summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-16 01:27:14 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-16 01:27:14 +0000
commita63c2657c94913d72b3cd388730d61edcb09fc69 (patch)
tree8762d1f992e2f725a6bde1ff966ed6f1e5f4f823
parent6484dceb0094998183c2f8d3c8c27c6f4e53b8a9 (diff)
downloadgcc-a63c2657c94913d72b3cd388730d61edcb09fc69.tar.gz
Major merge with Classpath.
Removed many duplicate files. * HACKING: Updated.x * classpath: Imported new directory. * standard.omit: New file. * Makefile.in, aclocal.m4, configure: Rebuilt. * sources.am: New file. * configure.ac: Run Classpath configure script. Moved code around to support. Disable xlib AWT peers (temporarily). * Makefile.am (SUBDIRS): Added 'classpath' (JAVAC): Removed. (AM_CPPFLAGS): Added more -I options. (BOOTCLASSPATH): Simplified. Completely redid how sources are built. Include sources.am. * include/Makefile.am (tool_include__HEADERS): Removed jni.h. * include/jni.h: Removed (in Classpath). * scripts/classes.pl: Updated to look at built classes. * scripts/makemake.tcl: New file. * testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Added -I options. (gcj_jni_invocation_compile_c_to_binary): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102082 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libjava/ChangeLog25
-rw-r--r--libjava/HACKING64
-rw-r--r--libjava/Makefile.am3396
-rw-r--r--libjava/Makefile.in9035
-rw-r--r--libjava/aclocal.m4510
-rwxr-xr-xlibjava/configure486
-rw-r--r--libjava/configure.ac321
-rw-r--r--libjava/external/Makefile.am47
-rw-r--r--libjava/external/Makefile.in633
-rw-r--r--libjava/external/README3
-rw-r--r--libjava/external/sax/Makefile.am76
-rw-r--r--libjava/external/sax/Makefile.in631
-rw-r--r--libjava/external/sax/README71
-rw-r--r--libjava/external/sax/org/xml/sax/AttributeList.java193
-rw-r--r--libjava/external/sax/org/xml/sax/Attributes.java257
-rw-r--r--libjava/external/sax/org/xml/sax/ContentHandler.java419
-rw-r--r--libjava/external/sax/org/xml/sax/DTDHandler.java117
-rw-r--r--libjava/external/sax/org/xml/sax/DocumentHandler.java232
-rw-r--r--libjava/external/sax/org/xml/sax/EntityResolver.java119
-rw-r--r--libjava/external/sax/org/xml/sax/ErrorHandler.java139
-rw-r--r--libjava/external/sax/org/xml/sax/HandlerBase.java369
-rw-r--r--libjava/external/sax/org/xml/sax/InputSource.java336
-rw-r--r--libjava/external/sax/org/xml/sax/Locator.java136
-rw-r--r--libjava/external/sax/org/xml/sax/Parser.java209
-rw-r--r--libjava/external/sax/org/xml/sax/SAXException.java153
-rw-r--r--libjava/external/sax/org/xml/sax/SAXNotRecognizedException.java53
-rw-r--r--libjava/external/sax/org/xml/sax/SAXNotSupportedException.java53
-rw-r--r--libjava/external/sax/org/xml/sax/SAXParseException.java269
-rw-r--r--libjava/external/sax/org/xml/sax/XMLFilter.java65
-rw-r--r--libjava/external/sax/org/xml/sax/XMLReader.java404
-rw-r--r--libjava/external/sax/org/xml/sax/ext/Attributes2.java132
-rw-r--r--libjava/external/sax/org/xml/sax/ext/Attributes2Impl.java301
-rw-r--r--libjava/external/sax/org/xml/sax/ext/DeclHandler.java146
-rw-r--r--libjava/external/sax/org/xml/sax/ext/DefaultHandler2.java130
-rw-r--r--libjava/external/sax/org/xml/sax/ext/EntityResolver2.java197
-rw-r--r--libjava/external/sax/org/xml/sax/ext/LexicalHandler.java212
-rw-r--r--libjava/external/sax/org/xml/sax/ext/Locator2.java75
-rw-r--r--libjava/external/sax/org/xml/sax/ext/Locator2Impl.java101
-rw-r--r--libjava/external/sax/org/xml/sax/ext/package.html46
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/AttributeListImpl.java312
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/AttributesImpl.java618
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/DefaultHandler.java467
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/LocatorImpl.java214
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/NamespaceSupport.java836
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/NewInstance.java79
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/ParserAdapter.java1046
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/ParserFactory.java129
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/XMLFilterImpl.java713
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java538
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/XMLReaderFactory.java202
-rw-r--r--libjava/external/sax/org/xml/sax/helpers/package.html11
-rw-r--r--libjava/external/sax/org/xml/sax/package.html297
-rw-r--r--libjava/external/w3c_dom/COPYRIGHT.html106
-rw-r--r--libjava/external/w3c_dom/Makefile.am186
-rw-r--r--libjava/external/w3c_dom/Makefile.in741
-rw-r--r--libjava/external/w3c_dom/README97
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/Attr.java275
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/CDATASection.java54
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/CharacterData.java153
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/Comment.java30
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DOMConfiguration.java413
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DOMError.java87
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DOMErrorHandler.java45
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DOMException.java131
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DOMImplementation.java136
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DOMImplementationList.java43
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DOMImplementationSource.java58
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DOMLocator.java58
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DOMStringList.java50
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/Document.java814
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DocumentFragment.java53
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/DocumentType.java83
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/Element.java439
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/Entity.java90
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/EntityReference.java43
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/NameList.java68
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/NamedNodeMap.java183
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/Node.java900
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/NodeList.java41
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/Notation.java40
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ProcessingInstruction.java51
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/Text.java126
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/TypeInfo.java185
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/UserDataHandler.java72
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/bootstrap/DOMImplementationRegistry.java387
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSS2Properties.java1777
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSCharsetRule.java51
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSFontFaceRule.java28
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSImportRule.java44
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSMediaRule.java76
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSPageRule.java44
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSPrimitiveValue.java296
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSRule.java97
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSRuleList.java43
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleDeclaration.java162
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleRule.java47
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleSheet.java85
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSUnknownRule.java22
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSValue.java71
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/CSSValueList.java46
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/Counter.java38
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/DOMImplementationCSS.java40
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/DocumentCSS.java50
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/ElementCSSInlineStyle.java32
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/RGBColor.java47
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/Rect.java44
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/css/ViewCSS.java43
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/events/DocumentEvent.java56
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/events/Event.java141
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/events/EventException.java36
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/events/EventListener.java41
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/events/EventTarget.java102
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/events/MouseEvent.java156
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/events/MutationEvent.java108
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/events/UIEvent.java58
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAnchorElement.java156
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAppletElement.java156
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAreaElement.java111
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBRElement.java31
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBaseElement.java40
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBaseFontElement.java56
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBodyElement.java94
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLButtonElement.java88
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLCollection.java59
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDListElement.java31
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDirectoryElement.java32
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDivElement.java31
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDocument.java237
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLElement.java87
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFieldSetElement.java28
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFontElement.java54
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFormElement.java116
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFrameElement.java117
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFrameSetElement.java42
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHRElement.java66
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHeadElement.java31
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHeadingElement.java32
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHtmlElement.java31
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLIFrameElement.java137
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLImageElement.java176
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLInputElement.java303
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLIsIndexElement.java39
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLIElement.java44
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLabelElement.java51
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLegendElement.java52
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLinkElement.java116
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMapElement.java36
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMenuElement.java32
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMetaElement.java63
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLModElement.java43
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOListElement.java53
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLObjectElement.java230
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptGroupElement.java43
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptionElement.java104
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptionsCollection.java68
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLParagraphElement.java31
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLParamElement.java67
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLPreElement.java31
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLQuoteElement.java32
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLScriptElement.java91
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLSelectElement.java179
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLStyleElement.java53
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableCaptionElement.java31
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableCellElement.java181
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableColElement.java85
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableElement.java254
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableRowElement.java130
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableSectionElement.java103
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTextAreaElement.java154
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTitleElement.java29
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/html2/HTMLUListElement.java42
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/DOMImplementationLS.java122
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/LSException.java47
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/LSInput.java218
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/LSLoadEvent.java35
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/LSOutput.java106
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/LSParser.java466
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/LSParserFilter.java172
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/LSProgressEvent.java48
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/LSResourceResolver.java81
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/LSSerializer.java436
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ls/LSSerializerFilter.java63
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ranges/DocumentRange.java33
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ranges/Range.java416
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/ranges/RangeException.java39
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/stylesheets/DocumentStyle.java34
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/stylesheets/LinkStyle.java31
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/stylesheets/MediaList.java85
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheet.java103
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheetList.java42
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/traversal/DocumentTraversal.java93
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/traversal/NodeFilter.java144
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/traversal/NodeIterator.java109
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/traversal/TreeWalker.java179
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/views/AbstractView.java27
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/views/DocumentView.java30
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/xpath/XPathEvaluator.java134
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/xpath/XPathException.java39
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/xpath/XPathExpression.java65
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/xpath/XPathNSResolver.java34
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/xpath/XPathNamespace.java67
-rw-r--r--libjava/external/w3c_dom/org/w3c/dom/xpath/XPathResult.java214
-rw-r--r--libjava/gcj/Makefile.in8
-rw-r--r--libjava/gnu/classpath/Configuration.java.in62
-rw-r--r--libjava/gnu/classpath/ServiceFactory.java573
-rw-r--r--libjava/gnu/classpath/ServiceProviderLoadingAction.java149
-rw-r--r--libjava/gnu/classpath/jdwp/exception/InvalidClassException.java63
-rw-r--r--libjava/gnu/classpath/jdwp/exception/InvalidCountException.java61
-rw-r--r--libjava/gnu/classpath/jdwp/exception/InvalidEventTypeException.java63
-rw-r--r--libjava/gnu/classpath/jdwp/exception/InvalidObjectException.java63
-rw-r--r--libjava/gnu/classpath/jdwp/exception/InvalidStringException.java63
-rw-r--r--libjava/gnu/classpath/jdwp/exception/InvalidThreadException.java63
-rw-r--r--libjava/gnu/classpath/jdwp/exception/InvalidThreadGroupException.java63
-rw-r--r--libjava/gnu/classpath/jdwp/exception/JdwpException.java86
-rw-r--r--libjava/gnu/classpath/jdwp/exception/JdwpInternalErrorException.java58
-rw-r--r--libjava/gnu/classpath/jdwp/exception/NotImplementedException.java59
-rw-r--r--libjava/gnu/classpath/jdwp/exception/VmDeadException.java55
-rw-r--r--libjava/gnu/classpath/jdwp/id/ArrayId.java62
-rw-r--r--libjava/gnu/classpath/jdwp/id/ArrayReferenceTypeId.java59
-rw-r--r--libjava/gnu/classpath/jdwp/id/ClassLoaderId.java64
-rw-r--r--libjava/gnu/classpath/jdwp/id/ClassObjectId.java64
-rw-r--r--libjava/gnu/classpath/jdwp/id/ClassReferenceTypeId.java59
-rw-r--r--libjava/gnu/classpath/jdwp/id/InterfaceReferenceTypeId.java59
-rw-r--r--libjava/gnu/classpath/jdwp/id/JdwpId.java127
-rw-r--r--libjava/gnu/classpath/jdwp/id/JdwpIdFactory.java165
-rw-r--r--libjava/gnu/classpath/jdwp/id/ObjectId.java99
-rw-r--r--libjava/gnu/classpath/jdwp/id/ReferenceTypeId.java81
-rw-r--r--libjava/gnu/classpath/jdwp/id/StringId.java64
-rw-r--r--libjava/gnu/classpath/jdwp/id/ThreadGroupId.java64
-rw-r--r--libjava/gnu/classpath/jdwp/id/ThreadId.java64
-rw-r--r--libjava/gnu/classpath/jdwp/processor/CommandSet.java68
-rw-r--r--libjava/gnu/classpath/jdwp/processor/FieldCommandSet.java66
-rw-r--r--libjava/gnu/classpath/jdwp/processor/InterfaceTypeCommandSet.java67
-rw-r--r--libjava/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java249
-rw-r--r--libjava/gnu/classpath/jdwp/processor/PacketProcessor.java216
-rw-r--r--libjava/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java321
-rw-r--r--libjava/gnu/classpath/jdwp/processor/StringReferenceCommandSet.java98
-rw-r--r--libjava/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java474
-rw-r--r--libjava/gnu/classpath/jdwp/transport/ITransport.java84
-rw-r--r--libjava/gnu/classpath/jdwp/transport/JdwpCommandPacket.java149
-rw-r--r--libjava/gnu/classpath/jdwp/transport/JdwpConnection.java298
-rw-r--r--libjava/gnu/classpath/jdwp/transport/JdwpPacket.java278
-rw-r--r--libjava/gnu/classpath/jdwp/transport/JdwpReplyPacket.java137
-rw-r--r--libjava/gnu/classpath/jdwp/transport/SocketTransport.java171
-rw-r--r--libjava/gnu/classpath/jdwp/transport/TransportException.java75
-rw-r--r--libjava/gnu/classpath/jdwp/transport/TransportFactory.java115
-rw-r--r--libjava/gnu/classpath/jdwp/util/JdwpString.java95
-rw-r--r--libjava/gnu/classpath/jdwp/util/Signature.java149
-rw-r--r--libjava/gnu/java/awt/BitMaskExtent.java79
-rw-r--r--libjava/gnu/java/awt/BitwiseXORComposite.java295
-rw-r--r--libjava/gnu/java/awt/Buffers.java243
-rw-r--r--libjava/gnu/java/awt/ClasspathToolkit.java369
-rw-r--r--libjava/gnu/java/awt/ComponentDataBlitOp.java156
-rw-r--r--libjava/gnu/java/awt/EmbeddedWindow.java143
-rw-r--r--libjava/gnu/java/awt/EmbeddedWindowSupport.java65
-rw-r--r--libjava/gnu/java/awt/EventModifier.java107
-rw-r--r--libjava/gnu/java/awt/color/CieXyzConverter.java73
-rw-r--r--libjava/gnu/java/awt/color/ClutProfileConverter.java152
-rw-r--r--libjava/gnu/java/awt/color/ColorLookUpTable.java429
-rw-r--r--libjava/gnu/java/awt/color/ColorSpaceConverter.java69
-rw-r--r--libjava/gnu/java/awt/color/GrayProfileConverter.java137
-rw-r--r--libjava/gnu/java/awt/color/GrayScaleConverter.java110
-rw-r--r--libjava/gnu/java/awt/color/LinearRGBConverter.java152
-rw-r--r--libjava/gnu/java/awt/color/ProfileHeader.java398
-rw-r--r--libjava/gnu/java/awt/color/PyccConverter.java72
-rw-r--r--libjava/gnu/java/awt/color/RgbProfileConverter.java244
-rw-r--r--libjava/gnu/java/awt/color/SrgbConverter.java152
-rw-r--r--libjava/gnu/java/awt/color/TagEntry.java121
-rw-r--r--libjava/gnu/java/awt/color/ToneReproductionCurve.java177
-rw-r--r--libjava/gnu/java/awt/doc-files/BitwiseXORComposite-1.pngbin8845 -> 0 bytes
-rw-r--r--libjava/gnu/java/awt/image/ImageDecoder.java156
-rw-r--r--libjava/gnu/java/awt/image/XBMDecoder.java155
-rw-r--r--libjava/gnu/java/awt/peer/ClasspathFontPeer.java846
-rw-r--r--libjava/gnu/java/awt/peer/ClasspathTextLayoutPeer.java104
-rw-r--r--libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java47
-rw-r--r--libjava/gnu/java/awt/peer/GLightweightPeer.java298
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GThreadMutex.java109
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java303
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java134
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkFontPeer.java307
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGlyphVector.java359
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphics.java487
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java1449
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java138
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java107
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java675
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkRobotPeer.java94
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java115
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkTextLayout.java434
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java107
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java100
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java86
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java69
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java128
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java128
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkClipboard.java170
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java662
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java151
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java94
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java73
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java219
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java225
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java275
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java93
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkImage.java344
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java267
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java84
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkListPeer.java180
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java80
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java63
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java120
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java103
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java93
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java68
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java74
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java113
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java80
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java178
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java87
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java162
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkToolkit.java670
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkVolatileImage.java118
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java210
-rw-r--r--libjava/gnu/java/awt/peer/gtk/Test.java299
-rw-r--r--libjava/gnu/java/awt/peer/gtk/TestAWT.java613
-rw-r--r--libjava/gnu/java/beans/BeanInfoEmbryo.java171
-rw-r--r--libjava/gnu/java/beans/DummyAppletContext.java200
-rw-r--r--libjava/gnu/java/beans/DummyAppletStub.java115
-rw-r--r--libjava/gnu/java/beans/ExplicitBeanInfo.java149
-rw-r--r--libjava/gnu/java/beans/IntrospectionIncubator.java441
-rw-r--r--libjava/gnu/java/beans/decoder/AbstractContext.java70
-rw-r--r--libjava/gnu/java/beans/decoder/AbstractCreatableObjectContext.java113
-rw-r--r--libjava/gnu/java/beans/decoder/AbstractElementHandler.java316
-rw-r--r--libjava/gnu/java/beans/decoder/AbstractObjectContext.java127
-rw-r--r--libjava/gnu/java/beans/decoder/ArrayContext.java122
-rw-r--r--libjava/gnu/java/beans/decoder/ArrayHandler.java118
-rw-r--r--libjava/gnu/java/beans/decoder/AssemblyException.java57
-rw-r--r--libjava/gnu/java/beans/decoder/BooleanHandler.java67
-rw-r--r--libjava/gnu/java/beans/decoder/ByteHandler.java59
-rw-r--r--libjava/gnu/java/beans/decoder/CharHandler.java62
-rw-r--r--libjava/gnu/java/beans/decoder/ClassHandler.java66
-rw-r--r--libjava/gnu/java/beans/decoder/ConstructorContext.java102
-rw-r--r--libjava/gnu/java/beans/decoder/Context.java137
-rw-r--r--libjava/gnu/java/beans/decoder/DecoderContext.java124
-rw-r--r--libjava/gnu/java/beans/decoder/DefaultExceptionListener.java57
-rw-r--r--libjava/gnu/java/beans/decoder/DoubleHandler.java59
-rw-r--r--libjava/gnu/java/beans/decoder/DummyContext.java116
-rw-r--r--libjava/gnu/java/beans/decoder/DummyHandler.java156
-rw-r--r--libjava/gnu/java/beans/decoder/ElementHandler.java130
-rw-r--r--libjava/gnu/java/beans/decoder/FloatHandler.java59
-rw-r--r--libjava/gnu/java/beans/decoder/GrowableArrayContext.java138
-rw-r--r--libjava/gnu/java/beans/decoder/IndexContext.java130
-rw-r--r--libjava/gnu/java/beans/decoder/IntHandler.java59
-rw-r--r--libjava/gnu/java/beans/decoder/JavaHandler.java93
-rw-r--r--libjava/gnu/java/beans/decoder/LongHandler.java59
-rw-r--r--libjava/gnu/java/beans/decoder/MethodContext.java107
-rw-r--r--libjava/gnu/java/beans/decoder/MethodFinder.java177
-rw-r--r--libjava/gnu/java/beans/decoder/NullHandler.java62
-rw-r--r--libjava/gnu/java/beans/decoder/ObjectContext.java100
-rw-r--r--libjava/gnu/java/beans/decoder/ObjectHandler.java169
-rw-r--r--libjava/gnu/java/beans/decoder/PersistenceParser.java485
-rw-r--r--libjava/gnu/java/beans/decoder/PropertyContext.java137
-rw-r--r--libjava/gnu/java/beans/decoder/ShortHandler.java58
-rw-r--r--libjava/gnu/java/beans/decoder/SimpleHandler.java111
-rw-r--r--libjava/gnu/java/beans/decoder/StaticMethodContext.java95
-rw-r--r--libjava/gnu/java/beans/decoder/StringHandler.java54
-rw-r--r--libjava/gnu/java/beans/decoder/VoidHandler.java140
-rw-r--r--libjava/gnu/java/beans/editors/ColorEditor.java100
-rw-r--r--libjava/gnu/java/beans/editors/FontEditor.java77
-rw-r--r--libjava/gnu/java/beans/editors/NativeBooleanEditor.java76
-rw-r--r--libjava/gnu/java/beans/editors/NativeByteEditor.java61
-rw-r--r--libjava/gnu/java/beans/editors/NativeDoubleEditor.java61
-rw-r--r--libjava/gnu/java/beans/editors/NativeFloatEditor.java61
-rw-r--r--libjava/gnu/java/beans/editors/NativeIntEditor.java61
-rw-r--r--libjava/gnu/java/beans/editors/NativeLongEditor.java61
-rw-r--r--libjava/gnu/java/beans/editors/NativeShortEditor.java61
-rw-r--r--libjava/gnu/java/beans/editors/StringEditor.java61
-rw-r--r--libjava/gnu/java/io/ASN1ParsingException.java56
-rw-r--r--libjava/gnu/java/io/Base64InputStream.java216
-rw-r--r--libjava/gnu/java/io/ClassLoaderObjectInputStream.java73
-rw-r--r--libjava/gnu/java/io/NullOutputStream.java56
-rw-r--r--libjava/gnu/java/io/ObjectIdentityWrapper.java100
-rw-r--r--libjava/gnu/java/lang/ArrayHelper.java78
-rw-r--r--libjava/gnu/java/lang/CharData.java1001
-rw-r--r--libjava/gnu/java/lang/ClassHelper.java177
-rw-r--r--libjava/gnu/java/lang/reflect/TypeSignature.java288
-rw-r--r--libjava/gnu/java/math/MPN.java771
-rw-r--r--libjava/gnu/java/net/BASE64.java190
-rw-r--r--libjava/gnu/java/net/CRLFInputStream.java174
-rw-r--r--libjava/gnu/java/net/CRLFOutputStream.java183
-rw-r--r--libjava/gnu/java/net/EmptyX509TrustManager.java70
-rw-r--r--libjava/gnu/java/net/GetLocalHostAction.java65
-rw-r--r--libjava/gnu/java/net/HeaderFieldHelper.java138
-rw-r--r--libjava/gnu/java/net/LineInputStream.java198
-rw-r--r--libjava/gnu/java/net/URLParseError.java57
-rw-r--r--libjava/gnu/java/net/protocol/ftp/ActiveModeDTP.java251
-rw-r--r--libjava/gnu/java/net/protocol/ftp/BlockInputStream.java150
-rw-r--r--libjava/gnu/java/net/protocol/ftp/BlockOutputStream.java111
-rw-r--r--libjava/gnu/java/net/protocol/ftp/CompressedInputStream.java215
-rw-r--r--libjava/gnu/java/net/protocol/ftp/CompressedOutputStream.java228
-rw-r--r--libjava/gnu/java/net/protocol/ftp/DTP.java92
-rw-r--r--libjava/gnu/java/net/protocol/ftp/DTPInputStream.java88
-rw-r--r--libjava/gnu/java/net/protocol/ftp/DTPOutputStream.java85
-rw-r--r--libjava/gnu/java/net/protocol/ftp/FTPConnection.java1348
-rw-r--r--libjava/gnu/java/net/protocol/ftp/FTPException.java76
-rw-r--r--libjava/gnu/java/net/protocol/ftp/FTPResponse.java112
-rw-r--r--libjava/gnu/java/net/protocol/ftp/FTPURLConnection.java398
-rw-r--r--libjava/gnu/java/net/protocol/ftp/Handler.java70
-rw-r--r--libjava/gnu/java/net/protocol/ftp/PassiveModeDTP.java201
-rw-r--r--libjava/gnu/java/net/protocol/ftp/StreamInputStream.java95
-rw-r--r--libjava/gnu/java/net/protocol/ftp/StreamOutputStream.java85
-rw-r--r--libjava/gnu/java/net/protocol/http/Authenticator.java59
-rw-r--r--libjava/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java107
-rw-r--r--libjava/gnu/java/net/protocol/http/ByteArrayResponseBodyReader.java123
-rw-r--r--libjava/gnu/java/net/protocol/http/ChunkedInputStream.java172
-rw-r--r--libjava/gnu/java/net/protocol/http/Cookie.java160
-rw-r--r--libjava/gnu/java/net/protocol/http/CookieManager.java65
-rw-r--r--libjava/gnu/java/net/protocol/http/Credentials.java88
-rw-r--r--libjava/gnu/java/net/protocol/http/HTTPConnection.java681
-rw-r--r--libjava/gnu/java/net/protocol/http/HTTPDateFormat.java441
-rw-r--r--libjava/gnu/java/net/protocol/http/HTTPURLConnection.java682
-rw-r--r--libjava/gnu/java/net/protocol/http/Handler.java73
-rw-r--r--libjava/gnu/java/net/protocol/http/Headers.java369
-rw-r--r--libjava/gnu/java/net/protocol/http/Request.java914
-rw-r--r--libjava/gnu/java/net/protocol/http/RequestBodyWriter.java69
-rw-r--r--libjava/gnu/java/net/protocol/http/Response.java185
-rw-r--r--libjava/gnu/java/net/protocol/http/ResponseBodyReader.java70
-rw-r--r--libjava/gnu/java/net/protocol/http/ResponseHeaderHandler.java57
-rw-r--r--libjava/gnu/java/net/protocol/http/SimpleCookieManager.java140
-rw-r--r--libjava/gnu/java/net/protocol/http/event/ConnectionEvent.java81
-rw-r--r--libjava/gnu/java/net/protocol/http/event/ConnectionListener.java58
-rw-r--r--libjava/gnu/java/net/protocol/http/event/RequestEvent.java107
-rw-r--r--libjava/gnu/java/net/protocol/http/event/RequestListener.java70
-rw-r--r--libjava/gnu/java/net/protocol/https/Handler.java76
-rw-r--r--libjava/gnu/java/net/protocol/jar/Handler.java169
-rw-r--r--libjava/gnu/java/nio/ChannelInputStream.java79
-rw-r--r--libjava/gnu/java/nio/ChannelOutputStream.java67
-rw-r--r--libjava/gnu/java/nio/ChannelReader.java211
-rw-r--r--libjava/gnu/java/nio/FileLockImpl.java82
-rw-r--r--libjava/gnu/java/nio/InputStreamChannel.java88
-rw-r--r--libjava/gnu/java/nio/NIOConstants.java47
-rw-r--r--libjava/gnu/java/nio/NIODatagramSocket.java71
-rw-r--r--libjava/gnu/java/nio/NIOSocket.java77
-rw-r--r--libjava/gnu/java/nio/OutputStreamChannel.java87
-rw-r--r--libjava/gnu/java/nio/PipeImpl.java184
-rw-r--r--libjava/gnu/java/nio/SelectionKeyImpl.java104
-rw-r--r--libjava/gnu/java/nio/SelectorImpl.java394
-rw-r--r--libjava/gnu/java/nio/SelectorProviderImpl.java83
-rw-r--r--libjava/gnu/java/nio/charset/ISO_8859_1.java155
-rw-r--r--libjava/gnu/java/nio/charset/US_ASCII.java161
-rw-r--r--libjava/gnu/java/nio/charset/UTF_16.java80
-rw-r--r--libjava/gnu/java/nio/charset/UTF_16BE.java84
-rw-r--r--libjava/gnu/java/nio/charset/UTF_16Decoder.java151
-rw-r--r--libjava/gnu/java/nio/charset/UTF_16Encoder.java153
-rw-r--r--libjava/gnu/java/nio/charset/UTF_16LE.java83
-rw-r--r--libjava/gnu/java/nio/charset/UTF_8.java289
-rw-r--r--libjava/gnu/java/rmi/RMIMarshalledObjectInputStream.java71
-rw-r--r--libjava/gnu/java/rmi/RMIMarshalledObjectOutputStream.java79
-rw-r--r--libjava/gnu/java/rmi/dgc/DGCImpl.java118
-rw-r--r--libjava/gnu/java/rmi/dgc/DGCImpl_Skel.java144
-rw-r--r--libjava/gnu/java/rmi/dgc/DGCImpl_Stub.java158
-rw-r--r--libjava/gnu/java/rmi/registry/RegistryImpl.java154
-rw-r--r--libjava/gnu/java/rmi/registry/RegistryImpl_Skel.java227
-rw-r--r--libjava/gnu/java/rmi/registry/RegistryImpl_Stub.java293
-rw-r--r--libjava/gnu/java/rmi/server/ConnectionRunnerPool.java156
-rw-r--r--libjava/gnu/java/rmi/server/ProtocolConstants.java62
-rw-r--r--libjava/gnu/java/rmi/server/RMIDefaultSocketFactory.java59
-rw-r--r--libjava/gnu/java/rmi/server/RMIHashes.java98
-rw-r--r--libjava/gnu/java/rmi/server/RMIIncomingThread.java58
-rw-r--r--libjava/gnu/java/rmi/server/RMIObjectInputStream.java126
-rw-r--r--libjava/gnu/java/rmi/server/RMIObjectOutputStream.java114
-rw-r--r--libjava/gnu/java/rmi/server/RMIVoidValue.java51
-rw-r--r--libjava/gnu/java/rmi/server/UnicastConnection.java231
-rw-r--r--libjava/gnu/java/rmi/server/UnicastConnectionManager.java446
-rw-r--r--libjava/gnu/java/rmi/server/UnicastRef.java278
-rw-r--r--libjava/gnu/java/rmi/server/UnicastRemoteCall.java525
-rw-r--r--libjava/gnu/java/rmi/server/UnicastRemoteStub.java50
-rw-r--r--libjava/gnu/java/rmi/server/UnicastServer.java167
-rw-r--r--libjava/gnu/java/rmi/server/UnicastServerRef.java306
-rw-r--r--libjava/gnu/java/security/Engine.java237
-rw-r--r--libjava/gnu/java/security/OID.java509
-rw-r--r--libjava/gnu/java/security/PolicyFile.java667
-rw-r--r--libjava/gnu/java/security/action/GetPropertyAction.java89
-rw-r--r--libjava/gnu/java/security/action/GetSecurityPropertyAction.java93
-rw-r--r--libjava/gnu/java/security/action/SetAccessibleAction.java77
-rw-r--r--libjava/gnu/java/security/ber/BER.java46
-rw-r--r--libjava/gnu/java/security/ber/BEREncodingException.java54
-rw-r--r--libjava/gnu/java/security/ber/BERReader.java103
-rw-r--r--libjava/gnu/java/security/ber/BERValue.java82
-rw-r--r--libjava/gnu/java/security/der/BitString.java317
-rw-r--r--libjava/gnu/java/security/der/DER.java86
-rw-r--r--libjava/gnu/java/security/der/DEREncodingException.java54
-rw-r--r--libjava/gnu/java/security/der/DERReader.java437
-rw-r--r--libjava/gnu/java/security/der/DERValue.java170
-rw-r--r--libjava/gnu/java/security/der/DERWriter.java349
-rw-r--r--libjava/gnu/java/security/pkcs/PKCS7SignedData.java364
-rw-r--r--libjava/gnu/java/security/pkcs/SignerInfo.java279
-rw-r--r--libjava/gnu/java/security/provider/CollectionCertStoreImpl.java102
-rw-r--r--libjava/gnu/java/security/provider/DSAKeyFactory.java134
-rw-r--r--libjava/gnu/java/security/provider/DSAKeyPairGenerator.java171
-rw-r--r--libjava/gnu/java/security/provider/DSAParameterGenerator.java128
-rw-r--r--libjava/gnu/java/security/provider/DSAParameters.java150
-rw-r--r--libjava/gnu/java/security/provider/DSASignature.java251
-rw-r--r--libjava/gnu/java/security/provider/DefaultPolicy.java68
-rw-r--r--libjava/gnu/java/security/provider/EncodedKeyFactory.java303
-rw-r--r--libjava/gnu/java/security/provider/Gnu.java168
-rw-r--r--libjava/gnu/java/security/provider/GnuDHPublicKey.java115
-rw-r--r--libjava/gnu/java/security/provider/GnuDSAPrivateKey.java147
-rw-r--r--libjava/gnu/java/security/provider/GnuDSAPublicKey.java137
-rw-r--r--libjava/gnu/java/security/provider/GnuRSAPrivateKey.java164
-rw-r--r--libjava/gnu/java/security/provider/GnuRSAPublicKey.java109
-rw-r--r--libjava/gnu/java/security/provider/MD2withRSA.java54
-rw-r--r--libjava/gnu/java/security/provider/MD4withRSA.java54
-rw-r--r--libjava/gnu/java/security/provider/MD5.java338
-rw-r--r--libjava/gnu/java/security/provider/MD5withRSA.java54
-rw-r--r--libjava/gnu/java/security/provider/PKIXCertPathValidatorImpl.java701
-rw-r--r--libjava/gnu/java/security/provider/RSA.java311
-rw-r--r--libjava/gnu/java/security/provider/RSAKeyFactory.java181
-rw-r--r--libjava/gnu/java/security/provider/SHA.java242
-rw-r--r--libjava/gnu/java/security/provider/SHA1PRNG.java126
-rw-r--r--libjava/gnu/java/security/provider/SHA1withRSA.java61
-rw-r--r--libjava/gnu/java/security/provider/X509CertificateFactory.java305
-rw-r--r--libjava/gnu/java/security/util/Prime.java164
-rw-r--r--libjava/gnu/java/security/x509/GnuPKIExtension.java59
-rw-r--r--libjava/gnu/java/security/x509/PolicyNodeImpl.java214
-rw-r--r--libjava/gnu/java/security/x509/Util.java202
-rw-r--r--libjava/gnu/java/security/x509/X500DistinguishedName.java548
-rw-r--r--libjava/gnu/java/security/x509/X509CRL.java476
-rw-r--r--libjava/gnu/java/security/x509/X509CRLEntry.java278
-rw-r--r--libjava/gnu/java/security/x509/X509CRLSelectorImpl.java138
-rw-r--r--libjava/gnu/java/security/x509/X509CertPath.java303
-rw-r--r--libjava/gnu/java/security/x509/X509CertSelectorImpl.java197
-rw-r--r--libjava/gnu/java/security/x509/X509Certificate.java743
-rw-r--r--libjava/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java133
-rw-r--r--libjava/gnu/java/security/x509/ext/BasicConstraints.java129
-rw-r--r--libjava/gnu/java/security/x509/ext/CRLNumber.java97
-rw-r--r--libjava/gnu/java/security/x509/ext/CertificatePolicies.java189
-rw-r--r--libjava/gnu/java/security/x509/ext/ExtendedKeyUsage.java95
-rw-r--r--libjava/gnu/java/security/x509/ext/Extension.java289
-rw-r--r--libjava/gnu/java/security/x509/ext/GeneralNames.java155
-rw-r--r--libjava/gnu/java/security/x509/ext/IssuerAlternativeNames.java77
-rw-r--r--libjava/gnu/java/security/x509/ext/KeyUsage.java92
-rw-r--r--libjava/gnu/java/security/x509/ext/PolicyConstraint.java107
-rw-r--r--libjava/gnu/java/security/x509/ext/PolicyMappings.java104
-rw-r--r--libjava/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java105
-rw-r--r--libjava/gnu/java/security/x509/ext/ReasonCode.java85
-rw-r--r--libjava/gnu/java/security/x509/ext/SubjectAlternativeNames.java77
-rw-r--r--libjava/gnu/java/security/x509/ext/SubjectKeyIdentifier.java84
-rw-r--r--libjava/gnu/java/text/AttributedFormatBuffer.java247
-rw-r--r--libjava/gnu/java/text/BaseBreakIterator.java121
-rw-r--r--libjava/gnu/java/text/CharacterBreakIterator.java213
-rw-r--r--libjava/gnu/java/text/FormatBuffer.java136
-rw-r--r--libjava/gnu/java/text/FormatCharacterIterator.java534
-rw-r--r--libjava/gnu/java/text/LineBreakIterator.java194
-rw-r--r--libjava/gnu/java/text/SentenceBreakIterator.java247
-rw-r--r--libjava/gnu/java/text/StringFormatBuffer.java121
-rw-r--r--libjava/gnu/java/text/WordBreakIterator.java250
-rw-r--r--libjava/gnu/java/util/DoubleEnumeration.java138
-rw-r--r--libjava/gnu/java/util/EmptyEnumeration.java96
-rw-r--r--libjava/gnu/java/util/prefs/FileBasedFactory.java57
-rw-r--r--libjava/gnu/java/util/prefs/MemoryBasedFactory.java64
-rw-r--r--libjava/gnu/java/util/prefs/MemoryBasedPreferences.java144
-rw-r--r--libjava/gnu/java/util/prefs/NodeReader.java223
-rw-r--r--libjava/gnu/java/util/prefs/NodeWriter.java315
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/HTML_401F.java3729
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/gnuDTD.java422
-rw-r--r--libjava/gnu/javax/swing/text/html/parser/htmlAttributeSet.java133
-rw-r--r--libjava/gnu/javax/swing/text/html/parser/htmlValidator.java610
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.java62
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/models/TableRowContentModel.java77
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/models/list.java382
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/models/noTagModel.java75
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/models/node.java337
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/models/transformer.java201
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/support/Parser.java1443
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.java112
-rw-r--r--libjava/gnu/javax/swing/text/html/parser/support/low/Buffer.java238
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/support/low/Constants.java422
-rw-r--r--libjava/gnu/javax/swing/text/html/parser/support/low/Location.java83
-rw-r--r--libjava/gnu/javax/swing/text/html/parser/support/low/ParseException.java51
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/support/low/Queue.java142
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.java374
-rw-r--r--libjava/gnu/javax/swing/text/html/parser/support/low/Token.java169
-rw-r--r--libjava/gnu/javax/swing/text/html/parser/support/low/node.java78
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/support/low/pattern.java105
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/support/parameterDefaulter.java106
-rwxr-xr-xlibjava/gnu/javax/swing/text/html/parser/support/textPreProcessor.java193
-rw-r--r--libjava/gnu/regexp/CharIndexed.java84
-rw-r--r--libjava/gnu/regexp/CharIndexedCharArray.java62
-rw-r--r--libjava/gnu/regexp/CharIndexedInputStream.java149
-rw-r--r--libjava/gnu/regexp/CharIndexedString.java64
-rw-r--r--libjava/gnu/regexp/CharIndexedStringBuffer.java62
-rw-r--r--libjava/gnu/regexp/RE.java1394
-rw-r--r--libjava/gnu/regexp/REException.java182
-rw-r--r--libjava/gnu/regexp/REFilterInputStream.java140
-rw-r--r--libjava/gnu/regexp/REMatch.java263
-rw-r--r--libjava/gnu/regexp/REMatchEnumeration.java135
-rw-r--r--libjava/gnu/regexp/RESyntax.java527
-rw-r--r--libjava/gnu/regexp/REToken.java86
-rw-r--r--libjava/gnu/regexp/RETokenAny.java73
-rw-r--r--libjava/gnu/regexp/RETokenBackRef.java72
-rw-r--r--libjava/gnu/regexp/RETokenChar.java91
-rw-r--r--libjava/gnu/regexp/RETokenEnd.java75
-rw-r--r--libjava/gnu/regexp/RETokenEndSub.java53
-rw-r--r--libjava/gnu/regexp/RETokenLookAhead.java87
-rw-r--r--libjava/gnu/regexp/RETokenOneOf.java130
-rw-r--r--libjava/gnu/regexp/RETokenPOSIX.java144
-rw-r--r--libjava/gnu/regexp/RETokenRange.java69
-rw-r--r--libjava/gnu/regexp/RETokenRepeated.java240
-rw-r--r--libjava/gnu/regexp/RETokenStart.java87
-rw-r--r--libjava/gnu/regexp/RETokenWordBoundary.java104
-rw-r--r--libjava/gnu/regexp/UncheckedRE.java109
-rw-r--r--libjava/gnu/xml/aelfred2/ContentHandler2.java65
-rw-r--r--libjava/gnu/xml/aelfred2/JAXPFactory.java231
-rw-r--r--libjava/gnu/xml/aelfred2/SAXDriver.java1622
-rw-r--r--libjava/gnu/xml/aelfred2/XmlParser.java5835
-rw-r--r--libjava/gnu/xml/aelfred2/XmlReader.java374
-rw-r--r--libjava/gnu/xml/dom/Consumer.java368
-rw-r--r--libjava/gnu/xml/dom/DTDAttributeTypeInfo.java84
-rw-r--r--libjava/gnu/xml/dom/DTDElementTypeInfo.java112
-rw-r--r--libjava/gnu/xml/dom/DomAttr.java380
-rw-r--r--libjava/gnu/xml/dom/DomCDATASection.java91
-rw-r--r--libjava/gnu/xml/dom/DomCharacterData.java310
-rw-r--r--libjava/gnu/xml/dom/DomComment.java81
-rw-r--r--libjava/gnu/xml/dom/DomDOMException.java175
-rw-r--r--libjava/gnu/xml/dom/DomDoctype.java455
-rw-r--r--libjava/gnu/xml/dom/DomDocument.java1387
-rw-r--r--libjava/gnu/xml/dom/DomDocumentBuilder.java159
-rw-r--r--libjava/gnu/xml/dom/DomDocumentBuilderFactory.java128
-rw-r--r--libjava/gnu/xml/dom/DomDocumentConfiguration.java260
-rw-r--r--libjava/gnu/xml/dom/DomDocumentFragment.java76
-rw-r--r--libjava/gnu/xml/dom/DomElement.java523
-rw-r--r--libjava/gnu/xml/dom/DomEntity.java147
-rw-r--r--libjava/gnu/xml/dom/DomEntityReference.java130
-rw-r--r--libjava/gnu/xml/dom/DomEvent.java345
-rw-r--r--libjava/gnu/xml/dom/DomExtern.java117
-rw-r--r--libjava/gnu/xml/dom/DomImpl.java278
-rw-r--r--libjava/gnu/xml/dom/DomIterator.java373
-rw-r--r--libjava/gnu/xml/dom/DomNSResolverContext.java90
-rw-r--r--libjava/gnu/xml/dom/DomNamedNodeMap.java417
-rw-r--r--libjava/gnu/xml/dom/DomNode.java2189
-rw-r--r--libjava/gnu/xml/dom/DomNodeIterator.java327
-rw-r--r--libjava/gnu/xml/dom/DomNotation.java103
-rw-r--r--libjava/gnu/xml/dom/DomNsNode.java200
-rw-r--r--libjava/gnu/xml/dom/DomProcessingInstruction.java147
-rw-r--r--libjava/gnu/xml/dom/DomText.java220
-rw-r--r--libjava/gnu/xml/dom/DomXPathExpression.java147
-rw-r--r--libjava/gnu/xml/dom/DomXPathNSResolver.java64
-rw-r--r--libjava/gnu/xml/dom/DomXPathResult.java233
-rw-r--r--libjava/gnu/xml/dom/ImplementationList.java70
-rw-r--r--libjava/gnu/xml/dom/ImplementationSource.java167
-rw-r--r--libjava/gnu/xml/dom/JAXPFactory.java286
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLAnchorElement.java189
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLAppletElement.java169
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLAreaElement.java139
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLBRElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLBaseElement.java79
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLBaseFontElement.java89
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLBodyElement.java119
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLButtonElement.java121
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLCollection.java218
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLDListElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLDirectoryElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLDivElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLDocument.java425
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLElement.java269
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLFieldSetElement.java65
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLFontElement.java89
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLFormElement.java150
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLFrameElement.java146
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLFrameSetElement.java79
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLHRElement.java99
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLHeadElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLHeadingElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLHtmlElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLIFrameElement.java166
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLImageElement.java179
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLImpl.java67
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLInputElement.java266
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLIsIndexElement.java75
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLLIElement.java79
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLLabelElement.java85
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLLegendElement.java85
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLLinkElement.java149
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLMapElement.java79
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLMenuElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLMetaElement.java99
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLModElement.java79
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLOListElement.java89
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLObjectElement.java242
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLOptGroupElement.java79
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLOptionElement.java131
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLParagraphElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLParamElement.java99
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLParser.java266
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLPreElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLQuoteElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLScriptElement.java129
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLSelectElement.java211
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLStyleElement.java89
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLTableCaptionElement.java70
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLTableCellElement.java205
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLTableColElement.java120
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLTableElement.java383
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLTableRowElement.java225
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLTableSectionElement.java158
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLTextAreaElement.java182
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLTitleElement.java69
-rw-r--r--libjava/gnu/xml/dom/html2/DomHTMLUListElement.java79
-rw-r--r--libjava/gnu/xml/dom/ls/DomLSException.java57
-rw-r--r--libjava/gnu/xml/dom/ls/DomLSInput.java158
-rw-r--r--libjava/gnu/xml/dom/ls/DomLSOutput.java98
-rw-r--r--libjava/gnu/xml/dom/ls/DomLSParser.java574
-rw-r--r--libjava/gnu/xml/dom/ls/DomLSSerializer.java354
-rw-r--r--libjava/gnu/xml/dom/ls/FilteredSAXEventSink.java354
-rw-r--r--libjava/gnu/xml/dom/ls/ReaderInputStream.java237
-rw-r--r--libjava/gnu/xml/dom/ls/SAXEventSink.java557
-rw-r--r--libjava/gnu/xml/dom/ls/WriterOutputStream.java98
-rw-r--r--libjava/gnu/xml/pipeline/CallFilter.java257
-rw-r--r--libjava/gnu/xml/pipeline/DomConsumer.java982
-rw-r--r--libjava/gnu/xml/pipeline/EventConsumer.java95
-rw-r--r--libjava/gnu/xml/pipeline/EventFilter.java809
-rw-r--r--libjava/gnu/xml/pipeline/LinkFilter.java242
-rw-r--r--libjava/gnu/xml/pipeline/NSFilter.java341
-rw-r--r--libjava/gnu/xml/pipeline/PipelineFactory.java723
-rw-r--r--libjava/gnu/xml/pipeline/TeeConsumer.java417
-rw-r--r--libjava/gnu/xml/pipeline/TextConsumer.java117
-rw-r--r--libjava/gnu/xml/pipeline/ValidationConsumer.java1929
-rw-r--r--libjava/gnu/xml/pipeline/WellFormednessFilter.java363
-rw-r--r--libjava/gnu/xml/pipeline/XIncludeFilter.java579
-rw-r--r--libjava/gnu/xml/pipeline/XsltFilter.java130
-rw-r--r--libjava/gnu/xml/transform/AbstractNumberNode.java321
-rw-r--r--libjava/gnu/xml/transform/ApplyImportsNode.java85
-rw-r--r--libjava/gnu/xml/transform/ApplyTemplatesNode.java193
-rw-r--r--libjava/gnu/xml/transform/AttributeNode.java246
-rw-r--r--libjava/gnu/xml/transform/AttributeSet.java67
-rw-r--r--libjava/gnu/xml/transform/Bindings.java242
-rw-r--r--libjava/gnu/xml/transform/CallTemplateNode.java130
-rw-r--r--libjava/gnu/xml/transform/ChooseNode.java93
-rw-r--r--libjava/gnu/xml/transform/CommentNode.java115
-rw-r--r--libjava/gnu/xml/transform/CopyNode.java179
-rw-r--r--libjava/gnu/xml/transform/CopyOfNode.java179
-rw-r--r--libjava/gnu/xml/transform/CurrentFunction.java98
-rw-r--r--libjava/gnu/xml/transform/DOMSourceLocator.java84
-rw-r--r--libjava/gnu/xml/transform/DocumentFunction.java243
-rw-r--r--libjava/gnu/xml/transform/ElementAvailableFunction.java169
-rw-r--r--libjava/gnu/xml/transform/ElementNode.java279
-rw-r--r--libjava/gnu/xml/transform/ErrorListenerErrorHandler.java101
-rw-r--r--libjava/gnu/xml/transform/ForEachNode.java149
-rw-r--r--libjava/gnu/xml/transform/FormatNumberFunction.java132
-rw-r--r--libjava/gnu/xml/transform/FunctionAvailableFunction.java175
-rw-r--r--libjava/gnu/xml/transform/GenerateIdFunction.java126
-rw-r--r--libjava/gnu/xml/transform/IfNode.java107
-rw-r--r--libjava/gnu/xml/transform/Key.java71
-rw-r--r--libjava/gnu/xml/transform/KeyFunction.java216
-rw-r--r--libjava/gnu/xml/transform/LiteralNode.java225
-rw-r--r--libjava/gnu/xml/transform/MessageNode.java97
-rw-r--r--libjava/gnu/xml/transform/NodeNumberNode.java258
-rw-r--r--libjava/gnu/xml/transform/NumberNode.java85
-rw-r--r--libjava/gnu/xml/transform/OtherwiseNode.java93
-rw-r--r--libjava/gnu/xml/transform/ParameterNode.java156
-rw-r--r--libjava/gnu/xml/transform/ProcessingInstructionNode.java123
-rw-r--r--libjava/gnu/xml/transform/SAXSerializer.java305
-rw-r--r--libjava/gnu/xml/transform/SortKey.java154
-rw-r--r--libjava/gnu/xml/transform/StreamSerializer.java632
-rw-r--r--libjava/gnu/xml/transform/Stylesheet.java1728
-rw-r--r--libjava/gnu/xml/transform/SystemPropertyFunction.java128
-rw-r--r--libjava/gnu/xml/transform/Template.java252
-rw-r--r--libjava/gnu/xml/transform/TemplateNode.java115
-rw-r--r--libjava/gnu/xml/transform/TemplatesImpl.java80
-rw-r--r--libjava/gnu/xml/transform/TextNode.java116
-rw-r--r--libjava/gnu/xml/transform/TransformerFactoryImpl.java345
-rw-r--r--libjava/gnu/xml/transform/TransformerImpl.java580
-rw-r--r--libjava/gnu/xml/transform/TransformerOutputProperties.java185
-rw-r--r--libjava/gnu/xml/transform/URIResolverEntityResolver.java83
-rw-r--r--libjava/gnu/xml/transform/UnparsedEntityUriFunction.java118
-rw-r--r--libjava/gnu/xml/transform/ValueOfNode.java126
-rw-r--r--libjava/gnu/xml/transform/WhenNode.java110
-rw-r--r--libjava/gnu/xml/transform/WithParam.java110
-rw-r--r--libjava/gnu/xml/transform/XSLComparator.java124
-rw-r--r--libjava/gnu/xml/transform/XSLURIResolver.java269
-rw-r--r--libjava/gnu/xml/util/DoParse.java300
-rw-r--r--libjava/gnu/xml/util/DomParser.java804
-rw-r--r--libjava/gnu/xml/util/Resolver.java263
-rw-r--r--libjava/gnu/xml/util/SAXNullTransformerFactory.java676
-rw-r--r--libjava/gnu/xml/util/XCat.java1609
-rw-r--r--libjava/gnu/xml/util/XHTMLWriter.java112
-rw-r--r--libjava/gnu/xml/util/XMLWriter.java1927
-rw-r--r--libjava/gnu/xml/xpath/AndExpr.java81
-rw-r--r--libjava/gnu/xml/xpath/ArithmeticExpr.java148
-rw-r--r--libjava/gnu/xml/xpath/BooleanFunction.java89
-rw-r--r--libjava/gnu/xml/xpath/CeilingFunction.java83
-rw-r--r--libjava/gnu/xml/xpath/ConcatFunction.java100
-rw-r--r--libjava/gnu/xml/xpath/Constant.java92
-rw-r--r--libjava/gnu/xml/xpath/ContainsFunction.java86
-rw-r--r--libjava/gnu/xml/xpath/CountFunction.java82
-rw-r--r--libjava/gnu/xml/xpath/DocumentOrderComparator.java63
-rw-r--r--libjava/gnu/xml/xpath/EqualityExpr.java258
-rw-r--r--libjava/gnu/xml/xpath/Expr.java474
-rw-r--r--libjava/gnu/xml/xpath/FalseFunction.java66
-rw-r--r--libjava/gnu/xml/xpath/FloorFunction.java83
-rw-r--r--libjava/gnu/xml/xpath/Function.java57
-rw-r--r--libjava/gnu/xml/xpath/FunctionCall.java150
-rw-r--r--libjava/gnu/xml/xpath/IdFunction.java96
-rw-r--r--libjava/gnu/xml/xpath/LangFunction.java110
-rw-r--r--libjava/gnu/xml/xpath/LastFunction.java67
-rw-r--r--libjava/gnu/xml/xpath/LocalNameFunction.java87
-rw-r--r--libjava/gnu/xml/xpath/NameFunction.java95
-rw-r--r--libjava/gnu/xml/xpath/NameTest.java131
-rw-r--r--libjava/gnu/xml/xpath/NamespaceTest.java118
-rw-r--r--libjava/gnu/xml/xpath/NamespaceUriFunction.java87
-rw-r--r--libjava/gnu/xml/xpath/NegativeExpr.java75
-rw-r--r--libjava/gnu/xml/xpath/NodeTypeTest.java130
-rw-r--r--libjava/gnu/xml/xpath/NormalizeSpaceFunction.java99
-rw-r--r--libjava/gnu/xml/xpath/NotFunction.java81
-rw-r--r--libjava/gnu/xml/xpath/NumberFunction.java96
-rw-r--r--libjava/gnu/xml/xpath/OrExpr.java81
-rw-r--r--libjava/gnu/xml/xpath/ParenthesizedExpr.java84
-rw-r--r--libjava/gnu/xml/xpath/Path.java54
-rw-r--r--libjava/gnu/xml/xpath/Pattern.java54
-rw-r--r--libjava/gnu/xml/xpath/PositionFunction.java67
-rw-r--r--libjava/gnu/xml/xpath/Predicate.java79
-rw-r--r--libjava/gnu/xml/xpath/RelationalExpr.java101
-rw-r--r--libjava/gnu/xml/xpath/Root.java81
-rw-r--r--libjava/gnu/xml/xpath/RoundFunction.java90
-rw-r--r--libjava/gnu/xml/xpath/Selector.java498
-rw-r--r--libjava/gnu/xml/xpath/StartsWithFunction.java86
-rw-r--r--libjava/gnu/xml/xpath/Steps.java240
-rw-r--r--libjava/gnu/xml/xpath/StringFunction.java113
-rw-r--r--libjava/gnu/xml/xpath/StringLengthFunction.java85
-rw-r--r--libjava/gnu/xml/xpath/SubstringAfterFunction.java92
-rw-r--r--libjava/gnu/xml/xpath/SubstringBeforeFunction.java91
-rw-r--r--libjava/gnu/xml/xpath/SubstringFunction.java122
-rw-r--r--libjava/gnu/xml/xpath/SumFunction.java94
-rw-r--r--libjava/gnu/xml/xpath/Test.java55
-rw-r--r--libjava/gnu/xml/xpath/TranslateFunction.java126
-rw-r--r--libjava/gnu/xml/xpath/TrueFunction.java66
-rw-r--r--libjava/gnu/xml/xpath/UnionExpr.java102
-rw-r--r--libjava/gnu/xml/xpath/VariableReference.java88
-rw-r--r--libjava/gnu/xml/xpath/XPathFactoryImpl.java90
-rw-r--r--libjava/gnu/xml/xpath/XPathImpl.java164
-rw-r--r--libjava/gnu/xml/xpath/XPathParser.java1461
-rw-r--r--libjava/gnu/xml/xpath/XPathTokenizer.java592
-rw-r--r--libjava/include/Makefile.am2
-rw-r--r--libjava/include/Makefile.in10
-rw-r--r--libjava/include/jni.h1599
-rw-r--r--libjava/java/applet/Applet.java523
-rw-r--r--libjava/java/applet/AppletContext.java154
-rw-r--r--libjava/java/applet/AppletStub.java103
-rw-r--r--libjava/java/applet/AudioClip.java68
-rw-r--r--libjava/java/awt/AWTError.java64
-rw-r--r--libjava/java/awt/AWTEvent.java286
-rw-r--r--libjava/java/awt/AWTEventMulticaster.java1209
-rw-r--r--libjava/java/awt/AWTException.java64
-rw-r--r--libjava/java/awt/AWTKeyStroke.java659
-rw-r--r--libjava/java/awt/AWTPermission.java121
-rw-r--r--libjava/java/awt/ActiveEvent.java61
-rw-r--r--libjava/java/awt/Adjustable.java171
-rw-r--r--libjava/java/awt/AlphaComposite.java167
-rw-r--r--libjava/java/awt/AttributeValue.java98
-rw-r--r--libjava/java/awt/BasicStroke.java248
-rw-r--r--libjava/java/awt/BorderLayout.java731
-rw-r--r--libjava/java/awt/BufferCapabilities.java251
-rw-r--r--libjava/java/awt/Button.java466
-rw-r--r--libjava/java/awt/Canvas.java365
-rw-r--r--libjava/java/awt/CardLayout.java483
-rw-r--r--libjava/java/awt/Checkbox.java649
-rw-r--r--libjava/java/awt/CheckboxGroup.java173
-rw-r--r--libjava/java/awt/CheckboxMenuItem.java355
-rw-r--r--libjava/java/awt/Choice.java638
-rw-r--r--libjava/java/awt/Color.java1008
-rw-r--r--libjava/java/awt/ColorPaintContext.java195
-rw-r--r--libjava/java/awt/Component.java6005
-rw-r--r--libjava/java/awt/ComponentOrientation.java215
-rw-r--r--libjava/java/awt/Composite.java73
-rw-r--r--libjava/java/awt/CompositeContext.java71
-rw-r--r--libjava/java/awt/Container.java2023
-rw-r--r--libjava/java/awt/ContainerOrderFocusTraversalPolicy.java413
-rw-r--r--libjava/java/awt/Cursor.java224
-rw-r--r--libjava/java/awt/DefaultFocusTraversalPolicy.java109
-rw-r--r--libjava/java/awt/DefaultKeyboardFocusManager.java503
-rw-r--r--libjava/java/awt/Dialog.java553
-rw-r--r--libjava/java/awt/Dimension.java234
-rw-r--r--libjava/java/awt/DisplayMode.java164
-rw-r--r--libjava/java/awt/Event.java185
-rw-r--r--libjava/java/awt/EventDispatchThread.java94
-rw-r--r--libjava/java/awt/EventQueue.java551
-rw-r--r--libjava/java/awt/FileDialog.java318
-rw-r--r--libjava/java/awt/FlowLayout.java364
-rw-r--r--libjava/java/awt/FocusTraversalPolicy.java103
-rw-r--r--libjava/java/awt/Font.java1335
-rw-r--r--libjava/java/awt/FontFormatException.java65
-rw-r--r--libjava/java/awt/FontMetrics.java425
-rw-r--r--libjava/java/awt/Frame.java649
-rw-r--r--libjava/java/awt/GradientPaint.java129
-rw-r--r--libjava/java/awt/Graphics.java767
-rw-r--r--libjava/java/awt/Graphics2D.java158
-rw-r--r--libjava/java/awt/GraphicsConfigTemplate.java106
-rw-r--r--libjava/java/awt/GraphicsConfiguration.java218
-rw-r--r--libjava/java/awt/GraphicsDevice.java290
-rw-r--r--libjava/java/awt/GraphicsEnvironment.java244
-rw-r--r--libjava/java/awt/GridBagConstraints.java195
-rw-r--r--libjava/java/awt/GridBagLayout.java1067
-rw-r--r--libjava/java/awt/GridBagLayoutInfo.java70
-rw-r--r--libjava/java/awt/GridLayout.java360
-rw-r--r--libjava/java/awt/HeadlessException.java72
-rw-r--r--libjava/java/awt/IllegalComponentStateException.java71
-rw-r--r--libjava/java/awt/Image.java203
-rw-r--r--libjava/java/awt/ImageCapabilities.java107
-rw-r--r--libjava/java/awt/Insets.java158
-rw-r--r--libjava/java/awt/ItemSelectable.java75
-rw-r--r--libjava/java/awt/JobAttributes.java500
-rw-r--r--libjava/java/awt/KeyEventDispatcher.java82
-rw-r--r--libjava/java/awt/KeyEventPostProcessor.java81
-rw-r--r--libjava/java/awt/KeyboardFocusManager.java1436
-rw-r--r--libjava/java/awt/Label.java314
-rw-r--r--libjava/java/awt/LayoutManager.java92
-rw-r--r--libjava/java/awt/LayoutManager2.java100
-rw-r--r--libjava/java/awt/List.java1263
-rw-r--r--libjava/java/awt/MediaTracker.java663
-rw-r--r--libjava/java/awt/Menu.java468
-rw-r--r--libjava/java/awt/MenuBar.java423
-rw-r--r--libjava/java/awt/MenuComponent.java1324
-rw-r--r--libjava/java/awt/MenuContainer.java71
-rw-r--r--libjava/java/awt/MenuItem.java603
-rw-r--r--libjava/java/awt/MenuShortcut.java207
-rw-r--r--libjava/java/awt/PageAttributes.java482
-rw-r--r--libjava/java/awt/Paint.java79
-rw-r--r--libjava/java/awt/PaintContext.java76
-rw-r--r--libjava/java/awt/Panel.java173
-rw-r--r--libjava/java/awt/Point.java245
-rw-r--r--libjava/java/awt/Polygon.java613
-rw-r--r--libjava/java/awt/PopupMenu.java169
-rw-r--r--libjava/java/awt/PrintGraphics.java57
-rw-r--r--libjava/java/awt/PrintJob.java102
-rw-r--r--libjava/java/awt/Rectangle.java749
-rw-r--r--libjava/java/awt/RenderingHints.java793
-rw-r--r--libjava/java/awt/Robot.java422
-rw-r--r--libjava/java/awt/ScrollPane.java615
-rw-r--r--libjava/java/awt/ScrollPaneAdjustable.java200
-rw-r--r--libjava/java/awt/Scrollbar.java825
-rw-r--r--libjava/java/awt/Shape.java203
-rw-r--r--libjava/java/awt/Stroke.java65
-rw-r--r--libjava/java/awt/SystemColor.java462
-rw-r--r--libjava/java/awt/TextArea.java629
-rw-r--r--libjava/java/awt/TextComponent.java739
-rw-r--r--libjava/java/awt/TextField.java541
-rw-r--r--libjava/java/awt/TexturePaint.java75
-rw-r--r--libjava/java/awt/Toolkit.java995
-rw-r--r--libjava/java/awt/Transparency.java67
-rw-r--r--libjava/java/awt/Window.java1132
-rw-r--r--libjava/java/awt/color/CMMException.java63
-rw-r--r--libjava/java/awt/color/ColorSpace.java183
-rw-r--r--libjava/java/awt/color/ICC_ColorSpace.java314
-rw-r--r--libjava/java/awt/color/ICC_Profile.java1244
-rw-r--r--libjava/java/awt/color/ICC_ProfileGray.java133
-rw-r--r--libjava/java/awt/color/ICC_ProfileRGB.java227
-rw-r--r--libjava/java/awt/color/ProfileDataException.java64
-rw-r--r--libjava/java/awt/datatransfer/Clipboard.java114
-rw-r--r--libjava/java/awt/datatransfer/ClipboardOwner.java57
-rw-r--r--libjava/java/awt/datatransfer/DataFlavor.java1034
-rw-r--r--libjava/java/awt/datatransfer/FlavorMap.java75
-rw-r--r--libjava/java/awt/datatransfer/FlavorTable.java73
-rw-r--r--libjava/java/awt/datatransfer/MimeTypeParseException.java70
-rw-r--r--libjava/java/awt/datatransfer/StringSelection.java158
-rw-r--r--libjava/java/awt/datatransfer/SystemFlavorMap.java169
-rw-r--r--libjava/java/awt/datatransfer/Transferable.java83
-rw-r--r--libjava/java/awt/datatransfer/UnsupportedFlavorException.java65
-rw-r--r--libjava/java/awt/dnd/Autoscroll.java70
-rw-r--r--libjava/java/awt/dnd/DnDConstants.java77
-rw-r--r--libjava/java/awt/dnd/DnDEventMulticaster.java74
-rw-r--r--libjava/java/awt/dnd/DragGestureEvent.java156
-rw-r--r--libjava/java/awt/dnd/DragGestureListener.java63
-rw-r--r--libjava/java/awt/dnd/DragGestureRecognizer.java179
-rw-r--r--libjava/java/awt/dnd/DragSource.java257
-rw-r--r--libjava/java/awt/dnd/DragSourceAdapter.java126
-rw-r--r--libjava/java/awt/dnd/DragSourceContext.java200
-rw-r--r--libjava/java/awt/dnd/DragSourceDragEvent.java102
-rw-r--r--libjava/java/awt/dnd/DragSourceDropEvent.java89
-rw-r--r--libjava/java/awt/dnd/DragSourceEvent.java93
-rw-r--r--libjava/java/awt/dnd/DragSourceListener.java97
-rw-r--r--libjava/java/awt/dnd/DragSourceMotionListener.java64
-rw-r--r--libjava/java/awt/dnd/DropTarget.java293
-rw-r--r--libjava/java/awt/dnd/DropTargetAdapter.java100
-rw-r--r--libjava/java/awt/dnd/DropTargetContext.java188
-rw-r--r--libjava/java/awt/dnd/DropTargetDragEvent.java140
-rw-r--r--libjava/java/awt/dnd/DropTargetDropEvent.java170
-rw-r--r--libjava/java/awt/dnd/DropTargetEvent.java56
-rw-r--r--libjava/java/awt/dnd/DropTargetListener.java89
-rw-r--r--libjava/java/awt/dnd/InvalidDnDOperationException.java73
-rw-r--r--libjava/java/awt/dnd/MouseDragGestureRecognizer.java131
-rw-r--r--libjava/java/awt/dnd/peer/DragSourceContextPeer.java57
-rw-r--r--libjava/java/awt/dnd/peer/DropTargetContextPeer.java68
-rw-r--r--libjava/java/awt/dnd/peer/DropTargetPeer.java48
-rw-r--r--libjava/java/awt/event/AWTEventListener.java64
-rw-r--r--libjava/java/awt/event/AWTEventListenerProxy.java154
-rw-r--r--libjava/java/awt/event/ActionEvent.java226
-rw-r--r--libjava/java/awt/event/ActionListener.java59
-rw-r--r--libjava/java/awt/event/AdjustmentEvent.java222
-rw-r--r--libjava/java/awt/event/AdjustmentListener.java58
-rw-r--r--libjava/java/awt/event/ComponentAdapter.java97
-rw-r--r--libjava/java/awt/event/ComponentEvent.java137
-rw-r--r--libjava/java/awt/event/ComponentListener.java84
-rw-r--r--libjava/java/awt/event/ContainerAdapter.java79
-rw-r--r--libjava/java/awt/event/ContainerEvent.java135
-rw-r--r--libjava/java/awt/event/ContainerListener.java70
-rw-r--r--libjava/java/awt/event/FocusAdapter.java79
-rw-r--r--libjava/java/awt/event/FocusEvent.java181
-rw-r--r--libjava/java/awt/event/FocusListener.java69
-rw-r--r--libjava/java/awt/event/HierarchyBoundsAdapter.java78
-rw-r--r--libjava/java/awt/event/HierarchyBoundsListener.java70
-rw-r--r--libjava/java/awt/event/HierarchyEvent.java253
-rw-r--r--libjava/java/awt/event/HierarchyListener.java62
-rw-r--r--libjava/java/awt/event/InputEvent.java381
-rw-r--r--libjava/java/awt/event/InputMethodEvent.java303
-rw-r--r--libjava/java/awt/event/InputMethodListener.java69
-rw-r--r--libjava/java/awt/event/InvocationEvent.java237
-rw-r--r--libjava/java/awt/event/ItemEvent.java155
-rw-r--r--libjava/java/awt/event/ItemListener.java61
-rw-r--r--libjava/java/awt/event/KeyAdapter.java88
-rw-r--r--libjava/java/awt/event/KeyEvent.java1740
-rw-r--r--libjava/java/awt/event/KeyListener.java77
-rw-r--r--libjava/java/awt/event/MouseAdapter.java106
-rw-r--r--libjava/java/awt/event/MouseEvent.java432
-rw-r--r--libjava/java/awt/event/MouseListener.java94
-rw-r--r--libjava/java/awt/event/MouseMotionAdapter.java79
-rw-r--r--libjava/java/awt/event/MouseMotionListener.java72
-rw-r--r--libjava/java/awt/event/MouseWheelEvent.java226
-rw-r--r--libjava/java/awt/event/MouseWheelListener.java60
-rw-r--r--libjava/java/awt/event/PaintEvent.java127
-rw-r--r--libjava/java/awt/event/TextEvent.java92
-rw-r--r--libjava/java/awt/event/TextListener.java60
-rw-r--r--libjava/java/awt/event/WindowAdapter.java156
-rw-r--r--libjava/java/awt/event/WindowEvent.java311
-rw-r--r--libjava/java/awt/event/WindowFocusListener.java68
-rw-r--r--libjava/java/awt/event/WindowListener.java107
-rw-r--r--libjava/java/awt/event/WindowStateListener.java62
-rw-r--r--libjava/java/awt/font/FontRenderContext.java126
-rw-r--r--libjava/java/awt/font/GlyphJustificationInfo.java77
-rw-r--r--libjava/java/awt/font/GlyphMetrics.java134
-rw-r--r--libjava/java/awt/font/GlyphVector.java145
-rw-r--r--libjava/java/awt/font/GraphicAttribute.java84
-rw-r--r--libjava/java/awt/font/ImageGraphicAttribute.java109
-rw-r--r--libjava/java/awt/font/LineBreakMeasurer.java113
-rw-r--r--libjava/java/awt/font/LineMetrics.java67
-rw-r--r--libjava/java/awt/font/MultipleMaster.java61
-rw-r--r--libjava/java/awt/font/NumericShaper.java137
-rw-r--r--libjava/java/awt/font/OpenType.java111
-rw-r--r--libjava/java/awt/font/ShapeGraphicAttribute.java105
-rw-r--r--libjava/java/awt/font/TextAttribute.java309
-rw-r--r--libjava/java/awt/font/TextHitInfo.java125
-rw-r--r--libjava/java/awt/font/TextLayout.java332
-rw-r--r--libjava/java/awt/font/TextMeasurer.java97
-rw-r--r--libjava/java/awt/font/TransformAttribute.java100
-rw-r--r--libjava/java/awt/geom/AffineTransform.java1487
-rw-r--r--libjava/java/awt/geom/Arc2D.java1399
-rw-r--r--libjava/java/awt/geom/Area.java3312
-rw-r--r--libjava/java/awt/geom/CubicCurve2D.java1724
-rw-r--r--libjava/java/awt/geom/Dimension2D.java118
-rw-r--r--libjava/java/awt/geom/Ellipse2D.java413
-rw-r--r--libjava/java/awt/geom/FlatteningPathIterator.java579
-rw-r--r--libjava/java/awt/geom/GeneralPath.java958
-rw-r--r--libjava/java/awt/geom/IllegalPathStateException.java71
-rw-r--r--libjava/java/awt/geom/Line2D.java1182
-rw-r--r--libjava/java/awt/geom/NoninvertibleTransformException.java65
-rw-r--r--libjava/java/awt/geom/PathIterator.java189
-rw-r--r--libjava/java/awt/geom/Point2D.java396
-rw-r--r--libjava/java/awt/geom/QuadCurve2D.java1467
-rw-r--r--libjava/java/awt/geom/Rectangle2D.java992
-rw-r--r--libjava/java/awt/geom/RectangularShape.java385
-rw-r--r--libjava/java/awt/geom/RoundRectangle2D.java533
-rw-r--r--libjava/java/awt/im/InputContext.java434
-rw-r--r--libjava/java/awt/im/InputMethodHighlight.java185
-rw-r--r--libjava/java/awt/im/InputMethodRequests.java153
-rw-r--r--libjava/java/awt/im/InputSubset.java129
-rw-r--r--libjava/java/awt/im/spi/InputMethod.java240
-rw-r--r--libjava/java/awt/im/spi/InputMethodContext.java123
-rw-r--r--libjava/java/awt/im/spi/InputMethodDescriptor.java113
-rw-r--r--libjava/java/awt/image/AffineTransformOp.java375
-rw-r--r--libjava/java/awt/image/AreaAveragingScaleFilter.java127
-rw-r--r--libjava/java/awt/image/BandCombineOp.java168
-rw-r--r--libjava/java/awt/image/BandedSampleModel.java537
-rw-r--r--libjava/java/awt/image/BufferStrategy.java124
-rw-r--r--libjava/java/awt/image/BufferedImage.java693
-rw-r--r--libjava/java/awt/image/BufferedImageFilter.java110
-rw-r--r--libjava/java/awt/image/BufferedImageOp.java55
-rw-r--r--libjava/java/awt/image/ByteLookupTable.java166
-rw-r--r--libjava/java/awt/image/ColorConvertOp.java319
-rw-r--r--libjava/java/awt/image/ColorModel.java758
-rw-r--r--libjava/java/awt/image/ComponentColorModel.java391
-rw-r--r--libjava/java/awt/image/ComponentSampleModel.java544
-rw-r--r--libjava/java/awt/image/ConvolveOp.java337
-rw-r--r--libjava/java/awt/image/CropImageFilter.java180
-rw-r--r--libjava/java/awt/image/DataBuffer.java436
-rw-r--r--libjava/java/awt/image/DataBufferByte.java242
-rw-r--r--libjava/java/awt/image/DataBufferDouble.java285
-rw-r--r--libjava/java/awt/image/DataBufferFloat.java283
-rw-r--r--libjava/java/awt/image/DataBufferInt.java241
-rw-r--r--libjava/java/awt/image/DataBufferShort.java242
-rw-r--r--libjava/java/awt/image/DataBufferUShort.java243
-rw-r--r--libjava/java/awt/image/DirectColorModel.java420
-rw-r--r--libjava/java/awt/image/FilteredImageSource.java125
-rw-r--r--libjava/java/awt/image/ImageConsumer.java216
-rw-r--r--libjava/java/awt/image/ImageFilter.java221
-rw-r--r--libjava/java/awt/image/ImageObserver.java129
-rw-r--r--libjava/java/awt/image/ImageProducer.java85
-rw-r--r--libjava/java/awt/image/ImagingOpException.java66
-rw-r--r--libjava/java/awt/image/IndexColorModel.java516
-rw-r--r--libjava/java/awt/image/Kernel.java143
-rw-r--r--libjava/java/awt/image/LookupOp.java252
-rw-r--r--libjava/java/awt/image/LookupTable.java109
-rw-r--r--libjava/java/awt/image/MemoryImageSource.java373
-rw-r--r--libjava/java/awt/image/MultiPixelPackedSampleModel.java388
-rw-r--r--libjava/java/awt/image/PackedColorModel.java192
-rw-r--r--libjava/java/awt/image/PixelGrabber.java624
-rw-r--r--libjava/java/awt/image/PixelInterleavedSampleModel.java98
-rw-r--r--libjava/java/awt/image/RGBImageFilter.java265
-rw-r--r--libjava/java/awt/image/Raster.java546
-rw-r--r--libjava/java/awt/image/RasterFormatException.java65
-rw-r--r--libjava/java/awt/image/RasterOp.java57
-rw-r--r--libjava/java/awt/image/RenderedImage.java70
-rw-r--r--libjava/java/awt/image/ReplicateScaleFilter.java244
-rw-r--r--libjava/java/awt/image/RescaleOp.java218
-rw-r--r--libjava/java/awt/image/SampleModel.java477
-rw-r--r--libjava/java/awt/image/ShortLookupTable.java162
-rw-r--r--libjava/java/awt/image/SinglePixelPackedSampleModel.java449
-rw-r--r--libjava/java/awt/image/TileObserver.java47
-rw-r--r--libjava/java/awt/image/VolatileImage.java253
-rw-r--r--libjava/java/awt/image/WritableRaster.java265
-rw-r--r--libjava/java/awt/image/WritableRenderedImage.java56
-rw-r--r--libjava/java/awt/image/renderable/ContextualRenderedImageFactory.java56
-rw-r--r--libjava/java/awt/image/renderable/ParameterBlock.java308
-rw-r--r--libjava/java/awt/image/renderable/RenderContext.java141
-rw-r--r--libjava/java/awt/image/renderable/RenderableImage.java62
-rw-r--r--libjava/java/awt/image/renderable/RenderableImageOp.java157
-rw-r--r--libjava/java/awt/image/renderable/RenderableImageProducer.java79
-rw-r--r--libjava/java/awt/image/renderable/RenderedImageFactory.java47
-rw-r--r--libjava/java/awt/peer/ButtonPeer.java46
-rw-r--r--libjava/java/awt/peer/CanvasPeer.java45
-rw-r--r--libjava/java/awt/peer/CheckboxMenuItemPeer.java46
-rw-r--r--libjava/java/awt/peer/CheckboxPeer.java52
-rw-r--r--libjava/java/awt/peer/ChoicePeer.java54
-rw-r--r--libjava/java/awt/peer/ComponentPeer.java187
-rw-r--r--libjava/java/awt/peer/ContainerPeer.java59
-rw-r--r--libjava/java/awt/peer/DialogPeer.java48
-rw-r--r--libjava/java/awt/peer/FileDialogPeer.java52
-rw-r--r--libjava/java/awt/peer/FontPeer.java45
-rw-r--r--libjava/java/awt/peer/FramePeer.java55
-rw-r--r--libjava/java/awt/peer/LabelPeer.java46
-rw-r--r--libjava/java/awt/peer/LightweightPeer.java45
-rw-r--r--libjava/java/awt/peer/ListPeer.java61
-rw-r--r--libjava/java/awt/peer/MenuBarPeer.java48
-rw-r--r--libjava/java/awt/peer/MenuComponentPeer.java45
-rw-r--r--libjava/java/awt/peer/MenuItemPeer.java48
-rw-r--r--libjava/java/awt/peer/MenuPeer.java48
-rw-r--r--libjava/java/awt/peer/PanelPeer.java45
-rw-r--r--libjava/java/awt/peer/PopupMenuPeer.java53
-rw-r--r--libjava/java/awt/peer/RobotPeer.java54
-rw-r--r--libjava/java/awt/peer/ScrollPanePeer.java52
-rw-r--r--libjava/java/awt/peer/ScrollbarPeer.java47
-rw-r--r--libjava/java/awt/peer/TextAreaPeer.java53
-rw-r--r--libjava/java/awt/peer/TextComponentPeer.java57
-rw-r--r--libjava/java/awt/peer/TextFieldPeer.java52
-rw-r--r--libjava/java/awt/peer/WindowPeer.java46
-rw-r--r--libjava/java/awt/print/Book.java159
-rw-r--r--libjava/java/awt/print/PageFormat.java292
-rw-r--r--libjava/java/awt/print/Pageable.java113
-rw-r--r--libjava/java/awt/print/Paper.java236
-rw-r--r--libjava/java/awt/print/Printable.java80
-rw-r--r--libjava/java/awt/print/PrinterAbortException.java71
-rw-r--r--libjava/java/awt/print/PrinterException.java71
-rw-r--r--libjava/java/awt/print/PrinterGraphics.java61
-rw-r--r--libjava/java/awt/print/PrinterIOException.java98
-rw-r--r--libjava/java/awt/print/PrinterJob.java299
-rw-r--r--libjava/java/beans/AppletInitializer.java61
-rw-r--r--libjava/java/beans/BeanDescriptor.java89
-rw-r--r--libjava/java/beans/BeanInfo.java181
-rw-r--r--libjava/java/beans/Beans.java368
-rw-r--r--libjava/java/beans/Customizer.java86
-rw-r--r--libjava/java/beans/DesignMode.java93
-rw-r--r--libjava/java/beans/EventHandler.java606
-rw-r--r--libjava/java/beans/EventSetDescriptor.java442
-rw-r--r--libjava/java/beans/ExceptionListener.java57
-rw-r--r--libjava/java/beans/Expression.java133
-rw-r--r--libjava/java/beans/FeatureDescriptor.java232
-rw-r--r--libjava/java/beans/IndexedPropertyDescriptor.java307
-rw-r--r--libjava/java/beans/IntrospectionException.java67
-rw-r--r--libjava/java/beans/Introspector.java608
-rw-r--r--libjava/java/beans/MethodDescriptor.java88
-rw-r--r--libjava/java/beans/ParameterDescriptor.java52
-rw-r--r--libjava/java/beans/PropertyChangeEvent.java189
-rw-r--r--libjava/java/beans/PropertyChangeListener.java61
-rw-r--r--libjava/java/beans/PropertyChangeListenerProxy.java102
-rw-r--r--libjava/java/beans/PropertyChangeSupport.java488
-rw-r--r--libjava/java/beans/PropertyDescriptor.java583
-rw-r--r--libjava/java/beans/PropertyEditor.java209
-rw-r--r--libjava/java/beans/PropertyEditorManager.java215
-rw-r--r--libjava/java/beans/PropertyEditorSupport.java265
-rw-r--r--libjava/java/beans/PropertyVetoException.java85
-rw-r--r--libjava/java/beans/SimpleBeanInfo.java139
-rw-r--r--libjava/java/beans/Statement.java326
-rw-r--r--libjava/java/beans/VetoableChangeListener.java73
-rw-r--r--libjava/java/beans/VetoableChangeListenerProxy.java102
-rw-r--r--libjava/java/beans/VetoableChangeSupport.java530
-rw-r--r--libjava/java/beans/Visibility.java85
-rw-r--r--libjava/java/beans/XMLDecoder.java307
-rw-r--r--libjava/java/beans/beancontext/BeanContext.java272
-rw-r--r--libjava/java/beans/beancontext/BeanContextChild.java174
-rw-r--r--libjava/java/beans/beancontext/BeanContextChildComponentProxy.java60
-rw-r--r--libjava/java/beans/beancontext/BeanContextChildSupport.java381
-rw-r--r--libjava/java/beans/beancontext/BeanContextContainerProxy.java63
-rw-r--r--libjava/java/beans/beancontext/BeanContextEvent.java110
-rw-r--r--libjava/java/beans/beancontext/BeanContextMembershipEvent.java112
-rw-r--r--libjava/java/beans/beancontext/BeanContextMembershipListener.java70
-rw-r--r--libjava/java/beans/beancontext/BeanContextProxy.java65
-rw-r--r--libjava/java/beans/beancontext/BeanContextServiceAvailableEvent.java95
-rw-r--r--libjava/java/beans/beancontext/BeanContextServiceProvider.java138
-rw-r--r--libjava/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java60
-rw-r--r--libjava/java/beans/beancontext/BeanContextServiceRevokedEvent.java110
-rw-r--r--libjava/java/beans/beancontext/BeanContextServiceRevokedListener.java62
-rw-r--r--libjava/java/beans/beancontext/BeanContextServices.java216
-rw-r--r--libjava/java/beans/beancontext/BeanContextServicesListener.java56
-rw-r--r--libjava/java/beans/beancontext/BeanContextServicesSupport.java300
-rw-r--r--libjava/java/beans/beancontext/BeanContextSupport.java460
-rw-r--r--libjava/java/io/BufferedOutputStream.java192
-rw-r--r--libjava/java/io/BufferedReader.java581
-rw-r--r--libjava/java/io/BufferedWriter.java262
-rw-r--r--libjava/java/io/ByteArrayInputStream.java251
-rw-r--r--libjava/java/io/ByteArrayOutputStream.java283
-rw-r--r--libjava/java/io/CharArrayReader.java305
-rw-r--r--libjava/java/io/CharArrayWriter.java274
-rw-r--r--libjava/java/io/CharConversionException.java73
-rw-r--r--libjava/java/io/DataInput.java456
-rw-r--r--libjava/java/io/DataInputStream.java739
-rw-r--r--libjava/java/io/DataOutput.java326
-rw-r--r--libjava/java/io/DataOutputStream.java455
-rw-r--r--libjava/java/io/EOFException.java76
-rw-r--r--libjava/java/io/Externalizable.java107
-rw-r--r--libjava/java/io/FileDescriptor.java139
-rw-r--r--libjava/java/io/FileFilter.java65
-rw-r--r--libjava/java/io/FileNotFoundException.java73
-rw-r--r--libjava/java/io/FilePermission.java292
-rw-r--r--libjava/java/io/FileReader.java92
-rw-r--r--libjava/java/io/FileWriter.java137
-rw-r--r--libjava/java/io/FilenameFilter.java76
-rw-r--r--libjava/java/io/FilterInputStream.java203
-rw-r--r--libjava/java/io/FilterOutputStream.java150
-rw-r--r--libjava/java/io/FilterReader.java185
-rw-r--r--libjava/java/io/FilterWriter.java147
-rw-r--r--libjava/java/io/IOException.java74
-rw-r--r--libjava/java/io/InputStream.java272
-rw-r--r--libjava/java/io/InterruptedIOException.java94
-rw-r--r--libjava/java/io/InvalidClassException.java111
-rw-r--r--libjava/java/io/InvalidObjectException.java66
-rw-r--r--libjava/java/io/LineNumberInputStream.java315
-rw-r--r--libjava/java/io/LineNumberReader.java417
-rw-r--r--libjava/java/io/NotActiveException.java72
-rw-r--r--libjava/java/io/NotSerializableException.java74
-rw-r--r--libjava/java/io/ObjectInput.java140
-rw-r--r--libjava/java/io/ObjectInputValidation.java67
-rw-r--r--libjava/java/io/ObjectOutput.java111
-rw-r--r--libjava/java/io/ObjectOutputStream.java1570
-rw-r--r--libjava/java/io/ObjectStreamConstants.java89
-rw-r--r--libjava/java/io/ObjectStreamException.java74
-rw-r--r--libjava/java/io/ObjectStreamField.java412
-rw-r--r--libjava/java/io/OptionalDataException.java91
-rw-r--r--libjava/java/io/OutputStream.java140
-rw-r--r--libjava/java/io/PipedInputStream.java374
-rw-r--r--libjava/java/io/PipedOutputStream.java181
-rw-r--r--libjava/java/io/PipedReader.java361
-rw-r--r--libjava/java/io/PipedWriter.java182
-rw-r--r--libjava/java/io/PrintWriter.java571
-rw-r--r--libjava/java/io/PushbackInputStream.java328
-rw-r--r--libjava/java/io/PushbackReader.java384
-rw-r--r--libjava/java/io/Reader.java271
-rw-r--r--libjava/java/io/SequenceInputStream.java221
-rw-r--r--libjava/java/io/Serializable.java54
-rw-r--r--libjava/java/io/SerializablePermission.java113
-rw-r--r--libjava/java/io/StreamCorruptedException.java73
-rw-r--r--libjava/java/io/StreamTokenizer.java708
-rw-r--r--libjava/java/io/StringBufferInputStream.java187
-rw-r--r--libjava/java/io/StringReader.java209
-rw-r--r--libjava/java/io/StringWriter.java191
-rw-r--r--libjava/java/io/SyncFailedException.java66
-rw-r--r--libjava/java/io/UTFDataFormatException.java74
-rw-r--r--libjava/java/io/UnsupportedEncodingException.java73
-rw-r--r--libjava/java/io/WriteAbortedException.java109
-rw-r--r--libjava/java/io/Writer.java192
-rw-r--r--libjava/java/lang/AbstractMethodError.java75
-rw-r--r--libjava/java/lang/ArithmeticException.java77
-rw-r--r--libjava/java/lang/ArrayIndexOutOfBoundsException.java87
-rw-r--r--libjava/java/lang/ArrayStoreException.java77
-rw-r--r--libjava/java/lang/AssertionError.java148
-rw-r--r--libjava/java/lang/Boolean.java224
-rw-r--r--libjava/java/lang/Byte.java357
-rw-r--r--libjava/java/lang/CharSequence.java99
-rw-r--r--libjava/java/lang/ClassCastException.java76
-rw-r--r--libjava/java/lang/ClassCircularityError.java73
-rw-r--r--libjava/java/lang/ClassFormatError.java72
-rw-r--r--libjava/java/lang/ClassNotFoundException.java125
-rw-r--r--libjava/java/lang/CloneNotSupportedException.java92
-rw-r--r--libjava/java/lang/Cloneable.java78
-rw-r--r--libjava/java/lang/Comparable.java98
-rw-r--r--libjava/java/lang/Compiler.java127
-rw-r--r--libjava/java/lang/Error.java107
-rw-r--r--libjava/java/lang/Exception.java104
-rw-r--r--libjava/java/lang/ExceptionInInitializerError.java123
-rw-r--r--libjava/java/lang/IllegalAccessError.java76
-rw-r--r--libjava/java/lang/IllegalAccessException.java95
-rw-r--r--libjava/java/lang/IllegalArgumentException.java75
-rw-r--r--libjava/java/lang/IllegalMonitorStateException.java78
-rw-r--r--libjava/java/lang/IllegalStateException.java80
-rw-r--r--libjava/java/lang/IllegalThreadStateException.java75
-rw-r--r--libjava/java/lang/IncompatibleClassChangeError.java73
-rw-r--r--libjava/java/lang/IndexOutOfBoundsException.java75
-rw-r--r--libjava/java/lang/InstantiationError.java75
-rw-r--r--libjava/java/lang/InstantiationException.java74
-rw-r--r--libjava/java/lang/Integer.java606
-rw-r--r--libjava/java/lang/InternalError.java72
-rw-r--r--libjava/java/lang/InterruptedException.java80
-rw-r--r--libjava/java/lang/LinkageError.java74
-rw-r--r--libjava/java/lang/Long.java614
-rw-r--r--libjava/java/lang/Math.java650
-rw-r--r--libjava/java/lang/NegativeArraySizeException.java77
-rw-r--r--libjava/java/lang/NoClassDefFoundError.java76
-rw-r--r--libjava/java/lang/NoSuchFieldError.java74
-rw-r--r--libjava/java/lang/NoSuchFieldException.java73
-rw-r--r--libjava/java/lang/NoSuchMethodError.java74
-rw-r--r--libjava/java/lang/NoSuchMethodException.java72
-rw-r--r--libjava/java/lang/NullPointerException.java82
-rw-r--r--libjava/java/lang/Number.java131
-rw-r--r--libjava/java/lang/NumberFormatException.java73
-rw-r--r--libjava/java/lang/OutOfMemoryError.java73
-rw-r--r--libjava/java/lang/Process.java129
-rw-r--r--libjava/java/lang/Runnable.java62
-rw-r--r--libjava/java/lang/RuntimeException.java102
-rw-r--r--libjava/java/lang/RuntimePermission.java208
-rw-r--r--libjava/java/lang/SecurityException.java74
-rw-r--r--libjava/java/lang/Short.java353
-rw-r--r--libjava/java/lang/StackOverflowError.java72
-rw-r--r--libjava/java/lang/StackTraceElement.java259
-rw-r--r--libjava/java/lang/StrictMath.java1844
-rw-r--r--libjava/java/lang/StringIndexOutOfBoundsException.java85
-rw-r--r--libjava/java/lang/ThreadDeath.java68
-rw-r--r--libjava/java/lang/ThreadGroup.java749
-rw-r--r--libjava/java/lang/Throwable.java563
-rw-r--r--libjava/java/lang/UnknownError.java72
-rw-r--r--libjava/java/lang/UnsatisfiedLinkError.java74
-rw-r--r--libjava/java/lang/UnsupportedClassVersionError.java74
-rw-r--r--libjava/java/lang/UnsupportedOperationException.java73
-rw-r--r--libjava/java/lang/VerifyError.java72
-rw-r--r--libjava/java/lang/VirtualMachineError.java73
-rw-r--r--libjava/java/lang/Void.java68
-rw-r--r--libjava/java/lang/dtoa.c906
-rw-r--r--libjava/java/lang/e_acos.c111
-rw-r--r--libjava/java/lang/e_asin.c120
-rw-r--r--libjava/java/lang/e_atan2.c131
-rw-r--r--libjava/java/lang/e_exp.c167
-rw-r--r--libjava/java/lang/e_fmod.c140
-rw-r--r--libjava/java/lang/e_log.c152
-rw-r--r--libjava/java/lang/e_pow.c312
-rw-r--r--libjava/java/lang/e_rem_pio2.c185
-rw-r--r--libjava/java/lang/e_remainder.c80
-rw-r--r--libjava/java/lang/e_scalb.c55
-rw-r--r--libjava/java/lang/e_sqrt.c452
-rw-r--r--libjava/java/lang/fdlibm.h350
-rw-r--r--libjava/java/lang/ieeefp.h163
-rw-r--r--libjava/java/lang/k_cos.c96
-rw-r--r--libjava/java/lang/k_rem_pio2.c320
-rw-r--r--libjava/java/lang/k_sin.c79
-rw-r--r--libjava/java/lang/k_tan.c132
-rw-r--r--libjava/java/lang/mprec.c958
-rw-r--r--libjava/java/lang/mprec.h397
-rw-r--r--libjava/java/lang/ref/PhantomReference.java73
-rw-r--r--libjava/java/lang/ref/ReferenceQueue.java145
-rw-r--r--libjava/java/lang/ref/SoftReference.java84
-rw-r--r--libjava/java/lang/ref/WeakReference.java79
-rw-r--r--libjava/java/lang/reflect/AccessibleObject.java159
-rw-r--r--libjava/java/lang/reflect/InvocationHandler.java137
-rw-r--r--libjava/java/lang/reflect/InvocationTargetException.java123
-rw-r--r--libjava/java/lang/reflect/Member.java100
-rw-r--r--libjava/java/lang/reflect/Proxy.java1615
-rw-r--r--libjava/java/lang/reflect/ReflectPermission.java102
-rw-r--r--libjava/java/lang/reflect/UndeclaredThrowableException.java128
-rw-r--r--libjava/java/lang/s_atan.c181
-rw-r--r--libjava/java/lang/s_ceil.c80
-rw-r--r--libjava/java/lang/s_copysign.c82
-rw-r--r--libjava/java/lang/s_cos.c82
-rw-r--r--libjava/java/lang/s_fabs.c73
-rw-r--r--libjava/java/lang/s_floor.c134
-rw-r--r--libjava/java/lang/s_rint.c87
-rw-r--r--libjava/java/lang/s_scalbn.c104
-rw-r--r--libjava/java/lang/s_sin.c132
-rw-r--r--libjava/java/lang/s_tan.c114
-rw-r--r--libjava/java/lang/sf_fabs.c47
-rw-r--r--libjava/java/lang/sf_rint.c80
-rw-r--r--libjava/java/lang/strtod.c719
-rw-r--r--libjava/java/lang/w_acos.c118
-rw-r--r--libjava/java/lang/w_asin.c121
-rw-r--r--libjava/java/lang/w_atan2.c117
-rw-r--r--libjava/java/lang/w_exp.c140
-rw-r--r--libjava/java/lang/w_fmod.c107
-rw-r--r--libjava/java/lang/w_log.c115
-rw-r--r--libjava/java/lang/w_pow.c231
-rw-r--r--libjava/java/lang/w_remainder.c119
-rw-r--r--libjava/java/lang/w_sqrt.c93
-rw-r--r--libjava/java/math/BigDecimal.java517
-rw-r--r--libjava/java/math/BigInteger.java2230
-rw-r--r--libjava/java/net/Authenticator.java313
-rw-r--r--libjava/java/net/BindException.java74
-rw-r--r--libjava/java/net/ConnectException.java75
-rw-r--r--libjava/java/net/ContentHandler.java126
-rw-r--r--libjava/java/net/ContentHandlerFactory.java65
-rw-r--r--libjava/java/net/DatagramPacket.java391
-rw-r--r--libjava/java/net/DatagramSocket.java931
-rw-r--r--libjava/java/net/DatagramSocketImpl.java296
-rw-r--r--libjava/java/net/DatagramSocketImplFactory.java60
-rw-r--r--libjava/java/net/FileNameMap.java65
-rw-r--r--libjava/java/net/HttpURLConnection.java589
-rw-r--r--libjava/java/net/Inet4Address.java233
-rw-r--r--libjava/java/net/Inet6Address.java261
-rw-r--r--libjava/java/net/InetSocketAddress.java221
-rw-r--r--libjava/java/net/MalformedURLException.java74
-rw-r--r--libjava/java/net/MulticastSocket.java486
-rw-r--r--libjava/java/net/NetPermission.java90
-rw-r--r--libjava/java/net/NetworkInterface.java259
-rw-r--r--libjava/java/net/NoRouteToHostException.java74
-rw-r--r--libjava/java/net/PasswordAuthentication.java92
-rw-r--r--libjava/java/net/PortUnreachableException.java72
-rw-r--r--libjava/java/net/ProtocolException.java75
-rw-r--r--libjava/java/net/Socket.java1284
-rw-r--r--libjava/java/net/SocketAddress.java63
-rw-r--r--libjava/java/net/SocketException.java75
-rw-r--r--libjava/java/net/SocketImpl.java321
-rw-r--r--libjava/java/net/SocketImplFactory.java59
-rw-r--r--libjava/java/net/SocketOptions.java166
-rw-r--r--libjava/java/net/SocketPermission.java408
-rw-r--r--libjava/java/net/SocketTimeoutException.java73
-rw-r--r--libjava/java/net/URI.java893
-rw-r--r--libjava/java/net/URISyntaxException.java144
-rw-r--r--libjava/java/net/URLDecoder.java180
-rw-r--r--libjava/java/net/URLEncoder.java184
-rw-r--r--libjava/java/net/URLStreamHandler.java532
-rw-r--r--libjava/java/net/URLStreamHandlerFactory.java65
-rw-r--r--libjava/java/net/UnknownHostException.java77
-rw-r--r--libjava/java/net/UnknownServiceException.java76
-rw-r--r--libjava/java/nio/BufferOverflowException.java51
-rw-r--r--libjava/java/nio/BufferUnderflowException.java51
-rw-r--r--libjava/java/nio/ByteBuffer.java651
-rw-r--r--libjava/java/nio/ByteBufferHelper.java344
-rw-r--r--libjava/java/nio/ByteBufferImpl.java379
-rw-r--r--libjava/java/nio/ByteOrder.java82
-rw-r--r--libjava/java/nio/CharBuffer.java508
-rw-r--r--libjava/java/nio/CharBufferImpl.java219
-rw-r--r--libjava/java/nio/CharViewBufferImpl.java187
-rw-r--r--libjava/java/nio/DoubleBuffer.java383
-rw-r--r--libjava/java/nio/DoubleBufferImpl.java172
-rw-r--r--libjava/java/nio/DoubleViewBufferImpl.java172
-rw-r--r--libjava/java/nio/FloatBuffer.java383
-rw-r--r--libjava/java/nio/FloatBufferImpl.java172
-rw-r--r--libjava/java/nio/FloatViewBufferImpl.java173
-rw-r--r--libjava/java/nio/IntBuffer.java383
-rw-r--r--libjava/java/nio/IntBufferImpl.java172
-rw-r--r--libjava/java/nio/IntViewBufferImpl.java173
-rw-r--r--libjava/java/nio/InvalidMarkException.java52
-rw-r--r--libjava/java/nio/LongBuffer.java383
-rw-r--r--libjava/java/nio/LongBufferImpl.java172
-rw-r--r--libjava/java/nio/LongViewBufferImpl.java173
-rw-r--r--libjava/java/nio/ReadOnlyBufferException.java52
-rw-r--r--libjava/java/nio/ShortBuffer.java383
-rw-r--r--libjava/java/nio/ShortBufferImpl.java172
-rw-r--r--libjava/java/nio/ShortViewBufferImpl.java173
-rw-r--r--libjava/java/nio/channels/AlreadyConnectedException.java48
-rw-r--r--libjava/java/nio/channels/AsynchronousCloseException.java53
-rw-r--r--libjava/java/nio/channels/ByteChannel.java43
-rw-r--r--libjava/java/nio/channels/CancelledKeyException.java53
-rw-r--r--libjava/java/nio/channels/Channel.java59
-rw-r--r--libjava/java/nio/channels/ClosedByInterruptException.java53
-rw-r--r--libjava/java/nio/channels/ClosedChannelException.java55
-rw-r--r--libjava/java/nio/channels/ClosedSelectorException.java53
-rw-r--r--libjava/java/nio/channels/ConnectionPendingException.java53
-rw-r--r--libjava/java/nio/channels/DatagramChannel.java210
-rw-r--r--libjava/java/nio/channels/FileChannel.java367
-rw-r--r--libjava/java/nio/channels/FileLock.java150
-rw-r--r--libjava/java/nio/channels/FileLockInterruptionException.java55
-rw-r--r--libjava/java/nio/channels/GatheringByteChannel.java79
-rw-r--r--libjava/java/nio/channels/IllegalBlockingModeException.java57
-rw-r--r--libjava/java/nio/channels/IllegalSelectorException.java53
-rw-r--r--libjava/java/nio/channels/InterruptibleChannel.java51
-rw-r--r--libjava/java/nio/channels/NoConnectionPendingException.java53
-rw-r--r--libjava/java/nio/channels/NonReadableChannelException.java53
-rw-r--r--libjava/java/nio/channels/NonWritableChannelException.java53
-rw-r--r--libjava/java/nio/channels/NotYetBoundException.java53
-rw-r--r--libjava/java/nio/channels/NotYetConnectedException.java53
-rw-r--r--libjava/java/nio/channels/OverlappingFileLockException.java53
-rw-r--r--libjava/java/nio/channels/Pipe.java121
-rw-r--r--libjava/java/nio/channels/ReadableByteChannel.java64
-rw-r--r--libjava/java/nio/channels/ScatteringByteChannel.java79
-rw-r--r--libjava/java/nio/channels/SelectableChannel.java140
-rw-r--r--libjava/java/nio/channels/SelectionKey.java164
-rw-r--r--libjava/java/nio/channels/Selector.java134
-rw-r--r--libjava/java/nio/channels/ServerSocketChannel.java98
-rw-r--r--libjava/java/nio/channels/SocketChannel.java248
-rw-r--r--libjava/java/nio/channels/UnresolvedAddressException.java53
-rw-r--r--libjava/java/nio/channels/UnsupportedAddressTypeException.java53
-rw-r--r--libjava/java/nio/channels/WritableByteChannel.java60
-rw-r--r--libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java119
-rw-r--r--libjava/java/nio/channels/spi/AbstractSelectableChannel.java256
-rw-r--r--libjava/java/nio/channels/spi/AbstractSelectionKey.java78
-rw-r--r--libjava/java/nio/channels/spi/AbstractSelector.java167
-rw-r--r--libjava/java/nio/channels/spi/SelectorProvider.java151
-rw-r--r--libjava/java/nio/charset/CharacterCodingException.java53
-rw-r--r--libjava/java/nio/charset/CharsetDecoder.java313
-rw-r--r--libjava/java/nio/charset/CharsetEncoder.java365
-rw-r--r--libjava/java/nio/charset/CoderMalfunctionError.java52
-rw-r--r--libjava/java/nio/charset/CoderResult.java189
-rw-r--r--libjava/java/nio/charset/CodingErrorAction.java66
-rw-r--r--libjava/java/nio/charset/IllegalCharsetNameException.java73
-rw-r--r--libjava/java/nio/charset/MalformedInputException.java77
-rw-r--r--libjava/java/nio/charset/UnmappableCharacterException.java71
-rw-r--r--libjava/java/nio/charset/UnsupportedCharsetException.java69
-rw-r--r--libjava/java/nio/charset/spi/CharsetProvider.java91
-rw-r--r--libjava/java/rmi/AccessException.java76
-rw-r--r--libjava/java/rmi/AlreadyBoundException.java73
-rw-r--r--libjava/java/rmi/ConnectException.java74
-rw-r--r--libjava/java/rmi/ConnectIOException.java74
-rw-r--r--libjava/java/rmi/MarshalException.java76
-rw-r--r--libjava/java/rmi/MarshalledObject.java113
-rw-r--r--libjava/java/rmi/Naming.java220
-rw-r--r--libjava/java/rmi/NoSuchObjectException.java68
-rw-r--r--libjava/java/rmi/NotBoundException.java75
-rw-r--r--libjava/java/rmi/RMISecurityException.java77
-rw-r--r--libjava/java/rmi/RMISecurityManager.java48
-rw-r--r--libjava/java/rmi/Remote.java41
-rw-r--r--libjava/java/rmi/RemoteException.java127
-rw-r--r--libjava/java/rmi/ServerError.java64
-rw-r--r--libjava/java/rmi/ServerException.java74
-rw-r--r--libjava/java/rmi/ServerRuntimeException.java67
-rw-r--r--libjava/java/rmi/StubNotFoundException.java77
-rw-r--r--libjava/java/rmi/UnexpectedException.java75
-rw-r--r--libjava/java/rmi/UnknownHostException.java75
-rw-r--r--libjava/java/rmi/UnmarshalException.java88
-rw-r--r--libjava/java/rmi/activation/Activatable.java105
-rw-r--r--libjava/java/rmi/activation/ActivateFailedException.java76
-rw-r--r--libjava/java/rmi/activation/ActivationDesc.java113
-rw-r--r--libjava/java/rmi/activation/ActivationException.java122
-rw-r--r--libjava/java/rmi/activation/ActivationGroup.java85
-rw-r--r--libjava/java/rmi/activation/ActivationGroupDesc.java134
-rw-r--r--libjava/java/rmi/activation/ActivationGroupID.java70
-rw-r--r--libjava/java/rmi/activation/ActivationID.java72
-rw-r--r--libjava/java/rmi/activation/ActivationInstantiator.java50
-rw-r--r--libjava/java/rmi/activation/ActivationMonitor.java55
-rw-r--r--libjava/java/rmi/activation/ActivationSystem.java78
-rw-r--r--libjava/java/rmi/activation/Activator.java50
-rw-r--r--libjava/java/rmi/activation/UnknownGroupException.java69
-rw-r--r--libjava/java/rmi/activation/UnknownObjectException.java69
-rw-r--r--libjava/java/rmi/dgc/DGC.java51
-rw-r--r--libjava/java/rmi/dgc/Lease.java67
-rw-r--r--libjava/java/rmi/dgc/VMID.java138
-rw-r--r--libjava/java/rmi/registry/LocateRegistry.java87
-rw-r--r--libjava/java/rmi/registry/Registry.java65
-rw-r--r--libjava/java/rmi/registry/RegistryHandler.java58
-rw-r--r--libjava/java/rmi/server/ExportException.java78
-rw-r--r--libjava/java/rmi/server/LoaderHandler.java66
-rw-r--r--libjava/java/rmi/server/LogStream.java146
-rw-r--r--libjava/java/rmi/server/ObjID.java103
-rw-r--r--libjava/java/rmi/server/Operation.java70
-rw-r--r--libjava/java/rmi/server/RMIClassLoader.java339
-rw-r--r--libjava/java/rmi/server/RMIClassLoaderSpi.java64
-rw-r--r--libjava/java/rmi/server/RMIClientSocketFactory.java47
-rw-r--r--libjava/java/rmi/server/RMIFailureHandler.java46
-rw-r--r--libjava/java/rmi/server/RMIServerSocketFactory.java47
-rw-r--r--libjava/java/rmi/server/RMISocketFactory.java108
-rw-r--r--libjava/java/rmi/server/RemoteCall.java86
-rw-r--r--libjava/java/rmi/server/RemoteObject.java160
-rw-r--r--libjava/java/rmi/server/RemoteRef.java79
-rw-r--r--libjava/java/rmi/server/RemoteServer.java76
-rw-r--r--libjava/java/rmi/server/RemoteStub.java61
-rw-r--r--libjava/java/rmi/server/ServerCloneException.java117
-rw-r--r--libjava/java/rmi/server/ServerNotActiveException.java72
-rw-r--r--libjava/java/rmi/server/ServerRef.java51
-rw-r--r--libjava/java/rmi/server/Skeleton.java57
-rw-r--r--libjava/java/rmi/server/SkeletonMismatchException.java68
-rw-r--r--libjava/java/rmi/server/SkeletonNotFoundException.java79
-rw-r--r--libjava/java/rmi/server/SocketSecurityException.java75
-rw-r--r--libjava/java/rmi/server/UID.java127
-rw-r--r--libjava/java/rmi/server/UnicastRemoteObject.java133
-rw-r--r--libjava/java/rmi/server/Unreferenced.java43
-rw-r--r--libjava/java/security/AccessControlException.java97
-rw-r--r--libjava/java/security/AlgorithmParameterGenerator.java302
-rw-r--r--libjava/java/security/AlgorithmParameterGeneratorSpi.java94
-rw-r--r--libjava/java/security/AlgorithmParameters.java340
-rw-r--r--libjava/java/security/AlgorithmParametersSpi.java149
-rw-r--r--libjava/java/security/AllPermission.java198
-rw-r--r--libjava/java/security/BasicPermission.java308
-rw-r--r--libjava/java/security/Certificate.java125
-rw-r--r--libjava/java/security/CodeSource.java354
-rw-r--r--libjava/java/security/DigestException.java70
-rw-r--r--libjava/java/security/DigestInputStream.java167
-rw-r--r--libjava/java/security/DigestOutputStream.java158
-rw-r--r--libjava/java/security/DomainCombiner.java67
-rw-r--r--libjava/java/security/DummyKeyPairGenerator.java75
-rw-r--r--libjava/java/security/DummyMessageDigest.java90
-rw-r--r--libjava/java/security/DummySignature.java102
-rw-r--r--libjava/java/security/GeneralSecurityException.java75
-rw-r--r--libjava/java/security/Guard.java60
-rw-r--r--libjava/java/security/GuardedObject.java121
-rw-r--r--libjava/java/security/Identity.java407
-rw-r--r--libjava/java/security/IdentityScope.java226
-rw-r--r--libjava/java/security/InvalidAlgorithmParameterException.java73
-rw-r--r--libjava/java/security/InvalidKeyException.java69
-rw-r--r--libjava/java/security/InvalidParameterException.java70
-rw-r--r--libjava/java/security/Key.java94
-rw-r--r--libjava/java/security/KeyException.java72
-rw-r--r--libjava/java/security/KeyFactory.java297
-rw-r--r--libjava/java/security/KeyFactorySpi.java133
-rw-r--r--libjava/java/security/KeyManagementException.java71
-rw-r--r--libjava/java/security/KeyPair.java87
-rw-r--r--libjava/java/security/KeyPairGenerator.java401
-rw-r--r--libjava/java/security/KeyPairGeneratorSpi.java102
-rw-r--r--libjava/java/security/KeyStore.java507
-rw-r--r--libjava/java/security/KeyStoreException.java70
-rw-r--r--libjava/java/security/KeyStoreSpi.java275
-rw-r--r--libjava/java/security/MessageDigest.java413
-rw-r--r--libjava/java/security/MessageDigestSpi.java155
-rw-r--r--libjava/java/security/NoSuchAlgorithmException.java70
-rw-r--r--libjava/java/security/NoSuchProviderException.java70
-rw-r--r--libjava/java/security/Permission.java187
-rw-r--r--libjava/java/security/PermissionCollection.java167
-rw-r--r--libjava/java/security/Permissions.java254
-rw-r--r--libjava/java/security/Policy.java310
-rw-r--r--libjava/java/security/Principal.java85
-rw-r--r--libjava/java/security/PrivateKey.java62
-rw-r--r--libjava/java/security/PrivilegedAction.java64
-rw-r--r--libjava/java/security/PrivilegedActionException.java109
-rw-r--r--libjava/java/security/PrivilegedExceptionAction.java65
-rw-r--r--libjava/java/security/ProtectionDomain.java269
-rw-r--r--libjava/java/security/Provider.java202
-rw-r--r--libjava/java/security/ProviderException.java70
-rw-r--r--libjava/java/security/PublicKey.java60
-rw-r--r--libjava/java/security/SecureClassLoader.java128
-rw-r--r--libjava/java/security/SecureRandom.java380
-rw-r--r--libjava/java/security/SecureRandomSpi.java85
-rw-r--r--libjava/java/security/Security.java740
-rw-r--r--libjava/java/security/SecurityPermission.java178
-rw-r--r--libjava/java/security/Signature.java636
-rw-r--r--libjava/java/security/SignatureException.java70
-rw-r--r--libjava/java/security/SignatureSpi.java302
-rw-r--r--libjava/java/security/SignedObject.java240
-rw-r--r--libjava/java/security/Signer.java164
-rw-r--r--libjava/java/security/UnrecoverableKeyException.java71
-rw-r--r--libjava/java/security/UnresolvedPermission.java304
-rw-r--r--libjava/java/security/acl/Acl.java153
-rw-r--r--libjava/java/security/acl/AclEntry.java143
-rw-r--r--libjava/java/security/acl/AclNotFoundException.java60
-rw-r--r--libjava/java/security/acl/Group.java90
-rw-r--r--libjava/java/security/acl/LastOwnerException.java62
-rw-r--r--libjava/java/security/acl/NotOwnerException.java62
-rw-r--r--libjava/java/security/acl/Owner.java95
-rw-r--r--libjava/java/security/acl/Permission.java67
-rw-r--r--libjava/java/security/cert/CRL.java98
-rw-r--r--libjava/java/security/cert/CRLException.java73
-rw-r--r--libjava/java/security/cert/CRLSelector.java69
-rw-r--r--libjava/java/security/cert/CertPath.java252
-rw-r--r--libjava/java/security/cert/CertPathBuilder.java238
-rw-r--r--libjava/java/security/cert/CertPathBuilderException.java159
-rw-r--r--libjava/java/security/cert/CertPathBuilderResult.java63
-rw-r--r--libjava/java/security/cert/CertPathBuilderSpi.java74
-rw-r--r--libjava/java/security/cert/CertPathParameters.java58
-rw-r--r--libjava/java/security/cert/CertPathValidator.java249
-rw-r--r--libjava/java/security/cert/CertPathValidatorException.java226
-rw-r--r--libjava/java/security/cert/CertPathValidatorResult.java63
-rw-r--r--libjava/java/security/cert/CertPathValidatorSpi.java79
-rw-r--r--libjava/java/security/cert/CertSelector.java58
-rw-r--r--libjava/java/security/cert/CertStore.java294
-rw-r--r--libjava/java/security/cert/CertStoreException.java159
-rw-r--r--libjava/java/security/cert/CertStoreParameters.java60
-rw-r--r--libjava/java/security/cert/CertStoreSpi.java102
-rw-r--r--libjava/java/security/cert/Certificate.java306
-rw-r--r--libjava/java/security/cert/CertificateEncodingException.java71
-rw-r--r--libjava/java/security/cert/CertificateException.java74
-rw-r--r--libjava/java/security/cert/CertificateExpiredException.java71
-rw-r--r--libjava/java/security/cert/CertificateFactory.java358
-rw-r--r--libjava/java/security/cert/CertificateFactorySpi.java225
-rw-r--r--libjava/java/security/cert/CertificateNotYetValidException.java71
-rw-r--r--libjava/java/security/cert/CertificateParsingException.java71
-rw-r--r--libjava/java/security/cert/CollectionCertStoreParameters.java121
-rw-r--r--libjava/java/security/cert/LDAPCertStoreParameters.java140
-rw-r--r--libjava/java/security/cert/PKIXBuilderParameters.java145
-rw-r--r--libjava/java/security/cert/PKIXCertPathBuilderResult.java102
-rw-r--r--libjava/java/security/cert/PKIXCertPathChecker.java133
-rw-r--r--libjava/java/security/cert/PKIXCertPathValidatorResult.java142
-rw-r--r--libjava/java/security/cert/PKIXParameters.java546
-rw-r--r--libjava/java/security/cert/PolicyNode.java102
-rw-r--r--libjava/java/security/cert/PolicyQualifierInfo.java168
-rw-r--r--libjava/java/security/cert/TrustAnchor.java185
-rw-r--r--libjava/java/security/cert/X509CRL.java397
-rw-r--r--libjava/java/security/cert/X509CRLEntry.java169
-rw-r--r--libjava/java/security/cert/X509CRLSelector.java440
-rw-r--r--libjava/java/security/cert/X509CertSelector.java1106
-rw-r--r--libjava/java/security/cert/X509Certificate.java586
-rw-r--r--libjava/java/security/cert/X509Extension.java113
-rw-r--r--libjava/java/security/interfaces/DSAKey.java56
-rw-r--r--libjava/java/security/interfaces/DSAKeyPairGenerator.java85
-rw-r--r--libjava/java/security/interfaces/DSAParams.java72
-rw-r--r--libjava/java/security/interfaces/DSAPrivateKey.java61
-rw-r--r--libjava/java/security/interfaces/DSAPublicKey.java61
-rw-r--r--libjava/java/security/interfaces/RSAKey.java57
-rw-r--r--libjava/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java111
-rw-r--r--libjava/java/security/interfaces/RSAPrivateCrtKey.java95
-rw-r--r--libjava/java/security/interfaces/RSAPrivateKey.java60
-rw-r--r--libjava/java/security/interfaces/RSAPublicKey.java60
-rw-r--r--libjava/java/security/spec/AlgorithmParameterSpec.java52
-rw-r--r--libjava/java/security/spec/DSAParameterSpec.java101
-rw-r--r--libjava/java/security/spec/DSAPrivateKeySpec.java113
-rw-r--r--libjava/java/security/spec/DSAPublicKeySpec.java113
-rw-r--r--libjava/java/security/spec/EncodedKeySpec.java85
-rw-r--r--libjava/java/security/spec/InvalidKeySpecException.java74
-rw-r--r--libjava/java/security/spec/InvalidParameterSpecException.java76
-rw-r--r--libjava/java/security/spec/KeySpec.java52
-rw-r--r--libjava/java/security/spec/PKCS8EncodedKeySpec.java81
-rw-r--r--libjava/java/security/spec/PSSParameterSpec.java90
-rw-r--r--libjava/java/security/spec/RSAKeyGenParameterSpec.java97
-rw-r--r--libjava/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java217
-rw-r--r--libjava/java/security/spec/RSAOtherPrimeInfo.java133
-rw-r--r--libjava/java/security/spec/RSAPrivateCrtKeySpec.java151
-rw-r--r--libjava/java/security/spec/RSAPrivateKeySpec.java88
-rw-r--r--libjava/java/security/spec/RSAPublicKeySpec.java88
-rw-r--r--libjava/java/security/spec/X509EncodedKeySpec.java82
-rw-r--r--libjava/java/sql/Array.java185
-rw-r--r--libjava/java/sql/BatchUpdateException.java141
-rw-r--r--libjava/java/sql/Blob.java131
-rw-r--r--libjava/java/sql/CallableStatement.java651
-rw-r--r--libjava/java/sql/Clob.java152
-rw-r--r--libjava/java/sql/Connection.java420
-rw-r--r--libjava/java/sql/DataTruncation.java157
-rw-r--r--libjava/java/sql/DatabaseMetaData.java2214
-rw-r--r--libjava/java/sql/Date.java188
-rw-r--r--libjava/java/sql/Driver.java123
-rw-r--r--libjava/java/sql/DriverManager.java346
-rw-r--r--libjava/java/sql/DriverPropertyInfo.java88
-rw-r--r--libjava/java/sql/ParameterMetaData.java103
-rw-r--r--libjava/java/sql/PreparedStatement.java438
-rw-r--r--libjava/java/sql/Ref.java75
-rw-r--r--libjava/java/sql/ResultSet.java1530
-rw-r--r--libjava/java/sql/ResultSetMetaData.java281
-rw-r--r--libjava/java/sql/SQLData.java72
-rw-r--r--libjava/java/sql/SQLException.java167
-rw-r--r--libjava/java/sql/SQLInput.java259
-rw-r--r--libjava/java/sql/SQLOutput.java257
-rw-r--r--libjava/java/sql/SQLPermission.java57
-rw-r--r--libjava/java/sql/SQLWarning.java120
-rw-r--r--libjava/java/sql/Savepoint.java55
-rw-r--r--libjava/java/sql/Statement.java366
-rw-r--r--libjava/java/sql/Struct.java77
-rw-r--r--libjava/java/sql/Time.java205
-rw-r--r--libjava/java/sql/Timestamp.java315
-rw-r--r--libjava/java/sql/Types.java85
-rw-r--r--libjava/java/text/Annotation.java113
-rw-r--r--libjava/java/text/AttributedCharacterIterator.java268
-rw-r--r--libjava/java/text/AttributedString.java425
-rw-r--r--libjava/java/text/AttributedStringIterator.java348
-rw-r--r--libjava/java/text/BreakIterator.java374
-rw-r--r--libjava/java/text/CharacterIterator.java144
-rw-r--r--libjava/java/text/ChoiceFormat.java503
-rw-r--r--libjava/java/text/CollationElementIterator.java467
-rw-r--r--libjava/java/text/CollationKey.java199
-rw-r--r--libjava/java/text/DecimalFormat.java1265
-rw-r--r--libjava/java/text/FieldPosition.java232
-rw-r--r--libjava/java/text/Format.java181
-rw-r--r--libjava/java/text/MessageFormat.java832
-rw-r--r--libjava/java/text/NumberFormat.java803
-rw-r--r--libjava/java/text/ParseException.java86
-rw-r--r--libjava/java/text/ParsePosition.java151
-rw-r--r--libjava/java/text/RuleBasedCollator.java1017
-rw-r--r--libjava/java/text/StringCharacterIterator.java356
-rw-r--r--libjava/java/util/AbstractCollection.java470
-rw-r--r--libjava/java/util/AbstractList.java1225
-rw-r--r--libjava/java/util/AbstractMap.java749
-rw-r--r--libjava/java/util/AbstractSequentialList.java235
-rw-r--r--libjava/java/util/AbstractSet.java139
-rw-r--r--libjava/java/util/ArrayList.java591
-rw-r--r--libjava/java/util/Arrays.java2510
-rw-r--r--libjava/java/util/BitSet.java744
-rw-r--r--libjava/java/util/Collection.java288
-rw-r--r--libjava/java/util/Collections.java5493
-rw-r--r--libjava/java/util/Comparator.java119
-rw-r--r--libjava/java/util/ConcurrentModificationException.java92
-rw-r--r--libjava/java/util/Dictionary.java136
-rw-r--r--libjava/java/util/EmptyStackException.java69
-rw-r--r--libjava/java/util/Enumeration.java81
-rw-r--r--libjava/java/util/EventListener.java54
-rw-r--r--libjava/java/util/EventListenerProxy.java75
-rw-r--r--libjava/java/util/EventObject.java101
-rw-r--r--libjava/java/util/HashMap.java906
-rw-r--r--libjava/java/util/HashSet.java293
-rw-r--r--libjava/java/util/Hashtable.java1151
-rw-r--r--libjava/java/util/IdentityHashMap.java935
-rw-r--r--libjava/java/util/Iterator.java87
-rw-r--r--libjava/java/util/LinkedHashMap.java501
-rw-r--r--libjava/java/util/LinkedHashSet.java160
-rw-r--r--libjava/java/util/LinkedList.java958
-rw-r--r--libjava/java/util/List.java451
-rw-r--r--libjava/java/util/ListIterator.java170
-rw-r--r--libjava/java/util/ListResourceBundle.java140
-rw-r--r--libjava/java/util/Map.java338
-rw-r--r--libjava/java/util/MissingResourceException.java105
-rw-r--r--libjava/java/util/NoSuchElementException.java88
-rw-r--r--libjava/java/util/Observable.java180
-rw-r--r--libjava/java/util/Observer.java60
-rw-r--r--libjava/java/util/Properties.java574
-rw-r--r--libjava/java/util/PropertyPermission.java271
-rw-r--r--libjava/java/util/PropertyPermissionCollection.java166
-rw-r--r--libjava/java/util/PropertyResourceBundle.java152
-rw-r--r--libjava/java/util/Random.java429
-rw-r--r--libjava/java/util/RandomAccess.java64
-rw-r--r--libjava/java/util/Set.java264
-rw-r--r--libjava/java/util/SortedMap.java173
-rw-r--r--libjava/java/util/SortedSet.java176
-rw-r--r--libjava/java/util/Stack.java158
-rw-r--r--libjava/java/util/StringTokenizer.java268
-rw-r--r--libjava/java/util/TimeZone.java1331
-rw-r--r--libjava/java/util/Timer.java615
-rw-r--r--libjava/java/util/TimerTask.java145
-rw-r--r--libjava/java/util/TooManyListenersException.java78
-rw-r--r--libjava/java/util/TreeMap.java1781
-rw-r--r--libjava/java/util/TreeSet.java416
-rw-r--r--libjava/java/util/Vector.java931
-rw-r--r--libjava/java/util/WeakHashMap.java881
-rw-r--r--libjava/java/util/jar/Attributes.java630
-rw-r--r--libjava/java/util/jar/JarEntry.java165
-rw-r--r--libjava/java/util/jar/JarException.java77
-rw-r--r--libjava/java/util/jar/JarFile.java1058
-rw-r--r--libjava/java/util/jar/JarInputStream.java200
-rw-r--r--libjava/java/util/jar/JarOutputStream.java113
-rw-r--r--libjava/java/util/jar/Manifest.java472
-rw-r--r--libjava/java/util/logging/ConsoleHandler.java125
-rw-r--r--libjava/java/util/logging/ErrorManager.java194
-rw-r--r--libjava/java/util/logging/FileHandler.java506
-rw-r--r--libjava/java/util/logging/Filter.java64
-rw-r--r--libjava/java/util/logging/Formatter.java171
-rw-r--r--libjava/java/util/logging/Handler.java386
-rw-r--r--libjava/java/util/logging/Level.java414
-rw-r--r--libjava/java/util/logging/LogRecord.java672
-rw-r--r--libjava/java/util/logging/LoggingPermission.java73
-rw-r--r--libjava/java/util/logging/MemoryHandler.java345
-rw-r--r--libjava/java/util/logging/SimpleFormatter.java119
-rw-r--r--libjava/java/util/logging/SocketHandler.java221
-rw-r--r--libjava/java/util/logging/StreamHandler.java521
-rw-r--r--libjava/java/util/logging/XMLFormatter.java387
-rw-r--r--libjava/java/util/prefs/AbstractPreferences.java1272
-rw-r--r--libjava/java/util/prefs/BackingStoreException.java104
-rw-r--r--libjava/java/util/prefs/InvalidPreferencesFormatException.java116
-rw-r--r--libjava/java/util/prefs/NodeChangeEvent.java91
-rw-r--r--libjava/java/util/prefs/NodeChangeListener.java64
-rw-r--r--libjava/java/util/prefs/PreferenceChangeEvent.java105
-rw-r--r--libjava/java/util/prefs/PreferenceChangeListener.java60
-rw-r--r--libjava/java/util/prefs/Preferences.java668
-rw-r--r--libjava/java/util/prefs/PreferencesFactory.java65
-rw-r--r--libjava/java/util/regex/Matcher.java301
-rw-r--r--libjava/java/util/regex/Pattern.java253
-rw-r--r--libjava/java/util/regex/PatternSyntaxException.java132
-rw-r--r--libjava/java/util/zip/Adler32.java205
-rw-r--r--libjava/java/util/zip/CRC32.java132
-rw-r--r--libjava/java/util/zip/CheckedInputStream.java135
-rw-r--r--libjava/java/util/zip/CheckedOutputStream.java100
-rw-r--r--libjava/java/util/zip/Checksum.java86
-rw-r--r--libjava/java/util/zip/DataFormatException.java71
-rw-r--r--libjava/java/util/zip/ZipConstants.java97
-rw-r--r--libjava/java/util/zip/ZipException.java72
-rw-r--r--libjava/java/util/zip/ZipInputStream.java371
-rw-r--r--libjava/java/util/zip/ZipOutputStream.java399
-rw-r--r--libjava/javax/accessibility/Accessible.java61
-rw-r--r--libjava/javax/accessibility/AccessibleAction.java82
-rw-r--r--libjava/javax/accessibility/AccessibleBundle.java120
-rw-r--r--libjava/javax/accessibility/AccessibleComponent.java321
-rw-r--r--libjava/javax/accessibility/AccessibleContext.java589
-rw-r--r--libjava/javax/accessibility/AccessibleEditableText.java142
-rw-r--r--libjava/javax/accessibility/AccessibleExtendedComponent.java78
-rw-r--r--libjava/javax/accessibility/AccessibleExtendedTable.java81
-rw-r--r--libjava/javax/accessibility/AccessibleHyperlink.java139
-rw-r--r--libjava/javax/accessibility/AccessibleHypertext.java84
-rw-r--r--libjava/javax/accessibility/AccessibleIcon.java85
-rw-r--r--libjava/javax/accessibility/AccessibleKeyBinding.java78
-rw-r--r--libjava/javax/accessibility/AccessibleRelation.java220
-rw-r--r--libjava/javax/accessibility/AccessibleRelationSet.java222
-rw-r--r--libjava/javax/accessibility/AccessibleResourceBundle.java74
-rw-r--r--libjava/javax/accessibility/AccessibleRole.java478
-rw-r--r--libjava/javax/accessibility/AccessibleSelection.java113
-rw-r--r--libjava/javax/accessibility/AccessibleState.java315
-rw-r--r--libjava/javax/accessibility/AccessibleStateSet.java172
-rw-r--r--libjava/javax/accessibility/AccessibleTable.java236
-rw-r--r--libjava/javax/accessibility/AccessibleTableModelChange.java102
-rw-r--r--libjava/javax/accessibility/AccessibleText.java185
-rw-r--r--libjava/javax/accessibility/AccessibleValue.java94
-rw-r--r--libjava/javax/crypto/BadPaddingException.java79
-rw-r--r--libjava/javax/crypto/Cipher.java1095
-rw-r--r--libjava/javax/crypto/CipherInputStream.java383
-rw-r--r--libjava/javax/crypto/CipherOutputStream.java268
-rw-r--r--libjava/javax/crypto/CipherSpi.java398
-rw-r--r--libjava/javax/crypto/EncryptedPrivateKeyInfo.java282
-rw-r--r--libjava/javax/crypto/ExemptionMechanism.java229
-rw-r--r--libjava/javax/crypto/ExemptionMechanismException.java78
-rw-r--r--libjava/javax/crypto/ExemptionMechanismSpi.java149
-rw-r--r--libjava/javax/crypto/IllegalBlockSizeException.java71
-rw-r--r--libjava/javax/crypto/KeyAgreement.java372
-rw-r--r--libjava/javax/crypto/KeyAgreementSpi.java160
-rw-r--r--libjava/javax/crypto/KeyGenerator.java283
-rw-r--r--libjava/javax/crypto/KeyGeneratorSpi.java112
-rw-r--r--libjava/javax/crypto/Mac.java413
-rw-r--r--libjava/javax/crypto/MacSpi.java145
-rw-r--r--libjava/javax/crypto/NoSuchPaddingException.java71
-rw-r--r--libjava/javax/crypto/NullCipher.java62
-rw-r--r--libjava/javax/crypto/NullCipherImpl.java127
-rw-r--r--libjava/javax/crypto/SealedObject.java355
-rw-r--r--libjava/javax/crypto/SecretKey.java65
-rw-r--r--libjava/javax/crypto/SecretKeyFactory.java247
-rw-r--r--libjava/javax/crypto/SecretKeyFactorySpi.java108
-rw-r--r--libjava/javax/crypto/ShortBufferException.java70
-rw-r--r--libjava/javax/crypto/interfaces/DHKey.java61
-rw-r--r--libjava/javax/crypto/interfaces/DHPrivateKey.java69
-rw-r--r--libjava/javax/crypto/interfaces/DHPublicKey.java68
-rw-r--r--libjava/javax/crypto/interfaces/PBEKey.java90
-rw-r--r--libjava/javax/crypto/spec/DESKeySpec.java220
-rw-r--r--libjava/javax/crypto/spec/DESedeKeySpec.java151
-rw-r--r--libjava/javax/crypto/spec/DHGenParameterSpec.java100
-rw-r--r--libjava/javax/crypto/spec/DHParameterSpec.java135
-rw-r--r--libjava/javax/crypto/spec/DHPrivateKeySpec.java115
-rw-r--r--libjava/javax/crypto/spec/DHPublicKeySpec.java115
-rw-r--r--libjava/javax/crypto/spec/IvParameterSpec.java96
-rw-r--r--libjava/javax/crypto/spec/PBEKeySpec.java176
-rw-r--r--libjava/javax/crypto/spec/PBEParameterSpec.java100
-rw-r--r--libjava/javax/crypto/spec/RC2ParameterSpec.java166
-rw-r--r--libjava/javax/crypto/spec/RC5ParameterSpec.java202
-rw-r--r--libjava/javax/crypto/spec/SecretKeySpec.java155
-rw-r--r--libjava/javax/imageio/IIOException.java69
-rw-r--r--libjava/javax/imageio/IIOImage.java138
-rw-r--r--libjava/javax/imageio/IIOParam.java171
-rw-r--r--libjava/javax/imageio/IIOParamController.java58
-rw-r--r--libjava/javax/imageio/ImageIO.java605
-rw-r--r--libjava/javax/imageio/ImageReadParam.java126
-rw-r--r--libjava/javax/imageio/ImageReader.java556
-rw-r--r--libjava/javax/imageio/ImageTranscoder.java54
-rw-r--r--libjava/javax/imageio/ImageTypeSpecifier.java94
-rw-r--r--libjava/javax/imageio/ImageWriteParam.java398
-rw-r--r--libjava/javax/imageio/ImageWriter.java390
-rw-r--r--libjava/javax/imageio/event/IIOReadProgressListener.java117
-rw-r--r--libjava/javax/imageio/event/IIOReadUpdateListener.java133
-rw-r--r--libjava/javax/imageio/event/IIOReadWarningListener.java55
-rw-r--r--libjava/javax/imageio/event/IIOWriteProgressListener.java102
-rw-r--r--libjava/javax/imageio/event/IIOWriteWarningListener.java60
-rw-r--r--libjava/javax/imageio/metadata/IIOAttr.java378
-rw-r--r--libjava/javax/imageio/metadata/IIOInvalidTreeException.java68
-rw-r--r--libjava/javax/imageio/metadata/IIOMetadata.java213
-rw-r--r--libjava/javax/imageio/metadata/IIOMetadataController.java47
-rw-r--r--libjava/javax/imageio/metadata/IIOMetadataFormat.java124
-rw-r--r--libjava/javax/imageio/metadata/IIOMetadataFormatImpl.java43
-rw-r--r--libjava/javax/imageio/metadata/IIOMetadataNode.java592
-rw-r--r--libjava/javax/imageio/metadata/IIONamedNodeMap.java138
-rw-r--r--libjava/javax/imageio/metadata/IIONodeList.java72
-rw-r--r--libjava/javax/imageio/spi/IIORegistry.java109
-rw-r--r--libjava/javax/imageio/spi/IIOServiceProvider.java163
-rw-r--r--libjava/javax/imageio/spi/ImageInputStreamSpi.java144
-rw-r--r--libjava/javax/imageio/spi/ImageOutputStreamSpi.java143
-rw-r--r--libjava/javax/imageio/spi/ImageReaderSpi.java121
-rw-r--r--libjava/javax/imageio/spi/ImageReaderWriterSpi.java425
-rw-r--r--libjava/javax/imageio/spi/ImageTranscoderSpi.java84
-rw-r--r--libjava/javax/imageio/spi/ImageWriterSpi.java135
-rw-r--r--libjava/javax/imageio/spi/RegisterableService.java83
-rw-r--r--libjava/javax/imageio/spi/ServiceRegistry.java961
-rw-r--r--libjava/javax/imageio/stream/FileCacheImageInputStream.java109
-rw-r--r--libjava/javax/imageio/stream/FileCacheImageOutputStream.java123
-rw-r--r--libjava/javax/imageio/stream/FileImageInputStream.java108
-rw-r--r--libjava/javax/imageio/stream/FileImageOutputStream.java133
-rw-r--r--libjava/javax/imageio/stream/IIOByteBuffer.java94
-rw-r--r--libjava/javax/imageio/stream/ImageInputStream.java650
-rw-r--r--libjava/javax/imageio/stream/ImageInputStreamImpl.java515
-rw-r--r--libjava/javax/imageio/stream/ImageOutputStream.java269
-rw-r--r--libjava/javax/imageio/stream/ImageOutputStreamImpl.java245
-rw-r--r--libjava/javax/imageio/stream/MemoryCacheImageInputStream.java98
-rw-r--r--libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java112
-rw-r--r--libjava/javax/naming/AuthenticationException.java53
-rw-r--r--libjava/javax/naming/AuthenticationNotSupportedException.java54
-rw-r--r--libjava/javax/naming/BinaryRefAddr.java156
-rw-r--r--libjava/javax/naming/Binding.java98
-rw-r--r--libjava/javax/naming/CannotProceedException.java105
-rw-r--r--libjava/javax/naming/CommunicationException.java53
-rw-r--r--libjava/javax/naming/CompositeName.java321
-rw-r--r--libjava/javax/naming/CompoundName.java498
-rw-r--r--libjava/javax/naming/ConfigurationException.java53
-rw-r--r--libjava/javax/naming/Context.java160
-rw-r--r--libjava/javax/naming/ContextNotEmptyException.java53
-rw-r--r--libjava/javax/naming/InitialContext.java393
-rw-r--r--libjava/javax/naming/InsufficientResourcesException.java53
-rw-r--r--libjava/javax/naming/InterruptedNamingException.java53
-rw-r--r--libjava/javax/naming/InvalidNameException.java66
-rw-r--r--libjava/javax/naming/LimitExceededException.java53
-rw-r--r--libjava/javax/naming/LinkException.java117
-rw-r--r--libjava/javax/naming/LinkLoopException.java53
-rw-r--r--libjava/javax/naming/LinkRef.java67
-rw-r--r--libjava/javax/naming/MalformedLinkException.java53
-rw-r--r--libjava/javax/naming/Name.java198
-rw-r--r--libjava/javax/naming/NameAlreadyBoundException.java53
-rw-r--r--libjava/javax/naming/NameClassPair.java101
-rw-r--r--libjava/javax/naming/NameNotFoundException.java53
-rw-r--r--libjava/javax/naming/NameParser.java46
-rw-r--r--libjava/javax/naming/NamingEnumeration.java48
-rw-r--r--libjava/javax/naming/NamingException.java315
-rw-r--r--libjava/javax/naming/NamingSecurityException.java55
-rw-r--r--libjava/javax/naming/NoInitialContextException.java53
-rw-r--r--libjava/javax/naming/NoPermissionException.java53
-rw-r--r--libjava/javax/naming/NotContextException.java53
-rw-r--r--libjava/javax/naming/OperationNotSupportedException.java52
-rw-r--r--libjava/javax/naming/PartialResultException.java53
-rw-r--r--libjava/javax/naming/RefAddr.java142
-rw-r--r--libjava/javax/naming/Reference.java194
-rw-r--r--libjava/javax/naming/Referenceable.java44
-rw-r--r--libjava/javax/naming/ReferralException.java68
-rw-r--r--libjava/javax/naming/ServiceUnavailableException.java53
-rw-r--r--libjava/javax/naming/SizeLimitExceededException.java53
-rw-r--r--libjava/javax/naming/StringRefAddr.java75
-rw-r--r--libjava/javax/naming/TimeLimitExceededException.java53
-rw-r--r--libjava/javax/naming/directory/Attribute.java70
-rw-r--r--libjava/javax/naming/directory/AttributeInUseException.java54
-rw-r--r--libjava/javax/naming/directory/AttributeModificationException.java77
-rw-r--r--libjava/javax/naming/directory/Attributes.java62
-rw-r--r--libjava/javax/naming/directory/BasicAttribute.java337
-rw-r--r--libjava/javax/naming/directory/BasicAttributes.java238
-rw-r--r--libjava/javax/naming/directory/DirContext.java83
-rw-r--r--libjava/javax/naming/directory/InitialDirContext.java265
-rw-r--r--libjava/javax/naming/directory/InvalidAttributeIdentifierException.java54
-rw-r--r--libjava/javax/naming/directory/InvalidAttributeValueException.java54
-rw-r--r--libjava/javax/naming/directory/InvalidAttributesException.java54
-rw-r--r--libjava/javax/naming/directory/InvalidSearchControlsException.java54
-rw-r--r--libjava/javax/naming/directory/InvalidSearchFilterException.java54
-rw-r--r--libjava/javax/naming/directory/ModificationItem.java80
-rw-r--r--libjava/javax/naming/directory/NoSuchAttributeException.java54
-rw-r--r--libjava/javax/naming/directory/SchemaViolationException.java54
-rw-r--r--libjava/javax/naming/directory/SearchControls.java137
-rw-r--r--libjava/javax/naming/directory/SearchResult.java94
-rw-r--r--libjava/javax/naming/event/EventContext.java65
-rw-r--r--libjava/javax/naming/event/EventDirContext.java65
-rw-r--r--libjava/javax/naming/event/NamespaceChangeListener.java51
-rw-r--r--libjava/javax/naming/event/NamingEvent.java120
-rw-r--r--libjava/javax/naming/event/NamingExceptionEvent.java75
-rw-r--r--libjava/javax/naming/event/NamingListener.java51
-rw-r--r--libjava/javax/naming/event/ObjectChangeListener.java49
-rw-r--r--libjava/javax/naming/ldap/Control.java56
-rw-r--r--libjava/javax/naming/ldap/ControlFactory.java107
-rw-r--r--libjava/javax/naming/ldap/ExtendedRequest.java57
-rw-r--r--libjava/javax/naming/ldap/ExtendedResponse.java52
-rw-r--r--libjava/javax/naming/ldap/HasControls.java51
-rw-r--r--libjava/javax/naming/ldap/InitialLdapContext.java133
-rw-r--r--libjava/javax/naming/ldap/LdapContext.java63
-rw-r--r--libjava/javax/naming/ldap/LdapReferralException.java68
-rw-r--r--libjava/javax/naming/ldap/UnsolicitedNotification.java52
-rw-r--r--libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java70
-rw-r--r--libjava/javax/naming/ldap/UnsolicitedNotificationListener.java51
-rw-r--r--libjava/javax/naming/spi/DirObjectFactory.java56
-rw-r--r--libjava/javax/naming/spi/DirStateFactory.java83
-rw-r--r--libjava/javax/naming/spi/DirectoryManager.java243
-rw-r--r--libjava/javax/naming/spi/InitialContextFactory.java49
-rw-r--r--libjava/javax/naming/spi/InitialContextFactoryBuilder.java49
-rw-r--r--libjava/javax/naming/spi/NamingManager.java398
-rw-r--r--libjava/javax/naming/spi/ObjectFactory.java51
-rw-r--r--libjava/javax/naming/spi/ObjectFactoryBuilder.java54
-rw-r--r--libjava/javax/naming/spi/ResolveResult.java126
-rw-r--r--libjava/javax/naming/spi/Resolver.java55
-rw-r--r--libjava/javax/naming/spi/StateFactory.java55
-rw-r--r--libjava/javax/net/ServerSocketFactory.java122
-rw-r--r--libjava/javax/net/SocketFactory.java157
-rw-r--r--libjava/javax/net/VanillaServerSocketFactory.java82
-rw-r--r--libjava/javax/net/VanillaSocketFactory.java88
-rw-r--r--libjava/javax/net/ssl/HandshakeCompletedEvent.java152
-rw-r--r--libjava/javax/net/ssl/HandshakeCompletedListener.java57
-rw-r--r--libjava/javax/net/ssl/HostnameVerifier.java64
-rw-r--r--libjava/javax/net/ssl/HttpsURLConnection.java280
-rw-r--r--libjava/javax/net/ssl/KeyManager.java51
-rw-r--r--libjava/javax/net/ssl/KeyManagerFactory.java280
-rw-r--r--libjava/javax/net/ssl/KeyManagerFactorySpi.java102
-rw-r--r--libjava/javax/net/ssl/ManagerFactoryParameters.java50
-rw-r--r--libjava/javax/net/ssl/SSLContext.java267
-rw-r--r--libjava/javax/net/ssl/SSLContextSpi.java109
-rw-r--r--libjava/javax/net/ssl/SSLException.java59
-rw-r--r--libjava/javax/net/ssl/SSLHandshakeException.java51
-rw-r--r--libjava/javax/net/ssl/SSLKeyException.java52
-rw-r--r--libjava/javax/net/ssl/SSLPeerUnverifiedException.java51
-rw-r--r--libjava/javax/net/ssl/SSLPermission.java66
-rw-r--r--libjava/javax/net/ssl/SSLProtocolException.java53
-rw-r--r--libjava/javax/net/ssl/SSLServerSocket.java188
-rw-r--r--libjava/javax/net/ssl/SSLServerSocketFactory.java172
-rw-r--r--libjava/javax/net/ssl/SSLSession.java168
-rw-r--r--libjava/javax/net/ssl/SSLSessionBindingEvent.java94
-rw-r--r--libjava/javax/net/ssl/SSLSessionBindingListener.java65
-rw-r--r--libjava/javax/net/ssl/SSLSessionContext.java103
-rw-r--r--libjava/javax/net/ssl/SSLSocket.java229
-rw-r--r--libjava/javax/net/ssl/SSLSocketFactory.java190
-rw-r--r--libjava/javax/net/ssl/TrivialHostnameVerifier.java51
-rw-r--r--libjava/javax/net/ssl/TrustManager.java47
-rw-r--r--libjava/javax/net/ssl/TrustManagerFactory.java278
-rw-r--r--libjava/javax/net/ssl/TrustManagerFactorySpi.java88
-rw-r--r--libjava/javax/net/ssl/X509KeyManager.java108
-rw-r--r--libjava/javax/net/ssl/X509TrustManager.java76
-rw-r--r--libjava/javax/print/AttributeException.java63
-rw-r--r--libjava/javax/print/CancelablePrintJob.java52
-rw-r--r--libjava/javax/print/Doc.java95
-rw-r--r--libjava/javax/print/DocFlavor.java322
-rw-r--r--libjava/javax/print/DocPrintJob.java104
-rw-r--r--libjava/javax/print/FlavorException.java52
-rw-r--r--libjava/javax/print/MultiDoc.java66
-rw-r--r--libjava/javax/print/MultiDocPrintJob.java60
-rw-r--r--libjava/javax/print/MultiDocPrintService.java53
-rw-r--r--libjava/javax/print/PrintException.java84
-rw-r--r--libjava/javax/print/PrintService.java226
-rw-r--r--libjava/javax/print/PrintServiceLookup.java76
-rw-r--r--libjava/javax/print/ServiceUIFactory.java89
-rw-r--r--libjava/javax/print/StreamPrintService.java97
-rw-r--r--libjava/javax/print/URIException.java65
-rw-r--r--libjava/javax/print/attribute/Attribute.java50
-rw-r--r--libjava/javax/print/attribute/AttributeSet.java77
-rw-r--r--libjava/javax/print/attribute/AttributeSetUtilities.java450
-rw-r--r--libjava/javax/print/attribute/DateTimeSyntax.java101
-rw-r--r--libjava/javax/print/attribute/DocAttribute.java45
-rw-r--r--libjava/javax/print/attribute/DocAttributeSet.java55
-rw-r--r--libjava/javax/print/attribute/EnumSyntax.java146
-rw-r--r--libjava/javax/print/attribute/HashAttributeSet.java366
-rw-r--r--libjava/javax/print/attribute/HashDocAttributeSet.java94
-rw-r--r--libjava/javax/print/attribute/HashPrintJobAttributeSet.java94
-rw-r--r--libjava/javax/print/attribute/HashPrintRequestAttributeSet.java94
-rw-r--r--libjava/javax/print/attribute/HashPrintServiceAttributeSet.java94
-rw-r--r--libjava/javax/print/attribute/IntegerSyntax.java122
-rw-r--r--libjava/javax/print/attribute/PrintJobAttribute.java45
-rw-r--r--libjava/javax/print/attribute/PrintJobAttributeSet.java55
-rw-r--r--libjava/javax/print/attribute/PrintRequestAttribute.java45
-rw-r--r--libjava/javax/print/attribute/PrintRequestAttributeSet.java55
-rw-r--r--libjava/javax/print/attribute/PrintServiceAttribute.java45
-rw-r--r--libjava/javax/print/attribute/PrintServiceAttributeSet.java55
-rw-r--r--libjava/javax/print/attribute/ResolutionSyntax.java218
-rw-r--r--libjava/javax/print/attribute/SetOfIntegerSyntax.java253
-rw-r--r--libjava/javax/print/attribute/Size2DSyntax.java225
-rw-r--r--libjava/javax/print/attribute/SupportedValuesAttribute.java45
-rw-r--r--libjava/javax/print/attribute/TextSyntax.java126
-rw-r--r--libjava/javax/print/attribute/URISyntax.java112
-rw-r--r--libjava/javax/print/attribute/UnmodifiableSetException.java65
-rw-r--r--libjava/javax/print/attribute/standard/Chromaticity.java86
-rw-r--r--libjava/javax/print/attribute/standard/ColorSupported.java84
-rw-r--r--libjava/javax/print/attribute/standard/Compression.java86
-rw-r--r--libjava/javax/print/attribute/standard/Copies.java101
-rw-r--r--libjava/javax/print/attribute/standard/CopiesSupported.java87
-rw-r--r--libjava/javax/print/attribute/standard/DateTimeAtCompleted.java100
-rw-r--r--libjava/javax/print/attribute/standard/DateTimeAtCreation.java100
-rw-r--r--libjava/javax/print/attribute/standard/DateTimeAtProcessing.java100
-rw-r--r--libjava/javax/print/attribute/standard/Destination.java82
-rw-r--r--libjava/javax/print/attribute/standard/DocumentName.java100
-rw-r--r--libjava/javax/print/attribute/standard/Fidelity.java85
-rw-r--r--libjava/javax/print/attribute/standard/Finishings.java102
-rw-r--r--libjava/javax/print/attribute/standard/JobHoldUntil.java101
-rw-r--r--libjava/javax/print/attribute/standard/JobImpressions.java101
-rw-r--r--libjava/javax/print/attribute/standard/JobImpressionsCompleted.java100
-rw-r--r--libjava/javax/print/attribute/standard/JobImpressionsSupported.java79
-rw-r--r--libjava/javax/print/attribute/standard/JobKOctets.java101
-rw-r--r--libjava/javax/print/attribute/standard/JobKOctetsProcessed.java100
-rw-r--r--libjava/javax/print/attribute/standard/JobKOctetsSupported.java79
-rw-r--r--libjava/javax/print/attribute/standard/JobMediaSheets.java101
-rw-r--r--libjava/javax/print/attribute/standard/JobMediaSheetsCompleted.java100
-rw-r--r--libjava/javax/print/attribute/standard/JobMediaSheetsSupported.java79
-rw-r--r--libjava/javax/print/attribute/standard/JobMessageFromOperator.java100
-rw-r--r--libjava/javax/print/attribute/standard/JobName.java101
-rw-r--r--libjava/javax/print/attribute/standard/JobOriginatingUserName.java100
-rw-r--r--libjava/javax/print/attribute/standard/JobPriority.java102
-rw-r--r--libjava/javax/print/attribute/standard/JobPrioritySupported.java101
-rw-r--r--libjava/javax/print/attribute/standard/JobSheets.java83
-rw-r--r--libjava/javax/print/attribute/standard/JobState.java88
-rw-r--r--libjava/javax/print/attribute/standard/JobStateReason.java109
-rw-r--r--libjava/javax/print/attribute/standard/JobStateReasons.java72
-rw-r--r--libjava/javax/print/attribute/standard/Media.java81
-rw-r--r--libjava/javax/print/attribute/standard/MediaPrintableArea.java146
-rw-r--r--libjava/javax/print/attribute/standard/MediaSize.java114
-rw-r--r--libjava/javax/print/attribute/standard/MediaSizeName.java135
-rw-r--r--libjava/javax/print/attribute/standard/MultipleDocumentHandling.java89
-rw-r--r--libjava/javax/print/attribute/standard/NumberOfDocuments.java100
-rw-r--r--libjava/javax/print/attribute/standard/NumberOfInterveningJobs.java100
-rw-r--r--libjava/javax/print/attribute/standard/NumberUp.java100
-rw-r--r--libjava/javax/print/attribute/standard/NumberUpSupported.java95
-rw-r--r--libjava/javax/print/attribute/standard/OrientationRequested.java90
-rw-r--r--libjava/javax/print/attribute/standard/OutputDeviceAssigned.java100
-rw-r--r--libjava/javax/print/attribute/standard/PDLOverrideSupported.java84
-rw-r--r--libjava/javax/print/attribute/standard/PageRanges.java97
-rw-r--r--libjava/javax/print/attribute/standard/PagesPerMinute.java101
-rw-r--r--libjava/javax/print/attribute/standard/PagesPerMinuteColor.java100
-rw-r--r--libjava/javax/print/attribute/standard/PresentationDirection.java97
-rw-r--r--libjava/javax/print/attribute/standard/PrintQuality.java85
-rw-r--r--libjava/javax/print/attribute/standard/PrinterInfo.java101
-rw-r--r--libjava/javax/print/attribute/standard/PrinterIsAcceptingJobs.java84
-rw-r--r--libjava/javax/print/attribute/standard/PrinterLocation.java101
-rw-r--r--libjava/javax/print/attribute/standard/PrinterMakeAndModel.java101
-rw-r--r--libjava/javax/print/attribute/standard/PrinterMessageFromOperator.java101
-rw-r--r--libjava/javax/print/attribute/standard/PrinterMoreInfo.java81
-rw-r--r--libjava/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java81
-rw-r--r--libjava/javax/print/attribute/standard/PrinterName.java101
-rw-r--r--libjava/javax/print/attribute/standard/PrinterResolution.java82
-rw-r--r--libjava/javax/print/attribute/standard/PrinterState.java84
-rw-r--r--libjava/javax/print/attribute/standard/PrinterStateReason.java140
-rw-r--r--libjava/javax/print/attribute/standard/PrinterStateReasons.java72
-rw-r--r--libjava/javax/print/attribute/standard/PrinterURI.java81
-rw-r--r--libjava/javax/print/attribute/standard/QueuedJobCount.java100
-rw-r--r--libjava/javax/print/attribute/standard/ReferenceUriSchemesSupported.java96
-rw-r--r--libjava/javax/print/attribute/standard/RequestingUserName.java101
-rw-r--r--libjava/javax/print/attribute/standard/Severity.java83
-rw-r--r--libjava/javax/print/attribute/standard/SheetCollate.java81
-rw-r--r--libjava/javax/print/attribute/standard/Sides.java89
-rw-r--r--libjava/javax/print/event/PrintEvent.java67
-rw-r--r--libjava/javax/print/event/PrintJobAdapter.java117
-rw-r--r--libjava/javax/print/event/PrintJobAttributeEvent.java85
-rw-r--r--libjava/javax/print/event/PrintJobAttributeListener.java52
-rw-r--r--libjava/javax/print/event/PrintJobEvent.java90
-rw-r--r--libjava/javax/print/event/PrintJobListener.java87
-rw-r--r--libjava/javax/print/event/PrintServiceAttributeEvent.java83
-rw-r--r--libjava/javax/print/event/PrintServiceAttributeListener.java52
-rw-r--r--libjava/javax/security/auth/AuthPermission.java146
-rw-r--r--libjava/javax/security/auth/DestroyFailedException.java67
-rw-r--r--libjava/javax/security/auth/Destroyable.java64
-rw-r--r--libjava/javax/security/auth/Policy.java79
-rw-r--r--libjava/javax/security/auth/PrivateCredentialPermission.java326
-rw-r--r--libjava/javax/security/auth/RefreshFailedException.java63
-rw-r--r--libjava/javax/security/auth/Refreshable.java65
-rw-r--r--libjava/javax/security/auth/Subject.java556
-rw-r--r--libjava/javax/security/auth/SubjectDomainCombiner.java96
-rw-r--r--libjava/javax/security/auth/callback/Callback.java64
-rw-r--r--libjava/javax/security/auth/callback/CallbackHandler.java155
-rw-r--r--libjava/javax/security/auth/callback/ChoiceCallback.java236
-rw-r--r--libjava/javax/security/auth/callback/ConfirmationCallback.java505
-rw-r--r--libjava/javax/security/auth/callback/LanguageCallback.java100
-rw-r--r--libjava/javax/security/auth/callback/NameCallback.java178
-rw-r--r--libjava/javax/security/auth/callback/PasswordCallback.java168
-rw-r--r--libjava/javax/security/auth/callback/TextInputCallback.java177
-rw-r--r--libjava/javax/security/auth/callback/TextOutputCallback.java140
-rw-r--r--libjava/javax/security/auth/callback/UnsupportedCallbackException.java101
-rw-r--r--libjava/javax/security/auth/login/AccountExpiredException.java64
-rw-r--r--libjava/javax/security/auth/login/AppConfigurationEntry.java135
-rw-r--r--libjava/javax/security/auth/login/Configuration.java120
-rw-r--r--libjava/javax/security/auth/login/CredentialExpiredException.java64
-rw-r--r--libjava/javax/security/auth/login/FailedLoginException.java63
-rw-r--r--libjava/javax/security/auth/login/LoginContext.java253
-rw-r--r--libjava/javax/security/auth/login/LoginException.java65
-rw-r--r--libjava/javax/security/auth/login/NullConfiguration.java62
-rw-r--r--libjava/javax/security/auth/spi/LoginModule.java122
-rw-r--r--libjava/javax/security/auth/x500/X500Principal.java530
-rw-r--r--libjava/javax/security/auth/x500/X500PrivateCredential.java149
-rw-r--r--libjava/javax/security/cert/Certificate.java176
-rw-r--r--libjava/javax/security/cert/CertificateEncodingException.java60
-rw-r--r--libjava/javax/security/cert/CertificateException.java60
-rw-r--r--libjava/javax/security/cert/CertificateExpiredException.java60
-rw-r--r--libjava/javax/security/cert/CertificateNotYetValidException.java60
-rw-r--r--libjava/javax/security/cert/CertificateParsingException.java59
-rw-r--r--libjava/javax/security/cert/X509CertBridge.java201
-rw-r--r--libjava/javax/security/cert/X509Certificate.java189
-rw-r--r--libjava/javax/security/sasl/AuthenticationException.java105
-rw-r--r--libjava/javax/security/sasl/AuthorizeCallback.java171
-rw-r--r--libjava/javax/security/sasl/RealmCallback.java75
-rw-r--r--libjava/javax/security/sasl/RealmChoiceCallback.java71
-rw-r--r--libjava/javax/security/sasl/Sasl.java690
-rw-r--r--libjava/javax/security/sasl/SaslClient.java230
-rw-r--r--libjava/javax/security/sasl/SaslClientFactory.java116
-rw-r--r--libjava/javax/security/sasl/SaslException.java183
-rw-r--r--libjava/javax/security/sasl/SaslServer.java225
-rw-r--r--libjava/javax/security/sasl/SaslServerFactory.java113
-rw-r--r--libjava/javax/sql/ConnectionEvent.java78
-rw-r--r--libjava/javax/sql/ConnectionEventListener.java57
-rw-r--r--libjava/javax/sql/ConnectionPoolDataSource.java79
-rw-r--r--libjava/javax/sql/DataSource.java80
-rw-r--r--libjava/javax/sql/PooledConnection.java68
-rw-r--r--libjava/javax/sql/RowSet.java187
-rw-r--r--libjava/javax/sql/RowSetEvent.java52
-rw-r--r--libjava/javax/sql/RowSetInternal.java74
-rw-r--r--libjava/javax/sql/RowSetListener.java53
-rw-r--r--libjava/javax/sql/RowSetMetaData.java95
-rw-r--r--libjava/javax/sql/RowSetReader.java49
-rw-r--r--libjava/javax/sql/RowSetWriter.java49
-rw-r--r--libjava/javax/sql/XAConnection.java51
-rw-r--r--libjava/javax/sql/XADataSource.java61
-rw-r--r--libjava/javax/swing/AbstractAction.java265
-rw-r--r--libjava/javax/swing/AbstractButton.java1945
-rw-r--r--libjava/javax/swing/AbstractCellEditor.java163
-rw-r--r--libjava/javax/swing/AbstractListModel.java179
-rw-r--r--libjava/javax/swing/AbstractSpinnerModel.java117
-rw-r--r--libjava/javax/swing/Action.java138
-rw-r--r--libjava/javax/swing/ActionMap.java210
-rw-r--r--libjava/javax/swing/BorderFactory.java449
-rw-r--r--libjava/javax/swing/BoundedRangeModel.java168
-rw-r--r--libjava/javax/swing/Box.java284
-rw-r--r--libjava/javax/swing/BoxLayout.java497
-rw-r--r--libjava/javax/swing/ButtonGroup.java179
-rw-r--r--libjava/javax/swing/ButtonModel.java82
-rw-r--r--libjava/javax/swing/CellEditor.java95
-rw-r--r--libjava/javax/swing/CellRendererPane.java256
-rw-r--r--libjava/javax/swing/ComboBoxEditor.java97
-rw-r--r--libjava/javax/swing/ComboBoxModel.java68
-rw-r--r--libjava/javax/swing/ComponentInputMap.java130
-rw-r--r--libjava/javax/swing/DebugGraphics.java885
-rw-r--r--libjava/javax/swing/DefaultBoundedRangeModel.java476
-rw-r--r--libjava/javax/swing/DefaultButtonModel.java537
-rw-r--r--libjava/javax/swing/DefaultCellEditor.java294
-rw-r--r--libjava/javax/swing/DefaultComboBoxModel.java239
-rw-r--r--libjava/javax/swing/DefaultDesktopManager.java627
-rw-r--r--libjava/javax/swing/DefaultFocusManager.java155
-rw-r--r--libjava/javax/swing/DefaultListCellRenderer.java179
-rw-r--r--libjava/javax/swing/DefaultListModel.java521
-rw-r--r--libjava/javax/swing/DefaultListSelectionModel.java620
-rw-r--r--libjava/javax/swing/DefaultSingleSelectionModel.java172
-rw-r--r--libjava/javax/swing/DesktopManager.java177
-rw-r--r--libjava/javax/swing/FocusManager.java186
-rw-r--r--libjava/javax/swing/GrayFilter.java85
-rw-r--r--libjava/javax/swing/Icon.java48
-rw-r--r--libjava/javax/swing/ImageIcon.java198
-rw-r--r--libjava/javax/swing/InputMap.java213
-rw-r--r--libjava/javax/swing/InputVerifier.java75
-rw-r--r--libjava/javax/swing/InternalFrameFocusTraversalPolicy.java55
-rw-r--r--libjava/javax/swing/JApplet.java176
-rw-r--r--libjava/javax/swing/JButton.java142
-rw-r--r--libjava/javax/swing/JCheckBox.java143
-rw-r--r--libjava/javax/swing/JCheckBoxMenuItem.java250
-rw-r--r--libjava/javax/swing/JColorChooser.java704
-rw-r--r--libjava/javax/swing/JComboBox.java1221
-rw-r--r--libjava/javax/swing/JComponent.java2279
-rw-r--r--libjava/javax/swing/JDesktopPane.java332
-rw-r--r--libjava/javax/swing/JDialog.java561
-rw-r--r--libjava/javax/swing/JEditorPane.java348
-rw-r--r--libjava/javax/swing/JFileChooser.java959
-rw-r--r--libjava/javax/swing/JFormattedTextField.java300
-rw-r--r--libjava/javax/swing/JFrame.java279
-rw-r--r--libjava/javax/swing/JInternalFrame.java1716
-rw-r--r--libjava/javax/swing/JLabel.java647
-rw-r--r--libjava/javax/swing/JLayeredPane.java560
-rw-r--r--libjava/javax/swing/JList.java1338
-rw-r--r--libjava/javax/swing/JMenu.java894
-rw-r--r--libjava/javax/swing/JMenuBar.java459
-rw-r--r--libjava/javax/swing/JMenuItem.java674
-rw-r--r--libjava/javax/swing/JOptionPane.java1547
-rw-r--r--libjava/javax/swing/JPanel.java114
-rw-r--r--libjava/javax/swing/JPasswordField.java270
-rw-r--r--libjava/javax/swing/JPopupMenu.java1074
-rw-r--r--libjava/javax/swing/JProgressBar.java654
-rw-r--r--libjava/javax/swing/JRadioButton.java258
-rw-r--r--libjava/javax/swing/JRadioButtonMenuItem.java212
-rw-r--r--libjava/javax/swing/JRootPane.java625
-rw-r--r--libjava/javax/swing/JScrollBar.java647
-rw-r--r--libjava/javax/swing/JScrollPane.java681
-rw-r--r--libjava/javax/swing/JSeparator.java208
-rw-r--r--libjava/javax/swing/JSlider.java907
-rw-r--r--libjava/javax/swing/JSpinner.java546
-rw-r--r--libjava/javax/swing/JSplitPane.java815
-rw-r--r--libjava/javax/swing/JTabbedPane.java1476
-rw-r--r--libjava/javax/swing/JTable.java1877
-rw-r--r--libjava/javax/swing/JTextArea.java480
-rw-r--r--libjava/javax/swing/JTextField.java428
-rw-r--r--libjava/javax/swing/JTextPane.java279
-rw-r--r--libjava/javax/swing/JToggleButton.java304
-rw-r--r--libjava/javax/swing/JToolBar.java779
-rw-r--r--libjava/javax/swing/JToolTip.java195
-rw-r--r--libjava/javax/swing/JTree.java1392
-rw-r--r--libjava/javax/swing/JViewport.java395
-rw-r--r--libjava/javax/swing/JWindow.java205
-rw-r--r--libjava/javax/swing/KeyStroke.java122
-rw-r--r--libjava/javax/swing/LayoutFocusTraversalPolicy.java87
-rw-r--r--libjava/javax/swing/ListCellRenderer.java49
-rw-r--r--libjava/javax/swing/ListModel.java81
-rw-r--r--libjava/javax/swing/ListSelectionModel.java82
-rw-r--r--libjava/javax/swing/LookAndFeel.java203
-rw-r--r--libjava/javax/swing/MenuElement.java92
-rw-r--r--libjava/javax/swing/MenuSelectionManager.java382
-rw-r--r--libjava/javax/swing/MutableComboBoxModel.java83
-rw-r--r--libjava/javax/swing/OverlayLayout.java191
-rw-r--r--libjava/javax/swing/Popup.java189
-rw-r--r--libjava/javax/swing/PopupFactory.java139
-rw-r--r--libjava/javax/swing/ProgressMonitor.java228
-rw-r--r--libjava/javax/swing/ProgressMonitorInputStream.java160
-rw-r--r--libjava/javax/swing/Renderer.java67
-rw-r--r--libjava/javax/swing/RepaintManager.java543
-rw-r--r--libjava/javax/swing/RootPaneContainer.java98
-rw-r--r--libjava/javax/swing/ScrollPaneConstants.java151
-rw-r--r--libjava/javax/swing/ScrollPaneLayout.java475
-rw-r--r--libjava/javax/swing/Scrollable.java50
-rw-r--r--libjava/javax/swing/SingleSelectionModel.java89
-rw-r--r--libjava/javax/swing/SizeRequirements.java171
-rw-r--r--libjava/javax/swing/SizeSequence.java249
-rw-r--r--libjava/javax/swing/SortingFocusTraversalPolicy.java333
-rw-r--r--libjava/javax/swing/SpinnerDateModel.java237
-rw-r--r--libjava/javax/swing/SpinnerListModel.java296
-rw-r--r--libjava/javax/swing/SpinnerModel.java109
-rw-r--r--libjava/javax/swing/SpinnerNumberModel.java298
-rw-r--r--libjava/javax/swing/Spring.java580
-rw-r--r--libjava/javax/swing/SpringLayout.java657
-rw-r--r--libjava/javax/swing/SwingConstants.java74
-rw-r--r--libjava/javax/swing/SwingUtilities.java1322
-rw-r--r--libjava/javax/swing/Timer.java485
-rw-r--r--libjava/javax/swing/ToolTipManager.java642
-rw-r--r--libjava/javax/swing/TransferHandler.java190
-rw-r--r--libjava/javax/swing/UIDefaults.java828
-rw-r--r--libjava/javax/swing/UIManager.java474
-rw-r--r--libjava/javax/swing/UnsupportedLookAndFeelException.java47
-rw-r--r--libjava/javax/swing/ViewportLayout.java169
-rw-r--r--libjava/javax/swing/WindowConstants.java72
-rw-r--r--libjava/javax/swing/border/AbstractBorder.java192
-rw-r--r--libjava/javax/swing/border/BevelBorder.java568
-rw-r--r--libjava/javax/swing/border/Border.java105
-rw-r--r--libjava/javax/swing/border/CompoundBorder.java257
-rw-r--r--libjava/javax/swing/border/EmptyBorder.java223
-rw-r--r--libjava/javax/swing/border/EtchedBorder.java411
-rw-r--r--libjava/javax/swing/border/LineBorder.java343
-rw-r--r--libjava/javax/swing/border/MatteBorder.java404
-rw-r--r--libjava/javax/swing/border/SoftBevelBorder.java329
-rw-r--r--libjava/javax/swing/border/TitledBorder.java1155
-rw-r--r--libjava/javax/swing/colorchooser/AbstractColorChooserPanel.java162
-rw-r--r--libjava/javax/swing/colorchooser/ColorChooserComponentFactory.java85
-rw-r--r--libjava/javax/swing/colorchooser/ColorSelectionModel.java81
-rw-r--r--libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java163
-rw-r--r--libjava/javax/swing/colorchooser/DefaultHSBChooserPanel.java891
-rw-r--r--libjava/javax/swing/colorchooser/DefaultPreviewPanel.java318
-rw-r--r--libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java402
-rw-r--r--libjava/javax/swing/colorchooser/DefaultSwatchChooserPanel.java893
-rw-r--r--libjava/javax/swing/event/AncestorEvent.java100
-rw-r--r--libjava/javax/swing/event/AncestorListener.java69
-rw-r--r--libjava/javax/swing/event/CaretEvent.java79
-rw-r--r--libjava/javax/swing/event/CaretListener.java56
-rw-r--r--libjava/javax/swing/event/CellEditorListener.java62
-rw-r--r--libjava/javax/swing/event/ChangeEvent.java59
-rw-r--r--libjava/javax/swing/event/ChangeListener.java57
-rw-r--r--libjava/javax/swing/event/DocumentEvent.java166
-rw-r--r--libjava/javax/swing/event/DocumentListener.java68
-rw-r--r--libjava/javax/swing/event/EventListenerList.java302
-rw-r--r--libjava/javax/swing/event/HyperlinkEvent.java162
-rw-r--r--libjava/javax/swing/event/HyperlinkListener.java57
-rw-r--r--libjava/javax/swing/event/InternalFrameAdapter.java113
-rw-r--r--libjava/javax/swing/event/InternalFrameEvent.java115
-rw-r--r--libjava/javax/swing/event/InternalFrameListener.java92
-rw-r--r--libjava/javax/swing/event/ListDataEvent.java98
-rw-r--r--libjava/javax/swing/event/ListDataListener.java69
-rw-r--r--libjava/javax/swing/event/ListSelectionEvent.java126
-rw-r--r--libjava/javax/swing/event/ListSelectionListener.java57
-rw-r--r--libjava/javax/swing/event/MenuDragMouseEvent.java115
-rw-r--r--libjava/javax/swing/event/MenuDragMouseListener.java74
-rw-r--r--libjava/javax/swing/event/MenuEvent.java59
-rw-r--r--libjava/javax/swing/event/MenuKeyEvent.java113
-rw-r--r--libjava/javax/swing/event/MenuKeyListener.java68
-rw-r--r--libjava/javax/swing/event/MenuListener.java68
-rw-r--r--libjava/javax/swing/event/MouseInputAdapter.java119
-rw-r--r--libjava/javax/swing/event/MouseInputListener.java52
-rw-r--r--libjava/javax/swing/event/PopupMenuEvent.java58
-rw-r--r--libjava/javax/swing/event/PopupMenuListener.java68
-rw-r--r--libjava/javax/swing/event/SwingPropertyChangeSupport.java255
-rw-r--r--libjava/javax/swing/event/TableColumnModelEvent.java105
-rw-r--r--libjava/javax/swing/event/TableColumnModelListener.java80
-rw-r--r--libjava/javax/swing/event/TableModelEvent.java158
-rw-r--r--libjava/javax/swing/event/TableModelListener.java55
-rw-r--r--libjava/javax/swing/event/TreeExpansionEvent.java89
-rw-r--r--libjava/javax/swing/event/TreeExpansionListener.java62
-rw-r--r--libjava/javax/swing/event/TreeModelEvent.java171
-rw-r--r--libjava/javax/swing/event/TreeModelListener.java74
-rw-r--r--libjava/javax/swing/event/TreeSelectionEvent.java190
-rw-r--r--libjava/javax/swing/event/TreeSelectionListener.java56
-rw-r--r--libjava/javax/swing/event/TreeWillExpandListener.java65
-rw-r--r--libjava/javax/swing/event/UndoableEditEvent.java92
-rw-r--r--libjava/javax/swing/event/UndoableEditListener.java56
-rw-r--r--libjava/javax/swing/filechooser/FileFilter.java80
-rw-r--r--libjava/javax/swing/filechooser/FileSystemView.java150
-rw-r--r--libjava/javax/swing/filechooser/FileView.java114
-rw-r--r--libjava/javax/swing/plaf/ActionMapUIResource.java64
-rw-r--r--libjava/javax/swing/plaf/BorderUIResource.java933
-rw-r--r--libjava/javax/swing/plaf/ButtonUI.java52
-rw-r--r--libjava/javax/swing/plaf/ColorChooserUI.java60
-rw-r--r--libjava/javax/swing/plaf/ColorUIResource.java114
-rw-r--r--libjava/javax/swing/plaf/ComboBoxUI.java96
-rw-r--r--libjava/javax/swing/plaf/ComponentInputMapUIResource.java70
-rw-r--r--libjava/javax/swing/plaf/ComponentUI.java326
-rw-r--r--libjava/javax/swing/plaf/DesktopIconUI.java56
-rw-r--r--libjava/javax/swing/plaf/DesktopPaneUI.java59
-rw-r--r--libjava/javax/swing/plaf/DimensionUIResource.java68
-rw-r--r--libjava/javax/swing/plaf/FileChooserUI.java138
-rw-r--r--libjava/javax/swing/plaf/FontUIResource.java101
-rw-r--r--libjava/javax/swing/plaf/IconUIResource.java122
-rw-r--r--libjava/javax/swing/plaf/InputMapUIResource.java63
-rw-r--r--libjava/javax/swing/plaf/InsetsUIResource.java77
-rw-r--r--libjava/javax/swing/plaf/InternalFrameUI.java59
-rw-r--r--libjava/javax/swing/plaf/LabelUI.java59
-rw-r--r--libjava/javax/swing/plaf/ListUI.java114
-rw-r--r--libjava/javax/swing/plaf/MenuBarUI.java59
-rw-r--r--libjava/javax/swing/plaf/MenuItemUI.java59
-rw-r--r--libjava/javax/swing/plaf/OptionPaneUI.java75
-rw-r--r--libjava/javax/swing/plaf/PanelUI.java58
-rw-r--r--libjava/javax/swing/plaf/PopupMenuUI.java117
-rw-r--r--libjava/javax/swing/plaf/ProgressBarUI.java59
-rw-r--r--libjava/javax/swing/plaf/RootPaneUI.java58
-rw-r--r--libjava/javax/swing/plaf/ScrollBarUI.java58
-rw-r--r--libjava/javax/swing/plaf/ScrollPaneUI.java59
-rw-r--r--libjava/javax/swing/plaf/SeparatorUI.java58
-rw-r--r--libjava/javax/swing/plaf/SliderUI.java59
-rw-r--r--libjava/javax/swing/plaf/SpinnerUI.java59
-rw-r--r--libjava/javax/swing/plaf/SplitPaneUI.java133
-rw-r--r--libjava/javax/swing/plaf/TabbedPaneUI.java111
-rw-r--r--libjava/javax/swing/plaf/TableHeaderUI.java59
-rw-r--r--libjava/javax/swing/plaf/TableUI.java59
-rw-r--r--libjava/javax/swing/plaf/TextUI.java284
-rw-r--r--libjava/javax/swing/plaf/ToolBarUI.java59
-rw-r--r--libjava/javax/swing/plaf/ToolTipUI.java59
-rw-r--r--libjava/javax/swing/plaf/TreeUI.java211
-rw-r--r--libjava/javax/swing/plaf/UIResource.java55
-rw-r--r--libjava/javax/swing/plaf/ViewportUI.java60
-rw-r--r--libjava/javax/swing/plaf/basic/BasicArrowButton.java350
-rw-r--r--libjava/javax/swing/plaf/basic/BasicBorders.java1815
-rw-r--r--libjava/javax/swing/plaf/basic/BasicButtonListener.java234
-rw-r--r--libjava/javax/swing/plaf/basic/BasicButtonUI.java421
-rw-r--r--libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java104
-rw-r--r--libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java67
-rw-r--r--libjava/javax/swing/plaf/basic/BasicColorChooserUI.java339
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java170
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java142
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboBoxUI.java1243
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboPopup.java1055
-rw-r--r--libjava/javax/swing/plaf/basic/BasicDesktopIconUI.java590
-rw-r--r--libjava/javax/swing/plaf/basic/BasicDesktopPaneUI.java464
-rw-r--r--libjava/javax/swing/plaf/basic/BasicEditorPaneUI.java68
-rw-r--r--libjava/javax/swing/plaf/basic/BasicFormattedTextFieldUI.java62
-rw-r--r--libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java637
-rw-r--r--libjava/javax/swing/plaf/basic/BasicIconFactory.java238
-rw-r--r--libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java1014
-rw-r--r--libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java1652
-rw-r--r--libjava/javax/swing/plaf/basic/BasicLabelUI.java427
-rw-r--r--libjava/javax/swing/plaf/basic/BasicListUI.java870
-rw-r--r--libjava/javax/swing/plaf/basic/BasicLookAndFeel.java1033
-rw-r--r--libjava/javax/swing/plaf/basic/BasicMenuBarUI.java303
-rw-r--r--libjava/javax/swing/plaf/basic/BasicMenuItemUI.java1008
-rw-r--r--libjava/javax/swing/plaf/basic/BasicMenuUI.java518
-rw-r--r--libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java1323
-rw-r--r--libjava/javax/swing/plaf/basic/BasicPanelUI.java56
-rw-r--r--libjava/javax/swing/plaf/basic/BasicPasswordFieldUI.java67
-rw-r--r--libjava/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java114
-rw-r--r--libjava/javax/swing/plaf/basic/BasicPopupMenuUI.java401
-rw-r--r--libjava/javax/swing/plaf/basic/BasicProgressBarUI.java825
-rw-r--r--libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java102
-rw-r--r--libjava/javax/swing/plaf/basic/BasicRadioButtonUI.java87
-rw-r--r--libjava/javax/swing/plaf/basic/BasicRootPaneUI.java67
-rw-r--r--libjava/javax/swing/plaf/basic/BasicScrollBarUI.java1277
-rw-r--r--libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java130
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSeparatorUI.java269
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSliderUI.java2219
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSpinnerUI.java573
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java912
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSplitPaneUI.java1521
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java3064
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java224
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTableUI.java341
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextAreaUI.java68
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextFieldUI.java80
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextPaneUI.java68
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextUI.java496
-rw-r--r--libjava/javax/swing/plaf/basic/BasicToggleButtonUI.java62
-rw-r--r--libjava/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java127
-rw-r--r--libjava/javax/swing/plaf/basic/BasicToolBarUI.java1435
-rw-r--r--libjava/javax/swing/plaf/basic/BasicToolTipUI.java288
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTreeUI.java398
-rw-r--r--libjava/javax/swing/plaf/basic/BasicViewportUI.java235
-rw-r--r--libjava/javax/swing/plaf/basic/ComboPopup.java103
-rw-r--r--libjava/javax/swing/plaf/metal/DefaultMetalTheme.java143
-rw-r--r--libjava/javax/swing/plaf/metal/MetalBorders.java443
-rw-r--r--libjava/javax/swing/plaf/metal/MetalButtonUI.java101
-rw-r--r--libjava/javax/swing/plaf/metal/MetalCheckBoxUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalComboBoxUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalDesktopIconUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalInternalFrameUI.java88
-rw-r--r--libjava/javax/swing/plaf/metal/MetalLabelUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalLookAndFeel.java532
-rw-r--r--libjava/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java73
-rw-r--r--libjava/javax/swing/plaf/metal/MetalProgressBarUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalRadioButtonUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalRootPaneUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalScrollBarUI.java165
-rw-r--r--libjava/javax/swing/plaf/metal/MetalScrollPaneUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalSeparatorUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalSliderUI.java87
-rw-r--r--libjava/javax/swing/plaf/metal/MetalSplitPaneUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalTabbedPaneUI.java86
-rw-r--r--libjava/javax/swing/plaf/metal/MetalTextFieldUI.java86
-rw-r--r--libjava/javax/swing/plaf/metal/MetalTheme.java259
-rw-r--r--libjava/javax/swing/plaf/metal/MetalToggleButtonUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalToolBarUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalToolTipUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalTreeUI.java74
-rw-r--r--libjava/javax/swing/table/AbstractTableModel.java275
-rw-r--r--libjava/javax/swing/table/DefaultTableCellRenderer.java230
-rw-r--r--libjava/javax/swing/table/DefaultTableColumnModel.java542
-rw-r--r--libjava/javax/swing/table/DefaultTableModel.java582
-rw-r--r--libjava/javax/swing/table/JTableHeader.java631
-rw-r--r--libjava/javax/swing/table/TableCellEditor.java65
-rw-r--r--libjava/javax/swing/table/TableCellRenderer.java66
-rw-r--r--libjava/javax/swing/table/TableColumn.java554
-rw-r--r--libjava/javax/swing/table/TableColumnModel.java166
-rw-r--r--libjava/javax/swing/table/TableModel.java134
-rw-r--r--libjava/javax/swing/text/AbstractDocument.java912
-rw-r--r--libjava/javax/swing/text/AttributeSet.java72
-rw-r--r--libjava/javax/swing/text/BadLocationException.java65
-rw-r--r--libjava/javax/swing/text/Caret.java81
-rw-r--r--libjava/javax/swing/text/ChangedCharSetException.java100
-rw-r--r--libjava/javax/swing/text/ComponentView.java103
-rw-r--r--libjava/javax/swing/text/DefaultCaret.java315
-rw-r--r--libjava/javax/swing/text/DefaultEditorKit.java394
-rw-r--r--libjava/javax/swing/text/DefaultHighlighter.java257
-rw-r--r--libjava/javax/swing/text/DefaultStyledDocument.java195
-rw-r--r--libjava/javax/swing/text/Document.java221
-rw-r--r--libjava/javax/swing/text/DocumentFilter.java83
-rw-r--r--libjava/javax/swing/text/EditorKit.java96
-rw-r--r--libjava/javax/swing/text/Element.java54
-rw-r--r--libjava/javax/swing/text/FieldView.java101
-rw-r--r--libjava/javax/swing/text/GapContent.java356
-rw-r--r--libjava/javax/swing/text/Highlighter.java79
-rw-r--r--libjava/javax/swing/text/JTextComponent.java1564
-rw-r--r--libjava/javax/swing/text/Keymap.java60
-rw-r--r--libjava/javax/swing/text/LayeredHighlighter.java57
-rw-r--r--libjava/javax/swing/text/MutableAttributeSet.java85
-rw-r--r--libjava/javax/swing/text/NavigationFilter.java71
-rw-r--r--libjava/javax/swing/text/PasswordView.java170
-rw-r--r--libjava/javax/swing/text/PlainDocument.java166
-rw-r--r--libjava/javax/swing/text/PlainView.java206
-rw-r--r--libjava/javax/swing/text/Position.java62
-rw-r--r--libjava/javax/swing/text/Segment.java176
-rw-r--r--libjava/javax/swing/text/SimpleAttributeSet.java193
-rw-r--r--libjava/javax/swing/text/StringContent.java307
-rw-r--r--libjava/javax/swing/text/Style.java64
-rw-r--r--libjava/javax/swing/text/StyleConstants.java443
-rw-r--r--libjava/javax/swing/text/StyleContext.java703
-rw-r--r--libjava/javax/swing/text/StyledDocument.java145
-rw-r--r--libjava/javax/swing/text/StyledEditorKit.java503
-rw-r--r--libjava/javax/swing/text/TabExpander.java43
-rw-r--r--libjava/javax/swing/text/TabSet.java102
-rw-r--r--libjava/javax/swing/text/TabStop.java133
-rw-r--r--libjava/javax/swing/text/TabableView.java44
-rw-r--r--libjava/javax/swing/text/TextAction.java111
-rw-r--r--libjava/javax/swing/text/Utilities.java198
-rw-r--r--libjava/javax/swing/text/View.java264
-rw-r--r--libjava/javax/swing/text/ViewFactory.java50
-rw-r--r--libjava/javax/swing/text/html/HTML.java1294
-rw-r--r--libjava/javax/swing/text/html/HTMLDocument.java53
-rwxr-xr-xlibjava/javax/swing/text/html/HTMLEditorKit.java173
-rw-r--r--libjava/javax/swing/text/html/HTMLFrameHyperlinkEvent.java132
-rwxr-xr-xlibjava/javax/swing/text/html/parser/AttributeList.java294
-rwxr-xr-xlibjava/javax/swing/text/html/parser/ContentModel.java218
-rwxr-xr-xlibjava/javax/swing/text/html/parser/DTD.java607
-rwxr-xr-xlibjava/javax/swing/text/html/parser/DTDConstants.java290
-rw-r--r--libjava/javax/swing/text/html/parser/DocumentParser.java261
-rwxr-xr-xlibjava/javax/swing/text/html/parser/Element.java317
-rw-r--r--libjava/javax/swing/text/html/parser/Entity.java185
-rwxr-xr-xlibjava/javax/swing/text/html/parser/Parser.java436
-rw-r--r--libjava/javax/swing/text/html/parser/ParserDelegator.java208
-rwxr-xr-xlibjava/javax/swing/text/html/parser/TagElement.java142
-rw-r--r--libjava/javax/swing/text/rtf/ControlWordToken.java86
-rw-r--r--libjava/javax/swing/text/rtf/RTFEditorKit.java114
-rw-r--r--libjava/javax/swing/text/rtf/RTFParseException.java65
-rw-r--r--libjava/javax/swing/text/rtf/RTFParser.java195
-rw-r--r--libjava/javax/swing/text/rtf/RTFScanner.java268
-rw-r--r--libjava/javax/swing/text/rtf/TextToken.java65
-rw-r--r--libjava/javax/swing/text/rtf/Token.java91
-rw-r--r--libjava/javax/swing/tree/AbstractLayoutCache.java405
-rw-r--r--libjava/javax/swing/tree/DefaultMutableTreeNode.java954
-rw-r--r--libjava/javax/swing/tree/DefaultTreeCellEditor.java516
-rw-r--r--libjava/javax/swing/tree/DefaultTreeCellRenderer.java497
-rw-r--r--libjava/javax/swing/tree/DefaultTreeModel.java451
-rw-r--r--libjava/javax/swing/tree/DefaultTreeSelectionModel.java646
-rw-r--r--libjava/javax/swing/tree/ExpandVetoException.java83
-rw-r--r--libjava/javax/swing/tree/FixedHeightLayoutCache.java236
-rw-r--r--libjava/javax/swing/tree/MutableTreeNode.java104
-rw-r--r--libjava/javax/swing/tree/RowMapper.java54
-rw-r--r--libjava/javax/swing/tree/TreeCellEditor.java65
-rw-r--r--libjava/javax/swing/tree/TreeCellRenderer.java67
-rw-r--r--libjava/javax/swing/tree/TreeModel.java109
-rw-r--r--libjava/javax/swing/tree/TreeNode.java99
-rw-r--r--libjava/javax/swing/tree/TreePath.java300
-rw-r--r--libjava/javax/swing/tree/TreeSelectionModel.java84
-rw-r--r--libjava/javax/swing/tree/VariableHeightLayoutCache.java261
-rw-r--r--libjava/javax/swing/undo/AbstractUndoableEdit.java323
-rw-r--r--libjava/javax/swing/undo/CannotRedoException.java56
-rw-r--r--libjava/javax/swing/undo/CannotUndoException.java57
-rw-r--r--libjava/javax/swing/undo/CompoundEdit.java400
-rw-r--r--libjava/javax/swing/undo/StateEdit.java263
-rw-r--r--libjava/javax/swing/undo/StateEditable.java112
-rw-r--r--libjava/javax/swing/undo/UndoManager.java625
-rw-r--r--libjava/javax/swing/undo/UndoableEdit.java114
-rw-r--r--libjava/javax/swing/undo/UndoableEditSupport.java271
-rw-r--r--libjava/javax/transaction/HeuristicCommitException.java57
-rw-r--r--libjava/javax/transaction/HeuristicMixedException.java57
-rw-r--r--libjava/javax/transaction/HeuristicRollbackException.java57
-rw-r--r--libjava/javax/transaction/InvalidTransactionException.java58
-rw-r--r--libjava/javax/transaction/NotSupportedException.java57
-rw-r--r--libjava/javax/transaction/RollbackException.java57
-rw-r--r--libjava/javax/transaction/Status.java58
-rw-r--r--libjava/javax/transaction/Synchronization.java50
-rw-r--r--libjava/javax/transaction/SystemException.java65
-rw-r--r--libjava/javax/transaction/Transaction.java70
-rw-r--r--libjava/javax/transaction/TransactionManager.java72
-rw-r--r--libjava/javax/transaction/TransactionRequiredException.java58
-rw-r--r--libjava/javax/transaction/TransactionRolledbackException.java58
-rw-r--r--libjava/javax/transaction/UserTransaction.java64
-rw-r--r--libjava/javax/transaction/xa/XAException.java89
-rw-r--r--libjava/javax/transaction/xa/XAResource.java69
-rw-r--r--libjava/javax/transaction/xa/Xid.java53
-rw-r--r--libjava/javax/xml/XMLConstants.java126
-rw-r--r--libjava/javax/xml/datatype/DatatypeConfigurationException.java70
-rw-r--r--libjava/javax/xml/datatype/DatatypeConstants.java259
-rw-r--r--libjava/javax/xml/datatype/DatatypeFactory.java401
-rw-r--r--libjava/javax/xml/datatype/Duration.java295
-rw-r--r--libjava/javax/xml/datatype/XMLGregorianCalendar.java217
-rw-r--r--libjava/javax/xml/namespace/NamespaceContext.java66
-rw-r--r--libjava/javax/xml/namespace/QName.java160
-rw-r--r--libjava/javax/xml/parsers/DocumentBuilder.java203
-rw-r--r--libjava/javax/xml/parsers/DocumentBuilderFactory.java346
-rw-r--r--libjava/javax/xml/parsers/FactoryConfigurationError.java113
-rw-r--r--libjava/javax/xml/parsers/ParserConfigurationException.java66
-rw-r--r--libjava/javax/xml/parsers/SAXParser.java340
-rw-r--r--libjava/javax/xml/parsers/SAXParserFactory.java273
-rw-r--r--libjava/javax/xml/transform/ErrorListener.java66
-rw-r--r--libjava/javax/xml/transform/OutputKeys.java103
-rw-r--r--libjava/javax/xml/transform/Result.java72
-rw-r--r--libjava/javax/xml/transform/Source.java60
-rw-r--r--libjava/javax/xml/transform/SourceLocator.java70
-rw-r--r--libjava/javax/xml/transform/Templates.java67
-rw-r--r--libjava/javax/xml/transform/Transformer.java164
-rw-r--r--libjava/javax/xml/transform/TransformerConfigurationException.java103
-rw-r--r--libjava/javax/xml/transform/TransformerException.java241
-rw-r--r--libjava/javax/xml/transform/TransformerFactory.java284
-rw-r--r--libjava/javax/xml/transform/TransformerFactoryConfigurationError.java104
-rw-r--r--libjava/javax/xml/transform/URIResolver.java58
-rw-r--r--libjava/javax/xml/transform/dom/DOMLocator.java57
-rw-r--r--libjava/javax/xml/transform/dom/DOMResult.java163
-rw-r--r--libjava/javax/xml/transform/dom/DOMSource.java118
-rw-r--r--libjava/javax/xml/transform/sax/SAXResult.java132
-rw-r--r--libjava/javax/xml/transform/sax/SAXSource.java197
-rw-r--r--libjava/javax/xml/transform/sax/SAXTransformerFactory.java115
-rw-r--r--libjava/javax/xml/transform/sax/TemplatesHandler.java68
-rw-r--r--libjava/javax/xml/transform/sax/TransformerHandler.java78
-rw-r--r--libjava/javax/xml/transform/stream/StreamResult.java173
-rw-r--r--libjava/javax/xml/transform/stream/StreamSource.java210
-rw-r--r--libjava/javax/xml/validation/Schema.java61
-rw-r--r--libjava/javax/xml/validation/SchemaFactory.java168
-rw-r--r--libjava/javax/xml/validation/TypeInfoProvider.java83
-rw-r--r--libjava/javax/xml/validation/Validator.java117
-rw-r--r--libjava/javax/xml/validation/ValidatorHandler.java115
-rw-r--r--libjava/javax/xml/xpath/XPath.java115
-rw-r--r--libjava/javax/xml/xpath/XPathConstants.java87
-rw-r--r--libjava/javax/xml/xpath/XPathException.java86
-rw-r--r--libjava/javax/xml/xpath/XPathExpression.java86
-rw-r--r--libjava/javax/xml/xpath/XPathExpressionException.java60
-rw-r--r--libjava/javax/xml/xpath/XPathFactory.java227
-rw-r--r--libjava/javax/xml/xpath/XPathFactoryConfigurationException.java60
-rw-r--r--libjava/javax/xml/xpath/XPathFunction.java58
-rw-r--r--libjava/javax/xml/xpath/XPathFunctionException.java60
-rw-r--r--libjava/javax/xml/xpath/XPathFunctionResolver.java59
-rw-r--r--libjava/javax/xml/xpath/XPathVariableResolver.java52
-rw-r--r--libjava/jni/classpath/classpath_jawt.h64
-rw-r--r--libjava/jni/classpath/native_state.c247
-rw-r--r--libjava/jni/classpath/native_state.h71
-rw-r--r--libjava/jni/gtk-peer/gdkfont.h142
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c70
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c401
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c692
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c1621
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c99
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c445
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c328
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c183
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c355
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c60
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c77
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c76
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c217
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c207
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c183
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c1078
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c82
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c1176
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c274
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c223
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c100
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c168
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c179
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c513
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c112
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c56
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c170
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c172
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c62
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c101
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c165
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c193
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c248
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c498
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c209
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c537
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c744
-rw-r--r--libjava/jni/gtk-peer/gthread-jni.c2592
-rw-r--r--libjava/jni/gtk-peer/gthread-jni.h48
-rw-r--r--libjava/jni/gtk-peer/gtk_jawt.c197
-rw-r--r--libjava/jni/gtk-peer/gtkcairopeer.h92
-rw-r--r--libjava/jni/gtk-peer/gtkpeer.h522
-rw-r--r--libjava/org/ietf/jgss/ChannelBinding.java215
-rw-r--r--libjava/org/ietf/jgss/GSSContext.java924
-rw-r--r--libjava/org/ietf/jgss/GSSCredential.java334
-rw-r--r--libjava/org/ietf/jgss/GSSException.java431
-rw-r--r--libjava/org/ietf/jgss/GSSManager.java501
-rw-r--r--libjava/org/ietf/jgss/GSSName.java269
-rw-r--r--libjava/org/ietf/jgss/MessageProp.java273
-rw-r--r--libjava/org/ietf/jgss/MessagesBundle.properties60
-rw-r--r--libjava/org/ietf/jgss/Oid.java385
-rw-r--r--libjava/scripts/classes.pl44
-rwxr-xr-xlibjava/scripts/makemake.tcl357
-rw-r--r--libjava/sources.am5323
-rw-r--r--libjava/standard.omit21
-rw-r--r--libjava/testsuite/Makefile.in8
-rw-r--r--libjava/testsuite/libjava.jni/jni.exp8
2817 files changed, 11668 insertions, 643410 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 4fae8576c86..8870799b4e5 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,28 @@
+2005-07-15 Tom Tromey <tromey@redhat.com>
+
+ Major merge with Classpath.
+ Removed many duplicate files.
+ * HACKING: Updated.x
+ * classpath: Imported new directory.
+ * standard.omit: New file.
+ * Makefile.in, aclocal.m4, configure: Rebuilt.
+ * sources.am: New file.
+ * configure.ac: Run Classpath configure script. Moved code around
+ to support. Disable xlib AWT peers (temporarily).
+ * Makefile.am (SUBDIRS): Added 'classpath'
+ (JAVAC): Removed.
+ (AM_CPPFLAGS): Added more -I options.
+ (BOOTCLASSPATH): Simplified.
+ Completely redid how sources are built.
+ Include sources.am.
+ * include/Makefile.am (tool_include__HEADERS): Removed jni.h.
+ * include/jni.h: Removed (in Classpath).
+ * scripts/classes.pl: Updated to look at built classes.
+ * scripts/makemake.tcl: New file.
+ * testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Added
+ -I options.
+ (gcj_jni_invocation_compile_c_to_binary): Likewise.
+
2005-07-15 Scott Gilbertson <scottg@mantatest.com>
* gnu/awt/xlib/XCanvasPeer.java (attributes): New field.
diff --git a/libjava/HACKING b/libjava/HACKING
index a26590596a1..df74b06414e 100644
--- a/libjava/HACKING
+++ b/libjava/HACKING
@@ -7,36 +7,46 @@ explained in this HACKING file. Please add them if you discover them :)
--
-A lot of the standard library files come from the GNU Classpath project.
-<http://www.gnu.org/software/classpath/>
-The libgcj and Classpath project have officially merged, but the merge
-is not yet complete. Our eventual goal is for Classpath to be an upstream
-source provider for libgcj, however it will be some time before this becomes
-reality: libgcj and Classpath have different implementations of many core
-java classes. In order to merge them, we need to select the best (most
-efficient, cleanest) implementation of each method/class/package, resolve
-any conflicts created by the merge, and test the final result.
-
-The merged files can be recognized by the standard Classpath copyright
-comments at the top of the file. If you make changes to these files
-then you should also check in the fix to Classpath. For small changes
-it may be easier to send a patch to the classpath mailinglist. For
-large changes, if you have direct write access to the libgcj tree,
-then you will also need to get a Classpath account and do the work
-yourself.
-<http://mail.gnu.org/mailman/listinfo/classpath/>
-<mailto:classpath@gnu.org>
-
-If you merge a libgcj class with a classpath class then you must update the
-copyright notice at the top of the file so others can see that this is a
-shared libgcj/classpath file.
+libgcj uses GNU Classpath as an upstream provider. Snapshots of
+Classpath are imported into the libgcj source tree. Some classes are
+overridden by local versions; these files still appear in the libgcj
+tree.
+
+To import a new release:
+
+- Check out a classpath snapshot
+- Use auto* to create configure, Makefile.in, etc
+ You have to make sure to use the gcc libtool.m4 and gcc lt* scripts
+ cd .../classpath
+ cp ../../lt* .
+ aclocal -I m4 -I ../..
+ autoconf
+ autoheader
+ automake
+ rm -rf autom4te.cache
+- Test everything first. The simplest way to do this is by overlaying
+ the checked out classpath on your gcc tree and then doing a build.
+- Use 'cvs import' to import. The vendor tag is 'CLASSPATH'. For the
+ release tag, if this is a released classpath version, use something
+ like 'classpath-import-VERSION'; otherwise something like
+ 'classpath-import-DATE'.
+ Be sure to use -ko and -I\!
+- Remove any files that were deleted in Classpath
+- Run 'scripts/makemake.tcl > sources.am' in the source tree
+- Run automake for libgcj
+
+Over time we plan to remove as many of the remaining divergences as
+possible.
+
+File additions and deletions require running scripts/makemake.tcl
+before running automake.
+
--
If you need to add new java files to libgcj then you have to edit the
Makefile.am file in the top (libjava) directory. And run automake.
-Tom Tromey adds:
If you add a class to java.lang, java.io, or java.util
(including sub-packages, like java.lang.ref).
@@ -45,8 +55,10 @@ If you add a class to java.lang, java.io, or java.util
* Go to the `namespace java' line, and delete that entire block (the
entire contents of the namespace)
-* Then insert the output of `perl ../scripts/classes.pl' into the file
- at that point.
+* Then insert the output of `perl scripts/classes.pl' into the file
+ at that point. This must be run from the build tree, in
+ <build>/classpath/lib; it uses the .class file name to determine
+ what to print.
If you're generating a patch there is a program you can get to do an
offline `cvs add' (it will fake an `add' if you don't have write
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index ac0457e224b..bd1c267d5dd 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -7,7 +7,7 @@ ACLOCAL_AMFLAGS = -I . -I ../config
# May be used by various substitution variables.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
-SUBDIRS = $(DIRLTDL) gcj include external
+SUBDIRS = $(DIRLTDL) gcj include classpath
if TESTSUBDIR
SUBDIRS += testsuite
endif
@@ -94,8 +94,6 @@ GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
-JAVAC = $(GCJ_WITH_FLAGS) -C
-
GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
WARNINGS = -Wextra -Wall
@@ -145,77 +143,23 @@ JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
LIBFFIINCS = @LIBFFIINCS@
-AM_CPPFLAGS = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \
+AM_CPPFLAGS = -I$(top_srcdir) \
+ -Iinclude -I$(top_srcdir)/include \
+ -I$(top_srcdir)/classpath/include \
+ -I$(top_srcdir)/classpath/native/fdlibm \
$(GCINCS) $(THREADINCS) $(INCLTDL) \
$(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
-BOOTCLASSPATH = $(here)'$(CLASSPATH_SEPARATOR)'$(srcdir)'$(CLASSPATH_SEPARATOR)'$(srcdir)/external/w3c_dom'$(CLASSPATH_SEPARATOR)'$(srcdir)/external/sax
+BOOTCLASSPATH = $(here)/classpath/lib
## ################################################################
-# Files for which we build .lo files
-all_native_compiled_source_files = \
- $(java_source_files) \
- $(built_java_source_files) \
- $(xlib_java_source_files)
-
-# Files for which we build .class files
-# It *must* begin with $(all_native_compiled_source_files)
-all_java_source_files = \
- $(all_native_compiled_source_files) \
- $(gtk_awt_peer_source_files) \
- $(gnu_xml_source_files) \
- $(javax_imageio_source_files) \
- $(javax_xml_source_files) \
- $(gnu_java_beans_source_files) \
- gnu/gcj/tools/gcj_dbtool/Main.java
-
-EXTRA_DIST = $(all_java_source_files)
-
-# Build dependencies between java, class and lo files. They are included
-# below, together with automatically-generated dependencies between Java
-# files.
-#
-# Dependencies from Java to .class files
-# --------------------------------------
-# Each directory's filelist file depends on the corresponding Java source files.
-# The stamp file depends on the filelist (using a `Static Pattern Rule').
-# Each class file depends on the its directory's .stamp file. This reflects
-# the fact that 1) all classfiles are compiled in one go when the .stamp file
-# is built and 2) anything which depends on a particular .class file must wait
-# until its directory is processed and the .stamp file is created.
-#
-# Dependencies from Java to .lo files
-# -----------------------------------
-# As above, each directory's filelist file depends on the corresponding Java
-# source files, and the stamp file depends on the filelist. For native
-# compilation, the lo file depends on the stamp file (also using a `Static
-# Pattern Rule'). So, when one Java file changes, the filelist file is
-# updated, the stamp file rule builds the .class files, and the .lo file rule
-# recompiles to native code.
-Makefile.deps: $(srcdir)/Makefile.in
- @: $(call write_entries_to_file,$(all_java_source_files),files.tmplist)
- echo 's,^\(.*\)/\([^/]*\)\.java$$,\1.list: &\' > tmpsed
- echo '\1/\2.class: \1.stamp,' >> tmpsed
- sed -ftmpsed files.tmplist > Makefile.deps
- rm files.tmplist tmpsed
-
-all_native_compiled_dirs = $(sort $(patsubst %/, %, $(dir $(all_native_compiled_source_files))))
-all_java_dirs = $(sort $(patsubst %/, %, $(dir $(all_java_source_files))))
-all_java_lo_files = $(all_native_compiled_dirs:=.lo)
-all_java_deps_files = $(all_java_dirs:=.deps)
-all_java_stamp_files = $(all_java_dirs:=.stamp)
-all_java_filelist_files = $(all_java_dirs:=.list)
-
# In the future these may be defined manually, if we decide to split libgcj.so
# into multiple shared libraries. For now, everything but xlib goes into
# all_libgcj_lo_files
all_xlib_lo_files = gnu/gcj/xlib.lo gnu/awt/xlib.lo
all_libgcj_lo_files = $(filter-out $(all_xlib_lo_files), $(all_java_lo_files))
-# Include automatically generated dependencies between Java source files.
--include Makefile.deps $(all_java_deps_files)
-
all_property_files = $(property_files) \
java/util/logging/logging.properties
@@ -233,7 +177,8 @@ libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc \
link.cc defineclass.cc interpret.cc verify.cc \
- $(nat_source_files) $(math_c_source_files)
+ java/lang/Class.java java/lang/Object.java \
+ $(nat_source_files)
if USING_BOEHMGC
libgcj_la_SOURCES += boehm.cc
@@ -282,14 +227,13 @@ libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
$(LIBLTDL) $(SYS_ZLIBS) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version`
libgcj_la_LIBADD = \
- $(all_libgcj_lo_files) \
- gnu-xml.lo javax-imageio.lo \
- javax-xml.lo gnu-java-beans.lo \
- external/sax/libsax-gcj.la \
- external/w3c_dom/libw3c-gcj.la \
- $(LIBFFI) $(ZLIBS) $(GCLIBS) $(propertyo_files)
+ classpath/native/fdlibm/libfdlibm.la \
+ $(all_packages_source_files:.list=.lo) \
+ $(bc_objects) \
+ $(propertyo_files) \
+ $(LIBFFI) $(ZLIBS) $(GCLIBS)
libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
- java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \
+ $(all_packages_source_files:.list=.lo) \
$(LIBLTDL) $(libgcj_la_LIBADD)
libgcj_la_LINK = $(LIBLINK)
@@ -304,210 +248,26 @@ $(db_name): gcj-dbtool$(EXEEXT)
## not available.
./gcj-dbtool -n $(db_name) || touch $(db_name)
-## Gtk JNI sources.
-lib_gnu_java_awt_peer_gtk_la_SOURCES = \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \
-jni/gtk-peer/gthread-jni.c \
-jni/gtk-peer/gtk_jawt.c \
-jni/classpath/native_state.c \
-jni/gtk-peer/gthread-jni.h \
-jni/gtk-peer/gtkpeer.h \
-jni/classpath/native_state.h
-
-# Gtk/Cairo JNI sources.
-if GTK_CAIRO
-lib_gnu_java_awt_peer_gtk_la_SOURCES += jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
-endif
-
-## Java sources for Gtk peers.
-gtk_awt_peer_source_files = \
-gnu/java/awt/peer/gtk/GdkTextLayout.java \
-gnu/java/awt/peer/gtk/GdkFontMetrics.java \
-gnu/java/awt/peer/gtk/GdkFontPeer.java \
-gnu/java/awt/peer/gtk/GdkGlyphVector.java \
-gnu/java/awt/peer/gtk/GdkGraphics.java \
-gnu/java/awt/peer/gtk/GdkGraphics2D.java \
-gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.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/GdkScreenGraphicsDevice.java \
-gnu/java/awt/peer/gtk/GtkButtonPeer.java \
-gnu/java/awt/peer/gtk/GtkCanvasPeer.java \
-gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.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/GtkClipboard.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/GtkEmbeddedWindowPeer.java \
-gnu/java/awt/peer/gtk/GtkFileDialogPeer.java \
-gnu/java/awt/peer/gtk/GtkFramePeer.java \
-gnu/java/awt/peer/gtk/GtkGenericPeer.java \
-gnu/java/awt/peer/gtk/GtkImage.java \
-gnu/java/awt/peer/gtk/GtkImagePainter.java \
-gnu/java/awt/peer/gtk/GtkLabelPeer.java \
-gnu/java/awt/peer/gtk/GtkListPeer.java \
-gnu/java/awt/peer/gtk/GtkMenuBarPeer.java \
-gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java \
-gnu/java/awt/peer/gtk/GtkMenuItemPeer.java \
-gnu/java/awt/peer/gtk/GtkMenuPeer.java \
-gnu/java/awt/peer/gtk/GtkOffScreenImage.java \
-gnu/java/awt/peer/gtk/GtkPanelPeer.java \
-gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java \
-gnu/java/awt/peer/gtk/GtkScrollPanePeer.java \
-gnu/java/awt/peer/gtk/GtkScrollbarPeer.java \
-gnu/java/awt/peer/gtk/GtkTextAreaPeer.java \
-gnu/java/awt/peer/gtk/GtkTextComponentPeer.java \
-gnu/java/awt/peer/gtk/GtkTextFieldPeer.java \
-gnu/java/awt/peer/gtk/GtkToolkit.java \
-gnu/java/awt/peer/gtk/GtkVolatileImage.java \
-gnu/java/awt/peer/gtk/GtkWindowPeer.java \
-gnu/java/awt/peer/gtk/GThreadMutex.java \
-gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java
-
-
-gtk_jni_headers = $(patsubst %.java,jniinclude/%.h,$(subst /,_,$(gtk_awt_peer_source_files)))
-
-jniinclude/gnu_java_awt_peer_gtk_GdkGraphics.h: gnu/java/awt/peer/gtk/GdkGraphics.java
-jniinclude/gnu_java_awt_peer_gtk_GdkGraphics2D.h: gnu/java/awt/peer/gtk/GdkGraphics2D.java
-jniinclude/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h: gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
-jniinclude/gnu_java_awt_peer_gtk_GdkPixbufDecoder.h: gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
-jniinclude/gnu_java_awt_peer_gtk_GtkButtonPeer.h: gnu/java/awt/peer/gtk/GtkButtonPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkCanvasPeer.h: gnu/java/awt/peer/gtk/GtkCanvasPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h: gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.h: gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxPeer.h: gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkChoicePeer.h: gnu/java/awt/peer/gtk/GtkChoicePeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkClipboard.h: gnu/java/awt/peer/gtk/GtkClipboard.java
-jniinclude/gnu_java_awt_peer_gtk_GtkComponentPeer.h: gnu/java/awt/peer/gtk/GtkComponentPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkContainerPeer.h: gnu/java/awt/peer/gtk/GtkContainerPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkDialogPeer.h: gnu/java/awt/peer/gtk/GtkDialogPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.h: gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkFileDialogPeer.h: gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkFontPeer.h: gnu/java/awt/peer/gtk/GtkFontPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkFramePeer.h: gnu/java/awt/peer/gtk/GtkFramePeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkGenericPeer.h: gnu/java/awt/peer/gtk/GtkGenericPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkImage.h: gnu/java/awt/peer/gtk/GtkImage.java
-jniinclude/gnu_java_awt_peer_gtk_GtkImagePainter.h: gnu/java/awt/peer/gtk/GtkImagePainter.java
-jniinclude/gnu_java_awt_peer_gtk_GtkLabelPeer.h: gnu/java/awt/peer/gtk/GtkLabelPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkListPeer.h: gnu/java/awt/peer/gtk/GtkListPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h: gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.h: gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkMenuItemPeer.h: gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkMenuPeer.h: gnu/java/awt/peer/gtk/GtkMenuPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkOffScreenImage.h: gnu/java/awt/peer/gtk/GtkOffScreenImage.java
-jniinclude/gnu_java_awt_peer_gtk_GtkPanelPeer.h: gnu/java/awt/peer/gtk/GtkPanelPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h: gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkScrollPanePeer.h: gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkScrollbarPeer.h: gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkTextAreaPeer.h: gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkTextComponentPeer.h: gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkTextFieldPeer.h: gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkToolkit.h: gnu/java/awt/peer/gtk/GtkToolkit.java
-jniinclude/gnu_java_awt_peer_gtk_GtkWindowPeer.h: gnu/java/awt/peer/gtk/GtkWindowPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GThreadMutex.h: gnu/java/awt/peer/gtk/GThreadMutex.java
-jniinclude/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.h: gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java
-jniinclude/gnu_java_awt_peer_gtk_GdkTextLayout.h: gnu/java/awt/peer/gtk/GdkTextLayout.java
-jniinclude/gnu_java_awt_peer_gtk_GdkFontPeer.h: gnu/java/awt/peer/gtk/GdkFontPeer.java
-
-$(gtk_jni_headers): %.h:
- @input=`echo $@ | sed -e 's,jniinclude/,,' -e 's,_,.,g' -e 's,.h$$,,'`; \
- echo "$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input"; \
- $(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input
-
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkFontPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphics2D.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphics.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkPixbufDecoder.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkTextLayout.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkButtonPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkCanvasPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxPeer.h $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkComponentPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkChoicePeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkClipboard.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkComponentPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkFileDialogPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkFramePeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkGenericPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkImagePainter.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkLabelPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkListPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuItemPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkPanelPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkScrollbarPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkScrollPanePeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkTextAreaPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkTextComponentPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkTextFieldPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkToolkit.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkWindowPeer.h
-
-
## For the peer library, DEPENDENCIES need to come before OBJECTS so
## that JNI headers are built before JNI C files.
$(lib_gnu_java_awt_peer_gtk_la_OBJECTS): $(lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES)
-lib_gnu_java_awt_peer_gtk_la_CFLAGS = \
- -Ijniinclude -I$(srcdir)/jni/classpath \
- -I$(srcdir)/jni/gtk-peer $(PEDANTIC_CFLAGS) $(GTK_CFLAGS) $(LIBART_CFLAGS) \
- $(X_CFLAGS) $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS)
-lib_gnu_java_awt_peer_gtk_la_GCJFLAGS = $(AM_GCJFLAGS) -fjni
-lib_gnu_java_awt_peer_gtk_la_LIBADD = gtk-awt-peer.lo $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS)
-lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = gtk-awt-peer.lo $(gtk_jni_headers) libgcj-$(gcc_version).jar libgcj.la libgcj.spec
+lib_gnu_java_awt_peer_gtk_la_SOURCES =
+lib_gnu_java_awt_peer_gtk_la_LIBADD = \
+ gnu-java-awt-peer-gtk.lo \
+ classpath/native/jni/gtk-peer/libgtkpeer.la \
+ $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS)
+lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = gnu-java-awt-peer-gtk.lo \
+ classpath/native/jni/gtk-peer/libgtkpeer.la \
+ libgcj-$(gcc_version).jar libgcj.la libgcj.spec
## The mysterious backslash in the grep pattern is consumed by make.
lib_gnu_java_awt_peer_gtk_la_LDFLAGS = \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
lib_gnu_java_awt_peer_gtk_la_LINK = $(LIBLINK)
libgcjawt_la_SOURCES = jawt.c
-libgcjawt_la_CFLAGS = -I$(srcdir)/jni/classpath $(PEDANTIC_CFLAGS) $(X_CFLAGS)
+libgcjawt_la_CFLAGS = -I$(srcdir)/classpath/native/jni/classpath \
+ $(PEDANTIC_CFLAGS) $(X_CFLAGS)
## See jv_convert_LDADD.
libgcjawt_la_LIBADD = -L$(here)/.libs lib-gnu-java-awt-peer-gtk.la
libgcjawt_la_LDFLAGS = \
@@ -534,72 +294,33 @@ lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
## Build property files into the library.
property_files = \
-gnu/regexp/MessagesBundle.properties \
-gnu/regexp/MessagesBundle_fr.properties \
-org/ietf/jgss/MessagesBundle.properties
-
-propertyo_files = $(property_files:.properties=.properties.lo)
-
-%.properties.lo: %.properties
- $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,`echo $@ | sed "s/\.lo$$//"`
-
-# Compile one directory in one go. If the files have to be compiled with the
-# binary compatibility ABI, only make the .class here -- the .lo is made
-# elsewhere in this Makefile.
-
-%.list:
- @: $(shell $(mkinstalldirs) $(basename $@))
- @: $(call write_entries_to_file,$^,$@)
-
-$(all_java_lo_files): %.lo: %.stamp
- $(LTGCJCOMPILE) -o $@ -c @${<:.stamp=.list}
-
-$(all_java_stamp_files): %.stamp: %.list
- $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(BOOTCLASSPATH) -d $(here) \
- -MD -MF ${@:.stamp=.deps} @$<
- echo timestamp > $@
-
-classes.stamp: $(all_property_files) $(all_java_stamp_files)
- echo timestamp > classes.stamp
-
-libgcj-$(gcc_version).jar: classes.stamp
- -@rm -f libgcj-$(gcc_version).jar
-## Note that we explicitly want to include directory information.
- (find java gnu javax org -type d -o -type f -name '*.class'; \
-## Ugly code to avoid "echo -C". Must separate each entry by a newline
-## Gross but easy.
- for file in $(all_property_files); do \
- echo "x-C" | sed -e 's/^.//'; \
- echo $(srcdir); \
- echo $$file; \
- done) | \
- sed -e '/\/xlib/d' -e '/\/\.libs/d' -e '/\/\.deps/d' | \
- $(ZIP) -cfM0E@ $@
-## Now include the classes from external/.
- for dir in sax w3c_dom; do \
- (cd external/$$dir; \
- find org -type f -name '*.class' -print | while read file; do \
- echo "x-C" | sed -e 's/^.//'; \
- echo external/$$dir; \
- echo $$file; \
- done) | \
- $(ZIP) -ufM0E@ $@; \
- done
-
-CLEANFILES = libgcj-$(gcc_version).jar classes.stamp $(all_java_stamp_files) \
+classpath/resource/org/ietf/jgss/MessagesBundle.properties \
+classpath/resource/java/util/iso4217.properties \
+classpath/resource/gnu/java/awt/peer/gtk/font.properties \
+classpath/resource/gnu/regexp/MessagesBundle_it.properties \
+classpath/resource/gnu/regexp/MessagesBundle_fr.properties \
+classpath/resource/gnu/regexp/MessagesBundle.properties
+
+propertyo_files = $(patsubst classpath/resource/%,%,$(property_files:.properties=.properties.lo))
+
+$(propertyo_files): %.properties.lo: classpath/resource/%.properties
+ $(mkinstalldirs) `dirname $@`; \
+ $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
+
+libgcj-$(gcc_version).jar:
+ jardir=`dirname $(ZIP)`; \
+ jardir=`cd $$jardir && pwd`; \
+ jarname=`basename $(ZIP)`; \
+ cd classpath/lib; $$jardir/$$jarname -cfM \
+ ../../libgcj-$(gcc_version).jar gnu java javax org
+
+CLEANFILES = libgcj-$(gcc_version).jar \
$(all_java_deps_files) $(all_java_filelist_files)
-DISTCLEANFILES = Makefile.deps native.dirs bytecompile.dirs
+DISTCLEANFILES = native.dirs
mostlyclean-local:
## Use libtool rm to remove each libtool object
find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
-## Remove headers. We use GNU make trickery because otherwise
-## the command line is too long.
- @: $(foreach header,$(nat_headers) $(xlib_nat_headers) $(gtk_jni_headers),$(shell rm -f '$(header)'))
-
-clean-local:
-## Remove every .class file that was created.
- find . -name '*.class' -print | xargs rm -f
distclean-local:
## Remove every .d file that was created.
@@ -609,7 +330,7 @@ distclean-local:
clean-nat:
rm -f $(nat_files) $(xlib_nat_files)
-SUFFIXES = .class .java .h .properties
+SUFFIXES = .class .java .h .properties .list
## Pass the list of object files to libtool in a temporary file to
## avoid tripping platform command line length limits.
@@ -621,66 +342,16 @@ lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPEND
## ################################################################
-##
-## Some packages must be built with the binary compatibility ABI. We
-## compile each such package into a .so, broken down more or less by
-## conceptual unit.
-##
+## Compiling a list of java sources to a single .o.
+
+%.lo: %.list
+ -mkdir $(dir $@) > /dev/null 2>&1
+ $(LTGCJCOMPILE) -c -o $@ -MT $@ -MD -MP -MF $(basename $@).deps @$<
-## Depend on the sources, even though we are going to compile the
-## classes.
-gnu-xml.lo: $(gnu_xml_source_files)
-## FIXME: this is ugly. We want to make sure the .class files have
-## been built, but we don't want a real dependency on them as this
-## would cause our target to be rebuilt whenever any .java file is
-## touched.
- $(MAKE) classes.stamp
- $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o gnu-xml.lo \
- `find gnu/xml -name '*.class' -print`
-
-## Depend on the sources, even though we are going to compile the
-## classes.
-javax-imageio.lo: $(javax_imageio_source_files)
-## FIXME: this is ugly. We want to make sure the .class files have
-## been built, but we don't want a real dependency on them as this
-## would cause our target to be rebuilt whenever any .java file is
-## touched.
- $(MAKE) classes.stamp
- $(LTGCJCOMPILE) -findirect-dispatch -c -o javax-imageio.lo \
- `find javax/imageio -name '*.class' -print`
-
-## Depend on the sources, even though we are going to compile the
-## classes.
-javax-xml.lo: $(javax_xml_source_files)
-## FIXME: this is ugly. We want to make sure the .class files have
-## been built, but we don't want a real dependency on them as this
-## would cause our target to be rebuilt whenever any .java file is
-## touched.
- $(MAKE) classes.stamp
- $(LTGCJCOMPILE) -findirect-dispatch -c -o javax-xml.lo \
- `find javax/xml -name '*.class' -print`
-
-## Depend on the sources, even though we are going to compile the
-## classes.
-gnu-java-beans.lo: $(gnu_java_beans_source_files)
-## FIXME: this is ugly. We want to make sure the .class files have
-## been built, but we don't want a real dependency on them as this
-## would cause our target to be rebuilt whenever any .java file is
-## touched.
- $(MAKE) classes.stamp
- $(LTGCJCOMPILE) -findirect-dispatch -c -o gnu-java-beans.lo \
- `find gnu/java/beans -name '*.class' -print`
-
-## Depend on the sources, even though we are going to compile the
-## classes.
-gtk-awt-peer.lo: $(gtk_awt_peer_source_files)
-## FIXME: this is ugly. We want to make sure the .class files have
-## been built, but we don't want a real dependency on them as this
-## would cause our target to be rebuilt whenever any .java file is
-## touched.
- $(MAKE) classes.stamp
- $(LTGCJCOMPILE) -findirect-dispatch -fjni -c -o gtk-awt-peer.lo \
- `find gnu/java/awt/peer/gtk -name '*.class' -print`
+## ################################################################
+
+## This pulls in a number of variable and target definitions.
+include sources.am
## ################################################################
@@ -688,13 +359,19 @@ gtk-awt-peer.lo: $(gtk_awt_peer_source_files)
## How to build header files.
##
-%.h: %.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) $(basename $<)
+## We have special rules for certain headers.
+omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
+ java/lang/String.h java/lang/reflect/Constructor.h \
+ java/lang/reflect/Field.h java/lang/reflect/Method.h \
+ java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
+
+generic_header_files = $(filter-out $(omitted_headers),$(ordinary_header_files) $(xlib_nat_headers)) \
+ gnu/gcj/tools/gcj_dbtool/Main.h
-## Header files used when compiling some of the nat* files.
-ordinary_nat_headers = \
- $(ordinary_java_source_files:.java=.h) \
- $(built_java_source_files:.java=.h)
+$(generic_header_files): %.h: classpath/lib/%.class
+ name=`echo $< | sed -e 's/\.class$$//' -e 's,classpath/lib/,,'`; \
+ $(mkinstalldirs) `dirname $$name`; \
+ $(GCJH) -d . -classpath '' -bootclasspath classpath/lib $$name
inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
java/io/ObjectInputStream$$GetField.h \
@@ -709,23 +386,22 @@ inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
gnu/java/nio/PipeImpl$$SourceChannelImpl.h \
$(PLATFORM_INNER_NAT_HDRS)
-nat_headers = $(ordinary_nat_headers) $(inner_nat_headers) gnu/gcj/tools/gcj_dbtool/Main.h
-nat_headers_install = $(ordinary_nat_headers)
+nat_headers = $(ordinary_header_files) $(inner_nat_headers) \
+ gnu/gcj/tools/gcj_dbtool/Main.h
+nat_headers_install = $(ordinary_header_files)
-xlib_nat_headers = $(xlib_java_source_files:.java=.h)
+xlib_nat_headers = $(patsubst %.java,%.h,$(xlib_java_source_files))
-$(ordinary_nat_headers) $(xlib_nat_headers): %.h: %.class
-
-java/lang/ClassLoader.h: java/lang/ClassLoader.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/ClassLoader.h: classpath/lib/java/lang/ClassLoader.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
-prepend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
-friend 'jclass (::_Jv_FindClass) (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
-friend 'void ::_Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
- $(basename $<)
+ java/lang/ClassLoader
-java/lang/Thread.h: java/lang/Thread.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/Thread.h: classpath/lib/java/lang/Thread.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'class _Jv_JNIEnv;' \
-prepend '#define _JV_NOT_OWNER 1' \
-prepend '#define _JV_INTERRUPTED 2' \
@@ -743,10 +419,10 @@ java/lang/Thread.h: java/lang/Thread.class
-friend 'java::lang::Thread* ::_Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
-friend 'java::lang::Thread* ::_Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
-friend 'jint (::_Jv_DetachCurrentThread) ();' \
- $(basename $<)
+ java/lang/Thread
-java/lang/String.h: java/lang/String.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/String.h: classpath/lib/java/lang/String.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'jchar* _Jv_GetStringChars (jstring str);' \
-prepend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \
-prepend 'jstring* _Jv_StringGetSlot (jstring);' \
@@ -759,92 +435,92 @@ java/lang/String.h: java/lang/String.class
-friend 'jstring (::_Jv_NewStringUtf8Const) (_Jv_Utf8Const* str);' \
-friend 'jstring (::_Jv_NewStringLatin1) (const char*, jsize);' \
-friend 'jstring (::_Jv_AllocString) (jsize);' \
- $(basename $<)
+ java/lang/String
-java/lang/reflect/Constructor.h: java/lang/reflect/Constructor.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/reflect/Constructor.h: classpath/lib/java/lang/reflect/Constructor.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \
-prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
-friend 'jmethodID (::_Jv_FromReflectedConstructor) (java::lang::reflect::Constructor *);' \
-friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
-friend 'class java::lang::Class;' \
- $(basename $<)
+ java/lang/reflect/Constructor
-java/lang/reflect/Field.h: java/lang/reflect/Field.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/reflect/Field.h: classpath/lib/java/lang/reflect/Field.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \
-prepend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
-friend 'jfieldID (::_Jv_FromReflectedField) (java::lang::reflect::Field *);' \
-friend 'jobject (::_Jv_JNI_ToReflectedField) (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
-friend 'class java::lang::Class;' \
- $(basename $<)
+ java/lang/reflect/Field
-java/lang/reflect/Method.h: java/lang/reflect/Method.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/reflect/Method.h: classpath/lib/java/lang/reflect/Method.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \
-prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
-friend 'jmethodID (::_Jv_FromReflectedMethod) (java::lang::reflect::Method *);' \
-friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
-friend 'class java::lang::Class;' \
-friend 'class java::io::ObjectInputStream;' \
- $(basename $<)
+ java/lang/reflect/Method
-java/lang/reflect/Proxy.h: java/lang/reflect/Proxy.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
- $(basename $<)
+java/lang/reflect/Proxy.h: classpath/lib/java/lang/reflect/Proxy.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
+ java/lang/reflect/Proxy
-java/lang/reflect/Proxy$$ProxyData.h: java/lang/reflect/Proxy.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/reflect/Proxy$$ProxyData.h: classpath/lib/java/lang/reflect/Proxy.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/lang/reflect/Proxy$$ProxyData'
-java/lang/reflect/Proxy$$ProxyType.h: java/lang/reflect/Proxy.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/reflect/Proxy$$ProxyType.h: classpath/lib/java/lang/reflect/Proxy.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/lang/reflect/Proxy$$ProxyType'
-gnu/gcj/runtime/ExtensionClassLoader.h: gnu/gcj/runtime/ExtensionClassLoader.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+gnu/gcj/runtime/ExtensionClassLoader.h: classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-friend 'class ::java::lang::ClassLoader;' \
- $(basename $<)
+ gnu/gcj/runtime/ExtensionClassLoader
-java/io/ObjectInputStream$$GetField.h: java/io/ObjectInputStream.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/io/ObjectInputStream$$GetField.h: classpath/lib/java/io/ObjectInputStream.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/io/ObjectInputStream$$GetField'
-java/io/ObjectOutputStream$$PutField.h: java/io/ObjectOutputStream.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/io/ObjectOutputStream$$PutField.h: classpath/lib/java/io/ObjectOutputStream.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/io/ObjectOutputStream$$PutField'
-java/nio/DirectByteBufferImpl$$ReadWrite.h: java/nio/DirectByteBufferImpl.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/nio/DirectByteBufferImpl$$ReadWrite.h: classpath/lib/java/nio/DirectByteBufferImpl.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/nio/DirectByteBufferImpl$$ReadWrite'
-java/nio/channels/Pipe$$SinkChannel.h: java/nio/channels/Pipe.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/nio/channels/Pipe$$SinkChannel.h: classpath/lib/java/nio/channels/Pipe.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/nio/channels/Pipe$$SinkChannel'
-java/nio/channels/Pipe$$SourceChannel.h: java/nio/channels/Pipe.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/nio/channels/Pipe$$SourceChannel.h: classpath/lib/java/nio/channels/Pipe.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/nio/channels/Pipe$$SourceChannel'
-gnu/java/net/PlainSocketImpl$$SocketInputStream.h: gnu/java/net/PlainSocketImpl.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+gnu/java/net/PlainSocketImpl$$SocketInputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'gnu/java/net/PlainSocketImpl$$SocketInputStream'
-gnu/java/net/PlainSocketImpl$$SocketOutputStream.h: gnu/java/net/PlainSocketImpl.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+gnu/java/net/PlainSocketImpl$$SocketOutputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'gnu/java/net/PlainSocketImpl$$SocketOutputStream'
-gnu/java/nio/PipeImpl$$SinkChannelImpl.h: gnu/java/nio/PipeImpl.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+gnu/java/nio/PipeImpl$$SinkChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'gnu/java/nio/PipeImpl$$SinkChannelImpl'
-gnu/java/nio/PipeImpl$$SourceChannelImpl.h: gnu/java/nio/PipeImpl.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+gnu/java/nio/PipeImpl$$SourceChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'gnu/java/nio/PipeImpl$$SourceChannelImpl'
## Only used by PosixProcess.java
-java/lang/ConcreteProcess$$ProcessManager.h: java/lang/ConcreteProcess.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/ConcreteProcess$$ProcessManager.h: classpath/lib/java/lang/ConcreteProcess.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/lang/ConcreteProcess$$ProcessManager'
## Headers we maintain by hand and which we want to install.
@@ -1022,8 +698,10 @@ jv_convert_LDADD = -L$(here)/.libs libgcj.la
## linking this program.
jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
-gcj_dbtool_SOURCES = gnu/gcj/tools/gcj_dbtool/Main.java \
- gnu/gcj/tools/gcj_dbtool/natMain.cc
+gcj_dbtool_SOURCES = \
+gnu/gcj/tools/gcj_dbtool/Main.java \
+gnu/gcj/tools/gcj_dbtool/natMain.cc
+
## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
## need this because we are explicitly using libtool to link using the
## `.la' file.
@@ -1078,2788 +756,6 @@ grmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
## ################################################################
-##
-## This section lists all the source files we care about.
-##
-
-convert_source_files = \
-gnu/gcj/convert/BytesToUnicode.java \
-gnu/gcj/convert/Convert.java \
-gnu/gcj/convert/Input_8859_1.java \
-gnu/gcj/convert/Input_ASCII.java \
-gnu/gcj/convert/Input_EUCJIS.java \
-gnu/gcj/convert/Input_JavaSrc.java \
-gnu/gcj/convert/Input_SJIS.java \
-gnu/gcj/convert/Input_UnicodeBig.java \
-gnu/gcj/convert/Input_UnicodeLittle.java \
-gnu/gcj/convert/Input_UTF8.java \
-gnu/gcj/convert/Input_iconv.java \
-gnu/gcj/convert/IOConverter.java \
-gnu/gcj/convert/Output_8859_1.java \
-gnu/gcj/convert/Output_ASCII.java \
-gnu/gcj/convert/Output_EUCJIS.java \
-gnu/gcj/convert/Output_JavaSrc.java \
-gnu/gcj/convert/Output_SJIS.java \
-gnu/gcj/convert/Output_UnicodeLittleUnmarked.java \
-gnu/gcj/convert/Output_UTF8.java \
-gnu/gcj/convert/Output_iconv.java \
-gnu/gcj/convert/UnicodeToBytes.java
-
-## List of all .java files for which the .h file is maintained by
-## hand.
-special_java_source_files = java/lang/Class.java java/lang/Object.java
-
-gnu_java_beans_source_files = \
-gnu/java/beans/decoder/AbstractContext.java \
-gnu/java/beans/decoder/AbstractCreatableObjectContext.java \
-gnu/java/beans/decoder/AbstractElementHandler.java \
-gnu/java/beans/decoder/AbstractObjectContext.java \
-gnu/java/beans/decoder/ArrayContext.java \
-gnu/java/beans/decoder/ArrayHandler.java \
-gnu/java/beans/decoder/AssemblyException.java \
-gnu/java/beans/decoder/BooleanHandler.java \
-gnu/java/beans/decoder/ByteHandler.java \
-gnu/java/beans/decoder/CharHandler.java \
-gnu/java/beans/decoder/ClassHandler.java \
-gnu/java/beans/decoder/ConstructorContext.java \
-gnu/java/beans/decoder/Context.java \
-gnu/java/beans/decoder/DecoderContext.java \
-gnu/java/beans/decoder/DefaultExceptionListener.java \
-gnu/java/beans/decoder/DoubleHandler.java \
-gnu/java/beans/decoder/DummyContext.java \
-gnu/java/beans/decoder/DummyHandler.java \
-gnu/java/beans/decoder/ElementHandler.java \
-gnu/java/beans/decoder/FloatHandler.java \
-gnu/java/beans/decoder/GrowableArrayContext.java \
-gnu/java/beans/decoder/IndexContext.java \
-gnu/java/beans/decoder/IntHandler.java \
-gnu/java/beans/decoder/JavaHandler.java \
-gnu/java/beans/decoder/LongHandler.java \
-gnu/java/beans/decoder/MethodContext.java \
-gnu/java/beans/decoder/MethodFinder.java \
-gnu/java/beans/decoder/NullHandler.java \
-gnu/java/beans/decoder/ObjectContext.java \
-gnu/java/beans/decoder/ObjectHandler.java \
-gnu/java/beans/decoder/PersistenceParser.java \
-gnu/java/beans/decoder/PropertyContext.java \
-gnu/java/beans/decoder/ShortHandler.java \
-gnu/java/beans/decoder/SimpleHandler.java \
-gnu/java/beans/decoder/StaticMethodContext.java \
-gnu/java/beans/decoder/StringHandler.java \
-gnu/java/beans/decoder/VoidHandler.java \
-gnu/java/beans/editors/ColorEditor.java \
-gnu/java/beans/editors/FontEditor.java \
-gnu/java/beans/editors/NativeBooleanEditor.java \
-gnu/java/beans/editors/NativeByteEditor.java \
-gnu/java/beans/editors/NativeDoubleEditor.java \
-gnu/java/beans/editors/NativeFloatEditor.java \
-gnu/java/beans/editors/NativeIntEditor.java \
-gnu/java/beans/editors/NativeLongEditor.java \
-gnu/java/beans/editors/NativeShortEditor.java \
-gnu/java/beans/editors/StringEditor.java \
-gnu/java/beans/BeanInfoEmbryo.java \
-gnu/java/beans/DummyAppletContext.java \
-gnu/java/beans/DummyAppletStub.java \
-gnu/java/beans/ExplicitBeanInfo.java \
-gnu/java/beans/IntrospectionIncubator.java
-
-awt_java_source_files = \
-gnu/awt/LightweightRedirector.java \
-gnu/awt/j2d/AbstractGraphicsState.java \
-gnu/awt/j2d/DirectRasterGraphics.java \
-gnu/awt/j2d/Graphics2DImpl.java \
-gnu/awt/j2d/IntegerGraphicsState.java \
-gnu/awt/j2d/MappedRaster.java \
-gnu/java/awt/BitMaskExtent.java \
-gnu/java/awt/Buffers.java \
-gnu/java/awt/BitwiseXORComposite.java \
-gnu/java/awt/ComponentDataBlitOp.java \
-gnu/java/awt/ClasspathToolkit.java \
-gnu/java/awt/EmbeddedWindow.java \
-gnu/java/awt/EmbeddedWindowSupport.java \
-gnu/java/awt/EventModifier.java \
-gnu/java/awt/color/CieXyzConverter.java \
-gnu/java/awt/color/ClutProfileConverter.java \
-gnu/java/awt/color/ColorLookUpTable.java \
-gnu/java/awt/color/ColorSpaceConverter.java \
-gnu/java/awt/color/GrayProfileConverter.java \
-gnu/java/awt/color/GrayScaleConverter.java \
-gnu/java/awt/color/LinearRGBConverter.java \
-gnu/java/awt/color/ProfileHeader.java \
-gnu/java/awt/color/PyccConverter.java \
-gnu/java/awt/color/RgbProfileConverter.java \
-gnu/java/awt/color/SrgbConverter.java \
-gnu/java/awt/color/TagEntry.java \
-gnu/java/awt/color/ToneReproductionCurve.java \
-gnu/java/awt/image/ImageDecoder.java \
-gnu/java/awt/image/XBMDecoder.java \
-gnu/java/awt/peer/EmbeddedWindowPeer.java \
-gnu/java/awt/peer/GLightweightPeer.java \
-gnu/java/awt/peer/ClasspathFontPeer.java \
-gnu/java/awt/peer/ClasspathTextLayoutPeer.java \
-gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.java \
-gnu/javax/swing/text/html/parser/support/parameterDefaulter.java \
-gnu/javax/swing/text/html/parser/support/Parser.java \
-gnu/javax/swing/text/html/parser/support/textPreProcessor.java \
-gnu/javax/swing/text/html/parser/support/low/Buffer.java \
-gnu/javax/swing/text/html/parser/support/low/Constants.java \
-gnu/javax/swing/text/html/parser/support/low/Location.java \
-gnu/javax/swing/text/html/parser/support/low/node.java \
-gnu/javax/swing/text/html/parser/support/low/ParseException.java \
-gnu/javax/swing/text/html/parser/support/low/pattern.java \
-gnu/javax/swing/text/html/parser/support/low/Queue.java \
-gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.java \
-gnu/javax/swing/text/html/parser/support/low/Token.java \
-gnu/javax/swing/text/html/parser/gnuDTD.java \
-gnu/javax/swing/text/html/parser/HTML_401F.java \
-gnu/javax/swing/text/html/parser/htmlAttributeSet.java \
-gnu/javax/swing/text/html/parser/htmlValidator.java \
-gnu/javax/swing/text/html/parser/models/list.java \
-gnu/javax/swing/text/html/parser/models/node.java \
-gnu/javax/swing/text/html/parser/models/noTagModel.java \
-gnu/javax/swing/text/html/parser/models/PCDATAonly_model.java \
-gnu/javax/swing/text/html/parser/models/TableRowContentModel.java \
-gnu/javax/swing/text/html/parser/models/transformer.java \
-java/applet/Applet.java \
-java/applet/AppletStub.java \
-java/applet/AppletContext.java \
-java/applet/AudioClip.java \
-java/awt/AWTError.java \
-java/awt/AWTEvent.java \
-java/awt/AWTEventMulticaster.java \
-java/awt/AWTException.java \
-java/awt/AWTPermission.java \
-java/awt/ActiveEvent.java \
-java/awt/Adjustable.java \
-java/awt/BorderLayout.java \
-java/awt/Button.java \
-java/awt/Canvas.java \
-java/awt/CardLayout.java \
-java/awt/Checkbox.java \
-java/awt/CheckboxGroup.java \
-java/awt/CheckboxMenuItem.java \
-java/awt/Choice.java \
-java/awt/Color.java \
-java/awt/Component.java \
-java/awt/ComponentOrientation.java \
-java/awt/Container.java \
-java/awt/Cursor.java \
-java/awt/Dialog.java \
-java/awt/Dimension.java \
-java/awt/Event.java \
-java/awt/EventDispatchThread.java \
-java/awt/EventQueue.java \
-java/awt/FileDialog.java \
-java/awt/FlowLayout.java \
-java/awt/Font.java \
-java/awt/FontMetrics.java \
-java/awt/Frame.java \
-java/awt/Graphics.java \
-java/awt/Graphics2D.java \
-java/awt/GraphicsConfiguration.java \
-java/awt/GridBagConstraints.java \
-java/awt/GridBagLayout.java \
-java/awt/GridBagLayoutInfo.java \
-java/awt/GridLayout.java \
-java/awt/IllegalComponentStateException.java \
-java/awt/Image.java \
-java/awt/Insets.java \
-java/awt/ItemSelectable.java \
-java/awt/Label.java \
-java/awt/LayoutManager.java \
-java/awt/LayoutManager2.java \
-java/awt/List.java \
-java/awt/Menu.java \
-java/awt/MenuBar.java \
-java/awt/MenuComponent.java \
-java/awt/MenuContainer.java \
-java/awt/MenuItem.java \
-java/awt/MenuShortcut.java \
-java/awt/Paint.java \
-java/awt/PaintContext.java \
-java/awt/Panel.java \
-java/awt/Point.java \
-java/awt/PopupMenu.java \
-java/awt/Rectangle.java \
-java/awt/RenderingHints.java \
-java/awt/ScrollPane.java \
-java/awt/Scrollbar.java \
-java/awt/Shape.java \
-java/awt/TextArea.java \
-java/awt/TextComponent.java \
-java/awt/TextField.java \
-java/awt/Toolkit.java \
-java/awt/Transparency.java \
-java/awt/Window.java \
-java/awt/color/ColorSpace.java \
-java/awt/color/ICC_ColorSpace.java \
-java/awt/color/ICC_Profile.java \
-java/awt/color/ICC_ProfileGray.java \
-java/awt/color/ICC_ProfileRGB.java \
-java/awt/color/CMMException.java \
-java/awt/color/ProfileDataException.java \
-java/awt/datatransfer/Clipboard.java \
-java/awt/datatransfer/ClipboardOwner.java \
-java/awt/datatransfer/DataFlavor.java \
-java/awt/datatransfer/FlavorMap.java \
-java/awt/datatransfer/MimeTypeParseException.java \
-java/awt/datatransfer/StringSelection.java \
-java/awt/datatransfer/SystemFlavorMap.java \
-java/awt/datatransfer/Transferable.java \
-java/awt/datatransfer/UnsupportedFlavorException.java \
-java/awt/datatransfer/FlavorTable.java \
-java/awt/event/AWTEventListener.java \
-java/awt/event/ActionEvent.java \
-java/awt/event/ActionListener.java \
-java/awt/event/AdjustmentEvent.java \
-java/awt/event/AdjustmentListener.java \
-java/awt/event/ComponentAdapter.java \
-java/awt/event/ComponentEvent.java \
-java/awt/event/ComponentListener.java \
-java/awt/event/ContainerAdapter.java \
-java/awt/event/ContainerEvent.java \
-java/awt/event/ContainerListener.java \
-java/awt/event/FocusAdapter.java \
-java/awt/event/FocusEvent.java \
-java/awt/event/FocusListener.java \
-java/awt/event/HierarchyBoundsAdapter.java \
-java/awt/event/HierarchyBoundsListener.java \
-java/awt/event/HierarchyEvent.java \
-java/awt/event/HierarchyListener.java \
-java/awt/event/InputEvent.java \
-java/awt/event/InputMethodEvent.java \
-java/awt/event/InputMethodListener.java \
-java/awt/event/InvocationEvent.java \
-java/awt/event/ItemEvent.java \
-java/awt/event/ItemListener.java \
-java/awt/event/KeyAdapter.java \
-java/awt/event/KeyEvent.java \
-java/awt/event/KeyListener.java \
-java/awt/event/MouseAdapter.java \
-java/awt/event/MouseEvent.java \
-java/awt/event/MouseListener.java \
-java/awt/event/MouseMotionAdapter.java \
-java/awt/event/MouseMotionListener.java \
-java/awt/event/PaintEvent.java \
-java/awt/event/TextEvent.java \
-java/awt/event/TextListener.java \
-java/awt/event/WindowAdapter.java \
-java/awt/event/WindowEvent.java \
-java/awt/event/WindowListener.java \
-java/awt/event/AWTEventListenerProxy.java \
-java/awt/event/MouseWheelEvent.java \
-java/awt/event/MouseWheelListener.java \
-java/awt/event/WindowFocusListener.java \
-java/awt/event/WindowStateListener.java \
-java/awt/font/FontRenderContext.java \
-java/awt/font/ShapeGraphicAttribute.java \
-java/awt/font/MultipleMaster.java \
-java/awt/font/TransformAttribute.java \
-java/awt/font/GlyphJustificationInfo.java \
-java/awt/font/LineBreakMeasurer.java \
-java/awt/font/TextMeasurer.java \
-java/awt/font/TextLayout.java \
-java/awt/font/LineMetrics.java \
-java/awt/font/TextAttribute.java \
-java/awt/font/GlyphMetrics.java \
-java/awt/font/OpenType.java \
-java/awt/font/GlyphVector.java \
-java/awt/font/GraphicAttribute.java \
-java/awt/font/ImageGraphicAttribute.java \
-java/awt/font/NumericShaper.java \
-java/awt/geom/AffineTransform.java \
-java/awt/geom/Dimension2D.java \
-java/awt/geom/Ellipse2D.java \
-java/awt/geom/IllegalPathStateException.java \
-java/awt/geom/NoninvertibleTransformException.java \
-java/awt/geom/PathIterator.java \
-java/awt/geom/Point2D.java \
-java/awt/geom/Rectangle2D.java \
-java/awt/geom/RectangularShape.java \
-java/awt/geom/RoundRectangle2D.java \
-java/awt/geom/Line2D.java \
-java/awt/geom/Arc2D.java \
-java/awt/geom/Area.java \
-java/awt/geom/CubicCurve2D.java \
-java/awt/geom/FlatteningPathIterator.java \
-java/awt/geom/GeneralPath.java \
-java/awt/geom/QuadCurve2D.java \
-java/awt/image/BandCombineOp.java \
-java/awt/image/BandedSampleModel.java \
-java/awt/image/AffineTransformOp.java \
-java/awt/image/BufferedImage.java \
-java/awt/image/BufferedImageFilter.java \
-java/awt/image/ByteLookupTable.java \
-java/awt/image/ColorConvertOp.java \
-java/awt/image/ColorModel.java \
-java/awt/image/ComponentColorModel.java \
-java/awt/image/ComponentSampleModel.java \
-java/awt/image/ConvolveOp.java \
-java/awt/image/DataBuffer.java \
-java/awt/image/DataBufferByte.java \
-java/awt/image/DataBufferDouble.java \
-java/awt/image/DataBufferFloat.java \
-java/awt/image/DataBufferInt.java \
-java/awt/image/DataBufferShort.java \
-java/awt/image/DataBufferUShort.java \
-java/awt/image/DirectColorModel.java \
-java/awt/image/ImageConsumer.java \
-java/awt/image/ImageObserver.java \
-java/awt/image/ImageProducer.java \
-java/awt/image/IndexColorModel.java \
-java/awt/image/Kernel.java \
-java/awt/image/LookupOp.java \
-java/awt/image/LookupTable.java \
-java/awt/image/MultiPixelPackedSampleModel.java \
-java/awt/image/PackedColorModel.java \
-java/awt/image/PixelInterleavedSampleModel.java \
-java/awt/image/Raster.java \
-java/awt/image/RasterOp.java \
-java/awt/image/RescaleOp.java \
-java/awt/image/SampleModel.java \
-java/awt/image/ShortLookupTable.java \
-java/awt/image/SinglePixelPackedSampleModel.java \
-java/awt/image/WritableRaster.java \
-java/awt/image/AreaAveragingScaleFilter.java \
-java/awt/image/CropImageFilter.java \
-java/awt/image/FilteredImageSource.java \
-java/awt/image/ImageFilter.java \
-java/awt/image/MemoryImageSource.java \
-java/awt/image/PixelGrabber.java \
-java/awt/image/RGBImageFilter.java \
-java/awt/image/ReplicateScaleFilter.java \
-java/awt/image/BufferStrategy.java \
-java/awt/image/BufferedImageOp.java \
-java/awt/image/ImagingOpException.java \
-java/awt/image/RasterFormatException.java \
-java/awt/image/RenderedImage.java \
-java/awt/image/TileObserver.java \
-java/awt/image/VolatileImage.java \
-java/awt/image/WritableRenderedImage.java \
-java/awt/image/renderable/ContextualRenderedImageFactory.java \
-java/awt/image/renderable/ParameterBlock.java \
-java/awt/image/renderable/RenderContext.java \
-java/awt/image/renderable/RenderableImage.java \
-java/awt/image/renderable/RenderableImageOp.java \
-java/awt/image/renderable/RenderableImageProducer.java \
-java/awt/image/renderable/RenderedImageFactory.java \
-java/awt/peer/ButtonPeer.java \
-java/awt/peer/CanvasPeer.java \
-java/awt/peer/CheckboxMenuItemPeer.java \
-java/awt/peer/CheckboxPeer.java \
-java/awt/peer/ChoicePeer.java \
-java/awt/peer/ComponentPeer.java \
-java/awt/peer/ContainerPeer.java \
-java/awt/peer/DialogPeer.java \
-java/awt/peer/FileDialogPeer.java \
-java/awt/peer/FontPeer.java \
-java/awt/peer/FramePeer.java \
-java/awt/peer/LabelPeer.java \
-java/awt/peer/LightweightPeer.java \
-java/awt/peer/ListPeer.java \
-java/awt/peer/MenuBarPeer.java \
-java/awt/peer/MenuComponentPeer.java \
-java/awt/peer/MenuItemPeer.java \
-java/awt/peer/MenuPeer.java \
-java/awt/peer/PanelPeer.java \
-java/awt/peer/PopupMenuPeer.java \
-java/awt/peer/RobotPeer.java \
-java/awt/peer/ScrollPanePeer.java \
-java/awt/peer/ScrollbarPeer.java \
-java/awt/peer/TextAreaPeer.java \
-java/awt/peer/TextComponentPeer.java \
-java/awt/peer/TextFieldPeer.java \
-java/awt/peer/WindowPeer.java \
-java/awt/SystemColor.java \
-java/awt/Polygon.java \
-java/awt/MediaTracker.java \
-java/awt/PrintGraphics.java \
-java/awt/PrintJob.java \
-java/awt/AWTKeyStroke.java \
-java/awt/AlphaComposite.java \
-java/awt/AttributeValue.java \
-java/awt/BasicStroke.java \
-java/awt/BufferCapabilities.java \
-java/awt/ColorPaintContext.java \
-java/awt/Composite.java \
-java/awt/CompositeContext.java \
-java/awt/ContainerOrderFocusTraversalPolicy.java \
-java/awt/DefaultFocusTraversalPolicy.java \
-java/awt/DefaultKeyboardFocusManager.java \
-java/awt/DisplayMode.java \
-java/awt/FocusTraversalPolicy.java \
-java/awt/FontFormatException.java \
-java/awt/GradientPaint.java \
-java/awt/GraphicsConfigTemplate.java \
-java/awt/GraphicsDevice.java \
-java/awt/GraphicsEnvironment.java \
-java/awt/HeadlessException.java \
-java/awt/ImageCapabilities.java \
-java/awt/JobAttributes.java \
-java/awt/KeyEventDispatcher.java \
-java/awt/KeyEventPostProcessor.java \
-java/awt/KeyboardFocusManager.java \
-java/awt/PageAttributes.java \
-java/awt/Robot.java \
-java/awt/ScrollPaneAdjustable.java \
-java/awt/Stroke.java \
-java/awt/TexturePaint.java \
-java/awt/dnd/peer/DragSourceContextPeer.java \
-java/awt/dnd/peer/DropTargetContextPeer.java \
-java/awt/dnd/peer/DropTargetPeer.java \
-java/awt/dnd/DnDConstants.java \
-java/awt/dnd/DnDEventMulticaster.java \
-java/awt/dnd/DragGestureEvent.java \
-java/awt/dnd/DragGestureListener.java \
-java/awt/dnd/DragGestureRecognizer.java \
-java/awt/dnd/DragSource.java \
-java/awt/dnd/DragSourceAdapter.java \
-java/awt/dnd/DragSourceContext.java \
-java/awt/dnd/DragSourceDragEvent.java \
-java/awt/dnd/DragSourceEvent.java \
-java/awt/dnd/DragSourceListener.java \
-java/awt/dnd/DragSourceMotionListener.java \
-java/awt/dnd/DropTarget.java \
-java/awt/dnd/InvalidDnDOperationException.java \
-java/awt/dnd/Autoscroll.java \
-java/awt/dnd/DragSourceDropEvent.java \
-java/awt/dnd/DropTargetAdapter.java \
-java/awt/dnd/DropTargetContext.java \
-java/awt/dnd/DropTargetDragEvent.java \
-java/awt/dnd/DropTargetDropEvent.java \
-java/awt/dnd/DropTargetEvent.java \
-java/awt/dnd/DropTargetListener.java \
-java/awt/dnd/MouseDragGestureRecognizer.java \
-java/awt/font/TextHitInfo.java \
-java/awt/im/spi/InputMethod.java \
-java/awt/im/spi/InputMethodContext.java \
-java/awt/im/spi/InputMethodDescriptor.java \
-java/awt/im/InputContext.java \
-java/awt/im/InputMethodHighlight.java \
-java/awt/im/InputMethodRequests.java \
-java/awt/im/InputSubset.java \
-java/awt/print/Book.java \
-java/awt/print/PageFormat.java \
-java/awt/print/Pageable.java \
-java/awt/print/Paper.java \
-java/awt/print/Printable.java \
-java/awt/print/PrinterAbortException.java \
-java/awt/print/PrinterException.java \
-java/awt/print/PrinterGraphics.java \
-java/awt/print/PrinterIOException.java \
-java/awt/print/PrinterJob.java \
-java/beans/beancontext/BeanContext.java \
-java/beans/beancontext/BeanContextChild.java \
-java/beans/beancontext/BeanContextChildComponentProxy.java \
-java/beans/beancontext/BeanContextChildSupport.java \
-java/beans/beancontext/BeanContextContainerProxy.java \
-java/beans/beancontext/BeanContextEvent.java \
-java/beans/beancontext/BeanContextMembershipEvent.java \
-java/beans/beancontext/BeanContextMembershipListener.java \
-java/beans/beancontext/BeanContextProxy.java \
-java/beans/beancontext/BeanContextServiceAvailableEvent.java \
-java/beans/beancontext/BeanContextServiceProvider.java \
-java/beans/beancontext/BeanContextServiceProviderBeanInfo.java \
-java/beans/beancontext/BeanContextServiceRevokedEvent.java \
-java/beans/beancontext/BeanContextServiceRevokedListener.java \
-java/beans/beancontext/BeanContextServices.java \
-java/beans/beancontext/BeanContextServicesListener.java \
-java/beans/beancontext/BeanContextServicesSupport.java \
-java/beans/beancontext/BeanContextSupport.java \
-java/beans/BeanDescriptor.java \
-java/beans/BeanInfo.java \
-java/beans/Beans.java \
-java/beans/Customizer.java \
-java/beans/DesignMode.java \
-java/beans/EventHandler.java \
-java/beans/EventSetDescriptor.java \
-java/beans/ExceptionListener.java \
-java/beans/Expression.java \
-java/beans/FeatureDescriptor.java \
-java/beans/IndexedPropertyDescriptor.java \
-java/beans/IntrospectionException.java \
-java/beans/Introspector.java \
-java/beans/MethodDescriptor.java \
-java/beans/ParameterDescriptor.java \
-java/beans/PropertyChangeEvent.java \
-java/beans/PropertyChangeListener.java \
-java/beans/PropertyChangeListenerProxy.java \
-java/beans/PropertyChangeSupport.java \
-java/beans/PropertyDescriptor.java \
-java/beans/PropertyEditor.java \
-java/beans/PropertyEditorManager.java \
-java/beans/PropertyEditorSupport.java \
-java/beans/PropertyVetoException.java \
-java/beans/Statement.java \
-java/beans/SimpleBeanInfo.java \
-java/beans/VetoableChangeListener.java \
-java/beans/VetoableChangeListenerProxy.java \
-java/beans/VetoableChangeSupport.java \
-java/beans/Visibility.java \
-java/beans/AppletInitializer.java \
-java/beans/XMLDecoder.java \
-javax/swing/border/AbstractBorder.java \
-javax/swing/border/BevelBorder.java \
-javax/swing/border/Border.java \
-javax/swing/border/CompoundBorder.java \
-javax/swing/border/EmptyBorder.java \
-javax/swing/border/EtchedBorder.java \
-javax/swing/border/LineBorder.java \
-javax/swing/border/MatteBorder.java \
-javax/swing/border/SoftBevelBorder.java \
-javax/swing/border/TitledBorder.java \
-javax/swing/GrayFilter.java \
-javax/swing/AbstractAction.java \
-javax/swing/AbstractButton.java \
-javax/swing/AbstractSpinnerModel.java \
-javax/swing/plaf/basic/BasicArrowButton.java \
-javax/swing/plaf/basic/BasicButtonListener.java \
-javax/swing/plaf/basic/BasicButtonUI.java \
-javax/swing/plaf/basic/BasicCheckBoxUI.java \
-javax/swing/plaf/basic/BasicColorChooserUI.java \
-javax/swing/plaf/basic/BasicComboBoxUI.java \
-javax/swing/plaf/basic/BasicComboBoxEditor.java \
-javax/swing/plaf/basic/BasicComboBoxRenderer.java \
-javax/swing/plaf/basic/BasicComboPopup.java \
-javax/swing/plaf/basic/BasicDesktopIconUI.java \
-javax/swing/plaf/basic/BasicDesktopPaneUI.java \
-javax/swing/plaf/basic/BasicEditorPaneUI.java \
-javax/swing/plaf/basic/BasicFormattedTextFieldUI.java \
-javax/swing/plaf/basic/BasicGraphicsUtils.java \
-javax/swing/plaf/basic/BasicInternalFrameTitlePane.java \
-javax/swing/plaf/basic/BasicInternalFrameUI.java \
-javax/swing/plaf/basic/BasicLabelUI.java \
-javax/swing/plaf/basic/BasicListUI.java \
-javax/swing/plaf/basic/BasicMenuUI.java \
-javax/swing/plaf/basic/BasicMenuBarUI.java \
-javax/swing/plaf/basic/BasicMenuItemUI.java \
-javax/swing/plaf/basic/BasicOptionPaneUI.java \
-javax/swing/plaf/basic/BasicPanelUI.java \
-javax/swing/plaf/basic/BasicPasswordFieldUI.java \
-javax/swing/plaf/basic/BasicPopupMenuUI.java \
-javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java \
-javax/swing/plaf/basic/BasicProgressBarUI.java \
-javax/swing/plaf/basic/BasicRootPaneUI.java \
-javax/swing/plaf/basic/BasicRadioButtonUI.java \
-javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java \
-javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java \
-javax/swing/plaf/basic/BasicScrollBarUI.java \
-javax/swing/plaf/basic/BasicScrollPaneUI.java \
-javax/swing/plaf/basic/BasicSeparatorUI.java \
-javax/swing/plaf/basic/BasicSliderUI.java \
-javax/swing/plaf/basic/BasicSpinnerUI.java \
-javax/swing/plaf/basic/BasicSplitPaneDivider.java \
-javax/swing/plaf/basic/BasicSplitPaneUI.java \
-javax/swing/plaf/basic/BasicTabbedPaneUI.java \
-javax/swing/plaf/basic/BasicTableUI.java \
-javax/swing/plaf/basic/BasicTableHeaderUI.java \
-javax/swing/plaf/basic/BasicTextAreaUI.java \
-javax/swing/plaf/basic/BasicTextFieldUI.java \
-javax/swing/plaf/basic/BasicTextPaneUI.java \
-javax/swing/plaf/basic/BasicTextUI.java \
-javax/swing/plaf/basic/BasicToggleButtonUI.java \
-javax/swing/plaf/basic/BasicToolBarSeparatorUI.java \
-javax/swing/plaf/basic/BasicToolBarUI.java \
-javax/swing/plaf/basic/BasicToolTipUI.java \
-javax/swing/plaf/basic/BasicTreeUI.java \
-javax/swing/plaf/basic/BasicViewportUI.java \
-javax/swing/plaf/basic/BasicLookAndFeel.java \
-javax/swing/plaf/basic/BasicBorders.java \
-javax/swing/plaf/basic/BasicIconFactory.java \
-javax/swing/plaf/basic/ComboPopup.java \
-javax/swing/plaf/metal/MetalBorders.java \
-javax/swing/plaf/metal/MetalButtonUI.java \
-javax/swing/plaf/metal/MetalCheckBoxUI.java \
-javax/swing/plaf/metal/MetalComboBoxUI.java \
-javax/swing/plaf/metal/MetalDesktopIconUI.java \
-javax/swing/plaf/metal/MetalInternalFrameUI.java \
-javax/swing/plaf/metal/MetalLabelUI.java \
-javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java \
-javax/swing/plaf/metal/MetalProgressBarUI.java \
-javax/swing/plaf/metal/MetalRadioButtonUI.java \
-javax/swing/plaf/metal/MetalRootPaneUI.java \
-javax/swing/plaf/metal/MetalScrollBarUI.java \
-javax/swing/plaf/metal/MetalScrollPaneUI.java \
-javax/swing/plaf/metal/MetalSeparatorUI.java \
-javax/swing/plaf/metal/MetalSliderUI.java \
-javax/swing/plaf/metal/MetalSplitPaneUI.java \
-javax/swing/plaf/metal/MetalTabbedPaneUI.java \
-javax/swing/plaf/metal/MetalTextFieldUI.java \
-javax/swing/plaf/metal/MetalToggleButtonUI.java \
-javax/swing/plaf/metal/MetalToolBarUI.java \
-javax/swing/plaf/metal/MetalToolTipUI.java \
-javax/swing/plaf/metal/MetalTreeUI.java \
-javax/swing/plaf/BorderUIResource.java \
-javax/swing/plaf/UIResource.java \
-javax/swing/plaf/ButtonUI.java \
-javax/swing/plaf/ComponentUI.java \
-javax/swing/plaf/LabelUI.java \
-javax/swing/plaf/ListUI.java \
-javax/swing/plaf/OptionPaneUI.java \
-javax/swing/plaf/PanelUI.java \
-javax/swing/plaf/ScrollPaneUI.java \
-javax/swing/plaf/TabbedPaneUI.java \
-javax/swing/plaf/TextUI.java \
-javax/swing/plaf/TreeUI.java \
-javax/swing/plaf/ViewportUI.java \
-javax/swing/plaf/metal/DefaultMetalTheme.java \
-javax/swing/plaf/metal/MetalLookAndFeel.java \
-javax/swing/plaf/metal/MetalTheme.java \
-javax/swing/plaf/ColorUIResource.java \
-javax/swing/plaf/DimensionUIResource.java \
-javax/swing/plaf/FontUIResource.java \
-javax/swing/plaf/IconUIResource.java \
-javax/swing/plaf/InsetsUIResource.java \
-javax/swing/plaf/ActionMapUIResource.java \
-javax/swing/plaf/ColorChooserUI.java \
-javax/swing/plaf/ComboBoxUI.java \
-javax/swing/plaf/ComponentInputMapUIResource.java \
-javax/swing/plaf/DesktopIconUI.java \
-javax/swing/plaf/DesktopPaneUI.java \
-javax/swing/plaf/FileChooserUI.java \
-javax/swing/plaf/InputMapUIResource.java \
-javax/swing/plaf/InternalFrameUI.java \
-javax/swing/plaf/MenuBarUI.java \
-javax/swing/plaf/MenuItemUI.java \
-javax/swing/plaf/PopupMenuUI.java \
-javax/swing/plaf/ProgressBarUI.java \
-javax/swing/plaf/RootPaneUI.java \
-javax/swing/plaf/ScrollBarUI.java \
-javax/swing/plaf/SeparatorUI.java \
-javax/swing/plaf/SliderUI.java \
-javax/swing/plaf/SpinnerUI.java \
-javax/swing/plaf/SplitPaneUI.java \
-javax/swing/plaf/TableHeaderUI.java \
-javax/swing/plaf/TableUI.java \
-javax/swing/plaf/ToolBarUI.java \
-javax/swing/plaf/ToolTipUI.java \
-javax/swing/AbstractListModel.java \
-javax/swing/colorchooser/AbstractColorChooserPanel.java \
-javax/swing/colorchooser/ColorChooserComponentFactory.java \
-javax/swing/colorchooser/ColorSelectionModel.java \
-javax/swing/colorchooser/DefaultColorSelectionModel.java \
-javax/swing/colorchooser/DefaultPreviewPanel.java \
-javax/swing/colorchooser/DefaultSwatchChooserPanel.java \
-javax/swing/colorchooser/DefaultHSBChooserPanel.java \
-javax/swing/colorchooser/DefaultRGBChooserPanel.java \
-javax/swing/filechooser/FileFilter.java \
-javax/swing/filechooser/FileSystemView.java \
-javax/swing/filechooser/FileView.java \
-javax/swing/table/AbstractTableModel.java \
-javax/swing/table/DefaultTableColumnModel.java \
-javax/swing/table/DefaultTableModel.java \
-javax/swing/table/JTableHeader.java \
-javax/swing/table/TableCellEditor.java \
-javax/swing/table/TableCellRenderer.java \
-javax/swing/table/TableColumn.java \
-javax/swing/table/TableColumnModel.java \
-javax/swing/table/TableModel.java \
-javax/swing/table/DefaultTableCellRenderer.java \
-javax/swing/Action.java \
-javax/swing/BorderFactory.java \
-javax/swing/Box.java \
-javax/swing/BoxLayout.java \
-javax/swing/ButtonGroup.java \
-javax/swing/ButtonModel.java \
-javax/swing/ComponentInputMap.java \
-javax/swing/DefaultButtonModel.java \
-javax/swing/DefaultListModel.java \
-javax/swing/DefaultListSelectionModel.java \
-javax/swing/Icon.java \
-javax/swing/ImageIcon.java \
-javax/swing/InputMap.java \
-javax/swing/InternalFrameFocusTraversalPolicy.java \
-javax/swing/JApplet.java \
-javax/swing/JButton.java \
-javax/swing/JCheckBox.java \
-javax/swing/JComponent.java \
-javax/swing/JDialog.java \
-javax/swing/JEditorPane.java \
-javax/swing/JFormattedTextField.java \
-javax/swing/JFrame.java \
-javax/swing/JLabel.java \
-javax/swing/JLayeredPane.java \
-javax/swing/JList.java \
-javax/swing/JMenuBar.java \
-javax/swing/JOptionPane.java \
-javax/swing/JPanel.java \
-javax/swing/JRadioButton.java \
-javax/swing/JRootPane.java \
-javax/swing/JScrollBar.java \
-javax/swing/JScrollPane.java \
-javax/swing/JSpinner.java \
-javax/swing/JTabbedPane.java \
-javax/swing/JTextArea.java \
-javax/swing/JTextField.java \
-javax/swing/JToggleButton.java \
-javax/swing/JToolTip.java \
-javax/swing/JTree.java \
-javax/swing/JViewport.java \
-javax/swing/JWindow.java \
-javax/swing/KeyStroke.java \
-javax/swing/LayoutFocusTraversalPolicy.java \
-javax/swing/ListCellRenderer.java \
-javax/swing/ListModel.java \
-javax/swing/ListSelectionModel.java \
-javax/swing/LookAndFeel.java \
-javax/swing/Scrollable.java \
-javax/swing/SortingFocusTraversalPolicy.java \
-javax/swing/SpinnerDateModel.java \
-javax/swing/SpinnerListModel.java \
-javax/swing/SpinnerModel.java \
-javax/swing/SpinnerNumberModel.java \
-javax/swing/Spring.java \
-javax/swing/SpringLayout.java \
-javax/swing/SwingConstants.java \
-javax/swing/SwingUtilities.java \
-javax/swing/Timer.java \
-javax/swing/ToolTipManager.java \
-javax/swing/TransferHandler.java \
-javax/swing/UIDefaults.java \
-javax/swing/UIManager.java \
-javax/swing/UnsupportedLookAndFeelException.java \
-javax/swing/event/AncestorEvent.java \
-javax/swing/event/AncestorListener.java \
-javax/swing/event/ChangeEvent.java \
-javax/swing/event/ChangeListener.java \
-javax/swing/event/DocumentEvent.java \
-javax/swing/event/DocumentListener.java \
-javax/swing/event/HyperlinkEvent.java \
-javax/swing/event/HyperlinkListener.java \
-javax/swing/event/ListDataEvent.java \
-javax/swing/event/ListDataListener.java \
-javax/swing/event/ListSelectionEvent.java \
-javax/swing/event/ListSelectionListener.java \
-javax/swing/event/MenuEvent.java \
-javax/swing/event/UndoableEditEvent.java \
-javax/swing/event/UndoableEditListener.java \
-javax/swing/event/CaretEvent.java \
-javax/swing/event/CaretListener.java \
-javax/swing/event/CellEditorListener.java \
-javax/swing/event/EventListenerList.java \
-javax/swing/event/InternalFrameAdapter.java \
-javax/swing/event/InternalFrameEvent.java \
-javax/swing/event/InternalFrameListener.java \
-javax/swing/event/MenuDragMouseEvent.java \
-javax/swing/event/MenuDragMouseListener.java \
-javax/swing/event/MenuKeyEvent.java \
-javax/swing/event/MenuKeyListener.java \
-javax/swing/event/MenuListener.java \
-javax/swing/event/MouseInputAdapter.java \
-javax/swing/event/MouseInputListener.java \
-javax/swing/event/PopupMenuEvent.java \
-javax/swing/event/PopupMenuListener.java \
-javax/swing/event/SwingPropertyChangeSupport.java \
-javax/swing/event/TableColumnModelEvent.java \
-javax/swing/event/TableColumnModelListener.java \
-javax/swing/event/TableModelEvent.java \
-javax/swing/event/TableModelListener.java \
-javax/swing/event/TreeExpansionEvent.java \
-javax/swing/event/TreeExpansionListener.java \
-javax/swing/event/TreeModelEvent.java \
-javax/swing/event/TreeModelListener.java \
-javax/swing/event/TreeSelectionEvent.java \
-javax/swing/event/TreeSelectionListener.java \
-javax/swing/event/TreeWillExpandListener.java \
-javax/swing/ActionMap.java \
-javax/swing/text/AbstractDocument.java \
-javax/swing/text/AttributeSet.java \
-javax/swing/text/BadLocationException.java \
-javax/swing/text/Caret.java \
-javax/swing/text/ChangedCharSetException.java \
-javax/swing/text/ComponentView.java \
-javax/swing/text/DefaultCaret.java \
-javax/swing/text/DefaultEditorKit.java \
-javax/swing/text/DefaultHighlighter.java \
-javax/swing/text/DefaultStyledDocument.java \
-javax/swing/text/Document.java \
-javax/swing/text/DocumentFilter.java \
-javax/swing/text/EditorKit.java \
-javax/swing/text/Element.java \
-javax/swing/text/FieldView.java \
-javax/swing/text/GapContent.java \
-javax/swing/text/Highlighter.java \
-javax/swing/text/JTextComponent.java \
-javax/swing/text/Keymap.java \
-javax/swing/text/LayeredHighlighter.java \
-javax/swing/text/MutableAttributeSet.java \
-javax/swing/text/NavigationFilter.java \
-javax/swing/text/PasswordView.java \
-javax/swing/text/PlainDocument.java \
-javax/swing/text/PlainView.java \
-javax/swing/text/Position.java \
-javax/swing/text/Segment.java \
-javax/swing/text/SimpleAttributeSet.java \
-javax/swing/text/StringContent.java \
-javax/swing/text/Style.java \
-javax/swing/text/StyleConstants.java \
-javax/swing/text/StyleContext.java \
-javax/swing/text/StyledDocument.java \
-javax/swing/text/StyledEditorKit.java \
-javax/swing/text/TabableView.java \
-javax/swing/text/TabExpander.java \
-javax/swing/text/TabSet.java \
-javax/swing/text/TabStop.java \
-javax/swing/text/TextAction.java \
-javax/swing/text/Utilities.java \
-javax/swing/text/View.java \
-javax/swing/text/ViewFactory.java \
-javax/swing/text/html/HTML.java \
-javax/swing/text/html/HTMLDocument.java \
-javax/swing/text/html/HTMLEditorKit.java \
-javax/swing/text/html/HTMLFrameHyperlinkEvent.java \
-javax/swing/text/html/parser/AttributeList.java \
-javax/swing/text/html/parser/ContentModel.java \
-javax/swing/text/html/parser/DTD.java \
-javax/swing/text/html/parser/DTDConstants.java \
-javax/swing/text/html/parser/DocumentParser.java \
-javax/swing/text/html/parser/Element.java \
-javax/swing/text/html/parser/Entity.java \
-javax/swing/text/html/parser/Parser.java \
-javax/swing/text/html/parser/ParserDelegator.java \
-javax/swing/text/html/parser/TagElement.java \
-javax/swing/text/rtf/ControlWordToken.java \
-javax/swing/text/rtf/RTFEditorKit.java \
-javax/swing/text/rtf/RTFParseException.java \
-javax/swing/text/rtf/RTFParser.java \
-javax/swing/text/rtf/RTFScanner.java \
-javax/swing/text/rtf/TextToken.java \
-javax/swing/text/rtf/Token.java \
-javax/swing/tree/TreeNode.java \
-javax/swing/tree/AbstractLayoutCache.java \
-javax/swing/tree/DefaultMutableTreeNode.java \
-javax/swing/tree/DefaultTreeCellEditor.java \
-javax/swing/tree/DefaultTreeCellRenderer.java \
-javax/swing/tree/DefaultTreeModel.java \
-javax/swing/tree/DefaultTreeSelectionModel.java \
-javax/swing/tree/ExpandVetoException.java \
-javax/swing/tree/FixedHeightLayoutCache.java \
-javax/swing/tree/MutableTreeNode.java \
-javax/swing/tree/RowMapper.java \
-javax/swing/tree/TreeCellEditor.java \
-javax/swing/tree/TreeCellRenderer.java \
-javax/swing/tree/TreeModel.java \
-javax/swing/tree/TreePath.java \
-javax/swing/tree/TreeSelectionModel.java \
-javax/swing/tree/VariableHeightLayoutCache.java \
-javax/swing/undo/UndoableEdit.java \
-javax/swing/undo/AbstractUndoableEdit.java \
-javax/swing/undo/CannotRedoException.java \
-javax/swing/undo/CannotUndoException.java \
-javax/swing/undo/CompoundEdit.java \
-javax/swing/undo/StateEdit.java \
-javax/swing/undo/StateEditable.java \
-javax/swing/undo/UndoManager.java \
-javax/swing/undo/UndoableEditSupport.java \
-javax/swing/BoundedRangeModel.java \
-javax/swing/CellEditor.java \
-javax/swing/ComboBoxEditor.java \
-javax/swing/ComboBoxModel.java \
-javax/swing/DefaultBoundedRangeModel.java \
-javax/swing/DesktopManager.java \
-javax/swing/InputVerifier.java \
-javax/swing/JInternalFrame.java \
-javax/swing/JTable.java \
-javax/swing/MenuElement.java \
-javax/swing/MenuSelectionManager.java \
-javax/swing/MutableComboBoxModel.java \
-javax/swing/Renderer.java \
-javax/swing/RootPaneContainer.java \
-javax/swing/ScrollPaneConstants.java \
-javax/swing/SingleSelectionModel.java \
-javax/swing/SizeRequirements.java \
-javax/swing/SizeSequence.java \
-javax/swing/WindowConstants.java \
-javax/swing/AbstractCellEditor.java \
-javax/swing/CellRendererPane.java \
-javax/swing/DebugGraphics.java \
-javax/swing/DefaultCellEditor.java \
-javax/swing/DefaultComboBoxModel.java \
-javax/swing/DefaultDesktopManager.java \
-javax/swing/DefaultFocusManager.java \
-javax/swing/DefaultListCellRenderer.java \
-javax/swing/DefaultSingleSelectionModel.java \
-javax/swing/FocusManager.java \
-javax/swing/JCheckBoxMenuItem.java \
-javax/swing/JColorChooser.java \
-javax/swing/JComboBox.java \
-javax/swing/JDesktopPane.java \
-javax/swing/JFileChooser.java \
-javax/swing/JMenu.java \
-javax/swing/JMenuItem.java \
-javax/swing/JPasswordField.java \
-javax/swing/JPopupMenu.java \
-javax/swing/JProgressBar.java \
-javax/swing/JRadioButtonMenuItem.java \
-javax/swing/JSeparator.java \
-javax/swing/JSlider.java \
-javax/swing/JSplitPane.java \
-javax/swing/JTextPane.java \
-javax/swing/JToolBar.java \
-javax/swing/OverlayLayout.java \
-javax/swing/Popup.java \
-javax/swing/PopupFactory.java \
-javax/swing/ProgressMonitor.java \
-javax/swing/ProgressMonitorInputStream.java \
-javax/swing/RepaintManager.java \
-javax/swing/ScrollPaneLayout.java \
-javax/swing/ViewportLayout.java
-
-rmi_java_source_files = \
-java/rmi/activation/Activatable.java \
-java/rmi/activation/ActivateFailedException.java \
-java/rmi/activation/ActivationDesc.java \
-java/rmi/activation/ActivationException.java \
-java/rmi/activation/ActivationGroup.java \
-java/rmi/activation/ActivationGroupDesc.java \
-java/rmi/activation/ActivationGroupID.java \
-java/rmi/activation/ActivationID.java \
-java/rmi/activation/ActivationInstantiator.java \
-java/rmi/activation/ActivationMonitor.java \
-java/rmi/activation/ActivationSystem.java \
-java/rmi/activation/Activator.java \
-java/rmi/activation/UnknownGroupException.java \
-java/rmi/activation/UnknownObjectException.java \
-java/rmi/AccessException.java \
-java/rmi/AlreadyBoundException.java \
-java/rmi/ConnectException.java \
-java/rmi/ConnectIOException.java \
-java/rmi/MarshalException.java \
-java/rmi/MarshalledObject.java \
-java/rmi/Naming.java \
-java/rmi/NoSuchObjectException.java \
-java/rmi/NotBoundException.java \
-java/rmi/RMISecurityException.java \
-java/rmi/RMISecurityManager.java \
-java/rmi/Remote.java \
-java/rmi/RemoteException.java \
-java/rmi/ServerError.java \
-java/rmi/ServerException.java \
-java/rmi/ServerRuntimeException.java \
-java/rmi/StubNotFoundException.java \
-java/rmi/UnexpectedException.java \
-java/rmi/UnknownHostException.java \
-java/rmi/UnmarshalException.java \
-java/rmi/dgc/DGC.java \
-java/rmi/dgc/Lease.java \
-java/rmi/dgc/VMID.java \
-java/rmi/registry/LocateRegistry.java \
-java/rmi/registry/Registry.java \
-java/rmi/registry/RegistryHandler.java \
-java/rmi/server/ExportException.java \
-java/rmi/server/LoaderHandler.java \
-java/rmi/server/LogStream.java \
-java/rmi/server/ObjID.java \
-java/rmi/server/Operation.java \
-java/rmi/server/RMIClassLoader.java \
-java/rmi/server/RMIClassLoaderSpi.java \
-java/rmi/server/RMIClientSocketFactory.java \
-java/rmi/server/RMIFailureHandler.java \
-java/rmi/server/RMIServerSocketFactory.java \
-java/rmi/server/RMISocketFactory.java \
-java/rmi/server/RemoteCall.java \
-java/rmi/server/RemoteObject.java \
-java/rmi/server/RemoteRef.java \
-java/rmi/server/RemoteServer.java \
-java/rmi/server/RemoteStub.java \
-java/rmi/server/ServerCloneException.java \
-java/rmi/server/ServerNotActiveException.java \
-java/rmi/server/ServerRef.java \
-java/rmi/server/Skeleton.java \
-java/rmi/server/SkeletonMismatchException.java \
-java/rmi/server/SkeletonNotFoundException.java \
-java/rmi/server/SocketSecurityException.java \
-java/rmi/server/UID.java \
-java/rmi/server/UnicastRemoteObject.java \
-java/rmi/server/Unreferenced.java \
-gnu/java/rmi/RMIMarshalledObjectInputStream.java \
-gnu/java/rmi/RMIMarshalledObjectOutputStream.java \
-gnu/java/rmi/dgc/DGCImpl.java \
-gnu/java/rmi/dgc/DGCImpl_Skel.java \
-gnu/java/rmi/dgc/DGCImpl_Stub.java \
-gnu/java/rmi/registry/RegistryImpl.java \
-gnu/java/rmi/registry/RegistryImpl_Skel.java \
-gnu/java/rmi/registry/RegistryImpl_Stub.java \
-gnu/java/rmi/rmic/Compile_gcj.java \
-gnu/java/rmi/rmic/Compile_jikes.java \
-gnu/java/rmi/rmic/Compile_kjc.java \
-gnu/java/rmi/rmic/Compiler.java \
-gnu/java/rmi/rmic/CompilerProcess.java \
-gnu/java/rmi/rmic/RMIC.java \
-gnu/java/rmi/rmic/RMICException.java \
-gnu/java/rmi/rmic/TabbedWriter.java \
-gnu/java/rmi/server/ConnectionRunnerPool.java \
-gnu/java/rmi/server/ProtocolConstants.java \
-gnu/java/rmi/server/RMIDefaultSocketFactory.java \
-gnu/java/rmi/server/RMIHashes.java \
-gnu/java/rmi/server/RMIIncomingThread.java \
-gnu/java/rmi/server/RMIObjectInputStream.java \
-gnu/java/rmi/server/RMIObjectOutputStream.java \
-gnu/java/rmi/server/RMIVoidValue.java \
-gnu/java/rmi/server/UnicastConnection.java \
-gnu/java/rmi/server/UnicastConnectionManager.java \
-gnu/java/rmi/server/UnicastRef.java \
-gnu/java/rmi/server/UnicastRemoteCall.java \
-gnu/java/rmi/server/UnicastRemoteStub.java \
-gnu/java/rmi/server/UnicastServer.java \
-gnu/java/rmi/server/UnicastServerRef.java
-
-javax_imageio_source_files = \
-javax/imageio/ImageWriteParam.java \
-javax/imageio/ImageReader.java \
-javax/imageio/ImageWriter.java \
-javax/imageio/IIOException.java \
-javax/imageio/IIOParamController.java \
-javax/imageio/ImageReadParam.java \
-javax/imageio/IIOParam.java \
-javax/imageio/spi/IIORegistry.java \
-javax/imageio/spi/ImageWriterSpi.java \
-javax/imageio/spi/ImageOutputStreamSpi.java \
-javax/imageio/spi/ServiceRegistry.java \
-javax/imageio/spi/ImageTranscoderSpi.java \
-javax/imageio/spi/ImageReaderSpi.java \
-javax/imageio/spi/IIOServiceProvider.java \
-javax/imageio/spi/ImageReaderWriterSpi.java \
-javax/imageio/spi/ImageInputStreamSpi.java \
-javax/imageio/spi/RegisterableService.java \
-javax/imageio/metadata/IIOAttr.java \
-javax/imageio/metadata/IIONamedNodeMap.java \
-javax/imageio/metadata/IIONodeList.java \
-javax/imageio/metadata/IIOMetadataFormatImpl.java \
-javax/imageio/metadata/IIOInvalidTreeException.java \
-javax/imageio/metadata/IIOMetadataFormat.java \
-javax/imageio/metadata/IIOMetadataController.java \
-javax/imageio/metadata/IIOMetadataNode.java \
-javax/imageio/metadata/IIOMetadata.java \
-javax/imageio/stream/FileImageOutputStream.java \
-javax/imageio/stream/ImageInputStream.java \
-javax/imageio/stream/IIOByteBuffer.java \
-javax/imageio/stream/FileCacheImageInputStream.java \
-javax/imageio/stream/ImageInputStreamImpl.java \
-javax/imageio/stream/ImageOutputStreamImpl.java \
-javax/imageio/stream/MemoryCacheImageInputStream.java \
-javax/imageio/stream/FileCacheImageOutputStream.java \
-javax/imageio/stream/ImageOutputStream.java \
-javax/imageio/stream/MemoryCacheImageOutputStream.java \
-javax/imageio/stream/FileImageInputStream.java \
-javax/imageio/event/IIOReadProgressListener.java \
-javax/imageio/event/IIOWriteWarningListener.java \
-javax/imageio/event/IIOReadWarningListener.java \
-javax/imageio/event/IIOReadUpdateListener.java \
-javax/imageio/event/IIOWriteProgressListener.java \
-javax/imageio/ImageTranscoder.java \
-javax/imageio/ImageTypeSpecifier.java \
-javax/imageio/ImageIO.java \
-javax/imageio/IIOImage.java
-
-javax_xml_source_files = \
-javax/xml/xpath/XPathConstants.java \
-javax/xml/xpath/XPathFunction.java \
-javax/xml/xpath/XPathVariableResolver.java \
-javax/xml/xpath/XPathExpressionException.java \
-javax/xml/xpath/XPathFunctionResolver.java \
-javax/xml/xpath/XPath.java \
-javax/xml/xpath/XPathFactoryConfigurationException.java \
-javax/xml/xpath/XPathFactory.java \
-javax/xml/xpath/XPathException.java \
-javax/xml/xpath/XPathExpression.java \
-javax/xml/xpath/XPathFunctionException.java \
-javax/xml/validation/ValidatorHandler.java \
-javax/xml/validation/Validator.java \
-javax/xml/validation/TypeInfoProvider.java \
-javax/xml/validation/SchemaFactory.java \
-javax/xml/validation/Schema.java \
-javax/xml/parsers/SAXParserFactory.java \
-javax/xml/parsers/FactoryConfigurationError.java \
-javax/xml/parsers/SAXParser.java \
-javax/xml/parsers/DocumentBuilderFactory.java \
-javax/xml/parsers/ParserConfigurationException.java \
-javax/xml/parsers/DocumentBuilder.java \
-javax/xml/datatype/DatatypeFactory.java \
-javax/xml/datatype/XMLGregorianCalendar.java \
-javax/xml/datatype/Duration.java \
-javax/xml/datatype/DatatypeConfigurationException.java \
-javax/xml/datatype/DatatypeConstants.java \
-javax/xml/XMLConstants.java \
-javax/xml/namespace/NamespaceContext.java \
-javax/xml/namespace/QName.java \
-javax/xml/transform/TransformerException.java \
-javax/xml/transform/TransformerFactoryConfigurationError.java \
-javax/xml/transform/sax/SAXResult.java \
-javax/xml/transform/sax/TransformerHandler.java \
-javax/xml/transform/sax/SAXTransformerFactory.java \
-javax/xml/transform/sax/SAXSource.java \
-javax/xml/transform/sax/TemplatesHandler.java \
-javax/xml/transform/OutputKeys.java \
-javax/xml/transform/stream/StreamResult.java \
-javax/xml/transform/stream/StreamSource.java \
-javax/xml/transform/Source.java \
-javax/xml/transform/SourceLocator.java \
-javax/xml/transform/ErrorListener.java \
-javax/xml/transform/TransformerConfigurationException.java \
-javax/xml/transform/Templates.java \
-javax/xml/transform/Result.java \
-javax/xml/transform/URIResolver.java \
-javax/xml/transform/dom/DOMSource.java \
-javax/xml/transform/dom/DOMLocator.java \
-javax/xml/transform/dom/DOMResult.java \
-javax/xml/transform/Transformer.java \
-javax/xml/transform/TransformerFactory.java
-
-javax_source_files = \
-javax/net/VanillaSocketFactory.java \
-javax/net/ssl/TrustManagerFactorySpi.java \
-javax/net/ssl/SSLKeyException.java \
-javax/net/ssl/TrustManager.java \
-javax/net/ssl/SSLServerSocket.java \
-javax/net/ssl/TrustManagerFactory.java \
-javax/net/ssl/KeyManager.java \
-javax/net/ssl/SSLSocketFactory.java \
-javax/net/ssl/SSLPermission.java \
-javax/net/ssl/SSLContext.java \
-javax/net/ssl/TrivialHostnameVerifier.java \
-javax/net/ssl/X509KeyManager.java \
-javax/net/ssl/SSLServerSocketFactory.java \
-javax/net/ssl/SSLSessionBindingListener.java \
-javax/net/ssl/SSLSessionContext.java \
-javax/net/ssl/KeyManagerFactory.java \
-javax/net/ssl/SSLProtocolException.java \
-javax/net/ssl/SSLSocket.java \
-javax/net/ssl/HostnameVerifier.java \
-javax/net/ssl/HandshakeCompletedListener.java \
-javax/net/ssl/HttpsURLConnection.java \
-javax/net/ssl/KeyManagerFactorySpi.java \
-javax/net/ssl/SSLHandshakeException.java \
-javax/net/ssl/SSLPeerUnverifiedException.java \
-javax/net/ssl/X509TrustManager.java \
-javax/net/ssl/SSLSession.java \
-javax/net/ssl/SSLContextSpi.java \
-javax/net/ssl/HandshakeCompletedEvent.java \
-javax/net/ssl/SSLSessionBindingEvent.java \
-javax/net/ssl/SSLException.java \
-javax/net/ssl/ManagerFactoryParameters.java \
-javax/net/SocketFactory.java \
-javax/net/VanillaServerSocketFactory.java \
-javax/net/ServerSocketFactory.java \
-javax/print/attribute/HashPrintServiceAttributeSet.java \
-javax/print/attribute/Attribute.java \
-javax/print/attribute/DocAttributeSet.java \
-javax/print/attribute/PrintRequestAttributeSet.java \
-javax/print/attribute/standard/Chromaticity.java \
-javax/print/attribute/standard/Destination.java \
-javax/print/attribute/standard/MediaPrintableArea.java \
-javax/print/attribute/standard/MediaSize.java \
-javax/print/attribute/standard/NumberOfInterveningJobs.java \
-javax/print/attribute/standard/PrinterMakeAndModel.java \
-javax/print/attribute/standard/PrinterStateReason.java \
-javax/print/attribute/standard/JobImpressions.java \
-javax/print/attribute/standard/JobHoldUntil.java \
-javax/print/attribute/standard/JobKOctetsSupported.java \
-javax/print/attribute/standard/JobPriority.java \
-javax/print/attribute/standard/QueuedJobCount.java \
-javax/print/attribute/standard/JobOriginatingUserName.java \
-javax/print/attribute/standard/PrinterName.java \
-javax/print/attribute/standard/PDLOverrideSupported.java \
-javax/print/attribute/standard/PrinterStateReasons.java \
-javax/print/attribute/standard/JobMediaSheets.java \
-javax/print/attribute/standard/JobKOctets.java \
-javax/print/attribute/standard/MultipleDocumentHandling.java \
-javax/print/attribute/standard/PrinterMessageFromOperator.java \
-javax/print/attribute/standard/Severity.java \
-javax/print/attribute/standard/ReferenceUriSchemesSupported.java \
-javax/print/attribute/standard/DocumentName.java \
-javax/print/attribute/standard/PrinterMoreInfo.java \
-javax/print/attribute/standard/JobMessageFromOperator.java \
-javax/print/attribute/standard/JobStateReasons.java \
-javax/print/attribute/standard/PrinterIsAcceptingJobs.java \
-javax/print/attribute/standard/DateTimeAtProcessing.java \
-javax/print/attribute/standard/PagesPerMinute.java \
-javax/print/attribute/standard/PrinterResolution.java \
-javax/print/attribute/standard/JobMediaSheetsSupported.java \
-javax/print/attribute/standard/NumberUpSupported.java \
-javax/print/attribute/standard/Finishings.java \
-javax/print/attribute/standard/DateTimeAtCompleted.java \
-javax/print/attribute/standard/NumberOfDocuments.java \
-javax/print/attribute/standard/PrinterInfo.java \
-javax/print/attribute/standard/PrintQuality.java \
-javax/print/attribute/standard/JobSheets.java \
-javax/print/attribute/standard/Media.java \
-javax/print/attribute/standard/Fidelity.java \
-javax/print/attribute/standard/PrinterLocation.java \
-javax/print/attribute/standard/PrinterMoreInfoManufacturer.java \
-javax/print/attribute/standard/OrientationRequested.java \
-javax/print/attribute/standard/JobState.java \
-javax/print/attribute/standard/DateTimeAtCreation.java \
-javax/print/attribute/standard/PresentationDirection.java \
-javax/print/attribute/standard/JobName.java \
-javax/print/attribute/standard/PagesPerMinuteColor.java \
-javax/print/attribute/standard/CopiesSupported.java \
-javax/print/attribute/standard/PrinterURI.java \
-javax/print/attribute/standard/PageRanges.java \
-javax/print/attribute/standard/RequestingUserName.java \
-javax/print/attribute/standard/JobPrioritySupported.java \
-javax/print/attribute/standard/JobMediaSheetsCompleted.java \
-javax/print/attribute/standard/JobKOctetsProcessed.java \
-javax/print/attribute/standard/JobImpressionsCompleted.java \
-javax/print/attribute/standard/Compression.java \
-javax/print/attribute/standard/JobImpressionsSupported.java \
-javax/print/attribute/standard/Sides.java \
-javax/print/attribute/standard/JobStateReason.java \
-javax/print/attribute/standard/SheetCollate.java \
-javax/print/attribute/standard/Copies.java \
-javax/print/attribute/standard/MediaSizeName.java \
-javax/print/attribute/standard/OutputDeviceAssigned.java \
-javax/print/attribute/standard/PrinterState.java \
-javax/print/attribute/standard/NumberUp.java \
-javax/print/attribute/standard/ColorSupported.java \
-javax/print/attribute/HashAttributeSet.java \
-javax/print/attribute/SetOfIntegerSyntax.java \
-javax/print/attribute/HashDocAttributeSet.java \
-javax/print/attribute/PrintRequestAttribute.java \
-javax/print/attribute/DateTimeSyntax.java \
-javax/print/attribute/PrintServiceAttribute.java \
-javax/print/attribute/UnmodifiableSetException.java \
-javax/print/attribute/HashPrintJobAttributeSet.java \
-javax/print/attribute/PrintJobAttribute.java \
-javax/print/attribute/AttributeSet.java \
-javax/print/attribute/ResolutionSyntax.java \
-javax/print/attribute/URISyntax.java \
-javax/print/attribute/AttributeSetUtilities.java \
-javax/print/attribute/HashPrintRequestAttributeSet.java \
-javax/print/attribute/TextSyntax.java \
-javax/print/attribute/PrintJobAttributeSet.java \
-javax/print/attribute/SupportedValuesAttribute.java \
-javax/print/attribute/EnumSyntax.java \
-javax/print/attribute/DocAttribute.java \
-javax/print/attribute/Size2DSyntax.java \
-javax/print/attribute/IntegerSyntax.java \
-javax/print/attribute/PrintServiceAttributeSet.java \
-javax/print/PrintService.java \
-javax/print/DocFlavor.java \
-javax/print/DocPrintJob.java \
-javax/print/event/PrintEvent.java \
-javax/print/event/PrintJobAdapter.java \
-javax/print/event/PrintServiceAttributeEvent.java \
-javax/print/event/PrintJobAttributeEvent.java \
-javax/print/event/PrintServiceAttributeListener.java \
-javax/print/event/PrintJobEvent.java \
-javax/print/event/PrintJobListener.java \
-javax/print/event/PrintJobAttributeListener.java \
-javax/print/PrintServiceLookup.java \
-javax/print/URIException.java \
-javax/print/StreamPrintService.java \
-javax/print/MultiDoc.java \
-javax/print/FlavorException.java \
-javax/print/Doc.java \
-javax/print/MultiDocPrintJob.java \
-javax/print/CancelablePrintJob.java \
-javax/print/MultiDocPrintService.java \
-javax/print/ServiceUIFactory.java \
-javax/print/AttributeException.java \
-javax/print/PrintException.java \
-javax/naming/ServiceUnavailableException.java \
-javax/naming/directory/Attribute.java \
-javax/naming/directory/SchemaViolationException.java \
-javax/naming/directory/InitialDirContext.java \
-javax/naming/directory/BasicAttribute.java \
-javax/naming/directory/NoSuchAttributeException.java \
-javax/naming/directory/InvalidAttributesException.java \
-javax/naming/directory/InvalidAttributeValueException.java \
-javax/naming/directory/BasicAttributes.java \
-javax/naming/directory/AttributeModificationException.java \
-javax/naming/directory/InvalidAttributeIdentifierException.java \
-javax/naming/directory/DirContext.java \
-javax/naming/directory/Attributes.java \
-javax/naming/directory/InvalidSearchControlsException.java \
-javax/naming/directory/SearchControls.java \
-javax/naming/directory/AttributeInUseException.java \
-javax/naming/directory/InvalidSearchFilterException.java \
-javax/naming/directory/ModificationItem.java \
-javax/naming/directory/SearchResult.java \
-javax/naming/Binding.java \
-javax/naming/ContextNotEmptyException.java \
-javax/naming/Referenceable.java \
-javax/naming/InterruptedNamingException.java \
-javax/naming/CommunicationException.java \
-javax/naming/LinkException.java \
-javax/naming/BinaryRefAddr.java \
-javax/naming/LinkLoopException.java \
-javax/naming/AuthenticationException.java \
-javax/naming/NameAlreadyBoundException.java \
-javax/naming/MalformedLinkException.java \
-javax/naming/NotContextException.java \
-javax/naming/spi/DirStateFactory.java \
-javax/naming/spi/ResolveResult.java \
-javax/naming/spi/ObjectFactoryBuilder.java \
-javax/naming/spi/DirObjectFactory.java \
-javax/naming/spi/DirectoryManager.java \
-javax/naming/spi/InitialContextFactoryBuilder.java \
-javax/naming/spi/ObjectFactory.java \
-javax/naming/spi/Resolver.java \
-javax/naming/spi/StateFactory.java \
-javax/naming/spi/InitialContextFactory.java \
-javax/naming/spi/NamingManager.java \
-javax/naming/InvalidNameException.java \
-javax/naming/NamingEnumeration.java \
-javax/naming/LinkRef.java \
-javax/naming/event/NamingListener.java \
-javax/naming/event/NamingEvent.java \
-javax/naming/event/NamespaceChangeListener.java \
-javax/naming/event/ObjectChangeListener.java \
-javax/naming/event/EventContext.java \
-javax/naming/event/NamingExceptionEvent.java \
-javax/naming/event/EventDirContext.java \
-javax/naming/NamingException.java \
-javax/naming/CannotProceedException.java \
-javax/naming/PartialResultException.java \
-javax/naming/TimeLimitExceededException.java \
-javax/naming/NoPermissionException.java \
-javax/naming/CompoundName.java \
-javax/naming/SizeLimitExceededException.java \
-javax/naming/NoInitialContextException.java \
-javax/naming/NameNotFoundException.java \
-javax/naming/InitialContext.java \
-javax/naming/NamingSecurityException.java \
-javax/naming/Context.java \
-javax/naming/ConfigurationException.java \
-javax/naming/InsufficientResourcesException.java \
-javax/naming/AuthenticationNotSupportedException.java \
-javax/naming/StringRefAddr.java \
-javax/naming/ldap/InitialLdapContext.java \
-javax/naming/ldap/ExtendedRequest.java \
-javax/naming/ldap/Control.java \
-javax/naming/ldap/UnsolicitedNotificationListener.java \
-javax/naming/ldap/LdapReferralException.java \
-javax/naming/ldap/UnsolicitedNotificationEvent.java \
-javax/naming/ldap/HasControls.java \
-javax/naming/ldap/LdapContext.java \
-javax/naming/ldap/ExtendedResponse.java \
-javax/naming/ldap/UnsolicitedNotification.java \
-javax/naming/ldap/ControlFactory.java \
-javax/naming/OperationNotSupportedException.java \
-javax/naming/ReferralException.java \
-javax/naming/LimitExceededException.java \
-javax/naming/Reference.java \
-javax/naming/NameParser.java \
-javax/naming/NameClassPair.java \
-javax/naming/RefAddr.java \
-javax/naming/CompositeName.java \
-javax/naming/Name.java \
-javax/security/cert/CertificateNotYetValidException.java \
-javax/security/cert/Certificate.java \
-javax/security/cert/X509Certificate.java \
-javax/security/cert/X509CertBridge.java \
-javax/security/cert/CertificateEncodingException.java \
-javax/security/cert/CertificateExpiredException.java \
-javax/security/cert/CertificateException.java \
-javax/security/cert/CertificateParsingException.java \
-javax/security/auth/Destroyable.java \
-javax/security/auth/x500/X500PrivateCredential.java \
-javax/security/auth/x500/X500Principal.java \
-javax/security/auth/spi/LoginModule.java \
-javax/security/auth/DestroyFailedException.java \
-javax/security/auth/SubjectDomainCombiner.java \
-javax/security/auth/AuthPermission.java \
-javax/security/auth/login/CredentialExpiredException.java \
-javax/security/auth/login/NullConfiguration.java \
-javax/security/auth/login/AccountExpiredException.java \
-javax/security/auth/login/LoginException.java \
-javax/security/auth/login/AppConfigurationEntry.java \
-javax/security/auth/login/Configuration.java \
-javax/security/auth/login/LoginContext.java \
-javax/security/auth/login/FailedLoginException.java \
-javax/security/auth/PrivateCredentialPermission.java \
-javax/security/auth/Subject.java \
-javax/security/auth/Policy.java \
-javax/security/auth/Refreshable.java \
-javax/security/auth/callback/TextInputCallback.java \
-javax/security/auth/callback/LanguageCallback.java \
-javax/security/auth/callback/TextOutputCallback.java \
-javax/security/auth/callback/UnsupportedCallbackException.java \
-javax/security/auth/callback/Callback.java \
-javax/security/auth/callback/ConfirmationCallback.java \
-javax/security/auth/callback/ChoiceCallback.java \
-javax/security/auth/callback/NameCallback.java \
-javax/security/auth/callback/PasswordCallback.java \
-javax/security/auth/callback/CallbackHandler.java \
-javax/security/auth/RefreshFailedException.java \
-javax/security/sasl/RealmCallback.java \
-javax/security/sasl/SaslClient.java \
-javax/security/sasl/RealmChoiceCallback.java \
-javax/security/sasl/AuthenticationException.java \
-javax/security/sasl/Sasl.java \
-javax/security/sasl/SaslClientFactory.java \
-javax/security/sasl/AuthorizeCallback.java \
-javax/security/sasl/SaslServerFactory.java \
-javax/security/sasl/SaslException.java \
-javax/security/sasl/SaslServer.java \
-javax/transaction/TransactionRolledbackException.java \
-javax/transaction/Synchronization.java \
-javax/transaction/TransactionRequiredException.java \
-javax/transaction/RollbackException.java \
-javax/transaction/Status.java \
-javax/transaction/HeuristicMixedException.java \
-javax/transaction/HeuristicRollbackException.java \
-javax/transaction/SystemException.java \
-javax/transaction/UserTransaction.java \
-javax/transaction/NotSupportedException.java \
-javax/transaction/HeuristicCommitException.java \
-javax/transaction/Transaction.java \
-javax/transaction/TransactionManager.java \
-javax/transaction/InvalidTransactionException.java \
-javax/transaction/xa/XAException.java \
-javax/transaction/xa/XAResource.java \
-javax/transaction/xa/Xid.java \
-javax/accessibility/AccessibleValue.java \
-javax/accessibility/AccessibleBundle.java \
-javax/accessibility/AccessibleContext.java \
-javax/accessibility/AccessibleRelationSet.java \
-javax/accessibility/Accessible.java \
-javax/accessibility/AccessibleTableModelChange.java \
-javax/accessibility/AccessibleState.java \
-javax/accessibility/AccessibleIcon.java \
-javax/accessibility/AccessibleHypertext.java \
-javax/accessibility/AccessibleComponent.java \
-javax/accessibility/AccessibleText.java \
-javax/accessibility/AccessibleRole.java \
-javax/accessibility/AccessibleEditableText.java \
-javax/accessibility/AccessibleRelation.java \
-javax/accessibility/AccessibleTable.java \
-javax/accessibility/AccessibleStateSet.java \
-javax/accessibility/AccessibleSelection.java \
-javax/accessibility/AccessibleExtendedTable.java \
-javax/accessibility/AccessibleResourceBundle.java \
-javax/accessibility/AccessibleExtendedComponent.java \
-javax/accessibility/AccessibleHyperlink.java \
-javax/accessibility/AccessibleKeyBinding.java \
-javax/accessibility/AccessibleAction.java \
-javax/sql/ConnectionEventListener.java \
-javax/sql/RowSetEvent.java \
-javax/sql/ConnectionPoolDataSource.java \
-javax/sql/RowSetWriter.java \
-javax/sql/XAConnection.java \
-javax/sql/RowSet.java \
-javax/sql/DataSource.java \
-javax/sql/RowSetInternal.java \
-javax/sql/RowSetReader.java \
-javax/sql/RowSetMetaData.java \
-javax/sql/PooledConnection.java \
-javax/sql/XADataSource.java \
-javax/sql/RowSetListener.java \
-javax/sql/ConnectionEvent.java \
-javax/crypto/Cipher.java \
-javax/crypto/IllegalBlockSizeException.java \
-javax/crypto/MacSpi.java \
-javax/crypto/SecretKeyFactorySpi.java \
-javax/crypto/ShortBufferException.java \
-javax/crypto/KeyAgreement.java \
-javax/crypto/ExemptionMechanism.java \
-javax/crypto/CipherOutputStream.java \
-javax/crypto/SealedObject.java \
-javax/crypto/NullCipher.java \
-javax/crypto/KeyAgreementSpi.java \
-javax/crypto/SecretKeyFactory.java \
-javax/crypto/SecretKey.java \
-javax/crypto/NullCipherImpl.java \
-javax/crypto/spec/DESKeySpec.java \
-javax/crypto/spec/DHPrivateKeySpec.java \
-javax/crypto/spec/DHParameterSpec.java \
-javax/crypto/spec/PBEParameterSpec.java \
-javax/crypto/spec/DESedeKeySpec.java \
-javax/crypto/spec/DHGenParameterSpec.java \
-javax/crypto/spec/DHPublicKeySpec.java \
-javax/crypto/spec/PBEKeySpec.java \
-javax/crypto/spec/RC5ParameterSpec.java \
-javax/crypto/spec/RC2ParameterSpec.java \
-javax/crypto/spec/IvParameterSpec.java \
-javax/crypto/spec/SecretKeySpec.java \
-javax/crypto/interfaces/DHPublicKey.java \
-javax/crypto/interfaces/DHKey.java \
-javax/crypto/interfaces/DHPrivateKey.java \
-javax/crypto/interfaces/PBEKey.java \
-javax/crypto/NoSuchPaddingException.java \
-javax/crypto/KeyGeneratorSpi.java \
-javax/crypto/BadPaddingException.java \
-javax/crypto/CipherSpi.java \
-javax/crypto/KeyGenerator.java \
-javax/crypto/CipherInputStream.java \
-javax/crypto/ExemptionMechanismException.java \
-javax/crypto/ExemptionMechanismSpi.java \
-javax/crypto/EncryptedPrivateKeyInfo.java \
-javax/crypto/Mac.java
-
-org_source_files = \
-org/ietf/jgss/GSSManager.java \
-org/ietf/jgss/GSSException.java \
-org/ietf/jgss/MessageProp.java \
-org/ietf/jgss/GSSName.java \
-org/ietf/jgss/GSSContext.java \
-org/ietf/jgss/Oid.java \
-org/ietf/jgss/GSSCredential.java \
-org/ietf/jgss/ChannelBinding.java
-
-gnu_xml_source_files = \
-gnu/xml/xpath/EqualityExpr.java \
-gnu/xml/xpath/NumberFunction.java \
-gnu/xml/xpath/StringLengthFunction.java \
-gnu/xml/xpath/NameFunction.java \
-gnu/xml/xpath/SumFunction.java \
-gnu/xml/xpath/Pattern.java \
-gnu/xml/xpath/StringFunction.java \
-gnu/xml/xpath/NegativeExpr.java \
-gnu/xml/xpath/UnionExpr.java \
-gnu/xml/xpath/SubstringFunction.java \
-gnu/xml/xpath/Expr.java \
-gnu/xml/xpath/XPathFactoryImpl.java \
-gnu/xml/xpath/NormalizeSpaceFunction.java \
-gnu/xml/xpath/Constant.java \
-gnu/xml/xpath/Predicate.java \
-gnu/xml/xpath/Path.java \
-gnu/xml/xpath/OrExpr.java \
-gnu/xml/xpath/LangFunction.java \
-gnu/xml/xpath/StartsWithFunction.java \
-gnu/xml/xpath/SubstringAfterFunction.java \
-gnu/xml/xpath/FloorFunction.java \
-gnu/xml/xpath/NotFunction.java \
-gnu/xml/xpath/Root.java \
-gnu/xml/xpath/PositionFunction.java \
-gnu/xml/xpath/VariableReference.java \
-gnu/xml/xpath/DocumentOrderComparator.java \
-gnu/xml/xpath/LocalNameFunction.java \
-gnu/xml/xpath/NamespaceUriFunction.java \
-gnu/xml/xpath/TranslateFunction.java \
-gnu/xml/xpath/FalseFunction.java \
-gnu/xml/xpath/AndExpr.java \
-gnu/xml/xpath/XPathParser.java \
-gnu/xml/xpath/NamespaceTest.java \
-gnu/xml/xpath/ConcatFunction.java \
-gnu/xml/xpath/NameTest.java \
-gnu/xml/xpath/CountFunction.java \
-gnu/xml/xpath/IdFunction.java \
-gnu/xml/xpath/LastFunction.java \
-gnu/xml/xpath/XPathTokenizer.java \
-gnu/xml/xpath/Steps.java \
-gnu/xml/xpath/TrueFunction.java \
-gnu/xml/xpath/BooleanFunction.java \
-gnu/xml/xpath/ParenthesizedExpr.java \
-gnu/xml/xpath/XPathImpl.java \
-gnu/xml/xpath/Selector.java \
-gnu/xml/xpath/RoundFunction.java \
-gnu/xml/xpath/SubstringBeforeFunction.java \
-gnu/xml/xpath/Function.java \
-gnu/xml/xpath/CeilingFunction.java \
-gnu/xml/xpath/RelationalExpr.java \
-gnu/xml/xpath/FunctionCall.java \
-gnu/xml/xpath/NodeTypeTest.java \
-gnu/xml/xpath/ArithmeticExpr.java \
-gnu/xml/xpath/Test.java \
-gnu/xml/xpath/ContainsFunction.java \
-gnu/xml/pipeline/EventFilter.java \
-gnu/xml/pipeline/NSFilter.java \
-gnu/xml/pipeline/XsltFilter.java \
-gnu/xml/pipeline/ValidationConsumer.java \
-gnu/xml/pipeline/PipelineFactory.java \
-gnu/xml/pipeline/TextConsumer.java \
-gnu/xml/pipeline/LinkFilter.java \
-gnu/xml/pipeline/TeeConsumer.java \
-gnu/xml/pipeline/DomConsumer.java \
-gnu/xml/pipeline/EventConsumer.java \
-gnu/xml/pipeline/WellFormednessFilter.java \
-gnu/xml/pipeline/XIncludeFilter.java \
-gnu/xml/pipeline/CallFilter.java \
-gnu/xml/aelfred2/XmlParser.java \
-gnu/xml/aelfred2/XmlReader.java \
-gnu/xml/aelfred2/JAXPFactory.java \
-gnu/xml/aelfred2/ContentHandler2.java \
-gnu/xml/aelfred2/SAXDriver.java \
-gnu/xml/util/XCat.java \
-gnu/xml/util/DomParser.java \
-gnu/xml/util/XMLWriter.java \
-gnu/xml/util/Resolver.java \
-gnu/xml/util/DoParse.java \
-gnu/xml/util/XHTMLWriter.java \
-gnu/xml/util/SAXNullTransformerFactory.java \
-gnu/xml/dom/DomXPathNSResolver.java \
-gnu/xml/dom/ls/FilteredSAXEventSink.java \
-gnu/xml/dom/ls/DomLSException.java \
-gnu/xml/dom/ls/DomLSSerializer.java \
-gnu/xml/dom/ls/DomLSInput.java \
-gnu/xml/dom/ls/DomLSOutput.java \
-gnu/xml/dom/ls/SAXEventSink.java \
-gnu/xml/dom/ls/DomLSParser.java \
-gnu/xml/dom/ls/ReaderInputStream.java \
-gnu/xml/dom/ls/WriterOutputStream.java \
-gnu/xml/dom/DomElement.java \
-gnu/xml/dom/DomNsNode.java \
-gnu/xml/dom/DomAttr.java \
-gnu/xml/dom/DTDAttributeTypeInfo.java \
-gnu/xml/dom/DomDocumentBuilder.java \
-gnu/xml/dom/DTDElementTypeInfo.java \
-gnu/xml/dom/DomDocument.java \
-gnu/xml/dom/DomXPathExpression.java \
-gnu/xml/dom/DomDocumentConfiguration.java \
-gnu/xml/dom/DomDocumentFragment.java \
-gnu/xml/dom/DomProcessingInstruction.java \
-gnu/xml/dom/Consumer.java \
-gnu/xml/dom/DomComment.java \
-gnu/xml/dom/DomCharacterData.java \
-gnu/xml/dom/DomExtern.java \
-gnu/xml/dom/DomEntityReference.java \
-gnu/xml/dom/DomNamedNodeMap.java \
-gnu/xml/dom/ImplementationList.java \
-gnu/xml/dom/ImplementationSource.java \
-gnu/xml/dom/DomImpl.java \
-gnu/xml/dom/DomDoctype.java \
-gnu/xml/dom/DomNode.java \
-gnu/xml/dom/DomXPathResult.java \
-gnu/xml/dom/DomDocumentBuilderFactory.java \
-gnu/xml/dom/DomText.java \
-gnu/xml/dom/DomNSResolverContext.java \
-gnu/xml/dom/DomNodeIterator.java \
-gnu/xml/dom/DomNotation.java \
-gnu/xml/dom/JAXPFactory.java \
-gnu/xml/dom/DomIterator.java \
-gnu/xml/dom/DomEvent.java \
-gnu/xml/dom/DomEntity.java \
-gnu/xml/dom/DomCDATASection.java \
-gnu/xml/dom/DomDOMException.java \
-gnu/xml/dom/html2/DomHTMLAnchorElement.java \
-gnu/xml/dom/html2/DomHTMLAppletElement.java \
-gnu/xml/dom/html2/DomHTMLAreaElement.java \
-gnu/xml/dom/html2/DomHTMLBaseElement.java \
-gnu/xml/dom/html2/DomHTMLBaseFontElement.java \
-gnu/xml/dom/html2/DomHTMLBodyElement.java \
-gnu/xml/dom/html2/DomHTMLBRElement.java \
-gnu/xml/dom/html2/DomHTMLButtonElement.java \
-gnu/xml/dom/html2/DomHTMLCollection.java \
-gnu/xml/dom/html2/DomHTMLDirectoryElement.java \
-gnu/xml/dom/html2/DomHTMLDivElement.java \
-gnu/xml/dom/html2/DomHTMLDListElement.java \
-gnu/xml/dom/html2/DomHTMLDocument.java \
-gnu/xml/dom/html2/DomHTMLElement.java \
-gnu/xml/dom/html2/DomHTMLFieldSetElement.java \
-gnu/xml/dom/html2/DomHTMLFontElement.java \
-gnu/xml/dom/html2/DomHTMLFormElement.java \
-gnu/xml/dom/html2/DomHTMLFrameElement.java \
-gnu/xml/dom/html2/DomHTMLFrameSetElement.java \
-gnu/xml/dom/html2/DomHTMLHeadElement.java \
-gnu/xml/dom/html2/DomHTMLHeadingElement.java \
-gnu/xml/dom/html2/DomHTMLHRElement.java \
-gnu/xml/dom/html2/DomHTMLHtmlElement.java \
-gnu/xml/dom/html2/DomHTMLIFrameElement.java \
-gnu/xml/dom/html2/DomHTMLImageElement.java \
-gnu/xml/dom/html2/DomHTMLImpl.java \
-gnu/xml/dom/html2/DomHTMLInputElement.java \
-gnu/xml/dom/html2/DomHTMLIsIndexElement.java \
-gnu/xml/dom/html2/DomHTMLLabelElement.java \
-gnu/xml/dom/html2/DomHTMLLegendElement.java \
-gnu/xml/dom/html2/DomHTMLLIElement.java \
-gnu/xml/dom/html2/DomHTMLLinkElement.java \
-gnu/xml/dom/html2/DomHTMLMapElement.java \
-gnu/xml/dom/html2/DomHTMLMenuElement.java \
-gnu/xml/dom/html2/DomHTMLMetaElement.java \
-gnu/xml/dom/html2/DomHTMLModElement.java \
-gnu/xml/dom/html2/DomHTMLObjectElement.java \
-gnu/xml/dom/html2/DomHTMLOListElement.java \
-gnu/xml/dom/html2/DomHTMLOptGroupElement.java \
-gnu/xml/dom/html2/DomHTMLOptionElement.java \
-gnu/xml/dom/html2/DomHTMLParagraphElement.java \
-gnu/xml/dom/html2/DomHTMLParamElement.java \
-gnu/xml/dom/html2/DomHTMLParser.java \
-gnu/xml/dom/html2/DomHTMLPreElement.java \
-gnu/xml/dom/html2/DomHTMLQuoteElement.java \
-gnu/xml/dom/html2/DomHTMLScriptElement.java \
-gnu/xml/dom/html2/DomHTMLSelectElement.java \
-gnu/xml/dom/html2/DomHTMLStyleElement.java \
-gnu/xml/dom/html2/DomHTMLTableCaptionElement.java \
-gnu/xml/dom/html2/DomHTMLTableCellElement.java \
-gnu/xml/dom/html2/DomHTMLTableColElement.java \
-gnu/xml/dom/html2/DomHTMLTableElement.java \
-gnu/xml/dom/html2/DomHTMLTableRowElement.java \
-gnu/xml/dom/html2/DomHTMLTableSectionElement.java \
-gnu/xml/dom/html2/DomHTMLTextAreaElement.java \
-gnu/xml/dom/html2/DomHTMLTitleElement.java \
-gnu/xml/dom/html2/DomHTMLUListElement.java \
-gnu/xml/transform/GenerateIdFunction.java \
-gnu/xml/transform/FormatNumberFunction.java \
-gnu/xml/transform/ValueOfNode.java \
-gnu/xml/transform/ApplyImportsNode.java \
-gnu/xml/transform/WithParam.java \
-gnu/xml/transform/DocumentFunction.java \
-gnu/xml/transform/SAXSerializer.java \
-gnu/xml/transform/FunctionAvailableFunction.java \
-gnu/xml/transform/ElementAvailableFunction.java \
-gnu/xml/transform/IfNode.java \
-gnu/xml/transform/ApplyTemplatesNode.java \
-gnu/xml/transform/SortKey.java \
-gnu/xml/transform/Key.java \
-gnu/xml/transform/ElementNode.java \
-gnu/xml/transform/CurrentFunction.java \
-gnu/xml/transform/XSLComparator.java \
-gnu/xml/transform/CallTemplateNode.java \
-gnu/xml/transform/TemplatesImpl.java \
-gnu/xml/transform/ChooseNode.java \
-gnu/xml/transform/NumberNode.java \
-gnu/xml/transform/CopyOfNode.java \
-gnu/xml/transform/ParameterNode.java \
-gnu/xml/transform/TransformerFactoryImpl.java \
-gnu/xml/transform/TextNode.java \
-gnu/xml/transform/CopyNode.java \
-gnu/xml/transform/SystemPropertyFunction.java \
-gnu/xml/transform/Stylesheet.java \
-gnu/xml/transform/ProcessingInstructionNode.java \
-gnu/xml/transform/UnparsedEntityUriFunction.java \
-gnu/xml/transform/URIResolverEntityResolver.java \
-gnu/xml/transform/ErrorListenerErrorHandler.java \
-gnu/xml/transform/Bindings.java \
-gnu/xml/transform/AttributeSet.java \
-gnu/xml/transform/Template.java \
-gnu/xml/transform/MessageNode.java \
-gnu/xml/transform/LiteralNode.java \
-gnu/xml/transform/StreamSerializer.java \
-gnu/xml/transform/XSLURIResolver.java \
-gnu/xml/transform/AttributeNode.java \
-gnu/xml/transform/CommentNode.java \
-gnu/xml/transform/ForEachNode.java \
-gnu/xml/transform/KeyFunction.java \
-gnu/xml/transform/TransformerImpl.java \
-gnu/xml/transform/WhenNode.java \
-gnu/xml/transform/NodeNumberNode.java \
-gnu/xml/transform/OtherwiseNode.java \
-gnu/xml/transform/AbstractNumberNode.java \
-gnu/xml/transform/TemplateNode.java \
-gnu/xml/transform/TransformerOutputProperties.java \
-gnu/xml/transform/DOMSourceLocator.java
-
-## Java files which are created by configure and thus are in the build
-## directory.
-built_java_source_files = java/lang/ConcreteProcess.java \
- gnu/classpath/Configuration.java
-
-## Java files in the core packages java.lang, java.io, and java.util.
-## These are built before the other source files, in order to reduce
-## build time.
-core_java_source_files = \
-java/lang/AbstractMethodError.java \
-java/lang/ArithmeticException.java \
-java/lang/ArrayIndexOutOfBoundsException.java \
-java/lang/ArrayStoreException.java \
-java/lang/AssertionError.java \
-java/lang/Boolean.java \
-java/lang/Byte.java \
-java/lang/Character.java \
-java/lang/CharSequence.java \
-java/lang/ClassCastException.java \
-java/lang/ClassCircularityError.java \
-java/lang/ClassFormatError.java \
-java/lang/ClassLoader.java \
-java/lang/ClassNotFoundException.java \
-java/lang/CloneNotSupportedException.java \
-java/lang/Cloneable.java \
-java/lang/Comparable.java \
-java/lang/Compiler.java \
-java/lang/Double.java \
-java/lang/Error.java \
-java/lang/Exception.java \
-java/lang/ExceptionInInitializerError.java \
-java/lang/Float.java \
-java/lang/IllegalAccessError.java \
-java/lang/IllegalAccessException.java \
-java/lang/IllegalArgumentException.java \
-java/lang/IllegalMonitorStateException.java \
-java/lang/IllegalStateException.java \
-java/lang/IllegalThreadStateException.java \
-java/lang/IncompatibleClassChangeError.java \
-java/lang/IndexOutOfBoundsException.java \
-java/lang/InheritableThreadLocal.java \
-java/lang/InstantiationError.java \
-java/lang/InstantiationException.java \
-java/lang/Integer.java \
-java/lang/InternalError.java \
-java/lang/InterruptedException.java \
-java/lang/LinkageError.java \
-java/lang/Long.java \
-java/lang/Math.java \
-java/lang/NegativeArraySizeException.java \
-java/lang/NoClassDefFoundError.java \
-java/lang/NoSuchFieldError.java \
-java/lang/NoSuchFieldException.java \
-java/lang/NoSuchMethodError.java \
-java/lang/NoSuchMethodException.java \
-java/lang/NullPointerException.java \
-java/lang/Number.java \
-java/lang/NumberFormatException.java \
-java/lang/OutOfMemoryError.java \
-java/lang/Package.java \
-java/lang/Process.java \
-java/lang/Runnable.java \
-java/lang/Runtime.java \
-java/lang/RuntimeException.java \
-java/lang/RuntimePermission.java \
-java/lang/SecurityException.java \
-java/lang/SecurityManager.java \
-java/lang/Short.java \
-java/lang/StackOverflowError.java \
-java/lang/StackTraceElement.java \
-java/lang/StrictMath.java \
-java/lang/String.java \
-java/lang/StringBuffer.java \
-java/lang/StringBuilder.java \
-java/lang/StringIndexOutOfBoundsException.java \
-java/lang/System.java \
-java/lang/Thread.java \
-java/lang/ThreadDeath.java \
-java/lang/ThreadGroup.java \
-java/lang/ThreadLocal.java \
-java/lang/Throwable.java \
-java/lang/UnknownError.java \
-java/lang/UnsatisfiedLinkError.java \
-java/lang/UnsupportedClassVersionError.java \
-java/lang/UnsupportedOperationException.java \
-java/lang/VerifyError.java \
-java/lang/VirtualMachineError.java \
-java/lang/VMClassLoader.java \
-java/lang/VMCompiler.java \
-java/lang/VMSecurityManager.java \
-java/lang/VMThrowable.java \
-java/lang/Void.java \
-java/io/BufferedInputStream.java \
-java/io/BufferedOutputStream.java \
-java/io/BufferedReader.java \
-java/io/BufferedWriter.java \
-java/io/ByteArrayInputStream.java \
-java/io/ByteArrayOutputStream.java \
-java/io/CharArrayReader.java \
-java/io/CharArrayWriter.java \
-java/io/CharConversionException.java \
-java/io/DataInput.java \
-java/io/DataInputStream.java \
-java/io/DataOutput.java \
-java/io/DataOutputStream.java \
-java/io/EOFException.java \
-java/io/Externalizable.java \
-java/io/File.java \
-java/io/FileDescriptor.java \
-java/io/FileFilter.java \
-java/io/FileInputStream.java \
-java/io/FileNotFoundException.java \
-java/io/FileOutputStream.java \
-java/io/FilePermission.java \
-java/io/FileReader.java \
-java/io/FileWriter.java \
-java/io/FilenameFilter.java \
-java/io/FilterInputStream.java \
-java/io/FilterOutputStream.java \
-java/io/FilterReader.java \
-java/io/FilterWriter.java \
-java/io/IOException.java \
-java/io/InputStream.java \
-java/io/InputStreamReader.java \
-java/io/InterruptedIOException.java \
-java/io/InvalidClassException.java \
-java/io/InvalidObjectException.java \
-java/io/LineNumberInputStream.java \
-java/io/LineNumberReader.java \
-java/io/NotActiveException.java \
-java/io/NotSerializableException.java \
-java/io/ObjectInput.java \
-java/io/ObjectInputStream.java \
-java/io/ObjectInputValidation.java \
-java/io/ObjectOutput.java \
-java/io/ObjectOutputStream.java \
-java/io/ObjectStreamClass.java \
-java/io/ObjectStreamConstants.java \
-java/io/ObjectStreamException.java \
-java/io/ObjectStreamField.java \
-java/io/OptionalDataException.java \
-java/io/OutputStream.java \
-java/io/OutputStreamWriter.java \
-java/io/PipedInputStream.java \
-java/io/PipedOutputStream.java \
-java/io/PipedReader.java \
-java/io/PipedWriter.java \
-java/io/PrintStream.java \
-java/io/PrintWriter.java \
-java/io/PushbackInputStream.java \
-java/io/PushbackReader.java \
-java/io/RandomAccessFile.java \
-java/io/Reader.java \
-java/io/SequenceInputStream.java \
-java/io/Serializable.java \
-java/io/SerializablePermission.java \
-java/io/StreamCorruptedException.java \
-java/io/StreamTokenizer.java \
-java/io/StringBufferInputStream.java \
-java/io/StringReader.java \
-java/io/StringWriter.java \
-java/io/SyncFailedException.java \
-java/io/UTFDataFormatException.java \
-java/io/UnsupportedEncodingException.java \
-java/io/VMObjectStreamClass.java \
-java/io/WriteAbortedException.java \
-java/io/Writer.java \
-java/util/AbstractCollection.java \
-java/util/AbstractList.java \
-java/util/AbstractMap.java \
-java/util/AbstractSequentialList.java \
-java/util/AbstractSet.java \
-java/util/ArrayList.java \
-java/util/Arrays.java \
-java/util/BitSet.java \
-java/util/Calendar.java \
-java/util/Collection.java \
-java/util/Collections.java \
-java/util/Comparator.java \
-java/util/ConcurrentModificationException.java \
-java/util/Currency.java \
-java/util/Date.java \
-java/util/Dictionary.java \
-java/util/EmptyStackException.java \
-java/util/Enumeration.java \
-java/util/EventListener.java \
-java/util/EventListenerProxy.java \
-java/util/EventObject.java \
-java/util/GregorianCalendar.java \
-java/util/HashMap.java \
-java/util/HashSet.java \
-java/util/Hashtable.java \
-java/util/IdentityHashMap.java \
-java/util/Iterator.java \
-java/util/LinkedList.java \
-java/util/LinkedHashMap.java \
-java/util/LinkedHashSet.java \
-java/util/List.java \
-java/util/ListIterator.java \
-java/util/ListResourceBundle.java \
-java/util/Locale.java \
-java/util/Map.java \
-java/util/MissingResourceException.java \
-java/util/NoSuchElementException.java \
-java/util/Observable.java \
-java/util/Observer.java \
-java/util/Properties.java \
-java/util/PropertyPermission.java \
-java/util/PropertyPermissionCollection.java \
-java/util/PropertyResourceBundle.java \
-java/util/Random.java \
-java/util/RandomAccess.java \
-java/util/ResourceBundle.java \
-java/util/Set.java \
-java/util/SimpleTimeZone.java \
-java/util/SortedMap.java \
-java/util/SortedSet.java \
-java/util/Stack.java \
-java/util/StringTokenizer.java \
-java/util/TimeZone.java \
-java/util/Timer.java \
-java/util/TimerTask.java \
-java/util/TreeMap.java \
-java/util/TreeSet.java \
-java/util/TooManyListenersException.java \
-java/util/Vector.java \
-java/util/VMTimeZone.java \
-java/util/WeakHashMap.java \
-java/util/logging/ConsoleHandler.java \
-java/util/logging/ErrorManager.java \
-java/util/logging/FileHandler.java \
-java/util/logging/Filter.java \
-java/util/logging/Formatter.java \
-java/util/logging/Handler.java \
-java/util/logging/Level.java \
-java/util/logging/Logger.java \
-java/util/logging/LoggingPermission.java \
-java/util/logging/LogManager.java \
-java/util/logging/LogRecord.java \
-java/util/logging/MemoryHandler.java \
-java/util/logging/SimpleFormatter.java \
-java/util/logging/SocketHandler.java \
-java/util/logging/StreamHandler.java \
-java/util/logging/XMLFormatter.java \
-java/util/prefs/NodeChangeListener.java \
-java/util/prefs/Preferences.java \
-java/util/prefs/PreferenceChangeListener.java \
-java/util/prefs/NodeChangeEvent.java \
-java/util/prefs/InvalidPreferencesFormatException.java \
-java/util/prefs/AbstractPreferences.java \
-java/util/prefs/BackingStoreException.java \
-java/util/prefs/PreferenceChangeEvent.java \
-java/util/prefs/PreferencesFactory.java \
-java/util/regex/Matcher.java \
-java/util/regex/Pattern.java \
-java/util/regex/PatternSyntaxException.java
-
-## List of all .java files to be compiled. Please keep this list
-## alphabetical. Please put files from java/lang, java/io, and java/util
-## into core_java_source_files. Please put files from gnu/gcj/convert
-## into convert_source_files and files from java/awt into
-## awt_java_source_files. If the .java file has a hand-maintained
-## header, please list it in special_java_source_files.
-ordinary_java_source_files = $(core_java_source_files) \
-gnu/classpath/ServiceFactory.java \
-gnu/classpath/ServiceProviderLoadingAction.java \
-gnu/classpath/SystemProperties.java \
-gnu/gcj/Core.java \
-gnu/gcj/RawData.java \
-gnu/gcj/RawDataManaged.java \
-gnu/gcj/io/DefaultMimeTypes.java \
-gnu/gcj/io/MimeTypes.java \
-gnu/gcj/io/SimpleSHSStream.java \
-gnu/gcj/runtime/BootClassLoader.java \
-gnu/gcj/runtime/ExtensionClassLoader.java \
-gnu/gcj/runtime/FileDeleter.java \
-gnu/gcj/runtime/FinalizerThread.java \
-gnu/gcj/runtime/HelperClassLoader.java \
-gnu/gcj/runtime/JNIWeakRef.java \
-gnu/gcj/runtime/NameFinder.java \
-gnu/gcj/runtime/PersistentByteMap.java \
-gnu/gcj/runtime/SharedLibHelper.java \
-gnu/gcj/runtime/SharedLibLoader.java \
-gnu/gcj/runtime/StringBuffer.java \
-gnu/gcj/runtime/SystemClassLoader.java \
-gnu/gcj/util/Debug.java \
-gnu/java/io/ASN1ParsingException.java \
-gnu/java/io/Base64InputStream.java \
-gnu/java/io/ClassLoaderObjectInputStream.java \
-gnu/java/io/NullOutputStream.java \
-gnu/java/io/ObjectIdentityWrapper.java \
-gnu/java/lang/ArrayHelper.java \
-gnu/java/lang/ClassHelper.java \
-gnu/java/lang/MainThread.java \
-gnu/java/lang/reflect/TypeSignature.java \
-gnu/java/locale/Calendar.java \
-gnu/java/locale/Calendar_de.java \
-gnu/java/locale/Calendar_en.java \
-gnu/java/locale/Calendar_nl.java \
-gnu/java/locale/LocaleInformation.java \
-gnu/java/locale/LocaleInformation_af_ZA.java \
-gnu/java/locale/LocaleInformation_ar_AE.java \
-gnu/java/locale/LocaleInformation_ar_BH.java \
-gnu/java/locale/LocaleInformation_ar_DZ.java \
-gnu/java/locale/LocaleInformation_ar_EG.java \
-gnu/java/locale/LocaleInformation_ar_IN.java \
-gnu/java/locale/LocaleInformation_ar_IQ.java \
-gnu/java/locale/LocaleInformation_ar_JO.java \
-gnu/java/locale/LocaleInformation_ar_KW.java \
-gnu/java/locale/LocaleInformation_ar_LB.java \
-gnu/java/locale/LocaleInformation_ar_LY.java \
-gnu/java/locale/LocaleInformation_ar_MA.java \
-gnu/java/locale/LocaleInformation_ar_OM.java \
-gnu/java/locale/LocaleInformation_ar_QA.java \
-gnu/java/locale/LocaleInformation_ar_SD.java \
-gnu/java/locale/LocaleInformation_ar_SY.java \
-gnu/java/locale/LocaleInformation_ar_TN.java \
-gnu/java/locale/LocaleInformation_ar_YE.java \
-gnu/java/locale/LocaleInformation_be_BY.java \
-gnu/java/locale/LocaleInformation_bn_IN.java \
-gnu/java/locale/LocaleInformation_br_FR.java \
-gnu/java/locale/LocaleInformation_bs_BA.java \
-gnu/java/locale/LocaleInformation_ca_ES.java \
-gnu/java/locale/LocaleInformation_cs_CZ.java \
-gnu/java/locale/LocaleInformation_cy_GB.java \
-gnu/java/locale/LocaleInformation_da_DK.java \
-gnu/java/locale/LocaleInformation_de.java \
-gnu/java/locale/LocaleInformation_de_AT.java \
-gnu/java/locale/LocaleInformation_de_BE.java \
-gnu/java/locale/LocaleInformation_de_CH.java \
-gnu/java/locale/LocaleInformation_de_DE.java \
-gnu/java/locale/LocaleInformation_de_LU.java \
-gnu/java/locale/LocaleInformation_el_GR.java \
-gnu/java/locale/LocaleInformation_en.java \
-gnu/java/locale/LocaleInformation_en_AU.java \
-gnu/java/locale/LocaleInformation_en_BW.java \
-gnu/java/locale/LocaleInformation_en_CA.java \
-gnu/java/locale/LocaleInformation_en_DK.java \
-gnu/java/locale/LocaleInformation_en_GB.java \
-gnu/java/locale/LocaleInformation_en_HK.java \
-gnu/java/locale/LocaleInformation_en_IE.java \
-gnu/java/locale/LocaleInformation_en_IN.java \
-gnu/java/locale/LocaleInformation_en_NZ.java \
-gnu/java/locale/LocaleInformation_en_PH.java \
-gnu/java/locale/LocaleInformation_en_SG.java \
-gnu/java/locale/LocaleInformation_en_US.java \
-gnu/java/locale/LocaleInformation_en_ZA.java \
-gnu/java/locale/LocaleInformation_en_ZW.java \
-gnu/java/locale/LocaleInformation_es_AR.java \
-gnu/java/locale/LocaleInformation_es_BO.java \
-gnu/java/locale/LocaleInformation_es_CL.java \
-gnu/java/locale/LocaleInformation_es_CO.java \
-gnu/java/locale/LocaleInformation_es_CR.java \
-gnu/java/locale/LocaleInformation_es_DO.java \
-gnu/java/locale/LocaleInformation_es_EC.java \
-gnu/java/locale/LocaleInformation_es_ES.java \
-gnu/java/locale/LocaleInformation_es_GT.java \
-gnu/java/locale/LocaleInformation_es_HN.java \
-gnu/java/locale/LocaleInformation_es_MX.java \
-gnu/java/locale/LocaleInformation_es_NI.java \
-gnu/java/locale/LocaleInformation_es_PA.java \
-gnu/java/locale/LocaleInformation_es_PE.java \
-gnu/java/locale/LocaleInformation_es_PR.java \
-gnu/java/locale/LocaleInformation_es_PY.java \
-gnu/java/locale/LocaleInformation_es_SV.java \
-gnu/java/locale/LocaleInformation_es_US.java \
-gnu/java/locale/LocaleInformation_es_UY.java \
-gnu/java/locale/LocaleInformation_es_VE.java \
-gnu/java/locale/LocaleInformation_et_EE.java \
-gnu/java/locale/LocaleInformation_eu_ES.java \
-gnu/java/locale/LocaleInformation_fa_IR.java \
-gnu/java/locale/LocaleInformation_fi_FI.java \
-gnu/java/locale/LocaleInformation_fo_FO.java \
-gnu/java/locale/LocaleInformation_fr_BE.java \
-gnu/java/locale/LocaleInformation_fr_CA.java \
-gnu/java/locale/LocaleInformation_fr_CH.java \
-gnu/java/locale/LocaleInformation_fr_FR.java \
-gnu/java/locale/LocaleInformation_fr_LU.java \
-gnu/java/locale/LocaleInformation_ga_IE.java \
-gnu/java/locale/LocaleInformation_gd_GB.java \
-gnu/java/locale/LocaleInformation_gl_ES.java \
-gnu/java/locale/LocaleInformation_gv_GB.java \
-gnu/java/locale/LocaleInformation_he_IL.java \
-gnu/java/locale/LocaleInformation_hi_IN.java \
-gnu/java/locale/LocaleInformation_hr_HR.java \
-gnu/java/locale/LocaleInformation_hu_HU.java \
-gnu/java/locale/LocaleInformation_id_ID.java \
-gnu/java/locale/LocaleInformation_it_CH.java \
-gnu/java/locale/LocaleInformation_it_IT.java \
-gnu/java/locale/LocaleInformation_iw_IL.java \
-gnu/java/locale/LocaleInformation_ja_JP.java \
-gnu/java/locale/LocaleInformation_ka_GE.java \
-gnu/java/locale/LocaleInformation_kl_GL.java \
-gnu/java/locale/LocaleInformation_ko_KR.java \
-gnu/java/locale/LocaleInformation_kw_GB.java \
-gnu/java/locale/LocaleInformation_lt_LT.java \
-gnu/java/locale/LocaleInformation_lv_LV.java \
-gnu/java/locale/LocaleInformation_mi_NZ.java \
-gnu/java/locale/LocaleInformation_mk_MK.java \
-gnu/java/locale/LocaleInformation_mr_IN.java \
-gnu/java/locale/LocaleInformation_mt_MT.java \
-gnu/java/locale/LocaleInformation_nl.java \
-gnu/java/locale/LocaleInformation_nl_BE.java \
-gnu/java/locale/LocaleInformation_nl_NL.java \
-gnu/java/locale/LocaleInformation_nn_NO.java \
-gnu/java/locale/LocaleInformation_no_NO.java \
-gnu/java/locale/LocaleInformation_oc_FR.java \
-gnu/java/locale/LocaleInformation_pl_PL.java \
-gnu/java/locale/LocaleInformation_pt_BR.java \
-gnu/java/locale/LocaleInformation_pt_PT.java \
-gnu/java/locale/LocaleInformation_ro_RO.java \
-gnu/java/locale/LocaleInformation_ru_RU.java \
-gnu/java/locale/LocaleInformation_ru_UA.java \
-gnu/java/locale/LocaleInformation_se_NO.java \
-gnu/java/locale/LocaleInformation_sk_SK.java \
-gnu/java/locale/LocaleInformation_sl_SI.java \
-gnu/java/locale/LocaleInformation_sq_AL.java \
-gnu/java/locale/LocaleInformation_sr_YU.java \
-gnu/java/locale/LocaleInformation_sv_FI.java \
-gnu/java/locale/LocaleInformation_sv_SE.java \
-gnu/java/locale/LocaleInformation_ta_IN.java \
-gnu/java/locale/LocaleInformation_te_IN.java \
-gnu/java/locale/LocaleInformation_tg_TJ.java \
-gnu/java/locale/LocaleInformation_tl_PH.java \
-gnu/java/locale/LocaleInformation_tr_TR.java \
-gnu/java/locale/LocaleInformation_uk_UA.java \
-gnu/java/locale/LocaleInformation_ur_PK.java \
-gnu/java/locale/LocaleInformation_uz_UZ.java \
-gnu/java/locale/LocaleInformation_vi_VN.java \
-gnu/java/locale/LocaleInformation_yi_US.java \
-gnu/java/locale/LocaleInformation_zh_CN.java \
-gnu/java/locale/LocaleInformation_zh_HK.java \
-gnu/java/locale/LocaleInformation_zh_SG.java \
-gnu/java/locale/LocaleInformation_zh_TW.java \
-gnu/java/math/MPN.java \
-gnu/java/net/BASE64.java \
-gnu/java/net/CRLFInputStream.java \
-gnu/java/net/CRLFOutputStream.java \
-gnu/java/net/DefaultContentHandlerFactory.java \
-gnu/java/net/EmptyX509TrustManager.java \
-gnu/java/net/GetLocalHostAction.java \
-gnu/java/net/HeaderFieldHelper.java \
-gnu/java/net/LineInputStream.java \
-gnu/java/net/PlainDatagramSocketImpl.java \
-gnu/java/net/PlainSocketImpl.java \
-gnu/java/net/URLParseError.java \
-gnu/java/net/protocol/core/Connection.java \
-gnu/java/net/protocol/core/CoreInputStream.java \
-gnu/java/net/protocol/core/Handler.java \
-gnu/java/net/protocol/file/Connection.java \
-gnu/java/net/protocol/file/Handler.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/CompressedInputStream.java \
-gnu/java/net/protocol/ftp/CompressedOutputStream.java \
-gnu/java/net/protocol/ftp/DTP.java \
-gnu/java/net/protocol/ftp/DTPInputStream.java \
-gnu/java/net/protocol/ftp/DTPOutputStream.java \
-gnu/java/net/protocol/ftp/FTPConnection.java \
-gnu/java/net/protocol/ftp/FTPException.java \
-gnu/java/net/protocol/ftp/FTPResponse.java \
-gnu/java/net/protocol/ftp/FTPURLConnection.java \
-gnu/java/net/protocol/ftp/Handler.java \
-gnu/java/net/protocol/ftp/PassiveModeDTP.java \
-gnu/java/net/protocol/ftp/StreamInputStream.java \
-gnu/java/net/protocol/ftp/StreamOutputStream.java \
-gnu/java/net/protocol/gcjlib/Connection.java \
-gnu/java/net/protocol/gcjlib/Handler.java \
-gnu/java/net/protocol/http/Authenticator.java \
-gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java \
-gnu/java/net/protocol/http/ByteArrayResponseBodyReader.java \
-gnu/java/net/protocol/http/ChunkedInputStream.java \
-gnu/java/net/protocol/http/Cookie.java \
-gnu/java/net/protocol/http/CookieManager.java \
-gnu/java/net/protocol/http/Credentials.java \
-gnu/java/net/protocol/http/HTTPConnection.java \
-gnu/java/net/protocol/http/HTTPDateFormat.java \
-gnu/java/net/protocol/http/HTTPURLConnection.java \
-gnu/java/net/protocol/http/Handler.java \
-gnu/java/net/protocol/http/Headers.java \
-gnu/java/net/protocol/http/Request.java \
-gnu/java/net/protocol/http/RequestBodyWriter.java \
-gnu/java/net/protocol/http/Response.java \
-gnu/java/net/protocol/http/ResponseBodyReader.java \
-gnu/java/net/protocol/http/ResponseHeaderHandler.java \
-gnu/java/net/protocol/http/SimpleCookieManager.java \
-gnu/java/net/protocol/http/event/ConnectionEvent.java \
-gnu/java/net/protocol/http/event/ConnectionListener.java \
-gnu/java/net/protocol/http/event/RequestEvent.java \
-gnu/java/net/protocol/http/event/RequestListener.java \
-gnu/java/net/protocol/https/Handler.java \
-gnu/java/net/protocol/jar/Connection.java \
-gnu/java/net/protocol/jar/Handler.java \
-gnu/java/nio/ChannelInputStream.java \
-gnu/java/nio/ChannelOutputStream.java \
-gnu/java/nio/ChannelReader.java \
-gnu/java/nio/DatagramChannelImpl.java \
-gnu/java/nio/DatagramChannelSelectionKey.java \
-gnu/java/nio/FileLockImpl.java \
-gnu/java/nio/InputStreamChannel.java \
-gnu/java/nio/NIOConstants.java \
-gnu/java/nio/NIODatagramSocket.java \
-gnu/java/nio/NIOServerSocket.java \
-gnu/java/nio/NIOSocket.java \
-gnu/java/nio/OutputStreamChannel.java \
-gnu/java/nio/PipeImpl.java \
-gnu/java/nio/SelectionKeyImpl.java \
-gnu/java/nio/SelectorImpl.java \
-gnu/java/nio/SelectorProviderImpl.java \
-gnu/java/nio/ServerSocketChannelImpl.java \
-gnu/java/nio/ServerSocketChannelSelectionKey.java \
-gnu/java/nio/SocketChannelImpl.java \
-gnu/java/nio/SocketChannelSelectionKey.java \
-gnu/java/nio/VMPipe.java \
-gnu/java/nio/VMSelector.java \
-gnu/java/nio/channels/FileChannelImpl.java \
-gnu/java/nio/charset/ISO_8859_1.java \
-gnu/java/nio/charset/Provider.java \
-gnu/java/nio/charset/US_ASCII.java \
-gnu/java/nio/charset/UTF_16.java \
-gnu/java/nio/charset/UTF_16BE.java \
-gnu/java/nio/charset/UTF_16Decoder.java \
-gnu/java/nio/charset/UTF_16Encoder.java \
-gnu/java/nio/charset/UTF_16LE.java \
-gnu/java/nio/charset/UTF_8.java \
-gnu/java/security/Engine.java \
-gnu/java/security/OID.java \
-gnu/java/security/PolicyFile.java \
-gnu/java/security/action/GetPropertyAction.java \
-gnu/java/security/action/GetSecurityPropertyAction.java \
-gnu/java/security/action/SetAccessibleAction.java \
-gnu/java/security/ber/BER.java \
-gnu/java/security/ber/BEREncodingException.java \
-gnu/java/security/ber/BERReader.java \
-gnu/java/security/ber/BERValue.java \
-gnu/java/security/der/BitString.java \
-gnu/java/security/der/DER.java \
-gnu/java/security/der/DEREncodingException.java \
-gnu/java/security/der/DERReader.java \
-gnu/java/security/der/DERValue.java \
-gnu/java/security/der/DERWriter.java \
-gnu/java/security/pkcs/PKCS7SignedData.java \
-gnu/java/security/pkcs/SignerInfo.java \
-gnu/java/security/provider/CollectionCertStoreImpl.java \
-gnu/java/security/provider/DSAKeyFactory.java \
-gnu/java/security/provider/DSAKeyPairGenerator.java \
-gnu/java/security/provider/DSAParameterGenerator.java \
-gnu/java/security/provider/DSAParameters.java \
-gnu/java/security/provider/DSASignature.java \
-gnu/java/security/provider/DefaultPolicy.java \
-gnu/java/security/provider/EncodedKeyFactory.java \
-gnu/java/security/provider/Gnu.java \
-gnu/java/security/provider/GnuDHPublicKey.java \
-gnu/java/security/provider/GnuDSAPrivateKey.java \
-gnu/java/security/provider/GnuDSAPublicKey.java \
-gnu/java/security/provider/GnuRSAPrivateKey.java \
-gnu/java/security/provider/GnuRSAPublicKey.java \
-gnu/java/security/provider/MD2withRSA.java \
-gnu/java/security/provider/MD4withRSA.java \
-gnu/java/security/provider/MD5.java \
-gnu/java/security/provider/MD5withRSA.java \
-gnu/java/security/provider/PKIXCertPathValidatorImpl.java \
-gnu/java/security/provider/RSA.java \
-gnu/java/security/provider/RSAKeyFactory.java \
-gnu/java/security/provider/SHA.java \
-gnu/java/security/provider/SHA1PRNG.java \
-gnu/java/security/provider/SHA1withRSA.java \
-gnu/java/security/provider/X509CertificateFactory.java \
-gnu/java/security/util/Prime.java \
-gnu/java/security/x509/GnuPKIExtension.java \
-gnu/java/security/x509/PolicyNodeImpl.java \
-gnu/java/security/x509/Util.java \
-gnu/java/security/x509/X500DistinguishedName.java \
-gnu/java/security/x509/X509CRL.java \
-gnu/java/security/x509/X509CRLEntry.java \
-gnu/java/security/x509/X509CRLSelectorImpl.java \
-gnu/java/security/x509/X509Certificate.java \
-gnu/java/security/x509/X509CertPath.java \
-gnu/java/security/x509/X509CertSelectorImpl.java \
-gnu/java/security/x509/ext/AuthorityKeyIdentifier.java \
-gnu/java/security/x509/ext/BasicConstraints.java \
-gnu/java/security/x509/ext/CRLNumber.java \
-gnu/java/security/x509/ext/CertificatePolicies.java \
-gnu/java/security/x509/ext/ExtendedKeyUsage.java \
-gnu/java/security/x509/ext/Extension.java \
-gnu/java/security/x509/ext/GeneralNames.java \
-gnu/java/security/x509/ext/IssuerAlternativeNames.java \
-gnu/java/security/x509/ext/KeyUsage.java \
-gnu/java/security/x509/ext/PolicyConstraint.java \
-gnu/java/security/x509/ext/PolicyMappings.java \
-gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java \
-gnu/java/security/x509/ext/ReasonCode.java \
-gnu/java/security/x509/ext/SubjectAlternativeNames.java \
-gnu/java/security/x509/ext/SubjectKeyIdentifier.java \
-gnu/java/text/AttributedFormatBuffer.java \
-gnu/java/text/BaseBreakIterator.java \
-gnu/java/text/CharacterBreakIterator.java \
-gnu/java/text/FormatBuffer.java \
-gnu/java/text/FormatCharacterIterator.java \
-gnu/java/text/LineBreakIterator.java \
-gnu/java/text/SentenceBreakIterator.java \
-gnu/java/text/StringFormatBuffer.java \
-gnu/java/text/WordBreakIterator.java \
-gnu/java/util/DoubleEnumeration.java \
-gnu/java/util/EmptyEnumeration.java \
-gnu/java/util/prefs/FileBasedFactory.java \
-gnu/java/util/prefs/MemoryBasedFactory.java \
-gnu/java/util/prefs/MemoryBasedPreferences.java \
-gnu/java/util/prefs/NodeReader.java \
-gnu/java/util/prefs/NodeWriter.java \
-gnu/regexp/CharIndexed.java \
-gnu/regexp/CharIndexedCharArray.java \
-gnu/regexp/CharIndexedInputStream.java \
-gnu/regexp/CharIndexedString.java \
-gnu/regexp/CharIndexedStringBuffer.java \
-gnu/regexp/RE.java \
-gnu/regexp/REException.java \
-gnu/regexp/REFilterInputStream.java \
-gnu/regexp/REMatch.java \
-gnu/regexp/REMatchEnumeration.java \
-gnu/regexp/RESyntax.java \
-gnu/regexp/REToken.java \
-gnu/regexp/RETokenAny.java \
-gnu/regexp/RETokenBackRef.java \
-gnu/regexp/RETokenChar.java \
-gnu/regexp/RETokenEnd.java \
-gnu/regexp/RETokenEndSub.java \
-gnu/regexp/RETokenLookAhead.java \
-gnu/regexp/RETokenOneOf.java \
-gnu/regexp/RETokenPOSIX.java \
-gnu/regexp/RETokenRange.java \
-gnu/regexp/RETokenRepeated.java \
-gnu/regexp/RETokenStart.java \
-gnu/regexp/RETokenWordBoundary.java \
-gnu/regexp/UncheckedRE.java \
-java/lang/ref/PhantomReference.java \
-java/lang/ref/Reference.java \
-java/lang/ref/ReferenceQueue.java \
-java/lang/ref/SoftReference.java \
-java/lang/ref/WeakReference.java \
-java/lang/reflect/AccessibleObject.java \
-java/lang/reflect/Array.java \
-java/lang/reflect/Constructor.java \
-java/lang/reflect/Field.java \
-java/lang/reflect/InvocationHandler.java \
-java/lang/reflect/InvocationTargetException.java \
-java/lang/reflect/Member.java \
-java/lang/reflect/Method.java \
-java/lang/reflect/Modifier.java \
-java/lang/reflect/Proxy.java \
-java/lang/reflect/ReflectPermission.java \
-java/lang/reflect/UndeclaredThrowableException.java \
-java/math/BigDecimal.java \
-java/math/BigInteger.java \
-java/net/Authenticator.java \
-java/net/BindException.java \
-java/net/ConnectException.java \
-java/net/ContentHandler.java \
-java/net/ContentHandlerFactory.java \
-java/net/DatagramPacket.java \
-java/net/DatagramSocket.java \
-java/net/DatagramSocketImpl.java \
-java/net/DatagramSocketImplFactory.java \
-java/net/FileNameMap.java \
-java/net/HttpURLConnection.java \
-java/net/Inet4Address.java \
-java/net/Inet6Address.java \
-java/net/InetAddress.java \
-java/net/InetSocketAddress.java \
-java/net/JarURLConnection.java \
-java/net/MalformedURLException.java \
-java/net/MulticastSocket.java \
-java/net/NetPermission.java \
-java/net/NetworkInterface.java \
-java/net/NoRouteToHostException.java \
-java/net/PasswordAuthentication.java \
-java/net/PortUnreachableException.java \
-java/net/ProtocolException.java \
-java/net/ServerSocket.java \
-java/net/Socket.java \
-java/net/SocketAddress.java \
-java/net/SocketException.java \
-java/net/SocketImpl.java \
-java/net/SocketImplFactory.java \
-java/net/SocketOptions.java \
-java/net/SocketPermission.java \
-java/net/SocketTimeoutException.java \
-java/net/URI.java \
-java/net/URISyntaxException.java \
-java/net/URL.java \
-java/net/URLClassLoader.java \
-java/net/URLConnection.java \
-java/net/URLDecoder.java \
-java/net/URLEncoder.java \
-java/net/URLStreamHandler.java \
-java/net/URLStreamHandlerFactory.java \
-java/net/UnknownHostException.java \
-java/net/UnknownServiceException.java \
-java/net/VMNetworkInterface.java \
-java/nio/Buffer.java \
-java/nio/BufferOverflowException.java \
-java/nio/BufferUnderflowException.java \
-java/nio/ByteBuffer.java \
-java/nio/ByteBufferHelper.java \
-java/nio/ByteBufferImpl.java \
-java/nio/ByteOrder.java \
-java/nio/CharBuffer.java \
-java/nio/CharBufferImpl.java \
-java/nio/CharViewBufferImpl.java \
-java/nio/DirectByteBufferImpl.java \
-java/nio/DoubleBuffer.java \
-java/nio/DoubleBufferImpl.java \
-java/nio/DoubleViewBufferImpl.java \
-java/nio/FloatBuffer.java \
-java/nio/FloatBufferImpl.java \
-java/nio/FloatViewBufferImpl.java \
-java/nio/IntBuffer.java \
-java/nio/IntBufferImpl.java \
-java/nio/IntViewBufferImpl.java \
-java/nio/InvalidMarkException.java \
-java/nio/LongBuffer.java \
-java/nio/LongBufferImpl.java \
-java/nio/LongViewBufferImpl.java \
-java/nio/MappedByteBuffer.java \
-java/nio/MappedByteBufferImpl.java \
-java/nio/ReadOnlyBufferException.java \
-java/nio/ShortBuffer.java \
-java/nio/ShortBufferImpl.java \
-java/nio/ShortViewBufferImpl.java \
-java/nio/VMDirectByteBuffer.java \
-java/nio/channels/AlreadyConnectedException.java \
-java/nio/channels/AsynchronousCloseException.java \
-java/nio/channels/ByteChannel.java \
-java/nio/channels/CancelledKeyException.java \
-java/nio/channels/Channel.java \
-java/nio/channels/Channels.java \
-java/nio/channels/ClosedByInterruptException.java \
-java/nio/channels/ClosedChannelException.java \
-java/nio/channels/ClosedSelectorException.java \
-java/nio/channels/ConnectionPendingException.java \
-java/nio/channels/DatagramChannel.java \
-java/nio/channels/FileChannel.java \
-java/nio/channels/FileLock.java \
-java/nio/channels/FileLockInterruptionException.java \
-java/nio/channels/GatheringByteChannel.java \
-java/nio/channels/IllegalBlockingModeException.java \
-java/nio/channels/IllegalSelectorException.java \
-java/nio/channels/InterruptibleChannel.java \
-java/nio/channels/NoConnectionPendingException.java \
-java/nio/channels/NonReadableChannelException.java \
-java/nio/channels/NonWritableChannelException.java \
-java/nio/channels/NotYetBoundException.java \
-java/nio/channels/NotYetConnectedException.java \
-java/nio/channels/OverlappingFileLockException.java \
-java/nio/channels/Pipe.java \
-java/nio/channels/ReadableByteChannel.java \
-java/nio/channels/ScatteringByteChannel.java \
-java/nio/channels/SelectableChannel.java \
-java/nio/channels/SelectionKey.java \
-java/nio/channels/Selector.java \
-java/nio/channels/ServerSocketChannel.java \
-java/nio/channels/SocketChannel.java \
-java/nio/channels/UnresolvedAddressException.java \
-java/nio/channels/UnsupportedAddressTypeException.java \
-java/nio/channels/WritableByteChannel.java \
-java/nio/channels/spi/AbstractInterruptibleChannel.java \
-java/nio/channels/spi/AbstractSelectableChannel.java \
-java/nio/channels/spi/AbstractSelectionKey.java \
-java/nio/channels/spi/AbstractSelector.java \
-java/nio/channels/spi/SelectorProvider.java \
-java/nio/charset/CharacterCodingException.java \
-java/nio/charset/Charset.java \
-java/nio/charset/CharsetDecoder.java \
-java/nio/charset/CharsetEncoder.java \
-java/nio/charset/CoderMalfunctionError.java \
-java/nio/charset/CoderResult.java \
-java/nio/charset/CodingErrorAction.java \
-java/nio/charset/IllegalCharsetNameException.java \
-java/nio/charset/MalformedInputException.java \
-java/nio/charset/UnmappableCharacterException.java \
-java/nio/charset/UnsupportedCharsetException.java \
-java/nio/charset/spi/CharsetProvider.java \
-java/security/AccessControlContext.java \
-java/security/AccessControlException.java \
-java/security/AccessController.java \
-java/security/AlgorithmParameterGenerator.java \
-java/security/AlgorithmParameterGeneratorSpi.java \
-java/security/AlgorithmParameters.java \
-java/security/AlgorithmParametersSpi.java \
-java/security/AllPermission.java \
-java/security/BasicPermission.java \
-java/security/Certificate.java \
-java/security/CodeSource.java \
-java/security/DigestException.java \
-java/security/DigestInputStream.java \
-java/security/DigestOutputStream.java \
-java/security/DomainCombiner.java \
-java/security/DummyKeyPairGenerator.java \
-java/security/DummyMessageDigest.java \
-java/security/DummySignature.java \
-java/security/GeneralSecurityException.java \
-java/security/Guard.java \
-java/security/GuardedObject.java \
-java/security/Identity.java \
-java/security/IdentityScope.java \
-java/security/InvalidAlgorithmParameterException.java \
-java/security/InvalidKeyException.java \
-java/security/InvalidParameterException.java \
-java/security/Key.java \
-java/security/KeyException.java \
-java/security/KeyFactory.java \
-java/security/KeyFactorySpi.java \
-java/security/KeyManagementException.java \
-java/security/KeyPair.java \
-java/security/KeyPairGenerator.java \
-java/security/KeyPairGeneratorSpi.java \
-java/security/KeyStore.java \
-java/security/KeyStoreException.java \
-java/security/KeyStoreSpi.java \
-java/security/MessageDigest.java \
-java/security/MessageDigestSpi.java \
-java/security/NoSuchAlgorithmException.java \
-java/security/NoSuchProviderException.java \
-java/security/Permission.java \
-java/security/PermissionCollection.java \
-java/security/Permissions.java \
-java/security/Policy.java \
-java/security/Principal.java \
-java/security/PrivateKey.java \
-java/security/PrivilegedAction.java \
-java/security/PrivilegedActionException.java \
-java/security/PrivilegedExceptionAction.java \
-java/security/ProtectionDomain.java \
-java/security/Provider.java \
-java/security/ProviderException.java \
-java/security/PublicKey.java \
-java/security/SecureClassLoader.java \
-java/security/SecureRandom.java \
-java/security/SecureRandomSpi.java \
-java/security/Security.java \
-java/security/SecurityPermission.java \
-java/security/Signature.java \
-java/security/SignatureException.java \
-java/security/SignatureSpi.java \
-java/security/SignedObject.java \
-java/security/Signer.java \
-java/security/UnrecoverableKeyException.java \
-java/security/UnresolvedPermission.java \
-java/security/acl/Acl.java \
-java/security/acl/AclEntry.java \
-java/security/acl/AclNotFoundException.java \
-java/security/acl/Group.java \
-java/security/acl/LastOwnerException.java \
-java/security/acl/NotOwnerException.java \
-java/security/acl/Owner.java \
-java/security/acl/Permission.java \
-java/security/cert/CRL.java \
-java/security/cert/CRLException.java \
-java/security/cert/CRLSelector.java \
-java/security/cert/CertPath.java \
-java/security/cert/CertPathBuilder.java \
-java/security/cert/CertPathBuilderException.java \
-java/security/cert/CertPathBuilderResult.java \
-java/security/cert/CertPathBuilderSpi.java \
-java/security/cert/CertPathParameters.java \
-java/security/cert/CertPathValidator.java \
-java/security/cert/CertPathValidatorException.java \
-java/security/cert/CertPathValidatorResult.java \
-java/security/cert/CertPathValidatorSpi.java \
-java/security/cert/CertSelector.java \
-java/security/cert/CertStore.java \
-java/security/cert/CertStoreException.java \
-java/security/cert/CertStoreParameters.java \
-java/security/cert/CertStoreSpi.java \
-java/security/cert/Certificate.java \
-java/security/cert/CertificateEncodingException.java \
-java/security/cert/CertificateException.java \
-java/security/cert/CertificateExpiredException.java \
-java/security/cert/CertificateFactory.java \
-java/security/cert/CertificateFactorySpi.java \
-java/security/cert/CertificateNotYetValidException.java \
-java/security/cert/CertificateParsingException.java \
-java/security/cert/CollectionCertStoreParameters.java \
-java/security/cert/LDAPCertStoreParameters.java \
-java/security/cert/PKIXBuilderParameters.java \
-java/security/cert/PKIXCertPathBuilderResult.java \
-java/security/cert/PKIXCertPathChecker.java \
-java/security/cert/PKIXCertPathValidatorResult.java \
-java/security/cert/PKIXParameters.java \
-java/security/cert/PolicyNode.java \
-java/security/cert/PolicyQualifierInfo.java \
-java/security/cert/TrustAnchor.java \
-java/security/cert/X509CRL.java \
-java/security/cert/X509CRLEntry.java \
-java/security/cert/X509CRLSelector.java \
-java/security/cert/X509CertSelector.java \
-java/security/cert/X509Certificate.java \
-java/security/cert/X509Extension.java \
-java/security/interfaces/DSAKey.java \
-java/security/interfaces/DSAKeyPairGenerator.java \
-java/security/interfaces/DSAParams.java \
-java/security/interfaces/DSAPrivateKey.java \
-java/security/interfaces/DSAPublicKey.java \
-java/security/interfaces/RSAKey.java \
-java/security/interfaces/RSAMultiPrimePrivateCrtKey.java \
-java/security/interfaces/RSAPrivateCrtKey.java \
-java/security/interfaces/RSAPrivateKey.java \
-java/security/interfaces/RSAPublicKey.java \
-java/security/spec/AlgorithmParameterSpec.java \
-java/security/spec/DSAParameterSpec.java \
-java/security/spec/DSAPrivateKeySpec.java \
-java/security/spec/DSAPublicKeySpec.java \
-java/security/spec/EncodedKeySpec.java \
-java/security/spec/InvalidKeySpecException.java \
-java/security/spec/InvalidParameterSpecException.java \
-java/security/spec/KeySpec.java \
-java/security/spec/PKCS8EncodedKeySpec.java \
-java/security/spec/PSSParameterSpec.java \
-java/security/spec/RSAKeyGenParameterSpec.java \
-java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java\
-java/security/spec/RSAOtherPrimeInfo.java \
-java/security/spec/RSAPrivateCrtKeySpec.java \
-java/security/spec/RSAPrivateKeySpec.java \
-java/security/spec/RSAPublicKeySpec.java \
-java/security/spec/X509EncodedKeySpec.java \
-java/sql/Array.java \
-java/sql/BatchUpdateException.java \
-java/sql/Blob.java \
-java/sql/CallableStatement.java \
-java/sql/Clob.java \
-java/sql/Connection.java \
-java/sql/DataTruncation.java \
-java/sql/DatabaseMetaData.java \
-java/sql/Date.java \
-java/sql/Driver.java \
-java/sql/DriverManager.java \
-java/sql/DriverPropertyInfo.java \
-java/sql/ParameterMetaData.java \
-java/sql/PreparedStatement.java \
-java/sql/Ref.java \
-java/sql/ResultSet.java \
-java/sql/ResultSetMetaData.java \
-java/sql/SQLData.java \
-java/sql/SQLException.java \
-java/sql/SQLInput.java \
-java/sql/SQLOutput.java \
-java/sql/SQLPermission.java \
-java/sql/SQLWarning.java \
-java/sql/Savepoint.java \
-java/sql/Statement.java \
-java/sql/Struct.java \
-java/sql/Time.java \
-java/sql/Timestamp.java \
-java/sql/Types.java \
-java/text/Annotation.java \
-java/text/AttributedCharacterIterator.java \
-java/text/AttributedString.java \
-java/text/AttributedStringIterator.java \
-java/text/BreakIterator.java \
-java/text/CharacterIterator.java \
-java/text/ChoiceFormat.java \
-java/text/CollationElementIterator.java \
-java/text/CollationKey.java \
-java/text/Collator.java \
-java/text/DateFormat.java \
-java/text/DateFormatSymbols.java \
-java/text/DecimalFormat.java \
-java/text/DecimalFormatSymbols.java \
-java/text/FieldPosition.java \
-java/text/Format.java \
-java/text/MessageFormat.java \
-java/text/NumberFormat.java \
-java/text/ParseException.java \
-java/text/ParsePosition.java \
-java/text/RuleBasedCollator.java \
-java/text/SimpleDateFormat.java \
-java/text/StringCharacterIterator.java \
-java/util/jar/Attributes.java \
-java/util/jar/JarEntry.java \
-java/util/jar/JarException.java \
-java/util/jar/JarFile.java \
-java/util/jar/JarInputStream.java \
-java/util/jar/JarOutputStream.java \
-java/util/jar/Manifest.java \
-java/util/zip/Adler32.java \
-java/util/zip/CRC32.java \
-java/util/zip/CheckedInputStream.java \
-java/util/zip/CheckedOutputStream.java \
-java/util/zip/Checksum.java \
-java/util/zip/DataFormatException.java \
-java/util/zip/Deflater.java \
-java/util/zip/DeflaterOutputStream.java \
-java/util/zip/GZIPInputStream.java \
-java/util/zip/GZIPOutputStream.java \
-java/util/zip/Inflater.java \
-java/util/zip/InflaterInputStream.java \
-java/util/zip/ZipConstants.java \
-java/util/zip/ZipEntry.java \
-java/util/zip/ZipException.java \
-java/util/zip/ZipFile.java \
-java/util/zip/ZipInputStream.java \
-java/util/zip/ZipOutputStream.java \
-$(rmi_java_source_files) \
-$(awt_java_source_files) \
-$(convert_source_files) \
-$(javax_source_files) \
-$(org_source_files)
-
-
-java_source_files = $(special_java_source_files) $(ordinary_java_source_files)
-
-## Math library: C, not C++
-math_c_source_files = \
- java/lang/dtoa.c java/lang/k_rem_pio2.c java/lang/s_tan.c \
- java/lang/e_acos.c java/lang/k_sin.c java/lang/strtod.c \
- java/lang/e_asin.c java/lang/k_tan.c java/lang/w_acos.c \
- java/lang/e_atan2.c java/lang/mprec.c java/lang/w_asin.c \
- java/lang/e_exp.c java/lang/s_atan.c java/lang/w_atan2.c \
- java/lang/e_fmod.c java/lang/s_ceil.c java/lang/w_exp.c \
- java/lang/e_log.c java/lang/s_copysign.c java/lang/w_fmod.c \
- java/lang/e_pow.c java/lang/s_cos.c java/lang/w_log.c \
- java/lang/e_rem_pio2.c java/lang/s_fabs.c java/lang/w_pow.c \
- java/lang/e_remainder.c java/lang/s_floor.c java/lang/w_remainder.c \
- java/lang/e_scalb.c java/lang/s_rint.c java/lang/w_sqrt.c \
- java/lang/e_sqrt.c java/lang/s_scalbn.c java/lang/sf_rint.c \
- java/lang/k_cos.c java/lang/s_sin.c java/lang/sf_fabs.c
-
-
## This lists all the C++ source files in subdirectories.
nat_source_files = \
gnu/classpath/natSystemProperties.cc \
@@ -4006,16 +902,6 @@ src.zip:
## Many of the above circumlocutions are because ZIP will most likely
## be a relative path to fastjar.
$(ZIP) -cfM@ $$here/src.zip
-## Now include the files from external/.
- for dir in sax w3c_dom; do \
- (cd $(srcdir)/external/$$dir; \
- find org -type f -name '*.java' -print | while read file; do \
- echo "x-C" | sed -e 's/^.//'; \
- echo $(srcdir)/external/$$dir; \
- echo $$file; \
- done) | \
- $(ZIP) -ufM0E@ src.zip; \
- done
## We use a variable for this in case the user wants to override it.
sourcesdir = $(jardir)
@@ -4031,13 +917,33 @@ install-src.zip: src.zip
##
## This is an evil hack to work around an automake limitation. We
-## need to ensure that all CNI headers are built, not just the ones used
-## internally by libgcj. We can't make the .o files depend on nat_headers,
-## because in that case we'll force a complete rebuild of
-## the C++ code whenever any .java file is touched.
-## Also force all the class files to build first. This makes them build in
-## the right order to improve performance.
-all-recursive: classes.stamp $(nat_headers) $(xlib_nat_headers)
+## need to ensure that all CNI headers are built, not just the ones
+## used internally by libgcj. We can't make the .o files depend on
+## nat_headers, because in that case we'll force a complete rebuild of
+## the C++ code whenever any .java file is touched. So instead we
+## have a dummy rule which is only used once, namely the first time a
+## build is done. On subsequent builds, the dependency tracking for
+## the .cc compilations will have picked up the .h files, and these
+## will be built directly as needed.
+
+headers.stamp:
+## Note that we don't use a real dependency here, since we don't want
+## to rebuild all the headers here when the header list changes. If
+## we did rebuild here, then any addition of a .java file would cause
+## a large number of recompilations.
+ $(MAKE) create-headers
+ @echo > headers.stamp
+
+headers_to_make = $(nat_headers)
+if XLIB_AWT
+headers_to_make += $(xlib_nat_headers)
+endif
+
+create-headers: $(headers_to_make)
+
+.PHONY: create-headers
+
+$(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
## ################################################################
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index 2979f0beff1..23be822d4f4 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004 Free Software Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -58,11 +58,6 @@ target_triplet = @target@
@USING_POSIX_THREADS_TRUE@am__append_11 = posix-threads.cc
@USING_WIN32_THREADS_TRUE@am__append_12 = win32-threads.cc
@USING_NO_THREADS_TRUE@am__append_13 = no-threads.cc
-
-# Gtk/Cairo JNI sources.
-@GTK_CAIRO_TRUE@am__append_14 = jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
-@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@noinst_PROGRAMS = \
-@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gen-from-JIS$(EXEEXT)
DIST_COMMON = README $(am__configure_deps) $(srcdir)/../compile \
$(srcdir)/../config.guess $(srcdir)/../config.sub \
$(srcdir)/../depcomp $(srcdir)/../install-sh \
@@ -70,20 +65,20 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/../compile \
$(srcdir)/../mkinstalldirs $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/libgcj-test.spec.in \
$(srcdir)/libgcj.pc.in $(srcdir)/libgcj.spec.in \
- $(top_srcdir)/configure \
- $(top_srcdir)/gnu/classpath/Configuration.java.in COPYING \
- ChangeLog NEWS THANKS
+ $(srcdir)/sources.am $(top_srcdir)/configure COPYING ChangeLog \
+ NEWS THANKS
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@noinst_PROGRAMS = \
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gen-from-JIS$(EXEEXT)
+@XLIB_AWT_TRUE@am__append_14 = $(xlib_nat_headers)
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
- $(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
$(top_srcdir)/../config/iconv.m4 \
$(top_srcdir)/../config/lcmessage.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
$(top_srcdir)/../config/lib-link.m4 \
- $(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
+ $(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
@@ -94,9 +89,9 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
CONFIG_HEADER = $(top_builddir)/include/config.h \
$(top_builddir)/gcj/libgcj-config.h
CONFIG_CLEAN_FILES = libgcj.pc libgcj.spec libgcj-test.spec \
- gnu/classpath/Configuration.java java/io/natFile.cc \
- java/lang/ConcreteProcess.java java/lang/natConcreteProcess.cc \
- java/net/natInetAddress.cc java/net/natVMNetworkInterface.cc \
+ java/io/natFile.cc java/lang/ConcreteProcess.java \
+ java/lang/natConcreteProcess.cc java/net/natInetAddress.cc \
+ java/net/natVMNetworkInterface.cc \
gnu/java/net/natPlainSocketImpl.cc \
gnu/java/net/natPlainDatagramSocketImpl.cc \
gnu/java/nio/natPipeImpl.cc gnu/java/nio/natSelectorImpl.cc \
@@ -140,100 +135,75 @@ am_lib_gnu_awt_xlib_la_OBJECTS = $(am__objects_1)
lib_gnu_awt_xlib_la_OBJECTS = $(am_lib_gnu_awt_xlib_la_OBJECTS)
@XLIB_AWT_TRUE@am_lib_gnu_awt_xlib_la_rpath = -rpath $(toolexeclibdir)
am__DEPENDENCIES_2 =
-am__lib_gnu_java_awt_peer_gtk_la_SOURCES_DIST = \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \
- jni/gtk-peer/gthread-jni.c jni/gtk-peer/gtk_jawt.c \
- jni/classpath/native_state.c jni/gtk-peer/gthread-jni.h \
- jni/gtk-peer/gtkpeer.h jni/classpath/native_state.h \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
-@GTK_CAIRO_TRUE@am__objects_2 = jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.lo
-am_lib_gnu_java_awt_peer_gtk_la_OBJECTS = jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo \
- jni/classpath/lib_gnu_java_awt_peer_gtk_la-native_state.lo \
- $(am__objects_2)
+am_lib_gnu_java_awt_peer_gtk_la_OBJECTS =
lib_gnu_java_awt_peer_gtk_la_OBJECTS = \
$(am_lib_gnu_java_awt_peer_gtk_la_OBJECTS)
@GTK_AWT_TRUE@am_lib_gnu_java_awt_peer_gtk_la_rpath = -rpath \
@GTK_AWT_TRUE@ $(toolexeclibdir)
-am__DEPENDENCIES_3 = $(filter-out $(all_xlib_lo_files), \
- $(all_java_lo_files))
-am__DEPENDENCIES_4 = gnu/regexp/MessagesBundle.properties.lo \
- gnu/regexp/MessagesBundle_fr.properties.lo \
- org/ietf/jgss/MessagesBundle.properties.lo
-am__DEPENDENCIES_5 = $(am__DEPENDENCIES_4)
+am__DEPENDENCIES_3 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \
+ gnu/classpath/debug.lo gnu/gcj.lo gnu/gcj/convert.lo \
+ gnu/gcj/io.lo gnu/gcj/runtime.lo gnu/gcj/util.lo \
+ gnu/java/awt.lo gnu/java/awt/color.lo gnu/java/awt/image.lo \
+ gnu/java/awt/peer.lo gnu/java/io.lo gnu/java/lang.lo \
+ gnu/java/lang/reflect.lo gnu/java/locale.lo gnu/java/math.lo \
+ gnu/java/net.lo gnu/java/net/protocol/file.lo \
+ gnu/java/net/protocol/ftp.lo gnu/java/net/protocol/http.lo \
+ gnu/java/net/protocol/http/event.lo \
+ gnu/java/net/protocol/https.lo gnu/java/net/protocol/jar.lo \
+ gnu/java/nio.lo gnu/java/nio/channels.lo \
+ gnu/java/nio/charset.lo gnu/java/rmi.lo gnu/java/rmi/dgc.lo \
+ gnu/java/rmi/registry.lo gnu/java/rmi/server.lo \
+ gnu/java/security.lo gnu/java/security/action.lo \
+ gnu/java/security/ber.lo gnu/java/security/der.lo \
+ gnu/java/security/pkcs.lo gnu/java/security/provider.lo \
+ gnu/java/security/util.lo gnu/java/security/x509.lo \
+ gnu/java/security/x509/ext.lo gnu/java/text.lo \
+ gnu/java/util.lo gnu/java/util/prefs.lo \
+ gnu/javax/swing/text/html/parser.lo \
+ gnu/javax/swing/text/html/parser/models.lo \
+ gnu/javax/swing/text/html/parser/support.lo \
+ gnu/javax/swing/text/html/parser/support/low.lo gnu/regexp.lo \
+ java/applet.lo java/awt.lo java/awt/color.lo \
+ java/awt/datatransfer.lo java/awt/dnd.lo java/awt/dnd/peer.lo \
+ java/awt/event.lo java/awt/font.lo java/awt/geom.lo \
+ java/awt/im.lo java/awt/im/spi.lo java/awt/image.lo \
+ java/awt/image/renderable.lo java/awt/peer.lo \
+ java/awt/print.lo java/beans.lo java/beans/beancontext.lo \
+ java/io.lo java/lang.lo java/lang/annotation.lo \
+ java/lang/ref.lo java/lang/reflect.lo java/math.lo java/net.lo \
+ java/nio.lo java/nio/channels.lo java/nio/channels/spi.lo \
+ java/nio/charset.lo java/nio/charset/spi.lo java/rmi.lo \
+ java/rmi/activation.lo java/rmi/dgc.lo java/rmi/registry.lo \
+ java/rmi/server.lo java/security.lo java/security/acl.lo \
+ java/security/cert.lo java/security/interfaces.lo \
+ java/security/spec.lo java/sql.lo java/text.lo java/util.lo \
+ java/util/jar.lo java/util/logging.lo java/util/prefs.lo \
+ java/util/regex.lo java/util/zip.lo javax/accessibility.lo \
+ javax/crypto.lo javax/crypto/interfaces.lo \
+ javax/crypto/spec.lo javax/naming.lo javax/naming/directory.lo \
+ javax/naming/event.lo javax/naming/ldap.lo javax/naming/spi.lo \
+ javax/net.lo javax/net/ssl.lo javax/print.lo \
+ javax/print/attribute.lo javax/print/attribute/standard.lo \
+ javax/print/event.lo javax/security/auth.lo \
+ javax/security/auth/callback.lo javax/security/auth/login.lo \
+ javax/security/auth/spi.lo javax/security/auth/x500.lo \
+ javax/security/cert.lo javax/security/sasl.lo javax/sql.lo \
+ javax/swing.lo javax/swing/border.lo \
+ javax/swing/colorchooser.lo javax/swing/event.lo \
+ javax/swing/filechooser.lo javax/swing/plaf.lo \
+ javax/swing/plaf/basic.lo javax/swing/plaf/metal.lo \
+ javax/swing/table.lo javax/swing/text.lo \
+ javax/swing/text/html.lo javax/swing/text/html/parser.lo \
+ javax/swing/text/rtf.lo javax/swing/tree.lo \
+ javax/swing/undo.lo javax/transaction.lo \
+ javax/transaction/xa.lo org/ietf/jgss.lo
+am__DEPENDENCIES_4 = gnu-java-beans.lo gnu-xml.lo javax-imageio.lo \
+ javax-xml.lo org-w3c.lo org-xml.lo
+am__DEPENDENCIES_5 = $(patsubst \
+ classpath/resource/%,%,$(property_files:.properties=.properties.lo))
am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc \
stacktrace.cc link.cc defineclass.cc interpret.cc verify.cc \
+ java/lang/Class.java java/lang/Object.java \
gnu/classpath/natSystemProperties.cc gnu/gcj/natCore.cc \
gnu/gcj/convert/JIS0208_to_Unicode.cc \
gnu/gcj/convert/JIS0212_to_Unicode.cc \
@@ -272,23 +242,10 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc \
java/nio/natDirectByteBufferImpl.cc java/text/natCollator.cc \
java/util/natResourceBundle.cc java/util/natVMTimeZone.cc \
java/util/logging/natLogger.cc java/util/zip/natDeflater.cc \
- java/util/zip/natInflater.cc java/lang/dtoa.c \
- java/lang/k_rem_pio2.c java/lang/s_tan.c java/lang/e_acos.c \
- java/lang/k_sin.c java/lang/strtod.c java/lang/e_asin.c \
- java/lang/k_tan.c java/lang/w_acos.c java/lang/e_atan2.c \
- java/lang/mprec.c java/lang/w_asin.c java/lang/e_exp.c \
- java/lang/s_atan.c java/lang/w_atan2.c java/lang/e_fmod.c \
- java/lang/s_ceil.c java/lang/w_exp.c java/lang/e_log.c \
- java/lang/s_copysign.c java/lang/w_fmod.c java/lang/e_pow.c \
- java/lang/s_cos.c java/lang/w_log.c java/lang/e_rem_pio2.c \
- java/lang/s_fabs.c java/lang/w_pow.c java/lang/e_remainder.c \
- java/lang/s_floor.c java/lang/w_remainder.c \
- java/lang/e_scalb.c java/lang/s_rint.c java/lang/w_sqrt.c \
- java/lang/e_sqrt.c java/lang/s_scalbn.c java/lang/sf_rint.c \
- java/lang/k_cos.c java/lang/s_sin.c java/lang/sf_fabs.c \
- boehm.cc nogc.cc sysdep/dwarf2-backtrace.cc posix.cc win32.cc \
- darwin.cc posix-threads.cc win32-threads.cc no-threads.cc
-am__objects_3 = gnu/classpath/natSystemProperties.lo \
+ java/util/zip/natInflater.cc boehm.cc nogc.cc \
+ sysdep/dwarf2-backtrace.cc posix.cc win32.cc darwin.cc \
+ posix-threads.cc win32-threads.cc no-threads.cc
+am__objects_2 = gnu/classpath/natSystemProperties.lo \
gnu/gcj/natCore.lo gnu/gcj/convert/JIS0208_to_Unicode.lo \
gnu/gcj/convert/JIS0212_to_Unicode.lo \
gnu/gcj/convert/Unicode_to_JIS.lo gnu/gcj/convert/natIconv.lo \
@@ -327,35 +284,21 @@ am__objects_3 = gnu/classpath/natSystemProperties.lo \
java/util/natResourceBundle.lo java/util/natVMTimeZone.lo \
java/util/logging/natLogger.lo java/util/zip/natDeflater.lo \
java/util/zip/natInflater.lo
-am__objects_4 = java/lang/dtoa.lo java/lang/k_rem_pio2.lo \
- java/lang/s_tan.lo java/lang/e_acos.lo java/lang/k_sin.lo \
- java/lang/strtod.lo java/lang/e_asin.lo java/lang/k_tan.lo \
- java/lang/w_acos.lo java/lang/e_atan2.lo java/lang/mprec.lo \
- java/lang/w_asin.lo java/lang/e_exp.lo java/lang/s_atan.lo \
- java/lang/w_atan2.lo java/lang/e_fmod.lo java/lang/s_ceil.lo \
- java/lang/w_exp.lo java/lang/e_log.lo java/lang/s_copysign.lo \
- java/lang/w_fmod.lo java/lang/e_pow.lo java/lang/s_cos.lo \
- java/lang/w_log.lo java/lang/e_rem_pio2.lo java/lang/s_fabs.lo \
- java/lang/w_pow.lo java/lang/e_remainder.lo \
- java/lang/s_floor.lo java/lang/w_remainder.lo \
- java/lang/e_scalb.lo java/lang/s_rint.lo java/lang/w_sqrt.lo \
- java/lang/e_sqrt.lo java/lang/s_scalbn.lo java/lang/sf_rint.lo \
- java/lang/k_cos.lo java/lang/s_sin.lo java/lang/sf_fabs.lo
-@USING_BOEHMGC_TRUE@am__objects_5 = boehm.lo
-@USING_NOGC_TRUE@am__objects_6 = nogc.lo
-@SUPPLY_BACKTRACE_TRUE@am__objects_7 = sysdep/dwarf2-backtrace.lo
-@USING_POSIX_PLATFORM_TRUE@am__objects_8 = posix.lo
-@USING_WIN32_PLATFORM_TRUE@am__objects_9 = win32.lo
-@USING_DARWIN_CRT_TRUE@am__objects_10 = darwin.lo
-@USING_POSIX_THREADS_TRUE@am__objects_11 = posix-threads.lo
-@USING_WIN32_THREADS_TRUE@am__objects_12 = win32-threads.lo
-@USING_NO_THREADS_TRUE@am__objects_13 = no-threads.lo
+@USING_BOEHMGC_TRUE@am__objects_3 = boehm.lo
+@USING_NOGC_TRUE@am__objects_4 = nogc.lo
+@SUPPLY_BACKTRACE_TRUE@am__objects_5 = sysdep/dwarf2-backtrace.lo
+@USING_POSIX_PLATFORM_TRUE@am__objects_6 = posix.lo
+@USING_WIN32_PLATFORM_TRUE@am__objects_7 = win32.lo
+@USING_DARWIN_CRT_TRUE@am__objects_8 = darwin.lo
+@USING_POSIX_THREADS_TRUE@am__objects_9 = posix-threads.lo
+@USING_WIN32_THREADS_TRUE@am__objects_10 = win32-threads.lo
+@USING_NO_THREADS_TRUE@am__objects_11 = no-threads.lo
am_libgcj_la_OBJECTS = prims.lo jni.lo exception.lo stacktrace.lo \
- link.lo defineclass.lo interpret.lo verify.lo $(am__objects_3) \
- $(am__objects_4) $(am__objects_5) $(am__objects_6) \
- $(am__objects_7) $(am__objects_8) $(am__objects_9) \
- $(am__objects_10) $(am__objects_11) $(am__objects_12) \
- $(am__objects_13)
+ link.lo defineclass.lo interpret.lo verify.lo \
+ java/lang/Class.lo java/lang/Object.lo $(am__objects_2) \
+ $(am__objects_3) $(am__objects_4) $(am__objects_5) \
+ $(am__objects_6) $(am__objects_7) $(am__objects_8) \
+ $(am__objects_9) $(am__objects_10) $(am__objects_11)
libgcj_la_OBJECTS = $(am_libgcj_la_OBJECTS)
libgcjawt_la_DEPENDENCIES = lib-gnu-java-awt-peer-gtk.la
am_libgcjawt_la_OBJECTS = libgcjawt_la-jawt.lo
@@ -413,7 +356,7 @@ SOURCES = $(lib_gnu_awt_xlib_la_SOURCES) \
$(gcj_dbtool_SOURCES) $(gen_from_JIS_SOURCES) $(gij_SOURCES) \
$(grmic_SOURCES) $(grmiregistry_SOURCES) $(jv_convert_SOURCES)
DIST_SOURCES = $(lib_gnu_awt_xlib_la_SOURCES) \
- $(am__lib_gnu_java_awt_peer_gtk_la_SOURCES_DIST) \
+ $(lib_gnu_java_awt_peer_gtk_la_SOURCES) \
$(am__libgcj_la_SOURCES_DIST) $(libgcjawt_la_SOURCES) \
$(libgij_la_SOURCES) $(gcj_dbtool_SOURCES) \
$(am__gen_from_JIS_SOURCES_DIST) $(gij_SOURCES) \
@@ -432,7 +375,7 @@ DATA = $(dbexec_DATA) $(jar_DATA) $(pkgconfig_DATA) \
$(toolexecmainlib_DATA)
ETAGS = etags
CTAGS = ctags
-DIST_SUBDIRS = @DIRLTDL@ gcj include external testsuite
+DIST_SUBDIRS = @DIRLTDL@ gcj include classpath testsuite
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -669,7 +612,7 @@ ACLOCAL_AMFLAGS = -I . -I ../config
# May be used by various substitution variables.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
-SUBDIRS = $(DIRLTDL) gcj include external $(am__append_1)
+SUBDIRS = $(DIRLTDL) gcj include classpath $(am__append_1)
# write_entries_to_file - writes each entry in a list
# to the specified file. Each entry is written individually
@@ -700,7 +643,6 @@ bin_SCRIPTS = addr2name.awk
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
-JAVAC = $(GCJ_WITH_FLAGS) -C
WARNINGS = -Wextra -Wall
AM_CXXFLAGS = \
-fno-rtti \
@@ -733,37 +675,14 @@ AM_CFLAGS = @LIBGCJ_CFLAGS@ $(am__append_4)
PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
JCFLAGS = -g
JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
-AM_CPPFLAGS = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \
+AM_CPPFLAGS = -I$(top_srcdir) \
+ -Iinclude -I$(top_srcdir)/include \
+ -I$(top_srcdir)/classpath/include \
+ -I$(top_srcdir)/classpath/native/fdlibm \
$(GCINCS) $(THREADINCS) $(INCLTDL) \
$(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
-BOOTCLASSPATH = $(here)'$(CLASSPATH_SEPARATOR)'$(srcdir)'$(CLASSPATH_SEPARATOR)'$(srcdir)/external/w3c_dom'$(CLASSPATH_SEPARATOR)'$(srcdir)/external/sax
-
-# Files for which we build .lo files
-all_native_compiled_source_files = \
- $(java_source_files) \
- $(built_java_source_files) \
- $(xlib_java_source_files)
-
-
-# Files for which we build .class files
-# It *must* begin with $(all_native_compiled_source_files)
-all_java_source_files = \
- $(all_native_compiled_source_files) \
- $(gtk_awt_peer_source_files) \
- $(gnu_xml_source_files) \
- $(javax_imageio_source_files) \
- $(javax_xml_source_files) \
- $(gnu_java_beans_source_files) \
- gnu/gcj/tools/gcj_dbtool/Main.java
-
-EXTRA_DIST = $(all_java_source_files)
-all_native_compiled_dirs = $(sort $(patsubst %/, %, $(dir $(all_native_compiled_source_files))))
-all_java_dirs = $(sort $(patsubst %/, %, $(dir $(all_java_source_files))))
-all_java_lo_files = $(all_native_compiled_dirs:=.lo)
-all_java_deps_files = $(all_java_dirs:=.deps)
-all_java_stamp_files = $(all_java_dirs:=.stamp)
-all_java_filelist_files = $(all_java_dirs:=.list)
+BOOTCLASSPATH = $(here)/classpath/lib
# In the future these may be defined manually, if we decide to split libgcj.so
# into multiple shared libraries. For now, everything but xlib goes into
@@ -780,11 +699,11 @@ libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc link.cc \
- defineclass.cc interpret.cc verify.cc $(nat_source_files) \
- $(math_c_source_files) $(am__append_5) $(am__append_6) \
- $(am__append_7) $(am__append_8) $(am__append_9) \
- $(am__append_10) $(am__append_11) $(am__append_12) \
- $(am__append_13)
+ defineclass.cc interpret.cc verify.cc java/lang/Class.java \
+ java/lang/Object.java $(nat_source_files) $(am__append_5) \
+ $(am__append_6) $(am__append_7) $(am__append_8) \
+ $(am__append_9) $(am__append_10) $(am__append_11) \
+ $(am__append_12) $(am__append_13)
nat_files = $(nat_source_files:.cc=.lo)
xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
@@ -795,122 +714,35 @@ libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version`
libgcj_la_LIBADD = \
- $(all_libgcj_lo_files) \
- gnu-xml.lo javax-imageio.lo \
- javax-xml.lo gnu-java-beans.lo \
- external/sax/libsax-gcj.la \
- external/w3c_dom/libw3c-gcj.la \
- $(LIBFFI) $(ZLIBS) $(GCLIBS) $(propertyo_files)
+ classpath/native/fdlibm/libfdlibm.la \
+ $(all_packages_source_files:.list=.lo) \
+ $(bc_objects) \
+ $(propertyo_files) \
+ $(LIBFFI) $(ZLIBS) $(GCLIBS)
libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
- java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \
+ $(all_packages_source_files:.list=.lo) \
$(LIBLTDL) $(libgcj_la_LIBADD)
libgcj_la_LINK = $(LIBLINK)
-lib_gnu_java_awt_peer_gtk_la_SOURCES = \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \
- jni/gtk-peer/gthread-jni.c jni/gtk-peer/gtk_jawt.c \
- jni/classpath/native_state.c jni/gtk-peer/gthread-jni.h \
- jni/gtk-peer/gtkpeer.h jni/classpath/native_state.h \
- $(am__append_14)
-gtk_awt_peer_source_files = \
-gnu/java/awt/peer/gtk/GdkTextLayout.java \
-gnu/java/awt/peer/gtk/GdkFontMetrics.java \
-gnu/java/awt/peer/gtk/GdkFontPeer.java \
-gnu/java/awt/peer/gtk/GdkGlyphVector.java \
-gnu/java/awt/peer/gtk/GdkGraphics.java \
-gnu/java/awt/peer/gtk/GdkGraphics2D.java \
-gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.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/GdkScreenGraphicsDevice.java \
-gnu/java/awt/peer/gtk/GtkButtonPeer.java \
-gnu/java/awt/peer/gtk/GtkCanvasPeer.java \
-gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.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/GtkClipboard.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/GtkEmbeddedWindowPeer.java \
-gnu/java/awt/peer/gtk/GtkFileDialogPeer.java \
-gnu/java/awt/peer/gtk/GtkFramePeer.java \
-gnu/java/awt/peer/gtk/GtkGenericPeer.java \
-gnu/java/awt/peer/gtk/GtkImage.java \
-gnu/java/awt/peer/gtk/GtkImagePainter.java \
-gnu/java/awt/peer/gtk/GtkLabelPeer.java \
-gnu/java/awt/peer/gtk/GtkListPeer.java \
-gnu/java/awt/peer/gtk/GtkMenuBarPeer.java \
-gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java \
-gnu/java/awt/peer/gtk/GtkMenuItemPeer.java \
-gnu/java/awt/peer/gtk/GtkMenuPeer.java \
-gnu/java/awt/peer/gtk/GtkOffScreenImage.java \
-gnu/java/awt/peer/gtk/GtkPanelPeer.java \
-gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java \
-gnu/java/awt/peer/gtk/GtkScrollPanePeer.java \
-gnu/java/awt/peer/gtk/GtkScrollbarPeer.java \
-gnu/java/awt/peer/gtk/GtkTextAreaPeer.java \
-gnu/java/awt/peer/gtk/GtkTextComponentPeer.java \
-gnu/java/awt/peer/gtk/GtkTextFieldPeer.java \
-gnu/java/awt/peer/gtk/GtkToolkit.java \
-gnu/java/awt/peer/gtk/GtkVolatileImage.java \
-gnu/java/awt/peer/gtk/GtkWindowPeer.java \
-gnu/java/awt/peer/gtk/GThreadMutex.java \
-gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java
-
-gtk_jni_headers = $(patsubst %.java,jniinclude/%.h,$(subst /,_,$(gtk_awt_peer_source_files)))
-lib_gnu_java_awt_peer_gtk_la_CFLAGS = \
- -Ijniinclude -I$(srcdir)/jni/classpath \
- -I$(srcdir)/jni/gtk-peer $(PEDANTIC_CFLAGS) $(GTK_CFLAGS) $(LIBART_CFLAGS) \
- $(X_CFLAGS) $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS)
-
-lib_gnu_java_awt_peer_gtk_la_GCJFLAGS = $(AM_GCJFLAGS) -fjni
-lib_gnu_java_awt_peer_gtk_la_LIBADD = gtk-awt-peer.lo $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS)
-lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = gtk-awt-peer.lo $(gtk_jni_headers) libgcj-$(gcc_version).jar libgcj.la libgcj.spec
+lib_gnu_java_awt_peer_gtk_la_SOURCES =
+lib_gnu_java_awt_peer_gtk_la_LIBADD = \
+ gnu-java-awt-peer-gtk.lo \
+ classpath/native/jni/gtk-peer/libgtkpeer.la \
+ $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS)
+
+lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = gnu-java-awt-peer-gtk.lo \
+ classpath/native/jni/gtk-peer/libgtkpeer.la \
+ libgcj-$(gcc_version).jar libgcj.la libgcj.spec
+
lib_gnu_java_awt_peer_gtk_la_LDFLAGS = \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
lib_gnu_java_awt_peer_gtk_la_LINK = $(LIBLINK)
libgcjawt_la_SOURCES = jawt.c
-libgcjawt_la_CFLAGS = -I$(srcdir)/jni/classpath $(PEDANTIC_CFLAGS) $(X_CFLAGS)
+libgcjawt_la_CFLAGS = -I$(srcdir)/classpath/native/jni/classpath \
+ $(PEDANTIC_CFLAGS) $(X_CFLAGS)
+
libgcjawt_la_LIBADD = -L$(here)/.libs lib-gnu-java-awt-peer-gtk.la
libgcjawt_la_LDFLAGS = \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
@@ -935,2090 +767,84 @@ lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
property_files = \
-gnu/regexp/MessagesBundle.properties \
-gnu/regexp/MessagesBundle_fr.properties \
-org/ietf/jgss/MessagesBundle.properties
-
-propertyo_files = $(property_files:.properties=.properties.lo)
-CLEANFILES = libgcj-$(gcc_version).jar classes.stamp $(all_java_stamp_files) \
+classpath/resource/org/ietf/jgss/MessagesBundle.properties \
+classpath/resource/java/util/iso4217.properties \
+classpath/resource/gnu/java/awt/peer/gtk/font.properties \
+classpath/resource/gnu/regexp/MessagesBundle_it.properties \
+classpath/resource/gnu/regexp/MessagesBundle_fr.properties \
+classpath/resource/gnu/regexp/MessagesBundle.properties
+
+propertyo_files = $(patsubst classpath/resource/%,%,$(property_files:.properties=.properties.lo))
+CLEANFILES = libgcj-$(gcc_version).jar \
$(all_java_deps_files) $(all_java_filelist_files)
-DISTCLEANFILES = Makefile.deps native.dirs bytecompile.dirs
-SUFFIXES = .class .java .h .properties
-ordinary_nat_headers = \
- $(ordinary_java_source_files:.java=.h) \
- $(built_java_source_files:.java=.h)
-
-inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
- java/io/ObjectInputStream$$GetField.h \
- java/nio/DirectByteBufferImpl$$ReadWrite.h \
- java/nio/channels/Pipe$$SinkChannel.h \
- java/nio/channels/Pipe$$SourceChannel.h \
- java/lang/reflect/Proxy$$ProxyData.h \
- java/lang/reflect/Proxy$$ProxyType.h \
- gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
- gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
- gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
- gnu/java/nio/PipeImpl$$SourceChannelImpl.h \
- $(PLATFORM_INNER_NAT_HDRS)
-
-nat_headers = $(ordinary_nat_headers) $(inner_nat_headers) gnu/gcj/tools/gcj_dbtool/Main.h
-nat_headers_install = $(ordinary_nat_headers)
-xlib_nat_headers = $(xlib_java_source_files:.java=.h)
-extra_headers = java/lang/Object.h java/lang/Class.h
-NM = nm
-@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@gen_from_JIS_SOURCES = \
-@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gnu/gcj/convert/gen-from-JIS.c \
-@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gnu/gcj/convert/make-trie.c
-
-@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@gen_from_JIS_DEPENDENCIES = \
-@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gnu/gcj/convert/JIS0201.h \
-@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gnu/gcj/convert/JIS0208.h \
-@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gnu/gcj/convert/JIS0212.h
-
-jv_convert_SOURCES =
-jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
- -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
-
-jv_convert_LINK = $(GCJLINK)
-jv_convert_LDADD = -L$(here)/.libs libgcj.la
-jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
-gcj_dbtool_SOURCES = gnu/gcj/tools/gcj_dbtool/Main.java \
- gnu/gcj/tools/gcj_dbtool/natMain.cc
-
-gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
- -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
-
-gcj_dbtool_LINK = $(GCJLINK)
-gcj_dbtool_LDADD = -L$(here)/.libs libgcj.la
-gcj_dbtool_DEPENDENCIES = libgcj.la libgcj.spec
-gij_SOURCES =
-gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
-gij_LINK = $(GCJLINK)
-gij_LDADD = -L$(here)/.libs libgij.la
-gij_DEPENDENCIES = libgij.la
-grmic_SOURCES =
-grmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
- -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
+DISTCLEANFILES = native.dirs
+SUFFIXES = .class .java .h .properties .list
+gnu_awt_source_files = \
+gnu/awt/LightweightRedirector.java
-grmic_LINK = $(GCJLINK)
-grmic_LDADD = -L$(here)/.libs libgcj.la
-grmic_DEPENDENCIES = libgcj.la libgcj.spec
-grmiregistry_SOURCES =
-grmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
- -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
+gnu_awt_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_awt_source_files)))
+gnu_awt_j2d_source_files = \
+gnu/awt/j2d/AbstractGraphicsState.java \
+gnu/awt/j2d/DirectRasterGraphics.java \
+gnu/awt/j2d/Graphics2DImpl.java \
+gnu/awt/j2d/IntegerGraphicsState.java \
+gnu/awt/j2d/MappedRaster.java
+
+gnu_awt_j2d_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_awt_j2d_source_files)))
+gnu_classpath_source_files = \
+classpath/gnu/classpath/Configuration.java \
+classpath/gnu/classpath/RawData.java \
+classpath/gnu/classpath/RawData32.java \
+classpath/gnu/classpath/RawData64.java \
+classpath/gnu/classpath/ServiceFactory.java \
+classpath/gnu/classpath/ServiceProviderLoadingAction.java \
+gnu/classpath/SystemProperties.java
+
+gnu_classpath_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_classpath_source_files))))
+gnu_classpath_debug_source_files = \
+classpath/gnu/classpath/debug/Component.java \
+classpath/gnu/classpath/debug/PreciseFilter.java \
+classpath/gnu/classpath/debug/SystemLogger.java
+
+gnu_classpath_debug_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_classpath_debug_source_files)))
+gnu_gcj_source_files = \
+gnu/gcj/Core.java \
+gnu/gcj/RawData.java \
+gnu/gcj/RawDataManaged.java
-grmiregistry_LINK = $(GCJLINK)
-grmiregistry_LDADD = -L$(here)/.libs libgcj.la
-grmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
-convert_source_files = \
+gnu_gcj_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_gcj_source_files)))
+gnu_gcj_convert_source_files = \
gnu/gcj/convert/BytesToUnicode.java \
gnu/gcj/convert/Convert.java \
+gnu/gcj/convert/IOConverter.java \
gnu/gcj/convert/Input_8859_1.java \
gnu/gcj/convert/Input_ASCII.java \
gnu/gcj/convert/Input_EUCJIS.java \
gnu/gcj/convert/Input_JavaSrc.java \
gnu/gcj/convert/Input_SJIS.java \
+gnu/gcj/convert/Input_UTF8.java \
gnu/gcj/convert/Input_UnicodeBig.java \
gnu/gcj/convert/Input_UnicodeLittle.java \
-gnu/gcj/convert/Input_UTF8.java \
gnu/gcj/convert/Input_iconv.java \
-gnu/gcj/convert/IOConverter.java \
gnu/gcj/convert/Output_8859_1.java \
gnu/gcj/convert/Output_ASCII.java \
gnu/gcj/convert/Output_EUCJIS.java \
gnu/gcj/convert/Output_JavaSrc.java \
gnu/gcj/convert/Output_SJIS.java \
-gnu/gcj/convert/Output_UnicodeLittleUnmarked.java \
gnu/gcj/convert/Output_UTF8.java \
+gnu/gcj/convert/Output_UnicodeLittleUnmarked.java \
gnu/gcj/convert/Output_iconv.java \
gnu/gcj/convert/UnicodeToBytes.java
-special_java_source_files = java/lang/Class.java java/lang/Object.java
-gnu_java_beans_source_files = \
-gnu/java/beans/decoder/AbstractContext.java \
-gnu/java/beans/decoder/AbstractCreatableObjectContext.java \
-gnu/java/beans/decoder/AbstractElementHandler.java \
-gnu/java/beans/decoder/AbstractObjectContext.java \
-gnu/java/beans/decoder/ArrayContext.java \
-gnu/java/beans/decoder/ArrayHandler.java \
-gnu/java/beans/decoder/AssemblyException.java \
-gnu/java/beans/decoder/BooleanHandler.java \
-gnu/java/beans/decoder/ByteHandler.java \
-gnu/java/beans/decoder/CharHandler.java \
-gnu/java/beans/decoder/ClassHandler.java \
-gnu/java/beans/decoder/ConstructorContext.java \
-gnu/java/beans/decoder/Context.java \
-gnu/java/beans/decoder/DecoderContext.java \
-gnu/java/beans/decoder/DefaultExceptionListener.java \
-gnu/java/beans/decoder/DoubleHandler.java \
-gnu/java/beans/decoder/DummyContext.java \
-gnu/java/beans/decoder/DummyHandler.java \
-gnu/java/beans/decoder/ElementHandler.java \
-gnu/java/beans/decoder/FloatHandler.java \
-gnu/java/beans/decoder/GrowableArrayContext.java \
-gnu/java/beans/decoder/IndexContext.java \
-gnu/java/beans/decoder/IntHandler.java \
-gnu/java/beans/decoder/JavaHandler.java \
-gnu/java/beans/decoder/LongHandler.java \
-gnu/java/beans/decoder/MethodContext.java \
-gnu/java/beans/decoder/MethodFinder.java \
-gnu/java/beans/decoder/NullHandler.java \
-gnu/java/beans/decoder/ObjectContext.java \
-gnu/java/beans/decoder/ObjectHandler.java \
-gnu/java/beans/decoder/PersistenceParser.java \
-gnu/java/beans/decoder/PropertyContext.java \
-gnu/java/beans/decoder/ShortHandler.java \
-gnu/java/beans/decoder/SimpleHandler.java \
-gnu/java/beans/decoder/StaticMethodContext.java \
-gnu/java/beans/decoder/StringHandler.java \
-gnu/java/beans/decoder/VoidHandler.java \
-gnu/java/beans/editors/ColorEditor.java \
-gnu/java/beans/editors/FontEditor.java \
-gnu/java/beans/editors/NativeBooleanEditor.java \
-gnu/java/beans/editors/NativeByteEditor.java \
-gnu/java/beans/editors/NativeDoubleEditor.java \
-gnu/java/beans/editors/NativeFloatEditor.java \
-gnu/java/beans/editors/NativeIntEditor.java \
-gnu/java/beans/editors/NativeLongEditor.java \
-gnu/java/beans/editors/NativeShortEditor.java \
-gnu/java/beans/editors/StringEditor.java \
-gnu/java/beans/BeanInfoEmbryo.java \
-gnu/java/beans/DummyAppletContext.java \
-gnu/java/beans/DummyAppletStub.java \
-gnu/java/beans/ExplicitBeanInfo.java \
-gnu/java/beans/IntrospectionIncubator.java
-
-awt_java_source_files = \
-gnu/awt/LightweightRedirector.java \
-gnu/awt/j2d/AbstractGraphicsState.java \
-gnu/awt/j2d/DirectRasterGraphics.java \
-gnu/awt/j2d/Graphics2DImpl.java \
-gnu/awt/j2d/IntegerGraphicsState.java \
-gnu/awt/j2d/MappedRaster.java \
-gnu/java/awt/BitMaskExtent.java \
-gnu/java/awt/Buffers.java \
-gnu/java/awt/BitwiseXORComposite.java \
-gnu/java/awt/ComponentDataBlitOp.java \
-gnu/java/awt/ClasspathToolkit.java \
-gnu/java/awt/EmbeddedWindow.java \
-gnu/java/awt/EmbeddedWindowSupport.java \
-gnu/java/awt/EventModifier.java \
-gnu/java/awt/color/CieXyzConverter.java \
-gnu/java/awt/color/ClutProfileConverter.java \
-gnu/java/awt/color/ColorLookUpTable.java \
-gnu/java/awt/color/ColorSpaceConverter.java \
-gnu/java/awt/color/GrayProfileConverter.java \
-gnu/java/awt/color/GrayScaleConverter.java \
-gnu/java/awt/color/LinearRGBConverter.java \
-gnu/java/awt/color/ProfileHeader.java \
-gnu/java/awt/color/PyccConverter.java \
-gnu/java/awt/color/RgbProfileConverter.java \
-gnu/java/awt/color/SrgbConverter.java \
-gnu/java/awt/color/TagEntry.java \
-gnu/java/awt/color/ToneReproductionCurve.java \
-gnu/java/awt/image/ImageDecoder.java \
-gnu/java/awt/image/XBMDecoder.java \
-gnu/java/awt/peer/EmbeddedWindowPeer.java \
-gnu/java/awt/peer/GLightweightPeer.java \
-gnu/java/awt/peer/ClasspathFontPeer.java \
-gnu/java/awt/peer/ClasspathTextLayoutPeer.java \
-gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.java \
-gnu/javax/swing/text/html/parser/support/parameterDefaulter.java \
-gnu/javax/swing/text/html/parser/support/Parser.java \
-gnu/javax/swing/text/html/parser/support/textPreProcessor.java \
-gnu/javax/swing/text/html/parser/support/low/Buffer.java \
-gnu/javax/swing/text/html/parser/support/low/Constants.java \
-gnu/javax/swing/text/html/parser/support/low/Location.java \
-gnu/javax/swing/text/html/parser/support/low/node.java \
-gnu/javax/swing/text/html/parser/support/low/ParseException.java \
-gnu/javax/swing/text/html/parser/support/low/pattern.java \
-gnu/javax/swing/text/html/parser/support/low/Queue.java \
-gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.java \
-gnu/javax/swing/text/html/parser/support/low/Token.java \
-gnu/javax/swing/text/html/parser/gnuDTD.java \
-gnu/javax/swing/text/html/parser/HTML_401F.java \
-gnu/javax/swing/text/html/parser/htmlAttributeSet.java \
-gnu/javax/swing/text/html/parser/htmlValidator.java \
-gnu/javax/swing/text/html/parser/models/list.java \
-gnu/javax/swing/text/html/parser/models/node.java \
-gnu/javax/swing/text/html/parser/models/noTagModel.java \
-gnu/javax/swing/text/html/parser/models/PCDATAonly_model.java \
-gnu/javax/swing/text/html/parser/models/TableRowContentModel.java \
-gnu/javax/swing/text/html/parser/models/transformer.java \
-java/applet/Applet.java \
-java/applet/AppletStub.java \
-java/applet/AppletContext.java \
-java/applet/AudioClip.java \
-java/awt/AWTError.java \
-java/awt/AWTEvent.java \
-java/awt/AWTEventMulticaster.java \
-java/awt/AWTException.java \
-java/awt/AWTPermission.java \
-java/awt/ActiveEvent.java \
-java/awt/Adjustable.java \
-java/awt/BorderLayout.java \
-java/awt/Button.java \
-java/awt/Canvas.java \
-java/awt/CardLayout.java \
-java/awt/Checkbox.java \
-java/awt/CheckboxGroup.java \
-java/awt/CheckboxMenuItem.java \
-java/awt/Choice.java \
-java/awt/Color.java \
-java/awt/Component.java \
-java/awt/ComponentOrientation.java \
-java/awt/Container.java \
-java/awt/Cursor.java \
-java/awt/Dialog.java \
-java/awt/Dimension.java \
-java/awt/Event.java \
-java/awt/EventDispatchThread.java \
-java/awt/EventQueue.java \
-java/awt/FileDialog.java \
-java/awt/FlowLayout.java \
-java/awt/Font.java \
-java/awt/FontMetrics.java \
-java/awt/Frame.java \
-java/awt/Graphics.java \
-java/awt/Graphics2D.java \
-java/awt/GraphicsConfiguration.java \
-java/awt/GridBagConstraints.java \
-java/awt/GridBagLayout.java \
-java/awt/GridBagLayoutInfo.java \
-java/awt/GridLayout.java \
-java/awt/IllegalComponentStateException.java \
-java/awt/Image.java \
-java/awt/Insets.java \
-java/awt/ItemSelectable.java \
-java/awt/Label.java \
-java/awt/LayoutManager.java \
-java/awt/LayoutManager2.java \
-java/awt/List.java \
-java/awt/Menu.java \
-java/awt/MenuBar.java \
-java/awt/MenuComponent.java \
-java/awt/MenuContainer.java \
-java/awt/MenuItem.java \
-java/awt/MenuShortcut.java \
-java/awt/Paint.java \
-java/awt/PaintContext.java \
-java/awt/Panel.java \
-java/awt/Point.java \
-java/awt/PopupMenu.java \
-java/awt/Rectangle.java \
-java/awt/RenderingHints.java \
-java/awt/ScrollPane.java \
-java/awt/Scrollbar.java \
-java/awt/Shape.java \
-java/awt/TextArea.java \
-java/awt/TextComponent.java \
-java/awt/TextField.java \
-java/awt/Toolkit.java \
-java/awt/Transparency.java \
-java/awt/Window.java \
-java/awt/color/ColorSpace.java \
-java/awt/color/ICC_ColorSpace.java \
-java/awt/color/ICC_Profile.java \
-java/awt/color/ICC_ProfileGray.java \
-java/awt/color/ICC_ProfileRGB.java \
-java/awt/color/CMMException.java \
-java/awt/color/ProfileDataException.java \
-java/awt/datatransfer/Clipboard.java \
-java/awt/datatransfer/ClipboardOwner.java \
-java/awt/datatransfer/DataFlavor.java \
-java/awt/datatransfer/FlavorMap.java \
-java/awt/datatransfer/MimeTypeParseException.java \
-java/awt/datatransfer/StringSelection.java \
-java/awt/datatransfer/SystemFlavorMap.java \
-java/awt/datatransfer/Transferable.java \
-java/awt/datatransfer/UnsupportedFlavorException.java \
-java/awt/datatransfer/FlavorTable.java \
-java/awt/event/AWTEventListener.java \
-java/awt/event/ActionEvent.java \
-java/awt/event/ActionListener.java \
-java/awt/event/AdjustmentEvent.java \
-java/awt/event/AdjustmentListener.java \
-java/awt/event/ComponentAdapter.java \
-java/awt/event/ComponentEvent.java \
-java/awt/event/ComponentListener.java \
-java/awt/event/ContainerAdapter.java \
-java/awt/event/ContainerEvent.java \
-java/awt/event/ContainerListener.java \
-java/awt/event/FocusAdapter.java \
-java/awt/event/FocusEvent.java \
-java/awt/event/FocusListener.java \
-java/awt/event/HierarchyBoundsAdapter.java \
-java/awt/event/HierarchyBoundsListener.java \
-java/awt/event/HierarchyEvent.java \
-java/awt/event/HierarchyListener.java \
-java/awt/event/InputEvent.java \
-java/awt/event/InputMethodEvent.java \
-java/awt/event/InputMethodListener.java \
-java/awt/event/InvocationEvent.java \
-java/awt/event/ItemEvent.java \
-java/awt/event/ItemListener.java \
-java/awt/event/KeyAdapter.java \
-java/awt/event/KeyEvent.java \
-java/awt/event/KeyListener.java \
-java/awt/event/MouseAdapter.java \
-java/awt/event/MouseEvent.java \
-java/awt/event/MouseListener.java \
-java/awt/event/MouseMotionAdapter.java \
-java/awt/event/MouseMotionListener.java \
-java/awt/event/PaintEvent.java \
-java/awt/event/TextEvent.java \
-java/awt/event/TextListener.java \
-java/awt/event/WindowAdapter.java \
-java/awt/event/WindowEvent.java \
-java/awt/event/WindowListener.java \
-java/awt/event/AWTEventListenerProxy.java \
-java/awt/event/MouseWheelEvent.java \
-java/awt/event/MouseWheelListener.java \
-java/awt/event/WindowFocusListener.java \
-java/awt/event/WindowStateListener.java \
-java/awt/font/FontRenderContext.java \
-java/awt/font/ShapeGraphicAttribute.java \
-java/awt/font/MultipleMaster.java \
-java/awt/font/TransformAttribute.java \
-java/awt/font/GlyphJustificationInfo.java \
-java/awt/font/LineBreakMeasurer.java \
-java/awt/font/TextMeasurer.java \
-java/awt/font/TextLayout.java \
-java/awt/font/LineMetrics.java \
-java/awt/font/TextAttribute.java \
-java/awt/font/GlyphMetrics.java \
-java/awt/font/OpenType.java \
-java/awt/font/GlyphVector.java \
-java/awt/font/GraphicAttribute.java \
-java/awt/font/ImageGraphicAttribute.java \
-java/awt/font/NumericShaper.java \
-java/awt/geom/AffineTransform.java \
-java/awt/geom/Dimension2D.java \
-java/awt/geom/Ellipse2D.java \
-java/awt/geom/IllegalPathStateException.java \
-java/awt/geom/NoninvertibleTransformException.java \
-java/awt/geom/PathIterator.java \
-java/awt/geom/Point2D.java \
-java/awt/geom/Rectangle2D.java \
-java/awt/geom/RectangularShape.java \
-java/awt/geom/RoundRectangle2D.java \
-java/awt/geom/Line2D.java \
-java/awt/geom/Arc2D.java \
-java/awt/geom/Area.java \
-java/awt/geom/CubicCurve2D.java \
-java/awt/geom/FlatteningPathIterator.java \
-java/awt/geom/GeneralPath.java \
-java/awt/geom/QuadCurve2D.java \
-java/awt/image/BandCombineOp.java \
-java/awt/image/BandedSampleModel.java \
-java/awt/image/AffineTransformOp.java \
-java/awt/image/BufferedImage.java \
-java/awt/image/BufferedImageFilter.java \
-java/awt/image/ByteLookupTable.java \
-java/awt/image/ColorConvertOp.java \
-java/awt/image/ColorModel.java \
-java/awt/image/ComponentColorModel.java \
-java/awt/image/ComponentSampleModel.java \
-java/awt/image/ConvolveOp.java \
-java/awt/image/DataBuffer.java \
-java/awt/image/DataBufferByte.java \
-java/awt/image/DataBufferDouble.java \
-java/awt/image/DataBufferFloat.java \
-java/awt/image/DataBufferInt.java \
-java/awt/image/DataBufferShort.java \
-java/awt/image/DataBufferUShort.java \
-java/awt/image/DirectColorModel.java \
-java/awt/image/ImageConsumer.java \
-java/awt/image/ImageObserver.java \
-java/awt/image/ImageProducer.java \
-java/awt/image/IndexColorModel.java \
-java/awt/image/Kernel.java \
-java/awt/image/LookupOp.java \
-java/awt/image/LookupTable.java \
-java/awt/image/MultiPixelPackedSampleModel.java \
-java/awt/image/PackedColorModel.java \
-java/awt/image/PixelInterleavedSampleModel.java \
-java/awt/image/Raster.java \
-java/awt/image/RasterOp.java \
-java/awt/image/RescaleOp.java \
-java/awt/image/SampleModel.java \
-java/awt/image/ShortLookupTable.java \
-java/awt/image/SinglePixelPackedSampleModel.java \
-java/awt/image/WritableRaster.java \
-java/awt/image/AreaAveragingScaleFilter.java \
-java/awt/image/CropImageFilter.java \
-java/awt/image/FilteredImageSource.java \
-java/awt/image/ImageFilter.java \
-java/awt/image/MemoryImageSource.java \
-java/awt/image/PixelGrabber.java \
-java/awt/image/RGBImageFilter.java \
-java/awt/image/ReplicateScaleFilter.java \
-java/awt/image/BufferStrategy.java \
-java/awt/image/BufferedImageOp.java \
-java/awt/image/ImagingOpException.java \
-java/awt/image/RasterFormatException.java \
-java/awt/image/RenderedImage.java \
-java/awt/image/TileObserver.java \
-java/awt/image/VolatileImage.java \
-java/awt/image/WritableRenderedImage.java \
-java/awt/image/renderable/ContextualRenderedImageFactory.java \
-java/awt/image/renderable/ParameterBlock.java \
-java/awt/image/renderable/RenderContext.java \
-java/awt/image/renderable/RenderableImage.java \
-java/awt/image/renderable/RenderableImageOp.java \
-java/awt/image/renderable/RenderableImageProducer.java \
-java/awt/image/renderable/RenderedImageFactory.java \
-java/awt/peer/ButtonPeer.java \
-java/awt/peer/CanvasPeer.java \
-java/awt/peer/CheckboxMenuItemPeer.java \
-java/awt/peer/CheckboxPeer.java \
-java/awt/peer/ChoicePeer.java \
-java/awt/peer/ComponentPeer.java \
-java/awt/peer/ContainerPeer.java \
-java/awt/peer/DialogPeer.java \
-java/awt/peer/FileDialogPeer.java \
-java/awt/peer/FontPeer.java \
-java/awt/peer/FramePeer.java \
-java/awt/peer/LabelPeer.java \
-java/awt/peer/LightweightPeer.java \
-java/awt/peer/ListPeer.java \
-java/awt/peer/MenuBarPeer.java \
-java/awt/peer/MenuComponentPeer.java \
-java/awt/peer/MenuItemPeer.java \
-java/awt/peer/MenuPeer.java \
-java/awt/peer/PanelPeer.java \
-java/awt/peer/PopupMenuPeer.java \
-java/awt/peer/RobotPeer.java \
-java/awt/peer/ScrollPanePeer.java \
-java/awt/peer/ScrollbarPeer.java \
-java/awt/peer/TextAreaPeer.java \
-java/awt/peer/TextComponentPeer.java \
-java/awt/peer/TextFieldPeer.java \
-java/awt/peer/WindowPeer.java \
-java/awt/SystemColor.java \
-java/awt/Polygon.java \
-java/awt/MediaTracker.java \
-java/awt/PrintGraphics.java \
-java/awt/PrintJob.java \
-java/awt/AWTKeyStroke.java \
-java/awt/AlphaComposite.java \
-java/awt/AttributeValue.java \
-java/awt/BasicStroke.java \
-java/awt/BufferCapabilities.java \
-java/awt/ColorPaintContext.java \
-java/awt/Composite.java \
-java/awt/CompositeContext.java \
-java/awt/ContainerOrderFocusTraversalPolicy.java \
-java/awt/DefaultFocusTraversalPolicy.java \
-java/awt/DefaultKeyboardFocusManager.java \
-java/awt/DisplayMode.java \
-java/awt/FocusTraversalPolicy.java \
-java/awt/FontFormatException.java \
-java/awt/GradientPaint.java \
-java/awt/GraphicsConfigTemplate.java \
-java/awt/GraphicsDevice.java \
-java/awt/GraphicsEnvironment.java \
-java/awt/HeadlessException.java \
-java/awt/ImageCapabilities.java \
-java/awt/JobAttributes.java \
-java/awt/KeyEventDispatcher.java \
-java/awt/KeyEventPostProcessor.java \
-java/awt/KeyboardFocusManager.java \
-java/awt/PageAttributes.java \
-java/awt/Robot.java \
-java/awt/ScrollPaneAdjustable.java \
-java/awt/Stroke.java \
-java/awt/TexturePaint.java \
-java/awt/dnd/peer/DragSourceContextPeer.java \
-java/awt/dnd/peer/DropTargetContextPeer.java \
-java/awt/dnd/peer/DropTargetPeer.java \
-java/awt/dnd/DnDConstants.java \
-java/awt/dnd/DnDEventMulticaster.java \
-java/awt/dnd/DragGestureEvent.java \
-java/awt/dnd/DragGestureListener.java \
-java/awt/dnd/DragGestureRecognizer.java \
-java/awt/dnd/DragSource.java \
-java/awt/dnd/DragSourceAdapter.java \
-java/awt/dnd/DragSourceContext.java \
-java/awt/dnd/DragSourceDragEvent.java \
-java/awt/dnd/DragSourceEvent.java \
-java/awt/dnd/DragSourceListener.java \
-java/awt/dnd/DragSourceMotionListener.java \
-java/awt/dnd/DropTarget.java \
-java/awt/dnd/InvalidDnDOperationException.java \
-java/awt/dnd/Autoscroll.java \
-java/awt/dnd/DragSourceDropEvent.java \
-java/awt/dnd/DropTargetAdapter.java \
-java/awt/dnd/DropTargetContext.java \
-java/awt/dnd/DropTargetDragEvent.java \
-java/awt/dnd/DropTargetDropEvent.java \
-java/awt/dnd/DropTargetEvent.java \
-java/awt/dnd/DropTargetListener.java \
-java/awt/dnd/MouseDragGestureRecognizer.java \
-java/awt/font/TextHitInfo.java \
-java/awt/im/spi/InputMethod.java \
-java/awt/im/spi/InputMethodContext.java \
-java/awt/im/spi/InputMethodDescriptor.java \
-java/awt/im/InputContext.java \
-java/awt/im/InputMethodHighlight.java \
-java/awt/im/InputMethodRequests.java \
-java/awt/im/InputSubset.java \
-java/awt/print/Book.java \
-java/awt/print/PageFormat.java \
-java/awt/print/Pageable.java \
-java/awt/print/Paper.java \
-java/awt/print/Printable.java \
-java/awt/print/PrinterAbortException.java \
-java/awt/print/PrinterException.java \
-java/awt/print/PrinterGraphics.java \
-java/awt/print/PrinterIOException.java \
-java/awt/print/PrinterJob.java \
-java/beans/beancontext/BeanContext.java \
-java/beans/beancontext/BeanContextChild.java \
-java/beans/beancontext/BeanContextChildComponentProxy.java \
-java/beans/beancontext/BeanContextChildSupport.java \
-java/beans/beancontext/BeanContextContainerProxy.java \
-java/beans/beancontext/BeanContextEvent.java \
-java/beans/beancontext/BeanContextMembershipEvent.java \
-java/beans/beancontext/BeanContextMembershipListener.java \
-java/beans/beancontext/BeanContextProxy.java \
-java/beans/beancontext/BeanContextServiceAvailableEvent.java \
-java/beans/beancontext/BeanContextServiceProvider.java \
-java/beans/beancontext/BeanContextServiceProviderBeanInfo.java \
-java/beans/beancontext/BeanContextServiceRevokedEvent.java \
-java/beans/beancontext/BeanContextServiceRevokedListener.java \
-java/beans/beancontext/BeanContextServices.java \
-java/beans/beancontext/BeanContextServicesListener.java \
-java/beans/beancontext/BeanContextServicesSupport.java \
-java/beans/beancontext/BeanContextSupport.java \
-java/beans/BeanDescriptor.java \
-java/beans/BeanInfo.java \
-java/beans/Beans.java \
-java/beans/Customizer.java \
-java/beans/DesignMode.java \
-java/beans/EventHandler.java \
-java/beans/EventSetDescriptor.java \
-java/beans/ExceptionListener.java \
-java/beans/Expression.java \
-java/beans/FeatureDescriptor.java \
-java/beans/IndexedPropertyDescriptor.java \
-java/beans/IntrospectionException.java \
-java/beans/Introspector.java \
-java/beans/MethodDescriptor.java \
-java/beans/ParameterDescriptor.java \
-java/beans/PropertyChangeEvent.java \
-java/beans/PropertyChangeListener.java \
-java/beans/PropertyChangeListenerProxy.java \
-java/beans/PropertyChangeSupport.java \
-java/beans/PropertyDescriptor.java \
-java/beans/PropertyEditor.java \
-java/beans/PropertyEditorManager.java \
-java/beans/PropertyEditorSupport.java \
-java/beans/PropertyVetoException.java \
-java/beans/Statement.java \
-java/beans/SimpleBeanInfo.java \
-java/beans/VetoableChangeListener.java \
-java/beans/VetoableChangeListenerProxy.java \
-java/beans/VetoableChangeSupport.java \
-java/beans/Visibility.java \
-java/beans/AppletInitializer.java \
-java/beans/XMLDecoder.java \
-javax/swing/border/AbstractBorder.java \
-javax/swing/border/BevelBorder.java \
-javax/swing/border/Border.java \
-javax/swing/border/CompoundBorder.java \
-javax/swing/border/EmptyBorder.java \
-javax/swing/border/EtchedBorder.java \
-javax/swing/border/LineBorder.java \
-javax/swing/border/MatteBorder.java \
-javax/swing/border/SoftBevelBorder.java \
-javax/swing/border/TitledBorder.java \
-javax/swing/GrayFilter.java \
-javax/swing/AbstractAction.java \
-javax/swing/AbstractButton.java \
-javax/swing/AbstractSpinnerModel.java \
-javax/swing/plaf/basic/BasicArrowButton.java \
-javax/swing/plaf/basic/BasicButtonListener.java \
-javax/swing/plaf/basic/BasicButtonUI.java \
-javax/swing/plaf/basic/BasicCheckBoxUI.java \
-javax/swing/plaf/basic/BasicColorChooserUI.java \
-javax/swing/plaf/basic/BasicComboBoxUI.java \
-javax/swing/plaf/basic/BasicComboBoxEditor.java \
-javax/swing/plaf/basic/BasicComboBoxRenderer.java \
-javax/swing/plaf/basic/BasicComboPopup.java \
-javax/swing/plaf/basic/BasicDesktopIconUI.java \
-javax/swing/plaf/basic/BasicDesktopPaneUI.java \
-javax/swing/plaf/basic/BasicEditorPaneUI.java \
-javax/swing/plaf/basic/BasicFormattedTextFieldUI.java \
-javax/swing/plaf/basic/BasicGraphicsUtils.java \
-javax/swing/plaf/basic/BasicInternalFrameTitlePane.java \
-javax/swing/plaf/basic/BasicInternalFrameUI.java \
-javax/swing/plaf/basic/BasicLabelUI.java \
-javax/swing/plaf/basic/BasicListUI.java \
-javax/swing/plaf/basic/BasicMenuUI.java \
-javax/swing/plaf/basic/BasicMenuBarUI.java \
-javax/swing/plaf/basic/BasicMenuItemUI.java \
-javax/swing/plaf/basic/BasicOptionPaneUI.java \
-javax/swing/plaf/basic/BasicPanelUI.java \
-javax/swing/plaf/basic/BasicPasswordFieldUI.java \
-javax/swing/plaf/basic/BasicPopupMenuUI.java \
-javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java \
-javax/swing/plaf/basic/BasicProgressBarUI.java \
-javax/swing/plaf/basic/BasicRootPaneUI.java \
-javax/swing/plaf/basic/BasicRadioButtonUI.java \
-javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java \
-javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java \
-javax/swing/plaf/basic/BasicScrollBarUI.java \
-javax/swing/plaf/basic/BasicScrollPaneUI.java \
-javax/swing/plaf/basic/BasicSeparatorUI.java \
-javax/swing/plaf/basic/BasicSliderUI.java \
-javax/swing/plaf/basic/BasicSpinnerUI.java \
-javax/swing/plaf/basic/BasicSplitPaneDivider.java \
-javax/swing/plaf/basic/BasicSplitPaneUI.java \
-javax/swing/plaf/basic/BasicTabbedPaneUI.java \
-javax/swing/plaf/basic/BasicTableUI.java \
-javax/swing/plaf/basic/BasicTableHeaderUI.java \
-javax/swing/plaf/basic/BasicTextAreaUI.java \
-javax/swing/plaf/basic/BasicTextFieldUI.java \
-javax/swing/plaf/basic/BasicTextPaneUI.java \
-javax/swing/plaf/basic/BasicTextUI.java \
-javax/swing/plaf/basic/BasicToggleButtonUI.java \
-javax/swing/plaf/basic/BasicToolBarSeparatorUI.java \
-javax/swing/plaf/basic/BasicToolBarUI.java \
-javax/swing/plaf/basic/BasicToolTipUI.java \
-javax/swing/plaf/basic/BasicTreeUI.java \
-javax/swing/plaf/basic/BasicViewportUI.java \
-javax/swing/plaf/basic/BasicLookAndFeel.java \
-javax/swing/plaf/basic/BasicBorders.java \
-javax/swing/plaf/basic/BasicIconFactory.java \
-javax/swing/plaf/basic/ComboPopup.java \
-javax/swing/plaf/metal/MetalBorders.java \
-javax/swing/plaf/metal/MetalButtonUI.java \
-javax/swing/plaf/metal/MetalCheckBoxUI.java \
-javax/swing/plaf/metal/MetalComboBoxUI.java \
-javax/swing/plaf/metal/MetalDesktopIconUI.java \
-javax/swing/plaf/metal/MetalInternalFrameUI.java \
-javax/swing/plaf/metal/MetalLabelUI.java \
-javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java \
-javax/swing/plaf/metal/MetalProgressBarUI.java \
-javax/swing/plaf/metal/MetalRadioButtonUI.java \
-javax/swing/plaf/metal/MetalRootPaneUI.java \
-javax/swing/plaf/metal/MetalScrollBarUI.java \
-javax/swing/plaf/metal/MetalScrollPaneUI.java \
-javax/swing/plaf/metal/MetalSeparatorUI.java \
-javax/swing/plaf/metal/MetalSliderUI.java \
-javax/swing/plaf/metal/MetalSplitPaneUI.java \
-javax/swing/plaf/metal/MetalTabbedPaneUI.java \
-javax/swing/plaf/metal/MetalTextFieldUI.java \
-javax/swing/plaf/metal/MetalToggleButtonUI.java \
-javax/swing/plaf/metal/MetalToolBarUI.java \
-javax/swing/plaf/metal/MetalToolTipUI.java \
-javax/swing/plaf/metal/MetalTreeUI.java \
-javax/swing/plaf/BorderUIResource.java \
-javax/swing/plaf/UIResource.java \
-javax/swing/plaf/ButtonUI.java \
-javax/swing/plaf/ComponentUI.java \
-javax/swing/plaf/LabelUI.java \
-javax/swing/plaf/ListUI.java \
-javax/swing/plaf/OptionPaneUI.java \
-javax/swing/plaf/PanelUI.java \
-javax/swing/plaf/ScrollPaneUI.java \
-javax/swing/plaf/TabbedPaneUI.java \
-javax/swing/plaf/TextUI.java \
-javax/swing/plaf/TreeUI.java \
-javax/swing/plaf/ViewportUI.java \
-javax/swing/plaf/metal/DefaultMetalTheme.java \
-javax/swing/plaf/metal/MetalLookAndFeel.java \
-javax/swing/plaf/metal/MetalTheme.java \
-javax/swing/plaf/ColorUIResource.java \
-javax/swing/plaf/DimensionUIResource.java \
-javax/swing/plaf/FontUIResource.java \
-javax/swing/plaf/IconUIResource.java \
-javax/swing/plaf/InsetsUIResource.java \
-javax/swing/plaf/ActionMapUIResource.java \
-javax/swing/plaf/ColorChooserUI.java \
-javax/swing/plaf/ComboBoxUI.java \
-javax/swing/plaf/ComponentInputMapUIResource.java \
-javax/swing/plaf/DesktopIconUI.java \
-javax/swing/plaf/DesktopPaneUI.java \
-javax/swing/plaf/FileChooserUI.java \
-javax/swing/plaf/InputMapUIResource.java \
-javax/swing/plaf/InternalFrameUI.java \
-javax/swing/plaf/MenuBarUI.java \
-javax/swing/plaf/MenuItemUI.java \
-javax/swing/plaf/PopupMenuUI.java \
-javax/swing/plaf/ProgressBarUI.java \
-javax/swing/plaf/RootPaneUI.java \
-javax/swing/plaf/ScrollBarUI.java \
-javax/swing/plaf/SeparatorUI.java \
-javax/swing/plaf/SliderUI.java \
-javax/swing/plaf/SpinnerUI.java \
-javax/swing/plaf/SplitPaneUI.java \
-javax/swing/plaf/TableHeaderUI.java \
-javax/swing/plaf/TableUI.java \
-javax/swing/plaf/ToolBarUI.java \
-javax/swing/plaf/ToolTipUI.java \
-javax/swing/AbstractListModel.java \
-javax/swing/colorchooser/AbstractColorChooserPanel.java \
-javax/swing/colorchooser/ColorChooserComponentFactory.java \
-javax/swing/colorchooser/ColorSelectionModel.java \
-javax/swing/colorchooser/DefaultColorSelectionModel.java \
-javax/swing/colorchooser/DefaultPreviewPanel.java \
-javax/swing/colorchooser/DefaultSwatchChooserPanel.java \
-javax/swing/colorchooser/DefaultHSBChooserPanel.java \
-javax/swing/colorchooser/DefaultRGBChooserPanel.java \
-javax/swing/filechooser/FileFilter.java \
-javax/swing/filechooser/FileSystemView.java \
-javax/swing/filechooser/FileView.java \
-javax/swing/table/AbstractTableModel.java \
-javax/swing/table/DefaultTableColumnModel.java \
-javax/swing/table/DefaultTableModel.java \
-javax/swing/table/JTableHeader.java \
-javax/swing/table/TableCellEditor.java \
-javax/swing/table/TableCellRenderer.java \
-javax/swing/table/TableColumn.java \
-javax/swing/table/TableColumnModel.java \
-javax/swing/table/TableModel.java \
-javax/swing/table/DefaultTableCellRenderer.java \
-javax/swing/Action.java \
-javax/swing/BorderFactory.java \
-javax/swing/Box.java \
-javax/swing/BoxLayout.java \
-javax/swing/ButtonGroup.java \
-javax/swing/ButtonModel.java \
-javax/swing/ComponentInputMap.java \
-javax/swing/DefaultButtonModel.java \
-javax/swing/DefaultListModel.java \
-javax/swing/DefaultListSelectionModel.java \
-javax/swing/Icon.java \
-javax/swing/ImageIcon.java \
-javax/swing/InputMap.java \
-javax/swing/InternalFrameFocusTraversalPolicy.java \
-javax/swing/JApplet.java \
-javax/swing/JButton.java \
-javax/swing/JCheckBox.java \
-javax/swing/JComponent.java \
-javax/swing/JDialog.java \
-javax/swing/JEditorPane.java \
-javax/swing/JFormattedTextField.java \
-javax/swing/JFrame.java \
-javax/swing/JLabel.java \
-javax/swing/JLayeredPane.java \
-javax/swing/JList.java \
-javax/swing/JMenuBar.java \
-javax/swing/JOptionPane.java \
-javax/swing/JPanel.java \
-javax/swing/JRadioButton.java \
-javax/swing/JRootPane.java \
-javax/swing/JScrollBar.java \
-javax/swing/JScrollPane.java \
-javax/swing/JSpinner.java \
-javax/swing/JTabbedPane.java \
-javax/swing/JTextArea.java \
-javax/swing/JTextField.java \
-javax/swing/JToggleButton.java \
-javax/swing/JToolTip.java \
-javax/swing/JTree.java \
-javax/swing/JViewport.java \
-javax/swing/JWindow.java \
-javax/swing/KeyStroke.java \
-javax/swing/LayoutFocusTraversalPolicy.java \
-javax/swing/ListCellRenderer.java \
-javax/swing/ListModel.java \
-javax/swing/ListSelectionModel.java \
-javax/swing/LookAndFeel.java \
-javax/swing/Scrollable.java \
-javax/swing/SortingFocusTraversalPolicy.java \
-javax/swing/SpinnerDateModel.java \
-javax/swing/SpinnerListModel.java \
-javax/swing/SpinnerModel.java \
-javax/swing/SpinnerNumberModel.java \
-javax/swing/Spring.java \
-javax/swing/SpringLayout.java \
-javax/swing/SwingConstants.java \
-javax/swing/SwingUtilities.java \
-javax/swing/Timer.java \
-javax/swing/ToolTipManager.java \
-javax/swing/TransferHandler.java \
-javax/swing/UIDefaults.java \
-javax/swing/UIManager.java \
-javax/swing/UnsupportedLookAndFeelException.java \
-javax/swing/event/AncestorEvent.java \
-javax/swing/event/AncestorListener.java \
-javax/swing/event/ChangeEvent.java \
-javax/swing/event/ChangeListener.java \
-javax/swing/event/DocumentEvent.java \
-javax/swing/event/DocumentListener.java \
-javax/swing/event/HyperlinkEvent.java \
-javax/swing/event/HyperlinkListener.java \
-javax/swing/event/ListDataEvent.java \
-javax/swing/event/ListDataListener.java \
-javax/swing/event/ListSelectionEvent.java \
-javax/swing/event/ListSelectionListener.java \
-javax/swing/event/MenuEvent.java \
-javax/swing/event/UndoableEditEvent.java \
-javax/swing/event/UndoableEditListener.java \
-javax/swing/event/CaretEvent.java \
-javax/swing/event/CaretListener.java \
-javax/swing/event/CellEditorListener.java \
-javax/swing/event/EventListenerList.java \
-javax/swing/event/InternalFrameAdapter.java \
-javax/swing/event/InternalFrameEvent.java \
-javax/swing/event/InternalFrameListener.java \
-javax/swing/event/MenuDragMouseEvent.java \
-javax/swing/event/MenuDragMouseListener.java \
-javax/swing/event/MenuKeyEvent.java \
-javax/swing/event/MenuKeyListener.java \
-javax/swing/event/MenuListener.java \
-javax/swing/event/MouseInputAdapter.java \
-javax/swing/event/MouseInputListener.java \
-javax/swing/event/PopupMenuEvent.java \
-javax/swing/event/PopupMenuListener.java \
-javax/swing/event/SwingPropertyChangeSupport.java \
-javax/swing/event/TableColumnModelEvent.java \
-javax/swing/event/TableColumnModelListener.java \
-javax/swing/event/TableModelEvent.java \
-javax/swing/event/TableModelListener.java \
-javax/swing/event/TreeExpansionEvent.java \
-javax/swing/event/TreeExpansionListener.java \
-javax/swing/event/TreeModelEvent.java \
-javax/swing/event/TreeModelListener.java \
-javax/swing/event/TreeSelectionEvent.java \
-javax/swing/event/TreeSelectionListener.java \
-javax/swing/event/TreeWillExpandListener.java \
-javax/swing/ActionMap.java \
-javax/swing/text/AbstractDocument.java \
-javax/swing/text/AttributeSet.java \
-javax/swing/text/BadLocationException.java \
-javax/swing/text/Caret.java \
-javax/swing/text/ChangedCharSetException.java \
-javax/swing/text/ComponentView.java \
-javax/swing/text/DefaultCaret.java \
-javax/swing/text/DefaultEditorKit.java \
-javax/swing/text/DefaultHighlighter.java \
-javax/swing/text/DefaultStyledDocument.java \
-javax/swing/text/Document.java \
-javax/swing/text/DocumentFilter.java \
-javax/swing/text/EditorKit.java \
-javax/swing/text/Element.java \
-javax/swing/text/FieldView.java \
-javax/swing/text/GapContent.java \
-javax/swing/text/Highlighter.java \
-javax/swing/text/JTextComponent.java \
-javax/swing/text/Keymap.java \
-javax/swing/text/LayeredHighlighter.java \
-javax/swing/text/MutableAttributeSet.java \
-javax/swing/text/NavigationFilter.java \
-javax/swing/text/PasswordView.java \
-javax/swing/text/PlainDocument.java \
-javax/swing/text/PlainView.java \
-javax/swing/text/Position.java \
-javax/swing/text/Segment.java \
-javax/swing/text/SimpleAttributeSet.java \
-javax/swing/text/StringContent.java \
-javax/swing/text/Style.java \
-javax/swing/text/StyleConstants.java \
-javax/swing/text/StyleContext.java \
-javax/swing/text/StyledDocument.java \
-javax/swing/text/StyledEditorKit.java \
-javax/swing/text/TabableView.java \
-javax/swing/text/TabExpander.java \
-javax/swing/text/TabSet.java \
-javax/swing/text/TabStop.java \
-javax/swing/text/TextAction.java \
-javax/swing/text/Utilities.java \
-javax/swing/text/View.java \
-javax/swing/text/ViewFactory.java \
-javax/swing/text/html/HTML.java \
-javax/swing/text/html/HTMLDocument.java \
-javax/swing/text/html/HTMLEditorKit.java \
-javax/swing/text/html/HTMLFrameHyperlinkEvent.java \
-javax/swing/text/html/parser/AttributeList.java \
-javax/swing/text/html/parser/ContentModel.java \
-javax/swing/text/html/parser/DTD.java \
-javax/swing/text/html/parser/DTDConstants.java \
-javax/swing/text/html/parser/DocumentParser.java \
-javax/swing/text/html/parser/Element.java \
-javax/swing/text/html/parser/Entity.java \
-javax/swing/text/html/parser/Parser.java \
-javax/swing/text/html/parser/ParserDelegator.java \
-javax/swing/text/html/parser/TagElement.java \
-javax/swing/text/rtf/ControlWordToken.java \
-javax/swing/text/rtf/RTFEditorKit.java \
-javax/swing/text/rtf/RTFParseException.java \
-javax/swing/text/rtf/RTFParser.java \
-javax/swing/text/rtf/RTFScanner.java \
-javax/swing/text/rtf/TextToken.java \
-javax/swing/text/rtf/Token.java \
-javax/swing/tree/TreeNode.java \
-javax/swing/tree/AbstractLayoutCache.java \
-javax/swing/tree/DefaultMutableTreeNode.java \
-javax/swing/tree/DefaultTreeCellEditor.java \
-javax/swing/tree/DefaultTreeCellRenderer.java \
-javax/swing/tree/DefaultTreeModel.java \
-javax/swing/tree/DefaultTreeSelectionModel.java \
-javax/swing/tree/ExpandVetoException.java \
-javax/swing/tree/FixedHeightLayoutCache.java \
-javax/swing/tree/MutableTreeNode.java \
-javax/swing/tree/RowMapper.java \
-javax/swing/tree/TreeCellEditor.java \
-javax/swing/tree/TreeCellRenderer.java \
-javax/swing/tree/TreeModel.java \
-javax/swing/tree/TreePath.java \
-javax/swing/tree/TreeSelectionModel.java \
-javax/swing/tree/VariableHeightLayoutCache.java \
-javax/swing/undo/UndoableEdit.java \
-javax/swing/undo/AbstractUndoableEdit.java \
-javax/swing/undo/CannotRedoException.java \
-javax/swing/undo/CannotUndoException.java \
-javax/swing/undo/CompoundEdit.java \
-javax/swing/undo/StateEdit.java \
-javax/swing/undo/StateEditable.java \
-javax/swing/undo/UndoManager.java \
-javax/swing/undo/UndoableEditSupport.java \
-javax/swing/BoundedRangeModel.java \
-javax/swing/CellEditor.java \
-javax/swing/ComboBoxEditor.java \
-javax/swing/ComboBoxModel.java \
-javax/swing/DefaultBoundedRangeModel.java \
-javax/swing/DesktopManager.java \
-javax/swing/InputVerifier.java \
-javax/swing/JInternalFrame.java \
-javax/swing/JTable.java \
-javax/swing/MenuElement.java \
-javax/swing/MenuSelectionManager.java \
-javax/swing/MutableComboBoxModel.java \
-javax/swing/Renderer.java \
-javax/swing/RootPaneContainer.java \
-javax/swing/ScrollPaneConstants.java \
-javax/swing/SingleSelectionModel.java \
-javax/swing/SizeRequirements.java \
-javax/swing/SizeSequence.java \
-javax/swing/WindowConstants.java \
-javax/swing/AbstractCellEditor.java \
-javax/swing/CellRendererPane.java \
-javax/swing/DebugGraphics.java \
-javax/swing/DefaultCellEditor.java \
-javax/swing/DefaultComboBoxModel.java \
-javax/swing/DefaultDesktopManager.java \
-javax/swing/DefaultFocusManager.java \
-javax/swing/DefaultListCellRenderer.java \
-javax/swing/DefaultSingleSelectionModel.java \
-javax/swing/FocusManager.java \
-javax/swing/JCheckBoxMenuItem.java \
-javax/swing/JColorChooser.java \
-javax/swing/JComboBox.java \
-javax/swing/JDesktopPane.java \
-javax/swing/JFileChooser.java \
-javax/swing/JMenu.java \
-javax/swing/JMenuItem.java \
-javax/swing/JPasswordField.java \
-javax/swing/JPopupMenu.java \
-javax/swing/JProgressBar.java \
-javax/swing/JRadioButtonMenuItem.java \
-javax/swing/JSeparator.java \
-javax/swing/JSlider.java \
-javax/swing/JSplitPane.java \
-javax/swing/JTextPane.java \
-javax/swing/JToolBar.java \
-javax/swing/OverlayLayout.java \
-javax/swing/Popup.java \
-javax/swing/PopupFactory.java \
-javax/swing/ProgressMonitor.java \
-javax/swing/ProgressMonitorInputStream.java \
-javax/swing/RepaintManager.java \
-javax/swing/ScrollPaneLayout.java \
-javax/swing/ViewportLayout.java
-
-rmi_java_source_files = \
-java/rmi/activation/Activatable.java \
-java/rmi/activation/ActivateFailedException.java \
-java/rmi/activation/ActivationDesc.java \
-java/rmi/activation/ActivationException.java \
-java/rmi/activation/ActivationGroup.java \
-java/rmi/activation/ActivationGroupDesc.java \
-java/rmi/activation/ActivationGroupID.java \
-java/rmi/activation/ActivationID.java \
-java/rmi/activation/ActivationInstantiator.java \
-java/rmi/activation/ActivationMonitor.java \
-java/rmi/activation/ActivationSystem.java \
-java/rmi/activation/Activator.java \
-java/rmi/activation/UnknownGroupException.java \
-java/rmi/activation/UnknownObjectException.java \
-java/rmi/AccessException.java \
-java/rmi/AlreadyBoundException.java \
-java/rmi/ConnectException.java \
-java/rmi/ConnectIOException.java \
-java/rmi/MarshalException.java \
-java/rmi/MarshalledObject.java \
-java/rmi/Naming.java \
-java/rmi/NoSuchObjectException.java \
-java/rmi/NotBoundException.java \
-java/rmi/RMISecurityException.java \
-java/rmi/RMISecurityManager.java \
-java/rmi/Remote.java \
-java/rmi/RemoteException.java \
-java/rmi/ServerError.java \
-java/rmi/ServerException.java \
-java/rmi/ServerRuntimeException.java \
-java/rmi/StubNotFoundException.java \
-java/rmi/UnexpectedException.java \
-java/rmi/UnknownHostException.java \
-java/rmi/UnmarshalException.java \
-java/rmi/dgc/DGC.java \
-java/rmi/dgc/Lease.java \
-java/rmi/dgc/VMID.java \
-java/rmi/registry/LocateRegistry.java \
-java/rmi/registry/Registry.java \
-java/rmi/registry/RegistryHandler.java \
-java/rmi/server/ExportException.java \
-java/rmi/server/LoaderHandler.java \
-java/rmi/server/LogStream.java \
-java/rmi/server/ObjID.java \
-java/rmi/server/Operation.java \
-java/rmi/server/RMIClassLoader.java \
-java/rmi/server/RMIClassLoaderSpi.java \
-java/rmi/server/RMIClientSocketFactory.java \
-java/rmi/server/RMIFailureHandler.java \
-java/rmi/server/RMIServerSocketFactory.java \
-java/rmi/server/RMISocketFactory.java \
-java/rmi/server/RemoteCall.java \
-java/rmi/server/RemoteObject.java \
-java/rmi/server/RemoteRef.java \
-java/rmi/server/RemoteServer.java \
-java/rmi/server/RemoteStub.java \
-java/rmi/server/ServerCloneException.java \
-java/rmi/server/ServerNotActiveException.java \
-java/rmi/server/ServerRef.java \
-java/rmi/server/Skeleton.java \
-java/rmi/server/SkeletonMismatchException.java \
-java/rmi/server/SkeletonNotFoundException.java \
-java/rmi/server/SocketSecurityException.java \
-java/rmi/server/UID.java \
-java/rmi/server/UnicastRemoteObject.java \
-java/rmi/server/Unreferenced.java \
-gnu/java/rmi/RMIMarshalledObjectInputStream.java \
-gnu/java/rmi/RMIMarshalledObjectOutputStream.java \
-gnu/java/rmi/dgc/DGCImpl.java \
-gnu/java/rmi/dgc/DGCImpl_Skel.java \
-gnu/java/rmi/dgc/DGCImpl_Stub.java \
-gnu/java/rmi/registry/RegistryImpl.java \
-gnu/java/rmi/registry/RegistryImpl_Skel.java \
-gnu/java/rmi/registry/RegistryImpl_Stub.java \
-gnu/java/rmi/rmic/Compile_gcj.java \
-gnu/java/rmi/rmic/Compile_jikes.java \
-gnu/java/rmi/rmic/Compile_kjc.java \
-gnu/java/rmi/rmic/Compiler.java \
-gnu/java/rmi/rmic/CompilerProcess.java \
-gnu/java/rmi/rmic/RMIC.java \
-gnu/java/rmi/rmic/RMICException.java \
-gnu/java/rmi/rmic/TabbedWriter.java \
-gnu/java/rmi/server/ConnectionRunnerPool.java \
-gnu/java/rmi/server/ProtocolConstants.java \
-gnu/java/rmi/server/RMIDefaultSocketFactory.java \
-gnu/java/rmi/server/RMIHashes.java \
-gnu/java/rmi/server/RMIIncomingThread.java \
-gnu/java/rmi/server/RMIObjectInputStream.java \
-gnu/java/rmi/server/RMIObjectOutputStream.java \
-gnu/java/rmi/server/RMIVoidValue.java \
-gnu/java/rmi/server/UnicastConnection.java \
-gnu/java/rmi/server/UnicastConnectionManager.java \
-gnu/java/rmi/server/UnicastRef.java \
-gnu/java/rmi/server/UnicastRemoteCall.java \
-gnu/java/rmi/server/UnicastRemoteStub.java \
-gnu/java/rmi/server/UnicastServer.java \
-gnu/java/rmi/server/UnicastServerRef.java
-
-javax_imageio_source_files = \
-javax/imageio/ImageWriteParam.java \
-javax/imageio/ImageReader.java \
-javax/imageio/ImageWriter.java \
-javax/imageio/IIOException.java \
-javax/imageio/IIOParamController.java \
-javax/imageio/ImageReadParam.java \
-javax/imageio/IIOParam.java \
-javax/imageio/spi/IIORegistry.java \
-javax/imageio/spi/ImageWriterSpi.java \
-javax/imageio/spi/ImageOutputStreamSpi.java \
-javax/imageio/spi/ServiceRegistry.java \
-javax/imageio/spi/ImageTranscoderSpi.java \
-javax/imageio/spi/ImageReaderSpi.java \
-javax/imageio/spi/IIOServiceProvider.java \
-javax/imageio/spi/ImageReaderWriterSpi.java \
-javax/imageio/spi/ImageInputStreamSpi.java \
-javax/imageio/spi/RegisterableService.java \
-javax/imageio/metadata/IIOAttr.java \
-javax/imageio/metadata/IIONamedNodeMap.java \
-javax/imageio/metadata/IIONodeList.java \
-javax/imageio/metadata/IIOMetadataFormatImpl.java \
-javax/imageio/metadata/IIOInvalidTreeException.java \
-javax/imageio/metadata/IIOMetadataFormat.java \
-javax/imageio/metadata/IIOMetadataController.java \
-javax/imageio/metadata/IIOMetadataNode.java \
-javax/imageio/metadata/IIOMetadata.java \
-javax/imageio/stream/FileImageOutputStream.java \
-javax/imageio/stream/ImageInputStream.java \
-javax/imageio/stream/IIOByteBuffer.java \
-javax/imageio/stream/FileCacheImageInputStream.java \
-javax/imageio/stream/ImageInputStreamImpl.java \
-javax/imageio/stream/ImageOutputStreamImpl.java \
-javax/imageio/stream/MemoryCacheImageInputStream.java \
-javax/imageio/stream/FileCacheImageOutputStream.java \
-javax/imageio/stream/ImageOutputStream.java \
-javax/imageio/stream/MemoryCacheImageOutputStream.java \
-javax/imageio/stream/FileImageInputStream.java \
-javax/imageio/event/IIOReadProgressListener.java \
-javax/imageio/event/IIOWriteWarningListener.java \
-javax/imageio/event/IIOReadWarningListener.java \
-javax/imageio/event/IIOReadUpdateListener.java \
-javax/imageio/event/IIOWriteProgressListener.java \
-javax/imageio/ImageTranscoder.java \
-javax/imageio/ImageTypeSpecifier.java \
-javax/imageio/ImageIO.java \
-javax/imageio/IIOImage.java
-
-javax_xml_source_files = \
-javax/xml/xpath/XPathConstants.java \
-javax/xml/xpath/XPathFunction.java \
-javax/xml/xpath/XPathVariableResolver.java \
-javax/xml/xpath/XPathExpressionException.java \
-javax/xml/xpath/XPathFunctionResolver.java \
-javax/xml/xpath/XPath.java \
-javax/xml/xpath/XPathFactoryConfigurationException.java \
-javax/xml/xpath/XPathFactory.java \
-javax/xml/xpath/XPathException.java \
-javax/xml/xpath/XPathExpression.java \
-javax/xml/xpath/XPathFunctionException.java \
-javax/xml/validation/ValidatorHandler.java \
-javax/xml/validation/Validator.java \
-javax/xml/validation/TypeInfoProvider.java \
-javax/xml/validation/SchemaFactory.java \
-javax/xml/validation/Schema.java \
-javax/xml/parsers/SAXParserFactory.java \
-javax/xml/parsers/FactoryConfigurationError.java \
-javax/xml/parsers/SAXParser.java \
-javax/xml/parsers/DocumentBuilderFactory.java \
-javax/xml/parsers/ParserConfigurationException.java \
-javax/xml/parsers/DocumentBuilder.java \
-javax/xml/datatype/DatatypeFactory.java \
-javax/xml/datatype/XMLGregorianCalendar.java \
-javax/xml/datatype/Duration.java \
-javax/xml/datatype/DatatypeConfigurationException.java \
-javax/xml/datatype/DatatypeConstants.java \
-javax/xml/XMLConstants.java \
-javax/xml/namespace/NamespaceContext.java \
-javax/xml/namespace/QName.java \
-javax/xml/transform/TransformerException.java \
-javax/xml/transform/TransformerFactoryConfigurationError.java \
-javax/xml/transform/sax/SAXResult.java \
-javax/xml/transform/sax/TransformerHandler.java \
-javax/xml/transform/sax/SAXTransformerFactory.java \
-javax/xml/transform/sax/SAXSource.java \
-javax/xml/transform/sax/TemplatesHandler.java \
-javax/xml/transform/OutputKeys.java \
-javax/xml/transform/stream/StreamResult.java \
-javax/xml/transform/stream/StreamSource.java \
-javax/xml/transform/Source.java \
-javax/xml/transform/SourceLocator.java \
-javax/xml/transform/ErrorListener.java \
-javax/xml/transform/TransformerConfigurationException.java \
-javax/xml/transform/Templates.java \
-javax/xml/transform/Result.java \
-javax/xml/transform/URIResolver.java \
-javax/xml/transform/dom/DOMSource.java \
-javax/xml/transform/dom/DOMLocator.java \
-javax/xml/transform/dom/DOMResult.java \
-javax/xml/transform/Transformer.java \
-javax/xml/transform/TransformerFactory.java
-
-javax_source_files = \
-javax/net/VanillaSocketFactory.java \
-javax/net/ssl/TrustManagerFactorySpi.java \
-javax/net/ssl/SSLKeyException.java \
-javax/net/ssl/TrustManager.java \
-javax/net/ssl/SSLServerSocket.java \
-javax/net/ssl/TrustManagerFactory.java \
-javax/net/ssl/KeyManager.java \
-javax/net/ssl/SSLSocketFactory.java \
-javax/net/ssl/SSLPermission.java \
-javax/net/ssl/SSLContext.java \
-javax/net/ssl/TrivialHostnameVerifier.java \
-javax/net/ssl/X509KeyManager.java \
-javax/net/ssl/SSLServerSocketFactory.java \
-javax/net/ssl/SSLSessionBindingListener.java \
-javax/net/ssl/SSLSessionContext.java \
-javax/net/ssl/KeyManagerFactory.java \
-javax/net/ssl/SSLProtocolException.java \
-javax/net/ssl/SSLSocket.java \
-javax/net/ssl/HostnameVerifier.java \
-javax/net/ssl/HandshakeCompletedListener.java \
-javax/net/ssl/HttpsURLConnection.java \
-javax/net/ssl/KeyManagerFactorySpi.java \
-javax/net/ssl/SSLHandshakeException.java \
-javax/net/ssl/SSLPeerUnverifiedException.java \
-javax/net/ssl/X509TrustManager.java \
-javax/net/ssl/SSLSession.java \
-javax/net/ssl/SSLContextSpi.java \
-javax/net/ssl/HandshakeCompletedEvent.java \
-javax/net/ssl/SSLSessionBindingEvent.java \
-javax/net/ssl/SSLException.java \
-javax/net/ssl/ManagerFactoryParameters.java \
-javax/net/SocketFactory.java \
-javax/net/VanillaServerSocketFactory.java \
-javax/net/ServerSocketFactory.java \
-javax/print/attribute/HashPrintServiceAttributeSet.java \
-javax/print/attribute/Attribute.java \
-javax/print/attribute/DocAttributeSet.java \
-javax/print/attribute/PrintRequestAttributeSet.java \
-javax/print/attribute/standard/Chromaticity.java \
-javax/print/attribute/standard/Destination.java \
-javax/print/attribute/standard/MediaPrintableArea.java \
-javax/print/attribute/standard/MediaSize.java \
-javax/print/attribute/standard/NumberOfInterveningJobs.java \
-javax/print/attribute/standard/PrinterMakeAndModel.java \
-javax/print/attribute/standard/PrinterStateReason.java \
-javax/print/attribute/standard/JobImpressions.java \
-javax/print/attribute/standard/JobHoldUntil.java \
-javax/print/attribute/standard/JobKOctetsSupported.java \
-javax/print/attribute/standard/JobPriority.java \
-javax/print/attribute/standard/QueuedJobCount.java \
-javax/print/attribute/standard/JobOriginatingUserName.java \
-javax/print/attribute/standard/PrinterName.java \
-javax/print/attribute/standard/PDLOverrideSupported.java \
-javax/print/attribute/standard/PrinterStateReasons.java \
-javax/print/attribute/standard/JobMediaSheets.java \
-javax/print/attribute/standard/JobKOctets.java \
-javax/print/attribute/standard/MultipleDocumentHandling.java \
-javax/print/attribute/standard/PrinterMessageFromOperator.java \
-javax/print/attribute/standard/Severity.java \
-javax/print/attribute/standard/ReferenceUriSchemesSupported.java \
-javax/print/attribute/standard/DocumentName.java \
-javax/print/attribute/standard/PrinterMoreInfo.java \
-javax/print/attribute/standard/JobMessageFromOperator.java \
-javax/print/attribute/standard/JobStateReasons.java \
-javax/print/attribute/standard/PrinterIsAcceptingJobs.java \
-javax/print/attribute/standard/DateTimeAtProcessing.java \
-javax/print/attribute/standard/PagesPerMinute.java \
-javax/print/attribute/standard/PrinterResolution.java \
-javax/print/attribute/standard/JobMediaSheetsSupported.java \
-javax/print/attribute/standard/NumberUpSupported.java \
-javax/print/attribute/standard/Finishings.java \
-javax/print/attribute/standard/DateTimeAtCompleted.java \
-javax/print/attribute/standard/NumberOfDocuments.java \
-javax/print/attribute/standard/PrinterInfo.java \
-javax/print/attribute/standard/PrintQuality.java \
-javax/print/attribute/standard/JobSheets.java \
-javax/print/attribute/standard/Media.java \
-javax/print/attribute/standard/Fidelity.java \
-javax/print/attribute/standard/PrinterLocation.java \
-javax/print/attribute/standard/PrinterMoreInfoManufacturer.java \
-javax/print/attribute/standard/OrientationRequested.java \
-javax/print/attribute/standard/JobState.java \
-javax/print/attribute/standard/DateTimeAtCreation.java \
-javax/print/attribute/standard/PresentationDirection.java \
-javax/print/attribute/standard/JobName.java \
-javax/print/attribute/standard/PagesPerMinuteColor.java \
-javax/print/attribute/standard/CopiesSupported.java \
-javax/print/attribute/standard/PrinterURI.java \
-javax/print/attribute/standard/PageRanges.java \
-javax/print/attribute/standard/RequestingUserName.java \
-javax/print/attribute/standard/JobPrioritySupported.java \
-javax/print/attribute/standard/JobMediaSheetsCompleted.java \
-javax/print/attribute/standard/JobKOctetsProcessed.java \
-javax/print/attribute/standard/JobImpressionsCompleted.java \
-javax/print/attribute/standard/Compression.java \
-javax/print/attribute/standard/JobImpressionsSupported.java \
-javax/print/attribute/standard/Sides.java \
-javax/print/attribute/standard/JobStateReason.java \
-javax/print/attribute/standard/SheetCollate.java \
-javax/print/attribute/standard/Copies.java \
-javax/print/attribute/standard/MediaSizeName.java \
-javax/print/attribute/standard/OutputDeviceAssigned.java \
-javax/print/attribute/standard/PrinterState.java \
-javax/print/attribute/standard/NumberUp.java \
-javax/print/attribute/standard/ColorSupported.java \
-javax/print/attribute/HashAttributeSet.java \
-javax/print/attribute/SetOfIntegerSyntax.java \
-javax/print/attribute/HashDocAttributeSet.java \
-javax/print/attribute/PrintRequestAttribute.java \
-javax/print/attribute/DateTimeSyntax.java \
-javax/print/attribute/PrintServiceAttribute.java \
-javax/print/attribute/UnmodifiableSetException.java \
-javax/print/attribute/HashPrintJobAttributeSet.java \
-javax/print/attribute/PrintJobAttribute.java \
-javax/print/attribute/AttributeSet.java \
-javax/print/attribute/ResolutionSyntax.java \
-javax/print/attribute/URISyntax.java \
-javax/print/attribute/AttributeSetUtilities.java \
-javax/print/attribute/HashPrintRequestAttributeSet.java \
-javax/print/attribute/TextSyntax.java \
-javax/print/attribute/PrintJobAttributeSet.java \
-javax/print/attribute/SupportedValuesAttribute.java \
-javax/print/attribute/EnumSyntax.java \
-javax/print/attribute/DocAttribute.java \
-javax/print/attribute/Size2DSyntax.java \
-javax/print/attribute/IntegerSyntax.java \
-javax/print/attribute/PrintServiceAttributeSet.java \
-javax/print/PrintService.java \
-javax/print/DocFlavor.java \
-javax/print/DocPrintJob.java \
-javax/print/event/PrintEvent.java \
-javax/print/event/PrintJobAdapter.java \
-javax/print/event/PrintServiceAttributeEvent.java \
-javax/print/event/PrintJobAttributeEvent.java \
-javax/print/event/PrintServiceAttributeListener.java \
-javax/print/event/PrintJobEvent.java \
-javax/print/event/PrintJobListener.java \
-javax/print/event/PrintJobAttributeListener.java \
-javax/print/PrintServiceLookup.java \
-javax/print/URIException.java \
-javax/print/StreamPrintService.java \
-javax/print/MultiDoc.java \
-javax/print/FlavorException.java \
-javax/print/Doc.java \
-javax/print/MultiDocPrintJob.java \
-javax/print/CancelablePrintJob.java \
-javax/print/MultiDocPrintService.java \
-javax/print/ServiceUIFactory.java \
-javax/print/AttributeException.java \
-javax/print/PrintException.java \
-javax/naming/ServiceUnavailableException.java \
-javax/naming/directory/Attribute.java \
-javax/naming/directory/SchemaViolationException.java \
-javax/naming/directory/InitialDirContext.java \
-javax/naming/directory/BasicAttribute.java \
-javax/naming/directory/NoSuchAttributeException.java \
-javax/naming/directory/InvalidAttributesException.java \
-javax/naming/directory/InvalidAttributeValueException.java \
-javax/naming/directory/BasicAttributes.java \
-javax/naming/directory/AttributeModificationException.java \
-javax/naming/directory/InvalidAttributeIdentifierException.java \
-javax/naming/directory/DirContext.java \
-javax/naming/directory/Attributes.java \
-javax/naming/directory/InvalidSearchControlsException.java \
-javax/naming/directory/SearchControls.java \
-javax/naming/directory/AttributeInUseException.java \
-javax/naming/directory/InvalidSearchFilterException.java \
-javax/naming/directory/ModificationItem.java \
-javax/naming/directory/SearchResult.java \
-javax/naming/Binding.java \
-javax/naming/ContextNotEmptyException.java \
-javax/naming/Referenceable.java \
-javax/naming/InterruptedNamingException.java \
-javax/naming/CommunicationException.java \
-javax/naming/LinkException.java \
-javax/naming/BinaryRefAddr.java \
-javax/naming/LinkLoopException.java \
-javax/naming/AuthenticationException.java \
-javax/naming/NameAlreadyBoundException.java \
-javax/naming/MalformedLinkException.java \
-javax/naming/NotContextException.java \
-javax/naming/spi/DirStateFactory.java \
-javax/naming/spi/ResolveResult.java \
-javax/naming/spi/ObjectFactoryBuilder.java \
-javax/naming/spi/DirObjectFactory.java \
-javax/naming/spi/DirectoryManager.java \
-javax/naming/spi/InitialContextFactoryBuilder.java \
-javax/naming/spi/ObjectFactory.java \
-javax/naming/spi/Resolver.java \
-javax/naming/spi/StateFactory.java \
-javax/naming/spi/InitialContextFactory.java \
-javax/naming/spi/NamingManager.java \
-javax/naming/InvalidNameException.java \
-javax/naming/NamingEnumeration.java \
-javax/naming/LinkRef.java \
-javax/naming/event/NamingListener.java \
-javax/naming/event/NamingEvent.java \
-javax/naming/event/NamespaceChangeListener.java \
-javax/naming/event/ObjectChangeListener.java \
-javax/naming/event/EventContext.java \
-javax/naming/event/NamingExceptionEvent.java \
-javax/naming/event/EventDirContext.java \
-javax/naming/NamingException.java \
-javax/naming/CannotProceedException.java \
-javax/naming/PartialResultException.java \
-javax/naming/TimeLimitExceededException.java \
-javax/naming/NoPermissionException.java \
-javax/naming/CompoundName.java \
-javax/naming/SizeLimitExceededException.java \
-javax/naming/NoInitialContextException.java \
-javax/naming/NameNotFoundException.java \
-javax/naming/InitialContext.java \
-javax/naming/NamingSecurityException.java \
-javax/naming/Context.java \
-javax/naming/ConfigurationException.java \
-javax/naming/InsufficientResourcesException.java \
-javax/naming/AuthenticationNotSupportedException.java \
-javax/naming/StringRefAddr.java \
-javax/naming/ldap/InitialLdapContext.java \
-javax/naming/ldap/ExtendedRequest.java \
-javax/naming/ldap/Control.java \
-javax/naming/ldap/UnsolicitedNotificationListener.java \
-javax/naming/ldap/LdapReferralException.java \
-javax/naming/ldap/UnsolicitedNotificationEvent.java \
-javax/naming/ldap/HasControls.java \
-javax/naming/ldap/LdapContext.java \
-javax/naming/ldap/ExtendedResponse.java \
-javax/naming/ldap/UnsolicitedNotification.java \
-javax/naming/ldap/ControlFactory.java \
-javax/naming/OperationNotSupportedException.java \
-javax/naming/ReferralException.java \
-javax/naming/LimitExceededException.java \
-javax/naming/Reference.java \
-javax/naming/NameParser.java \
-javax/naming/NameClassPair.java \
-javax/naming/RefAddr.java \
-javax/naming/CompositeName.java \
-javax/naming/Name.java \
-javax/security/cert/CertificateNotYetValidException.java \
-javax/security/cert/Certificate.java \
-javax/security/cert/X509Certificate.java \
-javax/security/cert/X509CertBridge.java \
-javax/security/cert/CertificateEncodingException.java \
-javax/security/cert/CertificateExpiredException.java \
-javax/security/cert/CertificateException.java \
-javax/security/cert/CertificateParsingException.java \
-javax/security/auth/Destroyable.java \
-javax/security/auth/x500/X500PrivateCredential.java \
-javax/security/auth/x500/X500Principal.java \
-javax/security/auth/spi/LoginModule.java \
-javax/security/auth/DestroyFailedException.java \
-javax/security/auth/SubjectDomainCombiner.java \
-javax/security/auth/AuthPermission.java \
-javax/security/auth/login/CredentialExpiredException.java \
-javax/security/auth/login/NullConfiguration.java \
-javax/security/auth/login/AccountExpiredException.java \
-javax/security/auth/login/LoginException.java \
-javax/security/auth/login/AppConfigurationEntry.java \
-javax/security/auth/login/Configuration.java \
-javax/security/auth/login/LoginContext.java \
-javax/security/auth/login/FailedLoginException.java \
-javax/security/auth/PrivateCredentialPermission.java \
-javax/security/auth/Subject.java \
-javax/security/auth/Policy.java \
-javax/security/auth/Refreshable.java \
-javax/security/auth/callback/TextInputCallback.java \
-javax/security/auth/callback/LanguageCallback.java \
-javax/security/auth/callback/TextOutputCallback.java \
-javax/security/auth/callback/UnsupportedCallbackException.java \
-javax/security/auth/callback/Callback.java \
-javax/security/auth/callback/ConfirmationCallback.java \
-javax/security/auth/callback/ChoiceCallback.java \
-javax/security/auth/callback/NameCallback.java \
-javax/security/auth/callback/PasswordCallback.java \
-javax/security/auth/callback/CallbackHandler.java \
-javax/security/auth/RefreshFailedException.java \
-javax/security/sasl/RealmCallback.java \
-javax/security/sasl/SaslClient.java \
-javax/security/sasl/RealmChoiceCallback.java \
-javax/security/sasl/AuthenticationException.java \
-javax/security/sasl/Sasl.java \
-javax/security/sasl/SaslClientFactory.java \
-javax/security/sasl/AuthorizeCallback.java \
-javax/security/sasl/SaslServerFactory.java \
-javax/security/sasl/SaslException.java \
-javax/security/sasl/SaslServer.java \
-javax/transaction/TransactionRolledbackException.java \
-javax/transaction/Synchronization.java \
-javax/transaction/TransactionRequiredException.java \
-javax/transaction/RollbackException.java \
-javax/transaction/Status.java \
-javax/transaction/HeuristicMixedException.java \
-javax/transaction/HeuristicRollbackException.java \
-javax/transaction/SystemException.java \
-javax/transaction/UserTransaction.java \
-javax/transaction/NotSupportedException.java \
-javax/transaction/HeuristicCommitException.java \
-javax/transaction/Transaction.java \
-javax/transaction/TransactionManager.java \
-javax/transaction/InvalidTransactionException.java \
-javax/transaction/xa/XAException.java \
-javax/transaction/xa/XAResource.java \
-javax/transaction/xa/Xid.java \
-javax/accessibility/AccessibleValue.java \
-javax/accessibility/AccessibleBundle.java \
-javax/accessibility/AccessibleContext.java \
-javax/accessibility/AccessibleRelationSet.java \
-javax/accessibility/Accessible.java \
-javax/accessibility/AccessibleTableModelChange.java \
-javax/accessibility/AccessibleState.java \
-javax/accessibility/AccessibleIcon.java \
-javax/accessibility/AccessibleHypertext.java \
-javax/accessibility/AccessibleComponent.java \
-javax/accessibility/AccessibleText.java \
-javax/accessibility/AccessibleRole.java \
-javax/accessibility/AccessibleEditableText.java \
-javax/accessibility/AccessibleRelation.java \
-javax/accessibility/AccessibleTable.java \
-javax/accessibility/AccessibleStateSet.java \
-javax/accessibility/AccessibleSelection.java \
-javax/accessibility/AccessibleExtendedTable.java \
-javax/accessibility/AccessibleResourceBundle.java \
-javax/accessibility/AccessibleExtendedComponent.java \
-javax/accessibility/AccessibleHyperlink.java \
-javax/accessibility/AccessibleKeyBinding.java \
-javax/accessibility/AccessibleAction.java \
-javax/sql/ConnectionEventListener.java \
-javax/sql/RowSetEvent.java \
-javax/sql/ConnectionPoolDataSource.java \
-javax/sql/RowSetWriter.java \
-javax/sql/XAConnection.java \
-javax/sql/RowSet.java \
-javax/sql/DataSource.java \
-javax/sql/RowSetInternal.java \
-javax/sql/RowSetReader.java \
-javax/sql/RowSetMetaData.java \
-javax/sql/PooledConnection.java \
-javax/sql/XADataSource.java \
-javax/sql/RowSetListener.java \
-javax/sql/ConnectionEvent.java \
-javax/crypto/Cipher.java \
-javax/crypto/IllegalBlockSizeException.java \
-javax/crypto/MacSpi.java \
-javax/crypto/SecretKeyFactorySpi.java \
-javax/crypto/ShortBufferException.java \
-javax/crypto/KeyAgreement.java \
-javax/crypto/ExemptionMechanism.java \
-javax/crypto/CipherOutputStream.java \
-javax/crypto/SealedObject.java \
-javax/crypto/NullCipher.java \
-javax/crypto/KeyAgreementSpi.java \
-javax/crypto/SecretKeyFactory.java \
-javax/crypto/SecretKey.java \
-javax/crypto/NullCipherImpl.java \
-javax/crypto/spec/DESKeySpec.java \
-javax/crypto/spec/DHPrivateKeySpec.java \
-javax/crypto/spec/DHParameterSpec.java \
-javax/crypto/spec/PBEParameterSpec.java \
-javax/crypto/spec/DESedeKeySpec.java \
-javax/crypto/spec/DHGenParameterSpec.java \
-javax/crypto/spec/DHPublicKeySpec.java \
-javax/crypto/spec/PBEKeySpec.java \
-javax/crypto/spec/RC5ParameterSpec.java \
-javax/crypto/spec/RC2ParameterSpec.java \
-javax/crypto/spec/IvParameterSpec.java \
-javax/crypto/spec/SecretKeySpec.java \
-javax/crypto/interfaces/DHPublicKey.java \
-javax/crypto/interfaces/DHKey.java \
-javax/crypto/interfaces/DHPrivateKey.java \
-javax/crypto/interfaces/PBEKey.java \
-javax/crypto/NoSuchPaddingException.java \
-javax/crypto/KeyGeneratorSpi.java \
-javax/crypto/BadPaddingException.java \
-javax/crypto/CipherSpi.java \
-javax/crypto/KeyGenerator.java \
-javax/crypto/CipherInputStream.java \
-javax/crypto/ExemptionMechanismException.java \
-javax/crypto/ExemptionMechanismSpi.java \
-javax/crypto/EncryptedPrivateKeyInfo.java \
-javax/crypto/Mac.java
-
-org_source_files = \
-org/ietf/jgss/GSSManager.java \
-org/ietf/jgss/GSSException.java \
-org/ietf/jgss/MessageProp.java \
-org/ietf/jgss/GSSName.java \
-org/ietf/jgss/GSSContext.java \
-org/ietf/jgss/Oid.java \
-org/ietf/jgss/GSSCredential.java \
-org/ietf/jgss/ChannelBinding.java
-
-gnu_xml_source_files = \
-gnu/xml/xpath/EqualityExpr.java \
-gnu/xml/xpath/NumberFunction.java \
-gnu/xml/xpath/StringLengthFunction.java \
-gnu/xml/xpath/NameFunction.java \
-gnu/xml/xpath/SumFunction.java \
-gnu/xml/xpath/Pattern.java \
-gnu/xml/xpath/StringFunction.java \
-gnu/xml/xpath/NegativeExpr.java \
-gnu/xml/xpath/UnionExpr.java \
-gnu/xml/xpath/SubstringFunction.java \
-gnu/xml/xpath/Expr.java \
-gnu/xml/xpath/XPathFactoryImpl.java \
-gnu/xml/xpath/NormalizeSpaceFunction.java \
-gnu/xml/xpath/Constant.java \
-gnu/xml/xpath/Predicate.java \
-gnu/xml/xpath/Path.java \
-gnu/xml/xpath/OrExpr.java \
-gnu/xml/xpath/LangFunction.java \
-gnu/xml/xpath/StartsWithFunction.java \
-gnu/xml/xpath/SubstringAfterFunction.java \
-gnu/xml/xpath/FloorFunction.java \
-gnu/xml/xpath/NotFunction.java \
-gnu/xml/xpath/Root.java \
-gnu/xml/xpath/PositionFunction.java \
-gnu/xml/xpath/VariableReference.java \
-gnu/xml/xpath/DocumentOrderComparator.java \
-gnu/xml/xpath/LocalNameFunction.java \
-gnu/xml/xpath/NamespaceUriFunction.java \
-gnu/xml/xpath/TranslateFunction.java \
-gnu/xml/xpath/FalseFunction.java \
-gnu/xml/xpath/AndExpr.java \
-gnu/xml/xpath/XPathParser.java \
-gnu/xml/xpath/NamespaceTest.java \
-gnu/xml/xpath/ConcatFunction.java \
-gnu/xml/xpath/NameTest.java \
-gnu/xml/xpath/CountFunction.java \
-gnu/xml/xpath/IdFunction.java \
-gnu/xml/xpath/LastFunction.java \
-gnu/xml/xpath/XPathTokenizer.java \
-gnu/xml/xpath/Steps.java \
-gnu/xml/xpath/TrueFunction.java \
-gnu/xml/xpath/BooleanFunction.java \
-gnu/xml/xpath/ParenthesizedExpr.java \
-gnu/xml/xpath/XPathImpl.java \
-gnu/xml/xpath/Selector.java \
-gnu/xml/xpath/RoundFunction.java \
-gnu/xml/xpath/SubstringBeforeFunction.java \
-gnu/xml/xpath/Function.java \
-gnu/xml/xpath/CeilingFunction.java \
-gnu/xml/xpath/RelationalExpr.java \
-gnu/xml/xpath/FunctionCall.java \
-gnu/xml/xpath/NodeTypeTest.java \
-gnu/xml/xpath/ArithmeticExpr.java \
-gnu/xml/xpath/Test.java \
-gnu/xml/xpath/ContainsFunction.java \
-gnu/xml/pipeline/EventFilter.java \
-gnu/xml/pipeline/NSFilter.java \
-gnu/xml/pipeline/XsltFilter.java \
-gnu/xml/pipeline/ValidationConsumer.java \
-gnu/xml/pipeline/PipelineFactory.java \
-gnu/xml/pipeline/TextConsumer.java \
-gnu/xml/pipeline/LinkFilter.java \
-gnu/xml/pipeline/TeeConsumer.java \
-gnu/xml/pipeline/DomConsumer.java \
-gnu/xml/pipeline/EventConsumer.java \
-gnu/xml/pipeline/WellFormednessFilter.java \
-gnu/xml/pipeline/XIncludeFilter.java \
-gnu/xml/pipeline/CallFilter.java \
-gnu/xml/aelfred2/XmlParser.java \
-gnu/xml/aelfred2/XmlReader.java \
-gnu/xml/aelfred2/JAXPFactory.java \
-gnu/xml/aelfred2/ContentHandler2.java \
-gnu/xml/aelfred2/SAXDriver.java \
-gnu/xml/util/XCat.java \
-gnu/xml/util/DomParser.java \
-gnu/xml/util/XMLWriter.java \
-gnu/xml/util/Resolver.java \
-gnu/xml/util/DoParse.java \
-gnu/xml/util/XHTMLWriter.java \
-gnu/xml/util/SAXNullTransformerFactory.java \
-gnu/xml/dom/DomXPathNSResolver.java \
-gnu/xml/dom/ls/FilteredSAXEventSink.java \
-gnu/xml/dom/ls/DomLSException.java \
-gnu/xml/dom/ls/DomLSSerializer.java \
-gnu/xml/dom/ls/DomLSInput.java \
-gnu/xml/dom/ls/DomLSOutput.java \
-gnu/xml/dom/ls/SAXEventSink.java \
-gnu/xml/dom/ls/DomLSParser.java \
-gnu/xml/dom/ls/ReaderInputStream.java \
-gnu/xml/dom/ls/WriterOutputStream.java \
-gnu/xml/dom/DomElement.java \
-gnu/xml/dom/DomNsNode.java \
-gnu/xml/dom/DomAttr.java \
-gnu/xml/dom/DTDAttributeTypeInfo.java \
-gnu/xml/dom/DomDocumentBuilder.java \
-gnu/xml/dom/DTDElementTypeInfo.java \
-gnu/xml/dom/DomDocument.java \
-gnu/xml/dom/DomXPathExpression.java \
-gnu/xml/dom/DomDocumentConfiguration.java \
-gnu/xml/dom/DomDocumentFragment.java \
-gnu/xml/dom/DomProcessingInstruction.java \
-gnu/xml/dom/Consumer.java \
-gnu/xml/dom/DomComment.java \
-gnu/xml/dom/DomCharacterData.java \
-gnu/xml/dom/DomExtern.java \
-gnu/xml/dom/DomEntityReference.java \
-gnu/xml/dom/DomNamedNodeMap.java \
-gnu/xml/dom/ImplementationList.java \
-gnu/xml/dom/ImplementationSource.java \
-gnu/xml/dom/DomImpl.java \
-gnu/xml/dom/DomDoctype.java \
-gnu/xml/dom/DomNode.java \
-gnu/xml/dom/DomXPathResult.java \
-gnu/xml/dom/DomDocumentBuilderFactory.java \
-gnu/xml/dom/DomText.java \
-gnu/xml/dom/DomNSResolverContext.java \
-gnu/xml/dom/DomNodeIterator.java \
-gnu/xml/dom/DomNotation.java \
-gnu/xml/dom/JAXPFactory.java \
-gnu/xml/dom/DomIterator.java \
-gnu/xml/dom/DomEvent.java \
-gnu/xml/dom/DomEntity.java \
-gnu/xml/dom/DomCDATASection.java \
-gnu/xml/dom/DomDOMException.java \
-gnu/xml/dom/html2/DomHTMLAnchorElement.java \
-gnu/xml/dom/html2/DomHTMLAppletElement.java \
-gnu/xml/dom/html2/DomHTMLAreaElement.java \
-gnu/xml/dom/html2/DomHTMLBaseElement.java \
-gnu/xml/dom/html2/DomHTMLBaseFontElement.java \
-gnu/xml/dom/html2/DomHTMLBodyElement.java \
-gnu/xml/dom/html2/DomHTMLBRElement.java \
-gnu/xml/dom/html2/DomHTMLButtonElement.java \
-gnu/xml/dom/html2/DomHTMLCollection.java \
-gnu/xml/dom/html2/DomHTMLDirectoryElement.java \
-gnu/xml/dom/html2/DomHTMLDivElement.java \
-gnu/xml/dom/html2/DomHTMLDListElement.java \
-gnu/xml/dom/html2/DomHTMLDocument.java \
-gnu/xml/dom/html2/DomHTMLElement.java \
-gnu/xml/dom/html2/DomHTMLFieldSetElement.java \
-gnu/xml/dom/html2/DomHTMLFontElement.java \
-gnu/xml/dom/html2/DomHTMLFormElement.java \
-gnu/xml/dom/html2/DomHTMLFrameElement.java \
-gnu/xml/dom/html2/DomHTMLFrameSetElement.java \
-gnu/xml/dom/html2/DomHTMLHeadElement.java \
-gnu/xml/dom/html2/DomHTMLHeadingElement.java \
-gnu/xml/dom/html2/DomHTMLHRElement.java \
-gnu/xml/dom/html2/DomHTMLHtmlElement.java \
-gnu/xml/dom/html2/DomHTMLIFrameElement.java \
-gnu/xml/dom/html2/DomHTMLImageElement.java \
-gnu/xml/dom/html2/DomHTMLImpl.java \
-gnu/xml/dom/html2/DomHTMLInputElement.java \
-gnu/xml/dom/html2/DomHTMLIsIndexElement.java \
-gnu/xml/dom/html2/DomHTMLLabelElement.java \
-gnu/xml/dom/html2/DomHTMLLegendElement.java \
-gnu/xml/dom/html2/DomHTMLLIElement.java \
-gnu/xml/dom/html2/DomHTMLLinkElement.java \
-gnu/xml/dom/html2/DomHTMLMapElement.java \
-gnu/xml/dom/html2/DomHTMLMenuElement.java \
-gnu/xml/dom/html2/DomHTMLMetaElement.java \
-gnu/xml/dom/html2/DomHTMLModElement.java \
-gnu/xml/dom/html2/DomHTMLObjectElement.java \
-gnu/xml/dom/html2/DomHTMLOListElement.java \
-gnu/xml/dom/html2/DomHTMLOptGroupElement.java \
-gnu/xml/dom/html2/DomHTMLOptionElement.java \
-gnu/xml/dom/html2/DomHTMLParagraphElement.java \
-gnu/xml/dom/html2/DomHTMLParamElement.java \
-gnu/xml/dom/html2/DomHTMLParser.java \
-gnu/xml/dom/html2/DomHTMLPreElement.java \
-gnu/xml/dom/html2/DomHTMLQuoteElement.java \
-gnu/xml/dom/html2/DomHTMLScriptElement.java \
-gnu/xml/dom/html2/DomHTMLSelectElement.java \
-gnu/xml/dom/html2/DomHTMLStyleElement.java \
-gnu/xml/dom/html2/DomHTMLTableCaptionElement.java \
-gnu/xml/dom/html2/DomHTMLTableCellElement.java \
-gnu/xml/dom/html2/DomHTMLTableColElement.java \
-gnu/xml/dom/html2/DomHTMLTableElement.java \
-gnu/xml/dom/html2/DomHTMLTableRowElement.java \
-gnu/xml/dom/html2/DomHTMLTableSectionElement.java \
-gnu/xml/dom/html2/DomHTMLTextAreaElement.java \
-gnu/xml/dom/html2/DomHTMLTitleElement.java \
-gnu/xml/dom/html2/DomHTMLUListElement.java \
-gnu/xml/transform/GenerateIdFunction.java \
-gnu/xml/transform/FormatNumberFunction.java \
-gnu/xml/transform/ValueOfNode.java \
-gnu/xml/transform/ApplyImportsNode.java \
-gnu/xml/transform/WithParam.java \
-gnu/xml/transform/DocumentFunction.java \
-gnu/xml/transform/SAXSerializer.java \
-gnu/xml/transform/FunctionAvailableFunction.java \
-gnu/xml/transform/ElementAvailableFunction.java \
-gnu/xml/transform/IfNode.java \
-gnu/xml/transform/ApplyTemplatesNode.java \
-gnu/xml/transform/SortKey.java \
-gnu/xml/transform/Key.java \
-gnu/xml/transform/ElementNode.java \
-gnu/xml/transform/CurrentFunction.java \
-gnu/xml/transform/XSLComparator.java \
-gnu/xml/transform/CallTemplateNode.java \
-gnu/xml/transform/TemplatesImpl.java \
-gnu/xml/transform/ChooseNode.java \
-gnu/xml/transform/NumberNode.java \
-gnu/xml/transform/CopyOfNode.java \
-gnu/xml/transform/ParameterNode.java \
-gnu/xml/transform/TransformerFactoryImpl.java \
-gnu/xml/transform/TextNode.java \
-gnu/xml/transform/CopyNode.java \
-gnu/xml/transform/SystemPropertyFunction.java \
-gnu/xml/transform/Stylesheet.java \
-gnu/xml/transform/ProcessingInstructionNode.java \
-gnu/xml/transform/UnparsedEntityUriFunction.java \
-gnu/xml/transform/URIResolverEntityResolver.java \
-gnu/xml/transform/ErrorListenerErrorHandler.java \
-gnu/xml/transform/Bindings.java \
-gnu/xml/transform/AttributeSet.java \
-gnu/xml/transform/Template.java \
-gnu/xml/transform/MessageNode.java \
-gnu/xml/transform/LiteralNode.java \
-gnu/xml/transform/StreamSerializer.java \
-gnu/xml/transform/XSLURIResolver.java \
-gnu/xml/transform/AttributeNode.java \
-gnu/xml/transform/CommentNode.java \
-gnu/xml/transform/ForEachNode.java \
-gnu/xml/transform/KeyFunction.java \
-gnu/xml/transform/TransformerImpl.java \
-gnu/xml/transform/WhenNode.java \
-gnu/xml/transform/NodeNumberNode.java \
-gnu/xml/transform/OtherwiseNode.java \
-gnu/xml/transform/AbstractNumberNode.java \
-gnu/xml/transform/TemplateNode.java \
-gnu/xml/transform/TransformerOutputProperties.java \
-gnu/xml/transform/DOMSourceLocator.java
-
-built_java_source_files = java/lang/ConcreteProcess.java \
- gnu/classpath/Configuration.java
-
-core_java_source_files = \
-java/lang/AbstractMethodError.java \
-java/lang/ArithmeticException.java \
-java/lang/ArrayIndexOutOfBoundsException.java \
-java/lang/ArrayStoreException.java \
-java/lang/AssertionError.java \
-java/lang/Boolean.java \
-java/lang/Byte.java \
-java/lang/Character.java \
-java/lang/CharSequence.java \
-java/lang/ClassCastException.java \
-java/lang/ClassCircularityError.java \
-java/lang/ClassFormatError.java \
-java/lang/ClassLoader.java \
-java/lang/ClassNotFoundException.java \
-java/lang/CloneNotSupportedException.java \
-java/lang/Cloneable.java \
-java/lang/Comparable.java \
-java/lang/Compiler.java \
-java/lang/Double.java \
-java/lang/Error.java \
-java/lang/Exception.java \
-java/lang/ExceptionInInitializerError.java \
-java/lang/Float.java \
-java/lang/IllegalAccessError.java \
-java/lang/IllegalAccessException.java \
-java/lang/IllegalArgumentException.java \
-java/lang/IllegalMonitorStateException.java \
-java/lang/IllegalStateException.java \
-java/lang/IllegalThreadStateException.java \
-java/lang/IncompatibleClassChangeError.java \
-java/lang/IndexOutOfBoundsException.java \
-java/lang/InheritableThreadLocal.java \
-java/lang/InstantiationError.java \
-java/lang/InstantiationException.java \
-java/lang/Integer.java \
-java/lang/InternalError.java \
-java/lang/InterruptedException.java \
-java/lang/LinkageError.java \
-java/lang/Long.java \
-java/lang/Math.java \
-java/lang/NegativeArraySizeException.java \
-java/lang/NoClassDefFoundError.java \
-java/lang/NoSuchFieldError.java \
-java/lang/NoSuchFieldException.java \
-java/lang/NoSuchMethodError.java \
-java/lang/NoSuchMethodException.java \
-java/lang/NullPointerException.java \
-java/lang/Number.java \
-java/lang/NumberFormatException.java \
-java/lang/OutOfMemoryError.java \
-java/lang/Package.java \
-java/lang/Process.java \
-java/lang/Runnable.java \
-java/lang/Runtime.java \
-java/lang/RuntimeException.java \
-java/lang/RuntimePermission.java \
-java/lang/SecurityException.java \
-java/lang/SecurityManager.java \
-java/lang/Short.java \
-java/lang/StackOverflowError.java \
-java/lang/StackTraceElement.java \
-java/lang/StrictMath.java \
-java/lang/String.java \
-java/lang/StringBuffer.java \
-java/lang/StringBuilder.java \
-java/lang/StringIndexOutOfBoundsException.java \
-java/lang/System.java \
-java/lang/Thread.java \
-java/lang/ThreadDeath.java \
-java/lang/ThreadGroup.java \
-java/lang/ThreadLocal.java \
-java/lang/Throwable.java \
-java/lang/UnknownError.java \
-java/lang/UnsatisfiedLinkError.java \
-java/lang/UnsupportedClassVersionError.java \
-java/lang/UnsupportedOperationException.java \
-java/lang/VerifyError.java \
-java/lang/VirtualMachineError.java \
-java/lang/VMClassLoader.java \
-java/lang/VMCompiler.java \
-java/lang/VMSecurityManager.java \
-java/lang/VMThrowable.java \
-java/lang/Void.java \
-java/io/BufferedInputStream.java \
-java/io/BufferedOutputStream.java \
-java/io/BufferedReader.java \
-java/io/BufferedWriter.java \
-java/io/ByteArrayInputStream.java \
-java/io/ByteArrayOutputStream.java \
-java/io/CharArrayReader.java \
-java/io/CharArrayWriter.java \
-java/io/CharConversionException.java \
-java/io/DataInput.java \
-java/io/DataInputStream.java \
-java/io/DataOutput.java \
-java/io/DataOutputStream.java \
-java/io/EOFException.java \
-java/io/Externalizable.java \
-java/io/File.java \
-java/io/FileDescriptor.java \
-java/io/FileFilter.java \
-java/io/FileInputStream.java \
-java/io/FileNotFoundException.java \
-java/io/FileOutputStream.java \
-java/io/FilePermission.java \
-java/io/FileReader.java \
-java/io/FileWriter.java \
-java/io/FilenameFilter.java \
-java/io/FilterInputStream.java \
-java/io/FilterOutputStream.java \
-java/io/FilterReader.java \
-java/io/FilterWriter.java \
-java/io/IOException.java \
-java/io/InputStream.java \
-java/io/InputStreamReader.java \
-java/io/InterruptedIOException.java \
-java/io/InvalidClassException.java \
-java/io/InvalidObjectException.java \
-java/io/LineNumberInputStream.java \
-java/io/LineNumberReader.java \
-java/io/NotActiveException.java \
-java/io/NotSerializableException.java \
-java/io/ObjectInput.java \
-java/io/ObjectInputStream.java \
-java/io/ObjectInputValidation.java \
-java/io/ObjectOutput.java \
-java/io/ObjectOutputStream.java \
-java/io/ObjectStreamClass.java \
-java/io/ObjectStreamConstants.java \
-java/io/ObjectStreamException.java \
-java/io/ObjectStreamField.java \
-java/io/OptionalDataException.java \
-java/io/OutputStream.java \
-java/io/OutputStreamWriter.java \
-java/io/PipedInputStream.java \
-java/io/PipedOutputStream.java \
-java/io/PipedReader.java \
-java/io/PipedWriter.java \
-java/io/PrintStream.java \
-java/io/PrintWriter.java \
-java/io/PushbackInputStream.java \
-java/io/PushbackReader.java \
-java/io/RandomAccessFile.java \
-java/io/Reader.java \
-java/io/SequenceInputStream.java \
-java/io/Serializable.java \
-java/io/SerializablePermission.java \
-java/io/StreamCorruptedException.java \
-java/io/StreamTokenizer.java \
-java/io/StringBufferInputStream.java \
-java/io/StringReader.java \
-java/io/StringWriter.java \
-java/io/SyncFailedException.java \
-java/io/UTFDataFormatException.java \
-java/io/UnsupportedEncodingException.java \
-java/io/VMObjectStreamClass.java \
-java/io/WriteAbortedException.java \
-java/io/Writer.java \
-java/util/AbstractCollection.java \
-java/util/AbstractList.java \
-java/util/AbstractMap.java \
-java/util/AbstractSequentialList.java \
-java/util/AbstractSet.java \
-java/util/ArrayList.java \
-java/util/Arrays.java \
-java/util/BitSet.java \
-java/util/Calendar.java \
-java/util/Collection.java \
-java/util/Collections.java \
-java/util/Comparator.java \
-java/util/ConcurrentModificationException.java \
-java/util/Currency.java \
-java/util/Date.java \
-java/util/Dictionary.java \
-java/util/EmptyStackException.java \
-java/util/Enumeration.java \
-java/util/EventListener.java \
-java/util/EventListenerProxy.java \
-java/util/EventObject.java \
-java/util/GregorianCalendar.java \
-java/util/HashMap.java \
-java/util/HashSet.java \
-java/util/Hashtable.java \
-java/util/IdentityHashMap.java \
-java/util/Iterator.java \
-java/util/LinkedList.java \
-java/util/LinkedHashMap.java \
-java/util/LinkedHashSet.java \
-java/util/List.java \
-java/util/ListIterator.java \
-java/util/ListResourceBundle.java \
-java/util/Locale.java \
-java/util/Map.java \
-java/util/MissingResourceException.java \
-java/util/NoSuchElementException.java \
-java/util/Observable.java \
-java/util/Observer.java \
-java/util/Properties.java \
-java/util/PropertyPermission.java \
-java/util/PropertyPermissionCollection.java \
-java/util/PropertyResourceBundle.java \
-java/util/Random.java \
-java/util/RandomAccess.java \
-java/util/ResourceBundle.java \
-java/util/Set.java \
-java/util/SimpleTimeZone.java \
-java/util/SortedMap.java \
-java/util/SortedSet.java \
-java/util/Stack.java \
-java/util/StringTokenizer.java \
-java/util/TimeZone.java \
-java/util/Timer.java \
-java/util/TimerTask.java \
-java/util/TreeMap.java \
-java/util/TreeSet.java \
-java/util/TooManyListenersException.java \
-java/util/Vector.java \
-java/util/VMTimeZone.java \
-java/util/WeakHashMap.java \
-java/util/logging/ConsoleHandler.java \
-java/util/logging/ErrorManager.java \
-java/util/logging/FileHandler.java \
-java/util/logging/Filter.java \
-java/util/logging/Formatter.java \
-java/util/logging/Handler.java \
-java/util/logging/Level.java \
-java/util/logging/Logger.java \
-java/util/logging/LoggingPermission.java \
-java/util/logging/LogManager.java \
-java/util/logging/LogRecord.java \
-java/util/logging/MemoryHandler.java \
-java/util/logging/SimpleFormatter.java \
-java/util/logging/SocketHandler.java \
-java/util/logging/StreamHandler.java \
-java/util/logging/XMLFormatter.java \
-java/util/prefs/NodeChangeListener.java \
-java/util/prefs/Preferences.java \
-java/util/prefs/PreferenceChangeListener.java \
-java/util/prefs/NodeChangeEvent.java \
-java/util/prefs/InvalidPreferencesFormatException.java \
-java/util/prefs/AbstractPreferences.java \
-java/util/prefs/BackingStoreException.java \
-java/util/prefs/PreferenceChangeEvent.java \
-java/util/prefs/PreferencesFactory.java \
-java/util/regex/Matcher.java \
-java/util/regex/Pattern.java \
-java/util/regex/PatternSyntaxException.java
-
-ordinary_java_source_files = $(core_java_source_files) \
-gnu/classpath/ServiceFactory.java \
-gnu/classpath/ServiceProviderLoadingAction.java \
-gnu/classpath/SystemProperties.java \
-gnu/gcj/Core.java \
-gnu/gcj/RawData.java \
-gnu/gcj/RawDataManaged.java \
+gnu_gcj_convert_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_gcj_convert_source_files)))
+gnu_gcj_io_source_files = \
gnu/gcj/io/DefaultMimeTypes.java \
gnu/gcj/io/MimeTypes.java \
-gnu/gcj/io/SimpleSHSStream.java \
+gnu/gcj/io/SimpleSHSStream.java
+
+gnu_gcj_io_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_gcj_io_source_files)))
+gnu_gcj_runtime_source_files = \
gnu/gcj/runtime/BootClassLoader.java \
gnu/gcj/runtime/ExtensionClassLoader.java \
gnu/gcj/runtime/FileDeleter.java \
@@ -3030,21 +856,181 @@ gnu/gcj/runtime/PersistentByteMap.java \
gnu/gcj/runtime/SharedLibHelper.java \
gnu/gcj/runtime/SharedLibLoader.java \
gnu/gcj/runtime/StringBuffer.java \
-gnu/gcj/runtime/SystemClassLoader.java \
-gnu/gcj/util/Debug.java \
-gnu/java/io/ASN1ParsingException.java \
-gnu/java/io/Base64InputStream.java \
-gnu/java/io/ClassLoaderObjectInputStream.java \
-gnu/java/io/NullOutputStream.java \
-gnu/java/io/ObjectIdentityWrapper.java \
-gnu/java/lang/ArrayHelper.java \
-gnu/java/lang/ClassHelper.java \
-gnu/java/lang/MainThread.java \
-gnu/java/lang/reflect/TypeSignature.java \
+gnu/gcj/runtime/SystemClassLoader.java
+
+gnu_gcj_runtime_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_gcj_runtime_source_files)))
+gnu_gcj_util_source_files = \
+gnu/gcj/util/Debug.java
+
+gnu_gcj_util_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_gcj_util_source_files)))
+gnu_java_awt_source_files = \
+classpath/gnu/java/awt/AWTUtilities.java \
+classpath/gnu/java/awt/BitMaskExtent.java \
+classpath/gnu/java/awt/BitwiseXORComposite.java \
+classpath/gnu/java/awt/Buffers.java \
+classpath/gnu/java/awt/ClasspathToolkit.java \
+classpath/gnu/java/awt/ComponentDataBlitOp.java \
+classpath/gnu/java/awt/EmbeddedWindow.java \
+classpath/gnu/java/awt/EventModifier.java \
+classpath/gnu/java/awt/FocusManager.java \
+classpath/gnu/java/awt/GradientPaintContext.java
+
+gnu_java_awt_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_source_files)))
+gnu_java_awt_color_source_files = \
+classpath/gnu/java/awt/color/CieXyzConverter.java \
+classpath/gnu/java/awt/color/ClutProfileConverter.java \
+classpath/gnu/java/awt/color/ColorLookUpTable.java \
+classpath/gnu/java/awt/color/ColorSpaceConverter.java \
+classpath/gnu/java/awt/color/GrayProfileConverter.java \
+classpath/gnu/java/awt/color/GrayScaleConverter.java \
+classpath/gnu/java/awt/color/LinearRGBConverter.java \
+classpath/gnu/java/awt/color/ProfileHeader.java \
+classpath/gnu/java/awt/color/PyccConverter.java \
+classpath/gnu/java/awt/color/RgbProfileConverter.java \
+classpath/gnu/java/awt/color/SrgbConverter.java \
+classpath/gnu/java/awt/color/TagEntry.java \
+classpath/gnu/java/awt/color/ToneReproductionCurve.java
+
+gnu_java_awt_color_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_color_source_files)))
+gnu_java_awt_image_source_files = \
+classpath/gnu/java/awt/image/ImageDecoder.java \
+classpath/gnu/java/awt/image/XBMDecoder.java
+
+gnu_java_awt_image_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_image_source_files)))
+gnu_java_awt_peer_source_files = \
+classpath/gnu/java/awt/peer/ClasspathFontPeer.java \
+classpath/gnu/java/awt/peer/ClasspathTextLayoutPeer.java \
+classpath/gnu/java/awt/peer/EmbeddedWindowPeer.java \
+classpath/gnu/java/awt/peer/GLightweightPeer.java
+
+gnu_java_awt_peer_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_peer_source_files)))
+gnu_java_awt_peer_gtk_source_files = \
+classpath/gnu/java/awt/peer/gtk/GThreadMutex.java \
+classpath/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java \
+classpath/gnu/java/awt/peer/gtk/GdkFontMetrics.java \
+classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java \
+classpath/gnu/java/awt/peer/gtk/GdkGlyphVector.java \
+classpath/gnu/java/awt/peer/gtk/GdkGraphics.java \
+classpath/gnu/java/awt/peer/gtk/GdkGraphics2D.java \
+classpath/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java \
+classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java \
+classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java \
+classpath/gnu/java/awt/peer/gtk/GdkRobotPeer.java \
+classpath/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java \
+classpath/gnu/java/awt/peer/gtk/GdkTextLayout.java \
+classpath/gnu/java/awt/peer/gtk/GtkButtonPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkCanvasPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkClipboard.java \
+classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkContainerPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkDialogPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkFontPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkGenericPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkImage.java \
+classpath/gnu/java/awt/peer/gtk/GtkImageConsumer.java \
+classpath/gnu/java/awt/peer/gtk/GtkLabelPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkListPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkMenuPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkPanelPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkToolkit.java \
+classpath/gnu/java/awt/peer/gtk/GtkVolatileImage.java \
+classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java
+
+gnu_java_beans_source_files = \
+classpath/gnu/java/beans/BeanInfoEmbryo.java \
+classpath/gnu/java/beans/DummyAppletContext.java \
+classpath/gnu/java/beans/DummyAppletStub.java \
+classpath/gnu/java/beans/ExplicitBeanInfo.java \
+classpath/gnu/java/beans/IntrospectionIncubator.java \
+classpath/gnu/java/beans/decoder/AbstractContext.java \
+classpath/gnu/java/beans/decoder/AbstractCreatableObjectContext.java \
+classpath/gnu/java/beans/decoder/AbstractElementHandler.java \
+classpath/gnu/java/beans/decoder/AbstractObjectContext.java \
+classpath/gnu/java/beans/decoder/ArrayContext.java \
+classpath/gnu/java/beans/decoder/ArrayHandler.java \
+classpath/gnu/java/beans/decoder/AssemblyException.java \
+classpath/gnu/java/beans/decoder/BooleanHandler.java \
+classpath/gnu/java/beans/decoder/ByteHandler.java \
+classpath/gnu/java/beans/decoder/CharHandler.java \
+classpath/gnu/java/beans/decoder/ClassHandler.java \
+classpath/gnu/java/beans/decoder/ConstructorContext.java \
+classpath/gnu/java/beans/decoder/Context.java \
+classpath/gnu/java/beans/decoder/DecoderContext.java \
+classpath/gnu/java/beans/decoder/DefaultExceptionListener.java \
+classpath/gnu/java/beans/decoder/DoubleHandler.java \
+classpath/gnu/java/beans/decoder/DummyContext.java \
+classpath/gnu/java/beans/decoder/DummyHandler.java \
+classpath/gnu/java/beans/decoder/ElementHandler.java \
+classpath/gnu/java/beans/decoder/FloatHandler.java \
+classpath/gnu/java/beans/decoder/GrowableArrayContext.java \
+classpath/gnu/java/beans/decoder/IndexContext.java \
+classpath/gnu/java/beans/decoder/IntHandler.java \
+classpath/gnu/java/beans/decoder/JavaHandler.java \
+classpath/gnu/java/beans/decoder/LongHandler.java \
+classpath/gnu/java/beans/decoder/MethodContext.java \
+classpath/gnu/java/beans/decoder/MethodFinder.java \
+classpath/gnu/java/beans/decoder/NullHandler.java \
+classpath/gnu/java/beans/decoder/ObjectContext.java \
+classpath/gnu/java/beans/decoder/ObjectHandler.java \
+classpath/gnu/java/beans/decoder/PersistenceParser.java \
+classpath/gnu/java/beans/decoder/PropertyContext.java \
+classpath/gnu/java/beans/decoder/ShortHandler.java \
+classpath/gnu/java/beans/decoder/SimpleHandler.java \
+classpath/gnu/java/beans/decoder/StaticMethodContext.java \
+classpath/gnu/java/beans/decoder/StringHandler.java \
+classpath/gnu/java/beans/decoder/VoidHandler.java \
+classpath/gnu/java/beans/editors/ColorEditor.java \
+classpath/gnu/java/beans/editors/FontEditor.java \
+classpath/gnu/java/beans/editors/NativeBooleanEditor.java \
+classpath/gnu/java/beans/editors/NativeByteEditor.java \
+classpath/gnu/java/beans/editors/NativeDoubleEditor.java \
+classpath/gnu/java/beans/editors/NativeFloatEditor.java \
+classpath/gnu/java/beans/editors/NativeIntEditor.java \
+classpath/gnu/java/beans/editors/NativeLongEditor.java \
+classpath/gnu/java/beans/editors/NativeShortEditor.java \
+classpath/gnu/java/beans/editors/StringEditor.java
+
+gnu_java_io_source_files = \
+classpath/gnu/java/io/ASN1ParsingException.java \
+classpath/gnu/java/io/Base64InputStream.java \
+classpath/gnu/java/io/ClassLoaderObjectInputStream.java \
+classpath/gnu/java/io/NullOutputStream.java \
+classpath/gnu/java/io/ObjectIdentityWrapper.java \
+classpath/gnu/java/io/PlatformHelper.java
+
+gnu_java_io_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_io_source_files)))
+gnu_java_lang_source_files = \
+classpath/gnu/java/lang/ArrayHelper.java \
+classpath/gnu/java/lang/CharData.java \
+classpath/gnu/java/lang/ClassHelper.java \
+gnu/java/lang/MainThread.java
+
+gnu_java_lang_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_lang_source_files))))
+gnu_java_lang_reflect_source_files = \
+classpath/gnu/java/lang/reflect/TypeSignature.java
+
+gnu_java_lang_reflect_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_lang_reflect_source_files)))
+gnu_java_locale_source_files = \
gnu/java/locale/Calendar.java \
gnu/java/locale/Calendar_de.java \
gnu/java/locale/Calendar_en.java \
gnu/java/locale/Calendar_nl.java \
+classpath/gnu/java/locale/LocaleHelper.java \
gnu/java/locale/LocaleInformation.java \
gnu/java/locale/LocaleInformation_af_ZA.java \
gnu/java/locale/LocaleInformation_ar_AE.java \
@@ -3179,598 +1165,3479 @@ gnu/java/locale/LocaleInformation_yi_US.java \
gnu/java/locale/LocaleInformation_zh_CN.java \
gnu/java/locale/LocaleInformation_zh_HK.java \
gnu/java/locale/LocaleInformation_zh_SG.java \
-gnu/java/locale/LocaleInformation_zh_TW.java \
-gnu/java/math/MPN.java \
-gnu/java/net/BASE64.java \
-gnu/java/net/CRLFInputStream.java \
-gnu/java/net/CRLFOutputStream.java \
+gnu/java/locale/LocaleInformation_zh_TW.java
+
+gnu_java_locale_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_locale_source_files))))
+gnu_java_math_source_files = \
+classpath/gnu/java/math/MPN.java
+
+gnu_java_math_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_math_source_files)))
+gnu_java_net_source_files = \
+classpath/gnu/java/net/BASE64.java \
+classpath/gnu/java/net/CRLFInputStream.java \
+classpath/gnu/java/net/CRLFOutputStream.java \
gnu/java/net/DefaultContentHandlerFactory.java \
-gnu/java/net/EmptyX509TrustManager.java \
-gnu/java/net/GetLocalHostAction.java \
-gnu/java/net/HeaderFieldHelper.java \
-gnu/java/net/LineInputStream.java \
+classpath/gnu/java/net/EmptyX509TrustManager.java \
+classpath/gnu/java/net/GetLocalHostAction.java \
+classpath/gnu/java/net/HeaderFieldHelper.java \
+classpath/gnu/java/net/LineInputStream.java \
gnu/java/net/PlainDatagramSocketImpl.java \
gnu/java/net/PlainSocketImpl.java \
-gnu/java/net/URLParseError.java \
+classpath/gnu/java/net/URLParseError.java \
gnu/java/net/protocol/core/Connection.java \
gnu/java/net/protocol/core/CoreInputStream.java \
gnu/java/net/protocol/core/Handler.java \
-gnu/java/net/protocol/file/Connection.java \
-gnu/java/net/protocol/file/Handler.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/CompressedInputStream.java \
-gnu/java/net/protocol/ftp/CompressedOutputStream.java \
-gnu/java/net/protocol/ftp/DTP.java \
-gnu/java/net/protocol/ftp/DTPInputStream.java \
-gnu/java/net/protocol/ftp/DTPOutputStream.java \
-gnu/java/net/protocol/ftp/FTPConnection.java \
-gnu/java/net/protocol/ftp/FTPException.java \
-gnu/java/net/protocol/ftp/FTPResponse.java \
-gnu/java/net/protocol/ftp/FTPURLConnection.java \
-gnu/java/net/protocol/ftp/Handler.java \
-gnu/java/net/protocol/ftp/PassiveModeDTP.java \
-gnu/java/net/protocol/ftp/StreamInputStream.java \
-gnu/java/net/protocol/ftp/StreamOutputStream.java \
gnu/java/net/protocol/gcjlib/Connection.java \
-gnu/java/net/protocol/gcjlib/Handler.java \
-gnu/java/net/protocol/http/Authenticator.java \
-gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java \
-gnu/java/net/protocol/http/ByteArrayResponseBodyReader.java \
-gnu/java/net/protocol/http/ChunkedInputStream.java \
-gnu/java/net/protocol/http/Cookie.java \
-gnu/java/net/protocol/http/CookieManager.java \
-gnu/java/net/protocol/http/Credentials.java \
-gnu/java/net/protocol/http/HTTPConnection.java \
-gnu/java/net/protocol/http/HTTPDateFormat.java \
-gnu/java/net/protocol/http/HTTPURLConnection.java \
-gnu/java/net/protocol/http/Handler.java \
-gnu/java/net/protocol/http/Headers.java \
-gnu/java/net/protocol/http/Request.java \
-gnu/java/net/protocol/http/RequestBodyWriter.java \
-gnu/java/net/protocol/http/Response.java \
-gnu/java/net/protocol/http/ResponseBodyReader.java \
-gnu/java/net/protocol/http/ResponseHeaderHandler.java \
-gnu/java/net/protocol/http/SimpleCookieManager.java \
-gnu/java/net/protocol/http/event/ConnectionEvent.java \
-gnu/java/net/protocol/http/event/ConnectionListener.java \
-gnu/java/net/protocol/http/event/RequestEvent.java \
-gnu/java/net/protocol/http/event/RequestListener.java \
-gnu/java/net/protocol/https/Handler.java \
+gnu/java/net/protocol/gcjlib/Handler.java
+
+gnu_java_net_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_net_source_files))))
+gnu_java_net_protocol_file_source_files = \
+gnu/java/net/protocol/file/Connection.java \
+gnu/java/net/protocol/file/Handler.java
+
+gnu_java_net_protocol_file_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_file_source_files)))
+gnu_java_net_protocol_ftp_source_files = \
+classpath/gnu/java/net/protocol/ftp/ActiveModeDTP.java \
+classpath/gnu/java/net/protocol/ftp/BlockInputStream.java \
+classpath/gnu/java/net/protocol/ftp/BlockOutputStream.java \
+classpath/gnu/java/net/protocol/ftp/CompressedInputStream.java \
+classpath/gnu/java/net/protocol/ftp/CompressedOutputStream.java \
+classpath/gnu/java/net/protocol/ftp/DTP.java \
+classpath/gnu/java/net/protocol/ftp/DTPInputStream.java \
+classpath/gnu/java/net/protocol/ftp/DTPOutputStream.java \
+classpath/gnu/java/net/protocol/ftp/FTPConnection.java \
+classpath/gnu/java/net/protocol/ftp/FTPException.java \
+classpath/gnu/java/net/protocol/ftp/FTPResponse.java \
+classpath/gnu/java/net/protocol/ftp/FTPURLConnection.java \
+classpath/gnu/java/net/protocol/ftp/Handler.java \
+classpath/gnu/java/net/protocol/ftp/PassiveModeDTP.java \
+classpath/gnu/java/net/protocol/ftp/StreamInputStream.java \
+classpath/gnu/java/net/protocol/ftp/StreamOutputStream.java
+
+gnu_java_net_protocol_ftp_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_ftp_source_files)))
+gnu_java_net_protocol_http_source_files = \
+classpath/gnu/java/net/protocol/http/Authenticator.java \
+classpath/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java \
+classpath/gnu/java/net/protocol/http/ByteArrayResponseBodyReader.java \
+classpath/gnu/java/net/protocol/http/ChunkedInputStream.java \
+classpath/gnu/java/net/protocol/http/Cookie.java \
+classpath/gnu/java/net/protocol/http/CookieManager.java \
+classpath/gnu/java/net/protocol/http/Credentials.java \
+classpath/gnu/java/net/protocol/http/HTTPConnection.java \
+classpath/gnu/java/net/protocol/http/HTTPDateFormat.java \
+classpath/gnu/java/net/protocol/http/HTTPURLConnection.java \
+classpath/gnu/java/net/protocol/http/Handler.java \
+classpath/gnu/java/net/protocol/http/Headers.java \
+classpath/gnu/java/net/protocol/http/Request.java \
+classpath/gnu/java/net/protocol/http/RequestBodyWriter.java \
+classpath/gnu/java/net/protocol/http/Response.java \
+classpath/gnu/java/net/protocol/http/ResponseBodyReader.java \
+classpath/gnu/java/net/protocol/http/ResponseHeaderHandler.java \
+classpath/gnu/java/net/protocol/http/SimpleCookieManager.java
+
+gnu_java_net_protocol_http_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_http_source_files)))
+gnu_java_net_protocol_http_event_source_files = \
+classpath/gnu/java/net/protocol/http/event/ConnectionEvent.java \
+classpath/gnu/java/net/protocol/http/event/ConnectionListener.java \
+classpath/gnu/java/net/protocol/http/event/RequestEvent.java \
+classpath/gnu/java/net/protocol/http/event/RequestListener.java
+
+gnu_java_net_protocol_http_event_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_http_event_source_files)))
+gnu_java_net_protocol_https_source_files = \
+classpath/gnu/java/net/protocol/https/Handler.java
+
+gnu_java_net_protocol_https_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_https_source_files)))
+gnu_java_net_protocol_jar_source_files = \
gnu/java/net/protocol/jar/Connection.java \
-gnu/java/net/protocol/jar/Handler.java \
-gnu/java/nio/ChannelInputStream.java \
-gnu/java/nio/ChannelOutputStream.java \
-gnu/java/nio/ChannelReader.java \
+classpath/gnu/java/net/protocol/jar/Handler.java
+
+gnu_java_net_protocol_jar_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_jar_source_files))))
+gnu_java_nio_source_files = \
+classpath/gnu/java/nio/ChannelInputStream.java \
+classpath/gnu/java/nio/ChannelOutputStream.java \
+classpath/gnu/java/nio/ChannelReader.java \
gnu/java/nio/DatagramChannelImpl.java \
gnu/java/nio/DatagramChannelSelectionKey.java \
-gnu/java/nio/FileLockImpl.java \
-gnu/java/nio/InputStreamChannel.java \
-gnu/java/nio/NIOConstants.java \
-gnu/java/nio/NIODatagramSocket.java \
+classpath/gnu/java/nio/FileLockImpl.java \
+classpath/gnu/java/nio/InputStreamChannel.java \
+classpath/gnu/java/nio/NIOConstants.java \
+classpath/gnu/java/nio/NIODatagramSocket.java \
gnu/java/nio/NIOServerSocket.java \
-gnu/java/nio/NIOSocket.java \
-gnu/java/nio/OutputStreamChannel.java \
-gnu/java/nio/PipeImpl.java \
-gnu/java/nio/SelectionKeyImpl.java \
-gnu/java/nio/SelectorImpl.java \
-gnu/java/nio/SelectorProviderImpl.java \
+classpath/gnu/java/nio/NIOSocket.java \
+classpath/gnu/java/nio/OutputStreamChannel.java \
+classpath/gnu/java/nio/PipeImpl.java \
+classpath/gnu/java/nio/SelectionKeyImpl.java \
+classpath/gnu/java/nio/SelectorImpl.java \
+classpath/gnu/java/nio/SelectorProviderImpl.java \
gnu/java/nio/ServerSocketChannelImpl.java \
gnu/java/nio/ServerSocketChannelSelectionKey.java \
gnu/java/nio/SocketChannelImpl.java \
gnu/java/nio/SocketChannelSelectionKey.java \
gnu/java/nio/VMPipe.java \
-gnu/java/nio/VMSelector.java \
-gnu/java/nio/channels/FileChannelImpl.java \
-gnu/java/nio/charset/ISO_8859_1.java \
+gnu/java/nio/VMSelector.java
+
+gnu_java_nio_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_nio_source_files))))
+gnu_java_nio_channels_source_files = \
+gnu/java/nio/channels/FileChannelImpl.java
+
+gnu_java_nio_channels_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_nio_channels_source_files)))
+gnu_java_nio_charset_source_files = \
+classpath/gnu/java/nio/charset/ByteCharset.java \
+classpath/gnu/java/nio/charset/Cp424.java \
+classpath/gnu/java/nio/charset/Cp437.java \
+classpath/gnu/java/nio/charset/Cp737.java \
+classpath/gnu/java/nio/charset/Cp775.java \
+classpath/gnu/java/nio/charset/Cp850.java \
+classpath/gnu/java/nio/charset/Cp852.java \
+classpath/gnu/java/nio/charset/Cp855.java \
+classpath/gnu/java/nio/charset/Cp857.java \
+classpath/gnu/java/nio/charset/Cp860.java \
+classpath/gnu/java/nio/charset/Cp861.java \
+classpath/gnu/java/nio/charset/Cp862.java \
+classpath/gnu/java/nio/charset/Cp863.java \
+classpath/gnu/java/nio/charset/Cp864.java \
+classpath/gnu/java/nio/charset/Cp865.java \
+classpath/gnu/java/nio/charset/Cp866.java \
+classpath/gnu/java/nio/charset/Cp869.java \
+classpath/gnu/java/nio/charset/Cp874.java \
+classpath/gnu/java/nio/charset/EncodingHelper.java \
+classpath/gnu/java/nio/charset/ISO_8859_1.java \
+classpath/gnu/java/nio/charset/ISO_8859_13.java \
+classpath/gnu/java/nio/charset/ISO_8859_15.java \
+classpath/gnu/java/nio/charset/ISO_8859_2.java \
+classpath/gnu/java/nio/charset/ISO_8859_3.java \
+classpath/gnu/java/nio/charset/ISO_8859_4.java \
+classpath/gnu/java/nio/charset/ISO_8859_5.java \
+classpath/gnu/java/nio/charset/ISO_8859_6.java \
+classpath/gnu/java/nio/charset/ISO_8859_7.java \
+classpath/gnu/java/nio/charset/ISO_8859_8.java \
+classpath/gnu/java/nio/charset/ISO_8859_9.java \
+classpath/gnu/java/nio/charset/KOI_8.java \
+classpath/gnu/java/nio/charset/MS874.java \
+classpath/gnu/java/nio/charset/MacCentralEurope.java \
+classpath/gnu/java/nio/charset/MacCroatian.java \
+classpath/gnu/java/nio/charset/MacCyrillic.java \
+classpath/gnu/java/nio/charset/MacDingbat.java \
+classpath/gnu/java/nio/charset/MacGreek.java \
+classpath/gnu/java/nio/charset/MacIceland.java \
+classpath/gnu/java/nio/charset/MacRoman.java \
+classpath/gnu/java/nio/charset/MacRomania.java \
+classpath/gnu/java/nio/charset/MacSymbol.java \
+classpath/gnu/java/nio/charset/MacThai.java \
+classpath/gnu/java/nio/charset/MacTurkish.java \
gnu/java/nio/charset/Provider.java \
-gnu/java/nio/charset/US_ASCII.java \
-gnu/java/nio/charset/UTF_16.java \
-gnu/java/nio/charset/UTF_16BE.java \
-gnu/java/nio/charset/UTF_16Decoder.java \
-gnu/java/nio/charset/UTF_16Encoder.java \
-gnu/java/nio/charset/UTF_16LE.java \
-gnu/java/nio/charset/UTF_8.java \
-gnu/java/security/Engine.java \
-gnu/java/security/OID.java \
-gnu/java/security/PolicyFile.java \
-gnu/java/security/action/GetPropertyAction.java \
-gnu/java/security/action/GetSecurityPropertyAction.java \
-gnu/java/security/action/SetAccessibleAction.java \
-gnu/java/security/ber/BER.java \
-gnu/java/security/ber/BEREncodingException.java \
-gnu/java/security/ber/BERReader.java \
-gnu/java/security/ber/BERValue.java \
-gnu/java/security/der/BitString.java \
-gnu/java/security/der/DER.java \
-gnu/java/security/der/DEREncodingException.java \
-gnu/java/security/der/DERReader.java \
-gnu/java/security/der/DERValue.java \
-gnu/java/security/der/DERWriter.java \
-gnu/java/security/pkcs/PKCS7SignedData.java \
-gnu/java/security/pkcs/SignerInfo.java \
-gnu/java/security/provider/CollectionCertStoreImpl.java \
-gnu/java/security/provider/DSAKeyFactory.java \
-gnu/java/security/provider/DSAKeyPairGenerator.java \
-gnu/java/security/provider/DSAParameterGenerator.java \
-gnu/java/security/provider/DSAParameters.java \
-gnu/java/security/provider/DSASignature.java \
-gnu/java/security/provider/DefaultPolicy.java \
-gnu/java/security/provider/EncodedKeyFactory.java \
-gnu/java/security/provider/Gnu.java \
-gnu/java/security/provider/GnuDHPublicKey.java \
-gnu/java/security/provider/GnuDSAPrivateKey.java \
-gnu/java/security/provider/GnuDSAPublicKey.java \
-gnu/java/security/provider/GnuRSAPrivateKey.java \
-gnu/java/security/provider/GnuRSAPublicKey.java \
-gnu/java/security/provider/MD2withRSA.java \
-gnu/java/security/provider/MD4withRSA.java \
-gnu/java/security/provider/MD5.java \
-gnu/java/security/provider/MD5withRSA.java \
-gnu/java/security/provider/PKIXCertPathValidatorImpl.java \
-gnu/java/security/provider/RSA.java \
-gnu/java/security/provider/RSAKeyFactory.java \
-gnu/java/security/provider/SHA.java \
-gnu/java/security/provider/SHA1PRNG.java \
-gnu/java/security/provider/SHA1withRSA.java \
-gnu/java/security/provider/X509CertificateFactory.java \
-gnu/java/security/util/Prime.java \
-gnu/java/security/x509/GnuPKIExtension.java \
-gnu/java/security/x509/PolicyNodeImpl.java \
-gnu/java/security/x509/Util.java \
-gnu/java/security/x509/X500DistinguishedName.java \
-gnu/java/security/x509/X509CRL.java \
-gnu/java/security/x509/X509CRLEntry.java \
-gnu/java/security/x509/X509CRLSelectorImpl.java \
-gnu/java/security/x509/X509Certificate.java \
-gnu/java/security/x509/X509CertPath.java \
-gnu/java/security/x509/X509CertSelectorImpl.java \
-gnu/java/security/x509/ext/AuthorityKeyIdentifier.java \
-gnu/java/security/x509/ext/BasicConstraints.java \
-gnu/java/security/x509/ext/CRLNumber.java \
-gnu/java/security/x509/ext/CertificatePolicies.java \
-gnu/java/security/x509/ext/ExtendedKeyUsage.java \
-gnu/java/security/x509/ext/Extension.java \
-gnu/java/security/x509/ext/GeneralNames.java \
-gnu/java/security/x509/ext/IssuerAlternativeNames.java \
-gnu/java/security/x509/ext/KeyUsage.java \
-gnu/java/security/x509/ext/PolicyConstraint.java \
-gnu/java/security/x509/ext/PolicyMappings.java \
-gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java \
-gnu/java/security/x509/ext/ReasonCode.java \
-gnu/java/security/x509/ext/SubjectAlternativeNames.java \
-gnu/java/security/x509/ext/SubjectKeyIdentifier.java \
-gnu/java/text/AttributedFormatBuffer.java \
-gnu/java/text/BaseBreakIterator.java \
-gnu/java/text/CharacterBreakIterator.java \
-gnu/java/text/FormatBuffer.java \
-gnu/java/text/FormatCharacterIterator.java \
-gnu/java/text/LineBreakIterator.java \
-gnu/java/text/SentenceBreakIterator.java \
-gnu/java/text/StringFormatBuffer.java \
-gnu/java/text/WordBreakIterator.java \
-gnu/java/util/DoubleEnumeration.java \
-gnu/java/util/EmptyEnumeration.java \
-gnu/java/util/prefs/FileBasedFactory.java \
-gnu/java/util/prefs/MemoryBasedFactory.java \
-gnu/java/util/prefs/MemoryBasedPreferences.java \
-gnu/java/util/prefs/NodeReader.java \
-gnu/java/util/prefs/NodeWriter.java \
-gnu/regexp/CharIndexed.java \
-gnu/regexp/CharIndexedCharArray.java \
-gnu/regexp/CharIndexedInputStream.java \
-gnu/regexp/CharIndexedString.java \
-gnu/regexp/CharIndexedStringBuffer.java \
-gnu/regexp/RE.java \
-gnu/regexp/REException.java \
-gnu/regexp/REFilterInputStream.java \
-gnu/regexp/REMatch.java \
-gnu/regexp/REMatchEnumeration.java \
-gnu/regexp/RESyntax.java \
-gnu/regexp/REToken.java \
-gnu/regexp/RETokenAny.java \
-gnu/regexp/RETokenBackRef.java \
-gnu/regexp/RETokenChar.java \
-gnu/regexp/RETokenEnd.java \
-gnu/regexp/RETokenEndSub.java \
-gnu/regexp/RETokenLookAhead.java \
-gnu/regexp/RETokenOneOf.java \
-gnu/regexp/RETokenPOSIX.java \
-gnu/regexp/RETokenRange.java \
-gnu/regexp/RETokenRepeated.java \
-gnu/regexp/RETokenStart.java \
-gnu/regexp/RETokenWordBoundary.java \
-gnu/regexp/UncheckedRE.java \
-java/lang/ref/PhantomReference.java \
+classpath/gnu/java/nio/charset/US_ASCII.java \
+classpath/gnu/java/nio/charset/UTF_16.java \
+classpath/gnu/java/nio/charset/UTF_16BE.java \
+classpath/gnu/java/nio/charset/UTF_16Decoder.java \
+classpath/gnu/java/nio/charset/UTF_16Encoder.java \
+classpath/gnu/java/nio/charset/UTF_16LE.java \
+classpath/gnu/java/nio/charset/UTF_8.java \
+classpath/gnu/java/nio/charset/UnicodeLittle.java \
+classpath/gnu/java/nio/charset/Windows1250.java \
+classpath/gnu/java/nio/charset/Windows1251.java \
+classpath/gnu/java/nio/charset/Windows1252.java \
+classpath/gnu/java/nio/charset/Windows1253.java \
+classpath/gnu/java/nio/charset/Windows1254.java \
+classpath/gnu/java/nio/charset/Windows1255.java \
+classpath/gnu/java/nio/charset/Windows1256.java \
+classpath/gnu/java/nio/charset/Windows1257.java \
+classpath/gnu/java/nio/charset/Windows1258.java
+
+gnu_java_nio_charset_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_nio_charset_source_files))))
+gnu_java_rmi_source_files = \
+classpath/gnu/java/rmi/RMIMarshalledObjectInputStream.java \
+classpath/gnu/java/rmi/RMIMarshalledObjectOutputStream.java \
+gnu/java/rmi/rmic/Compile_gcj.java \
+gnu/java/rmi/rmic/Compile_jikes.java \
+gnu/java/rmi/rmic/Compile_kjc.java \
+gnu/java/rmi/rmic/Compiler.java \
+gnu/java/rmi/rmic/CompilerProcess.java \
+gnu/java/rmi/rmic/RMIC.java \
+gnu/java/rmi/rmic/RMICException.java \
+gnu/java/rmi/rmic/TabbedWriter.java
+
+gnu_java_rmi_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_rmi_source_files))))
+gnu_java_rmi_dgc_source_files = \
+classpath/gnu/java/rmi/dgc/DGCImpl.java \
+classpath/gnu/java/rmi/dgc/DGCImpl_Skel.java \
+classpath/gnu/java/rmi/dgc/DGCImpl_Stub.java
+
+gnu_java_rmi_dgc_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_rmi_dgc_source_files)))
+gnu_java_rmi_registry_source_files = \
+classpath/gnu/java/rmi/registry/RegistryImpl.java \
+classpath/gnu/java/rmi/registry/RegistryImpl_Skel.java \
+classpath/gnu/java/rmi/registry/RegistryImpl_Stub.java
+
+gnu_java_rmi_registry_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_rmi_registry_source_files)))
+gnu_java_rmi_server_source_files = \
+classpath/gnu/java/rmi/server/ConnectionRunnerPool.java \
+classpath/gnu/java/rmi/server/ProtocolConstants.java \
+classpath/gnu/java/rmi/server/RMIDefaultSocketFactory.java \
+classpath/gnu/java/rmi/server/RMIHashes.java \
+classpath/gnu/java/rmi/server/RMIIncomingThread.java \
+classpath/gnu/java/rmi/server/RMIObjectInputStream.java \
+classpath/gnu/java/rmi/server/RMIObjectOutputStream.java \
+classpath/gnu/java/rmi/server/RMIVoidValue.java \
+classpath/gnu/java/rmi/server/UnicastConnection.java \
+classpath/gnu/java/rmi/server/UnicastConnectionManager.java \
+classpath/gnu/java/rmi/server/UnicastRef.java \
+classpath/gnu/java/rmi/server/UnicastRemoteCall.java \
+classpath/gnu/java/rmi/server/UnicastRemoteStub.java \
+classpath/gnu/java/rmi/server/UnicastServer.java \
+classpath/gnu/java/rmi/server/UnicastServerRef.java
+
+gnu_java_rmi_server_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_rmi_server_source_files)))
+gnu_java_security_source_files = \
+classpath/gnu/java/security/Engine.java \
+classpath/gnu/java/security/OID.java \
+classpath/gnu/java/security/PolicyFile.java
+
+gnu_java_security_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_source_files)))
+gnu_java_security_action_source_files = \
+classpath/gnu/java/security/action/GetPropertyAction.java \
+classpath/gnu/java/security/action/GetSecurityPropertyAction.java \
+classpath/gnu/java/security/action/SetAccessibleAction.java
+
+gnu_java_security_action_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_action_source_files)))
+gnu_java_security_ber_source_files = \
+classpath/gnu/java/security/ber/BER.java \
+classpath/gnu/java/security/ber/BEREncodingException.java \
+classpath/gnu/java/security/ber/BERReader.java \
+classpath/gnu/java/security/ber/BERValue.java
+
+gnu_java_security_ber_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_ber_source_files)))
+gnu_java_security_der_source_files = \
+classpath/gnu/java/security/der/BitString.java \
+classpath/gnu/java/security/der/DER.java \
+classpath/gnu/java/security/der/DEREncodingException.java \
+classpath/gnu/java/security/der/DERReader.java \
+classpath/gnu/java/security/der/DERValue.java \
+classpath/gnu/java/security/der/DERWriter.java
+
+gnu_java_security_der_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_der_source_files)))
+gnu_java_security_pkcs_source_files = \
+classpath/gnu/java/security/pkcs/PKCS7SignedData.java \
+classpath/gnu/java/security/pkcs/SignerInfo.java
+
+gnu_java_security_pkcs_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_pkcs_source_files)))
+gnu_java_security_provider_source_files = \
+classpath/gnu/java/security/provider/CollectionCertStoreImpl.java \
+classpath/gnu/java/security/provider/DSAKeyFactory.java \
+classpath/gnu/java/security/provider/DSAKeyPairGenerator.java \
+classpath/gnu/java/security/provider/DSAParameterGenerator.java \
+classpath/gnu/java/security/provider/DSAParameters.java \
+classpath/gnu/java/security/provider/DSASignature.java \
+classpath/gnu/java/security/provider/DefaultPolicy.java \
+classpath/gnu/java/security/provider/EncodedKeyFactory.java \
+classpath/gnu/java/security/provider/Gnu.java \
+classpath/gnu/java/security/provider/GnuDHPublicKey.java \
+classpath/gnu/java/security/provider/GnuDSAPrivateKey.java \
+classpath/gnu/java/security/provider/GnuDSAPublicKey.java \
+classpath/gnu/java/security/provider/GnuRSAPrivateKey.java \
+classpath/gnu/java/security/provider/GnuRSAPublicKey.java \
+classpath/gnu/java/security/provider/MD2withRSA.java \
+classpath/gnu/java/security/provider/MD4withRSA.java \
+classpath/gnu/java/security/provider/MD5.java \
+classpath/gnu/java/security/provider/MD5withRSA.java \
+classpath/gnu/java/security/provider/PKIXCertPathValidatorImpl.java \
+classpath/gnu/java/security/provider/RSA.java \
+classpath/gnu/java/security/provider/RSAKeyFactory.java \
+classpath/gnu/java/security/provider/SHA.java \
+classpath/gnu/java/security/provider/SHA1PRNG.java \
+classpath/gnu/java/security/provider/SHA1withRSA.java \
+classpath/gnu/java/security/provider/X509CertificateFactory.java
+
+gnu_java_security_provider_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_provider_source_files)))
+gnu_java_security_util_source_files = \
+classpath/gnu/java/security/util/Prime.java
+
+gnu_java_security_util_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_util_source_files)))
+gnu_java_security_x509_source_files = \
+classpath/gnu/java/security/x509/GnuPKIExtension.java \
+classpath/gnu/java/security/x509/PolicyNodeImpl.java \
+classpath/gnu/java/security/x509/Util.java \
+classpath/gnu/java/security/x509/X500DistinguishedName.java \
+classpath/gnu/java/security/x509/X509CRL.java \
+classpath/gnu/java/security/x509/X509CRLEntry.java \
+classpath/gnu/java/security/x509/X509CRLSelectorImpl.java \
+classpath/gnu/java/security/x509/X509CertPath.java \
+classpath/gnu/java/security/x509/X509CertSelectorImpl.java \
+classpath/gnu/java/security/x509/X509Certificate.java
+
+gnu_java_security_x509_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_x509_source_files)))
+gnu_java_security_x509_ext_source_files = \
+classpath/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java \
+classpath/gnu/java/security/x509/ext/BasicConstraints.java \
+classpath/gnu/java/security/x509/ext/CRLNumber.java \
+classpath/gnu/java/security/x509/ext/CertificatePolicies.java \
+classpath/gnu/java/security/x509/ext/ExtendedKeyUsage.java \
+classpath/gnu/java/security/x509/ext/Extension.java \
+classpath/gnu/java/security/x509/ext/GeneralNames.java \
+classpath/gnu/java/security/x509/ext/IssuerAlternativeNames.java \
+classpath/gnu/java/security/x509/ext/KeyUsage.java \
+classpath/gnu/java/security/x509/ext/PolicyConstraint.java \
+classpath/gnu/java/security/x509/ext/PolicyMappings.java \
+classpath/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java \
+classpath/gnu/java/security/x509/ext/ReasonCode.java \
+classpath/gnu/java/security/x509/ext/SubjectAlternativeNames.java \
+classpath/gnu/java/security/x509/ext/SubjectKeyIdentifier.java
+
+gnu_java_security_x509_ext_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_x509_ext_source_files)))
+gnu_java_text_source_files = \
+classpath/gnu/java/text/AttributedFormatBuffer.java \
+classpath/gnu/java/text/BaseBreakIterator.java \
+classpath/gnu/java/text/CharacterBreakIterator.java \
+classpath/gnu/java/text/FormatBuffer.java \
+classpath/gnu/java/text/FormatCharacterIterator.java \
+classpath/gnu/java/text/LineBreakIterator.java \
+classpath/gnu/java/text/SentenceBreakIterator.java \
+classpath/gnu/java/text/StringFormatBuffer.java \
+classpath/gnu/java/text/WordBreakIterator.java
+
+gnu_java_text_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_text_source_files)))
+gnu_java_util_source_files = \
+classpath/gnu/java/util/DoubleEnumeration.java \
+classpath/gnu/java/util/EmptyEnumeration.java
+
+gnu_java_util_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_util_source_files)))
+gnu_java_util_prefs_source_files = \
+classpath/gnu/java/util/prefs/FileBasedFactory.java \
+classpath/gnu/java/util/prefs/MemoryBasedFactory.java \
+classpath/gnu/java/util/prefs/MemoryBasedPreferences.java \
+classpath/gnu/java/util/prefs/NodeReader.java \
+classpath/gnu/java/util/prefs/NodeWriter.java
+
+gnu_java_util_prefs_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_util_prefs_source_files)))
+gnu_javax_swing_text_html_parser_source_files = \
+classpath/gnu/javax/swing/text/html/parser/HTML_401F.java \
+classpath/gnu/javax/swing/text/html/parser/gnuDTD.java \
+classpath/gnu/javax/swing/text/html/parser/htmlAttributeSet.java \
+classpath/gnu/javax/swing/text/html/parser/htmlValidator.java
+
+gnu_javax_swing_text_html_parser_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_javax_swing_text_html_parser_source_files)))
+gnu_javax_swing_text_html_parser_models_source_files = \
+classpath/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.java \
+classpath/gnu/javax/swing/text/html/parser/models/TableRowContentModel.java \
+classpath/gnu/javax/swing/text/html/parser/models/list.java \
+classpath/gnu/javax/swing/text/html/parser/models/noTagModel.java \
+classpath/gnu/javax/swing/text/html/parser/models/node.java \
+classpath/gnu/javax/swing/text/html/parser/models/transformer.java
+
+gnu_javax_swing_text_html_parser_models_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_javax_swing_text_html_parser_models_source_files)))
+gnu_javax_swing_text_html_parser_support_source_files = \
+classpath/gnu/javax/swing/text/html/parser/support/Parser.java \
+classpath/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.java \
+classpath/gnu/javax/swing/text/html/parser/support/parameterDefaulter.java \
+classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java
+
+gnu_javax_swing_text_html_parser_support_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_javax_swing_text_html_parser_support_source_files)))
+gnu_javax_swing_text_html_parser_support_low_source_files = \
+classpath/gnu/javax/swing/text/html/parser/support/low/Buffer.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/Constants.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/Location.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/ParseException.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/Queue.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/Token.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/node.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/pattern.java
+
+gnu_javax_swing_text_html_parser_support_low_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_javax_swing_text_html_parser_support_low_source_files)))
+gnu_regexp_source_files = \
+classpath/gnu/regexp/CharIndexed.java \
+classpath/gnu/regexp/CharIndexedCharArray.java \
+classpath/gnu/regexp/CharIndexedInputStream.java \
+classpath/gnu/regexp/CharIndexedString.java \
+classpath/gnu/regexp/CharIndexedStringBuffer.java \
+classpath/gnu/regexp/RE.java \
+classpath/gnu/regexp/REException.java \
+classpath/gnu/regexp/REFilterInputStream.java \
+classpath/gnu/regexp/REMatch.java \
+classpath/gnu/regexp/REMatchEnumeration.java \
+classpath/gnu/regexp/RESyntax.java \
+classpath/gnu/regexp/REToken.java \
+classpath/gnu/regexp/RETokenAny.java \
+classpath/gnu/regexp/RETokenBackRef.java \
+classpath/gnu/regexp/RETokenChar.java \
+classpath/gnu/regexp/RETokenEnd.java \
+classpath/gnu/regexp/RETokenEndSub.java \
+classpath/gnu/regexp/RETokenLookAhead.java \
+classpath/gnu/regexp/RETokenOneOf.java \
+classpath/gnu/regexp/RETokenPOSIX.java \
+classpath/gnu/regexp/RETokenRange.java \
+classpath/gnu/regexp/RETokenRepeated.java \
+classpath/gnu/regexp/RETokenStart.java \
+classpath/gnu/regexp/RETokenWordBoundary.java \
+classpath/gnu/regexp/UncheckedRE.java
+
+gnu_regexp_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_regexp_source_files)))
+gnu_xml_source_files = \
+classpath/gnu/xml/aelfred2/ContentHandler2.java \
+classpath/gnu/xml/aelfred2/JAXPFactory.java \
+classpath/gnu/xml/aelfred2/SAXDriver.java \
+classpath/gnu/xml/aelfred2/XmlParser.java \
+classpath/gnu/xml/aelfred2/XmlReader.java \
+classpath/gnu/xml/dom/Consumer.java \
+classpath/gnu/xml/dom/DTDAttributeTypeInfo.java \
+classpath/gnu/xml/dom/DTDElementTypeInfo.java \
+classpath/gnu/xml/dom/DomAttr.java \
+classpath/gnu/xml/dom/DomCDATASection.java \
+classpath/gnu/xml/dom/DomCharacterData.java \
+classpath/gnu/xml/dom/DomComment.java \
+classpath/gnu/xml/dom/DomDOMException.java \
+classpath/gnu/xml/dom/DomDoctype.java \
+classpath/gnu/xml/dom/DomDocument.java \
+classpath/gnu/xml/dom/DomDocumentBuilder.java \
+classpath/gnu/xml/dom/DomDocumentBuilderFactory.java \
+classpath/gnu/xml/dom/DomDocumentConfiguration.java \
+classpath/gnu/xml/dom/DomDocumentFragment.java \
+classpath/gnu/xml/dom/DomElement.java \
+classpath/gnu/xml/dom/DomEntity.java \
+classpath/gnu/xml/dom/DomEntityReference.java \
+classpath/gnu/xml/dom/DomEvent.java \
+classpath/gnu/xml/dom/DomExtern.java \
+classpath/gnu/xml/dom/DomImpl.java \
+classpath/gnu/xml/dom/DomIterator.java \
+classpath/gnu/xml/dom/DomNSResolverContext.java \
+classpath/gnu/xml/dom/DomNamedNodeMap.java \
+classpath/gnu/xml/dom/DomNode.java \
+classpath/gnu/xml/dom/DomNodeIterator.java \
+classpath/gnu/xml/dom/DomNotation.java \
+classpath/gnu/xml/dom/DomNsNode.java \
+classpath/gnu/xml/dom/DomProcessingInstruction.java \
+classpath/gnu/xml/dom/DomText.java \
+classpath/gnu/xml/dom/DomXPathExpression.java \
+classpath/gnu/xml/dom/DomXPathNSResolver.java \
+classpath/gnu/xml/dom/DomXPathResult.java \
+classpath/gnu/xml/dom/ImplementationList.java \
+classpath/gnu/xml/dom/ImplementationSource.java \
+classpath/gnu/xml/dom/JAXPFactory.java \
+classpath/gnu/xml/dom/html2/DomHTMLAnchorElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLAppletElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLAreaElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLBRElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLBaseElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLBaseFontElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLBodyElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLButtonElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLCollection.java \
+classpath/gnu/xml/dom/html2/DomHTMLDListElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLDirectoryElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLDivElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLDocument.java \
+classpath/gnu/xml/dom/html2/DomHTMLElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLFieldSetElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLFontElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLFormElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLFrameElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLFrameSetElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLHRElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLHeadElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLHeadingElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLHtmlElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLIFrameElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLImageElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLImpl.java \
+classpath/gnu/xml/dom/html2/DomHTMLInputElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLIsIndexElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLLIElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLLabelElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLLegendElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLLinkElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLMapElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLMenuElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLMetaElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLModElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLOListElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLObjectElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLOptGroupElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLOptionElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLParagraphElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLParamElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLParser.java \
+classpath/gnu/xml/dom/html2/DomHTMLPreElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLQuoteElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLScriptElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLSelectElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLStyleElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableCaptionElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableCellElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableColElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableRowElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableSectionElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTextAreaElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTitleElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLUListElement.java \
+classpath/gnu/xml/dom/ls/DomLSException.java \
+classpath/gnu/xml/dom/ls/DomLSInput.java \
+classpath/gnu/xml/dom/ls/DomLSOutput.java \
+classpath/gnu/xml/dom/ls/DomLSParser.java \
+classpath/gnu/xml/dom/ls/DomLSSerializer.java \
+classpath/gnu/xml/dom/ls/FilteredSAXEventSink.java \
+classpath/gnu/xml/dom/ls/ReaderInputStream.java \
+classpath/gnu/xml/dom/ls/SAXEventSink.java \
+classpath/gnu/xml/dom/ls/WriterOutputStream.java \
+classpath/gnu/xml/libxmlj/dom/GnomeAttr.java \
+classpath/gnu/xml/libxmlj/dom/GnomeCDATASection.java \
+classpath/gnu/xml/libxmlj/dom/GnomeCharacterData.java \
+classpath/gnu/xml/libxmlj/dom/GnomeComment.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDOMException.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDOMStringList.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDocument.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDocumentBuilder.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDocumentBuilderFactory.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDocumentFragment.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDocumentType.java \
+classpath/gnu/xml/libxmlj/dom/GnomeElement.java \
+classpath/gnu/xml/libxmlj/dom/GnomeEntity.java \
+classpath/gnu/xml/libxmlj/dom/GnomeEntityReference.java \
+classpath/gnu/xml/libxmlj/dom/GnomeNamedNodeMap.java \
+classpath/gnu/xml/libxmlj/dom/GnomeNode.java \
+classpath/gnu/xml/libxmlj/dom/GnomeNodeList.java \
+classpath/gnu/xml/libxmlj/dom/GnomeNotation.java \
+classpath/gnu/xml/libxmlj/dom/GnomeProcessingInstruction.java \
+classpath/gnu/xml/libxmlj/dom/GnomeText.java \
+classpath/gnu/xml/libxmlj/dom/GnomeTypeInfo.java \
+classpath/gnu/xml/libxmlj/dom/GnomeXPathExpression.java \
+classpath/gnu/xml/libxmlj/dom/GnomeXPathNSResolver.java \
+classpath/gnu/xml/libxmlj/dom/GnomeXPathNodeList.java \
+classpath/gnu/xml/libxmlj/dom/GnomeXPathResult.java \
+classpath/gnu/xml/libxmlj/sax/GnomeLocator.java \
+classpath/gnu/xml/libxmlj/sax/GnomeSAXParser.java \
+classpath/gnu/xml/libxmlj/sax/GnomeSAXParserFactory.java \
+classpath/gnu/xml/libxmlj/sax/GnomeXMLReader.java \
+classpath/gnu/xml/libxmlj/sax/Namespaces.java \
+classpath/gnu/xml/libxmlj/sax/StringArrayAttributes.java \
+classpath/gnu/xml/libxmlj/sax/XMLName.java \
+classpath/gnu/xml/libxmlj/transform/ErrorListenerErrorHandler.java \
+classpath/gnu/xml/libxmlj/transform/GnomeTransformer.java \
+classpath/gnu/xml/libxmlj/transform/GnomeTransformerFactory.java \
+classpath/gnu/xml/libxmlj/transform/URIResolverEntityResolver.java \
+classpath/gnu/xml/libxmlj/util/EmptyNodeList.java \
+classpath/gnu/xml/libxmlj/util/NamedInputStream.java \
+classpath/gnu/xml/libxmlj/util/StandaloneDocumentType.java \
+classpath/gnu/xml/libxmlj/util/StandaloneLocator.java \
+classpath/gnu/xml/libxmlj/util/XMLJ.java \
+classpath/gnu/xml/pipeline/CallFilter.java \
+classpath/gnu/xml/pipeline/DomConsumer.java \
+classpath/gnu/xml/pipeline/EventConsumer.java \
+classpath/gnu/xml/pipeline/EventFilter.java \
+classpath/gnu/xml/pipeline/LinkFilter.java \
+classpath/gnu/xml/pipeline/NSFilter.java \
+classpath/gnu/xml/pipeline/PipelineFactory.java \
+classpath/gnu/xml/pipeline/TeeConsumer.java \
+classpath/gnu/xml/pipeline/TextConsumer.java \
+classpath/gnu/xml/pipeline/ValidationConsumer.java \
+classpath/gnu/xml/pipeline/WellFormednessFilter.java \
+classpath/gnu/xml/pipeline/XIncludeFilter.java \
+classpath/gnu/xml/pipeline/XsltFilter.java \
+classpath/gnu/xml/transform/AbstractNumberNode.java \
+classpath/gnu/xml/transform/ApplyImportsNode.java \
+classpath/gnu/xml/transform/ApplyTemplatesNode.java \
+classpath/gnu/xml/transform/AttributeNode.java \
+classpath/gnu/xml/transform/AttributeSet.java \
+classpath/gnu/xml/transform/Bindings.java \
+classpath/gnu/xml/transform/CallTemplateNode.java \
+classpath/gnu/xml/transform/ChooseNode.java \
+classpath/gnu/xml/transform/CommentNode.java \
+classpath/gnu/xml/transform/CopyNode.java \
+classpath/gnu/xml/transform/CopyOfNode.java \
+classpath/gnu/xml/transform/CurrentFunction.java \
+classpath/gnu/xml/transform/DOMSourceLocator.java \
+classpath/gnu/xml/transform/DocumentFunction.java \
+classpath/gnu/xml/transform/ElementAvailableFunction.java \
+classpath/gnu/xml/transform/ElementNode.java \
+classpath/gnu/xml/transform/ErrorListenerErrorHandler.java \
+classpath/gnu/xml/transform/ForEachNode.java \
+classpath/gnu/xml/transform/FormatNumberFunction.java \
+classpath/gnu/xml/transform/FunctionAvailableFunction.java \
+classpath/gnu/xml/transform/GenerateIdFunction.java \
+classpath/gnu/xml/transform/IfNode.java \
+classpath/gnu/xml/transform/Key.java \
+classpath/gnu/xml/transform/KeyFunction.java \
+classpath/gnu/xml/transform/LiteralNode.java \
+classpath/gnu/xml/transform/MessageNode.java \
+classpath/gnu/xml/transform/NodeNumberNode.java \
+classpath/gnu/xml/transform/NumberNode.java \
+classpath/gnu/xml/transform/OtherwiseNode.java \
+classpath/gnu/xml/transform/ParameterNode.java \
+classpath/gnu/xml/transform/ProcessingInstructionNode.java \
+classpath/gnu/xml/transform/SAXSerializer.java \
+classpath/gnu/xml/transform/SortKey.java \
+classpath/gnu/xml/transform/StreamSerializer.java \
+classpath/gnu/xml/transform/Stylesheet.java \
+classpath/gnu/xml/transform/SystemPropertyFunction.java \
+classpath/gnu/xml/transform/Template.java \
+classpath/gnu/xml/transform/TemplateNode.java \
+classpath/gnu/xml/transform/TemplatesImpl.java \
+classpath/gnu/xml/transform/TextNode.java \
+classpath/gnu/xml/transform/TransformerFactoryImpl.java \
+classpath/gnu/xml/transform/TransformerImpl.java \
+classpath/gnu/xml/transform/TransformerOutputProperties.java \
+classpath/gnu/xml/transform/URIResolverEntityResolver.java \
+classpath/gnu/xml/transform/UnparsedEntityUriFunction.java \
+classpath/gnu/xml/transform/ValueOfNode.java \
+classpath/gnu/xml/transform/WhenNode.java \
+classpath/gnu/xml/transform/WithParam.java \
+classpath/gnu/xml/transform/XSLComparator.java \
+classpath/gnu/xml/transform/XSLURIResolver.java \
+classpath/gnu/xml/util/DoParse.java \
+classpath/gnu/xml/util/DomParser.java \
+classpath/gnu/xml/util/Resolver.java \
+classpath/gnu/xml/util/SAXNullTransformerFactory.java \
+classpath/gnu/xml/util/XCat.java \
+classpath/gnu/xml/util/XHTMLWriter.java \
+classpath/gnu/xml/util/XMLWriter.java \
+classpath/gnu/xml/xpath/AndExpr.java \
+classpath/gnu/xml/xpath/ArithmeticExpr.java \
+classpath/gnu/xml/xpath/BooleanFunction.java \
+classpath/gnu/xml/xpath/CeilingFunction.java \
+classpath/gnu/xml/xpath/ConcatFunction.java \
+classpath/gnu/xml/xpath/Constant.java \
+classpath/gnu/xml/xpath/ContainsFunction.java \
+classpath/gnu/xml/xpath/CountFunction.java \
+classpath/gnu/xml/xpath/DocumentOrderComparator.java \
+classpath/gnu/xml/xpath/EqualityExpr.java \
+classpath/gnu/xml/xpath/Expr.java \
+classpath/gnu/xml/xpath/FalseFunction.java \
+classpath/gnu/xml/xpath/FloorFunction.java \
+classpath/gnu/xml/xpath/Function.java \
+classpath/gnu/xml/xpath/FunctionCall.java \
+classpath/gnu/xml/xpath/IdFunction.java \
+classpath/gnu/xml/xpath/LangFunction.java \
+classpath/gnu/xml/xpath/LastFunction.java \
+classpath/gnu/xml/xpath/LocalNameFunction.java \
+classpath/gnu/xml/xpath/NameFunction.java \
+classpath/gnu/xml/xpath/NameTest.java \
+classpath/gnu/xml/xpath/NamespaceTest.java \
+classpath/gnu/xml/xpath/NamespaceUriFunction.java \
+classpath/gnu/xml/xpath/NegativeExpr.java \
+classpath/gnu/xml/xpath/NodeTypeTest.java \
+classpath/gnu/xml/xpath/NormalizeSpaceFunction.java \
+classpath/gnu/xml/xpath/NotFunction.java \
+classpath/gnu/xml/xpath/NumberFunction.java \
+classpath/gnu/xml/xpath/OrExpr.java \
+classpath/gnu/xml/xpath/ParenthesizedExpr.java \
+classpath/gnu/xml/xpath/Path.java \
+classpath/gnu/xml/xpath/Pattern.java \
+classpath/gnu/xml/xpath/PositionFunction.java \
+classpath/gnu/xml/xpath/Predicate.java \
+classpath/gnu/xml/xpath/RelationalExpr.java \
+classpath/gnu/xml/xpath/Root.java \
+classpath/gnu/xml/xpath/RoundFunction.java \
+classpath/gnu/xml/xpath/Selector.java \
+classpath/gnu/xml/xpath/StartsWithFunction.java \
+classpath/gnu/xml/xpath/Steps.java \
+classpath/gnu/xml/xpath/StringFunction.java \
+classpath/gnu/xml/xpath/StringLengthFunction.java \
+classpath/gnu/xml/xpath/SubstringAfterFunction.java \
+classpath/gnu/xml/xpath/SubstringBeforeFunction.java \
+classpath/gnu/xml/xpath/SubstringFunction.java \
+classpath/gnu/xml/xpath/SumFunction.java \
+classpath/gnu/xml/xpath/Test.java \
+classpath/gnu/xml/xpath/TranslateFunction.java \
+classpath/gnu/xml/xpath/TrueFunction.java \
+classpath/gnu/xml/xpath/UnionExpr.java \
+classpath/gnu/xml/xpath/VariableReference.java \
+classpath/gnu/xml/xpath/XPathFactoryImpl.java \
+classpath/gnu/xml/xpath/XPathImpl.java \
+classpath/gnu/xml/xpath/XPathParser.java \
+classpath/gnu/xml/xpath/XPathTokenizer.java
+
+java_applet_source_files = \
+classpath/java/applet/Applet.java \
+classpath/java/applet/AppletContext.java \
+classpath/java/applet/AppletStub.java \
+classpath/java/applet/AudioClip.java
+
+java_applet_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_applet_source_files)))
+java_awt_source_files = \
+classpath/java/awt/AWTError.java \
+classpath/java/awt/AWTEvent.java \
+classpath/java/awt/AWTEventMulticaster.java \
+classpath/java/awt/AWTException.java \
+classpath/java/awt/AWTKeyStroke.java \
+classpath/java/awt/AWTPermission.java \
+classpath/java/awt/ActiveEvent.java \
+classpath/java/awt/Adjustable.java \
+classpath/java/awt/AlphaComposite.java \
+classpath/java/awt/AttributeValue.java \
+classpath/java/awt/BasicStroke.java \
+classpath/java/awt/BorderLayout.java \
+classpath/java/awt/BufferCapabilities.java \
+classpath/java/awt/Button.java \
+classpath/java/awt/Canvas.java \
+classpath/java/awt/CardLayout.java \
+classpath/java/awt/Checkbox.java \
+classpath/java/awt/CheckboxGroup.java \
+classpath/java/awt/CheckboxMenuItem.java \
+classpath/java/awt/Choice.java \
+classpath/java/awt/Color.java \
+classpath/java/awt/ColorPaintContext.java \
+classpath/java/awt/Component.java \
+classpath/java/awt/ComponentOrientation.java \
+classpath/java/awt/Composite.java \
+classpath/java/awt/CompositeContext.java \
+classpath/java/awt/Container.java \
+classpath/java/awt/ContainerOrderFocusTraversalPolicy.java \
+classpath/java/awt/Cursor.java \
+classpath/java/awt/DefaultFocusTraversalPolicy.java \
+classpath/java/awt/DefaultKeyboardFocusManager.java \
+classpath/java/awt/Dialog.java \
+classpath/java/awt/Dimension.java \
+classpath/java/awt/DisplayMode.java \
+classpath/java/awt/Event.java \
+classpath/java/awt/EventDispatchThread.java \
+classpath/java/awt/EventQueue.java \
+classpath/java/awt/FileDialog.java \
+classpath/java/awt/FlowLayout.java \
+classpath/java/awt/FocusTraversalPolicy.java \
+classpath/java/awt/Font.java \
+classpath/java/awt/FontFormatException.java \
+classpath/java/awt/FontMetrics.java \
+classpath/java/awt/Frame.java \
+classpath/java/awt/GradientPaint.java \
+classpath/java/awt/Graphics.java \
+classpath/java/awt/Graphics2D.java \
+classpath/java/awt/GraphicsConfigTemplate.java \
+classpath/java/awt/GraphicsConfiguration.java \
+classpath/java/awt/GraphicsDevice.java \
+classpath/java/awt/GraphicsEnvironment.java \
+classpath/java/awt/GridBagConstraints.java \
+classpath/java/awt/GridBagLayout.java \
+classpath/java/awt/GridBagLayoutInfo.java \
+classpath/java/awt/GridLayout.java \
+classpath/java/awt/HeadlessException.java \
+classpath/java/awt/IllegalComponentStateException.java \
+classpath/java/awt/Image.java \
+classpath/java/awt/ImageCapabilities.java \
+classpath/java/awt/Insets.java \
+classpath/java/awt/ItemSelectable.java \
+classpath/java/awt/JobAttributes.java \
+classpath/java/awt/KeyEventDispatcher.java \
+classpath/java/awt/KeyEventPostProcessor.java \
+classpath/java/awt/KeyboardFocusManager.java \
+classpath/java/awt/Label.java \
+classpath/java/awt/LayoutManager.java \
+classpath/java/awt/LayoutManager2.java \
+classpath/java/awt/List.java \
+classpath/java/awt/MediaTracker.java \
+classpath/java/awt/Menu.java \
+classpath/java/awt/MenuBar.java \
+classpath/java/awt/MenuComponent.java \
+classpath/java/awt/MenuContainer.java \
+classpath/java/awt/MenuItem.java \
+classpath/java/awt/MenuShortcut.java \
+classpath/java/awt/PageAttributes.java \
+classpath/java/awt/Paint.java \
+classpath/java/awt/PaintContext.java \
+classpath/java/awt/Panel.java \
+classpath/java/awt/Point.java \
+classpath/java/awt/Polygon.java \
+classpath/java/awt/PopupMenu.java \
+classpath/java/awt/PrintGraphics.java \
+classpath/java/awt/PrintJob.java \
+classpath/java/awt/Rectangle.java \
+classpath/java/awt/RenderingHints.java \
+classpath/java/awt/Robot.java \
+classpath/java/awt/ScrollPane.java \
+classpath/java/awt/ScrollPaneAdjustable.java \
+classpath/java/awt/Scrollbar.java \
+classpath/java/awt/Shape.java \
+classpath/java/awt/Stroke.java \
+classpath/java/awt/SystemColor.java \
+classpath/java/awt/TextArea.java \
+classpath/java/awt/TextComponent.java \
+classpath/java/awt/TextField.java \
+classpath/java/awt/TexturePaint.java \
+classpath/java/awt/Toolkit.java \
+classpath/java/awt/Transparency.java \
+classpath/java/awt/Window.java
+
+java_awt_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_source_files)))
+java_awt_color_source_files = \
+classpath/java/awt/color/CMMException.java \
+classpath/java/awt/color/ColorSpace.java \
+classpath/java/awt/color/ICC_ColorSpace.java \
+classpath/java/awt/color/ICC_Profile.java \
+classpath/java/awt/color/ICC_ProfileGray.java \
+classpath/java/awt/color/ICC_ProfileRGB.java \
+classpath/java/awt/color/ProfileDataException.java
+
+java_awt_color_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_color_source_files)))
+java_awt_datatransfer_source_files = \
+classpath/java/awt/datatransfer/Clipboard.java \
+classpath/java/awt/datatransfer/ClipboardOwner.java \
+classpath/java/awt/datatransfer/DataFlavor.java \
+classpath/java/awt/datatransfer/FlavorMap.java \
+classpath/java/awt/datatransfer/FlavorTable.java \
+classpath/java/awt/datatransfer/MimeTypeParseException.java \
+classpath/java/awt/datatransfer/StringSelection.java \
+classpath/java/awt/datatransfer/SystemFlavorMap.java \
+classpath/java/awt/datatransfer/Transferable.java \
+classpath/java/awt/datatransfer/UnsupportedFlavorException.java
+
+java_awt_datatransfer_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_datatransfer_source_files)))
+java_awt_dnd_source_files = \
+classpath/java/awt/dnd/Autoscroll.java \
+classpath/java/awt/dnd/DnDConstants.java \
+classpath/java/awt/dnd/DnDEventMulticaster.java \
+classpath/java/awt/dnd/DragGestureEvent.java \
+classpath/java/awt/dnd/DragGestureListener.java \
+classpath/java/awt/dnd/DragGestureRecognizer.java \
+classpath/java/awt/dnd/DragSource.java \
+classpath/java/awt/dnd/DragSourceAdapter.java \
+classpath/java/awt/dnd/DragSourceContext.java \
+classpath/java/awt/dnd/DragSourceDragEvent.java \
+classpath/java/awt/dnd/DragSourceDropEvent.java \
+classpath/java/awt/dnd/DragSourceEvent.java \
+classpath/java/awt/dnd/DragSourceListener.java \
+classpath/java/awt/dnd/DragSourceMotionListener.java \
+classpath/java/awt/dnd/DropTarget.java \
+classpath/java/awt/dnd/DropTargetAdapter.java \
+classpath/java/awt/dnd/DropTargetContext.java \
+classpath/java/awt/dnd/DropTargetDragEvent.java \
+classpath/java/awt/dnd/DropTargetDropEvent.java \
+classpath/java/awt/dnd/DropTargetEvent.java \
+classpath/java/awt/dnd/DropTargetListener.java \
+classpath/java/awt/dnd/InvalidDnDOperationException.java \
+classpath/java/awt/dnd/MouseDragGestureRecognizer.java
+
+java_awt_dnd_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_dnd_source_files)))
+java_awt_dnd_peer_source_files = \
+classpath/java/awt/dnd/peer/DragSourceContextPeer.java \
+classpath/java/awt/dnd/peer/DropTargetContextPeer.java \
+classpath/java/awt/dnd/peer/DropTargetPeer.java
+
+java_awt_dnd_peer_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_dnd_peer_source_files)))
+java_awt_event_source_files = \
+classpath/java/awt/event/AWTEventListener.java \
+classpath/java/awt/event/AWTEventListenerProxy.java \
+classpath/java/awt/event/ActionEvent.java \
+classpath/java/awt/event/ActionListener.java \
+classpath/java/awt/event/AdjustmentEvent.java \
+classpath/java/awt/event/AdjustmentListener.java \
+classpath/java/awt/event/ComponentAdapter.java \
+classpath/java/awt/event/ComponentEvent.java \
+classpath/java/awt/event/ComponentListener.java \
+classpath/java/awt/event/ContainerAdapter.java \
+classpath/java/awt/event/ContainerEvent.java \
+classpath/java/awt/event/ContainerListener.java \
+classpath/java/awt/event/FocusAdapter.java \
+classpath/java/awt/event/FocusEvent.java \
+classpath/java/awt/event/FocusListener.java \
+classpath/java/awt/event/HierarchyBoundsAdapter.java \
+classpath/java/awt/event/HierarchyBoundsListener.java \
+classpath/java/awt/event/HierarchyEvent.java \
+classpath/java/awt/event/HierarchyListener.java \
+classpath/java/awt/event/InputEvent.java \
+classpath/java/awt/event/InputMethodEvent.java \
+classpath/java/awt/event/InputMethodListener.java \
+classpath/java/awt/event/InvocationEvent.java \
+classpath/java/awt/event/ItemEvent.java \
+classpath/java/awt/event/ItemListener.java \
+classpath/java/awt/event/KeyAdapter.java \
+classpath/java/awt/event/KeyEvent.java \
+classpath/java/awt/event/KeyListener.java \
+classpath/java/awt/event/MouseAdapter.java \
+classpath/java/awt/event/MouseEvent.java \
+classpath/java/awt/event/MouseListener.java \
+classpath/java/awt/event/MouseMotionAdapter.java \
+classpath/java/awt/event/MouseMotionListener.java \
+classpath/java/awt/event/MouseWheelEvent.java \
+classpath/java/awt/event/MouseWheelListener.java \
+classpath/java/awt/event/PaintEvent.java \
+classpath/java/awt/event/TextEvent.java \
+classpath/java/awt/event/TextListener.java \
+classpath/java/awt/event/WindowAdapter.java \
+classpath/java/awt/event/WindowEvent.java \
+classpath/java/awt/event/WindowFocusListener.java \
+classpath/java/awt/event/WindowListener.java \
+classpath/java/awt/event/WindowStateListener.java
+
+java_awt_event_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_event_source_files)))
+java_awt_font_source_files = \
+classpath/java/awt/font/FontRenderContext.java \
+classpath/java/awt/font/GlyphJustificationInfo.java \
+classpath/java/awt/font/GlyphMetrics.java \
+classpath/java/awt/font/GlyphVector.java \
+classpath/java/awt/font/GraphicAttribute.java \
+classpath/java/awt/font/ImageGraphicAttribute.java \
+classpath/java/awt/font/LineBreakMeasurer.java \
+classpath/java/awt/font/LineMetrics.java \
+classpath/java/awt/font/MultipleMaster.java \
+classpath/java/awt/font/NumericShaper.java \
+classpath/java/awt/font/OpenType.java \
+classpath/java/awt/font/ShapeGraphicAttribute.java \
+classpath/java/awt/font/TextAttribute.java \
+classpath/java/awt/font/TextHitInfo.java \
+classpath/java/awt/font/TextLayout.java \
+classpath/java/awt/font/TextMeasurer.java \
+classpath/java/awt/font/TransformAttribute.java
+
+java_awt_font_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_font_source_files)))
+java_awt_geom_source_files = \
+classpath/java/awt/geom/AffineTransform.java \
+classpath/java/awt/geom/Arc2D.java \
+classpath/java/awt/geom/Area.java \
+classpath/java/awt/geom/CubicCurve2D.java \
+classpath/java/awt/geom/Dimension2D.java \
+classpath/java/awt/geom/Ellipse2D.java \
+classpath/java/awt/geom/FlatteningPathIterator.java \
+classpath/java/awt/geom/GeneralPath.java \
+classpath/java/awt/geom/IllegalPathStateException.java \
+classpath/java/awt/geom/Line2D.java \
+classpath/java/awt/geom/NoninvertibleTransformException.java \
+classpath/java/awt/geom/PathIterator.java \
+classpath/java/awt/geom/Point2D.java \
+classpath/java/awt/geom/QuadCurve2D.java \
+classpath/java/awt/geom/Rectangle2D.java \
+classpath/java/awt/geom/RectangularShape.java \
+classpath/java/awt/geom/RoundRectangle2D.java
+
+java_awt_geom_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_geom_source_files)))
+java_awt_im_source_files = \
+classpath/java/awt/im/InputContext.java \
+classpath/java/awt/im/InputMethodHighlight.java \
+classpath/java/awt/im/InputMethodRequests.java \
+classpath/java/awt/im/InputSubset.java
+
+java_awt_im_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_im_source_files)))
+java_awt_im_spi_source_files = \
+classpath/java/awt/im/spi/InputMethod.java \
+classpath/java/awt/im/spi/InputMethodContext.java \
+classpath/java/awt/im/spi/InputMethodDescriptor.java
+
+java_awt_im_spi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_im_spi_source_files)))
+java_awt_image_source_files = \
+classpath/java/awt/image/AffineTransformOp.java \
+classpath/java/awt/image/AreaAveragingScaleFilter.java \
+classpath/java/awt/image/BandCombineOp.java \
+classpath/java/awt/image/BandedSampleModel.java \
+classpath/java/awt/image/BufferStrategy.java \
+classpath/java/awt/image/BufferedImage.java \
+classpath/java/awt/image/BufferedImageFilter.java \
+classpath/java/awt/image/BufferedImageOp.java \
+classpath/java/awt/image/ByteLookupTable.java \
+classpath/java/awt/image/ColorConvertOp.java \
+classpath/java/awt/image/ColorModel.java \
+classpath/java/awt/image/ComponentColorModel.java \
+classpath/java/awt/image/ComponentSampleModel.java \
+classpath/java/awt/image/ConvolveOp.java \
+classpath/java/awt/image/CropImageFilter.java \
+classpath/java/awt/image/DataBuffer.java \
+classpath/java/awt/image/DataBufferByte.java \
+classpath/java/awt/image/DataBufferDouble.java \
+classpath/java/awt/image/DataBufferFloat.java \
+classpath/java/awt/image/DataBufferInt.java \
+classpath/java/awt/image/DataBufferShort.java \
+classpath/java/awt/image/DataBufferUShort.java \
+classpath/java/awt/image/DirectColorModel.java \
+classpath/java/awt/image/FilteredImageSource.java \
+classpath/java/awt/image/ImageConsumer.java \
+classpath/java/awt/image/ImageFilter.java \
+classpath/java/awt/image/ImageObserver.java \
+classpath/java/awt/image/ImageProducer.java \
+classpath/java/awt/image/ImagingOpException.java \
+classpath/java/awt/image/IndexColorModel.java \
+classpath/java/awt/image/Kernel.java \
+classpath/java/awt/image/LookupOp.java \
+classpath/java/awt/image/LookupTable.java \
+classpath/java/awt/image/MemoryImageSource.java \
+classpath/java/awt/image/MultiPixelPackedSampleModel.java \
+classpath/java/awt/image/PackedColorModel.java \
+classpath/java/awt/image/PixelGrabber.java \
+classpath/java/awt/image/PixelInterleavedSampleModel.java \
+classpath/java/awt/image/RGBImageFilter.java \
+classpath/java/awt/image/Raster.java \
+classpath/java/awt/image/RasterFormatException.java \
+classpath/java/awt/image/RasterOp.java \
+classpath/java/awt/image/RenderedImage.java \
+classpath/java/awt/image/ReplicateScaleFilter.java \
+classpath/java/awt/image/RescaleOp.java \
+classpath/java/awt/image/SampleModel.java \
+classpath/java/awt/image/ShortLookupTable.java \
+classpath/java/awt/image/SinglePixelPackedSampleModel.java \
+classpath/java/awt/image/TileObserver.java \
+classpath/java/awt/image/VolatileImage.java \
+classpath/java/awt/image/WritableRaster.java \
+classpath/java/awt/image/WritableRenderedImage.java
+
+java_awt_image_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_image_source_files)))
+java_awt_image_renderable_source_files = \
+classpath/java/awt/image/renderable/ContextualRenderedImageFactory.java \
+classpath/java/awt/image/renderable/ParameterBlock.java \
+classpath/java/awt/image/renderable/RenderContext.java \
+classpath/java/awt/image/renderable/RenderableImage.java \
+classpath/java/awt/image/renderable/RenderableImageOp.java \
+classpath/java/awt/image/renderable/RenderableImageProducer.java \
+classpath/java/awt/image/renderable/RenderedImageFactory.java
+
+java_awt_image_renderable_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_image_renderable_source_files)))
+java_awt_peer_source_files = \
+classpath/java/awt/peer/ButtonPeer.java \
+classpath/java/awt/peer/CanvasPeer.java \
+classpath/java/awt/peer/CheckboxMenuItemPeer.java \
+classpath/java/awt/peer/CheckboxPeer.java \
+classpath/java/awt/peer/ChoicePeer.java \
+classpath/java/awt/peer/ComponentPeer.java \
+classpath/java/awt/peer/ContainerPeer.java \
+classpath/java/awt/peer/DialogPeer.java \
+classpath/java/awt/peer/FileDialogPeer.java \
+classpath/java/awt/peer/FontPeer.java \
+classpath/java/awt/peer/FramePeer.java \
+classpath/java/awt/peer/LabelPeer.java \
+classpath/java/awt/peer/LightweightPeer.java \
+classpath/java/awt/peer/ListPeer.java \
+classpath/java/awt/peer/MenuBarPeer.java \
+classpath/java/awt/peer/MenuComponentPeer.java \
+classpath/java/awt/peer/MenuItemPeer.java \
+classpath/java/awt/peer/MenuPeer.java \
+classpath/java/awt/peer/PanelPeer.java \
+classpath/java/awt/peer/PopupMenuPeer.java \
+classpath/java/awt/peer/RobotPeer.java \
+classpath/java/awt/peer/ScrollPanePeer.java \
+classpath/java/awt/peer/ScrollbarPeer.java \
+classpath/java/awt/peer/TextAreaPeer.java \
+classpath/java/awt/peer/TextComponentPeer.java \
+classpath/java/awt/peer/TextFieldPeer.java \
+classpath/java/awt/peer/WindowPeer.java
+
+java_awt_peer_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_peer_source_files)))
+java_awt_print_source_files = \
+classpath/java/awt/print/Book.java \
+classpath/java/awt/print/PageFormat.java \
+classpath/java/awt/print/Pageable.java \
+classpath/java/awt/print/Paper.java \
+classpath/java/awt/print/Printable.java \
+classpath/java/awt/print/PrinterAbortException.java \
+classpath/java/awt/print/PrinterException.java \
+classpath/java/awt/print/PrinterGraphics.java \
+classpath/java/awt/print/PrinterIOException.java \
+classpath/java/awt/print/PrinterJob.java
+
+java_awt_print_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_print_source_files)))
+java_beans_source_files = \
+classpath/java/beans/AppletInitializer.java \
+classpath/java/beans/BeanDescriptor.java \
+classpath/java/beans/BeanInfo.java \
+classpath/java/beans/Beans.java \
+classpath/java/beans/Customizer.java \
+classpath/java/beans/DesignMode.java \
+classpath/java/beans/EventHandler.java \
+classpath/java/beans/EventSetDescriptor.java \
+classpath/java/beans/ExceptionListener.java \
+classpath/java/beans/Expression.java \
+classpath/java/beans/FeatureDescriptor.java \
+classpath/java/beans/IndexedPropertyDescriptor.java \
+classpath/java/beans/IntrospectionException.java \
+classpath/java/beans/Introspector.java \
+classpath/java/beans/MethodDescriptor.java \
+classpath/java/beans/ParameterDescriptor.java \
+classpath/java/beans/PropertyChangeEvent.java \
+classpath/java/beans/PropertyChangeListener.java \
+classpath/java/beans/PropertyChangeListenerProxy.java \
+classpath/java/beans/PropertyChangeSupport.java \
+classpath/java/beans/PropertyDescriptor.java \
+classpath/java/beans/PropertyEditor.java \
+classpath/java/beans/PropertyEditorManager.java \
+classpath/java/beans/PropertyEditorSupport.java \
+classpath/java/beans/PropertyVetoException.java \
+classpath/java/beans/SimpleBeanInfo.java \
+classpath/java/beans/Statement.java \
+classpath/java/beans/VetoableChangeListener.java \
+classpath/java/beans/VetoableChangeListenerProxy.java \
+classpath/java/beans/VetoableChangeSupport.java \
+classpath/java/beans/Visibility.java \
+classpath/java/beans/XMLDecoder.java
+
+java_beans_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_beans_source_files)))
+java_beans_beancontext_source_files = \
+classpath/java/beans/beancontext/BeanContext.java \
+classpath/java/beans/beancontext/BeanContextChild.java \
+classpath/java/beans/beancontext/BeanContextChildComponentProxy.java \
+classpath/java/beans/beancontext/BeanContextChildSupport.java \
+classpath/java/beans/beancontext/BeanContextContainerProxy.java \
+classpath/java/beans/beancontext/BeanContextEvent.java \
+classpath/java/beans/beancontext/BeanContextMembershipEvent.java \
+classpath/java/beans/beancontext/BeanContextMembershipListener.java \
+classpath/java/beans/beancontext/BeanContextProxy.java \
+classpath/java/beans/beancontext/BeanContextServiceAvailableEvent.java \
+classpath/java/beans/beancontext/BeanContextServiceProvider.java \
+classpath/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java \
+classpath/java/beans/beancontext/BeanContextServiceRevokedEvent.java \
+classpath/java/beans/beancontext/BeanContextServiceRevokedListener.java \
+classpath/java/beans/beancontext/BeanContextServices.java \
+classpath/java/beans/beancontext/BeanContextServicesListener.java \
+classpath/java/beans/beancontext/BeanContextServicesSupport.java \
+classpath/java/beans/beancontext/BeanContextSupport.java
+
+java_beans_beancontext_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_beans_beancontext_source_files)))
+java_io_source_files = \
+java/io/BufferedInputStream.java \
+classpath/java/io/BufferedOutputStream.java \
+classpath/java/io/BufferedReader.java \
+classpath/java/io/BufferedWriter.java \
+classpath/java/io/ByteArrayInputStream.java \
+classpath/java/io/ByteArrayOutputStream.java \
+classpath/java/io/CharArrayReader.java \
+classpath/java/io/CharArrayWriter.java \
+classpath/java/io/CharConversionException.java \
+classpath/java/io/Closeable.java \
+classpath/java/io/DataInput.java \
+classpath/java/io/DataInputStream.java \
+classpath/java/io/DataOutput.java \
+classpath/java/io/DataOutputStream.java \
+classpath/java/io/DeleteFileHelper.java \
+classpath/java/io/EOFException.java \
+classpath/java/io/Externalizable.java \
+java/io/File.java \
+classpath/java/io/FileDescriptor.java \
+classpath/java/io/FileFilter.java \
+java/io/FileInputStream.java \
+classpath/java/io/FileNotFoundException.java \
+java/io/FileOutputStream.java \
+classpath/java/io/FilePermission.java \
+classpath/java/io/FileReader.java \
+classpath/java/io/FileWriter.java \
+classpath/java/io/FilenameFilter.java \
+classpath/java/io/FilterInputStream.java \
+classpath/java/io/FilterOutputStream.java \
+classpath/java/io/FilterReader.java \
+classpath/java/io/FilterWriter.java \
+classpath/java/io/Flushable.java \
+classpath/java/io/IOException.java \
+classpath/java/io/InputStream.java \
+java/io/InputStreamReader.java \
+classpath/java/io/InterruptedIOException.java \
+classpath/java/io/InvalidClassException.java \
+classpath/java/io/InvalidObjectException.java \
+classpath/java/io/LineNumberInputStream.java \
+classpath/java/io/LineNumberReader.java \
+classpath/java/io/NotActiveException.java \
+classpath/java/io/NotSerializableException.java \
+classpath/java/io/ObjectInput.java \
+java/io/ObjectInputStream.java \
+classpath/java/io/ObjectInputValidation.java \
+classpath/java/io/ObjectOutput.java \
+classpath/java/io/ObjectOutputStream.java \
+java/io/ObjectStreamClass.java \
+classpath/java/io/ObjectStreamConstants.java \
+classpath/java/io/ObjectStreamException.java \
+classpath/java/io/ObjectStreamField.java \
+classpath/java/io/OptionalDataException.java \
+classpath/java/io/OutputStream.java \
+java/io/OutputStreamWriter.java \
+classpath/java/io/PipedInputStream.java \
+classpath/java/io/PipedOutputStream.java \
+classpath/java/io/PipedReader.java \
+classpath/java/io/PipedWriter.java \
+java/io/PrintStream.java \
+classpath/java/io/PrintWriter.java \
+classpath/java/io/PushbackInputStream.java \
+classpath/java/io/PushbackReader.java \
+java/io/RandomAccessFile.java \
+classpath/java/io/Reader.java \
+classpath/java/io/SequenceInputStream.java \
+classpath/java/io/Serializable.java \
+classpath/java/io/SerializablePermission.java \
+classpath/java/io/StreamCorruptedException.java \
+classpath/java/io/StreamTokenizer.java \
+classpath/java/io/StringBufferInputStream.java \
+classpath/java/io/StringReader.java \
+classpath/java/io/StringWriter.java \
+classpath/java/io/SyncFailedException.java \
+classpath/java/io/UTFDataFormatException.java \
+classpath/java/io/UnsupportedEncodingException.java \
+java/io/VMObjectStreamClass.java \
+classpath/java/io/WriteAbortedException.java \
+classpath/java/io/Writer.java
+
+java_io_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_io_source_files))))
+java_lang_source_files = \
+classpath/java/lang/AbstractMethodError.java \
+classpath/java/lang/Appendable.java \
+classpath/java/lang/ArithmeticException.java \
+classpath/java/lang/ArrayIndexOutOfBoundsException.java \
+classpath/java/lang/ArrayStoreException.java \
+classpath/java/lang/AssertionError.java \
+classpath/java/lang/Boolean.java \
+classpath/java/lang/Byte.java \
+classpath/java/lang/CharSequence.java \
+java/lang/Character.java \
+classpath/java/lang/ClassCastException.java \
+classpath/java/lang/ClassCircularityError.java \
+classpath/java/lang/ClassFormatError.java \
+java/lang/ClassLoader.java \
+classpath/java/lang/ClassNotFoundException.java \
+classpath/java/lang/CloneNotSupportedException.java \
+classpath/java/lang/Cloneable.java \
+classpath/java/lang/Comparable.java \
+classpath/java/lang/Compiler.java \
+java/lang/ConcreteProcess.java \
+java/lang/Double.java \
+classpath/java/lang/Error.java \
+classpath/java/lang/Exception.java \
+classpath/java/lang/ExceptionInInitializerError.java \
+java/lang/Float.java \
+classpath/java/lang/IllegalAccessError.java \
+classpath/java/lang/IllegalAccessException.java \
+classpath/java/lang/IllegalArgumentException.java \
+classpath/java/lang/IllegalMonitorStateException.java \
+classpath/java/lang/IllegalStateException.java \
+classpath/java/lang/IllegalThreadStateException.java \
+classpath/java/lang/IncompatibleClassChangeError.java \
+classpath/java/lang/IndexOutOfBoundsException.java \
+java/lang/InheritableThreadLocal.java \
+classpath/java/lang/InstantiationError.java \
+classpath/java/lang/InstantiationException.java \
+classpath/java/lang/Integer.java \
+classpath/java/lang/InternalError.java \
+classpath/java/lang/InterruptedException.java \
+classpath/java/lang/LinkageError.java \
+classpath/java/lang/Long.java \
+classpath/java/lang/Math.java \
+classpath/java/lang/NegativeArraySizeException.java \
+classpath/java/lang/NoClassDefFoundError.java \
+classpath/java/lang/NoSuchFieldError.java \
+classpath/java/lang/NoSuchFieldException.java \
+classpath/java/lang/NoSuchMethodError.java \
+classpath/java/lang/NoSuchMethodException.java \
+classpath/java/lang/NullPointerException.java \
+classpath/java/lang/Number.java \
+classpath/java/lang/NumberFormatException.java \
+classpath/java/lang/OutOfMemoryError.java \
+java/lang/Package.java \
+classpath/java/lang/Process.java \
+classpath/java/lang/Readable.java \
+classpath/java/lang/Runnable.java \
+java/lang/Runtime.java \
+classpath/java/lang/RuntimeException.java \
+classpath/java/lang/RuntimePermission.java \
+classpath/java/lang/SecurityException.java \
+java/lang/SecurityManager.java \
+classpath/java/lang/Short.java \
+classpath/java/lang/StackOverflowError.java \
+classpath/java/lang/StackTraceElement.java \
+classpath/java/lang/StrictMath.java \
+java/lang/String.java \
+java/lang/StringBuffer.java \
+java/lang/StringBuilder.java \
+classpath/java/lang/StringIndexOutOfBoundsException.java \
+java/lang/System.java \
+java/lang/Thread.java \
+classpath/java/lang/ThreadDeath.java \
+classpath/java/lang/ThreadGroup.java \
+java/lang/ThreadLocal.java \
+classpath/java/lang/Throwable.java \
+classpath/java/lang/TypeNotPresentException.java \
+classpath/java/lang/UnknownError.java \
+classpath/java/lang/UnsatisfiedLinkError.java \
+classpath/java/lang/UnsupportedClassVersionError.java \
+classpath/java/lang/UnsupportedOperationException.java \
+java/lang/VMClassLoader.java \
+java/lang/VMCompiler.java \
+java/lang/VMSecurityManager.java \
+java/lang/VMThrowable.java \
+classpath/java/lang/VerifyError.java \
+classpath/java/lang/VirtualMachineError.java \
+classpath/java/lang/Void.java
+
+java_lang_header_files = $(filter-out java/lang/Object.h java/lang/Class.h,$(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_lang_source_files)))))
+java_lang_annotation_source_files = \
+classpath/java/lang/annotation/AnnotationFormatError.java \
+classpath/java/lang/annotation/AnnotationTypeMismatchException.java
+
+java_lang_annotation_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_lang_annotation_source_files)))
+java_lang_ref_source_files = \
+classpath/java/lang/ref/PhantomReference.java \
java/lang/ref/Reference.java \
-java/lang/ref/ReferenceQueue.java \
-java/lang/ref/SoftReference.java \
-java/lang/ref/WeakReference.java \
-java/lang/reflect/AccessibleObject.java \
+classpath/java/lang/ref/ReferenceQueue.java \
+classpath/java/lang/ref/SoftReference.java \
+classpath/java/lang/ref/WeakReference.java
+
+java_lang_ref_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_lang_ref_source_files))))
+java_lang_reflect_source_files = \
+classpath/java/lang/reflect/AccessibleObject.java \
java/lang/reflect/Array.java \
java/lang/reflect/Constructor.java \
java/lang/reflect/Field.java \
-java/lang/reflect/InvocationHandler.java \
-java/lang/reflect/InvocationTargetException.java \
-java/lang/reflect/Member.java \
+classpath/java/lang/reflect/GenericArrayType.java \
+classpath/java/lang/reflect/GenericSignatureFormatError.java \
+classpath/java/lang/reflect/InvocationHandler.java \
+classpath/java/lang/reflect/InvocationTargetException.java \
+classpath/java/lang/reflect/Member.java \
java/lang/reflect/Method.java \
-java/lang/reflect/Modifier.java \
-java/lang/reflect/Proxy.java \
-java/lang/reflect/ReflectPermission.java \
-java/lang/reflect/UndeclaredThrowableException.java \
-java/math/BigDecimal.java \
-java/math/BigInteger.java \
-java/net/Authenticator.java \
-java/net/BindException.java \
-java/net/ConnectException.java \
-java/net/ContentHandler.java \
-java/net/ContentHandlerFactory.java \
-java/net/DatagramPacket.java \
-java/net/DatagramSocket.java \
-java/net/DatagramSocketImpl.java \
-java/net/DatagramSocketImplFactory.java \
-java/net/FileNameMap.java \
-java/net/HttpURLConnection.java \
-java/net/Inet4Address.java \
-java/net/Inet6Address.java \
+java/lang/reflect/Modifier.java \
+classpath/java/lang/reflect/ParameterizedType.java \
+classpath/java/lang/reflect/Proxy.java \
+classpath/java/lang/reflect/ReflectPermission.java \
+classpath/java/lang/reflect/Type.java \
+classpath/java/lang/reflect/UndeclaredThrowableException.java \
+classpath/java/lang/reflect/WildcardType.java
+
+java_lang_reflect_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_lang_reflect_source_files))))
+java_math_source_files = \
+classpath/java/math/BigDecimal.java \
+classpath/java/math/BigInteger.java
+
+java_math_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_math_source_files)))
+java_net_source_files = \
+classpath/java/net/Authenticator.java \
+classpath/java/net/BindException.java \
+classpath/java/net/ConnectException.java \
+classpath/java/net/ContentHandler.java \
+classpath/java/net/ContentHandlerFactory.java \
+classpath/java/net/DatagramPacket.java \
+classpath/java/net/DatagramSocket.java \
+classpath/java/net/DatagramSocketImpl.java \
+classpath/java/net/DatagramSocketImplFactory.java \
+classpath/java/net/FileNameMap.java \
+classpath/java/net/HttpURLConnection.java \
+classpath/java/net/Inet4Address.java \
+classpath/java/net/Inet6Address.java \
java/net/InetAddress.java \
-java/net/InetSocketAddress.java \
+classpath/java/net/InetSocketAddress.java \
java/net/JarURLConnection.java \
-java/net/MalformedURLException.java \
-java/net/MulticastSocket.java \
-java/net/NetPermission.java \
-java/net/NetworkInterface.java \
-java/net/NoRouteToHostException.java \
-java/net/PasswordAuthentication.java \
-java/net/PortUnreachableException.java \
-java/net/ProtocolException.java \
+classpath/java/net/MalformedURLException.java \
+classpath/java/net/MimeTypeMapper.java \
+classpath/java/net/MulticastSocket.java \
+classpath/java/net/NetPermission.java \
+classpath/java/net/NetworkInterface.java \
+classpath/java/net/NoRouteToHostException.java \
+classpath/java/net/PasswordAuthentication.java \
+classpath/java/net/PortUnreachableException.java \
+classpath/java/net/ProtocolException.java \
java/net/ServerSocket.java \
-java/net/Socket.java \
-java/net/SocketAddress.java \
-java/net/SocketException.java \
-java/net/SocketImpl.java \
-java/net/SocketImplFactory.java \
-java/net/SocketOptions.java \
-java/net/SocketPermission.java \
-java/net/SocketTimeoutException.java \
-java/net/URI.java \
-java/net/URISyntaxException.java \
+classpath/java/net/Socket.java \
+classpath/java/net/SocketAddress.java \
+classpath/java/net/SocketException.java \
+classpath/java/net/SocketImpl.java \
+classpath/java/net/SocketImplFactory.java \
+classpath/java/net/SocketOptions.java \
+classpath/java/net/SocketPermission.java \
+classpath/java/net/SocketTimeoutException.java \
+classpath/java/net/URI.java \
+classpath/java/net/URISyntaxException.java \
java/net/URL.java \
java/net/URLClassLoader.java \
java/net/URLConnection.java \
-java/net/URLDecoder.java \
-java/net/URLEncoder.java \
-java/net/URLStreamHandler.java \
-java/net/URLStreamHandlerFactory.java \
-java/net/UnknownHostException.java \
-java/net/UnknownServiceException.java \
-java/net/VMNetworkInterface.java \
+classpath/java/net/URLDecoder.java \
+classpath/java/net/URLEncoder.java \
+classpath/java/net/URLStreamHandler.java \
+classpath/java/net/URLStreamHandlerFactory.java \
+classpath/java/net/UnknownHostException.java \
+classpath/java/net/UnknownServiceException.java \
+java/net/VMNetworkInterface.java
+
+java_net_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_net_source_files))))
+java_nio_source_files = \
java/nio/Buffer.java \
-java/nio/BufferOverflowException.java \
-java/nio/BufferUnderflowException.java \
-java/nio/ByteBuffer.java \
-java/nio/ByteBufferHelper.java \
-java/nio/ByteBufferImpl.java \
-java/nio/ByteOrder.java \
-java/nio/CharBuffer.java \
-java/nio/CharBufferImpl.java \
-java/nio/CharViewBufferImpl.java \
+classpath/java/nio/BufferOverflowException.java \
+classpath/java/nio/BufferUnderflowException.java \
+classpath/java/nio/ByteBuffer.java \
+classpath/java/nio/ByteBufferHelper.java \
+classpath/java/nio/ByteBufferImpl.java \
+classpath/java/nio/ByteOrder.java \
+classpath/java/nio/CharBuffer.java \
+classpath/java/nio/CharBufferImpl.java \
+classpath/java/nio/CharViewBufferImpl.java \
java/nio/DirectByteBufferImpl.java \
-java/nio/DoubleBuffer.java \
-java/nio/DoubleBufferImpl.java \
-java/nio/DoubleViewBufferImpl.java \
-java/nio/FloatBuffer.java \
-java/nio/FloatBufferImpl.java \
-java/nio/FloatViewBufferImpl.java \
-java/nio/IntBuffer.java \
-java/nio/IntBufferImpl.java \
-java/nio/IntViewBufferImpl.java \
-java/nio/InvalidMarkException.java \
-java/nio/LongBuffer.java \
-java/nio/LongBufferImpl.java \
-java/nio/LongViewBufferImpl.java \
+classpath/java/nio/DoubleBuffer.java \
+classpath/java/nio/DoubleBufferImpl.java \
+classpath/java/nio/DoubleViewBufferImpl.java \
+classpath/java/nio/FloatBuffer.java \
+classpath/java/nio/FloatBufferImpl.java \
+classpath/java/nio/FloatViewBufferImpl.java \
+classpath/java/nio/IntBuffer.java \
+classpath/java/nio/IntBufferImpl.java \
+classpath/java/nio/IntViewBufferImpl.java \
+classpath/java/nio/InvalidMarkException.java \
+classpath/java/nio/LongBuffer.java \
+classpath/java/nio/LongBufferImpl.java \
+classpath/java/nio/LongViewBufferImpl.java \
java/nio/MappedByteBuffer.java \
java/nio/MappedByteBufferImpl.java \
-java/nio/ReadOnlyBufferException.java \
-java/nio/ShortBuffer.java \
-java/nio/ShortBufferImpl.java \
-java/nio/ShortViewBufferImpl.java \
-java/nio/VMDirectByteBuffer.java \
-java/nio/channels/AlreadyConnectedException.java \
-java/nio/channels/AsynchronousCloseException.java \
-java/nio/channels/ByteChannel.java \
-java/nio/channels/CancelledKeyException.java \
-java/nio/channels/Channel.java \
+classpath/java/nio/ReadOnlyBufferException.java \
+classpath/java/nio/ShortBuffer.java \
+classpath/java/nio/ShortBufferImpl.java \
+classpath/java/nio/ShortViewBufferImpl.java \
+java/nio/VMDirectByteBuffer.java
+
+java_nio_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_nio_source_files))))
+java_nio_channels_source_files = \
+classpath/java/nio/channels/AlreadyConnectedException.java \
+classpath/java/nio/channels/AsynchronousCloseException.java \
+classpath/java/nio/channels/ByteChannel.java \
+classpath/java/nio/channels/CancelledKeyException.java \
+classpath/java/nio/channels/Channel.java \
java/nio/channels/Channels.java \
-java/nio/channels/ClosedByInterruptException.java \
-java/nio/channels/ClosedChannelException.java \
-java/nio/channels/ClosedSelectorException.java \
-java/nio/channels/ConnectionPendingException.java \
-java/nio/channels/DatagramChannel.java \
-java/nio/channels/FileChannel.java \
-java/nio/channels/FileLock.java \
-java/nio/channels/FileLockInterruptionException.java \
-java/nio/channels/GatheringByteChannel.java \
-java/nio/channels/IllegalBlockingModeException.java \
-java/nio/channels/IllegalSelectorException.java \
-java/nio/channels/InterruptibleChannel.java \
-java/nio/channels/NoConnectionPendingException.java \
-java/nio/channels/NonReadableChannelException.java \
-java/nio/channels/NonWritableChannelException.java \
-java/nio/channels/NotYetBoundException.java \
-java/nio/channels/NotYetConnectedException.java \
-java/nio/channels/OverlappingFileLockException.java \
-java/nio/channels/Pipe.java \
-java/nio/channels/ReadableByteChannel.java \
-java/nio/channels/ScatteringByteChannel.java \
-java/nio/channels/SelectableChannel.java \
-java/nio/channels/SelectionKey.java \
-java/nio/channels/Selector.java \
-java/nio/channels/ServerSocketChannel.java \
-java/nio/channels/SocketChannel.java \
-java/nio/channels/UnresolvedAddressException.java \
-java/nio/channels/UnsupportedAddressTypeException.java \
-java/nio/channels/WritableByteChannel.java \
-java/nio/channels/spi/AbstractInterruptibleChannel.java \
-java/nio/channels/spi/AbstractSelectableChannel.java \
-java/nio/channels/spi/AbstractSelectionKey.java \
-java/nio/channels/spi/AbstractSelector.java \
-java/nio/channels/spi/SelectorProvider.java \
-java/nio/charset/CharacterCodingException.java \
+classpath/java/nio/channels/ClosedByInterruptException.java \
+classpath/java/nio/channels/ClosedChannelException.java \
+classpath/java/nio/channels/ClosedSelectorException.java \
+classpath/java/nio/channels/ConnectionPendingException.java \
+classpath/java/nio/channels/DatagramChannel.java \
+classpath/java/nio/channels/FileChannel.java \
+classpath/java/nio/channels/FileLock.java \
+classpath/java/nio/channels/FileLockInterruptionException.java \
+classpath/java/nio/channels/GatheringByteChannel.java \
+classpath/java/nio/channels/IllegalBlockingModeException.java \
+classpath/java/nio/channels/IllegalSelectorException.java \
+classpath/java/nio/channels/InterruptibleChannel.java \
+classpath/java/nio/channels/NoConnectionPendingException.java \
+classpath/java/nio/channels/NonReadableChannelException.java \
+classpath/java/nio/channels/NonWritableChannelException.java \
+classpath/java/nio/channels/NotYetBoundException.java \
+classpath/java/nio/channels/NotYetConnectedException.java \
+classpath/java/nio/channels/OverlappingFileLockException.java \
+classpath/java/nio/channels/Pipe.java \
+classpath/java/nio/channels/ReadableByteChannel.java \
+classpath/java/nio/channels/ScatteringByteChannel.java \
+classpath/java/nio/channels/SelectableChannel.java \
+classpath/java/nio/channels/SelectionKey.java \
+classpath/java/nio/channels/Selector.java \
+classpath/java/nio/channels/ServerSocketChannel.java \
+classpath/java/nio/channels/SocketChannel.java \
+classpath/java/nio/channels/UnresolvedAddressException.java \
+classpath/java/nio/channels/UnsupportedAddressTypeException.java \
+classpath/java/nio/channels/WritableByteChannel.java
+
+java_nio_channels_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_nio_channels_source_files))))
+java_nio_channels_spi_source_files = \
+classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java \
+classpath/java/nio/channels/spi/AbstractSelectableChannel.java \
+classpath/java/nio/channels/spi/AbstractSelectionKey.java \
+classpath/java/nio/channels/spi/AbstractSelector.java \
+classpath/java/nio/channels/spi/SelectorProvider.java
+
+java_nio_channels_spi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_nio_channels_spi_source_files)))
+java_nio_charset_source_files = \
+classpath/java/nio/charset/CharacterCodingException.java \
java/nio/charset/Charset.java \
-java/nio/charset/CharsetDecoder.java \
-java/nio/charset/CharsetEncoder.java \
-java/nio/charset/CoderMalfunctionError.java \
-java/nio/charset/CoderResult.java \
-java/nio/charset/CodingErrorAction.java \
-java/nio/charset/IllegalCharsetNameException.java \
-java/nio/charset/MalformedInputException.java \
-java/nio/charset/UnmappableCharacterException.java \
-java/nio/charset/UnsupportedCharsetException.java \
-java/nio/charset/spi/CharsetProvider.java \
+classpath/java/nio/charset/CharsetDecoder.java \
+classpath/java/nio/charset/CharsetEncoder.java \
+classpath/java/nio/charset/CoderMalfunctionError.java \
+classpath/java/nio/charset/CoderResult.java \
+classpath/java/nio/charset/CodingErrorAction.java \
+classpath/java/nio/charset/IllegalCharsetNameException.java \
+classpath/java/nio/charset/MalformedInputException.java \
+classpath/java/nio/charset/UnmappableCharacterException.java \
+classpath/java/nio/charset/UnsupportedCharsetException.java
+
+java_nio_charset_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_nio_charset_source_files))))
+java_nio_charset_spi_source_files = \
+classpath/java/nio/charset/spi/CharsetProvider.java
+
+java_nio_charset_spi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_nio_charset_spi_source_files)))
+java_rmi_source_files = \
+classpath/java/rmi/AccessException.java \
+classpath/java/rmi/AlreadyBoundException.java \
+classpath/java/rmi/ConnectException.java \
+classpath/java/rmi/ConnectIOException.java \
+classpath/java/rmi/MarshalException.java \
+classpath/java/rmi/MarshalledObject.java \
+classpath/java/rmi/Naming.java \
+classpath/java/rmi/NoSuchObjectException.java \
+classpath/java/rmi/NotBoundException.java \
+classpath/java/rmi/RMISecurityException.java \
+classpath/java/rmi/RMISecurityManager.java \
+classpath/java/rmi/Remote.java \
+classpath/java/rmi/RemoteException.java \
+classpath/java/rmi/ServerError.java \
+classpath/java/rmi/ServerException.java \
+classpath/java/rmi/ServerRuntimeException.java \
+classpath/java/rmi/StubNotFoundException.java \
+classpath/java/rmi/UnexpectedException.java \
+classpath/java/rmi/UnknownHostException.java \
+classpath/java/rmi/UnmarshalException.java
+
+java_rmi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_rmi_source_files)))
+java_rmi_activation_source_files = \
+classpath/java/rmi/activation/Activatable.java \
+classpath/java/rmi/activation/ActivateFailedException.java \
+classpath/java/rmi/activation/ActivationDesc.java \
+classpath/java/rmi/activation/ActivationException.java \
+classpath/java/rmi/activation/ActivationGroup.java \
+classpath/java/rmi/activation/ActivationGroupDesc.java \
+classpath/java/rmi/activation/ActivationGroupID.java \
+classpath/java/rmi/activation/ActivationID.java \
+classpath/java/rmi/activation/ActivationInstantiator.java \
+classpath/java/rmi/activation/ActivationMonitor.java \
+classpath/java/rmi/activation/ActivationSystem.java \
+classpath/java/rmi/activation/Activator.java \
+classpath/java/rmi/activation/UnknownGroupException.java \
+classpath/java/rmi/activation/UnknownObjectException.java
+
+java_rmi_activation_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_rmi_activation_source_files)))
+java_rmi_dgc_source_files = \
+classpath/java/rmi/dgc/DGC.java \
+classpath/java/rmi/dgc/Lease.java \
+classpath/java/rmi/dgc/VMID.java
+
+java_rmi_dgc_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_rmi_dgc_source_files)))
+java_rmi_registry_source_files = \
+classpath/java/rmi/registry/LocateRegistry.java \
+classpath/java/rmi/registry/Registry.java \
+classpath/java/rmi/registry/RegistryHandler.java
+
+java_rmi_registry_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_rmi_registry_source_files)))
+java_rmi_server_source_files = \
+classpath/java/rmi/server/ExportException.java \
+classpath/java/rmi/server/LoaderHandler.java \
+classpath/java/rmi/server/LogStream.java \
+classpath/java/rmi/server/ObjID.java \
+classpath/java/rmi/server/Operation.java \
+classpath/java/rmi/server/RMIClassLoader.java \
+classpath/java/rmi/server/RMIClassLoaderSpi.java \
+classpath/java/rmi/server/RMIClientSocketFactory.java \
+classpath/java/rmi/server/RMIFailureHandler.java \
+classpath/java/rmi/server/RMIServerSocketFactory.java \
+classpath/java/rmi/server/RMISocketFactory.java \
+classpath/java/rmi/server/RemoteCall.java \
+classpath/java/rmi/server/RemoteObject.java \
+classpath/java/rmi/server/RemoteRef.java \
+classpath/java/rmi/server/RemoteServer.java \
+classpath/java/rmi/server/RemoteStub.java \
+classpath/java/rmi/server/ServerCloneException.java \
+classpath/java/rmi/server/ServerNotActiveException.java \
+classpath/java/rmi/server/ServerRef.java \
+classpath/java/rmi/server/Skeleton.java \
+classpath/java/rmi/server/SkeletonMismatchException.java \
+classpath/java/rmi/server/SkeletonNotFoundException.java \
+classpath/java/rmi/server/SocketSecurityException.java \
+classpath/java/rmi/server/UID.java \
+classpath/java/rmi/server/UnicastRemoteObject.java \
+classpath/java/rmi/server/Unreferenced.java
+
+java_rmi_server_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_rmi_server_source_files)))
+java_security_source_files = \
java/security/AccessControlContext.java \
-java/security/AccessControlException.java \
+classpath/java/security/AccessControlException.java \
java/security/AccessController.java \
-java/security/AlgorithmParameterGenerator.java \
-java/security/AlgorithmParameterGeneratorSpi.java \
-java/security/AlgorithmParameters.java \
-java/security/AlgorithmParametersSpi.java \
-java/security/AllPermission.java \
-java/security/BasicPermission.java \
-java/security/Certificate.java \
-java/security/CodeSource.java \
-java/security/DigestException.java \
-java/security/DigestInputStream.java \
-java/security/DigestOutputStream.java \
-java/security/DomainCombiner.java \
-java/security/DummyKeyPairGenerator.java \
-java/security/DummyMessageDigest.java \
-java/security/DummySignature.java \
-java/security/GeneralSecurityException.java \
-java/security/Guard.java \
-java/security/GuardedObject.java \
-java/security/Identity.java \
-java/security/IdentityScope.java \
-java/security/InvalidAlgorithmParameterException.java \
-java/security/InvalidKeyException.java \
-java/security/InvalidParameterException.java \
-java/security/Key.java \
-java/security/KeyException.java \
-java/security/KeyFactory.java \
-java/security/KeyFactorySpi.java \
-java/security/KeyManagementException.java \
-java/security/KeyPair.java \
-java/security/KeyPairGenerator.java \
-java/security/KeyPairGeneratorSpi.java \
-java/security/KeyStore.java \
-java/security/KeyStoreException.java \
-java/security/KeyStoreSpi.java \
-java/security/MessageDigest.java \
-java/security/MessageDigestSpi.java \
-java/security/NoSuchAlgorithmException.java \
-java/security/NoSuchProviderException.java \
-java/security/Permission.java \
-java/security/PermissionCollection.java \
-java/security/Permissions.java \
-java/security/Policy.java \
-java/security/Principal.java \
-java/security/PrivateKey.java \
-java/security/PrivilegedAction.java \
-java/security/PrivilegedActionException.java \
-java/security/PrivilegedExceptionAction.java \
-java/security/ProtectionDomain.java \
-java/security/Provider.java \
-java/security/ProviderException.java \
-java/security/PublicKey.java \
-java/security/SecureClassLoader.java \
-java/security/SecureRandom.java \
-java/security/SecureRandomSpi.java \
-java/security/Security.java \
-java/security/SecurityPermission.java \
-java/security/Signature.java \
-java/security/SignatureException.java \
-java/security/SignatureSpi.java \
-java/security/SignedObject.java \
-java/security/Signer.java \
-java/security/UnrecoverableKeyException.java \
-java/security/UnresolvedPermission.java \
-java/security/acl/Acl.java \
-java/security/acl/AclEntry.java \
-java/security/acl/AclNotFoundException.java \
-java/security/acl/Group.java \
-java/security/acl/LastOwnerException.java \
-java/security/acl/NotOwnerException.java \
-java/security/acl/Owner.java \
-java/security/acl/Permission.java \
-java/security/cert/CRL.java \
-java/security/cert/CRLException.java \
-java/security/cert/CRLSelector.java \
-java/security/cert/CertPath.java \
-java/security/cert/CertPathBuilder.java \
-java/security/cert/CertPathBuilderException.java \
-java/security/cert/CertPathBuilderResult.java \
-java/security/cert/CertPathBuilderSpi.java \
-java/security/cert/CertPathParameters.java \
-java/security/cert/CertPathValidator.java \
-java/security/cert/CertPathValidatorException.java \
-java/security/cert/CertPathValidatorResult.java \
-java/security/cert/CertPathValidatorSpi.java \
-java/security/cert/CertSelector.java \
-java/security/cert/CertStore.java \
-java/security/cert/CertStoreException.java \
-java/security/cert/CertStoreParameters.java \
-java/security/cert/CertStoreSpi.java \
-java/security/cert/Certificate.java \
-java/security/cert/CertificateEncodingException.java \
-java/security/cert/CertificateException.java \
-java/security/cert/CertificateExpiredException.java \
-java/security/cert/CertificateFactory.java \
-java/security/cert/CertificateFactorySpi.java \
-java/security/cert/CertificateNotYetValidException.java \
-java/security/cert/CertificateParsingException.java \
-java/security/cert/CollectionCertStoreParameters.java \
-java/security/cert/LDAPCertStoreParameters.java \
-java/security/cert/PKIXBuilderParameters.java \
-java/security/cert/PKIXCertPathBuilderResult.java \
-java/security/cert/PKIXCertPathChecker.java \
-java/security/cert/PKIXCertPathValidatorResult.java \
-java/security/cert/PKIXParameters.java \
-java/security/cert/PolicyNode.java \
-java/security/cert/PolicyQualifierInfo.java \
-java/security/cert/TrustAnchor.java \
-java/security/cert/X509CRL.java \
-java/security/cert/X509CRLEntry.java \
-java/security/cert/X509CRLSelector.java \
-java/security/cert/X509CertSelector.java \
-java/security/cert/X509Certificate.java \
-java/security/cert/X509Extension.java \
-java/security/interfaces/DSAKey.java \
-java/security/interfaces/DSAKeyPairGenerator.java \
-java/security/interfaces/DSAParams.java \
-java/security/interfaces/DSAPrivateKey.java \
-java/security/interfaces/DSAPublicKey.java \
-java/security/interfaces/RSAKey.java \
-java/security/interfaces/RSAMultiPrimePrivateCrtKey.java \
-java/security/interfaces/RSAPrivateCrtKey.java \
-java/security/interfaces/RSAPrivateKey.java \
-java/security/interfaces/RSAPublicKey.java \
-java/security/spec/AlgorithmParameterSpec.java \
-java/security/spec/DSAParameterSpec.java \
-java/security/spec/DSAPrivateKeySpec.java \
-java/security/spec/DSAPublicKeySpec.java \
-java/security/spec/EncodedKeySpec.java \
-java/security/spec/InvalidKeySpecException.java \
-java/security/spec/InvalidParameterSpecException.java \
-java/security/spec/KeySpec.java \
-java/security/spec/PKCS8EncodedKeySpec.java \
-java/security/spec/PSSParameterSpec.java \
-java/security/spec/RSAKeyGenParameterSpec.java \
-java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java\
-java/security/spec/RSAOtherPrimeInfo.java \
-java/security/spec/RSAPrivateCrtKeySpec.java \
-java/security/spec/RSAPrivateKeySpec.java \
-java/security/spec/RSAPublicKeySpec.java \
-java/security/spec/X509EncodedKeySpec.java \
-java/sql/Array.java \
-java/sql/BatchUpdateException.java \
-java/sql/Blob.java \
-java/sql/CallableStatement.java \
-java/sql/Clob.java \
-java/sql/Connection.java \
-java/sql/DataTruncation.java \
-java/sql/DatabaseMetaData.java \
-java/sql/Date.java \
-java/sql/Driver.java \
-java/sql/DriverManager.java \
-java/sql/DriverPropertyInfo.java \
-java/sql/ParameterMetaData.java \
-java/sql/PreparedStatement.java \
-java/sql/Ref.java \
-java/sql/ResultSet.java \
-java/sql/ResultSetMetaData.java \
-java/sql/SQLData.java \
-java/sql/SQLException.java \
-java/sql/SQLInput.java \
-java/sql/SQLOutput.java \
-java/sql/SQLPermission.java \
-java/sql/SQLWarning.java \
-java/sql/Savepoint.java \
-java/sql/Statement.java \
-java/sql/Struct.java \
-java/sql/Time.java \
-java/sql/Timestamp.java \
-java/sql/Types.java \
-java/text/Annotation.java \
-java/text/AttributedCharacterIterator.java \
-java/text/AttributedString.java \
-java/text/AttributedStringIterator.java \
-java/text/BreakIterator.java \
-java/text/CharacterIterator.java \
-java/text/ChoiceFormat.java \
-java/text/CollationElementIterator.java \
-java/text/CollationKey.java \
-java/text/Collator.java \
+classpath/java/security/AlgorithmParameterGenerator.java \
+classpath/java/security/AlgorithmParameterGeneratorSpi.java \
+classpath/java/security/AlgorithmParameters.java \
+classpath/java/security/AlgorithmParametersSpi.java \
+classpath/java/security/AllPermission.java \
+classpath/java/security/BasicPermission.java \
+classpath/java/security/Certificate.java \
+classpath/java/security/CodeSource.java \
+classpath/java/security/DigestException.java \
+classpath/java/security/DigestInputStream.java \
+classpath/java/security/DigestOutputStream.java \
+classpath/java/security/DomainCombiner.java \
+classpath/java/security/DummyKeyPairGenerator.java \
+classpath/java/security/DummyMessageDigest.java \
+classpath/java/security/DummySignature.java \
+classpath/java/security/GeneralSecurityException.java \
+classpath/java/security/Guard.java \
+classpath/java/security/GuardedObject.java \
+classpath/java/security/Identity.java \
+classpath/java/security/IdentityScope.java \
+classpath/java/security/IntersectingDomainCombiner.java \
+classpath/java/security/InvalidAlgorithmParameterException.java \
+classpath/java/security/InvalidKeyException.java \
+classpath/java/security/InvalidParameterException.java \
+classpath/java/security/Key.java \
+classpath/java/security/KeyException.java \
+classpath/java/security/KeyFactory.java \
+classpath/java/security/KeyFactorySpi.java \
+classpath/java/security/KeyManagementException.java \
+classpath/java/security/KeyPair.java \
+classpath/java/security/KeyPairGenerator.java \
+classpath/java/security/KeyPairGeneratorSpi.java \
+classpath/java/security/KeyStore.java \
+classpath/java/security/KeyStoreException.java \
+classpath/java/security/KeyStoreSpi.java \
+classpath/java/security/MessageDigest.java \
+classpath/java/security/MessageDigestSpi.java \
+classpath/java/security/NoSuchAlgorithmException.java \
+classpath/java/security/NoSuchProviderException.java \
+classpath/java/security/Permission.java \
+classpath/java/security/PermissionCollection.java \
+classpath/java/security/Permissions.java \
+classpath/java/security/Policy.java \
+classpath/java/security/Principal.java \
+classpath/java/security/PrivateKey.java \
+classpath/java/security/PrivilegedAction.java \
+classpath/java/security/PrivilegedActionException.java \
+classpath/java/security/PrivilegedExceptionAction.java \
+classpath/java/security/ProtectionDomain.java \
+classpath/java/security/Provider.java \
+classpath/java/security/ProviderException.java \
+classpath/java/security/PublicKey.java \
+classpath/java/security/SecureClassLoader.java \
+classpath/java/security/SecureRandom.java \
+classpath/java/security/SecureRandomSpi.java \
+classpath/java/security/Security.java \
+classpath/java/security/SecurityPermission.java \
+classpath/java/security/Signature.java \
+classpath/java/security/SignatureException.java \
+classpath/java/security/SignatureSpi.java \
+classpath/java/security/SignedObject.java \
+classpath/java/security/Signer.java \
+classpath/java/security/UnrecoverableKeyException.java \
+classpath/java/security/UnresolvedPermission.java
+
+java_security_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_security_source_files))))
+java_security_acl_source_files = \
+classpath/java/security/acl/Acl.java \
+classpath/java/security/acl/AclEntry.java \
+classpath/java/security/acl/AclNotFoundException.java \
+classpath/java/security/acl/Group.java \
+classpath/java/security/acl/LastOwnerException.java \
+classpath/java/security/acl/NotOwnerException.java \
+classpath/java/security/acl/Owner.java \
+classpath/java/security/acl/Permission.java
+
+java_security_acl_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_security_acl_source_files)))
+java_security_cert_source_files = \
+classpath/java/security/cert/CRL.java \
+classpath/java/security/cert/CRLException.java \
+classpath/java/security/cert/CRLSelector.java \
+classpath/java/security/cert/CertPath.java \
+classpath/java/security/cert/CertPathBuilder.java \
+classpath/java/security/cert/CertPathBuilderException.java \
+classpath/java/security/cert/CertPathBuilderResult.java \
+classpath/java/security/cert/CertPathBuilderSpi.java \
+classpath/java/security/cert/CertPathParameters.java \
+classpath/java/security/cert/CertPathValidator.java \
+classpath/java/security/cert/CertPathValidatorException.java \
+classpath/java/security/cert/CertPathValidatorResult.java \
+classpath/java/security/cert/CertPathValidatorSpi.java \
+classpath/java/security/cert/CertSelector.java \
+classpath/java/security/cert/CertStore.java \
+classpath/java/security/cert/CertStoreException.java \
+classpath/java/security/cert/CertStoreParameters.java \
+classpath/java/security/cert/CertStoreSpi.java \
+classpath/java/security/cert/Certificate.java \
+classpath/java/security/cert/CertificateEncodingException.java \
+classpath/java/security/cert/CertificateException.java \
+classpath/java/security/cert/CertificateExpiredException.java \
+classpath/java/security/cert/CertificateFactory.java \
+classpath/java/security/cert/CertificateFactorySpi.java \
+classpath/java/security/cert/CertificateNotYetValidException.java \
+classpath/java/security/cert/CertificateParsingException.java \
+classpath/java/security/cert/CollectionCertStoreParameters.java \
+classpath/java/security/cert/LDAPCertStoreParameters.java \
+classpath/java/security/cert/PKIXBuilderParameters.java \
+classpath/java/security/cert/PKIXCertPathBuilderResult.java \
+classpath/java/security/cert/PKIXCertPathChecker.java \
+classpath/java/security/cert/PKIXCertPathValidatorResult.java \
+classpath/java/security/cert/PKIXParameters.java \
+classpath/java/security/cert/PolicyNode.java \
+classpath/java/security/cert/PolicyQualifierInfo.java \
+classpath/java/security/cert/TrustAnchor.java \
+classpath/java/security/cert/X509CRL.java \
+classpath/java/security/cert/X509CRLEntry.java \
+classpath/java/security/cert/X509CRLSelector.java \
+classpath/java/security/cert/X509CertSelector.java \
+classpath/java/security/cert/X509Certificate.java \
+classpath/java/security/cert/X509Extension.java
+
+java_security_cert_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_security_cert_source_files)))
+java_security_interfaces_source_files = \
+classpath/java/security/interfaces/DSAKey.java \
+classpath/java/security/interfaces/DSAKeyPairGenerator.java \
+classpath/java/security/interfaces/DSAParams.java \
+classpath/java/security/interfaces/DSAPrivateKey.java \
+classpath/java/security/interfaces/DSAPublicKey.java \
+classpath/java/security/interfaces/RSAKey.java \
+classpath/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java \
+classpath/java/security/interfaces/RSAPrivateCrtKey.java \
+classpath/java/security/interfaces/RSAPrivateKey.java \
+classpath/java/security/interfaces/RSAPublicKey.java
+
+java_security_interfaces_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_security_interfaces_source_files)))
+java_security_spec_source_files = \
+classpath/java/security/spec/AlgorithmParameterSpec.java \
+classpath/java/security/spec/DSAParameterSpec.java \
+classpath/java/security/spec/DSAPrivateKeySpec.java \
+classpath/java/security/spec/DSAPublicKeySpec.java \
+classpath/java/security/spec/EncodedKeySpec.java \
+classpath/java/security/spec/InvalidKeySpecException.java \
+classpath/java/security/spec/InvalidParameterSpecException.java \
+classpath/java/security/spec/KeySpec.java \
+classpath/java/security/spec/PKCS8EncodedKeySpec.java \
+classpath/java/security/spec/PSSParameterSpec.java \
+classpath/java/security/spec/RSAKeyGenParameterSpec.java \
+classpath/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java \
+classpath/java/security/spec/RSAOtherPrimeInfo.java \
+classpath/java/security/spec/RSAPrivateCrtKeySpec.java \
+classpath/java/security/spec/RSAPrivateKeySpec.java \
+classpath/java/security/spec/RSAPublicKeySpec.java \
+classpath/java/security/spec/X509EncodedKeySpec.java
+
+java_security_spec_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_security_spec_source_files)))
+java_sql_source_files = \
+classpath/java/sql/Array.java \
+classpath/java/sql/BatchUpdateException.java \
+classpath/java/sql/Blob.java \
+classpath/java/sql/CallableStatement.java \
+classpath/java/sql/Clob.java \
+classpath/java/sql/Connection.java \
+classpath/java/sql/DataTruncation.java \
+classpath/java/sql/DatabaseMetaData.java \
+classpath/java/sql/Date.java \
+classpath/java/sql/Driver.java \
+classpath/java/sql/DriverManager.java \
+classpath/java/sql/DriverPropertyInfo.java \
+classpath/java/sql/ParameterMetaData.java \
+classpath/java/sql/PreparedStatement.java \
+classpath/java/sql/Ref.java \
+classpath/java/sql/ResultSet.java \
+classpath/java/sql/ResultSetMetaData.java \
+classpath/java/sql/SQLData.java \
+classpath/java/sql/SQLException.java \
+classpath/java/sql/SQLInput.java \
+classpath/java/sql/SQLOutput.java \
+classpath/java/sql/SQLPermission.java \
+classpath/java/sql/SQLWarning.java \
+classpath/java/sql/Savepoint.java \
+classpath/java/sql/Statement.java \
+classpath/java/sql/Struct.java \
+classpath/java/sql/Time.java \
+classpath/java/sql/Timestamp.java \
+classpath/java/sql/Types.java
+
+java_sql_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_sql_source_files)))
+java_text_source_files = \
+classpath/java/text/Annotation.java \
+classpath/java/text/AttributedCharacterIterator.java \
+classpath/java/text/AttributedString.java \
+classpath/java/text/AttributedStringIterator.java \
+classpath/java/text/BreakIterator.java \
+classpath/java/text/CharacterIterator.java \
+classpath/java/text/ChoiceFormat.java \
+classpath/java/text/CollationElementIterator.java \
+classpath/java/text/CollationKey.java \
+java/text/Collator.java \
java/text/DateFormat.java \
java/text/DateFormatSymbols.java \
-java/text/DecimalFormat.java \
+classpath/java/text/DecimalFormat.java \
java/text/DecimalFormatSymbols.java \
-java/text/FieldPosition.java \
-java/text/Format.java \
-java/text/MessageFormat.java \
-java/text/NumberFormat.java \
-java/text/ParseException.java \
-java/text/ParsePosition.java \
-java/text/RuleBasedCollator.java \
-java/text/SimpleDateFormat.java \
-java/text/StringCharacterIterator.java \
-java/util/jar/Attributes.java \
-java/util/jar/JarEntry.java \
-java/util/jar/JarException.java \
-java/util/jar/JarFile.java \
-java/util/jar/JarInputStream.java \
-java/util/jar/JarOutputStream.java \
-java/util/jar/Manifest.java \
-java/util/zip/Adler32.java \
-java/util/zip/CRC32.java \
-java/util/zip/CheckedInputStream.java \
-java/util/zip/CheckedOutputStream.java \
-java/util/zip/Checksum.java \
-java/util/zip/DataFormatException.java \
+classpath/java/text/FieldPosition.java \
+classpath/java/text/Format.java \
+classpath/java/text/MessageFormat.java \
+classpath/java/text/NumberFormat.java \
+classpath/java/text/ParseException.java \
+classpath/java/text/ParsePosition.java \
+classpath/java/text/RuleBasedCollator.java \
+java/text/SimpleDateFormat.java \
+classpath/java/text/StringCharacterIterator.java
+
+java_text_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_text_source_files))))
+java_util_source_files = \
+classpath/java/util/AbstractCollection.java \
+classpath/java/util/AbstractList.java \
+classpath/java/util/AbstractMap.java \
+classpath/java/util/AbstractSequentialList.java \
+classpath/java/util/AbstractSet.java \
+classpath/java/util/ArrayList.java \
+classpath/java/util/Arrays.java \
+classpath/java/util/BitSet.java \
+java/util/Calendar.java \
+classpath/java/util/Collection.java \
+classpath/java/util/Collections.java \
+classpath/java/util/Comparator.java \
+classpath/java/util/ConcurrentModificationException.java \
+java/util/Currency.java \
+java/util/Date.java \
+classpath/java/util/Dictionary.java \
+classpath/java/util/EmptyStackException.java \
+classpath/java/util/Enumeration.java \
+classpath/java/util/EventListener.java \
+classpath/java/util/EventListenerProxy.java \
+classpath/java/util/EventObject.java \
+java/util/GregorianCalendar.java \
+classpath/java/util/HashMap.java \
+classpath/java/util/HashSet.java \
+classpath/java/util/Hashtable.java \
+classpath/java/util/IdentityHashMap.java \
+classpath/java/util/Iterator.java \
+classpath/java/util/LinkedHashMap.java \
+classpath/java/util/LinkedHashSet.java \
+classpath/java/util/LinkedList.java \
+classpath/java/util/List.java \
+classpath/java/util/ListIterator.java \
+classpath/java/util/ListResourceBundle.java \
+java/util/Locale.java \
+classpath/java/util/LocaleData.java \
+classpath/java/util/Map.java \
+classpath/java/util/MissingResourceException.java \
+classpath/java/util/NoSuchElementException.java \
+classpath/java/util/Observable.java \
+classpath/java/util/Observer.java \
+classpath/java/util/Properties.java \
+classpath/java/util/PropertyPermission.java \
+classpath/java/util/PropertyPermissionCollection.java \
+classpath/java/util/PropertyResourceBundle.java \
+classpath/java/util/Random.java \
+classpath/java/util/RandomAccess.java \
+java/util/ResourceBundle.java \
+classpath/java/util/Set.java \
+java/util/SimpleTimeZone.java \
+classpath/java/util/SortedMap.java \
+classpath/java/util/SortedSet.java \
+classpath/java/util/Stack.java \
+classpath/java/util/StringTokenizer.java \
+classpath/java/util/TimeZone.java \
+classpath/java/util/Timer.java \
+classpath/java/util/TimerTask.java \
+classpath/java/util/TooManyListenersException.java \
+classpath/java/util/TreeMap.java \
+classpath/java/util/TreeSet.java \
+java/util/VMTimeZone.java \
+classpath/java/util/Vector.java \
+classpath/java/util/WeakHashMap.java
+
+java_util_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_util_source_files))))
+java_util_jar_source_files = \
+classpath/java/util/jar/Attributes.java \
+classpath/java/util/jar/JarEntry.java \
+classpath/java/util/jar/JarException.java \
+classpath/java/util/jar/JarFile.java \
+classpath/java/util/jar/JarInputStream.java \
+classpath/java/util/jar/JarOutputStream.java \
+classpath/java/util/jar/Manifest.java
+
+java_util_jar_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_util_jar_source_files)))
+java_util_logging_source_files = \
+classpath/java/util/logging/ConsoleHandler.java \
+classpath/java/util/logging/ErrorManager.java \
+classpath/java/util/logging/FileHandler.java \
+classpath/java/util/logging/Filter.java \
+classpath/java/util/logging/Formatter.java \
+classpath/java/util/logging/Handler.java \
+classpath/java/util/logging/Level.java \
+java/util/logging/LogManager.java \
+classpath/java/util/logging/LogRecord.java \
+java/util/logging/Logger.java \
+classpath/java/util/logging/LoggingPermission.java \
+classpath/java/util/logging/MemoryHandler.java \
+classpath/java/util/logging/SimpleFormatter.java \
+classpath/java/util/logging/SocketHandler.java \
+classpath/java/util/logging/StreamHandler.java \
+classpath/java/util/logging/XMLFormatter.java
+
+java_util_logging_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_util_logging_source_files))))
+java_util_prefs_source_files = \
+classpath/java/util/prefs/AbstractPreferences.java \
+classpath/java/util/prefs/BackingStoreException.java \
+classpath/java/util/prefs/InvalidPreferencesFormatException.java \
+classpath/java/util/prefs/NodeChangeEvent.java \
+classpath/java/util/prefs/NodeChangeListener.java \
+classpath/java/util/prefs/PreferenceChangeEvent.java \
+classpath/java/util/prefs/PreferenceChangeListener.java \
+classpath/java/util/prefs/Preferences.java \
+classpath/java/util/prefs/PreferencesFactory.java
+
+java_util_prefs_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_util_prefs_source_files)))
+java_util_regex_source_files = \
+classpath/java/util/regex/Matcher.java \
+classpath/java/util/regex/Pattern.java \
+classpath/java/util/regex/PatternSyntaxException.java
+
+java_util_regex_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_util_regex_source_files)))
+java_util_zip_source_files = \
+classpath/java/util/zip/Adler32.java \
+classpath/java/util/zip/CRC32.java \
+classpath/java/util/zip/CheckedInputStream.java \
+classpath/java/util/zip/CheckedOutputStream.java \
+classpath/java/util/zip/Checksum.java \
+classpath/java/util/zip/DataFormatException.java \
java/util/zip/Deflater.java \
-java/util/zip/DeflaterOutputStream.java \
+java/util/zip/DeflaterOutputStream.java \
java/util/zip/GZIPInputStream.java \
java/util/zip/GZIPOutputStream.java \
java/util/zip/Inflater.java \
java/util/zip/InflaterInputStream.java \
-java/util/zip/ZipConstants.java \
+classpath/java/util/zip/ZipConstants.java \
java/util/zip/ZipEntry.java \
-java/util/zip/ZipException.java \
+classpath/java/util/zip/ZipException.java \
java/util/zip/ZipFile.java \
-java/util/zip/ZipInputStream.java \
-java/util/zip/ZipOutputStream.java \
-$(rmi_java_source_files) \
-$(awt_java_source_files) \
-$(convert_source_files) \
-$(javax_source_files) \
-$(org_source_files)
-
-java_source_files = $(special_java_source_files) $(ordinary_java_source_files)
-math_c_source_files = \
- java/lang/dtoa.c java/lang/k_rem_pio2.c java/lang/s_tan.c \
- java/lang/e_acos.c java/lang/k_sin.c java/lang/strtod.c \
- java/lang/e_asin.c java/lang/k_tan.c java/lang/w_acos.c \
- java/lang/e_atan2.c java/lang/mprec.c java/lang/w_asin.c \
- java/lang/e_exp.c java/lang/s_atan.c java/lang/w_atan2.c \
- java/lang/e_fmod.c java/lang/s_ceil.c java/lang/w_exp.c \
- java/lang/e_log.c java/lang/s_copysign.c java/lang/w_fmod.c \
- java/lang/e_pow.c java/lang/s_cos.c java/lang/w_log.c \
- java/lang/e_rem_pio2.c java/lang/s_fabs.c java/lang/w_pow.c \
- java/lang/e_remainder.c java/lang/s_floor.c java/lang/w_remainder.c \
- java/lang/e_scalb.c java/lang/s_rint.c java/lang/w_sqrt.c \
- java/lang/e_sqrt.c java/lang/s_scalbn.c java/lang/sf_rint.c \
- java/lang/k_cos.c java/lang/s_sin.c java/lang/sf_fabs.c
+classpath/java/util/zip/ZipInputStream.java \
+classpath/java/util/zip/ZipOutputStream.java
+
+java_util_zip_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_util_zip_source_files))))
+javax_accessibility_source_files = \
+classpath/javax/accessibility/Accessible.java \
+classpath/javax/accessibility/AccessibleAction.java \
+classpath/javax/accessibility/AccessibleBundle.java \
+classpath/javax/accessibility/AccessibleComponent.java \
+classpath/javax/accessibility/AccessibleContext.java \
+classpath/javax/accessibility/AccessibleEditableText.java \
+classpath/javax/accessibility/AccessibleExtendedComponent.java \
+classpath/javax/accessibility/AccessibleExtendedTable.java \
+classpath/javax/accessibility/AccessibleHyperlink.java \
+classpath/javax/accessibility/AccessibleHypertext.java \
+classpath/javax/accessibility/AccessibleIcon.java \
+classpath/javax/accessibility/AccessibleKeyBinding.java \
+classpath/javax/accessibility/AccessibleRelation.java \
+classpath/javax/accessibility/AccessibleRelationSet.java \
+classpath/javax/accessibility/AccessibleResourceBundle.java \
+classpath/javax/accessibility/AccessibleRole.java \
+classpath/javax/accessibility/AccessibleSelection.java \
+classpath/javax/accessibility/AccessibleState.java \
+classpath/javax/accessibility/AccessibleStateSet.java \
+classpath/javax/accessibility/AccessibleTable.java \
+classpath/javax/accessibility/AccessibleTableModelChange.java \
+classpath/javax/accessibility/AccessibleText.java \
+classpath/javax/accessibility/AccessibleValue.java
+
+javax_accessibility_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_accessibility_source_files)))
+javax_crypto_source_files = \
+classpath/javax/crypto/BadPaddingException.java \
+classpath/javax/crypto/Cipher.java \
+classpath/javax/crypto/CipherInputStream.java \
+classpath/javax/crypto/CipherOutputStream.java \
+classpath/javax/crypto/CipherSpi.java \
+classpath/javax/crypto/EncryptedPrivateKeyInfo.java \
+classpath/javax/crypto/ExemptionMechanism.java \
+classpath/javax/crypto/ExemptionMechanismException.java \
+classpath/javax/crypto/ExemptionMechanismSpi.java \
+classpath/javax/crypto/IllegalBlockSizeException.java \
+classpath/javax/crypto/KeyAgreement.java \
+classpath/javax/crypto/KeyAgreementSpi.java \
+classpath/javax/crypto/KeyGenerator.java \
+classpath/javax/crypto/KeyGeneratorSpi.java \
+classpath/javax/crypto/Mac.java \
+classpath/javax/crypto/MacSpi.java \
+classpath/javax/crypto/NoSuchPaddingException.java \
+classpath/javax/crypto/NullCipher.java \
+classpath/javax/crypto/NullCipherImpl.java \
+classpath/javax/crypto/SealedObject.java \
+classpath/javax/crypto/SecretKey.java \
+classpath/javax/crypto/SecretKeyFactory.java \
+classpath/javax/crypto/SecretKeyFactorySpi.java \
+classpath/javax/crypto/ShortBufferException.java
+
+javax_crypto_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_crypto_source_files)))
+javax_crypto_interfaces_source_files = \
+classpath/javax/crypto/interfaces/DHKey.java \
+classpath/javax/crypto/interfaces/DHPrivateKey.java \
+classpath/javax/crypto/interfaces/DHPublicKey.java \
+classpath/javax/crypto/interfaces/PBEKey.java
+
+javax_crypto_interfaces_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_crypto_interfaces_source_files)))
+javax_crypto_spec_source_files = \
+classpath/javax/crypto/spec/DESKeySpec.java \
+classpath/javax/crypto/spec/DESedeKeySpec.java \
+classpath/javax/crypto/spec/DHGenParameterSpec.java \
+classpath/javax/crypto/spec/DHParameterSpec.java \
+classpath/javax/crypto/spec/DHPrivateKeySpec.java \
+classpath/javax/crypto/spec/DHPublicKeySpec.java \
+classpath/javax/crypto/spec/IvParameterSpec.java \
+classpath/javax/crypto/spec/PBEKeySpec.java \
+classpath/javax/crypto/spec/PBEParameterSpec.java \
+classpath/javax/crypto/spec/RC2ParameterSpec.java \
+classpath/javax/crypto/spec/RC5ParameterSpec.java \
+classpath/javax/crypto/spec/SecretKeySpec.java
+
+javax_crypto_spec_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_crypto_spec_source_files)))
+javax_imageio_source_files = \
+classpath/javax/imageio/IIOException.java \
+classpath/javax/imageio/IIOImage.java \
+classpath/javax/imageio/IIOParam.java \
+classpath/javax/imageio/IIOParamController.java \
+classpath/javax/imageio/ImageIO.java \
+classpath/javax/imageio/ImageReadParam.java \
+classpath/javax/imageio/ImageReader.java \
+classpath/javax/imageio/ImageTranscoder.java \
+classpath/javax/imageio/ImageTypeSpecifier.java \
+classpath/javax/imageio/ImageWriteParam.java \
+classpath/javax/imageio/ImageWriter.java \
+classpath/javax/imageio/event/IIOReadProgressListener.java \
+classpath/javax/imageio/event/IIOReadUpdateListener.java \
+classpath/javax/imageio/event/IIOReadWarningListener.java \
+classpath/javax/imageio/event/IIOWriteProgressListener.java \
+classpath/javax/imageio/event/IIOWriteWarningListener.java \
+classpath/javax/imageio/metadata/IIOAttr.java \
+classpath/javax/imageio/metadata/IIOInvalidTreeException.java \
+classpath/javax/imageio/metadata/IIOMetadata.java \
+classpath/javax/imageio/metadata/IIOMetadataController.java \
+classpath/javax/imageio/metadata/IIOMetadataFormat.java \
+classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java \
+classpath/javax/imageio/metadata/IIOMetadataNode.java \
+classpath/javax/imageio/metadata/IIONamedNodeMap.java \
+classpath/javax/imageio/metadata/IIONodeList.java \
+classpath/javax/imageio/spi/IIORegistry.java \
+classpath/javax/imageio/spi/IIOServiceProvider.java \
+classpath/javax/imageio/spi/ImageInputStreamSpi.java \
+classpath/javax/imageio/spi/ImageOutputStreamSpi.java \
+classpath/javax/imageio/spi/ImageReaderSpi.java \
+classpath/javax/imageio/spi/ImageReaderWriterSpi.java \
+classpath/javax/imageio/spi/ImageTranscoderSpi.java \
+classpath/javax/imageio/spi/ImageWriterSpi.java \
+classpath/javax/imageio/spi/RegisterableService.java \
+classpath/javax/imageio/spi/ServiceRegistry.java \
+classpath/javax/imageio/stream/FileCacheImageInputStream.java \
+classpath/javax/imageio/stream/FileCacheImageOutputStream.java \
+classpath/javax/imageio/stream/FileImageInputStream.java \
+classpath/javax/imageio/stream/FileImageOutputStream.java \
+classpath/javax/imageio/stream/IIOByteBuffer.java \
+classpath/javax/imageio/stream/ImageInputStream.java \
+classpath/javax/imageio/stream/ImageInputStreamImpl.java \
+classpath/javax/imageio/stream/ImageOutputStream.java \
+classpath/javax/imageio/stream/ImageOutputStreamImpl.java \
+classpath/javax/imageio/stream/MemoryCacheImageInputStream.java \
+classpath/javax/imageio/stream/MemoryCacheImageOutputStream.java
+
+javax_naming_source_files = \
+classpath/javax/naming/AuthenticationException.java \
+classpath/javax/naming/AuthenticationNotSupportedException.java \
+classpath/javax/naming/BinaryRefAddr.java \
+classpath/javax/naming/Binding.java \
+classpath/javax/naming/CannotProceedException.java \
+classpath/javax/naming/CommunicationException.java \
+classpath/javax/naming/CompositeName.java \
+classpath/javax/naming/CompoundName.java \
+classpath/javax/naming/ConfigurationException.java \
+classpath/javax/naming/Context.java \
+classpath/javax/naming/ContextNotEmptyException.java \
+classpath/javax/naming/InitialContext.java \
+classpath/javax/naming/InsufficientResourcesException.java \
+classpath/javax/naming/InterruptedNamingException.java \
+classpath/javax/naming/InvalidNameException.java \
+classpath/javax/naming/LimitExceededException.java \
+classpath/javax/naming/LinkException.java \
+classpath/javax/naming/LinkLoopException.java \
+classpath/javax/naming/LinkRef.java \
+classpath/javax/naming/MalformedLinkException.java \
+classpath/javax/naming/Name.java \
+classpath/javax/naming/NameAlreadyBoundException.java \
+classpath/javax/naming/NameClassPair.java \
+classpath/javax/naming/NameNotFoundException.java \
+classpath/javax/naming/NameParser.java \
+classpath/javax/naming/NamingEnumeration.java \
+classpath/javax/naming/NamingException.java \
+classpath/javax/naming/NamingSecurityException.java \
+classpath/javax/naming/NoInitialContextException.java \
+classpath/javax/naming/NoPermissionException.java \
+classpath/javax/naming/NotContextException.java \
+classpath/javax/naming/OperationNotSupportedException.java \
+classpath/javax/naming/PartialResultException.java \
+classpath/javax/naming/RefAddr.java \
+classpath/javax/naming/Reference.java \
+classpath/javax/naming/Referenceable.java \
+classpath/javax/naming/ReferralException.java \
+classpath/javax/naming/ServiceUnavailableException.java \
+classpath/javax/naming/SizeLimitExceededException.java \
+classpath/javax/naming/StringRefAddr.java \
+classpath/javax/naming/TimeLimitExceededException.java
+
+javax_naming_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_naming_source_files)))
+javax_naming_directory_source_files = \
+classpath/javax/naming/directory/Attribute.java \
+classpath/javax/naming/directory/AttributeInUseException.java \
+classpath/javax/naming/directory/AttributeModificationException.java \
+classpath/javax/naming/directory/Attributes.java \
+classpath/javax/naming/directory/BasicAttribute.java \
+classpath/javax/naming/directory/BasicAttributes.java \
+classpath/javax/naming/directory/DirContext.java \
+classpath/javax/naming/directory/InitialDirContext.java \
+classpath/javax/naming/directory/InvalidAttributeIdentifierException.java \
+classpath/javax/naming/directory/InvalidAttributeValueException.java \
+classpath/javax/naming/directory/InvalidAttributesException.java \
+classpath/javax/naming/directory/InvalidSearchControlsException.java \
+classpath/javax/naming/directory/InvalidSearchFilterException.java \
+classpath/javax/naming/directory/ModificationItem.java \
+classpath/javax/naming/directory/NoSuchAttributeException.java \
+classpath/javax/naming/directory/SchemaViolationException.java \
+classpath/javax/naming/directory/SearchControls.java \
+classpath/javax/naming/directory/SearchResult.java
+
+javax_naming_directory_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_naming_directory_source_files)))
+javax_naming_event_source_files = \
+classpath/javax/naming/event/EventContext.java \
+classpath/javax/naming/event/EventDirContext.java \
+classpath/javax/naming/event/NamespaceChangeListener.java \
+classpath/javax/naming/event/NamingEvent.java \
+classpath/javax/naming/event/NamingExceptionEvent.java \
+classpath/javax/naming/event/NamingListener.java \
+classpath/javax/naming/event/ObjectChangeListener.java
+
+javax_naming_event_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_naming_event_source_files)))
+javax_naming_ldap_source_files = \
+classpath/javax/naming/ldap/Control.java \
+classpath/javax/naming/ldap/ControlFactory.java \
+classpath/javax/naming/ldap/ExtendedRequest.java \
+classpath/javax/naming/ldap/ExtendedResponse.java \
+classpath/javax/naming/ldap/HasControls.java \
+classpath/javax/naming/ldap/InitialLdapContext.java \
+classpath/javax/naming/ldap/LdapContext.java \
+classpath/javax/naming/ldap/LdapReferralException.java \
+classpath/javax/naming/ldap/UnsolicitedNotification.java \
+classpath/javax/naming/ldap/UnsolicitedNotificationEvent.java \
+classpath/javax/naming/ldap/UnsolicitedNotificationListener.java
+
+javax_naming_ldap_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_naming_ldap_source_files)))
+javax_naming_spi_source_files = \
+classpath/javax/naming/spi/DirObjectFactory.java \
+classpath/javax/naming/spi/DirStateFactory.java \
+classpath/javax/naming/spi/DirectoryManager.java \
+classpath/javax/naming/spi/InitialContextFactory.java \
+classpath/javax/naming/spi/InitialContextFactoryBuilder.java \
+classpath/javax/naming/spi/NamingManager.java \
+classpath/javax/naming/spi/ObjectFactory.java \
+classpath/javax/naming/spi/ObjectFactoryBuilder.java \
+classpath/javax/naming/spi/ResolveResult.java \
+classpath/javax/naming/spi/Resolver.java \
+classpath/javax/naming/spi/StateFactory.java
+
+javax_naming_spi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_naming_spi_source_files)))
+javax_net_source_files = \
+classpath/javax/net/ServerSocketFactory.java \
+classpath/javax/net/SocketFactory.java \
+classpath/javax/net/VanillaServerSocketFactory.java \
+classpath/javax/net/VanillaSocketFactory.java
+
+javax_net_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_net_source_files)))
+javax_net_ssl_source_files = \
+classpath/javax/net/ssl/HandshakeCompletedEvent.java \
+classpath/javax/net/ssl/HandshakeCompletedListener.java \
+classpath/javax/net/ssl/HostnameVerifier.java \
+classpath/javax/net/ssl/HttpsURLConnection.java \
+classpath/javax/net/ssl/KeyManager.java \
+classpath/javax/net/ssl/KeyManagerFactory.java \
+classpath/javax/net/ssl/KeyManagerFactorySpi.java \
+classpath/javax/net/ssl/ManagerFactoryParameters.java \
+classpath/javax/net/ssl/SSLContext.java \
+classpath/javax/net/ssl/SSLContextSpi.java \
+classpath/javax/net/ssl/SSLException.java \
+classpath/javax/net/ssl/SSLHandshakeException.java \
+classpath/javax/net/ssl/SSLKeyException.java \
+classpath/javax/net/ssl/SSLPeerUnverifiedException.java \
+classpath/javax/net/ssl/SSLPermission.java \
+classpath/javax/net/ssl/SSLProtocolException.java \
+classpath/javax/net/ssl/SSLServerSocket.java \
+classpath/javax/net/ssl/SSLServerSocketFactory.java \
+classpath/javax/net/ssl/SSLSession.java \
+classpath/javax/net/ssl/SSLSessionBindingEvent.java \
+classpath/javax/net/ssl/SSLSessionBindingListener.java \
+classpath/javax/net/ssl/SSLSessionContext.java \
+classpath/javax/net/ssl/SSLSocket.java \
+classpath/javax/net/ssl/SSLSocketFactory.java \
+classpath/javax/net/ssl/TrivialHostnameVerifier.java \
+classpath/javax/net/ssl/TrustManager.java \
+classpath/javax/net/ssl/TrustManagerFactory.java \
+classpath/javax/net/ssl/TrustManagerFactorySpi.java \
+classpath/javax/net/ssl/X509KeyManager.java \
+classpath/javax/net/ssl/X509TrustManager.java
+
+javax_net_ssl_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_net_ssl_source_files)))
+javax_print_source_files = \
+classpath/javax/print/AttributeException.java \
+classpath/javax/print/CancelablePrintJob.java \
+classpath/javax/print/Doc.java \
+classpath/javax/print/DocFlavor.java \
+classpath/javax/print/DocPrintJob.java \
+classpath/javax/print/FlavorException.java \
+classpath/javax/print/MultiDoc.java \
+classpath/javax/print/MultiDocPrintJob.java \
+classpath/javax/print/MultiDocPrintService.java \
+classpath/javax/print/PrintException.java \
+classpath/javax/print/PrintService.java \
+classpath/javax/print/PrintServiceLookup.java \
+classpath/javax/print/ServiceUIFactory.java \
+classpath/javax/print/StreamPrintService.java \
+classpath/javax/print/URIException.java
+
+javax_print_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_print_source_files)))
+javax_print_attribute_source_files = \
+classpath/javax/print/attribute/Attribute.java \
+classpath/javax/print/attribute/AttributeSet.java \
+classpath/javax/print/attribute/AttributeSetUtilities.java \
+classpath/javax/print/attribute/DateTimeSyntax.java \
+classpath/javax/print/attribute/DocAttribute.java \
+classpath/javax/print/attribute/DocAttributeSet.java \
+classpath/javax/print/attribute/EnumSyntax.java \
+classpath/javax/print/attribute/HashAttributeSet.java \
+classpath/javax/print/attribute/HashDocAttributeSet.java \
+classpath/javax/print/attribute/HashPrintJobAttributeSet.java \
+classpath/javax/print/attribute/HashPrintRequestAttributeSet.java \
+classpath/javax/print/attribute/HashPrintServiceAttributeSet.java \
+classpath/javax/print/attribute/IntegerSyntax.java \
+classpath/javax/print/attribute/PrintJobAttribute.java \
+classpath/javax/print/attribute/PrintJobAttributeSet.java \
+classpath/javax/print/attribute/PrintRequestAttribute.java \
+classpath/javax/print/attribute/PrintRequestAttributeSet.java \
+classpath/javax/print/attribute/PrintServiceAttribute.java \
+classpath/javax/print/attribute/PrintServiceAttributeSet.java \
+classpath/javax/print/attribute/ResolutionSyntax.java \
+classpath/javax/print/attribute/SetOfIntegerSyntax.java \
+classpath/javax/print/attribute/Size2DSyntax.java \
+classpath/javax/print/attribute/SupportedValuesAttribute.java \
+classpath/javax/print/attribute/TextSyntax.java \
+classpath/javax/print/attribute/URISyntax.java \
+classpath/javax/print/attribute/UnmodifiableSetException.java
+
+javax_print_attribute_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_print_attribute_source_files)))
+javax_print_attribute_standard_source_files = \
+classpath/javax/print/attribute/standard/Chromaticity.java \
+classpath/javax/print/attribute/standard/ColorSupported.java \
+classpath/javax/print/attribute/standard/Compression.java \
+classpath/javax/print/attribute/standard/Copies.java \
+classpath/javax/print/attribute/standard/CopiesSupported.java \
+classpath/javax/print/attribute/standard/DateTimeAtCompleted.java \
+classpath/javax/print/attribute/standard/DateTimeAtCreation.java \
+classpath/javax/print/attribute/standard/DateTimeAtProcessing.java \
+classpath/javax/print/attribute/standard/Destination.java \
+classpath/javax/print/attribute/standard/DocumentName.java \
+classpath/javax/print/attribute/standard/Fidelity.java \
+classpath/javax/print/attribute/standard/Finishings.java \
+classpath/javax/print/attribute/standard/JobHoldUntil.java \
+classpath/javax/print/attribute/standard/JobImpressions.java \
+classpath/javax/print/attribute/standard/JobImpressionsCompleted.java \
+classpath/javax/print/attribute/standard/JobImpressionsSupported.java \
+classpath/javax/print/attribute/standard/JobKOctets.java \
+classpath/javax/print/attribute/standard/JobKOctetsProcessed.java \
+classpath/javax/print/attribute/standard/JobKOctetsSupported.java \
+classpath/javax/print/attribute/standard/JobMediaSheets.java \
+classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java \
+classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java \
+classpath/javax/print/attribute/standard/JobMessageFromOperator.java \
+classpath/javax/print/attribute/standard/JobName.java \
+classpath/javax/print/attribute/standard/JobOriginatingUserName.java \
+classpath/javax/print/attribute/standard/JobPriority.java \
+classpath/javax/print/attribute/standard/JobPrioritySupported.java \
+classpath/javax/print/attribute/standard/JobSheets.java \
+classpath/javax/print/attribute/standard/JobState.java \
+classpath/javax/print/attribute/standard/JobStateReason.java \
+classpath/javax/print/attribute/standard/JobStateReasons.java \
+classpath/javax/print/attribute/standard/Media.java \
+classpath/javax/print/attribute/standard/MediaPrintableArea.java \
+classpath/javax/print/attribute/standard/MediaSize.java \
+classpath/javax/print/attribute/standard/MediaSizeName.java \
+classpath/javax/print/attribute/standard/MultipleDocumentHandling.java \
+classpath/javax/print/attribute/standard/NumberOfDocuments.java \
+classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java \
+classpath/javax/print/attribute/standard/NumberUp.java \
+classpath/javax/print/attribute/standard/NumberUpSupported.java \
+classpath/javax/print/attribute/standard/OrientationRequested.java \
+classpath/javax/print/attribute/standard/OutputDeviceAssigned.java \
+classpath/javax/print/attribute/standard/PDLOverrideSupported.java \
+classpath/javax/print/attribute/standard/PageRanges.java \
+classpath/javax/print/attribute/standard/PagesPerMinute.java \
+classpath/javax/print/attribute/standard/PagesPerMinuteColor.java \
+classpath/javax/print/attribute/standard/PresentationDirection.java \
+classpath/javax/print/attribute/standard/PrintQuality.java \
+classpath/javax/print/attribute/standard/PrinterInfo.java \
+classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java \
+classpath/javax/print/attribute/standard/PrinterLocation.java \
+classpath/javax/print/attribute/standard/PrinterMakeAndModel.java \
+classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java \
+classpath/javax/print/attribute/standard/PrinterMoreInfo.java \
+classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java \
+classpath/javax/print/attribute/standard/PrinterName.java \
+classpath/javax/print/attribute/standard/PrinterResolution.java \
+classpath/javax/print/attribute/standard/PrinterState.java \
+classpath/javax/print/attribute/standard/PrinterStateReason.java \
+classpath/javax/print/attribute/standard/PrinterStateReasons.java \
+classpath/javax/print/attribute/standard/PrinterURI.java \
+classpath/javax/print/attribute/standard/QueuedJobCount.java \
+classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java \
+classpath/javax/print/attribute/standard/RequestingUserName.java \
+classpath/javax/print/attribute/standard/Severity.java \
+classpath/javax/print/attribute/standard/SheetCollate.java \
+classpath/javax/print/attribute/standard/Sides.java
+
+javax_print_attribute_standard_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_print_attribute_standard_source_files)))
+javax_print_event_source_files = \
+classpath/javax/print/event/PrintEvent.java \
+classpath/javax/print/event/PrintJobAdapter.java \
+classpath/javax/print/event/PrintJobAttributeEvent.java \
+classpath/javax/print/event/PrintJobAttributeListener.java \
+classpath/javax/print/event/PrintJobEvent.java \
+classpath/javax/print/event/PrintJobListener.java \
+classpath/javax/print/event/PrintServiceAttributeEvent.java \
+classpath/javax/print/event/PrintServiceAttributeListener.java
+
+javax_print_event_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_print_event_source_files)))
+javax_security_auth_source_files = \
+classpath/javax/security/auth/AuthPermission.java \
+classpath/javax/security/auth/DestroyFailedException.java \
+classpath/javax/security/auth/Destroyable.java \
+classpath/javax/security/auth/Policy.java \
+classpath/javax/security/auth/PrivateCredentialPermission.java \
+classpath/javax/security/auth/RefreshFailedException.java \
+classpath/javax/security/auth/Refreshable.java \
+classpath/javax/security/auth/Subject.java \
+classpath/javax/security/auth/SubjectDomainCombiner.java
+
+javax_security_auth_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_auth_source_files)))
+javax_security_auth_callback_source_files = \
+classpath/javax/security/auth/callback/Callback.java \
+classpath/javax/security/auth/callback/CallbackHandler.java \
+classpath/javax/security/auth/callback/ChoiceCallback.java \
+classpath/javax/security/auth/callback/ConfirmationCallback.java \
+classpath/javax/security/auth/callback/LanguageCallback.java \
+classpath/javax/security/auth/callback/NameCallback.java \
+classpath/javax/security/auth/callback/PasswordCallback.java \
+classpath/javax/security/auth/callback/TextInputCallback.java \
+classpath/javax/security/auth/callback/TextOutputCallback.java \
+classpath/javax/security/auth/callback/UnsupportedCallbackException.java
+
+javax_security_auth_callback_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_auth_callback_source_files)))
+javax_security_auth_login_source_files = \
+classpath/javax/security/auth/login/AccountExpiredException.java \
+classpath/javax/security/auth/login/AppConfigurationEntry.java \
+classpath/javax/security/auth/login/Configuration.java \
+classpath/javax/security/auth/login/CredentialExpiredException.java \
+classpath/javax/security/auth/login/FailedLoginException.java \
+classpath/javax/security/auth/login/LoginContext.java \
+classpath/javax/security/auth/login/LoginException.java \
+classpath/javax/security/auth/login/NullConfiguration.java
+
+javax_security_auth_login_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_auth_login_source_files)))
+javax_security_auth_spi_source_files = \
+classpath/javax/security/auth/spi/LoginModule.java
+
+javax_security_auth_spi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_auth_spi_source_files)))
+javax_security_auth_x500_source_files = \
+classpath/javax/security/auth/x500/X500Principal.java \
+classpath/javax/security/auth/x500/X500PrivateCredential.java
+
+javax_security_auth_x500_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_auth_x500_source_files)))
+javax_security_cert_source_files = \
+classpath/javax/security/cert/Certificate.java \
+classpath/javax/security/cert/CertificateEncodingException.java \
+classpath/javax/security/cert/CertificateException.java \
+classpath/javax/security/cert/CertificateExpiredException.java \
+classpath/javax/security/cert/CertificateNotYetValidException.java \
+classpath/javax/security/cert/CertificateParsingException.java \
+classpath/javax/security/cert/X509CertBridge.java \
+classpath/javax/security/cert/X509Certificate.java
+
+javax_security_cert_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_cert_source_files)))
+javax_security_sasl_source_files = \
+classpath/javax/security/sasl/AuthenticationException.java \
+classpath/javax/security/sasl/AuthorizeCallback.java \
+classpath/javax/security/sasl/RealmCallback.java \
+classpath/javax/security/sasl/RealmChoiceCallback.java \
+classpath/javax/security/sasl/Sasl.java \
+classpath/javax/security/sasl/SaslClient.java \
+classpath/javax/security/sasl/SaslClientFactory.java \
+classpath/javax/security/sasl/SaslException.java \
+classpath/javax/security/sasl/SaslServer.java \
+classpath/javax/security/sasl/SaslServerFactory.java
+
+javax_security_sasl_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_sasl_source_files)))
+javax_sql_source_files = \
+classpath/javax/sql/ConnectionEvent.java \
+classpath/javax/sql/ConnectionEventListener.java \
+classpath/javax/sql/ConnectionPoolDataSource.java \
+classpath/javax/sql/DataSource.java \
+classpath/javax/sql/PooledConnection.java \
+classpath/javax/sql/RowSet.java \
+classpath/javax/sql/RowSetEvent.java \
+classpath/javax/sql/RowSetInternal.java \
+classpath/javax/sql/RowSetListener.java \
+classpath/javax/sql/RowSetMetaData.java \
+classpath/javax/sql/RowSetReader.java \
+classpath/javax/sql/RowSetWriter.java \
+classpath/javax/sql/XAConnection.java \
+classpath/javax/sql/XADataSource.java
+
+javax_sql_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_sql_source_files)))
+javax_swing_source_files = \
+classpath/javax/swing/AbstractAction.java \
+classpath/javax/swing/AbstractButton.java \
+classpath/javax/swing/AbstractCellEditor.java \
+classpath/javax/swing/AbstractListModel.java \
+classpath/javax/swing/AbstractSpinnerModel.java \
+classpath/javax/swing/Action.java \
+classpath/javax/swing/ActionMap.java \
+classpath/javax/swing/BorderFactory.java \
+classpath/javax/swing/BoundedRangeModel.java \
+classpath/javax/swing/Box.java \
+classpath/javax/swing/BoxLayout.java \
+classpath/javax/swing/ButtonGroup.java \
+classpath/javax/swing/ButtonModel.java \
+classpath/javax/swing/CellEditor.java \
+classpath/javax/swing/CellRendererPane.java \
+classpath/javax/swing/ComboBoxEditor.java \
+classpath/javax/swing/ComboBoxModel.java \
+classpath/javax/swing/ComponentInputMap.java \
+classpath/javax/swing/DebugGraphics.java \
+classpath/javax/swing/DefaultBoundedRangeModel.java \
+classpath/javax/swing/DefaultButtonModel.java \
+classpath/javax/swing/DefaultCellEditor.java \
+classpath/javax/swing/DefaultComboBoxModel.java \
+classpath/javax/swing/DefaultDesktopManager.java \
+classpath/javax/swing/DefaultFocusManager.java \
+classpath/javax/swing/DefaultListCellRenderer.java \
+classpath/javax/swing/DefaultListModel.java \
+classpath/javax/swing/DefaultListSelectionModel.java \
+classpath/javax/swing/DefaultSingleSelectionModel.java \
+classpath/javax/swing/DesktopManager.java \
+classpath/javax/swing/FocusManager.java \
+classpath/javax/swing/GrayFilter.java \
+classpath/javax/swing/Icon.java \
+classpath/javax/swing/ImageIcon.java \
+classpath/javax/swing/InputMap.java \
+classpath/javax/swing/InputVerifier.java \
+classpath/javax/swing/InternalFrameFocusTraversalPolicy.java \
+classpath/javax/swing/JApplet.java \
+classpath/javax/swing/JButton.java \
+classpath/javax/swing/JCheckBox.java \
+classpath/javax/swing/JCheckBoxMenuItem.java \
+classpath/javax/swing/JColorChooser.java \
+classpath/javax/swing/JComboBox.java \
+classpath/javax/swing/JComponent.java \
+classpath/javax/swing/JDesktopPane.java \
+classpath/javax/swing/JDialog.java \
+classpath/javax/swing/JEditorPane.java \
+classpath/javax/swing/JFileChooser.java \
+classpath/javax/swing/JFormattedTextField.java \
+classpath/javax/swing/JFrame.java \
+classpath/javax/swing/JInternalFrame.java \
+classpath/javax/swing/JLabel.java \
+classpath/javax/swing/JLayeredPane.java \
+classpath/javax/swing/JList.java \
+classpath/javax/swing/JMenu.java \
+classpath/javax/swing/JMenuBar.java \
+classpath/javax/swing/JMenuItem.java \
+classpath/javax/swing/JOptionPane.java \
+classpath/javax/swing/JPanel.java \
+classpath/javax/swing/JPasswordField.java \
+classpath/javax/swing/JPopupMenu.java \
+classpath/javax/swing/JProgressBar.java \
+classpath/javax/swing/JRadioButton.java \
+classpath/javax/swing/JRadioButtonMenuItem.java \
+classpath/javax/swing/JRootPane.java \
+classpath/javax/swing/JScrollBar.java \
+classpath/javax/swing/JScrollPane.java \
+classpath/javax/swing/JSeparator.java \
+classpath/javax/swing/JSlider.java \
+classpath/javax/swing/JSpinner.java \
+classpath/javax/swing/JSplitPane.java \
+classpath/javax/swing/JTabbedPane.java \
+classpath/javax/swing/JTable.java \
+classpath/javax/swing/JTextArea.java \
+classpath/javax/swing/JTextField.java \
+classpath/javax/swing/JTextPane.java \
+classpath/javax/swing/JToggleButton.java \
+classpath/javax/swing/JToolBar.java \
+classpath/javax/swing/JToolTip.java \
+classpath/javax/swing/JTree.java \
+classpath/javax/swing/JViewport.java \
+classpath/javax/swing/JWindow.java \
+classpath/javax/swing/KeyStroke.java \
+classpath/javax/swing/LayoutFocusTraversalPolicy.java \
+classpath/javax/swing/ListCellRenderer.java \
+classpath/javax/swing/ListModel.java \
+classpath/javax/swing/ListSelectionModel.java \
+classpath/javax/swing/LookAndFeel.java \
+classpath/javax/swing/MenuElement.java \
+classpath/javax/swing/MenuSelectionManager.java \
+classpath/javax/swing/MutableComboBoxModel.java \
+classpath/javax/swing/OverlayLayout.java \
+classpath/javax/swing/Popup.java \
+classpath/javax/swing/PopupFactory.java \
+classpath/javax/swing/ProgressMonitor.java \
+classpath/javax/swing/ProgressMonitorInputStream.java \
+classpath/javax/swing/Renderer.java \
+classpath/javax/swing/RepaintManager.java \
+classpath/javax/swing/RootPaneContainer.java \
+classpath/javax/swing/ScrollPaneConstants.java \
+classpath/javax/swing/ScrollPaneLayout.java \
+classpath/javax/swing/Scrollable.java \
+classpath/javax/swing/SingleSelectionModel.java \
+classpath/javax/swing/SizeRequirements.java \
+classpath/javax/swing/SizeSequence.java \
+classpath/javax/swing/SortingFocusTraversalPolicy.java \
+classpath/javax/swing/SpinnerDateModel.java \
+classpath/javax/swing/SpinnerListModel.java \
+classpath/javax/swing/SpinnerModel.java \
+classpath/javax/swing/SpinnerNumberModel.java \
+classpath/javax/swing/Spring.java \
+classpath/javax/swing/SpringLayout.java \
+classpath/javax/swing/SwingConstants.java \
+classpath/javax/swing/SwingUtilities.java \
+classpath/javax/swing/Timer.java \
+classpath/javax/swing/ToolTipManager.java \
+classpath/javax/swing/TransferHandler.java \
+classpath/javax/swing/UIDefaults.java \
+classpath/javax/swing/UIManager.java \
+classpath/javax/swing/UnsupportedLookAndFeelException.java \
+classpath/javax/swing/ViewportLayout.java \
+classpath/javax/swing/WindowConstants.java
+
+javax_swing_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_source_files)))
+javax_swing_border_source_files = \
+classpath/javax/swing/border/AbstractBorder.java \
+classpath/javax/swing/border/BevelBorder.java \
+classpath/javax/swing/border/Border.java \
+classpath/javax/swing/border/CompoundBorder.java \
+classpath/javax/swing/border/EmptyBorder.java \
+classpath/javax/swing/border/EtchedBorder.java \
+classpath/javax/swing/border/LineBorder.java \
+classpath/javax/swing/border/MatteBorder.java \
+classpath/javax/swing/border/SoftBevelBorder.java \
+classpath/javax/swing/border/TitledBorder.java
+
+javax_swing_border_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_border_source_files)))
+javax_swing_colorchooser_source_files = \
+classpath/javax/swing/colorchooser/AbstractColorChooserPanel.java \
+classpath/javax/swing/colorchooser/ColorChooserComponentFactory.java \
+classpath/javax/swing/colorchooser/ColorSelectionModel.java \
+classpath/javax/swing/colorchooser/DefaultColorSelectionModel.java \
+classpath/javax/swing/colorchooser/DefaultHSBChooserPanel.java \
+classpath/javax/swing/colorchooser/DefaultPreviewPanel.java \
+classpath/javax/swing/colorchooser/DefaultRGBChooserPanel.java \
+classpath/javax/swing/colorchooser/DefaultSwatchChooserPanel.java
+
+javax_swing_colorchooser_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_colorchooser_source_files)))
+javax_swing_event_source_files = \
+classpath/javax/swing/event/AncestorEvent.java \
+classpath/javax/swing/event/AncestorListener.java \
+classpath/javax/swing/event/CaretEvent.java \
+classpath/javax/swing/event/CaretListener.java \
+classpath/javax/swing/event/CellEditorListener.java \
+classpath/javax/swing/event/ChangeEvent.java \
+classpath/javax/swing/event/ChangeListener.java \
+classpath/javax/swing/event/DocumentEvent.java \
+classpath/javax/swing/event/DocumentListener.java \
+classpath/javax/swing/event/EventListenerList.java \
+classpath/javax/swing/event/HyperlinkEvent.java \
+classpath/javax/swing/event/HyperlinkListener.java \
+classpath/javax/swing/event/InternalFrameAdapter.java \
+classpath/javax/swing/event/InternalFrameEvent.java \
+classpath/javax/swing/event/InternalFrameListener.java \
+classpath/javax/swing/event/ListDataEvent.java \
+classpath/javax/swing/event/ListDataListener.java \
+classpath/javax/swing/event/ListSelectionEvent.java \
+classpath/javax/swing/event/ListSelectionListener.java \
+classpath/javax/swing/event/MenuDragMouseEvent.java \
+classpath/javax/swing/event/MenuDragMouseListener.java \
+classpath/javax/swing/event/MenuEvent.java \
+classpath/javax/swing/event/MenuKeyEvent.java \
+classpath/javax/swing/event/MenuKeyListener.java \
+classpath/javax/swing/event/MenuListener.java \
+classpath/javax/swing/event/MouseInputAdapter.java \
+classpath/javax/swing/event/MouseInputListener.java \
+classpath/javax/swing/event/PopupMenuEvent.java \
+classpath/javax/swing/event/PopupMenuListener.java \
+classpath/javax/swing/event/SwingPropertyChangeSupport.java \
+classpath/javax/swing/event/TableColumnModelEvent.java \
+classpath/javax/swing/event/TableColumnModelListener.java \
+classpath/javax/swing/event/TableModelEvent.java \
+classpath/javax/swing/event/TableModelListener.java \
+classpath/javax/swing/event/TreeExpansionEvent.java \
+classpath/javax/swing/event/TreeExpansionListener.java \
+classpath/javax/swing/event/TreeModelEvent.java \
+classpath/javax/swing/event/TreeModelListener.java \
+classpath/javax/swing/event/TreeSelectionEvent.java \
+classpath/javax/swing/event/TreeSelectionListener.java \
+classpath/javax/swing/event/TreeWillExpandListener.java \
+classpath/javax/swing/event/UndoableEditEvent.java \
+classpath/javax/swing/event/UndoableEditListener.java
+
+javax_swing_event_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_event_source_files)))
+javax_swing_filechooser_source_files = \
+classpath/javax/swing/filechooser/FileFilter.java \
+classpath/javax/swing/filechooser/FileSystemView.java \
+classpath/javax/swing/filechooser/FileView.java \
+classpath/javax/swing/filechooser/UnixFileSystemView.java
+
+javax_swing_filechooser_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_filechooser_source_files)))
+javax_swing_plaf_source_files = \
+classpath/javax/swing/plaf/ActionMapUIResource.java \
+classpath/javax/swing/plaf/BorderUIResource.java \
+classpath/javax/swing/plaf/ButtonUI.java \
+classpath/javax/swing/plaf/ColorChooserUI.java \
+classpath/javax/swing/plaf/ColorUIResource.java \
+classpath/javax/swing/plaf/ComboBoxUI.java \
+classpath/javax/swing/plaf/ComponentInputMapUIResource.java \
+classpath/javax/swing/plaf/ComponentUI.java \
+classpath/javax/swing/plaf/DesktopIconUI.java \
+classpath/javax/swing/plaf/DesktopPaneUI.java \
+classpath/javax/swing/plaf/DimensionUIResource.java \
+classpath/javax/swing/plaf/FileChooserUI.java \
+classpath/javax/swing/plaf/FontUIResource.java \
+classpath/javax/swing/plaf/IconUIResource.java \
+classpath/javax/swing/plaf/InputMapUIResource.java \
+classpath/javax/swing/plaf/InsetsUIResource.java \
+classpath/javax/swing/plaf/InternalFrameUI.java \
+classpath/javax/swing/plaf/LabelUI.java \
+classpath/javax/swing/plaf/ListUI.java \
+classpath/javax/swing/plaf/MenuBarUI.java \
+classpath/javax/swing/plaf/MenuItemUI.java \
+classpath/javax/swing/plaf/OptionPaneUI.java \
+classpath/javax/swing/plaf/PanelUI.java \
+classpath/javax/swing/plaf/PopupMenuUI.java \
+classpath/javax/swing/plaf/ProgressBarUI.java \
+classpath/javax/swing/plaf/RootPaneUI.java \
+classpath/javax/swing/plaf/ScrollBarUI.java \
+classpath/javax/swing/plaf/ScrollPaneUI.java \
+classpath/javax/swing/plaf/SeparatorUI.java \
+classpath/javax/swing/plaf/SliderUI.java \
+classpath/javax/swing/plaf/SpinnerUI.java \
+classpath/javax/swing/plaf/SplitPaneUI.java \
+classpath/javax/swing/plaf/TabbedPaneUI.java \
+classpath/javax/swing/plaf/TableHeaderUI.java \
+classpath/javax/swing/plaf/TableUI.java \
+classpath/javax/swing/plaf/TextUI.java \
+classpath/javax/swing/plaf/ToolBarUI.java \
+classpath/javax/swing/plaf/ToolTipUI.java \
+classpath/javax/swing/plaf/TreeUI.java \
+classpath/javax/swing/plaf/UIResource.java \
+classpath/javax/swing/plaf/ViewportUI.java
+
+javax_swing_plaf_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_plaf_source_files)))
+javax_swing_plaf_basic_source_files = \
+classpath/javax/swing/plaf/basic/BasicArrowButton.java \
+classpath/javax/swing/plaf/basic/BasicBorders.java \
+classpath/javax/swing/plaf/basic/BasicButtonListener.java \
+classpath/javax/swing/plaf/basic/BasicButtonUI.java \
+classpath/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java \
+classpath/javax/swing/plaf/basic/BasicCheckBoxUI.java \
+classpath/javax/swing/plaf/basic/BasicColorChooserUI.java \
+classpath/javax/swing/plaf/basic/BasicComboBoxEditor.java \
+classpath/javax/swing/plaf/basic/BasicComboBoxRenderer.java \
+classpath/javax/swing/plaf/basic/BasicComboBoxUI.java \
+classpath/javax/swing/plaf/basic/BasicComboPopup.java \
+classpath/javax/swing/plaf/basic/BasicDesktopIconUI.java \
+classpath/javax/swing/plaf/basic/BasicDesktopPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicDirectoryModel.java \
+classpath/javax/swing/plaf/basic/BasicEditorPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicFileChooserUI.java \
+classpath/javax/swing/plaf/basic/BasicFormattedTextFieldUI.java \
+classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java \
+classpath/javax/swing/plaf/basic/BasicIconFactory.java \
+classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java \
+classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java \
+classpath/javax/swing/plaf/basic/BasicLabelUI.java \
+classpath/javax/swing/plaf/basic/BasicListUI.java \
+classpath/javax/swing/plaf/basic/BasicLookAndFeel.java \
+classpath/javax/swing/plaf/basic/BasicMenuBarUI.java \
+classpath/javax/swing/plaf/basic/BasicMenuItemUI.java \
+classpath/javax/swing/plaf/basic/BasicMenuUI.java \
+classpath/javax/swing/plaf/basic/BasicOptionPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicPanelUI.java \
+classpath/javax/swing/plaf/basic/BasicPasswordFieldUI.java \
+classpath/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java \
+classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java \
+classpath/javax/swing/plaf/basic/BasicProgressBarUI.java \
+classpath/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java \
+classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java \
+classpath/javax/swing/plaf/basic/BasicRootPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicScrollBarUI.java \
+classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicSeparatorUI.java \
+classpath/javax/swing/plaf/basic/BasicSliderUI.java \
+classpath/javax/swing/plaf/basic/BasicSpinnerUI.java \
+classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java \
+classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java \
+classpath/javax/swing/plaf/basic/BasicTableUI.java \
+classpath/javax/swing/plaf/basic/BasicTextAreaUI.java \
+classpath/javax/swing/plaf/basic/BasicTextFieldUI.java \
+classpath/javax/swing/plaf/basic/BasicTextPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicTextUI.java \
+classpath/javax/swing/plaf/basic/BasicToggleButtonUI.java \
+classpath/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java \
+classpath/javax/swing/plaf/basic/BasicToolBarUI.java \
+classpath/javax/swing/plaf/basic/BasicToolTipUI.java \
+classpath/javax/swing/plaf/basic/BasicTreeUI.java \
+classpath/javax/swing/plaf/basic/BasicViewportUI.java \
+classpath/javax/swing/plaf/basic/ComboPopup.java \
+classpath/javax/swing/plaf/basic/DefaultMenuLayout.java
+
+javax_swing_plaf_basic_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_plaf_basic_source_files)))
+javax_swing_plaf_metal_source_files = \
+classpath/javax/swing/plaf/metal/DefaultMetalTheme.java \
+classpath/javax/swing/plaf/metal/MetalBorders.java \
+classpath/javax/swing/plaf/metal/MetalButtonUI.java \
+classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java \
+classpath/javax/swing/plaf/metal/MetalCheckBoxUI.java \
+classpath/javax/swing/plaf/metal/MetalComboBoxIcon.java \
+classpath/javax/swing/plaf/metal/MetalComboBoxUI.java \
+classpath/javax/swing/plaf/metal/MetalDesktopIconUI.java \
+classpath/javax/swing/plaf/metal/MetalIconFactory.java \
+classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java \
+classpath/javax/swing/plaf/metal/MetalLabelUI.java \
+classpath/javax/swing/plaf/metal/MetalLookAndFeel.java \
+classpath/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java \
+classpath/javax/swing/plaf/metal/MetalProgressBarUI.java \
+classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java \
+classpath/javax/swing/plaf/metal/MetalRootPaneUI.java \
+classpath/javax/swing/plaf/metal/MetalScrollBarUI.java \
+classpath/javax/swing/plaf/metal/MetalScrollPaneUI.java \
+classpath/javax/swing/plaf/metal/MetalSeparatorUI.java \
+classpath/javax/swing/plaf/metal/MetalSliderUI.java \
+classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java \
+classpath/javax/swing/plaf/metal/MetalSplitPaneUI.java \
+classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java \
+classpath/javax/swing/plaf/metal/MetalTextFieldUI.java \
+classpath/javax/swing/plaf/metal/MetalTheme.java \
+classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java \
+classpath/javax/swing/plaf/metal/MetalToolBarUI.java \
+classpath/javax/swing/plaf/metal/MetalToolTipUI.java \
+classpath/javax/swing/plaf/metal/MetalTreeUI.java \
+classpath/javax/swing/plaf/metal/MetalUtils.java
+
+javax_swing_plaf_metal_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_plaf_metal_source_files)))
+javax_swing_table_source_files = \
+classpath/javax/swing/table/AbstractTableModel.java \
+classpath/javax/swing/table/DefaultTableCellRenderer.java \
+classpath/javax/swing/table/DefaultTableColumnModel.java \
+classpath/javax/swing/table/DefaultTableModel.java \
+classpath/javax/swing/table/JTableHeader.java \
+classpath/javax/swing/table/TableCellEditor.java \
+classpath/javax/swing/table/TableCellRenderer.java \
+classpath/javax/swing/table/TableColumn.java \
+classpath/javax/swing/table/TableColumnModel.java \
+classpath/javax/swing/table/TableModel.java
+
+javax_swing_table_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_table_source_files)))
+javax_swing_text_source_files = \
+classpath/javax/swing/text/AbstractDocument.java \
+classpath/javax/swing/text/AttributeSet.java \
+classpath/javax/swing/text/BadLocationException.java \
+classpath/javax/swing/text/Caret.java \
+classpath/javax/swing/text/ChangedCharSetException.java \
+classpath/javax/swing/text/ComponentView.java \
+classpath/javax/swing/text/DateFormatter.java \
+classpath/javax/swing/text/DefaultCaret.java \
+classpath/javax/swing/text/DefaultEditorKit.java \
+classpath/javax/swing/text/DefaultFormatter.java \
+classpath/javax/swing/text/DefaultHighlighter.java \
+classpath/javax/swing/text/DefaultStyledDocument.java \
+classpath/javax/swing/text/Document.java \
+classpath/javax/swing/text/DocumentFilter.java \
+classpath/javax/swing/text/EditorKit.java \
+classpath/javax/swing/text/Element.java \
+classpath/javax/swing/text/FieldView.java \
+classpath/javax/swing/text/GapContent.java \
+classpath/javax/swing/text/Highlighter.java \
+classpath/javax/swing/text/InternationalFormatter.java \
+classpath/javax/swing/text/JTextComponent.java \
+classpath/javax/swing/text/Keymap.java \
+classpath/javax/swing/text/LayeredHighlighter.java \
+classpath/javax/swing/text/MutableAttributeSet.java \
+classpath/javax/swing/text/NavigationFilter.java \
+classpath/javax/swing/text/PasswordView.java \
+classpath/javax/swing/text/PlainDocument.java \
+classpath/javax/swing/text/PlainView.java \
+classpath/javax/swing/text/Position.java \
+classpath/javax/swing/text/Segment.java \
+classpath/javax/swing/text/SimpleAttributeSet.java \
+classpath/javax/swing/text/StringContent.java \
+classpath/javax/swing/text/Style.java \
+classpath/javax/swing/text/StyleConstants.java \
+classpath/javax/swing/text/StyleContext.java \
+classpath/javax/swing/text/StyledDocument.java \
+classpath/javax/swing/text/StyledEditorKit.java \
+classpath/javax/swing/text/TabExpander.java \
+classpath/javax/swing/text/TabSet.java \
+classpath/javax/swing/text/TabStop.java \
+classpath/javax/swing/text/TabableView.java \
+classpath/javax/swing/text/TextAction.java \
+classpath/javax/swing/text/Utilities.java \
+classpath/javax/swing/text/View.java \
+classpath/javax/swing/text/ViewFactory.java
+
+javax_swing_text_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_text_source_files)))
+javax_swing_text_html_source_files = \
+classpath/javax/swing/text/html/HTML.java \
+classpath/javax/swing/text/html/HTMLDocument.java \
+classpath/javax/swing/text/html/HTMLEditorKit.java \
+classpath/javax/swing/text/html/HTMLFrameHyperlinkEvent.java
+
+javax_swing_text_html_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_text_html_source_files)))
+javax_swing_text_html_parser_source_files = \
+classpath/javax/swing/text/html/parser/AttributeList.java \
+classpath/javax/swing/text/html/parser/ContentModel.java \
+classpath/javax/swing/text/html/parser/DTD.java \
+classpath/javax/swing/text/html/parser/DTDConstants.java \
+classpath/javax/swing/text/html/parser/DocumentParser.java \
+classpath/javax/swing/text/html/parser/Element.java \
+classpath/javax/swing/text/html/parser/Entity.java \
+classpath/javax/swing/text/html/parser/Parser.java \
+classpath/javax/swing/text/html/parser/ParserDelegator.java \
+classpath/javax/swing/text/html/parser/TagElement.java
+
+javax_swing_text_html_parser_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_text_html_parser_source_files)))
+javax_swing_text_rtf_source_files = \
+classpath/javax/swing/text/rtf/ControlWordToken.java \
+classpath/javax/swing/text/rtf/RTFEditorKit.java \
+classpath/javax/swing/text/rtf/RTFParseException.java \
+classpath/javax/swing/text/rtf/RTFParser.java \
+classpath/javax/swing/text/rtf/RTFScanner.java \
+classpath/javax/swing/text/rtf/TextToken.java \
+classpath/javax/swing/text/rtf/Token.java
+
+javax_swing_text_rtf_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_text_rtf_source_files)))
+javax_swing_tree_source_files = \
+classpath/javax/swing/tree/AbstractLayoutCache.java \
+classpath/javax/swing/tree/DefaultMutableTreeNode.java \
+classpath/javax/swing/tree/DefaultTreeCellEditor.java \
+classpath/javax/swing/tree/DefaultTreeCellRenderer.java \
+classpath/javax/swing/tree/DefaultTreeModel.java \
+classpath/javax/swing/tree/DefaultTreeSelectionModel.java \
+classpath/javax/swing/tree/ExpandVetoException.java \
+classpath/javax/swing/tree/FixedHeightLayoutCache.java \
+classpath/javax/swing/tree/MutableTreeNode.java \
+classpath/javax/swing/tree/RowMapper.java \
+classpath/javax/swing/tree/TreeCellEditor.java \
+classpath/javax/swing/tree/TreeCellRenderer.java \
+classpath/javax/swing/tree/TreeModel.java \
+classpath/javax/swing/tree/TreeNode.java \
+classpath/javax/swing/tree/TreePath.java \
+classpath/javax/swing/tree/TreeSelectionModel.java \
+classpath/javax/swing/tree/VariableHeightLayoutCache.java
+
+javax_swing_tree_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_tree_source_files)))
+javax_swing_undo_source_files = \
+classpath/javax/swing/undo/AbstractUndoableEdit.java \
+classpath/javax/swing/undo/CannotRedoException.java \
+classpath/javax/swing/undo/CannotUndoException.java \
+classpath/javax/swing/undo/CompoundEdit.java \
+classpath/javax/swing/undo/StateEdit.java \
+classpath/javax/swing/undo/StateEditable.java \
+classpath/javax/swing/undo/UndoManager.java \
+classpath/javax/swing/undo/UndoableEdit.java \
+classpath/javax/swing/undo/UndoableEditSupport.java
+
+javax_swing_undo_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_undo_source_files)))
+javax_transaction_source_files = \
+classpath/javax/transaction/HeuristicCommitException.java \
+classpath/javax/transaction/HeuristicMixedException.java \
+classpath/javax/transaction/HeuristicRollbackException.java \
+classpath/javax/transaction/InvalidTransactionException.java \
+classpath/javax/transaction/NotSupportedException.java \
+classpath/javax/transaction/RollbackException.java \
+classpath/javax/transaction/Status.java \
+classpath/javax/transaction/Synchronization.java \
+classpath/javax/transaction/SystemException.java \
+classpath/javax/transaction/Transaction.java \
+classpath/javax/transaction/TransactionManager.java \
+classpath/javax/transaction/TransactionRequiredException.java \
+classpath/javax/transaction/TransactionRolledbackException.java \
+classpath/javax/transaction/UserTransaction.java
+
+javax_transaction_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_transaction_source_files)))
+javax_transaction_xa_source_files = \
+classpath/javax/transaction/xa/XAException.java \
+classpath/javax/transaction/xa/XAResource.java \
+classpath/javax/transaction/xa/Xid.java
+
+javax_transaction_xa_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_transaction_xa_source_files)))
+javax_xml_source_files = \
+classpath/javax/xml/XMLConstants.java \
+classpath/javax/xml/datatype/DatatypeConfigurationException.java \
+classpath/javax/xml/datatype/DatatypeConstants.java \
+classpath/javax/xml/datatype/DatatypeFactory.java \
+classpath/javax/xml/datatype/Duration.java \
+classpath/javax/xml/datatype/XMLGregorianCalendar.java \
+classpath/javax/xml/namespace/NamespaceContext.java \
+classpath/javax/xml/namespace/QName.java \
+classpath/javax/xml/parsers/DocumentBuilder.java \
+classpath/javax/xml/parsers/DocumentBuilderFactory.java \
+classpath/javax/xml/parsers/FactoryConfigurationError.java \
+classpath/javax/xml/parsers/ParserConfigurationException.java \
+classpath/javax/xml/parsers/SAXParser.java \
+classpath/javax/xml/parsers/SAXParserFactory.java \
+classpath/javax/xml/transform/ErrorListener.java \
+classpath/javax/xml/transform/OutputKeys.java \
+classpath/javax/xml/transform/Result.java \
+classpath/javax/xml/transform/Source.java \
+classpath/javax/xml/transform/SourceLocator.java \
+classpath/javax/xml/transform/Templates.java \
+classpath/javax/xml/transform/Transformer.java \
+classpath/javax/xml/transform/TransformerConfigurationException.java \
+classpath/javax/xml/transform/TransformerException.java \
+classpath/javax/xml/transform/TransformerFactory.java \
+classpath/javax/xml/transform/TransformerFactoryConfigurationError.java \
+classpath/javax/xml/transform/URIResolver.java \
+classpath/javax/xml/transform/dom/DOMLocator.java \
+classpath/javax/xml/transform/dom/DOMResult.java \
+classpath/javax/xml/transform/dom/DOMSource.java \
+classpath/javax/xml/transform/sax/SAXResult.java \
+classpath/javax/xml/transform/sax/SAXSource.java \
+classpath/javax/xml/transform/sax/SAXTransformerFactory.java \
+classpath/javax/xml/transform/sax/TemplatesHandler.java \
+classpath/javax/xml/transform/sax/TransformerHandler.java \
+classpath/javax/xml/transform/stream/StreamResult.java \
+classpath/javax/xml/transform/stream/StreamSource.java \
+classpath/javax/xml/validation/Schema.java \
+classpath/javax/xml/validation/SchemaFactory.java \
+classpath/javax/xml/validation/TypeInfoProvider.java \
+classpath/javax/xml/validation/Validator.java \
+classpath/javax/xml/validation/ValidatorHandler.java \
+classpath/javax/xml/xpath/XPath.java \
+classpath/javax/xml/xpath/XPathConstants.java \
+classpath/javax/xml/xpath/XPathException.java \
+classpath/javax/xml/xpath/XPathExpression.java \
+classpath/javax/xml/xpath/XPathExpressionException.java \
+classpath/javax/xml/xpath/XPathFactory.java \
+classpath/javax/xml/xpath/XPathFactoryConfigurationException.java \
+classpath/javax/xml/xpath/XPathFunction.java \
+classpath/javax/xml/xpath/XPathFunctionException.java \
+classpath/javax/xml/xpath/XPathFunctionResolver.java \
+classpath/javax/xml/xpath/XPathVariableResolver.java
+
+org_ietf_jgss_source_files = \
+classpath/org/ietf/jgss/ChannelBinding.java \
+classpath/org/ietf/jgss/GSSContext.java \
+classpath/org/ietf/jgss/GSSCredential.java \
+classpath/org/ietf/jgss/GSSException.java \
+classpath/org/ietf/jgss/GSSManager.java \
+classpath/org/ietf/jgss/GSSName.java \
+classpath/org/ietf/jgss/MessageProp.java \
+classpath/org/ietf/jgss/Oid.java
+
+org_ietf_jgss_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(org_ietf_jgss_source_files)))
+org_w3c_source_files = \
+classpath/external/w3c_dom/org/w3c/dom/Attr.java \
+classpath/external/w3c_dom/org/w3c/dom/CDATASection.java \
+classpath/external/w3c_dom/org/w3c/dom/CharacterData.java \
+classpath/external/w3c_dom/org/w3c/dom/Comment.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMConfiguration.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMError.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMErrorHandler.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMException.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMImplementation.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMImplementationList.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMImplementationSource.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMLocator.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMStringList.java \
+classpath/external/w3c_dom/org/w3c/dom/Document.java \
+classpath/external/w3c_dom/org/w3c/dom/DocumentFragment.java \
+classpath/external/w3c_dom/org/w3c/dom/DocumentType.java \
+classpath/external/w3c_dom/org/w3c/dom/Element.java \
+classpath/external/w3c_dom/org/w3c/dom/Entity.java \
+classpath/external/w3c_dom/org/w3c/dom/EntityReference.java \
+classpath/external/w3c_dom/org/w3c/dom/NameList.java \
+classpath/external/w3c_dom/org/w3c/dom/NamedNodeMap.java \
+classpath/external/w3c_dom/org/w3c/dom/Node.java \
+classpath/external/w3c_dom/org/w3c/dom/NodeList.java \
+classpath/external/w3c_dom/org/w3c/dom/Notation.java \
+classpath/external/w3c_dom/org/w3c/dom/ProcessingInstruction.java \
+classpath/external/w3c_dom/org/w3c/dom/Text.java \
+classpath/external/w3c_dom/org/w3c/dom/TypeInfo.java \
+classpath/external/w3c_dom/org/w3c/dom/UserDataHandler.java \
+classpath/external/w3c_dom/org/w3c/dom/bootstrap/DOMImplementationRegistry.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSS2Properties.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSCharsetRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSFontFaceRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSImportRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSMediaRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSPageRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSPrimitiveValue.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSRuleList.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSStyleDeclaration.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSStyleRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSStyleSheet.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSUnknownRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSValue.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSValueList.java \
+classpath/external/w3c_dom/org/w3c/dom/css/Counter.java \
+classpath/external/w3c_dom/org/w3c/dom/css/DOMImplementationCSS.java \
+classpath/external/w3c_dom/org/w3c/dom/css/DocumentCSS.java \
+classpath/external/w3c_dom/org/w3c/dom/css/ElementCSSInlineStyle.java \
+classpath/external/w3c_dom/org/w3c/dom/css/RGBColor.java \
+classpath/external/w3c_dom/org/w3c/dom/css/Rect.java \
+classpath/external/w3c_dom/org/w3c/dom/css/ViewCSS.java \
+classpath/external/w3c_dom/org/w3c/dom/events/DocumentEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/events/Event.java \
+classpath/external/w3c_dom/org/w3c/dom/events/EventException.java \
+classpath/external/w3c_dom/org/w3c/dom/events/EventListener.java \
+classpath/external/w3c_dom/org/w3c/dom/events/EventTarget.java \
+classpath/external/w3c_dom/org/w3c/dom/events/MouseEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/events/MutationEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/events/UIEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLAnchorElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLAppletElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLAreaElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLBRElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLBaseElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLBaseFontElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLBodyElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLButtonElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLCollection.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLDListElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLDirectoryElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLDivElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLDocument.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLFieldSetElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLFontElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLFormElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLFrameElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLFrameSetElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLHRElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLHeadElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLHeadingElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLHtmlElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLIFrameElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLImageElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLInputElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLIsIndexElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLLIElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLLabelElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLLegendElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLLinkElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLMapElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLMenuElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLMetaElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLModElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLOListElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLObjectElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLOptGroupElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLOptionElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLOptionsCollection.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLParagraphElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLParamElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLPreElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLQuoteElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLScriptElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLSelectElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLStyleElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableCaptionElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableCellElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableColElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableRowElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableSectionElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTextAreaElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTitleElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLUListElement.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/DOMImplementationLS.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSException.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSInput.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSLoadEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSOutput.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSParser.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSParserFilter.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSProgressEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSResourceResolver.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSSerializer.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSSerializerFilter.java \
+classpath/external/w3c_dom/org/w3c/dom/ranges/DocumentRange.java \
+classpath/external/w3c_dom/org/w3c/dom/ranges/Range.java \
+classpath/external/w3c_dom/org/w3c/dom/ranges/RangeException.java \
+classpath/external/w3c_dom/org/w3c/dom/stylesheets/DocumentStyle.java \
+classpath/external/w3c_dom/org/w3c/dom/stylesheets/LinkStyle.java \
+classpath/external/w3c_dom/org/w3c/dom/stylesheets/MediaList.java \
+classpath/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheet.java \
+classpath/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheetList.java \
+classpath/external/w3c_dom/org/w3c/dom/traversal/DocumentTraversal.java \
+classpath/external/w3c_dom/org/w3c/dom/traversal/NodeFilter.java \
+classpath/external/w3c_dom/org/w3c/dom/traversal/NodeIterator.java \
+classpath/external/w3c_dom/org/w3c/dom/traversal/TreeWalker.java \
+classpath/external/w3c_dom/org/w3c/dom/views/AbstractView.java \
+classpath/external/w3c_dom/org/w3c/dom/views/DocumentView.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathEvaluator.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathException.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathExpression.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathNSResolver.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathNamespace.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathResult.java
+
+org_xml_source_files = \
+classpath/external/sax/org/xml/sax/AttributeList.java \
+classpath/external/sax/org/xml/sax/Attributes.java \
+classpath/external/sax/org/xml/sax/ContentHandler.java \
+classpath/external/sax/org/xml/sax/DTDHandler.java \
+classpath/external/sax/org/xml/sax/DocumentHandler.java \
+classpath/external/sax/org/xml/sax/EntityResolver.java \
+classpath/external/sax/org/xml/sax/ErrorHandler.java \
+classpath/external/sax/org/xml/sax/HandlerBase.java \
+classpath/external/sax/org/xml/sax/InputSource.java \
+classpath/external/sax/org/xml/sax/Locator.java \
+classpath/external/sax/org/xml/sax/Parser.java \
+classpath/external/sax/org/xml/sax/SAXException.java \
+classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java \
+classpath/external/sax/org/xml/sax/SAXNotSupportedException.java \
+classpath/external/sax/org/xml/sax/SAXParseException.java \
+classpath/external/sax/org/xml/sax/XMLFilter.java \
+classpath/external/sax/org/xml/sax/XMLReader.java \
+classpath/external/sax/org/xml/sax/ext/Attributes2.java \
+classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java \
+classpath/external/sax/org/xml/sax/ext/DeclHandler.java \
+classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java \
+classpath/external/sax/org/xml/sax/ext/EntityResolver2.java \
+classpath/external/sax/org/xml/sax/ext/LexicalHandler.java \
+classpath/external/sax/org/xml/sax/ext/Locator2.java \
+classpath/external/sax/org/xml/sax/ext/Locator2Impl.java \
+classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java \
+classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java \
+classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java \
+classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java \
+classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java \
+classpath/external/sax/org/xml/sax/helpers/NewInstance.java \
+classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java \
+classpath/external/sax/org/xml/sax/helpers/ParserFactory.java \
+classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java \
+classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java \
+classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java
+
+all_packages_source_files = \
+ gnu/awt.list \
+ gnu/awt/j2d.list \
+ gnu/classpath.list \
+ gnu/classpath/debug.list \
+ gnu/gcj.list \
+ gnu/gcj/convert.list \
+ gnu/gcj/io.list \
+ gnu/gcj/runtime.list \
+ gnu/gcj/util.list \
+ gnu/java/awt.list \
+ gnu/java/awt/color.list \
+ gnu/java/awt/image.list \
+ gnu/java/awt/peer.list \
+ gnu/java/io.list \
+ gnu/java/lang.list \
+ gnu/java/lang/reflect.list \
+ gnu/java/locale.list \
+ gnu/java/math.list \
+ gnu/java/net.list \
+ gnu/java/net/protocol/file.list \
+ gnu/java/net/protocol/ftp.list \
+ gnu/java/net/protocol/http.list \
+ gnu/java/net/protocol/http/event.list \
+ gnu/java/net/protocol/https.list \
+ gnu/java/net/protocol/jar.list \
+ gnu/java/nio.list \
+ gnu/java/nio/channels.list \
+ gnu/java/nio/charset.list \
+ gnu/java/rmi.list \
+ gnu/java/rmi/dgc.list \
+ gnu/java/rmi/registry.list \
+ gnu/java/rmi/server.list \
+ gnu/java/security.list \
+ gnu/java/security/action.list \
+ gnu/java/security/ber.list \
+ gnu/java/security/der.list \
+ gnu/java/security/pkcs.list \
+ gnu/java/security/provider.list \
+ gnu/java/security/util.list \
+ gnu/java/security/x509.list \
+ gnu/java/security/x509/ext.list \
+ gnu/java/text.list \
+ gnu/java/util.list \
+ gnu/java/util/prefs.list \
+ gnu/javax/swing/text/html/parser.list \
+ gnu/javax/swing/text/html/parser/models.list \
+ gnu/javax/swing/text/html/parser/support.list \
+ gnu/javax/swing/text/html/parser/support/low.list \
+ gnu/regexp.list \
+ java/applet.list \
+ java/awt.list \
+ java/awt/color.list \
+ java/awt/datatransfer.list \
+ java/awt/dnd.list \
+ java/awt/dnd/peer.list \
+ java/awt/event.list \
+ java/awt/font.list \
+ java/awt/geom.list \
+ java/awt/im.list \
+ java/awt/im/spi.list \
+ java/awt/image.list \
+ java/awt/image/renderable.list \
+ java/awt/peer.list \
+ java/awt/print.list \
+ java/beans.list \
+ java/beans/beancontext.list \
+ java/io.list \
+ java/lang.list \
+ java/lang/annotation.list \
+ java/lang/ref.list \
+ java/lang/reflect.list \
+ java/math.list \
+ java/net.list \
+ java/nio.list \
+ java/nio/channels.list \
+ java/nio/channels/spi.list \
+ java/nio/charset.list \
+ java/nio/charset/spi.list \
+ java/rmi.list \
+ java/rmi/activation.list \
+ java/rmi/dgc.list \
+ java/rmi/registry.list \
+ java/rmi/server.list \
+ java/security.list \
+ java/security/acl.list \
+ java/security/cert.list \
+ java/security/interfaces.list \
+ java/security/spec.list \
+ java/sql.list \
+ java/text.list \
+ java/util.list \
+ java/util/jar.list \
+ java/util/logging.list \
+ java/util/prefs.list \
+ java/util/regex.list \
+ java/util/zip.list \
+ javax/accessibility.list \
+ javax/crypto.list \
+ javax/crypto/interfaces.list \
+ javax/crypto/spec.list \
+ javax/naming.list \
+ javax/naming/directory.list \
+ javax/naming/event.list \
+ javax/naming/ldap.list \
+ javax/naming/spi.list \
+ javax/net.list \
+ javax/net/ssl.list \
+ javax/print.list \
+ javax/print/attribute.list \
+ javax/print/attribute/standard.list \
+ javax/print/event.list \
+ javax/security/auth.list \
+ javax/security/auth/callback.list \
+ javax/security/auth/login.list \
+ javax/security/auth/spi.list \
+ javax/security/auth/x500.list \
+ javax/security/cert.list \
+ javax/security/sasl.list \
+ javax/sql.list \
+ javax/swing.list \
+ javax/swing/border.list \
+ javax/swing/colorchooser.list \
+ javax/swing/event.list \
+ javax/swing/filechooser.list \
+ javax/swing/plaf.list \
+ javax/swing/plaf/basic.list \
+ javax/swing/plaf/metal.list \
+ javax/swing/table.list \
+ javax/swing/text.list \
+ javax/swing/text/html.list \
+ javax/swing/text/html/parser.list \
+ javax/swing/text/rtf.list \
+ javax/swing/tree.list \
+ javax/swing/undo.list \
+ javax/transaction.list \
+ javax/transaction/xa.list \
+ org/ietf/jgss.list
+
+ordinary_header_files = \
+ $(gnu_awt_header_files) \
+ $(gnu_awt_j2d_header_files) \
+ $(gnu_classpath_header_files) \
+ $(gnu_classpath_debug_header_files) \
+ $(gnu_gcj_header_files) \
+ $(gnu_gcj_convert_header_files) \
+ $(gnu_gcj_io_header_files) \
+ $(gnu_gcj_runtime_header_files) \
+ $(gnu_gcj_util_header_files) \
+ $(gnu_java_awt_header_files) \
+ $(gnu_java_awt_color_header_files) \
+ $(gnu_java_awt_image_header_files) \
+ $(gnu_java_awt_peer_header_files) \
+ $(gnu_java_io_header_files) \
+ $(gnu_java_lang_header_files) \
+ $(gnu_java_lang_reflect_header_files) \
+ $(gnu_java_locale_header_files) \
+ $(gnu_java_math_header_files) \
+ $(gnu_java_net_header_files) \
+ $(gnu_java_net_protocol_file_header_files) \
+ $(gnu_java_net_protocol_ftp_header_files) \
+ $(gnu_java_net_protocol_http_header_files) \
+ $(gnu_java_net_protocol_http_event_header_files) \
+ $(gnu_java_net_protocol_https_header_files) \
+ $(gnu_java_net_protocol_jar_header_files) \
+ $(gnu_java_nio_header_files) \
+ $(gnu_java_nio_channels_header_files) \
+ $(gnu_java_nio_charset_header_files) \
+ $(gnu_java_rmi_header_files) \
+ $(gnu_java_rmi_dgc_header_files) \
+ $(gnu_java_rmi_registry_header_files) \
+ $(gnu_java_rmi_server_header_files) \
+ $(gnu_java_security_header_files) \
+ $(gnu_java_security_action_header_files) \
+ $(gnu_java_security_ber_header_files) \
+ $(gnu_java_security_der_header_files) \
+ $(gnu_java_security_pkcs_header_files) \
+ $(gnu_java_security_provider_header_files) \
+ $(gnu_java_security_util_header_files) \
+ $(gnu_java_security_x509_header_files) \
+ $(gnu_java_security_x509_ext_header_files) \
+ $(gnu_java_text_header_files) \
+ $(gnu_java_util_header_files) \
+ $(gnu_java_util_prefs_header_files) \
+ $(gnu_javax_swing_text_html_parser_header_files) \
+ $(gnu_javax_swing_text_html_parser_models_header_files) \
+ $(gnu_javax_swing_text_html_parser_support_header_files) \
+ $(gnu_javax_swing_text_html_parser_support_low_header_files) \
+ $(gnu_regexp_header_files) \
+ $(java_applet_header_files) \
+ $(java_awt_header_files) \
+ $(java_awt_color_header_files) \
+ $(java_awt_datatransfer_header_files) \
+ $(java_awt_dnd_header_files) \
+ $(java_awt_dnd_peer_header_files) \
+ $(java_awt_event_header_files) \
+ $(java_awt_font_header_files) \
+ $(java_awt_geom_header_files) \
+ $(java_awt_im_header_files) \
+ $(java_awt_im_spi_header_files) \
+ $(java_awt_image_header_files) \
+ $(java_awt_image_renderable_header_files) \
+ $(java_awt_peer_header_files) \
+ $(java_awt_print_header_files) \
+ $(java_beans_header_files) \
+ $(java_beans_beancontext_header_files) \
+ $(java_io_header_files) \
+ $(java_lang_header_files) \
+ $(java_lang_annotation_header_files) \
+ $(java_lang_ref_header_files) \
+ $(java_lang_reflect_header_files) \
+ $(java_math_header_files) \
+ $(java_net_header_files) \
+ $(java_nio_header_files) \
+ $(java_nio_channels_header_files) \
+ $(java_nio_channels_spi_header_files) \
+ $(java_nio_charset_header_files) \
+ $(java_nio_charset_spi_header_files) \
+ $(java_rmi_header_files) \
+ $(java_rmi_activation_header_files) \
+ $(java_rmi_dgc_header_files) \
+ $(java_rmi_registry_header_files) \
+ $(java_rmi_server_header_files) \
+ $(java_security_header_files) \
+ $(java_security_acl_header_files) \
+ $(java_security_cert_header_files) \
+ $(java_security_interfaces_header_files) \
+ $(java_security_spec_header_files) \
+ $(java_sql_header_files) \
+ $(java_text_header_files) \
+ $(java_util_header_files) \
+ $(java_util_jar_header_files) \
+ $(java_util_logging_header_files) \
+ $(java_util_prefs_header_files) \
+ $(java_util_regex_header_files) \
+ $(java_util_zip_header_files) \
+ $(javax_accessibility_header_files) \
+ $(javax_crypto_header_files) \
+ $(javax_crypto_interfaces_header_files) \
+ $(javax_crypto_spec_header_files) \
+ $(javax_naming_header_files) \
+ $(javax_naming_directory_header_files) \
+ $(javax_naming_event_header_files) \
+ $(javax_naming_ldap_header_files) \
+ $(javax_naming_spi_header_files) \
+ $(javax_net_header_files) \
+ $(javax_net_ssl_header_files) \
+ $(javax_print_header_files) \
+ $(javax_print_attribute_header_files) \
+ $(javax_print_attribute_standard_header_files) \
+ $(javax_print_event_header_files) \
+ $(javax_security_auth_header_files) \
+ $(javax_security_auth_callback_header_files) \
+ $(javax_security_auth_login_header_files) \
+ $(javax_security_auth_spi_header_files) \
+ $(javax_security_auth_x500_header_files) \
+ $(javax_security_cert_header_files) \
+ $(javax_security_sasl_header_files) \
+ $(javax_sql_header_files) \
+ $(javax_swing_header_files) \
+ $(javax_swing_border_header_files) \
+ $(javax_swing_colorchooser_header_files) \
+ $(javax_swing_event_header_files) \
+ $(javax_swing_filechooser_header_files) \
+ $(javax_swing_plaf_header_files) \
+ $(javax_swing_plaf_basic_header_files) \
+ $(javax_swing_plaf_metal_header_files) \
+ $(javax_swing_table_header_files) \
+ $(javax_swing_text_header_files) \
+ $(javax_swing_text_html_header_files) \
+ $(javax_swing_text_html_parser_header_files) \
+ $(javax_swing_text_rtf_header_files) \
+ $(javax_swing_tree_header_files) \
+ $(javax_swing_undo_header_files) \
+ $(javax_transaction_header_files) \
+ $(javax_transaction_xa_header_files) \
+ $(org_ietf_jgss_header_files)
+
+bc_objects = \
+ gnu-java-beans.lo \
+ gnu-xml.lo \
+ javax-imageio.lo \
+ javax-xml.lo \
+ org-w3c.lo \
+ org-xml.lo
+
+omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
+ java/lang/String.h java/lang/reflect/Constructor.h \
+ java/lang/reflect/Field.h java/lang/reflect/Method.h \
+ java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
+
+generic_header_files = $(filter-out $(omitted_headers),$(ordinary_header_files) $(xlib_nat_headers)) \
+ gnu/gcj/tools/gcj_dbtool/Main.h
+inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
+ java/io/ObjectInputStream$$GetField.h \
+ java/nio/DirectByteBufferImpl$$ReadWrite.h \
+ java/nio/channels/Pipe$$SinkChannel.h \
+ java/nio/channels/Pipe$$SourceChannel.h \
+ java/lang/reflect/Proxy$$ProxyData.h \
+ java/lang/reflect/Proxy$$ProxyType.h \
+ gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
+ gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
+ gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
+ gnu/java/nio/PipeImpl$$SourceChannelImpl.h \
+ $(PLATFORM_INNER_NAT_HDRS)
+
+nat_headers = $(ordinary_header_files) $(inner_nat_headers) \
+ gnu/gcj/tools/gcj_dbtool/Main.h
+
+nat_headers_install = $(ordinary_header_files)
+xlib_nat_headers = $(patsubst %.java,%.h,$(xlib_java_source_files))
+extra_headers = java/lang/Object.h java/lang/Class.h
+NM = nm
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@gen_from_JIS_SOURCES = \
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gnu/gcj/convert/gen-from-JIS.c \
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gnu/gcj/convert/make-trie.c
+
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@gen_from_JIS_DEPENDENCIES = \
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gnu/gcj/convert/JIS0201.h \
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gnu/gcj/convert/JIS0208.h \
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ gnu/gcj/convert/JIS0212.h
+
+jv_convert_SOURCES =
+jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
+
+jv_convert_LINK = $(GCJLINK)
+jv_convert_LDADD = -L$(here)/.libs libgcj.la
+jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
+gcj_dbtool_SOURCES = \
+gnu/gcj/tools/gcj_dbtool/Main.java \
+gnu/gcj/tools/gcj_dbtool/natMain.cc
+
+gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
+
+gcj_dbtool_LINK = $(GCJLINK)
+gcj_dbtool_LDADD = -L$(here)/.libs libgcj.la
+gcj_dbtool_DEPENDENCIES = libgcj.la libgcj.spec
+gij_SOURCES =
+gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
+gij_LINK = $(GCJLINK)
+gij_LDADD = -L$(here)/.libs libgij.la
+gij_DEPENDENCIES = libgij.la
+grmic_SOURCES =
+grmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
+
+grmic_LINK = $(GCJLINK)
+grmic_LDADD = -L$(here)/.libs libgcj.la
+grmic_DEPENDENCIES = libgcj.la libgcj.spec
+grmiregistry_SOURCES =
+grmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
+
+grmiregistry_LINK = $(GCJLINK)
+grmiregistry_LDADD = -L$(here)/.libs libgcj.la
+grmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
nat_source_files = \
gnu/classpath/natSystemProperties.cc \
gnu/gcj/natCore.cc \
@@ -3892,6 +4759,7 @@ gnu/gcj/xlib/natXImage.cc \
gnu/gcj/xlib/natXUnmapEvent.cc
sourcesdir = $(jardir)
+headers_to_make = $(nat_headers) $(am__append_14)
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
@@ -3948,10 +4816,10 @@ MULTICLEAN = true
all: all-recursive
.SUFFIXES:
-.SUFFIXES: .class .java .h .properties .c .cc .lo .o .obj
+.SUFFIXES: .class .java .h .properties .list .c .cc .lo .o .obj
am--refresh:
@:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/sources.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -3988,8 +4856,6 @@ libgcj.spec: $(top_builddir)/config.status $(srcdir)/libgcj.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
libgcj-test.spec: $(top_builddir)/config.status $(srcdir)/libgcj-test.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
-gnu/classpath/Configuration.java: $(top_builddir)/config.status $(top_srcdir)/gnu/classpath/Configuration.java.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(toolexeclibdir)" || $(mkdir_p) "$(DESTDIR)$(toolexeclibdir)"
@@ -4083,140 +4949,18 @@ gnu/gcj/xlib/lib_gnu_awt_xlib_la-natXImage.lo: \
gnu/gcj/xlib/lib_gnu_awt_xlib_la-natXUnmapEvent.lo: \
gnu/gcj/xlib/$(am__dirstamp) \
gnu/gcj/xlib/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/$(am__dirstamp):
- @$(mkdir_p) jni/gtk-peer
- @: > jni/gtk-peer/$(am__dirstamp)
-jni/gtk-peer/$(DEPDIR)/$(am__dirstamp):
- @$(mkdir_p) jni/gtk-peer/$(DEPDIR)
- @: > jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/classpath/$(am__dirstamp):
- @$(mkdir_p) jni/classpath
- @: > jni/classpath/$(am__dirstamp)
-jni/classpath/$(DEPDIR)/$(am__dirstamp):
- @$(mkdir_p) jni/classpath/$(DEPDIR)
- @: > jni/classpath/$(DEPDIR)/$(am__dirstamp)
-jni/classpath/lib_gnu_java_awt_peer_gtk_la-native_state.lo: \
- jni/classpath/$(am__dirstamp) \
- jni/classpath/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
lib-gnu-java-awt-peer-gtk.la: $(lib_gnu_java_awt_peer_gtk_la_OBJECTS) $(lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES)
$(lib_gnu_java_awt_peer_gtk_la_LINK) $(am_lib_gnu_java_awt_peer_gtk_la_rpath) $(lib_gnu_java_awt_peer_gtk_la_LDFLAGS) $(lib_gnu_java_awt_peer_gtk_la_OBJECTS) $(lib_gnu_java_awt_peer_gtk_la_LIBADD) $(LIBS)
+java/lang/$(am__dirstamp):
+ @$(mkdir_p) java/lang
+ @: > java/lang/$(am__dirstamp)
+java/lang/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) java/lang/$(DEPDIR)
+ @: > java/lang/$(DEPDIR)/$(am__dirstamp)
+java/lang/Class.lo: java/lang/$(am__dirstamp) \
+ java/lang/$(DEPDIR)/$(am__dirstamp)
+java/lang/Object.lo: java/lang/$(am__dirstamp) \
+ java/lang/$(DEPDIR)/$(am__dirstamp)
gnu/classpath/$(am__dirstamp):
@$(mkdir_p) gnu/classpath
@: > gnu/classpath/$(am__dirstamp)
@@ -4350,12 +5094,6 @@ java/io/natObjectInputStream.lo: java/io/$(am__dirstamp) \
java/io/$(DEPDIR)/$(am__dirstamp)
java/io/natVMObjectStreamClass.lo: java/io/$(am__dirstamp) \
java/io/$(DEPDIR)/$(am__dirstamp)
-java/lang/$(am__dirstamp):
- @$(mkdir_p) java/lang
- @: > java/lang/$(am__dirstamp)
-java/lang/$(DEPDIR)/$(am__dirstamp):
- @$(mkdir_p) java/lang/$(DEPDIR)
- @: > java/lang/$(DEPDIR)/$(am__dirstamp)
java/lang/natCharacter.lo: java/lang/$(am__dirstamp) \
java/lang/$(DEPDIR)/$(am__dirstamp)
java/lang/natClass.lo: java/lang/$(am__dirstamp) \
@@ -4477,84 +5215,6 @@ java/util/zip/natDeflater.lo: java/util/zip/$(am__dirstamp) \
java/util/zip/$(DEPDIR)/$(am__dirstamp)
java/util/zip/natInflater.lo: java/util/zip/$(am__dirstamp) \
java/util/zip/$(DEPDIR)/$(am__dirstamp)
-java/lang/dtoa.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/k_rem_pio2.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/s_tan.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_acos.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/k_sin.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/strtod.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_asin.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/k_tan.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/w_acos.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_atan2.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/mprec.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/w_asin.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_exp.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/s_atan.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/w_atan2.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_fmod.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/s_ceil.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/w_exp.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_log.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/s_copysign.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/w_fmod.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_pow.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/s_cos.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/w_log.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_rem_pio2.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/s_fabs.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/w_pow.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_remainder.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/s_floor.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/w_remainder.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_scalb.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/s_rint.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/w_sqrt.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/e_sqrt.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/s_scalbn.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/sf_rint.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/k_cos.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/s_sin.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
-java/lang/sf_fabs.lo: java/lang/$(am__dirstamp) \
- java/lang/$(DEPDIR)/$(am__dirstamp)
sysdep/$(am__dirstamp):
@$(mkdir_p) sysdep
@: > sysdep/$(am__dirstamp)
@@ -4759,40 +5419,10 @@ mostlyclean-compile:
-rm -f java/io/natObjectInputStream.lo
-rm -f java/io/natVMObjectStreamClass.$(OBJEXT)
-rm -f java/io/natVMObjectStreamClass.lo
- -rm -f java/lang/dtoa.$(OBJEXT)
- -rm -f java/lang/dtoa.lo
- -rm -f java/lang/e_acos.$(OBJEXT)
- -rm -f java/lang/e_acos.lo
- -rm -f java/lang/e_asin.$(OBJEXT)
- -rm -f java/lang/e_asin.lo
- -rm -f java/lang/e_atan2.$(OBJEXT)
- -rm -f java/lang/e_atan2.lo
- -rm -f java/lang/e_exp.$(OBJEXT)
- -rm -f java/lang/e_exp.lo
- -rm -f java/lang/e_fmod.$(OBJEXT)
- -rm -f java/lang/e_fmod.lo
- -rm -f java/lang/e_log.$(OBJEXT)
- -rm -f java/lang/e_log.lo
- -rm -f java/lang/e_pow.$(OBJEXT)
- -rm -f java/lang/e_pow.lo
- -rm -f java/lang/e_rem_pio2.$(OBJEXT)
- -rm -f java/lang/e_rem_pio2.lo
- -rm -f java/lang/e_remainder.$(OBJEXT)
- -rm -f java/lang/e_remainder.lo
- -rm -f java/lang/e_scalb.$(OBJEXT)
- -rm -f java/lang/e_scalb.lo
- -rm -f java/lang/e_sqrt.$(OBJEXT)
- -rm -f java/lang/e_sqrt.lo
- -rm -f java/lang/k_cos.$(OBJEXT)
- -rm -f java/lang/k_cos.lo
- -rm -f java/lang/k_rem_pio2.$(OBJEXT)
- -rm -f java/lang/k_rem_pio2.lo
- -rm -f java/lang/k_sin.$(OBJEXT)
- -rm -f java/lang/k_sin.lo
- -rm -f java/lang/k_tan.$(OBJEXT)
- -rm -f java/lang/k_tan.lo
- -rm -f java/lang/mprec.$(OBJEXT)
- -rm -f java/lang/mprec.lo
+ -rm -f java/lang/Class.$(OBJEXT)
+ -rm -f java/lang/Class.lo
+ -rm -f java/lang/Object.$(OBJEXT)
+ -rm -f java/lang/Object.lo
-rm -f java/lang/natCharacter.$(OBJEXT)
-rm -f java/lang/natCharacter.lo
-rm -f java/lang/natClass.$(OBJEXT)
@@ -4839,50 +5469,6 @@ mostlyclean-compile:
-rm -f java/lang/reflect/natMethod.lo
-rm -f java/lang/reflect/natProxy.$(OBJEXT)
-rm -f java/lang/reflect/natProxy.lo
- -rm -f java/lang/s_atan.$(OBJEXT)
- -rm -f java/lang/s_atan.lo
- -rm -f java/lang/s_ceil.$(OBJEXT)
- -rm -f java/lang/s_ceil.lo
- -rm -f java/lang/s_copysign.$(OBJEXT)
- -rm -f java/lang/s_copysign.lo
- -rm -f java/lang/s_cos.$(OBJEXT)
- -rm -f java/lang/s_cos.lo
- -rm -f java/lang/s_fabs.$(OBJEXT)
- -rm -f java/lang/s_fabs.lo
- -rm -f java/lang/s_floor.$(OBJEXT)
- -rm -f java/lang/s_floor.lo
- -rm -f java/lang/s_rint.$(OBJEXT)
- -rm -f java/lang/s_rint.lo
- -rm -f java/lang/s_scalbn.$(OBJEXT)
- -rm -f java/lang/s_scalbn.lo
- -rm -f java/lang/s_sin.$(OBJEXT)
- -rm -f java/lang/s_sin.lo
- -rm -f java/lang/s_tan.$(OBJEXT)
- -rm -f java/lang/s_tan.lo
- -rm -f java/lang/sf_fabs.$(OBJEXT)
- -rm -f java/lang/sf_fabs.lo
- -rm -f java/lang/sf_rint.$(OBJEXT)
- -rm -f java/lang/sf_rint.lo
- -rm -f java/lang/strtod.$(OBJEXT)
- -rm -f java/lang/strtod.lo
- -rm -f java/lang/w_acos.$(OBJEXT)
- -rm -f java/lang/w_acos.lo
- -rm -f java/lang/w_asin.$(OBJEXT)
- -rm -f java/lang/w_asin.lo
- -rm -f java/lang/w_atan2.$(OBJEXT)
- -rm -f java/lang/w_atan2.lo
- -rm -f java/lang/w_exp.$(OBJEXT)
- -rm -f java/lang/w_exp.lo
- -rm -f java/lang/w_fmod.$(OBJEXT)
- -rm -f java/lang/w_fmod.lo
- -rm -f java/lang/w_log.$(OBJEXT)
- -rm -f java/lang/w_log.lo
- -rm -f java/lang/w_pow.$(OBJEXT)
- -rm -f java/lang/w_pow.lo
- -rm -f java/lang/w_remainder.$(OBJEXT)
- -rm -f java/lang/w_remainder.lo
- -rm -f java/lang/w_sqrt.$(OBJEXT)
- -rm -f java/lang/w_sqrt.lo
-rm -f java/net/natInetAddress.$(OBJEXT)
-rm -f java/net/natInetAddress.lo
-rm -f java/net/natVMNetworkInterface.$(OBJEXT)
@@ -4903,86 +5489,6 @@ mostlyclean-compile:
-rm -f java/util/zip/natDeflater.lo
-rm -f java/util/zip/natInflater.$(OBJEXT)
-rm -f java/util/zip/natInflater.lo
- -rm -f jni/classpath/lib_gnu_java_awt_peer_gtk_la-native_state.$(OBJEXT)
- -rm -f jni/classpath/lib_gnu_java_awt_peer_gtk_la-native_state.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo
-rm -f sysdep/dwarf2-backtrace.$(OBJEXT)
-rm -f sysdep/dwarf2-backtrace.lo
@@ -5058,23 +5564,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@java/io/$(DEPDIR)/natFile.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/io/$(DEPDIR)/natObjectInputStream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/io/$(DEPDIR)/natVMObjectStreamClass.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/dtoa.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_acos.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_asin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_atan2.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_exp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_fmod.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_log.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_pow.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_rem_pio2.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_remainder.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_scalb.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/e_sqrt.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/k_cos.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/k_rem_pio2.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/k_sin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/k_tan.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/mprec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/Class.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/Object.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natCharacter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natClass.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natClassLoader.Plo@am__quote@
@@ -5092,28 +5583,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natVMClassLoader.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natVMSecurityManager.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natVMThrowable.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/s_atan.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/s_ceil.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/s_copysign.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/s_cos.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/s_fabs.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/s_floor.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/s_rint.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/s_scalbn.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/s_sin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/s_tan.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/sf_fabs.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/sf_rint.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/strtod.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/w_acos.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/w_asin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/w_atan2.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/w_exp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/w_fmod.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/w_log.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/w_pow.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/w_remainder.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/w_sqrt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/lang/ref/$(DEPDIR)/natReference.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/lang/reflect/$(DEPDIR)/natArray.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/lang/reflect/$(DEPDIR)/natConstructor.Plo@am__quote@
@@ -5130,46 +5599,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@java/util/logging/$(DEPDIR)/natLogger.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/util/zip/$(DEPDIR)/natDeflater.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/util/zip/$(DEPDIR)/natInflater.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-native_state.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gthread-jni.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@sysdep/$(DEPDIR)/dwarf2-backtrace.Plo@am__quote@
.c.o:
@@ -5196,286 +5625,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkChoicePeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkClipboard.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkComponentPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkEvents.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkFramePeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkGenericPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPanelPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkPopupMenuPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkScrollPanePeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextComponentPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo: jni/gtk-peer/gthread-jni.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gthread-jni.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo `test -f 'jni/gtk-peer/gthread-jni.c' || echo '$(srcdir)/'`jni/gtk-peer/gthread-jni.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gthread-jni.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gthread-jni.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gthread-jni.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gthread-jni.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo `test -f 'jni/gtk-peer/gthread-jni.c' || echo '$(srcdir)/'`jni/gtk-peer/gthread-jni.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo: jni/gtk-peer/gtk_jawt.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo `test -f 'jni/gtk-peer/gtk_jawt.c' || echo '$(srcdir)/'`jni/gtk-peer/gtk_jawt.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gtk_jawt.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo `test -f 'jni/gtk-peer/gtk_jawt.c' || echo '$(srcdir)/'`jni/gtk-peer/gtk_jawt.c
-
-jni/classpath/lib_gnu_java_awt_peer_gtk_la-native_state.lo: jni/classpath/native_state.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/classpath/lib_gnu_java_awt_peer_gtk_la-native_state.lo -MD -MP -MF "jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-native_state.Tpo" -c -o jni/classpath/lib_gnu_java_awt_peer_gtk_la-native_state.lo `test -f 'jni/classpath/native_state.c' || echo '$(srcdir)/'`jni/classpath/native_state.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-native_state.Tpo" "jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-native_state.Plo"; else rm -f "jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-native_state.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/classpath/native_state.c' object='jni/classpath/lib_gnu_java_awt_peer_gtk_la-native_state.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/classpath/lib_gnu_java_awt_peer_gtk_la-native_state.lo `test -f 'jni/classpath/native_state.c' || echo '$(srcdir)/'`jni/classpath/native_state.c
-
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
-
libgcjawt_la-jawt.lo: jawt.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgcjawt_la_CFLAGS) $(CFLAGS) -MT libgcjawt_la-jawt.lo -MD -MP -MF "$(DEPDIR)/libgcjawt_la-jawt.Tpo" -c -o libgcjawt_la-jawt.lo `test -f 'jawt.c' || echo '$(srcdir)/'`jawt.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgcjawt_la-jawt.Tpo" "$(DEPDIR)/libgcjawt_la-jawt.Plo"; else rm -f "$(DEPDIR)/libgcjawt_la-jawt.Tpo"; exit 1; fi
@@ -5699,8 +5848,6 @@ clean-libtool:
-rm -rf java/util/.libs java/util/_libs
-rm -rf java/util/logging/.libs java/util/logging/_libs
-rm -rf java/util/zip/.libs java/util/zip/_libs
- -rm -rf jni/classpath/.libs jni/classpath/_libs
- -rm -rf jni/gtk-peer/.libs jni/gtk-peer/_libs
-rm -rf sysdep/.libs sysdep/_libs
distclean-libtool:
@@ -5782,7 +5929,13 @@ uninstall-toolexecmainlibDATA:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @set fnord $$MAKEFLAGS; amf=$$2; \
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -5794,7 +5947,7 @@ $(RECURSIVE_TARGETS):
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ || eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
@@ -5802,7 +5955,13 @@ $(RECURSIVE_TARGETS):
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
- @set fnord $$MAKEFLAGS; amf=$$2; \
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
@@ -5823,7 +5982,7 @@ maintainer-clean-recursive:
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ || eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -5898,7 +6057,7 @@ distclean-tags:
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
- $(mkdir_p) $(distdir)/. $(distdir)/.. $(distdir)/../config $(distdir)/gnu/awt $(distdir)/gnu/awt/j2d $(distdir)/gnu/awt/xlib $(distdir)/gnu/classpath $(distdir)/gnu/gcj $(distdir)/gnu/gcj/convert $(distdir)/gnu/gcj/io $(distdir)/gnu/gcj/runtime $(distdir)/gnu/gcj/tools/gcj_dbtool $(distdir)/gnu/gcj/util $(distdir)/gnu/gcj/xlib $(distdir)/gnu/java/awt $(distdir)/gnu/java/awt/color $(distdir)/gnu/java/awt/image $(distdir)/gnu/java/awt/peer $(distdir)/gnu/java/awt/peer/gtk $(distdir)/gnu/java/beans $(distdir)/gnu/java/beans/decoder $(distdir)/gnu/java/beans/editors $(distdir)/gnu/java/io $(distdir)/gnu/java/lang $(distdir)/gnu/java/lang/reflect $(distdir)/gnu/java/locale $(distdir)/gnu/java/math $(distdir)/gnu/java/net $(distdir)/gnu/java/net/protocol/core $(distdir)/gnu/java/net/protocol/file $(distdir)/gnu/java/net/protocol/ftp $(distdir)/gnu/java/net/protocol/gcjlib $(distdir)/gnu/java/net/protocol/http $(distdir)/gnu/java/net/protocol/http/event $(distdir)/gnu/java/net/protocol/https $(distdir)/gnu/java/net/protocol/jar $(distdir)/gnu/java/nio $(distdir)/gnu/java/nio/channels $(distdir)/gnu/java/nio/charset $(distdir)/gnu/java/rmi $(distdir)/gnu/java/rmi/dgc $(distdir)/gnu/java/rmi/registry $(distdir)/gnu/java/rmi/rmic $(distdir)/gnu/java/rmi/server $(distdir)/gnu/java/security $(distdir)/gnu/java/security/action $(distdir)/gnu/java/security/ber $(distdir)/gnu/java/security/der $(distdir)/gnu/java/security/pkcs $(distdir)/gnu/java/security/provider $(distdir)/gnu/java/security/util $(distdir)/gnu/java/security/x509 $(distdir)/gnu/java/security/x509/ext $(distdir)/gnu/java/text $(distdir)/gnu/java/util $(distdir)/gnu/java/util/prefs $(distdir)/gnu/javax/swing/text/html/parser $(distdir)/gnu/javax/swing/text/html/parser/models $(distdir)/gnu/javax/swing/text/html/parser/support $(distdir)/gnu/javax/swing/text/html/parser/support/low $(distdir)/gnu/regexp $(distdir)/gnu/xml/aelfred2 $(distdir)/gnu/xml/dom $(distdir)/gnu/xml/dom/html2 $(distdir)/gnu/xml/dom/ls $(distdir)/gnu/xml/pipeline $(distdir)/gnu/xml/transform $(distdir)/gnu/xml/util $(distdir)/gnu/xml/xpath $(distdir)/java/applet $(distdir)/java/awt $(distdir)/java/awt/color $(distdir)/java/awt/datatransfer $(distdir)/java/awt/dnd $(distdir)/java/awt/dnd/peer $(distdir)/java/awt/event $(distdir)/java/awt/font $(distdir)/java/awt/geom $(distdir)/java/awt/im $(distdir)/java/awt/im/spi $(distdir)/java/awt/image $(distdir)/java/awt/image/renderable $(distdir)/java/awt/peer $(distdir)/java/awt/print $(distdir)/java/beans $(distdir)/java/beans/beancontext $(distdir)/java/io $(distdir)/java/lang $(distdir)/java/lang/ref $(distdir)/java/lang/reflect $(distdir)/java/math $(distdir)/java/net $(distdir)/java/nio $(distdir)/java/nio/channels $(distdir)/java/nio/channels/spi $(distdir)/java/nio/charset $(distdir)/java/nio/charset/spi $(distdir)/java/rmi $(distdir)/java/rmi/activation $(distdir)/java/rmi/dgc $(distdir)/java/rmi/registry $(distdir)/java/rmi/server $(distdir)/java/security $(distdir)/java/security/acl $(distdir)/java/security/cert $(distdir)/java/security/interfaces $(distdir)/java/security/spec $(distdir)/java/sql $(distdir)/java/text $(distdir)/java/util $(distdir)/java/util/jar $(distdir)/java/util/logging $(distdir)/java/util/prefs $(distdir)/java/util/regex $(distdir)/java/util/zip $(distdir)/javax/accessibility $(distdir)/javax/crypto $(distdir)/javax/crypto/interfaces $(distdir)/javax/crypto/spec $(distdir)/javax/imageio $(distdir)/javax/imageio/event $(distdir)/javax/imageio/metadata $(distdir)/javax/imageio/spi $(distdir)/javax/imageio/stream $(distdir)/javax/naming $(distdir)/javax/naming/directory $(distdir)/javax/naming/event $(distdir)/javax/naming/ldap $(distdir)/javax/naming/spi $(distdir)/javax/net $(distdir)/javax/net/ssl $(distdir)/javax/print $(distdir)/javax/print/attribute $(distdir)/javax/print/attribute/standard $(distdir)/javax/print/event $(distdir)/javax/security/auth $(distdir)/javax/security/auth/callback $(distdir)/javax/security/auth/login $(distdir)/javax/security/auth/spi $(distdir)/javax/security/auth/x500 $(distdir)/javax/security/cert $(distdir)/javax/security/sasl $(distdir)/javax/sql $(distdir)/javax/swing $(distdir)/javax/swing/border $(distdir)/javax/swing/colorchooser $(distdir)/javax/swing/event $(distdir)/javax/swing/filechooser $(distdir)/javax/swing/plaf $(distdir)/javax/swing/plaf/basic $(distdir)/javax/swing/plaf/metal $(distdir)/javax/swing/table $(distdir)/javax/swing/text $(distdir)/javax/swing/text/html $(distdir)/javax/swing/text/html/parser $(distdir)/javax/swing/text/rtf $(distdir)/javax/swing/tree $(distdir)/javax/swing/undo $(distdir)/javax/transaction $(distdir)/javax/transaction/xa $(distdir)/javax/xml $(distdir)/javax/xml/datatype $(distdir)/javax/xml/namespace $(distdir)/javax/xml/parsers $(distdir)/javax/xml/transform $(distdir)/javax/xml/transform/dom $(distdir)/javax/xml/transform/sax $(distdir)/javax/xml/transform/stream $(distdir)/javax/xml/validation $(distdir)/javax/xml/xpath $(distdir)/org/ietf/jgss
+ $(mkdir_p) $(distdir)/. $(distdir)/.. $(distdir)/../config
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
@@ -6114,10 +6273,6 @@ distclean-generic:
-rm -f java/util/logging/$(am__dirstamp)
-rm -f java/util/zip/$(DEPDIR)/$(am__dirstamp)
-rm -f java/util/zip/$(am__dirstamp)
- -rm -f jni/classpath/$(DEPDIR)/$(am__dirstamp)
- -rm -f jni/classpath/$(am__dirstamp)
- -rm -f jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
- -rm -f jni/gtk-peer/$(am__dirstamp)
-rm -f sysdep/$(DEPDIR)/$(am__dirstamp)
-rm -f sysdep/$(am__dirstamp)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
@@ -6127,13 +6282,13 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
-clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
+clean-am: clean-binPROGRAMS clean-generic clean-libtool \
clean-noinstPROGRAMS clean-toolexeclibLTLIBRARIES \
mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ./$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/zip/$(DEPDIR) jni/classpath/$(DEPDIR) jni/gtk-peer/$(DEPDIR) sysdep/$(DEPDIR)
+ -rm -rf ./$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/zip/$(DEPDIR) sysdep/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-local distclean-tags
@@ -6164,7 +6319,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ./$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/zip/$(DEPDIR) jni/classpath/$(DEPDIR) jni/gtk-peer/$(DEPDIR) sysdep/$(DEPDIR)
+ -rm -rf ./$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/zip/$(DEPDIR) sysdep/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -6190,7 +6345,7 @@ uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-binPROGRAMS clean-generic clean-libtool \
- clean-local clean-noinstPROGRAMS clean-recursive \
+ clean-noinstPROGRAMS clean-recursive \
clean-toolexeclibLTLIBRARIES ctags ctags-recursive dist \
dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \
distcheck distclean distclean-compile distclean-generic \
@@ -6214,174 +6369,25 @@ uninstall-info: uninstall-info-recursive
uninstall-toolexecmainlibDATA
-# Build dependencies between java, class and lo files. They are included
-# below, together with automatically-generated dependencies between Java
-# files.
-#
-# Dependencies from Java to .class files
-# --------------------------------------
-# Each directory's filelist file depends on the corresponding Java source files.
-# The stamp file depends on the filelist (using a `Static Pattern Rule').
-# Each class file depends on the its directory's .stamp file. This reflects
-# the fact that 1) all classfiles are compiled in one go when the .stamp file
-# is built and 2) anything which depends on a particular .class file must wait
-# until its directory is processed and the .stamp file is created.
-#
-# Dependencies from Java to .lo files
-# -----------------------------------
-# As above, each directory's filelist file depends on the corresponding Java
-# source files, and the stamp file depends on the filelist. For native
-# compilation, the lo file depends on the stamp file (also using a `Static
-# Pattern Rule'). So, when one Java file changes, the filelist file is
-# updated, the stamp file rule builds the .class files, and the .lo file rule
-# recompiles to native code.
-Makefile.deps: $(srcdir)/Makefile.in
- @: $(call write_entries_to_file,$(all_java_source_files),files.tmplist)
- echo 's,^\(.*\)/\([^/]*\)\.java$$,\1.list: &\' > tmpsed
- echo '\1/\2.class: \1.stamp,' >> tmpsed
- sed -ftmpsed files.tmplist > Makefile.deps
- rm files.tmplist tmpsed
-
-# Include automatically generated dependencies between Java source files.
--include Makefile.deps $(all_java_deps_files)
-
$(db_name): gcj-dbtool$(EXEEXT)
@rm -f $(db_name)
./gcj-dbtool -n $(db_name) || touch $(db_name)
-jniinclude/gnu_java_awt_peer_gtk_GdkGraphics.h: gnu/java/awt/peer/gtk/GdkGraphics.java
-jniinclude/gnu_java_awt_peer_gtk_GdkGraphics2D.h: gnu/java/awt/peer/gtk/GdkGraphics2D.java
-jniinclude/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h: gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
-jniinclude/gnu_java_awt_peer_gtk_GdkPixbufDecoder.h: gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
-jniinclude/gnu_java_awt_peer_gtk_GtkButtonPeer.h: gnu/java/awt/peer/gtk/GtkButtonPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkCanvasPeer.h: gnu/java/awt/peer/gtk/GtkCanvasPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h: gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.h: gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxPeer.h: gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkChoicePeer.h: gnu/java/awt/peer/gtk/GtkChoicePeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkClipboard.h: gnu/java/awt/peer/gtk/GtkClipboard.java
-jniinclude/gnu_java_awt_peer_gtk_GtkComponentPeer.h: gnu/java/awt/peer/gtk/GtkComponentPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkContainerPeer.h: gnu/java/awt/peer/gtk/GtkContainerPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkDialogPeer.h: gnu/java/awt/peer/gtk/GtkDialogPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.h: gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkFileDialogPeer.h: gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkFontPeer.h: gnu/java/awt/peer/gtk/GtkFontPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkFramePeer.h: gnu/java/awt/peer/gtk/GtkFramePeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkGenericPeer.h: gnu/java/awt/peer/gtk/GtkGenericPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkImage.h: gnu/java/awt/peer/gtk/GtkImage.java
-jniinclude/gnu_java_awt_peer_gtk_GtkImagePainter.h: gnu/java/awt/peer/gtk/GtkImagePainter.java
-jniinclude/gnu_java_awt_peer_gtk_GtkLabelPeer.h: gnu/java/awt/peer/gtk/GtkLabelPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkListPeer.h: gnu/java/awt/peer/gtk/GtkListPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h: gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.h: gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkMenuItemPeer.h: gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkMenuPeer.h: gnu/java/awt/peer/gtk/GtkMenuPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkOffScreenImage.h: gnu/java/awt/peer/gtk/GtkOffScreenImage.java
-jniinclude/gnu_java_awt_peer_gtk_GtkPanelPeer.h: gnu/java/awt/peer/gtk/GtkPanelPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h: gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkScrollPanePeer.h: gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkScrollbarPeer.h: gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkTextAreaPeer.h: gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkTextComponentPeer.h: gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkTextFieldPeer.h: gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkToolkit.h: gnu/java/awt/peer/gtk/GtkToolkit.java
-jniinclude/gnu_java_awt_peer_gtk_GtkWindowPeer.h: gnu/java/awt/peer/gtk/GtkWindowPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GThreadMutex.h: gnu/java/awt/peer/gtk/GThreadMutex.java
-jniinclude/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.h: gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java
-jniinclude/gnu_java_awt_peer_gtk_GdkTextLayout.h: gnu/java/awt/peer/gtk/GdkTextLayout.java
-jniinclude/gnu_java_awt_peer_gtk_GdkFontPeer.h: gnu/java/awt/peer/gtk/GdkFontPeer.java
-
-$(gtk_jni_headers): %.h:
- @input=`echo $@ | sed -e 's,jniinclude/,,' -e 's,_,.,g' -e 's,.h$$,,'`; \
- echo "$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input"; \
- $(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input
-
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkFontPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphics2D.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphics.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkPixbufDecoder.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkTextLayout.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkButtonPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkCanvasPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkCheckboxPeer.h $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkComponentPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkChoicePeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkClipboard.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkComponentPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkFileDialogPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkFramePeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkGenericPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkImagePainter.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkLabelPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkListPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuItemPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkPanelPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkScrollbarPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkScrollPanePeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkTextAreaPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkTextComponentPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkTextFieldPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkToolkit.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkWindowPeer.h
-
$(lib_gnu_java_awt_peer_gtk_la_OBJECTS): $(lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES)
-%.properties.lo: %.properties
- $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,`echo $@ | sed "s/\.lo$$//"`
-
-# Compile one directory in one go. If the files have to be compiled with the
-# binary compatibility ABI, only make the .class here -- the .lo is made
-# elsewhere in this Makefile.
-
-%.list:
- @: $(shell $(mkinstalldirs) $(basename $@))
- @: $(call write_entries_to_file,$^,$@)
-
-$(all_java_lo_files): %.lo: %.stamp
- $(LTGCJCOMPILE) -o $@ -c @${<:.stamp=.list}
-
-$(all_java_stamp_files): %.stamp: %.list
- $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(BOOTCLASSPATH) -d $(here) \
- -MD -MF ${@:.stamp=.deps} @$<
- echo timestamp > $@
-
-classes.stamp: $(all_property_files) $(all_java_stamp_files)
- echo timestamp > classes.stamp
-
-libgcj-$(gcc_version).jar: classes.stamp
- -@rm -f libgcj-$(gcc_version).jar
- (find java gnu javax org -type d -o -type f -name '*.class'; \
- for file in $(all_property_files); do \
- echo "x-C" | sed -e 's/^.//'; \
- echo $(srcdir); \
- echo $$file; \
- done) | \
- sed -e '/\/xlib/d' -e '/\/\.libs/d' -e '/\/\.deps/d' | \
- $(ZIP) -cfM0E@ $@
- for dir in sax w3c_dom; do \
- (cd external/$$dir; \
- find org -type f -name '*.class' -print | while read file; do \
- echo "x-C" | sed -e 's/^.//'; \
- echo external/$$dir; \
- echo $$file; \
- done) | \
- $(ZIP) -ufM0E@ $@; \
- done
+$(propertyo_files): %.properties.lo: classpath/resource/%.properties
+ $(mkinstalldirs) `dirname $@`; \
+ $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
+
+libgcj-$(gcc_version).jar:
+ jardir=`dirname $(ZIP)`; \
+ jardir=`cd $$jardir && pwd`; \
+ jarname=`basename $(ZIP)`; \
+ cd classpath/lib; $$jardir/$$jarname -cfM \
+ ../../libgcj-$(gcc_version).jar gnu java javax org
mostlyclean-local:
find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
- @: $(foreach header,$(nat_headers) $(xlib_nat_headers) $(gtk_jni_headers),$(shell rm -f '$(header)'))
-
-clean-local:
- find . -name '*.class' -print | xargs rm -f
distclean-local:
find . -name '*.d' -print | xargs rm -f
@@ -6396,46 +6402,1286 @@ lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPEND
$(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
-rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
+%.lo: %.list
+ -mkdir $(dir $@) > /dev/null 2>&1
+ $(LTGCJCOMPILE) -c -o $@ -MT $@ -MD -MP -MF $(basename $@).deps @$<
+
+gnu/awt.list: $(gnu_awt_source_files)
+ @for file in $(gnu_awt_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/awt.list
+
+-include gnu/awt.deps
+
+gnu/awt/j2d.list: $(gnu_awt_j2d_source_files)
+ @for file in $(gnu_awt_j2d_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/awt/j2d.list
+
+-include gnu/awt/j2d.deps
+
+gnu/classpath.list: $(gnu_classpath_source_files)
+ @for file in $(gnu_classpath_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/classpath.list
+
+-include gnu/classpath.deps
+
+gnu/classpath/debug.list: $(gnu_classpath_debug_source_files)
+ @for file in $(gnu_classpath_debug_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/classpath/debug.list
+
+-include gnu/classpath/debug.deps
+
+gnu/gcj.list: $(gnu_gcj_source_files)
+ @for file in $(gnu_gcj_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/gcj.list
+
+-include gnu/gcj.deps
+
+gnu/gcj/convert.list: $(gnu_gcj_convert_source_files)
+ @for file in $(gnu_gcj_convert_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/gcj/convert.list
+
+-include gnu/gcj/convert.deps
+
+gnu/gcj/io.list: $(gnu_gcj_io_source_files)
+ @for file in $(gnu_gcj_io_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/gcj/io.list
+
+-include gnu/gcj/io.deps
+
+gnu/gcj/runtime.list: $(gnu_gcj_runtime_source_files)
+ @for file in $(gnu_gcj_runtime_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/gcj/runtime.list
+
+-include gnu/gcj/runtime.deps
+
+gnu/gcj/util.list: $(gnu_gcj_util_source_files)
+ @for file in $(gnu_gcj_util_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/gcj/util.list
+
+-include gnu/gcj/util.deps
+
+gnu/java/awt.list: $(gnu_java_awt_source_files)
+ @for file in $(gnu_java_awt_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/awt.list
+
+-include gnu/java/awt.deps
+
+gnu/java/awt/color.list: $(gnu_java_awt_color_source_files)
+ @for file in $(gnu_java_awt_color_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/awt/color.list
+
+-include gnu/java/awt/color.deps
+
+gnu/java/awt/image.list: $(gnu_java_awt_image_source_files)
+ @for file in $(gnu_java_awt_image_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/awt/image.list
+
+-include gnu/java/awt/image.deps
+
+gnu/java/awt/peer.list: $(gnu_java_awt_peer_source_files)
+ @for file in $(gnu_java_awt_peer_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/awt/peer.list
+
+-include gnu/java/awt/peer.deps
+
+gnu-java-awt-peer-gtk.lo: $(gnu_java_awt_peer_gtk_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o gnu-java-awt-peer-gtk.lo \
+ `find classpath/lib/gnu/java/awt/peer/gtk -name '*.class' | sort -r`
+
+gnu-java-beans.lo: $(gnu_java_beans_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o gnu-java-beans.lo \
+ `find classpath/lib/gnu/java/beans -name '*.class' | sort -r`
+
+gnu/java/io.list: $(gnu_java_io_source_files)
+ @for file in $(gnu_java_io_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/io.list
+
+-include gnu/java/io.deps
+
+gnu/java/lang.list: $(gnu_java_lang_source_files)
+ @for file in $(gnu_java_lang_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/lang.list
+
+-include gnu/java/lang.deps
+
+gnu/java/lang/reflect.list: $(gnu_java_lang_reflect_source_files)
+ @for file in $(gnu_java_lang_reflect_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/lang/reflect.list
+
+-include gnu/java/lang/reflect.deps
+
+gnu/java/locale.list: $(gnu_java_locale_source_files)
+ @for file in $(gnu_java_locale_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/locale.list
+
+-include gnu/java/locale.deps
+
+gnu/java/math.list: $(gnu_java_math_source_files)
+ @for file in $(gnu_java_math_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/math.list
+
+-include gnu/java/math.deps
+
+gnu/java/net.list: $(gnu_java_net_source_files)
+ @for file in $(gnu_java_net_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net.list
+
+-include gnu/java/net.deps
+
+gnu/java/net/protocol/file.list: $(gnu_java_net_protocol_file_source_files)
+ @for file in $(gnu_java_net_protocol_file_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/file.list
+
+-include gnu/java/net/protocol/file.deps
+
+gnu/java/net/protocol/ftp.list: $(gnu_java_net_protocol_ftp_source_files)
+ @for file in $(gnu_java_net_protocol_ftp_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/ftp.list
+
+-include gnu/java/net/protocol/ftp.deps
+
+gnu/java/net/protocol/http.list: $(gnu_java_net_protocol_http_source_files)
+ @for file in $(gnu_java_net_protocol_http_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/http.list
+
+-include gnu/java/net/protocol/http.deps
+
+gnu/java/net/protocol/http/event.list: $(gnu_java_net_protocol_http_event_source_files)
+ @for file in $(gnu_java_net_protocol_http_event_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/http/event.list
+
+-include gnu/java/net/protocol/http/event.deps
+
+gnu/java/net/protocol/https.list: $(gnu_java_net_protocol_https_source_files)
+ @for file in $(gnu_java_net_protocol_https_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/https.list
+
+-include gnu/java/net/protocol/https.deps
+
+gnu/java/net/protocol/jar.list: $(gnu_java_net_protocol_jar_source_files)
+ @for file in $(gnu_java_net_protocol_jar_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/jar.list
+
+-include gnu/java/net/protocol/jar.deps
+
+gnu/java/nio.list: $(gnu_java_nio_source_files)
+ @for file in $(gnu_java_nio_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/nio.list
+
+-include gnu/java/nio.deps
+
+gnu/java/nio/channels.list: $(gnu_java_nio_channels_source_files)
+ @for file in $(gnu_java_nio_channels_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/nio/channels.list
+
+-include gnu/java/nio/channels.deps
+
+gnu/java/nio/charset.list: $(gnu_java_nio_charset_source_files)
+ @for file in $(gnu_java_nio_charset_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/nio/charset.list
+
+-include gnu/java/nio/charset.deps
+
+gnu/java/rmi.list: $(gnu_java_rmi_source_files)
+ @for file in $(gnu_java_rmi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/rmi.list
+
+-include gnu/java/rmi.deps
+
+gnu/java/rmi/dgc.list: $(gnu_java_rmi_dgc_source_files)
+ @for file in $(gnu_java_rmi_dgc_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/rmi/dgc.list
+
+-include gnu/java/rmi/dgc.deps
+
+gnu/java/rmi/registry.list: $(gnu_java_rmi_registry_source_files)
+ @for file in $(gnu_java_rmi_registry_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/rmi/registry.list
+
+-include gnu/java/rmi/registry.deps
+
+gnu/java/rmi/server.list: $(gnu_java_rmi_server_source_files)
+ @for file in $(gnu_java_rmi_server_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/rmi/server.list
+
+-include gnu/java/rmi/server.deps
+
+gnu/java/security.list: $(gnu_java_security_source_files)
+ @for file in $(gnu_java_security_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security.list
+
+-include gnu/java/security.deps
+
+gnu/java/security/action.list: $(gnu_java_security_action_source_files)
+ @for file in $(gnu_java_security_action_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/action.list
+
+-include gnu/java/security/action.deps
+
+gnu/java/security/ber.list: $(gnu_java_security_ber_source_files)
+ @for file in $(gnu_java_security_ber_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/ber.list
+
+-include gnu/java/security/ber.deps
+
+gnu/java/security/der.list: $(gnu_java_security_der_source_files)
+ @for file in $(gnu_java_security_der_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/der.list
+
+-include gnu/java/security/der.deps
+
+gnu/java/security/pkcs.list: $(gnu_java_security_pkcs_source_files)
+ @for file in $(gnu_java_security_pkcs_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/pkcs.list
+
+-include gnu/java/security/pkcs.deps
+
+gnu/java/security/provider.list: $(gnu_java_security_provider_source_files)
+ @for file in $(gnu_java_security_provider_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/provider.list
+
+-include gnu/java/security/provider.deps
+
+gnu/java/security/util.list: $(gnu_java_security_util_source_files)
+ @for file in $(gnu_java_security_util_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/util.list
+
+-include gnu/java/security/util.deps
+
+gnu/java/security/x509.list: $(gnu_java_security_x509_source_files)
+ @for file in $(gnu_java_security_x509_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/x509.list
+
+-include gnu/java/security/x509.deps
+
+gnu/java/security/x509/ext.list: $(gnu_java_security_x509_ext_source_files)
+ @for file in $(gnu_java_security_x509_ext_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/x509/ext.list
+
+-include gnu/java/security/x509/ext.deps
+
+gnu/java/text.list: $(gnu_java_text_source_files)
+ @for file in $(gnu_java_text_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/text.list
+
+-include gnu/java/text.deps
+
+gnu/java/util.list: $(gnu_java_util_source_files)
+ @for file in $(gnu_java_util_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/util.list
+
+-include gnu/java/util.deps
+
+gnu/java/util/prefs.list: $(gnu_java_util_prefs_source_files)
+ @for file in $(gnu_java_util_prefs_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/util/prefs.list
+
+-include gnu/java/util/prefs.deps
+
+gnu/javax/swing/text/html/parser.list: $(gnu_javax_swing_text_html_parser_source_files)
+ @for file in $(gnu_javax_swing_text_html_parser_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/javax/swing/text/html/parser.list
+
+-include gnu/javax/swing/text/html/parser.deps
+
+gnu/javax/swing/text/html/parser/models.list: $(gnu_javax_swing_text_html_parser_models_source_files)
+ @for file in $(gnu_javax_swing_text_html_parser_models_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/javax/swing/text/html/parser/models.list
+
+-include gnu/javax/swing/text/html/parser/models.deps
+
+gnu/javax/swing/text/html/parser/support.list: $(gnu_javax_swing_text_html_parser_support_source_files)
+ @for file in $(gnu_javax_swing_text_html_parser_support_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/javax/swing/text/html/parser/support.list
+
+-include gnu/javax/swing/text/html/parser/support.deps
+
+gnu/javax/swing/text/html/parser/support/low.list: $(gnu_javax_swing_text_html_parser_support_low_source_files)
+ @for file in $(gnu_javax_swing_text_html_parser_support_low_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/javax/swing/text/html/parser/support/low.list
+
+-include gnu/javax/swing/text/html/parser/support/low.deps
+
+gnu/regexp.list: $(gnu_regexp_source_files)
+ @for file in $(gnu_regexp_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/regexp.list
+
+-include gnu/regexp.deps
+
gnu-xml.lo: $(gnu_xml_source_files)
- $(MAKE) classes.stamp
$(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o gnu-xml.lo \
- `find gnu/xml -name '*.class' -print`
+ `find classpath/lib/gnu/xml -name '*.class' | sort -r`
+
+java/applet.list: $(java_applet_source_files)
+ @for file in $(java_applet_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/applet.list
+
+-include java/applet.deps
+
+java/awt.list: $(java_awt_source_files)
+ @for file in $(java_awt_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt.list
+
+-include java/awt.deps
+
+java/awt/color.list: $(java_awt_color_source_files)
+ @for file in $(java_awt_color_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/color.list
+
+-include java/awt/color.deps
+
+java/awt/datatransfer.list: $(java_awt_datatransfer_source_files)
+ @for file in $(java_awt_datatransfer_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/datatransfer.list
+
+-include java/awt/datatransfer.deps
+
+java/awt/dnd.list: $(java_awt_dnd_source_files)
+ @for file in $(java_awt_dnd_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/dnd.list
+
+-include java/awt/dnd.deps
+
+java/awt/dnd/peer.list: $(java_awt_dnd_peer_source_files)
+ @for file in $(java_awt_dnd_peer_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/dnd/peer.list
+
+-include java/awt/dnd/peer.deps
+
+java/awt/event.list: $(java_awt_event_source_files)
+ @for file in $(java_awt_event_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/event.list
+
+-include java/awt/event.deps
+
+java/awt/font.list: $(java_awt_font_source_files)
+ @for file in $(java_awt_font_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/font.list
+
+-include java/awt/font.deps
+
+java/awt/geom.list: $(java_awt_geom_source_files)
+ @for file in $(java_awt_geom_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/geom.list
+
+-include java/awt/geom.deps
+
+java/awt/im.list: $(java_awt_im_source_files)
+ @for file in $(java_awt_im_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/im.list
+
+-include java/awt/im.deps
+
+java/awt/im/spi.list: $(java_awt_im_spi_source_files)
+ @for file in $(java_awt_im_spi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/im/spi.list
+
+-include java/awt/im/spi.deps
+
+java/awt/image.list: $(java_awt_image_source_files)
+ @for file in $(java_awt_image_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/image.list
+
+-include java/awt/image.deps
+
+java/awt/image/renderable.list: $(java_awt_image_renderable_source_files)
+ @for file in $(java_awt_image_renderable_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/image/renderable.list
+
+-include java/awt/image/renderable.deps
+
+java/awt/peer.list: $(java_awt_peer_source_files)
+ @for file in $(java_awt_peer_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/peer.list
+
+-include java/awt/peer.deps
+
+java/awt/print.list: $(java_awt_print_source_files)
+ @for file in $(java_awt_print_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/print.list
+
+-include java/awt/print.deps
+
+java/beans.list: $(java_beans_source_files)
+ @for file in $(java_beans_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/beans.list
+
+-include java/beans.deps
+
+java/beans/beancontext.list: $(java_beans_beancontext_source_files)
+ @for file in $(java_beans_beancontext_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/beans/beancontext.list
+
+-include java/beans/beancontext.deps
+
+java/io.list: $(java_io_source_files)
+ @for file in $(java_io_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/io.list
+
+-include java/io.deps
+
+java/lang.list: $(java_lang_source_files)
+ @for file in $(java_lang_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/lang.list
+
+-include java/lang.deps
+
+java/lang/annotation.list: $(java_lang_annotation_source_files)
+ @for file in $(java_lang_annotation_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/lang/annotation.list
+
+-include java/lang/annotation.deps
+
+java/lang/ref.list: $(java_lang_ref_source_files)
+ @for file in $(java_lang_ref_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/lang/ref.list
+
+-include java/lang/ref.deps
+
+java/lang/reflect.list: $(java_lang_reflect_source_files)
+ @for file in $(java_lang_reflect_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/lang/reflect.list
+
+-include java/lang/reflect.deps
+
+java/math.list: $(java_math_source_files)
+ @for file in $(java_math_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/math.list
+
+-include java/math.deps
+
+java/net.list: $(java_net_source_files)
+ @for file in $(java_net_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/net.list
+
+-include java/net.deps
+
+java/nio.list: $(java_nio_source_files)
+ @for file in $(java_nio_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/nio.list
+
+-include java/nio.deps
+
+java/nio/channels.list: $(java_nio_channels_source_files)
+ @for file in $(java_nio_channels_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/nio/channels.list
+
+-include java/nio/channels.deps
+
+java/nio/channels/spi.list: $(java_nio_channels_spi_source_files)
+ @for file in $(java_nio_channels_spi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/nio/channels/spi.list
+
+-include java/nio/channels/spi.deps
+
+java/nio/charset.list: $(java_nio_charset_source_files)
+ @for file in $(java_nio_charset_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/nio/charset.list
+
+-include java/nio/charset.deps
+
+java/nio/charset/spi.list: $(java_nio_charset_spi_source_files)
+ @for file in $(java_nio_charset_spi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/nio/charset/spi.list
+
+-include java/nio/charset/spi.deps
+
+java/rmi.list: $(java_rmi_source_files)
+ @for file in $(java_rmi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/rmi.list
+
+-include java/rmi.deps
+
+java/rmi/activation.list: $(java_rmi_activation_source_files)
+ @for file in $(java_rmi_activation_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/rmi/activation.list
+
+-include java/rmi/activation.deps
+
+java/rmi/dgc.list: $(java_rmi_dgc_source_files)
+ @for file in $(java_rmi_dgc_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/rmi/dgc.list
+
+-include java/rmi/dgc.deps
+
+java/rmi/registry.list: $(java_rmi_registry_source_files)
+ @for file in $(java_rmi_registry_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/rmi/registry.list
+
+-include java/rmi/registry.deps
+
+java/rmi/server.list: $(java_rmi_server_source_files)
+ @for file in $(java_rmi_server_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/rmi/server.list
+
+-include java/rmi/server.deps
+
+java/security.list: $(java_security_source_files)
+ @for file in $(java_security_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/security.list
+
+-include java/security.deps
+
+java/security/acl.list: $(java_security_acl_source_files)
+ @for file in $(java_security_acl_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/security/acl.list
+
+-include java/security/acl.deps
+
+java/security/cert.list: $(java_security_cert_source_files)
+ @for file in $(java_security_cert_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/security/cert.list
+
+-include java/security/cert.deps
+
+java/security/interfaces.list: $(java_security_interfaces_source_files)
+ @for file in $(java_security_interfaces_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/security/interfaces.list
+
+-include java/security/interfaces.deps
+
+java/security/spec.list: $(java_security_spec_source_files)
+ @for file in $(java_security_spec_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/security/spec.list
+
+-include java/security/spec.deps
+
+java/sql.list: $(java_sql_source_files)
+ @for file in $(java_sql_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/sql.list
+
+-include java/sql.deps
+
+java/text.list: $(java_text_source_files)
+ @for file in $(java_text_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/text.list
+
+-include java/text.deps
+
+java/util.list: $(java_util_source_files)
+ @for file in $(java_util_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util.list
+
+-include java/util.deps
+
+java/util/jar.list: $(java_util_jar_source_files)
+ @for file in $(java_util_jar_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util/jar.list
+
+-include java/util/jar.deps
+
+java/util/logging.list: $(java_util_logging_source_files)
+ @for file in $(java_util_logging_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util/logging.list
+
+-include java/util/logging.deps
+
+java/util/prefs.list: $(java_util_prefs_source_files)
+ @for file in $(java_util_prefs_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util/prefs.list
+
+-include java/util/prefs.deps
+
+java/util/regex.list: $(java_util_regex_source_files)
+ @for file in $(java_util_regex_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util/regex.list
+
+-include java/util/regex.deps
+
+java/util/zip.list: $(java_util_zip_source_files)
+ @for file in $(java_util_zip_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util/zip.list
+
+-include java/util/zip.deps
+
+javax/accessibility.list: $(javax_accessibility_source_files)
+ @for file in $(javax_accessibility_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/accessibility.list
+
+-include javax/accessibility.deps
+
+javax/crypto.list: $(javax_crypto_source_files)
+ @for file in $(javax_crypto_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/crypto.list
+
+-include javax/crypto.deps
+
+javax/crypto/interfaces.list: $(javax_crypto_interfaces_source_files)
+ @for file in $(javax_crypto_interfaces_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/crypto/interfaces.list
+
+-include javax/crypto/interfaces.deps
+
+javax/crypto/spec.list: $(javax_crypto_spec_source_files)
+ @for file in $(javax_crypto_spec_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/crypto/spec.list
+
+-include javax/crypto/spec.deps
javax-imageio.lo: $(javax_imageio_source_files)
- $(MAKE) classes.stamp
- $(LTGCJCOMPILE) -findirect-dispatch -c -o javax-imageio.lo \
- `find javax/imageio -name '*.class' -print`
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o javax-imageio.lo \
+ `find classpath/lib/javax/imageio -name '*.class' | sort -r`
+
+javax/naming.list: $(javax_naming_source_files)
+ @for file in $(javax_naming_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/naming.list
+
+-include javax/naming.deps
+
+javax/naming/directory.list: $(javax_naming_directory_source_files)
+ @for file in $(javax_naming_directory_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/naming/directory.list
+
+-include javax/naming/directory.deps
+
+javax/naming/event.list: $(javax_naming_event_source_files)
+ @for file in $(javax_naming_event_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/naming/event.list
+
+-include javax/naming/event.deps
+
+javax/naming/ldap.list: $(javax_naming_ldap_source_files)
+ @for file in $(javax_naming_ldap_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/naming/ldap.list
+
+-include javax/naming/ldap.deps
+
+javax/naming/spi.list: $(javax_naming_spi_source_files)
+ @for file in $(javax_naming_spi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/naming/spi.list
+
+-include javax/naming/spi.deps
+
+javax/net.list: $(javax_net_source_files)
+ @for file in $(javax_net_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/net.list
+
+-include javax/net.deps
+
+javax/net/ssl.list: $(javax_net_ssl_source_files)
+ @for file in $(javax_net_ssl_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/net/ssl.list
+
+-include javax/net/ssl.deps
+
+javax/print.list: $(javax_print_source_files)
+ @for file in $(javax_print_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/print.list
+
+-include javax/print.deps
+
+javax/print/attribute.list: $(javax_print_attribute_source_files)
+ @for file in $(javax_print_attribute_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/print/attribute.list
+
+-include javax/print/attribute.deps
+
+javax/print/attribute/standard.list: $(javax_print_attribute_standard_source_files)
+ @for file in $(javax_print_attribute_standard_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/print/attribute/standard.list
+
+-include javax/print/attribute/standard.deps
+
+javax/print/event.list: $(javax_print_event_source_files)
+ @for file in $(javax_print_event_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/print/event.list
+
+-include javax/print/event.deps
+
+javax/security/auth.list: $(javax_security_auth_source_files)
+ @for file in $(javax_security_auth_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/auth.list
+
+-include javax/security/auth.deps
+
+javax/security/auth/callback.list: $(javax_security_auth_callback_source_files)
+ @for file in $(javax_security_auth_callback_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/auth/callback.list
+
+-include javax/security/auth/callback.deps
+
+javax/security/auth/login.list: $(javax_security_auth_login_source_files)
+ @for file in $(javax_security_auth_login_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/auth/login.list
+
+-include javax/security/auth/login.deps
+
+javax/security/auth/spi.list: $(javax_security_auth_spi_source_files)
+ @for file in $(javax_security_auth_spi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/auth/spi.list
+
+-include javax/security/auth/spi.deps
+
+javax/security/auth/x500.list: $(javax_security_auth_x500_source_files)
+ @for file in $(javax_security_auth_x500_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/auth/x500.list
+
+-include javax/security/auth/x500.deps
+
+javax/security/cert.list: $(javax_security_cert_source_files)
+ @for file in $(javax_security_cert_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/cert.list
+
+-include javax/security/cert.deps
+
+javax/security/sasl.list: $(javax_security_sasl_source_files)
+ @for file in $(javax_security_sasl_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/sasl.list
+
+-include javax/security/sasl.deps
+
+javax/sql.list: $(javax_sql_source_files)
+ @for file in $(javax_sql_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/sql.list
+
+-include javax/sql.deps
+
+javax/swing.list: $(javax_swing_source_files)
+ @for file in $(javax_swing_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing.list
+
+-include javax/swing.deps
+
+javax/swing/border.list: $(javax_swing_border_source_files)
+ @for file in $(javax_swing_border_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/border.list
+
+-include javax/swing/border.deps
+
+javax/swing/colorchooser.list: $(javax_swing_colorchooser_source_files)
+ @for file in $(javax_swing_colorchooser_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/colorchooser.list
+
+-include javax/swing/colorchooser.deps
+
+javax/swing/event.list: $(javax_swing_event_source_files)
+ @for file in $(javax_swing_event_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/event.list
+
+-include javax/swing/event.deps
+
+javax/swing/filechooser.list: $(javax_swing_filechooser_source_files)
+ @for file in $(javax_swing_filechooser_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/filechooser.list
+
+-include javax/swing/filechooser.deps
+
+javax/swing/plaf.list: $(javax_swing_plaf_source_files)
+ @for file in $(javax_swing_plaf_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/plaf.list
+
+-include javax/swing/plaf.deps
+
+javax/swing/plaf/basic.list: $(javax_swing_plaf_basic_source_files)
+ @for file in $(javax_swing_plaf_basic_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/plaf/basic.list
+
+-include javax/swing/plaf/basic.deps
+
+javax/swing/plaf/metal.list: $(javax_swing_plaf_metal_source_files)
+ @for file in $(javax_swing_plaf_metal_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/plaf/metal.list
+
+-include javax/swing/plaf/metal.deps
+
+javax/swing/table.list: $(javax_swing_table_source_files)
+ @for file in $(javax_swing_table_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/table.list
+
+-include javax/swing/table.deps
+
+javax/swing/text.list: $(javax_swing_text_source_files)
+ @for file in $(javax_swing_text_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/text.list
+
+-include javax/swing/text.deps
+
+javax/swing/text/html.list: $(javax_swing_text_html_source_files)
+ @for file in $(javax_swing_text_html_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/text/html.list
+
+-include javax/swing/text/html.deps
+
+javax/swing/text/html/parser.list: $(javax_swing_text_html_parser_source_files)
+ @for file in $(javax_swing_text_html_parser_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/text/html/parser.list
+
+-include javax/swing/text/html/parser.deps
+
+javax/swing/text/rtf.list: $(javax_swing_text_rtf_source_files)
+ @for file in $(javax_swing_text_rtf_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/text/rtf.list
+
+-include javax/swing/text/rtf.deps
+
+javax/swing/tree.list: $(javax_swing_tree_source_files)
+ @for file in $(javax_swing_tree_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/tree.list
+
+-include javax/swing/tree.deps
+
+javax/swing/undo.list: $(javax_swing_undo_source_files)
+ @for file in $(javax_swing_undo_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/undo.list
+
+-include javax/swing/undo.deps
+
+javax/transaction.list: $(javax_transaction_source_files)
+ @for file in $(javax_transaction_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/transaction.list
+
+-include javax/transaction.deps
+
+javax/transaction/xa.list: $(javax_transaction_xa_source_files)
+ @for file in $(javax_transaction_xa_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/transaction/xa.list
+
+-include javax/transaction/xa.deps
javax-xml.lo: $(javax_xml_source_files)
- $(MAKE) classes.stamp
- $(LTGCJCOMPILE) -findirect-dispatch -c -o javax-xml.lo \
- `find javax/xml -name '*.class' -print`
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o javax-xml.lo \
+ `find classpath/lib/javax/xml -name '*.class' | sort -r`
-gnu-java-beans.lo: $(gnu_java_beans_source_files)
- $(MAKE) classes.stamp
- $(LTGCJCOMPILE) -findirect-dispatch -c -o gnu-java-beans.lo \
- `find gnu/java/beans -name '*.class' -print`
+org/ietf/jgss.list: $(org_ietf_jgss_source_files)
+ @for file in $(org_ietf_jgss_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > org/ietf/jgss.list
+
+-include org/ietf/jgss.deps
-gtk-awt-peer.lo: $(gtk_awt_peer_source_files)
- $(MAKE) classes.stamp
- $(LTGCJCOMPILE) -findirect-dispatch -fjni -c -o gtk-awt-peer.lo \
- `find gnu/java/awt/peer/gtk -name '*.class' -print`
+org-w3c.lo: $(org_w3c_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o org-w3c.lo \
+ `find classpath/lib/org/w3c -name '*.class' | sort -r`
-%.h: %.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) $(basename $<)
+org-xml.lo: $(org_xml_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o org-xml.lo \
+ `find classpath/lib/org/xml -name '*.class' | sort -r`
-$(ordinary_nat_headers) $(xlib_nat_headers): %.h: %.class
+$(generic_header_files): %.h: classpath/lib/%.class
+ name=`echo $< | sed -e 's/\.class$$//' -e 's,classpath/lib/,,'`; \
+ $(mkinstalldirs) `dirname $$name`; \
+ $(GCJH) -d . -classpath '' -bootclasspath classpath/lib $$name
-java/lang/ClassLoader.h: java/lang/ClassLoader.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/ClassLoader.h: classpath/lib/java/lang/ClassLoader.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
-prepend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
-friend 'jclass (::_Jv_FindClass) (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
-friend 'void ::_Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
- $(basename $<)
+ java/lang/ClassLoader
-java/lang/Thread.h: java/lang/Thread.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/Thread.h: classpath/lib/java/lang/Thread.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'class _Jv_JNIEnv;' \
-prepend '#define _JV_NOT_OWNER 1' \
-prepend '#define _JV_INTERRUPTED 2' \
@@ -6453,10 +7699,10 @@ java/lang/Thread.h: java/lang/Thread.class
-friend 'java::lang::Thread* ::_Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
-friend 'java::lang::Thread* ::_Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
-friend 'jint (::_Jv_DetachCurrentThread) ();' \
- $(basename $<)
+ java/lang/Thread
-java/lang/String.h: java/lang/String.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/String.h: classpath/lib/java/lang/String.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'jchar* _Jv_GetStringChars (jstring str);' \
-prepend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \
-prepend 'jstring* _Jv_StringGetSlot (jstring);' \
@@ -6469,91 +7715,91 @@ java/lang/String.h: java/lang/String.class
-friend 'jstring (::_Jv_NewStringUtf8Const) (_Jv_Utf8Const* str);' \
-friend 'jstring (::_Jv_NewStringLatin1) (const char*, jsize);' \
-friend 'jstring (::_Jv_AllocString) (jsize);' \
- $(basename $<)
+ java/lang/String
-java/lang/reflect/Constructor.h: java/lang/reflect/Constructor.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/reflect/Constructor.h: classpath/lib/java/lang/reflect/Constructor.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \
-prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
-friend 'jmethodID (::_Jv_FromReflectedConstructor) (java::lang::reflect::Constructor *);' \
-friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
-friend 'class java::lang::Class;' \
- $(basename $<)
+ java/lang/reflect/Constructor
-java/lang/reflect/Field.h: java/lang/reflect/Field.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/reflect/Field.h: classpath/lib/java/lang/reflect/Field.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \
-prepend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
-friend 'jfieldID (::_Jv_FromReflectedField) (java::lang::reflect::Field *);' \
-friend 'jobject (::_Jv_JNI_ToReflectedField) (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
-friend 'class java::lang::Class;' \
- $(basename $<)
+ java/lang/reflect/Field
-java/lang/reflect/Method.h: java/lang/reflect/Method.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/reflect/Method.h: classpath/lib/java/lang/reflect/Method.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-prepend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \
-prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
-friend 'jmethodID (::_Jv_FromReflectedMethod) (java::lang::reflect::Method *);' \
-friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
-friend 'class java::lang::Class;' \
-friend 'class java::io::ObjectInputStream;' \
- $(basename $<)
+ java/lang/reflect/Method
-java/lang/reflect/Proxy.h: java/lang/reflect/Proxy.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
- $(basename $<)
+java/lang/reflect/Proxy.h: classpath/lib/java/lang/reflect/Proxy.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
+ java/lang/reflect/Proxy
-java/lang/reflect/Proxy$$ProxyData.h: java/lang/reflect/Proxy.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/reflect/Proxy$$ProxyData.h: classpath/lib/java/lang/reflect/Proxy.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/lang/reflect/Proxy$$ProxyData'
-java/lang/reflect/Proxy$$ProxyType.h: java/lang/reflect/Proxy.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/reflect/Proxy$$ProxyType.h: classpath/lib/java/lang/reflect/Proxy.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/lang/reflect/Proxy$$ProxyType'
-gnu/gcj/runtime/ExtensionClassLoader.h: gnu/gcj/runtime/ExtensionClassLoader.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+gnu/gcj/runtime/ExtensionClassLoader.h: classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
-friend 'class ::java::lang::ClassLoader;' \
- $(basename $<)
+ gnu/gcj/runtime/ExtensionClassLoader
-java/io/ObjectInputStream$$GetField.h: java/io/ObjectInputStream.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/io/ObjectInputStream$$GetField.h: classpath/lib/java/io/ObjectInputStream.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/io/ObjectInputStream$$GetField'
-java/io/ObjectOutputStream$$PutField.h: java/io/ObjectOutputStream.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/io/ObjectOutputStream$$PutField.h: classpath/lib/java/io/ObjectOutputStream.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/io/ObjectOutputStream$$PutField'
-java/nio/DirectByteBufferImpl$$ReadWrite.h: java/nio/DirectByteBufferImpl.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/nio/DirectByteBufferImpl$$ReadWrite.h: classpath/lib/java/nio/DirectByteBufferImpl.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/nio/DirectByteBufferImpl$$ReadWrite'
-java/nio/channels/Pipe$$SinkChannel.h: java/nio/channels/Pipe.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/nio/channels/Pipe$$SinkChannel.h: classpath/lib/java/nio/channels/Pipe.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/nio/channels/Pipe$$SinkChannel'
-java/nio/channels/Pipe$$SourceChannel.h: java/nio/channels/Pipe.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/nio/channels/Pipe$$SourceChannel.h: classpath/lib/java/nio/channels/Pipe.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/nio/channels/Pipe$$SourceChannel'
-gnu/java/net/PlainSocketImpl$$SocketInputStream.h: gnu/java/net/PlainSocketImpl.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+gnu/java/net/PlainSocketImpl$$SocketInputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'gnu/java/net/PlainSocketImpl$$SocketInputStream'
-gnu/java/net/PlainSocketImpl$$SocketOutputStream.h: gnu/java/net/PlainSocketImpl.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+gnu/java/net/PlainSocketImpl$$SocketOutputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'gnu/java/net/PlainSocketImpl$$SocketOutputStream'
-gnu/java/nio/PipeImpl$$SinkChannelImpl.h: gnu/java/nio/PipeImpl.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+gnu/java/nio/PipeImpl$$SinkChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'gnu/java/nio/PipeImpl$$SinkChannelImpl'
-gnu/java/nio/PipeImpl$$SourceChannelImpl.h: gnu/java/nio/PipeImpl.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+gnu/java/nio/PipeImpl$$SourceChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'gnu/java/nio/PipeImpl$$SourceChannelImpl'
-java/lang/ConcreteProcess$$ProcessManager.h: java/lang/ConcreteProcess.class
- $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
+java/lang/ConcreteProcess$$ProcessManager.h: classpath/lib/java/lang/ConcreteProcess.class
+ $(GCJH) -classpath '' -bootclasspath classpath/lib \
'java/lang/ConcreteProcess$$ProcessManager'
$(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
@@ -6667,20 +7913,19 @@ src.zip:
done ); \
find gnu java -name '*.java' -print) | \
$(ZIP) -cfM@ $$here/src.zip
- for dir in sax w3c_dom; do \
- (cd $(srcdir)/external/$$dir; \
- find org -type f -name '*.java' -print | while read file; do \
- echo "x-C" | sed -e 's/^.//'; \
- echo $(srcdir)/external/$$dir; \
- echo $$file; \
- done) | \
- $(ZIP) -ufM0E@ src.zip; \
- done
install-src.zip: src.zip
$(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
-all-recursive: classes.stamp $(nat_headers) $(xlib_nat_headers)
+headers.stamp:
+ $(MAKE) create-headers
+ @echo > headers.stamp
+
+create-headers: $(headers_to_make)
+
+.PHONY: create-headers
+
+$(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
# Multilib support.
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
diff --git a/libjava/aclocal.m4 b/libjava/aclocal.m4
index b0713c7d5c8..30c49f64435 100644
--- a/libjava/aclocal.m4
+++ b/libjava/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.9.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,23 +11,69 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-# -*- Autoconf -*-
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-# Generated from amversion.in; do not edit by hand.
-# This program 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.
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN([PKG_CHECK_MODULES], [
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ AC_MSG_CHECKING(for $2)
+
+ if $PKG_CONFIG --exists "$2" ; then
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+
+ AC_MSG_CHECKING($1_CFLAGS)
+ $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+ AC_MSG_RESULT($$1_CFLAGS)
+
+ AC_MSG_CHECKING($1_LIBS)
+ $1_LIBS=`$PKG_CONFIG --libs "$2"`
+ AC_MSG_RESULT($$1_LIBS)
+ else
+ $1_CFLAGS=""
+ $1_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+ ifelse([$4], ,echo $$1_PKG_ERRORS,)
+ fi
+
+ AC_SUBST($1_CFLAGS)
+ AC_SUBST($1_LIBS)
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+
+ if test $succeeded = yes; then
+ ifelse([$3], , :, [$3])
+ else
+ ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+ fi
+])
+
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
@@ -40,26 +86,15 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.9.3])])
-
-# AM_AUX_DIR_EXPAND
-
-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+ [AM_AUTOMAKE_VERSION([1.9.5])])
-# This program 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.
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
@@ -106,26 +141,16 @@ AC_PREREQ([2.50])dnl
am_aux_dir=`cd $ac_aux_dir && pwd`
])
-# AM_CONDITIONAL -*- Autoconf -*-
+# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
-
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 6
+# serial 7
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
@@ -149,26 +174,15 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# serial 7 -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
+# serial 8
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
@@ -177,7 +191,6 @@ fi])])
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
@@ -317,27 +330,16 @@ AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])
])
-# Generate code to set up dependency tracking. -*- Autoconf -*-
+# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
-
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-#serial 2
+#serial 3
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
@@ -396,25 +398,14 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
-# Check for Java compiler.
+# Check for Java compiler. -*- Autoconf -*-
# For now we only handle the GNU compiler.
-# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
-
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
AC_DEFUN([AM_PROG_GCJ],[
AC_CHECK_PROGS(GCJ, gcj, gcj)
@@ -426,30 +417,19 @@ AC_SUBST(GCJFLAGS)
_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(GCJ)])
])
-# Do all the work for Automake. -*- Autoconf -*-
+# Do all the work for Automake. -*- Autoconf -*-
-# This macro actually does too much some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# serial 12
-# serial 11
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
@@ -551,54 +531,52 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
-
-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
-
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
-# Add --enable-maintainer-mode option to configure.
-# From Jim Meyering
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
+# serial 2
-# This program 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.
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
-# This program 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.
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 3
+# serial 4
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
@@ -617,26 +595,15 @@ AC_DEFUN([AM_MAINTAINER_MODE],
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-
-# This program 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.
+# Check to see how 'make' treats includes. -*- Autoconf -*-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 2
+# serial 3
# AM_MAKE_INCLUDE()
# -----------------
@@ -680,29 +647,17 @@ AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
-# serial 2
+# Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
# AM_PROG_CC_C_O
# --------------
# Like AC_PROG_CC_C_O, but changed for automake.
-
-# Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
-
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
AC_DEFUN([AM_PROG_CC_C_O],
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
@@ -720,27 +675,16 @@ if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
fi
])
-# -*- Autoconf -*-
-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
-
-# This program 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.
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 3
+# serial 4
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
@@ -766,27 +710,16 @@ else
fi
])
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
# AM_PROG_MKDIR_P
# ---------------
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-
-# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
-
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
+#
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
# created by `make install' are always world readable, even if the
# installer happens to have an overly restrictive umask (e.g. 077).
@@ -840,26 +773,15 @@ else
fi
AC_SUBST([mkdir_p])])
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-
-# This program 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.
-
-# This program 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.
+# Helper functions for option handling. -*- Autoconf -*-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 2
+# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
@@ -884,28 +806,16 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-#
-# Check to make sure that the build environment is sane.
-#
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
-
-# This program 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.
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 3
+# serial 4
# AM_SANITY_CHECK
# ---------------
@@ -948,25 +858,14 @@ Check your system clock])
fi
AC_MSG_RESULT(yes)])
-# AM_PROG_INSTALL_STRIP
-
-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
-
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+# AM_PROG_INSTALL_STRIP
+# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
@@ -989,25 +888,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004 Free Software Foundation, Inc.
-
-# This program 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.
-
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 1
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
@@ -1096,13 +983,10 @@ AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([../config/acx.m4])
-m4_include([../config/depstand.m4])
m4_include([../config/gxx-include-dir.m4])
m4_include([../config/iconv.m4])
m4_include([../config/lcmessage.m4])
-m4_include([../config/lead-dot.m4])
m4_include([../config/lib-ld.m4])
m4_include([../config/lib-link.m4])
m4_include([../config/lib-prefix.m4])
-m4_include([pkg.m4])
m4_include([acinclude.m4])
diff --git a/libjava/configure b/libjava/configure
index 2c915261bc2..1f53425e65d 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -272,7 +272,7 @@ PACKAGE_STRING='libjava version-unused'
PACKAGE_BUGREPORT=''
ac_unique_file="java/lang/System.java"
-ac_subdirs_all="$ac_subdirs_all libltdl"
+ac_subdirs_all="$ac_subdirs_all classpath libltdl"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
@@ -310,7 +310,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_subdir host_subdir target_subdir libgcj_basedir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S mkinstalldirs CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LDFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBGCJ_CFLAGS LIBGCJ_CXXFLAGS LIBGCJ_JAVAFLAGS LIBGCJ_LD_SYMBOLIC INCLTDL LIBLTDL DIRLTDL LIBTOOL CXXCPP CPPFLAGS GCJ GCJFLAGS GCJDEPMODE am__fastdepGCJ_TRUE am__fastdepGCJ_FALSE subdirs TESTSUBDIR_TRUE TESTSUBDIR_FALSE JAVA_HOME_SET_TRUE JAVA_HOME_SET_FALSE JAVA_HOME LIBGCJDEBUG INTERPRETER LIBFFI LIBFFIINCS PLATFORM_INNER_NAT_HDRS CPP EGREP USING_WIN32_PLATFORM_TRUE USING_WIN32_PLATFORM_FALSE USING_POSIX_PLATFORM_TRUE USING_POSIX_PLATFORM_FALSE USING_DARWIN_CRT_TRUE USING_DARWIN_CRT_FALSE SYSTEMSPEC LIBGCJTESTSPEC ZLIBSPEC ZLIBTESTSPEC X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS TOOLKIT XLIB_AWT_TRUE XLIB_AWT_FALSE GTK_AWT_TRUE GTK_AWT_FALSE GTK_CAIRO_TRUE GTK_CAIRO_FALSE PKG_CONFIG CAIRO_CFLAGS CAIRO_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS GCLIBS GCINCS GCDEPS GCSPEC JC1GCSPEC GCTESTSPEC USING_BOEHMGC_TRUE USING_BOEHMGC_FALSE USING_NOGC_TRUE USING_NOGC_FALSE THREADLIBS THREADINCS THREADDEPS THREADSPEC THREADLDFLAGS THREADCXXFLAGS USING_POSIX_THREADS_TRUE USING_POSIX_THREADS_FALSE USING_WIN32_THREADS_TRUE USING_WIN32_THREADS_FALSE USING_NO_THREADS_TRUE USING_NO_THREADS_FALSE HASH_SYNC_SPEC USING_GCC_TRUE USING_GCC_FALSE LIBICONV LTLIBICONV GTK_CFLAGS GTK_LIBS GLIB_CFLAGS GLIB_LIBS LIBART_CFLAGS LIBART_LIBS SUPPLY_BACKTRACE_TRUE SUPPLY_BACKTRACE_FALSE GCJH ZIP CLASSPATH_SEPARATOR ac_ct_GCJ ZLIBS SYS_ZLIBS ZINCS DIVIDESPEC CHECKREFSPEC EXCEPTIONSPEC BACKTRACESPEC IEEESPEC NATIVE_TRUE NATIVE_FALSE NEEDS_DATA_START_TRUE NEEDS_DATA_START_FALSE GCC_UNWIND_INCLUDE toolexecdir toolexecmainlibdir toolexeclibdir GCJVERSION gxx_include_dir libstdcxx_incdir ALLOCA PERL SYSDEP_SOURCES here LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_subdir host_subdir target_subdir libgcj_basedir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S mkinstalldirs CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LDFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBGCJ_CFLAGS LIBGCJ_CXXFLAGS LIBGCJ_JAVAFLAGS LIBGCJ_LD_SYMBOLIC LIBGCJDEBUG TOOLKIT XLIB_AWT_TRUE XLIB_AWT_FALSE GTK_AWT_TRUE GTK_AWT_FALSE GCJH ZIP INCLTDL LIBLTDL DIRLTDL LIBTOOL CXXCPP CPPFLAGS GCJ GCJFLAGS GCJDEPMODE am__fastdepGCJ_TRUE am__fastdepGCJ_FALSE subdirs TESTSUBDIR_TRUE TESTSUBDIR_FALSE JAVA_HOME_SET_TRUE JAVA_HOME_SET_FALSE JAVA_HOME INTERPRETER LIBFFI LIBFFIINCS PLATFORM_INNER_NAT_HDRS CPP EGREP USING_WIN32_PLATFORM_TRUE USING_WIN32_PLATFORM_FALSE USING_POSIX_PLATFORM_TRUE USING_POSIX_PLATFORM_FALSE USING_DARWIN_CRT_TRUE USING_DARWIN_CRT_FALSE SYSTEMSPEC LIBGCJTESTSPEC ZLIBSPEC ZLIBTESTSPEC X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS GTK_CAIRO_TRUE GTK_CAIRO_FALSE PKG_CONFIG CAIRO_CFLAGS CAIRO_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS GCLIBS GCINCS GCDEPS GCSPEC JC1GCSPEC GCTESTSPEC USING_BOEHMGC_TRUE USING_BOEHMGC_FALSE USING_NOGC_TRUE USING_NOGC_FALSE THREADLIBS THREADINCS THREADDEPS THREADSPEC THREADLDFLAGS THREADCXXFLAGS USING_POSIX_THREADS_TRUE USING_POSIX_THREADS_FALSE USING_WIN32_THREADS_TRUE USING_WIN32_THREADS_FALSE USING_NO_THREADS_TRUE USING_NO_THREADS_FALSE HASH_SYNC_SPEC USING_GCC_TRUE USING_GCC_FALSE LIBICONV LTLIBICONV GTK_CFLAGS GTK_LIBS GLIB_CFLAGS GLIB_LIBS LIBART_CFLAGS LIBART_LIBS SUPPLY_BACKTRACE_TRUE SUPPLY_BACKTRACE_FALSE CLASSPATH_SEPARATOR ac_ct_GCJ ZLIBS SYS_ZLIBS ZINCS DIVIDESPEC CHECKREFSPEC EXCEPTIONSPEC BACKTRACESPEC IEEESPEC NATIVE_TRUE NATIVE_FALSE NEEDS_DATA_START_TRUE NEEDS_DATA_START_FALSE GCC_UNWIND_INCLUDE toolexecdir toolexecmainlibdir toolexeclibdir GCJVERSION gxx_include_dir libstdcxx_incdir ALLOCA PERL SYSDEP_SOURCES here LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -857,6 +857,8 @@ Optional Features:
--enable-dependency-tracking do not reject slow dependency extractors
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
+ --enable-libgcj-debug enable runtime debugging code
+ --enable-java-awt list of AWT peer implementations to be built
--enable-shared=PKGS build shared libraries default=yes
--enable-static=PKGS build static libraries default=yes
--enable-fast-install=PKGS optimize for fast installation default=yes
@@ -865,14 +867,12 @@ Optional Features:
don't set system properties from GCJ_PROPERTIES
--enable-hash-synchronization
use global hash table for monitor locks
- --enable-libgcj-debug enable runtime debugging code
--enable-gc-debug include full support for pointer backtracing etc.
--enable-interpreter enable interpreter
--enable-sjlj-exceptions
force use of builtin_setjmp for exceptions
--disable-java-net disable java.net
--disable-jvmpi disable JVMPI support
- --enable-java-awt list of AWT peer implementations to be built
--enable-gtk-cairo build the cairo Graphics2D implementation on GTK
--enable-java-gc=TYPE choose garbage collector (default is boehm)
--disable-rpath do not hardcode runtime library paths
@@ -4014,6 +4014,191 @@ LIBGCJ_LD_SYMBOLIC="${libgcj_ld_symbolic}"
ac_config_headers="$ac_config_headers include/config.h gcj/libgcj-config.h"
+
+# See if the user has requested runtime debugging.
+LIBGCJDEBUG="disable"
+
+# Check whether --enable-libgcj-debug or --disable-libgcj-debug was given.
+if test "${enable_libgcj_debug+set}" = set; then
+ enableval="$enable_libgcj_debug"
+ if test "$enable_libgcj_debug" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DEBUG 1
+_ACEOF
+
+ LIBGCJDEBUG="enable"
+ fi
+fi;
+
+# Determine which AWT peer libraries to build
+# Check whether --enable-java-awt or --disable-java-awt was given.
+if test "${enable_java_awt+set}" = set; then
+ enableval="$enable_java_awt"
+
+fi;
+
+peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
+use_xlib_awt=""
+use_gtk_awt=""
+# The default toolkit to use is the first one specified.
+TOOLKIT=
+
+
+for peer in $peerlibs ; do
+ case $peer in
+ xlib)
+ if test "$no_x" = yes; then
+ echo "*** xlib peers requested but no X library available" 1>&2
+ exit 1
+ else
+ # This code has bit-rotted a bit.
+ echo "*** xlib peers can't currently be compiled -- disabling" 1>&2
+# use_xlib_awt="yes"
+# if test -z "$TOOLKIT"; then
+# TOOLKIT=gnu.awt.xlib.XToolkit
+# fi
+ fi
+ ;;
+ gtk)
+ if test "$no_x" = yes; then
+ echo "*** xlib peers requested but no X library available" 1>&2
+ exit 1
+ else
+ use_gtk_awt=yes
+ if test -z "$TOOLKIT"; then
+ TOOLKIT=gnu.java.awt.peer.gtk.GtkToolkit
+ fi
+ fi
+ ;;
+ no)
+ use_xlib_awt=
+ use_gtk_awt=
+ break
+ ;;
+ *)
+ echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2
+ exit 1
+ esac
+done
+
+
+
+if test "$use_xlib_awt" = yes; then
+ XLIB_AWT_TRUE=
+ XLIB_AWT_FALSE='#'
+else
+ XLIB_AWT_TRUE='#'
+ XLIB_AWT_FALSE=
+fi
+
+
+
+if test "$use_gtk_awt" = yes; then
+ GTK_AWT_TRUE=
+ GTK_AWT_FALSE='#'
+else
+ GTK_AWT_TRUE='#'
+ GTK_AWT_FALSE=
+fi
+
+
+
+if test -z "${with_multisubdir}"; then
+ builddotdot=.
+else
+ builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
+fi
+
+NATIVE=yes
+
+# Which gcj do we use?
+which_gcj=default
+built_gcc_dir="`cd ${builddotdot}/../../${host_subdir}/gcc && ${PWDCMD-pwd}`"
+if test -n "${with_cross_host}"; then
+ # We are being configured with a cross compiler. We can't
+ # use ac_exeext, because that is for the target platform.
+ NATIVE=no
+ cross_host_exeext=
+ case "${with_cross_host}" in
+ *mingw* | *cygwin*)
+ cross_host_exeext=.exe
+ ;;
+ esac
+ if test -x "${built_gcc_dir}/gcj${cross_host_exeext}"; then
+ if test x"$build_noncanonical" = x"$with_cross_host"; then
+ # Ordinary cross (host!=target and host=build)
+ which_gcj=built
+ else
+ # Canadian cross (host!=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=cross
+ fi
+else
+ # We are being configured with a native or crossed-native compiler
+ if test -x "${built_gcc_dir}/gcj${ac_exeext}"; then
+ if test x"$build" = x"$host"; then
+ # True native build (host=target and host=build)
+ which_gcj=built
+ else
+ # Crossed-native build (host=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=path
+ fi
+fi
+case "${which_gcj}" in
+ built)
+ GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
+ GCJH='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/gcc/gcjh'
+ ZIP='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/fastjar/fastjar'
+ ;;
+ cross)
+ if test "x${with_newlib}" = "xyes"; then
+ # FIXME (comment): Why is this needed?
+ GCC_UNWIND_INCLUDE=
+ GCJ="${target_noncanonical}-gcj"
+ else
+ GCJ="${target_noncanonical}-gcj -B`${PWDCMD-pwd}`/"
+ fi
+ ZIP='$(target_noncanonical)-fastjar'
+ GCJH='$(target_noncanonical)-gcjh'
+ ;;
+ path)
+ GCJ="gcj -B`${PWDCMD-pwd}`/"
+ ## In this case, gcj is found outside the build tree. However, zip is
+ ## found in the build tree.
+ ZIP='$(top_builddir)/$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar'
+ GCJH=gcjh
+ ;;
+esac
+
+
+
+
+# Create it, so that compile/link tests don't fail
+test -f libgcj.spec || touch libgcj.spec
+
+
+
+# Set up to configure Classpath.
+# FIXME: no supported way to pass args in autoconf.
+ac_configure_args="$ac_configure_args --disable-load-library"
+ac_configure_args="$ac_configure_args --${LIBGCJDEBUG}-debug"
+ac_configure_args="$ac_configure_args --enable-default-toolkit=$TOOLKIT"
+dir1=`cd $srcdir && pwd`
+dir2=`pwd`
+ac_configure_args="$ac_configure_args --with-vm-classes=$dir1:$dir2"
+ac_configure_args="$ac_configure_args --disable-core-jni"
+ac_configure_args="$ac_configure_args --disable-examples"
+ac_configure_args="$ac_configure_args --with-glibj=build"
+if test "$use_gtk_awt" != yes; then
+ ac_configure_args="$ac_configure_args --disable-gtk-peer"
+fi
+
# Only use libltdl for non-newlib builds.
if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
case $enable_ltdl_convenience in
@@ -4432,67 +4617,6 @@ deplibs_check_method=$lt_cv_deplibs_check_method
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-# find the maximum length of command line arguments
-echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- cygwin* | mingw*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
- esac
-
-fi
-
-if test -n "$lt_cv_sys_max_cmd_len" ; then
- echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
-else
- echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6
-fi
-
-
# Only perform the check for file, if the check method requires it
case $deplibs_check_method in
file_magic*)
@@ -4826,7 +4950,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4829 "configure"' > conftest.$ac_ext
+ echo '#line 4953 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -5661,7 +5785,8 @@ fi
-subdirs="$subdirs libltdl"
+
+subdirs="$subdirs classpath libltdl"
# The -no-testsuite modules omit the test subdir.
@@ -5779,23 +5904,6 @@ _ACEOF
fi
-
-# See if the user has requested runtime debugging.
-LIBGCJDEBUG="false"
-
-# Check whether --enable-libgcj-debug or --disable-libgcj-debug was given.
-if test "${enable_libgcj_debug+set}" = set; then
- enableval="$enable_libgcj_debug"
- if test "$enable_libgcj_debug" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define DEBUG 1
-_ACEOF
-
- LIBGCJDEBUG="true"
- fi
-fi;
-
# Check for gc debugging. This option is handled both here and in the GC.
# Check whether --enable-gc-debug or --disable-gc-debug was given.
if test "${enable_gc_debug+set}" = set; then
@@ -5845,7 +5953,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then
:
else
cat > conftest.$ac_ext << EOF
-#line 5848 "configure"
+#line 5956 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -7976,77 +8084,6 @@ fi
fi
-# Determine which AWT peer libraries to build
-# Check whether --enable-java-awt or --disable-java-awt was given.
-if test "${enable_java_awt+set}" = set; then
- enableval="$enable_java_awt"
-
-fi;
-
-peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
-use_xlib_awt=""
-use_gtk_awt=""
-# The default toolkit to use is the first one specified.
-TOOLKIT=
-
-
-for peer in $peerlibs ; do
- case $peer in
- xlib)
- if test "$no_x" = yes; then
- echo "*** xlib peers requested but no X library available" 1>&2
- exit 1
- else
- use_xlib_awt="yes"
- if test -z "$TOOLKIT"; then
- TOOLKIT=gnu.awt.xlib.XToolkit
- fi
- fi
- ;;
- gtk)
- if test "$no_x" = yes; then
- echo "*** xlib peers requested but no X library available" 1>&2
- exit 1
- else
- use_gtk_awt=yes
- if test -z "$TOOLKIT"; then
- TOOLKIT=gnu.java.awt.peer.gtk.GtkToolkit
- fi
- test -d jniinclude || mkdir jniinclude
- fi
- ;;
- no)
- use_xlib_awt=
- use_gtk_awt=
- break
- ;;
- *)
- echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2
- exit 1
- esac
-done
-
-
-
-if test "$use_xlib_awt" = yes; then
- XLIB_AWT_TRUE=
- XLIB_AWT_FALSE='#'
-else
- XLIB_AWT_TRUE='#'
- XLIB_AWT_FALSE=
-fi
-
-
-
-if test "$use_gtk_awt" = yes; then
- GTK_AWT_TRUE=
- GTK_AWT_FALSE='#'
-else
- GTK_AWT_TRUE='#'
- GTK_AWT_FALSE=
-fi
-
-
# determine whether to enable the cairo GTK Graphics2D backend
# Check whether --enable-gtk-cairo or --disable-gtk-cairo was given.
if test "${enable_gtk_cairo+set}" = set; then
@@ -13311,84 +13348,6 @@ else
fi
-if test -z "${with_multisubdir}"; then
- builddotdot=.
-else
- builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
-fi
-
-NATIVE=yes
-
-# Which gcj do we use?
-which_gcj=default
-built_gcc_dir="`cd ${builddotdot}/../../${host_subdir}/gcc && ${PWDCMD-pwd}`"
-if test -n "${with_cross_host}"; then
- # We are being configured with a cross compiler. We can't
- # use ac_exeext, because that is for the target platform.
- NATIVE=no
- cross_host_exeext=
- case "${with_cross_host}" in
- *mingw* | *cygwin*)
- cross_host_exeext=.exe
- ;;
- esac
- if test -x "${built_gcc_dir}/gcj${cross_host_exeext}"; then
- if test x"$build_noncanonical" = x"$with_cross_host"; then
- # Ordinary cross (host!=target and host=build)
- which_gcj=built
- else
- # Canadian cross (host!=target and host!=build)
- which_gcj=cross
- fi
- else
- which_gcj=cross
- fi
-else
- # We are being configured with a native or crossed-native compiler
- if test -x "${built_gcc_dir}/gcj${ac_exeext}"; then
- if test x"$build" = x"$host"; then
- # True native build (host=target and host=build)
- which_gcj=built
- else
- # Crossed-native build (host=target and host!=build)
- which_gcj=cross
- fi
- else
- which_gcj=path
- fi
-fi
-case "${which_gcj}" in
- built)
- GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
- GCJH='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/gcc/gcjh'
- ZIP='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/fastjar/fastjar'
- ;;
- cross)
- if test "x${with_newlib}" = "xyes"; then
- # FIXME (comment): Why is this needed?
- GCC_UNWIND_INCLUDE=
- GCJ="${target_noncanonical}-gcj"
- else
- GCJ="${target_noncanonical}-gcj -B`${PWDCMD-pwd}`/"
- fi
- ZIP='$(target_noncanonical)-fastjar'
- GCJH='$(target_noncanonical)-gcjh'
- ;;
- path)
- GCJ="gcj -B`${PWDCMD-pwd}`/"
- ## In this case, gcj is found outside the build tree. However, zip is
- ## found in the build tree.
- ZIP='$(top_builddir)/$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar'
- GCJH=gcjh
- ;;
-esac
-
-
-
-
-# Create it, so that compile/link tests don't fail
-test -f libgcj.spec || touch libgcj.spec
-
# Use a semicolon as CLASSPATH separator for MinGW, otherwise a colon.
case $build in
*-mingw32) CLASSPATH_SEPARATOR=';' ;;
@@ -13406,8 +13365,8 @@ CPPFLAGS="$CPPFLAGS -I`${PWDCMD-pwd}` -I`cd $srcdir && ${PWDCMD-pwd}`"
if test ! -f gnu/classpath/Configuration.java; then
test -d gnu || mkdir gnu
test -d gnu/classpath || mkdir gnu/classpath
- sed -e 's,@LIBGCJDEBUG@,$LIBGCJDEBUG,' \
- -e 's,@TOOLKIT@,$TOOLKIT,' \
+ sed -e "s,@LIBGCJDEBUG@,$LIBGCJDEBUG," \
+ -e "s,@TOOLKIT@,$TOOLKIT," \
< $srcdir/gnu/classpath/Configuration.java.in \
> gnu/classpath/Configuration.java
# We do not want to redirect the output of the grep below to /dev/null,
@@ -13505,6 +13464,9 @@ fi
+# Now remove it.
+rm -f gnu/classpath/Configuration.java
+
CPPFLAGS=$GCJ_SAVE_CPPFLAGS
echo "$as_me:$LINENO: checking for void *" >&5
@@ -15574,7 +15536,7 @@ if test x$gcc_no_link = xyes; then
ac_cv_func_mmap_fixed_mapped=no
fi
fi
-if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then
+if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
for ac_header in stdlib.h unistd.h
@@ -16134,7 +16096,7 @@ here=`${PWDCMD-pwd}`
# We get this from the environment.
- ac_config_files="$ac_config_files Makefile libgcj.pc libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile external/Makefile external/sax/Makefile external/w3c_dom/Makefile"
+ ac_config_files="$ac_config_files Makefile libgcj.pc libgcj.spec libgcj-test.spec gcj/Makefile include/Makefile testsuite/Makefile"
ac_config_commands="$ac_config_commands default"
@@ -16259,6 +16221,20 @@ echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${XLIB_AWT_TRUE}" && test -z "${XLIB_AWT_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"XLIB_AWT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"XLIB_AWT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GTK_AWT_TRUE}" && test -z "${GTK_AWT_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GTK_AWT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GTK_AWT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
if test -z "${am__fastdepGCJ_TRUE}" && test -z "${am__fastdepGCJ_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"am__fastdepGCJ\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -16301,20 +16277,6 @@ echo "$as_me: error: conditional \"USING_DARWIN_CRT\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
-if test -z "${XLIB_AWT_TRUE}" && test -z "${XLIB_AWT_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"XLIB_AWT\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"XLIB_AWT\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${GTK_AWT_TRUE}" && test -z "${GTK_AWT_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"GTK_AWT\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"GTK_AWT\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
if test -z "${GTK_CAIRO_TRUE}" && test -z "${GTK_CAIRO_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"GTK_CAIRO\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -16847,13 +16809,9 @@ do
"libgcj.pc" ) CONFIG_FILES="$CONFIG_FILES libgcj.pc" ;;
"libgcj.spec" ) CONFIG_FILES="$CONFIG_FILES libgcj.spec" ;;
"libgcj-test.spec" ) CONFIG_FILES="$CONFIG_FILES libgcj-test.spec" ;;
- "gnu/classpath/Configuration.java" ) CONFIG_FILES="$CONFIG_FILES gnu/classpath/Configuration.java" ;;
"gcj/Makefile" ) CONFIG_FILES="$CONFIG_FILES gcj/Makefile" ;;
"include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
"testsuite/Makefile" ) CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
- "external/Makefile" ) CONFIG_FILES="$CONFIG_FILES external/Makefile" ;;
- "external/sax/Makefile" ) CONFIG_FILES="$CONFIG_FILES external/sax/Makefile" ;;
- "external/w3c_dom/Makefile" ) CONFIG_FILES="$CONFIG_FILES external/w3c_dom/Makefile" ;;
"include/platform.h" ) CONFIG_LINKS="$CONFIG_LINKS include/platform.h:include/$PLATFORMH" ;;
"java/io/natFile.cc" ) CONFIG_LINKS="$CONFIG_LINKS java/io/natFile.cc:java/io/natFile${FILE-${PLATFORM}}.cc" ;;
"java/lang/ConcreteProcess.java" ) CONFIG_LINKS="$CONFIG_LINKS java/lang/ConcreteProcess.java:java/lang/${PLATFORM}Process.java" ;;
@@ -17037,6 +16995,14 @@ s,@LIBGCJ_CFLAGS@,$LIBGCJ_CFLAGS,;t t
s,@LIBGCJ_CXXFLAGS@,$LIBGCJ_CXXFLAGS,;t t
s,@LIBGCJ_JAVAFLAGS@,$LIBGCJ_JAVAFLAGS,;t t
s,@LIBGCJ_LD_SYMBOLIC@,$LIBGCJ_LD_SYMBOLIC,;t t
+s,@LIBGCJDEBUG@,$LIBGCJDEBUG,;t t
+s,@TOOLKIT@,$TOOLKIT,;t t
+s,@XLIB_AWT_TRUE@,$XLIB_AWT_TRUE,;t t
+s,@XLIB_AWT_FALSE@,$XLIB_AWT_FALSE,;t t
+s,@GTK_AWT_TRUE@,$GTK_AWT_TRUE,;t t
+s,@GTK_AWT_FALSE@,$GTK_AWT_FALSE,;t t
+s,@GCJH@,$GCJH,;t t
+s,@ZIP@,$ZIP,;t t
s,@INCLTDL@,$INCLTDL,;t t
s,@LIBLTDL@,$LIBLTDL,;t t
s,@DIRLTDL@,$DIRLTDL,;t t
@@ -17054,7 +17020,6 @@ s,@TESTSUBDIR_FALSE@,$TESTSUBDIR_FALSE,;t t
s,@JAVA_HOME_SET_TRUE@,$JAVA_HOME_SET_TRUE,;t t
s,@JAVA_HOME_SET_FALSE@,$JAVA_HOME_SET_FALSE,;t t
s,@JAVA_HOME@,$JAVA_HOME,;t t
-s,@LIBGCJDEBUG@,$LIBGCJDEBUG,;t t
s,@INTERPRETER@,$INTERPRETER,;t t
s,@LIBFFI@,$LIBFFI,;t t
s,@LIBFFIINCS@,$LIBFFIINCS,;t t
@@ -17075,11 +17040,6 @@ s,@X_CFLAGS@,$X_CFLAGS,;t t
s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
s,@X_LIBS@,$X_LIBS,;t t
s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
-s,@TOOLKIT@,$TOOLKIT,;t t
-s,@XLIB_AWT_TRUE@,$XLIB_AWT_TRUE,;t t
-s,@XLIB_AWT_FALSE@,$XLIB_AWT_FALSE,;t t
-s,@GTK_AWT_TRUE@,$GTK_AWT_TRUE,;t t
-s,@GTK_AWT_FALSE@,$GTK_AWT_FALSE,;t t
s,@GTK_CAIRO_TRUE@,$GTK_CAIRO_TRUE,;t t
s,@GTK_CAIRO_FALSE@,$GTK_CAIRO_FALSE,;t t
s,@PKG_CONFIG@,$PKG_CONFIG,;t t
@@ -17122,8 +17082,6 @@ s,@LIBART_CFLAGS@,$LIBART_CFLAGS,;t t
s,@LIBART_LIBS@,$LIBART_LIBS,;t t
s,@SUPPLY_BACKTRACE_TRUE@,$SUPPLY_BACKTRACE_TRUE,;t t
s,@SUPPLY_BACKTRACE_FALSE@,$SUPPLY_BACKTRACE_FALSE,;t t
-s,@GCJH@,$GCJH,;t t
-s,@ZIP@,$ZIP,;t t
s,@CLASSPATH_SEPARATOR@,$CLASSPATH_SEPARATOR,;t t
s,@ac_ct_GCJ@,$ac_ct_GCJ,;t t
s,@ZLIBS@,$ZLIBS,;t t
diff --git a/libjava/configure.ac b/libjava/configure.ac
index a59a4616e59..ff45f6eebf0 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -144,6 +144,172 @@ AC_SUBST(LIBGCJ_LD_SYMBOLIC)
AC_CONFIG_HEADERS([include/config.h gcj/libgcj-config.h])
+
+# See if the user has requested runtime debugging.
+LIBGCJDEBUG="disable"
+AC_SUBST(LIBGCJDEBUG)
+AC_ARG_ENABLE(libgcj-debug,
+ AS_HELP_STRING([--enable-libgcj-debug],
+ [enable runtime debugging code]),
+ [if test "$enable_libgcj_debug" = yes; then
+ AC_DEFINE(DEBUG, 1, [Define this if you want runtime debugging enabled.])
+ LIBGCJDEBUG="enable"
+ fi])
+
+# Determine which AWT peer libraries to build
+AC_ARG_ENABLE(java-awt,
+ AS_HELP_STRING([--enable-java-awt],
+ [list of AWT peer implementations to be built]))
+
+peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
+use_xlib_awt=""
+use_gtk_awt=""
+# The default toolkit to use is the first one specified.
+TOOLKIT=
+AC_SUBST(TOOLKIT)
+
+for peer in $peerlibs ; do
+ case $peer in
+ xlib)
+ if test "$no_x" = yes; then
+ echo "*** xlib peers requested but no X library available" 1>&2
+ exit 1
+ else
+ # This code has bit-rotted a bit.
+ echo "*** xlib peers can't currently be compiled -- disabling" 1>&2
+# use_xlib_awt="yes"
+# if test -z "$TOOLKIT"; then
+# TOOLKIT=gnu.awt.xlib.XToolkit
+# fi
+ fi
+ ;;
+ gtk)
+ if test "$no_x" = yes; then
+ echo "*** xlib peers requested but no X library available" 1>&2
+ exit 1
+ else
+ use_gtk_awt=yes
+ if test -z "$TOOLKIT"; then
+ TOOLKIT=gnu.java.awt.peer.gtk.GtkToolkit
+ fi
+ fi
+ ;;
+ no)
+ use_xlib_awt=
+ use_gtk_awt=
+ break
+ ;;
+ *)
+ echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2
+ exit 1
+ esac
+done
+
+AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes)
+AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes)
+
+
+if test -z "${with_multisubdir}"; then
+ builddotdot=.
+else
+ builddotdot=`echo ${with_multisubdir} | sed -e 's:[[^/]][[^/]]*:..:g'`
+fi
+
+NATIVE=yes
+
+# Which gcj do we use?
+which_gcj=default
+built_gcc_dir="`cd ${builddotdot}/../../${host_subdir}/gcc && ${PWDCMD-pwd}`"
+if test -n "${with_cross_host}"; then
+ # We are being configured with a cross compiler. We can't
+ # use ac_exeext, because that is for the target platform.
+ NATIVE=no
+ cross_host_exeext=
+ case "${with_cross_host}" in
+ *mingw* | *cygwin*)
+ cross_host_exeext=.exe
+ ;;
+ esac
+ if test -x "${built_gcc_dir}/gcj${cross_host_exeext}"; then
+ if test x"$build_noncanonical" = x"$with_cross_host"; then
+ # Ordinary cross (host!=target and host=build)
+ which_gcj=built
+ else
+ # Canadian cross (host!=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=cross
+ fi
+else
+ # We are being configured with a native or crossed-native compiler
+ if test -x "${built_gcc_dir}/gcj${ac_exeext}"; then
+ if test x"$build" = x"$host"; then
+ # True native build (host=target and host=build)
+ which_gcj=built
+ else
+ # Crossed-native build (host=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=path
+ fi
+fi
+case "${which_gcj}" in
+ built)
+ GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
+ GCJH='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/gcc/gcjh'
+ ZIP='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/fastjar/fastjar'
+ ;;
+ cross)
+ if test "x${with_newlib}" = "xyes"; then
+ # FIXME (comment): Why is this needed?
+ GCC_UNWIND_INCLUDE=
+ GCJ="${target_noncanonical}-gcj"
+ else
+ GCJ="${target_noncanonical}-gcj -B`${PWDCMD-pwd}`/"
+ fi
+ ZIP='$(target_noncanonical)-fastjar'
+ GCJH='$(target_noncanonical)-gcjh'
+ ;;
+ path)
+ GCJ="gcj -B`${PWDCMD-pwd}`/"
+ ## In this case, gcj is found outside the build tree. However, zip is
+ ## found in the build tree.
+ ZIP='$(top_builddir)/$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar'
+ GCJH=gcjh
+ ;;
+esac
+
+AC_SUBST(GCJH)
+AC_SUBST(ZIP)
+
+# Create it, so that compile/link tests don't fail
+test -f libgcj.spec || touch libgcj.spec
+
+
+
+# Set up to configure Classpath.
+# FIXME: no supported way to pass args in autoconf.
+ac_configure_args="$ac_configure_args --disable-load-library"
+ac_configure_args="$ac_configure_args --${LIBGCJDEBUG}-debug"
+ac_configure_args="$ac_configure_args --enable-default-toolkit=$TOOLKIT"
+dir1=`cd $srcdir && pwd`
+dir2=`pwd`
+ac_configure_args="$ac_configure_args --with-vm-classes=$dir1:$dir2"
+ac_configure_args="$ac_configure_args --disable-core-jni"
+dnl FIXME?
+ac_configure_args="$ac_configure_args --disable-examples"
+ac_configure_args="$ac_configure_args --with-glibj=build"
+if test "$use_gtk_awt" != yes; then
+ ac_configure_args="$ac_configure_args --disable-gtk-peer"
+fi
+dnl --with-gcj=$GCJ
+dnl --with-javah=$GCJH
+dnl gjdoc?
+dnl gtk-cairo -- just export here...
+dnl --enable-regen-headers?
+
# Only use libltdl for non-newlib builds.
if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
AC_LIBLTDL_CONVENIENCE
@@ -162,7 +328,8 @@ AC_SUBST(DIRLTDL)
AC_PROG_LIBTOOL
AM_PROG_GCJ
AM_PROG_CC_C_O
-AC_CONFIG_SUBDIRS(libltdl)
+
+AC_CONFIG_SUBDIRS(classpath libltdl)
# The -no-testsuite modules omit the test subdir.
AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
@@ -234,18 +401,6 @@ if test "${slow_pthread_self}" = "yes"; then
[Define if if the synchronization code should try to avoid pthread_self calls by caching thread IDs in a hashtable.])
fi
-
-# See if the user has requested runtime debugging.
-LIBGCJDEBUG="false"
-AC_SUBST(LIBGCJDEBUG)
-AC_ARG_ENABLE(libgcj-debug,
- AS_HELP_STRING([--enable-libgcj-debug],
- [enable runtime debugging code]),
- [if test "$enable_libgcj_debug" = yes; then
- AC_DEFINE(DEBUG, 1, [Define this if you want runtime debugging enabled.])
- LIBGCJDEBUG="true"
- fi])
-
# Check for gc debugging. This option is handled both here and in the GC.
AC_ARG_ENABLE(gc-debug,
AS_HELP_STRING([--enable-gc-debug],
@@ -488,57 +643,6 @@ AC_SUBST(ZLIBTESTSPEC)
AC_PATH_XTRA
-# Determine which AWT peer libraries to build
-AC_ARG_ENABLE(java-awt,
- AS_HELP_STRING([--enable-java-awt],
- [list of AWT peer implementations to be built]))
-
-peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
-use_xlib_awt=""
-use_gtk_awt=""
-# The default toolkit to use is the first one specified.
-TOOLKIT=
-AC_SUBST(TOOLKIT)
-
-for peer in $peerlibs ; do
- case $peer in
- xlib)
- if test "$no_x" = yes; then
- echo "*** xlib peers requested but no X library available" 1>&2
- exit 1
- else
- use_xlib_awt="yes"
- if test -z "$TOOLKIT"; then
- TOOLKIT=gnu.awt.xlib.XToolkit
- fi
- fi
- ;;
- gtk)
- if test "$no_x" = yes; then
- echo "*** xlib peers requested but no X library available" 1>&2
- exit 1
- else
- use_gtk_awt=yes
- if test -z "$TOOLKIT"; then
- TOOLKIT=gnu.java.awt.peer.gtk.GtkToolkit
- fi
- test -d jniinclude || mkdir jniinclude
- fi
- ;;
- no)
- use_xlib_awt=
- use_gtk_awt=
- break
- ;;
- *)
- echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2
- exit 1
- esac
-done
-
-AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes)
-AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes)
-
# determine whether to enable the cairo GTK Graphics2D backend
AC_ARG_ENABLE(gtk-cairo,
AS_HELP_STRING([--enable-gtk-cairo],
@@ -1014,84 +1118,6 @@ else
fi
AM_CONDITIONAL(SUPPLY_BACKTRACE, test "$supply_backtrace" = yes)
-if test -z "${with_multisubdir}"; then
- builddotdot=.
-else
- builddotdot=`echo ${with_multisubdir} | sed -e 's:[[^/]][[^/]]*:..:g'`
-fi
-
-NATIVE=yes
-
-# Which gcj do we use?
-which_gcj=default
-built_gcc_dir="`cd ${builddotdot}/../../${host_subdir}/gcc && ${PWDCMD-pwd}`"
-if test -n "${with_cross_host}"; then
- # We are being configured with a cross compiler. We can't
- # use ac_exeext, because that is for the target platform.
- NATIVE=no
- cross_host_exeext=
- case "${with_cross_host}" in
- *mingw* | *cygwin*)
- cross_host_exeext=.exe
- ;;
- esac
- if test -x "${built_gcc_dir}/gcj${cross_host_exeext}"; then
- if test x"$build_noncanonical" = x"$with_cross_host"; then
- # Ordinary cross (host!=target and host=build)
- which_gcj=built
- else
- # Canadian cross (host!=target and host!=build)
- which_gcj=cross
- fi
- else
- which_gcj=cross
- fi
-else
- # We are being configured with a native or crossed-native compiler
- if test -x "${built_gcc_dir}/gcj${ac_exeext}"; then
- if test x"$build" = x"$host"; then
- # True native build (host=target and host=build)
- which_gcj=built
- else
- # Crossed-native build (host=target and host!=build)
- which_gcj=cross
- fi
- else
- which_gcj=path
- fi
-fi
-case "${which_gcj}" in
- built)
- GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
- GCJH='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/gcc/gcjh'
- ZIP='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/fastjar/fastjar'
- ;;
- cross)
- if test "x${with_newlib}" = "xyes"; then
- # FIXME (comment): Why is this needed?
- GCC_UNWIND_INCLUDE=
- GCJ="${target_noncanonical}-gcj"
- else
- GCJ="${target_noncanonical}-gcj -B`${PWDCMD-pwd}`/"
- fi
- ZIP='$(target_noncanonical)-fastjar'
- GCJH='$(target_noncanonical)-gcjh'
- ;;
- path)
- GCJ="gcj -B`${PWDCMD-pwd}`/"
- ## In this case, gcj is found outside the build tree. However, zip is
- ## found in the build tree.
- ZIP='$(top_builddir)/$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar'
- GCJH=gcjh
- ;;
-esac
-
-AC_SUBST(GCJH)
-AC_SUBST(ZIP)
-
-# Create it, so that compile/link tests don't fail
-test -f libgcj.spec || touch libgcj.spec
-
# Use a semicolon as CLASSPATH separator for MinGW, otherwise a colon.
case $build in
*-mingw32) CLASSPATH_SEPARATOR=';' ;;
@@ -1109,8 +1135,8 @@ CPPFLAGS="$CPPFLAGS -I`${PWDCMD-pwd}` -I`cd $srcdir && ${PWDCMD-pwd}`"
if test ! -f gnu/classpath/Configuration.java; then
test -d gnu || mkdir gnu
test -d gnu/classpath || mkdir gnu/classpath
- sed -e 's,@LIBGCJDEBUG@,$LIBGCJDEBUG,' \
- -e 's,@TOOLKIT@,$TOOLKIT,' \
+ sed -e "s,@LIBGCJDEBUG@,$LIBGCJDEBUG," \
+ -e "s,@TOOLKIT@,$TOOLKIT," \
< $srcdir/gnu/classpath/Configuration.java.in \
> gnu/classpath/Configuration.java
# We do not want to redirect the output of the grep below to /dev/null,
@@ -1123,6 +1149,9 @@ fi
LT_AC_PROG_GCJ
+# Now remove it.
+rm -f gnu/classpath/Configuration.java
+
CPPFLAGS=$GCJ_SAVE_CPPFLAGS
AC_CHECK_SIZEOF(void *)
@@ -1373,13 +1402,9 @@ Makefile
libgcj.pc
libgcj.spec
libgcj-test.spec
-gnu/classpath/Configuration.java
gcj/Makefile
include/Makefile
testsuite/Makefile
-external/Makefile
-external/sax/Makefile
-external/w3c_dom/Makefile
])
AC_CONFIG_COMMANDS([default],
diff --git a/libjava/external/Makefile.am b/libjava/external/Makefile.am
deleted file mode 100644
index 0031d6b7b00..00000000000
--- a/libjava/external/Makefile.am
+++ /dev/null
@@ -1,47 +0,0 @@
-## Input file for automake to generate the Makefile.in used by configure
-
-# May be used by various substitution variables.
-gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
-
-SUBDIRS = sax w3c_dom
-
-# Work around what appears to be a GNU make bug handling MAKEFLAGS
-# values defined in terms of make variables, as is the case for CC and
-# friends when we are called from the top level Makefile.
-AM_MAKEFLAGS = \
- "AR_FLAGS=$(AR_FLAGS)" \
- "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
- "CFLAGS=$(CFLAGS)" \
- "CXXFLAGS=$(CXXFLAGS)" \
- "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
- "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
- "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
- "LDFLAGS=$(LDFLAGS)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
- "MAKE=$(MAKE)" \
- "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
- "PICFLAG=$(PICFLAG)" \
- "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
- "SHELL=$(SHELL)" \
- "EXPECT=$(EXPECT)" \
- "RUNTEST=$(RUNTEST)" \
- "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
- "exec_prefix=$(exec_prefix)" \
- "infodir=$(infodir)" \
- "libdir=$(libdir)" \
- "prefix=$(prefix)" \
- "tooldir=$(tooldir)" \
- "AR=$(AR)" \
- "AS=$(AS)" \
- "CC=$(CC)" \
- "CXX=$(CXX)" \
- "LD=$(LD)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "NM=$(NM)" \
- "PICFLAG=$(PICFLAG)" \
- "RANLIB=$(RANLIB)" \
- "DESTDIR=$(DESTDIR)"
diff --git a/libjava/external/Makefile.in b/libjava/external/Makefile.in
deleted file mode 100644
index 9d88ebb64bc..00000000000
--- a/libjava/external/Makefile.in
+++ /dev/null
@@ -1,633 +0,0 @@
-# Makefile.in generated by automake 1.9.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = external
-DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
- $(top_srcdir)/../config/depstand.m4 \
- $(top_srcdir)/../config/gxx-include-dir.m4 \
- $(top_srcdir)/../config/iconv.m4 \
- $(top_srcdir)/../config/lcmessage.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
- $(top_srcdir)/../config/lib-ld.m4 \
- $(top_srcdir)/../config/lib-link.m4 \
- $(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
- $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/../config/no-executables.m4 \
- $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-CONFIG_HEADER = $(top_builddir)/include/config.h \
- $(top_builddir)/gcj/libgcj-config.h
-CONFIG_CLEAN_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BACKTRACESPEC = @BACKTRACESPEC@
-CAIRO_CFLAGS = @CAIRO_CFLAGS@
-CAIRO_LIBS = @CAIRO_LIBS@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CHECKREFSPEC = @CHECKREFSPEC@
-CLASSPATH_SEPARATOR = @CLASSPATH_SEPARATOR@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DIRLTDL = @DIRLTDL@
-DIVIDESPEC = @DIVIDESPEC@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXCEPTIONSPEC = @EXCEPTIONSPEC@
-EXEEXT = @EXEEXT@
-GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
-GCDEPS = @GCDEPS@
-GCINCS = @GCINCS@
-GCJ = @GCJ@
-GCJDEPMODE = @GCJDEPMODE@
-GCJFLAGS = @GCJFLAGS@
-GCJH = @GCJH@
-GCJVERSION = @GCJVERSION@
-GCLIBS = @GCLIBS@
-GCSPEC = @GCSPEC@
-GCTESTSPEC = @GCTESTSPEC@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GTK_AWT_FALSE = @GTK_AWT_FALSE@
-GTK_AWT_TRUE = @GTK_AWT_TRUE@
-GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
-GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
-GTK_CFLAGS = @GTK_CFLAGS@
-GTK_LIBS = @GTK_LIBS@
-HASH_SYNC_SPEC = @HASH_SYNC_SPEC@
-IEEESPEC = @IEEESPEC@
-INCLTDL = @INCLTDL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTERPRETER = @INTERPRETER@
-JAVA_HOME = @JAVA_HOME@
-JAVA_HOME_SET_FALSE = @JAVA_HOME_SET_FALSE@
-JAVA_HOME_SET_TRUE = @JAVA_HOME_SET_TRUE@
-JC1GCSPEC = @JC1GCSPEC@
-LDFLAGS = @LDFLAGS@
-LIBART_CFLAGS = @LIBART_CFLAGS@
-LIBART_LIBS = @LIBART_LIBS@
-LIBFFI = @LIBFFI@
-LIBFFIINCS = @LIBFFIINCS@
-LIBGCJDEBUG = @LIBGCJDEBUG@
-LIBGCJTESTSPEC = @LIBGCJTESTSPEC@
-LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@
-LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@
-LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
-LIBGCJ_LD_SYMBOLIC = @LIBGCJ_LD_SYMBOLIC@
-LIBICONV = @LIBICONV@
-LIBLTDL = @LIBLTDL@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBICONV = @LTLIBICONV@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-NATIVE_FALSE = @NATIVE_FALSE@
-NATIVE_TRUE = @NATIVE_TRUE@
-NEEDS_DATA_START_FALSE = @NEEDS_DATA_START_FALSE@
-NEEDS_DATA_START_TRUE = @NEEDS_DATA_START_TRUE@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
-PANGOFT2_LIBS = @PANGOFT2_LIBS@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-PKG_CONFIG = @PKG_CONFIG@
-PLATFORM_INNER_NAT_HDRS = @PLATFORM_INNER_NAT_HDRS@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SUPPLY_BACKTRACE_FALSE = @SUPPLY_BACKTRACE_FALSE@
-SUPPLY_BACKTRACE_TRUE = @SUPPLY_BACKTRACE_TRUE@
-SYSDEP_SOURCES = @SYSDEP_SOURCES@
-SYSTEMSPEC = @SYSTEMSPEC@
-SYS_ZLIBS = @SYS_ZLIBS@
-TESTSUBDIR_FALSE = @TESTSUBDIR_FALSE@
-TESTSUBDIR_TRUE = @TESTSUBDIR_TRUE@
-THREADCXXFLAGS = @THREADCXXFLAGS@
-THREADDEPS = @THREADDEPS@
-THREADINCS = @THREADINCS@
-THREADLDFLAGS = @THREADLDFLAGS@
-THREADLIBS = @THREADLIBS@
-THREADSPEC = @THREADSPEC@
-TOOLKIT = @TOOLKIT@
-USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@
-USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@
-USING_DARWIN_CRT_FALSE = @USING_DARWIN_CRT_FALSE@
-USING_DARWIN_CRT_TRUE = @USING_DARWIN_CRT_TRUE@
-USING_GCC_FALSE = @USING_GCC_FALSE@
-USING_GCC_TRUE = @USING_GCC_TRUE@
-USING_NOGC_FALSE = @USING_NOGC_FALSE@
-USING_NOGC_TRUE = @USING_NOGC_TRUE@
-USING_NO_THREADS_FALSE = @USING_NO_THREADS_FALSE@
-USING_NO_THREADS_TRUE = @USING_NO_THREADS_TRUE@
-USING_POSIX_PLATFORM_FALSE = @USING_POSIX_PLATFORM_FALSE@
-USING_POSIX_PLATFORM_TRUE = @USING_POSIX_PLATFORM_TRUE@
-USING_POSIX_THREADS_FALSE = @USING_POSIX_THREADS_FALSE@
-USING_POSIX_THREADS_TRUE = @USING_POSIX_THREADS_TRUE@
-USING_WIN32_PLATFORM_FALSE = @USING_WIN32_PLATFORM_FALSE@
-USING_WIN32_PLATFORM_TRUE = @USING_WIN32_PLATFORM_TRUE@
-USING_WIN32_THREADS_FALSE = @USING_WIN32_THREADS_FALSE@
-USING_WIN32_THREADS_TRUE = @USING_WIN32_THREADS_TRUE@
-VERSION = @VERSION@
-XLIB_AWT_FALSE = @XLIB_AWT_FALSE@
-XLIB_AWT_TRUE = @XLIB_AWT_TRUE@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-ZINCS = @ZINCS@
-ZIP = @ZIP@
-ZLIBS = @ZLIBS@
-ZLIBSPEC = @ZLIBSPEC@
-ZLIBTESTSPEC = @ZLIBTESTSPEC@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_AS = @ac_ct_AS@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_GCJ = @ac_ct_GCJ@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__fastdepGCJ_FALSE = @am__fastdepGCJ_FALSE@
-am__fastdepGCJ_TRUE = @am__fastdepGCJ_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_subdir = @build_subdir@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-gxx_include_dir = @gxx_include_dir@
-here = @here@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_subdir = @host_subdir@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libgcj_basedir = @libgcj_basedir@
-libstdcxx_incdir = @libstdcxx_incdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-mkinstalldirs = @mkinstalldirs@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-subdirs = @subdirs@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_noncanonical = @target_noncanonical@
-target_os = @target_os@
-target_subdir = @target_subdir@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-toolexecmainlibdir = @toolexecmainlibdir@
-
-# May be used by various substitution variables.
-gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
-SUBDIRS = sax w3c_dom
-
-# Work around what appears to be a GNU make bug handling MAKEFLAGS
-# values defined in terms of make variables, as is the case for CC and
-# friends when we are called from the top level Makefile.
-AM_MAKEFLAGS = \
- "AR_FLAGS=$(AR_FLAGS)" \
- "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
- "CFLAGS=$(CFLAGS)" \
- "CXXFLAGS=$(CXXFLAGS)" \
- "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
- "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
- "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
- "LDFLAGS=$(LDFLAGS)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
- "MAKE=$(MAKE)" \
- "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
- "PICFLAG=$(PICFLAG)" \
- "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
- "SHELL=$(SHELL)" \
- "EXPECT=$(EXPECT)" \
- "RUNTEST=$(RUNTEST)" \
- "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
- "exec_prefix=$(exec_prefix)" \
- "infodir=$(infodir)" \
- "libdir=$(libdir)" \
- "prefix=$(prefix)" \
- "tooldir=$(tooldir)" \
- "AR=$(AR)" \
- "AS=$(AS)" \
- "CC=$(CC)" \
- "CXX=$(CXX)" \
- "LD=$(LD)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "NM=$(NM)" \
- "PICFLAG=$(PICFLAG)" \
- "RANLIB=$(RANLIB)" \
- "DESTDIR=$(DESTDIR)"
-
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu external/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu external/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @set fnord $$MAKEFLAGS; amf=$$2; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @set fnord $$MAKEFLAGS; amf=$$2; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(mkdir_p) "$(distdir)/$$subdir" \
- || exit 1; \
- distdir=`$(am__cd) $(distdir) && pwd`; \
- top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
- (cd $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$top_distdir" \
- distdir="$$distdir/$$subdir" \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool \
- distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
- clean clean-generic clean-libtool clean-recursive ctags \
- ctags-recursive distclean distclean-generic distclean-libtool \
- distclean-recursive distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-exec install-exec-am install-info \
- install-info-am install-man install-strip installcheck \
- installcheck-am installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-generic mostlyclean-libtool \
- mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
- uninstall uninstall-am uninstall-info-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/libjava/external/README b/libjava/external/README
deleted file mode 100644
index d6d6491d62b..00000000000
--- a/libjava/external/README
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains libraries maintained externally to GNU Classpath.
-
-See the README files in the subdirectories for more information.
diff --git a/libjava/external/sax/Makefile.am b/libjava/external/sax/Makefile.am
deleted file mode 100644
index 08b82e5b826..00000000000
--- a/libjava/external/sax/Makefile.am
+++ /dev/null
@@ -1,76 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-
-AUTOMAKE_OPTIONS = foreign subdir-objects
-
-# May be used by various substitution variables.
-gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
-
-## The compiler with whatever flags we want for both -c and -C
-## compiles.
-GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated -fclasspath= -fbootclasspath=$(BOOTCLASSPATH)
-
-BOOTCLASSPATH = $(here)'$(CLASSPATH_SEPARATOR)'$(srcdir)'$(CLASSPATH_SEPARATOR)'$(top_srcdir)'$(CLASSPATH_SEPARATOR)'$(top_builddir)
-
-AM_GCJFLAGS = \
- -B$(top_builddir) \
- @LIBGCJ_JAVAFLAGS@ \
- -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
- --encoding=UTF-8 \
- -Wno-deprecated
-
-BUILT_SOURCES = classes.stamp
-
-sax.jar: classes.stamp
- find org -name '*.class' -print | $(ZIP) -cfME@ $@
-
-classes.stamp: $(source_files)
- here=`pwd`; cd $(srcdir); \
- $(GCJ_WITH_FLAGS) -C -d $$here $(source_files)
- echo > classes.stamp
-
-mostlyclean-local:
- -find . -name '*.class' | xargs rm
- -rm classes.stamp sax.jar
-
-noinst_LTLIBRARIES = libsax-gcj.la
-
-libsax_gcj_la_SOURCES = sax.jar
-libsax_gcj_la_GCJFLAGS = -findirect-dispatch -fbootstrap-classes $(AM_GCJFLAGS)
-
-source_files = \
-org/xml/sax/SAXNotSupportedException.java \
-org/xml/sax/helpers/NamespaceSupport.java \
-org/xml/sax/helpers/AttributesImpl.java \
-org/xml/sax/helpers/LocatorImpl.java \
-org/xml/sax/helpers/DefaultHandler.java \
-org/xml/sax/helpers/AttributeListImpl.java \
-org/xml/sax/helpers/ParserFactory.java \
-org/xml/sax/helpers/NewInstance.java \
-org/xml/sax/helpers/XMLFilterImpl.java \
-org/xml/sax/helpers/ParserAdapter.java \
-org/xml/sax/helpers/XMLReaderAdapter.java \
-org/xml/sax/helpers/XMLReaderFactory.java \
-org/xml/sax/HandlerBase.java \
-org/xml/sax/SAXException.java \
-org/xml/sax/ContentHandler.java \
-org/xml/sax/SAXNotRecognizedException.java \
-org/xml/sax/ErrorHandler.java \
-org/xml/sax/AttributeList.java \
-org/xml/sax/Locator.java \
-org/xml/sax/Attributes.java \
-org/xml/sax/SAXParseException.java \
-org/xml/sax/XMLFilter.java \
-org/xml/sax/EntityResolver.java \
-org/xml/sax/XMLReader.java \
-org/xml/sax/ext/Locator2.java \
-org/xml/sax/ext/LexicalHandler.java \
-org/xml/sax/ext/Attributes2Impl.java \
-org/xml/sax/ext/DeclHandler.java \
-org/xml/sax/ext/Attributes2.java \
-org/xml/sax/ext/EntityResolver2.java \
-org/xml/sax/ext/Locator2Impl.java \
-org/xml/sax/ext/DefaultHandler2.java \
-org/xml/sax/InputSource.java \
-org/xml/sax/DocumentHandler.java \
-org/xml/sax/DTDHandler.java \
-org/xml/sax/Parser.java
diff --git a/libjava/external/sax/Makefile.in b/libjava/external/sax/Makefile.in
deleted file mode 100644
index 18c8cf552c0..00000000000
--- a/libjava/external/sax/Makefile.in
+++ /dev/null
@@ -1,631 +0,0 @@
-# Makefile.in generated by automake 1.9.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-SOURCES = $(libsax_gcj_la_SOURCES)
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = external/sax
-DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
- $(top_srcdir)/../config/depstand.m4 \
- $(top_srcdir)/../config/gxx-include-dir.m4 \
- $(top_srcdir)/../config/iconv.m4 \
- $(top_srcdir)/../config/lcmessage.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
- $(top_srcdir)/../config/lib-ld.m4 \
- $(top_srcdir)/../config/lib-link.m4 \
- $(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
- $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/../config/no-executables.m4 \
- $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-CONFIG_HEADER = $(top_builddir)/include/config.h \
- $(top_builddir)/gcj/libgcj-config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libsax_gcj_la_LIBADD =
-am_libsax_gcj_la_OBJECTS = libsax_gcj_la-sax.lo
-libsax_gcj_la_OBJECTS = $(am_libsax_gcj_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_builddir)/gcj
-depcomp = $(SHELL) $(top_srcdir)/../depcomp
-am__depfiles_maybe = depfiles
-GCJCOMPILE = $(GCJ) $(AM_GCJFLAGS) $(GCJFLAGS)
-LTGCJCOMPILE = $(LIBTOOL) --mode=compile $(GCJ) $(AM_GCJFLAGS) \
- $(GCJFLAGS)
-GCJLD = $(GCJ)
-GCJLINK = $(LIBTOOL) --mode=link $(GCJLD) $(AM_GCJFLAGS) $(GCJFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libsax_gcj_la_SOURCES)
-DIST_SOURCES = $(libsax_gcj_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BACKTRACESPEC = @BACKTRACESPEC@
-CAIRO_CFLAGS = @CAIRO_CFLAGS@
-CAIRO_LIBS = @CAIRO_LIBS@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CHECKREFSPEC = @CHECKREFSPEC@
-CLASSPATH_SEPARATOR = @CLASSPATH_SEPARATOR@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DIRLTDL = @DIRLTDL@
-DIVIDESPEC = @DIVIDESPEC@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXCEPTIONSPEC = @EXCEPTIONSPEC@
-EXEEXT = @EXEEXT@
-GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
-GCDEPS = @GCDEPS@
-GCINCS = @GCINCS@
-GCJ = @GCJ@
-GCJDEPMODE = @GCJDEPMODE@
-GCJFLAGS = @GCJFLAGS@
-GCJH = @GCJH@
-GCJVERSION = @GCJVERSION@
-GCLIBS = @GCLIBS@
-GCSPEC = @GCSPEC@
-GCTESTSPEC = @GCTESTSPEC@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GTK_AWT_FALSE = @GTK_AWT_FALSE@
-GTK_AWT_TRUE = @GTK_AWT_TRUE@
-GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
-GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
-GTK_CFLAGS = @GTK_CFLAGS@
-GTK_LIBS = @GTK_LIBS@
-HASH_SYNC_SPEC = @HASH_SYNC_SPEC@
-IEEESPEC = @IEEESPEC@
-INCLTDL = @INCLTDL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTERPRETER = @INTERPRETER@
-JAVA_HOME = @JAVA_HOME@
-JAVA_HOME_SET_FALSE = @JAVA_HOME_SET_FALSE@
-JAVA_HOME_SET_TRUE = @JAVA_HOME_SET_TRUE@
-JC1GCSPEC = @JC1GCSPEC@
-LDFLAGS = @LDFLAGS@
-LIBART_CFLAGS = @LIBART_CFLAGS@
-LIBART_LIBS = @LIBART_LIBS@
-LIBFFI = @LIBFFI@
-LIBFFIINCS = @LIBFFIINCS@
-LIBGCJDEBUG = @LIBGCJDEBUG@
-LIBGCJTESTSPEC = @LIBGCJTESTSPEC@
-LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@
-LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@
-LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
-LIBGCJ_LD_SYMBOLIC = @LIBGCJ_LD_SYMBOLIC@
-LIBICONV = @LIBICONV@
-LIBLTDL = @LIBLTDL@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBICONV = @LTLIBICONV@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-NATIVE_FALSE = @NATIVE_FALSE@
-NATIVE_TRUE = @NATIVE_TRUE@
-NEEDS_DATA_START_FALSE = @NEEDS_DATA_START_FALSE@
-NEEDS_DATA_START_TRUE = @NEEDS_DATA_START_TRUE@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
-PANGOFT2_LIBS = @PANGOFT2_LIBS@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-PKG_CONFIG = @PKG_CONFIG@
-PLATFORM_INNER_NAT_HDRS = @PLATFORM_INNER_NAT_HDRS@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SUPPLY_BACKTRACE_FALSE = @SUPPLY_BACKTRACE_FALSE@
-SUPPLY_BACKTRACE_TRUE = @SUPPLY_BACKTRACE_TRUE@
-SYSDEP_SOURCES = @SYSDEP_SOURCES@
-SYSTEMSPEC = @SYSTEMSPEC@
-SYS_ZLIBS = @SYS_ZLIBS@
-TESTSUBDIR_FALSE = @TESTSUBDIR_FALSE@
-TESTSUBDIR_TRUE = @TESTSUBDIR_TRUE@
-THREADCXXFLAGS = @THREADCXXFLAGS@
-THREADDEPS = @THREADDEPS@
-THREADINCS = @THREADINCS@
-THREADLDFLAGS = @THREADLDFLAGS@
-THREADLIBS = @THREADLIBS@
-THREADSPEC = @THREADSPEC@
-TOOLKIT = @TOOLKIT@
-USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@
-USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@
-USING_DARWIN_CRT_FALSE = @USING_DARWIN_CRT_FALSE@
-USING_DARWIN_CRT_TRUE = @USING_DARWIN_CRT_TRUE@
-USING_GCC_FALSE = @USING_GCC_FALSE@
-USING_GCC_TRUE = @USING_GCC_TRUE@
-USING_NOGC_FALSE = @USING_NOGC_FALSE@
-USING_NOGC_TRUE = @USING_NOGC_TRUE@
-USING_NO_THREADS_FALSE = @USING_NO_THREADS_FALSE@
-USING_NO_THREADS_TRUE = @USING_NO_THREADS_TRUE@
-USING_POSIX_PLATFORM_FALSE = @USING_POSIX_PLATFORM_FALSE@
-USING_POSIX_PLATFORM_TRUE = @USING_POSIX_PLATFORM_TRUE@
-USING_POSIX_THREADS_FALSE = @USING_POSIX_THREADS_FALSE@
-USING_POSIX_THREADS_TRUE = @USING_POSIX_THREADS_TRUE@
-USING_WIN32_PLATFORM_FALSE = @USING_WIN32_PLATFORM_FALSE@
-USING_WIN32_PLATFORM_TRUE = @USING_WIN32_PLATFORM_TRUE@
-USING_WIN32_THREADS_FALSE = @USING_WIN32_THREADS_FALSE@
-USING_WIN32_THREADS_TRUE = @USING_WIN32_THREADS_TRUE@
-VERSION = @VERSION@
-XLIB_AWT_FALSE = @XLIB_AWT_FALSE@
-XLIB_AWT_TRUE = @XLIB_AWT_TRUE@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-ZINCS = @ZINCS@
-ZIP = @ZIP@
-ZLIBS = @ZLIBS@
-ZLIBSPEC = @ZLIBSPEC@
-ZLIBTESTSPEC = @ZLIBTESTSPEC@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_AS = @ac_ct_AS@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_GCJ = @ac_ct_GCJ@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__fastdepGCJ_FALSE = @am__fastdepGCJ_FALSE@
-am__fastdepGCJ_TRUE = @am__fastdepGCJ_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_subdir = @build_subdir@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-gxx_include_dir = @gxx_include_dir@
-here = @here@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_subdir = @host_subdir@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libgcj_basedir = @libgcj_basedir@
-libstdcxx_incdir = @libstdcxx_incdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-mkinstalldirs = @mkinstalldirs@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-subdirs = @subdirs@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_noncanonical = @target_noncanonical@
-target_os = @target_os@
-target_subdir = @target_subdir@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-toolexecmainlibdir = @toolexecmainlibdir@
-AUTOMAKE_OPTIONS = foreign subdir-objects
-
-# May be used by various substitution variables.
-gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
-GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated -fclasspath= -fbootclasspath=$(BOOTCLASSPATH)
-BOOTCLASSPATH = $(here)'$(CLASSPATH_SEPARATOR)'$(srcdir)'$(CLASSPATH_SEPARATOR)'$(top_srcdir)'$(CLASSPATH_SEPARATOR)'$(top_builddir)
-AM_GCJFLAGS = \
- -B$(top_builddir) \
- @LIBGCJ_JAVAFLAGS@ \
- -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
- --encoding=UTF-8 \
- -Wno-deprecated
-
-BUILT_SOURCES = classes.stamp
-noinst_LTLIBRARIES = libsax-gcj.la
-libsax_gcj_la_SOURCES = sax.jar
-libsax_gcj_la_GCJFLAGS = -findirect-dispatch -fbootstrap-classes $(AM_GCJFLAGS)
-source_files = \
-org/xml/sax/SAXNotSupportedException.java \
-org/xml/sax/helpers/NamespaceSupport.java \
-org/xml/sax/helpers/AttributesImpl.java \
-org/xml/sax/helpers/LocatorImpl.java \
-org/xml/sax/helpers/DefaultHandler.java \
-org/xml/sax/helpers/AttributeListImpl.java \
-org/xml/sax/helpers/ParserFactory.java \
-org/xml/sax/helpers/NewInstance.java \
-org/xml/sax/helpers/XMLFilterImpl.java \
-org/xml/sax/helpers/ParserAdapter.java \
-org/xml/sax/helpers/XMLReaderAdapter.java \
-org/xml/sax/helpers/XMLReaderFactory.java \
-org/xml/sax/HandlerBase.java \
-org/xml/sax/SAXException.java \
-org/xml/sax/ContentHandler.java \
-org/xml/sax/SAXNotRecognizedException.java \
-org/xml/sax/ErrorHandler.java \
-org/xml/sax/AttributeList.java \
-org/xml/sax/Locator.java \
-org/xml/sax/Attributes.java \
-org/xml/sax/SAXParseException.java \
-org/xml/sax/XMLFilter.java \
-org/xml/sax/EntityResolver.java \
-org/xml/sax/XMLReader.java \
-org/xml/sax/ext/Locator2.java \
-org/xml/sax/ext/LexicalHandler.java \
-org/xml/sax/ext/Attributes2Impl.java \
-org/xml/sax/ext/DeclHandler.java \
-org/xml/sax/ext/Attributes2.java \
-org/xml/sax/ext/EntityResolver2.java \
-org/xml/sax/ext/Locator2Impl.java \
-org/xml/sax/ext/DefaultHandler2.java \
-org/xml/sax/InputSource.java \
-org/xml/sax/DocumentHandler.java \
-org/xml/sax/DTDHandler.java \
-org/xml/sax/Parser.java
-
-all: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .jar .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign external/sax/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign external/sax/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-libsax-gcj.la: $(libsax_gcj_la_OBJECTS) $(libsax_gcj_la_DEPENDENCIES)
- $(GCJLINK) $(libsax_gcj_la_LDFLAGS) $(libsax_gcj_la_OBJECTS) $(libsax_gcj_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsax_gcj_la-sax.Plo@am__quote@
-
-.jar.o:
-@am__fastdepGCJ_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`; \
-@am__fastdepGCJ_TRUE@ if $(GCJCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
-@am__fastdepGCJ_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepGCJ_FALSE@ $(GCJCOMPILE) -c -o $@ $<
-
-.jar.obj:
-@am__fastdepGCJ_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`; \
-@am__fastdepGCJ_TRUE@ if $(GCJCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepGCJ_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepGCJ_FALSE@ $(GCJCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.jar.lo:
-@am__fastdepGCJ_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`; \
-@am__fastdepGCJ_TRUE@ if $(LTGCJCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
-@am__fastdepGCJ_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Plo"; else rm -f "$$depbase.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepGCJ_FALSE@ $(LTGCJCOMPILE) -c -o $@ $<
-
-libsax_gcj_la-sax.lo: sax.jar
-@am__fastdepGCJ_TRUE@ if $(LIBTOOL) --mode=compile $(GCJ) $(libsax_gcj_la_GCJFLAGS) $(GCJFLAGS) -MT libsax_gcj_la-sax.lo -MD -MP -MF "$(DEPDIR)/libsax_gcj_la-sax.Tpo" -c -o libsax_gcj_la-sax.lo `test -f 'sax.jar' || echo '$(srcdir)/'`sax.jar; \
-@am__fastdepGCJ_TRUE@ then mv -f "$(DEPDIR)/libsax_gcj_la-sax.Tpo" "$(DEPDIR)/libsax_gcj_la-sax.Plo"; else rm -f "$(DEPDIR)/libsax_gcj_la-sax.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='sax.jar' object='libsax_gcj_la-sax.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepGCJ_FALSE@ $(LIBTOOL) --mode=compile $(GCJ) $(libsax_gcj_la_GCJFLAGS) $(GCJFLAGS) -c -o libsax_gcj_la-sax.lo `test -f 'sax.jar' || echo '$(srcdir)/'`sax.jar
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool mostlyclean-local
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- mostlyclean-local pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am
-
-
-sax.jar: classes.stamp
- find org -name '*.class' -print | $(ZIP) -cfME@ $@
-
-classes.stamp: $(source_files)
- here=`pwd`; cd $(srcdir); \
- $(GCJ_WITH_FLAGS) -C -d $$here $(source_files)
- echo > classes.stamp
-
-mostlyclean-local:
- -find . -name '*.class' | xargs rm
- -rm classes.stamp sax.jar
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/libjava/external/sax/README b/libjava/external/sax/README
deleted file mode 100644
index 4b39d236423..00000000000
--- a/libjava/external/sax/README
+++ /dev/null
@@ -1,71 +0,0 @@
-Simple API for XML (SAX), a standard application interface for processing XML.
-SAX is not maintained as part of GNU Classpath, but is used with GNU Classpath.
-
-Last imported version sax2r3 final from http://www.saxproject.org/
-
-All files are distributed with the following short notice:
-
- NO WARRANTY! This class is in the Public Domain.
-
-The www.saxproject.org explains:
-
- Copyright Status
-
- SAX is free!
-
- In fact, it's not possible to own a license to SAX, since it's been
- placed in the public domain.
-
- No Warranty
-
- Because SAX is released to the public domain, there is no warranty
- for the design or for the software implementation, to the extent
- permitted by applicable law. Except when otherwise stated in writing
- the copyright holders and/or other parties provide SAX "as is" without
- warranty of any kind, either expressed or implied, including, but not
- limited to, the implied warranties of merchantability and fitness for
- a particular purpose. The entire risk as to the quality and
- performance of SAX is with you. Should SAX prove defective, you assume
- the cost of all necessary servicing, repair or correction.
-
- In no event unless required by applicable law or agreed to in
- writing will any copyright holder, or any other party who may modify
- and/or redistribute SAX, be liable to you for damages, including any
- general, special, incidental or consequential damages arising out of
- the use or inability to use SAX (including but not limited to loss of
- data or data being rendered inaccurate or losses sustained by you or
- third parties or a failure of the SAX to operate with any other
- programs), even if such holder or other party has been advised of the
- possibility of such damages.
-
- Copyright Disclaimers
-
- This page includes statements to that effect by David Megginson, who
- would have been able to claim copyright for the original work.
-
- SAX 1.0
-
- Version 1.0 of the Simple API for XML (SAX), created collectively by
- the membership of the XML-DEV mailing list, is hereby released into
- the public domain.
-
- No one owns SAX: you may use it freely in both commercial and
- non-commercial applications, bundle it with your software
- distribution, include it on a CD-ROM, list the source code in a book,
- mirror the documentation at your own web site, or use it in any other
- way you see fit.
-
- David Megginson, sax@megginson.com
- 1998-05-11
-
- SAX 2.0
-
- I hereby abandon any property rights to SAX 2.0 (the Simple API for
- XML), and release all of the SAX 2.0 source code, compiled code, and
- documentation contained in this distribution into the Public
- Domain. SAX comes with NO WARRANTY or guarantee of fitness for any
- purpose.
-
- David Megginson, david@megginson.com
- 2000-05-05
-
diff --git a/libjava/external/sax/org/xml/sax/AttributeList.java b/libjava/external/sax/org/xml/sax/AttributeList.java
deleted file mode 100644
index 7d8e9beec37..00000000000
--- a/libjava/external/sax/org/xml/sax/AttributeList.java
+++ /dev/null
@@ -1,193 +0,0 @@
-// SAX Attribute List Interface.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: AttributeList.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-/**
- * Interface for an element's attribute specifications.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This is the original SAX1 interface for reporting an element's
- * attributes. Unlike the new {@link org.xml.sax.Attributes Attributes}
- * interface, it does not support Namespace-related information.</p>
- *
- * <p>When an attribute list is supplied as part of a
- * {@link org.xml.sax.DocumentHandler#startElement startElement}
- * event, the list will return valid results only during the
- * scope of the event; once the event handler returns control
- * to the parser, the attribute list is invalid. To save a
- * persistent copy of the attribute list, use the SAX1
- * {@link org.xml.sax.helpers.AttributeListImpl AttributeListImpl}
- * helper class.</p>
- *
- * <p>An attribute list includes only attributes that have been
- * specified or defaulted: #IMPLIED attributes will not be included.</p>
- *
- * <p>There are two ways for the SAX application to obtain information
- * from the AttributeList. First, it can iterate through the entire
- * list:</p>
- *
- * <pre>
- * public void startElement (String name, AttributeList atts) {
- * for (int i = 0; i < atts.getLength(); i++) {
- * String name = atts.getName(i);
- * String type = atts.getType(i);
- * String value = atts.getValue(i);
- * [...]
- * }
- * }
- * </pre>
- *
- * <p>(Note that the result of getLength() will be zero if there
- * are no attributes.)
- *
- * <p>As an alternative, the application can request the value or
- * type of specific attributes:</p>
- *
- * <pre>
- * public void startElement (String name, AttributeList atts) {
- * String identifier = atts.getValue("id");
- * String label = atts.getValue("label");
- * [...]
- * }
- * </pre>
- *
- * @deprecated This interface has been replaced by the SAX2
- * {@link org.xml.sax.Attributes Attributes}
- * interface, which includes Namespace support.
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.DocumentHandler#startElement startElement
- * @see org.xml.sax.helpers.AttributeListImpl AttributeListImpl
- */
-public interface AttributeList {
-
-
- ////////////////////////////////////////////////////////////////////
- // Iteration methods.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the number of attributes in this list.
- *
- * <p>The SAX parser may provide attributes in any
- * arbitrary order, regardless of the order in which they were
- * declared or specified. The number of attributes may be
- * zero.</p>
- *
- * @return The number of attributes in the list.
- */
- public abstract int getLength ();
-
-
- /**
- * Return the name of an attribute in this list (by position).
- *
- * <p>The names must be unique: the SAX parser shall not include the
- * same attribute twice. Attributes without values (those declared
- * #IMPLIED without a value specified in the start tag) will be
- * omitted from the list.</p>
- *
- * <p>If the attribute name has a namespace prefix, the prefix
- * will still be attached.</p>
- *
- * @param i The index of the attribute in the list (starting at 0).
- * @return The name of the indexed attribute, or null
- * if the index is out of range.
- * @see #getLength
- */
- public abstract String getName (int i);
-
-
- /**
- * Return the type of an attribute in the list (by position).
- *
- * <p>The attribute type is one of the strings "CDATA", "ID",
- * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
- * or "NOTATION" (always in upper case).</p>
- *
- * <p>If the parser has not read a declaration for the attribute,
- * or if the parser does not report attribute types, then it must
- * return the value "CDATA" as stated in the XML 1.0 Recommentation
- * (clause 3.3.3, "Attribute-Value Normalization").</p>
- *
- * <p>For an enumerated attribute that is not a notation, the
- * parser will report the type as "NMTOKEN".</p>
- *
- * @param i The index of the attribute in the list (starting at 0).
- * @return The attribute type as a string, or
- * null if the index is out of range.
- * @see #getLength
- * @see #getType(java.lang.String)
- */
- public abstract String getType (int i);
-
-
- /**
- * Return the value of an attribute in the list (by position).
- *
- * <p>If the attribute value is a list of tokens (IDREFS,
- * ENTITIES, or NMTOKENS), the tokens will be concatenated
- * into a single string separated by whitespace.</p>
- *
- * @param i The index of the attribute in the list (starting at 0).
- * @return The attribute value as a string, or
- * null if the index is out of range.
- * @see #getLength
- * @see #getValue(java.lang.String)
- */
- public abstract String getValue (int i);
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Lookup methods.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the type of an attribute in the list (by name).
- *
- * <p>The return value is the same as the return value for
- * getType(int).</p>
- *
- * <p>If the attribute name has a namespace prefix in the document,
- * the application must include the prefix here.</p>
- *
- * @param name The name of the attribute.
- * @return The attribute type as a string, or null if no
- * such attribute exists.
- * @see #getType(int)
- */
- public abstract String getType (String name);
-
-
- /**
- * Return the value of an attribute in the list (by name).
- *
- * <p>The return value is the same as the return value for
- * getValue(int).</p>
- *
- * <p>If the attribute name has a namespace prefix in the document,
- * the application must include the prefix here.</p>
- *
- * @param name the name of the attribute to return
- * @return The attribute value as a string, or null if
- * no such attribute exists.
- * @see #getValue(int)
- */
- public abstract String getValue (String name);
-
-}
-
-// end of AttributeList.java
diff --git a/libjava/external/sax/org/xml/sax/Attributes.java b/libjava/external/sax/org/xml/sax/Attributes.java
deleted file mode 100644
index 51735908936..00000000000
--- a/libjava/external/sax/org/xml/sax/Attributes.java
+++ /dev/null
@@ -1,257 +0,0 @@
-// Attributes.java - attribute list with Namespace support
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: Attributes.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-
-/**
- * Interface for a list of XML attributes.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This interface allows access to a list of attributes in
- * three different ways:</p>
- *
- * <ol>
- * <li>by attribute index;</li>
- * <li>by Namespace-qualified name; or</li>
- * <li>by qualified (prefixed) name.</li>
- * </ol>
- *
- * <p>The list will not contain attributes that were declared
- * #IMPLIED but not specified in the start tag. It will also not
- * contain attributes used as Namespace declarations (xmlns*) unless
- * the <code>http://xml.org/sax/features/namespace-prefixes</code>
- * feature is set to <var>true</var> (it is <var>false</var> by
- * default).
- * Because SAX2 conforms to the original "Namespaces in XML"
- * recommendation, it normally does not
- * give namespace declaration attributes a namespace URI.
- * </p>
- *
- * <p>Some SAX2 parsers may support using an optional feature flag
- * (<code>http://xml.org/sax/features/xmlns-uris</code>) to request
- * that those attributes be given URIs, conforming to a later
- * backwards-incompatible revision of that recommendation. (The
- * attribute's "local name" will be the prefix, or "xmlns" when
- * defining a default element namespace.) For portability, handler
- * code should always resolve that conflict, rather than requiring
- * parsers that can change the setting of that feature flag. </p>
- *
- * <p>If the namespace-prefixes feature (see above) is
- * <var>false</var>, access by qualified name may not be available; if
- * the <code>http://xml.org/sax/features/namespaces</code> feature is
- * <var>false</var>, access by Namespace-qualified names may not be
- * available.</p>
- *
- * <p>This interface replaces the now-deprecated SAX1 {@link
- * org.xml.sax.AttributeList AttributeList} interface, which does not
- * contain Namespace support. In addition to Namespace support, it
- * adds the <var>getIndex</var> methods (below).</p>
- *
- * <p>The order of attributes in the list is unspecified, and will
- * vary from implementation to implementation.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.helpers.AttributesImpl
- * @see org.xml.sax.ext.DeclHandler#attributeDecl
- */
-public interface Attributes
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Indexed access.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the number of attributes in the list.
- *
- * <p>Once you know the number of attributes, you can iterate
- * through the list.</p>
- *
- * @return The number of attributes in the list.
- * @see #getURI(int)
- * @see #getLocalName(int)
- * @see #getQName(int)
- * @see #getType(int)
- * @see #getValue(int)
- */
- public abstract int getLength ();
-
-
- /**
- * Look up an attribute's Namespace URI by index.
- *
- * @param index The attribute index (zero-based).
- * @return The Namespace URI, or the empty string if none
- * is available, or null if the index is out of
- * range.
- * @see #getLength
- */
- public abstract String getURI (int index);
-
-
- /**
- * Look up an attribute's local name by index.
- *
- * @param index The attribute index (zero-based).
- * @return The local name, or the empty string if Namespace
- * processing is not being performed, or null
- * if the index is out of range.
- * @see #getLength
- */
- public abstract String getLocalName (int index);
-
-
- /**
- * Look up an attribute's XML qualified (prefixed) name by index.
- *
- * @param index The attribute index (zero-based).
- * @return The XML qualified name, or the empty string
- * if none is available, or null if the index
- * is out of range.
- * @see #getLength
- */
- public abstract String getQName (int index);
-
-
- /**
- * Look up an attribute's type by index.
- *
- * <p>The attribute type is one of the strings "CDATA", "ID",
- * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
- * or "NOTATION" (always in upper case).</p>
- *
- * <p>If the parser has not read a declaration for the attribute,
- * or if the parser does not report attribute types, then it must
- * return the value "CDATA" as stated in the XML 1.0 Recommendation
- * (clause 3.3.3, "Attribute-Value Normalization").</p>
- *
- * <p>For an enumerated attribute that is not a notation, the
- * parser will report the type as "NMTOKEN".</p>
- *
- * @param index The attribute index (zero-based).
- * @return The attribute's type as a string, or null if the
- * index is out of range.
- * @see #getLength
- */
- public abstract String getType (int index);
-
-
- /**
- * Look up an attribute's value by index.
- *
- * <p>If the attribute value is a list of tokens (IDREFS,
- * ENTITIES, or NMTOKENS), the tokens will be concatenated
- * into a single string with each token separated by a
- * single space.</p>
- *
- * @param index The attribute index (zero-based).
- * @return The attribute's value as a string, or null if the
- * index is out of range.
- * @see #getLength
- */
- public abstract String getValue (int index);
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Name-based query.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Look up the index of an attribute by Namespace name.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex (String uri, String localName);
-
-
- /**
- * Look up the index of an attribute by XML qualified (prefixed) name.
- *
- * @param qName The qualified (prefixed) name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex (String qName);
-
-
- /**
- * Look up an attribute's type by Namespace name.
- *
- * <p>See {@link #getType(int) getType(int)} for a description
- * of the possible types.</p>
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if Namespace
- * processing is not being performed.
- */
- public abstract String getType (String uri, String localName);
-
-
- /**
- * Look up an attribute's type by XML qualified (prefixed) name.
- *
- * <p>See {@link #getType(int) getType(int)} for a description
- * of the possible types.</p>
- *
- * @param qName The XML qualified name.
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if qualified names
- * are not available.
- */
- public abstract String getType (String qName);
-
-
- /**
- * Look up an attribute's value by Namespace name.
- *
- * <p>See {@link #getValue(int) getValue(int)} for a description
- * of the possible values.</p>
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute value as a string, or null if the
- * attribute is not in the list.
- */
- public abstract String getValue (String uri, String localName);
-
-
- /**
- * Look up an attribute's value by XML qualified (prefixed) name.
- *
- * <p>See {@link #getValue(int) getValue(int)} for a description
- * of the possible values.</p>
- *
- * @param qName The XML qualified name.
- * @return The attribute value as a string, or null if the
- * attribute is not in the list or if qualified names
- * are not available.
- */
- public abstract String getValue (String qName);
-
-}
-
-// end of Attributes.java
diff --git a/libjava/external/sax/org/xml/sax/ContentHandler.java b/libjava/external/sax/org/xml/sax/ContentHandler.java
deleted file mode 100644
index c0df614108d..00000000000
--- a/libjava/external/sax/org/xml/sax/ContentHandler.java
+++ /dev/null
@@ -1,419 +0,0 @@
-// ContentHandler.java - handle main document content.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: ContentHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-
-/**
- * Receive notification of the logical content of a document.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This is the main interface that most SAX applications
- * implement: if the application needs to be informed of basic parsing
- * events, it implements this interface and registers an instance with
- * the SAX parser using the {@link org.xml.sax.XMLReader#setContentHandler
- * setContentHandler} method. The parser uses the instance to report
- * basic document-related events like the start and end of elements
- * and character data.</p>
- *
- * <p>The order of events in this interface is very important, and
- * mirrors the order of information in the document itself. For
- * example, all of an element's content (character data, processing
- * instructions, and/or subelements) will appear, in order, between
- * the startElement event and the corresponding endElement event.</p>
- *
- * <p>This interface is similar to the now-deprecated SAX 1.0
- * DocumentHandler interface, but it adds support for Namespaces
- * and for reporting skipped entities (in non-validating XML
- * processors).</p>
- *
- * <p>Implementors should note that there is also a
- * <code>ContentHandler</code> class in the <code>java.net</code>
- * package; that means that it's probably a bad idea to do</p>
- *
- * <pre>import java.net.*;
- * import org.xml.sax.*;
- * </pre>
- *
- * <p>In fact, "import ...*" is usually a sign of sloppy programming
- * anyway, so the user should consider this a feature rather than a
- * bug.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1+ (sax2r3pre1)
- * @see org.xml.sax.XMLReader
- * @see org.xml.sax.DTDHandler
- * @see org.xml.sax.ErrorHandler
- */
-public interface ContentHandler
-{
-
- /**
- * Receive an object for locating the origin of SAX document events.
- *
- * <p>SAX parsers are strongly encouraged (though not absolutely
- * required) to supply a locator: if it does so, it must supply
- * the locator to the application by invoking this method before
- * invoking any of the other methods in the ContentHandler
- * interface.</p>
- *
- * <p>The locator allows the application to determine the end
- * position of any document-related event, even if the parser is
- * not reporting an error. Typically, the application will
- * use this information for reporting its own errors (such as
- * character content that does not match an application's
- * business rules). The information returned by the locator
- * is probably not sufficient for use with a search engine.</p>
- *
- * <p>Note that the locator will return correct information only
- * during the invocation SAX event callbacks after
- * {@link #startDocument startDocument} returns and before
- * {@link #endDocument endDocument} is called. The
- * application should not attempt to use it at any other time.</p>
- *
- * @param locator an object that can return the location of
- * any SAX document event
- * @see org.xml.sax.Locator
- */
- public void setDocumentLocator (Locator locator);
-
-
- /**
- * Receive notification of the beginning of a document.
- *
- * <p>The SAX parser will invoke this method only once, before any
- * other event callbacks (except for {@link #setDocumentLocator
- * setDocumentLocator}).</p>
- *
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- * @see #endDocument
- */
- public void startDocument ()
- throws SAXException;
-
-
- /**
- * Receive notification of the end of a document.
- *
- * <p><strong>There is an apparent contradiction between the
- * documentation for this method and the documentation for {@link
- * org.xml.sax.ErrorHandler#fatalError}. Until this ambiguity is
- * resolved in a future major release, clients should make no
- * assumptions about whether endDocument() will or will not be
- * invoked when the parser has reported a fatalError() or thrown
- * an exception.</strong></p>
- *
- * <p>The SAX parser will invoke this method only once, and it will
- * be the last method invoked during the parse. The parser shall
- * not invoke this method until it has either abandoned parsing
- * (because of an unrecoverable error) or reached the end of
- * input.</p>
- *
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- * @see #startDocument
- */
- public void endDocument()
- throws SAXException;
-
-
- /**
- * Begin the scope of a prefix-URI Namespace mapping.
- *
- * <p>The information from this event is not necessary for
- * normal Namespace processing: the SAX XML reader will
- * automatically replace prefixes for element and attribute
- * names when the <code>http://xml.org/sax/features/namespaces</code>
- * feature is <var>true</var> (the default).</p>
- *
- * <p>There are cases, however, when applications need to
- * use prefixes in character data or in attribute values,
- * where they cannot safely be expanded automatically; the
- * start/endPrefixMapping event supplies the information
- * to the application to expand prefixes in those contexts
- * itself, if necessary.</p>
- *
- * <p>Note that start/endPrefixMapping events are not
- * guaranteed to be properly nested relative to each other:
- * all startPrefixMapping events will occur immediately before the
- * corresponding {@link #startElement startElement} event,
- * and all {@link #endPrefixMapping endPrefixMapping}
- * events will occur immediately after the corresponding
- * {@link #endElement endElement} event,
- * but their order is not otherwise
- * guaranteed.</p>
- *
- * <p>There should never be start/endPrefixMapping events for the
- * "xml" prefix, since it is predeclared and immutable.</p>
- *
- * @param prefix the Namespace prefix being declared.
- * An empty string is used for the default element namespace,
- * which has no prefix.
- * @param uri the Namespace URI the prefix is mapped to
- * @throws org.xml.sax.SAXException the client may throw
- * an exception during processing
- * @see #endPrefixMapping
- * @see #startElement
- */
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException;
-
-
- /**
- * End the scope of a prefix-URI mapping.
- *
- * <p>See {@link #startPrefixMapping startPrefixMapping} for
- * details. These events will always occur immediately after the
- * corresponding {@link #endElement endElement} event, but the order of
- * {@link #endPrefixMapping endPrefixMapping} events is not otherwise
- * guaranteed.</p>
- *
- * @param prefix the prefix that was being mapped.
- * This is the empty string when a default mapping scope ends.
- * @throws org.xml.sax.SAXException the client may throw
- * an exception during processing
- * @see #startPrefixMapping
- * @see #endElement
- */
- public void endPrefixMapping (String prefix)
- throws SAXException;
-
-
- /**
- * Receive notification of the beginning of an element.
- *
- * <p>The Parser will invoke this method at the beginning of every
- * element in the XML document; there will be a corresponding
- * {@link #endElement endElement} event for every startElement event
- * (even when the element is empty). All of the element's content will be
- * reported, in order, before the corresponding endElement
- * event.</p>
- *
- * <p>This event allows up to three name components for each
- * element:</p>
- *
- * <ol>
- * <li>the Namespace URI;</li>
- * <li>the local name; and</li>
- * <li>the qualified (prefixed) name.</li>
- * </ol>
- *
- * <p>Any or all of these may be provided, depending on the
- * values of the <var>http://xml.org/sax/features/namespaces</var>
- * and the <var>http://xml.org/sax/features/namespace-prefixes</var>
- * properties:</p>
- *
- * <ul>
- * <li>the Namespace URI and local name are required when
- * the namespaces property is <var>true</var> (the default), and are
- * optional when the namespaces property is <var>false</var> (if one is
- * specified, both must be);</li>
- * <li>the qualified name is required when the namespace-prefixes property
- * is <var>true</var>, and is optional when the namespace-prefixes property
- * is <var>false</var> (the default).</li>
- * </ul>
- *
- * <p>Note that the attribute list provided will contain only
- * attributes with explicit values (specified or defaulted):
- * #IMPLIED attributes will be omitted. The attribute list
- * will contain attributes used for Namespace declarations
- * (xmlns* attributes) only if the
- * <code>http://xml.org/sax/features/namespace-prefixes</code>
- * property is true (it is false by default, and support for a
- * true value is optional).</p>
- *
- * <p>Like {@link #characters characters()}, attribute values may have
- * characters that need more than one <code>char</code> value. </p>
- *
- * @param uri the Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed
- * @param localName the local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed
- * @param qName the qualified name (with prefix), or the
- * empty string if qualified names are not available
- * @param atts the attributes attached to the element. If
- * there are no attributes, it shall be an empty
- * Attributes object. The value of this object after
- * startElement returns is undefined
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- * @see #endElement
- * @see org.xml.sax.Attributes
- * @see org.xml.sax.helpers.AttributesImpl
- */
- public void startElement (String uri, String localName,
- String qName, Attributes atts)
- throws SAXException;
-
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>The SAX parser will invoke this method at the end of every
- * element in the XML document; there will be a corresponding
- * {@link #startElement startElement} event for every endElement
- * event (even when the element is empty).</p>
- *
- * <p>For information on the names, see startElement.</p>
- *
- * @param uri the Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed
- * @param localName the local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed
- * @param qName the qualified XML name (with prefix), or the
- * empty string if qualified names are not available
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- */
- public void endElement (String uri, String localName,
- String qName)
- throws SAXException;
-
-
- /**
- * Receive notification of character data.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Individual characters may consist of more than one Java
- * <code>char</code> value. There are two important cases where this
- * happens, because characters can't be represented in just sixteen bits.
- * In one case, characters are represented in a <em>Surrogate Pair</em>,
- * using two special Unicode values. Such characters are in the so-called
- * "Astral Planes", with a code point above U+FFFF. A second case involves
- * composite characters, such as a base character combining with one or
- * more accent characters. </p>
- *
- * <p> Your code should not assume that algorithms using
- * <code>char</code>-at-a-time idioms will be working in character
- * units; in some cases they will split characters. This is relevant
- * wherever XML permits arbitrary characters, such as attribute values,
- * processing instruction data, and comments as well as in data reported
- * from this method. It's also generally relevant whenever Java code
- * manipulates internationalized text; the issue isn't unique to XML.</p>
- *
- * <p>Note that some parsers will report whitespace in element
- * content using the {@link #ignorableWhitespace ignorableWhitespace}
- * method rather than this one (validating parsers <em>must</em>
- * do so).</p>
- *
- * @param ch the characters from the XML document
- * @param start the start position in the array
- * @param length the number of characters to read from the array
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- */
- public void characters (char ch[], int start, int length)
- throws SAXException;
-
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>Validating Parsers must use this method to report each chunk
- * of whitespace in element content (see the W3C XML 1.0
- * recommendation, section 2.10): non-validating parsers may also
- * use this method if they are capable of parsing and using
- * content models.</p>
- *
- * <p>SAX parsers may return all contiguous whitespace in a single
- * chunk, or they may split it into several chunks; however, all of
- * the characters in any single event must come from the same
- * external entity, so that the Locator provides useful
- * information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * @param ch the characters from the XML document
- * @param start the start position in the array
- * @param length the number of characters to read from the array
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- * @see #characters
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException;
-
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>The Parser will invoke this method once for each processing
- * instruction found: note that processing instructions may occur
- * before or after the main document element.</p>
- *
- * <p>A SAX parser must never report an XML declaration (XML 1.0,
- * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
- * using this method.</p>
- *
- * <p>Like {@link #characters characters()}, processing instruction
- * data may have characters that need more than one <code>char</code>
- * value. </p>
- *
- * @param target the processing instruction target
- * @param data the processing instruction data, or null if
- * none was supplied. The data does not include any
- * whitespace separating it from the target
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- */
- public void processingInstruction (String target, String data)
- throws SAXException;
-
-
- /**
- * Receive notification of a skipped entity.
- * This is not called for entity references within markup constructs
- * such as element start tags or markup declarations. (The XML
- * recommendation requires reporting skipped external entities.
- * SAX also reports internal entity expansion/non-expansion, except
- * within markup constructs.)
- *
- * <p>The Parser will invoke this method each time the entity is
- * skipped. Non-validating processors may skip entities if they
- * have not seen the declarations (because, for example, the
- * entity was declared in an external DTD subset). All processors
- * may skip external entities, depending on the values of the
- * <code>http://xml.org/sax/features/external-general-entities</code>
- * and the
- * <code>http://xml.org/sax/features/external-parameter-entities</code>
- * properties.</p>
- *
- * @param name the name of the skipped entity. If it is a
- * parameter entity, the name will begin with '%', and if
- * it is the external DTD subset, it will be the string
- * "[dtd]"
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- */
- public void skippedEntity (String name)
- throws SAXException;
-}
-
-// end of ContentHandler.java
diff --git a/libjava/external/sax/org/xml/sax/DTDHandler.java b/libjava/external/sax/org/xml/sax/DTDHandler.java
deleted file mode 100644
index f894298cded..00000000000
--- a/libjava/external/sax/org/xml/sax/DTDHandler.java
+++ /dev/null
@@ -1,117 +0,0 @@
-// SAX DTD handler.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: DTDHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-/**
- * Receive notification of basic DTD-related events.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>If a SAX application needs information about notations and
- * unparsed entities, then the application implements this
- * interface and registers an instance with the SAX parser using
- * the parser's setDTDHandler method. The parser uses the
- * instance to report notation and unparsed entity declarations to
- * the application.</p>
- *
- * <p>Note that this interface includes only those DTD events that
- * the XML recommendation <em>requires</em> processors to report:
- * notation and unparsed entity declarations.</p>
- *
- * <p>The SAX parser may report these events in any order, regardless
- * of the order in which the notations and unparsed entities were
- * declared; however, all DTD events must be reported after the
- * document handler's startDocument event, and before the first
- * startElement event.
- * (If the {@link org.xml.sax.ext.LexicalHandler LexicalHandler} is
- * used, these events must also be reported before the endDTD event.)
- * </p>
- *
- * <p>It is up to the application to store the information for
- * future use (perhaps in a hash table or object tree).
- * If the application encounters attributes of type "NOTATION",
- * "ENTITY", or "ENTITIES", it can use the information that it
- * obtained through this interface to find the entity and/or
- * notation corresponding with the attribute value.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.XMLReader#setDTDHandler
- */
-public interface DTDHandler {
-
-
- /**
- * Receive notification of a notation declaration event.
- *
- * <p>It is up to the application to record the notation for later
- * reference, if necessary;
- * notations may appear as attribute values and in unparsed entity
- * declarations, and are sometime used with processing instruction
- * target names.</p>
- *
- * <p>At least one of publicId and systemId must be non-null.
- * If a system identifier is present, and it is a URL, the SAX
- * parser must resolve it fully before passing it to the
- * application through this event.</p>
- *
- * <p>There is no guarantee that the notation declaration will be
- * reported before any unparsed entities that use it.</p>
- *
- * @param name The notation name.
- * @param publicId The notation's public identifier, or null if
- * none was given.
- * @param systemId The notation's system identifier, or null if
- * none was given.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #unparsedEntityDecl
- * @see org.xml.sax.Attributes
- */
- public abstract void notationDecl (String name,
- String publicId,
- String systemId)
- throws SAXException;
-
-
- /**
- * Receive notification of an unparsed entity declaration event.
- *
- * <p>Note that the notation name corresponds to a notation
- * reported by the {@link #notationDecl notationDecl} event.
- * It is up to the application to record the entity for later
- * reference, if necessary;
- * unparsed entities may appear as attribute values.
- * </p>
- *
- * <p>If the system identifier is a URL, the parser must resolve it
- * fully before passing it to the application.</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @param name The unparsed entity's name.
- * @param publicId The entity's public identifier, or null if none
- * was given.
- * @param systemId The entity's system identifier.
- * @param notationName The name of the associated notation.
- * @see #notationDecl
- * @see org.xml.sax.Attributes
- */
- public abstract void unparsedEntityDecl (String name,
- String publicId,
- String systemId,
- String notationName)
- throws SAXException;
-
-}
-
-// end of DTDHandler.java
diff --git a/libjava/external/sax/org/xml/sax/DocumentHandler.java b/libjava/external/sax/org/xml/sax/DocumentHandler.java
deleted file mode 100644
index 08429b6bcf4..00000000000
--- a/libjava/external/sax/org/xml/sax/DocumentHandler.java
+++ /dev/null
@@ -1,232 +0,0 @@
-// SAX document handler.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: DocumentHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-/**
- * Receive notification of general document events.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This was the main event-handling interface for SAX1; in
- * SAX2, it has been replaced by {@link org.xml.sax.ContentHandler
- * ContentHandler}, which provides Namespace support and reporting
- * of skipped entities. This interface is included in SAX2 only
- * to support legacy SAX1 applications.</p>
- *
- * <p>The order of events in this interface is very important, and
- * mirrors the order of information in the document itself. For
- * example, all of an element's content (character data, processing
- * instructions, and/or subelements) will appear, in order, between
- * the startElement event and the corresponding endElement event.</p>
- *
- * <p>Application writers who do not want to implement the entire
- * interface can derive a class from HandlerBase, which implements
- * the default functionality; parser writers can instantiate
- * HandlerBase to obtain a default handler. The application can find
- * the location of any document event using the Locator interface
- * supplied by the Parser through the setDocumentLocator method.</p>
- *
- * @deprecated This interface has been replaced by the SAX2
- * {@link org.xml.sax.ContentHandler ContentHandler}
- * interface, which includes Namespace support.
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.Parser#setDocumentHandler
- * @see org.xml.sax.Locator
- * @see org.xml.sax.HandlerBase
- */
-public interface DocumentHandler {
-
-
- /**
- * Receive an object for locating the origin of SAX document events.
- *
- * <p>SAX parsers are strongly encouraged (though not absolutely
- * required) to supply a locator: if it does so, it must supply
- * the locator to the application by invoking this method before
- * invoking any of the other methods in the DocumentHandler
- * interface.</p>
- *
- * <p>The locator allows the application to determine the end
- * position of any document-related event, even if the parser is
- * not reporting an error. Typically, the application will
- * use this information for reporting its own errors (such as
- * character content that does not match an application's
- * business rules). The information returned by the locator
- * is probably not sufficient for use with a search engine.</p>
- *
- * <p>Note that the locator will return correct information only
- * during the invocation of the events in this interface. The
- * application should not attempt to use it at any other time.</p>
- *
- * @param locator An object that can return the location of
- * any SAX document event.
- * @see org.xml.sax.Locator
- */
- public abstract void setDocumentLocator (Locator locator);
-
-
- /**
- * Receive notification of the beginning of a document.
- *
- * <p>The SAX parser will invoke this method only once, before any
- * other methods in this interface or in DTDHandler (except for
- * setDocumentLocator).</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public abstract void startDocument ()
- throws SAXException;
-
-
- /**
- * Receive notification of the end of a document.
- *
- * <p>The SAX parser will invoke this method only once, and it will
- * be the last method invoked during the parse. The parser shall
- * not invoke this method until it has either abandoned parsing
- * (because of an unrecoverable error) or reached the end of
- * input.</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public abstract void endDocument ()
- throws SAXException;
-
-
- /**
- * Receive notification of the beginning of an element.
- *
- * <p>The Parser will invoke this method at the beginning of every
- * element in the XML document; there will be a corresponding
- * endElement() event for every startElement() event (even when the
- * element is empty). All of the element's content will be
- * reported, in order, before the corresponding endElement()
- * event.</p>
- *
- * <p>If the element name has a namespace prefix, the prefix will
- * still be attached. Note that the attribute list provided will
- * contain only attributes with explicit values (specified or
- * defaulted): #IMPLIED attributes will be omitted.</p>
- *
- * @param name The element type name.
- * @param atts The attributes attached to the element, if any.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #endElement
- * @see org.xml.sax.AttributeList
- */
- public abstract void startElement (String name, AttributeList atts)
- throws SAXException;
-
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>The SAX parser will invoke this method at the end of every
- * element in the XML document; there will be a corresponding
- * startElement() event for every endElement() event (even when the
- * element is empty).</p>
- *
- * <p>If the element name has a namespace prefix, the prefix will
- * still be attached to the name.</p>
- *
- * @param name The element type name
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public abstract void endElement (String name)
- throws SAXException;
-
-
- /**
- * Receive notification of character data.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- */
- public abstract void characters (char ch[], int start, int length)
- throws SAXException;
-
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>Validating Parsers must use this method to report each chunk
- * of ignorable whitespace (see the W3C XML 1.0 recommendation,
- * section 2.10): non-validating parsers may also use this method
- * if they are capable of parsing and using content models.</p>
- *
- * <p>SAX parsers may return all contiguous whitespace in a single
- * chunk, or they may split it into several chunks; however, all of
- * the characters in any single event must come from the same
- * external entity, so that the Locator provides useful
- * information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #characters
- */
- public abstract void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException;
-
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>The Parser will invoke this method once for each processing
- * instruction found: note that processing instructions may occur
- * before or after the main document element.</p>
- *
- * <p>A SAX parser should never report an XML declaration (XML 1.0,
- * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
- * using this method.</p>
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none was supplied.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public abstract void processingInstruction (String target, String data)
- throws SAXException;
-
-}
-
-// end of DocumentHandler.java
diff --git a/libjava/external/sax/org/xml/sax/EntityResolver.java b/libjava/external/sax/org/xml/sax/EntityResolver.java
deleted file mode 100644
index e240ba14b48..00000000000
--- a/libjava/external/sax/org/xml/sax/EntityResolver.java
+++ /dev/null
@@ -1,119 +0,0 @@
-// SAX entity resolver.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: EntityResolver.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-import java.io.IOException;
-
-
-/**
- * Basic interface for resolving entities.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>If a SAX application needs to implement customized handling
- * for external entities, it must implement this interface and
- * register an instance with the SAX driver using the
- * {@link org.xml.sax.XMLReader#setEntityResolver setEntityResolver}
- * method.</p>
- *
- * <p>The XML reader will then allow the application to intercept any
- * external entities (including the external DTD subset and external
- * parameter entities, if any) before including them.</p>
- *
- * <p>Many SAX applications will not need to implement this interface,
- * but it will be especially useful for applications that build
- * XML documents from databases or other specialised input sources,
- * or for applications that use URI types other than URLs.</p>
- *
- * <p>The following resolver would provide the application
- * with a special character stream for the entity with the system
- * identifier "http://www.myhost.com/today":</p>
- *
- * <pre>
- * import org.xml.sax.EntityResolver;
- * import org.xml.sax.InputSource;
- *
- * public class MyResolver implements EntityResolver {
- * public InputSource resolveEntity (String publicId, String systemId)
- * {
- * if (systemId.equals("http://www.myhost.com/today")) {
- * // return a special input source
- * MyReader reader = new MyReader();
- * return new InputSource(reader);
- * } else {
- * // use the default behaviour
- * return null;
- * }
- * }
- * }
- * </pre>
- *
- * <p>The application can also use this interface to redirect system
- * identifiers to local URIs or to look up replacements in a catalog
- * (possibly by using the public identifier).</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.XMLReader#setEntityResolver
- * @see org.xml.sax.InputSource
- */
-public interface EntityResolver {
-
-
- /**
- * Allow the application to resolve external entities.
- *
- * <p>The parser will call this method before opening any external
- * entity except the top-level document entity. Such entities include
- * the external DTD subset and external parameter entities referenced
- * within the DTD (in either case, only if the parser reads external
- * parameter entities), and external general entities referenced
- * within the document element (if the parser reads external general
- * entities). The application may request that the parser locate
- * the entity itself, that it use an alternative URI, or that it
- * use data provided by the application (as a character or byte
- * input stream).</p>
- *
- * <p>Application writers can use this method to redirect external
- * system identifiers to secure and/or local URIs, to look up
- * public identifiers in a catalogue, or to read an entity from a
- * database or other input source (including, for example, a dialog
- * box). Neither XML nor SAX specifies a preferred policy for using
- * public or system IDs to resolve resources. However, SAX specifies
- * how to interpret any InputSource returned by this method, and that
- * if none is returned, then the system ID will be dereferenced as
- * a URL. </p>
- *
- * <p>If the system identifier is a URL, the SAX parser must
- * resolve it fully before reporting it to the application.</p>
- *
- * @param publicId The public identifier of the external entity
- * being referenced, or null if none was supplied.
- * @param systemId The system identifier of the external entity
- * being referenced.
- * @return An InputSource object describing the new input source,
- * or null to request that the parser open a regular
- * URI connection to the system identifier.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException A Java-specific IO exception,
- * possibly the result of creating a new InputStream
- * or Reader for the InputSource.
- * @see org.xml.sax.InputSource
- */
- public abstract InputSource resolveEntity (String publicId,
- String systemId)
- throws SAXException, IOException;
-
-}
-
-// end of EntityResolver.java
diff --git a/libjava/external/sax/org/xml/sax/ErrorHandler.java b/libjava/external/sax/org/xml/sax/ErrorHandler.java
deleted file mode 100644
index 5ebe3926321..00000000000
--- a/libjava/external/sax/org/xml/sax/ErrorHandler.java
+++ /dev/null
@@ -1,139 +0,0 @@
-// SAX error handler.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: ErrorHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-
-/**
- * Basic interface for SAX error handlers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>If a SAX application needs to implement customized error
- * handling, it must implement this interface and then register an
- * instance with the XML reader using the
- * {@link org.xml.sax.XMLReader#setErrorHandler setErrorHandler}
- * method. The parser will then report all errors and warnings
- * through this interface.</p>
- *
- * <p><strong>WARNING:</strong> If an application does <em>not</em>
- * register an ErrorHandler, XML parsing errors will go unreported,
- * except that <em>SAXParseException</em>s will be thrown for fatal errors.
- * In order to detect validity errors, an ErrorHandler that does something
- * with {@link #error error()} calls must be registered.</p>
- *
- * <p>For XML processing errors, a SAX driver must use this interface
- * in preference to throwing an exception: it is up to the application
- * to decide whether to throw an exception for different types of
- * errors and warnings. Note, however, that there is no requirement that
- * the parser continue to report additional errors after a call to
- * {@link #fatalError fatalError}. In other words, a SAX driver class
- * may throw an exception after reporting any fatalError.
- * Also parsers may throw appropriate exceptions for non-XML errors.
- * For example, {@link XMLReader#parse XMLReader.parse()} would throw
- * an IOException for errors accessing entities or the document.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1+ (sax2r3pre1)
- * @see org.xml.sax.XMLReader#setErrorHandler
- * @see org.xml.sax.SAXParseException
- */
-public interface ErrorHandler {
-
-
- /**
- * Receive notification of a warning.
- *
- * <p>SAX parsers will use this method to report conditions that
- * are not errors or fatal errors as defined by the XML
- * recommendation. The default behaviour is to take no
- * action.</p>
- *
- * <p>The SAX parser must continue to provide normal parsing events
- * after invoking this method: it should still be possible for the
- * application to process the document through to the end.</p>
- *
- * <p>Filters may use this method to report other, non-XML warnings
- * as well.</p>
- *
- * @param exception The warning information encapsulated in a
- * SAX parse exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.SAXParseException
- */
- public abstract void warning (SAXParseException exception)
- throws SAXException;
-
-
- /**
- * Receive notification of a recoverable error.
- *
- * <p>This corresponds to the definition of "error" in section 1.2
- * of the W3C XML 1.0 Recommendation. For example, a validating
- * parser would use this callback to report the violation of a
- * validity constraint. The default behaviour is to take no
- * action.</p>
- *
- * <p>The SAX parser must continue to provide normal parsing
- * events after invoking this method: it should still be possible
- * for the application to process the document through to the end.
- * If the application cannot do so, then the parser should report
- * a fatal error even if the XML recommendation does not require
- * it to do so.</p>
- *
- * <p>Filters may use this method to report other, non-XML errors
- * as well.</p>
- *
- * @param exception The error information encapsulated in a
- * SAX parse exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.SAXParseException
- */
- public abstract void error (SAXParseException exception)
- throws SAXException;
-
-
- /**
- * Receive notification of a non-recoverable error.
- *
- * <p><strong>There is an apparent contradiction between the
- * documentation for this method and the documentation for {@link
- * org.xml.sax.ContentHandler#endDocument}. Until this ambiguity
- * is resolved in a future major release, clients should make no
- * assumptions about whether endDocument() will or will not be
- * invoked when the parser has reported a fatalError() or thrown
- * an exception.</strong></p>
- *
- * <p>This corresponds to the definition of "fatal error" in
- * section 1.2 of the W3C XML 1.0 Recommendation. For example, a
- * parser would use this callback to report the violation of a
- * well-formedness constraint.</p>
- *
- * <p>The application must assume that the document is unusable
- * after the parser has invoked this method, and should continue
- * (if at all) only for the sake of collecting additional error
- * messages: in fact, SAX parsers are free to stop reporting any
- * other events once this method has been invoked.</p>
- *
- * @param exception The error information encapsulated in a
- * SAX parse exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.SAXParseException
- */
- public abstract void fatalError (SAXParseException exception)
- throws SAXException;
-
-}
-
-// end of ErrorHandler.java
diff --git a/libjava/external/sax/org/xml/sax/HandlerBase.java b/libjava/external/sax/org/xml/sax/HandlerBase.java
deleted file mode 100644
index 7d6ce73616a..00000000000
--- a/libjava/external/sax/org/xml/sax/HandlerBase.java
+++ /dev/null
@@ -1,369 +0,0 @@
-// SAX default handler base class.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: HandlerBase.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-/**
- * Default base class for handlers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class implements the default behaviour for four SAX1
- * interfaces: EntityResolver, DTDHandler, DocumentHandler,
- * and ErrorHandler. It is now obsolete, but is included in SAX2 to
- * support legacy SAX1 applications. SAX2 applications should use
- * the {@link org.xml.sax.helpers.DefaultHandler DefaultHandler}
- * class instead.</p>
- *
- * <p>Application writers can extend this class when they need to
- * implement only part of an interface; parser writers can
- * instantiate this class to provide default handlers when the
- * application has not supplied its own.</p>
- *
- * <p>Note that the use of this class is optional.</p>
- *
- * @deprecated This class works with the deprecated
- * {@link org.xml.sax.DocumentHandler DocumentHandler}
- * interface. It has been replaced by the SAX2
- * {@link org.xml.sax.helpers.DefaultHandler DefaultHandler}
- * class.
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.EntityResolver
- * @see org.xml.sax.DTDHandler
- * @see org.xml.sax.DocumentHandler
- * @see org.xml.sax.ErrorHandler
- */
-public class HandlerBase
- implements EntityResolver, DTDHandler, DocumentHandler, ErrorHandler
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of the EntityResolver interface.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Resolve an external entity.
- *
- * <p>Always return null, so that the parser will use the system
- * identifier provided in the XML document. This method implements
- * the SAX default behaviour: application writers can override it
- * in a subclass to do special translations such as catalog lookups
- * or URI redirection.</p>
- *
- * @param publicId The public identifer, or null if none is
- * available.
- * @param systemId The system identifier provided in the XML
- * document.
- * @return The new input source, or null to require the
- * default behaviour.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.EntityResolver#resolveEntity
- */
- public InputSource resolveEntity (String publicId, String systemId)
- throws SAXException
- {
- return null;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of DTDHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive notification of a notation declaration.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass if they wish to keep track of the notations
- * declared in a document.</p>
- *
- * @param name The notation name.
- * @param publicId The notation public identifier, or null if not
- * available.
- * @param systemId The notation system identifier.
- * @see org.xml.sax.DTDHandler#notationDecl
- */
- public void notationDecl (String name, String publicId, String systemId)
- {
- // no op
- }
-
-
- /**
- * Receive notification of an unparsed entity declaration.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to keep track of the unparsed entities
- * declared in a document.</p>
- *
- * @param name The entity name.
- * @param publicId The entity public identifier, or null if not
- * available.
- * @param systemId The entity system identifier.
- * @param notationName The name of the associated notation.
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public void unparsedEntityDecl (String name, String publicId,
- String systemId, String notationName)
- {
- // no op
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of DocumentHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive a Locator object for document events.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass if they wish to store the locator for use
- * with other document events.</p>
- *
- * @param locator A locator for all SAX document events.
- * @see org.xml.sax.DocumentHandler#setDocumentLocator
- * @see org.xml.sax.Locator
- */
- public void setDocumentLocator (Locator locator)
- {
- // no op
- }
-
-
- /**
- * Receive notification of the beginning of the document.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the beginning
- * of a document (such as allocating the root node of a tree or
- * creating an output file).</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#startDocument
- */
- public void startDocument ()
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the end of the document.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the beginning
- * of a document (such as finalising a tree or closing an output
- * file).</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#endDocument
- */
- public void endDocument ()
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the start of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the start of
- * each element (such as allocating a new tree node or writing
- * output to a file).</p>
- *
- * @param name The element type name.
- * @param attributes The specified or defaulted attributes.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#startElement
- */
- public void startElement (String name, AttributeList attributes)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end of
- * each element (such as finalising a tree node or writing
- * output to a file).</p>
- *
- * @param name the element name
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#endElement
- */
- public void endElement (String name)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of character data inside an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method to take specific actions for each chunk of character data
- * (such as adding the data to a node or buffer, or printing it to
- * a file).</p>
- *
- * @param ch The characters.
- * @param start The start position in the character array.
- * @param length The number of characters to use from the
- * character array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#characters
- */
- public void characters (char ch[], int start, int length)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>By default, do nothing. Application writers may override this
- * method to take specific actions for each chunk of ignorable
- * whitespace (such as adding data to a node or buffer, or printing
- * it to a file).</p>
- *
- * @param ch The whitespace characters.
- * @param start The start position in the character array.
- * @param length The number of characters to use from the
- * character array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#ignorableWhitespace
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions for each
- * processing instruction, such as setting status variables or
- * invoking other methods.</p>
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none is supplied.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#processingInstruction
- */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- // no op
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of the ErrorHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive notification of a parser warning.
- *
- * <p>The default implementation does nothing. Application writers
- * may override this method in a subclass to take specific actions
- * for each warning, such as inserting the message in a log file or
- * printing it to the console.</p>
- *
- * @param e The warning information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#warning
- * @see org.xml.sax.SAXParseException
- */
- public void warning (SAXParseException e)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of a recoverable parser error.
- *
- * <p>The default implementation does nothing. Application writers
- * may override this method in a subclass to take specific actions
- * for each error, such as inserting the message in a log file or
- * printing it to the console.</p>
- *
- * @param e The warning information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#warning
- * @see org.xml.sax.SAXParseException
- */
- public void error (SAXParseException e)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Report a fatal XML parsing error.
- *
- * <p>The default implementation throws a SAXParseException.
- * Application writers may override this method in a subclass if
- * they need to take specific actions for each fatal error (such as
- * collecting all of the errors into a single report): in any case,
- * the application must stop all regular processing when this
- * method is invoked, since the document is no longer reliable, and
- * the parser may no longer report parsing events.</p>
- *
- * @param e The error information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#fatalError
- * @see org.xml.sax.SAXParseException
- */
- public void fatalError (SAXParseException e)
- throws SAXException
- {
- throw e;
- }
-
-}
-
-// end of HandlerBase.java
diff --git a/libjava/external/sax/org/xml/sax/InputSource.java b/libjava/external/sax/org/xml/sax/InputSource.java
deleted file mode 100644
index 3737b63712d..00000000000
--- a/libjava/external/sax/org/xml/sax/InputSource.java
+++ /dev/null
@@ -1,336 +0,0 @@
-// SAX input source.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: InputSource.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-import java.io.Reader;
-import java.io.InputStream;
-
-/**
- * A single input source for an XML entity.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class allows a SAX application to encapsulate information
- * about an input source in a single object, which may include
- * a public identifier, a system identifier, a byte stream (possibly
- * with a specified encoding), and/or a character stream.</p>
- *
- * <p>There are two places that the application can deliver an
- * input source to the parser: as the argument to the Parser.parse
- * method, or as the return value of the EntityResolver.resolveEntity
- * method.</p>
- *
- * <p>The SAX parser will use the InputSource object to determine how
- * to read XML input. If there is a character stream available, the
- * parser will read that stream directly, disregarding any text
- * encoding declaration found in that stream.
- * If there is no character stream, but there is
- * a byte stream, the parser will use that byte stream, using the
- * encoding specified in the InputSource or else (if no encoding is
- * specified) autodetecting the character encoding using an algorithm
- * such as the one in the XML specification. If neither a character
- * stream nor a
- * byte stream is available, the parser will attempt to open a URI
- * connection to the resource identified by the system
- * identifier.</p>
- *
- * <p>An InputSource object belongs to the application: the SAX parser
- * shall never modify it in any way (it may modify a copy if
- * necessary). However, standard processing of both byte and
- * character streams is to close them on as part of end-of-parse cleanup,
- * so applications should not attempt to re-use such streams after they
- * have been handed to a parser. </p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.XMLReader#parse(org.xml.sax.InputSource)
- * @see org.xml.sax.EntityResolver#resolveEntity
- * @see java.io.InputStream
- * @see java.io.Reader
- */
-public class InputSource {
-
- /**
- * Zero-argument default constructor.
- *
- * @see #setPublicId
- * @see #setSystemId
- * @see #setByteStream
- * @see #setCharacterStream
- * @see #setEncoding
- */
- public InputSource ()
- {
- }
-
-
- /**
- * Create a new input source with a system identifier.
- *
- * <p>Applications may use setPublicId to include a
- * public identifier as well, or setEncoding to specify
- * the character encoding, if known.</p>
- *
- * <p>If the system identifier is a URL, it must be fully
- * resolved (it may not be a relative URL).</p>
- *
- * @param systemId The system identifier (URI).
- * @see #setPublicId
- * @see #setSystemId
- * @see #setByteStream
- * @see #setEncoding
- * @see #setCharacterStream
- */
- public InputSource (String systemId)
- {
- setSystemId(systemId);
- }
-
-
- /**
- * Create a new input source with a byte stream.
- *
- * <p>Application writers should use setSystemId() to provide a base
- * for resolving relative URIs, may use setPublicId to include a
- * public identifier, and may use setEncoding to specify the object's
- * character encoding.</p>
- *
- * @param byteStream The raw byte stream containing the document.
- * @see #setPublicId
- * @see #setSystemId
- * @see #setEncoding
- * @see #setByteStream
- * @see #setCharacterStream
- */
- public InputSource (InputStream byteStream)
- {
- setByteStream(byteStream);
- }
-
-
- /**
- * Create a new input source with a character stream.
- *
- * <p>Application writers should use setSystemId() to provide a base
- * for resolving relative URIs, and may use setPublicId to include a
- * public identifier.</p>
- *
- * <p>The character stream shall not include a byte order mark.</p>
- *
- * @see #setPublicId
- * @see #setSystemId
- * @see #setByteStream
- * @see #setCharacterStream
- */
- public InputSource (Reader characterStream)
- {
- setCharacterStream(characterStream);
- }
-
-
- /**
- * Set the public identifier for this input source.
- *
- * <p>The public identifier is always optional: if the application
- * writer includes one, it will be provided as part of the
- * location information.</p>
- *
- * @param publicId The public identifier as a string.
- * @see #getPublicId
- * @see org.xml.sax.Locator#getPublicId
- * @see org.xml.sax.SAXParseException#getPublicId
- */
- public void setPublicId (String publicId)
- {
- this.publicId = publicId;
- }
-
-
- /**
- * Get the public identifier for this input source.
- *
- * @return The public identifier, or null if none was supplied.
- * @see #setPublicId
- */
- public String getPublicId ()
- {
- return publicId;
- }
-
-
- /**
- * Set the system identifier for this input source.
- *
- * <p>The system identifier is optional if there is a byte stream
- * or a character stream, but it is still useful to provide one,
- * since the application can use it to resolve relative URIs
- * and can include it in error messages and warnings (the parser
- * will attempt to open a connection to the URI only if
- * there is no byte stream or character stream specified).</p>
- *
- * <p>If the application knows the character encoding of the
- * object pointed to by the system identifier, it can register
- * the encoding using the setEncoding method.</p>
- *
- * <p>If the system identifier is a URL, it must be fully
- * resolved (it may not be a relative URL).</p>
- *
- * @param systemId The system identifier as a string.
- * @see #setEncoding
- * @see #getSystemId
- * @see org.xml.sax.Locator#getSystemId
- * @see org.xml.sax.SAXParseException#getSystemId
- */
- public void setSystemId (String systemId)
- {
- this.systemId = systemId;
- }
-
-
- /**
- * Get the system identifier for this input source.
- *
- * <p>The getEncoding method will return the character encoding
- * of the object pointed to, or null if unknown.</p>
- *
- * <p>If the system ID is a URL, it will be fully resolved.</p>
- *
- * @return The system identifier, or null if none was supplied.
- * @see #setSystemId
- * @see #getEncoding
- */
- public String getSystemId ()
- {
- return systemId;
- }
-
-
- /**
- * Set the byte stream for this input source.
- *
- * <p>The SAX parser will ignore this if there is also a character
- * stream specified, but it will use a byte stream in preference
- * to opening a URI connection itself.</p>
- *
- * <p>If the application knows the character encoding of the
- * byte stream, it should set it with the setEncoding method.</p>
- *
- * @param byteStream A byte stream containing an XML document or
- * other entity.
- * @see #setEncoding
- * @see #getByteStream
- * @see #getEncoding
- * @see java.io.InputStream
- */
- public void setByteStream (InputStream byteStream)
- {
- this.byteStream = byteStream;
- }
-
-
- /**
- * Get the byte stream for this input source.
- *
- * <p>The getEncoding method will return the character
- * encoding for this byte stream, or null if unknown.</p>
- *
- * @return The byte stream, or null if none was supplied.
- * @see #getEncoding
- * @see #setByteStream
- */
- public InputStream getByteStream ()
- {
- return byteStream;
- }
-
-
- /**
- * Set the character encoding, if known.
- *
- * <p>The encoding must be a string acceptable for an
- * XML encoding declaration (see section 4.3.3 of the XML 1.0
- * recommendation).</p>
- *
- * <p>This method has no effect when the application provides a
- * character stream.</p>
- *
- * @param encoding A string describing the character encoding.
- * @see #setSystemId
- * @see #setByteStream
- * @see #getEncoding
- */
- public void setEncoding (String encoding)
- {
- this.encoding = encoding;
- }
-
-
- /**
- * Get the character encoding for a byte stream or URI.
- * This value will be ignored when the application provides a
- * character stream.
- *
- * @return The encoding, or null if none was supplied.
- * @see #setByteStream
- * @see #getSystemId
- * @see #getByteStream
- */
- public String getEncoding ()
- {
- return encoding;
- }
-
-
- /**
- * Set the character stream for this input source.
- *
- * <p>If there is a character stream specified, the SAX parser
- * will ignore any byte stream and will not attempt to open
- * a URI connection to the system identifier.</p>
- *
- * @param characterStream The character stream containing the
- * XML document or other entity.
- * @see #getCharacterStream
- * @see java.io.Reader
- */
- public void setCharacterStream (Reader characterStream)
- {
- this.characterStream = characterStream;
- }
-
-
- /**
- * Get the character stream for this input source.
- *
- * @return The character stream, or null if none was supplied.
- * @see #setCharacterStream
- */
- public Reader getCharacterStream ()
- {
- return characterStream;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- private String publicId;
- private String systemId;
- private InputStream byteStream;
- private String encoding;
- private Reader characterStream;
-
-}
-
-// end of InputSource.java
diff --git a/libjava/external/sax/org/xml/sax/Locator.java b/libjava/external/sax/org/xml/sax/Locator.java
deleted file mode 100644
index 63947df7ac7..00000000000
--- a/libjava/external/sax/org/xml/sax/Locator.java
+++ /dev/null
@@ -1,136 +0,0 @@
-// SAX locator interface for document events.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: Locator.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-
-/**
- * Interface for associating a SAX event with a document location.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>If a SAX parser provides location information to the SAX
- * application, it does so by implementing this interface and then
- * passing an instance to the application using the content
- * handler's {@link org.xml.sax.ContentHandler#setDocumentLocator
- * setDocumentLocator} method. The application can use the
- * object to obtain the location of any other SAX event
- * in the XML source document.</p>
- *
- * <p>Note that the results returned by the object will be valid only
- * during the scope of each callback method: the application
- * will receive unpredictable results if it attempts to use the
- * locator at any other time, or after parsing completes.</p>
- *
- * <p>SAX parsers are not required to supply a locator, but they are
- * very strongly encouraged to do so. If the parser supplies a
- * locator, it must do so before reporting any other document events.
- * If no locator has been set by the time the application receives
- * the {@link org.xml.sax.ContentHandler#startDocument startDocument}
- * event, the application should assume that a locator is not
- * available.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.ContentHandler#setDocumentLocator
- */
-public interface Locator {
-
-
- /**
- * Return the public identifier for the current document event.
- *
- * <p>The return value is the public identifier of the document
- * entity or of the external parsed entity in which the markup
- * triggering the event appears.</p>
- *
- * @return A string containing the public identifier, or
- * null if none is available.
- * @see #getSystemId
- */
- public abstract String getPublicId ();
-
-
- /**
- * Return the system identifier for the current document event.
- *
- * <p>The return value is the system identifier of the document
- * entity or of the external parsed entity in which the markup
- * triggering the event appears.</p>
- *
- * <p>If the system identifier is a URL, the parser must resolve it
- * fully before passing it to the application. For example, a file
- * name must always be provided as a <em>file:...</em> URL, and other
- * kinds of relative URI are also resolved against their bases.</p>
- *
- * @return A string containing the system identifier, or null
- * if none is available.
- * @see #getPublicId
- */
- public abstract String getSystemId ();
-
-
- /**
- * Return the line number where the current document event ends.
- * Lines are delimited by line ends, which are defined in
- * the XML specification.
- *
- * <p><strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of diagnostics;
- * it is not intended to provide sufficient information
- * to edit the character content of the original XML document.
- * In some cases, these "line" numbers match what would be displayed
- * as columns, and in others they may not match the source text
- * due to internal entity expansion. </p>
- *
- * <p>The return value is an approximation of the line number
- * in the document entity or external parsed entity where the
- * markup triggering the event appears.</p>
- *
- * <p>If possible, the SAX driver should provide the line position
- * of the first character after the text associated with the document
- * event. The first line is line 1.</p>
- *
- * @return The line number, or -1 if none is available.
- * @see #getColumnNumber
- */
- public abstract int getLineNumber ();
-
-
- /**
- * Return the column number where the current document event ends.
- * This is one-based number of Java <code>char</code> values since
- * the last line end.
- *
- * <p><strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of diagnostics;
- * it is not intended to provide sufficient information
- * to edit the character content of the original XML document.
- * For example, when lines contain combining character sequences, wide
- * characters, surrogate pairs, or bi-directional text, the value may
- * not correspond to the column in a text editor's display. </p>
- *
- * <p>The return value is an approximation of the column number
- * in the document entity or external parsed entity where the
- * markup triggering the event appears.</p>
- *
- * <p>If possible, the SAX driver should provide the line position
- * of the first character after the text associated with the document
- * event. The first column in each line is column 1.</p>
- *
- * @return The column number, or -1 if none is available.
- * @see #getLineNumber
- */
- public abstract int getColumnNumber ();
-
-}
-
-// end of Locator.java
diff --git a/libjava/external/sax/org/xml/sax/Parser.java b/libjava/external/sax/org/xml/sax/Parser.java
deleted file mode 100644
index 5866eb09ce1..00000000000
--- a/libjava/external/sax/org/xml/sax/Parser.java
+++ /dev/null
@@ -1,209 +0,0 @@
-// SAX parser interface.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: Parser.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-import java.io.IOException;
-import java.util.Locale;
-
-
-/**
- * Basic interface for SAX (Simple API for XML) parsers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This was the main event supplier interface for SAX1; it has
- * been replaced in SAX2 by {@link org.xml.sax.XMLReader XMLReader},
- * which includes Namespace support and sophisticated configurability
- * and extensibility.</p>
- *
- * <p>All SAX1 parsers must implement this basic interface: it allows
- * applications to register handlers for different types of events
- * and to initiate a parse from a URI, or a character stream.</p>
- *
- * <p>All SAX1 parsers must also implement a zero-argument constructor
- * (though other constructors are also allowed).</p>
- *
- * <p>SAX1 parsers are reusable but not re-entrant: the application
- * may reuse a parser object (possibly with a different input source)
- * once the first parse has completed successfully, but it may not
- * invoke the parse() methods recursively within a parse.</p>
- *
- * @deprecated This interface has been replaced by the SAX2
- * {@link org.xml.sax.XMLReader XMLReader}
- * interface, which includes Namespace support.
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.EntityResolver
- * @see org.xml.sax.DTDHandler
- * @see org.xml.sax.DocumentHandler
- * @see org.xml.sax.ErrorHandler
- * @see org.xml.sax.HandlerBase
- * @see org.xml.sax.InputSource
- */
-public interface Parser
-{
-
- /**
- * Allow an application to request a locale for errors and warnings.
- *
- * <p>SAX parsers are not required to provide localisation for errors
- * and warnings; if they cannot support the requested locale,
- * however, they must throw a SAX exception. Applications may
- * not request a locale change in the middle of a parse.</p>
- *
- * @param locale A Java Locale object.
- * @exception org.xml.sax.SAXException Throws an exception
- * (using the previous or default locale) if the
- * requested locale is not supported.
- * @see org.xml.sax.SAXException
- * @see org.xml.sax.SAXParseException
- */
- public abstract void setLocale (Locale locale)
- throws SAXException;
-
-
- /**
- * Allow an application to register a custom entity resolver.
- *
- * <p>If the application does not register an entity resolver, the
- * SAX parser will resolve system identifiers and open connections
- * to entities itself (this is the default behaviour implemented in
- * HandlerBase).</p>
- *
- * <p>Applications may register a new or different entity resolver
- * in the middle of a parse, and the SAX parser must begin using
- * the new resolver immediately.</p>
- *
- * @param resolver The object for resolving entities.
- * @see EntityResolver
- * @see HandlerBase
- */
- public abstract void setEntityResolver (EntityResolver resolver);
-
-
- /**
- * Allow an application to register a DTD event handler.
- *
- * <p>If the application does not register a DTD handler, all DTD
- * events reported by the SAX parser will be silently
- * ignored (this is the default behaviour implemented by
- * HandlerBase).</p>
- *
- * <p>Applications may register a new or different
- * handler in the middle of a parse, and the SAX parser must
- * begin using the new handler immediately.</p>
- *
- * @param handler The DTD handler.
- * @see DTDHandler
- * @see HandlerBase
- */
- public abstract void setDTDHandler (DTDHandler handler);
-
-
- /**
- * Allow an application to register a document event handler.
- *
- * <p>If the application does not register a document handler, all
- * document events reported by the SAX parser will be silently
- * ignored (this is the default behaviour implemented by
- * HandlerBase).</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param handler The document handler.
- * @see DocumentHandler
- * @see HandlerBase
- */
- public abstract void setDocumentHandler (DocumentHandler handler);
-
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error event handler,
- * all error events reported by the SAX parser will be silently
- * ignored, except for fatalError, which will throw a SAXException
- * (this is the default behaviour implemented by HandlerBase).</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param handler The error handler.
- * @see ErrorHandler
- * @see SAXException
- * @see HandlerBase
- */
- public abstract void setErrorHandler (ErrorHandler handler);
-
-
- /**
- * Parse an XML document.
- *
- * <p>The application can use this method to instruct the SAX parser
- * to begin parsing an XML document from any valid input
- * source (a character stream, a byte stream, or a URI).</p>
- *
- * <p>Applications may not invoke this method while a parse is in
- * progress (they should create a new Parser instead for each
- * additional XML document). Once a parse is complete, an
- * application may reuse the same Parser object, possibly with a
- * different input source.</p>
- *
- * @param source The input source for the top-level of the
- * XML document.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- * @see org.xml.sax.InputSource
- * @see #parse(java.lang.String)
- * @see #setEntityResolver
- * @see #setDTDHandler
- * @see #setDocumentHandler
- * @see #setErrorHandler
- */
- public abstract void parse (InputSource source)
- throws SAXException, IOException;
-
-
- /**
- * Parse an XML document from a system identifier (URI).
- *
- * <p>This method is a shortcut for the common case of reading a
- * document from a system identifier. It is the exact
- * equivalent of the following:</p>
- *
- * <pre>
- * parse(new InputSource(systemId));
- * </pre>
- *
- * <p>If the system identifier is a URL, it must be fully resolved
- * by the application before it is passed to the parser.</p>
- *
- * @param systemId The system identifier (URI).
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- * @see #parse(org.xml.sax.InputSource)
- */
- public abstract void parse (String systemId)
- throws SAXException, IOException;
-
-}
-
-// end of Parser.java
diff --git a/libjava/external/sax/org/xml/sax/SAXException.java b/libjava/external/sax/org/xml/sax/SAXException.java
deleted file mode 100644
index b3c23e9aedb..00000000000
--- a/libjava/external/sax/org/xml/sax/SAXException.java
+++ /dev/null
@@ -1,153 +0,0 @@
-// SAX exception class.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: SAXException.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-/**
- * Encapsulate a general SAX error or warning.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class can contain basic error or warning information from
- * either the XML parser or the application: a parser writer or
- * application writer can subclass it to provide additional
- * functionality. SAX handlers may throw this exception or
- * any exception subclassed from it.</p>
- *
- * <p>If the application needs to pass through other types of
- * exceptions, it must wrap those exceptions in a SAXException
- * or an exception derived from a SAXException.</p>
- *
- * <p>If the parser or application needs to include information about a
- * specific location in an XML document, it should use the
- * {@link org.xml.sax.SAXParseException SAXParseException} subclass.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.SAXParseException
- */
-public class SAXException extends Exception {
-
-
- /**
- * Create a new SAXException.
- */
- public SAXException ()
- {
- super();
- this.exception = null;
- }
-
-
- /**
- * Create a new SAXException.
- *
- * @param message The error or warning message.
- */
- public SAXException (String message) {
- super(message);
- this.exception = null;
- }
-
-
- /**
- * Create a new SAXException wrapping an existing exception.
- *
- * <p>The existing exception will be embedded in the new
- * one, and its message will become the default message for
- * the SAXException.</p>
- *
- * @param e The exception to be wrapped in a SAXException.
- */
- public SAXException (Exception e)
- {
- super();
- this.exception = e;
- }
-
-
- /**
- * Create a new SAXException from an existing exception.
- *
- * <p>The existing exception will be embedded in the new
- * one, but the new exception will have its own message.</p>
- *
- * @param message The detail message.
- * @param e The exception to be wrapped in a SAXException.
- */
- public SAXException (String message, Exception e)
- {
- super(message);
- this.exception = e;
- }
-
-
- /**
- * Return a detail message for this exception.
- *
- * <p>If there is an embedded exception, and if the SAXException
- * has no detail message of its own, this method will return
- * the detail message from the embedded exception.</p>
- *
- * @return The error or warning message.
- */
- public String getMessage ()
- {
- String message = super.getMessage();
-
- if (message == null && exception != null) {
- return exception.getMessage();
- } else {
- return message;
- }
- }
-
-
- /**
- * Return the embedded exception, if any.
- *
- * @return The embedded exception, or null if there is none.
- */
- public Exception getException ()
- {
- return exception;
- }
-
-
- /**
- * Override toString to pick up any embedded exception.
- *
- * @return A string representation of this exception.
- */
- public String toString ()
- {
- if (exception != null) {
- return exception.toString();
- } else {
- return super.toString();
- }
- }
-
-
-
- //////////////////////////////////////////////////////////////////////
- // Internal state.
- //////////////////////////////////////////////////////////////////////
-
-
- /**
- * @serial The embedded exception if tunnelling, or null.
- */
- private Exception exception;
-
-}
-
-// end of SAXException.java
diff --git a/libjava/external/sax/org/xml/sax/SAXNotRecognizedException.java b/libjava/external/sax/org/xml/sax/SAXNotRecognizedException.java
deleted file mode 100644
index dc411b105ce..00000000000
--- a/libjava/external/sax/org/xml/sax/SAXNotRecognizedException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// SAXNotRecognizedException.java - unrecognized feature or value.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: SAXNotRecognizedException.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-
-/**
- * Exception class for an unrecognized identifier.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>An XMLReader will throw this exception when it finds an
- * unrecognized feature or property identifier; SAX applications and
- * extensions may use this class for other, similar purposes.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.SAXNotSupportedException
- */
-public class SAXNotRecognizedException extends SAXException
-{
-
- /**
- * Default constructor.
- */
- public SAXNotRecognizedException ()
- {
- super();
- }
-
-
- /**
- * Construct a new exception with the given message.
- *
- * @param message The text message of the exception.
- */
- public SAXNotRecognizedException (String message)
- {
- super(message);
- }
-
-}
-
-// end of SAXNotRecognizedException.java
diff --git a/libjava/external/sax/org/xml/sax/SAXNotSupportedException.java b/libjava/external/sax/org/xml/sax/SAXNotSupportedException.java
deleted file mode 100644
index 232ce8026de..00000000000
--- a/libjava/external/sax/org/xml/sax/SAXNotSupportedException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// SAXNotSupportedException.java - unsupported feature or value.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: SAXNotSupportedException.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-/**
- * Exception class for an unsupported operation.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>An XMLReader will throw this exception when it recognizes a
- * feature or property identifier, but cannot perform the requested
- * operation (setting a state or value). Other SAX2 applications and
- * extensions may use this class for similar purposes.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.SAXNotRecognizedException
- */
-public class SAXNotSupportedException extends SAXException
-{
-
- /**
- * Construct a new exception with no message.
- */
- public SAXNotSupportedException ()
- {
- super();
- }
-
-
- /**
- * Construct a new exception with the given message.
- *
- * @param message The text message of the exception.
- */
- public SAXNotSupportedException (String message)
- {
- super(message);
- }
-
-}
-
-// end of SAXNotSupportedException.java
diff --git a/libjava/external/sax/org/xml/sax/SAXParseException.java b/libjava/external/sax/org/xml/sax/SAXParseException.java
deleted file mode 100644
index c49ff095be3..00000000000
--- a/libjava/external/sax/org/xml/sax/SAXParseException.java
+++ /dev/null
@@ -1,269 +0,0 @@
-// SAX exception class.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: SAXParseException.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-/**
- * Encapsulate an XML parse error or warning.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This exception may include information for locating the error
- * in the original XML document, as if it came from a {@link Locator}
- * object. Note that although the application
- * will receive a SAXParseException as the argument to the handlers
- * in the {@link org.xml.sax.ErrorHandler ErrorHandler} interface,
- * the application is not actually required to throw the exception;
- * instead, it can simply read the information in it and take a
- * different action.</p>
- *
- * <p>Since this exception is a subclass of {@link org.xml.sax.SAXException
- * SAXException}, it inherits the ability to wrap another exception.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.SAXException
- * @see org.xml.sax.Locator
- * @see org.xml.sax.ErrorHandler
- */
-public class SAXParseException extends SAXException {
-
-
- //////////////////////////////////////////////////////////////////////
- // Constructors.
- //////////////////////////////////////////////////////////////////////
-
-
- /**
- * Create a new SAXParseException from a message and a Locator.
- *
- * <p>This constructor is especially useful when an application is
- * creating its own exception from within a {@link org.xml.sax.ContentHandler
- * ContentHandler} callback.</p>
- *
- * @param message The error or warning message.
- * @param locator The locator object for the error or warning (may be
- * null).
- * @see org.xml.sax.Locator
- */
- public SAXParseException (String message, Locator locator) {
- super(message);
- if (locator != null) {
- init(locator.getPublicId(), locator.getSystemId(),
- locator.getLineNumber(), locator.getColumnNumber());
- } else {
- init(null, null, -1, -1);
- }
- }
-
-
- /**
- * Wrap an existing exception in a SAXParseException.
- *
- * <p>This constructor is especially useful when an application is
- * creating its own exception from within a {@link org.xml.sax.ContentHandler
- * ContentHandler} callback, and needs to wrap an existing exception that is not a
- * subclass of {@link org.xml.sax.SAXException SAXException}.</p>
- *
- * @param message The error or warning message, or null to
- * use the message from the embedded exception.
- * @param locator The locator object for the error or warning (may be
- * null).
- * @param e Any exception.
- * @see org.xml.sax.Locator
- */
- public SAXParseException (String message, Locator locator,
- Exception e) {
- super(message, e);
- if (locator != null) {
- init(locator.getPublicId(), locator.getSystemId(),
- locator.getLineNumber(), locator.getColumnNumber());
- } else {
- init(null, null, -1, -1);
- }
- }
-
-
- /**
- * Create a new SAXParseException.
- *
- * <p>This constructor is most useful for parser writers.</p>
- *
- * <p>All parameters except the message are as if
- * they were provided by a {@link Locator}. For example, if the
- * system identifier is a URL (including relative filename), the
- * caller must resolve it fully before creating the exception.</p>
- *
- *
- * @param message The error or warning message.
- * @param publicId The public identifier of the entity that generated
- * the error or warning.
- * @param systemId The system identifier of the entity that generated
- * the error or warning.
- * @param lineNumber The line number of the end of the text that
- * caused the error or warning.
- * @param columnNumber The column number of the end of the text that
- * cause the error or warning.
- */
- public SAXParseException (String message, String publicId, String systemId,
- int lineNumber, int columnNumber)
- {
- super(message);
- init(publicId, systemId, lineNumber, columnNumber);
- }
-
-
- /**
- * Create a new SAXParseException with an embedded exception.
- *
- * <p>This constructor is most useful for parser writers who
- * need to wrap an exception that is not a subclass of
- * {@link org.xml.sax.SAXException SAXException}.</p>
- *
- * <p>All parameters except the message and exception are as if
- * they were provided by a {@link Locator}. For example, if the
- * system identifier is a URL (including relative filename), the
- * caller must resolve it fully before creating the exception.</p>
- *
- * @param message The error or warning message, or null to use
- * the message from the embedded exception.
- * @param publicId The public identifier of the entity that generated
- * the error or warning.
- * @param systemId The system identifier of the entity that generated
- * the error or warning.
- * @param lineNumber The line number of the end of the text that
- * caused the error or warning.
- * @param columnNumber The column number of the end of the text that
- * cause the error or warning.
- * @param e Another exception to embed in this one.
- */
- public SAXParseException (String message, String publicId, String systemId,
- int lineNumber, int columnNumber, Exception e)
- {
- super(message, e);
- init(publicId, systemId, lineNumber, columnNumber);
- }
-
-
- /**
- * Internal initialization method.
- *
- * @param publicId The public identifier of the entity which generated the exception,
- * or null.
- * @param systemId The system identifier of the entity which generated the exception,
- * or null.
- * @param lineNumber The line number of the error, or -1.
- * @param columnNumber The column number of the error, or -1.
- */
- private void init (String publicId, String systemId,
- int lineNumber, int columnNumber)
- {
- this.publicId = publicId;
- this.systemId = systemId;
- this.lineNumber = lineNumber;
- this.columnNumber = columnNumber;
- }
-
-
- /**
- * Get the public identifier of the entity where the exception occurred.
- *
- * @return A string containing the public identifier, or null
- * if none is available.
- * @see org.xml.sax.Locator#getPublicId
- */
- public String getPublicId ()
- {
- return this.publicId;
- }
-
-
- /**
- * Get the system identifier of the entity where the exception occurred.
- *
- * <p>If the system identifier is a URL, it will have been resolved
- * fully.</p>
- *
- * @return A string containing the system identifier, or null
- * if none is available.
- * @see org.xml.sax.Locator#getSystemId
- */
- public String getSystemId ()
- {
- return this.systemId;
- }
-
-
- /**
- * The line number of the end of the text where the exception occurred.
- *
- * <p>The first line is line 1.</p>
- *
- * @return An integer representing the line number, or -1
- * if none is available.
- * @see org.xml.sax.Locator#getLineNumber
- */
- public int getLineNumber ()
- {
- return this.lineNumber;
- }
-
-
- /**
- * The column number of the end of the text where the exception occurred.
- *
- * <p>The first column in a line is position 1.</p>
- *
- * @return An integer representing the column number, or -1
- * if none is available.
- * @see org.xml.sax.Locator#getColumnNumber
- */
- public int getColumnNumber ()
- {
- return this.columnNumber;
- }
-
-
- //////////////////////////////////////////////////////////////////////
- // Internal state.
- //////////////////////////////////////////////////////////////////////
-
-
- /**
- * @serial The public identifier, or null.
- * @see #getPublicId
- */
- private String publicId;
-
-
- /**
- * @serial The system identifier, or null.
- * @see #getSystemId
- */
- private String systemId;
-
-
- /**
- * @serial The line number, or -1.
- * @see #getLineNumber
- */
- private int lineNumber;
-
-
- /**
- * @serial The column number, or -1.
- * @see #getColumnNumber
- */
- private int columnNumber;
-
-}
-
-// end of SAXParseException.java
diff --git a/libjava/external/sax/org/xml/sax/XMLFilter.java b/libjava/external/sax/org/xml/sax/XMLFilter.java
deleted file mode 100644
index 363328e2d55..00000000000
--- a/libjava/external/sax/org/xml/sax/XMLFilter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-// XMLFilter.java - filter SAX2 events.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLFilter.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-
-/**
- * Interface for an XML filter.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>An XML filter is like an XML reader, except that it obtains its
- * events from another XML reader rather than a primary source like
- * an XML document or database. Filters can modify a stream of
- * events as they pass on to the final application.</p>
- *
- * <p>The XMLFilterImpl helper class provides a convenient base
- * for creating SAX2 filters, by passing on all {@link org.xml.sax.EntityResolver
- * EntityResolver}, {@link org.xml.sax.DTDHandler DTDHandler},
- * {@link org.xml.sax.ContentHandler ContentHandler} and {@link org.xml.sax.ErrorHandler
- * ErrorHandler} events automatically.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.helpers.XMLFilterImpl
- */
-public interface XMLFilter extends XMLReader
-{
-
- /**
- * Set the parent reader.
- *
- * <p>This method allows the application to link the filter to
- * a parent reader (which may be another filter). The argument
- * may not be null.</p>
- *
- * @param parent The parent reader.
- */
- public abstract void setParent (XMLReader parent);
-
-
- /**
- * Get the parent reader.
- *
- * <p>This method allows the application to query the parent
- * reader (which may be another filter). It is generally a
- * bad idea to perform any operations on the parent reader
- * directly: they should all pass through this filter.</p>
- *
- * @return The parent filter, or null if none has been set.
- */
- public abstract XMLReader getParent ();
-
-}
-
-// end of XMLFilter.java
diff --git a/libjava/external/sax/org/xml/sax/XMLReader.java b/libjava/external/sax/org/xml/sax/XMLReader.java
deleted file mode 100644
index 92d0a94e3d1..00000000000
--- a/libjava/external/sax/org/xml/sax/XMLReader.java
+++ /dev/null
@@ -1,404 +0,0 @@
-// XMLReader.java - read an XML document.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLReader.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax;
-
-import java.io.IOException;
-
-
-/**
- * Interface for reading an XML document using callbacks.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p><strong>Note:</strong> despite its name, this interface does
- * <em>not</em> extend the standard Java {@link java.io.Reader Reader}
- * interface, because reading XML is a fundamentally different activity
- * than reading character data.</p>
- *
- * <p>XMLReader is the interface that an XML parser's SAX2 driver must
- * implement. This interface allows an application to set and
- * query features and properties in the parser, to register
- * event handlers for document processing, and to initiate
- * a document parse.</p>
- *
- * <p>All SAX interfaces are assumed to be synchronous: the
- * {@link #parse parse} methods must not return until parsing
- * is complete, and readers must wait for an event-handler callback
- * to return before reporting the next event.</p>
- *
- * <p>This interface replaces the (now deprecated) SAX 1.0 {@link
- * org.xml.sax.Parser Parser} interface. The XMLReader interface
- * contains two important enhancements over the old Parser
- * interface (as well as some minor ones):</p>
- *
- * <ol>
- * <li>it adds a standard way to query and set features and
- * properties; and</li>
- * <li>it adds Namespace support, which is required for many
- * higher-level XML standards.</li>
- * </ol>
- *
- * <p>There are adapters available to convert a SAX1 Parser to
- * a SAX2 XMLReader and vice-versa.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1+ (sax2r3pre1)
- * @see org.xml.sax.XMLFilter
- * @see org.xml.sax.helpers.ParserAdapter
- * @see org.xml.sax.helpers.XMLReaderAdapter
- */
-public interface XMLReader
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Configuration.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Look up the value of a feature flag.
- *
- * <p>The feature name is any fully-qualified URI. It is
- * possible for an XMLReader to recognize a feature name but
- * temporarily be unable to return its value.
- * Some feature values may be available only in specific
- * contexts, such as before, during, or after a parse.
- * Also, some feature values may not be programmatically accessible.
- * (In the case of an adapter for SAX1 {@link Parser}, there is no
- * implementation-independent way to expose whether the underlying
- * parser is performing validation, expanding external entities,
- * and so forth.) </p>
- *
- * <p>All XMLReaders are required to recognize the
- * http://xml.org/sax/features/namespaces and the
- * http://xml.org/sax/features/namespace-prefixes feature names.</p>
- *
- * <p>Typical usage is something like this:</p>
- *
- * <pre>
- * XMLReader r = new MySAXDriver();
- *
- * // try to activate validation
- * try {
- * r.setFeature("http://xml.org/sax/features/validation", true);
- * } catch (SAXException e) {
- * System.err.println("Cannot activate validation.");
- * }
- *
- * // register event handlers
- * r.setContentHandler(new MyContentHandler());
- * r.setErrorHandler(new MyErrorHandler());
- *
- * // parse the first document
- * try {
- * r.parse("http://www.foo.com/mydoc.xml");
- * } catch (IOException e) {
- * System.err.println("I/O exception reading XML document");
- * } catch (SAXException e) {
- * System.err.println("XML exception reading document.");
- * }
- * </pre>
- *
- * <p>Implementors are free (and encouraged) to invent their own features,
- * using names built on their own URIs.</p>
- *
- * @param name The feature name, which is a fully-qualified URI.
- * @return The current value of the feature (true or false).
- * @exception org.xml.sax.SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * XMLReader recognizes the feature name but
- * cannot determine its value at this time.
- * @see #setFeature
- */
- public boolean getFeature (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
-
- /**
- * Set the value of a feature flag.
- *
- * <p>The feature name is any fully-qualified URI. It is
- * possible for an XMLReader to expose a feature value but
- * to be unable to change the current value.
- * Some feature values may be immutable or mutable only
- * in specific contexts, such as before, during, or after
- * a parse.</p>
- *
- * <p>All XMLReaders are required to support setting
- * http://xml.org/sax/features/namespaces to true and
- * http://xml.org/sax/features/namespace-prefixes to false.</p>
- *
- * @param name The feature name, which is a fully-qualified URI.
- * @param value The requested value of the feature (true or false).
- * @exception org.xml.sax.SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * XMLReader recognizes the feature name but
- * cannot set the requested value.
- * @see #getFeature
- */
- public void setFeature (String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
-
- /**
- * Look up the value of a property.
- *
- * <p>The property name is any fully-qualified URI. It is
- * possible for an XMLReader to recognize a property name but
- * temporarily be unable to return its value.
- * Some property values may be available only in specific
- * contexts, such as before, during, or after a parse.</p>
- *
- * <p>XMLReaders are not required to recognize any specific
- * property names, though an initial core set is documented for
- * SAX2.</p>
- *
- * <p>Implementors are free (and encouraged) to invent their own properties,
- * using names built on their own URIs.</p>
- *
- * @param name The property name, which is a fully-qualified URI.
- * @return The current value of the property.
- * @exception org.xml.sax.SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * XMLReader recognizes the property name but
- * cannot determine its value at this time.
- * @see #setProperty
- */
- public Object getProperty (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
-
- /**
- * Set the value of a property.
- *
- * <p>The property name is any fully-qualified URI. It is
- * possible for an XMLReader to recognize a property name but
- * to be unable to change the current value.
- * Some property values may be immutable or mutable only
- * in specific contexts, such as before, during, or after
- * a parse.</p>
- *
- * <p>XMLReaders are not required to recognize setting
- * any specific property names, though a core set is defined by
- * SAX2.</p>
- *
- * <p>This method is also the standard mechanism for setting
- * extended handlers.</p>
- *
- * @param name The property name, which is a fully-qualified URI.
- * @param value The requested value for the property.
- * @exception org.xml.sax.SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * XMLReader recognizes the property name but
- * cannot set the requested value.
- */
- public void setProperty (String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Event handlers.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Allow an application to register an entity resolver.
- *
- * <p>If the application does not register an entity resolver,
- * the XMLReader will perform its own default resolution.</p>
- *
- * <p>Applications may register a new or different resolver in the
- * middle of a parse, and the SAX parser must begin using the new
- * resolver immediately.</p>
- *
- * @param resolver The entity resolver.
- * @see #getEntityResolver
- */
- public void setEntityResolver (EntityResolver resolver);
-
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none
- * has been registered.
- * @see #setEntityResolver
- */
- public EntityResolver getEntityResolver ();
-
-
- /**
- * Allow an application to register a DTD event handler.
- *
- * <p>If the application does not register a DTD handler, all DTD
- * events reported by the SAX parser will be silently ignored.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param handler The DTD handler.
- * @see #getDTDHandler
- */
- public void setDTDHandler (DTDHandler handler);
-
-
- /**
- * Return the current DTD handler.
- *
- * @return The current DTD handler, or null if none
- * has been registered.
- * @see #setDTDHandler
- */
- public DTDHandler getDTDHandler ();
-
-
- /**
- * Allow an application to register a content event handler.
- *
- * <p>If the application does not register a content handler, all
- * content events reported by the SAX parser will be silently
- * ignored.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param handler The content handler.
- * @see #getContentHandler
- */
- public void setContentHandler (ContentHandler handler);
-
-
- /**
- * Return the current content handler.
- *
- * @return The current content handler, or null if none
- * has been registered.
- * @see #setContentHandler
- */
- public ContentHandler getContentHandler ();
-
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error handler, all
- * error events reported by the SAX parser will be silently
- * ignored; however, normal processing may not continue. It is
- * highly recommended that all SAX applications implement an
- * error handler to avoid unexpected bugs.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param handler The error handler.
- * @see #getErrorHandler
- */
- public void setErrorHandler (ErrorHandler handler);
-
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none
- * has been registered.
- * @see #setErrorHandler
- */
- public ErrorHandler getErrorHandler ();
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Parsing.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Parse an XML document.
- *
- * <p>The application can use this method to instruct the XML
- * reader to begin parsing an XML document from any valid input
- * source (a character stream, a byte stream, or a URI).</p>
- *
- * <p>Applications may not invoke this method while a parse is in
- * progress (they should create a new XMLReader instead for each
- * nested XML document). Once a parse is complete, an
- * application may reuse the same XMLReader object, possibly with a
- * different input source.
- * Configuration of the XMLReader object (such as handler bindings and
- * values established for feature flags and properties) is unchanged
- * by completion of a parse, unless the definition of that aspect of
- * the configuration explicitly specifies other behavior.
- * (For example, feature flags or properties exposing
- * characteristics of the document being parsed.)
- * </p>
- *
- * <p>During the parse, the XMLReader will provide information
- * about the XML document through the registered event
- * handlers.</p>
- *
- * <p>This method is synchronous: it will not return until parsing
- * has ended. If a client application wants to terminate
- * parsing early, it should throw an exception.</p>
- *
- * @param input The input source for the top-level of the
- * XML document.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- * @see org.xml.sax.InputSource
- * @see #parse(java.lang.String)
- * @see #setEntityResolver
- * @see #setDTDHandler
- * @see #setContentHandler
- * @see #setErrorHandler
- */
- public void parse (InputSource input)
- throws IOException, SAXException;
-
-
- /**
- * Parse an XML document from a system identifier (URI).
- *
- * <p>This method is a shortcut for the common case of reading a
- * document from a system identifier. It is the exact
- * equivalent of the following:</p>
- *
- * <pre>
- * parse(new InputSource(systemId));
- * </pre>
- *
- * <p>If the system identifier is a URL, it must be fully resolved
- * by the application before it is passed to the parser.</p>
- *
- * @param systemId The system identifier (URI).
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- * @see #parse(org.xml.sax.InputSource)
- */
- public void parse (String systemId)
- throws IOException, SAXException;
-
-}
diff --git a/libjava/external/sax/org/xml/sax/ext/Attributes2.java b/libjava/external/sax/org/xml/sax/ext/Attributes2.java
deleted file mode 100644
index 5c839bd1acf..00000000000
--- a/libjava/external/sax/org/xml/sax/ext/Attributes2.java
+++ /dev/null
@@ -1,132 +0,0 @@
-// Attributes2.java - extended Attributes
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: Attributes2.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.Attributes;
-
-
-/**
- * SAX2 extension to augment the per-attribute information
- * provided though {@link Attributes}.
- * If an implementation supports this extension, the attributes
- * provided in {@link org.xml.sax.ContentHandler#startElement
- * ContentHandler.startElement() } will implement this interface,
- * and the <em>http://xml.org/sax/features/use-attributes2</em>
- * feature flag will have the value <em>true</em>.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p> XMLReader implementations are not required to support this
- * information, and it is not part of core-only SAX2 distributions.</p>
- *
- * <p>Note that if an attribute was defaulted (<em>!isSpecified()</em>)
- * it will of necessity also have been declared (<em>isDeclared()</em>)
- * in the DTD.
- * Similarly if an attribute's type is anything except CDATA, then it
- * must have been declared.
- * </p>
- *
- * @since SAX 2.0 (extensions 1.1 alpha)
- * @author David Brownell
- * @version TBS
- */
-public interface Attributes2 extends Attributes
-{
- /**
- * Returns false unless the attribute was declared in the DTD.
- * This helps distinguish two kinds of attributes that SAX reports
- * as CDATA: ones that were declared (and hence are usually valid),
- * and those that were not (and which are never valid).
- *
- * @param index The attribute index (zero-based).
- * @return true if the attribute was declared in the DTD,
- * false otherwise.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not identify an attribute.
- */
- public boolean isDeclared (int index);
-
- /**
- * Returns false unless the attribute was declared in the DTD.
- * This helps distinguish two kinds of attributes that SAX reports
- * as CDATA: ones that were declared (and hence are usually valid),
- * and those that were not (and which are never valid).
- *
- * @param qName The XML qualified (prefixed) name.
- * @return true if the attribute was declared in the DTD,
- * false otherwise.
- * @exception java.lang.IllegalArgumentException When the
- * supplied name does not identify an attribute.
- */
- public boolean isDeclared (String qName);
-
- /**
- * Returns false unless the attribute was declared in the DTD.
- * This helps distinguish two kinds of attributes that SAX reports
- * as CDATA: ones that were declared (and hence are usually valid),
- * and those that were not (and which are never valid).
- *
- * <p>Remember that since DTDs do not "understand" namespaces, the
- * namespace URI associated with an attribute may not have come from
- * the DTD. The declaration will have applied to the attribute's
- * <em>qName</em>.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- * @return true if the attribute was declared in the DTD,
- * false otherwise.
- * @exception java.lang.IllegalArgumentException When the
- * supplied names do not identify an attribute.
- */
- public boolean isDeclared (String uri, String localName);
-
- /**
- * Returns true unless the attribute value was provided
- * by DTD defaulting.
- *
- * @param index The attribute index (zero-based).
- * @return true if the value was found in the XML text,
- * false if the value was provided by DTD defaulting.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not identify an attribute.
- */
- public boolean isSpecified (int index);
-
- /**
- * Returns true unless the attribute value was provided
- * by DTD defaulting.
- *
- * <p>Remember that since DTDs do not "understand" namespaces, the
- * namespace URI associated with an attribute may not have come from
- * the DTD. The declaration will have applied to the attribute's
- * <em>qName</em>.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- * @return true if the value was found in the XML text,
- * false if the value was provided by DTD defaulting.
- * @exception java.lang.IllegalArgumentException When the
- * supplied names do not identify an attribute.
- */
- public boolean isSpecified (String uri, String localName);
-
- /**
- * Returns true unless the attribute value was provided
- * by DTD defaulting.
- *
- * @param qName The XML qualified (prefixed) name.
- * @return true if the value was found in the XML text,
- * false if the value was provided by DTD defaulting.
- * @exception java.lang.IllegalArgumentException When the
- * supplied name does not identify an attribute.
- */
- public boolean isSpecified (String qName);
-}
diff --git a/libjava/external/sax/org/xml/sax/ext/Attributes2Impl.java b/libjava/external/sax/org/xml/sax/ext/Attributes2Impl.java
deleted file mode 100644
index 485a5d6ac44..00000000000
--- a/libjava/external/sax/org/xml/sax/ext/Attributes2Impl.java
+++ /dev/null
@@ -1,301 +0,0 @@
-// Attributes2Impl.java - extended AttributesImpl
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: Attributes2Impl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.helpers.AttributesImpl;
-
-
-/**
- * SAX2 extension helper for additional Attributes information,
- * implementing the {@link Attributes2} interface.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p>This is not part of core-only SAX2 distributions.</p>
- *
- * <p>The <em>specified</em> flag for each attribute will always
- * be true, unless it has been set to false in the copy constructor
- * or using {@link #setSpecified}.
- * Similarly, the <em>declared</em> flag for each attribute will
- * always be false, except for defaulted attributes (<em>specified</em>
- * is false), non-CDATA attributes, or when it is set to true using
- * {@link #setDeclared}.
- * If you change an attribute's type by hand, you may need to modify
- * its <em>declared</em> flag to match.
- * </p>
- *
- * @since SAX 2.0 (extensions 1.1 alpha)
- * @author David Brownell
- * @version TBS
- */
-public class Attributes2Impl extends AttributesImpl implements Attributes2
-{
- private boolean declared [];
- private boolean specified [];
-
-
- /**
- * Construct a new, empty Attributes2Impl object.
- */
- public Attributes2Impl () { }
-
-
- /**
- * Copy an existing Attributes or Attributes2 object.
- * If the object implements Attributes2, values of the
- * <em>specified</em> and <em>declared</em> flags for each
- * attribute are copied.
- * Otherwise the flag values are defaulted to assume no DTD was used,
- * unless there is evidence to the contrary (such as attributes with
- * type other than CDATA, which must have been <em>declared</em>).
- *
- * <p>This constructor is especially useful inside a
- * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
- *
- * @param atts The existing Attributes object.
- */
- public Attributes2Impl (Attributes atts)
- {
- super (atts);
- }
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of Attributes2
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Returns the current value of the attribute's "declared" flag.
- */
- // javadoc mostly from interface
- public boolean isDeclared (int index)
- {
- if (index < 0 || index >= getLength ())
- throw new ArrayIndexOutOfBoundsException (
- "No attribute at index: " + index);
- return declared [index];
- }
-
-
- /**
- * Returns the current value of the attribute's "declared" flag.
- */
- // javadoc mostly from interface
- public boolean isDeclared (String uri, String localName)
- {
- int index = getIndex (uri, localName);
-
- if (index < 0)
- throw new IllegalArgumentException (
- "No such attribute: local=" + localName
- + ", namespace=" + uri);
- return declared [index];
- }
-
-
- /**
- * Returns the current value of the attribute's "declared" flag.
- */
- // javadoc mostly from interface
- public boolean isDeclared (String qName)
- {
- int index = getIndex (qName);
-
- if (index < 0)
- throw new IllegalArgumentException (
- "No such attribute: " + qName);
- return declared [index];
- }
-
-
- /**
- * Returns the current value of an attribute's "specified" flag.
- *
- * @param index The attribute index (zero-based).
- * @return current flag value
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not identify an attribute.
- */
- public boolean isSpecified (int index)
- {
- if (index < 0 || index >= getLength ())
- throw new ArrayIndexOutOfBoundsException (
- "No attribute at index: " + index);
- return specified [index];
- }
-
-
- /**
- * Returns the current value of an attribute's "specified" flag.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- * @return current flag value
- * @exception java.lang.IllegalArgumentException When the
- * supplied names do not identify an attribute.
- */
- public boolean isSpecified (String uri, String localName)
- {
- int index = getIndex (uri, localName);
-
- if (index < 0)
- throw new IllegalArgumentException (
- "No such attribute: local=" + localName
- + ", namespace=" + uri);
- return specified [index];
- }
-
-
- /**
- * Returns the current value of an attribute's "specified" flag.
- *
- * @param qName The XML qualified (prefixed) name.
- * @return current flag value
- * @exception java.lang.IllegalArgumentException When the
- * supplied name does not identify an attribute.
- */
- public boolean isSpecified (String qName)
- {
- int index = getIndex (qName);
-
- if (index < 0)
- throw new IllegalArgumentException (
- "No such attribute: " + qName);
- return specified [index];
- }
-
-
- ////////////////////////////////////////////////////////////////////
- // Manipulators
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Copy an entire Attributes object. The "specified" flags are
- * assigned as true, and "declared" flags as false (except when
- * an attribute's type is not CDATA),
- * unless the object is an Attributes2 object.
- * In that case those flag values are all copied.
- *
- * @see AttributesImpl#setAttributes
- */
- public void setAttributes (Attributes atts)
- {
- int length = atts.getLength ();
-
- super.setAttributes (atts);
- declared = new boolean [length];
- specified = new boolean [length];
-
- if (atts instanceof Attributes2) {
- Attributes2 a2 = (Attributes2) atts;
- for (int i = 0; i < length; i++) {
- declared [i] = a2.isDeclared (i);
- specified [i] = a2.isSpecified (i);
- }
- } else {
- for (int i = 0; i < length; i++) {
- declared [i] = !"CDATA".equals (atts.getType (i));
- specified [i] = true;
- }
- }
- }
-
-
- /**
- * Add an attribute to the end of the list, setting its
- * "specified" flag to true. To set that flag's value
- * to false, use {@link #setSpecified}.
- *
- * <p>Unless the attribute <em>type</em> is CDATA, this attribute
- * is marked as being declared in the DTD. To set that flag's value
- * to true for CDATA attributes, use {@link #setDeclared}.
- *
- * @see AttributesImpl#addAttribute
- */
- public void addAttribute (String uri, String localName, String qName,
- String type, String value)
- {
- super.addAttribute (uri, localName, qName, type, value);
-
- int length = getLength ();
-
- if (length < specified.length) {
- boolean newFlags [];
-
- newFlags = new boolean [length];
- System.arraycopy (declared, 0, newFlags, 0, declared.length);
- declared = newFlags;
-
- newFlags = new boolean [length];
- System.arraycopy (specified, 0, newFlags, 0, specified.length);
- specified = newFlags;
- }
-
- specified [length - 1] = true;
- declared [length - 1] = !"CDATA".equals (type);
- }
-
-
- // javadoc entirely from superclass
- public void removeAttribute (int index)
- {
- int origMax = getLength () - 1;
-
- super.removeAttribute (index);
- if (index != origMax) {
- System.arraycopy (declared, index + 1, declared, index,
- origMax - index);
- System.arraycopy (specified, index + 1, specified, index,
- origMax - index);
- }
- }
-
-
- /**
- * Assign a value to the "declared" flag of a specific attribute.
- * This is normally needed only for attributes of type CDATA,
- * including attributes whose type is changed to or from CDATA.
- *
- * @param index The index of the attribute (zero-based).
- * @param value The desired flag value.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not identify an attribute.
- * @see #setType
- */
- public void setDeclared (int index, boolean value)
- {
- if (index < 0 || index >= getLength ())
- throw new ArrayIndexOutOfBoundsException (
- "No attribute at index: " + index);
- declared [index] = value;
- }
-
-
- /**
- * Assign a value to the "specified" flag of a specific attribute.
- * This is the only way this flag can be cleared, except clearing
- * by initialization with the copy constructor.
- *
- * @param index The index of the attribute (zero-based).
- * @param value The desired flag value.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not identify an attribute.
- */
- public void setSpecified (int index, boolean value)
- {
- if (index < 0 || index >= getLength ())
- throw new ArrayIndexOutOfBoundsException (
- "No attribute at index: " + index);
- specified [index] = value;
- }
-}
diff --git a/libjava/external/sax/org/xml/sax/ext/DeclHandler.java b/libjava/external/sax/org/xml/sax/ext/DeclHandler.java
deleted file mode 100644
index 1bb4dea4a41..00000000000
--- a/libjava/external/sax/org/xml/sax/ext/DeclHandler.java
+++ /dev/null
@@ -1,146 +0,0 @@
-// DeclHandler.java - Optional handler for DTD declaration events.
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: DeclHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.SAXException;
-
-
-/**
- * SAX2 extension handler for DTD declaration events.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This is an optional extension handler for SAX2 to provide more
- * complete information about DTD declarations in an XML document.
- * XML readers are not required to recognize this handler, and it
- * is not part of core-only SAX2 distributions.</p>
- *
- * <p>Note that data-related DTD declarations (unparsed entities and
- * notations) are already reported through the {@link
- * org.xml.sax.DTDHandler DTDHandler} interface.</p>
- *
- * <p>If you are using the declaration handler together with a lexical
- * handler, all of the events will occur between the
- * {@link org.xml.sax.ext.LexicalHandler#startDTD startDTD} and the
- * {@link org.xml.sax.ext.LexicalHandler#endDTD endDTD} events.</p>
- *
- * <p>To set the DeclHandler for an XML reader, use the
- * {@link org.xml.sax.XMLReader#setProperty setProperty} method
- * with the property name
- * <code>http://xml.org/sax/properties/declaration-handler</code>
- * and an object implementing this interface (or null) as the value.
- * If the reader does not report declaration events, it will throw a
- * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}
- * when you attempt to register the handler.</p>
- *
- * @since SAX 2.0 (extensions 1.0)
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- */
-public interface DeclHandler
-{
-
- /**
- * Report an element type declaration.
- *
- * <p>The content model will consist of the string "EMPTY", the
- * string "ANY", or a parenthesised group, optionally followed
- * by an occurrence indicator. The model will be normalized so
- * that all parameter entities are fully resolved and all whitespace
- * is removed,and will include the enclosing parentheses. Other
- * normalization (such as removing redundant parentheses or
- * simplifying occurrence indicators) is at the discretion of the
- * parser.</p>
- *
- * @param name The element type name.
- * @param model The content model as a normalized string.
- * @exception SAXException The application may raise an exception.
- */
- public abstract void elementDecl (String name, String model)
- throws SAXException;
-
-
- /**
- * Report an attribute type declaration.
- *
- * <p>Only the effective (first) declaration for an attribute will
- * be reported. The type will be one of the strings "CDATA",
- * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
- * "ENTITIES", a parenthesized token group with
- * the separator "|" and all whitespace removed, or the word
- * "NOTATION" followed by a space followed by a parenthesized
- * token group with all whitespace removed.</p>
- *
- * <p>The value will be the value as reported to applications,
- * appropriately normalized and with entity and character
- * references expanded. </p>
- *
- * @param eName The name of the associated element.
- * @param aName The name of the attribute.
- * @param type A string representing the attribute type.
- * @param mode A string representing the attribute defaulting mode
- * ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
- * none of these applies.
- * @param value A string representing the attribute's default value,
- * or null if there is none.
- * @exception SAXException The application may raise an exception.
- */
- public abstract void attributeDecl (String eName,
- String aName,
- String type,
- String mode,
- String value)
- throws SAXException;
-
-
- /**
- * Report an internal entity declaration.
- *
- * <p>Only the effective (first) declaration for each entity
- * will be reported. All parameter entities in the value
- * will be expanded, but general entities will not.</p>
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @param value The replacement text of the entity.
- * @exception SAXException The application may raise an exception.
- * @see #externalEntityDecl
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public abstract void internalEntityDecl (String name, String value)
- throws SAXException;
-
-
- /**
- * Report a parsed external entity declaration.
- *
- * <p>Only the effective (first) declaration for each entity
- * will be reported.</p>
- *
- * <p>If the system identifier is a URL, the parser must resolve it
- * fully before passing it to the application.</p>
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @param publicId The entity's public identifier, or null if none
- * was given.
- * @param systemId The entity's system identifier.
- * @exception SAXException The application may raise an exception.
- * @see #internalEntityDecl
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public abstract void externalEntityDecl (String name, String publicId,
- String systemId)
- throws SAXException;
-
-}
-
-// end of DeclHandler.java
diff --git a/libjava/external/sax/org/xml/sax/ext/DefaultHandler2.java b/libjava/external/sax/org/xml/sax/ext/DefaultHandler2.java
deleted file mode 100644
index 2b792e9df24..00000000000
--- a/libjava/external/sax/org/xml/sax/ext/DefaultHandler2.java
+++ /dev/null
@@ -1,130 +0,0 @@
-// DefaultHandler2.java - extended DefaultHandler
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: DefaultHandler2.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.ext;
-
-import java.io.IOException;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-
-/**
- * This class extends the SAX2 base handler class to support the
- * SAX2 {@link LexicalHandler}, {@link DeclHandler}, and
- * {@link EntityResolver2} extensions. Except for overriding the
- * original SAX1 {@link DefaultHandler#resolveEntity resolveEntity()}
- * method the added handler methods just return. Subclassers may
- * override everything on a method-by-method basis.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p> <em>Note:</em> this class might yet learn that the
- * <em>ContentHandler.setDocumentLocator()</em> call might be passed a
- * {@link Locator2} object, and that the
- * <em>ContentHandler.startElement()</em> call might be passed a
- * {@link Attributes2} object.
- *
- * @since SAX 2.0 (extensions 1.1 alpha)
- * @author David Brownell
- * @version TBS
- */
-public class DefaultHandler2 extends DefaultHandler
- implements LexicalHandler, DeclHandler, EntityResolver2
-{
- /** Constructs a handler which ignores all parsing events. */
- public DefaultHandler2 () { }
-
-
- // SAX2 ext-1.0 LexicalHandler
-
- public void startCDATA ()
- throws SAXException
- {}
-
- public void endCDATA ()
- throws SAXException
- {}
-
- public void startDTD (String name, String publicId, String systemId)
- throws SAXException
- {}
-
- public void endDTD ()
- throws SAXException
- {}
-
- public void startEntity (String name)
- throws SAXException
- {}
-
- public void endEntity (String name)
- throws SAXException
- {}
-
- public void comment (char ch [], int start, int length)
- throws SAXException
- { }
-
-
- // SAX2 ext-1.0 DeclHandler
-
- public void attributeDecl (String eName, String aName,
- String type, String mode, String value)
- throws SAXException
- {}
-
- public void elementDecl (String name, String model)
- throws SAXException
- {}
-
- public void externalEntityDecl (String name,
- String publicId, String systemId)
- throws SAXException
- {}
-
- public void internalEntityDecl (String name, String value)
- throws SAXException
- {}
-
- // SAX2 ext-1.1 EntityResolver2
-
- /**
- * Tells the parser that if no external subset has been declared
- * in the document text, none should be used.
- */
- public InputSource getExternalSubset (String name, String baseURI)
- throws SAXException, IOException
- { return null; }
-
- /**
- * Tells the parser to resolve the systemId against the baseURI
- * and read the entity text from that resulting absolute URI.
- * Note that because the older
- * {@link DefaultHandler#resolveEntity DefaultHandler.resolveEntity()},
- * method is overridden to call this one, this method may sometimes
- * be invoked with null <em>name</em> and <em>baseURI</em>, and
- * with the <em>systemId</em> already absolutized.
- */
- public InputSource resolveEntity (String name, String publicId,
- String baseURI, String systemId)
- throws SAXException, IOException
- { return null; }
-
- // SAX1 EntityResolver
-
- /**
- * Invokes
- * {@link EntityResolver2#resolveEntity EntityResolver2.resolveEntity()}
- * with null entity name and base URI.
- * You only need to override that method to use this class.
- */
- public InputSource resolveEntity (String publicId, String systemId)
- throws SAXException, IOException
- { return resolveEntity (null, publicId, null, systemId); }
-}
diff --git a/libjava/external/sax/org/xml/sax/ext/EntityResolver2.java b/libjava/external/sax/org/xml/sax/ext/EntityResolver2.java
deleted file mode 100644
index 57b0d83e852..00000000000
--- a/libjava/external/sax/org/xml/sax/ext/EntityResolver2.java
+++ /dev/null
@@ -1,197 +0,0 @@
-// EntityResolver2.java - Extended SAX entity resolver.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: EntityResolver2.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.ext;
-
-import java.io.IOException;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-
-/**
- * Extended interface for mapping external entity references to input
- * sources, or providing a missing external subset. The
- * {@link XMLReader#setEntityResolver XMLReader.setEntityResolver()} method
- * is used to provide implementations of this interface to parsers.
- * When a parser uses the methods in this interface, the
- * {@link EntityResolver2#resolveEntity EntityResolver2.resolveEntity()}
- * method (in this interface) is used <em>instead of</em> the older (SAX 1.0)
- * {@link EntityResolver#resolveEntity EntityResolver.resolveEntity()} method.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p>If a SAX application requires the customized handling which this
- * interface defines for external entities, it must ensure that it uses
- * an XMLReader with the
- * <em>http://xml.org/sax/features/use-entity-resolver2</em> feature flag
- * set to <em>true</em> (which is its default value when the feature is
- * recognized). If that flag is unrecognized, or its value is false,
- * or the resolver does not implement this interface, then only the
- * {@link EntityResolver} method will be used.
- * </p>
- *
- * <p>That supports three categories of application that modify entity
- * resolution. <em>Old Style</em> applications won't know about this interface;
- * they will provide an EntityResolver.
- * <em>Transitional Mode</em> provide an EntityResolver2 and automatically
- * get the benefit of its methods in any systems (parsers or other tools)
- * supporting it, due to polymorphism.
- * Both <em>Old Style</em> and <em>Transitional Mode</em> applications will
- * work with any SAX2 parser.
- * <em>New style</em> applications will fail to run except on SAX2 parsers
- * that support this particular feature.
- * They will insist that feature flag have a value of "true", and the
- * EntityResolver2 implementation they provide might throw an exception
- * if the original SAX 1.0 style entity resolution method is invoked.
- * </p>
- *
- * @see org.xml.sax.XMLReader#setEntityResolver
- *
- * @since SAX 2.0 (extensions 1.1 alpha)
- * @author David Brownell
- * @version TBD
- */
-public interface EntityResolver2 extends EntityResolver
-{
- /**
- * Allows applications to provide an external subset for documents
- * that don't explicitly define one. Documents with DOCTYPE declarations
- * that omit an external subset can thus augment the declarations
- * available for validation, entity processing, and attribute processing
- * (normalization, defaulting, and reporting types including ID).
- * This augmentation is reported
- * through the {@link LexicalHandler#startDTD startDTD()} method as if
- * the document text had originally included the external subset;
- * this callback is made before any internal subset data or errors
- * are reported.</p>
- *
- * <p>This method can also be used with documents that have no DOCTYPE
- * declaration. When the root element is encountered,
- * but no DOCTYPE declaration has been seen, this method is
- * invoked. If it returns a value for the external subset, that root
- * element is declared to be the root element, giving the effect of
- * splicing a DOCTYPE declaration at the end the prolog of a document
- * that could not otherwise be valid. The sequence of parser callbacks
- * in that case logically resembles this:</p>
- *
- * <pre>
- * ... comments and PIs from the prolog (as usual)
- * startDTD ("rootName", source.getPublicId (), source.getSystemId ());
- * startEntity ("[dtd]");
- * ... declarations, comments, and PIs from the external subset
- * endEntity ("[dtd]");
- * endDTD ();
- * ... then the rest of the document (as usual)
- * startElement (..., "rootName", ...);
- * </pre>
- *
- * <p>Note that the InputSource gets no further resolution.
- * Implementations of this method may wish to invoke
- * {@link #resolveEntity resolveEntity()} to gain benefits such as use
- * of local caches of DTD entities. Also, this method will never be
- * used by a (non-validating) processor that is not including external
- * parameter entities. </p>
- *
- * <p>Uses for this method include facilitating data validation when
- * interoperating with XML processors that would always require
- * undesirable network accesses for external entities, or which for
- * other reasons adopt a "no DTDs" policy.
- * Non-validation motives include forcing documents to include DTDs so
- * that attributes are handled consistently.
- * For example, an XPath processor needs to know which attibutes have
- * type "ID" before it can process a widely used type of reference.</p>
- *
- * <p><strong>Warning:</strong> Returning an external subset modifies
- * the input document. By providing definitions for general entities,
- * it can make a malformed document appear to be well formed.
- * </p>
- *
- * @param name Identifies the document root element. This name comes
- * from a DOCTYPE declaration (where available) or from the actual
- * root element.
- * @param baseURI The document's base URI, serving as an additional
- * hint for selecting the external subset. This is always an absolute
- * URI, unless it is null because the XMLReader was given an InputSource
- * without one.
- *
- * @return An InputSource object describing the new external subset
- * to be used by the parser, or null to indicate that no external
- * subset is provided.
- *
- * @exception SAXException Any SAX exception, possibly wrapping
- * another exception.
- * @exception IOException Probably indicating a failure to create
- * a new InputStream or Reader, or an illegal URL.
- */
- public InputSource getExternalSubset (String name, String baseURI)
- throws SAXException, IOException;
-
- /**
- * Allows applications to map references to external entities into input
- * sources, or tell the parser it should use conventional URI resolution.
- * This method is only called for external entities which have been
- * properly declared.
- * This method provides more flexibility than the {@link EntityResolver}
- * interface, supporting implementations of more complex catalogue
- * schemes such as the one defined by the <a href=
- "http://www.oasis-open.org/committees/entity/spec-2001-08-06.html"
- >OASIS XML Catalogs</a> specification.</p>
- *
- * <p>Parsers configured to use this resolver method will call it
- * to determine the input source to use for any external entity
- * being included because of a reference in the XML text.
- * That excludes the document entity, and any external entity returned
- * by {@link #getExternalSubset getExternalSubset()}.
- * When a (non-validating) processor is configured not to include
- * a class of entities (parameter or general) through use of feature
- * flags, this method is not invoked for such entities. </p>
- *
- * <p>Note that the entity naming scheme used here is the same one
- * used in the {@link LexicalHandler}, or in the {@link
- org.xml.sax.ContentHandler#skippedEntity
- ContentHandler.skippedEntity()}
- * method. </p>
- *
- * @param name Identifies the external entity being resolved.
- * Either "[dtd]" for the external subset, or a name starting
- * with "%" to indicate a parameter entity, or else the name of
- * a general entity. This is never null when invoked by a SAX2
- * parser.
- * @param publicId The public identifier of the external entity being
- * referenced (normalized as required by the XML specification), or
- * null if none was supplied.
- * @param baseURI The URI with respect to which relative systemIDs
- * are interpreted. This is always an absolute URI, unless it is
- * null (likely because the XMLReader was given an InputSource without
- * one). This URI is defined by the XML specification to be the one
- * associated with the "&lt;" starting the relevant declaration.
- * @param systemId The system identifier of the external entity
- * being referenced; either a relative or absolute URI.
- * This is never null when invoked by a SAX2 parser; only declared
- * entities, and any external subset, are resolved by such parsers.
- *
- * @return An InputSource object describing the new input source to
- * be used by the parser. Returning null directs the parser to
- * resolve the system ID against the base URI and open a connection
- * to resulting URI.
- *
- * @exception SAXException Any SAX exception, possibly wrapping
- * another exception.
- * @exception IOException Probably indicating a failure to create
- * a new InputStream or Reader, or an illegal URL.
- */
- public InputSource resolveEntity (
- String name,
- String publicId,
- String baseURI,
- String systemId
- ) throws SAXException, IOException;
-}
diff --git a/libjava/external/sax/org/xml/sax/ext/LexicalHandler.java b/libjava/external/sax/org/xml/sax/ext/LexicalHandler.java
deleted file mode 100644
index 076bdf857c2..00000000000
--- a/libjava/external/sax/org/xml/sax/ext/LexicalHandler.java
+++ /dev/null
@@ -1,212 +0,0 @@
-// LexicalHandler.java - optional handler for lexical parse events.
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: LexicalHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.SAXException;
-
-/**
- * SAX2 extension handler for lexical events.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This is an optional extension handler for SAX2 to provide
- * lexical information about an XML document, such as comments
- * and CDATA section boundaries.
- * XML readers are not required to recognize this handler, and it
- * is not part of core-only SAX2 distributions.</p>
- *
- * <p>The events in the lexical handler apply to the entire document,
- * not just to the document element, and all lexical handler events
- * must appear between the content handler's startDocument and
- * endDocument events.</p>
- *
- * <p>To set the LexicalHandler for an XML reader, use the
- * {@link org.xml.sax.XMLReader#setProperty setProperty} method
- * with the property name
- * <code>http://xml.org/sax/properties/lexical-handler</code>
- * and an object implementing this interface (or null) as the value.
- * If the reader does not report lexical events, it will throw a
- * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}
- * when you attempt to register the handler.</p>
- *
- * @since SAX 2.0 (extensions 1.0)
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- */
-public interface LexicalHandler
-{
-
- /**
- * Report the start of DTD declarations, if any.
- *
- * <p>This method is intended to report the beginning of the
- * DOCTYPE declaration; if the document has no DOCTYPE declaration,
- * this method will not be invoked.</p>
- *
- * <p>All declarations reported through
- * {@link org.xml.sax.DTDHandler DTDHandler} or
- * {@link org.xml.sax.ext.DeclHandler DeclHandler} events must appear
- * between the startDTD and {@link #endDTD endDTD} events.
- * Declarations are assumed to belong to the internal DTD subset
- * unless they appear between {@link #startEntity startEntity}
- * and {@link #endEntity endEntity} events. Comments and
- * processing instructions from the DTD should also be reported
- * between the startDTD and endDTD events, in their original
- * order of (logical) occurrence; they are not required to
- * appear in their correct locations relative to DTDHandler
- * or DeclHandler events, however.</p>
- *
- * <p>Note that the start/endDTD events will appear within
- * the start/endDocument events from ContentHandler and
- * before the first
- * {@link org.xml.sax.ContentHandler#startElement startElement}
- * event.</p>
- *
- * @param name The document type name.
- * @param publicId The declared public identifier for the
- * external DTD subset, or null if none was declared.
- * @param systemId The declared system identifier for the
- * external DTD subset, or null if none was declared.
- * (Note that this is not resolved against the document
- * base URI.)
- * @exception SAXException The application may raise an
- * exception.
- * @see #endDTD
- * @see #startEntity
- */
- public abstract void startDTD (String name, String publicId,
- String systemId)
- throws SAXException;
-
-
- /**
- * Report the end of DTD declarations.
- *
- * <p>This method is intended to report the end of the
- * DOCTYPE declaration; if the document has no DOCTYPE declaration,
- * this method will not be invoked.</p>
- *
- * @exception SAXException The application may raise an exception.
- * @see #startDTD
- */
- public abstract void endDTD ()
- throws SAXException;
-
-
- /**
- * Report the beginning of some internal and external XML entities.
- *
- * <p>The reporting of parameter entities (including
- * the external DTD subset) is optional, and SAX2 drivers that
- * report LexicalHandler events may not implement it; you can use the
- * <code
- * >http://xml.org/sax/features/lexical-handler/parameter-entities</code>
- * feature to query or control the reporting of parameter entities.</p>
- *
- * <p>General entities are reported with their regular names,
- * parameter entities have '%' prepended to their names, and
- * the external DTD subset has the pseudo-entity name "[dtd]".</p>
- *
- * <p>When a SAX2 driver is providing these events, all other
- * events must be properly nested within start/end entity
- * events. There is no additional requirement that events from
- * {@link org.xml.sax.ext.DeclHandler DeclHandler} or
- * {@link org.xml.sax.DTDHandler DTDHandler} be properly ordered.</p>
- *
- * <p>Note that skipped entities will be reported through the
- * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity}
- * event, which is part of the ContentHandler interface.</p>
- *
- * <p>Because of the streaming event model that SAX uses, some
- * entity boundaries cannot be reported under any
- * circumstances:</p>
- *
- * <ul>
- * <li>general entities within attribute values</li>
- * <li>parameter entities within declarations</li>
- * </ul>
- *
- * <p>These will be silently expanded, with no indication of where
- * the original entity boundaries were.</p>
- *
- * <p>Note also that the boundaries of character references (which
- * are not really entities anyway) are not reported.</p>
- *
- * <p>All start/endEntity events must be properly nested.
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%', and if it is the
- * external DTD subset, it will be "[dtd]".
- * @exception SAXException The application may raise an exception.
- * @see #endEntity
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
- */
- public abstract void startEntity (String name)
- throws SAXException;
-
-
- /**
- * Report the end of an entity.
- *
- * @param name The name of the entity that is ending.
- * @exception SAXException The application may raise an exception.
- * @see #startEntity
- */
- public abstract void endEntity (String name)
- throws SAXException;
-
-
- /**
- * Report the start of a CDATA section.
- *
- * <p>The contents of the CDATA section will be reported through
- * the regular {@link org.xml.sax.ContentHandler#characters
- * characters} event; this event is intended only to report
- * the boundary.</p>
- *
- * @exception SAXException The application may raise an exception.
- * @see #endCDATA
- */
- public abstract void startCDATA ()
- throws SAXException;
-
-
- /**
- * Report the end of a CDATA section.
- *
- * @exception SAXException The application may raise an exception.
- * @see #startCDATA
- */
- public abstract void endCDATA ()
- throws SAXException;
-
-
- /**
- * Report an XML comment anywhere in the document.
- *
- * <p>This callback will be used for comments inside or outside the
- * document element, including comments in the external DTD
- * subset (if read). Comments in the DTD must be properly
- * nested inside start/endDTD and start/endEntity events (if
- * used).</p>
- *
- * @param ch An array holding the characters in the comment.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @exception SAXException The application may raise an exception.
- */
- public abstract void comment (char ch[], int start, int length)
- throws SAXException;
-
-}
-
-// end of LexicalHandler.java
diff --git a/libjava/external/sax/org/xml/sax/ext/Locator2.java b/libjava/external/sax/org/xml/sax/ext/Locator2.java
deleted file mode 100644
index 5fe3ba7706a..00000000000
--- a/libjava/external/sax/org/xml/sax/ext/Locator2.java
+++ /dev/null
@@ -1,75 +0,0 @@
-// Locator2.java - extended Locator
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: Locator2.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.Locator;
-
-
-/**
- * SAX2 extension to augment the entity information provided
- * though a {@link Locator}.
- * If an implementation supports this extension, the Locator
- * provided in {@link org.xml.sax.ContentHandler#setDocumentLocator
- * ContentHandler.setDocumentLocator() } will implement this
- * interface, and the
- * <em>http://xml.org/sax/features/use-locator2</em> feature
- * flag will have the value <em>true</em>.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p> XMLReader implementations are not required to support this
- * information, and it is not part of core-only SAX2 distributions.</p>
- *
- * @since SAX 2.0 (extensions 1.1 alpha)
- * @author David Brownell
- * @version TBS
- */
-public interface Locator2 extends Locator
-{
- /**
- * Returns the version of XML used for the entity. This will
- * normally be the identifier from the current entity's
- * <em>&lt;?xml&nbsp;version='...'&nbsp;...?&gt;</em> declaration,
- * or be defaulted by the parser.
- *
- * @return Identifier for the XML version being used to interpret
- * the entity's text, or null if that information is not yet
- * available in the current parsing state.
- */
- public String getXMLVersion ();
-
- /**
- * Returns the name of the character encoding for the entity.
- * If the encoding was declared externally (for example, in a MIME
- * Content-Type header), that will be the name returned. Else if there
- * was an <em>&lt;?xml&nbsp;...encoding='...'?&gt;</em> declaration at
- * the start of the document, that encoding name will be returned.
- * Otherwise the encoding will been inferred (normally to be UTF-8, or
- * some UTF-16 variant), and that inferred name will be returned.
- *
- * <p>When an {@link org.xml.sax.InputSource InputSource} is used
- * to provide an entity's character stream, this method returns the
- * encoding provided in that input stream.
- *
- * <p> Note that some recent W3C specifications require that text
- * in some encodings be normalized, using Unicode Normalization
- * Form C, before processing. Such normalization must be performed
- * by applications, and would normally be triggered based on the
- * value returned by this method.
- *
- * <p> Encoding names may be those used by the underlying JVM,
- * and comparisons should be case-insensitive.
- *
- * @return Name of the character encoding being used to interpret
- * * the entity's text, or null if this was not provided for a *
- * character stream passed through an InputSource or is otherwise
- * not yet available in the current parsing state.
- */
- public String getEncoding ();
-}
diff --git a/libjava/external/sax/org/xml/sax/ext/Locator2Impl.java b/libjava/external/sax/org/xml/sax/ext/Locator2Impl.java
deleted file mode 100644
index 52f6331b5ab..00000000000
--- a/libjava/external/sax/org/xml/sax/ext/Locator2Impl.java
+++ /dev/null
@@ -1,101 +0,0 @@
-// Locator2Impl.java - extended LocatorImpl
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: Locator2Impl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.Locator;
-import org.xml.sax.helpers.LocatorImpl;
-
-
-/**
- * SAX2 extension helper for holding additional Entity information,
- * implementing the {@link Locator2} interface.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p> This is not part of core-only SAX2 distributions.</p>
- *
- * @since SAX 2.0.2
- * @author David Brownell
- * @version TBS
- */
-public class Locator2Impl extends LocatorImpl implements Locator2
-{
- private String encoding;
- private String version;
-
-
- /**
- * Construct a new, empty Locator2Impl object.
- * This will not normally be useful, since the main purpose
- * of this class is to make a snapshot of an existing Locator.
- */
- public Locator2Impl () { }
-
- /**
- * Copy an existing Locator or Locator2 object.
- * If the object implements Locator2, values of the
- * <em>encoding</em> and <em>version</em>strings are copied,
- * otherwise they set to <em>null</em>.
- *
- * @param locator The existing Locator object.
- */
- public Locator2Impl (Locator locator)
- {
- super (locator);
- if (locator instanceof Locator2) {
- Locator2 l2 = (Locator2) locator;
-
- version = l2.getXMLVersion ();
- encoding = l2.getEncoding ();
- }
- }
-
- ////////////////////////////////////////////////////////////////////
- // Locator2 method implementations
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Returns the current value of the version property.
- *
- * @see #setXMLVersion
- */
- public String getXMLVersion ()
- { return version; }
-
- /**
- * Returns the current value of the encoding property.
- *
- * @see #setEncoding
- */
- public String getEncoding ()
- { return encoding; }
-
-
- ////////////////////////////////////////////////////////////////////
- // Setters
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Assigns the current value of the version property.
- *
- * @param version the new "version" value
- * @see #getXMLVersion
- */
- public void setXMLVersion (String version)
- { this.version = version; }
-
- /**
- * Assigns the current value of the encoding property.
- *
- * @param encoding the new "encoding" value
- * @see #getEncoding
- */
- public void setEncoding (String encoding)
- { this.encoding = encoding; }
-}
diff --git a/libjava/external/sax/org/xml/sax/ext/package.html b/libjava/external/sax/org/xml/sax/ext/package.html
deleted file mode 100644
index 0b744800108..00000000000
--- a/libjava/external/sax/org/xml/sax/ext/package.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<HTML><HEAD>
-<!-- $Id: package.html,v 1.1 2004/12/23 22:38:42 mark Exp $ -->
-</HEAD><BODY>
-
-<p>
-This package contains interfaces to SAX2 facilities that
-conformant SAX drivers won't necessarily support.
-
-<p>See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
-for more information about SAX.</p>
-
-<p> This package is independent of the SAX2 core, though the functionality
-exposed generally needs to be implemented within a parser core.
-That independence has several consequences:</p>
-
-<ul>
-
-<li>SAX2 drivers are <em>not</em> required to recognize these handlers.
-</li>
-
-<li>You cannot assume that the class files will be present in every SAX2
-installation.</li>
-
-<li>This package may be updated independently of SAX2 (i.e. new
-handlers and classes may be added without updating SAX2 itself).</li>
-
-<li>The new handlers are not implemented by the SAX2
-<code>org.xml.sax.helpers.DefaultHandler</code> or
-<code>org.xml.sax.helpers.XMLFilterImpl</code> classes.
-You can subclass these if you need such behavior, or
-use the helper classes found here.</li>
-
-<li>The handlers need to be registered differently than core SAX2
-handlers.</li>
-
-</ul>
-
-<p>This package, SAX2-ext, is a standardized extension to SAX2. It is
-designed both to allow SAX parsers to pass certain types of information
-to applications, and to serve as a simple model for other SAX2 parser
-extension packages. Not all such extension packages should need to
-be recognized directly by parsers, however.
-As an example, most validation systems can be cleanly layered on top
-of parsers supporting the standardized SAX2 interfaces. </p>
-
-</BODY></HTML>
diff --git a/libjava/external/sax/org/xml/sax/helpers/AttributeListImpl.java b/libjava/external/sax/org/xml/sax/helpers/AttributeListImpl.java
deleted file mode 100644
index ca859fb1450..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/AttributeListImpl.java
+++ /dev/null
@@ -1,312 +0,0 @@
-// SAX default implementation for AttributeList.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: AttributeListImpl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.helpers;
-
-import org.xml.sax.AttributeList;
-
-import java.util.Vector;
-
-
-/**
- * Default implementation for AttributeList.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>AttributeList implements the deprecated SAX1 {@link
- * org.xml.sax.AttributeList AttributeList} interface, and has been
- * replaced by the new SAX2 {@link org.xml.sax.helpers.AttributesImpl
- * AttributesImpl} interface.</p>
- *
- * <p>This class provides a convenience implementation of the SAX
- * {@link org.xml.sax.AttributeList AttributeList} interface. This
- * implementation is useful both for SAX parser writers, who can use
- * it to provide attributes to the application, and for SAX application
- * writers, who can use it to create a persistent copy of an element's
- * attribute specifications:</p>
- *
- * <pre>
- * private AttributeList myatts;
- *
- * public void startElement (String name, AttributeList atts)
- * {
- * // create a persistent copy of the attribute list
- * // for use outside this method
- * myatts = new AttributeListImpl(atts);
- * [...]
- * }
- * </pre>
- *
- * <p>Please note that SAX parsers are not required to use this
- * class to provide an implementation of AttributeList; it is
- * supplied only as an optional convenience. In particular,
- * parser writers are encouraged to invent more efficient
- * implementations.</p>
- *
- * @deprecated This class implements a deprecated interface,
- * {@link org.xml.sax.AttributeList AttributeList};
- * that interface has been replaced by
- * {@link org.xml.sax.Attributes Attributes},
- * which is implemented in the
- * {@link org.xml.sax.helpers.AttributesImpl
- * AttributesImpl} helper class.
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.AttributeList
- * @see org.xml.sax.DocumentHandler#startElement
- */
-public class AttributeListImpl implements AttributeList
-{
-
- /**
- * Create an empty attribute list.
- *
- * <p>This constructor is most useful for parser writers, who
- * will use it to create a single, reusable attribute list that
- * can be reset with the clear method between elements.</p>
- *
- * @see #addAttribute
- * @see #clear
- */
- public AttributeListImpl ()
- {
- }
-
-
- /**
- * Construct a persistent copy of an existing attribute list.
- *
- * <p>This constructor is most useful for application writers,
- * who will use it to create a persistent copy of an existing
- * attribute list.</p>
- *
- * @param atts The attribute list to copy
- * @see org.xml.sax.DocumentHandler#startElement
- */
- public AttributeListImpl (AttributeList atts)
- {
- setAttributeList(atts);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Methods specific to this class.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the attribute list, discarding previous contents.
- *
- * <p>This method allows an application writer to reuse an
- * attribute list easily.</p>
- *
- * @param atts The attribute list to copy.
- */
- public void setAttributeList (AttributeList atts)
- {
- int count = atts.getLength();
-
- clear();
-
- for (int i = 0; i < count; i++) {
- addAttribute(atts.getName(i), atts.getType(i), atts.getValue(i));
- }
- }
-
-
- /**
- * Add an attribute to an attribute list.
- *
- * <p>This method is provided for SAX parser writers, to allow them
- * to build up an attribute list incrementally before delivering
- * it to the application.</p>
- *
- * @param name The attribute name.
- * @param type The attribute type ("NMTOKEN" for an enumeration).
- * @param value The attribute value (must not be null).
- * @see #removeAttribute
- * @see org.xml.sax.DocumentHandler#startElement
- */
- public void addAttribute (String name, String type, String value)
- {
- names.addElement(name);
- types.addElement(type);
- values.addElement(value);
- }
-
-
- /**
- * Remove an attribute from the list.
- *
- * <p>SAX application writers can use this method to filter an
- * attribute out of an AttributeList. Note that invoking this
- * method will change the length of the attribute list and
- * some of the attribute's indices.</p>
- *
- * <p>If the requested attribute is not in the list, this is
- * a no-op.</p>
- *
- * @param name The attribute name.
- * @see #addAttribute
- */
- public void removeAttribute (String name)
- {
- int i = names.indexOf(name);
-
- if (i >= 0) {
- names.removeElementAt(i);
- types.removeElementAt(i);
- values.removeElementAt(i);
- }
- }
-
-
- /**
- * Clear the attribute list.
- *
- * <p>SAX parser writers can use this method to reset the attribute
- * list between DocumentHandler.startElement events. Normally,
- * it will make sense to reuse the same AttributeListImpl object
- * rather than allocating a new one each time.</p>
- *
- * @see org.xml.sax.DocumentHandler#startElement
- */
- public void clear ()
- {
- names.removeAllElements();
- types.removeAllElements();
- values.removeAllElements();
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.AttributeList
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the number of attributes in the list.
- *
- * @return The number of attributes in the list.
- * @see org.xml.sax.AttributeList#getLength
- */
- public int getLength ()
- {
- return names.size();
- }
-
-
- /**
- * Get the name of an attribute (by position).
- *
- * @param i The position of the attribute in the list.
- * @return The attribute name as a string, or null if there
- * is no attribute at that position.
- * @see org.xml.sax.AttributeList#getName(int)
- */
- public String getName (int i)
- {
- if (i < 0) {
- return null;
- }
- try {
- return (String)names.elementAt(i);
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
-
-
- /**
- * Get the type of an attribute (by position).
- *
- * @param i The position of the attribute in the list.
- * @return The attribute type as a string ("NMTOKEN" for an
- * enumeration, and "CDATA" if no declaration was
- * read), or null if there is no attribute at
- * that position.
- * @see org.xml.sax.AttributeList#getType(int)
- */
- public String getType (int i)
- {
- if (i < 0) {
- return null;
- }
- try {
- return (String)types.elementAt(i);
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
-
-
- /**
- * Get the value of an attribute (by position).
- *
- * @param i The position of the attribute in the list.
- * @return The attribute value as a string, or null if
- * there is no attribute at that position.
- * @see org.xml.sax.AttributeList#getValue(int)
- */
- public String getValue (int i)
- {
- if (i < 0) {
- return null;
- }
- try {
- return (String)values.elementAt(i);
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
-
-
- /**
- * Get the type of an attribute (by name).
- *
- * @param name The attribute name.
- * @return The attribute type as a string ("NMTOKEN" for an
- * enumeration, and "CDATA" if no declaration was
- * read).
- * @see org.xml.sax.AttributeList#getType(java.lang.String)
- */
- public String getType (String name)
- {
- return getType(names.indexOf(name));
- }
-
-
- /**
- * Get the value of an attribute (by name).
- *
- * @param name The attribute name.
- * @see org.xml.sax.AttributeList#getValue(java.lang.String)
- */
- public String getValue (String name)
- {
- return getValue(names.indexOf(name));
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- Vector names = new Vector();
- Vector types = new Vector();
- Vector values = new Vector();
-
-}
-
-// end of AttributeListImpl.java
diff --git a/libjava/external/sax/org/xml/sax/helpers/AttributesImpl.java b/libjava/external/sax/org/xml/sax/helpers/AttributesImpl.java
deleted file mode 100644
index 8753968ba0a..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/AttributesImpl.java
+++ /dev/null
@@ -1,618 +0,0 @@
-// AttributesImpl.java - default implementation of Attributes.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: AttributesImpl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.helpers;
-
-import org.xml.sax.Attributes;
-
-
-/**
- * Default implementation of the Attributes interface.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class provides a default implementation of the SAX2
- * {@link org.xml.sax.Attributes Attributes} interface, with the
- * addition of manipulators so that the list can be modified or
- * reused.</p>
- *
- * <p>There are two typical uses of this class:</p>
- *
- * <ol>
- * <li>to take a persistent snapshot of an Attributes object
- * in a {@link org.xml.sax.ContentHandler#startElement startElement} event; or</li>
- * <li>to construct or modify an Attributes object in a SAX2 driver or filter.</li>
- * </ol>
- *
- * <p>This class replaces the now-deprecated SAX1 {@link
- * org.xml.sax.helpers.AttributeListImpl AttributeListImpl}
- * class; in addition to supporting the updated Attributes
- * interface rather than the deprecated {@link org.xml.sax.AttributeList
- * AttributeList} interface, it also includes a much more efficient
- * implementation using a single array rather than a set of Vectors.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- */
-public class AttributesImpl implements Attributes
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Constructors.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Construct a new, empty AttributesImpl object.
- */
- public AttributesImpl ()
- {
- length = 0;
- data = null;
- }
-
-
- /**
- * Copy an existing Attributes object.
- *
- * <p>This constructor is especially useful inside a
- * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
- *
- * @param atts The existing Attributes object.
- */
- public AttributesImpl (Attributes atts)
- {
- setAttributes(atts);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.Attributes.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the number of attributes in the list.
- *
- * @return The number of attributes in the list.
- * @see org.xml.sax.Attributes#getLength
- */
- public int getLength ()
- {
- return length;
- }
-
-
- /**
- * Return an attribute's Namespace URI.
- *
- * @param index The attribute's index (zero-based).
- * @return The Namespace URI, the empty string if none is
- * available, or null if the index is out of range.
- * @see org.xml.sax.Attributes#getURI
- */
- public String getURI (int index)
- {
- if (index >= 0 && index < length) {
- return data[index*5];
- } else {
- return null;
- }
- }
-
-
- /**
- * Return an attribute's local name.
- *
- * @param index The attribute's index (zero-based).
- * @return The attribute's local name, the empty string if
- * none is available, or null if the index if out of range.
- * @see org.xml.sax.Attributes#getLocalName
- */
- public String getLocalName (int index)
- {
- if (index >= 0 && index < length) {
- return data[index*5+1];
- } else {
- return null;
- }
- }
-
-
- /**
- * Return an attribute's qualified (prefixed) name.
- *
- * @param index The attribute's index (zero-based).
- * @return The attribute's qualified name, the empty string if
- * none is available, or null if the index is out of bounds.
- * @see org.xml.sax.Attributes#getQName
- */
- public String getQName (int index)
- {
- if (index >= 0 && index < length) {
- return data[index*5+2];
- } else {
- return null;
- }
- }
-
-
- /**
- * Return an attribute's type by index.
- *
- * @param index The attribute's index (zero-based).
- * @return The attribute's type, "CDATA" if the type is unknown, or null
- * if the index is out of bounds.
- * @see org.xml.sax.Attributes#getType(int)
- */
- public String getType (int index)
- {
- if (index >= 0 && index < length) {
- return data[index*5+3];
- } else {
- return null;
- }
- }
-
-
- /**
- * Return an attribute's value by index.
- *
- * @param index The attribute's index (zero-based).
- * @return The attribute's value or null if the index is out of bounds.
- * @see org.xml.sax.Attributes#getValue(int)
- */
- public String getValue (int index)
- {
- if (index >= 0 && index < length) {
- return data[index*5+4];
- } else {
- return null;
- }
- }
-
-
- /**
- * Look up an attribute's index by Namespace name.
- *
- * <p>In many cases, it will be more efficient to look up the name once and
- * use the index query methods rather than using the name query methods
- * repeatedly.</p>
- *
- * @param uri The attribute's Namespace URI, or the empty
- * string if none is available.
- * @param localName The attribute's local name.
- * @return The attribute's index, or -1 if none matches.
- * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String)
- */
- public int getIndex (String uri, String localName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i].equals(uri) && data[i+1].equals(localName)) {
- return i / 5;
- }
- }
- return -1;
- }
-
-
- /**
- * Look up an attribute's index by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attribute's index, or -1 if none matches.
- * @see org.xml.sax.Attributes#getIndex(java.lang.String)
- */
- public int getIndex (String qName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i+2].equals(qName)) {
- return i / 5;
- }
- }
- return -1;
- }
-
-
- /**
- * Look up an attribute's type by Namespace-qualified name.
- *
- * @param uri The Namespace URI, or the empty string for a name
- * with no explicit Namespace URI.
- * @param localName The local name.
- * @return The attribute's type, or null if there is no
- * matching attribute.
- * @see org.xml.sax.Attributes#getType(java.lang.String,java.lang.String)
- */
- public String getType (String uri, String localName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i].equals(uri) && data[i+1].equals(localName)) {
- return data[i+3];
- }
- }
- return null;
- }
-
-
- /**
- * Look up an attribute's type by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attribute's type, or null if there is no
- * matching attribute.
- * @see org.xml.sax.Attributes#getType(java.lang.String)
- */
- public String getType (String qName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i+2].equals(qName)) {
- return data[i+3];
- }
- }
- return null;
- }
-
-
- /**
- * Look up an attribute's value by Namespace-qualified name.
- *
- * @param uri The Namespace URI, or the empty string for a name
- * with no explicit Namespace URI.
- * @param localName The local name.
- * @return The attribute's value, or null if there is no
- * matching attribute.
- * @see org.xml.sax.Attributes#getValue(java.lang.String,java.lang.String)
- */
- public String getValue (String uri, String localName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i].equals(uri) && data[i+1].equals(localName)) {
- return data[i+4];
- }
- }
- return null;
- }
-
-
- /**
- * Look up an attribute's value by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attribute's value, or null if there is no
- * matching attribute.
- * @see org.xml.sax.Attributes#getValue(java.lang.String)
- */
- public String getValue (String qName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i+2].equals(qName)) {
- return data[i+4];
- }
- }
- return null;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Manipulators.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Clear the attribute list for reuse.
- *
- * <p>Note that little memory is freed by this call:
- * the current array is kept so it can be
- * reused.</p>
- */
- public void clear ()
- {
- if (data != null) {
- for (int i = 0; i < (length * 5); i++)
- data [i] = null;
- }
- length = 0;
- }
-
-
- /**
- * Copy an entire Attributes object.
- *
- * <p>It may be more efficient to reuse an existing object
- * rather than constantly allocating new ones.</p>
- *
- * @param atts The attributes to copy.
- */
- public void setAttributes (Attributes atts)
- {
- clear();
- length = atts.getLength();
- if (length > 0) {
- data = new String[length*5];
- for (int i = 0; i < length; i++) {
- data[i*5] = atts.getURI(i);
- data[i*5+1] = atts.getLocalName(i);
- data[i*5+2] = atts.getQName(i);
- data[i*5+3] = atts.getType(i);
- data[i*5+4] = atts.getValue(i);
- }
- }
- }
-
-
- /**
- * Add an attribute to the end of the list.
- *
- * <p>For the sake of speed, this method does no checking
- * to see if the attribute is already in the list: that is
- * the responsibility of the application.</p>
- *
- * @param uri The Namespace URI, or the empty string if
- * none is available or Namespace processing is not
- * being performed.
- * @param localName The local name, or the empty string if
- * Namespace processing is not being performed.
- * @param qName The qualified (prefixed) name, or the empty string
- * if qualified names are not available.
- * @param type The attribute type as a string.
- * @param value The attribute value.
- */
- public void addAttribute (String uri, String localName, String qName,
- String type, String value)
- {
- ensureCapacity(length+1);
- data[length*5] = uri;
- data[length*5+1] = localName;
- data[length*5+2] = qName;
- data[length*5+3] = type;
- data[length*5+4] = value;
- length++;
- }
-
-
- /**
- * Set an attribute in the list.
- *
- * <p>For the sake of speed, this method does no checking
- * for name conflicts or well-formedness: such checks are the
- * responsibility of the application.</p>
- *
- * @param index The index of the attribute (zero-based).
- * @param uri The Namespace URI, or the empty string if
- * none is available or Namespace processing is not
- * being performed.
- * @param localName The local name, or the empty string if
- * Namespace processing is not being performed.
- * @param qName The qualified name, or the empty string
- * if qualified names are not available.
- * @param type The attribute type as a string.
- * @param value The attribute value.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setAttribute (int index, String uri, String localName,
- String qName, String type, String value)
- {
- if (index >= 0 && index < length) {
- data[index*5] = uri;
- data[index*5+1] = localName;
- data[index*5+2] = qName;
- data[index*5+3] = type;
- data[index*5+4] = value;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Remove an attribute from the list.
- *
- * @param index The index of the attribute (zero-based).
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void removeAttribute (int index)
- {
- if (index >= 0 && index < length) {
- if (index < length - 1) {
- System.arraycopy(data, (index+1)*5, data, index*5,
- (length-index-1)*5);
- }
- index = (length - 1) * 5;
- data [index++] = null;
- data [index++] = null;
- data [index++] = null;
- data [index++] = null;
- data [index] = null;
- length--;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Set the Namespace URI of a specific attribute.
- *
- * @param index The index of the attribute (zero-based).
- * @param uri The attribute's Namespace URI, or the empty
- * string for none.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setURI (int index, String uri)
- {
- if (index >= 0 && index < length) {
- data[index*5] = uri;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Set the local name of a specific attribute.
- *
- * @param index The index of the attribute (zero-based).
- * @param localName The attribute's local name, or the empty
- * string for none.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setLocalName (int index, String localName)
- {
- if (index >= 0 && index < length) {
- data[index*5+1] = localName;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Set the qualified name of a specific attribute.
- *
- * @param index The index of the attribute (zero-based).
- * @param qName The attribute's qualified name, or the empty
- * string for none.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setQName (int index, String qName)
- {
- if (index >= 0 && index < length) {
- data[index*5+2] = qName;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Set the type of a specific attribute.
- *
- * @param index The index of the attribute (zero-based).
- * @param type The attribute's type.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setType (int index, String type)
- {
- if (index >= 0 && index < length) {
- data[index*5+3] = type;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Set the value of a specific attribute.
- *
- * @param index The index of the attribute (zero-based).
- * @param value The attribute's value.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setValue (int index, String value)
- {
- if (index >= 0 && index < length) {
- data[index*5+4] = value;
- } else {
- badIndex(index);
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal methods.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Ensure the internal array's capacity.
- *
- * @param n The minimum number of attributes that the array must
- * be able to hold.
- */
- private void ensureCapacity (int n) {
- if (n <= 0) {
- return;
- }
- int max;
- if (data == null || data.length == 0) {
- max = 25;
- }
- else if (data.length >= n * 5) {
- return;
- }
- else {
- max = data.length;
- }
- while (max < n * 5) {
- max *= 2;
- }
-
- String newData[] = new String[max];
- if (length > 0) {
- System.arraycopy(data, 0, newData, 0, length*5);
- }
- data = newData;
- }
-
-
- /**
- * Report a bad array index in a manipulator.
- *
- * @param index The index to report.
- * @exception java.lang.ArrayIndexOutOfBoundsException Always.
- */
- private void badIndex (int index)
- throws ArrayIndexOutOfBoundsException
- {
- String msg =
- "Attempt to modify attribute at illegal index: " + index;
- throw new ArrayIndexOutOfBoundsException(msg);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- int length;
- String data [];
-
-}
-
-// end of AttributesImpl.java
-
diff --git a/libjava/external/sax/org/xml/sax/helpers/DefaultHandler.java b/libjava/external/sax/org/xml/sax/helpers/DefaultHandler.java
deleted file mode 100644
index e01c3be403d..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/DefaultHandler.java
+++ /dev/null
@@ -1,467 +0,0 @@
-// DefaultHandler.java - default implementation of the core handlers.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: DefaultHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.helpers;
-
-import java.io.IOException;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-
-/**
- * Default base class for SAX2 event handlers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class is available as a convenience base class for SAX2
- * applications: it provides default implementations for all of the
- * callbacks in the four core SAX2 handler classes:</p>
- *
- * <ul>
- * <li>{@link org.xml.sax.EntityResolver EntityResolver}</li>
- * <li>{@link org.xml.sax.DTDHandler DTDHandler}</li>
- * <li>{@link org.xml.sax.ContentHandler ContentHandler}</li>
- * <li>{@link org.xml.sax.ErrorHandler ErrorHandler}</li>
- * </ul>
- *
- * <p>Application writers can extend this class when they need to
- * implement only part of an interface; parser writers can
- * instantiate this class to provide default handlers when the
- * application has not supplied its own.</p>
- *
- * <p>This class replaces the deprecated SAX1
- * {@link org.xml.sax.HandlerBase HandlerBase} class.</p>
- *
- * @since SAX 2.0
- * @author David Megginson,
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.EntityResolver
- * @see org.xml.sax.DTDHandler
- * @see org.xml.sax.ContentHandler
- * @see org.xml.sax.ErrorHandler
- */
-public class DefaultHandler
- implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of the EntityResolver interface.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Resolve an external entity.
- *
- * <p>Always return null, so that the parser will use the system
- * identifier provided in the XML document. This method implements
- * the SAX default behaviour: application writers can override it
- * in a subclass to do special translations such as catalog lookups
- * or URI redirection.</p>
- *
- * @param publicId The public identifer, or null if none is
- * available.
- * @param systemId The system identifier provided in the XML
- * document.
- * @return The new input source, or null to require the
- * default behaviour.
- * @exception java.io.IOException If there is an error setting
- * up the new input source.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.EntityResolver#resolveEntity
- */
- public InputSource resolveEntity (String publicId, String systemId)
- throws IOException, SAXException
- {
- return null;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of DTDHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive notification of a notation declaration.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass if they wish to keep track of the notations
- * declared in a document.</p>
- *
- * @param name The notation name.
- * @param publicId The notation public identifier, or null if not
- * available.
- * @param systemId The notation system identifier.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DTDHandler#notationDecl
- */
- public void notationDecl (String name, String publicId, String systemId)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of an unparsed entity declaration.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to keep track of the unparsed entities
- * declared in a document.</p>
- *
- * @param name The entity name.
- * @param publicId The entity public identifier, or null if not
- * available.
- * @param systemId The entity system identifier.
- * @param notationName The name of the associated notation.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public void unparsedEntityDecl (String name, String publicId,
- String systemId, String notationName)
- throws SAXException
- {
- // no op
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of ContentHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive a Locator object for document events.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass if they wish to store the locator for use
- * with other document events.</p>
- *
- * @param locator A locator for all SAX document events.
- * @see org.xml.sax.ContentHandler#setDocumentLocator
- * @see org.xml.sax.Locator
- */
- public void setDocumentLocator (Locator locator)
- {
- // no op
- }
-
-
- /**
- * Receive notification of the beginning of the document.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the beginning
- * of a document (such as allocating the root node of a tree or
- * creating an output file).</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startDocument
- */
- public void startDocument ()
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the end of the document.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end
- * of a document (such as finalising a tree or closing an output
- * file).</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endDocument
- */
- public void endDocument ()
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the start of a Namespace mapping.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the start of
- * each Namespace prefix scope (such as storing the prefix mapping).</p>
- *
- * @param prefix The Namespace prefix being declared.
- * @param uri The Namespace URI mapped to the prefix.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startPrefixMapping
- */
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the end of a Namespace mapping.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end of
- * each prefix mapping.</p>
- *
- * @param prefix The Namespace prefix being declared.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endPrefixMapping
- */
- public void endPrefixMapping (String prefix)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the start of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the start of
- * each element (such as allocating a new tree node or writing
- * output to a file).</p>
- *
- * @param uri The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param qName The qualified name (with prefix), or the
- * empty string if qualified names are not available.
- * @param attributes The attributes attached to the element. If
- * there are no attributes, it shall be an empty
- * Attributes object.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startElement
- */
- public void startElement (String uri, String localName,
- String qName, Attributes attributes)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end of
- * each element (such as finalising a tree node or writing
- * output to a file).</p>
- *
- * @param uri The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param qName The qualified name (with prefix), or the
- * empty string if qualified names are not available.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endElement
- */
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of character data inside an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method to take specific actions for each chunk of character data
- * (such as adding the data to a node or buffer, or printing it to
- * a file).</p>
- *
- * @param ch The characters.
- * @param start The start position in the character array.
- * @param length The number of characters to use from the
- * character array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#characters
- */
- public void characters (char ch[], int start, int length)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>By default, do nothing. Application writers may override this
- * method to take specific actions for each chunk of ignorable
- * whitespace (such as adding data to a node or buffer, or printing
- * it to a file).</p>
- *
- * @param ch The whitespace characters.
- * @param start The start position in the character array.
- * @param length The number of characters to use from the
- * character array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#ignorableWhitespace
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions for each
- * processing instruction, such as setting status variables or
- * invoking other methods.</p>
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none is supplied.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#processingInstruction
- */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of a skipped entity.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions for each
- * processing instruction, such as setting status variables or
- * invoking other methods.</p>
- *
- * @param name The name of the skipped entity.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#processingInstruction
- */
- public void skippedEntity (String name)
- throws SAXException
- {
- // no op
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of the ErrorHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive notification of a parser warning.
- *
- * <p>The default implementation does nothing. Application writers
- * may override this method in a subclass to take specific actions
- * for each warning, such as inserting the message in a log file or
- * printing it to the console.</p>
- *
- * @param e The warning information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#warning
- * @see org.xml.sax.SAXParseException
- */
- public void warning (SAXParseException e)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of a recoverable parser error.
- *
- * <p>The default implementation does nothing. Application writers
- * may override this method in a subclass to take specific actions
- * for each error, such as inserting the message in a log file or
- * printing it to the console.</p>
- *
- * @param e The warning information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#warning
- * @see org.xml.sax.SAXParseException
- */
- public void error (SAXParseException e)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Report a fatal XML parsing error.
- *
- * <p>The default implementation throws a SAXParseException.
- * Application writers may override this method in a subclass if
- * they need to take specific actions for each fatal error (such as
- * collecting all of the errors into a single report): in any case,
- * the application must stop all regular processing when this
- * method is invoked, since the document is no longer reliable, and
- * the parser may no longer report parsing events.</p>
- *
- * @param e The error information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#fatalError
- * @see org.xml.sax.SAXParseException
- */
- public void fatalError (SAXParseException e)
- throws SAXException
- {
- throw e;
- }
-
-}
-
-// end of DefaultHandler.java
diff --git a/libjava/external/sax/org/xml/sax/helpers/LocatorImpl.java b/libjava/external/sax/org/xml/sax/helpers/LocatorImpl.java
deleted file mode 100644
index 6fa4857277c..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/LocatorImpl.java
+++ /dev/null
@@ -1,214 +0,0 @@
-// SAX default implementation for Locator.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: LocatorImpl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.helpers;
-
-import org.xml.sax.Locator;
-
-
-/**
- * Provide an optional convenience implementation of Locator.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class is available mainly for application writers, who
- * can use it to make a persistent snapshot of a locator at any
- * point during a document parse:</p>
- *
- * <pre>
- * Locator locator;
- * Locator startloc;
- *
- * public void setLocator (Locator locator)
- * {
- * // note the locator
- * this.locator = locator;
- * }
- *
- * public void startDocument ()
- * {
- * // save the location of the start of the document
- * // for future use.
- * Locator startloc = new LocatorImpl(locator);
- * }
- *</pre>
- *
- * <p>Normally, parser writers will not use this class, since it
- * is more efficient to provide location information only when
- * requested, rather than constantly updating a Locator object.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.Locator Locator
- */
-public class LocatorImpl implements Locator
-{
-
-
- /**
- * Zero-argument constructor.
- *
- * <p>This will not normally be useful, since the main purpose
- * of this class is to make a snapshot of an existing Locator.</p>
- */
- public LocatorImpl ()
- {
- }
-
-
- /**
- * Copy constructor.
- *
- * <p>Create a persistent copy of the current state of a locator.
- * When the original locator changes, this copy will still keep
- * the original values (and it can be used outside the scope of
- * DocumentHandler methods).</p>
- *
- * @param locator The locator to copy.
- */
- public LocatorImpl (Locator locator)
- {
- setPublicId(locator.getPublicId());
- setSystemId(locator.getSystemId());
- setLineNumber(locator.getLineNumber());
- setColumnNumber(locator.getColumnNumber());
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.Locator
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the saved public identifier.
- *
- * @return The public identifier as a string, or null if none
- * is available.
- * @see org.xml.sax.Locator#getPublicId
- * @see #setPublicId
- */
- public String getPublicId ()
- {
- return publicId;
- }
-
-
- /**
- * Return the saved system identifier.
- *
- * @return The system identifier as a string, or null if none
- * is available.
- * @see org.xml.sax.Locator#getSystemId
- * @see #setSystemId
- */
- public String getSystemId ()
- {
- return systemId;
- }
-
-
- /**
- * Return the saved line number (1-based).
- *
- * @return The line number as an integer, or -1 if none is available.
- * @see org.xml.sax.Locator#getLineNumber
- * @see #setLineNumber
- */
- public int getLineNumber ()
- {
- return lineNumber;
- }
-
-
- /**
- * Return the saved column number (1-based).
- *
- * @return The column number as an integer, or -1 if none is available.
- * @see org.xml.sax.Locator#getColumnNumber
- * @see #setColumnNumber
- */
- public int getColumnNumber ()
- {
- return columnNumber;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Setters for the properties (not in org.xml.sax.Locator)
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the public identifier for this locator.
- *
- * @param publicId The new public identifier, or null
- * if none is available.
- * @see #getPublicId
- */
- public void setPublicId (String publicId)
- {
- this.publicId = publicId;
- }
-
-
- /**
- * Set the system identifier for this locator.
- *
- * @param systemId The new system identifier, or null
- * if none is available.
- * @see #getSystemId
- */
- public void setSystemId (String systemId)
- {
- this.systemId = systemId;
- }
-
-
- /**
- * Set the line number for this locator (1-based).
- *
- * @param lineNumber The line number, or -1 if none is available.
- * @see #getLineNumber
- */
- public void setLineNumber (int lineNumber)
- {
- this.lineNumber = lineNumber;
- }
-
-
- /**
- * Set the column number for this locator (1-based).
- *
- * @param columnNumber The column number, or -1 if none is available.
- * @see #getColumnNumber
- */
- public void setColumnNumber (int columnNumber)
- {
- this.columnNumber = columnNumber;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- private String publicId;
- private String systemId;
- private int lineNumber;
- private int columnNumber;
-
-}
-
-// end of LocatorImpl.java
diff --git a/libjava/external/sax/org/xml/sax/helpers/NamespaceSupport.java b/libjava/external/sax/org/xml/sax/helpers/NamespaceSupport.java
deleted file mode 100644
index 52472fa6e03..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/NamespaceSupport.java
+++ /dev/null
@@ -1,836 +0,0 @@
-// NamespaceSupport.java - generic Namespace support for SAX.
-// http://www.saxproject.org
-// Written by David Megginson
-// This class is in the Public Domain. NO WARRANTY!
-// $Id: NamespaceSupport.java,v 1.1 2005/02/02 00:41:54 tromey Exp $
-
-package org.xml.sax.helpers;
-
-import java.util.EmptyStackException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-
-/**
- * Encapsulate Namespace logic for use by applications using SAX,
- * or internally by SAX drivers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class encapsulates the logic of Namespace processing: it
- * tracks the declarations currently in force for each context and
- * automatically processes qualified XML names into their Namespace
- * parts; it can also be used in reverse for generating XML qnames
- * from Namespaces.</p>
- *
- * <p>Namespace support objects are reusable, but the reset method
- * must be invoked between each session.</p>
- *
- * <p>Here is a simple session:</p>
- *
- * <pre>
- * String parts[] = new String[3];
- * NamespaceSupport support = new NamespaceSupport();
- *
- * support.pushContext();
- * support.declarePrefix("", "http://www.w3.org/1999/xhtml");
- * support.declarePrefix("dc", "http://www.purl.org/dc#");
- *
- * parts = support.processName("p", parts, false);
- * System.out.println("Namespace URI: " + parts[0]);
- * System.out.println("Local name: " + parts[1]);
- * System.out.println("Raw name: " + parts[2]);
- *
- * parts = support.processName("dc:title", parts, false);
- * System.out.println("Namespace URI: " + parts[0]);
- * System.out.println("Local name: " + parts[1]);
- * System.out.println("Raw name: " + parts[2]);
- *
- * support.popContext();
- * </pre>
- *
- * <p>Note that this class is optimized for the use case where most
- * elements do not contain Namespace declarations: if the same
- * prefix/URI mapping is repeated for each context (for example), this
- * class will be somewhat less efficient.</p>
- *
- * <p>Although SAX drivers (parsers) may choose to use this class to
- * implement namespace handling, they are not required to do so.
- * Applications must track namespace information themselves if they
- * want to use namespace information.
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- */
-public class NamespaceSupport
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Constants.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * The XML Namespace URI as a constant.
- * The value is <code>http://www.w3.org/XML/1998/namespace</code>
- * as defined in the "Namespaces in XML" * recommendation.
- *
- * <p>This is the Namespace URI that is automatically mapped
- * to the "xml" prefix.</p>
- */
- public final static String XMLNS =
- "http://www.w3.org/XML/1998/namespace";
-
-
- /**
- * The namespace declaration URI as a constant.
- * The value is <code>http://www.w3.org/xmlns/2000/</code>, as defined
- * in a backwards-incompatible erratum to the "Namespaces in XML"
- * recommendation. Because that erratum postdated SAX2, SAX2 defaults
- * to the original recommendation, and does not normally use this URI.
- *
- *
- * <p>This is the Namespace URI that is optionally applied to
- * <em>xmlns</em> and <em>xmlns:*</em> attributes, which are used to
- * declare namespaces. </p>
- *
- * @since SAX 2.1alpha
- * @see #setNamespaceDeclUris
- * @see #isNamespaceDeclUris
- */
- public final static String NSDECL =
- "http://www.w3.org/xmlns/2000/";
-
-
- /**
- * An empty enumeration.
- */
- // GCJ LOCAL: work around gcj bug by making this package-private
- final static Enumeration EMPTY_ENUMERATION =
- new Vector().elements();
-
-
- ////////////////////////////////////////////////////////////////////
- // Constructor.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Create a new Namespace support object.
- */
- public NamespaceSupport ()
- {
- reset();
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Context management.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Reset this Namespace support object for reuse.
- *
- * <p>It is necessary to invoke this method before reusing the
- * Namespace support object for a new session. If namespace
- * declaration URIs are to be supported, that flag must also
- * be set to a non-default value.
- * </p>
- *
- * @see #setNamespaceDeclUris
- */
- public void reset ()
- {
- contexts = new Context[32];
- namespaceDeclUris = false;
- contextPos = 0;
- contexts[contextPos] = currentContext = new Context();
- currentContext.declarePrefix("xml", XMLNS);
- }
-
-
- /**
- * Start a new Namespace context.
- * The new context will automatically inherit
- * the declarations of its parent context, but it will also keep
- * track of which declarations were made within this context.
- *
- * <p>Event callback code should start a new context once per element.
- * This means being ready to call this in either of two places.
- * For elements that don't include namespace declarations, the
- * <em>ContentHandler.startElement()</em> callback is the right place.
- * For elements with such a declaration, it'd done in the first
- * <em>ContentHandler.startPrefixMapping()</em> callback.
- * A boolean flag can be used to
- * track whether a context has been started yet. When either of
- * those methods is called, it checks the flag to see if a new context
- * needs to be started. If so, it starts the context and sets the
- * flag. After <em>ContentHandler.startElement()</em>
- * does that, it always clears the flag.
- *
- * <p>Normally, SAX drivers would push a new context at the beginning
- * of each XML element. Then they perform a first pass over the
- * attributes to process all namespace declarations, making
- * <em>ContentHandler.startPrefixMapping()</em> callbacks.
- * Then a second pass is made, to determine the namespace-qualified
- * names for all attributes and for the element name.
- * Finally all the information for the
- * <em>ContentHandler.startElement()</em> callback is available,
- * so it can then be made.
- *
- * <p>The Namespace support object always starts with a base context
- * already in force: in this context, only the "xml" prefix is
- * declared.</p>
- *
- * @see org.xml.sax.ContentHandler
- * @see #popContext
- */
- public void pushContext ()
- {
- int max = contexts.length;
-
- contexts [contextPos].declsOK = false;
- contextPos++;
-
- // Extend the array if necessary
- if (contextPos >= max) {
- Context newContexts[] = new Context[max*2];
- System.arraycopy(contexts, 0, newContexts, 0, max);
- max *= 2;
- contexts = newContexts;
- }
-
- // Allocate the context if necessary.
- currentContext = contexts[contextPos];
- if (currentContext == null) {
- contexts[contextPos] = currentContext = new Context();
- }
-
- // Set the parent, if any.
- if (contextPos > 0) {
- currentContext.setParent(contexts[contextPos - 1]);
- }
- }
-
-
- /**
- * Revert to the previous Namespace context.
- *
- * <p>Normally, you should pop the context at the end of each
- * XML element. After popping the context, all Namespace prefix
- * mappings that were previously in force are restored.</p>
- *
- * <p>You must not attempt to declare additional Namespace
- * prefixes after popping a context, unless you push another
- * context first.</p>
- *
- * @see #pushContext
- */
- public void popContext ()
- {
- contexts[contextPos].clear();
- contextPos--;
- if (contextPos < 0) {
- throw new EmptyStackException();
- }
- currentContext = contexts[contextPos];
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Operations within a context.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Declare a Namespace prefix. All prefixes must be declared
- * before they are referenced. For example, a SAX driver (parser)
- * would scan an element's attributes
- * in two passes: first for namespace declarations,
- * then a second pass using {@link #processName processName()} to
- * interpret prefixes against (potentially redefined) prefixes.
- *
- * <p>This method declares a prefix in the current Namespace
- * context; the prefix will remain in force until this context
- * is popped, unless it is shadowed in a descendant context.</p>
- *
- * <p>To declare the default element Namespace, use the empty string as
- * the prefix.</p>
- *
- * <p>Note that you must <em>not</em> declare a prefix after
- * you've pushed and popped another Namespace context, or
- * treated the declarations phase as complete by processing
- * a prefixed name.</p>
- *
- * <p>Note that there is an asymmetry in this library: {@link
- * #getPrefix getPrefix} will not return the "" prefix,
- * even if you have declared a default element namespace.
- * To check for a default namespace,
- * you have to look it up explicitly using {@link #getURI getURI}.
- * This asymmetry exists to make it easier to look up prefixes
- * for attribute names, where the default prefix is not allowed.</p>
- *
- * @param prefix The prefix to declare, or the empty string to
- * indicate the default element namespace. This may never have
- * the value "xml" or "xmlns".
- * @param uri The Namespace URI to associate with the prefix.
- * @return true if the prefix was legal, false otherwise
- *
- * @see #processName
- * @see #getURI
- * @see #getPrefix
- */
- public boolean declarePrefix (String prefix, String uri)
- {
- if (prefix.equals("xml") || prefix.equals("xmlns")) {
- return false;
- } else {
- currentContext.declarePrefix(prefix, uri);
- return true;
- }
- }
-
-
- /**
- * Process a raw XML qualified name, after all declarations in the
- * current context have been handled by {@link #declarePrefix
- * declarePrefix()}.
- *
- * <p>This method processes a raw XML qualified name in the
- * current context by removing the prefix and looking it up among
- * the prefixes currently declared. The return value will be the
- * array supplied by the caller, filled in as follows:</p>
- *
- * <dl>
- * <dt>parts[0]</dt>
- * <dd>The Namespace URI, or an empty string if none is
- * in use.</dd>
- * <dt>parts[1]</dt>
- * <dd>The local name (without prefix).</dd>
- * <dt>parts[2]</dt>
- * <dd>The original raw name.</dd>
- * </dl>
- *
- * <p>All of the strings in the array will be internalized. If
- * the raw name has a prefix that has not been declared, then
- * the return value will be null.</p>
- *
- * <p>Note that attribute names are processed differently than
- * element names: an unprefixed element name will receive the
- * default Namespace (if any), while an unprefixed attribute name
- * will not.</p>
- *
- * @param qName The XML qualified name to be processed.
- * @param parts An array supplied by the caller, capable of
- * holding at least three members.
- * @param isAttribute A flag indicating whether this is an
- * attribute name (true) or an element name (false).
- * @return The supplied array holding three internalized strings
- * representing the Namespace URI (or empty string), the
- * local name, and the XML qualified name; or null if there
- * is an undeclared prefix.
- * @see #declarePrefix
- * @see java.lang.String#intern */
- public String [] processName (String qName, String parts[],
- boolean isAttribute)
- {
- String myParts[] = currentContext.processName(qName, isAttribute);
- if (myParts == null) {
- return null;
- } else {
- parts[0] = myParts[0];
- parts[1] = myParts[1];
- parts[2] = myParts[2];
- return parts;
- }
- }
-
-
- /**
- * Look up a prefix and get the currently-mapped Namespace URI.
- *
- * <p>This method looks up the prefix in the current context.
- * Use the empty string ("") for the default Namespace.</p>
- *
- * @param prefix The prefix to look up.
- * @return The associated Namespace URI, or null if the prefix
- * is undeclared in this context.
- * @see #getPrefix
- * @see #getPrefixes
- */
- public String getURI (String prefix)
- {
- return currentContext.getURI(prefix);
- }
-
-
- /**
- * Return an enumeration of all prefixes whose declarations are
- * active in the current context.
- * This includes declarations from parent contexts that have
- * not been overridden.
- *
- * <p><strong>Note:</strong> if there is a default prefix, it will not be
- * returned in this enumeration; check for the default prefix
- * using the {@link #getURI getURI} with an argument of "".</p>
- *
- * @return An enumeration of prefixes (never empty).
- * @see #getDeclaredPrefixes
- * @see #getURI
- */
- public Enumeration getPrefixes ()
- {
- return currentContext.getPrefixes();
- }
-
-
- /**
- * Return one of the prefixes mapped to a Namespace URI.
- *
- * <p>If more than one prefix is currently mapped to the same
- * URI, this method will make an arbitrary selection; if you
- * want all of the prefixes, use the {@link #getPrefixes}
- * method instead.</p>
- *
- * <p><strong>Note:</strong> this will never return the empty (default) prefix;
- * to check for a default prefix, use the {@link #getURI getURI}
- * method with an argument of "".</p>
- *
- * @param uri the namespace URI
- * @return one of the prefixes currently mapped to the URI supplied,
- * or null if none is mapped or if the URI is assigned to
- * the default namespace
- * @see #getPrefixes(java.lang.String)
- * @see #getURI
- */
- public String getPrefix (String uri)
- {
- return currentContext.getPrefix(uri);
- }
-
-
- /**
- * Return an enumeration of all prefixes for a given URI whose
- * declarations are active in the current context.
- * This includes declarations from parent contexts that have
- * not been overridden.
- *
- * <p>This method returns prefixes mapped to a specific Namespace
- * URI. The xml: prefix will be included. If you want only one
- * prefix that's mapped to the Namespace URI, and you don't care
- * which one you get, use the {@link #getPrefix getPrefix}
- * method instead.</p>
- *
- * <p><strong>Note:</strong> the empty (default) prefix is <em>never</em> included
- * in this enumeration; to check for the presence of a default
- * Namespace, use the {@link #getURI getURI} method with an
- * argument of "".</p>
- *
- * @param uri The Namespace URI.
- * @return An enumeration of prefixes (never empty).
- * @see #getPrefix
- * @see #getDeclaredPrefixes
- * @see #getURI
- */
- public Enumeration getPrefixes (String uri)
- {
- Vector prefixes = new Vector();
- Enumeration allPrefixes = getPrefixes();
- while (allPrefixes.hasMoreElements()) {
- String prefix = (String)allPrefixes.nextElement();
- if (uri.equals(getURI(prefix))) {
- prefixes.addElement(prefix);
- }
- }
- return prefixes.elements();
- }
-
-
- /**
- * Return an enumeration of all prefixes declared in this context.
- *
- * <p>The empty (default) prefix will be included in this
- * enumeration; note that this behaviour differs from that of
- * {@link #getPrefix} and {@link #getPrefixes}.</p>
- *
- * @return An enumeration of all prefixes declared in this
- * context.
- * @see #getPrefixes
- * @see #getURI
- */
- public Enumeration getDeclaredPrefixes ()
- {
- return currentContext.getDeclaredPrefixes();
- }
-
- /**
- * Controls whether namespace declaration attributes are placed
- * into the {@link #NSDECL NSDECL} namespace
- * by {@link #processName processName()}. This may only be
- * changed before any contexts have been pushed.
- *
- * @since SAX 2.1alpha
- *
- * @exception IllegalStateException when attempting to set this
- * after any context has been pushed.
- */
- public void setNamespaceDeclUris (boolean value)
- {
- if (contextPos != 0)
- throw new IllegalStateException ();
- if (value == namespaceDeclUris)
- return;
- namespaceDeclUris = value;
- if (value)
- currentContext.declarePrefix ("xmlns", NSDECL);
- else {
- contexts[contextPos] = currentContext = new Context();
- currentContext.declarePrefix("xml", XMLNS);
- }
- }
-
- /**
- * Returns true if namespace declaration attributes are placed into
- * a namespace. This behavior is not the default.
- *
- * @since SAX 2.1alpha
- */
- public boolean isNamespaceDeclUris ()
- { return namespaceDeclUris; }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- private Context contexts[];
- private Context currentContext;
- private int contextPos;
- private boolean namespaceDeclUris;
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal classes.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Internal class for a single Namespace context.
- *
- * <p>This module caches and reuses Namespace contexts,
- * so the number allocated
- * will be equal to the element depth of the document, not to the total
- * number of elements (i.e. 5-10 rather than tens of thousands).
- * Also, data structures used to represent contexts are shared when
- * possible (child contexts without declarations) to further reduce
- * the amount of memory that's consumed.
- * </p>
- */
- final class Context {
-
- /**
- * Create the root-level Namespace context.
- */
- Context ()
- {
- copyTables();
- }
-
-
- /**
- * (Re)set the parent of this Namespace context.
- * The context must either have been freshly constructed,
- * or must have been cleared.
- *
- * @param context The parent Namespace context object.
- */
- void setParent (Context parent)
- {
- this.parent = parent;
- declarations = null;
- prefixTable = parent.prefixTable;
- uriTable = parent.uriTable;
- elementNameTable = parent.elementNameTable;
- attributeNameTable = parent.attributeNameTable;
- defaultNS = parent.defaultNS;
- declSeen = false;
- declsOK = true;
- }
-
- /**
- * Makes associated state become collectible,
- * invalidating this context.
- * {@link #setParent} must be called before
- * this context may be used again.
- */
- void clear ()
- {
- parent = null;
- prefixTable = null;
- uriTable = null;
- elementNameTable = null;
- attributeNameTable = null;
- defaultNS = null;
- }
-
-
- /**
- * Declare a Namespace prefix for this context.
- *
- * @param prefix The prefix to declare.
- * @param uri The associated Namespace URI.
- * @see org.xml.sax.helpers.NamespaceSupport#declarePrefix
- */
- void declarePrefix (String prefix, String uri)
- {
- // Lazy processing...
- if (!declsOK)
- throw new IllegalStateException (
- "can't declare any more prefixes in this context");
- if (!declSeen) {
- copyTables();
- }
- if (declarations == null) {
- declarations = new Vector();
- }
-
- prefix = prefix.intern();
- uri = uri.intern();
- if ("".equals(prefix)) {
- if ("".equals(uri)) {
- defaultNS = null;
- } else {
- defaultNS = uri;
- }
- } else {
- prefixTable.put(prefix, uri);
- uriTable.put(uri, prefix); // may wipe out another prefix
- }
- declarations.addElement(prefix);
- }
-
-
- /**
- * Process an XML qualified name in this context.
- *
- * @param qName The XML qualified name.
- * @param isAttribute true if this is an attribute name.
- * @return An array of three strings containing the
- * URI part (or empty string), the local part,
- * and the raw name, all internalized, or null
- * if there is an undeclared prefix.
- * @see org.xml.sax.helpers.NamespaceSupport#processName
- */
- String [] processName (String qName, boolean isAttribute)
- {
- String name[];
- Hashtable table;
-
- // detect errors in call sequence
- declsOK = false;
-
- // Select the appropriate table.
- if (isAttribute) {
- table = attributeNameTable;
- } else {
- table = elementNameTable;
- }
-
- // Start by looking in the cache, and
- // return immediately if the name
- // is already known in this content
- name = (String[])table.get(qName);
- if (name != null) {
- return name;
- }
-
- // We haven't seen this name in this
- // context before. Maybe in the parent
- // context, but we can't assume prefix
- // bindings are the same.
- name = new String[3];
- name[2] = qName.intern();
- int index = qName.indexOf(':');
-
-
- // No prefix.
- if (index == -1) {
- if (isAttribute) {
- if (qName == "xmlns" && namespaceDeclUris)
- name[0] = NSDECL;
- else
- name[0] = "";
- } else if (defaultNS == null) {
- name[0] = "";
- } else {
- name[0] = defaultNS;
- }
- name[1] = name[2];
- }
-
- // Prefix
- else {
- String prefix = qName.substring(0, index);
- String local = qName.substring(index+1);
- String uri;
- if ("".equals(prefix)) {
- uri = defaultNS;
- } else {
- uri = (String)prefixTable.get(prefix);
- }
- if (uri == null
- || (!isAttribute && "xmlns".equals (prefix))) {
- return null;
- }
- name[0] = uri;
- name[1] = local.intern();
- }
-
- // Save in the cache for future use.
- // (Could be shared with parent context...)
- table.put(name[2], name);
- return name;
- }
-
-
- /**
- * Look up the URI associated with a prefix in this context.
- *
- * @param prefix The prefix to look up.
- * @return The associated Namespace URI, or null if none is
- * declared.
- * @see org.xml.sax.helpers.NamespaceSupport#getURI
- */
- String getURI (String prefix)
- {
- if ("".equals(prefix)) {
- return defaultNS;
- } else if (prefixTable == null) {
- return null;
- } else {
- return (String)prefixTable.get(prefix);
- }
- }
-
-
- /**
- * Look up one of the prefixes associated with a URI in this context.
- *
- * <p>Since many prefixes may be mapped to the same URI,
- * the return value may be unreliable.</p>
- *
- * @param uri The URI to look up.
- * @return The associated prefix, or null if none is declared.
- * @see org.xml.sax.helpers.NamespaceSupport#getPrefix
- */
- String getPrefix (String uri)
- {
- if (uriTable == null) {
- return null;
- } else {
- return (String)uriTable.get(uri);
- }
- }
-
-
- /**
- * Return an enumeration of prefixes declared in this context.
- *
- * @return An enumeration of prefixes (possibly empty).
- * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes
- */
- Enumeration getDeclaredPrefixes ()
- {
- if (declarations == null) {
- return EMPTY_ENUMERATION;
- } else {
- return declarations.elements();
- }
- }
-
-
- /**
- * Return an enumeration of all prefixes currently in force.
- *
- * <p>The default prefix, if in force, is <em>not</em>
- * returned, and will have to be checked for separately.</p>
- *
- * @return An enumeration of prefixes (never empty).
- * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes
- */
- Enumeration getPrefixes ()
- {
- if (prefixTable == null) {
- return EMPTY_ENUMERATION;
- } else {
- return prefixTable.keys();
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////
- // Internal methods.
- ////////////////////////////////////////////////////////////////
-
-
- /**
- * Copy on write for the internal tables in this context.
- *
- * <p>This class is optimized for the normal case where most
- * elements do not contain Namespace declarations.</p>
- */
- private void copyTables ()
- {
- if (prefixTable != null) {
- prefixTable = (Hashtable)prefixTable.clone();
- } else {
- prefixTable = new Hashtable();
- }
- if (uriTable != null) {
- uriTable = (Hashtable)uriTable.clone();
- } else {
- uriTable = new Hashtable();
- }
- elementNameTable = new Hashtable();
- attributeNameTable = new Hashtable();
- declSeen = true;
- }
-
-
-
- ////////////////////////////////////////////////////////////////
- // Protected state.
- ////////////////////////////////////////////////////////////////
-
- Hashtable prefixTable;
- Hashtable uriTable;
- Hashtable elementNameTable;
- Hashtable attributeNameTable;
- String defaultNS = null;
- boolean declsOK = true;
-
-
-
- ////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////
-
- private Vector declarations = null;
- private boolean declSeen = false;
- private Context parent = null;
- }
-}
-
-// end of NamespaceSupport.java
diff --git a/libjava/external/sax/org/xml/sax/helpers/NewInstance.java b/libjava/external/sax/org/xml/sax/helpers/NewInstance.java
deleted file mode 100644
index 70c043eb42f..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/NewInstance.java
+++ /dev/null
@@ -1,79 +0,0 @@
-// NewInstance.java - create a new instance of a class by name.
-// http://www.saxproject.org
-// Written by Edwin Goei, edwingo@apache.org
-// and by David Brownell, dbrownell@users.sourceforge.net
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: NewInstance.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.helpers;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * Create a new instance of a class by name.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class contains a static method for creating an instance of a
- * class from an explicit class name. It tries to use the thread's context
- * ClassLoader if possible and falls back to using
- * Class.forName(String).</p>
- *
- * <p>This code is designed to compile and run on JDK version 1.1 and later
- * including versions of Java 2.</p>
- *
- * @author Edwin Goei, David Brownell
- * @version 2.0.1 (sax2r2)
- */
-class NewInstance {
-
- /**
- * Creates a new instance of the specified class name
- *
- * Package private so this code is not exposed at the API level.
- */
- static Object newInstance (ClassLoader classLoader, String className)
- throws ClassNotFoundException, IllegalAccessException,
- InstantiationException
- {
- Class driverClass;
- if (classLoader == null) {
- driverClass = Class.forName(className);
- } else {
- driverClass = classLoader.loadClass(className);
- }
- return driverClass.newInstance();
- }
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader getClassLoader ()
- {
- Method m = null;
-
- try {
- m = Thread.class.getMethod("getContextClassLoader", null);
- } catch (NoSuchMethodException e) {
- // Assume that we are running JDK 1.1, use the current ClassLoader
- return NewInstance.class.getClassLoader();
- }
-
- try {
- return (ClassLoader) m.invoke(Thread.currentThread(), null);
- } catch (IllegalAccessException e) {
- // assert(false)
- throw new UnknownError(e.getMessage());
- } catch (InvocationTargetException e) {
- // assert(e.getTargetException() instanceof SecurityException)
- throw new UnknownError(e.getMessage());
- }
- }
-}
diff --git a/libjava/external/sax/org/xml/sax/helpers/ParserAdapter.java b/libjava/external/sax/org/xml/sax/helpers/ParserAdapter.java
deleted file mode 100644
index 748ad1c8499..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/ParserAdapter.java
+++ /dev/null
@@ -1,1046 +0,0 @@
-// ParserAdapter.java - adapt a SAX1 Parser to a SAX2 XMLReader.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: ParserAdapter.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.helpers;
-
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.xml.sax.Parser; // deprecated
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.AttributeList; // deprecated
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.DocumentHandler; // deprecated
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-
-/**
- * Adapt a SAX1 Parser as a SAX2 XMLReader.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class wraps a SAX1 {@link org.xml.sax.Parser Parser}
- * and makes it act as a SAX2 {@link org.xml.sax.XMLReader XMLReader},
- * with feature, property, and Namespace support. Note
- * that it is not possible to report {@link org.xml.sax.ContentHandler#skippedEntity
- * skippedEntity} events, since SAX1 does not make that information available.</p>
- *
- * <p>This adapter does not test for duplicate Namespace-qualified
- * attribute names.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.helpers.XMLReaderAdapter
- * @see org.xml.sax.XMLReader
- * @see org.xml.sax.Parser
- */
-public class ParserAdapter implements XMLReader, DocumentHandler
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Constructors.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Construct a new parser adapter.
- *
- * <p>Use the "org.xml.sax.parser" property to locate the
- * embedded SAX1 driver.</p>
- *
- * @exception SAXException If the embedded driver
- * cannot be instantiated or if the
- * org.xml.sax.parser property is not specified.
- */
- public ParserAdapter ()
- throws SAXException
- {
- super();
-
- String driver = System.getProperty("org.xml.sax.parser");
-
- try {
- setup(ParserFactory.makeParser());
- } catch (ClassNotFoundException e1) {
- throw new
- SAXException("Cannot find SAX1 driver class " +
- driver, e1);
- } catch (IllegalAccessException e2) {
- throw new
- SAXException("SAX1 driver class " +
- driver +
- " found but cannot be loaded", e2);
- } catch (InstantiationException e3) {
- throw new
- SAXException("SAX1 driver class " +
- driver +
- " loaded but cannot be instantiated", e3);
- } catch (ClassCastException e4) {
- throw new
- SAXException("SAX1 driver class " +
- driver +
- " does not implement org.xml.sax.Parser");
- } catch (NullPointerException e5) {
- throw new
- SAXException("System property org.xml.sax.parser not specified");
- }
- }
-
-
- /**
- * Construct a new parser adapter.
- *
- * <p>Note that the embedded parser cannot be changed once the
- * adapter is created; to embed a different parser, allocate
- * a new ParserAdapter.</p>
- *
- * @param parser The SAX1 parser to embed.
- * @exception java.lang.NullPointerException If the parser parameter
- * is null.
- */
- public ParserAdapter (Parser parser)
- {
- super();
- setup(parser);
- }
-
-
- /**
- * Internal setup method.
- *
- * @param parser The embedded parser.
- * @exception java.lang.NullPointerException If the parser parameter
- * is null.
- */
- private void setup (Parser parser)
- {
- if (parser == null) {
- throw new
- NullPointerException("Parser argument must not be null");
- }
- this.parser = parser;
- atts = new AttributesImpl();
- nsSupport = new NamespaceSupport();
- attAdapter = new AttributeListAdapter();
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.XMLReader.
- ////////////////////////////////////////////////////////////////////
-
-
- //
- // Internal constants for the sake of convenience.
- //
- private final static String FEATURES = "http://xml.org/sax/features/";
- private final static String NAMESPACES = FEATURES + "namespaces";
- private final static String NAMESPACE_PREFIXES = FEATURES + "namespace-prefixes";
- private final static String XMLNS_URIs = FEATURES + "xmlns-uris";
-
-
- /**
- * Set a feature flag for the parser.
- *
- * <p>The only features recognized are namespaces and
- * namespace-prefixes.</p>
- *
- * @param name The feature name, as a complete URI.
- * @param value The requested feature value.
- * @exception SAXNotRecognizedException If the feature
- * can't be assigned or retrieved.
- * @exception SAXNotSupportedException If the feature
- * can't be assigned that value.
- * @see org.xml.sax.XMLReader#setFeature
- */
- public void setFeature (String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (name.equals(NAMESPACES)) {
- checkNotParsing("feature", name);
- namespaces = value;
- if (!namespaces && !prefixes) {
- prefixes = true;
- }
- } else if (name.equals(NAMESPACE_PREFIXES)) {
- checkNotParsing("feature", name);
- prefixes = value;
- if (!prefixes && !namespaces) {
- namespaces = true;
- }
- } else if (name.equals(XMLNS_URIs)) {
- checkNotParsing("feature", name);
- uris = value;
- } else {
- throw new SAXNotRecognizedException("Feature: " + name);
- }
- }
-
-
- /**
- * Check a parser feature flag.
- *
- * <p>The only features recognized are namespaces and
- * namespace-prefixes.</p>
- *
- * @param name The feature name, as a complete URI.
- * @return The current feature value.
- * @exception SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @exception SAXNotSupportedException If the
- * feature is not currently readable.
- * @see org.xml.sax.XMLReader#setFeature
- */
- public boolean getFeature (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (name.equals(NAMESPACES)) {
- return namespaces;
- } else if (name.equals(NAMESPACE_PREFIXES)) {
- return prefixes;
- } else if (name.equals(XMLNS_URIs)) {
- return uris;
- } else {
- throw new SAXNotRecognizedException("Feature: " + name);
- }
- }
-
-
- /**
- * Set a parser property.
- *
- * <p>No properties are currently recognized.</p>
- *
- * @param name The property name.
- * @param value The property value.
- * @exception SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @exception SAXNotSupportedException If the property
- * can't be assigned that value.
- * @see org.xml.sax.XMLReader#setProperty
- */
- public void setProperty (String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException("Property: " + name);
- }
-
-
- /**
- * Get a parser property.
- *
- * <p>No properties are currently recognized.</p>
- *
- * @param name The property name.
- * @return The property value.
- * @exception SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @exception SAXNotSupportedException If the property
- * value is not currently readable.
- * @see org.xml.sax.XMLReader#getProperty
- */
- public Object getProperty (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException("Property: " + name);
- }
-
-
- /**
- * Set the entity resolver.
- *
- * @param resolver The new entity resolver.
- * @see org.xml.sax.XMLReader#setEntityResolver
- */
- public void setEntityResolver (EntityResolver resolver)
- {
- entityResolver = resolver;
- }
-
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none was supplied.
- * @see org.xml.sax.XMLReader#getEntityResolver
- */
- public EntityResolver getEntityResolver ()
- {
- return entityResolver;
- }
-
-
- /**
- * Set the DTD handler.
- *
- * @param handler the new DTD handler
- * @see org.xml.sax.XMLReader#setEntityResolver
- */
- public void setDTDHandler (DTDHandler handler)
- {
- dtdHandler = handler;
- }
-
-
- /**
- * Return the current DTD handler.
- *
- * @return the current DTD handler, or null if none was supplied
- * @see org.xml.sax.XMLReader#getEntityResolver
- */
- public DTDHandler getDTDHandler ()
- {
- return dtdHandler;
- }
-
-
- /**
- * Set the content handler.
- *
- * @param handler the new content handler
- * @see org.xml.sax.XMLReader#setEntityResolver
- */
- public void setContentHandler (ContentHandler handler)
- {
- contentHandler = handler;
- }
-
-
- /**
- * Return the current content handler.
- *
- * @return The current content handler, or null if none was supplied.
- * @see org.xml.sax.XMLReader#getEntityResolver
- */
- public ContentHandler getContentHandler ()
- {
- return contentHandler;
- }
-
-
- /**
- * Set the error handler.
- *
- * @param handler The new error handler.
- * @see org.xml.sax.XMLReader#setEntityResolver
- */
- public void setErrorHandler (ErrorHandler handler)
- {
- errorHandler = handler;
- }
-
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none was supplied.
- * @see org.xml.sax.XMLReader#getEntityResolver
- */
- public ErrorHandler getErrorHandler ()
- {
- return errorHandler;
- }
-
-
- /**
- * Parse an XML document.
- *
- * @param systemId The absolute URL of the document.
- * @exception java.io.IOException If there is a problem reading
- * the raw content of the document.
- * @exception SAXException If there is a problem
- * processing the document.
- * @see #parse(org.xml.sax.InputSource)
- * @see org.xml.sax.Parser#parse(java.lang.String)
- */
- public void parse (String systemId)
- throws IOException, SAXException
- {
- parse(new InputSource(systemId));
- }
-
-
- /**
- * Parse an XML document.
- *
- * @param input An input source for the document.
- * @exception java.io.IOException If there is a problem reading
- * the raw content of the document.
- * @exception SAXException If there is a problem
- * processing the document.
- * @see #parse(java.lang.String)
- * @see org.xml.sax.Parser#parse(org.xml.sax.InputSource)
- */
- public void parse (InputSource input)
- throws IOException, SAXException
- {
- if (parsing) {
- throw new SAXException("Parser is already in use");
- }
- setupParser();
- parsing = true;
- try {
- parser.parse(input);
- } finally {
- parsing = false;
- }
- parsing = false;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.DocumentHandler.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 document locator event.
- *
- * @param locator A document locator.
- * @see org.xml.sax.ContentHandler#setDocumentLocator
- */
- public void setDocumentLocator (Locator locator)
- {
- this.locator = locator;
- if (contentHandler != null) {
- contentHandler.setDocumentLocator(locator);
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 start document event.
- *
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#startDocument
- */
- public void startDocument ()
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.startDocument();
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 end document event.
- *
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#endDocument
- */
- public void endDocument ()
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.endDocument();
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 startElement event.
- *
- * <p>If necessary, perform Namespace processing.</p>
- *
- * @param qName The qualified (prefixed) name.
- * @param qAtts The XML attribute list (with qnames).
- * @exception SAXException The client may raise a
- * processing exception.
- */
- public void startElement (String qName, AttributeList qAtts)
- throws SAXException
- {
- // These are exceptions from the
- // first pass; they should be
- // ignored if there's a second pass,
- // but reported otherwise.
- Vector exceptions = null;
-
- // If we're not doing Namespace
- // processing, dispatch this quickly.
- if (!namespaces) {
- if (contentHandler != null) {
- attAdapter.setAttributeList(qAtts);
- contentHandler.startElement("", "", qName.intern(),
- attAdapter);
- }
- return;
- }
-
-
- // OK, we're doing Namespace processing.
- nsSupport.pushContext();
- int length = qAtts.getLength();
-
- // First pass: handle NS decls
- for (int i = 0; i < length; i++) {
- String attQName = qAtts.getName(i);
-
- if (!attQName.startsWith("xmlns"))
- continue;
- // Could be a declaration...
- String prefix;
- int n = attQName.indexOf(':');
-
- // xmlns=...
- if (n == -1 && attQName.length () == 5) {
- prefix = "";
- } else if (n != 5) {
- // XML namespaces spec doesn't discuss "xmlnsf:oo"
- // (and similarly named) attributes ... at most, warn
- continue;
- } else // xmlns:foo=...
- prefix = attQName.substring(n+1);
-
- String value = qAtts.getValue(i);
- if (!nsSupport.declarePrefix(prefix, value)) {
- reportError("Illegal Namespace prefix: " + prefix);
- continue;
- }
- if (contentHandler != null)
- contentHandler.startPrefixMapping(prefix, value);
- }
-
- // Second pass: copy all relevant
- // attributes into the SAX2 AttributeList
- // using updated prefix bindings
- atts.clear();
- for (int i = 0; i < length; i++) {
- String attQName = qAtts.getName(i);
- String type = qAtts.getType(i);
- String value = qAtts.getValue(i);
-
- // Declaration?
- if (attQName.startsWith("xmlns")) {
- String prefix;
- int n = attQName.indexOf(':');
-
- if (n == -1 && attQName.length () == 5) {
- prefix = "";
- } else if (n != 5) {
- // XML namespaces spec doesn't discuss "xmlnsf:oo"
- // (and similarly named) attributes ... ignore
- prefix = null;
- } else {
- prefix = attQName.substring(6);
- }
- // Yes, decl: report or prune
- if (prefix != null) {
- if (prefixes) {
- if (uris)
- // note funky case: localname can be null
- // when declaring the default prefix, and
- // yet the uri isn't null.
- atts.addAttribute (nsSupport.XMLNS, prefix,
- attQName.intern(), type, value);
- else
- atts.addAttribute ("", "",
- attQName.intern(), type, value);
- }
- continue;
- }
- }
-
- // Not a declaration -- report
- try {
- String attName[] = processName(attQName, true, true);
- atts.addAttribute(attName[0], attName[1], attName[2],
- type, value);
- } catch (SAXException e) {
- if (exceptions == null)
- exceptions = new Vector();
- exceptions.addElement(e);
- atts.addAttribute("", attQName, attQName, type, value);
- }
- }
-
- // now handle the deferred exception reports
- if (exceptions != null && errorHandler != null) {
- for (int i = 0; i < exceptions.size(); i++)
- errorHandler.error((SAXParseException)
- (exceptions.elementAt(i)));
- }
-
- // OK, finally report the event.
- if (contentHandler != null) {
- String name[] = processName(qName, false, false);
- contentHandler.startElement(name[0], name[1], name[2], atts);
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 end element event.
- *
- * @param qName The qualified (prefixed) name.
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#endElement
- */
- public void endElement (String qName)
- throws SAXException
- {
- // If we're not doing Namespace
- // processing, dispatch this quickly.
- if (!namespaces) {
- if (contentHandler != null) {
- contentHandler.endElement("", "", qName.intern());
- }
- return;
- }
-
- // Split the name.
- String names[] = processName(qName, false, false);
- if (contentHandler != null) {
- contentHandler.endElement(names[0], names[1], names[2]);
- Enumeration prefixes = nsSupport.getDeclaredPrefixes();
- while (prefixes.hasMoreElements()) {
- String prefix = (String)prefixes.nextElement();
- contentHandler.endPrefixMapping(prefix);
- }
- }
- nsSupport.popContext();
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 characters event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use.
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#characters
- */
- public void characters (char ch[], int start, int length)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.characters(ch, start, length);
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 ignorable whitespace event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use.
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#ignorableWhitespace
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.ignorableWhitespace(ch, start, length);
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 processing instruction event.
- *
- * @param target The processing instruction target.
- * @param data The remainder of the processing instruction
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#processingInstruction
- */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.processingInstruction(target, data);
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal utility methods.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Initialize the parser before each run.
- */
- private void setupParser ()
- {
- // catch an illegal "nonsense" state.
- if (!prefixes && !namespaces)
- throw new IllegalStateException ();
-
- nsSupport.reset();
- if (uris)
- nsSupport.setNamespaceDeclUris (true);
-
- if (entityResolver != null) {
- parser.setEntityResolver(entityResolver);
- }
- if (dtdHandler != null) {
- parser.setDTDHandler(dtdHandler);
- }
- if (errorHandler != null) {
- parser.setErrorHandler(errorHandler);
- }
- parser.setDocumentHandler(this);
- locator = null;
- }
-
-
- /**
- * Process a qualified (prefixed) name.
- *
- * <p>If the name has an undeclared prefix, use only the qname
- * and make an ErrorHandler.error callback in case the app is
- * interested.</p>
- *
- * @param qName The qualified (prefixed) name.
- * @param isAttribute true if this is an attribute name.
- * @return The name split into three parts.
- * @exception SAXException The client may throw
- * an exception if there is an error callback.
- */
- private String [] processName (String qName, boolean isAttribute,
- boolean useException)
- throws SAXException
- {
- String parts[] = nsSupport.processName(qName, nameParts,
- isAttribute);
- if (parts == null) {
- if (useException)
- throw makeException("Undeclared prefix: " + qName);
- reportError("Undeclared prefix: " + qName);
- parts = new String[3];
- parts[0] = parts[1] = "";
- parts[2] = qName.intern();
- }
- return parts;
- }
-
-
- /**
- * Report a non-fatal error.
- *
- * @param message The error message.
- * @exception SAXException The client may throw
- * an exception.
- */
- void reportError (String message)
- throws SAXException
- {
- if (errorHandler != null)
- errorHandler.error(makeException(message));
- }
-
-
- /**
- * Construct an exception for the current context.
- *
- * @param message The error message.
- */
- private SAXParseException makeException (String message)
- {
- if (locator != null) {
- return new SAXParseException(message, locator);
- } else {
- return new SAXParseException(message, null, null, -1, -1);
- }
- }
-
-
- /**
- * Throw an exception if we are parsing.
- *
- * <p>Use this method to detect illegal feature or
- * property changes.</p>
- *
- * @param type The type of thing (feature or property).
- * @param name The feature or property name.
- * @exception SAXNotSupportedException If a
- * document is currently being parsed.
- */
- private void checkNotParsing (String type, String name)
- throws SAXNotSupportedException
- {
- if (parsing) {
- throw new SAXNotSupportedException("Cannot change " +
- type + ' ' +
- name + " while parsing");
-
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- private NamespaceSupport nsSupport;
- private AttributeListAdapter attAdapter;
-
- private boolean parsing = false;
- private String nameParts[] = new String[3];
-
- private Parser parser = null;
-
- private AttributesImpl atts = null;
-
- // Features
- private boolean namespaces = true;
- private boolean prefixes = false;
- private boolean uris = false;
-
- // Properties
-
- // Handlers
- Locator locator;
-
- EntityResolver entityResolver = null;
- DTDHandler dtdHandler = null;
- ContentHandler contentHandler = null;
- ErrorHandler errorHandler = null;
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Inner class to wrap an AttributeList when not doing NS proc.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Adapt a SAX1 AttributeList as a SAX2 Attributes object.
- *
- * <p>This class is in the Public Domain, and comes with NO
- * WARRANTY of any kind.</p>
- *
- * <p>This wrapper class is used only when Namespace support
- * is disabled -- it provides pretty much a direct mapping
- * from SAX1 to SAX2, except that names and types are
- * interned whenever requested.</p>
- */
- final class AttributeListAdapter implements Attributes
- {
-
- /**
- * Construct a new adapter.
- */
- AttributeListAdapter ()
- {
- }
-
-
- /**
- * Set the embedded AttributeList.
- *
- * <p>This method must be invoked before any of the others
- * can be used.</p>
- *
- * @param The SAX1 attribute list (with qnames).
- */
- void setAttributeList (AttributeList qAtts)
- {
- this.qAtts = qAtts;
- }
-
-
- /**
- * Return the length of the attribute list.
- *
- * @return The number of attributes in the list.
- * @see org.xml.sax.Attributes#getLength
- */
- public int getLength ()
- {
- return qAtts.getLength();
- }
-
-
- /**
- * Return the Namespace URI of the specified attribute.
- *
- * @param The attribute's index.
- * @return Always the empty string.
- * @see org.xml.sax.Attributes#getURI
- */
- public String getURI (int i)
- {
- return "";
- }
-
-
- /**
- * Return the local name of the specified attribute.
- *
- * @param The attribute's index.
- * @return Always the empty string.
- * @see org.xml.sax.Attributes#getLocalName
- */
- public String getLocalName (int i)
- {
- return "";
- }
-
-
- /**
- * Return the qualified (prefixed) name of the specified attribute.
- *
- * @param The attribute's index.
- * @return The attribute's qualified name, internalized.
- */
- public String getQName (int i)
- {
- return qAtts.getName(i).intern();
- }
-
-
- /**
- * Return the type of the specified attribute.
- *
- * @param The attribute's index.
- * @return The attribute's type as an internalized string.
- */
- public String getType (int i)
- {
- return qAtts.getType(i).intern();
- }
-
-
- /**
- * Return the value of the specified attribute.
- *
- * @param The attribute's index.
- * @return The attribute's value.
- */
- public String getValue (int i)
- {
- return qAtts.getValue(i);
- }
-
-
- /**
- * Look up an attribute index by Namespace name.
- *
- * @param uri The Namespace URI or the empty string.
- * @param localName The local name.
- * @return The attributes index, or -1 if none was found.
- * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String)
- */
- public int getIndex (String uri, String localName)
- {
- return -1;
- }
-
-
- /**
- * Look up an attribute index by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attributes index, or -1 if none was found.
- * @see org.xml.sax.Attributes#getIndex(java.lang.String)
- */
- public int getIndex (String qName)
- {
- int max = atts.getLength();
- for (int i = 0; i < max; i++) {
- if (qAtts.getName(i).equals(qName)) {
- return i;
- }
- }
- return -1;
- }
-
-
- /**
- * Look up the type of an attribute by Namespace name.
- *
- * @param uri The Namespace URI
- * @param localName The local name.
- * @return The attribute's type as an internalized string.
- */
- public String getType (String uri, String localName)
- {
- return null;
- }
-
-
- /**
- * Look up the type of an attribute by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attribute's type as an internalized string.
- */
- public String getType (String qName)
- {
- return qAtts.getType(qName).intern();
- }
-
-
- /**
- * Look up the value of an attribute by Namespace name.
- *
- * @param uri The Namespace URI
- * @param localName The local name.
- * @return The attribute's value.
- */
- public String getValue (String uri, String localName)
- {
- return null;
- }
-
-
- /**
- * Look up the value of an attribute by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attribute's value.
- */
- public String getValue (String qName)
- {
- return qAtts.getValue(qName);
- }
-
- private AttributeList qAtts;
- }
-}
-
-// end of ParserAdapter.java
diff --git a/libjava/external/sax/org/xml/sax/helpers/ParserFactory.java b/libjava/external/sax/org/xml/sax/helpers/ParserFactory.java
deleted file mode 100644
index 23139981088..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/ParserFactory.java
+++ /dev/null
@@ -1,129 +0,0 @@
-// SAX parser factory.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: ParserFactory.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.helpers;
-
-import java.lang.ClassNotFoundException;
-import java.lang.IllegalAccessException;
-import java.lang.InstantiationException;
-import java.lang.SecurityException;
-import java.lang.ClassCastException;
-
-import org.xml.sax.Parser;
-
-
-/**
- * Java-specific class for dynamically loading SAX parsers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p><strong>Note:</strong> This class is designed to work with the now-deprecated
- * SAX1 {@link org.xml.sax.Parser Parser} class. SAX2 applications should use
- * {@link org.xml.sax.helpers.XMLReaderFactory XMLReaderFactory} instead.</p>
- *
- * <p>ParserFactory is not part of the platform-independent definition
- * of SAX; it is an additional convenience class designed
- * specifically for Java XML application writers. SAX applications
- * can use the static methods in this class to allocate a SAX parser
- * dynamically at run-time based either on the value of the
- * `org.xml.sax.parser' system property or on a string containing the class
- * name.</p>
- *
- * <p>Note that the application still requires an XML parser that
- * implements SAX1.</p>
- *
- * @deprecated This class works with the deprecated
- * {@link org.xml.sax.Parser Parser}
- * interface.
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- */
-public class ParserFactory {
-
-
- /**
- * Private null constructor.
- */
- private ParserFactory ()
- {
- }
-
-
- /**
- * Create a new SAX parser using the `org.xml.sax.parser' system property.
- *
- * <p>The named class must exist and must implement the
- * {@link org.xml.sax.Parser Parser} interface.</p>
- *
- * @exception java.lang.NullPointerException There is no value
- * for the `org.xml.sax.parser' system property.
- * @exception java.lang.ClassNotFoundException The SAX parser
- * class was not found (check your CLASSPATH).
- * @exception IllegalAccessException The SAX parser class was
- * found, but you do not have permission to load
- * it.
- * @exception InstantiationException The SAX parser class was
- * found but could not be instantiated.
- * @exception java.lang.ClassCastException The SAX parser class
- * was found and instantiated, but does not implement
- * org.xml.sax.Parser.
- * @see #makeParser(java.lang.String)
- * @see org.xml.sax.Parser
- */
- public static Parser makeParser ()
- throws ClassNotFoundException,
- IllegalAccessException,
- InstantiationException,
- NullPointerException,
- ClassCastException
- {
- String className = System.getProperty("org.xml.sax.parser");
- if (className == null) {
- throw new NullPointerException("No value for sax.parser property");
- } else {
- return makeParser(className);
- }
- }
-
-
- /**
- * Create a new SAX parser object using the class name provided.
- *
- * <p>The named class must exist and must implement the
- * {@link org.xml.sax.Parser Parser} interface.</p>
- *
- * @param className A string containing the name of the
- * SAX parser class.
- * @exception java.lang.ClassNotFoundException The SAX parser
- * class was not found (check your CLASSPATH).
- * @exception IllegalAccessException The SAX parser class was
- * found, but you do not have permission to load
- * it.
- * @exception InstantiationException The SAX parser class was
- * found but could not be instantiated.
- * @exception java.lang.ClassCastException The SAX parser class
- * was found and instantiated, but does not implement
- * org.xml.sax.Parser.
- * @see #makeParser()
- * @see org.xml.sax.Parser
- */
- public static Parser makeParser (String className)
- throws ClassNotFoundException,
- IllegalAccessException,
- InstantiationException,
- ClassCastException
- {
- return (Parser) NewInstance.newInstance (
- NewInstance.getClassLoader (), className);
- }
-
-}
-
diff --git a/libjava/external/sax/org/xml/sax/helpers/XMLFilterImpl.java b/libjava/external/sax/org/xml/sax/helpers/XMLFilterImpl.java
deleted file mode 100644
index 64ff0a4cf88..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/XMLFilterImpl.java
+++ /dev/null
@@ -1,713 +0,0 @@
-// XMLFilterImpl.java - base SAX2 filter implementation.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLFilterImpl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.helpers;
-
-import java.io.IOException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.XMLFilter;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXNotRecognizedException;
-
-
-/**
- * Base class for deriving an XML filter.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class is designed to sit between an {@link org.xml.sax.XMLReader
- * XMLReader} and the client application's event handlers. By default, it
- * does nothing but pass requests up to the reader and events
- * on to the handlers unmodified, but subclasses can override
- * specific methods to modify the event stream or the configuration
- * requests as they pass through.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.XMLFilter
- * @see org.xml.sax.XMLReader
- * @see org.xml.sax.EntityResolver
- * @see org.xml.sax.DTDHandler
- * @see org.xml.sax.ContentHandler
- * @see org.xml.sax.ErrorHandler
- */
-public class XMLFilterImpl
- implements XMLFilter, EntityResolver, DTDHandler, ContentHandler, ErrorHandler
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Constructors.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Construct an empty XML filter, with no parent.
- *
- * <p>This filter will have no parent: you must assign a parent
- * before you start a parse or do any configuration with
- * setFeature or setProperty, unless you use this as a pure event
- * consumer rather than as an {@link XMLReader}.</p>
- *
- * @see org.xml.sax.XMLReader#setFeature
- * @see org.xml.sax.XMLReader#setProperty
- * @see #setParent
- */
- public XMLFilterImpl ()
- {
- super();
- }
-
-
- /**
- * Construct an XML filter with the specified parent.
- *
- * @see #setParent
- * @see #getParent
- */
- public XMLFilterImpl (XMLReader parent)
- {
- super();
- setParent(parent);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.XMLFilter.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the parent reader.
- *
- * <p>This is the {@link org.xml.sax.XMLReader XMLReader} from which
- * this filter will obtain its events and to which it will pass its
- * configuration requests. The parent may itself be another filter.</p>
- *
- * <p>If there is no parent reader set, any attempt to parse
- * or to set or get a feature or property will fail.</p>
- *
- * @param parent The parent XML reader.
- * @see #getParent
- */
- public void setParent (XMLReader parent)
- {
- this.parent = parent;
- }
-
-
- /**
- * Get the parent reader.
- *
- * @return The parent XML reader, or null if none is set.
- * @see #setParent
- */
- public XMLReader getParent ()
- {
- return parent;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.XMLReader.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the value of a feature.
- *
- * <p>This will always fail if the parent is null.</p>
- *
- * @param name The feature name.
- * @param value The requested feature value.
- * @exception org.xml.sax.SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved from the parent.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * parent recognizes the feature name but
- * cannot set the requested value.
- */
- public void setFeature (String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (parent != null) {
- parent.setFeature(name, value);
- } else {
- throw new SAXNotRecognizedException("Feature: " + name);
- }
- }
-
-
- /**
- * Look up the value of a feature.
- *
- * <p>This will always fail if the parent is null.</p>
- *
- * @param name The feature name.
- * @return The current value of the feature.
- * @exception org.xml.sax.SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved from the parent.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * parent recognizes the feature name but
- * cannot determine its value at this time.
- */
- public boolean getFeature (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (parent != null) {
- return parent.getFeature(name);
- } else {
- throw new SAXNotRecognizedException("Feature: " + name);
- }
- }
-
-
- /**
- * Set the value of a property.
- *
- * <p>This will always fail if the parent is null.</p>
- *
- * @param name The property name.
- * @param value The requested property value.
- * @exception org.xml.sax.SAXNotRecognizedException If the property
- * value can't be assigned or retrieved from the parent.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * parent recognizes the property name but
- * cannot set the requested value.
- */
- public void setProperty (String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (parent != null) {
- parent.setProperty(name, value);
- } else {
- throw new SAXNotRecognizedException("Property: " + name);
- }
- }
-
-
- /**
- * Look up the value of a property.
- *
- * @param name The property name.
- * @return The current value of the property.
- * @exception org.xml.sax.SAXNotRecognizedException If the property
- * value can't be assigned or retrieved from the parent.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * parent recognizes the property name but
- * cannot determine its value at this time.
- */
- public Object getProperty (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (parent != null) {
- return parent.getProperty(name);
- } else {
- throw new SAXNotRecognizedException("Property: " + name);
- }
- }
-
-
- /**
- * Set the entity resolver.
- *
- * @param resolver The new entity resolver.
- */
- public void setEntityResolver (EntityResolver resolver)
- {
- entityResolver = resolver;
- }
-
-
- /**
- * Get the current entity resolver.
- *
- * @return The current entity resolver, or null if none was set.
- */
- public EntityResolver getEntityResolver ()
- {
- return entityResolver;
- }
-
-
- /**
- * Set the DTD event handler.
- *
- * @param handler the new DTD handler
- */
- public void setDTDHandler (DTDHandler handler)
- {
- dtdHandler = handler;
- }
-
-
- /**
- * Get the current DTD event handler.
- *
- * @return The current DTD handler, or null if none was set.
- */
- public DTDHandler getDTDHandler ()
- {
- return dtdHandler;
- }
-
-
- /**
- * Set the content event handler.
- *
- * @param handler the new content handler
- */
- public void setContentHandler (ContentHandler handler)
- {
- contentHandler = handler;
- }
-
-
- /**
- * Get the content event handler.
- *
- * @return The current content handler, or null if none was set.
- */
- public ContentHandler getContentHandler ()
- {
- return contentHandler;
- }
-
-
- /**
- * Set the error event handler.
- *
- * @param handler the new error handler
- */
- public void setErrorHandler (ErrorHandler handler)
- {
- errorHandler = handler;
- }
-
-
- /**
- * Get the current error event handler.
- *
- * @return The current error handler, or null if none was set.
- */
- public ErrorHandler getErrorHandler ()
- {
- return errorHandler;
- }
-
-
- /**
- * Parse a document.
- *
- * @param input The input source for the document entity.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- */
- public void parse (InputSource input)
- throws SAXException, IOException
- {
- setupParse();
- parent.parse(input);
- }
-
-
- /**
- * Parse a document.
- *
- * @param systemId The system identifier as a fully-qualified URI.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- */
- public void parse (String systemId)
- throws SAXException, IOException
- {
- parse(new InputSource(systemId));
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.EntityResolver.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Filter an external entity resolution.
- *
- * @param publicId The entity's public identifier, or null.
- * @param systemId The entity's system identifier.
- * @return A new InputSource or null for the default.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- * @exception java.io.IOException The client may throw an
- * I/O-related exception while obtaining the
- * new InputSource.
- */
- public InputSource resolveEntity (String publicId, String systemId)
- throws SAXException, IOException
- {
- if (entityResolver != null) {
- return entityResolver.resolveEntity(publicId, systemId);
- } else {
- return null;
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.DTDHandler.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Filter a notation declaration event.
- *
- * @param name The notation name.
- * @param publicId The notation's public identifier, or null.
- * @param systemId The notation's system identifier, or null.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void notationDecl (String name, String publicId, String systemId)
- throws SAXException
- {
- if (dtdHandler != null) {
- dtdHandler.notationDecl(name, publicId, systemId);
- }
- }
-
-
- /**
- * Filter an unparsed entity declaration event.
- *
- * @param name The entity name.
- * @param publicId The entity's public identifier, or null.
- * @param systemId The entity's system identifier, or null.
- * @param notationName The name of the associated notation.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void unparsedEntityDecl (String name, String publicId,
- String systemId, String notationName)
- throws SAXException
- {
- if (dtdHandler != null) {
- dtdHandler.unparsedEntityDecl(name, publicId, systemId,
- notationName);
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.ContentHandler.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Filter a new document locator event.
- *
- * @param locator The document locator.
- */
- public void setDocumentLocator (Locator locator)
- {
- this.locator = locator;
- if (contentHandler != null) {
- contentHandler.setDocumentLocator(locator);
- }
- }
-
-
- /**
- * Filter a start document event.
- *
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void startDocument ()
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.startDocument();
- }
- }
-
-
- /**
- * Filter an end document event.
- *
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void endDocument ()
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.endDocument();
- }
- }
-
-
- /**
- * Filter a start Namespace prefix mapping event.
- *
- * @param prefix The Namespace prefix.
- * @param uri The Namespace URI.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.startPrefixMapping(prefix, uri);
- }
- }
-
-
- /**
- * Filter an end Namespace prefix mapping event.
- *
- * @param prefix The Namespace prefix.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void endPrefixMapping (String prefix)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.endPrefixMapping(prefix);
- }
- }
-
-
- /**
- * Filter a start element event.
- *
- * @param uri The element's Namespace URI, or the empty string.
- * @param localName The element's local name, or the empty string.
- * @param qName The element's qualified (prefixed) name, or the empty
- * string.
- * @param atts The element's attributes.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void startElement (String uri, String localName, String qName,
- Attributes atts)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.startElement(uri, localName, qName, atts);
- }
- }
-
-
- /**
- * Filter an end element event.
- *
- * @param uri The element's Namespace URI, or the empty string.
- * @param localName The element's local name, or the empty string.
- * @param qName The element's qualified (prefixed) name, or the empty
- * string.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.endElement(uri, localName, qName);
- }
- }
-
-
- /**
- * Filter a character data event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void characters (char ch[], int start, int length)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.characters(ch, start, length);
- }
- }
-
-
- /**
- * Filter an ignorable whitespace event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.ignorableWhitespace(ch, start, length);
- }
- }
-
-
- /**
- * Filter a processing instruction event.
- *
- * @param target The processing instruction target.
- * @param data The text following the target.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.processingInstruction(target, data);
- }
- }
-
-
- /**
- * Filter a skipped entity event.
- *
- * @param name The name of the skipped entity.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void skippedEntity (String name)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.skippedEntity(name);
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.ErrorHandler.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Filter a warning event.
- *
- * @param e The warning as an exception.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void warning (SAXParseException e)
- throws SAXException
- {
- if (errorHandler != null) {
- errorHandler.warning(e);
- }
- }
-
-
- /**
- * Filter an error event.
- *
- * @param e The error as an exception.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void error (SAXParseException e)
- throws SAXException
- {
- if (errorHandler != null) {
- errorHandler.error(e);
- }
- }
-
-
- /**
- * Filter a fatal error event.
- *
- * @param e The error as an exception.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void fatalError (SAXParseException e)
- throws SAXException
- {
- if (errorHandler != null) {
- errorHandler.fatalError(e);
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal methods.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set up before a parse.
- *
- * <p>Before every parse, check whether the parent is
- * non-null, and re-register the filter for all of the
- * events.</p>
- */
- private void setupParse ()
- {
- if (parent == null) {
- throw new NullPointerException("No parent for filter");
- }
- parent.setEntityResolver(this);
- parent.setDTDHandler(this);
- parent.setContentHandler(this);
- parent.setErrorHandler(this);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- private XMLReader parent = null;
- private Locator locator = null;
- private EntityResolver entityResolver = null;
- private DTDHandler dtdHandler = null;
- private ContentHandler contentHandler = null;
- private ErrorHandler errorHandler = null;
-
-}
-
-// end of XMLFilterImpl.java
diff --git a/libjava/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java b/libjava/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java
deleted file mode 100644
index 566e69b8d7b..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java
+++ /dev/null
@@ -1,538 +0,0 @@
-// XMLReaderAdapter.java - adapt an SAX2 XMLReader to a SAX1 Parser
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: XMLReaderAdapter.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.helpers;
-
-import java.io.IOException;
-import java.util.Locale;
-
-import org.xml.sax.Parser; // deprecated
-import org.xml.sax.Locator;
-import org.xml.sax.InputSource;
-import org.xml.sax.AttributeList; // deprecated
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.DocumentHandler; // deprecated
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXNotSupportedException;
-
-
-/**
- * Adapt a SAX2 XMLReader as a SAX1 Parser.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class wraps a SAX2 {@link org.xml.sax.XMLReader XMLReader}
- * and makes it act as a SAX1 {@link org.xml.sax.Parser Parser}. The XMLReader
- * must support a true value for the
- * http://xml.org/sax/features/namespace-prefixes property or parsing will fail
- * with a {@link org.xml.sax.SAXException SAXException}; if the XMLReader
- * supports a false value for the http://xml.org/sax/features/namespaces
- * property, that will also be used to improve efficiency.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.Parser
- * @see org.xml.sax.XMLReader
- */
-public class XMLReaderAdapter implements Parser, ContentHandler
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Constructor.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Create a new adapter.
- *
- * <p>Use the "org.xml.sax.driver" property to locate the SAX2
- * driver to embed.</p>
- *
- * @exception org.xml.sax.SAXException If the embedded driver
- * cannot be instantiated or if the
- * org.xml.sax.driver property is not specified.
- */
- public XMLReaderAdapter ()
- throws SAXException
- {
- setup(XMLReaderFactory.createXMLReader());
- }
-
-
- /**
- * Create a new adapter.
- *
- * <p>Create a new adapter, wrapped around a SAX2 XMLReader.
- * The adapter will make the XMLReader act like a SAX1
- * Parser.</p>
- *
- * @param xmlReader The SAX2 XMLReader to wrap.
- * @exception java.lang.NullPointerException If the argument is null.
- */
- public XMLReaderAdapter (XMLReader xmlReader)
- {
- setup(xmlReader);
- }
-
-
-
- /**
- * Internal setup.
- *
- * @param xmlReader The embedded XMLReader.
- */
- private void setup (XMLReader xmlReader)
- {
- if (xmlReader == null) {
- throw new NullPointerException("XMLReader must not be null");
- }
- this.xmlReader = xmlReader;
- qAtts = new AttributesAdapter();
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.Parser.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the locale for error reporting.
- *
- * <p>This is not supported in SAX2, and will always throw
- * an exception.</p>
- *
- * @param locale the locale for error reporting.
- * @see org.xml.sax.Parser#setLocale
- * @exception org.xml.sax.SAXException Thrown unless overridden.
- */
- public void setLocale (Locale locale)
- throws SAXException
- {
- throw new SAXNotSupportedException("setLocale not supported");
- }
-
-
- /**
- * Register the entity resolver.
- *
- * @param resolver The new resolver.
- * @see org.xml.sax.Parser#setEntityResolver
- */
- public void setEntityResolver (EntityResolver resolver)
- {
- xmlReader.setEntityResolver(resolver);
- }
-
-
- /**
- * Register the DTD event handler.
- *
- * @param handler The new DTD event handler.
- * @see org.xml.sax.Parser#setDTDHandler
- */
- public void setDTDHandler (DTDHandler handler)
- {
- xmlReader.setDTDHandler(handler);
- }
-
-
- /**
- * Register the SAX1 document event handler.
- *
- * <p>Note that the SAX1 document handler has no Namespace
- * support.</p>
- *
- * @param handler The new SAX1 document event handler.
- * @see org.xml.sax.Parser#setDocumentHandler
- */
- public void setDocumentHandler (DocumentHandler handler)
- {
- documentHandler = handler;
- }
-
-
- /**
- * Register the error event handler.
- *
- * @param handler The new error event handler.
- * @see org.xml.sax.Parser#setErrorHandler
- */
- public void setErrorHandler (ErrorHandler handler)
- {
- xmlReader.setErrorHandler(handler);
- }
-
-
- /**
- * Parse the document.
- *
- * <p>This method will throw an exception if the embedded
- * XMLReader does not support the
- * http://xml.org/sax/features/namespace-prefixes property.</p>
- *
- * @param systemId The absolute URL of the document.
- * @exception java.io.IOException If there is a problem reading
- * the raw content of the document.
- * @exception org.xml.sax.SAXException If there is a problem
- * processing the document.
- * @see #parse(org.xml.sax.InputSource)
- * @see org.xml.sax.Parser#parse(java.lang.String)
- */
- public void parse (String systemId)
- throws IOException, SAXException
- {
- parse(new InputSource(systemId));
- }
-
-
- /**
- * Parse the document.
- *
- * <p>This method will throw an exception if the embedded
- * XMLReader does not support the
- * http://xml.org/sax/features/namespace-prefixes property.</p>
- *
- * @param input An input source for the document.
- * @exception java.io.IOException If there is a problem reading
- * the raw content of the document.
- * @exception org.xml.sax.SAXException If there is a problem
- * processing the document.
- * @see #parse(java.lang.String)
- * @see org.xml.sax.Parser#parse(org.xml.sax.InputSource)
- */
- public void parse (InputSource input)
- throws IOException, SAXException
- {
- setupXMLReader();
- xmlReader.parse(input);
- }
-
-
- /**
- * Set up the XML reader.
- */
- private void setupXMLReader ()
- throws SAXException
- {
- xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
- try {
- xmlReader.setFeature("http://xml.org/sax/features/namespaces",
- false);
- } catch (SAXException e) {
- // NO OP: it's just extra information, and we can ignore it
- }
- xmlReader.setContentHandler(this);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.ContentHandler.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set a document locator.
- *
- * @param locator The document locator.
- * @see org.xml.sax.ContentHandler#setDocumentLocator
- */
- public void setDocumentLocator (Locator locator)
- {
- if (documentHandler != null)
- documentHandler.setDocumentLocator(locator);
- }
-
-
- /**
- * Start document event.
- *
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#startDocument
- */
- public void startDocument ()
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.startDocument();
- }
-
-
- /**
- * End document event.
- *
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#endDocument
- */
- public void endDocument ()
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.endDocument();
- }
-
-
- /**
- * Adapt a SAX2 start prefix mapping event.
- *
- * @param prefix The prefix being mapped.
- * @param uri The Namespace URI being mapped to.
- * @see org.xml.sax.ContentHandler#startPrefixMapping
- */
- public void startPrefixMapping (String prefix, String uri)
- {
- }
-
-
- /**
- * Adapt a SAX2 end prefix mapping event.
- *
- * @param prefix The prefix being mapped.
- * @see org.xml.sax.ContentHandler#endPrefixMapping
- */
- public void endPrefixMapping (String prefix)
- {
- }
-
-
- /**
- * Adapt a SAX2 start element event.
- *
- * @param uri The Namespace URI.
- * @param localName The Namespace local name.
- * @param qName The qualified (prefixed) name.
- * @param atts The SAX2 attributes.
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#endDocument
- */
- public void startElement (String uri, String localName,
- String qName, Attributes atts)
- throws SAXException
- {
- if (documentHandler != null) {
- qAtts.setAttributes(atts);
- documentHandler.startElement(qName, qAtts);
- }
- }
-
-
- /**
- * Adapt a SAX2 end element event.
- *
- * @param uri The Namespace URI.
- * @param localName The Namespace local name.
- * @param qName The qualified (prefixed) name.
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#endElement
- */
- public void endElement (String uri, String localName,
- String qName)
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.endElement(qName);
- }
-
-
- /**
- * Adapt a SAX2 characters event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use.
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#characters
- */
- public void characters (char ch[], int start, int length)
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.characters(ch, start, length);
- }
-
-
- /**
- * Adapt a SAX2 ignorable whitespace event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use.
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#ignorableWhitespace
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.ignorableWhitespace(ch, start, length);
- }
-
-
- /**
- * Adapt a SAX2 processing instruction event.
- *
- * @param target The processing instruction target.
- * @param data The remainder of the processing instruction
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#processingInstruction
- */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.processingInstruction(target, data);
- }
-
-
- /**
- * Adapt a SAX2 skipped entity event.
- *
- * @param name The name of the skipped entity.
- * @see org.xml.sax.ContentHandler#skippedEntity
- * @exception org.xml.sax.SAXException Throwable by subclasses.
- */
- public void skippedEntity (String name)
- throws SAXException
- {
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- XMLReader xmlReader;
- DocumentHandler documentHandler;
- AttributesAdapter qAtts;
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal class.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Internal class to wrap a SAX2 Attributes object for SAX1.
- */
- final class AttributesAdapter implements AttributeList
- {
- AttributesAdapter ()
- {
- }
-
-
- /**
- * Set the embedded Attributes object.
- *
- * @param The embedded SAX2 Attributes.
- */
- void setAttributes (Attributes attributes)
- {
- this.attributes = attributes;
- }
-
-
- /**
- * Return the number of attributes.
- *
- * @return The length of the attribute list.
- * @see org.xml.sax.AttributeList#getLength
- */
- public int getLength ()
- {
- return attributes.getLength();
- }
-
-
- /**
- * Return the qualified (prefixed) name of an attribute by position.
- *
- * @return The qualified name.
- * @see org.xml.sax.AttributeList#getName
- */
- public String getName (int i)
- {
- return attributes.getQName(i);
- }
-
-
- /**
- * Return the type of an attribute by position.
- *
- * @return The type.
- * @see org.xml.sax.AttributeList#getType(int)
- */
- public String getType (int i)
- {
- return attributes.getType(i);
- }
-
-
- /**
- * Return the value of an attribute by position.
- *
- * @return The value.
- * @see org.xml.sax.AttributeList#getValue(int)
- */
- public String getValue (int i)
- {
- return attributes.getValue(i);
- }
-
-
- /**
- * Return the type of an attribute by qualified (prefixed) name.
- *
- * @return The type.
- * @see org.xml.sax.AttributeList#getType(java.lang.String)
- */
- public String getType (String qName)
- {
- return attributes.getType(qName);
- }
-
-
- /**
- * Return the value of an attribute by qualified (prefixed) name.
- *
- * @return The value.
- * @see org.xml.sax.AttributeList#getValue(java.lang.String)
- */
- public String getValue (String qName)
- {
- return attributes.getValue(qName);
- }
-
- private Attributes attributes;
- }
-
-}
-
-// end of XMLReaderAdapter.java
diff --git a/libjava/external/sax/org/xml/sax/helpers/XMLReaderFactory.java b/libjava/external/sax/org/xml/sax/helpers/XMLReaderFactory.java
deleted file mode 100644
index 0516ff24e71..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/XMLReaderFactory.java
+++ /dev/null
@@ -1,202 +0,0 @@
-// XMLReaderFactory.java - factory for creating a new reader.
-// http://www.saxproject.org
-// Written by David Megginson
-// and by David Brownell
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLReaderFactory.java,v 1.1 2004/12/23 22:38:42 mark Exp $
-
-package org.xml.sax.helpers;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-
-/**
- * Factory for creating an XML reader.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class contains static methods for creating an XML reader
- * from an explicit class name, or based on runtime defaults:</p>
- *
- * <pre>
- * try {
- * XMLReader myReader = XMLReaderFactory.createXMLReader();
- * } catch (SAXException e) {
- * System.err.println(e.getMessage());
- * }
- * </pre>
- *
- * <p><strong>Note to Distributions bundled with parsers:</strong>
- * You should modify the implementation of the no-arguments
- * <em>createXMLReader</em> to handle cases where the external
- * configuration mechanisms aren't set up. That method should do its
- * best to return a parser when one is in the class path, even when
- * nothing bound its class name to <code>org.xml.sax.driver</code> so
- * those configuration mechanisms would see it.</p>
- *
- * @since SAX 2.0
- * @author David Megginson, David Brownell
- * @version 2.0.1 (sax2r2)
- */
-final public class XMLReaderFactory
-{
- /**
- * Private constructor.
- *
- * <p>This constructor prevents the class from being instantiated.</p>
- */
- private XMLReaderFactory ()
- {
- }
-
- private static final String property = "org.xml.sax.driver";
-
- /**
- * Attempt to create an XMLReader from system defaults.
- * In environments which can support it, the name of the XMLReader
- * class is determined by trying each these options in order, and
- * using the first one which succeeds:</p> <ul>
- *
- * <li>If the system property <code>org.xml.sax.driver</code>
- * has a value, that is used as an XMLReader class name. </li>
- *
- * <li>The JAR "Services API" is used to look for a class name
- * in the <em>META-INF/services/org.xml.sax.driver</em> file in
- * jarfiles available to the runtime.</li>
- *
- * <li> SAX parser distributions are strongly encouraged to provide
- * a default XMLReader class name that will take effect only when
- * previous options (on this list) are not successful.</li>
- *
- * <li>Finally, if {@link ParserFactory#makeParser()} can
- * return a system default SAX1 parser, that parser is wrapped in
- * a {@link ParserAdapter}. (This is a migration aid for SAX1
- * environments, where the <code>org.xml.sax.parser</code> system
- * property will often be usable.) </li>
- *
- * </ul>
- *
- * <p> In environments such as small embedded systems, which can not
- * support that flexibility, other mechanisms to determine the default
- * may be used. </p>
- *
- * <p>Note that many Java environments allow system properties to be
- * initialized on a command line. This means that <em>in most cases</em>
- * setting a good value for that property ensures that calls to this
- * method will succeed, except when security policies intervene.
- * This will also maximize application portability to older SAX
- * environments, with less robust implementations of this method.
- * </p>
- *
- * @return A new XMLReader.
- * @exception org.xml.sax.SAXException If no default XMLReader class
- * can be identified and instantiated.
- * @see #createXMLReader(java.lang.String)
- */
- public static XMLReader createXMLReader ()
- throws SAXException
- {
- String className = null;
- ClassLoader loader = NewInstance.getClassLoader ();
-
- // 1. try the JVM-instance-wide system property
- try { className = System.getProperty (property); }
- catch (RuntimeException e) { /* normally fails for applets */ }
-
- // 2. if that fails, try META-INF/services/
- if (className == null) {
- try {
- String service = "META-INF/services/" + property;
- InputStream in;
- BufferedReader reader;
-
- if (loader == null)
- in = ClassLoader.getSystemResourceAsStream (service);
- else
- in = loader.getResourceAsStream (service);
-
- if (in != null) {
- reader = new BufferedReader (
- new InputStreamReader (in, "UTF8"));
- className = reader.readLine ();
- in.close ();
- }
- } catch (Exception e) {
- }
- }
-
- // 3. Distro-specific fallback
- if (className == null) {
-// BEGIN DISTRIBUTION-SPECIFIC
-
- // EXAMPLE:
- // className = "com.example.sax.XmlReader";
- // or a $JAVA_HOME/jre/lib/*properties setting...
-
-// END DISTRIBUTION-SPECIFIC
- }
-
- // do we know the XMLReader implementation class yet?
- if (className != null)
- return loadClass (loader, className);
-
- // 4. panic -- adapt any SAX1 parser
- try {
- return new ParserAdapter (ParserFactory.makeParser ());
- } catch (Exception e) {
- throw new SAXException ("Can't create default XMLReader; "
- + "is system property org.xml.sax.driver set?");
- }
- }
-
-
- /**
- * Attempt to create an XML reader from a class name.
- *
- * <p>Given a class name, this method attempts to load
- * and instantiate the class as an XML reader.</p>
- *
- * <p>Note that this method will not be usable in environments where
- * the caller (perhaps an applet) is not permitted to load classes
- * dynamically.</p>
- *
- * @return A new XML reader.
- * @exception org.xml.sax.SAXException If the class cannot be
- * loaded, instantiated, and cast to XMLReader.
- * @see #createXMLReader()
- */
- public static XMLReader createXMLReader (String className)
- throws SAXException
- {
- return loadClass (NewInstance.getClassLoader (), className);
- }
-
- private static XMLReader loadClass (ClassLoader loader, String className)
- throws SAXException
- {
- try {
- return (XMLReader) NewInstance.newInstance (loader, className);
- } catch (ClassNotFoundException e1) {
- throw new SAXException("SAX2 driver class " + className +
- " not found", e1);
- } catch (IllegalAccessException e2) {
- throw new SAXException("SAX2 driver class " + className +
- " found but cannot be loaded", e2);
- } catch (InstantiationException e3) {
- throw new SAXException("SAX2 driver class " + className +
- " loaded but cannot be instantiated (no empty public constructor?)",
- e3);
- } catch (ClassCastException e4) {
- throw new SAXException("SAX2 driver class " + className +
- " does not implement XMLReader", e4);
- }
- }
-}
diff --git a/libjava/external/sax/org/xml/sax/helpers/package.html b/libjava/external/sax/org/xml/sax/helpers/package.html
deleted file mode 100644
index 06d4a30a63c..00000000000
--- a/libjava/external/sax/org/xml/sax/helpers/package.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<HTML><HEAD>
-<!-- $Id: package.html,v 1.1 2004/12/23 22:38:42 mark Exp $ -->
-</HEAD><BODY>
-
-<p>This package contains "helper" classes, including
-support for bootstrapping SAX-based applications.
-
-<p>See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
-for more information about SAX.</p>
-
-</BODY></HTML>
diff --git a/libjava/external/sax/org/xml/sax/package.html b/libjava/external/sax/org/xml/sax/package.html
deleted file mode 100644
index b71f67fdda7..00000000000
--- a/libjava/external/sax/org/xml/sax/package.html
+++ /dev/null
@@ -1,297 +0,0 @@
-<html><head>
-<!-- $Id: package.html,v 1.1 2004/12/23 22:38:42 mark Exp $ -->
-</head><body>
-
-<p> This package provides the core SAX APIs.
-Some SAX1 APIs are deprecated to encourage integration of
-namespace-awareness into designs of new applications
-and into maintenance of existing infrastructure. </p>
-
-<p>See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
-for more information about SAX.</p>
-
-
-<h2> SAX2 Standard Feature Flags </h2>
-
-<p> One of the essential characteristics of SAX2 is that it added
-feature flags which can be used to examine and perhaps modify
-parser modes, in particular modes such as validation.
-Since features are identified by (absolute) URIs, anyone
-can define such features.
-Currently defined standard feature URIs have the prefix
-<code>http://xml.org/sax/features/</code> before an identifier such as
-<code>validation</code>. Turn features on or off using
-<em>setFeature</em>. Those standard identifiers are: </p>
-
-
-<table border="1" cellpadding="3" cellspacing="0" width="100%">
- <tr align="center" bgcolor="#ccccff">
- <th>Feature ID</th>
- <th>Access</th>
- <th>Default</th>
- <th>Description</th>
- </tr>
-
- <tr>
- <td>external-general-entities</td>
- <td><em>read/write</em></td>
- <td><em>unspecified</em></td>
- <td> Reports whether this parser processes external
- general entities; always true if validating.
- </td>
- </tr>
-
- <tr>
- <td>external-parameter-entities</td>
- <td><em>read/write</em></td>
- <td><em>unspecified</em></td>
- <td> Reports whether this parser processes external
- parameter entities; always true if validating.
- </td>
- </tr>
-
- <tr>
- <td>is-standalone</td>
- <td>(parsing) <em>read-only</em>, (not parsing) <em>none</em></td>
- <td>not applicable</td>
- <td> May be examined only during a parse, after the
- <em>startDocument()</em> callback has been completed; read-only.
- The value is true if the document specified standalone="yes" in
- its XML declaration, and otherwise is false.
- </td>
- </tr>
-
- <tr>
- <td>lexical-handler/parameter-entities</td>
- <td><em>read/write</em></td>
- <td><em>unspecified</em></td>
- <td> A value of "true" indicates that the LexicalHandler will report
- the beginning and end of parameter entities.
- </td>
- </tr>
-
- <tr>
- <td>namespaces</td>
- <td><em>read/write</em></td>
- <td>true</td>
- <td> A value of "true" indicates namespace URIs and unprefixed local names
- for element and attribute names will be available.
- </td>
- </tr>
-
- <tr>
- <td>namespace-prefixes</td>
- <td><em>read/write</em></td>
- <td>false</td>
- <td> A value of "true" indicates that XML qualified names (with prefixes) and
- attributes (including <em>xmlns*</em> attributes) will be available.
- </td>
- </tr>
-
- <tr>
- <td>resolve-dtd-uris</td>
- <td><em>read/write</em></td>
- <td><em>true</em></td>
- <td> A value of "true" indicates that system IDs in declarations will
- be absolutized (relative to their base URIs) before reporting.
- (That is the default behavior for all SAX2 XML parsers.)
- A value of "false" indicates those IDs will not be absolutized;
- parsers will provide the base URI from
- <em>Locator.getSystemId()</em>.
- This applies to system IDs passed in <ul>
- <li><em>DTDHandler.notationDecl()</em>,
- <li><em>DTDHandler.unparsedEntityDecl()</em>, and
- <li><em>DeclHandler.externalEntityDecl()</em>.
- </ul>
- It does not apply to <em>EntityResolver.resolveEntity()</em>,
- which is not used to report declarations, or to
- <em>LexicalHandler.startDTD()</em>, which already provides
- the non-absolutized URI.
- </td>
- </tr>
-
- <tr>
- <td>string-interning</td>
- <td><em>read/write</em></td>
- <td><em>unspecified</em></td>
- <td> Has a value of "true" if all XML names (for elements, prefixes,
- attributes, entities, notations, and local names),
- as well as Namespace URIs, will have been interned
- using <em>java.lang.String.intern</em>. This supports fast
- testing of equality/inequality against string constants,
- rather than forcing slower calls to <em>String.equals()</em>.
- </td>
- </tr>
-
- <tr>
- <td>unicode-normalization-checking</td>
- <td><em>read/write</em></td>
- <td><em>false</em></td>
- <td> Controls whether the parser reports Unicode normalization
- errors as described in section 2.13 and Appendix B of the
- XML 1.1 Recommendation. If true, Unicode normalization
- errors are reported using the ErrorHandler.error() callback.
- Such errors are not fatal in themselves (though, obviously,
- other Unicode-related encoding errors may be).
- </td>
- </tr>
-
- <tr>
- <td>use-attributes2</td>
- <td><em>read-only</em></td>
- <td>not applicable</td>
- <td> Returns "true" if the <em>Attributes</em> objects passed by
- this parser in <em>ContentHandler.startElement()</em>
- implement the <a href="ext/Attributes2.html"
- ><em>org.xml.sax.ext.Attributes2</em></a> interface.
- That interface exposes additional DTD-related information,
- such as whether the attribute was specified in the
- source text rather than defaulted.
- </td>
- </tr>
-
- <tr>
- <td>use-locator2</td>
- <td><em>read-only</em></td>
- <td>not applicable</td>
- <td> Returns "true" if the <em>Locator</em> objects passed by
- this parser in <em>ContentHandler.setDocumentLocator()</em>
- implement the <a href="ext/Locator2.html"
- ><em>org.xml.sax.ext.Locator2</em></a> interface.
- That interface exposes additional entity information,
- such as the character encoding and XML version used.
- </td>
- </tr>
-
- <tr>
- <td>use-entity-resolver2</td>
- <td><em>read/write</em></td>
- <td><em>true</em></td>
- <td> Returns "true" if, when <em>setEntityResolver</em> is given
- an object implementing the <a href="ext/EntityResolver2.html"
- ><em>org.xml.sax.ext.EntityResolver2</em></a> interface,
- those new methods will be used.
- Returns "false" to indicate that those methods will not be used.
- </td>
- </tr>
-
- <tr>
- <td>validation</td>
- <td><em>read/write</em></td>
- <td><em>unspecified</em></td>
- <td> Controls whether the parser is reporting all validity
- errors; if true, all external entities will be read.
- </td>
- </tr>
-
- <tr>
- <td>xmlns-uris</td>
- <td><em>read/write</em></td>
- <td><em>false</em></td>
- <td> Controls whether, when the <em>namespace-prefixes</em> feature
- is set, the parser treats namespace declaration attributes as
- being in the <em>http://www.w3.org/2000/xmlns/</em> namespace.
- By default, SAX2 conforms to the original "Namespaces in XML"
- Recommendation, which explicitly states that such attributes are
- not in any namespace.
- Setting this optional flag to "true" makes the SAX2 events conform to
- a later backwards-incompatible revision of that recommendation,
- placing those attributes in a namespace.
- </td>
- </tr>
-
- <tr>
- <td>xml-1.1</td>
- <td><em>read-only</em></td>
- <td>not applicable</td>
- <td> Returns "true" if the parser supports both XML 1.1 and XML 1.0.
- Returns "false" if the parser supports only XML 1.0.
- </td>
- </tr>
-
-</table>
-
-<p> Support for the default values of the
-<em>namespaces</em> and <em>namespace-prefixes</em>
-properties is required.
-Support for any other feature flags is entirely optional.
-</p>
-
-<p> For default values not specified by SAX2,
-each XMLReader implementation specifies its default,
-or may choose not to expose the feature flag.
-Unless otherwise specified here,
-implementations may support changing current values
-of these standard feature flags, but not while parsing.
-</p>
-
-<h2> SAX2 Standard Handler and Property IDs </h2>
-
-<p> For parser interface characteristics that are described
-as objects, a separate namespace is defined. The
-objects in this namespace are again identified by URI, and
-the standard property URIs have the prefix
-<code>http://xml.org/sax/properties/</code> before an identifier such as
-<code>lexical-handler</code> or
-<code>dom-node</code>. Manage those properties using
-<em>setProperty()</em>. Those identifiers are: </p>
-
-<table border="1" cellpadding="3" cellspacing="0" width="100%">
- <tr align="center" bgcolor="#ccccff">
- <th>Property ID</th>
- <th>Description</th>
- </tr>
-
- <tr>
- <td>declaration-handler</td>
- <td> Used to see most DTD declarations except those treated
- as lexical ("document element name is ...") or which are
- mandatory for all SAX parsers (<em>DTDHandler</em>).
- The Object must implement <a href="ext/DeclHandler.html"
- ><em>org.xml.sax.ext.DeclHandler</em></a>.
- </td>
- </tr>
-
- <tr>
- <td>document-xml-version</td>
- <td> May be examined only during a parse, after the startDocument()
- callback has been completed; read-only. This property is a
- literal string describing the actual XML version of the document,
- such as "1.0" or "1.1".
- </td>
- </tr>
-
- <tr>
- <td>dom-node</td>
- <td> For "DOM Walker" style parsers, which ignore their
- <em>parser.parse()</em> parameters, this is used to
- specify the DOM (sub)tree being walked by the parser.
- The Object must implement the
- <em>org.w3c.dom.Node</em> interface.
- </td>
- </tr>
-
- <tr>
- <td>lexical-handler</td>
- <td> Used to see some syntax events that are essential in some
- applications: comments, CDATA delimiters, selected general
- entity inclusions, and the start and end of the DTD
- (and declaration of document element name).
- The Object must implement <a href="ext/LexicalHandler.html"
- ><em>org.xml.sax.ext.LexicalHandler</em></a>.
- </td>
- </tr>
-
- <tr>
- <td>xml-string</td>
- <td> Readable only during a parser callback, this exposes a <b>TBS</b>
- chunk of characters responsible for the current event. </td>
- </tr>
-
-</table>
-
-<p> All of these standard properties are optional;
-XMLReader implementations need not support them.
-</p>
-
-</body></html> \ No newline at end of file
diff --git a/libjava/external/w3c_dom/COPYRIGHT.html b/libjava/external/w3c_dom/COPYRIGHT.html
deleted file mode 100644
index c7e0e497a5f..00000000000
--- a/libjava/external/w3c_dom/COPYRIGHT.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
- <title>W3C IPR SOFTWARE NOTICE</title>
-<style type="text/css">
-<!--
-html, body { background: #fff; color: #000; } /* body for Windows IE3 */
--->
-</style>
- </head>
- <body>
- <h1>
- W3C IPR SOFTWARE NOTICE
- </h1>
- <h3>
- Copyright &copy; 2002 <a href="http://www.w3.org/">World Wide Web
- Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
- Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
- National de Recherche en Informatique et en Automatique</a>, <a
- href="http://www.keio.ac.jp/">Keio University</a>). All Rights
- Reserved.
- </h3>
- <p>
- The DOM bindings are published under the W3C Software Copyright Notice
- and License. The software license requires "Notice of any changes or
- modifications to the W3C files, including the date changes were made."
- Consequently, modified versions of the DOM bindings must document that
- they do not conform to the W3C standard; in the case of the IDL
- definitions, the pragma prefix can no longer be 'w3c.org'; in the case of
- the Java language binding, the package names can no longer be in the
- 'org.w3c' package.
- </p>
- <p>
- <b>Note:</b> The original version of the W3C Software Copyright Notice
- and License could be found at <a
- href='http://www.w3.org/Consortium/Legal/copyright-software-19980720'>http://www.w3.org/Consortium/Legal/copyright-software-19980720</a>
- </p>
- <h3>
- Copyright &copy; 1994-2002 <a href="http://www.w3.org/">World Wide Web
- Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
- Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
- National de Recherche en Informatique et en Automatique</a>, <a
- href="http://www.keio.ac.jp/">Keio University</a>). All Rights
- Reserved. http://www.w3.org/Consortium/Legal/
- </h3>
- <p>
- This W3C work (including software, documents, or other related items) is
- being provided by the copyright holders under the following license. By
- obtaining, using and/or copying this work, you (the licensee) agree that
- you have read, understood, and will comply with the following terms and
- conditions:
- </p>
- <p>
- Permission to use, copy, and modify this software and its documentation,
- with or without modification,&nbsp; for any purpose and without fee or
- royalty is hereby granted, provided that you include the following on ALL
- copies of the software and documentation or portions thereof, including
- modifications, that you make:
- </p>
- <ol>
- <li>
- The full text of this NOTICE in a location viewable to users of the
- redistributed or derivative work.
- </li>
- <li>
- Any pre-existing intellectual property disclaimers, notices, or terms
- and conditions. If none exist, a short notice of the following form
- (hypertext is preferred, text is permitted) should be used within the
- body of any redistributed or derivative code: "Copyright &copy;
- [$date-of-software] <a href="http://www.w3.org/">World Wide Web
- Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
- Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
- National de Recherche en Informatique et en Automatique</a>, <a
- href="http://www.keio.ac.jp/">Keio University</a>). All Rights
- Reserved. http://www.w3.org/Consortium/Legal/"
- </li>
- <li>
- Notice of any changes or modifications to the W3C files, including the
- date changes were made. (We recommend you provide URIs to the location
- from which the code is derived.)
- </li>
- </ol>
- <p>
- THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
- HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
- FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
- DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
- TRADEMARKS OR OTHER RIGHTS.
- </p>
- <p>
- COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
- CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
- DOCUMENTATION.
- </p>
- <p>
- The name and trademarks of copyright holders may NOT be used in
- advertising or publicity pertaining to the software without specific,
- written prior permission. Title to copyright in this software and any
- associated documentation will at all times remain with copyright
- holders.
- </p>
- </body>
-</html>
diff --git a/libjava/external/w3c_dom/Makefile.am b/libjava/external/w3c_dom/Makefile.am
deleted file mode 100644
index 82f6b76a0b2..00000000000
--- a/libjava/external/w3c_dom/Makefile.am
+++ /dev/null
@@ -1,186 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-
-AUTOMAKE_OPTIONS = foreign subdir-objects
-
-# May be used by various substitution variables.
-gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
-
-## The compiler with whatever flags we want for both -c and -C
-## compiles.
-GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated -fclasspath= -fbootclasspath=$(BOOTCLASSPATH)
-
-BOOTCLASSPATH = $(here)'$(CLASSPATH_SEPARATOR)'$(srcdir)'$(CLASSPATH_SEPARATOR)'$(top_srcdir)'$(CLASSPATH_SEPARATOR)'$(top_builddir)
-
-AM_GCJFLAGS = \
- -B$(top_builddir) \
- @LIBGCJ_JAVAFLAGS@ \
- -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
- --encoding=UTF-8 \
- -Wno-deprecated
-
-BUILT_SOURCES = classes.stamp
-
-w3c.jar: classes.stamp
- find org -name '*.class' -print | $(ZIP) -cfME@ $@
-
-classes.stamp: $(source_files)
- here=`pwd`; cd $(srcdir); \
- $(GCJ_WITH_FLAGS) -C -d $$here $(source_files)
- echo > classes.stamp
-
-mostlyclean-local:
- -find . -name '*.class' | xargs rm
- -rm classes.stamp w3c.jar
-
-noinst_LTLIBRARIES = libw3c-gcj.la
-
-libw3c_gcj_la_SOURCES = w3c.jar
-libw3c_gcj_la_GCJFLAGS = -findirect-dispatch -fbootstrap-classes $(AM_GCJFLAGS)
-
-source_files = \
-org/w3c/dom/xpath/XPathNamespace.java \
-org/w3c/dom/xpath/XPathResult.java \
-org/w3c/dom/xpath/XPathException.java \
-org/w3c/dom/xpath/XPathExpression.java \
-org/w3c/dom/xpath/XPathNSResolver.java \
-org/w3c/dom/xpath/XPathEvaluator.java \
-org/w3c/dom/DOMException.java \
-org/w3c/dom/Comment.java \
-org/w3c/dom/stylesheets/DocumentStyle.java \
-org/w3c/dom/stylesheets/MediaList.java \
-org/w3c/dom/stylesheets/LinkStyle.java \
-org/w3c/dom/stylesheets/StyleSheet.java \
-org/w3c/dom/stylesheets/StyleSheetList.java \
-org/w3c/dom/Attr.java \
-org/w3c/dom/Notation.java \
-org/w3c/dom/TypeInfo.java \
-org/w3c/dom/html2/HTMLIsIndexElement.java \
-org/w3c/dom/html2/HTMLTableColElement.java \
-org/w3c/dom/html2/HTMLLinkElement.java \
-org/w3c/dom/html2/HTMLTitleElement.java \
-org/w3c/dom/html2/HTMLBRElement.java \
-org/w3c/dom/html2/HTMLHeadElement.java \
-org/w3c/dom/html2/HTMLHtmlElement.java \
-org/w3c/dom/html2/HTMLScriptElement.java \
-org/w3c/dom/html2/HTMLTableRowElement.java \
-org/w3c/dom/html2/HTMLOptionsCollection.java \
-org/w3c/dom/html2/HTMLTableCellElement.java \
-org/w3c/dom/html2/HTMLDListElement.java \
-org/w3c/dom/html2/HTMLFieldSetElement.java \
-org/w3c/dom/html2/HTMLImageElement.java \
-org/w3c/dom/html2/HTMLHRElement.java \
-org/w3c/dom/html2/HTMLModElement.java \
-org/w3c/dom/html2/HTMLHeadingElement.java \
-org/w3c/dom/html2/HTMLTableElement.java \
-org/w3c/dom/html2/HTMLAreaElement.java \
-org/w3c/dom/html2/HTMLOptGroupElement.java \
-org/w3c/dom/html2/HTMLIFrameElement.java \
-org/w3c/dom/html2/HTMLDirectoryElement.java \
-org/w3c/dom/html2/HTMLParamElement.java \
-org/w3c/dom/html2/HTMLLegendElement.java \
-org/w3c/dom/html2/HTMLFrameElement.java \
-org/w3c/dom/html2/HTMLFormElement.java \
-org/w3c/dom/html2/HTMLStyleElement.java \
-org/w3c/dom/html2/HTMLFrameSetElement.java \
-org/w3c/dom/html2/HTMLCollection.java \
-org/w3c/dom/html2/HTMLAnchorElement.java \
-org/w3c/dom/html2/HTMLLabelElement.java \
-org/w3c/dom/html2/HTMLBodyElement.java \
-org/w3c/dom/html2/HTMLOptionElement.java \
-org/w3c/dom/html2/HTMLTableSectionElement.java \
-org/w3c/dom/html2/HTMLAppletElement.java \
-org/w3c/dom/html2/HTMLSelectElement.java \
-org/w3c/dom/html2/HTMLMetaElement.java \
-org/w3c/dom/html2/HTMLMenuElement.java \
-org/w3c/dom/html2/HTMLDivElement.java \
-org/w3c/dom/html2/HTMLLIElement.java \
-org/w3c/dom/html2/HTMLFontElement.java \
-org/w3c/dom/html2/HTMLOListElement.java \
-org/w3c/dom/html2/HTMLBaseFontElement.java \
-org/w3c/dom/html2/HTMLElement.java \
-org/w3c/dom/html2/HTMLTableCaptionElement.java \
-org/w3c/dom/html2/HTMLTextAreaElement.java \
-org/w3c/dom/html2/HTMLPreElement.java \
-org/w3c/dom/html2/HTMLObjectElement.java \
-org/w3c/dom/html2/HTMLBaseElement.java \
-org/w3c/dom/html2/HTMLUListElement.java \
-org/w3c/dom/html2/HTMLMapElement.java \
-org/w3c/dom/html2/HTMLParagraphElement.java \
-org/w3c/dom/html2/HTMLButtonElement.java \
-org/w3c/dom/html2/HTMLQuoteElement.java \
-org/w3c/dom/html2/HTMLInputElement.java \
-org/w3c/dom/html2/HTMLDocument.java \
-org/w3c/dom/ls/LSParser.java \
-org/w3c/dom/ls/LSSerializerFilter.java \
-org/w3c/dom/ls/LSLoadEvent.java \
-org/w3c/dom/ls/DOMImplementationLS.java \
-org/w3c/dom/ls/LSException.java \
-org/w3c/dom/ls/LSSerializer.java \
-org/w3c/dom/ls/LSResourceResolver.java \
-org/w3c/dom/ls/LSOutput.java \
-org/w3c/dom/ls/LSInput.java \
-org/w3c/dom/ls/LSProgressEvent.java \
-org/w3c/dom/ls/LSParserFilter.java \
-org/w3c/dom/DOMLocator.java \
-org/w3c/dom/DOMStringList.java \
-org/w3c/dom/DocumentFragment.java \
-org/w3c/dom/events/MutationEvent.java \
-org/w3c/dom/events/UIEvent.java \
-org/w3c/dom/events/EventListener.java \
-org/w3c/dom/events/Event.java \
-org/w3c/dom/events/MouseEvent.java \
-org/w3c/dom/events/EventTarget.java \
-org/w3c/dom/events/DocumentEvent.java \
-org/w3c/dom/events/EventException.java \
-org/w3c/dom/EntityReference.java \
-org/w3c/dom/DOMErrorHandler.java \
-org/w3c/dom/views/AbstractView.java \
-org/w3c/dom/views/DocumentView.java \
-org/w3c/dom/DOMError.java \
-org/w3c/dom/bootstrap/DOMImplementationRegistry.java \
-org/w3c/dom/traversal/TreeWalker.java \
-org/w3c/dom/traversal/NodeFilter.java \
-org/w3c/dom/traversal/DocumentTraversal.java \
-org/w3c/dom/traversal/NodeIterator.java \
-org/w3c/dom/CharacterData.java \
-org/w3c/dom/DOMConfiguration.java \
-org/w3c/dom/css/CSSRule.java \
-org/w3c/dom/css/Rect.java \
-org/w3c/dom/css/CSSStyleSheet.java \
-org/w3c/dom/css/CSSFontFaceRule.java \
-org/w3c/dom/css/CSSPrimitiveValue.java \
-org/w3c/dom/css/CSSRuleList.java \
-org/w3c/dom/css/ViewCSS.java \
-org/w3c/dom/css/CSSStyleRule.java \
-org/w3c/dom/css/CSSUnknownRule.java \
-org/w3c/dom/css/RGBColor.java \
-org/w3c/dom/css/ElementCSSInlineStyle.java \
-org/w3c/dom/css/CSSMediaRule.java \
-org/w3c/dom/css/CSS2Properties.java \
-org/w3c/dom/css/CSSValue.java \
-org/w3c/dom/css/CSSStyleDeclaration.java \
-org/w3c/dom/css/DOMImplementationCSS.java \
-org/w3c/dom/css/CSSCharsetRule.java \
-org/w3c/dom/css/Counter.java \
-org/w3c/dom/css/CSSPageRule.java \
-org/w3c/dom/css/DocumentCSS.java \
-org/w3c/dom/css/CSSValueList.java \
-org/w3c/dom/css/CSSImportRule.java \
-org/w3c/dom/NameList.java \
-org/w3c/dom/Element.java \
-org/w3c/dom/Document.java \
-org/w3c/dom/ranges/Range.java \
-org/w3c/dom/ranges/RangeException.java \
-org/w3c/dom/ranges/DocumentRange.java \
-org/w3c/dom/DOMImplementationList.java \
-org/w3c/dom/Entity.java \
-org/w3c/dom/UserDataHandler.java \
-org/w3c/dom/DOMImplementation.java \
-org/w3c/dom/CDATASection.java \
-org/w3c/dom/ProcessingInstruction.java \
-org/w3c/dom/Node.java \
-org/w3c/dom/NamedNodeMap.java \
-org/w3c/dom/NodeList.java \
-org/w3c/dom/Text.java \
-org/w3c/dom/DocumentType.java \
-org/w3c/dom/DOMImplementationSource.java
diff --git a/libjava/external/w3c_dom/Makefile.in b/libjava/external/w3c_dom/Makefile.in
deleted file mode 100644
index 13968d84772..00000000000
--- a/libjava/external/w3c_dom/Makefile.in
+++ /dev/null
@@ -1,741 +0,0 @@
-# Makefile.in generated by automake 1.9.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-SOURCES = $(libw3c_gcj_la_SOURCES)
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = external/w3c_dom
-DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
- $(top_srcdir)/../config/depstand.m4 \
- $(top_srcdir)/../config/gxx-include-dir.m4 \
- $(top_srcdir)/../config/iconv.m4 \
- $(top_srcdir)/../config/lcmessage.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
- $(top_srcdir)/../config/lib-ld.m4 \
- $(top_srcdir)/../config/lib-link.m4 \
- $(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
- $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/../config/no-executables.m4 \
- $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-CONFIG_HEADER = $(top_builddir)/include/config.h \
- $(top_builddir)/gcj/libgcj-config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libw3c_gcj_la_LIBADD =
-am_libw3c_gcj_la_OBJECTS = libw3c_gcj_la-w3c.lo
-libw3c_gcj_la_OBJECTS = $(am_libw3c_gcj_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_builddir)/gcj
-depcomp = $(SHELL) $(top_srcdir)/../depcomp
-am__depfiles_maybe = depfiles
-GCJCOMPILE = $(GCJ) $(AM_GCJFLAGS) $(GCJFLAGS)
-LTGCJCOMPILE = $(LIBTOOL) --mode=compile $(GCJ) $(AM_GCJFLAGS) \
- $(GCJFLAGS)
-GCJLD = $(GCJ)
-GCJLINK = $(LIBTOOL) --mode=link $(GCJLD) $(AM_GCJFLAGS) $(GCJFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libw3c_gcj_la_SOURCES)
-DIST_SOURCES = $(libw3c_gcj_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BACKTRACESPEC = @BACKTRACESPEC@
-CAIRO_CFLAGS = @CAIRO_CFLAGS@
-CAIRO_LIBS = @CAIRO_LIBS@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CHECKREFSPEC = @CHECKREFSPEC@
-CLASSPATH_SEPARATOR = @CLASSPATH_SEPARATOR@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DIRLTDL = @DIRLTDL@
-DIVIDESPEC = @DIVIDESPEC@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXCEPTIONSPEC = @EXCEPTIONSPEC@
-EXEEXT = @EXEEXT@
-GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
-GCDEPS = @GCDEPS@
-GCINCS = @GCINCS@
-GCJ = @GCJ@
-GCJDEPMODE = @GCJDEPMODE@
-GCJFLAGS = @GCJFLAGS@
-GCJH = @GCJH@
-GCJVERSION = @GCJVERSION@
-GCLIBS = @GCLIBS@
-GCSPEC = @GCSPEC@
-GCTESTSPEC = @GCTESTSPEC@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GTK_AWT_FALSE = @GTK_AWT_FALSE@
-GTK_AWT_TRUE = @GTK_AWT_TRUE@
-GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
-GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
-GTK_CFLAGS = @GTK_CFLAGS@
-GTK_LIBS = @GTK_LIBS@
-HASH_SYNC_SPEC = @HASH_SYNC_SPEC@
-IEEESPEC = @IEEESPEC@
-INCLTDL = @INCLTDL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTERPRETER = @INTERPRETER@
-JAVA_HOME = @JAVA_HOME@
-JAVA_HOME_SET_FALSE = @JAVA_HOME_SET_FALSE@
-JAVA_HOME_SET_TRUE = @JAVA_HOME_SET_TRUE@
-JC1GCSPEC = @JC1GCSPEC@
-LDFLAGS = @LDFLAGS@
-LIBART_CFLAGS = @LIBART_CFLAGS@
-LIBART_LIBS = @LIBART_LIBS@
-LIBFFI = @LIBFFI@
-LIBFFIINCS = @LIBFFIINCS@
-LIBGCJDEBUG = @LIBGCJDEBUG@
-LIBGCJTESTSPEC = @LIBGCJTESTSPEC@
-LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@
-LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@
-LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
-LIBGCJ_LD_SYMBOLIC = @LIBGCJ_LD_SYMBOLIC@
-LIBICONV = @LIBICONV@
-LIBLTDL = @LIBLTDL@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBICONV = @LTLIBICONV@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-NATIVE_FALSE = @NATIVE_FALSE@
-NATIVE_TRUE = @NATIVE_TRUE@
-NEEDS_DATA_START_FALSE = @NEEDS_DATA_START_FALSE@
-NEEDS_DATA_START_TRUE = @NEEDS_DATA_START_TRUE@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
-PANGOFT2_LIBS = @PANGOFT2_LIBS@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-PKG_CONFIG = @PKG_CONFIG@
-PLATFORM_INNER_NAT_HDRS = @PLATFORM_INNER_NAT_HDRS@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SUPPLY_BACKTRACE_FALSE = @SUPPLY_BACKTRACE_FALSE@
-SUPPLY_BACKTRACE_TRUE = @SUPPLY_BACKTRACE_TRUE@
-SYSDEP_SOURCES = @SYSDEP_SOURCES@
-SYSTEMSPEC = @SYSTEMSPEC@
-SYS_ZLIBS = @SYS_ZLIBS@
-TESTSUBDIR_FALSE = @TESTSUBDIR_FALSE@
-TESTSUBDIR_TRUE = @TESTSUBDIR_TRUE@
-THREADCXXFLAGS = @THREADCXXFLAGS@
-THREADDEPS = @THREADDEPS@
-THREADINCS = @THREADINCS@
-THREADLDFLAGS = @THREADLDFLAGS@
-THREADLIBS = @THREADLIBS@
-THREADSPEC = @THREADSPEC@
-TOOLKIT = @TOOLKIT@
-USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@
-USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@
-USING_DARWIN_CRT_FALSE = @USING_DARWIN_CRT_FALSE@
-USING_DARWIN_CRT_TRUE = @USING_DARWIN_CRT_TRUE@
-USING_GCC_FALSE = @USING_GCC_FALSE@
-USING_GCC_TRUE = @USING_GCC_TRUE@
-USING_NOGC_FALSE = @USING_NOGC_FALSE@
-USING_NOGC_TRUE = @USING_NOGC_TRUE@
-USING_NO_THREADS_FALSE = @USING_NO_THREADS_FALSE@
-USING_NO_THREADS_TRUE = @USING_NO_THREADS_TRUE@
-USING_POSIX_PLATFORM_FALSE = @USING_POSIX_PLATFORM_FALSE@
-USING_POSIX_PLATFORM_TRUE = @USING_POSIX_PLATFORM_TRUE@
-USING_POSIX_THREADS_FALSE = @USING_POSIX_THREADS_FALSE@
-USING_POSIX_THREADS_TRUE = @USING_POSIX_THREADS_TRUE@
-USING_WIN32_PLATFORM_FALSE = @USING_WIN32_PLATFORM_FALSE@
-USING_WIN32_PLATFORM_TRUE = @USING_WIN32_PLATFORM_TRUE@
-USING_WIN32_THREADS_FALSE = @USING_WIN32_THREADS_FALSE@
-USING_WIN32_THREADS_TRUE = @USING_WIN32_THREADS_TRUE@
-VERSION = @VERSION@
-XLIB_AWT_FALSE = @XLIB_AWT_FALSE@
-XLIB_AWT_TRUE = @XLIB_AWT_TRUE@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-ZINCS = @ZINCS@
-ZIP = @ZIP@
-ZLIBS = @ZLIBS@
-ZLIBSPEC = @ZLIBSPEC@
-ZLIBTESTSPEC = @ZLIBTESTSPEC@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_AS = @ac_ct_AS@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_GCJ = @ac_ct_GCJ@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__fastdepGCJ_FALSE = @am__fastdepGCJ_FALSE@
-am__fastdepGCJ_TRUE = @am__fastdepGCJ_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_subdir = @build_subdir@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-gxx_include_dir = @gxx_include_dir@
-here = @here@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_subdir = @host_subdir@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libgcj_basedir = @libgcj_basedir@
-libstdcxx_incdir = @libstdcxx_incdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-mkinstalldirs = @mkinstalldirs@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-subdirs = @subdirs@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_noncanonical = @target_noncanonical@
-target_os = @target_os@
-target_subdir = @target_subdir@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-toolexecmainlibdir = @toolexecmainlibdir@
-AUTOMAKE_OPTIONS = foreign subdir-objects
-
-# May be used by various substitution variables.
-gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
-GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated -fclasspath= -fbootclasspath=$(BOOTCLASSPATH)
-BOOTCLASSPATH = $(here)'$(CLASSPATH_SEPARATOR)'$(srcdir)'$(CLASSPATH_SEPARATOR)'$(top_srcdir)'$(CLASSPATH_SEPARATOR)'$(top_builddir)
-AM_GCJFLAGS = \
- -B$(top_builddir) \
- @LIBGCJ_JAVAFLAGS@ \
- -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
- --encoding=UTF-8 \
- -Wno-deprecated
-
-BUILT_SOURCES = classes.stamp
-noinst_LTLIBRARIES = libw3c-gcj.la
-libw3c_gcj_la_SOURCES = w3c.jar
-libw3c_gcj_la_GCJFLAGS = -findirect-dispatch -fbootstrap-classes $(AM_GCJFLAGS)
-source_files = \
-org/w3c/dom/xpath/XPathNamespace.java \
-org/w3c/dom/xpath/XPathResult.java \
-org/w3c/dom/xpath/XPathException.java \
-org/w3c/dom/xpath/XPathExpression.java \
-org/w3c/dom/xpath/XPathNSResolver.java \
-org/w3c/dom/xpath/XPathEvaluator.java \
-org/w3c/dom/DOMException.java \
-org/w3c/dom/Comment.java \
-org/w3c/dom/stylesheets/DocumentStyle.java \
-org/w3c/dom/stylesheets/MediaList.java \
-org/w3c/dom/stylesheets/LinkStyle.java \
-org/w3c/dom/stylesheets/StyleSheet.java \
-org/w3c/dom/stylesheets/StyleSheetList.java \
-org/w3c/dom/Attr.java \
-org/w3c/dom/Notation.java \
-org/w3c/dom/TypeInfo.java \
-org/w3c/dom/html2/HTMLIsIndexElement.java \
-org/w3c/dom/html2/HTMLTableColElement.java \
-org/w3c/dom/html2/HTMLLinkElement.java \
-org/w3c/dom/html2/HTMLTitleElement.java \
-org/w3c/dom/html2/HTMLBRElement.java \
-org/w3c/dom/html2/HTMLHeadElement.java \
-org/w3c/dom/html2/HTMLHtmlElement.java \
-org/w3c/dom/html2/HTMLScriptElement.java \
-org/w3c/dom/html2/HTMLTableRowElement.java \
-org/w3c/dom/html2/HTMLOptionsCollection.java \
-org/w3c/dom/html2/HTMLTableCellElement.java \
-org/w3c/dom/html2/HTMLDListElement.java \
-org/w3c/dom/html2/HTMLFieldSetElement.java \
-org/w3c/dom/html2/HTMLImageElement.java \
-org/w3c/dom/html2/HTMLHRElement.java \
-org/w3c/dom/html2/HTMLModElement.java \
-org/w3c/dom/html2/HTMLHeadingElement.java \
-org/w3c/dom/html2/HTMLTableElement.java \
-org/w3c/dom/html2/HTMLAreaElement.java \
-org/w3c/dom/html2/HTMLOptGroupElement.java \
-org/w3c/dom/html2/HTMLIFrameElement.java \
-org/w3c/dom/html2/HTMLDirectoryElement.java \
-org/w3c/dom/html2/HTMLParamElement.java \
-org/w3c/dom/html2/HTMLLegendElement.java \
-org/w3c/dom/html2/HTMLFrameElement.java \
-org/w3c/dom/html2/HTMLFormElement.java \
-org/w3c/dom/html2/HTMLStyleElement.java \
-org/w3c/dom/html2/HTMLFrameSetElement.java \
-org/w3c/dom/html2/HTMLCollection.java \
-org/w3c/dom/html2/HTMLAnchorElement.java \
-org/w3c/dom/html2/HTMLLabelElement.java \
-org/w3c/dom/html2/HTMLBodyElement.java \
-org/w3c/dom/html2/HTMLOptionElement.java \
-org/w3c/dom/html2/HTMLTableSectionElement.java \
-org/w3c/dom/html2/HTMLAppletElement.java \
-org/w3c/dom/html2/HTMLSelectElement.java \
-org/w3c/dom/html2/HTMLMetaElement.java \
-org/w3c/dom/html2/HTMLMenuElement.java \
-org/w3c/dom/html2/HTMLDivElement.java \
-org/w3c/dom/html2/HTMLLIElement.java \
-org/w3c/dom/html2/HTMLFontElement.java \
-org/w3c/dom/html2/HTMLOListElement.java \
-org/w3c/dom/html2/HTMLBaseFontElement.java \
-org/w3c/dom/html2/HTMLElement.java \
-org/w3c/dom/html2/HTMLTableCaptionElement.java \
-org/w3c/dom/html2/HTMLTextAreaElement.java \
-org/w3c/dom/html2/HTMLPreElement.java \
-org/w3c/dom/html2/HTMLObjectElement.java \
-org/w3c/dom/html2/HTMLBaseElement.java \
-org/w3c/dom/html2/HTMLUListElement.java \
-org/w3c/dom/html2/HTMLMapElement.java \
-org/w3c/dom/html2/HTMLParagraphElement.java \
-org/w3c/dom/html2/HTMLButtonElement.java \
-org/w3c/dom/html2/HTMLQuoteElement.java \
-org/w3c/dom/html2/HTMLInputElement.java \
-org/w3c/dom/html2/HTMLDocument.java \
-org/w3c/dom/ls/LSParser.java \
-org/w3c/dom/ls/LSSerializerFilter.java \
-org/w3c/dom/ls/LSLoadEvent.java \
-org/w3c/dom/ls/DOMImplementationLS.java \
-org/w3c/dom/ls/LSException.java \
-org/w3c/dom/ls/LSSerializer.java \
-org/w3c/dom/ls/LSResourceResolver.java \
-org/w3c/dom/ls/LSOutput.java \
-org/w3c/dom/ls/LSInput.java \
-org/w3c/dom/ls/LSProgressEvent.java \
-org/w3c/dom/ls/LSParserFilter.java \
-org/w3c/dom/DOMLocator.java \
-org/w3c/dom/DOMStringList.java \
-org/w3c/dom/DocumentFragment.java \
-org/w3c/dom/events/MutationEvent.java \
-org/w3c/dom/events/UIEvent.java \
-org/w3c/dom/events/EventListener.java \
-org/w3c/dom/events/Event.java \
-org/w3c/dom/events/MouseEvent.java \
-org/w3c/dom/events/EventTarget.java \
-org/w3c/dom/events/DocumentEvent.java \
-org/w3c/dom/events/EventException.java \
-org/w3c/dom/EntityReference.java \
-org/w3c/dom/DOMErrorHandler.java \
-org/w3c/dom/views/AbstractView.java \
-org/w3c/dom/views/DocumentView.java \
-org/w3c/dom/DOMError.java \
-org/w3c/dom/bootstrap/DOMImplementationRegistry.java \
-org/w3c/dom/traversal/TreeWalker.java \
-org/w3c/dom/traversal/NodeFilter.java \
-org/w3c/dom/traversal/DocumentTraversal.java \
-org/w3c/dom/traversal/NodeIterator.java \
-org/w3c/dom/CharacterData.java \
-org/w3c/dom/DOMConfiguration.java \
-org/w3c/dom/css/CSSRule.java \
-org/w3c/dom/css/Rect.java \
-org/w3c/dom/css/CSSStyleSheet.java \
-org/w3c/dom/css/CSSFontFaceRule.java \
-org/w3c/dom/css/CSSPrimitiveValue.java \
-org/w3c/dom/css/CSSRuleList.java \
-org/w3c/dom/css/ViewCSS.java \
-org/w3c/dom/css/CSSStyleRule.java \
-org/w3c/dom/css/CSSUnknownRule.java \
-org/w3c/dom/css/RGBColor.java \
-org/w3c/dom/css/ElementCSSInlineStyle.java \
-org/w3c/dom/css/CSSMediaRule.java \
-org/w3c/dom/css/CSS2Properties.java \
-org/w3c/dom/css/CSSValue.java \
-org/w3c/dom/css/CSSStyleDeclaration.java \
-org/w3c/dom/css/DOMImplementationCSS.java \
-org/w3c/dom/css/CSSCharsetRule.java \
-org/w3c/dom/css/Counter.java \
-org/w3c/dom/css/CSSPageRule.java \
-org/w3c/dom/css/DocumentCSS.java \
-org/w3c/dom/css/CSSValueList.java \
-org/w3c/dom/css/CSSImportRule.java \
-org/w3c/dom/NameList.java \
-org/w3c/dom/Element.java \
-org/w3c/dom/Document.java \
-org/w3c/dom/ranges/Range.java \
-org/w3c/dom/ranges/RangeException.java \
-org/w3c/dom/ranges/DocumentRange.java \
-org/w3c/dom/DOMImplementationList.java \
-org/w3c/dom/Entity.java \
-org/w3c/dom/UserDataHandler.java \
-org/w3c/dom/DOMImplementation.java \
-org/w3c/dom/CDATASection.java \
-org/w3c/dom/ProcessingInstruction.java \
-org/w3c/dom/Node.java \
-org/w3c/dom/NamedNodeMap.java \
-org/w3c/dom/NodeList.java \
-org/w3c/dom/Text.java \
-org/w3c/dom/DocumentType.java \
-org/w3c/dom/DOMImplementationSource.java
-
-all: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .jar .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign external/w3c_dom/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign external/w3c_dom/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-libw3c-gcj.la: $(libw3c_gcj_la_OBJECTS) $(libw3c_gcj_la_DEPENDENCIES)
- $(GCJLINK) $(libw3c_gcj_la_LDFLAGS) $(libw3c_gcj_la_OBJECTS) $(libw3c_gcj_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libw3c_gcj_la-w3c.Plo@am__quote@
-
-.jar.o:
-@am__fastdepGCJ_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`; \
-@am__fastdepGCJ_TRUE@ if $(GCJCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
-@am__fastdepGCJ_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepGCJ_FALSE@ $(GCJCOMPILE) -c -o $@ $<
-
-.jar.obj:
-@am__fastdepGCJ_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`; \
-@am__fastdepGCJ_TRUE@ if $(GCJCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepGCJ_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepGCJ_FALSE@ $(GCJCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.jar.lo:
-@am__fastdepGCJ_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`; \
-@am__fastdepGCJ_TRUE@ if $(LTGCJCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
-@am__fastdepGCJ_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Plo"; else rm -f "$$depbase.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepGCJ_FALSE@ $(LTGCJCOMPILE) -c -o $@ $<
-
-libw3c_gcj_la-w3c.lo: w3c.jar
-@am__fastdepGCJ_TRUE@ if $(LIBTOOL) --mode=compile $(GCJ) $(libw3c_gcj_la_GCJFLAGS) $(GCJFLAGS) -MT libw3c_gcj_la-w3c.lo -MD -MP -MF "$(DEPDIR)/libw3c_gcj_la-w3c.Tpo" -c -o libw3c_gcj_la-w3c.lo `test -f 'w3c.jar' || echo '$(srcdir)/'`w3c.jar; \
-@am__fastdepGCJ_TRUE@ then mv -f "$(DEPDIR)/libw3c_gcj_la-w3c.Tpo" "$(DEPDIR)/libw3c_gcj_la-w3c.Plo"; else rm -f "$(DEPDIR)/libw3c_gcj_la-w3c.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='w3c.jar' object='libw3c_gcj_la-w3c.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepGCJ_FALSE@ $(LIBTOOL) --mode=compile $(GCJ) $(libw3c_gcj_la_GCJFLAGS) $(GCJFLAGS) -c -o libw3c_gcj_la-w3c.lo `test -f 'w3c.jar' || echo '$(srcdir)/'`w3c.jar
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool mostlyclean-local
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- mostlyclean-local pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am
-
-
-w3c.jar: classes.stamp
- find org -name '*.class' -print | $(ZIP) -cfME@ $@
-
-classes.stamp: $(source_files)
- here=`pwd`; cd $(srcdir); \
- $(GCJ_WITH_FLAGS) -C -d $$here $(source_files)
- echo > classes.stamp
-
-mostlyclean-local:
- -find . -name '*.class' | xargs rm
- -rm classes.stamp w3c.jar
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/libjava/external/w3c_dom/README b/libjava/external/w3c_dom/README
deleted file mode 100644
index 6670651efc9..00000000000
--- a/libjava/external/w3c_dom/README
+++ /dev/null
@@ -1,97 +0,0 @@
-Bindings for the Document Object Model (DOM).
-DOM is not maintained as part of GNU Classpath, but is used with GNU Classpath.
-
-The packages includes are:
-
-Document Object Model (DOM) Level 3 Core Specification
-http://www.w3.org/TR/DOM-Level-3-Core/
-(07 April 2004)
-
-Document Object Model (DOM) Level 3 Load and Save Specification
-http://www.w3.org/TR/DOM-Level-3-LS/
-(07 April 2004)
-
-Document Object Model (DOM) Level 2 Events Specification
-http://www.w3.org/TR/DOM-Level-2-Events/
-(13 November 2000)
-Latest errata: 20021016
-
-Document Object Model (DOM) Level 2 Views Specification
-http://www.w3.org/TR/DOM-Level-2-Views/
-(13 November 2000)
-Latest errata: 20021016
-
-Document Object Model (DOM) Level 2 Style Specification
-http://www.w3.org/TR/DOM-Level-2-Style/
-(13 November 2000)
-Latest errata: 20021016
-
-Document Object Model (DOM) Level 2 Traversal and Range Specification
-http://www.w3.org/TR/DOM-Level-2-Traversal-Range/
-(13 November 2000)
-Latest errata: 20021016
-
-Document Object Model (DOM) Level 2 HTML Specification
-http://www.w3.org/TR/DOM-Level-2-HTML/
-(09 January 2003)
-
-Document Object Model (DOM) Level 3 XPath Specification
-http://www.w3.org/TR/DOM-Level-3-XPath/
-(26 February 2004)
-
-Errata can be found at:
-http://www.w3.org/2000/11/DOM-Level-2-errata
-http://www.w3.org/2004/01/DOM-Level-3-errata
-
-The only change to the sources is setting the additional fallback for
-org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance() to
-gnu.xml.dom.ImplementationSource.
-
-When importing new versions don't forget to update the Makefile.am
-to list any new files (or to remove old ones).
-
-All files are distributed under the following
-W3C Software Short Notice:
-
- Copyright (c) 2004 World Wide Web Consortium,
-
- (Massachusetts Institute of Technology, European Research Consortium for
- Informatics and Mathematics, Keio University). All Rights Reserved. This
- work is distributed under the W3C(r) Software License [1] 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.
-
- [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-
- Permission to copy, modify, and distribute this software and its
- documentation, with or without modification, for any purpose and
- without fee or royalty is hereby granted, provided that you include
- the following on ALL copies of the software and documentation or
- portions thereof, including modifications:
-
- 1. The full text of this NOTICE in a location viewable to users of
- the redistributed or derivative work.
- 2. Any pre-existing intellectual property disclaimers, notices, or
- terms and conditions. If none exist, the W3C Software Short Notice
- should be included (hypertext is preferred, text is permitted) within
- the body of any redistributed or derivative code.
- 3. Notice of any changes or modifications to the files, including
- the date changes were made. (We recommend you provide URIs to the
- location from which the code is derived.)
-
- THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
- HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
- FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
- DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
- TRADEMARKS OR OTHER RIGHTS.
-
- COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL
- OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
- DOCUMENTATION.
-
- The name and trademarks of copyright holders may NOT be used in
- advertising or publicity pertaining to the software without specific,
- written prior permission. Title to copyright in this software and any
- associated documentation will at all times remain with copyright
- holders.
diff --git a/libjava/external/w3c_dom/org/w3c/dom/Attr.java b/libjava/external/w3c_dom/org/w3c/dom/Attr.java
deleted file mode 100644
index d9ed6ffe128..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/Attr.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>Attr</code> interface represents an attribute in an
- * <code>Element</code> object. Typically the allowable values for the
- * attribute are defined in a schema associated with the document.
- * <p><code>Attr</code> objects inherit the <code>Node</code> interface, but
- * since they are not actually child nodes of the element they describe, the
- * DOM does not consider them part of the document tree. Thus, the
- * <code>Node</code> attributes <code>parentNode</code>,
- * <code>previousSibling</code>, and <code>nextSibling</code> have a
- * <code>null</code> value for <code>Attr</code> objects. The DOM takes the
- * view that attributes are properties of elements rather than having a
- * separate identity from the elements they are associated with; this should
- * make it more efficient to implement such features as default attributes
- * associated with all elements of a given type. Furthermore,
- * <code>Attr</code> nodes may not be immediate children of a
- * <code>DocumentFragment</code>. However, they can be associated with
- * <code>Element</code> nodes contained within a
- * <code>DocumentFragment</code>. In short, users and implementors of the
- * DOM need to be aware that <code>Attr</code> nodes have some things in
- * common with other objects inheriting the <code>Node</code> interface, but
- * they also are quite distinct.
- * <p>The attribute's effective value is determined as follows: if this
- * attribute has been explicitly assigned any value, that value is the
- * attribute's effective value; otherwise, if there is a declaration for
- * this attribute, and that declaration includes a default value, then that
- * default value is the attribute's effective value; otherwise, the
- * attribute does not exist on this element in the structure model until it
- * has been explicitly added. Note that the <code>Node.nodeValue</code>
- * attribute on the <code>Attr</code> instance can also be used to retrieve
- * the string version of the attribute's value(s).
- * <p> If the attribute was not explicitly given a value in the instance
- * document but has a default value provided by the schema associated with
- * the document, an attribute node will be created with
- * <code>specified</code> set to <code>false</code>. Removing attribute
- * nodes for which a default value is defined in the schema generates a new
- * attribute node with the default value and <code>specified</code> set to
- * <code>false</code>. If validation occurred while invoking
- * <code>Document.normalizeDocument()</code>, attribute nodes with
- * <code>specified</code> equals to <code>false</code> are recomputed
- * according to the default attribute values provided by the schema. If no
- * default value is associate with this attribute in the schema, the
- * attribute node is discarded.
- * <p>In XML, where the value of an attribute can contain entity references,
- * the child nodes of the <code>Attr</code> node may be either
- * <code>Text</code> or <code>EntityReference</code> nodes (when these are
- * in use; see the description of <code>EntityReference</code> for
- * discussion).
- * <p>The DOM Core represents all attribute values as simple strings, even if
- * the DTD or schema associated with the document declares them of some
- * specific type such as tokenized.
- * <p>The way attribute value normalization is performed by the DOM
- * implementation depends on how much the implementation knows about the
- * schema in use. Typically, the <code>value</code> and
- * <code>nodeValue</code> attributes of an <code>Attr</code> node initially
- * returns the normalized value given by the parser. It is also the case
- * after <code>Document.normalizeDocument()</code> is called (assuming the
- * right options have been set). But this may not be the case after
- * mutation, independently of whether the mutation is performed by setting
- * the string value directly or by changing the <code>Attr</code> child
- * nodes. In particular, this is true when <a href='http://www.w3.org/TR/2004/REC-xml-20040204#dt-charref'>character
- * references</a> are involved, given that they are not represented in the DOM and they
- * impact attribute value normalization. On the other hand, if the
- * implementation knows about the schema in use when the attribute value is
- * changed, and it is of a different type than CDATA, it may normalize it
- * again at that time. This is especially true of specialized DOM
- * implementations, such as SVG DOM implementations, which store attribute
- * values in an internal form different from a string.
- * <p>The following table gives some examples of the relations between the
- * attribute value in the original document (parsed attribute), the value as
- * exposed in the DOM, and the serialization of the value:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>Examples</th>
- * <th>Parsed
- * attribute value</th>
- * <th>Initial <code>Attr.value</code></th>
- * <th>Serialized attribute value</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * Character reference</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x&amp;#178;=5"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x\u00b2=5"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x&amp;#178;=5"</pre>
- * </td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>Built-in
- * character entity</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"y&amp;lt;6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"y&lt;6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"y&amp;lt;6"</pre>
- * </td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>Literal newline between</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>
- * "x=5&amp;#10;y=6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x=5 y=6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x=5&amp;#10;y=6"</pre>
- * </td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>Normalized newline between</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x=5
- * y=6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x=5 y=6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x=5 y=6"</pre>
- * </td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>Entity <code>e</code> with literal newline</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>
- * &lt;!ENTITY e '...&amp;#10;...'&gt; [...]&gt; "x=5&amp;e;y=6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'><em>Dependent on Implementation and Load Options</em></td>
- * <td valign='top' rowspan='1' colspan='1'><em>Dependent on Implementation and Load/Save Options</em></td>
- * </tr>
- * </table>
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Attr extends Node {
- /**
- * Returns the name of this attribute. If <code>Node.localName</code> is
- * different from <code>null</code>, this attribute is a qualified name.
- */
- public String getName();
-
- /**
- * <code>True</code> if this attribute was explicitly given a value in
- * the instance document, <code>false</code> otherwise. If the
- * application changed the value of this attribute node (even if it ends
- * up having the same value as the default value) then it is set to
- * <code>true</code>. The implementation may handle attributes with
- * default values from other schemas similarly but applications should
- * use <code>Document.normalizeDocument()</code> to guarantee this
- * information is up-to-date.
- */
- public boolean getSpecified();
-
- /**
- * On retrieval, the value of the attribute is returned as a string.
- * Character and general entity references are replaced with their
- * values. See also the method <code>getAttribute</code> on the
- * <code>Element</code> interface.
- * <br>On setting, this creates a <code>Text</code> node with the unparsed
- * contents of the string, i.e. any characters that an XML processor
- * would recognize as markup are instead treated as literal text. See
- * also the method <code>Element.setAttribute()</code>.
- * <br> Some specialized implementations, such as some [<a href='http://www.w3.org/TR/2003/REC-SVG11-20030114/'>SVG 1.1</a>]
- * implementations, may do normalization automatically, even after
- * mutation; in such case, the value on retrieval may differ from the
- * value on setting.
- */
- public String getValue();
- /**
- * On retrieval, the value of the attribute is returned as a string.
- * Character and general entity references are replaced with their
- * values. See also the method <code>getAttribute</code> on the
- * <code>Element</code> interface.
- * <br>On setting, this creates a <code>Text</code> node with the unparsed
- * contents of the string, i.e. any characters that an XML processor
- * would recognize as markup are instead treated as literal text. See
- * also the method <code>Element.setAttribute()</code>.
- * <br> Some specialized implementations, such as some [<a href='http://www.w3.org/TR/2003/REC-SVG11-20030114/'>SVG 1.1</a>]
- * implementations, may do normalization automatically, even after
- * mutation; in such case, the value on retrieval may differ from the
- * value on setting.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- */
- public void setValue(String value)
- throws DOMException;
-
- /**
- * The <code>Element</code> node this attribute is attached to or
- * <code>null</code> if this attribute is not in use.
- * @since DOM Level 2
- */
- public Element getOwnerElement();
-
- /**
- * The type information associated with this attribute. While the type
- * information contained in this attribute is guarantee to be correct
- * after loading the document or invoking
- * <code>Document.normalizeDocument()</code>, <code>schemaTypeInfo</code>
- * may not be reliable if the node was moved.
- * @since DOM Level 3
- */
- public TypeInfo getSchemaTypeInfo();
-
- /**
- * Returns whether this attribute is known to be of type ID (i.e. to
- * contain an identifier for its owner element) or not. When it is and
- * its value is unique, the <code>ownerElement</code> of this attribute
- * can be retrieved using the method <code>Document.getElementById</code>
- * . The implementation could use several ways to determine if an
- * attribute node is known to contain an identifier:
- * <ul>
- * <li> If validation
- * occurred using an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * while loading the document or while invoking
- * <code>Document.normalizeDocument()</code>, the post-schema-validation
- * infoset contributions (PSVI contributions) values are used to
- * determine if this attribute is a schema-determined ID attribute using
- * the <a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/#term-sdi'>
- * schema-determined ID</a> definition in [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>]
- * .
- * </li>
- * <li> If validation occurred using a DTD while loading the document or
- * while invoking <code>Document.normalizeDocument()</code>, the infoset <b>[type definition]</b> value is used to determine if this attribute is a DTD-determined ID
- * attribute using the <a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/#term-ddi'>
- * DTD-determined ID</a> definition in [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>]
- * .
- * </li>
- * <li> from the use of the methods <code>Element.setIdAttribute()</code>,
- * <code>Element.setIdAttributeNS()</code>, or
- * <code>Element.setIdAttributeNode()</code>, i.e. it is an
- * user-determined ID attribute;
- * <p ><b>Note:</b> XPointer framework (see section 3.2 in [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>]
- * ) consider the DOM user-determined ID attribute as being part of the
- * XPointer externally-determined ID definition.
- * </li>
- * <li> using mechanisms that
- * are outside the scope of this specification, it is then an
- * externally-determined ID attribute. This includes using schema
- * languages different from XML schema and DTD.
- * </li>
- * </ul>
- * <br> If validation occurred while invoking
- * <code>Document.normalizeDocument()</code>, all user-determined ID
- * attributes are reset and all attribute nodes ID information are then
- * reevaluated in accordance to the schema used. As a consequence, if
- * the <code>Attr.schemaTypeInfo</code> attribute contains an ID type,
- * <code>isId</code> will always return true.
- * @since DOM Level 3
- */
- public boolean isId();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/CDATASection.java b/libjava/external/w3c_dom/org/w3c/dom/CDATASection.java
deleted file mode 100644
index 9267227e42d..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/CDATASection.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * CDATA sections are used to escape blocks of text containing characters that
- * would otherwise be regarded as markup. The only delimiter that is
- * recognized in a CDATA section is the "]]&gt;" string that ends the CDATA
- * section. CDATA sections cannot be nested. Their primary purpose is for
- * including material such as XML fragments, without needing to escape all
- * the delimiters.
- * <p>The <code>CharacterData.data</code> attribute holds the text that is
- * contained by the CDATA section. Note that this <em>may</em> contain characters that need to be escaped outside of CDATA sections and
- * that, depending on the character encoding ("charset") chosen for
- * serialization, it may be impossible to write out some characters as part
- * of a CDATA section.
- * <p>The <code>CDATASection</code> interface inherits from the
- * <code>CharacterData</code> interface through the <code>Text</code>
- * interface. Adjacent <code>CDATASection</code> nodes are not merged by use
- * of the <code>normalize</code> method of the <code>Node</code> interface.
- * <p> No lexical check is done on the content of a CDATA section and it is
- * therefore possible to have the character sequence <code>"]]&gt;"</code>
- * in the content, which is illegal in a CDATA section per section 2.7 of [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. The
- * presence of this character sequence must generate a fatal error during
- * serialization or the cdata section must be splitted before the
- * serialization (see also the parameter <code>"split-cdata-sections"</code>
- * in the <code>DOMConfiguration</code> interface).
- * <p ><b>Note:</b> Because no markup is recognized within a
- * <code>CDATASection</code>, character numeric references cannot be used as
- * an escape mechanism when serializing. Therefore, action needs to be taken
- * when serializing a <code>CDATASection</code> with a character encoding
- * where some of the contained characters cannot be represented. Failure to
- * do so would not produce well-formed XML.
- * <p ><b>Note:</b> One potential solution in the serialization process is to
- * end the CDATA section before the character, output the character using a
- * character reference or entity reference, and open a new CDATA section for
- * any further characters in the text node. Note, however, that some code
- * conversion libraries at the time of writing do not return an error or
- * exception when a character is missing from the encoding, making the task
- * of ensuring that data is not corrupted on serialization more difficult.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface CDATASection extends Text {
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/CharacterData.java b/libjava/external/w3c_dom/org/w3c/dom/CharacterData.java
deleted file mode 100644
index a12dcedfae3..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/CharacterData.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>CharacterData</code> interface extends Node with a set of
- * attributes and methods for accessing character data in the DOM. For
- * clarity this set is defined here rather than on each object that uses
- * these attributes and methods. No DOM objects correspond directly to
- * <code>CharacterData</code>, though <code>Text</code> and others do
- * inherit the interface from it. All <code>offsets</code> in this interface
- * start from <code>0</code>.
- * <p>As explained in the <code>DOMString</code> interface, text strings in
- * the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In
- * the following, the term 16-bit units is used whenever necessary to
- * indicate that indexing on CharacterData is done in 16-bit units.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface CharacterData extends Node {
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- */
- public String getData()
- throws DOMException;
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- */
- public void setData(String data)
- throws DOMException;
-
- /**
- * The number of 16-bit units that are available through <code>data</code>
- * and the <code>substringData</code> method below. This may have the
- * value zero, i.e., <code>CharacterData</code> nodes may be empty.
- */
- public int getLength();
-
- /**
- * Extracts a range of data from the node.
- * @param offset Start offset of substring to extract.
- * @param count The number of 16-bit units to extract.
- * @return The specified substring. If the sum of <code>offset</code> and
- * <code>count</code> exceeds the <code>length</code>, then all 16-bit
- * units to the end of the data are returned.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>, or if the specified <code>count</code> is
- * negative.
- * <br>DOMSTRING_SIZE_ERR: Raised if the specified range of text does
- * not fit into a <code>DOMString</code>.
- */
- public String substringData(int offset,
- int count)
- throws DOMException;
-
- /**
- * Append the string to the end of the character data of the node. Upon
- * success, <code>data</code> provides access to the concatenation of
- * <code>data</code> and the <code>DOMString</code> specified.
- * @param arg The <code>DOMString</code> to append.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void appendData(String arg)
- throws DOMException;
-
- /**
- * Insert a string at the specified 16-bit unit offset.
- * @param offset The character offset at which to insert.
- * @param arg The <code>DOMString</code> to insert.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void insertData(int offset,
- String arg)
- throws DOMException;
-
- /**
- * Remove a range of 16-bit units from the node. Upon success,
- * <code>data</code> and <code>length</code> reflect the change.
- * @param offset The offset from which to start removing.
- * @param count The number of 16-bit units to delete. If the sum of
- * <code>offset</code> and <code>count</code> exceeds
- * <code>length</code> then all 16-bit units from <code>offset</code>
- * to the end of the data are deleted.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>, or if the specified <code>count</code> is
- * negative.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void deleteData(int offset,
- int count)
- throws DOMException;
-
- /**
- * Replace the characters starting at the specified 16-bit unit offset
- * with the specified string.
- * @param offset The offset from which to start replacing.
- * @param count The number of 16-bit units to replace. If the sum of
- * <code>offset</code> and <code>count</code> exceeds
- * <code>length</code>, then all 16-bit units to the end of the data
- * are replaced; (i.e., the effect is the same as a <code>remove</code>
- * method call with the same range, followed by an <code>append</code>
- * method invocation).
- * @param arg The <code>DOMString</code> with which the range must be
- * replaced.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>, or if the specified <code>count</code> is
- * negative.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void replaceData(int offset,
- int count,
- String arg)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/Comment.java b/libjava/external/w3c_dom/org/w3c/dom/Comment.java
deleted file mode 100644
index b04ed4d0a5e..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/Comment.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * This interface inherits from <code>CharacterData</code> and represents the
- * content of a comment, i.e., all the characters between the starting '
- * <code>&lt;!--</code>' and ending '<code>--&gt;</code>'. Note that this is
- * the definition of a comment in XML, and, in practice, HTML, although some
- * HTML tools may implement the full SGML comment structure.
- * <p> No lexical check is done on the content of a comment and it is
- * therefore possible to have the character sequence <code>"--"</code>
- * (double-hyphen) in the content, which is illegal in a comment per section
- * 2.5 of [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. The
- * presence of this character sequence must generate a fatal error during
- * serialization.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Comment extends CharacterData {
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DOMConfiguration.java b/libjava/external/w3c_dom/org/w3c/dom/DOMConfiguration.java
deleted file mode 100644
index 7cce1609e19..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DOMConfiguration.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>DOMConfiguration</code> interface represents the configuration
- * of a document and maintains a table of recognized parameters. Using the
- * configuration, it is possible to change
- * <code>Document.normalizeDocument()</code> behavior, such as replacing the
- * <code>CDATASection</code> nodes with <code>Text</code> nodes or
- * specifying the type of the schema that must be used when the validation
- * of the <code>Document</code> is requested. <code>DOMConfiguration</code>
- * objects are also used in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>DOM Level 3 Load and Save</a>]
- * in the <code>DOMParser</code> and <code>DOMSerializer</code> interfaces.
- * <p> The parameter names used by the <code>DOMConfiguration</code> object
- * are defined throughout the DOM Level 3 specifications. Names are
- * case-insensitive. To avoid possible conflicts, as a convention, names
- * referring to parameters defined outside the DOM specification should be
- * made unique. Because parameters are exposed as properties in the , names
- * are recommended to follow the section 5.16 Identifiers of [Unicode] with the addition of the character '-' (HYPHEN-MINUS) but it is not
- * enforced by the DOM implementation. DOM Level 3 Core Implementations are
- * required to recognize all parameters defined in this specification. Some
- * parameter values may also be required to be supported by the
- * implementation. Refer to the definition of the parameter to know if a
- * value must be supported or not.
- * <p ><b>Note:</b> Parameters are similar to features and properties used in
- * SAX2 [<a href='http://www.saxproject.org/'>SAX</a>].
- * <p> The following list of parameters defined in the DOM:
- * <dl>
- * <dt>
- * <code>"canonical-form"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Canonicalize the document according to the rules specified in [<a href='http://www.w3.org/TR/2001/REC-xml-c14n-20010315'>Canonical XML</a>],
- * such as removing the <code>DocumentType</code> node (if any) from the
- * tree, or removing superfluous namespace declarations from each element.
- * Note that this is limited to what can be represented in the DOM; in
- * particular, there is no way to specify the order of the attributes in the
- * DOM. In addition, Setting this parameter to <code>true</code> will also
- * set the state of the parameters listed below. Later changes to the state
- * of one of those parameters will revert "canonical-form" back to
- * <code>false</code>. Parameters set to <code>false</code>: "entities", "
- * normalize-characters", "cdata-sections". Parameters set to
- * <code>true</code>: "namespaces", "namespace-declarations", "well-formed",
- * "element-content-whitespace". Other parameters are not changed unless
- * explicitly specified in the description of the parameters.</dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Do not canonicalize the document.</dd>
- * </dl></dd>
- * <dt><code>"cdata-sections"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep <code>CDATASection</code> nodes in the document.</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Transform <code>CDATASection</code> nodes in the document into
- * <code>Text</code> nodes. The new <code>Text</code> node is then combined
- * with any adjacent <code>Text</code> node.</dd>
- * </dl></dd>
- * <dt>
- * <code>"check-character-normalization"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Check if the characters in the document are <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>fully
- * normalized</a>, as defined in appendix B of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. When a
- * sequence of characters is encountered that fails normalization checking,
- * an error with the <code>DOMError.type</code> equals to
- * "check-character-normalization-failure" is issued. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Do not check if characters are normalized.</dd>
- * </dl></dd>
- * <dt><code>"comments"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep <code>Comment</code> nodes in the document.</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Discard <code>Comment</code> nodes in the document.</dd>
- * </dl></dd>
- * <dt>
- * <code>"datatype-normalization"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Expose schema normalized values in the tree, such as <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-nv'>XML
- * Schema normalized values</a> in the case of XML Schema. Since this parameter requires to have schema
- * information, the "validate" parameter will also be set to
- * <code>true</code>. Having this parameter activated when "validate" is
- * <code>false</code> has no effect and no schema-normalization will happen.
- * <p ><b>Note:</b> Since the document contains the result of the XML 1.0
- * processing, this parameter does not apply to attribute value
- * normalization as defined in section 3.3.3 of [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] and is only
- * meant for schema languages other than Document Type Definition (DTD). </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Do not perform schema normalization on the tree. </dd>
- * </dl></dd>
- * <dt>
- * <code>"element-content-whitespace"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep all whitespaces in the document.</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>optional</em>] Discard all <code>Text</code> nodes that contain whitespaces in element
- * content, as described in <a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.character'>
- * [element content whitespace]</a>. The implementation is expected to use the attribute
- * <code>Text.isElementContentWhitespace</code> to determine if a
- * <code>Text</code> node should be discarded or not.</dd>
- * </dl></dd>
- * <dt><code>"entities"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep <code>EntityReference</code> nodes in the document.</dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] Remove all <code>EntityReference</code> nodes from the document,
- * putting the entity expansions directly in their place. <code>Text</code>
- * nodes are normalized, as defined in <code>Node.normalize</code>. Only <a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#infoitem.rse'>
- * unexpanded entity references</a> are kept in the document. </dd>
- * </dl>
- * <p ><b>Note:</b> This parameter does not affect <code>Entity</code> nodes. </dd>
- * <dt>
- * <code>"error-handler"</code></dt>
- * <dd>[<em>required</em>] Contains a <code>DOMErrorHandler</code> object. If an error is
- * encountered in the document, the implementation will call back the
- * <code>DOMErrorHandler</code> registered using this parameter. The
- * implementation may provide a default <code>DOMErrorHandler</code> object.
- * When called, <code>DOMError.relatedData</code> will contain the closest
- * node to where the error occurred. If the implementation is unable to
- * determine the node where the error occurs,
- * <code>DOMError.relatedData</code> will contain the <code>Document</code>
- * node. Mutations to the document from within an error handler will result
- * in implementation dependent behavior. </dd>
- * <dt><code>"infoset"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>]Keep in the document the information defined in the XML Information Set [<a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/'>XML Information Set</a>]
- * .This forces the following parameters to <code>false</code>: "
- * validate-if-schema", "entities", "datatype-normalization", "cdata-sections
- * ".This forces the following parameters to <code>true</code>: "
- * namespace-declarations", "well-formed", "element-content-whitespace", "
- * comments", "namespaces".Other parameters are not changed unless
- * explicitly specified in the description of the parameters. Note that
- * querying this parameter with <code>getParameter</code> returns
- * <code>true</code> only if the individual parameters specified above are
- * appropriately set.</dd>
- * <dt><code>false</code></dt>
- * <dd>Setting <code>infoset</code> to
- * <code>false</code> has no effect.</dd>
- * </dl></dd>
- * <dt><code>"namespaces"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Perform the namespace processing as defined in . </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>optional</em>] Do not perform the namespace processing. </dd>
- * </dl></dd>
- * <dt>
- * <code>"namespace-declarations"</code></dt>
- * <dd> This parameter has no effect if the
- * parameter "namespaces" is set to <code>false</code>.
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Include namespace declaration attributes, specified or defaulted from
- * the schema, in the document. See also the sections "Declaring Namespaces"
- * in [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * and [<a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/'>XML Namespaces 1.1</a>]
- * .</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Discard all namespace declaration attributes. The namespace prefixes (
- * <code>Node.prefix</code>) are retained even if this parameter is set to
- * <code>false</code>.</dd>
- * </dl></dd>
- * <dt><code>"normalize-characters"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>Fully
- * normalized</a> the characters in the document as defined in appendix B of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Do not perform character normalization.</dd>
- * </dl></dd>
- * <dt><code>"schema-location"</code></dt>
- * <dd>[<em>optional</em>] Represent a <code>DOMString</code> object containing a list of URIs,
- * separated by whitespaces (characters matching the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-S'>nonterminal
- * production S</a> defined in section 2.3 [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]), that
- * represents the schemas against which validation should occur, i.e. the
- * current schema. The types of schemas referenced in this list must match
- * the type specified with <code>schema-type</code>, otherwise the behavior
- * of an implementation is undefined. The schemas specified using this
- * property take precedence to the schema information specified in the
- * document itself. For namespace aware schema, if a schema specified using
- * this property and a schema specified in the document instance (i.e. using
- * the <code>schemaLocation</code> attribute) in a schema document (i.e.
- * using schema <code>import</code> mechanisms) share the same
- * <code>targetNamespace</code>, the schema specified by the user using this
- * property will be used. If two schemas specified using this property share
- * the same <code>targetNamespace</code> or have no namespace, the behavior
- * is implementation dependent. If no location has been provided, this
- * parameter is <code>null</code>.
- * <p ><b>Note:</b> The <code>"schema-location"</code> parameter is ignored
- * unless the "schema-type" parameter value is set. It is strongly
- * recommended that <code>Document.documentURI</code> will be set so that an
- * implementation can successfully resolve any external entities referenced. </dd>
- * <dt>
- * <code>"schema-type"</code></dt>
- * <dd>[<em>optional</em>] Represent a <code>DOMString</code> object containing an absolute URI
- * and representing the type of the schema language used to validate a
- * document against. Note that no lexical checking is done on the absolute
- * URI. If this parameter is not set, a default value may be provided by
- * the implementation, based on the schema languages supported and on the
- * schema language used at load time. If no value is provided, this
- * parameter is <code>null</code>.
- * <p ><b>Note:</b> For XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , applications must use the value
- * <code>"http://www.w3.org/2001/XMLSchema"</code>. For XML DTD [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>],
- * applications must use the value
- * <code>"http://www.w3.org/TR/REC-xml"</code>. Other schema languages are
- * outside the scope of the W3C and therefore should recommend an absolute
- * URI in order to use this method. </dd>
- * <dt><code>"split-cdata-sections"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Split CDATA sections containing the CDATA section termination marker
- * ']]&gt;'. When a CDATA section is split a warning is issued with a
- * <code>DOMError.type</code> equals to
- * <code>"cdata-sections-splitted"</code> and
- * <code>DOMError.relatedData</code> equals to the first
- * <code>CDATASection</code> node in document order resulting from the split.</dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>]Signal an error if a <code>CDATASection</code> contains an
- * unrepresentable character.</dd>
- * </dl></dd>
- * <dt><code>"validate"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Require the validation against a schema (i.e. XML schema, DTD, any
- * other type or representation of schema) of the document as it is being
- * normalized as defined by [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. If
- * validation errors are found, or no schema was found, the error handler is
- * notified. Schema-normalized values will not be exposed according to the
- * schema in used unless the parameter "datatype-normalization" is
- * <code>true</code>. This parameter will reevaluate:
- * <ul>
- * <li> Attribute nodes with
- * <code>Attr.specified</code> equals to <code>false</code>, as specified in
- * the description of the <code>Attr</code> interface;
- * </li>
- * <li> The value of the
- * attribute <code>Text.isElementContentWhitespace</code> for all
- * <code>Text</code> nodes;
- * </li>
- * <li> The value of the attribute
- * <code>Attr.isId</code> for all <code>Attr</code> nodes;
- * </li>
- * <li> The attributes
- * <code>Element.schemaTypeInfo</code> and <code>Attr.schemaTypeInfo</code>.
- * </li>
- * </ul>
- * <p ><b>Note:</b> "validate-if-schema" and "validate" are mutually
- * exclusive, setting one of them to <code>true</code> will set the other
- * one to <code>false</code>. Applications should also consider setting the
- * parameter "well-formed" to <code>true</code>, which is the default for
- * that option, when validating the document. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Do not accomplish schema processing, including the internal subset
- * processing. Default attribute values information are kept. Note that
- * validation might still happen if "validate-if-schema" is <code>true</code>
- * . </dd>
- * </dl></dd>
- * <dt><code>"validate-if-schema"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>]Enable validation only if a declaration for the document element can be
- * found in a schema (independently of where it is found, i.e. XML schema,
- * DTD, or any other type or representation of schema). If validation is
- * enabled, this parameter has the same behavior as the parameter "validate"
- * set to <code>true</code>.
- * <p ><b>Note:</b> "validate-if-schema" and "validate" are mutually
- * exclusive, setting one of them to <code>true</code> will set the other
- * one to <code>false</code>. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) No schema processing should be performed if the document has a schema,
- * including internal subset processing. Default attribute values
- * information are kept. Note that validation must still happen if "validate
- * " is <code>true</code>. </dd>
- * </dl></dd>
- * <dt><code>"well-formed"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Check if all nodes are XML well formed according to the XML version in
- * use in <code>Document.xmlVersion</code>:
- * <ul>
- * <li> check if the attribute
- * <code>Node.nodeName</code> contains invalid characters according to its
- * node type and generate a <code>DOMError</code> of type
- * <code>"wf-invalid-character-in-node-name"</code>, with a
- * <code>DOMError.SEVERITY_ERROR</code> severity, if necessary;
- * </li>
- * <li> check if
- * the text content inside <code>Attr</code>, <code>Element</code>,
- * <code>Comment</code>, <code>Text</code>, <code>CDATASection</code> nodes
- * for invalid characters and generate a <code>DOMError</code> of type
- * <code>"wf-invalid-character"</code>, with a
- * <code>DOMError.SEVERITY_ERROR</code> severity, if necessary;
- * </li>
- * <li> check if
- * the data inside <code>ProcessingInstruction</code> nodes for invalid
- * characters and generate a <code>DOMError</code> of type
- * <code>"wf-invalid-character"</code>, with a
- * <code>DOMError.SEVERITY_ERROR</code> severity, if necessary;
- * </li>
- * </ul></dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>optional</em>] Do not check for XML well-formedness. </dd>
- * </dl></dd>
- * </dl>
- * <p> The resolution of the system identifiers associated with entities is
- * done using <code>Document.documentURI</code>. However, when the feature
- * "LS" defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>DOM Level 3 Load and Save</a>]
- * is supported by the DOM implementation, the parameter
- * "resource-resolver" can also be used on <code>DOMConfiguration</code>
- * objects attached to <code>Document</code> nodes. If this parameter is
- * set, <code>Document.normalizeDocument()</code> will invoke the resource
- * resolver instead of using <code>Document.documentURI</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMConfiguration {
- /**
- * Set the value of a parameter.
- * @param name The name of the parameter to set.
- * @param value The new value or <code>null</code> if the user wishes to
- * unset the parameter. While the type of the value parameter is
- * defined as <code>DOMUserData</code>, the object type must match the
- * type defined by the definition of the parameter. For example, if
- * the parameter is "error-handler", the value must be of type
- * <code>DOMErrorHandler</code>.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised when the parameter name is not recognized.
- * <br> NOT_SUPPORTED_ERR: Raised when the parameter name is recognized
- * but the requested value cannot be set.
- * <br> TYPE_MISMATCH_ERR: Raised if the value type for this parameter
- * name is incompatible with the expected value type.
- */
- public void setParameter(String name,
- Object value)
- throws DOMException;
-
- /**
- * Return the value of a parameter if known.
- * @param name The name of the parameter.
- * @return The current object associated with the specified parameter or
- * <code>null</code> if no object has been associated or if the
- * parameter is not supported.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised when the parameter name is not recognized.
- */
- public Object getParameter(String name)
- throws DOMException;
-
- /**
- * Check if setting a parameter to a specific value is supported.
- * @param name The name of the parameter to check.
- * @param value An object. if <code>null</code>, the returned value is
- * <code>true</code>.
- * @return <code>true</code> if the parameter could be successfully set
- * to the specified value, or <code>false</code> if the parameter is
- * not recognized or the requested value is not supported. This does
- * not change the current value of the parameter itself.
- */
- public boolean canSetParameter(String name,
- Object value);
-
- /**
- * The list of the parameters supported by this
- * <code>DOMConfiguration</code> object and for which at least one value
- * can be set by the application. Note that this list can also contain
- * parameter names defined outside this specification.
- */
- public DOMStringList getParameterNames();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DOMError.java b/libjava/external/w3c_dom/org/w3c/dom/DOMError.java
deleted file mode 100644
index 37ed7d10d89..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DOMError.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * <code>DOMError</code> is an interface that describes an error.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMError {
- // ErrorSeverity
- /**
- * The severity of the error described by the <code>DOMError</code> is
- * warning. A <code>SEVERITY_WARNING</code> will not cause the
- * processing to stop, unless <code>DOMErrorHandler.handleError()</code>
- * returns <code>false</code>.
- */
- public static final short SEVERITY_WARNING = 1;
- /**
- * The severity of the error described by the <code>DOMError</code> is
- * error. A <code>SEVERITY_ERROR</code> may not cause the processing to
- * stop if the error can be recovered, unless
- * <code>DOMErrorHandler.handleError()</code> returns <code>false</code>.
- */
- public static final short SEVERITY_ERROR = 2;
- /**
- * The severity of the error described by the <code>DOMError</code> is
- * fatal error. A <code>SEVERITY_FATAL_ERROR</code> will cause the
- * normal processing to stop. The return value of
- * <code>DOMErrorHandler.handleError()</code> is ignored unless the
- * implementation chooses to continue, in which case the behavior
- * becomes undefined.
- */
- public static final short SEVERITY_FATAL_ERROR = 3;
-
- /**
- * The severity of the error, either <code>SEVERITY_WARNING</code>,
- * <code>SEVERITY_ERROR</code>, or <code>SEVERITY_FATAL_ERROR</code>.
- */
- public short getSeverity();
-
- /**
- * An implementation specific string describing the error that occurred.
- */
- public String getMessage();
-
- /**
- * A <code>DOMString</code> indicating which related data is expected in
- * <code>relatedData</code>. Users should refer to the specification of
- * the error in order to find its <code>DOMString</code> type and
- * <code>relatedData</code> definitions if any.
- * <p ><b>Note:</b> As an example,
- * <code>Document.normalizeDocument()</code> does generate warnings when
- * the "split-cdata-sections" parameter is in use. Therefore, the method
- * generates a <code>SEVERITY_WARNING</code> with <code>type</code>
- * <code>"cdata-sections-splitted"</code> and the first
- * <code>CDATASection</code> node in document order resulting from the
- * split is returned by the <code>relatedData</code> attribute.
- */
- public String getType();
-
- /**
- * The related platform dependent exception if any.
- */
- public Object getRelatedException();
-
- /**
- * The related <code>DOMError.type</code> dependent data if any.
- */
- public Object getRelatedData();
-
- /**
- * The location of the error.
- */
- public DOMLocator getLocation();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DOMErrorHandler.java b/libjava/external/w3c_dom/org/w3c/dom/DOMErrorHandler.java
deleted file mode 100644
index 3d4ad2aba58..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DOMErrorHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * <code>DOMErrorHandler</code> is a callback interface that the DOM
- * implementation can call when reporting errors that happens while
- * processing XML data, or when doing some other processing (e.g. validating
- * a document). A <code>DOMErrorHandler</code> object can be attached to a
- * <code>Document</code> using the "error-handler" on the
- * <code>DOMConfiguration</code> interface. If more than one error needs to
- * be reported during an operation, the sequence and numbers of the errors
- * passed to the error handler are implementation dependent.
- * <p> The application that is using the DOM implementation is expected to
- * implement this interface.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMErrorHandler {
- /**
- * This method is called on the error handler when an error occurs.
- * <br> If an exception is thrown from this method, it is considered to be
- * equivalent of returning <code>true</code>.
- * @param error The error object that describes the error. This object
- * may be reused by the DOM implementation across multiple calls to
- * the <code>handleError</code> method.
- * @return If the <code>handleError</code> method returns
- * <code>false</code>, the DOM implementation should stop the current
- * processing when possible. If the method returns <code>true</code>,
- * the processing may continue depending on
- * <code>DOMError.severity</code>.
- */
- public boolean handleError(DOMError error);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DOMException.java b/libjava/external/w3c_dom/org/w3c/dom/DOMException.java
deleted file mode 100644
index 0b2578f92f6..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DOMException.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * DOM operations only raise exceptions in "exceptional" circumstances, i.e.,
- * when an operation is impossible to perform (either for logical reasons,
- * because data is lost, or because the implementation has become unstable).
- * In general, DOM methods return specific error values in ordinary
- * processing situations, such as out-of-bound errors when using
- * <code>NodeList</code>.
- * <p>Implementations should raise other exceptions under other circumstances.
- * For example, implementations should raise an implementation-dependent
- * exception if a <code>null</code> argument is passed when <code>null</code>
- * was not expected.
- * <p>Some languages and object systems do not support the concept of
- * exceptions. For such systems, error conditions may be indicated using
- * native error reporting mechanisms. For some bindings, for example,
- * methods may return error codes similar to those listed in the
- * corresponding method descriptions.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public class DOMException extends RuntimeException {
- public DOMException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // ExceptionCode
- /**
- * If index or size is negative, or greater than the allowed value.
- */
- public static final short INDEX_SIZE_ERR = 1;
- /**
- * If the specified range of text does not fit into a
- * <code>DOMString</code>.
- */
- public static final short DOMSTRING_SIZE_ERR = 2;
- /**
- * If any <code>Node</code> is inserted somewhere it doesn't belong.
- */
- public static final short HIERARCHY_REQUEST_ERR = 3;
- /**
- * If a <code>Node</code> is used in a different document than the one
- * that created it (that doesn't support it).
- */
- public static final short WRONG_DOCUMENT_ERR = 4;
- /**
- * If an invalid or illegal character is specified, such as in an XML name.
- */
- public static final short INVALID_CHARACTER_ERR = 5;
- /**
- * If data is specified for a <code>Node</code> which does not support
- * data.
- */
- public static final short NO_DATA_ALLOWED_ERR = 6;
- /**
- * If an attempt is made to modify an object where modifications are not
- * allowed.
- */
- public static final short NO_MODIFICATION_ALLOWED_ERR = 7;
- /**
- * If an attempt is made to reference a <code>Node</code> in a context
- * where it does not exist.
- */
- public static final short NOT_FOUND_ERR = 8;
- /**
- * If the implementation does not support the requested type of object or
- * operation.
- */
- public static final short NOT_SUPPORTED_ERR = 9;
- /**
- * If an attempt is made to add an attribute that is already in use
- * elsewhere.
- */
- public static final short INUSE_ATTRIBUTE_ERR = 10;
- /**
- * If an attempt is made to use an object that is not, or is no longer,
- * usable.
- * @since DOM Level 2
- */
- public static final short INVALID_STATE_ERR = 11;
- /**
- * If an invalid or illegal string is specified.
- * @since DOM Level 2
- */
- public static final short SYNTAX_ERR = 12;
- /**
- * If an attempt is made to modify the type of the underlying object.
- * @since DOM Level 2
- */
- public static final short INVALID_MODIFICATION_ERR = 13;
- /**
- * If an attempt is made to create or change an object in a way which is
- * incorrect with regard to namespaces.
- * @since DOM Level 2
- */
- public static final short NAMESPACE_ERR = 14;
- /**
- * If a parameter or an operation is not supported by the underlying
- * object.
- * @since DOM Level 2
- */
- public static final short INVALID_ACCESS_ERR = 15;
- /**
- * If a call to a method such as <code>insertBefore</code> or
- * <code>removeChild</code> would make the <code>Node</code> invalid
- * with respect to "partial validity", this exception would be raised
- * and the operation would not be done. This code is used in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Val-20040127/'>DOM Level 3 Validation</a>]
- * . Refer to this specification for further information.
- * @since DOM Level 3
- */
- public static final short VALIDATION_ERR = 16;
- /**
- * If the type of an object is incompatible with the expected type of the
- * parameter associated to the object.
- * @since DOM Level 3
- */
- public static final short TYPE_MISMATCH_ERR = 17;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DOMImplementation.java b/libjava/external/w3c_dom/org/w3c/dom/DOMImplementation.java
deleted file mode 100644
index 5bb71e263a9..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DOMImplementation.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>DOMImplementation</code> interface provides a number of methods
- * for performing operations that are independent of any particular instance
- * of the document object model.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface DOMImplementation {
- /**
- * Test if the DOM implementation implements a specific feature and
- * version, as specified in .
- * @param feature The name of the feature to test.
- * @param version This is the version number of the feature to test.
- * @return <code>true</code> if the feature is implemented in the
- * specified version, <code>false</code> otherwise.
- */
- public boolean hasFeature(String feature,
- String version);
-
- /**
- * Creates an empty <code>DocumentType</code> node. Entity declarations
- * and notations are not made available. Entity reference expansions and
- * default attribute additions do not occur..
- * @param qualifiedName The qualified name of the document type to be
- * created.
- * @param publicId The external subset public identifier.
- * @param systemId The external subset system identifier.
- * @return A new <code>DocumentType</code> node with
- * <code>Node.ownerDocument</code> set to <code>null</code>.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified qualified name is not
- * an XML name according to [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>].
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
- * malformed.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature "XML" and the language exposed through the
- * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public DocumentType createDocumentType(String qualifiedName,
- String publicId,
- String systemId)
- throws DOMException;
-
- /**
- * Creates a DOM Document object of the specified type with its document
- * element.
- * <br>Note that based on the <code>DocumentType</code> given to create
- * the document, the implementation may instantiate specialized
- * <code>Document</code> objects that support additional features than
- * the "Core", such as "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * . On the other hand, setting the <code>DocumentType</code> after the
- * document was created makes this very unlikely to happen.
- * Alternatively, specialized <code>Document</code> creation methods,
- * such as <code>createHTMLDocument</code> [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * , can be used to obtain specific types of <code>Document</code>
- * objects.
- * @param namespaceURI The namespace URI of the document element to
- * create or <code>null</code>.
- * @param qualifiedName The qualified name of the document element to be
- * created or <code>null</code>.
- * @param doctype The type of document to be created or <code>null</code>.
- * When <code>doctype</code> is not <code>null</code>, its
- * <code>Node.ownerDocument</code> attribute is set to the document
- * being created.
- * @return A new <code>Document</code> object with its document element.
- * If the <code>NamespaceURI</code>, <code>qualifiedName</code>, and
- * <code>doctype</code> are <code>null</code>, the returned
- * <code>Document</code> is empty with no document element.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified qualified name is not
- * an XML name according to [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>].
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
- * malformed, if the <code>qualifiedName</code> has a prefix and the
- * <code>namespaceURI</code> is <code>null</code>, or if the
- * <code>qualifiedName</code> is <code>null</code> and the
- * <code>namespaceURI</code> is different from <code>null</code>, or
- * if the <code>qualifiedName</code> has a prefix that is "xml" and
- * the <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , or if the DOM implementation does not support the
- * <code>"XML"</code> feature but a non-null namespace URI was
- * provided, since namespaces were defined by XML.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
- * been used with a different document or was created from a different
- * implementation.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature "XML" and the language exposed through the
- * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Document createDocument(String namespaceURI,
- String qualifiedName,
- DocumentType doctype)
- throws DOMException;
-
- /**
- * This method returns a specialized object which implements the
- * specialized APIs of the specified feature and version, as specified
- * in . The specialized object may also be obtained by using
- * binding-specific casting methods but is not necessarily expected to,
- * as discussed in . This method also allow the implementation to
- * provide specialized objects which do not support the
- * <code>DOMImplementation</code> interface.
- * @param feature The name of the feature requested. Note that any plus
- * sign "+" prepended to the name of the feature will be ignored since
- * it is not significant in the context of this method.
- * @param version This is the version number of the feature to test.
- * @return Returns an object which implements the specialized APIs of
- * the specified feature and version, if any, or <code>null</code> if
- * there is no object which implements interfaces associated with that
- * feature. If the <code>DOMObject</code> returned by this method
- * implements the <code>DOMImplementation</code> interface, it must
- * delegate to the primary core <code>DOMImplementation</code> and not
- * return results inconsistent with the primary core
- * <code>DOMImplementation</code> such as <code>hasFeature</code>,
- * <code>getFeature</code>, etc.
- * @since DOM Level 3
- */
- public Object getFeature(String feature,
- String version);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DOMImplementationList.java b/libjava/external/w3c_dom/org/w3c/dom/DOMImplementationList.java
deleted file mode 100644
index 18349fdd411..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DOMImplementationList.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>DOMImplementationList</code> interface provides the abstraction
- * of an ordered collection of DOM implementations, without defining or
- * constraining how this collection is implemented. The items in the
- * <code>DOMImplementationList</code> are accessible via an integral index,
- * starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMImplementationList {
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of
- * <code>DOMImplementation</code>s in the list, this returns
- * <code>null</code>.
- * @param index Index into the collection.
- * @return The <code>DOMImplementation</code> at the <code>index</code>
- * th position in the <code>DOMImplementationList</code>, or
- * <code>null</code> if that is not a valid index.
- */
- public DOMImplementation item(int index);
-
- /**
- * The number of <code>DOMImplementation</code>s in the list. The range
- * of valid child node indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DOMImplementationSource.java b/libjava/external/w3c_dom/org/w3c/dom/DOMImplementationSource.java
deleted file mode 100644
index 3c32c188378..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DOMImplementationSource.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * This interface permits a DOM implementer to supply one or more
- * implementations, based upon requested features and versions, as specified
- * in . Each implemented <code>DOMImplementationSource</code> object is
- * listed in the binding-specific list of available sources so that its
- * <code>DOMImplementation</code> objects are made available.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMImplementationSource {
- /**
- * A method to request the first DOM implementation that supports the
- * specified features.
- * @param features A string that specifies which features and versions
- * are required. This is a space separated list in which each feature
- * is specified by its name optionally followed by a space and a
- * version number. This method returns the first item of the list
- * returned by <code>getDOMImplementationList</code>. As an example,
- * the string <code>"XML 3.0 Traversal +Events 2.0"</code> will
- * request a DOM implementation that supports the module "XML" for its
- * 3.0 version, a module that support of the "Traversal" module for
- * any version, and the module "Events" for its 2.0 version. The
- * module "Events" must be accessible using the method
- * <code>Node.getFeature()</code> and
- * <code>DOMImplementation.getFeature()</code>.
- * @return The first DOM implementation that support the desired
- * features, or <code>null</code> if this source has none.
- */
- public DOMImplementation getDOMImplementation(String features);
-
- /**
- * A method to request a list of DOM implementations that support the
- * specified features and versions, as specified in .
- * @param features A string that specifies which features and versions
- * are required. This is a space separated list in which each feature
- * is specified by its name optionally followed by a space and a
- * version number. This is something like: "XML 3.0 Traversal +Events
- * 2.0"
- * @return A list of DOM implementations that support the desired
- * features.
- */
- public DOMImplementationList getDOMImplementationList(String features);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DOMLocator.java b/libjava/external/w3c_dom/org/w3c/dom/DOMLocator.java
deleted file mode 100644
index fcaaa23de87..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DOMLocator.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * <code>DOMLocator</code> is an interface that describes a location (e.g.
- * where an error occurred).
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMLocator {
- /**
- * The line number this locator is pointing to, or <code>-1</code> if
- * there is no column number available.
- */
- public int getLineNumber();
-
- /**
- * The column number this locator is pointing to, or <code>-1</code> if
- * there is no column number available.
- */
- public int getColumnNumber();
-
- /**
- * The byte offset into the input source this locator is pointing to or
- * <code>-1</code> if there is no byte offset available.
- */
- public int getByteOffset();
-
- /**
- * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], offset into the input source this locator is pointing to or
- * <code>-1</code> if there is no UTF-16 offset available.
- */
- public int getUtf16Offset();
-
- /**
- * The node this locator is pointing to, or <code>null</code> if no node
- * is available.
- */
- public Node getRelatedNode();
-
- /**
- * The URI this locator is pointing to, or <code>null</code> if no URI is
- * available.
- */
- public String getUri();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DOMStringList.java b/libjava/external/w3c_dom/org/w3c/dom/DOMStringList.java
deleted file mode 100644
index e6c348ae8c4..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DOMStringList.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>DOMStringList</code> interface provides the abstraction of an
- * ordered collection of <code>DOMString</code> values, without defining or
- * constraining how this collection is implemented. The items in the
- * <code>DOMStringList</code> are accessible via an integral index, starting
- * from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMStringList {
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of
- * <code>DOMString</code>s in the list, this returns <code>null</code>.
- * @param index Index into the collection.
- * @return The <code>DOMString</code> at the <code>index</code>th
- * position in the <code>DOMStringList</code>, or <code>null</code> if
- * that is not a valid index.
- */
- public String item(int index);
-
- /**
- * The number of <code>DOMString</code>s in the list. The range of valid
- * child node indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Test if a string is part of this <code>DOMStringList</code>.
- * @param str The string to look for.
- * @return <code>true</code> if the string has been found,
- * <code>false</code> otherwise.
- */
- public boolean contains(String str);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/Document.java b/libjava/external/w3c_dom/org/w3c/dom/Document.java
deleted file mode 100644
index 43ebd4ec420..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/Document.java
+++ /dev/null
@@ -1,814 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>Document</code> interface represents the entire HTML or XML
- * document. Conceptually, it is the root of the document tree, and provides
- * the primary access to the document's data.
- * <p>Since elements, text nodes, comments, processing instructions, etc.
- * cannot exist outside the context of a <code>Document</code>, the
- * <code>Document</code> interface also contains the factory methods needed
- * to create these objects. The <code>Node</code> objects created have a
- * <code>ownerDocument</code> attribute which associates them with the
- * <code>Document</code> within whose context they were created.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Document extends Node {
- /**
- * The Document Type Declaration (see <code>DocumentType</code>)
- * associated with this document. For XML documents without a document
- * type declaration this returns <code>null</code>. For HTML documents,
- * a <code>DocumentType</code> object may be returned, independently of
- * the presence or absence of document type declaration in the HTML
- * document.
- * <br>This provides direct access to the <code>DocumentType</code> node,
- * child node of this <code>Document</code>. This node can be set at
- * document creation time and later changed through the use of child
- * nodes manipulation methods, such as <code>Node.insertBefore</code>,
- * or <code>Node.replaceChild</code>. Note, however, that while some
- * implementations may instantiate different types of
- * <code>Document</code> objects supporting additional features than the
- * "Core", such as "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * , based on the <code>DocumentType</code> specified at creation time,
- * changing it afterwards is very unlikely to result in a change of the
- * features supported.
- * @version DOM Level 3
- */
- public DocumentType getDoctype();
-
- /**
- * The <code>DOMImplementation</code> object that handles this document. A
- * DOM application may use objects from multiple implementations.
- */
- public DOMImplementation getImplementation();
-
- /**
- * This is a convenience attribute that allows direct access to the child
- * node that is the document element of the document.
- */
- public Element getDocumentElement();
-
- /**
- * Creates an element of the type specified. Note that the instance
- * returned implements the <code>Element</code> interface, so attributes
- * can be specified directly on the returned object.
- * <br>In addition, if there are known attributes with default values,
- * <code>Attr</code> nodes representing them are automatically created
- * and attached to the element.
- * <br>To create an element with a qualified name and namespace URI, use
- * the <code>createElementNS</code> method.
- * @param tagName The name of the element type to instantiate. For XML,
- * this is case-sensitive, otherwise it depends on the
- * case-sensitivity of the markup language in use. In that case, the
- * name is mapped to the canonical form of that markup by the DOM
- * implementation.
- * @return A new <code>Element</code> object with the
- * <code>nodeName</code> attribute set to <code>tagName</code>, and
- * <code>localName</code>, <code>prefix</code>, and
- * <code>namespaceURI</code> set to <code>null</code>.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified name is not an XML
- * name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- */
- public Element createElement(String tagName)
- throws DOMException;
-
- /**
- * Creates an empty <code>DocumentFragment</code> object.
- * @return A new <code>DocumentFragment</code>.
- */
- public DocumentFragment createDocumentFragment();
-
- /**
- * Creates a <code>Text</code> node given the specified string.
- * @param data The data for the node.
- * @return The new <code>Text</code> object.
- */
- public Text createTextNode(String data);
-
- /**
- * Creates a <code>Comment</code> node given the specified string.
- * @param data The data for the node.
- * @return The new <code>Comment</code> object.
- */
- public Comment createComment(String data);
-
- /**
- * Creates a <code>CDATASection</code> node whose value is the specified
- * string.
- * @param data The data for the <code>CDATASection</code> contents.
- * @return The new <code>CDATASection</code> object.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
- */
- public CDATASection createCDATASection(String data)
- throws DOMException;
-
- /**
- * Creates a <code>ProcessingInstruction</code> node given the specified
- * name and data strings.
- * @param target The target part of the processing instruction.Unlike
- * <code>Document.createElementNS</code> or
- * <code>Document.createAttributeNS</code>, no namespace well-formed
- * checking is done on the target name. Applications should invoke
- * <code>Document.normalizeDocument()</code> with the parameter "
- * namespaces" set to <code>true</code> in order to ensure that the
- * target name is namespace well-formed.
- * @param data The data for the node.
- * @return The new <code>ProcessingInstruction</code> object.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified target is not an XML
- * name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- * <br>NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
- */
- public ProcessingInstruction createProcessingInstruction(String target,
- String data)
- throws DOMException;
-
- /**
- * Creates an <code>Attr</code> of the given name. Note that the
- * <code>Attr</code> instance can then be set on an <code>Element</code>
- * using the <code>setAttributeNode</code> method.
- * <br>To create an attribute with a qualified name and namespace URI, use
- * the <code>createAttributeNS</code> method.
- * @param name The name of the attribute.
- * @return A new <code>Attr</code> object with the <code>nodeName</code>
- * attribute set to <code>name</code>, and <code>localName</code>,
- * <code>prefix</code>, and <code>namespaceURI</code> set to
- * <code>null</code>. The value of the attribute is the empty string.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified name is not an XML
- * name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- */
- public Attr createAttribute(String name)
- throws DOMException;
-
- /**
- * Creates an <code>EntityReference</code> object. In addition, if the
- * referenced entity is known, the child list of the
- * <code>EntityReference</code> node is made the same as that of the
- * corresponding <code>Entity</code> node.
- * <p ><b>Note:</b> If any descendant of the <code>Entity</code> node has
- * an unbound namespace prefix, the corresponding descendant of the
- * created <code>EntityReference</code> node is also unbound; (its
- * <code>namespaceURI</code> is <code>null</code>). The DOM Level 2 and
- * 3 do not support any mechanism to resolve namespace prefixes in this
- * case.
- * @param name The name of the entity to reference.Unlike
- * <code>Document.createElementNS</code> or
- * <code>Document.createAttributeNS</code>, no namespace well-formed
- * checking is done on the entity name. Applications should invoke
- * <code>Document.normalizeDocument()</code> with the parameter "
- * namespaces" set to <code>true</code> in order to ensure that the
- * entity name is namespace well-formed.
- * @return The new <code>EntityReference</code> object.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified name is not an XML
- * name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- * <br>NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
- */
- public EntityReference createEntityReference(String name)
- throws DOMException;
-
- /**
- * Returns a <code>NodeList</code> of all the <code>Elements</code> in
- * document order with a given tag name and are contained in the
- * document.
- * @param tagname The name of the tag to match on. The special value "*"
- * matches all tags. For XML, the <code>tagname</code> parameter is
- * case-sensitive, otherwise it depends on the case-sensitivity of the
- * markup language in use.
- * @return A new <code>NodeList</code> object containing all the matched
- * <code>Elements</code>.
- */
- public NodeList getElementsByTagName(String tagname);
-
- /**
- * Imports a node from another document to this document, without altering
- * or removing the source node from the original document; this method
- * creates a new copy of the source node. The returned node has no
- * parent; (<code>parentNode</code> is <code>null</code>).
- * <br>For all nodes, importing a node creates a node object owned by the
- * importing document, with attribute values identical to the source
- * node's <code>nodeName</code> and <code>nodeType</code>, plus the
- * attributes related to namespaces (<code>prefix</code>,
- * <code>localName</code>, and <code>namespaceURI</code>). As in the
- * <code>cloneNode</code> operation, the source node is not altered.
- * User data associated to the imported node is not carried over.
- * However, if any <code>UserDataHandlers</code> has been specified
- * along with the associated data these handlers will be called with the
- * appropriate parameters before this method returns.
- * <br>Additional information is copied as appropriate to the
- * <code>nodeType</code>, attempting to mirror the behavior expected if
- * a fragment of XML or HTML source was copied from one document to
- * another, recognizing that the two documents may have different DTDs
- * in the XML case. The following list describes the specifics for each
- * type of node.
- * <dl>
- * <dt>ATTRIBUTE_NODE</dt>
- * <dd>The <code>ownerElement</code> attribute
- * is set to <code>null</code> and the <code>specified</code> flag is
- * set to <code>true</code> on the generated <code>Attr</code>. The
- * descendants of the source <code>Attr</code> are recursively imported
- * and the resulting nodes reassembled to form the corresponding subtree.
- * Note that the <code>deep</code> parameter has no effect on
- * <code>Attr</code> nodes; they always carry their children with them
- * when imported.</dd>
- * <dt>DOCUMENT_FRAGMENT_NODE</dt>
- * <dd>If the <code>deep</code> option
- * was set to <code>true</code>, the descendants of the source
- * <code>DocumentFragment</code> are recursively imported and the
- * resulting nodes reassembled under the imported
- * <code>DocumentFragment</code> to form the corresponding subtree.
- * Otherwise, this simply generates an empty
- * <code>DocumentFragment</code>.</dd>
- * <dt>DOCUMENT_NODE</dt>
- * <dd><code>Document</code>
- * nodes cannot be imported.</dd>
- * <dt>DOCUMENT_TYPE_NODE</dt>
- * <dd><code>DocumentType</code>
- * nodes cannot be imported.</dd>
- * <dt>ELEMENT_NODE</dt>
- * <dd><em>Specified</em> attribute nodes of the source element are imported, and the generated
- * <code>Attr</code> nodes are attached to the generated
- * <code>Element</code>. Default attributes are <em>not</em> copied, though if the document being imported into defines default
- * attributes for this element name, those are assigned. If the
- * <code>importNode</code> <code>deep</code> parameter was set to
- * <code>true</code>, the descendants of the source element are
- * recursively imported and the resulting nodes reassembled to form the
- * corresponding subtree.</dd>
- * <dt>ENTITY_NODE</dt>
- * <dd><code>Entity</code> nodes can be
- * imported, however in the current release of the DOM the
- * <code>DocumentType</code> is readonly. Ability to add these imported
- * nodes to a <code>DocumentType</code> will be considered for addition
- * to a future release of the DOM.On import, the <code>publicId</code>,
- * <code>systemId</code>, and <code>notationName</code> attributes are
- * copied. If a <code>deep</code> import is requested, the descendants
- * of the the source <code>Entity</code> are recursively imported and
- * the resulting nodes reassembled to form the corresponding subtree.</dd>
- * <dt>
- * ENTITY_REFERENCE_NODE</dt>
- * <dd>Only the <code>EntityReference</code> itself is
- * copied, even if a <code>deep</code> import is requested, since the
- * source and destination documents might have defined the entity
- * differently. If the document being imported into provides a
- * definition for this entity name, its value is assigned.</dd>
- * <dt>NOTATION_NODE</dt>
- * <dd>
- * <code>Notation</code> nodes can be imported, however in the current
- * release of the DOM the <code>DocumentType</code> is readonly. Ability
- * to add these imported nodes to a <code>DocumentType</code> will be
- * considered for addition to a future release of the DOM.On import, the
- * <code>publicId</code> and <code>systemId</code> attributes are copied.
- * Note that the <code>deep</code> parameter has no effect on this type
- * of nodes since they cannot have any children.</dd>
- * <dt>
- * PROCESSING_INSTRUCTION_NODE</dt>
- * <dd>The imported node copies its
- * <code>target</code> and <code>data</code> values from those of the
- * source node.Note that the <code>deep</code> parameter has no effect
- * on this type of nodes since they cannot have any children.</dd>
- * <dt>TEXT_NODE,
- * CDATA_SECTION_NODE, COMMENT_NODE</dt>
- * <dd>These three types of nodes inheriting
- * from <code>CharacterData</code> copy their <code>data</code> and
- * <code>length</code> attributes from those of the source node.Note
- * that the <code>deep</code> parameter has no effect on these types of
- * nodes since they cannot have any children.</dd>
- * </dl>
- * @param importedNode The node to import.
- * @param deep If <code>true</code>, recursively import the subtree under
- * the specified node; if <code>false</code>, import only the node
- * itself, as explained above. This has no effect on nodes that cannot
- * have any children, and on <code>Attr</code>, and
- * <code>EntityReference</code> nodes.
- * @return The imported node that belongs to this <code>Document</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the type of node being imported is not
- * supported.
- * <br>INVALID_CHARACTER_ERR: Raised if one of the imported names is not
- * an XML name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute. This may happen when
- * importing an XML 1.1 [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] element
- * into an XML 1.0 document, for instance.
- * @since DOM Level 2
- */
- public Node importNode(Node importedNode,
- boolean deep)
- throws DOMException;
-
- /**
- * Creates an element of the given qualified name and namespace URI.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * namespaceURI parameter for methods if they wish to have no namespace.
- * @param namespaceURI The namespace URI of the element to create.
- * @param qualifiedName The qualified name of the element type to
- * instantiate.
- * @return A new <code>Element</code> object with the following
- * attributes:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>Attribute</th>
- * <th>Value</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.nodeName</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>qualifiedName</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.namespaceURI</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>namespaceURI</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.prefix</code></td>
- * <td valign='top' rowspan='1' colspan='1'>prefix, extracted
- * from <code>qualifiedName</code>, or <code>null</code> if there is
- * no prefix</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.localName</code></td>
- * <td valign='top' rowspan='1' colspan='1'>local name, extracted from
- * <code>qualifiedName</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Element.tagName</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>qualifiedName</code></td>
- * </tr>
- * </table>
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified
- * <code>qualifiedName</code> is not an XML name according to the XML
- * version in use specified in the <code>Document.xmlVersion</code>
- * attribute.
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is a
- * malformed qualified name, if the <code>qualifiedName</code> has a
- * prefix and the <code>namespaceURI</code> is <code>null</code>, or
- * if the <code>qualifiedName</code> has a prefix that is "xml" and
- * the <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , or if the <code>qualifiedName</code> or its prefix is "xmlns" and
- * the <code>namespaceURI</code> is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if the <code>namespaceURI</code> is "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>" and neither the <code>qualifiedName</code> nor its prefix is "xmlns".
- * <br>NOT_SUPPORTED_ERR: Always thrown if the current document does not
- * support the <code>"XML"</code> feature, since namespaces were
- * defined by XML.
- * @since DOM Level 2
- */
- public Element createElementNS(String namespaceURI,
- String qualifiedName)
- throws DOMException;
-
- /**
- * Creates an attribute of the given qualified name and namespace URI.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to create.
- * @param qualifiedName The qualified name of the attribute to
- * instantiate.
- * @return A new <code>Attr</code> object with the following attributes:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>
- * Attribute</th>
- * <th>Value</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.nodeName</code></td>
- * <td valign='top' rowspan='1' colspan='1'>qualifiedName</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>Node.namespaceURI</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>namespaceURI</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>Node.prefix</code></td>
- * <td valign='top' rowspan='1' colspan='1'>prefix, extracted from
- * <code>qualifiedName</code>, or <code>null</code> if there is no
- * prefix</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.localName</code></td>
- * <td valign='top' rowspan='1' colspan='1'>local name, extracted from
- * <code>qualifiedName</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Attr.name</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>qualifiedName</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.nodeValue</code></td>
- * <td valign='top' rowspan='1' colspan='1'>the empty
- * string</td>
- * </tr>
- * </table>
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified
- * <code>qualifiedName</code> is not an XML name according to the XML
- * version in use specified in the <code>Document.xmlVersion</code>
- * attribute.
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is a
- * malformed qualified name, if the <code>qualifiedName</code> has a
- * prefix and the <code>namespaceURI</code> is <code>null</code>, if
- * the <code>qualifiedName</code> has a prefix that is "xml" and the
- * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>", if the <code>qualifiedName</code> or its prefix is "xmlns" and the
- * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if the <code>namespaceURI</code> is "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>" and neither the <code>qualifiedName</code> nor its prefix is "xmlns".
- * <br>NOT_SUPPORTED_ERR: Always thrown if the current document does not
- * support the <code>"XML"</code> feature, since namespaces were
- * defined by XML.
- * @since DOM Level 2
- */
- public Attr createAttributeNS(String namespaceURI,
- String qualifiedName)
- throws DOMException;
-
- /**
- * Returns a <code>NodeList</code> of all the <code>Elements</code> with a
- * given local name and namespace URI in document order.
- * @param namespaceURI The namespace URI of the elements to match on. The
- * special value <code>"*"</code> matches all namespaces.
- * @param localName The local name of the elements to match on. The
- * special value "*" matches all local names.
- * @return A new <code>NodeList</code> object containing all the matched
- * <code>Elements</code>.
- * @since DOM Level 2
- */
- public NodeList getElementsByTagNameNS(String namespaceURI,
- String localName);
-
- /**
- * Returns the <code>Element</code> that has an ID attribute with the
- * given value. If no such element exists, this returns <code>null</code>
- * . If more than one element has an ID attribute with that value, what
- * is returned is undefined.
- * <br> The DOM implementation is expected to use the attribute
- * <code>Attr.isId</code> to determine if an attribute is of type ID.
- * <p ><b>Note:</b> Attributes with the name "ID" or "id" are not of type
- * ID unless so defined.
- * @param elementId The unique <code>id</code> value for an element.
- * @return The matching element or <code>null</code> if there is none.
- * @since DOM Level 2
- */
- public Element getElementById(String elementId);
-
- /**
- * An attribute specifying the encoding used for this document at the time
- * of the parsing. This is <code>null</code> when it is not known, such
- * as when the <code>Document</code> was created in memory.
- * @since DOM Level 3
- */
- public String getInputEncoding();
-
- /**
- * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, the encoding of this document. This is <code>null</code> when
- * unspecified or when it is not known, such as when the
- * <code>Document</code> was created in memory.
- * @since DOM Level 3
- */
- public String getXmlEncoding();
-
- /**
- * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, whether this document is standalone. This is <code>false</code> when
- * unspecified.
- * <p ><b>Note:</b> No verification is done on the value when setting
- * this attribute. Applications should use
- * <code>Document.normalizeDocument()</code> with the "validate"
- * parameter to verify if the value matches the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#sec-rmd'>validity
- * constraint for standalone document declaration</a> as defined in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>].
- * @since DOM Level 3
- */
- public boolean getXmlStandalone();
- /**
- * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, whether this document is standalone. This is <code>false</code> when
- * unspecified.
- * <p ><b>Note:</b> No verification is done on the value when setting
- * this attribute. Applications should use
- * <code>Document.normalizeDocument()</code> with the "validate"
- * parameter to verify if the value matches the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#sec-rmd'>validity
- * constraint for standalone document declaration</a> as defined in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>].
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if this document does not support the
- * "XML" feature.
- * @since DOM Level 3
- */
- public void setXmlStandalone(boolean xmlStandalone)
- throws DOMException;
-
- /**
- * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, the version number of this document. If there is no declaration and if
- * this document supports the "XML" feature, the value is
- * <code>"1.0"</code>. If this document does not support the "XML"
- * feature, the value is always <code>null</code>. Changing this
- * attribute will affect methods that check for invalid characters in
- * XML names. Application should invoke
- * <code>Document.normalizeDocument()</code> in order to check for
- * invalid characters in the <code>Node</code>s that are already part of
- * this <code>Document</code>.
- * <br> DOM applications may use the
- * <code>DOMImplementation.hasFeature(feature, version)</code> method
- * with parameter values "XMLVersion" and "1.0" (respectively) to
- * determine if an implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. DOM
- * applications may use the same method with parameter values
- * "XMLVersion" and "1.1" (respectively) to determine if an
- * implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. In both
- * cases, in order to support XML, an implementation must also support
- * the "XML" feature defined in this specification. <code>Document</code>
- * objects supporting a version of the "XMLVersion" feature must not
- * raise a <code>NOT_SUPPORTED_ERR</code> exception for the same version
- * number when using <code>Document.xmlVersion</code>.
- * @since DOM Level 3
- */
- public String getXmlVersion();
- /**
- * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, the version number of this document. If there is no declaration and if
- * this document supports the "XML" feature, the value is
- * <code>"1.0"</code>. If this document does not support the "XML"
- * feature, the value is always <code>null</code>. Changing this
- * attribute will affect methods that check for invalid characters in
- * XML names. Application should invoke
- * <code>Document.normalizeDocument()</code> in order to check for
- * invalid characters in the <code>Node</code>s that are already part of
- * this <code>Document</code>.
- * <br> DOM applications may use the
- * <code>DOMImplementation.hasFeature(feature, version)</code> method
- * with parameter values "XMLVersion" and "1.0" (respectively) to
- * determine if an implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. DOM
- * applications may use the same method with parameter values
- * "XMLVersion" and "1.1" (respectively) to determine if an
- * implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. In both
- * cases, in order to support XML, an implementation must also support
- * the "XML" feature defined in this specification. <code>Document</code>
- * objects supporting a version of the "XMLVersion" feature must not
- * raise a <code>NOT_SUPPORTED_ERR</code> exception for the same version
- * number when using <code>Document.xmlVersion</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the version is set to a value that is
- * not supported by this <code>Document</code> or if this document
- * does not support the "XML" feature.
- * @since DOM Level 3
- */
- public void setXmlVersion(String xmlVersion)
- throws DOMException;
-
- /**
- * An attribute specifying whether error checking is enforced or not. When
- * set to <code>false</code>, the implementation is free to not test
- * every possible error case normally defined on DOM operations, and not
- * raise any <code>DOMException</code> on DOM operations or report
- * errors while using <code>Document.normalizeDocument()</code>. In case
- * of error, the behavior is undefined. This attribute is
- * <code>true</code> by default.
- * @since DOM Level 3
- */
- public boolean getStrictErrorChecking();
- /**
- * An attribute specifying whether error checking is enforced or not. When
- * set to <code>false</code>, the implementation is free to not test
- * every possible error case normally defined on DOM operations, and not
- * raise any <code>DOMException</code> on DOM operations or report
- * errors while using <code>Document.normalizeDocument()</code>. In case
- * of error, the behavior is undefined. This attribute is
- * <code>true</code> by default.
- * @since DOM Level 3
- */
- public void setStrictErrorChecking(boolean strictErrorChecking);
-
- /**
- * The location of the document or <code>null</code> if undefined or if
- * the <code>Document</code> was created using
- * <code>DOMImplementation.createDocument</code>. No lexical checking is
- * performed when setting this attribute; this could result in a
- * <code>null</code> value returned when using <code>Node.baseURI</code>
- * .
- * <br> Beware that when the <code>Document</code> supports the feature
- * "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * , the href attribute of the HTML BASE element takes precedence over
- * this attribute when computing <code>Node.baseURI</code>.
- * @since DOM Level 3
- */
- public String getDocumentURI();
- /**
- * The location of the document or <code>null</code> if undefined or if
- * the <code>Document</code> was created using
- * <code>DOMImplementation.createDocument</code>. No lexical checking is
- * performed when setting this attribute; this could result in a
- * <code>null</code> value returned when using <code>Node.baseURI</code>
- * .
- * <br> Beware that when the <code>Document</code> supports the feature
- * "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * , the href attribute of the HTML BASE element takes precedence over
- * this attribute when computing <code>Node.baseURI</code>.
- * @since DOM Level 3
- */
- public void setDocumentURI(String documentURI);
-
- /**
- * Attempts to adopt a node from another document to this document. If
- * supported, it changes the <code>ownerDocument</code> of the source
- * node, its children, as well as the attached attribute nodes if there
- * are any. If the source node has a parent it is first removed from the
- * child list of its parent. This effectively allows moving a subtree
- * from one document to another (unlike <code>importNode()</code> which
- * create a copy of the source node instead of moving it). When it
- * fails, applications should use <code>Document.importNode()</code>
- * instead. Note that if the adopted node is already part of this
- * document (i.e. the source and target document are the same), this
- * method still has the effect of removing the source node from the
- * child list of its parent, if any. The following list describes the
- * specifics for each type of node.
- * <dl>
- * <dt>ATTRIBUTE_NODE</dt>
- * <dd>The
- * <code>ownerElement</code> attribute is set to <code>null</code> and
- * the <code>specified</code> flag is set to <code>true</code> on the
- * adopted <code>Attr</code>. The descendants of the source
- * <code>Attr</code> are recursively adopted.</dd>
- * <dt>DOCUMENT_FRAGMENT_NODE</dt>
- * <dd>The
- * descendants of the source node are recursively adopted.</dd>
- * <dt>DOCUMENT_NODE</dt>
- * <dd>
- * <code>Document</code> nodes cannot be adopted.</dd>
- * <dt>DOCUMENT_TYPE_NODE</dt>
- * <dd>
- * <code>DocumentType</code> nodes cannot be adopted.</dd>
- * <dt>ELEMENT_NODE</dt>
- * <dd><em>Specified</em> attribute nodes of the source element are adopted. Default attributes
- * are discarded, though if the document being adopted into defines
- * default attributes for this element name, those are assigned. The
- * descendants of the source element are recursively adopted.</dd>
- * <dt>ENTITY_NODE</dt>
- * <dd>
- * <code>Entity</code> nodes cannot be adopted.</dd>
- * <dt>ENTITY_REFERENCE_NODE</dt>
- * <dd>Only
- * the <code>EntityReference</code> node itself is adopted, the
- * descendants are discarded, since the source and destination documents
- * might have defined the entity differently. If the document being
- * imported into provides a definition for this entity name, its value
- * is assigned.</dd>
- * <dt>NOTATION_NODE</dt>
- * <dd><code>Notation</code> nodes cannot be
- * adopted.</dd>
- * <dt>PROCESSING_INSTRUCTION_NODE, TEXT_NODE, CDATA_SECTION_NODE,
- * COMMENT_NODE</dt>
- * <dd>These nodes can all be adopted. No specifics.</dd>
- * </dl>
- * <p ><b>Note:</b> Since it does not create new nodes unlike the
- * <code>Document.importNode()</code> method, this method does not raise
- * an <code>INVALID_CHARACTER_ERR</code> exception, and applications
- * should use the <code>Document.normalizeDocument()</code> method to
- * check if an imported name is not an XML name according to the XML
- * version in use.
- * @param source The node to move into this document.
- * @return The adopted node, or <code>null</code> if this operation
- * fails, such as when the source node comes from a different
- * implementation.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the source node is of type
- * <code>DOCUMENT</code>, <code>DOCUMENT_TYPE</code>.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised when the source node is
- * readonly.
- * @since DOM Level 3
- */
- public Node adoptNode(Node source)
- throws DOMException;
-
- /**
- * The configuration used when <code>Document.normalizeDocument()</code>
- * is invoked.
- * @since DOM Level 3
- */
- public DOMConfiguration getDomConfig();
-
- /**
- * This method acts as if the document was going through a save and load
- * cycle, putting the document in a "normal" form. As a consequence,
- * this method updates the replacement tree of
- * <code>EntityReference</code> nodes and normalizes <code>Text</code>
- * nodes, as defined in the method <code>Node.normalize()</code>.
- * <br> Otherwise, the actual result depends on the features being set on
- * the <code>Document.domConfig</code> object and governing what
- * operations actually take place. Noticeably this method could also
- * make the document namespace well-formed according to the algorithm
- * described in , check the character normalization, remove the
- * <code>CDATASection</code> nodes, etc. See
- * <code>DOMConfiguration</code> for details.
- * <pre>// Keep in the document
- * the information defined // in the XML Information Set (Java example)
- * DOMConfiguration docConfig = myDocument.getDomConfig();
- * docConfig.setParameter("infoset", Boolean.TRUE);
- * myDocument.normalizeDocument();</pre>
- *
- * <br>Mutation events, when supported, are generated to reflect the
- * changes occurring on the document.
- * <br> If errors occur during the invocation of this method, such as an
- * attempt to update a read-only node or a <code>Node.nodeName</code>
- * contains an invalid character according to the XML version in use,
- * errors or warnings (<code>DOMError.SEVERITY_ERROR</code> or
- * <code>DOMError.SEVERITY_WARNING</code>) will be reported using the
- * <code>DOMErrorHandler</code> object associated with the "error-handler
- * " parameter. Note this method might also report fatal errors (
- * <code>DOMError.SEVERITY_FATAL_ERROR</code>) if an implementation
- * cannot recover from an error.
- * @since DOM Level 3
- */
- public void normalizeDocument();
-
- /**
- * Rename an existing node of type <code>ELEMENT_NODE</code> or
- * <code>ATTRIBUTE_NODE</code>.
- * <br>When possible this simply changes the name of the given node,
- * otherwise this creates a new node with the specified name and
- * replaces the existing node with the new node as described below.
- * <br>If simply changing the name of the given node is not possible, the
- * following operations are performed: a new node is created, any
- * registered event listener is registered on the new node, any user
- * data attached to the old node is removed from that node, the old node
- * is removed from its parent if it has one, the children are moved to
- * the new node, if the renamed node is an <code>Element</code> its
- * attributes are moved to the new node, the new node is inserted at the
- * position the old node used to have in its parent's child nodes list
- * if it has one, the user data that was attached to the old node is
- * attached to the new node.
- * <br>When the node being renamed is an <code>Element</code> only the
- * specified attributes are moved, default attributes originated from
- * the DTD are updated according to the new element name. In addition,
- * the implementation may update default attributes from other schemas.
- * Applications should use <code>Document.normalizeDocument()</code> to
- * guarantee these attributes are up-to-date.
- * <br>When the node being renamed is an <code>Attr</code> that is
- * attached to an <code>Element</code>, the node is first removed from
- * the <code>Element</code> attributes map. Then, once renamed, either
- * by modifying the existing node or creating a new one as described
- * above, it is put back.
- * <br>In addition,
- * <ul>
- * <li> a user data event <code>NODE_RENAMED</code> is fired,
- * </li>
- * <li>
- * when the implementation supports the feature "MutationNameEvents",
- * each mutation operation involved in this method fires the appropriate
- * event, and in the end the event {
- * <code>http://www.w3.org/2001/xml-events</code>,
- * <code>DOMElementNameChanged</code>} or {
- * <code>http://www.w3.org/2001/xml-events</code>,
- * <code>DOMAttributeNameChanged</code>} is fired.
- * </li>
- * </ul>
- * @param n The node to rename.
- * @param namespaceURI The new namespace URI.
- * @param qualifiedName The new qualified name.
- * @return The renamed node. This is either the specified node or the new
- * node that was created to replace the specified node.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised when the type of the specified node is
- * neither <code>ELEMENT_NODE</code> nor <code>ATTRIBUTE_NODE</code>,
- * or if the implementation does not support the renaming of the
- * document element.
- * <br>INVALID_CHARACTER_ERR: Raised if the new qualified name is not an
- * XML name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- * <br>WRONG_DOCUMENT_ERR: Raised when the specified node was created
- * from a different document than this document.
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is a
- * malformed qualified name, if the <code>qualifiedName</code> has a
- * prefix and the <code>namespaceURI</code> is <code>null</code>, or
- * if the <code>qualifiedName</code> has a prefix that is "xml" and
- * the <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * . Also raised, when the node being renamed is an attribute, if the
- * <code>qualifiedName</code>, or its prefix, is "xmlns" and the
- * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>".
- * @since DOM Level 3
- */
- public Node renameNode(Node n,
- String namespaceURI,
- String qualifiedName)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DocumentFragment.java b/libjava/external/w3c_dom/org/w3c/dom/DocumentFragment.java
deleted file mode 100644
index 8c4531eff87..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DocumentFragment.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * <code>DocumentFragment</code> is a "lightweight" or "minimal"
- * <code>Document</code> object. It is very common to want to be able to
- * extract a portion of a document's tree or to create a new fragment of a
- * document. Imagine implementing a user command like cut or rearranging a
- * document by moving fragments around. It is desirable to have an object
- * which can hold such fragments and it is quite natural to use a Node for
- * this purpose. While it is true that a <code>Document</code> object could
- * fulfill this role, a <code>Document</code> object can potentially be a
- * heavyweight object, depending on the underlying implementation. What is
- * really needed for this is a very lightweight object.
- * <code>DocumentFragment</code> is such an object.
- * <p>Furthermore, various operations -- such as inserting nodes as children
- * of another <code>Node</code> -- may take <code>DocumentFragment</code>
- * objects as arguments; this results in all the child nodes of the
- * <code>DocumentFragment</code> being moved to the child list of this node.
- * <p>The children of a <code>DocumentFragment</code> node are zero or more
- * nodes representing the tops of any sub-trees defining the structure of
- * the document. <code>DocumentFragment</code> nodes do not need to be
- * well-formed XML documents (although they do need to follow the rules
- * imposed upon well-formed XML parsed entities, which can have multiple top
- * nodes). For example, a <code>DocumentFragment</code> might have only one
- * child and that child node could be a <code>Text</code> node. Such a
- * structure model represents neither an HTML document nor a well-formed XML
- * document.
- * <p>When a <code>DocumentFragment</code> is inserted into a
- * <code>Document</code> (or indeed any other <code>Node</code> that may
- * take children) the children of the <code>DocumentFragment</code> and not
- * the <code>DocumentFragment</code> itself are inserted into the
- * <code>Node</code>. This makes the <code>DocumentFragment</code> very
- * useful when the user wishes to create nodes that are siblings; the
- * <code>DocumentFragment</code> acts as the parent of these nodes so that
- * the user can use the standard methods from the <code>Node</code>
- * interface, such as <code>Node.insertBefore</code> and
- * <code>Node.appendChild</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface DocumentFragment extends Node {
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/DocumentType.java b/libjava/external/w3c_dom/org/w3c/dom/DocumentType.java
deleted file mode 100644
index 6221c7b5ef6..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/DocumentType.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * Each <code>Document</code> has a <code>doctype</code> attribute whose value
- * is either <code>null</code> or a <code>DocumentType</code> object. The
- * <code>DocumentType</code> interface in the DOM Core provides an interface
- * to the list of entities that are defined for the document, and little
- * else because the effect of namespaces and the various XML schema efforts
- * on DTD representation are not clearly understood as of this writing.
- * <p>DOM Level 3 doesn't support editing <code>DocumentType</code> nodes.
- * <code>DocumentType</code> nodes are read-only.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface DocumentType extends Node {
- /**
- * The name of DTD; i.e., the name immediately following the
- * <code>DOCTYPE</code> keyword.
- */
- public String getName();
-
- /**
- * A <code>NamedNodeMap</code> containing the general entities, both
- * external and internal, declared in the DTD. Parameter entities are
- * not contained. Duplicates are discarded. For example in:
- * <pre>&lt;!DOCTYPE
- * ex SYSTEM "ex.dtd" [ &lt;!ENTITY foo "foo"&gt; &lt;!ENTITY bar
- * "bar"&gt; &lt;!ENTITY bar "bar2"&gt; &lt;!ENTITY % baz "baz"&gt;
- * ]&gt; &lt;ex/&gt;</pre>
- * the interface provides access to <code>foo</code>
- * and the first declaration of <code>bar</code> but not the second
- * declaration of <code>bar</code> or <code>baz</code>. Every node in
- * this map also implements the <code>Entity</code> interface.
- * <br>The DOM Level 2 does not support editing entities, therefore
- * <code>entities</code> cannot be altered in any way.
- */
- public NamedNodeMap getEntities();
-
- /**
- * A <code>NamedNodeMap</code> containing the notations declared in the
- * DTD. Duplicates are discarded. Every node in this map also implements
- * the <code>Notation</code> interface.
- * <br>The DOM Level 2 does not support editing notations, therefore
- * <code>notations</code> cannot be altered in any way.
- */
- public NamedNodeMap getNotations();
-
- /**
- * The public identifier of the external subset.
- * @since DOM Level 2
- */
- public String getPublicId();
-
- /**
- * The system identifier of the external subset. This may be an absolute
- * URI or not.
- * @since DOM Level 2
- */
- public String getSystemId();
-
- /**
- * The internal subset as a string, or <code>null</code> if there is none.
- * This is does not contain the delimiting square brackets.
- * <p ><b>Note:</b> The actual content returned depends on how much
- * information is available to the implementation. This may vary
- * depending on various parameters, including the XML processor used to
- * build the document.
- * @since DOM Level 2
- */
- public String getInternalSubset();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/Element.java b/libjava/external/w3c_dom/org/w3c/dom/Element.java
deleted file mode 100644
index 6a7f7e3d0c7..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/Element.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>Element</code> interface represents an element in an HTML or XML
- * document. Elements may have attributes associated with them; since the
- * <code>Element</code> interface inherits from <code>Node</code>, the
- * generic <code>Node</code> interface attribute <code>attributes</code> may
- * be used to retrieve the set of all attributes for an element. There are
- * methods on the <code>Element</code> interface to retrieve either an
- * <code>Attr</code> object by name or an attribute value by name. In XML,
- * where an attribute value may contain entity references, an
- * <code>Attr</code> object should be retrieved to examine the possibly
- * fairly complex sub-tree representing the attribute value. On the other
- * hand, in HTML, where all attributes have simple string values, methods to
- * directly access an attribute value can safely be used as a convenience.
- * <p ><b>Note:</b> In DOM Level 2, the method <code>normalize</code> is
- * inherited from the <code>Node</code> interface where it was moved.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Element extends Node {
- /**
- * The name of the element. If <code>Node.localName</code> is different
- * from <code>null</code>, this attribute is a qualified name. For
- * example, in:
- * <pre> &lt;elementExample id="demo"&gt; ...
- * &lt;/elementExample&gt; , </pre>
- * <code>tagName</code> has the value
- * <code>"elementExample"</code>. Note that this is case-preserving in
- * XML, as are all of the operations of the DOM. The HTML DOM returns
- * the <code>tagName</code> of an HTML element in the canonical
- * uppercase form, regardless of the case in the source HTML document.
- */
- public String getTagName();
-
- /**
- * Retrieves an attribute value by name.
- * @param name The name of the attribute to retrieve.
- * @return The <code>Attr</code> value as a string, or the empty string
- * if that attribute does not have a specified or default value.
- */
- public String getAttribute(String name);
-
- /**
- * Adds a new attribute. If an attribute with that name is already present
- * in the element, its value is changed to be that of the value
- * parameter. This value is a simple string; it is not parsed as it is
- * being set. So any markup (such as syntax to be recognized as an
- * entity reference) is treated as literal text, and needs to be
- * appropriately escaped by the implementation when it is written out.
- * In order to assign an attribute value that contains entity
- * references, the user must create an <code>Attr</code> node plus any
- * <code>Text</code> and <code>EntityReference</code> nodes, build the
- * appropriate subtree, and use <code>setAttributeNode</code> to assign
- * it as the value of an attribute.
- * <br>To set an attribute with a qualified name and namespace URI, use
- * the <code>setAttributeNS</code> method.
- * @param name The name of the attribute to create or alter.
- * @param value Value to set in string form.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified name is not an XML
- * name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void setAttribute(String name,
- String value)
- throws DOMException;
-
- /**
- * Removes an attribute by name. If a default value for the removed
- * attribute is defined in the DTD, a new attribute immediately appears
- * with the default value as well as the corresponding namespace URI,
- * local name, and prefix when applicable. The implementation may handle
- * default values from other schemas similarly but applications should
- * use <code>Document.normalizeDocument()</code> to guarantee this
- * information is up-to-date.
- * <br>If no attribute with this name is found, this method has no effect.
- * <br>To remove an attribute by local name and namespace URI, use the
- * <code>removeAttributeNS</code> method.
- * @param name The name of the attribute to remove.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void removeAttribute(String name)
- throws DOMException;
-
- /**
- * Retrieves an attribute node by name.
- * <br>To retrieve an attribute node by qualified name and namespace URI,
- * use the <code>getAttributeNodeNS</code> method.
- * @param name The name (<code>nodeName</code>) of the attribute to
- * retrieve.
- * @return The <code>Attr</code> node with the specified name (
- * <code>nodeName</code>) or <code>null</code> if there is no such
- * attribute.
- */
- public Attr getAttributeNode(String name);
-
- /**
- * Adds a new attribute node. If an attribute with that name (
- * <code>nodeName</code>) is already present in the element, it is
- * replaced by the new one. Replacing an attribute node by itself has no
- * effect.
- * <br>To add a new attribute node with a qualified name and namespace
- * URI, use the <code>setAttributeNodeNS</code> method.
- * @param newAttr The <code>Attr</code> node to add to the attribute list.
- * @return If the <code>newAttr</code> attribute replaces an existing
- * attribute, the replaced <code>Attr</code> node is returned,
- * otherwise <code>null</code> is returned.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a
- * different document than the one that created the element.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an
- * attribute of another <code>Element</code> object. The DOM user must
- * explicitly clone <code>Attr</code> nodes to re-use them in other
- * elements.
- */
- public Attr setAttributeNode(Attr newAttr)
- throws DOMException;
-
- /**
- * Removes the specified attribute node. If a default value for the
- * removed <code>Attr</code> node is defined in the DTD, a new node
- * immediately appears with the default value as well as the
- * corresponding namespace URI, local name, and prefix when applicable.
- * The implementation may handle default values from other schemas
- * similarly but applications should use
- * <code>Document.normalizeDocument()</code> to guarantee this
- * information is up-to-date.
- * @param oldAttr The <code>Attr</code> node to remove from the attribute
- * list.
- * @return The <code>Attr</code> node that was removed.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>oldAttr</code> is not an attribute
- * of the element.
- */
- public Attr removeAttributeNode(Attr oldAttr)
- throws DOMException;
-
- /**
- * Returns a <code>NodeList</code> of all descendant <code>Elements</code>
- * with a given tag name, in document order.
- * @param name The name of the tag to match on. The special value "*"
- * matches all tags.
- * @return A list of matching <code>Element</code> nodes.
- */
- public NodeList getElementsByTagName(String name);
-
- /**
- * Retrieves an attribute value by local name and namespace URI.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to retrieve.
- * @param localName The local name of the attribute to retrieve.
- * @return The <code>Attr</code> value as a string, or the empty string
- * if that attribute does not have a specified or default value.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public String getAttributeNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * Adds a new attribute. If an attribute with the same local name and
- * namespace URI is already present on the element, its prefix is
- * changed to be the prefix part of the <code>qualifiedName</code>, and
- * its value is changed to be the <code>value</code> parameter. This
- * value is a simple string; it is not parsed as it is being set. So any
- * markup (such as syntax to be recognized as an entity reference) is
- * treated as literal text, and needs to be appropriately escaped by the
- * implementation when it is written out. In order to assign an
- * attribute value that contains entity references, the user must create
- * an <code>Attr</code> node plus any <code>Text</code> and
- * <code>EntityReference</code> nodes, build the appropriate subtree,
- * and use <code>setAttributeNodeNS</code> or
- * <code>setAttributeNode</code> to assign it as the value of an
- * attribute.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to create or
- * alter.
- * @param qualifiedName The qualified name of the attribute to create or
- * alter.
- * @param value The value to set in string form.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified qualified name is not
- * an XML name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
- * malformed per the Namespaces in XML specification, if the
- * <code>qualifiedName</code> has a prefix and the
- * <code>namespaceURI</code> is <code>null</code>, if the
- * <code>qualifiedName</code> has a prefix that is "xml" and the
- * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>", if the <code>qualifiedName</code> or its prefix is "xmlns" and the
- * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if the <code>namespaceURI</code> is "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>" and neither the <code>qualifiedName</code> nor its prefix is "xmlns".
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public void setAttributeNS(String namespaceURI,
- String qualifiedName,
- String value)
- throws DOMException;
-
- /**
- * Removes an attribute by local name and namespace URI. If a default
- * value for the removed attribute is defined in the DTD, a new
- * attribute immediately appears with the default value as well as the
- * corresponding namespace URI, local name, and prefix when applicable.
- * The implementation may handle default values from other schemas
- * similarly but applications should use
- * <code>Document.normalizeDocument()</code> to guarantee this
- * information is up-to-date.
- * <br>If no attribute with this local name and namespace URI is found,
- * this method has no effect.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to remove.
- * @param localName The local name of the attribute to remove.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public void removeAttributeNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * Retrieves an <code>Attr</code> node by local name and namespace URI.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to retrieve.
- * @param localName The local name of the attribute to retrieve.
- * @return The <code>Attr</code> node with the specified attribute local
- * name and namespace URI or <code>null</code> if there is no such
- * attribute.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Attr getAttributeNodeNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * Adds a new attribute. If an attribute with that local name and that
- * namespace URI is already present in the element, it is replaced by
- * the new one. Replacing an attribute node by itself has no effect.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param newAttr The <code>Attr</code> node to add to the attribute list.
- * @return If the <code>newAttr</code> attribute replaces an existing
- * attribute with the same local name and namespace URI, the replaced
- * <code>Attr</code> node is returned, otherwise <code>null</code> is
- * returned.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a
- * different document than the one that created the element.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an
- * attribute of another <code>Element</code> object. The DOM user must
- * explicitly clone <code>Attr</code> nodes to re-use them in other
- * elements.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Attr setAttributeNodeNS(Attr newAttr)
- throws DOMException;
-
- /**
- * Returns a <code>NodeList</code> of all the descendant
- * <code>Elements</code> with a given local name and namespace URI in
- * document order.
- * @param namespaceURI The namespace URI of the elements to match on. The
- * special value "*" matches all namespaces.
- * @param localName The local name of the elements to match on. The
- * special value "*" matches all local names.
- * @return A new <code>NodeList</code> object containing all the matched
- * <code>Elements</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public NodeList getElementsByTagNameNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * Returns <code>true</code> when an attribute with a given name is
- * specified on this element or has a default value, <code>false</code>
- * otherwise.
- * @param name The name of the attribute to look for.
- * @return <code>true</code> if an attribute with the given name is
- * specified on this element or has a default value, <code>false</code>
- * otherwise.
- * @since DOM Level 2
- */
- public boolean hasAttribute(String name);
-
- /**
- * Returns <code>true</code> when an attribute with a given local name and
- * namespace URI is specified on this element or has a default value,
- * <code>false</code> otherwise.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to look for.
- * @param localName The local name of the attribute to look for.
- * @return <code>true</code> if an attribute with the given local name
- * and namespace URI is specified or has a default value on this
- * element, <code>false</code> otherwise.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public boolean hasAttributeNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * The type information associated with this element.
- * @since DOM Level 3
- */
- public TypeInfo getSchemaTypeInfo();
-
- /**
- * If the parameter <code>isId</code> is <code>true</code>, this method
- * declares the specified attribute to be a user-determined ID attribute
- * . This affects the value of <code>Attr.isId</code> and the behavior
- * of <code>Document.getElementById</code>, but does not change any
- * schema that may be in use, in particular this does not affect the
- * <code>Attr.schemaTypeInfo</code> of the specified <code>Attr</code>
- * node. Use the value <code>false</code> for the parameter
- * <code>isId</code> to undeclare an attribute for being a
- * user-determined ID attribute.
- * <br> To specify an attribute by local name and namespace URI, use the
- * <code>setIdAttributeNS</code> method.
- * @param name The name of the attribute.
- * @param isId Whether the attribute is a of type ID.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if the specified node is not an attribute
- * of this element.
- * @since DOM Level 3
- */
- public void setIdAttribute(String name,
- boolean isId)
- throws DOMException;
-
- /**
- * If the parameter <code>isId</code> is <code>true</code>, this method
- * declares the specified attribute to be a user-determined ID attribute
- * . This affects the value of <code>Attr.isId</code> and the behavior
- * of <code>Document.getElementById</code>, but does not change any
- * schema that may be in use, in particular this does not affect the
- * <code>Attr.schemaTypeInfo</code> of the specified <code>Attr</code>
- * node. Use the value <code>false</code> for the parameter
- * <code>isId</code> to undeclare an attribute for being a
- * user-determined ID attribute.
- * @param namespaceURI The namespace URI of the attribute.
- * @param localName The local name of the attribute.
- * @param isId Whether the attribute is a of type ID.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if the specified node is not an attribute
- * of this element.
- * @since DOM Level 3
- */
- public void setIdAttributeNS(String namespaceURI,
- String localName,
- boolean isId)
- throws DOMException;
-
- /**
- * If the parameter <code>isId</code> is <code>true</code>, this method
- * declares the specified attribute to be a user-determined ID attribute
- * . This affects the value of <code>Attr.isId</code> and the behavior
- * of <code>Document.getElementById</code>, but does not change any
- * schema that may be in use, in particular this does not affect the
- * <code>Attr.schemaTypeInfo</code> of the specified <code>Attr</code>
- * node. Use the value <code>false</code> for the parameter
- * <code>isId</code> to undeclare an attribute for being a
- * user-determined ID attribute.
- * @param idAttr The attribute node.
- * @param isId Whether the attribute is a of type ID.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if the specified node is not an attribute
- * of this element.
- * @since DOM Level 3
- */
- public void setIdAttributeNode(Attr idAttr,
- boolean isId)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/Entity.java b/libjava/external/w3c_dom/org/w3c/dom/Entity.java
deleted file mode 100644
index f621c3386b1..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/Entity.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * This interface represents a known entity, either parsed or unparsed, in an
- * XML document. Note that this models the entity itself <em>not</em> the entity declaration.
- * <p>The <code>nodeName</code> attribute that is inherited from
- * <code>Node</code> contains the name of the entity.
- * <p>An XML processor may choose to completely expand entities before the
- * structure model is passed to the DOM; in this case there will be no
- * <code>EntityReference</code> nodes in the document tree.
- * <p>XML does not mandate that a non-validating XML processor read and
- * process entity declarations made in the external subset or declared in
- * parameter entities. This means that parsed entities declared in the
- * external subset need not be expanded by some classes of applications, and
- * that the replacement text of the entity may not be available. When the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#intern-replacement'>
- * replacement text</a> is available, the corresponding <code>Entity</code> node's child list
- * represents the structure of that replacement value. Otherwise, the child
- * list is empty.
- * <p>DOM Level 3 does not support editing <code>Entity</code> nodes; if a
- * user wants to make changes to the contents of an <code>Entity</code>,
- * every related <code>EntityReference</code> node has to be replaced in the
- * structure model by a clone of the <code>Entity</code>'s contents, and
- * then the desired changes must be made to each of those clones instead.
- * <code>Entity</code> nodes and all their descendants are readonly.
- * <p>An <code>Entity</code> node does not have any parent.
- * <p ><b>Note:</b> If the entity contains an unbound namespace prefix, the
- * <code>namespaceURI</code> of the corresponding node in the
- * <code>Entity</code> node subtree is <code>null</code>. The same is true
- * for <code>EntityReference</code> nodes that refer to this entity, when
- * they are created using the <code>createEntityReference</code> method of
- * the <code>Document</code> interface.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Entity extends Node {
- /**
- * The public identifier associated with the entity if specified, and
- * <code>null</code> otherwise.
- */
- public String getPublicId();
-
- /**
- * The system identifier associated with the entity if specified, and
- * <code>null</code> otherwise. This may be an absolute URI or not.
- */
- public String getSystemId();
-
- /**
- * For unparsed entities, the name of the notation for the entity. For
- * parsed entities, this is <code>null</code>.
- */
- public String getNotationName();
-
- /**
- * An attribute specifying the encoding used for this entity at the time
- * of parsing, when it is an external parsed entity. This is
- * <code>null</code> if it an entity from the internal subset or if it
- * is not known.
- * @since DOM Level 3
- */
- public String getInputEncoding();
-
- /**
- * An attribute specifying, as part of the text declaration, the encoding
- * of this entity, when it is an external parsed entity. This is
- * <code>null</code> otherwise.
- * @since DOM Level 3
- */
- public String getXmlEncoding();
-
- /**
- * An attribute specifying, as part of the text declaration, the version
- * number of this entity, when it is an external parsed entity. This is
- * <code>null</code> otherwise.
- * @since DOM Level 3
- */
- public String getXmlVersion();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/EntityReference.java b/libjava/external/w3c_dom/org/w3c/dom/EntityReference.java
deleted file mode 100644
index b42b0913bc8..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/EntityReference.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * <code>EntityReference</code> nodes may be used to represent an entity
- * reference in the tree. Note that character references and references to
- * predefined entities are considered to be expanded by the HTML or XML
- * processor so that characters are represented by their Unicode equivalent
- * rather than by an entity reference. Moreover, the XML processor may
- * completely expand references to entities while building the
- * <code>Document</code>, instead of providing <code>EntityReference</code>
- * nodes. If it does provide such nodes, then for an
- * <code>EntityReference</code> node that represents a reference to a known
- * entity an <code>Entity</code> exists, and the subtree of the
- * <code>EntityReference</code> node is a copy of the <code>Entity</code>
- * node subtree. However, the latter may not be true when an entity contains
- * an unbound namespace prefix. In such a case, because the namespace prefix
- * resolution depends on where the entity reference is, the descendants of
- * the <code>EntityReference</code> node may be bound to different namespace
- * URIs. When an <code>EntityReference</code> node represents a reference to
- * an unknown entity, the node has no children and its replacement value,
- * when used by <code>Attr.value</code> for example, is empty.
- * <p>As for <code>Entity</code> nodes, <code>EntityReference</code> nodes and
- * all their descendants are readonly.
- * <p ><b>Note:</b> <code>EntityReference</code> nodes may cause element
- * content and attribute value normalization problems when, such as in XML
- * 1.0 and XML Schema, the normalization is performed after entity reference
- * are expanded.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface EntityReference extends Node {
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/NameList.java b/libjava/external/w3c_dom/org/w3c/dom/NameList.java
deleted file mode 100644
index 10caa90f6a0..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/NameList.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>NameList</code> interface provides the abstraction of an ordered
- * collection of parallel pairs of name and namespace values (which could be
- * null values), without defining or constraining how this collection is
- * implemented. The items in the <code>NameList</code> are accessible via an
- * integral index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface NameList {
- /**
- * Returns the <code>index</code>th name item in the collection.
- * @param index Index into the collection.
- * @return The name at the <code>index</code>th position in the
- * <code>NameList</code>, or <code>null</code> if there is no name for
- * the specified index or if the index is out of range.
- */
- public String getName(int index);
-
- /**
- * Returns the <code>index</code>th namespaceURI item in the collection.
- * @param index Index into the collection.
- * @return The namespace URI at the <code>index</code>th position in the
- * <code>NameList</code>, or <code>null</code> if there is no name for
- * the specified index or if the index is out of range.
- */
- public String getNamespaceURI(int index);
-
- /**
- * The number of pairs (name and namespaceURI) in the list. The range of
- * valid child node indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Test if a name is part of this <code>NameList</code>.
- * @param str The name to look for.
- * @return <code>true</code> if the name has been found,
- * <code>false</code> otherwise.
- */
- public boolean contains(String str);
-
- /**
- * Test if the pair namespaceURI/name is part of this
- * <code>NameList</code>.
- * @param namespaceURI The namespace URI to look for.
- * @param name The name to look for.
- * @return <code>true</code> if the pair namespaceURI/name has been
- * found, <code>false</code> otherwise.
- */
- public boolean containsNS(String namespaceURI,
- String name);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/NamedNodeMap.java b/libjava/external/w3c_dom/org/w3c/dom/NamedNodeMap.java
deleted file mode 100644
index ad1e67bcdeb..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/NamedNodeMap.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * Objects implementing the <code>NamedNodeMap</code> interface are used to
- * represent collections of nodes that can be accessed by name. Note that
- * <code>NamedNodeMap</code> does not inherit from <code>NodeList</code>;
- * <code>NamedNodeMaps</code> are not maintained in any particular order.
- * Objects contained in an object implementing <code>NamedNodeMap</code> may
- * also be accessed by an ordinal index, but this is simply to allow
- * convenient enumeration of the contents of a <code>NamedNodeMap</code>,
- * and does not imply that the DOM specifies an order to these Nodes.
- * <p><code>NamedNodeMap</code> objects in the DOM are live.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface NamedNodeMap {
- /**
- * Retrieves a node specified by name.
- * @param name The <code>nodeName</code> of a node to retrieve.
- * @return A <code>Node</code> (of any type) with the specified
- * <code>nodeName</code>, or <code>null</code> if it does not identify
- * any node in this map.
- */
- public Node getNamedItem(String name);
-
- /**
- * Adds a node using its <code>nodeName</code> attribute. If a node with
- * that name is already present in this map, it is replaced by the new
- * one. Replacing a node by itself has no effect.
- * <br>As the <code>nodeName</code> attribute is used to derive the name
- * which the node must be stored under, multiple nodes of certain types
- * (those that have a "special" string value) cannot be stored as the
- * names would clash. This is seen as preferable to allowing nodes to be
- * aliased.
- * @param arg A node to store in this map. The node will later be
- * accessible using the value of its <code>nodeName</code> attribute.
- * @return If the new <code>Node</code> replaces an existing node the
- * replaced <code>Node</code> is returned, otherwise <code>null</code>
- * is returned.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
- * different document than the one that created this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an
- * <code>Attr</code> that is already an attribute of another
- * <code>Element</code> object. The DOM user must explicitly clone
- * <code>Attr</code> nodes to re-use them in other elements.
- * <br>HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node
- * doesn't belong in this NamedNodeMap. Examples would include trying
- * to insert something other than an Attr node into an Element's map
- * of attributes, or a non-Entity node into the DocumentType's map of
- * Entities.
- */
- public Node setNamedItem(Node arg)
- throws DOMException;
-
- /**
- * Removes a node specified by name. When this map contains the attributes
- * attached to an element, if the removed attribute is known to have a
- * default value, an attribute immediately appears containing the
- * default value as well as the corresponding namespace URI, local name,
- * and prefix when applicable.
- * @param name The <code>nodeName</code> of the node to remove.
- * @return The node removed from this map if a node with such a name
- * exists.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in
- * this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- */
- public Node removeNamedItem(String name)
- throws DOMException;
-
- /**
- * Returns the <code>index</code>th item in the map. If <code>index</code>
- * is greater than or equal to the number of nodes in this map, this
- * returns <code>null</code>.
- * @param index Index into this map.
- * @return The node at the <code>index</code>th position in the map, or
- * <code>null</code> if that is not a valid index.
- */
- public Node item(int index);
-
- /**
- * The number of nodes in this map. The range of valid child node indices
- * is <code>0</code> to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Retrieves a node specified by local name and namespace URI.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value null as the namespaceURI parameter
- * for methods if they wish to have no namespace.
- * @param namespaceURI The namespace URI of the node to retrieve.
- * @param localName The local name of the node to retrieve.
- * @return A <code>Node</code> (of any type) with the specified local
- * name and namespace URI, or <code>null</code> if they do not
- * identify any node in this map.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature "XML" and the language exposed through the
- * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Node getNamedItemNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * Adds a node using its <code>namespaceURI</code> and
- * <code>localName</code>. If a node with that namespace URI and that
- * local name is already present in this map, it is replaced by the new
- * one. Replacing a node by itself has no effect.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value null as the namespaceURI parameter
- * for methods if they wish to have no namespace.
- * @param arg A node to store in this map. The node will later be
- * accessible using the value of its <code>namespaceURI</code> and
- * <code>localName</code> attributes.
- * @return If the new <code>Node</code> replaces an existing node the
- * replaced <code>Node</code> is returned, otherwise <code>null</code>
- * is returned.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
- * different document than the one that created this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an
- * <code>Attr</code> that is already an attribute of another
- * <code>Element</code> object. The DOM user must explicitly clone
- * <code>Attr</code> nodes to re-use them in other elements.
- * <br>HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node
- * doesn't belong in this NamedNodeMap. Examples would include trying
- * to insert something other than an Attr node into an Element's map
- * of attributes, or a non-Entity node into the DocumentType's map of
- * Entities.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature "XML" and the language exposed through the
- * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Node setNamedItemNS(Node arg)
- throws DOMException;
-
- /**
- * Removes a node specified by local name and namespace URI. A removed
- * attribute may be known to have a default value when this map contains
- * the attributes attached to an element, as returned by the attributes
- * attribute of the <code>Node</code> interface. If so, an attribute
- * immediately appears containing the default value as well as the
- * corresponding namespace URI, local name, and prefix when applicable.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value null as the namespaceURI parameter
- * for methods if they wish to have no namespace.
- * @param namespaceURI The namespace URI of the node to remove.
- * @param localName The local name of the node to remove.
- * @return The node removed from this map if a node with such a local
- * name and namespace URI exists.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised if there is no node with the specified
- * <code>namespaceURI</code> and <code>localName</code> in this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature "XML" and the language exposed through the
- * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Node removeNamedItemNS(String namespaceURI,
- String localName)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/Node.java b/libjava/external/w3c_dom/org/w3c/dom/Node.java
deleted file mode 100644
index 989d49a2ea0..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/Node.java
+++ /dev/null
@@ -1,900 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>Node</code> interface is the primary datatype for the entire
- * Document Object Model. It represents a single node in the document tree.
- * While all objects implementing the <code>Node</code> interface expose
- * methods for dealing with children, not all objects implementing the
- * <code>Node</code> interface may have children. For example,
- * <code>Text</code> nodes may not have children, and adding children to
- * such nodes results in a <code>DOMException</code> being raised.
- * <p>The attributes <code>nodeName</code>, <code>nodeValue</code> and
- * <code>attributes</code> are included as a mechanism to get at node
- * information without casting down to the specific derived interface. In
- * cases where there is no obvious mapping of these attributes for a
- * specific <code>nodeType</code> (e.g., <code>nodeValue</code> for an
- * <code>Element</code> or <code>attributes</code> for a <code>Comment</code>
- * ), this returns <code>null</code>. Note that the specialized interfaces
- * may contain additional and more convenient mechanisms to get and set the
- * relevant information.
- * <p>The values of <code>nodeName</code>,
- * <code>nodeValue</code>, and <code>attributes</code> vary according to the
- * node type as follows:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>Interface</th>
- * <th>nodeName</th>
- * <th>nodeValue</th>
- * <th>attributes</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>Attr</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as <code>Attr.name</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as
- * <code>Attr.value</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>CDATASection</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>"#cdata-section"</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the
- * content of the CDATA Section</td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Comment</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>"#comment"</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the
- * content of the comment</td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Document</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>"#document"</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>DocumentFragment</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>"#document-fragment"</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>DocumentType</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as
- * <code>DocumentType.name</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>Element</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as <code>Element.tagName</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>NamedNodeMap</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Entity</code></td>
- * <td valign='top' rowspan='1' colspan='1'>entity name</td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>EntityReference</code></td>
- * <td valign='top' rowspan='1' colspan='1'>name of entity referenced</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Notation</code></td>
- * <td valign='top' rowspan='1' colspan='1'>notation name</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>ProcessingInstruction</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same
- * as <code>ProcessingInstruction.target</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as
- * <code>ProcessingInstruction.data</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Text</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>"#text"</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the content
- * of the text node</td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * </table>
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Node {
- // NodeType
- /**
- * The node is an <code>Element</code>.
- */
- public static final short ELEMENT_NODE = 1;
- /**
- * The node is an <code>Attr</code>.
- */
- public static final short ATTRIBUTE_NODE = 2;
- /**
- * The node is a <code>Text</code> node.
- */
- public static final short TEXT_NODE = 3;
- /**
- * The node is a <code>CDATASection</code>.
- */
- public static final short CDATA_SECTION_NODE = 4;
- /**
- * The node is an <code>EntityReference</code>.
- */
- public static final short ENTITY_REFERENCE_NODE = 5;
- /**
- * The node is an <code>Entity</code>.
- */
- public static final short ENTITY_NODE = 6;
- /**
- * The node is a <code>ProcessingInstruction</code>.
- */
- public static final short PROCESSING_INSTRUCTION_NODE = 7;
- /**
- * The node is a <code>Comment</code>.
- */
- public static final short COMMENT_NODE = 8;
- /**
- * The node is a <code>Document</code>.
- */
- public static final short DOCUMENT_NODE = 9;
- /**
- * The node is a <code>DocumentType</code>.
- */
- public static final short DOCUMENT_TYPE_NODE = 10;
- /**
- * The node is a <code>DocumentFragment</code>.
- */
- public static final short DOCUMENT_FRAGMENT_NODE = 11;
- /**
- * The node is a <code>Notation</code>.
- */
- public static final short NOTATION_NODE = 12;
-
- /**
- * The name of this node, depending on its type; see the table above.
- */
- public String getNodeName();
-
- /**
- * The value of this node, depending on its type; see the table above.
- * When it is defined to be <code>null</code>, setting it has no effect,
- * including if the node is read-only.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- */
- public String getNodeValue()
- throws DOMException;
- /**
- * The value of this node, depending on its type; see the table above.
- * When it is defined to be <code>null</code>, setting it has no effect,
- * including if the node is read-only.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly and if
- * it is not defined to be <code>null</code>.
- */
- public void setNodeValue(String nodeValue)
- throws DOMException;
-
- /**
- * A code representing the type of the underlying object, as defined above.
- */
- public short getNodeType();
-
- /**
- * The parent of this node. All nodes, except <code>Attr</code>,
- * <code>Document</code>, <code>DocumentFragment</code>,
- * <code>Entity</code>, and <code>Notation</code> may have a parent.
- * However, if a node has just been created and not yet added to the
- * tree, or if it has been removed from the tree, this is
- * <code>null</code>.
- */
- public Node getParentNode();
-
- /**
- * A <code>NodeList</code> that contains all children of this node. If
- * there are no children, this is a <code>NodeList</code> containing no
- * nodes.
- */
- public NodeList getChildNodes();
-
- /**
- * The first child of this node. If there is no such node, this returns
- * <code>null</code>.
- */
- public Node getFirstChild();
-
- /**
- * The last child of this node. If there is no such node, this returns
- * <code>null</code>.
- */
- public Node getLastChild();
-
- /**
- * The node immediately preceding this node. If there is no such node,
- * this returns <code>null</code>.
- */
- public Node getPreviousSibling();
-
- /**
- * The node immediately following this node. If there is no such node,
- * this returns <code>null</code>.
- */
- public Node getNextSibling();
-
- /**
- * A <code>NamedNodeMap</code> containing the attributes of this node (if
- * it is an <code>Element</code>) or <code>null</code> otherwise.
- */
- public NamedNodeMap getAttributes();
-
- /**
- * The <code>Document</code> object associated with this node. This is
- * also the <code>Document</code> object used to create new nodes. When
- * this node is a <code>Document</code> or a <code>DocumentType</code>
- * which is not used with any <code>Document</code> yet, this is
- * <code>null</code>.
- * @version DOM Level 2
- */
- public Document getOwnerDocument();
-
- /**
- * Inserts the node <code>newChild</code> before the existing child node
- * <code>refChild</code>. If <code>refChild</code> is <code>null</code>,
- * insert <code>newChild</code> at the end of the list of children.
- * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
- * all of its children are inserted, in the same order, before
- * <code>refChild</code>. If the <code>newChild</code> is already in the
- * tree, it is first removed.
- * <p ><b>Note:</b> Inserting a node before itself is implementation
- * dependent.
- * @param newChild The node to insert.
- * @param refChild The reference node, i.e., the node before which the
- * new node must be inserted.
- * @return The node being inserted.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or if
- * the node to insert is one of this node's ancestors or this node
- * itself, or if this node is of type <code>Document</code> and the
- * DOM application attempts to insert a second
- * <code>DocumentType</code> or <code>Element</code> node.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
- * from a different document than the one that created this node.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
- * if the parent of the node being inserted is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of
- * this node.
- * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
- * this exception might be raised if the DOM implementation doesn't
- * support the insertion of a <code>DocumentType</code> or
- * <code>Element</code> node.
- * @version DOM Level 3
- */
- public Node insertBefore(Node newChild,
- Node refChild)
- throws DOMException;
-
- /**
- * Replaces the child node <code>oldChild</code> with <code>newChild</code>
- * in the list of children, and returns the <code>oldChild</code> node.
- * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
- * <code>oldChild</code> is replaced by all of the
- * <code>DocumentFragment</code> children, which are inserted in the
- * same order. If the <code>newChild</code> is already in the tree, it
- * is first removed.
- * <p ><b>Note:</b> Replacing a node with itself is implementation
- * dependent.
- * @param newChild The new node to put in the child list.
- * @param oldChild The node being replaced in the list.
- * @return The node replaced.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or if
- * the node to put in is one of this node's ancestors or this node
- * itself, or if this node is of type <code>Document</code> and the
- * result of the replacement operation would add a second
- * <code>DocumentType</code> or <code>Element</code> on the
- * <code>Document</code> node.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
- * from a different document than the one that created this node.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of
- * the new node is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
- * this node.
- * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
- * this exception might be raised if the DOM implementation doesn't
- * support the replacement of the <code>DocumentType</code> child or
- * <code>Element</code> child.
- * @version DOM Level 3
- */
- public Node replaceChild(Node newChild,
- Node oldChild)
- throws DOMException;
-
- /**
- * Removes the child node indicated by <code>oldChild</code> from the list
- * of children, and returns it.
- * @param oldChild The node being removed.
- * @return The node removed.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
- * this node.
- * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
- * this exception might be raised if the DOM implementation doesn't
- * support the removal of the <code>DocumentType</code> child or the
- * <code>Element</code> child.
- * @version DOM Level 3
- */
- public Node removeChild(Node oldChild)
- throws DOMException;
-
- /**
- * Adds the node <code>newChild</code> to the end of the list of children
- * of this node. If the <code>newChild</code> is already in the tree, it
- * is first removed.
- * @param newChild The node to add.If it is a
- * <code>DocumentFragment</code> object, the entire contents of the
- * document fragment are moved into the child list of this node
- * @return The node added.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or if
- * the node to append is one of this node's ancestors or this node
- * itself, or if this node is of type <code>Document</code> and the
- * DOM application attempts to append a second
- * <code>DocumentType</code> or <code>Element</code> node.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
- * from a different document than the one that created this node.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
- * if the previous parent of the node being inserted is readonly.
- * <br>NOT_SUPPORTED_ERR: if the <code>newChild</code> node is a child
- * of the <code>Document</code> node, this exception might be raised
- * if the DOM implementation doesn't support the removal of the
- * <code>DocumentType</code> child or <code>Element</code> child.
- * @version DOM Level 3
- */
- public Node appendChild(Node newChild)
- throws DOMException;
-
- /**
- * Returns whether this node has any children.
- * @return Returns <code>true</code> if this node has any children,
- * <code>false</code> otherwise.
- */
- public boolean hasChildNodes();
-
- /**
- * Returns a duplicate of this node, i.e., serves as a generic copy
- * constructor for nodes. The duplicate node has no parent (
- * <code>parentNode</code> is <code>null</code>) and no user data. User
- * data associated to the imported node is not carried over. However, if
- * any <code>UserDataHandlers</code> has been specified along with the
- * associated data these handlers will be called with the appropriate
- * parameters before this method returns.
- * <br>Cloning an <code>Element</code> copies all attributes and their
- * values, including those generated by the XML processor to represent
- * defaulted attributes, but this method does not copy any children it
- * contains unless it is a deep clone. This includes text contained in
- * an the <code>Element</code> since the text is contained in a child
- * <code>Text</code> node. Cloning an <code>Attr</code> directly, as
- * opposed to be cloned as part of an <code>Element</code> cloning
- * operation, returns a specified attribute (<code>specified</code> is
- * <code>true</code>). Cloning an <code>Attr</code> always clones its
- * children, since they represent its value, no matter whether this is a
- * deep clone or not. Cloning an <code>EntityReference</code>
- * automatically constructs its subtree if a corresponding
- * <code>Entity</code> is available, no matter whether this is a deep
- * clone or not. Cloning any other type of node simply returns a copy of
- * this node.
- * <br>Note that cloning an immutable subtree results in a mutable copy,
- * but the children of an <code>EntityReference</code> clone are readonly
- * . In addition, clones of unspecified <code>Attr</code> nodes are
- * specified. And, cloning <code>Document</code>,
- * <code>DocumentType</code>, <code>Entity</code>, and
- * <code>Notation</code> nodes is implementation dependent.
- * @param deep If <code>true</code>, recursively clone the subtree under
- * the specified node; if <code>false</code>, clone only the node
- * itself (and its attributes, if it is an <code>Element</code>).
- * @return The duplicate node.
- */
- public Node cloneNode(boolean deep);
-
- /**
- * Puts all <code>Text</code> nodes in the full depth of the sub-tree
- * underneath this <code>Node</code>, including attribute nodes, into a
- * "normal" form where only structure (e.g., elements, comments,
- * processing instructions, CDATA sections, and entity references)
- * separates <code>Text</code> nodes, i.e., there are neither adjacent
- * <code>Text</code> nodes nor empty <code>Text</code> nodes. This can
- * be used to ensure that the DOM view of a document is the same as if
- * it were saved and re-loaded, and is useful when operations (such as
- * XPointer [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>]
- * lookups) that depend on a particular document tree structure are to
- * be used. If the parameter "normalize-characters" of the
- * <code>DOMConfiguration</code> object attached to the
- * <code>Node.ownerDocument</code> is <code>true</code>, this method
- * will also fully normalize the characters of the <code>Text</code>
- * nodes.
- * <p ><b>Note:</b> In cases where the document contains
- * <code>CDATASections</code>, the normalize operation alone may not be
- * sufficient, since XPointers do not differentiate between
- * <code>Text</code> nodes and <code>CDATASection</code> nodes.
- * @version DOM Level 3
- */
- public void normalize();
-
- /**
- * Tests whether the DOM implementation implements a specific feature and
- * that feature is supported by this node, as specified in .
- * @param feature The name of the feature to test.
- * @param version This is the version number of the feature to test.
- * @return Returns <code>true</code> if the specified feature is
- * supported on this node, <code>false</code> otherwise.
- * @since DOM Level 2
- */
- public boolean isSupported(String feature,
- String version);
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified (see ).
- * <br>This is not a computed value that is the result of a namespace
- * lookup based on an examination of the namespace declarations in
- * scope. It is merely the namespace URI given at creation time.
- * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
- * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
- * method, such as <code>Document.createElement()</code>, this is always
- * <code>null</code>.
- * <p ><b>Note:</b> Per the <em>Namespaces in XML</em> Specification [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * an attribute does not inherit its namespace from the element it is
- * attached to. If an attribute is not explicitly given a namespace, it
- * simply has no namespace.
- * @since DOM Level 2
- */
- public String getNamespaceURI();
-
- /**
- * The namespace prefix of this node, or <code>null</code> if it is
- * unspecified. When it is defined to be <code>null</code>, setting it
- * has no effect, including if the node is read-only.
- * <br>Note that setting this attribute, when permitted, changes the
- * <code>nodeName</code> attribute, which holds the qualified name, as
- * well as the <code>tagName</code> and <code>name</code> attributes of
- * the <code>Element</code> and <code>Attr</code> interfaces, when
- * applicable.
- * <br>Setting the prefix to <code>null</code> makes it unspecified,
- * setting it to an empty string is implementation dependent.
- * <br>Note also that changing the prefix of an attribute that is known to
- * have a default value, does not make a new attribute with the default
- * value and the original prefix appear, since the
- * <code>namespaceURI</code> and <code>localName</code> do not change.
- * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
- * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
- * method, such as <code>createElement</code> from the
- * <code>Document</code> interface, this is always <code>null</code>.
- * @since DOM Level 2
- */
- public String getPrefix();
- /**
- * The namespace prefix of this node, or <code>null</code> if it is
- * unspecified. When it is defined to be <code>null</code>, setting it
- * has no effect, including if the node is read-only.
- * <br>Note that setting this attribute, when permitted, changes the
- * <code>nodeName</code> attribute, which holds the qualified name, as
- * well as the <code>tagName</code> and <code>name</code> attributes of
- * the <code>Element</code> and <code>Attr</code> interfaces, when
- * applicable.
- * <br>Setting the prefix to <code>null</code> makes it unspecified,
- * setting it to an empty string is implementation dependent.
- * <br>Note also that changing the prefix of an attribute that is known to
- * have a default value, does not make a new attribute with the default
- * value and the original prefix appear, since the
- * <code>namespaceURI</code> and <code>localName</code> do not change.
- * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
- * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
- * method, such as <code>createElement</code> from the
- * <code>Document</code> interface, this is always <code>null</code>.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
- * illegal character according to the XML version in use specified in
- * the <code>Document.xmlVersion</code> attribute.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NAMESPACE_ERR: Raised if the specified <code>prefix</code> is
- * malformed per the Namespaces in XML specification, if the
- * <code>namespaceURI</code> of this node is <code>null</code>, if the
- * specified prefix is "xml" and the <code>namespaceURI</code> of this
- * node is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>", if this node is an attribute and the specified prefix is "xmlns" and
- * the <code>namespaceURI</code> of this node is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if this node is an attribute and the <code>qualifiedName</code> of
- * this node is "xmlns" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * .
- * @since DOM Level 2
- */
- public void setPrefix(String prefix)
- throws DOMException;
-
- /**
- * Returns the local part of the qualified name of this node.
- * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
- * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
- * method, such as <code>Document.createElement()</code>, this is always
- * <code>null</code>.
- * @since DOM Level 2
- */
- public String getLocalName();
-
- /**
- * Returns whether this node (if it is an element) has any attributes.
- * @return Returns <code>true</code> if this node has any attributes,
- * <code>false</code> otherwise.
- * @since DOM Level 2
- */
- public boolean hasAttributes();
-
- /**
- * The absolute base URI of this node or <code>null</code> if the
- * implementation wasn't able to obtain an absolute URI. This value is
- * computed as described in . However, when the <code>Document</code>
- * supports the feature "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * , the base URI is computed using first the value of the href
- * attribute of the HTML BASE element if any, and the value of the
- * <code>documentURI</code> attribute from the <code>Document</code>
- * interface otherwise.
- * @since DOM Level 3
- */
- public String getBaseURI();
-
- // DocumentPosition
- /**
- * The two nodes are disconnected. Order between disconnected nodes is
- * always implementation-specific.
- */
- public static final short DOCUMENT_POSITION_DISCONNECTED = 0x01;
- /**
- * The second node precedes the reference node.
- */
- public static final short DOCUMENT_POSITION_PRECEDING = 0x02;
- /**
- * The node follows the reference node.
- */
- public static final short DOCUMENT_POSITION_FOLLOWING = 0x04;
- /**
- * The node contains the reference node. A node which contains is always
- * preceding, too.
- */
- public static final short DOCUMENT_POSITION_CONTAINS = 0x08;
- /**
- * The node is contained by the reference node. A node which is contained
- * is always following, too.
- */
- public static final short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
- /**
- * The determination of preceding versus following is
- * implementation-specific.
- */
- public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
-
- /**
- * Compares the reference node, i.e. the node on which this method is
- * being called, with a node, i.e. the one passed as a parameter, with
- * regard to their position in the document and according to the
- * document order.
- * @param other The node to compare against the reference node.
- * @return Returns how the node is positioned relatively to the reference
- * node.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: when the compared nodes are from different DOM
- * implementations that do not coordinate to return consistent
- * implementation-specific results.
- * @since DOM Level 3
- */
- public short compareDocumentPosition(Node other)
- throws DOMException;
-
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be <code>null</code>, setting it
- * has no effect. On setting, any possible children this node may have
- * are removed and, if it the new string is not empty or
- * <code>null</code>, replaced by a single <code>Text</code> node
- * containing the string this attribute is set to.
- * <br> On getting, no serialization is performed, the returned string
- * does not contain any markup. No whitespace normalization is performed
- * and the returned string does not contain the white spaces in element
- * content (see the attribute
- * <code>Text.isElementContentWhitespace</code>). Similarly, on setting,
- * no parsing is performed either, the input string is taken as pure
- * textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the
- * node has no children.</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
- * PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE,
- * DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'><em>null</em></td>
- * </tr>
- * </table>
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- * @since DOM Level 3
- */
- public String getTextContent()
- throws DOMException;
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be <code>null</code>, setting it
- * has no effect. On setting, any possible children this node may have
- * are removed and, if it the new string is not empty or
- * <code>null</code>, replaced by a single <code>Text</code> node
- * containing the string this attribute is set to.
- * <br> On getting, no serialization is performed, the returned string
- * does not contain any markup. No whitespace normalization is performed
- * and the returned string does not contain the white spaces in element
- * content (see the attribute
- * <code>Text.isElementContentWhitespace</code>). Similarly, on setting,
- * no parsing is performed either, the input string is taken as pure
- * textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the
- * node has no children.</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
- * PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE,
- * DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'><em>null</em></td>
- * </tr>
- * </table>
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @since DOM Level 3
- */
- public void setTextContent(String textContent)
- throws DOMException;
-
- /**
- * Returns whether this node is the same node as the given one.
- * <br>This method provides a way to determine whether two
- * <code>Node</code> references returned by the implementation reference
- * the same object. When two <code>Node</code> references are references
- * to the same object, even if through a proxy, the references may be
- * used completely interchangeably, such that all attributes have the
- * same values and calling the same DOM method on either reference
- * always has exactly the same effect.
- * @param other The node to test against.
- * @return Returns <code>true</code> if the nodes are the same,
- * <code>false</code> otherwise.
- * @since DOM Level 3
- */
- public boolean isSameNode(Node other);
-
- /**
- * Look up the prefix associated to the given namespace URI, starting from
- * this node. The default namespace declarations are ignored by this
- * method.
- * <br>See for details on the algorithm used by this method.
- * @param namespaceURI The namespace URI to look for.
- * @return Returns an associated namespace prefix if found or
- * <code>null</code> if none is found. If more than one prefix are
- * associated to the namespace prefix, the returned namespace prefix
- * is implementation dependent.
- * @since DOM Level 3
- */
- public String lookupPrefix(String namespaceURI);
-
- /**
- * This method checks if the specified <code>namespaceURI</code> is the
- * default namespace or not.
- * @param namespaceURI The namespace URI to look for.
- * @return Returns <code>true</code> if the specified
- * <code>namespaceURI</code> is the default namespace,
- * <code>false</code> otherwise.
- * @since DOM Level 3
- */
- public boolean isDefaultNamespace(String namespaceURI);
-
- /**
- * Look up the namespace URI associated to the given prefix, starting from
- * this node.
- * <br>See for details on the algorithm used by this method.
- * @param prefix The prefix to look for. If this parameter is
- * <code>null</code>, the method will return the default namespace URI
- * if any.
- * @return Returns the associated namespace URI or <code>null</code> if
- * none is found.
- * @since DOM Level 3
- */
- public String lookupNamespaceURI(String prefix);
-
- /**
- * Tests whether two nodes are equal.
- * <br>This method tests for equality of nodes, not sameness (i.e.,
- * whether the two nodes are references to the same object) which can be
- * tested with <code>Node.isSameNode()</code>. All nodes that are the
- * same will also be equal, though the reverse may not be true.
- * <br>Two nodes are equal if and only if the following conditions are
- * satisfied:
- * <ul>
- * <li>The two nodes are of the same type.
- * </li>
- * <li>The following string
- * attributes are equal: <code>nodeName</code>, <code>localName</code>,
- * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
- * . This is: they are both <code>null</code>, or they have the same
- * length and are character for character identical.
- * </li>
- * <li>The
- * <code>attributes</code> <code>NamedNodeMaps</code> are equal. This
- * is: they are both <code>null</code>, or they have the same length and
- * for each node that exists in one map there is a node that exists in
- * the other map and is equal, although not necessarily at the same
- * index.
- * </li>
- * <li>The <code>childNodes</code> <code>NodeLists</code> are equal.
- * This is: they are both <code>null</code>, or they have the same
- * length and contain equal nodes at the same index. Note that
- * normalization can affect equality; to avoid this, nodes should be
- * normalized before being compared.
- * </li>
- * </ul>
- * <br>For two <code>DocumentType</code> nodes to be equal, the following
- * conditions must also be satisfied:
- * <ul>
- * <li>The following string attributes
- * are equal: <code>publicId</code>, <code>systemId</code>,
- * <code>internalSubset</code>.
- * </li>
- * <li>The <code>entities</code>
- * <code>NamedNodeMaps</code> are equal.
- * </li>
- * <li>The <code>notations</code>
- * <code>NamedNodeMaps</code> are equal.
- * </li>
- * </ul>
- * <br>On the other hand, the following do not affect equality: the
- * <code>ownerDocument</code>, <code>baseURI</code>, and
- * <code>parentNode</code> attributes, the <code>specified</code>
- * attribute for <code>Attr</code> nodes, the <code>schemaTypeInfo</code>
- * attribute for <code>Attr</code> and <code>Element</code> nodes, the
- * <code>Text.isElementContentWhitespace</code> attribute for
- * <code>Text</code> nodes, as well as any user data or event listeners
- * registered on the nodes.
- * <p ><b>Note:</b> As a general rule, anything not mentioned in the
- * description above is not significant in consideration of equality
- * checking. Note that future versions of this specification may take
- * into account more attributes and implementations conform to this
- * specification are expected to be updated accordingly.
- * @param arg The node to compare equality with.
- * @return Returns <code>true</code> if the nodes are equal,
- * <code>false</code> otherwise.
- * @since DOM Level 3
- */
- public boolean isEqualNode(Node arg);
-
- /**
- * This method returns a specialized object which implements the
- * specialized APIs of the specified feature and version, as specified
- * in . The specialized object may also be obtained by using
- * binding-specific casting methods but is not necessarily expected to,
- * as discussed in . This method also allow the implementation to
- * provide specialized objects which do not support the <code>Node</code>
- * interface.
- * @param feature The name of the feature requested. Note that any plus
- * sign "+" prepended to the name of the feature will be ignored since
- * it is not significant in the context of this method.
- * @param version This is the version number of the feature to test.
- * @return Returns an object which implements the specialized APIs of
- * the specified feature and version, if any, or <code>null</code> if
- * there is no object which implements interfaces associated with that
- * feature. If the <code>DOMObject</code> returned by this method
- * implements the <code>Node</code> interface, it must delegate to the
- * primary core <code>Node</code> and not return results inconsistent
- * with the primary core <code>Node</code> such as attributes,
- * childNodes, etc.
- * @since DOM Level 3
- */
- public Object getFeature(String feature,
- String version);
-
- /**
- * Associate an object to a key on this node. The object can later be
- * retrieved from this node by calling <code>getUserData</code> with the
- * same key.
- * @param key The key to associate the object to.
- * @param data The object to associate to the given key, or
- * <code>null</code> to remove any existing association to that key.
- * @param handler The handler to associate to that key, or
- * <code>null</code>.
- * @return Returns the <code>DOMUserData</code> previously associated to
- * the given key on this node, or <code>null</code> if there was none.
- * @since DOM Level 3
- */
- public Object setUserData(String key,
- Object data,
- UserDataHandler handler);
-
- /**
- * Retrieves the object associated to a key on a this node. The object
- * must first have been set to this node by calling
- * <code>setUserData</code> with the same key.
- * @param key The key the object is associated to.
- * @return Returns the <code>DOMUserData</code> associated to the given
- * key on this node, or <code>null</code> if there was none.
- * @since DOM Level 3
- */
- public Object getUserData(String key);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/NodeList.java b/libjava/external/w3c_dom/org/w3c/dom/NodeList.java
deleted file mode 100644
index e4204ec974c..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/NodeList.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>NodeList</code> interface provides the abstraction of an ordered
- * collection of nodes, without defining or constraining how this collection
- * is implemented. <code>NodeList</code> objects in the DOM are live.
- * <p>The items in the <code>NodeList</code> are accessible via an integral
- * index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface NodeList {
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this returns <code>null</code>.
- * @param index Index into the collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- */
- public Node item(int index);
-
- /**
- * The number of nodes in the list. The range of valid child node indices
- * is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/Notation.java b/libjava/external/w3c_dom/org/w3c/dom/Notation.java
deleted file mode 100644
index 3739f928443..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/Notation.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * This interface represents a notation declared in the DTD. A notation either
- * declares, by name, the format of an unparsed entity (see <a href='http://www.w3.org/TR/2004/REC-xml-20040204#Notations'>section 4.7</a> of the XML 1.0 specification [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]), or is
- * used for formal declaration of processing instruction targets (see <a href='http://www.w3.org/TR/2004/REC-xml-20040204#sec-pi'>section 2.6</a> of the XML 1.0 specification [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]). The
- * <code>nodeName</code> attribute inherited from <code>Node</code> is set
- * to the declared name of the notation.
- * <p>The DOM Core does not support editing <code>Notation</code> nodes; they
- * are therefore readonly.
- * <p>A <code>Notation</code> node does not have any parent.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Notation extends Node {
- /**
- * The public identifier of this notation. If the public identifier was
- * not specified, this is <code>null</code>.
- */
- public String getPublicId();
-
- /**
- * The system identifier of this notation. If the system identifier was
- * not specified, this is <code>null</code>. This may be an absolute URI
- * or not.
- */
- public String getSystemId();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ProcessingInstruction.java b/libjava/external/w3c_dom/org/w3c/dom/ProcessingInstruction.java
deleted file mode 100644
index 0b6825f104c..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ProcessingInstruction.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>ProcessingInstruction</code> interface represents a "processing
- * instruction", used in XML as a way to keep processor-specific information
- * in the text of the document.
- * <p> No lexical check is done on the content of a processing instruction and
- * it is therefore possible to have the character sequence
- * <code>"?&gt;"</code> in the content, which is illegal a processing
- * instruction per section 2.6 of [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. The
- * presence of this character sequence must generate a fatal error during
- * serialization.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface ProcessingInstruction extends Node {
- /**
- * The target of this processing instruction. XML defines this as being
- * the first token following the markup that begins the processing
- * instruction.
- */
- public String getTarget();
-
- /**
- * The content of this processing instruction. This is from the first non
- * white space character after the target to the character immediately
- * preceding the <code>?&gt;</code>.
- */
- public String getData();
- /**
- * The content of this processing instruction. This is from the first non
- * white space character after the target to the character immediately
- * preceding the <code>?&gt;</code>.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- */
- public void setData(String data)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/Text.java b/libjava/external/w3c_dom/org/w3c/dom/Text.java
deleted file mode 100644
index 9c294a4a488..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/Text.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>Text</code> interface inherits from <code>CharacterData</code>
- * and represents the textual content (termed <a href='http://www.w3.org/TR/2004/REC-xml-20040204#syntax'>character data</a> in XML) of an <code>Element</code> or <code>Attr</code>. If there is no
- * markup inside an element's content, the text is contained in a single
- * object implementing the <code>Text</code> interface that is the only
- * child of the element. If there is markup, it is parsed into the
- * information items (elements, comments, etc.) and <code>Text</code> nodes
- * that form the list of children of the element.
- * <p>When a document is first made available via the DOM, there is only one
- * <code>Text</code> node for each block of text. Users may create adjacent
- * <code>Text</code> nodes that represent the contents of a given element
- * without any intervening markup, but should be aware that there is no way
- * to represent the separations between these nodes in XML or HTML, so they
- * will not (in general) persist between DOM editing sessions. The
- * <code>Node.normalize()</code> method merges any such adjacent
- * <code>Text</code> objects into a single node for each block of text.
- * <p> No lexical check is done on the content of a <code>Text</code> node
- * and, depending on its position in the document, some characters must be
- * escaped during serialization using character references; e.g. the
- * characters "&lt;&amp;" if the textual content is part of an element or of
- * an attribute, the character sequence "]]&gt;" when part of an element,
- * the quotation mark character " or the apostrophe character ' when part of
- * an attribute.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Text extends CharacterData {
- /**
- * Breaks this node into two nodes at the specified <code>offset</code>,
- * keeping both in the tree as siblings. After being split, this node
- * will contain all the content up to the <code>offset</code> point. A
- * new node of the same type, which contains all the content at and
- * after the <code>offset</code> point, is returned. If the original
- * node had a parent node, the new node is inserted as the next sibling
- * of the original node. When the <code>offset</code> is equal to the
- * length of this node, the new node has no data.
- * @param offset The 16-bit unit offset at which to split, starting from
- * <code>0</code>.
- * @return The new node, of the same type as this node.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
- * than the number of 16-bit units in <code>data</code>.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public Text splitText(int offset)
- throws DOMException;
-
- /**
- * Returns whether this text node contains <a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.character'>
- * element content whitespace</a>, often abusively called "ignorable whitespace". The text node is
- * determined to contain whitespace in element content during the load
- * of the document or if validation occurs while using
- * <code>Document.normalizeDocument()</code>.
- * @since DOM Level 3
- */
- public boolean isElementContentWhitespace();
-
- /**
- * Returns all text of <code>Text</code> nodes logically-adjacent text
- * nodes to this node, concatenated in document order.
- * <br>For instance, in the example below <code>wholeText</code> on the
- * <code>Text</code> node that contains "bar" returns "barfoo", while on
- * the <code>Text</code> node that contains "foo" it returns "barfoo".
- * @since DOM Level 3
- */
- public String getWholeText();
-
- /**
- * Replaces the text of the current node and all logically-adjacent text
- * nodes with the specified text. All logically-adjacent text nodes are
- * removed including the current node unless it was the recipient of the
- * replacement text.
- * <br>This method returns the node which received the replacement text.
- * The returned node is:
- * <ul>
- * <li><code>null</code>, when the replacement text is
- * the empty string;
- * </li>
- * <li>the current node, except when the current node is
- * read-only;
- * </li>
- * <li> a new <code>Text</code> node of the same type (
- * <code>Text</code> or <code>CDATASection</code>) as the current node
- * inserted at the location of the replacement.
- * </li>
- * </ul>
- * <br>For instance, in the above example calling
- * <code>replaceWholeText</code> on the <code>Text</code> node that
- * contains "bar" with "yo" in argument results in the following:
- * <br>Where the nodes to be removed are read-only descendants of an
- * <code>EntityReference</code>, the <code>EntityReference</code> must
- * be removed instead of the read-only nodes. If any
- * <code>EntityReference</code> to be removed has descendants that are
- * not <code>EntityReference</code>, <code>Text</code>, or
- * <code>CDATASection</code> nodes, the <code>replaceWholeText</code>
- * method must fail before performing any modification of the document,
- * raising a <code>DOMException</code> with the code
- * <code>NO_MODIFICATION_ALLOWED_ERR</code>.
- * <br>For instance, in the example below calling
- * <code>replaceWholeText</code> on the <code>Text</code> node that
- * contains "bar" fails, because the <code>EntityReference</code> node
- * "ent" contains an <code>Element</code> node which cannot be removed.
- * @param content The content of the replacing <code>Text</code> node.
- * @return The <code>Text</code> node created with the specified content.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if one of the <code>Text</code>
- * nodes being replaced is readonly.
- * @since DOM Level 3
- */
- public Text replaceWholeText(String content)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/TypeInfo.java b/libjava/external/w3c_dom/org/w3c/dom/TypeInfo.java
deleted file mode 100644
index 054f9907245..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/TypeInfo.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>TypeInfo</code> interface represents a type referenced from
- * <code>Element</code> or <code>Attr</code> nodes, specified in the schemas
- * associated with the document. The type is a pair of a namespace URI and
- * name properties, and depends on the document's schema.
- * <p> If the document's schema is an XML DTD [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], the values
- * are computed as follows:
- * <ul>
- * <li> If this type is referenced from an
- * <code>Attr</code> node, <code>typeNamespace</code> is
- * <code>"http://www.w3.org/TR/REC-xml"</code> and <code>typeName</code>
- * represents the <b>[attribute type]</b> property in the [<a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/'>XML Information Set</a>]
- * . If there is no declaration for the attribute, <code>typeNamespace</code>
- * and <code>typeName</code> are <code>null</code>.
- * </li>
- * <li> If this type is
- * referenced from an <code>Element</code> node, <code>typeNamespace</code>
- * and <code>typeName</code> are <code>null</code>.
- * </li>
- * </ul>
- * <p> If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , the values are computed as follows using the post-schema-validation
- * infoset contributions (also called PSVI contributions):
- * <ul>
- * <li> If the <b>[validity]</b> property exists AND is <em>"invalid"</em> or <em>"notKnown"</em>: the {target namespace} and {name} properties of the declared type if
- * available, otherwise <code>null</code>.
- * <p ><b>Note:</b> At the time of writing, the XML Schema specification does
- * not require exposing the declared type. Thus, DOM implementations might
- * choose not to provide type information if validity is not valid.
- * </li>
- * <li> If the <b>[validity]</b> property exists and is <em>"valid"</em>:
- * <ol>
- * <li> If <b>[member type definition]</b> exists:
- * <ol>
- * <li>If {name} is not absent, then expose {name} and {target
- * namespace} properties of the <b>[member type definition]</b> property;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the
- * corresponding anonymous type name.
- * </li>
- * </ol>
- * </li>
- * <li> If the <b>[type definition]</b> property exists:
- * <ol>
- * <li>If {name} is not absent, then expose {name} and {target
- * namespace} properties of the <b>[type definition]</b> property;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the
- * corresponding anonymous type name.
- * </li>
- * </ol>
- * </li>
- * <li> If the <b>[member type definition anonymous]</b> exists:
- * <ol>
- * <li>If it is false, then expose <b>[member type definition name]</b> and <b>[member type definition namespace]</b> properties;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the
- * corresponding anonymous type name.
- * </li>
- * </ol>
- * </li>
- * <li> If the <b>[type definition anonymous]</b> exists:
- * <ol>
- * <li>If it is false, then expose <b>[type definition name]</b> and <b>[type definition namespace]</b> properties;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the
- * corresponding anonymous type name.
- * </li>
- * </ol>
- * </li>
- * </ol>
- * </li>
- * </ul>
- * <p ><b>Note:</b> Other schema languages are outside the scope of the W3C
- * and therefore should define how to represent their type systems using
- * <code>TypeInfo</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface TypeInfo {
- /**
- * The name of a type declared for the associated element or attribute,
- * or <code>null</code> if unknown.
- */
- public String getTypeName();
-
- /**
- * The namespace of the type declared for the associated element or
- * attribute or <code>null</code> if the element does not have
- * declaration or if no namespace information is available.
- */
- public String getTypeNamespace();
-
- // DerivationMethods
- /**
- * If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , this constant represents the derivation by <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-typeRestriction'>
- * restriction</a> if complex types are involved, or a <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-restriction'>
- * restriction</a> if simple types are involved.
- * <br> The reference type definition is derived by restriction from the
- * other type definition if the other type definition is the same as the
- * reference type definition, or if the other type definition can be
- * reached recursively following the {base type definition} property
- * from the reference type definition, and all the <em>derivation methods</em> involved are restriction.
- */
- public static final int DERIVATION_RESTRICTION = 0x00000001;
- /**
- * If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , this constant represents the derivation by <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-typeExtension'>
- * extension</a>.
- * <br> The reference type definition is derived by extension from the
- * other type definition if the other type definition can be reached
- * recursively following the {base type definition} property from the
- * reference type definition, and at least one of the <em>derivation methods</em> involved is an extension.
- */
- public static final int DERIVATION_EXTENSION = 0x00000002;
- /**
- * If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , this constant represents the <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-union'>
- * union</a> if simple types are involved.
- * <br> The reference type definition is derived by union from the other
- * type definition if there exists two type definitions T1 and T2 such
- * as the reference type definition is derived from T1 by
- * <code>DERIVATION_RESTRICTION</code> or
- * <code>DERIVATION_EXTENSION</code>, T2 is derived from the other type
- * definition by <code>DERIVATION_RESTRICTION</code>, T1 has {variety} <em>union</em>, and one of the {member type definitions} is T2. Note that T1 could be
- * the same as the reference type definition, and T2 could be the same
- * as the other type definition.
- */
- public static final int DERIVATION_UNION = 0x00000004;
- /**
- * If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , this constant represents the <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-list'>list</a>.
- * <br> The reference type definition is derived by list from the other
- * type definition if there exists two type definitions T1 and T2 such
- * as the reference type definition is derived from T1 by
- * <code>DERIVATION_RESTRICTION</code> or
- * <code>DERIVATION_EXTENSION</code>, T2 is derived from the other type
- * definition by <code>DERIVATION_RESTRICTION</code>, T1 has {variety} <em>list</em>, and T2 is the {item type definition}. Note that T1 could be the same as
- * the reference type definition, and T2 could be the same as the other
- * type definition.
- */
- public static final int DERIVATION_LIST = 0x00000008;
-
- /**
- * This method returns if there is a derivation between the reference
- * type definition, i.e. the <code>TypeInfo</code> on which the method
- * is being called, and the other type definition, i.e. the one passed
- * as parameters.
- * @param typeNamespaceArg the namespace of the other type definition.
- * @param typeNameArg the name of the other type definition.
- * @param derivationMethod the type of derivation and conditions applied
- * between two types, as described in the list of constants provided
- * in this interface.
- * @return If the document's schema is a DTD or no schema is associated
- * with the document, this method will always return <code>false</code>
- * . If the document's schema is an XML Schema, the method will
- * <code>true</code> if the reference type definition is derived from
- * the other type definition according to the derivation parameter. If
- * the value of the parameter is <code>0</code> (no bit is set to
- * <code>1</code> for the <code>derivationMethod</code> parameter),
- * the method will return <code>true</code> if the other type
- * definition can be reached by recursing any combination of {base
- * type definition}, {item type definition}, or {member type
- * definitions} from the reference type definition.
- */
- public boolean isDerivedFrom(String typeNamespaceArg,
- String typeNameArg,
- int derivationMethod);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/UserDataHandler.java b/libjava/external/w3c_dom/org/w3c/dom/UserDataHandler.java
deleted file mode 100644
index a16ea7308c2..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/UserDataHandler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * When associating an object to a key on a node using
- * <code>Node.setUserData()</code> the application can provide a handler
- * that gets called when the node the object is associated to is being
- * cloned, imported, or renamed. This can be used by the application to
- * implement various behaviors regarding the data it associates to the DOM
- * nodes. This interface defines that handler.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface UserDataHandler {
- // OperationType
- /**
- * The node is cloned, using <code>Node.cloneNode()</code>.
- */
- public static final short NODE_CLONED = 1;
- /**
- * The node is imported, using <code>Document.importNode()</code>.
- */
- public static final short NODE_IMPORTED = 2;
- /**
- * The node is deleted.
- * <p ><b>Note:</b> This may not be supported or may not be reliable in
- * certain environments, such as Java, where the implementation has no
- * real control over when objects are actually deleted.
- */
- public static final short NODE_DELETED = 3;
- /**
- * The node is renamed, using <code>Document.renameNode()</code>.
- */
- public static final short NODE_RENAMED = 4;
- /**
- * The node is adopted, using <code>Document.adoptNode()</code>.
- */
- public static final short NODE_ADOPTED = 5;
-
- /**
- * This method is called whenever the node for which this handler is
- * registered is imported or cloned.
- * <br> DOM applications must not raise exceptions in a
- * <code>UserDataHandler</code>. The effect of throwing exceptions from
- * the handler is DOM implementation dependent.
- * @param operation Specifies the type of operation that is being
- * performed on the node.
- * @param key Specifies the key for which this handler is being called.
- * @param data Specifies the data for which this handler is being called.
- * @param src Specifies the node being cloned, adopted, imported, or
- * renamed. This is <code>null</code> when the node is being deleted.
- * @param dst Specifies the node newly created if any, or
- * <code>null</code>.
- */
- public void handle(short operation,
- String key,
- Object data,
- Node src,
- Node dst);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/bootstrap/DOMImplementationRegistry.java b/libjava/external/w3c_dom/org/w3c/dom/bootstrap/DOMImplementationRegistry.java
deleted file mode 100644
index be73f396bd8..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/bootstrap/DOMImplementationRegistry.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-
-package org.w3c.dom.bootstrap;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-import org.w3c.dom.DOMImplementationSource;
-import org.w3c.dom.DOMImplementationList;
-import org.w3c.dom.DOMImplementation;
-import java.io.InputStream;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * A factory that enables applications to obtain instances of
- * <code>DOMImplementation</code>.
- *
- * <p>
- * Example:
- * </p>
- *
- * <pre class='example'>
- * // get an instance of the DOMImplementation registry
- * DOMImplementationRegistry registry =
- * DOMImplementationRegistry.newInstance();
- * // get a DOM implementation the Level 3 XML module
- * DOMImplementation domImpl =
- * registry.getDOMImplementation("XML 3.0");
- * </pre>
- *
- * <p>
- * This provides an application with an implementation-independent starting
- * point. DOM implementations may modify this class to meet new security
- * standards or to provide *additional* fallbacks for the list of
- * DOMImplementationSources.
- * </p>
- *
- * @see DOMImplementation
- * @see DOMImplementationSource
- * @since DOM Level 3
- */
-public final class DOMImplementationRegistry {
- /**
- * The system property to specify the
- * DOMImplementationSource class names.
- */
- public static final String PROPERTY =
- "org.w3c.dom.DOMImplementationSourceList";
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /**
- * The list of DOMImplementationSources.
- */
- private Vector sources;
-
- /**
- * Private constructor.
- * @param srcs Vector List of DOMImplementationSources
- */
- private DOMImplementationRegistry(final Vector srcs) {
- sources = srcs;
- }
-
- /**
- * Obtain a new instance of a <code>DOMImplementationRegistry</code>.
- *
-
- * The <code>DOMImplementationRegistry</code> is initialized by the
- * application or the implementation, depending on the context, by
- * first checking the value of the Java system property
- * <code>org.w3c.dom.DOMImplementationSourceList</code> and
- * the the service provider whose contents are at
- * "<code>META_INF/services/org.w3c.dom.DOMImplementationSourceList</code>"
- * The value of this property is a white-space separated list of
- * names of availables classes implementing the
- * <code>DOMImplementationSource</code> interface. Each class listed
- * in the class name list is instantiated and any exceptions
- * encountered are thrown to the application.
- *
- * @return an initialized instance of DOMImplementationRegistry
- * @throws ClassNotFoundException
- * If any specified class can not be found
- * @throws InstantiationException
- * If any specified class is an interface or abstract class
- * @throws IllegalAccessException
- * If the default constructor of a specified class is not accessible
- * @throws ClassCastException
- * If any specified class does not implement
- * <code>DOMImplementationSource</code>
- */
- public static DOMImplementationRegistry newInstance()
- throws
- ClassNotFoundException,
- InstantiationException,
- IllegalAccessException,
- ClassCastException {
- Vector sources = new Vector();
-
- ClassLoader classLoader = getClassLoader();
- // fetch system property:
- String p = getSystemProperty(PROPERTY);
-
- //
- // if property is not specified then use contents of
- // META_INF/org.w3c.dom.DOMImplementationSourceList from classpath
- if (p == null) {
- p = getServiceValue(classLoader);
- }
- if (p == null) {
- //
- // DOM Implementations can modify here to add *additional* fallback
- // mechanisms to access a list of default DOMImplementationSources.
- p = "gnu.xml.dom.ImplementationSource";
- }
- if (p != null) {
- StringTokenizer st = new StringTokenizer(p);
- while (st.hasMoreTokens()) {
- String sourceName = st.nextToken();
- // Use context class loader, falling back to Class.forName
- // if and only if this fails...
- Class sourceClass = null;
- if (classLoader != null) {
- sourceClass = classLoader.loadClass(sourceName);
- } else {
- sourceClass = Class.forName(sourceName);
- }
- DOMImplementationSource source =
- (DOMImplementationSource) sourceClass.newInstance();
- sources.addElement(source);
- }
- }
- return new DOMImplementationRegistry(sources);
- }
-
- /**
- * Return the first implementation that has the desired
- * features, or <code>null</code> if none is found.
- *
- * @param features
- * A string that specifies which features are required. This is
- * a space separated list in which each feature is specified by
- * its name optionally followed by a space and a version number.
- * This is something like: "XML 1.0 Traversal +Events 2.0"
- * @return An implementation that has the desired features,
- * or <code>null</code> if none found.
- */
- public DOMImplementation getDOMImplementation(final String features) {
- int size = sources.size();
- String name = null;
- for (int i = 0; i < size; i++) {
- DOMImplementationSource source =
- (DOMImplementationSource) sources.elementAt(i);
- DOMImplementation impl = source.getDOMImplementation(features);
- if (impl != null) {
- return impl;
- }
- }
- return null;
- }
-
- /**
- * Return a list of implementations that support the
- * desired features.
- *
- * @param features
- * A string that specifies which features are required. This is
- * a space separated list in which each feature is specified by
- * its name optionally followed by a space and a version number.
- * This is something like: "XML 1.0 Traversal +Events 2.0"
- * @return A list of DOMImplementations that support the desired features.
- */
- public DOMImplementationList getDOMImplementationList(final String features) {
- final Vector implementations = new Vector();
- int size = sources.size();
- for (int i = 0; i < size; i++) {
- DOMImplementationSource source =
- (DOMImplementationSource) sources.elementAt(i);
- DOMImplementationList impls =
- source.getDOMImplementationList(features);
- for (int j = 0; j < impls.getLength(); j++) {
- DOMImplementation impl = impls.item(j);
- implementations.addElement(impl);
- }
- }
- return new DOMImplementationList() {
- public DOMImplementation item(final int index) {
- if (index >= 0 && index < implementations.size()) {
- try {
- return (DOMImplementation)
- implementations.elementAt(index);
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
- return null;
- }
-
- public int getLength() {
- return implementations.size();
- }
- };
- }
-
- /**
- * Register an implementation.
- *
- * @param s The source to be registered, may not be <code>null</code>
- */
- public void addSource(final DOMImplementationSource s) {
- if (s == null) {
- throw new NullPointerException();
- }
- if (!sources.contains(s)) {
- sources.addElement(s);
- }
- }
-
- /**
- *
- * Gets a class loader.
- *
- * @return A class loader, possibly <code>null</code>
- */
- private static ClassLoader getClassLoader() {
- try {
- ClassLoader contextClassLoader = getContextClassLoader();
-
- if (contextClassLoader != null) {
- return contextClassLoader;
- }
- } catch (Exception e) {
- // Assume that the DOM application is in a JRE 1.1, use the
- // current ClassLoader
- return DOMImplementationRegistry.class.getClassLoader();
- }
- return DOMImplementationRegistry.class.getClassLoader();
- }
-
- /**
- * This method attempts to return the first line of the resource
- * META_INF/services/org.w3c.dom.DOMImplementationSourceList
- * from the provided ClassLoader.
- *
- * @param classLoader classLoader, may not be <code>null</code>.
- * @return first line of resource, or <code>null</code>
- */
- private static String getServiceValue(final ClassLoader classLoader) {
- String serviceId = "META-INF/services/" + PROPERTY;
- // try to find services in CLASSPATH
- try {
- InputStream is = getResourceAsStream(classLoader, serviceId);
-
- if (is != null) {
- BufferedReader rd;
- try {
- rd =
- new BufferedReader(new InputStreamReader(is, "UTF-8"),
- DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd =
- new BufferedReader(new InputStreamReader(is),
- DEFAULT_LINE_LENGTH);
- }
- String serviceValue = rd.readLine();
- rd.close();
- if (serviceValue != null && serviceValue.length() > 0) {
- return serviceValue;
- }
- }
- } catch (Exception ex) {
- return null;
- }
- return null;
- }
-
- /**
- * A simple JRE (Java Runtime Environment) 1.1 test
- *
- * @return <code>true</code> if JRE 1.1
- */
- private static boolean isJRE11() {
- try {
- Class c = Class.forName("java.security.AccessController");
- // java.security.AccessController existed since 1.2 so, if no
- // exception was thrown, the DOM application is running in a JRE
- // 1.2 or higher
- return false;
- } catch (Exception ex) {
- // ignore
- }
- return true;
- }
-
- /**
- * This method returns the ContextClassLoader or <code>null</code> if
- * running in a JRE 1.1
- *
- * @return The Context Classloader
- */
- private static ClassLoader getContextClassLoader() {
- return isJRE11()
- ? null
- : (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader classLoader = null;
- try {
- classLoader =
- Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) {
- }
- return classLoader;
- }
- });
- }
-
- /**
- * This method returns the system property indicated by the specified name
- * after checking access control privileges. For a JRE 1.1, this check is
- * not done.
- *
- * @param name the name of the system property
- * @return the system property
- */
- private static String getSystemProperty(final String name) {
- return isJRE11()
- ? (String) System.getProperty(name)
- : (String) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(name);
- }
- });
- }
-
- /**
- * This method returns an Inputstream for the reading resource
- * META_INF/services/org.w3c.dom.DOMImplementationSourceList after checking
- * access control privileges. For a JRE 1.1, this check is not done.
- *
- * @param classLoader classLoader
- * @param name the resource
- * @return an Inputstream for the resource specified
- */
- private static InputStream getResourceAsStream(final ClassLoader classLoader,
- final String name) {
- if (isJRE11()) {
- InputStream ris;
- if (classLoader == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = classLoader.getResourceAsStream(name);
- }
- return ris;
- } else {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (classLoader == null) {
- ris =
- ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = classLoader.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
- }
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSS2Properties.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSS2Properties.java
deleted file mode 100644
index 89ccf5048ef..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSS2Properties.java
+++ /dev/null
@@ -1,1777 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSS2Properties</code> interface represents a convenience
- * mechanism for retrieving and setting properties within a
- * <code>CSSStyleDeclaration</code>. The attributes of this interface
- * correspond to all the properties specified in CSS2. Getting an attribute
- * of this interface is equivalent to calling the
- * <code>getPropertyValue</code> method of the
- * <code>CSSStyleDeclaration</code> interface. Setting an attribute of this
- * interface is equivalent to calling the <code>setProperty</code> method of
- * the <code>CSSStyleDeclaration</code> interface.
- * <p> A conformant implementation of the CSS module is not required to
- * implement the <code>CSS2Properties</code> interface. If an implementation
- * does implement this interface, the expectation is that language-specific
- * methods can be used to cast from an instance of the
- * <code>CSSStyleDeclaration</code> interface to the
- * <code>CSS2Properties</code> interface.
- * <p> If an implementation does implement this interface, it is expected to
- * understand the specific syntax of the shorthand properties, and apply
- * their semantics; when the <code>margin</code> property is set, for
- * example, the <code>marginTop</code>, <code>marginRight</code>,
- * <code>marginBottom</code> and <code>marginLeft</code> properties are
- * actually being set by the underlying implementation.
- * <p> When dealing with CSS "shorthand" properties, the shorthand properties
- * should be decomposed into their component longhand properties as
- * appropriate, and when querying for their value, the form returned should
- * be the shortest form exactly equivalent to the declarations made in the
- * ruleset. However, if there is no shorthand declaration that could be
- * added to the ruleset without changing in any way the rules already
- * declared in the ruleset (i.e., by adding longhand rules that were
- * previously not declared in the ruleset), then the empty string should be
- * returned for the shorthand property.
- * <p> For example, querying for the <code>font</code> property should not
- * return "normal normal normal 14pt/normal Arial, sans-serif", when "14pt
- * Arial, sans-serif" suffices. (The normals are initial values, and are
- * implied by use of the longhand property.)
- * <p> If the values for all the longhand properties that compose a particular
- * string are the initial values, then a string consisting of all the
- * initial values should be returned (e.g. a <code>border-width</code> value
- * of "medium" should be returned as such, not as "").
- * <p> For some shorthand properties that take missing values from other
- * sides, such as the <code>margin</code>, <code>padding</code>, and
- * <code>border-[width|style|color]</code> properties, the minimum number of
- * sides possible should be used; i.e., "0px 10px" will be returned instead
- * of "0px 10px 0px 10px".
- * <p> If the value of a shorthand property can not be decomposed into its
- * component longhand properties, as is the case for the <code>font</code>
- * property with a value of "menu", querying for the values of the component
- * longhand properties should return the empty string.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSS2Properties {
- /**
- * See the azimuth property definition in CSS2.
- */
- public String getAzimuth();
- /**
- * See the azimuth property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setAzimuth(String azimuth)
- throws DOMException;
-
- /**
- * See the background property definition in CSS2.
- */
- public String getBackground();
- /**
- * See the background property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackground(String background)
- throws DOMException;
-
- /**
- * See the background-attachment property definition in CSS2.
- */
- public String getBackgroundAttachment();
- /**
- * See the background-attachment property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackgroundAttachment(String backgroundAttachment)
- throws DOMException;
-
- /**
- * See the background-color property definition in CSS2.
- */
- public String getBackgroundColor();
- /**
- * See the background-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackgroundColor(String backgroundColor)
- throws DOMException;
-
- /**
- * See the background-image property definition in CSS2.
- */
- public String getBackgroundImage();
- /**
- * See the background-image property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackgroundImage(String backgroundImage)
- throws DOMException;
-
- /**
- * See the background-position property definition in CSS2.
- */
- public String getBackgroundPosition();
- /**
- * See the background-position property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackgroundPosition(String backgroundPosition)
- throws DOMException;
-
- /**
- * See the background-repeat property definition in CSS2.
- */
- public String getBackgroundRepeat();
- /**
- * See the background-repeat property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackgroundRepeat(String backgroundRepeat)
- throws DOMException;
-
- /**
- * See the border property definition in CSS2.
- */
- public String getBorder();
- /**
- * See the border property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorder(String border)
- throws DOMException;
-
- /**
- * See the border-collapse property definition in CSS2.
- */
- public String getBorderCollapse();
- /**
- * See the border-collapse property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderCollapse(String borderCollapse)
- throws DOMException;
-
- /**
- * See the border-color property definition in CSS2.
- */
- public String getBorderColor();
- /**
- * See the border-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderColor(String borderColor)
- throws DOMException;
-
- /**
- * See the border-spacing property definition in CSS2.
- */
- public String getBorderSpacing();
- /**
- * See the border-spacing property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderSpacing(String borderSpacing)
- throws DOMException;
-
- /**
- * See the border-style property definition in CSS2.
- */
- public String getBorderStyle();
- /**
- * See the border-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderStyle(String borderStyle)
- throws DOMException;
-
- /**
- * See the border-top property definition in CSS2.
- */
- public String getBorderTop();
- /**
- * See the border-top property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderTop(String borderTop)
- throws DOMException;
-
- /**
- * See the border-right property definition in CSS2.
- */
- public String getBorderRight();
- /**
- * See the border-right property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderRight(String borderRight)
- throws DOMException;
-
- /**
- * See the border-bottom property definition in CSS2.
- */
- public String getBorderBottom();
- /**
- * See the border-bottom property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderBottom(String borderBottom)
- throws DOMException;
-
- /**
- * See the border-left property definition in CSS2.
- */
- public String getBorderLeft();
- /**
- * See the border-left property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderLeft(String borderLeft)
- throws DOMException;
-
- /**
- * See the border-top-color property definition in CSS2.
- */
- public String getBorderTopColor();
- /**
- * See the border-top-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderTopColor(String borderTopColor)
- throws DOMException;
-
- /**
- * See the border-right-color property definition in CSS2.
- */
- public String getBorderRightColor();
- /**
- * See the border-right-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderRightColor(String borderRightColor)
- throws DOMException;
-
- /**
- * See the border-bottom-color property definition in CSS2.
- */
- public String getBorderBottomColor();
- /**
- * See the border-bottom-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderBottomColor(String borderBottomColor)
- throws DOMException;
-
- /**
- * See the border-left-color property definition in CSS2.
- */
- public String getBorderLeftColor();
- /**
- * See the border-left-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderLeftColor(String borderLeftColor)
- throws DOMException;
-
- /**
- * See the border-top-style property definition in CSS2.
- */
- public String getBorderTopStyle();
- /**
- * See the border-top-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderTopStyle(String borderTopStyle)
- throws DOMException;
-
- /**
- * See the border-right-style property definition in CSS2.
- */
- public String getBorderRightStyle();
- /**
- * See the border-right-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderRightStyle(String borderRightStyle)
- throws DOMException;
-
- /**
- * See the border-bottom-style property definition in CSS2.
- */
- public String getBorderBottomStyle();
- /**
- * See the border-bottom-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderBottomStyle(String borderBottomStyle)
- throws DOMException;
-
- /**
- * See the border-left-style property definition in CSS2.
- */
- public String getBorderLeftStyle();
- /**
- * See the border-left-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderLeftStyle(String borderLeftStyle)
- throws DOMException;
-
- /**
- * See the border-top-width property definition in CSS2.
- */
- public String getBorderTopWidth();
- /**
- * See the border-top-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderTopWidth(String borderTopWidth)
- throws DOMException;
-
- /**
- * See the border-right-width property definition in CSS2.
- */
- public String getBorderRightWidth();
- /**
- * See the border-right-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderRightWidth(String borderRightWidth)
- throws DOMException;
-
- /**
- * See the border-bottom-width property definition in CSS2.
- */
- public String getBorderBottomWidth();
- /**
- * See the border-bottom-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderBottomWidth(String borderBottomWidth)
- throws DOMException;
-
- /**
- * See the border-left-width property definition in CSS2.
- */
- public String getBorderLeftWidth();
- /**
- * See the border-left-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderLeftWidth(String borderLeftWidth)
- throws DOMException;
-
- /**
- * See the border-width property definition in CSS2.
- */
- public String getBorderWidth();
- /**
- * See the border-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderWidth(String borderWidth)
- throws DOMException;
-
- /**
- * See the bottom property definition in CSS2.
- */
- public String getBottom();
- /**
- * See the bottom property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBottom(String bottom)
- throws DOMException;
-
- /**
- * See the caption-side property definition in CSS2.
- */
- public String getCaptionSide();
- /**
- * See the caption-side property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCaptionSide(String captionSide)
- throws DOMException;
-
- /**
- * See the clear property definition in CSS2.
- */
- public String getClear();
- /**
- * See the clear property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setClear(String clear)
- throws DOMException;
-
- /**
- * See the clip property definition in CSS2.
- */
- public String getClip();
- /**
- * See the clip property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setClip(String clip)
- throws DOMException;
-
- /**
- * See the color property definition in CSS2.
- */
- public String getColor();
- /**
- * See the color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setColor(String color)
- throws DOMException;
-
- /**
- * See the content property definition in CSS2.
- */
- public String getContent();
- /**
- * See the content property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setContent(String content)
- throws DOMException;
-
- /**
- * See the counter-increment property definition in CSS2.
- */
- public String getCounterIncrement();
- /**
- * See the counter-increment property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCounterIncrement(String counterIncrement)
- throws DOMException;
-
- /**
- * See the counter-reset property definition in CSS2.
- */
- public String getCounterReset();
- /**
- * See the counter-reset property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCounterReset(String counterReset)
- throws DOMException;
-
- /**
- * See the cue property definition in CSS2.
- */
- public String getCue();
- /**
- * See the cue property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCue(String cue)
- throws DOMException;
-
- /**
- * See the cue-after property definition in CSS2.
- */
- public String getCueAfter();
- /**
- * See the cue-after property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCueAfter(String cueAfter)
- throws DOMException;
-
- /**
- * See the cue-before property definition in CSS2.
- */
- public String getCueBefore();
- /**
- * See the cue-before property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCueBefore(String cueBefore)
- throws DOMException;
-
- /**
- * See the cursor property definition in CSS2.
- */
- public String getCursor();
- /**
- * See the cursor property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCursor(String cursor)
- throws DOMException;
-
- /**
- * See the direction property definition in CSS2.
- */
- public String getDirection();
- /**
- * See the direction property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setDirection(String direction)
- throws DOMException;
-
- /**
- * See the display property definition in CSS2.
- */
- public String getDisplay();
- /**
- * See the display property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setDisplay(String display)
- throws DOMException;
-
- /**
- * See the elevation property definition in CSS2.
- */
- public String getElevation();
- /**
- * See the elevation property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setElevation(String elevation)
- throws DOMException;
-
- /**
- * See the empty-cells property definition in CSS2.
- */
- public String getEmptyCells();
- /**
- * See the empty-cells property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setEmptyCells(String emptyCells)
- throws DOMException;
-
- /**
- * See the float property definition in CSS2.
- */
- public String getCssFloat();
- /**
- * See the float property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCssFloat(String cssFloat)
- throws DOMException;
-
- /**
- * See the font property definition in CSS2.
- */
- public String getFont();
- /**
- * See the font property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFont(String font)
- throws DOMException;
-
- /**
- * See the font-family property definition in CSS2.
- */
- public String getFontFamily();
- /**
- * See the font-family property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontFamily(String fontFamily)
- throws DOMException;
-
- /**
- * See the font-size property definition in CSS2.
- */
- public String getFontSize();
- /**
- * See the font-size property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontSize(String fontSize)
- throws DOMException;
-
- /**
- * See the font-size-adjust property definition in CSS2.
- */
- public String getFontSizeAdjust();
- /**
- * See the font-size-adjust property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontSizeAdjust(String fontSizeAdjust)
- throws DOMException;
-
- /**
- * See the font-stretch property definition in CSS2.
- */
- public String getFontStretch();
- /**
- * See the font-stretch property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontStretch(String fontStretch)
- throws DOMException;
-
- /**
- * See the font-style property definition in CSS2.
- */
- public String getFontStyle();
- /**
- * See the font-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontStyle(String fontStyle)
- throws DOMException;
-
- /**
- * See the font-variant property definition in CSS2.
- */
- public String getFontVariant();
- /**
- * See the font-variant property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontVariant(String fontVariant)
- throws DOMException;
-
- /**
- * See the font-weight property definition in CSS2.
- */
- public String getFontWeight();
- /**
- * See the font-weight property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontWeight(String fontWeight)
- throws DOMException;
-
- /**
- * See the height property definition in CSS2.
- */
- public String getHeight();
- /**
- * See the height property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setHeight(String height)
- throws DOMException;
-
- /**
- * See the left property definition in CSS2.
- */
- public String getLeft();
- /**
- * See the left property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setLeft(String left)
- throws DOMException;
-
- /**
- * See the letter-spacing property definition in CSS2.
- */
- public String getLetterSpacing();
- /**
- * See the letter-spacing property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setLetterSpacing(String letterSpacing)
- throws DOMException;
-
- /**
- * See the line-height property definition in CSS2.
- */
- public String getLineHeight();
- /**
- * See the line-height property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setLineHeight(String lineHeight)
- throws DOMException;
-
- /**
- * See the list-style property definition in CSS2.
- */
- public String getListStyle();
- /**
- * See the list-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setListStyle(String listStyle)
- throws DOMException;
-
- /**
- * See the list-style-image property definition in CSS2.
- */
- public String getListStyleImage();
- /**
- * See the list-style-image property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setListStyleImage(String listStyleImage)
- throws DOMException;
-
- /**
- * See the list-style-position property definition in CSS2.
- */
- public String getListStylePosition();
- /**
- * See the list-style-position property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setListStylePosition(String listStylePosition)
- throws DOMException;
-
- /**
- * See the list-style-type property definition in CSS2.
- */
- public String getListStyleType();
- /**
- * See the list-style-type property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setListStyleType(String listStyleType)
- throws DOMException;
-
- /**
- * See the margin property definition in CSS2.
- */
- public String getMargin();
- /**
- * See the margin property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMargin(String margin)
- throws DOMException;
-
- /**
- * See the margin-top property definition in CSS2.
- */
- public String getMarginTop();
- /**
- * See the margin-top property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarginTop(String marginTop)
- throws DOMException;
-
- /**
- * See the margin-right property definition in CSS2.
- */
- public String getMarginRight();
- /**
- * See the margin-right property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarginRight(String marginRight)
- throws DOMException;
-
- /**
- * See the margin-bottom property definition in CSS2.
- */
- public String getMarginBottom();
- /**
- * See the margin-bottom property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarginBottom(String marginBottom)
- throws DOMException;
-
- /**
- * See the margin-left property definition in CSS2.
- */
- public String getMarginLeft();
- /**
- * See the margin-left property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarginLeft(String marginLeft)
- throws DOMException;
-
- /**
- * See the marker-offset property definition in CSS2.
- */
- public String getMarkerOffset();
- /**
- * See the marker-offset property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarkerOffset(String markerOffset)
- throws DOMException;
-
- /**
- * See the marks property definition in CSS2.
- */
- public String getMarks();
- /**
- * See the marks property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarks(String marks)
- throws DOMException;
-
- /**
- * See the max-height property definition in CSS2.
- */
- public String getMaxHeight();
- /**
- * See the max-height property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMaxHeight(String maxHeight)
- throws DOMException;
-
- /**
- * See the max-width property definition in CSS2.
- */
- public String getMaxWidth();
- /**
- * See the max-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMaxWidth(String maxWidth)
- throws DOMException;
-
- /**
- * See the min-height property definition in CSS2.
- */
- public String getMinHeight();
- /**
- * See the min-height property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMinHeight(String minHeight)
- throws DOMException;
-
- /**
- * See the min-width property definition in CSS2.
- */
- public String getMinWidth();
- /**
- * See the min-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMinWidth(String minWidth)
- throws DOMException;
-
- /**
- * See the orphans property definition in CSS2.
- */
- public String getOrphans();
- /**
- * See the orphans property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOrphans(String orphans)
- throws DOMException;
-
- /**
- * See the outline property definition in CSS2.
- */
- public String getOutline();
- /**
- * See the outline property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOutline(String outline)
- throws DOMException;
-
- /**
- * See the outline-color property definition in CSS2.
- */
- public String getOutlineColor();
- /**
- * See the outline-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOutlineColor(String outlineColor)
- throws DOMException;
-
- /**
- * See the outline-style property definition in CSS2.
- */
- public String getOutlineStyle();
- /**
- * See the outline-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOutlineStyle(String outlineStyle)
- throws DOMException;
-
- /**
- * See the outline-width property definition in CSS2.
- */
- public String getOutlineWidth();
- /**
- * See the outline-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOutlineWidth(String outlineWidth)
- throws DOMException;
-
- /**
- * See the overflow property definition in CSS2.
- */
- public String getOverflow();
- /**
- * See the overflow property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOverflow(String overflow)
- throws DOMException;
-
- /**
- * See the padding property definition in CSS2.
- */
- public String getPadding();
- /**
- * See the padding property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPadding(String padding)
- throws DOMException;
-
- /**
- * See the padding-top property definition in CSS2.
- */
- public String getPaddingTop();
- /**
- * See the padding-top property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPaddingTop(String paddingTop)
- throws DOMException;
-
- /**
- * See the padding-right property definition in CSS2.
- */
- public String getPaddingRight();
- /**
- * See the padding-right property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPaddingRight(String paddingRight)
- throws DOMException;
-
- /**
- * See the padding-bottom property definition in CSS2.
- */
- public String getPaddingBottom();
- /**
- * See the padding-bottom property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPaddingBottom(String paddingBottom)
- throws DOMException;
-
- /**
- * See the padding-left property definition in CSS2.
- */
- public String getPaddingLeft();
- /**
- * See the padding-left property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPaddingLeft(String paddingLeft)
- throws DOMException;
-
- /**
- * See the page property definition in CSS2.
- */
- public String getPage();
- /**
- * See the page property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPage(String page)
- throws DOMException;
-
- /**
- * See the page-break-after property definition in CSS2.
- */
- public String getPageBreakAfter();
- /**
- * See the page-break-after property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPageBreakAfter(String pageBreakAfter)
- throws DOMException;
-
- /**
- * See the page-break-before property definition in CSS2.
- */
- public String getPageBreakBefore();
- /**
- * See the page-break-before property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPageBreakBefore(String pageBreakBefore)
- throws DOMException;
-
- /**
- * See the page-break-inside property definition in CSS2.
- */
- public String getPageBreakInside();
- /**
- * See the page-break-inside property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPageBreakInside(String pageBreakInside)
- throws DOMException;
-
- /**
- * See the pause property definition in CSS2.
- */
- public String getPause();
- /**
- * See the pause property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPause(String pause)
- throws DOMException;
-
- /**
- * See the pause-after property definition in CSS2.
- */
- public String getPauseAfter();
- /**
- * See the pause-after property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPauseAfter(String pauseAfter)
- throws DOMException;
-
- /**
- * See the pause-before property definition in CSS2.
- */
- public String getPauseBefore();
- /**
- * See the pause-before property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPauseBefore(String pauseBefore)
- throws DOMException;
-
- /**
- * See the pitch property definition in CSS2.
- */
- public String getPitch();
- /**
- * See the pitch property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPitch(String pitch)
- throws DOMException;
-
- /**
- * See the pitch-range property definition in CSS2.
- */
- public String getPitchRange();
- /**
- * See the pitch-range property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPitchRange(String pitchRange)
- throws DOMException;
-
- /**
- * See the play-during property definition in CSS2.
- */
- public String getPlayDuring();
- /**
- * See the play-during property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPlayDuring(String playDuring)
- throws DOMException;
-
- /**
- * See the position property definition in CSS2.
- */
- public String getPosition();
- /**
- * See the position property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPosition(String position)
- throws DOMException;
-
- /**
- * See the quotes property definition in CSS2.
- */
- public String getQuotes();
- /**
- * See the quotes property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setQuotes(String quotes)
- throws DOMException;
-
- /**
- * See the richness property definition in CSS2.
- */
- public String getRichness();
- /**
- * See the richness property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setRichness(String richness)
- throws DOMException;
-
- /**
- * See the right property definition in CSS2.
- */
- public String getRight();
- /**
- * See the right property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setRight(String right)
- throws DOMException;
-
- /**
- * See the size property definition in CSS2.
- */
- public String getSize();
- /**
- * See the size property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSize(String size)
- throws DOMException;
-
- /**
- * See the speak property definition in CSS2.
- */
- public String getSpeak();
- /**
- * See the speak property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSpeak(String speak)
- throws DOMException;
-
- /**
- * See the speak-header property definition in CSS2.
- */
- public String getSpeakHeader();
- /**
- * See the speak-header property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSpeakHeader(String speakHeader)
- throws DOMException;
-
- /**
- * See the speak-numeral property definition in CSS2.
- */
- public String getSpeakNumeral();
- /**
- * See the speak-numeral property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSpeakNumeral(String speakNumeral)
- throws DOMException;
-
- /**
- * See the speak-punctuation property definition in CSS2.
- */
- public String getSpeakPunctuation();
- /**
- * See the speak-punctuation property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSpeakPunctuation(String speakPunctuation)
- throws DOMException;
-
- /**
- * See the speech-rate property definition in CSS2.
- */
- public String getSpeechRate();
- /**
- * See the speech-rate property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSpeechRate(String speechRate)
- throws DOMException;
-
- /**
- * See the stress property definition in CSS2.
- */
- public String getStress();
- /**
- * See the stress property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setStress(String stress)
- throws DOMException;
-
- /**
- * See the table-layout property definition in CSS2.
- */
- public String getTableLayout();
- /**
- * See the table-layout property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTableLayout(String tableLayout)
- throws DOMException;
-
- /**
- * See the text-align property definition in CSS2.
- */
- public String getTextAlign();
- /**
- * See the text-align property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTextAlign(String textAlign)
- throws DOMException;
-
- /**
- * See the text-decoration property definition in CSS2.
- */
- public String getTextDecoration();
- /**
- * See the text-decoration property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTextDecoration(String textDecoration)
- throws DOMException;
-
- /**
- * See the text-indent property definition in CSS2.
- */
- public String getTextIndent();
- /**
- * See the text-indent property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTextIndent(String textIndent)
- throws DOMException;
-
- /**
- * See the text-shadow property definition in CSS2.
- */
- public String getTextShadow();
- /**
- * See the text-shadow property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTextShadow(String textShadow)
- throws DOMException;
-
- /**
- * See the text-transform property definition in CSS2.
- */
- public String getTextTransform();
- /**
- * See the text-transform property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTextTransform(String textTransform)
- throws DOMException;
-
- /**
- * See the top property definition in CSS2.
- */
- public String getTop();
- /**
- * See the top property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTop(String top)
- throws DOMException;
-
- /**
- * See the unicode-bidi property definition in CSS2.
- */
- public String getUnicodeBidi();
- /**
- * See the unicode-bidi property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setUnicodeBidi(String unicodeBidi)
- throws DOMException;
-
- /**
- * See the vertical-align property definition in CSS2.
- */
- public String getVerticalAlign();
- /**
- * See the vertical-align property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setVerticalAlign(String verticalAlign)
- throws DOMException;
-
- /**
- * See the visibility property definition in CSS2.
- */
- public String getVisibility();
- /**
- * See the visibility property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setVisibility(String visibility)
- throws DOMException;
-
- /**
- * See the voice-family property definition in CSS2.
- */
- public String getVoiceFamily();
- /**
- * See the voice-family property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setVoiceFamily(String voiceFamily)
- throws DOMException;
-
- /**
- * See the volume property definition in CSS2.
- */
- public String getVolume();
- /**
- * See the volume property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setVolume(String volume)
- throws DOMException;
-
- /**
- * See the white-space property definition in CSS2.
- */
- public String getWhiteSpace();
- /**
- * See the white-space property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setWhiteSpace(String whiteSpace)
- throws DOMException;
-
- /**
- * See the widows property definition in CSS2.
- */
- public String getWidows();
- /**
- * See the widows property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setWidows(String widows)
- throws DOMException;
-
- /**
- * See the width property definition in CSS2.
- */
- public String getWidth();
- /**
- * See the width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setWidth(String width)
- throws DOMException;
-
- /**
- * See the word-spacing property definition in CSS2.
- */
- public String getWordSpacing();
- /**
- * See the word-spacing property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setWordSpacing(String wordSpacing)
- throws DOMException;
-
- /**
- * See the z-index property definition in CSS2.
- */
- public String getZIndex();
- /**
- * See the z-index property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setZIndex(String zIndex)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSCharsetRule.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSCharsetRule.java
deleted file mode 100644
index 8c0defa4753..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSCharsetRule.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSCharsetRule</code> interface represents a @charset rule in a
- * CSS style sheet. The value of the <code>encoding</code> attribute does
- * not affect the encoding of text data in the DOM objects; this encoding is
- * always UTF-16. After a stylesheet is loaded, the value of the
- * <code>encoding</code> attribute is the value found in the
- * <code>@charset</code> rule. If there was no <code>@charset</code> in the
- * original document, then no <code>CSSCharsetRule</code> is created. The
- * value of the <code>encoding</code> attribute may also be used as a hint
- * for the encoding used on serialization of the style sheet.
- * <p> The value of the @charset rule (and therefore of the
- * <code>CSSCharsetRule</code>) may not correspond to the encoding the
- * document actually came in; character encoding information e.g. in an HTTP
- * header, has priority (see CSS document representation) but this is not
- * reflected in the <code>CSSCharsetRule</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSCharsetRule extends CSSRule {
- /**
- * The encoding information used in this <code>@charset</code> rule.
- */
- public String getEncoding();
- /**
- * The encoding information used in this <code>@charset</code> rule.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified encoding value has a syntax error
- * and is unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding rule is
- * readonly.
- */
- public void setEncoding(String encoding)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSFontFaceRule.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSFontFaceRule.java
deleted file mode 100644
index a1795706118..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSFontFaceRule.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>CSSFontFaceRule</code> interface represents a @font-face rule in
- * a CSS style sheet. The <code>@font-face</code> rule is used to hold a set
- * of font descriptions.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSFontFaceRule extends CSSRule {
- /**
- * The declaration-block of this rule.
- */
- public CSSStyleDeclaration getStyle();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSImportRule.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSImportRule.java
deleted file mode 100644
index e18ad569bcb..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSImportRule.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.stylesheets.MediaList;
-
-/**
- * The <code>CSSImportRule</code> interface represents a @import rule within
- * a CSS style sheet. The <code>@import</code> rule is used to import style
- * rules from other style sheets.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSImportRule extends CSSRule {
- /**
- * The location of the style sheet to be imported. The attribute will not
- * contain the <code>"url(...)"</code> specifier around the URI.
- */
- public String getHref();
-
- /**
- * A list of media types for which this style sheet may be used.
- */
- public MediaList getMedia();
-
- /**
- * The style sheet referred to by this rule, if it has been loaded. The
- * value of this attribute is <code>null</code> if the style sheet has
- * not yet been loaded or if it will not be loaded (e.g. if the style
- * sheet is for a media type not supported by the user agent).
- */
- public CSSStyleSheet getStyleSheet();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSMediaRule.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSMediaRule.java
deleted file mode 100644
index 68a73045ede..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSMediaRule.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.stylesheets.MediaList;
-
-/**
- * The <code>CSSMediaRule</code> interface represents a @media rule in a CSS
- * style sheet. A <code>@media</code> rule can be used to delimit style
- * rules for specific media types.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSMediaRule extends CSSRule {
- /**
- * A list of media types for this rule.
- */
- public MediaList getMedia();
-
- /**
- * A list of all CSS rules contained within the media block.
- */
- public CSSRuleList getCssRules();
-
- /**
- * Used to insert a new rule into the media block.
- * @param rule The parsable text representing the rule. For rule sets
- * this contains both the selector and the style declaration. For
- * at-rules, this specifies both the at-identifier and the rule
- * content.
- * @param index The index within the media block's rule collection of
- * the rule before which to insert the specified rule. If the
- * specified index is equal to the length of the media blocks's rule
- * collection, the rule will be added to the end of the media block.
- * @return The index within the media block's rule collection of the
- * newly inserted rule.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the
- * specified index, e.g., if an <code>@import</code> rule is inserted
- * after a standard rule set or other at-rule.
- * <br>INDEX_SIZE_ERR: Raised if the specified index is not a valid
- * insertion point.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is
- * readonly.
- * <br>SYNTAX_ERR: Raised if the specified rule has a syntax error and
- * is unparsable.
- */
- public int insertRule(String rule,
- int index)
- throws DOMException;
-
- /**
- * Used to delete a rule from the media block.
- * @param index The index within the media block's rule collection of
- * the rule to remove.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index does not correspond to
- * a rule in the media rule list.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is
- * readonly.
- */
- public void deleteRule(int index)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSPageRule.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSPageRule.java
deleted file mode 100644
index 538626a97e9..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSPageRule.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSPageRule</code> interface represents a @page rule within a
- * CSS style sheet. The <code>@page</code> rule is used to specify the
- * dimensions, orientation, margins, etc. of a page box for paged media.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSPageRule extends CSSRule {
- /**
- * The parsable textual representation of the page selector for the rule.
- */
- public String getSelectorText();
- /**
- * The parsable textual representation of the page selector for the rule.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
- * error and is unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is readonly.
- */
- public void setSelectorText(String selectorText)
- throws DOMException;
-
- /**
- * The declaration-block of this rule.
- */
- public CSSStyleDeclaration getStyle();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSPrimitiveValue.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSPrimitiveValue.java
deleted file mode 100644
index 4131d26cda3..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSPrimitiveValue.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSPrimitiveValue</code> interface represents a single CSS value
- * . This interface may be used to determine the value of a specific style
- * property currently set in a block or to set a specific style property
- * explicitly within the block. An instance of this interface might be
- * obtained from the <code>getPropertyCSSValue</code> method of the
- * <code>CSSStyleDeclaration</code> interface. A
- * <code>CSSPrimitiveValue</code> object only occurs in a context of a CSS
- * property.
- * <p> Conversions are allowed between absolute values (from millimeters to
- * centimeters, from degrees to radians, and so on) but not between relative
- * values. (For example, a pixel value cannot be converted to a centimeter
- * value.) Percentage values can't be converted since they are relative to
- * the parent value (or another property value). There is one exception for
- * color percentage values: since a color percentage value is relative to
- * the range 0-255, a color percentage value can be converted to a number;
- * (see also the <code>RGBColor</code> interface).
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSPrimitiveValue extends CSSValue {
- // UnitTypes
- /**
- * The value is not a recognized CSS2 value. The value can only be
- * obtained by using the <code>cssText</code> attribute.
- */
- public static final short CSS_UNKNOWN = 0;
- /**
- * The value is a simple number. The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_NUMBER = 1;
- /**
- * The value is a percentage. The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_PERCENTAGE = 2;
- /**
- * The value is a length (ems). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_EMS = 3;
- /**
- * The value is a length (exs). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_EXS = 4;
- /**
- * The value is a length (px). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_PX = 5;
- /**
- * The value is a length (cm). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_CM = 6;
- /**
- * The value is a length (mm). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_MM = 7;
- /**
- * The value is a length (in). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_IN = 8;
- /**
- * The value is a length (pt). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_PT = 9;
- /**
- * The value is a length (pc). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_PC = 10;
- /**
- * The value is an angle (deg). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_DEG = 11;
- /**
- * The value is an angle (rad). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_RAD = 12;
- /**
- * The value is an angle (grad). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_GRAD = 13;
- /**
- * The value is a time (ms). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_MS = 14;
- /**
- * The value is a time (s). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_S = 15;
- /**
- * The value is a frequency (Hz). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_HZ = 16;
- /**
- * The value is a frequency (kHz). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_KHZ = 17;
- /**
- * The value is a number with an unknown dimension. The value can be
- * obtained by using the <code>getFloatValue</code> method.
- */
- public static final short CSS_DIMENSION = 18;
- /**
- * The value is a STRING. The value can be obtained by using the
- * <code>getStringValue</code> method.
- */
- public static final short CSS_STRING = 19;
- /**
- * The value is a URI. The value can be obtained by using the
- * <code>getStringValue</code> method.
- */
- public static final short CSS_URI = 20;
- /**
- * The value is an identifier. The value can be obtained by using the
- * <code>getStringValue</code> method.
- */
- public static final short CSS_IDENT = 21;
- /**
- * The value is a attribute function. The value can be obtained by using
- * the <code>getStringValue</code> method.
- */
- public static final short CSS_ATTR = 22;
- /**
- * The value is a counter or counters function. The value can be obtained
- * by using the <code>getCounterValue</code> method.
- */
- public static final short CSS_COUNTER = 23;
- /**
- * The value is a rect function. The value can be obtained by using the
- * <code>getRectValue</code> method.
- */
- public static final short CSS_RECT = 24;
- /**
- * The value is a RGB color. The value can be obtained by using the
- * <code>getRGBColorValue</code> method.
- */
- public static final short CSS_RGBCOLOR = 25;
-
- /**
- * The type of the value as defined by the constants specified above.
- */
- public short getPrimitiveType();
-
- /**
- * A method to set the float value with a specified unit. If the property
- * attached with this value can not accept the specified unit or the
- * float value, the value will be unchanged and a
- * <code>DOMException</code> will be raised.
- * @param unitType A unit code as defined above. The unit code can only
- * be a float unit type (i.e. <code>CSS_NUMBER</code>,
- * <code>CSS_PERCENTAGE</code>, <code>CSS_EMS</code>,
- * <code>CSS_EXS</code>, <code>CSS_PX</code>, <code>CSS_CM</code>,
- * <code>CSS_MM</code>, <code>CSS_IN</code>, <code>CSS_PT</code>,
- * <code>CSS_PC</code>, <code>CSS_DEG</code>, <code>CSS_RAD</code>,
- * <code>CSS_GRAD</code>, <code>CSS_MS</code>, <code>CSS_S</code>,
- * <code>CSS_HZ</code>, <code>CSS_KHZ</code>,
- * <code>CSS_DIMENSION</code>).
- * @param floatValue The new float value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the attached property doesn't support
- * the float value or the unit type.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFloatValue(short unitType,
- float floatValue)
- throws DOMException;
-
- /**
- * This method is used to get a float value in a specified unit. If this
- * CSS value doesn't contain a float value or can't be converted into
- * the specified unit, a <code>DOMException</code> is raised.
- * @param unitType A unit code to get the float value. The unit code can
- * only be a float unit type (i.e. <code>CSS_NUMBER</code>,
- * <code>CSS_PERCENTAGE</code>, <code>CSS_EMS</code>,
- * <code>CSS_EXS</code>, <code>CSS_PX</code>, <code>CSS_CM</code>,
- * <code>CSS_MM</code>, <code>CSS_IN</code>, <code>CSS_PT</code>,
- * <code>CSS_PC</code>, <code>CSS_DEG</code>, <code>CSS_RAD</code>,
- * <code>CSS_GRAD</code>, <code>CSS_MS</code>, <code>CSS_S</code>,
- * <code>CSS_HZ</code>, <code>CSS_KHZ</code>,
- * <code>CSS_DIMENSION</code>).
- * @return The float value in the specified unit.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a float
- * value or if the float value can't be converted into the specified
- * unit.
- */
- public float getFloatValue(short unitType)
- throws DOMException;
-
- /**
- * A method to set the string value with the specified unit. If the
- * property attached to this value can't accept the specified unit or
- * the string value, the value will be unchanged and a
- * <code>DOMException</code> will be raised.
- * @param stringType A string code as defined above. The string code can
- * only be a string unit type (i.e. <code>CSS_STRING</code>,
- * <code>CSS_URI</code>, <code>CSS_IDENT</code>, and
- * <code>CSS_ATTR</code>).
- * @param stringValue The new string value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string
- * value or if the string value can't be converted into the specified
- * unit.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setStringValue(short stringType,
- String stringValue)
- throws DOMException;
-
- /**
- * This method is used to get the string value. If the CSS value doesn't
- * contain a string value, a <code>DOMException</code> is raised. Some
- * properties (like 'font-family' or 'voice-family') convert a
- * whitespace separated list of idents to a string.
- * @return The string value in the current unit. The current
- * <code>primitiveType</code> can only be a string unit type (i.e.
- * <code>CSS_STRING</code>, <code>CSS_URI</code>,
- * <code>CSS_IDENT</code> and <code>CSS_ATTR</code>).
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string
- * value.
- */
- public String getStringValue()
- throws DOMException;
-
- /**
- * This method is used to get the Counter value. If this CSS value
- * doesn't contain a counter value, a <code>DOMException</code> is
- * raised. Modification to the corresponding style property can be
- * achieved using the <code>Counter</code> interface.
- * @return The Counter value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a
- * Counter value (e.g. this is not <code>CSS_COUNTER</code>).
- */
- public Counter getCounterValue()
- throws DOMException;
-
- /**
- * This method is used to get the Rect value. If this CSS value doesn't
- * contain a rect value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved
- * using the <code>Rect</code> interface.
- * @return The Rect value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Rect
- * value. (e.g. this is not <code>CSS_RECT</code>).
- */
- public Rect getRectValue()
- throws DOMException;
-
- /**
- * This method is used to get the RGB color. If this CSS value doesn't
- * contain a RGB color value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved
- * using the <code>RGBColor</code> interface.
- * @return the RGB color value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the attached property can't return a
- * RGB color value (e.g. this is not <code>CSS_RGBCOLOR</code>).
- */
- public RGBColor getRGBColorValue()
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSRule.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSRule.java
deleted file mode 100644
index 788f946eca5..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSRule.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSRule</code> interface is the abstract base interface for any
- * type of CSS statement. This includes both rule sets and at-rules. An
- * implementation is expected to preserve all rules specified in a CSS style
- * sheet, even if the rule is not recognized by the parser. Unrecognized
- * rules are represented using the <code>CSSUnknownRule</code> interface.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSRule {
- // RuleType
- /**
- * The rule is a <code>CSSUnknownRule</code>.
- */
- public static final short UNKNOWN_RULE = 0;
- /**
- * The rule is a <code>CSSStyleRule</code>.
- */
- public static final short STYLE_RULE = 1;
- /**
- * The rule is a <code>CSSCharsetRule</code>.
- */
- public static final short CHARSET_RULE = 2;
- /**
- * The rule is a <code>CSSImportRule</code>.
- */
- public static final short IMPORT_RULE = 3;
- /**
- * The rule is a <code>CSSMediaRule</code>.
- */
- public static final short MEDIA_RULE = 4;
- /**
- * The rule is a <code>CSSFontFaceRule</code>.
- */
- public static final short FONT_FACE_RULE = 5;
- /**
- * The rule is a <code>CSSPageRule</code>.
- */
- public static final short PAGE_RULE = 6;
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType();
-
- /**
- * The parsable textual representation of the rule. This reflects the
- * current state of the rule and not its initial value.
- */
- public String getCssText();
- /**
- * The parsable textual representation of the rule. This reflects the
- * current state of the rule and not its initial value.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
- * error and is unparsable.
- * <br>INVALID_MODIFICATION_ERR: Raised if the specified CSS string
- * value represents a different type of rule than the current one.
- * <br>HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at
- * this point in the style sheet.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if the rule is readonly.
- */
- public void setCssText(String cssText)
- throws DOMException;
-
- /**
- * The style sheet that contains this rule.
- */
- public CSSStyleSheet getParentStyleSheet();
-
- /**
- * If this rule is contained inside another rule (e.g. a style rule
- * inside an @media block), this is the containing rule. If this rule is
- * not nested inside any other rules, this returns <code>null</code>.
- */
- public CSSRule getParentRule();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSRuleList.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSRuleList.java
deleted file mode 100644
index 41c2c68377c..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSRuleList.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>CSSRuleList</code> interface provides the abstraction of an
- * ordered collection of CSS rules.
- * <p> The items in the <code>CSSRuleList</code> are accessible via an
- * integral index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSRuleList {
- /**
- * The number of <code>CSSRules</code> in the list. The range of valid
- * child rule indices is <code>0</code> to <code>length-1</code>
- * inclusive.
- */
- public int getLength();
-
- /**
- * Used to retrieve a CSS rule by ordinal index. The order in this
- * collection represents the order of the rules in the CSS style sheet.
- * If index is greater than or equal to the number of rules in the list,
- * this returns <code>null</code>.
- * @param index Index into the collection
- * @return The style rule at the <code>index</code> position in the
- * <code>CSSRuleList</code>, or <code>null</code> if that is not a
- * valid index.
- */
- public CSSRule item(int index);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleDeclaration.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleDeclaration.java
deleted file mode 100644
index e5e346b0a71..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleDeclaration.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSStyleDeclaration</code> interface represents a single CSS
- * declaration block. This interface may be used to determine the style
- * properties currently set in a block or to set style properties explicitly
- * within the block.
- * <p> While an implementation may not recognize all CSS properties within a
- * CSS declaration block, it is expected to provide access to all specified
- * properties in the style sheet through the <code>CSSStyleDeclaration</code>
- * interface. Furthermore, implementations that support a specific level of
- * CSS should correctly handle CSS shorthand properties for that level. For
- * a further discussion of shorthand properties, see the
- * <code>CSS2Properties</code> interface.
- * <p> This interface is also used to provide a read-only access to the
- * computed values of an element. See also the <code>ViewCSS</code>
- * interface. The CSS Object Model doesn't provide an access to the
- * specified or actual values of the CSS cascade.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSStyleDeclaration {
- /**
- * The parsable textual representation of the declaration block
- * (excluding the surrounding curly braces). Setting this attribute will
- * result in the parsing of the new value and resetting of all the
- * properties in the declaration block including the removal or addition
- * of properties.
- */
- public String getCssText();
- /**
- * The parsable textual representation of the declaration block
- * (excluding the surrounding curly braces). Setting this attribute will
- * result in the parsing of the new value and resetting of all the
- * properties in the declaration block including the removal or addition
- * of properties.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
- * error and is unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is
- * readonly or a property is readonly.
- */
- public void setCssText(String cssText)
- throws DOMException;
-
- /**
- * Used to retrieve the value of a CSS property if it has been explicitly
- * set within this declaration block.
- * @param propertyName The name of the CSS property. See the CSS
- * property index.
- * @return Returns the value of the property if it has been explicitly
- * set for this declaration block. Returns the empty string if the
- * property has not been set.
- */
- public String getPropertyValue(String propertyName);
-
- /**
- * Used to retrieve the object representation of the value of a CSS
- * property if it has been explicitly set within this declaration block.
- * This method returns <code>null</code> if the property is a shorthand
- * property. Shorthand property values can only be accessed and modified
- * as strings, using the <code>getPropertyValue</code> and
- * <code>setProperty</code> methods.
- * @param propertyName The name of the CSS property. See the CSS
- * property index.
- * @return Returns the value of the property if it has been explicitly
- * set for this declaration block. Returns <code>null</code> if the
- * property has not been set.
- */
- public CSSValue getPropertyCSSValue(String propertyName);
-
- /**
- * Used to remove a CSS property if it has been explicitly set within
- * this declaration block.
- * @param propertyName The name of the CSS property. See the CSS
- * property index.
- * @return Returns the value of the property if it has been explicitly
- * set for this declaration block. Returns the empty string if the
- * property has not been set or the property name does not correspond
- * to a known CSS property.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly
- * or the property is readonly.
- */
- public String removeProperty(String propertyName)
- throws DOMException;
-
- /**
- * Used to retrieve the priority of a CSS property (e.g. the
- * <code>"important"</code> qualifier) if the priority has been
- * explicitly set in this declaration block.
- * @param propertyName The name of the CSS property. See the CSS
- * property index.
- * @return A string representing the priority (e.g.
- * <code>"important"</code>) if the property has been explicitly set
- * in this declaration block and has a priority specified. The empty
- * string otherwise.
- */
- public String getPropertyPriority(String propertyName);
-
- /**
- * Used to set a property value and priority within this declaration
- * block. <code>setProperty</code> permits to modify a property or add a
- * new one in the declaration block. Any call to this method may modify
- * the order of properties in the <code>item</code> method.
- * @param propertyName The name of the CSS property. See the CSS
- * property index.
- * @param value The new value of the property.
- * @param priority The new priority of the property (e.g.
- * <code>"important"</code>) or the empty string if none.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is
- * readonly or the property is readonly.
- */
- public void setProperty(String propertyName,
- String value,
- String priority)
- throws DOMException;
-
- /**
- * The number of properties that have been explicitly set in this
- * declaration block. The range of valid indices is 0 to length-1
- * inclusive.
- */
- public int getLength();
-
- /**
- * Used to retrieve the properties that have been explicitly set in this
- * declaration block. The order of the properties retrieved using this
- * method does not have to be the order in which they were set. This
- * method can be used to iterate over all properties in this declaration
- * block.
- * @param index Index of the property name to retrieve.
- * @return The name of the property at this ordinal position. The empty
- * string if no property exists at this position.
- */
- public String item(int index);
-
- /**
- * The CSS rule that contains this declaration block or <code>null</code>
- * if this <code>CSSStyleDeclaration</code> is not attached to a
- * <code>CSSRule</code>.
- */
- public CSSRule getParentRule();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleRule.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleRule.java
deleted file mode 100644
index 626f3224b4c..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleRule.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSStyleRule</code> interface represents a single rule set in a
- * CSS style sheet.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSStyleRule extends CSSRule {
- /**
- * The textual representation of the selector for the rule set. The
- * implementation may have stripped out insignificant whitespace while
- * parsing the selector.
- */
- public String getSelectorText();
- /**
- * The textual representation of the selector for the rule set. The
- * implementation may have stripped out insignificant whitespace while
- * parsing the selector.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
- * error and is unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is readonly.
- */
- public void setSelectorText(String selectorText)
- throws DOMException;
-
- /**
- * The declaration-block of this rule set.
- */
- public CSSStyleDeclaration getStyle();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleSheet.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleSheet.java
deleted file mode 100644
index b529e5db089..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSStyleSheet.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- * The <code>CSSStyleSheet</code> interface is a concrete interface used to
- * represent a CSS style sheet i.e., a style sheet whose content type is
- * "text/css".
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSStyleSheet extends StyleSheet {
- /**
- * If this style sheet comes from an <code>@import</code> rule, the
- * <code>ownerRule</code> attribute will contain the
- * <code>CSSImportRule</code>. In that case, the <code>ownerNode</code>
- * attribute in the <code>StyleSheet</code> interface will be
- * <code>null</code>. If the style sheet comes from an element or a
- * processing instruction, the <code>ownerRule</code> attribute will be
- * <code>null</code> and the <code>ownerNode</code> attribute will
- * contain the <code>Node</code>.
- */
- public CSSRule getOwnerRule();
-
- /**
- * The list of all CSS rules contained within the style sheet. This
- * includes both rule sets and at-rules.
- */
- public CSSRuleList getCssRules();
-
- /**
- * Used to insert a new rule into the style sheet. The new rule now
- * becomes part of the cascade.
- * @param rule The parsable text representing the rule. For rule sets
- * this contains both the selector and the style declaration. For
- * at-rules, this specifies both the at-identifier and the rule
- * content.
- * @param index The index within the style sheet's rule list of the rule
- * before which to insert the specified rule. If the specified index
- * is equal to the length of the style sheet's rule collection, the
- * rule will be added to the end of the style sheet.
- * @return The index within the style sheet's rule collection of the
- * newly inserted rule.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the
- * specified index e.g. if an <code>@import</code> rule is inserted
- * after a standard rule set or other at-rule.
- * <br>INDEX_SIZE_ERR: Raised if the specified index is not a valid
- * insertion point.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly.
- * <br>SYNTAX_ERR: Raised if the specified rule has a syntax error and
- * is unparsable.
- */
- public int insertRule(String rule,
- int index)
- throws DOMException;
-
- /**
- * Used to delete a rule from the style sheet.
- * @param index The index within the style sheet's rule list of the rule
- * to remove.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index does not correspond to
- * a rule in the style sheet's rule list.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly.
- */
- public void deleteRule(int index)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSUnknownRule.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSUnknownRule.java
deleted file mode 100644
index 763d5f1b61f..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSUnknownRule.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>CSSUnknownRule</code> interface represents an at-rule not
- * supported by this user agent.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSUnknownRule extends CSSRule {
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSValue.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSValue.java
deleted file mode 100644
index 0285bcc7721..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSValue.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSValue</code> interface represents a simple or a complex
- * value. A <code>CSSValue</code> object only occurs in a context of a CSS
- * property.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSValue {
- // UnitTypes
- /**
- * The value is inherited and the <code>cssText</code> contains "inherit".
- */
- public static final short CSS_INHERIT = 0;
- /**
- * The value is a primitive value and an instance of the
- * <code>CSSPrimitiveValue</code> interface can be obtained by using
- * binding-specific casting methods on this instance of the
- * <code>CSSValue</code> interface.
- */
- public static final short CSS_PRIMITIVE_VALUE = 1;
- /**
- * The value is a <code>CSSValue</code> list and an instance of the
- * <code>CSSValueList</code> interface can be obtained by using
- * binding-specific casting methods on this instance of the
- * <code>CSSValue</code> interface.
- */
- public static final short CSS_VALUE_LIST = 2;
- /**
- * The value is a custom value.
- */
- public static final short CSS_CUSTOM = 3;
-
- /**
- * A string representation of the current value.
- */
- public String getCssText();
- /**
- * A string representation of the current value.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
- * error (according to the attached property) or is unparsable.
- * <br>INVALID_MODIFICATION_ERR: Raised if the specified CSS string
- * value represents a different type of values than the values allowed
- * by the CSS property.
- * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this value is readonly.
- */
- public void setCssText(String cssText)
- throws DOMException;
-
- /**
- * A code defining the type of the value as defined above.
- */
- public short getCssValueType();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/CSSValueList.java b/libjava/external/w3c_dom/org/w3c/dom/css/CSSValueList.java
deleted file mode 100644
index bf15bb3ebfd..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/CSSValueList.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>CSSValueList</code> interface provides the abstraction of an
- * ordered collection of CSS values.
- * <p> Some properties allow an empty list into their syntax. In that case,
- * these properties take the <code>none</code> identifier. So, an empty list
- * means that the property has the value <code>none</code>.
- * <p> The items in the <code>CSSValueList</code> are accessible via an
- * integral index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSValueList extends CSSValue {
- /**
- * The number of <code>CSSValues</code> in the list. The range of valid
- * values of the indices is <code>0</code> to <code>length-1</code>
- * inclusive.
- */
- public int getLength();
-
- /**
- * Used to retrieve a <code>CSSValue</code> by ordinal index. The order in
- * this collection represents the order of the values in the CSS style
- * property. If index is greater than or equal to the number of values
- * in the list, this returns <code>null</code>.
- * @param index Index into the collection.
- * @return The <code>CSSValue</code> at the <code>index</code> position
- * in the <code>CSSValueList</code>, or <code>null</code> if that is
- * not a valid index.
- */
- public CSSValue item(int index);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/Counter.java b/libjava/external/w3c_dom/org/w3c/dom/css/Counter.java
deleted file mode 100644
index 8cd4967b32d..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/Counter.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>Counter</code> interface is used to represent any counter or
- * counters function value. This interface reflects the values in the
- * underlying style property.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface Counter {
- /**
- * This attribute is used for the identifier of the counter.
- */
- public String getIdentifier();
-
- /**
- * This attribute is used for the style of the list.
- */
- public String getListStyle();
-
- /**
- * This attribute is used for the separator of the nested counters.
- */
- public String getSeparator();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/DOMImplementationCSS.java b/libjava/external/w3c_dom/org/w3c/dom/css/DOMImplementationCSS.java
deleted file mode 100644
index 65c97291ef4..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/DOMImplementationCSS.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.DOMException;
-
-/**
- * This interface allows the DOM user to create a <code>CSSStyleSheet</code>
- * outside the context of a document. There is no way to associate the new
- * <code>CSSStyleSheet</code> with a document in DOM Level 2.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface DOMImplementationCSS extends DOMImplementation {
- /**
- * Creates a new <code>CSSStyleSheet</code>.
- * @param title The advisory title. See also the section.
- * @param media The comma-separated list of media associated with the
- * new style sheet. See also the section.
- * @return A new CSS style sheet.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified media string value has a syntax
- * error and is unparsable.
- */
- public CSSStyleSheet createCSSStyleSheet(String title,
- String media)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/DocumentCSS.java b/libjava/external/w3c_dom/org/w3c/dom/css/DocumentCSS.java
deleted file mode 100644
index 8fe93c79a7e..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/DocumentCSS.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.stylesheets.DocumentStyle;
-
-/**
- * This interface represents a document with a CSS view.
- * <p> The <code>getOverrideStyle</code> method provides a mechanism through
- * which a DOM author could effect immediate change to the style of an
- * element without modifying the explicitly linked style sheets of a
- * document or the inline style of elements in the style sheets. This style
- * sheet comes after the author style sheet in the cascade algorithm and is
- * called override style sheet. The override style sheet takes precedence
- * over author style sheets. An "!important" declaration still takes
- * precedence over a normal declaration. Override, author, and user style
- * sheets all may contain "!important" declarations. User "!important" rules
- * take precedence over both override and author "!important" rules, and
- * override "!important" rules take precedence over author "!important"
- * rules.
- * <p> The expectation is that an instance of the <code>DocumentCSS</code>
- * interface can be obtained by using binding-specific casting methods on an
- * instance of the <code>Document</code> interface.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentCSS extends DocumentStyle {
- /**
- * This method is used to retrieve the override style declaration for a
- * specified element and a specified pseudo-element.
- * @param elt The element whose style is to be modified. This parameter
- * cannot be null.
- * @param pseudoElt The pseudo-element or <code>null</code> if none.
- * @return The override style declaration.
- */
- public CSSStyleDeclaration getOverrideStyle(Element elt,
- String pseudoElt);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/ElementCSSInlineStyle.java b/libjava/external/w3c_dom/org/w3c/dom/css/ElementCSSInlineStyle.java
deleted file mode 100644
index 98b60bf9ddf..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/ElementCSSInlineStyle.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * Inline style information attached to elements is exposed through the
- * <code>style</code> attribute. This represents the contents of the STYLE
- * attribute for HTML elements (or elements in other schemas or DTDs which
- * use the STYLE attribute in the same way). The expectation is that an
- * instance of the ElementCSSInlineStyle interface can be obtained by using
- * binding-specific casting methods on an instance of the Element interface
- * when the element supports inline CSS style informations.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface ElementCSSInlineStyle {
- /**
- * The style attribute.
- */
- public CSSStyleDeclaration getStyle();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/RGBColor.java b/libjava/external/w3c_dom/org/w3c/dom/css/RGBColor.java
deleted file mode 100644
index cd5daa56703..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/RGBColor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>RGBColor</code> interface is used to represent any RGB color
- * value. This interface reflects the values in the underlying style
- * property. Hence, modifications made to the <code>CSSPrimitiveValue</code>
- * objects modify the style property.
- * <p> A specified RGB color is not clipped (even if the number is outside the
- * range 0-255 or 0%-100%). A computed RGB color is clipped depending on the
- * device.
- * <p> Even if a style sheet can only contain an integer for a color value,
- * the internal storage of this integer is a float, and this can be used as
- * a float in the specified or the computed style.
- * <p> A color percentage value can always be converted to a number and vice
- * versa.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface RGBColor {
- /**
- * This attribute is used for the red value of the RGB color.
- */
- public CSSPrimitiveValue getRed();
-
- /**
- * This attribute is used for the green value of the RGB color.
- */
- public CSSPrimitiveValue getGreen();
-
- /**
- * This attribute is used for the blue value of the RGB color.
- */
- public CSSPrimitiveValue getBlue();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/Rect.java b/libjava/external/w3c_dom/org/w3c/dom/css/Rect.java
deleted file mode 100644
index f5efb1084d9..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/Rect.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>Rect</code> interface is used to represent any rect value. This
- * interface reflects the values in the underlying style property. Hence,
- * modifications made to the <code>CSSPrimitiveValue</code> objects modify
- * the style property.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface Rect {
- /**
- * This attribute is used for the top of the rect.
- */
- public CSSPrimitiveValue getTop();
-
- /**
- * This attribute is used for the right of the rect.
- */
- public CSSPrimitiveValue getRight();
-
- /**
- * This attribute is used for the bottom of the rect.
- */
- public CSSPrimitiveValue getBottom();
-
- /**
- * This attribute is used for the left of the rect.
- */
- public CSSPrimitiveValue getLeft();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/css/ViewCSS.java b/libjava/external/w3c_dom/org/w3c/dom/css/ViewCSS.java
deleted file mode 100644
index 76b585a54d2..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/css/ViewCSS.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.views.AbstractView;
-
-/**
- * This interface represents a CSS view. The <code>getComputedStyle</code>
- * method provides a read only access to the computed values of an element.
- * <p> The expectation is that an instance of the <code>ViewCSS</code>
- * interface can be obtained by using binding-specific casting methods on an
- * instance of the <code>AbstractView</code> interface.
- * <p> Since a computed style is related to an <code>Element</code> node, if
- * this element is removed from the document, the associated
- * <code>CSSStyleDeclaration</code> and <code>CSSValue</code> related to
- * this declaration are no longer valid.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface ViewCSS extends AbstractView {
- /**
- * This method is used to get the computed style as it is defined in [<a href='http://www.w3.org/TR/1998/REC-CSS2-19980512'>CSS2</a>].
- * @param elt The element whose style is to be computed. This parameter
- * cannot be null.
- * @param pseudoElt The pseudo-element or <code>null</code> if none.
- * @return The computed style. The <code>CSSStyleDeclaration</code> is
- * read-only and contains only absolute values.
- */
- public CSSStyleDeclaration getComputedStyle(Element elt,
- String pseudoElt);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/events/DocumentEvent.java b/libjava/external/w3c_dom/org/w3c/dom/events/DocumentEvent.java
deleted file mode 100644
index 76644bc5a3d..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/events/DocumentEvent.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>DocumentEvent</code> interface provides a mechanism by which the
- * user can create an Event of a type supported by the implementation. It is
- * expected that the <code>DocumentEvent</code> interface will be
- * implemented on the same object which implements the <code>Document</code>
- * interface in an implementation which supports the Event model.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentEvent {
- /**
- *
- * @param eventType The <code>eventType</code> parameter specifies the
- * type of <code>Event</code> interface to be created. If the
- * <code>Event</code> interface specified is supported by the
- * implementation this method will return a new <code>Event</code> of
- * the interface type requested. If the <code>Event</code> is to be
- * dispatched via the <code>dispatchEvent</code> method the
- * appropriate event init method must be called after creation in
- * order to initialize the <code>Event</code>'s values. As an example,
- * a user wishing to synthesize some kind of <code>UIEvent</code>
- * would call <code>createEvent</code> with the parameter "UIEvents".
- * The <code>initUIEvent</code> method could then be called on the
- * newly created <code>UIEvent</code> to set the specific type of
- * UIEvent to be dispatched and set its context information.The
- * <code>createEvent</code> method is used in creating
- * <code>Event</code>s when it is either inconvenient or unnecessary
- * for the user to create an <code>Event</code> themselves. In cases
- * where the implementation provided <code>Event</code> is
- * insufficient, users may supply their own <code>Event</code>
- * implementations for use with the <code>dispatchEvent</code> method.
- * @return The newly created <code>Event</code>
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support the
- * type of <code>Event</code> interface requested
- */
- public Event createEvent(String eventType)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/events/Event.java b/libjava/external/w3c_dom/org/w3c/dom/events/Event.java
deleted file mode 100644
index 14a9239ed76..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/events/Event.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-/**
- * The <code>Event</code> interface is used to provide contextual information
- * about an event to the handler processing the event. An object which
- * implements the <code>Event</code> interface is generally passed as the
- * first parameter to an event handler. More specific context information is
- * passed to event handlers by deriving additional interfaces from
- * <code>Event</code> which contain information directly relating to the
- * type of event they accompany. These derived interfaces are also
- * implemented by the object passed to the event listener.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface Event {
- // PhaseType
- /**
- * The current event phase is the capturing phase.
- */
- public static final short CAPTURING_PHASE = 1;
- /**
- * The event is currently being evaluated at the target
- * <code>EventTarget</code>.
- */
- public static final short AT_TARGET = 2;
- /**
- * The current event phase is the bubbling phase.
- */
- public static final short BUBBLING_PHASE = 3;
-
- /**
- * The name of the event (case-insensitive). The name must be an XML name.
- */
- public String getType();
-
- /**
- * Used to indicate the <code>EventTarget</code> to which the event was
- * originally dispatched.
- */
- public EventTarget getTarget();
-
- /**
- * Used to indicate the <code>EventTarget</code> whose
- * <code>EventListeners</code> are currently being processed. This is
- * particularly useful during capturing and bubbling.
- */
- public EventTarget getCurrentTarget();
-
- /**
- * Used to indicate which phase of event flow is currently being
- * evaluated.
- */
- public short getEventPhase();
-
- /**
- * Used to indicate whether or not an event is a bubbling event. If the
- * event can bubble the value is true, else the value is false.
- */
- public boolean getBubbles();
-
- /**
- * Used to indicate whether or not an event can have its default action
- * prevented. If the default action can be prevented the value is true,
- * else the value is false.
- */
- public boolean getCancelable();
-
- /**
- * Used to specify the time (in milliseconds relative to the epoch) at
- * which the event was created. Due to the fact that some systems may
- * not provide this information the value of <code>timeStamp</code> may
- * be not available for all events. When not available, a value of 0
- * will be returned. Examples of epoch time are the time of the system
- * start or 0:0:0 UTC 1st January 1970.
- */
- public long getTimeStamp();
-
- /**
- * The <code>stopPropagation</code> method is used prevent further
- * propagation of an event during event flow. If this method is called
- * by any <code>EventListener</code> the event will cease propagating
- * through the tree. The event will complete dispatch to all listeners
- * on the current <code>EventTarget</code> before event flow stops. This
- * method may be used during any stage of event flow.
- */
- public void stopPropagation();
-
- /**
- * If an event is cancelable, the <code>preventDefault</code> method is
- * used to signify that the event is to be canceled, meaning any default
- * action normally taken by the implementation as a result of the event
- * will not occur. If, during any stage of event flow, the
- * <code>preventDefault</code> method is called the event is canceled.
- * Any default action associated with the event will not occur. Calling
- * this method for a non-cancelable event has no effect. Once
- * <code>preventDefault</code> has been called it will remain in effect
- * throughout the remainder of the event's propagation. This method may
- * be used during any stage of event flow.
- */
- public void preventDefault();
-
- /**
- * The <code>initEvent</code> method is used to initialize the value of an
- * <code>Event</code> created through the <code>DocumentEvent</code>
- * interface. This method may only be called before the
- * <code>Event</code> has been dispatched via the
- * <code>dispatchEvent</code> method, though it may be called multiple
- * times during that phase if necessary. If called multiple times the
- * final invocation takes precedence. If called from a subclass of
- * <code>Event</code> interface only the values specified in the
- * <code>initEvent</code> method are modified, all other attributes are
- * left unchanged.
- * @param eventTypeArg Specifies the event type. This type may be any
- * event type currently defined in this specification or a new event
- * type.. The string must be an XML name. Any new event type must not
- * begin with any upper, lower, or mixed case version of the string
- * "DOM". This prefix is reserved for future DOM event sets. It is
- * also strongly recommended that third parties adding their own
- * events use their own prefix to avoid confusion and lessen the
- * probability of conflicts with other new events.
- * @param canBubbleArg Specifies whether or not the event can bubble.
- * @param cancelableArg Specifies whether or not the event's default
- * action can be prevented.
- */
- public void initEvent(String eventTypeArg,
- boolean canBubbleArg,
- boolean cancelableArg);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/events/EventException.java b/libjava/external/w3c_dom/org/w3c/dom/events/EventException.java
deleted file mode 100644
index 7a6ff262052..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/events/EventException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-/**
- * Event operations may throw an <code>EventException</code> as specified in
- * their method descriptions.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public class EventException extends RuntimeException {
- public EventException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // EventExceptionCode
- /**
- * If the <code>Event</code>'s type was not specified by initializing the
- * event before the method was called. Specification of the Event's type
- * as <code>null</code> or an empty string will also trigger this
- * exception.
- */
- public static final short UNSPECIFIED_EVENT_TYPE_ERR = 0;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/events/EventListener.java b/libjava/external/w3c_dom/org/w3c/dom/events/EventListener.java
deleted file mode 100644
index 1df80202cea..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/events/EventListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-/**
- * The <code>EventListener</code> interface is the primary method for
- * handling events. Users implement the <code>EventListener</code> interface
- * and register their listener on an <code>EventTarget</code> using the
- * <code>AddEventListener</code> method. The users should also remove their
- * <code>EventListener</code> from its <code>EventTarget</code> after they
- * have completed using the listener.
- * <p> When a <code>Node</code> is copied using the <code>cloneNode</code>
- * method the <code>EventListener</code>s attached to the source
- * <code>Node</code> are not attached to the copied <code>Node</code>. If
- * the user wishes the same <code>EventListener</code>s to be added to the
- * newly created copy the user must add them manually.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface EventListener {
- /**
- * This method is called whenever an event occurs of the type for which
- * the <code> EventListener</code> interface was registered.
- * @param evt The <code>Event</code> contains contextual information
- * about the event. It also contains the <code>stopPropagation</code>
- * and <code>preventDefault</code> methods which are used in
- * determining the event's flow and default action.
- */
- public void handleEvent(Event evt);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/events/EventTarget.java b/libjava/external/w3c_dom/org/w3c/dom/events/EventTarget.java
deleted file mode 100644
index f07663660fd..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/events/EventTarget.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-/**
- * The <code>EventTarget</code> interface is implemented by all
- * <code>Nodes</code> in an implementation which supports the DOM Event
- * Model. Therefore, this interface can be obtained by using
- * binding-specific casting methods on an instance of the <code>Node</code>
- * interface. The interface allows registration and removal of
- * <code>EventListeners</code> on an <code>EventTarget</code> and dispatch
- * of events to that <code>EventTarget</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface EventTarget {
- /**
- * This method allows the registration of event listeners on the event
- * target. If an <code>EventListener</code> is added to an
- * <code>EventTarget</code> while it is processing an event, it will not
- * be triggered by the current actions but may be triggered during a
- * later stage of event flow, such as the bubbling phase.
- * <br> If multiple identical <code>EventListener</code>s are registered
- * on the same <code>EventTarget</code> with the same parameters the
- * duplicate instances are discarded. They do not cause the
- * <code>EventListener</code> to be called twice and since they are
- * discarded they do not need to be removed with the
- * <code>removeEventListener</code> method.
- * @param type The event type for which the user is registering
- * @param listener The <code>listener</code> parameter takes an interface
- * implemented by the user which contains the methods to be called
- * when the event occurs.
- * @param useCapture If true, <code>useCapture</code> indicates that the
- * user wishes to initiate capture. After initiating capture, all
- * events of the specified type will be dispatched to the registered
- * <code>EventListener</code> before being dispatched to any
- * <code>EventTargets</code> beneath them in the tree. Events which
- * are bubbling upward through the tree will not trigger an
- * <code>EventListener</code> designated to use capture.
- */
- public void addEventListener(String type,
- EventListener listener,
- boolean useCapture);
-
- /**
- * This method allows the removal of event listeners from the event
- * target. If an <code>EventListener</code> is removed from an
- * <code>EventTarget</code> while it is processing an event, it will not
- * be triggered by the current actions. <code>EventListener</code>s can
- * never be invoked after being removed.
- * <br>Calling <code>removeEventListener</code> with arguments which do
- * not identify any currently registered <code>EventListener</code> on
- * the <code>EventTarget</code> has no effect.
- * @param type Specifies the event type of the <code>EventListener</code>
- * being removed.
- * @param listener The <code>EventListener</code> parameter indicates the
- * <code>EventListener </code> to be removed.
- * @param useCapture Specifies whether the <code>EventListener</code>
- * being removed was registered as a capturing listener or not. If a
- * listener was registered twice, one with capture and one without,
- * each must be removed separately. Removal of a capturing listener
- * does not affect a non-capturing version of the same listener, and
- * vice versa.
- */
- public void removeEventListener(String type,
- EventListener listener,
- boolean useCapture);
-
- /**
- * This method allows the dispatch of events into the implementations
- * event model. Events dispatched in this manner will have the same
- * capturing and bubbling behavior as events dispatched directly by the
- * implementation. The target of the event is the
- * <code> EventTarget</code> on which <code>dispatchEvent</code> is
- * called.
- * @param evt Specifies the event type, behavior, and contextual
- * information to be used in processing the event.
- * @return The return value of <code>dispatchEvent</code> indicates
- * whether any of the listeners which handled the event called
- * <code>preventDefault</code>. If <code>preventDefault</code> was
- * called the value is false, else the value is true.
- * @exception EventException
- * UNSPECIFIED_EVENT_TYPE_ERR: Raised if the <code>Event</code>'s type
- * was not specified by initializing the event before
- * <code>dispatchEvent</code> was called. Specification of the
- * <code>Event</code>'s type as <code>null</code> or an empty string
- * will also trigger this exception.
- */
- public boolean dispatchEvent(Event evt)
- throws EventException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/events/MouseEvent.java b/libjava/external/w3c_dom/org/w3c/dom/events/MouseEvent.java
deleted file mode 100644
index be780357a88..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/events/MouseEvent.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-import org.w3c.dom.views.AbstractView;
-
-/**
- * The <code>MouseEvent</code> interface provides specific contextual
- * information associated with Mouse events.
- * <p>The <code>detail</code> attribute inherited from <code>UIEvent</code>
- * indicates the number of times a mouse button has been pressed and
- * released over the same screen location during a user action. The
- * attribute value is 1 when the user begins this action and increments by 1
- * for each full sequence of pressing and releasing. If the user moves the
- * mouse between the mousedown and mouseup the value will be set to 0,
- * indicating that no click is occurring.
- * <p>In the case of nested elements mouse events are always targeted at the
- * most deeply nested element. Ancestors of the targeted element may use
- * bubbling to obtain notification of mouse events which occur within its
- * descendent elements.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface MouseEvent extends UIEvent {
- /**
- * The horizontal coordinate at which the event occurred relative to the
- * origin of the screen coordinate system.
- */
- public int getScreenX();
-
- /**
- * The vertical coordinate at which the event occurred relative to the
- * origin of the screen coordinate system.
- */
- public int getScreenY();
-
- /**
- * The horizontal coordinate at which the event occurred relative to the
- * DOM implementation's client area.
- */
- public int getClientX();
-
- /**
- * The vertical coordinate at which the event occurred relative to the DOM
- * implementation's client area.
- */
- public int getClientY();
-
- /**
- * Used to indicate whether the 'ctrl' key was depressed during the firing
- * of the event.
- */
- public boolean getCtrlKey();
-
- /**
- * Used to indicate whether the 'shift' key was depressed during the
- * firing of the event.
- */
- public boolean getShiftKey();
-
- /**
- * Used to indicate whether the 'alt' key was depressed during the firing
- * of the event. On some platforms this key may map to an alternative
- * key name.
- */
- public boolean getAltKey();
-
- /**
- * Used to indicate whether the 'meta' key was depressed during the firing
- * of the event. On some platforms this key may map to an alternative
- * key name.
- */
- public boolean getMetaKey();
-
- /**
- * During mouse events caused by the depression or release of a mouse
- * button, <code>button</code> is used to indicate which mouse button
- * changed state. The values for <code>button</code> range from zero to
- * indicate the left button of the mouse, one to indicate the middle
- * button if present, and two to indicate the right button. For mice
- * configured for left handed use in which the button actions are
- * reversed the values are instead read from right to left.
- */
- public short getButton();
-
- /**
- * Used to identify a secondary <code>EventTarget</code> related to a UI
- * event. Currently this attribute is used with the mouseover event to
- * indicate the <code>EventTarget</code> which the pointing device
- * exited and with the mouseout event to indicate the
- * <code>EventTarget</code> which the pointing device entered.
- */
- public EventTarget getRelatedTarget();
-
- /**
- * The <code>initMouseEvent</code> method is used to initialize the value
- * of a <code>MouseEvent</code> created through the
- * <code>DocumentEvent</code> interface. This method may only be called
- * before the <code>MouseEvent</code> has been dispatched via the
- * <code>dispatchEvent</code> method, though it may be called multiple
- * times during that phase if necessary. If called multiple times, the
- * final invocation takes precedence.
- * @param typeArg Specifies the event type.
- * @param canBubbleArg Specifies whether or not the event can bubble.
- * @param cancelableArg Specifies whether or not the event's default
- * action can be prevented.
- * @param viewArg Specifies the <code>Event</code>'s
- * <code>AbstractView</code>.
- * @param detailArg Specifies the <code>Event</code>'s mouse click count.
- * @param screenXArg Specifies the <code>Event</code>'s screen x
- * coordinate
- * @param screenYArg Specifies the <code>Event</code>'s screen y
- * coordinate
- * @param clientXArg Specifies the <code>Event</code>'s client x
- * coordinate
- * @param clientYArg Specifies the <code>Event</code>'s client y
- * coordinate
- * @param ctrlKeyArg Specifies whether or not control key was depressed
- * during the <code>Event</code>.
- * @param altKeyArg Specifies whether or not alt key was depressed during
- * the <code>Event</code>.
- * @param shiftKeyArg Specifies whether or not shift key was depressed
- * during the <code>Event</code>.
- * @param metaKeyArg Specifies whether or not meta key was depressed
- * during the <code>Event</code>.
- * @param buttonArg Specifies the <code>Event</code>'s mouse button.
- * @param relatedTargetArg Specifies the <code>Event</code>'s related
- * <code>EventTarget</code>.
- */
- public void initMouseEvent(String typeArg,
- boolean canBubbleArg,
- boolean cancelableArg,
- AbstractView viewArg,
- int detailArg,
- int screenXArg,
- int screenYArg,
- int clientXArg,
- int clientYArg,
- boolean ctrlKeyArg,
- boolean altKeyArg,
- boolean shiftKeyArg,
- boolean metaKeyArg,
- short buttonArg,
- EventTarget relatedTargetArg);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/events/MutationEvent.java b/libjava/external/w3c_dom/org/w3c/dom/events/MutationEvent.java
deleted file mode 100644
index 3db40038e93..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/events/MutationEvent.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-import org.w3c.dom.Node;
-
-/**
- * The <code>MutationEvent</code> interface provides specific contextual
- * information associated with Mutation events.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface MutationEvent extends Event {
- // attrChangeType
- /**
- * The <code>Attr</code> was modified in place.
- */
- public static final short MODIFICATION = 1;
- /**
- * The <code>Attr</code> was just added.
- */
- public static final short ADDITION = 2;
- /**
- * The <code>Attr</code> was just removed.
- */
- public static final short REMOVAL = 3;
-
- /**
- * <code>relatedNode</code> is used to identify a secondary node related
- * to a mutation event. For example, if a mutation event is dispatched
- * to a node indicating that its parent has changed, the
- * <code>relatedNode</code> is the changed parent. If an event is
- * instead dispatched to a subtree indicating a node was changed within
- * it, the <code>relatedNode</code> is the changed node. In the case of
- * the DOMAttrModified event it indicates the <code>Attr</code> node
- * which was modified, added, or removed.
- */
- public Node getRelatedNode();
-
- /**
- * <code>prevValue</code> indicates the previous value of the
- * <code>Attr</code> node in DOMAttrModified events, and of the
- * <code>CharacterData</code> node in DOMCharacterDataModified events.
- */
- public String getPrevValue();
-
- /**
- * <code>newValue</code> indicates the new value of the <code>Attr</code>
- * node in DOMAttrModified events, and of the <code>CharacterData</code>
- * node in DOMCharacterDataModified events.
- */
- public String getNewValue();
-
- /**
- * <code>attrName</code> indicates the name of the changed
- * <code>Attr</code> node in a DOMAttrModified event.
- */
- public String getAttrName();
-
- /**
- * <code>attrChange</code> indicates the type of change which triggered
- * the DOMAttrModified event. The values can be <code>MODIFICATION</code>
- * , <code>ADDITION</code>, or <code>REMOVAL</code>.
- */
- public short getAttrChange();
-
- /**
- * The <code>initMutationEvent</code> method is used to initialize the
- * value of a <code>MutationEvent</code> created through the
- * <code>DocumentEvent</code> interface. This method may only be called
- * before the <code>MutationEvent</code> has been dispatched via the
- * <code>dispatchEvent</code> method, though it may be called multiple
- * times during that phase if necessary. If called multiple times, the
- * final invocation takes precedence.
- * @param typeArg Specifies the event type.
- * @param canBubbleArg Specifies whether or not the event can bubble.
- * @param cancelableArg Specifies whether or not the event's default
- * action can be prevented.
- * @param relatedNodeArg Specifies the <code>Event</code>'s related Node.
- * @param prevValueArg Specifies the <code>Event</code>'s
- * <code>prevValue</code> attribute. This value may be null.
- * @param newValueArg Specifies the <code>Event</code>'s
- * <code>newValue</code> attribute. This value may be null.
- * @param attrNameArg Specifies the <code>Event</code>'s
- * <code>attrName</code> attribute. This value may be null.
- * @param attrChangeArg Specifies the <code>Event</code>'s
- * <code>attrChange</code> attribute
- */
- public void initMutationEvent(String typeArg,
- boolean canBubbleArg,
- boolean cancelableArg,
- Node relatedNodeArg,
- String prevValueArg,
- String newValueArg,
- String attrNameArg,
- short attrChangeArg);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/events/UIEvent.java b/libjava/external/w3c_dom/org/w3c/dom/events/UIEvent.java
deleted file mode 100644
index 15affe8791e..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/events/UIEvent.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-import org.w3c.dom.views.AbstractView;
-
-/**
- * The <code>UIEvent</code> interface provides specific contextual information
- * associated with User Interface events.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface UIEvent extends Event {
- /**
- * The <code>view</code> attribute identifies the <code>AbstractView</code>
- * from which the event was generated.
- */
- public AbstractView getView();
-
- /**
- * Specifies some detail information about the <code>Event</code>,
- * depending on the type of event.
- */
- public int getDetail();
-
- /**
- * The <code>initUIEvent</code> method is used to initialize the value of
- * a <code>UIEvent</code> created through the <code>DocumentEvent</code>
- * interface. This method may only be called before the
- * <code>UIEvent</code> has been dispatched via the
- * <code>dispatchEvent</code> method, though it may be called multiple
- * times during that phase if necessary. If called multiple times, the
- * final invocation takes precedence.
- * @param typeArg Specifies the event type.
- * @param canBubbleArg Specifies whether or not the event can bubble.
- * @param cancelableArg Specifies whether or not the event's default
- * action can be prevented.
- * @param viewArg Specifies the <code>Event</code>'s
- * <code>AbstractView</code>.
- * @param detailArg Specifies the <code>Event</code>'s detail.
- */
- public void initUIEvent(String typeArg,
- boolean canBubbleArg,
- boolean cancelableArg,
- AbstractView viewArg,
- int detailArg);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAnchorElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAnchorElement.java
deleted file mode 100644
index eaac35c8a76..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAnchorElement.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * The anchor element. See the A element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLAnchorElement extends HTMLElement {
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public String getAccessKey();
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public void setAccessKey(String accessKey);
-
- /**
- * The character encoding of the linked resource. See the charset
- * attribute definition in HTML 4.01.
- */
- public String getCharset();
- /**
- * The character encoding of the linked resource. See the charset
- * attribute definition in HTML 4.01.
- */
- public void setCharset(String charset);
-
- /**
- * Comma-separated list of lengths, defining an active region geometry.
- * See also <code>shape</code> for the shape of the region. See the
- * coords attribute definition in HTML 4.01.
- */
- public String getCoords();
- /**
- * Comma-separated list of lengths, defining an active region geometry.
- * See also <code>shape</code> for the shape of the region. See the
- * coords attribute definition in HTML 4.01.
- */
- public void setCoords(String coords);
-
- /**
- * The absolute URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the linked resource. See the href attribute
- * definition in HTML 4.01.
- */
- public String getHref();
- /**
- * The absolute URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the linked resource. See the href attribute
- * definition in HTML 4.01.
- */
- public void setHref(String href);
-
- /**
- * Language code of the linked resource. See the hreflang attribute
- * definition in HTML 4.01.
- */
- public String getHreflang();
- /**
- * Language code of the linked resource. See the hreflang attribute
- * definition in HTML 4.01.
- */
- public void setHreflang(String hreflang);
-
- /**
- * Anchor name. See the name attribute definition in HTML 4.01.
- */
- public String getName();
- /**
- * Anchor name. See the name attribute definition in HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * Forward link type. See the rel attribute definition in HTML 4.01.
- */
- public String getRel();
- /**
- * Forward link type. See the rel attribute definition in HTML 4.01.
- */
- public void setRel(String rel);
-
- /**
- * Reverse link type. See the rev attribute definition in HTML 4.01.
- */
- public String getRev();
- /**
- * Reverse link type. See the rev attribute definition in HTML 4.01.
- */
- public void setRev(String rev);
-
- /**
- * The shape of the active area. The coordinates are given by
- * <code>coords</code>. See the shape attribute definition in HTML 4.01.
- */
- public String getShape();
- /**
- * The shape of the active area. The coordinates are given by
- * <code>coords</code>. See the shape attribute definition in HTML 4.01.
- */
- public void setShape(String shape);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public int getTabIndex();
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public void setTabIndex(int tabIndex);
-
- /**
- * Frame to render the resource in. See the target attribute definition in
- * HTML 4.01.
- */
- public String getTarget();
- /**
- * Frame to render the resource in. See the target attribute definition in
- * HTML 4.01.
- */
- public void setTarget(String target);
-
- /**
- * Advisory content type. See the type attribute definition in HTML 4.01.
- */
- public String getType();
- /**
- * Advisory content type. See the type attribute definition in HTML 4.01.
- */
- public void setType(String type);
-
- /**
- * Removes keyboard focus from this element.
- */
- public void blur();
-
- /**
- * Gives keyboard focus to this element.
- */
- public void focus();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAppletElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAppletElement.java
deleted file mode 100644
index f27b51afb7a..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAppletElement.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * An embedded Java applet. See the APPLET element definition in HTML 4.01.
- * This element is deprecated in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLAppletElement extends HTMLElement {
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
- /**
- * Alternate text for user agents not rendering the normal content of this
- * element. See the alt attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getAlt();
- /**
- * Alternate text for user agents not rendering the normal content of this
- * element. See the alt attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setAlt(String alt);
-
- /**
- * Comma-separated archive list. See the archive attribute definition in
- * HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getArchive();
- /**
- * Comma-separated archive list. See the archive attribute definition in
- * HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setArchive(String archive);
-
- /**
- * Applet class file. See the code attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getCode();
- /**
- * Applet class file. See the code attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setCode(String code);
-
- /**
- * Optional base URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] for applet. See the codebase attribute definition in
- * HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getCodeBase();
- /**
- * Optional base URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] for applet. See the codebase attribute definition in
- * HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setCodeBase(String codeBase);
-
- /**
- * Override height. See the height attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getHeight();
- /**
- * Override height. See the height attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setHeight(String height);
-
- /**
- * Horizontal space, in pixels, to the left and right of this image,
- * applet, or object. See the hspace attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- * @version DOM Level 2
- */
- public int getHspace();
- /**
- * Horizontal space, in pixels, to the left and right of this image,
- * applet, or object. See the hspace attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- * @version DOM Level 2
- */
- public void setHspace(int hspace);
-
- /**
- * The name of the applet. See the name attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getName();
- /**
- * The name of the applet. See the name attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * The value of the "object" attribute. See the object attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- * @version DOM Level 2
- */
- public String getObject();
- /**
- * The value of the "object" attribute. See the object attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- * @version DOM Level 2
- */
- public void setObject(String object);
-
- /**
- * Vertical space, in pixels, above and below this image, applet, or
- * object. See the vspace attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- * @version DOM Level 2
- */
- public int getVspace();
- /**
- * Vertical space, in pixels, above and below this image, applet, or
- * object. See the vspace attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- * @version DOM Level 2
- */
- public void setVspace(int vspace);
-
- /**
- * Override width. See the width attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getWidth();
- /**
- * Override width. See the width attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setWidth(String width);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAreaElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAreaElement.java
deleted file mode 100644
index 75d1dc5cfa9..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLAreaElement.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Client-side image map area definition. See the AREA element definition in
- * HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLAreaElement extends HTMLElement {
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public String getAccessKey();
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public void setAccessKey(String accessKey);
-
- /**
- * Alternate text for user agents not rendering the normal content of this
- * element. See the alt attribute definition in HTML 4.01.
- */
- public String getAlt();
- /**
- * Alternate text for user agents not rendering the normal content of this
- * element. See the alt attribute definition in HTML 4.01.
- */
- public void setAlt(String alt);
-
- /**
- * Comma-separated list of lengths, defining an active region geometry.
- * See also <code>shape</code> for the shape of the region. See the
- * coords attribute definition in HTML 4.01.
- */
- public String getCoords();
- /**
- * Comma-separated list of lengths, defining an active region geometry.
- * See also <code>shape</code> for the shape of the region. See the
- * coords attribute definition in HTML 4.01.
- */
- public void setCoords(String coords);
-
- /**
- * The URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the linked resource. See the href attribute definition in
- * HTML 4.01.
- */
- public String getHref();
- /**
- * The URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the linked resource. See the href attribute definition in
- * HTML 4.01.
- */
- public void setHref(String href);
-
- /**
- * Specifies that this area is inactive, i.e., has no associated action.
- * See the nohref attribute definition in HTML 4.01.
- */
- public boolean getNoHref();
- /**
- * Specifies that this area is inactive, i.e., has no associated action.
- * See the nohref attribute definition in HTML 4.01.
- */
- public void setNoHref(boolean noHref);
-
- /**
- * The shape of the active area. The coordinates are given by
- * <code>coords</code>. See the shape attribute definition in HTML 4.01.
- */
- public String getShape();
- /**
- * The shape of the active area. The coordinates are given by
- * <code>coords</code>. See the shape attribute definition in HTML 4.01.
- */
- public void setShape(String shape);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public int getTabIndex();
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public void setTabIndex(int tabIndex);
-
- /**
- * Frame to render the resource in. See the target attribute definition in
- * HTML 4.01.
- */
- public String getTarget();
- /**
- * Frame to render the resource in. See the target attribute definition in
- * HTML 4.01.
- */
- public void setTarget(String target);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBRElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBRElement.java
deleted file mode 100644
index a865d282d41..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBRElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Force a line break. See the BR element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLBRElement extends HTMLElement {
- /**
- * Control flow of text around floats. See the clear attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getClear();
- /**
- * Control flow of text around floats. See the clear attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setClear(String clear);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBaseElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBaseElement.java
deleted file mode 100644
index 7b52dbcc209..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBaseElement.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Document base URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]. See the BASE element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLBaseElement extends HTMLElement {
- /**
- * The base URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]. See the href attribute definition in HTML 4.01.
- */
- public String getHref();
- /**
- * The base URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]. See the href attribute definition in HTML 4.01.
- */
- public void setHref(String href);
-
- /**
- * The default target frame. See the target attribute definition in HTML
- * 4.01.
- */
- public String getTarget();
- /**
- * The default target frame. See the target attribute definition in HTML
- * 4.01.
- */
- public void setTarget(String target);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBaseFontElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBaseFontElement.java
deleted file mode 100644
index 5a3c5c93cee..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBaseFontElement.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Base font. See the BASEFONT element definition in HTML 4.01. This element
- * is deprecated in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLBaseFontElement extends HTMLElement {
- /**
- * Font color. See the color attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getColor();
- /**
- * Font color. See the color attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setColor(String color);
-
- /**
- * Font face identifier. See the face attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getFace();
- /**
- * Font face identifier. See the face attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setFace(String face);
-
- /**
- * Computed font size. See the size attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- * @version DOM Level 2
- */
- public int getSize();
- /**
- * Computed font size. See the size attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- * @version DOM Level 2
- */
- public void setSize(int size);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBodyElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBodyElement.java
deleted file mode 100644
index 8898c5de030..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLBodyElement.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * The HTML document body. This element is always present in the DOM API, even
- * if the tags are not present in the source document. See the BODY element
- * definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLBodyElement extends HTMLElement {
- /**
- * Color of active links (after mouse-button down, but before mouse-button
- * up). See the alink attribute definition in HTML 4.01. This attribute
- * is deprecated in HTML 4.01.
- */
- public String getALink();
- /**
- * Color of active links (after mouse-button down, but before mouse-button
- * up). See the alink attribute definition in HTML 4.01. This attribute
- * is deprecated in HTML 4.01.
- */
- public void setALink(String aLink);
-
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the background texture tile image. See the background attribute
- * definition in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getBackground();
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the background texture tile image. See the background attribute
- * definition in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setBackground(String background);
-
- /**
- * Document background color. See the bgcolor attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getBgColor();
- /**
- * Document background color. See the bgcolor attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setBgColor(String bgColor);
-
- /**
- * Color of links that are not active and unvisited. See the link
- * attribute definition in HTML 4.01. This attribute is deprecated in
- * HTML 4.01.
- */
- public String getLink();
- /**
- * Color of links that are not active and unvisited. See the link
- * attribute definition in HTML 4.01. This attribute is deprecated in
- * HTML 4.01.
- */
- public void setLink(String link);
-
- /**
- * Document text color. See the text attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getText();
- /**
- * Document text color. See the text attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setText(String text);
-
- /**
- * Color of links that have been visited by the user. See the vlink
- * attribute definition in HTML 4.01. This attribute is deprecated in
- * HTML 4.01.
- */
- public String getVLink();
- /**
- * Color of links that have been visited by the user. See the vlink
- * attribute definition in HTML 4.01. This attribute is deprecated in
- * HTML 4.01.
- */
- public void setVLink(String vLink);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLButtonElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLButtonElement.java
deleted file mode 100644
index 7efe1834c26..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLButtonElement.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Push button. See the BUTTON element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLButtonElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a
- * form.
- */
- public HTMLFormElement getForm();
-
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public String getAccessKey();
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public void setAccessKey(String accessKey);
-
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public boolean getDisabled();
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public void setDisabled(boolean disabled);
-
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.01.
- */
- public String getName();
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public int getTabIndex();
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public void setTabIndex(int tabIndex);
-
- /**
- * The type of button (all lower case). See the type attribute definition
- * in HTML 4.01.
- */
- public String getType();
-
- /**
- * The current form control value. See the value attribute definition in
- * HTML 4.01.
- */
- public String getValue();
- /**
- * The current form control value. See the value attribute definition in
- * HTML 4.01.
- */
- public void setValue(String value);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLCollection.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLCollection.java
deleted file mode 100644
index 6b6751783fe..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLCollection.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.Node;
-
-/**
- * An <code>HTMLCollection</code> is a list of nodes. An individual node may
- * be accessed by either ordinal index or the node's <code>name</code> or
- * <code>id</code> attributes. Collections in the HTML DOM are assumed to be
- * live meaning that they are automatically updated when the underlying
- * document is changed.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLCollection {
- /**
- * This attribute specifies the length or size of the list.
- */
- public int getLength();
-
- /**
- * This method retrieves a node specified by ordinal index. Nodes are
- * numbered in tree order (depth-first traversal order).
- * @param index The index of the node to be fetched. The index origin is
- * <code>0</code>.
- * @return The <code>Node</code> at the corresponding position upon
- * success. A value of <code>null</code> is returned if the index is
- * out of range.
- */
- public Node item(int index);
-
- /**
- * This method retrieves a <code>Node</code> using a name. With [<a href='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>]
- * documents, it first searches for a <code>Node</code> with a matching
- * <code>id</code> attribute. If it doesn't find one, it then searches
- * for a <code>Node</code> with a matching <code>name</code> attribute,
- * but only on those elements that are allowed a name attribute. With [<a href='http://www.w3.org/TR/2002/REC-xhtml1-20020801'>XHTML 1.0</a>]
- * documents, this method only searches for <code>Nodes</code> with a
- * matching <code>id</code> attribute. This method is case insensitive
- * in HTML documents and case sensitive in XHTML documents.
- * @param name The name of the <code>Node</code> to be fetched.
- * @return The <code>Node</code> with a <code>name</code> or
- * <code>id</code> attribute whose value corresponds to the specified
- * string. Upon failure (e.g., no node with this name exists), returns
- * <code>null</code>.
- */
- public Node namedItem(String name);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDListElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDListElement.java
deleted file mode 100644
index e8a3bb4a064..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDListElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Definition list. See the DL element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLDListElement extends HTMLElement {
- /**
- * Reduce spacing between list items. See the compact attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public boolean getCompact();
- /**
- * Reduce spacing between list items. See the compact attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setCompact(boolean compact);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDirectoryElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDirectoryElement.java
deleted file mode 100644
index 5a405c80432..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDirectoryElement.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Directory list. See the DIR element definition in HTML 4.01. This element
- * is deprecated in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLDirectoryElement extends HTMLElement {
- /**
- * Reduce spacing between list items. See the compact attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public boolean getCompact();
- /**
- * Reduce spacing between list items. See the compact attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setCompact(boolean compact);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDivElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDivElement.java
deleted file mode 100644
index 31107c5f168..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDivElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Generic block container. See the DIV element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLDivElement extends HTMLElement {
- /**
- * Horizontal text alignment. See the align attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Horizontal text alignment. See the align attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDocument.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDocument.java
deleted file mode 100644
index 79ad1b3363f..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLDocument.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.DOMException;
-
-/**
- * An <code>HTMLDocument</code> is the root of the HTML hierarchy and holds
- * the entire content. Besides providing access to the hierarchy, it also
- * provides some convenience methods for accessing certain sets of
- * information from the document.
- * <p>The following properties have been deprecated in favor of the
- * corresponding ones for the <code>BODY</code> element:alinkColorbackground
- * bgColorfgColorlinkColorvlinkColorIn DOM Level 2, the method
- * <code>getElementById</code> is inherited from the <code>Document</code>
- * interface where it was moved to.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLDocument extends Document {
- /**
- * The title of a document as specified by the <code>TITLE</code> element
- * in the head of the document.
- */
- public String getTitle();
- /**
- * The title of a document as specified by the <code>TITLE</code> element
- * in the head of the document.
- */
- public void setTitle(String title);
-
- /**
- * Returns the URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the page that linked to this page. The value is an
- * empty string if the user navigated to the page directly (not through
- * a link, but, for example, via a bookmark).
- */
- public String getReferrer();
-
- /**
- * The domain name of the server that served the document, or
- * <code>null</code> if the server cannot be identified by a domain
- * name.
- */
- public String getDomain();
-
- /**
- * The absolute URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the document.
- */
- public String getURL();
-
- /**
- * The element that contains the content for the document. In documents
- * with <code>BODY</code> contents, returns the <code>BODY</code>
- * element. In frameset documents, this returns the outermost
- * <code>FRAMESET</code> element.
- */
- public HTMLElement getBody();
- /**
- * The element that contains the content for the document. In documents
- * with <code>BODY</code> contents, returns the <code>BODY</code>
- * element. In frameset documents, this returns the outermost
- * <code>FRAMESET</code> element.
- */
- public void setBody(HTMLElement body);
-
- /**
- * A collection of all the <code>IMG</code> elements in a document. The
- * behavior is limited to <code>IMG</code> elements for backwards
- * compatibility. As suggested by [<a href='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>], to include images, authors may use
- * the <code>OBJECT</code> element or the <code>IMG</code> element.
- * Therefore, it is recommended not to use this attribute to find the
- * images in the document but <code>getElementsByTagName</code> with
- * HTML 4.01 or <code>getElementsByTagNameNS</code> with XHTML 1.0.
- */
- public HTMLCollection getImages();
-
- /**
- * A collection of all the <code>OBJECT</code> elements that include
- * applets and <code>APPLET</code> (deprecated) elements in a document.
- */
- public HTMLCollection getApplets();
-
- /**
- * A collection of all <code>AREA</code> elements and anchor (
- * <code>A</code>) elements in a document with a value for the
- * <code>href</code> attribute.
- */
- public HTMLCollection getLinks();
-
- /**
- * A collection of all the forms of a document.
- */
- public HTMLCollection getForms();
-
- /**
- * A collection of all the anchor (<code>A</code>) elements in a document
- * with a value for the <code>name</code> attribute. For reasons of
- * backward compatibility, the returned set of anchors only contains
- * those anchors created with the <code>name</code> attribute, not those
- * created with the <code>id</code> attribute. Note that in [<a href='http://www.w3.org/TR/2002/REC-xhtml1-20020801'>XHTML 1.0</a>], the
- * <code>name</code> attribute (see section 4.10) has no semantics and
- * is only present for legacy user agents: the <code>id</code> attribute
- * is used instead. Users should prefer the iterator mechanisms provided
- * by [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal</a>] instead.
- */
- public HTMLCollection getAnchors();
-
- /**
- * This mutable string attribute denotes persistent state information
- * that (1) is associated with the current frame or document and (2) is
- * composed of information described by the <code>cookies</code>
- * non-terminal of [<a href='http://www.ietf.org/rfc/rfc2965.txt'>IETF RFC 2965</a>], Section 4.2.2.
- * <br> If no persistent state information is available for the current
- * frame or document document, then this property's value is an empty
- * string.
- * <br> When this attribute is read, all cookies are returned as a single
- * string, with each cookie's name-value pair concatenated into a list
- * of name-value pairs, each list item being separated by a ';'
- * (semicolon).
- * <br> When this attribute is set, the value it is set to should be a
- * string that adheres to the <code>cookie</code> non-terminal of [<a href='http://www.ietf.org/rfc/rfc2965.txt'>IETF RFC 2965</a>]; that
- * is, it should be a single name-value pair followed by zero or more
- * cookie attribute values. If no domain attribute is specified, then
- * the domain attribute for the new value defaults to the host portion
- * of an absolute URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the current frame or document. If no path
- * attribute is specified, then the path attribute for the new value
- * defaults to the absolute path portion of the URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the current
- * frame or document. If no max-age attribute is specified, then the
- * max-age attribute for the new value defaults to a user agent defined
- * value. If a cookie with the specified name is already associated with
- * the current frame or document, then the new value as well as the new
- * attributes replace the old value and attributes. If a max-age
- * attribute of 0 is specified for the new value, then any existing
- * cookies of the specified name are removed from the cookie storage.
- * See [<a href='http://www.ietf.org/rfc/rfc2965.txt'>IETF RFC 2965</a>] for the semantics of persistent state item attribute value
- * pairs. The precise nature of a user agent session is not defined by
- * this specification.
- */
- public String getCookie();
- /**
- * This mutable string attribute denotes persistent state information
- * that (1) is associated with the current frame or document and (2) is
- * composed of information described by the <code>cookies</code>
- * non-terminal of [<a href='http://www.ietf.org/rfc/rfc2965.txt'>IETF RFC 2965</a>], Section 4.2.2.
- * <br> If no persistent state information is available for the current
- * frame or document document, then this property's value is an empty
- * string.
- * <br> When this attribute is read, all cookies are returned as a single
- * string, with each cookie's name-value pair concatenated into a list
- * of name-value pairs, each list item being separated by a ';'
- * (semicolon).
- * <br> When this attribute is set, the value it is set to should be a
- * string that adheres to the <code>cookie</code> non-terminal of [<a href='http://www.ietf.org/rfc/rfc2965.txt'>IETF RFC 2965</a>]; that
- * is, it should be a single name-value pair followed by zero or more
- * cookie attribute values. If no domain attribute is specified, then
- * the domain attribute for the new value defaults to the host portion
- * of an absolute URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the current frame or document. If no path
- * attribute is specified, then the path attribute for the new value
- * defaults to the absolute path portion of the URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the current
- * frame or document. If no max-age attribute is specified, then the
- * max-age attribute for the new value defaults to a user agent defined
- * value. If a cookie with the specified name is already associated with
- * the current frame or document, then the new value as well as the new
- * attributes replace the old value and attributes. If a max-age
- * attribute of 0 is specified for the new value, then any existing
- * cookies of the specified name are removed from the cookie storage.
- * See [<a href='http://www.ietf.org/rfc/rfc2965.txt'>IETF RFC 2965</a>] for the semantics of persistent state item attribute value
- * pairs. The precise nature of a user agent session is not defined by
- * this specification.
- * @exception DOMException
- * SYNTAX_ERR: If the new value does not adhere to the cookie syntax
- * specified by [<a href='http://www.ietf.org/rfc/rfc2965.txt'>IETF RFC 2965</a>].
- */
- public void setCookie(String cookie)
- throws DOMException;
-
- /**
- * Open a document stream for writing. If a document exists in the target,
- * this method clears it. This method and the ones following allow a
- * user to add to or replace the structure model of a document using
- * strings of unparsed HTML. At the time of writing alternate methods
- * for providing similar functionality for both HTML and XML documents
- * were being considered (see [<a href='http://www.w3.org/TR/2002/WD-DOM-Level-3-LS-20020725'>DOM Level 3 Load and Save</a>]).
- */
- public void open();
-
- /**
- * Closes a document stream opened by <code>open()</code> and forces
- * rendering.
- */
- public void close();
-
- /**
- * Write a string of text to a document stream opened by
- * <code>open()</code>. Note that the function will produce a document
- * which is not necessarily driven by a DTD and therefore might be
- * produce an invalid result in the context of the document.
- * @param text The string to be parsed into some structure in the
- * document structure model.
- */
- public void write(String text);
-
- /**
- * Write a string of text followed by a newline character to a document
- * stream opened by <code>open()</code>. Note that the function will
- * produce a document which is not necessarily driven by a DTD and
- * therefore might be produce an invalid result in the context of the
- * document
- * @param text The string to be parsed into some structure in the
- * document structure model.
- */
- public void writeln(String text);
-
- /**
- * With [<a href='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>] documents, this method returns the (possibly empty) collection
- * of elements whose <code>name</code> value is given by
- * <code>elementName</code>. In [<a href='http://www.w3.org/TR/2002/REC-xhtml1-20020801'>XHTML 1.0</a>] documents, this methods only return the
- * (possibly empty) collection of form controls with matching name. This
- * method is case sensitive.
- * @param elementName The <code>name</code> attribute value for an
- * element.
- * @return The matching elements.
- */
- public NodeList getElementsByName(String elementName);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLElement.java
deleted file mode 100644
index ed37419d3bc..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLElement.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.Element;
-
-/**
- * All HTML element interfaces derive from this class. Elements that only
- * expose the HTML core attributes are represented by the base
- * <code>HTMLElement</code> interface. These elements are as follows:
- * special: SUB, SUP, SPAN, BDOfont: TT, I, B, U, S, STRIKE, BIG, SMALL
- * phrase: EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ACRONYM, ABBRlist:
- * DD, DTNOFRAMES, NOSCRIPTADDRESS, CENTERThe <code>style</code> attribute
- * of an HTML element is accessible through the
- * <code>ElementCSSInlineStyle</code> interface which is defined in the CSS
- * module [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>DOM Level 2 Style Sheets and CSS</a>].
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLElement extends Element {
- /**
- * The element's identifier. See the id attribute definition in HTML 4.01.
- */
- public String getId();
- /**
- * The element's identifier. See the id attribute definition in HTML 4.01.
- */
- public void setId(String id);
-
- /**
- * The element's advisory title. See the title attribute definition in
- * HTML 4.01.
- */
- public String getTitle();
- /**
- * The element's advisory title. See the title attribute definition in
- * HTML 4.01.
- */
- public void setTitle(String title);
-
- /**
- * Language code defined in RFC 1766. See the lang attribute definition in
- * HTML 4.01.
- */
- public String getLang();
- /**
- * Language code defined in RFC 1766. See the lang attribute definition in
- * HTML 4.01.
- */
- public void setLang(String lang);
-
- /**
- * Specifies the base direction of directionally neutral text and the
- * directionality of tables. See the dir attribute definition in HTML
- * 4.01.
- */
- public String getDir();
- /**
- * Specifies the base direction of directionally neutral text and the
- * directionality of tables. See the dir attribute definition in HTML
- * 4.01.
- */
- public void setDir(String dir);
-
- /**
- * The class attribute of the element. This attribute has been renamed due
- * to conflicts with the "class" keyword exposed by many languages. See
- * the class attribute definition in HTML 4.01.
- */
- public String getClassName();
- /**
- * The class attribute of the element. This attribute has been renamed due
- * to conflicts with the "class" keyword exposed by many languages. See
- * the class attribute definition in HTML 4.01.
- */
- public void setClassName(String className);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFieldSetElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFieldSetElement.java
deleted file mode 100644
index c962a567d1b..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFieldSetElement.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Organizes form controls into logical groups. See the FIELDSET element
- * definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLFieldSetElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a
- * form.
- */
- public HTMLFormElement getForm();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFontElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFontElement.java
deleted file mode 100644
index 8fa25893c35..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFontElement.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Local change to font. See the FONT element definition in HTML 4.01. This
- * element is deprecated in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLFontElement extends HTMLElement {
- /**
- * Font color. See the color attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getColor();
- /**
- * Font color. See the color attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setColor(String color);
-
- /**
- * Font face identifier. See the face attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getFace();
- /**
- * Font face identifier. See the face attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setFace(String face);
-
- /**
- * Font size. See the size attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getSize();
- /**
- * Font size. See the size attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setSize(String size);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFormElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFormElement.java
deleted file mode 100644
index 109f31a57dd..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFormElement.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * The <code>FORM</code> element encompasses behavior similar to a collection
- * and an element. It provides direct access to the contained form controls
- * as well as the attributes of the form element. See the FORM element
- * definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLFormElement extends HTMLElement {
- /**
- * Returns a collection of all form control elements in the form.
- */
- public HTMLCollection getElements();
-
- /**
- * The number of form controls in the form.
- */
- public int getLength();
-
- /**
- * Names the form.
- */
- public String getName();
- /**
- * Names the form.
- */
- public void setName(String name);
-
- /**
- * List of character sets supported by the server. See the accept-charset
- * attribute definition in HTML 4.01.
- */
- public String getAcceptCharset();
- /**
- * List of character sets supported by the server. See the accept-charset
- * attribute definition in HTML 4.01.
- */
- public void setAcceptCharset(String acceptCharset);
-
- /**
- * Server-side form handler. See the action attribute definition in HTML
- * 4.01.
- */
- public String getAction();
- /**
- * Server-side form handler. See the action attribute definition in HTML
- * 4.01.
- */
- public void setAction(String action);
-
- /**
- * The content type of the submitted form, generally
- * "application/x-www-form-urlencoded". See the enctype attribute
- * definition in HTML 4.01. The onsubmit even handler is not guaranteed
- * to be triggered when invoking this method. The behavior is
- * inconsistent for historical reasons and authors should not rely on a
- * particular one.
- */
- public String getEnctype();
- /**
- * The content type of the submitted form, generally
- * "application/x-www-form-urlencoded". See the enctype attribute
- * definition in HTML 4.01. The onsubmit even handler is not guaranteed
- * to be triggered when invoking this method. The behavior is
- * inconsistent for historical reasons and authors should not rely on a
- * particular one.
- */
- public void setEnctype(String enctype);
-
- /**
- * HTTP method [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>] used to submit form. See the method attribute definition
- * in HTML 4.01.
- */
- public String getMethod();
- /**
- * HTTP method [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>] used to submit form. See the method attribute definition
- * in HTML 4.01.
- */
- public void setMethod(String method);
-
- /**
- * Frame to render the resource in. See the target attribute definition in
- * HTML 4.01.
- */
- public String getTarget();
- /**
- * Frame to render the resource in. See the target attribute definition in
- * HTML 4.01.
- */
- public void setTarget(String target);
-
- /**
- * Submits the form. It performs the same action as a submit button.
- */
- public void submit();
-
- /**
- * Restores a form element's default values. It performs the same action
- * as a reset button.
- */
- public void reset();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFrameElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFrameElement.java
deleted file mode 100644
index d6100815f5a..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFrameElement.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.Document;
-
-/**
- * Create a frame. See the FRAME element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLFrameElement extends HTMLElement {
- /**
- * Request frame borders. See the frameborder attribute definition in HTML
- * 4.01.
- */
- public String getFrameBorder();
- /**
- * Request frame borders. See the frameborder attribute definition in HTML
- * 4.01.
- */
- public void setFrameBorder(String frameBorder);
-
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a long description of this image or frame. See the
- * longdesc attribute definition in HTML 4.01.
- */
- public String getLongDesc();
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a long description of this image or frame. See the
- * longdesc attribute definition in HTML 4.01.
- */
- public void setLongDesc(String longDesc);
-
- /**
- * Frame margin height, in pixels. See the marginheight attribute
- * definition in HTML 4.01.
- */
- public String getMarginHeight();
- /**
- * Frame margin height, in pixels. See the marginheight attribute
- * definition in HTML 4.01.
- */
- public void setMarginHeight(String marginHeight);
-
- /**
- * Frame margin width, in pixels. See the marginwidth attribute definition
- * in HTML 4.01.
- */
- public String getMarginWidth();
- /**
- * Frame margin width, in pixels. See the marginwidth attribute definition
- * in HTML 4.01.
- */
- public void setMarginWidth(String marginWidth);
-
- /**
- * The frame name (object of the <code>target</code> attribute). See the
- * name attribute definition in HTML 4.01.
- */
- public String getName();
- /**
- * The frame name (object of the <code>target</code> attribute). See the
- * name attribute definition in HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * When true, forbid user from resizing frame. See the noresize attribute
- * definition in HTML 4.01.
- */
- public boolean getNoResize();
- /**
- * When true, forbid user from resizing frame. See the noresize attribute
- * definition in HTML 4.01.
- */
- public void setNoResize(boolean noResize);
-
- /**
- * Specify whether or not the frame should have scrollbars. See the
- * scrolling attribute definition in HTML 4.01.
- */
- public String getScrolling();
- /**
- * Specify whether or not the frame should have scrollbars. See the
- * scrolling attribute definition in HTML 4.01.
- */
- public void setScrolling(String scrolling);
-
- /**
- * A URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating the initial frame contents. See the src attribute
- * definition in HTML 4.01.
- */
- public String getSrc();
- /**
- * A URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating the initial frame contents. See the src attribute
- * definition in HTML 4.01.
- */
- public void setSrc(String src);
-
- /**
- * The document this frame contains, if there is any and it is available,
- * or <code>null</code> otherwise.
- * @since DOM Level 2
- */
- public Document getContentDocument();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFrameSetElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFrameSetElement.java
deleted file mode 100644
index 4e5d75bde1b..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLFrameSetElement.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Create a grid of frames. See the FRAMESET element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLFrameSetElement extends HTMLElement {
- /**
- * The number of columns of frames in the frameset. See the cols attribute
- * definition in HTML 4.01.
- */
- public String getCols();
- /**
- * The number of columns of frames in the frameset. See the cols attribute
- * definition in HTML 4.01.
- */
- public void setCols(String cols);
-
- /**
- * The number of rows of frames in the frameset. See the rows attribute
- * definition in HTML 4.01.
- */
- public String getRows();
- /**
- * The number of rows of frames in the frameset. See the rows attribute
- * definition in HTML 4.01.
- */
- public void setRows(String rows);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHRElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHRElement.java
deleted file mode 100644
index b09ec0f3fb1..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHRElement.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Create a horizontal rule. See the HR element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLHRElement extends HTMLElement {
- /**
- * Align the rule on the page. See the align attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Align the rule on the page. See the align attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
- /**
- * Indicates to the user agent that there should be no shading in the
- * rendering of this element. See the noshade attribute definition in
- * HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public boolean getNoShade();
- /**
- * Indicates to the user agent that there should be no shading in the
- * rendering of this element. See the noshade attribute definition in
- * HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setNoShade(boolean noShade);
-
- /**
- * The height of the rule. See the size attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getSize();
- /**
- * The height of the rule. See the size attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setSize(String size);
-
- /**
- * The width of the rule. See the width attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getWidth();
- /**
- * The width of the rule. See the width attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setWidth(String width);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHeadElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHeadElement.java
deleted file mode 100644
index c4550a50711..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHeadElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Document head information. See the HEAD element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLHeadElement extends HTMLElement {
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a metadata profile. See the profile attribute
- * definition in HTML 4.01.
- */
- public String getProfile();
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a metadata profile. See the profile attribute
- * definition in HTML 4.01.
- */
- public void setProfile(String profile);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHeadingElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHeadingElement.java
deleted file mode 100644
index 149752507e3..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHeadingElement.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * For the <code>H1</code> to <code>H6</code> elements. See the H1 element
- * definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLHeadingElement extends HTMLElement {
- /**
- * Horizontal text alignment. See the align attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Horizontal text alignment. See the align attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHtmlElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHtmlElement.java
deleted file mode 100644
index 5ba30fe3177..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLHtmlElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Root of an HTML document. See the HTML element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLHtmlElement extends HTMLElement {
- /**
- * Version information about the document's DTD. See the version attribute
- * definition in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getVersion();
- /**
- * Version information about the document's DTD. See the version attribute
- * definition in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setVersion(String version);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLIFrameElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLIFrameElement.java
deleted file mode 100644
index 7cac12f89e5..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLIFrameElement.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.Document;
-
-/**
- * Inline subwindows. See the IFRAME element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLIFrameElement extends HTMLElement {
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
- /**
- * Request frame borders. See the frameborder attribute definition in HTML
- * 4.01.
- */
- public String getFrameBorder();
- /**
- * Request frame borders. See the frameborder attribute definition in HTML
- * 4.01.
- */
- public void setFrameBorder(String frameBorder);
-
- /**
- * Frame height. See the height attribute definition in HTML 4.01.
- */
- public String getHeight();
- /**
- * Frame height. See the height attribute definition in HTML 4.01.
- */
- public void setHeight(String height);
-
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a long description of this image or frame. See the
- * longdesc attribute definition in HTML 4.01.
- */
- public String getLongDesc();
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a long description of this image or frame. See the
- * longdesc attribute definition in HTML 4.01.
- */
- public void setLongDesc(String longDesc);
-
- /**
- * Frame margin height, in pixels. See the marginheight attribute
- * definition in HTML 4.01.
- */
- public String getMarginHeight();
- /**
- * Frame margin height, in pixels. See the marginheight attribute
- * definition in HTML 4.01.
- */
- public void setMarginHeight(String marginHeight);
-
- /**
- * Frame margin width, in pixels. See the marginwidth attribute definition
- * in HTML 4.01.
- */
- public String getMarginWidth();
- /**
- * Frame margin width, in pixels. See the marginwidth attribute definition
- * in HTML 4.01.
- */
- public void setMarginWidth(String marginWidth);
-
- /**
- * The frame name (object of the <code>target</code> attribute). See the
- * name attribute definition in HTML 4.01.
- */
- public String getName();
- /**
- * The frame name (object of the <code>target</code> attribute). See the
- * name attribute definition in HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * Specify whether or not the frame should have scrollbars. See the
- * scrolling attribute definition in HTML 4.01.
- */
- public String getScrolling();
- /**
- * Specify whether or not the frame should have scrollbars. See the
- * scrolling attribute definition in HTML 4.01.
- */
- public void setScrolling(String scrolling);
-
- /**
- * A URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating the initial frame contents. See the src attribute
- * definition in HTML 4.01.
- */
- public String getSrc();
- /**
- * A URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating the initial frame contents. See the src attribute
- * definition in HTML 4.01.
- */
- public void setSrc(String src);
-
- /**
- * Frame width. See the width attribute definition in HTML 4.01.
- */
- public String getWidth();
- /**
- * Frame width. See the width attribute definition in HTML 4.01.
- */
- public void setWidth(String width);
-
- /**
- * The document this frame contains, if there is any and it is available,
- * or <code>null</code> otherwise.
- * @since DOM Level 2
- */
- public Document getContentDocument();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLImageElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLImageElement.java
deleted file mode 100644
index 8e8142184d4..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLImageElement.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Embedded image. See the IMG element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLImageElement extends HTMLElement {
- /**
- * The name of the element (for backwards compatibility).
- */
- public String getName();
- /**
- * The name of the element (for backwards compatibility).
- */
- public void setName(String name);
-
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
- /**
- * Alternate text for user agents not rendering the normal content of this
- * element. See the alt attribute definition in HTML 4.01.
- */
- public String getAlt();
- /**
- * Alternate text for user agents not rendering the normal content of this
- * element. See the alt attribute definition in HTML 4.01.
- */
- public void setAlt(String alt);
-
- /**
- * Width of border around image. See the border attribute definition in
- * HTML 4.01. This attribute is deprecated in HTML 4.01. Note that the
- * type of this attribute was <code>DOMString</code> in DOM Level 1 HTML [<a href='http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001'>DOM Level 1</a>]
- * .
- */
- public String getBorder();
- /**
- * Width of border around image. See the border attribute definition in
- * HTML 4.01. This attribute is deprecated in HTML 4.01. Note that the
- * type of this attribute was <code>DOMString</code> in DOM Level 1 HTML [<a href='http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001'>DOM Level 1</a>]
- * .
- */
- public void setBorder(String border);
-
- /**
- * Height of the image in pixels. See the height attribute definition in
- * HTML 4.01. Note that the type of this attribute was
- * <code>DOMString</code> in DOM Level 1 HTML [<a href='http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001'>DOM Level 1</a>].
- * @version DOM Level 2
- */
- public int getHeight();
- /**
- * Height of the image in pixels. See the height attribute definition in
- * HTML 4.01. Note that the type of this attribute was
- * <code>DOMString</code> in DOM Level 1 HTML [<a href='http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001'>DOM Level 1</a>].
- * @version DOM Level 2
- */
- public void setHeight(int height);
-
- /**
- * Horizontal space to the left and right of this image in pixels. See the
- * hspace attribute definition in HTML 4.01. This attribute is
- * deprecated in HTML 4.01. Note that the type of this attribute was
- * <code>DOMString</code> in DOM Level 1 HTML [<a href='http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001'>DOM Level 1</a>].
- * @version DOM Level 2
- */
- public int getHspace();
- /**
- * Horizontal space to the left and right of this image in pixels. See the
- * hspace attribute definition in HTML 4.01. This attribute is
- * deprecated in HTML 4.01. Note that the type of this attribute was
- * <code>DOMString</code> in DOM Level 1 HTML [<a href='http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001'>DOM Level 1</a>].
- * @version DOM Level 2
- */
- public void setHspace(int hspace);
-
- /**
- * Use server-side image map. See the ismap attribute definition in HTML
- * 4.01.
- */
- public boolean getIsMap();
- /**
- * Use server-side image map. See the ismap attribute definition in HTML
- * 4.01.
- */
- public void setIsMap(boolean isMap);
-
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a long description of this image or frame. See the
- * longdesc attribute definition in HTML 4.01.
- */
- public String getLongDesc();
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a long description of this image or frame. See the
- * longdesc attribute definition in HTML 4.01.
- */
- public void setLongDesc(String longDesc);
-
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating the source of this image. See the src attribute
- * definition in HTML 4.01.
- */
- public String getSrc();
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating the source of this image. See the src attribute
- * definition in HTML 4.01.
- */
- public void setSrc(String src);
-
- /**
- * Use client-side image map. See the usemap attribute definition in HTML
- * 4.01.
- */
- public String getUseMap();
- /**
- * Use client-side image map. See the usemap attribute definition in HTML
- * 4.01.
- */
- public void setUseMap(String useMap);
-
- /**
- * Vertical space above and below this image in pixels. See the vspace
- * attribute definition in HTML 4.01. This attribute is deprecated in
- * HTML 4.01. Note that the type of this attribute was "DOMString" in
- * DOM Level 1 HTML [<a href='http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001'>DOM Level 1</a>].
- * @version DOM Level 2
- */
- public int getVspace();
- /**
- * Vertical space above and below this image in pixels. See the vspace
- * attribute definition in HTML 4.01. This attribute is deprecated in
- * HTML 4.01. Note that the type of this attribute was "DOMString" in
- * DOM Level 1 HTML [<a href='http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001'>DOM Level 1</a>].
- * @version DOM Level 2
- */
- public void setVspace(int vspace);
-
- /**
- * The width of the image in pixels. See the width attribute definition in
- * HTML 4.01. Note that the type of this attribute was
- * <code>DOMString</code> in DOM Level 1 HTML [<a href='http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001'>DOM Level 1</a>].
- * @version DOM Level 2
- */
- public int getWidth();
- /**
- * The width of the image in pixels. See the width attribute definition in
- * HTML 4.01. Note that the type of this attribute was
- * <code>DOMString</code> in DOM Level 1 HTML [<a href='http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001'>DOM Level 1</a>].
- * @version DOM Level 2
- */
- public void setWidth(int width);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLInputElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLInputElement.java
deleted file mode 100644
index b0d0d9d091b..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLInputElement.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Form control.Depending upon the environment in which the page is being
- * viewed, the value property may be read-only for the file upload input
- * type. For the "password" input type, the actual value returned may be
- * masked to prevent unauthorized use. See the INPUT element definition in [<a href='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>].
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLInputElement extends HTMLElement {
- /**
- * When the <code>type</code> attribute of the element has the value
- * "text", "file" or "password", this represents the HTML value
- * attribute of the element. The value of this attribute does not change
- * if the contents of the corresponding form control, in an interactive
- * user agent, changes. See the value attribute definition in HTML 4.01.
- */
- public String getDefaultValue();
- /**
- * When the <code>type</code> attribute of the element has the value
- * "text", "file" or "password", this represents the HTML value
- * attribute of the element. The value of this attribute does not change
- * if the contents of the corresponding form control, in an interactive
- * user agent, changes. See the value attribute definition in HTML 4.01.
- */
- public void setDefaultValue(String defaultValue);
-
- /**
- * When <code>type</code> has the value "radio" or "checkbox", this
- * represents the HTML checked attribute of the element. The value of
- * this attribute does not change if the state of the corresponding form
- * control, in an interactive user agent, changes. See the checked
- * attribute definition in HTML 4.01.
- */
- public boolean getDefaultChecked();
- /**
- * When <code>type</code> has the value "radio" or "checkbox", this
- * represents the HTML checked attribute of the element. The value of
- * this attribute does not change if the state of the corresponding form
- * control, in an interactive user agent, changes. See the checked
- * attribute definition in HTML 4.01.
- */
- public void setDefaultChecked(boolean defaultChecked);
-
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a
- * form.
- */
- public HTMLFormElement getForm();
-
- /**
- * A comma-separated list of content types that a server processing this
- * form will handle correctly. See the accept attribute definition in
- * HTML 4.01.
- */
- public String getAccept();
- /**
- * A comma-separated list of content types that a server processing this
- * form will handle correctly. See the accept attribute definition in
- * HTML 4.01.
- */
- public void setAccept(String accept);
-
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public String getAccessKey();
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public void setAccessKey(String accessKey);
-
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
- /**
- * Alternate text for user agents not rendering the normal content of this
- * element. See the alt attribute definition in HTML 4.01.
- */
- public String getAlt();
- /**
- * Alternate text for user agents not rendering the normal content of this
- * element. See the alt attribute definition in HTML 4.01.
- */
- public void setAlt(String alt);
-
- /**
- * When the <code>type</code> attribute of the element has the value
- * "radio" or "checkbox", this represents the current state of the form
- * control, in an interactive user agent. Changes to this attribute
- * change the state of the form control, but do not change the value of
- * the HTML checked attribute of the INPUT element.During the handling
- * of a click event on an input element with a type attribute that has
- * the value "radio" or "checkbox", some implementations may change the
- * value of this property before the event is being dispatched in the
- * document. If the default action of the event is canceled, the value
- * of the property may be changed back to its original value. This means
- * that the value of this property during the handling of click events
- * is implementation dependent.
- */
- public boolean getChecked();
- /**
- * When the <code>type</code> attribute of the element has the value
- * "radio" or "checkbox", this represents the current state of the form
- * control, in an interactive user agent. Changes to this attribute
- * change the state of the form control, but do not change the value of
- * the HTML checked attribute of the INPUT element.During the handling
- * of a click event on an input element with a type attribute that has
- * the value "radio" or "checkbox", some implementations may change the
- * value of this property before the event is being dispatched in the
- * document. If the default action of the event is canceled, the value
- * of the property may be changed back to its original value. This means
- * that the value of this property during the handling of click events
- * is implementation dependent.
- */
- public void setChecked(boolean checked);
-
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public boolean getDisabled();
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public void setDisabled(boolean disabled);
-
- /**
- * Maximum number of characters for text fields, when <code>type</code>
- * has the value "text" or "password". See the maxlength attribute
- * definition in HTML 4.01.
- */
- public int getMaxLength();
- /**
- * Maximum number of characters for text fields, when <code>type</code>
- * has the value "text" or "password". See the maxlength attribute
- * definition in HTML 4.01.
- */
- public void setMaxLength(int maxLength);
-
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.01.
- */
- public String getName();
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * This control is read-only. Relevant only when <code>type</code> has the
- * value "text" or "password". See the readonly attribute definition in
- * HTML 4.01.
- */
- public boolean getReadOnly();
- /**
- * This control is read-only. Relevant only when <code>type</code> has the
- * value "text" or "password". See the readonly attribute definition in
- * HTML 4.01.
- */
- public void setReadOnly(boolean readOnly);
-
- /**
- * Size information. The precise meaning is specific to each type of
- * field. See the size attribute definition in HTML 4.01.
- * @version DOM Level 2
- */
- public int getSize();
- /**
- * Size information. The precise meaning is specific to each type of
- * field. See the size attribute definition in HTML 4.01.
- * @version DOM Level 2
- */
- public void setSize(int size);
-
- /**
- * When the <code>type</code> attribute has the value "image", this
- * attribute specifies the location of the image to be used to decorate
- * the graphical submit button. See the src attribute definition in HTML
- * 4.01.
- */
- public String getSrc();
- /**
- * When the <code>type</code> attribute has the value "image", this
- * attribute specifies the location of the image to be used to decorate
- * the graphical submit button. See the src attribute definition in HTML
- * 4.01.
- */
- public void setSrc(String src);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public int getTabIndex();
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public void setTabIndex(int tabIndex);
-
- /**
- * The type of control created (all lower case). See the type attribute
- * definition in HTML 4.01.
- * @version DOM Level 2
- */
- public String getType();
- /**
- * The type of control created (all lower case). See the type attribute
- * definition in HTML 4.01.
- * @version DOM Level 2
- */
- public void setType(String type);
-
- /**
- * Use client-side image map. See the usemap attribute definition in HTML
- * 4.01.
- */
- public String getUseMap();
- /**
- * Use client-side image map. See the usemap attribute definition in HTML
- * 4.01.
- */
- public void setUseMap(String useMap);
-
- /**
- * When the <code>type</code> attribute of the element has the value
- * "text", "file" or "password", this represents the current contents of
- * the corresponding form control, in an interactive user agent.
- * Changing this attribute changes the contents of the form control, but
- * does not change the value of the HTML value attribute of the element.
- * When the <code>type</code> attribute of the element has the value
- * "button", "hidden", "submit", "reset", "image", "checkbox" or
- * "radio", this represents the HTML value attribute of the element. See
- * the value attribute definition in HTML 4.01.
- */
- public String getValue();
- /**
- * When the <code>type</code> attribute of the element has the value
- * "text", "file" or "password", this represents the current contents of
- * the corresponding form control, in an interactive user agent.
- * Changing this attribute changes the contents of the form control, but
- * does not change the value of the HTML value attribute of the element.
- * When the <code>type</code> attribute of the element has the value
- * "button", "hidden", "submit", "reset", "image", "checkbox" or
- * "radio", this represents the HTML value attribute of the element. See
- * the value attribute definition in HTML 4.01.
- */
- public void setValue(String value);
-
- /**
- * Removes keyboard focus from this element.
- */
- public void blur();
-
- /**
- * Gives keyboard focus to this element.
- */
- public void focus();
-
- /**
- * Select the contents of the text area. For <code>INPUT</code> elements
- * whose <code>type</code> attribute has one of the following values:
- * "text", "file", or "password".
- */
- public void select();
-
- /**
- * Simulate a mouse-click. For <code>INPUT</code> elements whose
- * <code>type</code> attribute has one of the following values:
- * "button", "checkbox", "radio", "reset", or "submit".
- */
- public void click();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLIsIndexElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLIsIndexElement.java
deleted file mode 100644
index 898b9e46a01..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLIsIndexElement.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * This element is used for single-line text input. See the ISINDEX element
- * definition in HTML 4.01. This element is deprecated in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLIsIndexElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a
- * form.
- */
- public HTMLFormElement getForm();
-
- /**
- * The prompt message. See the prompt attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getPrompt();
- /**
- * The prompt message. See the prompt attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setPrompt(String prompt);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLIElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLIElement.java
deleted file mode 100644
index df20c000ac2..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLIElement.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * List item. See the LI element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLLIElement extends HTMLElement {
- /**
- * List item bullet style. See the type attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getType();
- /**
- * List item bullet style. See the type attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setType(String type);
-
- /**
- * Reset sequence number when used in <code>OL</code>. See the value
- * attribute definition in HTML 4.01. This attribute is deprecated in
- * HTML 4.01.
- */
- public int getValue();
- /**
- * Reset sequence number when used in <code>OL</code>. See the value
- * attribute definition in HTML 4.01. This attribute is deprecated in
- * HTML 4.01.
- */
- public void setValue(int value);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLabelElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLabelElement.java
deleted file mode 100644
index 69a104053c2..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLabelElement.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Form field label text. See the LABEL element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLLabelElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a
- * form.
- */
- public HTMLFormElement getForm();
-
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public String getAccessKey();
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public void setAccessKey(String accessKey);
-
- /**
- * This attribute links this label with another form control by
- * <code>id</code> attribute. See the for attribute definition in HTML
- * 4.01.
- */
- public String getHtmlFor();
- /**
- * This attribute links this label with another form control by
- * <code>id</code> attribute. See the for attribute definition in HTML
- * 4.01.
- */
- public void setHtmlFor(String htmlFor);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLegendElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLegendElement.java
deleted file mode 100644
index b976d099a6a..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLegendElement.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Provides a caption for a <code>FIELDSET</code> grouping. See the LEGEND
- * element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLLegendElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a
- * form.
- */
- public HTMLFormElement getForm();
-
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public String getAccessKey();
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public void setAccessKey(String accessKey);
-
- /**
- * Text alignment relative to <code>FIELDSET</code>. See the align
- * attribute definition in HTML 4.01. This attribute is deprecated in
- * HTML 4.01.
- */
- public String getAlign();
- /**
- * Text alignment relative to <code>FIELDSET</code>. See the align
- * attribute definition in HTML 4.01. This attribute is deprecated in
- * HTML 4.01.
- */
- public void setAlign(String align);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLinkElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLinkElement.java
deleted file mode 100644
index 4ed72ca9483..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLLinkElement.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * The <code>LINK</code> element specifies a link to an external resource, and
- * defines this document's relationship to that resource (or vice versa).
- * See the LINK element definition in HTML 4.01 (see also the
- * <code>LinkStyle</code> interface in the StyleSheet module [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>DOM Level 2 Style Sheets and CSS</a>]).
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLLinkElement extends HTMLElement {
- /**
- * Enables/disables the link. This is currently only used for style sheet
- * links, and may be used to activate or deactivate style sheets.
- */
- public boolean getDisabled();
- /**
- * Enables/disables the link. This is currently only used for style sheet
- * links, and may be used to activate or deactivate style sheets.
- */
- public void setDisabled(boolean disabled);
-
- /**
- * The character encoding of the resource being linked to. See the charset
- * attribute definition in HTML 4.01.
- */
- public String getCharset();
- /**
- * The character encoding of the resource being linked to. See the charset
- * attribute definition in HTML 4.01.
- */
- public void setCharset(String charset);
-
- /**
- * The URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the linked resource. See the href attribute definition in
- * HTML 4.01.
- */
- public String getHref();
- /**
- * The URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] of the linked resource. See the href attribute definition in
- * HTML 4.01.
- */
- public void setHref(String href);
-
- /**
- * Language code of the linked resource. See the hreflang attribute
- * definition in HTML 4.01.
- */
- public String getHreflang();
- /**
- * Language code of the linked resource. See the hreflang attribute
- * definition in HTML 4.01.
- */
- public void setHreflang(String hreflang);
-
- /**
- * Designed for use with one or more target media. See the media attribute
- * definition in HTML 4.01.
- */
- public String getMedia();
- /**
- * Designed for use with one or more target media. See the media attribute
- * definition in HTML 4.01.
- */
- public void setMedia(String media);
-
- /**
- * Forward link type. See the rel attribute definition in HTML 4.01.
- */
- public String getRel();
- /**
- * Forward link type. See the rel attribute definition in HTML 4.01.
- */
- public void setRel(String rel);
-
- /**
- * Reverse link type. See the rev attribute definition in HTML 4.01.
- */
- public String getRev();
- /**
- * Reverse link type. See the rev attribute definition in HTML 4.01.
- */
- public void setRev(String rev);
-
- /**
- * Frame to render the resource in. See the target attribute definition in
- * HTML 4.01.
- */
- public String getTarget();
- /**
- * Frame to render the resource in. See the target attribute definition in
- * HTML 4.01.
- */
- public void setTarget(String target);
-
- /**
- * Advisory content type. See the type attribute definition in HTML 4.01.
- */
- public String getType();
- /**
- * Advisory content type. See the type attribute definition in HTML 4.01.
- */
- public void setType(String type);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMapElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMapElement.java
deleted file mode 100644
index e413727ab4d..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMapElement.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Client-side image map. See the MAP element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLMapElement extends HTMLElement {
- /**
- * The list of areas defined for the image map.
- */
- public HTMLCollection getAreas();
-
- /**
- * Names the map (for use with <code>usemap</code>). See the name
- * attribute definition in HTML 4.01.
- */
- public String getName();
- /**
- * Names the map (for use with <code>usemap</code>). See the name
- * attribute definition in HTML 4.01.
- */
- public void setName(String name);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMenuElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMenuElement.java
deleted file mode 100644
index 7c8ec62d0eb..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMenuElement.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Menu list. See the MENU element definition in HTML 4.01. This element is
- * deprecated in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLMenuElement extends HTMLElement {
- /**
- * Reduce spacing between list items. See the compact attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public boolean getCompact();
- /**
- * Reduce spacing between list items. See the compact attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setCompact(boolean compact);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMetaElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMetaElement.java
deleted file mode 100644
index b6bf05d40c7..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLMetaElement.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * This contains generic meta-information about the document. See the META
- * element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLMetaElement extends HTMLElement {
- /**
- * Associated information. See the content attribute definition in HTML
- * 4.01.
- */
- public String getContent();
- /**
- * Associated information. See the content attribute definition in HTML
- * 4.01.
- */
- public void setContent(String content);
-
- /**
- * HTTP response header name [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>]. See the http-equiv attribute definition in
- * HTML 4.01.
- */
- public String getHttpEquiv();
- /**
- * HTTP response header name [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>]. See the http-equiv attribute definition in
- * HTML 4.01.
- */
- public void setHttpEquiv(String httpEquiv);
-
- /**
- * Meta information name. See the name attribute definition in HTML 4.01.
- */
- public String getName();
- /**
- * Meta information name. See the name attribute definition in HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * Select form of content. See the scheme attribute definition in HTML
- * 4.01.
- */
- public String getScheme();
- /**
- * Select form of content. See the scheme attribute definition in HTML
- * 4.01.
- */
- public void setScheme(String scheme);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLModElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLModElement.java
deleted file mode 100644
index 006ba69c4bd..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLModElement.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Notice of modification to part of a document. See the INS and DEL element
- * definitions in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLModElement extends HTMLElement {
- /**
- * A URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a document that describes the reason for the change.
- * See the cite attribute definition in HTML 4.01.
- */
- public String getCite();
- /**
- * A URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a document that describes the reason for the change.
- * See the cite attribute definition in HTML 4.01.
- */
- public void setCite(String cite);
-
- /**
- * The date and time of the change. See the datetime attribute definition
- * in HTML 4.01.
- */
- public String getDateTime();
- /**
- * The date and time of the change. See the datetime attribute definition
- * in HTML 4.01.
- */
- public void setDateTime(String dateTime);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOListElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOListElement.java
deleted file mode 100644
index 13041c8a106..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOListElement.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Ordered list. See the OL element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLOListElement extends HTMLElement {
- /**
- * Reduce spacing between list items. See the compact attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public boolean getCompact();
- /**
- * Reduce spacing between list items. See the compact attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setCompact(boolean compact);
-
- /**
- * Starting sequence number. See the start attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public int getStart();
- /**
- * Starting sequence number. See the start attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setStart(int start);
-
- /**
- * Numbering style. See the type attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getType();
- /**
- * Numbering style. See the type attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setType(String type);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLObjectElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLObjectElement.java
deleted file mode 100644
index 11795468d77..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLObjectElement.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.Document;
-
-/**
- * Generic embedded object.In principle, all properties on the object element
- * are read-write but in some environments some properties may be read-only
- * once the underlying object is instantiated. See the OBJECT element
- * definition in [<a href='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>].
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLObjectElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a
- * form.
- */
- public HTMLFormElement getForm();
-
- /**
- * Applet class file. See the <code>code</code> attribute for
- * HTMLAppletElement.
- */
- public String getCode();
- /**
- * Applet class file. See the <code>code</code> attribute for
- * HTMLAppletElement.
- */
- public void setCode(String code);
-
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
- /**
- * Space-separated list of archives. See the archive attribute definition
- * in HTML 4.01.
- */
- public String getArchive();
- /**
- * Space-separated list of archives. See the archive attribute definition
- * in HTML 4.01.
- */
- public void setArchive(String archive);
-
- /**
- * Width of border around the object. See the border attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getBorder();
- /**
- * Width of border around the object. See the border attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setBorder(String border);
-
- /**
- * Base URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] for <code>classid</code>, <code>data</code>, and
- * <code>archive</code> attributes. See the codebase attribute definition
- * in HTML 4.01.
- */
- public String getCodeBase();
- /**
- * Base URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] for <code>classid</code>, <code>data</code>, and
- * <code>archive</code> attributes. See the codebase attribute definition
- * in HTML 4.01.
- */
- public void setCodeBase(String codeBase);
-
- /**
- * Content type for data downloaded via <code>classid</code> attribute.
- * See the codetype attribute definition in HTML 4.01.
- */
- public String getCodeType();
- /**
- * Content type for data downloaded via <code>classid</code> attribute.
- * See the codetype attribute definition in HTML 4.01.
- */
- public void setCodeType(String codeType);
-
- /**
- * A URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] specifying the location of the object's data. See the data
- * attribute definition in HTML 4.01.
- */
- public String getData();
- /**
- * A URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] specifying the location of the object's data. See the data
- * attribute definition in HTML 4.01.
- */
- public void setData(String data);
-
- /**
- * Declare (for future reference), but do not instantiate, this object.
- * See the declare attribute definition in HTML 4.01.
- */
- public boolean getDeclare();
- /**
- * Declare (for future reference), but do not instantiate, this object.
- * See the declare attribute definition in HTML 4.01.
- */
- public void setDeclare(boolean declare);
-
- /**
- * Override height. See the height attribute definition in HTML 4.01.
- */
- public String getHeight();
- /**
- * Override height. See the height attribute definition in HTML 4.01.
- */
- public void setHeight(String height);
-
- /**
- * Horizontal space, in pixels, to the left and right of this image,
- * applet, or object. See the hspace attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public int getHspace();
- /**
- * Horizontal space, in pixels, to the left and right of this image,
- * applet, or object. See the hspace attribute definition in HTML 4.01.
- * This attribute is deprecated in HTML 4.01.
- */
- public void setHspace(int hspace);
-
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.01.
- */
- public String getName();
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * Message to render while loading the object. See the standby attribute
- * definition in HTML 4.01.
- */
- public String getStandby();
- /**
- * Message to render while loading the object. See the standby attribute
- * definition in HTML 4.01.
- */
- public void setStandby(String standby);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public int getTabIndex();
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public void setTabIndex(int tabIndex);
-
- /**
- * Content type for data downloaded via <code>data</code> attribute. See
- * the type attribute definition in HTML 4.01.
- */
- public String getType();
- /**
- * Content type for data downloaded via <code>data</code> attribute. See
- * the type attribute definition in HTML 4.01.
- */
- public void setType(String type);
-
- /**
- * Use client-side image map. See the usemap attribute definition in HTML
- * 4.01.
- */
- public String getUseMap();
- /**
- * Use client-side image map. See the usemap attribute definition in HTML
- * 4.01.
- */
- public void setUseMap(String useMap);
-
- /**
- * Vertical space, in pixels, above and below this image, applet, or
- * object. See the vspace attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public int getVspace();
- /**
- * Vertical space, in pixels, above and below this image, applet, or
- * object. See the vspace attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setVspace(int vspace);
-
- /**
- * Override width. See the width attribute definition in HTML 4.01.
- */
- public String getWidth();
- /**
- * Override width. See the width attribute definition in HTML 4.01.
- */
- public void setWidth(String width);
-
- /**
- * The document this object contains, if there is any and it is available,
- * or <code>null</code> otherwise.
- * @since DOM Level 2
- */
- public Document getContentDocument();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptGroupElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptGroupElement.java
deleted file mode 100644
index 8bd606a7126..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptGroupElement.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Group options together in logical subdivisions. See the OPTGROUP element
- * definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLOptGroupElement extends HTMLElement {
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public boolean getDisabled();
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public void setDisabled(boolean disabled);
-
- /**
- * Assigns a label to this option group. See the label attribute definition
- * in HTML 4.01.
- */
- public String getLabel();
- /**
- * Assigns a label to this option group. See the label attribute definition
- * in HTML 4.01.
- */
- public void setLabel(String label);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptionElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptionElement.java
deleted file mode 100644
index f3b38a6019c..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptionElement.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * A selectable choice. See the OPTION element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLOptionElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a
- * form.
- */
- public HTMLFormElement getForm();
-
- /**
- * Represents the value of the HTML selected attribute. The value of this
- * attribute does not change if the state of the corresponding form
- * control, in an interactive user agent, changes. See the selected
- * attribute definition in HTML 4.01.
- * @version DOM Level 2
- */
- public boolean getDefaultSelected();
- /**
- * Represents the value of the HTML selected attribute. The value of this
- * attribute does not change if the state of the corresponding form
- * control, in an interactive user agent, changes. See the selected
- * attribute definition in HTML 4.01.
- * @version DOM Level 2
- */
- public void setDefaultSelected(boolean defaultSelected);
-
- /**
- * The text contained within the option element.
- */
- public String getText();
-
- /**
- * The index of this <code>OPTION</code> in its parent <code>SELECT</code>
- * , starting from 0.
- * @version DOM Level 2
- */
- public int getIndex();
-
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public boolean getDisabled();
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public void setDisabled(boolean disabled);
-
- /**
- * Option label for use in hierarchical menus. See the label attribute
- * definition in HTML 4.01.
- */
- public String getLabel();
- /**
- * Option label for use in hierarchical menus. See the label attribute
- * definition in HTML 4.01.
- */
- public void setLabel(String label);
-
- /**
- * Represents the current state of the corresponding form control, in an
- * interactive user agent. Changing this attribute changes the state of
- * the form control, but does not change the value of the HTML selected
- * attribute of the element.
- */
- public boolean getSelected();
- /**
- * Represents the current state of the corresponding form control, in an
- * interactive user agent. Changing this attribute changes the state of
- * the form control, but does not change the value of the HTML selected
- * attribute of the element.
- */
- public void setSelected(boolean selected);
-
- /**
- * The current form control value. See the value attribute definition in
- * HTML 4.01.
- */
- public String getValue();
- /**
- * The current form control value. See the value attribute definition in
- * HTML 4.01.
- */
- public void setValue(String value);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptionsCollection.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptionsCollection.java
deleted file mode 100644
index d70d92d73e2..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLOptionsCollection.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * An <code>HTMLOptionsCollection</code> is a list of nodes representing HTML
- * option element. An individual node may be accessed by either ordinal
- * index or the node's <code>name</code> or <code>id</code> attributes.
- * Collections in the HTML DOM are assumed to be live meaning that they are
- * automatically updated when the underlying document is changed.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- * @since DOM Level 2
- */
-public interface HTMLOptionsCollection {
- /**
- * This attribute specifies the length or size of the list.
- */
- public int getLength();
- /**
- * This attribute specifies the length or size of the list.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: if setting the length is not allowed by the
- * implementation.
- */
- public void setLength(int length)
- throws DOMException;
-
- /**
- * This method retrieves a node specified by ordinal index. Nodes are
- * numbered in tree order (depth-first traversal order).
- * @param index The index of the node to be fetched. The index origin is
- * 0.
- * @return The <code>Node</code> at the corresponding position upon
- * success. A value of <code>null</code> is returned if the index is
- * out of range.
- */
- public Node item(int index);
-
- /**
- * This method retrieves a <code>Node</code> using a name. It first
- * searches for a <code>Node</code> with a matching <code>id</code>
- * attribute. If it doesn't find one, it then searches for a
- * <code>Node</code> with a matching <code>name</code> attribute, but
- * only on those elements that are allowed a name attribute. This method
- * is case insensitive in HTML documents and case sensitive in XHTML
- * documents.
- * @param name The name of the <code>Node</code> to be fetched.
- * @return The <code>Node</code> with a <code>name</code> or
- * <code>id</code> attribute whose value corresponds to the specified
- * string. Upon failure (e.g., no node with this name exists), returns
- * <code>null</code>.
- */
- public Node namedItem(String name);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLParagraphElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLParagraphElement.java
deleted file mode 100644
index 1cb8e04203b..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLParagraphElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Paragraphs. See the P element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLParagraphElement extends HTMLElement {
- /**
- * Horizontal text alignment. See the align attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Horizontal text alignment. See the align attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLParamElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLParamElement.java
deleted file mode 100644
index ecf91c287d3..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLParamElement.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Parameters fed to the <code>OBJECT</code> element. See the PARAM element
- * definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLParamElement extends HTMLElement {
- /**
- * The name of a run-time parameter. See the name attribute definition in
- * HTML 4.01.
- */
- public String getName();
- /**
- * The name of a run-time parameter. See the name attribute definition in
- * HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * Content type for the <code>value</code> attribute when
- * <code>valuetype</code> has the value "ref". See the type attribute
- * definition in HTML 4.01.
- */
- public String getType();
- /**
- * Content type for the <code>value</code> attribute when
- * <code>valuetype</code> has the value "ref". See the type attribute
- * definition in HTML 4.01.
- */
- public void setType(String type);
-
- /**
- * The value of a run-time parameter. See the value attribute definition
- * in HTML 4.01.
- */
- public String getValue();
- /**
- * The value of a run-time parameter. See the value attribute definition
- * in HTML 4.01.
- */
- public void setValue(String value);
-
- /**
- * Information about the meaning of the <code>value</code> attribute
- * value. See the valuetype attribute definition in HTML 4.01.
- */
- public String getValueType();
- /**
- * Information about the meaning of the <code>value</code> attribute
- * value. See the valuetype attribute definition in HTML 4.01.
- */
- public void setValueType(String valueType);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLPreElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLPreElement.java
deleted file mode 100644
index bab7358a730..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLPreElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Preformatted text. See the PRE element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLPreElement extends HTMLElement {
- /**
- * Fixed width for content. See the width attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public int getWidth();
- /**
- * Fixed width for content. See the width attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setWidth(int width);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLQuoteElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLQuoteElement.java
deleted file mode 100644
index c7cc666f417..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLQuoteElement.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * For the <code>Q</code> and <code>BLOCKQUOTE</code> elements. See the Q
- * element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLQuoteElement extends HTMLElement {
- /**
- * A URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a source document or message. See the cite attribute
- * definition in HTML 4.01.
- */
- public String getCite();
- /**
- * A URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating a source document or message. See the cite attribute
- * definition in HTML 4.01.
- */
- public void setCite(String cite);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLScriptElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLScriptElement.java
deleted file mode 100644
index a35f7ddc1cb..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLScriptElement.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Script statements. See the SCRIPT element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLScriptElement extends HTMLElement {
- /**
- * The script content of the element.
- */
- public String getText();
- /**
- * The script content of the element.
- */
- public void setText(String text);
-
- /**
- * Reserved for future use.
- */
- public String getHtmlFor();
- /**
- * Reserved for future use.
- */
- public void setHtmlFor(String htmlFor);
-
- /**
- * Reserved for future use.
- */
- public String getEvent();
- /**
- * Reserved for future use.
- */
- public void setEvent(String event);
-
- /**
- * The character encoding of the linked resource. See the charset
- * attribute definition in HTML 4.01.
- */
- public String getCharset();
- /**
- * The character encoding of the linked resource. See the charset
- * attribute definition in HTML 4.01.
- */
- public void setCharset(String charset);
-
- /**
- * Indicates that the user agent can defer processing of the script. See
- * the defer attribute definition in HTML 4.01.
- */
- public boolean getDefer();
- /**
- * Indicates that the user agent can defer processing of the script. See
- * the defer attribute definition in HTML 4.01.
- */
- public void setDefer(boolean defer);
-
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating an external script. See the src attribute definition
- * in HTML 4.01.
- */
- public String getSrc();
- /**
- * URI [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>] designating an external script. See the src attribute definition
- * in HTML 4.01.
- */
- public void setSrc(String src);
-
- /**
- * The content type of the script language. See the type attribute
- * definition in HTML 4.01.
- */
- public String getType();
- /**
- * The content type of the script language. See the type attribute
- * definition in HTML 4.01.
- */
- public void setType(String type);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLSelectElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLSelectElement.java
deleted file mode 100644
index c5d83b05182..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLSelectElement.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The select element allows the selection of an option. The contained options
- * can be directly accessed through the select element as a collection. See
- * the SELECT element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLSelectElement extends HTMLElement {
- /**
- * The type of this form control. This is the string "select-multiple"
- * when the multiple attribute is <code>true</code> and the string
- * "select-one" when <code>false</code>.
- */
- public String getType();
-
- /**
- * The ordinal index of the selected option, starting from 0. The value -1
- * is returned if no element is selected. If multiple options are
- * selected, the index of the first selected option is returned.
- */
- public int getSelectedIndex();
- /**
- * The ordinal index of the selected option, starting from 0. The value -1
- * is returned if no element is selected. If multiple options are
- * selected, the index of the first selected option is returned.
- */
- public void setSelectedIndex(int selectedIndex);
-
- /**
- * The current form control value (i.e. the value of the currently
- * selected option), if multiple options are selected this is the value
- * of the first selected option.
- */
- public String getValue();
- /**
- * The current form control value (i.e. the value of the currently
- * selected option), if multiple options are selected this is the value
- * of the first selected option.
- */
- public void setValue(String value);
-
- /**
- * The number of options in this <code>SELECT</code>.
- * @version DOM Level 2
- */
- public int getLength();
- /**
- * The number of options in this <code>SELECT</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: if setting the length is not allowed by the
- * implementation.
- * @version DOM Level 2
- */
- public void setLength(int length)
- throws DOMException;
-
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a
- * form.
- */
- public HTMLFormElement getForm();
-
- /**
- * The collection of <code>OPTION</code> elements contained by this
- * element.
- * @version DOM Level 2
- */
- public HTMLOptionsCollection getOptions();
-
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public boolean getDisabled();
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public void setDisabled(boolean disabled);
-
- /**
- * If true, multiple <code>OPTION</code> elements may be selected in this
- * <code>SELECT</code>. See the multiple attribute definition in HTML
- * 4.01.
- */
- public boolean getMultiple();
- /**
- * If true, multiple <code>OPTION</code> elements may be selected in this
- * <code>SELECT</code>. See the multiple attribute definition in HTML
- * 4.01.
- */
- public void setMultiple(boolean multiple);
-
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.01.
- */
- public String getName();
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * Number of visible rows. See the size attribute definition in HTML 4.01.
- */
- public int getSize();
- /**
- * Number of visible rows. See the size attribute definition in HTML 4.01.
- */
- public void setSize(int size);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public int getTabIndex();
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public void setTabIndex(int tabIndex);
-
- /**
- * Add a new element to the collection of <code>OPTION</code> elements for
- * this <code>SELECT</code>. This method is the equivalent of the
- * <code>appendChild</code> method of the <code>Node</code> interface if
- * the <code>before</code> parameter is <code>null</code>. It is
- * equivalent to the <code>insertBefore</code> method on the parent of
- * <code>before</code> in all other cases. This method may have no
- * effect if the new element is not an <code>OPTION</code> or an
- * <code>OPTGROUP</code>.
- * @param element The element to add.
- * @param before The element to insert before, or <code>null</code> for
- * the tail of the list.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised if <code>before</code> is not a descendant of
- * the <code>SELECT</code> element.
- */
- public void add(HTMLElement element,
- HTMLElement before)
- throws DOMException;
-
- /**
- * Remove an element from the collection of <code>OPTION</code> elements
- * for this <code>SELECT</code>. Does nothing if no element has the
- * given index.
- * @param index The index of the item to remove, starting from 0.
- */
- public void remove(int index);
-
- /**
- * Removes keyboard focus from this element.
- */
- public void blur();
-
- /**
- * Gives keyboard focus to this element.
- */
- public void focus();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLStyleElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLStyleElement.java
deleted file mode 100644
index 148bcda1cf2..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLStyleElement.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Style information. See the STYLE element definition in HTML 4.01, the CSS
- * module [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>DOM Level 2 Style Sheets and CSS</a>] and the <code>LinkStyle</code> interface in the StyleSheets
- * module [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>DOM Level 2 Style Sheets and CSS</a>].
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLStyleElement extends HTMLElement {
- /**
- * Enables/disables the style sheet.
- */
- public boolean getDisabled();
- /**
- * Enables/disables the style sheet.
- */
- public void setDisabled(boolean disabled);
-
- /**
- * Designed for use with one or more target media. See the media attribute
- * definition in HTML 4.01.
- */
- public String getMedia();
- /**
- * Designed for use with one or more target media. See the media attribute
- * definition in HTML 4.01.
- */
- public void setMedia(String media);
-
- /**
- * The content type of the style sheet language. See the type attribute
- * definition in HTML 4.01.
- */
- public String getType();
- /**
- * The content type of the style sheet language. See the type attribute
- * definition in HTML 4.01.
- */
- public void setType(String type);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableCaptionElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableCaptionElement.java
deleted file mode 100644
index 6c0d872e541..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableCaptionElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Table caption See the CAPTION element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLTableCaptionElement extends HTMLElement {
- /**
- * Caption alignment with respect to the table. See the align attribute
- * definition in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Caption alignment with respect to the table. See the align attribute
- * definition in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableCellElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableCellElement.java
deleted file mode 100644
index 1e8dc3d4738..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableCellElement.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * The object used to represent the <code>TH</code> and <code>TD</code>
- * elements. See the TD element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLTableCellElement extends HTMLElement {
- /**
- * The index of this cell in the row, starting from 0. This index is in
- * document tree order and not display order.
- */
- public int getCellIndex();
-
- /**
- * Abbreviation for header cells. See the abbr attribute definition in
- * HTML 4.01.
- */
- public String getAbbr();
- /**
- * Abbreviation for header cells. See the abbr attribute definition in
- * HTML 4.01.
- */
- public void setAbbr(String abbr);
-
- /**
- * Horizontal alignment of data in cell. See the align attribute definition
- * in HTML 4.01.
- */
- public String getAlign();
- /**
- * Horizontal alignment of data in cell. See the align attribute definition
- * in HTML 4.01.
- */
- public void setAlign(String align);
-
- /**
- * Names group of related headers. See the axis attribute definition in
- * HTML 4.01.
- */
- public String getAxis();
- /**
- * Names group of related headers. See the axis attribute definition in
- * HTML 4.01.
- */
- public void setAxis(String axis);
-
- /**
- * Cell background color. See the bgcolor attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getBgColor();
- /**
- * Cell background color. See the bgcolor attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setBgColor(String bgColor);
-
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.01.
- */
- public String getCh();
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.01.
- */
- public void setCh(String ch);
-
- /**
- * Offset of alignment character. See the charoff attribute definition in
- * HTML 4.01.
- */
- public String getChOff();
- /**
- * Offset of alignment character. See the charoff attribute definition in
- * HTML 4.01.
- */
- public void setChOff(String chOff);
-
- /**
- * Number of columns spanned by cell. See the colspan attribute definition
- * in HTML 4.01.
- */
- public int getColSpan();
- /**
- * Number of columns spanned by cell. See the colspan attribute definition
- * in HTML 4.01.
- */
- public void setColSpan(int colSpan);
-
- /**
- * List of <code>id</code> attribute values for header cells. See the
- * headers attribute definition in HTML 4.01.
- */
- public String getHeaders();
- /**
- * List of <code>id</code> attribute values for header cells. See the
- * headers attribute definition in HTML 4.01.
- */
- public void setHeaders(String headers);
-
- /**
- * Cell height. See the height attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getHeight();
- /**
- * Cell height. See the height attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setHeight(String height);
-
- /**
- * Suppress word wrapping. See the nowrap attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public boolean getNoWrap();
- /**
- * Suppress word wrapping. See the nowrap attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setNoWrap(boolean noWrap);
-
- /**
- * Number of rows spanned by cell. See the rowspan attribute definition in
- * HTML 4.01.
- */
- public int getRowSpan();
- /**
- * Number of rows spanned by cell. See the rowspan attribute definition in
- * HTML 4.01.
- */
- public void setRowSpan(int rowSpan);
-
- /**
- * Scope covered by header cells. See the scope attribute definition in
- * HTML 4.01.
- */
- public String getScope();
- /**
- * Scope covered by header cells. See the scope attribute definition in
- * HTML 4.01.
- */
- public void setScope(String scope);
-
- /**
- * Vertical alignment of data in cell. See the valign attribute definition
- * in HTML 4.01.
- */
- public String getVAlign();
- /**
- * Vertical alignment of data in cell. See the valign attribute definition
- * in HTML 4.01.
- */
- public void setVAlign(String vAlign);
-
- /**
- * Cell width. See the width attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getWidth();
- /**
- * Cell width. See the width attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setWidth(String width);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableColElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableColElement.java
deleted file mode 100644
index 85a42ddd2bb..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableColElement.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Regroups the <code>COL</code> and <code>COLGROUP</code> elements. See the
- * COL element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLTableColElement extends HTMLElement {
- /**
- * Horizontal alignment of cell data in column. See the align attribute
- * definition in HTML 4.01.
- */
- public String getAlign();
- /**
- * Horizontal alignment of cell data in column. See the align attribute
- * definition in HTML 4.01.
- */
- public void setAlign(String align);
-
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.01.
- */
- public String getCh();
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.01.
- */
- public void setCh(String ch);
-
- /**
- * Offset of alignment character. See the charoff attribute definition in
- * HTML 4.01.
- */
- public String getChOff();
- /**
- * Offset of alignment character. See the charoff attribute definition in
- * HTML 4.01.
- */
- public void setChOff(String chOff);
-
- /**
- * Indicates the number of columns in a group or affected by a grouping.
- * See the span attribute definition in HTML 4.01.
- */
- public int getSpan();
- /**
- * Indicates the number of columns in a group or affected by a grouping.
- * See the span attribute definition in HTML 4.01.
- */
- public void setSpan(int span);
-
- /**
- * Vertical alignment of cell data in column. See the valign attribute
- * definition in HTML 4.01.
- */
- public String getVAlign();
- /**
- * Vertical alignment of cell data in column. See the valign attribute
- * definition in HTML 4.01.
- */
- public void setVAlign(String vAlign);
-
- /**
- * Default column width. See the width attribute definition in HTML 4.01.
- */
- public String getWidth();
- /**
- * Default column width. See the width attribute definition in HTML 4.01.
- */
- public void setWidth(String width);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableElement.java
deleted file mode 100644
index d36b19cfa78..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableElement.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The create* and delete* methods on the table allow authors to construct and
- * modify tables. [<a href='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>] specifies that only one of each of the
- * <code>CAPTION</code>, <code>THEAD</code>, and <code>TFOOT</code> elements
- * may exist in a table. Therefore, if one exists, and the createTHead() or
- * createTFoot() method is called, the method returns the existing THead or
- * TFoot element. See the TABLE element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLTableElement extends HTMLElement {
- /**
- * Returns the table's <code>CAPTION</code>, or void if none exists.
- * @version DOM Level 2
- */
- public HTMLTableCaptionElement getCaption();
- /**
- * Returns the table's <code>CAPTION</code>, or void if none exists.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: if the element is not a <code>CAPTION</code>.
- * @version DOM Level 2
- */
- public void setCaption(HTMLTableCaptionElement caption)
- throws DOMException;
-
- /**
- * Returns the table's <code>THEAD</code>, or <code>null</code> if none
- * exists.
- * @version DOM Level 2
- */
- public HTMLTableSectionElement getTHead();
- /**
- * Returns the table's <code>THEAD</code>, or <code>null</code> if none
- * exists.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: if the element is not a <code>THEAD</code>.
- * @version DOM Level 2
- */
- public void setTHead(HTMLTableSectionElement tHead)
- throws DOMException;
-
- /**
- * Returns the table's <code>TFOOT</code>, or <code>null</code> if none
- * exists.
- * @version DOM Level 2
- */
- public HTMLTableSectionElement getTFoot();
- /**
- * Returns the table's <code>TFOOT</code>, or <code>null</code> if none
- * exists.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: if the element is not a <code>TFOOT</code>.
- * @version DOM Level 2
- */
- public void setTFoot(HTMLTableSectionElement tFoot)
- throws DOMException;
-
- /**
- * Returns a collection of all the rows in the table, including all in
- * <code>THEAD</code>, <code>TFOOT</code>, all <code>TBODY</code>
- * elements.
- */
- public HTMLCollection getRows();
-
- /**
- * Returns a collection of the table bodies (including implicit ones).
- */
- public HTMLCollection getTBodies();
-
- /**
- * Specifies the table's position with respect to the rest of the
- * document. See the align attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getAlign();
- /**
- * Specifies the table's position with respect to the rest of the
- * document. See the align attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setAlign(String align);
-
- /**
- * Cell background color. See the bgcolor attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getBgColor();
- /**
- * Cell background color. See the bgcolor attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setBgColor(String bgColor);
-
- /**
- * The width of the border around the table. See the border attribute
- * definition in HTML 4.01.
- */
- public String getBorder();
- /**
- * The width of the border around the table. See the border attribute
- * definition in HTML 4.01.
- */
- public void setBorder(String border);
-
- /**
- * Specifies the horizontal and vertical space between cell content and
- * cell borders. See the cellpadding attribute definition in HTML 4.01.
- */
- public String getCellPadding();
- /**
- * Specifies the horizontal and vertical space between cell content and
- * cell borders. See the cellpadding attribute definition in HTML 4.01.
- */
- public void setCellPadding(String cellPadding);
-
- /**
- * Specifies the horizontal and vertical separation between cells. See the
- * cellspacing attribute definition in HTML 4.01.
- */
- public String getCellSpacing();
- /**
- * Specifies the horizontal and vertical separation between cells. See the
- * cellspacing attribute definition in HTML 4.01.
- */
- public void setCellSpacing(String cellSpacing);
-
- /**
- * Specifies which external table borders to render. See the frame
- * attribute definition in HTML 4.01.
- */
- public String getFrame();
- /**
- * Specifies which external table borders to render. See the frame
- * attribute definition in HTML 4.01.
- */
- public void setFrame(String frame);
-
- /**
- * Specifies which internal table borders to render. See the rules
- * attribute definition in HTML 4.01.
- */
- public String getRules();
- /**
- * Specifies which internal table borders to render. See the rules
- * attribute definition in HTML 4.01.
- */
- public void setRules(String rules);
-
- /**
- * Description about the purpose or structure of a table. See the summary
- * attribute definition in HTML 4.01.
- */
- public String getSummary();
- /**
- * Description about the purpose or structure of a table. See the summary
- * attribute definition in HTML 4.01.
- */
- public void setSummary(String summary);
-
- /**
- * Specifies the desired table width. See the width attribute definition
- * in HTML 4.01.
- */
- public String getWidth();
- /**
- * Specifies the desired table width. See the width attribute definition
- * in HTML 4.01.
- */
- public void setWidth(String width);
-
- /**
- * Create a table header row or return an existing one.
- * @return A new table header element (<code>THEAD</code>).
- */
- public HTMLElement createTHead();
-
- /**
- * Delete the header from the table, if one exists.
- */
- public void deleteTHead();
-
- /**
- * Create a table footer row or return an existing one.
- * @return A footer element (<code>TFOOT</code>).
- */
- public HTMLElement createTFoot();
-
- /**
- * Delete the footer from the table, if one exists.
- */
- public void deleteTFoot();
-
- /**
- * Create a new table caption object or return an existing one.
- * @return A <code>CAPTION</code> element.
- */
- public HTMLElement createCaption();
-
- /**
- * Delete the table caption, if one exists.
- */
- public void deleteCaption();
-
- /**
- * Insert a new empty row in the table. The new row is inserted
- * immediately before and in the same section as the current
- * <code>index</code>th row in the table. If <code>index</code> is -1 or
- * equal to the number of rows, the new row is appended. In addition,
- * when the table is empty the row is inserted into a <code>TBODY</code>
- * which is created and inserted into the table.A table row cannot be
- * empty according to [<a href='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>].
- * @param index The row number where to insert a new row. This index
- * starts from 0 and is relative to the logical order (not document
- * order) of all the rows contained inside the table.
- * @return The newly created row.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index is greater than the
- * number of rows or if the index is a negative number other than -1.
- * @version DOM Level 2
- */
- public HTMLElement insertRow(int index)
- throws DOMException;
-
- /**
- * Delete a table row.
- * @param index The index of the row to be deleted. This index starts
- * from 0 and is relative to the logical order (not document order) of
- * all the rows contained inside the table. If the index is -1 the
- * last row in the table is deleted.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index is greater than or
- * equal to the number of rows or if the index is a negative number
- * other than -1.
- * @version DOM Level 2
- */
- public void deleteRow(int index)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableRowElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableRowElement.java
deleted file mode 100644
index 9f4fbf96c67..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableRowElement.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.DOMException;
-
-/**
- * A row in a table. See the TR element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLTableRowElement extends HTMLElement {
- /**
- * This is in logical order and not in document order. The
- * <code>rowIndex</code> does take into account sections (
- * <code>THEAD</code>, <code>TFOOT</code>, or <code>TBODY</code>) within
- * the table, placing <code>THEAD</code> rows first in the index,
- * followed by <code>TBODY</code> rows, followed by <code>TFOOT</code>
- * rows.
- * @version DOM Level 2
- */
- public int getRowIndex();
-
- /**
- * The index of this row, relative to the current section (
- * <code>THEAD</code>, <code>TFOOT</code>, or <code>TBODY</code>),
- * starting from 0.
- * @version DOM Level 2
- */
- public int getSectionRowIndex();
-
- /**
- * The collection of cells in this row.
- * @version DOM Level 2
- */
- public HTMLCollection getCells();
-
- /**
- * Horizontal alignment of data within cells of this row. See the align
- * attribute definition in HTML 4.01.
- */
- public String getAlign();
- /**
- * Horizontal alignment of data within cells of this row. See the align
- * attribute definition in HTML 4.01.
- */
- public void setAlign(String align);
-
- /**
- * Background color for rows. See the bgcolor attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public String getBgColor();
- /**
- * Background color for rows. See the bgcolor attribute definition in HTML
- * 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setBgColor(String bgColor);
-
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.01.
- */
- public String getCh();
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.01.
- */
- public void setCh(String ch);
-
- /**
- * Offset of alignment character. See the charoff attribute definition in
- * HTML 4.01.
- */
- public String getChOff();
- /**
- * Offset of alignment character. See the charoff attribute definition in
- * HTML 4.01.
- */
- public void setChOff(String chOff);
-
- /**
- * Vertical alignment of data within cells of this row. See the valign
- * attribute definition in HTML 4.01.
- */
- public String getVAlign();
- /**
- * Vertical alignment of data within cells of this row. See the valign
- * attribute definition in HTML 4.01.
- */
- public void setVAlign(String vAlign);
-
- /**
- * Insert an empty <code>TD</code> cell into this row. If
- * <code>index</code> is -1 or equal to the number of cells, the new
- * cell is appended.
- * @param index The place to insert the cell, starting from 0.
- * @return The newly created cell.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>index</code> is greater
- * than the number of cells or if the index is a negative number other
- * than -1.
- * @version DOM Level 2
- */
- public HTMLElement insertCell(int index)
- throws DOMException;
-
- /**
- * Delete a cell from the current row.
- * @param index The index of the cell to delete, starting from 0. If the
- * index is -1 the last cell in the row is deleted.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>index</code> is greater
- * than or equal to the number of cells or if the index is a negative
- * number other than -1.
- * @version DOM Level 2
- */
- public void deleteCell(int index)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableSectionElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableSectionElement.java
deleted file mode 100644
index 5aa6ce4402d..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTableSectionElement.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>THEAD</code>, <code>TFOOT</code>, and <code>TBODY</code>
- * elements.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLTableSectionElement extends HTMLElement {
- /**
- * Horizontal alignment of data in cells. See the <code>align</code>
- * attribute for HTMLTheadElement for details.
- */
- public String getAlign();
- /**
- * Horizontal alignment of data in cells. See the <code>align</code>
- * attribute for HTMLTheadElement for details.
- */
- public void setAlign(String align);
-
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.01.
- */
- public String getCh();
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.01.
- */
- public void setCh(String ch);
-
- /**
- * Offset of alignment character. See the charoff attribute definition in
- * HTML 4.01.
- */
- public String getChOff();
- /**
- * Offset of alignment character. See the charoff attribute definition in
- * HTML 4.01.
- */
- public void setChOff(String chOff);
-
- /**
- * Vertical alignment of data in cells. See the <code>valign</code>
- * attribute for HTMLTheadElement for details.
- */
- public String getVAlign();
- /**
- * Vertical alignment of data in cells. See the <code>valign</code>
- * attribute for HTMLTheadElement for details.
- */
- public void setVAlign(String vAlign);
-
- /**
- * The collection of rows in this table section.
- */
- public HTMLCollection getRows();
-
- /**
- * Insert a row into this section. The new row is inserted immediately
- * before the current <code>index</code>th row in this section. If
- * <code>index</code> is -1 or equal to the number of rows in this
- * section, the new row is appended.
- * @param index The row number where to insert a new row. This index
- * starts from 0 and is relative only to the rows contained inside
- * this section, not all the rows in the table.
- * @return The newly created row.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index is greater than the
- * number of rows of if the index is a negative number other than -1.
- * @version DOM Level 2
- */
- public HTMLElement insertRow(int index)
- throws DOMException;
-
- /**
- * Delete a row from this section.
- * @param index The index of the row to be deleted, or -1 to delete the
- * last row. This index starts from 0 and is relative only to the rows
- * contained inside this section, not all the rows in the table.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index is greater than or
- * equal to the number of rows or if the index is a negative number
- * other than -1.
- * @version DOM Level 2
- */
- public void deleteRow(int index)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTextAreaElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTextAreaElement.java
deleted file mode 100644
index ed5c6c978d6..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTextAreaElement.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Multi-line text field. See the TEXTAREA element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLTextAreaElement extends HTMLElement {
- /**
- * Represents the contents of the element. The value of this attribute
- * does not change if the contents of the corresponding form control, in
- * an interactive user agent, changes.
- * @version DOM Level 2
- */
- public String getDefaultValue();
- /**
- * Represents the contents of the element. The value of this attribute
- * does not change if the contents of the corresponding form control, in
- * an interactive user agent, changes.
- * @version DOM Level 2
- */
- public void setDefaultValue(String defaultValue);
-
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a
- * form.
- */
- public HTMLFormElement getForm();
-
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public String getAccessKey();
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.01.
- */
- public void setAccessKey(String accessKey);
-
- /**
- * Width of control (in characters). See the cols attribute definition in
- * HTML 4.01.
- */
- public int getCols();
- /**
- * Width of control (in characters). See the cols attribute definition in
- * HTML 4.01.
- */
- public void setCols(int cols);
-
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public boolean getDisabled();
- /**
- * The control is unavailable in this context. See the disabled attribute
- * definition in HTML 4.01.
- */
- public void setDisabled(boolean disabled);
-
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.01.
- */
- public String getName();
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.01.
- */
- public void setName(String name);
-
- /**
- * This control is read-only. See the readonly attribute definition in
- * HTML 4.01.
- */
- public boolean getReadOnly();
- /**
- * This control is read-only. See the readonly attribute definition in
- * HTML 4.01.
- */
- public void setReadOnly(boolean readOnly);
-
- /**
- * Number of text rows. See the rows attribute definition in HTML 4.01.
- */
- public int getRows();
- /**
- * Number of text rows. See the rows attribute definition in HTML 4.01.
- */
- public void setRows(int rows);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public int getTabIndex();
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.01.
- */
- public void setTabIndex(int tabIndex);
-
- /**
- * The type of this form control. This the string "textarea".
- */
- public String getType();
-
- /**
- * Represents the current contents of the corresponding form control, in
- * an interactive user agent. Changing this attribute changes the
- * contents of the form control, but does not change the contents of the
- * element. If the entirety of the data can not fit into a single
- * <code>DOMString</code>, the implementation may truncate the data.
- */
- public String getValue();
- /**
- * Represents the current contents of the corresponding form control, in
- * an interactive user agent. Changing this attribute changes the
- * contents of the form control, but does not change the contents of the
- * element. If the entirety of the data can not fit into a single
- * <code>DOMString</code>, the implementation may truncate the data.
- */
- public void setValue(String value);
-
- /**
- * Removes keyboard focus from this element.
- */
- public void blur();
-
- /**
- * Gives keyboard focus to this element.
- */
- public void focus();
-
- /**
- * Select the contents of the <code>TEXTAREA</code>.
- */
- public void select();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTitleElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTitleElement.java
deleted file mode 100644
index 67122bb0a71..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLTitleElement.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * The document title. See the TITLE element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLTitleElement extends HTMLElement {
- /**
- * The specified title as a string.
- */
- public String getText();
- /**
- * The specified title as a string.
- */
- public void setText(String text);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLUListElement.java b/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLUListElement.java
deleted file mode 100644
index 61ccb322f45..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/html2/HTMLUListElement.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2003 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.html2;
-
-/**
- * Unordered list. See the UL element definition in HTML 4.01.
- * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
- */
-public interface HTMLUListElement extends HTMLElement {
- /**
- * Reduce spacing between list items. See the compact attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public boolean getCompact();
- /**
- * Reduce spacing between list items. See the compact attribute definition
- * in HTML 4.01. This attribute is deprecated in HTML 4.01.
- */
- public void setCompact(boolean compact);
-
- /**
- * Bullet style. See the type attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public String getType();
- /**
- * Bullet style. See the type attribute definition in HTML 4.01. This
- * attribute is deprecated in HTML 4.01.
- */
- public void setType(String type);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/DOMImplementationLS.java b/libjava/external/w3c_dom/org/w3c/dom/ls/DOMImplementationLS.java
deleted file mode 100644
index c94fc8e4651..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/DOMImplementationLS.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.DOMException;
-
-/**
- * <code>DOMImplementationLS</code> contains the factory methods for creating
- * Load and Save objects.
- * <p> The expectation is that an instance of the
- * <code>DOMImplementationLS</code> interface can be obtained by using
- * binding-specific casting methods on an instance of the
- * <code>DOMImplementation</code> interface or, if the <code>Document</code>
- * supports the feature <code>"Core"</code> version <code>"3.0"</code>
- * defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , by using the method <code>DOMImplementation.getFeature</code> with
- * parameter values <code>"LS"</code> (or <code>"LS-Async"</code>) and
- * <code>"3.0"</code> (respectively).
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface DOMImplementationLS {
- // DOMImplementationLSMode
- /**
- * Create a synchronous <code>LSParser</code>.
- */
- public static final short MODE_SYNCHRONOUS = 1;
- /**
- * Create an asynchronous <code>LSParser</code>.
- */
- public static final short MODE_ASYNCHRONOUS = 2;
-
- /**
- * Create a new <code>LSParser</code>. The newly constructed parser may
- * then be configured by means of its <code>DOMConfiguration</code>
- * object, and used to parse documents by means of its <code>parse</code>
- * method.
- * @param mode The <code>mode</code> argument is either
- * <code>MODE_SYNCHRONOUS</code> or <code>MODE_ASYNCHRONOUS</code>, if
- * <code>mode</code> is <code>MODE_SYNCHRONOUS</code> then the
- * <code>LSParser</code> that is created will operate in synchronous
- * mode, if it's <code>MODE_ASYNCHRONOUS</code> then the
- * <code>LSParser</code> that is created will operate in asynchronous
- * mode.
- * @param schemaType An absolute URI representing the type of the schema
- * language used during the load of a <code>Document</code> using the
- * newly created <code>LSParser</code>. Note that no lexical checking
- * is done on the absolute URI. In order to create a
- * <code>LSParser</code> for any kind of schema types (i.e. the
- * LSParser will be free to use any schema found), use the value
- * <code>null</code>.
- * <p ><b>Note:</b> For W3C XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , applications must use the value
- * <code>"http://www.w3.org/2001/XMLSchema"</code>. For XML DTD [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>],
- * applications must use the value
- * <code>"http://www.w3.org/TR/REC-xml"</code>. Other Schema languages
- * are outside the scope of the W3C and therefore should recommend an
- * absolute URI in order to use this method.
- * @return The newly created <code>LSParser</code> object. This
- * <code>LSParser</code> is either synchronous or asynchronous
- * depending on the value of the <code>mode</code> argument.
- * <p ><b>Note:</b> By default, the newly created <code>LSParser</code>
- * does not contain a <code>DOMErrorHandler</code>, i.e. the value of
- * the "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" configuration parameter is <code>null</code>. However, implementations
- * may provide a default error handler at creation time. In that case,
- * the initial value of the <code>"error-handler"</code> configuration
- * parameter on the new <code>LSParser</code> object contains a
- * reference to the default error handler.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the requested mode or schema type is
- * not supported.
- */
- public LSParser createLSParser(short mode,
- String schemaType)
- throws DOMException;
-
- /**
- * Create a new <code>LSSerializer</code> object.
- * @return The newly created <code>LSSerializer</code> object.
- * <p ><b>Note:</b> By default, the newly created
- * <code>LSSerializer</code> has no <code>DOMErrorHandler</code>, i.e.
- * the value of the <code>"error-handler"</code> configuration
- * parameter is <code>null</code>. However, implementations may
- * provide a default error handler at creation time. In that case, the
- * initial value of the <code>"error-handler"</code> configuration
- * parameter on the new <code>LSSerializer</code> object contains a
- * reference to the default error handler.
- */
- public LSSerializer createLSSerializer();
-
- /**
- * Create a new empty input source object where
- * <code>LSInput.characterStream</code>, <code>LSInput.byteStream</code>
- * , <code>LSInput.stringData</code> <code>LSInput.systemId</code>,
- * <code>LSInput.publicId</code>, <code>LSInput.baseURI</code>, and
- * <code>LSInput.encoding</code> are null, and
- * <code>LSInput.certifiedText</code> is false.
- * @return The newly created input object.
- */
- public LSInput createLSInput();
-
- /**
- * Create a new empty output destination object where
- * <code>LSOutput.characterStream</code>,
- * <code>LSOutput.byteStream</code>, <code>LSOutput.systemId</code>,
- * <code>LSOutput.encoding</code> are null.
- * @return The newly created output object.
- */
- public LSOutput createLSOutput();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/LSException.java b/libjava/external/w3c_dom/org/w3c/dom/ls/LSException.java
deleted file mode 100644
index 65a83f0ded1..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/LSException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-/**
- * Parser or write operations may throw an <code>LSException</code> if the
- * processing is stopped. The processing can be stopped due to a
- * <code>DOMError</code> with a severity of
- * <code>DOMError.SEVERITY_FATAL_ERROR</code> or a non recovered
- * <code>DOMError.SEVERITY_ERROR</code>, or if
- * <code>DOMErrorHandler.handleError()</code> returned <code>false</code>.
- * <p ><b>Note:</b> As suggested in the definition of the constants in the
- * <code>DOMError</code> interface, a DOM implementation may choose to
- * continue after a fatal error, but the resulting DOM tree is then
- * implementation dependent.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public class LSException extends RuntimeException {
- public LSException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // LSExceptionCode
- /**
- * If an attempt was made to load a document, or an XML Fragment, using
- * <code>LSParser</code> and the processing has been stopped.
- */
- public static final short PARSE_ERR = 81;
- /**
- * If an attempt was made to serialize a <code>Node</code> using
- * <code>LSSerializer</code> and the processing has been stopped.
- */
- public static final short SERIALIZE_ERR = 82;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/LSInput.java b/libjava/external/w3c_dom/org/w3c/dom/ls/LSInput.java
deleted file mode 100644
index 862bf7703b7..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/LSInput.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-/**
- * This interface represents an input source for data.
- * <p> This interface allows an application to encapsulate information about
- * an input source in a single object, which may include a public
- * identifier, a system identifier, a byte stream (possibly with a specified
- * encoding), a base URI, and/or a character stream.
- * <p> The exact definitions of a byte stream and a character stream are
- * binding dependent.
- * <p> The application is expected to provide objects that implement this
- * interface whenever such objects are needed. The application can either
- * provide its own objects that implement this interface, or it can use the
- * generic factory method <code>DOMImplementationLS.createLSInput()</code>
- * to create objects that implement this interface.
- * <p> The <code>LSParser</code> will use the <code>LSInput</code> object to
- * determine how to read data. The <code>LSParser</code> will look at the
- * different inputs specified in the <code>LSInput</code> in the following
- * order to know which one to read from, the first one that is not null and
- * not an empty string will be used:
- * <ol>
- * <li> <code>LSInput.characterStream</code>
- * </li>
- * <li>
- * <code>LSInput.byteStream</code>
- * </li>
- * <li> <code>LSInput.stringData</code>
- * </li>
- * <li>
- * <code>LSInput.systemId</code>
- * </li>
- * <li> <code>LSInput.publicId</code>
- * </li>
- * </ol>
- * <p> If all inputs are null, the <code>LSParser</code> will report a
- * <code>DOMError</code> with its <code>DOMError.type</code> set to
- * <code>"no-input-specified"</code> and its <code>DOMError.severity</code>
- * set to <code>DOMError.SEVERITY_FATAL_ERROR</code>.
- * <p> <code>LSInput</code> objects belong to the application. The DOM
- * implementation will never modify them (though it may make copies and
- * modify the copies, if necessary).
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSInput {
- /**
- * An attribute of a language and binding dependent type that represents
- * a stream of 16-bit units. The application must encode the stream
- * using UTF-16 (defined in [Unicode] and in [ISO/IEC 10646]). It is not a requirement to have an XML declaration when
- * using character streams. If an XML declaration is present, the value
- * of the encoding attribute will be ignored.
- */
- public java.io.Reader getCharacterStream();
- /**
- * An attribute of a language and binding dependent type that represents
- * a stream of 16-bit units. The application must encode the stream
- * using UTF-16 (defined in [Unicode] and in [ISO/IEC 10646]). It is not a requirement to have an XML declaration when
- * using character streams. If an XML declaration is present, the value
- * of the encoding attribute will be ignored.
- */
- public void setCharacterStream(java.io.Reader characterStream);
-
- /**
- * An attribute of a language and binding dependent type that represents
- * a stream of bytes.
- * <br> If the application knows the character encoding of the byte
- * stream, it should set the encoding attribute. Setting the encoding in
- * this way will override any encoding specified in an XML declaration
- * in the data.
- */
- public java.io.InputStream getByteStream();
- /**
- * An attribute of a language and binding dependent type that represents
- * a stream of bytes.
- * <br> If the application knows the character encoding of the byte
- * stream, it should set the encoding attribute. Setting the encoding in
- * this way will override any encoding specified in an XML declaration
- * in the data.
- */
- public void setByteStream(java.io.InputStream byteStream);
-
- /**
- * String data to parse. If provided, this will always be treated as a
- * sequence of 16-bit units (UTF-16 encoded characters). It is not a
- * requirement to have an XML declaration when using
- * <code>stringData</code>. If an XML declaration is present, the value
- * of the encoding attribute will be ignored.
- */
- public String getStringData();
- /**
- * String data to parse. If provided, this will always be treated as a
- * sequence of 16-bit units (UTF-16 encoded characters). It is not a
- * requirement to have an XML declaration when using
- * <code>stringData</code>. If an XML declaration is present, the value
- * of the encoding attribute will be ignored.
- */
- public void setStringData(String stringData);
-
- /**
- * The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], for this
- * input source. The system identifier is optional if there is a byte
- * stream, a character stream, or string data. It is still useful to
- * provide one, since the application will use it to resolve any
- * relative URIs and can include it in error messages and warnings. (The
- * LSParser will only attempt to fetch the resource identified by the
- * URI reference if there is no other input available in the input
- * source.)
- * <br> If the application knows the character encoding of the object
- * pointed to by the system identifier, it can set the encoding using
- * the <code>encoding</code> attribute.
- * <br> If the specified system ID is a relative URI reference (see
- * section 5 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the DOM
- * implementation will attempt to resolve the relative URI with the
- * <code>baseURI</code> as the base, if that fails, the behavior is
- * implementation dependent.
- */
- public String getSystemId();
- /**
- * The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], for this
- * input source. The system identifier is optional if there is a byte
- * stream, a character stream, or string data. It is still useful to
- * provide one, since the application will use it to resolve any
- * relative URIs and can include it in error messages and warnings. (The
- * LSParser will only attempt to fetch the resource identified by the
- * URI reference if there is no other input available in the input
- * source.)
- * <br> If the application knows the character encoding of the object
- * pointed to by the system identifier, it can set the encoding using
- * the <code>encoding</code> attribute.
- * <br> If the specified system ID is a relative URI reference (see
- * section 5 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the DOM
- * implementation will attempt to resolve the relative URI with the
- * <code>baseURI</code> as the base, if that fails, the behavior is
- * implementation dependent.
- */
- public void setSystemId(String systemId);
-
- /**
- * The public identifier for this input source. This may be mapped to an
- * input source using an implementation dependent mechanism (such as
- * catalogues or other mappings). The public identifier, if specified,
- * may also be reported as part of the location information when errors
- * are reported.
- */
- public String getPublicId();
- /**
- * The public identifier for this input source. This may be mapped to an
- * input source using an implementation dependent mechanism (such as
- * catalogues or other mappings). The public identifier, if specified,
- * may also be reported as part of the location information when errors
- * are reported.
- */
- public void setPublicId(String publicId);
-
- /**
- * The base URI to be used (see section 5.1.4 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]) for
- * resolving a relative <code>systemId</code> to an absolute URI.
- * <br> If, when used, the base URI is itself a relative URI, an empty
- * string, or null, the behavior is implementation dependent.
- */
- public String getBaseURI();
- /**
- * The base URI to be used (see section 5.1.4 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]) for
- * resolving a relative <code>systemId</code> to an absolute URI.
- * <br> If, when used, the base URI is itself a relative URI, an empty
- * string, or null, the behavior is implementation dependent.
- */
- public void setBaseURI(String baseURI);
-
- /**
- * The character encoding, if known. The encoding must be a string
- * acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section
- * 4.3.3 "Character Encoding in Entities").
- * <br> This attribute has no effect when the application provides a
- * character stream or string data. For other sources of input, an
- * encoding specified by means of this attribute will override any
- * encoding specified in the XML declaration or the Text declaration, or
- * an encoding obtained from a higher level protocol, such as HTTP [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>].
- */
- public String getEncoding();
- /**
- * The character encoding, if known. The encoding must be a string
- * acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section
- * 4.3.3 "Character Encoding in Entities").
- * <br> This attribute has no effect when the application provides a
- * character stream or string data. For other sources of input, an
- * encoding specified by means of this attribute will override any
- * encoding specified in the XML declaration or the Text declaration, or
- * an encoding obtained from a higher level protocol, such as HTTP [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>].
- */
- public void setEncoding(String encoding);
-
- /**
- * If set to true, assume that the input is certified (see section 2.13
- * in [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]) when
- * parsing [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>].
- */
- public boolean getCertifiedText();
- /**
- * If set to true, assume that the input is certified (see section 2.13
- * in [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]) when
- * parsing [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>].
- */
- public void setCertifiedText(boolean certifiedText);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/LSLoadEvent.java b/libjava/external/w3c_dom/org/w3c/dom/ls/LSLoadEvent.java
deleted file mode 100644
index 601a5be11b7..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/LSLoadEvent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.events.Event;
-
-/**
- * This interface represents a load event object that signals the completion
- * of a document load.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSLoadEvent extends Event {
- /**
- * The document that finished loading.
- */
- public Document getNewDocument();
-
- /**
- * The input source that was parsed.
- */
- public LSInput getInput();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/LSOutput.java b/libjava/external/w3c_dom/org/w3c/dom/ls/LSOutput.java
deleted file mode 100644
index 2f8675c571e..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/LSOutput.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-/**
- * This interface represents an output destination for data.
- * <p> This interface allows an application to encapsulate information about
- * an output destination in a single object, which may include a URI, a byte
- * stream (possibly with a specified encoding), a base URI, and/or a
- * character stream.
- * <p> The exact definitions of a byte stream and a character stream are
- * binding dependent.
- * <p> The application is expected to provide objects that implement this
- * interface whenever such objects are needed. The application can either
- * provide its own objects that implement this interface, or it can use the
- * generic factory method <code>DOMImplementationLS.createLSOutput()</code>
- * to create objects that implement this interface.
- * <p> The <code>LSSerializer</code> will use the <code>LSOutput</code> object
- * to determine where to serialize the output to. The
- * <code>LSSerializer</code> will look at the different outputs specified in
- * the <code>LSOutput</code> in the following order to know which one to
- * output to, the first one that is not null and not an empty string will be
- * used:
- * <ol>
- * <li> <code>LSOutput.characterStream</code>
- * </li>
- * <li>
- * <code>LSOutput.byteStream</code>
- * </li>
- * <li> <code>LSOutput.systemId</code>
- * </li>
- * </ol>
- * <p> <code>LSOutput</code> objects belong to the application. The DOM
- * implementation will never modify them (though it may make copies and
- * modify the copies, if necessary).
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSOutput {
- /**
- * An attribute of a language and binding dependent type that represents
- * a writable stream to which 16-bit units can be output.
- */
- public java.io.Writer getCharacterStream();
- /**
- * An attribute of a language and binding dependent type that represents
- * a writable stream to which 16-bit units can be output.
- */
- public void setCharacterStream(java.io.Writer characterStream);
-
- /**
- * An attribute of a language and binding dependent type that represents
- * a writable stream of bytes.
- */
- public java.io.OutputStream getByteStream();
- /**
- * An attribute of a language and binding dependent type that represents
- * a writable stream of bytes.
- */
- public void setByteStream(java.io.OutputStream byteStream);
-
- /**
- * The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], for this
- * output destination.
- * <br> If the system ID is a relative URI reference (see section 5 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the
- * behavior is implementation dependent.
- */
- public String getSystemId();
- /**
- * The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], for this
- * output destination.
- * <br> If the system ID is a relative URI reference (see section 5 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the
- * behavior is implementation dependent.
- */
- public void setSystemId(String systemId);
-
- /**
- * The character encoding to use for the output. The encoding must be a
- * string acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section
- * 4.3.3 "Character Encoding in Entities"), it is recommended that
- * character encodings registered (as charsets) with the Internet
- * Assigned Numbers Authority [<a href='ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets'>IANA-CHARSETS</a>]
- * should be referred to using their registered names.
- */
- public String getEncoding();
- /**
- * The character encoding to use for the output. The encoding must be a
- * string acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section
- * 4.3.3 "Character Encoding in Entities"), it is recommended that
- * character encodings registered (as charsets) with the Internet
- * Assigned Numbers Authority [<a href='ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets'>IANA-CHARSETS</a>]
- * should be referred to using their registered names.
- */
- public void setEncoding(String encoding);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/LSParser.java b/libjava/external/w3c_dom/org/w3c/dom/ls/LSParser.java
deleted file mode 100644
index ee918e0dce7..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/LSParser.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * An interface to an object that is able to build, or augment, a DOM tree
- * from various input sources.
- * <p> <code>LSParser</code> provides an API for parsing XML and building the
- * corresponding DOM document structure. A <code>LSParser</code> instance
- * can be obtained by invoking the
- * <code>DOMImplementationLS.createLSParser()</code> method.
- * <p> As specified in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , when a document is first made available via the LSParser:
- * <ul>
- * <li> there will
- * never be two adjacent nodes of type NODE_TEXT, and there will never be
- * empty text nodes.
- * </li>
- * <li> it is expected that the <code>value</code> and
- * <code>nodeValue</code> attributes of an <code>Attr</code> node initially
- * return the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#AVNormalize'>XML 1.0
- * normalized value</a>. However, if the parameters "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate-if-schema'>
- * validate-if-schema</a>" and "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-datatype-normalization'>
- * datatype-normalization</a>" are set to <code>true</code>, depending on the attribute normalization
- * used, the attribute values may differ from the ones obtained by the XML
- * 1.0 attribute normalization. If the parameters "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-datatype-normalization'>
- * datatype-normalization</a>" is set to <code>false</code>, the XML 1.0 attribute normalization is
- * guaranteed to occur, and if the attributes list does not contain
- * namespace declarations, the <code>attributes</code> attribute on
- * <code>Element</code> node represents the property <b>[attributes]</b> defined in [<a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/'>XML Information Set</a>]
- * .
- * </li>
- * </ul>
- * <p> Asynchronous <code>LSParser</code> objects are expected to also
- * implement the <code>events::EventTarget</code> interface so that event
- * listeners can be registered on asynchronous <code>LSParser</code>
- * objects.
- * <p> Events supported by asynchronous <code>LSParser</code> objects are:
- * <dl>
- * <dt>load</dt>
- * <dd>
- * The <code>LSParser</code> finishes to load the document. See also the
- * definition of the <code>LSLoadEvent</code> interface. </dd>
- * <dt>progress</dt>
- * <dd> The
- * <code>LSParser</code> signals progress as data is parsed. This
- * specification does not attempt to define exactly when progress events
- * should be dispatched. That is intentionally left as
- * implementation-dependent. Here is one example of how an application might
- * dispatch progress events: Once the parser starts receiving data, a
- * progress event is dispatched to indicate that the parsing starts. From
- * there on, a progress event is dispatched for every 4096 bytes of data
- * that is received and processed. This is only one example, though, and
- * implementations can choose to dispatch progress events at any time while
- * parsing, or not dispatch them at all. See also the definition of the
- * <code>LSProgressEvent</code> interface. </dd>
- * </dl>
- * <p ><b>Note:</b> All events defined in this specification use the
- * namespace URI <code>"http://www.w3.org/2002/DOMLS"</code>.
- * <p> While parsing an input source, errors are reported to the application
- * through the error handler (<code>LSParser.domConfig</code>'s "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" parameter). This specification does in no way try to define all possible
- * errors that can occur while parsing XML, or any other markup, but some
- * common error cases are defined. The types (<code>DOMError.type</code>) of
- * errors and warnings defined by this specification are:
- * <dl>
- * <dt>
- * <code>"check-character-normalization-failure" [error]</code> </dt>
- * <dd> Raised if
- * the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-check-character-normalization'>
- * check-character-normalization</a>" is set to true and a string is encountered that fails normalization
- * checking. </dd>
- * <dt><code>"doctype-not-allowed" [fatal]</code></dt>
- * <dd> Raised if the
- * configuration parameter "disallow-doctype" is set to <code>true</code>
- * and a doctype is encountered. </dd>
- * <dt><code>"no-input-specified" [fatal]</code></dt>
- * <dd>
- * Raised when loading a document and no input is specified in the
- * <code>LSInput</code> object. </dd>
- * <dt>
- * <code>"pi-base-uri-not-preserved" [warning]</code></dt>
- * <dd> Raised if a processing
- * instruction is encountered in a location where the base URI of the
- * processing instruction can not be preserved. One example of a case where
- * this warning will be raised is if the configuration parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
- * entities</a>" is set to <code>false</code> and the following XML file is parsed:
- * <pre>
- * &lt;!DOCTYPE root [ &lt;!ENTITY e SYSTEM 'subdir/myentity.ent' ]&gt;
- * &lt;root&gt; &amp;e; &lt;/root&gt;</pre>
- * And <code>subdir/myentity.ent</code>
- * contains:
- * <pre>&lt;one&gt; &lt;two/&gt; &lt;/one&gt; &lt;?pi 3.14159?&gt;
- * &lt;more/&gt;</pre>
- * </dd>
- * <dt><code>"unbound-prefix-in-entity" [warning]</code></dt>
- * <dd> An
- * implementation dependent warning that may be raised if the configuration
- * parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-namespaces'>
- * namespaces</a>" is set to <code>true</code> and an unbound namespace prefix is
- * encountered in an entity's replacement text. Raising this warning is not
- * enforced since some existing parsers may not recognize unbound namespace
- * prefixes in the replacement text of entities. </dd>
- * <dt>
- * <code>"unknown-character-denormalization" [fatal]</code></dt>
- * <dd> Raised if the
- * configuration parameter "ignore-unknown-character-denormalizations" is
- * set to <code>false</code> and a character is encountered for which the
- * processor cannot determine the normalization properties. </dd>
- * <dt>
- * <code>"unsupported-encoding" [fatal]</code></dt>
- * <dd> Raised if an unsupported
- * encoding is encountered. </dd>
- * <dt><code>"unsupported-media-type" [fatal]</code></dt>
- * <dd>
- * Raised if the configuration parameter "supported-media-types-only" is set
- * to <code>true</code> and an unsupported media type is encountered. </dd>
- * </dl>
- * <p> In addition to raising the defined errors and warnings, implementations
- * are expected to raise implementation specific errors and warnings for any
- * other error and warning cases such as IO errors (file not found,
- * permission denied,...), XML well-formedness errors, and so on.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSParser {
- /**
- * The <code>DOMConfiguration</code> object used when parsing an input
- * source. This <code>DOMConfiguration</code> is specific to the parse
- * operation. No parameter values from this <code>DOMConfiguration</code>
- * object are passed automatically to the <code>DOMConfiguration</code>
- * object on the <code>Document</code> that is created, or used, by the
- * parse operation. The DOM application is responsible for passing any
- * needed parameter values from this <code>DOMConfiguration</code>
- * object to the <code>DOMConfiguration</code> object referenced by the
- * <code>Document</code> object.
- * <br> In addition to the parameters recognized in on the <a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration'>
- * DOMConfiguration</a> interface defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , the <code>DOMConfiguration</code> objects for <code>LSParser</code>
- * add or modify the following parameters:
- * <dl>
- * <dt>
- * <code>"charset-overrides-xml-encoding"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] (<em>default</em>) If a higher level protocol such as HTTP [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>] provides an
- * indication of the character encoding of the input stream being
- * processed, that will override any encoding specified in the XML
- * declaration or the Text declaration (see also section 4.3.3,
- * "Character Encoding in Entities", in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]).
- * Explicitly setting an encoding in the <code>LSInput</code> overrides
- * any encoding from the protocol. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] The parser ignores any character set encoding information from
- * higher-level protocols. </dd>
- * </dl></dd>
- * <dt><code>"disallow-doctype"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>optional</em>] Throw a fatal <b>"doctype-not-allowed"</b> error if a doctype node is found while parsing the document. This is
- * useful when dealing with things like SOAP envelopes where doctype
- * nodes are not allowed. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Allow doctype nodes in the document. </dd>
- * </dl></dd>
- * <dt>
- * <code>"ignore-unknown-character-denormalizations"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) If, while verifying full normalization when [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] is
- * supported, a processor encounters characters for which it cannot
- * determine the normalization properties, then the processor will
- * ignore any possible denormalizations caused by these characters.
- * This parameter is ignored for [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>optional</em>] Report an fatal <b>"unknown-character-denormalization"</b> error if a character is encountered for which the processor cannot
- * determine the normalization properties. </dd>
- * </dl></dd>
- * <dt><code>"infoset"</code></dt>
- * <dd> See
- * the definition of <code>DOMConfiguration</code> for a description of
- * this parameter. Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , this parameter will default to <code>true</code> for
- * <code>LSParser</code>. </dd>
- * <dt><code>"namespaces"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Perform the namespace processing as defined in [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * and [<a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/'>XML Namespaces 1.1</a>]
- * . </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>optional</em>] Do not perform the namespace processing. </dd>
- * </dl></dd>
- * <dt>
- * <code>"resource-resolver"</code></dt>
- * <dd>[<em>required</em>] A reference to a <code>LSResourceResolver</code> object, or null. If
- * the value of this parameter is not null when an external resource
- * (such as an external XML entity or an XML schema location) is
- * encountered, the implementation will request that the
- * <code>LSResourceResolver</code> referenced in this parameter resolves
- * the resource. </dd>
- * <dt><code>"supported-media-types-only"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>optional</em>] Check that the media type of the parsed resource is a supported media
- * type. If an unsupported media type is encountered, a fatal error of
- * type <b>"unsupported-media-type"</b> will be raised. The media types defined in [<a href='http://www.ietf.org/rfc/rfc3023.txt'>IETF RFC 3023</a>] must always
- * be accepted. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Accept any media type. </dd>
- * </dl></dd>
- * <dt><code>"validate"</code></dt>
- * <dd> See the definition of
- * <code>DOMConfiguration</code> for a description of this parameter.
- * Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , the processing of the internal subset is always accomplished, even
- * if this parameter is set to <code>false</code>. </dd>
- * <dt>
- * <code>"validate-if-schema"</code></dt>
- * <dd> See the definition of
- * <code>DOMConfiguration</code> for a description of this parameter.
- * Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , the processing of the internal subset is always accomplished, even
- * if this parameter is set to <code>false</code>. </dd>
- * <dt>
- * <code>"well-formed"</code></dt>
- * <dd> See the definition of
- * <code>DOMConfiguration</code> for a description of this parameter.
- * Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , this parameter cannot be set to <code>false</code>. </dd>
- * </dl>
- */
- public DOMConfiguration getDomConfig();
-
- /**
- * When a filter is provided, the implementation will call out to the
- * filter as it is constructing the DOM tree structure. The filter can
- * choose to remove elements from the document being constructed, or to
- * terminate the parsing early.
- * <br> The filter is invoked after the operations requested by the
- * <code>DOMConfiguration</code> parameters have been applied. For
- * example, if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate'>
- * validate</a>" is set to <code>true</code>, the validation is done before invoking the
- * filter.
- */
- public LSParserFilter getFilter();
- /**
- * When a filter is provided, the implementation will call out to the
- * filter as it is constructing the DOM tree structure. The filter can
- * choose to remove elements from the document being constructed, or to
- * terminate the parsing early.
- * <br> The filter is invoked after the operations requested by the
- * <code>DOMConfiguration</code> parameters have been applied. For
- * example, if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate'>
- * validate</a>" is set to <code>true</code>, the validation is done before invoking the
- * filter.
- */
- public void setFilter(LSParserFilter filter);
-
- /**
- * <code>true</code> if the <code>LSParser</code> is asynchronous,
- * <code>false</code> if it is synchronous.
- */
- public boolean getAsync();
-
- /**
- * <code>true</code> if the <code>LSParser</code> is currently busy
- * loading a document, otherwise <code>false</code>.
- */
- public boolean getBusy();
-
- /**
- * Parse an XML document from a resource identified by a
- * <code>LSInput</code>.
- * @param input The <code>LSInput</code> from which the source of the
- * document is to be read.
- * @return If the <code>LSParser</code> is a synchronous
- * <code>LSParser</code>, the newly created and populated
- * <code>Document</code> is returned. If the <code>LSParser</code> is
- * asynchronous, <code>null</code> is returned since the document
- * object may not yet be constructed when this method returns.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if the <code>LSParser</code>'s
- * <code>LSParser.busy</code> attribute is <code>true</code>.
- * @exception LSException
- * PARSE_ERR: Raised if the <code>LSParser</code> was unable to load
- * the XML document. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public Document parse(LSInput input)
- throws DOMException, LSException;
-
- /**
- * Parse an XML document from a location identified by a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]. If the URI
- * contains a fragment identifier (see section 4.1 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the
- * behavior is not defined by this specification, future versions of
- * this specification may define the behavior.
- * @param uri The location of the XML document to be read.
- * @return If the <code>LSParser</code> is a synchronous
- * <code>LSParser</code>, the newly created and populated
- * <code>Document</code> is returned, or <code>null</code> if an error
- * occured. If the <code>LSParser</code> is asynchronous,
- * <code>null</code> is returned since the document object may not yet
- * be constructed when this method returns.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if the <code>LSParser.busy</code>
- * attribute is <code>true</code>.
- * @exception LSException
- * PARSE_ERR: Raised if the <code>LSParser</code> was unable to load
- * the XML document. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public Document parseURI(String uri)
- throws DOMException, LSException;
-
- // ACTION_TYPES
- /**
- * Append the result of the parse operation as children of the context
- * node. For this action to work, the context node must be an
- * <code>Element</code> or a <code>DocumentFragment</code>.
- */
- public static final short ACTION_APPEND_AS_CHILDREN = 1;
- /**
- * Replace all the children of the context node with the result of the
- * parse operation. For this action to work, the context node must be an
- * <code>Element</code>, a <code>Document</code>, or a
- * <code>DocumentFragment</code>.
- */
- public static final short ACTION_REPLACE_CHILDREN = 2;
- /**
- * Insert the result of the parse operation as the immediately preceding
- * sibling of the context node. For this action to work the context
- * node's parent must be an <code>Element</code> or a
- * <code>DocumentFragment</code>.
- */
- public static final short ACTION_INSERT_BEFORE = 3;
- /**
- * Insert the result of the parse operation as the immediately following
- * sibling of the context node. For this action to work the context
- * node's parent must be an <code>Element</code> or a
- * <code>DocumentFragment</code>.
- */
- public static final short ACTION_INSERT_AFTER = 4;
- /**
- * Replace the context node with the result of the parse operation. For
- * this action to work, the context node must have a parent, and the
- * parent must be an <code>Element</code> or a
- * <code>DocumentFragment</code>.
- */
- public static final short ACTION_REPLACE = 5;
-
- /**
- * Parse an XML fragment from a resource identified by a
- * <code>LSInput</code> and insert the content into an existing document
- * at the position specified with the <code>context</code> and
- * <code>action</code> arguments. When parsing the input stream, the
- * context node (or its parent, depending on where the result will be
- * inserted) is used for resolving unbound namespace prefixes. The
- * context node's <code>ownerDocument</code> node (or the node itself if
- * the node of type <code>DOCUMENT_NODE</code>) is used to resolve
- * default attributes and entity references.
- * <br> As the new data is inserted into the document, at least one
- * mutation event is fired per new immediate child or sibling of the
- * context node.
- * <br> If the context node is a <code>Document</code> node and the action
- * is <code>ACTION_REPLACE_CHILDREN</code>, then the document that is
- * passed as the context node will be changed such that its
- * <code>xmlEncoding</code>, <code>documentURI</code>,
- * <code>xmlVersion</code>, <code>inputEncoding</code>,
- * <code>xmlStandalone</code>, and all other such attributes are set to
- * what they would be set to if the input source was parsed using
- * <code>LSParser.parse()</code>.
- * <br> This method is always synchronous, even if the
- * <code>LSParser</code> is asynchronous (<code>LSParser.async</code> is
- * <code>true</code>).
- * <br> If an error occurs while parsing, the caller is notified through
- * the <code>ErrorHandler</code> instance associated with the "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" parameter of the <code>DOMConfiguration</code>.
- * <br> When calling <code>parseWithContext</code>, the values of the
- * following configuration parameters will be ignored and their default
- * values will always be used instead: "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate'>
- * validate</a>", "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate-if-schema'>
- * validate-if-schema</a>", and "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-element-content-whitespace'>
- * element-content-whitespace</a>". Other parameters will be treated normally, and the parser is expected
- * to call the <code>LSParserFilter</code> just as if a whole document
- * was parsed.
- * @param input The <code>LSInput</code> from which the source document
- * is to be read. The source document must be an XML fragment, i.e.
- * anything except a complete XML document (except in the case where
- * the context node of type <code>DOCUMENT_NODE</code>, and the action
- * is <code>ACTION_REPLACE_CHILDREN</code>), a DOCTYPE (internal
- * subset), entity declaration(s), notation declaration(s), or XML or
- * text declaration(s).
- * @param contextArg The node that is used as the context for the data
- * that is being parsed. This node must be a <code>Document</code>
- * node, a <code>DocumentFragment</code> node, or a node of a type
- * that is allowed as a child of an <code>Element</code> node, e.g. it
- * cannot be an <code>Attribute</code> node.
- * @param action This parameter describes which action should be taken
- * between the new set of nodes being inserted and the existing
- * children of the context node. The set of possible actions is
- * defined in <code>ACTION_TYPES</code> above.
- * @return Return the node that is the result of the parse operation. If
- * the result is more than one top-level node, the first one is
- * returned.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the content cannot replace, be
- * inserted before, after, or as a child of the context node (see also
- * <code>Node.insertBefore</code> or <code>Node.replaceChild</code> in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * ).
- * <br> NOT_SUPPORTED_ERR: Raised if the <code>LSParser</code> doesn't
- * support this method, or if the context node is of type
- * <code>Document</code> and the DOM implementation doesn't support
- * the replacement of the <code>DocumentType</code> child or
- * <code>Element</code> child.
- * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if the context node is a
- * read only node and the content is being appended to its child list,
- * or if the parent node of the context node is read only node and the
- * content is being inserted in its child list.
- * <br> INVALID_STATE_ERR: Raised if the <code>LSParser.busy</code>
- * attribute is <code>true</code>.
- * @exception LSException
- * PARSE_ERR: Raised if the <code>LSParser</code> was unable to load
- * the XML fragment. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public Node parseWithContext(LSInput input,
- Node contextArg,
- short action)
- throws DOMException, LSException;
-
- /**
- * Abort the loading of the document that is currently being loaded by
- * the <code>LSParser</code>. If the <code>LSParser</code> is currently
- * not busy, a call to this method does nothing.
- */
- public void abort();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/LSParserFilter.java b/libjava/external/w3c_dom/org/w3c/dom/ls/LSParserFilter.java
deleted file mode 100644
index 4e612945e95..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/LSParserFilter.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Element;
-
-/**
- * <code>LSParserFilter</code>s provide applications the ability to examine
- * nodes as they are being constructed while parsing. As each node is
- * examined, it may be modified or removed, or the entire parse may be
- * terminated early.
- * <p> At the time any of the filter methods are called by the parser, the
- * owner Document and DOMImplementation objects exist and are accessible.
- * The document element is never passed to the <code>LSParserFilter</code>
- * methods, i.e. it is not possible to filter out the document element.
- * <code>Document</code>, <code>DocumentType</code>, <code>Notation</code>,
- * <code>Entity</code>, and <code>Attr</code> nodes are never passed to the
- * <code>acceptNode</code> method on the filter. The child nodes of an
- * <code>EntityReference</code> node are passed to the filter if the
- * parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
- * entities</a>" is set to <code>false</code>. Note that, as described by the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
- * entities</a>", unexpanded entity reference nodes are never discarded and are always
- * passed to the filter.
- * <p> All validity checking while parsing a document occurs on the source
- * document as it appears on the input stream, not on the DOM document as it
- * is built in memory. With filters, the document in memory may be a subset
- * of the document on the stream, and its validity may have been affected by
- * the filtering.
- * <p> All default attributes must be present on elements when the elements
- * are passed to the filter methods. All other default content must be
- * passed to the filter methods.
- * <p> DOM applications must not raise exceptions in a filter. The effect of
- * throwing exceptions from a filter is DOM implementation dependent.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSParserFilter {
- // Constants returned by startElement and acceptNode
- /**
- * Accept the node.
- */
- public static final short FILTER_ACCEPT = 1;
- /**
- * Reject the node and its children.
- */
- public static final short FILTER_REJECT = 2;
- /**
- * Skip this single node. The children of this node will still be
- * considered.
- */
- public static final short FILTER_SKIP = 3;
- /**
- * Interrupt the normal processing of the document.
- */
- public static final short FILTER_INTERRUPT = 4;
-
- /**
- * The parser will call this method after each <code>Element</code> start
- * tag has been scanned, but before the remainder of the
- * <code>Element</code> is processed. The intent is to allow the
- * element, including any children, to be efficiently skipped. Note that
- * only element nodes are passed to the <code>startElement</code>
- * function.
- * <br>The element node passed to <code>startElement</code> for filtering
- * will include all of the Element's attributes, but none of the
- * children nodes. The Element may not yet be in place in the document
- * being constructed (it may not have a parent node.)
- * <br>A <code>startElement</code> filter function may access or change
- * the attributes for the Element. Changing Namespace declarations will
- * have no effect on namespace resolution by the parser.
- * <br>For efficiency, the Element node passed to the filter may not be
- * the same one as is actually placed in the tree if the node is
- * accepted. And the actual node (node object identity) may be reused
- * during the process of reading in and filtering a document.
- * @param elementArg The newly encountered element. At the time this
- * method is called, the element is incomplete - it will have its
- * attributes, but no children.
- * @return
- * <ul>
- * <li> <code>FILTER_ACCEPT</code> if the <code>Element</code> should
- * be included in the DOM document being built.
- * </li>
- * <li>
- * <code>FILTER_REJECT</code> if the <code>Element</code> and all of
- * its children should be rejected.
- * </li>
- * <li> <code>FILTER_SKIP</code> if the
- * <code>Element</code> should be skipped. All of its children are
- * inserted in place of the skipped <code>Element</code> node.
- * </li>
- * <li>
- * <code>FILTER_INTERRUPT</code> if the filter wants to stop the
- * processing of the document. Interrupting the processing of the
- * document does no longer guarantee that the resulting DOM tree is
- * XML well-formed. The <code>Element</code> is rejected.
- * </li>
- * </ul> Returning
- * any other values will result in unspecified behavior.
- */
- public short startElement(Element elementArg);
-
- /**
- * This method will be called by the parser at the completion of the
- * parsing of each node. The node and all of its descendants will exist
- * and be complete. The parent node will also exist, although it may be
- * incomplete, i.e. it may have additional children that have not yet
- * been parsed. Attribute nodes are never passed to this function.
- * <br>From within this method, the new node may be freely modified -
- * children may be added or removed, text nodes modified, etc. The state
- * of the rest of the document outside this node is not defined, and the
- * affect of any attempt to navigate to, or to modify any other part of
- * the document is undefined.
- * <br>For validating parsers, the checks are made on the original
- * document, before any modification by the filter. No validity checks
- * are made on any document modifications made by the filter.
- * <br>If this new node is rejected, the parser might reuse the new node
- * and any of its descendants.
- * @param nodeArg The newly constructed element. At the time this method
- * is called, the element is complete - it has all of its children
- * (and their children, recursively) and attributes, and is attached
- * as a child to its parent.
- * @return
- * <ul>
- * <li> <code>FILTER_ACCEPT</code> if this <code>Node</code> should
- * be included in the DOM document being built.
- * </li>
- * <li>
- * <code>FILTER_REJECT</code> if the <code>Node</code> and all of its
- * children should be rejected.
- * </li>
- * <li> <code>FILTER_SKIP</code> if the
- * <code>Node</code> should be skipped and the <code>Node</code>
- * should be replaced by all the children of the <code>Node</code>.
- * </li>
- * <li>
- * <code>FILTER_INTERRUPT</code> if the filter wants to stop the
- * processing of the document. Interrupting the processing of the
- * document does no longer guarantee that the resulting DOM tree is
- * XML well-formed. The <code>Node</code> is accepted and will be the
- * last completely parsed node.
- * </li>
- * </ul>
- */
- public short acceptNode(Node nodeArg);
-
- /**
- * Tells the <code>LSParser</code> what types of nodes to show to the
- * method <code>LSParserFilter.acceptNode</code>. If a node is not shown
- * to the filter using this attribute, it is automatically included in
- * the DOM document being built. See <code>NodeFilter</code> for
- * definition of the constants. The constants <code>SHOW_ATTRIBUTE</code>
- * , <code>SHOW_DOCUMENT</code>, <code>SHOW_DOCUMENT_TYPE</code>,
- * <code>SHOW_NOTATION</code>, <code>SHOW_ENTITY</code>, and
- * <code>SHOW_DOCUMENT_FRAGMENT</code> are meaningless here. Those nodes
- * will never be passed to <code>LSParserFilter.acceptNode</code>.
- * <br> The constants used here are defined in [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal and Range</a>]
- * .
- */
- public int getWhatToShow();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/LSProgressEvent.java b/libjava/external/w3c_dom/org/w3c/dom/ls/LSProgressEvent.java
deleted file mode 100644
index da98e14ad5b..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/LSProgressEvent.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.events.Event;
-
-/**
- * This interface represents a progress event object that notifies the
- * application about progress as a document is parsed. It extends the
- * <code>Event</code> interface defined in [<a href='http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107'>DOM Level 3 Events</a>]
- * .
- * <p> The units used for the attributes <code>position</code> and
- * <code>totalSize</code> are not specified and can be implementation and
- * input dependent.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSProgressEvent extends Event {
- /**
- * The input source that is being parsed.
- */
- public LSInput getInput();
-
- /**
- * The current position in the input source, including all external
- * entities and other resources that have been read.
- */
- public int getPosition();
-
- /**
- * The total size of the document including all external resources, this
- * number might change as a document is being parsed if references to
- * more external resources are seen. A value of <code>0</code> is
- * returned if the total size cannot be determined or estimated.
- */
- public int getTotalSize();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/LSResourceResolver.java b/libjava/external/w3c_dom/org/w3c/dom/ls/LSResourceResolver.java
deleted file mode 100644
index c0c523c8a00..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/LSResourceResolver.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-/**
- * <code>LSResourceResolver</code> provides a way for applications to
- * redirect references to external resources.
- * <p> Applications needing to implement custom handling for external
- * resources can implement this interface and register their implementation
- * by setting the "resource-resolver" parameter of
- * <code>DOMConfiguration</code> objects attached to <code>LSParser</code>
- * and <code>LSSerializer</code>. It can also be register on
- * <code>DOMConfiguration</code> objects attached to <code>Document</code>
- * if the "LS" feature is supported.
- * <p> The <code>LSParser</code> will then allow the application to intercept
- * any external entities, including the external DTD subset and external
- * parameter entities, before including them. The top-level document entity
- * is never passed to the <code>resolveResource</code> method.
- * <p> Many DOM applications will not need to implement this interface, but it
- * will be especially useful for applications that build XML documents from
- * databases or other specialized input sources, or for applications that
- * use URNs.
- * <p ><b>Note:</b> <code>LSResourceResolver</code> is based on the SAX2 [<a href='http://www.saxproject.org/'>SAX</a>] <code>EntityResolver</code>
- * interface.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSResourceResolver {
- /**
- * Allow the application to resolve external resources.
- * <br> The <code>LSParser</code> will call this method before opening any
- * external resource, including the external DTD subset, external
- * entities referenced within the DTD, and external entities referenced
- * within the document element (however, the top-level document entity
- * is not passed to this method). The application may then request that
- * the <code>LSParser</code> resolve the external resource itself, that
- * it use an alternative URI, or that it use an entirely different input
- * source.
- * <br> Application writers can use this method to redirect external
- * system identifiers to secure and/or local URI, to look up public
- * identifiers in a catalogue, or to read an entity from a database or
- * other input source (including, for example, a dialog box).
- * @param type The type of the resource being resolved. For XML [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] resources
- * (i.e. entities), applications must use the value
- * <code>"http://www.w3.org/TR/REC-xml"</code>. For XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , applications must use the value
- * <code>"http://www.w3.org/2001/XMLSchema"</code>. Other types of
- * resources are outside the scope of this specification and therefore
- * should recommend an absolute URI in order to use this method.
- * @param namespaceURI The namespace of the resource being resolved,
- * e.g. the target namespace of the XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * when resolving XML Schema resources.
- * @param publicId The public identifier of the external entity being
- * referenced, or <code>null</code> if no public identifier was
- * supplied or if the resource is not an entity.
- * @param systemId The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], of the
- * external resource being referenced, or <code>null</code> if no
- * system identifier was supplied.
- * @param baseURI The absolute base URI of the resource being parsed, or
- * <code>null</code> if there is no base URI.
- * @return A <code>LSInput</code> object describing the new input
- * source, or <code>null</code> to request that the parser open a
- * regular URI connection to the resource.
- */
- public LSInput resolveResource(String type,
- String namespaceURI,
- String publicId,
- String systemId,
- String baseURI);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/LSSerializer.java b/libjava/external/w3c_dom/org/w3c/dom/ls/LSSerializer.java
deleted file mode 100644
index e7b6350d304..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/LSSerializer.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * A <code>LSSerializer</code> provides an API for serializing (writing) a
- * DOM document out into XML. The XML data is written to a string or an
- * output stream. Any changes or fixups made during the serialization affect
- * only the serialized data. The <code>Document</code> object and its
- * children are never altered by the serialization operation.
- * <p> During serialization of XML data, namespace fixup is done as defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , Appendix B. [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>DOM Level 2 Core</a>]
- * allows empty strings as a real namespace URI. If the
- * <code>namespaceURI</code> of a <code>Node</code> is empty string, the
- * serialization will treat them as <code>null</code>, ignoring the prefix
- * if any.
- * <p> <code>LSSerializer</code> accepts any node type for serialization. For
- * nodes of type <code>Document</code> or <code>Entity</code>, well-formed
- * XML will be created when possible (well-formedness is guaranteed if the
- * document or entity comes from a parse operation and is unchanged since it
- * was created). The serialized output for these node types is either as a
- * XML document or an External XML Entity, respectively, and is acceptable
- * input for an XML parser. For all other types of nodes the serialized form
- * is implementation dependent.
- * <p>Within a <code>Document</code>, <code>DocumentFragment</code>, or
- * <code>Entity</code> being serialized, <code>Nodes</code> are processed as
- * follows
- * <ul>
- * <li> <code>Document</code> nodes are written, including the XML
- * declaration (unless the parameter "xml-declaration" is set to
- * <code>false</code>) and a DTD subset, if one exists in the DOM. Writing a
- * <code>Document</code> node serializes the entire document.
- * </li>
- * <li>
- * <code>Entity</code> nodes, when written directly by
- * <code>LSSerializer.write</code>, outputs the entity expansion but no
- * namespace fixup is done. The resulting output will be valid as an
- * external entity.
- * </li>
- * <li> If the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
- * entities</a>" is set to <code>true</code>, <code>EntityReference</code> nodes are
- * serialized as an entity reference of the form "
- * <code>&amp;entityName;</code>" in the output. Child nodes (the expansion)
- * of the entity reference are ignored. If the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
- * entities</a>" is set to <code>false</code>, only the children of the entity reference
- * are serialized. <code>EntityReference</code> nodes with no children (no
- * corresponding <code>Entity</code> node or the corresponding
- * <code>Entity</code> nodes have no children) are always serialized.
- * </li>
- * <li>
- * <code>CDATAsections</code> containing content characters that cannot be
- * represented in the specified output encoding are handled according to the
- * "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-split-cdata-sections'>
- * split-cdata-sections</a>" parameter. If the parameter is set to <code>true</code>,
- * <code>CDATAsections</code> are split, and the unrepresentable characters
- * are serialized as numeric character references in ordinary content. The
- * exact position and number of splits is not specified. If the parameter
- * is set to <code>false</code>, unrepresentable characters in a
- * <code>CDATAsection</code> are reported as
- * <code>"wf-invalid-character"</code> errors if the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-well-formed'>
- * well-formed</a>" is set to <code>true</code>. The error is not recoverable - there is no
- * mechanism for supplying alternative characters and continuing with the
- * serialization.
- * </li>
- * <li> <code>DocumentFragment</code> nodes are serialized by
- * serializing the children of the document fragment in the order they
- * appear in the document fragment.
- * </li>
- * <li> All other node types (Element, Text,
- * etc.) are serialized to their corresponding XML source form.
- * </li>
- * </ul>
- * <p ><b>Note:</b> The serialization of a <code>Node</code> does not always
- * generate a well-formed XML document, i.e. a <code>LSParser</code> might
- * throw fatal errors when parsing the resulting serialization.
- * <p> Within the character data of a document (outside of markup), any
- * characters that cannot be represented directly are replaced with
- * character references. Occurrences of '&lt;' and '&amp;' are replaced by
- * the predefined entities &amp;lt; and &amp;amp;. The other predefined
- * entities (&amp;gt;, &amp;apos;, and &amp;quot;) might not be used, except
- * where needed (e.g. using &amp;gt; in cases such as ']]&gt;'). Any
- * characters that cannot be represented directly in the output character
- * encoding are serialized as numeric character references (and since
- * character encoding standards commonly use hexadecimal representations of
- * characters, using the hexadecimal representation when serializing
- * character references is encouraged).
- * <p> To allow attribute values to contain both single and double quotes, the
- * apostrophe or single-quote character (') may be represented as
- * "&amp;apos;", and the double-quote character (") as "&amp;quot;". New
- * line characters and other characters that cannot be represented directly
- * in attribute values in the output character encoding are serialized as a
- * numeric character reference.
- * <p> Within markup, but outside of attributes, any occurrence of a character
- * that cannot be represented in the output character encoding is reported
- * as a <code>DOMError</code> fatal error. An example would be serializing
- * the element &lt;LaCa\u00f1ada/&gt; with <code>encoding="us-ascii"</code>.
- * This will result with a generation of a <code>DOMError</code>
- * "wf-invalid-character-in-node-name" (as proposed in "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-well-formed'>
- * well-formed</a>").
- * <p> When requested by setting the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-normalize-characters'>
- * normalize-characters</a>" on <code>LSSerializer</code> to true, character normalization is
- * performed according to the definition of <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>fully
- * normalized</a> characters included in appendix E of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] on all
- * data to be serialized, both markup and character data. The character
- * normalization process affects only the data as it is being written; it
- * does not alter the DOM's view of the document after serialization has
- * completed.
- * <p> Implementations are required to support the encodings "UTF-8",
- * "UTF-16", "UTF-16BE", and "UTF-16LE" to guarantee that data is
- * serializable in all encodings that are required to be supported by all
- * XML parsers. When the encoding is UTF-8, whether or not a byte order mark
- * is serialized, or if the output is big-endian or little-endian, is
- * implementation dependent. When the encoding is UTF-16, whether or not the
- * output is big-endian or little-endian is implementation dependent, but a
- * Byte Order Mark must be generated for non-character outputs, such as
- * <code>LSOutput.byteStream</code> or <code>LSOutput.systemId</code>. If
- * the Byte Order Mark is not generated, a "byte-order-mark-needed" warning
- * is reported. When the encoding is UTF-16LE or UTF-16BE, the output is
- * big-endian (UTF-16BE) or little-endian (UTF-16LE) and the Byte Order Mark
- * is not be generated. In all cases, the encoding declaration, if
- * generated, will correspond to the encoding used during the serialization
- * (e.g. <code>encoding="UTF-16"</code> will appear if UTF-16 was
- * requested).
- * <p> Namespaces are fixed up during serialization, the serialization process
- * will verify that namespace declarations, namespace prefixes and the
- * namespace URI associated with elements and attributes are consistent. If
- * inconsistencies are found, the serialized form of the document will be
- * altered to remove them. The method used for doing the namespace fixup
- * while serializing a document is the algorithm defined in Appendix B.1,
- * "Namespace normalization", of [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * .
- * <p> While serializing a document, the parameter "discard-default-content"
- * controls whether or not non-specified data is serialized.
- * <p> While serializing, errors and warnings are reported to the application
- * through the error handler (<code>LSSerializer.domConfig</code>'s "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" parameter). This specification does in no way try to define all possible
- * errors and warnings that can occur while serializing a DOM node, but some
- * common error and warning cases are defined. The types (
- * <code>DOMError.type</code>) of errors and warnings defined by this
- * specification are:
- * <dl>
- * <dt><code>"no-output-specified" [fatal]</code></dt>
- * <dd> Raised when
- * writing to a <code>LSOutput</code> if no output is specified in the
- * <code>LSOutput</code>. </dd>
- * <dt>
- * <code>"unbound-prefix-in-entity-reference" [fatal]</code> </dt>
- * <dd> Raised if the
- * configuration parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-namespaces'>
- * namespaces</a>" is set to <code>true</code> and an entity whose replacement text
- * contains unbound namespace prefixes is referenced in a location where
- * there are no bindings for the namespace prefixes. </dd>
- * <dt>
- * <code>"unsupported-encoding" [fatal]</code></dt>
- * <dd> Raised if an unsupported
- * encoding is encountered. </dd>
- * </dl>
- * <p> In addition to raising the defined errors and warnings, implementations
- * are expected to raise implementation specific errors and warnings for any
- * other error and warning cases such as IO errors (file not found,
- * permission denied,...) and so on.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSSerializer {
- /**
- * The <code>DOMConfiguration</code> object used by the
- * <code>LSSerializer</code> when serializing a DOM node.
- * <br> In addition to the parameters recognized by the <a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration'>
- * DOMConfiguration</a> interface defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , the <code>DOMConfiguration</code> objects for
- * <code>LSSerializer</code> adds, or modifies, the following
- * parameters:
- * <dl>
- * <dt><code>"canonical-form"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Writes the document according to the rules specified in [<a href='http://www.w3.org/TR/2001/REC-xml-c14n-20010315'>Canonical XML</a>].
- * In addition to the behavior described in "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-canonical-form'>
- * canonical-form</a>" [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , setting this parameter to <code>true</code> will set the parameters
- * "format-pretty-print", "discard-default-content", and "xml-declaration
- * ", to <code>false</code>. Setting one of those parameters to
- * <code>true</code> will set this parameter to <code>false</code>.
- * Serializing an XML 1.1 document when "canonical-form" is
- * <code>true</code> will generate a fatal error. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Do not canonicalize the output. </dd>
- * </dl></dd>
- * <dt><code>"discard-default-content"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Use the <code>Attr.specified</code> attribute to decide what attributes
- * should be discarded. Note that some implementations might use
- * whatever information available to the implementation (i.e. XML
- * schema, DTD, the <code>Attr.specified</code> attribute, and so on) to
- * determine what attributes and content to discard if this parameter is
- * set to <code>true</code>. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Keep all attributes and all content.</dd>
- * </dl></dd>
- * <dt><code>"format-pretty-print"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>optional</em>] Formatting the output by adding whitespace to produce a pretty-printed,
- * indented, human-readable form. The exact form of the transformations
- * is not specified by this specification. Pretty-printing changes the
- * content of the document and may affect the validity of the document,
- * validating implementations should preserve validity. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Don't pretty-print the result. </dd>
- * </dl></dd>
- * <dt>
- * <code>"ignore-unknown-character-denormalizations"</code> </dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) If, while verifying full normalization when [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] is
- * supported, a character is encountered for which the normalization
- * properties cannot be determined, then raise a
- * <code>"unknown-character-denormalization"</code> warning (instead of
- * raising an error, if this parameter is not set) and ignore any
- * possible denormalizations caused by these characters. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>optional</em>] Report a fatal error if a character is encountered for which the
- * processor cannot determine the normalization properties. </dd>
- * </dl></dd>
- * <dt>
- * <code>"normalize-characters"</code></dt>
- * <dd> This parameter is equivalent to
- * the one defined by <code>DOMConfiguration</code> in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * . Unlike in the Core, the default value for this parameter is
- * <code>true</code>. While DOM implementations are not required to
- * support <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>fully
- * normalizing</a> the characters in the document according to appendix E of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>], this
- * parameter must be activated by default if supported. </dd>
- * <dt>
- * <code>"xml-declaration"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) If a <code>Document</code>, <code>Element</code>, or <code>Entity</code>
- * node is serialized, the XML declaration, or text declaration, should
- * be included. The version (<code>Document.xmlVersion</code> if the
- * document is a Level 3 document and the version is non-null, otherwise
- * use the value "1.0"), and the output encoding (see
- * <code>LSSerializer.write</code> for details on how to find the output
- * encoding) are specified in the serialized XML declaration. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] Do not serialize the XML and text declarations. Report a
- * <code>"xml-declaration-needed"</code> warning if this will cause
- * problems (i.e. the serialized data is of an XML version other than [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], or an
- * encoding would be needed to be able to re-parse the serialized data). </dd>
- * </dl></dd>
- * </dl>
- */
- public DOMConfiguration getDomConfig();
-
- /**
- * The end-of-line sequence of characters to be used in the XML being
- * written out. Any string is supported, but XML treats only a certain
- * set of characters sequence as end-of-line (See section 2.11,
- * "End-of-Line Handling" in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], if the
- * serialized content is XML 1.0 or section 2.11, "End-of-Line Handling"
- * in [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>], if the
- * serialized content is XML 1.1). Using other character sequences than
- * the recommended ones can result in a document that is either not
- * serializable or not well-formed).
- * <br> On retrieval, the default value of this attribute is the
- * implementation specific default end-of-line sequence. DOM
- * implementations should choose the default to match the usual
- * convention for text files in the environment being used.
- * Implementations must choose a default sequence that matches one of
- * those allowed by XML 1.0 or XML 1.1, depending on the serialized
- * content. Setting this attribute to <code>null</code> will reset its
- * value to the default value.
- * <br>
- */
- public String getNewLine();
- /**
- * The end-of-line sequence of characters to be used in the XML being
- * written out. Any string is supported, but XML treats only a certain
- * set of characters sequence as end-of-line (See section 2.11,
- * "End-of-Line Handling" in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], if the
- * serialized content is XML 1.0 or section 2.11, "End-of-Line Handling"
- * in [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>], if the
- * serialized content is XML 1.1). Using other character sequences than
- * the recommended ones can result in a document that is either not
- * serializable or not well-formed).
- * <br> On retrieval, the default value of this attribute is the
- * implementation specific default end-of-line sequence. DOM
- * implementations should choose the default to match the usual
- * convention for text files in the environment being used.
- * Implementations must choose a default sequence that matches one of
- * those allowed by XML 1.0 or XML 1.1, depending on the serialized
- * content. Setting this attribute to <code>null</code> will reset its
- * value to the default value.
- * <br>
- */
- public void setNewLine(String newLine);
-
- /**
- * When the application provides a filter, the serializer will call out
- * to the filter before serializing each Node. The filter implementation
- * can choose to remove the node from the stream or to terminate the
- * serialization early.
- * <br> The filter is invoked after the operations requested by the
- * <code>DOMConfiguration</code> parameters have been applied. For
- * example, CDATA sections won't be passed to the filter if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-cdata-sections'>
- * cdata-sections</a>" is set to <code>false</code>.
- */
- public LSSerializerFilter getFilter();
- /**
- * When the application provides a filter, the serializer will call out
- * to the filter before serializing each Node. The filter implementation
- * can choose to remove the node from the stream or to terminate the
- * serialization early.
- * <br> The filter is invoked after the operations requested by the
- * <code>DOMConfiguration</code> parameters have been applied. For
- * example, CDATA sections won't be passed to the filter if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-cdata-sections'>
- * cdata-sections</a>" is set to <code>false</code>.
- */
- public void setFilter(LSSerializerFilter filter);
-
- /**
- * Serialize the specified node as described above in the general
- * description of the <code>LSSerializer</code> interface. The output is
- * written to the supplied <code>LSOutput</code>.
- * <br> When writing to a <code>LSOutput</code>, the encoding is found by
- * looking at the encoding information that is reachable through the
- * <code>LSOutput</code> and the item to be written (or its owner
- * document) in this order:
- * <ol>
- * <li> <code>LSOutput.encoding</code>,
- * </li>
- * <li>
- * <code>Document.inputEncoding</code>,
- * </li>
- * <li>
- * <code>Document.xmlEncoding</code>.
- * </li>
- * </ol>
- * <br> If no encoding is reachable through the above properties, a
- * default encoding of "UTF-8" will be used. If the specified encoding
- * is not supported an "unsupported-encoding" fatal error is raised.
- * <br> If no output is specified in the <code>LSOutput</code>, a
- * "no-output-specified" fatal error is raised.
- * <br> The implementation is responsible of associating the appropriate
- * media type with the serialized data.
- * <br> When writing to a HTTP URI, a HTTP PUT is performed. When writing
- * to other types of URIs, the mechanism for writing the data to the URI
- * is implementation dependent.
- * @param nodeArg The node to serialize.
- * @param destination The destination for the serialized DOM.
- * @return Returns <code>true</code> if <code>node</code> was
- * successfully serialized. Return <code>false</code> in case the
- * normal processing stopped but the implementation kept serializing
- * the document; the result of the serialization being implementation
- * dependent then.
- * @exception LSException
- * SERIALIZE_ERR: Raised if the <code>LSSerializer</code> was unable to
- * serialize the node. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public boolean write(Node nodeArg,
- LSOutput destination)
- throws LSException;
-
- /**
- * A convenience method that acts as if <code>LSSerializer.write</code>
- * was called with a <code>LSOutput</code> with no encoding specified
- * and <code>LSOutput.systemId</code> set to the <code>uri</code>
- * argument.
- * @param nodeArg The node to serialize.
- * @param uri The URI to write to.
- * @return Returns <code>true</code> if <code>node</code> was
- * successfully serialized. Return <code>false</code> in case the
- * normal processing stopped but the implementation kept serializing
- * the document; the result of the serialization being implementation
- * dependent then.
- * @exception LSException
- * SERIALIZE_ERR: Raised if the <code>LSSerializer</code> was unable to
- * serialize the node. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public boolean writeToURI(Node nodeArg,
- String uri)
- throws LSException;
-
- /**
- * Serialize the specified node as described above in the general
- * description of the <code>LSSerializer</code> interface. The output is
- * written to a <code>DOMString</code> that is returned to the caller.
- * The encoding used is the encoding of the <code>DOMString</code> type,
- * i.e. UTF-16. Note that no Byte Order Mark is generated in a
- * <code>DOMString</code> object.
- * @param nodeArg The node to serialize.
- * @return Returns the serialized data.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised if the resulting string is too long to
- * fit in a <code>DOMString</code>.
- * @exception LSException
- * SERIALIZE_ERR: Raised if the <code>LSSerializer</code> was unable to
- * serialize the node. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public String writeToString(Node nodeArg)
- throws DOMException, LSException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ls/LSSerializerFilter.java b/libjava/external/w3c_dom/org/w3c/dom/ls/LSSerializerFilter.java
deleted file mode 100644
index 049459c6417..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ls/LSSerializerFilter.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.traversal.NodeFilter;
-
-/**
- * <code>LSSerializerFilter</code>s provide applications the ability to
- * examine nodes as they are being serialized and decide what nodes should
- * be serialized or not. The <code>LSSerializerFilter</code> interface is
- * based on the <code>NodeFilter</code> interface defined in [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal and Range</a>]
- * .
- * <p> <code>Document</code>, <code>DocumentType</code>,
- * <code>DocumentFragment</code>, <code>Notation</code>, <code>Entity</code>
- * , and children of <code>Attr</code> nodes are not passed to the filter.
- * The child nodes of an <code>EntityReference</code> node are only passed
- * to the filter if the <code>EntityReference</code> node is skipped by the
- * method <code>LSParserFilter.acceptNode()</code>.
- * <p> When serializing an <code>Element</code>, the element is passed to the
- * filter before any of its attributes are passed to the filter. Namespace
- * declaration attributes, and default attributes (except in the case when "
- * discard-default-content" is set to <code>false</code>), are never passed
- * to the filter.
- * <p> The result of any attempt to modify a node passed to a
- * <code>LSSerializerFilter</code> is implementation dependent.
- * <p> DOM applications must not raise exceptions in a filter. The effect of
- * throwing exceptions from a filter is DOM implementation dependent.
- * <p> For efficiency, a node passed to the filter may not be the same as the
- * one that is actually in the tree. And the actual node (node object
- * identity) may be reused during the process of filtering and serializing a
- * document.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSSerializerFilter extends NodeFilter {
- /**
- * Tells the <code>LSSerializer</code> what types of nodes to show to the
- * filter. If a node is not shown to the filter using this attribute, it
- * is automatically serialized. See <code>NodeFilter</code> for
- * definition of the constants. The constants <code>SHOW_DOCUMENT</code>
- * , <code>SHOW_DOCUMENT_TYPE</code>, <code>SHOW_DOCUMENT_FRAGMENT</code>
- * , <code>SHOW_NOTATION</code>, and <code>SHOW_ENTITY</code> are
- * meaningless here, such nodes will never be passed to a
- * <code>LSSerializerFilter</code>.
- * <br> Unlike [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal and Range</a>]
- * , the <code>SHOW_ATTRIBUTE</code> constant indicates that the
- * <code>Attr</code> nodes are shown and passed to the filter.
- * <br> The constants used here are defined in [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal and Range</a>]
- * .
- */
- public int getWhatToShow();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ranges/DocumentRange.java b/libjava/external/w3c_dom/org/w3c/dom/ranges/DocumentRange.java
deleted file mode 100644
index 6b522670e20..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ranges/DocumentRange.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.ranges;
-
-/**
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentRange {
- /**
- * This interface can be obtained from the object implementing the
- * <code>Document</code> interface using binding-specific casting
- * methods.
- * @return The initial state of the Range returned from this method is
- * such that both of its boundary-points are positioned at the
- * beginning of the corresponding Document, before any content. The
- * Range returned can only be used to select content associated with
- * this Document, or with DocumentFragments and Attrs for which this
- * Document is the <code>ownerDocument</code>.
- */
- public Range createRange();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ranges/Range.java b/libjava/external/w3c_dom/org/w3c/dom/ranges/Range.java
deleted file mode 100644
index a576b4dd642..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ranges/Range.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.ranges;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DocumentFragment;
-
-/**
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface Range {
- /**
- * Node within which the Range begins
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public Node getStartContainer()
- throws DOMException;
-
- /**
- * Offset within the starting node of the Range.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public int getStartOffset()
- throws DOMException;
-
- /**
- * Node within which the Range ends
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public Node getEndContainer()
- throws DOMException;
-
- /**
- * Offset within the ending node of the Range.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public int getEndOffset()
- throws DOMException;
-
- /**
- * TRUE if the Range is collapsed
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public boolean getCollapsed()
- throws DOMException;
-
- /**
- * The deepest common ancestor container of the Range's two
- * boundary-points.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public Node getCommonAncestorContainer()
- throws DOMException;
-
- /**
- * Sets the attributes describing the start of the Range.
- * @param refNode The <code>refNode</code> value. This parameter must be
- * different from <code>null</code>.
- * @param offset The <code>startOffset</code> value.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
- * of <code>refNode</code> is an Entity, Notation, or DocumentType
- * node.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if <code>offset</code> is negative or greater
- * than the number of child units in <code>refNode</code>. Child units
- * are 16-bit units if <code>refNode</code> is a type of CharacterData
- * node (e.g., a Text or Comment node) or a ProcessingInstruction
- * node. Child units are Nodes in all other cases.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setStart(Node refNode,
- int offset)
- throws RangeException, DOMException;
-
- /**
- * Sets the attributes describing the end of a Range.
- * @param refNode The <code>refNode</code> value. This parameter must be
- * different from <code>null</code>.
- * @param offset The <code>endOffset</code> value.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
- * of <code>refNode</code> is an Entity, Notation, or DocumentType
- * node.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if <code>offset</code> is negative or greater
- * than the number of child units in <code>refNode</code>. Child units
- * are 16-bit units if <code>refNode</code> is a type of CharacterData
- * node (e.g., a Text or Comment node) or a ProcessingInstruction
- * node. Child units are Nodes in all other cases.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setEnd(Node refNode,
- int offset)
- throws RangeException, DOMException;
-
- /**
- * Sets the start position to be before a node
- * @param refNode Range starts before <code>refNode</code>
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document, or DocumentFragment
- * node or if <code>refNode</code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setStartBefore(Node refNode)
- throws RangeException, DOMException;
-
- /**
- * Sets the start position to be after a node
- * @param refNode Range starts after <code>refNode</code>
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document, or DocumentFragment
- * node or if <code>refNode</code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setStartAfter(Node refNode)
- throws RangeException, DOMException;
-
- /**
- * Sets the end position to be before a node.
- * @param refNode Range ends before <code>refNode</code>
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document, or DocumentFragment
- * node or if <code>refNode</code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setEndBefore(Node refNode)
- throws RangeException, DOMException;
-
- /**
- * Sets the end of a Range to be after a node
- * @param refNode Range ends after <code>refNode</code>.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document or DocumentFragment
- * node or if <code>refNode</code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setEndAfter(Node refNode)
- throws RangeException, DOMException;
-
- /**
- * Collapse a Range onto one of its boundary-points
- * @param toStart If TRUE, collapses the Range onto its start; if FALSE,
- * collapses it onto its end.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public void collapse(boolean toStart)
- throws DOMException;
-
- /**
- * Select a node and its contents
- * @param refNode The node to select.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if an ancestor of <code>refNode</code>
- * is an Entity, Notation or DocumentType node or if
- * <code>refNode</code> is a Document, DocumentFragment, Attr, Entity,
- * or Notation node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void selectNode(Node refNode)
- throws RangeException, DOMException;
-
- /**
- * Select the contents within a node
- * @param refNode Node to select from
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
- * of <code>refNode</code> is an Entity, Notation or DocumentType node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void selectNodeContents(Node refNode)
- throws RangeException, DOMException;
-
- // CompareHow
- /**
- * Compare start boundary-point of <code>sourceRange</code> to start
- * boundary-point of Range on which <code>compareBoundaryPoints</code>
- * is invoked.
- */
- public static final short START_TO_START = 0;
- /**
- * Compare start boundary-point of <code>sourceRange</code> to end
- * boundary-point of Range on which <code>compareBoundaryPoints</code>
- * is invoked.
- */
- public static final short START_TO_END = 1;
- /**
- * Compare end boundary-point of <code>sourceRange</code> to end
- * boundary-point of Range on which <code>compareBoundaryPoints</code>
- * is invoked.
- */
- public static final short END_TO_END = 2;
- /**
- * Compare end boundary-point of <code>sourceRange</code> to start
- * boundary-point of Range on which <code>compareBoundaryPoints</code>
- * is invoked.
- */
- public static final short END_TO_START = 3;
-
- /**
- * Compare the boundary-points of two Ranges in a document.
- * @param how A code representing the type of comparison, as defined
- * above.
- * @param sourceRange The <code>Range</code> on which this current
- * <code>Range</code> is compared to.
- * @return -1, 0 or 1 depending on whether the corresponding
- * boundary-point of the Range is respectively before, equal to, or
- * after the corresponding boundary-point of <code>sourceRange</code>.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in the same
- * Document or DocumentFragment.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- */
- public short compareBoundaryPoints(short how,
- Range sourceRange)
- throws DOMException;
-
- /**
- * Removes the contents of a Range from the containing document or
- * document fragment without returning a reference to the removed
- * content.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of
- * the Range is read-only or any of the nodes that contain any of the
- * content of the Range are read-only.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- */
- public void deleteContents()
- throws DOMException;
-
- /**
- * Moves the contents of a Range from the containing document or document
- * fragment to a new DocumentFragment.
- * @return A DocumentFragment containing the extracted contents.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of
- * the Range is read-only or any of the nodes which contain any of the
- * content of the Range are read-only.
- * <br>HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be
- * extracted into the new DocumentFragment.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- */
- public DocumentFragment extractContents()
- throws DOMException;
-
- /**
- * Duplicates the contents of a Range
- * @return A DocumentFragment that contains content equivalent to this
- * Range.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be
- * extracted into the new DocumentFragment.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- */
- public DocumentFragment cloneContents()
- throws DOMException;
-
- /**
- * Inserts a node into the Document or DocumentFragment at the start of
- * the Range. If the container is a Text node, this will be split at the
- * start of the Range (as if the Text node's splitText method was
- * performed at the insertion point) and the insertion will occur
- * between the two resulting Text nodes. Adjacent Text nodes will not be
- * automatically merged. If the node to be inserted is a
- * DocumentFragment node, the children will be inserted rather than the
- * DocumentFragment node itself.
- * @param newNode The node to insert at the start of the Range
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of the
- * start of the Range is read-only.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newNode</code> and the
- * container of the start of the Range were not created from the same
- * document.
- * <br>HIERARCHY_REQUEST_ERR: Raised if the container of the start of
- * the Range is of a type that does not allow children of the type of
- * <code>newNode</code> or if <code>newNode</code> is an ancestor of
- * the container.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>newNode</code> is an Attr,
- * Entity, Notation, or Document node.
- */
- public void insertNode(Node newNode)
- throws DOMException, RangeException;
-
- /**
- * Reparents the contents of the Range to the given node and inserts the
- * node at the position of the start of the Range.
- * @param newParent The node to surround the contents with.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of
- * either boundary-point of the Range is read-only.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code> newParent</code> and the
- * container of the start of the Range were not created from the same
- * document.
- * <br>HIERARCHY_REQUEST_ERR: Raised if the container of the start of
- * the Range is of a type that does not allow children of the type of
- * <code>newParent</code> or if <code>newParent</code> is an ancestor
- * of the container or if <code>node</code> would end up with a child
- * node of a type not allowed by the type of <code>node</code>.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- * @exception RangeException
- * BAD_BOUNDARYPOINTS_ERR: Raised if the Range partially selects a
- * non-text node.
- * <br>INVALID_NODE_TYPE_ERR: Raised if <code> node</code> is an Attr,
- * Entity, DocumentType, Notation, Document, or DocumentFragment node.
- */
- public void surroundContents(Node newParent)
- throws DOMException, RangeException;
-
- /**
- * Produces a new Range whose boundary-points are equal to the
- * boundary-points of the Range.
- * @return The duplicated Range.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public Range cloneRange()
- throws DOMException;
-
- /**
- * Returns the contents of a Range as a string. This string contains only
- * the data characters, not any markup.
- * @return The contents of the Range.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public String toString()
- throws DOMException;
-
- /**
- * Called to indicate that the Range is no longer in use and that the
- * implementation may relinquish any resources associated with this
- * Range. Subsequent calls to any methods or attribute getters on this
- * Range will result in a <code>DOMException</code> being thrown with an
- * error code of <code>INVALID_STATE_ERR</code>.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public void detach()
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/ranges/RangeException.java b/libjava/external/w3c_dom/org/w3c/dom/ranges/RangeException.java
deleted file mode 100644
index 551008e5dba..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/ranges/RangeException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.ranges;
-
-/**
- * Range operations may throw a <code>RangeException</code> as specified in
- * their method descriptions.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public class RangeException extends RuntimeException {
- public RangeException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // RangeExceptionCode
- /**
- * If the boundary-points of a Range do not meet specific requirements.
- */
- public static final short BAD_BOUNDARYPOINTS_ERR = 1;
- /**
- * If the container of an boundary-point of a Range is being set to either
- * a node of an invalid type or a node with an ancestor of an invalid
- * type.
- */
- public static final short INVALID_NODE_TYPE_ERR = 2;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/stylesheets/DocumentStyle.java b/libjava/external/w3c_dom/org/w3c/dom/stylesheets/DocumentStyle.java
deleted file mode 100644
index 612a561135a..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/stylesheets/DocumentStyle.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.stylesheets;
-
-/**
- * The <code>DocumentStyle</code> interface provides a mechanism by which the
- * style sheets embedded in a document can be retrieved. The expectation is
- * that an instance of the <code>DocumentStyle</code> interface can be
- * obtained by using binding-specific casting methods on an instance of the
- * <code>Document</code> interface.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentStyle {
- /**
- * A list containing all the style sheets explicitly linked into or
- * embedded in a document. For HTML documents, this includes external
- * style sheets, included via the HTML LINK element, and inline STYLE
- * elements. In XML, this includes external style sheets, included via
- * style sheet processing instructions (see [XML StyleSheet]).
- */
- public StyleSheetList getStyleSheets();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/stylesheets/LinkStyle.java b/libjava/external/w3c_dom/org/w3c/dom/stylesheets/LinkStyle.java
deleted file mode 100644
index 481bd19dbab..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/stylesheets/LinkStyle.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.stylesheets;
-
-/**
- * The <code>LinkStyle</code> interface provides a mechanism by which a style
- * sheet can be retrieved from the node responsible for linking it into a
- * document. An instance of the <code>LinkStyle</code> interface can be
- * obtained using binding-specific casting methods on an instance of a
- * linking node (<code>HTMLLinkElement</code>, <code>HTMLStyleElement</code>
- * or <code>ProcessingInstruction</code> in DOM Level 2).
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface LinkStyle {
- /**
- * The style sheet.
- */
- public StyleSheet getSheet();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/stylesheets/MediaList.java b/libjava/external/w3c_dom/org/w3c/dom/stylesheets/MediaList.java
deleted file mode 100644
index f83d5f13d62..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/stylesheets/MediaList.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.stylesheets;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>MediaList</code> interface provides the abstraction of an
- * ordered collection of media, without defining or constraining how this
- * collection is implemented. An empty list is the same as a list that
- * contains the medium <code>"all"</code>.
- * <p> The items in the <code>MediaList</code> are accessible via an integral
- * index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface MediaList {
- /**
- * The parsable textual representation of the media list. This is a
- * comma-separated list of media.
- */
- public String getMediaText();
- /**
- * The parsable textual representation of the media list. This is a
- * comma-separated list of media.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified string value has a syntax error
- * and is unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this media list is
- * readonly.
- */
- public void setMediaText(String mediaText)
- throws DOMException;
-
- /**
- * The number of media in the list. The range of valid media is
- * <code>0</code> to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Returns the <code>index</code>th in the list. If <code>index</code> is
- * greater than or equal to the number of media in the list, this
- * returns <code>null</code>.
- * @param index Index into the collection.
- * @return The medium at the <code>index</code>th position in the
- * <code>MediaList</code>, or <code>null</code> if that is not a valid
- * index.
- */
- public String item(int index);
-
- /**
- * Deletes the medium indicated by <code>oldMedium</code> from the list.
- * @param oldMedium The medium to delete in the media list.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.
- * <br> NOT_FOUND_ERR: Raised if <code>oldMedium</code> is not in the
- * list.
- */
- public void deleteMedium(String oldMedium)
- throws DOMException;
-
- /**
- * Adds the medium <code>newMedium</code> to the end of the list. If the
- * <code>newMedium</code> is already used, it is first removed.
- * @param newMedium The new medium to add.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: If the medium contains characters that are
- * invalid in the underlying style language.
- * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.
- */
- public void appendMedium(String newMedium)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheet.java b/libjava/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheet.java
deleted file mode 100644
index 3da43076994..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheet.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.stylesheets;
-
-import org.w3c.dom.Node;
-
-/**
- * The <code>StyleSheet</code> interface is the abstract base interface for
- * any type of style sheet. It represents a single style sheet associated
- * with a structured document. In HTML, the StyleSheet interface represents
- * either an external style sheet, included via the HTML LINK element, or
- * an inline STYLE element. In XML, this interface represents an external
- * style sheet, included via a style sheet processing instruction.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface StyleSheet {
- /**
- * This specifies the style sheet language for this style sheet. The
- * style sheet language is specified as a content type (e.g.
- * "text/css"). The content type is often specified in the
- * <code>ownerNode</code>. Also see the type attribute definition for
- * the <code>LINK</code> element in HTML 4.0, and the type
- * pseudo-attribute for the XML style sheet processing instruction.
- */
- public String getType();
-
- /**
- * <code>false</code> if the style sheet is applied to the document.
- * <code>true</code> if it is not. Modifying this attribute may cause a
- * new resolution of style for the document. A stylesheet only applies
- * if both an appropriate medium definition is present and the disabled
- * attribute is false. So, if the media doesn't apply to the current
- * user agent, the <code>disabled</code> attribute is ignored.
- */
- public boolean getDisabled();
- /**
- * <code>false</code> if the style sheet is applied to the document.
- * <code>true</code> if it is not. Modifying this attribute may cause a
- * new resolution of style for the document. A stylesheet only applies
- * if both an appropriate medium definition is present and the disabled
- * attribute is false. So, if the media doesn't apply to the current
- * user agent, the <code>disabled</code> attribute is ignored.
- */
- public void setDisabled(boolean disabled);
-
- /**
- * The node that associates this style sheet with the document. For HTML,
- * this may be the corresponding <code>LINK</code> or <code>STYLE</code>
- * element. For XML, it may be the linking processing instruction. For
- * style sheets that are included by other style sheets, the value of
- * this attribute is <code>null</code>.
- */
- public Node getOwnerNode();
-
- /**
- * For style sheet languages that support the concept of style sheet
- * inclusion, this attribute represents the including style sheet, if
- * one exists. If the style sheet is a top-level style sheet, or the
- * style sheet language does not support inclusion, the value of this
- * attribute is <code>null</code>.
- */
- public StyleSheet getParentStyleSheet();
-
- /**
- * If the style sheet is a linked style sheet, the value of its attribute
- * is its location. For inline style sheets, the value of this attribute
- * is <code>null</code>. See the href attribute definition for the
- * <code>LINK</code> element in HTML 4.0, and the href pseudo-attribute
- * for the XML style sheet processing instruction.
- */
- public String getHref();
-
- /**
- * The advisory title. The title is often specified in the
- * <code>ownerNode</code>. See the title attribute definition for the
- * <code>LINK</code> element in HTML 4.0, and the title pseudo-attribute
- * for the XML style sheet processing instruction.
- */
- public String getTitle();
-
- /**
- * The intended destination media for style information. The media is
- * often specified in the <code>ownerNode</code>. If no media has been
- * specified, the <code>MediaList</code> will be empty. See the media
- * attribute definition for the <code>LINK</code> element in HTML 4.0,
- * and the media pseudo-attribute for the XML style sheet processing
- * instruction . Modifying the media list may cause a change to the
- * attribute <code>disabled</code>.
- */
- public MediaList getMedia();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheetList.java b/libjava/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheetList.java
deleted file mode 100644
index b8f9a442330..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheetList.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.stylesheets;
-
-/**
- * The <code>StyleSheetList</code> interface provides the abstraction of an
- * ordered collection of style sheets.
- * <p> The items in the <code>StyleSheetList</code> are accessible via an
- * integral index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface StyleSheetList {
- /**
- * The number of <code>StyleSheets</code> in the list. The range of valid
- * child stylesheet indices is <code>0</code> to <code>length-1</code>
- * inclusive.
- */
- public int getLength();
-
- /**
- * Used to retrieve a style sheet by ordinal index. If index is greater
- * than or equal to the number of style sheets in the list, this returns
- * <code>null</code>.
- * @param index Index into the collection
- * @return The style sheet at the <code>index</code> position in the
- * <code>StyleSheetList</code>, or <code>null</code> if that is not a
- * valid index.
- */
- public StyleSheet item(int index);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/traversal/DocumentTraversal.java b/libjava/external/w3c_dom/org/w3c/dom/traversal/DocumentTraversal.java
deleted file mode 100644
index bc45ad9f753..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/traversal/DocumentTraversal.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * <code>DocumentTraversal</code> contains methods that create
- * <code>NodeIterators</code> and <code>TreeWalkers</code> to traverse a
- * node and its children in document order (depth first, pre-order
- * traversal, which is equivalent to the order in which the start tags occur
- * in the text representation of the document). In DOMs which support the
- * Traversal feature, <code>DocumentTraversal</code> will be implemented by
- * the same objects that implement the Document interface.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentTraversal {
- /**
- * Create a new <code>NodeIterator</code> over the subtree rooted at the
- * specified node.
- * @param root The node which will be iterated together with its
- * children. The <code>NodeIterator</code> is initially positioned
- * just before this node. The <code>whatToShow</code> flags and the
- * filter, if any, are not considered when setting this position. The
- * root must not be <code>null</code>.
- * @param whatToShow This flag specifies which node types may appear in
- * the logical view of the tree presented by the
- * <code>NodeIterator</code>. See the description of
- * <code>NodeFilter</code> for the set of possible <code>SHOW_</code>
- * values.These flags can be combined using <code>OR</code>.
- * @param filter The <code>NodeFilter</code> to be used with this
- * <code>NodeIterator</code>, or <code>null</code> to indicate no
- * filter.
- * @param entityReferenceExpansion The value of this flag determines
- * whether entity reference nodes are expanded.
- * @return The newly created <code>NodeIterator</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the specified <code>root</code> is
- * <code>null</code>.
- */
- public NodeIterator createNodeIterator(Node root,
- int whatToShow,
- NodeFilter filter,
- boolean entityReferenceExpansion)
- throws DOMException;
-
- /**
- * Create a new <code>TreeWalker</code> over the subtree rooted at the
- * specified node.
- * @param root The node which will serve as the <code>root</code> for the
- * <code>TreeWalker</code>. The <code>whatToShow</code> flags and the
- * <code>NodeFilter</code> are not considered when setting this value;
- * any node type will be accepted as the <code>root</code>. The
- * <code>currentNode</code> of the <code>TreeWalker</code> is
- * initialized to this node, whether or not it is visible. The
- * <code>root</code> functions as a stopping point for traversal
- * methods that look upward in the document structure, such as
- * <code>parentNode</code> and nextNode. The <code>root</code> must
- * not be <code>null</code>.
- * @param whatToShow This flag specifies which node types may appear in
- * the logical view of the tree presented by the
- * <code>TreeWalker</code>. See the description of
- * <code>NodeFilter</code> for the set of possible <code>SHOW_</code>
- * values.These flags can be combined using <code>OR</code>.
- * @param filter The <code>NodeFilter</code> to be used with this
- * <code>TreeWalker</code>, or <code>null</code> to indicate no filter.
- * @param entityReferenceExpansion If this flag is false, the contents of
- * <code>EntityReference</code> nodes are not presented in the logical
- * view.
- * @return The newly created <code>TreeWalker</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the specified <code>root</code> is
- * <code>null</code>.
- */
- public TreeWalker createTreeWalker(Node root,
- int whatToShow,
- NodeFilter filter,
- boolean entityReferenceExpansion)
- throws DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/traversal/NodeFilter.java b/libjava/external/w3c_dom/org/w3c/dom/traversal/NodeFilter.java
deleted file mode 100644
index b9beac476b3..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/traversal/NodeFilter.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-
-/**
- * Filters are objects that know how to "filter out" nodes. If a
- * <code>NodeIterator</code> or <code>TreeWalker</code> is given a
- * <code>NodeFilter</code>, it applies the filter before it returns the next
- * node. If the filter says to accept the node, the traversal logic returns
- * it; otherwise, traversal looks for the next node and pretends that the
- * node that was rejected was not there.
- * <p>The DOM does not provide any filters. <code>NodeFilter</code> is just an
- * interface that users can implement to provide their own filters.
- * <p><code>NodeFilters</code> do not need to know how to traverse from node
- * to node, nor do they need to know anything about the data structure that
- * is being traversed. This makes it very easy to write filters, since the
- * only thing they have to know how to do is evaluate a single node. One
- * filter may be used with a number of different kinds of traversals,
- * encouraging code reuse.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface NodeFilter {
- // Constants returned by acceptNode
- /**
- * Accept the node. Navigation methods defined for
- * <code>NodeIterator</code> or <code>TreeWalker</code> will return this
- * node.
- */
- public static final short FILTER_ACCEPT = 1;
- /**
- * Reject the node. Navigation methods defined for
- * <code>NodeIterator</code> or <code>TreeWalker</code> will not return
- * this node. For <code>TreeWalker</code>, the children of this node
- * will also be rejected. <code>NodeIterators</code> treat this as a
- * synonym for <code>FILTER_SKIP</code>.
- */
- public static final short FILTER_REJECT = 2;
- /**
- * Skip this single node. Navigation methods defined for
- * <code>NodeIterator</code> or <code>TreeWalker</code> will not return
- * this node. For both <code>NodeIterator</code> and
- * <code>TreeWalker</code>, the children of this node will still be
- * considered.
- */
- public static final short FILTER_SKIP = 3;
-
- // Constants for whatToShow
- /**
- * Show all <code>Nodes</code>.
- */
- public static final int SHOW_ALL = 0xFFFFFFFF;
- /**
- * Show <code>Element</code> nodes.
- */
- public static final int SHOW_ELEMENT = 0x00000001;
- /**
- * Show <code>Attr</code> nodes. This is meaningful only when creating an
- * <code>NodeIterator</code> or <code>TreeWalker</code> with an
- * attribute node as its <code>root</code>; in this case, it means that
- * the attribute node will appear in the first position of the iteration
- * or traversal. Since attributes are never children of other nodes,
- * they do not appear when traversing over the document tree.
- */
- public static final int SHOW_ATTRIBUTE = 0x00000002;
- /**
- * Show <code>Text</code> nodes.
- */
- public static final int SHOW_TEXT = 0x00000004;
- /**
- * Show <code>CDATASection</code> nodes.
- */
- public static final int SHOW_CDATA_SECTION = 0x00000008;
- /**
- * Show <code>EntityReference</code> nodes.
- */
- public static final int SHOW_ENTITY_REFERENCE = 0x00000010;
- /**
- * Show <code>Entity</code> nodes. This is meaningful only when creating
- * an <code>NodeIterator</code> or <code>TreeWalker</code> with an
- * <code>Entity</code> node as its <code>root</code>; in this case, it
- * means that the <code>Entity</code> node will appear in the first
- * position of the traversal. Since entities are not part of the
- * document tree, they do not appear when traversing over the document
- * tree.
- */
- public static final int SHOW_ENTITY = 0x00000020;
- /**
- * Show <code>ProcessingInstruction</code> nodes.
- */
- public static final int SHOW_PROCESSING_INSTRUCTION = 0x00000040;
- /**
- * Show <code>Comment</code> nodes.
- */
- public static final int SHOW_COMMENT = 0x00000080;
- /**
- * Show <code>Document</code> nodes.
- */
- public static final int SHOW_DOCUMENT = 0x00000100;
- /**
- * Show <code>DocumentType</code> nodes.
- */
- public static final int SHOW_DOCUMENT_TYPE = 0x00000200;
- /**
- * Show <code>DocumentFragment</code> nodes.
- */
- public static final int SHOW_DOCUMENT_FRAGMENT = 0x00000400;
- /**
- * Show <code>Notation</code> nodes. This is meaningful only when creating
- * an <code>NodeIterator</code> or <code>TreeWalker</code> with a
- * <code>Notation</code> node as its <code>root</code>; in this case, it
- * means that the <code>Notation</code> node will appear in the first
- * position of the traversal. Since notations are not part of the
- * document tree, they do not appear when traversing over the document
- * tree.
- */
- public static final int SHOW_NOTATION = 0x00000800;
-
- /**
- * Test whether a specified node is visible in the logical view of a
- * <code>TreeWalker</code> or <code>NodeIterator</code>. This function
- * will be called by the implementation of <code>TreeWalker</code> and
- * <code>NodeIterator</code>; it is not normally called directly from
- * user code. (Though you could do so if you wanted to use the same
- * filter to guide your own application logic.)
- * @param n The node to check to see if it passes the filter or not.
- * @return A constant to determine whether the node is accepted,
- * rejected, or skipped, as defined above.
- */
- public short acceptNode(Node n);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/traversal/NodeIterator.java b/libjava/external/w3c_dom/org/w3c/dom/traversal/NodeIterator.java
deleted file mode 100644
index d1f0d08399d..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/traversal/NodeIterator.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * <code>NodeIterators</code> are used to step through a set of nodes, e.g.
- * the set of nodes in a <code>NodeList</code>, the document subtree
- * governed by a particular <code>Node</code>, the results of a query, or
- * any other set of nodes. The set of nodes to be iterated is determined by
- * the implementation of the <code>NodeIterator</code>. DOM Level 2
- * specifies a single <code>NodeIterator</code> implementation for
- * document-order traversal of a document subtree. Instances of these
- * <code>NodeIterators</code> are created by calling
- * <code>DocumentTraversal</code><code>.createNodeIterator()</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface NodeIterator {
- /**
- * The root node of the <code>NodeIterator</code>, as specified when it
- * was created.
- */
- public Node getRoot();
-
- /**
- * This attribute determines which node types are presented via the
- * <code>NodeIterator</code>. The available set of constants is defined
- * in the <code>NodeFilter</code> interface. Nodes not accepted by
- * <code>whatToShow</code> will be skipped, but their children may still
- * be considered. Note that this skip takes precedence over the filter,
- * if any.
- */
- public int getWhatToShow();
-
- /**
- * The <code>NodeFilter</code> used to screen nodes.
- */
- public NodeFilter getFilter();
-
- /**
- * The value of this flag determines whether the children of entity
- * reference nodes are visible to the <code>NodeIterator</code>. If
- * false, these children and their descendants will be rejected. Note
- * that this rejection takes precedence over <code>whatToShow</code> and
- * the filter. Also note that this is currently the only situation where
- * <code>NodeIterators</code> may reject a complete subtree rather than
- * skipping individual nodes.
- * <br>
- * <br> To produce a view of the document that has entity references
- * expanded and does not expose the entity reference node itself, use
- * the <code>whatToShow</code> flags to hide the entity reference node
- * and set <code>expandEntityReferences</code> to true when creating the
- * <code>NodeIterator</code>. To produce a view of the document that has
- * entity reference nodes but no entity expansion, use the
- * <code>whatToShow</code> flags to show the entity reference node and
- * set <code>expandEntityReferences</code> to false.
- */
- public boolean getExpandEntityReferences();
-
- /**
- * Returns the next node in the set and advances the position of the
- * <code>NodeIterator</code> in the set. After a
- * <code>NodeIterator</code> is created, the first call to
- * <code>nextNode()</code> returns the first node in the set.
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if this method is called after the
- * <code>detach</code> method was invoked.
- */
- public Node nextNode()
- throws DOMException;
-
- /**
- * Returns the previous node in the set and moves the position of the
- * <code>NodeIterator</code> backwards in the set.
- * @return The previous <code>Node</code> in the set being iterated over,
- * or <code>null</code> if there are no more members in that set.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if this method is called after the
- * <code>detach</code> method was invoked.
- */
- public Node previousNode()
- throws DOMException;
-
- /**
- * Detaches the <code>NodeIterator</code> from the set which it iterated
- * over, releasing any computational resources and placing the
- * <code>NodeIterator</code> in the INVALID state. After
- * <code>detach</code> has been invoked, calls to <code>nextNode</code>
- * or <code>previousNode</code> will raise the exception
- * INVALID_STATE_ERR.
- */
- public void detach();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/traversal/TreeWalker.java b/libjava/external/w3c_dom/org/w3c/dom/traversal/TreeWalker.java
deleted file mode 100644
index f5fff86be09..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/traversal/TreeWalker.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * <code>TreeWalker</code> objects are used to navigate a document tree or
- * subtree using the view of the document defined by their
- * <code>whatToShow</code> flags and filter (if any). Any function which
- * performs navigation using a <code>TreeWalker</code> will automatically
- * support any view defined by a <code>TreeWalker</code>.
- * <p>Omitting nodes from the logical view of a subtree can result in a
- * structure that is substantially different from the same subtree in the
- * complete, unfiltered document. Nodes that are siblings in the
- * <code>TreeWalker</code> view may be children of different, widely
- * separated nodes in the original view. For instance, consider a
- * <code>NodeFilter</code> that skips all nodes except for Text nodes and
- * the root node of a document. In the logical view that results, all text
- * nodes will be siblings and appear as direct children of the root node, no
- * matter how deeply nested the structure of the original document.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface TreeWalker {
- /**
- * The <code>root</code> node of the <code>TreeWalker</code>, as specified
- * when it was created.
- */
- public Node getRoot();
-
- /**
- * This attribute determines which node types are presented via the
- * <code>TreeWalker</code>. The available set of constants is defined in
- * the <code>NodeFilter</code> interface. Nodes not accepted by
- * <code>whatToShow</code> will be skipped, but their children may still
- * be considered. Note that this skip takes precedence over the filter,
- * if any.
- */
- public int getWhatToShow();
-
- /**
- * The filter used to screen nodes.
- */
- public NodeFilter getFilter();
-
- /**
- * The value of this flag determines whether the children of entity
- * reference nodes are visible to the <code>TreeWalker</code>. If false,
- * these children and their descendants will be rejected. Note that
- * this rejection takes precedence over <code>whatToShow</code> and the
- * filter, if any.
- * <br> To produce a view of the document that has entity references
- * expanded and does not expose the entity reference node itself, use
- * the <code>whatToShow</code> flags to hide the entity reference node
- * and set <code>expandEntityReferences</code> to true when creating the
- * <code>TreeWalker</code>. To produce a view of the document that has
- * entity reference nodes but no entity expansion, use the
- * <code>whatToShow</code> flags to show the entity reference node and
- * set <code>expandEntityReferences</code> to false.
- */
- public boolean getExpandEntityReferences();
-
- /**
- * The node at which the <code>TreeWalker</code> is currently positioned.
- * <br>Alterations to the DOM tree may cause the current node to no longer
- * be accepted by the <code>TreeWalker</code>'s associated filter.
- * <code>currentNode</code> may also be explicitly set to any node,
- * whether or not it is within the subtree specified by the
- * <code>root</code> node or would be accepted by the filter and
- * <code>whatToShow</code> flags. Further traversal occurs relative to
- * <code>currentNode</code> even if it is not part of the current view,
- * by applying the filters in the requested direction; if no traversal
- * is possible, <code>currentNode</code> is not changed.
- */
- public Node getCurrentNode();
- /**
- * The node at which the <code>TreeWalker</code> is currently positioned.
- * <br>Alterations to the DOM tree may cause the current node to no longer
- * be accepted by the <code>TreeWalker</code>'s associated filter.
- * <code>currentNode</code> may also be explicitly set to any node,
- * whether or not it is within the subtree specified by the
- * <code>root</code> node or would be accepted by the filter and
- * <code>whatToShow</code> flags. Further traversal occurs relative to
- * <code>currentNode</code> even if it is not part of the current view,
- * by applying the filters in the requested direction; if no traversal
- * is possible, <code>currentNode</code> is not changed.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if an attempt is made to set
- * <code>currentNode</code> to <code>null</code>.
- */
- public void setCurrentNode(Node currentNode)
- throws DOMException;
-
- /**
- * Moves to and returns the closest visible ancestor node of the current
- * node. If the search for <code>parentNode</code> attempts to step
- * upward from the <code>TreeWalker</code>'s <code>root</code> node, or
- * if it fails to find a visible ancestor node, this method retains the
- * current position and returns <code>null</code>.
- * @return The new parent node, or <code>null</code> if the current node
- * has no parent in the <code>TreeWalker</code>'s logical view.
- */
- public Node parentNode();
-
- /**
- * Moves the <code>TreeWalker</code> to the first visible child of the
- * current node, and returns the new node. If the current node has no
- * visible children, returns <code>null</code>, and retains the current
- * node.
- * @return The new node, or <code>null</code> if the current node has no
- * visible children in the <code>TreeWalker</code>'s logical view.
- */
- public Node firstChild();
-
- /**
- * Moves the <code>TreeWalker</code> to the last visible child of the
- * current node, and returns the new node. If the current node has no
- * visible children, returns <code>null</code>, and retains the current
- * node.
- * @return The new node, or <code>null</code> if the current node has no
- * children in the <code>TreeWalker</code>'s logical view.
- */
- public Node lastChild();
-
- /**
- * Moves the <code>TreeWalker</code> to the previous sibling of the
- * current node, and returns the new node. If the current node has no
- * visible previous sibling, returns <code>null</code>, and retains the
- * current node.
- * @return The new node, or <code>null</code> if the current node has no
- * previous sibling. in the <code>TreeWalker</code>'s logical view.
- */
- public Node previousSibling();
-
- /**
- * Moves the <code>TreeWalker</code> to the next sibling of the current
- * node, and returns the new node. If the current node has no visible
- * next sibling, returns <code>null</code>, and retains the current node.
- * @return The new node, or <code>null</code> if the current node has no
- * next sibling. in the <code>TreeWalker</code>'s logical view.
- */
- public Node nextSibling();
-
- /**
- * Moves the <code>TreeWalker</code> to the previous visible node in
- * document order relative to the current node, and returns the new
- * node. If the current node has no previous node, or if the search for
- * <code>previousNode</code> attempts to step upward from the
- * <code>TreeWalker</code>'s <code>root</code> node, returns
- * <code>null</code>, and retains the current node.
- * @return The new node, or <code>null</code> if the current node has no
- * previous node in the <code>TreeWalker</code>'s logical view.
- */
- public Node previousNode();
-
- /**
- * Moves the <code>TreeWalker</code> to the next visible node in document
- * order relative to the current node, and returns the new node. If the
- * current node has no next node, or if the search for nextNode attempts
- * to step upward from the <code>TreeWalker</code>'s <code>root</code>
- * node, returns <code>null</code>, and retains the current node.
- * @return The new node, or <code>null</code> if the current node has no
- * next node in the <code>TreeWalker</code>'s logical view.
- */
- public Node nextNode();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/views/AbstractView.java b/libjava/external/w3c_dom/org/w3c/dom/views/AbstractView.java
deleted file mode 100644
index 97e8f0e2b0b..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/views/AbstractView.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.views;
-
-/**
- * A base interface that all views shall derive from.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113'>Document Object Model (DOM) Level 2 Views Specification</a>.
- * @since DOM Level 2
- */
-public interface AbstractView {
- /**
- * The source <code>DocumentView</code> of which this is an
- * <code>AbstractView</code>.
- */
- public DocumentView getDocument();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/views/DocumentView.java b/libjava/external/w3c_dom/org/w3c/dom/views/DocumentView.java
deleted file mode 100644
index 2cb9eebb84b..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/views/DocumentView.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program 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 W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.views;
-
-/**
- * The <code>DocumentView</code> interface is implemented by
- * <code>Document</code> objects in DOM implementations supporting DOM
- * Views. It provides an attribute to retrieve the default view of a
- * document.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113'>Document Object Model (DOM) Level 2 Views Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentView {
- /**
- * The default <code>AbstractView</code> for this <code>Document</code>,
- * or <code>null</code> if none available.
- */
- public AbstractView getDefaultView();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathEvaluator.java b/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathEvaluator.java
deleted file mode 100644
index a85c0e811da..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathEvaluator.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.xpath;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * The evaluation of XPath expressions is provided by
- * <code>XPathEvaluator</code>. In a DOM implementation which supports the
- * XPath 3.0 feature, as described above, the <code>XPathEvaluator</code>
- * interface will be implemented on the same object which implements the
- * <code>Document</code> interface permitting it to be obtained by the usual
- * binding-specific method such as casting or by using the DOM Level 3
- * getInterface method. In this case the implementation obtained from the
- * Document supports the XPath DOM module and is compatible with the XPath
- * 1.0 specification.
- * <p>Evaluation of expressions with specialized extension functions or
- * variables may not work in all implementations and is, therefore, not
- * portable. <code>XPathEvaluator</code> implementations may be available
- * from other sources that could provide specific support for specialized
- * extension functions or variables as would be defined by other
- * specifications.
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public interface XPathEvaluator {
- /**
- * Creates a parsed XPath expression with resolved namespaces. This is
- * useful when an expression will be reused in an application since it
- * makes it possible to compile the expression string into a more
- * efficient internal form and preresolve all namespace prefixes which
- * occur within the expression.
- * @param expression The XPath expression string to be parsed.
- * @param resolver The <code>resolver</code> permits translation of all
- * prefixes, including the <code>xml</code> namespace prefix, within
- * the XPath expression into appropriate namespace URIs. If this is
- * specified as <code>null</code>, any namespace prefix within the
- * expression will result in <code>DOMException</code> being thrown
- * with the code <code>NAMESPACE_ERR</code>.
- * @return The compiled form of the XPath expression.
- * @exception XPathException
- * INVALID_EXPRESSION_ERR: Raised if the expression is not legal
- * according to the rules of the <code>XPathEvaluator</code>.
- * @exception DOMException
- * NAMESPACE_ERR: Raised if the expression contains namespace prefixes
- * which cannot be resolved by the specified
- * <code>XPathNSResolver</code>.
- */
- public XPathExpression createExpression(String expression,
- XPathNSResolver resolver)
- throws XPathException, DOMException;
-
- /**
- * Adapts any DOM node to resolve namespaces so that an XPath expression
- * can be easily evaluated relative to the context of the node where it
- * appeared within the document. This adapter works like the DOM Level 3
- * method <code>lookupNamespaceURI</code> on nodes in resolving the
- * namespaceURI from a given prefix using the current information
- * available in the node's hierarchy at the time lookupNamespaceURI is
- * called. also correctly resolving the implicit xml prefix.
- * @param nodeResolver The node to be used as a context for namespace
- * resolution.
- * @return <code>XPathNSResolver</code> which resolves namespaces with
- * respect to the definitions in scope for a specified node.
- */
- public XPathNSResolver createNSResolver(Node nodeResolver);
-
- /**
- * Evaluates an XPath expression string and returns a result of the
- * specified type if possible.
- * @param expression The XPath expression string to be parsed and
- * evaluated.
- * @param contextNode The <code>context</code> is context node for the
- * evaluation of this XPath expression. If the XPathEvaluator was
- * obtained by casting the <code>Document</code> then this must be
- * owned by the same document and must be a <code>Document</code>,
- * <code>Element</code>, <code>Attribute</code>, <code>Text</code>,
- * <code>CDATASection</code>, <code>Comment</code>,
- * <code>ProcessingInstruction</code>, or <code>XPathNamespace</code>
- * node. If the context node is a <code>Text</code> or a
- * <code>CDATASection</code>, then the context is interpreted as the
- * whole logical text node as seen by XPath, unless the node is empty
- * in which case it may not serve as the XPath context.
- * @param resolver The <code>resolver</code> permits translation of all
- * prefixes, including the <code>xml</code> namespace prefix, within
- * the XPath expression into appropriate namespace URIs. If this is
- * specified as <code>null</code>, any namespace prefix within the
- * expression will result in <code>DOMException</code> being thrown
- * with the code <code>NAMESPACE_ERR</code>.
- * @param type If a specific <code>type</code> is specified, then the
- * result will be returned as the corresponding type.For XPath 1.0
- * results, this must be one of the codes of the
- * <code>XPathResult</code> interface.
- * @param result The <code>result</code> specifies a specific result
- * object which may be reused and returned by this method. If this is
- * specified as <code>null</code>or the implementation does not reuse
- * the specified result, a new result object will be constructed and
- * returned.For XPath 1.0 results, this object will be of type
- * <code>XPathResult</code>.
- * @return The result of the evaluation of the XPath expression.For XPath
- * 1.0 results, this object will be of type <code>XPathResult</code>.
- * @exception XPathException
- * INVALID_EXPRESSION_ERR: Raised if the expression is not legal
- * according to the rules of the <code>XPathEvaluator</code>i
- * <br>TYPE_ERR: Raised if the result cannot be converted to return the
- * specified type.
- * @exception DOMException
- * NAMESPACE_ERR: Raised if the expression contains namespace prefixes
- * which cannot be resolved by the specified
- * <code>XPathNSResolver</code>.
- * <br>WRONG_DOCUMENT_ERR: The Node is from a document that is not
- * supported by this <code>XPathEvaluator</code>.
- * <br>NOT_SUPPORTED_ERR: The Node is not a type permitted as an XPath
- * context node or the request type is not permitted by this
- * <code>XPathEvaluator</code>.
- */
- public Object evaluate(String expression,
- Node contextNode,
- XPathNSResolver resolver,
- short type,
- Object result)
- throws XPathException, DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathException.java b/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathException.java
deleted file mode 100644
index deb1bd78394..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.xpath;
-
-/**
- * A new exception has been created for exceptions specific to these XPath
- * interfaces.
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public class XPathException extends RuntimeException {
- public XPathException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // XPathExceptionCode
- /**
- * If the expression has a syntax error or otherwise is not a legal
- * expression according to the rules of the specific
- * <code>XPathEvaluator</code> or contains specialized extension
- * functions or variables not supported by this implementation.
- */
- public static final short INVALID_EXPRESSION_ERR = 51;
- /**
- * If the expression cannot be converted to return the specified type.
- */
- public static final short TYPE_ERR = 52;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathExpression.java b/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathExpression.java
deleted file mode 100644
index e972532544d..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathExpression.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.xpath;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>XPathExpression</code> interface represents a parsed and resolved
- * XPath expression.
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public interface XPathExpression {
- /**
- * Evaluates this XPath expression and returns a result.
- * @param contextNode The <code>context</code> is context node for the
- * evaluation of this XPath expression.If the XPathEvaluator was
- * obtained by casting the <code>Document</code> then this must be
- * owned by the same document and must be a <code>Document</code>,
- * <code>Element</code>, <code>Attribute</code>, <code>Text</code>,
- * <code>CDATASection</code>, <code>Comment</code>,
- * <code>ProcessingInstruction</code>, or <code>XPathNamespace</code>
- * node.If the context node is a <code>Text</code> or a
- * <code>CDATASection</code>, then the context is interpreted as the
- * whole logical text node as seen by XPath, unless the node is empty
- * in which case it may not serve as the XPath context.
- * @param type If a specific <code>type</code> is specified, then the
- * result will be coerced to return the specified type relying on
- * XPath conversions and fail if the desired coercion is not possible.
- * This must be one of the type codes of <code>XPathResult</code>.
- * @param result The <code>result</code> specifies a specific result
- * object which may be reused and returned by this method. If this is
- * specified as <code>null</code>or the implementation does not reuse
- * the specified result, a new result object will be constructed and
- * returned.For XPath 1.0 results, this object will be of type
- * <code>XPathResult</code>.
- * @return The result of the evaluation of the XPath expression.For XPath
- * 1.0 results, this object will be of type <code>XPathResult</code>.
- * @exception XPathException
- * TYPE_ERR: Raised if the result cannot be converted to return the
- * specified type.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: The Node is from a document that is not supported
- * by the XPathEvaluator that created this <code>XPathExpression</code>
- * .
- * <br>NOT_SUPPORTED_ERR: The Node is not a type permitted as an XPath
- * context node or the request type is not permitted by this
- * <code>XPathExpression</code>.
- */
- public Object evaluate(Node contextNode,
- short type,
- Object result)
- throws XPathException, DOMException;
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathNSResolver.java b/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathNSResolver.java
deleted file mode 100644
index b8f05213812..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathNSResolver.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.xpath;
-
-/**
- * The <code>XPathNSResolver</code> interface permit <code>prefix</code>
- * strings in the expression to be properly bound to
- * <code>namespaceURI</code> strings. <code>XPathEvaluator</code> can
- * construct an implementation of <code>XPathNSResolver</code> from a node,
- * or the interface may be implemented by any application.
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public interface XPathNSResolver {
- /**
- * Look up the namespace URI associated to the given namespace prefix. The
- * XPath evaluator must never call this with a <code>null</code> or
- * empty argument, because the result of doing this is undefined.
- * @param prefix The prefix to look for.
- * @return Returns the associated namespace URI or <code>null</code> if
- * none is found.
- */
- public String lookupNamespaceURI(String prefix);
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathNamespace.java b/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathNamespace.java
deleted file mode 100644
index 9f15481d584..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathNamespace.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.xpath;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * The <code>XPathNamespace</code> interface is returned by
- * <code>XPathResult</code> interfaces to represent the XPath namespace node
- * type that DOM lacks. There is no public constructor for this node type.
- * Attempts to place it into a hierarchy or a NamedNodeMap result in a
- * <code>DOMException</code> with the code <code>HIERARCHY_REQUEST_ERR</code>
- * . This node is read only, so methods or setting of attributes that would
- * mutate the node result in a DOMException with the code
- * <code>NO_MODIFICATION_ALLOWED_ERR</code>.
- * <p>The core specification describes attributes of the <code>Node</code>
- * interface that are different for different node types but does not
- * describe <code>XPATH_NAMESPACE_NODE</code>, so here is a description of
- * those attributes for this node type. All attributes of <code>Node</code>
- * not described in this section have a <code>null</code> or
- * <code>false</code> value.
- * <p><code>ownerDocument</code> matches the <code>ownerDocument</code> of the
- * <code>ownerElement</code> even if the element is later adopted.
- * <p><code>nodeName</code> is always the string "<code>#namespace</code>".
- * <p><code>prefix</code> is the prefix of the namespace represented by the
- * node.
- * <p><code>localName</code> is the same as <code>prefix</code>.
- * <p><code>nodeType</code> is equal to <code>XPATH_NAMESPACE_NODE</code>.
- * <p><code>namespaceURI</code> is the namespace URI of the namespace
- * represented by the node.
- * <p><code>nodeValue</code> is the same as <code>namespaceURI</code>.
- * <p><code>adoptNode</code>, <code>cloneNode</code>, and
- * <code>importNode</code> fail on this node type by raising a
- * <code>DOMException</code> with the code <code>NOT_SUPPORTED_ERR</code>.
- * <p ><b>Note:</b> In future versions of the XPath specification, the
- * definition of a namespace node may be changed incomatibly, in which case
- * incompatible changes to field values may be required to implement
- * versions beyond XPath 1.0.
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public interface XPathNamespace extends Node {
- // XPathNodeType
- /**
- * The node is a <code>Namespace</code>.
- */
- public static final short XPATH_NAMESPACE_NODE = 13;
-
- /**
- * The <code>Element</code> on which the namespace was in scope when it
- * was requested. This does not change on a returned namespace node even
- * if the document changes such that the namespace goes out of scope on
- * that element and this node is no longer found there by XPath.
- */
- public Element getOwnerElement();
-
-}
diff --git a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathResult.java b/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathResult.java
deleted file mode 100644
index 56064b90ecf..00000000000
--- a/libjava/external/w3c_dom/org/w3c/dom/xpath/XPathResult.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.xpath;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>XPathResult</code> interface represents the result of the
- * evaluation of an XPath 1.0 expression within the context of a particular
- * node. Since evaluation of an XPath expression can result in various
- * result types, this object makes it possible to discover and manipulate
- * the type and value of the result.
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public interface XPathResult {
- // XPathResultType
- /**
- * This code does not represent a specific type. An evaluation of an XPath
- * expression will never produce this type. If this type is requested,
- * then the evaluation returns whatever type naturally results from
- * evaluation of the expression.
- * <br>If the natural result is a node set when <code>ANY_TYPE</code> was
- * requested, then <code>UNORDERED_NODE_ITERATOR_TYPE</code> is always
- * the resulting type. Any other representation of a node set must be
- * explicitly requested.
- */
- public static final short ANY_TYPE = 0;
- /**
- * The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#numbers'>number</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>].
- * Document modification does not invalidate the number, but may mean
- * that reevaluation would not yield the same number.
- */
- public static final short NUMBER_TYPE = 1;
- /**
- * The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#strings'>string</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>].
- * Document modification does not invalidate the string, but may mean
- * that the string no longer corresponds to the current document.
- */
- public static final short STRING_TYPE = 2;
- /**
- * The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#booleans'>boolean</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>].
- * Document modification does not invalidate the boolean, but may mean
- * that reevaluation would not yield the same boolean.
- */
- public static final short BOOLEAN_TYPE = 3;
- /**
- * The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that
- * will be accessed iteratively, which may not produce nodes in a
- * particular order. Document modification invalidates the iteration.
- * <br>This is the default type returned if the result is a node set and
- * <code>ANY_TYPE</code> is requested.
- */
- public static final short UNORDERED_NODE_ITERATOR_TYPE = 4;
- /**
- * The result is a node set as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that
- * will be accessed iteratively, which will produce document-ordered
- * nodes. Document modification invalidates the iteration.
- */
- public static final short ORDERED_NODE_ITERATOR_TYPE = 5;
- /**
- * The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that
- * will be accessed as a snapshot list of nodes that may not be in a
- * particular order. Document modification does not invalidate the
- * snapshot but may mean that reevaluation would not yield the same
- * snapshot and nodes in the snapshot may have been altered, moved, or
- * removed from the document.
- */
- public static final short UNORDERED_NODE_SNAPSHOT_TYPE = 6;
- /**
- * The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that
- * will be accessed as a snapshot list of nodes that will be in original
- * document order. Document modification does not invalidate the
- * snapshot but may mean that reevaluation would not yield the same
- * snapshot and nodes in the snapshot may have been altered, moved, or
- * removed from the document.
- */
- public static final short ORDERED_NODE_SNAPSHOT_TYPE = 7;
- /**
- * The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] and
- * will be accessed as a single node, which may be <code>null</code>if
- * the node set is empty. Document modification does not invalidate the
- * node, but may mean that the result node no longer corresponds to the
- * current document. This is a convenience that permits optimization
- * since the implementation can stop once any node in the resulting set
- * has been found.
- * <br>If there is more than one node in the actual result, the single
- * node returned might not be the first in document order.
- */
- public static final short ANY_UNORDERED_NODE_TYPE = 8;
- /**
- * The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] and
- * will be accessed as a single node, which may be <code>null</code> if
- * the node set is empty. Document modification does not invalidate the
- * node, but may mean that the result node no longer corresponds to the
- * current document. This is a convenience that permits optimization
- * since the implementation can stop once the first node in document
- * order of the resulting set has been found.
- * <br>If there are more than one node in the actual result, the single
- * node returned will be the first in document order.
- */
- public static final short FIRST_ORDERED_NODE_TYPE = 9;
-
- /**
- * A code representing the type of this result, as defined by the type
- * constants.
- */
- public short getResultType();
-
- /**
- * The value of this number result. If the native double type of the DOM
- * binding does not directly support the exact IEEE 754 result of the
- * XPath expression, then it is up to the definition of the binding to
- * specify how the XPath number is converted to the native binding
- * number.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>NUMBER_TYPE</code>.
- */
- public double getNumberValue()
- throws XPathException;
-
- /**
- * The value of this string result.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>STRING_TYPE</code>.
- */
- public String getStringValue()
- throws XPathException;
-
- /**
- * The value of this boolean result.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>BOOLEAN_TYPE</code>.
- */
- public boolean getBooleanValue()
- throws XPathException;
-
- /**
- * The value of this single node result, which may be <code>null</code>.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>ANY_UNORDERED_NODE_TYPE</code> or
- * <code>FIRST_ORDERED_NODE_TYPE</code>.
- */
- public Node getSingleNodeValue()
- throws XPathException;
-
- /**
- * Signifies that the iterator has become invalid. True if
- * <code>resultType</code> is <code>UNORDERED_NODE_ITERATOR_TYPE</code>
- * or <code>ORDERED_NODE_ITERATOR_TYPE</code> and the document has been
- * modified since this result was returned.
- */
- public boolean getInvalidIteratorState();
-
- /**
- * The number of nodes in the result snapshot. Valid values for
- * snapshotItem indices are <code>0</code> to
- * <code>snapshotLength-1</code> inclusive.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or
- * <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.
- */
- public int getSnapshotLength()
- throws XPathException;
-
- /**
- * Iterates and returns the next node from the node set or
- * <code>null</code>if there are no more nodes.
- * @return Returns the next node.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>UNORDERED_NODE_ITERATOR_TYPE</code> or
- * <code>ORDERED_NODE_ITERATOR_TYPE</code>.
- * @exception DOMException
- * INVALID_STATE_ERR: The document has been mutated since the result was
- * returned.
- */
- public Node iterateNext()
- throws XPathException, DOMException;
-
- /**
- * Returns the <code>index</code>th item in the snapshot collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this method returns <code>null</code>. Unlike the iterator
- * result, the snapshot does not become invalid, but may not correspond
- * to the current document if it is mutated.
- * @param index Index into the snapshot collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or
- * <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.
- */
- public Node snapshotItem(int index)
- throws XPathException;
-
-}
diff --git a/libjava/gcj/Makefile.in b/libjava/gcj/Makefile.in
index a357231c683..56189d7a7d9 100644
--- a/libjava/gcj/Makefile.in
+++ b/libjava/gcj/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004 Free Software Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -43,14 +43,12 @@ DIST_COMMON = $(gcj_HEADERS) $(srcdir)/Makefile.am \
$(toolgcj_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
- $(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
$(top_srcdir)/../config/iconv.m4 \
$(top_srcdir)/../config/lcmessage.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
$(top_srcdir)/../config/lib-link.m4 \
- $(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
+ $(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
diff --git a/libjava/gnu/classpath/Configuration.java.in b/libjava/gnu/classpath/Configuration.java.in
deleted file mode 100644
index f1c6bc5680d..00000000000
--- a/libjava/gnu/classpath/Configuration.java.in
+++ /dev/null
@@ -1,62 +0,0 @@
-/* gnu.classpath.Configuration
- Copyright (C) 1998, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.classpath;
-
-/**
- * This file defines compile-time constants that can be accessed by
- * java code. It is pre-processed by configure.
- */
-public interface Configuration
-{
- // The value of DEBUG is substituted according to whether the
- // "--enable-libgcj-debug" argument was passed to configure. Code
- // which is made conditional based on the value of this flag will
- // be removed by the optimizer in a non-debug build.
- boolean DEBUG = @LIBGCJDEBUG@;
-
- // For libgcj we never load the JNI libraries.
- boolean INIT_LOAD_LIBRARY = false;
-
- // For libgcj we have native methods for dynamic proxy support....
- boolean HAVE_NATIVE_GET_PROXY_DATA = false;
- boolean HAVE_NATIVE_GET_PROXY_CLASS = false;
- boolean HAVE_NATIVE_GENERATE_PROXY_CLASS = false;
-
- // Name of default AWT peer library.
- String default_awt_peer_toolkit = "@TOOLKIT@";
-}
diff --git a/libjava/gnu/classpath/ServiceFactory.java b/libjava/gnu/classpath/ServiceFactory.java
deleted file mode 100644
index 711a9042cbf..00000000000
--- a/libjava/gnu/classpath/ServiceFactory.java
+++ /dev/null
@@ -1,573 +0,0 @@
-/* ServiceFactory.java -- Factory for plug-in services.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.classpath;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-
-
-/**
- * A factory for plug-ins that conform to a service provider
- * interface. This is a general mechanism that gets used by a number
- * of packages in the Java API. For instance, {@link
- * java.nio.charset.spi.CharsetProvider} allows to write custom
- * encoders and decoders for character sets, {@link
- * javax.imageio.spi.ImageReaderSpi} allows to support custom image
- * formats, and {@link javax.print.PrintService} makes it possible to
- * write custom printer drivers.
- *
- * <p>The plug-ins are concrete implementations of the service
- * provider interface, which is defined as an interface or an abstract
- * class. The implementation classes must be public and have a public
- * constructor that takes no arguments.
- *
- * <p>Plug-ins are usually deployed in JAR files. A JAR that provides
- * an implementation of a service must declare this in a resource file
- * whose name is the fully qualified service name and whose location
- * is the directory <code>META-INF/services</code>. This UTF-8 encoded
- * text file lists, on separate lines, the fully qualified names of
- * the concrete implementations. Thus, one JAR file can provide an
- * arbitrary number of implementations for an arbitrary count of
- * service provider interfaces.
- *
- * <p><b>Example</b>
- *
- * <p>For example, a JAR might provide two implementations of the
- * service provider interface <code>org.foo.ThinkService</code>,
- * namely <code>com.acme.QuickThinker</code> and
- * <code>com.acme.DeepThinker</code>. The code for <code>QuickThinker</code>
- * woud look as follows:
- *
- * <pre>
- * package com.acme;
- *
- * &#x2f;**
- * * Provices a super-quick, but not very deep implementation of ThinkService.
- * *&#x2f;
- * public class QuickThinker
- * implements org.foo.ThinkService
- * {
- * &#x2f;**
- * * Constructs a new QuickThinker. The service factory (which is
- * * part of the Java environment) calls this no-argument constructor
- * * when it looks up the available implementations of ThinkService.
- * *
- * * &lt;p&gt;Note that an application might query all available
- * * ThinkService providers, but use just one of them. Therefore,
- * * constructing an instance should be very inexpensive. For example,
- * * large data structures should only be allocated when the service
- * * actually gets used.
- * *&#x2f;
- * public QuickThinker()
- * {
- * }
- *
- * &#x2f;**
- * * Returns the speed of this ThinkService in thoughts per second.
- * * Applications can choose among the available service providers
- * * based on this value.
- * *&#x2f;
- * public double getSpeed()
- * {
- * return 314159.2654;
- * }
- *
- * &#x2f;**
- * * Produces a thought. While the returned thoughts are not very
- * * deep, they are generated in very short time.
- * *&#x2f;
- * public Thought think()
- * {
- * return null;
- * }
- * }
- * </pre>
- *
- * <p>The code for <code>com.acme.DeepThinker</code> is left as an
- * exercise to the reader.
- *
- * <p>Acme&#x2019;s <code>ThinkService</code> plug-in gets deployed as
- * a JAR file. Besides the bytecode and resources for
- * <code>QuickThinker</code> and <code>DeepThinker</code>, it also
- * contains the text file
- * <code>META-INF/services/org.foo.ThinkService</code>:
- *
- * <pre>
- * # Available implementations of org.foo.ThinkService
- * com.acme.QuickThinker
- * com.acme.DeepThinker
- * </pre>
- *
- * <p><b>Thread Safety</b>
- *
- * <p>It is safe to use <code>ServiceFactory</code> from multiple
- * concurrent threads without external synchronization.
- *
- * <p><b>Note for User Applications</b>
- *
- * <p>User applications that want to load plug-ins should not directly
- * use <code>gnu.classpath.ServiceFactory</code>, because this class
- * is only available in Java environments that are based on GNU
- * Classpath. Instead, it is recommended that user applications call
- * {@link
- * javax.imageio.spi.ServiceRegistry#lookupProviders(Class)}. This API
- * is actually independent of image I/O, and it is available on every
- * environment.
- *
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
- */
-public final class ServiceFactory
-{
- /**
- * A logger that gets informed when a service gets loaded, or
- * when there is a problem with loading a service.
- *
- * <p>Because {@link java.util.logging.Logger#getLogger(String)}
- * is thread-safe, we do not need to worry about synchronization
- * here.
- */
- private static final Logger LOGGER = Logger.getLogger("gnu.classpath");
-
-
- /**
- * Declared private in order to prevent constructing instances of
- * this utility class.
- */
- private ServiceFactory()
- {
- }
-
-
- /**
- * Finds service providers that are implementing the specified
- * Service Provider Interface.
- *
- * <p><b>On-demand loading:</b> Loading and initializing service
- * providers is delayed as much as possible. The rationale is that
- * typical clients will iterate through the set of installed service
- * providers until one is found that matches some criteria (like
- * supported formats, or quality of service). In such scenarios, it
- * might make sense to install only the frequently needed service
- * providers on the local machine. More exotic providers can be put
- * onto a server; the server will only be contacted when no suitable
- * service could be found locally.
- *
- * <p><b>Security considerations:</b> Any loaded service providers
- * are loaded through the specified ClassLoader, or the system
- * ClassLoader if <code>classLoader</code> is
- * <code>null</code>. When <code>lookupProviders</code> is called,
- * the current {@link AccessControlContext} gets recorded. This
- * captured security context will determine the permissions when
- * services get loaded via the <code>next()</code> method of the
- * returned <code>Iterator</code>.
- *
- * @param spi the service provider interface which must be
- * implemented by any loaded service providers.
- *
- * @param loader the class loader that will be used to load the
- * service providers, or <code>null</code> for the system class
- * loader. For using the context class loader, see {@link
- * #lookupProviders(Class)}.
- *
- * @return an iterator over instances of <code>spi</code>.
- *
- * @throws IllegalArgumentException if <code>spi</code> is
- * <code>null</code>.
- */
- public static Iterator lookupProviders(Class spi,
- ClassLoader loader)
- {
- String resourceName;
- Enumeration urls;
-
- if (spi == null)
- throw new IllegalArgumentException();
-
- if (loader == null)
- loader = ClassLoader.getSystemClassLoader();
-
- resourceName = "META-INF/services/" + spi.getName();
- try
- {
- urls = loader.getResources(resourceName);
- }
- catch (IOException ioex)
- {
- /* If an I/O error occurs here, we cannot provide any service
- * providers. In this case, we simply return an iterator that
- * does not return anything (no providers installed).
- */
- log(Level.WARNING, "cannot access {0}", resourceName, ioex);
- return Collections.EMPTY_LIST.iterator();
- }
-
- return new ServiceIterator(spi, urls, loader,
- AccessController.getContext());
- }
-
-
- /**
- * Finds service providers that are implementing the specified
- * Service Provider Interface, using the context class loader
- * for loading providers.
- *
- * @param spi the service provider interface which must be
- * implemented by any loaded service providers.
- *
- * @return an iterator over instances of <code>spi</code>.
- *
- * @throws IllegalArgumentException if <code>spi</code> is
- * <code>null</code>.
- *
- * @see #lookupProviders(Class, ClassLoader)
- */
- public static Iterator lookupProviders(Class spi)
- {
- ClassLoader ctxLoader;
-
- ctxLoader = Thread.currentThread().getContextClassLoader();
- return lookupProviders(spi, ctxLoader);
- }
-
-
- /**
- * An iterator over service providers that are listed in service
- * provider configuration files, which get passed as an Enumeration
- * of URLs. This is a helper class for {@link
- * ServiceFactory#lookupProviders}.
- *
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
- */
- private static final class ServiceIterator
- implements Iterator
- {
- /**
- * The service provider interface (usually an interface, sometimes
- * an abstract class) which the services must implement.
- */
- private final Class spi;
-
-
- /**
- * An Enumeration<URL> over the URLs that contain a resource
- * <code>META-INF/services/&lt;org.foo.SomeService&gt;</code>,
- * as returned by {@link ClassLoader#getResources(String)}.
- */
- private final Enumeration urls;
-
-
- /**
- * The class loader used for loading service providers.
- */
- private final ClassLoader loader;
-
-
- /**
- * The security context used when loading and initializing service
- * providers. We want to load and initialize all plug-in service
- * providers under the same security context, namely the one that
- * was active when {@link #lookupProviders} has been called.
- */
- private final AccessControlContext securityContext;
-
-
- /**
- * A reader for the current file listing class names of service
- * implementors, or <code>null</code> when the last reader has
- * been fetched.
- */
- private BufferedReader reader;
-
-
- /**
- * The URL currently being processed. This is only used for
- * emitting error messages.
- */
- private URL currentURL;
-
-
- /**
- * The service provider that will be returned by the next call to
- * {@link #next()}, or <code>null</code> if the iterator has
- * already returned all service providers.
- */
- private Object nextProvider;
-
-
- /**
- * Constructs an Iterator that loads and initializes services on
- * demand.
- *
- * @param spi the service provider interface which the services
- * must implement. Usually, this is a Java interface type, but it
- * might also be an abstract class or even a concrete superclass.
- *
- * @param urls an Enumeration<URL> over the URLs that contain a
- * resource
- * <code>META-INF/services/&lt;org.foo.SomeService&gt;</code>, as
- * determined by {@link ClassLoader#getResources(String)}.
- *
- * @param loader the ClassLoader that gets used for loading
- * service providers.
- *
- * @param securityContext the security context to use when loading
- * and initializing service providers.
- */
- ServiceIterator(Class spi, Enumeration urls, ClassLoader loader,
- AccessControlContext securityContext)
- {
- this.spi = spi;
- this.urls = urls;
- this.loader = loader;
- this.securityContext = securityContext;
- this.nextProvider = loadNextServiceProvider();
- }
-
-
- /**
- * @throws NoSuchElementException if {@link #hasNext} returns
- * <code>false</code>.
- */
- public Object next()
- {
- Object result;
-
- if (!hasNext())
- throw new NoSuchElementException();
-
- result = nextProvider;
- nextProvider = loadNextServiceProvider();
- return result;
- }
-
-
- public boolean hasNext()
- {
- return nextProvider != null;
- }
-
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
-
-
- private Object loadNextServiceProvider()
- {
- String line;
-
- if (reader == null)
- advanceReader();
-
- for (;;)
- {
- /* If we have reached the last provider list, we cannot
- * retrieve any further lines.
- */
- if (reader == null)
- return null;
-
- try
- {
- line = reader.readLine();
- }
- catch (IOException readProblem)
- {
- log(Level.WARNING, "IOException upon reading {0}", currentURL,
- readProblem);
- line = null;
- }
-
- /* When we are at the end of one list of services,
- * switch over to the next one.
- */
- if (line == null)
- {
- advanceReader();
- continue;
- }
-
-
- // Skip whitespace at the beginning and end of each line.
- line = line.trim();
-
- // Skip empty lines.
- if (line.length() == 0)
- continue;
-
- // Skip comment lines.
- if (line.charAt(0) == '#')
- continue;
-
- try
- {
- log(Level.FINE,
- "Loading service provider \"{0}\", specified"
- + " by \"META-INF/services/{1}\" in {2}.",
- new Object[] { line, spi.getName(), currentURL },
- null);
-
- /* Load the class in the security context that was
- * active when calling lookupProviders.
- */
- return AccessController.doPrivileged(
- new ServiceProviderLoadingAction(spi, line, loader),
- securityContext);
- }
- catch (Exception ex)
- {
- String msg = "Cannot load service provider class \"{0}\","
- + " specified by \"META-INF/services/{1}\" in {2}";
- if (ex instanceof PrivilegedActionException
- && ex.getCause() instanceof ClassCastException)
- msg = "Service provider class \"{0}\" is not an instance"
- + " of \"{1}\". Specified"
- + " by \"META-INF/services/{1}\" in {2}.";
-
- log(Level.WARNING, msg,
- new Object[] { line, spi.getName(), currentURL },
- ex);
- continue;
- }
- }
- }
-
-
- private void advanceReader()
- {
- do
- {
- if (reader != null)
- {
- try
- {
- reader.close();
- log(Level.FINE, "closed {0}", currentURL, null);
- }
- catch (Exception ex)
- {
- log(Level.WARNING, "cannot close {0}", currentURL, ex);
- }
- reader = null;
- currentURL = null;
- }
-
- if (!urls.hasMoreElements())
- return;
-
- currentURL = (URL) urls.nextElement();
- try
- {
- reader = new BufferedReader(new InputStreamReader(
- currentURL.openStream(), "UTF-8"));
- log(Level.FINE, "opened {0}", currentURL, null);
- }
- catch (Exception ex)
- {
- log(Level.WARNING, "cannot open {0}", currentURL, ex);
- }
- }
- while (reader == null);
- }
- }
-
-
- // Package-private to avoid a trampoline.
- /**
- * Passes a log message to the <code>java.util.logging</code>
- * framework. This call returns very quickly if no log message will
- * be produced, so there is not much overhead in the standard case.
- *
- * @param the severity of the message, for instance {@link
- * Level#WARNING}.
- *
- * @param msg the log message, for instance <code>&#x201c;Could not
- * load {0}.&#x201d;</code>
- *
- * @param param the parameter(s) for the log message, or
- * <code>null</code> if <code>msg</code> does not specify any
- * parameters. If <code>param</code> is not an array, an array with
- * <code>param</code> as its single element gets passed to the
- * logging framework.
- *
- * @param t a Throwable that is associated with the log record, or
- * <code>null</code> if the log message is not associated with a
- * Throwable.
- */
- static void log(Level level, String msg, Object param, Throwable t)
- {
- LogRecord rec;
-
- // Return quickly if no log message will be produced.
- if (!LOGGER.isLoggable(level))
- return;
-
- rec = new LogRecord(level, msg);
- if (param != null && param.getClass().isArray())
- rec.setParameters((Object[]) param);
- else
- rec.setParameters(new Object[] { param });
-
- rec.setThrown(t);
-
- // While java.util.logging can sometimes infer the class and
- // method of the caller, this automatic inference is not reliable
- // on highly optimizing VMs. Also, log messages make more sense to
- // developers when they display a public method in a public class;
- // otherwise, they might feel tempted to figure out the internals
- // of ServiceFactory in order to understand the problem.
- rec.setSourceClassName(ServiceFactory.class.getName());
- rec.setSourceMethodName("lookupProviders");
-
- LOGGER.log(rec);
- }
-}
diff --git a/libjava/gnu/classpath/ServiceProviderLoadingAction.java b/libjava/gnu/classpath/ServiceProviderLoadingAction.java
deleted file mode 100644
index b5e59cb4b6f..00000000000
--- a/libjava/gnu/classpath/ServiceProviderLoadingAction.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* ServiceProviderLoadingAction.java -- Action for loading plug-in services.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.classpath;
-
-import java.security.PrivilegedExceptionAction;
-
-/**
- * A privileged action for creating a new instance of a service
- * provider.
- *
- * <p>Class loading and instantiation is encapsulated in a
- * <code>PriviledgedAction</code> in order to restrict the loaded
- * service providers to the {@link java.security.AccessControlContext}
- * that was active when {@link
- * gnu.classpath.ServiceFactory#lookupProviders} was called, even
- * though the actual loading is delayed to the time when the provider
- * is actually needed.
- *
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
- */
-final class ServiceProviderLoadingAction
- implements PrivilegedExceptionAction
-{
- /**
- * The interface to which the loaded service provider implementation
- * must conform. Usually, this is a Java interface type, but it
- * might also be an abstract class or even a concrete class.
- */
- private final Class spi;
-
-
- /**
- * The fully qualified name of the class that gets loaded when
- * this action is executed.
- */
- private final String providerName;
-
-
- /**
- * The ClassLoader that gets used for loading the service provider
- * class.
- */
- private final ClassLoader loader;
-
-
- /**
- * Constructs a privileged action for loading a service provider.
- *
- * @param spi the interface to which the loaded service provider
- * implementation must conform. Usually, this is a Java interface
- * type, but it might also be an abstract class or even a concrete
- * superclass.
- *
- * @param providerName the fully qualified name of the class that
- * gets loaded when this action is executed.
- *
- * @param loader the ClassLoader that gets used for loading the
- * service provider class.
- *
- * @throws IllegalArgumentException if <code>spi</code>,
- * <code>providerName</code> or <code>loader</code> is
- * <code>null</code>.
- */
- ServiceProviderLoadingAction(Class spi, String providerName,
- ClassLoader loader)
- {
- if (spi == null || providerName == null || loader == null)
- throw new IllegalArgumentException();
-
- this.spi = spi;
- this.providerName = providerName;
- this.loader = loader;
- }
-
-
- /**
- * Loads an implementation class for a service provider, and creates
- * a new instance of the loaded class by invoking its public
- * no-argument constructor.
- *
- * @return a new instance of the class whose name was passed as
- * <code>providerName</code> to the constructor.
- *
- * @throws ClassCastException if the service provider does not
- * implement the <code>spi</code> interface that was passed to the
- * constructor.
- *
- * @throws IllegalAccessException if the service provider class or
- * its no-argument constructor are not <code>public</code>.
- *
- * @throws InstantiationException if the service provider class is
- * <code>abstract</code>, an interface, a primitive type, an array
- * class, or void; or if service provider class does not have a
- * no-argument constructor; or if there some other problem with
- * creating a new instance of the service provider.
- */
- public Object run()
- throws Exception
- {
- Class loadedClass;
- Object serviceProvider;
-
- loadedClass = loader.loadClass(providerName);
- serviceProvider = loadedClass.newInstance();
-
- // Ensure that the loaded provider is actually implementing
- // the service provider interface.
- if (!spi.isInstance(serviceProvider))
- throw new ClassCastException(spi.getName());
-
- return serviceProvider;
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/InvalidClassException.java b/libjava/gnu/classpath/jdwp/exception/InvalidClassException.java
deleted file mode 100644
index 2e9b7246818..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/InvalidClassException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* InvalidClassException.java -- invalid/unknown class reference id exception
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * An exception thrown by the JDWP back-end when an invalid reference
- * type id is used by the debugger.
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class InvalidClassException
- extends JdwpException
-{
- public InvalidClassException (long id)
- {
- super (JdwpConstants.Error.INVALID_CLASS,
- "invalid class id (" + id + ")");
- }
-
- public InvalidClassException (Throwable t)
- {
- super (JdwpConstants.Error.INVALID_CLASS, t);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/InvalidCountException.java b/libjava/gnu/classpath/jdwp/exception/InvalidCountException.java
deleted file mode 100644
index 668db042d6b..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/InvalidCountException.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* InvalidCountException -- an invalid count exception
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * An exception thrown when a count filter is given an invalid count.
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class InvalidCountException
- extends JdwpException
-{
- public InvalidCountException (int id)
- {
- super (JdwpConstants.Error.INVALID_COUNT, "invalid count (" + id + ")");
- }
-
- public InvalidCountException (Throwable t)
- {
- super (JdwpConstants.Error.INVALID_COUNT, t);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/InvalidEventTypeException.java b/libjava/gnu/classpath/jdwp/exception/InvalidEventTypeException.java
deleted file mode 100644
index 6463325804c..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/InvalidEventTypeException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* InvalidEventTypeException.java -- an invalid event kind exception
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * An exception thrown when the debugger asks for an event request
- * for a non-existant event
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class InvalidEventTypeException
- extends JdwpException
-{
- public InvalidEventTypeException (byte kind)
- {
- super (JdwpConstants.Error.INVALID_EVENT_TYPE,
- "invalid event type (" + kind + ")");
- }
-
- public InvalidEventTypeException (Throwable t)
- {
- super (JdwpConstants.Error.INVALID_EVENT_TYPE, t);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/InvalidObjectException.java b/libjava/gnu/classpath/jdwp/exception/InvalidObjectException.java
deleted file mode 100644
index 587f4609e8f..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/InvalidObjectException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* InvalidObjectException.java -- an invalid object id exception
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * An exception thrown when an invalid object id is used by
- * the debugger
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class InvalidObjectException
- extends JdwpException
-{
- public InvalidObjectException (long id)
- {
- super (JdwpConstants.Error.INVALID_OBJECT,
- "invalid object id (" + id + ")");
- }
-
- public InvalidObjectException (Throwable t)
- {
- super (JdwpConstants.Error.INVALID_OBJECT, t);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/InvalidStringException.java b/libjava/gnu/classpath/jdwp/exception/InvalidStringException.java
deleted file mode 100644
index c689d5f1678..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/InvalidStringException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* InvalidStringException.java -- an invalid string id exception
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * An exception thrown when the debugger uses an invalid String
- * id
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class InvalidStringException
- extends JdwpException
-{
- public InvalidStringException (String str)
- {
- super (JdwpConstants.Error.INVALID_STRING,
- "invalid string (" + str + ")");
- }
-
- public InvalidStringException (Throwable t)
- {
- super (JdwpConstants.Error.INVALID_STRING, t);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/InvalidThreadException.java b/libjava/gnu/classpath/jdwp/exception/InvalidThreadException.java
deleted file mode 100644
index bcbaf4902ed..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/InvalidThreadException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* InvalidThreadException.java -- an invalid thread id exception
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * An exception thrown when an invalid thread id is used
- * by the debugger
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class InvalidThreadException
- extends JdwpException
-{
- public InvalidThreadException (long id)
- {
- super (JdwpConstants.Error.INVALID_THREAD,
- "invalid thread id (" + id + ")");
- }
-
- public InvalidThreadException (Throwable t)
- {
- super (JdwpConstants.Error.INVALID_THREAD, t);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/InvalidThreadGroupException.java b/libjava/gnu/classpath/jdwp/exception/InvalidThreadGroupException.java
deleted file mode 100644
index 92b214f4696..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/InvalidThreadGroupException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* InvalidThreadGroupException.java -- an invalid thread group id exception
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * An exception thrown when an invalid thread group id is used
- * by the debugger
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class InvalidThreadGroupException
- extends JdwpException
-{
- public InvalidThreadGroupException (long id)
- {
- super (JdwpConstants.Error.INVALID_THREAD_GROUP,
- "invalid thread id (" + id + ")");
- }
-
- public InvalidThreadException (Throwable t)
- {
- super (JdwpConstants.Error.INVALID_THREAD_GROUP, t);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/JdwpException.java b/libjava/gnu/classpath/jdwp/exception/JdwpException.java
deleted file mode 100644
index 6d4887cdad2..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/JdwpException.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* JdwpException.java -- an exception base class for all JDWP exceptions
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-/**
- * A base class exception for all JDWP back-end exceptions
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class JdwpException
- extends Exception
-{
- // The integer error code defined by JDWP
- private short _errorCode;
-
- /**
- * Constructs a new <code>JdwpException</code> with the
- * given error code and given cause
- *
- * @param code the JDWP error code
- * @param t the cause of the exception
- */
- public JdwpException (short code, Throwable t)
- {
- super (t);
- _errorCode = code;
- }
-
- /**
- * Constructs a new <code>JdwpException</code> with the
- * given error code and string error message
- *
- * @param code the JDWP error code
- * @param str an error message
- */
- public JdwpException (short code, String str)
- {
- super (str);
- _errorCode = code;
- }
-
- /**
- * Returns the JDWP error code represented by this exception
- */
- public short getErrorCode ()
- {
- return _errorCode;
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/JdwpInternalErrorException.java b/libjava/gnu/classpath/jdwp/exception/JdwpInternalErrorException.java
deleted file mode 100644
index d76ad8ca837..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/JdwpInternalErrorException.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* JdwpInternalErrorException.java -- an internal error exception
- features or functions
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * An exception thrown by the JDWP back-end when an unusual runtime
- * error occurs internally
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class JdwpInternalErrorException
- extends JdwpException
-{
- public JdwpInternalErrorException (Throwable cause)
- {
- super (JdwpConstants.Error.INTERNAL, cause);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/NotImplementedException.java b/libjava/gnu/classpath/jdwp/exception/NotImplementedException.java
deleted file mode 100644
index 8f5feabe9b8..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/NotImplementedException.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* NotImplementedException.java -- an exception for unimplemented JDWP
- features or functions
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * An exception thrown by virtual machines when functionality
- * or features are not implemented
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class NotImplementedException
- extends JdwpException
-{
- public NotImplementedException (String feature)
- {
- super (JdwpConstants.Error.NOT_IMPLEMENTED,
- feature + " is not yet implemented");
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/exception/VmDeadException.java b/libjava/gnu/classpath/jdwp/exception/VmDeadException.java
deleted file mode 100644
index 6164018db64..00000000000
--- a/libjava/gnu/classpath/jdwp/exception/VmDeadException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Jdwp.java -- Virtual machine to JDWP back-end programming interface
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.exception;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * An exception thrown when the virtual machine is dead
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class VmDeadException
- extends JdwpException
-{
- public VmDeadException ()
- {
- super (JdwpConstants.Error.VM_DEAD, "Virtual machine is dead");
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/ArrayId.java b/libjava/gnu/classpath/jdwp/id/ArrayId.java
deleted file mode 100644
index cd428a172b3..00000000000
--- a/libjava/gnu/classpath/jdwp/id/ArrayId.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ArrayId.java -- array object IDs
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * A class which represents a JDWP array id
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class ArrayId
- extends ObjectId
-{
- // Arrays are handled a little differently than other IDs
- //public static final Class typeClass = UNDEFINED
-
- /**
- * Constructs a new <code>ArrayId</code>
- */
- public ArrayId ()
- {
- super (JdwpConstants.Tag.ARRAY);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/ArrayReferenceTypeId.java b/libjava/gnu/classpath/jdwp/id/ArrayReferenceTypeId.java
deleted file mode 100644
index 14a73dc5b24..00000000000
--- a/libjava/gnu/classpath/jdwp/id/ArrayReferenceTypeId.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ArrayReferenceTypeId.java -- array reference type ids
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * A reference type ID representing java arrays
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class ArrayReferenceTypeId
- extends ReferenceTypeId
-{
- /**
- * Constructs a new <code>ArrayReferenceTypeId</code>
- */
- public ArrayReferenceTypeId ()
- {
- super (JdwpConstants.TypeTag.ARRAY);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/ClassLoaderId.java b/libjava/gnu/classpath/jdwp/id/ClassLoaderId.java
deleted file mode 100644
index 133872566fd..00000000000
--- a/libjava/gnu/classpath/jdwp/id/ClassLoaderId.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ClassLoaderId.java -- class loader IDs
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * A class which represents a JDWP thread id
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class ClassLoaderId
- extends ObjectId
-{
- /**
- * The object class that this id represents
- */
- public static final Class typeClass = ClassLoader.class;
-
- /**
- * Constructs a new <code>ClassLoaderId</code>
- */
- public ClassLoaderId ()
- {
- super (JdwpConstants.Tag.CLASS_LOADER);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/ClassObjectId.java b/libjava/gnu/classpath/jdwp/id/ClassObjectId.java
deleted file mode 100644
index e5559ce10f3..00000000000
--- a/libjava/gnu/classpath/jdwp/id/ClassObjectId.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ClassObjectId.java -- class object IDs
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * A class which represents a JDWP class object id
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class ClassObjectId
- extends ObjectId
-{
- /**
- * The object class that this id represents
- */
- public static final Class typeClass = Class.class;
-
- /**
- * Constructs a new <code>ClassObjectId</code>
- */
- public ClassObjectId ()
- {
- super (JdwpConstants.Tag.CLASS_OBJECT);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/ClassReferenceTypeId.java b/libjava/gnu/classpath/jdwp/id/ClassReferenceTypeId.java
deleted file mode 100644
index 6b57673f827..00000000000
--- a/libjava/gnu/classpath/jdwp/id/ClassReferenceTypeId.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ClassReferenceTypeId.java -- class reference type ids
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * A reference type ID representing java classes
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class ClassReferenceTypeId
- extends ReferenceTypeId
-{
- /**
- * Constructs a new <code>ClassReferenceTypeId</code>
- */
- public ClassReferenceTypeId ()
- {
- super (JdwpConstants.TypeTag.CLASS);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/InterfaceReferenceTypeId.java b/libjava/gnu/classpath/jdwp/id/InterfaceReferenceTypeId.java
deleted file mode 100644
index bdbd6b6ebff..00000000000
--- a/libjava/gnu/classpath/jdwp/id/InterfaceReferenceTypeId.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* InterfaceReferenceTypeId.java -- interface reference type ids
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * A reference type ID representing java interfaces
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class InterfaceReferenceTypeId
- extends ReferenceTypeId
-{
- /**
- * Constructs a new <code>InterfaceReferenceTypeId</code>
- */
- public InterfaceReferenceTypeId ()
- {
- super (JdwpConstants.TypeTag.INTERFACE);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/JdwpId.java b/libjava/gnu/classpath/jdwp/id/JdwpId.java
deleted file mode 100644
index 37f82e208c5..00000000000
--- a/libjava/gnu/classpath/jdwp/id/JdwpId.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/* JdwpId.java -- base class for all object ID types
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-/**
- * A baseclass for all object types reported to the debugger
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public abstract class JdwpId
-{
- /**
- * ID assigned to this object
- */
- protected long _id;
-
- /**
- * Tag of ID's type (see {@link gnu.classpath.jdwp.JdwpConstants.Tag})
- * for object-like IDs or the type tag (see {@link
- * gnu.classpath.JdwpConstants.TypeTag}) for reference type IDs.
- */
- private byte _tag;
-
- /**
- * Constructs an empty <code>JdwpId</code>
- */
- public JdwpId (byte tag)
- {
- _tag = tag;
- }
-
- /**
- * Sets the id for this object reference
- */
- void setId (long id)
- {
- _id = id;
- }
-
- /**
- * Returns the id for this object reference
- */
- public long getId ()
- {
- return _id;
- }
-
- /**
- * Compares two object ids for equality. Two object ids
- * are equal if they point to the same type and contain to
- * the same id number. (NOTE: This is a much stricter check
- * than is necessary: all <code>JdwpId</code>s have unique
- * ids.)
- */
- public boolean equals (JdwpId id)
- {
- return ((id.getClass () == getClass ()) && (id.getId () == getId ()));
- }
-
- /**
- * Returns size of this type (used by IDSizes)
- */
- public abstract int size ();
-
- /**
- * Writes the contents of this type to the <code>DataOutputStream</code>
- * @param outStream the <code>DataOutputStream</code> to use
- * @throws IOException when an error occurs on the <code>OutputStream</code>
- */
- public abstract void write (DataOutputStream outStream)
- throws IOException;
-
- /**
- * Writes the contents of this type to the output stream, preceded
- * by a one-byte tag for tagged object IDs or type tag for
- * reference type IDs.
- *
- * @param outStream the <code>DataOutputStream</code> to use
- * @throws IOException when an error occurs on the <code>OutputStream</code>
- */
- public void writeTagged (DataOutputStream outStream)
- throws IOException
- {
- outStream.writeByte (_tag);
- write (outStream);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/JdwpIdFactory.java b/libjava/gnu/classpath/jdwp/id/JdwpIdFactory.java
deleted file mode 100644
index 06ec3c7681f..00000000000
--- a/libjava/gnu/classpath/jdwp/id/JdwpIdFactory.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/* JdwpIdFactory.java -- factory for generating type and object IDs
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import java.util.HashMap;
-
-/**
- * This factory generates ids for objects and types that may
- * be sent to a debugger.
- *
- * @author Keith Seitz (keiths@redhat.com)
- */
-public class JdwpIdFactory
-{
- // ID of last object / referencetype
- private static Object _idLock = new Object ();
- private static Object _ridLock = new Object ();
- private static long _lastId = 0;
- private static long _lastRid = 0;
-
- // A list of all ID types
- private static HashMap _idList = new HashMap ();
-
- // Initialize the id list with known types
- static
- {
- // ObjectId and ArrayId are special cases. See newId.
- _idList.put (ClassLoaderId.typeClass, ClassLoaderId.class);
- _idList.put (ClassObjectId.typeClass, ClassObjectId.class);
- //_idList.put (FieldId.typeClass, FieldId.class);
- //_idList.put (FrameId.typeClass, FrameId.class);
- //_idList.put (MethodId.typeClass, MethodId.class);
- _idList.put (StringId.typeClass, StringId.class);
- _idList.put (ThreadId.typeClass, ThreadId.class);
- _idList.put (ThreadGroupId.typeClass, ThreadGroupId.class);
- }
-
- /**
- * Returns a new id for the given object
- *
- * @param object the object for which an id is desired
- * @returns a suitable object id
- */
- public static JdwpId newId (Object object)
- {
- JdwpId id = null;
-
- // Special case: arrays
- if (object.getClass ().isArray ())
- id = new ArrayId ();
- else
- {
- // Loop through all classes until we hit baseclass
- Class myClass;
- for (myClass = object.getClass (); myClass != null;
- myClass = myClass.getSuperclass ())
- {
- Class clz = (Class) _idList.get (myClass);
- if (clz != null)
- {
- try
- {
- id = (JdwpId) clz.newInstance ();
- synchronized (_idLock)
- {
- id.setId (++_lastId);
- }
- return id;
- }
- catch (InstantiationException ie)
- {
- // This really should not happen
- throw new RuntimeException ("cannot create new ID", ie);
- }
- catch (IllegalAccessException iae)
- {
- // This really should not happen
- throw new RuntimeException ("illegal access of ID", iae);
- }
- }
- }
-
- /* getSuperclass returned null and no matching ID type found.
- So it must derive from Object. */
- id = new ObjectId ();
- }
-
- synchronized (_idLock)
- {
- id.setId (++_lastId);
- }
-
- return id;
- }
-
- /**
- * Returns a new reference type id for the given class
- *
- * @param clazz the <code>Class</code> for which an id is desired
- * @returns a suitable reference type id or <code>null</code>
- */
- public static ReferenceTypeId newReferenceTypeId (Class clazz)
- {
- ReferenceTypeId id = null;
- try
- {
- if (clazz.isArray ())
- id = new ArrayReferenceTypeId ();
- else if (clazz.isInterface ())
- id = new InterfaceReferenceTypeId ();
- else
- id = new ClassReferenceTypeId ();
- synchronized (_ridLock)
- {
- id.setId (++_lastRid);
- }
- return id;
- }
- catch (InstantiationException ie)
- {
- return null;
- }
- catch (IllegalAccessException iae)
- {
- return null;
- }
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/ObjectId.java b/libjava/gnu/classpath/jdwp/id/ObjectId.java
deleted file mode 100644
index e34a3b59ebf..00000000000
--- a/libjava/gnu/classpath/jdwp/id/ObjectId.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* ObjectId.java -- object IDs
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-/**
- * A class which represents a JDWP object id for an object
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class ObjectId
- extends JdwpId
-{
- /**
- * The object class that this id represents
- */
- public static final Class typeClass = Object.class;
-
- /**
- * Constructs a new <code>ObjectId</code>
- */
- public ObjectId ()
- {
- super (JdwpConstants.Tag.OBJECT);
- }
-
- /**
- * Constructs a new <code>ObjectId</code> of the
- * given type.
- *
- * @param tag the tag of this type of object ID
- */
- public ObjectId (byte tag)
- {
- super (tag);
- }
-
- /**
- * Returns the size of this id type
- */
- public int size ()
- {
- return 8;
- }
-
- /**
- * Writes the id to the stream
- *
- * @param outStream the stream to which to write
- * @throws IOException when an error occurs on the <code>OutputStream</code>
- */
- public void write (DataOutputStream outStream)
- throws IOException
- {
- // All we need to do is write out our id as an 8-byte integer
- outStream.writeLong (_id);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/ReferenceTypeId.java b/libjava/gnu/classpath/jdwp/id/ReferenceTypeId.java
deleted file mode 100644
index cdb78040a41..00000000000
--- a/libjava/gnu/classpath/jdwp/id/ReferenceTypeId.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* ReferenceTypeId.java -- a base class for all reference type IDs
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-/**
- * Base class for reference type IDs. This class usurps
- * <code>JdwpId</code>'s tag member for its own use (type tag).
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class ReferenceTypeId
- extends JdwpId
-{
- /**
- * Constructor used by {Array,Interface,Class}ReferenceTypeId
- */
- public ReferenceTypeId (byte tag)
- {
- super (tag);
- }
-
- /**
- * Returns the size of this ID type
- */
- public int size ()
- {
- return 8;
- }
-
- /**
- * Outputs the reference type ID to the given output stream
- *
- * @param outStream the stream to which to write the data
- * @throws IOException for errors writing to the stream
- */
- public void write (DataOutputStream outStream)
- throws IOException
- {
- outStream.writeLong (_id);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/StringId.java b/libjava/gnu/classpath/jdwp/id/StringId.java
deleted file mode 100644
index ea1a83a56a2..00000000000
--- a/libjava/gnu/classpath/jdwp/id/StringId.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* StringId.java -- string IDs
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * A class which represents a JDWP string id
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class StringId
- extends ObjectId
-{
- /**
- * The object class that this id represents
- */
- public static final Class typeClass = String.class;
-
- /**
- * Constructs a new <code>StringId</code>
- */
- public StringId ()
- {
- super (JdwpConstants.Tag.STRING);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/ThreadGroupId.java b/libjava/gnu/classpath/jdwp/id/ThreadGroupId.java
deleted file mode 100644
index aef7d5b5421..00000000000
--- a/libjava/gnu/classpath/jdwp/id/ThreadGroupId.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ThreadGroupId.java -- thread group IDs
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * A class which represents a JDWP thread group id
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class ThreadGroupId
- extends ObjectId
-{
- /**
- * The object class that this id represents
- */
- public static final Class typeClass = ThreadGroup.class;
-
- /**
- * Constructs a new <code>ThreadGroupId</code>
- */
- public ThreadGroupId ()
- {
- super (JdwpConstants.Tag.THREAD_GROUP);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/id/ThreadId.java b/libjava/gnu/classpath/jdwp/id/ThreadId.java
deleted file mode 100644
index 733bf55102b..00000000000
--- a/libjava/gnu/classpath/jdwp/id/ThreadId.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ThreadId.java -- thread IDs
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.id;
-
-import gnu.classpath.jdwp.JdwpConstants;
-
-/**
- * A class which represents a JDWP thread id
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class ThreadId
- extends ObjectId
-{
- /**
- * The object class that this id represents
- */
- public static final Class typeClass = Thread.class;
-
- /**
- * Constructs a new <code>ThreadId</code>
- */
- public ThreadId ()
- {
- super (JdwpConstants.Tag.THREAD);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/processor/CommandSet.java b/libjava/gnu/classpath/jdwp/processor/CommandSet.java
deleted file mode 100644
index 17b956ceadc..00000000000
--- a/libjava/gnu/classpath/jdwp/processor/CommandSet.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* CommandSet.java -- An interface defining JDWP Command Sets
- Copyright (C) 2005 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
-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.classpath.jdwp.processor;
-
-import gnu.classpath.jdwp.exception.JdwpException;
-
-import java.io.DataOutputStream;
-import java.nio.ByteBuffer;
-
-/**
- * A class representing a JDWP Command Set. This class serves as a generic
- * interface for all Command Sets types used by JDWP.
- *
- * @author Aaron Luchko <aluchko@redhat.com>
- */
-public interface CommandSet
-{
- /**
- * Runs the given command with the data in distr and writes the data for the
- * reply packet to ostr.
- *
- * @param bb holds the data portion of the Command Packet
- * @param os data portion of the Reply Packet will be written here
- * @param command the command field of the Command Packet
- * @return true if the JDWP layer should shut down in response to this packet
- * @throws JdwpException command wasn't carried out successfully
- */
- public boolean runCommand(ByteBuffer bb, DataOutputStream os,
- byte command)
- throws JdwpException;
-}
diff --git a/libjava/gnu/classpath/jdwp/processor/FieldCommandSet.java b/libjava/gnu/classpath/jdwp/processor/FieldCommandSet.java
deleted file mode 100644
index f14635b9188..00000000000
--- a/libjava/gnu/classpath/jdwp/processor/FieldCommandSet.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* FieldCommandSet.java -- class to implement the Field Command Set
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.classpath.jdwp.processor;
-
-import gnu.classpath.jdwp.exception.JdwpException;
-import gnu.classpath.jdwp.exception.NotImplementedException;
-
-import java.io.DataOutputStream;
-import java.nio.ByteBuffer;
-
-/**
- * A class representing the Field Command Set.
- *
- * @author Aaron Luchko <aluchko@redhat.com>
- */
-public class FieldCommandSet implements CommandSet
-{
- /**
- * There are no commands for this CommandSet at this time so we just throw a
- * NotImplementedException whenever it's called.
- *
- * @throws JdwpException An exception will always be thrown
- */
- public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)
- throws JdwpException
- {
- throw new NotImplementedException(
- "No commands for command set Field implemented.");
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/processor/InterfaceTypeCommandSet.java b/libjava/gnu/classpath/jdwp/processor/InterfaceTypeCommandSet.java
deleted file mode 100644
index a32da38b324..00000000000
--- a/libjava/gnu/classpath/jdwp/processor/InterfaceTypeCommandSet.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* InterfaceTypeCommandSet.java -- class to implement the InterfaceType
- Command Set
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.classpath.jdwp.processor;
-
-import gnu.classpath.jdwp.exception.JdwpException;
-import gnu.classpath.jdwp.exception.NotImplementedException;
-
-import java.io.DataOutputStream;
-import java.nio.ByteBuffer;
-
-/**
- * A class representing the InterfaceType Command Set.
- *
- * @author Aaron Luchko <aluchko@redhat.com>
- */
-public class InterfaceTypeCommandSet implements CommandSet
-{
- /**
- * There are no commands for this CommandSet at this time so we just throw a
- * NotImplementedException whenever it's called.
- *
- * @throws JdwpException An exception will always be thrown
- */
- public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)
- throws JdwpException
- {
- throw new NotImplementedException(
- "No commands for command set InterfaceType implemented.");
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java b/libjava/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java
deleted file mode 100644
index 38bb0cdbf96..00000000000
--- a/libjava/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/* ObjectReferenceCommandSet.java -- lass to implement the ObjectReference
- Command Set
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.classpath.jdwp.processor;
-
-import gnu.classpath.jdwp.IVirtualMachine;
-import gnu.classpath.jdwp.Jdwp;
-import gnu.classpath.jdwp.JdwpConstants;
-import gnu.classpath.jdwp.exception.InvalidFieldException;
-import gnu.classpath.jdwp.exception.JdwpException;
-import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
-import gnu.classpath.jdwp.exception.NotImplementedException;
-import gnu.classpath.jdwp.id.IdManager;
-import gnu.classpath.jdwp.id.ObjectId;
-import gnu.classpath.jdwp.id.ReferenceTypeId;
-import gnu.classpath.jdwp.util.Value;
-import gnu.classpath.jdwp.util.MethodInvoker;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.nio.ByteBuffer;
-
-/**
- * A class representing the ObjectReference Command Set.
- *
- * @author Aaron Luchko <aluchko@redhat.com>
- */
-public class ObjectReferenceCommandSet implements CommandSet
-{
- // Our hook into the jvm
- private final IVirtualMachine vm = Jdwp.getIVirtualMachine();
-
- // Manages all the different ids that are assigned by jdwp
- private final IdManager idMan = Jdwp.getIdManager();
-
- public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)
- throws JdwpException
- {
- try
- {
- switch (command)
- {
- case JdwpConstants.CommandSet.ObjectReference.REFERENCE_TYPE:
- executeReferenceType(bb, os);
- break;
- case JdwpConstants.CommandSet.ObjectReference.GET_VALUES:
- executeGetValues(bb, os);
- break;
- case JdwpConstants.CommandSet.ObjectReference.SET_VALUES:
- executeSetValues(bb, os);
- break;
- case JdwpConstants.CommandSet.ObjectReference.MONITOR_INFO:
- executeMonitorInfo(bb, os);
- break;
- case JdwpConstants.CommandSet.ObjectReference.INVOKE_METHOD:
- executeInvokeMethod(bb, os);
- break;
- case JdwpConstants.CommandSet.ObjectReference.DISABLE_COLLECTION:
- executeDisableCollection(bb, os);
- break;
- case JdwpConstants.CommandSet.ObjectReference.ENABLE_COLLECTION:
- executeEnableCollection(bb, os);
- break;
- case JdwpConstants.CommandSet.ObjectReference.IS_COLLECTED:
- executeIsCollected(bb, os);
- break;
- default:
- throw new NotImplementedException("Command " + command +
- " not found in String Reference Command Set.");
- }
- }
- catch (IOException ex)
- {
- // The DataOutputStream we're using isn't talking to a socket at all
- // So if we throw an IOException we're in serious trouble
- throw new JdwpInternalErrorException(ex);
- }
- return true;
- }
-
- private void executeReferenceType(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ObjectId oid = idMan.readId(bb);
- Object obj = oid.getObject();
- Class clazz = obj.getClass();
- ReferenceTypeId refId = idMan.getReferenceTypeId(clazz);
- refId.writeTagged(os);
- }
-
- private void executeGetValues(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ObjectId oid = idMan.readId(bb);
- Object obj = oid.getObject();
-
- int numFields = bb.getInt();
-
- os.writeInt(numFields); // Looks pointless but this is the protocol
-
- for (int i = 0; i < numFields; i++)
- {
- Field field = (Field) idMan.readId(bb).getObject();
- Value.writeValueFromField(os, field, obj);
- }
- }
-
- private void executeSetValues(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ObjectId oid = idMan.readId(bb);
- Object obj = oid.getObject();
-
- int numFields = bb.getInt();
-
- for (int i = 0; i < numFields; i++)
- {
- Field field = (Field) idMan.readId(bb).getObject();
- Object value = Value.getObj(bb, field);
- try
- {
- field.set(obj, value);
- }
- catch (IllegalArgumentException ex)
- {
- // I suppose this would best qualify as an invalid field then
- throw new InvalidFieldException(ex);
- }
- catch (IllegalAccessException ex)
- {
- // We should be able to access any field
- throw new JdwpInternalErrorException(ex);
- }
- }
- }
-
- private void executeMonitorInfo(ByteBuffer bb, DataOutputStream os)
- throws JdwpException
- {
- // This command is optional, determined by VirtualMachines CapabilitiesNew
- // so we'll leave it till later to implement
- throw new NotImplementedException(
- "Command ExecuteMonitorInfo not implemented.");
-
- }
-
- private void executeInvokeMethod(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ObjectId oid = idMan.readId(bb);
- Object obj = oid.getObject();
-
- ObjectId tid = idMan.readId(bb);
- Thread thread = (Thread) tid.getObject();
-
- ReferenceTypeId rid = idMan.readReferenceTypeId(bb);
- Class clazz = rid.getType();
-
- ObjectId mid = idMan.readId(bb);
- Method method = (Method) mid.getObject();
-
- int args = bb.getInt();
- Object[] values = new Object[args];
-
- for (int i = 0; i < args; i++)
- {
- values[i] = Value.getObj(bb);
- }
-
- int invokeOptions = bb.getInt();
-
- if ((invokeOptions & JdwpConstants.InvokeOptions.INVOKE_SINGLE_THREADED) != 0)
- { // We must suspend all other running threads first
- vm.suspendAllThreads();
- }
- boolean nonVirtual;
- if ((invokeOptions & JdwpConstants.InvokeOptions.INVOKE_NONVIRTUAL) != 0)
- nonVirtual = true;
- else
- nonVirtual = false;
- MethodInvoker vmi = new MethodInvoker(vm);
-
- vmi.executeMethod(obj, thread, clazz, method, values, nonVirtual);
- Object value = vmi.getReturnedValue();
- ObjectId exceptionId = vmi.getExceptionId();
-
- Value.writeValue(os, value);
- exceptionId.writeTagged(os);
- }
-
- private void executeDisableCollection(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ObjectId oid = idMan.readId(bb);
- oid.disableCollection();
- }
-
- private void executeEnableCollection(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ObjectId oid = idMan.readId(bb);
- oid.enableCollection();
- }
-
- private void executeIsCollected(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ObjectId oid = idMan.readId(bb);
- boolean collected = oid.isCollected();
- os.writeBoolean(collected);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/processor/PacketProcessor.java b/libjava/gnu/classpath/jdwp/processor/PacketProcessor.java
deleted file mode 100644
index 914494c249f..00000000000
--- a/libjava/gnu/classpath/jdwp/processor/PacketProcessor.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/* PacketProcessor.java -- a thread which processes command packets
- from the debugger
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.processor;
-
-import gnu.classpath.jdwp.Jdwp;
-import gnu.classpath.jdwp.JdwpConstants;
-import gnu.classpath.jdwp.exception.JdwpException;
-import gnu.classpath.jdwp.transport.JdwpCommandPacket;
-import gnu.classpath.jdwp.transport.JdwpConnection;
-import gnu.classpath.jdwp.transport.JdwpPacket;
-import gnu.classpath.jdwp.transport.JdwpReplyPacket;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-/**
- * This class is responsible for processing packets from the
- * debugger. It waits for an available packet from the connection
- * ({@link gnu.classpath.jdwp.transport.JdwpConnection}) and then
- * processes the packet and any reply.
- *
- * @author Keith Seitz (keiths@redhat.com)
- */
-public class PacketProcessor
- extends Thread
-{
- // The connection to the debugger
- private JdwpConnection _connection;
-
- // Shutdown this thread?
- private boolean _shutdown;
-
- // A Mapping of the command set (Byte) to the specific CommandSet
- private CommandSet[] _sets;
-
- // Contents of the ReplyPackets data field
- private ByteArrayOutputStream _outputBytes;
-
- // Output stream around _outputBytes
- private DataOutputStream _os;
-
- /**
- * Constructs a new <code>PacketProcessor</code> object
- * Connection must be validated before getting here!
- *
- * @param con the connection
- */
- public PacketProcessor (JdwpConnection con)
- {
- _connection = con;
- _shutdown = false;
-
- // MAXIMUM is the value of the largest command set we may receive
- _sets = new CommandSet[JdwpConstants.CommandSet.MAXIMUM + 1];
- _outputBytes = new ByteArrayOutputStream();
- _os = new DataOutputStream (_outputBytes);
-
- // Create all the Command Sets and add them to our array
- _sets[JdwpConstants.CommandSet.VirtualMachine.CS_VALUE] =
- new VirtualMachineCommandSet();
- _sets[JdwpConstants.CommandSet.ReferenceType.CS_VALUE] =
- new ReferenceTypeCommandSet();
- _sets[JdwpConstants.CommandSet.ClassType.CS_VALUE] =
- new ClassTypeCommandSet();
- _sets[JdwpConstants.CommandSet.ArrayType.CS_VALUE] =
- new ArrayTypeCommandSet();
- _sets[JdwpConstants.CommandSet.InterfaceType.CS_VALUE] =
- new InterfaceTypeCommandSet();
- _sets[JdwpConstants.CommandSet.Method.CS_VALUE] =
- new MethodCommandSet();
- _sets[JdwpConstants.CommandSet.Field.CS_VALUE] =
- new FieldCommandSet();
- _sets[JdwpConstants.CommandSet.ObjectReference.CS_VALUE] =
- new ObjectReferenceCommandSet();
- _sets[JdwpConstants.CommandSet.StringReference.CS_VALUE] =
- new StringReferenceCommandSet();
- _sets[JdwpConstants.CommandSet.ThreadReference.CS_VALUE] =
- new ThreadReferenceCommandSet();
- _sets[JdwpConstants.CommandSet.ThreadGroupReference.CS_VALUE] =
- new ThreadGroupReferenceCommandSet();
- _sets[JdwpConstants.CommandSet.ArrayReference.CS_VALUE] =
- new ArrayReferenceCommandSet();
- _sets[JdwpConstants.CommandSet.ClassLoaderReference.CS_VALUE] =
- new ClassLoaderReferenceCommandSet();
- _sets[JdwpConstants.CommandSet.EventRequest.CS_VALUE] =
- new EventRequestCommandSet();
- _sets[JdwpConstants.CommandSet.StackFrame.CS_VALUE] =
- new StackFrameCommandSet();
- _sets[JdwpConstants.CommandSet.ClassObjectReference.CS_VALUE] =
- new ClassObjectReferenceCommandSet();
- }
-
- /**
- * Main run routine for this thread. Will loop getting packets
- * from the connection and processing them.
- */
- public void run ()
- {
- try
- {
- while (!_shutdown)
- {
- _processOnePacket ();
- }
- }
- catch (IOException ex)
- {
- ex.printStackTrace();
- }
- // Time to shutdown, tell Jdwp to shutdown
- Jdwp.getDefault().shutdown();
- }
-
- /**
- * Shutdown the packet processor
- */
- public void shutdown ()
- {
- _shutdown = true;
- interrupt ();
- }
-
- // Helper function which actually does all the work of waiting
- // for a packet and getting it processed.
- private void _processOnePacket ()
- throws IOException
- {
- JdwpPacket pkt = _connection.getPacket ();
-
- if (!(pkt instanceof JdwpCommandPacket))
- {
- // We're not supposed to get these from the debugger!
- // Drop it on the floor
- return;
- }
-
- if (pkt != null)
- {
- JdwpCommandPacket commandPkt = (JdwpCommandPacket) pkt;
- JdwpReplyPacket reply = new JdwpReplyPacket(commandPkt);
-
- // Reset our output stream
- _outputBytes.reset();
-
- // Create a ByteBuffer around the command packet
- ByteBuffer bb = ByteBuffer.wrap(commandPkt.getData());
- byte command = commandPkt.getCommand();
- byte commandSet = commandPkt.getCommandSet();
-
- CommandSet set = null;
- try
- {
- // There is no command set with value 0
- if (commandSet > 0 && commandSet < _sets.length)
- {
- set = _sets[commandPkt.getCommandSet()];
- }
- if (set != null)
- {
- _shutdown = set.runCommand(bb, _os, command);
- reply.setData(_outputBytes.toByteArray());
- }
- else
- {
- // This command set wasn't in our tree
- reply.setErrorCode(JdwpConstants.Error.NOT_IMPLEMENTED);
- }
- }
- catch (JdwpException ex)
- {
- reply.setErrorCode(ex.getErrorCode ());
- }
- _connection.sendPacket (reply);
- }
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java b/libjava/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
deleted file mode 100644
index 34def9f2d07..00000000000
--- a/libjava/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/* ReferenceTypeCommandSet.java -- lass to implement the ReferenceType
- Command Set
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.classpath.jdwp.processor;
-
-import gnu.classpath.jdwp.IVirtualMachine;
-import gnu.classpath.jdwp.Jdwp;
-import gnu.classpath.jdwp.JdwpConstants;
-import gnu.classpath.jdwp.exception.InvalidFieldException;
-import gnu.classpath.jdwp.exception.JdwpException;
-import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
-import gnu.classpath.jdwp.exception.NotImplementedException;
-import gnu.classpath.jdwp.id.IdManager;
-import gnu.classpath.jdwp.id.ObjectId;
-import gnu.classpath.jdwp.id.ReferenceTypeId;
-import gnu.classpath.jdwp.util.JdwpString;
-import gnu.classpath.jdwp.util.Signature;
-import gnu.classpath.jdwp.util.Value;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.nio.ByteBuffer;
-
-/**
- * A class representing the ReferenceType Command Set.
- *
- * @author Aaron Luchko <aluchko@redhat.com>
- */
-public class ReferenceTypeCommandSet implements CommandSet
-{
- // Our hook into the jvm
- private final IVirtualMachine vm = Jdwp.getIVirtualMachine();
-
- // Manages all the different ids that are assigned by jdwp
- private final IdManager idMan = Jdwp.getIdManager();
-
- public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)
- throws JdwpException
- {
- try
- {
- switch (command)
- {
- case JdwpConstants.CommandSet.ReferenceType.SIGNATURE:
- executeSignature(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.CLASS_LOADER:
- executeClassLoader(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.MODIFIERS:
- executeModifiers(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.FIELDS:
- executeFields(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.METHODS:
- executeMethods(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.GET_VALUES:
- executeGetValues(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.SOURCE_FILE:
- executeSourceFile(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.NESTED_TYPES:
- executeNestedTypes(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.STATUS:
- executeStatus(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.INTERFACES:
- executeInterfaces(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.CLASS_OBJECT:
- executeClassObject(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.SOURCE_DEBUG_EXTENSION:
- executeSourceDebugExtension(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.SIGNATURE_WITH_GENERIC:
- executeSignatureWithGeneric(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.FIELDS_WITH_GENERIC:
- executeFieldWithGeneric(bb, os);
- break;
- case JdwpConstants.CommandSet.ReferenceType.METHODS_WITH_GENERIC:
- executeMethodsWithGeneric(bb, os);
- break;
- default:
- throw new NotImplementedException("Command " + command +
- " not found in String Reference Command Set.");
- }
- }
- catch (IOException ex)
- {
- // The DataOutputStream we're using isn't talking to a socket at all
- // So if we throw an IOException we're in serious trouble
- throw new JdwpInternalErrorException(ex);
- }
- return true;
- }
-
- private void executeSignature(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
- String sig = Signature.computeClassSignature(refId.getType());
- JdwpString.writeString(os, sig);
- }
-
- private void executeClassLoader(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
-
- Class clazz = refId.getType();
- ClassLoader loader = clazz.getClassLoader();
- ObjectId oid = idMan.getId(loader);
- oid.write(os);
- }
-
- private void executeModifiers(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
-
- Class clazz = refId.getType();
- os.writeInt(clazz.getModifiers());
- }
-
- private void executeFields(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
- Class clazz = refId.getType();
-
- Field[] fields = clazz.getFields();
- os.writeInt(fields.length);
- for (int i = 0; i < fields.length; i++)
- {
- Field field = fields[i];
- idMan.getId(field).write(os);
- JdwpString.writeString(os, field.getName());
- JdwpString.writeString(os, Signature.computeFieldSignature(field));
- os.writeInt(field.getModifiers());
- }
- }
-
- private void executeMethods(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
- Class clazz = refId.getType();
-
- Method[] methods = clazz.getMethods();
- os.writeInt(methods.length);
- for (int i = 0; i < methods.length; i++)
- {
- Method method = methods[i];
- idMan.getId(method).write(os);
- JdwpString.writeString(os, method.getName());
- JdwpString.writeString(os, Signature.computeMethodSignature(method));
- os.writeInt(method.getModifiers());
- }
- }
-
- private void executeGetValues(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
- Class clazz = refId.getType();
-
- int numFields = bb.getInt();
- os.writeInt(numFields); // Looks pointless but this is the protocol
- for (int i = 0; i < numFields; i++)
- {
- ObjectId fieldId = idMan.readId(bb);
- Field field = (Field) (fieldId.getObject());
- Class fieldClazz = field.getDeclaringClass();
-
- // We don't actually need the clazz to get the field but we might as
- // well check that the debugger got it right
- if (fieldClazz.isAssignableFrom(clazz))
- Value.writeStaticValueFromField(os, field);
- else
- throw new InvalidFieldException(fieldId.getId());
- }
- }
-
- private void executeSourceFile(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
- Class clazz = refId.getType();
-
- // We'll need to go into the jvm for this unless there's an easier way
- String sourceFileName = vm.getSourceFile(clazz);
- JdwpString.writeString(os, sourceFileName);
- // clazz.getProtectionDomain().getCodeSource().getLocation();
- }
-
- private void executeNestedTypes(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
- Class clazz = refId.getType();
- Class[] declaredClazzes = clazz.getDeclaredClasses();
- os.writeInt(declaredClazzes.length);
- for (int i = 0; i < declaredClazzes.length; i++)
- {
- Class decClazz = declaredClazzes[i];
- ReferenceTypeId clazzId = idMan.getReferenceTypeId(decClazz);
- clazzId.writeTagged(os);
- }
- }
-
- private void executeStatus(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
- Class clazz = refId.getType();
-
- // I don't think there's any other way to get this
- int status = vm.getStatus(clazz);
- os.writeInt(status);
- }
-
- private void executeInterfaces(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
- Class clazz = refId.getType();
- Class[] interfaces = clazz.getInterfaces();
- os.writeInt(interfaces.length);
- for (int i = 0; i < interfaces.length; i++)
- {
- Class interfaceClass = interfaces[i];
- ReferenceTypeId intId = idMan.getReferenceTypeId(interfaceClass);
- intId.write(os);
- }
- }
-
- private void executeClassObject(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
- Class clazz = refId.getType();
- ObjectId clazzObjectId = idMan.getId(clazz);
- clazzObjectId.write(os);
- }
-
- private void executeSourceDebugExtension(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- // This command is optional, determined by VirtualMachines CapabilitiesNew
- // so we'll leave it till later to implement
- throw new NotImplementedException(
- "Command SourceDebugExtension not implemented.");
- }
-
- private void executeSignatureWithGeneric(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- // We don't have generics yet
- throw new NotImplementedException(
- "Command SourceDebugExtension not implemented.");
- }
-
- private void executeFieldWithGeneric(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- // We don't have generics yet
- throw new NotImplementedException(
- "Command SourceDebugExtension not implemented.");
- }
-
- private void executeMethodsWithGeneric(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- // We don't have generics yet
- throw new NotImplementedException(
- "Command SourceDebugExtension not implemented.");
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/processor/StringReferenceCommandSet.java b/libjava/gnu/classpath/jdwp/processor/StringReferenceCommandSet.java
deleted file mode 100644
index 1f1b04cb0cc..00000000000
--- a/libjava/gnu/classpath/jdwp/processor/StringReferenceCommandSet.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* StringReferenceCommandSet.java -- class to implement the StringReference
- Command Set
- Copyright (C) 2005 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
-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.classpath.jdwp.processor;
-
-import gnu.classpath.jdwp.Jdwp;
-import gnu.classpath.jdwp.JdwpConstants;
-import gnu.classpath.jdwp.exception.JdwpException;
-import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
-import gnu.classpath.jdwp.exception.NotImplementedException;
-import gnu.classpath.jdwp.id.ObjectId;
-import gnu.classpath.jdwp.util.JdwpString;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-/**
- * A class representing the StringReference Command Set.
- *
- * @author Aaron Luchko <aluchko@redhat.com>
- */
-public class StringReferenceCommandSet implements CommandSet
-{
-
- public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)
- throws JdwpException
- {
- try
- {
-
- // Although there's only a single command to choose from we still use
- // a switch to maintain consistency with the rest of the CommandSets
- switch (command)
- {
- case JdwpConstants.CommandSet.StringReference.VALUE:
- executeValue(bb, os);
- break;
- default:
- throw new NotImplementedException("Command " + command +
- " not found in String Reference Command Set.");
- }
- }
- catch (IOException ex)
- {
- // The DataOutputStream we're using isn't talking to a socket at all
- // So if we throw an IOException we're in serious trouble
- throw new JdwpInternalErrorException(ex);
- }
- return true;
- }
-
- private void executeValue(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ObjectId oid = Jdwp.getIdManager().readId(bb);
-
- String str = (String) oid.getObject();
- JdwpString.writeString(os, str);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java b/libjava/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java
deleted file mode 100644
index 32b98781727..00000000000
--- a/libjava/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java
+++ /dev/null
@@ -1,474 +0,0 @@
-/* VirtualMachineCommandSet.java -- class to implement the VirtualMachine
- Command Set
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.classpath.jdwp.processor;
-
-import gnu.classpath.jdwp.IVirtualMachine;
-import gnu.classpath.jdwp.Jdwp;
-import gnu.classpath.jdwp.JdwpConstants;
-import gnu.classpath.jdwp.exception.JdwpException;
-import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
-import gnu.classpath.jdwp.exception.NotImplementedException;
-import gnu.classpath.jdwp.id.IdManager;
-import gnu.classpath.jdwp.id.ObjectId;
-import gnu.classpath.jdwp.id.ReferenceTypeId;
-import gnu.classpath.jdwp.util.JdwpString;
-import gnu.classpath.jdwp.util.Signature;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Properties;
-
-/**
- * A class representing the VirtualMachine Command Set.
- *
- * @author Aaron Luchko <aluchko@redhat.com>
- */
-public class VirtualMachineCommandSet implements CommandSet
-{
- // Our hook into the jvm
- private final IVirtualMachine vm = Jdwp.getIVirtualMachine();
-
- // Manages all the different ids that are assigned by jdwp
- private final IdManager idMan = Jdwp.getIdManager();
-
- // The Jdwp object
- private final Jdwp jdwp = Jdwp.getDefault();
-
- public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)
- throws JdwpException
- {
- boolean keepRunning = true;
- try
- {
- switch (command)
- {
- case JdwpConstants.CommandSet.VirtualMachine.VERSION:
- executeVersion(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.CLASSES_BY_SIGNATURE:
- executeClassesBySignature(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.ALL_CLASSES:
- executeAllClasses(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.ALL_THREADS:
- executeAllThreads(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.TOP_LEVEL_THREAD_GROUPS:
- executeTopLevelThreadGroups(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.IDSIZES:
- executeIDsizes(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.DISPOSE:
- keepRunning = false;
- executeDispose(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.SUSPEND:
- executeSuspend(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.RESUME:
- executeResume(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.EXIT:
- keepRunning = false;
- executeExit(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.CREATE_STRING:
- executeCreateString(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.CAPABILITIES:
- executeCapabilities(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.CLASS_PATHS:
- executeClassPaths(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.DISPOSE_OBJECTS:
- executeDisposeObjects(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.HOLD_EVENTS:
- executeHoldEvents(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.RELEASE_EVENTS:
- executeReleaseEvents(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.CAPABILITIES_NEW:
- executeCapabilitiesNew(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.REDEFINE_CLASSES:
- executeRedefineClasses(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.SET_DEFAULT_STRATUM:
- executeSetDefaultStratum(bb, os);
- break;
- case JdwpConstants.CommandSet.VirtualMachine.ALL_CLASSES_WITH_GENERIC:
- executeAllClassesWithGeneric(bb, os);
- break;
-
- default:
- break;
- }
- }
- catch (IOException ex)
- {
- // The DataOutputStream we're using isn't talking to a socket at all
- // So if we throw an IOException we're in serious trouble
- throw new JdwpInternalErrorException(ex);
- }
- return keepRunning;
- }
-
- private void executeVersion(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
-
- Properties props = System.getProperties();
-
- int jdwpMajor = JdwpConstants.Version.MAJOR;
- int jdwpMinor = JdwpConstants.Version.MINOR;
- // The description field is pretty loosely defined
- String description = "JDWP version " + jdwpMajor + "." + jdwpMinor
- + ", JVM version " + props.getProperty("java.vm.name")
- + " " + props.getProperty("java.vm.version") + " "
- + props.getProperty("java.version");
- String vmVersion = props.getProperty("java.version");
- String vmName = props.getProperty("java.vm.name");
- JdwpString.writeString(os, description);
- os.write(jdwpMajor);
- os.write(jdwpMinor);
- JdwpString.writeString(os, vmName);
- JdwpString.writeString(os, vmVersion);
- }
-
- private void executeClassesBySignature(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- String sig = JdwpString.readString(bb);
- ArrayList allMatchingClasses = new ArrayList();
-
- // This will be an Iterator over all loaded Classes
- Iterator iter = vm.getAllLoadedClasses();
-
- while (iter.hasNext())
- {
- Class clazz = (Class) iter.next();
- String clazzSig = Signature.computeClassSignature(clazz);
- if (clazzSig.equals(sig))
- allMatchingClasses.add(clazz);
- }
-
- os.writeInt(allMatchingClasses.size());
- for (int i = 0; i < allMatchingClasses.size(); i++)
- {
- Class clazz = (Class) allMatchingClasses.get(i);
- ReferenceTypeId id = idMan.getReferenceTypeId(clazz);
- id.writeTagged(os);
- int status = vm.getStatus(clazz);
- os.writeInt(status);
- }
- }
-
- private void executeAllClasses(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- // Disable garbage collection while we're collecting the info on loaded
- // classes so we some classes don't get collected between the time we get
- // the count and the time we get the list
- vm.disableGarbageCollection();
-
- int classCount = vm.getAllLoadedClassesCount();
- os.writeInt(classCount);
-
- // This will be an Iterator over all loaded Classes
- Iterator iter = vm.getAllLoadedClasses();
- vm.enableGarbageCollection();
- int count = 0;
-
- // Note it's possible classes were created since out classCount so make
- // sure we don't write more classes than we told the debugger
- while (iter.hasNext() && count++ < classCount)
- {
- Class clazz = (Class) iter.next();
- ReferenceTypeId id = idMan.getReferenceTypeId(clazz);
- id.writeTagged(os);
- String sig = Signature.computeClassSignature(clazz);
- JdwpString.writeString(os, sig);
- int status = vm.getStatus(clazz);
- os.writeInt(status);
- }
- }
-
- private void executeAllThreads(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ThreadGroup jdwpGroup = Thread.currentThread().getThreadGroup();
- ThreadGroup root = getRootThreadGroup(jdwpGroup);
-
- int numThreads = root.activeCount();
- Thread allThreads[] = new Thread[numThreads];
- root.enumerate(allThreads, true);
-
- // We need to loop through for the true count since some threads may have
- // been destroyed since we got
- // activeCount so those spots in the array will be null. As well we must
- // ignore any threads that belong to jdwp
- numThreads = 0;
- for (int i = 0; i < allThreads.length; i++)
- {
- Thread thread = allThreads[i];
- if (thread == null)
- break; // No threads after this point
- if (!thread.getThreadGroup().equals(jdwpGroup))
- numThreads++;
- }
-
- os.writeInt(numThreads);
-
- for (int i = 0; i < allThreads.length; i++)
- {
- Thread thread = allThreads[i];
- if (thread == null)
- break; // No threads after this point
- if (!thread.getThreadGroup().equals(jdwpGroup))
- idMan.getId(thread).write(os);
- }
- }
-
- private void executeTopLevelThreadGroups(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ThreadGroup jdwpGroup = jdwp.getJdwpThreadGroup();
- ThreadGroup root = getRootThreadGroup(jdwpGroup);
-
- os.writeInt(1); // Just one top level group allowed?
- idMan.getId(root);
- }
-
- private void executeDispose(ByteBuffer bb, DataOutputStream os)
- throws JdwpException
- {
- // resumeAllThreads isn't sufficient as a thread may have been
- // suspended multiple times, we likely need a way to keep track of how many
- // times a thread has been suspended or else a stronger resume method for
- // this purpose
- // vm.resumeAllThreadsExcept(jdwp.getJdwpThreadGroup());
-
- // Simply shutting down the jdwp layer will take care of the rest of the
- // shutdown other than disabling debugging in the VM
- // vm.disableDebugging();
-
- // Don't implement this until we're sure how to remove all the debugging
- // effects from the VM.
- throw new NotImplementedException(
- "Command VirtualMachine.Dispose not implemented");
-
- }
-
- private void executeIDsizes(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- ObjectId oid = new ObjectId();
- os.writeInt(oid.size()); // fieldId
- os.writeInt(oid.size()); // methodId
- os.writeInt(oid.size()); // objectId
- os.writeInt(new ReferenceTypeId((byte) 0x00).size()); // referenceTypeId
- os.writeInt(oid.size()); // frameId
- }
-
- private void executeSuspend(ByteBuffer bb, DataOutputStream os)
- throws JdwpException
- {
- vm.suspendAllThreadsExcept(jdwp.getJdwpThreadGroup());
- }
-
- private void executeResume(ByteBuffer bb, DataOutputStream os)
- throws JdwpException
- {
- vm.resumeAllThreadsExcept(jdwp.getJdwpThreadGroup());
- }
-
- private void executeExit(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- int exitCode = bb.getInt();
- jdwp.setExit(exitCode);
- }
-
- private void executeCreateString(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- String string = JdwpString.readString(bb);
- ObjectId stringId = Jdwp.getIdManager().getId(string);
-
- // Since this string isn't referenced anywhere we'll disable garbage
- // collection on it so it's still around when the debugger gets back to it.
- stringId.disableCollection();
- stringId.write(os);
- }
-
- private void executeCapabilities(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- // Store these somewhere?
- os.writeBoolean(false); // canWatchFieldModification
- os.writeBoolean(false); // canWatchFieldAccess
- os.writeBoolean(false); // canGetBytecodes
- os.writeBoolean(false); // canGetSyntheticAttribute
- os.writeBoolean(false); // canGetOwnedMonitorInfo
- os.writeBoolean(false); // canGetCurrentContendedMonitor
- os.writeBoolean(false); // canGetMonitorInfo
- }
-
- private void executeClassPaths(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- String baseDir = System.getProperty("user.dir");
- JdwpString.writeString(os, baseDir);
-
- // Find and write the classpath
- String classPath = System.getProperty("java.class.path");
- String[] paths = classPath.split(":");
-
- os.writeInt(paths.length);
- for (int i = 0; i < paths.length; i++)
- JdwpString.writeString(os, paths[i]);
-
- // Now the bootpath
- String bootPath = System.getProperty("sun.boot.class.path");
- paths = bootPath.split(":");
- os.writeInt(paths.length);
- for (int i = 0; i < paths.length; i++)
- JdwpString.writeString(os, paths[i]);
- }
-
- private void executeDisposeObjects(ByteBuffer bb, DataOutputStream os)
- throws JdwpException
- {
- // Instead of going through the list of objects they give us it's probably
- // better just to find the garbage collected objects ourselves
- idMan.update();
- }
-
- private void executeHoldEvents(ByteBuffer bb, DataOutputStream os)
- throws JdwpException
- {
- // Going to have to implement a send queue somewhere and do this without
- // triggering events
- // Until then just don't implement
- throw new NotImplementedException(
- "Command VirtualMachine.HoldEvents not implemented");
- }
-
- // Opposite of executeHoldEvents
- private void executeReleaseEvents(ByteBuffer bb, DataOutputStream os)
- throws JdwpException
- {
- throw new NotImplementedException(
- "Command VirtualMachine.ReleaseEvents not implemented");
- }
-
- private void executeCapabilitiesNew(ByteBuffer bb, DataOutputStream os)
- throws JdwpException, IOException
- {
- // Store these somewhere?
- final int CAPABILITIES_NEW_SIZE = 32;
- os.writeBoolean(false); // canWatchFieldModification
- os.writeBoolean(false); // canWatchFieldAccess
- os.writeBoolean(false); // canGetBytecodes
- os.writeBoolean(false); // canGetSyntheticAttribute
- os.writeBoolean(false); // canGetOwnedMonitorInfo
- os.writeBoolean(false); // canGetCurrentContendedMonitor
- os.writeBoolean(false); // canGetMonitorInfo
- os.writeBoolean(false); // canRedefineClasses
- os.writeBoolean(false); // canAddMethod
- os.writeBoolean(false); // canUnrestrictedlyRedefineClasses
- os.writeBoolean(false); // canPopFrames
- os.writeBoolean(false); // canUseInstanceFilters
- os.writeBoolean(false); // canGetSourceDebugExtension
- os.writeBoolean(false); // canRequestVMDeathEvent
- os.writeBoolean(false); // canSetDefaultStratum
- for (int i = 15; i < CAPABILITIES_NEW_SIZE; i++)
- // Future capabilities
- // currently unused
- os.writeBoolean(false); // Set to false
- }
-
- private void executeRedefineClasses(ByteBuffer bb, DataOutputStream os)
- throws JdwpException
- {
- // Optional command, don't implement
- throw new NotImplementedException(
- "Command VirtualMachine.RedefineClasses not implemented");
- }
-
- private void executeSetDefaultStratum(ByteBuffer bb, DataOutputStream os)
- throws JdwpException
- {
- // Optional command, don't implement
- throw new NotImplementedException(
- "Command VirtualMachine.SetDefaultStratum not implemented");
- }
-
- private void executeAllClassesWithGeneric(ByteBuffer bb, DataOutputStream os)
- throws JdwpException
- {
- // We don't handle generics
- throw new NotImplementedException(
- "Command VirtualMachine.AllClassesWithGeneric not implemented");
- }
-
- /**
- * Find the root ThreadGroup of this ThreadGroup
- */
- private ThreadGroup getRootThreadGroup(ThreadGroup group)
- {
- ThreadGroup parent = group.getParent();
-
- while (parent != null)
- {
- group = parent;
- parent = group.getParent();
- }
- return group; // This group was the root
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/transport/ITransport.java b/libjava/gnu/classpath/jdwp/transport/ITransport.java
deleted file mode 100644
index 371cf8f06af..00000000000
--- a/libjava/gnu/classpath/jdwp/transport/ITransport.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ITransport.java -- An interface defining JDWP transports
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.transport;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.IllegalArgumentException;
-import java.util.HashMap;
-
-/**
- * A class representing a transport layer. This class serves as a generic
- * interface for all transport types used in the JDWP back-end.
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public interface ITransport
-{
- /**
- * Configure the transport with the given properties
- *
- * @param properties properties of the transport configuration
- * @throws TransportException on configury error
- */
- public void configure (HashMap properties)
- throws TransportException;
-
- /**
- * Initialize the transport
- *
- * @throws TransportException on initialization error
- */
- public void initialize ()
- throws TransportException;
-
- /**
- * Get the input stream for the transport
- */
- public InputStream getInputStream ()
- throws IOException;
-
- /**
- * Get the output stream for the transport
- */
- public OutputStream getOutputStream ()
- throws IOException;
-}
diff --git a/libjava/gnu/classpath/jdwp/transport/JdwpCommandPacket.java b/libjava/gnu/classpath/jdwp/transport/JdwpCommandPacket.java
deleted file mode 100644
index e99159aad9b..00000000000
--- a/libjava/gnu/classpath/jdwp/transport/JdwpCommandPacket.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* JdwpCommandPacket.java -- JDWP command packet
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.transport;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-/**
- * A class representing a JDWP command packet.
- * This class adds command set and command to the packet header
- * information in {@link gnu.classpath.jdwp.transport.JdwpPacket}
- * and adds additional command packet-specific processing.
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class JdwpCommandPacket extends JdwpPacket
-{
- /**
- * Command set
- */
- protected byte _commandSet;
-
- /**
- * Command
- */
- protected byte _command;
-
- // Minimum packet size [excluding super class]
- // ( commandSet (1) + command (1) )
- private static final int MINIMUM_LENGTH = 2;
-
- /**
- * Constructs a new <code>JdwpCommandPacket</code>
- */
- public JdwpCommandPacket ()
- {
- // Don't assign an id. This constructor is called by
- // JdwpPacket.fromBytes, and that will assign a packet id.
- }
-
- /**
- * Constructs a new <code>JdwpCommandPacket</code>
- * with the given command set and command
- *
- * @param set the command set
- * @param command the command
- */
- public JdwpCommandPacket (byte set, byte command)
- {
- _id = ++_last_id;
- _commandSet = set;
- _command = command;
- }
-
- /**
- * Retuns the length of this packet
- */
- public int getLength ()
- {
- return MINIMUM_LENGTH + super.getLength ();
- }
-
- /**
- * Returns the command set
- */
- public byte getCommandSet ()
- {
- return _commandSet;
- }
-
- /**
- * Sets the command set
- */
- public void setCommandSet (byte cs)
- {
- _commandSet = cs;
- }
-
- /**
- * Returns the command
- */
- public byte getCommand ()
- {
- return _command;
- }
-
- /**
- * Sets the command
- */
- public void setCommand (byte cmd)
- {
- _command = cmd;
- }
-
- // Reads command packet data from the given buffer, starting
- // at the given offset
- protected int myFromBytes (byte[] bytes, int index)
- {
- int i = 0;
- setCommandSet (bytes[index + i++]);
- setCommand (bytes[index + i++]);
- return i;
- }
-
- // Writes the command packet data into the given buffer
- protected void myWrite (DataOutputStream dos)
- throws IOException
- {
- dos.writeByte (getCommandSet ());
- dos.writeByte (getCommand ());
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/transport/JdwpConnection.java b/libjava/gnu/classpath/jdwp/transport/JdwpConnection.java
deleted file mode 100644
index 18250d3209b..00000000000
--- a/libjava/gnu/classpath/jdwp/transport/JdwpConnection.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/* JdwpConnection.java -- A JDWP-speaking connection
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.transport;
-
-import gnu.classpath.jdwp.Jdwp;
-import gnu.classpath.jdwp.event.Event;
-import gnu.classpath.jdwp.event.EventRequest;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-/**
- * A connection via some transport to some JDWP-speaking entity.
- * This is also a thread which handles all communications to/from
- * the debugger. While access to the transport layer may be accessed by
- * several threads, start-up and initialization should not be allowed
- * to occur more than once.
- *
- * <p>This class is also a thread that is responsible for pulling
- * packets off the wire and sticking them in a queue for packet
- * processing threads.
- *
- * @author Keith Seitz (keiths@redhat.com)
- */
-public class JdwpConnection
- extends Thread
-{
- // The JDWP handshake
- private static final byte[] _HANDSHAKE = {'J', 'D', 'W', 'P', '-', 'H', 'a',
- 'n', 'd', 's', 'h', 'a', 'k', 'e'};
-
- // Transport method
- private ITransport _transport;
-
- // Command queue
- private ArrayList _commandQueue;
-
- // Shutdown flag
- private boolean _shutdown;
-
- // Input stream from transport
- private DataInputStream _inStream;
-
- // Output stream from transprot
- private DataOutputStream _outStream;
-
- // A buffer used to construct the packet data
- private ByteArrayOutputStream _bytes;
-
- // A DataOutputStream for the byte buffer
- private DataOutputStream _doStream;
-
- /**
- * Creates a new <code>JdwpConnection</code> instance
- *
- * @param transport the transport to use for communications
- */
- public JdwpConnection (ITransport transport)
- {
- _transport = transport;
- _commandQueue = new ArrayList ();
- _shutdown = false;
- _bytes = new ByteArrayOutputStream ();
- _doStream = new DataOutputStream (_bytes);
- }
-
- /**
- * Initializes the connection, including connecting
- * to socket or shared memory endpoint
- *
- * @throws TransportException if initialization fails
- */
- public void initialize ()
- throws TransportException
- {
- // Initialize transport (connect socket, e.g.)
- _transport.initialize ();
-
- // Do handshake
- try
- {
- _inStream = new DataInputStream (_transport.getInputStream ());
- _outStream = new DataOutputStream (_transport.getOutputStream ());
- _doHandshake ();
- }
- catch (IOException ioe)
- {
- throw new TransportException (ioe);
- }
- }
-
- /* Does the JDWP handshake -- this should not need synchronization
- because this is called by VM startup code, i.e., no packet
- processing threads have started yet. */
- private void _doHandshake ()
- throws IOException
- {
- // According to the spec, the handshake is always initiated by
- // the debugger, regardless of whether the JVM is in client mode or
- // server mode.
-
- // Wait for handshake from debugger
- byte[] hshake = new byte[_HANDSHAKE.length];
- _inStream.readFully (hshake, 0, _HANDSHAKE.length);
-
- if (Arrays.equals (hshake, _HANDSHAKE))
- {
- // Send reply handshake
- _outStream.write (_HANDSHAKE, 0, _HANDSHAKE.length);
- return;
- }
- else
- {
- throw new IOException ("invalid JDWP handshake (\"" + hshake + "\")");
- }
- }
-
- /**
- * Main run method for the thread. This thread loops waiting for
- * packets to be read via the connection. When a packet is complete
- * and ready for processing, it places the packet in a queue that can
- * be accessed via <code>getPacket</code>
- */
- public void run ()
- {
- while (!_shutdown)
- {
- try
- {
- _readOnePacket ();
- }
- catch (IOException ioe)
- {
- /* IOException can occur for two reasons:
- 1. Lost connection with the other side
- 2. Transport was shutdown
- In either case, we make sure that all of the
- back-end gets shutdown. */
- Jdwp.getInstance().shutdown ();
- }
- catch (Throwable t)
- {
- System.out.println ("JdwpConnection.run: caught an exception: "
- + t);
- // Just keep going
- }
- }
- }
-
- // Reads a single packet from the connection, adding it to the packet
- // queue when a complete packet is ready.
- private void _readOnePacket ()
- throws IOException
- {
- byte[] data = null;
-
- // Read in the packet
- int length = _inStream.readInt ();
- if (length < 11)
- {
- throw new IOException ("JDWP packet length < 11 ("
- + length + ")");
- }
-
- data = new byte[length];
- data[0] = (byte) (length >>> 24);
- data[1] = (byte) (length >>> 16);
- data[2] = (byte) (length >>> 8);
- data[3] = (byte) length;
- _inStream.readFully (data, 4, length - 4);
-
- JdwpPacket packet = JdwpPacket.fromBytes (data);
- if (packet != null)
- {
- synchronized (_commandQueue)
- {
- _commandQueue.add (packet);
- _commandQueue.notifyAll ();
- }
- }
- }
-
- /**
- * Returns a packet from the queue of ready packets
- *
- * @returns a <code>JdwpPacket</code> ready for processing
- * <code>null</code> when shutting down
- */
- public JdwpPacket getPacket ()
- {
- synchronized (_commandQueue)
- {
- while (_commandQueue.isEmpty ())
- {
- try
- {
- _commandQueue.wait ();
- }
- catch (InterruptedException ie)
- {
- /* PacketProcessor is interrupted
- when shutting down */
- return null;
- }
- }
-
- return (JdwpPacket) _commandQueue.remove (0);
- }
- }
-
- /**
- * Send a packet to the debugger
- *
- * @param pkt a <code>JdwpPacket</code> to send
- * @throws IOException
- */
- public void sendPacket (JdwpPacket pkt)
- throws IOException
- {
- pkt.write (_outStream);
- }
-
- /**
- * Send an event notification to the debugger
- *
- * @param request the debugger request that wanted this event
- * @param event the event
- * @throws IOException
- */
- public void sendEvent (EventRequest request, Event event)
- throws IOException
- {
- JdwpPacket pkt;
-
- synchronized (_bytes)
- {
- _bytes.reset ();
- pkt = event.toPacket (_doStream, request);
- pkt.setData (_bytes.toByteArray ());
- }
-
- sendPacket (pkt);
- }
-
- /**
- * Shutdown the connection
- */
- public void shutdown ()
- {
- if (!_shutdown)
- {
- _transport.shutdown ();
- _shutdown = true;
- interrupt ();
- }
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/transport/JdwpPacket.java b/libjava/gnu/classpath/jdwp/transport/JdwpPacket.java
deleted file mode 100644
index 7fa93e2de1b..00000000000
--- a/libjava/gnu/classpath/jdwp/transport/JdwpPacket.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/* JdwpPacket.java -- Base class for JDWP command and reply packets
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.transport;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-/**
- * All command and reply packets in JDWP share
- * common header type information:
- *
- * length (4 bytes) : size of entire packet, including length
- * id (4 bytes) : unique packet id
- * flags (1 byte) : flag byte
- * [command packet stuff | reply packet stuff]
- * data (variable) : unique command-/reply-specific data
- *
- * This class deal with everything except the command- and reply-specific
- * data, which get handled in {@link
- * gnu.classpath.jdwp.transport.JdwpCommandPacket} and {@link
- * gnu.classpath.jdwp.transprot.JdwpReplyPacket}.
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public abstract class JdwpPacket
-{
- // Last id of packet constructed
- protected static int _last_id = 0;
-
- // JDWP reply packet flag
- protected static final int JDWP_FLAG_REPLY = 0x80;
-
- /**
- * Minimum packet size excluding sub-class data
- * ( length (4) + id (4) + flags (1) )
- */
- protected static final int MINIMUM_SIZE = 9;
-
- /**
- * Id of command/reply
- */
- protected int _id;
-
- /**
- * Packet flags
- */
- protected byte _flags;
-
- /**
- * Packet-specific data
- */
- protected byte[] _data;
-
- /**
- * Constructor
- */
- public JdwpPacket ()
- {
- // By default, DON'T assign an id. This way when a packet
- // is constructed from fromBytes, _last_id won't increment (i.e.,
- // it won't leave holes in the outgoing packet ids).
- }
-
- /**
- * Constructs a <code>JdwpPacket</code> with the id
- * from the given packet.
- *
- * @param pkt a packet whose id will be used in this new packet
- */
- public JdwpPacket (JdwpPacket pkt)
- {
- _id = pkt.getId ();
- }
-
- /**
- * Returns the packet id
- */
- public int getId ()
- {
- return _id;
- }
-
- /**
- * Sets the packet id
- */
- public void setId (int id)
- {
- _id = id;
- }
-
- /**
- * Returns the packet flags
- */
- public byte getFlags ()
- {
- return _flags;
- }
-
- /**
- * Sets the packet flags
- */
- public void setFlags (byte flags)
- {
- _flags = flags;
- }
-
- /**
- * Gets the command/reply-specific data in this packet
- */
- public byte[] getData ()
- {
- return _data;
- }
-
- /**
- * Sets the command/reply-specific data in this packet
- */
- public void setData (byte[] data)
- {
- _data = data;
- }
-
- /**
- * Returns the length of this entire packet
- */
- public int getLength ()
- {
- return MINIMUM_SIZE + (_data == null ? 0 : _data.length);
- }
-
- /**
- * Allow subclasses to initialize from data
- *
- * @param bytes packet data from the wire
- * @param index index into <code>bytes</code> to start processing
- * @return number of bytes in <code>bytes</code> processed
- */
- protected abstract int myFromBytes (byte[] bytes, int index);
-
- /**
- * Convert the given bytes into a <code>JdwpPacket</code>. Uses the
- * abstract method <code>myFromBytes</code> to allow subclasses to
- * process data.
- *
- * If the given data does not represent a valid JDWP packet, it returns
- * <code>null</code>.
- *
- * @param bytes packet data from the wire
- * @param index index into <code>bytes</code> to start processing
- * @return number of bytes in <code>bytes</code> processed
- */
- public static JdwpPacket fromBytes (byte[] bytes)
- {
- int i = 0;
- int length = ((bytes[i++] & 0xff) << 24 | (bytes[i++] & 0xff) << 16
- | (bytes[i++] & 0xff) << 8 | (bytes[i++] & 0xff));
- int id = 0;
- byte flags = 0;
-
- if (bytes.length == length)
- {
- id = ((bytes[i++] & 0xff) << 24 | (bytes[i++] & 0xff) << 16
- | (bytes[i++] & 0xff) << 8 | (bytes[i++] & 0xff));
- flags = bytes[i++];
-
- Class clazz = null;
- if (flags == 0)
- clazz = JdwpCommandPacket.class;
- else if ((flags & JDWP_FLAG_REPLY) != 0)
- clazz = JdwpReplyPacket.class;
- else
- {
- // Malformed packet. Discard it.
- return null;
- }
-
- JdwpPacket pkt = null;
- try
- {
- pkt = (JdwpPacket) clazz.newInstance ();
- }
- catch (InstantiationException ie)
- {
- // Discard packet
- return null;
- }
- catch (IllegalAccessException iae)
- {
- // Discard packet
- return null;
- }
-
- pkt.setId (id);
- pkt.setFlags (flags);
-
- i += pkt.myFromBytes (bytes, i);
- byte[] data = new byte[length - i];
- System.arraycopy (bytes, i, data, 0, data.length);
- pkt.setData (data);
-
- return pkt;
- }
-
- return null;
- }
-
- /**
- * Put subclass information onto the stream
- *
- * @param dos the output stream to which to write
- */
- protected abstract void myWrite (DataOutputStream dos)
- throws IOException;
-
- /**
- * Writes the packet to the output stream
- *
- * @param dos the output stream to which to write the packet
- */
- public void write (DataOutputStream dos)
- throws IOException
- {
- // length
- int length = getLength ();
- dos.writeInt (length);
-
- // ID
- dos.writeInt (getId ());
-
- // flag
- dos.writeByte (getFlags ());
-
- // packet-specific stuff
- myWrite (dos);
-
- // data (if any)
- byte[] data = getData ();
- if (data != null && data.length > 0)
- dos.write (data, 0, data.length);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/transport/JdwpReplyPacket.java b/libjava/gnu/classpath/jdwp/transport/JdwpReplyPacket.java
deleted file mode 100644
index de32ecf995b..00000000000
--- a/libjava/gnu/classpath/jdwp/transport/JdwpReplyPacket.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* JdwpReplyPacket.java -- JDWP reply packet
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.transport;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-/**
- * A class represents a JDWP reply packet.
- * This class adds an error code to the packet header information
- * in {@link gnu.classpath.transport.JdwpPacket} and adds additional
- * reply packet-specific processing.
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class JdwpReplyPacket extends JdwpPacket
-{
- /**
- * Error code
- */
- protected short _errorCode;
-
- // Minimum packet size [excluding super class] ( errorCode (2) )
- private static final int MINIMUM_LENGTH = 2;
-
- /**
- * Constructs a <code>JdwpReplyPacket</code>.
- */
- public JdwpReplyPacket ()
- {
- // Don't assign a packet id. This is called by JdwpPacket.fromBytes
- // which assigns a packet id. (Not that a VM would do that...)
- }
-
- /**
- * Constructs a <code>JdwpReplyPacket</code> with the
- * id from the given packet and error code
- *
- * @param pkt the packet whose id this packet will use
- * @param errorCode the error code
- */
- public JdwpReplyPacket (JdwpPacket pkt, short errorCode)
- {
- this(pkt);
- _errorCode = errorCode;
- }
-
- /**
- * Constructs a <code>JdwpReplyPacket</code> with the
- * id from the given packet and an empty error code
- *
- * @param pkt the packet whose id this packet will use
- */
- public JdwpReplyPacket (JdwpPacket pkt)
- {
- super (pkt);
- _flags = (byte) JDWP_FLAG_REPLY;
- }
-
- /**
- * Returns the length of this packet
- */
- public int getLength ()
- {
- return MINIMUM_LENGTH + super.getLength ();
- }
-
- /**
- * Returns the error code
- */
- public short getErrorCode ()
- {
- return _errorCode;
- }
-
- /**
- * Sets the error code
- */
- public void setErrorCode (short ec)
- {
- _errorCode = ec;
- }
-
- // Reads command packet data from the given buffer, starting
- // at the given offset
- protected int myFromBytes (byte[] bytes, int index)
- {
- int i = 0;
- setErrorCode ((short) ((bytes[index + i++] & 0xff) << 8
- | (bytes[index + i++] & 0xff)));
- return i;
- }
-
- // Writes the command packet data into the given buffer
- protected void myWrite (DataOutputStream dos)
- throws IOException
- {
- dos.writeShort (getErrorCode ());
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/transport/SocketTransport.java b/libjava/gnu/classpath/jdwp/transport/SocketTransport.java
deleted file mode 100644
index 0ad7357e183..00000000000
--- a/libjava/gnu/classpath/jdwp/transport/SocketTransport.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* SocketTransport.java -- a socket transport
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.transport;
-
-import gnu.classpath.jdwp.transport.ITransport;
-import gnu.classpath.jdwp.transport.TransportException;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.HashMap;
-
-import javax.net.ServerSocketFactory;
-import javax.net.SocketFactory;
-
-/**
- * A socket-based transport. This transport uses
- * configury string that looks like "name=dt_socket,
- * address=localhost:1234,server=y".
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-class SocketTransport
- implements ITransport
-{
- /**
- * Name of this transport
- */
- public static final String NAME = "dt_socket";
-
- // Configure properties
- private static final String _PROPERTY_ADDRESS = "address";
- private static final String _PROPERTY_SERVER = "server";
-
- // Port number
- private int _port;
-
- // Host name
- private String _host;
-
- // Are we acting as a server?
- private boolean _server = false;
-
- // Socket
- private Socket _socket;
-
- /**
- * Setup the connection configuration from the given properties
- *
- * @param properties the properties of the JDWP session
- * @throws TransportException for any configury errors
- */
- public void configure (HashMap properties)
- throws TransportException
- {
- // Get address [form: "hostname:port"]
- String p = (String) properties.get (_PROPERTY_ADDRESS);
- if (p != null)
- {
- String[] s = p.split (":");
- if (s.length == 2)
- {
- _host = s[0];
- _port = Integer.parseInt (s[1]);
- }
- }
-
- // Get server [form: "y" or "n"]
- p = (String) properties.get (_PROPERTY_SERVER);
- if (p != null)
- {
- if (p.toLowerCase().equals ("y"))
- _server = true;
- }
- }
-
- /**
- * Initialize this socket connection. This includes
- * connecting to the host (or listening for it).
- *
- * @throws TransportException if a transport-related error occurs
- */
- public void initialize ()
- throws TransportException
- {
- try
- {
- if (_server)
- {
- // Get a server socket
- ServerSocketFactory ssf = ServerSocketFactory.getDefault ();
- ServerSocket ss = ssf.createServerSocket (_port, 1);
- _socket = ss.accept ();
- }
- else
- {
- // Get a client socket (the factory will connect it)
- SocketFactory sf = SocketFactory.getDefault ();
- _socket = sf.createSocket (_host, _port);
- }
- }
- catch (IOException ioe)
- {
- // This will grab UnknownHostException, too.
- throw new TransportException (ioe);
- }
- }
-
- /**
- * Returns an <code>InputStream</code> for the transport
- *
- * @throws IOException if an I/O error occurs creating the stream
- * or the socket is not connected
- */
- public InputStream getInputStream ()
- throws IOException
- {
- return _socket.getInputStream ();
- }
-
- /**
- * Returns an <code>OutputStream</code> for the transport
- *
- * @throws IOException if an I/O error occurs creating the stream
- * or the socket is not connected
- */
- public OutputStream getOutputStream ()
- throws IOException
- {
- return _socket.getOutputStream ();
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/transport/TransportException.java b/libjava/gnu/classpath/jdwp/transport/TransportException.java
deleted file mode 100644
index 057422a879e..00000000000
--- a/libjava/gnu/classpath/jdwp/transport/TransportException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* TransportException.java -- Exception for transport configury errors
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.transport;
-
-/**
- * A transport configury or initialization exception thrown by
- * JDWP transports. This class is a generic exception class
- * that the different transport layers use to report transport-specific
- * exceptions that may occur (which could be very different from
- * one transport to the next.).
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class TransportException
- extends Exception
-{
- /**
- * Constructs a <code>TransportException</code> with the
- * given message
- *
- * @param message a message describing the exception
- */
- public TransportException (String message)
- {
- super (message);
- }
-
- /**
- * Constructs a <code>TransportException</code> with the
- * given <code>Throwable</code> root cause
- *
- * @param t the cause of the exception
- */
- public TransportException (Throwable t)
- {
- super (t);
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/transport/TransportFactory.java b/libjava/gnu/classpath/jdwp/transport/TransportFactory.java
deleted file mode 100644
index 480fb362939..00000000000
--- a/libjava/gnu/classpath/jdwp/transport/TransportFactory.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* TransportFactory.java -- Factory for transports
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.transport;
-
-import java.util.HashMap;
-
-/**
- * A factory class that constructs transports for use by
- * the JDWP back-end.
- *
- * @author Keith Seitz <keiths@redhat.com>
- */
-public class TransportFactory
-{
- // Keyword in configspec that specifies transport method
- private static final String _TRANSPORT_PROPERTY = "transport";
-
- // A single transport method mapping
- private static class TransportMethod
- {
- String name;
- Class clazz;
- public TransportMethod (String name, Class clazz)
- {
- this.name = name;
- this.clazz = clazz;
- }
- }
-
- // List of all supported transport methods
- private static TransportMethod[] _transportMethods = new TransportMethod[]
- {
- new TransportMethod (SocketTransport.NAME, SocketTransport.class)
- //new TransportMethod (ShmemTransport.NAME, ShmemTransport.class)
- };
-
- /**
- * Get a transport configured as specified in the properties
- *
- * @param properties a <code>HashMap</code> specifying the JDWP
- * configuration properties
- * @returns the created and configured transport
- * @throws TransportException for invalid configurations
- */
- public static ITransport newInstance (HashMap properties)
- throws TransportException
- {
- String name = null;
- if (properties != null)
- name = (String) properties.get (_TRANSPORT_PROPERTY);
- if (name == null)
- throw new TransportException ("no transport specified");
-
- for (int i = 0; i < _transportMethods.length; ++i)
- {
- if (_transportMethods[i].name.equals (name))
- {
- try
- {
- ITransport t;
- t = (ITransport) _transportMethods[i].clazz.newInstance ();
- t.configure (properties);
- return t;
- }
- catch (TransportException te)
- {
- throw te;
- }
- catch (Exception e)
- {
- throw new TransportException (e);
- }
- }
- }
-
- throw new TransportException ("transport \"" + name + "\" not found");
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/util/JdwpString.java b/libjava/gnu/classpath/jdwp/util/JdwpString.java
deleted file mode 100644
index 592249fccb2..00000000000
--- a/libjava/gnu/classpath/jdwp/util/JdwpString.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* JdwpString.java -- utility class to read and write jdwp strings
- Copyright (C) 2005 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.classpath.jdwp.util;
-
-import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-
-/**
- * A class to compute the JDWP representation of Strings.
- *
- * @author Aaron Luchko <aluchko@redhat.com>
- */
-public class JdwpString
-{
-
- /**
- * Write this String to the outStream as a string understood by jdwp.
- *
- * @param os write the String here
- * @param string the String to write
- * @throws IOException
- */
- public static void writeString(DataOutputStream os, String string)
- throws IOException
- {
- // Get the bytes of the string as a string in UTF-8
- byte[] strBytes = string.getBytes("UTF-8");
- os.writeInt(strBytes.length);
- os.write(strBytes);
- }
-
- /**
- * Read a jdwp style string from the ByteBuffer.
- *
- * @param bb contains the string
- * @return the String that was read
- * @throws JdwpInternalErrorException bb didn't contain a value UTF-8 string
- */
- public static String readString(ByteBuffer bb)
- throws JdwpInternalErrorException
- {
- int length = bb.getInt();
- byte[] strBytes = new byte[length];
- bb.get(strBytes);
- try
- {
- return new String(strBytes, "UTF-8");
- }
- catch (UnsupportedEncodingException ex)
- {
- // Any string from the VM should be in UTF-8 so an encoding error
- // shouldn't be possible
- throw new JdwpInternalErrorException(ex);
- }
- }
-}
diff --git a/libjava/gnu/classpath/jdwp/util/Signature.java b/libjava/gnu/classpath/jdwp/util/Signature.java
deleted file mode 100644
index 36445c31841..00000000000
--- a/libjava/gnu/classpath/jdwp/util/Signature.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* Signature.java -- utility class to compute class and method signatures
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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
-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.classpath.jdwp.util;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-/**
- * A class to compute class and method signatures.
- *
- * @author Tom Tromey (tromey@redhat.com)
- * @author Keith Seitz (keiths@redhat.com)
- */
-public class Signature
-{
- /**
- * Computes the class signature, i.e., java.lang.String.class
- * returns "Ljava/lang/String;".
- *
- * @param theClass the class for which to compute the signature
- * @return the class's type signature
- */
- public static String computeClassSignature (Class theClass)
- {
- StringBuffer sb = new StringBuffer ();
- _addToSignature (sb, theClass);
- return sb.toString ();
- }
-
- /**
- * Computes the field signature which is just the class signature of the
- * field's type, ie a Field of type java.lang.String this will return
- * "Ljava/lang/String;".
- *
- * @param field the field for which to compute the signature
- * @return the field's type signature
- */
- public static String computeFieldSignature (Field field)
- {
- return computeClassSignature (field.getType());
- }
-
- /**
- * Computes the method signature, i.e., java.lang.String.split (String, int)
- * returns "(Ljava/lang/String;I)[Ljava/lang/String;"
- *
- * @param method the method for which to compute the signature
- * @return the method's type signature
- */
- public static String computeMethodSignature (Method method)
- {
- return _computeSignature (method.getReturnType (),
- method.getParameterTypes ());
- }
-
- private static String _computeSignature (Class returnType,
- Class[] paramTypes)
- {
- StringBuffer sb = new StringBuffer ("(");
- if (paramTypes != null)
- {
- for (int i = 0; i < paramTypes.length; ++i)
- _addToSignature (sb, paramTypes[i]);
- }
- sb.append (")");
- _addToSignature (sb, returnType);
- return sb.toString();
- }
-
- private static void _addToSignature (StringBuffer sb, Class k)
- {
- // For some reason there's no easy way to get the signature of a
- // class.
- if (k.isPrimitive ())
- {
- if (k == void.class)
- sb.append('V');
- else if (k == boolean.class)
- sb.append('Z');
- else if (k == byte.class)
- sb.append('B');
- else if (k == char.class)
- sb.append('C');
- else if (k == short.class)
- sb.append('S');
- else if (k == int.class)
- sb.append('I');
- else if (k == float.class)
- sb.append('F');
- else if (k == double.class)
- sb.append('D');
- else if (k == long.class)
- sb.append('J');
- return;
- }
-
- String name = k.getName ();
- int len = name.length ();
- sb.ensureCapacity (len);
- if (! k.isArray ())
- sb.append('L');
- for (int i = 0; i < len; ++i)
- {
- char c = name.charAt (i);
- if (c == '.')
- c = '/';
- sb.append (c);
- }
- if (! k.isArray ())
- sb.append(';');
- }
-}
diff --git a/libjava/gnu/java/awt/BitMaskExtent.java b/libjava/gnu/java/awt/BitMaskExtent.java
deleted file mode 100644
index 28134991099..00000000000
--- a/libjava/gnu/java/awt/BitMaskExtent.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * Simple transparent utility class that can be used to perform bit
- * mask extent calculations.
- */
-public final class BitMaskExtent
-{
- /** The number of the least significant bit of the bit mask extent. */
- public byte leastSignificantBit;
-
- /** The number of bits in the bit mask extent. */
- public byte bitWidth;
-
- /**
- * Set the bit mask. This will calculate and set the leastSignificantBit
- * and bitWidth fields.
- *
- * @see #leastSignificantBit
- * @see #bitWidth
- */
- public void setMask(long mask)
- {
- leastSignificantBit = 0;
- bitWidth = 0;
- if (mask == 0) return;
- long shiftMask = mask;
- for (; (shiftMask&1) == 0; shiftMask >>>=1) leastSignificantBit++;
- for (; (shiftMask&1) != 0; shiftMask >>>=1) bitWidth++;
-
- if (shiftMask != 0)
- throw new IllegalArgumentException("mask must be continuous");
- }
-
- /**
- * Calculate the bit mask based on the values of the
- * leastSignificantBit and bitWidth fields.
- */
- public long toMask()
- {
- return ((1<<bitWidth)-1) << leastSignificantBit;
- }
-}
diff --git a/libjava/gnu/java/awt/BitwiseXORComposite.java b/libjava/gnu/java/awt/BitwiseXORComposite.java
deleted file mode 100644
index b568e1108c1..00000000000
--- a/libjava/gnu/java/awt/BitwiseXORComposite.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/* BitwiseXORComposite.java -- Composite for emulating old-style XOR.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-import java.awt.Color;
-import java.awt.Composite;
-import java.awt.CompositeContext;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
-import java.awt.image.ColorModel;
-import java.awt.image.DataBuffer;
-import java.awt.image.Raster;
-import java.awt.image.WritableRaster;
-
-
-/**
- * A composite for emulating traditional bitwise XOR of pixel values.
- * Please note that this composite does <i>not</i> implement the Porter-Duff
- * XOR operator, but an exclusive or of overlapping subpixel regions.
- *
- * <p><img src="doc-files/BitwiseXORComposite-1.png" width="545"
- * height="138" alt="A screen shot of BitwiseXORComposite in action"
- * />
- *
- * <p>The above screen shot shows the result of applying six different
- * BitwiseXORComposites. They were constructed with the colors colors
- * white, blue, black, orange, green, and brown, respectively. Each
- * composite was used to paint a fully white rectangle on top of the
- * blue bar in the background.
- *
- * <p>The purpose of this composite is to support the {@link
- * Graphics#setXORMode(Color)} method in composite-aware graphics
- * implementations. Applications typically would use
- * <code>setXORMode</code> for drawing &#x201c;highlights&#x201d; such
- * as text selections or cursors by inverting colors temporarily and
- * then inverting them back.
- *
- * <p>A concrete <code>Graphics</code> implementation may contain
- * the following code:
- *
- * <p><pre> public void setXORMode(Color xorColor)
- * {
- * setComposite(new gnu.java.awt.BitwiseXORComposite(xorColor));
- * }
- *
- * public void setPaintMode()
- * {
- * setComposite(java.awt.AlphaComposite.SrcOver);
- * }</pre>
- *
- * @author Graydon Hoare (graydon@redhat.com)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class BitwiseXORComposite
- implements Composite
-{
- /**
- * The color whose RGB value is xor-ed with the values of each
- * pixel.
- */
- protected Color xorColor;
-
-
- /**
- * Constructs a new composite for xor-ing the pixel value.
- *
- * @param xorColor the color whose pixel value will be bitwise
- * xor-ed with the source and destination pixels.
- */
- public BitwiseXORComposite(Color xorColor)
- {
- this.xorColor = xorColor;
- }
-
-
- /**
- * Creates a context object for performing the compositing
- * operation. Several contexts may co-exist for one composite; each
- * context may simultaneously be called from concurrent threads.
- *
- * @param srcColorModel the color model of the source.
- * @param dstColorModel the color model of the destination.
- * @param hints hints for choosing between rendering alternatives.
- */
- public CompositeContext createContext(ColorModel srcColorModel,
- ColorModel dstColorModel,
- RenderingHints hints)
- {
- if (IntContext.isSupported(srcColorModel, dstColorModel, hints))
- return new IntContext(srcColorModel, xorColor);
-
- return new GeneralContext(srcColorModel, dstColorModel, xorColor);
- }
-
-
- /**
- * A fallback CompositeContext that performs bitwise XOR of pixel
- * values with the pixel value of the specified <code>xorColor</code>.
- *
- * <p>Applying this CompositeContext on a 1024x1024 BufferedImage of
- * <code>TYPE_INT_RGB</code> took 611 ms on a lightly loaded 2.4 GHz
- * Intel Pentium 4 CPU running Sun J2SE 1.4.1_01 on GNU/Linux
- * 2.4.20. The timing is the average of ten runs on the same
- * BufferedImage. Since the measurements were taken with {@link
- * System#currentTimeMillis()}, they are rather inaccurate.
- *
- * @author Graydon Hoare (graydon@redhat.com)
- */
- private static class GeneralContext
- implements CompositeContext
- {
- ColorModel srcColorModel;
- ColorModel dstColorModel;
- Color xorColor;
-
- public GeneralContext(ColorModel srcColorModel,
- ColorModel dstColorModel,
- Color xorColor)
- {
- this.srcColorModel = srcColorModel;
- this.dstColorModel = dstColorModel;
- this.xorColor = xorColor;
- }
-
-
- public void compose(Raster src, Raster dstIn, WritableRaster dstOut)
- {
- Rectangle srcRect = src.getBounds();
- Rectangle dstInRect = dstIn.getBounds();
- Rectangle dstOutRect = dstOut.getBounds();
-
- int xp = xorColor.getRGB();
- int w = Math.min(Math.min(srcRect.width, dstOutRect.width),
- dstInRect.width);
- int h = Math.min(Math.min(srcRect.height, dstOutRect.height),
- dstInRect.height);
-
- Object srcPix = null, dstPix = null, rpPix = null;
-
- // Re-using the rpPix object saved 1-2% of execution time in
- // the 1024x1024 pixel benchmark.
-
- for (int y = 0; y < h; y++)
- {
- for (int x = 0; x < w; x++)
- {
- srcPix = src.getDataElements(x + srcRect.x, y + srcRect.y, srcPix);
- dstPix = dstIn.getDataElements(x + dstInRect.x, y + dstInRect.y,
- dstPix);
- int sp = srcColorModel.getRGB(srcPix);
- int dp = dstColorModel.getRGB(dstPix);
- int rp = sp ^ xp ^ dp;
- dstOut.setDataElements(x + dstOutRect.x, y + dstOutRect.y,
- dstColorModel.getDataElements(rp, rpPix));
- }
- }
- }
-
-
- /**
- * Disposes any cached resources. The default implementation does
- * nothing because no resources are cached.
- */
- public void dispose()
- {
- }
- }
-
-
- /**
- * An optimized CompositeContext that performs bitwise XOR of
- * <code>int</code> pixel values with the pixel value of a specified
- * <code>xorColor</code>. This CompositeContext working only for
- * rasters whose transfer format is {@link DataBuffer#TYPE_INT}.
- *
- * <p>Applying this CompositeContext on a 1024x1024 BufferedImage of
- * <code>TYPE_INT_RGB</code> took 69 ms on a lightly loaded 2.4 GHz
- * Intel Pentium 4 CPU running Sun J2SE 1.4.1_01 on GNU/Linux
- * 2.4.20. The timing is the average of ten runs on the same
- * BufferedImage. Since the measurements were taken with {@link
- * System#currentTimeMillis()}, they are rather inaccurate.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- private static class IntContext
- extends GeneralContext
- {
- public IntContext(ColorModel colorModel, Color xorColor)
- {
- super(colorModel, colorModel, xorColor);
- }
-
-
- public void compose(Raster src, Raster dstIn,
- WritableRaster dstOut)
- {
- int aX, bX, dstX, aY, bY, dstY, width, height;
- int xorPixel;
- int[] srcLine, dstLine;
-
- aX = src.getMinX();
- aY = src.getMinY();
- bX = dstIn.getMinX();
- bY = dstIn.getMinY();
- dstX = dstOut.getMinX();
- dstY = dstOut.getMinY();
- width = Math.min(Math.min(src.getWidth(), dstIn.getWidth()),
- dstOut.getWidth());
- height = Math.min(Math.min(src.getHeight(), dstIn.getHeight()),
- dstOut.getHeight());
- if ((width < 1) || (height < 1))
- return;
-
- srcLine = new int[width];
- dstLine = new int[width];
-
- /* We need an int[] array with at least one element here;
- * srcLine is as good as any other.
- */
- srcColorModel.getDataElements(this.xorColor.getRGB(), srcLine);
- xorPixel = srcLine[0];
-
- for (int y = 0; y < height; y++)
- {
- src.getDataElements(aX, y + aY, width, 1, srcLine);
- dstIn.getDataElements(bX, y + bY, width, 1, dstLine);
-
- for (int x = 0; x < width; x++)
- dstLine[x] ^= srcLine[x] ^ xorPixel;
-
- dstOut.setDataElements(dstX, y + dstY, width, 1, dstLine);
- }
- }
-
-
- /**
- * Determines whether an instance of this CompositeContext would
- * be able to process the specified color models.
- */
- public static boolean isSupported(ColorModel srcColorModel,
- ColorModel dstColorModel,
- RenderingHints hints)
- {
- // FIXME: It would be good if someone could review these checks.
- // They probably need to be more restrictive.
-
- int transferType;
-
- transferType = srcColorModel.getTransferType();
- if (transferType != dstColorModel.getTransferType())
- return false;
-
- if (transferType != DataBuffer.TYPE_INT)
- return false;
-
- return true;
- }
- }
-}
diff --git a/libjava/gnu/java/awt/Buffers.java b/libjava/gnu/java/awt/Buffers.java
deleted file mode 100644
index c6ccf919145..00000000000
--- a/libjava/gnu/java/awt/Buffers.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/* Buffers.java --
- Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-import java.awt.image.DataBuffer;
-import java.awt.image.DataBufferByte;
-import java.awt.image.DataBufferDouble;
-import java.awt.image.DataBufferFloat;
-import java.awt.image.DataBufferInt;
-import java.awt.image.DataBufferShort;
-import java.awt.image.DataBufferUShort;
-
-/**
- * Utility class for creating and accessing data buffers of arbitrary
- * data types.
- */
-public final class Buffers
-{
- /**
- * Create a data buffer of a particular type.
- *
- * @param dataType the desired data type of the buffer.
- * @param data an array containing data, or null
- * @param size the size of the data buffer bank
- */
- public static DataBuffer createBuffer(int dataType, Object data,
- int size)
- {
- if (data == null) return createBuffer(dataType, size, 1);
-
- return createBufferFromData(dataType, data, size);
- }
-
-
- /**
- * Create a data buffer of a particular type.
- *
- * @param dataType the desired data type of the buffer.
- * @param size the size of the data buffer bank
- */
- public static DataBuffer createBuffer(int dataType, int size) {
- return createBuffer(dataType, size, 1);
- }
-
- /**
- * Create a data buffer of a particular type.
- *
- * @param dataType the desired data type of the buffer.
- * @param size the size of the data buffer bank
- * @param numBanks the number of banks the buffer should have
- */
- public static DataBuffer createBuffer(int dataType, int size, int numBanks)
- {
- switch (dataType)
- {
- case DataBuffer.TYPE_BYTE:
- return new DataBufferByte(size, numBanks);
- case DataBuffer.TYPE_SHORT:
- return new DataBufferShort(size, numBanks);
- case DataBuffer.TYPE_USHORT:
- return new DataBufferUShort(size, numBanks);
- case DataBuffer.TYPE_INT:
- return new DataBufferInt(size, numBanks);
- case DataBuffer.TYPE_FLOAT:
- return new DataBufferFloat(size, numBanks);
- case DataBuffer.TYPE_DOUBLE:
- return new DataBufferDouble(size, numBanks);
- default:
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * Create a data buffer of a particular type.
- *
- * @param dataType the desired data type of the buffer
- * @param data an array containing the data
- * @param size the size of the data buffer bank
- */
- public static DataBuffer createBufferFromData(int dataType, Object data,
- int size)
- {
- switch (dataType)
- {
- case DataBuffer.TYPE_BYTE:
- return new DataBufferByte((byte[]) data, size);
- case DataBuffer.TYPE_SHORT:
- return new DataBufferShort((short[]) data, size);
- case DataBuffer.TYPE_USHORT:
- return new DataBufferUShort((short[]) data, size);
- case DataBuffer.TYPE_INT:
- return new DataBufferInt((int[]) data, size);
- case DataBuffer.TYPE_FLOAT:
- return new DataBufferFloat((float[]) data, size);
- case DataBuffer.TYPE_DOUBLE:
- return new DataBufferDouble((double[]) data, size);
- default:
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * Return the data array of a data buffer, regardless of the data
- * type.
- *
- * @return an array of primitive values. The actual array type
- * depends on the data type of the buffer.
- */
- public static Object getData(DataBuffer buffer)
- {
- if (buffer instanceof DataBufferByte)
- return ((DataBufferByte) buffer).getData();
-
- if (buffer instanceof DataBufferShort)
- return ((DataBufferShort) buffer).getData();
-
- if (buffer instanceof DataBufferUShort)
- return ((DataBufferUShort) buffer).getData();
-
- if (buffer instanceof DataBufferInt)
- return ((DataBufferInt) buffer).getData();
-
- if (buffer instanceof DataBufferFloat)
- return ((DataBufferFloat) buffer).getData();
-
- if (buffer instanceof DataBufferDouble)
- return ((DataBufferDouble) buffer).getData();
-
- throw new ClassCastException("Unknown data buffer type");
- }
-
-
- /**
- * Copy data from array contained in data buffer, much like
- * System.arraycopy. Create a suitable destination array if the
- * given destination array is null.
- */
- public static Object getData(DataBuffer src, int srcOffset,
- Object dest, int destOffset,
- int length)
- {
- Object from;
- if (src instanceof DataBufferByte)
- {
- from = ((DataBufferByte) src).getData();
- if (dest == null) dest = new byte[length+destOffset];
- }
- else if (src instanceof DataBufferShort)
- {
- from = ((DataBufferShort) src).getData();
- if (dest == null) dest = new short[length+destOffset];
- }
- else if (src instanceof DataBufferUShort)
- {
- from = ((DataBufferUShort) src).getData();
- if (dest == null) dest = new short[length+destOffset];
- }
- else if (src instanceof DataBufferInt)
- {
- from = ((DataBufferInt) src).getData();
- if (dest == null) dest = new int[length+destOffset];
- }
- else if (src instanceof DataBufferFloat)
- {
- from = ((DataBufferFloat) src).getData();
- if (dest == null) dest = new float[length+destOffset];
- }
- else if (src instanceof DataBufferDouble)
- {
- from = ((DataBufferDouble) src).getData();
- if (dest == null) dest = new double[length+destOffset];
- }
- else
- {
- throw new ClassCastException("Unknown data buffer type");
- }
-
- System.arraycopy(from, srcOffset, dest, destOffset, length);
- return dest;
- }
-
- /**
- * @param bits the width of a data element measured in bits
- *
- * @return the smallest data type that can store data elements of
- * the given number of bits, without any truncation.
- */
- public static int smallestAppropriateTransferType(int bits)
- {
- if (bits <= 8)
- {
- return DataBuffer.TYPE_BYTE;
- }
- else if (bits <= 16)
- {
- return DataBuffer.TYPE_USHORT;
- }
- else if (bits <= 32)
- {
- return DataBuffer.TYPE_INT;
- }
- else
- {
- return DataBuffer.TYPE_UNDEFINED;
- }
- }
-}
diff --git a/libjava/gnu/java/awt/ClasspathToolkit.java b/libjava/gnu/java/awt/ClasspathToolkit.java
deleted file mode 100644
index d42bfc08221..00000000000
--- a/libjava/gnu/java/awt/ClasspathToolkit.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/* ClasspathToolkit.java -- Abstract superclass for Classpath toolkits.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-import gnu.java.awt.peer.ClasspathFontPeer;
-import gnu.java.awt.peer.ClasspathTextLayoutPeer;
-
-import java.awt.AWTException;
-import java.awt.Dimension;
-import java.awt.DisplayMode;
-import java.awt.EventQueue;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.awt.Image;
-import java.awt.Toolkit;
-import java.awt.font.FontRenderContext;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageProducer;
-import java.awt.peer.RobotPeer;
-import java.io.File;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.AttributedString;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.imageio.spi.IIORegistry;
-
-/**
- * An abstract superclass for Classpath toolkits.
- *
- * <p>There exist some parts of AWT and Java2D that are specific to
- * the underlying platform, but for which the {@link Toolkit} class
- * does not provide suitable abstractions. Examples include some
- * methods of {@link Font} or {@link GraphicsEnvironment}. Those
- * methods use ClasspathToolkit as a central place for obtaining
- * platform-specific functionality.
- *
- * <p>In addition, ClasspathToolkit implements some abstract methods
- * of {@link java.awt.Toolkit} that are not really platform-specific,
- * such as the maintenance of a cache of loaded images.
- *
- * <p><b>Thread Safety:</b> The methods of this class may safely be
- * called without external synchronization. This also hold for any
- * inherited {@link Toolkit} methods. Subclasses are responsible for
- * the necessary synchronization.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ClasspathToolkit
- extends Toolkit
-{
- /**
- * A map from URLs to previously loaded images, used by {@link
- * #getImage(java.net.URL)}. For images that were loaded via a path
- * to an image file, the map contains a key with a file URL.
- */
- private HashMap imageCache;
-
-
- /**
- * Returns a shared instance of the local, platform-specific
- * graphics environment.
- *
- * <p>This method is specific to GNU Classpath. It gets called by
- * the Classpath implementation of {@link
- * GraphicsEnvironment.getLocalGraphcisEnvironment()}.
- */
- public abstract GraphicsEnvironment getLocalGraphicsEnvironment();
-
-
- /**
- * Determines the current size of the default, primary screen.
- *
- * @throws HeadlessException if the local graphics environment is
- * headless, which means that no screen is attached and no user
- * interaction is allowed.
- */
- public Dimension getScreenSize()
- {
- DisplayMode mode;
-
- // getDefaultScreenDevice throws HeadlessException if the
- // local graphics environment is headless.
- mode = GraphicsEnvironment.getLocalGraphicsEnvironment()
- .getDefaultScreenDevice().getDisplayMode();
-
- return new Dimension(mode.getWidth(), mode.getHeight());
- }
-
-
- /**
- * Determines the current color model of the default, primary
- * screen.
- *
- * @see GraphicsEnvironment#getDefaultScreenDevice()
- * @see java.awt.GraphicsDevice#getDefaultConfiguration()
- * @see java.awt.GraphicsConfiguration#getColorModel()
- *
- * @throws HeadlessException if the local graphics environment is
- * headless, which means that no screen is attached and no user
- * interaction is allowed.
- */
- public ColorModel getColorModel()
- {
- // getDefaultScreenDevice throws HeadlessException if the
- // local graphics environment is headless.
- return GraphicsEnvironment.getLocalGraphicsEnvironment()
- .getDefaultScreenDevice().getDefaultConfiguration()
- .getColorModel();
- }
-
- /**
- * Retrieves the metrics for rendering a font on the screen.
- *
- * @param font the font whose metrics are requested.
- */
- public FontMetrics getFontMetrics(Font font)
- {
- return ((ClasspathFontPeer) font.getPeer ()).getFontMetrics (font);
- }
-
-
- /**
- * Acquires an appropriate {@link ClasspathFontPeer}, for use in
- * classpath's implementation of {@link java.awt.Font}.
- *
- * @param name The logical name of the font. This may be either a face
- * name or a logical font name, or may even be null. A default
- * implementation of name decoding is provided in
- * {@link ClasspathFontPeer}, but may be overridden in other toolkits.
- *
- * @param attrs Any extra {@link java.awt.font.TextAttribute} attributes
- * this font peer should have, such as size, weight, family name, or
- * transformation.
- */
- public abstract ClasspathFontPeer getClasspathFontPeer (String name, Map attrs);
-
- public abstract ClasspathTextLayoutPeer
- getClasspathTextLayoutPeer (AttributedString str, FontRenderContext frc);
-
-
- /**
- * Creates a {@link Font}, in a platform-specific manner.
- *
- * The default implementation simply constructs a {@link Font}, but some
- * toolkits may wish to override this, to return {@link Font} subclasses which
- * implement {@link java.awt.font.OpenType} or
- * {@link java.awt.font.MultipleMaster}.
- */
- public Font getFont (String name, Map attrs)
- {
- return new Font (name, attrs);
- }
-
-
- /**
- * Creates a font, reading the glyph definitions from a stream.
- *
- * <p>This method provides the platform-specific implementation for
- * the static factory method {@link Font#createFont(int,
- * java.io.InputStream)}.
- *
- * @param format the format of the font data, such as {@link
- * Font#TRUETYPE_FONT}. An implementation may ignore this argument
- * if it is able to automatically recognize the font format from the
- * provided data.
- *
- * @param stream an input stream from where the font data is read
- * in. The stream will be advanced to the position after the font
- * data, but not closed.
- *
- * @throws IllegalArgumentException if <code>format</code> is
- * not supported.
- *
- * @throws FontFormatException if <code>stream</code> does not
- * contain data in the expected format, or if required tables are
- * missing from a font.
- *
- * @throws IOException if a problem occurs while reading in the
- * contents of <code>stream</code>.
- */
- public abstract Font createFont(int format, InputStream stream);
-
-
- /**
- * Returns an image from the specified file, which must be in a
- * recognized format. The set of recognized image formats may vary
- * from toolkit to toolkit.
- *
- * <p>This method maintains a cache for images. If an image has been
- * loaded from the same path before, the cached copy will be
- * returned. The implementation may hold cached copies for an
- * indefinite time, which can consume substantial resources with
- * large images. Users are therefore advised to use {@link
- * #createImage(java.lang.String)} instead.
- *
- * <p>The default implementation creates a file URL for the
- * specified path and invokes {@link #getImage(URL)}.
- *
- * @param path A path to the image file.
- *
- * @return IllegalArgumentException if <code>path</code> does not
- * designate a valid path.
- */
- public Image getImage(String path)
- {
- try
- {
- return getImage(new File(path).toURL());
- }
- catch (MalformedURLException muex)
- {
- throw (IllegalArgumentException) new IllegalArgumentException(path)
- .initCause(muex);
- }
- }
-
-
- /**
- * Loads an image from the specified URL. The image data must be in
- * a recognized format. The set of recognized image formats may vary
- * from toolkit to toolkit.
- *
- * <p>This method maintains a cache for images. If an image has been
- * loaded from the same URL before, the cached copy will be
- * returned. The implementation may hold cached copies for an
- * indefinite time, which can consume substantial resources with
- * large images. Users are therefore advised to use {@link
- * #createImage(java.net.URL)} instead.
- *
- * @param url the URL from where the image is read.
- */
- public Image getImage(URL url)
- {
- Image result;
-
- synchronized (this)
- {
- // Many applications never call getImage. Therefore, we lazily
- // create the image cache when it is actually needed.
- if (imageCache == null)
- imageCache = new HashMap();
- else
- {
- result = (Image) imageCache.get(url);
- if (result != null)
- return result;
- }
-
- // The createImage(URL) method, which is specified by
- // java.awt.Toolkit, is not implemented by this abstract class
- // because it is platform-dependent. Once Classpath has support
- // for the javax.imageio package, it might be worth considering
- // that toolkits provide native stream readers. Then, the class
- // ClasspathToolkit could provide a general implementation that
- // delegates the image format parsing to javax.imageio.
- result = createImage(url);
-
- // It is not clear whether it would be a good idea to use weak
- // references here. The advantage would be reduced memory
- // consumption, since loaded images would not be kept
- // forever. But on VMs that frequently perform garbage
- // collection (which includes VMs with a parallel or incremental
- // collector), the image might frequently need to be re-loaded,
- // possibly over a slow network connection.
- imageCache.put(url, result);
-
- return result;
- }
- }
-
-
- /**
- * Returns an image from the specified file, which must be in a
- * recognized format. The set of recognized image formats may vary
- * from toolkit to toolkit.
- *
- * <p>A new image is created every time this method gets called,
- * even if the same path has been passed before.
- *
- * <p>The default implementation creates a file URL for the
- * specified path and invokes {@link #createImage(URL)}.
- *
- * @param path A path to the file to be read in.
- */
- public Image createImage(String path)
- {
- try
- {
- // The abstract method createImage(URL) is defined by
- // java.awt.Toolkit, but intentionally not implemented by
- // ClasspathToolkit because it is platform specific.
- return createImage(new File(path).toURL());
- }
- catch (MalformedURLException muex)
- {
- throw (IllegalArgumentException) new IllegalArgumentException(path)
- .initCause(muex);
- }
- }
-
- /**
- * Creates an ImageProducer from the specified URL. The image is assumed
- * to be in a recognised format. If the toolkit does not implement the
- * image format or the image format is not recognised, null is returned.
- * This default implementation is overriden by the Toolkit implementations.
- *
- * @param url URL to read image data from.
- */
- public ImageProducer createImageProducer(URL url)
- {
- return null;
- }
-
- public abstract RobotPeer createRobot (GraphicsDevice screen)
- throws AWTException;
-
- /**
- * Used to register ImageIO SPIs provided by the toolkit.
- */
-
- public void registerImageIOSpis(IIORegistry reg)
- {
- }
-
- public abstract boolean nativeQueueEmpty();
- public abstract void wakeNativeQueue();
- public abstract void iterateNativeQueue(EventQueue locked, boolean block);
-}
diff --git a/libjava/gnu/java/awt/ComponentDataBlitOp.java b/libjava/gnu/java/awt/ComponentDataBlitOp.java
deleted file mode 100644
index 545427ea767..00000000000
--- a/libjava/gnu/java/awt/ComponentDataBlitOp.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-import java.awt.RenderingHints;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.ComponentSampleModel;
-import java.awt.image.DataBuffer;
-import java.awt.image.Raster;
-import java.awt.image.RasterOp;
-import java.awt.image.WritableRaster;
-
-/**
- * This raster copy operation assumes that both source and destination
- * sample models are tightly pixel packed and contain the same number
- * of bands.
- *
- * @throws java.lang.ClassCastException if the sample models of the
- * rasters are not of type ComponentSampleModel.
- *
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public class ComponentDataBlitOp implements RasterOp
-{
- public static final ComponentDataBlitOp INSTANCE = new ComponentDataBlitOp();
-
- public WritableRaster filter(Raster src, WritableRaster dest)
- {
- if (dest == null)
- dest = createCompatibleDestRaster(src);
-
- DataBuffer srcDB = src.getDataBuffer();
- DataBuffer destDB = dest.getDataBuffer();
-
- ComponentSampleModel srcSM = (ComponentSampleModel) src.getSampleModel();
- ComponentSampleModel destSM = (ComponentSampleModel) dest.getSampleModel();
-
-
- // Calculate offset to data in the underlying arrays:
-
- int srcScanlineStride = srcSM.getScanlineStride();
- int destScanlineStride = destSM.getScanlineStride();
- int srcX = src.getMinX() - src.getSampleModelTranslateX();
- int srcY = src.getMinY() - src.getSampleModelTranslateY();
- int destX = dest.getMinX() - dest.getSampleModelTranslateX();
- int destY = dest.getMinY() - dest.getSampleModelTranslateY();
-
- int numBands = srcSM.getNumBands();
-
- /* We can't use getOffset(x, y) from the sample model since we
- don't want the band offset added in. */
-
- int srcOffset =
- numBands*srcX + srcScanlineStride*srcY + // from sample model
- srcDB.getOffset(); // from data buffer
-
- int destOffset =
- numBands*destX + destScanlineStride*destY + // from sample model
- destDB.getOffset(); // from data buffer
-
- // Determine how much, and how many times to blit.
-
- int rowSize = src.getWidth()*numBands;
- int h = src.getHeight();
-
- if ((rowSize == srcScanlineStride) &&
- (rowSize == destScanlineStride))
- {
- // collapse scan line blits to one large blit.
- rowSize *= h;
- h = 1;
- }
-
-
- // Do blitting
-
- Object srcArray = Buffers.getData(srcDB);
- Object destArray = Buffers.getData(destDB);
-
- for (int yd = 0; yd<h; yd++)
- {
- System.arraycopy(srcArray, srcOffset,
- destArray, destOffset,
- rowSize);
- srcOffset += srcScanlineStride;
- destOffset += destScanlineStride;
- }
-
-
- return dest;
- }
-
- public Rectangle2D getBounds2D(Raster src)
- {
- return src.getBounds();
- }
-
- public WritableRaster createCompatibleDestRaster(Raster src) {
-
- /* FIXME: Maybe we should explicitly create a raster with a
- tightly pixel packed sample model, rather than assuming
- that the createCompatibleWritableRaster() method in Raster
- will create one. */
-
- return src.createCompatibleWritableRaster();
- }
-
- public Point2D getPoint2D(Point2D srcPoint, Point2D destPoint)
- {
- if (destPoint == null)
- return (Point2D) srcPoint.clone();
-
- destPoint.setLocation(srcPoint);
- return destPoint;
- }
-
- public RenderingHints getRenderingHints()
- {
- throw new UnsupportedOperationException("not implemented");
- }
-}
diff --git a/libjava/gnu/java/awt/EmbeddedWindow.java b/libjava/gnu/java/awt/EmbeddedWindow.java
deleted file mode 100644
index 2cf4316a42d..00000000000
--- a/libjava/gnu/java/awt/EmbeddedWindow.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/* EmbeddedWindow.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-import gnu.java.awt.peer.EmbeddedWindowPeer;
-import gnu.java.security.action.SetAccessibleAction;
-
-import java.awt.Component;
-import java.awt.Frame;
-import java.awt.Toolkit;
-import java.lang.reflect.Field;
-import java.security.AccessController;
-
-/**
- * Represents an AWT window that can be embedded into another
- * application.
- *
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class EmbeddedWindow extends Frame
-{
- private long handle;
-
- /**
- * Creates a window to be embedded into another application. The
- * window will only be embedded after its setHandle method has been
- * called.
- */
- public EmbeddedWindow ()
- {
- super();
- this.handle = 0;
- }
-
- /**
- * Creates a window to be embedded into another application.
- *
- * @param handle the native handle to the screen area where the AWT
- * window should be embedded
- */
- public EmbeddedWindow (long handle)
- {
- super();
- this.handle = handle;
- }
-
- /**
- * Creates the native peer for this embedded window.
- */
- public void addNotify()
- {
- Toolkit tk = getToolkit();
-
- if (! (tk instanceof EmbeddedWindowSupport))
- throw new UnsupportedOperationException
- ("Embedded windows are not supported by the current peers: "
- + tk.getClass());
-
- // Circumvent the package-privateness of the AWT internal
- // java.awt.Component.peer member variable.
- try
- {
- Field peerField = Component.class.getDeclaredField("peer");
- AccessController.doPrivileged(new SetAccessibleAction(peerField));
- peerField.set(this, ((EmbeddedWindowSupport) tk).createEmbeddedWindow (this));
- }
- catch (IllegalAccessException e)
- {
- // This should never happen.
- }
- catch (NoSuchFieldException e)
- {
- // This should never happen.
- }
-
- super.addNotify();
- }
-
- /**
- * If the native peer for this embedded window has been created,
- * then setHandle will embed the window. If not, setHandle tells
- * us where to embed ourselves when our peer is created.
- *
- * @param handle the native handle to the screen area where the AWT
- * window should be embedded
- */
- public void setHandle(long handle)
- {
- if (this.handle != 0)
- throw new RuntimeException ("EmbeddedWindow is already embedded");
-
- this.handle = handle;
- if (getPeer() != null)
- ((EmbeddedWindowPeer) getPeer()).embed (this.handle);
- }
-
- /**
- * Gets the native handle of the screen area where the window will
- * be embedded.
- *
- * @return The native handle that was passed to the constructor.
- */
- public long getHandle()
- {
- return handle;
- }
-}
diff --git a/libjava/gnu/java/awt/EmbeddedWindowSupport.java b/libjava/gnu/java/awt/EmbeddedWindowSupport.java
deleted file mode 100644
index 566f0949eb2..00000000000
--- a/libjava/gnu/java/awt/EmbeddedWindowSupport.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* EmbeddedWindowSupport.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-import gnu.java.awt.peer.EmbeddedWindowPeer;
-
-/**
- * Declares a method for creating native embedded window peers.
- *
- * All classes inherited from java.awt.Toolkit that implement this
- * interface are assumed to support the creation of embedded window
- * peers. To create an embedded window, use
- * gnu.java.awt.EmbeddedWindow.
- *
- * @see gnu.java.awt.EmbeddedWindow
- * @see java.awt.Toolkit
- *
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface EmbeddedWindowSupport
-{
- /**
- * Creates an embedded window peer, and associates it with an
- * EmbeddedWindow object.
- *
- * @param w The embedded window with which to associate a peer.
- */
- EmbeddedWindowPeer createEmbeddedWindow (EmbeddedWindow w);
-}
diff --git a/libjava/gnu/java/awt/EventModifier.java b/libjava/gnu/java/awt/EventModifier.java
deleted file mode 100644
index 565fcbc3297..00000000000
--- a/libjava/gnu/java/awt/EventModifier.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* EventModifier.java -- tool for converting modifier bits to 1.4 syle
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-import java.awt.event.InputEvent;
-
-public class EventModifier
-{
- /** The mask for old events. */
- public static final int OLD_MASK = 0x3f;
-
- /** The mask for new events. */
- public static final int NEW_MASK = 0x3fc0;
-
- /**
- * Non-instantiable.
- */
- private EventModifier()
- {
- throw new InternalError();
- }
-
- /**
- * Converts the old style modifiers (0x3f) to the new style (0xffffffc0).
- *
- * @param mod the modifiers to convert
- * @return the adjusted modifiers
- */
- public static int extend(int mod)
- {
- // Favor what we hope will be the common case.
- if ((mod & OLD_MASK) == 0)
- return mod;
- if ((mod & InputEvent.SHIFT_MASK) != 0)
- mod |= InputEvent.SHIFT_DOWN_MASK;
- if ((mod & InputEvent.CTRL_MASK) != 0)
- mod |= InputEvent.CTRL_DOWN_MASK;
- if ((mod & InputEvent.META_MASK) != 0)
- mod |= InputEvent.META_DOWN_MASK;
- if ((mod & InputEvent.ALT_MASK) != 0)
- mod |= InputEvent.ALT_DOWN_MASK;
- if ((mod & InputEvent.BUTTON1_MASK) != 0)
- mod |= InputEvent.BUTTON1_DOWN_MASK;
- if ((mod & InputEvent.ALT_GRAPH_MASK) != 0)
- mod |= InputEvent.ALT_GRAPH_DOWN_MASK;
- return mod & ~OLD_MASK;
- }
-
- /**
- * Converts the new style modifiers (0xffffffc0) to the old style (0x3f).
- *
- * @param mod the modifiers to convert
- * @return the adjusted modifiers
- */
- public static int revert(int mod)
- {
- if ((mod & InputEvent.SHIFT_DOWN_MASK) != 0)
- mod |= InputEvent.SHIFT_MASK;
- if ((mod & InputEvent.CTRL_DOWN_MASK) != 0)
- mod |= InputEvent.CTRL_MASK;
- if ((mod & InputEvent.META_DOWN_MASK) != 0)
- mod |= InputEvent.META_MASK;
- if ((mod & InputEvent.ALT_DOWN_MASK) != 0)
- mod |= InputEvent.ALT_MASK;
- if ((mod & InputEvent.ALT_GRAPH_DOWN_MASK) != 0)
- mod |= InputEvent.ALT_GRAPH_MASK;
- if ((mod & InputEvent.BUTTON1_DOWN_MASK) != 0)
- mod |= InputEvent.BUTTON1_MASK;
- return mod & OLD_MASK;
- }
-} // class EventModifier
diff --git a/libjava/gnu/java/awt/color/CieXyzConverter.java b/libjava/gnu/java/awt/color/CieXyzConverter.java
deleted file mode 100644
index 1742805854d..00000000000
--- a/libjava/gnu/java/awt/color/CieXyzConverter.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* CieXyzConverter.java -- CieXyz conversion class
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-
-/**
- * CieXyzConverter - converts to/from a D50-relative CIE XYZ color space.
- *
- * The sRGB<->CIE XYZ conversions in SrgbConverter are used.
- *
- * @author Sven de Marothy
- */
-public class CieXyzConverter implements ColorSpaceConverter
-{
- public float[] toCIEXYZ(float[] in)
- {
- float[] out = new float[3];
- System.arraycopy(in, 0, out, 0, 3);
- return out;
- }
-
- public float[] fromCIEXYZ(float[] in)
- {
- float[] out = new float[3];
- System.arraycopy(in, 0, out, 0, 3);
- return out;
- }
-
- public float[] toRGB(float[] in)
- {
- return SrgbConverter.XYZtoRGB(in);
- }
-
- public float[] fromRGB(float[] in)
- {
- return SrgbConverter.RGBtoXYZ(in);
- }
-}
diff --git a/libjava/gnu/java/awt/color/ClutProfileConverter.java b/libjava/gnu/java/awt/color/ClutProfileConverter.java
deleted file mode 100644
index bff97cc9b87..00000000000
--- a/libjava/gnu/java/awt/color/ClutProfileConverter.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/* ClutProfileConverter.java -- Conversion routines for CLUT-Based profiles
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-import java.awt.color.ICC_Profile;
-
-
-/**
- * ClutProfileConverter - conversions through a CLUT-based profile
- *
- * @author Sven de Marothy
- */
-public class ClutProfileConverter implements ColorSpaceConverter
-{
- private ColorLookUpTable toPCS;
- private ColorLookUpTable fromPCS;
- private int nChannels;
-
- public ClutProfileConverter(ICC_Profile profile)
- {
- nChannels = profile.getNumComponents();
-
- // Sun does not specifiy which rendering intent should be used,
- // neither does the ICC v2 spec really.
- // Try intent 0
- try
- {
- toPCS = new ColorLookUpTable(profile, ICC_Profile.icSigAToB0Tag);
- }
- catch (Exception e)
- {
- toPCS = null;
- }
-
- try
- {
- fromPCS = new ColorLookUpTable(profile, ICC_Profile.icSigBToA0Tag);
- }
- catch (Exception e)
- {
- fromPCS = null;
- }
-
- if (toPCS != null || fromPCS != null)
- return;
-
- // If no intent 0 clut is available, look for a intent 1 clut.
- try
- {
- toPCS = new ColorLookUpTable(profile, ICC_Profile.icSigAToB1Tag);
- }
- catch (Exception e)
- {
- toPCS = null;
- }
-
- try
- {
- fromPCS = new ColorLookUpTable(profile, ICC_Profile.icSigBToA1Tag);
- }
- catch (Exception e)
- {
- fromPCS = null;
- }
-
- if (toPCS != null || fromPCS != null)
- return;
-
- // Last shot.. intent 2 CLUT.
- try
- {
- toPCS = new ColorLookUpTable(profile, ICC_Profile.icSigAToB2Tag);
- }
- catch (Exception e)
- {
- toPCS = null;
- }
-
- try
- {
- fromPCS = new ColorLookUpTable(profile, ICC_Profile.icSigBToA2Tag);
- }
- catch (Exception e)
- {
- fromPCS = null;
- }
-
- if (toPCS == null && fromPCS == null)
- throw new IllegalArgumentException("No CLUTs in profile!");
- }
-
- public float[] toCIEXYZ(float[] in)
- {
- if (toPCS != null)
- return toPCS.lookup(in);
- else
- return new float[3];
- }
-
- public float[] toRGB(float[] in)
- {
- return SrgbConverter.XYZtoRGB(toCIEXYZ(in));
- }
-
- public float[] fromCIEXYZ(float[] in)
- {
- if (fromPCS != null)
- return fromPCS.lookup(in);
- else
- return new float[nChannels];
- }
-
- public float[] fromRGB(float[] in)
- {
- return fromCIEXYZ(SrgbConverter.RGBtoXYZ(in));
- }
-}
diff --git a/libjava/gnu/java/awt/color/ColorLookUpTable.java b/libjava/gnu/java/awt/color/ColorLookUpTable.java
deleted file mode 100644
index 6b6418bc284..00000000000
--- a/libjava/gnu/java/awt/color/ColorLookUpTable.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/* ColorLookUpTable.java -- ICC v2 CLUT
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-import java.awt.color.ColorSpace;
-import java.awt.color.ICC_Profile;
-import java.nio.ByteBuffer;
-
-
-/**
- * ColorLookUpTable handles color lookups through a color lookup table,
- * as defined in the ICC specification.
- * Both 'mft2' and 'mft1' (8 and 16-bit) type CLUTs are handled.
- *
- * This will have to be updated later for ICC 4.0.0
- *
- * @author Sven de Marothy
- */
-public class ColorLookUpTable
-{
- /**
- * CIE 1931 D50 white point (in Lab coordinates)
- */
- private static float[] D50 = { 0.96422f, 1.00f, 0.82521f };
-
- /**
- * Number of input/output channels
- */
- int nIn;
-
- /**
- * Number of input/output channels
- */
- int nOut;
- int nInTableEntries; // Number of input table entries
- int nOutTableEntries; // Number of output table entries
- int gridpoints; // Number of gridpoints
- int nClut; // This is nOut*(gridpoints**nIn)
- double[][] inTable; // 1D input table ([channel][table])
- short[][] outTable; // 1D input table ([channel][table])
- double[] clut; // The color lookup table
- float[][] inMatrix; // input matrix (XYZ only)
- boolean useMatrix; // Whether to use the matrix or not.
- int[] multiplier;
- int[] offsets; // Hypercube offsets
- boolean inputLab; // Set if the CLUT input CS is Lab
- boolean outputLab; // Set if the CLUT output CS is Lab
-
- /**
- * Constructor
- * Requires a profile file to get the CLUT from and the tag of the
- * CLUT to create. (icSigXToYZTag where X,Y = [A | B], Z = [0,1,2])
- */
- public ColorLookUpTable(ICC_Profile profile, int tag)
- {
- useMatrix = false;
-
- switch (tag)
- {
- case ICC_Profile.icSigAToB0Tag:
- case ICC_Profile.icSigAToB1Tag:
- case ICC_Profile.icSigAToB2Tag:
- if (profile.getColorSpaceType() == ColorSpace.TYPE_XYZ)
- useMatrix = true;
- inputLab = false;
- outputLab = (profile.getPCSType() == ColorSpace.TYPE_Lab);
- break;
- case ICC_Profile.icSigBToA0Tag:
- case ICC_Profile.icSigBToA1Tag:
- case ICC_Profile.icSigBToA2Tag:
- if (profile.getPCSType() == ColorSpace.TYPE_XYZ)
- useMatrix = true;
- inputLab = (profile.getPCSType() == ColorSpace.TYPE_Lab);
- outputLab = false;
- break;
- default:
- throw new IllegalArgumentException("Not a clut-type tag.");
- }
-
- byte[] data = profile.getData(tag);
- if (data == null)
- throw new IllegalArgumentException("Unsuitable profile, does not contain a CLUT.");
-
- // check 'mft'
- if (data[0] != 0x6d || data[1] != 0x66 || data[2] != 0x74)
- throw new IllegalArgumentException("Unsuitable profile, invalid CLUT data.");
-
- if (data[3] == 0x32)
- readClut16(data);
- else if (data[3] == 0x31)
- readClut8(data);
- else
- throw new IllegalArgumentException("Unknown/invalid CLUT type.");
- }
-
- /**
- * Loads a 16-bit CLUT into our data structures
- */
- private void readClut16(byte[] data)
- {
- ByteBuffer buf = ByteBuffer.wrap(data);
-
- nIn = data[8] & (0xFF);
- nOut = data[9] & (0xFF);
- nInTableEntries = buf.getShort(48);
- nOutTableEntries = buf.getShort(50);
- gridpoints = data[10] & (0xFF);
-
- inMatrix = new float[3][3];
- for (int i = 0; i < 3; i++)
- for (int j = 0; j < 3; j++)
- inMatrix[i][j] = ((float) (buf.getInt(12 + (i * 3 + j) * 4))) / 65536.0f;
-
- inTable = new double[nIn][nInTableEntries];
- for (int channel = 0; channel < nIn; channel++)
- for (int i = 0; i < nInTableEntries; i++)
- inTable[channel][i] = (double) ((int) buf.getShort(52
- + (channel * nInTableEntries
- + i) * 2)
- & (0xFFFF)) / 65536.0;
-
- nClut = nOut;
- multiplier = new int[nIn];
- multiplier[nIn - 1] = nOut;
- for (int i = 0; i < nIn; i++)
- {
- nClut *= gridpoints;
- if (i > 0)
- multiplier[nIn - i - 1] = multiplier[nIn - i] * gridpoints;
- }
-
- int clutOffset = 52 + nIn * nInTableEntries * 2;
- clut = new double[nClut];
- for (int i = 0; i < nClut; i++)
- clut[i] = (double) ((int) buf.getShort(clutOffset + i * 2) & (0xFFFF)) / 65536.0;
-
- outTable = new short[nOut][nOutTableEntries];
- for (int channel = 0; channel < nOut; channel++)
- for (int i = 0; i < nOutTableEntries; i++)
- outTable[channel][i] = buf.getShort(clutOffset
- + (nClut
- + channel * nOutTableEntries + i) * 2);
-
- // calculate the hypercube corner offsets
- offsets = new int[(1 << nIn)];
- offsets[0] = 0;
- for (int j = 0; j < nIn; j++)
- {
- int factor = 1 << j;
- for (int i = 0; i < factor; i++)
- offsets[factor + i] = offsets[i] + multiplier[j];
- }
- }
-
- /**
- * Loads a 8-bit CLUT into our data structures.
- */
- private void readClut8(byte[] data)
- {
- ByteBuffer buf = ByteBuffer.wrap(data);
-
- nIn = (data[8] & (0xFF));
- nOut = (data[9] & (0xFF));
- nInTableEntries = 256; // always 256
- nOutTableEntries = 256; // always 256
- gridpoints = (data[10] & (0xFF));
-
- inMatrix = new float[3][3];
- for (int i = 0; i < 3; i++)
- for (int j = 0; j < 3; j++)
- inMatrix[i][j] = ((float) (buf.getInt(12 + (i * 3 + j) * 4))) / 65536.0f;
-
- inTable = new double[nIn][nInTableEntries];
- for (int channel = 0; channel < nIn; channel++)
- for (int i = 0; i < nInTableEntries; i++)
- inTable[channel][i] = (double) ((int) buf.get(48
- + (channel * nInTableEntries
- + i)) & (0xFF)) / 255.0;
-
- nClut = nOut;
- multiplier = new int[nIn];
- multiplier[nIn - 1] = nOut;
- for (int i = 0; i < nIn; i++)
- {
- nClut *= gridpoints;
- if (i > 0)
- multiplier[nIn - i - 1] = multiplier[nIn - i] * gridpoints;
- }
-
- int clutOffset = 48 + nIn * nInTableEntries;
- clut = new double[nClut];
- for (int i = 0; i < nClut; i++)
- clut[i] = (double) ((int) buf.get(clutOffset + i) & (0xFF)) / 255.0;
-
- outTable = new short[nOut][nOutTableEntries];
- for (int channel = 0; channel < nOut; channel++)
- for (int i = 0; i < nOutTableEntries; i++)
- outTable[channel][i] = (short) (buf.get(clutOffset + nClut
- + channel * nOutTableEntries
- + i) * 257);
-
- // calculate the hypercube corner offsets
- offsets = new int[(1 << nIn)];
- offsets[0] = 0;
- for (int j = 0; j < nIn; j++)
- {
- int factor = 1 << j;
- for (int i = 0; i < factor; i++)
- offsets[factor + i] = offsets[i] + multiplier[j];
- }
- }
-
- /**
- * Performs a lookup through the Color LookUp Table.
- * If the CLUT tag type is AtoB the conversion will be from the device
- * color space to the PCS, BtoA type goes in the opposite direction.
- *
- * For convenience, the PCS values for input or output will always be
- * CIE XYZ (D50), if the actual PCS is Lab, the values will be converted.
- *
- * N-dimensional linear interpolation is used.
- */
- float[] lookup(float[] in)
- {
- float[] in2 = new float[in.length];
- if (useMatrix)
- {
- for (int i = 0; i < 3; i++)
- in2[i] = in[0] * inMatrix[i][0] + in[1] * inMatrix[i][1]
- + in[2] * inMatrix[i][2];
- }
- else if (inputLab)
- in2 = XYZtoLab(in);
- else
- System.arraycopy(in, 0, in2, 0, in.length);
-
- // input table
- for (int i = 0; i < nIn; i++)
- {
- int index = (int) Math.floor(in2[i] * (double) (nInTableEntries - 1)); // floor in
-
- // clip values.
- if (index >= nInTableEntries - 1)
- in2[i] = (float) inTable[i][nInTableEntries - 1];
- else if (index < 0)
- in2[i] = (float) inTable[i][0];
- else
- {
- // linear interpolation
- double alpha = in2[i] * ((double) nInTableEntries - 1.0) - index;
- in2[i] = (float) (inTable[i][index] * (1 - alpha)
- + inTable[i][index + 1] * alpha);
- }
- }
-
- // CLUT lookup
- double[] output2 = new double[nOut];
- double[] weights = new double[(1 << nIn)];
- double[] clutalpha = new double[nIn]; // interpolation values
- int offset = 0; // = gp
- for (int i = 0; i < nIn; i++)
- {
- int index = (int) Math.floor(in2[i] * ((double) gridpoints - 1.0));
- double alpha = in2[i] * ((double) gridpoints - 1.0) - (double) index;
-
- // clip values.
- if (index >= gridpoints - 1)
- {
- index = gridpoints - 1;
- alpha = 1.0;
- }
- else if (index < 0)
- index = 0;
- clutalpha[i] = alpha;
- offset += index * multiplier[i];
- }
-
- // Calculate interpolation weights
- weights[0] = 1.0;
- for (int j = 0; j < nIn; j++)
- {
- int factor = 1 << j;
- for (int i = 0; i < factor; i++)
- {
- weights[factor + i] = weights[i] * clutalpha[j];
- weights[i] *= (1.0 - clutalpha[j]);
- }
- }
-
- for (int i = 0; i < nOut; i++)
- output2[i] = weights[0] * clut[offset + i];
-
- for (int i = 1; i < (1 << nIn); i++)
- {
- int offset2 = offset + offsets[i];
- for (int f = 0; f < nOut; f++)
- output2[f] += weights[i] * clut[offset2 + f];
- }
-
- // output table
- float[] output = new float[nOut];
- for (int i = 0; i < nOut; i++)
- {
- int index = (int) Math.floor(output2[i] * ((double) nOutTableEntries
- - 1.0));
-
- // clip values.
- if (index >= nOutTableEntries - 1)
- output[i] = outTable[i][nOutTableEntries - 1];
- else if (index < 0)
- output[i] = outTable[i][0];
- else
- {
- // linear interpolation
- double a = output2[i] * ((double) nOutTableEntries - 1.0)
- - (double) index;
- output[i] = (float) ((double) ((int) outTable[i][index] & (0xFFFF)) * (1
- - a)
- + (double) ((int) outTable[i][index + 1] & (0xFFFF)) * a) / 65536f;
- }
- }
-
- if (outputLab)
- return LabtoXYZ(output);
- return output;
- }
-
- /**
- * Converts CIE Lab coordinates to (D50) XYZ ones.
- */
- private float[] LabtoXYZ(float[] in)
- {
- // Convert from byte-packed format to a
- // more convenient one (actual Lab values)
- // (See ICC spec for details)
- // factor is 100 * 65536 / 65280
- in[0] = (float) (100.392156862745 * in[0]);
- in[1] = (in[1] * 256.0f) - 128.0f;
- in[2] = (in[2] * 256.0f) - 128.0f;
-
- float[] out = new float[3];
-
- out[1] = (in[0] + 16.0f) / 116.0f;
- out[0] = in[1] / 500.0f + out[1];
- out[2] = out[1] - in[2] / 200.0f;
-
- for (int i = 0; i < 3; i++)
- {
- double exp = out[i] * out[i] * out[i];
- if (exp <= 0.008856)
- out[i] = (out[i] - 16.0f / 116.0f) / 7.787f;
- else
- out[i] = (float) exp;
- out[i] = D50[i] * out[i];
- }
- return out;
- }
-
- /**
- * Converts CIE XYZ coordinates to Lab ones.
- */
- private float[] XYZtoLab(float[] in)
- {
- float[] temp = new float[3];
-
- for (int i = 0; i < 3; i++)
- {
- temp[i] = in[i] / D50[i];
-
- if (temp[i] <= 0.008856f)
- temp[i] = (7.7870689f * temp[i]) + (16f / 116.0f);
- else
- temp[i] = (float) Math.exp((1.0 / 3.0) * Math.log(temp[i]));
- }
-
- float[] out = new float[3];
- out[0] = (116.0f * temp[1]) - 16f;
- out[1] = 500.0f * (temp[0] - temp[1]);
- out[2] = 200.0f * (temp[1] - temp[2]);
-
- // Normalize to packed format
- out[0] = (float) (out[0] / 100.392156862745);
- out[1] = (out[1] + 128f) / 256f;
- out[2] = (out[2] + 128f) / 256f;
- for (int i = 0; i < 3; i++)
- {
- if (out[i] < 0f)
- out[i] = 0f;
- if (out[i] > 1f)
- out[i] = 1f;
- }
- return out;
- }
-}
diff --git a/libjava/gnu/java/awt/color/ColorSpaceConverter.java b/libjava/gnu/java/awt/color/ColorSpaceConverter.java
deleted file mode 100644
index 63ba08a4ff5..00000000000
--- a/libjava/gnu/java/awt/color/ColorSpaceConverter.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ColorSpaceConverter.java -- an interface for colorspace conversion
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-
-/**
- * ColorSpaceConverter - used by java.awt.color.ICC_ColorSpace
- *
- * Color space conversion can occur in several ways:
- *
- * -Directly (for the built in spaces sRGB, linear RGB, gray, CIE XYZ and PYCC
- * -ICC_ProfileRGB works through TRC curves and a matrix
- * -ICC_ProfileGray works through a single TRC
- * -Everything else is done through Color lookup tables.
- *
- * The different conversion methods are implemented through
- * an interface. The built-in colorspaces are implemented directly
- * with the relevant conversion equations.
- *
- * In this way, we hopefully will always use the fastest and most
- * accurate method available.
- *
- * @author Sven de Marothy
- */
-public interface ColorSpaceConverter
-{
- float[] toCIEXYZ(float[] in);
-
- float[] fromCIEXYZ(float[] in);
-
- float[] toRGB(float[] in);
-
- float[] fromRGB(float[] in);
-}
diff --git a/libjava/gnu/java/awt/color/GrayProfileConverter.java b/libjava/gnu/java/awt/color/GrayProfileConverter.java
deleted file mode 100644
index 3c725138a66..00000000000
--- a/libjava/gnu/java/awt/color/GrayProfileConverter.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* GrayProfileConverter.java -- Gray profile conversion class
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-import java.awt.color.ICC_Profile;
-import java.awt.color.ICC_ProfileGray;
-import java.awt.color.ProfileDataException;
-
-/**
- * GrayProfileConverter - converts Grayscale profiles (ICC_ProfileGray)
- *
- * This type of profile contains a single tone reproduction curve (TRC).
- * Conversion consists of simple TRC lookup.
- *
- * This implementation is very lazy and does everything applying the TRC and
- * utilizing the built-in linear grayscale color space.
- *
- * @author Sven de Marothy
- */
-public class GrayProfileConverter implements ColorSpaceConverter
-{
- private GrayScaleConverter gc;
- private ToneReproductionCurve trc;
- private ColorLookUpTable toPCS;
- private ColorLookUpTable fromPCS;
-
- /**
- * Constructs the converter described by an ICC_ProfileGray object
- */
- public GrayProfileConverter(ICC_ProfileGray profile)
- {
- try
- {
- trc = new ToneReproductionCurve(profile.getGamma());
- }
- catch (ProfileDataException e)
- {
- trc = new ToneReproductionCurve(profile.getTRC());
- }
-
- // linear grayscale converter
- gc = new GrayScaleConverter();
-
- // If a CLUT is available, it should be used, and the TRCs ignored.
- // Note: A valid profile may only have CLUTs in one direction, and
- // TRC:s without useful info, making reverse-transforms impossible.
- // In this case the TRC will be used for the reverse-transform with
- // unpredictable results. This is in line with the Java specification,
- try
- {
- toPCS = new ColorLookUpTable(profile, ICC_Profile.icSigAToB0Tag);
- }
- catch (Exception e)
- {
- toPCS = null;
- }
-
- try
- {
- fromPCS = new ColorLookUpTable(profile, ICC_Profile.icSigBToA0Tag);
- }
- catch (Exception e)
- {
- fromPCS = null;
- }
- }
-
- public float[] toCIEXYZ(float[] in)
- {
- if (toPCS != null)
- return toPCS.lookup(in);
- float[] gray = new float[1];
- gray[0] = trc.lookup(in[0]);
- return gc.toCIEXYZ(gray);
- }
-
- public float[] toRGB(float[] in)
- {
- float[] gray = new float[1];
- gray[0] = trc.lookup(in[0]);
- return gc.toRGB(gray);
- }
-
- public float[] fromRGB(float[] in)
- {
- // get linear grayscale value
- float[] gray = gc.fromRGB(in);
- gray[0] = trc.reverseLookup(gray[0]);
- return gray;
- }
-
- public float[] fromCIEXYZ(float[] in)
- {
- if (fromPCS != null)
- return fromPCS.lookup(in);
-
- float[] gray = gc.fromCIEXYZ(in);
- gray[0] = trc.reverseLookup(gray[0]);
- return gray;
- }
-}
diff --git a/libjava/gnu/java/awt/color/GrayScaleConverter.java b/libjava/gnu/java/awt/color/GrayScaleConverter.java
deleted file mode 100644
index 7a27ddba828..00000000000
--- a/libjava/gnu/java/awt/color/GrayScaleConverter.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/* GrayScaleConverter.java -- Linear grayscale conversion class
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-
-/**
- * Linear Grayscale converter
- *
- * @author Sven de Marothy
- */
-public class GrayScaleConverter implements ColorSpaceConverter
-{
- // intensity factors (ITU Rec. BT.709)
- double[] coeff = { 0.2125f, 0.7154f, 0.0721f };
-
- /**
- * CIE 1931 D50 white point (in Lab coordinates)
- */
- private static float[] D50 = { 0.96422f, 1.00f, 0.82521f };
-
- public float[] toCIEXYZ(float[] in)
- {
- float g = in[0];
- if (g < 0)
- g = 1 + g;
- float[] out = { g * D50[0], g * D50[1], g * D50[2] }; // White spot
- return out;
- }
-
- public float[] toRGB(float[] in)
- {
- float[] out = new float[3];
- if (in[0] <= 0.00304f)
- out[0] = in[0] * 12.92f;
- else
- out[0] = 1.055f * ((float) Math.exp((1 / 2.4) * Math.log(in[0])))
- - 0.055f;
- out[1] = out[2] = out[0];
- return out;
- }
-
- public float[] fromCIEXYZ(float[] in)
- {
- float[] temp = new float[3];
- temp[0] = 3.1338f * in[0] - 1.6171f * in[1] - 0.4907f * in[2];
- temp[1] = -0.9785f * in[0] + 1.9160f * in[1] + 0.0334f * in[2];
- temp[2] = 0.0720f * in[0] - 0.2290f * in[1] + 1.4056f * in[2];
- float[] out = new float[1];
- for (int i = 0; i < 3; i++)
- out[0] = (float) (temp[i] * coeff[i]);
- return out;
- }
-
- public float[] fromRGB(float[] in)
- {
- float[] out = new float[1];
-
- // Convert non-linear RGB coordinates to linear ones,
- // numbers from the w3 spec.
- out[0] = 0;
- for (int i = 0; i < 3; i++)
- {
- float n = in[i];
- if (n < 0)
- n = 0f;
- if (n > 1)
- n = 1f;
- if (n <= 0.03928f)
- out[0] += (float) (coeff[i] * n / 12.92);
- else
- out[0] += (float) (coeff[i] * Math.exp(2.4 * Math.log((n + 0.055) / 1.055)));
- }
- return out;
- }
-}
diff --git a/libjava/gnu/java/awt/color/LinearRGBConverter.java b/libjava/gnu/java/awt/color/LinearRGBConverter.java
deleted file mode 100644
index 13a4e2c04f4..00000000000
--- a/libjava/gnu/java/awt/color/LinearRGBConverter.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/* LinearRGBConverter.java -- conversion to a linear RGB color space
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-
-/**
- * LinearRGBConverter - conversion routines for a linear sRGB colorspace
- * sRGB is a standard for RGB colorspaces, adopted by the w3c.
- *
- * The specification is available at:
- * http://www.w3.org/Graphics/Color/sRGB.html
- *
- * @author Sven de Marothy
- */
-public class LinearRGBConverter implements ColorSpaceConverter
-{
- /**
- * linear RGB --> sRGB
- * Use the inverse gamma curve
- */
- public float[] toRGB(float[] in)
- {
- float[] out = new float[3];
- for (int i = 0; i < 3; i++)
- {
- float n = in[i];
- if (n < 0)
- n = 0f;
- if (n > 1)
- n = 1f;
- if (n <= 0.00304f)
- out[i] = in[0] * 12.92f;
- else
- out[i] = 1.055f * ((float) Math.exp((1 / 2.4) * Math.log(n)))
- - 0.055f;
- }
- return out;
- }
-
- /**
- * sRGB --> linear RGB
- * Use the gamma curve (gamma=2.4 in sRGB)
- */
- public float[] fromRGB(float[] in)
- {
- float[] out = new float[3];
-
- // Convert non-linear RGB coordinates to linear ones,
- // numbers from the w3 spec.
- for (int i = 0; i < 3; i++)
- {
- float n = in[i];
- if (n < 0)
- n = 0f;
- if (n > 1)
- n = 1f;
- if (n <= 0.03928f)
- out[i] = (float) (n / 12.92);
- else
- out[i] = (float) (Math.exp(2.4 * Math.log((n + 0.055) / 1.055)));
- }
- return out;
- }
-
- /**
- * Linear RGB --> CIE XYZ (D50 relative)
- * This is a simple matrix transform, the matrix (relative D65)
- * is given in the sRGB spec. This has been combined with a
- * linear Bradford transform for the D65-->D50 mapping, resulting
- * in a single matrix which does the whole thing.
- *
- */
- public float[] fromCIEXYZ(float[] in)
- {
- /*
- * Note: The numbers which were used to calculate this only had four
- * digits of accuracy. So don't be fooled by the number of digits here.
- * If someone has more accurate source, feel free to update this.
- */
- float[] out = new float[3];
- out[0] = (float) (3.13383065124221 * in[0] - 1.61711949411313 * in[1]
- - 0.49071914111101 * in[2]);
- out[1] = (float) (-0.97847026691142 * in[0] + 1.91597856031996 * in[1]
- + 0.03340430640699 * in[2]);
- out[2] = (float) (0.07203679486279 * in[0] - 0.22903073553113 * in[1]
- + 1.40557835776234 * in[2]);
- if (out[0] < 0)
- out[0] = 0f;
- if (out[1] < 0)
- out[1] = 0f;
- if (out[2] < 0)
- out[2] = 0f;
- if (out[0] > 1.0f)
- out[0] = 1.0f;
- if (out[1] > 1.0f)
- out[1] = 1.0f;
- if (out[2] > 1.0f)
- out[2] = 1.0f;
- return out;
- }
-
- /**
- * Linear RGB --> CIE XYZ (D50 relative)
- * Uses the inverse of the above matrix.
- */
- public float[] toCIEXYZ(float[] in)
- {
- float[] out = new float[3];
- out[0] = (float) (0.43606375022190 * in[0] + 0.38514960146481 * in[1]
- + 0.14308641888799 * in[2]);
- out[1] = (float) (0.22245089403542 * in[0] + 0.71692584775182 * in[1]
- + 0.06062451125578 * in[2]);
- out[2] = (float) (0.01389851860679 * in[0] + 0.09707969011198 * in[1]
- + 0.71399604572506 * in[2]);
- return out;
- }
-}
diff --git a/libjava/gnu/java/awt/color/ProfileHeader.java b/libjava/gnu/java/awt/color/ProfileHeader.java
deleted file mode 100644
index 4fdef560a42..00000000000
--- a/libjava/gnu/java/awt/color/ProfileHeader.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/* ProfileHeader.java -- Encapsules ICC Profile header data
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-import java.awt.color.ColorSpace;
-import java.awt.color.ICC_Profile;
-import java.nio.ByteBuffer;
-
-
-/**
- * Header, abstracts and validates the header data.
- *
- * @author Sven de Marothy
- */
-public class ProfileHeader
-{
- /**
- * Magic identifier (ASCII 'acsp')
- */
- private static final int icMagicNumber = 0x61637370;
-
- /**
- * Mapping from ICC Profile signatures to ColorSpace types
- */
- private static final int[] csTypeMap =
- {
- ICC_Profile.icSigXYZData,
- ColorSpace.TYPE_XYZ,
- ICC_Profile.icSigLabData,
- ColorSpace.TYPE_Lab,
- ICC_Profile.icSigLuvData,
- ColorSpace.TYPE_Luv,
- ICC_Profile.icSigYCbCrData,
- ColorSpace.TYPE_YCbCr,
- ICC_Profile.icSigYxyData,
- ColorSpace.TYPE_Yxy,
- ICC_Profile.icSigRgbData,
- ColorSpace.TYPE_RGB,
- ICC_Profile.icSigGrayData,
- ColorSpace.TYPE_GRAY,
- ICC_Profile.icSigHsvData,
- ColorSpace.TYPE_HSV,
- ICC_Profile.icSigHlsData,
- ColorSpace.TYPE_HLS,
- ICC_Profile.icSigCmykData,
- ColorSpace.TYPE_CMYK,
- ICC_Profile.icSigCmyData,
- ColorSpace.TYPE_CMY,
- ICC_Profile.icSigSpace2CLR,
- ColorSpace.TYPE_2CLR,
- ICC_Profile.icSigSpace3CLR,
- ColorSpace.TYPE_3CLR,
- ICC_Profile.icSigSpace4CLR,
- ColorSpace.TYPE_4CLR,
- ICC_Profile.icSigSpace5CLR,
- ColorSpace.TYPE_5CLR,
- ICC_Profile.icSigSpace6CLR,
- ColorSpace.TYPE_6CLR,
- ICC_Profile.icSigSpace7CLR,
- ColorSpace.TYPE_7CLR,
- ICC_Profile.icSigSpace8CLR,
- ColorSpace.TYPE_8CLR,
- ICC_Profile.icSigSpace9CLR,
- ColorSpace.TYPE_9CLR,
- ICC_Profile.icSigSpaceACLR,
- ColorSpace.TYPE_ACLR,
- ICC_Profile.icSigSpaceBCLR,
- ColorSpace.TYPE_BCLR,
- ICC_Profile.icSigSpaceCCLR,
- ColorSpace.TYPE_CCLR,
- ICC_Profile.icSigSpaceDCLR,
- ColorSpace.TYPE_DCLR,
- ICC_Profile.icSigSpaceECLR,
- ColorSpace.TYPE_ECLR,
- ICC_Profile.icSigSpaceFCLR,
- ColorSpace.TYPE_FCLR
- };
-
- /**
- * Size of an ICC header (128 bytes)
- */
- public static final int HEADERSIZE = 128;
-
- /**
- * Mapping of ICC class signatures to profile class constants
- */
- private static final int[] classMap =
- {
- ICC_Profile.icSigInputClass,
- ICC_Profile.CLASS_INPUT,
- ICC_Profile.icSigDisplayClass,
- ICC_Profile.CLASS_DISPLAY,
- ICC_Profile.icSigOutputClass,
- ICC_Profile.CLASS_OUTPUT,
- ICC_Profile.icSigLinkClass,
- ICC_Profile.CLASS_DEVICELINK,
- ICC_Profile.icSigColorSpaceClass,
- ICC_Profile.CLASS_COLORSPACECONVERSION,
- ICC_Profile.icSigAbstractClass,
- ICC_Profile.CLASS_ABSTRACT,
- ICC_Profile.icSigNamedColorClass,
- ICC_Profile.CLASS_NAMEDCOLOR
- };
- private int size;
- private int cmmId;
-
- // Major/Minor version, The ICC-1998 spec is major v2
- private int majorVersion;
-
- // Major/Minor version, The ICC-1998 spec is major v2
- private int minorVersion;
- private int profileClass; // profile device class
- private int colorSpace; // data color space type
- private int profileColorSpace; // profile connection space (PCS) type
- private byte[] timestamp; // original creation timestamp
- private int platform; // platform signature
- private int flags; // flags
- private int magic; // magic number.
- private int manufacturerSig; // manufacturer sig
- private int modelSig; // model sig
- private byte[] attributes; // Attributes
- private int intent; // rendering intent
- private byte[] illuminant; // illuminant info (Coordinates of D50 in the PCS)
- private int creatorSig; // Creator sig (same type as manufacturer)
-
- /**
- * Creates a 'default' header for use with our predefined profiles.
- * Note the device and profile color spaces are not set.
- */
- public ProfileHeader()
- {
- creatorSig = 0;
- intent = 0;
- modelSig = manufacturerSig = (int) 0x6E6f6E65; // 'none'
- magic = icMagicNumber;
- cmmId = 0;
- platform = 0; // no preferred platform
- timestamp = new byte[8];
- majorVersion = 2;
- minorVersion = 0x10;
- flags = 0;
-
- // D50 in XYZ format (encoded)
- illuminant = new byte[]
- {
- (byte) 0x00, (byte) 0x00, (byte) 0xf6, (byte) 0xd6,
- (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00,
- (byte) 0x00, (byte) 0x00, (byte) 0xd3, (byte) 0x2d
- };
- attributes = new byte[8];
- profileClass = ICC_Profile.CLASS_DISPLAY;
- }
-
- /**
- * Creates a header from profile data. Only the header portion (128 bytes)
- * is read, so the array passed need not be the full profile.
- */
- public ProfileHeader(byte[] data)
- {
- ByteBuffer buf = ByteBuffer.wrap(data);
-
- // Get size (the sign bit shouldn't matter.
- // A valid profile can never be +2Gb)
- size = buf.getInt(ICC_Profile.icHdrSize);
-
- // CMM ID
- cmmId = buf.getInt(ICC_Profile.icHdrCmmId);
-
- // Version number
- majorVersion = (int) (data[ICC_Profile.icHdrVersion]);
- minorVersion = (int) (data[ICC_Profile.icHdrVersion + 1]);
-
- // Profile/Device class
- int classSig = buf.getInt(ICC_Profile.icHdrDeviceClass);
- profileClass = -1;
- for (int i = 0; i < classMap.length; i += 2)
- if (classMap[i] == classSig)
- {
- profileClass = classMap[i + 1];
- break;
- }
-
- // get the data color space
- int csSig = buf.getInt(ICC_Profile.icHdrColorSpace);
- colorSpace = -1;
- for (int i = 0; i < csTypeMap.length; i += 2)
- if (csTypeMap[i] == csSig)
- {
- colorSpace = csTypeMap[i + 1];
- break;
- }
-
- // get the profile color space (PCS), must be xyz or lab except
- // for device-link-class profiles
- int pcsSig = buf.getInt(ICC_Profile.icHdrPcs);
- profileColorSpace = -1;
- if (profileClass != ICC_Profile.CLASS_DEVICELINK)
- {
- if (pcsSig == ICC_Profile.icSigXYZData)
- profileColorSpace = ColorSpace.TYPE_XYZ;
- if (pcsSig == ICC_Profile.icSigLabData)
- profileColorSpace = ColorSpace.TYPE_Lab;
- }
- else
- {
- for (int i = 0; i < csTypeMap.length; i += 2)
- if (csTypeMap[i] == pcsSig)
- {
- profileColorSpace = csTypeMap[i + 1];
- break;
- }
- }
-
- // creation timestamp
- timestamp = new byte[8];
- System.arraycopy(data, ICC_Profile.icHdrDate, timestamp, 0, 8);
-
- // magic number
- magic = buf.getInt(ICC_Profile.icHdrMagic);
-
- // platform info
- platform = buf.getInt(ICC_Profile.icHdrPlatform);
- // get flags
- flags = buf.getInt(ICC_Profile.icHdrFlags);
- // get manufacturer sign
- manufacturerSig = buf.getInt(ICC_Profile.icHdrManufacturer);
- // get header model
- modelSig = buf.getInt(ICC_Profile.icHdrModel);
- // attributes
- attributes = new byte[8];
- System.arraycopy(data, ICC_Profile.icHdrAttributes, attributes, 0, 8);
- // rendering intent
- intent = buf.getInt(ICC_Profile.icHdrRenderingIntent);
- // illuminant info
- illuminant = new byte[12];
- System.arraycopy(data, ICC_Profile.icHdrIlluminant, illuminant, 0, 12);
- // Creator signature
- creatorSig = buf.getInt(ICC_Profile.icHdrCreator);
- // The rest of the header (Total size: 128 bytes) is unused..
- }
-
- /**
- * Verify that the header is valid
- * @param size equals the file size if it is to be verified, -1 otherwise
- * @throws IllegalArgumentException if the header is found to be invalid.
- */
- public void verifyHeader(int size) throws IllegalArgumentException
- {
- // verify size
- if (size != -1 && this.size != size)
- throw new IllegalArgumentException("Invalid profile length:" + size);
-
- // Check version number
- if (majorVersion != 2)
- throw new IllegalArgumentException("Wrong major version number:"
- + majorVersion);
-
- // Profile/Device class
- if (profileClass == -1)
- throw new IllegalArgumentException("Invalid profile/device class");
-
- // get the data color space
- if (colorSpace == -1)
- throw new IllegalArgumentException("Invalid colorspace");
-
- // profile color space
- if (profileColorSpace == -1)
- throw new IllegalArgumentException("Invalid PCS.");
-
- // check magic number
- if (magic != icMagicNumber)
- throw new IllegalArgumentException("Invalid magic number!");
- }
-
- /**
- * Creates a header, setting the header file size at the same time.
- * @param size the profile file size.
- */
- public byte[] getData(int size)
- {
- byte[] data = new byte[HEADERSIZE];
- ByteBuffer buf = ByteBuffer.wrap(data);
- buf.putInt(ICC_Profile.icHdrSize, size);
- buf.putInt(ICC_Profile.icHdrCmmId, cmmId);
- buf.putShort(ICC_Profile.icHdrVersion,
- (short) (majorVersion << 8 | minorVersion));
- for (int i = 1; i < classMap.length; i += 2)
- if (profileClass == classMap[i])
- buf.putInt(ICC_Profile.icHdrDeviceClass, classMap[i - 1]);
- for (int i = 1; i < csTypeMap.length; i += 2)
- if (csTypeMap[i] == colorSpace)
- buf.putInt(ICC_Profile.icHdrColorSpace, csTypeMap[i - 1]);
- for (int i = 1; i < csTypeMap.length; i += 2)
- if (csTypeMap[i] == profileColorSpace)
- buf.putInt(ICC_Profile.icHdrPcs, csTypeMap[i - 1]);
-
- System.arraycopy(timestamp, 0, data, ICC_Profile.icHdrDate,
- timestamp.length);
- buf.putInt(ICC_Profile.icHdrMagic, icMagicNumber);
- buf.putInt(ICC_Profile.icHdrPlatform, platform);
- buf.putInt(ICC_Profile.icHdrFlags, flags);
- buf.putInt(ICC_Profile.icHdrManufacturer, manufacturerSig);
- buf.putInt(ICC_Profile.icHdrModel, modelSig);
- System.arraycopy(attributes, 0, data, ICC_Profile.icHdrAttributes,
- attributes.length);
- buf.putInt(ICC_Profile.icHdrRenderingIntent, intent);
- System.arraycopy(illuminant, 0, data, ICC_Profile.icHdrIlluminant,
- illuminant.length);
- buf.putInt(ICC_Profile.icHdrCreator, creatorSig);
- return buf.array();
- }
-
- public int getSize()
- {
- return size;
- }
-
- public void setSize(int s)
- {
- size = s;
- }
-
- public int getMajorVersion()
- {
- return majorVersion;
- }
-
- public int getMinorVersion()
- {
- return minorVersion;
- }
-
- public int getProfileClass()
- {
- return profileClass;
- }
-
- public void setProfileClass(int pc)
- {
- profileClass = pc;
- }
-
- public int getColorSpace()
- {
- return colorSpace;
- }
-
- public int getProfileColorSpace()
- {
- return profileColorSpace;
- }
-
- public void setColorSpace(int cs)
- {
- colorSpace = cs;
- }
-
- public void setProfileColorSpace(int pcs)
- {
- profileColorSpace = pcs;
- }
-
-}
diff --git a/libjava/gnu/java/awt/color/PyccConverter.java b/libjava/gnu/java/awt/color/PyccConverter.java
deleted file mode 100644
index cd50d8776cd..00000000000
--- a/libjava/gnu/java/awt/color/PyccConverter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* PyccConverter.java -- PhotoYCC conversion class
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-
-/**
- * PyccConverter - conversion routines for the PhotoYCC colorspace
- *
- * Also known as PhotoCD YCC, it is an expansion of the conventional
- * YCC color space to also include colors with over 100% white.
- *
- * XXX FIXME: Not yet implemented, implementation pending.
- *
- * @author Sven de Marothy
- */
-public class PyccConverter implements ColorSpaceConverter
-{
- public float[] toRGB(float[] in)
- {
- return null;
- }
-
- public float[] fromRGB(float[] in)
- {
- return null;
- }
-
- public float[] toCIEXYZ(float[] in)
- {
- return null;
- }
-
- public float[] fromCIEXYZ(float[] in)
- {
- return null;
- }
-}
diff --git a/libjava/gnu/java/awt/color/RgbProfileConverter.java b/libjava/gnu/java/awt/color/RgbProfileConverter.java
deleted file mode 100644
index 0cbd28f6cca..00000000000
--- a/libjava/gnu/java/awt/color/RgbProfileConverter.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/* RgbProfileConverter.java -- RGB Profile conversion class
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-import java.awt.color.ICC_Profile;
-import java.awt.color.ICC_ProfileRGB;
-import java.awt.color.ProfileDataException;
-
-/**
- * RgbProfileConverter - converts RGB profiles (ICC_ProfileRGB)
- *
- * This type of profile contains a matrix and three
- * tone reproduction curves (TRCs).
- *
- * Device RGB --&gt; CIE XYZ is done through first multiplying with
- * a matrix, then each component is looked-up against it's TRC.
- *
- * The opposite transform is done using the inverse of the matrix,
- * and TRC:s.
- *
- * @author Sven de Marothy
- */
-public class RgbProfileConverter implements ColorSpaceConverter
-{
- private float[][] matrix;
- private float[][] inv_matrix;
- private ToneReproductionCurve rTRC;
- private ToneReproductionCurve gTRC;
- private ToneReproductionCurve bTRC;
- private ColorLookUpTable toPCS;
- private ColorLookUpTable fromPCS;
-
- /**
- * CIE 1931 D50 white point (in Lab coordinates)
- */
- private static float[] D50 = { 0.96422f, 1.00f, 0.82521f };
-
- /**
- * Constructs an RgbProfileConverter from a given ICC_ProfileRGB
- */
- public RgbProfileConverter(ICC_ProfileRGB profile)
- {
- toPCS = fromPCS = null;
- matrix = profile.getMatrix();
-
- // get TRCs
- try
- {
- rTRC = new ToneReproductionCurve(profile.getGamma(ICC_ProfileRGB.REDCOMPONENT));
- }
- catch (ProfileDataException e)
- {
- rTRC = new ToneReproductionCurve(profile.getTRC(ICC_ProfileRGB.REDCOMPONENT));
- }
- try
- {
- gTRC = new ToneReproductionCurve(profile.getGamma(ICC_ProfileRGB.GREENCOMPONENT));
- }
- catch (ProfileDataException e)
- {
- gTRC = new ToneReproductionCurve(profile.getTRC(ICC_ProfileRGB.GREENCOMPONENT));
- }
- try
- {
- bTRC = new ToneReproductionCurve(profile.getGamma(ICC_ProfileRGB.BLUECOMPONENT));
- }
- catch (ProfileDataException e)
- {
- bTRC = new ToneReproductionCurve(profile.getTRC(ICC_ProfileRGB.BLUECOMPONENT));
- }
-
- // If a CLUT is available, it should be used, and the TRCs ignored.
- // Note: A valid profile may only have CLUTs in one direction, and
- // TRC:s without useful info, making reverse-transforms impossible.
- // In this case the TRC will be used for the reverse-transform with
- // unpredictable results. This is in line with the Java specification,
- try
- {
- toPCS = new ColorLookUpTable(profile, ICC_Profile.icSigAToB0Tag);
- }
- catch (Exception e)
- {
- toPCS = null;
- }
-
- try
- {
- fromPCS = new ColorLookUpTable(profile, ICC_Profile.icSigBToA0Tag);
- }
- catch (Exception e)
- {
- fromPCS = null;
- }
-
- // Calculate the inverse matrix if no reverse CLUT is available
- if(fromPCS == null)
- inv_matrix = invertMatrix(matrix);
- else
- {
- // otherwise just set it to an identity matrix
- inv_matrix = new float[3][3];
- inv_matrix[0][0] = inv_matrix[1][1] = inv_matrix[2][2] = 1.0f;
- }
- }
-
- public float[] toCIEXYZ(float[] in)
- {
- // CLUT takes precedence
- if (toPCS != null)
- return toPCS.lookup(in);
-
- float[] temp = new float[3];
- float[] out = new float[3];
-
- // device space --> linear gamma
- temp[0] = rTRC.lookup(in[0]);
- temp[1] = gTRC.lookup(in[1]);
- temp[2] = bTRC.lookup(in[2]);
-
- // matrix multiplication
- out[0] = matrix[0][0] * temp[0] + matrix[0][1] * temp[1]
- + matrix[0][2] * temp[2];
- out[1] = matrix[1][0] * temp[0] + matrix[1][1] * temp[1]
- + matrix[1][2] * temp[2];
- out[2] = matrix[2][0] * temp[0] + matrix[2][1] * temp[1]
- + matrix[2][2] * temp[2];
-
- return out;
- }
-
- public float[] toRGB(float[] in)
- {
- return SrgbConverter.XYZtoRGB(toCIEXYZ(in));
- }
-
- public float[] fromCIEXYZ(float[] in)
- {
- if (fromPCS != null)
- return fromPCS.lookup(in);
-
- float[] temp = new float[3];
- float[] out = new float[3];
-
- // matrix multiplication
- temp[0] = inv_matrix[0][0] * in[0] + inv_matrix[0][1] * in[1]
- + inv_matrix[0][2] * in[2];
- temp[1] = inv_matrix[1][0] * in[0] + inv_matrix[1][1] * in[1]
- + inv_matrix[1][2] * in[2];
- temp[2] = inv_matrix[2][0] * in[0] + inv_matrix[2][1] * in[1]
- + inv_matrix[2][2] * in[2];
-
- // device space --> linear gamma
- out[0] = rTRC.reverseLookup(temp[0]);
- out[1] = gTRC.reverseLookup(temp[1]);
- out[2] = bTRC.reverseLookup(temp[2]);
-
- // FIXME: Sun appears to clip the return values to [0,1]
- // I don't believe that is a Good Thing,
- // (some colorspaces may allow values outside that range.)
- // So we return the actual values here.
- return out;
- }
-
- public float[] fromRGB(float[] in)
- {
- return fromCIEXYZ(SrgbConverter.RGBtoXYZ(in));
- }
-
- /**
- * Inverts a 3x3 matrix, returns the inverse,
- * throws an IllegalArgumentException if the matrix is not
- * invertible (this shouldn't happen for a valid profile)
- */
- private float[][] invertMatrix(float[][] matrix)
- {
- float[][] out = new float[3][3];
- double determinant = matrix[0][0] * (matrix[1][1] * matrix[2][2]
- - matrix[2][1] * matrix[1][2])
- - matrix[0][1] * (matrix[1][0] * matrix[2][2]
- - matrix[2][0] * matrix[1][2])
- + matrix[0][2] * (matrix[1][0] * matrix[2][1]
- - matrix[2][0] * matrix[1][1]);
-
- if (determinant == 0.0)
- throw new IllegalArgumentException("Can't invert conversion matrix.");
- float invdet = (float) (1.0 / determinant);
-
- out[0][0] = invdet * (matrix[1][1] * matrix[2][2]
- - matrix[1][2] * matrix[2][1]);
- out[0][1] = invdet * (matrix[0][2] * matrix[2][1]
- - matrix[0][1] * matrix[2][2]);
- out[0][2] = invdet * (matrix[0][1] * matrix[1][2]
- - matrix[0][2] * matrix[1][1]);
- out[1][0] = invdet * (matrix[1][2] * matrix[2][0]
- - matrix[1][0] * matrix[2][2]);
- out[1][1] = invdet * (matrix[0][0] * matrix[2][2]
- - matrix[0][2] * matrix[2][0]);
- out[1][2] = invdet * (matrix[0][2] * matrix[1][0]
- - matrix[0][0] * matrix[1][2]);
- out[2][0] = invdet * (matrix[1][0] * matrix[2][1]
- - matrix[1][1] * matrix[2][0]);
- out[2][1] = invdet * (matrix[0][1] * matrix[2][0]
- - matrix[0][0] * matrix[2][1]);
- out[2][2] = invdet * (matrix[0][0] * matrix[1][1]
- - matrix[0][1] * matrix[1][0]);
- return out;
- }
-}
diff --git a/libjava/gnu/java/awt/color/SrgbConverter.java b/libjava/gnu/java/awt/color/SrgbConverter.java
deleted file mode 100644
index a30a0db906c..00000000000
--- a/libjava/gnu/java/awt/color/SrgbConverter.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/* SrgbConverter.java -- sRGB conversion class
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-
-/**
- * SrgbConverter - conversion routines for the sRGB colorspace
- * sRGB is a standard for RGB colorspaces, adopted by the w3c.
- *
- * The specification is available at:
- * http://www.w3.org/Graphics/Color/sRGB.html
- *
- * @author Sven de Marothy
- */
-/**
- *
- * Note the matrix numbers used here are NOT identical to those in the
- * w3 spec, as those numbers are CIE XYZ relative a D65 white point.
- * The CIE XYZ we use is relative a D50 white point, so therefore a
- * linear Bradford transform matrix for D65->D50 mapping has been applied.
- * (The ICC documents describe this transform)
- *
- * Linearized Bradford transform:
- * 0.8951 0.2664 -0.1614
- * -0.7502 1.7135 0.0367
- * 0.0389 -0.0685 1.0296
- *
- * Inverse:
- * 0.9870 -0.1471 0.1600
- * 0.4323 0.5184 0.0493
- * -0.00853 0.0400 0.9685
- */
-public class SrgbConverter implements ColorSpaceConverter
-{
- public float[] fromCIEXYZ(float[] in)
- {
- return XYZtoRGB(in);
- }
-
- public float[] toCIEXYZ(float[] in)
- {
- return RGBtoXYZ(in);
- }
-
- public float[] toRGB(float[] in)
- {
- float[] out = new float[3];
- System.arraycopy(in, 0, out, 0, 3);
- return out;
- }
-
- public float[] fromRGB(float[] in)
- {
- float[] out = new float[3];
- System.arraycopy(in, 0, out, 0, 3);
- return out;
- }
-
- /**
- * CIE XYZ (D50 relative) --> sRGB
- *
- * Static as it's used by other ColorSpaceConverters to
- * convert to sRGB if the color space is defined in XYZ.
- */
- public static float[] XYZtoRGB(float[] in)
- {
- float[] temp = new float[3];
- temp[0] = 3.1338f * in[0] - 1.6171f * in[1] - 0.4907f * in[2];
- temp[1] = -0.9785f * in[0] + 1.9160f * in[1] + 0.0334f * in[2];
- temp[2] = 0.0720f * in[0] - 0.2290f * in[1] + 1.4056f * in[2];
-
- float[] out = new float[3];
- for (int i = 0; i < 3; i++)
- {
- if (temp[i] < 0)
- temp[i] = 0.0f;
- if (temp[i] > 1)
- temp[i] = 1.0f;
- if (temp[i] <= 0.00304f)
- out[i] = temp[i] * 12.92f;
- else
- out[i] = 1.055f * ((float) Math.exp((1 / 2.4) * Math.log(temp[i])))
- - 0.055f;
- }
- return out;
- }
-
- /**
- * sRGB --> CIE XYZ (D50 relative)
- *
- * Static as it's used by other ColorSpaceConverters to
- * convert to XYZ if the color space is defined in RGB.
- */
- public static float[] RGBtoXYZ(float[] in)
- {
- float[] temp = new float[3];
- float[] out = new float[3];
- for (int i = 0; i < 3; i++)
- if (in[i] <= 0.03928f)
- temp[i] = in[i] / 12.92f;
- else
- temp[i] = (float) Math.exp(2.4 * Math.log((in[i] + 0.055) / 1.055));
-
- /*
- * Note: The numbers which were used to calculate this only had four
- * digits of accuracy. So don't be fooled by the number of digits here.
- * If someone has more accurate source, feel free to update this.
- */
- out[0] = (float) (0.436063750222 * temp[0] + 0.385149601465 * temp[1]
- + 0.143086418888 * temp[2]);
- out[1] = (float) (0.222450894035 * temp[0] + 0.71692584775 * temp[1]
- + 0.060624511256 * temp[2]);
- out[2] = (float) (0.0138985186 * temp[0] + 0.097079690112 * temp[1]
- + 0.713996045725 * temp[2]);
- return out;
- }
-}
diff --git a/libjava/gnu/java/awt/color/TagEntry.java b/libjava/gnu/java/awt/color/TagEntry.java
deleted file mode 100644
index a9786468384..00000000000
--- a/libjava/gnu/java/awt/color/TagEntry.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* TagEntry.java -- A utility class used for storing the tags in ICC_Profile
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-
-/**
- * TagEntry - stores a profile tag.
- * These are conveniently stored in a hashtable with the tag signature
- * as a key. A legal profile can only have one tag with a given sig,
- * so we can conveniently ignore collisions.
- *
- * @author Sven de Marothy
- */
-public class TagEntry
-{
- // tag table entry size
- public static final int entrySize = 12;
- private int signature;
- private int size;
- private int offset;
- private byte[] data;
-
- public TagEntry(int sig, int offset, int size, byte[] data)
- {
- this.signature = sig;
- this.offset = offset;
- this.size = size;
- this.data = new byte[size];
- System.arraycopy(data, offset, this.data, 0, size);
- }
-
- public TagEntry(int sig, byte[] data)
- {
- this.signature = sig;
- this.size = data.length;
- this.data = new byte[size];
- System.arraycopy(data, offset, this.data, 0, size);
- }
-
- public byte[] getData()
- {
- byte[] d = new byte[size];
- System.arraycopy(this.data, 0, d, 0, size);
- return d;
- }
-
- public String hashKey()
- {
- return tagHashKey(signature);
- }
-
- public String toString()
- {
- String s = "";
- s = s + (char) ((byte) ((signature >> 24) & 0xFF));
- s = s + (char) ((byte) ((signature >> 16) & 0xFF));
- s = s + (char) ((byte) ((signature >> 8) & 0xFF));
- s = s + (char) ((byte) (signature & 0xFF));
- return s;
- }
-
- public int getSignature()
- {
- return signature;
- }
-
- public int getSize()
- {
- return size;
- }
-
- public int getOffset()
- {
- return offset;
- }
-
- public void setOffset(int offset)
- {
- this.offset = offset;
- }
-
- public static String tagHashKey(int sig)
- {
- return "" + sig;
- }
-}
diff --git a/libjava/gnu/java/awt/color/ToneReproductionCurve.java b/libjava/gnu/java/awt/color/ToneReproductionCurve.java
deleted file mode 100644
index a1bccbd4068..00000000000
--- a/libjava/gnu/java/awt/color/ToneReproductionCurve.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/* ToneReproductionCurve.java -- Representation of an ICC 'curv' type TRC
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.color;
-
-
-/**
- * ToneReproductionCurve - TRCs are used to describe RGB
- * and Grayscale profiles. The TRC is essentially the gamma
- * function of the color space.
- *
- * For example, Apple RGB has a gamma of 1.8, most monitors are ~2.2,
- * sRGB is 2.4 with a small linear part near 0.
- * Linear spaces are of course 1.0.
- * (The exact function is implemented in SrgbConverter)
- *
- * The ICC specification allows the TRC to be described as a single
- * Gamma value, where the function is thus out = in**gamma.
- * Alternatively, the gamma function may be represented by a lookup table
- * of values, in which case linear interpolation is used.
- *
- * @author Sven de Marothy
- */
-public class ToneReproductionCurve
-{
- private float[] trc;
- private float gamma;
- private float[] reverseTrc;
-
- /**
- * Constructs a TRC from a gamma values
- */
- public ToneReproductionCurve(float gamma)
- {
- trc = null;
- reverseTrc = null;
- this.gamma = gamma;
- }
-
- /**
- * Constructs a TRC from a set of float values
- */
- public ToneReproductionCurve(float[] trcValues)
- {
- trc = new float[trcValues.length];
- System.arraycopy(trcValues, 0, trc, 0, trcValues.length);
- setupReverseTrc();
- }
-
- /**
- * Constructs a TRC from a set of short values normalized to
- * the 0-65535 range (as in the ICC profile file).
- * (Note the values are treated as unsigned)
- */
- public ToneReproductionCurve(short[] trcValues)
- {
- trc = new float[trcValues.length];
- for (int i = 0; i < trcValues.length; i++)
- trc[i] = (float) ((int) trcValues[i] & (0xFFFF)) / 65535.0f;
- setupReverseTrc();
- }
-
- /**
- * Performs a TRC lookup
- */
- public float lookup(float in)
- {
- float out;
-
- if (trc == null)
- {
- if (in == 0f)
- return 0.0f;
- return (float) Math.exp(gamma * Math.log(in));
- }
- else
- {
- double alpha = in * (trc.length - 1);
- int index = (int) Math.floor(alpha);
- alpha = alpha - (double) index;
- if (index >= trc.length - 1)
- return trc[trc.length - 1];
- if (index <= 0)
- return trc[0];
- out = (float) (trc[index] * (1.0 - alpha) + trc[index + 1] * alpha);
- }
- return out;
- }
-
- /**
- * Performs an reverse lookup
- */
- public float reverseLookup(float in)
- {
- float out;
-
- if (trc == null)
- {
- if (in == 0f)
- return 0.0f;
- return (float) Math.exp((1.0 / gamma) * Math.log(in));
- }
- else
- {
- double alpha = in * (reverseTrc.length - 1);
- int index = (int) Math.floor(alpha);
- alpha = alpha - (double) index;
- if (index >= reverseTrc.length - 1)
- return reverseTrc[reverseTrc.length - 1];
- if (index <= 0)
- return reverseTrc[0];
- out = (float) (reverseTrc[index] * (1.0 - alpha)
- + reverseTrc[index + 1] * alpha);
- }
- return out;
- }
-
- /**
- * Calculates a reverse-lookup table.
- * We use a whopping 10,000 entries.. This is should be more than any
- * real-life TRC table (typically around 256-1024) so we won't be losing
- * any precision.
- *
- * This will of course generate completely invalid results if the curve
- * is not monotonic and invertable. But what's the alternative?
- */
- public void setupReverseTrc()
- {
- reverseTrc = new float[10000];
- int j = 0;
- for (int i = 0; i < 10000; i++)
- {
- float n = ((float) i) / 10000f;
- while (trc[j + 1] < n && j < trc.length - 2)
- j++;
-
- if (j == trc.length - 2)
- reverseTrc[i] = trc[trc.length - 1];
- else
- reverseTrc[i] = (j + (n - trc[j]) / (trc[j + 1] - trc[j])) / ((float) trc.length);
- }
- }
-}
diff --git a/libjava/gnu/java/awt/doc-files/BitwiseXORComposite-1.png b/libjava/gnu/java/awt/doc-files/BitwiseXORComposite-1.png
deleted file mode 100644
index 588c910dd75..00000000000
--- a/libjava/gnu/java/awt/doc-files/BitwiseXORComposite-1.png
+++ /dev/null
Binary files differ
diff --git a/libjava/gnu/java/awt/image/ImageDecoder.java b/libjava/gnu/java/awt/image/ImageDecoder.java
deleted file mode 100644
index 141c8541794..00000000000
--- a/libjava/gnu/java/awt/image/ImageDecoder.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* ImageDecoder.java --
- Copyright (C) 1999, 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.image;
-
-import java.awt.image.ImageConsumer;
-import java.awt.image.ImageProducer;
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Vector;
-
-public abstract class ImageDecoder implements ImageProducer
-{
- Vector consumers = new Vector ();
- String filename;
- URL url;
- byte[] data;
- int offset;
- int length;
- InputStream input;
-
- static
- {
- // FIXME: there was some broken code here that looked like
- // it wanted to rely on this property. I don't have any idea
- // what it was intended to do.
- // String endian = System.getProperties ().getProperty ("gnu.cpu.endian");
- }
-
- public ImageDecoder (String filename)
- {
- this.filename = filename;
- }
-
- public ImageDecoder (URL url)
- {
- this.url = url;
- }
-
- public ImageDecoder (InputStream is)
- {
- this.input = is;
- }
-
- public ImageDecoder (byte[] imagedata, int imageoffset, int imagelength)
- {
- data = imagedata;
- offset = imageoffset;
- length = imagelength;
- }
-
- public void addConsumer (ImageConsumer ic)
- {
- consumers.addElement (ic);
- }
-
- public boolean isConsumer (ImageConsumer ic)
- {
- return consumers.contains (ic);
- }
-
- public void removeConsumer (ImageConsumer ic)
- {
- consumers.removeElement (ic);
- }
-
- public void startProduction (ImageConsumer ic)
- {
- if (!isConsumer(ic))
- addConsumer(ic);
-
- Vector list = (Vector) consumers.clone ();
- try
- {
- // Create the input stream here rather than in the
- // ImageDecoder constructors so that exceptions cause
- // imageComplete to be called with an appropriate error
- // status.
- if (input == null)
- {
- try
- {
- if (url != null)
- input = url.openStream();
- else
- {
- if (filename != null)
- input = new FileInputStream (filename);
- else
- input = new ByteArrayInputStream (data, offset, length);
- }
- produce (list, input);
- }
- finally
- {
- input = null;
- }
- }
- else
- {
- produce (list, input);
- }
- }
- catch (Exception e)
- {
- for (int i = 0; i < list.size (); i++)
- {
- ImageConsumer ic2 = (ImageConsumer) list.elementAt (i);
- ic2.imageComplete (ImageConsumer.IMAGEERROR);
- }
- }
- }
-
- public void requestTopDownLeftRightResend (ImageConsumer ic)
- {
- }
-
- public abstract void produce (Vector v, InputStream is) throws IOException;
-}
diff --git a/libjava/gnu/java/awt/image/XBMDecoder.java b/libjava/gnu/java/awt/image/XBMDecoder.java
deleted file mode 100644
index 0793d8ee749..00000000000
--- a/libjava/gnu/java/awt/image/XBMDecoder.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/* XBMDecoder.java -- Decodes X-bitmaps
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.image;
-
-import java.awt.image.ColorModel;
-import java.awt.image.ImageConsumer;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URL;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-public class XBMDecoder extends ImageDecoder
-{
- BufferedReader reader;
- static final ColorModel cm = ColorModel.getRGBdefault ();
- static final int black = 0xff000000;
- static final int transparent = 0x00000000;
- static final int masktable[] = { 0x01, 0x02, 0x04, 0x08,
- 0x10, 0x20, 0x40, 0x80 };
-
- public XBMDecoder (String filename)
- {
- super (filename);
- }
-
- public XBMDecoder (URL url)
- {
- super (url);
- }
-
- public void produce (Vector v, InputStream is) throws IOException
- {
- reader = new BufferedReader (new InputStreamReader (is));
- int width = -1, height = -1;
-
- for (int i = 0; i < 2; i++)
- {
- String line = reader.readLine ();
- StringTokenizer st = new StringTokenizer (line);
-
- st.nextToken (); // #define
- st.nextToken (); // name_[width|height]
- if (i == 0)
- width = Integer.parseInt (st.nextToken (), 10);
- else
- height = Integer.parseInt (st.nextToken (), 10);
- }
-
- for (int i = 0; i < v.size (); i++)
- {
- ImageConsumer ic = (ImageConsumer) v.elementAt (i);
-
- ic.setDimensions (width, height);
- ic.setColorModel (cm);
- ic.setHints (ImageConsumer.COMPLETESCANLINES
- | ImageConsumer.SINGLEFRAME
- | ImageConsumer.SINGLEPASS
- | ImageConsumer.TOPDOWNLEFTRIGHT);
- }
-
- /* skip to the byte array */
- while (reader.read () != '{') { }
-
- /* loop through each scanline */
- for (int line = 0; line < height; line++)
- {
- int scanline[] = getScanline (reader, width);
-
- for (int i = 0; i < v.size (); i++)
- {
- ImageConsumer ic = (ImageConsumer) v.elementAt (i);
- ic.setPixels (0, 0 + line, width, 1, cm, scanline, 0, width);
- }
- }
-
- /* tell each ImageConsumer that we're finished */
- for (int i = 0; i < v.size (); i++)
- {
- ImageConsumer ic = (ImageConsumer) v.elementAt (i);
- ic.imageComplete (ImageConsumer.STATICIMAGEDONE);
- }
- }
-
- public static int[] getScanline (Reader in, int len) throws IOException
- {
- char byteStr[] = new char[2];
- int scanline[] = new int[len];
- int x = 0;
-
- while (x < len)
- {
- int ch = in.read ();
- if (ch == '0')
- {
- in.read (); // 'x'
-
- byteStr[0] = (char) in.read ();
- byteStr[1] = (char) in.read ();
-
- int byteVal = Integer.parseInt (new String (byteStr), 16);
-
- for (int i = 0; i < 8; i++, x++)
- {
- if (x == len) // condition occurs if bitmap is padded
- return scanline;
-
- scanline[x] = ((byteVal & masktable[i]) != 0) ?
- black : transparent;
- }
- }
- }
-
- return scanline;
- }
-}
diff --git a/libjava/gnu/java/awt/peer/ClasspathFontPeer.java b/libjava/gnu/java/awt/peer/ClasspathFontPeer.java
deleted file mode 100644
index 78ab3a9de21..00000000000
--- a/libjava/gnu/java/awt/peer/ClasspathFontPeer.java
+++ /dev/null
@@ -1,846 +0,0 @@
-/* ClasspathFontPeer.java -- Font peer used by GNU Classpath.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-import gnu.java.awt.ClasspathToolkit;
-
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Toolkit;
-import java.awt.font.FontRenderContext;
-import java.awt.font.GlyphVector;
-import java.awt.font.LineMetrics;
-import java.awt.font.TextAttribute;
-import java.awt.font.TransformAttribute;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-import java.awt.peer.FontPeer;
-import java.text.AttributedCharacterIterator;
-import java.text.CharacterIterator;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * A peer for fonts that are used inside Classpath. The purpose of
- * this interface is to abstract from platform-specific font handling
- * in the Classpath implementation of java.awt.Font and related
- * classes.
- *
- * <p><b>State kept by the peer:</b> a peer is generated for each Font
- * object in the default implementation. If you wish to share peers between
- * fonts, you will need to subclass both ClasspathFontPeer and
- * {@link ClasspathToolKit}.</p>
- *
- * <p><b>Thread Safety:</b> Methods of this interface may be called
- * from arbitrary threads at any time. Implementations of the
- * <code>ClasspathFontPeer</code> interface are required to perform
- * the necessary synchronization.</p>
- *
- * @see java.awt.Font#getPeer
- * @see java.awt.Toolkit#getFontPeer
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- * @author Graydon Hoare (graydon@redhat.com)
- */
-public abstract class ClasspathFontPeer
- implements FontPeer
-{
-
- /*************************************************************************/
-
- /*
- * Instance Variables
- */
-
- /**
- * The 3 names of this font. all fonts have 3 names, some of which
- * may be equal:
- *
- * logical -- name the font was constructed from
- * family -- a designer or brand name (Helvetica)
- * face -- specific instance of a design (Helvetica Regular)
- *
- * @see isLogicalFontName
- */
-
- protected String logicalName;
- protected String familyName;
- protected String faceName;
-
- /**
- * The font style, which is a combination (by OR-ing) of the font style
- * constants PLAIN, BOLD and ITALIC, in this class.
- */
- protected int style;
-
- /**
- * The font point size. A point is 1/72 of an inch.
- */
- protected float size;
-
- /**
- * The affine transformation the font is currently subject to.
- */
- protected AffineTransform transform;
-
- protected static ClasspathToolkit tk()
- {
- return (ClasspathToolkit)(Toolkit.getDefaultToolkit ());
- }
-
- /*
- * Confusingly, a Logical Font is a concept unrelated to
- * a Font's Logical Name.
- *
- * A Logical Font is one of 6 built-in, abstract font types
- * which must be supported by any java environment: SansSerif,
- * Serif, Monospaced, Dialog, and DialogInput.
- *
- * A Font's Logical Name is the name the font was constructed
- * from. This might be the name of a Logical Font, or it might
- * be the name of a Font Face.
- */
-
- protected static boolean isLogicalFontName(String name)
- {
- String uname = name.toUpperCase ();
- return (uname.equals ("SANSSERIF") ||
- uname.equals ("SERIF") ||
- uname.equals ("MONOSPACED") ||
- uname.equals ("DIALOG") ||
- uname.equals ("DIALOGINPUT"));
- }
-
- protected static String logicalFontNameToFaceName (String name)
- {
- String uname = name.toUpperCase ();
- if (uname.equals("SANSSERIF"))
- return "Helvetica";
- else if (uname.equals ("SERIF"))
- return "Times";
- else if (uname.equals ("MONOSPACED"))
- return "Courier";
- else if (uname.equals ("DIALOG"))
- return "Helvetica";
- else if (uname.equals ("DIALOGINPUT"))
- return "Helvetica";
- else
- return "Helvetica";
- }
-
- protected static String faceNameToFamilyName (String name)
- {
- return name;
- }
-
- public static void copyStyleToAttrs (int style, Map attrs)
- {
- if ((style & Font.BOLD) == Font.BOLD)
- attrs.put (TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
- else
- attrs.put (TextAttribute.WEIGHT, TextAttribute.WEIGHT_REGULAR);
-
- if ((style & Font.ITALIC) == Font.ITALIC)
- attrs.put (TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
- else
- attrs.put (TextAttribute.POSTURE, TextAttribute.POSTURE_REGULAR);
- }
-
- protected static void copyFamilyToAttrs (String fam, Map attrs)
- {
- if (fam != null)
- attrs.put (TextAttribute.FAMILY, fam);
- }
-
- public static void copySizeToAttrs (float size, Map attrs)
- {
- attrs.put (TextAttribute.SIZE, new Float (size));
- }
-
- protected static void copyTransformToAttrs (AffineTransform trans, Map attrs)
- {
- if (trans != null)
- attrs.put(TextAttribute.TRANSFORM, new TransformAttribute (trans));
- }
-
-
- protected void setStandardAttributes (String name, String family, int style,
- float size, AffineTransform trans)
- {
- this.logicalName = name;
-
- if (isLogicalFontName (name))
- this.faceName = logicalFontNameToFaceName (name);
- else
- this.faceName = name;
-
- if (family != null)
- this.familyName = family;
- else
- this.familyName = faceNameToFamilyName (faceName);
-
- this.style = style;
- this.size = size;
- this.transform = trans;
- }
-
-
- protected void setStandardAttributes (String name, Map attribs)
- {
- String family = this.familyName;
- AffineTransform trans = this.transform;
- float size = this.size;
- int style = this.style;
-
- if (attribs.containsKey (TextAttribute.FAMILY))
- family = (String) attribs.get (TextAttribute.FAMILY);
-
- if (name == null)
- name = "SansSerif";
-
- if (attribs.containsKey (TextAttribute.WEIGHT))
- {
- Float weight = (Float) attribs.get (TextAttribute.WEIGHT);
- if (weight.floatValue () >= TextAttribute.WEIGHT_BOLD.floatValue ())
- style += Font.BOLD;
- }
-
- if (attribs.containsKey (TextAttribute.POSTURE))
- {
- Float posture = (Float) attribs.get (TextAttribute.POSTURE);
- if (posture.floatValue () >= TextAttribute.POSTURE_OBLIQUE.floatValue ())
- style += Font.ITALIC;
- }
-
- if (attribs.containsKey (TextAttribute.SIZE))
- {
- Float sz = (Float) attribs.get (TextAttribute.SIZE);
- size = sz.floatValue ();
-
- // Pango doesn't accept 0 as a font size.
- if (size < 1)
- size = 1;
- }
- else
- size = 12;
-
- if (attribs.containsKey (TextAttribute.TRANSFORM))
- {
- TransformAttribute ta = (TransformAttribute)
- attribs.get(TextAttribute.TRANSFORM);
- trans = ta.getTransform ();
- }
-
- setStandardAttributes (name, family, style, size, trans);
- }
-
- protected void getStandardAttributes (Map attrs)
- {
- copyFamilyToAttrs (this.familyName, attrs);
- copySizeToAttrs (this.size, attrs);
- copyStyleToAttrs (this.style, attrs);
- copyTransformToAttrs (this.transform, attrs);
- }
-
-
- /* Begin public API */
-
- public ClasspathFontPeer (String name, Map attrs)
- {
- setStandardAttributes (name, attrs);
- }
-
- public ClasspathFontPeer (String name, int style, int size)
- {
- setStandardAttributes (name, (String)null, style,
- (float)size, (AffineTransform)null);
- }
-
- /**
- * Implementation of {@link Font#getName}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public String getName (Font font)
- {
- return logicalName;
- }
-
- /**
- * Implementation of {@link Font#getFamily()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public String getFamily (Font font)
- {
- return familyName;
- }
-
- /**
- * Implementation of {@link Font#getFamily(Locale)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public String getFamily (Font font, Locale lc)
- {
- return familyName;
- }
-
- /**
- * Implementation of {@link Font#getFontName()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public String getFontName (Font font)
- {
- return faceName;
- }
-
- /**
- * Implementation of {@link Font#getFontName(Locale)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public String getFontName (Font font, Locale lc)
- {
- return faceName;
- }
-
- /**
- * Implementation of {@link Font#getSize}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public float getSize (Font font)
- {
- return size;
- }
-
- /**
- * Implementation of {@link Font#isPlain}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public boolean isPlain (Font font)
- {
- return style == Font.PLAIN;
- }
-
- /**
- * Implementation of {@link Font#isBold}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public boolean isBold (Font font)
- {
- return ((style & Font.BOLD) == Font.BOLD);
- }
-
- /**
- * Implementation of {@link Font#isItalic}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public boolean isItalic (Font font)
- {
- return ((style & Font.ITALIC) == Font.ITALIC);
- }
-
- /**
- * Implementation of {@link Font#deriveFont(int, float)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public Font deriveFont (Font font, int style, float size)
- {
- Map attrs = new HashMap ();
- getStandardAttributes (attrs);
- copyStyleToAttrs (style, attrs);
- copySizeToAttrs (size, attrs);
- return tk().getFont (logicalName, attrs);
- }
-
- /**
- * Implementation of {@link Font#deriveFont(float)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public Font deriveFont (Font font, float size)
- {
- Map attrs = new HashMap ();
- getStandardAttributes (attrs);
- copySizeToAttrs (size, attrs);
- return tk().getFont (logicalName, attrs);
- }
-
- /**
- * Implementation of {@link Font#deriveFont(int)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public Font deriveFont (Font font, int style)
- {
- Map attrs = new HashMap ();
- getStandardAttributes (attrs);
- copyStyleToAttrs (style, attrs);
- return tk().getFont (logicalName, attrs);
- }
-
- /**
- * Implementation of {@link Font#deriveFont(int, AffineTransform)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public Font deriveFont (Font font, int style, AffineTransform t)
- {
- Map attrs = new HashMap ();
- getStandardAttributes (attrs);
- copyStyleToAttrs (style, attrs);
- copyTransformToAttrs (t, attrs);
- return tk().getFont (logicalName, attrs);
- }
-
- /**
- * Implementation of {@link Font#deriveFont(AffineTransform)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public Font deriveFont (Font font, AffineTransform t)
- {
- Map attrs = new HashMap ();
- getStandardAttributes (attrs);
- copyTransformToAttrs (t, attrs);
- return tk().getFont (logicalName, attrs);
- }
-
- /**
- * Implementation of {@link Font#deriveFont(Map)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public Font deriveFont (Font font, Map attrs)
- {
- return tk().getFont (logicalName, attrs);
- }
-
- /**
- * Implementation of {@link Font#getAttributes()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public Map getAttributes (Font font)
- {
- HashMap h = new HashMap ();
- getStandardAttributes (h);
- return h;
- }
-
- /**
- * Implementation of {@link Font#getAvailableAttributes()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public AttributedCharacterIterator.Attribute[] getAvailableAttributes(Font font)
- {
- AttributedCharacterIterator.Attribute a[] =
- new AttributedCharacterIterator.Attribute[5];
- a[0] = TextAttribute.FAMILY;
- a[1] = TextAttribute.SIZE;
- a[2] = TextAttribute.POSTURE;
- a[3] = TextAttribute.WEIGHT;
- a[4] = TextAttribute.TRANSFORM;
- return a;
- }
-
- /**
- * Implementation of {@link Font#getTransform()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public AffineTransform getTransform (Font font)
- {
- if (transform == null)
- transform = new AffineTransform ();
- return transform;
- }
-
- /**
- * Implementation of {@link Font#isTransformed()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public boolean isTransformed (Font font)
- {
- return ! transform.isIdentity ();
- }
-
- /**
- * Implementation of {@link Font#getItalicAngle()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public float getItalicAngle (Font font)
- {
- if ((style & Font.ITALIC) == Font.ITALIC)
- return TextAttribute.POSTURE_OBLIQUE.floatValue ();
- else
- return TextAttribute.POSTURE_REGULAR.floatValue ();
- }
-
-
- /**
- * Implementation of {@link Font#getStyle()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public int getStyle (Font font)
- {
- return style;
- }
-
-
-
-
- /* Remaining methods are abstract */
-
- /**
- * Implementation of {@link Font#canDisplay(char)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract boolean canDisplay (Font font, char c);
-
- /**
- * Implementation of {@link Font#canDisplay(String)},
- * {@link Font#canDisplay(char [], int, int)}, and
- * {@link Font#canDisplay(CharacterIterator, int, int)}.
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract int canDisplayUpTo (Font font, CharacterIterator i, int start, int limit);
-
-
- /**
- * Returns the name of this font face inside the family, for example
- * <i>&#x201c;Light&#x201d;</i>.
- *
- * <p>This method is currently not used by {@link Font}. However,
- * this name would be needed by any serious desktop publishing
- * application.
- *
- * @param font the font whose sub-family name is requested.
- *
- * @param locale the locale for which to localize the name. If
- * <code>locale</code> is <code>null</code>, the returned name is
- * localized to the user&#x2019;s default locale.
- *
- * @return the name of the face inside its family, or
- * <code>null</code> if the font does not provide a sub-family name.
- */
-
- public abstract String getSubFamilyName (Font font, Locale locale);
-
-
- /**
- * Implementation of {@link Font#getPSName()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract String getPostScriptName (Font font);
-
-
- /**
- * Implementation of {@link Font#getNumGlyphs()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract int getNumGlyphs (Font font);
-
-
- /**
- * Implementation of {@link Font#getMissingGlyphCode()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract int getMissingGlyphCode (Font font);
-
-
- /**
- * Implementation of {@link Font#getBaselineFor(char)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract byte getBaselineFor (Font font, char c);
-
-
- /**
- * Returns a name for the specified glyph. This is useful for
- * generating PostScript or PDF files that embed some glyphs of a
- * font. If the implementation follows glyph naming conventions
- * specified by Adobe, search engines can extract the original text
- * from the generated PostScript and PDF files.
- *
- * <p>This method is currently not used by GNU Classpath. However,
- * it would be very useful for someone wishing to write a good
- * PostScript or PDF stream provider for the
- * <code>javax.print</code> package.
- *
- * <p><b>Names are not unique:</b> Under some rare circumstances,
- * the same name can be returned for different glyphs. It is
- * therefore recommended that printer drivers check whether the same
- * name has already been returned for antoher glyph, and make the
- * name unique by adding the string ".alt" followed by the glyph
- * index.</p>
- *
- * <p>This situation would occur for an OpenType or TrueType font
- * that has a <code>post</code> table of format 3 and provides a
- * mapping from glyph IDs to Unicode sequences through a
- * <code>Zapf</code> table. If the same sequence of Unicode
- * codepoints leads to different glyphs (depending on contextual
- * position, for example, or on typographic sophistication level),
- * the same name would get synthesized for those glyphs. To avoid
- * this, the font peer would have to go through the names of all
- * glyphs, which would make this operation very inefficient with
- * large fonts.
- *
- * @param font the font containing the glyph whose name is
- * requested.
- *
- * @param glyphIndex the glyph whose name the caller wants to
- * retrieve.
- *
- * @return the glyph name, or <code>null</code> if a font does not
- * provide glyph names.
- */
-
- public abstract String getGlyphName (Font font, int glyphIndex);
-
-
- /**
- * Implementation of {@link
- * Font#createGlyphVector(FontRenderContext, String)}, {@link
- * Font#createGlyphVector(FontRenderContext, char[])}, and {@link
- * Font#createGlyphVector(FontRenderContext, CharacterIterator)}.
- *
- * @param font the font object that the created GlyphVector will return
- * when it gets asked for its font. This argument is needed because the
- * public API of {@link GlyphVector} works with {@link java.awt.Font},
- * not with font peers.
- */
-
- public abstract GlyphVector createGlyphVector (Font font,
- FontRenderContext frc,
- CharacterIterator ci);
-
-
- /**
- * Implementation of {@link Font#createGlyphVector(FontRenderContext,
- * int[])}.
- *
- * @param font the font object that the created GlyphVector will return
- * when it gets asked for its font. This argument is needed because the
- * public API of {@link GlyphVector} works with {@link java.awt.Font},
- * not with font peers.
- */
-
- public abstract GlyphVector createGlyphVector (Font font,
- FontRenderContext ctx,
- int[] glyphCodes);
-
-
- /**
- * Implementation of {@link Font#layoutGlyphVector(FontRenderContext,
- * char[], int, int, int)}.
- *
- * @param font the font object that the created GlyphVector will return
- * when it gets asked for its font. This argument is needed because the
- * public API of {@link GlyphVector} works with {@link java.awt.Font},
- * not with font peers.
- */
-
- public abstract GlyphVector layoutGlyphVector (Font font,
- FontRenderContext frc,
- char[] chars, int start,
- int limit, int flags);
-
-
- /**
- * Implementation of {@link Font#getFontMetrics()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract FontMetrics getFontMetrics (Font font);
-
-
- /**
- * Implementation of {@link Font#hasUniformLineMetrics()}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract boolean hasUniformLineMetrics (Font font);
-
-
- /**
- * Implementation of {@link Font#getLineMetrics(CharacterIterator, int,
- * int, FontRenderContext)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract LineMetrics getLineMetrics (Font font,
- CharacterIterator ci,
- int begin, int limit,
- FontRenderContext rc);
-
- /**
- * Implementation of {@link Font#getMaxCharBounds(FontRenderContext)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract Rectangle2D getMaxCharBounds (Font font,
- FontRenderContext rc);
-
- /**
- * Implementation of {@link Font#getStringBounds(CharacterIterator, int,
- * int, FontRenderContext)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract Rectangle2D getStringBounds (Font font,
- CharacterIterator ci,
- int begin, int limit,
- FontRenderContext frc);
-
-}
diff --git a/libjava/gnu/java/awt/peer/ClasspathTextLayoutPeer.java b/libjava/gnu/java/awt/peer/ClasspathTextLayoutPeer.java
deleted file mode 100644
index 70df2ef74ef..00000000000
--- a/libjava/gnu/java/awt/peer/ClasspathTextLayoutPeer.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* ClasspathTextLayoutPeer.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-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;
-
-/**
- * @author Graydon Hoare
- */
-
-public interface ClasspathTextLayoutPeer
-{
- TextHitInfo getStrongCaret (TextHitInfo hit1,
- TextHitInfo hit2);
-
- void draw (Graphics2D g2, float x, float y);
-
- byte getBaseline ();
-
- boolean isLeftToRight ();
- boolean isVertical ();
-
- float getAdvance ();
- float getAscent ();
- float getDescent ();
- float getLeading ();
-
- int getCharacterCount ();
- byte getCharacterLevel (int index);
-
- float[] getBaselineOffsets ();
- Shape getBlackBoxBounds (int firstEndpoint, int secondEndpoint);
- Rectangle2D getBounds ();
-
- float[] getCaretInfo (TextHitInfo hit, Rectangle2D bounds);
- Shape getCaretShape (TextHitInfo hit, Rectangle2D bounds);
- Shape[] getCaretShapes (int offset, Rectangle2D bounds,
- TextLayout.CaretPolicy policy);
-
- Shape getLogicalHighlightShape (int firstEndpoint, int secondEndpoint,
- Rectangle2D bounds);
- int[] getLogicalRangesForVisualSelection (TextHitInfo firstEndpoint,
- TextHitInfo secondEndpoint);
-
- TextHitInfo getNextLeftHit (int offset, TextLayout.CaretPolicy policy);
- TextHitInfo getNextRightHit (int offset, TextLayout.CaretPolicy policy);
- TextHitInfo hitTestChar (float x, float y, Rectangle2D bounds);
- TextHitInfo getVisualOtherHit (TextHitInfo hit);
-
- float getVisibleAdvance ();
- Shape getOutline (AffineTransform tx);
- Shape getVisualHighlightShape (TextHitInfo firstEndpoint,
- TextHitInfo secondEndpoint,
- Rectangle2D bounds);
-
- TextLayout getJustifiedLayout (float justificationWidth);
- void handleJustify (float justificationWidth);
-
- Object clone ();
- int hashCode ();
- boolean equals (ClasspathTextLayoutPeer tl);
- String toString ();
-}
diff --git a/libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java b/libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java
deleted file mode 100644
index 4c64a1d2d18..00000000000
--- a/libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* EmbeddedWindowPeer.java -- Interface for window peers that may be
- embedded into other applications
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-import java.awt.peer.FramePeer;
-
-public interface EmbeddedWindowPeer extends FramePeer
-{
- void embed (long handle);
-}
diff --git a/libjava/gnu/java/awt/peer/GLightweightPeer.java b/libjava/gnu/java/awt/peer/GLightweightPeer.java
deleted file mode 100644
index 3bcaebcea62..00000000000
--- a/libjava/gnu/java/awt/peer/GLightweightPeer.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/* GLightweightPeer.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-import java.awt.AWTEvent;
-import java.awt.AWTException;
-import java.awt.BufferCapabilities;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.GraphicsConfiguration;
-import java.awt.Image;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.awt.event.PaintEvent;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageObserver;
-import java.awt.image.ImageProducer;
-import java.awt.image.VolatileImage;
-import java.awt.peer.ContainerPeer;
-import java.awt.peer.LightweightPeer;
-
-/*
- * Another possible implementation strategy for lightweight peers is
- * to make GLightweightPeer a placeholder class that implements
- * LightweightPeer. Then the Component and Container classes could
- * identify a peer as lightweight and handle it specially. The
- * current approach is probably more clear but less efficient.
- */
-
-/**
- * A stub class that implements the ComponentPeer and ContainerPeer
- * interfaces using callbacks into the Component and Container
- * classes. GLightweightPeer allows the Component and Container
- * classes to treat lightweight and heavyweight peers in the same way.
- *
- * Lightweight components are painted directly onto their parent
- * containers through an Image object provided by the toolkit.
- */
-public class GLightweightPeer
- implements LightweightPeer, ContainerPeer
-{
- private Component comp;
-
- private Insets containerInsets;
-
- public GLightweightPeer(Component comp)
- {
- this.comp = comp;
- }
-
- // -------- java.awt.peer.ContainerPeer implementation:
-
- public Insets insets()
- {
- return getInsets ();
- }
-
- public Insets getInsets()
- {
- if (containerInsets == null)
- containerInsets = new Insets (0,0,0,0);
- return containerInsets;
- }
-
- public void beginValidate()
- {
- }
-
- public void endValidate()
- {
- }
-
- public void beginLayout()
- {
- }
-
- public void endLayout()
- {
- }
-
- public boolean isPaintPending()
- {
- return false;
- }
-
- // -------- java.awt.peer.ComponentPeer implementation:
-
- public int checkImage(Image img, int width, int height, ImageObserver o)
- {
- return comp.getToolkit().checkImage(img, width, height, o);
- }
-
- public Image createImage(ImageProducer prod)
- {
- return comp.getToolkit().createImage(prod);
- }
-
- /* This method is not called. */
- public Image createImage(int width, int height)
- {
- return null;
- }
-
- public void disable() {}
-
- public void dispose() {}
-
- public void enable() {}
-
- public GraphicsConfiguration getGraphicsConfiguration()
- {
- return null;
- }
-
- public FontMetrics getFontMetrics(Font f)
- {
- return comp.getToolkit().getFontMetrics(f);
- }
-
- /* Returning null here tells the Component object that called us to
- * use its parent's Graphics. */
- public Graphics getGraphics()
- {
- return null;
- }
-
- public Point getLocationOnScreen()
- {
- Point parentLocation = comp.getParent().getLocationOnScreen();
- return new Point (parentLocation.x + comp.getX(),
- parentLocation.y + comp.getY());
- }
-
- public Dimension getMinimumSize()
- {
- return new Dimension(comp.getWidth(), comp.getHeight());
- }
-
- /* A lightweight component's preferred size is equivalent to its
- * Component width and height values. */
- public Dimension getPreferredSize()
- {
- return new Dimension(comp.getWidth(), comp.getHeight());
- }
-
- /* Returning null here tells the Component object that called us to
- * use its parent's Toolkit. */
- public Toolkit getToolkit()
- {
- return null;
- }
-
- public void handleEvent(AWTEvent e) {}
-
- public void hide() {}
-
- public boolean isFocusable()
- {
- return false;
- }
-
- public boolean isFocusTraversable()
- {
- return false;
- }
-
- public Dimension minimumSize()
- {
- return getMinimumSize();
- }
-
- public Dimension preferredSize()
- {
- return getPreferredSize();
- }
-
- public void paint(Graphics graphics) {}
-
- public boolean prepareImage(Image img, int width, int height,
- ImageObserver o)
- {
- return comp.getToolkit().prepareImage(img, width, height, o);
- }
-
- public void print(Graphics graphics) {}
-
- public void repaint(long tm, int x, int y, int width, int height) {}
-
- public void requestFocus() {}
-
- public boolean requestFocus(Component source, boolean bool1, boolean bool2, long x)
- {
- return false;
- }
-
- public void reshape(int x, int y, int width, int height) {}
-
- public void setBackground(Color color) {}
-
- public void setBounds(int x, int y, int width, int height) {}
-
- public void setCursor(Cursor cursor) {}
-
- public void setEnabled(boolean enabled) {}
-
- public void setEventMask(long eventMask) {}
-
- public void setFont(Font font) {}
-
- public void setForeground(Color color) {}
-
- public void setVisible(boolean visible) {}
-
- public void show() {}
-
- public ColorModel getColorModel ()
- {
- return comp.getColorModel ();
- }
-
- public boolean isObscured()
- {
- return false;
- }
-
- public boolean canDetermineObscurity()
- {
- return false;
- }
-
- public void coalescePaintEvent(PaintEvent e) { }
-
- public void updateCursorImmediately() { }
-
- public VolatileImage createVolatileImage(int width, int height)
- {
- return null;
- }
-
- public boolean handlesWheelScrolling()
- {
- return false;
- }
-
- public void createBuffers(int x, BufferCapabilities capabilities)
- throws AWTException { }
-
- public Image getBackBuffer()
- {
- return null;
- }
-
- public void flip(BufferCapabilities.FlipContents contents) { }
-
- public void destroyBuffers() { }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GThreadMutex.java b/libjava/gnu/java/awt/peer/gtk/GThreadMutex.java
deleted file mode 100644
index e73df9e5509..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GThreadMutex.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* GThreadMutex.java -- Implements a mutex object for glib's gthread
- abstraction, for use with GNU Classpath's --portable-native-sync option.
- This is used in gthread-jni.c
-
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/** Implements a mutex object for glib's gthread
- abstraction, for use with GNU Classpath's --portable-native-sync option.
- This is used in gthread-jni.c.
-
- We use this object to implement the POSIX semantics for Mutexes. They are
- needed are needed for the function vector that is passed to glib's
- g_thread subpackage's initialization function.
-
- The GThreadMutex object itself serves as the Real Lock; if code has
- entered the monitor for this GThreadMutex object (in Java language, if
- it's synchronized on this object) then it holds the lock that this object
- represents.
-
- @author Steven Augart
- May, 2004
-
-
-*/
-
-class GThreadMutex
-{
- /** Might "lock" be locked? Is anyone waiting
- to get that lock? How long is the queue?
-
- If zero, nobody holds a lock on this GThreadMutex object, and nobody is
- trying to get one. Before someone attempts to acquire a lock on this
- object, they must increment potentialLockers. After they release their
- lock on this object, they must decrement potentialLockers.
-
- Access to this field is guarded by synchronizing on the object
- <code>lockForPotentialLockers</code>.
-
- After construction, we only access this field via JNI.
- */
- volatile int potentialLockers;
-
- /** An object to synchronize to if you want to examine or modify the
- <code>potentialLockers</code> field. Only hold this lock for brief
- moments, just long enough to check or set the value of
- <code>lockForPotentialLockers</code>.
-
- We use this representation so that g_thread_mutex_trylock() will work
- with the POSIX semantics. This is the only case in which you ever hold a
- lock on <code>lockForPotentialLockers</code> while trying to get another
- lock -- if you are the mutex_trylock() implementation, and you have just
- checked that <code>potentialLockers</code> has the value zero. In that
- case, mutex_trylock() holds the lock on lockForPotentialLockers so that
- another thread calling mutex_trylock() or mutex_lock() won't increment
- potentialLockers after we've checked it and before we've gained the lock
- on the POSIX mutex. Of course, in that case the operation of gaining
- the POSIX lock itself will succeed immediately, and once it has
- succeeded, trylock releases lockForPotentialLockers right away,
- incremented to 1 (one).
-
- After construction, we only access this field via JNI.
- */
- Object lockForPotentialLockers;
-
- GThreadMutex()
- {
- potentialLockers = 0;
- lockForPotentialLockers = new Object();
- }
-}
-// Local Variables:
-// c-file-style: "gnu"
-// End:
diff --git a/libjava/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java b/libjava/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java
deleted file mode 100644
index 9a1b8e3a30a..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/* GThreadNativeMethodRunner.java -- Implements pthread_create(), under
- glib's gthread abstraction, for use with GNU Classpath's
- --portable-native-sync option.
- This is used by gthread-jni.c
-
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.lang.ref.WeakReference;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-/** Implements pthread_create(), under glib's gthread abstraction, for use
- with GNU Classpath's --portable-native-sync option. This is used in
- gthread-jni.c
-
- Also implements a registry for threads, mapping Thread objects to small
- integers. The registry uses weak references for threads that aren't
- joinable, so that they will be garbage collected.
-
- There are a number of possible alternative implementations.
-
-
- The rest of this comment consists of an answer to a question that was
- raised on the commit-classpath mailing list:
-
- Mark Wielaard wrote:
-
- > Can't we assume that jobject and gpointer are both (void *) so we don't
- > need the int <-> Thread (global jobject ref) mapping?
- > Maybe there are platforms where jobject and gpointer aren't the same,
- > but I guess that is pretty unlikely.
-
-
- I agree with you on the pointer size issues. A gpointer is a void *, so
- it's certainly guaranteed to be at least as large as any other
- pointer. And a jobject is implicitly an opaque pointer (in Jikes RVM, we
- use small integers, but we coerce them into the representation of a
- pointer).
-
- The int <==> Thread mapping addresses a different issue. I realize that I
- did not document this properly (two and a half lines in thread_create),
- and the point is subtle (at least to me; took me a while to figure out).
-
- The int => Thread mapping always returns jobjects that are local
- references, not global ones. This is because Thread objects need to be
- able to go away and be garbage collected after the thread they refer to
- has died.
-
- If we keep a global object reference to a thread, then when do we delete
- that global object reference? We have an answer in the case of GThread
- objects that were explicitly created with the joinable attribute. It is
- safe for us to maintain a global reference to any joinable thread, since
- the joinable thread must linger (even if only in a zombie state)
- until it's explicitly joined via a g_thread_join() call. The global ref
- could be cleaned up at that point too.
-
- However, in the case of GThreads that were created non-joinable by
- g_thread_create(), and in the case of Java threads that were created
- within pure Java code (not via g_thread_create()), we don't want them to
- linger forever, and there is no way to tell when the last reference
- to such threads needs to expire. In the case of this application -- AWT
- with GTK peers -- it would probably be safe anyway, since there are not
- very many threads we create, but I was going for correctness even in the
- case of long-running programs that might set up and tear down AWT
- interfaces many times.
-
- So, I duplicated the POSIX thread-ID semantics. The thread ID of a
- non-joinable thread remains valid as long as that thread is still alive.
- Once that thread dies, the old thread ID may be reused at any moment. And
- that's why the array indexed by thread ID numbers is an array of weak
- references.
-
- That's also why the int => Thread jobject mapping function always returns
- local references, since global references would lock the Thread in memory
- forever.
-
- I would dearly love there to be a cleaner solution. I dislike the
- repeated dips from C code into Java that are necessary to look up thread
- ID numbers. If anyone can think of one, I'm all ears.
-*/
-
-class GThreadNativeMethodRunner
- extends Thread
-{
- /** The C function pointer that was passed to g_thread_create().
- Specifically, this the numeric address of an object of
- C type "void *(*funcPtr)(void *funcArg)".
- */
- private final long funcPtr;
-
- /** The argument for the function "funcPtr(funcArg)". */
- private final long funcArg;
-
- GThreadNativeMethodRunner(long funcPtr, long funcArg, boolean joinable)
- {
- this.funcPtr = funcPtr;
- this.funcArg = funcArg;
-
- if (joinable)
- registerSelfJoinable();
- }
-
- public void run()
- {
- nativeRun(funcPtr, funcArg);
- }
-
- private native void nativeRun(long funcPtr, long funcArg);
-
- /** THREADS is an array of threads, indexed by thread ID codes. Not sure
- whether this is the "best" approach but it does make it O(1) to look up a
- thread by its ID.
-
- Zero is a valid thread ID code. Any negative number is invalid.
-
- Possible future fixes (TODO?)
-
- - The THREADS array will only grow. probably not a problem.
- But we could keep count when nulling entries and shrink when we have
- lots of nulls at the end. Probably not worth it. --mjw
-
- - Could make this a set of Object; see the comment on "joinable" below.
-
- The initial size of 17 is just a starting point. Any number will do,
- including zero.
- */
- private static WeakReference[] threads = new WeakReference[17];
-
- /** Used by threadToThreadID, below. Returns the registration number of
- the newly-registered thread.
- */
- private static synchronized int registerThread(Thread t)
- {
- int i;
-
- for (i = 0; i < threads.length; ++i)
- {
- WeakReference ref = threads[i];
- if (ref == null)
- break; // found an empty spot.
- }
-
- if (i == threads.length)
- {
- /* expand the array */
- WeakReference[] bigger = new WeakReference[threads.length * 2];
- System.arraycopy(threads, 0, bigger, 0, threads.length);
- threads = bigger;
- }
-
- threads[i] = new WeakReference(t);
-
- return i;
- }
-
- /** Look up the Thread ID # for a Thread. Assign a Thread ID # if none
- exists. This is a general routine for handling all threads, including
- the VM's main thread, if appropriate.
-
-
- Runs in O(n/2) time.
-
- We can't just issue a threadID upon thread creation. If we were to do
- that, not all threads would have a threadID, because not all threads
- are launched by GThreadNativeMethodRunner.
- */
- static synchronized int threadToThreadID(Thread t)
- {
- for (int i = 0; i < threads.length; ++i )
- {
- if (threads[i] == null)
- continue;
- Thread referent = (Thread) threads[i].get();
- if (referent == null)
- {
- threads[i] = null; // Purge the dead WeakReference.
- continue;
- }
- if (referent.equals(t))
- return i;
- } // for()
-
- /* No match found. */
- return registerThread(t);
- }
-
- /** @param threadID Must be a non-negative integer.
-
- Used to return null if the thread number was out of range or if
- the thread was unregistered. Now we throw an exception.
-
- Possible Alternative Interface: We could go back to returning null in
- some sort of check-free mode, so code that calls this function must
- be prepared to get null.
- */
- static Thread threadIDToThread(int threadID)
- throws IllegalArgumentException
- {
- if (threadID < 0)
- throw new IllegalArgumentException("Received a negative threadID, "
- + threadID);
- if (threadID >= threads.length)
- throw new IllegalArgumentException("Received a threadID (" + threadID
- + ") higher than was"
- + " ever issued");
-
- /* Note: if the user is using a stale reference, things will just
- break. We might end up getting a different thread than the one
- expected.
-
- TODO: Add an error-checking mode where the user's problems with threads
- are announced. For instance, if the user asks for the thread
- associated with a threadID that was never issued, we could print a
- warning or even abort.
-
- TODO: Consider optionally disabling all of the error-checking we
- already have; it probably slows down the implementation. We could
- just return NULL. This is just the reverse of the above TODO item.
- */
-
- WeakReference threadRef = threads[threadID];
-
- if (threadRef == null)
- throw new IllegalArgumentException("Asked to look up a stale or unissued"
- + "threadID (" + threadID + ")" );
-
-
- Thread referent = (Thread) threadRef.get();
- if (referent == null)
- throw new IllegalArgumentException ("Asked to look up a stale threadID ("
- + threadID + ")");
- return referent;
- }
-
- /** Joinable threads need a hard reference, so that they won't go away when
- they die. That is because their thread IDs need to stay valid until the
- thread is joined via thread_join(threadID). Joinable threads have to be
- explicitly joined before they are allowed to go away completely.
-
- Possible Alternative Implementation: Eliminate the Joinable set. When
- calling getThreadIDFromThread() you know whether or not the thread
- is joinable. So just store the Thread itself in the threads array?
- Make that array an Object array and check with instanceof. This
- looks cleaner and more robust to me and it saves a native -> Java
- call. But instanceof might be expensive. --mjw
- */
- private static final Set joinable =
- Collections.synchronizedSet(new HashSet());
-
- /** Only called from the constructor. */
- private void registerSelfJoinable()
- {
- joinable.add(this);
- }
-
- /** This method is only called from JNI, and only after we have succeeded in
- a thread_join() operation. */
- static void deRegisterJoinable(Thread thread)
- {
- joinable.remove(thread);
- }
-}
-
-// Local Variables:
-// c-file-style: "gnu"
-// End:
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java b/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
deleted file mode 100644
index 7a439e83a9d..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/* GdkFontMetrics.java
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 gnu.java.awt.ClasspathToolkit;
-
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Toolkit;
-
-public class GdkFontMetrics extends FontMetrics
-{
-
- private int[] font_metrics;
- GdkFontPeer peer;
-
- static final int FONT_METRICS_ASCENT = 0;
- static final int FONT_METRICS_MAX_ASCENT = 1;
- static final int FONT_METRICS_DESCENT = 2;
- static final int FONT_METRICS_MAX_DESCENT = 3;
- static final int FONT_METRICS_MAX_ADVANCE = 4;
-
- static final int TEXT_METRICS_X_BEARING = 0;
- static final int TEXT_METRICS_Y_BEARING = 1;
- static final int TEXT_METRICS_WIDTH = 2;
- static final int TEXT_METRICS_HEIGHT = 3;
- static final int TEXT_METRICS_X_ADVANCE = 4;
- static final int TEXT_METRICS_Y_ADVANCE = 5;
-
-
- public GdkFontMetrics (Font font)
- {
- super (font.getPeer() instanceof GdkFontPeer
- ? font
- : ((ClasspathToolkit)(Toolkit.getDefaultToolkit ()))
- .getFont (font.getName(), font.getAttributes ()));
-
- peer = (GdkFontPeer) this.font.getPeer();
-
- font_metrics = new int[5];
- double [] hires = new double[5];
- peer.getFontMetrics (hires);
- for (int i = 0; i < 5; ++i)
- font_metrics[i] = (int) hires[i];
- }
-
- public int stringWidth (String str)
- {
- double [] hires = new double[6];
- peer.getTextMetrics(str, hires);
- return (int) hires [TEXT_METRICS_WIDTH];
- }
-
- public int charWidth (char ch)
- {
- return stringWidth (new String (new char[] { ch }));
- }
-
- public int charsWidth (char data[], int off, int len)
- {
- return stringWidth (new String (data, off, len));
- }
-
- /*
- Sun's Motif implementation always returns 0 or 1 here (???), but
- going by the X11 man pages, it seems as though we should return
- font.ascent + font.descent.
- */
- public int getLeading ()
- {
- return 1;
- }
-
- public int getAscent ()
- {
- return font_metrics[FONT_METRICS_ASCENT];
- }
-
- public int getMaxAscent ()
- {
- return font_metrics[FONT_METRICS_MAX_ASCENT];
- }
-
- public int getDescent ()
- {
- return font_metrics[FONT_METRICS_DESCENT];
- }
-
- public int getMaxDescent ()
- {
- return font_metrics[FONT_METRICS_MAX_DESCENT];
- }
-
- public int getMaxAdvance ()
- {
- return font_metrics[FONT_METRICS_MAX_ADVANCE];
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkFontPeer.java b/libjava/gnu/java/awt/peer/gtk/GdkFontPeer.java
deleted file mode 100644
index c6d42b37276..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkFontPeer.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/* GdkFontPeer.java -- Implements FontPeer with GTK+
- Copyright (C) 1999, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 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.text.CharacterIterator;
-import java.text.StringCharacterIterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-public class GdkFontPeer extends ClasspathFontPeer
-{
- static native void initStaticState();
- private final int native_state = GtkGenericPeer.getUniqueInteger ();
- private static ResourceBundle bundle;
-
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary("gtkpeer");
- }
-
- initStaticState ();
-
- try
- {
- bundle = ResourceBundle.getBundle ("gnu.java.awt.peer.gtk.font");
- }
- catch (Throwable ignored)
- {
- bundle = null;
- }
- }
-
- private native void initState ();
- 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 ())
- GdkGraphics2D.releasePeerGraphicsResource(this);
- dispose ();
- }
-
- /*
- * Helpers for the 3-way overloading that this class seems to suffer
- * from. Remove them if you feel like they're a performance bottleneck,
- * for the time being I prefer my code not be written and debugged in
- * triplicate.
- */
-
- private String buildString(CharacterIterator iter)
- {
- StringBuffer sb = new StringBuffer();
- for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next())
- sb.append(c);
- return sb.toString();
- }
-
- private String buildString(CharacterIterator iter, int begin, int limit)
- {
- StringBuffer sb = new StringBuffer();
- int i = 0;
- for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next(), i++)
- {
- if (begin <= i)
- sb.append(c);
- if (limit <= i)
- break;
- }
- return sb.toString();
- }
-
- private String buildString(char[] chars, int begin, int limit)
- {
- return new String(chars, begin, limit - begin);
- }
-
- /* Public API */
-
- public GdkFontPeer (String name, int style)
- {
- // All fonts get a default size of 12 if size is not specified.
- this(name, style, 12);
- }
-
- public GdkFontPeer (String name, int style, int size)
- {
- super(name, style, size);
- initState ();
- setFont (this.familyName, this.style, (int)this.size,
- GtkToolkit.useGraphics2D());
- }
-
- public GdkFontPeer (String name, Map attributes)
- {
- super(name, attributes);
- initState ();
- setFont (this.familyName, this.style, (int)this.size,
- GtkToolkit.useGraphics2D());
- }
-
- public String getSubFamilyName(Font font, Locale locale)
- {
- return null;
- }
-
- public String getPostScriptName(Font font)
- {
- return null;
- }
-
- public boolean canDisplay (Font font, char c)
- {
- // FIXME: inquire with pango
- return true;
- }
-
- public int canDisplayUpTo (Font font, CharacterIterator i, int start, int limit)
- {
- // 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 getGlyphVector(buildString (i), font, ctx);
- }
-
- public GlyphVector createGlyphVector (Font font,
- FontRenderContext ctx,
- int[] glyphCodes)
- {
- return null;
- // return new GdkGlyphVector (font, this, ctx, glyphCodes);
- }
-
- public byte getBaselineFor (Font font, char c)
- {
- throw new UnsupportedOperationException ();
- }
-
- protected class GdkFontLineMetrics extends LineMetrics
- {
- FontMetrics fm;
- int nchars;
-
- public GdkFontLineMetrics (FontMetrics m, int n)
- {
- fm = m;
- nchars = n;
- }
-
- public float getAscent()
- {
- return (float) fm.getAscent ();
- }
-
- public int getBaselineIndex()
- {
- return Font.ROMAN_BASELINE;
- }
-
- public float[] getBaselineOffsets()
- {
- return new float[3];
- }
-
- public float getDescent()
- {
- return (float) fm.getDescent ();
- }
-
- public float getHeight()
- {
- return (float) fm.getHeight ();
- }
-
- public float getLeading() { return 0.f; }
- public int getNumChars() { return nchars; }
- public float getStrikethroughOffset() { return 0.f; }
- public float getStrikethroughThickness() { return 0.f; }
- public float getUnderlineOffset() { return 0.f; }
- public float getUnderlineThickness() { return 0.f; }
-
- }
-
- public LineMetrics getLineMetrics (Font font, CharacterIterator ci,
- int begin, int limit, FontRenderContext rc)
- {
- return new GdkFontLineMetrics (getFontMetrics (font), limit - begin);
- }
-
- public Rectangle2D getMaxCharBounds (Font font, FontRenderContext rc)
- {
- throw new UnsupportedOperationException ();
- }
-
- public int getMissingGlyphCode (Font font)
- {
- throw new UnsupportedOperationException ();
- }
-
- public String getGlyphName (Font font, int glyphIndex)
- {
- throw new UnsupportedOperationException ();
- }
-
- public int getNumGlyphs (Font font)
- {
- throw new UnsupportedOperationException ();
- }
-
- public Rectangle2D getStringBounds (Font font, CharacterIterator ci,
- int begin, int limit, FontRenderContext frc)
- {
- GdkGlyphVector gv = getGlyphVector(buildString (ci, begin, limit), font, frc);
- return gv.getVisualBounds();
- }
-
- public boolean hasUniformLineMetrics (Font font)
- {
- return true;
- }
-
- public GlyphVector layoutGlyphVector (Font font, FontRenderContext frc,
- char[] chars, int start, int limit,
- int flags)
- {
- int nchars = (limit - start) + 1;
- char[] nc = new char[nchars];
-
- for (int i = 0; i < nchars; ++i)
- nc[i] = chars[start + i];
-
- return createGlyphVector (font, frc,
- new StringCharacterIterator (new String (nc)));
- }
-
- public LineMetrics getLineMetrics (Font font, String str,
- FontRenderContext frc)
- {
- return new GdkFontLineMetrics (getFontMetrics (font), str.length ());
- }
-
- public FontMetrics getFontMetrics (Font font)
- {
- return new GdkFontMetrics (font);
- }
-
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGlyphVector.java b/libjava/gnu/java/awt/peer/gtk/GdkGlyphVector.java
deleted file mode 100644
index f0ddea43a12..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkGlyphVector.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/* GdkGlyphVector.java -- Glyph vector object
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Font;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.awt.font.FontRenderContext;
-import java.awt.font.GlyphJustificationInfo;
-import java.awt.font.GlyphMetrics;
-import java.awt.font.GlyphVector;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-
-public class GdkGlyphVector extends GlyphVector
-{
-
- /* 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)
- {
- 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)
- {
- 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]));
- }
- }
-
- /*
- geometric notes:
-
- the FRC contains a mapping from points -> pixels.
-
- typographics points are typically 1/72 of an inch.
-
- pixel displays are often around 72 dpi.
-
- so the FRC can get away with using an identity transform on a screen,
- often. behavior is documented by sun to fall back to an identity
- transform if the internal transformation is null.
-
- coordinates coming up from pango are expressed as floats -- in device
- space, so basically pixels-with-fractional-bits -- derived from their
- storage format in pango (1024ths of pixels).
-
- it is not clear from the javadocs whether the results of methods like
- getGlyphPositions ought to return coordinates in device space, or
- "point" space, or what. for now I'm returning them in device space.
-
- */
-
- public double[] getExtents()
- {
- return extents;
- }
-
- public int[] getCodes()
- {
- return codes;
- }
-
- public Font getFont ()
- {
- return font;
- }
-
- public FontRenderContext getFontRenderContext ()
- {
- return fontRenderContext;
- }
-
- public int getGlyphCharIndex (int 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,
- int numEntries,
- int[] codeReturn)
- {
- int ix[] = codeReturn;
- if (ix == null)
- ix = new int[numEntries];
-
- for (int i = 0; i < numEntries; i++)
- ix[i] = getGlyphCharIndex (beginGlyphIndex + i);
- return ix;
- }
-
- public int getGlyphCode (int glyphIndex)
- {
- return codes[glyphIndex];
- }
-
- public int[] getGlyphCodes (int beginGlyphIndex, int numEntries,
- int[] codeReturn)
- {
- if (codeReturn == null)
- codeReturn = new int[numEntries];
-
- System.arraycopy(codes, beginGlyphIndex, codeReturn, 0, numEntries);
- return codeReturn;
- }
-
- public Shape getGlyphLogicalBounds (int i)
- {
- return new Rectangle2D.Double (extents[8*i], extents[8*i + 1],
- extents[8*i + 2], extents[8*i + 3]);
- }
-
- public GlyphMetrics getGlyphMetrics (int i)
- {
- // 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)
- {
- throw new UnsupportedOperationException ();
- }
-
- public Shape getGlyphOutline (int glyphIndex, float x, float y)
- {
- throw new UnsupportedOperationException ();
- }
-
- public Rectangle getGlyphPixelBounds (int i,
- FontRenderContext renderFRC,
- float x, float y)
- {
- return new Rectangle((int) x, (int) y,
- (int) extents[8*i + 6], (int) extents[8*i + 7]);
- }
-
- public Point2D getGlyphPosition (int i)
- {
- return new Point2D.Double (extents[10*i + 8],
- extents[10*i + 9]);
- }
-
- public float[] getGlyphPositions (int beginGlyphIndex,
- int numEntries,
- float[] positionReturn)
- {
- float fx[] = positionReturn;
- if (fx == null)
- fx = new float[numEntries * 2];
-
- for (int i = 0; i < numEntries; ++i)
- {
- 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
- // vectors; docs specify null is an ok return here.
- return null;
- }
-
- public Shape getGlyphVisualBounds (int i)
- {
- return new Rectangle2D.Double(extents[8*i + 4], extents[8*i + 5],
- extents[8*i + 6], extents[8*i + 7]);
- }
-
- public int getLayoutFlags ()
- {
- return 0;
- }
-
- public Rectangle2D getLogicalBounds ()
- {
- return allLogical;
- }
-
- public int getNumGlyphs ()
- {
- return codes.length;
- }
-
- public Shape getOutline ()
- {
- throw new UnsupportedOperationException ();
- }
-
- public Rectangle getPixelBounds (FontRenderContext renderFRC,
- float x, float y)
- {
- return new Rectangle((int)x,
- (int)y,
- (int) allVisual.getWidth(),
- (int) allVisual.getHeight());
- }
-
- public Rectangle2D getVisualBounds ()
- {
- return allVisual;
- }
-
- public void performDefaultLayout ()
- {
- }
-
- public void setGlyphPosition (int i, Point2D newPos)
- {
- 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,
- AffineTransform newTX)
- {
- // not yet.. maybe not ever?
- throw new UnsupportedOperationException ();
- }
-
- public boolean equals(GlyphVector gv)
- {
- if (gv == null)
- return false;
-
- if (! (gv instanceof GdkGlyphVector))
- return false;
-
- 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)
- {
- throw new UnsupportedOperationException ();
- }
-
- public Shape getOutline(float x, float y)
- {
- throw new UnsupportedOperationException ();
- }
-
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
deleted file mode 100644
index cc3a1009d86..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
+++ /dev/null
@@ -1,487 +0,0 @@
-/* GdkGraphics.java
- Copyright (C) 1998, 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Image;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.awt.SystemColor;
-import java.awt.image.ImageObserver;
-import java.text.AttributedCharacterIterator;
-
-public class GdkGraphics extends Graphics
-{
- private final int native_state = GtkGenericPeer.getUniqueInteger();
-
- Color color, xorColor;
- GtkComponentPeer component;
- Font font;
- Rectangle clip;
-
- int xOffset = 0;
- int yOffset = 0;
-
- static final int GDK_COPY = 0, GDK_XOR = 2;
-
- native void initState (GtkComponentPeer component);
- native void initState (int width, int height);
- native void copyState (GdkGraphics g);
-
- GdkGraphics (GdkGraphics g)
- {
- color = g.color;
- xorColor = g.xorColor;
- font = g.font;
- clip = new Rectangle (g.clip);
- component = g.component;
-
- copyState (g);
- }
-
- GdkGraphics (int width, int height)
- {
- initState (width, height);
- color = Color.black;
- clip = new Rectangle (0, 0, width, height);
- font = new Font ("Dialog", Font.PLAIN, 12);
- }
-
- GdkGraphics (GtkComponentPeer component)
- {
- this.component = component;
- font = component.awtComponent.getFont ();
-
- if (component.isRealized ())
- initComponentGraphics ();
- else
- connectSignals (component);
- }
-
- void initComponentGraphics ()
- {
- initState (component);
- color = component.awtComponent.getForeground ();
- Dimension d = component.awtComponent.getSize ();
- clip = new Rectangle (0, 0, d.width, d.height);
- }
-
- native void connectSignals (GtkComponentPeer component);
-
- public native void clearRect(int x, int y, int width, int height);
-
- public void clipRect (int x, int y, int width, int height)
- {
- if (component != null && ! component.isRealized ())
- return;
-
- clip = clip.intersection (new Rectangle (x, y, width, height));
- setClipRectangle (clip.x, clip.y, clip.width, clip.height);
- }
-
- public native void copyArea(int x, int y, int width, int height,
- int dx, int dy);
-
- public Graphics create ()
- {
- return new GdkGraphics (this);
- }
-
- public native void dispose();
-
- native void copyPixmap (Graphics g, int x, int y, int width, int height);
- native void copyAndScalePixmap (Graphics g, boolean flip_x, boolean flip_y,
- int src_x, int src_y,
- int src_width, int src_height,
- int dest_x, int dest_y,
- int dest_width, int dest_height);
- public boolean drawImage (Image img, int x, int y,
- Color bgcolor, ImageObserver observer)
- {
- if (component != null && ! component.isRealized ())
- return false;
-
- if (img instanceof GtkOffScreenImage)
- {
- int width = img.getWidth (null);
- int height = img.getHeight (null);
- copyPixmap (img.getGraphics (),
- x, y, width, height);
- return true;
- }
-
- GtkImage image = (GtkImage) img;
- new GtkImagePainter (image, this, x, y, -1, -1, bgcolor, observer);
- return image.isLoaded ();
- }
-
- public boolean drawImage (Image img, int x, int y, ImageObserver observer)
- {
- if (component != null && ! component.isRealized ())
- return false;
-
- if (img instanceof GtkOffScreenImage)
- {
- int width = img.getWidth (null);
- int height = img.getHeight (null);
- copyPixmap (img.getGraphics (),
- x, y, width, height);
- return true;
- }
-
- if (component != null)
- return drawImage (img, x, y, component.getBackground (), observer);
- else
- return drawImage (img, x, y, SystemColor.window, observer);
- }
-
- public boolean drawImage (Image img, int x, int y, int width, int height,
- Color bgcolor, ImageObserver observer)
- {
- if (component != null && ! component.isRealized ())
- return false;
-
- if (img instanceof GtkOffScreenImage)
- {
- copyAndScalePixmap (img.getGraphics (), false, false,
- 0, 0, img.getWidth (null), img.getHeight (null),
- x, y, width, height);
- return true;
- }
-
- GtkImage image = (GtkImage) img;
- new GtkImagePainter (image, this, x, y, width, height, bgcolor, observer);
- return image.isLoaded ();
- }
-
- public boolean drawImage (Image img, int x, int y, int width, int height,
- ImageObserver observer)
- {
- if (component != null && ! component.isRealized ())
- return false;
-
- if (component != null)
- return drawImage (img, x, y, width, height, component.getBackground (),
- observer);
- else
- return drawImage (img, x, y, width, height, SystemColor.window,
- observer);
- }
-
- public boolean drawImage (Image img, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2,
- Color bgcolor, ImageObserver observer)
- {
- if (component != null && ! component.isRealized ())
- return false;
-
- if (img instanceof GtkOffScreenImage)
- {
- int dx_start, dy_start, d_width, d_height;
- int sx_start, sy_start, s_width, s_height;
- boolean x_flip = false;
- boolean y_flip = false;
-
- if (dx1 < dx2)
- {
- dx_start = dx1;
- d_width = dx2 - dx1;
- }
- else
- {
- dx_start = dx2;
- d_width = dx1 - dx2;
- x_flip ^= true;
- }
- if (dy1 < dy2)
- {
- dy_start = dy1;
- d_height = dy2 - dy1;
- }
- else
- {
- dy_start = dy2;
- d_height = dy1 - dy2;
- y_flip ^= true;
- }
- if (sx1 < sx2)
- {
- sx_start = sx1;
- s_width = sx2 - sx1;
- }
- else
- {
- sx_start = sx2;
- s_width = sx1 - sx2;
- x_flip ^= true;
- }
- if (sy1 < sy2)
- {
- sy_start = sy1;
- s_height = sy2 - sy1;
- }
- else
- {
- sy_start = sy2;
- s_height = sy1 - sy2;
- y_flip ^= true;
- }
-
- copyAndScalePixmap (img.getGraphics (), x_flip, y_flip,
- sx_start, sy_start, s_width, s_height,
- dx_start, dy_start, d_width, d_height);
- return true;
- }
-
- GtkImage image = (GtkImage) img;
- new GtkImagePainter (image, this, dx1, dy1, dx2, dy2,
- sx1, sy1, sx2, sy2, bgcolor, observer);
- return image.isLoaded ();
- }
-
- public boolean drawImage (Image img, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2,
- ImageObserver observer)
- {
- if (component != null && ! component.isRealized ())
- return false;
-
- if (component != null)
- return drawImage (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2,
- component.getBackground (), observer);
- else
- return drawImage (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2,
- SystemColor.window, observer);
- }
-
- public native void drawLine(int x1, int y1, int x2, int y2);
-
- public native void drawArc(int x, int y, int width, int height,
- int startAngle, int arcAngle);
- public native void fillArc(int x, int y, int width, int height,
- int startAngle, int arcAngle);
- public native void drawOval(int x, int y, int width, int height);
- public native void fillOval(int x, int y, int width, int height);
-
- public native void drawPolygon(int[] xPoints, int[] yPoints, int nPoints);
- public native void fillPolygon(int[] xPoints, int[] yPoints, int nPoints);
-
- public native void drawPolyline(int[] xPoints, int[] yPoints, int nPoints);
-
- public native void drawRect(int x, int y, int width, int height);
- public native void fillRect(int x, int y, int width, int height);
-
- GdkFontPeer getFontPeer()
- {
- return (GdkFontPeer) getFont().getPeer();
- }
-
- native void drawString (GdkFontPeer f, String str, int x, int y);
- public void drawString (String str, int x, int y)
- {
- drawString(getFontPeer(), str, x, y);
- }
-
-
- public void drawString (AttributedCharacterIterator ci, int x, int y)
- {
- throw new Error ("not implemented");
- }
-
- public void drawRoundRect(int x, int y, int width, int height,
- int arcWidth, int arcHeight)
- {
- if (arcWidth > width)
- arcWidth = width;
- if (arcHeight > height)
- arcHeight = height;
-
- int xx = x + width - arcWidth;
- int yy = y + height - arcHeight;
-
- drawArc (x, y, arcWidth, arcHeight, 90, 90);
- drawArc (xx, y, arcWidth, arcHeight, 0, 90);
- drawArc (xx, yy, arcWidth, arcHeight, 270, 90);
- drawArc (x, yy, arcWidth, arcHeight, 180, 90);
-
- int y1 = y + arcHeight / 2;
- int y2 = y + height - arcHeight / 2;
- drawLine (x, y1, x, y2);
- drawLine (x + width, y1, x + width, y2);
-
- int x1 = x + arcWidth / 2;
- int x2 = x + width - arcWidth / 2;
- drawLine (x1, y, x2, y);
- drawLine (x1, y + height, x2, y + height);
- }
-
- public void fillRoundRect (int x, int y, int width, int height,
- int arcWidth, int arcHeight)
- {
- if (arcWidth > width)
- arcWidth = width;
- if (arcHeight > height)
- arcHeight = height;
-
- int xx = x + width - arcWidth;
- int yy = y + height - arcHeight;
-
- fillArc (x, y, arcWidth, arcHeight, 90, 90);
- fillArc (xx, y, arcWidth, arcHeight, 0, 90);
- fillArc (xx, yy, arcWidth, arcHeight, 270, 90);
- fillArc (x, yy, arcWidth, arcHeight, 180, 90);
-
- fillRect (x, y + arcHeight / 2, width, height - arcHeight + 1);
- fillRect (x + arcWidth / 2, y, width - arcWidth + 1, height);
- }
-
- public Shape getClip ()
- {
- return getClipBounds ();
- }
-
- public Rectangle getClipBounds ()
- {
- if (clip == null)
- return null;
- else
- return clip.getBounds();
- }
-
- public Color getColor ()
- {
- return color;
- }
-
- public Font getFont ()
- {
- return font;
- }
-
- public FontMetrics getFontMetrics (Font font)
- {
- return new GdkFontMetrics (font);
- }
-
- native void setClipRectangle (int x, int y, int width, int height);
-
- public void setClip (int x, int y, int width, int height)
- {
- if ((component != null && ! component.isRealized ())
- || clip == null)
- return;
-
- clip.x = x;
- clip.y = y;
- clip.width = width;
- clip.height = height;
-
- setClipRectangle (x, y, width, height);
- }
-
- public void setClip (Rectangle clip)
- {
- setClip (clip.x, clip.y, clip.width, clip.height);
- }
-
- public void setClip (Shape clip)
- {
- if (clip != null)
- setClip(clip.getBounds());
- }
-
- private native void setFGColor(int red, int green, int blue);
-
- public void setColor (Color c)
- {
- if (c == null)
- color = Color.BLACK;
- else
- color = c;
-
- if (xorColor == null) /* paint mode */
- setFGColor (color.getRed (), color.getGreen (), color.getBlue ());
- else /* xor mode */
- setFGColor (color.getRed () ^ xorColor.getRed (),
- color.getGreen () ^ xorColor.getGreen (),
- color.getBlue () ^ xorColor.getBlue ());
- }
-
- public void setFont (Font font)
- {
- this.font = font;
- }
-
- native void setFunction (int gdk_func);
-
- public void setPaintMode ()
- {
- xorColor = null;
-
- setFunction (GDK_COPY);
- setFGColor (color.getRed (), color.getGreen (), color.getBlue ());
- }
-
- public void setXORMode (Color c)
- {
- xorColor = c;
-
- setFunction (GDK_XOR);
- setFGColor (color.getRed () ^ xorColor.getRed (),
- color.getGreen () ^ xorColor.getGreen (),
- color.getBlue () ^ xorColor.getBlue ());
- }
-
- public native void translateNative(int x, int y);
-
- public void translate (int x, int y)
- {
- if (component != null && ! component.isRealized ())
- return;
-
- clip.x -= x;
- clip.y -= y;
-
- translateNative (x, y);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java
deleted file mode 100644
index 65c4ca2a224..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java
+++ /dev/null
@@ -1,1449 +0,0 @@
-/* GdkGraphics2D.java --
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 gnu.classpath.Configuration;
-import gnu.java.awt.ClasspathToolkit;
-
-import java.awt.AlphaComposite;
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Composite;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.GradientPaint;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
-import java.awt.Image;
-import java.awt.Paint;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
-import java.awt.Shape;
-import java.awt.Stroke;
-import java.awt.TexturePaint;
-import java.awt.Toolkit;
-import java.awt.font.FontRenderContext;
-import java.awt.font.GlyphVector;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Arc2D;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.NoninvertibleTransformException;
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.AffineTransformOp;
-import java.awt.image.BufferedImage;
-import java.awt.image.BufferedImageOp;
-import java.awt.image.ColorModel;
-import java.awt.image.CropImageFilter;
-import java.awt.image.DataBuffer;
-import java.awt.image.DataBufferInt;
-import java.awt.image.DirectColorModel;
-import java.awt.image.FilteredImageSource;
-import java.awt.image.ImageObserver;
-import java.awt.image.ImagingOpException;
-import java.awt.image.MultiPixelPackedSampleModel;
-import java.awt.image.Raster;
-import java.awt.image.RenderedImage;
-import java.awt.image.SampleModel;
-import java.awt.image.WritableRaster;
-import java.awt.image.renderable.RenderContext;
-import java.awt.image.renderable.RenderableImage;
-import java.text.AttributedCharacterIterator;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Stack;
-
-public class GdkGraphics2D extends Graphics2D
-{
- //////////////////////////////////////
- ////// State Management Methods //////
- //////////////////////////////////////
-
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- System.loadLibrary("gtkpeer");
-
- if (GtkToolkit.useGraphics2D())
- initStaticState();
- }
-
- static native void initStaticState();
-
- private final int native_state = GtkGenericPeer.getUniqueInteger();
-
- // These are package-private to avoid accessor methods.
- Paint paint;
- Stroke stroke;
- Color fg;
- Color bg;
- Shape clip;
- AffineTransform transform;
- private GtkComponentPeer component;
- // This is package-private to avoid an accessor method.
- Font font;
- private RenderingHints hints;
- private BufferedImage bimage;
- private boolean pixelConversionRequired;
- private int[] pixelBuffer;
- // This is package-private to avoid an accessor method.
- Composite comp;
- private Stack stateStack;
-
- private native void initState(GtkComponentPeer component);
- private native void initState(int width, int height);
- private native void initState(int[] pixes, int width, int height);
- private native void copyState(GdkGraphics2D g);
- public native void dispose();
- private native void cairoSurfaceSetFilter(int filter);
- native void connectSignals(GtkComponentPeer component);
-
- public void finalize()
- {
- dispose();
- }
-
- public Graphics create()
- {
- return new GdkGraphics2D(this);
- }
-
- public Graphics create(int x, int y, int width, int height)
- {
- return new GdkGraphics2D(width, height);
- }
-
- GdkGraphics2D(GdkGraphics2D g)
- {
- paint = g.paint;
- stroke = g.stroke;
- setRenderingHints(g.hints);
-
- if (g.fg.getAlpha() != -1)
- fg = new Color(g.fg.getRed(), g.fg.getGreen(), g.fg.getBlue(),
- g.fg.getAlpha());
- else
- fg = new Color(g.fg.getRGB());
-
- if (g.bg.getAlpha() != -1)
- bg = new Color(g.bg.getRed(), g.bg.getGreen(), g.bg.getBlue(),
- g.bg.getAlpha());
- else
- bg = new Color(g.bg.getRGB());
-
- if (g.clip == null)
- clip = null;
- else
- clip = new Rectangle(g.getClipBounds());
-
- if (g.transform == null)
- transform = new AffineTransform();
- else
- transform = new AffineTransform(g.transform);
-
- font = g.font;
- component = g.component;
- copyState(g);
-
- setColor(fg);
- setBackground(bg);
- setPaint(paint);
- setStroke(stroke);
- setTransform(transform);
- setClip(clip);
- stateStack = new Stack();
- }
-
- GdkGraphics2D(int width, int height)
- {
- initState(width, height);
-
- setColor(Color.black);
- setBackground(Color.black);
- setPaint(getColor());
- setFont(new Font("SansSerif", Font.PLAIN, 12));
- setTransform(new AffineTransform());
- setStroke(new BasicStroke());
- setRenderingHints(getDefaultHints());
-
- stateStack = new Stack();
- }
-
- GdkGraphics2D(GtkComponentPeer component)
- {
- this.component = component;
-
- if (component.isRealized())
- initComponentGraphics2D();
- else
- connectSignals(component);
- }
-
- void initComponentGraphics2D()
- {
- initState(component);
-
- setColor(component.awtComponent.getForeground());
- setBackground(component.awtComponent.getBackground());
- setPaint(getColor());
- setTransform(new AffineTransform());
- setStroke(new BasicStroke());
- setRenderingHints(getDefaultHints());
- setFont(new Font("SansSerif", Font.PLAIN, 12));
-
- stateStack = new Stack();
- }
-
- GdkGraphics2D(BufferedImage bimage)
- {
- this.bimage = bimage;
- this.pixelBuffer = findSimpleIntegerArray(bimage.getColorModel(),
- bimage.getRaster());
- if (this.pixelBuffer == null)
- {
- this.pixelBuffer = new int[bimage.getRaster().getWidth() * bimage.getRaster()
- .getHeight()];
- this.pixelConversionRequired = true;
- }
- else
- {
- this.pixelConversionRequired = false;
- }
-
- initState(this.pixelBuffer, bimage.getWidth(), bimage.getHeight());
-
- setColor(Color.black);
- setBackground(Color.black);
- setPaint(getColor());
- setFont(new Font("SansSerif", Font.PLAIN, 12));
- setTransform(new AffineTransform());
- setStroke(new BasicStroke());
- setRenderingHints(getDefaultHints());
-
- stateStack = new Stack();
-
- // draw current buffered image to the pixmap associated
- // with it, if the image is not equal to our paint buffer.
- if (pixelConversionRequired)
- drawImage(bimage, new AffineTransform(1, 0, 0, 1, 0, 0), bg, null);
- }
-
- ////////////////////////////////////
- ////// Native Drawing Methods //////
- ////////////////////////////////////
-
- // GDK drawing methods
- private native void gdkDrawDrawable(GdkGraphics2D other, int x, int y);
-
- // drawing utility methods
- private native void drawPixels(int[] pixels, int w, int h, int stride,
- double[] i2u);
- private native void setTexturePixels(int[] pixels, int w, int h, int stride);
- private native void setGradient(double x1, double y1, double x2, double y2,
- int r1, int g1, int b1, int a1, int r2,
- int g2, int b2, int a2, boolean cyclic);
-
- // simple passthroughs to cairo
- private native void cairoSave();
- private native void cairoRestore();
- private native void cairoSetMatrix(double[] m);
- private native void cairoSetOperator(int cairoOperator);
- private native void cairoSetRGBColor(double red, double green, double blue);
- private native void cairoSetAlpha(double alpha);
- private native void cairoSetFillRule(int cairoFillRule);
- private native void cairoSetLineWidth(double width);
- private native void cairoSetLineCap(int cairoLineCap);
- private native void cairoSetLineJoin(int cairoLineJoin);
- private native void cairoSetDash(double[] dashes, int ndash, double offset);
-
- private native void cairoSetMiterLimit(double limit);
- private native void cairoNewPath();
- private native void cairoMoveTo(double x, double y);
- private native void cairoLineTo(double x, double y);
- private native void cairoCurveTo(double x1, double y1, double x2, double y2,
- double x3, double y3);
- private native void cairoRelMoveTo(double dx, double dy);
- private native void cairoRelLineTo(double dx, double dy);
- private native void cairoRelCurveTo(double dx1, double dy1, double dx2,
- double dy2, double dx3, double dy3);
- private native void cairoRectangle(double x, double y, double width,
- double height);
- private native void cairoClosePath();
- private native void cairoStroke();
- private native void cairoFill();
- private native void cairoClip();
-
- /////////////////////////////////////////////
- ////// General Drawing Support Methods //////
- /////////////////////////////////////////////
-
- private class DrawState
- {
- private Paint paint;
- private Stroke stroke;
- private Color fg;
- private Color bg;
- private Shape clip;
- private AffineTransform transform;
- private Font font;
- private Composite comp;
-
- DrawState(GdkGraphics2D g)
- {
- this.paint = g.paint;
- this.stroke = g.stroke;
- this.fg = g.fg;
- this.bg = g.bg;
- this.clip = g.clip;
- if (g.transform != null)
- this.transform = (AffineTransform) g.transform.clone();
- this.font = g.font;
- this.comp = g.comp;
- }
-
- public void restore(GdkGraphics2D g)
- {
- g.paint = this.paint;
- g.stroke = this.stroke;
- g.fg = this.fg;
- g.bg = this.bg;
- g.clip = this.clip;
- g.transform = this.transform;
- g.font = this.font;
- g.comp = this.comp;
- }
- }
-
- private void stateSave()
- {
- stateStack.push(new DrawState(this));
- cairoSave();
- }
-
- private void stateRestore()
- {
- ((DrawState) (stateStack.pop())).restore(this);
- cairoRestore();
- }
-
- // Some operations (drawing rather than filling) require that their
- // coords be shifted to land on 0.5-pixel boundaries, in order to land on
- // "middle of pixel" coordinates and light up complete pixels.
- private boolean shiftDrawCalls = false;
-
- private double shifted(double coord, boolean doShift)
- {
- if (doShift)
- return Math.floor(coord) + 0.5;
- else
- return coord;
- }
-
- private void walkPath(PathIterator p, boolean doShift)
- {
- double x = 0;
- double y = 0;
- double[] coords = new double[6];
-
- cairoSetFillRule(p.getWindingRule());
- for (; ! p.isDone(); p.next())
- {
- int seg = p.currentSegment(coords);
- switch (seg)
- {
- case PathIterator.SEG_MOVETO:
- x = shifted(coords[0], doShift);
- y = shifted(coords[1], doShift);
- cairoMoveTo(x, y);
- break;
- case PathIterator.SEG_LINETO:
- x = shifted(coords[0], doShift);
- y = shifted(coords[1], doShift);
- cairoLineTo(x, y);
- break;
- case PathIterator.SEG_QUADTO:
- // splitting a quadratic bezier into a cubic:
- // see: http://pfaedit.sourceforge.net/bezier.html
- double x1 = x + (2.0 / 3.0) * (shifted(coords[0], doShift) - x);
- double y1 = y + (2.0 / 3.0) * (shifted(coords[1], doShift) - y);
-
- double x2 = x1 + (1.0 / 3.0) * (shifted(coords[2], doShift) - x);
- double y2 = y1 + (1.0 / 3.0) * (shifted(coords[3], doShift) - y);
-
- x = shifted(coords[2], doShift);
- y = shifted(coords[3], doShift);
- cairoCurveTo(x1, y1, x2, y2, x, y);
- break;
- case PathIterator.SEG_CUBICTO:
- x = shifted(coords[4], doShift);
- y = shifted(coords[5], doShift);
- cairoCurveTo(shifted(coords[0], doShift),
- shifted(coords[1], doShift),
- shifted(coords[2], doShift),
- shifted(coords[3], doShift), x, y);
- break;
- case PathIterator.SEG_CLOSE:
- cairoClosePath();
- break;
- }
- }
- }
-
- private Map getDefaultHints()
- {
- HashMap defaultHints = new HashMap();
-
- defaultHints.put(RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
-
- defaultHints.put(RenderingHints.KEY_STROKE_CONTROL,
- RenderingHints.VALUE_STROKE_DEFAULT);
-
- defaultHints.put(RenderingHints.KEY_FRACTIONALMETRICS,
- RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
-
- defaultHints.put(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_OFF);
-
- defaultHints.put(RenderingHints.KEY_RENDERING,
- RenderingHints.VALUE_RENDER_DEFAULT);
-
- return defaultHints;
- }
-
- public static int[] findSimpleIntegerArray (ColorModel cm, Raster raster)
- {
- if (cm == null || raster == null)
- return null;
-
- if (! cm.getColorSpace().isCS_sRGB())
- return null;
-
- if (! (cm instanceof DirectColorModel))
- return null;
-
- DirectColorModel dcm = (DirectColorModel) cm;
-
- if (dcm.getRedMask() != 0x00FF0000 || dcm.getGreenMask() != 0x0000FF00
- || dcm.getBlueMask() != 0x000000FF)
- return null;
-
- if (! (raster instanceof WritableRaster))
- return null;
-
- if (raster.getSampleModel().getDataType() != DataBuffer.TYPE_INT)
- return null;
-
- if (! (raster.getDataBuffer() instanceof DataBufferInt))
- return null;
-
- DataBufferInt db = (DataBufferInt) raster.getDataBuffer();
-
- if (db.getNumBanks() != 1)
- return null;
-
- // Finally, we have determined that this is a single bank, [A]RGB-int
- // buffer in sRGB space. It's worth checking all this, because it means
- // that cairo can paint directly into the data buffer, which is very
- // fast compared to all the normal copying and converting.
-
- return db.getData();
- }
-
- private void updateBufferedImage()
- {
- if (bimage != null && pixelConversionRequired)
- {
- int height = bimage.getHeight();
- int width = bimage.getWidth();
- for (int y = 0; y < height; ++y)
- for (int x = 0; x < width; ++x)
- bimage.setRGB(x, y, pixelBuffer[y*width+height]);
- }
- }
-
- private boolean drawImage(Image img, AffineTransform xform,
- Color bgcolor, ImageObserver obs)
- {
- if (img == null)
- return false;
-
- if (img instanceof GtkOffScreenImage
- && img.getGraphics() instanceof GdkGraphics2D
- && (xform == null || xform.getType() == AffineTransform.TYPE_IDENTITY
- || xform.getType() == AffineTransform.TYPE_TRANSLATION))
- {
- // we are being asked to flush a double buffer from Gdk
- GdkGraphics2D g2 = (GdkGraphics2D) img.getGraphics();
- gdkDrawDrawable(g2, (int) xform.getTranslateX(),
- (int) xform.getTranslateY());
-
- updateBufferedImage();
-
- return true;
- }
- else
- {
- // In this case, xform is an AffineTransform that transforms bounding
- // box of the specified image from image space to user space. However
- // when we pass this transform to cairo, cairo will use this transform
- // to map "user coordinates" to "pixel" coordinates, which is the
- // other way around. Therefore to get the "user -> pixel" transform
- // that cairo wants from "image -> user" transform that we currently
- // have, we will need to invert the transformation matrix.
- AffineTransform invertedXform = new AffineTransform();
-
- try
- {
- invertedXform = xform.createInverse();
- if (img instanceof BufferedImage)
- {
- // draw an image which has actually been loaded
- // into memory fully
- BufferedImage b = (BufferedImage) img;
- return drawRaster(b.getColorModel(), b.getData(),
- invertedXform, bgcolor);
- }
- else
- return this.drawImage(GdkPixbufDecoder.createBufferedImage(img
- .getSource()),
- xform, bgcolor, obs);
- }
- catch (NoninvertibleTransformException e)
- {
- throw new ImagingOpException("Unable to invert transform "
- + xform.toString());
- }
- }
- }
-
- //////////////////////////////////////////////////
- ////// Implementation of Graphics2D Methods //////
- //////////////////////////////////////////////////
-
- public void draw(Shape s)
- {
- if (stroke != null && ! (stroke instanceof BasicStroke))
- {
- fill(stroke.createStrokedShape(s));
- return;
- }
-
- cairoNewPath();
-
- if (s instanceof Rectangle2D)
- {
- Rectangle2D r = (Rectangle2D) s;
- cairoRectangle(shifted(r.getX(), shiftDrawCalls),
- shifted(r.getY(), shiftDrawCalls), r.getWidth(),
- r.getHeight());
- }
- else
- walkPath(s.getPathIterator(null), shiftDrawCalls);
- cairoStroke();
-
- updateBufferedImage();
- }
-
- public void fill(Shape s)
- {
- cairoNewPath();
- if (s instanceof Rectangle2D)
- {
- Rectangle2D r = (Rectangle2D) s;
- cairoRectangle(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
- else
- walkPath(s.getPathIterator(null), false);
-
- cairoFill();
-
- updateBufferedImage();
- }
-
- public void clip(Shape s)
- {
- // update it
- if (clip == null || s == null)
- clip = s;
- else if (s instanceof Rectangle2D && clip instanceof Rectangle2D)
- {
- Rectangle2D r = (Rectangle2D) s;
- Rectangle2D curr = (Rectangle2D) clip;
- clip = curr.createIntersection(r);
- }
- else
- throw new UnsupportedOperationException();
-
- // draw it
- if (clip != null)
- {
- cairoNewPath();
- if (clip instanceof Rectangle2D)
- {
- Rectangle2D r = (Rectangle2D) clip;
- cairoRectangle(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
- else
- walkPath(clip.getPathIterator(null), false);
-
- // cairoClosePath ();
- cairoClip();
- }
- }
-
- public Paint getPaint()
- {
- return paint;
- }
-
- public AffineTransform getTransform()
- {
- return (AffineTransform) transform.clone();
- }
-
- public void setPaint(Paint p)
- {
- if (paint == null)
- return;
-
- paint = p;
- if (paint instanceof Color)
- {
- setColor((Color) paint);
- }
- else if (paint instanceof TexturePaint)
- {
- TexturePaint tp = (TexturePaint) paint;
- BufferedImage img = tp.getImage();
-
- // map the image to the anchor rectangle
- int width = (int) tp.getAnchorRect().getWidth();
- int height = (int) tp.getAnchorRect().getHeight();
-
- double scaleX = width / (double) img.getWidth();
- double scaleY = width / (double) img.getHeight();
-
- AffineTransform at = new AffineTransform(scaleX, 0, 0, scaleY, 0, 0);
- AffineTransformOp op = new AffineTransformOp(at, getRenderingHints());
- BufferedImage texture = op.filter(img, null);
- int[] pixels = texture.getRGB(0, 0, width, height, null, 0, width);
- setTexturePixels(pixels, width, height, width);
- }
- else if (paint instanceof GradientPaint)
- {
- GradientPaint gp = (GradientPaint) paint;
- Point2D p1 = gp.getPoint1();
- Point2D p2 = gp.getPoint2();
- Color c1 = gp.getColor1();
- Color c2 = gp.getColor2();
- setGradient(p1.getX(), p1.getY(), p2.getX(), p2.getY(), c1.getRed(),
- c1.getGreen(), c1.getBlue(), c1.getAlpha(), c2.getRed(),
- c2.getGreen(), c2.getBlue(), c2.getAlpha(), gp.isCyclic());
- }
- else
- throw new java.lang.UnsupportedOperationException();
- }
-
- public void setTransform(AffineTransform tx)
- {
- transform = tx;
- if (transform != null)
- {
- double[] m = new double[6];
- transform.getMatrix(m);
- cairoSetMatrix(m);
- }
- }
-
- public void transform(AffineTransform tx)
- {
- if (transform == null)
- transform = new AffineTransform(tx);
- else
- transform.concatenate(tx);
- setTransform(transform);
- if (clip != null)
- {
- // FIXME: this should actuall try to transform the shape
- // rather than degrade to bounds.
- Rectangle2D r = clip.getBounds2D();
- double[] coords = new double[]
- {
- r.getX(), r.getY(), r.getX() + r.getWidth(),
- r.getY() + r.getHeight()
- };
- try
- {
- tx.createInverse().transform(coords, 0, coords, 0, 2);
- r.setRect(coords[0], coords[1], coords[2] - coords[0],
- coords[3] - coords[1]);
- clip = r;
- }
- catch (java.awt.geom.NoninvertibleTransformException e)
- {
- }
- }
- }
-
- public void rotate(double theta)
- {
- transform(AffineTransform.getRotateInstance(theta));
- }
-
- public void rotate(double theta, double x, double y)
- {
- transform(AffineTransform.getRotateInstance(theta, x, y));
- }
-
- public void scale(double sx, double sy)
- {
- transform(AffineTransform.getScaleInstance(sx, sy));
- }
-
- public void translate(double tx, double ty)
- {
- transform(AffineTransform.getTranslateInstance(tx, ty));
- }
-
- public void translate(int x, int y)
- {
- translate((double) x, (double) y);
- }
-
- public void shear(double shearX, double shearY)
- {
- transform(AffineTransform.getShearInstance(shearX, shearY));
- }
-
- public Stroke getStroke()
- {
- return stroke;
- }
-
- public void setStroke(Stroke st)
- {
- stroke = st;
- if (stroke instanceof BasicStroke)
- {
- BasicStroke bs = (BasicStroke) stroke;
- cairoSetLineCap(bs.getEndCap());
- cairoSetLineWidth(bs.getLineWidth());
- cairoSetLineJoin(bs.getLineJoin());
- cairoSetMiterLimit(bs.getMiterLimit());
- float[] dashes = bs.getDashArray();
- if (dashes != null)
- {
- double[] double_dashes = new double[dashes.length];
- for (int i = 0; i < dashes.length; i++)
- double_dashes[i] = dashes[i];
- cairoSetDash(double_dashes, double_dashes.length,
- (double) bs.getDashPhase());
- }
- }
- }
-
- ////////////////////////////////////////////////
- ////// Implementation of Graphics Methods //////
- ////////////////////////////////////////////////
-
- public void setPaintMode()
- {
- setComposite(java.awt.AlphaComposite.SrcOver);
- }
-
- public void setXORMode(Color c)
- {
- setComposite(new gnu.java.awt.BitwiseXORComposite(c));
- }
-
- public void setColor(Color c)
- {
- if (c == null)
- c = Color.BLACK;
-
- fg = c;
- paint = c;
- cairoSetRGBColor(fg.getRed() / 255.0, fg.getGreen() / 255.0,
- fg.getBlue() / 255.0);
- cairoSetAlpha((fg.getAlpha() & 255) / 255.0);
- }
-
- public Color getColor()
- {
- return fg;
- }
-
- public void clipRect(int x, int y, int width, int height)
- {
- clip(new Rectangle(x, y, width, height));
- }
-
- public Shape getClip()
- {
- return clip.getBounds2D(); //getClipInDevSpace();
- }
-
- public Rectangle getClipBounds()
- {
- if (clip == null)
- return null;
- else
- return clip.getBounds();
- }
-
- protected Rectangle2D getClipInDevSpace()
- {
- Rectangle2D uclip = clip.getBounds2D();
- if (transform == null)
- return uclip;
- else
- {
- Point2D pos = transform.transform(new Point2D.Double(uclip.getX(),
- uclip.getY()),
- (Point2D) null);
- Point2D extent = transform.deltaTransform(new Point2D.Double(uclip
- .getWidth(),
- uclip
- .getHeight()),
- (Point2D) null);
- return new Rectangle2D.Double(pos.getX(), pos.getY(), extent.getX(),
- extent.getY());
- }
- }
-
- public void setClip(int x, int y, int width, int height)
- {
- setClip(new Rectangle2D.Double((double) x, (double) y, (double) width,
- (double) height));
- }
-
- public void setClip(Shape s)
- {
- clip = s;
- if (s != null)
- {
- cairoNewPath();
- if (s instanceof Rectangle2D)
- {
- Rectangle2D r = (Rectangle2D) s;
- cairoRectangle(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
- else
- walkPath(s.getPathIterator(null), false);
-
- // cairoClosePath ();
- cairoClip();
- }
- }
-
- private static BasicStroke draw3DRectStroke = new BasicStroke();
-
- public void draw3DRect(int x, int y, int width, int height, boolean raised)
- {
- Stroke tmp = stroke;
- setStroke(draw3DRectStroke);
- super.draw3DRect(x, y, width, height, raised);
- setStroke(tmp);
- updateBufferedImage();
- }
-
- public void fill3DRect(int x, int y, int width, int height, boolean raised)
- {
- Stroke tmp = stroke;
- setStroke(draw3DRectStroke);
- super.fill3DRect(x, y, width, height, raised);
- setStroke(tmp);
- updateBufferedImage();
- }
-
- public void drawRect(int x, int y, int width, int height)
- {
- draw(new Rectangle(x, y, width, height));
- }
-
- public void fillRect(int x, int y, int width, int height)
- {
- cairoNewPath();
- cairoRectangle(x, y, width, height);
- cairoFill();
- }
-
- public void clearRect(int x, int y, int width, int height)
- {
- cairoSetRGBColor(bg.getRed() / 255.0, bg.getGreen() / 255.0,
- bg.getBlue() / 255.0);
- cairoSetAlpha(1.0);
- cairoNewPath();
- cairoRectangle(x, y, width, height);
- cairoFill();
- setColor(fg);
-
- updateBufferedImage();
- }
-
- public void setBackground(Color c)
- {
- bg = c;
- }
-
- public Color getBackground()
- {
- return bg;
- }
-
- private void doPolygon(int[] xPoints, int[] yPoints, int nPoints,
- boolean close, boolean fill)
- {
- if (nPoints < 1)
- return;
- GeneralPath gp = new GeneralPath(PathIterator.WIND_EVEN_ODD);
- gp.moveTo((float) xPoints[0], (float) yPoints[0]);
- for (int i = 1; i < nPoints; i++)
- gp.lineTo((float) xPoints[i], (float) yPoints[i]);
-
- if (close)
- gp.closePath();
-
- Shape sh = gp;
- if (fill == false && stroke != null && ! (stroke instanceof BasicStroke))
- {
- sh = stroke.createStrokedShape(gp);
- fill = true;
- }
-
- if (fill)
- fill(sh);
- else
- draw(sh);
- }
-
- public void drawLine(int x1, int y1, int x2, int y2)
- {
- int[] xp = new int[2];
- int[] yp = new int[2];
-
- xp[0] = x1;
- xp[1] = x2;
- yp[0] = y1;
- yp[1] = y2;
-
- doPolygon(xp, yp, 2, false, false);
- }
-
- public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
- {
- doPolygon(xPoints, yPoints, nPoints, true, true);
- }
-
- public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
- {
- doPolygon(xPoints, yPoints, nPoints, true, false);
- }
-
- public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
- {
- doPolygon(xPoints, yPoints, nPoints, false, false);
- }
-
- private boolean drawRaster(ColorModel cm, Raster r,
- AffineTransform imageToUser, Color bgcolor)
- {
- if (r == null)
- return false;
-
- SampleModel sm = r.getSampleModel();
- DataBuffer db = r.getDataBuffer();
-
- if (db == null || sm == null)
- return false;
-
- if (cm == null)
- cm = ColorModel.getRGBdefault();
-
- double[] i2u = new double[6];
- if (imageToUser != null)
- imageToUser.getMatrix(i2u);
- else
- {
- i2u[0] = 1;
- i2u[1] = 0;
- i2u[2] = 0;
- i2u[3] = 1;
- i2u[4] = 0;
- i2u[5] = 0;
- }
-
- int[] pixels = findSimpleIntegerArray(cm, r);
-
- if (pixels == null)
- {
- // FIXME: I don't think this code will work correctly with a non-RGB
- // MultiPixelPackedSampleModel. Although this entire method should
- // probably be rewritten to better utilize Cairo's different supported
- // data formats.
- if (sm instanceof MultiPixelPackedSampleModel)
- {
- pixels = r.getPixels(0, 0, r.getWidth(), r.getHeight(), pixels);
- for (int i = 0; i < pixels.length; i++)
- pixels[i] = cm.getRGB(pixels[i]);
- }
- else
- {
- pixels = new int[r.getWidth() * r.getHeight()];
- for (int i = 0; i < pixels.length; i++)
- pixels[i] = cm.getRGB(db.getElem(i));
- }
- }
-
- // Change all transparent pixels in the image to the specified bgcolor,
- // or (if there's no alpha) fill in an alpha channel so that it paints
- // correctly.
- if (cm.hasAlpha())
- {
- if (bgcolor != null && cm.hasAlpha())
- for (int i = 0; i < pixels.length; i++)
- {
- if (cm.getAlpha(pixels[i]) == 0)
- pixels[i] = bgcolor.getRGB();
- }
- }
- else
- for (int i = 0; i < pixels.length; i++)
- pixels[i] |= 0xFF000000;
-
- drawPixels(pixels, r.getWidth(), r.getHeight(), r.getWidth(), i2u);
-
- updateBufferedImage();
-
- return true;
- }
-
- public void drawRenderedImage(RenderedImage image, AffineTransform xform)
- {
- drawRaster(image.getColorModel(), image.getData(), xform, bg);
- }
-
- public void drawRenderableImage(RenderableImage image, AffineTransform xform)
- {
- drawRenderedImage(image.createRendering(new RenderContext(xform)), xform);
- }
-
- public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
- {
- return drawImage(img, xform, bg, obs);
- }
-
- public void drawImage(BufferedImage image, BufferedImageOp op, int x, int y)
- {
- Image filtered = op.filter(image, null);
- drawImage(filtered, new AffineTransform(1f, 0f, 0f, 1f, x, y), bg, null);
- }
-
- public boolean drawImage(Image img, int x, int y, ImageObserver observer)
- {
- return drawImage(img, new AffineTransform(1f, 0f, 0f, 1f, x, y), bg,
- observer);
- }
-
- ///////////////////////////////////////////////
- ////// Unimplemented Stubs and Overloads //////
- ///////////////////////////////////////////////
-
- public boolean hit(Rectangle rect, Shape text, boolean onStroke)
- {
- throw new java.lang.UnsupportedOperationException();
- }
-
- public GraphicsConfiguration getDeviceConfiguration()
- {
- throw new java.lang.UnsupportedOperationException();
- }
-
- public void setComposite(Composite comp)
- {
- this.comp = comp;
-
- if (comp instanceof AlphaComposite)
- {
- AlphaComposite a = (AlphaComposite) comp;
- cairoSetOperator(a.getRule());
- Color c = getColor();
- setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(),
- (int) (a.getAlpha() * ((float) c.getAlpha()))));
- }
- else
- throw new java.lang.UnsupportedOperationException();
- }
-
- public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
- {
- hints.put(hintKey, hintValue);
-
- if (hintKey.equals(RenderingHints.KEY_INTERPOLATION)
- || hintKey.equals(RenderingHints.KEY_ALPHA_INTERPOLATION))
- {
- if (hintValue.equals(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
- cairoSurfaceSetFilter(0);
-
- else if (hintValue.equals(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
- cairoSurfaceSetFilter(1);
-
- else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED))
- cairoSurfaceSetFilter(2);
-
- else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY))
- cairoSurfaceSetFilter(3);
-
- else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT))
- cairoSurfaceSetFilter(4);
- }
-
- shiftDrawCalls = hints.containsValue(RenderingHints.VALUE_STROKE_NORMALIZE)
- || hints.containsValue(RenderingHints.VALUE_STROKE_DEFAULT);
- }
-
- public Object getRenderingHint(RenderingHints.Key hintKey)
- {
- return hints.get(hintKey);
- }
-
- public void setRenderingHints(Map hints)
- {
- this.hints = new RenderingHints(getDefaultHints());
- this.hints.add(new RenderingHints(hints));
-
- if (hints.containsKey(RenderingHints.KEY_INTERPOLATION))
- {
- if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
- cairoSurfaceSetFilter(0);
-
- else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
- cairoSurfaceSetFilter(1);
- }
-
- if (hints.containsKey(RenderingHints.KEY_ALPHA_INTERPOLATION))
- {
- if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED))
- cairoSurfaceSetFilter(2);
-
- else if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY))
- cairoSurfaceSetFilter(3);
-
- else if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT))
- cairoSurfaceSetFilter(4);
- }
-
- shiftDrawCalls = hints.containsValue(RenderingHints.VALUE_STROKE_NORMALIZE)
- || hints.containsValue(RenderingHints.VALUE_STROKE_DEFAULT);
- }
-
- public void addRenderingHints(Map hints)
- {
- this.hints.add(new RenderingHints(hints));
- }
-
- public RenderingHints getRenderingHints()
- {
- return hints;
- }
-
- public Composite getComposite()
- {
- if (comp == null)
- return AlphaComposite.SrcOver;
- else
- return comp;
- }
-
- public FontRenderContext getFontRenderContext()
- {
- return new FontRenderContext(transform, true, true);
- }
-
- public void copyArea(int x, int y, int width, int height, int dx, int dy)
- {
- throw new java.lang.UnsupportedOperationException();
- }
-
- public void drawArc(int x, int y, int width, int height, int startAngle,
- int arcAngle)
- {
- draw(new Arc2D.Double((double) x, (double) y, (double) width,
- (double) height, (double) startAngle,
- (double) arcAngle, Arc2D.OPEN));
- }
-
- public boolean drawImage(Image img, int x, int y, Color bgcolor,
- ImageObserver observer)
- {
- return drawImage(img, x, y, img.getWidth(observer),
- img.getHeight(observer), bgcolor, observer);
- }
-
- public boolean drawImage(Image img, int x, int y, int width, int height,
- Color bgcolor, ImageObserver observer)
- {
- double scaleX = width / (double) img.getWidth(observer);
- double scaleY = height / (double) img.getHeight(observer);
-
- return drawImage(img, new AffineTransform(scaleX, 0f, 0f, scaleY, x, y),
- bgcolor, observer);
- }
-
- public boolean drawImage(Image img, int x, int y, int width, int height,
- ImageObserver observer)
- {
- return drawImage(img, x, y, width, height, bg, observer);
- }
-
- public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2, Color bgcolor,
- ImageObserver observer)
- {
- if (img == null)
- return false;
-
- Image subImage;
-
- int sourceWidth = sx2 - sx1;
- int sourceHeight = sy2 - sy1;
-
- int destWidth = dx2 - dx1;
- int destHeight = dy2 - dy1;
-
- double scaleX = destWidth / (double) sourceWidth;
- double scaleY = destHeight / (double) sourceHeight;
-
- // Get the subimage of the source enclosed in the
- // rectangle specified by sx1, sy1, sx2, sy2
-
- if (img instanceof BufferedImage)
- {
- BufferedImage b = (BufferedImage) img;
- subImage = b.getSubimage(sx1, sy1, sx2, sy2);
- }
- else
- {
- // FIXME: This code currently doesn't work. Null Pointer
- // exception is thrown in this case. This happens
- // because img.getSource() always returns null, since source gets
- // never initialized when it is created with the help of
- // createImage(int width, int height).
- CropImageFilter filter = new CropImageFilter(sx1, sx2, sx2, sy2);
- FilteredImageSource src = new FilteredImageSource(img.getSource(),
- filter);
-
- subImage = Toolkit.getDefaultToolkit().createImage(src);
- }
-
- return drawImage(subImage,
- new AffineTransform(scaleX, 0, 0, scaleY, dx1, dy1),
- bgcolor, observer);
- }
-
- public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2,
- ImageObserver observer)
- {
- return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bg, observer);
- }
-
- public void drawOval(int x, int y, int width, int height)
- {
- drawArc(x, y, width, height, 0, 360);
- }
-
- public void drawRoundRect(int x, int y, int width, int height, int arcWidth,
- int arcHeight)
- {
- if (arcWidth > width)
- arcWidth = width;
- if (arcHeight > height)
- arcHeight = height;
-
- int xx = x + width - arcWidth;
- int yy = y + height - arcHeight;
-
- drawArc(x, y, arcWidth, arcHeight, 90, 90);
- drawArc(xx, y, arcWidth, arcHeight, 0, 90);
- drawArc(xx, yy, arcWidth, arcHeight, 270, 90);
- drawArc(x, yy, arcWidth, arcHeight, 180, 90);
-
- int y1 = y + arcHeight / 2;
- int y2 = y + height - arcHeight / 2;
- drawLine(x, y1, x, y2);
- drawLine(x + width, y1, x + width, y2);
-
- int x1 = x + arcWidth / 2;
- int x2 = x + width - arcWidth / 2;
- drawLine(x1, y, x2, y);
- drawLine(x1, y + height, x2, y + height);
- }
-
- // these are the most accelerated painting paths
- native void cairoDrawGlyphVector(GdkFontPeer font,
- float x, float y, int n,
- int[] codes, float[] positions);
-
- native void cairoDrawGdkTextLayout(GdkTextLayout gl,
- float x, float y);
-
- GdkFontPeer getFontPeer()
- {
- return (GdkFontPeer) getFont().getPeer();
- }
-
- public void drawGdkTextLayout(GdkTextLayout gl, float x, float y)
- {
- cairoDrawGdkTextLayout (gl, x, y);
- updateBufferedImage ();
- }
-
- public void drawString(String str, float x, float y)
- {
- drawGlyphVector(getFont().createGlyphVector(null, str), x, y);
- updateBufferedImage ();
- }
-
- public void drawString(String str, int x, int y)
- {
- drawString (str, (float) x, (float) y);
- }
-
- public void drawString(AttributedCharacterIterator ci, int x, int y)
- {
- drawString (ci, (float) x, (float) y);
- }
-
- public void drawGlyphVector(GlyphVector gv, float x, float y)
- {
- 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 = getFont().createGlyphVector(getFontRenderContext(), ci);
- drawGlyphVector(gv, x, y);
- }
-
- public void fillArc(int x, int y, int width, int height, int startAngle,
- int arcAngle)
- {
- fill(new Arc2D.Double((double) x, (double) y, (double) width,
- (double) height, (double) startAngle,
- (double) arcAngle, Arc2D.OPEN));
- }
-
- public void fillOval(int x, int y, int width, int height)
- {
- fillArc(x, y, width, height, 0, 360);
- }
-
- public void fillRoundRect(int x, int y, int width, int height, int arcWidth,
- int arcHeight)
- {
- if (arcWidth > width)
- arcWidth = width;
- if (arcHeight > height)
- arcHeight = height;
-
- int xx = x + width - arcWidth;
- int yy = y + height - arcHeight;
-
- fillArc(x, y, arcWidth, arcHeight, 90, 90);
- fillArc(xx, y, arcWidth, arcHeight, 0, 90);
- fillArc(xx, yy, arcWidth, arcHeight, 270, 90);
- fillArc(x, yy, arcWidth, arcHeight, 180, 90);
-
- fillRect(x, y + arcHeight / 2, width, height - arcHeight + 1);
- fillRect(x + arcWidth / 2, y, width - arcWidth + 1, height);
- }
-
- public Font getFont()
- {
- if (font == null)
- return new Font("SansSerif", Font.PLAIN, 12);
- return font;
- }
-
- // Until such time as pango is happy to talk directly to cairo, we
- // actually need to redirect some calls from the GtkFontPeer and
- // GtkFontMetrics into the drawing kit and ask cairo ourselves.
-
- static native void releasePeerGraphicsResource(GdkFontPeer f);
-
- public FontMetrics getFontMetrics()
- {
- return getFontMetrics(getFont());
- }
-
- public FontMetrics getFontMetrics(Font f)
- {
- // 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(f);
- }
-
- public void setFont(Font f)
- {
- if (f.getPeer() instanceof GdkFontPeer)
- font = f;
- else
- font =
- ((ClasspathToolkit)(Toolkit.getDefaultToolkit()))
- .getFont(f.getName(), f.getAttributes());
- }
-
- public String toString()
- {
- return (getClass().getName()
- + "[font=" + getFont().toString()
- + ",color=" + fg.toString()
- + "]");
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java
deleted file mode 100644
index bfad87acac0..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.ImageCapabilities;
-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)
- {
- return new GtkVolatileImage(w, h);
- }
-
- public VolatileImage createCompatibleVolatileImage(int w, int h,
- ImageCapabilities caps)
- throws java.awt.AWTException
- {
- return new GtkVolatileImage(w, h, caps);
- }
-
- 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);
- }
-
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
deleted file mode 100644
index 4f9d1c27af6..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* GdkGraphicsEnvironment.java -- information about the graphics environment
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Font;
-import java.awt.Graphics2D;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.awt.HeadlessException;
-import java.awt.image.BufferedImage;
-import java.util.Locale;
-
-public class GdkGraphicsEnvironment extends GraphicsEnvironment
-{
- GtkToolkit gtkToolkit;
-
- public GtkToolkit getToolkit()
- {
- return gtkToolkit;
- }
-
- public GdkGraphicsEnvironment (GtkToolkit tk)
- {
- super();
- gtkToolkit = tk;
- }
-
- public GraphicsDevice[] getScreenDevices ()
- {
- // FIXME: Support multiple screens, since GDK can.
- return new GraphicsDevice[] { new GdkScreenGraphicsDevice (this) };
- }
-
- public GraphicsDevice getDefaultScreenDevice ()
- {
- if (GraphicsEnvironment.isHeadless ())
- throw new HeadlessException ();
-
- return new GdkScreenGraphicsDevice (this);
- }
-
- public Graphics2D createGraphics (BufferedImage image)
- {
- return new GdkGraphics2D (image);
- }
-
- private native int nativeGetNumFontFamilies();
- private native void nativeGetFontFamilies(String[] family_names);
-
- public Font[] getAllFonts ()
- {
- throw new java.lang.UnsupportedOperationException ();
- }
-
- public String[] getAvailableFontFamilyNames ()
- {
- String[] family_names;
- int array_size;
-
- array_size = nativeGetNumFontFamilies();
- family_names = new String[array_size];
-
- nativeGetFontFamilies(family_names);
- return family_names;
- }
-
- public String[] getAvailableFontFamilyNames (Locale l)
- {
- throw new java.lang.UnsupportedOperationException ();
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java b/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
deleted file mode 100644
index a3d82f62f87..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
+++ /dev/null
@@ -1,675 +0,0 @@
-/* GdkPixbufDecoder.java -- Image data decoding object
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 gnu.classpath.Configuration;
-
-import java.awt.image.BufferedImage;
-import java.awt.image.ColorModel;
-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.io.DataOutput;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Vector;
-
-import javax.imageio.IIOImage;
-import javax.imageio.ImageReadParam;
-import javax.imageio.ImageReader;
-import javax.imageio.ImageTypeSpecifier;
-import javax.imageio.ImageWriteParam;
-import javax.imageio.ImageWriter;
-import javax.imageio.metadata.IIOMetadata;
-import javax.imageio.spi.IIORegistry;
-import javax.imageio.spi.ImageReaderSpi;
-import javax.imageio.spi.ImageWriterSpi;
-import javax.imageio.stream.ImageInputStream;
-import javax.imageio.stream.ImageOutputStream;
-
-public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
-{
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary("gtkpeer");
- }
- initStaticState ();
- }
-
- static native void initStaticState();
- private final int native_state = GtkGenericPeer.getUniqueInteger ();
- private boolean initialized = false;
-
- // the current set of ImageConsumers for this decoder
- Vector curr;
-
- // interface to GdkPixbuf
- native void initState ();
- native void pumpBytes (byte[] bytes, int len);
- native void finish ();
- static native void streamImage(int[] bytes, String format, int width, int height, boolean hasAlpha, DataOutput sink);
-
- // gdk-pixbuf provids data in RGBA format
- static final ColorModel cm = new DirectColorModel (32, 0xff000000,
- 0x00ff0000,
- 0x0000ff00,
- 0x000000ff);
- public GdkPixbufDecoder (InputStream in)
- {
- super (in);
- }
-
- public GdkPixbufDecoder (String filename)
- {
- super (filename);
- }
-
- public GdkPixbufDecoder (URL url)
- {
- super (url);
- }
-
- public GdkPixbufDecoder (byte[] imagedata, int imageoffset, int imagelength)
- {
- super (imagedata, imageoffset, imagelength);
- }
-
- // called back by native side
- void areaPrepared (int width, int height)
- {
-
- if (curr == null)
- return;
-
- for (int i = 0; i < curr.size (); i++)
- {
- ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
- ic.setDimensions (width, height);
- ic.setColorModel (cm);
- ic.setHints (ImageConsumer.RANDOMPIXELORDER);
- }
- }
-
- // called back by native side
- void areaUpdated (int x, int y, int width, int height,
- int pixels[], int scansize)
- {
- if (curr == null)
- return;
-
- for (int i = 0; i < curr.size (); i++)
- {
- ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
- ic.setPixels (x, y, width, height, cm, pixels, 0, scansize);
- }
- }
-
- // called from an async image loader of one sort or another, this method
- // repeatedly reads bytes from the input stream and passes them through a
- // GdkPixbufLoader using the native method pumpBytes. pumpBytes in turn
- // decodes the image data and calls back areaPrepared and areaUpdated on
- // this object, feeding back decoded pixel blocks, which we pass to each
- // of the ImageConsumers in the provided Vector.
-
- public void produce (Vector v, InputStream is) throws IOException
- {
- curr = v;
-
- byte bytes[] = new byte[4096];
- int len = 0;
- initState();
- while ((len = is.read (bytes)) != -1)
- pumpBytes (bytes, len);
-
- for (int i = 0; i < curr.size (); i++)
- {
- ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
- ic.imageComplete (ImageConsumer.STATICIMAGEDONE);
- }
-
- curr = null;
- }
-
- public void finalize()
- {
- finish();
- }
-
-
- public static class ImageFormatSpec
- {
- public String name;
- public boolean writable = false;
- public ArrayList mimeTypes = new ArrayList();
- public ArrayList extensions = new ArrayList();
-
- public ImageFormatSpec(String name, boolean writable)
- {
- this.name = name;
- this.writable = writable;
- }
-
- public synchronized void addMimeType(String m)
- {
- mimeTypes.add(m);
- }
-
- public synchronized void addExtension(String e)
- {
- extensions.add(e);
- }
- }
-
- static ArrayList imageFormatSpecs;
-
- public static ImageFormatSpec registerFormat(String name, boolean writable)
- {
- ImageFormatSpec ifs = new ImageFormatSpec(name, writable);
- synchronized(GdkPixbufDecoder.class)
- {
- if (imageFormatSpecs == null)
- imageFormatSpecs = new ArrayList();
- imageFormatSpecs.add(ifs);
- }
- return ifs;
- }
-
- static String[] getFormatNames(boolean writable)
- {
- ArrayList names = new ArrayList();
- synchronized (imageFormatSpecs)
- {
- Iterator i = imageFormatSpecs.iterator();
- while (i.hasNext())
- {
- ImageFormatSpec ifs = (ImageFormatSpec) i.next();
- if (writable && !ifs.writable)
- continue;
- names.add(ifs.name);
-
- /*
- * In order to make the filtering code work, we need to register
- * this type under every "format name" likely to be used as a synonym.
- * This generally means "all the extensions people might use".
- */
-
- Iterator j = ifs.extensions.iterator();
- while (j.hasNext())
- names.add((String) j.next());
- }
- }
- Object[] objs = names.toArray();
- String[] strings = new String[objs.length];
- for (int i = 0; i < objs.length; ++i)
- strings[i] = (String) objs[i];
- return strings;
- }
-
- static String[] getFormatExtensions(boolean writable)
- {
- ArrayList extensions = new ArrayList();
- synchronized (imageFormatSpecs)
- {
- Iterator i = imageFormatSpecs.iterator();
- while (i.hasNext())
- {
- ImageFormatSpec ifs = (ImageFormatSpec) i.next();
- if (writable && !ifs.writable)
- continue;
- Iterator j = ifs.extensions.iterator();
- while (j.hasNext())
- extensions.add((String) j.next());
- }
- }
- Object[] objs = extensions.toArray();
- String[] strings = new String[objs.length];
- for (int i = 0; i < objs.length; ++i)
- strings[i] = (String) objs[i];
- return strings;
- }
-
- static String[] getFormatMimeTypes(boolean writable)
- {
- ArrayList mimeTypes = new ArrayList();
- synchronized (imageFormatSpecs)
- {
- Iterator i = imageFormatSpecs.iterator();
- while (i.hasNext())
- {
- ImageFormatSpec ifs = (ImageFormatSpec) i.next();
- if (writable && !ifs.writable)
- continue;
- Iterator j = ifs.mimeTypes.iterator();
- while (j.hasNext())
- mimeTypes.add((String) j.next());
- }
- }
- Object[] objs = mimeTypes.toArray();
- String[] strings = new String[objs.length];
- for (int i = 0; i < objs.length; ++i)
- strings[i] = (String) objs[i];
- return strings;
- }
-
-
- static String findFormatName(Object ext, boolean needWritable)
- {
- if (ext == null)
- throw new IllegalArgumentException("extension is null");
-
- if (!(ext instanceof String))
- throw new IllegalArgumentException("extension is not a string");
-
- String str = (String) ext;
-
- Iterator i = imageFormatSpecs.iterator();
- while (i.hasNext())
- {
- ImageFormatSpec ifs = (ImageFormatSpec) i.next();
-
- if (needWritable && !ifs.writable)
- continue;
-
- if (ifs.name.equals(str))
- return str;
-
- Iterator j = ifs.extensions.iterator();
- while (j.hasNext())
- {
- String extension = (String)j.next();
- if (extension.equals(str))
- return ifs.name;
- }
-
- j = ifs.mimeTypes.iterator();
- while (j.hasNext())
- {
- String mimeType = (String)j.next();
- if (mimeType.equals(str))
- return ifs.name;
- }
- }
- throw new IllegalArgumentException("unknown extension '" + str + "'");
- }
-
- private static GdkPixbufReaderSpi readerSpi;
- private static GdkPixbufWriterSpi writerSpi;
-
- public static synchronized GdkPixbufReaderSpi getReaderSpi()
- {
- if (readerSpi == null)
- readerSpi = new GdkPixbufReaderSpi();
- return readerSpi;
- }
-
- public static synchronized GdkPixbufWriterSpi getWriterSpi()
- {
- if (writerSpi == null)
- writerSpi = new GdkPixbufWriterSpi();
- return writerSpi;
- }
-
- public static void registerSpis(IIORegistry reg)
- {
- reg.registerServiceProvider(getReaderSpi(), ImageReaderSpi.class);
- reg.registerServiceProvider(getWriterSpi(), ImageWriterSpi.class);
- }
-
- public static class GdkPixbufWriterSpi extends ImageWriterSpi
- {
- public GdkPixbufWriterSpi()
- {
- super("GdkPixbuf", "2.x",
- GdkPixbufDecoder.getFormatNames(true),
- GdkPixbufDecoder.getFormatExtensions(true),
- GdkPixbufDecoder.getFormatMimeTypes(true),
- "gnu.java.awt.peer.gtk.GdkPixbufDecoder$GdkPixbufWriter",
- new Class[] { ImageOutputStream.class },
- new String[] { "gnu.java.awt.peer.gtk.GdkPixbufDecoder$GdkPixbufReaderSpi" },
- false, null, null, null, null,
- false, null, null, null, null);
- }
-
- public boolean canEncodeImage(ImageTypeSpecifier ts)
- {
- return true;
- }
-
- public ImageWriter createWriterInstance(Object ext)
- {
- return new GdkPixbufWriter(this, ext);
- }
-
- public String getDescription(java.util.Locale loc)
- {
- return "GdkPixbuf Writer SPI";
- }
-
- }
-
- public static class GdkPixbufReaderSpi extends ImageReaderSpi
- {
- public GdkPixbufReaderSpi()
- {
- super("GdkPixbuf", "2.x",
- GdkPixbufDecoder.getFormatNames(false),
- GdkPixbufDecoder.getFormatExtensions(false),
- GdkPixbufDecoder.getFormatMimeTypes(false),
- "gnu.java.awt.peer.gtk.GdkPixbufDecoder$GdkPixbufReader",
- new Class[] { ImageInputStream.class },
- new String[] { "gnu.java.awt.peer.gtk.GdkPixbufDecoder$GdkPixbufWriterSpi" },
- false, null, null, null, null,
- false, null, null, null, null);
- }
-
- public boolean canDecodeInput(Object obj)
- {
- return true;
- }
-
- public ImageReader createReaderInstance(Object ext)
- {
- return new GdkPixbufReader(this, ext);
- }
-
- public String getDescription(Locale loc)
- {
- return "GdkPixbuf Reader SPI";
- }
- }
-
- private static class GdkPixbufWriter
- extends ImageWriter
- {
- String ext;
- public GdkPixbufWriter(GdkPixbufWriterSpi ownerSpi, Object ext)
- {
- super(ownerSpi);
- this.ext = findFormatName(ext, true);
- }
-
- public IIOMetadata convertImageMetadata (IIOMetadata inData,
- ImageTypeSpecifier imageType,
- ImageWriteParam param)
- {
- return null;
- }
-
- public IIOMetadata convertStreamMetadata (IIOMetadata inData,
- ImageWriteParam param)
- {
- return null;
- }
-
- public IIOMetadata getDefaultImageMetadata (ImageTypeSpecifier imageType,
- ImageWriteParam param)
- {
- return null;
- }
-
- public IIOMetadata getDefaultStreamMetadata (ImageWriteParam param)
- {
- return null;
- }
-
- public void write (IIOMetadata streamMetadata, IIOImage i, ImageWriteParam param)
- throws IOException
- {
- RenderedImage image = i.getRenderedImage();
- Raster ras = image.getData();
- int width = ras.getWidth();
- int height = ras.getHeight();
- ColorModel model = image.getColorModel();
- int[] pixels = GdkGraphics2D.findSimpleIntegerArray (image.getColorModel(), ras);
-
- if (pixels == null)
- {
- BufferedImage img = new BufferedImage(width, height,
- (model != null && model.hasAlpha() ?
- BufferedImage.TYPE_INT_ARGB
- : BufferedImage.TYPE_INT_RGB));
- int[] pix = new int[4];
- for (int y = 0; y < height; ++y)
- for (int x = 0; x < width; ++x)
- img.setRGB(x, y, model.getRGB(ras.getPixel(x, y, pix)));
- pixels = GdkGraphics2D.findSimpleIntegerArray (img.getColorModel(),
- img.getRaster());
- model = img.getColorModel();
- }
-
- processImageStarted(1);
- streamImage(pixels, this.ext, width, height, model.hasAlpha(),
- (DataOutput) this.getOutput());
- processImageComplete();
- }
- }
-
- private static class GdkPixbufReader
- extends ImageReader
- implements ImageConsumer
- {
- // ImageConsumer parts
- GdkPixbufDecoder dec;
- BufferedImage bufferedImage;
- ColorModel defaultModel;
- int width;
- int height;
- String ext;
-
- public GdkPixbufReader(GdkPixbufReaderSpi ownerSpi, Object ext)
- {
- super(ownerSpi);
- this.ext = findFormatName(ext, false);
- }
-
- public GdkPixbufReader(GdkPixbufReaderSpi ownerSpi, Object ext, GdkPixbufDecoder d)
- {
- this(ownerSpi, ext);
- dec = d;
- }
-
- public void setDimensions(int w, int h)
- {
- processImageStarted(1);
- width = w;
- height = h;
- }
-
- public void setProperties(Hashtable props) {}
-
- public void setColorModel(ColorModel model)
- {
- defaultModel = model;
- }
-
- public void setHints(int flags) {}
-
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels,
- int offset, int scansize)
- {
- }
-
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels,
- int offset, int scansize)
- {
- if (model == null)
- model = defaultModel;
-
- if (bufferedImage == null)
- {
- bufferedImage = new BufferedImage (width, height, (model != null && model.hasAlpha() ?
- BufferedImage.TYPE_INT_ARGB
- : BufferedImage.TYPE_INT_RGB));
- }
-
- int pixels2[];
- if (model != null)
- {
- pixels2 = new int[pixels.length];
- for (int yy = 0; yy < h; yy++)
- for (int xx = 0; xx < w; xx++)
- {
- int i = yy * scansize + xx;
- pixels2[i] = model.getRGB (pixels[i]);
- }
- }
- else
- pixels2 = pixels;
-
- bufferedImage.setRGB (x, y, w, h, pixels2, offset, scansize);
- processImageProgress(y / (height == 0 ? 1 : height));
- }
-
- public void imageComplete(int status)
- {
- processImageComplete();
- }
-
- public BufferedImage getBufferedImage()
- {
- if (bufferedImage == null && dec != null)
- dec.startProduction (this);
- return bufferedImage;
- }
-
- // ImageReader parts
-
- public int getNumImages(boolean allowSearch)
- throws IOException
- {
- return 1;
- }
-
- public IIOMetadata getImageMetadata(int i)
- {
- return null;
- }
-
- public IIOMetadata getStreamMetadata()
- throws IOException
- {
- return null;
- }
-
- public Iterator getImageTypes(int imageIndex)
- throws IOException
- {
- BufferedImage img = getBufferedImage();
- Vector vec = new Vector();
- vec.add(new ImageTypeSpecifier(img));
- return vec.iterator();
- }
-
- public int getHeight(int imageIndex)
- throws IOException
- {
- return getBufferedImage().getHeight();
- }
-
- public int getWidth(int imageIndex)
- throws IOException
- {
- return getBufferedImage().getWidth();
- }
-
- public void setInput(Object input,
- boolean seekForwardOnly,
- boolean ignoreMetadata)
- {
- super.setInput(input, seekForwardOnly, ignoreMetadata);
- dec = new GdkPixbufDecoder((InputStream) getInput());
- }
-
- public BufferedImage read(int imageIndex, ImageReadParam param)
- throws IOException
- {
- return getBufferedImage ();
- }
- }
-
- // remaining helper class and static method is a convenience for the Gtk
- // peers, for loading a BufferedImage in off a disk file without going
- // through the whole imageio system.
-
- public static BufferedImage createBufferedImage (String filename)
- {
- GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(),
- "png", // reader auto-detects, doesn't matter
- new GdkPixbufDecoder (filename));
- return r.getBufferedImage ();
- }
-
- public static BufferedImage createBufferedImage (URL u)
- {
- GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(),
- "png", // reader auto-detects, doesn't matter
- new GdkPixbufDecoder (u));
- return r.getBufferedImage ();
- }
-
- public static BufferedImage createBufferedImage (byte[] imagedata, int imageoffset,
- int imagelength)
- {
- GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(),
- "png", // reader auto-detects, doesn't matter
- new GdkPixbufDecoder (imagedata,
- imageoffset,
- imagelength));
- return r.getBufferedImage ();
- }
-
- public static BufferedImage createBufferedImage (ImageProducer producer)
- {
- GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(), "png" /* ignored */, null);
- producer.startProduction(r);
- return r.getBufferedImage ();
- }
-
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkRobotPeer.java b/libjava/gnu/java/awt/peer/gtk/GdkRobotPeer.java
deleted file mode 100644
index 6d0218d057a..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkRobotPeer.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* GdkRobot.java -- an XTest implementation of RobotPeer
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.AWTException;
-import java.awt.GraphicsDevice;
-import java.awt.Rectangle;
-import java.awt.image.ColorModel;
-import java.awt.image.DirectColorModel;
-import java.awt.peer.RobotPeer;
-
-/**
- * Implements the RobotPeer interface using the XTest extension.
- *
- * @author Thomas Fitzsimmons
- */
-public class GdkRobotPeer implements RobotPeer
-{
- // gdk-pixbuf provides data in RGBA format
- static final ColorModel cm = new DirectColorModel (32, 0xff000000,
- 0x00ff0000,
- 0x0000ff00,
- 0x000000ff);
-
- public GdkRobotPeer (GraphicsDevice screen) throws AWTException
- {
- // FIXME: make use of screen parameter when GraphicsDevice is
- // implemented.
- if (!initXTest ())
- throw new AWTException ("XTest extension not supported");
- }
-
- native boolean initXTest ();
-
- // RobotPeer methods
- public native void mouseMove (int x, int y);
- public native void mousePress (int buttons);
- public native void mouseRelease (int buttons);
- public native void mouseWheel (int wheelAmt);
- public native void keyPress (int keycode);
- public native void keyRelease (int keycode);
- native int[] nativeGetRGBPixels (int x, int y, int width, int height);
-
- public int getRGBPixel (int x, int y)
- {
- return cm.getRGB (nativeGetRGBPixels (x, y, 1, 1)[0]);
- }
-
- public int[] getRGBPixels (Rectangle r)
- {
- int[] gdk_pixels = nativeGetRGBPixels (r.x, r.y, r.width, r.height);
- int[] pixels = new int[r.width * r.height];
-
- for (int i = 0; i < r.width * r.height; i++)
- pixels[i] = cm.getRGB (gdk_pixels[i]);
-
- return pixels;
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java b/libjava/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java
deleted file mode 100644
index 2bf9d23db94..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* GdkScreenGraphicsDevice.java -- information about a screen device
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Dimension;
-import java.awt.DisplayMode;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-
-public class GdkScreenGraphicsDevice extends GraphicsDevice
-{
- GdkGraphicsEnvironment env;
-
- public GtkToolkit getToolkit()
- {
- return env.getToolkit();
- }
-
- public GdkScreenGraphicsDevice (GdkGraphicsEnvironment e)
- {
- super ();
- env = e;
- }
-
- public int getType ()
- {
- return GraphicsDevice.TYPE_RASTER_SCREEN;
- }
-
- public String getIDstring ()
- {
- // FIXME: query X for this string
- return "default GDK device ID string";
- }
-
- public GraphicsConfiguration[] getConfigurations ()
- {
- // FIXME: query X for the list of possible configurations
- return new GraphicsConfiguration [] { new GdkGraphicsConfiguration(this) };
- }
-
- public GraphicsConfiguration getDefaultConfiguration ()
- {
-
- // FIXME: query X for default configuration
- return new GdkGraphicsConfiguration(this);
- }
-
-
- /**
- * Returns the current display mode of this device, or null if unknown.
- *
- * @return the current display mode
- * @see #setDisplayMode(DisplayMode)
- * @see #getDisplayModes()
- * @since 1.4
- */
- public DisplayMode getDisplayMode()
- {
- // determine display mode
- Dimension dim = getToolkit().getScreenSize();
- DisplayMode mode = new DisplayMode(dim.width, dim.height, 0,
- DisplayMode.REFRESH_RATE_UNKNOWN);
- return mode;
- }
-
- /**
- * This device does not yet support fullscreen exclusive mode, so this
- * returns <code>false</code>.
- *
- * @return <code>false</code>
- * @since 1.4
- */
- public boolean isFullScreenSupported()
- {
- return false;
- }
-
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkTextLayout.java b/libjava/gnu/java/awt/peer/gtk/GdkTextLayout.java
deleted file mode 100644
index ff51745f26c..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GdkTextLayout.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/* GdkTextLayout.java
- Copyright (C) 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 gnu.classpath.Configuration;
-import gnu.java.awt.peer.ClasspathTextLayoutPeer;
-
-import java.awt.Font;
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import java.awt.font.FontRenderContext;
-import java.awt.font.GlyphMetrics;
-import java.awt.font.GlyphVector;
-import java.awt.font.TextAttribute;
-import java.awt.font.TextHitInfo;
-import java.awt.font.TextLayout;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.Rectangle2D;
-import java.text.AttributedCharacterIterator;
-import java.text.AttributedString;
-import java.text.CharacterIterator;
-
-/**
- * This is an implementation of the text layout peer interface which
- * delegates all the hard work to pango.
- *
- * @author Graydon Hoare
- */
-
-public class GdkTextLayout
- implements ClasspathTextLayoutPeer
-{
- // native side, plumbing, etc.
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary("gtkpeer");
- }
- initStaticState ();
- }
- private native void setText(String str);
- private native void getExtents(double[] inkExtents,
- double[] logExtents);
- private native void indexToPos(int idx, double[] pos);
- private native void initState ();
- private native void dispose ();
- static native void initStaticState();
- private final int native_state = GtkGenericPeer.getUniqueInteger ();
- protected void finalize ()
- {
- dispose ();
- }
-
- // we hold on to these to make sure we can render when presented
- // with non-GdkGraphics2D paint targets
- private AttributedString attributedString;
- private FontRenderContext fontRenderContext;
-
- public GdkTextLayout(AttributedString str, FontRenderContext frc)
- {
- initState();
- attributedString = str;
- fontRenderContext = frc;
- }
-
- protected class CharacterIteratorProxy
- implements CharacterIterator
- {
- public CharacterIterator target;
- public int begin;
- public int limit;
- public int index;
-
- public CharacterIteratorProxy (CharacterIterator ci)
- {
- target = ci;
- }
-
- public int getBeginIndex ()
- {
- return begin;
- }
-
- public int getEndIndex ()
- {
- return limit;
- }
-
- public int getIndex ()
- {
- return index;
- }
-
- public char setIndex (int idx)
- throws IllegalArgumentException
- {
- if (idx < begin || idx >= limit)
- throw new IllegalArgumentException ();
- char ch = target.setIndex (idx);
- index = idx;
- return ch;
- }
-
- public char first ()
- {
- int save = target.getIndex ();
- char ch = target.setIndex (begin);
- target.setIndex (save);
- return ch;
- }
-
- public char last ()
- {
- if (begin == limit)
- return this.first ();
-
- int save = target.getIndex ();
- char ch = target.setIndex (limit - 1);
- target.setIndex (save);
- return ch;
- }
-
- public char current ()
- {
- return target.current();
- }
-
- public char next ()
- {
- if (index >= limit - 1)
- return CharacterIterator.DONE;
- else
- {
- index++;
- return target.next();
- }
- }
-
- public char previous ()
- {
- if (index <= begin)
- return CharacterIterator.DONE;
- else
- {
- index--;
- return target.previous ();
- }
- }
-
- public Object clone ()
- {
- CharacterIteratorProxy cip = new CharacterIteratorProxy (this.target);
- cip.begin = this.begin;
- cip.limit = this.limit;
- cip.index = this.index;
- return cip;
- }
-
- }
-
-
- // public side
-
- public void draw (Graphics2D g2, float x, float y)
- {
- if (g2 instanceof GdkGraphics2D)
- {
- // we share pango structures directly with GdkGraphics2D
- // when legal
- GdkGraphics2D gg2 = (GdkGraphics2D) g2;
- gg2.drawGdkTextLayout(this, x, y);
- }
- else
- {
- // falling back to a rather tedious layout algorithm when
- // not legal
- AttributedCharacterIterator ci = attributedString.getIterator ();
- CharacterIteratorProxy proxy = new CharacterIteratorProxy (ci);
- Font defFont = g2.getFont ();
-
- /* Note: this implementation currently only interprets FONT text
- * attributes. There is a reasonable argument to be made for some
- * attributes being interpreted out here, where we have control of the
- * Graphics2D and can construct or derive new fonts, and some
- * attributes being interpreted by the GlyphVector itself. So far, for
- * all attributes except FONT we do neither.
- */
-
- for (char c = ci.first ();
- c != CharacterIterator.DONE;
- c = ci.next ())
- {
- proxy.begin = ci.getIndex ();
- proxy.limit = ci.getRunLimit(TextAttribute.FONT);
- if (proxy.limit <= proxy.begin)
- continue;
-
- proxy.index = proxy.begin;
-
- Object fnt = ci.getAttribute(TextAttribute.FONT);
- GlyphVector gv;
- if (fnt instanceof Font)
- gv = ((Font)fnt).createGlyphVector (fontRenderContext, proxy);
- else
- gv = defFont.createGlyphVector (fontRenderContext, proxy);
-
- g2.drawGlyphVector (gv, x, y);
-
- int n = gv.getNumGlyphs ();
- for (int i = 0; i < n; ++i)
- {
- GlyphMetrics gm = gv.getGlyphMetrics (i);
- if (gm.getAdvanceX() == gm.getAdvance ())
- x += gm.getAdvanceX ();
- else
- y += gm.getAdvanceY ();
- }
- }
- }
- }
-
- public TextHitInfo getStrongCaret (TextHitInfo hit1,
- TextHitInfo hit2)
- {
- throw new Error("not implemented");
- }
-
- public byte getBaseline ()
- {
- throw new Error("not implemented");
- }
-
- public boolean isLeftToRight ()
- {
- throw new Error("not implemented");
- }
-
- public boolean isVertical ()
- {
- throw new Error("not implemented");
- }
-
- public float getAdvance ()
- {
- throw new Error("not implemented");
- }
-
- public float getAscent ()
- {
- throw new Error("not implemented");
- }
-
- public float getDescent ()
- {
- throw new Error("not implemented");
- }
-
- public float getLeading ()
- {
- throw new Error("not implemented");
- }
-
- public int getCharacterCount ()
- {
- throw new Error("not implemented");
- }
-
- public byte getCharacterLevel (int index)
- {
- throw new Error("not implemented");
- }
-
- public float[] getBaselineOffsets ()
- {
- throw new Error("not implemented");
- }
-
- public Shape getBlackBoxBounds (int firstEndpoint, int secondEndpoint)
- {
- throw new Error("not implemented");
- }
-
- public Rectangle2D getBounds ()
- {
- double[] inkExtents = new double[4];
- double[] logExtents = new double[4];
- getExtents(inkExtents, logExtents);
- return new Rectangle2D.Double(logExtents[0], logExtents[1],
- logExtents[2], logExtents[3]);
- }
-
- public float[] getCaretInfo (TextHitInfo hit, Rectangle2D bounds)
- {
- throw new Error("not implemented");
- }
-
- public Shape getCaretShape (TextHitInfo hit, Rectangle2D bounds)
- {
- throw new Error("not implemented");
- }
-
- public Shape[] getCaretShapes (int offset, Rectangle2D bounds,
- TextLayout.CaretPolicy policy)
- {
- throw new Error("not implemented");
- }
-
- public Shape getLogicalHighlightShape (int firstEndpoint, int secondEndpoint,
- Rectangle2D bounds)
- {
- AffineTransform at = new AffineTransform();
- GeneralPath gp = new GeneralPath();
- double [] rect = new double[4];
- Rectangle2D tmp = new Rectangle2D.Double();
- for (int i = firstEndpoint; i <= secondEndpoint; ++i)
- {
- indexToPos(i, rect);
- tmp.setRect(rect[0], rect[1], rect[2], rect[3]);
- Rectangle2D.intersect(tmp, bounds, tmp);
- gp.append(tmp.getPathIterator(at), false);
- }
- return gp;
- }
-
- public int[] getLogicalRangesForVisualSelection (TextHitInfo firstEndpoint,
- TextHitInfo secondEndpoint)
- {
- throw new Error("not implemented");
- }
-
- public TextHitInfo getNextLeftHit (int offset, TextLayout.CaretPolicy policy)
- {
- throw new Error("not implemented");
- }
- public TextHitInfo getNextRightHit (int offset, TextLayout.CaretPolicy policy)
- {
- throw new Error("not implemented");
- }
- public TextHitInfo hitTestChar (float x, float y, Rectangle2D bounds)
- {
- throw new Error("not implemented");
- }
- public TextHitInfo getVisualOtherHit (TextHitInfo hit)
- {
- throw new Error("not implemented");
- }
-
- public float getVisibleAdvance ()
- {
- throw new Error("not implemented");
- }
-
- public Shape getOutline (AffineTransform tx)
- {
- throw new Error("not implemented");
- }
-
- public Shape getVisualHighlightShape (TextHitInfo firstEndpoint,
- TextHitInfo secondEndpoint,
- Rectangle2D bounds)
- {
- throw new Error("not implemented");
- }
-
-
- public TextLayout getJustifiedLayout (float justificationWidth)
- {
- throw new Error("not implemented");
- }
-
- public void handleJustify (float justificationWidth)
- {
- throw new Error("not implemented");
- }
-
- public Object clone ()
- {
- throw new Error("not implemented");
- }
-
- public int hashCode ()
- {
- throw new Error("not implemented");
- }
-
- public boolean equals (ClasspathTextLayoutPeer tl)
- {
- throw new Error("not implemented");
- }
-
- public String toString ()
- {
- throw new Error("not implemented");
- }
-
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
deleted file mode 100644
index ab5df9f463f..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* GtkButtonPeer.java -- Implements ButtonPeer with GTK
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.AWTEvent;
-import java.awt.Button;
-import java.awt.Component;
-import java.awt.Point;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.peer.ButtonPeer;
-
-public class GtkButtonPeer extends GtkComponentPeer
- implements ButtonPeer
-{
- native void create (String label);
-
- public native void connectSignals ();
-
- native void gtkWidgetModifyFont (String name, int style, int size);
- native void gtkSetLabel (String label);
- native void gtkWidgetSetForeground (int red, int green, int blue);
- native void gtkWidgetSetBackground (int red, int green, int blue);
- native void gtkActivate ();
- native void gtkWidgetRequestFocus ();
- native void setNativeBounds (int x, int y, int width, int height);
-
- public GtkButtonPeer (Button b)
- {
- super (b);
- }
-
- void create ()
- {
- create (((Button) awtComponent).getLabel ());
- }
-
- public void setLabel (String label)
- {
- gtkSetLabel(label);
- }
-
- public void handleEvent (AWTEvent e)
- {
- if (e.getID () == MouseEvent.MOUSE_RELEASED && isEnabled ())
- {
- MouseEvent me = (MouseEvent) e;
- Point p = me.getPoint();
- p.translate(((Component) me.getSource()).getX(),
- ((Component) me.getSource()).getY());
- if (!me.isConsumed ()
- && (me.getModifiersEx () & MouseEvent.BUTTON1_DOWN_MASK) != 0
- && awtComponent.getBounds().contains(p))
- postActionEvent (((Button) awtComponent).getActionCommand (),
- me.getModifiersEx ());
- }
-
- if (e.getID () == KeyEvent.KEY_PRESSED)
- {
- KeyEvent ke = (KeyEvent) e;
- if (!ke.isConsumed () && ke.getKeyCode () == KeyEvent.VK_SPACE)
- {
- postActionEvent (((Button) awtComponent).getActionCommand (),
- ke.getModifiersEx ());
- gtkActivate ();
- }
- }
-
- super.handleEvent (e);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java
deleted file mode 100644
index dc21761209e..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* GtkCanvasPeer.java
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.AWTEvent;
-import java.awt.Canvas;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.event.PaintEvent;
-import java.awt.peer.CanvasPeer;
-
-public class GtkCanvasPeer extends GtkComponentPeer implements CanvasPeer
-{
- native void create ();
-
- public GtkCanvasPeer (Canvas c)
- {
- super (c);
- }
-
- public Graphics getGraphics ()
- {
- if (GtkToolkit.useGraphics2D ())
- return new GdkGraphics2D (this);
- else
- return new GdkGraphics (this);
- }
-
- public void handleEvent (AWTEvent event)
- {
- int id = event.getID();
-
- switch (id)
- {
- case PaintEvent.PAINT:
- case PaintEvent.UPDATE:
- {
- try
- {
- Graphics g = getGraphics ();
- g.setClip (((PaintEvent)event).getUpdateRect());
-
- if (id == PaintEvent.PAINT)
- awtComponent.paint (g);
- else
- awtComponent.update (g);
-
- g.dispose ();
- }
- catch (InternalError e)
- {
- System.err.println (e);
- }
- }
- break;
- }
- }
-
- /* Preferred size for a drawing widget is always what the user requested */
- public Dimension getPreferredSize ()
- {
- return awtComponent.getSize ();
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
deleted file mode 100644
index 46b0733d363..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* GtkCheckboxGroupPeer.java - Wrap a CheckboxGroup
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.CheckboxGroup;
-import java.util.WeakHashMap;
-
-// Note that there is no peer interface for a CheckboxGroup. We
-// introduce our own in order to make it easier to keep a piece of
-// native state for each one.
-public class GtkCheckboxGroupPeer extends GtkGenericPeer
-{
- // This maps from a CheckboxGroup to the native peer.
- private static WeakHashMap map = new WeakHashMap ();
-
- // Find the native peer corresponding to a CheckboxGroup.
- public static synchronized GtkCheckboxGroupPeer
- getCheckboxGroupPeer (CheckboxGroup group)
- {
- if (group == null)
- return null;
- GtkCheckboxGroupPeer nat = (GtkCheckboxGroupPeer) map.get (group);
- if (nat == null)
- {
- nat = new GtkCheckboxGroupPeer ();
- map.put (group, nat);
- }
- return nat;
- }
-
- private GtkCheckboxGroupPeer ()
- {
- // We don't need any special state here. Note that we can't store
- // a reference to the java-side CheckboxGroup. That would mean
- // they could never be collected.
- super (null);
- }
-
- // Dispose of our native resources.
- public native void dispose ();
-
- // Remove a given checkbox from this group.
- public native void remove (GtkCheckboxPeer box);
-
- // When collected, clean up the native state.
- protected void finalize ()
- {
- dispose ();
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
deleted file mode 100644
index 01a6e3102d9..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* GtkCheckboxMenuItemPeer.java -- Implements CheckboxMenuItemPeer with GTK+
- Copyright (C) 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.CheckboxMenuItem;
-import java.awt.ItemSelectable;
-import java.awt.event.ItemEvent;
-import java.awt.peer.CheckboxMenuItemPeer;
-
-public class GtkCheckboxMenuItemPeer extends GtkMenuItemPeer
- implements CheckboxMenuItemPeer
-{
- native void create (String label);
-
- public GtkCheckboxMenuItemPeer (CheckboxMenuItem menu)
- {
- super (menu);
- setState (menu.getState ());
- }
-
- public native 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();
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
deleted file mode 100644
index 851757245aa..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* GtkCheckboxPeer.java -- Implements CheckboxPeer with GTK
- Copyright (C) 1998, 1999, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Checkbox;
-import java.awt.CheckboxGroup;
-import java.awt.peer.CheckboxPeer;
-
-public class GtkCheckboxPeer extends GtkComponentPeer
- implements CheckboxPeer
-{
- // Group from last time it was set.
- public GtkCheckboxGroupPeer old_group;
- // The current state of the GTK checkbox.
- private boolean currentState;
-
- public native void create (GtkCheckboxGroupPeer group);
- public native void nativeSetCheckboxGroup (GtkCheckboxGroupPeer group);
- public native void connectSignals ();
- native void gtkWidgetModifyFont (String name, int style, int size);
- native void gtkButtonSetLabel (String label);
- native void gtkToggleButtonSetActive (boolean is_active);
-
- public GtkCheckboxPeer (Checkbox c)
- {
- super (c);
- }
-
- // FIXME: we must be able to switch between a checkbutton and a
- // radiobutton dynamically.
- public void create ()
- {
- Checkbox checkbox = (Checkbox) awtComponent;
- CheckboxGroup g = checkbox.getCheckboxGroup ();
- old_group = GtkCheckboxGroupPeer.getCheckboxGroupPeer (g);
- create (old_group);
- gtkToggleButtonSetActive (checkbox.getState ());
- gtkButtonSetLabel (checkbox.getLabel ());
- }
-
- public void setState (boolean state)
- {
- if (currentState != state)
- gtkToggleButtonSetActive (state);
- }
-
- public void setLabel (String label)
- {
- gtkButtonSetLabel (label);
- }
-
- public void setCheckboxGroup (CheckboxGroup group)
- {
- GtkCheckboxGroupPeer gp
- = GtkCheckboxGroupPeer.getCheckboxGroupPeer (group);
- if (gp != old_group)
- {
- if (old_group != null)
- old_group.remove (this);
- nativeSetCheckboxGroup (gp);
- old_group = gp;
- }
- }
-
- // Override the superclass postItemEvent so that the peer doesn't
- // need information that we have.
- public void postItemEvent (Object item, int stateChange)
- {
- Checkbox currentCheckBox = ((Checkbox)awtComponent);
- // A firing of the event is only desired if the state has changed due to a
- // button press. The currentCheckBox's state must be different from the
- // one that the stateChange is changing to.
- // stateChange = 1 if it goes from false -> true
- // stateChange = 2 if it goes from true -> false
- if (( !currentCheckBox.getState() && stateChange == 1)
- || (currentCheckBox.getState() && stateChange == 2))
- {
- super.postItemEvent (awtComponent, stateChange);
- currentState = !currentCheckBox.getState();
- currentCheckBox.setState(currentState);
- }
- }
-
- public void dispose ()
- {
- // Notify the group so that the native state can be cleaned up
- // appropriately.
- if (old_group != null)
- old_group.remove (this);
- super.dispose ();
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
deleted file mode 100644
index 6260b58e0e6..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* GtkChoicePeer.java -- Implements ChoicePeer with GTK
- Copyright (C) 1998, 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Choice;
-import java.awt.event.ItemEvent;
-import java.awt.peer.ChoicePeer;
-
-public class GtkChoicePeer extends GtkComponentPeer
- implements ChoicePeer
-{
- public GtkChoicePeer (Choice c)
- {
- super (c);
-
- int count = c.getItemCount ();
- if (count > 0)
- {
- String items[] = new String[count];
- for (int i = 0; i < count; i++)
- items[i] = c.getItem (i);
-
- append (items);
- }
-
- int selected = c.getSelectedIndex();
- if (selected >= 0)
- select(selected);
- }
-
- native void create ();
-
- native void append (String items[]);
- native int nativeGetSelected ();
- native void nativeAdd (String item, int index);
- native void nativeRemove (int index);
- native void nativeRemoveAll ();
-
- public native void select (int position);
-
- public void add (String item, int index)
- {
- int before = nativeGetSelected();
-
- nativeAdd (item, index);
-
- /* Generate an ItemEvent if we added the first one or
- if we inserted at or before the currently selected item. */
- if ((before < 0) || (before >= index))
- {
- // Must set our state before notifying listeners
- ((Choice) awtComponent).select (((Choice) awtComponent).getItem (0));
- postItemEvent (((Choice) awtComponent).getItem (0), ItemEvent.SELECTED);
- }
- }
-
- public void remove (int index)
- {
- int before = nativeGetSelected();
- int after;
-
- nativeRemove (index);
- after = nativeGetSelected();
-
- /* Generate an ItemEvent if we are removing the currently selected item
- and there are at least one item left. */
- if ((before == index) && (after >= 0))
- {
- // Must set our state before notifying listeners
- ((Choice) awtComponent).select (((Choice) awtComponent).getItem (0));
- postItemEvent (((Choice) awtComponent).getItem (0), ItemEvent.SELECTED);
- }
- }
-
- public void removeAll ()
- {
- nativeRemoveAll();
- }
-
- public void addItem (String item, int position)
- {
- add (item, position);
- }
-
- protected void choicePostItemEvent (String label, int stateChange)
- {
- // Must set our state before notifying listeners
- if (stateChange == ItemEvent.SELECTED)
- ((Choice) awtComponent).select (label);
- postItemEvent (label, stateChange);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java b/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
deleted file mode 100644
index c719cddb575..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/* GtkClipboard.java
- Copyright (C) 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.datatransfer.Clipboard;
-import java.awt.datatransfer.ClipboardOwner;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.StringSelection;
-import java.awt.datatransfer.Transferable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-public class GtkClipboard extends Clipboard
-{
- /* the number of milliseconds that we'll wait around for the
- owner of the GDK_SELECTION_PRIMARY selection to convert
- the requested data */
- static final int SELECTION_RECEIVED_TIMEOUT = 5000;
-
- /* We currently only support transferring of text between applications */
- static String selection;
- static Object selectionLock = new Object ();
-
- static boolean hasSelection = false;
-
- protected GtkClipboard()
- {
- super("System Clipboard");
- initNativeState();
- }
-
- public Transferable getContents(Object requestor)
- {
- synchronized (this)
- {
- if (hasSelection)
- return contents;
- }
-
- /* Java doesn't own the selection, so we need to ask X11 */
- // XXX: Does this hold with Swing too ?
- synchronized (selectionLock)
- {
- requestStringConversion();
-
- try
- {
- selectionLock.wait(SELECTION_RECEIVED_TIMEOUT);
- }
- catch (InterruptedException e)
- {
- return null;
- }
-
- return selection == null ? null : new StringSelection(selection);
- }
- }
-
- void stringSelectionReceived(String newSelection)
- {
- synchronized (selectionLock)
- {
- selection = newSelection;
- selectionLock.notify();
- }
- }
-
- /* convert Java clipboard data into a String suitable for sending
- to another application */
- synchronized String stringSelectionHandler() throws IOException
- {
- String selection = null;
-
- try
- {
- if (contents.isDataFlavorSupported(DataFlavor.stringFlavor))
- selection = (String)contents.getTransferData(DataFlavor.stringFlavor);
- else if (contents.isDataFlavorSupported(DataFlavor.plainTextFlavor))
- {
- StringBuffer sbuf = new StringBuffer();
- InputStreamReader reader;
- char readBuf[] = new char[512];
- int numChars;
-
- reader = new InputStreamReader
- ((InputStream)
- contents.getTransferData(DataFlavor.plainTextFlavor), "UNICODE");
-
- while (true)
- {
- numChars = reader.read(readBuf);
- if (numChars == -1)
- break;
- sbuf.append(readBuf, 0, numChars);
- }
-
- selection = new String(sbuf);
- }
- }
- catch (Exception e)
- {
- }
-
- return selection;
- }
-
- public synchronized void setContents(Transferable contents,
- ClipboardOwner owner)
- {
- selectionGet();
-
- this.contents = contents;
- this.owner = owner;
-
- hasSelection = true;
- }
-
- synchronized void selectionClear()
- {
- hasSelection = false;
-
- if (owner != null)
- {
- owner.lostOwnership(this, contents);
- owner = null;
- contents = null;
- }
- }
-
- native void initNativeState();
- static native void requestStringConversion();
- static native void selectionGet();
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
deleted file mode 100644
index 61dbaadf054..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
+++ /dev/null
@@ -1,662 +0,0 @@
-/* GtkComponentPeer.java -- Implements ComponentPeer with GTK
- Copyright (C) 1998, 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.AWTEvent;
-import java.awt.AWTException;
-import java.awt.BufferCapabilities;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Cursor;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-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.Point;
-import java.awt.Rectangle;
-import java.awt.Toolkit;
-import java.awt.Window;
-import java.awt.event.FocusEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.event.PaintEvent;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageObserver;
-import java.awt.image.ImageProducer;
-import java.awt.image.VolatileImage;
-import java.awt.peer.ComponentPeer;
-
-public class GtkComponentPeer extends GtkGenericPeer
- implements ComponentPeer
-{
- VolatileImage backBuffer;
- BufferCapabilities caps;
-
- Component awtComponent;
-
- Insets insets;
-
- boolean isInRepaint;
-
- /* this isEnabled differs from Component.isEnabled, in that it
- knows if a parent is disabled. In that case Component.isEnabled
- may return true, but our isEnabled will always return false */
- native boolean isEnabled ();
- static native boolean modalHasGrab();
-
- native int[] gtkWidgetGetForeground ();
- native int[] gtkWidgetGetBackground ();
- native void gtkWidgetGetDimensions (int[] dim);
- native void gtkWidgetGetPreferredDimensions (int[] dim);
- native void gtkWidgetGetLocationOnScreen (int[] point);
- native void gtkWidgetSetCursor (int type);
- native void gtkWidgetSetBackground (int red, int green, int blue);
- native void gtkWidgetSetForeground (int red, int green, int blue);
- native void gtkWidgetSetSensitive (boolean sensitive);
- native void gtkWidgetSetParent (ComponentPeer parent);
- native void gtkWidgetRequestFocus ();
- native void gtkWidgetDispatchKeyEvent (int id, long when, int mods,
- int keyCode, int keyLocation);
-
- native boolean isRealized ();
-
- void create ()
- {
- throw new RuntimeException ();
- }
-
- native void connectSignals ();
-
- protected GtkComponentPeer (Component awtComponent)
- {
- super (awtComponent);
- this.awtComponent = awtComponent;
- insets = new Insets (0, 0, 0, 0);
-
- create ();
-
- connectSignals ();
-
- if (awtComponent.getForeground () != null)
- setForeground (awtComponent.getForeground ());
- if (awtComponent.getBackground () != null)
- setBackground (awtComponent.getBackground ());
- if (awtComponent.getFont() != null)
- setFont(awtComponent.getFont());
-
- Component parent = awtComponent.getParent ();
-
- // Only set our parent on the GTK side if our parent on the AWT
- // side is not showing. Otherwise the gtk peer will be shown
- // before we've had a chance to position and size it properly.
- if (awtComponent instanceof Window
- || (parent != null && ! parent.isShowing ()))
- setParentAndBounds ();
- }
-
- void setParentAndBounds ()
- {
- setParent ();
-
- setComponentBounds ();
-
- setVisibleAndEnabled ();
- }
-
- void setParent ()
- {
- ComponentPeer p;
- Component component = awtComponent;
- do
- {
- component = component.getParent ();
- p = component.getPeer ();
- }
- while (p instanceof java.awt.peer.LightweightPeer);
-
- if (p != null)
- gtkWidgetSetParent (p);
- }
-
- void beginNativeRepaint ()
- {
- isInRepaint = true;
- }
-
- void endNativeRepaint ()
- {
- isInRepaint = false;
- }
-
- /*
- * Set the bounds of this peer's AWT Component based on dimensions
- * returned by the native windowing system. Most Components impose
- * their dimensions on the peers which is what the default
- * implementation does. However some peers, like GtkFileDialogPeer,
- * need to pass their size back to the AWT Component.
- */
- void setComponentBounds ()
- {
- Rectangle bounds = awtComponent.getBounds ();
-
- if (bounds.x == 0 && bounds.y == 0
- && bounds.width == 0 && bounds.height == 0)
- return;
-
- setBounds (bounds.x, bounds.y, bounds.width, bounds.height);
- }
-
- void setVisibleAndEnabled ()
- {
- setVisible (awtComponent.isVisible ());
- setEnabled (awtComponent.isEnabled ());
- }
-
- public int checkImage (Image image, int width, int height,
- ImageObserver observer)
- {
- GtkImage i = (GtkImage) image;
- return i.checkImage ();
- }
-
- public Image createImage (ImageProducer producer)
- {
- GtkImage image = new GtkImage (producer, null);
- producer.startProduction (image);
- return image;
- }
-
- public Image createImage (int width, int height)
- {
- Graphics g;
- if (GtkToolkit.useGraphics2D ())
- {
- Graphics2D g2 = new GdkGraphics2D (width, height);
- g2.setBackground (getBackground ());
- g = g2;
- }
- else
- g = new GdkGraphics (width, height);
-
- g.setColor(getBackground());
- g.fillRect(0, 0, width, height);
-
- return new GtkOffScreenImage (null, g, width, height);
- }
-
- public void disable ()
- {
- setEnabled (false);
- }
-
- public void enable ()
- {
- setEnabled (true);
- }
-
- public ColorModel getColorModel ()
- {
- return ColorModel.getRGBdefault ();
- }
-
- public FontMetrics getFontMetrics (Font font)
- {
- return getToolkit().getFontMetrics(font);
- }
-
- public Graphics getGraphics ()
- {
- if (GtkToolkit.useGraphics2D ())
- return new GdkGraphics2D (this);
- else
- return new GdkGraphics (this);
- }
-
- public Point getLocationOnScreen ()
- {
- int point[] = new int[2];
- gtkWidgetGetLocationOnScreen (point);
- return new Point (point[0], point[1]);
- }
-
- public Dimension getMinimumSize ()
- {
- return minimumSize ();
- }
-
- public Dimension getPreferredSize ()
- {
- return preferredSize ();
- }
-
- public Toolkit getToolkit ()
- {
- return Toolkit.getDefaultToolkit();
- }
-
- public void handleEvent (AWTEvent event)
- {
- int id = event.getID();
- KeyEvent ke = null;
-
- switch (id)
- {
- case PaintEvent.PAINT:
- case PaintEvent.UPDATE:
- {
- try
- {
- Graphics g = getGraphics ();
-
- // Some peers like GtkFileDialogPeer are repainted by Gtk itself
- if (g == null)
- break;
-
- g.setClip (((PaintEvent) event).getUpdateRect());
-
- if (id == PaintEvent.PAINT)
- awtComponent.paint (g);
- else
- awtComponent.update (g);
-
- g.dispose ();
- }
- catch (InternalError e)
- {
- System.err.println (e);
- }
- }
- break;
- case KeyEvent.KEY_PRESSED:
- ke = (KeyEvent) event;
- gtkWidgetDispatchKeyEvent (ke.getID (), ke.getWhen (), ke.getModifiersEx (),
- ke.getKeyCode (), ke.getKeyLocation ());
- break;
- case KeyEvent.KEY_RELEASED:
- ke = (KeyEvent) event;
- gtkWidgetDispatchKeyEvent (ke.getID (), ke.getWhen (), ke.getModifiersEx (),
- ke.getKeyCode (), ke.getKeyLocation ());
- break;
- }
- }
-
- public boolean isFocusTraversable ()
- {
- return true;
- }
-
- public Dimension minimumSize ()
- {
- int dim[] = new int[2];
-
- gtkWidgetGetPreferredDimensions (dim);
-
- return new Dimension (dim[0], dim[1]);
- }
-
- public void paint (Graphics g)
- {
- }
-
- public Dimension preferredSize ()
- {
- int dim[] = new int[2];
-
- gtkWidgetGetPreferredDimensions (dim);
-
- return new Dimension (dim[0], dim[1]);
- }
-
- public boolean prepareImage (Image image, int width, int height,
- ImageObserver observer)
- {
- GtkImage i = (GtkImage) image;
-
- if (i.isLoaded ()) return true;
-
- class PrepareImage extends Thread
- {
- GtkImage image;
- ImageObserver observer;
-
- PrepareImage (GtkImage image, ImageObserver observer)
- {
- this.image = image;
- image.setObserver (observer);
- }
-
- public void run ()
- {
- image.source.startProduction (image);
- }
- }
-
- new PrepareImage (i, observer).start ();
- return false;
- }
-
- public void print (Graphics g)
- {
- throw new RuntimeException ();
- }
-
- public void repaint (long tm, int x, int y, int width, int height)
- {
- if (x == 0 && y == 0 && width == 0 && height == 0)
- return;
-
- q().postEvent (new PaintEvent (awtComponent, PaintEvent.UPDATE,
- new Rectangle (x, y, width, height)));
- }
-
- public void requestFocus ()
- {
- gtkWidgetRequestFocus();
- postFocusEvent(FocusEvent.FOCUS_GAINED, false);
- }
-
- public void reshape (int x, int y, int width, int height)
- {
- setBounds (x, y, width, height);
- }
-
- public void setBackground (Color c)
- {
- gtkWidgetSetBackground (c.getRed(), c.getGreen(), c.getBlue());
- }
-
- native void setNativeBounds (int x, int y, int width, int height);
-
- public void setBounds (int x, int y, int width, int height)
- {
- Component parent = awtComponent.getParent ();
-
- // Heavyweight components that are children of one or more
- // lightweight containers have to be handled specially. Because
- // calls to GLightweightPeer.setBounds do nothing, GTK has no
- // knowledge of the lightweight containers' positions. So we have
- // to add the offsets manually when placing a heavyweight
- // component within a lightweight container. The lightweight
- // container may itself be in a lightweight container and so on,
- // so we need to continue adding offsets until we reach a
- // container whose position GTK knows -- that is, the first
- // non-lightweight.
- boolean lightweightChild = false;
- Insets i;
- while (parent.isLightweight ())
- {
- lightweightChild = true;
-
- i = ((Container) parent).getInsets ();
-
- x += parent.getX () + i.left;
- y += parent.getY () + i.top;
-
- parent = parent.getParent ();
- }
-
- // We only need to convert from Java to GTK coordinates if we're
- // placing a heavyweight component in a Window.
- if (parent instanceof Window && !lightweightChild)
- {
- Insets insets = ((Window) parent).getInsets ();
- GtkWindowPeer peer = (GtkWindowPeer) parent.getPeer ();
- int menuBarHeight = 0;
- if (peer instanceof GtkFramePeer)
- menuBarHeight = ((GtkFramePeer) peer).getMenuBarHeight ();
-
- // Convert from Java coordinates to GTK coordinates.
- setNativeBounds (x - insets.left, y - insets.top + menuBarHeight,
- width, height);
- }
- else
- setNativeBounds (x, y, width, height);
- }
-
- void setCursor ()
- {
- setCursor (awtComponent.getCursor ());
- }
-
- public void setCursor (Cursor cursor)
- {
- gtkWidgetSetCursor (cursor.getType ());
- }
-
- public void setEnabled (boolean b)
- {
- gtkWidgetSetSensitive (b);
- }
-
- public void setFont (Font f)
- {
- // FIXME: This should really affect the widget tree below me.
- // Currently this is only handled if the call is made directly on
- // a text widget, which implements setFont() itself.
- gtkWidgetModifyFont(f.getName(), f.getStyle(), f.getSize());
- }
-
- public void setForeground (Color c)
- {
- gtkWidgetSetForeground (c.getRed(), c.getGreen(), c.getBlue());
- }
-
- public Color getForeground ()
- {
- int rgb[] = gtkWidgetGetForeground ();
- return new Color (rgb[0], rgb[1], rgb[2]);
- }
-
- public Color getBackground ()
- {
- int rgb[] = gtkWidgetGetBackground ();
- return new Color (rgb[0], rgb[1], rgb[2]);
- }
-
- public void setVisible (boolean b)
- {
- if (b)
- show ();
- else
- hide ();
- }
-
- public native void hide ();
- public native void show ();
-
- protected void postMouseEvent(int id, long when, int mods, int x, int y,
- int clickCount, boolean popupTrigger)
- {
- q().postEvent(new MouseEvent(awtComponent, id, when, mods, x, y,
- clickCount, popupTrigger));
- }
-
- protected void postExposeEvent (int x, int y, int width, int height)
- {
- if (!isInRepaint)
- q().postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
- new Rectangle (x, y, width, height)));
- }
-
- protected void postKeyEvent (int id, long when, int mods,
- int keyCode, char keyChar, int keyLocation)
- {
- KeyEvent keyEvent = new KeyEvent (awtComponent, id, when, mods,
- keyCode, keyChar, keyLocation);
-
- // Also post a KEY_TYPED event if keyEvent is a key press that
- // doesn't represent an action or modifier key.
- if (keyEvent.getID () == KeyEvent.KEY_PRESSED
- && (!keyEvent.isActionKey ()
- && keyCode != KeyEvent.VK_SHIFT
- && keyCode != KeyEvent.VK_CONTROL
- && keyCode != KeyEvent.VK_ALT))
- {
- synchronized (q)
- {
- q().postEvent (keyEvent);
- q().postEvent (new KeyEvent (awtComponent, KeyEvent.KEY_TYPED, when, mods,
- KeyEvent.VK_UNDEFINED, keyChar, keyLocation));
- }
- }
- else
- q().postEvent (keyEvent);
- }
-
- protected void postFocusEvent (int id, boolean temporary)
- {
- q().postEvent (new FocusEvent (awtComponent, id, temporary));
- }
-
- protected void postItemEvent (Object item, int stateChange)
- {
- q().postEvent (new ItemEvent ((ItemSelectable)awtComponent,
- ItemEvent.ITEM_STATE_CHANGED,
- item, stateChange));
- }
-
- public GraphicsConfiguration getGraphicsConfiguration ()
- {
- // FIXME: just a stub for now.
- return null;
- }
-
- public void setEventMask (long mask)
- {
- // FIXME: just a stub for now.
- }
-
- public boolean isFocusable ()
- {
- return false;
- }
-
- public boolean requestFocus (Component source, boolean b1,
- boolean b2, long x)
- {
- return false;
- }
-
- public boolean isObscured ()
- {
- return false;
- }
-
- public boolean canDetermineObscurity ()
- {
- return false;
- }
-
- public void coalescePaintEvent (PaintEvent e)
- {
-
- }
-
- public void updateCursorImmediately ()
- {
-
- }
-
- public boolean handlesWheelScrolling ()
- {
- return false;
- }
-
- // Convenience method to create a new volatile image on the screen
- // on which this component is displayed.
- public VolatileImage createVolatileImage (int width, int height)
- {
- return new GtkVolatileImage (width, height);
- }
-
- // Creates buffers used in a buffering strategy.
- public void createBuffers (int numBuffers, BufferCapabilities caps)
- throws AWTException
- {
- // numBuffers == 2 implies double-buffering, meaning one back
- // buffer and one front buffer.
- if (numBuffers == 2)
- backBuffer = new GtkVolatileImage(awtComponent.getWidth(),
- awtComponent.getHeight(),
- caps.getBackBufferCapabilities());
- else
- throw new AWTException("GtkComponentPeer.createBuffers:"
- + " multi-buffering not supported");
- this.caps = caps;
- }
-
- // Return the back buffer.
- public Image getBackBuffer ()
- {
- return backBuffer;
- }
-
- // FIXME: flip should be implemented as a fast native operation
- public void flip (BufferCapabilities.FlipContents contents)
- {
- getGraphics().drawImage(backBuffer,
- awtComponent.getWidth(),
- awtComponent.getHeight(),
- null);
-
- // create new back buffer and clear it to the background color.
- if (contents == BufferCapabilities.FlipContents.BACKGROUND)
- {
- backBuffer = createVolatileImage(awtComponent.getWidth(),
- awtComponent.getHeight());
- backBuffer.getGraphics().clearRect(0, 0,
- awtComponent.getWidth(),
- awtComponent.getHeight());
- }
- // FIXME: support BufferCapabilities.FlipContents.PRIOR
- }
-
- // Release the resources allocated to back buffers.
- public void destroyBuffers ()
- {
- backBuffer.flush();
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
deleted file mode 100644
index e4d033fc2f6..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/* GtkContainerPeer.java -- Implements ContainerPeer with GTK
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Font;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Window;
-import java.awt.peer.ComponentPeer;
-import java.awt.peer.ContainerPeer;
-
-public class GtkContainerPeer extends GtkComponentPeer
- implements ContainerPeer
-{
- Container c;
- boolean isValidating;
-
- public GtkContainerPeer(Container c)
- {
- super (c);
- this.c = c;
- }
-
- public void beginValidate ()
- {
- isValidating = true;
- }
-
- public void endValidate ()
- {
- Component parent = awtComponent.getParent ();
-
- // Only set our parent on the GTK side if our parent on the AWT
- // side is not showing. Otherwise the gtk peer will be shown
- // before we've had a chance to position and size it properly.
- if (parent != null && parent.isShowing ())
- {
- Component[] components = ((Container) awtComponent).getComponents ();
- int ncomponents = components.length;
-
- for (int i = 0; i < ncomponents; i++)
- {
- ComponentPeer peer = components[i].getPeer ();
-
- // Skip lightweight peers.
- if (peer instanceof GtkComponentPeer)
- ((GtkComponentPeer) peer).setParentAndBounds ();
- }
-
- // GTK windows don't have parents.
- if (!(awtComponent instanceof Window))
- setParentAndBounds ();
- }
-
- isValidating = false;
- }
-
- public Insets getInsets()
- {
- return insets;
- }
-
- public Insets insets()
- {
- return getInsets ();
- }
-
- public void setBounds (int x, int y, int width, int height)
- {
- super.setBounds (x, y, width, height);
- }
-
- public void setFont(Font f)
- {
- super.setFont(f);
- Component[] components = ((Container) awtComponent).getComponents();
- for (int i = 0; i < components.length; i++)
- {
- GtkComponentPeer peer = (GtkComponentPeer) components[i].getPeer();
- if (peer != null && ! peer.awtComponent.isFontSet())
- peer.setFont(f);
- }
- }
-
- public Graphics getGraphics ()
- {
- return super.getGraphics();
- }
-
- public void beginLayout () { }
- public void endLayout () { }
- public boolean isPaintPending () { return false; }
-
- public void setBackground (Color c)
- {
- super.setBackground(c);
-
- Object components[] = ((Container) awtComponent).getComponents();
- for (int i = 0; i < components.length; i++)
- {
- Component comp = (Component) components[i];
-
- // If the child's background has not been explicitly set yet,
- // it should inherit this container's background. This makes the
- // child component appear as if it has a transparent background.
- // Note that we do not alter the background property of the child,
- // but only repaint the child with the parent's background color.
- if (!comp.isBackgroundSet() && comp.getPeer() != null)
- comp.getPeer().setBackground(c);
- }
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
deleted file mode 100644
index c2cbc37dce9..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* GtkDialogPeer.java -- Implements DialogPeer with GTK
- Copyright (C) 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Dialog;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-import java.awt.event.PaintEvent;
-import java.awt.peer.DialogPeer;
-
-public class GtkDialogPeer extends GtkWindowPeer
- implements DialogPeer
-{
- public GtkDialogPeer (Dialog dialog)
- {
- super (dialog);
- }
-
- public Graphics getGraphics ()
- {
- Graphics g;
- if (GtkToolkit.useGraphics2D ())
- g = new GdkGraphics2D (this);
- else
- g = new GdkGraphics (this);
- g.translate (-insets.left, -insets.top);
- return g;
- }
-
- protected void postMouseEvent(int id, long when, int mods, int x, int y,
- int clickCount, boolean popupTrigger)
- {
- super.postMouseEvent (id, when, mods,
- x + insets.left, y + insets.top,
- clickCount, popupTrigger);
- }
-
- protected void postExposeEvent (int x, int y, int width, int height)
- {
- if (!isInRepaint)
- q().postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
- new Rectangle (x + insets.left,
- y + insets.top,
- width, height)));
- }
-
- void create ()
- {
- // Create a decorated dialog window.
- create (GDK_WINDOW_TYPE_HINT_DIALOG, true);
-
- Dialog dialog = (Dialog) awtComponent;
-
- gtkWindowSetModal (dialog.isModal ());
- setTitle (dialog.getTitle ());
- setResizable (dialog.isResizable ());
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java
deleted file mode 100644
index 0533d2759c2..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* GtkEmbeddedWindowPeer.java -- Implements EmbeddedWindowPeer using a
- GtkPlug
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 gnu.java.awt.EmbeddedWindow;
-import gnu.java.awt.peer.EmbeddedWindowPeer;
-
-public class GtkEmbeddedWindowPeer extends GtkFramePeer
- implements EmbeddedWindowPeer
-{
- native void create (long socket_id);
-
- void create ()
- {
- create (((EmbeddedWindow) awtComponent).getHandle ());
- }
-
- native void construct (long socket_id);
-
- // FIXME: embed doesn't work right now, though I believe it should.
- // This means that you can't call setVisible (true) on an
- // EmbeddedWindow before calling setHandle with a valid handle. The
- // problem is that somewhere after the call to
- // GtkEmbeddedWindow.create and before the call to
- // GtkEmbeddedWindow.construct, the GtkPlug peer is being realized.
- // GtkSocket silently fails to embed an already-realized GtkPlug.
- public void embed (long handle)
- {
- construct (handle);
- }
-
- public GtkEmbeddedWindowPeer (EmbeddedWindow w)
- {
- super (w);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
deleted file mode 100644
index bd1f0775a92..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/* GtkFileDialogPeer.java -- Implements FileDialogPeer with GTK
- Copyright (C) 1998, 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Dialog;
-import java.awt.FileDialog;
-import java.awt.Graphics;
-import java.awt.Window;
-import java.awt.peer.FileDialogPeer;
-import java.io.File;
-import java.io.FilenameFilter;
-
-public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
-{
- static final String FS = System.getProperty("file.separator");
-
- private String currentFile = null;
- private String currentDirectory = null;
- private FilenameFilter filter;
-
- native void create (GtkContainerPeer parent);
- native void connectSignals ();
- native void nativeSetFile (String file);
- public native String nativeGetDirectory();
- public native void nativeSetDirectory(String directory);
- native void nativeSetFilenameFilter (FilenameFilter filter);
-
- public void create()
- {
- create((GtkContainerPeer) awtComponent.getParent().getPeer());
-
- FileDialog fd = (FileDialog) awtComponent;
-
- setDirectory(fd.getDirectory());
- setFile(fd.getFile());
-
- FilenameFilter filter = fd.getFilenameFilter();
- if (filter != null)
- setFilenameFilter(filter);
- }
-
- public GtkFileDialogPeer (FileDialog fd)
- {
- super (fd);
- }
-
- void setComponentBounds ()
- {
- if (awtComponent.getHeight () == 0
- && awtComponent.getWidth () == 0)
- {
- int[] dims = new int[2];
- gtkWidgetGetPreferredDimensions (dims);
- ((GtkFileDialogPeer) this).setBoundsCallback ((Window) awtComponent,
- awtComponent.getX (),
- awtComponent.getY (),
- dims[0], dims[1]);
- }
- super.setComponentBounds ();
- }
-
- public void setFile (String fileName)
- {
- /* If nothing changed do nothing. This usually happens because
- the only way we have to set the file name in FileDialog is by
- calling its SetFile which will call us back. */
- if ((fileName == null && currentFile == null)
- || (fileName != null && fileName.equals (currentFile)))
- return;
-
- if (fileName == null || fileName.equals (""))
- {
- currentFile = "";
- nativeSetFile ("");
- return;
- }
-
- // GtkFileChooser requires absolute filenames. If the given filename
- // is not absolute, let's construct it based on current directory.
- currentFile = fileName;
- if (fileName.indexOf(FS) == 0)
- {
- nativeSetFile (fileName);
- }
- else
- {
- nativeSetFile (nativeGetDirectory() + FS + fileName);
- }
- }
-
- public void setDirectory (String directory)
- {
- /* If nothing changed so nothing. This usually happens because
- the only way we have to set the directory in FileDialog is by
- calling its setDirectory which will call us back. */
- if ((directory == null && currentDirectory == null)
- || (directory != null && directory.equals (currentDirectory)))
- return;
-
- if (directory == null || directory.equals (""))
- {
- currentDirectory = FS;
- nativeSetFile (FS);
- return;
- }
-
- currentDirectory = directory;
- nativeSetDirectory (directory);
- }
-
- public void setFilenameFilter (FilenameFilter filter)
- {
- this.filter = filter;
- nativeSetFilenameFilter(filter);
- }
-
- /* This method interacts with the native callback function of the
- same name. The native function will extract the filename from the
- GtkFileFilterInfo object and send it to this method, which will
- in turn call the filter's accept() method and give back the return
- value. */
- boolean filenameFilterCallback (String fullname) {
- String filename = fullname.substring(fullname.lastIndexOf(FS) + 1);
- String dirname = fullname.substring(0, fullname.lastIndexOf(FS));
- File dir = new File(dirname);
- return filter.accept(dir, filename);
- }
-
- public Graphics getGraphics ()
- {
- // GtkFileDialog will repaint by itself
- return null;
- }
-
- void gtkHideFileDialog ()
- {
- ((Dialog) awtComponent).hide();
- }
-
- void gtkDisposeFileDialog ()
- {
- ((Dialog) awtComponent).dispose();
- }
-
- /* Callback to set the file and directory values when the user is finished
- * with the dialog.
- */
- void gtkSetFilename (String fileName)
- {
- FileDialog fd = (FileDialog) awtWidget;
- if (fileName == null)
- {
- currentFile = null;
- fd.setFile(null);
- return;
- }
-
- int sepIndex = fileName.lastIndexOf (FS);
- if (sepIndex < 0)
- {
- /* This should never happen on Unix (all paths start with '/') */
- currentFile = fileName;
- }
- else
- {
- if (fileName.length() > (sepIndex + 1))
- {
- String fn = fileName.substring (sepIndex + 1);
- currentFile = fn;
- }
- else
- {
- currentFile = null;
- }
-
- String dn = fileName.substring (0, sepIndex + 1);
- currentDirectory = dn;
- fd.setDirectory(dn);
- }
-
- fd.setFile (currentFile);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java
deleted file mode 100644
index 80ad1580362..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/* GtkFontPeer.java -- Implements FontPeer with GTK+
- Copyright (C) 1999, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 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.text.CharacterIterator;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class GtkFontPeer extends ClasspathFontPeer
-{
- private static ResourceBundle bundle;
-
- static
- {
- try
- {
- bundle = ResourceBundle.getBundle ("gnu.java.awt.peer.gtk.font");
- }
- catch (Throwable ignored)
- {
- bundle = null;
- }
- }
-
- private final String Xname;
-
- public GtkFontPeer (String name, int style)
- {
- // All fonts get a default size of 12 if size is not specified.
- this(name, style, 12);
- }
-
- public GtkFontPeer (String name, int style, int size)
- {
- super(name, style, size);
-
- String Xname = null;
- if (bundle != null)
- {
- try
- {
- Xname = bundle.getString (name.toLowerCase () + "." + style);
- }
- catch (MissingResourceException mre)
- {
- // ignored
- }
- }
-
- if (Xname == null)
- {
- String weight;
- String slant;
- String spacing;
-
- if (style == Font.ITALIC || (style == (Font.BOLD+Font.ITALIC)))
- slant = "i";
- else
- slant = "r";
- if (style == Font.BOLD || (style == (Font.BOLD+Font.ITALIC)))
- weight = "bold";
- else
- weight = "medium";
- if (name.equals("Serif") || name.equals("SansSerif")
- || name.equals("Helvetica") || name.equals("Times"))
- spacing = "p";
- else
- spacing = "c";
-
- Xname = "-*-*-" + weight + "-" + slant + "-normal-*-*-" + size + "-*-*-" + spacing + "-*-*-*";
- }
-
- this.Xname = Xname;
- }
-
- public String getXLFD ()
- {
- return Xname;
- }
-
-
- /* remaining methods are for static compatibility with the newer
- ClasspathFontPeer superclass; none of these methods ever existed or
- worked on the older FontPeer interface, but we need to pretend to
- support them anyways. */
-
- public boolean canDisplay (Font font, char c)
- {
- throw new UnsupportedOperationException();
- }
-
- public int canDisplayUpTo (Font font, CharacterIterator i, int start, int limit)
- {
- throw new UnsupportedOperationException();
- }
-
- public String getSubFamilyName (Font font, Locale locale)
- {
- throw new UnsupportedOperationException();
- }
-
- public String getPostScriptName (Font font)
- {
- throw new UnsupportedOperationException();
- }
-
- public int getNumGlyphs (Font font)
- {
- throw new UnsupportedOperationException();
- }
-
- public int getMissingGlyphCode (Font font)
- {
- throw new UnsupportedOperationException();
- }
-
- public byte getBaselineFor (Font font, char c)
- {
- throw new UnsupportedOperationException();
- }
-
- public String getGlyphName (Font font, int glyphIndex)
- {
- throw new UnsupportedOperationException();
- }
-
- public GlyphVector createGlyphVector (Font font,
- FontRenderContext frc,
- CharacterIterator ci)
- {
- throw new UnsupportedOperationException();
- }
-
- public GlyphVector createGlyphVector (Font font,
- FontRenderContext ctx,
- int[] glyphCodes)
- {
- throw new UnsupportedOperationException();
- }
-
- public GlyphVector layoutGlyphVector (Font font,
- FontRenderContext frc,
- char[] chars, int start,
- int limit, int flags)
- {
- throw new UnsupportedOperationException();
- }
-
- public FontMetrics getFontMetrics (Font font)
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasUniformLineMetrics (Font font)
- {
- throw new UnsupportedOperationException();
- }
-
- public LineMetrics getLineMetrics (Font font,
- CharacterIterator ci,
- int begin, int limit,
- FontRenderContext rc)
- {
- throw new UnsupportedOperationException();
- }
-
- public Rectangle2D getMaxCharBounds (Font font,
- FontRenderContext rc)
- {
- throw new UnsupportedOperationException();
- }
-
- public Rectangle2D getStringBounds (Font font,
- CharacterIterator ci,
- int begin, int limit,
- FontRenderContext frc)
- {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
deleted file mode 100644
index 77b7a81786a..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/* GtkFramePeer.java -- Implements FramePeer with GTK
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Frame;
-import java.awt.Graphics;
-import java.awt.Image;
-import java.awt.MenuBar;
-import java.awt.Rectangle;
-import java.awt.Window;
-import java.awt.event.PaintEvent;
-import java.awt.image.ColorModel;
-import java.awt.peer.FramePeer;
-import java.awt.peer.MenuBarPeer;
-
-public class GtkFramePeer extends GtkWindowPeer
- implements FramePeer
-{
- private int menuBarHeight;
- private MenuBarPeer menuBar;
- native int getMenuBarHeight (MenuBarPeer bar);
- native void setMenuBarWidth (MenuBarPeer bar, int width);
- native void setMenuBarPeer (MenuBarPeer bar);
- native void removeMenuBarPeer ();
- native void gtkFixedSetVisible (boolean visible);
-
- int getMenuBarHeight ()
- {
- return menuBar == null ? 0 : getMenuBarHeight (menuBar);
- }
-
- public void setMenuBar (MenuBar bar)
- {
- if (bar == null && menuBar != null)
- {
- // We're removing the menubar.
- gtkFixedSetVisible (false);
- menuBar = null;
- removeMenuBarPeer ();
- insets.top -= menuBarHeight;
- menuBarHeight = 0;
- awtComponent.validate ();
- gtkFixedSetVisible (true);
- }
- else if (bar != null && menuBar == null)
- {
- // We're adding a menubar where there was no menubar before.
- gtkFixedSetVisible (false);
- menuBar = (MenuBarPeer) ((MenuBar) bar).getPeer();
- setMenuBarPeer (menuBar);
- int menuBarWidth =
- awtComponent.getWidth () - insets.left - insets.right;
- if (menuBarWidth > 0)
- setMenuBarWidth (menuBar, menuBarWidth);
- menuBarHeight = getMenuBarHeight ();
- insets.top += menuBarHeight;
- awtComponent.validate ();
- gtkFixedSetVisible (true);
- }
- else if (bar != null && menuBar != null)
- {
- // We're swapping the menubar.
- gtkFixedSetVisible (false);
- removeMenuBarPeer();
- int oldHeight = menuBarHeight;
- int menuBarWidth =
- awtComponent.getWidth () - insets.left - insets.right;
- menuBar = (MenuBarPeer) ((MenuBar) bar).getPeer ();
- setMenuBarPeer (menuBar);
- if (menuBarWidth > 0)
- setMenuBarWidth (menuBar, menuBarWidth);
- menuBarHeight = getMenuBarHeight ();
- if (oldHeight != menuBarHeight)
- {
- insets.top += (menuBarHeight - oldHeight);
- awtComponent.validate ();
- }
- gtkFixedSetVisible (true);
- }
- }
-
- public void setBounds (int x, int y, int width, int height)
- {
- int menuBarWidth = width - insets.left - insets.right;
- if (menuBar != null && menuBarWidth > 0)
- setMenuBarWidth (menuBar, menuBarWidth);
-
- nativeSetBounds (x, y,
- width - insets.left - insets.right,
- height - insets.top - insets.bottom
- + menuBarHeight);
- }
-
- public void setResizable (boolean resizable)
- {
- // Call setSize; otherwise when resizable is changed from true to
- // false the frame will shrink to the dimensions it had before it
- // was resizable.
- setSize (awtComponent.getWidth() - insets.left - insets.right,
- awtComponent.getHeight() - insets.top - insets.bottom
- + menuBarHeight);
- gtkWindowSetResizable (resizable);
- }
-
- protected void postInsetsChangedEvent (int top, int left,
- int bottom, int right)
- {
- insets.top = top + menuBarHeight;
- insets.left = left;
- insets.bottom = bottom;
- insets.right = right;
- }
-
- public GtkFramePeer (Frame frame)
- {
- super (frame);
- }
-
- void create ()
- {
- // Create a normal decorated window.
- create (GDK_WINDOW_TYPE_HINT_NORMAL, true);
-
- Frame frame = (Frame) awtComponent;
-
- setMenuBar (frame.getMenuBar ());
-
- setTitle (frame.getTitle ());
- gtkWindowSetResizable (frame.isResizable ());
- setIconImage(frame.getIconImage());
- }
-
- native void nativeSetIconImageFromDecoder (GdkPixbufDecoder decoder);
- native void nativeSetIconImageFromData (int[] pixels, int width, int height);
- public void setIconImage (Image image)
- {
- if (image != null && image instanceof GtkImage)
- {
- GtkImage img = (GtkImage) image;
- // FIXME: Image should be loaded, but if not, do image loading here.
- if (img.isLoaded())
- {
- if (img.getSource() instanceof GdkPixbufDecoder)
- {
- nativeSetIconImageFromDecoder((GdkPixbufDecoder) img.getSource());
- }
- else
- {
- int[] pixels = img.getPixelCache();
- ColorModel model = img.getColorModel();
- int[] data = new int[pixels.length * 4];
- for (int i = 0; i < pixels.length; i++)
- {
- data[i * 4] = model.getRed(pixels[i]);
- data[i * 4 + 1] = model.getGreen(pixels[i]);
- data[i * 4 + 2] = model.getBlue(pixels[i]);
- data[i * 4 + 3] = model.getAlpha(pixels[i]);
- }
- nativeSetIconImageFromData(data, img.getWidth(null), img.getHeight(null));
- }
- }
- }
- }
-
- public Graphics getGraphics ()
- {
- Graphics g;
- if (GtkToolkit.useGraphics2D ())
- g = new GdkGraphics2D (this);
- else
- g = new GdkGraphics (this);
- g.translate (-insets.left, -insets.top);
- return g;
- }
-
- protected void postConfigureEvent (int x, int y, int width, int height)
- {
- int frame_x = x - insets.left;
- // Since insets.top includes the MenuBar height, we need to add back
- // the MenuBar height to the frame's y position.
- // If no MenuBar exists in this frame, the MenuBar height will be 0.
- int frame_y = y - insets.top + menuBarHeight;
- int frame_width = width + insets.left + insets.right;
- // Ditto as above. Since insets.top already includes the MenuBar's height,
- // we need to subtract the MenuBar's height from the top inset.
- int frame_height = height + insets.top + insets.bottom - menuBarHeight;
- if (frame_x != awtComponent.getX()
- || frame_y != awtComponent.getY()
- || frame_width != awtComponent.getWidth()
- || frame_height != awtComponent.getHeight())
- {
- if (frame_width != awtComponent.getWidth() && menuBar != null
- && width > 0)
- setMenuBarWidth (menuBar, width);
-
- setBoundsCallback ((Window) awtComponent,
- frame_x,
- frame_y,
- frame_width,
- frame_height);
-
- awtComponent.validate();
- }
- }
-
- protected void postMouseEvent(int id, long when, int mods, int x, int y,
- int clickCount, boolean popupTrigger)
- {
- super.postMouseEvent (id, when, mods,
- x + insets.left, y + insets.top,
- clickCount, popupTrigger);
- }
-
- protected void postExposeEvent (int x, int y, int width, int height)
- {
- if (!isInRepaint)
- q().postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
- new Rectangle (x + insets.left,
- y + insets.top,
- width, height)));
- }
-
- public int getState ()
- {
- return 0;
- }
-
- public void setState (int state)
- {
-
- }
-
- public void setMaximizedBounds (Rectangle r)
- {
-
- }
-}
-
-
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
deleted file mode 100644
index 669268e92d8..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/* GtkGenericPeer.java - Has a hashcode. Yuck.
- Copyright (C) 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.EventQueue;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-
-public class GtkGenericPeer
-{
- final int native_state = getUniqueInteger ();
-
- // Next native state value we will assign.
- private static int next_native_state = 0;
-
- // The widget or other java-side object we wrap.
- protected Object awtWidget;
-
- // Global event queue.
- protected static EventQueue q = null;
-
- // Dispose of our native state.
- public native void dispose ();
-
- static EventQueue q ()
- {
- return Toolkit.getDefaultToolkit ().getSystemEventQueue ();
- }
-
- protected GtkGenericPeer (Object awtWidget)
- {
- this.awtWidget = awtWidget;
- }
-
- public static void enableQueue (EventQueue sq)
- {
- if (q == null)
- q = sq;
- }
-
- protected void postActionEvent (String command, int mods)
- {
- q().postEvent (new ActionEvent (awtWidget, ActionEvent.ACTION_PERFORMED,
- command, mods));
- }
-
- // Return a unique integer for use in the native state mapping
- // code. We can't use a hash code since that is not guaranteed to
- // be unique.
- static synchronized int getUniqueInteger ()
- {
- // Let's assume this will never wrap.
- return next_native_state++;
- }
-
- native void gtkWidgetModifyFont (String name, int style, int size);
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkImage.java b/libjava/gnu/java/awt/peer/gtk/GtkImage.java
deleted file mode 100644
index a9f8e9075b6..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkImage.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/* GtkImage.java
- Copyright (C) 1999, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Graphics;
-import java.awt.Image;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageConsumer;
-import java.awt.image.ImageObserver;
-import java.awt.image.ImageProducer;
-import java.util.Hashtable;
-import java.util.Vector;
-
-public class GtkImage extends Image implements ImageConsumer
-{
- int width = -1, height = -1;
- Hashtable props = null;
- boolean isLoaded = false;
- boolean isCacheable = true;
- boolean loading = false;
-
- Vector widthObservers = new Vector ();
- Vector heightObservers = new Vector ();
- Vector propertyObservers = new Vector ();
-
- ImageProducer source;
- ImageObserver observer;
- Graphics g;
-
- /* Variables in which we stored cached data, if possible.
-
- An image is cached if the following properties are true:
- 1. The ColorModel passed into setColorModel is the same ColorModel
- passed to all invocations of setPixels.
- 2. The image contains a single frame.
-
- */
- int[] pixelCache;
- ColorModel model;
-
- public
- GtkImage (ImageProducer producer, Graphics g)
- {
- source = producer;
- this.g = g;
-
- if (source != null)
- source.addConsumer (this);
- }
-
- public void setObserver (ImageObserver observer)
- {
- this.observer = observer;
- }
-
- public synchronized int[]
- getPixelCache ()
- {
- return pixelCache;
- }
-
- public synchronized ColorModel
- getColorModel ()
- {
- return model;
- }
-
- public synchronized int
- getWidth (ImageObserver observer)
- {
- if (width == -1)
- widthObservers.addElement (observer);
-
- return width;
- }
-
- public synchronized int
- getHeight (ImageObserver observer)
- {
- if (height == -1)
- heightObservers.addElement (observer);
-
- return height;
- }
-
- public ImageProducer
- getSource ()
- {
- return source;
- }
-
- public Graphics
- getGraphics ()
- {
- return g;
- }
-
- public synchronized Object
- getProperty (String name, ImageObserver observer)
- {
- if (props == null)
- {
- propertyObservers.addElement (observer);
- return null;
- }
-
- Object value = props.get (name);
- return (value == null) ? UndefinedProperty : value;
- }
-
- public synchronized void
- flush ()
- {
- isLoaded = false;
- isCacheable = true;
- width = height = -1;
- props = null;
- pixelCache = null;
- model = null;
-
- if (source != null)
- {
- source.removeConsumer (this);
- source.addConsumer (this);
- }
- }
-
- public boolean
- isLoaded ()
- {
- return isLoaded;
- }
-
- /* ImageConsumer methods */
-
- public synchronized void
- setDimensions (int width, int height)
- {
- pixelCache = new int[width*height];
-
- this.width = width;
- this.height = height;
-
- for (int i = 0; i < widthObservers.size (); i++)
- {
- ImageObserver io = (ImageObserver) widthObservers.elementAt (i);
- if (io != null)
- io.imageUpdate (this, ImageObserver.WIDTH, -1, -1, width, height);
- }
-
- for (int i = 0; i < heightObservers.size (); i++)
- {
- ImageObserver io = (ImageObserver) heightObservers.elementAt (i);
- if (io != null)
- io.imageUpdate (this, ImageObserver.HEIGHT, -1, -1, width, height);
- }
-
- if (observer != null)
- observer.imageUpdate (this,
- (ImageObserver.WIDTH
- | ImageObserver.HEIGHT),
- -1, -1, width, height);
- }
-
- public synchronized void
- setProperties (Hashtable props)
- {
- this.props = props;
-
- for (int i = 0; i < propertyObservers.size (); i++)
- {
- ImageObserver io = (ImageObserver) propertyObservers.elementAt (i);
- if (io != null)
- io.imageUpdate (this, ImageObserver.PROPERTIES, -1, -1, width, height);
- }
- }
-
- public synchronized void
- setColorModel (ColorModel model)
- {
- if (this.model == null || this.model.equals(model))
- this.model = model;
- else
- isCacheable = false;
- }
-
- public synchronized void
- setHints (int flags)
- {
- }
-
- public synchronized void
- setPixels (int x, int y, int width, int height, ColorModel cm, byte[] pixels,
- int offset, int scansize)
- {
- setPixels (x, y, width, height, cm, convertPixels (pixels), offset,
- scansize);
-
- if (observer != null)
- observer.imageUpdate (this,
- ImageObserver.SOMEBITS,
- x, y, width, height);
- }
-
- public synchronized void
- setPixels (int x, int y, int width, int height, ColorModel cm, int[] pixels,
- int offset, int scansize)
- {
- loading = true;
-
- if (!isCacheable)
- return;
-
- if (!cm.equals(model) || pixelCache == null)
- {
- isCacheable = false;
- return;
- }
-
- if (scansize == width && height == 1)
- {
- // Copy contents of pixels array into pixel cache.
- System.arraycopy (pixels, offset,
- pixelCache, y * this.width + x,
- pixels.length - offset);
- }
- else // skip over scansize-width for each row
- {
- for (int i = 0; i < height; i++)
- System.arraycopy (pixels, offset + (i * scansize),
- pixelCache, (y + i) * this.width + x,
- width);
- }
- }
-
- public synchronized void
- imageComplete (int status)
- {
- if (status == ImageConsumer.STATICIMAGEDONE && isCacheable)
- isLoaded = true;
-
- if (status == ImageConsumer.SINGLEFRAME)
- isCacheable = false;
-
- if (observer != null)
- {
- if (status == ImageConsumer.IMAGEERROR)
- observer.imageUpdate (null,
- ImageObserver.ERROR,
- -1, -1, -1, -1);
- else
- observer.imageUpdate (null,
- ImageObserver.ALLBITS,
- -1, -1, -1, -1);
- }
-
- if (source != null && status != ImageConsumer.SINGLEFRAME)
- source.removeConsumer (this);
- }
-
- public synchronized void
- startProduction (GtkImagePainter painter)
- {
- if (isLoaded)
- {
- painter.setDimensions (width, height);
- painter.setPixels (0, 0, width, height, model, pixelCache, 0, width);
- }
- else
- {
- if (source != null)
- {
- source.startProduction (painter);
- source.removeConsumer (painter);
- }
- }
- }
-
- private int[]
- convertPixels (byte[] pixels)
- {
- int ret[] = new int[pixels.length];
-
- for (int i = 0; i < pixels.length; i++)
- ret[i] = pixels[i];
-
- return ret;
- }
-
- synchronized int
- checkImage ()
- {
- int bits = 0;
-
- if (width != -1)
- bits |= ImageObserver.WIDTH;
- if (height != -1)
- bits |= ImageObserver.HEIGHT;
- if (props != null)
- bits |= ImageObserver.PROPERTIES;
- if (loading)
- bits |= ImageObserver.SOMEBITS;
- if (isLoaded)
- bits |= ImageObserver.ALLBITS;
-
- return bits;
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java b/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java
deleted file mode 100644
index 9efa0ae7137..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/* GtkImagePainter.java
- Copyright (C) 1999, 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Color;
-import java.awt.Rectangle;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageConsumer;
-import java.awt.image.ImageObserver;
-import java.util.Hashtable;
-
-public class GtkImagePainter implements Runnable, ImageConsumer
-{
- GtkImage image;
- GdkGraphics gc;
- int startX, startY;
- int redBG;
- int greenBG;
- int blueBG;
- double affine[];
- int width, height;
- boolean flipX, flipY;
- Rectangle clip;
- int s_width, s_height;
- ImageObserver observer;
-
- public
- GtkImagePainter (GtkImage image, GdkGraphics gc, int x, int y,
- int width, int height, Color bgcolor, ImageObserver o)
- {
- this.image = image;
- this.gc = (GdkGraphics) gc.create ();
- startX = x;
- startY = y;
- redBG = bgcolor.getRed ();
- greenBG = bgcolor.getGreen ();
- blueBG = bgcolor.getBlue ();
- this.width = width;
- this.height = height;
- flipX = flipY = false;
- s_width = s_height = 0;
- clip = null;
- observer = o;
-
- run ();
- }
-
- public
- GtkImagePainter (GtkImage image, GdkGraphics gc,
- int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2,
- Color bgcolor, ImageObserver o)
- {
- this.image = image;
- this.gc = (GdkGraphics) gc.create ();
- startX = (dx1 < dx2) ? dx1 : dx2;
- startY = dy1;
- redBG = bgcolor.getRed ();
- greenBG = bgcolor.getGreen ();
- blueBG = bgcolor.getBlue ();
- observer = o;
-
- this.width = Math.abs (dx2 - dx1);
- this.height = Math.abs (dy2 - dy1);
-
- flipX = ((dx1 > dx2 && sx2 > sx1)
- || (dx1 < dx2 && sx2 < sx1));
-
- flipY = ((dy1 > dy2 && sy2 > sy1)
- || (dy1 < dy2 && sy2 < sy1));
-
- s_width = Math.abs (sx2 - sx1);
- s_height = Math.abs (sy2 - sy1);
- clip = new Rectangle (sx1, sy1, s_width, s_height);
-
- run ();
- }
-
- public void
- run ()
- {
- image.startProduction (this);
- gc.dispose ();
- }
-
- /* Convert pixel data into a format that gdkrgb can understand */
- static int[]
- convertPixels (int[] pixels, ColorModel model)
- {
- if (pixels == null || model == null)
- {
- return null;
- }
-
- if (model.equals (ColorModel.getRGBdefault ()))
- return pixels;
-
- int ret[] = new int[pixels.length];
-
- for (int i = 0; i < pixels.length; i++)
- ret[i] = model.getRGB (pixels[i]);
-
- return ret;
- }
-
- static int[]
- convertPixels (byte[] pixels, ColorModel model)
- {
- if (pixels == null || model == null)
- {
- return null;
- }
-
- int ret[] = new int[pixels.length];
-
- for (int i = 0; i < pixels.length; i++)
- ret[i] = model.getRGB (pixels[i]);
-
- return ret;
- }
-
- native void
- drawPixels (GdkGraphics gc, int bg_red, int bg_green, int bg_blue,
- int x, int y, int width, int height, int[] pixels, int offset,
- int scansize, double affine[]);
-
-
- public void
- setPixels (int x, int y, int width, int height, ColorModel model,
- int[] pixels, int offset, int scansize)
- {
- if (clip != null)
- {
- Rectangle r;
- r = clip.intersection (new Rectangle (x, y, width, height));
- if (r.width == 0 && r.height == 0)
- return;
-
- offset += r.y * scansize + r.x;
-
- width = r.width;
- height = r.height;
- x = r.x;
- y = r.y;
- }
-
- drawPixels (gc, redBG, greenBG, blueBG,
- startX + x, startY + y,
- width, height, convertPixels (pixels, model), offset,
- scansize, affine);
- }
-
- public void
- setPixels (int x, int y, int width, int height, ColorModel model,
- byte[] pixels, int offset, int scansize)
- {
- setPixels (x, y, width, height, ColorModel.getRGBdefault(),
- convertPixels (pixels, model), offset, scansize);
- }
-
- public void
- setDimensions (int width, int height)
- {
- if (!flipX && !flipY &&
- ((this.width == -1 && this.height == -1)
- || (this.width == width && this.height == height)))
- return;
-
- affine = new double[6];
- affine[1] = affine[2] = affine[4] = affine[5] = 0;
-
- if (clip != null)
- {
- affine[0] = this.width / (double) s_width;
- affine[3] = this.height / (double) s_height;
- }
- else
- {
- affine[0] = this.width / (double) width;
- affine[3] = this.height / (double) height;
- }
-
- if (flipX)
- {
- affine[0] = -affine[0];
- affine[4] = this.width;
- }
-
- if (flipY)
- {
- affine[3] = -affine[3];
- affine[5] = this.height;
- }
-
- if (affine[0] == 1 && affine[3] == 1)
- affine = null;
- }
-
- public void
- setProperties (Hashtable props)
- {
- }
-
- public void
- setColorModel (ColorModel model)
- {
- }
-
- public void
- setHints (int flags)
- {
- }
-
- public void
- imageComplete (int status)
- {
- image.imageComplete(status);
-
- if (observer != null)
- {
- if (status == ImageConsumer.IMAGEERROR)
- observer.imageUpdate (null,
- ImageObserver.ERROR,
- -1, -1, -1, -1);
- else
- observer.imageUpdate (null,
- ImageObserver.ALLBITS,
- -1, -1, -1, -1);
- }
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
deleted file mode 100644
index fdd5fd15f63..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* GtkLabelPeer.java -- Implements LabelPeer with GTK
- Copyright (C) 1998, 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Label;
-import java.awt.peer.LabelPeer;
-
-public class GtkLabelPeer extends GtkComponentPeer
- implements LabelPeer
-{
- native void create (String text, float alignment);
- native void gtkWidgetModifyFont (String name, int style, int size);
- native void nativeSetAlignment (float alignment);
-
- public native void setText(String text);
- native void setNativeBounds (int x, int y, int width, int height);
-
- void create ()
- {
- Label label = (Label) awtComponent;
- create (label.getText (), getGtkAlignment (label.getAlignment ()));
- }
-
- public GtkLabelPeer (Label l)
- {
- super (l);
- }
-
- public void setAlignment (int alignment)
- {
- nativeSetAlignment (getGtkAlignment (alignment));
- }
-
- float getGtkAlignment (int alignment)
- {
- switch (alignment)
- {
- case Label.LEFT:
- return 0.0f;
- case Label.CENTER:
- return 0.5f;
- case Label.RIGHT:
- return 1.0f;
- }
-
- return 0.0f;
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
deleted file mode 100644
index ff12fe34bba..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/* GtkListPeer.java -- Implements ListPeer with GTK
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.AWTEvent;
-import java.awt.Dimension;
-import java.awt.List;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.peer.ListPeer;
-
-public class GtkListPeer extends GtkComponentPeer
- implements ListPeer
-{
- void create ()
- {
- List list = (List) awtComponent;
-
- create (list.getRows ());
-
- setMultipleMode (list.isMultipleMode ());
- }
-
- native void create (int rows);
- native void connectSignals ();
- native void gtkWidgetModifyFont (String name, int style, int size);
- native void gtkWidgetRequestFocus ();
-
- native void getSize (int rows, int visibleRows, int dims[]);
-
- public GtkListPeer (List list)
- {
- super (list);
-
- setMultipleMode (list.isMultipleMode ());
-
- if (list.getItemCount () > 0)
- append (list.getItems ());
- }
-
- native void append (String items[]);
-
- public native void add (String item, int index);
-
- public void addItem (String item, int index)
- {
- add (item, index);
- }
-
- public void clear ()
- {
- removeAll ();
- }
-
- public native void delItems (int start, int end);
- public native void deselect (int index);
-
- public Dimension getMinimumSize (int rows)
- {
- return minimumSize (rows);
- }
-
- public Dimension getPreferredSize (int rows)
- {
- return preferredSize (rows);
- }
-
- public native int[] getSelectedIndexes ();
- public native void makeVisible (int index);
-
- public Dimension minimumSize (int rows)
- {
- int dims[] = new int[2];
-
- int visibleRows = ((List) awtComponent).getRows();
- getSize (rows, visibleRows, dims);
- return new Dimension (dims[0], dims[1]);
- }
-
- public Dimension preferredSize (int rows)
- {
- int dims[] = new int[2];
-
- int visibleRows = ((List) awtComponent).getRows();
- getSize (rows, visibleRows, dims);
- return new Dimension (dims[0], dims[1]);
- }
-
- public void removeAll ()
- {
- delItems (0, -1);
- }
-
- public native void select (int index);
- public native void setMultipleMode (boolean b);
-
- public void setMultipleSelections (boolean b)
- {
- setMultipleMode (b);
- }
-
- public void handleEvent (AWTEvent e)
- {
- if (e.getID () == MouseEvent.MOUSE_CLICKED && isEnabled ())
- {
- // Only generate the ActionEvent on the second click of a
- // multiple click.
- MouseEvent me = (MouseEvent) e;
- if (!me.isConsumed ()
- && (me.getModifiersEx () & MouseEvent.BUTTON1_DOWN_MASK) != 0
- && me.getClickCount() == 2)
- {
- String selectedItem = ((List) awtComponent).getSelectedItem ();
-
- // Double-click only generates an Action event if
- // something is selected.
- if (selectedItem != null)
- postActionEvent (((List) awtComponent).getSelectedItem (),
- me.getModifiersEx ());
- }
- }
-
- if (e.getID () == KeyEvent.KEY_PRESSED)
- {
- KeyEvent ke = (KeyEvent) e;
- if (!ke.isConsumed () && ke.getKeyCode () == KeyEvent.VK_ENTER)
- {
- String selectedItem = ((List) awtComponent).getSelectedItem ();
-
- // Enter only generates an Action event if something is
- // selected.
- if (selectedItem != null)
- postActionEvent (selectedItem, ke.getModifiersEx ());
- }
- }
-
- super.handleEvent (e);
- }
-
- protected void postItemEvent (int item, int stateChange)
- {
- postItemEvent (new Integer (item), stateChange);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
deleted file mode 100644
index 79eeaf9ba6a..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* GtkMenuBarPeer.java -- Implements MenuBarPeer with GTK+
- Copyright (C) 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Font;
-import java.awt.Menu;
-import java.awt.MenuBar;
-import java.awt.MenuComponent;
-import java.awt.peer.MenuBarPeer;
-import java.awt.peer.MenuPeer;
-
-public class GtkMenuBarPeer extends GtkMenuComponentPeer
- implements MenuBarPeer
-{
-
- native void create ();
- native void addMenu (MenuPeer menu);
-
- public GtkMenuBarPeer (MenuBar target)
- {
- super (target);
- }
-
- void setFont ()
- {
- MenuComponent mc = (MenuComponent) awtWidget;
- Font f = mc.getFont ();
-
- if (f == null)
- mc.setFont (new Font ("Dialog", Font.PLAIN, 12));
- }
-
- // FIXME: remove this method or replace it with one that does
- // something useful.
- /* In Gnome, help menus are no longer right flushed. */
- native void nativeSetHelpMenu(MenuPeer menuPeer);
-
- public void addHelpMenu (Menu menu)
- {
- // nativeSetHelpMenu((MenuPeer) menu.getPeer());
- }
-
- public native void delMenu(int index);
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
deleted file mode 100644
index 8d9d1ca04a0..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* GtkMenuComponentPeer.java -- Implements MenuComponentPeer with GTK+
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.peer.MenuComponentPeer;
-
-public class GtkMenuComponentPeer extends GtkGenericPeer
- implements MenuComponentPeer
-{
- void create ()
- {
- throw new RuntimeException ();
- }
-
- void setFont ()
- {
- }
-
- public GtkMenuComponentPeer (Object awtWidget)
- {
- super (awtWidget);
- create ();
- setFont ();
- }
-
- public native void dispose();
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
deleted file mode 100644
index 5728f262b13..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/* GtkMenuItemPeer.java -- Implements MenuItemPeer with GTK+
- Copyright (C) 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Font;
-import java.awt.Menu;
-import java.awt.MenuBar;
-import java.awt.MenuComponent;
-import java.awt.MenuItem;
-import java.awt.peer.MenuItemPeer;
-import java.awt.peer.MenuPeer;
-
-public class GtkMenuItemPeer extends GtkMenuComponentPeer
- implements MenuItemPeer
-{
- native void create (String label);
- native void connectSignals ();
- native void gtkWidgetModifyFont (String name, int style, int size);
-
- void create ()
- {
- create (((MenuItem) awtWidget).getLabel());
- }
-
- public GtkMenuItemPeer (MenuItem item)
- {
- super (item);
- setEnabled (item.isEnabled ());
- setParent (item);
-
- if (item.getParent() instanceof Menu && ! (item instanceof Menu))
- connectSignals();
- }
-
- void setFont ()
- {
- MenuComponent mc = ((MenuComponent) awtWidget);
- Font f = mc.getFont ();
-
- if (f == null)
- {
- MenuComponent parent = (MenuComponent) mc.getParent ();
- Font pf = parent.getFont ();
- gtkWidgetModifyFont (pf.getName (), pf.getStyle (), pf.getSize ());
- }
- else
- gtkWidgetModifyFont(f.getName(), f.getStyle(), f.getSize());
- }
-
- void setParent (MenuItem item)
- {
- // add ourself differently, based on what type of parent we have
- // yes, the typecasting here is nasty.
- Object parent = item.getParent ();
- if (parent instanceof MenuBar)
- {
- ((GtkMenuBarPeer)((MenuBar)parent).getPeer ()).addMenu ((MenuPeer) this);
- }
- else // parent instanceof Menu
- {
- ((GtkMenuPeer)((Menu)parent).getPeer ()).addItem (this,
- item.getShortcut ());
- }
- }
-
- public void disable ()
- {
- setEnabled (false);
- }
-
- public void enable ()
- {
- setEnabled (true);
- }
-
- public native void setEnabled(boolean b);
-
- public native void setLabel(String label);
-
- protected void postMenuActionEvent ()
- {
- postActionEvent (((MenuItem)awtWidget).getActionCommand (), 0);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
deleted file mode 100644
index 80332dd6a72..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* GtkMenuPeer.java -- Implements MenuPeer with GTK+
- Copyright (C) 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Component;
-import java.awt.Menu;
-import java.awt.MenuContainer;
-import java.awt.MenuItem;
-import java.awt.MenuShortcut;
-import java.awt.peer.MenuItemPeer;
-import java.awt.peer.MenuPeer;
-
-public class GtkMenuPeer extends GtkMenuItemPeer
- implements MenuPeer
-{
- native void create (String label);
- native void addItem (MenuItemPeer item, int key, boolean shiftModifier);
- native void setupAccelGroup (GtkGenericPeer container);
- native void addTearOff ();
-
- public GtkMenuPeer (Menu menu)
- {
- super (menu);
-
- if (menu.isTearOff())
- addTearOff();
-
- MenuContainer parent = menu.getParent ();
- if (parent instanceof Menu)
- setupAccelGroup ((GtkGenericPeer)((Menu)parent).getPeer ());
- else if (parent instanceof Component)
- setupAccelGroup ((GtkGenericPeer)((Component)parent).getPeer ());
- else
- setupAccelGroup (null);
- }
-
- public void addItem (MenuItem item)
- {
- int key = 0;
- boolean shiftModifier = false;
-
- MenuShortcut ms = item.getShortcut ();
- if (ms != null)
- {
- key = ms.getKey ();
- shiftModifier = ms.usesShiftModifier ();
- }
-
- addItem ((MenuItemPeer) item.getPeer (), key, shiftModifier);
- }
-
- public void addItem (MenuItemPeer item, MenuShortcut ms)
- {
- int key = 0;
- boolean shiftModifier = false;
-
- if (ms != null)
- {
- key = ms.getKey ();
- shiftModifier = ms.usesShiftModifier ();
- }
-
- addItem (item, key, shiftModifier);
- }
-
- public native void delItem(int index);
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java b/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java
deleted file mode 100644
index 48cea2d7231..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/* GtkOffScreenImage.java
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Graphics;
-import java.awt.Image;
-import java.awt.image.ImageObserver;
-import java.awt.image.ImageProducer;
-
-public class GtkOffScreenImage extends Image
-{
- int width, height;
- ImageProducer source;
- Graphics g;
-
- public GtkOffScreenImage (ImageProducer source, Graphics g,
- int width, int height)
- {
- this.width = width;
- this.height = height;
-
- this.source = source;
- this.g = g;
- }
-
- public int getWidth (ImageObserver observer)
- {
- return width;
- }
-
- public int getHeight (ImageObserver observer)
- {
- return height;
- }
-
- public ImageProducer getSource ()
- {
- return source;
- }
-
- public Graphics getGraphics ()
- {
- if (g instanceof GdkGraphics2D)
- return new GdkGraphics2D ((GdkGraphics2D) this.g);
- else
- return new GdkGraphics ((GdkGraphics) this.g);
- }
-
- public Object getProperty (String name, ImageObserver observer)
- {
- return Image.UndefinedProperty;
- }
-
- public void flush ()
- {
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
deleted file mode 100644
index fbddb302a76..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* GtkPanelPeer.java -- Implements PanelPeer with GTK
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.AWTEvent;
-import java.awt.Panel;
-import java.awt.event.MouseEvent;
-import java.awt.peer.PanelPeer;
-
-public class GtkPanelPeer extends GtkContainerPeer
- implements PanelPeer
-{
- native void create ();
-
- public GtkPanelPeer (Panel p)
- {
- super (p);
- }
-
- public void handleEvent (AWTEvent event)
- {
- int id = event.getID();
-
- switch (id)
- {
- case MouseEvent.MOUSE_PRESSED:
- awtComponent.requestFocusInWindow ();
- break;
- }
- super.handleEvent (event);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
deleted file mode 100644
index d14c16dd79d..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* GtkPopupMenuPeer.java -- Implements PopupMenuPeer with GTK+
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Component;
-import java.awt.Event;
-import java.awt.MenuItem;
-import java.awt.Point;
-import java.awt.PopupMenu;
-import java.awt.peer.PopupMenuPeer;
-
-public class GtkPopupMenuPeer extends GtkMenuPeer
- implements PopupMenuPeer
-{
- public GtkPopupMenuPeer (PopupMenu menu)
- {
- super (menu);
- }
-
- native void setupAccelGroup (GtkGenericPeer container);
-
- void setParent (MenuItem item)
- {
- // we don't need to "add" ourselves to our parent
- }
-
- native void show (int x, int y, long time);
- public void show (Component origin, int x, int y)
- {
- Point abs = origin.getLocationOnScreen ();
- show (abs.x + x, abs.y + y, 0);
- }
-
- public void show (Event e)
- {
-
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
deleted file mode 100644
index 69f8b494625..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* GtkScrollPanePeer.java -- Implements ScrollPanePeer with GTK
- Copyright (C) 1998, 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Adjustable;
-import java.awt.Dimension;
-import java.awt.ScrollPane;
-import java.awt.peer.ScrollPanePeer;
-
-public class GtkScrollPanePeer extends GtkContainerPeer
- implements ScrollPanePeer
-{
- native void create (int width, int height);
-
- void create ()
- {
- create (awtComponent.getWidth (), awtComponent.getHeight ());
- }
-
- // native void gtkScrolledWindowSetScrollPosition(int x, int y);
- native void gtkScrolledWindowSetHScrollIncrement (int u);
- native void gtkScrolledWindowSetVScrollIncrement (int u);
-
- public GtkScrollPanePeer (ScrollPane sp)
- {
- super (sp);
-
- setPolicy (sp.getScrollbarDisplayPolicy ());
- }
-
- native void setPolicy (int policy);
- public void childResized (int width, int height)
- {
- int dim[] = new int[2];
-
- gtkWidgetGetDimensions (dim);
-
- // If the child is in this range, GTK adds both scrollbars, but
- // the AWT doesn't. So set the peer's scroll policy to
- // GTK_POLICY_NEVER.
- if ((width > dim[0] - getVScrollbarWidth ()
- && width <= dim[0])
- && (height > dim[1] - getHScrollbarHeight ()
- && height <= dim[1]))
- setPolicy (ScrollPane.SCROLLBARS_NEVER);
- else
- setPolicy (((ScrollPane) awtComponent).getScrollbarDisplayPolicy ());
- }
-
- public native int getHScrollbarHeight();
- public native int getVScrollbarWidth();
- public native void setScrollPosition(int x, int y);
-
- public Dimension getPreferredSize ()
- {
- return awtComponent.getSize();
- }
-
- public void setUnitIncrement (Adjustable adj, int u)
- {
- if (adj.getOrientation()==Adjustable.HORIZONTAL)
- gtkScrolledWindowSetHScrollIncrement (u);
- else
- gtkScrolledWindowSetVScrollIncrement (u);
- }
-
- public void setValue (Adjustable adj, int v)
- {
-// System.out.println("SPP: setVal: "+adj+":"+v);
-// Point p=myScrollPane.getScrollPosition ();
-// if (adj.getOrientation()==Adjustable.HORIZONTAL)
-// gtkScrolledWindowSetScrollPosition (v,p.y);
-// else
-// gtkScrolledWindowSetScrollPosition (p.x,v);
-// adj.setValue(v);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
deleted file mode 100644
index aa3a26e34ad..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* GtkScrollbarPeer.java -- Implements ScrollbarPeer with GTK+
- Copyright (C) 1998, 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Adjustable;
-import java.awt.Scrollbar;
-import java.awt.event.AdjustmentEvent;
-import java.awt.peer.ScrollbarPeer;
-
-public class GtkScrollbarPeer extends GtkComponentPeer
- implements ScrollbarPeer
-{
- void create ()
- {
- Scrollbar sb = (Scrollbar) awtComponent;
-
- create (sb.getOrientation (), sb.getValue (),
- sb.getMinimum (), sb.getMaximum (),
- sb.getUnitIncrement (), sb.getBlockIncrement (),
- sb.getVisibleAmount ());
- }
-
- native void create (int orientation, int value,
- int min, int max, int stepIncr, int pageIncr,
- int visibleAmount);
-
- native void connectSignals ();
-
- public GtkScrollbarPeer (Scrollbar s)
- {
- super (s);
- }
-
- public native void setLineIncrement(int amount);
- public native void setPageIncrement(int amount);
- public native void setValues(int value, int visible, int min, int max);
-
- protected void postAdjustmentEvent (int type, int value)
- {
- q().postEvent (new AdjustmentEvent ((Adjustable)awtComponent,
- AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- type, value));
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
deleted file mode 100644
index fb0e2ced508..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/* GtkTextAreaPeer.java -- Implements TextAreaPeer with GTK
- Copyright (C) 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.TextArea;
-import java.awt.peer.TextAreaPeer;
-
-public class GtkTextAreaPeer extends GtkTextComponentPeer
- implements TextAreaPeer
-{
- private static transient int DEFAULT_ROWS = 10;
- private static transient int DEFAULT_COLS = 80;
-
- native void create (int width, int height, int scrollbarVisibility);
-
- native void gtkWidgetModifyFont (String name, int style, int size);
- native void gtkWidgetRequestFocus ();
-
- void create ()
- {
- Font f = awtComponent.getFont ();
-
- // By default, Sun sets a TextArea's font when its peer is
- // created. If f != null then the peer's font is set by
- // GtkComponent.create.
- if (f == null)
- {
- f = new Font ("Dialog", Font.PLAIN, 12);
- awtComponent.setFont (f);
- }
-
- FontMetrics fm = getFontMetrics (f);
-
- TextArea ta = ((TextArea) awtComponent);
- int sizeRows = ta.getRows ();
- int sizeCols = ta.getColumns ();
-
- sizeRows = sizeRows == 0 ? DEFAULT_ROWS : sizeRows;
- sizeCols = sizeCols == 0 ? DEFAULT_COLS : sizeCols;
-
- int width = sizeCols * fm.getMaxAdvance ();
- int height = sizeRows * (fm.getMaxDescent () + fm.getMaxAscent ());
-
- create (width, height, ta.getScrollbarVisibility ());
- setEditable (ta.isEditable ());
- }
-
- public GtkTextAreaPeer (TextArea ta)
- {
- super (ta);
- }
-
- public native void insert (String str, int pos);
- public native void replaceRange (String str, int start, int end);
-
- public Dimension getMinimumSize (int rows, int cols)
- {
- return minimumSize (rows == 0 ? DEFAULT_ROWS : rows,
- cols == 0 ? DEFAULT_COLS : cols);
- }
-
- public Dimension getPreferredSize (int rows, int cols)
- {
- return preferredSize (rows == 0 ? DEFAULT_ROWS : rows,
- cols == 0 ? DEFAULT_COLS : cols);
- }
-
- native int getHScrollbarHeight ();
- native int getVScrollbarWidth ();
-
- // Deprecated
- public Dimension minimumSize (int rows, int cols)
- {
- TextArea ta = ((TextArea) awtComponent);
- int height = 0;
- int width = 0;
-
- if (ta.getScrollbarVisibility () == TextArea.SCROLLBARS_BOTH
- || ta.getScrollbarVisibility () == TextArea.SCROLLBARS_HORIZONTAL_ONLY)
- height = getHScrollbarHeight ();
-
- if (ta.getScrollbarVisibility () == TextArea.SCROLLBARS_BOTH
- || ta.getScrollbarVisibility () == TextArea.SCROLLBARS_VERTICAL_ONLY)
- width = getVScrollbarWidth ();
-
- Font f = awtComponent.getFont ();
- if (f == null)
- return new Dimension (width, height);
-
- FontMetrics fm = getFontMetrics (f);
-
- int sizeRows = rows == 0 ? DEFAULT_ROWS : rows;
- int sizeCols = cols == 0 ? DEFAULT_COLS : cols;
-
- width += sizeCols * fm.getMaxAdvance ();
- height += sizeRows * (fm.getMaxDescent () + fm.getMaxAscent ());
-
- return new Dimension (width, height);
- }
-
- public Dimension preferredSize (int rows, int cols)
- {
- TextArea ta = ((TextArea) awtComponent);
- int height = 0;
- int width = 0;
-
- if (ta.getScrollbarVisibility () == TextArea.SCROLLBARS_BOTH
- || ta.getScrollbarVisibility () == TextArea.SCROLLBARS_HORIZONTAL_ONLY)
- height = getHScrollbarHeight ();
-
- if (ta.getScrollbarVisibility () == TextArea.SCROLLBARS_BOTH
- || ta.getScrollbarVisibility () == TextArea.SCROLLBARS_VERTICAL_ONLY)
- width = getVScrollbarWidth ();
-
- Font f = awtComponent.getFont ();
- if (f == null)
- return new Dimension (width, height);
-
- FontMetrics fm = getFontMetrics (f);
-
- int sizeRows = rows == 0 ? DEFAULT_ROWS : rows;
- int sizeCols = cols == 0 ? DEFAULT_COLS : cols;
-
- width += sizeCols * fm.getMaxAdvance ();
- height += sizeRows * (fm.getMaxDescent () + fm.getMaxAscent ());
-
- return new Dimension (width, height);
- }
-
- public void replaceText (String str, int start, int end)
- {
- replaceRange (str, start, end);
- }
-
- public void insertText (String str, int pos)
- {
- insert (str, pos);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
deleted file mode 100644
index c1f1cf0e1ae..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* GtkTextComponentPeer.java -- Implements TextComponentPeer with GTK
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Rectangle;
-import java.awt.TextComponent;
-import java.awt.event.TextEvent;
-import java.awt.peer.TextComponentPeer;
-
-public class GtkTextComponentPeer extends GtkComponentPeer
- implements TextComponentPeer
-{
- GtkTextComponentPeer (TextComponent tc)
- {
- super (tc);
-
- setText (tc.getText ());
- setCaretPosition(0);
- }
-
- public native void connectSignals ();
-
- public native int getCaretPosition ();
- public native void setCaretPosition (int pos);
- public native int getSelectionStart ();
- public native int getSelectionEnd ();
- public native String getText ();
- public native void select (int start, int end);
- public native void setEditable (boolean state);
- public native void setText (String text);
-
- public int getIndexAtPoint(int x, int y)
- {
- return 0; // FIXME
- }
-
- public Rectangle getCharacterBounds (int pos)
- {
- return null;
- }
-
- public long filterEvents (long filter)
- {
- return filter; // FIXME
- }
-
- protected void postTextEvent ()
- {
- q().postEvent (new TextEvent (awtComponent, TextEvent.TEXT_VALUE_CHANGED));
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
deleted file mode 100644
index 1031f7cc9e6..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/* GtkTextFieldPeer.java -- Implements TextFieldPeer with GTK
- Copyright (C) 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.AWTEvent;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.TextField;
-import java.awt.event.KeyEvent;
-import java.awt.peer.TextFieldPeer;
-
-public class GtkTextFieldPeer extends GtkTextComponentPeer
- implements TextFieldPeer
-{
- native void create (int width);
- native void gtkWidgetSetBackground (int red, int green, int blue);
- native void gtkWidgetSetForeground (int red, int green, int blue);
-
- void create ()
- {
- Font f = awtComponent.getFont ();
-
- // By default, Sun sets a TextField's font when its peer is
- // created. If f != null then the peer's font is set by
- // GtkComponent.create.
- if (f == null)
- {
- f = new Font ("Dialog", Font.PLAIN, 12);
- awtComponent.setFont (f);
- }
-
- FontMetrics fm = getFontMetrics (f);
-
- TextField tf = ((TextField) awtComponent);
- int cols = tf.getColumns ();
-
- int text_width = cols * fm.getMaxAdvance ();
-
- create (text_width);
-
- setEditable (tf.isEditable ());
- }
-
- native int gtkEntryGetBorderWidth ();
-
- native void gtkWidgetModifyFont (String name, int style, int size);
-
- public GtkTextFieldPeer (TextField tf)
- {
- super (tf);
-
- if (tf.echoCharIsSet ())
- setEchoChar (tf.getEchoChar ());
- }
-
- public Dimension getMinimumSize (int cols)
- {
- return minimumSize (cols);
- }
-
- public Dimension getPreferredSize (int cols)
- {
- return preferredSize (cols);
- }
-
- public native void setEchoChar (char c);
-
- // Deprecated
- public Dimension minimumSize (int cols)
- {
- int dim[] = new int[2];
-
- gtkWidgetGetPreferredDimensions (dim);
-
- Font f = awtComponent.getFont ();
- if (f == null)
- return new Dimension (2 * gtkEntryGetBorderWidth (), dim[1]);
-
- FontMetrics fm = getFontMetrics (f);
-
- int text_width = cols * fm.getMaxAdvance ();
-
- int width = text_width + 2 * gtkEntryGetBorderWidth ();
-
- return new Dimension (width, dim[1]);
- }
-
- public Dimension preferredSize (int cols)
- {
- int dim[] = new int[2];
-
- gtkWidgetGetPreferredDimensions (dim);
-
- Font f = awtComponent.getFont ();
- if (f == null)
- return new Dimension (2 * gtkEntryGetBorderWidth (), dim[1]);
-
- FontMetrics fm = getFontMetrics (f);
-
- int text_width = cols * fm.getMaxAdvance ();
-
- int width = text_width + 2 * gtkEntryGetBorderWidth ();
-
- return new Dimension (width, dim[1]);
- }
-
- public void setEchoCharacter (char c)
- {
- setEchoChar (c);
- }
-
- public void handleEvent (AWTEvent e)
- {
- if (e.getID () == KeyEvent.KEY_PRESSED)
- {
- KeyEvent ke = (KeyEvent) e;
-
- if (!ke.isConsumed ()
- && ke.getKeyCode () == KeyEvent.VK_ENTER)
- postActionEvent (getText (), ke.getModifiersEx ());
- }
-
- super.handleEvent (e);
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
deleted file mode 100644
index 10afde77c74..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
+++ /dev/null
@@ -1,670 +0,0 @@
-/* GtkToolkit.java -- Implements an AWT Toolkit using GTK for peers
- Copyright (C) 1998, 1999, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 gnu.classpath.Configuration;
-import gnu.java.awt.EmbeddedWindow;
-import gnu.java.awt.EmbeddedWindowSupport;
-import gnu.java.awt.peer.ClasspathFontPeer;
-import gnu.java.awt.peer.ClasspathTextLayoutPeer;
-import gnu.java.awt.peer.EmbeddedWindowPeer;
-
-import java.awt.*;
-import java.awt.datatransfer.Clipboard;
-import java.awt.dnd.DragGestureEvent;
-import java.awt.dnd.peer.DragSourceContextPeer;
-import java.awt.font.FontRenderContext;
-import java.awt.im.InputMethodHighlight;
-import java.awt.image.BufferedImage;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageConsumer;
-import java.awt.image.ImageObserver;
-import java.awt.image.ImageProducer;
-import java.awt.peer.*;
-import java.io.InputStream;
-import java.net.URL;
-import java.text.AttributedString;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.imageio.spi.IIORegistry;
-
-/* This class uses a deprecated method java.awt.peer.ComponentPeer.getPeer().
- This merits comment. We are basically calling Sun's bluff on this one.
- We think Sun has deprecated it simply to discourage its use as it is
- bad programming style. However, we need to get at a component's peer in
- this class. If getPeer() ever goes away, we can implement a hash table
- that will keep up with every window's peer, but for now this is faster. */
-
-/**
- * This class accesses a system property called
- * <tt>gnu.java.awt.peer.gtk.Graphics</tt>. If the property is defined and
- * equal to "Graphics2D", the cairo-based GdkGraphics2D will be used in
- * drawing contexts. Any other value will cause the older GdkGraphics
- * object to be used.
- */
-public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
- implements EmbeddedWindowSupport
-{
- Hashtable containers = new Hashtable();
- static EventQueue q;
- static Clipboard systemClipboard;
- static boolean useGraphics2dSet;
- static boolean useGraphics2d;
-
- public static boolean useGraphics2D()
- {
- if (useGraphics2dSet)
- return useGraphics2d;
- useGraphics2d = System.getProperty("gnu.java.awt.peer.gtk.Graphics",
- "Graphics").equals("Graphics2D");
- useGraphics2dSet = true;
- return useGraphics2d;
- }
-
- static native void gtkInit(int portableNativeSync);
-
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- System.loadLibrary("gtkpeer");
-
- int portableNativeSync;
- String portNatSyncProp =
- System.getProperty("gnu.classpath.awt.gtk.portable.native.sync");
-
- if (portNatSyncProp == null)
- portableNativeSync = -1; // unset
- else if (Boolean.valueOf(portNatSyncProp).booleanValue())
- portableNativeSync = 1; // true
- else
- portableNativeSync = 0; // false
-
- gtkInit(portableNativeSync);
- }
-
- public GtkToolkit ()
- {
- systemClipboard = new GtkClipboard ();
- }
-
- public native void beep();
- private native void getScreenSizeDimensions(int[] xy);
-
- public int checkImage (Image image, int width, int height,
- ImageObserver observer)
- {
- int status = ImageObserver.ALLBITS
- | ImageObserver.WIDTH
- | ImageObserver.HEIGHT;
-
- if (image instanceof GtkImage)
- {
- status = ((GtkImage) image).checkImage ();
- }
-
- if (observer != null)
- observer.imageUpdate (image, status,
- -1, -1,
- image.getWidth (observer),
- image.getHeight (observer));
-
- return status;
- }
-
- /**
- * A helper class to return to clients in cases where a BufferedImage is
- * desired but its construction fails.
- */
- private class GtkErrorImage extends Image
- {
- public GtkErrorImage()
- {
- }
-
- public int getWidth(ImageObserver observer)
- {
- return -1;
- }
-
- public int getHeight(ImageObserver observer)
- {
- return -1;
- }
-
- public ImageProducer getSource()
- {
-
- return new ImageProducer()
- {
- HashSet consumers = new HashSet();
- public void addConsumer(ImageConsumer ic)
- {
- consumers.add(ic);
- }
-
- public boolean isConsumer(ImageConsumer ic)
- {
- return consumers.contains(ic);
- }
-
- public void removeConsumer(ImageConsumer ic)
- {
- consumers.remove(ic);
- }
-
- public void startProduction(ImageConsumer ic)
- {
- consumers.add(ic);
- Iterator i = consumers.iterator();
- while(i.hasNext())
- {
- ImageConsumer c = (ImageConsumer) i.next();
- c.imageComplete(ImageConsumer.IMAGEERROR);
- }
- }
- public void requestTopDownLeftRightResend(ImageConsumer ic)
- {
- startProduction(ic);
- }
- };
- }
-
- public Graphics getGraphics()
- {
- return null;
- }
-
- public Object getProperty(String name, ImageObserver observer)
- {
- return null;
- }
- public Image getScaledInstance(int width, int height, int flags)
- {
- return new GtkErrorImage();
- }
-
- public void flush()
- {
- }
- }
-
-
- /**
- * Helper to return either a BufferedImage -- the argument -- or a
- * GtkErrorImage if the argument is null.
- */
-
- private Image bufferedImageOrError(BufferedImage b)
- {
- if (b == null)
- return new GtkErrorImage();
- else
- return b;
- }
-
-
- public Image createImage (String filename)
- {
- if (useGraphics2D())
- return bufferedImageOrError(GdkPixbufDecoder.createBufferedImage (filename));
- else
- {
- GdkPixbufDecoder d = new GdkPixbufDecoder (filename);
- GtkImage image = new GtkImage (d, null);
- d.startProduction (image);
- return image;
- }
- }
-
- public Image createImage (URL url)
- {
- if (useGraphics2D())
- return bufferedImageOrError(GdkPixbufDecoder.createBufferedImage (url));
- else
- {
- GdkPixbufDecoder d = new GdkPixbufDecoder (url);
- GtkImage image = new GtkImage (d, null);
- d.startProduction (image);
- return image;
- }
- }
-
- public Image createImage (ImageProducer producer)
- {
- if (useGraphics2D())
- return bufferedImageOrError(GdkPixbufDecoder.createBufferedImage (producer));
- else
- {
- GtkImage image = new GtkImage (producer, null);
- producer.startProduction (image);
- return image;
- }
- }
-
- public Image createImage (byte[] imagedata, int imageoffset,
- int imagelength)
- {
- if (useGraphics2D())
- return bufferedImageOrError(GdkPixbufDecoder.createBufferedImage (imagedata,
- imageoffset,
- imagelength));
- else
- {
- GdkPixbufDecoder d = new GdkPixbufDecoder (imagedata,
- imageoffset,
- imagelength);
- GtkImage image = new GtkImage (d, null);
- d.startProduction (image);
- return image;
- }
- }
-
- /**
- * Creates an ImageProducer from the specified URL. The image is assumed
- * to be in a recognised format.
- *
- * @param url URL to read image data from.
- */
- public ImageProducer createImageProducer(URL url)
- {
- return new GdkPixbufDecoder(url);
- }
-
- public ColorModel getColorModel ()
- {
- return ColorModel.getRGBdefault ();
- }
-
- public String[] getFontList ()
- {
- return (new String[] { "Dialog",
- "DialogInput",
- "Monospaced",
- "Serif",
- "SansSerif" });
- }
-
- private class LRUCache extends LinkedHashMap
- {
- int max_entries;
- public LRUCache(int max)
- {
- super(max, 0.75f, true);
- max_entries = max;
- }
- protected boolean removeEldestEntry(Map.Entry eldest)
- {
- return size() > max_entries;
- }
- }
-
- private LRUCache fontCache = new LRUCache(50);
- private LRUCache metricsCache = new LRUCache(50);
- private LRUCache imageCache = new LRUCache(50);
-
- public FontMetrics getFontMetrics (Font font)
- {
- synchronized (metricsCache)
- {
- if (metricsCache.containsKey(font))
- return (FontMetrics) metricsCache.get(font);
- }
-
- FontMetrics m = new GdkFontMetrics (font);
- synchronized (metricsCache)
- {
- metricsCache.put(font, m);
- }
- return m;
- }
-
- public Image getImage (String filename)
- {
- if (imageCache.containsKey(filename))
- return (Image) imageCache.get(filename);
- else
- {
- Image im = createImage(filename);
- imageCache.put(filename, im);
- return im;
- }
- }
-
- public Image getImage (URL url)
- {
- if (imageCache.containsKey(url))
- return (Image) imageCache.get(url);
- else
- {
- Image im = createImage(url);
- imageCache.put(url, im);
- return im;
- }
- }
-
- public PrintJob getPrintJob (Frame frame, String jobtitle, Properties props)
- {
- return null;
- }
-
- public native int getScreenResolution();
-
- public Dimension getScreenSize ()
- {
- int dim[] = new int[2];
- getScreenSizeDimensions(dim);
- return new Dimension(dim[0], dim[1]);
- }
-
- public Clipboard getSystemClipboard()
- {
- return systemClipboard;
- }
-
- public boolean prepareImage (Image image, int width, int height,
- ImageObserver observer)
- {
- GtkImage i = (GtkImage) image;
-
- if (i.isLoaded ()) return true;
-
- class PrepareImage extends Thread
- {
- GtkImage image;
- ImageObserver observer;
-
- PrepareImage (GtkImage image, ImageObserver observer)
- {
- this.image = image;
- image.setObserver (observer);
- }
-
- public void run ()
- {
- image.source.startProduction (image);
- }
- }
-
- new PrepareImage (i, observer).start ();
- return false;
- }
-
- public native void sync();
-
- protected void setComponentState (Component c, GtkComponentPeer cp)
- {
- /* Make the Component reflect Peer defaults */
- if (c.getForeground () == null)
- c.setForeground (cp.getForeground ());
- if (c.getBackground () == null)
- c.setBackground (cp.getBackground ());
- // if (c.getFont () == null)
- // c.setFont (cp.getFont ());
-
- /* Make the Peer reflect the state of the Component */
- if (! (c instanceof Window))
- {
- cp.setCursor (c.getCursor ());
-
- Rectangle bounds = c.getBounds ();
- cp.setBounds (bounds.x, bounds.y, bounds.width, bounds.height);
- cp.setVisible (c.isVisible ());
- }
- }
-
- protected ButtonPeer createButton (Button b)
- {
- return new GtkButtonPeer (b);
- }
-
- protected CanvasPeer createCanvas (Canvas c)
- {
- return new GtkCanvasPeer (c);
- }
-
- protected CheckboxPeer createCheckbox (Checkbox cb)
- {
- return new GtkCheckboxPeer (cb);
- }
-
- protected CheckboxMenuItemPeer createCheckboxMenuItem (CheckboxMenuItem cmi)
- {
- return new GtkCheckboxMenuItemPeer (cmi);
- }
-
- protected ChoicePeer createChoice (Choice c)
- {
- return new GtkChoicePeer (c);
- }
-
- protected DialogPeer createDialog (Dialog d)
- {
- return new GtkDialogPeer (d);
- }
-
- protected FileDialogPeer createFileDialog (FileDialog fd)
- {
- return new GtkFileDialogPeer (fd);
- }
-
- protected FramePeer createFrame (Frame f)
- {
- return new GtkFramePeer (f);
- }
-
- protected LabelPeer createLabel (Label label)
- {
- return new GtkLabelPeer (label);
- }
-
- protected ListPeer createList (List list)
- {
- return new GtkListPeer (list);
- }
-
- protected MenuPeer createMenu (Menu m)
- {
- return new GtkMenuPeer (m);
- }
-
- protected MenuBarPeer createMenuBar (MenuBar mb)
- {
- return new GtkMenuBarPeer (mb);
- }
-
- protected MenuItemPeer createMenuItem (MenuItem mi)
- {
- return new GtkMenuItemPeer (mi);
- }
-
- protected PanelPeer createPanel (Panel p)
- {
- return new GtkPanelPeer (p);
- }
-
- protected PopupMenuPeer createPopupMenu (PopupMenu target)
- {
- return new GtkPopupMenuPeer (target);
- }
-
- protected ScrollPanePeer createScrollPane (ScrollPane sp)
- {
- return new GtkScrollPanePeer (sp);
- }
-
- protected ScrollbarPeer createScrollbar (Scrollbar sb)
- {
- return new GtkScrollbarPeer (sb);
- }
-
- protected TextAreaPeer createTextArea (TextArea ta)
- {
- return new GtkTextAreaPeer (ta);
- }
-
- protected TextFieldPeer createTextField (TextField tf)
- {
- return new GtkTextFieldPeer (tf);
- }
-
- protected WindowPeer createWindow (Window w)
- {
- return new GtkWindowPeer (w);
- }
-
- public EmbeddedWindowPeer createEmbeddedWindow (EmbeddedWindow w)
- {
- return new GtkEmbeddedWindowPeer (w);
- }
-
- /**
- * @deprecated part of the older "logical font" system in earlier AWT
- * implementations. Our newer Font class uses getClasspathFontPeer.
- */
- protected FontPeer getFontPeer (String name, int style) {
- // All fonts get a default size of 12 if size is not specified.
- return getFontPeer(name, style, 12);
- }
-
- /**
- * Private method that allows size to be set at initialization time.
- */
- private FontPeer getFontPeer (String name, int style, int size)
- {
- Map attrs = new HashMap ();
- ClasspathFontPeer.copyStyleToAttrs (style, attrs);
- ClasspathFontPeer.copySizeToAttrs (size, attrs);
- return getClasspathFontPeer (name, attrs);
- }
-
- /**
- * Newer method to produce a peer for a Font object, even though Sun's
- * design claims Font should now be peerless, we do not agree with this
- * model, hence "ClasspathFontPeer".
- */
-
- public ClasspathFontPeer getClasspathFontPeer (String name, Map attrs)
- {
- Map keyMap = new HashMap (attrs);
- // We don't know what kind of "name" the user requested (logical, face,
- // family), and we don't actually *need* to know here. The worst case
- // involves failure to consolidate fonts with the same backend in our
- // cache. This is harmless.
- keyMap.put ("GtkToolkit.RequestedFontName", name);
- if (fontCache.containsKey (keyMap))
- return (ClasspathFontPeer) fontCache.get (keyMap);
- else
- {
- ClasspathFontPeer newPeer = new GdkFontPeer (name, attrs);
- fontCache.put (keyMap, newPeer);
- return newPeer;
- }
- }
-
- public ClasspathTextLayoutPeer getClasspathTextLayoutPeer (AttributedString str,
- FontRenderContext frc)
- {
- return new GdkTextLayout(str, frc);
- }
-
- protected EventQueue getSystemEventQueueImpl()
- {
- synchronized (GtkToolkit.class)
- {
- if (q == null)
- {
- q = new EventQueue();
- GtkGenericPeer.enableQueue (q);
- }
- }
- return q;
- }
-
- protected native void loadSystemColors (int[] systemColors);
-
- public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent e)
- {
- throw new Error("not implemented");
- }
-
- public Map mapInputMethodHighlight(InputMethodHighlight highlight)
- {
- 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(this);
- }
-
- public Font createFont(int format, InputStream stream)
- {
- throw new UnsupportedOperationException();
- }
-
- public RobotPeer createRobot (GraphicsDevice screen) throws AWTException
- {
- return new GdkRobotPeer (screen);
- }
-
- public void registerImageIOSpis(IIORegistry reg)
- {
- GdkPixbufDecoder.registerSpis(reg);
- }
-
- public native boolean nativeQueueEmpty();
- public native void wakeNativeQueue();
- public native void iterateNativeQueue(EventQueue locked, boolean block);
-
-} // class GtkToolkit
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkVolatileImage.java b/libjava/gnu/java/awt/peer/gtk/GtkVolatileImage.java
deleted file mode 100644
index 496090a0940..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkVolatileImage.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/* GtkVolatileImage.java -- a hardware-accelerated image buffer
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.ImageCapabilities;
-import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
-import java.awt.image.BufferedImage;
-import java.awt.image.ImageObserver;
-import java.awt.image.VolatileImage;
-
-public class GtkVolatileImage extends VolatileImage
-{
- private int width;
- private int height;
- private ImageCapabilities caps;
-
- public GtkVolatileImage(int width, int height)
- {
- this(width, height, null);
- }
-
- public GtkVolatileImage(int width, int height, ImageCapabilities caps)
- {
- this.width = width;
- this.height = height;
- this.caps = caps;
- }
-
- // FIXME: should return a buffered image snapshot of the accelerated
- // visual
- public BufferedImage getSnapshot()
- {
- return null;
- }
-
- public int getWidth()
- {
- return width;
- }
-
- public int getHeight()
- {
- return height;
- }
-
- // FIXME: should return a graphics wrapper around this image's
- // visual
- public Graphics2D createGraphics()
- {
- return null;
- }
-
- public int validate(GraphicsConfiguration gc)
- {
- return VolatileImage.IMAGE_OK;
- }
-
- public boolean contentsLost()
- {
- return false;
- }
-
- public ImageCapabilities getCapabilities()
- {
- return caps;
- }
-
- public synchronized Object getProperty (String name, ImageObserver observer)
- {
- return null;
- }
-
- public synchronized int getWidth (ImageObserver observer)
- {
- return width;
- }
-
- public synchronized int getHeight (ImageObserver observer)
- {
- return height;
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
deleted file mode 100644
index bd16f3c7695..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/* GtkWindowPeer.java -- Implements WindowPeer with GTK
- Copyright (C) 1998, 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Component;
-import java.awt.Frame;
-import java.awt.Window;
-import java.awt.event.WindowEvent;
-import java.awt.peer.WindowPeer;
-
-public class GtkWindowPeer extends GtkContainerPeer
- implements WindowPeer
-{
- protected static final int GDK_WINDOW_TYPE_HINT_NORMAL = 0;
- protected static final int GDK_WINDOW_TYPE_HINT_DIALOG = 1;
- protected static final int GDK_WINDOW_TYPE_HINT_MENU = 2;
- protected static final int GDK_WINDOW_TYPE_HINT_TOOLBAR = 3;
- protected static final int GDK_WINDOW_TYPE_HINT_SPLASHSCREEN = 4;
- protected static final int GDK_WINDOW_TYPE_HINT_UTILITY = 5;
- protected static final int GDK_WINDOW_TYPE_HINT_DOCK = 6;
- protected static final int GDK_WINDOW_TYPE_HINT_DESKTOP = 7;
-
- private boolean hasBeenShown = false;
- private int oldState = Frame.NORMAL;
-
- native void gtkWindowSetTitle (String title);
- native void gtkWindowSetResizable (boolean resizable);
- native void gtkWindowSetModal (boolean modal);
-
- int getWidth ()
- {
- return awtComponent.getWidth();
- }
-
- int getHeight ()
- {
- return awtComponent.getHeight();
- }
-
- native void create (int type, boolean decorated, GtkWindowPeer parent);
-
- void create (int type, boolean decorated)
- {
- GtkWindowPeer parent_peer = null;
- Component parent = awtComponent.getParent();
-
- if (parent != null)
- parent_peer = (GtkWindowPeer) awtComponent.getParent().getPeer();
-
- create (type, decorated, parent_peer);
- }
-
- void create ()
- {
- // Create a normal undecorated window.
- create (GDK_WINDOW_TYPE_HINT_NORMAL, false);
- }
-
- void setParent ()
- {
- setVisible (awtComponent.isVisible ());
- setEnabled (awtComponent.isEnabled ());
- }
-
- void setVisibleAndEnabled ()
- {
- }
-
- native void connectSignals ();
-
- public GtkWindowPeer (Window window)
- {
- super (window);
- }
-
- public native void toBack();
- public native void toFront();
-
- native void nativeSetBounds (int x, int y, int width, int height);
-
- public void setBounds (int x, int y, int width, int height)
- {
- nativeSetBounds (x, y,
- width - insets.left - insets.right,
- height - insets.top - insets.bottom);
- }
-
- public void setTitle (String title)
- {
- gtkWindowSetTitle (title);
- }
-
- native void setSize (int width, int height);
-
- public void setResizable (boolean resizable)
- {
- // Call setSize; otherwise when resizable is changed from true to
- // false the window will shrink to the dimensions it had before it
- // was resizable.
- setSize (awtComponent.getWidth() - insets.left - insets.right,
- awtComponent.getHeight() - insets.top - insets.bottom);
- gtkWindowSetResizable (resizable);
- }
-
- native void setBoundsCallback (Window window,
- int x, int y,
- int width, int height);
-
- protected void postInsetsChangedEvent (int top, int left,
- int bottom, int right)
- {
- insets.top = top;
- insets.left = left;
- insets.bottom = bottom;
- insets.right = right;
- }
-
- protected void postConfigureEvent (int x, int y, int width, int height)
- {
- int frame_x = x - insets.left;
- int frame_y = y - insets.top;
- int frame_width = width + insets.left + insets.right;
- int frame_height = height + insets.top + insets.bottom;
-
- if (frame_x != awtComponent.getX()
- || frame_y != awtComponent.getY()
- || frame_width != awtComponent.getWidth()
- || frame_height != awtComponent.getHeight())
- {
- setBoundsCallback ((Window) awtComponent,
- frame_x, frame_y, frame_width, frame_height);
-
- awtComponent.validate();
- }
- }
-
- native void nativeSetVisible (boolean b);
- public void setVisible (boolean b)
- {
- // Prevent the window manager from automatically placing this
- // window when it is shown.
- if (b)
- setBounds (awtComponent.getX(),
- awtComponent.getY(),
- awtComponent.getWidth(),
- awtComponent.getHeight());
- nativeSetVisible (b);
- }
-
- void postWindowEvent (int id, Window opposite, int newState)
- {
- if (id == WindowEvent.WINDOW_OPENED)
- {
- // Post a WINDOW_OPENED event the first time this window is shown.
- if (!hasBeenShown)
- {
- q().postEvent (new WindowEvent ((Window) awtComponent, id,
- opposite));
- hasBeenShown = true;
- }
- }
- else if (id == WindowEvent.WINDOW_STATE_CHANGED)
- {
- if (oldState != newState)
- {
- q().postEvent (new WindowEvent ((Window) awtComponent, id, opposite,
- oldState, newState));
- oldState = newState;
- }
- }
- else
- q().postEvent (new WindowEvent ((Window) awtComponent, id, opposite));
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/Test.java b/libjava/gnu/java/awt/peer/gtk/Test.java
deleted file mode 100644
index 66f37d814bd..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/Test.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/* Test.java -- Tests the GTK Toolkit
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-
-import java.util.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.peer.*;
-import java.awt.datatransfer.*;
-import gnu.java.awt.image.*;
-import java.io.*;
-
-class Test
-{
- static int xs = 5, ys = 5;
-
- public static void main(String args[])
- {
- if (args.length == 0)
- {
- Properties prop=System.getProperties ();
- prop.put ("awt.toolkit","gnu.java.awt.peer.gtk.GtkToolkit");
- }
-
- final Frame f=new Frame();
- f.setTitle ("Red Hat Classpath");
-
-// f.addComponentListener (new ComponentAdapter() {
-// public void componentMoved (ComponentEvent e) {
-// System.out.println("component moved");
-// }
-// public void componentResized (ComponentEvent e) {
-// System.out.println("component resized");
-// }
-// });
- f.setSize(200,200);
-
- Panel pan=new Panel();
-
- final Label l = new Label ("Pithy Message:");
- l.setCursor (Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR));
- pan.add (l);
-
- TextField tf = new TextField("Hello world!");
- pan.add(tf);
-
- final Image img;
- img = Toolkit.getDefaultToolkit ().createImage (new XBMDecoder ("fvwm.xbm"));
-
-
- final Canvas ch = new Canvas () {
-
- public void update (Graphics g)
- {
- System.out.println ("update called");
- super.update (g);
- }
- public void paint (Graphics g) {
- g.drawString("Hello world!", xs+5, ys+10);
- g.setColor (Color.blue);
- g.drawLine (xs,ys,xs+20,ys+20);
-
-// System.out.println (TextArea.SCROLLBARS_BOTH);
-// System.out.println (TextArea.SCROLLBARS_HORIZONTAL_ONLY);
-// System.out.println (TextArea.SCROLLBARS_VERTICAL_ONLY);
-
-// Font f1 = new Font ("TimesRoman", Font.PLAIN, 10);
-// System.out.println (f1.getName ());
-// System.out.println (f1.getFamily ());
-
-// Font font = new Font ("Serif", Font.PLAIN, 18);
-// g.setFont (font);
-// g.setXORMode (Color.red);
-
-
-// System.out.println (g.getFontMetrics (font).stringWidth ("foobar"));
-
-// System.out.println (g.drawImage (img, 0, 0, this));
- }
- };
-
- ch.setSize(60, 60);
-// List ch=new List();
-// ch.add("Ding");
-// ch.add("September");
-// ch.add("Red");
-// ch.add("Quassia");
-// ch.add("Pterodactyl");
-
-// ch.addMouseListener(new MouseAdapter() {
-// public void mousePressed(MouseEvent e) {
-// System.out.println("mouse pressed ch");
-// System.out.println("shift = " + e.isShiftDown());
-// System.out.println("meta = " + e.isMetaDown());
-// System.out.println("alt = " + e.isAltDown());
-// System.out.println("ctrl = " + e.isControlDown());
-// System.out.println("x = " + e.getX());
-// System.out.println("y = " + e.getY());
-// System.out.println("clickcount = " + e.getClickCount());
-// System.out.println("when = " + e.getWhen());
-// System.out.println();
-// }
-// public void mouseReleased(MouseEvent e) {
-// System.out.println("mouse released ch");
-// }
-// public void mouseClicked(MouseEvent e) {
-// System.out.println("mouse clicked ch");
-// }
-// });
-
- pan.add(ch);
- f.add(pan,"North");
-
- final ScrollPane sp=new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
- System.out.println ("ALWAYS HERE: " + ScrollPane.SCROLLBARS_ALWAYS);
- System.out.println ("ALWAYS" + ScrollPane.SCROLLBARS_ALWAYS);
- System.out.println ("NEEDED" + ScrollPane.SCROLLBARS_AS_NEEDED);
- System.out.println ("NEVER " + ScrollPane.SCROLLBARS_NEVER);
-
-
- final Panel p=new Panel();
- System.out.println ("PREFERED: " + p.getPreferredSize ());
- p.add(new Button("Stop"));
- System.out.println ("PREFERED: " + p.getPreferredSize ());
- p.add(new Button("evil"));
- System.out.println ("PREFERED: " + p.getPreferredSize ());
- p.add(new Button("hoarders"));
- p.add(new Button("use"));
- p.add(new Button("GNU"));
- p.add(new Scrollbar(Scrollbar.HORIZONTAL));
- System.out.println ("PREFERED: " + p.getPreferredSize ());
-
- sp.add(p);
- f.add(sp,"South");
-
- Panel east_panel = new Panel();
- east_panel.setLayout(new GridLayout (0,1));
-
-// CheckboxGroup group = new CheckboxGroup();
-
-// Checkbox cb=new Checkbox("one", group, true);
-// east_panel.add(cb);
-// cb=new Checkbox("two", group, false);
-// east_panel.add(cb);
-
-// cb.addMouseListener(new MouseAdapter() {
-// public void mousePressed(MouseEvent e) {
-// System.out.println("mouse pressed cb");
-// System.out.println("shift = " + e.isShiftDown());
-// System.out.println("meta = " + e.isMetaDown());
-// System.out.println("alt = " + e.isAltDown());
-// System.out.println("ctrl = " + e.isControlDown());
-// System.out.println("x = " + e.getX());
-// System.out.println("y = " + e.getY());
-// System.out.println("clickcount = " + e.getClickCount());
-// System.out.println("when = " + e.getWhen());
-// System.out.println();
-// }
-// public void mouseReleased(MouseEvent e) {
-// System.out.println("mouse released cb");
-// }
-// public void mouseClicked(MouseEvent e) {
-// System.out.println("mouse clicked cb");
-// }
-// public void mouseEntered(MouseEvent e) {
-// System.out.println("mouse entered cb");
-// }
-// public void mouseExited(MouseEvent e) {
-// System.out.println("mouse exited cb");
-// }
-// });
-
- f.add(east_panel,"East");
-
- final Button wb=new Button();
- wb.setLabel("Destroy Frame on Click");
- wb.addActionListener (new ActionListener () {
- public void actionPerformed (ActionEvent e) {
- ScrollPanePeer peer = (ScrollPanePeer)sp.getPeer ();
- if (peer != null)
- {
- System.out.println (peer.getHScrollbarHeight ());
- System.out.println (peer.getVScrollbarWidth ());
- }
-
- l.setText ("Hello World!");
- System.out.println ("PREFERED: " + p.getPreferredSize ());
-
- final Dialog d = new Dialog (f);
- d.setModal (true);
- Button b = new Button ("foobar");
- b.addMouseListener (new MouseAdapter () {
- public void mousePressed (MouseEvent me) {
- System.out.println ("I got called");
- d.hide ();
-
-// System.out.println (ScrollPane.SCROLLBARS_ALWAYS);
-// System.out.println (ScrollPane.SCROLLBARS_AS_NEEDED);
-// System.out.println (ScrollPane.SCROLLBARS_NEVER);
- }
- });
- d.add (b);
- d.pack ();
- d.show ();
- System.out.println ("hello world");
-// System.out.println ("action listener on wb called");
-// Clipboard clip = Toolkit.getDefaultToolkit ().getSystemClipboard ();
-// StringSelection ss = new StringSelection("123456789");
-// clip.setContents (ss, ss);
-// Transferable t = clip.getContents (this);
-// try {
-// System.out.println (t.getTransferData (DataFlavor.stringFlavor));
-// } catch (Exception ex) {
-// ex.printStackTrace ();
-// }
-// System.exit (0);
- }
- });
-
- wb.addMouseListener(new MouseAdapter() {
- public void mousePressed(MouseEvent e) {
- System.out.println("mouse pressed wb");
- xs++;
- ys++;
- ch.repaint ();
- }
- public void mouseReleased(MouseEvent e) {
- System.out.println("mouse released wb");
- }
- public void mouseClicked(MouseEvent e) {
- System.out.println("mouse clicked wb");
- }
- public void mouseEntered(MouseEvent e) {
- System.out.println("mouse entered wb");
- }
- public void mouseExited(MouseEvent e) {
- System.out.println("mouse exited wb");
- }
- });
-
- f.add(wb,"West");
-
- f.pack();
- f.show();
-
- sp.setScrollPosition (10,0);
-
- Toolkit t = Toolkit.getDefaultToolkit();
- /* t.beep(); */
- System.out.println("screen size: " + t.getScreenSize());
- System.out.println("resolution : " + t.getScreenResolution());
-// try {
-// Thread.sleep (5000);
-// } catch (InterruptedException e) {}
-// f.setSize(500,500);
-
- System.out.println ("background of canvas: " + ch.getBackground ());
- System.out.println ("foreground of canvas: " + ch.getForeground ());
-
- System.out.println("done");
- }
-}
-
-
-
diff --git a/libjava/gnu/java/awt/peer/gtk/TestAWT.java b/libjava/gnu/java/awt/peer/gtk/TestAWT.java
deleted file mode 100644
index 3fb00a4f2d6..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/TestAWT.java
+++ /dev/null
@@ -1,613 +0,0 @@
-/* TestAWT.java -- Tests the AWT like testgtk
- Copyright (C) 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-import java.awt.List;
-import java.util.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.peer.*;
-
-class TestAWT
-{
- public static void main(String args[])
- {
- if (args.length==0)
- {
- Properties prop = System.getProperties ();
- prop.put ("awt.toolkit", "gnu.java.awt.peer.gtk.GtkToolkit");
- }
- MainWindow f = new MainWindow();
- System.out.println(f.isDisplayable());
- f.show();
- System.out.println(f.isDisplayable());
- }
-}
-
-interface SubWindow
-{
- public void init ();
-}
-
-class PrettyPanel extends Panel
-{
- Insets myInsets;
-
- public PrettyPanel ()
- {
- myInsets = new Insets (10, 10, 10, 10);
- }
- public Insets getInsets ()
- {
- return myInsets;
- }
-}
-
-abstract class PrettyFrame extends Frame
-{
- public PrettyFrame ()
- {
- ((BorderLayout) getLayout ()).setHgap (5);
- ((BorderLayout) getLayout ()).setVgap (5);
- }
-
-// public Insets getInsets()
-// {
-// Insets oldInsets = super.getInsets ();
-// return new Insets (oldInsets.top+10,
-// oldInsets.left+10,
-// oldInsets.bottom+10,
-// oldInsets.right+10);
-// }
-}
-
-abstract class SubFrame extends PrettyFrame implements SubWindow
-{
- boolean initted = false;
-
- public void setVisible (boolean visible)
- {
- if (!initted && visible)
- init();
- super.setVisible (visible);
- }
-}
-
-class MainWindow extends PrettyFrame implements ActionListener
-{
- Button closeButton;
-
- Hashtable windows;
- Vector buttons;
-
- void addSubWindow (String name, SubWindow w)
- {
- Button b = new Button (name);
- b.addActionListener (this);
-
- buttons.addElement (b);
- windows.put (b, w);
- }
-
- MainWindow ()
- {
- MenuBar mb = new MenuBar ();
- Menu menu = new Menu ("File");
- Menu submenu = new Menu ("Testing");
- submenu.add (new CheckboxMenuItem ("Foobar"));
- menu.add (submenu);
- mb.add (menu);
-
- setMenuBar (mb);
-
- add (new Label ("Classpath v0.0.0"), "North");
-
- closeButton = new Button ("Close");
- closeButton.addActionListener (this);
- closeButton.setFont (new Font ("Serif", Font.BOLD | Font.ITALIC, 18));
- add (closeButton, "South");
-
- windows = new Hashtable ();
- buttons = new Vector ();
-
- addSubWindow ("Buttons", new ButtonsWindow ());
- addSubWindow ("Cursors", new CursorsWindow ());
- addSubWindow ("Dialog", new DialogWindow (this));
- addSubWindow ("File", new FileWindow (this));
- addSubWindow ("Labels", new LabelWindow ());
- addSubWindow ("List", new ListWindow ());
- addSubWindow ("Radio Buttons", new RadioWindow ());
- addSubWindow ("TextField", new TextFieldWindow ());
-
- Panel sp = new Panel();
- PrettyPanel p = new PrettyPanel();
- p.setLayout (new GridLayout (windows.size(), 1));
-
- for (Enumeration e = buttons.elements (); e.hasMoreElements (); )
- {
- p.add ((Button) e.nextElement ());
- }
-
- sp.add (p);
- add (sp, "Center");
-
- setSize (200, 86 + (windows.size ()*22));
- setTitle ("TestAWT");
- }
-
- public void actionPerformed (ActionEvent evt)
- {
- Button source = (Button) evt.getSource ();
-
- if (source==closeButton)
- {
- System.getProperties ().list (System.out);
- dispose();
- System.exit (0);
- }
-
- Window w = (Window) windows.get (source);
- if (w.isVisible ())
- w.dispose ();
- else
- {
- if (w instanceof Dialog)
- {
- System.out.println ("Will 'show'");
- w.show();
- System.out.println ("Has shown");
- }
- else
- {
- w.setVisible (true);
- }
- }
- }
-}
-
-class ButtonsWindow extends SubFrame implements ActionListener
-{
- Button b[] = new Button [9];
-
- public void init ()
- {
- initted = true;
- Panel p = new Panel ();
- p.setLayout (new GridLayout (0, 3, 5, 5));
-
- for (int i=0; i<9; i++)
- {
- b[i]=new Button ("button" + (i+1));
- b[i].addActionListener (this);
- }
-
- p.add (b[0]);
- p.add (b[6]);
- p.add (b[4]);
- p.add (b[8]);
- p.add (b[1]);
- p.add (b[7]);
- p.add (b[3]);
- p.add (b[5]);
- p.add (b[2]);
-
- add (p, "North");
-
- Button cb = new Button ("close");
- cb.addActionListener(new ActionListener () {
- public void actionPerformed (ActionEvent e) {
- dispose();
- }
- });
- add (cb, "South");
- setTitle ("Buttons");
- }
-
- public void actionPerformed (ActionEvent evt)
- {
- Button source = (Button) evt.getSource ();
-
- for (int i=0; i<9; i++)
- {
- if (source == b[i])
- {
- int i2=((i+1)==9)?0:(i+1);
- if (b[i2].isVisible())
- b[i2].setVisible(false);
- else
- b[i2].setVisible(true);
- }
- }
- }
-}
-
-
-class DialogWindow extends Dialog implements SubWindow
-{
- Label text;
- Frame parent;
- boolean initted = false;
-
- public DialogWindow (Frame f)
- {
- super (f, true);
-
- this.parent = f;
-
- addWindowListener (new WindowAdapter ()
- {
- public void windowClosing (WindowEvent e)
- {
- System.out.println ("Window Closing");
- text.setVisible (false);
- hide ();
- }
- });
- }
-
- public void setVisible (boolean visible)
- {
- if (!initted && visible)
- init();
- super.setVisible (visible);
- }
-
- public void show ()
- {
- if (!initted)
- init();
- super.show ();
- }
-
- public void init ()
- {
- text = new Label ("Dialog Test");
- text.setAlignment (Label.CENTER);
-
- add (text, "North");
- text.setVisible (false);
-
- Panel p = new PrettyPanel();
-
- Button cb = new Button ("OK");
- cb.addActionListener(new ActionListener () {
- public void actionPerformed (ActionEvent e)
- {
- text.setVisible (false);
- hide();
- }
- });
-
- p.setLayout (new GridLayout (1, 3));
- ((GridLayout) p.getLayout ()).setHgap (5);
- ((GridLayout) p.getLayout ()).setVgap (5);
- p.add (cb);
-
- Button toggle = new Button ("Toggle");
- p.add (toggle);
-
- toggle.addActionListener(new ActionListener () {
- public void actionPerformed (ActionEvent e)
- {
- if (text.isVisible ())
- text.setVisible (false);
- else
- text.setVisible (true);
- doLayout();
- }
- });
-
- Button subdlg = new Button ("SubDialog");
- p.add (subdlg);
-
- subdlg.addActionListener(new ActionListener () {
- public void actionPerformed (ActionEvent e)
- {
- DialogWindow sw = new DialogWindow (parent);
- System.out.println ("Will show modal sub dialog");
- sw.show ();
- System.out.println ("Has shown modal sub dialog");
- }
- });
-
- add (p, "South");
- setTitle ("Dialog");
- setSize (240, 120);
- }
-}
-
-class CursorsWindow extends SubFrame implements ItemListener
-{
- Choice cursorChoice;
- Canvas cursorCanvas;
-
- public void init ()
- {
- cursorChoice = new Choice();
- cursorChoice.add ("Default");
- cursorChoice.add ("Crosshair");
- cursorChoice.add ("Text");
- cursorChoice.add ("Wait");
- cursorChoice.add ("Southwest Resize");
- cursorChoice.add ("Southeast Resize");
- cursorChoice.add ("Northwest Resize");
- cursorChoice.add ("Northeast Resize");
- cursorChoice.add ("North Resize");
- cursorChoice.add ("South Resize");
- cursorChoice.add ("West Resize");
- cursorChoice.add ("East Resize");
- cursorChoice.add ("Hand");
- cursorChoice.add ("Move");
-
- cursorChoice.addItemListener(this);
-
- add (cursorChoice, "North");
-
- cursorCanvas = new Canvas ()
- {
- public void paint (Graphics g)
- {
- Dimension d = this.getSize();
- g.setColor (Color.white);
- g.fillRect (0, 0, d.width, d.height/2);
- g.setColor (Color.black);
- g.fillRect (0, d.height/2, d.width, d.height/2);
- g.setColor (this.getBackground());
- g.fillRect (d.width/3, d.height/3, d.width/3,
- d.height/3);
- }
- };
-
- cursorCanvas.setSize (80,80);
-
- add (cursorCanvas, "Center");
-
- Button cb = new Button ("Close");
- cb.addActionListener(new ActionListener () {
- public void actionPerformed (ActionEvent e) {
- dispose();
- }
- });
-
- add (cb, "South");
- setTitle ("Cursors");
- setSize (160, 180);
- }
-
- public void itemStateChanged (ItemEvent e)
- {
- cursorCanvas.setCursor (Cursor.getPredefinedCursor (cursorChoice.getSelectedIndex()));
- }
-}
-
-class TextFieldWindow extends SubFrame implements ItemListener
-{
- Checkbox editable, visible, sensitive;
- TextField text;
-
- public void init ()
- {
- initted = true;
- text = new TextField ("hello world");
- add (text, "North");
-
- Panel p = new Panel();
- p.setLayout (new GridLayout (3, 1));
- ((GridLayout) p.getLayout ()).setHgap (5);
- ((GridLayout) p.getLayout ()).setVgap (5);
-
- editable = new Checkbox("Editable", true);
- p.add (editable);
- editable.addItemListener (this);
-
- visible = new Checkbox("Visible", true);
- p.add (visible);
- visible.addItemListener (this);
-
- sensitive = new Checkbox("Sensitive", true);
- p.add (sensitive);
- sensitive.addItemListener (this);
-
- add (p, "Center");
-
- Button cb = new Button ("Close");
- cb.addActionListener(new ActionListener () {
- public void actionPerformed (ActionEvent e) {
- dispose();
- }
- });
-
- add (cb, "South");
- setTitle ("TextField");
- setSize (160, 180);
- }
-
- public void itemStateChanged (ItemEvent e)
- {
- boolean on=true;
-
- if (e.getStateChange () == ItemEvent.DESELECTED)
- on=false;
- if (e.getSource() == editable)
- text.setEditable (on);
- if (e.getSource() == visible)
- if (on)
- text.setEchoChar ((char) 0);
- else
- text.setEchoChar ('*');
- if (e.getSource() == sensitive)
- text.setEnabled (on);
-
- }
-}
-
-class FileWindow extends FileDialog implements SubWindow
-{
- boolean initted = false;
-
- public FileWindow (MainWindow mw)
- {
- super (mw);
- }
-
- public void setVisible (boolean visible)
- {
- if (!initted && visible)
- init();
- super.setVisible (visible);
- }
-
- public void init()
- {
- initted = true;
- }
-}
-
-class LabelWindow extends SubFrame
-{
- public void init ()
- {
- initted = true;
-
- Panel p = new Panel();
- p.setLayout (new GridLayout (3, 1));
- ((GridLayout) p.getLayout ()).setHgap (5);
- ((GridLayout) p.getLayout ()).setVgap (5);
-
- p.add (new Label ("left justified label", Label.LEFT));
- p.add (new Label ("center justified label", Label.CENTER));
- p.add (new Label ("right justified label", Label.RIGHT));
-
- add (p, "Center");
-
- Button cb = new Button ("Close");
- cb.addActionListener(new ActionListener () {
- public void actionPerformed (ActionEvent e) {
- dispose();
- }
- });
-
- add (cb, "South");
- setTitle ("Labels");
- setSize (160, 180);
- }
-}
-
-class ListWindow extends SubFrame
-{
- public void init ()
- {
- initted = true;
-
- Panel p = new Panel ();
- p.setLayout (new GridLayout (3, 1));
-
- List l = new List (5, true);
- for (int i = 0; i < 10; i++)
- l.add ("added item " + i);
-
- p.add (l);
-
- add (p, "Center");
-
- Button cb = new Button ("Close");
- cb.addActionListener(new ActionListener () {
- public void actionPerformed (ActionEvent e) {
- dispose();
- }
- });
-
- add (cb, "South");
- setTitle ("List");
- setSize (85, 167);
- }
-}
-
-
-class RadioWindow extends SubFrame
-{
- public void init ()
- {
- initted = true;
-
- Panel p = new Panel();
- p.setLayout (new GridLayout (3, 1));
- ((GridLayout) p.getLayout ()).setHgap (5);
- ((GridLayout) p.getLayout ()).setVgap (5);
-
- final CheckboxGroup cg = new CheckboxGroup();
- final Checkbox[] boxes = new Checkbox[3];
- for (int i = 0; i < 3; ++i)
- {
- boxes[i] = new Checkbox("button" + i, cg, i == 0);
- p.add(boxes[i]);
- }
-
- add (p, "North");
-
- p = new Panel();
- p.setLayout (new GridLayout (1, 3));
- ((GridLayout) p.getLayout ()).setHgap (5);
- ((GridLayout) p.getLayout ()).setVgap (5);
-
- for (int i = 0; i < 3; ++i)
- {
- final int val = i;
- Button tweak = new Button ("Set " + i);
- tweak.addActionListener(new ActionListener ()
- {
- public void actionPerformed (ActionEvent e)
- {
- cg.setSelectedCheckbox(boxes[val]);
- }
- });
- p.add(tweak);
- }
-
- add (p, "Center");
-
- Button cb = new Button ("Close");
- cb.addActionListener(new ActionListener () {
- public void actionPerformed (ActionEvent e) {
- dispose();
- }
- });
-
- add (cb, "South");
- setTitle ("Radio Buttons");
- setSize (85, 167);
- }
-}
diff --git a/libjava/gnu/java/beans/BeanInfoEmbryo.java b/libjava/gnu/java/beans/BeanInfoEmbryo.java
deleted file mode 100644
index 0cf73e5b9ae..00000000000
--- a/libjava/gnu/java/beans/BeanInfoEmbryo.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* gnu.java.beans.BeanInfoEmbryo
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans;
-
-import java.beans.BeanDescriptor;
-import java.beans.BeanInfo;
-import java.beans.EventSetDescriptor;
-import java.beans.IndexedPropertyDescriptor;
-import java.beans.MethodDescriptor;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.Vector;
-
-/**
- ** A BeanInfoEmbryo accumulates information about a Bean
- ** while it is in the process of being created, and then
- ** when you are done accumulating the information, the
- ** getBeanInfo() method may be called to create a BeanInfo
- ** object based on the information.<P>
- **
- ** This class is not well-synchronized. (It can be, it
- ** just isn't yet.)
- **
- ** @author John Keiser
- ** @version 1.1.0, 30 Jul 1998
- ** @see java.beans.BeanInfo
- **/
-
-public class BeanInfoEmbryo {
-
- // by using a TreeMap the properties will be sorted alphabetically by name
- // which matches the (undocumented) behavior of jdk
- TreeMap properties = new TreeMap();
- Hashtable events = new Hashtable();
- Vector methods = new Vector();
-
- BeanDescriptor beanDescriptor;
- BeanInfo[] additionalBeanInfo;
- java.awt.Image[] im;
- String defaultPropertyName;
- String defaultEventName;
-
- public BeanInfoEmbryo() {
- }
-
- public BeanInfo getBeanInfo() {
- int defaultProperty = -1;
- int defaultEvent = -1;
-
- PropertyDescriptor[] Aproperties = new PropertyDescriptor[properties.size()];
- int i = 0;
- Iterator it = properties.entrySet().iterator();
- while (it.hasNext()) {
- Aproperties[i] = (PropertyDescriptor) (((Map.Entry)it.next()).getValue());
- if(defaultPropertyName != null && Aproperties[i].getName().equals(defaultPropertyName)) {
- defaultProperty = i;
- }
- i++;
- }
-
- EventSetDescriptor[] Aevents = new EventSetDescriptor[events.size()];
- i = 0;
- Enumeration e = events.elements();
- while (e.hasMoreElements()) {
- Aevents[i] = (EventSetDescriptor) e.nextElement();
- if(defaultEventName != null && Aevents[i].getName().equals(defaultEventName)) {
- defaultEvent = i;
- }
- i++;
- }
-
- MethodDescriptor[] Amethods = new MethodDescriptor[methods.size()];
- methods.copyInto(Amethods);
-
- return new ExplicitBeanInfo(beanDescriptor,additionalBeanInfo,Aproperties,defaultProperty,Aevents,defaultEvent,Amethods,im);
- }
-
- public void setBeanDescriptor(BeanDescriptor b) {
- beanDescriptor = b;
- }
-
- public void setAdditionalBeanInfo(BeanInfo[] b) {
- additionalBeanInfo = b;
- }
-
- public boolean hasProperty(PropertyDescriptor p) {
- return properties.get(p.getName()) != null;
- }
- public void addProperty(PropertyDescriptor p) {
- properties.put(p.getName(),p);
- }
- public void addIndexedProperty(IndexedPropertyDescriptor p) {
- properties.put(p.getName(),p);
- }
-
- public boolean hasEvent(EventSetDescriptor e) {
- return events.get(e.getName()) != null;
- }
- public void addEvent(EventSetDescriptor e) {
- events.put(e.getName(),e);
- }
-
- public boolean hasMethod(MethodDescriptor m) {
- for(int i=0;i<methods.size();i++) {
- Method thisMethod = ((MethodDescriptor)methods.elementAt(i)).getMethod();
- if(m.getMethod().getName().equals(thisMethod.getName())
- && Arrays.equals(m.getMethod().getParameterTypes(),
- thisMethod.getParameterTypes())) {
- return true;
- }
- }
- return false;
- }
- public void addMethod(MethodDescriptor m) {
- methods.addElement(m);
- }
-
- public void setDefaultPropertyName(String defaultPropertyName) {
- this.defaultPropertyName = defaultPropertyName;
- }
-
- public void setDefaultEventName(String defaultEventName) {
- this.defaultEventName = defaultEventName;
- }
-
- public void setIcons(java.awt.Image[] im) {
- this.im = im;
- }
-}
diff --git a/libjava/gnu/java/beans/DummyAppletContext.java b/libjava/gnu/java/beans/DummyAppletContext.java
deleted file mode 100644
index 4facb470d95..00000000000
--- a/libjava/gnu/java/beans/DummyAppletContext.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/* gnu.java.beans.DummyAppletContext
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans;
-
-import java.applet.Applet;
-import java.applet.AppletContext;
-import java.applet.AudioClip;
-import java.awt.Image;
-import java.awt.Toolkit;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Iterator;
-
-/** A placeholder <code>AppletContext</code> implementation that does nothing.
- *
- * <p>This is the default implementation for GNU Classpath and is used for <code>Applet</code>
- * beans being created with {@link java.beans.Beans.instantiate}.</p>
- *
- * <p>It has no functionality in order to allow it to be used without any dependencies
- * (e.g. sound, network access, ...).</p>
- *
- * @author Robert Schuster
- */
-class DummyAppletContext implements AppletContext
-{
- private static final Enumeration EMPTY_ENUMERATION = Collections.enumeration(Collections.EMPTY_SET);
- private static final AudioClip DUMMY_CLIP = new DummyAudioClip();
-
- DummyAppletContext()
- {
- }
-
- /** Implementation is VM neutral and returns a dummy {@link AudioClip} instance
- * for every URL that returns a non-<code>null</code> object on
- * <code>URL.openConnection()</code>.
- *
- * @see java.applet.AppletContext#getAudioClip(java.net.URL)
- *
- * FIXME: When Java Sound API (javax.sound) is included in Classpath or URL is able to handle
- * sampled sound this should be adjusted.
- */
- public AudioClip getAudioClip(URL url)
- {
- try
- {
- return (url.openConnection() != null ? DUMMY_CLIP : null);
- }
- catch (IOException ioe)
- {
- return null;
- }
- }
-
- /** Loads the <code>Image</code> instance by delegating to
- * {@link java.awt.Toolkit.createImage(URL) }.
- *
- * @see java.applet.AppletContext#getImage(java.net.URL)
- * @see java.awt.Toolkit#createImage(java.net.URL)
- */
- public Image getImage(URL url)
- {
- return Toolkit.getDefaultToolkit().createImage(url);
- }
-
- /** Returns <code>null</code> for every argument.
- *
- * @see java.applet.AppletContext#getApplet(java.lang.String)
- */
- public Applet getApplet(String name)
- {
- return null;
- }
-
- /** Returns always an empty <code>Enumeration</code>.
- *
- * @see java.applet.AppletContext#getApplets()
- */
- public Enumeration getApplets()
- {
- return EMPTY_ENUMERATION;
- }
-
- /** Does nothing.
- *
- * @see java.applet.AppletContext#showDocument(java.net.URL)
- */
- public void showDocument(URL url)
- {
- }
-
- /** Does nothing.
- *
- * @see java.applet.AppletContext#showDocument(java.net.URL, java.lang.String)
- */
- public void showDocument(URL url, String target)
- {
- }
-
- /** Does nothing.
- *
- * @see java.applet.AppletContext#showStatus(java.lang.String)
- */
- public void showStatus(String message)
- {
- }
-
- /** Does nothing.
- *
- * @see java.applet.AppletContext#setStream(java.lang.String, java.io.InputStream)
- */
- public void setStream(String key, InputStream stream)
- throws IOException
- {
- throw new IOException("Dummy implementation imposes zero InputStream associations.");
- }
-
- /** Returns <code>null</code> for every argument.
- *
- * @see java.applet.AppletContext#getStream(java.lang.String)
- */
- public InputStream getStream(String key)
- {
- return null;
- }
-
- /** Returns always an empty iterator.
- *
- * @see java.applet.AppletContext#getStreamKeys()
- */
- public Iterator getStreamKeys()
- {
- return Collections.EMPTY_SET.iterator();
- }
-
- /** Dummy <code>AudioClip</code> implementation that does nothing but
- * preventing <code>NullPointerException</code>S being thrown in programs
- * that expect a valid <code>AudioClip</code> instance to be returned by
- * their Applet.
- *
- * @author Robert Schuster
- */
- static class DummyAudioClip implements AudioClip
- {
- public void play()
- {
- }
-
- public void stop()
- {
- }
-
- public void loop()
- {
- }
-
- public String toString()
- {
- return "DummyAudioClip never plays anything - implement javax.sound and make us happy :)";
- }
- }
-}
diff --git a/libjava/gnu/java/beans/DummyAppletStub.java b/libjava/gnu/java/beans/DummyAppletStub.java
deleted file mode 100644
index 3bcb43534cf..00000000000
--- a/libjava/gnu/java/beans/DummyAppletStub.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* gnu.java.beans.DummyAppletStub
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans;
-
-import java.applet.AppletContext;
-import java.applet.AppletStub;
-import java.net.URL;
-
-/** Placeholder implementation of <code>AppletStub</code> providing no functionality.
- * <p>This class is used for <code>Applet</code> being created with
- * {@link java.beans.Bean.instantiate}.</p>
- *
- * @author Robert Schuster
- */
-public class DummyAppletStub implements AppletStub
-{
- private URL documentBase;
- private URL codeBase;
- private DummyAppletContext context;
-
- public DummyAppletStub(URL newCodeBase, URL newDocumentBase)
- {
- codeBase = newCodeBase;
- documentBase = newDocumentBase;
-
- context = new DummyAppletContext();
- }
-
- /** Returns always <code>true</code>.
- *
- * @see java.applet.AppletStub#isActive()
- */
- public boolean isActive()
- {
- return true;
- }
-
- /**
- * @see java.applet.AppletStub#getDocumentBase()
- */
- public URL getDocumentBase()
- {
- return documentBase;
- }
-
- /**
- * @see java.applet.AppletStub#getCodeBase()
- */
- public URL getCodeBase()
- {
- return codeBase;
- }
-
- /** Implementation returns <code>null</code> for every parameter name.
- *
- * @see java.applet.AppletStub#getParameter(java.lang.String)
- */
- public String getParameter(String name)
- {
- return null;
- }
-
- /** Returns a non-functional context instance.
- *
- * @see java.applet.AppletStub#getAppletContext()
- */
- public AppletContext getAppletContext()
- {
- return context;
- }
-
- /** Does nothing.
- *
- * @see java.applet.AppletStub#appletResize(int, int)
- */
- public void appletResize(int width, int height)
- {
- }
-}
diff --git a/libjava/gnu/java/beans/ExplicitBeanInfo.java b/libjava/gnu/java/beans/ExplicitBeanInfo.java
deleted file mode 100644
index 6da5e869695..00000000000
--- a/libjava/gnu/java/beans/ExplicitBeanInfo.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* ExplicitBeanInfo.java --
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans;
-
-import java.awt.Image;
-import java.beans.BeanDescriptor;
-import java.beans.BeanInfo;
-import java.beans.EventSetDescriptor;
-import java.beans.MethodDescriptor;
-import java.beans.PropertyDescriptor;
-
-/**
- ** ExplicitBeanInfo lets you specify in the constructor
- ** all the various parts of the BeanInfo.
- **
- ** @author John Keiser
- ** @version 1.1.0, 30 Jul 1998
- ** @see java.beans.BeanInfo
- **/
-
-public class ExplicitBeanInfo implements BeanInfo {
- /** The BeanDescriptor returned by getBeanDescriptor. **/
- protected BeanDescriptor beanDescriptor;
-
- /** The EventSetDescriptor array returned by
- ** getEventSetDescriptors().
- **/
- protected EventSetDescriptor[] eventSetDescriptors = new EventSetDescriptor[0];
-
- /** The PropertyDescriptor array returned by
- ** getPropertyDescriptors().
- **/
- protected PropertyDescriptor[] propertyDescriptors = new PropertyDescriptor[0];
-
- /** The MethodDescriptor array returned by
- ** getMethodDescriptors().
- **/
- protected MethodDescriptor[] methodDescriptors;
-
- /** The default property index. **/
- protected int defaultPropertyIndex;
-
- /** The default event index. **/
- protected int defaultEventIndex;
-
- /** The BeanInfo array returned by
- ** getAdditionalBeanInfo().
- **/
- protected BeanInfo[] additionalBeanInfo;
-
- /** The set of icons. **/
- protected Image[] icons;
-
- public ExplicitBeanInfo(BeanDescriptor beanDescriptor,
- BeanInfo[] additionalBeanInfo,
- PropertyDescriptor[] propertyDescriptors,
- int defaultPropertyIndex,
- EventSetDescriptor[] eventSetDescriptors,
- int defaultEventIndex,
- MethodDescriptor[] methodDescriptors,
- Image[] icons) {
- this.beanDescriptor = beanDescriptor;
- this.additionalBeanInfo = additionalBeanInfo;
- this.propertyDescriptors = propertyDescriptors;
- this.defaultPropertyIndex = defaultPropertyIndex;
- this.eventSetDescriptors = eventSetDescriptors;
- this.defaultEventIndex = defaultEventIndex;
- this.methodDescriptors = methodDescriptors;
- this.icons = icons;
- }
-
- /** Get Bean descriptor. **/
- public BeanDescriptor getBeanDescriptor() {
- return beanDescriptor;
- }
-
- /** Get Bean events. **/
- public EventSetDescriptor[] getEventSetDescriptors() {
- return eventSetDescriptors;
- }
-
- /** Get default event set. **/
- public int getDefaultEventIndex() {
- return defaultEventIndex;
- }
-
- /** Get Bean properties. **/
- public PropertyDescriptor[] getPropertyDescriptors() {
- return propertyDescriptors;
- }
-
- /** Get "default" property. **/
- public int getDefaultPropertyIndex() {
- return defaultPropertyIndex;
- }
-
- /** Get Bean methods. **/
- public MethodDescriptor[] getMethodDescriptors() {
- return methodDescriptors;
- }
-
- /** Get additional Bean info. **/
- public BeanInfo[] getAdditionalBeanInfo() {
- return additionalBeanInfo;
- }
-
- /** Get Bean icons.
- ** @param iconType the type of icon
- **/
- public Image getIcon(int iconType) {
- return icons != null ? icons[iconType - 1] : null;
- }
-}
diff --git a/libjava/gnu/java/beans/IntrospectionIncubator.java b/libjava/gnu/java/beans/IntrospectionIncubator.java
deleted file mode 100644
index e0d9480e327..00000000000
--- a/libjava/gnu/java/beans/IntrospectionIncubator.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/* gnu.java.beans.IntrospectionIncubator
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans;
-
-import gnu.java.lang.ArrayHelper;
-import gnu.java.lang.ClassHelper;
-
-import java.beans.BeanInfo;
-import java.beans.EventSetDescriptor;
-import java.beans.IndexedPropertyDescriptor;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.MethodDescriptor;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Array;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-/**
- ** IntrospectionIncubator takes in a bunch of Methods, and
- ** Introspects only those Methods you give it.<br/>
- **
- ** See {@link addMethod(Method)} for details which rules apply to
- ** the methods.
- **
- ** @author John Keiser
- ** @author Robert Schuster
- ** @see gnu.java.beans.ExplicitBeanInfo
- ** @see java.beans.BeanInfo
- **/
-
-public class IntrospectionIncubator {
- Hashtable propertyMethods = new Hashtable();
- Hashtable listenerMethods = new Hashtable();
- Vector otherMethods = new Vector();
-
- Class propertyStopClass;
- Class eventStopClass;
- Class methodStopClass;
-
- public IntrospectionIncubator() {
- }
-
- /** Examines the given method and files it in a suitable collection.
- * It files the method as a property method if it finds:
- * <ul>
- * <li>boolean "is" getter</li>
- * <li>"get" style getter</li>
- * <li>single argument setter</li>
- * <li>indiced setter and getter</li>
- * </ul>
- * It files the method as a listener method if all of these rules apply:
- * <ul>
- * <li>the method name starts with "add" or "remove"</li>
- * <li>there is only a single argument</li>
- * <li>the argument type is a subclass of <code>java.util.EventListener</code></li>
- * </ul>
- * All public methods are filed as such.
- *
- * @param method The method instance to examine.
- */
- public void addMethod(Method method) {
- if(Modifier.isPublic(method.getModifiers())) {
- String name = ClassHelper.getTruncatedName(method.getName());
- Class retType = method.getReturnType();
- Class[] params = method.getParameterTypes();
- boolean isVoid = retType.equals(java.lang.Void.TYPE);
- Class methodClass = method.getDeclaringClass();
-
- /* Accepts the method for examination if no stop class is given or the method is declared in a subclass of the stop class.
- * The rules for this are described in {@link java.beans.Introspector.getBeanInfo(Class, Class)}.
- * This block finds out whether the method is a suitable getter or setter method (or read/write method).
- */
- if(isReachable(propertyStopClass, methodClass)) {
- /* At this point a method may regarded as a property's read or write method if its name
- * starts with "is", "get" or "set". However, if a method is static it cannot be part
- * of a property.
- */
- if(Modifier.isStatic(method.getModifiers())) {
- // files method as other because it is static
- otherMethods.addElement(method);
- } else if(name.startsWith("is")
- && retType.equals(java.lang.Boolean.TYPE)
- && params.length == 0) {
- // files method as boolean "is" style getter
- addToPropertyHash(name,method,IS);
- } else if(name.startsWith("get") && !isVoid) {
- if(params.length == 0) {
- // files as legal non-argument getter
- addToPropertyHash(name,method,GET);
- } else if(params.length == 1 && params[0].equals(java.lang.Integer.TYPE)) {
- // files as legal indiced getter
- addToPropertyHash(name,method,GET_I);
- } else {
- // files as other because the method's signature is not Bean-like
- otherMethods.addElement(method);
- }
- } else if(name.startsWith("set") && isVoid) {
- if(params.length == 1) {
- // files as legal single-argument setter method
- addToPropertyHash(name,method,SET);
- } else if(params.length == 2 && params[0].equals(java.lang.Integer.TYPE)) {
- // files as legal indiced setter method
- addToPropertyHash(name,method,SET_I);
- } else {
- // files as other because the method's signature is not Bean-like
- otherMethods.addElement(method);
- }
- }
- }
-
- if(isReachable(eventStopClass, methodClass)) {
- if(name.startsWith("add")
- && isVoid
- && params.length == 1
- && java.util.EventListener.class.isAssignableFrom(params[0])) {
- addToListenerHash(name,method,ADD);
- } else if(name.startsWith("remove")
- && isVoid
- && params.length == 1
- && java.util.EventListener.class.isAssignableFrom(params[0])) {
- addToListenerHash(name,method,REMOVE);
- }
- }
-
- if(isReachable(methodStopClass, methodClass)) {
- // files as reachable public method
- otherMethods.addElement(method);
- }
-
- }
- }
-
- public void addMethods(Method[] m) {
- for(int i=0;i<m.length;i++) {
- addMethod(m[i]);
- }
- }
-
- public void setPropertyStopClass(Class c) {
- propertyStopClass = c;
- }
-
- public void setEventStopClass(Class c) {
- eventStopClass = c;
- }
-
- public void setMethodStopClass(Class c) {
- methodStopClass = c;
- }
-
-
- public BeanInfoEmbryo getBeanInfoEmbryo() throws IntrospectionException {
- BeanInfoEmbryo b = new BeanInfoEmbryo();
- findXXX(b,IS);
- findXXXInt(b,GET_I);
- findXXXInt(b,SET_I);
- findXXX(b,GET);
- findXXX(b,SET);
- findAddRemovePairs(b);
- for(int i=0;i<otherMethods.size();i++) {
- MethodDescriptor newMethod = new MethodDescriptor((Method)otherMethods.elementAt(i));
- if(!b.hasMethod(newMethod)) {
- b.addMethod(new MethodDescriptor((Method)otherMethods.elementAt(i)));
- }
- }
- return b;
- }
-
- public BeanInfo getBeanInfo() throws IntrospectionException {
- return getBeanInfoEmbryo().getBeanInfo();
- }
-
-
- void findAddRemovePairs(BeanInfoEmbryo b) throws IntrospectionException {
- Enumeration listenerEnum = listenerMethods.keys();
- while(listenerEnum.hasMoreElements()) {
- DoubleKey k = (DoubleKey)listenerEnum.nextElement();
- Method[] m = (Method[])listenerMethods.get(k);
- if(m[ADD] != null && m[REMOVE] != null) {
- EventSetDescriptor e = new EventSetDescriptor(Introspector.decapitalize(k.getName()),
- k.getType(), k.getType().getMethods(),
- m[ADD],m[REMOVE]);
- e.setUnicast(ArrayHelper.contains(m[ADD].getExceptionTypes(),java.util.TooManyListenersException.class));
- if(!b.hasEvent(e)) {
- b.addEvent(e);
- }
- }
- }
- }
-
- void findXXX(BeanInfoEmbryo b, int funcType) throws IntrospectionException {
- Enumeration keys = propertyMethods.keys();
- while(keys.hasMoreElements()) {
- DoubleKey k = (DoubleKey)keys.nextElement();
- Method[] m = (Method[])propertyMethods.get(k);
- if(m[funcType] != null) {
- PropertyDescriptor p = new PropertyDescriptor(Introspector.decapitalize(k.getName()),
- m[IS] != null ? m[IS] : m[GET],
- m[SET]);
- if(m[SET] != null) {
- p.setConstrained(ArrayHelper.contains(m[SET].getExceptionTypes(),java.beans.PropertyVetoException.class));
- }
- if(!b.hasProperty(p)) {
- b.addProperty(p);
- }
- }
- }
- }
-
- void findXXXInt(BeanInfoEmbryo b, int funcType) throws IntrospectionException {
- Enumeration keys = propertyMethods.keys();
- while(keys.hasMoreElements()) {
- DoubleKey k = (DoubleKey)keys.nextElement();
- Method[] m = (Method[])propertyMethods.get(k);
- if(m[funcType] != null) {
- boolean constrained;
- if(m[SET_I] != null) {
- constrained = ArrayHelper.contains(m[SET_I].getExceptionTypes(),java.beans.PropertyVetoException.class);
- } else {
- constrained = false;
- }
-
- /** Find out if there is an array type get or set **/
- Class arrayType = Array.newInstance(k.getType(),0).getClass();
- DoubleKey findSetArray = new DoubleKey(arrayType,k.getName());
- Method[] m2 = (Method[])propertyMethods.get(findSetArray);
- IndexedPropertyDescriptor p;
- if(m2 == null) {
- p = new IndexedPropertyDescriptor(Introspector.decapitalize(k.getName()),
- null,null,
- m[GET_I],m[SET_I]);
- } else {
- if(constrained && m2[SET] != null) {
- constrained = ArrayHelper.contains(m2[SET].getExceptionTypes(),java.beans.PropertyVetoException.class);
- }
- p = new IndexedPropertyDescriptor(Introspector.decapitalize(k.getName()),
- m2[GET],m2[SET],
- m[GET_I],m[SET_I]);
- }
- p.setConstrained(constrained);
- if(!b.hasProperty(p)) {
- b.addProperty(p);
- }
- }
- }
- }
-
- static final int IS=0;
- static final int GET_I=1;
- static final int SET_I=2;
- static final int GET=3;
- static final int SET=4;
-
- static final int ADD=0;
- static final int REMOVE=1;
-
- void addToPropertyHash(String name, Method method, int funcType) {
- String newName;
- Class type;
-
- switch(funcType) {
- case IS:
- type = java.lang.Boolean.TYPE;
- newName = name.substring(2);
- break;
- case GET_I:
- type = method.getReturnType();
- newName = name.substring(3);
- break;
- case SET_I:
- type = method.getParameterTypes()[1];
- newName = name.substring(3);
- break;
- case GET:
- type = method.getReturnType();
- newName = name.substring(3);
- break;
- case SET:
- type = method.getParameterTypes()[0];
- newName = name.substring(3);
- break;
- default:
- return;
- }
- newName = capitalize(newName);
- if (newName.length() == 0)
- return;
-
- DoubleKey k = new DoubleKey(type,newName);
- Method[] methods = (Method[])propertyMethods.get(k);
- if(methods == null) {
- methods = new Method[5];
- propertyMethods.put(k,methods);
- }
- methods[funcType] = method;
- }
-
- void addToListenerHash(String name, Method method, int funcType) {
- String newName;
- Class type;
-
- switch(funcType) {
- case ADD:
- type = method.getParameterTypes()[0];
- newName = name.substring(3,name.length()-8);
- break;
- case REMOVE:
- type = method.getParameterTypes()[0];
- newName = name.substring(6,name.length()-8);
- break;
- default:
- return;
- }
- newName = capitalize(newName);
- if (newName.length() == 0)
- return;
-
- DoubleKey k = new DoubleKey(type,newName);
- Method[] methods = (Method[])listenerMethods.get(k);
- if(methods == null) {
- methods = new Method[2];
- listenerMethods.put(k,methods);
- }
- methods[funcType] = method;
- }
-
- /* Determines whether <code>stopClass</code> is <code>null</code>
- * or <code>declaringClass<code> is a true subclass of <code>stopClass</code>.
- * This expression is useful to detect whether a method should be introspected or not.
- * The rules for this are described in {@link java.beans.Introspector.getBeanInfo(Class, Class)}.
- */
- static boolean isReachable(Class stopClass, Class declaringClass) {
- return stopClass == null || (stopClass.isAssignableFrom(declaringClass) && !stopClass.equals(declaringClass));
- }
-
- /** Transforms a property name into a part of a method name.
- * E.g. "value" becomes "Value" which can then concatenated with
- * "set", "get" or "is" to form a valid method name.
- *
- * Implementation notes:
- * If "" is the argument, it is returned without changes.
- * If <code>null</code> is the argument, <code>null</code> is returned.
- *
- * @param name Name of a property.
- * @return Part of a method name of a property.
- */
- static String capitalize(String name) {
- try {
- if(Character.isUpperCase(name.charAt(0))) {
- return name;
- } else {
- char[] c = name.toCharArray();
- c[0] = Character.toLowerCase(c[0]);
- return new String(c);
- }
- } catch(StringIndexOutOfBoundsException E) {
- return name;
- } catch(NullPointerException E) {
- return null;
- }
- }
-}
-
-/** This class is a hashmap key that consists of a <code>Class</code> and a
- * <code>String</code> element.
- *
- * It is used for XXX: find out what this is used for
- *
- * @author John Keiser
- * @author Robert Schuster
- */
-class DoubleKey {
- Class type;
- String name;
-
- DoubleKey(Class type, String name) {
- this.type = type;
- this.name = name;
- }
-
- Class getType() {
- return type;
- }
-
- String getName() {
- return name;
- }
-
- public boolean equals(Object o) {
- if(o instanceof DoubleKey) {
- DoubleKey d = (DoubleKey)o;
- return d.type.equals(type) && d.name.equals(name);
- } else {
- return false;
- }
- }
-
- public int hashCode() {
- return type.hashCode() ^ name.hashCode();
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/AbstractContext.java b/libjava/gnu/java/beans/decoder/AbstractContext.java
deleted file mode 100644
index 0e95d432986..00000000000
--- a/libjava/gnu/java/beans/decoder/AbstractContext.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* gnu.java.beans.decoder.AbstractContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** AbstractContext implements some basic functionality of the Context
- * interface and is therefore the base of all Context implementations.
- *
- * @author Robert Schuster
- */
-abstract class AbstractContext implements Context
-{
- private boolean isStatement;
- private String id;
-
- public String getId()
- {
- return id;
- }
-
- public void setId(String newId)
- {
- id = newId;
- }
-
- public boolean isStatement()
- {
- return isStatement;
- }
-
- public void setStatement(boolean b)
- {
- isStatement = b;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/AbstractCreatableObjectContext.java b/libjava/gnu/java/beans/decoder/AbstractCreatableObjectContext.java
deleted file mode 100644
index 47f04fa1cbe..00000000000
--- a/libjava/gnu/java/beans/decoder/AbstractCreatableObjectContext.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* gnu.java.beans.decoder.AbstractCreatableContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** AbstractCreatableObjectContext is the base class for all Context implementations
- * which create a result object in their lifetime. It provides means for preventing
- * to create the object twice.
- *
- * @author Robert Schuster
- *
- */
-abstract class AbstractCreatableObjectContext extends AbstractObjectContext
-{
- AbstractCreatableObjectContext()
- {
- }
-
- /** Adds a parameter object to this Context if the result object has not been
- * created yet. Otherwise an AssemblyException is thrown that indicates a wrong
- * behavior of the decoder.
- */
- public final void addParameterObject(Object o) throws AssemblyException
- {
- if (object == null)
- addParameterObjectImpl(o);
- else
- throw new AssemblyException(new IllegalStateException("No more parameter objects are allowed when the object as already been created."));
- }
-
- /** Adds a parameter object to this Context. Implement this without caring
- * for illegal states because this has been done already.
- *
- * @param obj The parameter object to be added.
- */
- protected abstract void addParameterObjectImpl(Object obj);
-
- /** Creates the result object if it does not exist already.
- */
- public final void notifyStatement(Context outerContext)
- throws AssemblyException
- {
- if (object != null)
- return;
-
- object = createObject(outerContext);
- }
-
- /** Creates the result object. This method is called only once. Implement this
- * without checking for double invocations as this is already being prevented.
- *
- * @param outerContext The Context that exists around this one.
- * @return The result object.
- * @throws AssemblerException if the object creation fails somehow.
- */
- protected abstract Object createObject(Context outerContext)
- throws AssemblyException;
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#endContext(gnu.java.beans.decoder.Context)
- */
- public final Object endContext(Context outerContext)
- throws AssemblyException
- {
- notifyStatement(outerContext);
- return object;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#subContextFailed()
- */
- public boolean subContextFailed()
- {
- /* Returns true when the AbstractCreatableObjectContext has not created the result object yet
- * (A failed subcontext automatically lets this context fail too.)
- */
- return object == null;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/AbstractElementHandler.java b/libjava/gnu/java/beans/decoder/AbstractElementHandler.java
deleted file mode 100644
index e5578a990bc..00000000000
--- a/libjava/gnu/java/beans/decoder/AbstractElementHandler.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/* gnu.java.beans.decoder.AbstractElementHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.ExceptionListener;
-
-import org.xml.sax.Attributes;
-
-/** ElementHandler manages a Context instance and interacts with
- * its parent and child handlers.
- *
- * @author Robert Schuster
- */
-abstract class AbstractElementHandler implements ElementHandler
-{
- /** The Context instance of this handler. The instance is available after the startElement()
- * method was called. Otherwise the handler is marked as failed.
- */
- private Context context;
-
- /** The parent handler. */
- private ElementHandler parent;
-
- /** Stores whether this handler is marked as failed. */
- private boolean hasFailed;
-
- /** Stores the character data which is contained in the body of the XML tag. */
- private StringBuffer buffer = new StringBuffer();
-
- /** Stores whether this ElementHandler can have subelements. The information for this is taken from
- * javabeans.dtd which can be found here:
- * <a href="http://java.sun.com/products/jfc/tsc/articles/persistence3/">Java Persistence Article</a>
- */
- private boolean allowsSubelements;
-
- /** Creates a new ElementHandler with the given ElementHandler instance
- * as parent.
- *
- * @param parentHandler The parent handler.
- */
- protected AbstractElementHandler(ElementHandler parentHandler,
- boolean allowsSubs)
- {
- parent = parentHandler;
- allowsSubelements = allowsSubs;
- }
-
- /** Evaluates the attributes and creates a Context instance.
- * If the creation of the Context instance fails the ElementHandler
- * is marked as failed which may affect the parent handler other.
- *
- * @param attributes Attributes of the XML tag.
- */
- public final void start(Attributes attributes,
- ExceptionListener exceptionListener)
- {
- try
- {
- // lets the subclass create the appropriate Context instance
- context = startElement(attributes, exceptionListener);
- }
- catch (AssemblyException pe)
- {
- Throwable t = pe.getCause();
-
- if (t instanceof Exception)
- exceptionListener.exceptionThrown((Exception) t);
- else
- throw new InternalError("Unexpected Throwable type in AssemblerException. Please file a bug report.");
-
- notifyContextFailed();
-
- return;
- }
- }
-
- /** Analyses the content of the Attributes instance and creates a Context
- * object accordingly.
- * An AssemblerException is thrown when the Context instance could not
- * be created.
- *
- * @param attributes Attributes of the XML tag.
- * @return A Context instance.
- * @throws AssemblerException when Context instance could not be created.
- */
- protected abstract Context startElement(Attributes attributes, ExceptionListener exceptionListener)
- throws AssemblyException;
-
- /** Post-processes the Context.
- */
- public final void end(ExceptionListener exceptionListener)
- {
- // skips processing if the handler is marked as failed (because the Context
- // is then invalid or may not exist at all)
- if (!hasFailed)
- {
- try
- {
- // note: the order of operations is very important here
- // sends the stored character data to the Context
- endElement(buffer.toString());
-
- // reports to the parent handler if this handler's Context is a
- // statement (returning no value BACK to the parent's Context)
- if (context.isStatement())
- {
- // This may create a valid result in the parent's Context
- // or let it fail
- parent.notifyStatement(exceptionListener);
-
- // skips any further processing if the parent handler is now marked
- // as failed
- if (parent.hasFailed())
- return;
- }
-
- // processes the Context and stores the result
- putObject(context.getId(), context.endContext(parent.getContext()));
-
- // transfers the Context's results to the parent's Context
- // if it is an expression (rather than a statement)
- if (! context.isStatement())
- parent.getContext().addParameterObject(context.getResult());
- }
- catch (AssemblyException pe)
- {
- // notifies that an exception was thrown in this handler's Context
- Throwable t = pe.getCause();
-
- if (t instanceof Exception)
- exceptionListener.exceptionThrown((Exception) t);
- else
- throw (InternalError) new InternalError("Severe problem while decoding XML data.")
- .initCause(t);
-
- // marks the handler as failed
- notifyContextFailed();
- }
- }
- }
-
- /** Notifies the handler's Context that its child Context will not return
- * a value back. Some Context variants need this information to know when
- * a method or a constructor call can be made.
- *
- * This method is called by a child handler.
- */
- public void notifyStatement(ExceptionListener exceptionListener)
- {
- try
- {
-
- // propagates to parent handler first to generate objects
- // needed by this Context instance
- if(context.isStatement())
- {
- parent.notifyStatement(exceptionListener);
- }
-
- // Some Context instances do stuff which can fail now. If that
- // happens this handler is marked as failed.
- context.notifyStatement(parent.getContext());
- }
- catch (AssemblyException ae)
- {
- // notifies that an exception was thrown in this handler's Context
- Throwable t = ae.getCause();
-
- if (t instanceof Exception)
- exceptionListener.exceptionThrown((Exception) t);
- else
- throw (InternalError) new InternalError("Severe problem while decoding XML data.")
- .initCause(t);
-
- // marks the handler as failed
- notifyContextFailed();
- }
- }
-
- /** Marks this and any depending parent handlers as failed. Which means that on their end
- * no result is calculated.
- *
- * When a handler has failed no more handlers are accepted within it.
- */
- public final void notifyContextFailed()
- {
- hasFailed = true;
-
- // marks the parent handler as failed if its Context
- // is affected by the failure of this handler's Context
- if (parent.getContext().subContextFailed())
- parent.notifyContextFailed();
- }
-
- /** Returns whether this handler has failed.
- *
- * This is used to skip child elements.
- *
- * @return Whether this handler has failed.
- */
- public final boolean hasFailed()
- {
- return hasFailed;
- }
-
- /** Processes the character data when the element ends.
- *
- * The default implementation does nothing for convenience.
- *
- * @param characters
- * @throws AssemblerException
- */
- protected void endElement(String characters) throws AssemblyException
- {
- // XXX: throw an exception when unexpected character data is available?
- }
-
- /** Adds characters from the body of the XML tag to the buffer.
- *
- * @param ch
- * @param start
- * @param length
- * @throws SAXException
- */
- public final void characters(char[] ch, int start, int length)
- {
- // simply appends character data
- buffer.append(ch, start, length);
- }
-
- /** Stores an object globally under a unique id. If the id is
- * null the object is not stored.
- *
- * @param objectId
- * @param o
- */
- public void putObject(String objectId, Object o)
- {
- if (objectId != null)
- parent.putObject(objectId, o);
- }
-
- /** Returns a previously stored object. If the id is null the
- * result is null, too.
- *
- * @param objectId
- * @return Returns a previously stored object or null.
- */
- public Object getObject(String objectId) throws AssemblyException
- {
- return objectId == null ? null : parent.getObject(objectId);
- }
-
- /** Returns the Class instance as if called Class.forName() but
- * uses a ClassLoader given by the user.
- *
- * @param className
- * @return
- * @throws ClassNotFoundException
- */
- public Class instantiateClass(String className)
- throws ClassNotFoundException
- {
- return parent.instantiateClass(className);
- }
-
- public final boolean isSubelementAllowed(String subElementName)
- {
- return allowsSubelements && ! subElementName.equals("java");
- }
-
- public final Context getContext()
- {
- return context;
- }
-
- public final ElementHandler getParent()
- {
- return parent;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/AbstractObjectContext.java b/libjava/gnu/java/beans/decoder/AbstractObjectContext.java
deleted file mode 100644
index 202c33b3413..00000000000
--- a/libjava/gnu/java/beans/decoder/AbstractObjectContext.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/* gnu.java.beans.decoder.AbstractObjectContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/** AbstractObjectContext is the base for all Context implementations which
- * create or provide a result object during their lifetime.
- *
- * <p>This class provides the implementation for an indexed get and set method.
- * But this does not mean that the result object supports these operation.</p>
- *
- * @author Robert Schuster
- *
- */
-abstract class AbstractObjectContext extends AbstractContext
-{
- protected Object object;
-
- AbstractObjectContext()
- {}
-
- /** Sets the result object of the Context.
- *
- * @param obj The result object to be set.
- */
- protected final void setObject(Object obj)
- {
- object = obj;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#set(int, java.lang.Object)
- */
- public final void set(int index, Object o) throws AssemblyException
- {
- try
- {
- Method method =
- object.getClass().getMethod(
- "set",
- new Class[] { Integer.TYPE, Object.class });
-
- method.invoke(object, new Object[] { new Integer(index), o });
- }
- catch (NoSuchMethodException nsme)
- {
- throw new AssemblyException(nsme);
- }
- catch (InvocationTargetException ite)
- {
- throw new AssemblyException(ite.getCause());
- }
- catch (IllegalAccessException iae)
- {
- throw new AssemblyException(iae);
- }
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#get(int)
- */
- public final Object get(int index) throws AssemblyException
- {
- try
- {
- Method method =
- object.getClass().getMethod(
- "get",
- new Class[] { Integer.TYPE });
-
- return method.invoke(object, new Object[] { new Integer(index)});
- }
- catch (NoSuchMethodException nsme)
- {
- throw new AssemblyException(nsme);
- }
- catch (InvocationTargetException ite)
- {
- throw new AssemblyException(ite.getCause());
- }
- catch (IllegalAccessException iae)
- {
- throw new AssemblyException(iae);
- }
- }
-
- public final Object getResult()
- {
- return object;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/ArrayContext.java b/libjava/gnu/java/beans/decoder/ArrayContext.java
deleted file mode 100644
index cf4267f2779..00000000000
--- a/libjava/gnu/java/beans/decoder/ArrayContext.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/* gnu.java.beans.decoder.ArrayContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.lang.reflect.Array;
-
-/** A Context implementation for a fixed size array. The array
- * elements have to be set using IndexContext instances.
- *
- * @author Robert Schuster
- */
-class ArrayContext extends AbstractContext
-{
- private Object array;
-
- ArrayContext(String id, Class klass, int length)
- {
- setId(id);
- array = Array.newInstance(klass, length);
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#addObject(java.lang.Object)
- */
- public void addParameterObject(Object o) throws AssemblyException
- {
- throw new AssemblyException(new IllegalStateException("Adding objects without an index to a fixed array is not possible."));
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#reportStatement()
- */
- public void notifyStatement(Context outerContext)
- {
- // method call intentionally ignored because there is not any useful effect
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#endContext(gnu.java.beans.decoder.Context)
- */
- public Object endContext(Context outerContext) throws AssemblyException
- {
- return array;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#subContextFailed()
- */
- public boolean subContextFailed()
- {
- // returns false to indicate that assembling the array does not fail only because
- // a subelement failed.
- return false;
- }
-
- public void set(int index, Object o) throws AssemblyException
- {
- try
- {
- Array.set(array, index, o);
- }
- catch (ArrayIndexOutOfBoundsException aioobe)
- {
- throw new AssemblyException(aioobe);
- }
- }
-
- public Object get(int index) throws AssemblyException
- {
- try
- {
- return Array.get(array, index);
- }
- catch (ArrayIndexOutOfBoundsException aioobe)
- {
- throw new AssemblyException(aioobe);
- }
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#getResult()
- */
- public Object getResult()
- {
- return array;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/ArrayHandler.java b/libjava/gnu/java/beans/decoder/ArrayHandler.java
deleted file mode 100644
index 23f0285192b..00000000000
--- a/libjava/gnu/java/beans/decoder/ArrayHandler.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/* gnu.java.beans.decoder.ArrayHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.ExceptionListener;
-import java.util.HashMap;
-
-import org.xml.sax.Attributes;
-
-/** ArrayHandler processes the &lt;array&gt; tag. Depending on the existance of the 'length' attribute a Context for
- * a fixed-size or growable array is created.
- *
- * @author Robert Schuster
- */
-class ArrayHandler extends AbstractElementHandler
-{
- /** Contains a mapping between a textual description of a primitive type (like "byte") and
- * its corresponding wrapper class. This allows it to easily construct Array objects for
- * primitive data types.
- */
- private static HashMap typeMap = new HashMap();
-
- static
- {
- typeMap.put("byte", Byte.TYPE);
- typeMap.put("short", Short.TYPE);
- typeMap.put("int", Integer.TYPE);
- typeMap.put("long", Long.TYPE);
-
- typeMap.put("float", Float.TYPE);
- typeMap.put("double", Double.TYPE);
-
- typeMap.put("boolean", Boolean.TYPE);
-
- typeMap.put("char", Character.TYPE);
- }
-
- /**
- * @param PersistenceParser
- */
- ArrayHandler(ElementHandler parent)
- {
- super(parent, true);
- }
-
- protected Context startElement(Attributes attributes, ExceptionListener exceptionListener)
- throws AssemblyException, AssemblyException
- {
- String id = attributes.getValue("id");
- String className = attributes.getValue("class");
-
- if (className != null)
- {
- try
- {
- Class klass;
-
- if (typeMap.containsKey(className))
- klass = (Class) typeMap.get(className);
- else
- klass = instantiateClass(className);
-
- String length = attributes.getValue("length");
- if (length != null)
- // creates Array with predefined length
- return new ArrayContext(id, klass, Integer.parseInt(length));
- else
- // creates Array without length restriction
- return new GrowableArrayContext(id, klass);
- }
- catch (ClassNotFoundException cnfe)
- {
- throw new AssemblyException(cnfe);
- }
- catch (NumberFormatException nfe)
- {
- throw new AssemblyException(nfe);
- }
- }
-
- throw new AssemblyException(new IllegalArgumentException("Missing 'class' attribute in <array> tag."));
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/AssemblyException.java b/libjava/gnu/java/beans/decoder/AssemblyException.java
deleted file mode 100644
index 29dfa65ac7c..00000000000
--- a/libjava/gnu/java/beans/decoder/AssemblyException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* gnu.java.beans.decoder.AssemblyException
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** The AssemblyException is used to wrap the cause of problems when assembling objects.
- * In all cases only the wrapped exception is given to the PersistenceParser's
- * ExceptionListener instance (never the AssemblyException itself).
- *
- * <p>Note: Often multiple steps are needed to construct a fully usuable object instance.
- * Such a construction can be called assembly and thats why this exception was
- * named AssemblyException.</p>
- *
- * @author Robert Schuster
- */
-class AssemblyException extends Exception
-{
- AssemblyException(Throwable cause)
- {
- super(cause);
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/BooleanHandler.java b/libjava/gnu/java/beans/decoder/BooleanHandler.java
deleted file mode 100644
index a34fe346e0f..00000000000
--- a/libjava/gnu/java/beans/decoder/BooleanHandler.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* gnu.java.beans.decoder.BooleanHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** Creates a Boolean instance from the character data in a &lt;boolean&gt; tag.
- *
- * @author Robert Schuster
- */
-class BooleanHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- BooleanHandler(ElementHandler parent)
- {
- super(parent);
-
- // TODO Auto-generated constructor stub
- }
-
- protected Object parse(String number) throws AssemblyException
- {
- if (number.equals("true"))
- return new Boolean(true);
-
- if (number.equals("false"))
- return new Boolean(false);
-
- throw new AssemblyException(new IllegalArgumentException("Element contained no valid boolean value."));
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/ByteHandler.java b/libjava/gnu/java/beans/decoder/ByteHandler.java
deleted file mode 100644
index d6c33d14d21..00000000000
--- a/libjava/gnu/java/beans/decoder/ByteHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* gnu.java.beans.decoder.ByteHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** Creates a Byte instance from the character data in a &lt;byte&gt; tag.
- *
- * @author Robert Schuster
- */
-class ByteHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- ByteHandler(ElementHandler parent)
- {
- super(parent);
- }
-
- protected Object parse(String number) throws NumberFormatException
- {
- return Byte.valueOf(number);
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/CharHandler.java b/libjava/gnu/java/beans/decoder/CharHandler.java
deleted file mode 100644
index 1b31e5b0559..00000000000
--- a/libjava/gnu/java/beans/decoder/CharHandler.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* gnu.java.beans.decoder.CharHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** Creates a Character instance from the character data in a &lt;char&gt; tag.
- *
- * @author Robert Schuster
- */
-class CharHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- CharHandler(ElementHandler parent)
- {
- super(parent);
- }
-
- protected Object parse(String number) throws AssemblyException
- {
- if (number.length() > 1)
- throw new AssemblyException(new IllegalArgumentException("Element contained no valid character."));
-
- return new Character(number.charAt(0));
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/ClassHandler.java b/libjava/gnu/java/beans/decoder/ClassHandler.java
deleted file mode 100644
index 1dbdd63e79a..00000000000
--- a/libjava/gnu/java/beans/decoder/ClassHandler.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* gnu.java.beans.decoder.ClassHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** Creates a Class instance from the character data in a &lt;class&gt; tag.
- *
- * @author Robert Schuster
- */
-class ClassHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- ClassHandler(ElementHandler parent)
- {
- super(parent);
- }
-
- protected Object parse(String characters) throws AssemblyException
- {
- try
- {
- return instantiateClass(characters);
- }
- catch (ClassNotFoundException cnfe)
- {
- throw new AssemblyException(cnfe);
- }
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/ConstructorContext.java b/libjava/gnu/java/beans/decoder/ConstructorContext.java
deleted file mode 100644
index 7838fb7e263..00000000000
--- a/libjava/gnu/java/beans/decoder/ConstructorContext.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* gnu.java.beans.decoder.ConstructorContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-
-/** A ConstructorContext is a {@link Context} implementation which collects the parameters for a constructor
- * call and instantiates the result object using that constructor. After that sub-contexts can invoke
- * methods on the result object.
- *
- * <p>The constructor is invoked when a sub-context is a statement or the Context ends.</p>
- *
- * @author Robert Schuster
- */
-class ConstructorContext extends AbstractCreatableObjectContext
-{
- private ArrayList arguments = new ArrayList();
- private Class klass;
-
- ConstructorContext(String id, Class newClass)
- {
- setId(id);
- // sets superclass field
- klass = newClass;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#addObject(java.lang.Object)
- */
- protected void addParameterObjectImpl(Object o)
- {
- arguments.add(o);
- }
-
- protected Object createObject(Context outerContext)
- throws AssemblyException
- {
- Object[] args = arguments.toArray();
-
- try
- {
- Constructor constructor = MethodFinder.getConstructor(klass, args);
-
- // instantiates object (klass field gets re-set by superclass)
- return constructor.newInstance(args);
- }
- catch (NoSuchMethodException nsme)
- {
- throw new AssemblyException(nsme);
- }
- catch (InvocationTargetException ite)
- {
- throw new AssemblyException(ite.getCause());
- }
- catch (IllegalAccessException iae)
- {
- throw new AssemblyException(iae);
- }
- catch (InstantiationException ie)
- {
- throw new AssemblyException(ie);
- }
- }
-
-}
diff --git a/libjava/gnu/java/beans/decoder/Context.java b/libjava/gnu/java/beans/decoder/Context.java
deleted file mode 100644
index a2db09732d1..00000000000
--- a/libjava/gnu/java/beans/decoder/Context.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* gnu.java.beans.decoder.Context
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-/** A Context is the environment for an object which is being assembler. If there
- * are no errors each handler creates one Context.
- * <p>Depending on the result of isStatement() a Context can be statement or an
- * expression. An expression returns a value to the Context of its parent handler,
- * a statement does not. Whenever a Context is a statement the parent handler's
- * Context is informed about that through the {@link notifyStatement}-method.</p>
- *
- * @author Robert Schuster
- */
-interface Context
-{
- /** Adds a parameter object to the context. This method is used when
- * sub-Contexts return their result.
- *
- * Some Contexts do not accept more than a certain amount of objects
- * and throw an AssemblerException if the amount is exceeded.
- *
- * @param o The object added to this context.
- */
- void addParameterObject(Object o) throws AssemblyException;
-
- /** Notifies that the next element is a statement. This can mean
- * that an argument list is complete to be called.
- *
- */
- void notifyStatement(Context outerContext) throws AssemblyException;
-
- /** Notifies that the context ends and the returns the appropriate result
- * object.
- *
- * @param outerContext
- * @return
- */
- Object endContext(Context outerContext) throws AssemblyException;
-
- /** Notifies that the assembly of a subcontext failed and returns
- * whether this Context is affected in a way that it fails too.
- *
- * @return Whether the failure of a subcontext lets this context fail, too.
- */
- boolean subContextFailed();
-
- /** Calls an appropriate indexed set method if it is available or
- * throws an AssemblerException if that is not allowed on this Context.
- *
- * The behaviour of this method is equal to List.set(int, Object).
- *
- * @param index Index position to be set.
- * @param o Object to be set at the given index position.
- * @throws AssemblerException Indexed set is not allowed or otherwise failed.
- */
- void set(int index, Object o) throws AssemblyException;
-
- /** Calls an appropriate indexed get method if it is available or
- * throws an AssemblerException if that is not allowed on this Context.
- *
- * The behaviour of this method is equal to List.get(int).
- *
- * @param index Index position of the object return.
- * @throws AssemblerException Indexed get is not allowed or otherwise failed.
- */
- Object get(int index) throws AssemblyException;
-
- /** Returns the result which was calculated by calling endContext() or reportStatement().
- * Its the handler's responsibility to care that any of these two methods was called.
- *
- * This is used by sub-Contexts to access this Context's result.
- *
- * @return
- */
- Object getResult();
-
- /** Gives this Context a unique id. For convenience the id may be null which means
- * that no id exists at all.
- *
- * @param id
- */
- void setId(String id);
-
- /** Returns this Context's unique id or null if does not have such an id.
- *
- * @return This Context's id or null.
- */
- String getId();
-
- /** Returns whether this Context is a statement (not returning result back
- * to parent handler's Context) or not (= expression).
- *
- * @return
- */
- boolean isStatement();
-
- /** Sets whether this Context is a statement or not.
- *
- * @param b
- */
- void setStatement(boolean b);
-}
diff --git a/libjava/gnu/java/beans/decoder/DecoderContext.java b/libjava/gnu/java/beans/decoder/DecoderContext.java
deleted file mode 100644
index 69d84e57656..00000000000
--- a/libjava/gnu/java/beans/decoder/DecoderContext.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/* gnu.java.beans.decoder.DecoderContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.XMLDecoder;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/** DecoderContext is a Context implementation which allows access to
- * the XMLDecoder instance itself. This is used for the &lt;java&gt; tag.
- *
- * @author Robert Schuster
- */
-public class DecoderContext extends AbstractContext
-{
- private XMLDecoder decoder;
-
- public DecoderContext(XMLDecoder xmlDecoder)
- {
- decoder = xmlDecoder;
- }
-
- private ArrayList objects = new ArrayList();
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#addObject(java.lang.Object)
- */
- public void addParameterObject(Object o) throws AssemblyException
- {
- objects.add(o);
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#reportStatement()
- */
- public void notifyStatement(Context outerContext) throws AssemblyException
- {
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#endContext(gnu.java.beans.decoder.Context)
- */
- public Object endContext(Context outerContext) throws AssemblyException
- {
- return decoder;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#subContextFailed()
- */
- public boolean subContextFailed()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#set(int, java.lang.Object)
- */
- public void set(int index, Object o) throws AssemblyException
- {
- throw new AssemblyException(new IllegalArgumentException("Set method is not allowed in decoder context."));
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#get(int)
- */
- public Object get(int index) throws AssemblyException
- {
- throw new AssemblyException(new IllegalArgumentException("Get method is not allowed in decoder context."));
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#getResult()
- */
- public Object getResult()
- {
- return decoder;
- }
-
- /** Returns an Iterator that retrieves the assembled objects.
- *
- * @return An Iterator retrieving assembled objects.
- */
- public Iterator iterator()
- {
- return objects.iterator();
- }
-
-}
diff --git a/libjava/gnu/java/beans/decoder/DefaultExceptionListener.java b/libjava/gnu/java/beans/decoder/DefaultExceptionListener.java
deleted file mode 100644
index 71e7158e7d2..00000000000
--- a/libjava/gnu/java/beans/decoder/DefaultExceptionListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* gnu.java.beans.DefaultExceptionListener
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.ExceptionListener;
-
-/** The DefaultExceptionListener is the default implementation of the ExceptionListener
- * interface. An instance of this class is used whenever the user provided no
- * ExceptionListener instance on its own.
- *
- * <p>The implementation just writes the exception's message to <code>System.err</code>.</p>
- *
- * @author Robert Schuster
- */
-public class DefaultExceptionListener implements ExceptionListener
-{
- public void exceptionThrown(Exception e)
- {
- System.err.println("non-critical exception: " + e + " - message: "
- + e.getMessage());
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/DoubleHandler.java b/libjava/gnu/java/beans/decoder/DoubleHandler.java
deleted file mode 100644
index 8f6be7ec092..00000000000
--- a/libjava/gnu/java/beans/decoder/DoubleHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* gnu.java.beans.decoder.DoubleHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** Creates a Double instance from the character data in a &lt;double&gt; tag.
- *
- * @author Robert Schuster
- */
-class DoubleHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- DoubleHandler(ElementHandler parent)
- {
- super(parent);
- }
-
- protected Object parse(String number) throws NumberFormatException
- {
- return Double.valueOf(number);
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/DummyContext.java b/libjava/gnu/java/beans/decoder/DummyContext.java
deleted file mode 100644
index f3b24549de2..00000000000
--- a/libjava/gnu/java/beans/decoder/DummyContext.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/* gnu.java.beans.decoder.DummyContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-/** The DummyContext is used as the Context implementation for the DummyHandler. It
- * just prevents having a null-reference.
- *
- * <p>When the implementation is correct none of this class' methods
- * (except <code>notifyStatement()</code>) is called.</p>
- *
- * @author Robert Schuster
- */
-public class DummyContext extends AbstractContext
-{
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#addObject(java.lang.Object)
- */
- public void addParameterObject(Object o) throws AssemblyException
- {
- fail();
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#reportStatement()
- */
- public void notifyStatement(Context outerContext) throws AssemblyException
- {
- // intentionally ignored
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#endContext(gnu.java.beans.decoder.Context)
- */
- public Object endContext(Context outerContext) throws AssemblyException
- {
- fail();
- return null;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#subContextFailed()
- */
- public boolean subContextFailed()
- {
- fail();
- return false;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#set(int, java.lang.Object)
- */
- public void set(int index, Object o) throws AssemblyException
- {
- fail();
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#get(int)
- */
- public Object get(int index) throws AssemblyException
- {
- fail();
- return null;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#getResult()
- */
- public Object getResult()
- {
- fail();
- return null;
- }
-
- private void fail()
- {
- throw new InternalError("Invoking the DummyContext is not expected"
- + " - Please file a bug report at"
- + " http://www/gnu.org/software/classpath/.");
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/DummyHandler.java b/libjava/gnu/java/beans/decoder/DummyHandler.java
deleted file mode 100644
index 880d76adc0e..00000000000
--- a/libjava/gnu/java/beans/decoder/DummyHandler.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* gnu.java.beans.decoder.DummyHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.ExceptionListener;
-
-import org.xml.sax.Attributes;
-
-/** An ElementHandler implementation that is used as an artificial root
- * element. This avoids having to check for a null element.
- *
- * @author Robert Schuster
- */
-class DummyHandler implements ElementHandler
-{
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#start(org.xml.sax.Attributes, java.beans.ExceptionListener)
- */
- public void start(
- Attributes attributes,
- ExceptionListener exceptionListener)
- {
- fail();
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#end(java.beans.ExceptionListener)
- */
- public void end(ExceptionListener exceptionListener)
- {
- fail();
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#characters(char[], int, int)
- */
- public void characters(char[] ch, int start, int length)
- {
- fail();
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#isSubelementAllowed(java.lang.String)
- */
- public boolean isSubelementAllowed(String subElementName)
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#instantiateClass(java.lang.String)
- */
- public Class instantiateClass(String className)
- throws ClassNotFoundException
- {
- fail();
- return null;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#reportStatement(java.beans.ExceptionListener)
- */
- public void notifyStatement(ExceptionListener exceptionListener)
- {
- // ignore
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#hasFailed()
- */
- public boolean hasFailed()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#getContext()
- */
- public Context getContext()
- {
- return new DummyContext();
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#contextFailed()
- */
- public void notifyContextFailed()
- {
- fail();
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#putObject(java.lang.String, java.lang.Object)
- */
- public void putObject(String objectId, Object o)
- {
- fail();
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.ElementHandler#getObject(java.lang.String)
- */
- public Object getObject(String objectId)
- {
- fail();
- return null;
- }
-
- public ElementHandler getParent()
- {
- fail();
- return null;
- }
-
- private void fail()
- {
- throw new InternalError("Invoking the DummyHandler is not expected"
- + " - Please file a bug report at "
- + " http://www.gnu.org/software/classpath/.");
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/ElementHandler.java b/libjava/gnu/java/beans/decoder/ElementHandler.java
deleted file mode 100644
index e6ae60af886..00000000000
--- a/libjava/gnu/java/beans/decoder/ElementHandler.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* gnu.java.beans.decoder.ElementHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.ExceptionListener;
-
-import org.xml.sax.Attributes;
-
-/** ElementHandler manages a Context instance and interacts with
- * its parent and child handlers.
- *
- * @author Robert Schuster
- */
-interface ElementHandler
-{
- /** Evaluates the attributes and creates a Context instance.
- * If the creation of the Context instance fails the ElementHandler
- * is marked as failed which may affect the parent handler other.
- *
- * @param attributes Attributes of the XML tag.
- */
- void start(Attributes attributes, ExceptionListener exceptionListener);
-
- /** Post-processes the Context.
- */
- void end(ExceptionListener exceptionListener);
-
- /** Adds characters from the body of the XML tag to the buffer.
- *
- * @param ch
- * @param start
- * @param length
- * @throws SAXException
- */
- void characters(char[] ch, int start, int length);
-
- /** Returns whether a subelement of the given name is allowed. The rules
- * for evaluating this are derived from the javabeans.dtd which can be found
- * here: <a href="http://java.sun.com/products/jfc/tsc/articles/persistence3">Java Persistence Article</a>.
- *
- * @param subElementName
- * @return
- */
- boolean isSubelementAllowed(String subElementName);
-
- /** Provides the same functionality as Class.forName() but allows the decoder
- * to use a different class loader.
- *
- * @param className
- * @return
- * @throws ClassNotFoundException
- */
- Class instantiateClass(String className) throws ClassNotFoundException;
-
- /** Notifies the handler's Context that its child Context will not return
- * a value back. Some Context variants need this information to know when
- * a method or a constructor call can be made.
- *
- * This method is called by a child handler.
- */
- void notifyStatement(ExceptionListener exceptionListener);
-
- /** Returns whether this handler has failed.
- *
- * This is used to skip child elements.
- *
- * @return Whether this handler has failed.
- */
- boolean hasFailed();
-
- /** Returns the Context instance this handler is working on.
- *
- * @return The handler's Context instance.
- */
- Context getContext();
-
- /** Notifies the handler that its Context failed and starts a recursive
- * invocation of the parent handler if it is affected by that failure.
- *
- * Although the method is a public API member it is only used internally.
- */
- void notifyContextFailed();
-
- /** Stores the object under the given id. The object is not stored if the
- * id is null.
- *
- * @param objectId
- * @param o
- */
- void putObject(String objectId, Object o);
-
- Object getObject(String objectId) throws AssemblyException;
-
- ElementHandler getParent();
-}
diff --git a/libjava/gnu/java/beans/decoder/FloatHandler.java b/libjava/gnu/java/beans/decoder/FloatHandler.java
deleted file mode 100644
index 5f0e15cefed..00000000000
--- a/libjava/gnu/java/beans/decoder/FloatHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* gnu.java.beans.decoder.FloatHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** Creates a Float instance from the character data in a &lt;float&gt; tag.
- *
- * @author Robert Schuster
- */
-class FloatHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- FloatHandler(ElementHandler parent)
- {
- super(parent);
- }
-
- protected Object parse(String number) throws NumberFormatException
- {
- return Float.valueOf(number);
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/GrowableArrayContext.java b/libjava/gnu/java/beans/decoder/GrowableArrayContext.java
deleted file mode 100644
index f24a60b4a4b..00000000000
--- a/libjava/gnu/java/beans/decoder/GrowableArrayContext.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* gnu.java.beans.decoder.GrowableArrayContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.lang.reflect.Array;
-
-/** A Context implementation for a growable array. The array
- * elements have to be set using expressions.
- *
- * @author Robert Schuster
- */
-class GrowableArrayContext extends AbstractContext
-{
- private static final int INITIAL_SIZE = 16;
-
- private Class klass;
- private Object array;
- private int length;
-
- GrowableArrayContext(String id, Class newClass)
- {
- setId(id);
- klass = newClass;
- array = Array.newInstance(klass, INITIAL_SIZE);
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#addObject(java.lang.Object)
- */
- public void addParameterObject(Object o) throws AssemblyException
- {
- if (length == Array.getLength(array))
- {
- Object tmp = Array.newInstance(klass, length * 2);
- System.arraycopy(array, 0, tmp, 0, length);
- array = tmp;
- }
-
- try {
- Array.set(array, length++, o);
- } catch(IllegalArgumentException iae) {
- throw new AssemblyException(iae);
- }
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#reportStatement()
- */
- public void notifyStatement(Context outerContext) throws AssemblyException
- {
- throw new AssemblyException(
- new IllegalArgumentException("Statements inside a growable array are not allowed."));
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#endContext(gnu.java.beans.decoder.Context)
- */
- public Object endContext(Context outerContext) throws AssemblyException
- {
- if (length != Array.getLength(array))
- {
- Object tmp = Array.newInstance(klass, length);
- System.arraycopy(array, 0, tmp, 0, length);
- array = tmp;
- }
-
- return array;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#subContextFailed()
- */
- public boolean subContextFailed()
- {
- // returns false to indicate that assembling the array does not fail only because
- // a subelement failed
- return false;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#set(int, java.lang.Object)
- */
- public void set(int index, Object o) throws AssemblyException
- {
- try {
- Array.set(array, index, o);
- } catch(IllegalArgumentException iae) {
- throw new AssemblyException(iae);
- }
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#get(int)
- */
- public Object get(int index) throws AssemblyException
- {
- return Array.get(array, index);
- }
-
- public Object getResult()
- {
- return array;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/IndexContext.java b/libjava/gnu/java/beans/decoder/IndexContext.java
deleted file mode 100644
index 11f840caeec..00000000000
--- a/libjava/gnu/java/beans/decoder/IndexContext.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* gnu.java.beans.decoder.IndexContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-/** IndexContext is Context implementation that senses whether it is an indexed get or set
- * operation and invokes this operation.
- *
- * <p>An IndexContent is a get operation when no argument is provided and a set operation if one
- * argument is provided.</p>
- *
- * @author Robert Schuster
- */
-class IndexContext extends AbstractContext
-{
- private Object result;
- private Object argument;
- private int index;
- private boolean isSetter;
-
- IndexContext(String id, int newIndex)
- {
- setId(id);
- index = newIndex;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#addObject(java.lang.Object)
- */
- public void addParameterObject(Object o) throws AssemblyException
- {
- if (! isSetter)
- {
- argument = o;
- isSetter = true;
- }
- else
- throw new AssemblyException(new IllegalStateException("More than one argument for indiced access is not possible."));
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#reportStatement()
- */
- public void notifyStatement(Context outerContext) throws AssemblyException
- {
- throw new AssemblyException(new IllegalStateException("Statements inside indiced access are not allowed."));
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#endContext(gnu.java.beans.decoder.Context)
- */
- public Object endContext(Context outerContext) throws AssemblyException
- {
- if (isSetter)
- {
- // setter
- outerContext.set(index, argument);
-
- return null;
- }
- else
- // getter
- return result = outerContext.get(index);
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#subContextFailed()
- */
- public boolean subContextFailed()
- {
- // returns true to indicate that indiced access assembly fails when one of its
- // argument could not be assembled
- return true;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#set(int, java.lang.Object)
- */
- public void set(int index, Object o) throws AssemblyException
- {
- throw new AssemblyException(new IllegalStateException("Setter is not allowed inside indiced access."));
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#get(int)
- */
- public Object get(int index) throws AssemblyException
- {
- throw new AssemblyException(new IllegalStateException("getter is not allowed insided indiced access."));
- }
-
- public Object getResult()
- {
- return result;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/IntHandler.java b/libjava/gnu/java/beans/decoder/IntHandler.java
deleted file mode 100644
index a96f4a0315b..00000000000
--- a/libjava/gnu/java/beans/decoder/IntHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* gnu.java.beans.decoder.IntHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** Creates a Integer instance from the character data in a &lt;int&gt; tag.
- *
- * @author Robert Schuster
- */
-class IntHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- IntHandler(ElementHandler parent)
- {
- super(parent);
- }
-
- protected Object parse(String number) throws NumberFormatException
- {
- return Integer.valueOf(number);
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/JavaHandler.java b/libjava/gnu/java/beans/decoder/JavaHandler.java
deleted file mode 100644
index 3bc8c60288c..00000000000
--- a/libjava/gnu/java/beans/decoder/JavaHandler.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/* gnu.java.beans.decoder.JavaHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.ExceptionListener;
-import java.util.HashMap;
-
-import org.xml.sax.Attributes;
-
-/** Wraps a DecoderContext instance.
- *
- * @author Robert Schuster
- */
-public class JavaHandler extends AbstractElementHandler
-{
- private Context context;
- private HashMap objectMap = new HashMap();
- private ClassLoader classLoader;
-
- /**
- * @param PersistenceParser
- */
- JavaHandler(DummyHandler parent, Context decoderContext,
- ClassLoader cl)
- {
- super(parent, true);
-
- classLoader = cl;
-
- context = decoderContext;
-
- }
-
- protected Context startElement(Attributes attributes, ExceptionListener exceptionListener)
- throws AssemblyException
- {
- // may expect version and class attribute but it not used in JDK
- // so we do either
- return context;
- }
-
- public Object getObject(String objectId)
- {
- return objectMap.get(objectId);
- }
-
- public void putObject(String objectId, Object o)
- {
- if (objectId != null)
- objectMap.put(objectId, o);
- }
-
- public Class instantiateClass(String className)
- throws ClassNotFoundException
- {
- return Class.forName(className, false, classLoader);
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/LongHandler.java b/libjava/gnu/java/beans/decoder/LongHandler.java
deleted file mode 100644
index d7bfa54e54e..00000000000
--- a/libjava/gnu/java/beans/decoder/LongHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* gnu.java.beans.decoder.LongHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** Creates a Long instance from the character data in a &lt;long&gt; tag.
- *
- * @author Robert Schuster
- */
-class LongHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- LongHandler(ElementHandler parent)
- {
- super(parent);
- }
-
- protected Object parse(String number) throws NumberFormatException
- {
- return Long.valueOf(number);
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/MethodContext.java b/libjava/gnu/java/beans/decoder/MethodContext.java
deleted file mode 100644
index bad0a213f7f..00000000000
--- a/libjava/gnu/java/beans/decoder/MethodContext.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* gnu.java.beans.decoder.MethodContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-
-/** MethodContext collects arguments for a method call and creates the result object
- * using it. The method is called using the result object of the parent Context.
- *
- * <p>When the result object is available methods can be called on it using sub-Contexts.</p>
- *
- * @author Robert Schuster
- */
-class MethodContext extends AbstractCreatableObjectContext
-{
- private ArrayList arguments = new ArrayList();
- private String methodName;
-
- MethodContext(String id, String newMethodName)
- {
- setId(id);
- setStatement(true);
- methodName = newMethodName;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#addObject(java.lang.Object)
- */
- public void addParameterObjectImpl(Object o)
- {
- arguments.add(o);
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#endContext(gnu.java.beans.decoder.Context)
- */
- protected Object createObject(Context outerContext)
- throws AssemblyException
- {
- Object outerObject = outerContext.getResult();
-
- if (outerObject == null)
- throw new AssemblyException(
- new NullPointerException(
- "No object to invoke method " + methodName));
-
- Object[] args = arguments.toArray();
-
- try
- {
- Method method =
- MethodFinder.getMethod(
- outerObject.getClass(),
- methodName,
- args);
- return method.invoke(outerObject, args);
- }
- catch (NoSuchMethodException nsme)
- {
- throw new AssemblyException(nsme);
- }
- catch (InvocationTargetException ite)
- {
- throw new AssemblyException(ite.getCause());
- }
- catch (IllegalAccessException iae)
- {
- throw new AssemblyException(iae);
- }
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/MethodFinder.java b/libjava/gnu/java/beans/decoder/MethodFinder.java
deleted file mode 100644
index 3968b173adb..00000000000
--- a/libjava/gnu/java/beans/decoder/MethodFinder.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/* gnu.java.beans.decoder.MethodFinder
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-
-class MethodFinder
-{
- /** Provides a mapping between a wrapper class and its corresponding primitive's type. */
- private static HashMap typeMapping = new HashMap();
-
- static {
- typeMapping.put(Byte.class, Byte.TYPE);
- typeMapping.put(Short.class, Short.TYPE);
- typeMapping.put(Integer.class, Integer.TYPE);
- typeMapping.put(Long.class, Long.TYPE);
- typeMapping.put(Float.class, Float.TYPE);
- typeMapping.put(Double.class, Double.TYPE);
-
- typeMapping.put(Character.class, Character.TYPE);
- typeMapping.put(Boolean.class, Boolean.TYPE);
- }
-
- private MethodFinder()
- {
- }
-
- /** Searches a Method which can accept the given arguments.
- *
- * @param klass
- * @param name
- * @param arguments
- * @return
- * @throws NoSuchMethodException
- */
- static Method getMethod(Class klass, String name, Object[] arguments)
- throws NoSuchMethodException
- {
- // prepares array containing the types of the arguments
- Class[] argumentTypes = getArgumentTypes(arguments);
-
- Method[] methods = klass.getMethods();
-
- // iterates over all public methods
- for (int i = 0; i < methods.length; i++)
- {
- if (methods[i].getName().equals(name))
- {
- if (matchingArgumentTypes(methods[i].getParameterTypes(),
- argumentTypes))
- return methods[i];
- }
- }
-
- throw new NoSuchMethodException(
- "Could not find a matching method named "
- + name
- + "() in class "
- + klass);
- }
-
- static Constructor getConstructor(Class klass, Object[] arguments)
- throws NoSuchMethodException
- {
- Class[] argumentTypes = getArgumentTypes(arguments);
- Constructor[] constructors = klass.getConstructors();
-
- // iterates over all public methods
- for (int i = 0; i < constructors.length; i++)
- {
- if (matchingArgumentTypes(constructors[i].getParameterTypes(),
- argumentTypes))
- return constructors[i];
- }
-
- throw new NoSuchMethodException(
- "Could not find a matching constructor in class " + klass);
- }
-
- /** Transforms an array of argument objects into an array of argument types.
- * For each argument being null the argument is null, too. An argument type
- * being null means: Accepts everything (although this can be ambigous).
- *
- * @param arguments
- * @return
- */
- private static Class[] getArgumentTypes(Object[] arguments)
- {
- if (arguments == null)
- return new Class[0];
-
- // prepares array containing the types of the arguments
- Class[] argumentTypes = new Class[arguments.length];
- for (int i = 0; i < arguments.length; i++)
- argumentTypes[i] =
- (arguments[i] == null) ? null : arguments[i].getClass();
- return argumentTypes;
- }
-
- /** Tests whether the argument types supplied to the method argument types
- * are assignable. In addition to the assignment specifications this method
- * handles the primitive's wrapper classes as if they were of their
- * primitive type (e.g Boolean.class equals Boolean.TYPE).
- * When a supplied argument type is null it is assumed that no argument
- * object was supplied for it and the test for this particular parameter will
- * pass.
- *
- * @param methodArgTypes
- * @param suppliedArgTypes
- * @return
- */
- private static boolean matchingArgumentTypes(
- Class[] methodArgTypes,
- Class[] suppliedArgTypes)
- {
- if (methodArgTypes.length != suppliedArgTypes.length)
- return false;
-
- for (int i = 0; i < methodArgTypes.length; i++)
- {
- if (suppliedArgTypes[i] == null)
- {
- // by definition a non-existant argument type (null) can be converted to everything
- continue;
- }
- else if (typeMapping.containsKey(suppliedArgTypes[i]))
- {
- Class primitiveType =
- (Class) typeMapping.get(suppliedArgTypes[i]);
- if (!(methodArgTypes[i].isAssignableFrom(suppliedArgTypes[i])
- || methodArgTypes[i].isAssignableFrom(primitiveType)))
- return false;
- }
- else if (!methodArgTypes[i].isAssignableFrom(suppliedArgTypes[i]))
- return false;
- }
-
- return true;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/NullHandler.java b/libjava/gnu/java/beans/decoder/NullHandler.java
deleted file mode 100644
index 549617db3cb..00000000000
--- a/libjava/gnu/java/beans/decoder/NullHandler.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* gnu.java.beans.decoder.NullHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-
-/** Just provides the 'null' object.
- *
- * @author Robert Schuster
- */
-class NullHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- NullHandler(ElementHandler parent)
- {
- super(parent);
- }
-
- protected Object parse(String characters) throws AssemblyException
- {
- if (! characters.equals(""))
- throw new AssemblyException(new IllegalArgumentException("No characters inside <void> tag allowed."));
-
- return null;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/ObjectContext.java b/libjava/gnu/java/beans/decoder/ObjectContext.java
deleted file mode 100644
index cf88a2c2c5c..00000000000
--- a/libjava/gnu/java/beans/decoder/ObjectContext.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* gnu.java.beans.decoder.ObjectHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-/** ObjectContext is a {@link Context} implementation that wraps a simple Object instance.
- * The instance can be provided when the Context is created (due to an 'idref'
- * attribute) or later (eg. &lt;int&gt; tag)
- *
- * <p>The ObjectContext does not accept any parameter object and ignores notifications
- * about sub-contexts being statements.</p>
- *
- * @author Robert Schuster
- */
-final class ObjectContext extends AbstractObjectContext
-{
- ObjectContext(Object newObject)
- {
- setObject(newObject);
- }
-
- ObjectContext(String id, Object newObject)
- {
- setId(id);
- setObject(newObject);
- }
-
- ObjectContext()
- {
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#addObject(java.lang.Object)
- */
- public void addParameterObject(Object o) throws AssemblyException
- {
- throw new AssemblyException(new IllegalArgumentException("Adding objects to an ObjectContext is not allowed."));
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#reportStatement()
- */
- public void notifyStatement(Context outerContext) throws AssemblyException
- {
- // can ignore that
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#endContext(gnu.java.beans.decoder.Context)
- */
- public Object endContext(Context outerContext) throws AssemblyException
- {
- // just returns the object which is encapsuled (may be null)
- return getResult();
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#subContextFailed()
- */
- public boolean subContextFailed()
- {
- // this context will not fail when a subcontext fails because the result is
- // already available when the context is created.
- return false;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/ObjectHandler.java b/libjava/gnu/java/beans/decoder/ObjectHandler.java
deleted file mode 100644
index dc5b3290bb1..00000000000
--- a/libjava/gnu/java/beans/decoder/ObjectHandler.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/* gnu.java.beans.decoder.ObjectHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.ExceptionListener;
-
-import org.xml.sax.Attributes;
-
-/** An ObjectHandler parses the &lt;object&gt; tag and thereby creates various
- * Context implementations.
- *
- * @author Robert Schuster
- *
- */
-public class ObjectHandler extends AbstractElementHandler
-{
- /**
- * XXX: Can all results be stored with an object id?
- *
- *
- * @param PersistenceParser
- */
- ObjectHandler(ElementHandler parent)
- {
- super(parent, true);
- }
-
- protected Context startElement(Attributes attributes, ExceptionListener exceptionListener)
- throws AssemblyException
- {
- String className = attributes.getValue("class");
- String methodName = attributes.getValue("method");
- String fieldName = attributes.getValue("field");
- String index = attributes.getValue("index");
- String propertyName = attributes.getValue("property");
- String id = attributes.getValue("id");
- String idRef = attributes.getValue("idref");
-
- /* first check if we just want to access an existing object (idref present)
- *
- * note: <object idref="foo" method="bar"/> is not valid to call method "bar"
- * on the object with id "foo". Instead this should return the object "foo"
- * itself. The right way to this is:
- * <object idref="foo">
- * <object method="bar"/>
- * </object>
- *
- * This means that if idref is present class, method, field, index and
- * property are obsolete.
- */
- if (idRef != null)
- // reactivates an existing object and giving it another name if id exists
- return new ObjectContext(id, getObject(idRef));
-
- // decides whether we are in a static (className present) or dynamic context
- if (className != null)
- {
- try
- {
- Class klass = instantiateClass(className);
-
- // class name exists which means that we are in a static context.
- // so we may want to ...
- // access a static field if the fieldName exists
- if (fieldName != null)
- {
- try
- {
- return new ObjectContext(id,
- klass.getField(fieldName).get(null));
- }
- catch (NoSuchFieldException nsfe)
- {
- throw new AssemblyException(nsfe);
- }
- catch (IllegalAccessException iae)
- {
- throw new AssemblyException(iae);
- }
- }
-
- // (falling through is important!)
- // run a constructor if methodName is "new" or null
- if (methodName == null || methodName.equals("new"))
- return new ConstructorContext(id, klass);
-
- // (falling through is important!)
- // run a static method on the given class (if methodName exists, which is implied already)
- return new StaticMethodContext(id, klass, methodName);
- // XXX: should fail if unexpected attributes are present?
- }
- catch (ClassNotFoundException cnfe)
- {
- throw new AssemblyException(cnfe);
- }
- }
- else
- {
- // className does not exist which means we are in the context of
- // some object and want to ...
- // access the get(int index) method if index != null
- if (index != null)
- {
- try
- {
- // Note: http://java.sun.com/products/jfc/tsc/articles/persistence3/ says
- // that <void index="4"/> will make up a get()-call. But this is wrong because
- // <void/> tags never return values (to the surrounding context)
- return new IndexContext(id, Integer.parseInt(index));
- }
- catch (NumberFormatException nfe)
- {
- throw new AssemblyException(nfe);
- }
- }
-
- // access a method if methodName exists
- if (methodName != null)
- return new MethodContext(id, methodName);
-
- // (falling through is important!)
- // access a property if a propertyName exists
- if (propertyName != null && propertyName.length() > 0)
- // this is reported as an ordinary method access where the propertyName is
- // converted into a 'getter'-method name: convert first character of property name
- // to upper case and prepend 'get'
- // Note: This will be a getter-method because the <object> tag implies that a return
- // value is expected.
- return new PropertyContext(id, propertyName);
- }
-
- throw new AssemblyException(new IllegalArgumentException("Wrong or missing attributes for <object> tag."));
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/PersistenceParser.java b/libjava/gnu/java/beans/decoder/PersistenceParser.java
deleted file mode 100644
index 4eb37abef97..00000000000
--- a/libjava/gnu/java/beans/decoder/PersistenceParser.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/* gnu.java.beans.PersistenceParser
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.ExceptionListener;
-import java.beans.XMLDecoder;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/** The PersistenceParser parses an XML data stream and delegates actions to ElementHandler
- * instances. The parser catches and recovers from all exception which reside from wrong usage
- * of attributes and tags.
- *
- * @author Robert Schuster
- */
-public class PersistenceParser extends DefaultHandler implements Context
-{
- /** The ExceptionListener instance which is informed of non-critical parsing exceptions.
- */
- private ExceptionListener exceptionListener;
-
- /** When an element was not usable all elements inside it should be skipped.
- * This is done by skipping startElement() and endElement() invocations whenever
- * this value is above 0.
- */
- private int skipElement;
-
- /** Stores the Creator instances which can instantiate the appropriate handler implementation
- * for a given element.
- */
- private HashMap handlerCreators = new HashMap();
-
- /** Denotes the current ElementHandler. To avoid checking for null-values it is pre-assigned
- * with a DummyHandler instance which must not be used but acts as a root element.
- */
- private ElementHandler currentHandler;
-
- /** The real root element that stores all objects created during parsing.
- * Package-private to avoid an accessor method.
- */
- JavaHandler javaHandler;
-
- /** Stores the decoded objects. */
- private List objects = new LinkedList();
-
- /** The XMLDecoder instance that started this PersistenceParser */
- private XMLDecoder decoder;
-
- /** Creates a PersistenceParser which reads XML data from the given InputStream, reports
- * exceptions to ExceptionListener instance, stores resulting object in the DecoderContext
- * and uses the given ClassLoader to resolve classes.
- *
- * @param inputStream
- * @param exceptionListener
- * @param decoderContext
- * @param cl
- */
- public PersistenceParser(
- InputStream inputStream,
- ExceptionListener exceptionListener,
- ClassLoader cl,
- XMLDecoder decoder)
- {
-
- this.exceptionListener = exceptionListener;
- this.decoder = decoder;
-
- DummyHandler dummyHandler = new DummyHandler();
- currentHandler = dummyHandler;
- javaHandler = new JavaHandler(dummyHandler, this, cl);
-
- SAXParserFactory factory = SAXParserFactory.newInstance();
-
- SAXParser parser;
- try
- {
- parser = factory.newSAXParser();
- }
- catch (ParserConfigurationException pce)
- {
- // should not happen when a parser is available because we did
- // not request any requirements on the XML parser
- throw (InternalError) new InternalError(
- "No SAX Parser available.").initCause(
- pce);
- }
- catch (SAXException saxe)
- {
- // should not happen when a parser is available because we did
- // not request any requirements on the XML parser
- throw (InternalError) new InternalError(
- "No SAX Parser available.").initCause(
- saxe);
- }
-
- // prepares a map of Creator instances which can instantiate a handler which is
- // appropriate for the tag that is used as a key for the Creator
- handlerCreators.put("java", new JavaHandlerCreator());
-
- // calls methods (properties), constructors, access fields
- handlerCreators.put("object", new ObjectHandlerCreator());
- handlerCreators.put("void", new VoidHandlerCreator());
-
- handlerCreators.put("array", new ArrayHandlerCreator());
-
- // these handler directly create an Object (or null)
- handlerCreators.put("class", new ClassHandlerCreator());
- handlerCreators.put("null", new NullHandlerCreator());
-
- handlerCreators.put("char", new CharHandlerCreator());
- handlerCreators.put("string", new StringHandlerCreator());
- handlerCreators.put("boolean", new BooleanHandlerCreator());
- handlerCreators.put("byte", new ByteHandlerCreator());
- handlerCreators.put("short", new ShortHandlerCreator());
- handlerCreators.put("int", new IntHandlerCreator());
- handlerCreators.put("long", new LongHandlerCreator());
- handlerCreators.put("float", new FloatHandlerCreator());
- handlerCreators.put("double", new DoubleHandlerCreator());
-
- // parses the data and sends all exceptions to the ExceptionListener
- try
- {
- parser.parse(inputStream, this);
- }
- catch (SAXException saxe)
- {
- exceptionListener.exceptionThrown(
- new IllegalArgumentException("XML data not well-formed."));
- }
- catch (IOException ioe)
- {
- exceptionListener.exceptionThrown(ioe);
- }
- }
-
- public void startElement(
- String uri,
- String localName,
- String qName,
- Attributes attributes)
- throws SAXException
- {
- /* The element is skipped if
- * a) the current handler has already failed or a previous error occured
- * which makes all children obsolete
- */
- if (currentHandler.hasFailed() || skipElement > 0)
- {
- exceptionListener.exceptionThrown(
- new IllegalArgumentException(
- "Element unusable due to previous error: " + qName));
-
- skipElement++;
-
- return;
- }
-
- /* b) Subelements are not allowed within the current ElementHandler.
- */
- if (!currentHandler.isSubelementAllowed(qName))
- {
- exceptionListener.exceptionThrown(
- new IllegalArgumentException(
- "Element is not allowed here: " + qName));
-
- skipElement++;
-
- return;
- }
-
- /* c) The tag name is not a key in the map of Creator instances. This means that
- * either the XML data is of a newer version or simply contains a miss-spelled element.
- */
- if (!handlerCreators.containsKey(qName))
- {
- exceptionListener.exceptionThrown(
- new IllegalArgumentException(
- "Element unusable because tag is unknown: " + qName));
-
- skipElement++;
-
- return;
- }
-
- // creates a new handler for the new element
- AbstractElementHandler handler =
- ((Creator) handlerCreators.get(qName)).createHandler(
- currentHandler);
-
- // makes it the current handler to receive character data
- currentHandler = handler;
-
- // starts the handler
- currentHandler.start(attributes, exceptionListener);
- }
-
- public void endElement(String uri, String localName, String qName)
- throws SAXException
- {
- // skips processing the current handler if we are parsing an element
- // which was marked invalid (in startElement() )
- if (skipElement > 0)
- {
- skipElement--;
- return;
- }
-
- // invokes the handler's finishing method
- currentHandler.end(exceptionListener);
-
- // removes the current handler and reactivates its parent
- currentHandler = currentHandler.getParent();
- }
-
- /** Transfers character data to the current handler
- */
- public void characters(char[] ch, int start, int length)
- throws SAXException
- {
- // prevents sending character data of invalid elements
- if (skipElement > 0)
- return;
-
- currentHandler.characters(ch, start, length);
- }
-
- /** Creator interface provided a mechanism to instantiate ElementHandler instances
- * for the appropriate tag.
- *
- * @author Robert Schuster
- */
- interface Creator
- {
- /** Creates an ElementHandler instance using the given ElementHandler as its parent.
- *
- * @param parent The parent ElementHandler of the result.
- * @return A new ElementHandler instance.
- */
- AbstractElementHandler createHandler(ElementHandler parent);
- }
-
- class BooleanHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new BooleanHandler(parent);
- }
- }
-
- class ByteHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new ByteHandler(parent);
- }
- }
-
- class ShortHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new ShortHandler(parent);
- }
- }
-
- class IntHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new IntHandler(parent);
- }
- }
-
- class LongHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new LongHandler(parent);
- }
- }
-
- class FloatHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new FloatHandler(parent);
- }
- }
-
- class DoubleHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new DoubleHandler(parent);
- }
- }
-
- class CharHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new CharHandler(parent);
- }
- }
-
- class StringHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new StringHandler(parent);
- }
- }
-
- class JavaHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return javaHandler;
- }
- }
-
- class ObjectHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new ObjectHandler(parent);
- }
- }
-
- class VoidHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new VoidHandler(parent);
- }
- }
-
- class ClassHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new ClassHandler(parent);
- }
- }
-
- class NullHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new NullHandler(parent);
- }
- }
-
- class ArrayHandlerCreator implements Creator
- {
- public AbstractElementHandler createHandler(ElementHandler parent)
- {
- return new ArrayHandler(parent);
- }
- }
-
- /** Adds a decoded object to the Context. */
- public void addParameterObject(Object o) throws AssemblyException
- {
- objects.add(o);
- }
-
- public void notifyStatement(Context outerContext) throws AssemblyException
- {
- // can be ignored because theis Context does not react to statement and expressions
- // differently
- }
-
- public Object endContext(Context outerContext) throws AssemblyException
- {
- return null;
- }
-
- public boolean subContextFailed()
- {
- // failing of subcontexts is no problem for the mother of all contexts
- return false;
- }
-
- public void set(int index, Object o) throws AssemblyException
- {
- // not supported
- throw new AssemblyException(
- new IllegalArgumentException("Set method is not allowed in decoder context."));
- }
-
- public Object get(int index) throws AssemblyException
- {
- // not supported
- throw new AssemblyException(
- new IllegalArgumentException("Get method is not allowed in decoder context."));
- }
-
- public Object getResult()
- {
- // returns the XMLDecoder instance which is requested by child contexts this way.
- // That is needed to invoke methods on the decoder.
- return decoder;
- }
-
- public void setId(String id)
- {
- exceptionListener.exceptionThrown(new IllegalArgumentException("id attribute is not allowed for <java> tag."));
- }
-
- public String getId()
- {
- // appears to have no id
- return null;
- }
-
- public boolean isStatement()
- {
- // this context is a statement by definition because it never returns anything to a parent because
- // there is no such parent (DummyContext does not count!)
- return true;
- }
-
- public void setStatement(boolean b)
- {
- // ignores that because this Context is always a statement
- }
-
- /** Returns an Iterator instance which returns the decoded objects.
- *
- * This method is used by the XMLDecoder directly.
- */
- public Iterator iterator()
- {
- return objects.iterator();
- }
-
-}
diff --git a/libjava/gnu/java/beans/decoder/PropertyContext.java b/libjava/gnu/java/beans/decoder/PropertyContext.java
deleted file mode 100644
index 838ef814b01..00000000000
--- a/libjava/gnu/java/beans/decoder/PropertyContext.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* gnu.java.beans.decoder.PropertyContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/** PropertyContext is a Context implementation that is very similar to MethodContext
- * and IndexContext. The sole purpose of PropertyContext to find out whether it should
- * 'set' or 'get' a certain property. This decision is made using the number of
- * arguments.
- * <p>When the method call has to be made and there is no argument we 'get' the property.
- * With one argument it is 'set'.</p>
- *
- * @author Robert Schuster
- */
-class PropertyContext extends AbstractObjectContext
-{
- private Object argument;
- private String propertyName;
- private String prefix = "get";
- private boolean methodCalled;
-
- PropertyContext(String id, String newPropertyName)
- {
- setId(id);
- propertyName = newPropertyName;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#addObject(java.lang.Object)
- */
- public void addParameterObject(Object o) throws AssemblyException
- {
- if (methodCalled)
- throw new AssemblyException(new IllegalArgumentException("Cannot add parameter object when method was already called."));
-
- if (argument != null)
- throw new AssemblyException(new IllegalArgumentException("Property attribut allows zero or one argument only."));
-
- argument = o;
- setStatement(true);
- prefix = "set";
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#endContext(gnu.java.beans.decoder.Context)
- */
- public void notifyStatement(Context outerContext) throws AssemblyException
- {
- if (methodCalled)
- return;
- methodCalled = true;
-
- Object outerObject = outerContext.getResult();
-
- if (outerObject == null)
- throw new AssemblyException(new NullPointerException("No object to access property "
- + propertyName));
-
-
- // converts property name into a method name
- String methodName = prefix + propertyName.substring(0, 1).toUpperCase()
- + propertyName.substring(1);
-
- // prepares the argument
- Object[] args = (argument != null) ? new Object[] { argument } : null;
-
- try
- {
- Method method = MethodFinder.getMethod(outerObject.getClass(),
- methodName, args);
-
- // stores the result whether it is available or not
- setObject(method.invoke(outerObject, args));
- }
- catch (NoSuchMethodException nsme)
- {
- throw new AssemblyException(nsme);
- }
- catch (InvocationTargetException ite)
- {
- throw new AssemblyException(ite.getCause());
- }
- catch (IllegalAccessException iae)
- {
- throw new AssemblyException(iae);
- }
- }
-
- public Object endContext(Context outerContext) throws AssemblyException
- {
- notifyStatement(outerContext);
-
- return getResult();
- }
-
- public boolean subContextFailed()
- {
- return ! methodCalled;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/ShortHandler.java b/libjava/gnu/java/beans/decoder/ShortHandler.java
deleted file mode 100644
index ab6ddbece26..00000000000
--- a/libjava/gnu/java/beans/decoder/ShortHandler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* gnu.java.beans.decoder.ShortHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-/** Creates a Short instance from the character data in a &lt;short&gt; tag.
- *
- * @author Robert Schuster
- */
-class ShortHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- ShortHandler(ElementHandler parent)
- {
- super(parent);
- }
-
- protected Object parse(String number) throws NumberFormatException
- {
- return Short.valueOf(number);
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/SimpleHandler.java b/libjava/gnu/java/beans/decoder/SimpleHandler.java
deleted file mode 100644
index bc187e8a052..00000000000
--- a/libjava/gnu/java/beans/decoder/SimpleHandler.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/* gnu.java.beans.decoder.SimpleHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.ExceptionListener;
-
-import org.xml.sax.Attributes;
-
-/** XML element handler that is specialized on tags that contains a simple string in their
- * body which has to be parsed in a specific way.
- * <p>All of these tags have in common that they do not accept attributes. A warning is
- * send to the parser's ExceptionListener when one or more attributes exist.</p>
- *
- * @author Robert Schuster
- */
-abstract class SimpleHandler extends AbstractElementHandler
-{
- private ObjectContext context;
-
- /**
- * @param PersistenceParser
- */
- SimpleHandler(ElementHandler parent)
- {
- super(parent, false);
-
- // SimpleHandler do not accept any subelements
- }
-
- protected final Context startElement(Attributes attributes, ExceptionListener exceptionListener)
- throws AssemblyException
- {
-
- // note: simple elements should not have any attributes. We inform
- // the user of this syntactical but uncritical problem by sending
- // an IllegalArgumentException for each unneccessary attribute
- int size = attributes.getLength();
- for (int i = 0; i < size; i++) {
- String attributeName = attributes.getQName(i);
- Exception e =
- new IllegalArgumentException(
- "Unneccessary attribute '"
- + attributeName
- + "' discarded.");
- exceptionListener.exceptionThrown(e);
- }
-
- return context = new ObjectContext();
- }
-
- public void endElement(String characters)
- throws AssemblyException, AssemblyException
- {
- // reports the number when the character data can be parsed
- try
- {
- context.setObject(parse(characters));
- }
- catch (NumberFormatException nfe)
- {
- throw new AssemblyException(nfe);
- }
- }
-
- /** Returns an object that is created from the given characters. If the string is
- * converted into a number a NumberFormatException is cathed and reported
- * appropriately.
- *
- * @param characters A string of characters that has to be processed in some way.
- * @return An Object instance generated from the given data.
- * @throws AssemblerException When the string was invalid.
- * @throws NumberFormatException When the string could not be parsed into a number.
- */
- protected abstract Object parse(String characters)
- throws AssemblyException, NumberFormatException;
-}
diff --git a/libjava/gnu/java/beans/decoder/StaticMethodContext.java b/libjava/gnu/java/beans/decoder/StaticMethodContext.java
deleted file mode 100644
index 959c949f77b..00000000000
--- a/libjava/gnu/java/beans/decoder/StaticMethodContext.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* gnu.java.beans.decoder.StaticMethodContext
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-
-/**
- * @author Robert Schuster
- */
-class StaticMethodContext extends AbstractCreatableObjectContext
-{
- private ArrayList arguments = new ArrayList();
- private Class klass;
- private String methodName;
-
- StaticMethodContext(String id, Class newClass, String newMethodName)
- {
- setId(id);
- klass = newClass;
- methodName = newMethodName;
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#addObject(java.lang.Object)
- */
- public void addParameterObjectImpl(Object o)
- {
- arguments.add(o);
- }
-
- /* (non-Javadoc)
- * @see gnu.java.beans.decoder.Context#endContext(gnu.java.beans.decoder.Context)
- */
- protected Object createObject(Context outerContext)
- throws AssemblyException
- {
- Object[] args = arguments.toArray();
-
- try
- {
- Method method = MethodFinder.getMethod(klass, methodName, args);
- return method.invoke(null, args);
- }
- catch (NoSuchMethodException nsme)
- {
- throw new AssemblyException(nsme);
- }
- catch (InvocationTargetException ite)
- {
- // rethrows the reason for the InvocationTargetsException (ie. the exception in the called code)
- throw new AssemblyException(ite.getCause());
- }
- catch (IllegalAccessException iae)
- {
- throw new AssemblyException(iae);
- }
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/StringHandler.java b/libjava/gnu/java/beans/decoder/StringHandler.java
deleted file mode 100644
index 6f2311a9e62..00000000000
--- a/libjava/gnu/java/beans/decoder/StringHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* gnu.java.beans.decoder.StringHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-class StringHandler extends SimpleHandler
-{
- /**
- * @param PersistenceParser
- */
- StringHandler(ElementHandler parent)
- {
- super(parent);
- }
-
- protected Object parse(String characters)
- {
- return characters;
- }
-}
diff --git a/libjava/gnu/java/beans/decoder/VoidHandler.java b/libjava/gnu/java/beans/decoder/VoidHandler.java
deleted file mode 100644
index ca3664bbed1..00000000000
--- a/libjava/gnu/java/beans/decoder/VoidHandler.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* gnu.java.beans.decoder.VoidHandler
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.decoder;
-
-import java.beans.ExceptionListener;
-
-import org.xml.sax.Attributes;
-
-public class VoidHandler extends AbstractElementHandler
-{
- /**
- * @param PersistenceParser
- */
- VoidHandler(ElementHandler parent)
- {
- super(parent, true);
- }
-
- protected Context startElement(
- Attributes attributes,
- ExceptionListener exceptionListener)
- throws AssemblyException
- {
- Context ctx = startElementImpl(attributes);
- ctx.setStatement(true);
-
- return ctx;
- }
-
- private Context startElementImpl(Attributes attributes)
- throws AssemblyException
- {
- String id = attributes.getValue("id");
- String className = attributes.getValue("class");
- String methodName = attributes.getValue("method");
- String propertyName = attributes.getValue("property");
- String index = attributes.getValue("index");
-
- if (className != null)
- {
- try
- {
- Class klass = instantiateClass(className);
-
- // class name exists which means that we are in a static context.
- // so we may want to ...
- // run a constructor if methodName is "new" or null
- if (methodName == null || methodName.equals("new"))
- // if the id is null the result cannot be by the decoder accessed but the
- // constructor may have side effects (e.g. registering itself in a global registry)
- return new ConstructorContext(id, klass);
-
- // (falling through is important!)
- // run a static method on the given class (if methodName exists, which is implied already)
- return new StaticMethodContext(id, klass, methodName);
- }
- catch (ClassNotFoundException cnfe)
- {
- throw new AssemblyException(cnfe);
- }
- }
- else
- {
- // className does not exist which means we are in the context of
- // some object and want to ...
- // access an element by index
- if (index != null)
- {
- // note: whether this resolves into get(i) or set(i, o) depends on the
- // number of arguments and is decided by the ObjectAssembler
- try
- {
- return new IndexContext(id, Integer.parseInt(index));
- }
- catch (NumberFormatException nfe)
- {
- throw new AssemblyException(nfe);
- }
- }
-
- // access a method if methodName exists
- if (methodName != null)
- return new MethodContext(id, methodName);
-
- // (falling through is important!)
- // access a property if a propertyName exists
- if (propertyName != null && propertyName.length() > 0)
- // this is reported as an ordinary method invocation where the propertyName is
- // converted into a 'setter'-method name: convert first character of property name
- // to upper case and prepend 'set'
- // Note: This will be a setter-method because the <void> tag implies that no return
- // value is expected (but a side effect)
- return new PropertyContext(id, propertyName);
- }
-
- // if code reaches this point the tag has wrong attributes. The following test
- // does not make it better but can provide are more specific error message for
- // a common mistake: <void> tags are not allowed to have an idref attribute
- throw new AssemblyException(
- new IllegalArgumentException(
- (attributes.getValue("idref") == null)
- ? "Missing attributes for <void> tag"
- : "<void> does not support 'idref' attribute."));
- }
-}
diff --git a/libjava/gnu/java/beans/editors/ColorEditor.java b/libjava/gnu/java/beans/editors/ColorEditor.java
deleted file mode 100644
index b099eb2f0e9..00000000000
--- a/libjava/gnu/java/beans/editors/ColorEditor.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* gnu.java.beans.editors.ColorEditor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.editors;
-
-import java.awt.Color;
-import java.beans.PropertyEditorSupport;
-
-/**
- ** NativeByteEditor is a property editor for the
- ** byte type.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class ColorEditor extends PropertyEditorSupport {
- Color[] stdColors = {Color.black,Color.blue,Color.cyan,
- Color.darkGray,Color.gray,Color.green,
- Color.lightGray,Color.magenta,Color.orange,
- Color.pink,Color.red,Color.white,
- Color.yellow};
- String[] stdColorNames = {"black","blue","cyan",
- "dark gray","gray","green",
- "light gray","magenta","orange",
- "pink","red","white",
- "yellow"};
-
- /** setAsText for Color checks for standard color names
- ** and then checks for a #RRGGBB value or just RRGGBB,
- ** both in hex.
- **/
- public void setAsText(String val) throws IllegalArgumentException {
- if(val.length() == 0) {
- throw new IllegalArgumentException("Tried to set empty value!");
- }
- for(int i=0;i<stdColorNames.length;i++) {
- if(stdColorNames[i].equalsIgnoreCase(val)) {
- setValue(stdColors[i]);
- return;
- }
- }
- if(val.charAt(0) == '#') {
- setValue(new Color(Integer.parseInt(val.substring(1),16)));
- } else {
- setValue(new Color(Integer.parseInt(val,16)));
- }
- }
-
- /** getAsText for Color turns the color into either one of the standard
- ** colors or into an RGB hex value with # prepended. **/
- public String getAsText() {
- for(int i=0;i<stdColors.length;i++) {
- if(stdColors[i].equals(getValue())) {
- return stdColorNames[i];
- }
- }
- return "#" + Integer.toHexString(((Color)getValue()).getRGB() & 0x00FFFFFF);
- }
-
- /** getTags for Color returns a list of standard colors. **/
- public String[] getTags() {
- return stdColorNames;
- }
-}
diff --git a/libjava/gnu/java/beans/editors/FontEditor.java b/libjava/gnu/java/beans/editors/FontEditor.java
deleted file mode 100644
index 904f7bebfbe..00000000000
--- a/libjava/gnu/java/beans/editors/FontEditor.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* gnu.java.beans.editors.FontEditor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.editors;
-
-import java.awt.Font;
-import java.beans.PropertyEditorSupport;
-
-/**
- ** FontEditor is a property editor for java.awt.Font.
- **
- ** <STRONG>To Do:</STRONG> Add custom font chooser
- ** component.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class FontEditor extends PropertyEditorSupport {
- /** setAsText for Font calls Font.decode(). **/
- public void setAsText(String val) throws IllegalArgumentException {
- setValue(Font.decode(val));
- }
-
- /** getAsText for Font returns a value in the format
- ** expected by Font.decode().
- **/
- public String getAsText() {
- Font f = (Font)getValue();
- if(f.isBold()) {
- if(f.isItalic()) {
- return f.getName()+"-bolditalic-"+f.getSize();
- } else {
- return f.getName()+"-bold-"+f.getSize();
- }
- } else if(f.isItalic()) {
- return f.getName()+"-italic-"+f.getSize();
- } else {
- return f.getName()+"-"+f.getSize();
- }
- }
-}
diff --git a/libjava/gnu/java/beans/editors/NativeBooleanEditor.java b/libjava/gnu/java/beans/editors/NativeBooleanEditor.java
deleted file mode 100644
index 3620cc1747a..00000000000
--- a/libjava/gnu/java/beans/editors/NativeBooleanEditor.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* gnu.java.beans.editors.NativeBooleanEditor
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.editors;
-
-import java.beans.PropertyEditorSupport;
-
-/**
- ** NativeBooleanEditor is a property editor for the
- ** boolean type.<P>
- **
- ** <STRONG>To Do:</STRONG> add support for a checkbox
- ** as the custom editor.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class NativeBooleanEditor extends PropertyEditorSupport {
- String[] tags = {"true","false"};
-
- /**
- * setAsText for boolean checks for true or false or t or f.
- * "" also means false.
- **/
- public void setAsText(String val) throws IllegalArgumentException {
- if(val.equalsIgnoreCase("true") || val.equalsIgnoreCase("t")) {
- setValue(Boolean.TRUE);
- } else if(val.equalsIgnoreCase("false") || val.equalsIgnoreCase("f") || val.equals("")) {
- setValue(Boolean.FALSE);
- } else {
- throw new IllegalArgumentException("Value must be true, false, t, f or empty.");
- }
- }
-
-
- /** getAsText for boolean calls Boolean.toString(). **/
- public String getAsText() {
- return getValue().toString();
- }
-}
diff --git a/libjava/gnu/java/beans/editors/NativeByteEditor.java b/libjava/gnu/java/beans/editors/NativeByteEditor.java
deleted file mode 100644
index f3ec5fa1945..00000000000
--- a/libjava/gnu/java/beans/editors/NativeByteEditor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* gnu.java.beans.editors.NativeByteEditor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.editors;
-
-import java.beans.PropertyEditorSupport;
-
-/**
- ** NativeByteEditor is a property editor for the
- ** byte type.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class NativeByteEditor extends PropertyEditorSupport {
- /** setAsText for byte calls Byte.valueOf(). **/
- public void setAsText(String val) throws IllegalArgumentException {
- setValue(Byte.valueOf(val));
- }
-
- /** getAsText for byte calls Byte.toString(). **/
- public String getAsText() {
- return getValue().toString();
- }
-}
diff --git a/libjava/gnu/java/beans/editors/NativeDoubleEditor.java b/libjava/gnu/java/beans/editors/NativeDoubleEditor.java
deleted file mode 100644
index 8d8aae15337..00000000000
--- a/libjava/gnu/java/beans/editors/NativeDoubleEditor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* gnu.java.beans.editors.NativeDoubleEditor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.editors;
-
-import java.beans.PropertyEditorSupport;
-
-/**
- ** NativeDoubleEditor is a property editor for the
- ** double type.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class NativeDoubleEditor extends PropertyEditorSupport {
- /** setAsText for double calls Double.valueOf(). **/
- public void setAsText(String val) throws IllegalArgumentException {
- setValue(Double.valueOf(val));
- }
-
- /** getAsText for double calls Double.toString(). **/
- public String getAsText() {
- return getValue().toString();
- }
-}
diff --git a/libjava/gnu/java/beans/editors/NativeFloatEditor.java b/libjava/gnu/java/beans/editors/NativeFloatEditor.java
deleted file mode 100644
index 801377e7df9..00000000000
--- a/libjava/gnu/java/beans/editors/NativeFloatEditor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* gnu.java.beans.editors.NativeFloatEditor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.editors;
-
-import java.beans.PropertyEditorSupport;
-
-/**
- ** NativeFloatEditor is a property editor for the
- ** float type.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class NativeFloatEditor extends PropertyEditorSupport {
- /** setAsText for float calls Float.valueOf(). **/
- public void setAsText(String val) throws IllegalArgumentException {
- setValue(Float.valueOf(val));
- }
-
- /** getAsText for float calls Float.toString(). **/
- public String getAsText() {
- return getValue().toString();
- }
-}
diff --git a/libjava/gnu/java/beans/editors/NativeIntEditor.java b/libjava/gnu/java/beans/editors/NativeIntEditor.java
deleted file mode 100644
index a6148841c46..00000000000
--- a/libjava/gnu/java/beans/editors/NativeIntEditor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* gnu.java.beans.editors.NativeIntEditor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.editors;
-
-import java.beans.PropertyEditorSupport;
-
-/**
- ** NativeIntEditor is a property editor for the
- ** int type.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class NativeIntEditor extends PropertyEditorSupport {
- /** setAsText for int calls Integer.valueOf(). **/
- public void setAsText(String val) throws IllegalArgumentException {
- setValue(Integer.valueOf(val));
- }
-
- /** getAsText for int calls Integer.toString(). **/
- public String getAsText() {
- return getValue().toString();
- }
-}
diff --git a/libjava/gnu/java/beans/editors/NativeLongEditor.java b/libjava/gnu/java/beans/editors/NativeLongEditor.java
deleted file mode 100644
index 95e9dc87028..00000000000
--- a/libjava/gnu/java/beans/editors/NativeLongEditor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* gnu.java.beans.editors.NativeLongEditor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.editors;
-
-import java.beans.PropertyEditorSupport;
-
-/**
- ** NativeLongEditor is a property editor for the
- ** long type.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class NativeLongEditor extends PropertyEditorSupport {
- /** setAsText for long calls Long.valueOf(). **/
- public void setAsText(String val) throws IllegalArgumentException {
- setValue(Long.valueOf(val));
- }
-
- /** getAsText for long calls Long.toString(). **/
- public String getAsText() {
- return getValue().toString();
- }
-}
diff --git a/libjava/gnu/java/beans/editors/NativeShortEditor.java b/libjava/gnu/java/beans/editors/NativeShortEditor.java
deleted file mode 100644
index ffaa266492e..00000000000
--- a/libjava/gnu/java/beans/editors/NativeShortEditor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* gnu.java.beans.editors.NativeShortEditor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.editors;
-
-import java.beans.PropertyEditorSupport;
-
-/**
- ** NativeShortEditor is a property editor for the
- ** short type.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class NativeShortEditor extends PropertyEditorSupport {
- /** setAsText for short calls Short.valueOf(). **/
- public void setAsText(String val) throws IllegalArgumentException {
- setValue(Short.valueOf(val));
- }
-
- /** getAsText for short calls Short.toString(). **/
- public String getAsText() {
- return getValue().toString();
- }
-}
diff --git a/libjava/gnu/java/beans/editors/StringEditor.java b/libjava/gnu/java/beans/editors/StringEditor.java
deleted file mode 100644
index 8242d5475a5..00000000000
--- a/libjava/gnu/java/beans/editors/StringEditor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* gnu.java.beans.editors.StringEditor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.editors;
-
-import java.beans.PropertyEditorSupport;
-
-/**
- ** NativeByteEditor is a property editor for the
- ** byte type.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class StringEditor extends PropertyEditorSupport {
- /** setAsText just sets the value. **/
- public void setAsText(String val) throws IllegalArgumentException {
- setValue(val);
- }
-
- /** getAsText just returns the value. **/
- public String getAsText() {
- return (String)getValue();
- }
-}
diff --git a/libjava/gnu/java/io/ASN1ParsingException.java b/libjava/gnu/java/io/ASN1ParsingException.java
deleted file mode 100644
index 5d2c64ab54f..00000000000
--- a/libjava/gnu/java/io/ASN1ParsingException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* ASN1ParsingException.java -- ASN.1 parsing exception.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.io;
-
-/**
- * Signals a malformed ASN.1 sequence.
- */
-public class ASN1ParsingException extends java.io.IOException
-{
-
- public ASN1ParsingException()
- {
- super();
- }
-
- public ASN1ParsingException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/gnu/java/io/Base64InputStream.java b/libjava/gnu/java/io/Base64InputStream.java
deleted file mode 100644
index b0824ab6935..00000000000
--- a/libjava/gnu/java/io/Base64InputStream.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/* Base64InputStream.java -- base-64 input stream.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.io;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * A filter input stream that decodes data encoded in the Base-64
- * encoding scheme.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class Base64InputStream extends FilterInputStream
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** Base-64 digits. */
- private static final String BASE_64 =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
- /** Base-64 padding character. */
- private static final char BASE_64_PAD = '=';
-
- /** Decoding state. */
- private int state;
-
- /** Intermediate decoded value. */
- private int temp;
-
- /** EOF flag. */
- private boolean eof;
-
- private final byte[] one = new byte[1];
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new Base-64 input stream. The input bytes must be the
- * ASCII characters A-Z, a-z, 0-9, + and /, with optional whitespace,
- * and will be decoded into a byte stream.
- *
- * @param in The source of Base-64 input.
- */
- public Base64InputStream(InputStream in)
- {
- super(in);
- state = 0;
- temp = 0;
- eof = false;
- }
-
- // Class method.
- // ------------------------------------------------------------------------
-
- /**
- * Decode a single Base-64 string to a byte array.
- *
- * @param base64 The Base-64 encoded data.
- * @return The decoded bytes.
- * @throws IOException If the given data do not compose a valid Base-64
- * sequence.
- */
- public static byte[] decode(String base64) throws IOException
- {
- Base64InputStream in =
- new Base64InputStream(new ByteArrayInputStream(base64.getBytes()));
- ByteArrayOutputStream out =
- new ByteArrayOutputStream((int) (base64.length() / 0.666));
- byte[] buf = new byte[1024];
- int len;
- while ((len = in.read(buf)) != -1)
- out.write(buf, 0, len);
- return out.toByteArray();
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- public int available()
- {
- return 0;
- }
-
- public int read() throws IOException
- {
- if (read(one) == 1)
- return one[0];
- return -1;
- }
-
- public int read(byte[] buf, int off, int len) throws IOException
- {
- if (eof)
- return -1;
- int count = 0;
- while (count < len)
- {
- int i;
- while (Character.isWhitespace((char) (i = in.read())));
- int pos = BASE_64.indexOf((char) i);
- if (pos >= 0)
- {
- switch (state)
- {
- case 0:
- temp = pos << 2;
- state = 1;
- break;
- case 1:
- buf[count++] = (byte) (temp | (pos >>> 4));
- temp = (pos & 0x0F) << 4;
- state = 2;
- break;
- case 2:
- buf[count++] = (byte) (temp | (pos >>> 2));
- temp = (pos & 0x03) << 6;
- state = 3;
- break;
- case 3:
- buf[count++] = (byte) (temp | pos);
- state = 0;
- break;
- }
- }
- else if (i == BASE_64_PAD)
- {
- switch (state)
- {
- case 0:
- case 1:
- throw new IOException("malformed Base-64 input");
- case 2:
- while (Character.isWhitespace((char) (i = in.read())));
- if (i != BASE_64_PAD)
- throw new IOException("malformed Base-64 input");
- case 3:
- while (Character.isWhitespace((char) (i = in.read())));
- }
- eof = true;
- break;
- }
- else // First non-Base-64 character, consider it end-of-stream.
- {
- if (state != 0)
- throw new IOException("malformed Base-64 input");
- eof = true;
- break;
- }
- }
- return count;
- }
-
- public boolean markSupported()
- {
- return false;
- }
-
- public void mark(int markLimit) { }
-
- public void reset() throws IOException
- {
- throw new IOException("reset not supported");
- }
-
- public long skip(long n) throws IOException
- {
- long skipped;
- for (skipped = 0; skipped < n; skipped++)
- if (read() == -1)
- break;
- return skipped;
- }
-}
diff --git a/libjava/gnu/java/io/ClassLoaderObjectInputStream.java b/libjava/gnu/java/io/ClassLoaderObjectInputStream.java
deleted file mode 100644
index 238ab26b1b9..00000000000
--- a/libjava/gnu/java/io/ClassLoaderObjectInputStream.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* gnu.java.io.ClassLoaderObjectInputStream
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.io;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.StreamCorruptedException;
-
-/**
- * ClassLoaderObjectInputStream is ObjectInputStream, with
- * the ability to use a specific ClassLoader.
- *
- * @author Geoff Berry
- * @version 1.1.0, 29 Jul 1998
- */
-
-public class ClassLoaderObjectInputStream extends ObjectInputStream {
- ClassLoader myClassLoader;
-
- /** Create the new ClassLoaderObjectInputStream.
- * @param in the InputStream to read the Objects from.
- * @param myClassLoader the ClassLoader to load classes
- * with.
- */
- public ClassLoaderObjectInputStream(InputStream in, ClassLoader myClassLoader) throws IOException,StreamCorruptedException {
- super(in);
- this.myClassLoader = myClassLoader;
- }
-
- /** Overriden method to use the loadClass() method from
- * the ClassLoader.
- */
- public Class resolveClass(String name) throws IOException, ClassNotFoundException {
- return myClassLoader.loadClass(name);
- }
-}
diff --git a/libjava/gnu/java/io/NullOutputStream.java b/libjava/gnu/java/io/NullOutputStream.java
deleted file mode 100644
index 526bd26e830..00000000000
--- a/libjava/gnu/java/io/NullOutputStream.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* NullOutputStream.java -- OutputStream that does absolutely nothing
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.io;
-
-import java.io.OutputStream;
-
-/**
- This is a placeholder OutputStream that does absolutley nothing
- when written to. It is intended to be used in the same manner as
- /dev/null. None of this class's methods do anything at all.
-*/
-public class NullOutputStream extends OutputStream
-{
- public NullOutputStream() {}
- public void write( int b ) {}
- public void write( byte b[] ) {}
- public void write( byte b[], int off, int len ) {}
- public void flush() {}
- public void close() {}
-}
diff --git a/libjava/gnu/java/io/ObjectIdentityWrapper.java b/libjava/gnu/java/io/ObjectIdentityWrapper.java
deleted file mode 100644
index 6db2e3a52a6..00000000000
--- a/libjava/gnu/java/io/ObjectIdentityWrapper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* ObjectIdentityWrapper.java -- Wrapper class used to override equals()
- and hashCode() to be as discriminating as possible
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.io;
-
-/**
- This class is a thin wrapper around <code>Object</code> that makes
- the methods <code>hashCode()</code> and <code>equals(Object)</code>
- as discriminating as possible.
-*/
-public class ObjectIdentityWrapper
-{
-
- /**
- Constructs a <code>ObjectIdentityWrapper</code> that is wrapped
- around o.
- */
- public ObjectIdentityWrapper( Object o )
- {
- object = o;
- }
-
- /**
- Uses <code>System.identityHashCode(Object)</code> to compute a
- hash code for the object wrapped by this
- <code>ObjectIdentityWrapper</code>.
-
- @see java.lang.System#identityHashCode(java.lang.Object)
- @see java.util.Hashtable
- @see java.lang.Object#hashCode()
- */
- public int hashCode()
- {
- return System.identityHashCode( object );
- }
-
- /**
- Uses the <code>==</code> operator to test for equality between
- the object wrapped by this <code>ObjectIdentityWrapper</code> and
- the object wrapped by the <code>ObjectIdentityWrapper</code> o.
- Returns false if o is not a <code>ObjectIdentityWrapper</code>.
-
- @see java.util.Hashtable
- @see java.lang.Object#equals()
- */
- public boolean equals( Object o )
- {
- if( o instanceof ObjectIdentityWrapper )
- return object == ((ObjectIdentityWrapper)o).object;
- else
- return false;
- }
-
- public String toString()
- {
- return "ObjectIdentityWrapper< " + object + ", " + hashCode() + " >";
- }
-
- /**
- The <code>Object</code> wrapped by this
- <code>ObjectIdentityWrapper</code>.
- */
- public Object object;
-}
diff --git a/libjava/gnu/java/lang/ArrayHelper.java b/libjava/gnu/java/lang/ArrayHelper.java
deleted file mode 100644
index 5f675831e9f..00000000000
--- a/libjava/gnu/java/lang/ArrayHelper.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ArrayHelper.java -- Helper methods for handling array operations
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.lang;
-
-/**
- * ArrayHelper helps you do things with arrays.
- *
- * @author John Keiser
- */
-public class ArrayHelper
-{
- /**
- * Counterpart to java.util.Collection.contains.
- *
- * @param array the array to search
- * @param searchFor the object to locate
- * @return true if some array element <code>equals(searchFor)</code>
- */
- public static boolean contains(Object[] array, Object searchFor)
- {
- return indexOf(array, searchFor) != -1;
- }
-
- /**
- * Counterpart to java.util.Collection.indexOf.
- *
- * @param array the array to search
- * @param searchFor the object to locate
- * @return the index of the first equal object, or -1
- */
- public static int indexOf(Object[] array, Object searchFor)
- {
- for (int i = 0; i < array.length; i++)
- {
- if(array[i].equals(searchFor))
- {
- return i;
- }
- }
- return -1;
- }
-}
diff --git a/libjava/gnu/java/lang/CharData.java b/libjava/gnu/java/lang/CharData.java
deleted file mode 100644
index 7631522c810..00000000000
--- a/libjava/gnu/java/lang/CharData.java
+++ /dev/null
@@ -1,1001 +0,0 @@
-/* gnu/java/lang/CharData -- Database for java.lang.Character Unicode info
- Copyright (C) 2002 Free Software Foundation, Inc.
- *** This file is generated by scripts/unicode-muncher.pl ***
-
-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.lang;
-
-/**
- * This contains the info about the unicode characters, that
- * java.lang.Character needs. It is generated automatically from
- * <code>gnu/gcj/convert/UnicodeData-3.0.0.txt</code> and
- * <code>gnu/gcj/convert/SpecialCasing-2.txt</code>, by some
- * perl scripts. These Unicode definition files can be found on the
- * <a href="http://www.unicode.org">http://www.unicode.org</a> website.
- * JDK 1.4 uses Unicode version 3.0.0.
- *
- * The data is stored as string constants, but Character will convert these
- * Strings to their respective <code>char[]</code> components. The field
- * <code>BLOCKS</code> stores the offset of a block of 2<sup>SHIFT</sup>
- * characters within <code>DATA</code>. The DATA field, in turn, stores
- * information about each character in the low order bits, and an offset
- * into the attribute tables <code>UPPER</code>, <code>LOWER</code>,
- * <code>NUM_VALUE</code>, and <code>DIRECTION</code>. Notice that the
- * attribute tables are much smaller than 0xffff entries; as many characters
- * in Unicode share common attributes. The DIRECTION table also contains
- * a field for detecting characters with multi-character uppercase expansions.
- * Next, there is a listing for <code>TITLE</code> exceptions (most characters
- * just have the same title case as upper case). Finally, there are two
- * tables for multi-character capitalization, <code>UPPER_SPECIAL</code>
- * which lists the characters which are special cased, and
- * <code>UPPER_EXPAND</code>, which lists their expansion.
- *
- * @author scripts/unicode-muncher.pl (written by Jochen Hoenicke,
- * Eric Blake)
- * @see Character
- * @see String
- */
-public interface CharData
-{
- /**
- * The Unicode definition file that was parsed to build this database.
- */
- String SOURCE = "gnu/gcj/convert/UnicodeData-3.0.0.txt";
-
- /**
- * The character shift amount to look up the block offset. In other words,
- * <code>(char) (BLOCKS.value[ch >> SHIFT] + ch)</code> is the index where
- * <code>ch</code> is described in <code>DATA</code>.
- */
- int SHIFT = 5;
-
- /**
- * The mapping of character blocks to their location in <code>DATA</code>.
- * Each entry has been adjusted so that the 16-bit sum with the desired
- * character gives the actual index into <code>DATA</code>.
- */
- String BLOCKS
- = "\u01c2\u01c2\u01c1\u012c\u012b\u01a0\u01f8\u02dc\u025f\u02ee\u0215"
- + "\u0346\u02dc\u0326\u02bc\u0216\u015f\u02d4\u0376\u0376\u0376\u0369"
- + "\ufe8f\u0344\uff85\uff65\ufdb5\ufda1\033\u02c4\034G\ufea8"
- + "\uff8c\u0235\ufeff\032\ufebf&\ufb20\ufe28\u0113\u0104\ufb61"
- + "\ufb5a\u010b\u0109\u00fe\uff08\u0229\u025e\u01c7\u01fc\u01dc\ufc46"
- + "\u0229\ufe27\ufb55\u0169\ufbc8\u00fc\u0103\ufb68\ufb48\ufb28\ufb08"
- + "\ufae8\ufac8\ufaa8\ufa88\ufa68\ufa48eP\u00ab\u0139\ufe0e"
- + "c\u0155\u01a8\uf669\u0129\u0128\uf91f\ufe56\u0108\u0107\ufac0"
- + "\ufc8e\ufead\u00c6\ufca7\ufb95\uf47d\u009f\ufb17\ufe20\ufd28\ufb2f"
- + ";\uf3b9\ufe57\ufcce\uffbb\uf339\ufa98\uff8b\uff3b\ufa54\uf7e3"
- + "\uff2b\ufad7\ufb69\ufc3a\ufee5\uf4c8\ufcb0\ufa88\ufdbf\uf448\ufe45"
- + "\ufcc7\ufe4f\uf7f1\uf715\uf2e8\ufd9f\uf348\uf96a\ufc02\ufd97\uf2c8"
- + "\uf2a8\uf4b9\uf4b3\uef6b\uf86a\uf84a\ufc58\uf80a\uf7ea\ufc0f\uf7aa"
- + "\uee9c\ufb90\uf74a\uf7fa\uf70a\uf7ca\uf792\uf471\uf4d2\uf732\uf64a"
- + "\uf401\uf64d\uefa8\uf5ca\uf5aa\ueca1\uf569\uf54a\uf52a\uf50a\uf4ea"
- + "\uf4ca\uf4aa\uf48a\uf46a\uf44a\uf42a\uf40a\uf3ea\uf3ca\uf3aa\uf38a"
- + "\uf36a\uf34a\uf32a\uf289\uf777\uf2ca\uf2aa\uf737\uec28\uec08\uebe8"
- + "\uebc8\uf1ea\uf4a2\uf545\uedc6\uf2d7\uf14a\ue8ed\ue81e\uf0ea\uf597"
- + "\uea68\uea48\uea28\uea08\ue9e8\ue9c8\ue9a8\ue988\ue968\ue948\ue928"
- + "\ue908\ue8e8\ue8c8\ue8a8\ue888\ue868\ue848\ue828\ue808\ue7e8\ue7c8"
- + "\ue7a8\ue788\ue768\ue748\ue728\ue708\ue6e8\ue6c8\ue6a8\ue688\ue668"
- + "\ue648\ue628\ue608\ue5e8\ue5c8\ue5a8\ue588\ue568\ue548\ue55f\ue53f"
- + "\ue51f\ue4ff\uefd7\ue4bf\ue49f\ue485\uef87\uef57\uef57\uef57\uef57"
- + "\uef47\ue1ad\uef46\uef46\uef46\ue1e0\ue3dd\uef06\ue9d9\uebeb\ue244"
- + "\ueed4\uef65\ue1f5\uef45\ueee9\uef7c\uee74\uef70\uef7d\uef78\uee91"
- + "\uefd3\uee7d\uee25\uee27\uef65\uefdd\uee96\uefd3\uefe1\uef69\udf88"
- + "\udf68\udf48\ued2b\ued3d\ued19\uef1c\uef08\ued47\ued3d\ued33\uec2b"
- + "\uec0b\uebeb\uebcb\uebce\uea7c\ueb69\ueb6c\ue9b6\ueb0b\ueaeb\ue9e9"
- + "\udca8\udc88\udc68\udc48\ue910\uea23\ueb58\ueb4f\ueb45\ueae5\udb68"
- + "\udb48\ue92b\ue90b\ue8eb\ue8cb\ue8ab\ue88b\ue86b\ue84b\uda28\uda08"
- + "\ud9e8\ud9c8\ud9a8\ud988\ud968\ud948\ud928\ud908\ud8e8\ud8c8\ud8a8"
- + "\ud888\ud868\ud848\ud828\ud808\ud7e8\ud7c8\ud7a8\ud788\ud768\ud748"
- + "\ud728\ud708\ud6e8\ud6c8\ud6a8\ud688\ud668\ud648\ud628\ud608\ud5e8"
- + "\ud5c8\ud5a8\ud588\ud568\ud548\ud528\ud508\ud4e8\ud4c8\ue2b1\ue28b"
- + "\ue26b\ue270\ue22b\ue20b\ue1eb\ue1cb\ue1ab\ue18b\ue18e\udd8f\ue3a8"
- + "\udfd3\ud929\ud90a\ue348\ud8c9\ud8aa\udcd7\udcb2\ud681\ud82a\ud80a"
- + "\ue268\ucede\ud168\ud148\ue116\ue0e9\ue1cb\ue0b7\ue0b7\ue15e\udf17"
- + "\ue034\ue013\udff3\udfd3\ude6c\udf93\udf73\udf55\udf34\ud56a\ud54a"
- + "\ud52a\ud50a\ud4ea\ud4ca\ud4aa\ud48a\ud46a\ud44a\ud42a\ud40a\ud3ea"
- + "\ud3ca\ud3aa\ud38a\ud36a\ud34a\ud32a\ud30a\ud2ea\ud2ca\ud2aa\ud28a"
- + "\ud26a\ud24a\ud22a\ud20a\ud1ea\ud1ca\ud1aa\ud18a\ud16a\ud14a\ud12a"
- + "\ud10a\ud0ea\ud0ca\ud0aa\ud08a\ud06a\ud04a\ud02a\ud00a\ucfea\ucfca"
- + "\ucfaa\ucf8a\ucf6a\ucf4a\ucf2a\ucf0a\uceea\uceca\uceaa\uce8a\uce6a"
- + "\uce4a\uce2a\uce0a\ucdea\ucdca\ucdaa\ucd8a\ucd6a\ucd4a\ucd2a\ucd0a"
- + "\uccea\uccca\uccaa\ucc8a\ucc6a\ucc4a\ucc2a\ucc0a\ucbea\ucbca\ucbaa"
- + "\ucb8a\ucb6a\ucb4a\ucb2a\ucb0a\ucaea\ucaca\ucaaa\uca8a\uca6a\uca4a"
- + "\uca2a\uca0a\uc9ea\uc9ca\uc9aa\uc98a\uc96a\uc94a\uc92a\uc90a\uc8ea"
- + "\uc8ca\uc8aa\uc88a\uc86a\uc84a\uc82a\uc80a\uc7ea\uc7ca\uc7aa\uc78a"
- + "\uc76a\uc74a\uc72a\uc70a\uc6ea\uc6ca\uc6aa\uc68a\uc66a\uc64a\uc62a"
- + "\uc60a\uc5ea\uc5ca\uc5aa\uc58a\uc56a\uc54a\uc52a\uc50a\uc4ea\uc4ca"
- + "\uc4aa\uc48a\uc46a\uc44a\uc42a\uc40a\uc3ea\uc3ca\uc3aa\uc38a\uc36a"
- + "\uc34a\uc32a\uc30a\uc2ea\uc2ca\uc2aa\uc28a\uc26a\uc24a\uc22a\uc20a"
- + "\uc1ea\uc1ca\uc1aa\uc18a\uc16a\uc14a\uc12a\uc10a\uc0ea\uc0ca\uc0aa"
- + "\uc08a\uc06a\uc04a\uc02a\uc00a\ubfea\ubfca\ubfaa\ubf8a\ubf6a\ubf4a"
- + "\ubf2a\ubf0a\ubeea\ubeca\ubeaa\ube8a\ube6a\ube4a\ube2a\ube0a\ubdea"
- + "\ubdca\ubdaa\ubd8a\ubd6a\ubd4a\ubd2a\ubd0a\ubcea\ubcca\ubcaa\ubc8a"
- + "\ubc6a\ubc4a\ubc2a\ubc0a\ubbea\ub2e0\ub568\ub548\ubb6a\ubb4a\ubb2a"
- + "\ubb0a\ubaea\ubaca\ubaaa\uba8a\uba6a\uba4a\uba2a\uba0a\ub9ea\ub9ca"
- + "\ub9aa\ub98a\ub96a\ub94a\ub92a\ub90a\ub8ea\ub8ca\ub8aa\ub88a\ub86a"
- + "\ub84a\ub82a\ub80a\ub7ea\ub7ca\ub7aa\ub78a\ub76a\ub74a\ub72a\ub70a"
- + "\ub6ea\ub6ca\ub6aa\ub68a\ub66a\ub64a\ub62a\ub60a\ub5ea\ub5ca\ub5aa"
- + "\ub58a\ub56a\ub54a\ub52a\ub50a\ub4ea\ub4ca\ub4aa\ub48a\ub46a\ub44a"
- + "\ub42a\ub40a\ub3ea\ub3ca\ub3aa\ub38a\ub36a\ub34a\ub32a\ub30a\ub2ea"
- + "\ub2ca\ub2aa\ub28a\ub26a\ub24a\ub22a\ub20a\ub1ea\ub1ca\ub1aa\ub18a"
- + "\ub16a\ub14a\ub12a\ub10a\ub0ea\ub0ca\ub0aa\ub08a\ub06a\ub04a\ub02a"
- + "\ub00a\uafea\uafca\uafaa\uaf8a\uaf6a\uaf4a\uaf2a\uaf0a\uaeea\uaeca"
- + "\uaeaa\uae8a\uae6a\uae4a\uae2a\uae0a\uadea\uadca\uadaa\uad8a\uad6a"
- + "\uad4a\uad2a\uad0a\uacea\uacca\uacaa\uac8a\uac6a\uac4a\uac2a\uac0a"
- + "\uabea\uabca\uabaa\uab8a\uab6a\uab4a\uab2a\uab0a\uaaea\uaaca\uaaaa"
- + "\uaa8a\uaa6a\uaa4a\uaa2a\uaa0a\ua9ea\ua9ca\ua9aa\ua98a\ua96a\ua94a"
- + "\ua92a\ua90a\ua8ea\ua8ca\ua8aa\ua88a\ua86a\ua84a\ua82a\ua80a\ua7ea"
- + "\ua7ca\ua7aa\ua78a\ua76a\ua74a\ua72a\ua70a\ua6ea\ua6ca\ua6aa\ua68a"
- + "\ua66a\ua64a\ua62a\ua60a\ua5ea\ua5ca\ua5aa\ua58a\ua56a\ua54a\ua52a"
- + "\ua50a\ua4ea\ua4ca\ua4aa\ua48a\ua46a\ua44a\ua42a\ua40a\ua3ea\ua3ca"
- + "\ua3aa\ua38a\ua36a\ua34a\ua32a\ua30a\ua2ea\ua2ca\ua2aa\ua28a\ua26a"
- + "\ua24a\ua22a\ua20a\ua1ea\ua1ca\ua1aa\ua18a\ua16a\ua14a\ua12a\ua10a"
- + "\ua0ea\ua0ca\ua0aa\ua08a\ua06a\ua04a\ua02a\ua00a\u9fea\u9fca\u9faa"
- + "\u9f8a\u9f6a\u9f4a\u9f2a\u9f0a\u9eea\u9eca\u9eaa\u9e8a\u9e6a\u9e4a"
- + "\u9e2a\u9e0a\u9dea\u9dca\u9daa\u9d8a\u9d6a\u9d4a\u9d2a\u9d0a\u9cea"
- + "\u9cca\u9caa\u9c8a\u9c6a\u9c4a\u9c2a\u9c0a\u9bea\u9bca\u9baa\u9b8a"
- + "\u9b6a\u9b4a\u9b2a\u9b0a\u9aea\u9aca\u9aaa\u9a8a\u9a6a\u9a4a\u9a2a"
- + "\u9a0a\u99ea\u99ca\u99aa\u998a\u996a\u994a\u992a\u990a\u98ea\u98ca"
- + "\u98aa\u988a\u986a\u984a\u982a\u980a\u97ea\u97ca\u97aa\u978a\u976a"
- + "\u974a\u972a\u970a\u96ea\u96ca\u96aa\u968a\u966a\u964a\u962a\u960a"
- + "\u95ea\u95ca\u95aa\u958a\u956a\u954a\u952a\u950a\u94ea\u94ca\u94aa"
- + "\u948a\u946a\u944a\u942a\u940a\u93ea\u93ca\u93aa\u938a\u936a\u934a"
- + "\u932a\u930a\u92ea\u92ca\u92aa\u928a\u926a\u924a\u922a\u920a\u91ea"
- + "\u91ca\u91aa\u918a\u916a\u914a\u912a\u910a\u90ea\u90ca\u90aa\u908a"
- + "\u906a\u904a\u902a\u900a\u8fea\u8fca\u8faa\u8f8a\u8f6a\u8f4a\u8f2a"
- + "\u8f0a\u8eea\u8eca\u8eaa\u8e8a\u8e6a\u8e4a\u8e2a\u8e0a\u8dea\u8dca"
- + "\u8daa\u8d8a\u8d6a\u8d4a\u8d2a\u8d0a\u8cea\u8cca\u8caa\u8c8a\u8c6a"
- + "\u8c4a\u8c2a\u8c0a\u8bea\u8bca\u8baa\u8b8a\u8b6a\u8b4a\u8b2a\u8b0a"
- + "\u8aea\u8aca\u8aaa\u8a8a\u8a6a\u8a4a\u8a2a\u8a0a\u89ea\u89ca\u89aa"
- + "\u898a\u896a\u894a\u892a\u890a\u88ea\u88ca\u88aa\u888a\u886a\u884a"
- + "\u882a\u880a\u87ea\u87ca\u87aa\u878a\u876a\u874a\u872a\u870a\u86ea"
- + "\u86ca\u86aa\u868a\u866a\u864a\u862a\u860a\u85ea\u85ca\u85aa\u858a"
- + "\u856a\u854a\u852a\u850a\u84ea\u84ca\u84aa\u848a\u846a\u844a\u842a"
- + "\u840a\u83ea\u83ca\u83aa\u838a\u836a\u834a\u832a\u830a\u82ea\u82ca"
- + "\u82aa\u828a\u826a\u824a\u822a\u820a\u81ea\u81ca\u81aa\u818a\u816a"
- + "\u814a\u812a\u810a\u80ea\u80ca\u80aa\u808a\u806a\u804a\u802a\u800a"
- + "\u7fea\u7fca\u7faa\u7f8a\u7f6a\u7f4a\u7f2a\u7f0a\u7eea\u7eca\u7eaa"
- + "\u7e8a\u7e6a\u7e4a\u7e2a\u7e0a\u7dea\u7dca\u7daa\u7d8a\u7d6a\u7d4a"
- + "\u7d2a\u7d0a\u7cea\u7cca\u7caa\u7c8a\u7c6a\u7c4a\u7c2a\u7c0a\u7bea"
- + "\u7bca\u7baa\u7b8a\u7b6a\u7b4a\u7b2a\u7b0a\u7aea\u7aca\u7aaa\u7a8a"
- + "\u7a6a\u7a4a\u7a2a\u7a0a\u79ea\u79ca\u79aa\u798a\u796a\u794a\u792a"
- + "\u790a\u78ea\u78ca\u78aa\u788a\u786a\u784a\u782a\u780a\u77ea\u77ca"
- + "\u77aa\u778a\u776a\u774a\u772a\u770a\u76ea\u76ca\u76aa\u768a\u766a"
- + "\u764a\u762a\u760a\u75ea\u75ca\u75aa\u758a\u756a\u754a\u752a\u750a"
- + "\u74ea\u74ca\u74aa\u748a\u746a\u744a\u742a\u740a\u73ea\u73ca\u73aa"
- + "\u738a\u736a\u734a\u732a\u730a\u72ea\u72ca\u72aa\u728a\u726a\u724a"
- + "\u722a\u720a\u71ea\u71ca\u71aa\u718a\u716a\u714a\u712a\u710a\u70ea"
- + "\u70ca\u70aa\u708a\u706a\u704a\u702a\u700a\u6fea\u6fca\u6faa\u6f8a"
- + "\u6f6a\u6f4a\u6f2a\u6f0a\u6eea\u6eca\u6eaa\u6e8a\u6e6a\u6e4a\u6e2a"
- + "\u6e0a\u6dea\u6dca\u6daa\u6d8a\u6d6a\u6d4a\u6d2a\u6d0a\u6cea\u6cca"
- + "\u6caa\u6c8a\u6c6a\u6c4a\u6c2a\u6c0a\u6bea\u6bca\u6baa\u6b8a\u6b6a"
- + "\u6b4a\u6b2a\u6b0a\u6aea\u6aca\u6aaa\u6a8a\u6a6a\u6a4a\u6a2a\u6a0a"
- + "\u69ea\u60f0\u6368\u6348\u696a\u694a\u692a\u690a\u68ea\u68ca\u68aa"
- + "\u688a\u686a\u684a\u682a\u680a\u67ea\u67ca\u67aa\u678a\u676a\u674a"
- + "\u672a\u670a\u66ea\u66ca\u66aa\u668a\u666a\u664a\u662a\u660a\u65ea"
- + "\u65ca\u65aa\u658a\u656a\u654a\u652a\u650a\u6b26\u6de1\u6e9c\u5e48"
- + "\u5e28\u5e08\u5de8\u5dc8\u5da8\u5d88\u5d68\u5d48\u5d28\u5d08\u5ce8"
- + "\u5cc8\u5ca8\u5c88\u5c68\u5c48\u5c28\u5c08\u5be8\u5bc8\u5ba8\u5b88"
- + "\u5b68\u5b48\u5b28\u5b08\u5ae8\u5ac8\u5aa8\u5a88\u5a68\u5a48\u5a28"
- + "\u5a08\u59e8\u59c8\u59a8\u5988\u5968\u5948\u5928\u5908\u58e8\u58c8"
- + "\u58a8\u5888\u5868\u5848\u5828\u5808\u57e8\u57c8\u57a8\u5788\u5768"
- + "\u5748\u5d6a\u5d4a\u5d2a\u5d0a\u5cea\u5cca\u5caa\u5c8a\u5c6a\u5c4a"
- + "\u5c2a\u5c0a\u5bea\u5bca\u5baa\u5b8a\u5b6a\u5b4a\u5b2a\u5b0a\u5aea"
- + "\u5aca\u5aaa\u5a8a\u5a6a\u5a4a\u5a2a\u5a0a\u59ea\u59ca\u59aa\u598a"
- + "\u596a\u594a\u592a\u590a\u58ea\u58ca\u58aa\u588a\u586a\u584a\u582a"
- + "\u580a\u57ea\u57ca\u57aa\u578a\u576a\u574a\u572a\u570a\u56ea\u56ca"
- + "\u56aa\u568a\u566a\u564a\u562a\u560a\u55ea\u55ca\u55aa\u558a\u556a"
- + "\u554a\u552a\u550a\u54ea\u54ca\u54aa\u548a\u546a\u544a\u542a\u540a"
- + "\u53ea\u53ca\u53aa\u538a\u536a\u534a\u532a\u530a\u52ea\u52ca\u52aa"
- + "\u528a\u526a\u524a\u522a\u520a\u51ea\u51ca\u51aa\u518a\u516a\u514a"
- + "\u512a\u510a\u50ea\u50ca\u50aa\u508a\u506a\u504a\u502a\u500a\u4fea"
- + "\u4fca\u4faa\u4f8a\u4f6a\u4f4a\u4f2a\u4f0a\u4eea\u4eca\u4eaa\u4e8a"
- + "\u4e6a\u4e4a\u4e2a\u4e0a\u4dea\u4dca\u4daa\u4d8a\u4d6a\u4d4a\u4d2a"
- + "\u4d0a\u4cea\u4cca\u4caa\u4c8a\u4c6a\u4c4a\u4c2a\u4c0a\u4bea\u4bca"
- + "\u4baa\u4b8a\u4b6a\u4b4a\u4b2a\u4b0a\u4aea\u4aca\u4aaa\u4a8a\u4a6a"
- + "\u4a4a\u4a2a\u4a0a\u49ea\u49ca\u49aa\u498a\u496a\u494a\u492a\u490a"
- + "\u48ea\u48ca\u48aa\u488a\u486a\u484a\u482a\u480a\u47ea\u47ca\u47aa"
- + "\u478a\u476a\u474a\u472a\u470a\u46ea\u46ca\u46aa\u468a\u466a\u464a"
- + "\u462a\u460a\u45ea\u45ca\u45aa\u458a\u456a\u454a\u452a\u450a\u44ea"
- + "\u44ca\u44aa\u448a\u446a\u444a\u442a\u440a\u43ea\u43ca\u43aa\u438a"
- + "\u436a\u434a\u432a\u430a\u42ea\u42ca\u42aa\u428a\u426a\u424a\u422a"
- + "\u420a\u41ea\u41ca\u41aa\u418a\u416a\u414a\u412a\u410a\u40ea\u40ca"
- + "\u40aa\u408a\u406a\u404a\u402a\u400a\u3fea\u3fca\u3faa\u3f8a\u3f6a"
- + "\u3f4a\u3f2a\u3f0a\u3eea\u3eca\u3eaa\u3e8a\u3e6a\u3e4a\u3e2a\u3e0a"
- + "\u3dea\u3dca\u3daa\u3d8a\u3d6a\u3d4a\u3d2a\u3d0a\u3cea\u3cca\u3caa"
- + "\u3c8a\u3c6a\u3c4a\u3c2a\u3c0a\u3bea\u3bca\u3baa\u3b8a\u3b6a\u3b4a"
- + "\u3b2a\u3b0a\u3aea\u3aca\u3aaa\u3a8a\u3a6a\u3a4a\u3a2a\u3a0a\u39ea"
- + "\u39ca\u39aa\u398a\u396a\u394a\u392a\u390a\u38ea\u38ca\u38aa\u388a"
- + "\u386a\u384a\u382a\u380a\u37ea\u37ca\u37aa\u378a\u376a\u374a\u372a"
- + "\u370a\u36ea\u36ca\u36aa\u368a\u366a\u364a\u362a\u360a\u35ea\u35ca"
- + "\u35aa\u358a\u356a\u354a\u352a\u350a\u34ea\u34ca\u34aa\u348a\u346a"
- + "\u344a\u342a\u340a\u33ea\u33ca\u33aa\u338a\u336a\u334a\u332a\u330a"
- + "\u32ea\u32ca\u32aa\u328a\u326a\u324a\u322a\u320a\u31ea\u28f2\u2b68"
- + "\u2b48\u3c2b\u3c0b\u3beb\u3bcb\u3bab\u3b8b\u3b6b\u3b4b\u3b2b\u3b0b"
- + "\u3aeb\u3acb\u3aab\u3a8b\u3a6b\u3a4b\u3a2b\u3a0b\u39eb\u39cb\u39ab"
- + "\u398b\u396b\u394b\u392b\u390b\u38eb\u38cb\u38ab\u388b\u386b\u384b"
- + "\u382b\u380b\u37eb\u37cb\u37ab\u378b\u376b\u374b\u372b\u370b\u36eb"
- + "\u36cb\u36ab\u368b\u366b\u364b\u362b\u360b\u35eb\u35cb\u35ab\u358b"
- + "\u356b\u354b\u352b\u350b\u34eb\u34cb\u34ab\u348b\u346b\u344b\u344b"
- + "\u342b\u340b\u33eb\u33cb\u33ab\u338b\u336b\u334b\u332b\u330b\u32eb"
- + "\u32cb\u32ab\u328b\u326b\u324b\u322b\u320b\u31eb\u31cb\u31ab\u318b"
- + "\u316b\u314b\u312b\u310b\u30eb\u30cb\u30ab\u308b\u306b\u304b\u302b"
- + "\u300b\u2feb\u2fcb\u2fab\u2f8b\u2f6b\u2f4b\u2f2b\u2f0b\u2eeb\u2ecb"
- + "\u2eab\u2e8b\u2e6b\u2e4b\u2e2b\u2e0b\u2deb\u2dcb\u2dab\u2d8b\u2d6b"
- + "\u2d4b\u2d2b\u2d0b\u2ceb\u2ccb\u2cab\u2c8b\u2c6b\u2c4b\u2c2b\u2c0b"
- + "\u2beb\u2bcb\u2bab\u2b8b\u2b6b\u2b4b\u2b2b\u2b0b\u2aeb\u2acb\u2aab"
- + "\u2a8b\u2a6b\u2a4b\u2a2b\u2a0b\u29eb\u29cb\u29ab\u298b\u296b\u294b"
- + "\u292b\u290b\u28eb\u28cb\u28ab\u288b\u286b\u284b\u282b\u280b\u27eb"
- + "\u27cb\u27ab\u278b\u276b\u274b\u272b\u270b\u26eb\u26cb\u26ab\u268b"
- + "\u266b\u264b\u262b\u260b\u25eb\u25cb\u25ab\u258b\u256b\u254b\u252b"
- + "\u250b\u24eb\u24cb\u24ab\u248b\u246b\u244b\u242b\u240b\u23eb\u23cb"
- + "\u23ab\u238b\u236b\u234b\u232b\u230b\u22eb\u22cb\u22ab\u228b\u226b"
- + "\u224b\u222b\u220b\u21eb\u21cb\u21ab\u218b\u216b\u214b\u212b\u210b"
- + "\u20eb\u20cb\u20ab\u208b\u206b\u204b\u202b\u200b\u1feb\u1fcb\u1fab"
- + "\u1f8b\u1f6b\u1f4b\u1f2b\u1f0b\u1eeb\u1ecb\u1eab\u1e8b\u1e6b\u1e4b"
- + "\u1e2b\u1e0b\u1deb\u1dcb\u1dab\u1d8b\u1d6b\u1d4b\u1d2b\u1d0b\u1ceb"
- + "\u1ccb\u1cab\u1c8b\u1c6b\u1c4b\u1c2b\u1c0b\u1beb\u1bcb\u1bab\u1b8b"
- + "\u1b6b\u106a\u104a\u102a\u100a\u0fea\u0fca\u0faa\u0f8a\u0f6a\u0668"
- + "\u08e8\u08c8\u08a8\u0888\u0868\u0848\u07d7\u194b\u07b6\u0d1c\u0cfc"
- + "\u0cb2\u0ca9\u0c9c\u0c7c\u0c5c\u0c3c\u0c1c\u0bfc\u0bdc\u0bbc\u0b9c"
- + "\u0b7c\u0b5e\u0b2c\u0b1c\u0ab8\u0adc\u0a9c\u02c2\u0528\u166b\u1667"
- + "\u03ff\u09fc\u09dc\u09bc\u0659\u0bb8\u15a7\u0fc6\u01c0\u01b1\u09cb"
- + "\u082c\u1285";
-
- /**
- * Information about each character. The low order 5 bits form the
- * character type, the next bit is a flag for non-breaking spaces, and the
- * next bit is a flag for mirrored directionality. The high order 9 bits
- * form the offset into the attribute tables. Note that this limits the
- * number of unique character attributes to 512, which is not a problem
- * as of Unicode version 3.2.0, but may soon become one.
- */
- String DATA
- = "\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001"
- + "\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082"
- + "\u3e80\u3e80\u3001\u3082\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3a85"
- + "\u3a85\u3e80\u3e80\u3e80\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85"
- + "\u3e80\u3e80\u3e80\u3e80\u5b88\u5b88\u3e80\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80"
- + "\u3e80\u3e80\u3e80\u5198\u3e80\u3e80\u3e80\u3e80\u4606\u3e80\u3e80"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3e80\u3a85"
- + "\u3a85\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u3e80\u3e80\u3e80\u3e80\u5202\u5202\u5202\u5202"
- + "\u5202\u5202\u5202\u5202\u5202\u5202\u5202\u5202\u5202\u5202\u5202"
- + "\u5202\u5202\u5202\u5202\u5202\u5202\u5202\u5202\u5202\u5202\u5202"
- + "\u5202\u5202\u5202\u5202\u5202\u2e82\u3e80\u5198\u2a14\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u4606\u4606\u4606\u4606\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4686\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u1a1b\u1a1b\u3e80\u3e80\u3e80\u3e80\u4584\u3e80\u3e80"
- + "\u3e80\u0298\u3e80\u0298\u6615\u6696\u0298\u1a97\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u4584\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u4584\u4584\u1a1b\u1a1b\u1a1b\u1a1b"
- + "\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u4584"
- + "\u4584\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b"
- + "\u1a1b\u1a1b\u1a1b\u1a1b\u2e82\u7282\u2e82\u3e80\u2e82\u4902\u7481"
- + "\u7481\u7481\u7481\u7383\u1a1b\u1a1b\u1a1b\u6d82\u6d82\u4902\u4902"
- + "\u3e80\u3e80\u2e82\u4902\u6e01\u6e01\u7501\u7501\u3e80\u1a1b\u1a1b"
- + "\u1a1b\u1b02\u1b82\u1c02\u1c82\u1d02\u1d82\u1e02\u1e82\u1f02\u1f82"
- + "\u2002\u2082\u2102\u2182\u2202\u2282\u2302\u2382\u2402\u2482\u2502"
- + "\u2582\u2602\u2682\u2702\u2782\u0455\u0c99\u04d6\u0c99\017\017"
- + "\017\017\017\u010f\017\017\017\017\017\017\017"
- + "\017\017\017\017\017\017\017\017\017\017\017"
- + "\017\017\017\017\017\017\017\017\u008f\u010f\u008f"
- + "\u018f\u010f\017\017\017\017\017\017\017\017\017"
- + "\017\017\017\017\017\u010f\u010f\u010f\u008f\u020c\u0298"
- + "\u0298\u0318\u039a\u0318\u0298\u0298\u0455\u04d6\u0298\u0519\u0598"
- + "\u0614\u0598\u0698\u0709\u0789\u0809\u0889\u0909\u0989\u0a09\u0a89"
- + "\u0b09\u0b89\u0598\u0298\u0c59\u0c99\u0c59\u0298\u0d01\u0d81\u0e01"
- + "\u0e81\u0f01\u0f81\u1001\u1081\u1101\u1181\u1201\u1281\u1301\u1381"
- + "\u1401\u1481\u1501\u1581\u1601\u1681\u1701\u1781\u1801\u1881\u1901"
- + "\u1981\u0455\u0298\u04d6\u1a1b\u1a97\u0298\u0298\u0298\u0c99\u0455"
- + "\u04d6\u3e80\u0298\u0298\u0298\u0298\u0298\u0298\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u282c\u0298\u039a\u039a\u039a\u039a\u289c"
- + "\u289c\u1a1b\u289c\u2902\u29dd\u0c99\u2a14\u289c\u1a1b\u2a9c\u0519"
- + "\u2b0b\u2b8b\u1a1b\u2c02\u289c\u0298\u1a1b\u2c8b\u2902\u2d5e\u2d8b"
- + "\u2d8b\u2d8b\u0298\u0298\u0519\u0614\u0c99\u0c99\u0c99\u3e80\u0298"
- + "\u039a\u0318\u0298\u3e80\u3e80\u3e80\u3e80\u5405\u5405\u5405\u3e80"
- + "\u5405\u3e80\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u5405\u3e80\u3e80\u3e80\u4606\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u3e80\u501c\u501c\u4f81\u4f81"
- + "\u4f81\u4f81\u4f81\u4f81\u4f81\u4f81\u4f81\u4f81\u4f81\u4f81\u4f81"
- + "\u4f81\u4f81\u4f81\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01"
- + "\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01"
- + "\u2e01\u2e01\u2e01\u2e01\u0c99\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01"
- + "\u2e01\u2e82\u2e82\u2e82\u4902\u4902\u2e82\u2e82\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u2e82\u2e82"
- + "\u2e82\u2e82\u2e82\u3e80\u3e80\u3e80\u3e80\u3e80\u5305\u4606\u5305"
- + "\u5305\u3e80\u5305\u5305\u3e80\u5305\u5305\u5305\u5305\u5305\u5305"
- + "\u5305\u5305\u5305\u5305\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5398\u5405\u4606\u4606\u4606\u4606\u4606\u4606\u4606"
- + "\u5087\u5087\u4606\u5087\u5087\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u2d8b\u2d8b\u2d8b\u2d8b\u2d8b\u2d8b\u2d8b"
- + "\u2d8b\u2d8b\u2d8b\u2d8b\u2d8b\u840b\u3082\u3001\u3082\u3001\u3082"
- + "\u3001\u3082\u3001\u3082\u2e82\u3001\u3082\u3001\u3082\u3001\u3082"
- + "\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001"
- + "\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082"
- + "\u3001\u3082\u3001\u3082\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u5c09"
- + "\u5c89\u5d09\u5d89\u5e09\u5e89\u5f09\u5f89\u6009\u6089\u4606\u4606"
- + "\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u1a1b\u1a1b\u4701\u0298\u4781\u4781\u4781\u3e80"
- + "\u4801\u3e80\u4881\u4881\u4902\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01"
- + "\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2f02"
- + "\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02"
- + "\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02"
- + "\u0c99\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f82\u2f02\u2f02"
- + "\u4a82\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u4b02"
- + "\u4b82\u4b82\u3e80\u4c02\u4c82\u4d01\u4d01\u4d01\u4d82\u4e02\u2902"
- + "\u3e80\u3e80\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001"
- + "\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u2e82\u3b81\u3c03\u3c82"
- + "\u3001\u3082\u3d81\u3e01\u3001\u3082\u3001\u3082\u3001\u3082\u3001"
- + "\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3101\u3182"
- + "\u3001\u3082\u3001\u3082\u3001\u3082\u2902\u3001\u3082\u3001\u3082"
- + "\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001"
- + "\u3082\u4e82\u4f02\u3d02\u2902\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u5b10\u5b10\u5b10\u5b10\u5b10"
- + "\u5b10\u7f0b\u3e80\u3e80\u3e80\u7f8b\u800b\u808b\u810b\u818b\u820b"
- + "\u0519\u0519\u0c99\u0455\u04d6\u2902\u3301\u3001\u3082\u3001\u3082"
- + "\u3381\u3001\u3082\u3401\u3401\u3001\u3082\u2902\u3481\u3501\u3581"
- + "\u3001\u3082\u3401\u3601\u3682\u3701\u3781\u3001\u3082\u2902\u2902"
- + "\u3701\u3801\u2902\u3881\u3a85\u3a85\u3a85\u3a85\u3b81\u3c03\u3c82"
- + "\u3b81\u3c03\u3c82\u3b81\u3c03\u3c82\u3001\u3082\u3001\u3082\u3001"
- + "\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082"
- + "\u3d02\u3001\u3082\u501c\u4606\u4606\u4606\u4606\u3e80\u5087\u5087"
- + "\u3e80\u3e80\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001"
- + "\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082"
- + "\u3001\u3082\u3001\u3082\u3201\u3001\u3082\u3001\u3082\u3001\u3082"
- + "\u3282\u3001\u3082\u3001\u3082\u3001\u3082\u3901\u3001\u3082\u3901"
- + "\u2902\u2902\u3001\u3082\u3901\u3001\u3082\u3981\u3981\u3001\u3082"
- + "\u3001\u3082\u3a01\u3001\u3082\u2902\u3a85\u3001\u3082\u2902\u3b02"
- + "\u4d01\u3001\u3082\u3001\u3082\u3e80\u3e80\u3001\u3082\u3e80\u3e80"
- + "\u3001\u3082\u3e80\u3e80\u3e80\u3001\u3082\u3001\u3082\u3001\u3082"
- + "\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001"
- + "\u3082\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u0598\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u5398\u3e80\u3e80\u3e80\u5398"
- + "\u5398\u5398\u5398\u5398\u5398\u5398\u5398\u5398\u5398\u5398\u5398"
- + "\u5398\u5398\u3e80\u5b10\u5405\u4606\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u3e80\u3e80\u5b10\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01"
- + "\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01"
- + "\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01\u4d01"
- + "\u4d01\u4d01\u4d01\u4d01\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u5c09\u5c89\u5d09\u5d89\u5e09\u5e89"
- + "\u5f09\u5f89\u6009\u6089\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u2902\u2902\u2902\u3f02\u3f82\u2902\u4002"
- + "\u4002\u2902\u4082\u2902\u4102\u2902\u2902\u2902\u2902\u4002\u2902"
- + "\u2902\u4182\u2902\u2902\u2902\u2902\u4202\u4282\u2902\u2902\u2902"
- + "\u2902\u2902\u4282\u2902\u2902\u4302\u2902\u2902\u4382\u2902\u2902"
- + "\u2902\u2902\u2902\u2902\u2902\u2902\u2902\u2902\u4402\u2902\u2902"
- + "\u4402\u2902\u2902\u2902\u2902\u4402\u2902\u4482\u4482\u2902\u2902"
- + "\u2902\u2902\u2902\u2902\u4502\u2902\u2902\u2902\u2902\u2902\u2902"
- + "\u2902\u2902\u2902\u2902\u2902\u2902\u2902\u2902\u3e80\u3e80\u4584"
- + "\u4584\u4584\u4584\u4584\u4584\u4584\u4584\u4584\u1a1b\u1a1b\u4584"
- + "\u4584\u4584\u4584\u4584\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b\u1a1b"
- + "\u1a1b\u1a1b\u4584\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u5101\u5101"
- + "\u5101\u5101\u5101\u5101\u5101\u5101\u5101\u5101\u5101\u5101\u5101"
- + "\u5101\u5101\u5101\u5101\u5101\u5101\u5101\u5101\u5101\u5101\u3e80"
- + "\u3e80\u4584\u5198\u5198\u5198\u5198\u5198\u5198\u2e01\u2e01\u3e80"
- + "\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u2e01\u4982\u4a02"
- + "\u4a02\u4a02\u4902\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02"
- + "\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u2f02\u4f02\u4f02\u4f02"
- + "\u4f02\u4f02\u4f02\u4f02\u4f02\u4f02\u4f02\u4f02\u4f02\u4f02\u4f02"
- + "\u4f02\u4f02\u4606\u4606\u4606\u4606\u4606\u5198\u4606\u4606\u3a85"
- + "\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3e80\u4606\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u3e80\u4606\u4606\u4606\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u3e80\u4606\u4606\u4606\u5298"
- + "\u4606\u4606\u5298\u4606\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u5305\u5305\u5305\u5305\u5305\u5305\u5305"
- + "\u5305\u5305\u5305\u5305\u5305\u5305\u5305\u5305\u5305\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u5305\u5305\u5305\u5298\u5298\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u5c89\u5d09\u5d89"
- + "\u5e09\u5e89\u5f09\u5f89\u6009\u6089\u640b\u648b\u650b\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u4606\u5b88\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80"
- + "\u3e80\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80"
- + "\u3e80\u3a85\u3a85\u3e80\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3e80"
- + "\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606"
- + "\u4606\u5b88\u5b88\u5b88\u5b88\u3e80\u4606\u4606\u4606\u3e80\u4606"
- + "\u4606\u4606\u4606\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u4606"
- + "\u4606\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u4606"
- + "\u5b88\u5b88\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3e80\u3e80\u3a85\u3a85\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80"
- + "\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3e80\u3e80\u3e80\u3e80\u5b88\u5b88\u3e80\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u3a85\u3a85\u3a85"
- + "\u3e80\u3e80\u3e80\u3e80\u5c09\u5c89\u5d09\u5d89\u5e09\u5e89\u5f09"
- + "\u5f89\u6009\u6089\u501c\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u5509\u5589\u5609"
- + "\u5689\u5709\u5789\u5809\u5889\u5909\u5989\u0318\u5a18\u5a18\u5398"
- + "\u3e80\u3e80\u4606\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u3e80\u3e80\u5405"
- + "\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u5405\u6615\u6696\u5484\u5405\u5405\u5405\u5405"
- + "\u5405\u5405\u5405\u5405\u5405\u5405\u4606\u4606\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u5b88\u5b88\u5198\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u4606\u4606\u5b88"
- + "\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3e80"
- + "\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u5198\u5198\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u4606\u4606\u4606\u4606\u4606\u5484\u5484\u4606"
- + "\u4606\u289c\u4606\u4606\u4606\u4606\u3e80\u3e80\u0709\u0789\u0809"
- + "\u0889\u0909\u0989\u0a09\u0a89\u0b09\u0b89\u5405\u5405\u5405\u5a9c"
- + "\u5a9c\u3e80\u3a85\u3a85\u3a85\u3e80\u3a85\u3e80\u3a85\u3e80\u3e80"
- + "\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u4606\u3a85\u3a85\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u3e80\u4606\u4606\u3a85\u3e80\u3e80"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3e80\u4606\u4606\u5b88"
- + "\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3e80\u3e80\u4606\u3a85\u5b88\u5b88\u5b88\u5b88\u5b88\u3e80\u4606"
- + "\u5b88\u5b88\u3e80\u5b88\u5b88\u4606\u4606\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u5b88\u5b88\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3a85\u3e80\u5198\u5198\u5198\u5198\u5198\u5198\u5198\u5198"
- + "\u5c89\u5d09\u5d89\u5e09\u5e89\u5f09\u5f89\u6009\u6089\u640b\u670b"
- + "\u678b\u680b\u688b\u690b\u698b\u6a0b\u6a8b\u648b\u6b0b\u3e80\u3e80"
- + "\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85\u3e80"
- + "\u3e80\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u4606\u3a85\u5b88\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u5b88\u5b88\u5b88\u5b88"
- + "\u4606\u3e80\u3e80\u3a85\u4606\u4606\u4606\u4606\u3e80\u3e80\u3e80"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3e80\u3e80\u3e80"
- + "\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u4606\u3e80\u5b88\u5b88\u5b88"
- + "\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85"
- + "\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3e80\u3a85"
- + "\u3a85\u3a85\u3a85\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3e80\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u4606\u3a85\u3a85\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u3e80\u3e80\u3e80\u3e80\u039a\u039a\u039a"
- + "\u039a\u039a\u039a\u039a\u039a\u039a\u039a\u039a\u039a\u039a\u039a"
- + "\u039a\u039a\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3a85\u3a85\u4606\u4606"
- + "\u5198\u5198\u5c09\u5c89\u5d09\u5d89\u5e09\u5e89\u5f09\u5f89\u6009"
- + "\u6089\u5198\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u0298\u0298\u0318\u039a\u0318"
- + "\u0298\u0298\u6615\u6696\u0298\u0519\u0598\u0614\u0598\u0698\u0709"
- + "\u0789\u0809\u0889\u0909\u0989\u0a09\u0a89\u0b09\u0b89\u0598\u0298"
- + "\u0c99\u0c99\u0c99\u0298\u0298\u0298\u0298\u0298\u0298\u2a14\u0298"
- + "\u0298\u0298\u0298\u5b10\u5b10\u5b10\u5b10\u3e80\u5c09\u5c89\u5d09"
- + "\u5d89\u5e09\u5e89\u5f09\u5f89\u6009\u6089\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3e80\u5b88"
- + "\u4606\u4606\u4606\u4606\u3e80\u3e80\u5b88\u5b88\u3e80\u3e80\u5b88"
- + "\u5b88\u4606\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u5b88\u3e80\u3e80\u3e80\u3e80\u3a85\u3a85\u3e80\u3a85\u3e80\u3e80"
- + "\u3a85\u3a85\u3e80\u3a85\u3e80\u3e80\u3a85\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3e80\u3a85\u3a85\u3e80\u3a85\u3a85\u3e80\u3a85\u3a85"
- + "\u3e80\u3e80\u4606\u3e80\u5b88\u5b88\u4606\u4606\u3e80\u3e80\u3e80"
- + "\u3e80\u4606\u4606\u3e80\u3e80\u4606\u4606\u4606\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3a85\u3a85\u3a85"
- + "\u3a85\u3e80\u3a85\u3e80\u3a85\u3a85\u4606\u4606\u3e80\u3e80\u5c09"
- + "\u5c89\u5d09\u5d89\u5e09\u5e89\u5f09\u5f89\u6009\u6089\u3a85\u3a85"
- + "\u039a\u039a\u610b\u618b\u620b\u628b\u630b\u638b\u501c\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3a85"
- + "\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u4606\u3a85"
- + "\u5b88\u5b88\u4606\u4606\u4606\u4606\u4606\u3e80\u4606\u4606\u5b88"
- + "\u3e80\u5b88\u5b88\u4606\u3e80\u3e80\u3a85\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u5c09\u5c89\u5d09\u5d89\u5e09\u5e89\u5f09\u5f89\u6009\u6089\u630b"
- + "\u630b\u630b\u630b\u630b\u630b\u630b\u630b\u630b\u630b\u501c\u4606"
- + "\u501c\u4606\u501c\u4606\u6615\u6696\u6615\u6696\u5b88\u5b88\u4606"
- + "\u4606\u4606\u3e80\u3e80\u3e80\u5b88\u5b88\u3e80\u3e80\u5b88\u5b88"
- + "\u4606\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u4606\u5b88"
- + "\u3e80\u3e80\u3e80\u3e80\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3e80\u3a85\u3a85\u3e80\u5b88\u4606\u4606\u4606\u4606\u5b88"
- + "\u4606\u3e80\u3e80\u3e80\u4606\u4606\u5b88\u4606\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u5b88\u5b88\u5b88\u4606\u4606\u4606\u4606\u4606\u4606\u4606"
- + "\u5b88\u5b88\u3e80\u3e80\u3e80\u5b88\u5b88\u5b88\u3e80\u5b88\u5b88"
- + "\u5b88\u4606\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u5b88\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3e80\u4584\u3e80\u4606\u4606\u4606\u4606\u4606"
- + "\u4606\u3e80\u3e80\u5c09\u5c89\u5d09\u5d89\u5e09\u5e89\u5f09\u5f89"
- + "\u6009\u6089\u3e80\u3e80\u3a85\u3a85\u3e80\u3e80\u3e80\u3e80\u5c09"
- + "\u5c89\u5d09\u5d89\u5e09\u5e89\u5f09\u5f89\u6009\u6089\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u5087\u5087\u5087\u5b88\u4606\u4606"
- + "\u4606\u3e80\u3e80\u5b88\u5b88\u5b88\u3e80\u5b88\u5b88\u5b88\u4606"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u5b88\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u4606\u3e80\u3e80\u3e80\u3e80"
- + "\u5b88\u5b88\u5b88\u4606\u4606\u4606\u3e80\u4606\u3e80\u5b88\u5b88"
- + "\u5b88\u5b88\u5b88\u5b88\u5b88\u5b88\u4606\u5b88\u5b88\u4606\u4606"
- + "\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u4606\u5198\u5198"
- + "\u5198\u5198\u5198\u5198\u5198\u039a\u5198\u3e80\u3e80\u3e80\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u4584\u4606\u4606\u4606\u4606\u4606"
- + "\u4606\u4606\u4606\u5198\u5c09\u5c89\u5d09\u5d89\u5e09\u5e89\u5f09"
- + "\u5f89\u6009\u6089\u5198\u5198\u3e80\u3e80\u3e80\u3e80\u3a85\u501c"
- + "\u501c\u501c\u5198\u5198\u5198\u5198\u5198\u5198\u5198\u5198\u65b8"
- + "\u5198\u5198\u5198\u5198\u5198\u5198\u501c\u501c\u501c\u501c\u501c"
- + "\u4606\u4606\u501c\u501c\u501c\u501c\u501c\u501c\u4606\u501c\u501c"
- + "\u501c\u501c\u501c\u501c\u3e80\u3e80\u501c\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u3e80\u3e80\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u1a97\u4584\u4584\u4584"
- + "\u3e80\u5c09\u5c89\u5d09\u5d89\u5e09\u5e89\u5f09\u5f89\u6009\u6089"
- + "\u5198\u5198\u5198\u5198\u5198\u5198\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u5b88\u5b88\u4606\u4606\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u020c\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u6615\u6696\u3e80\u3e80\u3e80\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u5198"
- + "\u5198\u5198\u6b8b\u6c0b\u6c8b\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u4606\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3001\u3082\u3001"
- + "\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082"
- + "\u3001\u3082\u3001\u3082\u3001\u3082\u3001\u3082\u2e82\u2e82\u2e82"
- + "\u2e82\u2e82\u6d02\u3e80\u3e80\u3e80\u3e80\u6d82\u6d82\u6d82\u6d82"
- + "\u6d82\u6d82\u6d82\u6d82\u6e01\u6e01\u6e01\u6e01\u6e01\u6e01\u6e01"
- + "\u6e01\u6d82\u6d82\u6d82\u6d82\u6d82\u6d82\u6d82\u6d82\u6e01\u6e01"
- + "\u6e01\u6e01\u6e01\u6e01\u6e01\u6e01\u6d82\u6d82\u6d82\u6d82\u6d82"
- + "\u6d82\u3e80\u3e80\u6e01\u6e01\u6e01\u6e01\u6e01\u6e01\u3e80\u3e80"
- + "\u2e82\u6d82\u4902\u6d82\u4902\u6d82\u4902\u6d82\u3e80\u6e01\u3e80"
- + "\u6e01\u3e80\u6e01\u3e80\u6e01\u6d82\u6d82\u6d82\u6d82\u6d82\u6d82"
- + "\u6d82\u6d82\u6e01\u6e01\u6e01\u6e01\u6e01\u6e01\u6e01\u6e01\u6e82"
- + "\u6e82\u6f02\u6f02\u6f02\u6f02\u6f82\u6f82\u7002\u7002\u7082\u7082"
- + "\u7102\u7102\u3e80\u3e80\u7182\u7182\u7182\u7182\u7182\u7182\u7182"
- + "\u7182\u7203\u7203\u7203\u7203\u7203\u7203\u7203\u7203\u7182\u7182"
- + "\u7182\u7182\u7182\u7182\u7182\u7182\u7203\u7203\u7203\u7203\u7203"
- + "\u7203\u7203\u7203\u6d82\u6d82\u2e82\u7282\u2e82\u3e80\u2e82\u4902"
- + "\u6e01\u6e01\u7301\u7301\u7383\u1a1b\u7402\u1a1b\u1b02\u1b82\u1c02"
- + "\u1c82\u1d02\u1d82\u1e02\u1e82\u1f02\u1f82\u2002\u2082\u2102\u2182"
- + "\u2202\u2282\u2302\u2382\u2402\u2482\u2502\u2582\u2602\u2682\u2702"
- + "\u2782\u6615\u0c99\u6696\u0c99\u3e80\u6d82\u6d82\u4902\u4902\u2e82"
- + "\u7582\u2e82\u4902\u6e01\u6e01\u7601\u7601\u7681\u1a1b\u1a1b\u1a1b"
- + "\u3e80\u3e80\u2e82\u7282\u2e82\u3e80\u2e82\u4902\u7701\u7701\u7781"
- + "\u7781\u7383\u1a1b\u1a1b\u3e80\u020c\u020c\u020c\u020c\u020c\u020c"
- + "\u020c\u782c\u020c\u020c\u020c\u788c\u5b10\u5b10\u7910\u7990\u2a14"
- + "\u7a34\u2a14\u2a14\u2a14\u2a14\u0298\u0298\u7a9d\u7b1e\u6615\u7a9d"
- + "\u7a9d\u7b1e\u6615\u7a9d\u0298\u0298\u0298\u0298\u0298\u0298\u0298"
- + "\u0298\u7b8d\u7c0e\u7c90\u7d10\u7d90\u7e10\u7e90\u782c\u0318\u0318"
- + "\u0318\u0318\u0318\u0298\u0298\u0298\u0298\u29dd\u2d5e\u0298\u0298"
- + "\u0298\u0298\u1a97\u7f0b\u2c8b\u2b0b\u2b8b\u7f8b\u800b\u808b\u810b"
- + "\u818b\u820b\u0519\u0519\u0c99\u0455\u04d6\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u3e80\u3e80\u3e80\u3e80\u3e80\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u4d01\u289c\u289c\u289c\u289c"
- + "\u4d01\u289c\u289c\u2902\u4d01\u4d01\u4d01\u2902\u2902\u4d01\u4d01"
- + "\u4d01\u2902\u289c\u4d01\u289c\u289c\u289c\u4d01\u4d01\u4d01\u4d01"
- + "\u4d01\u289c\u289c\ua20a\ua28a\ua30a\ua38a\ua40a\ua48a\ua50a\ua58a"
- + "\ua60a\u4606\u4606\u4606\u4606\u4606\u4606\u2a14\u4584\u4584\u4584"
- + "\u4584\u4584\u289c\u289c\ua68a\ua70a\ua78a\u3e80\u3e80\u3e80\u289c"
- + "\u289c\u289c\u289c\u3e80\u289c\u289c\u289c\u289c\u3e80\u3e80\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u0c99\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u0c99\u0c99\u289c\u289c\u0c99\u289c\u0c99"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u0c99\u289c\u289c\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u948a"
- + "\u950a\u958a\u960a\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u0c99\u0c99\u0c99\u0c99\u0c99\u289c\u289c"
- + "\u289c\u289c\u289c\u0c99\u0c99\u289c\u289c\u289c\u289c\u4d01\u289c"
- + "\u8281\u289c\u4d01\u289c\u8301\u8381\u4d01\u4d01\u2a9c\u2902\u4d01"
- + "\u4d01\u289c\u4d01\u2902\u3a85\u3a85\u3a85\u3a85\u2902\u289c\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u848a\u850a\u858a\u860a\u868a\u870a\u878a"
- + "\u880a\u888a\u890a\u898a\u8a0a\u8a8a\u8b0a\u8b8a\u8c0a\u8c8a\u8d0a"
- + "\u8d8a\u8e0a\u8e8a\u8f0a\u8f8a\u900a\u908a\u910a\u918a\u920a\u928a"
- + "\u930a\u938a\u940a\u0c99\u0c99\u0c59\u0c59\u0c99\u0c99\u0c59\u0c59"
- + "\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59"
- + "\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c99\u0c99\u0c99\u0c99\u0c99"
- + "\u0c59\u0c59\u0c59\u0c59\u0c99\u0c99\u0c99\u0c99\u0c99\u0c99\u0c99"
- + "\u0c99\u0c99\u0c59\u0c59\u0c59\u0c59\u0c59\u0c99\u0c99\u0c59\u0c59"
- + "\u0c99\u0c99\u0c99\u0c99\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59"
- + "\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c99\u0c99\u0c59\u0c59\u0c59"
- + "\u0c59\u0c99\u0c99\u0c99\u0c99\u0c99\u0c59\u0c99\u0c99\u0c99\u0c99"
- + "\u0c99\u0c99\u0c99\u289c\u289c\u0c99\u289c\u289c\u0c99\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u0c99\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u3e80\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u0c99\u0c59\u0c59\u0c59\u0c59\u0c99\u0c99\u0c99\u0c59\u0c59\u0c59"
- + "\u0c59\u0c59\u0c59\u0c99\u0c99\u0c99\u0c59\u0519\u0519\u0c99\u0c59"
- + "\u0c59\u0c99\u0c99\u0c99\u0c59\u0c59\u0c59\u0c59\u0c99\u0c59\u0c99"
- + "\u0c59\u0c99\u0c99\u0c99\u0c99\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59"
- + "\u0c59\u0c59\u0c59\u0c99\u0c99\u0c99\u0c99\u0c99\u0c59\u0c99\u0c59"
- + "\u0c59\u0c59\u0c59\u0c59\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u0455\u04d6\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c"
- + "\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c"
- + "\u501c\u501c\u501c\u3e80\u3e80\u3e80\u3e80\u501c\u501c\u501c\u501c"
- + "\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c"
- + "\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u9c1c\u9c1c\u9c1c\u9c1c"
- + "\u9c1c\u9c1c\u9c1c\u9c1c\u9c1c\u9c1c\u9c1c\u9c1c\u9c1c\u9c1c\u9c1c"
- + "\u9c1c\u9c9c\u9c9c\u9c9c\u9c9c\u9c9c\u9c9c\u9c9c\u9c9c\u9c9c\u9c9c"
- + "\u9c9c\u9c9c\u9c9c\u9c9c\u9c9c\u9c9c\u7f0b\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u0c59\u0c99\u0c59\u0c99\u0c59"
- + "\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c99\u0c99\u0c59\u0c59"
- + "\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59\u0c59"
- + "\u0c59\u0c59\u0c59\u0c59\u0c59\u0c99\u0c99\u0c59\u0c59\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u039a\u039a\u0c99\u1a1b\u289c\u039a\u039a\u3e80\u289c\u0c99"
- + "\u0c99\u0c99\u0c99\u289c\u289c\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u5b10\u5b10\u5b10\u289c\u289c\u3e80\u3e80"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u3e80\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u3e80\u289c"
- + "\u3e80\u289c\u289c\u289c\u289c\u3e80\u3e80\u3e80\u289c\u3e80\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u840b\u9d0b"
- + "\u9d8b\u9e0b\u9e8b\u9f0b\u9f8b\ua00b\ua08b\ua10b\u840b\u9d0b\u9d8b"
- + "\u9e0b\u9e8b\u9f0b\u9f8b\ua00b\ua08b\ua10b\u289c\u3e80\u3e80\u3e80"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u0c59\u0c59\u0c59"
- + "\u0c59\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c\u289c"
- + "\u501c\u289c\u289c\u289c\u289c\u289c\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u630b\u630b\u630b\u630b\u630b\u630b\u630b\u630b\u630b\u630b\u501c"
- + "\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c"
- + "\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c"
- + "\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u3e80\u3e80"
- + "\u3e80\u501c\u610b\u618b\u620b\u628b\ua80b\ua88b\ua90b\ua98b\uaa0b"
- + "\u640b\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c"
- + "\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c"
- + "\u501c\u501c\u501c\u501c\u501c\u501c\u289c\u3e80\u289c\u289c\u289c"
- + "\u3e80\u289c\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u2c8b\u2b0b\u2b8b\u7f8b\u800b\u808b"
- + "\u810b\u818b\u820b\u968b\u970b\u978b\u980b\u988b\u990b\u998b\u9a0b"
- + "\u9a8b\u9b0b\u9b8b\u2c8b\u2b0b\u2b8b\u7f8b\u800b\u808b\u810b\u818b"
- + "\u820b\u968b\u970b\u978b\u980b\u988b\u990b\u998b\u9a0b\u9a8b\u9b0b"
- + "\u9b8b\u501c\u501c\u501c\u501c\u020c\u0298\u0298\u0298\u289c\u4584"
- + "\u3a85\ua18a\u0455\u04d6\u0455\u04d6\u0455\u04d6\u0455\u04d6\u0455"
- + "\u04d6\u289c\u289c\u0455\u04d6\u0455\u04d6\u0455\u04d6\u0455\u04d6"
- + "\u2a14\u6615\u6696\u6696\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3e80\u3e80\u3e80\u3e80\u4606\u4606\u1a1b\u1a1b"
- + "\u4584\u4584\u3e80\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85"
- + "\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3a85\u3e80\u501c\u501c\u630b"
- + "\u630b\u630b\u630b\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c"
- + "\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u501c\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93"
- + "\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93"
- + "\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93\uaa93"
- + "\uaa93\uaa93\uaa93\uab12\uab12\uab12\uab12\uab12\uab12\uab12\uab12"
- + "\uab12\uab12\uab12\uab12\uab12\uab12\uab12\uab12\uab12\uab12\uab12"
- + "\uab12\uab12\uab12\uab12\uab12\uab12\uab12\uab12\uab12\uab12\uab12"
- + "\uab12\uab12\u5305\u5305\u5305\u5305\u5305\u5305\u5305\u5305\u5305"
- + "\u0519\u5305\u5305\u5305\u5305\u5305\u5305\u5305\u5305\u5305\u5305"
- + "\u5305\u5305\u5305\u3e80\u5305\u5305\u5305\u5305\u5305\u3e80\u5305"
- + "\u3e80\u4606\u4606\u4606\u4606\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80"
- + "\u3e80\u3e80\u3e80\u3e80\u3e80\u3e80\u0298\u2a14\u2a14\u1a97\u1a97"
- + "\u6615\u6696\u6615\u6696\u6615\u6696\u6615\u6696\u6615\u6696\u6615"
- + "\u6696\u3e80\u3e80\u3e80\u3e80\u0298\u0298\u0298\u0298\u1a97\u1a97"
- + "\u1a97\u0598\u0298\u0598\u3e80\u0298\u0598\u0298\u0298\u2a14\u6615"
- + "\u6696\u6615\u6696\u6615\u6696\u0318\u0298\u0d01\u0d81\u0e01\u0e81"
- + "\u0f01\u0f81\u1001\u1081\u1101\u1181\u1201\u1281\u1301\u1381\u1401"
- + "\u1481\u1501\u1581\u1601\u1681\u1701\u1781\u1801\u1881\u1901\u1981"
- + "\u6615\u0298\u6696\u1a1b\u1a97";
-
- /**
- * This is the attribute table for computing the numeric value of a
- * character. The value is -1 if Unicode does not define a value, -2
- * if the value is not a positive integer, otherwise it is the value.
- * Note that this is a signed value, but stored as an unsigned char
- * since this is a String literal.
- */
- String NUM_VALUE
- = "\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\uffff\uffff\000\001\002\003\004\005\006\007"
- + "\010\011\uffff\uffff\012\013\014\015\016\017\020"
- + "\021\022\023\024\025\026\027\030\031\032\033"
- + "\034\035\036\037 !\"#\uffff\uffff\012"
- + "\013\014\015\016\017\020\021\022\023\024\025"
- + "\026\027\030\031\032\033\034\035\036\037 "
- + "!\"#\uffff\uffff\uffff\uffff\uffff\uffff\002\003"
- + "\uffff\001\uffff\ufffe\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\uffff\uffff\uffff\uffff\000\001\002\003\004\005"
- + "\006\007\010\011\uffff\uffff\uffff\uffff\000\001\002"
- + "\003\004\005\006\007\010\011\001\002\003\004"
- + "\uffff\020\012d\u03e8\uffff\uffff\uffff\024\036("
- + "2<FPZ\u2710\021\022\023\uffff\uffff"
- + "\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff"
- + "\uffff\000\004\005\006\007\010\011\uffff\uffff\uffff"
- + "\001\001\002\003\004\005\006\007\010\011\012"
- + "\013\0142d\u01f4\u03e8\001\002\003\004\005"
- + "\006\007\010\011\012\013\0142d\u01f4\u03e8"
- + "\u03e8\u1388\u2710\uffff\012\013\014\015\016\017\020"
- + "\021\022\023\024\uffff\uffff\002\003\004\005\006"
- + "\007\010\011\012\000\001\002\003\004\005\006"
- + "\007\010\011\012\024\036\005\006\007\010\011"
- + "\uffff\uffff";
-
- /**
- * This is the attribute table for computing the single-character uppercase
- * representation of a character. The value is the signed difference
- * between the character and its uppercase version. Note that this is
- * stored as an unsigned char since this is a String literal. When
- * capitalizing a String, you must first check if a multi-character uppercase
- * sequence exists before using this character.
- */
- String UPPER
- = "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\uffe0"
- + "\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0"
- + "\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0\uffe0"
- + "\uffe0\uffe0\uffe0\000\000\000\000\000\000\000\000"
- + "\u02e7\000\000\000\000\000\uffe0y\000\uffff\000"
- + "\uff18\000\ufed4\000\000\000\000\000\000\000a"
- + "\000\000\000\000\000\000\000\0008\000\uffff"
- + "\ufffe\uffb1\000\000\000\uff2e\uff32\uff33\uff36\uff35\uff31"
- + "\uff2f\uff2d\uff2b\uff2a\uff26\uff27\uff25\000\000T\000"
- + "\000\000\000\000\uffda\uffdb\uffe1\uffc0\uffc1\uffc2\uffc7"
- + "\000\uffd1\uffca\uffaa\uffb0\000\000\000\000\000\uffd0"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\uffc5\010"
- + "\000JVd\u0080p~\010\000\011\000"
- + "\000\ue3db\000\000\007\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\ufff0\ufff0\ufff0\ufff0\ufff0"
- + "\ufff0\ufff0\ufff0\ufff0\ufff0\ufff0\ufff0\ufff0\ufff0\ufff0\ufff0"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\uffe6\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000";
-
- /**
- * This is the attribute table for computing the lowercase representation
- * of a character. The value is the signed difference between the
- * character and its lowercase version. Note that this is stored as an
- * unsigned char since this is a String literal.
- */
- String LOWER
- = "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + " "
- + " "
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000 \000\000\000\001\000\uff39\000\uff87\000\u00d2\u00ce"
- + "\u00cdO\u00ca\u00cb\u00cf\000\u00d3\u00d1\u00d5\u00d6\u00da\u00d9\u00db"
- + "\000\000\002\001\000\000\uff9f\uffc8\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000&"
- + "%@?\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000P\000\0000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\ufff8"
- + "\000\000\000\000\000\000\000\ufff8\000\uffb6\ufff7\000\uffaa"
- + "\uff9c\000\uff90\ufff9\uff80\uff82\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\ue2a3\udf41\udfba\000\020\020\020\020\020\020\020\020"
- + "\020\020\020\020\020\020\020\020\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\032\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000";
-
- /**
- * This is the attribute table for computing the directionality class
- * of a character, as well as a marker of characters with a multi-character
- * capitalization. The direction is taken by performing a signed shift
- * right by 2 (where a result of -1 means an unknown direction, such as
- * for undefined characters). The lower 2 bits form a count of the
- * additional characters that will be added to a String when performing
- * multi-character uppercase expansion. This count is also used, along with
- * the offset in UPPER_SPECIAL, to determine how much of UPPER_EXPAND to use
- * when performing the case conversion. Note that this information is stored
- * as an unsigned char since this is a String literal.
- */
- String DIRECTION
- = "$,(004\024\02444\024\034\024\020\014\014\014"
- + "\014\014\014\014\014\014\01444\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\00044\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\0344\00044"
- + "\024\014\014\000\01444\000\001\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\ufffc\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000 \000\000\000\000\002\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000 \000\000\000\004\004\010\010\010"
- + "\030\030\030\030\030\030\030\030\030\030\030\010$\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "44\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\001\001\001\000\001\000\000\000\000\000\000"
- + "\000\0000$\000\0044440(8@H<D\014"
- + "\014\014\014\014\014\014\000\000\0004\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\014\014\014\014\014"
- + "\014\014\014\014\014\014\000\000444444444"
- + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
- + "\000\000\000";
-
- /**
- * This is the listing of titlecase special cases (all other characters
- * can use <code>UPPER</code> to determine their titlecase). The listing
- * is a sorted sequence of character pairs; converting the first character
- * of the pair to titlecase produces the second character.
- */
- String TITLE
- = "\u01c4\u01c5\u01c5\u01c5\u01c6\u01c5\u01c7\u01c8\u01c8\u01c8\u01c9"
- + "\u01c8\u01ca\u01cb\u01cb\u01cb\u01cc\u01cb\u01f1\u01f2\u01f2\u01f2"
- + "\u01f3\u01f2";
-
- /**
- * This is a listing of characters with multi-character uppercase sequences.
- * A character appears in this list exactly when it has a non-zero entry
- * in the low-order 2-bit field of DIRECTION. The listing is a sorted
- * sequence of pairs (hence a binary search on the even elements is an
- * efficient way to lookup a character). The first element of a pair is the
- * character with the expansion, and the second is the index into
- * UPPER_EXPAND where the expansion begins. Use the 2-bit field of
- * DIRECTION to determine where the expansion ends.
- */
- String UPPER_SPECIAL
- = "\u00df\000\u0149\002\u01f0\004\u0390\006\u03b0\011"
- + "\u0587\014\u1e96\016\u1e97\020\u1e98\022\u1e99\024"
- + "\u1e9a\026\u1f50\030\u1f52\032\u1f54\035\u1f56 "
- + "\u1f80#\u1f81%\u1f82'\u1f83)\u1f84+"
- + "\u1f85-\u1f86/\u1f871\u1f883\u1f895"
- + "\u1f8a7\u1f8b9\u1f8c;\u1f8d=\u1f8e?"
- + "\u1f8fA\u1f90C\u1f91E\u1f92G\u1f93I"
- + "\u1f94K\u1f95M\u1f96O\u1f97Q\u1f98S"
- + "\u1f99U\u1f9aW\u1f9bY\u1f9c[\u1f9d]"
- + "\u1f9e_\u1f9fa\u1fa0c\u1fa1e\u1fa2g"
- + "\u1fa3i\u1fa4k\u1fa5m\u1fa6o\u1fa7q"
- + "\u1fa8s\u1fa9u\u1faaw\u1faby\u1fac{"
- + "\u1fad}\u1fae\u007f\u1faf\u0081\u1fb2\u0083\u1fb3\u0085"
- + "\u1fb4\u0087\u1fb6\u0089\u1fb7\u008b\u1fbc\u008e\u1fc2\u0090"
- + "\u1fc3\u0092\u1fc4\u0094\u1fc6\u0096\u1fc7\u0098\u1fcc\u009b"
- + "\u1fd2\u009d\u1fd3\u00a0\u1fd6\u00a3\u1fd7\u00a5\u1fe2\u00a8"
- + "\u1fe3\u00ab\u1fe4\u00ae\u1fe6\u00b0\u1fe7\u00b2\u1ff2\u00b5"
- + "\u1ff3\u00b7\u1ff4\u00b9\u1ff6\u00bb\u1ff7\u00bd\u1ffc\u00c0"
- + "\ufb00\u00c2\ufb01\u00c4\ufb02\u00c6\ufb03\u00c8\ufb04\u00cb"
- + "\ufb05\u00ce\ufb06\u00d0\ufb13\u00d2\ufb14\u00d4\ufb15\u00d6"
- + "\ufb16\u00d8\ufb17\u00da";
-
- /**
- * This is the listing of special case multi-character uppercase sequences.
- * Characters listed in UPPER_SPECIAL index into this table to find their
- * uppercase expansion. Remember that you must also perform special-casing
- * on two single-character sequences in the Turkish locale, which are not
- * covered here in CharData.
- */
- String UPPER_EXPAND
- = "SS\u02bcNJ\u030c\u0399\u0308\u0301\u03a5\u0308"
- + "\u0301\u0535\u0552H\u0331T\u0308W\u030aY\u030a"
- + "A\u02be\u03a5\u0313\u03a5\u0313\u0300\u03a5\u0313\u0301\u03a5"
- + "\u0313\u0342\u1f08\u0399\u1f09\u0399\u1f0a\u0399\u1f0b\u0399\u1f0c"
- + "\u0399\u1f0d\u0399\u1f0e\u0399\u1f0f\u0399\u1f08\u0399\u1f09\u0399"
- + "\u1f0a\u0399\u1f0b\u0399\u1f0c\u0399\u1f0d\u0399\u1f0e\u0399\u1f0f"
- + "\u0399\u1f28\u0399\u1f29\u0399\u1f2a\u0399\u1f2b\u0399\u1f2c\u0399"
- + "\u1f2d\u0399\u1f2e\u0399\u1f2f\u0399\u1f28\u0399\u1f29\u0399\u1f2a"
- + "\u0399\u1f2b\u0399\u1f2c\u0399\u1f2d\u0399\u1f2e\u0399\u1f2f\u0399"
- + "\u1f68\u0399\u1f69\u0399\u1f6a\u0399\u1f6b\u0399\u1f6c\u0399\u1f6d"
- + "\u0399\u1f6e\u0399\u1f6f\u0399\u1f68\u0399\u1f69\u0399\u1f6a\u0399"
- + "\u1f6b\u0399\u1f6c\u0399\u1f6d\u0399\u1f6e\u0399\u1f6f\u0399\u1fba"
- + "\u0399\u0391\u0399\u0386\u0399\u0391\u0342\u0391\u0342\u0399\u0391"
- + "\u0399\u1fca\u0399\u0397\u0399\u0389\u0399\u0397\u0342\u0397\u0342"
- + "\u0399\u0397\u0399\u0399\u0308\u0300\u0399\u0308\u0301\u0399\u0342"
- + "\u0399\u0308\u0342\u03a5\u0308\u0300\u03a5\u0308\u0301\u03a1\u0313"
- + "\u03a5\u0342\u03a5\u0308\u0342\u1ffa\u0399\u03a9\u0399\u038f\u0399"
- + "\u03a9\u0342\u03a9\u0342\u0399\u03a9\u0399FFFI"
- + "FLFFIFFLSTS"
- + "T\u0544\u0546\u0544\u0535\u0544\u053b\u054e\u0546\u0544\u053d";
-}
diff --git a/libjava/gnu/java/lang/ClassHelper.java b/libjava/gnu/java/lang/ClassHelper.java
deleted file mode 100644
index 14c8a39c478..00000000000
--- a/libjava/gnu/java/lang/ClassHelper.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/* ClassHelper.java -- Utility methods to augment java.lang.Class
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.lang;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * ClassHelper has various methods that ought to have been in Class.
- *
- * @author John Keiser
- * @author Eric Blake (ebb9@email.byu.edu)
- */
-public class ClassHelper
-{
- /**
- * Strip the package part from the class name.
- *
- * @param clazz the class to get the truncated name from
- * @return the truncated class name
- */
- public static String getTruncatedClassName(Class clazz)
- {
- return getTruncatedName(clazz.getName());
- }
-
- /**
- * Strip the package part from the class name, or the class part from
- * the method or field name.
- *
- * @param name the name to truncate
- * @return the truncated name
- */
- public static String getTruncatedName(String name)
- {
- int lastInd = name.lastIndexOf('.');
- if (lastInd == -1)
- return name;
- return name.substring(lastInd + 1);
- }
-
- /** Cache of methods found in getAllMethods(). */
- private static Map allMethods = new HashMap();
-
- /**
- * Get all the methods, public, private and otherwise, from the class,
- * getting them from the most recent class to find them. This may not
- * be quite the correct approach, as this includes methods that are not
- * inherited or accessible from clazz, so beware.
- *
- * @param clazz the class to start at
- * @return all methods declared or inherited in clazz
- */
- public static Method[] getAllMethods(Class clazz)
- {
- Method[] retval = (Method[]) allMethods.get(clazz);
- if (retval == null)
- {
- Set methods = new HashSet();
- Class c = clazz;
- while (c != null)
- {
- Method[] currentMethods = c.getDeclaredMethods();
- loop:
- for (int i = 0; i < currentMethods.length; i++)
- {
- Method current = currentMethods[i];
- int size = methods.size();
- Iterator iter = methods.iterator();
- while (--size >= 0)
- {
- Method override = (Method) iter.next();
- if (current.getName().equals(override.getName())
- && Arrays.equals(current.getParameterTypes(),
- override.getParameterTypes())
- && current.getReturnType() == override.getReturnType())
- continue loop;
- }
- methods.add(current);
- }
- c = c.getSuperclass();
- }
- retval = new Method[methods.size()];
- methods.toArray(retval);
- allMethods.put(clazz, retval);
- }
- return retval;
- }
-
- /** Cache of fields found in getAllFields(). */
- private static Map allFields = new HashMap();
-
- /**
- * Get all the fields, public, private and otherwise, from the class,
- * getting them from the most recent class to find them. This may not
- * be quite the correct approach, as this includes fields that are not
- * inherited or accessible from clazz, so beware.
- *
- * @param clazz the class to start at
- * @return all fields declared or inherited in clazz
- */
- public static Field[] getAllFields(Class clazz)
- {
- Field[] retval = (Field[]) allFields.get(clazz);
- if (retval == null)
- {
- Set fields = new HashSet();
- Class c = clazz;
- while (c != null)
- {
- Field[] currentFields = c.getDeclaredFields();
- loop:
- for (int i = 0; i < currentFields.length; i++)
- {
- Field current = currentFields[i];
- int size = fields.size();
- Iterator iter = fields.iterator();
- while (--size >= 0)
- {
- Field override = (Field) iter.next();
- if (current.getName().equals(override.getName())
- && current.getType() == override.getType())
- continue loop;
- }
- fields.add(current);
- }
- c = c.getSuperclass();
- }
- retval = new Field[fields.size()];
- fields.toArray(retval);
- allFields.put(clazz, retval);
- }
- return retval;
- }
-}
diff --git a/libjava/gnu/java/lang/reflect/TypeSignature.java b/libjava/gnu/java/lang/reflect/TypeSignature.java
deleted file mode 100644
index 842e5bdf0f0..00000000000
--- a/libjava/gnu/java/lang/reflect/TypeSignature.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/* TypeSignature.java -- Class used to compute type signatures
- Copyright (C) 1998, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.lang.reflect;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-
-/**
- * This class provides static methods that can be used to compute
- * type-signatures of <code>Class</code>s or <code>Member</code>s.
- * More specific methods are also provided for computing the
- * type-signature of <code>Constructor</code>s and
- * <code>Method</code>s. Methods are also provided to go in the
- * reverse direction.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
-public class TypeSignature
-{
- /**
- * Returns a <code>String</code> representing the type-encoding of a class.
- * The .class file format has different encodings for classes, depending
- * on whether it must be disambiguated from primitive types or not; hence
- * the descriptor parameter to choose between them. If you are planning
- * on decoding primitive types along with classes, then descriptor should
- * be true for correct results. Type-encodings are computed as follows:
- *
- * <pre>
- * boolean -> "Z"
- * byte -> "B"
- * char -> "C"
- * double -> "D"
- * float -> "F"
- * int -> "I"
- * long -> "J"
- * short -> "S"
- * void -> "V"
- * arrays -> "[" + descriptor format of component type
- * object -> class format: fully qualified name with '.' replaced by '/'
- * descriptor format: "L" + class format + ";"
- * </pre>
- *
- * @param type the class name to encode
- * @param descriptor true to return objects in descriptor format
- * @return the class name, as it appears in bytecode constant pools
- * @see #getClassForEncoding(String)
- */
- public static String getEncodingOfClass(String type, boolean descriptor)
- {
- if (! descriptor || type.charAt(0) == '[')
- return type.replace('.', '/');
- if (type.equals("boolean"))
- return "Z";
- if (type.equals("byte"))
- return "B";
- if (type.equals("short"))
- return "S";
- if (type.equals("char"))
- return "C";
- if (type.equals("int"))
- return "I";
- if (type.equals("long"))
- return "J";
- if (type.equals("float"))
- return "F";
- if (type.equals("double"))
- return "D";
- if (type.equals("void"))
- return "V";
- return 'L' + type.replace('.', '/') + ';';
- }
-
- /**
- * Gets the descriptor encoding for a class.
- *
- * @param clazz the class to encode
- * @param descriptor true to return objects in descriptor format
- * @return the class name, as it appears in bytecode constant pools
- * @see #getEncodingOfClass(String, boolean)
- */
- public static String getEncodingOfClass(Class clazz, boolean descriptor)
- {
- return getEncodingOfClass(clazz.getName(), descriptor);
- }
-
- /**
- * Gets the descriptor encoding for a class.
- *
- * @param clazz the class to encode
- * @return the class name, as it appears in bytecode constant pools
- * @see #getEncodingOfClass(String, boolean)
- */
- public static String getEncodingOfClass(Class clazz)
- {
- return getEncodingOfClass(clazz.getName(), true);
- }
-
-
- /**
- * This function is the inverse of <code>getEncodingOfClass</code>. This
- * accepts both object and descriptor formats, but must know which style
- * of string is being passed in (usually, descriptor should be true). In
- * descriptor format, "I" is treated as int.class, in object format, it
- * is treated as a class named I in the unnamed package. This method is
- * strictly equivalent to {@link #getClassForEncoding(java.lang.String, boolean, java.lang.ClassLoader)}
- * with a class loader equal to <code>null</code>. In that case, it
- * uses the default class loader on the calling stack.
- *
- * @param type_code the class name to decode
- * @param descriptor if the string is in descriptor format
- * @return the corresponding Class object
- * @throws ClassNotFoundException if the class cannot be located
- * @see #getEncodingOfClass(Class, boolean)
- */
- public static Class getClassForEncoding(String type_code, boolean descriptor)
- throws ClassNotFoundException
- {
- return getClassForEncoding(type_code, descriptor, null);
- }
-
- /**
- * This function is the inverse of <code>getEncodingOfClass</code>. This
- * accepts both object and descriptor formats, but must know which style
- * of string is being passed in (usually, descriptor should be true). In
- * descriptor format, "I" is treated as int.class, in object format, it
- * is treated as a class named I in the unnamed package.
- *
- * @param type_code The class name to decode.
- * @param descriptor If the string is in descriptor format.
- * @param loader The class loader when resolving generic object name. If
- * <code>loader</code> is null then it uses the default class loader on the
- * calling stack.
- * @return the corresponding Class object.
- * @throws ClassNotFoundException if the class cannot be located.
- * @see #getEncodingOfClass(Class, boolean)
- * @see #getClassForEncoding(String, boolean)
- */
- public static Class getClassForEncoding(String type_code, boolean descriptor,
- ClassLoader loader)
- throws ClassNotFoundException
- {
- if (descriptor)
- {
- switch (type_code.charAt(0))
- {
- case 'B':
- return byte.class;
- case 'C':
- return char.class;
- case 'D':
- return double.class;
- case 'F':
- return float.class;
- case 'I':
- return int.class;
- case 'J':
- return long.class;
- case 'S':
- return short.class;
- case 'V':
- return void.class;
- case 'Z':
- return boolean.class;
- default:
- throw new ClassNotFoundException("Invalid class name: "
- + type_code);
- case 'L':
- type_code = type_code.substring(1, type_code.length() - 1);
- // Fallthrough.
- case '[':
- }
- }
- return Class.forName(type_code.replace('/', '.'), true, loader);
- }
-
- /**
- * Gets the Class object for a type name.
- *
- * @param type_code the class name to decode
- * @return the corresponding Class object
- * @throws ClassNotFoundException if the class cannot be located
- * @see #getClassForEncoding(String, boolean)
- */
- public static Class getClassForEncoding(String type_code)
- throws ClassNotFoundException
- {
- return getClassForEncoding(type_code, true);
- }
-
- /**
- * Returns a <code>String</code> representing the type-encoding of a
- * method. The type-encoding of a method is:
- *
- * "(" + parameter type descriptors + ")" + return type descriptor
- *
- * XXX This could be faster if it were implemented natively.
- *
- * @param m the method to encode
- * @return the encoding
- */
- public static String getEncodingOfMethod(Method m)
- {
- Class[] paramTypes = m.getParameterTypes();
- StringBuffer buf = new StringBuffer().append('(');
- for (int i = 0; i < paramTypes.length; i++)
- buf.append(getEncodingOfClass(paramTypes[i].getName(), true));
- buf.append(')').append(getEncodingOfClass(m.getReturnType().getName(),
- true));
- return buf.toString();
- }
-
- /**
- * Returns a <code>String</code> representing the type-encoding of a
- * constructor. The type-encoding of a method is:
- *
- * "(" + parameter type descriptors + ")V"
- *
- * XXX This could be faster if it were implemented natively.
- *
- * @param c the constructor to encode
- * @return the encoding
- */
- public static String getEncodingOfConstructor(Constructor c)
- {
- Class[] paramTypes = c.getParameterTypes();
- StringBuffer buf = new StringBuffer().append('(');
- for (int i = 0; i < paramTypes.length; i++)
- buf.append(getEncodingOfClass(paramTypes[i].getName(), true));
- buf.append(")V");
- return buf.toString();
- }
-
- /**
- * Returns a <code>String</code> representing the type-encoding of a
- * class member. This appropriately handles Constructors, Methods, and
- * Fields.
- *
- * @param mem the member to encode
- * @return the encoding
- */
- public static String getEncodingOfMember(Member mem)
- {
- if (mem instanceof Constructor)
- return getEncodingOfConstructor((Constructor) mem);
- if (mem instanceof Method)
- return getEncodingOfMethod((Method) mem);
- else // Field
- return getEncodingOfClass(((Field) mem).getType().getName(), true);
- }
-} // class TypeSignature
diff --git a/libjava/gnu/java/math/MPN.java b/libjava/gnu/java/math/MPN.java
deleted file mode 100644
index 05491bb7e84..00000000000
--- a/libjava/gnu/java/math/MPN.java
+++ /dev/null
@@ -1,771 +0,0 @@
-/* gnu.java.math.MPN
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-// Included from Kawa 1.6.62 with permission of the author,
-// Per Bothner <per@bothner.com>.
-
-package gnu.java.math;
-
-/** This contains various low-level routines for unsigned bigints.
- * The interfaces match the mpn interfaces in gmp,
- * so it should be easy to replace them with fast native functions
- * that are trivial wrappers around the mpn_ functions in gmp
- * (at least on platforms that use 32-bit "limbs").
- */
-
-public class MPN
-{
- /** Add x[0:size-1] and y, and write the size least
- * significant words of the result to dest.
- * Return carry, either 0 or 1.
- * All values are unsigned.
- * This is basically the same as gmp's mpn_add_1. */
- public static int add_1 (int[] dest, int[] x, int size, int y)
- {
- long carry = (long) y & 0xffffffffL;
- for (int i = 0; i < size; i++)
- {
- carry += ((long) x[i] & 0xffffffffL);
- dest[i] = (int) carry;
- carry >>= 32;
- }
- return (int) carry;
- }
-
- /** Add x[0:len-1] and y[0:len-1] and write the len least
- * significant words of the result to dest[0:len-1].
- * All words are treated as unsigned.
- * @return the carry, either 0 or 1
- * This function is basically the same as gmp's mpn_add_n.
- */
- public static int add_n (int dest[], int[] x, int[] y, int len)
- {
- long carry = 0;
- for (int i = 0; i < len; i++)
- {
- carry += ((long) x[i] & 0xffffffffL)
- + ((long) y[i] & 0xffffffffL);
- dest[i] = (int) carry;
- carry >>>= 32;
- }
- return (int) carry;
- }
-
- /** Subtract Y[0:size-1] from X[0:size-1], and write
- * the size least significant words of the result to dest[0:size-1].
- * Return borrow, either 0 or 1.
- * This is basically the same as gmp's mpn_sub_n function.
- */
-
- public static int sub_n (int[] dest, int[] X, int[] Y, int size)
- {
- int cy = 0;
- for (int i = 0; i < size; i++)
- {
- int y = Y[i];
- int x = X[i];
- y += cy; /* add previous carry to subtrahend */
- // Invert the high-order bit, because: (unsigned) X > (unsigned) Y
- // iff: (int) (X^0x80000000) > (int) (Y^0x80000000).
- cy = (y^0x80000000) < (cy^0x80000000) ? 1 : 0;
- y = x - y;
- cy += (y^0x80000000) > (x ^ 0x80000000) ? 1 : 0;
- dest[i] = y;
- }
- return cy;
- }
-
- /** Multiply x[0:len-1] by y, and write the len least
- * significant words of the product to dest[0:len-1].
- * Return the most significant word of the product.
- * All values are treated as if they were unsigned
- * (i.e. masked with 0xffffffffL).
- * OK if dest==x (not sure if this is guaranteed for mpn_mul_1).
- * This function is basically the same as gmp's mpn_mul_1.
- */
-
- public static int mul_1 (int[] dest, int[] x, int len, int y)
- {
- long yword = (long) y & 0xffffffffL;
- long carry = 0;
- for (int j = 0; j < len; j++)
- {
- carry += ((long) x[j] & 0xffffffffL) * yword;
- dest[j] = (int) carry;
- carry >>>= 32;
- }
- return (int) carry;
- }
-
- /**
- * Multiply x[0:xlen-1] and y[0:ylen-1], and
- * write the result to dest[0:xlen+ylen-1].
- * The destination has to have space for xlen+ylen words,
- * even if the result might be one limb smaller.
- * This function requires that xlen >= ylen.
- * The destination must be distinct from either input operands.
- * All operands are unsigned.
- * This function is basically the same gmp's mpn_mul. */
-
- public static void mul (int[] dest,
- int[] x, int xlen,
- int[] y, int ylen)
- {
- dest[xlen] = MPN.mul_1 (dest, x, xlen, y[0]);
-
- for (int i = 1; i < ylen; i++)
- {
- long yword = (long) y[i] & 0xffffffffL;
- long carry = 0;
- for (int j = 0; j < xlen; j++)
- {
- carry += ((long) x[j] & 0xffffffffL) * yword
- + ((long) dest[i+j] & 0xffffffffL);
- dest[i+j] = (int) carry;
- carry >>>= 32;
- }
- dest[i+xlen] = (int) carry;
- }
- }
-
- /* Divide (unsigned long) N by (unsigned int) D.
- * Returns (remainder << 32)+(unsigned int)(quotient).
- * Assumes (unsigned int)(N>>32) < (unsigned int)D.
- * Code transcribed from gmp-2.0's mpn_udiv_w_sdiv function.
- */
- public static long udiv_qrnnd (long N, int D)
- {
- long q, r;
- long a1 = N >>> 32;
- long a0 = N & 0xffffffffL;
- if (D >= 0)
- {
- if (a1 < ((D - a1 - (a0 >>> 31)) & 0xffffffffL))
- {
- /* dividend, divisor, and quotient are nonnegative */
- q = N / D;
- r = N % D;
- }
- else
- {
- /* Compute c1*2^32 + c0 = a1*2^32 + a0 - 2^31*d */
- long c = N - ((long) D << 31);
- /* Divide (c1*2^32 + c0) by d */
- q = c / D;
- r = c % D;
- /* Add 2^31 to quotient */
- q += 1 << 31;
- }
- }
- else
- {
- long b1 = D >>> 1; /* d/2, between 2^30 and 2^31 - 1 */
- //long c1 = (a1 >> 1); /* A/2 */
- //int c0 = (a1 << 31) + (a0 >> 1);
- long c = N >>> 1;
- if (a1 < b1 || (a1 >> 1) < b1)
- {
- if (a1 < b1)
- {
- q = c / b1;
- r = c % b1;
- }
- else /* c1 < b1, so 2^31 <= (A/2)/b1 < 2^32 */
- {
- c = ~(c - (b1 << 32));
- q = c / b1; /* (A/2) / (d/2) */
- r = c % b1;
- q = (~q) & 0xffffffffL; /* (A/2)/b1 */
- r = (b1 - 1) - r; /* r < b1 => new r >= 0 */
- }
- r = 2 * r + (a0 & 1);
- if ((D & 1) != 0)
- {
- if (r >= q) {
- r = r - q;
- } else if (q - r <= ((long) D & 0xffffffffL)) {
- r = r - q + D;
- q -= 1;
- } else {
- r = r - q + D + D;
- q -= 2;
- }
- }
- }
- else /* Implies c1 = b1 */
- { /* Hence a1 = d - 1 = 2*b1 - 1 */
- if (a0 >= ((long)(-D) & 0xffffffffL))
- {
- q = -1;
- r = a0 + D;
- }
- else
- {
- q = -2;
- r = a0 + D + D;
- }
- }
- }
-
- return (r << 32) | (q & 0xFFFFFFFFl);
- }
-
- /** Divide divident[0:len-1] by (unsigned int)divisor.
- * Write result into quotient[0:len-1.
- * Return the one-word (unsigned) remainder.
- * OK for quotient==dividend.
- */
-
- public static int divmod_1 (int[] quotient, int[] dividend,
- int len, int divisor)
- {
- int i = len - 1;
- long r = dividend[i];
- if ((r & 0xffffffffL) >= ((long)divisor & 0xffffffffL))
- r = 0;
- else
- {
- quotient[i--] = 0;
- r <<= 32;
- }
-
- for (; i >= 0; i--)
- {
- int n0 = dividend[i];
- r = (r & ~0xffffffffL) | (n0 & 0xffffffffL);
- r = udiv_qrnnd (r, divisor);
- quotient[i] = (int) r;
- }
- return (int)(r >> 32);
- }
-
- /* Subtract x[0:len-1]*y from dest[offset:offset+len-1].
- * All values are treated as if unsigned.
- * @return the most significant word of
- * the product, minus borrow-out from the subtraction.
- */
- public static int submul_1 (int[] dest, int offset, int[] x, int len, int y)
- {
- long yl = (long) y & 0xffffffffL;
- int carry = 0;
- int j = 0;
- do
- {
- long prod = ((long) x[j] & 0xffffffffL) * yl;
- int prod_low = (int) prod;
- int prod_high = (int) (prod >> 32);
- prod_low += carry;
- // Invert the high-order bit, because: (unsigned) X > (unsigned) Y
- // iff: (int) (X^0x80000000) > (int) (Y^0x80000000).
- carry = ((prod_low ^ 0x80000000) < (carry ^ 0x80000000) ? 1 : 0)
- + prod_high;
- int x_j = dest[offset+j];
- prod_low = x_j - prod_low;
- if ((prod_low ^ 0x80000000) > (x_j ^ 0x80000000))
- carry++;
- dest[offset+j] = prod_low;
- }
- while (++j < len);
- return carry;
- }
-
- /** Divide zds[0:nx] by y[0:ny-1].
- * The remainder ends up in zds[0:ny-1].
- * The quotient ends up in zds[ny:nx].
- * Assumes: nx>ny.
- * (int)y[ny-1] < 0 (i.e. most significant bit set)
- */
-
- public static void divide (int[] zds, int nx, int[] y, int ny)
- {
- // This is basically Knuth's formulation of the classical algorithm,
- // but translated from in scm_divbigbig in Jaffar's SCM implementation.
-
- // Correspondance with Knuth's notation:
- // Knuth's u[0:m+n] == zds[nx:0].
- // Knuth's v[1:n] == y[ny-1:0]
- // Knuth's n == ny.
- // Knuth's m == nx-ny.
- // Our nx == Knuth's m+n.
-
- // Could be re-implemented using gmp's mpn_divrem:
- // zds[nx] = mpn_divrem (&zds[ny], 0, zds, nx, y, ny).
-
- int j = nx;
- do
- { // loop over digits of quotient
- // Knuth's j == our nx-j.
- // Knuth's u[j:j+n] == our zds[j:j-ny].
- int qhat; // treated as unsigned
- if (zds[j]==y[ny-1])
- qhat = -1; // 0xffffffff
- else
- {
- long w = (((long)(zds[j])) << 32) + ((long)zds[j-1] & 0xffffffffL);
- qhat = (int) udiv_qrnnd (w, y[ny-1]);
- }
- if (qhat != 0)
- {
- int borrow = submul_1 (zds, j - ny, y, ny, qhat);
- int save = zds[j];
- long num = ((long)save&0xffffffffL) - ((long)borrow&0xffffffffL);
- while (num != 0)
- {
- qhat--;
- long carry = 0;
- for (int i = 0; i < ny; i++)
- {
- carry += ((long) zds[j-ny+i] & 0xffffffffL)
- + ((long) y[i] & 0xffffffffL);
- zds[j-ny+i] = (int) carry;
- carry >>>= 32;
- }
- zds[j] += carry;
- num = carry - 1;
- }
- }
- zds[j] = qhat;
- } while (--j >= ny);
- }
-
- /** Number of digits in the conversion base that always fits in a word.
- * For example, for base 10 this is 9, since 10**9 is the
- * largest number that fits into a words (assuming 32-bit words).
- * This is the same as gmp's __mp_bases[radix].chars_per_limb.
- * @param radix the base
- * @return number of digits */
- public static int chars_per_word (int radix)
- {
- if (radix < 10)
- {
- if (radix < 8)
- {
- if (radix <= 2)
- return 32;
- else if (radix == 3)
- return 20;
- else if (radix == 4)
- return 16;
- else
- return 18 - radix;
- }
- else
- return 10;
- }
- else if (radix < 12)
- return 9;
- else if (radix <= 16)
- return 8;
- else if (radix <= 23)
- return 7;
- else if (radix <= 40)
- return 6;
- // The following are conservative, but we don't care.
- else if (radix <= 256)
- return 4;
- else
- return 1;
- }
-
- /** Count the number of leading zero bits in an int. */
- public static int count_leading_zeros (int i)
- {
- if (i == 0)
- return 32;
- int count = 0;
- for (int k = 16; k > 0; k = k >> 1) {
- int j = i >>> k;
- if (j == 0)
- count += k;
- else
- i = j;
- }
- return count;
- }
-
- public static int set_str (int dest[], byte[] str, int str_len, int base)
- {
- int size = 0;
- if ((base & (base - 1)) == 0)
- {
- // The base is a power of 2. Read the input string from
- // least to most significant character/digit. */
-
- int next_bitpos = 0;
- int bits_per_indigit = 0;
- for (int i = base; (i >>= 1) != 0; ) bits_per_indigit++;
- int res_digit = 0;
-
- for (int i = str_len; --i >= 0; )
- {
- int inp_digit = str[i];
- res_digit |= inp_digit << next_bitpos;
- next_bitpos += bits_per_indigit;
- if (next_bitpos >= 32)
- {
- dest[size++] = res_digit;
- next_bitpos -= 32;
- res_digit = inp_digit >> (bits_per_indigit - next_bitpos);
- }
- }
-
- if (res_digit != 0)
- dest[size++] = res_digit;
- }
- else
- {
- // General case. The base is not a power of 2.
- int indigits_per_limb = MPN.chars_per_word (base);
- int str_pos = 0;
-
- while (str_pos < str_len)
- {
- int chunk = str_len - str_pos;
- if (chunk > indigits_per_limb)
- chunk = indigits_per_limb;
- int res_digit = str[str_pos++];
- int big_base = base;
-
- while (--chunk > 0)
- {
- res_digit = res_digit * base + str[str_pos++];
- big_base *= base;
- }
-
- int cy_limb;
- if (size == 0)
- cy_limb = res_digit;
- else
- {
- cy_limb = MPN.mul_1 (dest, dest, size, big_base);
- cy_limb += MPN.add_1 (dest, dest, size, res_digit);
- }
- if (cy_limb != 0)
- dest[size++] = cy_limb;
- }
- }
- return size;
- }
-
- /** Compare x[0:size-1] with y[0:size-1], treating them as unsigned integers.
- * @result -1, 0, or 1 depending on if x&lt;y, x==y, or x&gt;y.
- * This is basically the same as gmp's mpn_cmp function.
- */
- public static int cmp (int[] x, int[] y, int size)
- {
- while (--size >= 0)
- {
- int x_word = x[size];
- int y_word = y[size];
- if (x_word != y_word)
- {
- // Invert the high-order bit, because:
- // (unsigned) X > (unsigned) Y iff
- // (int) (X^0x80000000) > (int) (Y^0x80000000).
- return (x_word ^ 0x80000000) > (y_word ^0x80000000) ? 1 : -1;
- }
- }
- return 0;
- }
-
- /**
- * Compare x[0:xlen-1] with y[0:ylen-1], treating them as unsigned integers.
- *
- * @return -1, 0, or 1 depending on if x&lt;y, x==y, or x&gt;y.
- */
- public static int cmp (int[] x, int xlen, int[] y, int ylen)
- {
- return xlen > ylen ? 1 : xlen < ylen ? -1 : cmp (x, y, xlen);
- }
-
- /**
- * Shift x[x_start:x_start+len-1] count bits to the "right"
- * (i.e. divide by 2**count).
- * Store the len least significant words of the result at dest.
- * The bits shifted out to the right are returned.
- * OK if dest==x.
- * Assumes: 0 &lt; count &lt; 32
- */
- public static int rshift (int[] dest, int[] x, int x_start,
- int len, int count)
- {
- int count_2 = 32 - count;
- int low_word = x[x_start];
- int retval = low_word << count_2;
- int i = 1;
- for (; i < len; i++)
- {
- int high_word = x[x_start+i];
- dest[i-1] = (low_word >>> count) | (high_word << count_2);
- low_word = high_word;
- }
- dest[i-1] = low_word >>> count;
- return retval;
- }
-
- /**
- * Shift x[x_start:x_start+len-1] count bits to the "right"
- * (i.e. divide by 2**count).
- * Store the len least significant words of the result at dest.
- * OK if dest==x.
- * Assumes: 0 &lt;= count &lt; 32
- * Same as rshift, but handles count==0 (and has no return value).
- */
- public static void rshift0 (int[] dest, int[] x, int x_start,
- int len, int count)
- {
- if (count > 0)
- rshift(dest, x, x_start, len, count);
- else
- for (int i = 0; i < len; i++)
- dest[i] = x[i + x_start];
- }
-
- /** Return the long-truncated value of right shifting.
- * @param x a two's-complement "bignum"
- * @param len the number of significant words in x
- * @param count the shift count
- * @return (long)(x[0..len-1] &gt;&gt; count).
- */
- public static long rshift_long (int[] x, int len, int count)
- {
- int wordno = count >> 5;
- count &= 31;
- int sign = x[len-1] < 0 ? -1 : 0;
- int w0 = wordno >= len ? sign : x[wordno];
- wordno++;
- int w1 = wordno >= len ? sign : x[wordno];
- if (count != 0)
- {
- wordno++;
- int w2 = wordno >= len ? sign : x[wordno];
- w0 = (w0 >>> count) | (w1 << (32-count));
- w1 = (w1 >>> count) | (w2 << (32-count));
- }
- return ((long)w1 << 32) | ((long)w0 & 0xffffffffL);
- }
-
- /* Shift x[0:len-1] left by count bits, and store the len least
- * significant words of the result in dest[d_offset:d_offset+len-1].
- * Return the bits shifted out from the most significant digit.
- * Assumes 0 &lt; count &lt; 32.
- * OK if dest==x.
- */
-
- public static int lshift (int[] dest, int d_offset,
- int[] x, int len, int count)
- {
- int count_2 = 32 - count;
- int i = len - 1;
- int high_word = x[i];
- int retval = high_word >>> count_2;
- d_offset++;
- while (--i >= 0)
- {
- int low_word = x[i];
- dest[d_offset+i] = (high_word << count) | (low_word >>> count_2);
- high_word = low_word;
- }
- dest[d_offset+i] = high_word << count;
- return retval;
- }
-
- /** Return least i such that word &amp; (1&lt;&lt;i). Assumes word!=0. */
-
- public static int findLowestBit (int word)
- {
- int i = 0;
- while ((word & 0xF) == 0)
- {
- word >>= 4;
- i += 4;
- }
- if ((word & 3) == 0)
- {
- word >>= 2;
- i += 2;
- }
- if ((word & 1) == 0)
- i += 1;
- return i;
- }
-
- /** Return least i such that words &amp; (1&lt;&lt;i). Assumes there is such an i. */
-
- public static int findLowestBit (int[] words)
- {
- for (int i = 0; ; i++)
- {
- if (words[i] != 0)
- return 32 * i + findLowestBit (words[i]);
- }
- }
-
- /** Calculate Greatest Common Divisior of x[0:len-1] and y[0:len-1].
- * Assumes both arguments are non-zero.
- * Leaves result in x, and returns len of result.
- * Also destroys y (actually sets it to a copy of the result). */
-
- public static int gcd (int[] x, int[] y, int len)
- {
- int i, word;
- // Find sh such that both x and y are divisible by 2**sh.
- for (i = 0; ; i++)
- {
- word = x[i] | y[i];
- if (word != 0)
- {
- // Must terminate, since x and y are non-zero.
- break;
- }
- }
- int initShiftWords = i;
- int initShiftBits = findLowestBit (word);
- // Logically: sh = initShiftWords * 32 + initShiftBits
-
- // Temporarily devide both x and y by 2**sh.
- len -= initShiftWords;
- MPN.rshift0 (x, x, initShiftWords, len, initShiftBits);
- MPN.rshift0 (y, y, initShiftWords, len, initShiftBits);
-
- int[] odd_arg; /* One of x or y which is odd. */
- int[] other_arg; /* The other one can be even or odd. */
- if ((x[0] & 1) != 0)
- {
- odd_arg = x;
- other_arg = y;
- }
- else
- {
- odd_arg = y;
- other_arg = x;
- }
-
- for (;;)
- {
- // Shift other_arg until it is odd; this doesn't
- // affect the gcd, since we divide by 2**k, which does not
- // divide odd_arg.
- for (i = 0; other_arg[i] == 0; ) i++;
- if (i > 0)
- {
- int j;
- for (j = 0; j < len-i; j++)
- other_arg[j] = other_arg[j+i];
- for ( ; j < len; j++)
- other_arg[j] = 0;
- }
- i = findLowestBit(other_arg[0]);
- if (i > 0)
- MPN.rshift (other_arg, other_arg, 0, len, i);
-
- // Now both odd_arg and other_arg are odd.
-
- // Subtract the smaller from the larger.
- // This does not change the result, since gcd(a-b,b)==gcd(a,b).
- i = MPN.cmp(odd_arg, other_arg, len);
- if (i == 0)
- break;
- if (i > 0)
- { // odd_arg > other_arg
- MPN.sub_n (odd_arg, odd_arg, other_arg, len);
- // Now odd_arg is even, so swap with other_arg;
- int[] tmp = odd_arg; odd_arg = other_arg; other_arg = tmp;
- }
- else
- { // other_arg > odd_arg
- MPN.sub_n (other_arg, other_arg, odd_arg, len);
- }
- while (odd_arg[len-1] == 0 && other_arg[len-1] == 0)
- len--;
- }
- if (initShiftWords + initShiftBits > 0)
- {
- if (initShiftBits > 0)
- {
- int sh_out = MPN.lshift (x, initShiftWords, x, len, initShiftBits);
- if (sh_out != 0)
- x[(len++)+initShiftWords] = sh_out;
- }
- else
- {
- for (i = len; --i >= 0;)
- x[i+initShiftWords] = x[i];
- }
- for (i = initShiftWords; --i >= 0; )
- x[i] = 0;
- len += initShiftWords;
- }
- return len;
- }
-
- public static int intLength (int i)
- {
- return 32 - count_leading_zeros (i < 0 ? ~i : i);
- }
-
- /** Calcaulte the Common Lisp "integer-length" function.
- * Assumes input is canonicalized: len==BigInteger.wordsNeeded(words,len) */
- public static int intLength (int[] words, int len)
- {
- len--;
- return intLength (words[len]) + 32 * len;
- }
-
- /* DEBUGGING:
- public static void dprint (BigInteger x)
- {
- if (x.words == null)
- System.err.print(Long.toString((long) x.ival & 0xffffffffL, 16));
- else
- dprint (System.err, x.words, x.ival);
- }
- public static void dprint (int[] x) { dprint (System.err, x, x.length); }
- public static void dprint (int[] x, int len) { dprint (System.err, x, len); }
- public static void dprint (java.io.PrintStream ps, int[] x, int len)
- {
- ps.print('(');
- for (int i = 0; i < len; i++)
- {
- if (i > 0)
- ps.print (' ');
- ps.print ("#x" + Long.toString ((long) x[i] & 0xffffffffL, 16));
- }
- ps.print(')');
- }
- */
-}
diff --git a/libjava/gnu/java/net/BASE64.java b/libjava/gnu/java/net/BASE64.java
deleted file mode 100644
index 901aa0c35fc..00000000000
--- a/libjava/gnu/java/net/BASE64.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/* BASE.java --
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-/**
- * Encodes and decodes text according to the BASE64 encoding.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public final class BASE64
-{
- private static final byte[] src = {
- 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a,
- 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54,
- 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x61, 0x62, 0x63, 0x64,
- 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e,
- 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
- 0x79, 0x7a, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
- 0x38, 0x39, 0x2b, 0x2f
- };
-
- private static final byte[] dst;
- static
- {
- dst = new byte[0x100];
- for (int i = 0x0; i < 0xff; i++)
- {
- dst[i] = -1;
- }
- for (int i = 0; i < src.length; i++)
- {
- dst[src[i]] = (byte) i;
- }
- }
-
- private BASE64()
- {
- }
-
- /**
- * Encode the specified byte array using the BASE64 algorithm.
- *
- * @param bs the source byte array
- */
- public static byte[] encode(byte[] bs)
- {
- int si = 0, ti = 0; // source/target array indices
- byte[] bt = new byte[((bs.length + 2) * 4) / 3]; // target byte array
- for (; si < bs.length; si += 3)
- {
- int buflen = bs.length - si;
- if (buflen == 1)
- {
- byte b = bs[si];
- int i = 0;
- bt[ti++] = src[b >>> 2 & 0x3f];
- bt[ti++] = src[(b << 4 & 0x30) + (i >>> 4 & 0xf)];
- }
- else if (buflen == 2)
- {
- byte b1 = bs[si], b2 = bs[si + 1];
- int i = 0;
- bt[ti++] = src[b1 >>> 2 & 0x3f];
- bt[ti++] = src[(b1 << 4 & 0x30) + (b2 >>> 4 & 0xf)];
- bt[ti++] = src[(b2 << 2 & 0x3c) + (i >>> 6 & 0x3)];
- }
- else
- {
- byte b1 = bs[si], b2 = bs[si + 1], b3 = bs[si + 2];
- bt[ti++] = src[b1 >>> 2 & 0x3f];
- bt[ti++] = src[(b1 << 4 & 0x30) + (b2 >>> 4 & 0xf)];
- bt[ti++] = src[(b2 << 2 & 0x3c) + (b3 >>> 6 & 0x3)];
- bt[ti++] = src[b3 & 0x3f];
- }
- }
- if (ti < bt.length)
- {
- byte[] tmp = new byte[ti];
- System.arraycopy(bt, 0, tmp, 0, ti);
- bt = tmp;
- }
- /*while (ti < bt.length)
- {
- bt[ti++] = 0x3d;
- }*/
- return bt;
- }
-
- /**
- * Decode the specified byte array using the BASE64 algorithm.
- *
- * @param bs the source byte array
- */
- public static byte[] decode(byte[] bs)
- {
- int srclen = bs.length;
- while (srclen > 0 && bs[srclen - 1] == 0x3d)
- {
- srclen--; /* strip padding character */
- }
- byte[] buffer = new byte[srclen];
- int buflen = 0;
- int si = 0;
- int len = srclen - si;
- while (len > 0)
- {
- byte b0 = dst[bs[si++] & 0xff];
- byte b2 = dst[bs[si++] & 0xff];
- buffer[buflen++] = (byte) (b0 << 2 & 0xfc | b2 >>> 4 & 0x3);
- if (len > 2)
- {
- b0 = b2;
- b2 = dst[bs[si++] & 0xff];
- buffer[buflen++] = (byte) (b0 << 4 & 0xf0 | b2 >>> 2 & 0xf);
- if (len > 3)
- {
- b0 = b2;
- b2 = dst[bs[si++] & 0xff];
- buffer[buflen++] = (byte) (b0 << 6 & 0xc0 | b2 & 0x3f);
- }
- }
- len = srclen - si;
- }
- byte[] bt = new byte[buflen];
- System.arraycopy(buffer, 0, bt, 0, buflen);
- return bt;
- }
-
- public static void main(String[] args)
- {
- boolean decode = false;
- for (int i = 0; i < args.length; i++)
- {
- if (args[i].equals("-d"))
- {
- decode = true;
- }
- else
- {
- try
- {
- byte[] in = args[i].getBytes("US-ASCII");
- byte[] out = decode ? decode(in) : encode(in);
- System.out.println(args[i] + " = " +
- new String(out, "US-ASCII"));
- }
- catch (java.io.UnsupportedEncodingException e)
- {
- e.printStackTrace(System.err);
- }
- }
- }
- }
-}
diff --git a/libjava/gnu/java/net/CRLFInputStream.java b/libjava/gnu/java/net/CRLFInputStream.java
deleted file mode 100644
index d0f9e8c4130..00000000000
--- a/libjava/gnu/java/net/CRLFInputStream.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/* CRLFInputStream.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-import java.io.BufferedInputStream;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * An input stream that filters out CR/LF pairs into LFs.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class CRLFInputStream
- extends FilterInputStream
-{
- /**
- * The CR octet.
- */
- public static final int CR = 13;
-
- /**
- * The LF octet.
- */
- public static final int LF = 10;
-
- private boolean doReset;
-
- /**
- * Constructs a CR/LF input stream connected to the specified input
- * stream.
- */
- public CRLFInputStream(InputStream in)
- {
- super(in.markSupported() ? in : new BufferedInputStream(in));
- }
-
- /**
- * Reads the next byte of data from this input stream.
- * Returns -1 if the end of the stream has been reached.
- * @exception IOException if an I/O error occurs
- */
- public int read()
- throws IOException
- {
- int c = in.read();
- if (c == CR)
- {
- in.mark(1);
- int d = in.read();
- if (d == LF)
- {
- c = d;
- }
- else
- {
- in.reset();
- }
- }
- return c;
- }
-
- /**
- * Reads up to b.length bytes of data from this input stream into
- * an array of bytes.
- * Returns -1 if the end of the stream has been reached.
- * @exception IOException if an I/O error occurs
- */
- public int read(byte[] b)
- throws IOException
- {
- return read(b, 0, b.length);
- }
-
- /**
- * Reads up to len bytes of data from this input stream into an
- * array of bytes, starting at the specified offset.
- * Returns -1 if the end of the stream has been reached.
- * @exception IOException if an I/O error occurs
- */
- public int read(byte[] b, int off, int len)
- throws IOException
- {
- in.mark(len + 1);
- int l = in.read(b, off, len);
- if (l > 0)
- {
- int i = indexOfCRLF(b, off, l);
- if (doReset)
- {
- in.reset();
- if (i != -1)
- {
- l = in.read(b, off, i + 1); // read to CR
- in.read(); // skip LF
- b[i] = LF; // fix CR as LF
- }
- else
- {
- l = in.read(b, off, len); // CR(s) but no LF
- }
- }
- }
- return l;
- }
-
- private int indexOfCRLF(byte[] b, int off, int len)
- throws IOException
- {
- doReset = false;
- int lm1 = len - 1;
- for (int i = off; i < len; i++)
- {
- if (b[i] == CR)
- {
- int d;
- if (i == lm1)
- {
- d = in.read();
- doReset = true;
- }
- else
- {
- d = b[i + 1];
- }
- if (d == LF)
- {
- doReset = true;
- return i;
- }
- }
- }
- return -1;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/CRLFOutputStream.java b/libjava/gnu/java/net/CRLFOutputStream.java
deleted file mode 100644
index f27e0f218ad..00000000000
--- a/libjava/gnu/java/net/CRLFOutputStream.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/* CRLFOutputStream.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-
-/**
- * An output stream that filters LFs into CR/LF pairs.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class CRLFOutputStream
- extends FilterOutputStream
-{
- static final String US_ASCII = "US-ASCII";
-
- /**
- * The CR octet.
- */
- public static final int CR = 13;
-
- /**
- * The LF octet.
- */
- public static final int LF = 10;
-
- /**
- * The CR/LF pair.
- */
- public static final byte[] CRLF = { CR, LF };
-
- /**
- * The last byte read.
- */
- protected int last;
-
- /**
- * Constructs a CR/LF output stream connected to the specified output stream.
- */
- public CRLFOutputStream(OutputStream out)
- {
- super(out);
- last = -1;
- }
-
- /**
- * Writes a character to the underlying stream.
- * @exception IOException if an I/O error occurred
- */
- public void write(int ch) throws IOException
- {
- if (ch == CR)
- {
- out.write(CRLF);
- }
- else if (ch == LF)
- {
- if (last != CR)
- {
- out.write(CRLF);
- }
- }
- else
- {
- out.write(ch);
- }
- last = ch;
- }
-
- /**
- * Writes a byte array to the underlying stream.
- * @exception IOException if an I/O error occurred
- */
- public void write(byte[] b)
- throws IOException
- {
- write(b, 0, b.length);
- }
-
- /**
- * Writes a portion of a byte array to the underlying stream.
- * @exception IOException if an I/O error occurred
- */
- public void write(byte[] b, int off, int len)
- throws IOException
- {
- int d = off;
- len += off;
- for (int i = off; i < len; i++)
- {
- switch (b[i])
- {
- case CR:
- out.write (b, d, i - d);
- out.write (CRLF, 0, 2);
- d = i + 1;
- break;
- case LF:
- if (last != CR)
- {
- out.write (b, d, i - d);
- out.write (CRLF, 0, 2);
- }
- d = i + 1;
- break;
- }
- last = b[i];
- }
- if (len - d > 0)
- {
- out.write (b, d, len - d);
- }
- }
-
- /**
- * Writes the specified ASCII string to the underlying stream.
- * @exception IOException if an I/O error occurred
- */
- public void write(String text)
- throws IOException
- {
- try
- {
- byte[] bytes = text.getBytes(US_ASCII);
- write(bytes, 0, bytes.length);
- }
- catch (UnsupportedEncodingException e)
- {
- throw new IOException("The US-ASCII encoding is not supported " +
- "on this system");
- }
- }
-
- /**
- * Writes a newline to the underlying stream.
- * @exception IOException if an I/O error occurred
- */
- public void writeln()
- throws IOException
- {
- out.write(CRLF, 0, 2);
- }
-}
-
diff --git a/libjava/gnu/java/net/EmptyX509TrustManager.java b/libjava/gnu/java/net/EmptyX509TrustManager.java
deleted file mode 100644
index b8faf41add7..00000000000
--- a/libjava/gnu/java/net/EmptyX509TrustManager.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* EmptyX509TrustManager.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.X509TrustManager;
-
-/**
- * Empty implementation of an X509 trust manager.
- * This implementation does not check any certificates in the chain.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class EmptyX509TrustManager
- implements X509TrustManager
-{
- public void checkClientTrusted(X509Certificate[] chain, String authType)
- throws CertificateException
- {
- }
-
- public void checkServerTrusted(X509Certificate[] chain, String authType)
- throws CertificateException
- {
- }
-
- public X509Certificate[] getAcceptedIssuers()
- {
- return new X509Certificate[0];
- }
-}
-
diff --git a/libjava/gnu/java/net/GetLocalHostAction.java b/libjava/gnu/java/net/GetLocalHostAction.java
deleted file mode 100644
index 7483b025773..00000000000
--- a/libjava/gnu/java/net/GetLocalHostAction.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* GetLocalHostAction.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.security.PrivilegedAction;
-
-/**
- * Privileged action to retrieve the local host InetAddress.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class GetLocalHostAction
- implements PrivilegedAction
-{
- public Object run()
- {
- try
- {
- return InetAddress.getLocalHost();
- }
- catch (UnknownHostException e)
- {
- return null;
- }
- }
-}
-
diff --git a/libjava/gnu/java/net/HeaderFieldHelper.java b/libjava/gnu/java/net/HeaderFieldHelper.java
deleted file mode 100644
index 0fb8d953d21..00000000000
--- a/libjava/gnu/java/net/HeaderFieldHelper.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* HeaderFieldHelper.java -- Helps manage headers fields
- Copyright (C) 1998, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-/**
- * This class manages header field keys and values.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class HeaderFieldHelper
-{
- private Vector headerFieldKeys;
- private Vector headerFieldValues;
-
- public HeaderFieldHelper()
- {
- this (10);
- }
-
- public HeaderFieldHelper (int size)
- {
- headerFieldKeys = new Vector (size);
- headerFieldValues = new Vector (size);
- }
-
- public void addHeaderField (String key, String value)
- {
- headerFieldKeys.addElement (key);
- headerFieldValues.addElement (value);
- }
-
- public String getHeaderFieldKeyByIndex (int index)
- {
- String key = null;
-
- try
- {
- key = (String) headerFieldKeys.elementAt (index);
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- }
-
- return key;
- }
-
- public String getHeaderFieldValueByIndex(int index)
- {
- String value = null;
-
- try
- {
- value = (String) headerFieldValues.elementAt (index);
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- }
-
- return value;
- }
-
- public String getHeaderFieldValueByKey(String key)
- {
- String value = null;
-
- try
- {
- value = (String) headerFieldValues.elementAt
- (headerFieldKeys.indexOf(key));
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- }
-
- return value;
- }
-
- public Map getHeaderFields()
- {
- HashMap headers = new HashMap();
- int max = headerFieldKeys.size();
-
- for (int index = 0; index < max; index++)
- {
- headers.put(headerFieldKeys.elementAt(index),
- headerFieldValues.elementAt(index));
- }
-
- return headers;
- }
-
- public int getNumberOfEntries()
- {
- return headerFieldKeys.size();
- }
-
-} // class HeaderFieldHelper
-
diff --git a/libjava/gnu/java/net/LineInputStream.java b/libjava/gnu/java/net/LineInputStream.java
deleted file mode 100644
index 5ca068618da..00000000000
--- a/libjava/gnu/java/net/LineInputStream.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/* LineInputStream.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-import java.io.ByteArrayOutputStream;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * An input stream that can read lines of input.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class LineInputStream
- extends FilterInputStream
-{
- /*
- * Line buffer.
- */
- private ByteArrayOutputStream buf;
-
- /*
- * Encoding to use when translating bytes to characters.
- */
- private String encoding;
-
- /*
- * End-of-stream flag.
- */
- private boolean eof;
-
- /**
- * Whether we can use block reads.
- */
- private final boolean blockReads;
-
- /**
- * Constructor using the US-ASCII character encoding.
- * @param in the underlying input stream
- */
- public LineInputStream(InputStream in)
- {
- this(in, "US-ASCII");
- }
-
- /**
- * Constructor.
- * @param in the underlying input stream
- * @param encoding the character encoding to use
- */
- public LineInputStream(InputStream in, String encoding)
- {
- super(in);
- buf = new ByteArrayOutputStream();
- this.encoding = encoding;
- eof = false;
- blockReads = in.markSupported();
- }
-
- /**
- * Read a line of input.
- */
- public String readLine()
- throws IOException
- {
- if (eof)
- {
- return null;
- }
- do
- {
- if (blockReads)
- {
- // Use mark and reset to read chunks of bytes
- final int MIN_LENGTH = 1024;
- int len, pos;
-
- len = in.available();
- len = (len < MIN_LENGTH) ? MIN_LENGTH : len;
- byte[] b = new byte[len];
- in.mark(len);
- // Read into buffer b
- len = in.read(b, 0, len);
- // Handle EOF
- if (len == -1)
- {
- eof = true;
- if (buf.size() == 0)
- {
- return null;
- }
- else
- {
- // We don't care about resetting buf
- return buf.toString(encoding);
- }
- }
- // Get index of LF in b
- pos = indexOf(b, len, (byte) 0x0a);
- if (pos != -1)
- {
- // Write pos bytes to buf
- buf.write(b, 0, pos);
- // Reset stream, and read pos + 1 bytes
- in.reset();
- pos += 1;
- while (pos > 0)
- {
- len = in.read(b, 0, pos);
- pos = (len == -1) ? -1 : pos - len;
- }
- // Return line
- String ret = buf.toString(encoding);
- buf.reset();
- return ret;
- }
- else
- {
- // Append everything to buf and fall through to re-read.
- buf.write(b, 0, len);
- }
- }
- else
- {
- // We must use character reads in order not to read too much
- // from the underlying stream.
- int c = in.read();
- switch (c)
- {
- case -1:
- eof = true;
- if (buf.size() == 0)
- {
- return null;
- }
- // Fall through and return contents of buffer.
- case 0x0a: // LF
- String ret = buf.toString(encoding);
- buf.reset();
- return ret;
- default:
- buf.write(c);
- }
- }
- }
- while (true);
- }
-
- private int indexOf(byte[] b, int len, byte c)
- {
- for (int pos = 0; pos < len; pos++)
- {
- if (b[pos] == c)
- {
- return pos;
- }
- }
- return -1;
- }
-}
-
diff --git a/libjava/gnu/java/net/URLParseError.java b/libjava/gnu/java/net/URLParseError.java
deleted file mode 100644
index 90907480f11..00000000000
--- a/libjava/gnu/java/net/URLParseError.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* URLParseError.java -- Helps bypassing the exception limitation for
- URLStreamHandler.parseURL().
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-/**
- * This class helps the people writing protocols to report URL parse
- * errors in parseUrl as this method cannot report other exceptions
- * than Errors.
- *
- * The main drawback is that it uses the Error mechanism which should not
- * be used for that type of error reporting.
- *
- * @author Guilhem Lavaux (guilhem@kaffe.org)
- */
-public class URLParseError extends Error
-{
- public URLParseError(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/gnu/java/net/protocol/ftp/ActiveModeDTP.java b/libjava/gnu/java/net/protocol/ftp/ActiveModeDTP.java
deleted file mode 100644
index 3755e8beb8d..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/ActiveModeDTP.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/* ActiveModeDTP.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-
-/**
- * An active mode FTP data transfer process.
- * This starts a server on the specified port listening for a data
- * connection. It converts the socket input into a file stream for reading.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-final class ActiveModeDTP
- implements DTP, Runnable
-{
-
- ServerSocket server;
- Socket socket;
- DTPInputStream in;
- DTPOutputStream out;
- boolean completed;
- boolean inProgress;
- int transferMode;
- IOException exception;
- Thread acceptThread;
- int connectionTimeout;
-
- ActiveModeDTP(InetAddress localhost, int port,
- int connectionTimeout, int timeout)
- throws IOException
- {
- completed = false;
- inProgress = false;
- server = new ServerSocket(port, 1, localhost);
- if (timeout > 0)
- {
- server.setSoTimeout(timeout);
- }
- if (connectionTimeout <= 0)
- {
- connectionTimeout = 20000;
- }
- this.connectionTimeout = connectionTimeout;
- acceptThread = new Thread(this, "ActiveModeDTP");
- acceptThread.start();
- }
-
- /**
- * Start listening.
- */
- public void run()
- {
- try
- {
- socket = server.accept();
- //System.err.println("Accepted connection from "+socket.getInetAddress()+":"+socket.getPort());
- }
- catch (IOException e)
- {
- exception = e;
- }
- }
-
- /**
- * Waits until a client has connected.
- */
- public void waitFor()
- throws IOException
- {
- try
- {
- acceptThread.join(connectionTimeout);
- }
- catch (InterruptedException e)
- {
- }
- if (exception != null)
- {
- throw exception;
- }
- if (socket == null)
- {
- server.close();
- throw new IOException("client did not connect before timeout");
- }
- acceptThread = null;
- }
-
- /**
- * Returns an input stream from which a remote file can be read.
- */
- public InputStream getInputStream()
- throws IOException
- {
- if (inProgress)
- {
- throw new IOException("Transfer in progress");
- }
- if (acceptThread != null)
- {
- waitFor();
- }
- switch (transferMode)
- {
- case FTPConnection.MODE_STREAM:
- in = new StreamInputStream(this, socket.getInputStream());
- break;
- case FTPConnection.MODE_BLOCK:
- in = new BlockInputStream(this, socket.getInputStream());
- break;
- case FTPConnection.MODE_COMPRESSED:
- in = new CompressedInputStream(this, socket.getInputStream());
- break;
- default:
- throw new IllegalStateException("invalid transfer mode");
- }
- in.setTransferComplete(false);
- return in;
- }
-
- /**
- * Returns an output stream to which a local file can be written for
- * upload.
- */
- public OutputStream getOutputStream() throws IOException
- {
- if (inProgress)
- {
- throw new IOException("Transfer in progress");
- }
- if (acceptThread != null)
- {
- waitFor();
- }
- switch (transferMode)
- {
- case FTPConnection.MODE_STREAM:
- out = new StreamOutputStream(this, socket.getOutputStream());
- break;
- case FTPConnection.MODE_BLOCK:
- out = new BlockOutputStream(this, socket.getOutputStream());
- break;
- case FTPConnection.MODE_COMPRESSED:
- out = new CompressedOutputStream(this, socket.getOutputStream());
- break;
- default:
- throw new IllegalStateException("invalid transfer mode");
- }
- out.setTransferComplete(false);
- return out;
- }
-
- public void setTransferMode(int mode)
- {
- transferMode = mode;
- }
-
- public void complete()
- {
- completed = true;
- if (!inProgress)
- {
- transferComplete();
- }
- }
-
- public boolean abort()
- {
- completed = true;
- transferComplete();
- return inProgress;
- }
-
- public void transferComplete()
- {
- if (socket == null)
- {
- return;
- }
- if (in != null)
- {
- in.setTransferComplete(true);
- }
- if (out != null)
- {
- out.setTransferComplete(true);
- }
- completed = completed || (transferMode == FTPConnection.MODE_STREAM);
- if (completed && socket != null)
- {
- try
- {
- socket.close();
- }
- catch (IOException e)
- {
- }
- try
- {
- server.close();
- }
- catch (IOException e)
- {
- }
- }
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/BlockInputStream.java b/libjava/gnu/java/net/protocol/ftp/BlockInputStream.java
deleted file mode 100644
index 63897f1d6db..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/BlockInputStream.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/* BlockInputStream.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * A DTP input stream that implements the FTP block transfer mode.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-class BlockInputStream
- extends DTPInputStream
-{
-
- static final int EOF = 64;
-
- int descriptor;
- int max = -1;
- int count = -1;
-
- BlockInputStream(DTP dtp, InputStream in)
- {
- super(dtp, in);
- }
-
- public int read()
- throws IOException
- {
- if (transferComplete)
- {
- return -1;
- }
- if (count == -1)
- {
- readHeader();
- }
- if (max < 1)
- {
- close();
- return -1;
- }
- int c = in.read();
- if (c == -1)
- {
- dtp.transferComplete();
- }
- count++;
- if (count >= max)
- {
- count = -1;
- if (descriptor == EOF)
- {
- close();
- }
- }
- return c;
- }
-
- public int read(byte[] buf)
- throws IOException
- {
- return read(buf, 0, buf.length);
- }
-
- public int read(byte[] buf, int off, int len)
- throws IOException
- {
- if (transferComplete)
- {
- return -1;
- }
- if (count == -1)
- {
- readHeader();
- }
- if (max < 1)
- {
- close();
- return -1;
- }
- int l = in.read(buf, off, len);
- if (l == -1)
- {
- dtp.transferComplete();
- }
- count += l;
- if (count >= max)
- {
- count = -1;
- if (descriptor == EOF)
- {
- close();
- }
- }
- return l;
- }
-
- /**
- * Reads the block header.
- */
- void readHeader()
- throws IOException
- {
- descriptor = in.read();
- int max_hi = in.read();
- int max_lo = in.read();
- max = (max_hi << 8) | max_lo;
- count = 0;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/BlockOutputStream.java b/libjava/gnu/java/net/protocol/ftp/BlockOutputStream.java
deleted file mode 100644
index 85481c95bd5..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/BlockOutputStream.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/* BlockOutputStream.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * A DTP output stream that implements the FTP block transfer mode.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-class BlockOutputStream
- extends DTPOutputStream
-{
-
- static final byte RECORD = -128; // 0x80
- static final byte EOF = 64; // 0x40
-
- BlockOutputStream(DTP dtp, OutputStream out)
- {
- super(dtp, out);
- }
-
- public void write(int c)
- throws IOException
- {
- if (transferComplete)
- {
- return;
- }
- byte[] buf = new byte[]
- {
- RECORD, /* record descriptor */
- 0x00, 0x01, /* one byte */
- (byte) c /* the byte */
- };
- out.write(buf, 0, 4);
- }
-
- public void write(byte[] b)
- throws IOException
- {
- write(b, 0, b.length);
- }
-
- public void write(byte[] b, int off, int len)
- throws IOException
- {
- if (transferComplete)
- {
- return;
- }
- byte[] buf = new byte[len + 3];
- buf[0] = RECORD; /* record descriptor */
- buf[1] = (byte) ((len & 0x00ff) >> 8); /* high byte of bytecount */
- buf[2] = (byte) (len & 0xff00); /* low byte of bytecount */
- System.arraycopy(b, off, buf, 3, len);
- out.write(buf, 0, len);
- }
-
- public void close()
- throws IOException
- {
- byte[] buf = new byte[]
- {
- EOF, /* eof descriptor */
- 0x00, 0x00 /* no bytes */
- };
- out.write(buf, 0, 3);
- super.close();
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/CompressedInputStream.java b/libjava/gnu/java/net/protocol/ftp/CompressedInputStream.java
deleted file mode 100644
index f2e65b7d37e..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/CompressedInputStream.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/* CompressedInputStream.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.ProtocolException;
-
-/**
- * A DTP input stream that implements the FTP compressed transfer mode.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-class CompressedInputStream
- extends DTPInputStream
-{
-
- static final int EOF = 64;
-
- static final int RAW = 0x00;
- static final int COMPRESSED = 0x80;
- static final int FILLER = 0xc0;
-
- int descriptor;
- int max = -1;
- int count = -1;
-
- int state = RAW; // RAW | STATE | FILLER
- int rep; // the compressed byte
- int n = 0; // the number of compressed or raw bytes
-
- CompressedInputStream(DTP dtp, InputStream in)
- {
- super(dtp, in);
- }
-
- public int read()
- throws IOException
- {
- if (transferComplete)
- {
- return -1;
- }
- if (count == -1)
- {
- readHeader();
- }
- if (max < 1)
- {
- close();
- return -1;
- }
- if (n > 0 && (state == COMPRESSED || state == FILLER))
- {
- n--;
- return rep;
- }
- int c = in.read();
- if (c == -1)
- {
- close();
- }
- count++;
- if (count >= max)
- {
- count = -1;
- if (descriptor == EOF)
- {
- close();
- }
- }
- if (c == -1)
- {
- return c;
- }
- while (n == 0) // read code header
- {
- state = (c & 0xc0);
- n = (c & 0x3f);
- c = in.read();
- if (c == -1)
- {
- return -1;
- }
- }
- switch (state)
- {
- case RAW:
- break;
- case COMPRESSED:
- case FILLER:
- rep = c;
- break;
- default:
- throw new ProtocolException("Illegal state: " + state);
- }
- n--;
- return c;
- }
-
- public int read(byte[] buf)
- throws IOException
- {
- return read(buf, 0, buf.length);
- }
-
- public int read(byte[] buf, int off, int len)
- throws IOException
- {
- if (transferComplete)
- {
- return -1;
- }
- if (count == -1)
- {
- readHeader();
- }
- if (max < 1)
- {
- close();
- return -1;
- }
- // TODO improve performance
- for (int i = off; i < len; i++)
- {
- int c = read();
- if (c == -1)
- {
- close();
- return i;
- }
- buf[i] = (byte) c;
- }
- return len;
- /*
- int l = in.read (buf, off, len);
- if (l==-1)
- {
- close ();
- }
- count += l;
- if (count>=max)
- {
- count = -1;
- if (descriptor==EOF)
- {
- close ();
- }
- }
- return l;
- */
- }
-
- /**
- * Reads the block header.
- */
- void readHeader()
- throws IOException
- {
- descriptor = in.read();
- int max_hi = in.read();
- int max_lo = in.read();
- max = (max_hi << 8) | max_lo;
- count = 0;
- }
-
- /**
- * Reads the code header.
- */
- void readCodeHeader()
- throws IOException
- {
- int code = in.read();
- state = (code & 0xc0);
- n = (code & 0x3f);
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/CompressedOutputStream.java b/libjava/gnu/java/net/protocol/ftp/CompressedOutputStream.java
deleted file mode 100644
index b960fb3afe8..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/CompressedOutputStream.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/* CompressedOutputStream.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * A DTP output stream that implements the FTP compressed transfer mode.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-class CompressedOutputStream
- extends DTPOutputStream
-{
-
- static final byte RECORD = -128; // 0x80
- static final byte EOF = 64; // 0x40
-
- CompressedOutputStream(DTP dtp, OutputStream out)
- {
- super(dtp, out);
- }
-
- /**
- * Just one byte cannot be compressed.
- * It takes 5 bytes to transmit - hardly very compressed!
- */
- public void write(int c)
- throws IOException
- {
- if (transferComplete)
- {
- return;
- }
- byte[] buf = new byte[]
- {
- RECORD, /* record descriptor */
- 0x00, 0x01, /* one byte */
- 0x01, /* one uncompressed byte */
- (byte) c /* the byte */
- };
- out.write(buf, 0, 5);
- }
-
- public void write(byte[] b)
- throws IOException
- {
- write(b, 0, b.length);
- }
-
- /**
- * The larger len is, the better.
- */
- public void write(byte[] b, int off, int len)
- throws IOException
- {
- if (transferComplete)
- {
- return;
- }
- byte[] buf = compress(b, off, len);
- len = buf.length;
- buf[0] = RECORD; /* record descriptor */
- buf[1] = (byte) ((len & 0x00ff) >> 8); /* high byte of bytecount */
- buf[2] = (byte) (len & 0xff00); /* low byte of bytecount */
- out.write(buf, 0, len);
- }
-
- /**
- * Returns the compressed form of the given byte array.
- * The first 3 bytes are left free for header information.
- */
- byte[] compress(byte[] b, int off, int len)
- {
- byte[] buf = new byte[len];
- byte last = 0;
- int pos = 0, raw_count = 0, rep_count = 1;
- for (int i = off; i < len; i++)
- {
- byte c = b[i];
- if (i > off && c == last) // compress
- {
- if (raw_count > 0) // flush raw bytes to buf
- {
- // need to add raw_count+1 bytes
- if (pos + (raw_count + 1) > buf.length)
- {
- buf = realloc(buf, len);
- }
- pos = flush_raw(buf, pos, b, (i - raw_count) - 1,
- raw_count);
- raw_count = 0;
- }
- rep_count++; // keep looking for same byte
- }
- else
- {
- if (rep_count > 1) // flush compressed bytes to buf
- {
- // need to add 2 bytes
- if (pos + 2 > buf.length)
- {
- buf = realloc(buf, len);
- }
- pos = flush_compressed(buf, pos, rep_count, last);
- rep_count = 1;
- }
- raw_count++; // keep looking for raw bytes
- }
- if (rep_count == 127) // flush compressed bytes
- {
- // need to add 2 bytes
- if (pos + 2 > buf.length)
- {
- buf = realloc(buf, len);
- }
- pos = flush_compressed(buf, pos, rep_count, last);
- rep_count = 1;
- }
- if (raw_count == 127) // flush raw bytes
- {
- // need to add raw_count+1 bytes
- if (pos + (raw_count + 1) > buf.length)
- {
- buf = realloc(buf, len);
- }
- pos = flush_raw(buf, pos, b, (i - raw_count), raw_count);
- raw_count = 0;
- }
- last = c;
- }
- if (rep_count > 1) // flush compressed bytes
- {
- // need to add 2 bytes
- if (pos + 2 > buf.length)
- {
- buf = realloc(buf, len);
- }
- pos = flush_compressed(buf, pos, rep_count, last);
- rep_count = 1;
- }
- if (raw_count > 0) // flush raw bytes
- {
- // need to add raw_count+1 bytes
- if (pos + (raw_count + 1) > buf.length)
- {
- buf = realloc(buf, len);
- }
- pos = flush_raw(buf, pos, b, (len - raw_count), raw_count);
- raw_count = 0;
- }
- byte[] ret = new byte[pos + 3];
- System.arraycopy(buf, 0, ret, 3, pos);
- return ret;
- }
-
- int flush_compressed(byte[] buf, int pos, int count, byte c)
- {
- buf[pos++] = (byte) (0x80 | count);
- buf[pos++] = c;
- return pos;
- }
-
- int flush_raw(byte[] buf, int pos, byte[] src, int off, int len)
- {
- buf[pos++] = (byte) len;
- System.arraycopy(src, off, buf, pos, len);
- return pos + len;
- }
-
- byte[] realloc(byte[] buf, int len)
- {
- byte[] ret = new byte[buf.length + len];
- System.arraycopy(buf, 0, ret, 0, buf.length);
- return ret;
- }
-
- public void close()
- throws IOException
- {
- byte[] buf = new byte[]
- {
- EOF, /* eof descriptor */
- 0x00, 0x00 /* no bytes */
- };
- out.write(buf, 0, 3);
- out.close();
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/DTP.java b/libjava/gnu/java/net/protocol/ftp/DTP.java
deleted file mode 100644
index 25580af403a..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/DTP.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* DTP.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * An FTP data transfer process.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-interface DTP
-{
-
- /**
- * Returns an input stream from which a remote file can be read.
- */
- InputStream getInputStream()
- throws IOException;
-
- /**
- * Returns an output stream to which a local file can be written for
- * upload.
- */
- OutputStream getOutputStream()
- throws IOException;
-
- /**
- * Sets the transfer mode to be used with this DTP.
- */
- void setTransferMode(int mode);
-
- /**
- * Marks this DTP completed.
- * When the current transfer has finished, any resources will be released.
- */
- void complete();
-
- /**
- * Aborts any current transfer and releases all resources held by this
- * DTP.
- * @return true if a transfer was interrupted, false otherwise
- */
- boolean abort();
-
- /**
- * Used to notify the DTP that its current transfer is complete.
- * This occurs either when end-of-stream is reached or a 226 response is
- * received.
- */
- void transferComplete();
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/DTPInputStream.java b/libjava/gnu/java/net/protocol/ftp/DTPInputStream.java
deleted file mode 100644
index 363a5590fbb..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/DTPInputStream.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* DTPInputStream.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * An input stream that notifies a DTP on completion.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-abstract class DTPInputStream
- extends FilterInputStream
-{
-
- DTP dtp;
- boolean transferComplete;
-
- /**
- * Constructor.
- * @param dtp the controlling data transfer process
- * @param in the underlying socket stream
- */
- DTPInputStream (DTP dtp, InputStream in)
- {
- super(in);
- this.dtp = dtp;
- transferComplete = false;
- }
-
- /**
- * Marks this input stream complete.
- * This is called by the DTP.
- */
- void setTransferComplete(boolean flag)
- {
- transferComplete = flag;
- }
-
- /**
- * Notifies the controlling DTP that this stream has completed transfer.
- */
- public void close()
- throws IOException
- {
- dtp.transferComplete();
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/DTPOutputStream.java b/libjava/gnu/java/net/protocol/ftp/DTPOutputStream.java
deleted file mode 100644
index 83f0be1e30d..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/DTPOutputStream.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* DTPOutputStream.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * An output stream that notifies a DTP on end of stream.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-abstract class DTPOutputStream extends FilterOutputStream
-{
-
- DTP dtp;
- boolean transferComplete;
-
- /**
- * Constructor.
- * @param dtp the controlling data transfer process
- * @param out the socket output stream
- */
- DTPOutputStream (DTP dtp, OutputStream out)
- {
- super (out);
- this.dtp = dtp;
- transferComplete = false;
- }
-
- /**
- * Tells this stream whether transfer has completed or not.
- * @param flag true if the process has completed, false otherwise
- */
- void setTransferComplete (boolean flag)
- {
- transferComplete = flag;
- }
-
- /**
- * Notifies the controlling DTP that this stream has been terminated.
- */
- public void close () throws IOException
- {
- dtp.transferComplete ();
- }
-
-}
diff --git a/libjava/gnu/java/net/protocol/ftp/FTPConnection.java b/libjava/gnu/java/net/protocol/ftp/FTPConnection.java
deleted file mode 100644
index d0f48727cfa..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/FTPConnection.java
+++ /dev/null
@@ -1,1348 +0,0 @@
-/* FTPConnection.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import gnu.java.net.CRLFInputStream;
-import gnu.java.net.CRLFOutputStream;
-import gnu.java.net.EmptyX509TrustManager;
-import gnu.java.net.LineInputStream;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.BindException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.ProtocolException;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.security.GeneralSecurityException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocket;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-
-/**
- * An FTP client connection, or PI.
- * This implements RFC 959, with the following exceptions:
- * <ul>
- * <li>STAT, HELP, SITE, SMNT, and ACCT commands are not supported.</li>
- * <li>the TYPE command does not allow alternatives to the default bytesize
- * (Non-print), and local bytesize is not supported.</li>
- * </ul>
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class FTPConnection
-{
-
- /**
- * The default FTP transmission control port.
- */
- public static final int FTP_PORT = 21;
-
- /**
- * The FTP data port.
- */
- public static final int FTP_DATA_PORT = 20;
-
- // -- FTP vocabulary --
- protected static final String USER = "USER";
- protected static final String PASS = "PASS";
- protected static final String ACCT = "ACCT";
- protected static final String CWD = "CWD";
- protected static final String CDUP = "CDUP";
- protected static final String SMNT = "SMNT";
- protected static final String REIN = "REIN";
- protected static final String QUIT = "QUIT";
-
- protected static final String PORT = "PORT";
- protected static final String PASV = "PASV";
- protected static final String TYPE = "TYPE";
- protected static final String STRU = "STRU";
- protected static final String MODE = "MODE";
-
- protected static final String RETR = "RETR";
- protected static final String STOR = "STOR";
- protected static final String STOU = "STOU";
- protected static final String APPE = "APPE";
- protected static final String ALLO = "ALLO";
- protected static final String REST = "REST";
- protected static final String RNFR = "RNFR";
- protected static final String RNTO = "RNTO";
- protected static final String ABOR = "ABOR";
- protected static final String DELE = "DELE";
- protected static final String RMD = "RMD";
- protected static final String MKD = "MKD";
- protected static final String PWD = "PWD";
- protected static final String LIST = "LIST";
- protected static final String NLST = "NLST";
- protected static final String SITE = "SITE";
- protected static final String SYST = "SYST";
- protected static final String STAT = "STAT";
- protected static final String HELP = "HELP";
- protected static final String NOOP = "NOOP";
-
- protected static final String AUTH = "AUTH";
- protected static final String PBSZ = "PBSZ";
- protected static final String PROT = "PROT";
- protected static final String CCC = "CCC";
- protected static final String TLS = "TLS";
-
- public static final int TYPE_ASCII = 1;
- public static final int TYPE_EBCDIC = 2;
- public static final int TYPE_BINARY = 3;
-
- public static final int STRUCTURE_FILE = 1;
- public static final int STRUCTURE_RECORD = 2;
- public static final int STRUCTURE_PAGE = 3;
-
- public static final int MODE_STREAM = 1;
- public static final int MODE_BLOCK = 2;
- public static final int MODE_COMPRESSED = 3;
-
- // -- Telnet constants --
- private static final String US_ASCII = "US-ASCII";
-
- /**
- * The socket used to communicate with the server.
- */
- protected Socket socket;
-
- /**
- * The socket input stream.
- */
- protected LineInputStream in;
-
- /**
- * The socket output stream.
- */
- protected CRLFOutputStream out;
-
- /**
- * The timeout when attempting to connect a socket.
- */
- protected int connectionTimeout;
-
- /**
- * The read timeout on sockets.
- */
- protected int timeout;
-
- /**
- * If true, print debugging information.
- */
- protected boolean debug;
-
- /**
- * The current data transfer process in use by this connection.
- */
- protected DTP dtp;
-
- /**
- * The current representation type.
- */
- protected int representationType = TYPE_ASCII;
-
- /**
- * The current file structure type.
- */
- protected int fileStructure = STRUCTURE_FILE;
-
- /**
- * The current transfer mode.
- */
- protected int transferMode = MODE_STREAM;
-
- /**
- * If true, use passive mode.
- */
- protected boolean passive = false;
-
- /**
- * Creates a new connection to the server using the default port.
- * @param hostname the hostname of the server to connect to
- */
- public FTPConnection(String hostname)
- throws UnknownHostException, IOException
- {
- this(hostname, -1, 0, 0, false);
- }
-
- /**
- * Creates a new connection to the server.
- * @param hostname the hostname of the server to connect to
- * @param port the port to connect to(if &lt;=0, use default port)
- */
- public FTPConnection(String hostname, int port)
- throws UnknownHostException, IOException
- {
- this(hostname, port, 0, 0, false);
- }
-
- /**
- * Creates a new connection to the server.
- * @param hostname the hostname of the server to connect to
- * @param port the port to connect to(if &lt;=0, use default port)
- * @param connectionTimeout the connection timeout, in milliseconds
- * @param timeout the I/O timeout, in milliseconds
- * @param debug print debugging information
- */
- public FTPConnection(String hostname, int port,
- int connectionTimeout, int timeout, boolean debug)
- throws UnknownHostException, IOException
- {
- this.connectionTimeout = connectionTimeout;
- this.timeout = timeout;
- this.debug = debug;
- if (port <= 0)
- {
- port = FTP_PORT;
- }
-
- // Set up socket
- socket = new Socket();
- InetSocketAddress address = new InetSocketAddress(hostname, port);
- if (connectionTimeout > 0)
- {
- socket.connect(address, connectionTimeout);
- }
- else
- {
- socket.connect(address);
- }
- if (timeout > 0)
- {
- socket.setSoTimeout(timeout);
- }
-
- InputStream in = socket.getInputStream();
- in = new BufferedInputStream(in);
- in = new CRLFInputStream(in);
- this.in = new LineInputStream(in);
- OutputStream out = socket.getOutputStream();
- out = new BufferedOutputStream(out);
- this.out = new CRLFOutputStream(out);
-
- // Read greeting
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 220: // hello
- break;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Authenticate using the specified username and password.
- * If the username suffices for the server, the password will not be used
- * and may be null.
- * @param username the username
- * @param password the optional password
- * @return true on success, false otherwise
- */
- public boolean authenticate(String username, String password)
- throws IOException
- {
- String cmd = USER + ' ' + username;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 230: // User logged in
- return true;
- case 331: // User name okay, need password
- break;
- case 332: // Need account for login
- case 530: // No such user
- return false;
- default:
- throw new FTPException(response);
- }
- cmd = PASS + ' ' + password;
- send(cmd);
- response = getResponse();
- switch (response.getCode())
- {
- case 230: // User logged in
- case 202: // Superfluous
- return true;
- case 332: // Need account for login
- case 530: // Bad password
- return false;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Negotiates TLS over the current connection.
- * See IETF draft-murray-auth-ftp-ssl-15.txt for details.
- * @param confidential whether to provide confidentiality for the
- * connection
- */
- public boolean starttls(boolean confidential)
- throws IOException
- {
- return starttls(confidential, new EmptyX509TrustManager());
- }
-
- /**
- * Negotiates TLS over the current connection.
- * See IETF draft-murray-auth-ftp-ssl-15.txt for details.
- * @param confidential whether to provide confidentiality for the
- * connection
- * @param tm the trust manager used to validate the server certificate.
- */
- public boolean starttls(boolean confidential, TrustManager tm)
- throws IOException
- {
- try
- {
- // Use SSLSocketFactory to negotiate a TLS session and wrap the
- // current socket.
- SSLContext context = SSLContext.getInstance("TLS");
- // We don't require strong validation of the server certificate
- TrustManager[] trust = new TrustManager[] { tm };
- context.init(null, trust, null);
- SSLSocketFactory factory = context.getSocketFactory();
-
- send(AUTH + ' ' + TLS);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 500:
- case 502:
- case 504:
- case 534:
- case 431:
- return false;
- case 234:
- break;
- default:
- throw new FTPException(response);
- }
-
- String hostname = socket.getInetAddress().getHostName();
- int port = socket.getPort();
- SSLSocket ss =
- (SSLSocket) factory.createSocket(socket, hostname, port, true);
- String[] protocols = { "TLSv1", "SSLv3" };
- ss.setEnabledProtocols(protocols);
- ss.setUseClientMode(true);
- ss.startHandshake();
-
- // PBSZ:PROT sequence
- send(PBSZ + ' ' + Integer.MAX_VALUE);
- response = getResponse();
- switch (response.getCode())
- {
- case 501: // syntax error
- case 503: // not authenticated
- return false;
- case 200:
- break;
- default:
- throw new FTPException(response);
- }
- send(PROT + ' ' +(confidential ? 'P' : 'C'));
- response = getResponse();
- switch (response.getCode())
- {
- case 503: // not authenticated
- case 504: // invalid level
- case 536: // level not supported
- return false;
- case 200:
- break;
- default:
- throw new FTPException(response);
- }
-
- if (confidential)
- {
- // Set up streams
- InputStream in = ss.getInputStream();
- in = new BufferedInputStream(in);
- in = new CRLFInputStream(in);
- this.in = new LineInputStream(in);
- OutputStream out = ss.getOutputStream();
- out = new BufferedOutputStream(out);
- this.out = new CRLFOutputStream(out);
- }
- return true;
- }
- catch (GeneralSecurityException e)
- {
- return false;
- }
- }
-
- /**
- * Changes directory to the specified path.
- * @param path an absolute or relative pathname
- * @return true on success, false if the specified path does not exist
- */
- public boolean changeWorkingDirectory(String path)
- throws IOException
- {
- String cmd = CWD + ' ' + path;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 250:
- return true;
- case 550:
- return false;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Changes directory to the parent of the current working directory.
- * @return true on success, false otherwise
- */
- public boolean changeToParentDirectory()
- throws IOException
- {
- send(CDUP);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 250:
- return true;
- case 550:
- return false;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Terminates an authenticated login.
- * If file transfer is in progress, it remains active for result response
- * only.
- */
- public void reinitialize()
- throws IOException
- {
- send(REIN);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 220:
- if (dtp != null)
- {
- dtp.complete();
- dtp = null;
- }
- break;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Terminates the control connection.
- * The file transfer connection remains open for result response only.
- * This connection is invalid and no further commands may be issued.
- */
- public void logout()
- throws IOException
- {
- send(QUIT);
- try
- {
- getResponse(); // not required
- }
- catch (IOException e)
- {
- }
- if (dtp != null)
- {
- dtp.complete();
- dtp = null;
- }
- try
- {
- socket.close();
- }
- catch (IOException e)
- {
- }
- }
-
- /**
- * Initialise the data transfer process.
- */
- protected void initialiseDTP()
- throws IOException
- {
- if (dtp != null)
- {
- dtp.complete();
- dtp = null;
- }
-
- InetAddress localhost = socket.getLocalAddress();
- if (passive)
- {
- send(PASV);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 227:
- String message = response.getMessage();
- try
- {
- int start = message.indexOf(',');
- char c = message.charAt(start - 1);
- while (c >= 0x30 && c <= 0x39)
- {
- c = message.charAt((--start) - 1);
- }
- int mid1 = start;
- for (int i = 0; i < 4; i++)
- {
- mid1 = message.indexOf(',', mid1 + 1);
- }
- int mid2 = message.indexOf(',', mid1 + 1);
- if (mid1 == -1 || mid2 < mid1)
- {
- throw new ProtocolException("Malformed 227: " +
- message);
- }
- int end = mid2;
- c = message.charAt(end + 1);
- while (c >= 0x30 && c <= 0x39)
- {
- c = message.charAt((++end) + 1);
- }
-
- String address =
- message.substring(start, mid1).replace(',', '.');
- int port_hi =
- Integer.parseInt(message.substring(mid1 + 1, mid2));
- int port_lo =
- Integer.parseInt(message.substring(mid2 + 1, end + 1));
- int port = (port_hi << 8) | port_lo;
-
- /*System.out.println("Entering passive mode: " + address +
- ":" + port);*/
- dtp = new PassiveModeDTP(address, port, localhost,
- connectionTimeout, timeout);
- break;
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- throw new ProtocolException(e.getMessage() + ": " +
- message);
- }
- catch (NumberFormatException e)
- {
- throw new ProtocolException(e.getMessage() + ": " +
- message);
- }
- default:
- throw new FTPException(response);
- }
- }
- else
- {
- // Get the local port
- int port = socket.getLocalPort() + 1;
- int tries = 0;
- // Bind the active mode DTP
- while (dtp == null)
- {
- try
- {
- dtp = new ActiveModeDTP(localhost, port,
- connectionTimeout, timeout);
- /*System.out.println("Listening on: " + port);*/
- }
- catch (BindException e)
- {
- port++;
- tries++;
- if (tries > 9)
- {
- throw e;
- }
- }
- }
-
- // Send PORT command
- StringBuffer buf = new StringBuffer(PORT);
- buf.append(' ');
- // Construct the address/port string form
- byte[] address = localhost.getAddress();
- for (int i = 0; i < address.length; i++)
- {
- int a =(int) address[i];
- if (a < 0)
- {
- a += 0x100;
- }
- buf.append(a);
- buf.append(',');
- }
- int port_hi =(port & 0xff00) >> 8;
- int port_lo =(port & 0x00ff);
- buf.append(port_hi);
- buf.append(',');
- buf.append(port_lo);
- send(buf.toString());
- // Get response
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 200: // OK
- break;
- default:
- dtp.abort();
- dtp = null;
- throw new FTPException(response);
- }
- }
- dtp.setTransferMode(transferMode);
- }
-
- /**
- * Set passive mode.
- * @param flag true if we should use passive mode, false otherwise
- */
- public void setPassive(boolean flag)
- throws IOException
- {
- if (passive != flag)
- {
- passive = flag;
- initialiseDTP();
- }
- }
-
- /**
- * Returns the current representation type of the transfer data.
- * @return TYPE_ASCII, TYPE_EBCDIC, or TYPE_BINARY
- */
- public int getRepresentationType()
- {
- return representationType;
- }
-
- /**
- * Sets the desired representation type of the transfer data.
- * @param type TYPE_ASCII, TYPE_EBCDIC, or TYPE_BINARY
- */
- public void setRepresentationType(int type)
- throws IOException
- {
- StringBuffer buf = new StringBuffer(TYPE);
- buf.append(' ');
- switch (type)
- {
- case TYPE_ASCII:
- buf.append('A');
- break;
- case TYPE_EBCDIC:
- buf.append('E');
- break;
- case TYPE_BINARY:
- buf.append('I');
- break;
- default:
- throw new IllegalArgumentException(Integer.toString(type));
- }
- //buf.append(' ');
- //buf.append('N');
- send(buf.toString());
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 200:
- representationType = type;
- break;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Returns the current file structure type.
- * @return STRUCTURE_FILE, STRUCTURE_RECORD, or STRUCTURE_PAGE
- */
- public int getFileStructure()
- {
- return fileStructure;
- }
-
- /**
- * Sets the desired file structure type.
- * @param structure STRUCTURE_FILE, STRUCTURE_RECORD, or STRUCTURE_PAGE
- */
- public void setFileStructure(int structure)
- throws IOException
- {
- StringBuffer buf = new StringBuffer(STRU);
- buf.append(' ');
- switch (structure)
- {
- case STRUCTURE_FILE:
- buf.append('F');
- break;
- case STRUCTURE_RECORD:
- buf.append('R');
- break;
- case STRUCTURE_PAGE:
- buf.append('P');
- break;
- default:
- throw new IllegalArgumentException(Integer.toString(structure));
- }
- send(buf.toString());
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 200:
- fileStructure = structure;
- break;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Returns the current transfer mode.
- * @return MODE_STREAM, MODE_BLOCK, or MODE_COMPRESSED
- */
- public int getTransferMode()
- {
- return transferMode;
- }
-
- /**
- * Sets the desired transfer mode.
- * @param mode MODE_STREAM, MODE_BLOCK, or MODE_COMPRESSED
- */
- public void setTransferMode(int mode)
- throws IOException
- {
- StringBuffer buf = new StringBuffer(MODE);
- buf.append(' ');
- switch (mode)
- {
- case MODE_STREAM:
- buf.append('S');
- break;
- case MODE_BLOCK:
- buf.append('B');
- break;
- case MODE_COMPRESSED:
- buf.append('C');
- break;
- default:
- throw new IllegalArgumentException(Integer.toString(mode));
- }
- send(buf.toString());
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 200:
- transferMode = mode;
- if (dtp != null)
- {
- dtp.setTransferMode(mode);
- }
- break;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Retrieves the specified file.
- * @param filename the filename of the file to retrieve
- * @return an InputStream containing the file content
- */
- public InputStream retrieve(String filename)
- throws IOException
- {
- if (dtp == null || transferMode == MODE_STREAM)
- {
- initialiseDTP();
- }
- /*
- int size = -1;
- String cmd = SIZE + ' ' + filename;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 213:
- size = Integer.parseInt(response.getMessage());
- break;
- case 550: // File not found
- default:
- throw new FTPException(response);
- }
- */
- String cmd = RETR + ' ' + filename;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 125: // Data connection already open; transfer starting
- case 150: // File status okay; about to open data connection
- return dtp.getInputStream();
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Returns a stream for uploading a file.
- * If a file with the same filename already exists on the server, it will
- * be overwritten.
- * @param filename the name of the file to save the content as
- * @return an OutputStream to write the file data to
- */
- public OutputStream store(String filename)
- throws IOException
- {
- if (dtp == null || transferMode == MODE_STREAM)
- {
- initialiseDTP();
- }
- String cmd = STOR + ' ' + filename;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 125: // Data connection already open; transfer starting
- case 150: // File status okay; about to open data connection
- return dtp.getOutputStream();
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Returns a stream for uploading a file.
- * If a file with the same filename already exists on the server, the
- * content specified will be appended to the existing file.
- * @param filename the name of the file to save the content as
- * @return an OutputStream to write the file data to
- */
- public OutputStream append(String filename)
- throws IOException
- {
- if (dtp == null || transferMode == MODE_STREAM)
- {
- initialiseDTP();
- }
- String cmd = APPE + ' ' + filename;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 125: // Data connection already open; transfer starting
- case 150: // File status okay; about to open data connection
- return dtp.getOutputStream();
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * This command may be required by some servers to reserve sufficient
- * storage to accommodate the new file to be transferred.
- * It should be immediately followed by a <code>store</code> or
- * <code>append</code>.
- * @param size the number of bytes of storage to allocate
- */
- public void allocate(long size)
- throws IOException
- {
- String cmd = ALLO + ' ' + size;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 200: // OK
- case 202: // Superfluous
- break;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Renames a file.
- * @param oldName the current name of the file
- * @param newName the new name
- * @return true if successful, false otherwise
- */
- public boolean rename(String oldName, String newName)
- throws IOException
- {
- String cmd = RNFR + ' ' + oldName;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 450: // File unavailable
- case 550: // File not found
- return false;
- case 350: // Pending
- break;
- default:
- throw new FTPException(response);
- }
- cmd = RNTO + ' ' + newName;
- send(cmd);
- response = getResponse();
- switch (response.getCode())
- {
- case 250: // OK
- return true;
- case 450:
- case 550:
- return false;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Aborts the transfer in progress.
- * @return true if a transfer was in progress, false otherwise
- */
- public boolean abort()
- throws IOException
- {
- send(ABOR);
- FTPResponse response = getResponse();
- // Abort client DTP
- if (dtp != null)
- {
- dtp.abort();
- }
- switch (response.getCode())
- {
- case 226: // successful abort
- return false;
- case 426: // interrupted
- response = getResponse();
- if (response.getCode() == 226)
- {
- return true;
- }
- // Otherwise fall through to throw exception
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Causes the file specified to be deleted at the server site.
- * @param filename the file to delete
- */
- public boolean delete(String filename)
- throws IOException
- {
- String cmd = DELE + ' ' + filename;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 250: // OK
- return true;
- case 450: // File unavailable
- case 550: // File not found
- return false;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Causes the directory specified to be deleted.
- * This may be an absolute or relative pathname.
- * @param pathname the directory to delete
- */
- public boolean removeDirectory(String pathname)
- throws IOException
- {
- String cmd = RMD + ' ' + pathname;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 250: // OK
- return true;
- case 550: // File not found
- return false;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Causes the directory specified to be created at the server site.
- * This may be an absolute or relative pathname.
- * @param pathname the directory to create
- */
- public boolean makeDirectory(String pathname)
- throws IOException
- {
- String cmd = MKD + ' ' + pathname;
- send(cmd);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 257: // Directory created
- return true;
- case 550: // File not found
- return false;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Returns the current working directory.
- */
- public String getWorkingDirectory()
- throws IOException
- {
- send(PWD);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 257:
- String message = response.getMessage();
- if (message.charAt(0) == '"')
- {
- int end = message.indexOf('"', 1);
- if (end == -1)
- {
- throw new ProtocolException(message);
- }
- return message.substring(1, end);
- }
- else
- {
- int end = message.indexOf(' ');
- if (end == -1)
- {
- return message;
- }
- else
- {
- return message.substring(0, end);
- }
- }
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Returns a listing of information about the specified pathname.
- * If the pathname specifies a directory or other group of files, the
- * server should transfer a list of files in the specified directory.
- * If the pathname specifies a file then the server should send current
- * information on the file. A null argument implies the user's
- * current working or default directory.
- * @param pathname the context pathname, or null
- */
- public InputStream list(String pathname)
- throws IOException
- {
- if (dtp == null || transferMode == MODE_STREAM)
- {
- initialiseDTP();
- }
- if (pathname == null)
- {
- send(LIST);
- }
- else
- {
- String cmd = LIST + ' ' + pathname;
- send(cmd);
- }
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 125: // Data connection already open; transfer starting
- case 150: // File status okay; about to open data connection
- return dtp.getInputStream();
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Returns a directory listing. The pathname should specify a
- * directory or other system-specific file group descriptor; a null
- * argument implies the user's current working or default directory.
- * @param pathname the directory pathname, or null
- * @return a list of filenames(strings)
- */
- public List nameList(String pathname)
- throws IOException
- {
- if (dtp == null || transferMode == MODE_STREAM)
- {
- initialiseDTP();
- }
- if (pathname == null)
- {
- send(NLST);
- }
- else
- {
- String cmd = NLST + ' ' + pathname;
- send(cmd);
- }
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 125: // Data connection already open; transfer starting
- case 150: // File status okay; about to open data connection
- InputStream in = dtp.getInputStream();
- in = new BufferedInputStream(in);
- in = new CRLFInputStream(in); // TODO ensure that TYPE is correct
- LineInputStream li = new LineInputStream(in);
- List ret = new ArrayList();
- for (String line = li.readLine();
- line != null;
- line = li.readLine())
- {
- ret.add(line);
- }
- li.close();
- return ret;
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Returns the type of operating system at the server.
- */
- public String system()
- throws IOException
- {
- send(SYST);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 215:
- String message = response.getMessage();
- int end = message.indexOf(' ');
- if (end == -1)
- {
- return message;
- }
- else
- {
- return message.substring(0, end);
- }
- default:
- throw new FTPException(response);
- }
- }
-
- /**
- * Does nothing.
- * This method can be used to ensure that the connection does not time
- * out.
- */
- public void noop()
- throws IOException
- {
- send(NOOP);
- FTPResponse response = getResponse();
- switch (response.getCode())
- {
- case 200:
- break;
- default:
- throw new FTPException(response);
- }
- }
-
- // -- I/O --
-
- /**
- * Sends the specified command line to the server.
- * The CRLF sequence is automatically appended.
- * @param cmd the command line to send
- */
- protected void send(String cmd)
- throws IOException
- {
- byte[] data = cmd.getBytes(US_ASCII);
- out.write(data);
- out.writeln();
- out.flush();
- }
-
- /**
- * Reads the next response from the server.
- * If the server sends the "transfer complete" code, this is handled here,
- * and the next response is passed to the caller.
- */
- protected FTPResponse getResponse()
- throws IOException
- {
- FTPResponse response = readResponse();
- if (response.getCode() == 226)
- {
- if (dtp != null)
- {
- dtp.transferComplete();
- }
- response = readResponse();
- }
- return response;
- }
-
- /**
- * Reads and parses the next response from the server.
- */
- protected FTPResponse readResponse()
- throws IOException
- {
- String line = in.readLine();
- if (line == null)
- {
- throw new ProtocolException( "EOF");
- }
- if (line.length() < 4)
- {
- throw new ProtocolException(line);
- }
- int code = parseCode(line);
- if (code == -1)
- {
- throw new ProtocolException(line);
- }
- char c = line.charAt(3);
- if (c == ' ')
- {
- return new FTPResponse(code, line.substring(4));
- }
- else if (c == '-')
- {
- StringBuffer buf = new StringBuffer(line.substring(4));
- buf.append('\n');
- while(true)
- {
- line = in.readLine();
- if (line == null)
- {
- throw new ProtocolException("EOF");
- }
- if (line.length() >= 4 &&
- line.charAt(3) == ' ' &&
- parseCode(line) == code)
- {
- return new FTPResponse(code, line.substring(4),
- buf.toString());
- }
- else
- {
- buf.append(line);
- buf.append('\n');
- }
- }
- }
- else
- {
- throw new ProtocolException(line);
- }
- }
-
- /*
- * Parses the 3-digit numeric code at the beginning of the given line.
- * Returns -1 on failure.
- */
- static final int parseCode(String line)
- {
- char[] c = { line.charAt(0), line.charAt(1), line.charAt(2) };
- int ret = 0;
- for (int i = 0; i < 3; i++)
- {
- int digit =((int) c[i]) - 0x30;
- if (digit < 0 || digit > 9)
- {
- return -1;
- }
- // Computing integer powers is way too expensive in Java!
- switch (i)
- {
- case 0:
- ret +=(100 * digit);
- break;
- case 1:
- ret +=(10 * digit);
- break;
- case 2:
- ret += digit;
- break;
- }
- }
- return ret;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/FTPException.java b/libjava/gnu/java/net/protocol/ftp/FTPException.java
deleted file mode 100644
index 14ad3813f85..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/FTPException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* FTPException.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-
-/**
- * An FTP control exception.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class FTPException
- extends IOException
-{
-
- /**
- * The response that provoked this exception.
- */
- protected final FTPResponse response;
-
- /**
- * Constructs a new FTP exception.
- * @param response the response that provoked this exception
- */
- public FTPException(FTPResponse response)
- {
- super(response.getMessage());
- this.response = response;
- }
-
- /**
- * Returns the response that provoked this exception.
- */
- public FTPResponse getResponse()
- {
- return response;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/FTPResponse.java b/libjava/gnu/java/net/protocol/ftp/FTPResponse.java
deleted file mode 100644
index ec72c732c1c..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/FTPResponse.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* FTPResponse.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-/**
- * An FTP control response.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public final class FTPResponse
-{
-
- /**
- * The 3-digit status code.
- */
- protected final int code;
-
- /**
- * The human-readable message.
- */
- protected final String message;
-
- /**
- * Multiline data, if present.
- */
- protected final String data;
-
- /**
- * Constructs a new FTP response.
- * @param code the status code
- * @param message the message
- */
- public FTPResponse(int code, String message)
- {
- this(code, message, null);
- }
-
- /**
- * Constructs a new multiline FTP response.
- * @param code the status code
- * @param message the message
- * @param data multiline data
- */
- public FTPResponse(int code, String message, String data)
- {
- this.code = code;
- this.message = message;
- this.data = data;
- }
-
- /**
- * Returns the 3-digit status code.
- */
- public int getCode()
- {
- return code;
- }
-
- /**
- * Returns the human-readable message.
- */
- public String getMessage()
- {
- return message;
- }
-
- /**
- * Returns the multiline data, or null if there was no such data.
- */
- public String getData()
- {
- return data;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/FTPURLConnection.java b/libjava/gnu/java/net/protocol/ftp/FTPURLConnection.java
deleted file mode 100644
index 62c40f19e04..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/FTPURLConnection.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/* FTPURLConnection.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import gnu.java.net.GetLocalHostAction;
-import gnu.java.security.action.GetPropertyAction;
-
-import java.io.FileNotFoundException;
-import java.io.FilterInputStream;
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.URL;
-import java.net.URLConnection;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * An FTP URL connection.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class FTPURLConnection
- extends URLConnection
-{
-
- /**
- * The connection managing the protocol exchange.
- */
- protected FTPConnection connection;
-
- protected boolean passive;
- protected int representationType;
- protected int fileStructure;
- protected int transferMode;
-
- /**
- * Constructs an FTP connection to the specified URL.
- * @param url the URL
- */
- public FTPURLConnection(URL url)
- {
- super(url);
- passive = true;
- representationType = FTPConnection.TYPE_BINARY;
- fileStructure = -1;
- transferMode = -1;
- }
-
- /**
- * Establishes the connection.
- */
- public void connect()
- throws IOException
- {
- if (connected)
- {
- return;
- }
- String host = url.getHost();
- int port = url.getPort();
- String username = url.getUserInfo();
- String password = null;
- if (username != null)
- {
- int ci = username.indexOf(':');
- if (ci != -1)
- {
- password = username.substring(ci + 1);
- username = username.substring(0, ci);
- }
- }
- else
- {
- username = "anonymous";
- PrivilegedAction a = new GetPropertyAction("user.name");
- String systemUsername =(String) AccessController.doPrivileged(a);
- a = new GetLocalHostAction();
- InetAddress localhost =(InetAddress) AccessController.doPrivileged(a);
- password = systemUsername + "@" +
- ((localhost == null) ? "localhost" : localhost.getHostName());
- }
- connection = new FTPConnection(host, port);
- if (!connection.authenticate(username, password))
- {
- throw new SecurityException("Authentication failed");
- }
- connection.setPassive(passive);
- if (representationType != -1)
- {
- connection.setRepresentationType(representationType);
- }
- if (fileStructure != -1)
- {
- connection.setFileStructure(fileStructure);
- }
- if (transferMode != -1)
- {
- connection.setTransferMode(transferMode);
- }
- }
-
- /**
- * This connection supports doInput.
- */
- public void setDoInput(boolean doinput)
- {
- doInput = doinput;
- }
-
- /**
- * This connection supports doOutput.
- */
- public void setDoOutput(boolean dooutput)
- {
- doOutput = dooutput;
- }
-
- /**
- * Returns an input stream that reads from this open connection.
- */
- public InputStream getInputStream()
- throws IOException
- {
- if (!connected)
- {
- connect();
- }
- String path = url.getPath();
- String filename = null;
- int lsi = path.lastIndexOf('/');
- if (lsi != -1)
- {
- filename = path.substring(lsi + 1);
- path = path.substring(0, lsi);
- if (!connection.changeWorkingDirectory(path))
- {
- throw new FileNotFoundException(path);
- }
- }
- if (filename != null && filename.length() > 0)
- {
- return this.new ClosingInputStream(connection.retrieve(filename));
- }
- else
- {
- return this.new ClosingInputStream(connection.list(null));
- }
- }
-
- /**
- * Returns an output stream that writes to this connection.
- */
- public OutputStream getOutputStream()
- throws IOException
- {
- if (!connected)
- {
- connect();
- }
- String dir = url.getPath();
- String filename = url.getFile();
- if (!connection.changeWorkingDirectory(dir))
- {
- throw new FileNotFoundException(dir);
- }
- if (filename != null)
- {
- return this.new ClosingOutputStream(connection.store(filename));
- }
- else
- {
- throw new FileNotFoundException(filename);
- }
- }
-
- public String getRequestProperty(String key)
- {
- if ("passive".equals(key))
- {
- return Boolean.toString(passive);
- }
- else if ("representationType".equals(key))
- {
- switch (representationType)
- {
- case FTPConnection.TYPE_ASCII:
- return "ASCII";
- case FTPConnection.TYPE_EBCDIC:
- return "EBCDIC";
- case FTPConnection.TYPE_BINARY:
- return "BINARY";
- }
- }
- else if ("fileStructure".equals(key))
- {
- switch (fileStructure)
- {
- case FTPConnection.STRUCTURE_FILE:
- return "FILE";
- case FTPConnection.STRUCTURE_RECORD:
- return "RECORD";
- case FTPConnection.STRUCTURE_PAGE:
- return "PAGE";
- }
- }
- else if ("transferMode".equals(key))
- {
- switch (transferMode)
- {
- case FTPConnection.MODE_STREAM:
- return "STREAM";
- case FTPConnection.MODE_BLOCK:
- return "BLOCK";
- case FTPConnection.MODE_COMPRESSED:
- return "COMPRESSED";
- }
- }
- return null;
- }
-
- public Map getRequestProperties()
- {
- Map map = new HashMap();
- addRequestPropertyValue(map, "passive");
- addRequestPropertyValue(map, "representationType");
- addRequestPropertyValue(map, "fileStructure");
- addRequestPropertyValue(map, "transferMode");
- return map;
- }
-
- private void addRequestPropertyValue(Map map, String key)
- {
- String value = getRequestProperty(key);
- map.put(key, value);
- }
-
- public void setRequestProperty(String key, String value)
- {
- if (connected)
- {
- throw new IllegalStateException();
- }
- if ("passive".equals(key))
- {
- passive = Boolean.valueOf(value).booleanValue();
- }
- else if ("representationType".equals(key))
- {
- if ("A".equalsIgnoreCase(value) ||
- "ASCII".equalsIgnoreCase(value))
- {
- representationType = FTPConnection.TYPE_ASCII;
- }
- else if ("E".equalsIgnoreCase(value) ||
- "EBCDIC".equalsIgnoreCase(value))
- {
- representationType = FTPConnection.TYPE_EBCDIC;
- }
- else if ("I".equalsIgnoreCase(value) ||
- "BINARY".equalsIgnoreCase(value))
- {
- representationType = FTPConnection.TYPE_BINARY;
- }
- else
- {
- throw new IllegalArgumentException(value);
- }
- }
- else if ("fileStructure".equals(key))
- {
- if ("F".equalsIgnoreCase(value) ||
- "FILE".equalsIgnoreCase(value))
- {
- fileStructure = FTPConnection.STRUCTURE_FILE;
- }
- else if ("R".equalsIgnoreCase(value) ||
- "RECORD".equalsIgnoreCase(value))
- {
- fileStructure = FTPConnection.STRUCTURE_RECORD;
- }
- else if ("P".equalsIgnoreCase(value) ||
- "PAGE".equalsIgnoreCase(value))
- {
- fileStructure = FTPConnection.STRUCTURE_PAGE;
- }
- else
- {
- throw new IllegalArgumentException(value);
- }
- }
- else if ("transferMode".equals(key))
- {
- if ("S".equalsIgnoreCase(value) ||
- "STREAM".equalsIgnoreCase(value))
- {
- transferMode = FTPConnection.MODE_STREAM;
- }
- else if ("B".equalsIgnoreCase(value) ||
- "BLOCK".equalsIgnoreCase(value))
- {
- transferMode = FTPConnection.MODE_BLOCK;
- }
- else if ("C".equalsIgnoreCase(value) ||
- "COMPRESSED".equalsIgnoreCase(value))
- {
- transferMode = FTPConnection.MODE_COMPRESSED;
- }
- else
- {
- throw new IllegalArgumentException(value);
- }
- }
- }
-
- public void addRequestProperty(String key, String value)
- {
- setRequestProperty(key, value);
- }
-
- class ClosingInputStream
- extends FilterInputStream
- {
-
- ClosingInputStream(InputStream in)
- {
- super(in);
- }
-
- public void close()
- throws IOException
- {
- super.close();
- connection.logout();
- }
-
- }
-
- class ClosingOutputStream
- extends FilterOutputStream
- {
-
- ClosingOutputStream(OutputStream out)
- {
- super(out);
- }
-
- public void close()
- throws IOException
- {
- super.close();
- connection.logout();
- }
-
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/Handler.java b/libjava/gnu/java/net/protocol/ftp/Handler.java
deleted file mode 100644
index 88491b3c15a..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/Handler.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Handler.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-
-/**
- * An FTP URL stream handler.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class Handler
- extends URLStreamHandler
-{
-
- protected int getDefaultPort()
- {
- return FTPConnection.FTP_PORT;
- }
-
- /**
- * Returns an FTPURLConnection for the given URL.
- */
- public URLConnection openConnection(URL url)
- throws IOException
- {
- return new FTPURLConnection(url);
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/PassiveModeDTP.java b/libjava/gnu/java/net/protocol/ftp/PassiveModeDTP.java
deleted file mode 100644
index 6f4fd634168..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/PassiveModeDTP.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/* PassiveModeDTP.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-
-/**
- * A passive mode FTP data transfer process.
- * This connects to the host specified and proxies the resulting socket's
- * input and output streams.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-final class PassiveModeDTP
- implements DTP
-{
-
- final String address;
- final int port;
- Socket socket;
- DTPInputStream in;
- DTPOutputStream out;
- boolean completed;
- boolean inProgress;
- int transferMode;
-
- PassiveModeDTP(String address, int port, InetAddress localhost,
- int connectionTimeout, int timeout)
- throws IOException
- {
- this.address = address;
- this.port = port;
- completed = false;
- inProgress = false;
- socket = new Socket();
- InetSocketAddress remote = new InetSocketAddress(address, port);
- InetSocketAddress local = new InetSocketAddress(localhost, port + 1);
- socket.bind(local);
- if (connectionTimeout > 0)
- {
- socket.connect(remote, connectionTimeout);
- }
- else
- {
- socket.connect(remote);
- }
- if (timeout > 0)
- {
- socket.setSoTimeout(timeout);
- }
- }
-
- /**
- * Returns an input stream from which a remote file can be read.
- */
- public InputStream getInputStream()
- throws IOException
- {
- if (inProgress)
- {
- throw new IOException("Transfer in progress");
- }
- switch (transferMode)
- {
- case FTPConnection.MODE_STREAM:
- in = new StreamInputStream(this, socket.getInputStream());
- break;
- case FTPConnection.MODE_BLOCK:
- in = new BlockInputStream(this, socket.getInputStream());
- break;
- case FTPConnection.MODE_COMPRESSED:
- in = new CompressedInputStream(this, socket.getInputStream());
- break;
- default:
- throw new IllegalStateException("Invalid transfer mode");
- }
- in.setTransferComplete(false);
- return in;
- }
-
- /**
- * Returns an output stream to which a local file can be written for
- * upload.
- */
- public OutputStream getOutputStream()
- throws IOException
- {
- if (inProgress)
- {
- throw new IOException("Transfer in progress");
- }
- switch (transferMode)
- {
- case FTPConnection.MODE_STREAM:
- out = new StreamOutputStream(this, socket.getOutputStream());
- break;
- case FTPConnection.MODE_BLOCK:
- out = new BlockOutputStream(this, socket.getOutputStream());
- break;
- case FTPConnection.MODE_COMPRESSED:
- out = new CompressedOutputStream(this, socket.getOutputStream());
- break;
- default:
- throw new IllegalStateException("Invalid transfer mode");
- }
- out.setTransferComplete(false);
- return out;
- }
-
- public void setTransferMode(int mode)
- {
- transferMode = mode;
- }
-
- public void complete()
- {
- completed = true;
- if (!inProgress)
- {
- transferComplete();
- }
- }
-
- public boolean abort()
- {
- completed = true;
- transferComplete();
- return inProgress;
- }
-
- /*
- * Called by DTPInputStream or DTPOutputStream when end of
- * stream is reached.
- */
- public void transferComplete()
- {
- if (in != null)
- {
- in.setTransferComplete(true);
- }
- if (out != null)
- {
- out.setTransferComplete(true);
- }
- inProgress = false;
- completed = completed ||(transferMode == FTPConnection.MODE_STREAM);
- if (completed && socket != null)
- {
- try
- {
- socket.close();
- }
- catch (IOException e)
- {
- }
- }
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/StreamInputStream.java b/libjava/gnu/java/net/protocol/ftp/StreamInputStream.java
deleted file mode 100644
index 93eee4e1924..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/StreamInputStream.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* StreamInputStream.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * A DTP input stream that implements the FTP stream data transfer mode.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-class StreamInputStream
- extends DTPInputStream
-{
-
- StreamInputStream(DTP dtp, InputStream in)
- {
- super(dtp, in);
- }
-
- public int read()
- throws IOException
- {
- if (transferComplete)
- {
- return -1;
- }
- int c = in.read();
- if (c == -1)
- {
- close();
- }
- return c;
- }
-
- public int read(byte[] buf)
- throws IOException
- {
- return read(buf, 0, buf.length);
- }
-
- public int read(byte[] buf, int off, int len)
- throws IOException
- {
- if (transferComplete)
- {
- return -1;
- }
- int l = in.read(buf, off, len);
- if (l == -1)
- {
- close();
- }
- return l;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/ftp/StreamOutputStream.java b/libjava/gnu/java/net/protocol/ftp/StreamOutputStream.java
deleted file mode 100644
index a6e28ece3d4..00000000000
--- a/libjava/gnu/java/net/protocol/ftp/StreamOutputStream.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* StreamOutputStream.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.ftp;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * A DTP output stream that implements the FTP stream transfer mode.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-class StreamOutputStream
- extends DTPOutputStream
-{
-
- StreamOutputStream(DTP dtp, OutputStream out)
- {
- super(dtp, out);
- }
-
- public void write(int c)
- throws IOException
- {
- if (transferComplete)
- {
- return;
- }
- out.write(c);
- }
-
- public void write(byte[] b)
- throws IOException
- {
- write(b, 0, b.length);
- }
-
- public void write(byte[] b, int off, int len)
- throws IOException
- {
- if (transferComplete)
- {
- return;
- }
- out.write(b, off, len);
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/Authenticator.java b/libjava/gnu/java/net/protocol/http/Authenticator.java
deleted file mode 100644
index 0d7c9881956..00000000000
--- a/libjava/gnu/java/net/protocol/http/Authenticator.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Authenticator.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-/**
- * Callback interface for managing authentication.
- * @see Request#setAuthenticator
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public interface Authenticator
-{
-
- /**
- * Returns the credentials to supply for the given realm.
- * @param realm the authentication realm
- * @param attempt zero on first authentication attempt, increments on each
- * unsuccessful attempt
- */
- Credentials getCredentials(String realm, int attempt);
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java b/libjava/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java
deleted file mode 100644
index 35ad2bccf45..00000000000
--- a/libjava/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ByteArrayRequestBodyWriter.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-/**
- * A simple request body writer using a byte array.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class ByteArrayRequestBodyWriter
- implements RequestBodyWriter
-{
-
- /**
- * The content.
- */
- protected byte[] content;
-
- /**
- * The position within the content at which the next read will occur.
- */
- protected int pos;
-
- /**
- * Constructs a new byte array request body writer with the specified
- * content.
- * @param content the content buffer
- */
- public ByteArrayRequestBodyWriter(byte[] content)
- {
- this.content = content;
- pos = 0;
- }
-
- /**
- * Returns the total number of bytes that will be written in a single pass
- * by this writer.
- */
- public int getContentLength()
- {
- return content.length;
- }
-
- /**
- * Initialises the writer.
- * This will be called before each pass.
- */
- public void reset()
- {
- pos = 0;
- }
-
- /**
- * Writes body content to the supplied buffer.
- * @param buffer the content buffer
- * @return the number of bytes written
- */
- public int write(byte[] buffer)
- {
- int len = content.length - pos;
- len = (buffer.length < len) ? buffer.length : len;
- if (len > -1)
- {
- System.arraycopy(content, pos, buffer, 0, len);
- pos += len;
- }
- return len;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/ByteArrayResponseBodyReader.java b/libjava/gnu/java/net/protocol/http/ByteArrayResponseBodyReader.java
deleted file mode 100644
index 680e45d3e49..00000000000
--- a/libjava/gnu/java/net/protocol/http/ByteArrayResponseBodyReader.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/* Authenticator.java --ByteArrayResponseBodyReader.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-/**
- * Simple response body reader that stores content in a byte array.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class ByteArrayResponseBodyReader
- implements ResponseBodyReader
-{
-
- /**
- * The content.
- */
- protected byte[] content;
-
- /**
- * The position in the content at which the next write will occur.
- */
- protected int pos;
-
- /**
- * The length of the buffer.
- */
- protected int len;
-
- /**
- * Constructs a new byte array response body reader.
- */
- public ByteArrayResponseBodyReader()
- {
- this(4096);
- }
-
- /**
- * Constructs a new byte array response body reader with the specified
- * initial buffer size.
- * @param size the initial buffer size
- */
- public ByteArrayResponseBodyReader(int size)
- {
- content = new byte[size];
- pos = len = 0;
- }
-
- /**
- * This reader accepts all responses.
- */
- public boolean accept(Request request, Response response)
- {
- return true;
- }
-
- public void read(byte[] buffer, int offset, int length)
- {
- int l = length - offset;
- if (pos + l > content.length)
- {
- byte[] tmp = new byte[content.length * 2];
- System.arraycopy(content, 0, tmp, 0, pos);
- content = tmp;
- }
- System.arraycopy(buffer, offset, content, pos, l);
- pos += l;
- len = pos;
- }
-
- public void close()
- {
- pos = 0;
- }
-
- /**
- * Retrieves the content of this reader as a byte array.
- * The size of the returned array is the number of bytes read.
- */
- public byte[] toByteArray()
- {
- byte[] ret = new byte[len];
- System.arraycopy(content, 0, ret, 0, len);
- return ret;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/ChunkedInputStream.java b/libjava/gnu/java/net/protocol/http/ChunkedInputStream.java
deleted file mode 100644
index c0706b70840..00000000000
--- a/libjava/gnu/java/net/protocol/http/ChunkedInputStream.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/* ChunkedInputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.ProtocolException;
-
-/**
- * Input stream wrapper for the "chunked" transfer-coding.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class ChunkedInputStream
- extends FilterInputStream
-{
-
- private static final byte CR = 0x0d;
- private static final byte LF = 0x0a;
-
- int size;
- int count;
- boolean meta;
- boolean eof;
- Headers headers;
-
- /**
- * Constructor.
- * @param in the response socket input stream
- * @param headers the headers to receive additional header lines
- */
- public ChunkedInputStream(InputStream in, Headers headers)
- {
- super(in);
- this.headers = headers;
- size = -1;
- count = 0;
- meta = true;
- }
-
- public int read()
- throws IOException
- {
- byte[] buf = new byte[1];
- int len = read(buf, 0, 1);
- if (len == -1)
- {
- return -1;
- }
- int ret = (int) buf[0];
- if (ret < 0)
- {
- ret += 0x100;
- }
- return ret;
- }
-
- public int read(byte[] buffer)
- throws IOException
- {
- return read(buffer, 0, buffer.length);
- }
-
- public int read(byte[] buffer, int offset, int length)
- throws IOException
- {
- if (eof)
- {
- return -1;
- }
- if (meta)
- {
- // Read chunk header
- int c, last = 0;
- boolean seenSemi = false;
- StringBuffer buf = new StringBuffer();
- do
- {
- c = in.read();
- if (c == 0x3b) // ;
- {
- seenSemi = true;
- }
- else if (c == 0x0a && last == 0x0d) // CRLF
- {
- size = Integer.parseInt(buf.toString(), 16);
- break;
- }
- else if (!seenSemi && c >= 0x30)
- {
- buf.append ((char) c);
- }
- last = c;
- }
- while(c != -1);
- count = 0;
- meta = false;
- }
- if (size == 0)
- {
- // Read trailer
- headers.parse(in);
- eof = true;
- return -1;
- }
- else
- {
- int diff = length - offset;
- int max = size - count;
- max = (diff < max) ? diff : max;
- int len = (max > 0) ? in.read(buffer, offset, max) : 0;
- count += len;
- if (count == size)
- {
- // Read CRLF
- int c1 = in.read();
- int c2 = in.read();
- if (c1 == -1 && c2 == -1)
- {
- // EOF before CRLF: bad, but ignore
- eof = true;
- return -1;
- }
- if (c1 != 0x0d || c2 != 0x0a)
- {
- throw new ProtocolException("expecting CRLF: " + c1 + "," + c2);
- }
- meta = true;
- }
- return len;
- }
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/Cookie.java b/libjava/gnu/java/net/protocol/http/Cookie.java
deleted file mode 100644
index 45e2f733ff3..00000000000
--- a/libjava/gnu/java/net/protocol/http/Cookie.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/* Cookie.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-import java.util.Date;
-
-/**
- * An HTTP cookie, as specified in RFC 2109.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class Cookie
-{
-
- /**
- * The name of the cookie.
- */
- protected final String name;
-
- /**
- * The value of the cookie.
- */
- protected final String value;
-
- /**
- * Optional documentation of the intended use of the cookie.
- */
- protected final String comment;
-
- /**
- * The domain for which the cookie is valid.
- */
- protected final String domain;
-
- /**
- * Optional subset of URL paths within the domain for which the cookie is
- * valid.
- */
- protected final String path;
-
- /**
- * Indicates that the user-agent should only use secure means to transmit
- * this cookie to the server.
- */
- protected final boolean secure;
-
- /**
- * The date at which this cookie expires.
- */
- protected final Date expires;
-
- public Cookie(String name, String value, String comment, String domain,
- String path, boolean secure, Date expires)
- {
- this.name = name;
- this.value = value;
- this.comment = comment;
- this.domain = domain;
- this.path = path;
- this.secure = secure;
- this.expires = expires;
- }
-
- public String getName()
- {
- return name;
- }
-
- public String getValue()
- {
- return value;
- }
-
- public String getComment()
- {
- return comment;
- }
-
- public String getDomain()
- {
- return domain;
- }
-
- public String getPath()
- {
- return path;
- }
-
- public boolean isSecure()
- {
- return secure;
- }
-
- public Date getExpiryDate()
- {
- return expires;
- }
-
- public String toString()
- {
- return toString(true, true);
- }
-
- public String toString(boolean showPath, boolean showDomain)
- {
- StringBuffer buf = new StringBuffer();
- buf.append(name);
- buf.append('=');
- buf.append(value);
- if (showPath)
- {
- buf.append("; $Path=");
- buf.append(path);
- }
- if (showDomain)
- {
- buf.append("; $Domain=");
- buf.append(domain);
- }
- return buf.toString();
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/CookieManager.java b/libjava/gnu/java/net/protocol/http/CookieManager.java
deleted file mode 100644
index cc1225c497d..00000000000
--- a/libjava/gnu/java/net/protocol/http/CookieManager.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* CookieManager.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-/**
- * Cookie manager interface.
- * If an application wants to handle cookies, they should implement this
- * interface and register the instance with each HTTPConnection they use.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public interface CookieManager
-{
-
- /**
- * Stores a cookie in the cookie manager.
- * @param cookie the cookie to store
- */
- void setCookie(Cookie cookie);
-
- /**
- * Retrieves the cookies matching the specified criteria.
- * @param host the host name
- * @param secure whether the connection is secure
- * @param path the path to access
- */
- Cookie[] getCookies(String host, boolean secure, String path);
-
-}
diff --git a/libjava/gnu/java/net/protocol/http/Credentials.java b/libjava/gnu/java/net/protocol/http/Credentials.java
deleted file mode 100644
index 9e5fcd172f5..00000000000
--- a/libjava/gnu/java/net/protocol/http/Credentials.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Credentials.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-/**
- * Represents a username/password combination that can be used to
- * authenticate to an HTTP server.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class Credentials
-{
-
- /**
- * The username.
- */
- private String username;
-
- /**
- * The password.
- */
- private String password;
-
- /**
- * Constructor.
- * @param username the username
- * @param password the password
- */
- public Credentials(String username, String password)
- {
- this.username = username;
- this.password = password;
- }
-
- /**
- * Returns the username.
- */
- public String getUsername()
- {
- return username;
- }
-
- /**
- * Returns the password.
- */
- public String getPassword()
- {
- return password;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/HTTPConnection.java b/libjava/gnu/java/net/protocol/http/HTTPConnection.java
deleted file mode 100644
index 221733dba05..00000000000
--- a/libjava/gnu/java/net/protocol/http/HTTPConnection.java
+++ /dev/null
@@ -1,681 +0,0 @@
-/* HTTPConnection.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-import gnu.classpath.Configuration;
-import gnu.classpath.SystemProperties;
-import gnu.java.net.EmptyX509TrustManager;
-import gnu.java.net.protocol.http.event.ConnectionEvent;
-import gnu.java.net.protocol.http.event.ConnectionListener;
-import gnu.java.net.protocol.http.event.RequestEvent;
-import gnu.java.net.protocol.http.event.RequestListener;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.security.GeneralSecurityException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.net.ssl.HandshakeCompletedListener;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocket;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-
-/**
- * A connection to an HTTP server.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class HTTPConnection
-{
-
- /**
- * The default HTTP port.
- */
- public static final int HTTP_PORT = 80;
-
- /**
- * The default HTTPS port.
- */
- public static final int HTTPS_PORT = 443;
-
- private static final String userAgent = SystemProperties.getProperty("http.agent");
-
- /**
- * The host name of the server to connect to.
- */
- protected final String hostname;
-
- /**
- * The port to connect to.
- */
- protected final int port;
-
- /**
- * Whether the connection should use transport level security (HTTPS).
- */
- protected final boolean secure;
-
- /**
- * The connection timeout for connecting the underlying socket.
- */
- protected final int connectionTimeout;
-
- /**
- * The read timeout for reads on the underlying socket.
- */
- protected final int timeout;
-
- /**
- * The host name of the proxy to connect to.
- */
- protected String proxyHostname;
-
- /**
- * The port on the proxy to connect to.
- */
- protected int proxyPort;
-
- /**
- * The major version of HTTP supported by this client.
- */
- protected int majorVersion;
-
- /**
- * The minor version of HTTP supported by this client.
- */
- protected int minorVersion;
-
- private final List connectionListeners;
- private final List requestListeners;
- private final List handshakeCompletedListeners;
-
- /**
- * The socket this connection communicates on.
- */
- protected Socket socket;
-
- /**
- * The SSL socket factory to use.
- */
- private SSLSocketFactory sslSocketFactory;
-
- /**
- * The socket input stream.
- */
- protected InputStream in;
-
- /**
- * The socket output stream.
- */
- protected OutputStream out;
-
- /**
- * Nonce values seen by this connection.
- */
- private Map nonceCounts;
-
- /**
- * The cookie manager for this connection.
- */
- protected CookieManager cookieManager;
-
- /**
- * Creates a new HTTP connection.
- * @param hostname the name of the host to connect to
- */
- public HTTPConnection(String hostname)
- {
- this(hostname, HTTP_PORT, false, 0, 0);
- }
-
- /**
- * Creates a new HTTP or HTTPS connection.
- * @param hostname the name of the host to connect to
- * @param secure whether to use a secure connection
- */
- public HTTPConnection(String hostname, boolean secure)
- {
- this(hostname, secure ? HTTPS_PORT : HTTP_PORT, secure, 0, 0);
- }
-
- /**
- * Creates a new HTTP or HTTPS connection on the specified port.
- * @param hostname the name of the host to connect to
- * @param secure whether to use a secure connection
- * @param connectionTimeout the connection timeout
- * @param timeout the socket read timeout
- */
- public HTTPConnection(String hostname, boolean secure,
- int connectionTimeout, int timeout)
- {
- this(hostname, secure ? HTTPS_PORT : HTTP_PORT, secure,
- connectionTimeout, timeout);
- }
-
- /**
- * Creates a new HTTP connection on the specified port.
- * @param hostname the name of the host to connect to
- * @param port the port on the host to connect to
- */
- public HTTPConnection(String hostname, int port)
- {
- this(hostname, port, false, 0, 0);
- }
-
- /**
- * Creates a new HTTP or HTTPS connection on the specified port.
- * @param hostname the name of the host to connect to
- * @param port the port on the host to connect to
- * @param secure whether to use a secure connection
- */
- public HTTPConnection(String hostname, int port, boolean secure)
- {
- this(hostname, port, secure, 0, 0);
- }
-
- /**
- * Creates a new HTTP or HTTPS connection on the specified port.
- * @param hostname the name of the host to connect to
- * @param port the port on the host to connect to
- * @param secure whether to use a secure connection
- * @param connectionTimeout the connection timeout
- * @param timeout the socket read timeout
- */
- public HTTPConnection(String hostname, int port, boolean secure,
- int connectionTimeout, int timeout)
- {
- this.hostname = hostname;
- this.port = port;
- this.secure = secure;
- this.connectionTimeout = connectionTimeout;
- this.timeout = timeout;
- majorVersion = minorVersion = 1;
- connectionListeners = new ArrayList(4);
- requestListeners = new ArrayList(4);
- handshakeCompletedListeners = new ArrayList(2);
- }
-
- /**
- * Returns the name of the host to connect to.
- */
- public String getHostName()
- {
- return hostname;
- }
-
- /**
- * Returns the port on the host to connect to.
- */
- public int getPort()
- {
- return port;
- }
-
- /**
- * Indicates whether to use a secure connection or not.
- */
- public boolean isSecure()
- {
- return secure;
- }
-
- /**
- * Returns the HTTP version string supported by this connection.
- * @see #version
- */
- public String getVersion()
- {
- return "HTTP/" + majorVersion + '.' + minorVersion;
- }
-
- /**
- * Sets the HTTP version supported by this connection.
- * @param majorVersion the major version
- * @param minorVersion the minor version
- */
- public void setVersion(int majorVersion, int minorVersion)
- {
- if (majorVersion != 1)
- {
- throw new IllegalArgumentException("major version not supported: " +
- majorVersion);
- }
- if (minorVersion < 0 || minorVersion > 1)
- {
- throw new IllegalArgumentException("minor version not supported: " +
- minorVersion);
- }
- this.majorVersion = majorVersion;
- this.minorVersion = minorVersion;
- }
-
- /**
- * Directs this connection to use the specified proxy.
- * @param hostname the proxy host name
- * @param port the port on the proxy to connect to
- */
- public void setProxy(String hostname, int port)
- {
- proxyHostname = hostname;
- proxyPort = port;
- }
-
- /**
- * Indicates whether this connection is using an HTTP proxy.
- */
- public boolean isUsingProxy()
- {
- return (proxyHostname != null && proxyPort > 0);
- }
-
- /**
- * Sets the cookie manager to use for this connection.
- * @param cookieManager the cookie manager
- */
- public void setCookieManager(CookieManager cookieManager)
- {
- this.cookieManager = cookieManager;
- }
-
- /**
- * Returns the cookie manager in use for this connection.
- */
- public CookieManager getCookieManager()
- {
- return cookieManager;
- }
-
- /**
- * Creates a new request using this connection.
- * @param method the HTTP method to invoke
- * @param path the URI-escaped RFC2396 <code>abs_path</code> with
- * optional query part
- */
- public Request newRequest(String method, String path)
- {
- if (method == null || method.length() == 0)
- {
- throw new IllegalArgumentException("method must have non-zero length");
- }
- if (path == null || path.length() == 0)
- {
- path = "/";
- }
- Request ret = new Request(this, method, path);
- if ((secure && port != HTTPS_PORT) ||
- (!secure && port != HTTP_PORT))
- {
- ret.setHeader("Host", hostname + ":" + port);
- }
- else
- {
- ret.setHeader("Host", hostname);
- }
- ret.setHeader("User-Agent", userAgent);
- ret.setHeader("Connection", "keep-alive");
- ret.setHeader("Accept-Encoding",
- "chunked;q=1.0, gzip;q=0.9, deflate;q=0.8, " +
- "identity;q=0.6, *;q=0");
- if (cookieManager != null)
- {
- Cookie[] cookies = cookieManager.getCookies(hostname, secure, path);
- if (cookies != null && cookies.length > 0)
- {
- StringBuffer buf = new StringBuffer();
- buf.append("$Version=1");
- for (int i = 0; i < cookies.length; i++)
- {
- buf.append(',');
- buf.append(' ');
- buf.append(cookies[i].toString());
- }
- ret.setHeader("Cookie", buf.toString());
- }
- }
- fireRequestEvent(RequestEvent.REQUEST_CREATED, ret);
- return ret;
- }
-
- /**
- * Closes this connection.
- */
- public void close()
- throws IOException
- {
- try
- {
- closeConnection();
- }
- finally
- {
- fireConnectionEvent(ConnectionEvent.CONNECTION_CLOSED);
- }
- }
-
- /**
- * Retrieves the socket associated with this connection.
- * This creates the socket if necessary.
- */
- protected Socket getSocket()
- throws IOException
- {
- if (socket == null)
- {
- String connectHostname = hostname;
- int connectPort = port;
- if (isUsingProxy())
- {
- connectHostname = proxyHostname;
- connectPort = proxyPort;
- }
- socket = new Socket();
- InetSocketAddress address =
- new InetSocketAddress(connectHostname, connectPort);
- if (connectionTimeout > 0)
- {
- socket.connect(address, connectionTimeout);
- }
- else
- {
- socket.connect(address);
- }
- if (timeout > 0)
- {
- socket.setSoTimeout(timeout);
- }
- if (secure)
- {
- try
- {
- SSLSocketFactory factory = getSSLSocketFactory();
- SSLSocket ss =
- (SSLSocket) factory.createSocket(socket, connectHostname,
- connectPort, true);
- String[] protocols = { "TLSv1", "SSLv3" };
- ss.setEnabledProtocols(protocols);
- ss.setUseClientMode(true);
- synchronized (handshakeCompletedListeners)
- {
- if (!handshakeCompletedListeners.isEmpty())
- {
- for (Iterator i =
- handshakeCompletedListeners.iterator();
- i.hasNext(); )
- {
- HandshakeCompletedListener l =
- (HandshakeCompletedListener) i.next();
- ss.addHandshakeCompletedListener(l);
- }
- }
- }
- ss.startHandshake();
- socket = ss;
- }
- catch (GeneralSecurityException e)
- {
- throw new IOException(e.getMessage());
- }
- }
- in = socket.getInputStream();
- in = new BufferedInputStream(in);
- out = socket.getOutputStream();
- out = new BufferedOutputStream(out);
- }
- return socket;
- }
-
- SSLSocketFactory getSSLSocketFactory()
- throws GeneralSecurityException
- {
- if (sslSocketFactory == null)
- {
- TrustManager tm = new EmptyX509TrustManager();
- SSLContext context = SSLContext.getInstance("SSL");
- TrustManager[] trust = new TrustManager[] { tm };
- context.init(null, trust, null);
- sslSocketFactory = context.getSocketFactory();
- }
- return sslSocketFactory;
- }
-
- void setSSLSocketFactory(SSLSocketFactory factory)
- {
- sslSocketFactory = factory;
- }
-
- protected InputStream getInputStream()
- throws IOException
- {
- if (socket == null)
- {
- getSocket();
- }
- return in;
- }
-
- protected OutputStream getOutputStream()
- throws IOException
- {
- if (socket == null)
- {
- getSocket();
- }
- return out;
- }
-
- /**
- * Closes the underlying socket, if any.
- */
- protected void closeConnection()
- throws IOException
- {
- if (socket != null)
- {
- try
- {
- socket.close();
- }
- finally
- {
- socket = null;
- }
- }
- }
-
- /**
- * Returns a URI representing the connection.
- * This does not include any request path component.
- */
- protected String getURI()
- {
- StringBuffer buf = new StringBuffer();
- buf.append(secure ? "https://" : "http://");
- buf.append(hostname);
- if (secure)
- {
- if (port != HTTPConnection.HTTPS_PORT)
- {
- buf.append(':');
- buf.append(port);
- }
- }
- else
- {
- if (port != HTTPConnection.HTTP_PORT)
- {
- buf.append(':');
- buf.append(port);
- }
- }
- return buf.toString();
- }
-
- /**
- * Get the number of times the specified nonce has been seen by this
- * connection.
- */
- int getNonceCount(String nonce)
- {
- if (nonceCounts == null)
- {
- return 0;
- }
- return((Integer) nonceCounts.get(nonce)).intValue();
- }
-
- /**
- * Increment the number of times the specified nonce has been seen.
- */
- void incrementNonce(String nonce)
- {
- int current = getNonceCount(nonce);
- if (nonceCounts == null)
- {
- nonceCounts = new HashMap();
- }
- nonceCounts.put(nonce, new Integer(current + 1));
- }
-
- // -- Events --
-
- public void addConnectionListener(ConnectionListener l)
- {
- synchronized (connectionListeners)
- {
- connectionListeners.add(l);
- }
- }
-
- public void removeConnectionListener(ConnectionListener l)
- {
- synchronized (connectionListeners)
- {
- connectionListeners.remove(l);
- }
- }
-
- protected void fireConnectionEvent(int type)
- {
- ConnectionEvent event = new ConnectionEvent(this, type);
- ConnectionListener[] l = null;
- synchronized (connectionListeners)
- {
- l = new ConnectionListener[connectionListeners.size()];
- connectionListeners.toArray(l);
- }
- for (int i = 0; i < l.length; i++)
- {
- switch (type)
- {
- case ConnectionEvent.CONNECTION_CLOSED:
- l[i].connectionClosed(event);
- break;
- }
- }
- }
-
- public void addRequestListener(RequestListener l)
- {
- synchronized (requestListeners)
- {
- requestListeners.add(l);
- }
- }
-
- public void removeRequestListener(RequestListener l)
- {
- synchronized (requestListeners)
- {
- requestListeners.remove(l);
- }
- }
-
- protected void fireRequestEvent(int type, Request request)
- {
- RequestEvent event = new RequestEvent(this, type, request);
- RequestListener[] l = null;
- synchronized (requestListeners)
- {
- l = new RequestListener[requestListeners.size()];
- requestListeners.toArray(l);
- }
- for (int i = 0; i < l.length; i++)
- {
- switch (type)
- {
- case RequestEvent.REQUEST_CREATED:
- l[i].requestCreated(event);
- break;
- case RequestEvent.REQUEST_SENDING:
- l[i].requestSent(event);
- break;
- case RequestEvent.REQUEST_SENT:
- l[i].requestSent(event);
- break;
- }
- }
- }
-
- void addHandshakeCompletedListener(HandshakeCompletedListener l)
- {
- synchronized (handshakeCompletedListeners)
- {
- handshakeCompletedListeners.add(l);
- }
- }
- void removeHandshakeCompletedListener(HandshakeCompletedListener l)
- {
- synchronized (handshakeCompletedListeners)
- {
- handshakeCompletedListeners.remove(l);
- }
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/HTTPDateFormat.java b/libjava/gnu/java/net/protocol/http/HTTPDateFormat.java
deleted file mode 100644
index 2f59e43181c..00000000000
--- a/libjava/gnu/java/net/protocol/http/HTTPDateFormat.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/* HTTPDateFormat.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-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.
- * Formats dates according to RFC 822 (updated by RFC 1123).
- * Parses dates according to the above, <i>or</i> RFC 1036, <i>or</i> the
- * ANSI C <code>asctime()</code> format.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class HTTPDateFormat
- extends DateFormat
-{
-
- static final String[] DAYS_OF_WEEK = {
- null, "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
- };
-
- static final String[] MONTHS = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
- };
-
- public HTTPDateFormat()
- {
- calendar = new GregorianCalendar(TimeZone.getTimeZone ("GMT"));
- numberFormat = new DecimalFormat();
- }
-
- /**
- * Appends the textual value for the specified field to the given string
- * buffer. This method should be avoided, use <code>format(Date)</code>
- * instead.
- * @param date the Date object
- * @param buf the buffer to append to
- * @param field the current field position
- * @return the modified buffer
- */
- public StringBuffer format(Date date, StringBuffer buf,
- FieldPosition field)
- {
- calendar.clear();
- calendar.setTime(date);
- buf.setLength(0);
-
- // Day of week
- buf.append(DAYS_OF_WEEK[calendar.get(Calendar.DAY_OF_WEEK)]);
- buf.append(',');
- buf.append(' ');
-
- // Day of month
- int day = calendar.get(Calendar.DAY_OF_MONTH);
- buf.append(Character.forDigit(day / 10, 10));
- buf.append(Character.forDigit(day % 10, 10));
- buf.append(' ');
-
- // Month
- buf.append(MONTHS[calendar.get(Calendar.MONTH)]);
- buf.append(' ');
-
- // Year
- int year = calendar.get(Calendar.YEAR);
- if (year < 1000)
- {
- buf.append('0');
- if (year < 100)
- {
- buf.append('0');
- if (year < 10)
- {
- buf.append('0');
- }
- }
- }
- buf.append(Integer.toString(year));
- buf.append(' ');
-
- // Hour
- int hour = calendar.get(Calendar.HOUR_OF_DAY);
- buf.append(Character.forDigit(hour / 10, 10));
- buf.append(Character.forDigit(hour % 10, 10));
- buf.append(':');
-
- // Minute
- int minute = calendar.get(Calendar.MINUTE);
- buf.append(Character.forDigit(minute / 10, 10));
- buf.append(Character.forDigit(minute % 10, 10));
- buf.append(':');
-
- // Second
- int second = calendar.get(Calendar.SECOND);
- buf.append(Character.forDigit(second / 10, 10));
- buf.append(Character.forDigit(second % 10, 10));
- buf.append(' ');
-
- // Timezone
- // Get time offset in minutes
- int zoneOffset =(calendar.get(Calendar.ZONE_OFFSET) +
- calendar.get(Calendar.DST_OFFSET)) / 60000;
-
- // Apply + or - appropriately
- if (zoneOffset < 0)
- {
- zoneOffset = -zoneOffset;
- buf.append('-');
- }
- else
- {
- buf.append('+');
- }
-
- // Set the 2 2-char fields as specified above
- int tzhours = zoneOffset / 60;
- buf.append(Character.forDigit(tzhours / 10, 10));
- buf.append(Character.forDigit(tzhours % 10, 10));
- int tzminutes = zoneOffset % 60;
- buf.append(Character.forDigit(tzminutes / 10, 10));
- buf.append(Character.forDigit(tzminutes % 10, 10));
-
- field.setBeginIndex(0);
- field.setEndIndex(buf.length());
- return buf;
- }
-
- /**
- * Parses the given date in the current TimeZone.
- * @param text the formatted date to be parsed
- * @param pos the current parse position
- */
- public Date parse(String text, ParsePosition pos)
- {
- int date, month, year, hour, minute, second;
- String monthText;
- int start = 0, end = -1;
- int len = text.length();
- calendar.clear();
- pos.setIndex(start);
- try
- {
- // Advance to date
- if (Character.isLetter(text.charAt(start)))
- {
- start = skipNonWhitespace(text, start);
- }
- // Determine mode
- switch(start)
- {
- case 3:
- // asctime
- start = skipWhitespace(text, start);
- pos.setIndex(start);
- end = skipNonWhitespace(text, start + 1);
- monthText = text.substring(start, end);
- month = -1;
- for (int i = 0; i < 12; i++)
- {
- if (MONTHS[i].equals(monthText))
- {
- month = i;
- break;
- }
- }
- if (month == -1)
- {
- pos.setErrorIndex(end);
- return null;
- }
- // Advance to date
- start = skipWhitespace(text, end + 1);
- pos.setIndex(start);
- end = skipNonWhitespace(text, start + 1);
- date = Integer.parseInt(text.substring(start, end));
- // Advance to hour
- start = skipWhitespace(text, end + 1);
- pos.setIndex(start);
- end = skipTo(text, start + 1, ':');
- hour = Integer.parseInt(text.substring(start, end));
- // Advance to minute
- start = end + 1;
- pos.setIndex(start);
- end = skipTo(text, start + 1, ':');
- minute = Integer.parseInt(text.substring(start, end));
- // Advance to second
- start = end + 1;
- pos.setIndex(start);
- end = skipNonWhitespace(text, start + 1);
- second = Integer.parseInt(text.substring(start, end));
- // Advance to year
- start = skipWhitespace(text, end + 1);
- pos.setIndex(start);
- end = skipNonWhitespace(text, start + 1);
- year = Integer.parseInt(text.substring(start, end));
- break;
- case 0:
- case 4:
- // rfc822
- start = skipWhitespace(text, start);
- pos.setIndex(start);
- end = skipNonWhitespace(text, start + 1);
- date = Integer.parseInt(text.substring(start, end));
- // Advance to month
- start = skipWhitespace(text, end + 1);
- pos.setIndex(start);
- end = skipNonWhitespace(text, start + 1);
- monthText = text.substring(start, end);
- month = -1;
- for (int i = 0; i < 12; i++)
- {
- if (MONTHS[i].equals(monthText))
- {
- month = i;
- break;
- }
- }
- if (month == -1)
- {
- pos.setErrorIndex(end);
- return null;
- }
- // Advance to year
- start = skipWhitespace(text, end + 1);
- pos.setIndex(start);
- end = skipNonWhitespace(text, start + 1);
- year = Integer.parseInt(text.substring(start, end));
- // Advance to hour
- start = skipWhitespace(text, end + 1);
- pos.setIndex(start);
- end = skipTo(text, start + 1, ':');
- hour = Integer.parseInt(text.substring(start, end));
- // Advance to minute
- start = end + 1;
- pos.setIndex(start);
- end = skipTo(text, start + 1, ':');
- minute = Integer.parseInt(text.substring(start, end));
- // Advance to second
- start = end + 1;
- pos.setIndex(start);
- end = start + 1;
- while (end < len && !Character.isWhitespace(text.charAt(end)))
- {
- end++;
- }
- second = Integer.parseInt(text.substring(start, end));
- break;
- default:
- // rfc850(obsolete)
- start = skipWhitespace(text, start);
- pos.setIndex(start);
- end = skipTo(text, start + 1, '-');
- date = Integer.parseInt(text.substring(start, end));
- // Advance to month
- start = end + 1;
- pos.setIndex(start);
- end = skipTo(text, start + 1, '-');
- monthText = text.substring(start, end);
- month = -1;
- for (int i = 0; i < 12; i++)
- {
- if (MONTHS[i].equals(monthText))
- {
- month = i;
- break;
- }
- }
- if (month == -1)
- {
- pos.setErrorIndex(end);
- return null;
- }
- // Advance to year
- start = end + 1;
- pos.setIndex(start);
- end = skipNonWhitespace(text, start + 1);
- year = 1900 + Integer.parseInt(text.substring(start, end));
- // Advance to hour
- start = skipWhitespace(text, end + 1);
- pos.setIndex(start);
- end = skipTo(text, start + 1, ':');
- hour = Integer.parseInt(text.substring(start, end));
- // Advance to minute
- start = end + 1;
- pos.setIndex(start);
- end = skipTo(text, start + 1, ':');
- minute = Integer.parseInt(text.substring(start, end));
- // Advance to second
- start = end + 1;
- pos.setIndex(start);
- end = start + 1;
- while (end < len && !Character.isWhitespace(text.charAt(end)))
- {
- end++;
- }
- second = Integer.parseInt(text.substring(start, end));
- }
-
- calendar.set(Calendar.YEAR, year);
- calendar.set(Calendar.MONTH, month);
- calendar.set(Calendar.DAY_OF_MONTH, date);
- calendar.set(Calendar.HOUR, hour);
- calendar.set(Calendar.MINUTE, minute);
- calendar.set(Calendar.SECOND, second);
-
- if (end != len)
- {
- // Timezone
- start = skipWhitespace(text, end + 1);
- end = start + 1;
- while (end < len && !Character.isWhitespace(text.charAt(end)))
- {
- end++;
- }
- char pm = text.charAt(start);
- if (Character.isLetter(pm))
- {
- TimeZone tz =
- TimeZone.getTimeZone(text.substring(start, end));
- calendar.set(Calendar.ZONE_OFFSET, tz.getRawOffset());
- }
- else
- {
- int zoneOffset = 0;
- zoneOffset += 600 * Character.digit(text.charAt(++start), 10);
- zoneOffset += 60 * Character.digit(text.charAt(++start), 10);
- zoneOffset += 10 * Character.digit(text.charAt(++start), 10);
- zoneOffset += Character.digit(text.charAt(++start), 10);
- zoneOffset *= 60000; // minutes -> ms
- if ('-' == pm)
- {
- zoneOffset = -zoneOffset;
- }
- calendar.set(Calendar.ZONE_OFFSET, zoneOffset);
- }
- }
- pos.setIndex(end);
-
- return calendar.getTime();
- }
- catch (NumberFormatException e)
- {
- pos.setErrorIndex(Math.max(start, end));
- }
- catch (StringIndexOutOfBoundsException e)
- {
- pos.setErrorIndex(Math.max(start, end));
- }
- return null;
- }
-
- private int skipWhitespace(String text, int pos)
- {
- while(Character.isWhitespace(text.charAt(pos)))
- {
- pos++;
- }
- return pos;
- }
-
- private int skipNonWhitespace(String text, int pos)
- {
- while(!Character.isWhitespace(text.charAt(pos)))
- {
- pos++;
- }
- return pos;
- }
-
- private int skipTo(String text, int pos, char c)
- {
- while(text.charAt(pos) != c)
- {
- pos++;
- }
- return pos;
- }
-
- /**
- * Don't allow setting the calendar.
- */
- public void setCalendar(Calendar newCalendar)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Don't allow setting the NumberFormat.
- */
- public void setNumberFormat(NumberFormat newNumberFormat)
- {
- throw new UnsupportedOperationException();
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/HTTPURLConnection.java b/libjava/gnu/java/net/protocol/http/HTTPURLConnection.java
deleted file mode 100644
index 1745a34abff..00000000000
--- a/libjava/gnu/java/net/protocol/http/HTTPURLConnection.java
+++ /dev/null
@@ -1,682 +0,0 @@
-/* HTTPURLConnection.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.ProtocolException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.cert.Certificate;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import javax.net.ssl.HandshakeCompletedEvent;
-import javax.net.ssl.HandshakeCompletedListener;
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLPeerUnverifiedException;
-import javax.net.ssl.SSLSocketFactory;
-
-/**
- * A URLConnection that uses the HTTPConnection class.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class HTTPURLConnection
- extends HttpsURLConnection
- implements HandshakeCompletedListener
-{
-
- /**
- * Pool of reusable connections, used if keepAlive is true.
- */
- private static final Map connectionPool = new LinkedHashMap();
-
- /*
- * The underlying connection.
- */
- private HTTPConnection connection;
-
- private String proxyHostname;
- private int proxyPort;
- private String agent;
- private boolean keepAlive;
- private int maxConnections;
-
- private Request request;
- private Headers requestHeaders;
- private ByteArrayOutputStream requestSink;
- private boolean requestMethodSetExplicitly;
-
- private Response response;
- private ByteArrayInputStream responseSink;
- private ByteArrayInputStream errorSink;
-
- private HandshakeCompletedEvent handshakeEvent;
-
- /**
- * Constructor.
- * @param url the URL
- */
- public HTTPURLConnection(URL url)
- throws IOException
- {
- super(url);
- requestHeaders = new Headers();
- AccessController.doPrivileged(this.new GetHTTPPropertiesAction());
- }
-
- class GetHTTPPropertiesAction
- implements PrivilegedAction
- {
-
- public Object run()
- {
- proxyHostname = System.getProperty("http.proxyHost");
- if (proxyHostname != null && proxyHostname.length() > 0)
- {
- String port = System.getProperty("http.proxyPort");
- if (port != null && port.length() > 0)
- {
- proxyPort = Integer.parseInt(port);
- }
- else
- {
- proxyHostname = null;
- proxyPort = -1;
- }
- }
- agent = System.getProperty("http.agent");
- String ka = System.getProperty("http.keepAlive");
- keepAlive = !(ka != null && "false".equals(ka));
- String mc = System.getProperty("http.maxConnections");
- maxConnections = (mc != null && mc.length() > 0) ?
- Math.max(Integer.parseInt(mc), 1) : 5;
- return null;
- }
-
- }
-
- public void connect()
- throws IOException
- {
- if (connected)
- {
- return;
- }
- String protocol = url.getProtocol();
- boolean secure = "https".equals(protocol);
- String host = url.getHost();
- int port = url.getPort();
- if (port < 0)
- {
- port = secure ? HTTPConnection.HTTPS_PORT :
- HTTPConnection.HTTP_PORT;
- }
- String file = url.getFile();
- String username = url.getUserInfo();
- String password = null;
- if (username != null)
- {
- int ci = username.indexOf(':');
- if (ci != -1)
- {
- password = username.substring(ci + 1);
- username = username.substring(0, ci);
- }
- }
- final Credentials creds = (username == null) ? null :
- new Credentials (username, password);
-
- boolean retry;
- do
- {
- retry = false;
- if (connection == null)
- {
- connection = getConnection(host, port, secure);
- if (secure)
- {
- SSLSocketFactory factory = getSSLSocketFactory();
- HostnameVerifier verifier = getHostnameVerifier();
- if (factory != null)
- {
- connection.setSSLSocketFactory(factory);
- }
- connection.addHandshakeCompletedListener(this);
- // TODO verifier
- }
- }
- if (proxyHostname != null)
- {
- if (proxyPort < 0)
- {
- proxyPort = secure ? HTTPConnection.HTTPS_PORT :
- HTTPConnection.HTTP_PORT;
- }
- connection.setProxy(proxyHostname, proxyPort);
- }
- request = connection.newRequest(method, file);
- if (!keepAlive)
- {
- request.setHeader("Connection", "close");
- }
- if (agent != null)
- {
- request.setHeader("User-Agent", agent);
- }
- request.getHeaders().putAll(requestHeaders);
- if (requestSink != null)
- {
- byte[] content = requestSink.toByteArray();
- RequestBodyWriter writer = new ByteArrayRequestBodyWriter(content);
- request.setRequestBodyWriter(writer);
- }
- ByteArrayResponseBodyReader reader = new ByteArrayResponseBodyReader();
- request.setResponseBodyReader(reader);
- if (creds != null)
- {
- request.setAuthenticator(new Authenticator() {
- public Credentials getCredentials(String realm, int attempts)
- {
- return (attempts < 2) ? creds : null;
- }
- });
- }
- response = request.dispatch();
- if (response.getCodeClass() == 3 && getInstanceFollowRedirects())
- {
- // Follow redirect
- String location = response.getHeader("Location");
- String connectionUri = connection.getURI();
- int start = connectionUri.length();
- if (location.startsWith(connectionUri) &&
- location.charAt(start) == '/')
- {
- file = location.substring(start);
- retry = true;
- }
- else if (location.startsWith("http:"))
- {
- connection.close();
- connection = null;
- secure = false;
- start = 7;
- int end = location.indexOf('/', start);
- host = location.substring(start, end);
- int ci = host.lastIndexOf(':');
- if (ci != -1)
- {
- port = Integer.parseInt(host.substring (ci + 1));
- host = host.substring(0, ci);
- }
- else
- {
- port = HTTPConnection.HTTP_PORT;
- }
- file = location.substring(end);
- retry = true;
- }
- else if (location.startsWith("https:"))
- {
- connection.close();
- connection = null;
- secure = true;
- start = 8;
- int end = location.indexOf('/', start);
- host = location.substring(start, end);
- int ci = host.lastIndexOf(':');
- if (ci != -1)
- {
- port = Integer.parseInt(host.substring (ci + 1));
- host = host.substring(0, ci);
- }
- else
- {
- port = HTTPConnection.HTTPS_PORT;
- }
- file = location.substring(end);
- retry = true;
- }
- else if (location.length() > 0)
- {
- // Malformed absolute URI, treat as file part of URI
- if (location.charAt(0) == '/')
- {
- // Absolute path
- file = location;
- }
- else
- {
- // Relative path
- int lsi = file.lastIndexOf('/');
- file = (lsi == -1) ? "/" : file.substring(0, lsi + 1);
- file += location;
- }
- retry = true;
- }
- }
- else
- {
- responseSink = new ByteArrayInputStream(reader.toByteArray ());
- if (response.getCode() == 404)
- {
- errorSink = responseSink;
- throw new FileNotFoundException(url.toString());
- }
- }
- }
- while (retry);
- connected = true;
- }
-
- /**
- * Returns a connection, from the pool if necessary.
- */
- HTTPConnection getConnection(String host, int port, boolean secure)
- throws IOException
- {
- HTTPConnection connection;
- if (keepAlive)
- {
- StringBuffer buf = new StringBuffer(secure ? "https://" : "http://");
- buf.append(host);
- buf.append(':');
- buf.append(port);
- String key = buf.toString();
- synchronized (connectionPool)
- {
- connection = (HTTPConnection) connectionPool.get(key);
- if (connection == null)
- {
- connection = new HTTPConnection(host, port, secure);
- // Good housekeeping
- if (connectionPool.size() == maxConnections)
- {
- // maxConnections must always be >= 1
- Object lru = connectionPool.keySet().iterator().next();
- connectionPool.remove(lru);
- }
- connectionPool.put(key, connection);
- }
- }
- }
- else
- {
- connection = new HTTPConnection(host, port, secure);
- }
- return connection;
- }
-
- public void disconnect()
- {
- if (connection != null)
- {
- try
- {
- connection.close();
- }
- catch (IOException e)
- {
- }
- }
- }
-
- public boolean usingProxy()
- {
- return (proxyHostname != null);
- }
-
- /**
- * Overrides the corresponding method in HttpURLConnection to permit
- * arbitrary methods, as long as they're valid ASCII alphabetic
- * characters. This is to permit WebDAV and other HTTP extensions to
- * function.
- * @param method the method
- */
- public void setRequestMethod(String method)
- throws ProtocolException
- {
- if (connected)
- {
- throw new ProtocolException("Already connected");
- }
- // Validate
- method = method.toUpperCase();
- int len = method.length();
- if (len == 0)
- {
- throw new ProtocolException("Empty method name");
- }
- for (int i = 0; i < len; i++)
- {
- char c = method.charAt(i);
- if (c < 0x41 || c > 0x5a)
- {
- throw new ProtocolException("Illegal character '" + c +
- "' at index " + i);
- }
- }
- // OK
- this.method = method;
- requestMethodSetExplicitly = true;
- }
-
- public String getRequestProperty(String key)
- {
- return requestHeaders.getValue(key);
- }
-
- public Map getRequestProperties()
- {
- return requestHeaders;
- }
-
- public void setRequestProperty(String key, String value)
- {
- requestHeaders.put(key, value);
- }
-
- public void addRequestProperty(String key, String value)
- {
- String old = requestHeaders.getValue(key);
- if (old == null)
- {
- requestHeaders.put(key, value);
- }
- else
- {
- requestHeaders.put(key, old + "," + value);
- }
- }
-
- public OutputStream getOutputStream()
- throws IOException
- {
- if (connected)
- {
- throw new ProtocolException("Already connected");
- }
- if (!doOutput)
- {
- throw new ProtocolException("doOutput is false");
- }
- else if (!requestMethodSetExplicitly)
- {
- /*
- * Silently change the method to POST if no method was set
- * explicitly. This is due to broken applications depending on this
- * behaviour (Apache XMLRPC for one).
- */
- method = "POST";
- }
- if (requestSink == null)
- {
- requestSink = new ByteArrayOutputStream();
- }
- return requestSink;
- }
-
- // -- Response --
-
- public InputStream getInputStream()
- throws IOException
- {
- if (!connected)
- {
- connect();
- }
- if (!doInput)
- {
- throw new ProtocolException("doInput is false");
- }
- return responseSink;
- }
-
- public InputStream getErrorStream()
- {
- return errorSink;
- }
-
- public Map getHeaderFields()
- {
- if (!connected)
- {
- try
- {
- connect();
- }
- catch (IOException e)
- {
- return null;
- }
- }
- Map headers = response.getHeaders();
- Map ret = new LinkedHashMap();
- ret.put("", Collections.singletonList(getStatusLine(response)));
- for (Iterator i = headers.entrySet().iterator(); i.hasNext(); )
- {
- Map.Entry entry = (Map.Entry) i.next();
- String key = (String) entry.getKey();
- String value = (String) entry.getValue();
- ret.put(key, Collections.singletonList(value));
- }
- return ret;
- }
-
- String getStatusLine(Response response)
- {
- return "HTTP/" + response.getMajorVersion() +
- "." + response.getMinorVersion() +
- " " + response.getCode() +
- " " + response.getMessage();
- }
-
- public String getHeaderField(int index)
- {
- if (!connected)
- {
- try
- {
- connect();
- }
- catch (IOException e)
- {
- return null;
- }
- }
- if (index == 0)
- {
- return getStatusLine(response);
- }
- Iterator i = response.getHeaders().entrySet().iterator();
- Map.Entry entry;
- int count = 1;
- do
- {
- if (!i.hasNext())
- {
- return null;
- }
- entry = (Map.Entry) i.next();
- count++;
- }
- while (count <= index);
- return (String) entry.getValue();
- }
-
- public String getHeaderFieldKey(int index)
- {
- if (!connected)
- {
- try
- {
- connect();
- }
- catch (IOException e)
- {
- return null;
- }
- }
- if (index == 0)
- {
- return null;
- }
- Iterator i = response.getHeaders().entrySet().iterator();
- Map.Entry entry;
- int count = 1;
- do
- {
- if (!i.hasNext())
- {
- return null;
- }
- entry = (Map.Entry) i.next();
- count++;
- }
- while (count <= index);
- return (String) entry.getKey();
- }
-
- public String getHeaderField(String name)
- {
- if (!connected)
- {
- try
- {
- connect();
- }
- catch (IOException e)
- {
- return null;
- }
- }
- return (String) response.getHeader(name);
- }
-
- public long getHeaderFieldDate(String name, long def)
- {
- if (!connected)
- {
- try
- {
- connect();
- }
- catch (IOException e)
- {
- return def;
- }
- }
- Date date = response.getDateHeader(name);
- return (date == null) ? def : date.getTime();
- }
-
- public String getContentType()
- {
- return getHeaderField("Content-Type");
- }
-
- public int getResponseCode()
- throws IOException
- {
- if (!connected)
- {
- connect();
- }
- return response.getCode();
- }
-
- public String getResponseMessage()
- throws IOException
- {
- if (!connected)
- {
- connect();
- }
- return response.getMessage();
- }
-
- // -- HTTPS specific --
-
- public String getCipherSuite()
- {
- if (!connected)
- {
- throw new IllegalStateException("not connected");
- }
- return handshakeEvent.getCipherSuite();
- }
-
- public Certificate[] getLocalCertificates()
- {
- if (!connected)
- {
- throw new IllegalStateException("not connected");
- }
- return handshakeEvent.getLocalCertificates();
- }
-
- public Certificate[] getServerCertificates()
- throws SSLPeerUnverifiedException
- {
- if (!connected)
- {
- throw new IllegalStateException("not connected");
- }
- return handshakeEvent.getPeerCertificates();
- }
-
- // HandshakeCompletedListener
-
- public void handshakeCompleted(HandshakeCompletedEvent event)
- {
- handshakeEvent = event;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/Handler.java b/libjava/gnu/java/net/protocol/http/Handler.java
deleted file mode 100644
index 64054251331..00000000000
--- a/libjava/gnu/java/net/protocol/http/Handler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Handler.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-
-/**
- * An HTTP URL stream handler.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class Handler
- extends URLStreamHandler
-{
-
- /**
- * Returns the default HTTP port (80).
- */
- protected int getDefaultPort()
- {
- return HTTPConnection.HTTP_PORT;
- }
-
- /**
- * Returns an HTTPURLConnection for the given URL.
- */
- public URLConnection openConnection(URL url)
- throws IOException
- {
- return new HTTPURLConnection(url);
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/Headers.java b/libjava/gnu/java/net/protocol/http/Headers.java
deleted file mode 100644
index 847ebefc1f6..00000000000
--- a/libjava/gnu/java/net/protocol/http/Headers.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/* Headers.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-import gnu.java.net.LineInputStream;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A collection of HTTP header names and associated values.
- * Retrieval of values is case insensitive. An iteration over the keys
- * returns the header names in the order they were received.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class Headers
- implements Map
-{
-
- static final DateFormat dateFormat = new HTTPDateFormat();
-
- static class Header
- {
-
- final String name;
-
- Header(String name)
- {
- if (name == null || name.length() == 0)
- {
- throw new IllegalArgumentException(name);
- }
- this.name = name;
- }
-
- public int hashCode()
- {
- return name.toLowerCase().hashCode();
- }
-
- public boolean equals(Object other)
- {
- if (other instanceof Header)
- {
- return ((Header) other).name.equalsIgnoreCase(name);
- }
- return false;
- }
-
- public String toString()
- {
- return name;
- }
-
- }
-
- static class HeaderEntry
- implements Map.Entry
- {
-
- final Map.Entry entry;
-
- HeaderEntry(Map.Entry entry)
- {
- this.entry = entry;
- }
-
- public Object getKey()
- {
- return ((Header) entry.getKey()).name;
- }
-
- public Object getValue()
- {
- return entry.getValue();
- }
-
- public Object setValue(Object value)
- {
- return entry.setValue(value);
- }
-
- public int hashCode()
- {
- return entry.hashCode();
- }
-
- public boolean equals(Object other)
- {
- return entry.equals(other);
- }
-
- public String toString()
- {
- return getKey().toString() + "=" + getValue();
- }
-
- }
-
- private LinkedHashMap headers;
-
- public Headers()
- {
- headers = new LinkedHashMap();
- }
-
- public int size()
- {
- return headers.size();
- }
-
- public boolean isEmpty()
- {
- return headers.isEmpty();
- }
-
- public boolean containsKey(Object key)
- {
- return headers.containsKey(new Header((String) key));
- }
-
- public boolean containsValue(Object value)
- {
- return headers.containsValue(value);
- }
-
- public Object get(Object key)
- {
- return headers.get(new Header((String) key));
- }
-
- /**
- * Returns the value of the specified header as a string.
- */
- public String getValue(String header)
- {
- return (String) headers.get(new Header(header));
- }
-
- /**
- * Returns the value of the specified header as an integer,
- * or -1 if the header is not present or not an integer.
- */
- public int getIntValue(String header)
- {
- String val = getValue(header);
- if (val == null)
- {
- return -1;
- }
- try
- {
- return Integer.parseInt(val);
- }
- catch (NumberFormatException e)
- {
- }
- return -1;
- }
-
- /**
- * Returns the value of the specified header as a date,
- * or <code>null</code> if the header is not present or not a date.
- */
- public Date getDateValue(String header)
- {
- String val = getValue(header);
- if (val == null)
- {
- return null;
- }
- try
- {
- return dateFormat.parse(val);
- }
- catch (ParseException e)
- {
- return null;
- }
- }
-
- public Object put(Object key, Object value)
- {
- return headers.put(new Header((String) key), value);
- }
-
- public Object remove(Object key)
- {
- return headers.remove(new Header((String) key));
- }
-
- public void putAll(Map t)
- {
- for (Iterator i = t.keySet().iterator(); i.hasNext(); )
- {
- String key = (String) i.next();
- String value = (String) t.get(key);
- headers.put(new Header(key), value);
- }
- }
-
- public void clear()
- {
- headers.clear();
- }
-
- public Set keySet()
- {
- Set keys = headers.keySet();
- Set ret = new LinkedHashSet();
- for (Iterator i = keys.iterator(); i.hasNext(); )
- {
- ret.add(((Header) i.next()).name);
- }
- return ret;
- }
-
- public Collection values()
- {
- return headers.values();
- }
-
- public Set entrySet()
- {
- Set entries = headers.entrySet();
- Set ret = new LinkedHashSet();
- for (Iterator i = entries.iterator(); i.hasNext(); )
- {
- Map.Entry entry = (Map.Entry) i.next();
- ret.add(new HeaderEntry(entry));
- }
- return ret;
- }
-
- public boolean equals(Object other)
- {
- return headers.equals(other);
- }
-
- public int hashCode()
- {
- return headers.hashCode();
- }
-
- /**
- * Parse the specified input stream, adding headers to this collection.
- */
- public void parse(InputStream in)
- throws IOException
- {
- LineInputStream lin = (in instanceof LineInputStream) ?
- (LineInputStream) in : new LineInputStream(in);
-
- String name = null;
- StringBuffer value = new StringBuffer();
- while (true)
- {
- String line = lin.readLine();
- if (line == null)
- {
- if (name != null)
- {
- addValue(name, value.toString());
- }
- break;
- }
- int len = line.length();
- if (len < 2)
- {
- if (name != null)
- {
- addValue(name, value.toString());
- }
- break;
- }
- char c1 = line.charAt(0);
- if (c1 == ' ' || c1 == '\t')
- {
- // Continuation
- int last = len - 1;
- if (line.charAt(last) != '\r')
- ++last;
- value.append(line.substring(0, last));
- }
- else
- {
- if (name != null)
- {
- addValue(name, value.toString());
- }
-
- int di = line.indexOf(':');
- name = line.substring(0, di);
- value.setLength(0);
- do
- {
- di++;
- }
- while (di < len && line.charAt(di) == ' ');
- int last = len - 1;
- if (line.charAt(last) != '\r')
- ++last;
- value.append(line.substring(di, last));
- }
- }
- }
-
- private void addValue(String name, String value)
- {
- Header key = new Header(name);
- String old = (String) headers.get(key);
- if (old == null)
- {
- headers.put(key, value);
- }
- else
- {
- headers.put(key, old + ", " + value);
- }
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/Request.java b/libjava/gnu/java/net/protocol/http/Request.java
deleted file mode 100644
index 15a459e3eac..00000000000
--- a/libjava/gnu/java/net/protocol/http/Request.java
+++ /dev/null
@@ -1,914 +0,0 @@
-/* Request.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-import gnu.java.net.BASE64;
-import gnu.java.net.LineInputStream;
-import gnu.java.net.protocol.http.event.RequestEvent;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.ProtocolException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.InflaterInputStream;
-
-/**
- * A single HTTP request.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class Request
-{
-
- /**
- * The connection context in which this request is invoked.
- */
- protected final HTTPConnection connection;
-
- /**
- * The HTTP method to invoke.
- */
- protected final String method;
-
- /**
- * The path identifying the resource.
- * This string must conform to the abs_path definition given in RFC2396,
- * with an optional "?query" part, and must be URI-escaped by the caller.
- */
- protected final String path;
-
- /**
- * The headers in this request.
- */
- protected final Headers requestHeaders;
-
- /**
- * The request body provider.
- */
- protected RequestBodyWriter requestBodyWriter;
-
- /**
- * Request body negotiation threshold for 100-continue expectations.
- */
- protected int requestBodyNegotiationThreshold;
-
- /**
- * The response body reader.
- */
- protected ResponseBodyReader responseBodyReader;
-
- /**
- * Map of response header handlers.
- */
- protected Map responseHeaderHandlers;
-
- /**
- * The authenticator.
- */
- protected Authenticator authenticator;
-
- /**
- * Whether this request has been dispatched yet.
- */
- private boolean dispatched;
-
- /**
- * Constructor for a new request.
- * @param connection the connection context
- * @param method the HTTP method
- * @param path the resource path including query part
- */
- protected Request(HTTPConnection connection, String method,
- String path)
- {
- this.connection = connection;
- this.method = method;
- this.path = path;
- requestHeaders = new Headers();
- responseHeaderHandlers = new HashMap();
- requestBodyNegotiationThreshold = 4096;
- }
-
- /**
- * Returns the connection associated with this request.
- * @see #connection
- */
- public HTTPConnection getConnection()
- {
- return connection;
- }
-
- /**
- * Returns the HTTP method to invoke.
- * @see #method
- */
- public String getMethod()
- {
- return method;
- }
-
- /**
- * Returns the resource path.
- * @see #path
- */
- public String getPath()
- {
- return path;
- }
-
- /**
- * Returns the full request-URI represented by this request, as specified
- * by HTTP/1.1.
- */
- public String getRequestURI()
- {
- return connection.getURI() + path;
- }
-
- /**
- * Returns the headers in this request.
- */
- public Headers getHeaders()
- {
- return requestHeaders;
- }
-
- /**
- * Returns the value of the specified header in this request.
- * @param name the header name
- */
- public String getHeader(String name)
- {
- return requestHeaders.getValue(name);
- }
-
- /**
- * Returns the value of the specified header in this request as an integer.
- * @param name the header name
- */
- public int getIntHeader(String name)
- {
- return requestHeaders.getIntValue(name);
- }
-
- /**
- * Returns the value of the specified header in this request as a date.
- * @param name the header name
- */
- public Date getDateHeader(String name)
- {
- return requestHeaders.getDateValue(name);
- }
-
- /**
- * Sets the specified header in this request.
- * @param name the header name
- * @param value the header value
- */
- public void setHeader(String name, String value)
- {
- requestHeaders.put(name, value);
- }
-
- /**
- * Convenience method to set the entire request body.
- * @param requestBody the request body content
- */
- public void setRequestBody(byte[] requestBody)
- {
- setRequestBodyWriter(new ByteArrayRequestBodyWriter(requestBody));
- }
-
- /**
- * Sets the request body provider.
- * @param requestBodyWriter the handler used to obtain the request body
- */
- public void setRequestBodyWriter(RequestBodyWriter requestBodyWriter)
- {
- this.requestBodyWriter = requestBodyWriter;
- }
-
- /**
- * Sets the response body reader.
- * @param responseBodyReader the handler to receive notifications of
- * response body content
- */
- public void setResponseBodyReader(ResponseBodyReader responseBodyReader)
- {
- this.responseBodyReader = responseBodyReader;
- }
-
- /**
- * Sets a callback handler to be invoked for the specified header name.
- * @param name the header name
- * @param handler the handler to receive the value for the header
- */
- public void setResponseHeaderHandler(String name,
- ResponseHeaderHandler handler)
- {
- responseHeaderHandlers.put(name, handler);
- }
-
- /**
- * Sets an authenticator that can be used to handle authentication
- * automatically.
- * @param authenticator the authenticator
- */
- public void setAuthenticator(Authenticator authenticator)
- {
- this.authenticator = authenticator;
- }
-
- /**
- * Sets the request body negotiation threshold.
- * If this is set, it determines the maximum size that the request body
- * may be before body negotiation occurs(via the
- * <code>100-continue</code> expectation). This ensures that a large
- * request body is not sent when the server wouldn't have accepted it
- * anyway.
- * @param threshold the body negotiation threshold, or &lt;=0 to disable
- * request body negotation entirely
- */
- public void setRequestBodyNegotiationThreshold(int threshold)
- {
- requestBodyNegotiationThreshold = threshold;
- }
-
- /**
- * Dispatches this request.
- * A request can only be dispatched once; calling this method a second
- * time results in a protocol exception.
- * @exception IOException if an I/O error occurred
- * @return an HTTP response object representing the result of the operation
- */
- public Response dispatch()
- throws IOException
- {
- if (dispatched)
- {
- throw new ProtocolException("request already dispatched");
- }
- final String CRLF = "\r\n";
- final String HEADER_SEP = ": ";
- final String US_ASCII = "US-ASCII";
- final String version = connection.getVersion();
- Response response;
- int contentLength = -1;
- boolean retry = false;
- int attempts = 0;
- boolean expectingContinue = false;
- if (requestBodyWriter != null)
- {
- contentLength = requestBodyWriter.getContentLength();
- if (contentLength > requestBodyNegotiationThreshold)
- {
- expectingContinue = true;
- setHeader("Expect", "100-continue");
- }
- else
- {
- setHeader("Content-Length", Integer.toString(contentLength));
- }
- }
-
- try
- {
- // Loop while authentication fails or continue
- do
- {
- retry = false;
- // Send request
- connection.fireRequestEvent(RequestEvent.REQUEST_SENDING, this);
-
- // Get socket output and input streams
- OutputStream out = connection.getOutputStream();
- LineInputStream in =
- new LineInputStream(connection.getInputStream());
- // Request line
- String requestUri = path;
- if (connection.isUsingProxy() &&
- !"*".equals(requestUri) &&
- !"CONNECT".equals(method))
- {
- requestUri = getRequestURI();
- }
- String line = method + ' ' + requestUri + ' ' + version + CRLF;
- out.write(line.getBytes(US_ASCII));
- // Request headers
- for (Iterator i = requestHeaders.keySet().iterator();
- i.hasNext(); )
- {
- String name =(String) i.next();
- String value =(String) requestHeaders.get(name);
- line = name + HEADER_SEP + value + CRLF;
- out.write(line.getBytes(US_ASCII));
- }
- out.write(CRLF.getBytes(US_ASCII));
- // Request body
- if (requestBodyWriter != null && !expectingContinue)
- {
- byte[] buffer = new byte[4096];
- int len;
- int count = 0;
-
- requestBodyWriter.reset();
- do
- {
- len = requestBodyWriter.write(buffer);
- if (len > 0)
- {
- out.write(buffer, 0, len);
- }
- count += len;
- }
- while (len > -1 && count < contentLength);
- out.write(CRLF.getBytes(US_ASCII));
- }
- out.flush();
- // Sent event
- connection.fireRequestEvent(RequestEvent.REQUEST_SENT, this);
- // Get response
- response = readResponse(in);
- int sc = response.getCode();
- if (sc == 401 && authenticator != null)
- {
- if (authenticate(response, attempts++))
- {
- retry = true;
- }
- }
- else if (sc == 100 && expectingContinue)
- {
- requestHeaders.remove("Expect");
- setHeader("Content-Length", Integer.toString(contentLength));
- expectingContinue = false;
- retry = true;
- }
- }
- while (retry);
- }
- catch (IOException e)
- {
- connection.close();
- throw e;
- }
- return response;
- }
-
- Response readResponse(LineInputStream in)
- throws IOException
- {
- String line;
- int len;
-
- // Read response status line
- line = in.readLine();
- if (line == null)
- {
- throw new ProtocolException("Peer closed connection");
- }
- if (!line.startsWith("HTTP/"))
- {
- throw new ProtocolException(line);
- }
- len = line.length();
- int start = 5, end = 6;
- while (line.charAt(end) != '.')
- {
- end++;
- }
- int majorVersion = Integer.parseInt(line.substring(start, end));
- start = end + 1;
- end = start + 1;
- while (line.charAt(end) != ' ')
- {
- end++;
- }
- int minorVersion = Integer.parseInt(line.substring(start, end));
- start = end + 1;
- end = start + 3;
- int code = Integer.parseInt(line.substring(start, end));
- String message = line.substring(end + 1, len - 1);
- // Read response headers
- Headers responseHeaders = new Headers();
- responseHeaders.parse(in);
- notifyHeaderHandlers(responseHeaders);
- // Construct response
- int codeClass = code / 100;
- Response ret = new Response(majorVersion, minorVersion, code,
- codeClass, message, responseHeaders);
- switch (code)
- {
- case 204:
- case 205:
- break;
- default:
- // Does response body reader want body?
- boolean notify = (responseBodyReader != null);
- if (notify)
- {
- if (!responseBodyReader.accept(this, ret))
- {
- notify = false;
- }
- }
- readResponseBody(ret, in, notify);
- }
- return ret;
- }
-
- void notifyHeaderHandlers(Headers headers)
- {
- for (Iterator i = headers.entrySet().iterator(); i.hasNext(); )
- {
- Map.Entry entry = (Map.Entry) i.next();
- String name =(String) entry.getKey();
- // Handle Set-Cookie
- if ("Set-Cookie".equalsIgnoreCase(name))
- {
- String value = (String) entry.getValue();
- handleSetCookie(value);
- }
- ResponseHeaderHandler handler =
- (ResponseHeaderHandler) responseHeaderHandlers.get(name);
- if (handler != null)
- {
- String value = (String) entry.getValue();
- handler.setValue(value);
- }
- }
- }
-
- void readResponseBody(Response response, InputStream in,
- boolean notify)
- throws IOException
- {
- byte[] buffer = new byte[4096];
- int contentLength = -1;
- Headers trailer = null;
-
- String transferCoding = response.getHeader("Transfer-Encoding");
- if ("chunked".equalsIgnoreCase(transferCoding))
- {
- trailer = new Headers();
- in = new ChunkedInputStream(in, trailer);
- }
- else
- {
- contentLength = response.getIntHeader("Content-Length");
- }
- String contentCoding = response.getHeader("Content-Encoding");
- if (contentCoding != null && !"identity".equals(contentCoding))
- {
- if ("gzip".equals(contentCoding))
- {
- in = new GZIPInputStream(in);
- }
- else if ("deflate".equals(contentCoding))
- {
- in = new InflaterInputStream(in);
- }
- else
- {
- throw new ProtocolException("Unsupported Content-Encoding: " +
- contentCoding);
- }
- }
-
- // Persistent connections are the default in HTTP/1.1
- boolean doClose = "close".equalsIgnoreCase(getHeader("Connection")) ||
- "close".equalsIgnoreCase(response.getHeader("Connection")) ||
- (connection.majorVersion == 1 && connection.minorVersion == 0) ||
- (response.majorVersion == 1 && response.minorVersion == 0);
-
- int count = contentLength;
- int len = (count > -1) ? count : buffer.length;
- len = (len > buffer.length) ? buffer.length : len;
- while (len > -1)
- {
- len = in.read(buffer, 0, len);
- if (len < 0)
- {
- // EOF
- connection.closeConnection();
- break;
- }
- if (notify)
- {
- responseBodyReader.read(buffer, 0, len);
- }
- if (count > -1)
- {
- count -= len;
- if (count < 1)
- {
- if (doClose)
- {
- connection.closeConnection();
- }
- break;
- }
- }
- }
- if (notify)
- {
- responseBodyReader.close();
- }
- if (trailer != null)
- {
- response.getHeaders().putAll(trailer);
- notifyHeaderHandlers(trailer);
- }
- }
-
- boolean authenticate(Response response, int attempts)
- throws IOException
- {
- String challenge = response.getHeader("WWW-Authenticate");
- if (challenge == null)
- {
- challenge = response.getHeader("Proxy-Authenticate");
- }
- int si = challenge.indexOf(' ');
- String scheme = (si == -1) ? challenge : challenge.substring(0, si);
- if ("Basic".equalsIgnoreCase(scheme))
- {
- Properties params = parseAuthParams(challenge.substring(si + 1));
- String realm = params.getProperty("realm");
- Credentials creds = authenticator.getCredentials(realm, attempts);
- String userPass = creds.getUsername() + ':' + creds.getPassword();
- byte[] b_userPass = userPass.getBytes("US-ASCII");
- byte[] b_encoded = BASE64.encode(b_userPass);
- String authorization =
- scheme + " " + new String(b_encoded, "US-ASCII");
- setHeader("Authorization", authorization);
- return true;
- }
- else if ("Digest".equalsIgnoreCase(scheme))
- {
- Properties params = parseAuthParams(challenge.substring(si + 1));
- String realm = params.getProperty("realm");
- String nonce = params.getProperty("nonce");
- String qop = params.getProperty("qop");
- String algorithm = params.getProperty("algorithm");
- String digestUri = getRequestURI();
- Credentials creds = authenticator.getCredentials(realm, attempts);
- String username = creds.getUsername();
- String password = creds.getPassword();
- connection.incrementNonce(nonce);
- try
- {
- MessageDigest md5 = MessageDigest.getInstance("MD5");
- final byte[] COLON = { 0x3a };
-
- // Calculate H(A1)
- md5.reset();
- md5.update(username.getBytes("US-ASCII"));
- md5.update(COLON);
- md5.update(realm.getBytes("US-ASCII"));
- md5.update(COLON);
- md5.update(password.getBytes("US-ASCII"));
- byte[] ha1 = md5.digest();
- if ("md5-sess".equals(algorithm))
- {
- byte[] cnonce = generateNonce();
- md5.reset();
- md5.update(ha1);
- md5.update(COLON);
- md5.update(nonce.getBytes("US-ASCII"));
- md5.update(COLON);
- md5.update(cnonce);
- ha1 = md5.digest();
- }
- String ha1Hex = toHexString(ha1);
-
- // Calculate H(A2)
- md5.reset();
- md5.update(method.getBytes("US-ASCII"));
- md5.update(COLON);
- md5.update(digestUri.getBytes("US-ASCII"));
- if ("auth-int".equals(qop))
- {
- byte[] hEntity = null; // TODO hash of entity body
- md5.update(COLON);
- md5.update(hEntity);
- }
- byte[] ha2 = md5.digest();
- String ha2Hex = toHexString(ha2);
-
- // Calculate response
- md5.reset();
- md5.update(ha1Hex.getBytes("US-ASCII"));
- md5.update(COLON);
- md5.update(nonce.getBytes("US-ASCII"));
- if ("auth".equals(qop) || "auth-int".equals(qop))
- {
- String nc = getNonceCount(nonce);
- byte[] cnonce = generateNonce();
- md5.update(COLON);
- md5.update(nc.getBytes("US-ASCII"));
- md5.update(COLON);
- md5.update(cnonce);
- md5.update(COLON);
- md5.update(qop.getBytes("US-ASCII"));
- }
- md5.update(COLON);
- md5.update(ha2Hex.getBytes("US-ASCII"));
- String digestResponse = toHexString(md5.digest());
-
- String authorization = scheme +
- " username=\"" + username + "\"" +
- " realm=\"" + realm + "\"" +
- " nonce=\"" + nonce + "\"" +
- " uri=\"" + digestUri + "\"" +
- " response=\"" + digestResponse + "\"";
- setHeader("Authorization", authorization);
- return true;
- }
- catch (NoSuchAlgorithmException e)
- {
- return false;
- }
- }
- // Scheme not recognised
- return false;
- }
-
- Properties parseAuthParams(String text)
- {
- int len = text.length();
- String key = null;
- StringBuffer buf = new StringBuffer();
- Properties ret = new Properties();
- boolean inQuote = false;
- for (int i = 0; i < len; i++)
- {
- char c = text.charAt(i);
- if (c == '"')
- {
- inQuote = !inQuote;
- }
- else if (c == '=' && key == null)
- {
- key = buf.toString().trim();
- buf.setLength(0);
- }
- else if (c == ' ' && !inQuote)
- {
- String value = unquote(buf.toString().trim());
- ret.put(key, value);
- key = null;
- buf.setLength(0);
- }
- else if (c != ',' || (i <(len - 1) && text.charAt(i + 1) != ' '))
- {
- buf.append(c);
- }
- }
- if (key != null)
- {
- String value = unquote(buf.toString().trim());
- ret.put(key, value);
- }
- return ret;
- }
-
- String unquote(String text)
- {
- int len = text.length();
- if (len > 0 && text.charAt(0) == '"' && text.charAt(len - 1) == '"')
- {
- return text.substring(1, len - 1);
- }
- return text;
- }
-
- /**
- * Returns the number of times the specified nonce value has been seen.
- * This always returns an 8-byte 0-padded hexadecimal string.
- */
- String getNonceCount(String nonce)
- {
- int nc = connection.getNonceCount(nonce);
- String hex = Integer.toHexString(nc);
- StringBuffer buf = new StringBuffer();
- for (int i = 8 - hex.length(); i > 0; i--)
- {
- buf.append('0');
- }
- buf.append(hex);
- return buf.toString();
- }
-
- /**
- * Client nonce value.
- */
- byte[] nonce;
-
- /**
- * Generates a new client nonce value.
- */
- byte[] generateNonce()
- throws IOException, NoSuchAlgorithmException
- {
- if (nonce == null)
- {
- long time = System.currentTimeMillis();
- MessageDigest md5 = MessageDigest.getInstance("MD5");
- md5.update(Long.toString(time).getBytes("US-ASCII"));
- nonce = md5.digest();
- }
- return nonce;
- }
-
- String toHexString(byte[] bytes)
- {
- char[] ret = new char[bytes.length * 2];
- for (int i = 0, j = 0; i < bytes.length; i++)
- {
- int c =(int) bytes[i];
- if (c < 0)
- {
- c += 0x100;
- }
- ret[j++] = Character.forDigit(c / 0x10, 0x10);
- ret[j++] = Character.forDigit(c % 0x10, 0x10);
- }
- return new String(ret);
- }
-
- /**
- * Parse the specified cookie list and notify the cookie manager.
- */
- void handleSetCookie(String text)
- {
- CookieManager cookieManager = connection.getCookieManager();
- if (cookieManager == null)
- {
- return;
- }
- String name = null;
- String value = null;
- String comment = null;
- String domain = connection.getHostName();
- String path = this.path;
- int lsi = path.lastIndexOf('/');
- if (lsi != -1)
- {
- path = path.substring(0, lsi);
- }
- boolean secure = false;
- Date expires = null;
-
- int len = text.length();
- String attr = null;
- StringBuffer buf = new StringBuffer();
- boolean inQuote = false;
- for (int i = 0; i <= len; i++)
- {
- char c =(i == len) ? '\u0000' : text.charAt(i);
- if (c == '"')
- {
- inQuote = !inQuote;
- }
- else if (!inQuote)
- {
- if (c == '=' && attr == null)
- {
- attr = buf.toString().trim();
- buf.setLength(0);
- }
- else if (c == ';' || i == len || c == ',')
- {
- String val = unquote(buf.toString().trim());
- if (name == null)
- {
- name = attr;
- value = val;
- }
- else if ("Comment".equalsIgnoreCase(attr))
- {
- comment = val;
- }
- else if ("Domain".equalsIgnoreCase(attr))
- {
- domain = val;
- }
- else if ("Path".equalsIgnoreCase(attr))
- {
- path = val;
- }
- else if ("Secure".equalsIgnoreCase(val))
- {
- secure = true;
- }
- else if ("Max-Age".equalsIgnoreCase(attr))
- {
- int delta = Integer.parseInt(val);
- Calendar cal = Calendar.getInstance();
- cal.setTimeInMillis(System.currentTimeMillis());
- cal.add(Calendar.SECOND, delta);
- expires = cal.getTime();
- }
- else if ("Expires".equalsIgnoreCase(attr))
- {
- DateFormat dateFormat = new HTTPDateFormat();
- try
- {
- expires = dateFormat.parse(val);
- }
- catch (ParseException e)
- {
- // if this isn't a valid date, it may be that
- // the value was returned unquoted; in that case, we
- // want to continue buffering the value
- buf.append(c);
- continue;
- }
- }
- attr = null;
- buf.setLength(0);
- // case EOL
- if (i == len || c == ',')
- {
- Cookie cookie = new Cookie(name, value, comment, domain,
- path, secure, expires);
- cookieManager.setCookie(cookie);
- }
- if (c == ',')
- {
- // Reset cookie fields
- name = null;
- value = null;
- comment = null;
- domain = connection.getHostName();
- path = this.path;
- if (lsi != -1)
- {
- path = path.substring(0, lsi);
- }
- secure = false;
- expires = null;
- }
- }
- else
- {
- buf.append(c);
- }
- }
- else
- {
- buf.append(c);
- }
- }
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/RequestBodyWriter.java b/libjava/gnu/java/net/protocol/http/RequestBodyWriter.java
deleted file mode 100644
index 05d98ebb81a..00000000000
--- a/libjava/gnu/java/net/protocol/http/RequestBodyWriter.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* RequestBodyWriter.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-/**
- * Callback interface for writing request body content.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public interface RequestBodyWriter
-{
-
- /**
- * Returns the total number of bytes that will be written in a single pass
- * by this writer.
- */
- int getContentLength();
-
- /**
- * Initialises the writer.
- * This will be called before each pass.
- */
- void reset();
-
- /**
- * Writes body content to the supplied buffer.
- * @param buffer the content buffer
- * @return the number of bytes written
- */
- int write(byte[] buffer);
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/Response.java b/libjava/gnu/java/net/protocol/http/Response.java
deleted file mode 100644
index 29dc28b17d3..00000000000
--- a/libjava/gnu/java/net/protocol/http/Response.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/* Response.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-import java.util.Date;
-
-/**
- * An HTTP response.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class Response
-{
-
- /**
- * The HTTP major version of the server issuing the response.
- */
- protected final int majorVersion;
-
- /**
- * The HTTP minor version of the server issuing the response.
- */
- protected final int minorVersion;
-
- /**
- * The HTTP status code of the response.
- */
- protected final int code;
-
- /**
- * The class of the response. This is the most significant digit of the
- * status code.
- * <dl>
- * <dt><code>1xx</code></dt> <dd>Informational response</dd>
- * <dt><code>2xx</code></dt> <dd>Success</dd>
- * <dt><code>3xx</code></dt> <dd>Redirection</dd>
- * <dt><code>4xx</code></dt> <dd>Client error</dd>
- * <dt><code>5xx</code></dt> <dd>Server error</dd>
- * </dl>
- */
- protected final int codeClass;
-
- /**
- * Human-readable text of the response.
- */
- protected final String message;
-
- /**
- * The response headers.
- */
- protected final Headers headers;
-
- /**
- * Constructs a new response with the specified parameters.
- */
- protected Response(int majorVersion, int minorVersion, int code,
- int codeClass, String message,
- Headers headers)
- {
- this.majorVersion = majorVersion;
- this.minorVersion = minorVersion;
- this.code = code;
- this.codeClass = codeClass;
- this.message = message;
- this.headers = headers;
- }
-
- /**
- * Returns the HTTP major version of the server issuing the response.
- * @see #majorVersion
- */
- public int getMajorVersion()
- {
- return majorVersion;
- }
-
- /**
- * Returns the HTTP minor version of the server issuing the response.
- * @see #minorVersion
- */
- public int getMinorVersion()
- {
- return minorVersion;
- }
-
- /**
- * Returns the HTTP status code of the response.
- * @see #code
- */
- public int getCode()
- {
- return code;
- }
-
- /**
- * Returns the class of the response.
- * @see #codeClass
- */
- public int getCodeClass()
- {
- return codeClass;
- }
-
- /**
- * Returns the human-readable text of the response.
- * @see #message
- */
- public String getMessage()
- {
- return message;
- }
-
- /**
- * Returns the headers in the response.
- */
- public Headers getHeaders()
- {
- return headers;
- }
-
- /**
- * Returns the header value for the specified name.
- * @param name the header name
- */
- public String getHeader(String name)
- {
- return headers.getValue(name);
- }
-
- /**
- * Returns the header value for the specified name as an integer.
- * @param name the header name
- */
- public int getIntHeader(String name)
- {
- return headers.getIntValue(name);
- }
-
- /**
- * Returns the header value for the specified name as a date.
- * @param name the header name
- */
- public Date getDateHeader(String name)
- {
- return headers.getDateValue(name);
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/ResponseBodyReader.java b/libjava/gnu/java/net/protocol/http/ResponseBodyReader.java
deleted file mode 100644
index 49e1b376f0f..00000000000
--- a/libjava/gnu/java/net/protocol/http/ResponseBodyReader.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ResponseBodyReader.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-/**
- * Callback interface for receiving notification of response body content.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public interface ResponseBodyReader
-{
-
- /**
- * Indicate whether this reader is interested in the specified response.
- * If it returns false, it will not receive body content notifications for
- * that response.
- */
- boolean accept(Request request, Response response);
-
- /**
- * Receive notification of body content.
- * @param buffer the content buffer
- * @param offset the offset within the buffer that content starts
- * @param length the length of the content
- */
- void read(byte[] buffer, int offset, int length);
-
- /**
- * Notifies the reader that the end of the content was reached.
- */
- void close();
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/ResponseHeaderHandler.java b/libjava/gnu/java/net/protocol/http/ResponseHeaderHandler.java
deleted file mode 100644
index 8e4e6492acf..00000000000
--- a/libjava/gnu/java/net/protocol/http/ResponseHeaderHandler.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ResponseHeaderHandler.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-/**
- * Callback interface for objects that wish to be notified of response
- * header values.
- * @see Request#setHeaderHandler(String)
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public interface ResponseHeaderHandler
-{
-
- /**
- * Sets the value for the header associated with this handler.
- */
- void setValue(String value);
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/SimpleCookieManager.java b/libjava/gnu/java/net/protocol/http/SimpleCookieManager.java
deleted file mode 100644
index 8947471885c..00000000000
--- a/libjava/gnu/java/net/protocol/http/SimpleCookieManager.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* CookieManager.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A simple non-persistent cookie manager. This class can be extended to
- * provide cookie persistence.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class SimpleCookieManager
- implements CookieManager
-{
-
- /**
- * The cookie cache.
- * This is a dictionary mapping domains to maps of cookies by name.
- */
- protected Map cookies;
-
- /**
- * Constructor.
- */
- public SimpleCookieManager()
- {
- cookies = new HashMap();
- }
-
- public void setCookie(Cookie cookie)
- {
- String domain = cookie.getDomain();
- Map map =(Map) cookies.get(domain);
- if (map == null)
- {
- map = new HashMap();
- cookies.put(domain, map);
- }
- String name = cookie.getName();
- map.put(name, cookie); // will replace a cookie of the same name
- }
-
- public Cookie[] getCookies(String host, boolean secure, String path)
- {
- List matches = new ArrayList();
- Date now = new Date();
- if (Character.isLetter(host.charAt(0)))
- {
- int di = host.indexOf('.');
- while (di != -1)
- {
- addCookies(matches, host, secure, path, now);
- host = host.substring(di);
- di = host.indexOf('.', 1);
- }
- }
- addCookies(matches, host, secure, path, now);
- Cookie[] ret = new Cookie[matches.size()];
- matches.toArray(ret);
- return ret;
- }
-
- private void addCookies(List matches, String domain, boolean secure,
- String path, Date now)
- {
- Map map = (Map) cookies.get(domain);
- if (map != null)
- {
- List expired = new ArrayList();
- for (Iterator i = map.entrySet().iterator(); i.hasNext(); )
- {
- Map.Entry entry = (Map.Entry) i.next();
- Cookie cookie = (Cookie) entry.getValue();
- Date expires = cookie.getExpiryDate();
- if (expires != null && expires.before(now))
- {
- expired.add(entry.getKey());
- continue;
- }
- if (secure && !cookie.isSecure())
- {
- continue;
- }
- if (path.startsWith(cookie.getPath()))
- {
- matches.add(cookie);
- }
- }
- // Good housekeeping
- for (Iterator i = expired.iterator(); i.hasNext(); )
- {
- map.remove(i.next());
- }
- }
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/event/ConnectionEvent.java b/libjava/gnu/java/net/protocol/http/event/ConnectionEvent.java
deleted file mode 100644
index 3f6f5454e73..00000000000
--- a/libjava/gnu/java/net/protocol/http/event/ConnectionEvent.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* ConnectionEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http.event;
-
-import java.util.EventObject;
-
-/**
- * A connection event.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class ConnectionEvent
- extends EventObject
-{
-
- /**
- * The connection closed event type.
- */
- public static final int CONNECTION_CLOSED = 0;
-
- /**
- * The type of this event.
- */
- protected int type;
-
- /**
- * Constructs a connection event with the specified source and type.
- */
- public ConnectionEvent(Object source, int type)
- {
- super(source);
- this.type = type;
- }
-
- /**
- * Returns the type of this event.
- * @see #type
- */
- public int getType()
- {
- return type;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/event/ConnectionListener.java b/libjava/gnu/java/net/protocol/http/event/ConnectionListener.java
deleted file mode 100644
index 073e89d4407..00000000000
--- a/libjava/gnu/java/net/protocol/http/event/ConnectionListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* ConnectionListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http.event;
-
-import java.util.EventListener;
-
-/**
- * A connection listener.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public interface ConnectionListener
- extends EventListener
-{
-
- /**
- * Callback invoked when the associated connection is closed.
- */
- void connectionClosed(ConnectionEvent event);
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/event/RequestEvent.java b/libjava/gnu/java/net/protocol/http/event/RequestEvent.java
deleted file mode 100644
index 281c621f33f..00000000000
--- a/libjava/gnu/java/net/protocol/http/event/RequestEvent.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* RequestEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http.event;
-
-import gnu.java.net.protocol.http.Request;
-
-import java.util.EventObject;
-
-/**
- * A request event.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class RequestEvent
- extends EventObject
-{
-
- /**
- * The request created event type.
- */
- public static final int REQUEST_CREATED = 0;
-
- /**
- * The request sending event type.
- */
- public static final int REQUEST_SENDING = 1;
-
- /**
- * The request sent event type.
- */
- public static final int REQUEST_SENT = 2;
-
- /**
- * The type of this event.
- */
- protected int type;
-
- /**
- * The request associated with this event.
- */
- protected Request request;
-
- /**
- * Constructs a request event with the specified source, type, and request.
- */
- public RequestEvent(Object source, int type, Request request)
- {
- super(source);
- this.type = type;
- this.request = request;
- }
-
- /**
- * Returns the type of this event.
- * @see #type
- */
- public int getType()
- {
- return type;
- }
-
- /**
- * Returns the request associated with this event.
- */
- public Request getRequest()
- {
- return request;
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/http/event/RequestListener.java b/libjava/gnu/java/net/protocol/http/event/RequestListener.java
deleted file mode 100644
index c880fbce6f0..00000000000
--- a/libjava/gnu/java/net/protocol/http/event/RequestListener.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* RequestListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.http.event;
-
-import java.util.EventListener;
-
-/**
- * A request listener.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public interface RequestListener
- extends EventListener
-{
-
- /**
- * Callback invoked when a request is created from the associated
- * connection.
- */
- void requestCreated(RequestEvent event);
-
- /**
- * Callback invoked when the request has been initialised with all data
- * and before sending this data to the server.
- */
- void requestSending(RequestEvent event);
-
- /**
- * Callback invoked after all request data has been sent to the server.
- */
- void requestSent(RequestEvent event);
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/https/Handler.java b/libjava/gnu/java/net/protocol/https/Handler.java
deleted file mode 100644
index 2b137517021..00000000000
--- a/libjava/gnu/java/net/protocol/https/Handler.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Handler.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.https;
-
-import gnu.java.net.protocol.http.HTTPConnection;
-import gnu.java.net.protocol.http.HTTPURLConnection;
-
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-
-/**
- * An HTTPS URL stream handler.
- *
- * @author Chris Burdess (dog@gnu.org)
- */
-public class Handler
- extends URLStreamHandler
-{
-
- /**
- * Returns the default HTTPS port (443).
- */
- protected int getDefaultPort()
- {
- return HTTPConnection.HTTPS_PORT;
- }
-
- /**
- * Returns an HTTPURLConnection for the given URL.
- */
- public URLConnection openConnection(URL url)
- throws IOException
- {
- return new HTTPURLConnection(url);
- }
-
-}
-
diff --git a/libjava/gnu/java/net/protocol/jar/Handler.java b/libjava/gnu/java/net/protocol/jar/Handler.java
deleted file mode 100644
index d45411c47e5..00000000000
--- a/libjava/gnu/java/net/protocol/jar/Handler.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/* gnu.java.net.protocol.jar.Handler - jar protocol handler for java.net
- Copyright (C) 1999, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.protocol.jar;
-
-import gnu.java.net.URLParseError;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-
-/**
- * @author Kresten Krab Thorup (krab@gnu.org)
- */
-public class Handler extends URLStreamHandler
-{
- /**
- * A do nothing constructor
- */
- public Handler()
- {
- }
-
- /**
- * This method returs a new JarURLConnection for the specified URL
- *
- * @param url The URL to return a connection for
- *
- * @return The URLConnection
- *
- * @exception IOException If an error occurs
- */
- protected URLConnection openConnection(URL url) throws IOException
- {
- return new Connection(url);
- }
-
- /**
- * This method overrides URLStreamHandler's for parsing url of protocol "jar"
- *
- * @param url The URL object in which to store the results
- * @param url_string The String-ized URL to parse
- * @param start The position in the string to start scanning from
- * @param end The position in the string to stop scanning
- */
- protected void parseURL (URL url, String url_string, int start, int end)
- {
- // This method does not throw an exception or return a value. Thus our
- // strategy when we encounter an error in parsing is to return without
- // doing anything.
- String file = url.getFile();
-
- if (!file.equals(""))
- { //has context url
- url_string = url_string.substring (start, end);
- if (url_string.startsWith("/"))
- { //url string is an absolute path
- int idx = file.lastIndexOf ("!/");
-
- if (idx < 0)
- throw new URLParseError("no !/ in spec");
-
- file = file.substring (0, idx + 1) + url_string;
- }
- else
- {
- int idx = file.lastIndexOf ("/");
- if (idx == -1) //context path is weird
- file = "/" + url_string;
- else if (idx == (file.length() - 1))
- //just concatenate two parts
- file = file + url_string;
- else
- // according to Java API Documentation, here is a little different
- // with URLStreamHandler.parseURL
- // but JDK seems doesn't handle it well
- file = file.substring(0, idx + 1) + url_string;
- }
-
- setURL (url, "jar", url.getHost(), url.getPort(), file, null);
- return;
- }
-
- // Bunches of things should be true. Make sure.
- if (end < start)
- return;
- if (end - start < 2)
- return;
- if (start > url_string.length())
- return;
-
- // Skip remains of protocol
- url_string = url_string.substring (start, end);
-
- int jar_stop;
- if ((jar_stop = url_string.indexOf("!/")) < 0)
- throw new URLParseError("no !/ in spec");
-
- try
- {
- new URL(url_string.substring (0, jar_stop));
- }
- catch (MalformedURLException e)
- {
- throw new URLParseError("invalid inner URL: " + e.getMessage());
- }
-
- if (!url.getProtocol().equals ("jar") )
- throw new URLParseError("unexpected protocol " + url.getProtocol());
-
- setURL (url, "jar", url.getHost(), url.getPort(), url_string, null);
- }
-
- /**
- * This method converts a Jar URL object into a String.
- *
- * @param url The URL object to convert
- */
- protected String toExternalForm (URL url)
- {
- String file = url.getFile();
-
- // return "jar:" + file;
- // Performance!!:
- // Do the concatenation manually to avoid resize StringBuffer's
- // internal buffer.
- StringBuffer sb = new StringBuffer (file.length() + 5);
- sb.append ("jar:");
- sb.append (file);
- return sb.toString();
- }
-}
diff --git a/libjava/gnu/java/nio/ChannelInputStream.java b/libjava/gnu/java/nio/ChannelInputStream.java
deleted file mode 100644
index 675a62f3d88..00000000000
--- a/libjava/gnu/java/nio/ChannelInputStream.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ChannelInputStream.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.nio.channels.IllegalBlockingModeException;
-import java.nio.channels.ReadableByteChannel;
-import java.nio.channels.SelectableChannel;
-
-/**
- * @author Michael Koch
- */
-public final class ChannelInputStream extends InputStream
-{
- private ReadableByteChannel ch;
-
- public ChannelInputStream (ReadableByteChannel ch)
- {
- super();
-
- this.ch = ch;
- }
-
- public int read() throws IOException
- {
- if (ch instanceof SelectableChannel
- && (! ((SelectableChannel) ch).isBlocking()))
- throw new IllegalBlockingModeException();
-
- ByteBuffer buffer = ByteBuffer.allocate(1);
- int result = ch.read(buffer);
-
- if (result == -1)
- return -1;
-
- if (result == 0)
- throw new IOException("Could not read from channel");
-
- return buffer.get(0);
- }
-}
diff --git a/libjava/gnu/java/nio/ChannelOutputStream.java b/libjava/gnu/java/nio/ChannelOutputStream.java
deleted file mode 100644
index 08323eacec4..00000000000
--- a/libjava/gnu/java/nio/ChannelOutputStream.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ChannelOutputStream.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.nio.channels.WritableByteChannel;
-
-/**
- * @author Michael Koch
- */
-public final class ChannelOutputStream extends OutputStream
-{
- private WritableByteChannel ch;
-
- public ChannelOutputStream (WritableByteChannel ch)
- {
- super();
-
- this.ch = ch;
- }
-
- public void write (int value) throws IOException
- {
- ByteBuffer buffer = ByteBuffer.allocate (1);
- buffer.put ((byte) (value & 0xff));
- buffer.flip();
- ch.write (buffer);
- }
-}
diff --git a/libjava/gnu/java/nio/ChannelReader.java b/libjava/gnu/java/nio/ChannelReader.java
deleted file mode 100644
index 44fe6625a3b..00000000000
--- a/libjava/gnu/java/nio/ChannelReader.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/* ChannelReader.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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.nio;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.channels.ReadableByteChannel;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CoderResult;
-import java.nio.charset.CodingErrorAction;
-
-/**
- * A Reader implementation that works using a ReadableByteChannel and a
- * CharsetDecoder.
- *
- * <p>
- * This is a bridge between NIO <-> IO character decoding.
- * </p>
- *
- * @author Robert Schuster
- */
-public class ChannelReader extends Reader
-{
-
- private static final int DEFAULT_BUFFER_CAP = 8192;
-
- private ReadableByteChannel channel;
-
- private CharsetDecoder decoder;
-
- private ByteBuffer byteBuffer;
-
- private CharBuffer charBuffer;
-
- public ChannelReader(ReadableByteChannel channel, CharsetDecoder decoder,
- int minBufferCap)
- {
- this.channel = channel;
- this.decoder = decoder;
-
- // JDK reports errors, so we do the same.
- decoder.onMalformedInput(CodingErrorAction.REPORT);
- decoder.onUnmappableCharacter(CodingErrorAction.REPORT);
- decoder.reset();
-
- int size = (minBufferCap == -1) ? DEFAULT_BUFFER_CAP : minBufferCap;
-
- // Allocates the buffers and prepares them for reading, because that is the
- // first operation being done on them.
- byteBuffer = ByteBuffer.allocate(size);
- byteBuffer.flip();
- charBuffer = CharBuffer.allocate((int) (size * decoder.averageCharsPerByte()));
- }
-
- public int read(char[] buf, int offset, int count) throws IOException
- {
- // I declared channel being null meaning that the reader is closed.
- if (!channel.isOpen())
- throw new IOException("Reader was already closed.");
-
- // I declared decoder being null meaning that there is no more data to read
- // and convert.
- if (decoder == null)
- return -1;
-
- // Stores the amount of character being read. It -1 so that if no conversion
- // occured the caller will see this as an 'end of file'.
- int sum = -1;
-
- // Copies any characters which may be left from the last invocation into the
- // destination array.
- if (charBuffer.remaining() > 0)
- {
- sum = Math.min(count, charBuffer.remaining());
- charBuffer.get(buf, offset, sum);
-
- // Updates the control variables according to the latest copy operation.
- offset += sum;
- count -= sum;
- }
-
- // Copies the character which have not been put in the destination array to
- // the beginning. If data is actually copied count will be 0. If no data is
- // copied count is >0 and we can now convert some more characters.
- charBuffer.compact();
-
- int converted = 0;
- boolean last = false;
-
- while (count != 0)
- {
- // Tries to convert some bytes (Which will intentionally fail in the
- // first place because we have not read any bytes yet.)
- CoderResult result = decoder.decode(byteBuffer, charBuffer, last);
- if (result.isMalformed() || result.isUnmappable())
- {
- // JDK throws exception when bytes are malformed for sure.
- // FIXME: Unsure what happens when a character is simply
- // unmappable.
- result.throwException();
- }
-
- // Marks that we should end this loop regardless whether the caller
- // wants more chars or not, when this was the last conversion.
- if (last)
- {
- decoder = null;
- }
- else if (result.isUnderflow())
- {
- // We need more bytes to do the conversion.
-
- // Copies the not yet converted bytes to the beginning making it
- // being able to receive more bytes.
- byteBuffer.compact();
-
- // Reads in another bunch of bytes for being converted.
- if (channel.read(byteBuffer) == -1)
- {
- // If there is no more data available in the channel we mark
- // that state for the final character conversion run which is
- // done in the next loop iteration.
- last = true;
- }
-
- // Prepares the byteBuffer for the next character conversion run.
- byteBuffer.flip();
- }
-
- // Prepares the charBuffer for being drained.
- charBuffer.flip();
-
- converted = Math.min(count, charBuffer.remaining());
- charBuffer.get(buf, offset, converted);
-
- // Copies characters which have not yet being copied into the char-Array
- // to the beginning making it possible to read them later (If data is
- // really copied here, then the caller has received enough characters so
- // far.).
- charBuffer.compact();
-
- // Updates the control variables according to the latest copy operation.
- offset += converted;
- count -= converted;
-
- // Updates the amount of transferred characters.
- sum += converted;
-
- if (decoder == null)
- {
- break;
- }
-
- // Now that more characters have been transfered we let the loop decide
- // what to do next.
- }
-
- // Makes the charBuffer ready for reading on the next invocation.
- charBuffer.flip();
-
- return sum;
- }
-
- public void close() throws IOException
- {
- channel.close();
-
- // Makes sure all intermediate data is released by the decoder.
- if (decoder != null)
- decoder.reset();
- }
-
-}
diff --git a/libjava/gnu/java/nio/FileLockImpl.java b/libjava/gnu/java/nio/FileLockImpl.java
deleted file mode 100644
index 245fa73402a..00000000000
--- a/libjava/gnu/java/nio/FileLockImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* FileLockImpl.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import gnu.java.nio.channels.FileChannelImpl;
-
-import java.io.IOException;
-import java.nio.channels.FileLock;
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class FileLockImpl extends FileLock
-{
- private FileChannelImpl ch;
-
- public FileLockImpl (FileChannelImpl channel, long position,
- long size, boolean shared)
- {
- super (channel, position, size, shared);
- ch = channel;
- }
-
- protected void finalize()
- {
- try
- {
- release();
- }
- catch (IOException e)
- {
- // Ignore this.
- }
- }
-
- public boolean isValid ()
- {
- return channel().isOpen();
- }
-
- public synchronized void release () throws IOException
- {
- ch.unlock(position(), size());
- }
-}
diff --git a/libjava/gnu/java/nio/InputStreamChannel.java b/libjava/gnu/java/nio/InputStreamChannel.java
deleted file mode 100644
index a3dffe24554..00000000000
--- a/libjava/gnu/java/nio/InputStreamChannel.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* InputStreamChannel.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.nio.channels.ClosedChannelException;
-import java.nio.channels.ReadableByteChannel;
-
-/**
- * @author Michael Koch
- */
-public final class InputStreamChannel implements ReadableByteChannel
-{
- private boolean closed = false;
- private InputStream in;
-
- public InputStreamChannel (InputStream in)
- {
- super();
- this.in = in;
- }
-
- public void close() throws IOException
- {
- if (!closed)
- {
- in.close();
- closed = true;
- }
- }
-
- public boolean isOpen()
- {
- return !closed;
- }
-
- public int read (ByteBuffer dst) throws IOException
- {
- if (!isOpen())
- throw new ClosedChannelException();
-
- byte[] buffer = new byte [dst.remaining()];
- int readBytes = in.read (buffer);
-
- if (readBytes > 0)
- dst.put (buffer, 0, readBytes);
-
- return readBytes;
- }
-}
diff --git a/libjava/gnu/java/nio/NIOConstants.java b/libjava/gnu/java/nio/NIOConstants.java
deleted file mode 100644
index bb5b3b7f940..00000000000
--- a/libjava/gnu/java/nio/NIOConstants.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* NIOConstants.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-/**
- * @author Michael Koch
- */
-public final class NIOConstants
-{
- public static final int DEFAULT_TIMEOUT = 50;
-}
diff --git a/libjava/gnu/java/nio/NIODatagramSocket.java b/libjava/gnu/java/nio/NIODatagramSocket.java
deleted file mode 100644
index f23236eca88..00000000000
--- a/libjava/gnu/java/nio/NIODatagramSocket.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* NIODatagramSocket.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import gnu.java.net.PlainDatagramSocketImpl;
-
-import java.net.DatagramSocket;
-import java.nio.channels.DatagramChannel;
-
-/**
- * @author Michael Koch
- */
-public final class NIODatagramSocket extends DatagramSocket
-{
- private PlainDatagramSocketImpl impl;
- private DatagramChannelImpl channel;
-
- public NIODatagramSocket (PlainDatagramSocketImpl impl,
- DatagramChannelImpl channel)
- {
- super (impl);
- this.impl = impl;
- this.channel = channel;
- }
-
- public final PlainDatagramSocketImpl getPlainDatagramSocketImpl()
- {
- return impl;
- }
-
- public final DatagramChannel getChannel()
- {
- return channel;
- }
-}
diff --git a/libjava/gnu/java/nio/NIOSocket.java b/libjava/gnu/java/nio/NIOSocket.java
deleted file mode 100644
index 4d812bf44ba..00000000000
--- a/libjava/gnu/java/nio/NIOSocket.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* NIOSocket.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import gnu.java.net.PlainSocketImpl;
-import java.io.IOException;
-import java.net.Socket;
-import java.nio.channels.SocketChannel;
-
-/**
- * @author Michael Koch
- */
-public final class NIOSocket extends Socket
-{
- private PlainSocketImpl impl;
- private SocketChannelImpl channel;
-
- protected NIOSocket (PlainSocketImpl impl, SocketChannelImpl channel)
- throws IOException
- {
- super (impl);
- this.impl = impl;
- this.channel = channel;
- }
-
- public final PlainSocketImpl getPlainSocketImpl()
- {
- return impl;
- }
-
- final void setChannel (SocketChannelImpl channel)
- {
- this.impl = channel.getPlainSocketImpl();
- this.channel = channel;
- }
-
- public final SocketChannel getChannel()
- {
- return channel;
- }
-}
diff --git a/libjava/gnu/java/nio/OutputStreamChannel.java b/libjava/gnu/java/nio/OutputStreamChannel.java
deleted file mode 100644
index 8167426b07d..00000000000
--- a/libjava/gnu/java/nio/OutputStreamChannel.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* OutputStreamChannel.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.nio.channels.ClosedChannelException;
-import java.nio.channels.WritableByteChannel;
-
-/**
- * @author Michael Koch
- */
-public final class OutputStreamChannel implements WritableByteChannel
-{
- private boolean closed = false;
- private OutputStream out;
-
- public OutputStreamChannel (OutputStream out)
- {
- super();
-
- this.out = out;
- }
-
- public void close() throws IOException
- {
- if (!closed)
- {
- out.close();
- closed = true;
- }
- }
-
- public boolean isOpen()
- {
- return !closed;
- }
-
- public int write (ByteBuffer src) throws IOException
- {
- if (!isOpen())
- throw new ClosedChannelException();
-
- int len = src.remaining();
- byte[] buffer = new byte [len];
- src.get (buffer);
- out.write (buffer);
- return len;
- }
-}
diff --git a/libjava/gnu/java/nio/PipeImpl.java b/libjava/gnu/java/nio/PipeImpl.java
deleted file mode 100644
index f7b01c8b740..00000000000
--- a/libjava/gnu/java/nio/PipeImpl.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/* PipeImpl.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.channels.Pipe;
-import java.nio.channels.spi.SelectorProvider;
-
-class PipeImpl extends Pipe
-{
- public static final class SourceChannelImpl extends Pipe.SourceChannel
- {
- private int native_fd;
-
- public SourceChannelImpl (SelectorProvider selectorProvider,
- int native_fd)
- {
- super (selectorProvider);
- this.native_fd = native_fd;
- }
-
- protected final void implCloseSelectableChannel()
- throws IOException
- {
- throw new Error ("Not implemented");
- }
-
- protected void implConfigureBlocking (boolean blocking)
- throws IOException
- {
- throw new Error ("Not implemented");
- }
-
- public final int read (ByteBuffer src)
- throws IOException
- {
- throw new Error ("Not implemented");
- }
-
- public final long read (ByteBuffer[] srcs)
- throws IOException
- {
- return read (srcs, 0, srcs.length);
- }
-
- public final synchronized long read (ByteBuffer[] srcs, int offset,
- int len)
- throws IOException
- {
- if (offset < 0
- || offset > srcs.length
- || len < 0
- || len > srcs.length - offset)
- throw new IndexOutOfBoundsException();
-
- long bytesRead = 0;
-
- for (int index = 0; index < len; index++)
- bytesRead += read (srcs [offset + index]);
-
- return bytesRead;
-
- }
-
- public final int getNativeFD()
- {
- return native_fd;
- }
- }
-
- public static final class SinkChannelImpl extends Pipe.SinkChannel
- {
- private int native_fd;
-
- public SinkChannelImpl (SelectorProvider selectorProvider,
- int native_fd)
- {
- super (selectorProvider);
- this.native_fd = native_fd;
- }
-
- protected final void implCloseSelectableChannel()
- throws IOException
- {
- throw new Error ("Not implemented");
- }
-
- protected final void implConfigureBlocking (boolean blocking)
- throws IOException
- {
- throw new Error ("Not implemented");
- }
-
- public final int write (ByteBuffer dst)
- throws IOException
- {
- throw new Error ("Not implemented");
- }
-
- public final long write (ByteBuffer[] srcs)
- throws IOException
- {
- return write (srcs, 0, srcs.length);
- }
-
- public final synchronized long write (ByteBuffer[] srcs, int offset, int len)
- throws IOException
- {
- if (offset < 0
- || offset > srcs.length
- || len < 0
- || len > srcs.length - offset)
- throw new IndexOutOfBoundsException();
-
- long bytesWritten = 0;
-
- for (int index = 0; index < len; index++)
- bytesWritten += write (srcs [offset + index]);
-
- return bytesWritten;
- }
-
- public final int getNativeFD()
- {
- return native_fd;
- }
- }
-
- private SinkChannelImpl sink;
- private SourceChannelImpl source;
-
- public PipeImpl (SelectorProvider provider)
- throws IOException
- {
- super();
- VMPipe.init (this, provider);
- }
-
- public Pipe.SinkChannel sink()
- {
- return sink;
- }
-
- public Pipe.SourceChannel source()
- {
- return source;
- }
-}
diff --git a/libjava/gnu/java/nio/SelectionKeyImpl.java b/libjava/gnu/java/nio/SelectionKeyImpl.java
deleted file mode 100644
index a1f125e9f8b..00000000000
--- a/libjava/gnu/java/nio/SelectionKeyImpl.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* SelectionKeyImpl.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import java.nio.channels.CancelledKeyException;
-import java.nio.channels.SelectableChannel;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.spi.AbstractSelectionKey;
-
-public abstract class SelectionKeyImpl extends AbstractSelectionKey
-{
- private int readyOps;
- private int interestOps;
- private SelectorImpl impl;
- SelectableChannel ch;
-
- public SelectionKeyImpl (SelectableChannel ch, SelectorImpl impl)
- {
- this.ch = ch;
- this.impl = impl;
- }
-
- public SelectableChannel channel ()
- {
- return ch;
- }
-
- public int readyOps ()
- {
- if (!isValid())
- throw new CancelledKeyException();
-
- return readyOps;
- }
-
- public SelectionKey readyOps (int ops)
- {
- if (!isValid())
- throw new CancelledKeyException();
-
- readyOps = ops;
- return this;
- }
-
- public int interestOps ()
- {
- if (!isValid())
- throw new CancelledKeyException();
-
- return interestOps;
- }
-
- public SelectionKey interestOps (int ops)
- {
- if (!isValid())
- throw new CancelledKeyException();
-
- interestOps = ops;
- return this;
- }
-
- public Selector selector ()
- {
- return impl;
- }
-
- public abstract int getNativeFD();
-}
diff --git a/libjava/gnu/java/nio/SelectorImpl.java b/libjava/gnu/java/nio/SelectorImpl.java
deleted file mode 100644
index dcafedeb8bb..00000000000
--- a/libjava/gnu/java/nio/SelectorImpl.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/* SelectorImpl.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import java.io.IOException;
-import java.nio.channels.ClosedSelectorException;
-import java.nio.channels.SelectableChannel;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.spi.AbstractSelectableChannel;
-import java.nio.channels.spi.AbstractSelector;
-import java.nio.channels.spi.SelectorProvider;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-public class SelectorImpl extends AbstractSelector
-{
- private Set keys;
- private Set selected;
-
- /**
- * A dummy object whose monitor regulates access to both our
- * selectThread and unhandledWakeup fields.
- */
- private Object selectThreadMutex = new Object ();
-
- /**
- * Any thread that's currently blocked in a select operation.
- */
- private Thread selectThread;
-
- /**
- * Indicates whether we have an unhandled wakeup call. This can
- * be due to either wakeup() triggering a thread interruption while
- * a thread was blocked in a select operation (in which case we need
- * to reset this thread's interrupt status after interrupting the
- * select), or else that no thread was on a select operation at the
- * time that wakeup() was called, in which case the following select()
- * operation should return immediately with nothing selected.
- */
- private boolean unhandledWakeup;
-
- public SelectorImpl (SelectorProvider provider)
- {
- super (provider);
-
- keys = new HashSet ();
- selected = new HashSet ();
- }
-
- protected void finalize() throws Throwable
- {
- close();
- }
-
- protected final void implCloseSelector()
- throws IOException
- {
- // Cancel any pending select operation.
- wakeup();
-
- synchronized (keys)
- {
- synchronized (selected)
- {
- synchronized (cancelledKeys ())
- {
- // FIXME: Release resources here.
- }
- }
- }
- }
-
- public final Set keys()
- {
- if (!isOpen())
- throw new ClosedSelectorException();
-
- return Collections.unmodifiableSet (keys);
- }
-
- public final int selectNow()
- throws IOException
- {
- // FIXME: We're simulating an immediate select
- // via a select with a timeout of one millisecond.
- return select (1);
- }
-
- public final int select()
- throws IOException
- {
- return select (0);
- }
-
- private final int[] getFDsAsArray (int ops)
- {
- int[] result;
- int counter = 0;
- Iterator it = keys.iterator ();
-
- // Count the number of file descriptors needed
- while (it.hasNext ())
- {
- SelectionKeyImpl key = (SelectionKeyImpl) it.next ();
-
- if ((key.interestOps () & ops) != 0)
- {
- counter++;
- }
- }
-
- result = new int[counter];
-
- counter = 0;
- it = keys.iterator ();
-
- // Fill the array with the file descriptors
- while (it.hasNext ())
- {
- SelectionKeyImpl key = (SelectionKeyImpl) it.next ();
-
- if ((key.interestOps () & ops) != 0)
- {
- result[counter] = key.getNativeFD();
- counter++;
- }
- }
-
- return result;
- }
-
- public synchronized int select (long timeout)
- throws IOException
- {
- if (!isOpen())
- throw new ClosedSelectorException();
-
- synchronized (keys)
- {
- synchronized (selected)
- {
- deregisterCancelledKeys();
-
- // Set only keys with the needed interest ops into the arrays.
- int[] read = getFDsAsArray (SelectionKey.OP_READ
- | SelectionKey.OP_ACCEPT);
- int[] write = getFDsAsArray (SelectionKey.OP_WRITE
- | SelectionKey.OP_CONNECT);
-
- // FIXME: We dont need to check this yet
- int[] except = new int [0];
-
- // Test to see if we've got an unhandled wakeup call,
- // in which case we return immediately. Otherwise,
- // remember our current thread and jump into the select.
- // The monitor for dummy object selectThreadMutex regulates
- // access to these fields.
-
- // FIXME: Not sure from the spec at what point we should
- // return "immediately". Is it here or immediately upon
- // entry to this function?
-
- // NOTE: There's a possibility of another thread calling
- // wakeup() immediately after our thread releases
- // selectThreadMutex's monitor here, in which case we'll
- // do the select anyway. Since calls to wakeup() and select()
- // among different threads happen in non-deterministic order,
- // I don't think this is an issue.
- synchronized (selectThreadMutex)
- {
- if (unhandledWakeup)
- {
- unhandledWakeup = false;
- return 0;
- }
- else
- {
- selectThread = Thread.currentThread ();
- }
- }
-
- // Call the native select() on all file descriptors.
- int result = 0;
- try
- {
- begin();
- result = VMSelector.select (read, write, except, timeout);
- }
- finally
- {
- end();
- }
-
- // If our unhandled wakeup flag is set at this point,
- // reset our thread's interrupt flag because we were
- // awakened by wakeup() instead of an external thread
- // interruption.
- //
- // NOTE: If we were blocked in a select() and one thread
- // called Thread.interrupt() on the blocked thread followed
- // by another thread calling Selector.wakeup(), then race
- // conditions could make it so that the thread's interrupt
- // flag is reset even though the Thread.interrupt() call
- // "was there first". I don't think we need to care about
- // this scenario.
- synchronized (selectThreadMutex)
- {
- if (unhandledWakeup)
- {
- unhandledWakeup = false;
- Thread.interrupted ();
- }
- selectThread = null;
- }
-
- Iterator it = keys.iterator ();
-
- while (it.hasNext ())
- {
- int ops = 0;
- SelectionKeyImpl key = (SelectionKeyImpl) it.next ();
-
- // If key is already selected retrieve old ready ops.
- if (selected.contains (key))
- {
- ops = key.readyOps ();
- }
-
- // Set new ready read/accept ops
- for (int i = 0; i < read.length; i++)
- {
- if (key.getNativeFD() == read[i])
- {
- if (key.channel () instanceof ServerSocketChannelImpl)
- {
- ops = ops | SelectionKey.OP_ACCEPT;
- }
- else
- {
- ops = ops | SelectionKey.OP_READ;
- }
- }
- }
-
- // Set new ready write ops
- for (int i = 0; i < write.length; i++)
- {
- if (key.getNativeFD() == write[i])
- {
- ops = ops | SelectionKey.OP_WRITE;
-
- // if (key.channel ().isConnected ())
- // {
- // ops = ops | SelectionKey.OP_WRITE;
- // }
- // else
- // {
- // ops = ops | SelectionKey.OP_CONNECT;
- // }
- }
- }
-
- // FIXME: We dont handle exceptional file descriptors yet.
-
- // If key is not yet selected add it.
- if (!selected.contains (key))
- {
- selected.add (key);
- }
-
- // Set new ready ops
- key.readyOps (key.interestOps () & ops);
- }
- deregisterCancelledKeys();
-
- return result;
- }
- }
- }
-
- public final Set selectedKeys()
- {
- if (!isOpen())
- throw new ClosedSelectorException();
-
- return selected;
- }
-
- public final Selector wakeup()
- {
- // IMPLEMENTATION NOTE: Whereas the specification says that
- // thread interruption should trigger a call to wakeup, we
- // do the reverse under the covers: wakeup triggers a thread
- // interrupt followed by a subsequent reset of the thread's
- // interrupt status within select().
-
- // First, acquire the monitor of the object regulating
- // access to our selectThread and unhandledWakeup fields.
- synchronized (selectThreadMutex)
- {
- unhandledWakeup = true;
-
- // Interrupt any thread which is currently blocked in
- // a select operation.
- if (selectThread != null)
- selectThread.interrupt ();
- }
-
- return this;
- }
-
- private final void deregisterCancelledKeys()
- {
- Set ckeys = cancelledKeys ();
- synchronized (ckeys)
- {
- Iterator it = ckeys.iterator();
-
- while (it.hasNext ())
- {
- keys.remove ((SelectionKeyImpl) it.next ());
- it.remove ();
- }
- }
- }
-
- protected SelectionKey register (SelectableChannel ch, int ops, Object att)
- {
- return register ((AbstractSelectableChannel) ch, ops, att);
- }
-
- protected final SelectionKey register (AbstractSelectableChannel ch, int ops,
- Object att)
- {
- SelectionKeyImpl result;
-
- if (ch instanceof SocketChannelImpl)
- result = new SocketChannelSelectionKey (ch, this);
- else if (ch instanceof DatagramChannelImpl)
- result = new DatagramChannelSelectionKey (ch, this);
- else if (ch instanceof ServerSocketChannelImpl)
- result = new ServerSocketChannelSelectionKey (ch, this);
- else
- throw new InternalError ("No known channel type");
-
- synchronized (keys)
- {
- keys.add (result);
- }
-
- result.interestOps (ops);
- result.attach (att);
- return result;
- }
-}
diff --git a/libjava/gnu/java/nio/SelectorProviderImpl.java b/libjava/gnu/java/nio/SelectorProviderImpl.java
deleted file mode 100644
index 47521107e90..00000000000
--- a/libjava/gnu/java/nio/SelectorProviderImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* SelectorProviderImpl.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio;
-
-import java.io.IOException;
-import java.nio.channels.DatagramChannel;
-import java.nio.channels.Pipe;
-import java.nio.channels.ServerSocketChannel;
-import java.nio.channels.SocketChannel;
-import java.nio.channels.spi.AbstractSelector;
-import java.nio.channels.spi.SelectorProvider;
-
-public class SelectorProviderImpl extends SelectorProvider
-{
- public SelectorProviderImpl ()
- {
- }
-
- public DatagramChannel openDatagramChannel ()
- throws IOException
- {
- return new DatagramChannelImpl (this);
- }
-
- public Pipe openPipe ()
- throws IOException
- {
- return new PipeImpl (this);
- }
-
- public AbstractSelector openSelector ()
- throws IOException
- {
- return new SelectorImpl (this);
- }
-
- public ServerSocketChannel openServerSocketChannel ()
- throws IOException
- {
- return new ServerSocketChannelImpl (this);
- }
-
- public SocketChannel openSocketChannel ()
- throws IOException
- {
- return new SocketChannelImpl (this);
- }
-}
diff --git a/libjava/gnu/java/nio/charset/ISO_8859_1.java b/libjava/gnu/java/nio/charset/ISO_8859_1.java
deleted file mode 100644
index cc06ecd5ad0..00000000000
--- a/libjava/gnu/java/nio/charset/ISO_8859_1.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/* ISO_8859_1.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio.charset;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.CoderResult;
-
-/**
- * ISO-8859-1 charset.
- *
- * @author Jesse Rosenstock
- */
-final class ISO_8859_1 extends Charset
-{
- ISO_8859_1 ()
- {
- /* Canonical charset name chosen according to:
- * http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
- */
- super ("ISO-8859-1", new String[] {
- /* These names are provided by
- * http://www.iana.org/assignments/character-sets
- */
- "iso-ir-100",
- "ISO_8859-1",
- "latin1",
- "l1",
- "IBM819",
- "CP819",
- "csISOLatin1",
- "8859_1",
- /* These names are provided by
- * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
- */
- "ISO8859_1", "ISO_8859_1", "ibm-819", "ISO_8859-1:1987",
- "819"
- });
-
- }
-
- public boolean contains (Charset cs)
- {
- return cs instanceof US_ASCII || cs instanceof ISO_8859_1;
- }
-
- public CharsetDecoder newDecoder ()
- {
- return new Decoder (this);
- }
-
- public CharsetEncoder newEncoder ()
- {
- return new Encoder (this);
- }
-
- private static final class Decoder extends CharsetDecoder
- {
- // Package-private to avoid a trampoline constructor.
- Decoder (Charset cs)
- {
- super (cs, 1.0f, 1.0f);
- }
-
- protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out)
- {
- // TODO: Optimize this in the case in.hasArray() / out.hasArray()
- while (in.hasRemaining ())
- {
- byte b = in.get ();
-
- if (!out.hasRemaining ())
- {
- in.position (in.position () - 1);
- return CoderResult.OVERFLOW;
- }
-
- out.put ((char) (b & 0xFF));
- }
-
- return CoderResult.UNDERFLOW;
- }
- }
-
- private static final class Encoder extends CharsetEncoder
- {
- // Package-private to avoid a trampoline constructor.
- Encoder (Charset cs)
- {
- super (cs, 1.0f, 1.0f);
- }
-
- protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out)
- {
- // TODO: Optimize this in the case in.hasArray() / out.hasArray()
- while (in.hasRemaining ())
- {
- char c = in.get ();
-
- if (c > 0xFF)
- {
- in.position (in.position () - 1);
- return CoderResult.unmappableForLength (1);
- }
- if (!out.hasRemaining ())
- {
- in.position (in.position () - 1);
- return CoderResult.OVERFLOW;
- }
-
- out.put ((byte) c);
- }
-
- return CoderResult.UNDERFLOW;
- }
- }
-}
diff --git a/libjava/gnu/java/nio/charset/US_ASCII.java b/libjava/gnu/java/nio/charset/US_ASCII.java
deleted file mode 100644
index d26f7ffc9ab..00000000000
--- a/libjava/gnu/java/nio/charset/US_ASCII.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/* US_ASCII.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio.charset;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.CoderResult;
-
-/**
- * US-ASCII charset.
- *
- * @author Jesse Rosenstock
- */
-final class US_ASCII extends Charset
-{
- US_ASCII ()
- {
- /* Canonical charset name chosen according to:
- * http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
- */
- super ("US-ASCII", new String[] {
- /* These names are provided by
- * http://www.iana.org/assignments/character-sets
- */
- "iso-ir-6",
- "ANSI_X3.4-1986",
- "ISO_646.irv:1991",
- "ASCII",
- "ISO646-US",
- "ASCII",
- "us",
- "IBM367",
- "cp367",
- "csASCII",
- /* These names are provided by
- * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
- */
- "ANSI_X3.4-1968", "iso_646.irv:1983", "ascii7", "646",
- "windows-20127"
- });
- }
-
- public boolean contains (Charset cs)
- {
- return cs instanceof US_ASCII;
- }
-
- public CharsetDecoder newDecoder ()
- {
- return new Decoder (this);
- }
-
- public CharsetEncoder newEncoder ()
- {
- return new Encoder (this);
- }
-
- private static final class Decoder extends CharsetDecoder
- {
- // Package-private to avoid a trampoline constructor.
- Decoder (Charset cs)
- {
- super (cs, 1.0f, 1.0f);
- }
-
- protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out)
- {
- // TODO: Optimize this in the case in.hasArray() / out.hasArray()
- while (in.hasRemaining ())
- {
- byte b = in.get ();
-
- if (b < 0)
- {
- in.position (in.position () - 1);
- return CoderResult.malformedForLength (1);
- }
- if (!out.hasRemaining ())
- {
- in.position (in.position () - 1);
- return CoderResult.OVERFLOW;
- }
-
- out.put ((char) b);
- }
-
- return CoderResult.UNDERFLOW;
- }
- }
-
- private static final class Encoder extends CharsetEncoder
- {
- // Package-private to avoid a trampoline constructor.
- Encoder (Charset cs)
- {
- super (cs, 1.0f, 1.0f);
- }
-
- protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out)
- {
- // TODO: Optimize this in the case in.hasArray() / out.hasArray()
- while (in.hasRemaining ())
- {
- char c = in.get ();
-
- if (c > Byte.MAX_VALUE)
- {
- in.position (in.position () - 1);
- return CoderResult.unmappableForLength (1);
- }
- if (!out.hasRemaining ())
- {
- in.position (in.position () - 1);
- return CoderResult.OVERFLOW;
- }
-
- out.put ((byte) c);
- }
-
- return CoderResult.UNDERFLOW;
- }
- }
-}
diff --git a/libjava/gnu/java/nio/charset/UTF_16.java b/libjava/gnu/java/nio/charset/UTF_16.java
deleted file mode 100644
index f111266ab59..00000000000
--- a/libjava/gnu/java/nio/charset/UTF_16.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* UTF_16.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio.charset;
-
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-
-/**
- * UTF-16 charset.
- *
- * @author Jesse Rosenstock
- */
-final class UTF_16 extends Charset
-{
- UTF_16 ()
- {
- super ("UTF-16", new String[] {
- // witnessed by the internet
- "UTF16",
- /* These names are provided by
- * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
- */
- "ISO-10646-UCS-2", "unicode", "csUnicode", "ucs-2"
- });
- }
-
- public boolean contains (Charset cs)
- {
- return cs instanceof US_ASCII || cs instanceof ISO_8859_1
- || cs instanceof UTF_8 || cs instanceof UTF_16BE
- || cs instanceof UTF_16LE || cs instanceof UTF_16;
- }
-
- public CharsetDecoder newDecoder ()
- {
- return new UTF_16Decoder (this, UTF_16Decoder.UNKNOWN_ENDIAN);
- }
-
- public CharsetEncoder newEncoder ()
- {
- return new UTF_16Encoder (this, UTF_16Encoder.BIG_ENDIAN, false);
- }
-}
diff --git a/libjava/gnu/java/nio/charset/UTF_16BE.java b/libjava/gnu/java/nio/charset/UTF_16BE.java
deleted file mode 100644
index 15e308fab56..00000000000
--- a/libjava/gnu/java/nio/charset/UTF_16BE.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* UTF_16BE.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio.charset;
-
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-
-/**
- * UTF-16BE charset.
- *
- * @author Jesse Rosenstock
- */
-final class UTF_16BE extends Charset
-{
- UTF_16BE ()
- {
- super ("UTF-16BE", new String[] {
- // witnessed by the internet
- "UTF16BE",
- /* These names are provided by
- * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
- */
- "x-utf-16be", "ibm-1200", "ibm-1201", "ibm-5297",
- "ibm-13488", "ibm-17584", "windows-1201", "cp1200", "cp1201",
- "UTF16_BigEndian",
- // see http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
- "UnicodeBigUnmarked"
- });
- }
-
- public boolean contains (Charset cs)
- {
- return cs instanceof US_ASCII || cs instanceof ISO_8859_1
- || cs instanceof UTF_8 || cs instanceof UTF_16BE
- || cs instanceof UTF_16LE || cs instanceof UTF_16;
- }
-
- public CharsetDecoder newDecoder ()
- {
- return new UTF_16Decoder (this, UTF_16Decoder.BIG_ENDIAN);
- }
-
- public CharsetEncoder newEncoder ()
- {
- return new UTF_16Encoder (this, UTF_16Encoder.BIG_ENDIAN, true);
- }
-}
diff --git a/libjava/gnu/java/nio/charset/UTF_16Decoder.java b/libjava/gnu/java/nio/charset/UTF_16Decoder.java
deleted file mode 100644
index ddcea88dd36..00000000000
--- a/libjava/gnu/java/nio/charset/UTF_16Decoder.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/* UTF_16Decoder.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio.charset;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CoderResult;
-
-/**
- * Decoder for UTF-16, UTF-15LE, and UTF-16BE.
- *
- * @author Jesse Rosenstock
- */
-final class UTF_16Decoder extends CharsetDecoder
-{
- // byte orders
- static final int BIG_ENDIAN = 0;
- static final int LITTLE_ENDIAN = 1;
- static final int UNKNOWN_ENDIAN = 2;
-
- private static final char BYTE_ORDER_MARK = '\uFEFF';
- private static final char REVERSED_BYTE_ORDER_MARK = '\uFFFE';
-
- private final int originalByteOrder;
- private int byteOrder;
-
- UTF_16Decoder (Charset cs, int byteOrder)
- {
- super (cs, 0.5f, 1.0f);
- this.originalByteOrder = byteOrder;
- this.byteOrder = byteOrder;
- }
-
- protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out)
- {
- // TODO: Optimize this in the case in.hasArray() / out.hasArray()
-
- int inPos = in.position ();
- try
- {
- while (in.remaining () >= 2)
- {
- byte b1 = in.get ();
- byte b2 = in.get ();
-
- // handle byte order mark
- if (byteOrder == UNKNOWN_ENDIAN)
- {
- char c = (char) ((b1 << 8) | b2);
- if (c == BYTE_ORDER_MARK)
- {
- byteOrder = BIG_ENDIAN;
- inPos += 2;
- continue;
- }
- else if (c == REVERSED_BYTE_ORDER_MARK)
- {
- byteOrder = LITTLE_ENDIAN;
- inPos += 2;
- continue;
- }
- else
- {
- // assume big endian, do not consume bytes,
- // continue with normal processing
- byteOrder = BIG_ENDIAN;
- }
- }
-
- char c = byteOrder == BIG_ENDIAN ? (char) ((b1 << 8) | b2)
- : (char) ((b2 << 8) | b1);
-
- if (0xD800 <= c && c <= 0xDFFF)
- {
- // c is a surrogate
-
- // make sure c is a high surrogate
- if (c > 0xDBFF)
- return CoderResult.malformedForLength (2);
- if (in.remaining () < 2)
- return CoderResult.UNDERFLOW;
- byte b3 = in.get ();
- byte b4 = in.get ();
- char d = byteOrder == BIG_ENDIAN ? (char) ((b3 << 8) | b4)
- : (char) ((b4 << 8) | b3);
- // make sure d is a low surrogate
- if (d < 0xDC00 || d > 0xDFFF)
- return CoderResult.malformedForLength (2);
- out.put (c);
- out.put (d);
- inPos += 4;
- }
- else
- {
- if (!out.hasRemaining ())
- return CoderResult.UNDERFLOW;
- out.put (c);
- inPos += 2;
- }
- }
-
- return CoderResult.UNDERFLOW;
- }
- finally
- {
- in.position (inPos);
- }
- }
-
- protected void implReset ()
- {
- byteOrder = originalByteOrder;
- }
-}
diff --git a/libjava/gnu/java/nio/charset/UTF_16Encoder.java b/libjava/gnu/java/nio/charset/UTF_16Encoder.java
deleted file mode 100644
index ae613355171..00000000000
--- a/libjava/gnu/java/nio/charset/UTF_16Encoder.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/* UTF_16Encoder.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio.charset;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.CoderResult;
-
-/**
- * Encoder for UTF-16, UTF-15LE, and UTF-16BE.
- *
- * @author Jesse Rosenstock
- */
-final class UTF_16Encoder extends CharsetEncoder
-{
- // byte orders
- static final int BIG_ENDIAN = 0;
- static final int LITTLE_ENDIAN = 1;
-
- private static final char BYTE_ORDER_MARK = '\uFEFF';
-
- private final int byteOrder;
- private final boolean useByteOrderMark;
- private boolean needsByteOrderMark;
-
- UTF_16Encoder (Charset cs, int byteOrder, boolean useByteOrderMark)
- {
- super (cs, 2.0f,
- useByteOrderMark ? 2.0f : 4.0f,
- byteOrder == BIG_ENDIAN
- ? new byte[] { (byte) 0xFF, (byte) 0xFD }
- : new byte[] { (byte) 0xFD, (byte) 0xFF });
- this.byteOrder = byteOrder;
- this.useByteOrderMark = useByteOrderMark;
- this.needsByteOrderMark = useByteOrderMark;
- }
-
- protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out)
- {
- // TODO: Optimize this in the case in.hasArray() / out.hasArray()
-
- if (needsByteOrderMark)
- {
- if (out.remaining () < 2)
- return CoderResult.OVERFLOW;
- put (out, BYTE_ORDER_MARK);
- needsByteOrderMark = false;
- }
-
- int inPos = in.position ();
- try
- {
- while (in.hasRemaining ())
- {
- char c = in.get ();
-
- if (0xD800 <= c && c <= 0xDFFF)
- {
- // c is a surrogate
-
- // make sure c is a high surrogate
- if (c > 0xDBFF)
- return CoderResult.malformedForLength (1);
- if (in.remaining () < 1)
- return CoderResult.UNDERFLOW;
- char d = in.get ();
- // make sure d is a low surrogate
- if (d < 0xDC00 || d > 0xDFFF)
- return CoderResult.malformedForLength (1);
- put (out, c);
- put (out, d);
- inPos += 2;
- }
- else
- {
- if (out.remaining () < 2)
- return CoderResult.OVERFLOW;
- put (out, c);
- inPos++;
- }
- }
-
- return CoderResult.UNDERFLOW;
- }
- finally
- {
- in.position (inPos);
- }
- }
-
- /**
- * Writes <code>c</code> to <code>out</code> in the byte order
- * specified by <code>byteOrder</code>.
- **/
- private void put (ByteBuffer out, char c)
- {
- if (byteOrder == BIG_ENDIAN)
- {
- out.put ((byte) (c >> 8));
- out.put ((byte) (c & 0xFF));
- }
- else
- {
- out.put ((byte) (c & 0xFF));
- out.put ((byte) (c >> 8));
- }
- }
-
- protected void implReset ()
- {
- needsByteOrderMark = useByteOrderMark;
- }
-
- // TODO: override canEncode(char) and canEncode(CharSequence)
- // for performance
-}
diff --git a/libjava/gnu/java/nio/charset/UTF_16LE.java b/libjava/gnu/java/nio/charset/UTF_16LE.java
deleted file mode 100644
index 952f4aa1700..00000000000
--- a/libjava/gnu/java/nio/charset/UTF_16LE.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* UTF_16LE.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio.charset;
-
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-
-/**
- * UTF-16LE charset.
- *
- * @author Jesse Rosenstock
- */
-final class UTF_16LE extends Charset
-{
- UTF_16LE ()
- {
- super ("UTF-16LE", new String[] {
- // witnessed by the internet
- "UTF16LE",
- /* These names are provided by
- * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
- */
- "x-utf-16le", "ibm-1202", "ibm-13490", "ibm-17586",
- "UTF16_LittleEndian",
- // see http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
- "UnicodeLittleUnmarked"
- });
- }
-
- public boolean contains (Charset cs)
- {
- return cs instanceof US_ASCII || cs instanceof ISO_8859_1
- || cs instanceof UTF_8 || cs instanceof UTF_16BE
- || cs instanceof UTF_16LE || cs instanceof UTF_16;
- }
-
- public CharsetDecoder newDecoder ()
- {
- return new UTF_16Decoder (this, UTF_16Decoder.LITTLE_ENDIAN);
- }
-
- public CharsetEncoder newEncoder ()
- {
- return new UTF_16Encoder (this, UTF_16Encoder.LITTLE_ENDIAN, true);
- }
-}
diff --git a/libjava/gnu/java/nio/charset/UTF_8.java b/libjava/gnu/java/nio/charset/UTF_8.java
deleted file mode 100644
index 12f15e1b0c2..00000000000
--- a/libjava/gnu/java/nio/charset/UTF_8.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/* UTF_8.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.nio.charset;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.CoderResult;
-
-/**
- * UTF-8 charset.
- *
- * <p> UTF-8 references:
- * <ul>
- * <li> <a href="http://ietf.org/rfc/rfc2279.txt">RFC 2279</a>
- * <li> The <a href="http://www.unicode.org/unicode/standard/standard.html">
- * Unicode standard</a> and
- * <a href="http://www.unicode.org/versions/corrigendum1.html">
- * Corrigendum</a>
- * </ul>
- *
- * @author Jesse Rosenstock
- */
-final class UTF_8 extends Charset
-{
- UTF_8 ()
- {
- super ("UTF-8", new String[] {
- /* These names are provided by
- * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
- */
- "ibm-1208", "ibm-1209", "ibm-5304", "ibm-5305",
- "windows-65001", "cp1208",
- // see http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
- "UTF8"
- });
- }
-
- public boolean contains (Charset cs)
- {
- return cs instanceof US_ASCII || cs instanceof ISO_8859_1
- || cs instanceof UTF_8 || cs instanceof UTF_16BE
- || cs instanceof UTF_16LE || cs instanceof UTF_16;
- }
-
- public CharsetDecoder newDecoder ()
- {
- return new Decoder (this);
- }
-
- public CharsetEncoder newEncoder ()
- {
- return new Encoder (this);
- }
-
- private static final class Decoder extends CharsetDecoder
- {
- // Package-private to avoid a trampoline constructor.
- Decoder (Charset cs)
- {
- super (cs, 1.0f, 1.0f);
- }
-
- protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out)
- {
- // TODO: Optimize this in the case in.hasArray() / out.hasArray()
- int inPos = in.position();
- try
- {
- while (in.hasRemaining ())
- {
- char c;
- byte b1 = in.get ();
- int highNibble = (b1 >> 4) & 0xF;
-
- switch (highNibble)
- {
- case 0: case 1: case 2: case 3:
- case 4: case 5: case 6: case 7:
- if (out.remaining () < 1)
- return CoderResult.OVERFLOW;
- out.put ((char) b1);
- inPos++;
- break;
-
- case 0xC: case 0xD:
- byte b2;
- if (in.remaining () < 1)
- return CoderResult.UNDERFLOW;
- if (out.remaining () < 1)
- return CoderResult.OVERFLOW;
- if (!isContinuation (b2 = in.get ()))
- return CoderResult.malformedForLength (1);
- c = (char) (((b1 & 0x1F) << 6) | (b2 & 0x3F));
- // check that we had the shortest encoding
- if (c <= 0x7F)
- return CoderResult.malformedForLength (2);
- out.put (c);
- inPos += 2;
- break;
-
- case 0xE:
- byte b3;
- if (in.remaining () < 2)
- return CoderResult.UNDERFLOW;
- if (out.remaining () < 1)
- return CoderResult.OVERFLOW;
- if (!isContinuation (b2 = in.get ()))
- return CoderResult.malformedForLength (1);
- if (!isContinuation (b3 = in.get ()))
- return CoderResult.malformedForLength (1);
- c = (char) (((b1 & 0x0F) << 12)
- | ((b2 & 0x3F) << 6)
- | (b3 & 0x3F));
- // check that we had the shortest encoding
- if (c <= 0x7FF)
- return CoderResult.malformedForLength (3);
- out.put (c);
- inPos += 3;
- break;
-
- default:
- return CoderResult.malformedForLength (1);
- }
- }
-
- return CoderResult.UNDERFLOW;
- }
- finally
- {
- // In case we did a get(), then encountered an error, reset the
- // position to before the error. If there was no error, this
- // will benignly reset the position to the value it already has.
- in.position (inPos);
- }
- }
-
- private static boolean isContinuation (byte b)
- {
- return (b & 0xC0) == 0x80;
- }
- }
-
- private static final class Encoder extends CharsetEncoder
- {
- // Package-private to avoid a trampoline constructor.
- Encoder (Charset cs)
- {
- // According to
- // http://www-106.ibm.com/developerworks/unicode/library/utfencodingforms/index.html
- // On average, English takes slightly over one unit per code point.
- // Most Latin-script languages take about 1.1 bytes. Greek, Russian,
- // Arabic and Hebrew take about 1.7 bytes, and most others (including
- // Japanese, Chinese, Korean and Hindi) take about 3 bytes.
- // We assume we will be dealing with latin scripts, and use 1.1
- // for averageBytesPerChar.
- super (cs, 1.1f, 4.0f);
- }
-
- protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out)
- {
- int inPos = in.position();
- try
- {
- // TODO: Optimize this in the case in.hasArray() / out.hasArray()
- while (in.hasRemaining ())
- {
- int remaining = out.remaining ();
- char c = in.get ();
-
- // UCS-4 range (hex.) UTF-8 octet sequence (binary)
- // 0000 0000-0000 007F 0xxxxxxx
- // 0000 0080-0000 07FF 110xxxxx 10xxxxxx
- // 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx
-
- // Scalar Value UTF-16 byte 1 byte 2 byte 3 byte 4
- // 0000 0000 0xxx xxxx 0000 0000 0xxx xxxx 0xxx xxxx
- // 0000 0yyy yyxx xxxx 0000 0yyy yyxx xxxx 110y yyyy 10xx xxxx
- // zzzz yyyy yyxx xxxx zzzz yyyy yyxx xxxx 1110 zzzz 10yy yyyy 10xx xxxx
- // u uuuu zzzz yyyy yyxx xxxx 1101 10ww wwzz zzyy 1111 0uuu 10uu zzzz 10yy yyyy 10xx xxxx
- // + 1101 11yy yyxx xxxx
- // Note: uuuuu = wwww + 1
-
- if (c <= 0x7F)
- {
- if (remaining < 1)
- return CoderResult.OVERFLOW;
- out.put ((byte) c);
- inPos++;
- }
- else if (c <= 0x7FF)
- {
- if (remaining < 2)
- return CoderResult.OVERFLOW;
- out.put ((byte) (0xC0 | (c >> 6)));
- out.put ((byte) (0x80 | (c & 0x3F)));
- inPos++;
- }
- else if (0xD800 <= c && c <= 0xDFFF)
- {
- if (remaining < 4)
- return CoderResult.OVERFLOW;
-
- // we got a low surrogate without a preciding high one
- if (c > 0xDBFF)
- return CoderResult.malformedForLength (1);
-
- // high surrogates
- if (!in.hasRemaining ())
- return CoderResult.UNDERFLOW;
-
- char d = in.get ();
-
- // make sure d is a low surrogate
- if (d < 0xDC00 || d > 0xDFFF)
- return CoderResult.malformedForLength (1);
-
- // make the 32 bit value
- // int value2 = (c - 0xD800) * 0x400 + (d - 0xDC00) + 0x10000;
- int value = (((c & 0x3FF) << 10) | (d & 0x3FF)) + 0x10000;
- // assert value == value2;
- out.put ((byte) (0xF0 | (value >> 18)));
- out.put ((byte) (0x80 | ((value >> 12) & 0x3F)));
- out.put ((byte) (0x80 | ((value >> 6) & 0x3F)));
- out.put ((byte) (0x80 | ((value ) & 0x3F)));
-
- inPos += 2;
- }
- else
- {
- if (remaining < 3)
- return CoderResult.OVERFLOW;
-
- out.put ((byte) (0xE0 | (c >> 12)));
- out.put ((byte) (0x80 | ((c >> 6) & 0x3F)));
- out.put ((byte) (0x80 | (c & 0x3F)));
- inPos++;
- }
- }
-
- return CoderResult.UNDERFLOW;
- }
- finally
- {
- // In case we did a get(), then encountered an error, reset the
- // position to before the error. If there was no error, this
- // will benignly reset the position to the value it already has.
- in.position (inPos);
- }
- }
- }
-}
diff --git a/libjava/gnu/java/rmi/RMIMarshalledObjectInputStream.java b/libjava/gnu/java/rmi/RMIMarshalledObjectInputStream.java
deleted file mode 100644
index 140069379bc..00000000000
--- a/libjava/gnu/java/rmi/RMIMarshalledObjectInputStream.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* gnu.java.rmi.RMIMarshalledObjectInputStream
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi;
-
-import gnu.java.rmi.server.RMIObjectInputStream;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-/**
- * This class is only for java.rmi.MarshalledObject to deserialize object from
- * objBytes and locBytes
- */
-
-public class RMIMarshalledObjectInputStream extends RMIObjectInputStream
-{
- private ObjectInputStream locStream;
-
- public RMIMarshalledObjectInputStream(byte[] objBytes, byte[] locBytes) throws IOException
- {
- super(new ByteArrayInputStream(objBytes));
- if(locBytes != null)
- locStream = new ObjectInputStream(new ByteArrayInputStream(locBytes));
- }
-
- //This method overrides RMIObjectInputStream's
- protected Object getAnnotation() throws IOException, ClassNotFoundException
- {
- if(locStream == null)
- return null;
- return locStream.readObject();
- }
-
-} // End of RMIMarshalledObjectInputStream
diff --git a/libjava/gnu/java/rmi/RMIMarshalledObjectOutputStream.java b/libjava/gnu/java/rmi/RMIMarshalledObjectOutputStream.java
deleted file mode 100644
index 2bbbaacb45f..00000000000
--- a/libjava/gnu/java/rmi/RMIMarshalledObjectOutputStream.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* gnu.java.rmi.RMIMarshalledObjectOutputStream
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi;
-
-import gnu.java.rmi.server.RMIObjectOutputStream;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-
-/**
- * This class is only for java.rmi.MarshalledObject to serialize object and
- * got objBytes and locBytes
- */
-public class RMIMarshalledObjectOutputStream extends RMIObjectOutputStream
-{
- private ObjectOutputStream locStream;
- private ByteArrayOutputStream locBytesStream;
-
- public RMIMarshalledObjectOutputStream(OutputStream objStream) throws IOException
- {
- super(objStream);
- locBytesStream = new ByteArrayOutputStream(256);
- locStream = new ObjectOutputStream(locBytesStream);
- }
-
- //This method overrides RMIObjectOutputStream's.
- protected void setAnnotation(String annotation) throws IOException{
- locStream.writeObject(annotation);
- }
-
- public void flush() throws IOException {
- super.flush();
- locStream.flush();
- }
-
- public byte[] getLocBytes(){
- return locBytesStream.toByteArray();
- }
-
-} // End of RMIMarshalledObjectOutputStream
-
diff --git a/libjava/gnu/java/rmi/dgc/DGCImpl.java b/libjava/gnu/java/rmi/dgc/DGCImpl.java
deleted file mode 100644
index a32445c343b..00000000000
--- a/libjava/gnu/java/rmi/dgc/DGCImpl.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/* DGCImpl.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2002, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.dgc;
-
-import gnu.java.rmi.server.UnicastServerRef;
-
-import java.rmi.RemoteException;
-import java.rmi.dgc.DGC;
-import java.rmi.dgc.Lease;
-import java.rmi.dgc.VMID;
-import java.rmi.server.ObjID;
-import java.rmi.server.RMISocketFactory;
-import java.util.Hashtable;
-
-/**
- * I let DGCImpl to extend UnicastServerRef, but not
- * UnicastRemoteObject, because UnicastRemoteObject must
- * exportObject automatically.
- */
-public class DGCImpl
- extends UnicastServerRef implements DGC {
-
- private static final long LEASE_VALUE = 600000L;
- // leaseCache caches a LeaseRecord associated with a vmid
- private Hashtable leaseCache = new Hashtable();
-
-public DGCImpl() throws RemoteException {
- super(new ObjID(ObjID.DGC_ID), 0, RMISocketFactory.getSocketFactory());
-}
-
-public Lease dirty(ObjID[] ids, long sequenceNum, Lease lease) throws RemoteException {
- VMID vmid = lease.getVMID();
- if (vmid == null)
- vmid = new VMID();
- long leaseValue = LEASE_VALUE;
- //long leaseValue = lease.getValue();
- lease = new Lease(vmid, leaseValue);
- synchronized(leaseCache){
- LeaseRecord lr = (LeaseRecord)leaseCache.get(vmid);
- if (lr != null)
- lr.reset(leaseValue);
- else{
- lr = new LeaseRecord(vmid, leaseValue);
- leaseCache.put(vmid, lr);
- }
- }
-
- return (lease);
-}
-
-public void clean(ObjID[] ids, long sequenceNum, VMID vmid, boolean strong) throws RemoteException {
- // Not implemented
-}
-
- /**
- * LeaseRecord associates a vmid to expireTime.
- */
- private static class LeaseRecord{
- private VMID vmid;
- private long expireTime;
-
- LeaseRecord(VMID vmid, long leaseValue){
- this.vmid = vmid;
- reset(leaseValue);
- }
-
- // reset expireTime
- void reset(long leaseValue){
- long l = System.currentTimeMillis();
- expireTime = l + leaseValue;
- }
-
- boolean isExpired(){
- long l = System.currentTimeMillis();
- if ( l > expireTime)
- return true;
- return false;
- }
-
- } //End of LeaseRecord
-
-} //End of DGCImpl
diff --git a/libjava/gnu/java/rmi/dgc/DGCImpl_Skel.java b/libjava/gnu/java/rmi/dgc/DGCImpl_Skel.java
deleted file mode 100644
index 5f032e72f8a..00000000000
--- a/libjava/gnu/java/rmi/dgc/DGCImpl_Skel.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/* DGCImpl_Skel.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-
-// Skel class generated by rmic - DO NOT EDIT!
-
-package gnu.java.rmi.dgc;
-
-public final class DGCImpl_Skel
- implements java.rmi.server.Skeleton
-{
- private static final long interfaceHash = -669196253586618813L;
-
- private static final java.rmi.server.Operation[] operations = {
- new java.rmi.server.Operation("void clean(java.rmi.server.ObjID[], long, java.rmi.dgc.VMID, boolean"),
- new java.rmi.server.Operation("java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease")
- };
-
- public java.rmi.server.Operation[] getOperations() {
- return ((java.rmi.server.Operation[]) operations.clone());
- }
-
- public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall call, int opnum, long hash) throws java.lang.Exception {
- if (opnum < 0) {
- if (hash == -5803803475088455571L) {
- opnum = 0;
- }
- else if (hash == -8139341527526761862L) {
- opnum = 1;
- }
- else {
- throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
- }
- }
- else if (hash != interfaceHash) {
- throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
- }
-
- gnu.java.rmi.dgc.DGCImpl server = (gnu.java.rmi.dgc.DGCImpl)obj;
- switch (opnum) {
- case 0:
- {
- java.rmi.server.ObjID[] $param_0;
- long $param_1;
- java.rmi.dgc.VMID $param_2;
- boolean $param_3;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $param_0 = (java.rmi.server.ObjID[])in.readObject();
- $param_1 = (long)in.readLong();
- $param_2 = (java.rmi.dgc.VMID)in.readObject();
- $param_3 = (boolean)in.readBoolean();
-
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- catch (java.lang.ClassCastException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- finally {
- call.releaseInputStream();
- }
- server.clean($param_0, $param_1, $param_2, $param_3);
- try {
- java.io.ObjectOutput out = call.getResultStream(true);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling return", e);
- }
- break;
- }
-
- case 1:
- {
- java.rmi.server.ObjID[] $param_0;
- long $param_1;
- java.rmi.dgc.Lease $param_2;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $param_0 = (java.rmi.server.ObjID[])in.readObject();
- $param_1 = (long)in.readLong();
- $param_2 = (java.rmi.dgc.Lease)in.readObject();
-
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- catch (java.lang.ClassCastException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- finally {
- call.releaseInputStream();
- }
- java.rmi.dgc.Lease $result = server.dirty($param_0, $param_1, $param_2);
- try {
- java.io.ObjectOutput out = call.getResultStream(true);
- out.writeObject($result);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling return", e);
- }
- break;
- }
-
- default:
- throw new java.rmi.UnmarshalException("invalid method number");
- }
- }
-}
diff --git a/libjava/gnu/java/rmi/dgc/DGCImpl_Stub.java b/libjava/gnu/java/rmi/dgc/DGCImpl_Stub.java
deleted file mode 100644
index b1e086a73b2..00000000000
--- a/libjava/gnu/java/rmi/dgc/DGCImpl_Stub.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* DGCImpl_Stub.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-
-// Stub class generated by rmic - DO NOT EDIT!
-
-package gnu.java.rmi.dgc;
-
-public final class DGCImpl_Stub
- extends java.rmi.server.RemoteStub
- implements java.rmi.dgc.DGC
-{
- private static final long serialVersionUID = 2L;
-
- private static final long interfaceHash = -669196253586618813L;
-
- private static boolean useNewInvoke;
-
- private static final java.rmi.server.Operation[] operations = {
- new java.rmi.server.Operation("void clean(java.rmi.server.ObjID[], long, java.rmi.dgc.VMID, boolean)"),
- new java.rmi.server.Operation("java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)")
- };
-
- private static java.lang.reflect.Method $method_clean_0;
- private static java.lang.reflect.Method $method_dirty_1;
-
- static {
- try {
- java.rmi.server.RemoteRef.class.getMethod("invoke", new java.lang.Class[] { java.rmi.Remote.class, java.lang.reflect.Method.class, java.lang.Object[].class, long.class });
- useNewInvoke = true;
- $method_clean_0 = gnu.java.rmi.dgc.DGCImpl.class.getMethod("clean", new java.lang.Class[] {java.rmi.server.ObjID[].class, long.class, java.rmi.dgc.VMID.class, boolean.class});
- $method_dirty_1 = gnu.java.rmi.dgc.DGCImpl.class.getMethod("dirty", new java.lang.Class[] {java.rmi.server.ObjID[].class, long.class, java.rmi.dgc.Lease.class});
-
- }
- catch (java.lang.NoSuchMethodException e) {
- useNewInvoke = false;
- }
- }
-
- public DGCImpl_Stub() {
- super();
- }
- public DGCImpl_Stub(java.rmi.server.RemoteRef ref) {
- super(ref);
- }
-
- public void clean(java.rmi.server.ObjID[] $param_0, long $param_1, java.rmi.dgc.VMID $param_2, boolean $param_3) throws java.rmi.RemoteException {
- try {
- if (useNewInvoke) {
- ref.invoke(this, $method_clean_0, new java.lang.Object[] {$param_0, new java.lang.Long($param_1), $param_2, new java.lang.Boolean($param_3)}, -5803803475088455571L);
- }
- else {
- java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject)this, operations, 0, interfaceHash);
- try {
- java.io.ObjectOutput out = call.getOutputStream();
- out.writeObject($param_0);
- out.writeLong($param_1);
- out.writeObject($param_2);
- out.writeBoolean($param_3);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling arguments", e);
- }
- ref.invoke(call);
- try {
- java.io.ObjectInput in = call.getInputStream();
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling return", e);
- }
- finally {
- ref.done(call);
- }
- }
- }
- catch (java.rmi.RemoteException e) {
- throw e;
- }
- catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- public java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[] $param_0, long $param_1, java.rmi.dgc.Lease $param_2) throws java.rmi.RemoteException {
- try {
- if (useNewInvoke) {
- java.lang.Object $result = ref.invoke(this, $method_dirty_1, new java.lang.Object[] {$param_0, new java.lang.Long($param_1), $param_2}, -8139341527526761862L);
- return ((java.rmi.dgc.Lease)$result);
- }
- else {
- java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject)this, operations, 1, interfaceHash);
- try {
- java.io.ObjectOutput out = call.getOutputStream();
- out.writeObject($param_0);
- out.writeLong($param_1);
- out.writeObject($param_2);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling arguments", e);
- }
- ref.invoke(call);
- java.rmi.dgc.Lease $result;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $result = (java.rmi.dgc.Lease)in.readObject();
- return ($result);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling return", e);
- }
- finally {
- ref.done(call);
- }
- }
- }
- catch (java.rmi.RemoteException e) {
- throw e;
- }
- catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
-}
diff --git a/libjava/gnu/java/rmi/registry/RegistryImpl.java b/libjava/gnu/java/rmi/registry/RegistryImpl.java
deleted file mode 100644
index 0c94434d806..00000000000
--- a/libjava/gnu/java/rmi/registry/RegistryImpl.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/* RegistryImpl.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2002, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.registry;
-
-import gnu.java.rmi.server.UnicastServerRef;
-
-import java.rmi.AccessException;
-import java.rmi.AlreadyBoundException;
-import java.rmi.NotBoundException;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.ObjID;
-import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RMIServerSocketFactory;
-import java.rmi.server.RMISocketFactory;
-import java.rmi.server.UnicastRemoteObject;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-public class RegistryImpl
- extends UnicastRemoteObject implements Registry {
-
-private Hashtable bindings = new Hashtable();
-
-public RegistryImpl(int port) throws RemoteException {
- this(port, RMISocketFactory.getSocketFactory(), RMISocketFactory.getSocketFactory());
-}
-
-public RegistryImpl(int port, RMIClientSocketFactory cf, RMIServerSocketFactory sf) throws RemoteException {
- super(new UnicastServerRef(new ObjID(ObjID.REGISTRY_ID), port, sf));
- // The following is unnecessary, because UnicastRemoteObject export itself automatically.
- //((UnicastServerRef)getRef()).exportObject(this);
-}
-
-public Remote lookup(String name) throws RemoteException, NotBoundException, AccessException {
- Object obj = bindings.get(name);
- if (obj == null) {
- throw new NotBoundException(name);
- }
- return ((Remote)obj);
-}
-
-public void bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException {
- if (bindings.containsKey(name)) {
- throw new AlreadyBoundException(name);
- }
- bindings.put(name, obj);
-}
-
-public void unbind(String name) throws RemoteException, NotBoundException, AccessException {
- Object obj = bindings.remove(name);
- if (obj == null) {
- throw new NotBoundException(name);
- }
-}
-
-public void rebind(String name, Remote obj) throws RemoteException, AccessException {
- bindings.put(name, obj);
-}
-
-public String[] list() throws RemoteException, AccessException {
- int size = bindings.size();
- String[] strings = new String[size];
- Enumeration e = bindings.keys();
- for (int i = 0; i < size; i++) {
- strings[i] = (String)e.nextElement();
- }
- return (strings);
-}
-
-public static void version() {
- System.out.println("rmiregistry ("
- + System.getProperty("java.vm.name")
- + ") "
- + System.getProperty("java.vm.version"));
- System.out.println("Copyright 2005 Free Software Foundation, Inc.");
- System.out.println("This is free software; see the source for copying conditions. There is NO");
- System.out.println("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
- System.exit(0);
-}
-
-public static void help() {
- System.out.println(
-"Usage: rmiregistry [OPTION | PORT]\n" +
-"\n" +
-" --help Print this help, then exit\n" +
-" --version Print version number, then exit\n");
- System.exit(0);
-}
-
-public static void main(String[] args) {
- int port = Registry.REGISTRY_PORT;
- if (args.length > 0) {
- if (args[0].equals("--version")) {
- version();
- }
- else if (args[0].equals("--help")) {
- help();
- }
- try {
- port = Integer.parseInt(args[0]);
- }
- catch (NumberFormatException _) {
- System.err.println("Bad port number - using default");
- }
- }
-
- try {
- Registry impl = LocateRegistry.createRegistry(port);
- }
- catch (RemoteException _) {
- System.err.println("Registry failed");
- }
-}
-
-}
diff --git a/libjava/gnu/java/rmi/registry/RegistryImpl_Skel.java b/libjava/gnu/java/rmi/registry/RegistryImpl_Skel.java
deleted file mode 100644
index 8cf14ccc0c4..00000000000
--- a/libjava/gnu/java/rmi/registry/RegistryImpl_Skel.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/* RegistryImpl_Skel.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-
-// Skel class generated by rmic - DO NOT EDIT!
-
-package gnu.java.rmi.registry;
-
-public final class RegistryImpl_Skel
- implements java.rmi.server.Skeleton
-{
- private static final long interfaceHash = 4905912898345647071L;
-
- private static final java.rmi.server.Operation[] operations = {
- new java.rmi.server.Operation("void bind(java.lang.String, java.rmi.Remote"),
- new java.rmi.server.Operation("java.lang.String[] list("),
- new java.rmi.server.Operation("java.rmi.Remote lookup(java.lang.String"),
- new java.rmi.server.Operation("void rebind(java.lang.String, java.rmi.Remote"),
- new java.rmi.server.Operation("void unbind(java.lang.String")
- };
-
- public java.rmi.server.Operation[] getOperations() {
- return ((java.rmi.server.Operation[]) operations.clone());
- }
-
- public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall call, int opnum, long hash) throws java.lang.Exception {
- if (opnum < 0) {
- if (hash == 7583982177005850366L) {
- opnum = 0;
- }
- else if (hash == 2571371476350237748L) {
- opnum = 1;
- }
- else if (hash == -7538657168040752697L) {
- opnum = 2;
- }
- else if (hash == -8381844669958460146L) {
- opnum = 3;
- }
- else if (hash == 7305022919901907578L) {
- opnum = 4;
- }
- else {
- throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
- }
- }
- else if (hash != interfaceHash) {
- throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
- }
-
- gnu.java.rmi.registry.RegistryImpl server = (gnu.java.rmi.registry.RegistryImpl)obj;
- switch (opnum) {
- case 0:
- {
- java.lang.String $param_0;
- java.rmi.Remote $param_1;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $param_0 = (java.lang.String)in.readObject();
- $param_1 = (java.rmi.Remote)in.readObject();
-
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- catch (java.lang.ClassCastException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- finally {
- call.releaseInputStream();
- }
- server.bind($param_0, $param_1);
- try {
- java.io.ObjectOutput out = call.getResultStream(true);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling return", e);
- }
- break;
- }
-
- case 1:
- {
- try {
- java.io.ObjectInput in = call.getInputStream();
-
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- finally {
- call.releaseInputStream();
- }
- java.lang.String[] $result = server.list();
- try {
- java.io.ObjectOutput out = call.getResultStream(true);
- out.writeObject($result);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling return", e);
- }
- break;
- }
-
- case 2:
- {
- java.lang.String $param_0;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $param_0 = (java.lang.String)in.readObject();
-
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- catch (java.lang.ClassCastException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- finally {
- call.releaseInputStream();
- }
- java.rmi.Remote $result = server.lookup($param_0);
- try {
- java.io.ObjectOutput out = call.getResultStream(true);
- out.writeObject($result);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling return", e);
- }
- break;
- }
-
- case 3:
- {
- java.lang.String $param_0;
- java.rmi.Remote $param_1;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $param_0 = (java.lang.String)in.readObject();
- $param_1 = (java.rmi.Remote)in.readObject();
-
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- catch (java.lang.ClassCastException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- finally {
- call.releaseInputStream();
- }
- server.rebind($param_0, $param_1);
- try {
- java.io.ObjectOutput out = call.getResultStream(true);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling return", e);
- }
- break;
- }
-
- case 4:
- {
- java.lang.String $param_0;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $param_0 = (java.lang.String)in.readObject();
-
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- catch (java.lang.ClassCastException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- }
- finally {
- call.releaseInputStream();
- }
- server.unbind($param_0);
- try {
- java.io.ObjectOutput out = call.getResultStream(true);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling return", e);
- }
- break;
- }
-
- default:
- throw new java.rmi.UnmarshalException("invalid method number");
- }
- }
-}
diff --git a/libjava/gnu/java/rmi/registry/RegistryImpl_Stub.java b/libjava/gnu/java/rmi/registry/RegistryImpl_Stub.java
deleted file mode 100644
index b289426b4fc..00000000000
--- a/libjava/gnu/java/rmi/registry/RegistryImpl_Stub.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/* RegistryImpl_Stub.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-
-// Stub class generated by rmic - DO NOT EDIT!
-
-package gnu.java.rmi.registry;
-
-public final class RegistryImpl_Stub
- extends java.rmi.server.RemoteStub
- implements java.rmi.registry.Registry
-{
- private static final long serialVersionUID = 2L;
-
- private static final long interfaceHash = 4905912898345647071L;
-
- private static boolean useNewInvoke;
-
- private static final java.rmi.server.Operation[] operations = {
- new java.rmi.server.Operation("void bind(java.lang.String, java.rmi.Remote)"),
- new java.rmi.server.Operation("java.lang.String[] list()"),
- new java.rmi.server.Operation("java.rmi.Remote lookup(java.lang.String)"),
- new java.rmi.server.Operation("void rebind(java.lang.String, java.rmi.Remote)"),
- new java.rmi.server.Operation("void unbind(java.lang.String)")
- };
-
- private static java.lang.reflect.Method $method_bind_0;
- private static java.lang.reflect.Method $method_list_1;
- private static java.lang.reflect.Method $method_lookup_2;
- private static java.lang.reflect.Method $method_rebind_3;
- private static java.lang.reflect.Method $method_unbind_4;
-
- static {
- try {
- java.rmi.server.RemoteRef.class.getMethod("invoke", new java.lang.Class[] { java.rmi.Remote.class, java.lang.reflect.Method.class, java.lang.Object[].class, long.class });
- useNewInvoke = false;
- $method_bind_0 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("bind", new java.lang.Class[] {java.lang.String.class, java.rmi.Remote.class});
- $method_list_1 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("list", new java.lang.Class[] {});
- $method_lookup_2 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("lookup", new java.lang.Class[] {java.lang.String.class});
- $method_rebind_3 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("rebind", new java.lang.Class[] {java.lang.String.class, java.rmi.Remote.class});
- $method_unbind_4 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("unbind", new java.lang.Class[] {java.lang.String.class});
-
- }
- catch (java.lang.NoSuchMethodException e) {
- useNewInvoke = false;
- }
- }
-
- public RegistryImpl_Stub() {
- super();
- }
- public RegistryImpl_Stub(java.rmi.server.RemoteRef ref) {
- super(ref);
- }
-
- public void bind(java.lang.String $param_0, java.rmi.Remote $param_1) throws java.rmi.AccessException, java.rmi.AlreadyBoundException, java.rmi.RemoteException {
- try {
- if (useNewInvoke) {
- ref.invoke(this, $method_bind_0, new java.lang.Object[] {$param_0, $param_1}, 7583982177005850366L);
- }
- else {
- java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject)this, operations, 0, interfaceHash);
- try {
- java.io.ObjectOutput out = call.getOutputStream();
- out.writeObject($param_0);
- out.writeObject($param_1);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling arguments", e);
- }
- ref.invoke(call);
- try {
- java.io.ObjectInput in = call.getInputStream();
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling return", e);
- }
- finally {
- ref.done(call);
- }
- }
- }
- catch (java.rmi.AccessException e) {
- throw e;
- }
- catch (java.rmi.AlreadyBoundException e) {
- throw e;
- }
- catch (java.rmi.RemoteException e) {
- throw e;
- }
- catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- public java.lang.String[] list() throws java.rmi.AccessException, java.rmi.RemoteException {
- try {
- if (useNewInvoke) {
- java.lang.Object $result = ref.invoke(this, $method_list_1, null, 2571371476350237748L);
- return ((java.lang.String[])$result);
- }
- else {
- java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject)this, operations, 1, interfaceHash);
- try {
- java.io.ObjectOutput out = call.getOutputStream();
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling arguments", e);
- }
- ref.invoke(call);
- java.lang.String[] $result;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $result = (java.lang.String[])in.readObject();
- return ($result);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling return", e);
- }
- finally {
- ref.done(call);
- }
- }
- }
- catch (java.rmi.AccessException e) {
- throw e;
- }
- catch (java.rmi.RemoteException e) {
- throw e;
- }
- catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- public java.rmi.Remote lookup(java.lang.String $param_0) throws java.rmi.AccessException, java.rmi.NotBoundException, java.rmi.RemoteException {
- try {
- if (useNewInvoke) {
- java.lang.Object $result = ref.invoke(this, $method_lookup_2, new java.lang.Object[] {$param_0}, -7538657168040752697L);
- return ((java.rmi.Remote)$result);
- }
- else {
- java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject)this, operations, 2, interfaceHash);
- try {
- java.io.ObjectOutput out = call.getOutputStream();
- out.writeObject($param_0);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling arguments", e);
- }
- ref.invoke(call);
- java.rmi.Remote $result;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $result = (java.rmi.Remote)in.readObject();
- return ($result);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling return", e);
- }
- finally {
- ref.done(call);
- }
- }
- }
- catch (java.rmi.AccessException e) {
- throw e;
- }
- catch (java.rmi.NotBoundException e) {
- throw e;
- }
- catch (java.rmi.RemoteException e) {
- throw e;
- }
- catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- public void rebind(java.lang.String $param_0, java.rmi.Remote $param_1) throws java.rmi.AccessException, java.rmi.RemoteException {
- try {
- if (useNewInvoke) {
- ref.invoke(this, $method_rebind_3, new java.lang.Object[] {$param_0, $param_1}, -8381844669958460146L);
- }
- else {
- java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject)this, operations, 3, interfaceHash);
- try {
- java.io.ObjectOutput out = call.getOutputStream();
- out.writeObject($param_0);
- out.writeObject($param_1);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling arguments", e);
- }
- ref.invoke(call);
- try {
- java.io.ObjectInput in = call.getInputStream();
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling return", e);
- }
- finally {
- ref.done(call);
- }
- }
- }
- catch (java.rmi.AccessException e) {
- throw e;
- }
- catch (java.rmi.RemoteException e) {
- throw e;
- }
- catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- public void unbind(java.lang.String $param_0) throws java.rmi.AccessException, java.rmi.NotBoundException, java.rmi.RemoteException {
- try {
- if (useNewInvoke) {
- ref.invoke(this, $method_unbind_4, new java.lang.Object[] {$param_0}, 7305022919901907578L);
- }
- else {
- java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject)this, operations, 4, interfaceHash);
- try {
- java.io.ObjectOutput out = call.getOutputStream();
- out.writeObject($param_0);
- }
- catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling arguments", e);
- }
- ref.invoke(call);
- try {
- java.io.ObjectInput in = call.getInputStream();
- }
- catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling return", e);
- }
- finally {
- ref.done(call);
- }
- }
- }
- catch (java.rmi.AccessException e) {
- throw e;
- }
- catch (java.rmi.NotBoundException e) {
- throw e;
- }
- catch (java.rmi.RemoteException e) {
- throw e;
- }
- catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
-}
diff --git a/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java b/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java
deleted file mode 100644
index 9cc57b2289f..00000000000
--- a/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* gnu.java.rmi.server.ConnectionRunnerPool
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-//Should I generalize this class?
-
-class ConnectionRunnerPool
-{
-
- public static
- class ConnectionRunner extends Thread{
- private UnicastConnection conn;
- private volatile boolean exiting = false;
-
- public ConnectionRunner(ThreadGroup group, String id){
- super(group, id);
- }
-
- public synchronized void run(){
- while(!exiting){
- if(conn == null)
- try{
- wait();
- }catch(InterruptedException e){
- continue;
- }
- else{
- conn.run();
- conn = null;
- synchronized(ConnectionRunnerPool.class){
- freelist.add(this);
- if(freelist.size() == 1)
- ConnectionRunnerPool.class.notifyAll();
- }
- }
- }
- }
-
- public synchronized void dispatch(UnicastConnection conn){
- this.conn = conn;
- notify();
- }
-
- void exit(){
- exiting = true;
- if(conn != null)
- try{
- join(500);
- }catch(InterruptedException e){}
- interrupt();
- }
-
- }
-
- // Should this value equal to number of CPU?
- private static int size = 5;
- private static int max_size = 10;
-
- // Package-private to avoid a trampoline.
- static ArrayList freelist;
-
- private static ThreadGroup group = new ThreadGroup("pool");
-
- static {
- ConnectionRunner[] pools = new ConnectionRunner[size];
- for(int i = 0; i < pools.length; i++){
- pools[i] = new ConnectionRunner(group, new Integer(i).toString());
- pools[i].setContextClassLoader(Thread.currentThread().getContextClassLoader());
- pools[i].start();
- }
- freelist = new ArrayList(Arrays.asList(pools));
- }
-
- public static void setSize(int size_){
- size = size_;
- }
-
- public static void setMaxSize(int size){
- max_size = size;
- }
-
- private static synchronized ConnectionRunner getConnectionRunner()
- {
- if(freelist.size() == 0){
- if(size < max_size){
- ++size;
- ConnectionRunner a = new ConnectionRunner(group, new Integer(size).toString());
- a.start();
- freelist.add(a);
- }else
- while(freelist.size() == 0)
- try{
- ConnectionRunnerPool.class.wait();
- }catch(InterruptedException e){}
- }
-
- // always let the first in pool most busy or other scheduling plan??
- ConnectionRunner a = (ConnectionRunner)freelist.get(0);
- freelist.remove(a);
- return a;
- }
-
- public static void dispatchConnection(UnicastConnection conn)
- {
- ConnectionRunner r = getConnectionRunner();
- r.dispatch(conn);
- }
-
- public static void exit()
- {
- Thread[] list = new Thread[group.activeCount()];
- group.enumerate(list);
- for(int i = 0; i < list.length; i++)
- ((ConnectionRunner)list[i]).exit();
- }
-
-}
diff --git a/libjava/gnu/java/rmi/server/ProtocolConstants.java b/libjava/gnu/java/rmi/server/ProtocolConstants.java
deleted file mode 100644
index 30fb5e89b39..00000000000
--- a/libjava/gnu/java/rmi/server/ProtocolConstants.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ProtocolConstants.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-public interface ProtocolConstants
-{
- int PROTOCOL_HEADER = 0x4a524d49; // JRMI
- int PROTOCOL_VERSION = 2;
-
- int STREAM_PROTOCOL = 0x4b;
- int SINGLE_OP_PROTOCOL = 0x4c;
- int MULTIPLEX_PROTOCOL = 0x4d;
-
- int PROTOCOL_ACK = 0x4e;
- int PROTOCOL_NACK = 0x4f;
-
- int MESSAGE_CALL = 0x50;
- int MESSAGE_CALL_ACK = 0x51;
- int MESSAGE_PING = 0x52;
- int MESSAGE_PING_ACK = 0x53;
- int MESSAGE_DGCACK = 0x54;
-
- int RETURN_ACK = 0x01;
- int RETURN_NACK = 0x02;
-
- int DEFAULT_PROTOCOL = STREAM_PROTOCOL;
-}
diff --git a/libjava/gnu/java/rmi/server/RMIDefaultSocketFactory.java b/libjava/gnu/java/rmi/server/RMIDefaultSocketFactory.java
deleted file mode 100644
index 628e1cc8799..00000000000
--- a/libjava/gnu/java/rmi/server/RMIDefaultSocketFactory.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* RMIDefaultSocketFactory.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.rmi.server.RMISocketFactory;
-
-public class RMIDefaultSocketFactory
- extends RMISocketFactory {
-
-public RMIDefaultSocketFactory() {
-}
-
-public Socket createSocket(String host, int port) throws IOException {
- return (new Socket(host, port));
-}
-
-public ServerSocket createServerSocket(int port) throws IOException {
- return (new ServerSocket(port));
-}
-
-}
diff --git a/libjava/gnu/java/rmi/server/RMIHashes.java b/libjava/gnu/java/rmi/server/RMIHashes.java
deleted file mode 100644
index 5a414404d4f..00000000000
--- a/libjava/gnu/java/rmi/server/RMIHashes.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* RMIHashes.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import gnu.java.lang.reflect.TypeSignature;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.lang.reflect.Method;
-import java.security.MessageDigest;
-
-public class RMIHashes
-{
- //There're other places using DigestOutputStream to generate hash in classpath, but I think the way I used
- //here is more efficient, anyway, you can switch to DigestOutputStream by doing like "//or:" comments say.
-
- //or:add this statement: private static final NullOutputStream nullOutputStream = new NullOutputStream ();
- public static long getMethodHash(Method meth)
- {
- //Object Serialization Spec 8.3
- try
- {
- MessageDigest md = MessageDigest.getInstance ("SHA");
- //or:remove this statement: DigestOutputStream digest_out = new DigestOutputStream (nullOutputStream, md);
- ByteArrayOutputStream digest_out = new ByteArrayOutputStream();
- DataOutputStream data_out = new DataOutputStream (digest_out);
-
- StringBuffer sbuf = new StringBuffer();
- sbuf.append(meth.getName());
- sbuf.append('(');
- Class params[] = meth.getParameterTypes();
- for(int i = 0; i < params.length; i++)
- sbuf.append(TypeSignature.getEncodingOfClass(params[i]));
- sbuf.append(')');
- Class rcls = meth.getReturnType();
- if(rcls != Void.TYPE)
- sbuf.append(TypeSignature.getEncodingOfClass(rcls));
- else
- sbuf.append('V');
-
- data_out.writeUTF (sbuf.toString());
- data_out.flush();
- data_out.close ();
-
- md.update(digest_out.toByteArray()); //or:remove this statement
- byte[] sha = md.digest ();
- long result = 0;
- int len = sha.length < 8 ? sha.length : 8;
- for (int i=0; i < len; i++)
- result += (long)(sha[i] & 0xFF) << (8 * i);
- return result;
- }catch(Exception _){
- return -1L;
- }
- }
-
- public static long getInterfaceHash(Class clazz)
- {
- return clazz.hashCode ();
- }
-}
-
diff --git a/libjava/gnu/java/rmi/server/RMIIncomingThread.java b/libjava/gnu/java/rmi/server/RMIIncomingThread.java
deleted file mode 100644
index 990d37bc521..00000000000
--- a/libjava/gnu/java/rmi/server/RMIIncomingThread.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* RMIIncomingThread.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-public class RMIIncomingThread extends Thread {
-
- private String clientHost = null;
-
- public RMIIncomingThread(Runnable runnable, String s_clientHost) {
- super(runnable);
- clientHost = s_clientHost;
- }
-
- public String toString() {
- return "RMIIncoming from " + clientHost + " " + super.toString();
- }
-
- public String getClientHost() {
- return clientHost;
- }
-
-
-}
diff --git a/libjava/gnu/java/rmi/server/RMIObjectInputStream.java b/libjava/gnu/java/rmi/server/RMIObjectInputStream.java
deleted file mode 100644
index 888b30bf6b6..00000000000
--- a/libjava/gnu/java/rmi/server/RMIObjectInputStream.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* RMIObjectInputStream.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectStreamClass;
-import java.lang.reflect.Proxy;
-import java.net.MalformedURLException;
-import java.rmi.server.RMIClassLoader;
-
-public class RMIObjectInputStream
- extends ObjectInputStream {
-
-public RMIObjectInputStream(InputStream strm) throws IOException {
- super(strm);
- enableResolveObject(true);
-}
-
-protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
- String annotation = (String)getAnnotation();
-
- try {
- if(annotation == null)
- return (RMIClassLoader.loadClass(desc.getName()));
- else
- return (RMIClassLoader.loadClass(annotation, desc.getName()));
- }
- catch (MalformedURLException _) {
- throw new ClassNotFoundException(desc.getName());
- }
-}
-
-//Separate it for override by MarshalledObject
-protected Object getAnnotation()
- throws IOException, ClassNotFoundException
-{
- return readObject();
-}
-
-protected Class resolveProxyClass(String intfs[])
- throws IOException, ClassNotFoundException
-{
- String annotation = (String)getAnnotation();
-
- Class clss[] = new Class[intfs.length];
- if(annotation == null)
- clss[0] = RMIClassLoader.loadClass(intfs[0]);
- else
- clss[0] = RMIClassLoader.loadClass(annotation, intfs[0]);
-
- //assume all interfaces can be loaded by the same classloader
- ClassLoader loader = clss[0].getClassLoader();
- for (int i = 0; i < intfs.length; i++)
- clss[i] = Class.forName(intfs[i], false, loader);
-
- try {
- return Proxy.getProxyClass(loader, clss);
- } catch (IllegalArgumentException e) {
- throw new ClassNotFoundException(null, e);
- }
-}
-
-protected Object readValue(Class valueClass) throws IOException, ClassNotFoundException {
- if(valueClass.isPrimitive()){
- if(valueClass == Boolean.TYPE)
- return new Boolean(readBoolean());
- if(valueClass == Byte.TYPE)
- return new Byte(readByte());
- if(valueClass == Character.TYPE)
- return new Character(readChar());
- if(valueClass == Short.TYPE)
- return new Short(readShort());
- if(valueClass == Integer.TYPE)
- return new Integer(readInt());
- if(valueClass == Long.TYPE)
- return new Long(readLong());
- if(valueClass == Float.TYPE)
- return new Float(readFloat());
- if(valueClass == Double.TYPE)
- return new Double(readDouble());
- else
- throw new Error("Unsupported primitive class: " + valueClass);
- } else
- return readObject();
-}
-
-}
diff --git a/libjava/gnu/java/rmi/server/RMIObjectOutputStream.java b/libjava/gnu/java/rmi/server/RMIObjectOutputStream.java
deleted file mode 100644
index d42908a4147..00000000000
--- a/libjava/gnu/java/rmi/server/RMIObjectOutputStream.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* RMIObjectOutputStream.java -
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.rmi.Remote;
-import java.rmi.server.RMIClassLoader;
-import java.rmi.server.RemoteStub;
-
-public class RMIObjectOutputStream
- extends ObjectOutputStream {
-
-public RMIObjectOutputStream(OutputStream strm) throws IOException {
- super(strm);
- enableReplaceObject(true);
-}
-
-//Separate it for override by MarshalledObject
-protected void setAnnotation(String annotation) throws IOException{
- writeObject(annotation);
-}
-
-protected void annotateClass(Class cls) throws IOException {
- setAnnotation(RMIClassLoader.getClassAnnotation(cls));
-}
-
-protected void annotateProxyClass(Class cls)
- throws IOException
-{
- annotateClass(cls);
-}
-
-protected Object replaceObject(Object obj)
- throws IOException
-{
- if((obj instanceof Remote) && !(obj instanceof RemoteStub)){
- UnicastServerRef ref = UnicastServer.getExportedRef((Remote)obj);
- if (ref != null)
- return ref.getStub();
- }
- return obj;
-}
-
-protected void writeValue(Object value, Class valueClass) throws IOException{
- if(valueClass.isPrimitive()){
- if(valueClass == Boolean.TYPE)
- writeBoolean(((Boolean)value).booleanValue());
- else
- if(valueClass == Byte.TYPE)
- writeByte(((Byte)value).byteValue());
- else
- if(valueClass == Character.TYPE)
- writeChar(((Character)value).charValue());
- else
- if(valueClass == Short.TYPE)
- writeShort(((Short)value).shortValue());
- else
- if(valueClass == Integer.TYPE)
- writeInt(((Integer)value).intValue());
- else
- if(valueClass == Long.TYPE)
- writeLong(((Long)value).longValue());
- else
- if(valueClass == Float.TYPE)
- writeFloat(((Float)value).floatValue());
- else
- if(valueClass == Double.TYPE)
- writeDouble(((Double)value).doubleValue());
- else
- throw new Error("Unsupported primitive class: " + valueClass);
- } else
- writeObject(value);
-}
-
-}
diff --git a/libjava/gnu/java/rmi/server/RMIVoidValue.java b/libjava/gnu/java/rmi/server/RMIVoidValue.java
deleted file mode 100644
index 8e5546d3523..00000000000
--- a/libjava/gnu/java/rmi/server/RMIVoidValue.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* RMIVoidValue.java --
- Copyright (c) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-/**
- * Package private class used to indicate a void return type.
- * INSTANCE is the only object of this class ever made.
- */
-final class RMIVoidValue
-{
- static RMIVoidValue INSTANCE = new RMIVoidValue();
-
- private RMIVoidValue()
- {
- }
-}
diff --git a/libjava/gnu/java/rmi/server/UnicastConnection.java b/libjava/gnu/java/rmi/server/UnicastConnection.java
deleted file mode 100644
index 216e453e72f..00000000000
--- a/libjava/gnu/java/rmi/server/UnicastConnection.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/* UnicastConnection.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.net.Socket;
-import java.rmi.RemoteException;
-
-public class UnicastConnection
- implements Runnable, ProtocolConstants {
-
-UnicastConnectionManager manager;
-Socket sock;
-DataInputStream din;
-DataOutputStream dout;
-ObjectInputStream oin;
-ObjectOutputStream oout;
-
-// reviveTime and expireTime make UnicastConnection pool-able
-long reviveTime = 0;
-long expireTime = Long.MAX_VALUE;
-
-UnicastConnection(UnicastConnectionManager man, Socket sock) {
- this.manager = man;
- this.sock = sock;
-}
-
-void acceptConnection() throws IOException {
-//System.out.println("Accepting connection on " + sock);
- //Use BufferedXXXStream would be more efficient
- din = new DataInputStream(new BufferedInputStream(sock.getInputStream()));
- dout = new DataOutputStream(new BufferedOutputStream(sock.getOutputStream()));
-
- int sig = din.readInt();
- if (sig != PROTOCOL_HEADER) {
- throw new IOException("bad protocol header");
- }
- short ver = din.readShort();
- if (ver != PROTOCOL_VERSION) {
- throw new IOException("bad protocol version");
- }
- int protocol = din.readUnsignedByte();
- if (protocol != SINGLE_OP_PROTOCOL) {
- // Send an ACK
- dout.writeByte(PROTOCOL_ACK);
-
- // Send my hostname and port
- dout.writeUTF(manager.serverName);
- dout.writeInt(manager.serverPort);
- dout.flush();
-
- // Read their hostname and port
- String rhost = din.readUTF();
- int rport = din.readInt();
- }
- // Okay, ready to roll ...
-}
-
-void makeConnection(int protocol) throws IOException {
- //Use BufferedXXXStream would be more efficient
- din = new DataInputStream(new BufferedInputStream(sock.getInputStream()));
-
- dout = new DataOutputStream(new BufferedOutputStream(sock.getOutputStream()));
-
- // Send header
- dout.writeInt(PROTOCOL_HEADER);
- dout.writeShort(PROTOCOL_VERSION);
- dout.writeByte(protocol);
- dout.flush();
-
- if (protocol != SINGLE_OP_PROTOCOL) {
- // Get back ack.
- int ack = din.readUnsignedByte();
- if (ack != PROTOCOL_ACK) {
- throw new RemoteException("Unsupported protocol");
- }
-
- // Read in host and port
- String dicard_rhost = din.readUTF();
- int discard_rport = din.readInt();
-
- // Send them my endpoint
- dout.writeUTF(manager.serverName);
- dout.writeInt(manager.serverPort);
- dout.flush();
- }
- // Okay, ready to roll ...
-}
-
-DataInputStream getDataInputStream() throws IOException {
- return (din);
-}
-
-DataOutputStream getDataOutputStream() throws IOException {
- return (dout);
-}
-
-/*
-*
-* get ObjectInputStream for reading more objects
-*
-*/
-ObjectInputStream getObjectInputStream() throws IOException {
- if (oin == null) {
- throw new IOException("no ObjectInputtream for reading more objects");
- }
- return (oin);
-}
-
-/**
-*
-* starts ObjectInputStream.
-*
-*/
-ObjectInputStream startObjectInputStream() throws IOException {
- return (oin = new RMIObjectInputStream(din));
-}
-
-/**
-*
-* get ObjectOutputStream for sending more objects
-*
-*/
-ObjectOutputStream getObjectOutputStream() throws IOException {
- if (oout == null) {
- throw new IOException("no ObjectOutputStream for sending more objects");
- }
- return (oout);
-}
-
-/**
-*
-* starts ObjectOutputStream.
-*
-*/
-ObjectOutputStream startObjectOutputStream() throws IOException {
- return (oout = new RMIObjectOutputStream(dout));
-}
-
-void disconnect() {
- try {
- if(oout != null)
- oout.close();
- sock.close();
- }
- catch (IOException _) {
- }
-
- oin = null;
- oout = null;
- din = null;
- dout = null;
- sock = null;
-}
-
-public static final long CONNECTION_TIMEOUT = 10000L;
-
-static boolean isExpired(UnicastConnection conn, long l){
- if (l <= conn.expireTime )
- return false;
- return true;
-}
-
-static void resetTime(UnicastConnection conn){
- long l = System.currentTimeMillis();
- conn.reviveTime = l;
- conn.expireTime = l + CONNECTION_TIMEOUT;
-}
-
-/**
- * We run connects on the server. Dispatch it then discard it.
- */
-public void run() {
- do{
- try {
- UnicastServer.dispatch(this);
- //don't discardConnection explicitly, only when
- // exception happens or the connection's expireTime
- // comes
- } catch (Exception e ){
- manager.discardConnection(this);
- break;
- }
- }while(true);
-}
-
-
-}
diff --git a/libjava/gnu/java/rmi/server/UnicastConnectionManager.java b/libjava/gnu/java/rmi/server/UnicastConnectionManager.java
deleted file mode 100644
index 08f6a9bc394..00000000000
--- a/libjava/gnu/java/rmi/server/UnicastConnectionManager.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/* UnicastConnectionManager.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.rmi.RemoteException;
-import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RMIServerSocketFactory;
-import java.rmi.server.RMISocketFactory;
-import java.util.ArrayList;
-import java.util.ConcurrentModificationException;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-public class UnicastConnectionManager
- implements Runnable, ProtocolConstants {
-
-private static String localhost;
-// use different maps for server/client type UnicastConnectionManager
-private static Hashtable servers = new Hashtable();
-// Package-private to avoid trampolines.
-static Hashtable clients = new Hashtable();
-ArrayList connections; //client connection pool
-
-// make serverThread volatile for poll
-private volatile Thread serverThread;
-private ServerSocket ssock;
-String serverName;
-int serverPort;
-
-// Package-private to avoid a trampoline.
-static Thread scavenger;
-
-// If client and server are in the same VM, serverobj represents server
-Object serverobj;
-
-private static RMISocketFactory defaultSocketFactory = RMISocketFactory.getSocketFactory();
-private RMIServerSocketFactory serverFactory;
-private RMIClientSocketFactory clientFactory;
-
-// The following is for debug
-private static int ncsock = 0; //count of client socket
-private static int nssock = 0; //count of server socket
-private static int ncmanager = 0; //count of client manager
-private static int nsmanager = 0; //count of server manager
-
-private static final boolean debug = false;
-
-private static final Object GLOBAL_LOCK = new Object();
-
-static {
- try {
- //Use host address instead of host name to avoid name resolving issues
- //localhost = InetAddress.getLocalHost().getHostName();
- localhost = InetAddress.getLocalHost().getHostAddress();
- }
- catch (UnknownHostException _) {
- localhost = "localhost";
- }
-
-
-}
-
-//Only one scavenger thread running globally
-private static void startScavenger(){
- scavenger = new Thread(new Runnable(){
- public void run(){
- if (debug) System.out.println("************* start scavenger.");
- boolean liveon = true;
- while (liveon){
- // Sleep for the expire timeout
- try{
- Thread.sleep(UnicastConnection.CONNECTION_TIMEOUT);
- }catch(InterruptedException _ie){
- break;
- }
- liveon = false;
- // Scavenge all clients' connections that're expired
- Iterator iter = clients.values().iterator();
- long l = System.currentTimeMillis();
- try{
- while(iter.hasNext()){
- UnicastConnectionManager man = (UnicastConnectionManager)iter.next();
- ArrayList conns = man.connections;
- synchronized(conns) { // is the lock a little coarser?
- for (int last = conns.size() - 1;
- last >= 0;
- --last)
- {
- UnicastConnection conn = (UnicastConnection)conns.get(last);
- if (UnicastConnection.isExpired(conn, l)){
- conns.remove(last);
- conn.disconnect();
- conn = null;
- }else
- liveon = true; //there're still live connections
- }
- }
- }
- }catch(ConcurrentModificationException cme) {
- // handle it lazily
- liveon = true;
- }
- }
- scavenger = null;
- if (debug) System.out.println("************* exit scavenger.");
- }
- });
- // As it is used for client connection, we may put this thread
- // in daemon state to prevent the VM from blocking when exiting.
- scavenger.setDaemon(true);
- scavenger.start();
-}
-
-/**
- * Client UnicastConnectionManager constructor
- */
-private UnicastConnectionManager(String host, int port, RMIClientSocketFactory csf) {
- ssock = null;
- serverName = host;
- serverPort = port;
- serverFactory = null;
- clientFactory = csf;
- connections = new ArrayList();
-}
-
-/**
- * Server UnicastConnectionManager constructor
- */
-private UnicastConnectionManager(int port, RMIServerSocketFactory ssf) throws RemoteException {
-
- try {
- ssock = ssf.createServerSocket(port);
- serverPort = ssock.getLocalPort();
- }
- catch (IOException ioex) {
- ssock = null;
- serverPort = 0;
- throw new java.rmi.server.ExportException("can not create Server Socket on port " + port,ioex);
- }
- serverName = localhost;
- serverFactory = ssf;
- clientFactory = null;
-}
-
-/**
- * Return a client connection manager which will connect to the given
- * host/port.
- */
-public static synchronized UnicastConnectionManager getInstance(String host, int port, RMIClientSocketFactory csf) {
-//System.out.println("getInstance: " + host + "," + port + "," + csf);
- if (csf == null) {
- csf = defaultSocketFactory;
- }
- // change host name to host address to avoid name resolving issues
- try{
- host = InetAddress.getByName(host).getHostAddress();
- }catch(Exception _){}
-
- TripleKey key = new TripleKey(host, port, csf);
- UnicastConnectionManager man = (UnicastConnectionManager)clients.get(key);
- if (man == null) {
- man = new UnicastConnectionManager(host, port, csf);
- if (debug) {
- ncmanager++;
- System.out.println("\n\n ====== " + ncmanager + " client managers.\n\n");
- }
- clients.put(key, man);
-
- // Detect if client and server are in the same VM, i.e., their keys are equal
- UnicastConnectionManager svrman = (UnicastConnectionManager)servers.get(key);
- if(svrman != null){ // server and client are in the same VM
- man.serverobj = svrman.serverobj;
- }
- }
- return (man);
-}
-
-/**
- * Return a server connection manager which will accept connection on the
- * given port.
- */
-public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) throws RemoteException {
-//System.out.println("getInstance: " + port + "," + ssf);
- if (ssf == null) {
- ssf = defaultSocketFactory;
- }
- TripleKey key = new TripleKey(localhost, port, ssf);
- UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key);
- if (man == null) {
- man = new UnicastConnectionManager(port, ssf);
- if (debug) {
- nsmanager++;
- System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n");
- }
- // The provided port might not be the set port.
- key.port = man.serverPort;
- servers.put(key, man);
- }
- return (man);
-}
-
-/**
- * Get a connection from this manager.
- */
-public UnicastConnection getConnection() throws IOException {
- if (ssock == null) {
- return (getClientConnection());
- }
- else {
- return (getServerConnection());
- }
-}
-
-/**
- * Accept a connection to this server.
- */
-private UnicastConnection getServerConnection() throws IOException {
- Socket sock = ssock.accept();
- sock.setTcpNoDelay(true); //??
- UnicastConnection conn = new UnicastConnection(this, sock);
- conn.acceptConnection();
- if (debug){
- nssock++;
- System.out.println("\n\n ****** " + nssock + " server socks.\n\n");
- }
- //System.out.println("Server connection " + sock);
- return (conn);
-}
-
-/**
- * Make a conection from this client to the server.
- */
-private UnicastConnection getClientConnection() throws IOException {
- ArrayList conns = connections;
- UnicastConnection conn;
-
- synchronized(conns) {
- int nconn = conns.size() - 1;
-
- // if there're free connections in connection pool
- if(nconn >= 0) {
- conn = (UnicastConnection)conns.get(nconn);
- //Should we check if conn is alive using Ping??
- conns.remove(nconn);
-
- // Check if the connection is already expired
- long l = System.currentTimeMillis();
- if (!UnicastConnection.isExpired(conn, l)){
- return conn;
- }else {
- conn.disconnect();
- conn = null;
- }
- }
- }
-
- Socket sock = clientFactory.createSocket(serverName, serverPort);
- conn = new UnicastConnection(this, sock);
- conn.makeConnection(DEFAULT_PROTOCOL);
-
- if (debug) {
- ncsock++;
- System.out.println("\n\n ====== " + ncsock + " client socks.\n\n");
- }
-
- return (conn);
-}
-
-/**
- * Discard a connection when we're done with it - maybe it can be
- * recycled.
- */
-public void discardConnection(UnicastConnection conn) {
-//System.out.println("Discarding connection " + conn);
- //conn.disconnect();
- if (ssock != null) //server connection
- conn.disconnect();
- else {
- // To client connection, we'd like to return back to pool
- UnicastConnection.resetTime(conn);
- //Ensure there're only one scavenger globally
- synchronized(GLOBAL_LOCK) {
- connections.add(conn); //borrow this lock to garantee thread safety
- if (scavenger == null)
- startScavenger();
- }
- }
-}
-
-/**
- * Start a server on this manager if it's a server socket and we've not
- * already got one running.
- */
-public void startServer() {
- synchronized(this) {
- if (ssock == null || serverThread != null) {
- return;
- }
- serverThread = new Thread(this);
- // The following is not necessary when java.lang.Thread's constructor do this.
- // serverThread.setContextClassLoader(Thread.currentThread().getContextClassLoader());
- }
- serverThread.start();
-}
-
-/**
- * Stop a server on this manager
- */
-public void stopServer() {
- synchronized(this) {
- if(serverThread != null){
- serverThread = null;
- try{
- ssock.close();
- }catch(Exception _){}
- }
- }
-}
-
-/**
- * Server thread for connection manager.
- */
-public void run() {
- for (;serverThread != null;) { // if serverThread==null, then exit thread
- try {
-//System.out.println("Waiting for connection on " + serverPort);
- UnicastConnection conn = getServerConnection();
-
- // get address of remote host for the RMIIncomingThread object
- String remoteHost = null;
- if (conn.sock != null) {
- remoteHost = conn.sock.getInetAddress().getHostAddress();
- }
-
- // use a thread pool to improve performance
- //ConnectionRunnerPool.dispatchConnection(conn);
- (new RMIIncomingThread(conn, remoteHost)).start();
-// (new Thread(conn)).start();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
-
-/**
- * Serialization routine.
- */
-void write(ObjectOutput out) throws IOException {
- out.writeUTF(serverName);
- out.writeInt(serverPort);
-}
-
-/**
- * Serialization routine.
- */
-static UnicastConnectionManager read(ObjectInput in) throws IOException {
- String host = in.readUTF();
- int port = in.readInt();
- //RMIClientSocketFactory csf = ((RMIObjectInputStream)in).manager.clientFactory;
- //return (getInstance(host, port, csf));
- return (getInstance(host, port, null));
-}
-
-}
-
-/**
- * This is use as the hashkey for the client/server connections.
- */
-class TripleKey {
-
-String host;
-int port;
-Object other;
-
-TripleKey(String host, int port, Object other) {
- this.host = host;
- this.port = port;
- this.other = other;
-}
-
-/**
- * Hash code just include the host and other - we ignore the port since
- * this has unusual matching behaviour.
- */
-public int hashCode() {
- return (host.hashCode() ^ other.hashCode());
-}
-
-public boolean equals(Object obj) {
- if (obj instanceof TripleKey) {
- TripleKey other = (TripleKey)obj;
- if (this.host.equals(other.host) &&
- this.other == other.other &&
- (this.port == other.port /* || this.port == 0 || other.port == 0*/)) {
- return (true);
- }
- }
- return (false);
-}
-
-}
diff --git a/libjava/gnu/java/rmi/server/UnicastRef.java b/libjava/gnu/java/rmi/server/UnicastRef.java
deleted file mode 100644
index c1b871fb8e5..00000000000
--- a/libjava/gnu/java/rmi/server/UnicastRef.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/* UnicastRef.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2002, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.server.ObjID;
-import java.rmi.server.Operation;
-import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RemoteCall;
-import java.rmi.server.RemoteObject;
-import java.rmi.server.RemoteRef;
-import java.rmi.server.UID;
-
-public class UnicastRef
- implements RemoteRef, ProtocolConstants {
-
-public ObjID objid;
-UnicastConnectionManager manager;
-
-/**
- * Used by serialization, and let subclass capable of having default constructor
- */
-// must be public otherwise java.rmi.RemoteObject cannot instantiate this class
-// -- iP
-public UnicastRef() {
-}
-
-public UnicastRef(ObjID objid, String host, int port, RMIClientSocketFactory csf) {
- this(objid);
- manager = UnicastConnectionManager.getInstance(host, port, csf);
-}
-
-public UnicastRef(ObjID objid) {
- this.objid = objid;
-}
-
-public Object invoke(Remote obj, Method method, Object[] params, long opnum) throws Exception {
- // Check if client and server are in the same VM, then local call can be used to
- // replace remote call, but it's somewhat violating remote semantic.
- Object svrobj = manager.serverobj;
-
- // Make sure that the server object is compatible. It could be loaded from a different
- // classloader --iP
- if(svrobj != null && method.getDeclaringClass().isInstance(svrobj)){
- //local call
- Object ret = null;
- try{
- ret = method.invoke(svrobj, params);
- }catch(InvocationTargetException e){
- throw (Exception)e.getTargetException();
- }
- //System.out.println("\n\n ***** local call: " + method + "\nreturn: " + ret + "\n\n");
- return ret;
- }
- //System.out.println("***************** remote call:" + manager.serverPort);
- return (invokeCommon(obj, method, params, -1, opnum));
-}
-
-private Object invokeCommon(Remote obj, Method method, Object[] params, int opnum, long hash) throws Exception {
- UnicastConnection conn;
- try {
- conn = manager.getConnection();
- }
- catch (IOException e1) {
- throw new RemoteException("connection failed to host: " + manager.serverName, e1);
- }
-
- ObjectOutputStream out;
- DataOutputStream dout;
- try {
- dout = conn.getDataOutputStream();
- dout.writeByte(MESSAGE_CALL);
-
- out = conn.startObjectOutputStream(); // (re)start ObjectOutputStream
-
- objid.write(out);
- out.writeInt(opnum);
- out.writeLong(hash);
-
- // must handle primitive class and their wrapper classes
- Class clss[] = method.getParameterTypes();
- for(int i = 0; i < clss.length; i++)
- ((RMIObjectOutputStream)out).writeValue(params[i], clss[i]);
-
- out.flush();
- }
- catch (IOException e2) {
- throw new RemoteException("call failed: ", e2);
- }
-
- int returncode;
- Object returnval;
- DataInputStream din;
- ObjectInputStream in;
- UID ack;
- try {
- din = conn.getDataInputStream();
-
- if ((returncode = din.readUnsignedByte()) != MESSAGE_CALL_ACK) {
- conn.disconnect();
- throw new RemoteException("Call not acked:" + returncode);
- }
-
- in = conn.startObjectInputStream(); // (re)start ObjectInputStream
- returncode = in.readUnsignedByte();
- ack = UID.read(in);
-
- Class cls = method.getReturnType();
-
- if (returncode == RETURN_NACK) {
- returnval = in.readObject(); // get Exception
-
- } else if(cls == Void.TYPE) {
- returnval = null;
- // in.readObject() // not required! returntype 'void' means no field is returned.
- } else {
- returnval = ((RMIObjectInputStream)in).readValue(cls); // get returnvalue
- }
- } catch (IOException e3) {
- //for debug: e3.printStackTrace();
- throw new RemoteException("call return failed: ", e3);
- }
-
- /* if DGCAck is necessary??
- //According to RMI wire protocol, send a DGCAck
- // to indicate receiving return value
- dout.writeByte(MESSAGE_DGCACK);
- ack.write(dout);
- out.flush();
- */
-
- manager.discardConnection(conn);
-
- if (returncode != RETURN_ACK && returnval != null) {
- if (returncode == RETURN_NACK) throw (Exception)returnval;
- else throw new RemoteException("unexpected returncode: " + returncode);
- }
-
- return (returnval);
-}
-
-/**
- * @deprecated
- */
-public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash) throws RemoteException {
- UnicastConnection conn;
-
- try {
- conn = manager.getConnection();
- }
- catch (IOException e1) {
- throw new RemoteException("connection failed to host: " + manager.serverName, e1);
- }
-
- //obj: useless?
-
- return (new UnicastRemoteCall(conn, objid, opnum, hash));
-}
-
-/**
- * @deprecated
- */
-public void invoke(RemoteCall call) throws Exception {
- UnicastRemoteCall c = (UnicastRemoteCall)call;
- call.executeCall();
-}
-
-/**
- * @deprecated
- */
-public void done(RemoteCall call) throws RemoteException {
- UnicastRemoteCall c = (UnicastRemoteCall)call;
- try{
- c.done();
- } catch(IOException e){}
- UnicastConnection conn = c.getConnection();
- manager.discardConnection(conn);
-}
-
-public void writeExternal(ObjectOutput out) throws IOException {
- if (manager == null) {
- throw new IOException("no connection");
- }
- manager.write(out);
- objid.write(out);
- // This byte is somewhat confusing when interoperating with JDK
- out.writeByte(0); //RETURN_ACK);
-}
-
-public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- manager = UnicastConnectionManager.read(in);
- objid = ObjID.read(in);
- byte ack = in.readByte();
- // This byte is somewhat confusing when interoperating with JDK
- if (ack != RETURN_ACK && ack != 0/*jdk ack value*/) {
- throw new IOException("no ack found");
- }
-}
-
-public boolean remoteEquals(RemoteRef ref) {
- throw new Error("Not implemented");
-}
-
-public int remoteHashCode() {
- throw new Error("Not implemented");
-}
-
-public String getRefClass(ObjectOutput out) {
- return ("UnicastRef");
-}
-
-public String remoteToString() {
- throw new Error("Not implemented");
-}
-
-public void dump(UnicastConnection conn) {
- try {
- DataInputStream din = conn.getDataInputStream();
- for (;;) {
- int b = din.readUnsignedByte();
- System.out.print(Integer.toHexString(b));
- if (b >= 32 && b < 128) {
- System.out.print(": " + (char)b);
- }
- System.out.println();
- }
- }
- catch (IOException _) {
- }
-}
-
-}
diff --git a/libjava/gnu/java/rmi/server/UnicastRemoteCall.java b/libjava/gnu/java/rmi/server/UnicastRemoteCall.java
deleted file mode 100644
index c5206e76df2..00000000000
--- a/libjava/gnu/java/rmi/server/UnicastRemoteCall.java
+++ /dev/null
@@ -1,525 +0,0 @@
-/* UnicastRemoteCall.java
- Copyright (c) 1996, 1997, 1998, 1999, 2002, 2004, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.StreamCorruptedException;
-import java.rmi.MarshalException;
-import java.rmi.RemoteException;
-import java.rmi.UnmarshalException;
-import java.rmi.server.ObjID;
-import java.rmi.server.RemoteCall;
-import java.rmi.server.UID;
-import java.util.Vector;
-
-public class UnicastRemoteCall
- implements RemoteCall, ProtocolConstants
-{
-
- private UnicastConnection conn;
- private Object result;
- private Object object;
- private int opnum;
- private long hash;
- // These are package-private due to inner class access.
- Vector vec;
- int ptr;
- private ObjID objid;
-
- private ObjectOutput oout;
- private ObjectInput oin;
-
- /**
- * Incoming call.
- */
- UnicastRemoteCall(UnicastConnection conn)
- {
- this.conn = conn;
- }
-
- /**
- * Outgoing call.
- */
- UnicastRemoteCall(UnicastConnection conn, ObjID objid, int opnum, long hash)
- throws RemoteException
- {
- this.conn = conn;
- this.opnum = opnum;
- this.hash = hash;
- this.objid = objid;
- }
-
- UnicastConnection getConnection()
- {
- return conn;
- }
-
- public ObjectOutput getOutputStream() throws IOException
- {
- if (vec == null)
- vec = new Vector();
- return (new DummyObjectOutputStream());
- }
-
- public void releaseOutputStream() throws IOException
- {
- if (vec != null)
- {
- oout = conn.getObjectOutputStream();
-
- for (int i = 0; i < vec.size(); i += 2)
- {
- boolean primitive = ((Boolean)vec.elementAt(i)).booleanValue();
- Object data = vec.elementAt(i+1);
-
- // No type, this is
- if (!primitive)
- oout.writeObject(data);
- else
- {
- if (data instanceof Boolean)
- oout.writeBoolean(((Boolean)data).booleanValue());
- else if (data instanceof Character)
- oout.writeChar(((Character)data).charValue());
- else if (data instanceof Byte)
- oout.writeByte(((Byte)data).byteValue());
- else if (data instanceof Short)
- oout.writeShort(((Short)data).shortValue());
- else if (data instanceof Integer)
- oout.writeInt(((Integer)data).intValue());
- else if (data instanceof Long)
- oout.writeLong(((Long)data).longValue());
- }
- }
- vec = null;
- }
- if(oout != null)
- oout.flush();
- }
-
- /**
- *
- * (re)starts ObjectInputStream
- *
- */
- public ObjectInput startInputStream() throws IOException
- {
- if (conn != null) {
- return (oin = conn.startObjectInputStream());
- } else {
- return getInputStream(); // dummy Input Stream
- }
-
- }
-
- public ObjectInput getInputStream() throws IOException
- {
- if (conn != null)
- {
- if(oin == null)
- return (oin = conn.getObjectInputStream());
- else
- return oin;
- }
- else
- {
- ptr = 0;
- return (new DummyObjectInputStream());
- }
- }
-
- public void releaseInputStream() throws IOException
- {
- // Does nothing.
- }
-
- public ObjectOutput getResultStream(boolean success)
- throws IOException, StreamCorruptedException
- {
- vec = new Vector();
- return new DummyObjectOutputStream();
- }
-
- public void executeCall() throws Exception
- {
- byte returncode;
- ObjectInput oin;
-
- // signal the call when constructing
- try
- {
- DataOutputStream dout = conn.getDataOutputStream();
- dout.write(MESSAGE_CALL);
-
- oout = conn.startObjectOutputStream(); // (re)start ObjectOutputStream
- objid.write(oout);
- oout.writeInt(opnum);
- oout.writeLong(hash);
- }
- catch(IOException ex)
- {
- throw new MarshalException("Try to write header but failed.", ex);
- }
-
- try
- {
- releaseOutputStream();
- DataInputStream din = conn.getDataInputStream();
- if (din.readByte() != MESSAGE_CALL_ACK)
- throw new RemoteException("Call not acked");
-
- oin = startInputStream();
- returncode = oin.readByte();
- UID.read(oin);
- }
- catch(IOException ex)
- {
- throw new UnmarshalException("Try to read header but failed:", ex);
- }
-
- //check return code
- switch(returncode)
- {
- case RETURN_ACK: //it's ok
- return;
- case RETURN_NACK:
- Object returnobj;
- try
- {
- returnobj = oin.readObject();
- }
- catch(Exception ex2)
- {
- throw new UnmarshalException
- ("Try to read exception object but failed", ex2);
- }
-
- if(!(returnobj instanceof Exception))
- throw new UnmarshalException("Should be Exception type here: "
- + returnobj);
- throw (Exception)returnobj;
-
- default:
- throw new UnmarshalException("Invalid return code");
- }
- }
-
- public void done() throws IOException
- {
- // conn.disconnect();
- }
-
- boolean isReturnValue()
- {
- return vec.size() > 0;
- }
-
- Object returnValue()
- {
- // This is not the first one (Boolean) but the second.
- return vec.elementAt(1);
- }
-
- Object[] getArguments()
- {
- return vec.toArray();
- }
-
- Object getObject()
- {
- return object;
- }
-
- int getOpnum()
- {
- return opnum;
- }
-
- long getHash()
- {
- return hash;
- }
-
- void setReturnValue(Object obj)
- {
- vec.removeAllElements();
- vec.addElement(obj);
- }
-
- /**
- * Dummy object output class.
- */
- private class DummyObjectOutputStream implements ObjectOutput
- {
- /**
- * Non-private constructor to reduce bytecode emitted.
- */
- DummyObjectOutputStream()
- {
- }
-
- public void writeBoolean(boolean v) throws IOException
- {
- vec.addElement(Boolean.TRUE);
- vec.addElement(Boolean.valueOf(v));
- }
-
- public void writeByte(int v) throws IOException
- {
- vec.addElement(Boolean.TRUE);
- vec.addElement(new Byte((byte) v));
- }
-
- public void writeChar(int v) throws IOException
- {
- vec.addElement(Boolean.TRUE);
- vec.addElement(new Character((char) v));
- }
-
- public void writeDouble(double v) throws IOException
- {
- vec.addElement(Boolean.TRUE);
- vec.addElement(new Double(v));
- }
-
- public void writeFloat(float v) throws IOException
- {
- vec.addElement(Boolean.TRUE);
- vec.addElement(new Float(v));
- }
-
- public void writeInt(int v) throws IOException
- {
- vec.addElement(Boolean.TRUE);
- vec.addElement(new Integer(v));
- }
-
- public void writeLong(long v) throws IOException
- {
- vec.addElement(Boolean.TRUE);
- vec.addElement(new Long(v));
- }
-
- public void writeShort(int v) throws IOException
- {
- vec.addElement(Boolean.TRUE);
- vec.addElement(new Short((short) v));
- }
-
- public void writeObject(Object obj) throws IOException
- {
- vec.addElement(Boolean.FALSE);
- vec.addElement(obj);
- }
-
- public void write(byte b[]) throws IOException
- {
- throw new IOException("not required");
- }
-
- public void write(byte b[], int off, int len) throws IOException
- {
- throw new IOException("not required");
- }
-
- public void write(int b) throws IOException
- {
- throw new IOException("not required");
- }
-
- public void writeBytes(String s) throws IOException
- {
- throw new IOException("not required");
- }
-
- public void writeChars(String s) throws IOException
- {
- throw new IOException("not required");
- }
-
- public void writeUTF(String str) throws IOException
- {
- throw new IOException("not required");
- }
-
- public void flush() throws IOException
- {
- }
-
- public void close() throws IOException
- {
- }
- } // class DummyObjectOutputStream
-
- /**
- * Dummy object input class.
- */
- private class DummyObjectInputStream implements ObjectInput
- {
- /**
- * Non-private constructor to reduce bytecode emitted.
- */
- DummyObjectInputStream()
- {
- }
-
- public boolean readBoolean() throws IOException
- {
- Object obj = vec.elementAt(ptr++);
- return ((Boolean) obj).booleanValue();
- }
-
- public byte readByte() throws IOException
- {
- Object obj = vec.elementAt(ptr++);
- return ((Byte) obj).byteValue();
- }
-
- public char readChar() throws IOException
- {
- Object obj = vec.elementAt(ptr++);
- return ((Character) obj).charValue();
- }
-
- public double readDouble() throws IOException
- {
- Object obj = vec.elementAt(ptr++);
- return ((Double) obj).doubleValue();
- }
-
- public float readFloat() throws IOException
- {
- Object obj = vec.elementAt(ptr++);
- return ((Float) obj).floatValue();
- }
-
- public int readInt() throws IOException
- {
- Object obj = vec.elementAt(ptr++);
- return ((Integer) obj).intValue();
- }
-
- public long readLong() throws IOException
- {
- Object obj = vec.elementAt(ptr++);
- return ((Long) obj).longValue();
- }
-
- public short readShort() throws IOException
- {
- Object obj = vec.elementAt(ptr++);
- return ((Short) obj).shortValue();
- }
-
- public Object readObject() throws IOException
- {
- return vec.elementAt(ptr++);
- }
-
- public int read(byte b[]) throws IOException
- {
- throw new IOException("not required");
- }
-
- public int read(byte b[], int off, int len) throws IOException
- {
- throw new IOException("not required");
- }
-
- public int read() throws IOException
- {
- throw new IOException("not required");
- }
-
- public long skip(long n) throws IOException
- {
- throw new IOException("not required");
- }
-
- public int available() throws IOException
- {
- throw new IOException("not required");
- }
-
- public void readFully(byte b[]) throws IOException
- {
- throw new IOException("not required");
- }
-
- public void readFully(byte b[], int off, int len) throws IOException
- {
- throw new IOException("not required");
- }
-
- public String readLine() throws IOException
- {
- throw new IOException("not required");
- }
-
- public String readUTF() throws IOException
- {
- throw new IOException("not required");
- }
-
- public int readUnsignedByte() throws IOException
- {
- throw new IOException("not required");
- }
-
- public int readUnsignedShort() throws IOException
- {
- throw new IOException("not required");
- }
-
- public int skipBytes(int n) throws IOException
- {
- throw new IOException("not required");
- }
-
- public void close() throws IOException
- {
- }
- } // class DummyObjectInputStream
-
-}
diff --git a/libjava/gnu/java/rmi/server/UnicastRemoteStub.java b/libjava/gnu/java/rmi/server/UnicastRemoteStub.java
deleted file mode 100644
index 87e932de559..00000000000
--- a/libjava/gnu/java/rmi/server/UnicastRemoteStub.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* UnicastRemoteStub.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import java.rmi.server.RemoteRef;
-import java.rmi.server.RemoteStub;
-
-public class UnicastRemoteStub
- extends RemoteStub {
-
-public static void setStubRef(RemoteStub stub, RemoteRef ref) {
- setRef(stub, ref);
-}
-
-}
diff --git a/libjava/gnu/java/rmi/server/UnicastServer.java b/libjava/gnu/java/rmi/server/UnicastServer.java
deleted file mode 100644
index 065ef8c77ee..00000000000
--- a/libjava/gnu/java/rmi/server/UnicastServer.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/* UnicastServer.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import gnu.java.rmi.dgc.DGCImpl;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.rmi.NoSuchObjectException;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.ServerError;
-import java.rmi.server.ObjID;
-import java.rmi.server.UID;
-import java.util.Hashtable;
-
-public class UnicastServer
- implements ProtocolConstants {
-
-static private Hashtable objects = new Hashtable(); //mapping OBJID to server ref
-static private Hashtable refcache = new Hashtable(); //mapping obj itself to server ref
-static private DGCImpl dgc;
-
-public static void exportObject(UnicastServerRef obj) {
- startDGC();
- objects.put(obj.objid, obj);
- refcache.put(obj.myself, obj);
- obj.manager.startServer();
-}
-
-// FIX ME: I haven't handle force parameter
-public static boolean unexportObject(UnicastServerRef obj, boolean force) {
- objects.remove(obj.objid);
- refcache.remove(obj.myself);
- obj.manager.stopServer();
- return true;
-}
-
-public static UnicastServerRef getExportedRef(Remote remote){
- return (UnicastServerRef)refcache.get(remote);
-}
-
-private static synchronized void startDGC() {
- if (dgc == null) {
- try {
- dgc = new DGCImpl();
- // Changed DGCImpl to inherit UnicastServerRef directly
- //((UnicastServerRef)dgc.getRef()).exportObject(dgc);
- dgc.exportObject(dgc);
- }
- catch (RemoteException e) {
- e.printStackTrace();
- }
- }
-}
-
-public static void dispatch(UnicastConnection conn) throws Exception {
- switch (conn.getDataInputStream().readUnsignedByte()) {
- case MESSAGE_CALL:
- incomingMessageCall(conn);
- break;
- case MESSAGE_PING:
- // jdk sends a ping before each method call -> answer it!
- DataOutputStream out = conn.getDataOutputStream();
- out.writeByte(MESSAGE_PING_ACK);
- out.flush();
- break;
- default:
- throw new Exception("bad method type");
- }
-}
-
-private static void incomingMessageCall(UnicastConnection conn) throws IOException {
- ObjectInputStream in = conn.startObjectInputStream(); // (re)start ObjectInputStream
-
- ObjID objid = ObjID.read(in);
- int method = in.readInt();
- long hash = in.readLong();
-
-//System.out.println("ObjID: " + objid + ", method: " + method + ", hash: " + hash);
-
- // Use the objid to locate the relevant UnicastServerRef
- UnicastServerRef uref = (UnicastServerRef)objects.get(objid);
- Object returnval;
- int returncode = RETURN_ACK;
- // returnval is from Method.invoke(), so we must check the return class to see
- // if it's primitive type
- Class returncls = null;
- if (uref != null) {
- try {
- // Dispatch the call to it.
- returnval = uref.incomingMessageCall(conn, method, hash);
- returncls = uref.getMethodReturnType(method, hash);
- }
- catch (Exception e) {
- returnval = e;
- returncode = RETURN_NACK;
- }
- catch (Error e) {
- returnval = new ServerError ("An Error is thrown while processing the invocation on the server", e);
- returncode = RETURN_NACK;
- }
- }
- else {
- returnval = new NoSuchObjectException("");
- returncode = RETURN_NACK;
- }
-
- conn.getDataOutputStream().writeByte(MESSAGE_CALL_ACK);
-
- ObjectOutputStream out = conn.startObjectOutputStream(); // (re)start ObjectOutputStream
-
- out.writeByte(returncode);
- (new UID()).write(out);
-
- //System.out.println("returnval=" + returnval + " returncls=" + returncls);
-
- if(returnval != null && returncls != null)
- ((RMIObjectOutputStream)out).writeValue(returnval, returncls);
-
- // 1.1/1.2 void return type detection:
- else if (!(returnval instanceof RMIVoidValue || returncls == Void.TYPE))
- out.writeObject(returnval);
-
- out.flush();
-}
-
-}
diff --git a/libjava/gnu/java/rmi/server/UnicastServerRef.java b/libjava/gnu/java/rmi/server/UnicastServerRef.java
deleted file mode 100644
index 1f6eedec68a..00000000000
--- a/libjava/gnu/java/rmi/server/UnicastServerRef.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/* UnicastServerRef.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.rmi.server;
-
-import java.io.ObjectInputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.server.ObjID;
-import java.rmi.server.RMIServerSocketFactory;
-import java.rmi.server.RemoteRef;
-import java.rmi.server.RemoteServer;
-import java.rmi.server.RemoteStub;
-import java.rmi.server.ServerNotActiveException;
-import java.rmi.server.ServerRef;
-import java.rmi.server.Skeleton;
-import java.util.Hashtable;
-
-public class UnicastServerRef
- extends UnicastRef
- implements ServerRef{ //SHOULD implement ServerRef
-
-final static private Class[] stubprototype = new Class[] { RemoteRef.class };
-
-Remote myself; //save the remote object itself
-private Skeleton skel;
-private RemoteStub stub;
-private Hashtable methods = new Hashtable();
-
-/**
- * Used by serialization.
- */
-UnicastServerRef()
-{
-}
-
-public UnicastServerRef(ObjID id, int port, RMIServerSocketFactory ssf) throws RemoteException {
- super(id);
- manager = UnicastConnectionManager.getInstance(port, ssf);
-}
-
-public RemoteStub exportObject(Remote obj) throws RemoteException {
- if (myself == null) {
- myself = obj;
- // Save it to server manager, to let client calls in the same VM to issue
- // local call
- manager.serverobj = obj;
-
- // Find and install the stub
- Class cls = obj.getClass();
- Class expCls;
- try {
- // where ist the _Stub? (check superclasses also)
- expCls = findStubSkelClass(cls);
- } catch (Exception ex) {
- throw new RemoteException("can not find stubs for class: " + cls, ex);
- }
-
- stub = (RemoteStub)getHelperClass(expCls, "_Stub");
- if (stub == null) {
- throw new RemoteException("failed to export: " + cls);
- }
-
- // Find and install the skeleton (if there is one)
- skel = (Skeleton)getHelperClass(expCls, "_Skel");
-
- // Build hash of methods which may be called.
- buildMethodHash(obj.getClass(), true);
-
- // Export it.
- UnicastServer.exportObject(this);
- }
-
- return (stub);
-}
-
-public RemoteStub exportObject(Remote remote, Object obj)
- throws RemoteException
-{
- //FIX ME
- return exportObject(remote);
-}
-
-public RemoteStub getStub(){
- return stub;
-}
-
-
-public boolean unexportObject(Remote obj, boolean force) {
- // Remove all hashes of methods which may be called.
- buildMethodHash(obj.getClass(), false);
- return UnicastServer.unexportObject(this, force);
-}
-
-/**
-*
-* The Subs/Skels might not there for the actual class, but maybe
-* for one of the superclasses.
-*
-*/
-private Class findStubSkelClass(Class startCls) throws Exception {
- Class cls = startCls;
-
- while (true) {
- try {
- String stubClassname = cls.getName() + "_Stub";
- ClassLoader cl = cls.getClassLoader();
- Class scls = cl == null ? Class.forName(stubClassname)
- : cl.loadClass(stubClassname);
- return cls; // found it
- } catch (ClassNotFoundException e) {
- Class superCls = cls.getSuperclass();
- if (superCls == null
- || superCls == java.rmi.server.UnicastRemoteObject.class)
- {
- throw new Exception("Neither " + startCls
- + " nor one of their superclasses (like" + cls + ")"
- + " has a _Stub");
- }
- cls = superCls;
- }
- }
-}
-
-
-
-private Object getHelperClass(Class cls, String type) {
- try {
- String classname = cls.getName();
- ClassLoader cl = cls.getClassLoader();
- Class scls = cl == null ? Class.forName(classname + type)
- : cl.loadClass(classname + type);
- if (type.equals("_Stub")) {
- try {
- // JDK 1.2 stubs
- Constructor con = scls.getConstructor(stubprototype);
- return (con.newInstance(new Object[]{this}));
- }
- catch (NoSuchMethodException e) {
- }
- catch (InstantiationException e) {
- }
- catch (IllegalAccessException e) {
- }
- catch (IllegalArgumentException e) {
- }
- catch (InvocationTargetException e) {
- }
- // JDK 1.1 stubs
- RemoteStub stub = (RemoteStub)scls.newInstance();
- UnicastRemoteStub.setStubRef(stub, this);
- return (stub);
- }
- else {
- // JDK 1.1 skel
- return (scls.newInstance());
- }
- }
- catch (ClassNotFoundException e) {
- }
- catch (InstantiationException e) {
- }
- catch (IllegalAccessException e) {
- }
- return (null);
-}
-
-
-
-public String getClientHost() throws ServerNotActiveException {
- return RemoteServer.getClientHost();
-}
-
-private void buildMethodHash(Class cls, boolean build) {
- Method[] meths = cls.getMethods();
- for (int i = 0; i < meths.length; i++) {
- /* Don't need to include any java.xxx related stuff */
- if (meths[i].getDeclaringClass().getName().startsWith("java.")) {
- continue;
- }
- long hash = RMIHashes.getMethodHash(meths[i]);
- if(build)
- methods.put(new Long (hash), meths[i]);
- else
- methods.remove(new Long (hash));
-//System.out.println("meth = " + meths[i] + ", hash = " + hash);
- }
-}
-
-Class getMethodReturnType(int method, long hash) throws Exception
-{
- if (method == -1) {
- Method meth = (Method)methods.get(new Long (hash));
- return meth.getReturnType();
- }else
- return null;
-}
-
-public Object incomingMessageCall(UnicastConnection conn, int method, long hash) throws Exception {
-//System.out.println("method = " + method + ", hash = " + hash);
- // If method is -1 then this is JDK 1.2 RMI - so use the hash
- // to locate the method
- if (method == -1) {
- Method meth = (Method)methods.get(new Long (hash));
-//System.out.println("class = " + myself.getClass() + ", meth = " + meth);
- if (meth == null) {
- throw new NoSuchMethodException();
- }
-
- ObjectInputStream in = conn.getObjectInputStream();
- int nrargs = meth.getParameterTypes().length;
- Object[] args = new Object[nrargs];
- for (int i = 0; i < nrargs; i++) {
- /**
- * For debugging purposes - we don't handle CodeBases
- * quite right so we don't always find the stubs. This
- * lets us know that.
- */
- try {
- // need to handle primitive types
- args[i] = ((RMIObjectInputStream)in).readValue(meth.getParameterTypes()[i]);
-
- }
- catch (Exception t) {
- t.printStackTrace();
- throw t;
- }
- }
- //We must reinterpret the exception thrown by meth.invoke()
- //return (meth.invoke(myself, args));
- Object ret = null;
- try{
- ret = meth.invoke(myself, args);
- }catch(InvocationTargetException e){
- Throwable cause = e.getTargetException();
- if (cause instanceof Exception) {
- throw (Exception)cause;
- }
- else if (cause instanceof Error) {
- throw (Error)cause;
- }
- else {
- throw new Error("The remote method threw a java.lang.Throwable that is neither java.lang.Exception nor java.lang.Error.", e);
- }
- }
- return ret;
- }
- // Otherwise this is JDK 1.1 style RMI - we find the skeleton
- // and invoke it using the method number. We wrap up our
- // connection system in a UnicastRemoteCall so it appears in a
- // way the Skeleton can handle.
- else {
- if (skel == null) {
- throw new NoSuchMethodException();
- }
- UnicastRemoteCall call = new UnicastRemoteCall(conn);
- skel.dispatch(myself, call, method, hash);
- if (!call.isReturnValue())
- return RMIVoidValue.INSTANCE;
- else
- return (call.returnValue());
- }
-}
-
-}
-
-
diff --git a/libjava/gnu/java/security/Engine.java b/libjava/gnu/java/security/Engine.java
deleted file mode 100644
index b75de5caa95..00000000000
--- a/libjava/gnu/java/security/Engine.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/* Engine -- generic getInstance method.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
-import java.security.NoSuchAlgorithmException;
-import java.security.Provider;
-
-/**
- * Generic implementation of the getInstance methods in the various
- * engine classes in java.security.
- * <p>
- * These classes ({@link java.security.Signature} for example) can be
- * thought of as the "chrome, upholstery, and steering wheel", and the SPI
- * (service provider interface, e.g. {@link java.security.SignatureSpi})
- * classes can be thought of as the "engine" -- providing the actual
- * functionality of whatever cryptographic algorithm the instance
- * represents.
- *
- * @see Provider
- * @author Casey Marshall
- */
-public final class Engine
-{
-
- // Constants.
- // ------------------------------------------------------------------------
-
- /** Prefix for aliases. */
- private static final String ALG_ALIAS = "Alg.Alias.";
-
- /** Maximum number of aliases to try. */
- private static final int MAX_ALIASES = 5;
-
- /** Argument list for no-argument constructors. */
- private static final Object[] NO_ARGS = new Object[0];
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /** This class cannot be instantiated. */
- private Engine() { }
-
- // Class method.
- // ------------------------------------------------------------------------
-
- /**
- * Get the implementation for <i>algorithm</i> for service
- * <i>service</i> from <i>provider</i>. The service is e.g.
- * "Signature", and the algorithm "DSA".
- *
- * @param service The service name.
- * @param algorithm The name of the algorithm to get.
- * @param provider The provider to get the implementation from.
- * @return The engine class for the specified algorithm; the object
- * returned is typically a subclass of the SPI class for that
- * service, but callers should check that this is so.
- * @throws NoSuchAlgorithmException If the implementation cannot be
- * found or cannot be instantiated.
- * @throws InvocationTargetException If the SPI class's constructor
- * throws an exception.
- * @throws IllegalArgumentException If any of the three arguments are null.
- */
- public static Object getInstance(String service, String algorithm,
- Provider provider)
- throws InvocationTargetException, NoSuchAlgorithmException
- {
- return getInstance(service, algorithm, provider, NO_ARGS);
- }
-
- /**
- * Get the implementation for <i>algorithm</i> for service
- * <i>service</i> from <i>provider</i>, passing <i>initArgs</i> to the
- * SPI class's constructor (which cannot be null; pass a zero-length
- * array if the SPI takes no arguments). The service is e.g.
- * "Signature", and the algorithm "DSA".
- *
- * @param service The service name.
- * @param algorithm The name of the algorithm to get.
- * @param provider The provider to get the implementation from.
- * @param initArgs The arguments to pass to the SPI class's
- * constructor (cannot be null).
- * @return The engine class for the specified algorithm; the object
- * returned is typically a subclass of the SPI class for that
- * service, but callers should check that this is so.
- * @throws NoSuchAlgorithmException If the implementation cannot be
- * found or cannot be instantiated.
- * @throws InvocationTargetException If the SPI class's constructor
- * throws an exception.
- * @throws IllegalArgumentException If any of the four arguments are null.
- */
- public static Object getInstance(String service, String algorithm,
- Provider provider, Object[] initArgs)
- throws InvocationTargetException, NoSuchAlgorithmException
- {
- if (service == null || algorithm == null
- || provider == null || initArgs == null)
- throw new IllegalArgumentException();
-
- // If there is no property "service.algorithm"
- if (provider.getProperty(service + "." + algorithm) == null)
- {
- // Iterate through aliases, until we find the class name or resolve
- // too many aliases.
- String alias = null;
- int count = 0;
- while ((alias = provider.getProperty(
- ALG_ALIAS + service + "." + algorithm)) != null)
- {
- if (algorithm.equals(alias)) // Refers to itself!
- break;
- algorithm = alias;
- if (count++ > MAX_ALIASES)
- throw new NoSuchAlgorithmException("too many aliases");
- }
- if (provider.getProperty(service + "." + algorithm) == null)
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- // Find and instantiate the implementation.
- Class clazz = null;
- ClassLoader loader = provider.getClass().getClassLoader();
- Constructor constructor = null;
- String error = algorithm;
-
- try
- {
- if (loader != null)
- clazz = loader.loadClass(provider.getProperty(service+"."+algorithm));
- else
- clazz = Class.forName(provider.getProperty(service+"."+algorithm));
- constructor = getCompatibleConstructor(clazz, initArgs);
- return constructor.newInstance(initArgs);
- }
- catch (ClassNotFoundException cnfe)
- {
- error = "class not found: " + algorithm;
- }
- catch (IllegalAccessException iae)
- {
- error = "illegal access: " + iae.getMessage();
- }
- catch (InstantiationException ie)
- {
- error = "instantiation exception: " + ie.getMessage();
- }
- catch (ExceptionInInitializerError eiie)
- {
- error = "exception in initializer: " + eiie.getMessage();
- }
- catch (SecurityException se)
- {
- error = "security exception: " + se.getMessage();
- }
- catch (NoSuchMethodException nsme)
- {
- error = "no appropriate constructor found";
- }
-
- throw new NoSuchAlgorithmException(error);
- }
-
- // Own methods.
- // ------------------------------------------------------------------------
-
- /**
- * Find a constructor in the given class that can take the specified
- * argument list, allowing any of which to be null.
- *
- * @param clazz The class from which to get the constructor.
- * @param initArgs The argument list to be passed to the constructor.
- * @return The constructor.
- * @throws NoSuchMethodException If no constructor of the given class
- * can take the specified argument array.
- */
- private static Constructor getCompatibleConstructor(Class clazz,
- Object[] initArgs)
- throws NoSuchMethodException
- {
- Constructor[] c = clazz.getConstructors();
- outer:for (int i = 0; i < c.length; i++)
- {
- Class[] argTypes = c[i].getParameterTypes();
- if (argTypes.length != initArgs.length)
- continue;
- for (int j = 0; j < argTypes.length; j++)
- {
- if (initArgs[j] != null &&
- !argTypes[j].isAssignableFrom(initArgs[j].getClass()))
- continue outer;
- }
- // If we reach this point, we know this constructor (c[i]) has
- // the same number of parameters as the target parameter list,
- // and all our parameters are either (1) null, or (2) assignable
- // to the target parameter type.
- return c[i];
- }
- throw new NoSuchMethodException();
- }
-}
diff --git a/libjava/gnu/java/security/OID.java b/libjava/gnu/java/security/OID.java
deleted file mode 100644
index 8cda43eeee8..00000000000
--- a/libjava/gnu/java/security/OID.java
+++ /dev/null
@@ -1,509 +0,0 @@
-/* OID.java -- numeric representation of an object identifier
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security;
-
-import gnu.java.security.der.DEREncodingException;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.StringTokenizer;
-
-/**
- * This immutable class represents an object identifier, or OID.
- *
- * <p>OIDs are represented as a series of hierarcical tokens, each of
- * which is usually represented as a single, unsigned integer. The
- * hierarchy works so that later tokens are considered within the group
- * of earlier tokens. Thus, the OID for the Serpent block cipher,
- * 1.3.6.1.4.1.11591.13.2, is maintained by the GNU project, whose OID
- * is 1.3.6.1.4.1.11591 (which is, in turn, part of bigger, more general
- * bodies; the topmost, 1, stands for the OIDs assigned by the
- * International Standards Organization, ISO).
- *
- * <p>OIDs can be represented in a variety of ways, including the
- * dotted-decimal form we use here.
- *
- * <p>OIDs may be relative, in which case the first two elements of the
- * OID are omitted.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class OID implements Cloneable, Comparable, java.io.Serializable
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /**
- * The numeric ID structure.
- */
- private int[] components;
-
- /**
- * The string representation of this OID, in dotted-decimal format.
- */
- private transient String strRep;
-
- /**
- * The DER encoding of this OID.
- */
- private transient byte[] der;
-
- /**
- * Whether or not this OID is relative.
- */
- private boolean relative;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new OID from the given byte array. The argument (which can
- * neither be null nor zero-length) is copied to prevent subsequent
- * modification.
- *
- * @param components The numeric IDs.
- * @throws IllegalArgumentException If <i>components</i> is null or empty.
- */
- public OID(int[] components)
- {
- this(components, false);
- }
-
- /**
- * Create a new OID from the given byte array. The argument (which can
- * neither be null nor zero-length) is copied to prevent subsequent
- * modification.
- *
- * @param components The numeric IDs.
- * @param relative The relative flag.
- * @throws IllegalArgumentException If <i>components</i> is null or empty.
- */
- public OID(int[] components, boolean relative)
- {
- if (components == null || components.length == 0)
- throw new IllegalArgumentException();
- this.components = (int[]) components.clone();
- this.relative = relative;
- }
-
- /**
- * Create a new OID from the given dotted-decimal representation.
- *
- * @param strRep The string representation of the OID.
- * @throws IllegalArgumentException If the string does not contain at
- * least one integer.
- * @throws NumberFormatException If the string does not contain only
- * numbers and periods ('.').
- */
- public OID(String strRep)
- {
- this(strRep, false);
- }
-
- /**
- * Create a new OID from the given dotted-decimal representation.
- *
- * @param strRep The string representation of the OID.
- * @param relative The relative flag.
- * @throws IllegalArgumentException If the string does not contain at
- * least one integer.
- * @throws NumberFormatException If the string does not contain only
- * numbers and periods ('.').
- */
- public OID(String strRep, boolean relative)
- {
- this.relative = relative;
- this.strRep = strRep;
- components = fromString(strRep);
- }
-
- /**
- * Construct a new OID from the DER bytes in an input stream. This method
- * does not read the tag or the length field from the input stream, so
- * the caller must supply the number of octets in this OID's encoded
- * form.
- *
- * @param derIn The DER input stream.
- * @param len The number of bytes in the encoded form.
- * @throws IOException If an error occurs reading the OID.
- */
- public OID(InputStream derIn, int len) throws IOException
- {
- this(derIn, len, false);
- }
-
- /**
- * Construct a new OID from the DER bytes in an input stream. This method
- * does not read the tag or the length field from the input stream, so
- * the caller must supply the number of octets in this OID's encoded
- * form.
- *
- * @param derIn The DER input stream.
- * @param len The number of bytes in the encoded form.
- * @param relative The relative flag.
- * @throws IOException If an error occurs reading the OID.
- */
- public OID(InputStream derIn, int len, boolean relative) throws IOException
- {
- der = new byte[len];
- derIn.read(der);
- this.relative = relative;
- try
- {
- components = fromDER(der, relative);
- }
- catch (ArrayIndexOutOfBoundsException aioobe)
- {
- aioobe.printStackTrace();
- throw aioobe;
- }
- }
-
- /**
- * Construct a new OID from the given DER bytes.
- *
- * @param encoded The DER encoded OID.
- * @throws IOException If an error occurs reading the OID.
- */
- public OID(byte[] encoded) throws IOException
- {
- this(encoded, false);
- }
-
- /**
- * Construct a new OID from the given DER bytes.
- *
- * @param root The root OID.
- * @param encoded The encoded relative OID.
- * @param relative The relative flag.
- */
- public OID(byte[] encoded, boolean relative) throws IOException
- {
- der = (byte[]) encoded.clone();
- this.relative = relative;
- try
- {
- components = fromDER(der, relative);
- }
- catch (ArrayIndexOutOfBoundsException aioobe)
- {
- aioobe.printStackTrace();
- throw aioobe;
- }
- }
-
- /**
- * Our private constructor.
- */
- private OID()
- {
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return the numeric IDs of this OID. The value returned is copied to
- * prevent modification.
- *
- * @return The IDs in a new integer array.
- */
- public int[] getIDs()
- {
- return (int[]) components.clone();
- }
-
- /**
- * Get the DER encoding of this OID, minus the tag and length fields.
- *
- * @return The DER bytes.
- */
- public byte[] getDER()
- {
- if (der == null)
- {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- int i = 0;
- if (!relative)
- {
- int b = components[i++] * 40 + (components.length > 1
- ? components[i++] : 0);
- encodeSubID(bout, b);
- }
- for ( ; i < components.length; i++)
- encodeSubID(bout, components[i]);
- der = bout.toByteArray();
- }
- return (byte[]) der.clone();
- }
-
- /**
- * Get the parent OID of this OID. That is, if this OID is "1.2.3.4",
- * then the parent OID will be "1.2.3". If this OID is a top-level
- * OID, this method returns null.
- *
- * @return The parent OID, or null.
- */
- public OID getParent()
- {
- if (components.length == 1)
- return null;
- int[] parent = new int[components.length - 1];
- System.arraycopy(components, 0, parent, 0, parent.length);
- return new OID(parent);
- }
-
- public OID getChild(int id)
- {
- int[] child = new int[components.length + 1];
- System.arraycopy(components, 0, child, 0, components.length);
- child[child.length - 1] = id;
- return new OID(child);
- }
-
- /**
- * Get the root OID of this OID. That is, the first two components.
- *
- * @return The root OID.
- */
- public OID getRoot()
- {
- if (components.length <= 2)
- return this;
- int[] root = new int[2];
- root[0] = components[0];
- root[1] = components[1];
- return new OID(root);
- }
-
- public boolean isRelative()
- {
- return relative;
- }
-
- /**
- * Returns a copy of this OID.
- *
- * @return The copy.
- */
- public Object clone()
- {
- OID oid = new OID();
- oid.components = this.components;
- oid.strRep = this.strRep;
- return oid;
- }
-
- /* Nice idea, but possibly too expensive for whatever benefit it
- * provides.
-
- public String getShortName()
- {
- return OIDTable.getShortName(this);
- }
-
- public String getLongName()
- {
- return OIDTable.getLongName(this);
- }
-
- */
-
- /**
- * Returns the value of this OID in dotted-decimal format.
- *
- * @return The string representation.
- */
- public String toString()
- {
- if (strRep != null)
- return strRep;
- else
- {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < components.length; i++)
- {
- buf.append((long) components[i] & 0xFFFFFFFFL);
- if (i < components.length - 1)
- buf.append('.');
- }
- return (strRep = buf.toString());
- }
- }
-
- /**
- * Computes a hash code for this OID.
- *
- * @return The hash code.
- */
- public int hashCode()
- {
- int ret = 0;
- for (int i = 0; i < components.length; i++)
- ret += components[i] << (i & 31);
- return ret;
- }
-
- /**
- * Tests whether or not this OID equals another.
- *
- * @return Whether or not this OID equals the other.
- */
- public boolean equals(Object o)
- {
- if (!(o instanceof OID))
- return false;
- return java.util.Arrays.equals(components, ((OID) o).components);
- }
-
- /**
- * Compares this OID to another. The comparison is essentially
- * lexicographic, where the two OIDs are compared until their
- * first difference, then that difference is returned. If one OID is
- * shorter, but all elements equal between the two for the shorter
- * length, then the shorter OID is lesser than the longer.
- *
- * @param o The object to compare.
- * @return An integer less than, equal to, or greater than zero if
- * this object is less than, equal to, or greater than the
- * argument.
- * @throws ClassCastException If <i>o</i> is not an OID.
- */
- public int compareTo(Object o)
- {
- if (equals(o))
- return 0;
- int[] components2 = ((OID) o).components;
- int len = Math.min(components.length, components2.length);
- for (int i = 0; i < len; i++)
- {
- if (components[i] != components2[i])
- return (components[i] < components2[i]) ? -1 : 1;
- }
- if (components.length == components2.length)
- return 0;
- return (components.length < components2.length) ? -1 : 1;
- }
-
- // Own methods.
- // ------------------------------------------------------------------------
-
- private static int[] fromDER(byte[] der, boolean relative)
- throws DEREncodingException
- {
- // cannot be longer than this.
- int[] components = new int[der.length + 1];
- int count = 0;
- int i = 0;
- if (!relative && i < der.length)
- {
- // Non-relative OIDs have the first two arcs coded as:
- //
- // i = first_arc * 40 + second_arc;
- //
- int j = (der[i] & 0xFF);
- components[count++] = j / 40;
- components[count++] = j % 40;
- i++;
- }
- while (i < der.length)
- {
- int j = 0;
- do
- {
- j = der[i++] & 0xFF;
- components[count] <<= 7;
- components[count] |= j & 0x7F;
- if (i >= der.length && (j & 0x80) != 0)
- throw new DEREncodingException("malformed OID");
- }
- while ((j & 0x80) != 0);
- count++;
- }
- if (count == components.length)
- return components;
- int[] ret = new int[count];
- System.arraycopy(components, 0, ret, 0, count);
- return ret;
- }
-
- private static int[] fromString(String strRep) throws NumberFormatException
- {
- if (strRep.startsWith("OID.") || strRep.startsWith("oid."))
- strRep = strRep.substring(4);
- StringTokenizer tok = new StringTokenizer(strRep, ".");
- if (tok.countTokens() == 0)
- throw new IllegalArgumentException();
- int[] components = new int[tok.countTokens()];
- int i = 0;
- while (tok.hasMoreTokens())
- {
- components[i++] = Integer.parseInt(tok.nextToken());
- }
- return components;
- }
-
- private static void encodeSubID(ByteArrayOutputStream out, int id)
- {
- if (id < 128)
- {
- out.write(id);
- }
- else if (id < 16384)
- {
- out.write((id >>> 7) | 0x80);
- out.write(id & 0x7F);
- }
- else if (id < 2097152)
- {
- out.write((id >>> 14) | 0x80);
- out.write(((id >>> 7) | 0x80) & 0xFF);
- out.write(id & 0x7F);
- }
- else if (id < 268435456)
- {
- out.write( (id >>> 21) | 0x80);
- out.write(((id >>> 14) | 0x80) & 0xFF);
- out.write(((id >>> 7) | 0x80) & 0xFF);
- out.write(id & 0x7F);
- }
- }
-}
diff --git a/libjava/gnu/java/security/PolicyFile.java b/libjava/gnu/java/security/PolicyFile.java
deleted file mode 100644
index dd3a4dec4c4..00000000000
--- a/libjava/gnu/java/security/PolicyFile.java
+++ /dev/null
@@ -1,667 +0,0 @@
-/* PolicyFile.java -- policy file reader
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.StreamTokenizer;
-import java.lang.reflect.Constructor;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.CodeSource;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.Permission;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-import java.security.Policy;
-import java.security.Principal;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.security.Security;
-import java.security.UnresolvedPermission;
-import java.security.cert.Certificate;
-import java.security.cert.X509Certificate;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-/**
- * An implementation of a {@link java.security.Policy} object whose
- * permissions are specified by a <em>policy file</em>.
- *
- * <p>The approximate syntax of policy files is:</p>
- *
- * <pre>
- * policyFile ::= keystoreOrGrantEntries ;
- *
- * keystoreOrGrantEntries ::= keystoreOrGrantEntry |
- * keystoreOrGrantEntries keystoreOrGrantEntry |
- * EMPTY ;
- *
- * keystoreOrGrantEntry ::= keystoreEntry | grantEntry ;
- *
- * keystoreEntry ::= "keystore" keystoreUrl ';' |
- * "keystore" keystoreUrl ',' keystoreAlgorithm ';' ;
- *
- * keystoreUrl ::= URL ;
- * keystoreAlgorithm ::= STRING ;
- *
- * grantEntry ::= "grant" domainParameters '{' permissions '}' ';'
- *
- * domainParameters ::= domainParameter |
- * domainParameter ',' domainParameters ;
- *
- * domainParameter ::= "signedBy" signerNames |
- * "codeBase" codeBaseUrl |
- * "principal" principalClassName principalName |
- * "principal" principalName ;
- *
- * signerNames ::= quotedString ;
- * codeBaseUrl ::= URL ;
- * principalClassName ::= STRING ;
- * principalName ::= quotedString ;
- *
- * quotedString ::= quoteChar STRING quoteChar ;
- * quoteChar ::= '"' | '\'';
- *
- * permissions ::= permission | permissions permission ;
- *
- * permission ::= "permission" permissionClassName permissionTarget permissionAction |
- * "permission" permissionClassName permissionTarget |
- * "permission" permissionClassName;
- * </pre>
- *
- * <p>Comments are either form of Java comments. Keystore entries only
- * affect subsequent grant entries, so if a grant entry preceeds a
- * keystore entry, that grant entry is not affected by that keystore
- * entry. Certian instances of <code>${property-name}</code> will be
- * replaced with <code>System.getProperty("property-name")</code> in
- * quoted strings.</p>
- *
- * <p>This class will load the following files when created or
- * refreshed, in order:</p>
- *
- * <ol>
- * <li>The file <code>${java.home}/lib/security/java.policy</code>.</li>
- * <li>All URLs specified by security properties
- * <code>"policy.file.<i>n</i>"</code>, for increasing <i>n</i>
- * starting from 1. The sequence stops at the first undefined
- * property, so you must set <code>"policy.file.1"</code> if you also
- * set <code>"policy.file.2"</code>, and so on.</li>
- * <li>The URL specified by the property
- * <code>"java.security.policy"</code>.</li>
- * </ol>
- *
- * @author Casey Marshall (csm@gnu.org)
- * @see java.security.Policy
- */
-public final class PolicyFile extends Policy
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- private static final boolean DEBUG = true;
- // Package-private to avoid a trampoline.
- static void debug(String msg)
- {
- System.err.print(">> PolicyFile: ");
- System.err.println(msg);
- }
-
- private static void debug(Throwable t)
- {
- System.err.println(">> PolicyFile");
- t.printStackTrace(System.err);
- }
-
- private static final String DEFAULT_POLICY = System.getProperty("java.home")
- + System.getProperty("file.separator") + "lib"
- + System.getProperty("file.separator") + "security"
- + System.getProperty("file.separator") + "java.policy";
-
- private final Map cs2pc;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public PolicyFile()
- {
- cs2pc = new HashMap();
- refresh();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public PermissionCollection getPermissions(CodeSource codeSource)
- {
- Permissions perms = new Permissions();
- for (Iterator it = cs2pc.entrySet().iterator(); it.hasNext(); )
- {
- Map.Entry e = (Map.Entry) it.next();
- CodeSource cs = (CodeSource) e.getKey();
- if (cs.implies(codeSource))
- {
- if (DEBUG) debug(cs+" -> "+codeSource);
- PermissionCollection pc = (PermissionCollection) e.getValue();
- for (Enumeration ee = pc.elements(); ee.hasMoreElements(); )
- {
- perms.add((Permission) ee.nextElement());
- }
- }
- else
- if (DEBUG) debug(cs+" !-> "+codeSource);
- }
- if (DEBUG) debug ("returning permissions " + perms + " for " + codeSource);
- return perms;
- }
-
- public void refresh()
- {
- cs2pc.clear();
- List policyFiles = new LinkedList();
- try
- {
- policyFiles.add(new File(DEFAULT_POLICY).toURL());
- if (DEBUG) debug ("defualt policy is " + DEFAULT_POLICY);
- policyFiles.addAll((List) AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- LinkedList l = new LinkedList();
- for (int i = 1; ; i++)
- {
- String s = Security.getProperty("policy.file."+i);
- if (DEBUG) debug("policy.file."+i+"="+s);
- if (s == null)
- break;
- l.add(new URL(s));
- }
- String s = System.getProperty("java.security.policy");
- if (DEBUG) debug("java.security.policy="+s);
- if (s != null)
- l.add(new URL(s));
- return l;
- }
- }));
- }
- catch (PrivilegedActionException pae)
- {
- if (DEBUG) debug(pae);
- }
- catch (MalformedURLException mue)
- {
- if (DEBUG) debug(mue);
- }
- for (Iterator it = policyFiles.iterator(); it.hasNext(); )
- {
- try
- {
- URL url = (URL) it.next();
- parse(url);
- }
- catch (IOException ioe)
- {
- if (DEBUG) debug(ioe);
- }
- }
- }
-
- public String toString()
- {
- return super.toString() + " [ " + cs2pc.toString() + " ]";
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private static final int STATE_BEGIN = 0;
- private static final int STATE_GRANT = 1;
- private static final int STATE_PERMS = 2;
-
- /**
- * Parse a policy file, incorporating the permission definitions
- * described therein.
- *
- * @param url The URL of the policy file to read.
- * @throws IOException if an I/O error occurs, or if the policy file
- * cannot be parsed.
- */
- private void parse(final URL url) throws IOException
- {
- if (DEBUG) debug ("reading policy file from " + url);
- final StreamTokenizer in = new StreamTokenizer(new InputStreamReader(url.openStream()));
- in.resetSyntax();
- in.slashSlashComments(true);
- in.slashStarComments(true);
- in.wordChars('A', 'Z');
- in.wordChars('a', 'z');
- in.wordChars('0', '9');
- in.wordChars('.', '.');
- in.wordChars('_', '_');
- in.wordChars('$', '$');
- in.whitespaceChars(' ', ' ');
- in.whitespaceChars('\t', '\t');
- in.whitespaceChars('\f', '\f');
- in.whitespaceChars('\n', '\n');
- in.whitespaceChars('\r', '\r');
- in.quoteChar('\'');
- in.quoteChar('"');
-
- int tok;
- int state = STATE_BEGIN;
- List keystores = new LinkedList();
- URL currentBase = null;
- List currentCerts = new LinkedList();
- Permissions currentPerms = new Permissions();
- while ((tok = in.nextToken()) != StreamTokenizer.TT_EOF)
- {
- switch (tok)
- {
- case '{':
- if (state != STATE_GRANT)
- error(url, in, "spurious '{'");
- state = STATE_PERMS;
- tok = in.nextToken();
- break;
- case '}':
- if (state != STATE_PERMS)
- error(url, in, "spurious '}'");
- state = STATE_BEGIN;
- currentPerms.setReadOnly();
- Certificate[] c = null;
- if (!currentCerts.isEmpty())
- c = (Certificate[]) currentCerts.toArray(new Certificate[currentCerts.size()]);
- cs2pc.put(new CodeSource(currentBase, c), currentPerms);
- currentCerts.clear();
- currentPerms = new Permissions();
- currentBase = null;
- tok = in.nextToken();
- if (tok != ';')
- in.pushBack();
- continue;
- }
- if (tok != StreamTokenizer.TT_WORD)
- {
- error(url, in, "expecting word token");
- }
-
- // keystore "<keystore-path>" [',' "<keystore-type>"] ';'
- if (in.sval.equalsIgnoreCase("keystore"))
- {
- String alg = KeyStore.getDefaultType();
- tok = in.nextToken();
- if (tok != '"' && tok != '\'')
- error(url, in, "expecting key store URL");
- String store = in.sval;
- tok = in.nextToken();
- if (tok == ',')
- {
- tok = in.nextToken();
- if (tok != '"' && tok != '\'')
- error(url, in, "expecting key store type");
- alg = in.sval;
- tok = in.nextToken();
- }
- if (tok != ';')
- error(url, in, "expecting semicolon");
- try
- {
- KeyStore keystore = KeyStore.getInstance(alg);
- keystore.load(new URL(url, store).openStream(), null);
- keystores.add(keystore);
- }
- catch (Exception x)
- {
- error(url, in, x.toString());
- }
- }
- else if (in.sval.equalsIgnoreCase("grant"))
- {
- if (state != STATE_BEGIN)
- error(url, in, "extraneous grant keyword");
- state = STATE_GRANT;
- }
- else if (in.sval.equalsIgnoreCase("signedBy"))
- {
- if (state != STATE_GRANT && state != STATE_PERMS)
- error(url, in, "spurious 'signedBy'");
- if (keystores.isEmpty())
- error(url, in, "'signedBy' with no keystores");
- tok = in.nextToken();
- if (tok != '"' && tok != '\'')
- error(url, in, "expecting signedBy name");
- StringTokenizer st = new StringTokenizer(in.sval, ",");
- while (st.hasMoreTokens())
- {
- String alias = st.nextToken();
- for (Iterator it = keystores.iterator(); it.hasNext(); )
- {
- KeyStore keystore = (KeyStore) it.next();
- try
- {
- if (keystore.isCertificateEntry(alias))
- currentCerts.add(keystore.getCertificate(alias));
- }
- catch (KeyStoreException kse)
- {
- error(url, in, kse.toString());
- }
- }
- }
- tok = in.nextToken();
- if (tok != ',')
- {
- if (state != STATE_GRANT)
- error(url, in, "spurious ','");
- in.pushBack();
- }
- }
- else if (in.sval.equalsIgnoreCase("codeBase"))
- {
- if (state != STATE_GRANT)
- error(url, in, "spurious 'codeBase'");
- tok = in.nextToken();
- if (tok != '"' && tok != '\'')
- error(url, in, "expecting code base URL");
- String base = expand(in.sval);
- if (File.separatorChar != '/')
- base = base.replace(File.separatorChar, '/');
- try
- {
- currentBase = new URL(base);
- }
- catch (MalformedURLException mue)
- {
- error(url, in, mue.toString());
- }
- tok = in.nextToken();
- if (tok != ',')
- in.pushBack();
- }
- else if (in.sval.equalsIgnoreCase("principal"))
- {
- if (state != STATE_GRANT)
- error(url, in, "spurious 'principal'");
- tok = in.nextToken();
- if (tok == StreamTokenizer.TT_WORD)
- {
- tok = in.nextToken();
- if (tok != '"' && tok != '\'')
- error(url, in, "expecting principal name");
- String name = in.sval;
- Principal p = null;
- try
- {
- Class pclass = Class.forName(in.sval);
- Constructor c =
- pclass.getConstructor(new Class[] { String.class });
- p = (Principal) c.newInstance(new Object[] { name });
- }
- catch (Exception x)
- {
- error(url, in, x.toString());
- }
- for (Iterator it = keystores.iterator(); it.hasNext(); )
- {
- KeyStore ks = (KeyStore) it.next();
- try
- {
- for (Enumeration e = ks.aliases(); e.hasMoreElements(); )
- {
- String alias = (String) e.nextElement();
- if (ks.isCertificateEntry(alias))
- {
- Certificate cert = ks.getCertificate(alias);
- if (!(cert instanceof X509Certificate))
- continue;
- if (p.equals(((X509Certificate) cert).getSubjectDN()) ||
- p.equals(((X509Certificate) cert).getSubjectX500Principal()))
- currentCerts.add(cert);
- }
- }
- }
- catch (KeyStoreException kse)
- {
- error(url, in, kse.toString());
- }
- }
- }
- else if (tok == '"' || tok == '\'')
- {
- String alias = in.sval;
- for (Iterator it = keystores.iterator(); it.hasNext(); )
- {
- KeyStore ks = (KeyStore) it.next();
- try
- {
- if (ks.isCertificateEntry(alias))
- currentCerts.add(ks.getCertificate(alias));
- }
- catch (KeyStoreException kse)
- {
- error(url, in, kse.toString());
- }
- }
- }
- else
- error(url, in, "expecting principal");
- tok = in.nextToken();
- if (tok != ',')
- in.pushBack();
- }
- else if (in.sval.equalsIgnoreCase("permission"))
- {
- if (state != STATE_PERMS)
- error(url, in, "spurious 'permission'");
- tok = in.nextToken();
- if (tok != StreamTokenizer.TT_WORD)
- error(url, in, "expecting permission class name");
- String className = in.sval;
- Class clazz = null;
- try
- {
- clazz = Class.forName(className);
- }
- catch (ClassNotFoundException cnfe)
- {
- }
- tok = in.nextToken();
- if (tok == ';')
- {
- if (clazz == null)
- {
- currentPerms.add(new UnresolvedPermission(className,
- null, null, (Certificate[]) currentCerts.toArray(new Certificate[0])));
- continue;
- }
- try
- {
- currentPerms.add((Permission) clazz.newInstance());
- }
- catch (Exception x)
- {
- error(url, in, x.toString());
- }
- continue;
- }
- if (tok != '"' && tok != '\'')
- error(url, in, "expecting permission target");
- String target = expand(in.sval);
- tok = in.nextToken();
- if (tok == ';')
- {
- if (clazz == null)
- {
- currentPerms.add(new UnresolvedPermission(className,
- target, null, (Certificate[]) currentCerts.toArray(new Certificate[0])));
- continue;
- }
- try
- {
- Constructor c =
- clazz.getConstructor(new Class[] { String.class });
- currentPerms.add((Permission) c.newInstance(
- new Object[] { target }));
- }
- catch (Exception x)
- {
- error(url, in, x.toString());
- }
- continue;
- }
- if (tok != ',')
- error(url, in, "expecting ','");
- tok = in.nextToken();
- if (tok == StreamTokenizer.TT_WORD)
- {
- if (!in.sval.equalsIgnoreCase("signedBy"))
- error(url, in, "expecting 'signedBy'");
- try
- {
- Constructor c =
- clazz.getConstructor(new Class[] { String.class });
- currentPerms.add((Permission) c.newInstance(
- new Object[] { target }));
- }
- catch (Exception x)
- {
- error(url, in, x.toString());
- }
- in.pushBack();
- continue;
- }
- if (tok != '"' && tok != '\'')
- error(url, in, "expecting permission action");
- String action = in.sval;
- if (clazz == null)
- {
- currentPerms.add(new UnresolvedPermission(className,
- target, action, (Certificate[]) currentCerts.toArray(new Certificate[0])));
- continue;
- }
- else
- {
- try
- {
- Constructor c = clazz.getConstructor(
- new Class[] { String.class, String.class });
- currentPerms.add((Permission) c.newInstance(
- new Object[] { target, action }));
- }
- catch (Exception x)
- {
- error(url, in, x.toString());
- }
- }
- tok = in.nextToken();
- if (tok != ';' && tok != ',')
- error(url, in, "expecting ';' or ','");
- }
- }
- }
-
- /**
- * Expand all instances of <code>"${property-name}"</code> into
- * <code>System.getProperty("property-name")</code>.
- */
- private static String expand(final String s)
- {
- final StringBuffer result = new StringBuffer();
- final StringBuffer prop = new StringBuffer();
- int state = 0;
- for (int i = 0; i < s.length(); i++)
- {
- switch (state)
- {
- case 0:
- if (s.charAt(i) == '$')
- state = 1;
- else
- result.append(s.charAt(i));
- break;
- case 1:
- if (s.charAt(i) == '{')
- state = 2;
- else
- {
- state = 0;
- result.append('$').append(s.charAt(i));
- }
- break;
- case 2:
- if (s.charAt(i) == '}')
- {
- String p = prop.toString();
- if (p.equals("/"))
- p = "file.separator";
- p = System.getProperty(p);
- if (p == null)
- p = "";
- result.append(p);
- prop.setLength(0);
- state = 0;
- }
- else
- prop.append(s.charAt(i));
- break;
- }
- }
- if (state != 0)
- result.append('$').append('{').append(prop);
- return result.toString();
- }
-
- /**
- * I miss macros.
- */
- private static void error(URL base, StreamTokenizer in, String msg)
- throws IOException
- {
- throw new IOException(base+":"+in.lineno()+": "+msg);
- }
-}
diff --git a/libjava/gnu/java/security/action/GetPropertyAction.java b/libjava/gnu/java/security/action/GetPropertyAction.java
deleted file mode 100644
index 2886deb3474..00000000000
--- a/libjava/gnu/java/security/action/GetPropertyAction.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* GetPropertyAction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.action;
-
-import java.security.PrivilegedAction;
-
-/**
- * PrivilegedAction implementation that calls System.getProperty() with
- * the property name passed to its constructor.
- *
- * Example of use:
- * <code>
- * GetPropertyAction action = new GetPropertyAction("http.proxyPort");
- * String port = AccessController.doPrivileged(action);
- * </code>
- */
-public class GetPropertyAction implements PrivilegedAction
-{
- String name;
- String value = null;
-
- public GetPropertyAction()
- {
- }
-
- public GetPropertyAction(String propName)
- {
- setParameters(propName);
- }
-
- public GetPropertyAction(String propName, String defaultValue)
- {
- setParameters(propName, defaultValue);
- }
-
- public Object run()
- {
- return System.getProperty(name, value);
- }
-
- public GetPropertyAction setParameters(String propName)
- {
- this.name = propName;
- this.value = null;
- return this;
- }
-
- public GetPropertyAction setParameters(String propName, String defaultValue)
- {
- this.name = propName;
- this.value = defaultValue;
- return this;
- }
-}
diff --git a/libjava/gnu/java/security/action/GetSecurityPropertyAction.java b/libjava/gnu/java/security/action/GetSecurityPropertyAction.java
deleted file mode 100644
index 97fa15d03e5..00000000000
--- a/libjava/gnu/java/security/action/GetSecurityPropertyAction.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/* GetSecurityPropertyAction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.action;
-
-import java.security.PrivilegedAction;
-import java.security.Security;
-
-/**
- * PrivilegedAction implementation that calls Security.getProperty()
- * with the property name passed to its constructor.
- *
- * Example of use:
- * <code>
- * GetSecurityPropertyAction action = new GetSecurityPropertyAction("javax.net.ssl.trustStorePassword");
- * String passwd = AccessController.doPrivileged(action);
- * </code>
- */
-public class GetSecurityPropertyAction implements PrivilegedAction
-{
- private String name;
- private String value;
-
- public GetSecurityPropertyAction()
- {
- }
-
- public GetSecurityPropertyAction(String propName)
- {
- setParameters(propName);
- }
-
- public GetSecurityPropertyAction(String propName, String defaultValue)
- {
- setParameters(propName, defaultValue);
- }
-
- public GetSecurityPropertyAction setParameters(String propName)
- {
- this.name = propName;
- this.value = null;
- return this;
- }
-
- public GetSecurityPropertyAction setParameters(String propName, String defaultValue)
- {
- this.name = propName;
- this.value = defaultValue;
- return this;
- }
-
- public Object run()
- {
- String val = Security.getProperty(name);
- if (val == null)
- val = value;
- return val;
- }
-}
diff --git a/libjava/gnu/java/security/action/SetAccessibleAction.java b/libjava/gnu/java/security/action/SetAccessibleAction.java
deleted file mode 100644
index 77e5fc988b8..00000000000
--- a/libjava/gnu/java/security/action/SetAccessibleAction.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* SetAccessibleAction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.action;
-
-import java.lang.reflect.AccessibleObject;
-import java.security.PrivilegedAction;
-
-/**
- * PrivilegedAction implementation that calls setAccessible(true) on the
- * AccessibleObject passed to its constructor.
- *
- * Example of use:
- * <code>
- * Field dataField = cl.getDeclaredField("data");
- * AccessController.doPrivileged(new SetAccessibleAction(dataField));
- * </code>
- */
-public class SetAccessibleAction implements PrivilegedAction
-{
- AccessibleObject member;
-
- public SetAccessibleAction()
- {
- }
-
- public SetAccessibleAction(AccessibleObject member)
- {
- this.member = member;
- }
-
- public Object run()
- {
- member.setAccessible(true);
- return null;
- }
-
- public SetAccessibleAction setMember(AccessibleObject member)
- {
- this.member = member;
- return this;
- }
-}
diff --git a/libjava/gnu/java/security/ber/BER.java b/libjava/gnu/java/security/ber/BER.java
deleted file mode 100644
index 7efb1bf90cc..00000000000
--- a/libjava/gnu/java/security/ber/BER.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/* BER.java -- basic encoding rules (BER) constants.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.ber;
-
-import gnu.java.security.der.DER;
-
-public interface BER extends DER
-{
- BERValue END_OF_SEQUENCE = new BERValue(0, null);
-}
diff --git a/libjava/gnu/java/security/ber/BEREncodingException.java b/libjava/gnu/java/security/ber/BEREncodingException.java
deleted file mode 100644
index aad10932cc4..00000000000
--- a/libjava/gnu/java/security/ber/BEREncodingException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* BEREncodingException.java --- BER Encoding Exception
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.ber;
-
-import gnu.java.security.der.DEREncodingException;
-
-public class BEREncodingException extends DEREncodingException
-{
- public BEREncodingException()
- {
- super ();
- }
-
- public BEREncodingException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/gnu/java/security/ber/BERReader.java b/libjava/gnu/java/security/ber/BERReader.java
deleted file mode 100644
index 53a3f3ee9a9..00000000000
--- a/libjava/gnu/java/security/ber/BERReader.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* BERReader.java -- basic encoding rules (BER) reader.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.ber;
-
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class BERReader extends DERReader implements BER
-{
-
- /**
- * Create a new DER reader from a byte array.
- *
- * @param in The encoded bytes.
- */
- public BERReader(byte[] in)
- {
- super(in);
- }
-
- public BERReader (byte[] in, int off, int len)
- {
- super(in, off, len);
- }
-
- /**
- * Create a new DER readed from an input stream.
- *
- * @param in The encoded bytes.
- */
- public BERReader(InputStream in)
- {
- super(in);
- }
-
- public DERValue read() throws IOException
- {
- in.mark(2);
- int tag = in.read();
- if (tag == -1)
- throw new EOFException();
- int length = in.read();
- if (length == 0)
- {
- if (tag == 0)
- return END_OF_SEQUENCE;
- return new BERValue(tag, CONSTRUCTED_VALUE, new byte[] { (byte) tag, 0 });
- }
- else
- {
- in.reset();
- return super.read();
- }
- }
-
- public int peek() throws IOException
- {
- in.mark(1);
- int ret = in.read();
- in.reset();
- return ret;
- }
-}
diff --git a/libjava/gnu/java/security/ber/BERValue.java b/libjava/gnu/java/security/ber/BERValue.java
deleted file mode 100644
index aeaef39bf2b..00000000000
--- a/libjava/gnu/java/security/ber/BERValue.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* BERReader.java -- basic encoding rules (BER) value.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.ber;
-
-import gnu.java.security.der.DERValue;
-
-public class BERValue extends DERValue
-{
-
- private boolean indefinite;
-
- public BERValue(int tag, Object value, byte[] encoded)
- {
- super(tag, 0, value, encoded);
- indefinite = true;
- }
-
- public BERValue(int tag, int length, Object value, byte[] encoded)
- {
- super(tag, length, value, encoded);
- }
-
- public BERValue(int tag, Object value)
- {
- super(tag, 0, value, null);
- }
-
- public static boolean isIndefinite(DERValue value)
- {
- if (value instanceof BERValue)
- return ((BERValue) value).getIndefinite();
- return false;
- }
-
- public boolean getIndefinite()
- {
- return indefinite;
- }
-
- public int getLength()
- {
- if (indefinite)
- return 0;
- return super.getLength();
- }
-}
diff --git a/libjava/gnu/java/security/der/BitString.java b/libjava/gnu/java/security/der/BitString.java
deleted file mode 100644
index b88b14541b6..00000000000
--- a/libjava/gnu/java/security/der/BitString.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/* BitString.java -- Java representation of the BIT STRING type.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.der;
-
-import java.math.BigInteger;
-import java.util.Arrays;
-
-/**
- * Immutable representation of a bit string, which is equivalent to a
- * byte array except some number of the rightmost bits are ignored. For
- * example, this could be the bit string:
- *
- * <pre> 00010101 11101101 11010xxx</pre>
- *
- * <p>Where the "xxx" represents three bits that should be ignored, and
- * can have any value.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class BitString implements Cloneable, Comparable
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The bits themselves. */
- private final byte[] bytes;
-
- /**
- * The exportable byte array. This array has the ignored bits
- * removed.
- */
- private transient byte[] externBytes;
-
- /** The number of bits ignored at the end of the byte array. */
- private final int ignoredBits;
-
- /** This bit string as a boolean array. */
- private transient boolean[] boolVal;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new bit string, shifting the given byte array if needed.
- *
- * @param bytes The byte array holding the bit string.
- * @param ignoredBits The number of bits to ignore.
- * @param doShift Pass true in this parameter if the byte array has
- * not yet been shifted left by <i>ignoredBits</i>.
- * @throws IllegalArgumentException If <i>ignoredBits</i> is negative
- * or greater than 7.
- * @throws NullPointerException If <i>bytes</i> is null.
- */
- public BitString(byte[] bytes, int ignoredBits, boolean doShift)
- {
- this(bytes, 0, bytes.length, ignoredBits, doShift);
- }
-
- /**
- * Create a new bit string, shifting the given byte array if needed.
- *
- * @param bytes The byte array holding the bit string.
- * @param offset The offset where the meaningful bytes begin.
- * @param length The number of meaningful bytes.
- * @param ignoredBits The number of bits to ignore.
- * @param doShift Pass true in this parameter if the byte array has
- * not yet been shifted left by <i>ignoredBits</i>.
- * @throws IllegalArgumentException If <i>ignoredBits</i> is negative
- * or greater than 7.
- * @throws NullPointerException If <i>bytes</i> is null.
- */
- public BitString(byte[] bytes, int offset, int length,
- int ignoredBits, boolean doShift)
- {
- if (ignoredBits < 0 || ignoredBits > 7)
- throw new IllegalArgumentException();
- if (bytes == null)
- throw new NullPointerException();
- if (doShift && ignoredBits > 0)
- {
- this.externBytes = new byte[length];
- System.arraycopy(bytes, offset, externBytes, 0, length);
- this.bytes = new BigInteger(externBytes).shiftLeft(ignoredBits)
- .toByteArray();
- }
- else
- {
- this.bytes = new byte[length];
- System.arraycopy(bytes, offset, this.bytes, 0, length);
- }
- this.ignoredBits = ignoredBits;
- }
-
- /**
- * Create a new bit string.
- *
- * @param bytes The byte array holding the bit string.
- * @param offset The offset where the meaningful bytes begin.
- * @param length The number of meaningful bytes.
- * @param ignoredBits The number of bits to ignore.
- * @throws IllegalArgumentException If <i>ignoredBits</i> is negative
- * or greater than 7.
- * @throws NullPointerException If <i>bytes</i> is null.
- */
- public BitString(byte[] bytes, int offset, int length, int ignoredBits)
- {
- this(bytes, offset, length, ignoredBits, false);
- }
-
- /**
- * Create a new bit string.
- *
- * @param bytes The byte array holding the bit string.
- * @param ignoredBits The number of bits to ignore.
- * @throws IllegalArgumentException If <i>ignoredBits</i> is negative
- * or greater than 7.
- * @throws NullPointerException If <i>bytes</i> is null.
- */
- public BitString(byte[] bytes, int ignoredBits)
- {
- this(bytes, 0, bytes.length, ignoredBits, false);
- }
-
- /**
- * Create a new bit string.
- *
- * @param bytes The byte array holding the bit string.
- * @param offset The offset where the meaningful bytes begin.
- * @param length The number of meaningful bytes.
- * @throws NullPointerException If <i>bytes</i> is null.
- */
- public BitString(byte[] bytes, int offset, int length)
- {
- this(bytes, offset, length, 0, false);
- }
-
- /**
- * Create a new bit string.
- *
- * @param bytes The byte array holding the bit string.
- * @throws NullPointerException If <i>bytes</i> is null.
- */
- public BitString(byte[] bytes)
- {
- this(bytes, 0, bytes.length, 0, false);
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return this bit string as a byte array, with the ignored bits
- * trimmed off. The byte array is cloned every time this method is
- * called to prevent modification.
- *
- * @return The trimmed byte array.
- */
- public byte[] toByteArray()
- {
- if (ignoredBits == 0)
- return (byte[]) bytes.clone();
- if (externBytes == null)
- externBytes = new BigInteger(bytes).shiftRight(ignoredBits).toByteArray();
- return (byte[]) externBytes.clone();
- }
-
- /**
- * Returns this bit string as a byte array, with the ignored bits
- * present. The byte array is cloned every time this method is
- * called to prevent modification.
- *
- * @return The byte array.
- */
- public byte[] getShiftedByteArray()
- {
- return (byte[]) bytes.clone();
- }
-
- /**
- * Returns the number of ignored bits.
- *
- * @return The number of ignored bits.
- */
- public int getIgnoredBits()
- {
- return ignoredBits;
- }
-
- /**
- * Returns the size, in bits, of this bit string.
- *
- * @return The size of this bit string.
- */
- public int size()
- {
- return (bytes.length << 3) - ignoredBits;
- }
-
- /**
- * Return this bit string as a boolean array. The value returned is of
- * size {@link #size()}, and each <code>true</code> value
- * corresponding to each "1" in this bit string. The boolean array is
- * cloned before it is returned.
- *
- * @return The boolean array.
- */
- public boolean[] toBooleanArray()
- {
- if (boolVal == null)
- {
- boolVal = new boolean[size()];
- for (int i = 0, j = 7, k = 0; i < boolVal.length; i++)
- {
- boolVal[i] = (bytes[k] & 1 << j--) != 0;
- if (j < 0)
- {
- j = 7;
- k++;
- }
- }
- }
- return (boolean[]) boolVal.clone();
- }
-
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException cce)
- {
- throw new InternalError(cce.getMessage());
- }
- }
-
- public int compareTo(Object o)
- {
- BitString that = (BitString) o;
- if (this.equals(that))
- return 0;
- if (this.bytes.length != that.bytes.length)
- return (this.bytes.length < that.bytes.length) ? -1 : 1;
- if (this.ignoredBits != that.ignoredBits)
- return (this.ignoredBits < that.ignoredBits) ? -1 : 1;
- for (int i = 0; i < this.bytes.length; i++)
- if (this.bytes[i] != that.bytes[i])
- return (this.bytes[i] < that.bytes[i]) ? -1 : 1;
- return 0; // not reached.
- }
-
- public boolean equals(Object o)
- {
- if (!(o instanceof BitString))
- return false;
- BitString that = (BitString) o;
- // True for cloned instances.
- if (this.bytes == that.bytes && this.ignoredBits == that.ignoredBits)
- return true;
- if (this.ignoredBits == that.ignoredBits)
- return Arrays.equals(this.bytes, that.bytes);
- return false;
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
- for (int i = 0, j = 7, k = 0; i < size(); i++)
- {
- sb.append((bytes[k] & 1 << j) != 0 ? "1" : "0");
- j--;
- if (j < 0)
- {
- j = 7;
- k++;
- }
- }
- return sb.toString();
- }
-}
diff --git a/libjava/gnu/java/security/der/DER.java b/libjava/gnu/java/security/der/DER.java
deleted file mode 100644
index a7eb4a6895e..00000000000
--- a/libjava/gnu/java/security/der/DER.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* DER.java -- Basic constants in DER sequences.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.der;
-
-/**
- * The set of tags for DER types.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public interface DER
-{
- int UNIVERSAL = 0x00;
- int APPLICATION = 0x40;
- int CONTEXT = 0x80;
- int PRIVATE = 0xC0;
-
- int CONSTRUCTED = 0x20;
-
- int ANY = 0x00;
- int BOOLEAN = 0x01;
- int INTEGER = 0x02;
- int BIT_STRING = 0x03;
- int OCTET_STRING = 0x04;
- int NULL = 0x05;
- int OBJECT_IDENTIFIER = 0x06;
- int REAL = 0x09;
- int ENUMERATED = 0x0a;
- int RELATIVE_OID = 0x0d;
-
- int SEQUENCE = 0x10;
- int SET = 0x11;
-
- Object CONSTRUCTED_VALUE = new Object();
-
- int NUMERIC_STRING = 0x12;
- int PRINTABLE_STRING = 0x13;
- int T61_STRING = 0x14;
- int VIDEOTEX_STRING = 0x15;
- int IA5_STRING = 0x16;
- int GRAPHIC_STRING = 0x19;
- int ISO646_STRING = 0x1A;
- int GENERAL_STRING = 0x1B;
-
- int UTF8_STRING = 0x0C;
- int UNIVERSAL_STRING = 0x1C;
- int BMP_STRING = 0x1E;
-
- int UTC_TIME = 0x17;
- int GENERALIZED_TIME = 0x18;
-}
diff --git a/libjava/gnu/java/security/der/DEREncodingException.java b/libjava/gnu/java/security/der/DEREncodingException.java
deleted file mode 100644
index 90042a3fc54..00000000000
--- a/libjava/gnu/java/security/der/DEREncodingException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* DEREncodingException.java --- DER Encoding Exception
- Copyright (C) 1999,2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.der;
-
-import java.io.IOException;
-
-public class DEREncodingException extends IOException
-{
- public DEREncodingException()
- {
- super ();
- }
-
- public DEREncodingException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/gnu/java/security/der/DERReader.java b/libjava/gnu/java/security/der/DERReader.java
deleted file mode 100644
index cb07f14325f..00000000000
--- a/libjava/gnu/java/security/der/DERReader.java
+++ /dev/null
@@ -1,437 +0,0 @@
-/* DERReader.java -- parses ASN.1 DER sequences
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.der;
-
-import gnu.java.security.OID;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigInteger;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
-
-/**
- * This class decodes DER sequences into Java objects. The methods of
- * this class do not have knowledge of higher-levels of structure in the
- * DER stream -- such as ASN.1 constructions -- and it is therefore up
- * to the calling application to determine if the data are structured
- * properly by inspecting the {@link DERValue} that is returned.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class DERReader implements DER
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- protected InputStream in;
-
- protected final ByteArrayOutputStream encBuf;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new DER reader from a byte array.
- *
- * @param in The encoded bytes.
- */
- public DERReader(byte[] in)
- {
- this(new ByteArrayInputStream(in));
- }
-
- public DERReader (byte[] in, int off, int len)
- {
- this (new ByteArrayInputStream (in, off, len));
- }
-
- /**
- * Create a new DER readed from an input stream.
- *
- * @param in The encoded bytes.
- */
- public DERReader(InputStream in)
- {
- if (!in.markSupported())
- this.in = new BufferedInputStream(in, 16384);
- else
- this.in = in;
- encBuf = new ByteArrayOutputStream(2048);
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Convenience method for reading a single primitive value from the
- * given byte array.
- *
- * @param encoded The encoded bytes.
- * @throws IOException If the bytes do not represent an encoded
- * object.
- */
- public static DERValue read(byte[] encoded) throws IOException
- {
- return new DERReader(encoded).read();
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- public void skip (int bytes) throws IOException
- {
- in.skip (bytes);
- }
-
- /**
- * Decode a single value from the input stream, returning it in a new
- * {@link DERValue}. By "single value" we mean any single type in its
- * entirety -- including constructed types such as SEQUENCE and all
- * the values they contain. Usually it is sufficient to call this
- * method once to parse and return the top-level structure, then to
- * inspect the returned value for the proper contents.
- *
- * @return The parsed DER structure.
- * @throws IOException If an error occurs reading from the input
- * stream.
- * @throws DEREncodingException If the input does not represent a
- * valid DER stream.
- */
- public DERValue read() throws IOException
- {
- int tag = in.read();
- if (tag == -1)
- throw new EOFException();
- encBuf.write(tag);
- int len = readLength();
- DERValue value = null;
- if ((tag & CONSTRUCTED) == CONSTRUCTED)
- {
- in.mark(2048);
- byte[] encoded = new byte[len];
- in.read(encoded);
- encBuf.write(encoded);
- value = new DERValue(tag, len, CONSTRUCTED_VALUE, encBuf.toByteArray());
- in.reset();
- encBuf.reset();
- return value;
- }
- switch (tag & 0xC0)
- {
- case UNIVERSAL:
- value = new DERValue(tag, len, readUniversal(tag, len),
- encBuf.toByteArray());
- encBuf.reset();
- break;
- case CONTEXT:
- byte[] encoded = new byte[len];
- in.read(encoded);
- encBuf.write(encoded);
- value = new DERValue(tag, len, encoded, encBuf.toByteArray());
- encBuf.reset();
- break;
- case APPLICATION:
- // This should not be reached, since (I think) APPLICATION is
- // always constructed.
- throw new DEREncodingException("non-constructed APPLICATION data");
- default:
- throw new DEREncodingException("PRIVATE class not supported");
- }
- return value;
- }
-
- protected int readLength() throws IOException
- {
- int i = in.read();
- if (i == -1)
- throw new EOFException();
- encBuf.write(i);
- if ((i & ~0x7F) == 0)
- {
- return i;
- }
- else if (i < 0xFF)
- {
- byte[] octets = new byte[i & 0x7F];
- in.read(octets);
- encBuf.write(octets);
- return new BigInteger(1, octets).intValue();
- }
- throw new DEREncodingException();
- }
-
- // Own methods.
- // ------------------------------------------------------------------------
-
- private Object readUniversal(int tag, int len) throws IOException
- {
- byte[] value = new byte[len];
- in.read(value);
- encBuf.write(value);
- switch (tag & 0x1F)
- {
- case BOOLEAN:
- if (value.length != 1)
- throw new DEREncodingException();
- return Boolean.valueOf(value[0] != 0);
- case NULL:
- if (len != 0)
- throw new DEREncodingException();
- return null;
- case INTEGER:
- case ENUMERATED:
- return new BigInteger(value);
- case BIT_STRING:
- byte[] bits = new byte[len - 1];
- System.arraycopy(value, 1, bits, 0, bits.length);
- return new BitString(bits, value[0] & 0xFF);
- case OCTET_STRING:
- return value;
- case NUMERIC_STRING:
- case PRINTABLE_STRING:
- case T61_STRING:
- case VIDEOTEX_STRING:
- case IA5_STRING:
- case GRAPHIC_STRING:
- case ISO646_STRING:
- case GENERAL_STRING:
- case UNIVERSAL_STRING:
- case BMP_STRING:
- case UTF8_STRING:
- return makeString(tag, value);
- case UTC_TIME:
- case GENERALIZED_TIME:
- return makeTime(tag, value);
- case OBJECT_IDENTIFIER:
- return new OID(value);
- case RELATIVE_OID:
- return new OID(value, true);
- default:
- throw new DEREncodingException("unknown tag " + tag);
- }
- }
-
- private static String makeString(int tag, byte[] value)
- throws IOException
- {
- switch (tag & 0x1F)
- {
- case NUMERIC_STRING:
- case PRINTABLE_STRING:
- case T61_STRING:
- case VIDEOTEX_STRING:
- case IA5_STRING:
- case GRAPHIC_STRING:
- case ISO646_STRING:
- case GENERAL_STRING:
- return fromIso88591(value);
-
- case UNIVERSAL_STRING:
- // XXX The docs say UniversalString is encoded in four bytes
- // per character, but Java has no support (yet) for UTF-32.
- //return new String(buf, "UTF-32");
- case BMP_STRING:
- return fromUtf16Be(value);
-
- case UTF8_STRING:
- return fromUtf8(value);
-
- default:
- throw new DEREncodingException("unknown string tag");
- }
- }
-
- private static String fromIso88591(byte[] bytes)
- {
- StringBuffer str = new StringBuffer(bytes.length);
- for (int i = 0; i < bytes.length; i++)
- str.append((char) (bytes[i] & 0xFF));
- return str.toString();
- }
-
- private static String fromUtf16Be(byte[] bytes) throws IOException
- {
- if ((bytes.length & 0x01) != 0)
- throw new IOException("UTF-16 bytes are odd in length");
- StringBuffer str = new StringBuffer(bytes.length / 2);
- for (int i = 0; i < bytes.length; i += 2)
- {
- char c = (char) ((bytes[i] << 8) & 0xFF);
- c |= (char) (bytes[i+1] & 0xFF);
- str.append(c);
- }
- return str.toString();
- }
-
- private static String fromUtf8(byte[] bytes) throws IOException
- {
- StringBuffer str = new StringBuffer((int)(bytes.length / 1.5));
- for (int i = 0; i < bytes.length; )
- {
- char c = 0;
- if ((bytes[i] & 0xE0) == 0xE0)
- {
- if ((i + 2) >= bytes.length)
- throw new IOException("short UTF-8 input");
- c = (char) ((bytes[i++] & 0x0F) << 12);
- if ((bytes[i] & 0x80) != 0x80)
- throw new IOException("malformed UTF-8 input");
- c |= (char) ((bytes[i++] & 0x3F) << 6);
- if ((bytes[i] & 0x80) != 0x80)
- throw new IOException("malformed UTF-8 input");
- c |= (char) (bytes[i++] & 0x3F);
- }
- else if ((bytes[i] & 0xC0) == 0xC0)
- {
- if ((i + 1) >= bytes.length)
- throw new IOException("short input");
- c = (char) ((bytes[i++] & 0x1F) << 6);
- if ((bytes[i] & 0x80) != 0x80)
- throw new IOException("malformed UTF-8 input");
- c |= (char) (bytes[i++] & 0x3F);
- }
- else if ((bytes[i] & 0xFF) < 0x80)
- {
- c = (char) (bytes[i++] & 0xFF);
- }
- else
- throw new IOException("badly formed UTF-8 sequence");
- str.append(c);
- }
- return str.toString();
- }
-
- private Date makeTime(int tag, byte[] value) throws IOException
- {
- Calendar calendar = Calendar.getInstance();
- String str = makeString(PRINTABLE_STRING, value);
-
- // Classpath's SimpleDateFormat does not work for parsing these
- // types of times, so we do this by hand.
- String date = str;
- String tz = "";
- if (str.indexOf("+") > 0)
- {
- date = str.substring(0, str.indexOf("+"));
- tz = str.substring(str.indexOf("+"));
- }
- else if (str.indexOf("-") > 0)
- {
- date = str.substring(0, str.indexOf("-"));
- tz = str.substring(str.indexOf("-"));
- }
- else if (str.endsWith("Z"))
- {
- date = str.substring(0, str.length()-2);
- tz = "Z";
- }
- if (!tz.equals("Z") && tz.length() > 0)
- calendar.setTimeZone(TimeZone.getTimeZone(tz));
- else
- calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
- if ((tag & 0x1F) == UTC_TIME)
- {
- if (date.length() < 10) // must be at least 10 chars long
- throw new DEREncodingException("cannot parse date");
- // UTCTime is of the form "yyMMddHHmm[ss](Z|(+|-)hhmm)"
- try
- {
- int year = Integer.parseInt(str.substring(0, 2));
- if (year < 50)
- year += 2000;
- else
- year += 1900;
- calendar.set(year,
- Integer.parseInt(str.substring( 2, 4))-1, // month
- Integer.parseInt(str.substring( 4, 6)), // day
- Integer.parseInt(str.substring( 6, 8)), // hour
- Integer.parseInt(str.substring( 8, 10))); // minute
- if (date.length() == 12);
- calendar.set(Calendar.SECOND,
- Integer.parseInt(str.substring(10, 12)));
- }
- catch (NumberFormatException nfe)
- {
- throw new DEREncodingException("cannot parse date");
- }
- }
- else
- {
- if (date.length() < 10) // must be at least 10 chars long
- throw new DEREncodingException("cannot parse date");
- // GeneralTime is of the form "yyyyMMddHH[mm[ss[(.|,)SSSS]]]"
- // followed by "Z" or "(+|-)hh[mm]"
- try
- {
- calendar.set(
- Integer.parseInt(date.substring(0, 4)), // year
- Integer.parseInt(date.substring(4, 6))-1, // month
- Integer.parseInt(date.substring(6, 8)), // day
- Integer.parseInt(date.substring(8, 10)), 0); // hour, min
- switch (date.length())
- {
- case 19:
- case 18:
- case 17:
- case 16:
- calendar.set(Calendar.MILLISECOND,
- Integer.parseInt(date.substring(15)));
- case 14:
- calendar.set(Calendar.SECOND,
- Integer.parseInt(date.substring(12, 14)));
- case 12:
- calendar.set(Calendar.MINUTE,
- Integer.parseInt(date.substring(10, 12)));
- }
- }
- catch (NumberFormatException nfe)
- {
- throw new DEREncodingException("cannot parse date");
- }
- }
- return calendar.getTime();
- }
-}
diff --git a/libjava/gnu/java/security/der/DERValue.java b/libjava/gnu/java/security/der/DERValue.java
deleted file mode 100644
index 9a597d724cc..00000000000
--- a/libjava/gnu/java/security/der/DERValue.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/* DERValue.java -- a value read or written to a DER encoding.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.der;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-public class DERValue implements DER
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- private final int tagClass;
- private final boolean constructed;
- private final int tag;
- private int length;
- private final Object value;
- private byte[] encoded;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- public DERValue(int tag, int length, Object value, byte[] encoded)
- {
- tagClass = tag & 0xC0;
- this.tag = tag & 0x1F;
- constructed = (tag & CONSTRUCTED) == CONSTRUCTED;
- this.length = length;
- this.value = value;
- if (encoded != null)
- this.encoded = (byte[]) encoded.clone();
- }
-
- public DERValue(int tag, Object value)
- {
- this(tag, 0, value, null);
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- public int getExternalTag()
- {
- return tagClass | tag | (constructed ? 0x20 : 0x00);
- }
-
- public int getTag()
- {
- return tag;
- }
-
- public int getTagClass()
- {
- return tagClass;
- }
-
- public boolean isConstructed()
- {
- return constructed;
- }
-
- public int getLength()
- {
- if (encoded == null)
- {
- try
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- length = DERWriter.write(out, this);
- encoded = out.toByteArray();
- }
- catch (IOException ioe)
- {
- encoded = new byte[0];
- }
- }
- return length;
- }
-
- public Object getValue()
- {
- return value;
- }
-
- public Object getValueAs (final int derType) throws IOException
- {
- byte[] encoded = getEncoded ();
- encoded[0] = (byte) derType;
- return DERReader.read (encoded).getValue ();
- }
-
- public byte[] getEncoded()
- {
- if (encoded == null)
- {
- try
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- length = DERWriter.write(out, this);
- encoded = out.toByteArray();
- }
- catch (IOException ioe)
- {
- encoded = new byte[0];
- }
- }
- return (byte[]) encoded.clone();
- }
-
- public int getEncodedLength()
- {
- if (encoded == null)
- {
- try
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- length = DERWriter.write(out, this);
- encoded = out.toByteArray();
- }
- catch (IOException ioe)
- {
- encoded = new byte[0];
- }
- }
- return encoded.length;
- }
-
- public String toString()
- {
- return "DERValue [ tag=" + tag + ", class=" + tagClass + ", constructed="
- + constructed + ", value=" + value + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/der/DERWriter.java b/libjava/gnu/java/security/der/DERWriter.java
deleted file mode 100644
index 78524fc949f..00000000000
--- a/libjava/gnu/java/security/der/DERWriter.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/* DERWriter.java -- write Java types in DER format.
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.der;
-
-import gnu.java.security.OID;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import java.math.BigInteger;
-
-import java.text.SimpleDateFormat;
-
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.TimeZone;
-
-/**
- * Methods that allow various Java types to be written as a DER
- * (Distinguished Encoding Rules) stream to the specified output stream.
- * DER is used to encode ASN.1 constructions, but this class provides no
- * methods for interacting with ASN.1. Rather, callers should construct
- * their output objects properly for whatever ASN.1 construct is being
- * output.
- *
- * <p>This class only defines static methods; there are no instance
- * variables needed.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class DERWriter implements DER
-{
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /** This class only has static methods. */
- private DERWriter()
- {
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- public static int write(OutputStream out, DERValue object)
- throws IOException
- {
- out.write(object.getExternalTag());
- Object value = object.getValue();
- if (value == null)
- {
- writeLength(out, 0);
- return 0;
- }
- if (value instanceof Boolean)
- return writeBoolean(out, (Boolean) value);
- else if (value instanceof BigInteger)
- return writeInteger(out, (BigInteger) value);
- else if (value instanceof Date)
- return writeDate(out, object.getExternalTag(), (Date) value);
- else if (value instanceof String)
- return writeString(out, object.getExternalTag(), (String) value);
- else if (value instanceof List)
- return writeSequence(out, (List) value);
- else if (value instanceof Set)
- return writeSet(out, (Set) value);
- else if (value instanceof BitString)
- return writeBitString(out, (BitString) value);
- else if (value instanceof OID)
- return writeOID(out, (OID) value);
- else if (value instanceof byte[])
- {
- writeLength(out, ((byte[]) value).length);
- out.write((byte[]) value);
- return ((byte[]) value).length;
- }
- else if (value instanceof DERValue)
- {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- write(bout, (DERValue) value);
- byte[] buf = bout.toByteArray();
- writeLength(out, buf.length);
- out.write(buf);
- return buf.length;
- }
- else
- throw new DEREncodingException("cannot encode " + value.getClass().getName());
- }
-
- public static int definiteEncodingSize(int length)
- {
- if (length < 128)
- return 1;
- else if (length < 256)
- return 2;
- else if (length < 65536)
- return 3;
- else if (length < 16777216)
- return 4;
- else
- return 5;
- }
-
- // Own methods.
- // ------------------------------------------------------------------------
-
- /**
- * Write a BOOLEAN type to the given output stream.
- *
- * @param out The sink output stream.
- * @param b The boolean value to write.
- */
- private static int writeBoolean(OutputStream out, Boolean b)
- throws IOException
- {
- writeLength(out, 1);
- if (b.booleanValue())
- out.write(0xFF);
- else
- out.write(0);
- return 1;
- }
-
- /**
- * Write an INTEGER type to the given output stream.
- *
- * @param out The sink output stream.
- * @param integer The integer to write.
- */
- private static int writeInteger(OutputStream out, BigInteger integer)
- throws IOException
- {
- byte[] bytes = integer.toByteArray();
- writeLength(out, bytes.length);
- out.write(bytes);
- return bytes.length;
- }
-
- private static int writeSequence(OutputStream out, List sequence)
- throws IOException
- {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- for (Iterator i = sequence.iterator(); i.hasNext(); )
- {
- write(bout, (DERValue) i.next());
- }
- byte[] buf = bout.toByteArray();
- writeLength(out, buf.length);
- out.write(buf);
- return buf.length;
- }
-
- private static int writeSet(OutputStream out, Set set)
- throws IOException
- {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- for (Iterator i = set.iterator(); i.hasNext(); )
- {
- write(bout, (DERValue) i.next());
- }
- byte[] buf = bout.toByteArray();
- writeLength(out, buf.length);
- out.write(buf);
- return buf.length;
- }
-
- private static int writeOID(OutputStream out, OID oid)
- throws IOException
- {
- byte[] der = oid.getDER();
- writeLength(out, der.length);
- out.write(der);
- return der.length;
- }
-
- private static int writeBitString(OutputStream out, BitString bs)
- throws IOException
- {
- byte[] buf = bs.getShiftedByteArray();
- out.write(buf.length + 1);
- out.write(bs.getIgnoredBits());
- out.write(buf);
- return buf.length;
- }
-
- private static int writeString(OutputStream out, int tag, String str)
- throws IOException
- {
- byte[] b = null;
- switch (tag & 0x1F)
- {
- case NUMERIC_STRING:
- case PRINTABLE_STRING:
- case T61_STRING:
- case VIDEOTEX_STRING:
- case IA5_STRING:
- case GRAPHIC_STRING:
- case ISO646_STRING:
- case GENERAL_STRING:
- b = toIso88591(str);
- break;
-
- case UNIVERSAL_STRING:
- case BMP_STRING:
- b = toUtf16Be(str);
- break;
-
- case UTF8_STRING:
- default:
- b = toUtf8(str);
- break;
- }
- writeLength(out, b.length);
- out.write(b);
- return b.length;
- }
-
- private static byte[] toIso88591(String string)
- {
- byte[] result = new byte[string.length()];
- for (int i = 0; i < string.length(); i++)
- result[i] = (byte) string.charAt(i);
- return result;
- }
-
- private static byte[] toUtf16Be(String string)
- {
- byte[] result = new byte[string.length() * 2];
- for (int i = 0; i < string.length(); i++)
- {
- result[i*2 ] = (byte) ((string.charAt(i) >>> 8) & 0xFF);
- result[i*2+1] = (byte) (string.charAt(i) & 0xFF);
- }
- return result;
- }
-
- private static byte[] toUtf8(String string)
- {
- ByteArrayOutputStream buf =
- new ByteArrayOutputStream((int)(string.length() * 1.5));
- for (int i = 0; i < string.length(); i++)
- {
- char c = string.charAt(i);
- if (c < 0x0080)
- buf.write(c & 0xFF);
- else if (c < 0x0800)
- {
- buf.write(0xC0 | ((c >>> 6) & 0x3F));
- buf.write(0x80 | (c & 0x3F));
- }
- else
- {
- buf.write(0xE0 | ((c >>> 12) & 0x0F));
- buf.write(0x80 | ((c >>> 6) & 0x3F));
- buf.write(0x80 | (c & 0x3F));
- }
- }
- return buf.toByteArray();
- }
-
- private static int writeDate(OutputStream out, int tag, Date date)
- throws IOException
- {
- SimpleDateFormat sdf = null;
- if ((tag & 0x1F) == UTC_TIME)
- sdf = new SimpleDateFormat("yyMMddHHmmss'Z'");
- else
- sdf = new SimpleDateFormat("yyyyMMddHHmmss'.'SSS'Z'");
- sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
- byte[] b = sdf.format(date).getBytes("ISO-8859-1");
- writeLength(out, b.length);
- out.write(b);
- return b.length;
- }
-
- // Package method.
- // ------------------------------------------------------------------------
-
- static void writeLength(OutputStream out, int len) throws IOException
- {
- if (len < 128)
- out.write(len);
- else if (len < 256)
- {
- out.write(0x81);
- out.write(len);
- }
- else if (len < 65536)
- {
- out.write(0x82);
- out.write(len >> 8);
- out.write(len);
- }
- else if (len < 16777216)
- {
- out.write(0x83);
- out.write(len >> 16);
- out.write(len >> 8);
- out.write(len);
- }
- else
- {
- out.write(0x84);
- out.write(len >> 24);
- out.write(len >> 16);
- out.write(len >> 8);
- out.write(len);
- }
- }
-}
diff --git a/libjava/gnu/java/security/pkcs/PKCS7SignedData.java b/libjava/gnu/java/security/pkcs/PKCS7SignedData.java
deleted file mode 100644
index ba5efc7222f..00000000000
--- a/libjava/gnu/java/security/pkcs/PKCS7SignedData.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/* PKCS7SignedData.java -- reader for PKCS#7 signedData objects
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.pkcs;
-
-import gnu.java.security.OID;
-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.DERValue;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import java.math.BigInteger;
-
-import java.security.cert.CRL;
-import java.security.cert.CRLException;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * The SignedData object in PKCS #7. This is a read-only implementation of
- * this format, and is used to provide signed Jar file support.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class PKCS7SignedData
-{
-
- public static final OID PKCS7_DATA = new OID("1.2.840.113549.1.7.1");
- public static final OID PKCS7_SIGNED_DATA = new OID("1.2.840.113549.1.7.2");
-
- private BigInteger version;
- private Set digestAlgorithms;
- private OID contentType;
- private byte[] content;
- private Certificate[] certificates;
- private CRL[] crls;
- private Set signerInfos;
-
- private static final boolean DEBUG = false;
- private static void debug(String msg)
- {
- System.err.print("PKCS7SignedData >> ");
- System.err.println(msg);
- }
-
- public PKCS7SignedData(InputStream in)
- throws CRLException, CertificateException, IOException
- {
- this(new BERReader(in));
- }
-
- /**
- * Parse an encoded PKCS#7 SignedData object. The ASN.1 format of this
- * object is:
- *
- * <pre>
- * SignedData ::= SEQUENCE {
- * version Version,
- * digestAlgorithms DigestAlgorithmIdentifiers,
- * contentInfo ContentInfo,
- * certificates
- * [0] IMPLICIT ExtendedCertificatesAndCertificates OPTIONAL,
- * crls
- * [1] IMPLICIT CertificateRevocationLists OPTIONAL,
- * signerInfos SignerInfos }
- *
- * Version ::= INTEGER
- *
- * DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier
- *
- * DigestAlgorithmIdentifier ::= AlgorithmIdentifier
- *
- * ContentInfo ::= SEQUENCE {
- * contentType ContentType,
- * content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
- *
- * ContentType ::= OBJECT IDENTIFIER
- *
- * ExtendedCertificatesAndCertificates ::=
- * SET OF ExtendedCertificatesAndCertificate
- *
- * ExtendedCertificatesAndCertificate ::= CHOICE {
- * certificate Certificate, -- from X.509
- * extendedCertificate [0] IMPLICIT ExtendedCertificate }
- *
- * CertificateRevocationLists ::= SET OF CertificateRevocationList
- * -- from X.509
- *
- * SignerInfos ::= SET OF SignerInfo
- *
- * SignerInfo ::= SEQUENCE {
- * version Version,
- * issuerAndSerialNumber IssuerAndSerialNumber,
- * digestAlgorithm DigestAlgorithmIdentifier,
- * authenticatedAttributes
- * [0] IMPLICIT Attributes OPTIONAL,
- * digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
- * encryptedDigest EncryptedDigest,
- * unauthenticatedAttributes
- * [1] IMPLICIT Attributes OPTIONAL }
- *
- * EncryptedDigest ::= OCTET STRING
- * </pre>
- *
- * <p>(Readers who are confused as to why it takes 40 levels of indirection
- * to specify "data with a signature", rest assured that the present author
- * is as confused as you are).</p>
- */
- public PKCS7SignedData(BERReader ber)
- throws CRLException, CertificateException, IOException
- {
- CertificateFactory x509 = CertificateFactory.getInstance("X509");
- DERValue val = ber.read();
- if (!val.isConstructed())
- throw new BEREncodingException("malformed ContentInfo");
-
- val = ber.read();
- if (val.getTag() != BER.OBJECT_IDENTIFIER)
- throw new BEREncodingException("malformed ContentType");
-
- if (!PKCS7_SIGNED_DATA.equals(val.getValue()))
- throw new BEREncodingException("content is not SignedData");
-
- val = ber.read();
- if (val.getTag() != 0)
- throw new BEREncodingException("malformed Content");
-
- val = ber.read();
- if (!val.isConstructed())
- throw new BEREncodingException("malformed SignedData");
-
- if (DEBUG)
- debug("SignedData: " + val);
-
- val = ber.read();
- if (val.getTag() != BER.INTEGER)
- throw new BEREncodingException("expecting Version");
- version = (BigInteger) val.getValue();
-
- if (DEBUG)
- debug(" Version: " + version);
-
- digestAlgorithms = new HashSet();
- val = ber.read();
- if (!val.isConstructed())
- throw new BEREncodingException("malformed DigestAlgorithmIdentifiers");
- if (DEBUG)
- debug(" DigestAlgorithmIdentifiers: " + val);
- int count = 0;
- DERValue val2 = ber.read();
- while (val2 != BER.END_OF_SEQUENCE &&
- (val.getLength() > 0 && val.getLength() > count))
- {
- if (!val2.isConstructed())
- throw new BEREncodingException("malformed AlgorithmIdentifier");
- if (DEBUG)
- debug(" AlgorithmIdentifier: " + val2);
- count += val2.getEncodedLength();
- val2 = ber.read();
- if (val2.getTag() != BER.OBJECT_IDENTIFIER)
- throw new BEREncodingException("malformed AlgorithmIdentifier");
- if (DEBUG)
- debug(" ID: " + val2.getValue());
- List algId = new ArrayList(2);
- algId.add(val2.getValue());
- val2 = ber.read();
- if (val2 != BER.END_OF_SEQUENCE)
- {
- count += val2.getEncodedLength();
- if (val2.getTag() == BER.NULL)
- algId.add(null);
- else
- algId.add(val2.getEncoded());
- if (DEBUG)
- debug(" params: " + new BigInteger(1, val2.getEncoded()).toString(16));
- if (val2.isConstructed())
- ber.skip(val2.getLength());
- if (BERValue.isIndefinite(val))
- val2 = ber.read();
- }
- else
- algId.add(null);
- digestAlgorithms.add(algId);
- }
-
- val = ber.read();
- if (!val.isConstructed())
- throw new BEREncodingException("malformed ContentInfo");
- if (DEBUG)
- debug(" ContentInfo: " + val);
- val2 = ber.read();
- if (val2.getTag() != BER.OBJECT_IDENTIFIER)
- throw new BEREncodingException("malformed ContentType");
- contentType = (OID) val2.getValue();
- if (DEBUG)
- debug(" ContentType: " + contentType);
- if (BERValue.isIndefinite(val)
- || (val.getLength() > 0 && val.getLength() > val2.getEncodedLength()))
- {
- val2 = ber.read();
- if (val2 != BER.END_OF_SEQUENCE)
- {
- content = val2.getEncoded();
- if (BERValue.isIndefinite(val))
- val2 = ber.read();
- if (DEBUG)
- debug(" Content: " + new BigInteger(1, content).toString(16));
- }
- }
-
- val = ber.read();
- if (val.getTag() == 0)
- {
- if (!val.isConstructed())
- throw new BEREncodingException("malformed ExtendedCertificatesAndCertificates");
- if (DEBUG)
- debug(" ExtendedCertificatesAndCertificates: " + val);
- count = 0;
- val2 = ber.read();
- List certs = new LinkedList();
- while (val2 != BER.END_OF_SEQUENCE &&
- (val.getLength() > 0 && val.getLength() > count))
- {
- Certificate cert =
- x509.generateCertificate(new ByteArrayInputStream(val2.getEncoded()));
- if (DEBUG)
- debug(" Certificate: " + cert);
- certs.add(cert);
- count += val2.getEncodedLength();
- ber.skip(val2.getLength());
- if (BERValue.isIndefinite(val) || val.getLength() > count)
- val2 = ber.read();
- }
- certificates = (Certificate[]) certs.toArray(new Certificate[certs.size()]);
- val = ber.read();
- }
-
- if (val.getTag() == 1)
- {
- if (!val.isConstructed())
- throw new BEREncodingException("malformed CertificateRevocationLists");
- if (DEBUG)
- debug(" CertificateRevocationLists: " + val);
- count = 0;
- val2 = ber.read();
- List crls = new LinkedList();
- while (val2 != BER.END_OF_SEQUENCE &&
- (val.getLength() > 0 && val.getLength() > count))
- {
- CRL crl = x509.generateCRL(new ByteArrayInputStream(val2.getEncoded()));
- if (DEBUG)
- debug (" CRL: " + crl);
- crls.add(crl);
- count += val2.getEncodedLength();
- ber.skip(val2.getLength());
- if (BERValue.isIndefinite(val) || val.getLength() > count)
- val2 = ber.read();
- }
- this.crls = (CRL[]) crls.toArray(new CRL[crls.size()]);
- val = ber.read();
- }
-
- signerInfos = new HashSet();
- if (!val.isConstructed())
- throw new BEREncodingException("malformed SignerInfos");
-
- if (DEBUG)
- debug(" SignerInfos: " + val);
-
- // FIXME read this more carefully.
- // Since we are just reading a file (probably) we just read until we
- // reach the end.
- while (true)
- {
- int i = ber.peek();
- if (i == 0 || i == -1)
- break;
- signerInfos.add(new SignerInfo(ber));
- }
- }
-
- public BigInteger getVersion()
- {
- return version;
- }
-
- public Certificate[] getCertificates()
- {
- return (certificates != null ? (Certificate[]) certificates.clone()
- : null);
- }
-
- public OID getContentType()
- {
- return contentType;
- }
-
- public byte[] getContent()
- {
- return (content != null ? (byte[]) content.clone() : null);
- }
-
- public Set getDigestAlgorithms()
- {
- // FIXME copy contents too, they are mutable!!!
- return Collections.unmodifiableSet(digestAlgorithms);
- }
-
- public Set getSignerInfos()
- {
- Set copy = new HashSet();
- for (Iterator it = signerInfos.iterator(); it.hasNext(); )
- copy.add(it.next());
- return Collections.unmodifiableSet(copy);
- }
-}
diff --git a/libjava/gnu/java/security/pkcs/SignerInfo.java b/libjava/gnu/java/security/pkcs/SignerInfo.java
deleted file mode 100644
index c976799bb0c..00000000000
--- a/libjava/gnu/java/security/pkcs/SignerInfo.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/* SignerInfo.java -- a SignerInfo object, from PKCS #7
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.pkcs;
-
-import gnu.java.security.OID;
-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.DERValue;
-
-import java.io.IOException;
-
-import java.math.BigInteger;
-
-import javax.security.auth.x500.X500Principal;
-
-public class SignerInfo
-{
- private final BigInteger version;
- private final BigInteger serialNumber;
- private final X500Principal issuer;
- private final OID digestAlgorithmId;
- private final byte[] digestAlgorithmParams;
- private final byte[] authenticatedAttributes;
- private final OID digestEncryptionAlgorithmId;
- private final byte[] digestEncryptionAlgorithmParams;
- private final byte[] encryptedDigest;
- private final byte[] unauthenticatedAttributes;
-
- private static final boolean DEBUG = false;
- private static void debug(String msg)
- {
- System.err.print("SignerInfo >> ");
- System.err.println(msg);
- }
-
- /**
- * Parse a SignerInfo object.
- */
- public SignerInfo(BERReader ber) throws IOException
- {
- DERValue val = ber.read();
- if (DEBUG)
- debug("SignerInfo: " + val);
- if (!val.isConstructed())
- throw new BEREncodingException("malformed SignerInfo");
-
- val = ber.read();
- if (val.getTag() != BER.INTEGER)
- throw new BEREncodingException("malformed Version");
- version = (BigInteger) val.getValue();
-
- if (DEBUG)
- debug(" Version: " + version);
-
- val = ber.read();
- if (!val.isConstructed())
- throw new BEREncodingException("malformed IssuerAndSerialNumber");
-
- if (DEBUG)
- debug(" IssuerAndSerialNumber: " + val);
-
- val = ber.read();
- if (!val.isConstructed())
- throw new BEREncodingException("malformed Issuer");
- issuer = new X500Principal(val.getEncoded());
- ber.skip(val.getLength());
- if (DEBUG)
- debug(" Issuer: " + issuer);
-
- val = ber.read();
- if (val.getTag() != BER.INTEGER)
- throw new BEREncodingException("malformed SerialNumber");
- serialNumber = (BigInteger) val.getValue();
- if (DEBUG)
- debug(" SerialNumber: " + serialNumber);
-
- val = ber.read();
- if (!val.isConstructed())
- throw new BEREncodingException("malformed DigestAlgorithmIdentifier");
- if (DEBUG)
- debug(" DigestAlgorithmIdentifier: " + val);
-
- int count = 0;
- DERValue val2 = ber.read();
- if (val2.getTag() != BER.OBJECT_IDENTIFIER)
- throw new BEREncodingException("malformed AlgorithmIdentifier");
- digestAlgorithmId = (OID) val2.getValue();
- if (DEBUG)
- debug(" OID: " + digestAlgorithmId);
-
- if (BERValue.isIndefinite(val))
- {
- val2 = ber.read();
- if (val2 != BER.END_OF_SEQUENCE)
- {
- digestAlgorithmParams = val2.getEncoded();
- val2 = ber.read();
- if (val2 != BER.END_OF_SEQUENCE)
- throw new BEREncodingException("expecting BER end-of-sequence");
- }
- else
- digestAlgorithmParams = null;
- }
- else if (val2.getEncodedLength() < val.getLength())
- {
- val2 = ber.read();
- digestAlgorithmParams = val2.getEncoded();
- if (val2.isConstructed())
- ber.skip(val2.getLength());
- }
- else
- digestAlgorithmParams = null;
- if(DEBUG)
- debug(" params: " + (digestAlgorithmParams == null ? null
- : new BigInteger(digestAlgorithmParams).toString(16)));
-
- val = ber.read();
- if (val.getTag() == 0)
- {
- authenticatedAttributes = val.getEncoded();
- val = ber.read();
- if (val.isConstructed())
- ber.skip(val.getLength());
- if (DEBUG)
- debug(" AuthenticatedAttributes: " + val);
- val = ber.read();
- }
- else
- authenticatedAttributes = null;
-
- if (!val.isConstructed())
- throw new BEREncodingException("malformed DigestEncryptionAlgorithmIdentifier");
- if (DEBUG)
- debug(" DigestEncryptionAlgorithmIdentifier: " + val);
- count = 0;
- val2 = ber.read();
- if (val2.getTag() != BER.OBJECT_IDENTIFIER)
- throw new BEREncodingException("malformed AlgorithmIdentifier");
- digestEncryptionAlgorithmId = (OID) val2.getValue();
- if (DEBUG)
- debug(" OID: " + digestEncryptionAlgorithmId);
-
- if (BERValue.isIndefinite(val))
- {
- val2 = ber.read();
- if (val2 != BER.END_OF_SEQUENCE)
- {
- digestEncryptionAlgorithmParams = val2.getEncoded();
- val2 = ber.read();
- if (val2 != BER.END_OF_SEQUENCE)
- throw new BEREncodingException("expecting BER end-of-sequence");
- }
- else
- digestEncryptionAlgorithmParams = null;
- }
- else if (val2.getEncodedLength() < val.getLength())
- {
- val2 = ber.read();
- digestEncryptionAlgorithmParams = val2.getEncoded();
- if (val2.isConstructed())
- ber.skip(val2.getLength());
- }
- else
- digestEncryptionAlgorithmParams = null;
- if(DEBUG)
- debug(" params: " + (digestEncryptionAlgorithmParams == null ? null
- : new BigInteger(digestEncryptionAlgorithmParams).toString(16)));
-
- val = ber.read();
- if (val.getTag() != BER.OCTET_STRING)
- throw new BEREncodingException("malformed EncryptedDigest");
- encryptedDigest = (byte[]) val.getValue();
- if (DEBUG)
- debug(" EncryptedDigest: " + new BigInteger(1, encryptedDigest).toString(16));
-
- if (ber.peek() == 1)
- unauthenticatedAttributes = ber.read().getEncoded();
- else
- unauthenticatedAttributes = null;
-
- if (ber.peek() == 0)
- ber.read();
- }
-
- public BigInteger getVersion()
- {
- return version;
- }
-
- public BigInteger getSerialNumber()
- {
- return serialNumber;
- }
-
- public X500Principal getIssuer()
- {
- return issuer;
- }
-
- public OID getDigestAlgorithmId()
- {
- return digestAlgorithmId;
- }
-
- public byte[] getDigestAlgorithmParams()
- {
- return (digestAlgorithmParams != null
- ? (byte[]) digestAlgorithmParams.clone()
- : null);
- }
-
- public byte[] getAuthenticatedAttributes()
- {
- return (authenticatedAttributes != null
- ? (byte[]) authenticatedAttributes.clone()
- : null);
- }
-
- public OID getDigestEncryptionAlgorithmId()
- {
- return digestEncryptionAlgorithmId;
- }
-
- public byte[] getDigestEncryptionAlgorithmParams()
- {
- return (digestEncryptionAlgorithmParams != null
- ? (byte[]) digestEncryptionAlgorithmParams.clone()
- : null);
- }
-
- public byte[] getEncryptedDigest()
- {
- return (encryptedDigest != null ? (byte[]) encryptedDigest.clone() : null);
- }
-
- public byte[] getUnauthenticatedAttributes()
- {
- return (unauthenticatedAttributes != null
- ? (byte[]) unauthenticatedAttributes.clone()
- : null);
- }
-}
diff --git a/libjava/gnu/java/security/provider/CollectionCertStoreImpl.java b/libjava/gnu/java/security/provider/CollectionCertStoreImpl.java
deleted file mode 100644
index 4bf3d5434ef..00000000000
--- a/libjava/gnu/java/security/provider/CollectionCertStoreImpl.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* CollectionCertStore.java -- Collection-based cert store.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.cert.CRL;
-import java.security.cert.CRLSelector;
-import java.security.cert.CertSelector;
-import java.security.cert.CertStoreException;
-import java.security.cert.CertStoreParameters;
-import java.security.cert.CertStoreSpi;
-import java.security.cert.Certificate;
-import java.security.cert.CollectionCertStoreParameters;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-
-public final class CollectionCertStoreImpl extends CertStoreSpi
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final Collection store;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public CollectionCertStoreImpl(CertStoreParameters params)
- throws InvalidAlgorithmParameterException
- {
- super(params);
- if (! (params instanceof CollectionCertStoreParameters))
- throw new InvalidAlgorithmParameterException("not a CollectionCertStoreParameters object");
- store = ((CollectionCertStoreParameters) params).getCollection();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public Collection engineGetCertificates(CertSelector selector)
- throws CertStoreException
- {
- LinkedList result = new LinkedList();
- for (Iterator it = store.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if ((o instanceof Certificate) && selector.match((Certificate) o))
- result.add(o);
- }
- return result;
- }
-
- public Collection engineGetCRLs(CRLSelector selector)
- throws CertStoreException
- {
- LinkedList result = new LinkedList();
- for (Iterator it = store.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if ((o instanceof CRL) && selector.match((CRL) o))
- result.add(o);
- }
- return result;
- }
-}
diff --git a/libjava/gnu/java/security/provider/DSAKeyFactory.java b/libjava/gnu/java/security/provider/DSAKeyFactory.java
deleted file mode 100644
index 7e154e27473..00000000000
--- a/libjava/gnu/java/security/provider/DSAKeyFactory.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/* DSAKeyFactory.java -- DSA key factory.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.KeyFactorySpi;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.interfaces.DSAPrivateKey;
-import java.security.interfaces.DSAPublicKey;
-import java.security.spec.DSAPrivateKeySpec;
-import java.security.spec.DSAPublicKeySpec;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-
-/**
- * DSA key factory.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class DSAKeyFactory extends KeyFactorySpi
-{
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- public DSAKeyFactory()
- {
- super();
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- protected PrivateKey engineGeneratePrivate(KeySpec keySpec)
- throws InvalidKeySpecException
- {
- if (!(keySpec instanceof DSAPrivateKeySpec))
- throw new InvalidKeySpecException();
- return new GnuDSAPrivateKey(
- ((DSAPrivateKeySpec) keySpec).getX(),
- ((DSAPrivateKeySpec) keySpec).getP(),
- ((DSAPrivateKeySpec) keySpec).getQ(),
- ((DSAPrivateKeySpec) keySpec).getG());
- }
-
- protected PublicKey engineGeneratePublic(KeySpec keySpec)
- throws InvalidKeySpecException
- {
- if (!(keySpec instanceof DSAPublicKeySpec))
- throw new InvalidKeySpecException();
- return new GnuDSAPublicKey(
- ((DSAPublicKeySpec) keySpec).getY(),
- ((DSAPublicKeySpec) keySpec).getP(),
- ((DSAPublicKeySpec) keySpec).getQ(),
- ((DSAPublicKeySpec) keySpec).getG());
- }
-
- protected KeySpec engineGetKeySpec(Key key, Class keySpec)
- throws InvalidKeySpecException
- {
- if ((key instanceof DSAPublicKey) &&
- keySpec.isAssignableFrom(DSAPublicKeySpec.class))
- {
- return new DSAPublicKeySpec(((DSAPublicKey) key).getY(),
- ((DSAPublicKey) key).getParams().getP(),
- ((DSAPublicKey) key).getParams().getQ(),
- ((DSAPublicKey) key).getParams().getG());
- }
- if ((key instanceof DSAPrivateKey) &&
- keySpec.isAssignableFrom(DSAPrivateKeySpec.class))
- {
- return new DSAPrivateKeySpec(((DSAPrivateKey) key).getX(),
- ((DSAPrivateKey) key).getParams().getP(),
- ((DSAPrivateKey) key).getParams().getQ(),
- ((DSAPrivateKey) key).getParams().getG());
- }
- throw new InvalidKeySpecException();
- }
-
- protected Key engineTranslateKey(Key key) throws InvalidKeyException
- {
- if ((key instanceof GnuDSAPublicKey) || (key instanceof GnuDSAPrivateKey))
- return key;
- if (key instanceof DSAPublicKey)
- return new GnuDSAPublicKey(((DSAPublicKey) key).getY(),
- ((DSAPublicKey) key).getParams().getP(),
- ((DSAPublicKey) key).getParams().getQ(),
- ((DSAPublicKey) key).getParams().getG());
- if (key instanceof DSAPrivateKey)
- return new GnuDSAPrivateKey(((DSAPrivateKey) key).getX(),
- ((DSAPrivateKey) key).getParams().getP(),
- ((DSAPrivateKey) key).getParams().getQ(),
- ((DSAPrivateKey) key).getParams().getG());
- throw new InvalidKeyException();
- }
-}
diff --git a/libjava/gnu/java/security/provider/DSAKeyPairGenerator.java b/libjava/gnu/java/security/provider/DSAKeyPairGenerator.java
deleted file mode 100644
index 2c643d5c367..00000000000
--- a/libjava/gnu/java/security/provider/DSAKeyPairGenerator.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* GnuDSAKeyPairGenerator.java --- Gnu DSA Key Pair Generator
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.math.BigInteger;
-import java.security.AlgorithmParameterGenerator;
-import java.security.AlgorithmParameters;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidParameterException;
-import java.security.KeyPair;
-import java.security.KeyPairGeneratorSpi;
-import java.security.SecureRandom;
-import java.security.interfaces.DSAParams;
-import java.security.spec.AlgorithmParameterSpec;
-import java.security.spec.DSAParameterSpec;
-import java.util.Random;
-
-public class DSAKeyPairGenerator extends KeyPairGeneratorSpi
- implements java.security.interfaces.DSAKeyPairGenerator
-{
-int keysize;
-SecureRandom random;
-private BigInteger q = null; // the small prime
-private BigInteger p = null; // the big prime
-private BigInteger g = null;
-
-DSAKeyPairGenerator()
-{
- keysize = 1024;
-}
-
-public void initialize(int keysize, SecureRandom random)
-{
- //if( ((keysize % 64) != 0) || (keysize < 512) || (keysize > 1024) )
- // throw new InvalidAlgorithmParameterException("Invalid key size");
-
- this.keysize = keysize;
- this.random = random;
-}
-
-public void initialize(AlgorithmParameterSpec params,
- SecureRandom random)
- throws InvalidAlgorithmParameterException
-{
- if( !( params instanceof DSAParameterSpec ) )
- throw new InvalidAlgorithmParameterException("Must be DSAParameterSpec");
-
- DSAParameterSpec dsaparameterspec = (DSAParameterSpec)params;
- p = dsaparameterspec.getP();
- q = dsaparameterspec.getQ();
- g = dsaparameterspec.getG();
- this.random = random;
-}
-
-public void initialize(DSAParams params, SecureRandom random)
- throws InvalidParameterException
-{
- if(params.getP() != null)
- p = params.getP();
- else
- throw new InvalidParameterException();
-
- if(params.getQ() != null)
- q = params.getQ();
- else
- throw new InvalidParameterException();
-
- if(params.getG() != null)
- g = params.getG();
- else
- throw new InvalidParameterException();
-
- this.random = random;
-}
-
-public void initialize(int modlen, boolean genParams, SecureRandom random)
- throws InvalidParameterException
-{
- if( ((modlen % 64) != 0) || (modlen < 512) || (modlen > 1024) )
- throw new InvalidParameterException();
-
- if( (genParams == false) && (modlen != 512) && (modlen != 768) && (modlen != 1024) )
- throw new InvalidParameterException();
- this.keysize = modlen;
- this.random = random;
- p = null;
- q = null;
- g = null;
-}
-
-public KeyPair generateKeyPair()
-{
- if( getDefaults() == false) {
- try {
- AlgorithmParameterGenerator apgDSA = AlgorithmParameterGenerator.getInstance("DSA");
- AlgorithmParameters apDSA = apgDSA.generateParameters();
- DSAParameterSpec dsaparameterspec = (DSAParameterSpec)apDSA.getParameterSpec( DSAParameterSpec.class );
- p = dsaparameterspec.getP();
- q = dsaparameterspec.getQ();
- g = dsaparameterspec.getG();
- } catch ( Exception e ) {
- return null;
- }
- }
-
- BigInteger x = new BigInteger( 159, new Random() );
-
- BigInteger y = g.modPow( x, p );
-
- return new KeyPair( new GnuDSAPublicKey(y,p,q,g), new GnuDSAPrivateKey(x,p,q,g));
- //return new KeyPair( public, private );
-}
-
-//These constants are Sun's Constants copied from the
-//Cryptography Specification
-private boolean getDefaults()
-{
- if( keysize == 512) {
- p = new BigInteger("fca682ce8e12caba26efccf7110e526db078b05edecbcd1eb4a208f3ae1617ae01f35b91a47e6df63413c5e12ed0899bcd132acd50d99151bdc43ee737592e17", 16);
- q = new BigInteger("962eddcc369cba8ebb260ee6b6a126d9346e38c5", 16);
- g = new BigInteger("678471b27a9cf44ee91a49c5147db1a9aaf244f05a434d6486931d2d14271b9e35030b71fd73da179069b32e2935630e1c2062354d0da20a6c416e50be794ca4", 16);
- return true;
- } else if( keysize == 768) {
- p = new BigInteger("e9e642599d355f37c97ffd3567120b8e25c9cd43e927b3a9670fbec5d890141922d2c3b3ad2480093799869d1e846aab49fab0ad26d2ce6a22219d470bce7d777d4a21fbe9c270b57f607002f3cef8393694cf45ee3688c11a8c56ab127a3daf", 16);
- q = new BigInteger("9cdbd84c9f1ac2f38d0f80f42ab952e7338bf511", 16);
- g = new BigInteger("30470ad5a005fb14ce2d9dcd87e38bc7d1b1c5facbaecbe95f190aa7a31d23c4dbbcbe06174544401a5b2c020965d8c2bd2171d3668445771f74ba084d2029d83c1c158547f3a9f1a2715be23d51ae4d3e5a1f6a7064f316933a346d3f529252", 16);
- } else if( keysize == 512) {
- p = new BigInteger("fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c7", 16);
- q = new BigInteger("9760508f15230bccb292b982a2eb840bf0581cf5", 16);
- g = new BigInteger("f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a", 16);
- }
- return false;
-}
-
-}
diff --git a/libjava/gnu/java/security/provider/DSAParameterGenerator.java b/libjava/gnu/java/security/provider/DSAParameterGenerator.java
deleted file mode 100644
index ccec1136cd3..00000000000
--- a/libjava/gnu/java/security/provider/DSAParameterGenerator.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* DSAParameterGenerator.java --- DSA Parameter Generator Implementation
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import gnu.java.security.util.Prime;
-
-import java.math.BigInteger;
-import java.security.AlgorithmParameterGeneratorSpi;
-import java.security.AlgorithmParameters;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.security.spec.AlgorithmParameterSpec;
-import java.security.spec.DSAParameterSpec;
-import java.security.spec.InvalidParameterSpecException;
-import java.util.Random;
-
-public class DSAParameterGenerator extends AlgorithmParameterGeneratorSpi
-{
- private int size;
- private SecureRandom random = null;
-
- public DSAParameterGenerator()
- {
- size = 1024;
- }
-
- public void engineInit(int size, SecureRandom random)
- {
- if( (size < 512) || (size > 1024) || ( (size % 64) != 0) )
- //throw new InvalidAlgorithmParameterException("Invalid Size");
- return;
- this.size = size;
- this.random = random;
- }
-
- public void engineInit(AlgorithmParameterSpec genParamSpec, SecureRandom random)
- throws InvalidAlgorithmParameterException
- {
- if( !( genParamSpec instanceof DSAParameterSpec ) )
- throw new InvalidAlgorithmParameterException("Must be DSAParameterSpec");
-
- DSAParameterSpec dsaparameterspec = (DSAParameterSpec)genParamSpec;
- int tmp = dsaparameterspec.getP().bitLength();
-
- if( (tmp < 512) || (tmp > 1024) || ( (tmp % 64) != 0) )
- throw new InvalidAlgorithmParameterException("Invalid Size");
-
- this.random = random;
- }
-
- //For more information see IEEE P1363 A.16.1 (10/05/98 Draft)
- public AlgorithmParameters engineGenerateParameters()
- {
- DSAParameterSpec dsaparameterspec;
-
- int L = size;
- BigInteger r, p, k, h, g;
-
- //q 2^159 < q < 2^160
- r = Prime.generateRandomPrime( 159, 160, BigInteger.valueOf(1));
-
- // 2^(L-1) < p < 2^L
- p = Prime.generateRandomPrime( r, BigInteger.valueOf(1), L - 1, L, BigInteger.valueOf(1));
-
- k = p.subtract( BigInteger.valueOf(1) );
- k = k.divide( r );
-
- Random rand = new Random();
- h = BigInteger.valueOf(1);
-
- for(;;) {
- h = h.add(BigInteger.valueOf( 1 ) );
-
- g = h.modPow(k, p);
-
- if( g.compareTo( BigInteger.valueOf(1) ) != 1 )
- break;
- }
-
- try {
- dsaparameterspec = new DSAParameterSpec(p, r, g);
- AlgorithmParameters ap = AlgorithmParameters.getInstance("DSA");
- ap.init( dsaparameterspec );
- return ap;
- } catch ( NoSuchAlgorithmException nsae ) {
- return null;
- } catch ( InvalidParameterSpecException ipse) {
- return null;
- }
- }
-}
diff --git a/libjava/gnu/java/security/provider/DSAParameters.java b/libjava/gnu/java/security/provider/DSAParameters.java
deleted file mode 100644
index 77d648956ee..00000000000
--- a/libjava/gnu/java/security/provider/DSAParameters.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/* DSAParameters.java --- DSA Parameters Implementation
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import gnu.java.io.ASN1ParsingException;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-import gnu.java.security.der.DERWriter;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.math.BigInteger;
-import java.security.AlgorithmParametersSpi;
-import java.security.spec.AlgorithmParameterSpec;
-import java.security.spec.DSAParameterSpec;
-import java.security.spec.InvalidParameterSpecException;
-import java.util.ArrayList;
-
-/*
- ASN.1 Encoding for DSA from rfc2459
-
- id-dsa ID ::= { iso(1) member-body(2) us(840) x9-57(10040)
- x9cm(4) 1 }
-
- Dss-Parms ::= SEQUENCE {
- p INTEGER,
- q INTEGER,
- g INTEGER }
-
-*/
-public class DSAParameters extends AlgorithmParametersSpi
-{
-private BigInteger q; // the small prime
-private BigInteger p; // the big prime
-private BigInteger g;
-
-
-public void engineInit(AlgorithmParameterSpec paramSpec)
- throws InvalidParameterSpecException
-{
- if( paramSpec instanceof DSAParameterSpec ) {
- DSAParameterSpec dsaParamSpec = (DSAParameterSpec)paramSpec;
- p = dsaParamSpec.getP();
- q = dsaParamSpec.getQ();
- g = dsaParamSpec.getG();
- }
- else
- throw new InvalidParameterSpecException("Only accepts DSAParameterSpec");
-}
-
-public void engineInit(byte[] params)
- throws IOException
-{
- DERReader in = new DERReader(params);
- DERValue val = in.read();
- if (val.getValue() != DER.CONSTRUCTED_VALUE)
- throw new ASN1ParsingException("badly formed parameters");
- try
- {
- p = (BigInteger) in.read().getValue();
- q = (BigInteger) in.read().getValue();
- g = (BigInteger) in.read().getValue();
- }
- catch (Exception x)
- {
- throw new ASN1ParsingException("badly formed parameters");
- }
-}
-
-public void engineInit(byte[] params, String format)
- throws IOException
-{
- if( !format.equals("ASN.1") )
- throw new IOException("Invalid Format: Only accepts ASN.1");
- engineInit( params );
-}
-
-public AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
- throws InvalidParameterSpecException
-{
- if( paramSpec.isAssignableFrom(DSAParameterSpec.class) )
- return new DSAParameterSpec(p, q, g);
- else
- throw new InvalidParameterSpecException("Only accepts DSAParameterSpec");
-}
-
-public byte[] engineGetEncoded()
- throws IOException
-{
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- ArrayList seq = new ArrayList(3);
- seq.add(new DERValue(DER.INTEGER, p));
- seq.add(new DERValue(DER.INTEGER, q));
- seq.add(new DERValue(DER.INTEGER, g));
- DERWriter.write(bout, new DERValue(DER.CONSTRUCTED | DER.SEQUENCE, seq));
- return bout.toByteArray();
-}
-
-
-public byte[] engineGetEncoded(String format)
- throws IOException
-{
- if( !format.equals("ASN.1") )
- throw new IOException("Invalid Format: Only accepts ASN.1");
- return engineGetEncoded();
-}
-
-public String engineToString()
-{
- return ("q: " + q + " p: " + p + " g: " + g);
-}
-
-}
diff --git a/libjava/gnu/java/security/provider/DSASignature.java b/libjava/gnu/java/security/provider/DSASignature.java
deleted file mode 100644
index 1d3875d28e3..00000000000
--- a/libjava/gnu/java/security/provider/DSASignature.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/* DSASignature.java --
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-import gnu.java.security.der.DERWriter;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.math.BigInteger;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.InvalidParameterException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.SecureRandom;
-import java.security.SignatureException;
-import java.security.SignatureSpi;
-import java.security.interfaces.DSAPrivateKey;
-import java.security.interfaces.DSAPublicKey;
-import java.security.spec.AlgorithmParameterSpec;
-import java.util.ArrayList;
-import java.util.Random;
-
-public class DSASignature extends SignatureSpi
-{
- private DSAPublicKey publicKey;
- private DSAPrivateKey privateKey;
- private final MessageDigest digest;
- private final SecureRandom random;
-
- public DSASignature() throws NoSuchAlgorithmException
- {
- random = new SecureRandom();
- digest = MessageDigest.getInstance ("SHA1");
- }
-
- private void init()
- {
- digest.reset();
- }
-
- public void engineInitVerify (PublicKey publicKey)
- throws InvalidKeyException
- {
- if (publicKey instanceof DSAPublicKey)
- this.publicKey = (DSAPublicKey) publicKey;
- else
- throw new InvalidKeyException();
- init();
- }
-
- public void engineInitSign (PrivateKey privateKey)
- throws InvalidKeyException
- {
- if (privateKey instanceof DSAPrivateKey)
- this.privateKey = (DSAPrivateKey) privateKey;
- else
- throw new InvalidKeyException ("not a DSA private key");
-
- init();
- }
-
- public void engineInitSign (PrivateKey privateKey,
- SecureRandom random)
- throws InvalidKeyException
- {
- if (privateKey instanceof DSAPrivateKey)
- this.privateKey = (DSAPrivateKey) privateKey;
- else
- throw new InvalidKeyException ("not a DSA private key");
-
- appRandom = random;
- init();
- }
-
- public void engineUpdate(byte b)
- throws SignatureException
- {
- digest.update (b);
- }
-
- public void engineUpdate (byte[] b, int off, int len)
- throws SignatureException
- {
- digest.update (b, off, len);
- }
-
- public byte[] engineSign() throws SignatureException
- {
- if (privateKey == null)
- throw new SignatureException ("not initialized for signing");
-
- try
- {
- BigInteger g = privateKey.getParams().getG();
- BigInteger p = privateKey.getParams().getP();
- BigInteger q = privateKey.getParams().getQ();
-
- BigInteger x = privateKey.getX();
-
- BigInteger k = new BigInteger (159, appRandom != null ? appRandom : random);
-
- BigInteger r = g.modPow(k, p);
- r = r.mod(q);
-
- byte bytes[] = digest.digest();
- BigInteger sha = new BigInteger (1, bytes);
-
- BigInteger s = sha.add (x.multiply (r));
- s = s.multiply (k.modInverse(q)).mod (q);
-
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- ArrayList seq = new ArrayList (2);
- seq.add(0, new DERValue (DER.INTEGER, r));
- seq.add(1, new DERValue (DER.INTEGER, s));
- DERWriter.write (bout, new DERValue (DER.CONSTRUCTED | DER.SEQUENCE, seq));
- return bout.toByteArray();
- }
- catch (IOException ioe)
- {
- SignatureException se = new SignatureException();
- se.initCause (ioe);
- throw se;
- }
- catch (ArithmeticException ae)
- {
- SignatureException se = new SignatureException();
- se.initCause (ae);
- throw se;
- }
- }
-
- public int engineSign (byte[] outbuf, int offset, int len)
- throws SignatureException
- {
- byte tmp[] = engineSign();
- if (tmp.length > len)
- throw new SignatureException ("output buffer too short");
- System.arraycopy (tmp, 0, outbuf, offset, tmp.length);
- return tmp.length;
- }
-
- public boolean engineVerify (byte[] sigBytes)
- throws SignatureException
- {
- // Decode sigBytes from ASN.1 DER encoding
- try
- {
- DERReader in = new DERReader (sigBytes);
- DERValue val = in.read();
- if (!val.isConstructed())
- throw new SignatureException ("badly formed signature");
- BigInteger r = (BigInteger) in.read().getValue();
- BigInteger s = (BigInteger) in.read().getValue();
-
- BigInteger g = publicKey.getParams().getG();
- BigInteger p = publicKey.getParams().getP();
- BigInteger q = publicKey.getParams().getQ();
-
- BigInteger y = publicKey.getY();
-
- BigInteger w = s.modInverse (q);
-
- byte bytes[] = digest.digest();
- BigInteger sha = new BigInteger (1, bytes);
-
- BigInteger u1 = w.multiply (sha).mod ( q );
-
- BigInteger u2 = r.multiply (w).mod(q);
-
- BigInteger v = g.modPow (u1, p).multiply (y.modPow (u2, p)).mod (p).mod (q);
-
- if (v.equals (r))
- return true;
- else
- return false;
- }
- catch (IOException ioe)
- {
- SignatureException se = new SignatureException ("badly formed signature");
- se.initCause (ioe);
- throw se;
- }
- }
-
- public void engineSetParameter (String param,
- Object value)
- throws InvalidParameterException
- {
- throw new InvalidParameterException();
- }
-
- public void engineSetParameter (AlgorithmParameterSpec params)
- throws InvalidAlgorithmParameterException
- {
- throw new InvalidParameterException();
-
- }
-
- public Object engineGetParameter (String param)
- throws InvalidParameterException
- {
- throw new InvalidParameterException();
- }
-
- public Object clone() throws CloneNotSupportedException
- {
- return super.clone();
- }
-}
diff --git a/libjava/gnu/java/security/provider/DefaultPolicy.java b/libjava/gnu/java/security/provider/DefaultPolicy.java
deleted file mode 100644
index d42be6c908f..00000000000
--- a/libjava/gnu/java/security/provider/DefaultPolicy.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* DefaultPolicy.java --
- Copyright (C) 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.security.AllPermission;
-import java.security.CodeSource;
-import java.security.Permission;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-import java.security.Policy;
-
-/**
- * This is just a stub policy implementation which grants all permissions
- * to any code source. FIXME: This should be replaced with a real
- * implementation that reads the policy configuration from a file, like
- * $JAVA_HOME/jre/lib/security/java.security.
- */
-public class DefaultPolicy extends Policy
-{
- static Permission allPermission = new AllPermission();
-
- public PermissionCollection getPermissions(CodeSource codesource)
- {
- Permissions perms = new Permissions();
- perms.add(allPermission);
- return perms;
- }
-
- public void refresh()
- {
- // Nothing.
- }
-}
diff --git a/libjava/gnu/java/security/provider/EncodedKeyFactory.java b/libjava/gnu/java/security/provider/EncodedKeyFactory.java
deleted file mode 100644
index 2bf0fff809e..00000000000
--- a/libjava/gnu/java/security/provider/EncodedKeyFactory.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/* EncodedKeyFactory.java -- encoded key factory.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.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;
-import java.security.AlgorithmParameters;
-import java.security.InvalidKeyException;
-import java.security.Key;
-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.InvalidKeySpecException;
-import java.security.spec.InvalidParameterSpecException;
-import java.security.spec.KeySpec;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.security.spec.RSAPrivateCrtKeySpec;
-import java.security.spec.RSAPublicKeySpec;
-import java.security.spec.X509EncodedKeySpec;
-
-import javax.crypto.spec.DHParameterSpec;
-
-/**
- * A factory for keys encoded in either the X.509 format (for public
- * keys) or the PKCS#8 format (for private keys).
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class EncodedKeyFactory extends KeyFactorySpi
-{
-
- // Constants.
- // ------------------------------------------------------------------------
-
- private static final OID ID_DSA = new OID("1.2.840.10040.4.1");
- private static final OID ID_RSA = new OID("1.2.840.113549.1.1.1");
- private static final OID ID_DH = new OID("1.2.840.10046.2.1");
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- public PublicKey engineGeneratePublic(KeySpec spec)
- throws InvalidKeySpecException
- {
- if (!(spec instanceof X509EncodedKeySpec))
- throw new InvalidKeySpecException("only supports X.509 key specs");
- DERReader der = new DERReader(((X509EncodedKeySpec) spec).getEncoded());
- try
- {
- DERValue spki = der.read();
- if (!spki.isConstructed())
- {
- throw new InvalidKeySpecException("malformed encoded key");
- }
- DERValue alg = der.read();
- if (!alg.isConstructed())
- {
- throw new InvalidKeySpecException("malformed encoded key");
- }
- DERValue val = der.read();
- if (!(val.getValue() instanceof OID))
- {
- throw new InvalidKeySpecException("malformed encoded key");
- }
- OID algId = (OID) val.getValue();
- byte[] algParams = null;
- if (alg.getLength() > val.getEncodedLength())
- {
- val = der.read();
- algParams = val.getEncoded();
- if (val.isConstructed())
- der.skip(val.getLength());
- }
- val = der.read();
- if (!(val.getValue() instanceof BitString))
- {
- throw new InvalidKeySpecException("malformed encoded key");
- }
- byte[] publicKey = ((BitString) val.getValue()).toByteArray();
- if (algId.equals(ID_DSA))
- {
- BigInteger p = null, g = null, q = null, Y;
- if (algParams != null)
- {
- DERReader dsaParams = new DERReader(algParams);
- val = dsaParams.read();
- if (!val.isConstructed())
- throw new InvalidKeySpecException("malformed DSA parameters");
- val = dsaParams.read();
- if (!(val.getValue() instanceof BigInteger))
- throw new InvalidKeySpecException("malformed DSA parameters");
- p = (BigInteger) val.getValue();
- val = dsaParams.read();
- if (!(val.getValue() instanceof BigInteger))
- throw new InvalidKeySpecException("malformed DSA parameters");
- q = (BigInteger) val.getValue();
- val = dsaParams.read();
- if (!(val.getValue() instanceof BigInteger))
- throw new InvalidKeySpecException("malformed DSA parameters");
- g = (BigInteger) val.getValue();
- }
- DERReader dsaPub = new DERReader(publicKey);
- val = dsaPub.read();
- if (!(val.getValue() instanceof BigInteger))
- throw new InvalidKeySpecException("malformed DSA parameters");
- Y = (BigInteger) val.getValue();
- return new GnuDSAPublicKey(Y, p, q, g);
- }
- else if (algId.equals(ID_RSA))
- {
- DERReader rsaParams = new DERReader(publicKey);
- if (!rsaParams.read().isConstructed())
- {
- throw new InvalidKeySpecException("malformed encoded key");
- }
- return new GnuRSAPublicKey(new RSAPublicKeySpec(
- (BigInteger) rsaParams.read().getValue(),
- (BigInteger) rsaParams.read().getValue()));
- }
- else if (algId.equals(ID_DH))
- {
- if (algParams == null)
- throw new InvalidKeySpecException("missing DH parameters");
- DERReader dhParams = new DERReader(algParams);
- val = dhParams.read();
- BigInteger p, g, q, Y;
- if (!val.isConstructed())
- throw new InvalidKeySpecException("malformed DH parameters");
- val = dhParams.read();
- if (!(val.getValue() instanceof BigInteger))
- throw new InvalidKeySpecException("malformed DH parameters");
- p = (BigInteger) val.getValue();
- val = dhParams.read();
- if (!(val.getValue() instanceof BigInteger))
- throw new InvalidKeySpecException("malformed DH parameters");
- g = (BigInteger) val.getValue();
- val = dhParams.read();
- if (!(val.getValue() instanceof BigInteger))
- throw new InvalidKeySpecException("malformed DH parameters");
- q = (BigInteger) val.getValue();
- DERReader dhPub = new DERReader(publicKey);
- val = dhPub.read();
- if (!(val.getValue() instanceof BigInteger))
- throw new InvalidKeySpecException("malformed DH parameters");
- Y = (BigInteger) val.getValue();
- return (PublicKey) new GnuDHPublicKey(new DHParameterSpec(p, g), Y, q);
- }
- else
- throw new InvalidKeySpecException("unknown algorithm: " + algId);
- }
- catch (IOException ioe)
- {
- throw new InvalidKeySpecException(ioe.getMessage());
- }
- }
-
- public PrivateKey engineGeneratePrivate(KeySpec spec)
- throws InvalidKeySpecException
- {
- if (!(spec instanceof PKCS8EncodedKeySpec))
- {
- throw new InvalidKeySpecException("only supports PKCS8 key specs");
- }
- DERReader der = new DERReader(((PKCS8EncodedKeySpec) spec).getEncoded());
- try
- {
- DERValue pki = der.read();
- if (!pki.isConstructed())
- {
- throw new InvalidKeySpecException("malformed encoded key");
- }
- DERValue val = der.read();
- if (!(val.getValue() instanceof BigInteger))
- {
- throw new InvalidKeySpecException("malformed encoded key");
- }
- DERValue alg = der.read();
- if (!alg.isConstructed())
- {
- throw new InvalidKeySpecException("malformed encoded key");
- }
- val = der.read();
- if (!(val.getValue() instanceof OID))
- {
- throw new InvalidKeySpecException("malformed encoded key");
- }
- OID algId = (OID) val.getValue();
- byte[] algParams = null;
- if (alg.getLength() > val.getEncodedLength())
- {
- val = der.read();
- algParams = val.getEncoded();
- if (val.isConstructed())
- der.skip(val.getLength());
- }
- byte[] privateKey = (byte[]) der.read().getValue();
- if (algId.equals(ID_DSA))
- {
- if (algParams == null)
- {
- throw new InvalidKeySpecException("missing DSA parameters");
- }
- AlgorithmParameters params = AlgorithmParameters.getInstance("DSA");
- params.init(algParams);
- DSAParameterSpec dsaSpec = (DSAParameterSpec)
- params.getParameterSpec(DSAParameterSpec.class);
- DERReader dsaPriv = new DERReader(privateKey);
- return new GnuDSAPrivateKey((BigInteger) dsaPriv.read().getValue(),
- dsaSpec.getP(), dsaSpec.getQ(), dsaSpec.getG());
- }
- else if (algId.equals(ID_RSA))
- {
- DERReader rsaParams = new DERReader(privateKey);
- if (!rsaParams.read().isConstructed())
- throw new InvalidKeySpecException("malformed encoded key");
- return new GnuRSAPrivateKey(new RSAPrivateCrtKeySpec(
- (BigInteger) rsaParams.read().getValue(), // n
- (BigInteger) rsaParams.read().getValue(), // e
- (BigInteger) rsaParams.read().getValue(), // d
- (BigInteger) rsaParams.read().getValue(), // p
- (BigInteger) rsaParams.read().getValue(), // q
- (BigInteger) rsaParams.read().getValue(), // d mod (p - 1)
- (BigInteger) rsaParams.read().getValue(), // d mod (q - 1)
- (BigInteger) rsaParams.read().getValue())); // (inv q) mod p
- }
- else
- throw new InvalidKeySpecException("unknown algorithm: " + algId);
- }
- catch (InvalidParameterSpecException iapse)
- {
- throw new InvalidKeySpecException(iapse.getMessage());
- }
- catch (NoSuchAlgorithmException nsae)
- {
- throw new InvalidKeySpecException(nsae.getMessage());
- }
- catch (IOException ioe)
- {
- throw new InvalidKeySpecException(ioe.getMessage());
- }
- }
-
- public KeySpec engineGetKeySpec(Key key, Class speClass)
- throws InvalidKeySpecException
- {
- if ((key instanceof PrivateKey) && key.getFormat().equals("PKCS#8")
- && speClass.isAssignableFrom(PKCS8EncodedKeySpec.class))
- return new PKCS8EncodedKeySpec(key.getEncoded());
- else if ((key instanceof PublicKey) && key.getFormat().equals("X.509")
- && speClass.isAssignableFrom(X509EncodedKeySpec.class))
- return new X509EncodedKeySpec(key.getEncoded());
- else
- throw new InvalidKeySpecException();
- }
-
- public Key engineTranslateKey(Key key) throws InvalidKeyException
- {
- throw new InvalidKeyException("translating keys not supported");
- }
-}
diff --git a/libjava/gnu/java/security/provider/Gnu.java b/libjava/gnu/java/security/provider/Gnu.java
deleted file mode 100644
index 849f63c1601..00000000000
--- a/libjava/gnu/java/security/provider/Gnu.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Gnu.java --- Gnu provider main class
- Copyright (C) 1999, 2002, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.Provider;
-
-public final class Gnu extends Provider
-{
- public Gnu()
- {
- super("GNU", 1.0, "GNU provider v1.0 implementing SHA-1, MD5, DSA, RSA, X.509 Certificates and CRLs, PKIX certificate path validators, Collection cert stores");
-
- AccessController.doPrivileged (new PrivilegedAction()
- {
- public Object run()
- {
- // Note that all implementation class names are referenced by using
- // Class.getName(). That way when we staticly link the Gnu provider
- // we automatically get all the implementation classes.
-
- // Signature
- put("Signature.SHA1withDSA",
- gnu.java.security.provider.DSASignature.class.getName());
-
- put("Alg.Alias.Signature.DSS", "SHA1withDSA");
- put("Alg.Alias.Signature.DSA", "SHA1withDSA");
- put("Alg.Alias.Signature.SHAwithDSA", "SHA1withDSA");
- put("Alg.Alias.Signature.DSAwithSHA", "SHA1withDSA");
- put("Alg.Alias.Signature.DSAwithSHA1", "SHA1withDSA");
- put("Alg.Alias.Signature.SHA/DSA", "SHA1withDSA");
- put("Alg.Alias.Signature.SHA-1/DSA", "SHA1withDSA");
- put("Alg.Alias.Signature.SHA1/DSA", "SHA1withDSA");
- put("Alg.Alias.Signature.OID.1.2.840.10040.4.3", "SHA1withDSA");
- put("Alg.Alias.Signature.1.2.840.10040.4.3", "SHA1withDSA");
- put("Alg.Alias.Signature.1.3.14.3.2.13", "SHA1withDSA");
- put("Alg.Alias.Signature.1.3.14.3.2.27", "SHA1withDSA");
-
- put("Signature.MD2withRSA", MD2withRSA.class.getName());
- put("Signature.MD2withRSA ImplementedIn", "Software");
- put("Alg.Alias.Signature.md2WithRSAEncryption", "MD2withRSA");
- put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.2", "MD2withRSA");
- put("Alg.Alias.Signature.1.2.840.113549.1.1.2", "MD2withRSA");
-
- put("Signature.MD4withRSA", MD4withRSA.class.getName());
- put("Signature.MD4withRSA ImplementedIn", "Software");
- put("Alg.Alias.Signature.md4WithRSAEncryption", "MD4withRSA");
- put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.3", "MD4withRSA");
- put("Alg.Alias.Signature.1.2.840.113549.1.1.3", "MD4withRSA");
-
- put("Signature.MD5withRSA", MD5withRSA.class.getName());
- put("Signature.MD5withRSA ImplementedIn", "Software");
- put("Alg.Alias.Signature.md5WithRSAEncryption", "MD5withRSA");
- put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.4", "MD5withRSA");
- put("Alg.Alias.Signature.1.2.840.113549.1.1.4", "MD5withRSA");
-
- put("Signature.SHA1withRSA", SHA1withRSA.class.getName());
- put("Signature.SHA1withRSA ImplementedIn", "Software");
- put("Alg.Alias.Signature.sha-1WithRSAEncryption", "SHA1withRSA");
- put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.5", "SHA1withRSA");
- put("Alg.Alias.Signature.1.2.840.113549.1.1.5", "SHA1withRSA");
-
- // Key Pair Generator
- put("KeyPairGenerator.DSA",
- gnu.java.security.provider.DSAKeyPairGenerator.class.getName());
-
- put("Alg.Alias.KeyPairGenerator.OID.1.2.840.10040.4.1", "DSA");
- put("Alg.Alias.KeyPairGenerator.1.2.840.10040.4.1", "DSA");
- put("Alg.Alias.KeyPairGenerator.1.3.14.3.2.12", "DSA");
-
- // Key Factory
- put("KeyFactory.DSA",
- gnu.java.security.provider.DSAKeyFactory.class.getName());
-
- put("KeyFactory.Encoded", EncodedKeyFactory.class.getName());
- put("KeyFactory.Encoded ImplementedIn", "Software");
- put("Alg.Alias.KeyFactory.X.509", "Encoded");
- put("Alg.Alias.KeyFactory.X509", "Encoded");
- put("Alg.Alias.KeyFactory.PKCS#8", "Encoded");
- put("Alg.Alias.KeyFactory.PKCS8", "Encoded");
-
- put("KeyFactory.RSA", RSAKeyFactory.class.getName());
-
- put("Alg.Alias.KeyFactory.OID.1.2.840.10040.4.1", "DSA");
- put("Alg.Alias.KeyFactory.1.2.840.10040.4.1", "DSA");
- put("Alg.Alias.KeyFactory.1.3.14.3.2.12", "DSA");
-
- // Message Digests
- put("MessageDigest.SHA", gnu.java.security.provider.SHA.class.getName());
- put("MessageDigest.MD5", gnu.java.security.provider.MD5.class.getName());
-
- // Format "Alias", "Actual Name"
- put("Alg.Alias.MessageDigest.SHA1", "SHA");
- put("Alg.Alias.MessageDigest.SHA-1", "SHA");
- put("Alg.Alias.MessageDigest.SHA-160", "SHA");
-
- // Algorithm Parameters
- put("AlgorithmParameters.DSA",
- gnu.java.security.provider.DSAParameters.class.getName());
-
- put("Alg.Alias.AlgorithmParameters.DSS", "DSA");
- put("Alg.Alias.AlgorithmParameters.SHAwithDSA", "DSA");
- put("Alg.Alias.AlgorithmParameters.OID.1.2.840.10040.4.3", "DSA");
- put("Alg.Alias.AlgorithmParameters.1.2.840.10040.4.3", "DSA");
-
- // Algorithm Parameter Generator
- put("AlgorithmParameterGenerator.DSA",
- gnu.java.security.provider.DSAParameterGenerator.class.getName());
-
- // SecureRandom
- put("SecureRandom.SHA1PRNG",
- gnu.java.security.provider.SHA1PRNG.class.getName());
-
- // CertificateFactory
- put("CertificateFactory.X509", X509CertificateFactory.class.getName());
-
- put("CertificateFactory.X509 ImplementedIn", "Software");
- put("Alg.Alias.CertificateFactory.X.509", "X509");
-
- // CertPathValidator
- put("CertPathValidator.PKIX", PKIXCertPathValidatorImpl.class.getName());
- put("CertPathValidator.PKIX ImplementedIn", "Software");
-
- // CertStore
- put("CertStore.Collection", CollectionCertStoreImpl.class.getName());
-
- return null;
- }
- });
- }
-}
diff --git a/libjava/gnu/java/security/provider/GnuDHPublicKey.java b/libjava/gnu/java/security/provider/GnuDHPublicKey.java
deleted file mode 100644
index 6e13f6bf20f..00000000000
--- a/libjava/gnu/java/security/provider/GnuDHPublicKey.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* GnuDHPublicKey.java -- A Diffie-Hellman public key.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.BitString;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERValue;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-
-import javax.crypto.interfaces.DHPublicKey;
-import javax.crypto.spec.DHParameterSpec;
-
-public class GnuDHPublicKey implements DHPublicKey
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private byte[] encoded;
- private final DHParameterSpec params;
- private final BigInteger Y;
- private final BigInteger q;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public GnuDHPublicKey(DHParameterSpec params, BigInteger Y, BigInteger q)
- {
- this.params = params;
- this.Y = Y;
- this.q = q;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public BigInteger getY()
- {
- return Y;
- }
-
- public DHParameterSpec getParams()
- {
- return params;
- }
-
- public String getAlgorithm()
- {
- return "DH";
- }
-
- public String getFormat()
- {
- return "X.509";
- }
-
- public byte[] getEncoded()
- {
- if (encoded != null)
- return (byte[]) encoded.clone();
- ArrayList spki = new ArrayList(2);
- ArrayList alg = new ArrayList(2);
- alg.add(new DERValue(DER.OBJECT_IDENTIFIER, new OID("1.2.840.10046.2.1")));
- ArrayList param = new ArrayList(3);
- param.add(new DERValue(DER.INTEGER, params.getP()));
- param.add(new DERValue(DER.INTEGER, params.getG()));
- param.add(new DERValue(DER.INTEGER, q));
- alg.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, param));
- spki.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, alg));
- spki.add(new DERValue(DER.BIT_STRING, new BitString(Y.toByteArray())));
- encoded = new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, spki).getEncoded();
- if (encoded != null)
- return (byte[]) encoded.clone();
- return null;
- }
-}
diff --git a/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java b/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java
deleted file mode 100644
index aac2faab229..00000000000
--- a/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/* GnuDSAPrivateKey.java --- Gnu DSA Private Key
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERValue;
-import gnu.java.security.der.DERWriter;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.math.BigInteger;
-import java.security.interfaces.DSAParams;
-import java.security.interfaces.DSAPrivateKey;
-import java.security.spec.DSAParameterSpec;
-import java.util.ArrayList;
-
-public class GnuDSAPrivateKey implements DSAPrivateKey
-{
- private byte[] encodedKey;
- BigInteger x;
- BigInteger p;
- BigInteger q;
- BigInteger g;
-
- public GnuDSAPrivateKey(BigInteger x, BigInteger p, BigInteger q, BigInteger g )
- {
- this.x = x;
- this.p = p;
- this.q = q;
- this.g = g;
- }
-
- public String getAlgorithm()
- {
- return "DSA";
- }
-
- public String getFormat()
- {
- return "PKCS#8";
- }
-
- /**
- * Encodes this key as a <code>PrivateKeyInfo</code>, as described in
- * PKCS #8. The ASN.1 specification for this structure is:
- *
- * <blockquote><pre>
- * PrivateKeyInfo ::= SEQUENCE {
- * version Version,
- * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
- * privateKey PrivateKey,
- * attributes [0] IMPLICIT Attributes OPTIONAL }
- *
- * Version ::= INTEGER
- *
- * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
- *
- * PrivateKey ::= OCTET STRING
- *
- * Attributes ::= SET OF Attribute
- * </pre></blockquote>
- *
- * <p>DSA private keys (in Classpath at least) have no attributes.
- */
- public byte[] getEncoded()
- {
- if (encodedKey != null)
- return (byte[]) encodedKey.clone();
- try
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- ArrayList pki = new ArrayList(3);
- pki.add(new DERValue(DER.INTEGER, BigInteger.ZERO));
- ArrayList algId = new ArrayList(2);
- algId.add(new DERValue(DER.OBJECT_IDENTIFIER,
- new OID("1.2.840.10040.4.1")));
- ArrayList algParams = new ArrayList(3);
- algParams.add(new DERValue(DER.INTEGER, p));
- algParams.add(new DERValue(DER.INTEGER, q));
- algParams.add(new DERValue(DER.INTEGER, g));
- algId.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, algParams));
- pki.add(new DERValue(DER.OCTET_STRING, x.toByteArray()));
- DERWriter.write(out, new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, pki));
- return (byte[]) (encodedKey = out.toByteArray()).clone();
- }
- catch (IOException ioe)
- {
- return null;
- }
- }
-
- public DSAParams getParams()
- {
- return (DSAParams)(new DSAParameterSpec(p,q,g));
- }
-
- public BigInteger getX()
- {
- return x;
- }
-
- public String toString()
- {
- return "GnuDSAPrivateKey: x="
- + (x != null ? x.toString(16) : "null") + " p="
- + (p != null ? p.toString(16) : "null") + " q="
- + (q != null ? q.toString(16) : "null") + " g="
- + (g != null ? g.toString(16) : "null");
- }
-}
diff --git a/libjava/gnu/java/security/provider/GnuDSAPublicKey.java b/libjava/gnu/java/security/provider/GnuDSAPublicKey.java
deleted file mode 100644
index 41195fa992c..00000000000
--- a/libjava/gnu/java/security/provider/GnuDSAPublicKey.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* GnuDSAPublicKey.java --- Gnu DSA Public Key
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-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;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.math.BigInteger;
-import java.security.interfaces.DSAParams;
-import java.security.interfaces.DSAPublicKey;
-import java.security.spec.DSAParameterSpec;
-import java.util.ArrayList;
-
-public class GnuDSAPublicKey implements DSAPublicKey
-{
- private byte[] encodedKey;
- BigInteger y;
- BigInteger p;
- BigInteger q;
- BigInteger g;
-
- public GnuDSAPublicKey(BigInteger y, BigInteger p, BigInteger q, BigInteger g )
- {
- this.y = y;
- this.p = p;
- this.q = q;
- this.g = g;
- }
-
- public String getAlgorithm()
- {
- return "DSA";
- }
-
- public String getFormat()
- {
- return "X.509";
- }
-
- /**
- * The encoded form of DSA public keys is:
- *
- * <blockquote><pre>
- * SubjectPublicKeyInfo ::= SEQUENCE {
- * algorithm AlgorithmIdentifier,
- * subjectPublicKey BIT STRING }
- * </pre></blockquote>
- */
- public byte[] getEncoded()
- {
- if (encodedKey != null)
- return (byte[]) encodedKey.clone();
- try
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- ArrayList spki = new ArrayList(2);
- ArrayList alg = new ArrayList(2);
- alg.add(new DERValue(DER.OBJECT_IDENTIFIER,
- new OID("1.2.840.113549.1.1.1")));
- ArrayList params = new ArrayList(3);
- params.add(new DERValue(DER.INTEGER, p));
- params.add(new DERValue(DER.INTEGER, q));
- params.add(new DERValue(DER.INTEGER, g));
- alg.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, params));
- spki.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, alg));
- spki.add(new DERValue(DER.BIT_STRING, new BitString(y.toByteArray())));
- DERWriter.write(out, new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, spki));
- return (byte[]) (encodedKey = out.toByteArray()).clone();
- }
- catch (IOException ioe)
- {
- return null;
- }
- }
-
- public DSAParams getParams()
- {
- if (p == null || q == null || g == null)
- return null;
- return (DSAParams)(new DSAParameterSpec(p,q,g));
- }
-
- public BigInteger getY()
- {
- return y;
- }
-
- public String toString()
- {
- return
- "GnuDSAPublicKey: y=" + (y != null ? y.toString(16) : "(null)") +
- " p=" + (p != null ? p.toString(16) : "(null)") +
- " q=" + (q != null ? q.toString(16) : "(null)") +
- " g=" + (g != null ? g.toString(16) : "(null)");
- }
-}
diff --git a/libjava/gnu/java/security/provider/GnuRSAPrivateKey.java b/libjava/gnu/java/security/provider/GnuRSAPrivateKey.java
deleted file mode 100644
index b09fc88bc5c..00000000000
--- a/libjava/gnu/java/security/provider/GnuRSAPrivateKey.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/* GnuRSAPrivateKey.java -- GNU RSA private key.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERValue;
-
-import java.math.BigInteger;
-import java.security.interfaces.RSAPrivateCrtKey;
-import java.security.spec.RSAPrivateCrtKeySpec;
-import java.util.ArrayList;
-
-class GnuRSAPrivateKey implements RSAPrivateCrtKey
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final RSAPrivateCrtKeySpec spec;
- private byte[] encodedKey;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public GnuRSAPrivateKey(RSAPrivateCrtKeySpec spec)
- {
- this.spec = spec;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public BigInteger getModulus()
- {
- return spec.getModulus();
- }
-
- public BigInteger getPrivateExponent()
- {
- return spec.getPrivateExponent();
- }
-
- public BigInteger getCrtCoefficient()
- {
- return spec.getCrtCoefficient();
- }
-
- public BigInteger getPrimeExponentP()
- {
- return spec.getPrimeExponentP();
- }
-
- public BigInteger getPrimeExponentQ()
- {
- return spec.getPrimeExponentQ();
- }
-
- public BigInteger getPrimeP()
- {
- return spec.getPrimeP();
- }
-
- public BigInteger getPrimeQ()
- {
- return spec.getPrimeQ();
- }
-
- public BigInteger getPublicExponent()
- {
- return spec.getPublicExponent();
- }
-
- public String getAlgorithm()
- {
- return "RSA";
- }
-
- public String getFormat()
- {
- return "PKCS#8";
- }
-
- /**
- * The encoded form is:
- *
- * <pre>
- * RSAPrivateKey ::= SEQUENCE {
- * version Version,
- * modulus INTEGER, -- n
- * publicExponent INTEGER, -- e
- * privateExponent INTEGER, -- d
- * prime1 INTEGER, -- p
- * prime2 INTEGER, -- q
- * exponent1 INTEGER, -- d mod (p-1)
- * exponent2 INTEGER, -- d mod (q-1)
- * coefficient INTEGER -- (inverse of q) mod p }
- * </pre>
- *
- * <p>Which is in turn encoded in a PrivateKeyInfo structure from PKCS#8.
- */
- public byte[] getEncoded()
- {
- if (encodedKey != null)
- return (byte[]) encodedKey.clone();
- ArrayList key = new ArrayList(9);
- key.add(new DERValue(DER.INTEGER, BigInteger.ZERO));
- key.add(new DERValue(DER.INTEGER, getModulus()));
- key.add(new DERValue(DER.INTEGER, getPublicExponent()));
- key.add(new DERValue(DER.INTEGER, getPrivateExponent()));
- key.add(new DERValue(DER.INTEGER, getPrimeP()));
- key.add(new DERValue(DER.INTEGER, getPrimeQ()));
- key.add(new DERValue(DER.INTEGER, getPrimeExponentP()));
- key.add(new DERValue(DER.INTEGER, getPrimeExponentQ()));
- key.add(new DERValue(DER.INTEGER, getCrtCoefficient()));
- DERValue pk = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, key);
- ArrayList pki = new ArrayList(3);
- pki.add(new DERValue(DER.INTEGER, BigInteger.ZERO));
- ArrayList alg = new ArrayList(2);
- alg.add(new DERValue(DER.OBJECT_IDENTIFIER,
- new OID("1.2.840.113549.1.1.1")));
- alg.add(new DERValue(DER.NULL, null));
- pki.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, alg));
- pki.add(new DERValue(DER.OCTET_STRING, pk.getEncoded()));
- encodedKey = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, pki).getEncoded();
- return (byte[]) encodedKey.clone();
- }
-}
diff --git a/libjava/gnu/java/security/provider/GnuRSAPublicKey.java b/libjava/gnu/java/security/provider/GnuRSAPublicKey.java
deleted file mode 100644
index a35e761c066..00000000000
--- a/libjava/gnu/java/security/provider/GnuRSAPublicKey.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* GnuRSAPublicKey.java -- GNU RSA public key.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.BitString;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERValue;
-
-import java.math.BigInteger;
-import java.security.interfaces.RSAPublicKey;
-import java.security.spec.RSAPublicKeySpec;
-import java.util.ArrayList;
-
-class GnuRSAPublicKey implements RSAPublicKey
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final RSAPublicKeySpec spec;
- private byte[] encodedKey;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public GnuRSAPublicKey(RSAPublicKeySpec spec)
- {
- this.spec = spec;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public BigInteger getModulus()
- {
- return spec.getModulus();
- }
-
- public BigInteger getPublicExponent()
- {
- return spec.getPublicExponent();
- }
-
- public String getAlgorithm()
- {
- return "RSA";
- }
-
- public String getFormat()
- {
- return "X.509";
- }
-
- public byte[] getEncoded()
- {
- if (encodedKey != null)
- return (byte[]) encodedKey.clone();
- ArrayList key = new ArrayList(2);
- key.add(new DERValue(DER.INTEGER, getModulus()));
- key.add(new DERValue(DER.INTEGER, getPublicExponent()));
- DERValue rsapk = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, key);
- ArrayList alg = new ArrayList(2);
- alg.add(new DERValue(DER.OBJECT_IDENTIFIER,
- new OID("1.2.840.113549.1.1.1")));
- alg.add(new DERValue(DER.NULL, null));
- ArrayList spki = new ArrayList(2);
- spki.add(new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, alg));
- spki.add(new DERValue(DER.BIT_STRING, new BitString(rsapk.getEncoded())));
- encodedKey = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, spki).getEncoded();
- return (byte[]) encodedKey.clone();
- }
-}
diff --git a/libjava/gnu/java/security/provider/MD2withRSA.java b/libjava/gnu/java/security/provider/MD2withRSA.java
deleted file mode 100644
index a72ae5588dc..00000000000
--- a/libjava/gnu/java/security/provider/MD2withRSA.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* MD2withRSA.java -- MD2 with RSA encryption signatures.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-public class MD2withRSA extends RSA
-{
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public MD2withRSA() throws NoSuchAlgorithmException
- {
- super(MessageDigest.getInstance("MD2"), DIGEST_ALGORITHM.getChild(2));
- }
-}
diff --git a/libjava/gnu/java/security/provider/MD4withRSA.java b/libjava/gnu/java/security/provider/MD4withRSA.java
deleted file mode 100644
index 76a6a1ad033..00000000000
--- a/libjava/gnu/java/security/provider/MD4withRSA.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* MD4withRSA.java -- MD4 with RSA encryption signatures.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-public class MD4withRSA extends RSA
-{
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public MD4withRSA() throws NoSuchAlgorithmException
- {
- super(MessageDigest.getInstance("MD4"), DIGEST_ALGORITHM.getChild(4));
- }
-}
diff --git a/libjava/gnu/java/security/provider/MD5.java b/libjava/gnu/java/security/provider/MD5.java
deleted file mode 100644
index 1534eb91089..00000000000
--- a/libjava/gnu/java/security/provider/MD5.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/* MD5.java -- Class implementing the MD5 algorithm as specified in RFC1321.
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-import java.security.MessageDigest;
-
-/**
- This class implements the MD5 algorithm as described in RFC1321.
-
- @see java.security.MessageDigest
-*/
-public class MD5 extends MessageDigest implements Cloneable
-{
- private final int W[] = new int[16];
- private long bytecount;
- private int A;
- private int B;
- private int C;
- private int D;
-
- public MD5()
- {
- super("MD5");
- engineReset ();
- }
-
- public Object clone()
- {
- return new MD5 (this);
- }
-
- private MD5 (MD5 copy)
- {
- this ();
- bytecount = copy.bytecount;
- A = copy.A;
- B = copy.B;
- C = copy.C;
- D = copy.D;
- System.arraycopy (copy.W, 0, W, 0, 16);
- }
-
- public int engineGetDigestLength()
- {
- return 16;
- }
-
- // Intialize the A,B,C,D needed for the hash
- public void engineReset()
- {
- bytecount = 0;
- A = 0x67452301;
- B = 0xefcdab89;
- C = 0x98badcfe;
- D = 0x10325476;
- for(int i = 0; i < 16; i++)
- W[i] = 0;
- }
-
- public void engineUpdate (byte b)
- {
- int i = (int)bytecount % 64;
- int shift = (3 - i % 4) * 8;
- int idx = i / 4;
-
- // if you could index ints, this would be: W[idx][shift/8] = b
- W[idx] = (W[idx] & ~(0xff << shift)) | ((b & 0xff) << shift);
-
- // if we've filled up a block, then process it
- if ((++ bytecount) % 64 == 0)
- munch ();
- }
-
- public void engineUpdate (byte bytes[], int off, int len)
- {
- if (len < 0)
- throw new ArrayIndexOutOfBoundsException ();
-
- int end = off + len;
- while (off < end)
- engineUpdate (bytes[off++]);
- }
-
- public byte[] engineDigest()
- {
- long bitcount = bytecount * 8;
- engineUpdate ((byte)0x80); // 10000000 in binary; the start of the padding
-
- // add the rest of the padding to fill this block out, but leave 8
- // bytes to put in the original bytecount
- while ((int)bytecount % 64 != 56)
- engineUpdate ((byte)0);
-
- // add the length of the original, unpadded block to the end of
- // the padding
- W[14] = SWAP((int)(0xffffffff & bitcount));
- W[15] = SWAP((int)(0xffffffff & (bitcount >>> 32)));
- bytecount += 8;
-
- // digest the fully padded block
- munch ();
-
- A = SWAP(A);
- B = SWAP(B);
- C = SWAP(C);
- D = SWAP(D);
- byte[] result = new byte[] {(byte)(A >>> 24), (byte)(A >>> 16),
- (byte)(A >>> 8), (byte)A,
- (byte)(B >>> 24), (byte)(B >>> 16),
- (byte)(B >>> 8), (byte)B,
- (byte)(C >>> 24), (byte)(C >>> 16),
- (byte)(C >>> 8), (byte)C,
- (byte)(D >>> 24), (byte)(D >>> 16),
- (byte)(D >>> 8), (byte)D};
-
- engineReset ();
- return result;
- }
-
- private int F( int X, int Y, int Z)
- {
- return ((X & Y) | (~X & Z));
- }
-
- private int G( int X, int Y, int Z)
- {
- return ((X & Z) | (Y & ~Z));
- }
-
- private int H( int X, int Y, int Z)
- {
- return (X ^ Y ^ Z);
- }
-
- private int I( int X, int Y, int Z)
- {
- return (Y ^ (X | ~Z));
- }
-
- private int rotateLeft( int i, int count)
- {
- //Taken from FIPS 180-1
- return ( (i << count) | (i >>> (32 - count)) ) ;
- }
-
- /* Round 1. */
- private int FF( int a, int b, int c, int d, int k, int s, int i)
- {
- /* Let [abcd k s i] denote the operation */
- a += F(b,c,d) + k + i;
- return b + rotateLeft(a, s);
- }
- /* Round 2. */
- private int GG( int a, int b, int c, int d, int k, int s, int i)
- {
- /* Let [abcd k s i] denote the operation */
- a += G(b,c,d) + k + i;
- return b + rotateLeft(a, s);
- }
- /* Round 3. */
- private int HH( int a, int b, int c, int d, int k, int s, int i)
- {
- /* Let [abcd k s t] denote the operation */
- a += H(b,c,d) + k + i;
- return b + rotateLeft(a, s);
- }
-
- /* Round 4. */
- private int II( int a, int b, int c, int d, int k, int s, int i)
- {
- /* Let [abcd k s t] denote the operation */
- a += I(b,c,d) + k + i;
- return b + rotateLeft(a, s);
- }
-
- private int SWAP(int n)
- {
- //Copied from md5.c in FSF Gnu Privacy Guard 0.9.2
- return (( (0xff & n) << 24) | ((n & 0xff00) << 8) | ((n >>> 8) & 0xff00) | (n >>> 24));
- }
-
- private void munch()
- {
- int AA,BB,CC,DD, j;
- int X[] = new int[16];
-
- /* Copy block i into X. */
- for(j = 0; j < 16; j++)
- X[j] = SWAP(W[j]);
-
- /* Save A as AA, B as BB, C as CC, and D as DD. */
- AA = A;
- BB = B;
- CC = C;
- DD = D;
-
- /* The hex constants are from md5.c
- in FSF Gnu Privacy Guard 0.9.2 */
- /* Round 1. */
- /* Let [abcd k s i] denote the operation
- a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */
- /* Do the following 16 operations. */
- A = FF(A,B,C,D, X[0], 7, 0xd76aa478);
- D = FF(D,A,B,C, X[1], 12, 0xe8c7b756);
- C = FF(C,D,A,B, X[2], 17, 0x242070db);
- B = FF(B,C,D,A, X[3], 22, 0xc1bdceee);
-
- A = FF(A,B,C,D, X[4], 7, 0xf57c0faf);
- D = FF(D,A,B,C, X[5], 12, 0x4787c62a);
- C = FF(C,D,A,B, X[6], 17, 0xa8304613);
- B = FF(B,C,D,A, X[7], 22, 0xfd469501);
-
- A = FF(A,B,C,D, X[8], 7, 0x698098d8);
- D = FF(D,A,B,C, X[9], 12, 0x8b44f7af);
- C = FF(C,D,A,B, X[10], 17, 0xffff5bb1);
- B = FF(B,C,D,A, X[11], 22, 0x895cd7be);
-
- A = FF(A,B,C,D, X[12], 7, 0x6b901122);
- D = FF(D,A,B,C, X[13], 12, 0xfd987193);
- C = FF(C,D,A,B, X[14], 17, 0xa679438e);
- B = FF(B,C,D,A, X[15], 22, 0x49b40821);
-
- /* Round 2. */
- /* Let [abcd k s i] denote the operation
- a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */
- /* Do the following 16 operations. */
- A = GG(A,B,C,D, X[1], 5, 0xf61e2562);
- D = GG(D,A,B,C, X[6], 9, 0xc040b340);
- C = GG(C,D,A,B, X[11], 14, 0x265e5a51);
- B = GG(B,C,D,A, X[0], 20, 0xe9b6c7aa);
-
- A = GG(A,B,C,D, X[5], 5, 0xd62f105d);
- D = GG(D,A,B,C, X[10], 9, 0x02441453);
- C = GG(C,D,A,B, X[15], 14, 0xd8a1e681);
- B = GG(B,C,D,A, X[4], 20, 0xe7d3fbc8);
-
- A = GG(A,B,C,D, X[9], 5, 0x21e1cde6);
- D = GG(D,A,B,C, X[14], 9, 0xc33707d6);
- C = GG(C,D,A,B, X[3], 14, 0xf4d50d87);
- B = GG(B,C,D,A, X[8], 20, 0x455a14ed);
-
- A = GG(A,B,C,D, X[13], 5, 0xa9e3e905);
- D = GG(D,A,B,C, X[2], 9, 0xfcefa3f8);
- C = GG(C,D,A,B, X[7], 14, 0x676f02d9);
- B = GG(B,C,D,A, X[12], 20, 0x8d2a4c8a);
-
- /* Round 3. */
- /* Let [abcd k s t] denote the operation
- a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */
- /* Do the following 16 operations. */
- A = HH(A,B,C,D, X[5], 4, 0xfffa3942);
- D = HH(D,A,B,C, X[8], 11, 0x8771f681);
- C = HH(C,D,A,B, X[11], 16, 0x6d9d6122);
- B = HH(B,C,D,A, X[14], 23, 0xfde5380c);
-
- A = HH(A,B,C,D, X[1], 4, 0xa4beea44);
- D = HH(D,A,B,C, X[4], 11, 0x4bdecfa9);
- C = HH(C,D,A,B, X[7], 16, 0xf6bb4b60);
- B = HH(B,C,D,A, X[10], 23, 0xbebfbc70);
-
- A = HH(A,B,C,D, X[13], 4, 0x289b7ec6);
- D = HH(D,A,B,C, X[0], 11, 0xeaa127fa);
- C = HH(C,D,A,B, X[3], 16, 0xd4ef3085);
- B = HH(B,C,D,A, X[6], 23, 0x04881d05);
-
- A = HH(A,B,C,D, X[9], 4, 0xd9d4d039);
- D = HH(D,A,B,C, X[12], 11, 0xe6db99e5);
- C = HH(C,D,A,B, X[15], 16, 0x1fa27cf8);
- B = HH(B,C,D,A, X[2], 23, 0xc4ac5665);
-
- /* Round 4. */
- /* Let [abcd k s t] denote the operation
- a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */
- /* Do the following 16 operations. */
- A = II(A,B,C,D, X[0], 6, 0xf4292244);
- D = II(D,A,B,C, X[7], 10, 0x432aff97);
- C = II(C,D,A,B, X[14], 15, 0xab9423a7);
- B = II(B,C,D,A, X[5], 21, 0xfc93a039);
-
- A = II(A,B,C,D, X[12], 6, 0x655b59c3);
- D = II(D,A,B,C, X[3], 10, 0x8f0ccc92);
- C = II(C,D,A,B, X[10], 15, 0xffeff47d);
- B = II(B,C,D,A, X[1], 21, 0x85845dd1);
-
- A = II(A,B,C,D, X[8], 6, 0x6fa87e4f);
- D = II(D,A,B,C, X[15], 10, 0xfe2ce6e0);
- C = II(C,D,A,B, X[6], 15, 0xa3014314);
- B = II(B,C,D,A, X[13], 21, 0x4e0811a1);
-
- A = II(A,B,C,D, X[4], 6, 0xf7537e82);
- D = II(D,A,B,C, X[11], 10, 0xbd3af235);
- C = II(C,D,A,B, X[2], 15, 0x2ad7d2bb);
- B = II(B,C,D,A, X[9], 21, 0xeb86d391);
-
- /* Then perform the following additions. (That is increment each
- of the four registers by the value it had before this block
- was started.) */
- A = A + AA;
- B = B + BB;
- C = C + CC;
- D = D + DD;
- }
-}
diff --git a/libjava/gnu/java/security/provider/MD5withRSA.java b/libjava/gnu/java/security/provider/MD5withRSA.java
deleted file mode 100644
index 721d897ed24..00000000000
--- a/libjava/gnu/java/security/provider/MD5withRSA.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* MD5withRSA.java -- MD5 with RSA encryption signatures.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-public class MD5withRSA extends RSA
-{
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public MD5withRSA() throws NoSuchAlgorithmException
- {
- super(MessageDigest.getInstance("MD5"), DIGEST_ALGORITHM.getChild(5));
- }
-}
diff --git a/libjava/gnu/java/security/provider/PKIXCertPathValidatorImpl.java b/libjava/gnu/java/security/provider/PKIXCertPathValidatorImpl.java
deleted file mode 100644
index 1268b169d9b..00000000000
--- a/libjava/gnu/java/security/provider/PKIXCertPathValidatorImpl.java
+++ /dev/null
@@ -1,701 +0,0 @@
-/* PKIXCertPathValidatorImpl.java -- PKIX certificate path validator.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import gnu.java.security.OID;
-import gnu.java.security.x509.GnuPKIExtension;
-import gnu.java.security.x509.PolicyNodeImpl;
-import gnu.java.security.x509.X509CRLSelectorImpl;
-import gnu.java.security.x509.X509CertSelectorImpl;
-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.PublicKey;
-import java.security.cert.CRL;
-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.CertificateException;
-import java.security.cert.PKIXCertPathChecker;
-import java.security.cert.PKIXCertPathValidatorResult;
-import java.security.cert.PKIXParameters;
-import java.security.cert.TrustAnchor;
-import java.security.cert.X509CRL;
-import java.security.cert.X509Certificate;
-import java.security.interfaces.DSAParams;
-import java.security.interfaces.DSAPublicKey;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * An implementation of the Public Key Infrastructure's X.509
- * certificate path validation algorithm.
- *
- * <p>See <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280:
- * Internet X.509 Public Key Infrastructure Certificate and
- * Certificate Revocation List (CRL) Profile</a>.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class PKIXCertPathValidatorImpl extends CertPathValidatorSpi
-{
-
- // Constants.
- // -------------------------------------------------------------------------
-
- private static final boolean DEBUG = false;
- private static void debug (String msg)
- {
- System.err.print (">> PKIXCertPathValidatorImpl: ");
- System.err.println (msg);
- }
-
- public static final String ANY_POLICY = "2.5.29.32.0";
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public PKIXCertPathValidatorImpl()
- {
- super();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public CertPathValidatorResult engineValidate(CertPath path,
- CertPathParameters params)
- throws CertPathValidatorException, InvalidAlgorithmParameterException
- {
- if (!(params instanceof PKIXParameters))
- throw new InvalidAlgorithmParameterException("not a PKIXParameters object");
-
- // First check if the certificate path is valid.
- //
- // This means that:
- //
- // (a) for all x in {1, ..., n-1}, the subject of certificate x is
- // the issuer of certificate x+1;
- //
- // (b) for all x in {1, ..., n}, the certificate was valid at the
- // time in question.
- //
- // Because this is the X.509 algorithm, we also check if all
- // cerificates are of type X509Certificate.
-
- PolicyNodeImpl rootNode = new PolicyNodeImpl();
- Set initPolicies = ((PKIXParameters) params).getInitialPolicies();
- rootNode.setValidPolicy(ANY_POLICY);
- rootNode.setCritical(false);
- rootNode.setDepth(0);
- if (initPolicies != null)
- rootNode.addAllExpectedPolicies(initPolicies);
- else
- rootNode.addExpectedPolicy(ANY_POLICY);
- List checks = ((PKIXParameters) params).getCertPathCheckers();
- List l = path.getCertificates();
- if (l == null || l.size() == 0)
- throw new CertPathValidatorException();
- X509Certificate[] p = null;
- try
- {
- p = (X509Certificate[]) l.toArray(new X509Certificate[l.size()]);
- }
- catch (ClassCastException cce)
- {
- throw new CertPathValidatorException("invalid certificate path");
- }
-
- String sigProvider = ((PKIXParameters) params).getSigProvider();
- PublicKey prevKey = null;
- Date now = ((PKIXParameters) params).getDate();
- if (now == null)
- now = new Date();
- LinkedList policyConstraints = new LinkedList();
- for (int i = p.length - 1; i >= 0; i--)
- {
- try
- {
- p[i].checkValidity(now);
- }
- catch (CertificateException ce)
- {
- throw new CertPathValidatorException(ce.toString());
- }
- Set uce = getCritExts(p[i]);
- for (Iterator check = checks.iterator(); check.hasNext(); )
- {
- try
- {
- ((PKIXCertPathChecker) check.next()).check(p[i], uce);
- }
- catch (Exception x)
- {
- }
- }
-
- PolicyConstraint constr = null;
- if (p[i] instanceof GnuPKIExtension)
- {
- Extension pcx =
- ((GnuPKIExtension) p[i]).getExtension (PolicyConstraint.ID);
- if (pcx != null)
- constr = (PolicyConstraint) pcx.getValue();
- }
- else
- {
- byte[] pcx = p[i].getExtensionValue (PolicyConstraint.ID.toString());
- if (pcx != null)
- {
- try
- {
- constr = new PolicyConstraint (pcx);
- }
- catch (Exception x)
- {
- }
- }
- }
- if (constr != null && constr.getRequireExplicitPolicy() >= 0)
- {
- policyConstraints.add (new int[]
- { p.length-i, constr.getRequireExplicitPolicy() });
- }
-
- updatePolicyTree(p[i], rootNode, p.length-i, (PKIXParameters) params,
- checkExplicitPolicy (p.length-i, policyConstraints));
-
- // The rest of the tests involve this cert's relationship with the
- // next in the path. If this cert is the end entity, we can stop.
- if (i == 0)
- break;
-
- basicSanity(p, i);
- PublicKey pubKey = null;
- try
- {
- pubKey = p[i].getPublicKey();
- if (pubKey instanceof DSAPublicKey)
- {
- DSAParams dsa = ((DSAPublicKey) pubKey).getParams();
- // If the DSA public key is missing its parameters, use those
- // from the previous cert's key.
- if (dsa == null || dsa.getP() == null || dsa.getG() == null
- || dsa.getQ() == null)
- {
- if (prevKey == null)
- throw new InvalidKeyException("DSA keys not chainable");
- if (!(prevKey instanceof DSAPublicKey))
- throw new InvalidKeyException("DSA keys not chainable");
- dsa = ((DSAPublicKey) prevKey).getParams();
- pubKey = new GnuDSAPublicKey(((DSAPublicKey) pubKey).getY(),
- dsa.getP(), dsa.getQ(), dsa.getG());
- }
- }
- if (sigProvider == null)
- p[i-1].verify(pubKey);
- else
- p[i-1].verify(pubKey, sigProvider);
- prevKey = pubKey;
- }
- catch (Exception e)
- {
- throw new CertPathValidatorException(e.toString());
- }
- if (!p[i].getSubjectDN().equals(p[i-1].getIssuerDN()))
- throw new CertPathValidatorException("issuer DN mismatch");
- boolean[] issuerUid = p[i-1].getIssuerUniqueID();
- boolean[] subjectUid = p[i].getSubjectUniqueID();
- if (issuerUid != null && subjectUid != null)
- if (!Arrays.equals(issuerUid, subjectUid))
- throw new CertPathValidatorException("UID mismatch");
-
- // Check the certificate against the revocation lists.
- if (((PKIXParameters) params).isRevocationEnabled())
- {
- X509CRLSelectorImpl selector = new X509CRLSelectorImpl();
- try
- {
- selector.addIssuerName(p[i].getSubjectDN());
- }
- catch (IOException ioe)
- {
- throw new CertPathValidatorException("error selecting CRLs");
- }
- List certStores = ((PKIXParameters) params).getCertStores();
- List crls = new LinkedList();
- for (Iterator it = certStores.iterator(); it.hasNext(); )
- {
- CertStore cs = (CertStore) it.next();
- try
- {
- Collection c = cs.getCRLs(selector);
- crls.addAll(c);
- }
- catch (CertStoreException cse)
- {
- }
- }
- if (crls.isEmpty())
- throw new CertPathValidatorException("no CRLs for issuer");
- boolean certOk = false;
- for (Iterator it = crls.iterator(); it.hasNext(); )
- {
- CRL crl = (CRL) it.next();
- if (!(crl instanceof X509CRL))
- continue;
- X509CRL xcrl = (X509CRL) crl;
- if (!checkCRL(xcrl, p, now, p[i], pubKey, certStores))
- continue;
- if (xcrl.isRevoked(p[i-1]))
- throw new CertPathValidatorException("certificate is revoked");
- else
- certOk = true;
- }
- if (!certOk)
- throw new CertPathValidatorException("certificate's validity could not be determined");
- }
- }
- rootNode.setReadOnly();
-
- // Now ensure that the first certificate in the chain was issued
- // by a trust anchor.
- Exception cause = null;
- Set anchors = ((PKIXParameters) params).getTrustAnchors();
- for (Iterator i = anchors.iterator(); i.hasNext(); )
- {
- TrustAnchor anchor = (TrustAnchor) i.next();
- X509Certificate anchorCert = null;
- PublicKey anchorKey = null;
- if (anchor.getTrustedCert() != null)
- {
- anchorCert = anchor.getTrustedCert();
- anchorKey = anchorCert.getPublicKey();
- }
- else
- anchorKey = anchor.getCAPublicKey();
- if (anchorKey == null)
- continue;
- try
- {
- if (anchorCert == null)
- anchorCert.checkValidity(now);
- p[p.length-1].verify(anchorKey);
- if (anchorCert != null && anchorCert.getBasicConstraints() >= 0
- && anchorCert.getBasicConstraints() < p.length)
- continue;
-
- if (((PKIXParameters) params).isRevocationEnabled())
- {
- X509CRLSelectorImpl selector = new X509CRLSelectorImpl();
- if (anchorCert != null)
- try
- {
- selector.addIssuerName(anchorCert.getSubjectDN());
- }
- catch (IOException ioe)
- {
- }
- else
- selector.addIssuerName(anchor.getCAName());
- List certStores = ((PKIXParameters) params).getCertStores();
- List crls = new LinkedList();
- for (Iterator it = certStores.iterator(); it.hasNext(); )
- {
- CertStore cs = (CertStore) it.next();
- try
- {
- Collection c = cs.getCRLs(selector);
- crls.addAll(c);
- }
- catch (CertStoreException cse)
- {
- }
- }
- if (crls.isEmpty())
- continue;
- for (Iterator it = crls.iterator(); it.hasNext(); )
- {
- CRL crl = (CRL) it.next();
- if (!(crl instanceof X509CRL))
- continue;
- X509CRL xcrl = (X509CRL) crl;
- try
- {
- xcrl.verify(anchorKey);
- }
- catch (Exception x)
- {
- continue;
- }
- Date nextUpdate = xcrl.getNextUpdate();
- if (nextUpdate != null && nextUpdate.compareTo(now) < 0)
- continue;
- if (xcrl.isRevoked(p[p.length-1]))
- throw new CertPathValidatorException("certificate is revoked");
- }
- }
-
- // The chain is valid; return the result.
- return new PKIXCertPathValidatorResult(anchor, rootNode,
- p[0].getPublicKey());
- }
- catch (Exception ignored)
- {
- cause = ignored;
- continue;
- }
- }
-
- // The path is not valid.
- CertPathValidatorException cpve =
- new CertPathValidatorException("path validation failed");
- if (cause != null)
- cpve.initCause (cause);
- throw cpve;
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- /**
- * Check if a given CRL is acceptable for checking the revocation status
- * of certificates in the path being checked.
- *
- * <p>The CRL is accepted iff:</p>
- *
- * <ol>
- * <li>The <i>nextUpdate</i> field (if present) is in the future.</li>
- * <li>The CRL does not contain any unsupported critical extensions.</li>
- * <li>The CRL is signed by one of the certificates in the path, or,</li>
- * <li>The CRL is signed by the given public key and was issued by the
- * public key's subject, or,</li>
- * <li>The CRL is signed by a certificate in the given cert stores, and
- * that cert is signed by one of the certificates in the path.</li>
- * </ol>
- *
- * @param crl The CRL being checked.
- * @param path The path this CRL is being checked against.
- * @param now The value to use as 'now'.
- * @param pubKeySubject The subject of the public key.
- * @param pubKey The public key to check.
- * @return True if the CRL is acceptable.
- */
- private static boolean checkCRL(X509CRL crl, X509Certificate[] path, Date now,
- X509Certificate pubKeyCert, PublicKey pubKey,
- List certStores)
- {
- Date nextUpdate = crl.getNextUpdate();
- if (nextUpdate != null && nextUpdate.compareTo(now) < 0)
- return false;
- if (crl.hasUnsupportedCriticalExtension())
- return false;
- for (int i = 0; i < path.length; i++)
- {
- if (!path[i].getSubjectDN().equals(crl.getIssuerDN()))
- continue;
- boolean[] keyUsage = path[i].getKeyUsage();
- if (keyUsage != null)
- {
- if (!keyUsage[KeyUsage.CRL_SIGN])
- continue;
- }
- try
- {
- crl.verify(path[i].getPublicKey());
- return true;
- }
- catch (Exception x)
- {
- }
- }
- if (crl.getIssuerDN().equals(pubKeyCert.getSubjectDN()))
- {
- try
- {
- boolean[] keyUsage = pubKeyCert.getKeyUsage();
- if (keyUsage != null)
- {
- if (!keyUsage[KeyUsage.CRL_SIGN])
- throw new Exception();
- }
- crl.verify(pubKey);
- return true;
- }
- catch (Exception x)
- {
- }
- }
- try
- {
- X509CertSelectorImpl select = new X509CertSelectorImpl();
- select.addSubjectName(crl.getIssuerDN());
- List certs = new LinkedList();
- for (Iterator it = certStores.iterator(); it.hasNext(); )
- {
- CertStore cs = (CertStore) it.next();
- try
- {
- certs.addAll(cs.getCertificates(select));
- }
- catch (CertStoreException cse)
- {
- }
- }
- for (Iterator it = certs.iterator(); it.hasNext(); )
- {
- X509Certificate c = (X509Certificate) it.next();
- for (int i = 0; i < path.length; i++)
- {
- if (!c.getIssuerDN().equals(path[i].getSubjectDN()))
- continue;
- boolean[] keyUsage = c.getKeyUsage();
- if (keyUsage != null)
- {
- if (!keyUsage[KeyUsage.CRL_SIGN])
- continue;
- }
- try
- {
- c.verify(path[i].getPublicKey());
- crl.verify(c.getPublicKey());
- return true;
- }
- catch (Exception x)
- {
- }
- }
- if (c.getIssuerDN().equals(pubKeyCert.getSubjectDN()))
- {
- c.verify(pubKey);
- crl.verify(c.getPublicKey());
- }
- }
- }
- catch (Exception x)
- {
- }
- return false;
- }
-
- private static Set getCritExts(X509Certificate cert)
- {
- HashSet s = new HashSet();
- if (cert instanceof GnuPKIExtension)
- {
- Collection exts = ((GnuPKIExtension) cert).getExtensions();
- for (Iterator it = exts.iterator(); it.hasNext(); )
- {
- Extension ext = (Extension) it.next();
- if (ext.isCritical() && !ext.isSupported())
- s.add(ext.getOid().toString());
- }
- }
- else
- s.addAll(cert.getCriticalExtensionOIDs());
- return s;
- }
-
- /**
- * Perform a basic sanity check on the CA certificate at <code>index</code>.
- */
- private static void basicSanity(X509Certificate[] path, int index)
- throws CertPathValidatorException
- {
- X509Certificate cert = path[index];
- int pathLen = 0;
- for (int i = index - 1; i > 0; i--)
- {
- if (!path[i].getIssuerDN().equals(path[i].getSubjectDN()))
- pathLen++;
- }
- Extension e = null;
- if (cert instanceof GnuPKIExtension)
- {
- e = ((GnuPKIExtension) cert).getExtension(BasicConstraints.ID);
- }
- else
- {
- try
- {
- e = new Extension(cert.getExtensionValue(BasicConstraints.ID.toString()));
- }
- catch (Exception x)
- {
- }
- }
- if (e == null)
- throw new CertPathValidatorException("no basicConstraints");
- BasicConstraints bc = (BasicConstraints) e.getValue();
- if (!bc.isCA())
- throw new CertPathValidatorException("certificate cannot be used to verify signatures");
- if (bc.getPathLengthConstraint() >= 0 && bc.getPathLengthConstraint() < pathLen)
- throw new CertPathValidatorException("path is too long");
-
- boolean[] keyUsage = cert.getKeyUsage();
- if (keyUsage != null)
- {
- if (!keyUsage[KeyUsage.KEY_CERT_SIGN])
- throw new CertPathValidatorException("certificate cannot be used to sign certificates");
- }
- }
-
- private static void updatePolicyTree(X509Certificate cert, PolicyNodeImpl root,
- int depth, PKIXParameters params,
- boolean explicitPolicy)
- throws CertPathValidatorException
- {
- if (DEBUG) debug("updatePolicyTree depth == " + depth);
- Set nodes = new HashSet();
- LinkedList stack = new LinkedList();
- Iterator current = null;
- stack.addLast(Collections.singleton(root).iterator());
- do
- {
- current = (Iterator) stack.removeLast();
- while (current.hasNext())
- {
- PolicyNodeImpl p = (PolicyNodeImpl) current.next();
- if (DEBUG) debug("visiting node == " + p);
- if (p.getDepth() == depth - 1)
- {
- if (DEBUG) debug("added node");
- nodes.add(p);
- }
- else
- {
- if (DEBUG) debug("skipped node");
- stack.addLast(current);
- current = p.getChildren();
- }
- }
- }
- while (!stack.isEmpty());
-
- Extension e = null;
- CertificatePolicies policies = null;
- List qualifierInfos = null;
- if (cert instanceof GnuPKIExtension)
- {
- e = ((GnuPKIExtension) cert).getExtension(CertificatePolicies.ID);
- if (e != null)
- policies = (CertificatePolicies) e.getValue();
- }
-
- List cp = null;
- if (policies != null)
- cp = policies.getPolicies();
- else
- cp = Collections.EMPTY_LIST;
- boolean match = false;
- if (DEBUG) debug("nodes are == " + nodes);
- if (DEBUG) debug("cert policies are == " + cp);
- for (Iterator it = nodes.iterator(); it.hasNext(); )
- {
- PolicyNodeImpl parent = (PolicyNodeImpl) it.next();
- if (DEBUG) debug("adding policies to " + parent);
- for (Iterator it2 = cp.iterator(); it2.hasNext(); )
- {
- OID policy = (OID) it2.next();
- if (DEBUG) debug("trying to add policy == " + policy);
- if (policy.toString().equals(ANY_POLICY) &&
- params.isAnyPolicyInhibited())
- continue;
- PolicyNodeImpl child = new PolicyNodeImpl();
- child.setValidPolicy(policy.toString());
- child.addExpectedPolicy(policy.toString());
- if (parent.getExpectedPolicies().contains(policy.toString()))
- {
- parent.addChild(child);
- match = true;
- }
- else if (parent.getExpectedPolicies().contains(ANY_POLICY))
- {
- parent.addChild(child);
- match = true;
- }
- else if (ANY_POLICY.equals (policy.toString()))
- {
- parent.addChild (child);
- match = true;
- }
- if (match && policies != null)
- {
- List qualifiers = policies.getPolicyQualifierInfos (policy);
- if (qualifiers != null)
- child.addAllPolicyQualifiers (qualifiers);
- }
- }
- }
- if (!match && (params.isExplicitPolicyRequired() || explicitPolicy))
- throw new CertPathValidatorException("policy tree building failed");
- }
-
- private boolean checkExplicitPolicy (int depth, List explicitPolicies)
- {
- if (DEBUG) debug ("checkExplicitPolicy depth=" + depth);
- for (Iterator it = explicitPolicies.iterator(); it.hasNext(); )
- {
- int[] i = (int[]) it.next();
- int caDepth = i[0];
- int limit = i[1];
- if (DEBUG) debug (" caDepth=" + caDepth + " limit=" + limit);
- if (depth - caDepth >= limit)
- return true;
- }
- return false;
- }
-}
diff --git a/libjava/gnu/java/security/provider/RSA.java b/libjava/gnu/java/security/provider/RSA.java
deleted file mode 100644
index c3cfbbf79f1..00000000000
--- a/libjava/gnu/java/security/provider/RSA.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/* RSA.java -- RSA PKCS#1 signatures.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-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.der.DERWriter;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.math.BigInteger;
-import java.security.InvalidKeyException;
-import java.security.MessageDigest;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.SecureRandom;
-import java.security.SignatureException;
-import java.security.SignatureSpi;
-import java.security.interfaces.RSAPrivateKey;
-import java.security.interfaces.RSAPublicKey;
-import java.util.ArrayList;
-
-public abstract class RSA extends SignatureSpi implements Cloneable
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- /**
- * digestAlgorithm OBJECT IDENTIFIER ::=
- * { iso(1) member-body(2) US(840) rsadsi(113549) digestAlgorithm(2) }
- */
- protected static final OID DIGEST_ALGORITHM = new OID("1.2.840.113549.2");
-
- protected final OID digestAlgorithm;
- protected final MessageDigest md;
- protected RSAPrivateKey signerKey;
- protected RSAPublicKey verifierKey;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- protected RSA(MessageDigest md, OID digestAlgorithm)
- {
- super();
- this.md = md;
- this.digestAlgorithm = digestAlgorithm;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public Object clone() throws CloneNotSupportedException
- {
- return super.clone();
- }
-
- protected Object engineGetParameter(String param)
- {
- throw new UnsupportedOperationException("deprecated");
- }
-
- protected void engineSetParameter(String param, Object value)
- {
- throw new UnsupportedOperationException("deprecated");
- }
-
- protected void engineInitSign(PrivateKey privateKey)
- throws InvalidKeyException
- {
- if (!(privateKey instanceof RSAPrivateKey))
- throw new InvalidKeyException();
- verifierKey = null;
- signerKey = (RSAPrivateKey) privateKey;
- }
-
- protected void engineInitSign(PrivateKey privateKey, SecureRandom random)
- throws InvalidKeyException
- {
- // This class does not need random bytes.
- engineInitSign(privateKey);
- }
-
- protected void engineInitVerify(PublicKey publicKey)
- throws InvalidKeyException
- {
- if (!(publicKey instanceof RSAPublicKey))
- throw new InvalidKeyException();
- signerKey = null;
- verifierKey = (RSAPublicKey) publicKey;
- }
-
- protected void engineUpdate(byte b) throws SignatureException
- {
- if (signerKey == null && verifierKey == null)
- throw new SignatureException("not initialized");
- md.update(b);
- }
-
- protected void engineUpdate(byte[] buf, int off, int len)
- throws SignatureException
- {
- if (signerKey == null && verifierKey == null)
- throw new SignatureException("not initialized");
- md.update(buf, off, len);
- }
-
- protected byte[] engineSign() throws SignatureException
- {
- if (signerKey == null)
- throw new SignatureException("not initialized for signing");
- //
- // The signature will be the RSA encrypted BER representation of
- // the following:
- //
- // DigestInfo ::= SEQUENCE {
- // digestAlgorithm DigestAlgorithmIdentifier,
- // digest Digest }
- //
- // DigestAlgorithmIdentifier ::= AlgorithmIdentifier
- //
- // Digest ::= OCTET STRING
- //
- ArrayList digestAlg = new ArrayList(2);
- digestAlg.add(new DERValue(DER.OBJECT_IDENTIFIER, digestAlgorithm));
- digestAlg.add(new DERValue(DER.NULL, null));
- ArrayList digestInfo = new ArrayList(2);
- digestInfo.add(new DERValue(DER.SEQUENCE, digestAlg));
- digestInfo.add(new DERValue(DER.OCTET_STRING, md.digest()));
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- try
- {
- DERWriter.write(out, new DERValue(DER.SEQUENCE, digestInfo));
- }
- catch (IOException ioe)
- {
- throw new SignatureException(ioe.toString());
- }
- byte[] buf = out.toByteArray();
- md.reset();
-
- // k = octect length of the modulus.
- int k = signerKey.getModulus().bitLength();
- k = (k >>> 3) + ((k & 7) == 0 ? 0 : 1);
- if (buf.length < k - 3)
- {
- throw new SignatureException("RSA modulus too small");
- }
- byte[] d = new byte[k];
-
- // Padding type 1:
- // 00 | 01 | FF | ... | FF | 00 | D
- d[1] = 0x01;
- for (int i = 2; i < k - buf.length - 1; i++)
- d[i] = (byte) 0xFF;
- System.arraycopy(buf, 0, d, k - buf.length, buf.length);
-
- BigInteger eb = new BigInteger(d);
-
- byte[] ed = eb.modPow(signerKey.getPrivateExponent(),
- signerKey.getModulus()).toByteArray();
-
- // Ensure output is k octets long.
- if (ed.length < k)
- {
- byte[] b = new byte[k];
- System.arraycopy(eb, 0, b, k - ed.length, ed.length);
- ed = b;
- }
- else if (ed.length > k)
- {
- if (ed.length != k + 1)
- {
- throw new SignatureException("modPow result is larger than the modulus");
- }
- // Maybe an extra 00 octect.
- byte[] b = new byte[k];
- System.arraycopy(ed, 1, b, 0, k);
- ed = b;
- }
-
- return ed;
- }
-
- protected int engineSign(byte[] out, int off, int len)
- throws SignatureException
- {
- if (out == null || off < 0 || len < 0 || off+len > out.length)
- throw new SignatureException("illegal output argument");
- byte[] result = engineSign();
- if (result.length > len)
- throw new SignatureException("not enough space for signature");
- System.arraycopy(result, 0, out, off, result.length);
- return result.length;
- }
-
- protected boolean engineVerify(byte[] sig) throws SignatureException
- {
- if (verifierKey == null)
- throw new SignatureException("not initialized for verifying");
- if (sig == null)
- throw new SignatureException("no signature specified");
- int k = verifierKey.getModulus().bitLength();
- k = (k >>> 3) + ((k & 7) == 0 ? 0 : 1);
- if (sig.length != k)
- throw new SignatureException("signature is the wrong size (expecting "
- + k + " bytes, got " + sig.length + ")");
- BigInteger ed = new BigInteger(1, sig);
- byte[] eb = ed.modPow(verifierKey.getPublicExponent(),
- verifierKey.getModulus()).toByteArray();
-
- int i = 0;
- if (eb[0] == 0x00)
- {
- for (i = 1; i < eb.length && eb[i] == 0x00; i++);
- if (i == 1)
- throw new SignatureException("wrong RSA padding");
- i--;
- }
- else if (eb[0] == 0x01)
- {
- for (i = 1; i < eb.length && eb[i] != 0x00; i++)
- if (eb[i] != (byte) 0xFF)
- throw new IllegalArgumentException("wrong RSA padding");
- }
- else
- throw new SignatureException("wrong RSA padding type");
-
- byte[] d = new byte[eb.length-i-1];
- System.arraycopy(eb, i+1, d, 0, eb.length-i-1);
-
- DERReader der = new DERReader(d);
- try
- {
- DERValue val = der.read();
- if (val.getTag() != DER.SEQUENCE)
- throw new SignatureException("failed to parse DigestInfo");
- val = der.read();
- if (val.getTag() != DER.SEQUENCE)
- throw new SignatureException("failed to parse DigestAlgorithmIdentifier");
- boolean sequenceIsBer = val.getLength() == 0;
- val = der.read();
- if (val.getTag() != DER.OBJECT_IDENTIFIER)
- throw new SignatureException("failed to parse object identifier");
- if (!val.getValue().equals(digestAlgorithm))
- throw new SignatureException("digest algorithms do not match");
- val = der.read();
- // We should never see parameters here, since they are never used.
- if (val.getTag() != DER.NULL)
- throw new SignatureException("cannot handle digest parameters");
- if (sequenceIsBer)
- der.skip(1); // end-of-sequence byte.
- val = der.read();
- if (val.getTag() != DER.OCTET_STRING)
- throw new SignatureException("failed to parse Digest");
- return MessageDigest.isEqual(md.digest(), (byte[]) val.getValue());
- }
- catch (IOException ioe)
- {
- throw new SignatureException(ioe.toString());
- }
- }
-
- protected boolean engineVerify(byte[] sig, int off, int len)
- throws SignatureException
- {
- if (sig == null || off < 0 || len < 0 || off+len > sig.length)
- throw new SignatureException("illegal parameter");
- byte[] buf = new byte[len];
- System.arraycopy(sig, off, buf, 0, len);
- return engineVerify(buf);
- }
-}
diff --git a/libjava/gnu/java/security/provider/RSAKeyFactory.java b/libjava/gnu/java/security/provider/RSAKeyFactory.java
deleted file mode 100644
index d13cbe510a1..00000000000
--- a/libjava/gnu/java/security/provider/RSAKeyFactory.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/* RSAKeyFactory.java -- RSA key factory.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.KeyFactorySpi;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-
-import java.security.interfaces.RSAPrivateCrtKey;
-import java.security.interfaces.RSAPrivateKey;
-import java.security.interfaces.RSAPublicKey;
-
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.security.spec.RSAPrivateCrtKeySpec;
-import java.security.spec.RSAPrivateKeySpec;
-import java.security.spec.RSAPublicKeySpec;
-import java.security.spec.X509EncodedKeySpec;
-
-public class RSAKeyFactory extends KeyFactorySpi
-{
-
- // Default constructor.
- // -------------------------------------------------------------------------
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- protected PrivateKey engineGeneratePrivate(KeySpec spec)
- throws InvalidKeySpecException
- {
- if (spec instanceof RSAPrivateCrtKeySpec)
- {
- return new GnuRSAPrivateKey((RSAPrivateCrtKeySpec) spec);
- }
- if (spec instanceof RSAPrivateKeySpec)
- {
- return new GnuRSAPrivateKey(new RSAPrivateCrtKeySpec(
- ((RSAPrivateKeySpec) spec).getModulus(), null,
- ((RSAPrivateKeySpec) spec).getPrivateExponent(), null,
- null, null, null, null));
- }
- if (spec instanceof PKCS8EncodedKeySpec)
- {
- EncodedKeyFactory ekf = new EncodedKeyFactory();
- PrivateKey pk = ekf.engineGeneratePrivate(spec);
- if (pk instanceof RSAPrivateKey)
- return pk;
- }
- throw new InvalidKeySpecException();
- }
-
- protected PublicKey engineGeneratePublic(KeySpec spec)
- throws InvalidKeySpecException
- {
- if (spec instanceof RSAPublicKeySpec)
- {
- return new GnuRSAPublicKey((RSAPublicKeySpec) spec);
- }
- if (spec instanceof X509EncodedKeySpec)
- {
- EncodedKeyFactory ekf = new EncodedKeyFactory();
- PublicKey pk = ekf.engineGeneratePublic(spec);
- if (pk instanceof RSAPublicKey)
- return pk;
- }
- throw new InvalidKeySpecException();
- }
-
- protected KeySpec engineGetKeySpec(Key key, Class keySpec)
- throws InvalidKeySpecException
- {
- if (keySpec.isAssignableFrom(RSAPrivateCrtKeySpec.class)
- && (key instanceof RSAPrivateCrtKey))
- {
- return new RSAPrivateCrtKeySpec(
- ((RSAPrivateCrtKey) key).getModulus(),
- ((RSAPrivateCrtKey) key).getPublicExponent(),
- ((RSAPrivateCrtKey) key).getPrivateExponent(),
- ((RSAPrivateCrtKey) key).getPrimeP(),
- ((RSAPrivateCrtKey) key).getPrimeQ(),
- ((RSAPrivateCrtKey) key).getPrimeExponentP(),
- ((RSAPrivateCrtKey) key).getPrimeExponentQ(),
- ((RSAPrivateCrtKey) key).getCrtCoefficient());
- }
- if (keySpec.isAssignableFrom(RSAPrivateKeySpec.class)
- && (key instanceof RSAPrivateKey))
- {
- return new RSAPrivateKeySpec(
- ((RSAPrivateCrtKey) key).getModulus(),
- ((RSAPrivateCrtKey) key).getPrivateExponent());
- }
- if (keySpec.isAssignableFrom(RSAPublicKeySpec.class)
- && (key instanceof RSAPublicKey))
- {
- return new RSAPublicKeySpec(
- ((RSAPrivateCrtKey) key).getModulus(),
- ((RSAPrivateCrtKey) key).getPublicExponent());
- }
- if (keySpec.isAssignableFrom(PKCS8EncodedKeySpec.class)
- && key.getFormat().equalsIgnoreCase("PKCS#8"))
- {
- return new PKCS8EncodedKeySpec(key.getEncoded());
- }
- if (keySpec.isAssignableFrom(X509EncodedKeySpec.class)
- && key.getFormat().equalsIgnoreCase("X.509"))
- {
- return new X509EncodedKeySpec(key.getEncoded());
- }
- throw new InvalidKeySpecException();
- }
-
- protected Key engineTranslateKey(Key key) throws InvalidKeyException
- {
- if (key instanceof RSAPrivateCrtKey)
- {
- return new GnuRSAPrivateKey(new RSAPrivateCrtKeySpec(
- ((RSAPrivateCrtKey) key).getModulus(),
- ((RSAPrivateCrtKey) key).getPublicExponent(),
- ((RSAPrivateCrtKey) key).getPrivateExponent(),
- ((RSAPrivateCrtKey) key).getPrimeP(),
- ((RSAPrivateCrtKey) key).getPrimeQ(),
- ((RSAPrivateCrtKey) key).getPrimeExponentP(),
- ((RSAPrivateCrtKey) key).getPrimeExponentQ(),
- ((RSAPrivateCrtKey) key).getCrtCoefficient()));
- }
- if (key instanceof RSAPrivateKey)
- {
- return new GnuRSAPrivateKey(new RSAPrivateCrtKeySpec(
- ((RSAPrivateKey) key).getModulus(), null,
- ((RSAPrivateKey) key).getPrivateExponent(), null,
- null, null, null, null));
- }
- if (key instanceof RSAPublicKey)
- {
- return new GnuRSAPublicKey(new RSAPublicKeySpec(
- ((RSAPrivateCrtKey) key).getModulus(),
- ((RSAPrivateCrtKey) key).getPublicExponent()));
- }
- throw new InvalidKeyException();
- }
-}
diff --git a/libjava/gnu/java/security/provider/SHA.java b/libjava/gnu/java/security/provider/SHA.java
deleted file mode 100644
index e3b09bc5603..00000000000
--- a/libjava/gnu/java/security/provider/SHA.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/* SHA.java -- Class implementing the SHA-1 algorithm as specified in [1].
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.security.MessageDigest;
-
-/**
- This class implements the SHA-1 algorithm as described in [1].
-
- [1] Federal Information Processing Standards Publication 180-1.
- Specifications for the Secure Hash Standard. April 17, 1995.
-
- @see java.security.MessageDigest
-*/
-public class SHA extends MessageDigest implements Cloneable
-{
- public SHA ()
- {
- super("SHA");
- engineReset ();
- }
-
- public int engineGetDigestLength()
- {
- return 20;
- }
-
- public void engineUpdate (byte b)
- {
- int i = ((int)bytecount) & 0x3f; //wgs
- int shift = (3 - i % 4) << 3;
- int idx = i / 4;
-
- i = (int)b;
- W[idx] = (W[idx] & ~(0xff << shift)) | ((i & 0xff) << shift);
-
- // if we've filled up a block, then process it
- if (((++bytecount) & 0x3f) == 0)
- munch ();
- }
-
- // This could be optimized.
- public void engineUpdate (byte bytes[], int off, int len)
- {
- if (len < 0)
- throw new ArrayIndexOutOfBoundsException ();
-
- int end = off + len;
- while (off < end)
- engineUpdate (bytes[off++]);
- }
-
- public void engineReset ()
- {
- bytecount = 0;
- // magic numbers from [1] p. 10.
- H0 = 0x67452301;
- H1 = 0xefcdab89;
- H2 = 0x98badcfe;
- H3 = 0x10325476;
- H4 = 0xc3d2e1f0;
- }
-
- public byte[] engineDigest ()
- {
- long bitcount = bytecount << 3;
- engineUpdate ((byte)0x80); // 10000000 in binary; the start of the padding
-
- // add the rest of the padding to fill this block out, but leave 8
- // bytes to put in the original bytecount
- while ((bytecount & 0x3f) != 56)
- engineUpdate ((byte)0);
-
- // add the length of the original, unpadded block to the end of
- // the padding
- W[14] = (int)(bitcount >>> 32);
- W[15] = (int)bitcount;
- bytecount += 8;
-
- // digest the fully padded block
- munch ();
-
- byte[] result
- = new byte[] {(byte)(H0 >>> 24), (byte)(H0 >>> 16),
- (byte)(H0 >>> 8), (byte)H0,
- (byte)(H1 >>> 24), (byte)(H1 >>> 16),
- (byte)(H1 >>> 8), (byte)H1,
- (byte)(H2 >>> 24), (byte)(H2 >>> 16),
- (byte)(H2 >>> 8), (byte)H2,
- (byte)(H3 >>> 24), (byte)(H3 >>> 16),
- (byte)(H3 >>> 8), (byte)H3,
- (byte)(H4 >>> 24), (byte)(H4 >>> 16),
- (byte)(H4 >>> 8), (byte)H4};
-
- engineReset ();
- return result;
- }
-
- // Process a single block. This is pretty much copied verbatim from
- // [1] pp. 9, 10.
- private void munch ()
- {
- for (int t = 16; t < 80; ++ t)
- {
- int Wt = W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16];
- W[t] = Wt << 1 | Wt >>> 31;
- }
-
- int A = H0;
- int B = H1;
- int C = H2;
- int D = H3;
- int E = H4;
-
- for (int t = 0; t < 20; ++ t)
- {
- int TEMP = (A << 5 | A >>> 27) // S^5(A)
- + ((B & C) | (~B & D)) // f_t(B,C,D)
- + E + W[t]
- + 0x5a827999; // K_t
-
- E = D;
- D = C;
- C = B << 30 | B >>> 2; // S^30(B)
- B = A;
- A = TEMP;
- }
-
- for (int t = 20; t < 40; ++ t)
- {
- int TEMP = (A << 5 | A >>> 27) // S^5(A)
- + (B ^ C ^ D) // f_t(B,C,D)
- + E + W[t]
- + 0x6ed9eba1; // K_t
-
- E = D;
- D = C;
- C = B << 30 | B >>> 2; // S^30(B)
- B = A;
- A = TEMP;
- }
-
- for (int t = 40; t < 60; ++ t)
- {
- int TEMP = (A << 5 | A >>> 27) // S^5(A)
- + (B & C | B & D | C & D) // f_t(B,C,D)
- + E + W[t]
- + 0x8f1bbcdc; // K_t
-
- E = D;
- D = C;
- C = B << 30 | B >>> 2; // S^30(B)
- B = A;
- A = TEMP;
- }
-
- for (int t = 60; t < 80; ++ t)
- {
- int TEMP = (A << 5 | A >>> 27) // S^5(A)
- + (B ^ C ^ D) // f_t(B,C,D)
- + E + W[t]
- + 0xca62c1d6; // K_t
-
- E = D;
- D = C;
- C = B << 30 | B >>> 2; // S^30(B)
- B = A;
- A = TEMP;
- }
-
- H0 += A;
- H1 += B;
- H2 += C;
- H3 += D;
- H4 += E;
-
- // Reset W by clearing it.
- for (int t = 0; t < 80; ++ t)
- W[t] = 0;
- }
-
- public Object clone ()
- {
- return new SHA (this);
- }
-
- private SHA (SHA copy)
- {
- this ();
- bytecount = copy.bytecount;
- H0 = copy.H0;
- H1 = copy.H1;
- H2 = copy.H2;
- H3 = copy.H3;
- H4 = copy.H4;
- System.arraycopy (copy.W, 0, W, 0, 80);
- }
-
- private final int W[] = new int[80];
- private long bytecount;
- private int H0;
- private int H1;
- private int H2;
- private int H3;
- private int H4;
-}
diff --git a/libjava/gnu/java/security/provider/SHA1PRNG.java b/libjava/gnu/java/security/provider/SHA1PRNG.java
deleted file mode 100644
index 7f2784881fb..00000000000
--- a/libjava/gnu/java/security/provider/SHA1PRNG.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* SHA1PRNG.java --- Secure Random SPI SHA1PRNG
- Copyright (C) 1999, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import java.io.Serializable;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandomSpi;
-import java.util.Random;
-
-public class SHA1PRNG extends SecureRandomSpi implements Serializable
-{
- MessageDigest digest;
- byte seed[];
- byte data[];
- int seedpos;
- int datapos;
- private boolean seeded = false; // set to true when we seed this
-
- public SHA1PRNG()
- {
- try {
- digest = MessageDigest.getInstance("SHA");
- } catch ( NoSuchAlgorithmException nsae) {
-// System.out.println("Failed to find SHA Message Digest: " + nsae);
-// nsae.printStackTrace();
- throw new InternalError ("no SHA implementation found");
- }
-
- seed = new byte[20];
- seedpos = 0;
- data = new byte[40];
- datapos = 20; // try to force hashing a first block
- }
-
- public void engineSetSeed(byte[] seed)
- {
- for(int i = 0; i < seed.length; i++)
- this.seed[seedpos++ % 20] ^= seed[i];
- seedpos %= 20;
-
- }
-
- public void engineNextBytes(byte[] bytes)
- {
- ensureIsSeeded ();
- int loc = 0;
- while (loc < bytes.length)
- {
- int copy = Math.min (bytes.length - loc, 20 - datapos);
-
- if (copy > 0)
- {
- System.arraycopy (data, datapos, bytes, loc, copy);
- datapos += copy;
- loc += copy;
- }
- else
- {
- // No data ready for copying, so refill our buffer.
- System.arraycopy( seed, 0, data, 20, 20);
- byte[] digestdata = digest.digest( data );
- System.arraycopy( digestdata, 0, data, 0, 20);
- datapos = 0;
- }
- }
- }
-
- public byte[] engineGenerateSeed(int numBytes)
- {
- byte tmp[] = new byte[numBytes];
-
- engineNextBytes( tmp );
- return tmp;
- }
-
- private void ensureIsSeeded()
- {
- if (!seeded)
- {
- new Random(0L).nextBytes(seed);
-
- byte[] digestdata = digest.digest(data);
- System.arraycopy(digestdata, 0, data, 0, 20);
-
- seeded = true;
- }
- }
-
-}
diff --git a/libjava/gnu/java/security/provider/SHA1withRSA.java b/libjava/gnu/java/security/provider/SHA1withRSA.java
deleted file mode 100644
index 0e63fdeeb52..00000000000
--- a/libjava/gnu/java/security/provider/SHA1withRSA.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* SHA1withRSA.java -- SHA-1 with RSA encryption signatures.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import gnu.java.security.OID;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-public class SHA1withRSA extends RSA
-{
-
- // Constant.
- // -------------------------------------------------------------------------
-
- private static final OID SHA1 = new OID("1.3.14.3.2.26");
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public SHA1withRSA() throws NoSuchAlgorithmException
- {
- super(MessageDigest.getInstance("SHA-160"), SHA1);
- }
-}
diff --git a/libjava/gnu/java/security/provider/X509CertificateFactory.java b/libjava/gnu/java/security/provider/X509CertificateFactory.java
deleted file mode 100644
index 1a415eabb05..00000000000
--- a/libjava/gnu/java/security/provider/X509CertificateFactory.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/* X509CertificateFactory.java -- generates X.509 certificates.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.provider;
-
-import gnu.java.io.Base64InputStream;
-import gnu.java.security.x509.X509CRL;
-import gnu.java.security.x509.X509CertPath;
-import gnu.java.security.x509.X509Certificate;
-
-import java.io.BufferedInputStream;
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.cert.CRL;
-import java.security.cert.CRLException;
-import java.security.cert.CertPath;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactorySpi;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-public class X509CertificateFactory extends CertificateFactorySpi
-{
-
- // Constants.
- // ------------------------------------------------------------------------
-
- public static final String BEGIN_CERTIFICATE = "-----BEGIN CERTIFICATE-----";
- public static final String END_CERTIFICATE = "-----END CERTIFICATE-----";
- public static final String BEGIN_X509_CRL = "-----BEGIN X509 CRL-----";
- public static final String END_X509_CRL = "-----END X509 CRL-----";
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- public X509CertificateFactory()
- {
- super();
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- public Certificate engineGenerateCertificate(InputStream inStream)
- throws CertificateException
- {
- try
- {
- return generateCert(inStream);
- }
- catch (IOException ioe)
- {
- CertificateException ce = new CertificateException(ioe.getMessage());
- ce.initCause (ioe);
- throw ce;
- }
- }
-
- public Collection engineGenerateCertificates(InputStream inStream)
- throws CertificateException
- {
- LinkedList certs = new LinkedList();
- while (true)
- {
- try
- {
- certs.add(generateCert(inStream));
- }
- catch (EOFException eof)
- {
- break;
- }
- catch (IOException ioe)
- {
- CertificateException ce = new CertificateException(ioe.getMessage());
- ce.initCause (ioe);
- throw ce;
- }
- }
- return certs;
- }
-
- public CRL engineGenerateCRL(InputStream inStream) throws CRLException
- {
- try
- {
- return generateCRL(inStream);
- }
- catch (IOException ioe)
- {
- CRLException crle = new CRLException(ioe.getMessage());
- crle.initCause (ioe);
- throw crle;
- }
- }
-
- public Collection engineGenerateCRLs(InputStream inStream)
- throws CRLException
- {
- LinkedList crls = new LinkedList();
- while (true)
- {
- try
- {
- crls.add(generateCRL(inStream));
- }
- catch (EOFException eof)
- {
- break;
- }
- catch (IOException ioe)
- {
- CRLException crle = new CRLException(ioe.getMessage());
- crle.initCause (ioe);
- throw crle;
- }
- }
- return crls;
- }
-
- public CertPath engineGenerateCertPath(List certs)
- {
- return new X509CertPath(certs);
- }
-
- public CertPath engineGenerateCertPath(InputStream in)
- throws CertificateEncodingException
- {
- return new X509CertPath(in);
- }
-
- public CertPath engineGenerateCertPath(InputStream in, String encoding)
- throws CertificateEncodingException
- {
- return new X509CertPath(in, encoding);
- }
-
- public Iterator engineGetCertPathEncodings()
- {
- return X509CertPath.ENCODINGS.iterator();
- }
-
- // Own methods.
- // ------------------------------------------------------------------------
-
- private X509Certificate generateCert(InputStream inStream)
- throws IOException, CertificateException
- {
- if (inStream == null)
- throw new CertificateException("missing input stream");
- if (!inStream.markSupported())
- inStream = new BufferedInputStream(inStream, 8192);
- inStream.mark(20);
- int i = inStream.read();
- if (i == -1)
- throw new EOFException();
-
- // If the input is in binary DER format, the first byte MUST be
- // 0x30, which stands for the ASN.1 [UNIVERSAL 16], which is the
- // UNIVERSAL SEQUENCE, with the CONSTRUCTED bit (0x20) set.
- //
- // So if we do not see 0x30 here we will assume it is in Base-64.
- if (i != 0x30)
- {
- inStream.reset();
- StringBuffer line = new StringBuffer(80);
- do
- {
- line.setLength(0);
- do
- {
- i = inStream.read();
- if (i == -1)
- throw new EOFException();
- if (i != '\n' && i != '\r')
- line.append((char) i);
- }
- while (i != '\n' && i != '\r');
- }
- while (!line.toString().equals(BEGIN_CERTIFICATE));
- X509Certificate ret = new X509Certificate(
- new BufferedInputStream(new Base64InputStream(inStream), 8192));
- line.setLength(0);
- line.append('-'); // Base64InputStream will eat this.
- do
- {
- i = inStream.read();
- if (i == -1)
- throw new EOFException();
- if (i != '\n' && i != '\r')
- line.append((char) i);
- }
- while (i != '\n' && i != '\r');
- // XXX ???
- if (!line.toString().equals(END_CERTIFICATE))
- throw new CertificateException("no end-of-certificate marker");
- return ret;
- }
- else
- {
- inStream.reset();
- return new X509Certificate(inStream);
- }
- }
-
- private X509CRL generateCRL(InputStream inStream)
- throws IOException, CRLException
- {
- if (inStream == null)
- throw new CRLException("missing input stream");
- if (!inStream.markSupported())
- inStream = new BufferedInputStream(inStream, 8192);
- inStream.mark(20);
- int i = inStream.read();
- if (i == -1)
- throw new EOFException();
-
- // If the input is in binary DER format, the first byte MUST be
- // 0x30, which stands for the ASN.1 [UNIVERSAL 16], which is the
- // UNIVERSAL SEQUENCE, with the CONSTRUCTED bit (0x20) set.
- //
- // So if we do not see 0x30 here we will assume it is in Base-64.
- if (i != 0x30)
- {
- inStream.reset();
- StringBuffer line = new StringBuffer(80);
- do
- {
- line.setLength(0);
- do
- {
- i = inStream.read();
- if (i == -1)
- throw new EOFException();
- if (i != '\n' && i != '\r')
- line.append((char) i);
- }
- while (i != '\n' && i != '\r');
- }
- while (!line.toString().startsWith(BEGIN_X509_CRL));
- X509CRL ret = new X509CRL(
- new BufferedInputStream(new Base64InputStream(inStream), 8192));
- line.setLength(0);
- line.append('-'); // Base64InputStream will eat this.
- do
- {
- i = inStream.read();
- if (i == -1)
- throw new EOFException();
- if (i != '\n' && i != '\r')
- line.append((char) i);
- }
- while (i != '\n' && i != '\r');
- // XXX ???
- if (!line.toString().startsWith(END_X509_CRL))
- throw new CRLException("no end-of-CRL marker");
- return ret;
- }
- else
- {
- inStream.reset();
- return new X509CRL(inStream);
- }
- }
-}
diff --git a/libjava/gnu/java/security/util/Prime.java b/libjava/gnu/java/security/util/Prime.java
deleted file mode 100644
index e493ce67503..00000000000
--- a/libjava/gnu/java/security/util/Prime.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Prime.java --- Prime number generation utilities
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.util;
-import java.math.BigInteger;
-import java.util.Random;
-//import java.security.SecureRandom;
-
-public final class Prime
-{
-
- /*
- See IEEE P1363 A.15.4 (10/05/98 Draft)
- */
- public static BigInteger generateRandomPrime( int pmin, int pmax, BigInteger f )
- {
- BigInteger d;
-
- //Step 1 - generate prime
- BigInteger p = new BigInteger( (pmax + pmin)/2, new Random() );
- if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmin ) ) <= 0 )
- {
- p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin ).subtract( p ) );
- }
-
- //Step 2 - test for even
- if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0)
- p = p.add( BigInteger.valueOf( 1 ) );
-
- for(;;)
- {
- //Step 3
- if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmax)) > 0)
- {
- //Step 3.1
- p = p.subtract( BigInteger.valueOf( 1 ).shiftLeft( pmax) );
- p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin) );
- p = p.subtract( BigInteger.valueOf( 1 ) );
-
- //Step 3.2
- // put step 2 code here so looping code is cleaner
- //Step 2 - test for even
- if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0)
- p = p.add( BigInteger.valueOf( 1 ) );
- continue;
- }
-
- //Step 4 - compute GCD
- d = p.subtract( BigInteger.valueOf(1) );
- d = d.gcd( f );
-
- //Step 5 - test d
- if( d.compareTo( BigInteger.valueOf( 1 ) ) == 0)
- {
- //Step 5.1 - test primality
- if( p.isProbablePrime( 1 ) == true )
- {
- //Step 5.2;
- return p;
- }
- }
- //Step 6
- p = p.add( BigInteger.valueOf( 2 ) );
-
- //Step 7
- }
- }
-
-
- /*
- See IEEE P1363 A.15.5 (10/05/98 Draft)
- */
- public static BigInteger generateRandomPrime( BigInteger r, BigInteger a, int pmin, int pmax, BigInteger f )
- {
- BigInteger d, w;
-
- //Step 1 - generate prime
- BigInteger p = new BigInteger( (pmax + pmin)/2, new Random() );
-
- steptwo:{ //Step 2
- w = p.mod( r.multiply( BigInteger.valueOf(2) ));
-
- //Step 3
- p = p.add( r.multiply( BigInteger.valueOf(2) ) );
- p = p.subtract( w );
- p = p.add(a);
-
- //Step 4 - test for even
- if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0)
- p = p.add( r );
-
- for(;;)
- {
- //Step 5
- if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmax)) > 0)
- {
- //Step 5.1
- p = p.subtract( BigInteger.valueOf( 1 ).shiftLeft( pmax) );
- p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin) );
- p = p.subtract( BigInteger.valueOf( 1 ) );
-
- //Step 5.2 - goto to Step 2
- break steptwo;
- }
-
- //Step 6
- d = p.subtract( BigInteger.valueOf(1) );
- d = d.gcd( f );
-
- //Step 7 - test d
- if( d.compareTo( BigInteger.valueOf( 1 ) ) == 0)
- {
- //Step 7.1 - test primality
- if( p.isProbablePrime( 1 ) == true )
- {
- //Step 7.2;
- return p;
- }
- }
- //Step 8
- p = p.add( r.multiply( BigInteger.valueOf(2) ) );
-
- //Step 9
- }
- }
- //Should never reach here but makes the compiler happy
- return BigInteger.valueOf(0);
- }
-}
diff --git a/libjava/gnu/java/security/x509/GnuPKIExtension.java b/libjava/gnu/java/security/x509/GnuPKIExtension.java
deleted file mode 100644
index 8e74b8b24ac..00000000000
--- a/libjava/gnu/java/security/x509/GnuPKIExtension.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* GnuPKIExtension.java -- interface for GNU PKI extensions.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509;
-
-import gnu.java.security.OID;
-import gnu.java.security.x509.ext.Extension;
-
-import java.security.cert.X509Extension;
-import java.util.Collection;
-
-public interface GnuPKIExtension extends X509Extension
-{
-
- /**
- * Returns the extension object for the given object identifier.
- *
- * @param oid The OID of the extension to get.
- * @return The extension, or null if there is no such extension.
- */
- Extension getExtension(OID oid);
-
- Collection getExtensions();
-}
diff --git a/libjava/gnu/java/security/x509/PolicyNodeImpl.java b/libjava/gnu/java/security/x509/PolicyNodeImpl.java
deleted file mode 100644
index 72cb4a9ea91..00000000000
--- a/libjava/gnu/java/security/x509/PolicyNodeImpl.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/* PolicyNodeImpl.java -- An implementation of a policy tree node.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509;
-
-import java.security.cert.PolicyNode;
-import java.security.cert.PolicyQualifierInfo;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-public final class PolicyNodeImpl implements PolicyNode
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private String policy;
- private final Set expectedPolicies;
- private final Set qualifiers;
- private final Set children;
- private PolicyNodeImpl parent;
- private int depth;
- private boolean critical;
- private boolean readOnly;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public PolicyNodeImpl()
- {
- expectedPolicies = new HashSet();
- qualifiers = new HashSet();
- children = new HashSet();
- readOnly = false;
- critical = false;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public void addChild(PolicyNodeImpl node)
- {
- if (readOnly)
- throw new IllegalStateException("read only");
- if (node.getParent() != null)
- throw new IllegalStateException("already a child node");
- node.parent = this;
- node.setDepth(depth + 1);
- children.add(node);
- }
-
- public Iterator getChildren()
- {
- return Collections.unmodifiableSet(children).iterator();
- }
-
- public int getDepth()
- {
- return depth;
- }
-
- public void setDepth(int depth)
- {
- if (readOnly)
- throw new IllegalStateException("read only");
- this.depth = depth;
- }
-
- public void addAllExpectedPolicies(Set policies)
- {
- if (readOnly)
- throw new IllegalStateException("read only");
- expectedPolicies.addAll(policies);
- }
-
- public void addExpectedPolicy(String policy)
- {
- if (readOnly)
- throw new IllegalStateException("read only");
- expectedPolicies.add(policy);
- }
-
- public Set getExpectedPolicies()
- {
- return Collections.unmodifiableSet(expectedPolicies);
- }
-
- public PolicyNode getParent()
- {
- return parent;
- }
-
- public void addAllPolicyQualifiers (Collection qualifiers)
- {
- for (Iterator it = qualifiers.iterator(); it.hasNext(); )
- {
- if (!(it.next() instanceof PolicyQualifierInfo))
- throw new IllegalArgumentException ("can only add PolicyQualifierInfos");
- }
- qualifiers.addAll (qualifiers);
- }
-
- public void addPolicyQualifier (PolicyQualifierInfo qualifier)
- {
- if (readOnly)
- throw new IllegalStateException("read only");
- qualifiers.add(qualifier);
- }
-
- public Set getPolicyQualifiers()
- {
- return Collections.unmodifiableSet(qualifiers);
- }
-
- public String getValidPolicy()
- {
- return policy;
- }
-
- public void setValidPolicy(String policy)
- {
- if (readOnly)
- throw new IllegalStateException("read only");
- this.policy = policy;
- }
-
- public boolean isCritical()
- {
- return critical;
- }
-
- public void setCritical(boolean critical)
- {
- if (readOnly)
- throw new IllegalStateException("read only");
- this.critical = critical;
- }
-
- public void setReadOnly()
- {
- if (readOnly)
- return;
- readOnly = true;
- for (Iterator it = getChildren(); it.hasNext(); )
- ((PolicyNodeImpl) it.next()).setReadOnly();
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < depth; i++)
- buf.append(" ");
- buf.append("(");
- buf.append(PolicyNodeImpl.class.getName());
- buf.append(" (oid ");
- buf.append(policy);
- buf.append(") (depth ");
- buf.append(depth);
- buf.append(") (qualifiers ");
- buf.append(qualifiers);
- buf.append(") (critical ");
- buf.append(critical);
- buf.append(") (expectedPolicies ");
- buf.append(expectedPolicies);
- buf.append(") (children (");
- final String nl = System.getProperty("line.separator");
- for (Iterator it = getChildren(); it.hasNext(); )
- {
- buf.append(nl);
- buf.append(it.next().toString());
- }
- buf.append(")))");
- return buf.toString();
- }
-}
diff --git a/libjava/gnu/java/security/x509/Util.java b/libjava/gnu/java/security/x509/Util.java
deleted file mode 100644
index d27392026f8..00000000000
--- a/libjava/gnu/java/security/x509/Util.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/* Util.java -- Miscellaneous utility methods.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509;
-
-/**
- * A collection of useful class methods.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public final class Util
-{
-
- // Constants.
- // -------------------------------------------------------------------------
-
- public static final String HEX = "0123456789abcdef";
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- /**
- * Convert a byte array to a hexadecimal string, as though it were a
- * big-endian arbitrarily-sized integer.
- *
- * @param buf The bytes to format.
- * @param off The offset to start at.
- * @param len The number of bytes to format.
- * @return A hexadecimal representation of the specified bytes.
- */
- public static String toHexString(byte[] buf, int off, int len)
- {
- StringBuffer str = new StringBuffer();
- for (int i = 0; i < len; i++)
- {
- str.append(HEX.charAt(buf[i+off] >>> 4 & 0x0F));
- str.append(HEX.charAt(buf[i+off] & 0x0F));
- }
- return str.toString();
- }
-
- /**
- * See {@link #toHexString(byte[],int,int)}.
- */
- public static String toHexString(byte[] buf)
- {
- return Util.toHexString(buf, 0, buf.length);
- }
-
- /**
- * Convert a byte array to a hexadecimal string, separating octets
- * with the given character.
- *
- * @param buf The bytes to format.
- * @param off The offset to start at.
- * @param len The number of bytes to format.
- * @param sep The character to insert between octets.
- * @return A hexadecimal representation of the specified bytes.
- */
- public static String toHexString(byte[] buf, int off, int len, char sep)
- {
- StringBuffer str = new StringBuffer();
- for (int i = 0; i < len; i++)
- {
- str.append(HEX.charAt(buf[i+off] >>> 4 & 0x0F));
- str.append(HEX.charAt(buf[i+off] & 0x0F));
- if (i < len - 1)
- str.append(sep);
- }
- return str.toString();
- }
-
- /**
- * See {@link #toHexString(byte[],int,int,char)}.
- */
- public static String toHexString(byte[] buf, char sep)
- {
- return Util.toHexString(buf, 0, buf.length, sep);
- }
-
- /**
- * Create a representation of the given byte array similar to the
- * output of `hexdump -C', which is
- *
- * <p><pre>OFFSET SIXTEEN-BYTES-IN-HEX PRINTABLE-BYTES</pre>
- *
- * <p>The printable bytes show up as-is if they are printable and
- * not a newline character, otherwise showing as '.'.
- *
- * @param buf The bytes to format.
- * @param off The offset to start at.
- * @param len The number of bytes to encode.
- * @return The formatted string.
- */
- public static String hexDump(byte[] buf, int off, int len, String prefix)
- {
- String nl = System.getProperty("line.separator");
- StringBuffer str = new StringBuffer();
- int i = 0;
- while (i < len)
- {
- str.append(prefix);
- str.append(Util.formatInt(i+off, 16, 8));
- str.append(" ");
- String s = Util.toHexString(buf, i+off, Math.min(16, len-i), ' ');
- str.append(s);
- for (int j = 56 - (56 - s.length()); j < 56; j++)
- str.append(" ");
- for (int j = 0; j < Math.min(16, len - i); j++)
- {
- if ((buf[i+off+j] & 0xFF) < 0x20 || (buf[i+off+j] & 0xFF) > 0x7E)
- str.append('.');
- else
- str.append((char) (buf[i+off+j] & 0xFF));
- }
- str.append(nl);
- i += 16;
- }
- return str.toString();
- }
-
- /**
- * See {@link #hexDump(byte[],int,int)}.
- */
- public static String hexDump(byte[] buf, String prefix)
- {
- return hexDump(buf, 0, buf.length, prefix);
- }
-
- /**
- * Format an integer into the specified radix, zero-filled.
- *
- * @param i The integer to format.
- * @param radix The radix to encode to.
- * @param len The target length of the string. The string is
- * zero-padded to this length, but may be longer.
- * @return The formatted integer.
- */
- public static String formatInt(int i, int radix, int len)
- {
- String s = Integer.toString(i, radix);
- StringBuffer buf = new StringBuffer();
- for (int j = 0; j < len - s.length(); j++)
- buf.append("0");
- buf.append(s);
- return buf.toString();
- }
-
- /**
- * Convert a hexadecimal string into its byte representation.
- *
- * @param hex The hexadecimal string.
- * @return The converted bytes.
- */
- public static byte[] toByteArray(String hex)
- {
- hex = hex.toLowerCase();
- byte[] buf = new byte[hex.length() / 2];
- int j = 0;
- for (int i = 0; i < buf.length; i++)
- {
- buf[i] = (byte) ((Character.digit(hex.charAt(j++), 16) << 4) |
- Character.digit(hex.charAt(j++), 16));
- }
- return buf;
- }
-}
diff --git a/libjava/gnu/java/security/x509/X500DistinguishedName.java b/libjava/gnu/java/security/x509/X500DistinguishedName.java
deleted file mode 100644
index daf746f5dc5..00000000000
--- a/libjava/gnu/java/security/x509/X500DistinguishedName.java
+++ /dev/null
@@ -1,548 +0,0 @@
-/* X500DistinguishedName.java -- X.500 distinguished name.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class X500DistinguishedName implements Principal
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID CN = new OID("2.5.4.3");
- public static final OID C = new OID("2.5.4.6");
- public static final OID L = new OID("2.5.4.7");
- public static final OID ST = new OID("2.5.4.8");
- public static final OID STREET = new OID("2.5.4.9");
- public static final OID O = new OID("2.5.4.10");
- public static final OID OU = new OID("2.5.4.11");
- public static final OID T = new OID("2.5.4.12");
- public static final OID DNQ = new OID("2.5.4.46");
- public static final OID NAME = new OID("2.5.4.41");
- public static final OID GIVENNAME = new OID("2.5.4.42");
- public static final OID INITIALS = new OID("2.5.4.43");
- public static final OID GENERATION = new OID("2.5.4.44");
- public static final OID EMAIL = new OID("1.2.840.113549.1.9.1");
- public static final OID DC = new OID("0.9.2342.19200300.100.1.25");
- public static final OID UID = new OID("0.9.2342.19200300.100.1.1");
-
- private List components;
- private Map currentRdn;
- private boolean fixed;
- private String stringRep;
- private byte[] encoded;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public X500DistinguishedName()
- {
- components = new LinkedList();
- currentRdn = new LinkedHashMap();
- components.add(currentRdn);
- }
-
- public X500DistinguishedName(String name)
- {
- this();
- try
- {
- parseString(name);
- }
- catch (IOException ioe)
- {
- throw new IllegalArgumentException(ioe.toString());
- }
- }
-
- public X500DistinguishedName(byte[] encoded) throws IOException
- {
- this();
- parseDer(new DERReader(encoded));
- }
-
- public X500DistinguishedName(InputStream encoded) throws IOException
- {
- this();
- parseDer(new DERReader(encoded));
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public String getName()
- {
- return toString();
- }
-
- public void newRelativeDistinguishedName()
- {
- if (fixed || currentRdn.isEmpty()) return;
- currentRdn = new LinkedHashMap();
- components.add(currentRdn);
- }
-
- public int size()
- {
- return components.size();
- }
-
- public int countComponents()
- {
- int count = 0;
- for (Iterator it = components.iterator(); it.hasNext(); )
- {
- count += ((Map) it.next()).size();
- }
- return count;
- }
-
- public boolean containsComponent(OID oid, String value)
- {
- for (Iterator it = components.iterator(); it.hasNext(); )
- {
- Map rdn = (Map) it.next();
- String s = (String) rdn.get(oid);
- if (s == null)
- continue;
- if (compressWS(value).equalsIgnoreCase(compressWS(s)))
- return true;
- }
- return false;
- }
-
- public String getComponent(OID oid)
- {
- for (Iterator it = components.iterator(); it.hasNext(); )
- {
- Map rdn = (Map) it.next();
- if (rdn.containsKey(oid))
- return (String) rdn.get(oid);
- }
- return null;
- }
-
- public String getComponent(OID oid, int rdn)
- {
- if (rdn >= size())
- return null;
- return (String) ((Map) components.get(rdn)).get(oid);
- }
-
- public void putComponent(OID oid, String value)
- {
- currentRdn.put(oid, value);
- }
-
- public void putComponent(String name, String value)
- {
- name = name.trim().toLowerCase();
- if (name.equals("cn"))
- putComponent(CN, value);
- else if (name.equals("c"))
- putComponent(C, value);
- else if (name.equals("l"))
- putComponent(L, value);
- else if (name.equals("street"))
- putComponent(STREET, value);
- else if (name.equals("st"))
- putComponent(ST, value);
- else if (name.equals("t"))
- putComponent(T, value);
- else if (name.equals("dnq"))
- putComponent(DNQ, value);
- else if (name.equals("name"))
- putComponent(NAME, value);
- else if (name.equals("givenname"))
- putComponent(GIVENNAME, value);
- else if (name.equals("initials"))
- putComponent(INITIALS, value);
- else if (name.equals("generation"))
- putComponent(GENERATION, value);
- else if (name.equals("email"))
- putComponent(EMAIL, value);
- else if (name.equals("dc"))
- putComponent(DC, value);
- else if (name.equals("uid"))
- putComponent(UID, value);
- else
- putComponent(new OID(name), value);
- }
-
- public void setUnmodifiable()
- {
- if (fixed) return;
- fixed = true;
- List newComps = new ArrayList(components.size());
- for (Iterator it = components.iterator(); it.hasNext(); )
- {
- Map rdn = (Map) it.next();
- rdn = Collections.unmodifiableMap(rdn);
- newComps.add(rdn);
- }
- components = Collections.unmodifiableList(newComps);
- currentRdn = Collections.EMPTY_MAP;
- }
-
- public int hashCode()
- {
- int sum = 0;
- for (Iterator it = components.iterator(); it.hasNext(); )
- {
- Map m = (Map) it.next();
- for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
- {
- Map.Entry e = (Map.Entry) it2.next();
- sum += e.getKey().hashCode();
- sum += e.getValue().hashCode();
- }
- }
- return sum;
- }
-
- public boolean equals(Object o)
- {
- if (!(o instanceof X500DistinguishedName))
- return false;
- if (size() != ((X500DistinguishedName) o).size())
- return false;
- for (int i = 0; i < size(); i++)
- {
- Map m = (Map) components.get(i);
- for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
- {
- Map.Entry e = (Map.Entry) it2.next();
- OID oid = (OID) e.getKey();
- String v1 = (String) e.getValue();
- String v2 = ((X500DistinguishedName) o).getComponent(oid, i);
- if (!compressWS(v1).equalsIgnoreCase(compressWS(v2)))
- return false;
- }
- }
- return true;
- }
-
- public String toString()
- {
- if (fixed && stringRep != null)
- return stringRep;
- StringBuffer str = new StringBuffer();
- for (Iterator it = components.iterator(); it.hasNext(); )
- {
- Map m = (Map) it.next();
- for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
- {
- Map.Entry entry = (Map.Entry) it2.next();
- OID oid = (OID) entry.getKey();
- String value = (String) entry.getValue();
- if (oid.equals(CN))
- str.append("CN");
- else if (oid.equals(C))
- str.append("C");
- else if (oid.equals(L))
- str.append("L");
- else if (oid.equals(ST))
- str.append("ST");
- else if (oid.equals(STREET))
- str.append("STREET");
- else if (oid.equals(O))
- str.append("O");
- else if (oid.equals(OU))
- str.append("OU");
- else if (oid.equals(T))
- str.append("T");
- else if (oid.equals(DNQ))
- str.append("DNQ");
- else if (oid.equals(NAME))
- str.append("NAME");
- else
- str.append(oid.toString());
- str.append('=');
- str.append(value);
- if (it2.hasNext())
- str.append("+");
- }
- if (it.hasNext())
- str.append(',');
- }
- return (stringRep = str.toString());
- }
-
- public byte[] getDer()
- {
- if (fixed && encoded != null)
- return (byte[]) encoded.clone();
- ArrayList name = new ArrayList(components.size());
- for (Iterator it = components.iterator(); it.hasNext(); )
- {
- Map m = (Map) it.next();
- if (m.isEmpty())
- continue;
- Set rdn = new HashSet();
- for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
- {
- Map.Entry e = (Map.Entry) it.next();
- ArrayList atav = new ArrayList(2);
- atav.add(new DERValue(DER.OBJECT_IDENTIFIER, e.getKey()));
- atav.add(new DERValue(DER.UTF8_STRING, e.getValue()));
- rdn.add(new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, atav));
- }
- name.add(new DERValue(DER.SET|DER.CONSTRUCTED, rdn));
- }
- DERValue val = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, name);
- return (byte[]) (encoded = val.getEncoded()).clone();
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private int sep;
-
- private void parseString(String str) throws IOException
- {
- Reader in = new StringReader(str);
- while (true)
- {
- String key = readAttributeType(in);
- if (key == null)
- break;
- String value = readAttributeValue(in);
- putComponent(key, value);
- if (sep == ',')
- newRelativeDistinguishedName();
- }
- setUnmodifiable();
- }
-
- private String readAttributeType(Reader in) throws IOException
- {
- StringBuffer buf = new StringBuffer();
- int ch;
- while ((ch = in.read()) != '=')
- {
- if (ch == -1)
- {
- if (buf.length() > 0)
- throw new EOFException();
- return null;
- }
- if (ch > 127)
- throw new IOException("Invalid char: " + (char) ch);
- if (Character.isLetterOrDigit((char) ch) || ch == '-' || ch == '.')
- buf.append((char) ch);
- else
- throw new IOException("Invalid char: " + (char) ch);
- }
- return buf.toString();
- }
-
- private String readAttributeValue(Reader in) throws IOException
- {
- StringBuffer buf = new StringBuffer();
- int ch = in.read();
- if (ch == '#')
- {
- while (true)
- {
- ch = in.read();
- if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
- || Character.isDigit((char) ch))
- buf.append((char) ch);
- else if (ch == '+' || ch == ',')
- {
- sep = ch;
- String hex = buf.toString();
- return new String(Util.toByteArray(hex));
- }
- else
- throw new IOException("illegal character: " + (char) ch);
- }
- }
- else if (ch == '"')
- {
- while (true)
- {
- ch = in.read();
- if (ch == '"')
- break;
- else if (ch == '\\')
- {
- ch = in.read();
- if (ch == -1)
- throw new EOFException();
- if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
- || Character.isDigit((char) ch))
- {
- int i = Character.digit((char) ch, 16) << 4;
- ch = in.read();
- if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
- || Character.isDigit((char) ch)))
- throw new IOException("illegal hex char");
- i |= Character.digit((char) ch, 16);
- buf.append((char) i);
- }
- else
- buf.append((char) ch);
- }
- else
- buf.append((char) ch);
- }
- sep = in.read();
- if (sep != '+' || sep != ',')
- throw new IOException("illegal character: " + (char) ch);
- return buf.toString();
- }
- else
- {
- while (true)
- {
- switch (ch)
- {
- case '+':
- case ',':
- sep = ch;
- return buf.toString();
- case '\\':
- ch = in.read();
- if (ch == -1)
- throw new EOFException();
- if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
- || Character.isDigit((char) ch))
- {
- int i = Character.digit((char) ch, 16) << 4;
- ch = in.read();
- if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
- || Character.isDigit((char) ch)))
- throw new IOException("illegal hex char");
- i |= Character.digit((char) ch, 16);
- buf.append((char) i);
- }
- else
- buf.append((char) ch);
- break;
- case '=':
- case '<':
- case '>':
- case '#':
- case ';':
- throw new IOException("illegal character: " + (char) ch);
- case -1:
- throw new EOFException();
- default:
- buf.append((char) ch);
- }
- }
- }
- }
-
- private void parseDer(DERReader der) throws IOException
- {
- DERValue name = der.read();
- if (!name.isConstructed())
- throw new IOException("malformed Name");
- encoded = name.getEncoded();
- int len = 0;
- while (len < name.getLength())
- {
- DERValue rdn = der.read();
- if (!rdn.isConstructed())
- throw new IOException("badly formed RDNSequence");
- int len2 = 0;
- while (len2 < rdn.getLength())
- {
- DERValue atav = der.read();
- if (!atav.isConstructed())
- throw new IOException("badly formed AttributeTypeAndValue");
- DERValue val = der.read();
- if (val.getTag() != DER.OBJECT_IDENTIFIER)
- throw new IOException("badly formed AttributeTypeAndValue");
- OID oid = (OID) val.getValue();
- val = der.read();
- if (!(val.getValue() instanceof String))
- throw new IOException("badly formed AttributeTypeAndValue");
- String value = (String) val.getValue();
- putComponent(oid, value);
- len2 += atav.getEncodedLength();
- }
- len += rdn.getEncodedLength();
- if (len < name.getLength())
- newRelativeDistinguishedName();
- }
- setUnmodifiable();
- }
-
- private static String compressWS(String str)
- {
- StringBuffer buf = new StringBuffer();
- char lastChar = 0;
- for (int i = 0; i < str.length(); i++)
- {
- char c = str.charAt(i);
- if (Character.isWhitespace(c))
- {
- if (!Character.isWhitespace(lastChar))
- buf.append(' ');
- }
- else
- buf.append(c);
- lastChar = c;
- }
- return buf.toString().trim();
- }
-}
diff --git a/libjava/gnu/java/security/x509/X509CRL.java b/libjava/gnu/java/security/x509/X509CRL.java
deleted file mode 100644
index 5b2d3b14130..00000000000
--- a/libjava/gnu/java/security/x509/X509CRL.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/* X509CRL.java -- X.509 certificate revocation list.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509;
-
-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;
-import gnu.java.security.x509.ext.Extension;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigInteger;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Principal;
-import java.security.PublicKey;
-import java.security.Signature;
-import java.security.SignatureException;
-import java.security.cert.CRLException;
-import java.security.cert.Certificate;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.security.auth.x500.X500Principal;
-
-/**
- * X.509 certificate revocation lists.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class X509CRL extends java.security.cert.X509CRL
- implements GnuPKIExtension
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- private static final boolean DEBUG = false;
- private static void debug(String msg)
- {
- if (DEBUG)
- {
- System.err.print(">> X509CRL: ");
- System.err.println(msg);
- }
- }
-
- private static final OID ID_DSA = new OID("1.2.840.10040.4.1");
- private static final OID ID_DSA_WITH_SHA1 = new OID("1.2.840.10040.4.3");
- private static final OID ID_RSA = new OID("1.2.840.113549.1.1.1");
- private static final OID ID_RSA_WITH_MD2 = new OID("1.2.840.113549.1.1.2");
- private static final OID ID_RSA_WITH_MD5 = new OID("1.2.840.113549.1.1.4");
- private static final OID ID_RSA_WITH_SHA1 = new OID("1.2.840.113549.1.1.5");
-
- private byte[] encoded;
-
- private byte[] tbsCRLBytes;
- private int version;
- private OID algId;
- private byte[] algParams;
- private Date thisUpdate;
- private Date nextUpdate;
- private X500DistinguishedName issuerDN;
- private HashMap revokedCerts;
- private HashMap extensions;
-
- private OID sigAlg;
- private byte[] sigAlgParams;
- private byte[] rawSig;
- private byte[] signature;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new X.509 CRL.
- *
- * @param encoded The DER encoded CRL.
- * @throws CRLException If the input bytes are incorrect.
- * @throws IOException If the input bytes cannot be read.
- */
- public X509CRL(InputStream encoded) throws CRLException, IOException
- {
- super();
- revokedCerts = new HashMap();
- extensions = new HashMap();
- try
- {
- parse(encoded);
- }
- catch (IOException ioe)
- {
- ioe.printStackTrace();
- throw ioe;
- }
- catch (Exception x)
- {
- x.printStackTrace();
- throw new CRLException(x.toString());
- }
- }
-
- // X509CRL methods.
- // ------------------------------------------------------------------------
-
- public boolean equals(Object o)
- {
- if (!(o instanceof X509CRL))
- return false;
- return ((X509CRL) o).getRevokedCertificates().equals(revokedCerts.values());
- }
-
- public int hashCode()
- {
- return revokedCerts.hashCode();
- }
-
- public byte[] getEncoded() throws CRLException
- {
- return (byte[]) encoded.clone();
- }
-
- public void verify(PublicKey key)
- throws CRLException, NoSuchAlgorithmException, InvalidKeyException,
- NoSuchProviderException, SignatureException
- {
- Signature sig = Signature.getInstance(sigAlg.toString());
- doVerify(sig, key);
- }
-
- public void verify(PublicKey key, String provider)
- throws CRLException, NoSuchAlgorithmException, InvalidKeyException,
- NoSuchProviderException, SignatureException
- {
- Signature sig = Signature.getInstance(sigAlg.toString(), provider);
- doVerify(sig, key);
- }
-
- public int getVersion()
- {
- return version;
- }
-
- public Principal getIssuerDN()
- {
- return issuerDN;
- }
-
- public X500Principal getIssuerX500Principal()
- {
- return new X500Principal(issuerDN.getDer());
- }
-
- public Date getThisUpdate()
- {
- return (Date) thisUpdate.clone();
- }
-
- public Date getNextUpdate()
- {
- if (nextUpdate != null)
- return (Date) nextUpdate.clone();
- return null;
- }
-
- public java.security.cert.X509CRLEntry getRevokedCertificate(BigInteger serialNo)
- {
- return (java.security.cert.X509CRLEntry) revokedCerts.get(serialNo);
- }
-
- public Set getRevokedCertificates()
- {
- return Collections.unmodifiableSet(new HashSet(revokedCerts.values()));
- }
-
- public byte[] getTBSCertList() throws CRLException
- {
- return (byte[]) tbsCRLBytes.clone();
- }
-
- public byte[] getSignature()
- {
- return (byte[]) rawSig.clone();
- }
-
- public String getSigAlgName()
- {
- if (sigAlg.equals(ID_DSA_WITH_SHA1))
- return "SHA1withDSA";
- if (sigAlg.equals(ID_RSA_WITH_MD2))
- return "MD2withRSA";
- if (sigAlg.equals(ID_RSA_WITH_MD5))
- return "MD5withRSA";
- if (sigAlg.equals(ID_RSA_WITH_SHA1))
- return "SHA1withRSA";
- return "unknown";
- }
-
- public String getSigAlgOID()
- {
- return sigAlg.toString();
- }
-
- public byte[] getSigAlgParams()
- {
- if (sigAlgParams != null)
- return (byte[]) sigAlgParams.clone();
- return null;
- }
-
- // X509Extension methods.
- // ------------------------------------------------------------------------
-
- public boolean hasUnsupportedCriticalExtension()
- {
- for (Iterator it = extensions.values().iterator(); it.hasNext(); )
- {
- Extension e = (Extension) it.next();
- if (e.isCritical() && !e.isSupported())
- return true;
- }
- return false;
- }
-
- public Set getCriticalExtensionOIDs()
- {
- HashSet s = new HashSet();
- for (Iterator it = extensions.values().iterator(); it.hasNext(); )
- {
- Extension e = (Extension) it.next();
- if (e.isCritical())
- s.add(e.getOid().toString());
- }
- return Collections.unmodifiableSet(s);
- }
-
- public Set getNonCriticalExtensionOIDs()
- {
- HashSet s = new HashSet();
- for (Iterator it = extensions.values().iterator(); it.hasNext(); )
- {
- Extension e = (Extension) it.next();
- if (!e.isCritical())
- s.add(e.getOid().toString());
- }
- return Collections.unmodifiableSet(s);
- }
-
- public byte[] getExtensionValue(String oid)
- {
- Extension e = getExtension(new OID(oid));
- if (e != null)
- {
- return e.getValue().getEncoded();
- }
- return null;
- }
-
- // GnuPKIExtension method.
- // -------------------------------------------------------------------------
-
- public Extension getExtension(OID oid)
- {
- return (Extension) extensions.get(oid);
- }
-
- public Collection getExtensions()
- {
- return extensions.values();
- }
-
- // CRL methods.
- // -------------------------------------------------------------------------
-
- public String toString()
- {
- return X509CRL.class.getName();
- }
-
- public boolean isRevoked(Certificate cert)
- {
- if (!(cert instanceof java.security.cert.X509Certificate))
- throw new IllegalArgumentException("not a X.509 certificate");
- BigInteger certSerial =
- ((java.security.cert.X509Certificate) cert).getSerialNumber();
- X509CRLEntry ent = (X509CRLEntry) revokedCerts.get(certSerial);
- if (ent == null)
- return false;
- return ent.getRevocationDate().compareTo(new Date()) < 0;
- }
-
- // Own methods.
- // ------------------------------------------------------------------------
-
- private void doVerify(Signature sig, PublicKey key)
- throws CRLException, InvalidKeyException, SignatureException
- {
- sig.initVerify(key);
- sig.update(tbsCRLBytes);
- if (!sig.verify(signature))
- throw new CRLException("signature not verified");
- }
-
- private void parse(InputStream in) throws Exception
- {
- // CertificateList ::= SEQUENCE {
- DERReader der = new DERReader(in);
- DERValue val = der.read();
- debug("start CertificateList len == " + val.getLength());
- if (!val.isConstructed())
- throw new IOException("malformed CertificateList");
- encoded = val.getEncoded();
-
- // tbsCertList ::= SEQUENCE { -- TBSCertList
- val = der.read();
- if (!val.isConstructed())
- throw new IOException("malformed TBSCertList");
- debug("start tbsCertList len == " + val.getLength());
- tbsCRLBytes = val.getEncoded();
-
- // version Version OPTIONAL,
- // -- If present must be v2
- val = der.read();
- if (val.getValue() instanceof BigInteger)
- {
- version = ((BigInteger) val.getValue()).intValue() + 1;
- val = der.read();
- }
- else
- version = 1;
- debug("read version == " + version);
-
- // signature AlgorithmIdentifier,
- debug("start AlgorithmIdentifier len == " + val.getLength());
- if (!val.isConstructed())
- throw new IOException("malformed AlgorithmIdentifier");
- DERValue algIdVal = der.read();
- algId = (OID) algIdVal.getValue();
- debug("read object identifier == " + algId);
- if (val.getLength() > algIdVal.getEncodedLength())
- {
- val = der.read();
- debug("read parameters len == " + val.getEncodedLength());
- algParams = val.getEncoded();
- if (val.isConstructed())
- in.skip(val.getLength());
- }
-
- // issuer Name,
- val = der.read();
- issuerDN = new X500DistinguishedName(val.getEncoded());
- der.skip(val.getLength());
- debug("read issuer == " + issuerDN);
-
- // thisUpdate Time,
- thisUpdate = (Date) der.read().getValue();
- debug("read thisUpdate == " + thisUpdate);
-
- // nextUpdate Time OPTIONAL,
- val = der.read();
- if (val.getValue() instanceof Date)
- {
- nextUpdate = (Date) val.getValue();
- debug("read nextUpdate == " + nextUpdate);
- val = der.read();
- }
-
- // revokedCertificates SEQUENCE OF SEQUENCE {
- // -- X509CRLEntry objects...
- // } OPTIONAL,
- if (val.getTag() != 0)
- {
- int len = 0;
- while (len < val.getLength())
- {
- X509CRLEntry entry = new X509CRLEntry(version, der);
- revokedCerts.put(entry.getSerialNumber(), entry);
- len += entry.getEncoded().length;
- }
- val = der.read();
- }
-
- // crlExtensions [0] EXPLICIT Extensions OPTIONAL
- // -- if present MUST be v2
- if (val.getTagClass() != DER.UNIVERSAL && val.getTag() == 0)
- {
- if (version < 2)
- throw new IOException("extra data in CRL");
- DERValue exts = der.read();
- if (!exts.isConstructed())
- throw new IOException("malformed Extensions");
- debug("start Extensions len == " + exts.getLength());
- int len = 0;
- while (len < exts.getLength())
- {
- DERValue ext = der.read();
- if (!ext.isConstructed())
- throw new IOException("malformed Extension");
- Extension e = new Extension(ext.getEncoded());
- extensions.put(e.getOid(), e);
- der.skip(ext.getLength());
- len += ext.getEncodedLength();
- debug("current count == " + len);
- }
- val = der.read();
- }
-
- debug("read tag == " + val.getTag());
- if (!val.isConstructed())
- throw new IOException("malformed AlgorithmIdentifier");
- debug("start AlgorithmIdentifier len == " + val.getLength());
- DERValue sigAlgVal = der.read();
- debug("read tag == " + sigAlgVal.getTag());
- if (sigAlgVal.getTag() != DER.OBJECT_IDENTIFIER)
- throw new IOException("malformed AlgorithmIdentifier");
- sigAlg = (OID) sigAlgVal.getValue();
- debug("signature id == " + sigAlg);
- debug("sigAlgVal length == " + sigAlgVal.getEncodedLength());
- if (val.getLength() > sigAlgVal.getEncodedLength())
- {
- val = der.read();
- debug("sig params tag = " + val.getTag() + " len == " + val.getEncodedLength());
- sigAlgParams = (byte[]) val.getEncoded();
- if (val.isConstructed())
- in.skip(val.getLength());
- }
- val = der.read();
- debug("read tag = " + val.getTag());
- rawSig = val.getEncoded();
- signature = ((BitString) val.getValue()).toByteArray();
- }
-}
diff --git a/libjava/gnu/java/security/x509/X509CRLEntry.java b/libjava/gnu/java/security/x509/X509CRLEntry.java
deleted file mode 100644
index a3bcfdea823..00000000000
--- a/libjava/gnu/java/security/x509/X509CRLEntry.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/* X509CRLEntry.java -- an entry in a X.509 CRL.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-import gnu.java.security.x509.ext.Extension;
-
-import java.io.IOException;
-import java.math.BigInteger;
-import java.security.cert.CRLException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * A single entry in a X.509 certificate revocation list.
- *
- * @see X509CRL
- * @author Casey Marshall
- */
-class X509CRLEntry extends java.security.cert.X509CRLEntry
- implements GnuPKIExtension
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- private static final boolean DEBUG = false;
- private static void debug(String msg)
- {
- if (DEBUG)
- {
- System.err.print(">> X509CRLEntry: ");
- System.err.println(msg);
- }
- }
-
- /** The DER encoded form of this CRL entry. */
- private byte[] encoded;
-
- /** The revoked certificate's serial number. */
- private BigInteger serialNo;
-
- /** The date the certificate was revoked. */
- private Date revocationDate;
-
- /** The CRL entry extensions. */
- private HashMap extensions;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new X.509 certificate revocation list entry from the given
- * input stream and CRL version number.
- *
- * @param version The CRL version.
- * @param encoded The stream of DER bytes.
- * @throws CRLException If the ASN.1 structure is invalid.
- * @throws IOException If the bytes cannot be read.
- */
- X509CRLEntry(int version, DERReader encoded)
- throws CRLException, IOException
- {
- super();
- extensions = new HashMap();
- try
- {
- parse(version, encoded);
- }
- catch (IOException ioe)
- {
- throw ioe;
- }
- catch (Exception x)
- {
- throw new CRLException(x.toString());
- }
- }
-
- // X509CRLEntry methods.
- // ------------------------------------------------------------------------
-
- public boolean equals(Object o)
- {
- if (!(o instanceof X509CRLEntry))
- return false;
- return ((X509CRLEntry) o).getSerialNumber().equals(serialNo) &&
- ((X509CRLEntry) o).getRevocationDate().equals(revocationDate);
- }
-
- public int hashCode()
- {
- return serialNo.hashCode();
- }
-
- public byte[] getEncoded() throws CRLException
- {
- return (byte[]) encoded.clone();
- }
-
- public BigInteger getSerialNumber()
- {
- return serialNo;
- }
-
- public Date getRevocationDate()
- {
- return (Date) revocationDate.clone();
- }
-
- public boolean hasExtensions()
- {
- return ! extensions.isEmpty();
- }
-
- public String toString()
- {
- return "X509CRLEntry serial=" + serialNo + " revocation date="
- + revocationDate + " ext=" + extensions;
- }
-
- // X509Extension methods.
- // -------------------------------------------------------------------------
-
- public boolean hasUnsupportedCriticalExtension()
- {
- for (Iterator it = extensions.values().iterator(); it.hasNext(); )
- {
- Extension e = (Extension) it.next();
- if (e.isCritical() && !e.isSupported())
- return true;
- }
- return false;
- }
-
- public Set getCriticalExtensionOIDs()
- {
- HashSet s = new HashSet();
- for (Iterator it = extensions.values().iterator(); it.hasNext(); )
- {
- Extension e = (Extension) it.next();
- if (e.isCritical())
- s.add(e.getOid().toString());
- }
- return Collections.unmodifiableSet(s);
- }
-
- public Set getNonCriticalExtensionOIDs()
- {
- HashSet s = new HashSet();
- for (Iterator it = extensions.values().iterator(); it.hasNext(); )
- {
- Extension e = (Extension) it.next();
- if (!e.isCritical())
- s.add(e.getOid().toString());
- }
- return Collections.unmodifiableSet(s);
- }
-
- public byte[] getExtensionValue(String oid)
- {
- Extension e = getExtension(new OID(oid));
- if (e != null)
- {
- return e.getValue().getEncoded();
- }
- return null;
- }
-
- // GnuPKIExtension method.
- // -------------------------------------------------------------------------
-
- public Extension getExtension(OID oid)
- {
- return (Extension) extensions.get(oid);
- }
-
- public Collection getExtensions()
- {
- return extensions.values();
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private void parse(int version, DERReader der) throws Exception
- {
- // RevokedCertificate ::= SEQUENCE {
- DERValue entry = der.read();
- debug("start CRL entry len == " + entry.getLength());
- if (!entry.isConstructed())
- throw new IOException("malformed revokedCertificate");
- encoded = entry.getEncoded();
- int len = 0;
-
- debug("encoded entry:\n" + Util.hexDump(encoded, ">>>> "));
-
- // userCertificate CertificateSerialNumber,
- DERValue val = der.read();
- serialNo = (BigInteger) val.getValue();
- len += val.getEncodedLength();
- debug("userCertificate == " + serialNo + " current count == " + len);
-
- // revocationDate Time,
- val = der.read();
- revocationDate = (Date) val.getValue();
- len += val.getEncodedLength();
- debug("revocationDate == " + revocationDate + " current count == " + len);
-
- // crlEntryExtensions Extensions OPTIONAL
- // -- if present MUST be v2
- if (len < entry.getLength())
- {
- if (version < 2)
- throw new IOException("extra data in CRL entry");
- DERValue exts = der.read();
- if (!exts.isConstructed())
- throw new IOException("malformed Extensions");
- debug("start Extensions len == " + exts.getLength());
- len = 0;
- while (len < exts.getLength())
- {
- val = der.read();
- if (!val.isConstructed())
- throw new IOException("malformed Extension");
- debug("start Extension len == " + val.getLength());
- Extension e = new Extension(val.getEncoded());
- extensions.put(e.getOid(), e);
- der.skip(val.getLength());
- len += val.getEncodedLength();
- debug("current count == " + len);
- }
- }
- }
-}
diff --git a/libjava/gnu/java/security/x509/X509CRLSelectorImpl.java b/libjava/gnu/java/security/x509/X509CRLSelectorImpl.java
deleted file mode 100644
index 0ada5501689..00000000000
--- a/libjava/gnu/java/security/x509/X509CRLSelectorImpl.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* X509CRLSelectorImpl.java -- implementation of an X509CRLSelector.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509;
-
-import java.io.IOException;
-
-import java.security.Principal;
-import java.security.cert.CRL;
-import java.security.cert.CRLSelector;
-import java.security.cert.X509CRL;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.security.auth.x500.X500Principal;
-
-/**
- * Sun's implementation of X509CRLSelector sucks. This one tries to work
- * better.
- */
-public class X509CRLSelectorImpl implements CRLSelector
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private Set issuerNames;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public X509CRLSelectorImpl()
- {
- issuerNames = new HashSet();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public void addIssuerName(byte[] issuerName) throws IOException
- {
- issuerNames.add(new X500DistinguishedName(issuerName));
- }
-
- public void addIssuerName(String issuerName)
- {
- issuerNames.add(new X500DistinguishedName(issuerName));
- }
-
- public void addIssuerName(Principal issuerName) throws IOException
- {
- if (issuerName instanceof X500DistinguishedName)
- issuerNames.add(issuerName);
- else if (issuerName instanceof X500Principal)
- issuerNames.add(new X500DistinguishedName(((X500Principal) issuerName).getEncoded()));
- else
- issuerNames.add(new X500DistinguishedName(issuerName.getName()));
- }
-
- public Collection getIssuerNames()
- {
- return Collections.unmodifiableSet(issuerNames);
- }
-
- public Object clone()
- {
- X509CRLSelectorImpl copy = new X509CRLSelectorImpl();
- copy.issuerNames.addAll(issuerNames);
- return copy;
- }
-
- public boolean match(CRL crl)
- {
- if (!(crl instanceof X509CRL))
- return false;
- try
- {
- Principal p = ((X509CRL) crl).getIssuerDN();
- X500DistinguishedName thisName = null;
- if (p instanceof X500DistinguishedName)
- thisName = (X500DistinguishedName) p;
- else if (p instanceof X500Principal)
- thisName = new X500DistinguishedName(((X500Principal) p).getEncoded());
- else
- thisName = new X500DistinguishedName(p.getName());
- for (Iterator it = issuerNames.iterator(); it.hasNext(); )
- {
- X500DistinguishedName name = (X500DistinguishedName) it.next();
- if (thisName.equals(name))
- return true;
- }
- }
- catch (Exception x)
- {
- }
- return false;
- }
-}
-
diff --git a/libjava/gnu/java/security/x509/X509CertPath.java b/libjava/gnu/java/security/x509/X509CertPath.java
deleted file mode 100644
index e8ed6bf35d1..00000000000
--- a/libjava/gnu/java/security/x509/X509CertPath.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/* X509CertPath.java -- an X.509 certificate path.
- Copyright (C) 2004 Free Software Fonudation, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DEREncodingException;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigInteger;
-import java.security.cert.CertPath;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.CertificateException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * A certificate path (or certificate chain) of X509Certificates.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class X509CertPath extends CertPath
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- public static final List ENCODINGS = Collections.unmodifiableList(
- Arrays.asList(new String[] { "PkiPath", "PKCS7" }));
-
- private static final OID PKCS7_SIGNED_DATA = new OID("1.2.840.113549.1.7.2");
- private static final OID PKCS7_DATA = new OID("1.2.840.113549.1.7.1");
-
- /** The certificate path. */
- private List path;
-
- /** The cached PKCS #7 encoded bytes. */
- private byte[] pkcs_encoded;
-
- /** The cached PkiPath encoded bytes. */
- private byte[] pki_encoded;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public X509CertPath(List path)
- {
- super("X.509");
- this.path = Collections.unmodifiableList(path);
- }
-
- public X509CertPath(InputStream in) throws CertificateEncodingException
- {
- this(in, (String) ENCODINGS.get(0));
- }
-
- public X509CertPath(InputStream in, String encoding)
- throws CertificateEncodingException
- {
- super("X.509");
- try
- {
- parse(in, encoding);
- }
- catch (IOException ioe)
- {
- throw new CertificateEncodingException();
- }
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public List getCertificates()
- {
- return path; // already unmodifiable
- }
-
- public byte[] getEncoded() throws CertificateEncodingException
- {
- return getEncoded((String) ENCODINGS.get(0));
- }
-
- public byte[] getEncoded(String encoding) throws CertificateEncodingException
- {
- if (encoding.equalsIgnoreCase("PkiPath"))
- {
- if (pki_encoded == null)
- {
- try
- {
- pki_encoded = encodePki();
- }
- catch (IOException ioe)
- {
- throw new CertificateEncodingException();
- }
- }
- return (byte[]) pki_encoded.clone();
- }
- else if (encoding.equalsIgnoreCase("PKCS7"))
- {
- if (pkcs_encoded == null)
- {
- try
- {
- pkcs_encoded = encodePKCS();
- }
- catch (IOException ioe)
- {
- throw new CertificateEncodingException();
- }
- }
- return (byte[]) pkcs_encoded.clone();
- }
- else
- throw new CertificateEncodingException("unknown encoding: " + encoding);
- }
-
- public Iterator getEncodings()
- {
- return ENCODINGS.iterator(); // already unmodifiable
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private void parse(InputStream in, String encoding)
- throws CertificateEncodingException, IOException
- {
- DERReader der = new DERReader(in);
- DERValue path = null;
- if (encoding.equalsIgnoreCase("PkiPath"))
- {
- // PKI encoding is just a SEQUENCE of X.509 certificates.
- path = der.read();
- if (!path.isConstructed())
- throw new DEREncodingException("malformed PkiPath");
- }
- else if (encoding.equalsIgnoreCase("PKCS7"))
- {
- // PKCS #7 encoding means that the certificates are contained in a
- // SignedData PKCS #7 type.
- //
- // ContentInfo ::= SEQUENCE {
- // contentType ::= ContentType,
- // content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
- //
- // ContentType ::= OBJECT IDENTIFIER
- //
- // SignedData ::= SEQUENCE {
- // version Version,
- // digestAlgorithms DigestAlgorithmIdentifiers,
- // contentInfo ContentInfo,
- // certificates [0] IMPLICIT ExtendedCertificatesAndCertificates
- // OPTIONAL,
- // crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
- // signerInfos SignerInfos }
- //
- // Version ::= INTEGER
- //
- DERValue value = der.read();
- if (!value.isConstructed())
- throw new DEREncodingException("malformed ContentInfo");
- value = der.read();
- if (!(value.getValue() instanceof OID) ||
- ((OID) value.getValue()).equals(PKCS7_SIGNED_DATA))
- throw new DEREncodingException("not a SignedData");
- value = der.read();
- if (!value.isConstructed() || value.getTag() != 0)
- throw new DEREncodingException("malformed content");
- value = der.read();
- if (value.getTag() != DER.INTEGER)
- throw new DEREncodingException("malformed Version");
- value = der.read();
- if (!value.isConstructed() || value.getTag() != DER.SET)
- throw new DEREncodingException("malformed DigestAlgorithmIdentifiers");
- der.skip(value.getLength());
- value = der.read();
- if (!value.isConstructed())
- throw new DEREncodingException("malformed ContentInfo");
- der.skip(value.getLength());
- path = der.read();
- if (!path.isConstructed() || path.getTag() != 0)
- throw new DEREncodingException("no certificates");
- }
- else
- throw new CertificateEncodingException("unknown encoding: " + encoding);
-
- LinkedList certs = new LinkedList();
- int len = 0;
- while (len < path.getLength())
- {
- DERValue cert = der.read();
- try
- {
- certs.add(new X509Certificate(new ByteArrayInputStream(cert.getEncoded())));
- }
- catch (CertificateException ce)
- {
- throw new CertificateEncodingException(ce.getMessage());
- }
- len += cert.getEncodedLength();
- der.skip(cert.getLength());
- }
-
- this.path = Collections.unmodifiableList(certs);
- }
-
- private byte[] encodePki()
- throws CertificateEncodingException, IOException
- {
- synchronized (path)
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- for (Iterator i = path.iterator(); i.hasNext(); )
- {
- out.write(((Certificate) i.next()).getEncoded());
- }
- byte[] b = out.toByteArray();
- DERValue val = new DERValue(DER.CONSTRUCTED | DER.SEQUENCE,
- b.length, b, null);
- return val.getEncoded();
- }
- }
-
- private byte[] encodePKCS()
- throws CertificateEncodingException, IOException
- {
- synchronized (path)
- {
- ArrayList signedData = new ArrayList(5);
- signedData.add(new DERValue(DER.INTEGER, BigInteger.ONE));
- signedData.add(new DERValue(DER.CONSTRUCTED | DER.SET,
- Collections.EMPTY_SET));
- signedData.add(new DERValue(DER.CONSTRUCTED | DER.SEQUENCE,
- Collections.singletonList(
- new DERValue(DER.OBJECT_IDENTIFIER, PKCS7_DATA))));
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- for (Iterator i = path.iterator(); i.hasNext(); )
- {
- out.write(((Certificate) i.next()).getEncoded());
- }
- byte[] b = out.toByteArray();
- signedData.add(new DERValue(DER.CONSTRUCTED | DER.CONTEXT,
- b.length, b, null));
- DERValue sdValue = new DERValue(DER.CONSTRUCTED | DER.SEQUENCE,
- signedData);
-
- ArrayList contentInfo = new ArrayList(2);
- contentInfo.add(new DERValue(DER.OBJECT_IDENTIFIER, PKCS7_SIGNED_DATA));
- contentInfo.add(new DERValue(DER.CONSTRUCTED | DER.CONTEXT, sdValue));
- return new DERValue(DER.CONSTRUCTED | DER.SEQUENCE,
- contentInfo).getEncoded();
- }
- }
-}
diff --git a/libjava/gnu/java/security/x509/X509CertSelectorImpl.java b/libjava/gnu/java/security/x509/X509CertSelectorImpl.java
deleted file mode 100644
index 36187ad8e64..00000000000
--- a/libjava/gnu/java/security/x509/X509CertSelectorImpl.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/* X509CertSelectorImpl.java -- implementation of an X509CertSelector.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509;
-
-import java.io.IOException;
-import java.security.Principal;
-import java.security.cert.CertSelector;
-import java.security.cert.Certificate;
-import java.security.cert.X509Certificate;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.security.auth.x500.X500Principal;
-
-/**
- * Sun's implementation of X509CertSelector sucks. This one tries to work
- * better.
- */
-public class X509CertSelectorImpl implements CertSelector
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private Set issuerNames;
- private Set subjectNames;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public X509CertSelectorImpl()
- {
- issuerNames = new HashSet();
- subjectNames = new HashSet();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public void addIssuerName(byte[] issuerName) throws IOException
- {
- issuerNames.add(new X500DistinguishedName(issuerName));
- }
-
- public void addIssuerName(String issuerName)
- {
- issuerNames.add(new X500DistinguishedName(issuerName));
- }
-
- public void addIssuerName(Principal issuerName) throws IOException
- {
- if (issuerName instanceof X500DistinguishedName)
- issuerNames.add(issuerName);
- else if (issuerName instanceof X500Principal)
- issuerNames.add(new X500DistinguishedName(((X500Principal) issuerName).getEncoded()));
- else
- issuerNames.add(new X500DistinguishedName(issuerName.getName()));
- }
-
- public Collection getIssuerNames()
- {
- return Collections.unmodifiableSet(issuerNames);
- }
-
- public void addSubjectName(byte[] subjectName) throws IOException
- {
- subjectNames.add(new X500DistinguishedName(subjectName));
- }
-
- public void addSubjectName(String subjectName) throws IOException
- {
- subjectNames.add(new X500DistinguishedName(subjectName));
- }
-
- public void addSubjectName(Principal subjectName) throws IOException
- {
- if (subjectName instanceof X500DistinguishedName)
- subjectNames.add(subjectName);
- else if (subjectName instanceof X500Principal)
- subjectNames.add(new X500DistinguishedName(((X500Principal) subjectName).getEncoded()));
- else
- subjectNames.add(new X500DistinguishedName(subjectName.getName()));
- }
-
- public Collection getSubjectNames()
- {
- return Collections.unmodifiableSet(subjectNames);
- }
-
- public Object clone()
- {
- X509CertSelectorImpl copy = new X509CertSelectorImpl();
- copy.issuerNames.addAll(issuerNames);
- copy.subjectNames.addAll(subjectNames);
- return copy;
- }
-
- public boolean match(Certificate cert)
- {
- if (!(cert instanceof X509Certificate))
- return false;
- boolean matchIssuer = false;
- boolean matchSubject = false;
- try
- {
- Principal p = ((X509Certificate) cert).getIssuerDN();
- X500DistinguishedName thisName = null;
- if (p instanceof X500DistinguishedName)
- thisName = (X500DistinguishedName) p;
- else if (p instanceof X500Principal)
- thisName = new X500DistinguishedName(((X500Principal) p).getEncoded());
- else
- thisName = new X500DistinguishedName(p.getName());
- if (issuerNames.isEmpty())
- matchIssuer = true;
- else
- {
- for (Iterator it = issuerNames.iterator(); it.hasNext(); )
- {
- X500DistinguishedName name = (X500DistinguishedName) it.next();
- if (thisName.equals(name))
- {
- matchIssuer = true;
- break;
- }
- }
- }
-
- p = ((X509Certificate) cert).getSubjectDN();
- thisName = null;
- if (p instanceof X500DistinguishedName)
- thisName = (X500DistinguishedName) p;
- else if (p instanceof X500Principal)
- thisName = new X500DistinguishedName(((X500Principal) p).getEncoded());
- else
- thisName = new X500DistinguishedName(p.getName());
- if (subjectNames.isEmpty())
- matchSubject = true;
- else
- {
- for (Iterator it = subjectNames.iterator(); it.hasNext(); )
- {
- X500DistinguishedName name = (X500DistinguishedName) it.next();
- if (thisName.equals(name))
- {
- matchSubject = true;
- break;
- }
- }
- }
- }
- catch (Exception x)
- {
- }
- return matchIssuer && matchSubject;
- }
-}
-
diff --git a/libjava/gnu/java/security/x509/X509Certificate.java b/libjava/gnu/java/security/x509/X509Certificate.java
deleted file mode 100644
index 94a02aa72c9..00000000000
--- a/libjava/gnu/java/security/x509/X509Certificate.java
+++ /dev/null
@@ -1,743 +0,0 @@
-/* X509Certificate.java -- X.509 certificate.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509;
-
-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;
-import gnu.java.security.x509.ext.BasicConstraints;
-import gnu.java.security.x509.ext.ExtendedKeyUsage;
-import gnu.java.security.x509.ext.Extension;
-import gnu.java.security.x509.ext.IssuerAlternativeNames;
-import gnu.java.security.x509.ext.KeyUsage;
-import gnu.java.security.x509.ext.SubjectAlternativeNames;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.math.BigInteger;
-import java.security.AlgorithmParameters;
-import java.security.InvalidKeyException;
-import java.security.KeyFactory;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Principal;
-import java.security.PublicKey;
-import java.security.Signature;
-import java.security.SignatureException;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateExpiredException;
-import java.security.cert.CertificateNotYetValidException;
-import java.security.cert.CertificateParsingException;
-import java.security.interfaces.DSAParams;
-import java.security.interfaces.DSAPublicKey;
-import java.security.spec.DSAParameterSpec;
-import java.security.spec.X509EncodedKeySpec;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.security.auth.x500.X500Principal;
-
-/**
- * An implementation of X.509 certificates.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class X509Certificate extends java.security.cert.X509Certificate
- implements Serializable, GnuPKIExtension
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- private static final boolean DEBUG = false;
- private static void debug(String msg)
- {
- if (DEBUG)
- {
- System.err.print(">> X509Certificate: ");
- System.err.println(msg);
- }
- }
- private static void debug(Throwable t)
- {
- if (DEBUG)
- {
- System.err.print(">> X509Certificate: ");
- t.printStackTrace();
- }
- }
-
- protected static final OID ID_DSA = new OID ("1.2.840.10040.4.1");
- protected static final OID ID_DSA_WITH_SHA1 = new OID ("1.2.840.10040.4.3");
- protected static final OID ID_RSA = new OID ("1.2.840.113549.1.1.1");
- protected static final OID ID_RSA_WITH_MD2 = new OID ("1.2.840.113549.1.1.2");
- protected static final OID ID_RSA_WITH_MD5 = new OID ("1.2.840.113549.1.1.4");
- protected static final OID ID_RSA_WITH_SHA1 = new OID ("1.2.840.113549.1.1.5");
- protected static final OID ID_ECDSA_WITH_SHA1 = new OID ("1.2.840.10045.4.1");
-
- // This object SHOULD be serialized with an instance of
- // java.security.cert.Certificate.CertificateRep, thus all fields are
- // transient.
-
- // The encoded certificate.
- protected transient byte[] encoded;
-
- // TBSCertificate part.
- protected transient byte[] tbsCertBytes;
- protected transient int version;
- protected transient BigInteger serialNo;
- protected transient OID algId;
- protected transient byte[] algVal;
- protected transient X500DistinguishedName issuer;
- protected transient Date notBefore;
- protected transient Date notAfter;
- protected transient X500DistinguishedName subject;
- protected transient PublicKey subjectKey;
- protected transient BitString issuerUniqueId;
- protected transient BitString subjectUniqueId;
- protected transient Map extensions;
-
- // Signature.
- protected transient OID sigAlgId;
- protected transient byte[] sigAlgVal;
- protected transient byte[] signature;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new X.509 certificate from the encoded data. The input
- * data are expected to be the ASN.1 DER encoding of the certificate.
- *
- * @param encoded The encoded certificate data.
- * @throws IOException If the certificate cannot be read, possibly
- * from a formatting error.
- * @throws CertificateException If the data read is not an X.509
- * certificate.
- */
- public X509Certificate(InputStream encoded)
- throws CertificateException, IOException
- {
- super();
- extensions = new HashMap();
- try
- {
- parse(encoded);
- }
- catch (IOException ioe)
- {
- debug(ioe);
- throw ioe;
- }
- catch (Exception e)
- {
- debug(e);
- CertificateException ce = new CertificateException(e.getMessage());
- ce.initCause (e);
- throw ce;
- }
- }
-
- protected X509Certificate()
- {
- extensions = new HashMap();
- }
-
- // X509Certificate methods.
- // ------------------------------------------------------------------------
-
- public void checkValidity()
- throws CertificateExpiredException, CertificateNotYetValidException
- {
- checkValidity(new Date());
- }
-
- public void checkValidity(Date date)
- throws CertificateExpiredException, CertificateNotYetValidException
- {
- if (date.compareTo(notBefore) < 0)
- {
- throw new CertificateNotYetValidException();
- }
- if (date.compareTo(notAfter) > 0)
- {
- throw new CertificateExpiredException();
- }
- }
-
- public int getVersion()
- {
- return version;
- }
-
- public BigInteger getSerialNumber()
- {
- return serialNo;
- }
-
- public Principal getIssuerDN()
- {
- return issuer;
- }
-
- public X500Principal getIssuerX500Principal()
- {
- return new X500Principal(issuer.getDer());
- }
-
- public Principal getSubjectDN()
- {
- return subject;
- }
-
- public X500Principal getSubjectX500Principal()
- {
- return new X500Principal(subject.getDer());
- }
-
- public Date getNotBefore()
- {
- return (Date) notBefore.clone();
- }
-
- public Date getNotAfter()
- {
- return (Date) notAfter.clone();
- }
-
- public byte[] getTBSCertificate() throws CertificateEncodingException
- {
- return (byte[]) tbsCertBytes.clone();
- }
-
- public byte[] getSignature()
- {
- return (byte[]) signature.clone();
- }
-
- public String getSigAlgName()
- {
- if (sigAlgId.equals(ID_DSA_WITH_SHA1))
- {
- return "SHA1withDSA";
- }
- if (sigAlgId.equals(ID_RSA_WITH_MD2))
- {
- return "MD2withRSA";
- }
- if (sigAlgId.equals(ID_RSA_WITH_MD5))
- {
- return "MD5withRSA";
- }
- if (sigAlgId.equals(ID_RSA_WITH_SHA1))
- {
- return "SHA1withRSA";
- }
- return "unknown";
- }
-
- public String getSigAlgOID()
- {
- return sigAlgId.toString();
- }
-
- public byte[] getSigAlgParams()
- {
- return (byte[]) sigAlgVal.clone();
- }
-
- public boolean[] getIssuerUniqueID()
- {
- if (issuerUniqueId != null)
- {
- return issuerUniqueId.toBooleanArray();
- }
- return null;
- }
-
- public boolean[] getSubjectUniqueID()
- {
- if (subjectUniqueId != null)
- {
- return subjectUniqueId.toBooleanArray();
- }
- return null;
- }
-
- public boolean[] getKeyUsage()
- {
- Extension e = getExtension(KeyUsage.ID);
- if (e != null)
- {
- KeyUsage ku = (KeyUsage) e.getValue();
- boolean[] result = new boolean[9];
- boolean[] b = ku.getKeyUsage().toBooleanArray();
- System.arraycopy(b, 0, result, 0, b.length);
- return result;
- }
- return null;
- }
-
- public List getExtendedKeyUsage() throws CertificateParsingException
- {
- Extension e = getExtension(ExtendedKeyUsage.ID);
- if (e != null)
- {
- List a = ((ExtendedKeyUsage) e.getValue()).getPurposeIds();
- List b = new ArrayList(a.size());
- for (Iterator it = a.iterator(); it.hasNext(); )
- {
- b.add(it.next().toString());
- }
- return Collections.unmodifiableList(b);
- }
- return null;
- }
-
- public int getBasicConstraints()
- {
- Extension e = getExtension(BasicConstraints.ID);
- if (e != null)
- {
- return ((BasicConstraints) e.getValue()).getPathLengthConstraint();
- }
- return -1;
- }
-
- public Collection getSubjectAlternativeNames()
- throws CertificateParsingException
- {
- Extension e = getExtension(SubjectAlternativeNames.ID);
- if (e != null)
- {
- return ((SubjectAlternativeNames) e.getValue()).getNames();
- }
- return null;
- }
-
- public Collection getIssuerAlternativeNames()
- throws CertificateParsingException
- {
- Extension e = getExtension(IssuerAlternativeNames.ID);
- if (e != null)
- {
- return ((IssuerAlternativeNames) e.getValue()).getNames();
- }
- return null;
- }
-
- // X509Extension methods.
- // ------------------------------------------------------------------------
-
- public boolean hasUnsupportedCriticalExtension()
- {
- for (Iterator it = extensions.values().iterator(); it.hasNext(); )
- {
- Extension e = (Extension) it.next();
- if (e.isCritical() && !e.isSupported())
- return true;
- }
- return false;
- }
-
- public Set getCriticalExtensionOIDs()
- {
- HashSet s = new HashSet();
- for (Iterator it = extensions.values().iterator(); it.hasNext(); )
- {
- Extension e = (Extension) it.next();
- if (e.isCritical())
- s.add(e.getOid().toString());
- }
- return Collections.unmodifiableSet(s);
- }
-
- public Set getNonCriticalExtensionOIDs()
- {
- HashSet s = new HashSet();
- for (Iterator it = extensions.values().iterator(); it.hasNext(); )
- {
- Extension e = (Extension) it.next();
- if (!e.isCritical())
- s.add(e.getOid().toString());
- }
- return Collections.unmodifiableSet(s);
- }
-
- public byte[] getExtensionValue(String oid)
- {
- Extension e = getExtension(new OID(oid));
- if (e != null)
- {
- return e.getValue().getEncoded();
- }
- return null;
- }
-
- // GnuPKIExtension method.
- // -------------------------------------------------------------------------
-
- public Extension getExtension(OID oid)
- {
- return (Extension) extensions.get(oid);
- }
-
- public Collection getExtensions()
- {
- return extensions.values();
- }
-
- // Certificate methods.
- // -------------------------------------------------------------------------
-
- public byte[] getEncoded() throws CertificateEncodingException
- {
- return (byte[]) encoded.clone();
- }
-
- public void verify(PublicKey key)
- throws CertificateException, NoSuchAlgorithmException,
- InvalidKeyException, NoSuchProviderException, SignatureException
- {
- Signature sig = Signature.getInstance(sigAlgId.toString());
- doVerify(sig, key);
- }
-
- public void verify(PublicKey key, String provider)
- throws CertificateException, NoSuchAlgorithmException,
- InvalidKeyException, NoSuchProviderException, SignatureException
- {
- Signature sig = Signature.getInstance(sigAlgId.toString(), provider);
- doVerify(sig, key);
- }
-
- public String toString()
- {
- StringWriter str = new StringWriter();
- PrintWriter out = new PrintWriter(str);
- out.println(X509Certificate.class.getName() + " {");
- out.println(" TBSCertificate {");
- out.println(" version = " + version + ";");
- out.println(" serialNo = " + serialNo + ";");
- out.println(" signature = {");
- out.println(" algorithm = " + getSigAlgName() + ";");
- out.print(" parameters =");
- if (sigAlgVal != null)
- {
- out.println();
- out.print(Util.hexDump(sigAlgVal, " "));
- }
- else
- {
- out.println(" null;");
- }
- out.println(" }");
- out.println(" issuer = " + issuer.getName() + ";");
- out.println(" validity = {");
- out.println(" notBefore = " + notBefore + ";");
- out.println(" notAfter = " + notAfter + ";");
- out.println(" }");
- out.println(" subject = " + subject.getName() + ";");
- out.println(" subjectPublicKeyInfo = {");
- out.println(" algorithm = " + subjectKey.getAlgorithm());
- out.println(" key =");
- out.print(Util.hexDump(subjectKey.getEncoded(), " "));
- out.println(" };");
- out.println(" issuerUniqueId = " + issuerUniqueId + ";");
- out.println(" subjectUniqueId = " + subjectUniqueId + ";");
- out.println(" extensions = {");
- for (Iterator it = extensions.values().iterator(); it.hasNext(); )
- {
- out.println(" " + it.next());
- }
- out.println(" }");
- out.println(" }");
- out.println(" signatureAlgorithm = " + getSigAlgName() + ";");
- out.println(" signatureValue =");
- out.print(Util.hexDump(signature, " "));
- out.println("}");
- return str.toString();
- }
-
- public PublicKey getPublicKey()
- {
- return subjectKey;
- }
-
- public boolean equals(Object other)
- {
- if (!(other instanceof X509Certificate))
- return false;
- try
- {
- if (other instanceof X509Certificate)
- return Arrays.equals(encoded, ((X509Certificate) other).encoded);
- byte[] enc = ((X509Certificate) other).getEncoded();
- if (enc == null)
- return false;
- return Arrays.equals(encoded, enc);
- }
- catch (CertificateEncodingException cee)
- {
- return false;
- }
- }
-
- // Own methods.
- // ------------------------------------------------------------------------
-
- /**
- * Verify this certificate's signature.
- */
- private void doVerify(Signature sig, PublicKey key)
- throws CertificateException, InvalidKeyException, SignatureException
- {
- debug("verifying sig=" + sig + " key=" + key);
- sig.initVerify(key);
- sig.update(tbsCertBytes);
- if (!sig.verify(signature))
- {
- throw new CertificateException("signature not validated");
- }
- }
-
- /**
- * Parse a DER stream into an X.509 certificate.
- *
- * @param encoded The encoded bytes.
- */
- private void parse(InputStream encoded) throws Exception
- {
- DERReader der = new DERReader(encoded);
-
- // Certificate ::= SEQUENCE {
- DERValue cert = der.read();
- debug("start Certificate len == " + cert.getLength());
-
- this.encoded = cert.getEncoded();
- if (!cert.isConstructed())
- {
- throw new IOException("malformed Certificate");
- }
-
- // TBSCertificate ::= SEQUENCE {
- DERValue tbsCert = der.read();
- if (tbsCert.getValue() != DER.CONSTRUCTED_VALUE)
- {
- throw new IOException("malformed TBSCertificate");
- }
- tbsCertBytes = tbsCert.getEncoded();
- debug("start TBSCertificate len == " + tbsCert.getLength());
-
- // Version ::= INTEGER [0] { v1(0), v2(1), v3(2) }
- DERValue val = der.read();
- if (val.getTagClass() == DER.CONTEXT && val.getTag() == 0)
- {
- version = ((BigInteger) der.read().getValue()).intValue() + 1;
- val = der.read();
- }
- else
- {
- version = 1;
- }
- debug("read version == " + version);
-
- // SerialNumber ::= INTEGER
- serialNo = (BigInteger) val.getValue();
- debug("read serial number == " + serialNo);
-
- // AlgorithmIdentifier ::= SEQUENCE {
- val = der.read();
- if (!val.isConstructed())
- {
- throw new IOException("malformed AlgorithmIdentifier");
- }
- int certAlgLen = val.getLength();
- debug("start AlgorithmIdentifier len == " + certAlgLen);
- val = der.read();
-
- // algorithm OBJECT IDENTIFIER,
- algId = (OID) val.getValue();
- debug("read algorithm ID == " + algId);
-
- // parameters ANY DEFINED BY algorithm OPTIONAL }
- if (certAlgLen > val.getEncodedLength())
- {
- val = der.read();
- if (val == null)
- {
- algVal = null;
- }
- else
- {
- algVal = val.getEncoded();
-
- if (val.isConstructed())
- encoded.skip(val.getLength());
- }
- debug("read algorithm parameters == " + algVal);
- }
-
- // issuer Name,
- val = der.read();
- issuer = new X500DistinguishedName(val.getEncoded());
- der.skip(val.getLength());
- debug("read issuer == " + issuer);
-
- // Validity ::= SEQUENCE {
- // notBefore Time,
- // notAfter Time }
- if (!der.read().isConstructed())
- {
- throw new IOException("malformed Validity");
- }
- notBefore = (Date) der.read().getValue();
- notAfter = (Date) der.read().getValue();
- debug("read notBefore == " + notBefore);
- debug("read notAfter == " + notAfter);
-
- // subject Name,
- val = der.read();
- subject = new X500DistinguishedName(val.getEncoded());
- der.skip(val.getLength());
- debug("read subject == " + subject);
-
- // SubjectPublicKeyInfo ::= SEQUENCE {
- // algorithm AlgorithmIdentifier,
- // subjectPublicKey BIT STRING }
- DERValue spki = der.read();
- if (!spki.isConstructed())
- {
- throw new IOException("malformed SubjectPublicKeyInfo");
- }
- KeyFactory spkFac = KeyFactory.getInstance("X.509");
- subjectKey = spkFac.generatePublic(new X509EncodedKeySpec(spki.getEncoded()));
- der.skip(spki.getLength());
- debug("read subjectPublicKey == " + subjectKey);
-
- if (version > 1)
- {
- val = der.read();
- }
- if (version >= 2 && val.getTagClass() != DER.UNIVERSAL && val.getTag() == 1)
- {
- byte[] b = (byte[]) val.getValue();
- issuerUniqueId = new BitString(b, 1, b.length-1, b[0] & 0xFF);
- debug("read issuerUniqueId == " + issuerUniqueId);
- val = der.read();
- }
- if (version >= 2 && val.getTagClass() != DER.UNIVERSAL && val.getTag() == 2)
- {
- byte[] b = (byte[]) val.getValue();
- subjectUniqueId = new BitString(b, 1, b.length-1, b[0] & 0xFF);
- debug("read subjectUniqueId == " + subjectUniqueId);
- val = der.read();
- }
- if (version >= 3 && val.getTagClass() != DER.UNIVERSAL && val.getTag() == 3)
- {
- val = der.read();
- debug("start Extensions len == " + val.getLength());
- int len = 0;
- while (len < val.getLength())
- {
- DERValue ext = der.read();
- debug("start extension len == " + ext.getLength());
- Extension e = new Extension(ext.getEncoded());
- extensions.put(e.getOid(), e);
- der.skip(ext.getLength());
- len += ext.getEncodedLength();
- debug("count == " + len);
- }
- }
-
- val = der.read();
- if (!val.isConstructed())
- {
- throw new IOException("malformed AlgorithmIdentifier");
- }
- int sigAlgLen = val.getLength();
- debug("start AlgorithmIdentifier len == " + sigAlgLen);
- val = der.read();
- sigAlgId = (OID) val.getValue();
- debug("read algorithm id == " + sigAlgId);
- if (sigAlgLen > val.getEncodedLength())
- {
- val = der.read();
- if (val.getValue() == null)
- {
- if (subjectKey instanceof DSAPublicKey)
- {
- AlgorithmParameters params =
- AlgorithmParameters.getInstance("DSA");
- DSAParams dsap = ((DSAPublicKey) subjectKey).getParams();
- DSAParameterSpec spec =
- new DSAParameterSpec(dsap.getP(), dsap.getQ(), dsap.getG());
- params.init(spec);
- sigAlgVal = params.getEncoded();
- }
- }
- else
- {
- sigAlgVal = (byte[]) val.getEncoded();
- }
- if (val.isConstructed())
- {
- encoded.skip(val.getLength());
- }
- debug("read parameters == " + sigAlgVal);
- }
- signature = ((BitString) der.read().getValue()).toByteArray();
- debug("read signature ==\n" + Util.hexDump(signature, ">>>> "));
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java b/libjava/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java
deleted file mode 100644
index a94b76f093e..00000000000
--- a/libjava/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* AuthorityKeyIdentifier.java -- Authority key identifier extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-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;
-
-import java.io.IOException;
-import java.math.BigInteger;
-
-public class AuthorityKeyIdentifier extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.35");
-
- private final byte[] keyIdentifier;
- private final GeneralNames authorityCertIssuer;
- private final BigInteger authorityCertSerialNumber;
-
- // Contstructor.
- // -------------------------------------------------------------------------
-
- public AuthorityKeyIdentifier(final byte[] encoded) throws IOException
- {
- super(encoded);
- DERReader der = new DERReader(encoded);
-
- // AuthorityKeyIdentifier ::= SEQUENCE {
- DERValue val = der.read();
- if (!val.isConstructed())
- throw new IOException("malformed AuthorityKeyIdentifier");
- if (val.getLength() > 0)
- val = der.read();
-
- // keyIdentifier [0] KeyIdentifier OPTIONAL,
- // KeyIdentifier ::= OCTET STRING
- if (val.getTagClass() == DER.APPLICATION && val.getTag() == 0)
- {
- keyIdentifier = (byte[]) val.getValue();
- val = der.read();
- }
- else
- keyIdentifier = null;
-
- // authorityCertIssuer [1] GeneralNames OPTIONAL,
- if (val.getTagClass() == DER.APPLICATION && val.getTag() == 1)
- {
- byte[] b = val.getEncoded();
- b[0] = (byte) (DER.CONSTRUCTED|DER.SEQUENCE);
- authorityCertIssuer = new GeneralNames(b);
- der.skip(val.getLength());
- val = der.read();
- }
- else
- authorityCertIssuer = null;
-
- // authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL }
- if (val.getTagClass() == DER.APPLICATION && val.getTag() == 2)
- {
- authorityCertSerialNumber = new BigInteger((byte[]) val.getValue());
- }
- else
- authorityCertSerialNumber = null;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public byte[] getKeyIdentifier()
- {
- return keyIdentifier != null ? (byte[]) keyIdentifier.clone() : null;
- }
-
- public GeneralNames getAuthorityCertIssuer()
- {
- return authorityCertIssuer;
- }
-
- public BigInteger getAuthorityCertSerialNumber()
- {
- return authorityCertSerialNumber;
- }
-
- public String toString()
- {
- return AuthorityKeyIdentifier.class.getName() + " [ keyId=" +
- (keyIdentifier != null ? Util.toHexString (keyIdentifier, ':') : "nil") +
- " authorityCertIssuer=" + authorityCertIssuer +
- " authorityCertSerialNumbe=" + authorityCertSerialNumber + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/BasicConstraints.java b/libjava/gnu/java/security/x509/ext/BasicConstraints.java
deleted file mode 100644
index 00f7a6ed220..00000000000
--- a/libjava/gnu/java/security/x509/ext/BasicConstraints.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/* BasicConstraints.java -- the basic constraints extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.IOException;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-
-public class BasicConstraints extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.19");
-
- private final boolean ca;
- private final int pathLenConstraint;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public BasicConstraints(final byte[] encoded) throws IOException
- {
- super(encoded);
- DERReader der = new DERReader(encoded);
- DERValue bc = der.read();
- if (!bc.isConstructed())
- throw new IOException("malformed BasicConstraints");
- DERValue val = bc;
- if (bc.getLength() > 0)
- val = der.read();
- if (val.getTag() == DER.BOOLEAN)
- {
- ca = ((Boolean) val.getValue()).booleanValue();
- if (val.getEncodedLength() < bc.getLength())
- val = der.read();
- }
- else
- ca = false;
- if (val.getTag() == DER.INTEGER)
- {
- pathLenConstraint = ((BigInteger) val.getValue()).intValue();
- }
- else
- pathLenConstraint = -1;
- }
-
- public BasicConstraints (final boolean ca, final int pathLenConstraint)
- {
- this.ca = ca;
- this.pathLenConstraint = pathLenConstraint;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public boolean isCA()
- {
- return ca;
- }
-
- public int getPathLengthConstraint()
- {
- return pathLenConstraint;
- }
-
- public byte[] getEncoded()
- {
- if (encoded == null)
- {
- List bc = new ArrayList (2);
- bc.add (new DERValue (DER.BOOLEAN, new Boolean (ca)));
- if (pathLenConstraint >= 0)
- bc.add (new DERValue (DER.INTEGER,
- BigInteger.valueOf ((long) pathLenConstraint)));
- encoded = new DERValue (DER.CONSTRUCTED|DER.SEQUENCE, bc).getEncoded();
- }
- return (byte[]) encoded.clone();
- }
-
- public String toString()
- {
- return BasicConstraints.class.getName() + " [ isCA=" + ca +
- " pathLen=" + pathLenConstraint + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/CRLNumber.java b/libjava/gnu/java/security/x509/ext/CRLNumber.java
deleted file mode 100644
index 36b1c7b5f1d..00000000000
--- a/libjava/gnu/java/security/x509/ext/CRLNumber.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* CRLNumber.java -- CRL number extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.IOException;
-import java.math.BigInteger;
-
-public class CRLNumber extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.20");
-
- private final BigInteger number;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public CRLNumber(final byte[] encoded) throws IOException
- {
- super(encoded);
- DERValue val = DERReader.read(encoded);
- if (val.getTag() != DER.INTEGER)
- throw new IOException("malformed CRLNumber");
- number = (BigInteger) val.getValue();
- }
-
- public CRLNumber (final BigInteger number)
- {
- this.number = number;
- }
-
- // Instance method.
- // -------------------------------------------------------------------------
-
- public BigInteger getNumber()
- {
- return number;
- }
-
- public byte[] getEncoded()
- {
- if (encoded == null)
- {
- encoded = new DERValue (DER.INTEGER, number).getEncoded();
- }
- return (byte[]) encoded.clone();
- }
-
- public String toString()
- {
- return CRLNumber.class.getName() + " [ " + number + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/CertificatePolicies.java b/libjava/gnu/java/security/x509/ext/CertificatePolicies.java
deleted file mode 100644
index 50bc6d367d7..00000000000
--- a/libjava/gnu/java/security/x509/ext/CertificatePolicies.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* CertificatePolicies.java -- certificate policy extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.IOException;
-import java.security.cert.PolicyQualifierInfo;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-public class CertificatePolicies extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.32");
-
- private final List policies;
- private final Map policyQualifierInfos;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public CertificatePolicies(final byte[] encoded) throws IOException
- {
- super(encoded);
- DERReader der = new DERReader(encoded);
- DERValue pol = der.read();
- if (!pol.isConstructed())
- throw new IOException("malformed CertificatePolicies");
-
- int len = 0;
- LinkedList policyList = new LinkedList();
- HashMap qualifierMap = new HashMap();
- while (len < pol.getLength())
- {
- DERValue policyInfo = der.read();
- if (!policyInfo.isConstructed())
- throw new IOException("malformed PolicyInformation");
- DERValue val = der.read();
- if (val.getTag() != DER.OBJECT_IDENTIFIER)
- throw new IOException("malformed CertPolicyId");
- OID policyId = (OID) val.getValue();
- policyList.add(policyId);
- if (val.getEncodedLength() < policyInfo.getLength())
- {
- DERValue qual = der.read();
- int len2 = 0;
- LinkedList quals = new LinkedList();
- while (len2 < qual.getLength())
- {
- val = der.read();
- quals.add(new PolicyQualifierInfo(val.getEncoded()));
- der.skip(val.getLength());
- len2 += val.getEncodedLength();
- }
- qualifierMap.put(policyId, quals);
- }
- len += policyInfo.getEncodedLength();
- }
-
- policies = Collections.unmodifiableList(policyList);
- policyQualifierInfos = Collections.unmodifiableMap(qualifierMap);
- }
-
- public CertificatePolicies (final List policies,
- final Map policyQualifierInfos)
- {
- for (Iterator it = policies.iterator(); it.hasNext(); )
- if (!(it.next() instanceof OID))
- throw new IllegalArgumentException ("policies must be OIDs");
- for (Iterator it = policyQualifierInfos.entrySet().iterator(); it.hasNext();)
- {
- Map.Entry e = (Map.Entry) it.next();
- if (!(e.getKey() instanceof OID) || !policies.contains (e.getKey()))
- throw new IllegalArgumentException
- ("policyQualifierInfos keys must be OIDs");
- if (!(e.getValue() instanceof List))
- throw new IllegalArgumentException
- ("policyQualifierInfos values must be Lists of PolicyQualifierInfos");
- for (Iterator it2 = ((List) e.getValue()).iterator(); it.hasNext(); )
- if (!(it2.next() instanceof PolicyQualifierInfo))
- throw new IllegalArgumentException
- ("policyQualifierInfos values must be Lists of PolicyQualifierInfos");
- }
- this.policies = Collections.unmodifiableList (new ArrayList (policies));
- this.policyQualifierInfos = Collections.unmodifiableMap
- (new HashMap (policyQualifierInfos));
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public List getPolicies()
- {
- return policies;
- }
-
- public List getPolicyQualifierInfos(OID oid)
- {
- return (List) policyQualifierInfos.get(oid);
- }
-
- public byte[] getEncoded()
- {
- if (encoded == null)
- {
- List pol = new ArrayList (policies.size());
- for (Iterator it = policies.iterator(); it.hasNext(); )
- {
- OID policy = (OID) it.next();
- List qualifiers = getPolicyQualifierInfos (policy);
- List l = new ArrayList (qualifiers == null ? 1 : 2);
- l.add (new DERValue (DER.OBJECT_IDENTIFIER, policy));
- if (qualifiers != null)
- {
- List ll = new ArrayList (qualifiers.size());
- for (Iterator it2 = qualifiers.iterator(); it.hasNext(); )
- {
- PolicyQualifierInfo info = (PolicyQualifierInfo) it2.next();
- try
- {
- ll.add (DERReader.read (info.getEncoded()));
- }
- catch (IOException ioe)
- {
- }
- }
- l.add (new DERValue (DER.CONSTRUCTED|DER.SEQUENCE, ll));
- }
- pol.add (new DERValue (DER.CONSTRUCTED|DER.SEQUENCE, l));
- }
- encoded = new DERValue (DER.CONSTRUCTED|DER.SEQUENCE, pol).getEncoded();
- }
- return (byte[]) encoded.clone();
- }
-
- public String toString()
- {
- return CertificatePolicies.class.getName() + " [ policies=" + policies +
- " policyQualifierInfos=" + policyQualifierInfos + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/ExtendedKeyUsage.java b/libjava/gnu/java/security/x509/ext/ExtendedKeyUsage.java
deleted file mode 100644
index 37b08acf43e..00000000000
--- a/libjava/gnu/java/security/x509/ext/ExtendedKeyUsage.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* ExtendedKeyUsage.java -- the extended key usage extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-public class ExtendedKeyUsage extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.37");
-
- private final List purposeIds;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public ExtendedKeyUsage(final byte[] encoded) throws IOException
- {
- super(encoded);
- DERReader der = new DERReader(encoded);
- DERValue usageList = der.read();
- if (!usageList.isConstructed())
- throw new IOException("malformed ExtKeyUsageSyntax");
- int len = 0;
- purposeIds = new LinkedList();
- while (len < usageList.getLength())
- {
- DERValue val = der.read();
- if (val.getTag() != DER.OBJECT_IDENTIFIER)
- throw new IOException("malformed KeyPurposeId");
- purposeIds.add(val.getValue());
- len += val.getEncodedLength();
- }
- }
-
- // Instance method.
- // -------------------------------------------------------------------------
-
- public List getPurposeIds()
- {
- return Collections.unmodifiableList(purposeIds);
- }
-
- public String toString()
- {
- return ExtendedKeyUsage.class.getName() + " [ " + purposeIds + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/Extension.java b/libjava/gnu/java/security/x509/ext/Extension.java
deleted file mode 100644
index 5ca9ac3a91d..00000000000
--- a/libjava/gnu/java/security/x509/ext/Extension.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/* Extension.java -- an X.509 certificate or CRL extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-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;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-public class Extension
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private static final boolean DEBUG = false;
- private static void debug(String msg)
- {
- System.err.print(">> Extension: ");
- System.err.println(msg);
- }
-
- /**
- * This extension's object identifier.
- */
- protected final OID oid;
-
- /**
- * The criticality flag.
- */
- protected final boolean critical;
-
- /**
- * Whether or not this extension is locally supported.
- */
- protected boolean isSupported;
-
- /**
- * The extension value.
- */
- protected final Value value;
-
- /**
- * The DER encoded form.
- */
- protected byte[] encoded;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public Extension(byte[] encoded) throws IOException
- {
- this.encoded = (byte[]) encoded.clone();
- DERReader der = new DERReader(encoded);
-
- // Extension ::= SEQUENCE {
- DERValue val = der.read();
- if (DEBUG) debug("read val tag == " + val.getTag() + " len == " + val.getLength());
- if (!val.isConstructed())
- throw new IOException("malformed Extension");
-
- // extnID OBJECT IDENTIFIER,
- val = der.read();
- if (val.getTag() != DER.OBJECT_IDENTIFIER)
- throw new IOException("expecting OBJECT IDENTIFIER");
- oid = (OID) val.getValue();
- if (DEBUG) debug("read oid == " + oid);
-
- // critical BOOLEAN DEFAULT FALSE,
- val = der.read();
- if (val.getTag() == DER.BOOLEAN)
- {
- critical = ((Boolean) val.getValue()).booleanValue();
- val = der.read();
- }
- else
- critical = false;
- if (DEBUG) debug("is critical == " + critical);
-
- // extnValue OCTET STRING }
- if (val.getTag() != DER.OCTET_STRING)
- throw new IOException("expecting OCTET STRING");
- byte[] encval = (byte[]) val.getValue();
- isSupported = true;
- if (oid.equals(AuthorityKeyIdentifier.ID))
- {
- value = new AuthorityKeyIdentifier(encval);
- }
- else if (oid.equals(SubjectKeyIdentifier.ID))
- {
- value = new SubjectKeyIdentifier(encval);
- }
- else if (oid.equals(KeyUsage.ID))
- {
- value = new KeyUsage(encval);
- }
- else if (oid.equals(PrivateKeyUsagePeriod.ID))
- {
- value = new PrivateKeyUsagePeriod(encval);
- }
- else if (oid.equals(CertificatePolicies.ID))
- {
- value = new CertificatePolicies(encval);
- }
- else if (oid.equals (PolicyConstraint.ID))
- {
- value = new PolicyConstraint (encval);
- }
- else if (oid.equals(PolicyMappings.ID))
- {
- value = new PolicyMappings(encval);
- }
- else if (oid.equals(SubjectAlternativeNames.ID))
- {
- value = new SubjectAlternativeNames(encval);
- }
- else if (oid.equals(IssuerAlternativeNames.ID))
- {
- value = new IssuerAlternativeNames(encval);
- }
- else if (oid.equals(BasicConstraints.ID))
- {
- value = new BasicConstraints(encval);
- }
- else if (oid.equals(ExtendedKeyUsage.ID))
- {
- value = new ExtendedKeyUsage(encval);
- }
- else if (oid.equals(CRLNumber.ID))
- {
- value = new CRLNumber(encval);
- }
- else if (oid.equals(ReasonCode.ID))
- {
- value = new ReasonCode(encval);
- }
- else
- {
- value = new Value(encval);
- isSupported = false;
- }
- if (DEBUG) debug("read value == " + value);
- }
-
- public Extension (final OID oid, final Value value, final boolean critical)
- {
- this.oid = oid;
- this.value = value;
- this.critical = critical;
- isSupported = true;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public OID getOid()
- {
- return oid;
- }
-
- public boolean isCritical()
- {
- return critical;
- }
-
- public boolean isSupported()
- {
- return isSupported;
- }
-
- public Value getValue()
- {
- return value;
- }
-
- public byte[] getEncoded()
- {
- if (encoded == null)
- encode();
- return (byte[]) encoded.clone();
- }
-
- public String toString()
- {
- return Extension.class.getName() + " [ id=" + oid + " critical=" +
- critical + " value=" + value + " ]";
- }
-
- public DERValue getDerValue()
- {
- List ext = new ArrayList (3);
- ext.add (new DERValue (DER.OBJECT_IDENTIFIER, oid));
- ext.add (new DERValue (DER.BOOLEAN, new Boolean (critical)));
- ext.add (new DERValue (DER.OCTET_STRING, value.getEncoded()));
- return new DERValue (DER.CONSTRUCTED|DER.SEQUENCE, ext);
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private void encode()
- {
- encoded = getDerValue().getEncoded();
- }
-
- // Inner class.
- // -------------------------------------------------------------------------
-
- public static class Value
- {
-
- // Fields.
- // -----------------------------------------------------------------------
-
- protected byte[] encoded;
-
- // Constructor.
- // -----------------------------------------------------------------------
-
- public Value(byte[] encoded)
- {
- this.encoded = (byte[]) encoded.clone();
- }
-
- protected Value() { }
-
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public byte[] getEncoded()
- {
- return (byte[]) encoded;
- }
-
- public boolean equals(Object o)
- {
- if (!(o instanceof Value))
- return false;
- return Arrays.equals(encoded, ((Value) o).encoded);
- }
-
- public String toString()
- {
- return Util.toHexString(encoded, ':');
- }
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/GeneralNames.java b/libjava/gnu/java/security/x509/ext/GeneralNames.java
deleted file mode 100644
index e92aedaefd0..00000000000
--- a/libjava/gnu/java/security/x509/ext/GeneralNames.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/* GeneralNames.java -- the GeneralNames object
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-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.X500DistinguishedName;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-public class GeneralNames
-{
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public static final int OTHER_NAME = 0;
- public static final int RFC822_NAME = 1;
- public static final int DNS_NAME = 2;
- public static final int X400_ADDRESS = 3;
- public static final int DIRECTORY_NAME = 4;
- public static final int EDI_PARTY_NAME = 5;
- public static final int URI = 6;
- public static final int IP_ADDRESS = 7;
- public static final int REGISTERED_ID = 8;
-
- private List names;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public GeneralNames(final byte[] encoded) throws IOException
- {
- names = new LinkedList();
- DERReader der = new DERReader(encoded);
- DERValue nameList = der.read();
- if (!nameList.isConstructed())
- throw new IOException("malformed GeneralNames");
- int len = 0;
- while (len < nameList.getLength())
- {
- DERValue name = der.read();
- List namePair = new ArrayList(2);
- if (name.getTagClass() != DER.APPLICATION)
- throw new IOException("malformed GeneralName");
- namePair.add(new Integer(name.getTag()));
- DERValue val = null;
- switch (name.getTag())
- {
- case RFC822_NAME:
- case DNS_NAME:
- case X400_ADDRESS:
- case URI:
- namePair.add(new String((byte[]) name.getValue()));
- break;
-
- case OTHER_NAME:
- case EDI_PARTY_NAME:
- namePair.add(name.getValue());
- break;
-
- case DIRECTORY_NAME:
- byte[] b = name.getEncoded();
- b[0] = (byte) (DER.CONSTRUCTED|DER.SEQUENCE);
- namePair.add(new X500DistinguishedName(b).toString());
- break;
-
- case IP_ADDRESS:
- namePair.add(InetAddress.getByAddress((byte[]) name.getValue())
- .getHostAddress());
- break;
-
- case REGISTERED_ID:
- byte[] bb = name.getEncoded();
- bb[0] = (byte) DER.OBJECT_IDENTIFIER;
- namePair.add(new OID(bb).toString());
- break;
-
- default:
- throw new IOException("unknown tag " + name.getTag());
- }
- names.add(namePair);
- len += name.getEncodedLength();
- }
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public List getNames()
- {
- List l = new ArrayList(names.size());
- for (Iterator it = names.iterator(); it.hasNext(); )
- {
- List ll = (List) it.next();
- List pair = new ArrayList(2);
- pair.add(ll.get(0));
- if (ll.get(1) instanceof byte[])
- pair.add(((byte[]) ll.get(1)).clone());
- else
- pair.add(ll.get(1));
- l.add(Collections.unmodifiableList(pair));
- }
- return Collections.unmodifiableList(l);
- }
-
- public String toString()
- {
- return GeneralNames.class.getName() + " [ " + names + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/IssuerAlternativeNames.java b/libjava/gnu/java/security/x509/ext/IssuerAlternativeNames.java
deleted file mode 100644
index 8b017dc62d8..00000000000
--- a/libjava/gnu/java/security/x509/ext/IssuerAlternativeNames.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* IssuerAlternatuveNames.java -- issuer alternative names extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-import gnu.java.security.OID;
-
-import java.io.IOException;
-import java.util.List;
-
-public class IssuerAlternativeNames extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.18");
-
- private final GeneralNames names;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public IssuerAlternativeNames(final byte[] encoded) throws IOException
- {
- super(encoded);
- names = new GeneralNames(encoded);
- }
-
- // Instance method.
- // -------------------------------------------------------------------------
-
- public List getNames()
- {
- return names.getNames();
- }
-
- public String toString()
- {
- return IssuerAlternativeNames.class.getName() + " [ " + names + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/KeyUsage.java b/libjava/gnu/java/security/x509/ext/KeyUsage.java
deleted file mode 100644
index dcd98181e12..00000000000
--- a/libjava/gnu/java/security/x509/ext/KeyUsage.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* KeyUsage.java -- the key usage extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-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;
-
-import java.io.IOException;
-
-public class KeyUsage extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.15");
- public static final int DIGITAL_SIGNATURE = 0;
- public static final int NON_REPUDIATION = 1;
- public static final int KEY_ENCIPHERMENT = 2;
- public static final int DATA_ENCIPHERMENT = 3;
- public static final int KEY_AGREEMENT = 4;
- public static final int KEY_CERT_SIGN = 5;
- public static final int CRL_SIGN = 6;
- public static final int ENCIPHER_ONLY = 7;
- public static final int DECIPHER_ONLY = 8;
-
- private final BitString keyUsage;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public KeyUsage(final byte[] encoded) throws IOException
- {
- super(encoded);
- DERValue val = DERReader.read(encoded);
- if (val.getTag() != DER.BIT_STRING)
- throw new IOException("malformed KeyUsage");
- keyUsage = (BitString) val.getValue();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public BitString getKeyUsage()
- {
- return keyUsage;
- }
-
- public String toString()
- {
- return KeyUsage.class.getName() + " [ " + keyUsage + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/PolicyConstraint.java b/libjava/gnu/java/security/x509/ext/PolicyConstraint.java
deleted file mode 100644
index 20cf552a0fe..00000000000
--- a/libjava/gnu/java/security/x509/ext/PolicyConstraint.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* PolicyConstraint.java -- policyConstraint extension
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.IOException;
-import java.math.BigInteger;
-
-public class PolicyConstraint extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID ("2.5.29.36");
-
- private final int requireExplicitPolicy;
- private final int inhibitPolicyMapping;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public PolicyConstraint (final byte[] encoded) throws IOException
- {
- super (encoded);
- int rpc = -1, ipm = -1;
- DERReader der = new DERReader(encoded);
- DERValue pc = der.read();
- if (!pc.isConstructed())
- throw new IOException("malformed PolicyConstraints");
- DERValue val;
- int len = pc.getLength();
- while (len > 0)
- {
- val = der.read();
- if (val.getTag() == 0)
- rpc = new BigInteger ((byte[]) val.getValue()).intValue();
- else if (val.getTag() == 1)
- ipm = new BigInteger ((byte[]) val.getValue()).intValue();
- else
- throw new IOException ("invalid policy constraint");
- len -= val.getEncodedLength();
- }
-
- requireExplicitPolicy = rpc;
- inhibitPolicyMapping = ipm;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public int getRequireExplicitPolicy()
- {
- return requireExplicitPolicy;
- }
-
- public int getInhibitPolicyMapping()
- {
- return inhibitPolicyMapping;
- }
-
- public String toString()
- {
- return PolicyConstraint.class.getName() + " [ requireExplicitPolicy=" +
- requireExplicitPolicy + " inhibitPolicyMapping=" + inhibitPolicyMapping
- + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/PolicyMappings.java b/libjava/gnu/java/security/x509/ext/PolicyMappings.java
deleted file mode 100644
index 0493ed89dd4..00000000000
--- a/libjava/gnu/java/security/x509/ext/PolicyMappings.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* PolicyMappings.java -- policy mappings extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-public class PolicyMappings extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.33");
-
- private final Map mappings;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public PolicyMappings(final byte[] encoded) throws IOException
- {
- super(encoded);
- DERReader der = new DERReader(encoded);
- DERValue maps = der.read();
- if (!maps.isConstructed())
- throw new IOException("malformed PolicyMappings");
- int len = 0;
- HashMap _mappings = new HashMap();
- while (len < maps.getLength())
- {
- DERValue map = der.read();
- if (!map.isConstructed())
- throw new IOException("malformed PolicyMapping");
- DERValue val = der.read();
- if (val.getTag() != DER.OBJECT_IDENTIFIER)
- throw new IOException("malformed PolicyMapping");
- OID issuerPolicy = (OID) val.getValue();
- val = der.read();
- if (val.getTag() != DER.OBJECT_IDENTIFIER)
- throw new IOException("malformed PolicyMapping");
- OID subjectPolicy = (OID) val.getValue();
- _mappings.put(issuerPolicy, subjectPolicy);
- len += map.getEncodedLength();
- }
- mappings = Collections.unmodifiableMap(_mappings);
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public OID getSubjectDomainPolicy(OID issuerDomainPolicy)
- {
- return (OID) mappings.get(issuerDomainPolicy);
- }
-
- public String toString()
- {
- return PolicyMappings.class.getName() + " [ " + mappings + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java b/libjava/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java
deleted file mode 100644
index 3b531c05517..00000000000
--- a/libjava/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/* PrivateKeyUsagePeriod.java -- private key usage period extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.IOException;
-import java.util.Date;
-
-public class PrivateKeyUsagePeriod extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.16");
-
- private final Date notBefore;
- private final Date notAfter;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public PrivateKeyUsagePeriod(final byte[] encoded) throws IOException
- {
- super(encoded);
- DERReader der = new DERReader(encoded);
- DERValue val = der.read();
- if (!val.isConstructed())
- throw new IOException("malformed PrivateKeyUsagePeriod");
- if (val.getLength() > 0)
- val = der.read();
- if (val.getTagClass() == DER.APPLICATION || val.getTag() == 0)
- {
- notBefore = (Date) val.getValueAs (DER.GENERALIZED_TIME);
- val = der.read();
- }
- else
- notBefore = null;
- if (val.getTagClass() == DER.APPLICATION || val.getTag() == 1)
- {
- notAfter = (Date) val.getValueAs (DER.GENERALIZED_TIME);
- }
- else
- notAfter = null;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public Date getNotBefore()
- {
- return notBefore != null ? (Date) notBefore.clone() : null;
- }
-
- public Date getNotAfter()
- {
- return notAfter != null ? (Date) notAfter.clone() : null;
- }
-
- public String toString()
- {
- return PrivateKeyUsagePeriod.class.getName() + " [ notBefore=" + notBefore
- + " notAfter=" + notAfter + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/ReasonCode.java b/libjava/gnu/java/security/x509/ext/ReasonCode.java
deleted file mode 100644
index a6d59e43ae8..00000000000
--- a/libjava/gnu/java/security/x509/ext/ReasonCode.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ReasonCode.java -- a reason code for a certificate revocation.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.IOException;
-import java.math.BigInteger;
-
-public class ReasonCode extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.21");
-
- public final int reason;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public ReasonCode(final byte[] encoded) throws IOException
- {
- super(encoded);
- DERValue val = DERReader.read(encoded);
- if (val.getTag() != DER.ENUMERATED)
- throw new IOException("malformed CRLReason");
- reason = ((BigInteger) val.getValue()).intValue();
- if (reason < 0 || reason == 7 || reason > 10)
- throw new IOException("illegal reason: " + reason);
- }
-
- // Instance method.
- // -------------------------------------------------------------------------
-
- public int getReasonCode()
- {
- return reason;
- }
-
- public String toString()
- {
- return ReasonCode.class.getName() + " [ " + reason + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/SubjectAlternativeNames.java b/libjava/gnu/java/security/x509/ext/SubjectAlternativeNames.java
deleted file mode 100644
index f88e854965f..00000000000
--- a/libjava/gnu/java/security/x509/ext/SubjectAlternativeNames.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* SubjectAlternatuveNames.java -- subject alternative names extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-import gnu.java.security.OID;
-
-import java.io.IOException;
-import java.util.List;
-
-public class SubjectAlternativeNames extends Extension.Value
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.17");
-
- private final GeneralNames names;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public SubjectAlternativeNames(final byte[] encoded) throws IOException
- {
- super(encoded);
- names = new GeneralNames(encoded);
- }
-
- // Instance method.
- // -------------------------------------------------------------------------
-
- public List getNames()
- {
- return names.getNames();
- }
-
- public String toString()
- {
- return SubjectAlternativeNames.class.getName() + " [ " + names + " ]";
- }
-}
diff --git a/libjava/gnu/java/security/x509/ext/SubjectKeyIdentifier.java b/libjava/gnu/java/security/x509/ext/SubjectKeyIdentifier.java
deleted file mode 100644
index fc65abe211c..00000000000
--- a/libjava/gnu/java/security/x509/ext/SubjectKeyIdentifier.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* SubjectKeyIdentifier.java -- subject key identifier extension.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.x509.ext;
-
-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;
-
-import java.io.IOException;
-
-public class SubjectKeyIdentifier extends Extension.Value
-{
-
- // Constant.
- // -------------------------------------------------------------------------
-
- public static final OID ID = new OID("2.5.29.14");
-
- private final byte[] keyIdentifier;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public SubjectKeyIdentifier(final byte[] encoded) throws IOException
- {
- super(encoded);
- DERValue val = DERReader.read(encoded);
- if (val.getTag() != DER.OCTET_STRING)
- throw new IOException("malformed SubjectKeyIdentifier");
- keyIdentifier = (byte[]) val.getValue();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public byte[] getKeyIdentifier()
- {
- return (byte[]) keyIdentifier.clone();
- }
-
- public String toString()
- {
- return SubjectKeyIdentifier.class.getName() + " [ " +
- Util.toHexString (keyIdentifier, ':') + " ]";
- }
-}
diff --git a/libjava/gnu/java/text/AttributedFormatBuffer.java b/libjava/gnu/java/text/AttributedFormatBuffer.java
deleted file mode 100644
index 8cfc8f56ddb..00000000000
--- a/libjava/gnu/java/text/AttributedFormatBuffer.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/* AttributedFormatBuffer.java -- Implements an attributed FormatBuffer.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.text.AttributedCharacterIterator;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-/**
- * This class is an implementation of a FormatBuffer with attributes.
- *
- * @author Guilhem Lavaux <guilhem@kaffe.org>
- * @date April 10, 2004
- */
-public class AttributedFormatBuffer implements FormatBuffer
-{
- private StringBuffer buffer;
- private ArrayList ranges;
- private ArrayList attributes;
- private int[] a_ranges;
- private HashMap[] a_attributes;
- private int startingRange;
- AttributedCharacterIterator.Attribute defaultAttr;
-
- /**
- * This constructor accepts a StringBuffer. If the buffer contains
- * already some characters they will not be attributed.
- */
- public AttributedFormatBuffer(StringBuffer buffer)
- {
- this.buffer = buffer;
- this.ranges = new ArrayList();
- this.attributes = new ArrayList();
- this.defaultAttr = null;
- if (buffer.length() != 0)
- {
- this.startingRange = buffer.length();
- addAttribute(buffer.length(), null);
- }
- else
- this.startingRange = -1;
- }
-
- public AttributedFormatBuffer(int prebuffer)
- {
- this(new StringBuffer(prebuffer));
- }
-
- public AttributedFormatBuffer()
- {
- this(10);
- }
-
- /**
- * This method is a helper function for formatters. Given a set of ranges
- * and attributes it adds exactly one attribute for the range of characters
- * comprised between the last entry in 'ranges' and the specified new range.
- *
- * @param new_range A new range to insert in the list.
- * @param new_attribute A new attribute to insert in the list.
- */
- private final void addAttribute(int new_range, AttributedCharacterIterator.Attribute attr)
- {
- HashMap map;
-
- if (attr != null)
- {
- map = new HashMap();
- map.put(attr, attr);
- attributes.add(map);
- }
- else
- attributes.add(null);
-
- ranges.add(new Integer(new_range));
- }
-
- public void append(String s)
- {
- if (startingRange < 0)
- startingRange = 0;
- buffer.append(s);
- }
-
- public void append(String s, AttributedCharacterIterator.Attribute attr)
- {
- setDefaultAttribute(attr);
- startingRange = buffer.length();
- append(s);
- setDefaultAttribute(null);
- }
-
- public void append(String s, int[] ranges, HashMap[] attrs)
- {
- int curPos = buffer.length();
-
- setDefaultAttribute(null);
- if (ranges != null)
- {
- for (int i = 0; i < ranges.length; i++)
- {
- this.ranges.add(new Integer(ranges[i] + curPos));
- this.attributes.add(attrs[i]);
- }
- }
- startingRange = buffer.length();
- buffer.append(s);
- }
-
- public void append(char c)
- {
- if (startingRange < 0)
- startingRange = buffer.length();
- buffer.append(c);
- }
-
- public void append(char c, AttributedCharacterIterator.Attribute attr)
- {
- setDefaultAttribute(attr);
- buffer.append(c);
- setDefaultAttribute(null);
- }
-
- public void setDefaultAttribute(AttributedCharacterIterator.Attribute attr)
- {
- if (attr == defaultAttr)
- return;
-
- int currentPos = buffer.length();
-
- if (startingRange != currentPos && startingRange >= 0)
- {
- addAttribute(currentPos, defaultAttr);
- }
- defaultAttr = attr;
- startingRange = currentPos;
- }
-
- public AttributedCharacterIterator.Attribute getDefaultAttribute()
- {
- return defaultAttr;
- }
-
- public void cutTail(int length)
- {
- buffer.setLength(buffer.length()-length);
- }
-
- public int length()
- {
- return buffer.length();
- }
-
- public void clear()
- {
- buffer.setLength(0);
- ranges.clear();
- attributes.clear();
- defaultAttr = null;
- startingRange = -1;
- }
-
- /**
- * This method synchronizes the state of the attribute array.
- * After calling it you may call {@link #getDefaultAttribute()}.
- */
- public void sync()
- {
- if (startingRange < 0 || startingRange == buffer.length())
- return;
-
- addAttribute(buffer.length(), defaultAttr);
-
- a_ranges = new int[ranges.size()];
- for (int i = 0; i < a_ranges.length; i++)
- a_ranges[i] = ((Integer)(ranges.get (i))).intValue();
-
- a_attributes = new HashMap[attributes.size()];
- System.arraycopy(attributes.toArray(), 0, a_attributes, 0, a_attributes.length);
- }
-
- /**
- * This method returns the internal StringBuffer describing
- * the attributed string.
- *
- * @return An instance of StringBuffer which contains the string.
- */
- public StringBuffer getBuffer()
- {
- return buffer;
- }
-
- /**
- * This method returns the ranges for the attributes.
- *
- * @return An array of int describing the ranges.
- */
- public int[] getRanges()
- {
- return a_ranges;
- }
-
- /**
- * This method returns the array containing the map on the
- * attributes.
- *
- * @return An array of {@link java.util.Map} containing the attributes.
- */
- public HashMap[] getAttributes()
- {
- return a_attributes;
- }
-}
diff --git a/libjava/gnu/java/text/BaseBreakIterator.java b/libjava/gnu/java/text/BaseBreakIterator.java
deleted file mode 100644
index c28a2089ad7..00000000000
--- a/libjava/gnu/java/text/BaseBreakIterator.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* BaseBreakIterator.java -- Base class for default BreakIterators
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.text.BreakIterator;
-import java.text.CharacterIterator;
-import java.text.StringCharacterIterator;
-
-/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date March 22, 1999
- */
-
-public abstract class BaseBreakIterator extends BreakIterator
-{
- public BaseBreakIterator ()
- {
- // It isn't documented, but break iterators are created in a
- // working state; their methods won't throw exceptions before
- // setText().
- iter = new StringCharacterIterator("");
- }
-
- public int current ()
- {
- return iter.getIndex();
- }
-
- public int first ()
- {
- iter.first();
- return iter.getBeginIndex();
- }
-
- public int following (int pos)
- {
- int save = iter.getIndex();
- iter.setIndex(pos);
- int r = next ();
- iter.setIndex(save);
- return r;
- }
-
- public CharacterIterator getText ()
- {
- return iter;
- }
-
- public int last ()
- {
- iter.last();
- // Go past the last character.
- iter.next();
- return iter.getEndIndex();
- }
-
- public int next (int n)
- {
- int r = iter.getIndex ();
- if (n > 0)
- {
- while (n > 0 && r != DONE)
- {
- r = next ();
- --n;
- }
- }
- else if (n < 0)
- {
- while (n < 0 && r != DONE)
- {
- r = previous ();
- ++n;
- }
- }
- return r;
- }
-
- public void setText (CharacterIterator newText)
- {
- iter = newText;
- }
-
- protected CharacterIterator iter;
-}
diff --git a/libjava/gnu/java/text/CharacterBreakIterator.java b/libjava/gnu/java/text/CharacterBreakIterator.java
deleted file mode 100644
index 5274543a9e5..00000000000
--- a/libjava/gnu/java/text/CharacterBreakIterator.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/* CharacterBreakIterator.java - Default character BreakIterator.
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.text.CharacterIterator;
-
-/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date March 19, 1999
- * Written using The Unicode Standard, Version 2.0.
- */
-
-public class CharacterBreakIterator extends BaseBreakIterator
-{
- // Hangul Jamo constants from Unicode book.
- private static final int LBase = 0x1100;
- private static final int VBase = 0x1161;
- private static final int TBase = 0x11a7;
- private static final int LCount = 19;
- private static final int VCount = 21;
- private static final int TCount = 28;
-
- // Information about surrogates.
- private static final int highSurrogateStart = 0xD800;
- private static final int highSurrogateEnd = 0xDBFF;
- private static final int lowSurrogateStart = 0xDC00;
- private static final int lowSurrogateEnd = 0xDFFF;
-
- public Object clone ()
- {
- return new CharacterBreakIterator (this);
- }
-
- public CharacterBreakIterator ()
- {
- }
-
- private CharacterBreakIterator (CharacterBreakIterator other)
- {
- iter = (CharacterIterator) other.iter.clone();
- }
-
- // Some methods to tell us different properties of characters.
- private final boolean isL (char c)
- {
- return c >= LBase && c <= LBase + LCount;
- }
- private final boolean isV (char c)
- {
- return c >= VBase && c <= VBase + VCount;
- }
- private final boolean isT (char c)
- {
- return c >= TBase && c <= TBase + TCount;
- }
- private final boolean isLVT (char c)
- {
- return isL (c) || isV (c) || isT (c);
- }
- private final boolean isHighSurrogate (char c)
- {
- return c >= highSurrogateStart && c <= highSurrogateEnd;
- }
- private final boolean isLowSurrogate (char c)
- {
- return c >= lowSurrogateStart && c <= lowSurrogateEnd;
- }
-
- public int next ()
- {
- int end = iter.getEndIndex();
- if (iter.getIndex() == end)
- return DONE;
-
- char c;
- for (char prev = CharacterIterator.DONE; iter.getIndex() < end; prev = c)
- {
- c = iter.next();
- if (c == CharacterIterator.DONE)
- break;
- int type = Character.getType(c);
-
- // Break after paragraph separators.
- if (type == Character.PARAGRAPH_SEPARATOR)
- break;
-
- // Now we need some lookahead.
- char ahead = iter.next();
- iter.previous();
- if (ahead == CharacterIterator.DONE)
- break;
- int aheadType = Character.getType(ahead);
-
- if (aheadType != Character.NON_SPACING_MARK
- && ! isLowSurrogate (ahead)
- && ! isLVT (ahead))
- break;
- if (! isLVT (c) && isLVT (ahead))
- break;
- if (isL (c) && ! isLVT (ahead)
- && aheadType != Character.NON_SPACING_MARK)
- break;
- if (isV (c) && ! isV (ahead) && !isT (ahead)
- && aheadType != Character.NON_SPACING_MARK)
- break;
- if (isT (c) && ! isT (ahead)
- && aheadType != Character.NON_SPACING_MARK)
- break;
-
- if (! isHighSurrogate (c) && isLowSurrogate (ahead))
- break;
- if (isHighSurrogate (c) && ! isLowSurrogate (ahead))
- break;
- if (! isHighSurrogate (prev) && isLowSurrogate (c))
- break;
- }
-
- return iter.getIndex();
- }
-
- public int previous ()
- {
- if (iter.getIndex() == iter.getBeginIndex())
- return DONE;
-
- while (iter.getIndex() >= iter.getBeginIndex())
- {
- char c = iter.previous();
- if (c == CharacterIterator.DONE)
- break;
- int type = Character.getType(c);
-
- if (type != Character.NON_SPACING_MARK
- && ! isLowSurrogate (c)
- && ! isLVT (c))
- break;
-
- // Now we need some lookahead.
- char ahead = iter.previous();
- if (ahead == CharacterIterator.DONE)
- {
- iter.next();
- break;
- }
- char ahead2 = iter.previous();
- iter.next();
- iter.next();
- if (ahead2 == CharacterIterator.DONE)
- break;
- int aheadType = Character.getType(ahead);
-
- if (aheadType == Character.PARAGRAPH_SEPARATOR)
- break;
-
- if (isLVT (c) && ! isLVT (ahead))
- break;
- if (! isLVT (c) && type != Character.NON_SPACING_MARK
- && isL (ahead))
- break;
- if (! isV (c) && ! isT (c) && type != Character.NON_SPACING_MARK
- && isV (ahead))
- break;
- if (! isT (c) && type != Character.NON_SPACING_MARK
- && isT (ahead))
- break;
-
- if (isLowSurrogate (c) && ! isHighSurrogate (ahead))
- break;
- if (! isLowSurrogate (c) && isHighSurrogate (ahead))
- break;
- if (isLowSurrogate (ahead) && ! isHighSurrogate (ahead2))
- break;
- }
-
- return iter.getIndex();
- }
-}
diff --git a/libjava/gnu/java/text/FormatBuffer.java b/libjava/gnu/java/text/FormatBuffer.java
deleted file mode 100644
index e6b68208792..00000000000
--- a/libjava/gnu/java/text/FormatBuffer.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/* FormatBuffer.java -- General interface to build attributed strings.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.text.AttributedCharacterIterator;
-import java.util.HashMap;
-
-/**
- * This interface describes a modifiable buffer which contains attributed
- * characters. The implementation may or may not implements attributes. It
- * aims to greatly simplify and clarify the implementation of java.text
- * formatters. The buffer may be appended or have its tail cut. It may also
- * be completely cleant up.
- *
- * @author Guilhem Lavaux <guilhem@kaffe.org>
- * @date April 10, 2004
- */
-public interface FormatBuffer
-{
- /**
- * This method appends a simple string to the buffer. This part of
- * the buffer will be attributed using the default attribute.
- *
- * @param s The string to append to the buffer.
- */
- public void append(String s);
-
- /**
- * This method appends a simple string to the buffer. This part of
- * the buffer will have the specified attribute (and only this one).
- * The default attribute may be changed after calling this method.
- *
- * @param s The string to append to the buffer.
- * @param attr Attribute to use for the string in the buffer.
- */
- public void append(String s, AttributedCharacterIterator.Attribute attr);
-
- /**
- * This method appends a simple string to the buffer. This part of
- * the buffer will be attributed using the specified ranges and attributes.
- * To have an example on how to specify ranges see {@link gnu.java.text.FormatCharacterIterator}.
- *
- * @param s The string to append to the buffer.
- * @param ranges The ranges describing how the attributes should be applied
- * to the string.
- * @param attrs The attributes of the string in the buffer.
- */
- public void append(String s, int[] ranges, HashMap[] attrs);
-
- /**
- * This method appends a simple char to the buffer. This part of
- * the buffer will be attributed using the default attribute.
- *
- * @param c The character to append to the buffer.
- */
- public void append(char c);
-
- /**
- * This method appends a simple character to the buffer. This part of
- * the buffer will have the specified attribute (and only this one).
- * The default attribute may be changed after calling this method.
- *
- * @param c The character to append to the buffer.
- * @param attr Attribute to use for the character in the buffer.
- */
- public void append(char c, AttributedCharacterIterator.Attribute attr);
-
- /**
- * This method changes the current default attribute for the next string
- * or character which will be appended to the buffer.
- *
- * @param attr The attribute which will be used by default.
- */
- public void setDefaultAttribute(AttributedCharacterIterator.Attribute attr);
-
- /**
- * This method returns the current default attribute for the buffer.
- *
- * @return The default attribute for the buffer.
- */
- public AttributedCharacterIterator.Attribute getDefaultAttribute();
-
- /**
- * This method cuts the last characters of the buffer. The number of
- * characters to cut is given by "length".
- *
- * @param length Number of characters to cut at the end of the buffer.
- */
- public void cutTail(int length);
-
- /**
- * This method resets completely the buffer.
- */
- public void clear();
-
- /**
- * This method returns the number of character in the buffer.
- *
- * @return The number of character in the buffer.
- */
- public int length();
-}
diff --git a/libjava/gnu/java/text/FormatCharacterIterator.java b/libjava/gnu/java/text/FormatCharacterIterator.java
deleted file mode 100644
index 7c41ed27c82..00000000000
--- a/libjava/gnu/java/text/FormatCharacterIterator.java
+++ /dev/null
@@ -1,534 +0,0 @@
-/* FormatCharacter.java -- Implementation of AttributedCharacterIterator for
- formatters.
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import gnu.classpath.Configuration;
-
-import java.text.AttributedCharacterIterator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- * This class should not be put public and it is only intended to the
- * classes of the java.text package. Its aim is to build a segmented
- * character iterator by appending strings and adding attributes to
- * portions of strings. The code intends to do some optimization
- * concerning memory consumption and attribute access but at the
- * end it is only an AttributedCharacterIterator.
- *
- * @author Guilhem Lavaux <guilhem@kaffe.org>
- * @date November 22, 2003
- */
-public class FormatCharacterIterator implements AttributedCharacterIterator
-{
- private String formattedString;
- private int charIndex;
- private int attributeIndex;
- private int[] ranges;
- private HashMap[] attributes;
-
- /**
- * This constructor builds an empty iterated strings. The attributes
- * are empty and so is the string. However you may append strings
- * and attributes to this iterator.
- */
- public FormatCharacterIterator()
- {
- formattedString = "";
- ranges = new int[0];
- attributes = new HashMap[0];
- }
-
- /**
- * This constructor take a string <code>s</code>, a set of ranges
- * and the corresponding attributes. This is used to build an iterator.
- * The array <code>ranges</code> should be formatted as follow:
- * each element of <code>ranges</code> specifies the index in the string
- * until which the corresponding map of attributes at the same position
- * is applied. For example, if you have:
- * <pre>
- * s = "hello";
- * ranges = new int[] { 2, 6 };
- * attributes = new HashMap[2];
- * </pre>
- * <code>"he"</code> will have the attributes <code>attributes[0]</code>,
- * <code>"llo"</code> the <code>attributes[1]</code>.
- */
- public FormatCharacterIterator (String s, int[] ranges, HashMap[] attributes)
- {
- formattedString = s;
- this.ranges = ranges;
- this.attributes = attributes;
- }
-
- /*
- * The following methods are inherited from AttributedCharacterIterator,
- * and thus are already documented.
- */
-
- public Set getAllAttributeKeys()
- {
- if (attributes != null && attributes[attributeIndex] != null)
- return attributes[attributeIndex].keySet();
- else
- return new HashSet();
- }
-
- public Map getAttributes()
- {
- if (attributes != null && attributes[attributeIndex] != null)
- return attributes[attributeIndex];
- else
- return new HashMap();
- }
-
- public Object getAttribute (AttributedCharacterIterator.Attribute attrib)
- {
- if (attributes != null && attributes[attributeIndex] != null)
- return attributes[attributeIndex].get (attrib);
- else
- return null;
- }
-
- public int getRunLimit(Set reqAttrs)
- {
- if (attributes == null)
- return formattedString.length();
-
- int currentAttrIndex = attributeIndex;
- Set newKeys;
-
- do
- {
- currentAttrIndex++;
- if (currentAttrIndex == attributes.length)
- return formattedString.length();
- if (attributes[currentAttrIndex] == null)
- break;
- newKeys = attributes[currentAttrIndex].keySet();
- }
- while (newKeys.containsAll (reqAttrs));
-
- return ranges[currentAttrIndex-1];
- }
-
- public int getRunLimit (AttributedCharacterIterator.Attribute attribute)
- {
- Set s = new HashSet();
-
- s.add (attribute);
- return getRunLimit (s);
- }
-
- public int getRunLimit()
- {
- if (attributes == null)
- return formattedString.length();
- if (attributes[attributeIndex] == null)
- {
- for (int i=attributeIndex+1;i<attributes.length;i++)
- if (attributes[i] != null)
- return ranges[i-1];
- return formattedString.length();
- }
-
- return getRunLimit (attributes[attributeIndex].keySet());
- }
-
- public int getRunStart (Set reqAttrs)
- {
- if (attributes == null)
- return formattedString.length();
-
- int currentAttrIndex = attributeIndex;
- Set newKeys = null;
-
- do
- {
- if (currentAttrIndex == 0)
- return 0;
-
- currentAttrIndex--;
- if (attributes[currentAttrIndex] == null)
- break;
- newKeys = attributes[currentAttrIndex].keySet();
- }
- while (newKeys.containsAll (reqAttrs));
-
- return (currentAttrIndex > 0) ? ranges[currentAttrIndex-1] : 0;
- }
-
- public int getRunStart()
- {
- if (attributes == null)
- return 0;
-
- if (attributes[attributeIndex] == null)
- {
- for (int i=attributeIndex;i>0;i--)
- if (attributes[i] != null)
- return ranges[attributeIndex-1];
- return 0;
- }
-
- return getRunStart (attributes[attributeIndex].keySet());
- }
-
- public int getRunStart (AttributedCharacterIterator.Attribute attribute)
- {
- Set s = new HashSet();
-
- s.add (attribute);
- return getRunStart (s);
- }
-
- public Object clone()
- {
- return new FormatCharacterIterator (formattedString, ranges, attributes);
- }
-
- /*
- * The following methods are inherited from CharacterIterator and thus
- * are already documented.
- */
-
- public char current()
- {
- return formattedString.charAt (charIndex);
- }
-
- public char first()
- {
- charIndex = 0;
- attributeIndex = 0;
- return formattedString.charAt (0);
- }
-
- public int getBeginIndex()
- {
- return 0;
- }
-
- public int getEndIndex()
- {
- return formattedString.length();
- }
-
- public int getIndex()
- {
- return charIndex;
- }
-
- public char last()
- {
- charIndex = formattedString.length()-1;
- if (attributes != null)
- attributeIndex = attributes.length-1;
- return formattedString.charAt (charIndex);
- }
-
- public char next()
- {
- charIndex++;
- if (charIndex >= formattedString.length())
- {
- charIndex = getEndIndex();
- return DONE;
- }
- if (attributes != null)
- {
- if (charIndex >= ranges[attributeIndex])
- attributeIndex++;
- }
- return formattedString.charAt (charIndex);
- }
-
- public char previous()
- {
- charIndex--;
- if (charIndex < 0)
- {
- charIndex = 0;
- return DONE;
- }
-
- if (attributes != null)
- {
- if (charIndex < ranges[attributeIndex])
- attributeIndex--;
- }
- return formattedString.charAt (charIndex);
- }
-
- public char setIndex (int position)
- {
- if (position < 0 || position > formattedString.length())
- throw new IllegalArgumentException ("position is out of range");
-
- charIndex = position;
- if (attributes != null)
- {
- for (attributeIndex=0;attributeIndex<attributes.length;
- attributeIndex++)
- if (ranges[attributeIndex] > charIndex)
- break;
- attributeIndex--;
- }
- if (charIndex == formattedString.length())
- return DONE;
- else
- return formattedString.charAt (charIndex);
- }
-
- /**
- * This method merge the specified attributes and ranges with the
- * internal tables. This method is in charge of the optimization
- * of tables. Two following sets of attributes are never the same.
- *
- * @see #FormatCharacterIterator()
- *
- * @param attributes the new array attributes to apply to the string.
- */
- public void mergeAttributes (HashMap[] attributes, int[] ranges)
- {
- Vector new_ranges = new Vector();
- Vector new_attributes = new Vector();
- int i = 0, j = 0;
-
- debug("merging " + attributes.length + " attrs");
-
- while (i < this.ranges.length && j < ranges.length)
- {
- if (this.attributes[i] != null)
- {
- new_attributes.add (this.attributes[i]);
- if (attributes[j] != null)
- this.attributes[i].putAll (attributes[j]);
- }
- else
- {
- new_attributes.add (attributes[j]);
- }
- if (this.ranges[i] == ranges[j])
- {
- new_ranges.add (new Integer (ranges[j]));
- i++;
- j++;
- }
- else if (this.ranges[i] < ranges[j])
- {
- new_ranges.add (new Integer (this.ranges[i]));
- i++;
- }
- else
- {
- new_ranges.add (new Integer (ranges[j]));
- j++;
- }
- }
-
- if (i != this.ranges.length)
- {
- for (;i<this.ranges.length;i++)
- {
- new_attributes.add (this.attributes[i]);
- new_ranges.add (new Integer (this.ranges[i]));
- }
- }
- if (j != ranges.length)
- {
- for (;j<ranges.length;j++)
- {
- new_attributes.add (attributes[j]);
- new_ranges.add (new Integer (ranges[j]));
- }
- }
-
- this.attributes = new HashMap[new_attributes.size()];
- this.ranges = new int[new_ranges.size()];
- System.arraycopy (new_attributes.toArray(), 0, this.attributes,
- 0, this.attributes.length);
-
- for (i=0;i<new_ranges.size();i++)
- {
- this.ranges[i] = ((Integer)new_ranges.elementAt (i)).intValue();
- }
-
- dumpTable();
- }
-
- /**
- * This method appends to the internal attributed string the attributed
- * string contained in the specified iterator.
- *
- * @param iterator the iterator which contains the attributed string to
- * append to this iterator.
- */
- public void append (AttributedCharacterIterator iterator)
- {
- char c = iterator.first();
- Vector more_ranges = new Vector();
- Vector more_attributes = new Vector();
-
- do
- {
- formattedString = formattedString + String.valueOf (c);
- // TODO: Reduce the size of the output array.
- more_attributes.add (iterator.getAttributes());
- more_ranges.add (new Integer (formattedString.length()));
- // END TOOD
- c = iterator.next();
- }
- while (c != DONE);
-
- HashMap[] new_attributes = new HashMap[attributes.length
- + more_attributes.size()];
- int[] new_ranges = new int[ranges.length + more_ranges.size()];
-
- System.arraycopy (attributes, 0, new_attributes, 0, attributes.length);
- System.arraycopy (more_attributes.toArray(), 0, new_attributes,
- attributes.length, more_attributes.size());
-
- System.arraycopy (ranges, 0, new_ranges, 0, ranges.length);
- Object[] new_ranges_array = more_ranges.toArray();
- for (int i = 0; i < more_ranges.size();i++)
- new_ranges[i+ranges.length] = ((Integer) new_ranges_array[i]).intValue();
-
- attributes = new_attributes;
- ranges = new_ranges;
- }
-
- /**
- * This method appends an attributed string which attributes are specified
- * directly in the calling parameters.
- *
- * @param text The string to append.
- * @param local_attributes The attributes to put on this string in the
- * iterator. If it is <code>null</code> the string will simply have no
- * attributes.
- */
- public void append (String text, HashMap local_attributes)
- {
- int[] new_ranges = new int[ranges.length+1];
- HashMap[] new_attributes = new HashMap[attributes.length+1];
-
- formattedString += text;
- System.arraycopy (attributes, 0, new_attributes, 0, attributes.length);
- System.arraycopy (ranges, 0, new_ranges, 0, ranges.length);
- new_ranges[ranges.length] = formattedString.length();
- new_attributes[attributes.length] = local_attributes;
-
- ranges = new_ranges;
- attributes = new_attributes;
- }
-
- /**
- * This method appends a string without attributes. It is completely
- * equivalent to call {@link #append(String,HashMap)} with local_attributes
- * equal to <code>null</code>.
- *
- * @param text The string to append to the iterator.
- */
- public void append (String text)
- {
- append (text, null);
- }
-
- /**
- * This method adds a set of attributes to a range of character. The
- * bounds are always inclusive. In the case many attributes have to
- * be added it is advised to directly use {@link #mergeAttributes([Ljava.util.HashMap;[I}
- *
- * @param attributes Attributes to merge into the iterator.
- * @param range_start Lower bound of the range of characters which will receive the
- * attribute.
- * @param range_end Upper bound of the range of characters which will receive the
- * attribute.
- *
- * @throws IllegalArgumentException if ranges are out of bounds.
- */
- public void addAttributes(HashMap attributes, int range_start, int range_end)
- {
- if (range_start == 0)
- mergeAttributes(new HashMap[] { attributes }, new int[] { range_end });
- else
- mergeAttributes(new HashMap[] { null, attributes }, new int[] { range_start, range_end });
- }
-
- private void debug(String s)
- {
- if (Configuration.DEBUG)
- System.out.println(s);
- }
-
- private void dumpTable()
- {
- int start_range = 0;
-
- if (!Configuration.DEBUG)
- return;
-
- System.out.println("Dumping internal table:");
- for (int i = 0; i < ranges.length; i++)
- {
- System.out.print("\t" + start_range + " => " + ranges[i] + ":");
- if (attributes[i] == null)
- System.out.println("null");
- else
- {
- Set keyset = attributes[i].keySet();
- if (keyset != null)
- {
- Iterator keys = keyset.iterator();
-
- while (keys.hasNext())
- System.out.print(" " + keys.next());
- }
- else
- System.out.println("keySet null");
- System.out.println();
- }
- }
- System.out.println();
- System.out.flush();
- }
-}
diff --git a/libjava/gnu/java/text/LineBreakIterator.java b/libjava/gnu/java/text/LineBreakIterator.java
deleted file mode 100644
index ad07479fb78..00000000000
--- a/libjava/gnu/java/text/LineBreakIterator.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/* LineBreakIterator.java - Default word BreakIterator.
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.text.CharacterIterator;
-
-/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date March 22, 1999
- * Written using The Unicode Standard, Version 2.0.
- */
-
-public class LineBreakIterator extends BaseBreakIterator
-{
- public Object clone ()
- {
- return new LineBreakIterator (this);
- }
-
- public LineBreakIterator ()
- {
- }
-
- private LineBreakIterator (LineBreakIterator other)
- {
- iter = (CharacterIterator) other.iter.clone();
- }
-
- // Some methods to tell us different properties of characters.
- private final boolean isNb (char c)
- {
- return (c == 0x00a0 // NO-BREAK SPACE
- || c == 0x2011 // NON-BREAKING HYPHEN
- || c == 0xfeff); // ZERO WITH NO-BREAK SPACE
- }
- private final boolean isClose (int type)
- {
- return (type == Character.END_PUNCTUATION
- // Unicode book says "comma, period, ...", which I take to
- // mean "Po" class.
- || type == Character.OTHER_PUNCTUATION);
- }
- private final boolean isIdeo (char c)
- {
- return (c >= 0x3040 && c <= 0x309f // Hiragana
- || c >= 0x30a0 && c <= 0x30ff // Katakana
- || c >= 0x4e00 && c <= 0x9fff // Han
- || c >= 0x3100 && c <= 0x312f); // Bopomofo
- }
-
- public int next ()
- {
- int end = iter.getEndIndex();
- if (iter.getIndex() == end)
- return DONE;
-
- while (iter.getIndex() < end)
- {
- char c = iter.current();
- int type = Character.getType(c);
-
- char n = iter.next();
-
- if (n == CharacterIterator.DONE
- || type == Character.PARAGRAPH_SEPARATOR
- || type == Character.LINE_SEPARATOR)
- break;
-
- // Handle two cases where we must scan for non-spacing marks.
- int start = iter.getIndex();
- if (type == Character.SPACE_SEPARATOR
- || type == Character.START_PUNCTUATION
- || isIdeo (c))
- {
- while (n != CharacterIterator.DONE
- && Character.getType(n) == Character.NON_SPACING_MARK)
- n = iter.next();
- if (n == CharacterIterator.DONE)
- break;
-
- if (type == Character.SPACE_SEPARATOR)
- {
- int nt = Character.getType(n);
- if (nt != Character.NON_SPACING_MARK
- && nt != Character.SPACE_SEPARATOR
- && ! isNb (n))
- break;
- }
- else if (type == Character.START_PUNCTUATION)
- {
- if (isIdeo (n))
- {
- // Open punctuation followed by non spacing marks
- // and then ideograph does not have a break in
- // it. So skip all this.
- start = iter.getIndex();
- }
- }
- else
- {
- // Ideograph preceded this character.
- if (isClose (Character.getType(n)))
- break;
- }
- }
- iter.setIndex(start);
- }
-
- return iter.getIndex();
- }
-
- public int previous ()
- {
- int start = iter.getBeginIndex();
- if (iter.getIndex() == start)
- return DONE;
-
- while (iter.getIndex() >= start)
- {
- char c = iter.previous();
- if (c == CharacterIterator.DONE)
- break;
- int type = Character.getType(c);
-
- char n = iter.previous();
- if (n == CharacterIterator.DONE)
- break;
- iter.next();
-
- int nt = Character.getType(n);
- // Break after paragraph separators.
- if (nt == Character.PARAGRAPH_SEPARATOR
- || nt == Character.LINE_SEPARATOR)
- break;
-
- // Skip non-spacing marks.
- int init = iter.getIndex();
- while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK)
- {
- n = iter.previous();
- nt = Character.getType(n);
- }
-
- if (nt == Character.SPACE_SEPARATOR
- && type != Character.SPACE_SEPARATOR
- && type != Character.NON_SPACING_MARK
- && ! isNb (c))
- break;
- if (! isClose (type) && isIdeo (n))
- break;
- if (isIdeo (c) && nt != Character.START_PUNCTUATION)
- break;
- iter.setIndex(init);
- }
-
- return iter.getIndex();
- }
-}
diff --git a/libjava/gnu/java/text/SentenceBreakIterator.java b/libjava/gnu/java/text/SentenceBreakIterator.java
deleted file mode 100644
index f91d269bb08..00000000000
--- a/libjava/gnu/java/text/SentenceBreakIterator.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/* SentenceBreakIterator.java - Default sentence BreakIterator.
- Copyright (C) 1999, 2001, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.text.CharacterIterator;
-
-/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date March 23, 1999
- * Written using The Unicode Standard, Version 2.0.
- */
-
-public class SentenceBreakIterator extends BaseBreakIterator
-{
- public Object clone ()
- {
- return new SentenceBreakIterator (this);
- }
-
- public SentenceBreakIterator ()
- {
- }
-
- private SentenceBreakIterator (SentenceBreakIterator other)
- {
- iter = (CharacterIterator) other.iter.clone();
- }
-
- public int next ()
- {
- int end = iter.getEndIndex();
- if (iter.getIndex() == end)
- return DONE;
-
- while (iter.getIndex() < end)
- {
- char c = iter.current();
- if (c == CharacterIterator.DONE)
- break;
- int type = Character.getType(c);
-
- char n = iter.next();
- if (n == CharacterIterator.DONE)
- break;
-
- // Always break after paragraph separator.
- if (type == Character.PARAGRAPH_SEPARATOR)
- break;
-
- if (c == '!' || c == '?')
- {
- // Skip close punctuation.
- while (n != CharacterIterator.DONE
- && Character.getType(n) == Character.END_PUNCTUATION)
- n = iter.next();
- // Skip (java) space, line and paragraph separators.
- while (n != CharacterIterator.DONE && Character.isWhitespace(n))
- n = iter.next();
-
- // There's always a break somewhere after `!' or `?'.
- break;
- }
-
- if (c == '.')
- {
- int save = iter.getIndex();
- // Skip close punctuation.
- while (n != CharacterIterator.DONE
- && Character.getType(n) == Character.END_PUNCTUATION)
- n = iter.next();
- // Skip (java) space, line and paragraph separators.
- // We keep count because we need at least one for this period to
- // represent a terminator.
- int spcount = 0;
- while (n != CharacterIterator.DONE && Character.isWhitespace(n))
- {
- n = iter.next();
- ++spcount;
- }
- if (spcount > 0)
- {
- int save2 = iter.getIndex();
- // Skip over open puncutation.
- while (n != CharacterIterator.DONE
- && Character.getType(n) == Character.START_PUNCTUATION)
- n = iter.next();
- // Next character must not be lower case.
- if (n == CharacterIterator.DONE
- || ! Character.isLowerCase(n))
- {
- iter.setIndex(save2);
- break;
- }
- }
- iter.setIndex(save);
- }
- }
-
- return iter.getIndex();
- }
-
- private final int previous_internal ()
- {
- int start = iter.getBeginIndex();
- if (iter.getIndex() == start)
- return DONE;
-
- while (iter.getIndex() >= start)
- {
- char c = iter.previous();
- if (c == CharacterIterator.DONE)
- break;
-
- char n = iter.previous();
- if (n == CharacterIterator.DONE)
- break;
- iter.next();
- int nt = Character.getType(n);
-
- if (! Character.isLowerCase(c)
- && (nt == Character.START_PUNCTUATION
- || Character.isWhitespace(n)))
- {
- int save = iter.getIndex();
- int save_nt = nt;
- char save_n = n;
- // Skip open punctuation.
- while (n != CharacterIterator.DONE
- && Character.getType(n) == Character.START_PUNCTUATION)
- n = iter.previous();
- if (n == CharacterIterator.DONE)
- break;
- if (Character.isWhitespace(n))
- {
- // Must have at least one (java) space after the `.'.
- int save2 = iter.getIndex();
- while (n != CharacterIterator.DONE
- && Character.isWhitespace(n))
- n = iter.previous();
- // Skip close punctuation.
- while (n != CharacterIterator.DONE
- && Character.getType(n) == Character.END_PUNCTUATION)
- n = iter.previous();
- if (n == CharacterIterator.DONE || n == '.')
- {
- // Communicate location of actual end.
- period = iter.getIndex();
- iter.setIndex(save2);
- break;
- }
- }
- iter.setIndex(save);
- nt = save_nt;
- n = save_n;
- }
-
- if (nt == Character.PARAGRAPH_SEPARATOR)
- {
- // Communicate location of actual end.
- period = iter.getIndex();
- break;
- }
- else if (Character.isWhitespace(n)
- || nt == Character.END_PUNCTUATION)
- {
- int save = iter.getIndex();
- // Skip (java) space, line and paragraph separators.
- while (n != CharacterIterator.DONE
- && Character.isWhitespace(n))
- n = iter.previous();
- // Skip close punctuation.
- while (n != CharacterIterator.DONE
- && Character.getType(n) == Character.END_PUNCTUATION)
- n = iter.previous();
- int here = iter.getIndex();
- iter.setIndex(save);
- if (n == CharacterIterator.DONE || n == '!' || n == '?')
- {
- // Communicate location of actual end.
- period = here;
- break;
- }
- }
- else if (n == '!' || n == '?')
- {
- // Communicate location of actual end.
- period = iter.getIndex();
- break;
- }
- }
-
- return iter.getIndex();
- }
-
- public int previous ()
- {
- // We want to skip over the first sentence end to the second one.
- // However, at the end of the string we want the first end.
- int here = iter.getIndex();
- period = here;
- int first = previous_internal ();
- if (here == iter.getEndIndex() || first == DONE)
- return first;
- iter.setIndex(period);
- return previous_internal ();
- }
-
- // This is used for communication between previous and
- // previous_internal.
- private int period;
-}
diff --git a/libjava/gnu/java/text/StringFormatBuffer.java b/libjava/gnu/java/text/StringFormatBuffer.java
deleted file mode 100644
index 5772186b4c5..00000000000
--- a/libjava/gnu/java/text/StringFormatBuffer.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* StringFormatBuffer.java -- Implements FormatBuffer using StringBuffer.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.text.AttributedCharacterIterator;
-import java.util.HashMap;
-
-/**
- * This class is an implementation of a FormatBuffer without attributes.
- *
- * @author Guilhem Lavaux <guilhem@kaffe.org>
- * @date April 10, 2004
- */
-public class StringFormatBuffer implements FormatBuffer
-{
- private StringBuffer buffer;
- private AttributedCharacterIterator.Attribute defaultAttr;
-
- public StringFormatBuffer(int prebuffer)
- {
- buffer = new StringBuffer(prebuffer);
- }
-
- public StringFormatBuffer(StringBuffer buffer)
- {
- this.buffer = buffer;
- }
-
- public void append(String s)
- {
- buffer.append(s);
- }
-
- public void append(String s, AttributedCharacterIterator.Attribute attr)
- {
- buffer.append(s);
- }
-
- public void append(String s, int[] ranges, HashMap[] attrs)
- {
- buffer.append(s);
- }
-
- public void append(char c)
- {
- buffer.append(c);
- }
-
- public void append(char c, AttributedCharacterIterator.Attribute attr)
- {
- buffer.append(c);
- }
-
- public void setDefaultAttribute(AttributedCharacterIterator.Attribute attr)
- {
- defaultAttr = attr;
- }
-
- public AttributedCharacterIterator.Attribute getDefaultAttribute()
- {
- return defaultAttr;
- }
-
- public void cutTail(int length)
- {
- buffer.setLength(buffer.length()-length);
- }
-
- public int length()
- {
- return buffer.length();
- }
-
- public void clear()
- {
- buffer.setLength(0);
- }
-
- /**
- * This method returns the internal {@link java.lang.StringBuffer} which
- * contains the string of character.
- */
- public StringBuffer getBuffer()
- {
- return buffer;
- }
-}
diff --git a/libjava/gnu/java/text/WordBreakIterator.java b/libjava/gnu/java/text/WordBreakIterator.java
deleted file mode 100644
index f140369f8c6..00000000000
--- a/libjava/gnu/java/text/WordBreakIterator.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/* WordBreakIterator.java - Default word BreakIterator.
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.text.CharacterIterator;
-
-/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date March 22, 1999
- * Written using The Unicode Standard, Version 2.0.
- */
-
-public class WordBreakIterator extends BaseBreakIterator
-{
- public Object clone ()
- {
- return new WordBreakIterator (this);
- }
-
- public WordBreakIterator ()
- {
- }
-
- private WordBreakIterator (WordBreakIterator other)
- {
- iter = (CharacterIterator) other.iter.clone();
- }
-
- // Some methods to tell us different properties of characters.
- private final boolean isHira (char c)
- {
- return c >= 0x3040 && c <= 0x309f;
- }
- private final boolean isKata (char c)
- {
- return c >= 0x30a0 && c <= 0x30ff;
- }
- private final boolean isHan (char c)
- {
- return c >= 0x4e00 && c <= 0x9fff;
- }
-
- public int next ()
- {
- int end = iter.getEndIndex();
- if (iter.getIndex() == end)
- return DONE;
-
- while (iter.getIndex() < end)
- {
- char c = iter.current();
- if (c == CharacterIterator.DONE)
- break;
- int type = Character.getType(c);
-
- char n = iter.next();
- if (n == CharacterIterator.DONE)
- break;
-
- // Break after paragraph separators.
- if (type == Character.PARAGRAPH_SEPARATOR
- || type == Character.LINE_SEPARATOR)
- break;
-
- // Break between letters and non-letters.
- // FIXME: we treat apostrophe as part of a word. This
- // is an English-ism.
- boolean is_letter = Character.isLetter(c);
- if (c != '\'' && ! is_letter && type != Character.NON_SPACING_MARK
- && Character.isLetter(n))
- break;
-
- // Always break after certain symbols, such as punctuation.
- // This heuristic is derived from hints in the JCL book and is
- // not part of Unicode. It seems to be right, however.
- // FIXME: we treat apostrophe as part of a word. This
- // is an English-ism.
- if (c != '\''
- && (type == Character.DASH_PUNCTUATION
- || type == Character.START_PUNCTUATION
- || type == Character.END_PUNCTUATION
- || type == Character.CONNECTOR_PUNCTUATION
- || type == Character.OTHER_PUNCTUATION
- || type == Character.MATH_SYMBOL
- || type == Character.CURRENCY_SYMBOL
- || type == Character.MODIFIER_SYMBOL
- || type == Character.OTHER_SYMBOL
- || type == Character.FORMAT
- || type == Character.CONTROL))
- break;
-
- boolean is_hira = isHira (c);
- boolean is_kata = isKata (c);
- boolean is_han = isHan (c);
-
- // Special case Japanese.
- if (! is_hira && ! is_kata && ! is_han
- && type != Character.NON_SPACING_MARK
- && (isHira (n) || isKata (n) || isHan (n)))
- break;
-
- if (is_hira || is_kata || is_han || is_letter)
- {
- // Now we need to do some lookahead. We might need to do
- // quite a bit of lookahead, so we save our position and
- // restore it later.
- int save = iter.getIndex();
- // Skip string of non spacing marks.
- while (n != CharacterIterator.DONE
- && Character.getType(n) == Character.NON_SPACING_MARK)
- n = iter.next();
- if (n == CharacterIterator.DONE)
- break;
- if ((is_hira && ! isHira (n))
- || (is_kata && ! isHira (n) && ! isKata (n))
- || (is_han && ! isHira (n) && ! isHan (n))
- // FIXME: we treat apostrophe as part of a word. This
- // is an English-ism.
- || (is_letter && ! Character.isLetter(n) && n != '\''))
- break;
- iter.setIndex(save);
- }
- }
-
- return iter.getIndex();
- }
-
- public int previous ()
- {
- int start = iter.getBeginIndex();
- if (iter.getIndex() == start)
- return DONE;
-
- while (iter.getIndex() >= start)
- {
- char c = iter.previous();
- if (c == CharacterIterator.DONE)
- break;
-
- boolean is_hira = isHira (c);
- boolean is_kata = isKata (c);
- boolean is_han = isHan (c);
- boolean is_letter = Character.isLetter(c);
-
- char n = iter.previous();
- if (n == CharacterIterator.DONE)
- break;
- iter.next();
- int type = Character.getType(n);
- // Break after paragraph separators.
- if (type == Character.PARAGRAPH_SEPARATOR
- || type == Character.LINE_SEPARATOR)
- break;
-
- // Break between letters and non-letters.
- // FIXME: we treat apostrophe as part of a word. This
- // is an English-ism.
- if (n != '\'' && ! Character.isLetter(n)
- && type != Character.NON_SPACING_MARK
- && is_letter)
- break;
-
- // Always break after certain symbols, such as punctuation.
- // This heuristic is derived from hints in the JCL book and is
- // not part of Unicode. It seems to be right, however.
- // FIXME: we treat apostrophe as part of a word. This
- // is an English-ism.
- if (n != '\''
- && (type == Character.DASH_PUNCTUATION
- || type == Character.START_PUNCTUATION
- || type == Character.END_PUNCTUATION
- || type == Character.CONNECTOR_PUNCTUATION
- || type == Character.OTHER_PUNCTUATION
- || type == Character.MATH_SYMBOL
- || type == Character.CURRENCY_SYMBOL
- || type == Character.MODIFIER_SYMBOL
- || type == Character.OTHER_SYMBOL
- || type == Character.FORMAT
- || type == Character.CONTROL))
- break;
-
- // Special case Japanese.
- if ((is_hira || is_kata || is_han)
- && ! isHira (n) && ! isKata (n) && ! isHan (n)
- && type != Character.NON_SPACING_MARK)
- break;
-
- // We might have to skip over non spacing marks to see what's
- // on the other side.
- if (! is_hira || (! is_letter && c != '\''))
- {
- int save = iter.getIndex();
- while (n != CharacterIterator.DONE
- && Character.getType(n) == Character.NON_SPACING_MARK)
- n = iter.previous();
- iter.setIndex(save);
- // This is a strange case: a bunch of non-spacing marks at
- // the beginning. We treat the current location as a word
- // break.
- if (n == CharacterIterator.DONE)
- break;
- if ((isHira (n) && ! is_hira)
- || (isKata (n) && ! is_hira && ! is_kata)
- || (isHan (n) && ! is_hira && ! is_han)
- // FIXME: we treat apostrophe as part of a word. This
- // is an English-ism.
- || (! is_letter && c != '\'' && Character.isLetter(n)))
- break;
- }
- }
-
- return iter.getIndex();
- }
-}
diff --git a/libjava/gnu/java/util/DoubleEnumeration.java b/libjava/gnu/java/util/DoubleEnumeration.java
deleted file mode 100644
index 1fc37f8e0f8..00000000000
--- a/libjava/gnu/java/util/DoubleEnumeration.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* gnu.java.util.DoubleEnumeration
- Copyright (C) 1998, 1999, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-
-/**
- * This is a helper class that combines two Enumerations.
- * It returns the elements of the first Enumeration until it has
- * no more elements and then returns the elements of the second
- * Enumeration.<br>
- *
- * In the default case:
- * <pre>
- * doubleEnum = new DoubleEnumeration(enum1, enum2);
- * while (doubleEnum.hasMoreElements()) {
- * Object o = doubleEnum.nextElement();
- * do_something(o);
- * }
- * </pre>
- * it calls hasMoreElements of the Enumerations as few times as
- * possible.
- * The references to the Enumerations are cleared as soon as they have no
- * more elements to help garbage collecting.
- *
- * @author Jochen Hoenicke
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class DoubleEnumeration implements Enumeration
-{
- /**
- * This is true as long as one of the enumerations has more
- * elements.
- * Only valid when hasChecked is true.
- * Set in <code>hasMoreElements()</code>
- */
- private boolean hasMore;
- /**
- * This is true, if it is sure that hasMore indicates wether there are
- * more elements.
- * Set to true in <code>hasMoreElements()</code>.
- * Set to false in <code>getNextElement()</code>.
- */
- private boolean hasChecked;
- /**
- * The first enumeration.
- */
- private Enumeration e1;
- /**
- * The second enumeration.
- */
- private Enumeration e2;
-
- /**
- * Creates a new Enumeration combining the given two enumerations.
- * The enumerations mustn't be accessed by other classes.
- */
- public DoubleEnumeration(Enumeration e1, Enumeration e2)
- {
- this.e1 = e1;
- this.e2 = e2;
- hasChecked = false;
- }
-
- /**
- * Returns true, if at least one of the two enumerations has more
- * elements.
- */
- public boolean hasMoreElements()
- {
- if (hasChecked)
- return hasMore;
-
- hasMore = (e1 != null && e1.hasMoreElements());
-
- if (!hasMore) {
- e1 = e2;
- e2 = null;
- hasMore = (e1 != null && e1.hasMoreElements());
- }
-
- hasChecked = true;
- return hasMore;
- }
-
- /**
- * Returns the next element. This returns the next element of the
- * first enumeration, if it has more elements, otherwise the next
- * element of the second enumeration. If both enumeration don't have
- * any elements it throws a <code>NoSuchElementException</code>.
- */
- public Object nextElement()
- {
- if (!hasMoreElements())
- throw new NoSuchElementException();
- else {
- hasChecked = false;
- return e1.nextElement();
- }
- }
-}
diff --git a/libjava/gnu/java/util/EmptyEnumeration.java b/libjava/gnu/java/util/EmptyEnumeration.java
deleted file mode 100644
index 46a82d6cb53..00000000000
--- a/libjava/gnu/java/util/EmptyEnumeration.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* EmptyEnumeration.java -- a constant empty enumeration
- Copyright (C) 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-/**
- * This is a helper class that produces an empty Enumerations. There is only
- * one instance of this class that can be used whenever one needs a
- * non-null but empty enumeration. Using this class prevents multiple
- * small objects and inner classes. <code>getInstance()</code> returns
- * the only instance of this class. It can be shared by multiple objects and
- * threads.
- *
- * @author Mark Wielaard (mark@klomp.org)
- */
-public final class EmptyEnumeration implements Enumeration, Serializable
-{
- /** The only instance of this class */
- private static final EmptyEnumeration instance = new EmptyEnumeration();
-
- /**
- * Private constructor that creates a new empty Enumeration.
- */
- private EmptyEnumeration()
- {
- }
-
- /**
- * Returns the only instance of this class.
- * It can be shared by multiple objects and threads.
- *
- * @return the common empty enumeration
- */
- public static EmptyEnumeration getInstance()
- {
- return instance;
- }
-
- /**
- * Returns false, since there are no elements.
- *
- * @return false
- */
- public boolean hasMoreElements()
- {
- return false;
- }
-
- /**
- * Always throws <code>NoSuchElementException</code>, since it is empty.
- *
- * @throws NoSuchElementException this is empty
- */
- public Object nextElement()
- {
- throw new NoSuchElementException();
- }
-}
diff --git a/libjava/gnu/java/util/prefs/FileBasedFactory.java b/libjava/gnu/java/util/prefs/FileBasedFactory.java
deleted file mode 100644
index 70f3558fc6f..00000000000
--- a/libjava/gnu/java/util/prefs/FileBasedFactory.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* FileBasedFactory - Default Classpath implementation of a PreferencesFactory
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util.prefs;
-
-import java.util.prefs.*;
-
-/**
- * Default Classpath implementation of a PreferencesFactory.
- * Returns system and user root Preferences nodes that are read from files.
- *
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class FileBasedFactory implements PreferencesFactory {
-
- public Preferences systemRoot() {
- return null;
- }
-
- public Preferences userRoot() {
- return null;
- }
-}
diff --git a/libjava/gnu/java/util/prefs/MemoryBasedFactory.java b/libjava/gnu/java/util/prefs/MemoryBasedFactory.java
deleted file mode 100644
index abaf0016f5b..00000000000
--- a/libjava/gnu/java/util/prefs/MemoryBasedFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* MemoryBasedFactory - Memory based PreferencesFactory usefull for testing
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util.prefs;
-
-import java.util.prefs.*;
-
-/**
- * Memory based PreferencesFactory usefull for testing.
- * Returns completely empty Preferences for system and user roots.
- * All changes are only backed by the current instances in memory.
- *
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class MemoryBasedFactory implements PreferencesFactory {
-
- // Static fields containing the preferences root nodes
- private static final Preferences systemPreferences
- = new MemoryBasedPreferences(null, "", false);
- private static final Preferences userPreferences
- = new MemoryBasedPreferences(null, "", true);
-
- public Preferences systemRoot() {
- return systemPreferences;
- }
-
- public Preferences userRoot() {
- return userPreferences;
- }
-}
diff --git a/libjava/gnu/java/util/prefs/MemoryBasedPreferences.java b/libjava/gnu/java/util/prefs/MemoryBasedPreferences.java
deleted file mode 100644
index b2f321c9c7e..00000000000
--- a/libjava/gnu/java/util/prefs/MemoryBasedPreferences.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/* MemoryBasedPreferences - A Preference node which holds all entries in memory
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util.prefs;
-
-import java.util.HashMap;
-
-import java.util.prefs.*;
-
-/**
- * A Preference node which holds all entries in memory
- *
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class MemoryBasedPreferences extends AbstractPreferences {
-
- /** True if this is a preference node in the user tree, false otherwise. */
- private final boolean isUser;
-
- /** Contains all the preference entries of this node. */
- private HashMap entries = new HashMap();
-
- /**
- * Creates a new preferences node with the given name and parent.
- * When isUser is true it will be user node otherwise it will be a system
- * node. It will always set the <code>newNode</code> field to true
- * since there is no real backing store, so all nodes are new.
- */
- public MemoryBasedPreferences(MemoryBasedPreferences parent,
- String name,
- boolean isUser) {
- super(parent, name);
- this.isUser = isUser;
-
- // Since we do not have a real backing store all nodes are new
- newNode = true;
- }
-
- /**
- * Returns true if this node was created as a user node.
- */
- public boolean isUserNode() {
- return isUser;
- }
-
- /**
- * Returns an empty array since all children names are always already
- * chached.
- */
- protected String[] childrenNamesSpi() throws BackingStoreException {
- return new String[0];
- }
-
- /**
- * Returns a new node with the given name with as parent this node and
- * with the <code>isUser</code> flag set to the same value as this node.
- */
- protected AbstractPreferences childSpi(String childName) {
- return new MemoryBasedPreferences(this, childName, isUser);
- }
-
- /**
- * Returns a (possibly empty) array of keys of the preferences entries of
- * this node.
- */
- protected String[] keysSpi() throws BackingStoreException {
- return (String[]) entries.keySet().toArray(new String[entries.size()]);
- }
-
- /**
- * Returns the associated value from this nodes preferences entries or
- * null when the key has not been set.
- */
- protected String getSpi(String key) {
- return (String) entries.get(key);
- }
-
- /**
- * Sets the value for the given key.
- */
- protected void putSpi(String key, String value) {
- entries.put(key, value);
- }
-
- /**
- * Removes the entry with the given key.
- */
- protected void removeSpi(String key) {
- entries.remove(key);
- }
-
- /**
- * Does nothing since we do not have any backing store.
- */
- protected void flushSpi() {
- }
-
- /**
- * Does nothing since we do not have any backing store.
- */
- protected void syncSpi() {
- }
-
- /**
- * Just removes the entries map of this node.
- */
- protected void removeNodeSpi() {
- entries = null;
- }
-}
diff --git a/libjava/gnu/java/util/prefs/NodeReader.java b/libjava/gnu/java/util/prefs/NodeReader.java
deleted file mode 100644
index 4cd52e5dbf9..00000000000
--- a/libjava/gnu/java/util/prefs/NodeReader.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/* NodeReader - Reads and imports preferences nodes from files
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util.prefs;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.prefs.InvalidPreferencesFormatException;
-import java.util.prefs.Preferences;
-import java.util.prefs.PreferencesFactory;
-
-/**
- * Reads and imports preferences nodes from files.
- *
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class NodeReader {
-
- private final BufferedReader br;
- private String line = "";
-
- private final PreferencesFactory factory;
-
- public NodeReader(Reader r, PreferencesFactory factory) {
- if(r instanceof BufferedReader) {
- br = (BufferedReader) r;
- } else {
- br = new BufferedReader(r);
- }
- this.factory = factory;
- }
-
- public NodeReader(InputStream is, PreferencesFactory factory) {
- this(new InputStreamReader(is), factory);
- }
-
- public void importPreferences()
- throws InvalidPreferencesFormatException, IOException
- {
- readPreferences();
- }
-
- private void readPreferences()
- throws InvalidPreferencesFormatException, IOException
- {
- // Begin starting tag
- skipTill("<preferences");
-
- readRoot();
-
- // Ending tag
- skipTill("</preferences>");
- }
-
- private void readRoot()
- throws InvalidPreferencesFormatException, IOException
- {
- // Begin starting tag
- skipTill("<root");
-
- // type attribute
- skipTill("type=\"");
- String type = readTill("\"");
- Preferences root;
- if ("user".equals(type)) {
- root = factory.userRoot();
- } else if ("system".equals(type)) {
- root = factory.systemRoot();
- } else {
- throw new InvalidPreferencesFormatException("Unknown type: "
- + type);
- }
-
- // Read root map and subnodes
- readMap(root);
- readNodes(root);
-
- // Ending tag
- skipTill("</root>");
- }
-
- private void readNodes(Preferences node)
- throws InvalidPreferencesFormatException, IOException
- {
- while ("node".equals(nextTag())) {
- skipTill("<node");
- skipTill("name=\"");
- String name = readTill("\"");
- Preferences subnode = node.node(name);
- System.out.println("Found subnode: " + subnode.absolutePath());
- readMap(subnode);
- readNodes(subnode);
- skipTill("</node>");
- }
-
- }
-
- private void readMap(Preferences node)
- throws InvalidPreferencesFormatException, IOException
- {
- // Begin map tag
- skipTill("<map");
-
- // Empty map?
- if (line.startsWith("/>")) {
- line = line.substring(2);
- return;
- }
-
- // Map entries
- readEntries(node);
-
- // Ending tag
- skipTill("</map>");
- }
-
- private void readEntries(Preferences node)
- throws InvalidPreferencesFormatException, IOException
- {
- while ("entry".equals(nextTag())) {
- skipTill("<entry");
- skipTill("key=\"");
- String key = readTill("\"");
- skipTill("value=\"");
- String value = readTill("\"");
- System.out.println("Key: " + key + " Value: " + value);
- node.put(key, value);
- }
- }
-
- private void skipTill(String s)
- throws InvalidPreferencesFormatException, IOException
- {
- while(true) {
- if (line == null)
- throw new InvalidPreferencesFormatException(s + " not found");
-
- int index = line.indexOf(s);
- if (index == -1) {
- line = br.readLine();
- } else {
- line = line.substring(index+s.length());
- return;
- }
- }
- }
-
- private String readTill(String s)
- throws InvalidPreferencesFormatException
- {
- int index = line.indexOf(s);
- if (index == -1)
- throw new InvalidPreferencesFormatException(s + " not found");
-
- String read = line.substring(0, index);
- line = line.substring(index+s.length());
-
- return read;
- }
-
- private String nextTag()
- throws InvalidPreferencesFormatException, IOException
- {
- while(true) {
- if (line == null)
- throw new InvalidPreferencesFormatException("unexpected EOF");
-
- int start = line.indexOf("<");
- if (start == -1) {
- line = br.readLine();
- } else {
- // Find end of tag
- int end = start+1;
- while (end != line.length()
- && " \t\r\n".indexOf(line.charAt(end)) == -1) {
- end++;
- }
- // Line now starts at the found tag
- String tag = line.substring(start+1,end);
- line = line.substring(start);
- return tag;
- }
- }
- }
-
-}
diff --git a/libjava/gnu/java/util/prefs/NodeWriter.java b/libjava/gnu/java/util/prefs/NodeWriter.java
deleted file mode 100644
index 1eed9e66e2d..00000000000
--- a/libjava/gnu/java/util/prefs/NodeWriter.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/* NodeWriter - Writes and exports preferences nodes to files
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util.prefs;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-
-import java.util.StringTokenizer;
-
-import java.util.prefs.*;
-
-/**
- * Writes and exports preferences nodes to files
- *
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class NodeWriter {
-
- /** The Preferences node to write. */
- private final Preferences prefs;
-
- /** The bufferedWriter to write the node to. */
- private final BufferedWriter bw;
-
- /**
- * True if the complete sub tree should be written,
- * false if only the node should be written.
- */
- private boolean subtree;
-
- /**
- * Creates a new NodeWriter for the given preferences node and writer.
- */
- public NodeWriter(Preferences prefs, Writer w) {
- this.prefs = prefs;
- if (w instanceof BufferedWriter) {
- this.bw = (BufferedWriter) w;
- } else {
- this.bw = new BufferedWriter(w);
- }
- }
-
- /**
- * Creates a new NodeWriter for the given preferences node and
- * outputstream. Creates a new OutputStreamWriter.
- */
- public NodeWriter(Preferences prefs, OutputStream os) {
- this(prefs, new OutputStreamWriter(os));
- }
-
- /**
- * Writes the preference node plus the complete subtree.
- */
- public void writePrefsTree() throws BackingStoreException, IOException {
- subtree = true;
- writeHeader();
- writePreferences();
- bw.flush();
- }
-
- /**
- * Writes only the preference node.
- */
- public void writePrefs() throws BackingStoreException, IOException {
- subtree = false;
- writeHeader();
- writePreferences();
- bw.flush();
- }
-
- /**
- * Writes the standard header.
- */
- private void writeHeader() throws BackingStoreException, IOException {
- bw.write("<?xml version=\"1.0\"?>");
- bw.newLine();
- bw.newLine();
- bw.write("<!-- GNU Classpath java.util.prefs Preferences ");
-
- if (prefs.isUserNode()) {
- bw.write("user");
- } else {
- bw.write("system");
- }
-
- // root node?
- if (prefs.parent() == null) {
- bw.write(" root");
- }
-
- if (subtree) {
- bw.write(" tree");
- } else {
- bw.write(" node");
- }
-
- // no root?
- if (prefs.parent() != null) {
- bw.newLine();
- bw.write(" '");
- bw.write(prefs.absolutePath());
- bw.write('\'');
- bw.newLine();
- }
- bw.write(" -->");
- bw.newLine();
- bw.newLine();
- }
-
- /**
- * Write the preferences tag and the root.
- */
- private void writePreferences() throws BackingStoreException, IOException {
- bw.write("<preferences>");
- bw.newLine();
- writeRoot();
- bw.write("</preferences>");
- bw.newLine();
- }
-
- private void writeRoot() throws BackingStoreException, IOException {
- bw.write(" <root type=\"");
- if (prefs.isUserNode()) {
- bw.write("user");
- } else {
- bw.write("system");
- }
- bw.write("\"/>");
-
- writeRootMap();
- writeNode();
-
- bw.write(" </root>");
- bw.newLine();
- }
-
- private void writeRootMap() throws BackingStoreException, IOException {
- // Is it a root node?
- if(prefs.parent() == null && prefs.keys().length > 0) {
- bw.newLine();
- writeMap(prefs, 2);
- } else {
- bw.write("<map/>");
- bw.newLine();
- }
- }
-
- /**
- * Writes all the parents of the preferences node without any entries.
- * Returns the number of parents written, which has to be used as
- * argument to <code>writeCloseParents()</code> after writing the node
- * itself.
- */
- private int writeParents() throws IOException {
- int parents;
- String path = prefs.absolutePath();
- int lastslash = path.lastIndexOf("/");
- if (lastslash > 0) {
- path = path.substring(1, lastslash);
- StringTokenizer st = new StringTokenizer(path);
- parents = st.countTokens();
-
- System.out.println("path: " + path);
- System.out.println("parents: " + parents);
-
- for (int i=0; i<parents; i++) {
- String name = st.nextToken();
- indent(i+2);
- bw.write("<node name=\"" + name + "\">");
- bw.write("<map/>");
- bw.write("</node>");
- bw.newLine();
- }
- } else {
- parents = 0;
- }
-
- return parents;
- }
-
- private void writeCloseParents(int parents) throws IOException {
- while(parents > 0) {
- indent(parents+1);
- bw.write("</node>");
- bw.newLine();
- parents--;
- }
- }
-
- private void writeNode() throws BackingStoreException, IOException {
- int parents = writeParents();
- // root?
- int indent;
- if (prefs.parent() == null) {
- indent = parents+1;
- } else {
- indent = parents+2;
- }
- writeNode(prefs, indent);
- writeCloseParents(parents);
- }
-
- private void writeNode(Preferences node, int indent)
- throws BackingStoreException, IOException
- {
- // not root?
- if (node.parent() != null) {
- indent(indent);
- bw.write("<node name=\"" + node.name() + "\">");
- if (node.keys().length > 0) {
- bw.newLine();
- }
- writeMap(node, indent+1);
- }
-
- if (subtree) {
- String[] children = node.childrenNames();
- for (int i=0; i<children.length; i++) {
- Preferences child = node.node(children[i]);
- writeNode(child, indent+1);
- }
- }
-
- // not root?
- if (node.parent() != null) {
- indent(indent);
- bw.write("</node>");
- bw.newLine();
- }
- }
-
- private void writeMap(Preferences node, int indent)
- throws BackingStoreException, IOException
- {
- // construct String used for indentation
- StringBuffer indentBuffer = new StringBuffer(2*indent);
- for (int i=0; i < indent; i++)
- indentBuffer.append(" ");
- String indentString = indentBuffer.toString();
-
- if (node.keys().length > 0) {
- bw.write(indentString);
- bw.write("<map>");
- bw.newLine();
- writeEntries(node, indentString + " ");
- bw.write(indentString);
- bw.write("</map>");
- } else {
- bw.write("<map/>");
- }
- bw.newLine();
- }
-
- private void writeEntries(Preferences node, String indent)
- throws BackingStoreException, IOException
- {
- String[] keys = node.keys();
- for(int i = 0; i < keys.length; i++) {
- String value = node.get(keys[i], null);
- if (value == null) {
- throw new BackingStoreException("null value for key '"
- + keys[i] + "'");
- }
-
- bw.write(indent);
- bw.write("<entry key=\"" + keys[i] + "\""
- + " value=\"" + value + "\"/>");
- bw.newLine();
- }
- }
-
- private void indent(int x) throws IOException {
- for (int i=0; i<x; i++) {
- bw.write(" ");
- }
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/HTML_401F.java b/libjava/gnu/javax/swing/text/html/parser/HTML_401F.java
deleted file mode 100755
index 1ed42a2ab98..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/HTML_401F.java
+++ /dev/null
@@ -1,3729 +0,0 @@
-/* HTML_401F.java -- HTML 4.01 FRAMESET DTD java conception.
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser;
-
-import gnu.javax.swing.text.html.parser.models.PCDATAonly_model;
-import gnu.javax.swing.text.html.parser.models.TableRowContentModel;
-import gnu.javax.swing.text.html.parser.models.noTagModel;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-import javax.swing.text.html.parser.*;
-import javax.swing.text.html.parser.ContentModel;
-import javax.swing.text.html.parser.DTDConstants;
-
-/**
- * This class represents the java implementation of the HTML 4.01
- * ( -//W3C//DTD HTML 4.01 Frameset//EN ) Frameset version. The
- * Frameset version includes as recommended, as obsoleted features and
- * also the frameset support. This the default DTD to parse HTML
- * documents in this implementation, containing 315 pre-defined general
- * entities and 92 elements.
- *
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class HTML_401F
- extends gnuDTD
- implements DTDConstants, Serializable
-{
- private static final long serialVersionUID = 1;
-
- /**
- * The standard name of this DTD,
- * '-//W3C//DTD HTML 4.01 Frameset//EN'
- */
- public static final String DTD_NAME = "-//W3C//DTD HTML 4.01 Frameset//EN";
-
- /**
- * The integer representing length in pixels.
- */
- static final int PIXELS = NUMBER;
-
- static final String[] NONE = new String[0];
-
- /* Define the HTML tags. */
- static final String PCDATA = "#pcdata";
- static final String A = "a";
- static final String ABBR = "abbr";
- static final String ACRONYM = "acronym";
- static final String ADDRESS = "address";
- static final String APPLET = "applet";
- static final String AREA = "area";
- static final String B = "b";
- static final String BASE = "base";
- static final String BASEFONT = "basefont";
- static final String BDO = "bdo";
- static final String BIG = "big";
- static final String BLOCKQUOTE = "blockquote";
- static final String BODY = "body";
- static final String BR = "br";
- static final String BUTTON = "button";
- static final String CAPTION = "caption";
- static final String CENTER = "center";
- static final String CITE = "cite";
- static final String CODE = "code";
- static final String COL = "col";
- static final String COLGROUP = "colgroup";
- static final String DEFAULTS = "default";
- static final String DD = "dd";
- static final String DEL = "del";
- static final String DFN = "dfn";
- static final String DIR = "dir";
- static final String DIV = "div";
- static final String DL = "dl";
- static final String DT = "dt";
- static final String EM = "em";
- static final String FIELDSET = "fieldset";
- static final String FONT = "font";
- static final String FORM = "form";
- static final String FRAME = "frame";
- static final String FRAMESET = "frameset";
- static final String H1 = "h1";
- static final String H2 = "h2";
- static final String H3 = "h3";
- static final String H4 = "h4";
- static final String H5 = "h5";
- static final String H6 = "h6";
- static final String HEAD = "head";
- static final String HR = "hr";
- static final String HTML = "html";
- static final String I = "i";
- static final String IFRAME = "iframe";
- static final String IMG = "img";
- static final String INPUT = "input";
- static final String INS = "ins";
- static final String ISINDEX = "isindex";
- static final String KBD = "kbd";
- static final String LABEL = "label";
- static final String LEGEND = "legend";
- static final String LI = "li";
- static final String LINK = "link";
- static final String MAP = "map";
- static final String MENU = "menu";
- static final String META = "meta";
- static final String NOFRAMES = "noframes";
- static final String NOSCRIPT = "noscript";
- static final String NONES = "none";
- static final String sNAME = "name";
- static final String OBJECT = "object";
- static final String OL = "ol";
- static final String OPTGROUP = "optgroup";
- static final String OPTION = "option";
- static final String P = "p";
- static final String PARAM = "param";
- static final String PRE = "pre";
- static final String Q = "q";
- static final String S = "s";
- static final String SAMP = "samp";
- static final String SCRIPT = "script";
- static final String SELECT = "select";
- static final String SMALL = "small";
- static final String SPAN = "span";
- static final String STRIKE = "strike";
- static final String STRONG = "strong";
- static final String STYLE = "style";
- static final String SUB = "sub";
- static final String SUP = "sup";
- static final String TABLE = "table";
- static final String TBODY = "tbody";
- static final String TD = "td";
- static final String TEXTAREA = "textarea";
- static final String TFOOT = "tfoot";
- static final String TH = "th";
- static final String THEAD = "thead";
- static final String TITLE = "title";
- static final String TR = "tr";
- static final String TT = "tt";
- static final String U = "u";
- static final String UL = "ul";
- static final String VAR = "var";
-
- /* Define the attribute constants. */
- static final String C_0 = "0";
- static final String C_1 = "1";
- static final String CHECKBOX = "checkbox";
- static final String DATA = "data";
- static final String FILE = "file";
- static final String GET = "get";
- static final String HIDDEN = "hidden";
- static final String IMAGE = "image";
- static final String PASSWORD = "password";
- static final String POST = "post";
- static final String RADIO = "radio";
- static final String REF = "ref";
- static final String RESET = "reset";
- static final String SUBMIT = "submit";
- static final String TEXT = "text";
- static final String ABOVE = "above";
- static final String ACCEPT = "accept";
- static final String ACCEPTCHARSET = "accept-charset";
- static final String ACCESSKEY = "accesskey";
- static final String ACTION = "action";
- static final String ALIGN = "align";
- static final String ALINK = "alink";
- static final String ALL = "all";
- static final String ALT = "alt";
- static final String APPLICATION_X_WWW_FORM_URLENCODED
- = "application/x-www-form-urlencoded";
- static final String ARCHIVE = "archive";
- static final String AUTO = "auto";
- static final String AXIS = "axis";
- static final String BACKGROUND = "background";
- static final String BASELINE = "baseline";
- static final String BELOW = "below";
- static final String BGCOLOR = "bgcolor";
- static final String BORDER = "border";
- static final String BOTTOM = "bottom";
- static final String BOX = "box";
- static final String CELLPADDING = "cellpadding";
- static final String CELLSPACING = "cellspacing";
- static final String CHAR = "char";
- static final String CHAROFF = "charoff";
- static final String CHARSET = "charset";
- static final String CHECKED = "checked";
- static final String CIRCLE = "circle";
- static final String CLASS = "class";
- static final String CLASSID = "classid";
- static final String CLEAR = "clear";
- static final String CODEBASE = "codebase";
- static final String CODETYPE = "codetype";
- static final String COLOR = "color";
- static final String COLS = "cols";
- static final String COLSPAN = "colspan";
- static final String COMPACT = "compact";
- static final String CONTENT = "content";
- static final String COORDS = "coords";
- static final String DATAPAGESIZE = "datapagesize";
- static final String DATETIME = "datetime";
- static final String DECLARE = "declare";
- static final String DEFER = "defer";
- static final String DISABLED = "disabled";
- static final String DISC = "disc";
- static final String ENCTYPE = "enctype";
- static final String EVENT = "event";
- static final String FACE = "face";
- static final String FOR = "for";
- static final String FRAMEBORDER = "frameborder";
- static final String GROUPS = "groups";
- static final String HEADERS = "headers";
- static final String HEIGHT = "height";
- static final String HREF = "href";
- static final String HREFLANG = "hreflang";
- static final String HSIDES = "hsides";
- static final String HSPACE = "hspace";
- static final String HTTPEQUIV = "http-equiv";
- static final String sID = "id";
- static final String ISMAP = "ismap";
- static final String JUSTIFY = "justify";
- static final String LANG = "lang";
- static final String LANGUAGE = "language";
- static final String LEFT = "left";
- static final String LHS = "lhs";
- static final String LONGDESC = "longdesc";
- static final String LTR = "ltr";
- static final String MARGINHEIGHT = "marginheight";
- static final String MARGINWIDTH = "marginwidth";
- static final String MAXLENGTH = "maxlength";
- static final String MEDIA = "media";
- static final String METHOD = "method";
- static final String MIDDLE = "middle";
- static final String MULTIPLE = "multiple";
- static final String NO = "no";
- static final String NOHREF = "nohref";
- static final String NORESIZE = "noresize";
- static final String NOSHADE = "noshade";
- static final String NOWRAP = "nowrap";
- static final String ONBLUR = "onblur";
- static final String ONCHANGE = "onchange";
- static final String ONCLICK = "onclick";
- static final String ONDBLCLICK = "ondblclick";
- static final String ONFOCUS = "onfocus";
- static final String ONKEYDOWN = "onkeydown";
- static final String ONKEYPRESS = "onkeypress";
- static final String ONKEYUP = "onkeyup";
- static final String ONLOAD = "onload";
- static final String ONMOUSEDOWN = "onmousedown";
- static final String ONMOUSEMOVE = "onmousemove";
- static final String ONMOUSEOUT = "onmouseout";
- static final String ONMOUSEOVER = "onmouseover";
- static final String ONMOUSEUP = "onmouseup";
- static final String ONRESET = "onreset";
- static final String ONSELECT = "onselect";
- static final String ONSUBMIT = "onsubmit";
- static final String ONUNLOAD = "onunload";
- static final String POLY = "poly";
- static final String PROFILE = "profile";
- static final String PROMPT = "prompt";
- static final String READONLY = "readonly";
- static final String RECT = "rect";
- static final String REL = "rel";
- static final String REV = "rev";
- static final String RHS = "rhs";
- static final String RIGHT = "right";
- static final String ROW = "row";
- static final String ROWGROUP = "rowgroup";
- static final String ROWS = "rows";
- static final String ROWSPAN = "rowspan";
- static final String RTL = "rtl";
- static final String RULES = "rules";
- static final String SCHEME = "scheme";
- static final String SCOPE = "scope";
- static final String SCROLLING = "scrolling";
- static final String SELECTED = "selected";
- static final String SHAPE = "shape";
- static final String SIZE = "size";
- static final String SQUARE = "square";
- static final String SRC = "src";
- static final String STANDBY = "standby";
- static final String START = "start";
- static final String SUMMARY = "summary";
- static final String TABINDEX = "tabindex";
- static final String TARGET = "target";
- static final String TOP = "top";
- static final String TYPE = "type";
- static final String USEMAP = "usemap";
- static final String VALIGN = "valign";
- static final String VALUE = "value";
- static final String VALUETYPE = "valuetype";
- static final String VERSION = "version";
- static final String VLINK = "vlink";
- static final String VOID = "void";
- static final String VSIDES = "vsides";
- static final String VSPACE = "vspace";
- static final String WIDTH = "width";
- static final String YES = "yes";
-
- static final String[] BLOCK =
- new String[] {
- ADDRESS, BLOCKQUOTE, CENTER, DIR,
- DIV, DL, FIELDSET, FORM,
- H1, H2, H3, H4, H5, H6,
- HR, ISINDEX, MENU, NOFRAMES, NOSCRIPT,
- OL, P, PRE, TABLE, UL
- };
-
- /**
- * Creates this DTD, filling in the entities and attributes data
- * as defined in -//W3C//DTD HTML 4.01 Frameset//EN.
- */
- protected HTML_401F()
- {
- super(DTD_NAME);
- defineEntities();
- defineElements();
- }
-
- /**
- * Either takes the document (by name) from DTD table, or
- * creates a new instance and registers it in the tabe.
- * The document is registerd under name "-//W3C//DTD HTML 4.01 Frameset//EN".
- * @return The new or existing DTD for parsing HTML 4.01 Frameset.
- */
- public static DTD getInstance()
- {
- try
- {
- DTD dtd = getDTD(DTD_NAME);
- if (dtd == null || dtd.getClass().equals(DTD.class))
- {
- dtd = new HTML_401F();
- putDTDHash(DTD_NAME, dtd);
- }
- return dtd;
- }
- catch (IOException ex)
- {
- throw new Error("This should never happen. Report the bug.", ex);
- }
- }
-
- /**
- * Define all elements of this DTD.
- */
- protected void defineElements()
- {
- /* Define the elements. */
- defElement(PCDATA, 0, false, false, null, NONE, NONE,
- new AttributeList[ 0 ]);
-
- defElement(A, 0, false, false, null,
- new String[] {
- A
- }
- ,
- new String[] {
- PCDATA, ABBR, ACRONYM, APPLET,
- B, BASEFONT, BDO, BIG, BR,
- BUTTON, CITE, CODE, DFN, EM,
- FONT, I, IFRAME, IMG, INPUT,
- KBD, LABEL, MAP, OBJECT, Q,
- S, SAMP, SCRIPT, SELECT, SMALL,
- SPAN, STRIKE, STRONG, SUB, SUP,
- TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(CHARSET, null, null, 0, IMPLIED),
- attr(TYPE, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(HREF, null, null, 0, IMPLIED),
- attr(HREFLANG, null, null, 0, IMPLIED),
- attr(TARGET, null, null, 0, IMPLIED),
- attr(REL, null, null, 0, IMPLIED),
- attr(REV, null, null, 0, IMPLIED),
- attr(ACCESSKEY, null, null, 0, IMPLIED),
- attr(SHAPE, RECT, new String[] { RECT, CIRCLE, POLY, DEFAULTS },
- 0, DEFAULT),
- attr(COORDS, null, null, 0, IMPLIED),
- attr(TABINDEX, null, null, NUMBER, IMPLIED),
- attr(ONFOCUS, null, null, 0, IMPLIED),
- attr(ONBLUR, null, null, 0, IMPLIED)
- }
- );
- defElement(ABBR, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(ACRONYM, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(ADDRESS, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- P
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(APPLET, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL, PARAM
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(CODEBASE, null, null, 0, IMPLIED),
- attr(ARCHIVE, null, null, 0, IMPLIED),
- attr(CODE, null, null, 0, IMPLIED),
- attr(OBJECT, null, null, 0, IMPLIED),
- attr(ALT, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(WIDTH, null, null, 0, REQUIRED),
- attr(HEIGHT, null, null, 0, REQUIRED),
- attr(ALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, LEFT, RIGHT },
- 0, IMPLIED),
- attr(HSPACE, null, null, 0, IMPLIED),
- attr(VSPACE, null, null, 0, IMPLIED)
- }
- );
- defElement(AREA, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(SHAPE, RECT, new String[] { RECT, CIRCLE, POLY, DEFAULTS },
- 0, DEFAULT),
- attr(COORDS, null, null, 0, IMPLIED),
- attr(HREF, null, null, 0, IMPLIED),
- attr(TARGET, null, null, 0, IMPLIED),
- attr(NOHREF, null, new String[] { NOHREF }, 0, IMPLIED),
- attr(ALT, null, null, 0, REQUIRED),
- attr(TABINDEX, null, null, NUMBER, IMPLIED),
- attr(ACCESSKEY, null, null, 0, IMPLIED),
- attr(ONFOCUS, null, null, 0, IMPLIED),
- attr(ONBLUR, null, null, 0, IMPLIED)
- }
- );
- defElement(B, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(BASE, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(HREF, null, null, 0, IMPLIED),
- attr(TARGET, null, null, 0, IMPLIED)
- }
- );
- defElement(BASEFONT, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(SIZE, null, null, 0, REQUIRED),
- attr(COLOR, null, null, 0, IMPLIED),
- attr(FACE, null, null, 0, IMPLIED)
- }
- );
- defElement(BDO, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, REQUIRED)
- }
- );
- defElement(BIG, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(BLOCKQUOTE, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(CITE, null, null, 0, IMPLIED)
- }
- );
- defElement(BODY, 0, true, true, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DEL, DIR,
- DIV, DL, FIELDSET, FORM, H1,
- H2, H3, H4, H5, H6,
- HR, INS, ISINDEX, MENU, NOFRAMES,
- NOSCRIPT, OL, P, PRE, TABLE,
- UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ONLOAD, null, null, 0, IMPLIED),
- attr(ONUNLOAD, null, null, 0, IMPLIED),
- attr(BACKGROUND, null, null, 0, IMPLIED),
- attr(BGCOLOR, null, null, 0, IMPLIED),
- attr(TEXT, null, null, 0, IMPLIED),
- attr(LINK, null, null, 0, IMPLIED),
- attr(VLINK, null, null, 0, IMPLIED),
- attr(ALINK, null, null, 0, IMPLIED)
- }
- );
- defElement(BR, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(CLEAR, "NONE", new String[] { LEFT, ALL, RIGHT, NONES },
- 0, DEFAULT)
- }
- );
- defElement(BUTTON, 0, false, false, null,
- new String[] {
- A, BUTTON, IFRAME, INPUT,
- LABEL, SELECT, TEXTAREA, FIELDSET, FORM,
- ISINDEX
- }
- ,
- new String[] {
- PCDATA, ABBR, ACRONYM, APPLET,
- B, BASEFONT, BDO, BIG, BR,
- CITE, CODE, DFN, EM, FONT,
- I, IMG, KBD, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SMALL,
- SPAN, STRIKE, STRONG, SUB, SUP,
- TT, U, VAR, ADDRESS, BLOCKQUOTE,
- CENTER, DIR, DIV, DL, H1,
- H2, H3, H4, H5, H6,
- HR, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(VALUE, null, null, 0, IMPLIED),
- attr(TYPE, SUBMIT, new String[] { BUTTON, SUBMIT, RESET }, 0, DEFAULT),
- attr(DISABLED, null, new String[] { DISABLED }, 0, IMPLIED),
- attr(TABINDEX, null, null, NUMBER, IMPLIED),
- attr(ACCESSKEY, null, null, 0, IMPLIED),
- attr(ONFOCUS, null, null, 0, IMPLIED),
- attr(ONBLUR, null, null, 0, IMPLIED)
- }
- );
- defElement(CAPTION, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { TOP, BOTTOM, LEFT, RIGHT },
- 0, IMPLIED)
- }
- );
- defElement(CENTER, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(CITE, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(CODE, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(COL, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(SPAN, C_1, null, NUMBER, DEFAULT),
- attr(WIDTH, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY, CHAR },
- 0, IMPLIED),
- attr(CHAR, null, null, 0, IMPLIED),
- attr(CHAROFF, null, null, 0, IMPLIED),
- attr(VALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, BASELINE },
- 0, IMPLIED)
- }
- );
- defElement(COLGROUP, 0, false, true, null,
- NONE
- ,
- new String[] {
- COL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(SPAN, C_1, null, NUMBER, DEFAULT),
- attr(WIDTH, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY, CHAR },
- 0, IMPLIED),
- attr(CHAR, null, null, 0, IMPLIED),
- attr(CHAROFF, null, null, 0, IMPLIED),
- attr(VALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, BASELINE },
- 0, IMPLIED)
- }
- );
- defElement(DD, 0, false, true, new ContentModel(0,
- new noTagModel( new String[] { DD, DT } ), null ),
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(DEL, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(CITE, null, null, 0, IMPLIED),
- attr(DATETIME, null, null, 0, IMPLIED)
- }
- );
- defElement(DFN, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(DIR, 0, false, false, createListModel(),
- new String[] {
- ADDRESS, BLOCKQUOTE, CENTER, DIR,
- DIV, DL, FIELDSET, FORM, H1,
- H2, H3, H4, H5, H6,
- HR, ISINDEX, MENU, NOFRAMES, NOSCRIPT,
- OL, P, PRE, TABLE, UL
- }
- ,
- new String[] {
- LI, UL, OL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(COMPACT, null, new String[] { COMPACT }, 0, IMPLIED)
- }
- );
- defElement(DIV, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY },
- 0, IMPLIED)
- }
- );
- defElement(DL, 0, false, false, createDefListModel(),
- NONE
- ,
- new String[] {
- DD, DT
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(COMPACT, null, new String[] { COMPACT }, 0, IMPLIED)
- }
- );
- defElement(DT, 0, false, true,
- new ContentModel(0,
- new noTagModel( new String[] { DT, DD } ), null),
- BLOCK
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(EM, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(FIELDSET, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL, LEGEND
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(FONT, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(SIZE, null, null, 0, IMPLIED),
- attr(COLOR, null, null, 0, IMPLIED),
- attr(FACE, null, null, 0, IMPLIED)
- }
- );
- defElement(FORM, 0, false, false, null,
- new String[] {
- FORM
- }
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, H1, H2, H3,
- H4, H5, H6, HR, ISINDEX,
- MENU, NOFRAMES, NOSCRIPT, OL, P,
- PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ACTION, null, null, 0, REQUIRED),
- attr(METHOD, GET, new String[] { GET, POST }, 0, DEFAULT),
- attr(ENCTYPE, APPLICATION_X_WWW_FORM_URLENCODED, null, 0, DEFAULT),
- attr(ACCEPT, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(ONSUBMIT, null, null, 0, IMPLIED),
- attr(ONRESET, null, null, 0, IMPLIED),
- attr(TARGET, null, null, 0, IMPLIED),
- attr(ACCEPTCHARSET, null, null, 0, IMPLIED)
- }
- );
- defElement(FRAME, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LONGDESC, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(SRC, null, null, 0, IMPLIED),
- attr(FRAMEBORDER, C_1, new String[] { C_1, C_0 }, 0, DEFAULT),
- attr(MARGINWIDTH, null, null, PIXELS, IMPLIED),
- attr(MARGINHEIGHT, null, null, PIXELS, IMPLIED),
- attr(NORESIZE, null, new String[] { NORESIZE }, 0, IMPLIED),
- attr(SCROLLING, AUTO, new String[] { YES, NO, AUTO }, 0, DEFAULT)
- }
- );
- defElement(FRAMESET, 0, false, false, null,
- NONE
- ,
- new String[] {
- NOFRAMES, FRAME, FRAMESET
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(ROWS, null, null, 0, IMPLIED),
- attr(COLS, null, null, 0, IMPLIED),
- attr(ONLOAD, null, null, 0, IMPLIED),
- attr(ONUNLOAD, null, null, 0, IMPLIED)
- }
- );
- defElement(H1, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY },
- 0, IMPLIED)
- }
- );
- defElement(H2, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY },
- 0, IMPLIED)
- }
- );
- defElement(H3, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY },
- 0, IMPLIED)
- }
- );
- defElement(H4, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY },
- 0, IMPLIED)
- }
- );
- defElement(H5, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY },
- 0, IMPLIED)
- }
- );
- defElement(H6, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY },
- 0, IMPLIED)
- }
- );
- defElement(HEAD, 0, true, true, null,
- new String[] {
- BODY
- }
- ,
- new String[] {
- TITLE, ISINDEX, BASE,
- SCRIPT, STYLE, META, LINK, OBJECT
- }
- ,
- new AttributeList[] {
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(PROFILE, null, null, 0, IMPLIED)
- }
- );
-
- defElement(HR, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT }, 0, IMPLIED),
- attr(NOSHADE, null, new String[] { NOSHADE }, 0, IMPLIED),
- attr(SIZE, null, null, 0, IMPLIED),
- attr(WIDTH, null, null, 0, IMPLIED)
- }
- );
- defElement(HTML, 0, true, true, createHtmlContentModel(),
- NONE
- ,
- new String[] {
- HEAD, BODY
- }
- ,
- new AttributeList[] {
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(VERSION, DTD_NAME, null, 0, FIXED)
- }
- );
- defElement(I, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(IFRAME, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LONGDESC, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(SRC, null, null, 0, IMPLIED),
- attr(FRAMEBORDER, C_1, new String[] { C_1, C_0 }, 0, DEFAULT),
- attr(MARGINWIDTH, null, null, PIXELS, IMPLIED),
- attr(MARGINHEIGHT, null, null, PIXELS, IMPLIED),
- attr(SCROLLING, AUTO, new String[] { YES, NO, AUTO }, 0, DEFAULT),
- attr(ALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, LEFT, RIGHT },
- 0, IMPLIED),
- attr(HEIGHT, null, null, 0, IMPLIED),
- attr(WIDTH, null, null, 0, IMPLIED)
- }
- );
- defElement(IMG, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(SRC, null, null, 0, REQUIRED),
- attr(ALT, null, null, 0, REQUIRED),
- attr(LONGDESC, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(HEIGHT, null, null, 0, IMPLIED),
- attr(WIDTH, null, null, 0, IMPLIED),
- attr(USEMAP, null, null, 0, IMPLIED),
- attr(ISMAP, null, new String[] { ISMAP }, 0, IMPLIED),
- attr(ALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, LEFT, RIGHT },
- 0, IMPLIED),
- attr(BORDER, null, null, PIXELS, IMPLIED),
- attr(HSPACE, null, null, 0, IMPLIED),
- attr(VSPACE, null, null, 0, IMPLIED)
- }
- );
- defElement(INPUT, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(TYPE, TEXT, new String[] { TEXT, PASSWORD, CHECKBOX, RADIO,
- SUBMIT, RESET, FILE, HIDDEN, IMAGE, BUTTON }, 0, DEFAULT),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(VALUE, null, null, 0, IMPLIED),
- attr(CHECKED, null, new String[] { CHECKED }, 0, IMPLIED),
- attr(DISABLED, null, new String[] { DISABLED }, 0, IMPLIED),
- attr(READONLY, null, new String[] { READONLY }, 0, IMPLIED),
- attr(SIZE, null, null, 0, IMPLIED),
- attr(MAXLENGTH, null, null, 0, IMPLIED),
- attr(SRC, null, null, 0, IMPLIED),
- attr(ALT, null, null, 0, IMPLIED),
- attr(USEMAP, null, null, 0, IMPLIED),
- attr(ISMAP, null, new String[] { ISMAP }, 0, IMPLIED),
- attr(TABINDEX, null, null, NUMBER, IMPLIED),
- attr(ACCESSKEY, null, null, 0, IMPLIED),
- attr(ONFOCUS, null, null, 0, IMPLIED),
- attr(ONBLUR, null, null, 0, IMPLIED),
- attr(ONSELECT, null, null, 0, IMPLIED),
- attr(ONCHANGE, null, null, 0, IMPLIED),
- attr(ACCEPT, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, LEFT, RIGHT },
- 0, IMPLIED)
- }
- );
- defElement(INS, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(CITE, null, null, 0, IMPLIED),
- attr(DATETIME, null, null, 0, IMPLIED)
- }
- );
- defElement(ISINDEX, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(PROMPT, null, null, 0, IMPLIED)
- }
- );
- defElement(KBD, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(LABEL, 0, false, false, null,
- new String[] {
- LABEL
- }
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, MAP, OBJECT, Q,
- S, SAMP, SCRIPT, SELECT, SMALL,
- SPAN, STRIKE, STRONG, SUB, SUP,
- TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(FOR, null, null, 0, IMPLIED),
- attr(ACCESSKEY, null, null, 0, IMPLIED),
- attr(ONFOCUS, null, null, 0, IMPLIED),
- attr(ONBLUR, null, null, 0, IMPLIED)
- }
- );
- defElement(LEGEND, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ACCESSKEY, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { TOP, BOTTOM, LEFT, RIGHT },
- 0, IMPLIED)
- }
- );
- // LI has a special content model that will be resolved into
- // by transformer.
- defElement(LI, 0, false, true,
- new ContentModel(0,
- new noTagModel(LI), null),
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(TYPE, null, null, 0, IMPLIED),
- attr(VALUE, null, null, NUMBER, IMPLIED)
- }
- );
- defElement(LINK, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(CHARSET, null, null, 0, IMPLIED),
- attr(HREF, null, null, 0, IMPLIED),
- attr(HREFLANG, null, null, 0, IMPLIED),
- attr(TYPE, null, null, 0, IMPLIED),
- attr(REL, null, null, 0, IMPLIED),
- attr(REV, null, null, 0, IMPLIED),
- attr(MEDIA, null, null, 0, IMPLIED),
- attr(TARGET, null, null, 0, IMPLIED)
- }
- );
- defElement(MAP, 0, false, false, null,
- NONE
- ,
- new String[] {
- ADDRESS, BLOCKQUOTE, CENTER, DIR,
- DIV, DL, FIELDSET, FORM, H1,
- H2, H3, H4, H5, H6,
- HR, ISINDEX, MENU, NOFRAMES, NOSCRIPT,
- OL, P, PRE, TABLE, UL,
- AREA
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, REQUIRED)
- }
- );
- defElement(MENU, 0, false, false, createListModel(),
- new String[] {
- ADDRESS, BLOCKQUOTE, CENTER, DIR,
- DIV, DL, FIELDSET, FORM, H1,
- H2, H3, H4, H5, H6,
- HR, ISINDEX, MENU, NOFRAMES, NOSCRIPT,
- OL, P, PRE, TABLE, UL
- }
- ,
- new String[] {
- LI, UL, OL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(COMPACT, null, new String[] { COMPACT }, 0, IMPLIED)
- }
- );
- defElement(META, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(HTTPEQUIV, null, null, 0, IMPLIED),
- attr(sNAME, null, null, NAME, IMPLIED),
- attr(CONTENT, null, null, 0, REQUIRED),
- attr(SCHEME, null, null, 0, IMPLIED)
- }
- );
- defElement(NOFRAMES, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(NOSCRIPT, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(OBJECT, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL, PARAM
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(DECLARE, null, new String[] { DECLARE }, 0, IMPLIED),
- attr(CLASSID, null, null, 0, IMPLIED),
- attr(CODEBASE, null, null, 0, IMPLIED),
- attr(DATA, null, null, 0, IMPLIED),
- attr(TYPE, null, null, 0, IMPLIED),
- attr(CODETYPE, null, null, 0, IMPLIED),
- attr(ARCHIVE, null, null, 0, IMPLIED),
- attr(STANDBY, null, null, 0, IMPLIED),
- attr(HEIGHT, null, null, 0, IMPLIED),
- attr(WIDTH, null, null, 0, IMPLIED),
- attr(USEMAP, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(TABINDEX, null, null, NUMBER, IMPLIED),
- attr(ALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, LEFT, RIGHT },
- 0, IMPLIED),
- attr(BORDER, null, null, PIXELS, IMPLIED),
- attr(HSPACE, null, null, 0, IMPLIED),
- attr(VSPACE, null, null, 0, IMPLIED)
- }
- );
- defElement(OL, 0, false, false, createListModel(),
- NONE
- ,
- new String[] {
- // See note on the createListModel method
- LI, UL, OL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(TYPE, null, null, 0, IMPLIED),
- attr(COMPACT, null, new String[] { COMPACT }, 0, IMPLIED),
- attr(START, null, null, 0, IMPLIED)
- }
- );
- defElement(OPTGROUP, 0, false, false, null,
- NONE
- ,
- new String[] {
- OPTION
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(DISABLED, null, new String[] { DISABLED }, 0, IMPLIED),
- attr(LABEL, null, null, 0, REQUIRED)
- }
- );
- defElement(OPTION, 0, false, true, new ContentModel(0,
- new PCDATAonly_model(), null),
- NONE,
- new String[] {
- PCDATA
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(SELECTED, null, new String[] { SELECTED }, 0, IMPLIED),
- attr(DISABLED, null, new String[] { DISABLED }, 0, IMPLIED),
- attr(LABEL, null, null, 0, IMPLIED),
- attr(VALUE, null, null, 0, IMPLIED)
- }
- );
- defElement(P, 0, false, true, new ContentModel( 0,
- new noTagModel(P), null),
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY },
- 0, IMPLIED)
- }
- );
- defElement(PARAM, EMPTY, false, true, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(sNAME, null, null, 0, REQUIRED),
- attr(VALUE, null, null, 0, IMPLIED),
- attr(VALUETYPE, DATA, new String[] { DATA, REF, OBJECT }, 0, DEFAULT),
- attr(TYPE, null, null, 0, IMPLIED)
- }
- );
- defElement(PRE, 0, false, false, null,
- new String[] {
- APPLET, BASEFONT, BIG, FONT,
- IMG, OBJECT, SMALL, SUB, SUP
- }
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- B, BDO, BR, BUTTON, CITE,
- CODE, DFN, EM, I, IFRAME,
- INPUT, KBD, LABEL, MAP, Q,
- S, SAMP, SCRIPT, SELECT, SPAN,
- STRIKE, STRONG, TEXTAREA, TT, U,
- VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(WIDTH, null, null, NUMBER, IMPLIED)
- }
- );
- defElement(Q, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(CITE, null, null, 0, IMPLIED)
- }
- );
- defElement(S, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(SAMP, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(SCRIPT, CDATA, false, false, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(CHARSET, null, null, 0, IMPLIED),
- attr(TYPE, null, null, 0, REQUIRED),
- attr(LANGUAGE, null, null, 0, IMPLIED),
- attr(SRC, null, null, 0, IMPLIED),
- attr(DEFER, null, new String[] { DEFER }, 0, IMPLIED),
- attr(EVENT, null, null, 0, IMPLIED),
- attr(FOR, null, null, 0, IMPLIED)
- }
- );
- defElement(SELECT, 0, false, false, null,
- NONE
- ,
- new String[] {
- OPTGROUP, OPTION
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(SIZE, null, null, NUMBER, IMPLIED),
- attr(MULTIPLE, null, new String[] { MULTIPLE }, 0, IMPLIED),
- attr(DISABLED, null, new String[] { DISABLED }, 0, IMPLIED),
- attr(TABINDEX, null, null, NUMBER, IMPLIED),
- attr(ONFOCUS, null, null, 0, IMPLIED),
- attr(ONBLUR, null, null, 0, IMPLIED),
- attr(ONCHANGE, null, null, 0, IMPLIED)
- }
- );
- defElement(SMALL, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(SPAN, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(STRIKE, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(STRONG, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(STYLE, CDATA, false, false, null,
- NONE
- ,
- NONE
- ,
- new AttributeList[] {
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(TYPE, null, null, 0, REQUIRED),
- attr(MEDIA, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED)
- }
- );
- defElement(SUB, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(SUP, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(TABLE, 0, false, false, createTableContentModel(),
- NONE
- ,
- new String[] {
- CAPTION, COL, COLGROUP, TBODY,
- TFOOT, THEAD
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(SUMMARY, null, null, 0, IMPLIED),
- attr(WIDTH, null, null, 0, IMPLIED),
- attr(BORDER, null, null, PIXELS, IMPLIED),
- attr(FRAME, null, new String[] { VOID, ABOVE, BELOW, HSIDES, LHS, RHS,
- VSIDES, BOX, BORDER }, 0, IMPLIED),
- attr(RULES, null, new String[] { NONES, GROUPS, ROWS, COLS, ALL },
- 0, IMPLIED),
- attr(CELLSPACING, null, null, 0, IMPLIED),
- attr(CELLPADDING, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT }, 0, IMPLIED),
- attr(BGCOLOR, null, null, 0, IMPLIED),
- attr(DATAPAGESIZE, null, null, 0, IMPLIED)
- }
- );
- defElement(TBODY, 0, true, true, model(TR,'+'),
- NONE
- ,
- new String[] {
- TR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY, CHAR },
- 0, IMPLIED),
- attr(CHAR, null, null, 0, IMPLIED),
- attr(CHAROFF, null, null, 0, IMPLIED),
- attr(VALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, BASELINE },
- 0, IMPLIED)
- }
- );
-
- defElement(TD, 0, false, true,
- new ContentModel(0,
- new noTagModel(new String[] {"TD", "TH", "TR" } ), null),
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ABBR, null, null, 0, IMPLIED),
- attr(AXIS, null, null, 0, IMPLIED),
- attr(HEADERS, null, null, 0, IMPLIED),
- attr(SCOPE, null, new String[] { ROW, COL, ROWGROUP, COLGROUP },
- 0, IMPLIED),
- attr(ROWSPAN, C_1, null, NUMBER, DEFAULT),
- attr(COLSPAN, C_1, null, NUMBER, DEFAULT),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY, CHAR },
- 0, IMPLIED),
- attr(CHAR, null, null, 0, IMPLIED),
- attr(CHAROFF, null, null, 0, IMPLIED),
- attr(VALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, BASELINE },
- 0, IMPLIED),
- attr(NOWRAP, null, new String[] { NOWRAP }, 0, IMPLIED),
- attr(BGCOLOR, null, null, 0, IMPLIED),
- attr(WIDTH, null, null, 0, IMPLIED),
- attr(HEIGHT, null, null, 0, IMPLIED)
- }
- );
- defElement(TEXTAREA, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(sNAME, null, null, 0, IMPLIED),
- attr(ROWS, null, null, NUMBER, REQUIRED),
- attr(COLS, null, null, NUMBER, REQUIRED),
- attr(DISABLED, null, new String[] { DISABLED }, 0, IMPLIED),
- attr(READONLY, null, new String[] { READONLY }, 0, IMPLIED),
- attr(TABINDEX, null, null, NUMBER, IMPLIED),
- attr(ACCESSKEY, null, null, 0, IMPLIED),
- attr(ONFOCUS, null, null, 0, IMPLIED),
- attr(ONBLUR, null, null, 0, IMPLIED),
- attr(ONSELECT, null, null, 0, IMPLIED),
- attr(ONCHANGE, null, null, 0, IMPLIED)
- }
- );
- defElement(TFOOT, 0, false, true, model(TR,'+'),
- NONE
- ,
- new String[] {
- TR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY, CHAR },
- 0, IMPLIED),
- attr(CHAR, null, null, 0, IMPLIED),
- attr(CHAROFF, null, null, 0, IMPLIED),
- attr(VALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, BASELINE },
- 0, IMPLIED)
- }
- );
- defElement(TH, 0, false, true, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR,
- ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
- DL, FIELDSET, FORM, H1, H2,
- H3, H4, H5, H6, HR,
- ISINDEX, MENU, NOFRAMES, NOSCRIPT, OL,
- P, PRE, TABLE, UL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ABBR, null, null, 0, IMPLIED),
- attr(AXIS, null, null, 0, IMPLIED),
- attr(HEADERS, null, null, 0, IMPLIED),
- attr(SCOPE, null, new String[] { ROW, COL, ROWGROUP, COLGROUP },
- 0, IMPLIED),
- attr(ROWSPAN, C_1, null, NUMBER, DEFAULT),
- attr(COLSPAN, C_1, null, NUMBER, DEFAULT),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY, CHAR },
- 0, IMPLIED),
- attr(CHAR, null, null, 0, IMPLIED),
- attr(CHAROFF, null, null, 0, IMPLIED),
- attr(VALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, BASELINE },
- 0, IMPLIED),
- attr(NOWRAP, null, new String[] { NOWRAP }, 0, IMPLIED),
- attr(BGCOLOR, null, null, 0, IMPLIED),
- attr(WIDTH, null, null, 0, IMPLIED),
- attr(HEIGHT, null, null, 0, IMPLIED)
- }
- );
- defElement(THEAD, 0, false, true, model(TR,'+'),
- NONE
- ,
- new String[] {
- TR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY, CHAR },
- 0, IMPLIED),
- attr(CHAR, null, null, 0, IMPLIED),
- attr(CHAROFF, null, null, 0, IMPLIED),
- attr(VALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, BASELINE },
- 0, IMPLIED)
- }
- );
- defElement(TITLE, 0, false, false, null,
- new String[] {
- OBJECT, SCRIPT, LINK, META,
- STYLE
- }
- ,
- new String[] {
- PCDATA
- }
- ,
- new AttributeList[] {
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED)
- }
- );
- defElement(TR, 0, false, true,
- new ContentModel(0, new TableRowContentModel(this), null),
- NONE
- ,
- new String[] {
- TD, TH
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(ALIGN, null, new String[] { LEFT, CENTER, RIGHT, JUSTIFY, CHAR },
- 0, IMPLIED),
- attr(CHAR, null, null, 0, IMPLIED),
- attr(CHAROFF, null, null, 0, IMPLIED),
- attr(VALIGN, null, new String[] { TOP, MIDDLE, BOTTOM, BASELINE },
- 0, IMPLIED),
- attr(BGCOLOR, null, null, 0, IMPLIED)
- }
- );
- defElement(TT, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(U, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
- defElement(UL, 0, false, false, createListModel(),
- NONE
- ,
- new String[] {
- // See note on the createListModel method
- LI, UL, OL
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED),
- attr(TYPE, null, new String[] { DISC, SQUARE, CIRCLE }, 0, IMPLIED),
- attr(COMPACT, null, new String[] { COMPACT }, 0, IMPLIED)
- }
- );
- defElement(VAR, 0, false, false, null,
- NONE
- ,
- new String[] {
- PCDATA, A, ABBR, ACRONYM,
- APPLET, B, BASEFONT, BDO, BIG,
- BR, BUTTON, CITE, CODE, DFN,
- EM, FONT, I, IFRAME, IMG,
- INPUT, KBD, LABEL, MAP, OBJECT,
- Q, S, SAMP, SCRIPT, SELECT,
- SMALL, SPAN, STRIKE, STRONG, SUB,
- SUP, TEXTAREA, TT, U, VAR
- }
- ,
- new AttributeList[] {
- attr(sID, null, null, ID, IMPLIED),
- attr(CLASS, null, null, 0, IMPLIED),
- attr(STYLE, null, null, 0, IMPLIED),
- attr(TITLE, null, null, 0, IMPLIED),
- attr(LANG, null, null, 0, IMPLIED),
- attr(DIR, null, new String[] { LTR, RTL }, 0, IMPLIED),
- attr(ONCLICK, null, null, 0, IMPLIED),
- attr(ONDBLCLICK, null, null, 0, IMPLIED),
- attr(ONMOUSEDOWN, null, null, 0, IMPLIED),
- attr(ONMOUSEUP, null, null, 0, IMPLIED),
- attr(ONMOUSEOVER, null, null, 0, IMPLIED),
- attr(ONMOUSEMOVE, null, null, 0, IMPLIED),
- attr(ONMOUSEOUT, null, null, 0, IMPLIED),
- attr(ONKEYPRESS, null, null, 0, IMPLIED),
- attr(ONKEYDOWN, null, null, 0, IMPLIED),
- attr(ONKEYUP, null, null, 0, IMPLIED)
- }
- );
-
- }
-
- /**
- * Define all entities in this DTD.
- */
- protected void defineEntities()
- {
- /* Define general entities */
- defineEntity("AElig", 198);
- defineEntity("Aacute", 193);
- defineEntity("Acirc", 194);
- defineEntity("Agrave", 192);
- defineEntity("Alpha", 913);
- defineEntity("Aring", 197);
- defineEntity("Atilde", 195);
- defineEntity("Auml", 196);
- defineEntity("Beta", 914);
- defineEntity("Ccedil", 199);
- defineEntity("Chi", 935);
- defineEntity("Dagger", 8225);
- defineEntity("Delta", 916);
- defineEntity("ETH", 208);
- defineEntity("Eacute", 201);
- defineEntity("Ecirc", 202);
- defineEntity("Egrave", 200);
- defineEntity("Epsilon", 917);
- defineEntity("Eta", 919);
- defineEntity("Euml", 203);
- defineEntity("Gamma", 915);
- defineEntity("Iacute", 205);
- defineEntity("Icirc", 206);
- defineEntity("Igrave", 204);
- defineEntity("Iota", 921);
- defineEntity("Iuml", 207);
- defineEntity("Kappa", 922);
- defineEntity("Lambda", 923);
- defineEntity("Mu", 924);
- defineEntity("Ntilde", 209);
- defineEntity("Nu", 925);
- defineEntity("OElig", 338);
- defineEntity("Oacute", 211);
- defineEntity("Ocirc", 212);
- defineEntity("Ograve", 210);
- defineEntity("Omega", 937);
- defineEntity("Omicron", 927);
- defineEntity("Oslash", 216);
- defineEntity("Otilde", 213);
- defineEntity("Ouml", 214);
- defineEntity("Phi", 934);
- defineEntity("Pi", 928);
- defineEntity("Prime", 8243);
- defineEntity("Psi", 936);
- defineEntity("Rho", 929);
- defineEntity("Scaron", 352);
- defineEntity("Sigma", 931);
- defineEntity("THORN", 222);
- defineEntity("Tau", 932);
- defineEntity("Theta", 920);
- defineEntity("Uacute", 218);
- defineEntity("Ucirc", 219);
- defineEntity("Ugrave", 217);
- defineEntity("Upsilon", 933);
- defineEntity("Uuml", 220);
- defineEntity("Xi", 926);
- defineEntity("Yacute", 221);
- defineEntity("Yuml", 376);
- defineEntity("Zeta", 918);
- defineEntity("aacute", 225);
- defineEntity("acirc", 226);
- defineEntity("acute", 180);
- defineEntity("aelig", 230);
- defineEntity("agrave", 224);
- defineEntity("alefsym", 8501);
- defineEntity("alpha", 945);
- defineEntity("amp", 38);
- defineEntity("and", 8743);
- defineEntity("ang", 8736);
- defineEntity("aring", 229);
- defineEntity("asymp", 8776);
- defineEntity("atilde", 227);
- defineEntity("auml", 228);
- defineEntity("bdquo", 8222);
- defineEntity("beta", 946);
- defineEntity("brvbar", 166);
- defineEntity("bull", 8226);
- defineEntity("cap", 8745);
- defineEntity("ccedil", 231);
- defineEntity("cedil", 184);
- defineEntity("cent", 162);
- defineEntity("chi", 967);
- defineEntity("circ", 710);
- defineEntity("clubs", 9827);
- defineEntity("cong", 8773);
- defineEntity("copy", 169);
- defineEntity("crarr", 8629);
- defineEntity("cup", 8746);
- defineEntity("curren", 164);
- defineEntity("dArr", 8659);
- defineEntity("dagger", 8224);
- defineEntity("darr", 8595);
- defineEntity("deg", 176);
- defineEntity("delta", 948);
- defineEntity("diams", 9830);
- defineEntity("divide", 247);
- defineEntity("eacute", 233);
- defineEntity("ecirc", 234);
- defineEntity("egrave", 232);
- defineEntity("empty", 8709);
- defineEntity("emsp", 8195);
- defineEntity("ensp", 8194);
- defineEntity("epsilon", 949);
- defineEntity("equiv", 8801);
- defineEntity("eta", 951);
- defineEntity("eth", 240);
- defineEntity("euml", 235);
- defineEntity("euro", 8364);
- defineEntity("exist", 8707);
- defineEntity("fnof", 402);
- defineEntity("forall", 8704);
- defineEntity("frac12", 189);
- defineEntity("frac14", 188);
- defineEntity("frac34", 190);
- defineEntity("frasl", 8260);
- defineEntity("gamma", 947);
- defineEntity("ge", 8805);
- defineEntity("gt", 62);
- defineEntity("hArr", 8660);
- defineEntity("harr", 8596);
- defineEntity("hearts", 9829);
- defineEntity("hellip", 8230);
- defineEntity("iacute", 237);
- defineEntity("icirc", 238);
- defineEntity("iexcl", 161);
- defineEntity("igrave", 236);
- defineEntity("image", 8465);
- defineEntity("infin", 8734);
- defineEntity("int", 8747);
- defineEntity("iota", 953);
- defineEntity("iquest", 191);
- defineEntity("isin", 8712);
- defineEntity("iuml", 239);
- defineEntity("kappa", 954);
- defineEntity("lArr", 8656);
- defineEntity("lambda", 955);
- defineEntity("lang", 9001);
- defineEntity("laquo", 171);
- defineEntity("larr", 8592);
- defineEntity("lceil", 8968);
- defineEntity("ldquo", 8220);
- defineEntity("le", 8804);
- defineEntity("lfloor", 8970);
- defineEntity("lowast", 8727);
- defineEntity("loz", 9674);
- defineEntity("lrm", 8206);
- defineEntity("lsaquo", 8249);
- defineEntity("lsquo", 8216);
- defineEntity("lt", 60);
- defineEntity("macr", 175);
- defineEntity("mdash", 8212);
- defineEntity("micro", 181);
- defineEntity("middot", 183);
- defineEntity("minus", 8722);
- defineEntity("mu", 956);
- defineEntity("nabla", 8711);
- defineEntity("nbsp", 160);
- defineEntity("ndash", 8211);
- defineEntity("ne", 8800);
- defineEntity("ni", 8715);
- defineEntity("not", 172);
- defineEntity("notin", 8713);
- defineEntity("nsub", 8836);
- defineEntity("ntilde", 241);
- defineEntity("nu", 957);
- defineEntity("oacute", 243);
- defineEntity("ocirc", 244);
- defineEntity("oelig", 339);
- defineEntity("ograve", 242);
- defineEntity("oline", 8254);
- defineEntity("omega", 969);
- defineEntity("omicron", 959);
- defineEntity("oplus", 8853);
- defineEntity("or", 8744);
- defineEntity("ordf", 170);
- defineEntity("ordm", 186);
- defineEntity("oslash", 248);
- defineEntity("otilde", 245);
- defineEntity("otimes", 8855);
- defineEntity("ouml", 246);
- defineEntity("para", 182);
- defineEntity("part", 8706);
- defineEntity("permil", 8240);
- defineEntity("perp", 8869);
- defineEntity("phi", 966);
- defineEntity("pi", 960);
- defineEntity("piv", 982);
- defineEntity("plusmn", 177);
- defineEntity("pound", 163);
- defineEntity("prime", 8242);
- defineEntity("prod", 8719);
- defineEntity("prop", 8733);
- defineEntity("psi", 968);
- defineEntity("quot", 34);
- defineEntity("rArr", 8658);
- defineEntity("radic", 8730);
- defineEntity("rang", 9002);
- defineEntity("raquo", 187);
- defineEntity("rarr", 8594);
- defineEntity("rceil", 8969);
- defineEntity("rdquo", 8221);
- defineEntity("real", 8476);
- defineEntity("reg", 174);
- defineEntity("rfloor", 8971);
- defineEntity("rho", 961);
- defineEntity("rlm", 8207);
- defineEntity("rsaquo", 8250);
- defineEntity("rsquo", 8217);
- defineEntity("sbquo", 8218);
- defineEntity("scaron", 353);
- defineEntity("sdot", 8901);
- defineEntity("sect", 167);
- defineEntity("shy", 173);
- defineEntity("sigma", 963);
- defineEntity("sigmaf", 962);
- defineEntity("sim", 8764);
- defineEntity("spades", 9824);
- defineEntity("sub", 8834);
- defineEntity("sube", 8838);
- defineEntity("sum", 8721);
- defineEntity("sup", 8835);
- defineEntity("sup1", 185);
- defineEntity("sup2", 178);
- defineEntity("sup3", 179);
- defineEntity("supe", 8839);
- defineEntity("szlig", 223);
- defineEntity("tau", 964);
- defineEntity("there4", 8756);
- defineEntity("theta", 952);
- defineEntity("thetasym", 977);
- defineEntity("thinsp", 8201);
- defineEntity("thorn", 254);
- defineEntity("tilde", 732);
- defineEntity("times", 215);
- defineEntity("trade", 8482);
- defineEntity("uArr", 8657);
- defineEntity("uacute", 250);
- defineEntity("uarr", 8593);
- defineEntity("ucirc", 251);
- defineEntity("ugrave", 249);
- defineEntity("uml", 168);
- defineEntity("upsih", 978);
- defineEntity("upsilon", 965);
- defineEntity("uuml", 252);
- defineEntity("weierp", 8472);
- defineEntity("xi", 958);
- defineEntity("yacute", 253);
- defineEntity("yen", 165);
- defineEntity("yuml", 255);
- defineEntity("zeta", 950);
- defineEntity("zwj", 8205);
- defineEntity("zwnj", 8204);
- }
-
- /**
- * Crate a content model, consisting of the single
- * element, specified by name.
- */
- private ContentModel model(String element)
- {
- return new ContentModel(getElement(element));
- }
-
- /**
- * Crate a chain from the two content models,
- * the last containing the given element and
- * the specified unary operation.
- */
- private ContentModel model(String element, int unary)
- {
- ContentModel ct = model(element);
- ct.type = unary;
- return new ContentModel(0, ct);
- }
-
- /**
- * Create the model HEAD, BODY
- * @return
- */
- protected ContentModel createHtmlContentModel()
- {
- ContentModel head = model(HEAD);
- ContentModel body = model(BODY);
- head.next = body;
- head.type = ',';
- return head;
- }
-
- /**
- * Create the model
- * ( CAPTION ? , ( COL * | COLGROUP * ) , THEAD ? , TFOOT ? , TBODY + )
- */
- protected ContentModel createTableContentModel()
- {
- ContentModel col_colgroup = new ContentModel
- ('|', model(COL,'*'), model(COLGROUP,'*') );
-
- col_colgroup = new ContentModel('*', col_colgroup);
- col_colgroup = new ContentModel(',', col_colgroup);
-
- ContentModel caption = model(CAPTION,'?');
- ContentModel thead = model(THEAD, '?');
- ContentModel tfoot = model(TFOOT, '?');
- ContentModel tbody = model(TBODY, '+');
-
- caption.next = col_colgroup;
- col_colgroup.next = thead;
- thead.next = tfoot;
- tfoot.next = tbody;
-
- caption.type = col_colgroup.type = thead.type = tfoot.type =
- tbody.type = ',';
-
- return caption;
- }
-
- /**
- * Creates a model for &lt;DL&gt; tag:
- * <code> DT+ | DL+ </code>.
- * @return
- */
- protected ContentModel createDefListModel()
- {
- ContentModel dt = model(DT, '+');
- ContentModel dd = model(DD, '+');
-
- dt.next = dd;
- dt.type = dd.type = '|';
- return dt;
- }
-
- /**
- * This model is used for UL, OL, MENU and DIR.
- * HTML 4.01 specifies LI only, but the nested
- * list seems rendered correctly only if
- * it is not enclosed into <LI>-</LI> of the
- * parent list.
- */
- protected ContentModel createListModel()
- {
- ContentModel li = model(LI, '+');
- ContentModel ul = model(UL, '+');
- ContentModel ol = model(OL, '+');
-
- li.next = ul;
- ul.next = ol;
- li.type = ul.type = ol.type = '|';
- return li;
- }
-
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/gnuDTD.java b/libjava/gnu/javax/swing/text/html/parser/gnuDTD.java
deleted file mode 100755
index 1f4b3ec6adc..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/gnuDTD.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/* gnuDTD.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser;
-
-import java.io.PrintStream;
-import java.io.Serializable;
-
-import java.util.BitSet;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.swing.text.html.parser.AttributeList;
-import javax.swing.text.html.parser.ContentModel;
-import javax.swing.text.html.parser.Element;
-import javax.swing.text.html.parser.Entity;
-
-/**
- * <p>
- * The class is derived from {@link gnu.javax.swing.text.html.parser.DTD }
- * making structure creation methods public. This is required when
- * creating the DTD by SGML parser that must have access to the structure.
- *
- * SGML DTD representation. Provides basis for describing a syntax of the
- * HTML documents. The fields of this class are NOT initialized in
- * constructor. You need to do this separately before passing this data
- * structure to the parser constructor.</p>
- *
- * <p>This implementation also provides you the derived class
- * <code>gnu.javax.swing.text.html.parser.DTD.HTML_4_0_1</code>, where
- * all fields are initialized to the values, representing HTML 4.01
- * ("-//W3C//DTD HTML 4.01 Frameset//EN") DTD. You can use it if you do not care
- * about the portability between different implementations of the core
- * class libraries. </p>
- * <p>Use {@link javax.swing.HTML.HTMLEditorKit.Parser#parse }
- * for parsing in accordance with "-//W3C//DTD HTML 4.01 Frameset//EN"
- * without specifying DTD separately.</p>
- *
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class gnuDTD
- extends javax.swing.text.html.parser.DTD
- implements javax.swing.text.html.parser.DTDConstants, Serializable
-{
- /* The undocumented element types, used to specify types, not defined
- in DTDConstants. */
-
- /**
- * The URI element type (not defined in DTDConstants).
- */
- public static final int URI = 512;
-
- /**
- * The Length element type
- */
- public static final int Length = 513;
-
- /**
- * The Char element type
- */
- public static final int Char = 514;
-
- /**
- * The Color element type
- */
- public static final int Color = 515;
-
- /**
- * Creates a new instance of gnuDTD.
- * @param name the name of the DTD.
- */
- public gnuDTD(String name)
- {
- super(name);
- }
-
- /**
- * Creates and returns new attribute (not an attribute list).
- * @param name the name of this attribute
- * @param type the type of this attribute (FIXED, IMPLIED or
- * REQUIRED from <code>DTDConstants</code>).
- * @param modifier the modifier of this attribute
- * @param default_value the default value of this attribute or null if
- * it is not specified.
- * @param allowed_values the allowed values of this attribute. The multiple
- * possible values in this parameter are supposed to be separated by
- * '|', same as in SGML DTD <code>&lt;!ATTLIST </code>tag. This parameter
- * can be null if no list of allowed values is specified.
- * @param atts the previous attribute of this element. This is
- * placed to the field
- * {@link javax.swing.text.html.parser.AttributeList#next },
- * creating a linked list.
- * @return
- */
- public AttributeList defAttributeList(String name, int type, int modifier,
- String default_value,
- String allowed_values,
- AttributeList atts
- )
- {
- return super.defAttributeList(name, type, modifier, default_value,
- allowed_values, atts
- );
- }
-
- /**
- * Define the attributes for the element with the given name.
- * If the element is not exist, it is created. This method is
- * needed if the element attributes are defined befor the
- * element itself.
- * @param forElement
- * @param attributes
- */
- public void defAttrsFor(String forElement, AttributeList attributes)
- {
- super.defineAttributes(forElement, attributes);
- }
-
- /**
- * Creates a new content model.
- * @param type specifies the BNF operation for this content model.
- * The valid operations are documented in the
- * {@link javax.swing.text.html.parser.ContentModel#type }.
- * @param content the content of this content model
- * @param next if the content model is specified by BNF-like
- * expression, contains the rest of this expression.
- * @return The newly created content model.
- */
- public ContentModel defContentModel(int type, Object content,
- ContentModel next
- )
- {
- return super.defContentModel(type, content, next);
- }
-
- /**
- * Defines a new element and adds it to the element table.
- * If the element alredy exists,
- * overrides it settings with the specified values.
- * @param name the name of the new element
- * @param type the type of the element
- * @param headless true if the element needs no starting tag
- * @param tailless true if the element needs no closing tag
- * @param content the element content.
- * @param exclusions the elements that must be excluded from the
- * content of this element, in all levels of the hierarchy.
- * @param inclusions the elements that can be included as the
- * content of this element.
- * @param attributes the element attributes.
- * @return the created or updated element.
- */
- public Element defElement(String name, int type, boolean headless,
- boolean tailless, ContentModel content,
- String[] exclusions, String[] inclusions,
- AttributeList attributes
- )
- {
- return super.defElement(name, type, headless, tailless, content,
- exclusions, inclusions, attributes
- );
- }
-
- /**
- * Defines a new element and adds it to the element table.
- * If the element alredy exists,
- * overrides it settings with the specified values.
- * @param name the name of the new element
- * @param type the type of the element
- * @param headless true if the element needs no starting tag
- * @param tailless true if the element needs no closing tag
- * @param content the element content.
- * @param exclusions the elements that must be excluded from the
- * content of this element, in all levels of the hierarchy.
- * @param inclusions the elements that can be included as the
- * content of this element.
- * @param attributes the element attributes.
- * @return the created or updated element.
- */
- public Element defElement(String name, int type, boolean headless,
- boolean tailless, ContentModel content,
- Collection exclusions, Collection inclusions,
- AttributeList attributes
- )
- {
- return super.defElement(name, type, headless, tailless, content,
- toStringArray(exclusions),
- toStringArray(inclusions), attributes
- );
- }
-
- /**
- * Defines a new element and adds it to the element table.
- * If the element alredy exists,
- * overrides it settings with the specified values.
- * @param name the name of the new element
- * @param type the type of the element
- * @param headless true if the element needs no starting tag
- * @param tailless true if the element needs no closing tag
- * @param content the element content.
- * @param exclusions the elements that must be excluded from the
- * content of this element, in all levels of the hierarchy.
- * @param inclusions the elements that can be included as the
- * content of this element.
- * @param attributes the element attributes (an array and not a
- * linked list). The attributes are chained into the linked list
- * inside this method.
- * @return the created or updated element.
- */
- public Element defElement(String name, int type, boolean headless,
- boolean tailless, ContentModel content,
- String[] exclusions, String[] inclusions,
- AttributeList[] attributes
- )
- {
- AttributeList list;
-
- if (attributes == null || attributes.length == 0)
- list = null;
- else
- {
- if (attributes.length > 1)
- for (int i = 1; i < attributes.length; i++)
- {
- attributes [ i - 1 ].next = attributes [ i ];
- }
- list = attributes [ 0 ];
- }
-
- Element e =
- super.defElement(name, type, headless, tailless, content, exclusions,
- inclusions, list
- );
- return e;
- }
-
- /**
- * Creates, adds into the internal table and returns the
- * character entity like <code>&amp;lt;</code>
- * (means '<code>&lt;</code>' );
- * This method inactivates the recursive refenrences to the same
- * entity.
- * @param name The entity name (without heading &amp; and closing ;)
- * @param type The entity type
- * @param character The entity value (single character)
- * @return The created entity
- */
- public Entity defEntity(String name, int type, String data)
- {
- int r;
- String eref = "%" + name + ";";
- do
- {
- r = data.indexOf(eref);
- if (r > 0)
- {
- data = data.substring(0, r) + data.substring(r + 1);
- }
- }
- while (r > 0);
-
- return super.defEntity(name, type, data);
- }
-
- /**
- * Summarises the document content into the given PrintStream.
- */
- public void dump(PrintStream p)
- {
- Iterator iter = entityHash.entrySet().iterator();
- while (iter.hasNext())
- {
- Map.Entry item = (Map.Entry) iter.next();
- Entity e = (Entity) item.getValue();
- if (e.isGeneral())
- p.println("Entity " + e.getName() + ": " + e.getString());
- }
-
- iter = elementHash.entrySet().iterator();
- while (iter.hasNext())
- {
- Map.Entry item = (Map.Entry) iter.next();
- Element e = (Element) item.getValue();
- p.println("Element " + e.getName());
-
- System.out.println(" includes:");
- dump(e.inclusions);
- System.out.println(" excludes:");
- dump(e.exclusions);
- System.out.println(" attributes:");
-
- AttributeList atts = e.atts;
- while (atts != null)
- {
- p.print(" " + atts.name + " = " + atts.value);
- if (atts.values == null || atts.values.size() == 0)
- p.println();
- else
- {
- Iterator viter = atts.values.iterator();
- System.out.print(" ( ");
- while (viter.hasNext())
- {
- System.out.print(viter.next());
- if (viter.hasNext())
- System.out.print(" | ");
- }
- System.out.println(" ) ");
- }
- atts = atts.next;
- }
- }
- }
-
- /**
- * Prints the content of the given attribute set to the System.out.
- * @param b
- */
- public void dump(BitSet b)
- {
- if (b != null)
- {
- for (int i = 0; i < b.size(); i++)
- {
- if (b.get(i))
- System.out.println(" " + elements.get(i));
- }
- }
- else
- System.out.println(" NULL set");
- }
-
- /**
- * Creates the attribute.
- * @param name The attribute name.
- * @param type The attribute type.
- * @param modifier The attribute modifier.
- * @param defaultValue Default value (or null)
- * @param allowed_values Allowed values (or null)
- * @return The newly created AttributeList. The <code>next</code>
- * field is initialized to null.
- */
- protected AttributeList attr(String name, String default_value,
- String[] allowed_values, int type, int modifier
- )
- {
- Vector allowed = null;
-
- if (allowed_values != null)
- {
- allowed = new Vector(allowed_values.length);
- for (int i = 0; i < allowed_values.length; i++)
- {
- allowed.add(allowed_values [ i ]);
- }
- }
- ;
-
- AttributeList attr =
- new AttributeList(name, type, modifier, default_value, allowed, null);
-
- return attr;
- }
-
- /**
- * Define the general entity, holding a single character.
- * @param name The entity name (for example, 'amp').
- * The defined entity <b>is</b> stored into the entity table.
- * @param character The entity character (for example, '&').
- */
- protected void defineEntity(String name, int character)
- {
- super.defEntity(name, GENERAL, character);
- }
-
- private String[] toStringArray(Collection c)
- {
- String[] s = new String[ c.size() ];
- Iterator iter = c.iterator();
- for (int i = 0; i < s.length; i++)
- {
- s [ i ] = iter.next().toString();
- }
- return s;
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/htmlAttributeSet.java b/libjava/gnu/javax/swing/text/html/parser/htmlAttributeSet.java
deleted file mode 100644
index a4e6f73c523..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/htmlAttributeSet.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* htmlAttributeSet.java -- A set to store HTML attributes
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser;
-
-import java.util.Enumeration;
-
-import javax.swing.text.AttributeSet;
-import javax.swing.text.SimpleAttributeSet;
-import javax.swing.text.html.HTML;
-
-/**
- * A set, adapted to store HTML attributes.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class htmlAttributeSet
- extends SimpleAttributeSet
-{
- public static final htmlAttributeSet EMPTY_HTML_ATTRIBUTE_SET =
- new htmlAttributeSet();
- AttributeSet parent;
-
- /**
- * Looks in this set and, if not found, later looks in the parent set.
- * Calls toString(), allowing to pass as HTML.Attribute, as String
- * to this method.
- * @param key A key to search for a value.
- * @return The value, if one is defined.
- */
- public Object getAttribute(Object _key)
- {
- Object key = _key.toString().toLowerCase();
-
- Object v = super.getAttribute(key);
- if (v != null)
- return v;
- else if (parent != null)
- return parent.getAttribute(key);
- else
- return null;
- }
-
- /**
- * The name set must return HTML.Attribute and not a string,
- * where applicable.
- */
- public Enumeration getAttributeNames()
- {
- // Replace the string keys by HTML.attribute, where applicable
- final Enumeration enumeration = super.getAttributeNames();
-
- return new Enumeration()
- {
- public boolean hasMoreElements()
- {
- return enumeration.hasMoreElements();
- }
-
- public Object nextElement()
- {
- Object key = enumeration.nextElement();
- HTML.Attribute hKey = HTML.getAttributeKey((String) key);
- if (hKey != null)
- return hKey;
- else
- return key;
- }
- };
- }
-
- /**
- * Set the parent set, containing the default values.
- * @param a_parent
- */
- public void setResolveParent(AttributeSet a_parent)
- {
- parent = a_parent;
- }
-
- /**
- * Get the parent set, containing the default values.
- * @return
- */
- public AttributeSet getResolveParent()
- {
- return parent;
- }
-
- /**
- * Add the attribute to this attribute set.
- * @param key Attribute key (will be case insensitive)
- * @param value Attribute value
- */
- public void addAttribute(Object key, Object value)
- {
- super.addAttribute(key.toString().toLowerCase(), value);
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/htmlValidator.java b/libjava/gnu/javax/swing/text/html/parser/htmlValidator.java
deleted file mode 100644
index 1f9eee03a91..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/htmlValidator.java
+++ /dev/null
@@ -1,610 +0,0 @@
-/* tagStack.java -- The HTML tag stack.
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser;
-
-import gnu.javax.swing.text.html.parser.models.node;
-import gnu.javax.swing.text.html.parser.models.transformer;
-
-import java.util.BitSet;
-import java.util.Enumeration;
-import java.util.LinkedList;
-import java.util.ListIterator;
-
-import javax.swing.text.SimpleAttributeSet;
-import javax.swing.text.html.HTML;
-import javax.swing.text.html.parser.*;
-
-/**
- * <p>The HTML content validator, is responsible for opening and
- * closing elements with optional start/end tags, detecting
- * the wrongly placed html tags and reporting errors. The working instance
- * is the inner class inside the {@link javax.swing.text.html.parser.Parser }
- * </p>
- * <p>This class could potentially
- * provide basis for automated closing and insertion of the html tags,
- * correcting the found html errors.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public abstract class htmlValidator
-{
- /**
- * The tag reference, holding additional information that the tag
- * has been forcibly closed.
- */
- protected class hTag
- {
- protected final Element element;
- protected final HTML.Tag tag;
- protected final TagElement tgElement;
- protected boolean forcibly_closed;
- protected node validationTrace;
-
- protected hTag(TagElement an_element)
- {
- element = an_element.getElement();
- tag = an_element.getHTMLTag();
- tgElement = an_element;
-
- if (element.content != null)
- validationTrace = transformer.transform(element.content, dtd);
- }
-
- /**
- * This is called when the tag must be forcibly closed because
- * it would make the newly appearing tag invalid.
- * The parser is not notified about such event (just the error
- * is reported). For such tags, the closing message does not
- * appear when later reaching the end of stream. The exception is
- * the &lt;head&gt; tag: the parser is notified about its silent closing
- * when &lt;body&gt; or other html content appears.
- */
- protected void forciblyCloseDueContext()
- {
- forcibly_closed = true;
- }
-
- /**
- * This is called when the tag must be forcibly closed after
- * reaching the end of stream. The parser is notified as if
- * closing the tag explicitly.
- */
- protected void forciblyCloseDueEndOfStream()
- {
- forcibly_closed = true;
- handleSupposedEndTag(element);
- }
- }
-
- /**
- * The DTD, providing information about the valid document structure.
- */
- protected final DTD dtd;
-
- /**
- * The stack, holding the current tag context.
- */
- protected final LinkedList stack = new LinkedList();
-
- /**
- * Creates a new tag stack, using the given DTD.
- * @param a_dtd A DTD, providing the information about the valid
- * tag content.
- */
- public htmlValidator(DTD a_dtd)
- {
- dtd = a_dtd;
- }
-
- /**
- * Close all opened tags (called at the end of parsing).
- */
- public void closeAll()
- {
- hTag h;
- while (!stack.isEmpty())
- {
- h = (hTag) stack.getLast();
- if (!h.forcibly_closed && !h.element.omitEnd())
- s_error("Unclosed <" + h.tag + ">, closing at the end of stream");
-
- handleSupposedEndTag(h.element);
-
- closeTag(h.tgElement);
- }
- }
-
- /**
- * Remove the given tag from the stack or (if found) from the list
- * of the forcibly closed tags.
- */
- public void closeTag(TagElement tElement)
- {
- HTML.Tag tag = tElement.getHTMLTag();
- hTag x;
- hTag close;
-
- if (!stack.isEmpty())
- {
- ListIterator iter = stack.listIterator(stack.size());
-
- while (iter.hasPrevious())
- {
- x = (hTag) iter.previous();
- if (tag.equals(x.tag))
- {
- if (x.forcibly_closed && !x.element.omitEnd())
- s_error("The tag <" + x.tag +
- "> has already been forcibly closed"
- );
-
-
- // If the tag has a content model defined, forcibly close all
- // tags that were opened after the tag being currently closed.
- closing:
- if (x.element.content != null)
- {
- iter = stack.listIterator(stack.size());
- while (iter.hasPrevious())
- {
- close = (hTag) iter.previous();
- if (close == x)
- break closing;
- handleSupposedEndTag(close.element);
- iter.remove();
- }
- }
-
- stack.remove(x);
- return;
- }
- }
- }
- s_error("Closing unopened <" + tag + ">");
- }
-
- /**
- * Add the given HTML tag to the stack of the opened tags. Forcibly closes
- * all tags in the stack that does not allow this tag in they content (error
- * is reported).
- * @param element
- */
- public void openTag(TagElement tElement, htmlAttributeSet parameters)
- {
- // If this is a fictional call, the message from the parser
- // has recursively returned - ignore.
- if (tElement.fictional())
- return;
-
- validateParameters(tElement, parameters);
-
- // If the stack is empty, start from HTML
- if (stack.isEmpty() && tElement.getHTMLTag() != HTML.Tag.HTML)
- {
- Element html = dtd.getElement(HTML.Tag.HTML.toString());
- openFictionalTag(html);
- }
-
- Object v = tagIsValidForContext(tElement);
- if (v != Boolean.TRUE)
- {
- // The tag is not valid for context, the content
- // model suggest to open another tag.
- if (v instanceof Element)
- {
- int n = 0;
- while (v instanceof Element && (n++ < 100))
- {
- Element fe = (Element) v;
-
- // notify the content model that we add the proposed tag
- getCurrentContentModel().show(fe);
- openFictionalTag(fe);
-
- Object vv = tagIsValidForContext(tElement);
- if (vv instanceof Element) // One level of nesting is supported.
- {
- openFictionalTag((Element) vv);
-
- Object vx = tagIsValidForContext(tElement);
- if (vx instanceof Element)
- openFictionalTag((Element) vx);
- }
- else if (vv == Boolean.FALSE)
- {
- // The tag is still not valid for the current
- // content after opening a fictional element.
- if (fe.omitEnd())
- {
- // close the previously opened fictional tag.
- closeLast();
- vv = tagIsValidForContext(tElement);
- if (vv instanceof Element)
-
- // another tag was suggested by the content model
- openFictionalTag((Element) vv);
- }
- }
- v = tagIsValidForContext(tElement);
- }
- }
- else // If the current element has the optional end tag, close it.
- {
- if (!stack.isEmpty())
- {
- closing:
- do
- {
- hTag last = (hTag) stack.getLast();
- if (last.element.omitEnd())
- {
- closeLast();
- v = tagIsValidForContext(tElement);
- if (v instanceof Element) // another tag was suggested by the content model
- {
- openFictionalTag((Element) v);
- break closing;
- }
- }
- else
- break closing;
- }
- while (v == Boolean.FALSE && !stack.isEmpty());
- }
- }
- }
-
- stack.add(new hTag(tElement));
- }
-
- /**
- * Clear the stack.
- */
- public void restart()
- {
- stack.clear();
- }
-
- /**
- * Check if this tag is valid for the current context.
- * Return Boolean.True if it is OK, Boolean.False
- * if it is surely not OK or the Element that the
- * content model recommends to insert making the situation
- * ok. If Boolean.True is returned, the content model current
- * position is moved forward. Otherwise this position remains
- * the same.
- * @param tElement
- * @return
- */
- public Object tagIsValidForContext(TagElement tElement)
- {
- // Check the current content model, if one is available.
- node cv = getCurrentContentModel();
-
- if (cv != null)
- return cv.show(tElement.getElement());
-
- // Check exclusions and inclusions.
- ListIterator iter = stack.listIterator(stack.size());
- hTag t;
- final int idx = tElement.getElement().index;
-
- // Check only known tags.
- if (idx >= 0)
- {
- BitSet inclusions = new BitSet();
- while (iter.hasPrevious())
- {
- t = (hTag) iter.previous();
- if (!t.forcibly_closed)
- {
- if (t.element.exclusions != null &&
- t.element.exclusions.get(idx)
- )
- return Boolean.FALSE;
-
- if (t.element.inclusions != null)
- inclusions.or(t.element.inclusions);
- }
- }
- if (!inclusions.get(idx))
- return Boolean.FALSE;
- }
- return Boolean.TRUE;
- }
-
- /**
- * Validate tag without storing in into the tag stack. This is called
- * for the empty tags and results the subsequent calls to the openTag
- * and closeTag.
- */
- public void validateTag(TagElement tElement, htmlAttributeSet parameters)
- {
- openTag(tElement, parameters);
- closeTag(tElement);
- }
-
- /**
- * Check for mandatory elements, subsequent to the last tag:
- * @param tElement The element that will be inserted next.
- */
- protected void checkContentModel(TagElement tElement, boolean first)
- {
- if (stack.isEmpty())
- return;
-
- hTag last = (hTag) stack.getLast();
- if (last.validationTrace == null)
- return;
-
- Object r = last.validationTrace.show(tElement.getElement());
- if (r == Boolean.FALSE)
- s_error("The <" + last.element + "> does not match the content model " +
- last.validationTrace
- );
- else if (r instanceof Element) // The content model recommends insertion of this element
- {
- if (!first)
- closeTag(last.tgElement);
- handleSupposedStartTag((Element) r);
- openTag(new TagElement((Element) r), null);
- }
- }
-
- /**
- * The method is called when the tag must be closed because
- * it does not allow the subsequent elements inside its context
- * or the end of stream has been reached. The parser is only
- * informed if the element being closed does not require the
- * end tag (the "omitEnd" flag is set).
- * The closing message must be passed to the parser mechanism
- * before passing message about the opening the next tag.
- *
- * @param element The tag being fictionally (forcibly) closed.
- */
- protected abstract void handleSupposedEndTag(Element element);
-
- /**
- * The method is called when the validator decides to open the
- * tag on its own initiative. This may happen if the content model
- * includes the element with the optional (supposed) start tag.
- *
- * @param element The tag being opened.
- */
- protected abstract void handleSupposedStartTag(Element element);
-
- /**
- * Handles the error message. This method must be overridden to pass
- * the message where required.
- * @param msg The message text.
- */
- protected abstract void s_error(String msg);
-
- /**
- * Validate the parameters, report the error if the given parameter is
- * not in the parameter set, valid for the given attribute. The information
- * about the valid parameter set is taken from the Element, enclosed
- * inside the tag. The method does not validate the default parameters.
- * @param tag The tag
- * @param parameters The parameters of this tag.
- */
- protected void validateParameters(TagElement tag, htmlAttributeSet parameters)
- {
- if (parameters == null ||
- parameters == htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET ||
- parameters == SimpleAttributeSet.EMPTY
- )
- return;
-
- Enumeration enumeration = parameters.getAttributeNames();
-
- while (enumeration.hasMoreElements())
- {
- validateAttribute(tag, parameters, enumeration);
- }
-
- // Check for missing required values.
- AttributeList a = tag.getElement().getAttributes();
-
- while (a != null)
- {
- if (a.getModifier() == DTDConstants.REQUIRED)
- if (parameters.getAttribute(a.getName()) == null)
- {
- s_error("Missing required attribute '" + a.getName() + "' for <" +
- tag.getHTMLTag() + ">"
- );
- }
- a = a.next;
- }
- }
-
- private node getCurrentContentModel()
- {
- if (!stack.isEmpty())
- {
- hTag last = (hTag) stack.getLast();
- return last.validationTrace;
- }
- else
- return null;
- }
-
- private void closeLast()
- {
- handleSupposedEndTag(((hTag) stack.getLast()).element);
- stack.removeLast();
- }
-
- private void openFictionalTag(Element e)
- {
- handleSupposedStartTag(e);
- stack.add(new hTag(new TagElement(e, true)));
- if (!e.omitStart())
- s_error("<" + e + "> is expected (supposing it)");
- }
-
- private void validateAttribute(TagElement tag, htmlAttributeSet parameters,
- Enumeration enumeration
- )
- {
- Object foundAttribute;
- AttributeList dtdAttribute;
- foundAttribute = enumeration.nextElement();
- dtdAttribute = tag.getElement().getAttribute(foundAttribute.toString());
- if (dtdAttribute == null)
- {
- StringBuffer valid =
- new StringBuffer("The tag <" + tag.getHTMLTag() +
- "> cannot contain the attribute '" + foundAttribute +
- "'. The valid attributes for this tag are: "
- );
-
- AttributeList a = tag.getElement().getAttributes();
-
- while (a != null)
- {
- valid.append(a.name.toUpperCase());
- valid.append(' ');
- a = a.next;
- }
- s_error(valid.toString());
- }
-
- else
- {
- String value = parameters.getAttribute(foundAttribute).toString();
-
- if (dtdAttribute.type == DTDConstants.NUMBER)
- validateNumberAttribute(tag, foundAttribute, value);
-
- if (dtdAttribute.type == DTDConstants.NAME ||
- dtdAttribute.type == DTDConstants.ID
- )
- validateNameOrIdAttribute(tag, foundAttribute, value);
-
- if (dtdAttribute.values != null)
- validateAttributeWithValueList(tag, foundAttribute, dtdAttribute,
- value
- );
- }
- }
-
- private void validateAttributeWithValueList(TagElement tag,
- Object foundAttribute,
- AttributeList dtdAttribute,
- String value
- )
- {
- if (!dtdAttribute.values.contains(value.toLowerCase()) &&
- !dtdAttribute.values.contains(value.toUpperCase())
- )
- {
- StringBuffer valid;
- if (dtdAttribute.values.size() == 1)
- valid =
- new StringBuffer("The attribute '" + foundAttribute +
- "' of the tag <" + tag.getHTMLTag() +
- "> cannot have the value '" + value +
- "'. The only valid value is "
- );
- else
- valid =
- new StringBuffer("The attribute '" + foundAttribute +
- "' of the tag <" + tag.getHTMLTag() +
- "> cannot have the value '" + value + "'. The " +
- dtdAttribute.values.size() +
- " valid values are: "
- );
-
- Enumeration vv = dtdAttribute.values.elements();
- while (vv.hasMoreElements())
- {
- valid.append('"');
- valid.append(vv.nextElement());
- valid.append("\" ");
- }
- s_error(valid.toString());
- }
- }
-
- private void validateNameOrIdAttribute(TagElement tag, Object foundAttribute,
- String value
- )
- {
- boolean ok = true;
-
- if (!Character.isLetter(value.charAt(0)))
- ok = false;
-
- char c;
- for (int i = 0; i < value.length(); i++)
- {
- c = value.charAt(i);
- if (!(
- Character.isLetter(c) || Character.isDigit(c) ||
- "".indexOf(c) >= 0
- )
- )
- ok = false;
- }
- if (!ok)
- s_error("The '" + foundAttribute + "' attribute of the tag <" +
- tag.getHTMLTag() + "> must start from letter and consist of " +
- "letters, digits, hypens, colons, underscores and periods. " +
- "It cannot be '" + value + "'"
- );
- }
-
- private void validateNumberAttribute(TagElement tag, Object foundAttribute,
- String value
- )
- {
- try
- {
- Integer.parseInt(value);
- }
- catch (NumberFormatException ex)
- {
- s_error("The '" + foundAttribute + "' attribute of the tag <" +
- tag.getHTMLTag() + "> must be a valid number and not '" +
- value + "'"
- );
- }
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.java b/libjava/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.java
deleted file mode 100755
index 5a19a1bc13c..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* PCDATAonly_model.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.models;
-
-import java.io.Serializable;
-
-/**
- * The model, allowing only PCDATA in it (like for element OPTION).
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class PCDATAonly_model
- extends node
- implements Serializable
-{
- private static final long serialVersionUID = 1;
-
- public PCDATAonly_model()
- {
- super((char) 0, (char) 0, null);
- }
-
- public Object show(Object x)
- {
- return x.toString().equalsIgnoreCase("#pcdata") ? Boolean.TRUE : Boolean.FALSE;
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/models/TableRowContentModel.java b/libjava/gnu/javax/swing/text/html/parser/models/TableRowContentModel.java
deleted file mode 100755
index 14514d58458..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/models/TableRowContentModel.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* TableRowContentModel.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.models;
-
-import java.io.Serializable;
-
-import javax.swing.text.html.parser.DTD;
-import javax.swing.text.html.parser.Element;
-
-/**
- * Table row content model.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class TableRowContentModel
- extends node
- implements Serializable
-{
- private static final long serialVersionUID = 1;
- final Element TD;
-
- public TableRowContentModel(DTD dtd)
- {
- super((char) 0, (char) 0, null);
- TD = dtd.getElement("TD");
- }
-
- public Object show(Object x)
- {
- // Always accept TD and TH
- String s = x.toString();
- if (s.equalsIgnoreCase("TD") || s.equalsIgnoreCase("TH"))
- return Boolean.TRUE;
-
- // Suggest closing in response to TR:
- if (s.equalsIgnoreCase("TR"))
- return Boolean.FALSE;
-
- // Recommend TD for other cases:
- return TD;
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/models/list.java b/libjava/gnu/javax/swing/text/html/parser/models/list.java
deleted file mode 100755
index b77ef7fd850..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/models/list.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/* list.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.models;
-
-import java.io.Serializable;
-
-/**
- * Part of the internal representation of the content model.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class list
- extends node
- implements Serializable
-{
- private static final long serialVersionUID = 1;
-
- /**
- * Setting to true means that the list nodes must always be connected
- * by the same operation. This is far safer and clearer, but not
- * required by default standard.
- */
- public static boolean CLEAR;
-
- /**
- * A list of nodes.
- */
- public final node[] nodes;
-
- /**
- * Creates a new model list that is a member of some enclosing list.
- * @param binary_operator An operator with that this list is connected
- * with other members of the enclosing list.
- * @param unary_operator The unary operator for this list.
- * @param a_nodes The nodes inside this list.
- */
- public list(char binary_operator, char unary_operator, node[] a_nodes)
- {
- super(binary_operator, unary_operator, a_nodes);
- nodes = a_nodes;
- }
-
- /**
- * Creates a new model list. Assigns the previous field.
- * @param a_nodes The nodes for this list.
- * @throws an error if the node elements are connected by the
- * different operations. This is not supported, use grouping.
- */
- public list(node[] a_nodes)
- throws Error
- {
- this(',', (char) 0, a_nodes);
-
- int operation = nodes [ 0 ].binary;
-
- for (int i = 0; i < nodes.length; i++)
- {
- if (CLEAR && nodes [ i ].binary != operation)
- throw new Error("List members can only be connected by " +
- "the same operation, use grouping"
- );
-
- if (i > 0)
- nodes [ i ].previous = nodes [ i - 1 ];
- }
- }
-
- /**
- * Returns true if all members in the list are closed.
- */
- public boolean isClosed()
- {
- if (super.isClosed())
- return true;
- for (int i = 0; i < nodes.length; i++)
- {
- if (!nodes [ i ].isClosed())
- return false;
- }
- return true;
- }
-
- /**
- * Find the token that could match as the next token in
- * the token list.
- *
- * @return Such token object or null if none is found.
- */
- public Object findFreeNode()
- {
- Object fn;
- for (int j = 0; j < nodes.length; j++)
- {
- if (!nodes [ j ].isClosed())
- {
- fn = nodes [ j ].findFreeNode();
- if (fn != null)
- return fn;
- }
- }
- return null;
- }
-
- /**
- * Tries to match this list agains the given token sequence.
- * @param tokens the sequence of the tokens to match.
- * @return true if the valid match is found.
- */
- public boolean matches(Object[] tokens)
- {
- reset();
-
- Object x;
- boolean m;
- boolean matched = false;
-
- for (int i = 0; i < tokens.length; i++)
- {
- matched = false;
- x = tokens [ i ];
-
- nodescan:
- for (int j = 0; j < nodes.length; j++)
- {
- if (!nodes [ j ].isClosed())
- {
- m = nodes [ j ].performMatch(x);
-
- if (m)
- {
- matched = true;
- break nodescan;
- }
- }
- }
- if (!matched)
- return false;
- }
-
- boolean valid = true;
-
- for (int i = 0; i < nodes.length; i++)
- {
- if (!nodes [ i ].valid())
- valid = false;
- }
-
- return valid;
- }
-
- /**
- * The list never closes, despite it is trated as closed
- * if all members in the list are closed.
- * @return false.
- */
- public boolean mustClose()
- {
- return false;
- }
-
- /**
- * Perform a match operation for the single token
- * against this list.
- * @param token a token to match.
- * @return true if the match is found.
- */
- public boolean performMatch(Object token)
- {
- boolean ok = false;
- Matching:
- for (int i = 0; i < nodes.length; i++)
- {
- ok = nodes [ i ].performMatch(token);
-
- if (ok)
- break Matching;
- }
-
- if (ok)
- matches();
-
- return ok;
- }
-
- /**
- * Prepeares the list for the next matching operation.
- */
- public void reset()
- {
- super.reset();
- for (int i = 0; i < nodes.length; i++)
- nodes [ i ].reset();
- }
-
- /**
- * Check if the provided token can match as a next token in the
- * list. In the case of match, the list state changes, moving
- * current position after the matched token. However if this method
- * returns a suggested new token to insert before the provided one,
- * the state of the list does not change.
- * @return Boolean.TRUE if the match is found,
- * Boolean.FALSE if the match is not possible and no token can be
- * inserted to make the match valid. Otherwise, returns the
- * token object that can be inserted before the last token in the
- * list, probably (not for sure) making the match valid.
- * If the object is an instance of Element or TagElement,
- * it is first ensured that the object flag "omit start" is set.
- */
- public Object show(Object x)
- {
- boolean m;
- boolean matched = false;
-
- nodescan:
- for (int j = 0; j < nodes.length; j++)
- {
- if (!nodes [ j ].isClosed())
- {
- m = nodes [ j ].performMatch(x);
-
- if (m)
- {
- matched = true;
- break nodescan;
- }
- else
- {
- // For comma operation, only first not closed
- // node must be tested for a match.
- // unless it allows matching zero times.
- if (binary == ',' &&
- !(nodes [ j ].unary == '?' || nodes [ j ].unary == '*')
- )
- break nodescan;
- }
- }
- }
-
- if (!matched)
- {
- // Find and return that would be matched.
- Object freeNode = findFreeNode();
- if (freeNode == null)
- return Boolean.FALSE;
- else
- return freeNode;
- }
-
- for (int i = 0; i < nodes.length; i++)
- if (!nodes [ i ].validPreliminary())
- {
- return Boolean.FALSE;
- }
-
- return Boolean.TRUE;
- }
-
- /**
- * Returns a string representation of the list.
- * @return String representation, similar to BNF expression.
- */
- public String toString()
- {
- StringBuffer b = new StringBuffer();
- b.append(" ( ");
- for (int i = 0; i < nodes.length; i++)
- {
- if (i > 0)
- b.append(" " + (char) nodes [ i ].binary + " ");
- b.append(nodes [ i ]);
- }
-
- b.append(" )");
- if (unary != 0)
- b.append((char) unary);
- else
- b.append(' ');
- return b.toString();
- }
-
- /**
- * Returns true if all memebers in the list are valid.
- */
- public boolean valid()
- {
- for (int i = 0; i < nodes.length; i++)
- {
- if (!nodes [ i ].valid())
- return false;
- }
- return true;
- }
-
- /**
- * Returns true if all memebers in the list are either valid
- * or unvisited. The unvisited members can become valid after
- * more tokens will be shown.
- */
- public boolean validPreliminary()
- {
- if (silenceAllowed())
- {
- boolean everVisited = false;
- for (int i = 0; i < nodes.length; i++)
- {
- if (nodes [ i ].visits > 0)
- {
- everVisited = true;
- break;
- }
- }
- if (!everVisited)
- return true;
- }
-
- for (int i = 0; i < nodes.length; i++)
- {
- if (!nodes [ i ].validPreliminary())
- return false;
- }
- return true;
- }
-
- /**
- * Closes all members in the list.
- */
- protected void close()
- {
- super.close();
- for (int i = 0; i < nodes.length; i++)
- {
- nodes [ i ].close();
- }
- }
-
- /**
- * Compare given token with the token of this node.
- * If the token represents a <code>list</code>, the call may be
- * delegeted to the child subnodes.
- * @param a_token A token to compare.
- * @return True if the token matches the token of this node.
- */
- protected boolean compare(Object a_token)
- {
- return performMatch(a_token);
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/models/noTagModel.java b/libjava/gnu/javax/swing/text/html/parser/models/noTagModel.java
deleted file mode 100755
index 8aac14d8e16..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/models/noTagModel.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* noTagModel.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.models;
-
-import java.io.Serializable;
-
-/**
- * Disallows a single given tag at the current content level only.
- * <p>@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)</p>
- */
-public class noTagModel
- extends node
- implements Serializable
-{
- private static final long serialVersionUID = 1;
- final String[] no;
-
- public noTagModel(String[] noTag)
- {
- super((char) 0, (char) 0, null);
- no = noTag;
- }
-
- public noTagModel(String noTag)
- {
- super((char) 0, (char) 0, null);
- no = new String[] { noTag };
- }
-
- public Object show(Object x)
- {
- for (int i = 0; i < no.length; i++)
- {
- if (x.toString().equalsIgnoreCase(no [ i ]))
- return Boolean.FALSE;
- }
- return Boolean.TRUE;
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/models/node.java b/libjava/gnu/javax/swing/text/html/parser/models/node.java
deleted file mode 100755
index c615ddff350..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/models/node.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/* node.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.models;
-
-import java.io.Serializable;
-
-/**
- * Part of the internal representation of the content model.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class node
- implements Serializable
-{
- private static final long serialVersionUID = 1;
-
- /**
- * The token to match (can be instance of list).
- */
- public Object token;
-
- /**
- * True for the node that cannot be visited again.
- */
- public boolean _closed;
-
- /**
- * The binary operation for this node.
- */
- public char binary;
-
- /**
- * The unary opeation for this node.
- */
- public char unary;
-
- /**
- * The number of times the node already was visited.
- */
- public int visits;
-
- /**
- * The previous node in content model (used for closing nodes).
- */
- public node previous;
-
- /**
- * Creates a new node.
- * @param binary_operator The operator, connecting all nodes in the list.
- * The nodes, connected by the different operators, must be arranged into
- * the different lists.
- * @param unary_operator The unary operator for this node or zero if
- * no such was specified.
- * @param token The token to match. This can be either a string or
- * the new instance of the list.
- * @param a_previous The previous node in the list, null for the first
- * node. This is used for propagating the closing operation for the
- * comma delimited list.
- */
- public node(char binary_operator, char unary_operator, Object a_token)
- {
- if (a_token != null)
- if (a_token.getClass().equals(node.class))
- throw new Error("Creating node in node is redundant and ineffective.");
-
- binary = binary_operator;
- unary = unary_operator;
- token = a_token;
- }
-
- /**
- * Checks if this node is in the closed state.
- * @return True if the node is closed.
- */
- public boolean isClosed()
- {
- return _closed;
- }
-
- /**
- * Check if closing this node means closing the previous node.
- */
- public boolean closePrevious()
- {
- return binary == ',';
- }
-
- /**
- * Return the token object if it could match as a next token in
- * a token list of null if it could not.
- * @return
- */
- public Object findFreeNode()
- {
- boolean ok;
- if (isClosed() || silenceAllowed())
- return null;
-
- // Try if the node would stay valid after a one more visit.
- visits++;
- ok = valid();
- visits--;
-
- if (ok)
- {
- if (token instanceof node)
- return ((node) token).findFreeNode();
- else
- return token;
- }
- else
- return null;
- }
-
- /**
- * Check if the current situation is such that the node must be closed
- * now.
- */
- public boolean mustClose()
- {
- switch (unary)
- {
- case 0 :
- return true;
-
- case '*' :
- return false;
-
- case '+' :
- return false;
-
- case '?' :
- return visits <= 1;
-
- default :
- throw new Error("Invalid unary operation " + unary + " ( '" +
- (char) unary + "' )"
- );
- }
- }
-
- /**
- * Do the match operation with the given token. This sets various
- * flags.
- * @param token The token to match.
- * @return true if the the token matches node, false if it does not match
- * or if the node is closed.
- */
- public boolean performMatch(Object a_token)
- {
- if (isClosed())
- return false;
-
- boolean matches = compare(a_token);
- if (matches)
- matches();
-
- return matches;
- }
-
- /**
- * Prepares the node for matching against a new list of tokens.
- */
- public void reset()
- {
- _closed = false;
- visits = 0;
- }
-
- /**
- * Check if the provided token can match this node.
- * In the case of match, the node state changes, moving
- * current position after the matched token. However if this method
- * returns a suggested new token to insert before the provided one,
- * the state of the list does not change.
- * @return Boolean.TRUE if the match is found,
- * Boolean.FALSE if the match is not possible and no token can be
- * inserted to make the match valid. Otherwise, returns the
- * token object that can be inserted before the last token in the
- * list, probably (not for sure) making the match valid.
- */
- public Object show(Object x)
- {
- if (compare(x))
- return performMatch(x) ? Boolean.TRUE : Boolean.FALSE;
-
- Object recommended = findFreeNode();
- return recommended != null ? recommended : Boolean.FALSE;
- }
-
- /**
- * Check if it would be a valid case if this node is visited zero times.
- * Nodes with unary operator * or ? need not be matched to make a
- * model valid.
- */
- public boolean silenceAllowed()
- {
- return unary == '?' || unary == '*';
- }
-
- /**
- * Returns a string representation of the list.
- * @return String representation, similar to BNF expression.
- */
- public String toString()
- {
- StringBuffer b = new StringBuffer();
-
- b.append(token);
- if (unary != 0)
- b.append((char) unary);
- else
- b.append('\'');
-
- return b.toString();
- }
-
- /**
- * Check if the node state is valid.
- */
- public boolean valid()
- {
- switch (unary)
- {
- case 0 :
- if (binary == '|')
- return true;
- else
- return visits == 1;
-
- case '*' :
- return true;
-
- case '+' :
- return visits > 0;
-
- case '?' :
- return visits <= 1;
-
- default :
- throw new Error("Invalid unary operation " + unary + " ( '" +
- (char) unary + "' )"
- );
- }
- }
-
- public boolean validPreliminary()
- {
- return visits == 0 || valid();
- }
-
- /**
- * Closes this node and, if closePrevious() returs true, calls close() for
- * the previous node.
- */
- protected void close()
- {
- _closed = true;
- if (previous != null && closePrevious())
- previous.close();
- }
-
- /**
- * Compare the provided token object with the token object of this node.
- */
- protected boolean compare(Object a_token)
- {
- if (token instanceof Object[])
- throw new Error("Invalid token object, probably the 'list' " +
- "should be used. "
- );
-
- if (token instanceof node[])
- throw new Error("Do not use 'node' for the array of nodes, use 'list'. ");
-
- if (token instanceof node)
- {
- return ((node) token).performMatch(a_token);
- }
-
- boolean rt = false;
-
- if (token == a_token)
- rt = true;
- if (token.equals(a_token))
- rt = true;
- if (token.toString().equalsIgnoreCase(a_token.toString()))
- rt = true;
-
- return rt;
- }
-
- /**
- * Fire the changes that must happen then the token matches this node.
- */
- protected void matches()
- {
- visits++;
- if (mustClose())
- close();
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/models/transformer.java b/libjava/gnu/javax/swing/text/html/parser/models/transformer.java
deleted file mode 100755
index 22ae3c3fa52..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/models/transformer.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/* transformer.java -- Content model transforms.
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.models;
-
-import java.io.Serializable;
-
-import javax.swing.text.html.parser.ContentModel;
-import javax.swing.text.html.parser.DTD;
-
-/**
- * Transforms the standard ContentModel tree into the internal representation,
- * used in this implementation.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class transformer
- implements Serializable
-{
- private static final long serialVersionUID = 1;
-
- /**
- * All binary operators.
- */
- protected static String binary = "&|,";
-
- /**
- * All unary operators.
- */
- protected static String unary = "+*?";
-
- /**
- * Measure length of the linked list of the content models.
- * @param c The heading element of the linked list.
- * @return the length of the list (0 for null 1 if c!=null and c.next==null,
- * etc.
- */
- public static int measureChainLength(ContentModel c)
- {
- if (c == null)
- return 0;
- else
- return measureChainLength(c.next) + 1;
- }
-
- /**
- * Transform into internal representation without usind dtd.
- * This should be used only for testing.
- */
- public static node transform(ContentModel c)
- {
- return transform(c, null);
- }
-
- /**
- * Transform into internal representation.
- * @param c a model to transform
- * @return a transformed model
- * @throws Error if the model structure contains errors.
- */
- public static node transform(ContentModel c, DTD dtd)
- {
- // Handle the special cases first.
- if (c.content instanceof node)
- return (node) c.content;
-
- // Do the typical transform.
- node n;
-
- /* Case with the single token */
- if (c.next == null)
- {
- n = optionalTransform(c, dtd);
- }
- else /* Case with the chain of the multiple tokens. */
- {
- node[] l = new node[ measureChainLength(c) ];
- ContentModel m = c;
- for (int i = 0; i < l.length; i++)
- {
- if (m.content instanceof ContentModel)
- {
- ContentModel nested = (ContentModel) m.content;
- if (nested.next == null &&
- !(nested.content instanceof ContentModel)
- )
- {
- l [ i ] =
- new node((char) m.type, (char) nested.type, nested.content);
- }
- else
- {
- l [ i ] = transform(nested, dtd);
- }
- }
- else
- l [ i ] = new node((char) 0, (char) 0, m.content);
- addtype(l [ i ], (char) m.type);
- m = m.next;
- }
-
- if (isBinary(c.type))
- for (int i = 0; i < l.length; i++)
- {
- l [ i ].binary = (char) c.type;
- }
-
- n = new list(l);
- }
-
- addtype(n, (char) c.type);
-
- return n;
- }
-
- /**
- * True for binary operator
- * @param c a character to test
- * @return true for [ ,&| ], false otherwise.
- */
- private static boolean isBinary(int c)
- {
- return binary.indexOf((char) c) >= 0;
- }
-
- /**
- * True for unary operator.
- * @param c a character to test
- * @return true for [ +?* ], false otherwise.
- */
- private static boolean isUnary(int c)
- {
- return unary.indexOf((char) c) >= 0;
- }
-
- /**
- * Assign an operation type for the given node.
- * @param n A node to set the operation to.
- * @param type Either binary or unary operation, is assigned to the
- * corresponding field of the node.
- * @throws error if the operation type is not
- * representing a valid unary or binary operation.
- */
- private static void addtype(node n, char type)
- {
- if (isBinary(type))
- n.binary = type;
-
- else if (isUnary(type))
- n.unary = type;
-
- else if (type != 0)
- throw new Error("Invalid operation '" + (char) type + "'");
- }
-
- private static node optionalTransform(ContentModel c, DTD dtd)
- {
- node n;
- if (c.content instanceof ContentModel)
- n = transform((ContentModel) c.content, dtd);
- else
-
- /* A single token with the specified operation */
- n = new node((char) 0, (char) 0, c.content);
- return n;
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/Parser.java b/libjava/gnu/javax/swing/text/html/parser/support/Parser.java
deleted file mode 100755
index cef94942e16..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/Parser.java
+++ /dev/null
@@ -1,1443 +0,0 @@
-/* Parser.java -- HTML parser.
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support;
-
-import gnu.javax.swing.text.html.parser.htmlAttributeSet;
-import gnu.javax.swing.text.html.parser.htmlValidator;
-import gnu.javax.swing.text.html.parser.support.low.Constants;
-import gnu.javax.swing.text.html.parser.support.low.ParseException;
-import gnu.javax.swing.text.html.parser.support.low.ReaderTokenizer;
-import gnu.javax.swing.text.html.parser.support.low.Token;
-import gnu.javax.swing.text.html.parser.support.low.node;
-import gnu.javax.swing.text.html.parser.support.low.pattern;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import java.util.Comparator;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.Vector;
-
-import javax.swing.text.ChangedCharSetException;
-import javax.swing.text.html.HTML;
-import javax.swing.text.html.parser.AttributeList;
-import javax.swing.text.html.parser.DTD;
-import javax.swing.text.html.parser.DTDConstants;
-import javax.swing.text.html.parser.Element;
-import javax.swing.text.html.parser.Entity;
-import javax.swing.text.html.parser.TagElement;
-
-/**
- * <p>A simple error-tolerant HTML parser that uses a DTD document
- * to access data on the possible tokens, arguments and syntax.</p>
- * <p> The parser reads an HTML content from a Reader and calls various
- * notifying methods (which should be overridden in a subclass)
- * when tags or data are encountered.</p>
- * <p>Some HTML elements need no opening or closing tags. The
- * task of this parser is to invoke the tag handling methods also when
- * the tags are not explicitly specified and must be supposed using
- * information, stored in the DTD.
- * For example, parsing the document
- * <p>&lt;table&gt;&lt;tr&gt;&lt;td&gt;a&lt;td&gt;b&lt;td&gt;c&lt;/tr&gt; <br>
- * will invoke exactly the handling methods exactly in the same order
- * (and with the same parameters) as if parsing the document: <br>
- * <em>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;table&gt;&lt;
- * tbody&gt;</em>&lt;tr&gt;&lt;td&gt;a<em>&lt;/td&gt;</em>&lt;td&gt;b<em>
- * &lt;/td&gt;</em>&lt;td&gt;c<em>&lt;/td&gt;&lt;/tr&gt;</em>&lt;
- * <em>/tbody&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</em></p>
- * (supposed tags are given in italics). The parser also supports
- * obsolete elements of HTML syntax.<p>
- * </p>
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class Parser
- extends ReaderTokenizer
- implements DTDConstants
-{
- /**
- * The current html tag.
- */
- public Token hTag = new Token();
-
- /**
- * The document template description that will be used to parse the documents.
- */
- protected DTD dtd;
-
- /**
- * The value of this field determines whether or not the Parser will be
- * strict in enforcing SGML compatibility. The default value is false,
- * stating that the parser should do everything to parse and get at least
- * some information even from the incorrectly written HTML input.
- */
- protected boolean strict;
-
- /**
- * This fields has positive values in preformatted tags.
- */
- protected int preformatted = 0;
-
- /**
- * The set of the document tags. This field is used for supporting
- * markFirstTime().
- */
- private Set documentTags =
- new TreeSet(new Comparator()
- {
- public int compare(Object a, Object b)
- {
- return ((String) a).compareToIgnoreCase((String) b);
- }
- }
- );
-
- /**
- * The buffer to collect the incremental output like text or coment.
- */
- private StringBuffer buffer = new StringBuffer();
-
- /**
- * The buffer to store the document title.
- */
- private StringBuffer title = new StringBuffer();
-
- /**
- * The current token.
- */
- private Token t;
-
- /**
- * True means that the 'title' tag of this document has
- * already been handled.
- */
- private boolean titleHandled;
-
- /**
- * True means that the 'title' tag is currently open and all
- * text is also added to the title buffer.
- */
- private boolean titleOpen;
-
- /**
- * The attributes of the current HTML element.
- * Package-private to avoid an accessor method.
- */
- htmlAttributeSet attributes =
- htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET;
-
- /**
- * The validator, controlling the forcible closing of the tags that
- * (in accordance to dtd) are not allowed in the current context.
- */
- private htmlValidator validator;
-
- /**
- * Provides the default values for parameters in the case when these
- * values are defined in the DTD.
- */
- private parameterDefaulter defaulter;
-
- /**
- * The text pre-processor for handling line ends and tabs.
- */
- private textPreProcessor textProcessor = new textPreProcessor();
-
- /**
- * Creates a new Parser that uses the given
- * {@link javax.swing.text.html.parser.DTD }. The only standard way
- * to get an instance of DTD is to construct it manually, filling in
- * all required fields.
- * @param a_dtd The DTD to use. The parser behaviour after passing null
- * as an argument is not documented and may vary between implementations.
- */
- public Parser(DTD a_dtd)
- {
- if (a_dtd == null)
- dtd = gnu.javax.swing.text.html.parser.HTML_401F.getInstance();
- else
- dtd = a_dtd;
-
- defaulter = new parameterDefaulter(dtd);
-
- validator =
- new htmlValidator(dtd)
- {
- /**
- * Handles the error message. This method must be overridden to pass
- * the message where required.
- * @param msg The message text.
- */
- protected void s_error(String msg)
- {
- error(msg);
- }
-
- /**
- * The method is called when the tag validator decides to close the
- * tag on its own initiative. After reaching the end of stream,
- * The tag validator closes all unclosed elements that are required
- * to have the end (closing) tag.
- *
- * @param element The tag being fictionally (forcibly) closed.
- */
- protected void handleSupposedEndTag(Element tElement)
- {
- // The tag is cloned as the original tElement is the
- // element from the starting tag - may be accidently used
- // somewhere else.
- TagElement tag = makeTag(tElement, true);
- _handleEndTag_remaining(tag);
- }
-
- /**
- * The method is called when the the tag validator decides to open
- * the new tag on its own initiative. The tags, opened in this
- * way, are HTML, HEAD and BODY. The attribute set is temporary
- * assigned to the empty one, the previous value is
- * restored before return.
- *
- * @param element The tag being fictionally (forcibly) closed.
- */
- protected void handleSupposedStartTag(Element tElement)
- {
- TagElement tag = makeTag(tElement, true);
- htmlAttributeSet were = attributes;
- attributes = htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET;
- _handleStartTag(tag);
- attributes = were;
- }
- };
- }
-
- /**
- * Get the attributes of the current tag.
- * @return The attribute set, representing the attributes of the current tag.
- */
- public htmlAttributeSet getAttributes()
- {
- return attributes;
- }
-
- /**
- * Invokes the error handler. The default method in this implementation
- * delegates the call to handleError, also providing the current line.
- */
- public void error(String msg)
- {
- error(msg, getTokenAhead());
- }
-
- public void error(String msg, Token atToken)
- {
- if (atToken != null)
- handleError(atToken.where.beginLine,
- msg + ": line " + atToken.where.beginLine +
- ", absolute pos " + atToken.where.startPosition
- );
- else
- handleError(0, msg);
- }
-
- /**
- * Invokes the error handler. The default method in this implementation
- * delegates the call to error (parm1+": '"+parm2+"'").
- */
- public void error(String msg, String invalid)
- {
- error(msg + ": '" + invalid + "'");
- }
-
- /**
- * Invokes the error handler. The default method in this implementation
- * delegates the call to error (parm1+" "+ parm2+" "+ parm3).
- */
- public void error(String parm1, String parm2, String parm3)
- {
- error(parm1 + " " + parm2 + " " + parm3);
- }
-
- /**
- * Invokes the error handler. The default method in this implementation
- * delegates the call to error (parm1+" "+ parm2+" "+ parm3+" "+ parm4).
- */
- public void error(String parm1, String parm2, String parm3, String parm4)
- {
- error(parm1 + " " + parm2 + " " + parm3 + " " + parm4);
- }
-
- public void flushAttributes()
- {
- }
-
- /**
- * Parse the HTML text, calling various methods in response to the
- * occurence of the corresponding HTML constructions.
- * @param reader The reader to read the source HTML from.
- * @throws IOException If the reader throws one.
- */
- public synchronized void parse(Reader reader)
- throws IOException
- {
- reset(reader);
- restart();
- try
- {
- parseDocument();
- validator.closeAll();
- }
- catch (ParseException ex)
- {
- if (ex != null)
- {
- error("Unable to continue parsing the document", ex.getMessage());
-
- Throwable cause = ex.getCause();
- if (cause instanceof IOException)
- throw (IOException) cause;
- }
- }
- }
-
- /**
- * Parses DTD markup declaration. Currently returns null without action.
- * @return null.
- * @throws IOException
- */
- public String parseDTDMarkup()
- throws IOException
- {
- return null;
- }
-
- /**
- * Parse SGML insertion ( &lt;! ... &gt; ). When the
- * the SGML insertion is found, this method is called, passing
- * SGML in the string buffer as a parameter. The default method
- * returns false without action and can be overridden to
- * implement user - defined SGML support.
- * <p>
- * If you need more information about SGML insertions in HTML documents,
- * the author suggests to read SGML tutorial on
- * {@link http://www.w3.org/TR/WD-html40-970708/intro/sgmltut.html}.
- * We also recommend Goldfarb C.F (1991) <i>The SGML Handbook</i>,
- * Oxford University Press, 688 p, ISBN: 0198537379.
- * </p>
- * @param strBuff
- * @return true if this is a valid DTD markup declaration.
- * @throws IOException
- */
- public boolean parseMarkupDeclarations(StringBuffer strBuff)
- throws IOException
- {
- return false;
- }
-
- /**
- * Get the first line of the last parsed token.
- */
- protected int getCurrentLine()
- {
- return hTag.where.beginLine;
- }
-
- /**
- * Read parseable character data, add to buffer.
- * @param clearBuffer If true, buffer if filled by CDATA section,
- * otherwise the section is appended to the existing content of the
- * buffer.
- *
- * @throws ParseException
- */
- protected void CDATA(boolean clearBuffer)
- throws ParseException
- {
- Token start = hTag = getTokenAhead();
-
- if (clearBuffer)
- buffer.setLength(0);
-
- // Handle expected EOF.
- if (start.kind == EOF)
- return;
-
- read:
- while (true)
- {
- t = getTokenAhead();
- if (t.kind == EOF)
- {
- error("unexpected eof", t);
- break read;
- }
- else if (t.kind == BEGIN)
- break read;
- else if (t.kind == Constants.ENTITY)
- {
- resolveAndAppendEntity(t);
- getNextToken();
- }
- else
- {
- append(t);
- getNextToken();
- }
- }
- hTag = new Token(start, getTokenAhead(0));
- if (buffer.length() != 0)
- _handleText();
- }
-
- /**
- * Process Comment. This method skips till --> without
- * taking SGML constructs into consideration. The supported SGML
- * constructs are handled separately.
- */
- protected void Comment()
- throws ParseException
- {
- buffer.setLength(0);
-
- Token start = hTag = mustBe(BEGIN);
- optional(WS);
- mustBe(EXCLAMATION);
- optional(WS);
- mustBe(DOUBLE_DASH);
-
- Token t;
- Token last;
-
- comment:
- while (true)
- {
- t = getTokenAhead();
- if (t.kind == EOF)
- {
- handleEOFInComment();
- last = t;
- break comment;
- }
- else if (COMMENT_END.matches(this))
- {
- mustBe(DOUBLE_DASH);
- optional(WS);
- last = mustBe(END);
- break comment;
- }
- else if (COMMENT_TRIPLEDASH_END.matches(this))
- {
- mustBe(DOUBLE_DASH);
- t = mustBe(NUMTOKEN);
- if (t.getImage().equals("-"))
- {
- append(t);
- last = mustBe(END);
- break comment;
- }
- else
- {
- buffer.append("--");
- append(t);
- t = getTokenAhead();
- }
- }
- else
- /* The lllll-- can match as NUMTOKEN */
- if ((t.getImage().endsWith("--")) &&
- (
- getTokenAhead(1).kind == END ||
- (getTokenAhead(1).kind == WS && getTokenAhead(2).kind == END)
- )
- )
- {
- buffer.append(t.getImage().substring(0, t.getImage().length() - 2));
-
- /* Skip the closing > that we have already checked. */
- last = mustBe(t.kind);
- break comment;
- }
- else
- append(t);
- mustBe(t.kind);
- }
- hTag = new Token(start, last);
- handleComment();
- }
-
- /**
- * Read a script. The text, returned without any changes,
- * is terminated only by the closing tag SCRIPT.
- */
- protected void Script()
- throws ParseException
- {
- Token name;
-
- Token start = hTag = mustBe(BEGIN);
- optional(WS);
-
- name = mustBe(SCRIPT);
-
- optional(WS);
-
- restOfTag(false, name, start);
-
- buffer.setLength(0);
-
- script:
- while (!SCRIPT_CLOSE.matches(this))
- {
- append(getNextToken());
- }
-
- consume(SCRIPT_CLOSE);
-
- _handleText();
-
- endTag(false);
- _handleEndTag(makeTagElement(name.getImage(), false));
- }
-
- /**
- * Process SGML insertion that is not a comment.
- */
- protected void Sgml()
- throws ParseException
- {
- if (COMMENT_OPEN.matches(this))
- Comment();
- else // skip till ">"
- {
- Token start = hTag = mustBe(BEGIN);
- optional(WS);
- mustBe(EXCLAMATION);
-
- buffer.setLength(0);
- read:
- while (true)
- {
- t = getNextToken();
- if (t.kind == Constants.ENTITY)
- {
- resolveAndAppendEntity(t);
- }
- else if (t.kind == EOF)
- {
- error("unexpected eof", t);
- break read;
- }
- else if (t.kind == END)
- break read;
- else
- append(t);
- }
-
- try
- {
- parseMarkupDeclarations(buffer);
- }
- catch (IOException ex)
- {
- error("Unable to parse SGML insertion: '" + buffer + "'",
- new Token(start, t)
- );
- }
- }
- }
-
- /**
- * Read a style definition. The text, returned without any changes,
- * is terminated only by the closing tag STYLE.
- */
- protected void Style()
- throws ParseException
- {
- Token name;
-
- Token start = hTag = mustBe(BEGIN);
- optional(WS);
-
- name = mustBe(STYLE);
-
- optional(WS);
-
- restOfTag(false, name, start);
-
- buffer.setLength(0);
-
- style:
- while (!STYLE_CLOSE.matches(this))
- {
- append(getNextToken());
- }
-
- consume(STYLE_CLOSE);
-
- _handleText();
-
- endTag(false);
- _handleEndTag(makeTagElement(name.getImage(), false));
- }
-
- /**
- * Read a html tag.
- */
- protected void Tag()
- throws ParseException
- {
- mark(true);
-
- boolean closing = false;
- Token name;
- Token start = hTag = mustBe(BEGIN);
-
- optional(WS);
- name = getNextToken();
- optional(WS);
-
- if (name.kind == SLASH)
- {
- closing = true;
- name = getNextToken();
- }
-
- restOfTag(closing, name, start);
- }
-
- /**
- * A hook, for operations, preceeding call to handleText.
- * Handle text in a string buffer.
- * In non - preformatted mode, all line breaks immediately following the
- * start tag and immediately before an end tag is discarded,
- * \r, \n and \t are replaced by spaces, multiple space are replaced
- * by the single one and the result is moved into array,
- * passing it to handleText().
- */
- protected void _handleText()
- {
- char[] text;
-
- if (preformatted > 0)
- text = textProcessor.preprocessPreformatted(buffer);
- else
- text = textProcessor.preprocess(buffer);
-
- if (text != null && text.length > 0)
- {
- TagElement pcdata = new TagElement(dtd.getElement("#pcdata"));
- attributes = htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET;
- _handleEmptyTag(pcdata);
-
- handleText(text);
- if (titleOpen)
- title.append(text);
- }
- }
-
- /**
- * Add the image of this token to the buffer.
- * @param t A token to append.
- */
- protected final void append(Token t)
- {
- if (t.kind != EOF)
- t.appendTo(buffer);
- }
-
- /**
- * Consume pattern that must match.
- * @param p A pattern to consume.
- */
- protected final void consume(pattern p)
- {
- node n;
- for (int i = 0; i < p.nodes.length; i++)
- {
- n = p.nodes [ i ];
- if (n.optional)
- optional(n.kind);
- else
- mustBe(n.kind);
- }
- }
-
- /**
- * The method is called when the HTML end (closing) tag is found or if
- * the parser concludes that the one should be present in the
- * current position. The method is called immediatly
- * before calling the handleEndTag().
- * @param omitted True if the tag is no actually present in the document,
- * but is supposed by the parser (like &lt;/html&gt; at the end of the
- * document).
- */
- protected void endTag(boolean omitted)
- {
- }
-
- /**
- * Handle HTML comment. The default method returns without action.
- * @param comment
- */
- protected void handleComment(char[] comment)
- {
- }
-
- /**
- * This is additionally called in when the HTML content terminates
- * without closing the HTML comment. This can only happen if the
- * HTML document contains errors (for example, the closing --;gt is
- * missing.
- */
- protected void handleEOFInComment()
- {
- error("Unclosed comment");
- }
-
- /**
- * Handle the tag with no content, like &lt;br&gt;. The method is
- * called for the elements that, in accordance with the current DTD,
- * has an empty content.
- * @param The tag being handled.
- * @throws javax.swing.text.ChangedCharSetException
- */
- protected void handleEmptyTag(TagElement tag)
- throws javax.swing.text.ChangedCharSetException
- {
- }
-
- /**
- * The method is called when the HTML closing tag ((like &lt;/table&gt;)
- * is found or if the parser concludes that the one should be present
- * in the current position.
- * @param The tag
- */
- protected void handleEndTag(TagElement tag)
- {
- }
-
- /* Handle error that has occured in the given line. */
- protected void handleError(int line, String message)
- {
- }
-
- /**
- * The method is called when the HTML opening tag ((like &lt;table&gt;)
- * is found or if the parser concludes that the one should be present
- * in the current position.
- * @param The tag
- */
- protected void handleStartTag(TagElement tag)
- {
- }
-
- /**
- * Handle the text section.
- * <p> For non-preformatted section, the parser replaces
- * \t, \r and \n by spaces and then multiple spaces
- * by a single space. Additionaly, all whitespace around
- * tags is discarded.
- * </p>
- * <p> For pre-formatted text (inside TEXAREA and PRE), the parser preserves
- * all tabs and spaces, but removes <b>one</b> bounding \r, \n or \r\n,
- * if it is present. Additionally, it replaces each occurence of \r or \r\n
- * by a single \n.</p>
- *
- * @param text A section text.
- */
- protected void handleText(char[] text)
- {
- }
-
- /**
- * Handle HTML &lt;title&gt; tag. This method is invoked when
- * both title starting and closing tags are already behind.
- * The passed argument contains the concatenation of all
- * title text sections.
- * @param The title text.
- */
- protected void handleTitle(char[] title)
- {
- }
-
- /**
- * Constructs the tag from the given element. In this implementation,
- * this is defined, but never called.
- * @return the tag
- */
- protected TagElement makeTag(Element element)
- {
- return makeTag(element, false);
- }
-
- /**
- * Constructs the tag from the given element.
- * @param the tag base {@link javax.swing.text.html.parser.Element}
- * @param isSupposed true if the tag is not actually present in the
- * html input, but the parser supposes that it should to occur in
- * the current location.
- * @return the tag
- */
- protected TagElement makeTag(Element element, boolean isSupposed)
- {
- return new TagElement(element, isSupposed);
- }
-
- /**
- * This is called when the tag, representing the given element,
- * occurs first time in the document.
- * @param element
- */
- protected void markFirstTime(Element element)
- {
- }
-
- /**
- * Consume the token that was checked before and hence MUST be present.
- * @param kind The kind of token to consume.
- */
- protected Token mustBe(int kind)
- {
- if (getTokenAhead().kind == kind)
- return getNextToken();
- else
- {
- String ei = "";
- if (kind < 1000)
- ei = " ('" + (char) kind + "') ";
- throw new AssertionError("The token of kind " + kind + ei +
- " MUST be here,"
- );
- }
- }
-
- /**
- * Handle attribute without value. The default method uses
- * the only allowed attribute value from DTD.
- * If the attribute is unknown or allows several values,
- * the HTML.NULL_ATTRIBUTE_VALUE is used. The attribute with
- * this value is added to the attribute set.
- * @param element The name of element.
- * @param attribute The name of attribute without value.
- */
- protected void noValueAttribute(String element, String attribute)
- {
- Object value = HTML.NULL_ATTRIBUTE_VALUE;
-
- Element e = (Element) dtd.elementHash.get(element.toLowerCase());
- if (e != null)
- {
- AttributeList attr = e.getAttribute(attribute);
- if (attr != null)
- {
- Vector values = attr.values;
- if (values != null && values.size() == 1)
- value = values.get(0);
- }
- }
- attributes.addAttribute(attribute, value);
- }
-
- /**
- * Consume the optional token, if present.
- * @param kind The kind of token to consume.
- */
- protected Token optional(int kind)
- {
- if (getTokenAhead().kind == kind)
- return getNextToken();
- else
- return null;
- }
-
- /** Parse the html document. */
- protected void parseDocument()
- throws ParseException
- {
- while (getTokenAhead().kind != EOF)
- {
- advanced = false;
- if (TAG.matches(this))
- Tag();
- else if (COMMENT_OPEN.matches(this))
- Comment();
- else if (STYLE_OPEN.matches(this))
- Style();
- else if (SCRIPT_OPEN.matches(this))
- Script();
- else if (SGML.matches(this))
- Sgml();
- else
- CDATA(true);
-
- // Surely HTML error, treat as a text.
- if (!advanced)
- {
- Token wrong = getNextToken();
- error("unexpected '" + wrong.getImage() + "'", wrong);
- buffer.setLength(0);
- buffer.append(wrong.getImage());
- _handleText();
- }
- }
- }
-
- /**
- * Read the element attributes, adding them into attribute set.
- * @param element The element name (needed to access attribute
- * information in dtd).
- */
- protected void readAttributes(String element)
- {
- Token name;
- Token value;
- Token next;
- String attrValue;
-
- attributes = new htmlAttributeSet();
-
- optional(WS);
-
- attributeReading:
- while (getTokenAhead().kind == NUMTOKEN)
- {
- name = getNextToken();
- optional(WS);
-
- next = getTokenAhead();
- if (next.kind == EQ)
- {
- mustBe(EQ);
- optional(WS);
-
- next = getNextToken();
-
- switch (next.kind)
- {
- case QUOT :
-
- // read "quoted" attribute.
- buffer.setLength(0);
- readTillTokenE(QUOT);
- attrValue = buffer.toString();
- break;
-
- case AP :
-
- // read 'quoted' attribute.
- buffer.setLength(0);
- readTillTokenE(AP);
- attrValue = buffer.toString();
- break;
-
- // read unquoted attribute.
- case NUMTOKEN :
- value = next;
- optional(WS);
-
- // Check maybe the opening quote is missing.
- next = getTokenAhead();
- if (bQUOTING.get(next.kind))
- {
- hTag = next;
- error("The value without opening quote is closed with '" +
- next.getImage() + "'"
- );
- }
- attrValue = value.getImage();
- break;
-
- default :
- break attributeReading;
- }
- attributes.addAttribute(name.getImage(), attrValue);
- optional(WS);
- }
- else // The '=' is missing: attribute without value.
- {
- noValueAttribute(element, name.getImage());
- }
- }
- }
-
- /**
- * Return string, corresponding the given named entity.
- * The name is passed with the preceeding &, but without
- * the ending semicolon.
- */
- protected String resolveNamedEntity(final String a_tag)
- {
- // Discard &
- if (!a_tag.startsWith("&"))
- throw new AssertionError("Named entity " + a_tag +
- " must start witn '&'."
- );
-
- String tag = a_tag.substring(1);
-
- try
- {
- Entity entity = dtd.getEntity(tag);
- if (entity != null)
- return entity.getString();
-
- entity = dtd.getEntity(tag.toLowerCase());
-
- if (entity != null)
- {
- error("The name of this entity should be in lowercase", a_tag);
- return entity.getString();
- }
- }
- catch (IndexOutOfBoundsException ibx)
- {
- /* The error will be reported. */
- }
-
- error("Unknown named entity", a_tag);
- return a_tag;
- }
-
- /**
- * Return char, corresponding the given numeric entity.
- * The name is passed with the preceeding &#, but without
- * the ending semicolon.
- */
- protected char resolveNumericEntity(final String a_tag)
- {
- // Discard &#
- if (!a_tag.startsWith("&#"))
- throw new AssertionError("Numeric entity " + a_tag +
- " must start witn '&#'."
- );
-
- String tag = a_tag.substring(2);
-
- try
- {
- // Determine the encoding type:
- char cx = tag.charAt(0);
- if (cx == 'x' || cx == 'X') // Hexadecimal &#Xnnn;
-
- return (char) Integer.parseInt(tag.substring(1), 16);
-
- return (char) Integer.parseInt(tag);
- }
-
- /* The error will be reported. */
- catch (NumberFormatException nex)
- {
- }
- catch (IndexOutOfBoundsException ix)
- {
- }
-
- error("Invalid numeric entity", a_tag);
- return '?';
- }
-
- /**
- * Reset all fields into the intial default state, preparing the
- * parset for parsing the next document.
- */
- protected void restart()
- {
- documentTags.clear();
- titleHandled = false;
- titleOpen = false;
- buffer.setLength(0);
- title.setLength(0);
- validator.restart();
- }
-
- /**
- * The method is called when the HTML opening tag ((like &lt;table&gt;)
- * is found or if the parser concludes that the one should be present
- * in the current position. The method is called immediately before
- * calling the handleStartTag.
- * @param The tag
- */
- protected void startTag(TagElement tag)
- throws ChangedCharSetException
- {
- }
-
- /**
- * Handle a complete element, when the tag content is already present in the
- * buffer and both starting and heading tags behind. This is called
- * in the case when the tag text must not be parsed for the nested
- * elements (elements STYLE and SCRIPT).
- */
- private void _handleCompleteElement(TagElement tag)
- {
- _handleStartTag(tag);
-
- // Suppress inclusion of the SCRIPT ans STYLE texts into the title.
- HTML.Tag h = tag.getHTMLTag();
- if (h == HTML.Tag.SCRIPT || h == HTML.Tag.STYLE)
- {
- boolean tmp = titleOpen;
- titleOpen = false;
- _handleText();
- titleOpen = tmp;
- }
- else
- _handleText();
-
- _handleEndTag(tag);
- }
-
- /**
- * A hooks for operations, preceeding call to handleEmptyTag().
- * Handle the tag with no content, like &lt;br&gt;. As no any
- * nested tags are expected, the tag validator is not involved.
- * @param The tag being handled.
- */
- private void _handleEmptyTag(TagElement tag)
- {
- try
- {
- validator.validateTag(tag, attributes);
- handleEmptyTag(tag);
- }
- catch (ChangedCharSetException ex)
- {
- error("Changed charset exception:", ex.getMessage());
- }
- }
-
- /**
- * A hooks for operations, preceeding call to handleEndTag().
- * The method is called when the HTML closing tag
- * is found. Calls handleTitle after closing the 'title' tag.
- * @param The tag
- */
- private void _handleEndTag(TagElement tag)
- {
- validator.closeTag(tag);
- _handleEndTag_remaining(tag);
- }
-
- /**
- * Actions that are also required if the closing action was
- * initiated by the tag validator.
- * Package-private to avoid an accessor method.
- */
- void _handleEndTag_remaining(TagElement tag)
- {
- HTML.Tag h = tag.getHTMLTag();
-
- handleEndTag(tag);
- endTag(tag.fictional());
-
- if (h.isPreformatted())
- preformatted--;
- if (preformatted < 0)
- preformatted = 0;
-
- if (h == HTML.Tag.TITLE)
- {
- titleOpen = false;
- titleHandled = true;
-
- char[] a = new char[ title.length() ];
- title.getChars(0, a.length, a, 0);
- handleTitle(a);
- }
- }
-
- /**
- * A hooks for operations, preceeding call to handleStartTag().
- * The method is called when the HTML opening tag ((like &lt;table&gt;)
- * is found.
- * Package-private to avoid an accessor method.
- * @param The tag
- */
- void _handleStartTag(TagElement tag)
- {
- validator.openTag(tag, attributes);
- startingTag(tag);
- handleStartTag(tag);
-
- HTML.Tag h = tag.getHTMLTag();
-
- if (h.isPreformatted())
- preformatted++;
-
- if (h == HTML.Tag.TITLE)
- {
- if (titleHandled)
- error("Repetetive <TITLE> tag");
- titleOpen = true;
- titleHandled = false;
- }
- }
-
- /**
- * Resume parsing after heavy errors in HTML tag structure.
- * @throws ParseException
- */
- private void forciblyCloseTheTag()
- throws ParseException
- {
- int closeAt = 0;
- buffer.setLength(0);
-
- ahead:
- for (int i = 1; i < 100; i++)
- {
- t = getTokenAhead(i - 1);
- if (t.kind == EOF || t.kind == BEGIN)
- break ahead;
- if (t.kind == END)
- {
- /* Closing '>' found. */
- closeAt = i;
- break ahead;
- }
- }
- if (closeAt > 0)
- {
- buffer.append("Ignoring '");
- for (int i = 1; i <= closeAt; i++)
- {
- t = getNextToken();
- append(t);
- }
- buffer.append('\'');
- error(buffer.toString());
- }
- }
-
- /**
- * Handle comment in string buffer. You can avoid allocating a char
- * array each time by processing your comment directly here.
- */
- private void handleComment()
- {
- char[] a = new char[ buffer.length() ];
- buffer.getChars(0, a.length, a, 0);
- handleComment(a);
- }
-
- private TagElement makeTagElement(String name, boolean isSupposed)
- {
- Element e = (Element) dtd.elementHash.get(name.toLowerCase());
- if (e == null)
- {
- error("Unknown tag <" + name + ">");
- e = dtd.getElement(name);
- e.name = name.toUpperCase();
- e.index = -1;
- }
-
- if (!documentTags.contains(e.name))
- {
- markFirstTime(e);
- documentTags.add(e.name);
- }
-
- return makeTag(e, isSupposed);
- }
-
- /**
- * Read till the given token, resolving entities. Consume the given
- * token without adding it to buffer.
- * @param till The token to read till
- * @throws ParseException
- */
- private void readTillTokenE(int till)
- throws ParseException
- {
- buffer.setLength(0);
- read:
- while (true)
- {
- t = getNextToken();
- if (t.kind == Constants.ENTITY)
- {
- resolveAndAppendEntity(t);
- }
- else if (t.kind == EOF)
- {
- error("unexpected eof", t);
- break read;
- }
- else if (t.kind == till)
- break read;
- else if (t.kind == WS)
- {
- // Processing whitespace in accordance with CDATA rules:
- String s = t.getImage();
- char c;
- for (int i = 0; i < s.length(); i++)
- {
- c = s.charAt(i);
- if (c == '\r')
- buffer.append(' '); // CR replaced by space
- else if (c == '\n')
- ; // LF ignored
- else if (c == '\t')
- buffer.append(' '); // Tab replaced by space
- else
- buffer.append(c);
- }
- }
- else
- append(t);
- }
- }
-
- /**
- * Resolve the entity and append it to the end of buffer.
- * @param entity
- */
- private void resolveAndAppendEntity(Token entity)
- {
- switch (entity.category)
- {
- case ENTITY_NAMED :
- buffer.append(resolveNamedEntity(entity.getImage()));
- break;
-
- case ENTITY_NUMERIC :
- buffer.append(resolveNumericEntity(entity.getImage()));
- break;
-
- default :
- throw new AssertionError("Invalid entity category " +
- entity.category
- );
- }
- }
-
- /**
- * Handle the remaining of HTML tags. This is a common end for
- * TAG, SCRIPT and STYLE.
- * @param closing True for closing tags ( &lt;/TAG&gt; ).
- * @param name Name of element
- * @param start Token where element has started
- * @throws ParseException
- */
- private void restOfTag(boolean closing, Token name, Token start)
- throws ParseException
- {
- boolean end = false;
- Token next;
-
- optional(WS);
-
- readAttributes(name.getImage());
-
- optional(WS);
-
- next = getTokenAhead();
- if (next.kind == END)
- {
- mustBe(END);
- end = true;
- }
-
- hTag = new Token(start, next);
-
- attributes.setResolveParent(defaulter.getDefaultParameters(name.getImage()));
-
- if (!end)
- {
- // The tag body contains errors. If additionally the tag
- // name is not valid, this construction is treated as text.
- if (dtd.elementHash.get(name.getImage().toLowerCase()) == null &&
- backupMode
- )
- {
- error("Errors in tag body and unknown tag name. " +
- "Treating the tag as a text."
- );
- reset();
-
- hTag = mustBe(BEGIN);
- buffer.setLength(0);
- buffer.append(hTag.getImage());
- CDATA(false);
- return;
- }
- else
- {
- error("Forcibly closing invalid parameter list");
- forciblyCloseTheTag();
- }
- }
-
- if (closing)
- {
- endTag(false);
- _handleEndTag(makeTagElement(name.getImage(), false));
- }
- else
- {
- TagElement te = makeTagElement(name.getImage(), false);
- if (te.getElement().type == DTDConstants.EMPTY)
- _handleEmptyTag(te);
- else
- _handleStartTag(te);
- }
- }
-
- /**
- * This should fire additional actions in response to the
- * ChangedCharSetException. The current implementation
- * does nothing.
- * @param tag
- */
- private void startingTag(TagElement tag)
- {
- try
- {
- startTag(tag);
- }
- catch (ChangedCharSetException cax)
- {
- error("Invalid change of charset");
- }
- }
-
- private void ws_error()
- {
- error("Whitespace here is not permitted");
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.java b/libjava/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.java
deleted file mode 100755
index 9cdf810dd42..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* gnuStringIntMapper.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * A helper class, mapping between the strings and they unique integer
- * identifiers.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public abstract class gnuStringIntMapper
-{
- /**
- * Maps argument integer values from DTDConstants into they string
- * names. Initialized on demand.
- */
- private Map is_Map;
-
- /**
- * Maps argument string names into they integer values from DTDConstants.
- * Initialized on demand.
- */
- private Map si_Map;
-
- /**
- * Get string from id or null if no such id is present in the mapper.
- */
- public final String get(int id)
- {
- if (is_Map == null)
- createTheMap();
-
- return (String) is_Map.get(new Integer(id));
- }
-
- /** Get id from string or 0 if no such string is present in the mapper. */
- public final int get(String id)
- {
- if (si_Map == null)
- createTheMap();
-
- Integer i = (Integer) si_Map.get(id);
-
- return i != null ? i.intValue() : 0;
- }
-
- /**
- * Create the mapping table for this mapper by adding the required
- * String/int pairs. The method is invoked
- * only once for each instance, after the first invocation of the any
- * form of the <code>get</code> method. Use <code>add</code> to
- * create a map for a concrete instance.
- */
- protected abstract void create();
-
- /**
- * Add an id/string pair to this mapper. This is called from
- * the method <code>create</code> only.
- */
- protected void add(String name, int id)
- {
- Integer i = new Integer(id);
- si_Map.put(name, i);
- is_Map.put(i, name);
- }
-
- private void createTheMap()
- {
- is_Map = new HashMap();
- si_Map = new TreeMap();
- create();
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/low/Buffer.java b/libjava/gnu/javax/swing/text/html/parser/support/low/Buffer.java
deleted file mode 100644
index a39330af846..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/low/Buffer.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/* Buffer.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support.low;
-
-/**
- * A string buffer that additionally holds line and absolute postion
- * information.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class Buffer
-{
- public static int INITIAL_SIZE = 2048;
-
- /**
- * True if the \n symbol has been seen.
- */
- public boolean n_seen;
-
- /**
- * True if the \r symbol has been seen.
- */
- public boolean r_seen;
- char[] chr = new char[ INITIAL_SIZE ];
- int[] line = new int[ INITIAL_SIZE ];
- int[] position = new int[ INITIAL_SIZE ];
-
- /**
- * Current line.
- */
- int current_line = 0;
-
- /**
- * Point to the next free position.
- */
- int length;
-
- public Buffer()
- {
- }
-
- public Buffer(String content)
- {
- for (int i = 0; i < content.length(); i++)
- {
- append(content.charAt(i), i);
- }
- }
-
- /**
- * Get the characters into array.
- * @param srcBegin From, inclusive
- * @param srcEnd To, exclusive.
- * @param dst Into
- * @param dstBegin Offset.
- */
- public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
- {
- System.arraycopy(chr, srcBegin, dst, dstBegin, (srcEnd - srcBegin));
- }
-
- /**
- * Return the sequence, used to separate lines in the document.
- * @return one of \n, \r or \r\n.
- */
- public String getEndOfLineSequence()
- {
- if (r_seen && n_seen)
- return "\r\n";
- else if (r_seen)
- return "\r";
- else
-
- // This also is returned for single-line document.
- return "\n";
- }
-
- /**
- * Truncate.
- * @param n The length to truncate till.
- */
- public void setLength(int n)
- {
- length = n;
- }
-
- /**
- * Get location information for the given region.
- * @param from Region start, inclusive.
- * @param to Region end, exclusive.
- * @return The location, covering the region.
- */
- public Location getLocation(int from, int to)
- {
- Location l = new Location();
- l.beginLine = line [ from ];
- l.endLine = line [ to - 1 ];
-
- l.startPosition = position [ from ];
- l.endPosition = position [ to - 1 ] + 1;
-
- return l;
- }
-
- /**
- * Add the character.
- * @param c The character.
- * @param pos The character position in the stream (the line number
- * is handled internally in the buffer).
- */
- public void append(char c, int pos)
- {
- if (length >= chr.length)
- expand();
- chr [ length ] = c;
- position [ length ] = pos;
-
- if (c == '\n')
- {
- if (!r_seen)
- current_line++;
- n_seen = true;
- }
- else if (c == '\r')
- {
- current_line++;
- r_seen = true;
- }
-
- line [ length ] = current_line;
-
- length++;
- }
-
- /**
- * Return char at the given positon.
- */
- public char charAt(int i)
- {
- return chr [ i ];
- }
-
- /**
- * Delete the range
- * @param from Start position, inclusive.
- * @param to End position, exclusive.
- */
- public void delete(int from, int to)
- {
- int len = to - from;
- if (len < 1)
- throw new AssertionError("Deleting " + from + " till " + to);
-
- int tail = length - to;
-
- System.arraycopy(chr, to, chr, from, tail);
- System.arraycopy(position, to, position, from, tail);
- System.arraycopy(line, to, line, from, tail);
- length = length - len;
- }
-
- /**
- * Double the buffer size.
- */
- public void expand()
- {
- int nSize = 2 * chr.length;
-
- char[] nchr = new char[ nSize ];
- int[] nposition = new int[ nSize ];
- int[] nline = new int[ nSize ];
-
- System.arraycopy(chr, 0, nchr, 0, chr.length);
- System.arraycopy(position, 0, nposition, 0, position.length);
- System.arraycopy(line, 0, nline, 0, line.length);
-
- chr = nchr;
- position = nposition;
- line = nline;
- }
-
- /**
- * Return length of the occupied part of the buffer.
- */
- public int length()
- {
- return length;
- }
-
- /**
- * Prepare for parsing the new document.
- */
- public void reset()
- {
- setLength(0);
- r_seen = n_seen = false;
- }
-
- public String toString()
- {
- return new String(chr, 0, length);
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/low/Constants.java b/libjava/gnu/javax/swing/text/html/parser/support/low/Constants.java
deleted file mode 100755
index 283d32385ef..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/low/Constants.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/* Constants.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support.low;
-
-import java.util.BitSet;
-
-/**
- * The parser constants and operations, directly related to the parser
- * constants.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class Constants
-{
- /* Single character tokens are reflected into they ASCII codes. */
-
- /**
- * Start of HTML token.
- */
- public static final int BEGIN = '<';
-
- /**
- * End of HTML token.
- */
- public static final int END = '>';
-
- /**
- * Exclamation (indicates SGML or comment).
- */
- public static final int EXCLAMATION = '!';
-
- /**
- * Slash (indicates closing tag).
- */
- public static final int SLASH = '/';
-
- /**
- * Equals sign.
- */
- public static final int EQ = '=';
-
- /**
- * Quoting sign.
- */
- public static final int AP = '\'';
-
- /**
- * Quoting sign.
- */
- public static final int QUOT = '"';
-
- /* The numbers of other tokens start outside the ascii space. */
- /* String tokens */
-
- /**
- * Double dash (--)
- */
- public static final int DOUBLE_DASH = 1000;
-
- /**
- * The STYLE tag (needs special handling).
- */
- public static final int STYLE = 1001;
-
- /**
- * The SCRIPT tag (needs special handling).
- */
- public static final int SCRIPT = 1002;
-
- /* Pattern tokens */
-
- /**
- * HTML whitespace.
- */
- public static final int WS = 1003;
-
- /**
- * Named or numeric entity,
- */
- public static final int ENTITY = 1004;
-
- /**
- * Sequence of valid name characters (can start from digit).
- */
- public static final int NUMTOKEN = 1005;
-
- /* Complex tokens */
-
- /**
- * Comment opening sequence.
- */
- public static final pattern COMMENT_OPEN =
- new pattern(new node[]
- {
- new node(BEGIN), new node(WS, true), new node(EXCLAMATION),
- new node(WS, true), new node(DOUBLE_DASH),
- }
- );
-
- /**
- * Comment closing sequence
- */
- public static final pattern COMMENT_END =
- new pattern(new node[]
- {
- new node(DOUBLE_DASH), new node(WS, true), new node(END)
- }
- );
-
- /**
- * Special case ---> (also is treated as end of comment).
- */
- public static final pattern COMMENT_TRIPLEDASH_END =
- new pattern(new node[]
- {
- new node(DOUBLE_DASH), new node(NUMTOKEN), new node(END)
- }
- );
-
- /**
- * STYLE element heading pattern.
- */
- public static final pattern STYLE_OPEN =
- new pattern(new node[] { new node(BEGIN), new node(WS, true), new node(STYLE) });
-
- /**
- * SCRIPT element heading pattern.
- */
- public static final pattern SCRIPT_OPEN =
- new pattern(new node[] { new node(BEGIN), new node(WS, true), new node(SCRIPT) });
-
- /**
- * SGML element heading pattern.
- */
- public static final pattern SGML =
- new pattern(new node[]
- {
- new node(BEGIN), new node(WS, true), new node(EXCLAMATION)
- }
- );
-
- /**
- * SCRIPT element closing pattern.
- */
- public static final pattern SCRIPT_CLOSE =
- new pattern(new node[]
- {
- new node(BEGIN), new node(WS, true), new node(SLASH),
- new node(WS, true), new node(SCRIPT), new node(WS, true),
- new node(END)
- }
- );
-
- /**
- * STYLE element closing pattern.
- */
- public static final pattern STYLE_CLOSE =
- new pattern(new node[]
- {
- new node(BEGIN), new node(WS, true), new node(SLASH),
- new node(WS, true), new node(STYLE), new node(WS, true),
- new node(END)
- }
- );
-
- /**
- * Ordinary HTML tag heading pattern.
- */
- public static final pattern TAG =
- new pattern(new node[]
- {
- new node(BEGIN), new node(WS, true), new node(SLASH, true),
- new node(WS, true), new node(NUMTOKEN)
- }
- );
-
- /* Special tokens */
-
- /**
- * All other tokens.
- */
- public static final int OTHER = 1999;
-
- /**
- * The UNICODE "end of text" control code
- */
- static final char ETX = 3;
-
- /**
- * End of file.
- */
- public static final int EOF = ETX;
-
- /* Character categories */
-
- /**
- * All single char tokens.
- */
- public static final BitSet bSINGLE_CHAR_TOKEN = new BitSet();
-
- /**
- * Non letters and non numbers, allowed in HTML names.
- */
- public static final BitSet bSPECIAL = new BitSet();
-
- /**
- * All letters, used in HTML names.
- */
- public static final BitSet bLETTER = new BitSet();
-
- /**
- * Digits.
- */
- public static final BitSet bDIGIT = new BitSet();
-
- /**
- * Both line breaks.
- */
- public static final BitSet bLINEBREAK = new BitSet();
-
- /**
- * All whitespace.
- */
- public static final BitSet bWHITESPACE = new BitSet();
-
- /**
- * Both quoting characters.
- */
- public static final BitSet bQUOTING = new BitSet();
-
- /**
- * Valid name characters.
- */
- public static final BitSet bNAME = new BitSet();
-
- /* Entity subcategories */
-
- /**
- * Named entity.
- */
- public static final int ENTITY_NAMED = 1;
-
- /**
- * Numeric entity.
- */
- public static final int ENTITY_NUMERIC = 2;
-
- static
- {
- bQUOTING.set(AP);
- bQUOTING.set(QUOT);
-
- bSINGLE_CHAR_TOKEN.set(BEGIN);
- bSINGLE_CHAR_TOKEN.set(END);
- bSINGLE_CHAR_TOKEN.set(EXCLAMATION);
- bSINGLE_CHAR_TOKEN.set(SLASH);
- bSINGLE_CHAR_TOKEN.set(EQ);
- bSINGLE_CHAR_TOKEN.set(EOF);
-
- bSINGLE_CHAR_TOKEN.or(bQUOTING);
-
- bLINEBREAK.set('\r');
- bLINEBREAK.set('\n');
-
- bWHITESPACE.set(' ');
- bWHITESPACE.set('\t');
- bWHITESPACE.set(0xC);
- bWHITESPACE.or(bLINEBREAK);
-
- for (char i = '0'; i <= '9'; i++)
- {
- bDIGIT.set(i);
- }
-
- for (char i = 'a'; i <= 'z'; i++)
- {
- bLETTER.set(i);
- }
-
- for (char i = 'A'; i <= 'Z'; i++)
- {
- bLETTER.set(i);
- }
-
- bSPECIAL.set('-');
- bSPECIAL.set('_');
- bSPECIAL.set(':');
- bSPECIAL.set('.');
-
- bNAME.or(bLETTER);
- bNAME.or(bDIGIT);
- bNAME.or(bSPECIAL);
- }
-
- /**
- * Verifies if one of the tokens matches the end of string
- * buffer. The last character in the string buffer is the
- * "future character", some tokens needs to verify it the
- * token does not continue "towards the future". If the token
- * matches, it matches till "pre-last" character in the buffer.
- * @param b
- * @return
- */
- public Token endMatches(Buffer b)
- {
- if (b.length() < 2)
- return null;
-
- int p = b.length() - 2;
-
- if (b.length() > 2 && b.charAt(p) == '-' && b.charAt(p - 1) == '-')
- return new Token(DOUBLE_DASH, "--", b.getLocation(p - 1, p + 1));
-
- char last = b.charAt(p);
-
- if (bSINGLE_CHAR_TOKEN.get(last))
- return new Token(last, last, b.getLocation(p, p + 1));
-
- char future = b.charAt(p + 1);
-
- // Check for numtokens, script and style:
- if (bNAME.get(last) && !bNAME.get(future))
- {
- // Scan the history up:
- int u = p - 1;
- while (u >= 0 && bNAME.get(b.charAt(u)))
- u--;
- u++;
-
- char[] token = new char[ p - u + 1 ];
-
- // Found a numtoken
- b.getChars(u, p + 1, token, 0);
-
- // Verify for the built-in tokens:
- String e = new String(token);
-
- // found the entity reference
- if (u > 0 && b.charAt(u - 1) == '&')
- {
- // The subsequent semicolon may be the part of the token
- // as well. The semicolon must be ignored. This must be
- // handled elsewhere.
- return new Token(ENTITY, ENTITY_NAMED, "&" + e,
- b.getLocation(u - 1, p + 1)
- );
- }
-
- // found the numeric entity reference
- if (u > 1 && b.charAt(u - 1) == '#' && b.charAt(u - 2) == '&')
- {
- // The subsequent semicolon may be the part of the token
- // as well. The semicolon must be ignored. This must be
- // handled elsewhere.
- return new Token(ENTITY, ENTITY_NUMERIC, "&#" + e,
- b.getLocation(u - 2, p + 2)
- );
- }
-
- Location le = b.getLocation(u, p + 1);
-
- if (e.equalsIgnoreCase("SCRIPT"))
- return new Token(SCRIPT, e, le);
- else if (e.equalsIgnoreCase("STYLE"))
- return new Token(STYLE, e, le);
- else
- return new Token(NUMTOKEN, e, le);
- }
-
- // Check for whitespace
- if (bWHITESPACE.get(last) && !bWHITESPACE.get(future))
- {
- // Scan the history up:
- int u = p - 1;
- while (u >= 0 && bWHITESPACE.get(b.charAt(u)))
- u--;
- u++;
-
- char[] token = new char[ p - u + 1 ];
- b.getChars(u, p + 1, token, 0);
-
- return new Token(WS, new String(token), b.getLocation(u, p + 1));
- }
-
- return null;
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/low/Location.java b/libjava/gnu/javax/swing/text/html/parser/support/low/Location.java
deleted file mode 100644
index 8a1cde1c86c..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/low/Location.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Location.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support.low;
-
-/**
- * Defines a region in the text: its bounding positions and the line number.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class Location
-{
- /**
- * The line number, where the token starts.
- */
- public int beginLine;
-
- /**
- * The line, where the token ends.
- */
- public int endLine;
-
- /**
- * The absolute token end position in the input stream,
- * exclusive.
- */
- public int endPosition;
-
- /**
- * The absolute token start position in the input stream,
- * inclusive.
- */
- public int startPosition;
-
- public Location()
- {
- }
-
- /**
- * Special case, used to mark EOF.
- * @param p The total stream length.
- */
- public Location(int p)
- {
- startPosition = p;
- endPosition = p + 1;
- beginLine = endLine = -1;
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/low/ParseException.java b/libjava/gnu/javax/swing/text/html/parser/support/low/ParseException.java
deleted file mode 100644
index e71c0c1f651..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/low/ParseException.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ParseException.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support.low;
-
-/**
- * This can be thrown from various parsing methods.
- */
-public class ParseException
- extends RuntimeException
-{
- public ParseException(String s, Throwable cause)
- {
- super(s, cause);
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/low/Queue.java b/libjava/gnu/javax/swing/text/html/parser/support/low/Queue.java
deleted file mode 100755
index 31cf4bb4d59..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/low/Queue.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Queue.java -- a token queue.
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support.low;
-
-import java.util.Arrays;
-
-/**
- * A token queue.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class Queue
-{
- Token[] m = new Token[ 64 ];
- int a = 0;
- int b = 0;
-
- /**
- * True for the empty queue.
- */
- public boolean isEmpty()
- {
- return size() == 0;
- }
-
- /**
- * Add this trace to the end of the queue.
- */
- public void add(Token u)
- {
- if (a < m.length)
- {
- m [ a ] = u;
- a++;
- }
- else // The end of array has been reached.
- {
- if (b > 0) // If some elements were deleted from the start of the queue, shift.
- {
- int d = b;
- System.arraycopy(m, b, m, 0, a - b);
- b = b - d;
- a = a - d;
- m [ a ] = u;
- a++;
- }
- else // Enlarge the queue, doubling the size.
- {
- int n = m.length * 2;
- Token[] nm = new Token[ 2 * n ];
- System.arraycopy(m, 0, nm, 0, m.length);
- Arrays.fill(m, null);
-
- nm [ a ] = u;
- m = nm;
- a++;
- }
- }
- }
-
- /**
- * Clear the queue.
- */
- public void clear()
- {
- a = b = 0;
- Arrays.fill(m, null);
- }
-
- /**
- * Read the value ahead. 0 is the value that will be returned with
- * the following next. This method does not remove values from the
- * queue. To test if there is enough tokens in the queue, size() must
- * be checked before calling this method.
- */
- public Token get(int ahead)
- {
- int p = b + ahead;
- if (p < a)
- return m [ p ];
- else
- throw new ArrayIndexOutOfBoundsException("Not enough tokens");
- }
-
- /**
- * Read the oldest value from the queue and remove this value from
- * the queue.
- */
- public Token next()
- {
- if (a == b)
- throw new ArrayIndexOutOfBoundsException("queue empty");
-
- Token r = m [ b ];
- m [ b ] = null;
- b++;
- return r;
- }
-
- /**
- * Size of the queue.
- */
- public int size()
- {
- return a - b;
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.java b/libjava/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.java
deleted file mode 100755
index 0ffc6c8b754..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/* ReaderTokenizer.java -- splits the input char sequence int tokens.
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support.low;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/**
- * Reader splits the input char sequence into tokens.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class ReaderTokenizer
- extends Constants
-{
- /**
- * This is set to true each time the getNextToken is called.
- * Used in preventing loops when all patterns refuse to accept
- * the invalid input.
- */
- protected boolean advanced;
-
- /**
- * If true, the returned tokens are also placed in the backup
- * queue.
- */
- protected boolean backupMode;
-
- /**
- * The buffer to read document into.
- */
- Buffer buffer = new Buffer();
-
- /**
- * The queue for supporting mark().
- */
- Queue backup = new Queue();
-
- /**
- * The queue of found tokens.
- */
- Queue queue = new Queue();
-
- /**
- * The reader to read the document from.
- */
- Reader reader;
-
- /**
- * Array of char tokens
- */
- char[] charTokens;
-
- /**
- * Array of string tokens.
- */
- String[] stringTokens;
-
- /**
- * The current reader position.
- */
- int readerPosition = -1;
-
- /**
- * Creates a new ReaderTokenizer. The reset(...) method must be
- * subsequently called to set the reader.
- */
- public ReaderTokenizer()
- {
- }
-
- /**
- * Return the sequence, used to separate lines in the document.
- * @return one of \n, \r or \r\n.
- */
- public String getEndOfLineSequence()
- {
- return buffer.getEndOfLineSequence();
- }
-
- /**
- * Get the next token.
- * @return
- */
- public Token getNextToken()
- {
- Token rt;
- advanced = true;
- try
- {
- if (queue.isEmpty())
- read(1);
-
- if (!queue.isEmpty())
- rt = queue.next();
- else
- rt = new Token(EOF, new Location(readerPosition));
- }
- catch (IOException ex)
- {
- throw new ParseException("IO Exception", ex);
- }
- if (backupMode)
- backup.add(rt);
- return rt;
- }
-
- /**
- * Get a token, lying the given number of tokens
- * ahead. getToken(0) will return the same token,
- * what would be returned by getNextToken().
- * getToken(..) does change the current position
- * in the input stream. If the end of stream is
- * reached, the EOF token is always returned.
- */
- public Token getTokenAhead(int ahead)
- {
- try
- {
- read(ahead - queue.size() + 1);
- return queue.size() >= ahead ? queue.get(ahead) : eofToken();
- }
- catch (IOException ex)
- {
- throw new ParseException("IO Exception", ex);
- }
- }
-
- /**
- * Get a token, bein immediatley ahead.
- * If the end of stream is
- * reached, the EOF token is always returned.
- * The method is equivalent calling getTokenAhead(0).
- */
- public Token getTokenAhead()
- {
- try
- {
- if (queue.isEmpty())
- read(1);
- if (!queue.isEmpty())
- return queue.get(0);
- else
- return eofToken();
- }
- catch (IOException ex)
- {
- throw new ParseException("IO Exception", ex);
- }
- }
-
- /**
- * Invokes the error handler.
- */
- public void error(String msg, Token at)
- {
- System.out.println(msg);
- }
-
- /**
- * Turns the backup mode on or off.
- * It is possible to return where the mark(true) was last called
- * by calling reset().
- * @param mode True if it is required to save tokens, making
- * returning to the current point possible.
- */
- public void mark(boolean mode)
- {
- backup.clear();
- backupMode = mode;
- }
-
- /**
- * Prepare for new parsing from the given stream.
- * @param a_reader A reader to parse from.
- */
- public void reset(Reader a_reader)
- {
- reader = a_reader;
- readerPosition = -1;
- buffer.reset();
- queue.clear();
- }
-
- /**
- * Reset the internal cursor to the position where the mark()
- * was last time called. Switches the backup mode off.
- */
- public void reset()
- {
- if (!backupMode)
- throw new AssertionError("Call mark(true) before using reset()!");
- backupMode = false;
-
- // That is now in the queue, will be appended to the end of backup.
- while (!queue.isEmpty())
- backup.add(queue.next());
-
- Queue t = queue;
- queue = backup;
- backup = t;
- backup.clear();
- }
-
- /**
- * Read the given number of the tokens. Add the needed number of EOF
- * tokens if there are no more data in the stream.
- * @param amount The number of additional tokens to read.
- */
- void read(int numberOfTokens)
- throws IOException
- {
- if (numberOfTokens <= 0)
- return;
-
- reading:
- for (int i = 0; i < numberOfTokens; i++)
- readToken();
- }
-
- /**
- * Read next token from the reader, add it to the queue
- */
- void readToken()
- throws IOException
- {
- Token t;
- int ch;
-
- enlarging:
- while (true)
- {
- t = tokenMatches();
- if (t != null)
- break enlarging;
- else
- {
- ch = reader.read();
- readerPosition++;
- if (ch == ETX)
- ch = ' ';
- if (ch < 0)
- {
- if (buffer.length() == 0)
- {
- queue.add(eofToken());
- return;
- }
- else
- {
- if (buffer.charAt(buffer.length() - 1) != ETX)
- buffer.append(ETX, readerPosition++);
- else
- {
- // Discard terminating ETX
- buffer.setLength(buffer.length() - 1);
- if (buffer.length() > 0)
- {
- t = new Token(OTHER, buffer.toString(),
- buffer.getLocation(0, buffer.length())
- );
- queue.add(t);
- buffer.setLength(0);
- }
- return;
- }
- }
- }
- else
- buffer.append((char) ch, readerPosition);
- }
- }
- }
-
- /**
- * Check if the end of buffer matches one of the tokens. If it does,
- * return this token and remove the token sequence from the end of
- * buffer.
- * @return The matching token.
- */
- Token tokenMatches()
- {
- Token rt = endMatches(buffer);
- if (rt != null) // Remove the matched image
- {
- // Consume future character if it was an entity and the future
- // character is semicolon.
- if (rt.kind == ENTITY)
- {
- if (buffer.charAt(buffer.length() - 1) == ';')
- buffer.setLength(buffer.length() - rt.getImage().length() - 1);
- else
- {
- error("Missing closing semicolon for entity '" + rt.getImage() +
- "'", rt
- );
- consumeBuffer(rt);
- }
- }
- else
- {
- consumeBuffer(rt);
- }
- }
-
- // If the buffer is not empty, some sequence does not match any tokens.
- // Add it to the queue as "OTHER".
- if (rt != null)
- {
- if (buffer.length() > 1)
- {
- String rest = buffer.toString();
- rest = rest.substring(0, rest.length() - 1);
-
- Token other =
- new Token(OTHER, rest, buffer.getLocation(0, buffer.length));
- queue.add(other);
- consumeBuffer(other);
- }
- queue.add(rt);
- }
- return rt;
- }
-
- private void consumeBuffer(Token rt)
- {
- buffer.delete(buffer.length() - rt.getImage().length() - 1,
- buffer.length() - 1
- );
- }
-
- /**
- * Create EOF token.
- */
- private Token eofToken()
- {
- return new Token(EOF, "#", new Location(readerPosition));
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/low/Token.java b/libjava/gnu/javax/swing/text/html/parser/support/low/Token.java
deleted file mode 100644
index d91adf47ab8..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/low/Token.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/* Token.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support.low;
-
-/**
- * A token.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class Token
-{
- /**
- * The place of this token in the document.
- */
- public Location where;
-
- /**
- * The additional category of token.
- */
- public int category;
-
- /**
- * An integer that describes the kind of this token.
- */
- public int kind;
-
- /**
- * The string image of the token, null if the char image must be used.
- */
- private String stringImage;
-
- /**
- * The char image of the token.
- */
- private char charImage;
-
- /**
- * Creates a new token with fields, initialized to the default values.
- */
- public Token()
- {
- }
-
- /**
- * Creates a new token of the given kind.
- */
- public Token(int _kind, Location _where)
- {
- kind = _kind;
- where = _where;
- }
-
- /**
- * Creates a new token of the given kind and given single char image.
- */
- public Token(int _kind, char _image, Location _where)
- {
- kind = _kind;
- charImage = _image;
- where = _where;
- }
-
- /**
- * Creates a new token of the given kind and given string image.
- */
- public Token(int _kind, String _image, Location _where)
- {
- kind = _kind;
- stringImage = _image;
- where = _where;
- }
-
- /**
- * Creates a new token of the given kind, category and given string image.
- */
- public Token(int _kind, int _category, String _image, Location _where)
- {
- kind = _kind;
- category = _category;
- stringImage = _image;
- where = _where;
- }
-
- /**
- * Creates a new token, where location fields are set as for token,
- * spanning over two provided tokens and any tokens between them.
- * The image field is initialized to null, the kind field is set to -1.
- */
- public Token(Token fromInclusive, Token toInclusive)
- {
- where = new Location();
- where.beginLine = fromInclusive.where.beginLine;
- where.startPosition = fromInclusive.where.startPosition;
-
- where.endLine = toInclusive.where.endLine;
- where.endPosition = toInclusive.where.endPosition;
- }
-
- public String getImage()
- {
- if (kind == 3)
- return "#";
- if (stringImage == null)
- {
- if (charImage == 0)
- return null;
- stringImage = new String(new char[] { charImage });
- }
- return stringImage;
- }
-
- /**
- * Append the token image to the given string buffer.
- * This may be more effective that buffer.append(this.getImage()).
- * @param buffer A buffer to append.
- */
- public void appendTo(StringBuffer buffer)
- {
- if (charImage == 0)
- buffer.append(getImage());
- else
- buffer.append(charImage);
- }
-
- /**
- * Returns the string image or, if null, the bounding positions.
- */
- public String toString()
- {
- return getImage() != null ? kind + "'" + getImage()
- : "<line " + where.beginLine + ", abs pos " + where.startPosition +
- ".." + where.endPosition + ">";
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/low/node.java b/libjava/gnu/javax/swing/text/html/parser/support/low/node.java
deleted file mode 100644
index b54ed86a381..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/low/node.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* node.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support.low;
-
-/**
- * A text level content model node. The only required unary operations
- * here are "appears" and "optionally appears" ('?').
- * <p>@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)</p>
- */
-public class node
-{
- /**
- * True for node that is optional for the given position.
- */
- public boolean optional;
-
- /**
- * The kind of the token to match.
- */
- public int kind;
-
- /**
- * Creates the new node for matching a given kind of the token.
- * @param kind The kind of the token to match.
- * @param modifier The modifier (*?+).
- */
- public node(int kind, boolean _optional)
- {
- this.kind = kind;
- optional = _optional;
- }
-
- /**
- * Creates the node, indicating that token must match exactluy one time.
- * @param kind The kind of token to match.
- */
- public node(int kind)
- {
- this.kind = kind;
- optional = false;
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/low/pattern.java b/libjava/gnu/javax/swing/text/html/parser/support/low/pattern.java
deleted file mode 100755
index 0fe03fdbe87..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/low/pattern.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/* pattern.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support.low;
-
-
-/**
- * The simple pattern, consisting from the sequence of tokens that
- * may have the unary modifier '?'. Choices and grouping
- * are not required here.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class pattern
-{
- /**
- * The nodes of this pattern.
- */
- public final node[] nodes;
-
- /**
- * Create a pattern, containing the given list of nodes.
- * @param a_nodes
- */
- public pattern(node[] a_nodes)
- {
- nodes = a_nodes;
- }
-
- /**
- * Checks if the pattern can match the tokens in this
- * tokenizer. Does not change the state of tokenizer.
- * @param stream The tokenizer to read data from
- * @return True if the pattern sequence matches the
- * beginning of the tokenizer content.
- */
- public boolean matches(ReaderTokenizer stream)
- {
- try
- {
- int pt = 0;
- int pn = 0;
- Token t;
- node n;
-
- while (pn < nodes.length)
- {
- n = nodes [ pn ];
- t = stream.getTokenAhead(pt);
-
- if (t.kind == n.kind)
- {
- pn++;
- pt++;
- }
- else
- {
- if (!n.optional)
- return false;
- else
- pn++;
- }
- }
- return true;
- }
- catch (Exception ex)
- {
- throw new ParseException("Exception", ex);
- }
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/parameterDefaulter.java b/libjava/gnu/javax/swing/text/html/parser/support/parameterDefaulter.java
deleted file mode 100755
index 654acbbb58c..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/parameterDefaulter.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/* parameterDefaulter.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support;
-
-import gnu.javax.swing.text.html.parser.htmlAttributeSet;
-
-import java.util.Hashtable;
-
-import javax.swing.text.html.parser.AttributeList;
-import javax.swing.text.html.parser.DTD;
-import javax.swing.text.html.parser.Element;
-
-/**
- * Returns an attribute set, containing default
- * parameters for the given element. Caches sets of default
- * parameters.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class parameterDefaulter
-{
- public final DTD dtd;
- Hashtable sets = new Hashtable();
-
- /**
- * Create a parameterDefaulter that looks for the default attribute
- * values in the given DTD.
- * @param a_dtd
- */
- public parameterDefaulter(DTD a_dtd)
- {
- dtd = a_dtd;
- }
-
- /**
- * Get the default parameter set for the given element.
- * @param element The element name (case insensitive).
- * @return the default attrbute set.
- */
- public htmlAttributeSet getDefaultParameters(String element)
- {
- String key = element.toLowerCase();
- htmlAttributeSet atts = (htmlAttributeSet) sets.get(key);
-
- if (atts == null)
- {
- htmlAttributeSet set = new htmlAttributeSet();
- Element e = (Element) dtd.elementHash.get(element.toLowerCase());
-
- if (e != null)
- {
- AttributeList a = e.getAttributes();
-
- while (a != null)
- {
- if (a.value != null)
- set.addAttribute(a.name, a.value);
- a = a.next;
- }
- }
-
- if (set.getAttributeCount() > 0)
- sets.put(key, set);
- else
- sets.put(key, htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET);
-
- atts = set;
- }
- return atts;
- }
-}
diff --git a/libjava/gnu/javax/swing/text/html/parser/support/textPreProcessor.java b/libjava/gnu/javax/swing/text/html/parser/support/textPreProcessor.java
deleted file mode 100755
index cc1610585a6..00000000000
--- a/libjava/gnu/javax/swing/text/html/parser/support/textPreProcessor.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/* textPreProcessor.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.javax.swing.text.html.parser.support;
-
-import gnu.javax.swing.text.html.parser.support.low.Constants;
-
-/**
- * Pre - processes text in text parts of the html document.
- * Not thread - safe.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class textPreProcessor
-{
- /**
- * Pre - process non-preformatted text.
- * \t, \r and \n mutate into spaces, then multiple spaces mutate
- * into single one, all whitespace around tags is consumed.
- * The content of the passed buffer is destroyed.
- * @param text A text to pre-process.
- */
- public char[] preprocess(StringBuffer a_text)
- {
- if (a_text.length() == 0)
- return null;
-
- char[] text = toCharArray(a_text);
-
- int a = 0;
- int b = text.length - 1;
-
- try
- {
- while (Constants.bWHITESPACE.get(text [ a ]))
- a++;
- while (Constants.bWHITESPACE.get(text [ b ]))
- b--;
- }
- catch (ArrayIndexOutOfBoundsException sx)
- {
- // A text fragment, consisting from line breaks only.
- return null;
- }
-
- a_text.setLength(0);
-
- boolean spacesWere = false;
- boolean spaceNow;
- char c;
-
- chars:
- for (int i = a; i <= b; i++)
- {
- c = text [ i ];
- spaceNow = Constants.bWHITESPACE.get(c);
- if (spacesWere && spaceNow)
- continue chars;
- if (spaceNow)
- a_text.append(' ');
- else
- a_text.append(c);
- spacesWere = spaceNow;
- }
-
- if (a_text.length() == text.length)
- {
- a_text.getChars(0, a_text.length(), text, 0);
- return text;
- }
- else
- return toCharArray(a_text);
- }
-
- /**
- * Pre - process pre-formatted text.
- * Heading/closing spaces and tabs preserved.
- * ONE bounding \r, \n or \r\n is removed.
- * \r or \r\n mutate into \n. Tabs are
- * preserved.
- * The content of the passed buffer is destroyed.
- * @param text
- * @return
- */
- public char[] preprocessPreformatted(StringBuffer a_text)
- {
- if (a_text.length() == 0)
- return null;
-
- char[] text = toCharArray(a_text);
-
- int a = 0;
- int n = text.length - 1;
- int b = n;
-
- if (text [ 0 ] == '\n')
- a++;
- else
- {
- if (text [ 0 ] == '\r')
- {
- a++;
- if (text.length > 1 && text [ 1 ] == '\n')
- a++;
- }
- }
-
- if (text [ n ] == '\r')
- b--;
- else
- {
- if (text [ n ] == '\n')
- {
- b--;
- if (n > 0 && text [ n - 1 ] == '\r')
- b--;
- }
- }
-
- a_text.setLength(0);
-
- if (a > b)
- return null;
-
- char c;
-
- for (int i = a; i <= b; i++)
- {
- c = text [ i ];
- if (c == '\r')
- {
- if (i == b || text [ i + 1 ] != '\n')
- a_text.append('\n');
- }
- else
- a_text.append(c);
- }
-
- if (a_text.length() == text.length)
- {
- a_text.getChars(0, a_text.length(), text, 0);
- return text;
- }
- else
- return toCharArray(a_text);
- }
-
- /**
- * Return array of chars, present in the given buffer.
- * @param a_text The buffer
- * @return
- */
- private static char[] toCharArray(StringBuffer a_text)
- {
- char[] text = new char[ a_text.length() ];
- a_text.getChars(0, text.length, text, 0);
- return text;
- }
-}
diff --git a/libjava/gnu/regexp/CharIndexed.java b/libjava/gnu/regexp/CharIndexed.java
deleted file mode 100644
index a0d7106aefa..00000000000
--- a/libjava/gnu/regexp/CharIndexed.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* gnu/regexp/CharIndexed.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-/**
- * Defines the interface used internally so that different types of source
- * text can be accessed in the same way. Built-in concrete classes provide
- * support for String, StringBuffer, InputStream and char[] types.
- * A class that is CharIndexed supports the notion of a cursor within a
- * block of text. The cursor must be able to be advanced via the move()
- * method. The charAt() method returns the character at the cursor position
- * plus a given offset.
- *
- * @author <A HREF="mailto:wes@cacas.org">Wes Biggs</A>
- */
-public interface CharIndexed {
- /**
- * Defines a constant (0xFFFF was somewhat arbitrarily chosen)
- * that can be returned by the charAt() function indicating that
- * the specified index is out of range.
- */
- char OUT_OF_BOUNDS = '\uFFFF';
-
- /**
- * Returns the character at the given offset past the current cursor
- * position in the input. The index of the current position is zero.
- * It is possible for this method to be called with a negative index.
- * This happens when using the '^' operator in multiline matching mode
- * or the '\b' or '\<' word boundary operators. In any case, the lower
- * bound is currently fixed at -2 (for '^' with a two-character newline).
- *
- * @param index the offset position in the character field to examine
- * @return the character at the specified index, or the OUT_OF_BOUNDS
- * character defined by this interface.
- */
- char charAt(int index);
-
- /**
- * Shifts the input buffer by a given number of positions. Returns
- * true if the new cursor position is valid.
- */
- boolean move(int index);
-
- /**
- * Returns true if the most recent move() operation placed the cursor
- * position at a valid position in the input.
- */
- boolean isValid();
-}
diff --git a/libjava/gnu/regexp/CharIndexedCharArray.java b/libjava/gnu/regexp/CharIndexedCharArray.java
deleted file mode 100644
index 63d858c8709..00000000000
--- a/libjava/gnu/regexp/CharIndexedCharArray.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* gnu/regexp/CharIndexedCharArray.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.io.Serializable;
-
-class CharIndexedCharArray implements CharIndexed, Serializable {
- private char[] s;
- private int anchor;
-
- CharIndexedCharArray(char[] str, int index) {
- s = str;
- anchor = index;
- }
-
- public char charAt(int index) {
- int pos = anchor + index;
- return ((pos < s.length) && (pos >= 0)) ? s[pos] : OUT_OF_BOUNDS;
- }
-
- public boolean isValid() {
- return (anchor < s.length);
- }
-
- public boolean move(int index) {
- return ((anchor += index) < s.length);
- }
-}
diff --git a/libjava/gnu/regexp/CharIndexedInputStream.java b/libjava/gnu/regexp/CharIndexedInputStream.java
deleted file mode 100644
index 145fe11b135..00000000000
--- a/libjava/gnu/regexp/CharIndexedInputStream.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* gnu/regexp/CharIndexedInputStream.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-// TODO: move(x) shouldn't rely on calling next() x times
-
-class CharIndexedInputStream implements CharIndexed {
- private static final int BUFFER_INCREMENT = 1024;
- private static final int UNKNOWN = Integer.MAX_VALUE; // value for end
-
- private BufferedInputStream br;
-
- // so that we don't try to reset() right away
- private int index = -1;
-
- private int bufsize = BUFFER_INCREMENT;
-
- private int end = UNKNOWN;
-
- private char cached = OUT_OF_BOUNDS;
-
- // Big enough for a \r\n pair
- // lookBehind[0] = most recent
- // lookBehind[1] = second most recent
- private char[] lookBehind = new char[] { OUT_OF_BOUNDS, OUT_OF_BOUNDS };
-
- CharIndexedInputStream(InputStream str, int index) {
- if (str instanceof BufferedInputStream) br = (BufferedInputStream) str;
- else br = new BufferedInputStream(str,BUFFER_INCREMENT);
- next();
- if (index > 0) move(index);
- }
-
- private boolean next() {
- if (end == 1) return false;
- end--; // closer to end
-
- try {
- if (index != -1) {
- br.reset();
- }
- int i = br.read();
- br.mark(bufsize);
- if (i == -1) {
- end = 1;
- cached = OUT_OF_BOUNDS;
- return false;
- }
- cached = (char) i;
- index = 1;
- } catch (IOException e) {
- e.printStackTrace();
- cached = OUT_OF_BOUNDS;
- return false;
- }
- return true;
- }
-
- public char charAt(int index) {
- if (index == 0) {
- return cached;
- } else if (index >= end) {
- return OUT_OF_BOUNDS;
- } else if (index == -1) {
- return lookBehind[0];
- } else if (index == -2) {
- return lookBehind[1];
- } else if (index < -2) {
- return OUT_OF_BOUNDS;
- } else if (index >= bufsize) {
- // Allocate more space in the buffer.
- try {
- while (bufsize <= index) bufsize += BUFFER_INCREMENT;
- br.reset();
- br.mark(bufsize);
- br.skip(index-1);
- } catch (IOException e) { }
- } else if (this.index != index) {
- try {
- br.reset();
- br.skip(index-1);
- } catch (IOException e) { }
- }
- char ch = OUT_OF_BOUNDS;
-
- try {
- int i = br.read();
- this.index = index+1; // this.index is index of next pos relative to charAt(0)
- if (i == -1) {
- // set flag that next should fail next time?
- end = index;
- return ch;
- }
- ch = (char) i;
- } catch (IOException ie) { }
-
- return ch;
- }
-
- public boolean move(int index) {
- // move read position [index] clicks from 'charAt(0)'
- boolean retval = true;
- while (retval && (index-- > 0)) retval = next();
- return retval;
- }
-
- public boolean isValid() {
- return (cached != OUT_OF_BOUNDS);
- }
-}
-
diff --git a/libjava/gnu/regexp/CharIndexedString.java b/libjava/gnu/regexp/CharIndexedString.java
deleted file mode 100644
index 05be07ac68c..00000000000
--- a/libjava/gnu/regexp/CharIndexedString.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* gnu/regexp/CharIndexedString.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.io.Serializable;
-
-class CharIndexedString implements CharIndexed, Serializable {
- private String s;
- private int anchor;
- private int len;
-
- CharIndexedString(String str, int index) {
- s = str;
- len = s.length();
- anchor = index;
- }
-
- public char charAt(int index) {
- int pos = anchor + index;
- return ((pos < len) && (pos >= 0)) ? s.charAt(pos) : OUT_OF_BOUNDS;
- }
-
- public boolean isValid() {
- return (anchor < len);
- }
-
- public boolean move(int index) {
- return ((anchor += index) < len);
- }
-}
diff --git a/libjava/gnu/regexp/CharIndexedStringBuffer.java b/libjava/gnu/regexp/CharIndexedStringBuffer.java
deleted file mode 100644
index 1b88e398571..00000000000
--- a/libjava/gnu/regexp/CharIndexedStringBuffer.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* gnu/regexp/CharIndexedStringBuffer.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.io.Serializable;
-
-class CharIndexedStringBuffer implements CharIndexed, Serializable {
- private StringBuffer s;
- private int anchor;
-
- CharIndexedStringBuffer(StringBuffer str, int index) {
- s = str;
- anchor = index;
- }
-
- public char charAt(int index) {
- int pos = anchor + index;
- return ((pos < s.length()) && (pos >= 0)) ? s.charAt(pos) : OUT_OF_BOUNDS;
- }
-
- public boolean isValid() {
- return (anchor < s.length());
- }
-
- public boolean move(int index) {
- return ((anchor += index) < s.length());
- }
-}
diff --git a/libjava/gnu/regexp/RE.java b/libjava/gnu/regexp/RE.java
deleted file mode 100644
index f5c990d5f83..00000000000
--- a/libjava/gnu/regexp/RE.java
+++ /dev/null
@@ -1,1394 +0,0 @@
-/* gnu/regexp/RE.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.Locale;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-/**
- * RE provides the user interface for compiling and matching regular
- * expressions.
- * <P>
- * A regular expression object (class RE) is compiled by constructing it
- * from a String, StringBuffer or character array, with optional
- * compilation flags (below)
- * and an optional syntax specification (see RESyntax; if not specified,
- * <code>RESyntax.RE_SYNTAX_PERL5</code> is used).
- * <P>
- * Once compiled, a regular expression object is reusable as well as
- * threadsafe: multiple threads can use the RE instance simultaneously
- * to match against different input text.
- * <P>
- * Various methods attempt to match input text against a compiled
- * regular expression. These methods are:
- * <LI><code>isMatch</code>: returns true if the input text in its
- * entirety matches the regular expression pattern.
- * <LI><code>getMatch</code>: returns the first match found in the
- * input text, or null if no match is found.
- * <LI><code>getAllMatches</code>: returns an array of all
- * non-overlapping matches found in the input text. If no matches are
- * found, the array is zero-length.
- * <LI><code>substitute</code>: substitute the first occurence of the
- * pattern in the input text with a replacement string (which may
- * include metacharacters $0-$9, see REMatch.substituteInto).
- * <LI><code>substituteAll</code>: same as above, but repeat for each
- * match before returning.
- * <LI><code>getMatchEnumeration</code>: returns an REMatchEnumeration
- * object that allows iteration over the matches (see
- * REMatchEnumeration for some reasons why you may want to do this
- * instead of using <code>getAllMatches</code>.
- * <P>
- *
- * These methods all have similar argument lists. The input can be a
- * String, a character array, a StringBuffer, or an
- * InputStream of some sort. Note that when using an
- * InputStream, the stream read position cannot be guaranteed after
- * attempting a match (this is not a bug, but a consequence of the way
- * regular expressions work). Using an REMatchEnumeration can
- * eliminate most positioning problems.
- *
- * <P>
- *
- * The optional index argument specifies the offset from the beginning
- * of the text at which the search should start (see the descriptions
- * of some of the execution flags for how this can affect positional
- * pattern operators). For an InputStream, this means an
- * offset from the current read position, so subsequent calls with the
- * same index argument on an InputStream will not
- * necessarily access the same position on the stream, whereas
- * repeated searches at a given index in a fixed string will return
- * consistent results.
- *
- * <P>
- * You can optionally affect the execution environment by using a
- * combination of execution flags (constants listed below).
- *
- * <P>
- * All operations on a regular expression are performed in a
- * thread-safe manner.
- *
- * @author <A HREF="mailto:wes@cacas.org">Wes Biggs</A>
- * @version 1.1.5-dev, to be released
- */
-
-public class RE extends REToken {
-
- private static final class IntPair implements Serializable {
- public int first, second;
- }
-
- private static final class CharUnit implements Serializable {
- public char ch;
- public boolean bk;
- }
-
- // This String will be returned by getVersion()
- private static final String VERSION = "1.1.5-dev";
-
- // The localized strings are kept in a separate file
- private static ResourceBundle messages = PropertyResourceBundle.getBundle("gnu/regexp/MessagesBundle", Locale.getDefault());
-
- // These are, respectively, the first and last tokens in our linked list
- // If there is only one token, firstToken == lastToken
- private REToken firstToken, lastToken;
-
- // This is the number of subexpressions in this regular expression,
- // with a minimum value of zero. Returned by getNumSubs()
- private int numSubs;
-
- /** Minimum length, in characters, of any possible match. */
- private int minimumLength;
-
- /**
- * Compilation flag. Do not differentiate case. Subsequent
- * searches using this RE will be case insensitive.
- */
- public static final int REG_ICASE = 2;
-
- /**
- * Compilation flag. The match-any-character operator (dot)
- * will match a newline character. When set this overrides the syntax
- * bit RE_DOT_NEWLINE (see RESyntax for details). This is equivalent to
- * the "/s" operator in Perl.
- */
- public static final int REG_DOT_NEWLINE = 4;
-
- /**
- * Compilation flag. Use multiline mode. In this mode, the ^ and $
- * anchors will match based on newlines within the input. This is
- * equivalent to the "/m" operator in Perl.
- */
- public static final int REG_MULTILINE = 8;
-
- /**
- * Execution flag.
- * The match-beginning operator (^) will not match at the beginning
- * of the input string. Useful for matching on a substring when you
- * know the context of the input is such that position zero of the
- * input to the match test is not actually position zero of the text.
- * <P>
- * This example demonstrates the results of various ways of matching on
- * a substring.
- * <P>
- * <CODE>
- * String s = "food bar fool";<BR>
- * RE exp = new RE("^foo.");<BR>
- * REMatch m0 = exp.getMatch(s);<BR>
- * REMatch m1 = exp.getMatch(s.substring(8));<BR>
- * REMatch m2 = exp.getMatch(s.substring(8),0,RE.REG_NOTBOL); <BR>
- * REMatch m3 = exp.getMatch(s,8); <BR>
- * REMatch m4 = exp.getMatch(s,8,RE.REG_ANCHORINDEX); <BR>
- * <P>
- * // Results:<BR>
- * // m0.toString(): "food"<BR>
- * // m1.toString(): "fool"<BR>
- * // m2.toString(): null<BR>
- * // m3.toString(): null<BR>
- * // m4.toString(): "fool"<BR>
- * </CODE>
- */
- public static final int REG_NOTBOL = 16;
-
- /**
- * Execution flag.
- * The match-end operator ($) does not match at the end
- * of the input string. Useful for matching on substrings.
- */
- public static final int REG_NOTEOL = 32;
-
- /**
- * Execution flag.
- * When a match method is invoked that starts matching at a non-zero
- * index into the input, treat the input as if it begins at the index
- * given. The effect of this flag is that the engine does not "see"
- * any text in the input before the given index. This is useful so
- * that the match-beginning operator (^) matches not at position 0
- * in the input string, but at the position the search started at
- * (based on the index input given to the getMatch function). See
- * the example under REG_NOTBOL. It also affects the use of the \&lt;
- * and \b operators.
- */
- public static final int REG_ANCHORINDEX = 64;
-
- /**
- * Execution flag.
- * The substitute and substituteAll methods will not attempt to
- * interpolate occurrences of $1-$9 in the replacement text with
- * the corresponding subexpressions. For example, you may want to
- * replace all matches of "one dollar" with "$1".
- */
- public static final int REG_NO_INTERPOLATE = 128;
-
- /** Returns a string representing the version of the gnu.regexp package. */
- public static final String version() {
- return VERSION;
- }
-
- // Retrieves a message from the ResourceBundle
- static final String getLocalizedMessage(String key) {
- return messages.getString(key);
- }
-
- /**
- * Constructs a regular expression pattern buffer without any compilation
- * flags set, and using the default syntax (RESyntax.RE_SYNTAX_PERL5).
- *
- * @param pattern A regular expression pattern, in the form of a String,
- * StringBuffer or char[]. Other input types will be converted to
- * strings using the toString() method.
- * @exception REException The input pattern could not be parsed.
- * @exception NullPointerException The pattern was null.
- */
- public RE(Object pattern) throws REException {
- this(pattern,0,RESyntax.RE_SYNTAX_PERL5,0,0);
- }
-
- /**
- * Constructs a regular expression pattern buffer using the specified
- * compilation flags and the default syntax (RESyntax.RE_SYNTAX_PERL5).
- *
- * @param pattern A regular expression pattern, in the form of a String,
- * StringBuffer, or char[]. Other input types will be converted to
- * strings using the toString() method.
- * @param cflags The logical OR of any combination of the compilation flags listed above.
- * @exception REException The input pattern could not be parsed.
- * @exception NullPointerException The pattern was null.
- */
- public RE(Object pattern, int cflags) throws REException {
- this(pattern,cflags,RESyntax.RE_SYNTAX_PERL5,0,0);
- }
-
- /**
- * Constructs a regular expression pattern buffer using the specified
- * compilation flags and regular expression syntax.
- *
- * @param pattern A regular expression pattern, in the form of a String,
- * StringBuffer, or char[]. Other input types will be converted to
- * strings using the toString() method.
- * @param cflags The logical OR of any combination of the compilation flags listed above.
- * @param syntax The type of regular expression syntax to use.
- * @exception REException The input pattern could not be parsed.
- * @exception NullPointerException The pattern was null.
- */
- public RE(Object pattern, int cflags, RESyntax syntax) throws REException {
- this(pattern,cflags,syntax,0,0);
- }
-
- // internal constructor used for alternation
- private RE(REToken first, REToken last,int subs, int subIndex, int minLength) {
- super(subIndex);
- firstToken = first;
- lastToken = last;
- numSubs = subs;
- minimumLength = minLength;
- addToken(new RETokenEndSub(subIndex));
- }
-
- private RE(Object patternObj, int cflags, RESyntax syntax, int myIndex, int nextSub) throws REException {
- super(myIndex); // Subexpression index of this token.
- initialize(patternObj, cflags, syntax, myIndex, nextSub);
- }
-
- // For use by subclasses
- protected RE() { super(0); }
-
- // The meat of construction
- protected void initialize(Object patternObj, int cflags, RESyntax syntax, int myIndex, int nextSub) throws REException {
- char[] pattern;
- if (patternObj instanceof String) {
- pattern = ((String) patternObj).toCharArray();
- } else if (patternObj instanceof char[]) {
- pattern = (char[]) patternObj;
- } else if (patternObj instanceof StringBuffer) {
- pattern = new char [((StringBuffer) patternObj).length()];
- ((StringBuffer) patternObj).getChars(0,pattern.length,pattern,0);
- } else {
- pattern = patternObj.toString().toCharArray();
- }
-
- int pLength = pattern.length;
-
- numSubs = 0; // Number of subexpressions in this token.
- Vector branches = null;
-
- // linked list of tokens (sort of -- some closed loops can exist)
- firstToken = lastToken = null;
-
- // Precalculate these so we don't pay for the math every time we
- // need to access them.
- boolean insens = ((cflags & REG_ICASE) > 0);
-
- // Parse pattern into tokens. Does anyone know if it's more efficient
- // to use char[] than a String.charAt()? I'm assuming so.
-
- // index tracks the position in the char array
- int index = 0;
-
- // this will be the current parse character (pattern[index])
- CharUnit unit = new CharUnit();
-
- // This is used for {x,y} calculations
- IntPair minMax = new IntPair();
-
- // Buffer a token so we can create a TokenRepeated, etc.
- REToken currentToken = null;
- char ch;
- boolean quot = false;
-
- while (index < pLength) {
- // read the next character unit (including backslash escapes)
- index = getCharUnit(pattern,index,unit,quot);
-
- if (unit.bk)
- if (unit.ch == 'Q') {
- quot = true;
- continue;
- } else if (unit.ch == 'E') {
- quot = false;
- continue;
- }
- if (quot)
- unit.bk = false;
-
- // ALTERNATION OPERATOR
- // \| or | (if RE_NO_BK_VBAR) or newline (if RE_NEWLINE_ALT)
- // not available if RE_LIMITED_OPS is set
-
- // TODO: the '\n' literal here should be a test against REToken.newline,
- // which unfortunately may be more than a single character.
- if ( ( (unit.ch == '|' && (syntax.get(RESyntax.RE_NO_BK_VBAR) ^ (unit.bk || quot)))
- || (syntax.get(RESyntax.RE_NEWLINE_ALT) && (unit.ch == '\n') && !(unit.bk || quot)) )
- && !syntax.get(RESyntax.RE_LIMITED_OPS)) {
- // make everything up to here be a branch. create vector if nec.
- addToken(currentToken);
- RE theBranch = new RE(firstToken, lastToken, numSubs, subIndex, minimumLength);
- minimumLength = 0;
- if (branches == null) {
- branches = new Vector();
- }
- branches.addElement(theBranch);
- firstToken = lastToken = currentToken = null;
- }
-
- // INTERVAL OPERATOR:
- // {x} | {x,} | {x,y} (RE_INTERVALS && RE_NO_BK_BRACES)
- // \{x\} | \{x,\} | \{x,y\} (RE_INTERVALS && !RE_NO_BK_BRACES)
- //
- // OPEN QUESTION:
- // what is proper interpretation of '{' at start of string?
-
- else if ((unit.ch == '{') && syntax.get(RESyntax.RE_INTERVALS) && (syntax.get(RESyntax.RE_NO_BK_BRACES) ^ (unit.bk || quot))) {
- int newIndex = getMinMax(pattern,index,minMax,syntax);
- if (newIndex > index) {
- if (minMax.first > minMax.second)
- throw new REException(getLocalizedMessage("interval.order"),REException.REG_BADRPT,newIndex);
- if (currentToken == null)
- throw new REException(getLocalizedMessage("repeat.no.token"),REException.REG_BADRPT,newIndex);
- if (currentToken instanceof RETokenRepeated)
- throw new REException(getLocalizedMessage("repeat.chained"),REException.REG_BADRPT,newIndex);
- if (currentToken instanceof RETokenWordBoundary || currentToken instanceof RETokenWordBoundary)
- throw new REException(getLocalizedMessage("repeat.assertion"),REException.REG_BADRPT,newIndex);
- if ((currentToken.getMinimumLength() == 0) && (minMax.second == Integer.MAX_VALUE))
- throw new REException(getLocalizedMessage("repeat.empty.token"),REException.REG_BADRPT,newIndex);
- index = newIndex;
- currentToken = setRepeated(currentToken,minMax.first,minMax.second,index);
- }
- else {
- addToken(currentToken);
- currentToken = new RETokenChar(subIndex,unit.ch,insens);
- }
- }
-
- // LIST OPERATOR:
- // [...] | [^...]
-
- else if ((unit.ch == '[') && !(unit.bk || quot)) {
- Vector options = new Vector();
- boolean negative = false;
- char lastChar = 0;
- if (index == pLength) throw new REException(getLocalizedMessage("unmatched.bracket"),REException.REG_EBRACK,index);
-
- // Check for initial caret, negation
- if ((ch = pattern[index]) == '^') {
- negative = true;
- if (++index == pLength) throw new REException(getLocalizedMessage("class.no.end"),REException.REG_EBRACK,index);
- ch = pattern[index];
- }
-
- // Check for leading right bracket literal
- if (ch == ']') {
- lastChar = ch;
- if (++index == pLength) throw new REException(getLocalizedMessage("class.no.end"),REException.REG_EBRACK,index);
- }
-
- while ((ch = pattern[index++]) != ']') {
- if ((ch == '-') && (lastChar != 0)) {
- if (index == pLength) throw new REException(getLocalizedMessage("class.no.end"),REException.REG_EBRACK,index);
- if ((ch = pattern[index]) == ']') {
- options.addElement(new RETokenChar(subIndex,lastChar,insens));
- lastChar = '-';
- } else {
- options.addElement(new RETokenRange(subIndex,lastChar,ch,insens));
- lastChar = 0;
- index++;
- }
- } else if ((ch == '\\') && syntax.get(RESyntax.RE_BACKSLASH_ESCAPE_IN_LISTS)) {
- if (index == pLength) throw new REException(getLocalizedMessage("class.no.end"),REException.REG_EBRACK,index);
- int posixID = -1;
- boolean negate = false;
- char asciiEsc = 0;
- if (("dswDSW".indexOf(pattern[index]) != -1) && syntax.get(RESyntax.RE_CHAR_CLASS_ESC_IN_LISTS)) {
- switch (pattern[index]) {
- case 'D':
- negate = true;
- case 'd':
- posixID = RETokenPOSIX.DIGIT;
- break;
- case 'S':
- negate = true;
- case 's':
- posixID = RETokenPOSIX.SPACE;
- break;
- case 'W':
- negate = true;
- case 'w':
- posixID = RETokenPOSIX.ALNUM;
- break;
- }
- }
- else if ("nrt".indexOf(pattern[index]) != -1) {
- switch (pattern[index]) {
- case 'n':
- asciiEsc = '\n';
- break;
- case 't':
- asciiEsc = '\t';
- break;
- case 'r':
- asciiEsc = '\r';
- break;
- }
- }
- if (lastChar != 0) options.addElement(new RETokenChar(subIndex,lastChar,insens));
-
- if (posixID != -1) {
- options.addElement(new RETokenPOSIX(subIndex,posixID,insens,negate));
- } else if (asciiEsc != 0) {
- lastChar = asciiEsc;
- } else {
- lastChar = pattern[index];
- }
- ++index;
- } else if ((ch == '[') && (syntax.get(RESyntax.RE_CHAR_CLASSES)) && (index < pLength) && (pattern[index] == ':')) {
- StringBuffer posixSet = new StringBuffer();
- index = getPosixSet(pattern,index+1,posixSet);
- int posixId = RETokenPOSIX.intValue(posixSet.toString());
- if (posixId != -1)
- options.addElement(new RETokenPOSIX(subIndex,posixId,insens,false));
- } else {
- if (lastChar != 0) options.addElement(new RETokenChar(subIndex,lastChar,insens));
- lastChar = ch;
- }
- if (index == pLength) throw new REException(getLocalizedMessage("class.no.end"),REException.REG_EBRACK,index);
- } // while in list
- // Out of list, index is one past ']'
-
- if (lastChar != 0) options.addElement(new RETokenChar(subIndex,lastChar,insens));
-
- // Create a new RETokenOneOf
- addToken(currentToken);
- options.trimToSize();
- currentToken = new RETokenOneOf(subIndex,options,negative);
- }
-
- // SUBEXPRESSIONS
- // (...) | \(...\) depending on RE_NO_BK_PARENS
-
- else if ((unit.ch == '(') && (syntax.get(RESyntax.RE_NO_BK_PARENS) ^ (unit.bk || quot))) {
- boolean pure = false;
- boolean comment = false;
- boolean lookAhead = false;
- boolean negativelh = false;
- if ((index+1 < pLength) && (pattern[index] == '?')) {
- switch (pattern[index+1]) {
- case '!':
- if (syntax.get(RESyntax.RE_LOOKAHEAD)) {
- pure = true;
- negativelh = true;
- lookAhead = true;
- index += 2;
- }
- break;
- case '=':
- if (syntax.get(RESyntax.RE_LOOKAHEAD)) {
- pure = true;
- lookAhead = true;
- index += 2;
- }
- break;
- case ':':
- if (syntax.get(RESyntax.RE_PURE_GROUPING)) {
- pure = true;
- index += 2;
- }
- break;
- case '#':
- if (syntax.get(RESyntax.RE_COMMENTS)) {
- comment = true;
- }
- break;
- default:
- throw new REException(getLocalizedMessage("repeat.no.token"), REException.REG_BADRPT, index);
- }
- }
-
- if (index >= pLength) {
- throw new REException(getLocalizedMessage("unmatched.paren"), REException.REG_ESUBREG,index);
- }
-
- // find end of subexpression
- int endIndex = index;
- int nextIndex = index;
- int nested = 0;
-
- while ( ((nextIndex = getCharUnit(pattern,endIndex,unit,false)) > 0)
- && !(nested == 0 && (unit.ch == ')') && (syntax.get(RESyntax.RE_NO_BK_PARENS) ^ (unit.bk || quot))) )
- if ((endIndex = nextIndex) >= pLength)
- throw new REException(getLocalizedMessage("subexpr.no.end"),REException.REG_ESUBREG,nextIndex);
- else if (unit.ch == '(' && (syntax.get(RESyntax.RE_NO_BK_PARENS) ^ (unit.bk || quot)))
- nested++;
- else if (unit.ch == ')' && (syntax.get(RESyntax.RE_NO_BK_PARENS) ^ (unit.bk || quot)))
- nested--;
-
- // endIndex is now position at a ')','\)'
- // nextIndex is end of string or position after ')' or '\)'
-
- if (comment) index = nextIndex;
- else { // not a comment
- // create RE subexpression as token.
- addToken(currentToken);
- if (!pure) {
- numSubs++;
- }
-
- int useIndex = (pure || lookAhead) ? 0 : nextSub + numSubs;
- currentToken = new RE(String.valueOf(pattern,index,endIndex-index).toCharArray(),cflags,syntax,useIndex,nextSub + numSubs);
- numSubs += ((RE) currentToken).getNumSubs();
-
- if (lookAhead) {
- currentToken = new RETokenLookAhead(currentToken,negativelh);
- }
-
- index = nextIndex;
- } // not a comment
- } // subexpression
-
- // UNMATCHED RIGHT PAREN
- // ) or \) throw exception if
- // !syntax.get(RESyntax.RE_UNMATCHED_RIGHT_PAREN_ORD)
- else if (!syntax.get(RESyntax.RE_UNMATCHED_RIGHT_PAREN_ORD) && ((unit.ch == ')') && (syntax.get(RESyntax.RE_NO_BK_PARENS) ^ (unit.bk || quot)))) {
- throw new REException(getLocalizedMessage("unmatched.paren"),REException.REG_EPAREN,index);
- }
-
- // START OF LINE OPERATOR
- // ^
-
- else if ((unit.ch == '^') && !(unit.bk || quot)) {
- addToken(currentToken);
- currentToken = null;
- addToken(new RETokenStart(subIndex,((cflags & REG_MULTILINE) > 0) ? syntax.getLineSeparator() : null));
- }
-
- // END OF LINE OPERATOR
- // $
-
- else if ((unit.ch == '$') && !(unit.bk || quot)) {
- addToken(currentToken);
- currentToken = null;
- addToken(new RETokenEnd(subIndex,((cflags & REG_MULTILINE) > 0) ? syntax.getLineSeparator() : null));
- }
-
- // MATCH-ANY-CHARACTER OPERATOR (except possibly newline and null)
- // .
-
- else if ((unit.ch == '.') && !(unit.bk || quot)) {
- addToken(currentToken);
- currentToken = new RETokenAny(subIndex,syntax.get(RESyntax.RE_DOT_NEWLINE) || ((cflags & REG_DOT_NEWLINE) > 0),syntax.get(RESyntax.RE_DOT_NOT_NULL));
- }
-
- // ZERO-OR-MORE REPEAT OPERATOR
- // *
-
- else if ((unit.ch == '*') && !(unit.bk || quot)) {
- if (currentToken == null)
- throw new REException(getLocalizedMessage("repeat.no.token"),REException.REG_BADRPT,index);
- if (currentToken instanceof RETokenRepeated)
- throw new REException(getLocalizedMessage("repeat.chained"),REException.REG_BADRPT,index);
- if (currentToken instanceof RETokenWordBoundary || currentToken instanceof RETokenWordBoundary)
- throw new REException(getLocalizedMessage("repeat.assertion"),REException.REG_BADRPT,index);
- if (currentToken.getMinimumLength() == 0)
- throw new REException(getLocalizedMessage("repeat.empty.token"),REException.REG_BADRPT,index);
- currentToken = setRepeated(currentToken,0,Integer.MAX_VALUE,index);
- }
-
- // ONE-OR-MORE REPEAT OPERATOR / POSSESSIVE MATCHING OPERATOR
- // + | \+ depending on RE_BK_PLUS_QM
- // not available if RE_LIMITED_OPS is set
-
- else if ((unit.ch == '+') && !syntax.get(RESyntax.RE_LIMITED_OPS) && (!syntax.get(RESyntax.RE_BK_PLUS_QM) ^ (unit.bk || quot))) {
- if (currentToken == null)
- throw new REException(getLocalizedMessage("repeat.no.token"),REException.REG_BADRPT,index);
-
- // Check for possessive matching on RETokenRepeated
- if (currentToken instanceof RETokenRepeated) {
- RETokenRepeated tokenRep = (RETokenRepeated)currentToken;
- if (syntax.get(RESyntax.RE_POSSESSIVE_OPS) && !tokenRep.isPossessive() && !tokenRep.isStingy())
- tokenRep.makePossessive();
- else
- throw new REException(getLocalizedMessage("repeat.chained"),REException.REG_BADRPT,index);
-
- }
- else if (currentToken instanceof RETokenWordBoundary || currentToken instanceof RETokenWordBoundary)
- throw new REException(getLocalizedMessage("repeat.assertion"),REException.REG_BADRPT,index);
- else if (currentToken.getMinimumLength() == 0)
- throw new REException(getLocalizedMessage("repeat.empty.token"),REException.REG_BADRPT,index);
- else
- currentToken = setRepeated(currentToken,1,Integer.MAX_VALUE,index);
- }
-
- // ZERO-OR-ONE REPEAT OPERATOR / STINGY MATCHING OPERATOR
- // ? | \? depending on RE_BK_PLUS_QM
- // not available if RE_LIMITED_OPS is set
- // stingy matching if RE_STINGY_OPS is set and it follows a quantifier
-
- else if ((unit.ch == '?') && !syntax.get(RESyntax.RE_LIMITED_OPS) && (!syntax.get(RESyntax.RE_BK_PLUS_QM) ^ (unit.bk || quot))) {
- if (currentToken == null) throw new REException(getLocalizedMessage("repeat.no.token"),REException.REG_BADRPT,index);
-
- // Check for stingy matching on RETokenRepeated
- if (currentToken instanceof RETokenRepeated) {
- RETokenRepeated tokenRep = (RETokenRepeated)currentToken;
- if (syntax.get(RESyntax.RE_STINGY_OPS) && !tokenRep.isStingy() && !tokenRep.isPossessive())
- tokenRep.makeStingy();
- else
- throw new REException(getLocalizedMessage("repeat.chained"),REException.REG_BADRPT,index);
- }
- else if (currentToken instanceof RETokenWordBoundary || currentToken instanceof RETokenWordBoundary)
- throw new REException(getLocalizedMessage("repeat.assertion"),REException.REG_BADRPT,index);
- else
- currentToken = setRepeated(currentToken,0,1,index);
- }
-
- // BACKREFERENCE OPERATOR
- // \1 \2 ... \9
- // not available if RE_NO_BK_REFS is set
-
- else if (unit.bk && Character.isDigit(unit.ch) && !syntax.get(RESyntax.RE_NO_BK_REFS)) {
- addToken(currentToken);
- currentToken = new RETokenBackRef(subIndex,Character.digit(unit.ch,10),insens);
- }
-
- // START OF STRING OPERATOR
- // \A if RE_STRING_ANCHORS is set
-
- else if (unit.bk && (unit.ch == 'A') && syntax.get(RESyntax.RE_STRING_ANCHORS)) {
- addToken(currentToken);
- currentToken = new RETokenStart(subIndex,null);
- }
-
- // WORD BREAK OPERATOR
- // \b if ????
-
- else if (unit.bk && (unit.ch == 'b') && syntax.get(RESyntax.RE_STRING_ANCHORS)) {
- addToken(currentToken);
- currentToken = new RETokenWordBoundary(subIndex, RETokenWordBoundary.BEGIN | RETokenWordBoundary.END, false);
- }
-
- // WORD BEGIN OPERATOR
- // \< if ????
- else if (unit.bk && (unit.ch == '<')) {
- addToken(currentToken);
- currentToken = new RETokenWordBoundary(subIndex, RETokenWordBoundary.BEGIN, false);
- }
-
- // WORD END OPERATOR
- // \> if ????
- else if (unit.bk && (unit.ch == '>')) {
- addToken(currentToken);
- currentToken = new RETokenWordBoundary(subIndex, RETokenWordBoundary.END, false);
- }
-
- // NON-WORD BREAK OPERATOR
- // \B if ????
-
- else if (unit.bk && (unit.ch == 'B') && syntax.get(RESyntax.RE_STRING_ANCHORS)) {
- addToken(currentToken);
- currentToken = new RETokenWordBoundary(subIndex, RETokenWordBoundary.BEGIN | RETokenWordBoundary.END, true);
- }
-
-
- // DIGIT OPERATOR
- // \d if RE_CHAR_CLASS_ESCAPES is set
-
- else if (unit.bk && (unit.ch == 'd') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {
- addToken(currentToken);
- currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.DIGIT,insens,false);
- }
-
- // NON-DIGIT OPERATOR
- // \D
-
- else if (unit.bk && (unit.ch == 'D') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {
- addToken(currentToken);
- currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.DIGIT,insens,true);
- }
-
- // NEWLINE ESCAPE
- // \n
-
- else if (unit.bk && (unit.ch == 'n')) {
- addToken(currentToken);
- currentToken = new RETokenChar(subIndex,'\n',false);
- }
-
- // RETURN ESCAPE
- // \r
-
- else if (unit.bk && (unit.ch == 'r')) {
- addToken(currentToken);
- currentToken = new RETokenChar(subIndex,'\r',false);
- }
-
- // WHITESPACE OPERATOR
- // \s if RE_CHAR_CLASS_ESCAPES is set
-
- else if (unit.bk && (unit.ch == 's') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {
- addToken(currentToken);
- currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.SPACE,insens,false);
- }
-
- // NON-WHITESPACE OPERATOR
- // \S
-
- else if (unit.bk && (unit.ch == 'S') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {
- addToken(currentToken);
- currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.SPACE,insens,true);
- }
-
- // TAB ESCAPE
- // \t
-
- else if (unit.bk && (unit.ch == 't')) {
- addToken(currentToken);
- currentToken = new RETokenChar(subIndex,'\t',false);
- }
-
- // ALPHANUMERIC OPERATOR
- // \w
-
- else if (unit.bk && (unit.ch == 'w') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {
- addToken(currentToken);
- currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.ALNUM,insens,false);
- }
-
- // NON-ALPHANUMERIC OPERATOR
- // \W
-
- else if (unit.bk && (unit.ch == 'W') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {
- addToken(currentToken);
- currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.ALNUM,insens,true);
- }
-
- // END OF STRING OPERATOR
- // \Z
-
- else if (unit.bk && (unit.ch == 'Z') && syntax.get(RESyntax.RE_STRING_ANCHORS)) {
- addToken(currentToken);
- currentToken = new RETokenEnd(subIndex,null);
- }
-
- // NON-SPECIAL CHARACTER (or escape to make literal)
- // c | \* for example
-
- else { // not a special character
- addToken(currentToken);
- currentToken = new RETokenChar(subIndex,unit.ch,insens);
- }
- } // end while
-
- // Add final buffered token and an EndSub marker
- addToken(currentToken);
-
- if (branches != null) {
- branches.addElement(new RE(firstToken,lastToken,numSubs,subIndex,minimumLength));
- branches.trimToSize(); // compact the Vector
- minimumLength = 0;
- firstToken = lastToken = null;
- addToken(new RETokenOneOf(subIndex,branches,false));
- }
- else addToken(new RETokenEndSub(subIndex));
-
- }
-
- private static int getCharUnit(char[] input, int index, CharUnit unit, boolean quot) throws REException {
- unit.ch = input[index++];
- if (unit.bk = (unit.ch == '\\' && (!quot || index >= input.length || input[index] == 'E')))
- if (index < input.length)
- unit.ch = input[index++];
- else throw new REException(getLocalizedMessage("ends.with.backslash"),REException.REG_ESCAPE,index);
- return index;
- }
-
- /**
- * Checks if the regular expression matches the input in its entirety.
- *
- * @param input The input text.
- */
- public boolean isMatch(Object input) {
- return isMatch(input,0,0);
- }
-
- /**
- * Checks if the input string, starting from index, is an exact match of
- * this regular expression.
- *
- * @param input The input text.
- * @param index The offset index at which the search should be begin.
- */
- public boolean isMatch(Object input,int index) {
- return isMatch(input,index,0);
- }
-
-
- /**
- * Checks if the input, starting from index and using the specified
- * execution flags, is an exact match of this regular expression.
- *
- * @param input The input text.
- * @param index The offset index at which the search should be begin.
- * @param eflags The logical OR of any execution flags above.
- */
- public boolean isMatch(Object input,int index,int eflags) {
- return isMatchImpl(makeCharIndexed(input,index),index,eflags);
- }
-
- private boolean isMatchImpl(CharIndexed input, int index, int eflags) {
- if (firstToken == null) // Trivial case
- return (input.charAt(0) == CharIndexed.OUT_OF_BOUNDS);
- REMatch m = new REMatch(numSubs, index, eflags);
- if (firstToken.match(input, m)) {
- while (m != null) {
- if (input.charAt(m.index) == CharIndexed.OUT_OF_BOUNDS) {
- return true;
- }
- m = m.next;
- }
- }
- return false;
- }
-
- /**
- * Returns the maximum number of subexpressions in this regular expression.
- * If the expression contains branches, the value returned will be the
- * maximum subexpressions in any of the branches.
- */
- public int getNumSubs() {
- return numSubs;
- }
-
- // Overrides REToken.setUncle
- void setUncle(REToken uncle) {
- if (lastToken != null) {
- lastToken.setUncle(uncle);
- } else super.setUncle(uncle); // to deal with empty subexpressions
- }
-
- // Overrides REToken.chain
-
- boolean chain(REToken next) {
- super.chain(next);
- setUncle(next);
- return true;
- }
-
- /**
- * Returns the minimum number of characters that could possibly
- * constitute a match of this regular expression.
- */
- public int getMinimumLength() {
- return minimumLength;
- }
-
- /**
- * Returns an array of all matches found in the input.
- *
- * If the regular expression allows the empty string to match, it will
- * substitute matches at all positions except the end of the input.
- *
- * @param input The input text.
- * @return a non-null (but possibly zero-length) array of matches
- */
- public REMatch[] getAllMatches(Object input) {
- return getAllMatches(input,0,0);
- }
-
- /**
- * Returns an array of all matches found in the input,
- * beginning at the specified index position.
- *
- * If the regular expression allows the empty string to match, it will
- * substitute matches at all positions except the end of the input.
- *
- * @param input The input text.
- * @param index The offset index at which the search should be begin.
- * @return a non-null (but possibly zero-length) array of matches
- */
- public REMatch[] getAllMatches(Object input, int index) {
- return getAllMatches(input,index,0);
- }
-
- /**
- * Returns an array of all matches found in the input string,
- * beginning at the specified index position and using the specified
- * execution flags.
- *
- * If the regular expression allows the empty string to match, it will
- * substitute matches at all positions except the end of the input.
- *
- * @param input The input text.
- * @param index The offset index at which the search should be begin.
- * @param eflags The logical OR of any execution flags above.
- * @return a non-null (but possibly zero-length) array of matches
- */
- public REMatch[] getAllMatches(Object input, int index, int eflags) {
- return getAllMatchesImpl(makeCharIndexed(input,index),index,eflags);
- }
-
- // this has been changed since 1.03 to be non-overlapping matches
- private REMatch[] getAllMatchesImpl(CharIndexed input, int index, int eflags) {
- Vector all = new Vector();
- REMatch m = null;
- while ((m = getMatchImpl(input,index,eflags,null)) != null) {
- all.addElement(m);
- index = m.getEndIndex();
- if (m.end[0] == 0) { // handle pathological case of zero-length match
- index++;
- input.move(1);
- } else {
- input.move(m.end[0]);
- }
- if (!input.isValid()) break;
- }
- REMatch[] mset = new REMatch[all.size()];
- all.copyInto(mset);
- return mset;
- }
-
- /* Implements abstract method REToken.match() */
- boolean match(CharIndexed input, REMatch mymatch) {
- if (firstToken == null) return next(input, mymatch);
-
- // Note the start of this subexpression
- mymatch.start[subIndex] = mymatch.index;
-
- return firstToken.match(input, mymatch);
- }
-
- /**
- * Returns the first match found in the input. If no match is found,
- * null is returned.
- *
- * @param input The input text.
- * @return An REMatch instance referencing the match, or null if none.
- */
- public REMatch getMatch(Object input) {
- return getMatch(input,0,0);
- }
-
- /**
- * Returns the first match found in the input, beginning
- * the search at the specified index. If no match is found,
- * returns null.
- *
- * @param input The input text.
- * @param index The offset within the text to begin looking for a match.
- * @return An REMatch instance referencing the match, or null if none.
- */
- public REMatch getMatch(Object input, int index) {
- return getMatch(input,index,0);
- }
-
- /**
- * Returns the first match found in the input, beginning
- * the search at the specified index, and using the specified
- * execution flags. If no match is found, returns null.
- *
- * @param input The input text.
- * @param index The offset index at which the search should be begin.
- * @param eflags The logical OR of any execution flags above.
- * @return An REMatch instance referencing the match, or null if none.
- */
- public REMatch getMatch(Object input, int index, int eflags) {
- return getMatch(input,index,eflags,null);
- }
-
- /**
- * Returns the first match found in the input, beginning the search
- * at the specified index, and using the specified execution flags.
- * If no match is found, returns null. If a StringBuffer is
- * provided and is non-null, the contents of the input text from the
- * index to the beginning of the match (or to the end of the input,
- * if there is no match) are appended to the StringBuffer.
- *
- * @param input The input text.
- * @param index The offset index at which the search should be begin.
- * @param eflags The logical OR of any execution flags above.
- * @param buffer The StringBuffer to save pre-match text in.
- * @return An REMatch instance referencing the match, or null if none. */
- public REMatch getMatch(Object input, int index, int eflags, StringBuffer buffer) {
- return getMatchImpl(makeCharIndexed(input,index),index,eflags,buffer);
- }
-
- REMatch getMatchImpl(CharIndexed input, int anchor, int eflags, StringBuffer buffer) {
- // Create a new REMatch to hold results
- REMatch mymatch = new REMatch(numSubs, anchor, eflags);
- do {
- // Optimization: check if anchor + minimumLength > length
- if (minimumLength == 0 || input.charAt(minimumLength-1) != CharIndexed.OUT_OF_BOUNDS) {
- if (match(input, mymatch)) {
- // Find longest match of them all to observe leftmost longest
- REMatch longest = mymatch;
- while ((mymatch = mymatch.next) != null) {
- if (mymatch.index > longest.index) {
- longest = mymatch;
- }
- }
-
- longest.end[0] = longest.index;
- longest.finish(input);
- return longest;
- }
- }
- mymatch.clear(++anchor);
- // Append character to buffer if needed
- if (buffer != null && input.charAt(0) != CharIndexed.OUT_OF_BOUNDS) {
- buffer.append(input.charAt(0));
- }
- } while (input.move(1));
-
- // Special handling at end of input for e.g. "$"
- if (minimumLength == 0) {
- if (match(input, mymatch)) {
- mymatch.finish(input);
- return mymatch;
- }
- }
-
- return null;
- }
-
- /**
- * Returns an REMatchEnumeration that can be used to iterate over the
- * matches found in the input text.
- *
- * @param input The input text.
- * @return A non-null REMatchEnumeration instance.
- */
- public REMatchEnumeration getMatchEnumeration(Object input) {
- return getMatchEnumeration(input,0,0);
- }
-
-
- /**
- * Returns an REMatchEnumeration that can be used to iterate over the
- * matches found in the input text.
- *
- * @param input The input text.
- * @param index The offset index at which the search should be begin.
- * @return A non-null REMatchEnumeration instance, with its input cursor
- * set to the index position specified.
- */
- public REMatchEnumeration getMatchEnumeration(Object input, int index) {
- return getMatchEnumeration(input,index,0);
- }
-
- /**
- * Returns an REMatchEnumeration that can be used to iterate over the
- * matches found in the input text.
- *
- * @param input The input text.
- * @param index The offset index at which the search should be begin.
- * @param eflags The logical OR of any execution flags above.
- * @return A non-null REMatchEnumeration instance, with its input cursor
- * set to the index position specified.
- */
- public REMatchEnumeration getMatchEnumeration(Object input, int index, int eflags) {
- return new REMatchEnumeration(this,makeCharIndexed(input,index),index,eflags);
- }
-
-
- /**
- * Substitutes the replacement text for the first match found in the input.
- *
- * @param input The input text.
- * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
- * @return A String interpolating the substituted text.
- * @see REMatch#substituteInto
- */
- public String substitute(Object input,String replace) {
- return substitute(input,replace,0,0);
- }
-
- /**
- * Substitutes the replacement text for the first match found in the input
- * beginning at the specified index position. Specifying an index
- * effectively causes the regular expression engine to throw away the
- * specified number of characters.
- *
- * @param input The input text.
- * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
- * @param index The offset index at which the search should be begin.
- * @return A String containing the substring of the input, starting
- * at the index position, and interpolating the substituted text.
- * @see REMatch#substituteInto
- */
- public String substitute(Object input,String replace,int index) {
- return substitute(input,replace,index,0);
- }
-
- /**
- * Substitutes the replacement text for the first match found in the input
- * string, beginning at the specified index position and using the
- * specified execution flags.
- *
- * @param input The input text.
- * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
- * @param index The offset index at which the search should be begin.
- * @param eflags The logical OR of any execution flags above.
- * @return A String containing the substring of the input, starting
- * at the index position, and interpolating the substituted text.
- * @see REMatch#substituteInto
- */
- public String substitute(Object input,String replace,int index,int eflags) {
- return substituteImpl(makeCharIndexed(input,index),replace,index,eflags);
- }
-
- private String substituteImpl(CharIndexed input,String replace,int index,int eflags) {
- StringBuffer buffer = new StringBuffer();
- REMatch m = getMatchImpl(input,index,eflags,buffer);
- if (m==null) return buffer.toString();
- buffer.append( ((eflags & REG_NO_INTERPOLATE) > 0) ?
- replace : m.substituteInto(replace) );
- if (input.move(m.end[0])) {
- do {
- buffer.append(input.charAt(0));
- } while (input.move(1));
- }
- return buffer.toString();
- }
-
- /**
- * Substitutes the replacement text for each non-overlapping match found
- * in the input text.
- *
- * @param input The input text.
- * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
- * @return A String interpolating the substituted text.
- * @see REMatch#substituteInto
- */
- public String substituteAll(Object input,String replace) {
- return substituteAll(input,replace,0,0);
- }
-
- /**
- * Substitutes the replacement text for each non-overlapping match found
- * in the input text, starting at the specified index.
- *
- * If the regular expression allows the empty string to match, it will
- * substitute matches at all positions except the end of the input.
- *
- * @param input The input text.
- * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
- * @param index The offset index at which the search should be begin.
- * @return A String containing the substring of the input, starting
- * at the index position, and interpolating the substituted text.
- * @see REMatch#substituteInto
- */
- public String substituteAll(Object input,String replace,int index) {
- return substituteAll(input,replace,index,0);
- }
-
- /**
- * Substitutes the replacement text for each non-overlapping match found
- * in the input text, starting at the specified index and using the
- * specified execution flags.
- *
- * @param input The input text.
- * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
- * @param index The offset index at which the search should be begin.
- * @param eflags The logical OR of any execution flags above.
- * @return A String containing the substring of the input, starting
- * at the index position, and interpolating the substituted text.
- * @see REMatch#substituteInto
- */
- public String substituteAll(Object input,String replace,int index,int eflags) {
- return substituteAllImpl(makeCharIndexed(input,index),replace,index,eflags);
- }
-
- private String substituteAllImpl(CharIndexed input,String replace,int index,int eflags) {
- StringBuffer buffer = new StringBuffer();
- REMatch m;
- while ((m = getMatchImpl(input,index,eflags,buffer)) != null) {
- buffer.append( ((eflags & REG_NO_INTERPOLATE) > 0) ?
- replace : m.substituteInto(replace) );
- index = m.getEndIndex();
- if (m.end[0] == 0) {
- char ch = input.charAt(0);
- if (ch != CharIndexed.OUT_OF_BOUNDS)
- buffer.append(ch);
- input.move(1);
- } else {
- input.move(m.end[0]);
- }
-
- if (!input.isValid()) break;
- }
- return buffer.toString();
- }
-
- /* Helper function for constructor */
- private void addToken(REToken next) {
- if (next == null) return;
- minimumLength += next.getMinimumLength();
- if (firstToken == null) {
- lastToken = firstToken = next;
- } else {
- // if chain returns false, it "rejected" the token due to
- // an optimization, and next was combined with lastToken
- if (lastToken.chain(next)) {
- lastToken = next;
- }
- }
- }
-
- private static REToken setRepeated(REToken current, int min, int max, int index) throws REException {
- if (current == null) throw new REException(getLocalizedMessage("repeat.no.token"),REException.REG_BADRPT,index);
- return new RETokenRepeated(current.subIndex,current,min,max);
- }
-
- private static int getPosixSet(char[] pattern,int index,StringBuffer buf) {
- // Precondition: pattern[index-1] == ':'
- // we will return pos of closing ']'.
- int i;
- for (i=index; i<(pattern.length-1); i++) {
- if ((pattern[i] == ':') && (pattern[i+1] == ']'))
- return i+2;
- buf.append(pattern[i]);
- }
- return index; // didn't match up
- }
-
- private int getMinMax(char[] input,int index,IntPair minMax,RESyntax syntax) throws REException {
- // Precondition: input[index-1] == '{', minMax != null
-
- boolean mustMatch = !syntax.get(RESyntax.RE_NO_BK_BRACES);
- int startIndex = index;
- if (index == input.length) {
- if (mustMatch)
- throw new REException(getLocalizedMessage("unmatched.brace"),REException.REG_EBRACE,index);
- else
- return startIndex;
- }
-
- int min,max=0;
- CharUnit unit = new CharUnit();
- StringBuffer buf = new StringBuffer();
-
- // Read string of digits
- do {
- index = getCharUnit(input,index,unit,false);
- if (Character.isDigit(unit.ch))
- buf.append(unit.ch);
- } while ((index != input.length) && Character.isDigit(unit.ch));
-
- // Check for {} tomfoolery
- if (buf.length() == 0) {
- if (mustMatch)
- throw new REException(getLocalizedMessage("interval.error"),REException.REG_EBRACE,index);
- else
- return startIndex;
- }
-
- min = Integer.parseInt(buf.toString());
-
- if ((unit.ch == '}') && (syntax.get(RESyntax.RE_NO_BK_BRACES) ^ unit.bk))
- max = min;
- else if (index == input.length)
- if (mustMatch)
- throw new REException(getLocalizedMessage("interval.no.end"),REException.REG_EBRACE,index);
- else
- return startIndex;
- else if ((unit.ch == ',') && !unit.bk) {
- buf = new StringBuffer();
- // Read string of digits
- while (((index = getCharUnit(input,index,unit,false)) != input.length) && Character.isDigit(unit.ch))
- buf.append(unit.ch);
-
- if (!((unit.ch == '}') && (syntax.get(RESyntax.RE_NO_BK_BRACES) ^ unit.bk)))
- if (mustMatch)
- throw new REException(getLocalizedMessage("interval.error"),REException.REG_EBRACE,index);
- else
- return startIndex;
-
- // This is the case of {x,}
- if (buf.length() == 0) max = Integer.MAX_VALUE;
- else max = Integer.parseInt(buf.toString());
- } else
- if (mustMatch)
- throw new REException(getLocalizedMessage("interval.error"),REException.REG_EBRACE,index);
- else
- return startIndex;
-
- // We know min and max now, and they are valid.
-
- minMax.first = min;
- minMax.second = max;
-
- // return the index following the '}'
- return index;
- }
-
- /**
- * Return a human readable form of the compiled regular expression,
- * useful for debugging.
- */
- public String toString() {
- StringBuffer sb = new StringBuffer();
- dump(sb);
- return sb.toString();
- }
-
- void dump(StringBuffer os) {
- os.append('(');
- if (subIndex == 0)
- os.append("?:");
- if (firstToken != null)
- firstToken.dumpAll(os);
- os.append(')');
- }
-
- // Cast input appropriately or throw exception
- private static CharIndexed makeCharIndexed(Object input, int index) {
- // We could let a String fall through to final input, but since
- // it's the most likely input type, we check it first.
- if (input instanceof String)
- return new CharIndexedString((String) input,index);
- else if (input instanceof char[])
- return new CharIndexedCharArray((char[]) input,index);
- else if (input instanceof StringBuffer)
- return new CharIndexedStringBuffer((StringBuffer) input,index);
- else if (input instanceof InputStream)
- return new CharIndexedInputStream((InputStream) input,index);
- else if (input instanceof CharIndexed)
- return (CharIndexed) input; // do we lose index info?
- else
- return new CharIndexedString(input.toString(), index);
- }
-}
diff --git a/libjava/gnu/regexp/REException.java b/libjava/gnu/regexp/REException.java
deleted file mode 100644
index 73f86fa8add..00000000000
--- a/libjava/gnu/regexp/REException.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/* gnu/regexp/REException.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-import java.text.MessageFormat;
-
-/**
- * This is the regular expression exception class. An exception of this type
- * defines the three attributes:
- * <OL>
- * <LI> A descriptive message of the error.
- * <LI> An integral type code equivalent to one of the statically
- * defined symbols listed below.
- * <LI> The approximate position in the input string where the error
- * occurred.
- * </OL>
- *
- * @author <A HREF="mailto:wes@cacas.org">Wes Biggs</A>
- */
-
-public class REException extends Exception {
- private int type;
- private int pos;
-
- // Error conditions from GNU regcomp(3) manual
-
- /**
- * Error flag.
- * Invalid use of repetition operators such as using
- * `*' as the first character.
- */
- public static final int REG_BADRPT = 1;
-
- /**
- * Error flag.
- * Invalid use of back reference operator.
- */
- public static final int REG_BADBR = 2;
-
- /**
- * Error flag.
- * Un-matched brace interval operators.
- */
- public static final int REG_EBRACE = 3;
-
- /**
- * Error flag.
- * Un-matched bracket list operators.
- */
- public static final int REG_EBRACK = 4;
-
- /**
- * Error flag.
- * Invalid use of the range operator, eg. the ending
- * point of the range occurs prior to the starting
- * point.
- */
- public static final int REG_ERANGE = 5;
-
- /**
- * Error flag.
- * Unknown character class name. <B>Not implemented</B>.
- */
- public static final int REG_ECTYPE = 6;
-
- /**
- * Error flag.
- * Un-matched parenthesis group operators.
- */
- public static final int REG_EPAREN = 7;
-
- /**
- * Error flag.
- * Invalid back reference to a subexpression.
- */
- public static final int REG_ESUBREG = 8;
-
- /**
- * Error flag.
- * Non specific error. <B>Not implemented</B>.
- */
- public static final int REG_EEND = 9;
-
- /**
- * Error flag.
- * Invalid escape sequence. <B>Not implemented</B>.
- */
- public static final int REG_ESCAPE = 10;
-
- /**
- * Error flag.
- * Invalid use of pattern operators such as group or list.
- */
- public static final int REG_BADPAT = 11;
-
- /**
- * Error flag.
- * Compiled regular expression requires a pattern
- * buffer larger than 64Kb. <B>Not implemented</B>.
- */
- public static final int REG_ESIZE = 12;
-
- /**
- * Error flag.
- * The regex routines ran out of memory. <B>Not implemented</B>.
- */
- public static final int REG_ESPACE = 13;
-
- REException(String msg, int type, int position) {
- super(msg);
- this.type = type;
- this.pos = position;
- }
-
- /**
- * Returns the type of the exception, one of the constants listed above.
- */
-
- public int getType() {
- return type;
- }
-
- /**
- * Returns the position, relative to the string or character array being
- * compiled, where the error occurred. This position is generally the point
- * where the error was detected, not necessarily the starting index of
- * a bad subexpression.
- */
- public int getPosition() {
- return pos;
- }
-
- /**
- * Reports the descriptive message associated with this exception
- * as well as its index position in the string or character array
- * being compiled.
- */
- public String getMessage() {
- Object[] args = {new Integer(pos)};
- StringBuffer sb = new StringBuffer();
- String prefix = RE.getLocalizedMessage("error.prefix");
- sb.append(MessageFormat.format(prefix, args));
- sb.append('\n');
- sb.append(super.getMessage());
- return sb.toString();
- }
-}
diff --git a/libjava/gnu/regexp/REFilterInputStream.java b/libjava/gnu/regexp/REFilterInputStream.java
deleted file mode 100644
index 485de56605d..00000000000
--- a/libjava/gnu/regexp/REFilterInputStream.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* gnu/regexp/REFilterInputStream.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.io.FilterInputStream;
-import java.io.InputStream;
-
-/**
- * Replaces instances of a given RE found within an InputStream
- * with replacement text. The replacements are interpolated into the
- * stream when a match is found.
- *
- * @author <A HREF="mailto:wes@cacas.org">Wes Biggs</A>
- * @deprecated This class cannot properly handle all character
- * encodings. For proper handling, use the REFilterReader
- * class instead.
- */
-
-public class REFilterInputStream extends FilterInputStream {
-
- private RE expr;
- private String replace;
- private String buffer;
- private int bufpos;
- private int offset;
- private CharIndexedInputStream stream;
-
- /**
- * Creates an REFilterInputStream. When reading from this stream,
- * occurrences of patterns matching the supplied regular expression
- * will be replaced with the supplied replacement text (the
- * metacharacters $0 through $9 may be used to refer to the full
- * match or subexpression matches).
- *
- * @param stream The InputStream to be filtered.
- * @param expr The regular expression to search for.
- * @param replace The text pattern to replace matches with.
- */
- public REFilterInputStream(InputStream stream, RE expr, String replace) {
- super(stream);
- this.stream = new CharIndexedInputStream(stream,0);
- this.expr = expr;
- this.replace = replace;
- }
-
- /**
- * Reads the next byte from the stream per the general contract of
- * InputStream.read(). Returns -1 on error or end of stream.
- */
- public int read() {
- // If we have buffered replace data, use it.
- if ((buffer != null) && (bufpos < buffer.length())) {
- return (int) buffer.charAt(bufpos++);
- }
-
- // check if input is at a valid position
- if (!stream.isValid()) return -1;
-
- REMatch mymatch = new REMatch(expr.getNumSubs(),offset,0);
- if (expr.match(stream, mymatch)) {
- mymatch.end[0] = mymatch.index;
- mymatch.finish(stream);
- stream.move(mymatch.toString().length());
- offset += mymatch.toString().length();
- buffer = mymatch.substituteInto(replace);
- bufpos = 1;
-
- // This is prone to infinite loops if replace string turns out empty.
- if (buffer.length() > 0) {
- return buffer.charAt(0);
- }
- }
- char ch = stream.charAt(0);
- if (ch == CharIndexed.OUT_OF_BOUNDS) return -1;
- stream.move(1);
- offset++;
- return ch;
- }
-
- /**
- * Returns false. REFilterInputStream does not support mark() and
- * reset() methods.
- */
- public boolean markSupported() {
- return false;
- }
-
- /** Reads from the stream into the provided array. */
- public int read(byte[] b, int off, int len) {
- int i;
- int ok = 0;
- while (len-- > 0) {
- i = read();
- if (i == -1) return (ok == 0) ? -1 : ok;
- b[off++] = (byte) i;
- ok++;
- }
- return ok;
- }
-
- /** Reads from the stream into the provided array. */
- public int read(byte[] b) {
- return read(b,0,b.length);
- }
-}
diff --git a/libjava/gnu/regexp/REMatch.java b/libjava/gnu/regexp/REMatch.java
deleted file mode 100644
index cf25bb331c5..00000000000
--- a/libjava/gnu/regexp/REMatch.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/* gnu/regexp/REMatch.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.io.Serializable;
-
-/**
- * An instance of this class represents a match
- * completed by a gnu.regexp matching function. It can be used
- * to obtain relevant information about the location of a match
- * or submatch.
- *
- * @author <A HREF="mailto:wes@cacas.org">Wes Biggs</A>
- */
-public final class REMatch implements Serializable, Cloneable {
- private String matchedText;
-
- // These variables are package scope for fast access within the engine
- int eflags; // execution flags this match was made using
-
- // Offset in source text where match was tried. This is zero-based;
- // the actual position in the source text is given by (offset + anchor).
- int offset;
-
- // Anchor position refers to the index into the source input
- // at which the matching operation began.
- // This is also useful for the ANCHORINDEX option.
- int anchor;
-
- // Package scope; used by RE.
- int index; // used while matching to mark current match position in input
- int[] start; // start positions (relative to offset) for each (sub)exp.
- int[] end; // end positions for the same
- REMatch next; // other possibility (to avoid having to use arrays)
-
- public Object clone() {
- try {
- REMatch copy = (REMatch) super.clone();
- copy.next = null;
-
- copy.start = (int[]) start.clone();
- copy.end = (int[]) end.clone();
-
- return copy;
- } catch (CloneNotSupportedException e) {
- throw new Error(); // doesn't happen
- }
- }
-
- void assignFrom(REMatch other) {
- start = other.start;
- end = other.end;
- index = other.index;
- // need to deep clone?
- next = other.next;
- }
-
- REMatch(int subs, int anchor, int eflags) {
- start = new int[subs+1];
- end = new int[subs+1];
- this.anchor = anchor;
- this.eflags = eflags;
- clear(anchor);
- }
-
- void finish(CharIndexed text) {
- start[0] = 0;
- StringBuffer sb = new StringBuffer();
- int i;
- for (i = 0; i < end[0]; i++)
- sb.append(text.charAt(i));
- matchedText = sb.toString();
- for (i = 0; i < start.length; i++) {
- // If any subexpressions didn't terminate, they don't count
- // TODO check if this code ever gets hit
- if ((start[i] == -1) ^ (end[i] == -1)) {
- start[i] = -1;
- end[i] = -1;
- }
- }
- next = null; // cut off alternates
- }
-
- /** Clears the current match and moves the offset to the new index. */
- void clear(int index) {
- offset = index;
- this.index = 0;
- for (int i = 0; i < start.length; i++) {
- start[i] = end[i] = -1;
- }
- next = null; // cut off alternates
- }
-
- /**
- * Returns the string matching the pattern. This makes it convenient
- * to write code like the following:
- * <P>
- * <code>
- * REMatch myMatch = myExpression.getMatch(myString);<br>
- * if (myMatch != null) System.out.println("Regexp found: "+myMatch);
- * </code>
- */
- public String toString() {
- return matchedText;
- }
-
- /**
- * Returns the index within the input text where the match in its entirety
- * began.
- */
- public int getStartIndex() {
- return offset + start[0];
- }
-
- /**
- * Returns the index within the input string where the match in
- * its entirety ends. The return value is the next position after
- * the end of the string; therefore, a match created by the
- * following call:
- *
- * <P>
- * <code>REMatch myMatch = myExpression.getMatch(myString);</code>
- * <P>
- * can be viewed (given that myMatch is not null) by creating
- * <P>
- * <code>String theMatch = myString.substring(myMatch.getStartIndex(),
- * myMatch.getEndIndex());</code>
- * <P>
- * But you can save yourself that work, since the <code>toString()</code>
- * method (above) does exactly that for you.
- */
- public int getEndIndex() {
- return offset + end[0];
- }
-
- /**
- * Returns the string matching the given subexpression. The subexpressions
- * are indexed starting with one, not zero. That is, the subexpression
- * identified by the first set of parentheses in a regular expression
- * could be retrieved from an REMatch by calling match.toString(1).
- *
- * @param sub Index of the subexpression.
- */
- public String toString(int sub) {
- if ((sub >= start.length) || (start[sub] == -1)) return "";
- return (matchedText.substring(start[sub],end[sub]));
- }
-
- /**
- * Returns the index within the input string used to generate this match
- * where subexpression number <i>sub</i> begins, or <code>-1</code> if
- * the subexpression does not exist. The initial position is zero.
- *
- * @param sub Subexpression index
- * @deprecated Use getStartIndex(int) instead.
- */
- public int getSubStartIndex(int sub) {
- if (sub >= start.length) return -1;
- int x = start[sub];
- return (x == -1) ? x : offset + x;
- }
-
- /**
- * Returns the index within the input string used to generate this match
- * where subexpression number <i>sub</i> begins, or <code>-1</code> if
- * the subexpression does not exist. The initial position is zero.
- *
- * @param sub Subexpression index
- * @since gnu.regexp 1.1.0
- */
- public int getStartIndex(int sub) {
- if (sub >= start.length) return -1;
- int x = start[sub];
- return (x == -1) ? x : offset + x;
- }
-
- /**
- * Returns the index within the input string used to generate this match
- * where subexpression number <i>sub</i> ends, or <code>-1</code> if
- * the subexpression does not exist. The initial position is zero.
- *
- * @param sub Subexpression index
- * @deprecated Use getEndIndex(int) instead
- */
- public int getSubEndIndex(int sub) {
- if (sub >= start.length) return -1;
- int x = end[sub];
- return (x == -1) ? x : offset + x;
- }
-
- /**
- * Returns the index within the input string used to generate this match
- * where subexpression number <i>sub</i> ends, or <code>-1</code> if
- * the subexpression does not exist. The initial position is zero.
- *
- * @param sub Subexpression index
- */
- public int getEndIndex(int sub) {
- if (sub >= start.length) return -1;
- int x = end[sub];
- return (x == -1) ? x : offset + x;
- }
-
- /**
- * Substitute the results of this match to create a new string.
- * This is patterned after PERL, so the tokens to watch out for are
- * <code>$0</code> through <code>$9</code>. <code>$0</code> matches
- * the full substring matched; <code>$<i>n</i></code> matches
- * subexpression number <i>n</i>.
- *
- * @param input A string consisting of literals and <code>$<i>n</i></code> tokens.
- */
- public String substituteInto(String input) {
- // a la Perl, $0 is whole thing, $1 - $9 are subexpressions
- StringBuffer output = new StringBuffer();
- int pos;
- for (pos = 0; pos < input.length()-1; pos++) {
- if ((input.charAt(pos) == '$') && (Character.isDigit(input.charAt(pos+1)))) {
- int val = Character.digit(input.charAt(++pos),10);
- if (val < start.length) {
- output.append(toString(val));
- }
- } else output.append(input.charAt(pos));
- }
- if (pos < input.length()) output.append(input.charAt(pos));
- return output.toString();
- }
-}
diff --git a/libjava/gnu/regexp/REMatchEnumeration.java b/libjava/gnu/regexp/REMatchEnumeration.java
deleted file mode 100644
index f164a69af4f..00000000000
--- a/libjava/gnu/regexp/REMatchEnumeration.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/* gnu/regexp/REMatchEnumeration.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-/**
- * An REMatchEnumeration enumerates regular expression matches over a
- * given input text. You obtain a reference to an enumeration using
- * the <code>getMatchEnumeration()</code> methods on an instance of
- * RE.
- *
- * <P>
- *
- * REMatchEnumeration does lazy computation; that is, it will not
- * search for a match until it needs to. If you'd rather just get all
- * the matches at once in a big array, use the
- * <code>getAllMatches()</code> methods on RE. However, using an
- * enumeration can help speed performance when the entire text does
- * not need to be searched immediately.
- *
- * <P>
- *
- * The enumerated type is especially useful when searching on a Reader
- * or InputStream, because the InputStream read position cannot be
- * guaranteed after calling <code>getMatch()</code> (see the
- * description of that method for an explanation of why). Enumeration
- * also saves a lot of overhead required when calling
- * <code>getMatch()</code> multiple times.
- *
- * @author <A HREF="mailto:wes@cacas.org">Wes Biggs</A>
- */
-public class REMatchEnumeration implements Enumeration, Serializable {
- private static final int YES = 1;
- private static final int MAYBE = 0;
- private static final int NO = -1;
-
- private int more;
- private REMatch match;
- private RE expr;
- private CharIndexed input;
- private int eflags;
- private int index;
-
- // Package scope constructor is used by RE.getMatchEnumeration()
- REMatchEnumeration(RE expr, CharIndexed input, int index, int eflags) {
- more = MAYBE;
- this.expr = expr;
- this.input = input;
- this.index = index;
- this.eflags = eflags;
- }
-
- /** Returns true if there are more matches in the input text. */
- public boolean hasMoreElements() {
- return hasMoreMatches(null);
- }
-
- /** Returns true if there are more matches in the input text. */
- public boolean hasMoreMatches() {
- return hasMoreMatches(null);
- }
-
- /** Returns true if there are more matches in the input text.
- * Saves the text leading up to the match (or to the end of the input)
- * in the specified buffer.
- */
- public boolean hasMoreMatches(StringBuffer buffer) {
- if (more == MAYBE) {
- match = expr.getMatchImpl(input,index,eflags,buffer);
- if (match != null) {
- input.move((match.end[0] > 0) ? match.end[0] : 1);
-
- index = (match.end[0] > 0) ? match.end[0] + match.offset : index + 1;
- more = YES;
- } else more = NO;
- }
- return (more == YES);
- }
-
- /** Returns the next match in the input text. */
- public Object nextElement() throws NoSuchElementException {
- return nextMatch();
- }
-
- /**
- * Returns the next match in the input text. This method is provided
- * for convenience to avoid having to explicitly cast the return value
- * to class REMatch.
- */
- public REMatch nextMatch() throws NoSuchElementException {
- if (hasMoreElements()) {
- more = (input.isValid()) ? MAYBE : NO;
- return match;
- }
- throw new NoSuchElementException();
- }
-}
-
diff --git a/libjava/gnu/regexp/RESyntax.java b/libjava/gnu/regexp/RESyntax.java
deleted file mode 100644
index 7272b03481b..00000000000
--- a/libjava/gnu/regexp/RESyntax.java
+++ /dev/null
@@ -1,527 +0,0 @@
-/* gnu/regexp/RESyntax.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.io.Serializable;
-import java.util.BitSet;
-
-/**
- * An RESyntax specifies the way a regular expression will be compiled.
- * This class provides a number of predefined useful constants for
- * emulating popular regular expression syntaxes. Additionally the
- * user may construct his or her own syntax, using any combination of the
- * syntax bit constants. The syntax is an optional argument to any of the
- * matching methods on class RE.
- *
- * @author <A HREF="mailto:wes@cacas.org">Wes Biggs</A>
- */
-
-public final class RESyntax implements Serializable {
- static final String DEFAULT_LINE_SEPARATOR = System.getProperty("line.separator");
-
- private static final String SYNTAX_IS_FINAL = RE.getLocalizedMessage("syntax.final");
-
- private BitSet bits;
-
- // true for the constant defined syntaxes
- private boolean isFinal = false;
-
- private String lineSeparator = DEFAULT_LINE_SEPARATOR;
-
- // Values for constants are bit indexes
-
- /**
- * Syntax bit. Backslash is an escape character in lists.
- */
- public static final int RE_BACKSLASH_ESCAPE_IN_LISTS = 0;
-
- /**
- * Syntax bit. Use \? instead of ? and \+ instead of +.
- */
- public static final int RE_BK_PLUS_QM = 1;
-
- /**
- * Syntax bit. POSIX character classes ([:...:]) in lists are allowed.
- */
- public static final int RE_CHAR_CLASSES = 2;
-
- /**
- * Syntax bit. ^ and $ are special everywhere.
- * <B>Not implemented.</B>
- */
- public static final int RE_CONTEXT_INDEP_ANCHORS = 3;
-
- /**
- * Syntax bit. Repetition operators are only special in valid positions.
- * <B>Not implemented.</B>
- */
- public static final int RE_CONTEXT_INDEP_OPS = 4;
-
- /**
- * Syntax bit. Repetition and alternation operators are invalid
- * at start and end of pattern and other places.
- * <B>Not implemented</B>.
- */
- public static final int RE_CONTEXT_INVALID_OPS = 5;
-
- /**
- * Syntax bit. Match-any-character operator (.) matches a newline.
- */
- public static final int RE_DOT_NEWLINE = 6;
-
- /**
- * Syntax bit. Match-any-character operator (.) does not match a null.
- */
- public static final int RE_DOT_NOT_NULL = 7;
-
- /**
- * Syntax bit. Intervals ({x}, {x,}, {x,y}) are allowed.
- */
- public static final int RE_INTERVALS = 8;
-
- /**
- * Syntax bit. No alternation (|), match one-or-more (+), or
- * match zero-or-one (?) operators.
- */
- public static final int RE_LIMITED_OPS = 9;
-
- /**
- * Syntax bit. Newline is an alternation operator.
- */
- public static final int RE_NEWLINE_ALT = 10; // impl.
-
- /**
- * Syntax bit. Intervals use { } instead of \{ \}
- */
- public static final int RE_NO_BK_BRACES = 11;
-
- /**
- * Syntax bit. Grouping uses ( ) instead of \( \).
- */
- public static final int RE_NO_BK_PARENS = 12;
-
- /**
- * Syntax bit. Backreferences not allowed.
- */
- public static final int RE_NO_BK_REFS = 13;
-
- /**
- * Syntax bit. Alternation uses | instead of \|
- */
- public static final int RE_NO_BK_VBAR = 14;
-
- /**
- * Syntax bit. <B>Not implemented</B>.
- */
- public static final int RE_NO_EMPTY_RANGES = 15;
-
- /**
- * Syntax bit. An unmatched right parenthesis (')' or '\)', depending
- * on RE_NO_BK_PARENS) will throw an exception when compiling.
- */
- public static final int RE_UNMATCHED_RIGHT_PAREN_ORD = 16;
-
- /**
- * Syntax bit. <B>Not implemented.</B>
- */
- public static final int RE_HAT_LISTS_NOT_NEWLINE = 17;
-
- /**
- * Syntax bit. Stingy matching is allowed (+?, *?, ??, {x,y}?).
- */
- public static final int RE_STINGY_OPS = 18;
-
- /**
- * Syntax bit. Allow character class escapes (\d, \D, \s, \S, \w, \W).
- */
- public static final int RE_CHAR_CLASS_ESCAPES = 19;
-
- /**
- * Syntax bit. Allow use of (?:xxx) grouping (subexpression is not saved).
- */
- public static final int RE_PURE_GROUPING = 20;
-
- /**
- * Syntax bit. Allow use of (?=xxx) and (?!xxx) apply the subexpression
- * to the text following the current position without consuming that text.
- */
- public static final int RE_LOOKAHEAD = 21;
-
- /**
- * Syntax bit. Allow beginning- and end-of-string anchors (\A, \Z).
- */
- public static final int RE_STRING_ANCHORS = 22;
-
- /**
- * Syntax bit. Allow embedded comments, (?#comment), as in Perl5.
- */
- public static final int RE_COMMENTS = 23;
-
- /**
- * Syntax bit. Allow character class escapes within lists, as in Perl5.
- */
- public static final int RE_CHAR_CLASS_ESC_IN_LISTS = 24;
-
- /**
- * Syntax bit. Possessive matching is allowed (++, *+, ?+, {x,y}+).
- */
- public static final int RE_POSSESSIVE_OPS = 25;
-
- private static final int BIT_TOTAL = 26;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in the awk utility.
- */
- public static final RESyntax RE_SYNTAX_AWK;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in the ed utility.
- */
- public static final RESyntax RE_SYNTAX_ED;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in the egrep utility.
- */
- public static final RESyntax RE_SYNTAX_EGREP;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in the GNU Emacs editor.
- */
- public static final RESyntax RE_SYNTAX_EMACS;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in the grep utility.
- */
- public static final RESyntax RE_SYNTAX_GREP;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in the POSIX awk specification.
- */
- public static final RESyntax RE_SYNTAX_POSIX_AWK;
-
- /**
- * Predefined syntax.
- * Emulates POSIX basic regular expression support.
- */
- public static final RESyntax RE_SYNTAX_POSIX_BASIC;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in the POSIX egrep specification.
- */
- public static final RESyntax RE_SYNTAX_POSIX_EGREP;
-
- /**
- * Predefined syntax.
- * Emulates POSIX extended regular expression support.
- */
- public static final RESyntax RE_SYNTAX_POSIX_EXTENDED;
-
- /**
- * Predefined syntax.
- * Emulates POSIX basic minimal regular expressions.
- */
- public static final RESyntax RE_SYNTAX_POSIX_MINIMAL_BASIC;
-
- /**
- * Predefined syntax.
- * Emulates POSIX extended minimal regular expressions.
- */
- public static final RESyntax RE_SYNTAX_POSIX_MINIMAL_EXTENDED;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in the sed utility.
- */
- public static final RESyntax RE_SYNTAX_SED;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in Larry Wall's perl, version 4,
- */
- public static final RESyntax RE_SYNTAX_PERL4;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in Larry Wall's perl, version 4,
- * using single line mode (/s modifier).
- */
- public static final RESyntax RE_SYNTAX_PERL4_S; // single line mode (/s)
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in Larry Wall's perl, version 5.
- */
- public static final RESyntax RE_SYNTAX_PERL5;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in Larry Wall's perl, version 5,
- * using single line mode (/s modifier).
- */
- public static final RESyntax RE_SYNTAX_PERL5_S;
-
- /**
- * Predefined syntax.
- * Emulates regular expression support in Java 1.4's java.util.regex
- * package.
- */
- public static final RESyntax RE_SYNTAX_JAVA_1_4;
-
- static {
- // Define syntaxes
-
- RE_SYNTAX_EMACS = new RESyntax().makeFinal();
-
- RESyntax RE_SYNTAX_POSIX_COMMON = new RESyntax()
- .set(RE_CHAR_CLASSES)
- .set(RE_DOT_NEWLINE)
- .set(RE_DOT_NOT_NULL)
- .set(RE_INTERVALS)
- .set(RE_NO_EMPTY_RANGES)
- .makeFinal();
-
- RE_SYNTAX_POSIX_BASIC = new RESyntax(RE_SYNTAX_POSIX_COMMON)
- .set(RE_BK_PLUS_QM)
- .makeFinal();
-
- RE_SYNTAX_POSIX_EXTENDED = new RESyntax(RE_SYNTAX_POSIX_COMMON)
- .set(RE_CONTEXT_INDEP_ANCHORS)
- .set(RE_CONTEXT_INDEP_OPS)
- .set(RE_NO_BK_BRACES)
- .set(RE_NO_BK_PARENS)
- .set(RE_NO_BK_VBAR)
- .set(RE_UNMATCHED_RIGHT_PAREN_ORD)
- .makeFinal();
-
- RE_SYNTAX_AWK = new RESyntax()
- .set(RE_BACKSLASH_ESCAPE_IN_LISTS)
- .set(RE_DOT_NOT_NULL)
- .set(RE_NO_BK_PARENS)
- .set(RE_NO_BK_REFS)
- .set(RE_NO_BK_VBAR)
- .set(RE_NO_EMPTY_RANGES)
- .set(RE_UNMATCHED_RIGHT_PAREN_ORD)
- .makeFinal();
-
- RE_SYNTAX_POSIX_AWK = new RESyntax(RE_SYNTAX_POSIX_EXTENDED)
- .set(RE_BACKSLASH_ESCAPE_IN_LISTS)
- .makeFinal();
-
- RE_SYNTAX_GREP = new RESyntax()
- .set(RE_BK_PLUS_QM)
- .set(RE_CHAR_CLASSES)
- .set(RE_HAT_LISTS_NOT_NEWLINE)
- .set(RE_INTERVALS)
- .set(RE_NEWLINE_ALT)
- .makeFinal();
-
- RE_SYNTAX_EGREP = new RESyntax()
- .set(RE_CHAR_CLASSES)
- .set(RE_CONTEXT_INDEP_ANCHORS)
- .set(RE_CONTEXT_INDEP_OPS)
- .set(RE_HAT_LISTS_NOT_NEWLINE)
- .set(RE_NEWLINE_ALT)
- .set(RE_NO_BK_PARENS)
- .set(RE_NO_BK_VBAR)
- .makeFinal();
-
- RE_SYNTAX_POSIX_EGREP = new RESyntax(RE_SYNTAX_EGREP)
- .set(RE_INTERVALS)
- .set(RE_NO_BK_BRACES)
- .makeFinal();
-
- /* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
-
- RE_SYNTAX_ED = new RESyntax(RE_SYNTAX_POSIX_BASIC)
- .makeFinal();
-
- RE_SYNTAX_SED = new RESyntax(RE_SYNTAX_POSIX_BASIC)
- .makeFinal();
-
- RE_SYNTAX_POSIX_MINIMAL_BASIC = new RESyntax(RE_SYNTAX_POSIX_COMMON)
- .set(RE_LIMITED_OPS)
- .makeFinal();
-
- /* Differs from RE_SYNTAX_POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
- replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
-
- RE_SYNTAX_POSIX_MINIMAL_EXTENDED = new RESyntax(RE_SYNTAX_POSIX_COMMON)
- .set(RE_CONTEXT_INDEP_ANCHORS)
- .set(RE_CONTEXT_INVALID_OPS)
- .set(RE_NO_BK_BRACES)
- .set(RE_NO_BK_PARENS)
- .set(RE_NO_BK_REFS)
- .set(RE_NO_BK_VBAR)
- .set(RE_UNMATCHED_RIGHT_PAREN_ORD)
- .makeFinal();
-
- /* There is no official Perl spec, but here's a "best guess" */
-
- RE_SYNTAX_PERL4 = new RESyntax()
- .set(RE_BACKSLASH_ESCAPE_IN_LISTS)
- .set(RE_CONTEXT_INDEP_ANCHORS)
- .set(RE_CONTEXT_INDEP_OPS) // except for '{', apparently
- .set(RE_INTERVALS)
- .set(RE_NO_BK_BRACES)
- .set(RE_NO_BK_PARENS)
- .set(RE_NO_BK_VBAR)
- .set(RE_NO_EMPTY_RANGES)
- .set(RE_CHAR_CLASS_ESCAPES) // \d,\D,\w,\W,\s,\S
- .makeFinal();
-
- RE_SYNTAX_PERL4_S = new RESyntax(RE_SYNTAX_PERL4)
- .set(RE_DOT_NEWLINE)
- .makeFinal();
-
- RE_SYNTAX_PERL5 = new RESyntax(RE_SYNTAX_PERL4)
- .set(RE_PURE_GROUPING) // (?:)
- .set(RE_STINGY_OPS) // *?,??,+?,{}?
- .set(RE_LOOKAHEAD) // (?=)(?!)
- .set(RE_STRING_ANCHORS) // \A,\Z
- .set(RE_CHAR_CLASS_ESC_IN_LISTS)// \d,\D,\w,\W,\s,\S within []
- .set(RE_COMMENTS) // (?#)
- .makeFinal();
-
- RE_SYNTAX_PERL5_S = new RESyntax(RE_SYNTAX_PERL5)
- .set(RE_DOT_NEWLINE)
- .makeFinal();
-
- RE_SYNTAX_JAVA_1_4 = new RESyntax(RE_SYNTAX_PERL5)
- // XXX
- .set(RE_POSSESSIVE_OPS) // *+,?+,++,{}+
- .makeFinal();
- }
-
- /**
- * Construct a new syntax object with all bits turned off.
- * This is equivalent to RE_SYNTAX_EMACS.
- */
- public RESyntax() {
- bits = new BitSet(BIT_TOTAL);
- }
-
- /**
- * Called internally when constructing predefined syntaxes
- * so their interpretation cannot vary. Conceivably useful
- * for your syntaxes as well. Causes IllegalAccessError to
- * be thrown if any attempt to modify the syntax is made.
- *
- * @return this object for convenient chaining
- */
- public RESyntax makeFinal() {
- isFinal = true;
- return this;
- }
-
- /**
- * Construct a new syntax object with all bits set the same
- * as the other syntax.
- */
- public RESyntax(RESyntax other) {
- bits = (BitSet) other.bits.clone();
- }
-
- /**
- * Check if a given bit is set in this syntax.
- */
- public boolean get(int index) {
- return bits.get(index);
- }
-
- /**
- * Set a given bit in this syntax.
- *
- * @param index the constant (RESyntax.RE_xxx) bit to set.
- * @return a reference to this object for easy chaining.
- */
- public RESyntax set(int index) {
- if (isFinal) throw new IllegalAccessError(SYNTAX_IS_FINAL);
- bits.set(index);
- return this;
- }
-
- /**
- * Clear a given bit in this syntax.
- *
- * @param index the constant (RESyntax.RE_xxx) bit to clear.
- * @return a reference to this object for easy chaining.
- */
- public RESyntax clear(int index) {
- if (isFinal) throw new IllegalAccessError(SYNTAX_IS_FINAL);
- bits.clear(index);
- return this;
- }
-
- /**
- * Changes the line separator string for regular expressions
- * created using this RESyntax. The default separator is the
- * value returned by the system property "line.separator", which
- * should be correct when reading platform-specific files from a
- * filesystem. However, many programs may collect input from
- * sources where the line separator is differently specified (for
- * example, in the applet environment, the text box widget
- * interprets line breaks as single-character newlines,
- * regardless of the host platform.
- *
- * Note that setting the line separator to a character or
- * characters that have specific meaning within the current syntax
- * can cause unexpected chronosynclastic infundibula.
- *
- * @return this object for convenient chaining
- */
- public RESyntax setLineSeparator(String aSeparator) {
- if (isFinal) throw new IllegalAccessError(SYNTAX_IS_FINAL);
- lineSeparator = aSeparator;
- return this;
- }
-
- /**
- * Returns the currently active line separator string. The default
- * is the platform-dependent system property "line.separator".
- */
- public String getLineSeparator() {
- return lineSeparator;
- }
-}
diff --git a/libjava/gnu/regexp/REToken.java b/libjava/gnu/regexp/REToken.java
deleted file mode 100644
index 4eae9ec473c..00000000000
--- a/libjava/gnu/regexp/REToken.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* gnu/regexp/REToken.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.io.Serializable;
-
-abstract class REToken implements Serializable {
-
- protected REToken next = null;
- protected REToken uncle = null;
- protected int subIndex;
-
- protected REToken(int subIndex) {
- this.subIndex = subIndex;
- }
-
- int getMinimumLength() {
- return 0;
- }
-
- void setUncle(REToken anUncle) {
- uncle = anUncle;
- }
-
- /** Returns true if the match succeeded, false if it failed. */
- abstract boolean match(CharIndexed input, REMatch mymatch);
-
- /** Returns true if the rest of the tokens match, false if they fail. */
- protected boolean next(CharIndexed input, REMatch mymatch) {
- if (next == null) {
- if (uncle == null) {
- return true;
- } else {
- return uncle.match(input, mymatch);
- }
- } else {
- return next.match(input, mymatch);
- }
- }
-
- boolean chain(REToken token) {
- next = token;
- return true; // Token was accepted
- }
-
- abstract void dump(StringBuffer os);
-
- void dumpAll(StringBuffer os) {
- dump(os);
- if (next != null) next.dumpAll(os);
- }
-}
diff --git a/libjava/gnu/regexp/RETokenAny.java b/libjava/gnu/regexp/RETokenAny.java
deleted file mode 100644
index ac032dcb3bf..00000000000
--- a/libjava/gnu/regexp/RETokenAny.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* gnu/regexp/RETokenAny.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-final class RETokenAny extends REToken {
- /** True if '.' can match a newline (RE_DOT_NEWLINE) */
- private boolean newline;
-
- /** True if '.' can't match a null (RE_DOT_NOT_NULL) */
- private boolean matchNull;
-
- RETokenAny(int subIndex, boolean newline, boolean matchNull) {
- super(subIndex);
- this.newline = newline;
- this.matchNull = matchNull;
- }
-
- int getMinimumLength() {
- return 1;
- }
-
- boolean match(CharIndexed input, REMatch mymatch) {
- char ch = input.charAt(mymatch.index);
- if ((ch == CharIndexed.OUT_OF_BOUNDS)
- || (!newline && (ch == '\n'))
- || (matchNull && (ch == 0))) {
- return false;
- }
- ++mymatch.index;
- return next(input, mymatch);
- }
-
- void dump(StringBuffer os) {
- os.append('.');
- }
-}
-
diff --git a/libjava/gnu/regexp/RETokenBackRef.java b/libjava/gnu/regexp/RETokenBackRef.java
deleted file mode 100644
index 674822abd70..00000000000
--- a/libjava/gnu/regexp/RETokenBackRef.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* gnu/regexp/RETokenBackRef.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-final class RETokenBackRef extends REToken {
- private int num;
- private boolean insens;
-
- RETokenBackRef(int subIndex, int num, boolean insens) {
- super(subIndex);
- this.num = num;
- this.insens = insens;
- }
-
- // should implement getMinimumLength() -- any ideas?
-
- boolean match(CharIndexed input, REMatch mymatch) {
- int b,e;
- b = mymatch.start[num];
- e = mymatch.end[num];
- if ((b==-1)||(e==-1)) return false; // this shouldn't happen, but...
- for (int i=b; i<e; i++) {
- if (input.charAt(mymatch.index+i-b) != input.charAt(i)) {
- return false;
- }
- }
- mymatch.index += e-b;
- return next(input, mymatch);
- }
-
- void dump(StringBuffer os) {
- os.append('\\').append(num);
- }
-}
-
-
diff --git a/libjava/gnu/regexp/RETokenChar.java b/libjava/gnu/regexp/RETokenChar.java
deleted file mode 100644
index a15449b2d96..00000000000
--- a/libjava/gnu/regexp/RETokenChar.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/* gnu/regexp/RETokenChar.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-final class RETokenChar extends REToken {
- private char[] ch;
- private boolean insens;
-
- RETokenChar(int subIndex, char c, boolean ins) {
- super(subIndex);
- ch = new char [1];
- ch[0] = (insens = ins) ? Character.toLowerCase(c) : c;
- }
-
- int getMinimumLength() {
- return ch.length;
- }
-
- boolean match(CharIndexed input, REMatch mymatch) {
- int z = ch.length;
- char c;
- for (int i=0; i<z; i++) {
- c = input.charAt(mymatch.index+i);
- if (( (insens) ? Character.toLowerCase(c) : c ) != ch[i]) {
- return false;
- }
- }
- mymatch.index += z;
-
- return next(input, mymatch);
- }
-
- // Overrides REToken.chain() to optimize for strings
- boolean chain(REToken next) {
- if (next instanceof RETokenChar) {
- RETokenChar cnext = (RETokenChar) next;
- // assume for now that next can only be one character
- int newsize = ch.length + cnext.ch.length;
-
- char[] chTemp = new char [newsize];
-
- System.arraycopy(ch,0,chTemp,0,ch.length);
- System.arraycopy(cnext.ch,0,chTemp,ch.length,cnext.ch.length);
-
- ch = chTemp;
- return false;
- } else return super.chain(next);
- }
-
- void dump(StringBuffer os) {
- os.append(ch);
- }
-}
-
-
diff --git a/libjava/gnu/regexp/RETokenEnd.java b/libjava/gnu/regexp/RETokenEnd.java
deleted file mode 100644
index 70483b746a9..00000000000
--- a/libjava/gnu/regexp/RETokenEnd.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* gnu/regexp/RETokenEnd.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-final class RETokenEnd extends REToken {
- /**
- * Indicates whether this token should match on a line break.
- */
- private String newline;
-
- RETokenEnd(int subIndex,String newline) {
- super(subIndex);
- this.newline = newline;
- }
-
- boolean match(CharIndexed input, REMatch mymatch) {
- char ch = input.charAt(mymatch.index);
- if (ch == CharIndexed.OUT_OF_BOUNDS)
- return ((mymatch.eflags & RE.REG_NOTEOL)>0) ?
- false : next(input, mymatch);
- if (newline != null) {
- char z;
- int i = 0; // position in newline
- do {
- z = newline.charAt(i);
- if (ch != z) return false;
- ++i;
- ch = input.charAt(mymatch.index + i);
- } while (i < newline.length());
-
- return next(input, mymatch);
- }
- return false;
- }
-
- void dump(StringBuffer os) {
- os.append('$');
- }
-}
diff --git a/libjava/gnu/regexp/RETokenEndSub.java b/libjava/gnu/regexp/RETokenEndSub.java
deleted file mode 100644
index f3bb4f2e131..00000000000
--- a/libjava/gnu/regexp/RETokenEndSub.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* gnu/regexp/RETokenEndSub.java
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-final class RETokenEndSub extends REToken {
- RETokenEndSub(int subIndex) {
- super(subIndex);
- }
-
- boolean match(CharIndexed input, REMatch mymatch) {
- mymatch.end[subIndex] = mymatch.index;
- return next(input, mymatch);
- }
-
- void dump(StringBuffer os) {
- // handled by RE
- }
-}
diff --git a/libjava/gnu/regexp/RETokenLookAhead.java b/libjava/gnu/regexp/RETokenLookAhead.java
deleted file mode 100644
index 33eaec9fac1..00000000000
--- a/libjava/gnu/regexp/RETokenLookAhead.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* gnu/regexp/RETokenLookAhead.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-/**
- * @since gnu.regexp 1.1.3
- * @author Shashank Bapat
- */
-final class RETokenLookAhead extends REToken
-{
- REToken re;
- boolean negative;
-
- RETokenLookAhead(REToken re, boolean negative) throws REException {
- super(0);
- this.re = re;
- this.negative = negative;
- }
-
- boolean match(CharIndexed input, REMatch mymatch)
- {
- REMatch trymatch = (REMatch)mymatch.clone();
- REMatch trymatch1 = (REMatch)mymatch.clone();
- REMatch newMatch = null;
- if (re.match(input, trymatch)) {
- if (negative) return false;
- if (next(input, trymatch1))
- newMatch = trymatch1;
- }
-
- if (newMatch != null) {
- if (negative) return false;
- //else
- mymatch.assignFrom(newMatch);
- return true;
- }
- else { // no match
- if (negative)
- return next(input, mymatch);
- //else
- return false;
- }
- }
-
- void dump(StringBuffer os) {
- os.append("(?");
- os.append(negative ? '!' : '=');
- re.dumpAll(os);
- os.append(')');
- }
-}
-
diff --git a/libjava/gnu/regexp/RETokenOneOf.java b/libjava/gnu/regexp/RETokenOneOf.java
deleted file mode 100644
index 3f6e89e2103..00000000000
--- a/libjava/gnu/regexp/RETokenOneOf.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* gnu/regexp/RETokenOneOf.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-import java.util.Vector;
-
-final class RETokenOneOf extends REToken {
- private Vector options;
- private boolean negative;
-
- // This constructor is used for convenience when we know the set beforehand,
- // e.g. \d --> new RETokenOneOf("0123456789",false, ..)
- // \D --> new RETokenOneOf("0123456789",true, ..)
-
- RETokenOneOf(int subIndex, String optionsStr, boolean negative, boolean insens) {
- super(subIndex);
- options = new Vector();
- this.negative = negative;
- for (int i = 0; i < optionsStr.length(); i++)
- options.addElement(new RETokenChar(subIndex,optionsStr.charAt(i),insens));
- }
-
- RETokenOneOf(int subIndex, Vector options, boolean negative) {
- super(subIndex);
- this.options = options;
- this.negative = negative;
- }
-
- int getMinimumLength() {
- int min = Integer.MAX_VALUE;
- int x;
- for (int i=0; i < options.size(); i++) {
- if ((x = ((REToken) options.elementAt(i)).getMinimumLength()) < min)
- min = x;
- }
- return min;
- }
-
- boolean match(CharIndexed input, REMatch mymatch) {
- if (negative && (input.charAt(mymatch.index) == CharIndexed.OUT_OF_BOUNDS))
- return false;
-
- REMatch newMatch = null;
- REMatch last = null;
- REToken tk;
- boolean isMatch;
- for (int i=0; i < options.size(); i++) {
- tk = (REToken) options.elementAt(i);
- REMatch tryMatch = (REMatch) mymatch.clone();
- if (tk.match(input, tryMatch)) { // match was successful
- if (negative) return false;
-
- if (next(input, tryMatch)) {
- // Add tryMatch to list of possibilities.
- if (last == null) {
- newMatch = tryMatch;
- last = tryMatch;
- } else {
- last.next = tryMatch;
- last = tryMatch;
- }
- } // next succeeds
- } // is a match
- } // try next option
-
- if (newMatch != null) {
- if (negative) {
- return false;
- } else {
- // set contents of mymatch equal to newMatch
-
- // try each one that matched
- mymatch.assignFrom(newMatch);
- return true;
- }
- } else {
- if (negative) {
- ++mymatch.index;
- return next(input, mymatch);
- } else {
- return false;
- }
- }
-
- // index+1 works for [^abc] lists, not for generic lookahead (--> index)
- }
-
- void dump(StringBuffer os) {
- os.append(negative ? "[^" : "(?:");
- for (int i = 0; i < options.size(); i++) {
- if (!negative && (i > 0)) os.append('|');
- ((REToken) options.elementAt(i)).dumpAll(os);
- }
- os.append(negative ? ']' : ')');
- }
-}
diff --git a/libjava/gnu/regexp/RETokenPOSIX.java b/libjava/gnu/regexp/RETokenPOSIX.java
deleted file mode 100644
index bbb8066bca8..00000000000
--- a/libjava/gnu/regexp/RETokenPOSIX.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/* gnu/regexp/RETokenPOSIX.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-final class RETokenPOSIX extends REToken {
- int type;
- boolean insens;
- boolean negated;
-
- static final int ALNUM = 0;
- static final int ALPHA = 1;
- static final int BLANK = 2;
- static final int CNTRL = 3;
- static final int DIGIT = 4;
- static final int GRAPH = 5;
- static final int LOWER = 6;
- static final int PRINT = 7;
- static final int PUNCT = 8;
- static final int SPACE = 9;
- static final int UPPER = 10;
- static final int XDIGIT = 11;
-
- // Array indices correspond to constants defined above.
- static final String[] s_nameTable = {
- "alnum", "alpha", "blank", "cntrl", "digit", "graph", "lower",
- "print", "punct", "space", "upper", "xdigit"
- };
-
- // The RE constructor uses this to look up the constant for a string
- static int intValue(String key) {
- for (int i = 0; i < s_nameTable.length; i++) {
- if (s_nameTable[i].equals(key)) return i;
- }
- return -1;
- }
-
- RETokenPOSIX(int subIndex, int type, boolean insens, boolean negated) {
- super(subIndex);
- this.type = type;
- this.insens = insens;
- this.negated = negated;
- }
-
- int getMinimumLength() {
- return 1;
- }
-
- boolean match(CharIndexed input, REMatch mymatch) {
- char ch = input.charAt(mymatch.index);
- if (ch == CharIndexed.OUT_OF_BOUNDS)
- return false;
-
- boolean retval = false;
- switch (type) {
- case ALNUM:
- // Note that there is some debate over whether '_' should be included
- retval = Character.isLetterOrDigit(ch) || (ch == '_');
- break;
- case ALPHA:
- retval = Character.isLetter(ch);
- break;
- case BLANK:
- retval = ((ch == ' ') || (ch == '\t'));
- break;
- case CNTRL:
- retval = Character.isISOControl(ch);
- break;
- case DIGIT:
- retval = Character.isDigit(ch);
- break;
- case GRAPH:
- retval = (!(Character.isWhitespace(ch) || Character.isISOControl(ch)));
- break;
- case LOWER:
- retval = ((insens && Character.isLetter(ch)) || Character.isLowerCase(ch));
- break;
- case PRINT:
- retval = (!(Character.isWhitespace(ch) || Character.isISOControl(ch)))
- || (ch == ' ');
- break;
- case PUNCT:
- // This feels sloppy, especially for non-U.S. locales.
- retval = ("`~!@#$%^&*()-_=+[]{}\\|;:'\"/?,.<>".indexOf(ch)!=-1);
- break;
- case SPACE:
- retval = Character.isWhitespace(ch);
- break;
- case UPPER:
- retval = ((insens && Character.isLetter(ch)) || Character.isUpperCase(ch));
- break;
- case XDIGIT:
- retval = (Character.isDigit(ch) || ("abcdefABCDEF".indexOf(ch)!=-1));
- break;
- }
-
- if (negated) retval = !retval;
- if (retval) {
- ++mymatch.index;
- return next(input, mymatch);
- }
- else return false;
- }
-
- void dump(StringBuffer os) {
- if (negated) os.append('^');
- os.append("[:" + s_nameTable[type] + ":]");
- }
-}
diff --git a/libjava/gnu/regexp/RETokenRange.java b/libjava/gnu/regexp/RETokenRange.java
deleted file mode 100644
index dadaf2d8072..00000000000
--- a/libjava/gnu/regexp/RETokenRange.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* gnu/regexp/RETokenRange.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-final class RETokenRange extends REToken {
- private char lo, hi;
- private boolean insens;
-
- RETokenRange(int subIndex, char lo, char hi, boolean ins) {
- super(subIndex);
- this.lo = (insens = ins) ? Character.toLowerCase(lo) : lo;
- this.hi = ins ? Character.toLowerCase(hi) : hi;
- }
-
- int getMinimumLength() {
- return 1;
- }
-
- boolean match(CharIndexed input, REMatch mymatch) {
- char c = input.charAt(mymatch.index);
- if (c == CharIndexed.OUT_OF_BOUNDS) return false;
- if (insens) c = Character.toLowerCase(c);
- if ((c >= lo) && (c <= hi)) {
- ++mymatch.index;
- return next(input, mymatch);
- }
- return false;
- }
-
- void dump(StringBuffer os) {
- os.append(lo).append('-').append(hi);
- }
-}
-
diff --git a/libjava/gnu/regexp/RETokenRepeated.java b/libjava/gnu/regexp/RETokenRepeated.java
deleted file mode 100644
index 3165a6f1654..00000000000
--- a/libjava/gnu/regexp/RETokenRepeated.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/* gnu/regexp/RETokenRepeated.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-import java.util.Vector;
-
-final class RETokenRepeated extends REToken {
- private REToken token;
- private int min,max;
- private boolean stingy;
- private boolean possessive;
-
- RETokenRepeated(int subIndex, REToken token, int min, int max) {
- super(subIndex);
- this.token = token;
- this.min = min;
- this.max = max;
- }
-
- /** Sets the minimal matching mode to true. */
- void makeStingy() {
- stingy = true;
- }
-
- /** Queries if this token has minimal matching enabled. */
- boolean isStingy() {
- return stingy;
- }
-
- /** Sets possessive matching mode to true. */
- void makePossessive() {
- possessive = true;
- }
-
- /** Queries if this token has possessive matching enabled. */
- boolean isPossessive() {
- return possessive;
- }
-
- /**
- * The minimum length of a repeated token is the minimum length
- * of the token multiplied by the minimum number of times it must
- * match.
- */
- int getMinimumLength() {
- return (min * token.getMinimumLength());
- }
-
- // We do need to save every possible point, but the number of clone()
- // invocations here is really a killer for performance on non-stingy
- // repeat operators. I'm open to suggestions...
-
- // Hypothetical question: can you have a RE that matches 1 times,
- // 3 times, 5 times, but not 2 times or 4 times? Does having
- // the subexpression back-reference operator allow that?
-
- boolean match(CharIndexed input, REMatch mymatch) {
- // number of times we've matched so far
- int numRepeats = 0;
-
- // Possible positions for the next repeat to match at
- REMatch newMatch = mymatch;
- REMatch last = null;
- REMatch current;
-
- // Add the '0-repeats' index
- // positions.elementAt(z) == position [] in input after <<z>> matches
- Vector positions = new Vector();
- positions.addElement(newMatch);
-
- // Declare variables used in loop
- REMatch doables;
- REMatch doablesLast;
- REMatch recurrent;
-
- do {
- // Check for stingy match for each possibility.
- if (stingy && (numRepeats >= min)) {
- REMatch result = matchRest(input, newMatch);
- if (result != null) {
- mymatch.assignFrom(result);
- return true;
- }
- }
-
- doables = null;
- doablesLast = null;
-
- // try next repeat at all possible positions
- for (current = newMatch; current != null; current = current.next) {
- recurrent = (REMatch) current.clone();
- if (token.match(input, recurrent)) {
- // add all items in current to doables array
- if (doables == null) {
- doables = recurrent;
- doablesLast = recurrent;
- } else {
- // Order these from longest to shortest
- // Start by assuming longest (more repeats)
- doablesLast.next = recurrent;
- }
- // Find new doablesLast
- while (doablesLast.next != null) {
- doablesLast = doablesLast.next;
- }
- }
- }
- // if none of the possibilities worked out, break out of do/while
- if (doables == null) break;
-
- // reassign where the next repeat can match
- newMatch = doables;
-
- // increment how many repeats we've successfully found
- ++numRepeats;
-
- positions.addElement(newMatch);
- } while (numRepeats < max);
-
- // If there aren't enough repeats, then fail
- if (numRepeats < min) return false;
-
- // We're greedy, but ease off until a true match is found
- int posIndex = positions.size();
-
- // At this point we've either got too many or just the right amount.
- // See if this numRepeats works with the rest of the regexp.
- REMatch allResults = null;
- REMatch allResultsLast = null;
-
- REMatch results = null;
- while (--posIndex >= min) {
- newMatch = (REMatch) positions.elementAt(posIndex);
- results = matchRest(input, newMatch);
- if (results != null) {
- if (allResults == null) {
- allResults = results;
- allResultsLast = results;
- } else {
- // Order these from longest to shortest
- // Start by assuming longest (more repeats)
- allResultsLast.next = results;
- }
- // Find new doablesLast
- while (allResultsLast.next != null) {
- allResultsLast = allResultsLast.next;
- }
- }
- // else did not match rest of the tokens, try again on smaller sample
- // or break out when performing possessive matching
- if (possessive) break;
- }
- if (allResults != null) {
- mymatch.assignFrom(allResults); // does this get all?
- return true;
- }
- // If we fall out, no matches.
- return false;
- }
-
- private REMatch matchRest(CharIndexed input, final REMatch newMatch) {
- REMatch current, single;
- REMatch doneIndex = null;
- REMatch doneIndexLast = null;
- // Test all possible matches for this number of repeats
- for (current = newMatch; current != null; current = current.next) {
- // clone() separates a single match from the chain
- single = (REMatch) current.clone();
- if (next(input, single)) {
- // chain results to doneIndex
- if (doneIndex == null) {
- doneIndex = single;
- doneIndexLast = single;
- } else {
- doneIndexLast.next = single;
- }
- // Find new doneIndexLast
- while (doneIndexLast.next != null) {
- doneIndexLast = doneIndexLast.next;
- }
- }
- }
- return doneIndex;
- }
-
- void dump(StringBuffer os) {
- os.append("(?:");
- token.dumpAll(os);
- os.append(')');
- if ((max == Integer.MAX_VALUE) && (min <= 1))
- os.append( (min == 0) ? '*' : '+' );
- else if ((min == 0) && (max == 1))
- os.append('?');
- else {
- os.append('{').append(min);
- if (max > min) {
- os.append(',');
- if (max != Integer.MAX_VALUE) os.append(max);
- }
- os.append('}');
- }
- if (stingy) os.append('?');
- }
-}
diff --git a/libjava/gnu/regexp/RETokenStart.java b/libjava/gnu/regexp/RETokenStart.java
deleted file mode 100644
index 8f7198237e1..00000000000
--- a/libjava/gnu/regexp/RETokenStart.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* gnu/regexp/RETokenStart.java
- Copyright (C) 1998-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-class RETokenStart extends REToken {
- private String newline; // matches after a newline
-
- RETokenStart(int subIndex, String newline) {
- super(subIndex);
- this.newline = newline;
- }
-
- boolean match(CharIndexed input, REMatch mymatch) {
- // charAt(index-n) may be unknown on a Reader/InputStream. FIXME
- // Match after a newline if in multiline mode
-
- if (newline != null) {
- int len = newline.length();
- if (mymatch.offset >= len) {
- boolean found = true;
- char z;
- int i = 0; // position in REToken.newline
- char ch = input.charAt(mymatch.index - len);
- do {
- z = newline.charAt(i);
- if (ch != z) {
- found = false;
- break;
- }
- ++i;
- ch = input.charAt(mymatch.index - len + i);
- } while (i < len);
-
- if (found) return next(input, mymatch);
- }
- }
-
- // Don't match at all if REG_NOTBOL is set.
- if ((mymatch.eflags & RE.REG_NOTBOL) > 0) return false;
-
- if ((mymatch.eflags & RE.REG_ANCHORINDEX) > 0)
- return (mymatch.anchor == mymatch.offset) ?
- next(input, mymatch) : false;
- else
- return ((mymatch.index == 0) && (mymatch.offset == 0)) ?
- next(input, mymatch) : false;
- }
-
- void dump(StringBuffer os) {
- os.append('^');
- }
-}
diff --git a/libjava/gnu/regexp/RETokenWordBoundary.java b/libjava/gnu/regexp/RETokenWordBoundary.java
deleted file mode 100644
index 6804151e261..00000000000
--- a/libjava/gnu/regexp/RETokenWordBoundary.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* gnu/regexp/RETokenWordBoundary.java
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-/**
- * Represents a combination lookahead/lookbehind for POSIX [:alnum:].
- */
-final class RETokenWordBoundary extends REToken {
- private boolean negated;
- private int where;
- static final int BEGIN = 1;
- static final int END = 2;
-
- RETokenWordBoundary(int subIndex, int where, boolean negated) {
- super(subIndex);
- this.where = where;
- this.negated = negated;
- }
-
- boolean match(CharIndexed input, REMatch mymatch) {
- // Word boundary means input[index-1] was a word character
- // and input[index] is not, or input[index] is a word character
- // and input[index-1] was not
- // In the string "one two three", these positions match:
- // |o|n|e| |t|w|o| |t|h|r|e|e|
- // ^ ^ ^ ^ ^ ^
- boolean after = false; // is current character a letter or digit?
- boolean before = false; // is previous character a letter or digit?
- char ch;
-
- // TODO: Also check REG_ANCHORINDEX vs. anchor
- if (((mymatch.eflags & RE.REG_ANCHORINDEX) != RE.REG_ANCHORINDEX)
- || (mymatch.offset + mymatch.index > mymatch.anchor)) {
- if ((ch = input.charAt(mymatch.index - 1)) != CharIndexed.OUT_OF_BOUNDS) {
- before = Character.isLetterOrDigit(ch) || (ch == '_');
- }
- }
-
- if ((ch = input.charAt(mymatch.index)) != CharIndexed.OUT_OF_BOUNDS) {
- after = Character.isLetterOrDigit(ch) || (ch == '_');
- }
-
- // if (before) and (!after), we're at end (\>)
- // if (after) and (!before), we're at beginning (\<)
- boolean doNext = false;
-
- if ((where & BEGIN) == BEGIN) {
- doNext = after && !before;
- }
- if ((where & END) == END) {
- doNext ^= before && !after;
- }
-
- if (negated) doNext = !doNext;
-
- return (doNext ? next(input, mymatch) : false);
- }
-
- void dump(StringBuffer os) {
- if (where == (BEGIN | END)) {
- os.append( negated ? "\\B" : "\\b" );
- } else if (where == BEGIN) {
- os.append("\\<");
- } else {
- os.append("\\>");
- }
- }
-}
diff --git a/libjava/gnu/regexp/UncheckedRE.java b/libjava/gnu/regexp/UncheckedRE.java
deleted file mode 100644
index e6712113828..00000000000
--- a/libjava/gnu/regexp/UncheckedRE.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* gnu/regexp/UncheckedRE.java
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.regexp;
-
-/**
- * UncheckedRE is a subclass of RE that allows programmers an easier means
- * of programmatically precompiling regular expressions. It is constructed
- * and used in exactly the same manner as an instance of the RE class; the
- * only difference is that its constructors do not throw REException.
- * Instead, if a syntax error is encountered during construction, a
- * RuntimeException will be thrown.
- * <P>
- * Note that this makes UncheckedRE dangerous if constructed with
- * dynamic data. Do not use UncheckedRE unless you are completely sure
- * that all input being passed to it contains valid, well-formed
- * regular expressions for the syntax specified.
- *
- * @author <A HREF="mailto:wes@cacas.org">Wes Biggs</A>
- * @see gnu.regexp.RE
- * @since gnu.regexp 1.1.4
- */
-
-public final class UncheckedRE extends RE {
- /**
- * Constructs a regular expression pattern buffer without any compilation
- * flags set, and using the default syntax (RESyntax.RE_SYNTAX_PERL5).
- *
- * @param pattern A regular expression pattern, in the form of a String,
- * StringBuffer or char[]. Other input types will be converted to
- * strings using the toString() method.
- * @exception RuntimeException The input pattern could not be parsed.
- * @exception NullPointerException The pattern was null.
- */
- public UncheckedRE(Object pattern) {
- this(pattern,0,RESyntax.RE_SYNTAX_PERL5);
- }
-
- /**
- * Constructs a regular expression pattern buffer using the specified
- * compilation flags and the default syntax (RESyntax.RE_SYNTAX_PERL5).
- *
- * @param pattern A regular expression pattern, in the form of a String,
- * StringBuffer, or char[]. Other input types will be converted to
- * strings using the toString() method.
- * @param cflags The logical OR of any combination of the compilation flags in the RE class.
- * @exception RuntimeException The input pattern could not be parsed.
- * @exception NullPointerException The pattern was null.
- */
- public UncheckedRE(Object pattern, int cflags) {
- this(pattern,cflags,RESyntax.RE_SYNTAX_PERL5);
- }
-
- /**
- * Constructs a regular expression pattern buffer using the specified
- * compilation flags and regular expression syntax.
- *
- * @param pattern A regular expression pattern, in the form of a String,
- * StringBuffer, or char[]. Other input types will be converted to
- * strings using the toString() method.
- * @param cflags The logical OR of any combination of the compilation flags in the RE class.
- * @param syntax The type of regular expression syntax to use.
- * @exception RuntimeException The input pattern could not be parsed.
- * @exception NullPointerException The pattern was null.
- */
- public UncheckedRE(Object pattern, int cflags, RESyntax syntax) {
- try {
- initialize(pattern,cflags,syntax,0,0);
- } catch (REException e) {
- throw new RuntimeException(e.getMessage());
- }
- }
-}
-
-
diff --git a/libjava/gnu/xml/aelfred2/ContentHandler2.java b/libjava/gnu/xml/aelfred2/ContentHandler2.java
deleted file mode 100644
index 15161383592..00000000000
--- a/libjava/gnu/xml/aelfred2/ContentHandler2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ContentHandler2.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.aelfred2;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-
-/**
- * Extension to the SAX ContentHandler interface to report parsing events
- * and parameters required by DOM Level 3 but not supported by SAX.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public interface ContentHandler2
- extends ContentHandler
-{
-
- /**
- * Reports the XML declaration.
- * @param version the value of the version attribute in the XML
- * declaration
- * @param encoding the encoding specified in the XML declaration, if any
- * @param standalone the standalone attribute from the XML declaration
- * @param inputEncoding the encoding of the XML input
- */
- void xmlDecl(String version, String encoding, boolean standalone,
- String inputEncoding)
- throws SAXException;
-
-}
diff --git a/libjava/gnu/xml/aelfred2/JAXPFactory.java b/libjava/gnu/xml/aelfred2/JAXPFactory.java
deleted file mode 100644
index 37e8cc9c120..00000000000
--- a/libjava/gnu/xml/aelfred2/JAXPFactory.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/* JAXPFactory.java --
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.aelfred2;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.xml.sax.Parser;
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.helpers.XMLReaderAdapter;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-
-/**
- * Configurable factory to create an &AElig;lfred2 JAXP parser; required
- * to bootstrap using JAXP. You should use SAX2 directly where possible,
- * rather than through JAXP, since that gives you better control.
- * This class would normally be configured as a platform default factory.
- *
- * @author David Brownell
- */
-public final class JAXPFactory
- extends SAXParserFactory
-{
-
- private Hashtable flags = new Hashtable();
-
- /**
- * Constructs a factory which normally returns a non-validating
- * parser.
- */
- public JAXPFactory()
- {
- }
-
- public SAXParser newSAXParser()
- throws ParserConfigurationException, SAXException
- {
- JaxpParser jaxp = new JaxpParser();
- Enumeration e = flags.keys();
- XMLReader parser = jaxp.getXMLReader();
-
- parser.setFeature(SAXDriver.FEATURE + "namespaces",
- isNamespaceAware());
- parser.setFeature(SAXDriver.FEATURE + "validation",
- isValidating());
- // that makes SAX2 feature flags trump JAXP
-
- while (e.hasMoreElements())
- {
- String uri = (String) e.nextElement();
- Boolean value = (Boolean) flags.get(uri);
- parser.setFeature(uri, value.booleanValue());
- }
-
- return jaxp;
- }
-
- // yes, this "feature transfer" mechanism doesn't play well
-
- public void setFeature(String name, boolean value)
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException
- {
- try
- {
- // force "early" detection of errors where possible
- // (flags can't necessarily be set before parsing)
- new JaxpParser().getXMLReader().setFeature(name, value);
-
- flags.put(name, new Boolean(value));
- }
- catch (SAXNotRecognizedException e)
- {
- throw new SAXNotRecognizedException(name);
- }
- catch (SAXNotSupportedException e)
- {
- throw new SAXNotSupportedException(name);
- }
- catch (Exception e)
- {
- throw new ParserConfigurationException(e.getClass().getName()
- + ": "
- + e.getMessage());
- }
- }
-
- public boolean getFeature(String name)
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException
- {
- Boolean value = (Boolean) flags.get(name);
-
- if (value != null)
- {
- return value.booleanValue();
- }
- else
- {
- try
- {
- return new JaxpParser().getXMLReader().getFeature(name);
- }
- catch (SAXNotRecognizedException e)
- {
- throw new SAXNotRecognizedException(name);
- }
- catch (SAXNotSupportedException e)
- {
- throw new SAXNotSupportedException(name);
- }
- catch (SAXException e)
- {
- throw new ParserConfigurationException(e.getClass().getName()
- + ": "
- + e.getMessage());
- }
- }
- }
-
- private static class JaxpParser
- extends SAXParser
- {
-
- private XmlReader ae2 = new XmlReader();
- private XMLReaderAdapter parser = null;
-
- JaxpParser()
- {
- }
-
- public void setProperty(String id, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- ae2.setProperty(id, value);
- }
-
- public Object getProperty(String id)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- return ae2.getProperty(id);
- }
-
- public Parser getParser()
- throws SAXException
- {
- if (parser == null)
- {
- parser = new XMLReaderAdapter(ae2);
- }
- return parser;
- }
-
- public XMLReader getXMLReader ()
- throws SAXException
- {
- return ae2;
- }
-
- public boolean isNamespaceAware()
- {
- try
- {
- return ae2.getFeature(SAXDriver.FEATURE + "namespaces");
- }
- catch (Exception e)
- {
- throw new Error();
- }
- }
-
- public boolean isValidating()
- {
- try
- {
- return ae2.getFeature(SAXDriver.FEATURE + "validation");
- }
- catch (Exception e)
- {
- throw new Error();
- }
- }
-
- // TODO isXIncludeAware()
-
- }
-
-}
-
diff --git a/libjava/gnu/xml/aelfred2/SAXDriver.java b/libjava/gnu/xml/aelfred2/SAXDriver.java
deleted file mode 100644
index 7e950ce042a..00000000000
--- a/libjava/gnu/xml/aelfred2/SAXDriver.java
+++ /dev/null
@@ -1,1622 +0,0 @@
-/* SAXDriver.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.
-
-Portions derived from code which carried the following notice:
-
- Copyright (c) 1997, 1998 by Microstar Software Ltd.
-
- AElfred is free for both commercial and non-commercial use and
- redistribution, provided that Microstar's copyright and disclaimer are
- retained intact. You are free to modify AElfred for your own use and
- to redistribute AElfred with your modifications, provided that the
- modifications are clearly documented.
-
- This program 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. Please use it AT
- YOUR OWN RISK.
-*/
-
-package gnu.xml.aelfred2;
-
-import java.io.*;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Locale;
-import java.util.Stack;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-import org.xml.sax.helpers.NamespaceSupport;
-
-
-/**
- * An enhanced SAX2 version of Microstar's &AElig;lfred XML parser.
- * The enhancements primarily relate to significant improvements in
- * conformance to the XML specification, and SAX2 support. Performance
- * has been improved. See the package level documentation for more
- * information.
- *
- * <table border="1" width='100%' cellpadding='3' cellspacing='0'>
- * <tr bgcolor='#ccccff'>
- * <th><font size='+1'>Name</font></th>
- * <th><font size='+1'>Notes</font></th></tr>
- *
- * <tr><td colspan=2><center><em>Features ... URL prefix is
- * <b>http://xml.org/sax/features/</b></em></center></td></tr>
- *
- * <tr><td>(URL)/external-general-entities</td>
- * <td>Value defaults to <em>true</em></td></tr>
- * <tr><td>(URL)/external-parameter-entities</td>
- * <td>Value defaults to <em>true</em></td></tr>
- * <tr><td>(URL)/is-standalone</td>
- * <td>(PRELIMINARY) Returns true iff the document's parsing
- * has started (some non-error event after <em>startDocument()</em>
- * was reported) and the document's standalone flag is set.</td></tr>
- * <tr><td>(URL)/namespace-prefixes</td>
- * <td>Value defaults to <em>false</em> (but XML 1.0 names are
- * always reported)</td></tr>
- * <tr><td>(URL)/lexical-handler/parameter-entities</td>
- * <td>Value is fixed at <em>true</em></td></tr>
- * <tr><td>(URL)/namespaces</td>
- * <td>Value defaults to <em>true</em></td></tr>
- * <tr><td>(URL)/resolve-dtd-uris</td>
- * <td>(PRELIMINARY) Value defaults to <em>true</em></td></tr>
- * <tr><td>(URL)/string-interning</td>
- * <td>Value is fixed at <em>true</em></td></tr>
- * <tr><td>(URL)/use-attributes2</td>
- * <td>(PRELIMINARY) Value is fixed at <em>true</em></td></tr>
- * <tr><td>(URL)/use-entity-resolver2</td>
- * <td>(PRELIMINARY) Value defaults to <em>true</em></td></tr>
- * <tr><td>(URL)/validation</td>
- * <td>Value is fixed at <em>false</em></td></tr>
- *
- * <tr><td colspan=2><center><em>Handler Properties ... URL prefix is
- * <b>http://xml.org/sax/properties/</b></em></center></td></tr>
- *
- * <tr><td>(URL)/declaration-handler</td>
- * <td>A declaration handler may be provided. </td></tr>
- * <tr><td>(URL)/lexical-handler</td>
- * <td>A lexical handler may be provided. </td></tr>
- * </table>
- *
- * <p>This parser currently implements the SAX1 Parser API, but
- * it may not continue to do so in the future.
- *
- * @author Written by David Megginson (version 1.2a from Microstar)
- * @author Updated by David Brownell &lt;dbrownell@users.sourceforge.net&gt;
- * @see org.xml.sax.Parser
- */
-final public class SAXDriver
- implements Locator, Attributes2, XMLReader, Parser, AttributeList
-{
-
- private final DefaultHandler2 base = new DefaultHandler2();
- private XmlParser parser;
-
- private EntityResolver entityResolver = base;
- private EntityResolver2 resolver2 = null;
- private ContentHandler contentHandler = base;
- private DTDHandler dtdHandler = base;
- private ErrorHandler errorHandler = base;
- private DeclHandler declHandler = base;
- private LexicalHandler lexicalHandler = base;
-
- private String elementName;
- private Stack entityStack;
-
- // one vector (of object/struct): faster, smaller
- private List attributesList;
-
- private boolean namespaces = true;
- private boolean xmlNames = false;
- private boolean extGE = true;
- private boolean extPE = true;
- private boolean resolveAll = true;
- private boolean useResolver2 = true;
-
- // package private to allow (read-only) access in XmlParser
- boolean stringInterning = true;
-
- private int attributeCount;
- private boolean attributes;
- private String[] nsTemp;
- private NamespaceSupport prefixStack;
-
- //
- // Constructor.
- //
-
- /**
- * Constructs a SAX Parser.
- */
- public SAXDriver()
- {
- reset();
- }
-
- private void reset()
- {
- elementName = null;
- entityStack = new Stack();
- attributesList = Collections.synchronizedList(new ArrayList());
- attributeCount = 0;
- attributes = false;
- nsTemp = new String[3];
- prefixStack = null;
- }
-
-
- //
- // Implementation of org.xml.sax.Parser.
- //
-
- /**
- * <b>SAX1</b>: Sets the locale used for diagnostics; currently,
- * only locales using the English language are supported.
- * @param locale The locale for which diagnostics will be generated
- */
- public void setLocale(Locale locale)
- throws SAXException
- {
- if ("en".equals(locale.getLanguage()))
- {
- return;
- }
- throw new SAXException ("AElfred2 only supports English locales.");
- }
-
- /**
- * <b>SAX2</b>: Returns the object used when resolving external
- * entities during parsing (both general and parameter entities).
- */
- public EntityResolver getEntityResolver()
- {
- return (entityResolver == base) ? null : entityResolver;
- }
-
- /**
- * <b>SAX1, SAX2</b>: Set the entity resolver for this parser.
- * @param handler The object to receive entity events.
- */
- public void setEntityResolver(EntityResolver resolver)
- {
- if (resolver instanceof EntityResolver2)
- {
- resolver2 = (EntityResolver2) resolver;
- }
- else
- {
- resolver2 = null;
- }
- if (resolver == null)
- {
- resolver = base;
- }
- entityResolver = resolver;
- }
-
- /**
- * <b>SAX2</b>: Returns the object used to process declarations related
- * to notations and unparsed entities.
- */
- public DTDHandler getDTDHandler()
- {
- return (dtdHandler == base) ? null : dtdHandler;
- }
-
- /**
- * <b>SAX1, SAX2</b>: Set the DTD handler for this parser.
- * @param handler The object to receive DTD events.
- */
- public void setDTDHandler(DTDHandler handler)
- {
- if (handler == null)
- {
- handler = base;
- }
- this.dtdHandler = handler;
- }
-
-
- /**
- * <b>SAX1</b>: Set the document handler for this parser. If a
- * content handler was set, this document handler will supplant it.
- * The parser is set to report all XML 1.0 names rather than to
- * filter out "xmlns" attributes (the "namespace-prefixes" feature
- * is set to true).
- *
- * @deprecated SAX2 programs should use the XMLReader interface
- * and a ContentHandler.
- *
- * @param handler The object to receive document events.
- */
- public void setDocumentHandler(DocumentHandler handler)
- {
- contentHandler = new Adapter(handler);
- xmlNames = true;
- }
-
- /**
- * <b>SAX2</b>: Returns the object used to report the logical
- * content of an XML document.
- */
- public ContentHandler getContentHandler()
- {
- return (contentHandler == base) ? null : contentHandler;
- }
-
- /**
- * <b>SAX2</b>: Assigns the object used to report the logical
- * content of an XML document. If a document handler was set,
- * this content handler will supplant it (but XML 1.0 style name
- * reporting may remain enabled).
- */
- public void setContentHandler(ContentHandler handler)
- {
- if (handler == null)
- {
- handler = base;
- }
- contentHandler = handler;
- }
-
- /**
- * <b>SAX1, SAX2</b>: Set the error handler for this parser.
- * @param handler The object to receive error events.
- */
- public void setErrorHandler(ErrorHandler handler)
- {
- if (handler == null)
- {
- handler = base;
- }
- this.errorHandler = handler;
- }
-
- /**
- * <b>SAX2</b>: Returns the object used to receive callbacks for XML
- * errors of all levels (fatal, nonfatal, warning); this is never null;
- */
- public ErrorHandler getErrorHandler()
- {
- return (errorHandler == base) ? null : errorHandler;
- }
-
- /**
- * <b>SAX1, SAX2</b>: Auxiliary API to parse an XML document, used mostly
- * when no URI is available.
- * If you want anything useful to happen, you should set
- * at least one type of handler.
- * @param source The XML input source. Don't set 'encoding' unless
- * you know for a fact that it's correct.
- * @see #setEntityResolver
- * @see #setDTDHandler
- * @see #setContentHandler
- * @see #setErrorHandler
- * @exception SAXException The handlers may throw any SAXException,
- * and the parser normally throws SAXParseException objects.
- * @exception IOException IOExceptions are normally through through
- * the parser if there are problems reading the source document.
- */
- public void parse(InputSource source)
- throws SAXException, IOException
- {
- synchronized (base)
- {
- parser = new XmlParser();
- if (namespaces)
- {
- prefixStack = new NamespaceSupport();
- }
- else if (!xmlNames)
- {
- throw new IllegalStateException();
- }
- parser.setHandler(this);
-
- try
- {
- Reader r = source.getCharacterStream();
- InputStream in = source.getByteStream();
-
- parser.doParse(source.getSystemId(),
- source.getPublicId(),
- r,
- in,
- source.getEncoding());
- }
- catch (SAXException e)
- {
- throw e;
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new SAXParseException(e.getMessage(), this, e);
- }
- finally
- {
- contentHandler.endDocument();
- reset();
- }
- }
- }
-
- /**
- * <b>SAX1, SAX2</b>: Preferred API to parse an XML document, using a
- * system identifier (URI).
- */
- public void parse(String systemId)
- throws SAXException, IOException
- {
- parse(new InputSource(systemId));
- }
-
- //
- // Implementation of SAX2 "XMLReader" interface
- //
- static final String FEATURE = "http://xml.org/sax/features/";
- static final String PROPERTY = "http://xml.org/sax/properties/";
-
- /**
- * <b>SAX2</b>: Tells the value of the specified feature flag.
- *
- * @exception SAXNotRecognizedException thrown if the feature flag
- * is neither built in, nor yet assigned.
- */
- public boolean getFeature(String featureId)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if ((FEATURE + "validation").equals(featureId))
- {
- return false;
- }
-
- // external entities (both types) are optionally included
- if ((FEATURE + "external-general-entities").equals(featureId))
- {
- return extGE;
- }
- if ((FEATURE + "external-parameter-entities").equals(featureId))
- {
- return extPE;
- }
-
- // element/attribute names are as written in document; no mangling
- if ((FEATURE + "namespace-prefixes").equals(featureId))
- {
- return xmlNames;
- }
-
- // report element/attribute namespaces?
- if ((FEATURE + "namespaces").equals(featureId))
- {
- return namespaces;
- }
-
- // all PEs and GEs are reported
- if ((FEATURE + "lexical-handler/parameter-entities").equals(featureId))
- {
- return true;
- }
-
- // default is true
- if ((FEATURE + "string-interning").equals(featureId))
- {
- return stringInterning;
- }
-
- // EXTENSIONS 1.1
-
- // always returns isSpecified info
- if ((FEATURE + "use-attributes2").equals(featureId))
- {
- return true;
- }
-
- // meaningful between startDocument/endDocument
- if ((FEATURE + "is-standalone").equals(featureId))
- {
- if (parser == null)
- {
- throw new SAXNotSupportedException(featureId);
- }
- return parser.isStandalone();
- }
-
- // optionally don't absolutize URIs in declarations
- if ((FEATURE + "resolve-dtd-uris").equals(featureId))
- {
- return resolveAll;
- }
-
- // optionally use resolver2 interface methods, if possible
- if ((FEATURE + "use-entity-resolver2").equals(featureId))
- {
- return useResolver2;
- }
-
- throw new SAXNotRecognizedException(featureId);
- }
-
- // package private
- DeclHandler getDeclHandler()
- {
- return declHandler;
- }
-
- // package private
- boolean resolveURIs()
- {
- return resolveAll;
- }
-
- /**
- * <b>SAX2</b>: Returns the specified property.
- *
- * @exception SAXNotRecognizedException thrown if the property value
- * is neither built in, nor yet stored.
- */
- public Object getProperty(String propertyId)
- throws SAXNotRecognizedException
- {
- if ((PROPERTY + "declaration-handler").equals(propertyId))
- {
- return (declHandler == base) ? null : declHandler;
- }
-
- if ((PROPERTY + "lexical-handler").equals(propertyId))
- {
- return (lexicalHandler == base) ? null : lexicalHandler;
- }
-
- // unknown properties
- throw new SAXNotRecognizedException(propertyId);
- }
-
- /**
- * <b>SAX2</b>: Sets the state of feature flags in this parser. Some
- * built-in feature flags are mutable.
- */
- public void setFeature(String featureId, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- boolean state;
-
- // Features with a defined value, we just change it if we can.
- state = getFeature (featureId);
-
- if (state == value)
- {
- return;
- }
- if (parser != null)
- {
- throw new SAXNotSupportedException("not while parsing");
- }
-
- if ((FEATURE + "namespace-prefixes").equals(featureId))
- {
- // in this implementation, this only affects xmlns reporting
- xmlNames = value;
- // forcibly prevent illegal parser state
- if (!xmlNames)
- {
- namespaces = true;
- }
- return;
- }
-
- if ((FEATURE + "namespaces").equals(featureId))
- {
- namespaces = value;
- // forcibly prevent illegal parser state
- if (!namespaces)
- {
- xmlNames = true;
- }
- return;
- }
-
- if ((FEATURE + "external-general-entities").equals(featureId))
- {
- extGE = value;
- return;
- }
- if ((FEATURE + "external-parameter-entities").equals(featureId))
- {
- extPE = value;
- return;
- }
- if ((FEATURE + "resolve-dtd-uris").equals(featureId))
- {
- resolveAll = value;
- return;
- }
-
- if ((FEATURE + "use-entity-resolver2").equals(featureId))
- {
- useResolver2 = value;
- return;
- }
-
- throw new SAXNotRecognizedException(featureId);
- }
-
- /**
- * <b>SAX2</b>: Assigns the specified property. Like SAX1 handlers,
- * these may be changed at any time.
- */
- public void setProperty(String propertyId, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- // see if the property is recognized
- getProperty(propertyId);
-
- // Properties with a defined value, we just change it if we can.
-
- if ((PROPERTY + "declaration-handler").equals(propertyId))
- {
- if (value == null)
- {
- declHandler = base;
- }
- else if (!(value instanceof DeclHandler))
- {
- throw new SAXNotSupportedException(propertyId);
- }
- else
- {
- declHandler = (DeclHandler) value;
- }
- return ;
- }
-
- if ((PROPERTY + "lexical-handler").equals(propertyId))
- {
- if (value == null)
- {
- lexicalHandler = base;
- }
- else if (!(value instanceof LexicalHandler))
- {
- throw new SAXNotSupportedException(propertyId);
- }
- else
- {
- lexicalHandler = (LexicalHandler) value;
- }
- return;
- }
-
- throw new SAXNotSupportedException(propertyId);
- }
-
- //
- // This is where the driver receives XmlParser callbacks and translates
- // them into SAX callbacks. Some more callbacks have been added for
- // SAX2 support.
- //
-
- void startDocument()
- throws SAXException
- {
- contentHandler.setDocumentLocator(this);
- contentHandler.startDocument();
- attributesList.clear();
- }
-
- void xmlDecl(String version,
- String encoding,
- boolean standalone,
- String inputEncoding)
- throws SAXException
- {
- if (contentHandler instanceof ContentHandler2)
- {
- ((ContentHandler2) contentHandler).xmlDecl(version,
- encoding,
- standalone,
- inputEncoding);
- }
- }
-
- void skippedEntity(String name)
- throws SAXException
- {
- contentHandler.skippedEntity(name);
- }
-
- InputSource getExternalSubset(String name, String baseURI)
- throws SAXException, IOException
- {
- if (resolver2 == null || !useResolver2 || !extPE)
- {
- return null;
- }
- return resolver2.getExternalSubset(name, baseURI);
- }
-
- InputSource resolveEntity(boolean isPE, String name,
- InputSource in, String baseURI)
- throws SAXException, IOException
- {
- InputSource source;
-
- // external entities might be skipped
- if (isPE && !extPE)
- {
- return null;
- }
- if (!isPE && !extGE)
- {
- return null;
- }
-
- // ... or not
- lexicalHandler.startEntity(name);
- if (resolver2 != null && useResolver2)
- {
- source = resolver2.resolveEntity(name, in.getPublicId(),
- baseURI, in.getSystemId());
- if (source == null)
- {
- in.setSystemId(absolutize(baseURI,
- in.getSystemId(), false));
- source = in;
- }
- }
- else
- {
- in.setSystemId(absolutize(baseURI, in.getSystemId(), false));
- source = entityResolver.resolveEntity(in.getPublicId(),
- in.getSystemId());
- if (source == null)
- {
- source = in;
- }
- }
- startExternalEntity(name, source.getSystemId(), true);
- return source;
- }
-
- // absolutize a system ID relative to the specified base URI
- // (temporarily) package-visible for external entity decls
- String absolutize(String baseURI, String systemId, boolean nice)
- throws MalformedURLException, SAXException
- {
- // FIXME normalize system IDs -- when?
- // - Convert to UTF-8
- // - Map reserved and non-ASCII characters to %HH
-
- try
- {
- if (baseURI == null)
- {
- if (XmlParser.uriWarnings)
- {
- warn ("No base URI; hope this SYSTEM id is absolute: "
- + systemId);
- }
- return new URL(systemId).toString();
- }
- else
- {
- return new URL(new URL(baseURI), systemId).toString();
- }
- }
- catch (MalformedURLException e)
- {
- // Let unknown URI schemes pass through unless we need
- // the JVM to map them to i/o streams for us...
- if (!nice)
- {
- throw e;
- }
-
- // sometimes sysids for notations or unparsed entities
- // aren't really URIs...
- warn("Can't absolutize SYSTEM id: " + e.getMessage());
- return systemId;
- }
- }
-
- void startExternalEntity(String name, String systemId, boolean stackOnly)
- throws SAXException
- {
- // The following warning was deleted because the application has the
- // option of not setting systemId. Sun's JAXP or Xerces seems to
- // ignore this case.
- /*
- if (systemId == null)
- warn ("URI was not reported to parser for entity " + name);
- */
- if (!stackOnly) // spliced [dtd] needs startEntity
- {
- lexicalHandler.startEntity(name);
- }
- entityStack.push(systemId);
- }
-
- void endExternalEntity(String name)
- throws SAXException
- {
- if (!"[document]".equals(name))
- {
- lexicalHandler.endEntity(name);
- }
- entityStack.pop();
- }
-
- void startInternalEntity(String name)
- throws SAXException
- {
- lexicalHandler.startEntity(name);
- }
-
- void endInternalEntity(String name)
- throws SAXException
- {
- lexicalHandler.endEntity(name);
- }
-
- void doctypeDecl(String name, String publicId, String systemId)
- throws SAXException
- {
- lexicalHandler.startDTD(name, publicId, systemId);
-
- // ... the "name" is a declaration and should be given
- // to the DeclHandler (but sax2 doesn't).
-
- // the IDs for the external subset are lexical details,
- // as are the contents of the internal subset; but sax2
- // doesn't provide the internal subset "pre-parse"
- }
-
- void notationDecl(String name, String publicId, String systemId,
- String baseUri)
- throws SAXException
- {
- try
- {
- dtdHandler.notationDecl(name, publicId,
- (resolveAll && systemId != null)
- ? absolutize(baseUri, systemId, true)
- : systemId);
- }
- catch (IOException e)
- {
- // "can't happen"
- throw new SAXParseException(e.getMessage(), this, e);
- }
- }
-
- void unparsedEntityDecl(String name, String publicId, String systemId,
- String baseUri, String notation)
- throws SAXException
- {
- try
- {
- dtdHandler.unparsedEntityDecl(name, publicId,
- resolveAll
- ? absolutize(baseUri, systemId, true)
- : systemId,
- notation);
- }
- catch (IOException e)
- {
- // "can't happen"
- throw new SAXParseException(e.getMessage(), this, e);
- }
- }
-
- void endDoctype()
- throws SAXException
- {
- lexicalHandler.endDTD();
- }
-
- private void declarePrefix(String prefix, String uri)
- throws SAXException
- {
- int index = uri.indexOf(':');
-
- // many versions of nwalsh docbook stylesheets
- // have bogus URLs; so this can't be an error...
- if (index < 1 && uri.length() != 0)
- {
- warn("relative URI for namespace: " + uri);
- }
-
- // FIXME: char [0] must be ascii alpha; chars [1..index]
- // must be ascii alphanumeric or in "+-." [RFC 2396]
-
- //Namespace Constraints
- //name for xml prefix must be http://www.w3.org/XML/1998/namespace
- boolean prefixEquality = prefix.equals("xml");
- boolean uriEquality = uri.equals("http://www.w3.org/XML/1998/namespace");
- if ((prefixEquality || uriEquality) && !(prefixEquality && uriEquality))
- {
- fatal("xml is by definition bound to the namespace name " +
- "http://www.w3.org/XML/1998/namespace");
- }
-
- //xmlns prefix declaration is illegal but xml prefix declaration is llegal...
- if (prefixEquality && uriEquality)
- {
- return;
- }
-
- //name for xmlns prefix must be http://www.w3.org/2000/xmlns/
- prefixEquality = prefix.equals("xmlns");
- uriEquality = uri.equals("http://www.w3.org/2000/xmlns/");
- if ((prefixEquality || uriEquality) && !(prefixEquality && uriEquality))
- {
- fatal("http://www.w3.org/2000/xmlns/ is by definition bound" +
- " to prefix xmlns");
- }
-
- //even if the uri is http://www.w3.org/2000/xmlns/
- // it is illegal to declare it
- if (prefixEquality && uriEquality)
- {
- fatal ("declaring the xmlns prefix is illegal");
- }
-
- uri = uri.intern();
- prefixStack.declarePrefix(prefix, uri);
- contentHandler.startPrefixMapping(prefix, uri);
- }
-
- void attribute(String qname, String value, boolean isSpecified)
- throws SAXException
- {
- if (!attributes)
- {
- attributes = true;
- if (namespaces)
- {
- prefixStack.pushContext();
- }
- }
-
- // process namespace decls immediately;
- // then maybe forget this as an attribute
- if (namespaces)
- {
- int index;
-
- // default NS declaration?
- if (stringInterning)
- {
- if ("xmlns" == qname)
- {
- declarePrefix("", value);
- if (!xmlNames)
- {
- return;
- }
- }
- // NS prefix declaration?
- else if ((index = qname.indexOf(':')) == 5
- && qname.startsWith("xmlns"))
- {
- String prefix = qname.substring(6);
-
- if (prefix.equals(""))
- {
- fatal("missing prefix " +
- "in namespace declaration attribute");
- }
- if (value.length() == 0)
- {
- verror("missing URI in namespace declaration attribute: "
- + qname);
- }
- else
- {
- declarePrefix(prefix, value);
- }
- if (!xmlNames)
- {
- return;
- }
- }
- }
- else
- {
- if ("xmlns".equals(qname))
- {
- declarePrefix("", value);
- if (!xmlNames)
- {
- return;
- }
- }
- // NS prefix declaration?
- else if ((index = qname.indexOf(':')) == 5
- && qname.startsWith("xmlns"))
- {
- String prefix = qname.substring(6);
-
- if (value.length() == 0)
- {
- verror("missing URI in namespace decl attribute: "
- + qname);
- }
- else
- {
- declarePrefix(prefix, value);
- }
- if (!xmlNames)
- {
- return;
- }
- }
- }
- }
- // remember this attribute ...
- attributeCount++;
-
- // attribute type comes from querying parser's DTD records
- attributesList.add(new Attribute(qname, value, isSpecified));
-
- }
-
- void startElement(String elname)
- throws SAXException
- {
- ContentHandler handler = contentHandler;
-
- //
- // NOTE: this implementation of namespace support adds something
- // like six percent to parsing CPU time, in a large (~50 MB)
- // document that doesn't use namespaces at all. (Measured by PC
- // sampling, with a bug where endElement processing was omitted.)
- // [Measurement referred to older implementation, older JVM ...]
- //
- // It ought to become notably faster in such cases. Most
- // costs are the prefix stack calling Hashtable.get() (2%),
- // String.hashCode() (1.5%) and about 1.3% each for pushing
- // the context, and two chunks of name processing.
- //
-
- if (!attributes)
- {
- if (namespaces)
- {
- prefixStack.pushContext();
- }
- }
- else if (namespaces)
- {
-
- // now we can patch up namespace refs; we saw all the
- // declarations, so now we'll do the Right Thing
- Iterator itt = attributesList.iterator();
- while (itt.hasNext())
- {
- Attribute attribute = (Attribute) itt.next();
- String qname = attribute.name;
- int index;
-
- // default NS declaration?
- if (stringInterning)
- {
- if ("xmlns" == qname)
- {
- continue;
- }
- }
- else
- {
- if ("xmlns".equals(qname))
- {
- continue;
- }
- }
- //Illegal in the new Namespaces Draft
- //should it be only in 1.1 docs??
- if (qname.equals (":"))
- {
- fatal("namespace names consisting of a single colon " +
- "character are invalid");
- }
- index = qname.indexOf(':');
-
- // NS prefix declaration?
- if (index == 5 && qname.startsWith("xmlns"))
- {
- continue;
- }
-
- // it's not a NS decl; patch namespace info items
- if (prefixStack.processName(qname, nsTemp, true) == null)
- {
- fatal("undeclared attribute prefix in: " + qname);
- }
- else
- {
- attribute.nameSpace = nsTemp[0];
- attribute.localName = nsTemp[1];
- }
- }
- }
-
- // save element name so attribute callbacks work
- elementName = elname;
- if (namespaces)
- {
- if (prefixStack.processName(elname, nsTemp, false) == null)
- {
- fatal("undeclared element prefix in: " + elname);
- nsTemp[0] = nsTemp[1] = "";
- }
- handler.startElement(nsTemp[0], nsTemp[1], elname, this);
- }
- else
- {
- handler.startElement("", "", elname, this);
- }
- // elementName = null;
-
- // elements with no attributes are pretty common!
- if (attributes)
- {
- attributesList.clear();
- attributeCount = 0;
- attributes = false;
- }
- }
-
- void endElement(String elname)
- throws SAXException
- {
- ContentHandler handler = contentHandler;
-
- if (!namespaces)
- {
- handler.endElement("", "", elname);
- return;
- }
- prefixStack.processName(elname, nsTemp, false);
- handler.endElement(nsTemp[0], nsTemp[1], elname);
-
- Enumeration prefixes = prefixStack.getDeclaredPrefixes();
-
- while (prefixes.hasMoreElements())
- {
- handler.endPrefixMapping((String) prefixes.nextElement());
- }
- prefixStack.popContext();
- }
-
- void startCDATA()
- throws SAXException
- {
- lexicalHandler.startCDATA();
- }
-
- void charData(char[] ch, int start, int length)
- throws SAXException
- {
- contentHandler.characters(ch, start, length);
- }
-
- void endCDATA()
- throws SAXException
- {
- lexicalHandler.endCDATA();
- }
-
- void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException
- {
- contentHandler.ignorableWhitespace(ch, start, length);
- }
-
- void processingInstruction(String target, String data)
- throws SAXException
- {
- contentHandler.processingInstruction(target, data);
- }
-
- void comment(char[] ch, int start, int length)
- throws SAXException
- {
- if (lexicalHandler != base)
- {
- lexicalHandler.comment(ch, start, length);
- }
- }
-
- void fatal(String message)
- throws SAXException
- {
- SAXParseException fatal;
-
- fatal = new SAXParseException(message, this);
- errorHandler.fatalError(fatal);
-
- // Even if the application can continue ... we can't!
- throw fatal;
- }
-
- // We can safely report a few validity errors that
- // make layered SAX2 DTD validation more conformant
- void verror(String message)
- throws SAXException
- {
- SAXParseException err;
-
- err = new SAXParseException(message, this);
- errorHandler.error(err);
- }
-
- void warn(String message)
- throws SAXException
- {
- SAXParseException err;
-
- err = new SAXParseException(message, this);
- errorHandler.warning(err);
- }
-
- //
- // Implementation of org.xml.sax.Attributes.
- //
-
- /**
- * <b>SAX1 AttributeList, SAX2 Attributes</b> method
- * (don't invoke on parser);
- */
- public int getLength()
- {
- return attributesList.size();
- }
-
- /**
- * <b>SAX2 Attributes</b> method (don't invoke on parser);
- */
- public String getURI(int index)
- {
- if (index < 0 || index >= attributesList.size())
- {
- return null;
- }
- return ((Attribute) attributesList.get(index)).nameSpace;
- }
-
- /**
- * <b>SAX2 Attributes</b> method (don't invoke on parser);
- */
- public String getLocalName(int 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)
- {
- // XXX fix this here for now
- int ci = attr.name.indexOf(':');
- attr.localName = (ci == -1) ? attr.name :
- attr.name.substring(ci + 1);
- }
- return (attr.localName == null) ? "" : attr.localName;
- }
-
- /**
- * <b>SAX2 Attributes</b> method (don't invoke on parser);
- */
- public String getQName(int index)
- {
- if (index < 0 || index >= attributesList.size())
- {
- return null;
- }
- Attribute attr = (Attribute) attributesList.get(index);
- return (attr.name == null) ? "" : attr.name;
- }
-
- /**
- * <b>SAX1 AttributeList</b> method (don't invoke on parser);
- */
- public String getName(int index)
- {
- return getQName(index);
- }
-
- /**
- * <b>SAX1 AttributeList, SAX2 Attributes</b> method
- * (don't invoke on parser);
- */
- public String getType(int index)
- {
- 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;
- }
-
- /**
- * <b>SAX1 AttributeList, SAX2 Attributes</b> method
- * (don't invoke on parser);
- */
- public String getValue(int index)
- {
- if (index < 0 || index >= attributesList.size())
- {
- return null;
- }
- return ((Attribute) attributesList.get(index)).value;
- }
-
- /**
- * <b>SAX2 Attributes</b> method (don't invoke on parser);
- */
- public int getIndex(String uri, String local)
- {
- int length = getLength();
-
- for (int i = 0; i < length; i++)
- {
- if (!getURI(i).equals(uri))
- {
- continue;
- }
- if (getLocalName(i).equals(local))
- {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * <b>SAX2 Attributes</b> method (don't invoke on parser);
- */
- public int getIndex(String xmlName)
- {
- int length = getLength();
-
- for (int i = 0; i < length; i++)
- {
- if (getQName(i).equals(xmlName))
- {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * <b>SAX2 Attributes</b> method (don't invoke on parser);
- */
- public String getType(String uri, String local)
- {
- int index = getIndex(uri, local);
-
- if (index < 0)
- {
- return null;
- }
- return getType(index);
- }
-
- /**
- * <b>SAX1 AttributeList, SAX2 Attributes</b> method
- * (don't invoke on parser);
- */
- public String getType(String xmlName)
- {
- int index = getIndex(xmlName);
-
- if (index < 0)
- {
- return null;
- }
- return getType(index);
- }
-
- /**
- * <b>SAX Attributes</b> method (don't invoke on parser);
- */
- public String getValue(String uri, String local)
- {
- int index = getIndex(uri, local);
-
- if (index < 0)
- {
- return null;
- }
- return getValue(index);
- }
-
- /**
- * <b>SAX1 AttributeList, SAX2 Attributes</b> method
- * (don't invoke on parser);
- */
- public String getValue(String xmlName)
- {
- int index = getIndex(xmlName);
-
- if (index < 0)
- {
- return null;
- }
- return getValue(index);
- }
-
- //
- // Implementation of org.xml.sax.ext.Attributes2
- //
-
- /** @return false unless the attribute was declared in the DTD.
- * @throws java.lang.ArrayIndexOutOfBoundsException
- * When the supplied index does not identify an attribute.
- */
- public boolean isDeclared(int index)
- {
- if (index < 0 || index >= attributeCount)
- {
- throw new ArrayIndexOutOfBoundsException();
- }
- String type = parser.getAttributeType(elementName, getQName(index));
- return (type != null);
- }
-
- /** @return false unless the attribute was declared in the DTD.
- * @throws java.lang.IllegalArgumentException
- * When the supplied names do not identify an attribute.
- */
- public boolean isDeclared(String qName)
- {
- int index = getIndex(qName);
- if (index < 0)
- {
- throw new IllegalArgumentException();
- }
- String type = parser.getAttributeType(elementName, qName);
- return (type != null);
- }
-
- /** @return false unless the attribute was declared in the DTD.
- * @throws java.lang.IllegalArgumentException
- * When the supplied names do not identify an attribute.
- */
- public boolean isDeclared(String uri, String localName)
- {
- int index = getIndex(uri, localName);
- return isDeclared(index);
- }
-
- /**
- * <b>SAX-ext Attributes2</b> method (don't invoke on parser);
- */
- public boolean isSpecified(int index)
- {
- return ((Attribute) attributesList.get(index)).specified;
- }
-
- /**
- * <b>SAX-ext Attributes2</b> method (don't invoke on parser);
- */
- public boolean isSpecified(String uri, String local)
- {
- int index = getIndex (uri, local);
- return isSpecified(index);
- }
-
- /**
- * <b>SAX-ext Attributes2</b> method (don't invoke on parser);
- */
- public boolean isSpecified(String xmlName)
- {
- int index = getIndex (xmlName);
- return isSpecified(index);
- }
-
- //
- // Implementation of org.xml.sax.Locator.
- //
-
- /**
- * <b>SAX Locator</b> method (don't invoke on parser);
- */
- public String getPublicId()
- {
- return null; // FIXME track public IDs too
- }
-
- /**
- * <b>SAX Locator</b> method (don't invoke on parser);
- */
- public String getSystemId()
- {
- if (entityStack.empty())
- {
- return null;
- }
- else
- {
- return (String) entityStack.peek();
- }
- }
-
- /**
- * <b>SAX Locator</b> method (don't invoke on parser);
- */
- public int getLineNumber()
- {
- return parser.getLineNumber();
- }
-
- /**
- * <b>SAX Locator</b> method (don't invoke on parser);
- */
- public int getColumnNumber()
- {
- return parser.getColumnNumber();
- }
-
- // adapter between SAX2 content handler and SAX1 document handler callbacks
- private static class Adapter
- implements ContentHandler
- {
-
- private DocumentHandler docHandler;
-
- Adapter(DocumentHandler dh)
- {
- docHandler = dh;
- }
-
- public void setDocumentLocator(Locator l)
- {
- docHandler.setDocumentLocator(l);
- }
-
- public void startDocument()
- throws SAXException
- {
- docHandler.startDocument();
- }
-
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- docHandler.processingInstruction(target, data);
- }
-
- public void startPrefixMapping(String prefix, String uri)
- {
- /* ignored */
- }
-
- public void startElement(String namespace,
- String local,
- String name,
- Attributes attrs)
- throws SAXException
- {
- docHandler.startElement(name, (AttributeList) attrs);
- }
-
- public void characters(char[] buf, int offset, int len)
- throws SAXException
- {
- docHandler.characters(buf, offset, len);
- }
-
- public void ignorableWhitespace(char[] buf, int offset, int len)
- throws SAXException
- {
- docHandler.ignorableWhitespace(buf, offset, len);
- }
-
- public void skippedEntity(String name)
- {
- /* ignored */
- }
-
- public void endElement(String u, String l, String name)
- throws SAXException
- {
- docHandler.endElement(name);
- }
-
- public void endPrefixMapping(String prefix)
- {
- /* ignored */
- }
-
- public void endDocument()
- throws SAXException
- {
- docHandler.endDocument();
- }
- }
-
- private static class Attribute
- {
-
- String name;
- String value;
- String nameSpace;
- String localName;
- boolean specified;
-
- Attribute(String name, String value, boolean specified)
- {
- this.name = name;
- this.value = value;
- this.nameSpace = "";
- this.specified = specified;
- }
-
- }
-
-}
diff --git a/libjava/gnu/xml/aelfred2/XmlParser.java b/libjava/gnu/xml/aelfred2/XmlParser.java
deleted file mode 100644
index 15d730ff4a7..00000000000
--- a/libjava/gnu/xml/aelfred2/XmlParser.java
+++ /dev/null
@@ -1,5835 +0,0 @@
-/* XmlParser.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.
-
-Partly derived from code which carried the following notice:
-
- Copyright (c) 1997, 1998 by Microstar Software Ltd.
-
- AElfred is free for both commercial and non-commercial use and
- redistribution, provided that Microstar's copyright and disclaimer are
- retained intact. You are free to modify AElfred for your own use and
- to redistribute AElfred with your modifications, provided that the
- modifications are clearly documented.
-
- This program 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. Please use it AT
- YOUR OWN RISK.
-*/
-
-package gnu.xml.aelfred2;
-
-import gnu.java.security.action.GetPropertyAction;
-
-import java.io.BufferedInputStream;
-import java.io.CharConversionException;
-import java.io.EOFException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.security.AccessController;
-
-import java.util.Iterator;
-import java.util.HashMap;
-import java.util.LinkedList;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-
-/**
- * Parse XML documents and return parse events through call-backs.
- * Use the <code>SAXDriver</code> class as your entry point, as all
- * internal parser interfaces are subject to change.
- *
- * @author Written by David Megginson &lt;dmeggins@microstar.com&gt;
- * (version 1.2a with bugfixes)
- * @author Updated by David Brownell &lt;dbrownell@users.sourceforge.net&gt;
- * @see SAXDriver
- */
-final class XmlParser
-{
-
- // avoid slow per-character readCh()
- private final static boolean USE_CHEATS = true;
-
- ////////////////////////////////////////////////////////////////////////
- // Constants.
- ////////////////////////////////////////////////////////////////////////
-
- //
- // Constants for element content type.
- //
-
- /**
- * Constant: an element has not been declared.
- * @see #getElementContentType
- */
- public final static int CONTENT_UNDECLARED = 0;
-
- /**
- * Constant: the element has a content model of ANY.
- * @see #getElementContentType
- */
- public final static int CONTENT_ANY = 1;
-
- /**
- * Constant: the element has declared content of EMPTY.
- * @see #getElementContentType
- */
- public final static int CONTENT_EMPTY = 2;
-
- /**
- * Constant: the element has mixed content.
- * @see #getElementContentType
- */
- public final static int CONTENT_MIXED = 3;
-
- /**
- * Constant: the element has element content.
- * @see #getElementContentType
- */
- public final static int CONTENT_ELEMENTS = 4;
-
-
- //
- // Constants for the entity type.
- //
-
- /**
- * Constant: the entity has not been declared.
- * @see #getEntityType
- */
- public final static int ENTITY_UNDECLARED = 0;
-
- /**
- * Constant: the entity is internal.
- * @see #getEntityType
- */
- public final static int ENTITY_INTERNAL = 1;
-
- /**
- * Constant: the entity is external, non-parsable data.
- * @see #getEntityType
- */
- public final static int ENTITY_NDATA = 2;
-
- /**
- * Constant: the entity is external XML data.
- * @see #getEntityType
- */
- public final static int ENTITY_TEXT = 3;
-
- //
- // Attribute type constants are interned literal strings.
- //
-
- //
- // Constants for supported encodings. "external" is just a flag.
- //
- private final static int ENCODING_EXTERNAL = 0;
- private final static int ENCODING_UTF_8 = 1;
- private final static int ENCODING_ISO_8859_1 = 2;
- private final static int ENCODING_UCS_2_12 = 3;
- private final static int ENCODING_UCS_2_21 = 4;
- private final static int ENCODING_UCS_4_1234 = 5;
- private final static int ENCODING_UCS_4_4321 = 6;
- private final static int ENCODING_UCS_4_2143 = 7;
- private final static int ENCODING_UCS_4_3412 = 8;
- private final static int ENCODING_ASCII = 9;
-
- //
- // Constants for attribute default value.
- //
-
- /**
- * Constant: the attribute is not declared.
- * @see #getAttributeDefaultValueType
- */
- public final static int ATTRIBUTE_DEFAULT_UNDECLARED = 30;
-
- /**
- * Constant: the attribute has a literal default value specified.
- * @see #getAttributeDefaultValueType
- * @see #getAttributeDefaultValue
- */
- public final static int ATTRIBUTE_DEFAULT_SPECIFIED = 31;
-
- /**
- * Constant: the attribute was declared #IMPLIED.
- * @see #getAttributeDefaultValueType
- */
- public final static int ATTRIBUTE_DEFAULT_IMPLIED = 32;
-
- /**
- * Constant: the attribute was declared #REQUIRED.
- * @see #getAttributeDefaultValueType
- */
- public final static int ATTRIBUTE_DEFAULT_REQUIRED = 33;
-
- /**
- * Constant: the attribute was declared #FIXED.
- * @see #getAttributeDefaultValueType
- * @see #getAttributeDefaultValue
- */
- public final static int ATTRIBUTE_DEFAULT_FIXED = 34;
-
- //
- // Constants for input.
- //
- private final static int INPUT_NONE = 0;
- private final static int INPUT_INTERNAL = 1;
- private final static int INPUT_STREAM = 3;
- private final static int INPUT_READER = 5;
-
- //
- // Flags for reading literals.
- //
- // expand general entity refs (attribute values in dtd and content)
- private final static int LIT_ENTITY_REF = 2;
- // normalize this value (space chars) (attributes, public ids)
- private final static int LIT_NORMALIZE = 4;
- // literal is an attribute value
- private final static int LIT_ATTRIBUTE = 8;
- // don't expand parameter entities
- private final static int LIT_DISABLE_PE = 16;
- // don't expand [or parse] character refs
- private final static int LIT_DISABLE_CREF = 32;
- // don't parse general entity refs
- private final static int LIT_DISABLE_EREF = 64;
- // literal is a public ID value
- private final static int LIT_PUBID = 256;
-
- //
- // Flags affecting PE handling in DTDs (if expandPE is true).
- // PEs expand with space padding, except inside literals.
- //
- private final static int CONTEXT_NORMAL = 0;
- private final static int CONTEXT_LITERAL = 1;
-
- // Emit warnings for relative URIs with no base URI.
- static boolean uriWarnings;
- static
- {
- String key = "gnu.xml.aelfred2.XmlParser.uriWarnings";
- GetPropertyAction a = new GetPropertyAction(key);
- uriWarnings = "true".equals(AccessController.doPrivileged(a));
- }
-
- //
- // The current XML handler interface.
- //
- private SAXDriver handler;
-
- //
- // I/O information.
- //
- private Reader reader; // current reader
- private InputStream is; // current input stream
- private int line; // current line number
- private int column; // current column number
- private int sourceType; // type of input source
- private LinkedList inputStack; // stack of input soruces
- private URLConnection externalEntity; // current external entity
- private int encoding; // current character encoding
- private int currentByteCount; // bytes read from current source
- private InputSource scratch; // temporary
-
- //
- // Buffers for decoded but unparsed character input.
- //
- private char[] readBuffer;
- private int readBufferPos;
- private int readBufferLength;
- private int readBufferOverflow; // overflow from last data chunk.
-
- //
- // Buffer for undecoded raw byte input.
- //
- private final static int READ_BUFFER_MAX = 16384;
- private byte[] rawReadBuffer;
-
-
- //
- // Buffer for attribute values, char refs, DTD stuff.
- //
- private static int DATA_BUFFER_INITIAL = 4096;
- private char[] dataBuffer;
- private int dataBufferPos;
-
- //
- // Buffer for parsed names.
- //
- private static int NAME_BUFFER_INITIAL = 1024;
- private char[] nameBuffer;
- private int nameBufferPos;
-
- //
- // Save any standalone flag
- //
- private boolean docIsStandalone;
-
- //
- // Hashtables for DTD information on elements, entities, and notations.
- // Populated until we start ignoring decls (because of skipping a PE)
- //
- private HashMap elementInfo;
- private HashMap entityInfo;
- private HashMap notationInfo;
- private boolean skippedPE;
-
- //
- // Element type currently in force.
- //
- private String currentElement;
- private int currentElementContent;
-
- //
- // Stack of entity names, to detect recursion.
- //
- private LinkedList entityStack;
-
- //
- // PE expansion is enabled in most chunks of the DTD, not all.
- // When it's enabled, literals are treated differently.
- //
- private boolean inLiteral;
- private boolean expandPE;
- private boolean peIsError;
-
- //
- // can't report entity expansion inside two constructs:
- // - attribute expansions (internal entities only)
- // - markup declarations (parameter entities only)
- //
- private boolean doReport;
-
- //
- // Symbol table, for caching interned names.
- //
- // These show up wherever XML names or nmtokens are used: naming elements,
- // attributes, PIs, notations, entities, and enumerated attribute values.
- //
- // NOTE: This hashtable doesn't grow. The default size is intended to be
- // rather large for most documents. Example: one snapshot of the DocBook
- // XML 4.1 DTD used only about 350 such names. As a rule, only pathological
- // documents (ones that don't reuse names) should ever see much collision.
- //
- // Be sure that SYMBOL_TABLE_LENGTH always stays prime, for best hashing.
- // "2039" keeps the hash table size at about two memory pages on typical
- // 32 bit hardware.
- //
- private final static int SYMBOL_TABLE_LENGTH = 2039;
-
- private Object[][] symbolTable;
-
- //
- // Hash table of attributes found in current start tag.
- //
- private String[] tagAttributes;
- private int tagAttributePos;
-
- //
- // Utility flag: have we noticed a CR while reading the last
- // data chunk? If so, we will have to go back and normalise
- // CR or CR/LF line ends.
- //
- private boolean sawCR;
-
- //
- // Utility flag: are we in CDATA? If so, whitespace isn't ignorable.
- //
- private boolean inCDATA;
-
- //
- // Xml version.
- //
- private static final int XML_10 = 0;
- private static final int XML_11 = 1;
- private int xmlVersion = XML_10;
-
- //////////////////////////////////////////////////////////////////////
- // Constructors.
- ////////////////////////////////////////////////////////////////////////
-
- /**
- * Construct a new parser with no associated handler.
- * @see #setHandler
- * @see #parse
- */
- // package private
- XmlParser()
- {
- }
-
- /**
- * Set the handler that will receive parsing events.
- * @param handler The handler to receive callback events.
- * @see #parse
- */
- // package private
- void setHandler(SAXDriver handler)
- {
- this.handler = handler;
- }
-
- /**
- * Parse an XML document from the character stream, byte stream, or URI
- * that you provide (in that order of preference). Any URI that you
- * supply will become the base URI for resolving relative URI, and may
- * be used to acquire a reader or byte stream.
- *
- * <p> Only one thread at a time may use this parser; since it is
- * private to this package, post-parse cleanup is done by the caller,
- * which MUST NOT REUSE the parser (just null it).
- *
- * @param systemId Absolute URI of the document; should never be null,
- * but may be so iff a reader <em>or</em> a stream is provided.
- * @param publicId The public identifier of the document, or null.
- * @param reader A character stream; must be null if stream isn't.
- * @param stream A byte input stream; must be null if reader isn't.
- * @param encoding The suggested encoding, or null if unknown.
- * @exception java.lang.Exception Basically SAXException or IOException
- */
- // package private
- void doParse(String systemId, String publicId, Reader reader,
- InputStream stream, String encoding)
- throws Exception
- {
- if (handler == null)
- {
- throw new IllegalStateException("no callback handler");
- }
-
- initializeVariables();
-
- // predeclare the built-in entities here (replacement texts)
- // we don't need to intern(), since we're guaranteed literals
- // are always (globally) interned.
- setInternalEntity("amp", "&#38;");
- setInternalEntity("lt", "&#60;");
- setInternalEntity("gt", "&#62;");
- setInternalEntity("apos", "&#39;");
- setInternalEntity("quot", "&#34;");
-
- try
- {
- // pushURL first to ensure locator is correct in startDocument
- // ... it might report an IO or encoding exception.
- handler.startDocument();
- pushURL(false, "[document]",
- // default baseURI: null
- new ExternalIdentifiers(publicId, systemId, null),
- reader, stream, encoding, false);
-
- parseDocument();
- }
- catch (EOFException e)
- {
- //empty input
- error("empty document, with no root element.");
- }
- finally
- {
- if (reader != null)
- {
- try
- {
- reader.close();
- }
- catch (IOException e)
- {
- /* ignore */
- }
- }
- if (stream != null)
- {
- try
- {
- stream.close();
- }
- catch (IOException e)
- {
- /* ignore */
- }
- }
- if (is != null)
- {
- try
- {
- is.close();
- }
- catch (IOException e)
- {
- /* ignore */
- }
- }
- scratch = null;
- }
- }
-
- //////////////////////////////////////////////////////////////////////
- // Error reporting.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * Report an error.
- * @param message The error message.
- * @param textFound The text that caused the error (or null).
- * @see SAXDriver#error
- * @see #line
- */
- private void error(String message, String textFound, String textExpected)
- throws SAXException
- {
- if (textFound != null)
- {
- message = message + " (found \"" + textFound + "\")";
- }
- if (textExpected != null)
- {
- message = message + " (expected \"" + textExpected + "\")";
- }
- handler.fatal(message);
-
- // "can't happen"
- throw new SAXException(message);
- }
-
- /**
- * Report a serious error.
- * @param message The error message.
- * @param textFound The text that caused the error (or null).
- */
- private void error(String message, char textFound, String textExpected)
- throws SAXException
- {
- error(message, new Character(textFound).toString(), textExpected);
- }
-
- /**
- * Report typical case fatal errors.
- */
- private void error(String message)
- throws SAXException
- {
- handler.fatal(message);
- }
-
- //////////////////////////////////////////////////////////////////////
- // Major syntactic productions.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * Parse an XML document.
- * <pre>
- * [1] document ::= prolog element Misc*
- * </pre>
- * <p>This is the top-level parsing function for a single XML
- * document. As a minimum, a well-formed document must have
- * a document element, and a valid document must have a prolog
- * (one with doctype) as well.
- */
- private void parseDocument()
- throws Exception
- {
- try
- { // added by MHK
- boolean sawDTD = parseProlog();
- require('<');
- parseElement(!sawDTD);
- }
- catch (EOFException ee)
- { // added by MHK
- error("premature end of file", "[EOF]", null);
- }
-
- try
- {
- parseMisc(); //skip all white, PIs, and comments
- char c = readCh(); //if this doesn't throw an exception...
- error("unexpected characters after document end", c, null);
- }
- catch (EOFException e)
- {
- return;
- }
- }
-
- static final char[] startDelimComment = { '<', '!', '-', '-' };
- static final char[] endDelimComment = { '-', '-' };
-
- /**
- * Skip a comment.
- * <pre>
- * [15] Comment ::= '&lt;!--' ((Char - '-') | ('-' (Char - '-')))* "-->"
- * </pre>
- * <p> (The <code>&lt;!--</code> has already been read.)
- */
- private void parseComment()
- throws Exception
- {
- char c;
- boolean saved = expandPE;
-
- expandPE = false;
- parseUntil(endDelimComment);
- require('>');
- expandPE = saved;
- handler.comment(dataBuffer, 0, dataBufferPos);
- dataBufferPos = 0;
- }
-
- static final char[] startDelimPI = { '<', '?' };
- static final char[] endDelimPI = { '?', '>' };
-
- /**
- * Parse a processing instruction and do a call-back.
- * <pre>
- * [16] PI ::= '&lt;?' PITarget
- * (S (Char* - (Char* '?&gt;' Char*)))?
- * '?&gt;'
- * [17] PITarget ::= Name - ( ('X'|'x') ('M'|m') ('L'|l') )
- * </pre>
- * <p> (The <code>&lt;?</code> has already been read.)
- */
- private void parsePI()
- throws SAXException, IOException
- {
- String name;
- boolean saved = expandPE;
-
- expandPE = false;
- name = readNmtoken(true);
- //NE08
- if (name.indexOf(':') >= 0)
- {
- error("Illegal character(':') in processing instruction name ",
- name, null);
- }
- if ("xml".equalsIgnoreCase(name))
- {
- error("Illegal processing instruction target", name, null);
- }
- if (!tryRead(endDelimPI))
- {
- requireWhitespace();
- parseUntil(endDelimPI);
- }
- expandPE = saved;
- handler.processingInstruction(name, dataBufferToString());
- }
-
- static final char[] endDelimCDATA = { ']', ']', '>' };
-
- private boolean isDirtyCurrentElement;
-
- /**
- * Parse a CDATA section.
- * <pre>
- * [18] CDSect ::= CDStart CData CDEnd
- * [19] CDStart ::= '&lt;![CDATA['
- * [20] CData ::= (Char* - (Char* ']]&gt;' Char*))
- * [21] CDEnd ::= ']]&gt;'
- * </pre>
- * <p> (The '&lt;![CDATA[' has already been read.)
- */
- private void parseCDSect()
- throws Exception
- {
- parseUntil(endDelimCDATA);
- dataBufferFlush();
- }
-
- /**
- * Parse the prolog of an XML document.
- * <pre>
- * [22] prolog ::= XMLDecl? Misc* (Doctypedecl Misc*)?
- * </pre>
- * <p>We do not look for the XML declaration here, because it was
- * handled by pushURL ().
- * @see pushURL
- * @return true if a DTD was read.
- */
- private boolean parseProlog()
- throws Exception
- {
- parseMisc();
-
- if (tryRead("<!DOCTYPE"))
- {
- parseDoctypedecl();
- parseMisc();
- return true;
- }
- return false;
- }
-
- private void checkLegalVersion(String version)
- throws SAXException
- {
- int len = version.length();
- for (int i = 0; i < len; i++)
- {
- char c = version.charAt(i);
- if ('0' <= c && c <= '9')
- {
- continue;
- }
- if (c == '_' || c == '.' || c == ':' || c == '-')
- {
- continue;
- }
- if ('a' <= c && c <= 'z')
- {
- continue;
- }
- if ('A' <= c && c <= 'Z')
- {
- continue;
- }
- error ("illegal character in version", version, "1.0");
- }
- }
-
- /**
- * Parse the XML declaration.
- * <pre>
- * [23] XMLDecl ::= '&lt;?xml' VersionInfo EncodingDecl? SDDecl? S? '?&gt;'
- * [24] VersionInfo ::= S 'version' Eq
- * ("'" VersionNum "'" | '"' VersionNum '"' )
- * [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')*
- * [32] SDDecl ::= S 'standalone' Eq
- * ( "'"" ('yes' | 'no') "'"" | '"' ("yes" | "no") '"' )
- * [80] EncodingDecl ::= S 'encoding' Eq
- * ( "'" EncName "'" | "'" EncName "'" )
- * [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
- * </pre>
- * <p> (The <code>&lt;?xml</code> and whitespace have already been read.)
- * @return the encoding in the declaration, uppercased; or null
- * @see #parseTextDecl
- * @see #setupDecoding
- */
- private String parseXMLDecl(boolean ignoreEncoding)
- throws SAXException, IOException
- {
- String version;
- String encodingName = null;
- String standalone = null;
- int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF;
- String inputEncoding = null;
-
- switch (this.encoding)
- {
- case ENCODING_EXTERNAL:
- case ENCODING_UTF_8:
- inputEncoding = "UTF-8";
- break;
- case ENCODING_ISO_8859_1:
- inputEncoding = "ISO-8859-1";
- break;
- case ENCODING_UCS_2_12:
- inputEncoding = "UTF-16BE";
- break;
- case ENCODING_UCS_2_21:
- inputEncoding = "UTF-16LE";
- break;
- }
-
- // Read the version.
- require("version");
- parseEq();
- checkLegalVersion(version = readLiteral(flags));
- if (!version.equals("1.0"))
- {
- if (version.equals("1.1"))
- {
- handler.warn("expected XML version 1.0, not: " + version);
- xmlVersion = XML_11;
- }
- else
- {
- error("illegal XML version", version, "1.0 or 1.1");
- }
- }
- else
- {
- xmlVersion = XML_10;
- }
- // Try reading an encoding declaration.
- boolean white = tryWhitespace();
-
- if (tryRead("encoding"))
- {
- if (!white)
- {
- error("whitespace required before 'encoding='");
- }
- parseEq();
- encodingName = readLiteral(flags);
- if (!ignoreEncoding)
- {
- setupDecoding(encodingName);
- }
- }
-
- // Try reading a standalone declaration
- if (encodingName != null)
- {
- white = tryWhitespace();
- }
- if (tryRead("standalone"))
- {
- if (!white)
- {
- error("whitespace required before 'standalone='");
- }
- parseEq();
- standalone = readLiteral(flags);
- if ("yes".equals(standalone))
- {
- docIsStandalone = true;
- }
- else if (!"no".equals(standalone))
- {
- error("standalone flag must be 'yes' or 'no'");
- }
- }
-
- skipWhitespace();
- require("?>");
-
- if (inputEncoding == null)
- {
- inputEncoding = encodingName;
- }
- handler.xmlDecl(version, encodingName, docIsStandalone,
- inputEncoding);
-
- return encodingName;
- }
-
- /**
- * Parse a text declaration.
- * <pre>
- * [79] TextDecl ::= '&lt;?xml' VersionInfo? EncodingDecl S? '?&gt;'
- * [80] EncodingDecl ::= S 'encoding' Eq
- * ( '"' EncName '"' | "'" EncName "'" )
- * [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
- * </pre>
- * <p> (The <code>&lt;?xml</code>' and whitespace have already been read.)
- * @return the encoding in the declaration, uppercased; or null
- * @see #parseXMLDecl
- * @see #setupDecoding
- */
- private String parseTextDecl(boolean ignoreEncoding)
- throws SAXException, IOException
- {
- String encodingName = null;
- int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF;
-
- // Read an optional version.
- if (tryRead ("version"))
- {
- String version;
- parseEq();
- checkLegalVersion(version = readLiteral(flags));
-
- if (version.equals("1.1"))
- {
- if (xmlVersion == XML_10)
- {
- error("external subset has later version number.", "1.0",
- version);
- }
- handler.warn("expected XML version 1.0, not: " + version);
- xmlVersion = XML_11;
- }
- else if (!version.equals("1.0"))
- {
- error("illegal XML version", version, "1.0 or 1.1");
- }
- requireWhitespace();
- }
-
- // Read the encoding.
- require("encoding");
- parseEq();
- encodingName = readLiteral(flags);
- if (!ignoreEncoding)
- {
- setupDecoding(encodingName);
- }
- skipWhitespace();
- require("?>");
-
- return encodingName;
- }
-
- /**
- * Sets up internal state so that we can decode an entity using the
- * specified encoding. This is used when we start to read an entity
- * and we have been given knowledge of its encoding before we start to
- * read any data (e.g. from a SAX input source or from a MIME type).
- *
- * <p> It is also used after autodetection, at which point only very
- * limited adjustments to the encoding may be used (switching between
- * related builtin decoders).
- *
- * @param encodingName The name of the encoding specified by the user.
- * @exception IOException if the encoding isn't supported either
- * internally to this parser, or by the hosting JVM.
- * @see #parseXMLDecl
- * @see #parseTextDecl
- */
- private void setupDecoding(String encodingName)
- throws SAXException, IOException
- {
- encodingName = encodingName.toUpperCase();
-
- // ENCODING_EXTERNAL indicates an encoding that wasn't
- // autodetected ... we can use builtin decoders, or
- // ones from the JVM (InputStreamReader).
-
- // Otherwise we can only tweak what was autodetected, and
- // only for single byte (ASCII derived) builtin encodings.
-
- // ASCII-derived encodings
- if (encoding == ENCODING_UTF_8 || encoding == ENCODING_EXTERNAL)
- {
- if (encodingName.equals("ISO-8859-1")
- || encodingName.equals("8859_1")
- || encodingName.equals("ISO8859_1"))
- {
- encoding = ENCODING_ISO_8859_1;
- return;
- }
- else if (encodingName.equals("US-ASCII")
- || encodingName.equals("ASCII"))
- {
- encoding = ENCODING_ASCII;
- return;
- }
- else if (encodingName.equals("UTF-8")
- || encodingName.equals("UTF8"))
- {
- encoding = ENCODING_UTF_8;
- return;
- }
- else if (encoding != ENCODING_EXTERNAL)
- {
- // used to start with a new reader ...
- throw new UnsupportedEncodingException(encodingName);
- }
- // else fallthrough ...
- // it's ASCII-ish and something other than a builtin
- }
-
- // Unicode and such
- if (encoding == ENCODING_UCS_2_12 || encoding == ENCODING_UCS_2_21)
- {
- if (!(encodingName.equals("ISO-10646-UCS-2")
- || encodingName.equals("UTF-16")
- || encodingName.equals("UTF-16BE")
- || encodingName.equals("UTF-16LE")))
- {
- error("unsupported Unicode encoding", encodingName, "UTF-16");
- }
- return;
- }
-
- // four byte encodings
- if (encoding == ENCODING_UCS_4_1234
- || encoding == ENCODING_UCS_4_4321
- || encoding == ENCODING_UCS_4_2143
- || encoding == ENCODING_UCS_4_3412)
- {
- // Strictly: "UCS-4" == "UTF-32BE"; also, "UTF-32LE" exists
- if (!encodingName.equals("ISO-10646-UCS-4"))
- {
- error("unsupported 32-bit encoding", encodingName,
- "ISO-10646-UCS-4");
- }
- return;
- }
-
- // assert encoding == ENCODING_EXTERNAL
- // if (encoding != ENCODING_EXTERNAL)
- // throw new RuntimeException ("encoding = " + encoding);
-
- if (encodingName.equals("UTF-16BE"))
- {
- encoding = ENCODING_UCS_2_12;
- return;
- }
- if (encodingName.equals("UTF-16LE"))
- {
- encoding = ENCODING_UCS_2_21;
- return;
- }
-
- // We couldn't use the builtin decoders at all. But we can try to
- // create a reader, since we haven't messed up buffering. Tweak
- // the encoding name if necessary.
-
- if (encodingName.equals("UTF-16")
- || encodingName.equals("ISO-10646-UCS-2"))
- {
- encodingName = "Unicode";
- }
- // Ignoring all the EBCDIC aliases here
-
- reader = new InputStreamReader(is, encodingName);
- sourceType = INPUT_READER;
- }
-
- /**
- * Parse miscellaneous markup outside the document element and DOCTYPE
- * declaration.
- * <pre>
- * [27] Misc ::= Comment | PI | S
- * </pre>
- */
- private void parseMisc()
- throws Exception
- {
- while (true)
- {
- skipWhitespace();
- if (tryRead(startDelimPI))
- {
- parsePI();
- }
- else if (tryRead(startDelimComment))
- {
- parseComment();
- }
- else
- {
- return;
- }
- }
- }
-
- /**
- * Parse a document type declaration.
- * <pre>
- * [28] doctypedecl ::= '&lt;!DOCTYPE' S Name (S ExternalID)? S?
- * ('[' (markupdecl | PEReference | S)* ']' S?)? '&gt;'
- * </pre>
- * <p> (The <code>&lt;!DOCTYPE</code> has already been read.)
- */
- private void parseDoctypedecl()
- throws Exception
- {
- String rootName;
- ExternalIdentifiers ids;
-
- // Read the document type name.
- requireWhitespace();
- rootName = readNmtoken(true);
-
- // Read the External subset's IDs
- skipWhitespace();
- ids = readExternalIds(false, true);
-
- // report (a) declaration of name, (b) lexical info (ids)
- handler.doctypeDecl(rootName, ids.publicId, ids.systemId);
-
- // Internal subset is parsed first, if present
- skipWhitespace();
- if (tryRead('['))
- {
-
- // loop until the subset ends
- while (true)
- {
- doReport = expandPE = true;
- skipWhitespace();
- doReport = expandPE = false;
- if (tryRead(']'))
- {
- break; // end of subset
- }
- else
- {
- // WFC, PEs in internal subset (only between decls)
- peIsError = expandPE = true;
- parseMarkupdecl();
- peIsError = expandPE = false;
- }
- }
- }
- skipWhitespace();
- require('>');
-
- // Read the external subset, if any
- InputSource subset;
-
- if (ids.systemId == null)
- {
- subset = handler.getExternalSubset(rootName,
- handler.getSystemId());
- }
- else
- {
- subset = null;
- }
- if (ids.systemId != null || subset != null)
- {
- pushString(null, ">");
-
- // NOTE: [dtd] is so we say what SAX2 expects,
- // though it's misleading (subset, not entire dtd)
- if (ids.systemId != null)
- {
- pushURL(true, "[dtd]", ids, null, null, null, true);
- }
- else
- {
- handler.warn("modifying document by adding external subset");
- pushURL(true, "[dtd]",
- new ExternalIdentifiers(subset.getPublicId(),
- subset.getSystemId(),
- null),
- subset.getCharacterStream(),
- subset.getByteStream(),
- subset.getEncoding(),
- false);
- }
-
- // Loop until we end up back at '>'
- while (true)
- {
- doReport = expandPE = true;
- skipWhitespace();
- doReport = expandPE = false;
- if (tryRead('>'))
- {
- break;
- }
- else
- {
- expandPE = true;
- parseMarkupdecl();
- expandPE = false;
- }
- }
-
- // the ">" string isn't popped yet
- if (inputStack.size() != 1)
- {
- error("external subset has unmatched '>'");
- }
- }
-
- // done dtd
- handler.endDoctype();
- expandPE = false;
- doReport = true;
- }
-
- /**
- * Parse a markup declaration in the internal or external DTD subset.
- * <pre>
- * [29] markupdecl ::= elementdecl | Attlistdecl | EntityDecl
- * | NotationDecl | PI | Comment
- * [30] extSubsetDecl ::= (markupdecl | conditionalSect
- * | PEReference | S) *
- * </pre>
- * <p> Reading toplevel PE references is handled as a lexical issue
- * by the caller, as is whitespace.
- */
- private void parseMarkupdecl()
- throws Exception
- {
- char[] saved = null;
- boolean savedPE = expandPE;
-
- // prevent "<%foo;" and ensures saved entity is right
- require('<');
- unread('<');
- expandPE = false;
-
- if (tryRead("<!ELEMENT"))
- {
- saved = readBuffer;
- expandPE = savedPE;
- parseElementDecl();
- }
- else if (tryRead("<!ATTLIST"))
- {
- saved = readBuffer;
- expandPE = savedPE;
- parseAttlistDecl();
- }
- else if (tryRead("<!ENTITY"))
- {
- saved = readBuffer;
- expandPE = savedPE;
- parseEntityDecl();
- }
- else if (tryRead("<!NOTATION"))
- {
- saved = readBuffer;
- expandPE = savedPE;
- parseNotationDecl();
- }
- else if (tryRead(startDelimPI))
- {
- saved = readBuffer;
- expandPE = savedPE;
- parsePI();
- }
- else if (tryRead(startDelimComment))
- {
- saved = readBuffer;
- expandPE = savedPE;
- parseComment();
- }
- else if (tryRead("<!["))
- {
- saved = readBuffer;
- expandPE = savedPE;
- if (inputStack.size() > 0)
- {
- parseConditionalSect(saved);
- }
- else
- {
- error("conditional sections illegal in internal subset");
- }
- }
- else
- {
- error("expected markup declaration");
- }
-
- // VC: Proper Decl/PE Nesting
- if (readBuffer != saved)
- {
- handler.verror("Illegal Declaration/PE nesting");
- }
- }
-
- /**
- * Parse an element, with its tags.
- * <pre>
- * [39] element ::= EmptyElementTag | STag content ETag
- * [40] STag ::= '&lt;' Name (S Attribute)* S? '&gt;'
- * [44] EmptyElementTag ::= '&lt;' Name (S Attribute)* S? '/&gt;'
- * </pre>
- * <p> (The '&lt;' has already been read.)
- * <p>NOTE: this method actually chains onto parseContent (), if necessary,
- * and parseContent () will take care of calling parseETag ().
- */
- private void parseElement(boolean maybeGetSubset)
- throws Exception
- {
- String gi;
- char c;
- int oldElementContent = currentElementContent;
- String oldElement = currentElement;
- ElementDecl element;
-
- // This is the (global) counter for the
- // array of specified attributes.
- tagAttributePos = 0;
-
- // Read the element type name.
- gi = readNmtoken(true);
-
- // If we saw no DTD, and this is the document root element,
- // let the application modify the input stream by providing one.
- if (maybeGetSubset)
- {
- InputSource subset = handler.getExternalSubset(gi,
- handler.getSystemId());
- if (subset != null)
- {
- String publicId = subset.getPublicId();
- String systemId = subset.getSystemId();
-
- handler.warn("modifying document by adding DTD");
- handler.doctypeDecl(gi, publicId, systemId);
- pushString(null, ">");
-
- // NOTE: [dtd] is so we say what SAX2 expects,
- // though it's misleading (subset, not entire dtd)
- pushURL(true, "[dtd]",
- new ExternalIdentifiers(publicId, systemId, null),
- subset.getCharacterStream(),
- subset.getByteStream(),
- subset.getEncoding(),
- false);
-
- // Loop until we end up back at '>'
- while (true)
- {
- doReport = expandPE = true;
- skipWhitespace();
- doReport = expandPE = false;
- if (tryRead('>'))
- {
- break;
- }
- else
- {
- expandPE = true;
- parseMarkupdecl();
- expandPE = false;
- }
- }
-
- // the ">" string isn't popped yet
- if (inputStack.size() != 1)
- {
- error("external subset has unmatched '>'");
- }
-
- handler.endDoctype();
- }
- }
-
- // Determine the current content type.
- currentElement = gi;
- element = (ElementDecl) elementInfo.get(gi);
- currentElementContent = getContentType(element, CONTENT_ANY);
-
- // Read the attributes, if any.
- // After this loop, "c" is the closing delimiter.
- boolean white = tryWhitespace();
- c = readCh();
- while (c != '/' && c != '>')
- {
- unread(c);
- if (!white)
- {
- error("need whitespace between attributes");
- }
- parseAttribute(gi);
- white = tryWhitespace();
- c = readCh();
- }
-
- // Supply any defaulted attributes.
- Iterator atts = declaredAttributes(element);
- if (atts != null)
- {
- String aname;
-loop:
- while (atts.hasNext())
- {
- aname = (String) atts.next();
- // See if it was specified.
- for (int i = 0; i < tagAttributePos; i++)
- {
- if (tagAttributes[i] == aname)
- {
- continue loop;
- }
- }
- // ... or has a default
- String value = getAttributeDefaultValue(gi, aname);
-
- if (value == null)
- {
- continue;
- }
- handler.attribute(aname, value, false);
- }
- }
-
- // Figure out if this is a start tag
- // or an empty element, and dispatch an
- // event accordingly.
- switch (c)
- {
- case '>':
- handler.startElement(gi);
- parseContent();
- break;
- case '/':
- require('>');
- handler.startElement(gi);
- handler.endElement(gi);
- break;
- }
-
- // Restore the previous state.
- currentElement = oldElement;
- currentElementContent = oldElementContent;
- }
-
- /**
- * Parse an attribute assignment.
- * <pre>
- * [41] Attribute ::= Name Eq AttValue
- * </pre>
- * @param name The name of the attribute's element.
- * @see SAXDriver#attribute
- */
- private void parseAttribute(String name)
- throws Exception
- {
- String aname;
- String type;
- String value;
- int flags = LIT_ATTRIBUTE | LIT_ENTITY_REF;
-
- // Read the attribute name.
- aname = readNmtoken(true);
- type = getAttributeType(name, aname);
-
- // Parse '='
- parseEq();
-
- // Read the value, normalizing whitespace
- // unless it is CDATA.
- if (handler.stringInterning)
- {
- if (type == "CDATA" || type == null)
- {
- value = readLiteral(flags);
- }
- else
- {
- value = readLiteral(flags | LIT_NORMALIZE);
- }
- }
- else
- {
- if (type.equals("CDATA") || type == null)
- {
- value = readLiteral(flags);
- }
- else
- {
- value = readLiteral(flags | LIT_NORMALIZE);
- }
- }
-
- // WFC: no duplicate attributes
- for (int i = 0; i < tagAttributePos; i++)
- {
- if (aname.equals(tagAttributes [i]))
- {
- error("duplicate attribute", aname, null);
- }
- }
-
- // Inform the handler about the
- // attribute.
- handler.attribute(aname, value, true);
- dataBufferPos = 0;
-
- // Note that the attribute has been
- // specified.
- if (tagAttributePos == tagAttributes.length)
- {
- String newAttrib[] = new String[tagAttributes.length * 2];
- System.arraycopy(tagAttributes, 0, newAttrib, 0, tagAttributePos);
- tagAttributes = newAttrib;
- }
- tagAttributes[tagAttributePos++] = aname;
- }
-
- /**
- * Parse an equals sign surrounded by optional whitespace.
- * <pre>
- * [25] Eq ::= S? '=' S?
- * </pre>
- */
- private void parseEq()
- throws SAXException, IOException
- {
- skipWhitespace();
- require('=');
- skipWhitespace();
- }
-
- /**
- * Parse an end tag.
- * <pre>
- * [42] ETag ::= '</' Name S? '>'
- * </pre>
- * <p>NOTE: parseContent () chains to here, we already read the
- * "&lt;/".
- */
- private void parseETag()
- throws Exception
- {
- require(currentElement);
- skipWhitespace();
- require('>');
- handler.endElement(currentElement);
- // not re-reporting any SAXException re bogus end tags,
- // even though that diagnostic might be clearer ...
- }
-
- /**
- * Parse the content of an element.
- * <pre>
- * [43] content ::= (element | CharData | Reference
- * | CDSect | PI | Comment)*
- * [67] Reference ::= EntityRef | CharRef
- * </pre>
- * <p> NOTE: consumes ETtag.
- */
- private void parseContent()
- throws Exception
- {
- char c;
-
- while (true)
- {
- // consume characters (or ignorable whitspace) until delimiter
- parseCharData();
-
- // Handle delimiters
- c = readCh();
- switch (c)
- {
- case '&': // Found "&"
- c = readCh();
- if (c == '#')
- {
- parseCharRef();
- }
- else
- {
- unread(c);
- parseEntityRef(true);
- }
- isDirtyCurrentElement = true;
- break;
-
- case '<': // Found "<"
- dataBufferFlush();
- c = readCh();
- switch (c)
- {
- case '!': // Found "<!"
- c = readCh();
- switch (c)
- {
- case '-': // Found "<!-"
- require('-');
- isDirtyCurrentElement = false;
- parseComment();
- break;
- case '[': // Found "<!["
- isDirtyCurrentElement = false;
- require("CDATA[");
- handler.startCDATA();
- inCDATA = true;
- parseCDSect();
- inCDATA = false;
- handler.endCDATA();
- break;
- default:
- error("expected comment or CDATA section", c, null);
- break;
- }
- break;
-
- case '?': // Found "<?"
- isDirtyCurrentElement = false;
- parsePI();
- break;
-
- case '/': // Found "</"
- isDirtyCurrentElement = false;
- parseETag();
- return;
-
- default: // Found "<" followed by something else
- isDirtyCurrentElement = false;
- unread(c);
- parseElement(false);
- break;
- }
- }
- }
- }
-
- /**
- * Parse an element type declaration.
- * <pre>
- * [45] elementdecl ::= '&lt;!ELEMENT' S Name S contentspec S? '&gt;'
- * </pre>
- * <p> NOTE: the '&lt;!ELEMENT' has already been read.
- */
- private void parseElementDecl()
- throws Exception
- {
- String name;
-
- requireWhitespace();
- // Read the element type name.
- name = readNmtoken(true);
-
- requireWhitespace();
- // Read the content model.
- parseContentspec(name);
-
- skipWhitespace();
- require('>');
- }
-
- /**
- * Content specification.
- * <pre>
- * [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | elements
- * </pre>
- */
- private void parseContentspec(String name)
- throws Exception
- {
- // FIXME: move elementDecl() into setElement(), pass EMTPY/ANY ...
- if (tryRead("EMPTY"))
- {
- setElement(name, CONTENT_EMPTY, null, null);
- if (!skippedPE)
- {
- handler.getDeclHandler().elementDecl(name, "EMPTY");
- }
- return;
- }
- else if (tryRead("ANY"))
- {
- setElement(name, CONTENT_ANY, null, null);
- if (!skippedPE)
- {
- handler.getDeclHandler().elementDecl(name, "ANY");
- }
- return;
- }
- else
- {
- String model;
- char[] saved;
-
- require('(');
- saved = readBuffer;
- dataBufferAppend('(');
- skipWhitespace();
- if (tryRead("#PCDATA"))
- {
- dataBufferAppend("#PCDATA");
- parseMixed(saved);
- model = dataBufferToString();
- setElement(name, CONTENT_MIXED, model, null);
- }
- else
- {
- parseElements(saved);
- model = dataBufferToString();
- setElement(name, CONTENT_ELEMENTS, model, null);
- }
- if (!skippedPE)
- {
- handler.getDeclHandler().elementDecl(name, model);
- }
- }
- }
-
- /**
- * Parse an element-content model.
- * <pre>
- * [47] elements ::= (choice | seq) ('?' | '*' | '+')?
- * [49] choice ::= '(' S? cp (S? '|' S? cp)+ S? ')'
- * [50] seq ::= '(' S? cp (S? ',' S? cp)* S? ')'
- * </pre>
- *
- * <p> NOTE: the opening '(' and S have already been read.
- *
- * @param saved Buffer for entity that should have the terminal ')'
- */
- private void parseElements(char[] saved)
- throws Exception
- {
- char c;
- char sep;
-
- // Parse the first content particle
- skipWhitespace();
- parseCp();
-
- // Check for end or for a separator.
- skipWhitespace();
- c = readCh();
- switch (c)
- {
- case ')':
- // VC: Proper Group/PE Nesting
- if (readBuffer != saved)
- {
- handler.verror("Illegal Group/PE nesting");
- }
-
- dataBufferAppend(')');
- c = readCh();
- switch (c)
- {
- case '*':
- case '+':
- case '?':
- dataBufferAppend(c);
- break;
- default:
- unread(c);
- }
- return;
- case ',': // Register the separator.
- case '|':
- sep = c;
- dataBufferAppend(c);
- break;
- default:
- error("bad separator in content model", c, null);
- return;
- }
-
- // Parse the rest of the content model.
- while (true)
- {
- skipWhitespace();
- parseCp();
- skipWhitespace();
- c = readCh();
- if (c == ')')
- {
- // VC: Proper Group/PE Nesting
- if (readBuffer != saved)
- {
- handler.verror("Illegal Group/PE nesting");
- }
-
- dataBufferAppend(')');
- break;
- }
- else if (c != sep)
- {
- error("bad separator in content model", c, null);
- return;
- }
- else
- {
- dataBufferAppend(c);
- }
- }
-
- // Check for the occurrence indicator.
- c = readCh();
- switch (c)
- {
- case '?':
- case '*':
- case '+':
- dataBufferAppend(c);
- return;
- default:
- unread(c);
- return;
- }
- }
-
- /**
- * Parse a content particle.
- * <pre>
- * [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
- * </pre>
- */
- private void parseCp()
- throws Exception
- {
- if (tryRead('('))
- {
- dataBufferAppend('(');
- parseElements(readBuffer);
- }
- else
- {
- dataBufferAppend(readNmtoken(true));
- char c = readCh();
- switch (c)
- {
- case '?':
- case '*':
- case '+':
- dataBufferAppend(c);
- break;
- default:
- unread(c);
- break;
- }
- }
- }
-
- /**
- * Parse mixed content.
- * <pre>
- * [51] Mixed ::= '(' S? ( '#PCDATA' (S? '|' S? Name)*) S? ')*'
- * | '(' S? ('#PCDATA') S? ')'
- * </pre>
- *
- * @param saved Buffer for entity that should have the terminal ')'
- */
- private void parseMixed(char[] saved)
- throws Exception
- {
- // Check for PCDATA alone.
- skipWhitespace();
- if (tryRead(')'))
- {
- // VC: Proper Group/PE Nesting
- if (readBuffer != saved)
- {
- handler.verror("Illegal Group/PE nesting");
- }
-
- dataBufferAppend(")*");
- tryRead('*');
- return;
- }
-
- // Parse mixed content.
- skipWhitespace();
- while (!tryRead(")"))
- {
- require('|');
- dataBufferAppend('|');
- skipWhitespace();
- dataBufferAppend(readNmtoken(true));
- skipWhitespace();
- }
-
- // VC: Proper Group/PE Nesting
- if (readBuffer != saved)
- {
- handler.verror("Illegal Group/PE nesting");
- }
-
- require('*');
- dataBufferAppend(")*");
- }
-
- /**
- * Parse an attribute list declaration.
- * <pre>
- * [52] AttlistDecl ::= '&lt;!ATTLIST' S Name AttDef* S? '&gt;'
- * </pre>
- * <p>NOTE: the '&lt;!ATTLIST' has already been read.
- */
- private void parseAttlistDecl()
- throws Exception
- {
- String elementName;
-
- requireWhitespace();
- elementName = readNmtoken(true);
- boolean white = tryWhitespace();
- while (!tryRead('>'))
- {
- if (!white)
- {
- error("whitespace required before attribute definition");
- }
- parseAttDef(elementName);
- white = tryWhitespace();
- }
- }
-
- /**
- * Parse a single attribute definition.
- * <pre>
- * [53] AttDef ::= S Name S AttType S DefaultDecl
- * </pre>
- */
- private void parseAttDef(String elementName)
- throws Exception
- {
- String name;
- String type;
- String enumer = null;
-
- // Read the attribute name.
- name = readNmtoken(true);
-
- // Read the attribute type.
- requireWhitespace();
- type = readAttType();
-
- // Get the string of enumerated values if necessary.
- if (handler.stringInterning)
- {
- if ("ENUMERATION" == type || "NOTATION" == type)
- {
- enumer = dataBufferToString();
- }
- }
- else
- {
- if ("ENUMERATION".equals(type) || "NOTATION".equals(type))
- {
- enumer = dataBufferToString();
- }
- }
-
- // Read the default value.
- requireWhitespace();
- parseDefault(elementName, name, type, enumer);
- }
-
- /**
- * Parse the attribute type.
- * <pre>
- * [54] AttType ::= StringType | TokenizedType | EnumeratedType
- * [55] StringType ::= 'CDATA'
- * [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY'
- * | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'
- * [57] EnumeratedType ::= NotationType | Enumeration
- * </pre>
- */
- private String readAttType()
- throws Exception
- {
- if (tryRead('('))
- {
- parseEnumeration(false);
- return "ENUMERATION";
- }
- else
- {
- String typeString = readNmtoken(true);
- if (handler.stringInterning)
- {
- if ("NOTATION" == typeString)
- {
- parseNotationType();
- return typeString;
- }
- else if ("CDATA" == typeString
- || "ID" == typeString
- || "IDREF" == typeString
- || "IDREFS" == typeString
- || "ENTITY" == typeString
- || "ENTITIES" == typeString
- || "NMTOKEN" == typeString
- || "NMTOKENS" == typeString)
- {
- return typeString;
- }
- }
- else
- {
- if ("NOTATION".equals(typeString))
- {
- parseNotationType();
- return typeString;
- }
- else if ("CDATA".equals(typeString)
- || "ID".equals(typeString)
- || "IDREF".equals(typeString)
- || "IDREFS".equals(typeString)
- || "ENTITY".equals(typeString)
- || "ENTITIES".equals(typeString)
- || "NMTOKEN".equals(typeString)
- || "NMTOKENS".equals(typeString))
- {
- return typeString;
- }
- }
- error("illegal attribute type", typeString, null);
- return null;
- }
- }
-
- /**
- * Parse an enumeration.
- * <pre>
- * [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
- * </pre>
- * <p>NOTE: the '(' has already been read.
- */
- private void parseEnumeration(boolean isNames)
- throws Exception
- {
- dataBufferAppend('(');
-
- // Read the first token.
- skipWhitespace();
- dataBufferAppend(readNmtoken(isNames));
- // Read the remaining tokens.
- skipWhitespace();
- while (!tryRead(')'))
- {
- require('|');
- dataBufferAppend('|');
- skipWhitespace();
- dataBufferAppend(readNmtoken (isNames));
- skipWhitespace();
- }
- dataBufferAppend(')');
- }
-
- /**
- * Parse a notation type for an attribute.
- * <pre>
- * [58] NotationType ::= 'NOTATION' S '(' S? NameNtoks
- * (S? '|' S? name)* S? ')'
- * </pre>
- * <p>NOTE: the 'NOTATION' has already been read
- */
- private void parseNotationType()
- throws Exception
- {
- requireWhitespace();
- require('(');
-
- parseEnumeration(true);
- }
-
- /**
- * Parse the default value for an attribute.
- * <pre>
- * [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED'
- * | (('#FIXED' S)? AttValue)
- * </pre>
- */
- private void parseDefault(String elementName, String name,
- String type, String enumer)
- throws Exception
- {
- int valueType = ATTRIBUTE_DEFAULT_SPECIFIED;
- String value = null;
- int flags = LIT_ATTRIBUTE;
- boolean saved = expandPE;
- String defaultType = null;
-
- // LIT_ATTRIBUTE forces '<' checks now (ASAP) and turns whitespace
- // chars to spaces (doesn't matter when that's done if it doesn't
- // interfere with char refs expanding to whitespace).
-
- if (!skippedPE)
- {
- flags |= LIT_ENTITY_REF;
- if (handler.stringInterning)
- {
- if ("CDATA" != type)
- {
- flags |= LIT_NORMALIZE;
- }
- }
- else
- {
- if (!"CDATA".equals(type))
- {
- flags |= LIT_NORMALIZE;
- }
- }
- }
-
- expandPE = false;
- if (tryRead('#'))
- {
- if (tryRead("FIXED"))
- {
- defaultType = "#FIXED";
- valueType = ATTRIBUTE_DEFAULT_FIXED;
- requireWhitespace();
- value = readLiteral(flags);
- }
- else if (tryRead("REQUIRED"))
- {
- defaultType = "#REQUIRED";
- valueType = ATTRIBUTE_DEFAULT_REQUIRED;
- }
- else if (tryRead("IMPLIED"))
- {
- defaultType = "#IMPLIED";
- valueType = ATTRIBUTE_DEFAULT_IMPLIED;
- }
- else
- {
- error("illegal keyword for attribute default value");
- }
- }
- else
- {
- value = readLiteral(flags);
- }
- expandPE = saved;
- setAttribute(elementName, name, type, enumer, value, valueType);
- if (handler.stringInterning)
- {
- if ("ENUMERATION" == type)
- {
- type = enumer;
- }
- else if ("NOTATION" == type)
- {
- type = "NOTATION " + enumer;
- }
- }
- else
- {
- if ("ENUMERATION".equals(type))
- {
- type = enumer;
- }
- else if ("NOTATION".equals(type))
- {
- type = "NOTATION " + enumer;
- }
- }
- if (!skippedPE)
- {
- handler.getDeclHandler().attributeDecl(elementName, name, type,
- defaultType, value);
- }
- }
-
- /**
- * Parse a conditional section.
- * <pre>
- * [61] conditionalSect ::= includeSect || ignoreSect
- * [62] includeSect ::= '&lt;![' S? 'INCLUDE' S? '['
- * extSubsetDecl ']]&gt;'
- * [63] ignoreSect ::= '&lt;![' S? 'IGNORE' S? '['
- * ignoreSectContents* ']]&gt;'
- * [64] ignoreSectContents ::= Ignore
- * ('&lt;![' ignoreSectContents* ']]&gt;' Ignore )*
- * [65] Ignore ::= Char* - (Char* ( '&lt;![' | ']]&gt;') Char* )
- * </pre>
- * <p> NOTE: the '&gt;![' has already been read.
- */
- private void parseConditionalSect(char[] saved)
- throws Exception
- {
- skipWhitespace();
- if (tryRead("INCLUDE"))
- {
- skipWhitespace();
- require('[');
- // VC: Proper Conditional Section/PE Nesting
- if (readBuffer != saved)
- {
- handler.verror("Illegal Conditional Section/PE nesting");
- }
- skipWhitespace();
- while (!tryRead("]]>"))
- {
- parseMarkupdecl();
- skipWhitespace();
- }
- }
- else if (tryRead("IGNORE"))
- {
- skipWhitespace();
- require('[');
- // VC: Proper Conditional Section/PE Nesting
- if (readBuffer != saved)
- {
- handler.verror("Illegal Conditional Section/PE nesting");
- }
- int nesting = 1;
- char c;
- expandPE = false;
- for (int nest = 1; nest > 0; )
- {
- c = readCh();
- switch (c)
- {
- case '<':
- if (tryRead("!["))
- {
- nest++;
- }
- case ']':
- if (tryRead("]>"))
- {
- nest--;
- }
- }
- }
- expandPE = true;
- }
- else
- {
- error("conditional section must begin with INCLUDE or IGNORE");
- }
- }
-
- private void parseCharRef()
- throws SAXException, IOException
- {
- parseCharRef(true /* do flushDataBuffer by default */);
- }
-
- /**
- * Try to read a character reference without consuming data from buffer.
- * <pre>
- * [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
- * </pre>
- * <p>NOTE: the '&#' has already been read.
- */
- private void tryReadCharRef()
- throws SAXException, IOException
- {
- int value = 0;
- char c;
-
- if (tryRead('x'))
- {
-loop1:
- while (true)
- {
- c = readCh();
- if (c == ';')
- {
- break loop1;
- }
- else
- {
- int n = Character.digit(c, 16);
- if (n == -1)
- {
- error("illegal character in character reference", c, null);
- break loop1;
- }
- value *= 16;
- value += n;
- }
- }
- }
- else
- {
-loop2:
- while (true)
- {
- c = readCh();
- if (c == ';')
- {
- break loop2;
- }
- else
- {
- int n = Character.digit(c, 10);
- if (n == -1)
- {
- error("illegal character in character reference", c, null);
- break loop2;
- }
- value *= 10;
- value += n;
- }
- }
- }
-
- // check for character refs being legal XML
- if ((value < 0x0020
- && ! (value == '\n' || value == '\t' || value == '\r'))
- || (value >= 0xD800 && value <= 0xDFFF)
- || value == 0xFFFE || value == 0xFFFF
- || value > 0x0010ffff)
- {
- error("illegal XML character reference U+"
- + Integer.toHexString(value));
- }
-
- // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz
- // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz:
- if (value > 0x0010ffff)
- {
- // too big for surrogate
- error("character reference " + value + " is too large for UTF-16",
- new Integer(value).toString(), null);
- }
-
- }
-
- /**
- * Read and interpret a character reference.
- * <pre>
- * [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
- * </pre>
- * <p>NOTE: the '&#' has already been read.
- */
- private void parseCharRef(boolean doFlush)
- throws SAXException, IOException
- {
- int value = 0;
- char c;
-
- if (tryRead('x'))
- {
-loop1:
- while (true)
- {
- c = readCh();
- if (c == ';')
- {
- break loop1;
- }
- else
- {
- int n = Character.digit(c, 16);
- if (n == -1)
- {
- error("illegal character in character reference", c, null);
- break loop1;
- }
- value *= 16;
- value += n;
- }
- }
- }
- else
- {
-loop2:
- while (true)
- {
- c = readCh();
- if (c == ';')
- {
- break loop2;
- }
- else
- {
- int n = Character.digit(c, 10);
- if (n == -1)
- {
- error("illegal character in character reference", c, null);
- break loop2;
- }
- value *= 10;
- value += c - '0';
- }
- }
- }
-
- // check for character refs being legal XML
- if ((value < 0x0020
- && ! (value == '\n' || value == '\t' || value == '\r'))
- || (value >= 0xD800 && value <= 0xDFFF)
- || value == 0xFFFE || value == 0xFFFF
- || value > 0x0010ffff)
- {
- error("illegal XML character reference U+"
- + Integer.toHexString(value));
- }
-
- // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz
- // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz:
- if (value <= 0x0000ffff)
- {
- // no surrogates needed
- dataBufferAppend((char) value);
- }
- else if (value <= 0x0010ffff)
- {
- value -= 0x10000;
- // > 16 bits, surrogate needed
- dataBufferAppend((char) (0xd800 | (value >> 10)));
- dataBufferAppend((char) (0xdc00 | (value & 0x0003ff)));
- }
- else
- {
- // too big for surrogate
- error("character reference " + value + " is too large for UTF-16",
- new Integer(value).toString(), null);
- }
- if (doFlush)
- {
- dataBufferFlush();
- }
- }
-
- /**
- * Parse and expand an entity reference.
- * <pre>
- * [68] EntityRef ::= '&' Name ';'
- * </pre>
- * <p>NOTE: the '&amp;' has already been read.
- * @param externalAllowed External entities are allowed here.
- */
- private void parseEntityRef(boolean externalAllowed)
- throws SAXException, IOException
- {
- String name;
-
- name = readNmtoken(true);
- require(';');
- switch (getEntityType(name))
- {
- case ENTITY_UNDECLARED:
- // NOTE: XML REC describes amazingly convoluted handling for
- // this case. Nothing as meaningful as being a WFness error
- // unless the processor might _legitimately_ not have seen a
- // declaration ... which is what this implements.
- String message;
-
- message = "reference to undeclared general entity " + name;
- if (skippedPE && !docIsStandalone)
- {
- handler.verror(message);
- // we don't know this entity, and it might be external...
- if (externalAllowed)
- {
- handler.skippedEntity(name);
- }
- }
- else
- {
- error(message);
- }
- break;
- case ENTITY_INTERNAL:
- pushString(name, getEntityValue(name));
-
- //workaround for possible input pop before marking
- //the buffer reading position
- char t = readCh();
- unread(t);
- int bufferPosMark = readBufferPos;
-
- int end = readBufferPos + getEntityValue(name).length();
- for (int k = readBufferPos; k < end; k++)
- {
- t = readCh();
- if (t == '&')
- {
- t = readCh();
- if (t == '#')
- {
- //try to match a character ref
- tryReadCharRef();
-
- //everything has been read
- if (readBufferPos >= end)
- {
- break;
- }
- k = readBufferPos;
- continue;
- }
- else if (Character.isLetter(t))
- {
- //looks like an entity ref
- unread(t);
- readNmtoken(true);
- require(';');
-
- //everything has been read
- if (readBufferPos >= end)
- {
- break;
- }
- k = readBufferPos;
- continue;
- }
- error(" malformed entity reference");
- }
-
- }
- readBufferPos = bufferPosMark;
- break;
- case ENTITY_TEXT:
- if (externalAllowed)
- {
- pushURL(false, name, getEntityIds(name),
- null, null, null, true);
- }
- else
- {
- error("reference to external entity in attribute value.",
- name, null);
- }
- break;
- case ENTITY_NDATA:
- if (externalAllowed)
- {
- error("unparsed entity reference in content", name, null);
- }
- else
- {
- error("reference to external entity in attribute value.",
- name, null);
- }
- break;
- default:
- throw new RuntimeException();
- }
- }
-
- /**
- * Parse and expand a parameter entity reference.
- * <pre>
- * [69] PEReference ::= '%' Name ';'
- * </pre>
- * <p>NOTE: the '%' has already been read.
- */
- private void parsePEReference()
- throws SAXException, IOException
- {
- String name;
-
- name = "%" + readNmtoken(true);
- require(';');
- switch (getEntityType(name))
- {
- case ENTITY_UNDECLARED:
- // VC: Entity Declared
- handler.verror("reference to undeclared parameter entity " + name);
-
- // we should disable handling of all subsequent declarations
- // unless this is a standalone document (info discarded)
- break;
- case ENTITY_INTERNAL:
- if (inLiteral)
- {
- pushString(name, getEntityValue(name));
- }
- else
- {
- pushString(name, ' ' + getEntityValue(name) + ' ');
- }
- break;
- case ENTITY_TEXT:
- if (!inLiteral)
- {
- pushString(null, " ");
- }
- pushURL(true, name, getEntityIds(name), null, null, null, true);
- if (!inLiteral)
- {
- pushString(null, " ");
- }
- break;
- }
- }
-
- /**
- * Parse an entity declaration.
- * <pre>
- * [70] EntityDecl ::= GEDecl | PEDecl
- * [71] GEDecl ::= '&lt;!ENTITY' S Name S EntityDef S? '&gt;'
- * [72] PEDecl ::= '&lt;!ENTITY' S '%' S Name S PEDef S? '&gt;'
- * [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
- * [74] PEDef ::= EntityValue | ExternalID
- * [75] ExternalID ::= 'SYSTEM' S SystemLiteral
- * | 'PUBLIC' S PubidLiteral S SystemLiteral
- * [76] NDataDecl ::= S 'NDATA' S Name
- * </pre>
- * <p>NOTE: the '&lt;!ENTITY' has already been read.
- */
- private void parseEntityDecl()
- throws Exception
- {
- boolean peFlag = false;
- int flags = 0;
-
- // Check for a parameter entity.
- expandPE = false;
- requireWhitespace();
- if (tryRead('%'))
- {
- peFlag = true;
- requireWhitespace();
- }
- expandPE = true;
-
- // Read the entity name, and prepend
- // '%' if necessary.
- String name = readNmtoken(true);
- //NE08
- if (name.indexOf(':') >= 0)
- {
- error("Illegal character(':') in entity name ", name, null);
- }
- if (peFlag)
- {
- name = "%" + name;
- }
-
- // Read the entity value.
- requireWhitespace();
- char c = readCh();
- unread (c);
- if (c == '"' || c == '\'')
- {
- // Internal entity ... replacement text has expanded refs
- // to characters and PEs, but not to general entities
- String value = readLiteral(flags);
- setInternalEntity(name, value);
- }
- else
- {
- // Read the external IDs
- ExternalIdentifiers ids = readExternalIds(false, false);
-
- // Check for NDATA declaration.
- boolean white = tryWhitespace();
- if (!peFlag && tryRead("NDATA"))
- {
- if (!white)
- {
- error("whitespace required before NDATA");
- }
- requireWhitespace();
- String notationName = readNmtoken(true);
- if (!skippedPE)
- {
- setExternalEntity(name, ENTITY_NDATA, ids, notationName);
- handler.unparsedEntityDecl(name, ids.publicId, ids.systemId,
- ids.baseUri, notationName);
- }
- }
- else if (!skippedPE)
- {
- setExternalEntity(name, ENTITY_TEXT, ids, null);
- handler.getDeclHandler()
- .externalEntityDecl(name, ids.publicId,
- handler.resolveURIs()
- // FIXME: ASSUMES not skipped
- // "false" forces error on bad URI
- ? handler.absolutize(ids.baseUri,
- ids.systemId,
- false)
- : ids.systemId);
- }
- }
-
- // Finish the declaration.
- skipWhitespace();
- require('>');
- }
-
- /**
- * Parse a notation declaration.
- * <pre>
- * [82] NotationDecl ::= '&lt;!NOTATION' S Name S
- * (ExternalID | PublicID) S? '&gt;'
- * [83] PublicID ::= 'PUBLIC' S PubidLiteral
- * </pre>
- * <P>NOTE: the '&lt;!NOTATION' has already been read.
- */
- private void parseNotationDecl()
- throws Exception
- {
- String nname;
- ExternalIdentifiers ids;
-
- requireWhitespace();
- nname = readNmtoken(true);
- //NE08
- if (nname.indexOf(':') >= 0)
- {
- error("Illegal character(':') in notation name ", nname, null);
- }
- requireWhitespace();
-
- // Read the external identifiers.
- ids = readExternalIds(true, false);
-
- // Register the notation.
- setNotation(nname, ids);
-
- skipWhitespace();
- require('>');
- }
-
- /**
- * Parse character data.
- * <pre>
- * [14] CharData ::= [^&lt;&amp;]* - ([^&lt;&amp;]* ']]&gt;' [^&lt;&amp;]*)
- * </pre>
- */
- private void parseCharData()
- throws Exception
- {
- char c;
- int state = 0;
- boolean pureWhite = false;
-
- // assert (dataBufferPos == 0);
-
- // are we expecting pure whitespace? it might be dirty...
- if ((currentElementContent == CONTENT_ELEMENTS) && !isDirtyCurrentElement)
- {
- pureWhite = true;
- }
-
- // always report right out of readBuffer
- // to minimize (pointless) buffer copies
- while (true)
- {
- int lineAugment = 0;
- int columnAugment = 0;
- int i;
-
-loop:
- for (i = readBufferPos; i < readBufferLength; i++)
- {
- switch (c = readBuffer[i])
- {
- case '\n':
- lineAugment++;
- columnAugment = 0;
- // pureWhite unmodified
- break;
- case '\r': // should not happen!!
- case '\t':
- case ' ':
- // pureWhite unmodified
- columnAugment++;
- break;
- case '&':
- case '<':
- columnAugment++;
- // pureWhite unmodified
- // CLEAN end of text sequence
- state = 1;
- break loop;
- case ']':
- // that's not a whitespace char, and
- // can not terminate pure whitespace either
- pureWhite = false;
- if ((i + 2) < readBufferLength)
- {
- if (readBuffer [i + 1] == ']'
- && readBuffer [i + 2] == '>')
- {
- // ERROR end of text sequence
- state = 2;
- break loop;
- }
- }
- else
- {
- // FIXME missing two end-of-buffer cases
- }
- columnAugment++;
- break;
- default:
- if ((c < 0x0020 || c > 0xFFFD)
- || ((c >= 0x007f) && (c <= 0x009f) && (c != 0x0085)
- && xmlVersion == XML_11))
- {
- error("illegal XML character U+"
- + Integer.toHexString(c));
- }
- // that's not a whitespace char
- pureWhite = false;
- columnAugment++;
- }
- }
-
- // report text thus far
- if (lineAugment > 0)
- {
- line += lineAugment;
- column = columnAugment;
- }
- else
- {
- column += columnAugment;
- }
-
- // report characters/whitspace
- int length = i - readBufferPos;
-
- if (length != 0)
- {
- if (pureWhite)
- {
- handler.ignorableWhitespace(readBuffer,
- readBufferPos, length);
- }
- else
- {
- handler.charData(readBuffer, readBufferPos, length);
- }
- readBufferPos = i;
- }
-
- if (state != 0)
- {
- break;
- }
-
- // fill next buffer from this entity, or
- // pop stack and continue with previous entity
- unread(readCh());
- }
- if (!pureWhite)
- {
- isDirtyCurrentElement = true;
- }
- // finish, maybe with error
- if (state != 1) // finish, no error
- {
- error("character data may not contain ']]>'");
- }
- }
-
- //////////////////////////////////////////////////////////////////////
- // High-level reading and scanning methods.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * Require whitespace characters.
- */
- private void requireWhitespace()
- throws SAXException, IOException
- {
- char c = readCh();
- if (isWhitespace(c))
- {
- skipWhitespace();
- }
- else
- {
- error("whitespace required", c, null);
- }
- }
-
- /**
- * Skip whitespace characters.
- * <pre>
- * [3] S ::= (#x20 | #x9 | #xd | #xa)+
- * </pre>
- */
- private void skipWhitespace()
- throws SAXException, IOException
- {
- // Start with a little cheat. Most of
- // the time, the white space will fall
- // within the current read buffer; if
- // not, then fall through.
- if (USE_CHEATS)
- {
- int lineAugment = 0;
- int columnAugment = 0;
-
-loop:
- for (int i = readBufferPos; i < readBufferLength; i++)
- {
- switch (readBuffer[i])
- {
- case ' ':
- case '\t':
- case '\r':
- columnAugment++;
- break;
- case '\n':
- lineAugment++;
- columnAugment = 0;
- break;
- case '%':
- if (expandPE)
- {
- break loop;
- }
- // else fall through...
- default:
- readBufferPos = i;
- if (lineAugment > 0)
- {
- line += lineAugment;
- column = columnAugment;
- }
- else
- {
- column += columnAugment;
- }
- return;
- }
- }
- }
-
- // OK, do it the slow way.
- char c = readCh ();
- while (isWhitespace(c))
- {
- c = readCh();
- }
- unread(c);
- }
-
- /**
- * Read a name or (when parsing an enumeration) name token.
- * <pre>
- * [5] Name ::= (Letter | '_' | ':') (NameChar)*
- * [7] Nmtoken ::= (NameChar)+
- * </pre>
- */
- private String readNmtoken(boolean isName)
- throws SAXException, IOException
- {
- char c;
-
- if (USE_CHEATS)
- {
-loop:
- for (int i = readBufferPos; i < readBufferLength; i++)
- {
- c = readBuffer[i];
- switch (c)
- {
- case '%':
- if (expandPE)
- {
- break loop;
- }
- // else fall through...
-
- // What may legitimately come AFTER a name/nmtoken?
- case '<': case '>': case '&':
- case ',': case '|': case '*': case '+': case '?':
- case ')':
- case '=':
- case '\'': case '"':
- case '[':
- case ' ': case '\t': case '\r': case '\n':
- case ';':
- case '/':
- int start = readBufferPos;
- if (i == start)
- {
- error("name expected", readBuffer[i], null);
- }
- readBufferPos = i;
- return intern(readBuffer, start, i - start);
-
- default:
- // FIXME ... per IBM's OASIS test submission, these:
- // ? U+06dd
- // Combining U+309B
- //these switches are kind of ugly but at least we won't
- //have to go over the whole lits for each char
- if (isName && i == readBufferPos)
- {
- char c2 = (char) (c & 0x00f0);
- switch (c & 0xff00)
- {
- //starting with 01
- case 0x0100:
- switch (c2)
- {
- case 0x0030:
- if (c == 0x0132 || c == 0x0133 || c == 0x013f)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- case 0x0040:
- if (c == 0x0140 || c == 0x0149)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- case 0x00c0:
- if (c == 0x01c4 || c == 0x01cc)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- case 0x00f0:
- if (c == 0x01f1 || c == 0x01f3)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- case 0x00b0:
- if (c == 0x01f1 || c == 0x01f3)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- default:
- if (c == 0x017f)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- }
-
- break;
- //starting with 11
- case 0x1100:
- switch (c2)
- {
- case 0x0000:
- if (c == 0x1104 || c == 0x1108 ||
- c == 0x110a || c == 0x110d)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- case 0x0030:
- if (c == 0x113b || c == 0x113f)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- case 0x0040:
- if (c == 0x1141 || c == 0x114d
- || c == 0x114f )
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- case 0x0050:
- if (c == 0x1151 || c == 0x1156)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- case 0x0060:
- if (c == 0x1162 || c == 0x1164
- || c == 0x1166 || c == 0x116b
- || c == 0x116f)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- case 0x00b0:
- if (c == 0x11b6 || c == 0x11b9
- || c == 0x11bb || c == 0x116f)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- break;
- default:
- if (c == 0x1174 || c == 0x119f
- || c == 0x11ac || c == 0x11c3
- || c == 0x11f1)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- }
- break;
- default:
- if (c == 0x0e46 || c == 0x1011
- || c == 0x212f || c == 0x0587
- || c == 0x0230 )
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- }
- }
- // punt on exact tests from Appendix A; approximate
- // them using the Unicode ID start/part rules
- if (i == readBufferPos && isName)
- {
- if (!Character.isUnicodeIdentifierStart(c)
- && c != ':' && c != '_')
- {
- error("Not a name start character, U+"
- + Integer.toHexString(c));
- }
- }
- else if (!Character.isUnicodeIdentifierPart(c)
- && c != '-' && c != ':' && c != '_' && c != '.'
- && !isExtender(c))
- {
- error("Not a name character, U+"
- + Integer.toHexString(c));
- }
- }
- }
- }
-
- nameBufferPos = 0;
-
- // Read the first character.
-loop:
- while (true)
- {
- c = readCh();
- switch (c)
- {
- case '%':
- case '<': case '>': case '&':
- case ',': case '|': case '*': case '+': case '?':
- case ')':
- case '=':
- case '\'': case '"':
- case '[':
- case ' ': case '\t': case '\n': case '\r':
- case ';':
- case '/':
- unread(c);
- if (nameBufferPos == 0)
- {
- error ("name expected");
- }
- // punt on exact tests from Appendix A, but approximate them
- if (isName
- && !Character.isUnicodeIdentifierStart(nameBuffer[0])
- && ":_".indexOf(nameBuffer[0]) == -1)
- {
- error("Not a name start character, U+"
- + Integer.toHexString(nameBuffer[0]));
- }
- String s = intern(nameBuffer, 0, nameBufferPos);
- nameBufferPos = 0;
- return s;
- default:
- // punt on exact tests from Appendix A, but approximate them
-
- if ((nameBufferPos != 0 || !isName)
- && !Character.isUnicodeIdentifierPart(c)
- && ":-_.".indexOf(c) == -1
- && !isExtender(c))
- {
- error("Not a name character, U+"
- + Integer.toHexString(c));
- }
- if (nameBufferPos >= nameBuffer.length)
- {
- nameBuffer =
- (char[]) extendArray(nameBuffer,
- nameBuffer.length, nameBufferPos);
- }
- nameBuffer[nameBufferPos++] = c;
- }
- }
- }
-
- private static boolean isExtender(char c)
- {
- // [88] Extender ::= ...
- return c == 0x00b7 || c == 0x02d0 || c == 0x02d1 || c == 0x0387
- || c == 0x0640 || c == 0x0e46 || c == 0x0ec6 || c == 0x3005
- || (c >= 0x3031 && c <= 0x3035)
- || (c >= 0x309d && c <= 0x309e)
- || (c >= 0x30fc && c <= 0x30fe);
- }
-
- /**
- * Read a literal. With matching single or double quotes as
- * delimiters (and not embedded!) this is used to parse:
- * <pre>
- * [9] EntityValue ::= ... ([^%&amp;] | PEReference | Reference)* ...
- * [10] AttValue ::= ... ([^<&] | Reference)* ...
- * [11] SystemLiteral ::= ... (URLchar - "'")* ...
- * [12] PubidLiteral ::= ... (PubidChar - "'")* ...
- * </pre>
- * as well as the quoted strings in XML and text declarations
- * (for version, encoding, and standalone) which have their
- * own constraints.
- */
- private String readLiteral(int flags)
- throws SAXException, IOException
- {
- char delim, c;
- int startLine = line;
- boolean saved = expandPE;
- boolean savedReport = doReport;
-
- // Find the first delimiter.
- delim = readCh();
- if (delim != '"' && delim != '\'')
- {
- error("expected '\"' or \"'\"", delim, null);
- return null;
- }
- inLiteral = true;
- if ((flags & LIT_DISABLE_PE) != 0)
- {
- expandPE = false;
- }
- doReport = false;
-
- // Each level of input source has its own buffer; remember
- // ours, so we won't read the ending delimiter from any
- // other input source, regardless of entity processing.
- char[] ourBuf = readBuffer;
-
- // Read the literal.
- try
- {
- c = readCh();
- boolean ampRead = false;
-loop:
- while (! (c == delim && readBuffer == ourBuf))
- {
- switch (c)
- {
- // attributes and public ids are normalized
- // in almost the same ways
- case '\n':
- case '\r':
- if ((flags & (LIT_ATTRIBUTE | LIT_PUBID)) != 0)
- {
- c = ' ';
- }
- break;
- case '\t':
- if ((flags & LIT_ATTRIBUTE) != 0)
- {
- c = ' ';
- }
- break;
- case '&':
- c = readCh();
- // Char refs are expanded immediately, except for
- // all the cases where it's deferred.
- if (c == '#')
- {
- if ((flags & LIT_DISABLE_CREF) != 0)
- {
- dataBufferAppend('&');
- break;
- }
- parseCharRef(false /* Do not do flushDataBuffer */);
-
- // exotic WFness risk: this is an entity literal,
- // dataBuffer [dataBufferPos - 1] == '&', and
- // following chars are a _partial_ entity/char ref
-
- // It looks like an entity ref ...
- }
- else
- {
- unread(c);
- // Expand it?
- if ((flags & LIT_ENTITY_REF) > 0)
- {
- parseEntityRef(false);
- if (String.valueOf(readBuffer).equals("&#38;"))
- {
- ampRead = true;
- }
- //Is it just data?
- }
- else if ((flags & LIT_DISABLE_EREF) != 0)
- {
- dataBufferAppend('&');
-
- // OK, it will be an entity ref -- expanded later.
- }
- else
- {
- String name = readNmtoken(true);
- require(';');
- dataBufferAppend('&');
- dataBufferAppend(name);
- dataBufferAppend(';');
- }
- }
- c = readCh();
- continue loop;
-
- case '<':
- // and why? Perhaps so "&foo;" expands the same
- // inside and outside an attribute?
- if ((flags & LIT_ATTRIBUTE) != 0)
- {
- error("attribute values may not contain '<'");
- }
- break;
-
- // We don't worry about case '%' and PE refs, readCh does.
-
- default:
- break;
- }
- dataBufferAppend(c);
- c = readCh();
- }
- }
- catch (EOFException e)
- {
- error("end of input while looking for delimiter (started on line "
- + startLine + ')', null, new Character(delim).toString());
- }
- inLiteral = false;
- expandPE = saved;
- doReport = savedReport;
-
- // Normalise whitespace if necessary.
- if ((flags & LIT_NORMALIZE) > 0)
- {
- dataBufferNormalize();
- }
-
- // Return the value.
- return dataBufferToString();
- }
-
- /**
- * Try reading external identifiers.
- * A system identifier is not required for notations.
- * @param inNotation Are we parsing a notation decl?
- * @param isSubset Parsing external subset decl (may be omitted)?
- * @return A three-member String array containing the identifiers,
- * or nulls. Order: public, system, baseURI.
- */
- private ExternalIdentifiers readExternalIds(boolean inNotation,
- boolean isSubset)
- throws Exception
- {
- char c;
- ExternalIdentifiers ids = new ExternalIdentifiers();
- int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF;
-
- if (tryRead("PUBLIC"))
- {
- requireWhitespace();
- ids.publicId = readLiteral(LIT_NORMALIZE | LIT_PUBID | flags);
- if (inNotation)
- {
- skipWhitespace();
- c = readCh();
- unread(c);
- if (c == '"' || c == '\'')
- {
- ids.systemId = readLiteral(flags);
- }
- }
- else
- {
- requireWhitespace();
- ids.systemId = readLiteral(flags);
- }
-
- for (int i = 0; i < ids.publicId.length(); i++)
- {
- c = ids.publicId.charAt(i);
- if (c >= 'a' && c <= 'z')
- {
- continue;
- }
- if (c >= 'A' && c <= 'Z')
- {
- continue;
- }
- if (" \r\n0123456789-' ()+,./:=?;!*#@$_%".indexOf(c) != -1)
- {
- continue;
- }
- error("illegal PUBLIC id character U+"
- + Integer.toHexString(c));
- }
- }
- else if (tryRead("SYSTEM"))
- {
- requireWhitespace();
- ids.systemId = readLiteral(flags);
- }
- else if (!isSubset)
- {
- error("missing SYSTEM or PUBLIC keyword");
- }
-
- if (ids.systemId != null)
- {
- if (ids.systemId.indexOf('#') != -1)
- {
- handler.verror("SYSTEM id has a URI fragment: " + ids.systemId);
- }
- ids.baseUri = handler.getSystemId();
- if (ids.baseUri == null && uriWarnings)
- {
- handler.warn("No base URI; hope URI is absolute: "
- + ids.systemId);
- }
- }
-
- return ids;
- }
-
- /**
- * Test if a character is whitespace.
- * <pre>
- * [3] S ::= (#x20 | #x9 | #xd | #xa)+
- * </pre>
- * @param c The character to test.
- * @return true if the character is whitespace.
- */
- private final boolean isWhitespace(char c)
- {
- if (c > 0x20)
- {
- return false;
- }
- if (c == 0x20 || c == 0x0a || c == 0x09 || c == 0x0d)
- {
- return true;
- }
- return false; // illegal ...
- }
-
- //////////////////////////////////////////////////////////////////////
- // Utility routines.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * Add a character to the data buffer.
- */
- private void dataBufferAppend(char c)
- {
- // Expand buffer if necessary.
- if (dataBufferPos >= dataBuffer.length)
- {
- dataBuffer = (char[]) extendArray(dataBuffer,
- dataBuffer.length, dataBufferPos);
- }
- dataBuffer[dataBufferPos++] = c;
- }
-
- /**
- * Add a string to the data buffer.
- */
- private void dataBufferAppend(String s)
- {
- dataBufferAppend(s.toCharArray(), 0, s.length());
- }
-
- /**
- * Append (part of) a character array to the data buffer.
- */
- private void dataBufferAppend(char[] ch, int start, int length)
- {
- dataBuffer = (char[]) extendArray(dataBuffer, dataBuffer.length,
- dataBufferPos + length);
-
- System.arraycopy(ch, start, dataBuffer, dataBufferPos, length);
- dataBufferPos += length;
- }
-
- /**
- * Normalise space characters in the data buffer.
- */
- private void dataBufferNormalize()
- {
- int i = 0;
- int j = 0;
- int end = dataBufferPos;
-
- // Skip spaces at the start.
- while (j < end && dataBuffer[j] == ' ')
- {
- j++;
- }
-
- // Skip whitespace at the end.
- while (end > j && dataBuffer[end - 1] == ' ')
- {
- end --;
- }
-
- // Start copying to the left.
- while (j < end)
- {
-
- char c = dataBuffer[j++];
-
- // Normalise all other spaces to
- // a single space.
- if (c == ' ')
- {
- while (j < end && dataBuffer[j++] == ' ')
- {
- continue;
- }
- dataBuffer[i++] = ' ';
- dataBuffer[i++] = dataBuffer[j - 1];
- }
- else
- {
- dataBuffer[i++] = c;
- }
- }
-
- // The new length is <= the old one.
- dataBufferPos = i;
- }
-
- /**
- * Convert the data buffer to a string.
- */
- private String dataBufferToString()
- {
- String s = new String(dataBuffer, 0, dataBufferPos);
- dataBufferPos = 0;
- return s;
- }
-
- /**
- * Flush the contents of the data buffer to the handler, as
- * appropriate, and reset the buffer for new input.
- */
- private void dataBufferFlush()
- throws SAXException
- {
- if (currentElementContent == CONTENT_ELEMENTS
- && dataBufferPos > 0
- && !inCDATA)
- {
- // We can't just trust the buffer to be whitespace, there
- // are (error) cases when it isn't
- for (int i = 0; i < dataBufferPos; i++)
- {
- if (!isWhitespace(dataBuffer[i]))
- {
- handler.charData(dataBuffer, 0, dataBufferPos);
- dataBufferPos = 0;
- }
- }
- if (dataBufferPos > 0)
- {
- handler.ignorableWhitespace(dataBuffer, 0, dataBufferPos);
- dataBufferPos = 0;
- }
- }
- else if (dataBufferPos > 0)
- {
- handler.charData(dataBuffer, 0, dataBufferPos);
- dataBufferPos = 0;
- }
- }
-
- /**
- * Require a string to appear, or throw an exception.
- * <p><em>Precondition:</em> Entity expansion is not required.
- * <p><em>Precondition:</em> data buffer has no characters that
- * will get sent to the application.
- */
- private void require(String delim)
- throws SAXException, IOException
- {
- int length = delim.length();
- char[] ch;
-
- if (length < dataBuffer.length)
- {
- ch = dataBuffer;
- delim.getChars(0, length, ch, 0);
- }
- else
- {
- ch = delim.toCharArray();
- }
-
- if (USE_CHEATS && length <= (readBufferLength - readBufferPos))
- {
- int offset = readBufferPos;
-
- for (int i = 0; i < length; i++, offset++)
- {
- if (ch[i] != readBuffer[offset])
- {
- error ("required string", null, delim);
- }
- }
- readBufferPos = offset;
-
- }
- else
- {
- for (int i = 0; i < length; i++)
- {
- require(ch[i]);
- }
- }
- }
-
- /**
- * Require a character to appear, or throw an exception.
- */
- private void require(char delim)
- throws SAXException, IOException
- {
- char c = readCh();
-
- if (c != delim)
- {
- error("required character", c, new Character(delim).toString());
- }
- }
-
- /**
- * Create an interned string from a character array.
- * &AElig;lfred uses this method to create an interned version
- * of all names and name tokens, so that it can test equality
- * with <code>==</code> instead of <code>String.equals ()</code>.
- *
- * <p>This is much more efficient than constructing a non-interned
- * string first, and then interning it.
- *
- * @param ch an array of characters for building the string.
- * @param start the starting position in the array.
- * @param length the number of characters to place in the string.
- * @return an interned string.
- * @see #intern (String)
- * @see java.lang.String#intern
- */
- public String intern(char[] ch, int start, int length)
- {
- int index = 0;
- int hash = 0;
- Object[] bucket;
-
- // Generate a hash code. This is a widely used string hash,
- // often attributed to Brian Kernighan.
- for (int i = start; i < start + length; i++)
- {
- hash = 31 * hash + ch[i];
- }
- hash = (hash & 0x7fffffff) % SYMBOL_TABLE_LENGTH;
-
- // Get the bucket -- consists of {array,String} pairs
- if ((bucket = symbolTable[hash]) == null)
- {
- // first string in this bucket
- bucket = new Object[8];
-
- // Search for a matching tuple, and
- // return the string if we find one.
- }
- else
- {
- while (index < bucket.length)
- {
- char[] chFound = (char[]) bucket[index];
-
- // Stop when we hit an empty entry.
- if (chFound == null)
- {
- break;
- }
-
- // If they're the same length, check for a match.
- if (chFound.length == length)
- {
- for (int i = 0; i < chFound.length; i++)
- {
- // continue search on failure
- if (ch[start + i] != chFound[i])
- {
- break;
- }
- else if (i == length - 1)
- {
- // That's it, we have a match!
- return (String) bucket[index + 1];
- }
- }
- }
- index += 2;
- }
- // Not found -- we'll have to add it.
-
- // Do we have to grow the bucket?
- bucket = (Object[]) extendArray(bucket, bucket.length, index);
- }
- symbolTable[hash] = bucket;
-
- // OK, add it to the end of the bucket -- "local" interning.
- // Intern "globally" to let applications share interning benefits.
- // That is, "!=" and "==" work on our strings, not just equals().
- String s = new String(ch, start, length).intern();
- bucket[index] = s.toCharArray();
- bucket[index + 1] = s;
- return s;
- }
-
- /**
- * Ensure the capacity of an array, allocating a new one if
- * necessary. Usually extends only for name hash collisions.
- */
- private Object extendArray(Object array, int currentSize, int requiredSize)
- {
- if (requiredSize < currentSize)
- {
- return array;
- }
- else
- {
- Object newArray = null;
- int newSize = currentSize * 2;
-
- if (newSize <= requiredSize)
- {
- newSize = requiredSize + 1;
- }
-
- if (array instanceof char[])
- {
- newArray = new char[newSize];
- }
- else if (array instanceof Object[])
- {
- newArray = new Object[newSize];
- }
- else
- {
- throw new RuntimeException();
- }
-
- System.arraycopy(array, 0, newArray, 0, currentSize);
- return newArray;
- }
- }
-
- //////////////////////////////////////////////////////////////////////
- // XML query routines.
- //////////////////////////////////////////////////////////////////////
-
- boolean isStandalone()
- {
- return docIsStandalone;
- }
-
- //
- // Elements
- //
-
- private int getContentType(ElementDecl element, int defaultType)
- {
- int retval;
-
- if (element == null)
- {
- return defaultType;
- }
- retval = element.contentType;
- if (retval == CONTENT_UNDECLARED)
- {
- retval = defaultType;
- }
- return retval;
- }
-
- /**
- * Look up the content type of an element.
- * @param name The element type name.
- * @return An integer constant representing the content type.
- * @see #CONTENT_UNDECLARED
- * @see #CONTENT_ANY
- * @see #CONTENT_EMPTY
- * @see #CONTENT_MIXED
- * @see #CONTENT_ELEMENTS
- */
- public int getElementContentType(String name)
- {
- ElementDecl element = (ElementDecl) elementInfo.get(name);
- return getContentType(element, CONTENT_UNDECLARED);
- }
-
- /**
- * Register an element.
- * Array format:
- * [0] element type name
- * [1] content model (mixed, elements only)
- * [2] attribute hash table
- */
- private void setElement(String name, int contentType,
- String contentModel, HashMap attributes)
- throws SAXException
- {
- if (skippedPE)
- {
- return;
- }
-
- ElementDecl element = (ElementDecl) elementInfo.get(name);
-
- // first <!ELEMENT ...> or <!ATTLIST ...> for this type?
- if (element == null)
- {
- element = new ElementDecl();
- element.contentType = contentType;
- element.contentModel = contentModel;
- element.attributes = attributes;
- elementInfo.put(name, element);
- return;
- }
-
- // <!ELEMENT ...> declaration?
- if (contentType != CONTENT_UNDECLARED)
- {
- // ... following an associated <!ATTLIST ...>
- if (element.contentType == CONTENT_UNDECLARED)
- {
- element.contentType = contentType;
- element.contentModel = contentModel;
- }
- else
- {
- // VC: Unique Element Type Declaration
- handler.verror("multiple declarations for element type: "
- + name);
- }
- }
-
- // first <!ATTLIST ...>, before <!ELEMENT ...> ?
- else if (attributes != null)
- {
- element.attributes = attributes;
- }
- }
-
- /**
- * Look up the attribute hash table for an element.
- * The hash table is the second item in the element array.
- */
- private HashMap getElementAttributes(String name)
- {
- ElementDecl element = (ElementDecl) elementInfo.get(name);
- return (element == null) ? null : element.attributes;
- }
-
- //
- // Attributes
- //
-
- /**
- * Get the declared attributes for an element type.
- * @param elname The name of the element type.
- * @return An iterator over all the attributes declared for
- * a specific element type. The results will be valid only
- * after the DTD (if any) has been parsed.
- * @see #getAttributeType
- * @see #getAttributeEnumeration
- * @see #getAttributeDefaultValueType
- * @see #getAttributeDefaultValue
- * @see #getAttributeExpandedValue
- */
- private Iterator declaredAttributes(ElementDecl element)
- {
- HashMap attlist;
-
- if (element == null)
- {
- return null;
- }
- if ((attlist = element.attributes) == null)
- {
- return null;
- }
- return attlist.keySet().iterator();
- }
-
- /**
- * Get the declared attributes for an element type.
- * @param elname The name of the element type.
- * @return An iterator over all the attributes declared for
- * a specific element type. The results will be valid only
- * after the DTD (if any) has been parsed.
- * @see #getAttributeType
- * @see #getAttributeEnumeration
- * @see #getAttributeDefaultValueType
- * @see #getAttributeDefaultValue
- * @see #getAttributeExpandedValue
- */
- public Iterator declaredAttributes(String elname)
- {
- return declaredAttributes((ElementDecl) elementInfo.get(elname));
- }
-
- /**
- * Retrieve the declared type of an attribute.
- * @param name The name of the associated element.
- * @param aname The name of the attribute.
- * @return An interend string denoting the type, or null
- * indicating an undeclared attribute.
- */
- public String getAttributeType(String name, String aname)
- {
- AttributeDecl attribute = getAttribute(name, aname);
- return (attribute == null) ? null : attribute.type;
- }
-
- /**
- * Retrieve the allowed values for an enumerated attribute type.
- * @param name The name of the associated element.
- * @param aname The name of the attribute.
- * @return A string containing the token list.
- */
- public String getAttributeEnumeration(String name, String aname)
- {
- AttributeDecl attribute = getAttribute(name, aname);
- // assert: attribute.enumeration is "ENUMERATION" or "NOTATION"
- return (attribute == null) ? null : attribute.enumeration;
- }
-
- /**
- * Retrieve the default value of a declared attribute.
- * @param name The name of the associated element.
- * @param aname The name of the attribute.
- * @return The default value, or null if the attribute was
- * #IMPLIED or simply undeclared and unspecified.
- * @see #getAttributeExpandedValue
- */
- public String getAttributeDefaultValue(String name, String aname)
- {
- AttributeDecl attribute = getAttribute(name, aname);
- return (attribute == null) ? null : attribute.value;
- }
-
- /*
-
-// FIXME: Leaving this in, until W3C finally resolves the confusion
-// between parts of the XML 2nd REC about when entity declararations
-// are guaranteed to be known. Current code matches what section 5.1
-// (conformance) describes, but some readings of the self-contradicting
-// text in 4.1 (the "Entity Declared" WFC and VC) seem to expect that
-// attribute expansion/normalization must be deferred in some cases
-// (just TRY to identify them!).
-
- * Retrieve the expanded value of a declared attribute.
- * <p>General entities (and char refs) will be expanded (once).
- * @param name The name of the associated element.
- * @param aname The name of the attribute.
- * @return The expanded default value, or null if the attribute was
- * #IMPLIED or simply undeclared
- * @see #getAttributeDefaultValue
- public String getAttributeExpandedValue (String name, String aname)
- throws Exception
- {
- AttributeDecl attribute = getAttribute (name, aname);
-
- if (attribute == null) {
- return null;
- } else if (attribute.defaultValue == null && attribute.value != null) {
- // we MUST use the same buf for both quotes else the literal
- // can't be properly terminated
- char buf [] = new char [1];
- int flags = LIT_ENTITY_REF | LIT_ATTRIBUTE;
- String type = getAttributeType (name, aname);
-
- if (type != "CDATA" && type != null)
- flags |= LIT_NORMALIZE;
- buf [0] = '"';
- pushCharArray (null, buf, 0, 1);
- pushString (null, attribute.value);
- pushCharArray (null, buf, 0, 1);
- attribute.defaultValue = readLiteral (flags);
- }
- return attribute.defaultValue;
- }
- */
-
- /**
- * Retrieve the default value mode of a declared attribute.
- * @see #ATTRIBUTE_DEFAULT_SPECIFIED
- * @see #ATTRIBUTE_DEFAULT_IMPLIED
- * @see #ATTRIBUTE_DEFAULT_REQUIRED
- * @see #ATTRIBUTE_DEFAULT_FIXED
- */
- public int getAttributeDefaultValueType(String name, String aname)
- {
- AttributeDecl attribute = getAttribute(name, aname);
- return (attribute == null) ? ATTRIBUTE_DEFAULT_UNDECLARED :
- attribute.valueType;
- }
-
- /**
- * Register an attribute declaration for later retrieval.
- * Format:
- * - String type
- * - String default value
- * - int value type
- * - enumeration
- * - processed default value
- */
- private void setAttribute(String elName, String name, String type,
- String enumeration, String value, int valueType)
- throws Exception
- {
- HashMap attlist;
-
- if (skippedPE)
- {
- return;
- }
-
- // Create a new hashtable if necessary.
- attlist = getElementAttributes(elName);
- if (attlist == null)
- {
- attlist = new HashMap();
- }
-
- // ignore multiple attribute declarations!
- if (attlist.get(name) != null)
- {
- // warn ...
- return;
- }
- else
- {
- AttributeDecl attribute = new AttributeDecl();
- attribute.type = type;
- attribute.value = value;
- attribute.valueType = valueType;
- attribute.enumeration = enumeration;
- attlist.put(name, attribute);
-
- // save; but don't overwrite any existing <!ELEMENT ...>
- setElement(elName, CONTENT_UNDECLARED, null, attlist);
- }
- }
-
- /**
- * Retrieve the attribute declaration for the given element name and name.
- */
- private AttributeDecl getAttribute(String elName, String name)
- {
- HashMap attlist = getElementAttributes(elName);
- return (attlist == null) ? null : (AttributeDecl) attlist.get(name);
- }
-
- //
- // Entities
- //
-
- /**
- * Find the type of an entity.
- * @returns An integer constant representing the entity type.
- * @see #ENTITY_UNDECLARED
- * @see #ENTITY_INTERNAL
- * @see #ENTITY_NDATA
- * @see #ENTITY_TEXT
- */
- public int getEntityType(String ename)
- {
- EntityInfo entity = (EntityInfo) entityInfo.get(ename);
- return (entity == null) ? ENTITY_UNDECLARED : entity.type;
- }
-
- /**
- * Return an external entity's identifiers.
- * @param ename The name of the external entity.
- * @return The entity's public identifier, system identifier, and base URI.
- * Null if the entity was not declared as an external entity.
- * @see #getEntityType
- */
- public ExternalIdentifiers getEntityIds(String ename)
- {
- EntityInfo entity = (EntityInfo) entityInfo.get(ename);
- return (entity == null) ? null : entity.ids;
- }
-
- /**
- * Return an internal entity's replacement text.
- * @param ename The name of the internal entity.
- * @return The entity's replacement text, or null if
- * the entity was not declared as an internal entity.
- * @see #getEntityType
- */
- public String getEntityValue(String ename)
- {
- EntityInfo entity = (EntityInfo) entityInfo.get(ename);
- return (entity == null) ? null : entity.value;
- }
-
- /**
- * Register an entity declaration for later retrieval.
- */
- private void setInternalEntity(String eName, String value)
- throws SAXException
- {
- if (skippedPE)
- {
- return;
- }
-
- if (entityInfo.get(eName) == null)
- {
- EntityInfo entity = new EntityInfo();
- entity.type = ENTITY_INTERNAL;
- entity.value = value;
- entityInfo.put(eName, entity);
- }
- if (handler.stringInterning)
- {
- if ("lt" == eName || "gt" == eName || "quot" == eName
- || "apos" == eName || "amp" == eName)
- {
- return;
- }
- }
- else
- {
- if ("lt".equals(eName) || "gt".equals(eName) || "quot".equals(eName)
- || "apos".equals(eName) || "amp".equals(eName))
- {
- return;
- }
- }
- handler.getDeclHandler().internalEntityDecl(eName, value);
- }
-
- /**
- * Register an external entity declaration for later retrieval.
- */
- private void setExternalEntity(String eName, int eClass,
- ExternalIdentifiers ids, String nName)
- {
- if (entityInfo.get(eName) == null)
- {
- EntityInfo entity = new EntityInfo();
- entity.type = eClass;
- entity.ids = ids;
- entity.notationName = nName;
- entityInfo.put(eName, entity);
- }
- }
-
- //
- // Notations.
- //
-
- /**
- * Report a notation declaration, checking for duplicates.
- */
- private void setNotation(String nname, ExternalIdentifiers ids)
- throws SAXException
- {
- if (skippedPE)
- {
- return;
- }
-
- handler.notationDecl(nname, ids.publicId, ids.systemId, ids.baseUri);
- if (notationInfo.get(nname) == null)
- {
- notationInfo.put(nname, nname);
- }
- else
- {
- // VC: Unique Notation Name
- handler.verror("Duplicate notation name decl: " + nname);
- }
- }
-
- //
- // Location.
- //
-
- /**
- * Return the current line number.
- */
- public int getLineNumber()
- {
- return line;
- }
-
- /**
- * Return the current column number.
- */
- public int getColumnNumber()
- {
- return column;
- }
-
- //////////////////////////////////////////////////////////////////////
- // High-level I/O.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * Read a single character from the readBuffer.
- * <p>The readDataChunk () method maintains the buffer.
- * <p>If we hit the end of an entity, try to pop the stack and
- * keep going.
- * <p> (This approach doesn't really enforce XML's rules about
- * entity boundaries, but this is not currently a validating
- * parser).
- * <p>This routine also attempts to keep track of the current
- * position in external entities, but it's not entirely accurate.
- * @return The next available input character.
- * @see #unread (char)
- * @see #readDataChunk
- * @see #readBuffer
- * @see #line
- * @return The next character from the current input source.
- */
- private char readCh()
- throws SAXException, IOException
- {
- // As long as there's nothing in the
- // read buffer, try reading more data
- // (for an external entity) or popping
- // the entity stack (for either).
- while (readBufferPos >= readBufferLength)
- {
- switch (sourceType)
- {
- case INPUT_READER:
- case INPUT_STREAM:
- readDataChunk();
- while (readBufferLength < 1)
- {
- popInput();
- if (readBufferLength < 1)
- {
- readDataChunk();
- }
- }
- break;
-
- default:
-
- popInput();
- break;
- }
- }
-
- char c = readBuffer[readBufferPos++];
-
- if (c == '\n')
- {
- line++;
- column = 0;
- }
- else
- {
- if (c == '<')
- {
- /* the most common return to parseContent () ... NOP */
- }
- else if (((c < 0x0020 && (c != '\t') && (c != '\r')) || c > 0xFFFD)
- || ((c >= 0x007f) && (c <= 0x009f) && (c != 0x0085)
- && xmlVersion == XML_11))
- {
- error("illegal XML character U+" + Integer.toHexString(c));
- }
-
- // If we're in the DTD and in a context where PEs get expanded,
- // do so ... 1/14/2000 errata identify those contexts. There
- // are also spots in the internal subset where PE refs are fatal
- // errors, hence yet another flag.
- else if (c == '%' && expandPE)
- {
- if (peIsError)
- {
- error("PE reference within decl in internal subset.");
- }
- parsePEReference();
- return readCh();
- }
- column++;
- }
-
- return c;
- }
-
- /**
- * Push a single character back onto the current input stream.
- * <p>This method usually pushes the character back onto
- * the readBuffer.
- * <p>I don't think that this would ever be called with
- * readBufferPos = 0, because the methods always reads a character
- * before unreading it, but just in case, I've added a boundary
- * condition.
- * @param c The character to push back.
- * @see #readCh
- * @see #unread (char[])
- * @see #readBuffer
- */
- private void unread(char c)
- throws SAXException
- {
- // Normal condition.
- if (c == '\n')
- {
- line--;
- column = -1;
- }
- if (readBufferPos > 0)
- {
- readBuffer[--readBufferPos] = c;
- }
- else
- {
- pushString(null, new Character(c).toString());
- }
- }
-
- /**
- * Push a char array back onto the current input stream.
- * <p>NOTE: you must <em>never</em> push back characters that you
- * haven't actually read: use pushString () instead.
- * @see #readCh
- * @see #unread (char)
- * @see #readBuffer
- * @see #pushString
- */
- private void unread(char[] ch, int length)
- throws SAXException
- {
- for (int i = 0; i < length; i++)
- {
- if (ch[i] == '\n')
- {
- line--;
- column = -1;
- }
- }
- if (length < readBufferPos)
- {
- readBufferPos -= length;
- }
- else
- {
- pushCharArray(null, ch, 0, length);
- }
- }
-
- /**
- * Push, or skip, a new external input source.
- * The source will be some kind of parsed entity, such as a PE
- * (including the external DTD subset) or content for the body.
- *
- * @param url The java.net.URL object for the entity.
- * @see SAXDriver#resolveEntity
- * @see #pushString
- * @see #sourceType
- * @see #pushInput
- * @see #detectEncoding
- * @see #sourceType
- * @see #readBuffer
- */
- private void pushURL(boolean isPE,
- String ename,
- ExternalIdentifiers ids,
- Reader reader,
- InputStream stream,
- String encoding,
- boolean doResolve)
- throws SAXException, IOException
- {
- boolean ignoreEncoding;
- String systemId;
- InputSource source;
-
- if (!isPE)
- {
- dataBufferFlush();
- }
-
- scratch.setPublicId(ids.publicId);
- scratch.setSystemId(ids.systemId);
-
- // See if we should skip or substitute the entity.
- // If we're not skipping, resolving reports startEntity()
- // and updates the (handler's) stack of URIs.
- if (doResolve)
- {
- // assert (stream == null && reader == null && encoding == null)
- source = handler.resolveEntity(isPE, ename, scratch, ids.baseUri);
- if (source == null)
- {
- handler.warn("skipping entity: " + ename);
- handler.skippedEntity(ename);
- if (isPE)
- {
- skippedPE = true;
- }
- return;
- }
-
- // we might be using alternate IDs/encoding
- systemId = source.getSystemId();
- // The following warning and setting systemId was deleted bcause
- // the application has the option of not setting systemId
- // provided that it has set the characte/byte stream.
- /*
- if (systemId == null) {
- handler.warn ("missing system ID, using " + ids.systemId);
- systemId = ids.systemId;
- }
- */
- }
- else
- {
- // "[document]", or "[dtd]" via getExternalSubset()
- scratch.setCharacterStream(reader);
- scratch.setByteStream(stream);
- scratch.setEncoding(encoding);
- source = scratch;
- systemId = ids.systemId;
- if (handler.stringInterning)
- {
- handler.startExternalEntity(ename, systemId,
- "[document]" == ename);
- }
- else
- {
- handler.startExternalEntity(ename, systemId,
- "[document]".equals(ename));
- }
- }
-
- // we may have been given I/O streams directly
- if (source.getCharacterStream() != null)
- {
- if (source.getByteStream() != null)
- error("InputSource has two streams!");
- reader = source.getCharacterStream();
- }
- else if (source.getByteStream() != null)
- {
- encoding = source.getEncoding();
- if (encoding == null)
- {
- stream = source.getByteStream();
- }
- else
- {
- try
- {
- reader = new InputStreamReader(source.getByteStream(),
- encoding);
- }
- catch (IOException e)
- {
- stream = source.getByteStream();
- }
- }
- }
- else if (systemId == null)
- {
- error("InputSource has no URI!");
- }
- scratch.setCharacterStream(null);
- scratch.setByteStream(null);
- scratch.setEncoding(null);
-
- // Push the existing status.
- pushInput(ename);
-
- // Create a new read buffer.
- // (Note the four-character margin)
- readBuffer = new char[READ_BUFFER_MAX + 4];
- readBufferPos = 0;
- readBufferLength = 0;
- readBufferOverflow = -1;
- is = null;
- line = 1;
- column = 0;
- currentByteCount = 0;
-
- // If there's an explicit character stream, just
- // ignore encoding declarations.
- if (reader != null)
- {
- sourceType = INPUT_READER;
- this.reader = reader;
- tryEncodingDecl(true);
- return;
- }
-
- // Else we handle the conversion, and need to ensure
- // it's done right.
- sourceType = INPUT_STREAM;
- if (stream != null)
- {
- is = stream;
- }
- else
- {
- // We have to open our own stream to the URL.
- URL url = new URL(systemId);
-
- externalEntity = url.openConnection();
- externalEntity.connect();
- is = externalEntity.getInputStream();
- }
-
- // If we get to here, there must be
- // an InputStream available.
- if (!is.markSupported())
- {
- is = new BufferedInputStream(is);
- }
-
- // Get any external encoding label.
- if (encoding == null && externalEntity != null)
- {
- // External labels can be untrustworthy; filesystems in
- // particular often have the wrong default for content
- // that wasn't locally originated. Those we autodetect.
- if (!"file".equals(externalEntity.getURL().getProtocol()))
- {
- int temp;
-
- // application/xml;charset=something;otherAttr=...
- // ... with many variants on 'something'
- encoding = externalEntity.getContentType();
-
- // MHK code (fix for Saxon 5.5.1/007):
- // protect against encoding==null
- if (encoding == null)
- {
- temp = -1;
- }
- else
- {
- temp = encoding.indexOf("charset");
- }
-
- // RFC 2376 sez MIME text defaults to ASCII, but since the
- // JDK will create a MIME type out of thin air, we always
- // autodetect when there's no explicit charset attribute.
- if (temp < 0)
- {
- encoding = null; // autodetect
- }
- else
- {
- // only this one attribute
- if ((temp = encoding.indexOf(';')) > 0)
- {
- encoding = encoding.substring(0, temp);
- }
-
- if ((temp = encoding.indexOf('=', temp + 7)) > 0)
- {
- encoding = encoding.substring(temp + 1);
-
- // attributes can have comment fields (RFC 822)
- if ((temp = encoding.indexOf('(')) > 0)
- {
- encoding = encoding.substring(0, temp);
- }
- // ... and values may be quoted
- if ((temp = encoding.indexOf('"')) > 0)
- {
- encoding =
- encoding.substring(temp + 1,
- encoding.indexOf('"', temp + 2));
- }
- encoding.trim();
- }
- else
- {
- handler.warn("ignoring illegal MIME attribute: "
- + encoding);
- encoding = null;
- }
- }
- }
- }
-
- // if we got an external encoding label, use it ...
- if (encoding != null)
- {
- this.encoding = ENCODING_EXTERNAL;
- setupDecoding(encoding);
- ignoreEncoding = true;
-
- // ... else autodetect from first bytes.
- }
- else
- {
- detectEncoding();
- ignoreEncoding = false;
- }
-
- // Read any XML or text declaration.
- // If we autodetected, it may tell us the "real" encoding.
- try
- {
- tryEncodingDecl(ignoreEncoding);
- }
- catch (UnsupportedEncodingException x)
- {
- encoding = x.getMessage();
-
- // if we don't handle the declared encoding,
- // try letting a JVM InputStreamReader do it
- try
- {
- if (sourceType != INPUT_STREAM)
- {
- throw x;
- }
-
- is.reset();
- readBufferPos = 0;
- readBufferLength = 0;
- readBufferOverflow = -1;
- line = 1;
- currentByteCount = column = 0;
-
- sourceType = INPUT_READER;
- this.reader = new InputStreamReader(is, encoding);
- is = null;
-
- tryEncodingDecl(true);
-
- }
- catch (IOException e)
- {
- error("unsupported text encoding",
- encoding,
- null);
- }
- }
- }
-
- /**
- * Check for an encoding declaration. This is the second part of the
- * XML encoding autodetection algorithm, relying on detectEncoding to
- * get to the point that this part can read any encoding declaration
- * in the document (using only US-ASCII characters).
- *
- * <p> Because this part starts to fill parser buffers with this data,
- * it's tricky to setup a reader so that Java's built-in decoders can be
- * used for the character encodings that aren't built in to this parser
- * (such as EUC-JP, KOI8-R, Big5, etc).
- *
- * @return any encoding in the declaration, uppercased; or null
- * @see detectEncoding
- */
- private String tryEncodingDecl(boolean ignoreEncoding)
- throws SAXException, IOException
- {
- // Read the XML/text declaration.
- if (tryRead("<?xml"))
- {
- if (tryWhitespace())
- {
- if (inputStack.size() > 0)
- {
- return parseTextDecl(ignoreEncoding);
- }
- else
- {
- return parseXMLDecl(ignoreEncoding);
- }
- }
- else
- {
- // <?xml-stylesheet ...?> or similar
- unread('l');
- unread('m');
- unread('x');
- unread('?');
- unread('<');
- }
- }
- return null;
- }
-
- /**
- * Attempt to detect the encoding of an entity.
- * <p>The trick here (as suggested in the XML standard) is that
- * any entity not in UTF-8, or in UCS-2 with a byte-order mark,
- * <b>must</b> begin with an XML declaration or an encoding
- * declaration; we simply have to look for "&lt;?xml" in various
- * encodings.
- * <p>This method has no way to distinguish among 8-bit encodings.
- * Instead, it sets up for UTF-8, then (possibly) revises its assumption
- * later in setupDecoding (). Any ASCII-derived 8-bit encoding
- * should work, but most will be rejected later by setupDecoding ().
- * @see #tryEncoding (byte[], byte, byte, byte, byte)
- * @see #tryEncoding (byte[], byte, byte)
- * @see #setupDecoding
- */
- private void detectEncoding()
- throws SAXException, IOException
- {
- byte[] signature = new byte[4];
-
- // Read the first four bytes for
- // autodetection.
- is.mark(4);
- is.read(signature);
- is.reset();
-
- //
- // FIRST: four byte encodings (who uses these?)
- //
- if (tryEncoding(signature, (byte) 0x00, (byte) 0x00,
- (byte) 0x00, (byte) 0x3c))
- {
- // UCS-4 must begin with "<?xml"
- // 0x00 0x00 0x00 0x3c: UCS-4, big-endian (1234)
- // "UTF-32BE"
- encoding = ENCODING_UCS_4_1234;
- }
- else if (tryEncoding(signature, (byte) 0x3c, (byte) 0x00,
- (byte) 0x00, (byte) 0x00))
- {
- // 0x3c 0x00 0x00 0x00: UCS-4, little-endian (4321)
- // "UTF-32LE"
- encoding = ENCODING_UCS_4_4321;
- }
- else if (tryEncoding(signature, (byte) 0x00, (byte) 0x00,
- (byte) 0x3c, (byte) 0x00))
- {
- // 0x00 0x00 0x3c 0x00: UCS-4, unusual (2143)
- encoding = ENCODING_UCS_4_2143;
- }
- else if (tryEncoding(signature, (byte) 0x00, (byte) 0x3c,
- (byte) 0x00, (byte) 0x00))
- {
- // 0x00 0x3c 0x00 0x00: UCS-4, unusual (3421)
- encoding = ENCODING_UCS_4_3412;
-
- // 00 00 fe ff UCS_4_1234 (with BOM)
- // ff fe 00 00 UCS_4_4321 (with BOM)
- }
-
- //
- // SECOND: two byte encodings
- // note ... with 1/14/2000 errata the XML spec identifies some
- // more "broken UTF-16" autodetection cases, with no XML decl,
- // which we don't handle here (that's legal too).
- //
- else if (tryEncoding(signature, (byte) 0xfe, (byte) 0xff))
- {
- // UCS-2 with a byte-order marker. (UTF-16)
- // 0xfe 0xff: UCS-2, big-endian (12)
- encoding = ENCODING_UCS_2_12;
- is.read(); is.read();
- }
- else if (tryEncoding(signature, (byte) 0xff, (byte) 0xfe))
- {
- // UCS-2 with a byte-order marker. (UTF-16)
- // 0xff 0xfe: UCS-2, little-endian (21)
- encoding = ENCODING_UCS_2_21;
- is.read(); is.read();
- }
- else if (tryEncoding(signature, (byte) 0x00, (byte) 0x3c,
- (byte) 0x00, (byte) 0x3f))
- {
- // UTF-16BE (otherwise, malformed UTF-16)
- // 0x00 0x3c 0x00 0x3f: UCS-2, big-endian, no byte-order mark
- encoding = ENCODING_UCS_2_12;
- error("no byte-order mark for UCS-2 entity");
- }
- else if (tryEncoding(signature, (byte) 0x3c, (byte) 0x00,
- (byte) 0x3f, (byte) 0x00))
- {
- // UTF-16LE (otherwise, malformed UTF-16)
- // 0x3c 0x00 0x3f 0x00: UCS-2, little-endian, no byte-order mark
- encoding = ENCODING_UCS_2_21;
- error("no byte-order mark for UCS-2 entity");
- }
-
- //
- // THIRD: ASCII-derived encodings, fixed and variable lengths
- //
- else if (tryEncoding(signature, (byte) 0x3c, (byte) 0x3f,
- (byte) 0x78, (byte) 0x6d))
- {
- // ASCII derived
- // 0x3c 0x3f 0x78 0x6d: UTF-8 or other 8-bit markup (read ENCODING)
- encoding = ENCODING_UTF_8;
- prefetchASCIIEncodingDecl();
- }
- else if (signature[0] == (byte) 0xef
- && signature[1] == (byte) 0xbb
- && signature[2] == (byte) 0xbf)
- {
- // 0xef 0xbb 0xbf: UTF-8 BOM (not part of document text)
- // this un-needed notion slipped into XML 2nd ed through a
- // "non-normative" erratum; now required by MSFT and UDDI,
- // and E22 made it normative.
- encoding = ENCODING_UTF_8;
- is.read(); is.read(); is.read();
- }
- else
- {
- // 4c 6f a7 94 ... we don't understand EBCDIC flavors
- // ... but we COULD at least kick in some fixed code page
-
- // (default) UTF-8 without encoding/XML declaration
- encoding = ENCODING_UTF_8;
- }
- }
-
- /**
- * Check for a four-byte signature.
- * <p>Utility routine for detectEncoding ().
- * <p>Always looks for some part of "<?XML" in a specific encoding.
- * @param sig The first four bytes read.
- * @param b1 The first byte of the signature
- * @param b2 The second byte of the signature
- * @param b3 The third byte of the signature
- * @param b4 The fourth byte of the signature
- * @see #detectEncoding
- */
- private static boolean tryEncoding(byte[] sig, byte b1, byte b2,
- byte b3, byte b4)
- {
- return (sig[0] == b1 && sig[1] == b2
- && sig[2] == b3 && sig[3] == b4);
- }
-
- /**
- * Check for a two-byte signature.
- * <p>Looks for a UCS-2 byte-order mark.
- * <p>Utility routine for detectEncoding ().
- * @param sig The first four bytes read.
- * @param b1 The first byte of the signature
- * @param b2 The second byte of the signature
- * @see #detectEncoding
- */
- private static boolean tryEncoding(byte[] sig, byte b1, byte b2)
- {
- return ((sig[0] == b1) && (sig[1] == b2));
- }
-
- /**
- * This method pushes a string back onto input.
- * <p>It is useful either as the expansion of an internal entity,
- * or for backtracking during the parse.
- * <p>Call pushCharArray () to do the actual work.
- * @param s The string to push back onto input.
- * @see #pushCharArray
- */
- private void pushString(String ename, String s)
- throws SAXException
- {
- char[] ch = s.toCharArray();
- pushCharArray(ename, ch, 0, ch.length);
- }
-
- /**
- * Push a new internal input source.
- * <p>This method is useful for expanding an internal entity,
- * or for unreading a string of characters. It creates a new
- * readBuffer containing the characters in the array, instead
- * of characters converted from an input byte stream.
- * @param ch The char array to push.
- * @see #pushString
- * @see #pushURL
- * @see #readBuffer
- * @see #sourceType
- * @see #pushInput
- */
- private void pushCharArray(String ename, char[] ch, int start, int length)
- throws SAXException
- {
- // Push the existing status
- pushInput(ename);
- if (ename != null && doReport)
- {
- dataBufferFlush();
- handler.startInternalEntity(ename);
- }
- sourceType = INPUT_INTERNAL;
- readBuffer = ch;
- readBufferPos = start;
- readBufferLength = length;
- readBufferOverflow = -1;
- }
-
- /**
- * Save the current input source onto the stack.
- * <p>This method saves all of the global variables associated with
- * the current input source, so that they can be restored when a new
- * input source has finished. It also tests for entity recursion.
- * <p>The method saves the following global variables onto a stack
- * using a fixed-length array:
- * <ol>
- * <li>sourceType
- * <li>externalEntity
- * <li>readBuffer
- * <li>readBufferPos
- * <li>readBufferLength
- * <li>line
- * <li>encoding
- * </ol>
- * @param ename The name of the entity (if any) causing the new input.
- * @see #popInput
- * @see #sourceType
- * @see #externalEntity
- * @see #readBuffer
- * @see #readBufferPos
- * @see #readBufferLength
- * @see #line
- * @see #encoding
- */
- private void pushInput(String ename)
- throws SAXException
- {
- // Check for entity recursion.
- if (ename != null)
- {
- Iterator entities = entityStack.iterator();
- while (entities.hasNext())
- {
- String e = (String) entities.next();
- if (e != null && e == ename)
- {
- error("recursive reference to entity", ename, null);
- }
- }
- }
- entityStack.addLast(ename);
-
- // Don't bother if there is no current input.
- if (sourceType == INPUT_NONE)
- {
- return;
- }
-
- // Set up a snapshot of the current
- // input source.
- Input input = new Input();
-
- input.sourceType = sourceType;
- input.externalEntity = externalEntity;
- input.readBuffer = readBuffer;
- input.readBufferPos = readBufferPos;
- input.readBufferLength = readBufferLength;
- input.line = line;
- input.encoding = encoding;
- input.readBufferOverflow = readBufferOverflow;
- input.is = is;
- input.currentByteCount = currentByteCount;
- input.column = column;
- input.reader = reader;
-
- // Push it onto the stack.
- inputStack.addLast(input);
- }
-
- /**
- * Restore a previous input source.
- * <p>This method restores all of the global variables associated with
- * the current input source.
- * @exception java.io.EOFException
- * If there are no more entries on the input stack.
- * @see #pushInput
- * @see #sourceType
- * @see #externalEntity
- * @see #readBuffer
- * @see #readBufferPos
- * @see #readBufferLength
- * @see #line
- * @see #encoding
- */
- private void popInput()
- throws SAXException, IOException
- {
- String ename = (String) entityStack.removeLast();
-
- if (ename != null && doReport)
- {
- dataBufferFlush();
- }
- switch (sourceType)
- {
- case INPUT_STREAM:
- handler.endExternalEntity(ename);
- is.close();
- break;
- case INPUT_READER:
- handler.endExternalEntity(ename);
- reader.close();
- break;
- case INPUT_INTERNAL:
- if (ename != null && doReport)
- {
- handler.endInternalEntity(ename);
- }
- break;
- }
-
- // Throw an EOFException if there
- // is nothing else to pop.
- if (inputStack.isEmpty())
- {
- throw new EOFException("no more input");
- }
-
- Input input = (Input) inputStack.removeLast();
-
- sourceType = input.sourceType;
- externalEntity = input.externalEntity;
- readBuffer = input.readBuffer;
- readBufferPos = input.readBufferPos;
- readBufferLength = input.readBufferLength;
- line = input.line;
- encoding = input.encoding;
- readBufferOverflow = input.readBufferOverflow;
- is = input.is;
- currentByteCount = input.currentByteCount;
- column = input.column;
- reader = input.reader;
- }
-
- /**
- * Return true if we can read the expected character.
- * <p>Note that the character will be removed from the input stream
- * on success, but will be put back on failure. Do not attempt to
- * read the character again if the method succeeds.
- * @param delim The character that should appear next. For a
- * insensitive match, you must supply this in upper-case.
- * @return true if the character was successfully read, or false if
- * it was not.
- * @see #tryRead (String)
- */
- private boolean tryRead(char delim)
- throws SAXException, IOException
- {
- char c;
-
- // Read the character
- c = readCh();
-
- // Test for a match, and push the character
- // back if the match fails.
- if (c == delim)
- {
- return true;
- }
- else
- {
- unread(c);
- return false;
- }
- }
-
- /**
- * Return true if we can read the expected string.
- * <p>This is simply a convenience method.
- * <p>Note that the string will be removed from the input stream
- * on success, but will be put back on failure. Do not attempt to
- * read the string again if the method succeeds.
- * <p>This method will push back a character rather than an
- * array whenever possible (probably the majority of cases).
- * @param delim The string that should appear next.
- * @return true if the string was successfully read, or false if
- * it was not.
- * @see #tryRead (char)
- */
- private boolean tryRead(String delim)
- throws SAXException, IOException
- {
- return tryRead(delim.toCharArray());
- }
-
- private boolean tryRead(char[] ch)
- throws SAXException, IOException
- {
- char c;
-
- // Compare the input, character-
- // by character.
-
- for (int i = 0; i < ch.length; i++)
- {
- c = readCh();
- if (c != ch[i])
- {
- unread(c);
- if (i != 0)
- {
- unread(ch, i);
- }
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return true if we can read some whitespace.
- * <p>This is simply a convenience method.
- * <p>This method will push back a character rather than an
- * array whenever possible (probably the majority of cases).
- * @return true if whitespace was found.
- */
- private boolean tryWhitespace()
- throws SAXException, IOException
- {
- char c;
- c = readCh();
- if (isWhitespace(c))
- {
- skipWhitespace();
- return true;
- }
- else
- {
- unread(c);
- return false;
- }
- }
-
- /**
- * Read all data until we find the specified string.
- * This is useful for scanning CDATA sections and PIs.
- * <p>This is inefficient right now, since it calls tryRead ()
- * for every character.
- * @param delim The string delimiter
- * @see #tryRead (String, boolean)
- * @see #readCh
- */
- private void parseUntil(String delim)
- throws SAXException, IOException
- {
- parseUntil(delim.toCharArray());
- }
-
- private void parseUntil(char[] delim)
- throws SAXException, IOException
- {
- char c;
- int startLine = line;
-
- try
- {
- while (!tryRead(delim))
- {
- c = readCh();
- dataBufferAppend(c);
- }
- }
- catch (EOFException e)
- {
- error("end of input while looking for delimiter "
- + "(started on line " + startLine
- + ')', null, new String(delim));
- }
- }
-
- //////////////////////////////////////////////////////////////////////
- // Low-level I/O.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * Prefetch US-ASCII XML/text decl from input stream into read buffer.
- * Doesn't buffer more than absolutely needed, so that when an encoding
- * decl says we need to create an InputStreamReader, we can discard our
- * buffer and reset(). Caller knows the first chars of the decl exist
- * in the input stream.
- */
- private void prefetchASCIIEncodingDecl()
- throws SAXException, IOException
- {
- int ch;
- readBufferPos = readBufferLength = 0;
-
- is.mark(readBuffer.length);
- while (true)
- {
- ch = is.read();
- readBuffer[readBufferLength++] = (char) ch;
- switch (ch)
- {
- case (int) '>':
- return;
- case -1:
- error("file ends before end of XML or encoding declaration.",
- null, "?>");
- }
- if (readBuffer.length == readBufferLength)
- {
- error("unfinished XML or encoding declaration");
- }
- }
- }
-
- /**
- * Read a chunk of data from an external input source.
- * <p>This is simply a front-end that fills the rawReadBuffer
- * with bytes, then calls the appropriate encoding handler.
- * @see #encoding
- * @see #rawReadBuffer
- * @see #readBuffer
- * @see #filterCR
- * @see #copyUtf8ReadBuffer
- * @see #copyIso8859_1ReadBuffer
- * @see #copyUcs_2ReadBuffer
- * @see #copyUcs_4ReadBuffer
- */
- private void readDataChunk()
- throws SAXException, IOException
- {
- int count;
-
- // See if we have any overflow (filterCR sets for CR at end)
- if (readBufferOverflow > -1)
- {
- readBuffer[0] = (char) readBufferOverflow;
- readBufferOverflow = -1;
- readBufferPos = 1;
- sawCR = true;
- }
- else
- {
- readBufferPos = 0;
- sawCR = false;
- }
-
- // input from a character stream.
- if (sourceType == INPUT_READER)
- {
- count = reader.read(readBuffer,
- readBufferPos, READ_BUFFER_MAX - readBufferPos);
- if (count < 0)
- {
- readBufferLength = readBufferPos;
- }
- else
- {
- readBufferLength = readBufferPos + count;
- }
- if (readBufferLength > 0)
- {
- filterCR(count >= 0);
- }
- sawCR = false;
- return;
- }
-
- // Read as many bytes as possible into the raw buffer.
- count = is.read(rawReadBuffer, 0, READ_BUFFER_MAX);
-
- // Dispatch to an encoding-specific reader method to populate
- // the readBuffer. In most parser speed profiles, these routines
- // show up at the top of the CPU usage chart.
- if (count > 0)
- {
- switch (encoding)
- {
- // one byte builtins
- case ENCODING_ASCII:
- copyIso8859_1ReadBuffer(count, (char) 0x0080);
- break;
- case ENCODING_UTF_8:
- copyUtf8ReadBuffer(count);
- break;
- case ENCODING_ISO_8859_1:
- copyIso8859_1ReadBuffer(count, (char) 0);
- break;
-
- // two byte builtins
- case ENCODING_UCS_2_12:
- copyUcs2ReadBuffer(count, 8, 0);
- break;
- case ENCODING_UCS_2_21:
- copyUcs2ReadBuffer(count, 0, 8);
- break;
-
- // four byte builtins
- case ENCODING_UCS_4_1234:
- copyUcs4ReadBuffer(count, 24, 16, 8, 0);
- break;
- case ENCODING_UCS_4_4321:
- copyUcs4ReadBuffer(count, 0, 8, 16, 24);
- break;
- case ENCODING_UCS_4_2143:
- copyUcs4ReadBuffer(count, 16, 24, 0, 8);
- break;
- case ENCODING_UCS_4_3412:
- copyUcs4ReadBuffer(count, 8, 0, 24, 16);
- break;
- }
- }
- else
- {
- readBufferLength = readBufferPos;
- }
-
- readBufferPos = 0;
-
- // Filter out all carriage returns if we've seen any
- // (including any saved from a previous read)
- if (sawCR)
- {
- filterCR(count >= 0);
- sawCR = false;
-
- // must actively report EOF, lest some CRs get lost.
- if (readBufferLength == 0 && count >= 0)
- {
- readDataChunk();
- }
- }
-
- if (count > 0)
- {
- currentByteCount += count;
- }
- }
-
- /**
- * Filter carriage returns in the read buffer.
- * CRLF becomes LF; CR becomes LF.
- * @param moreData true iff more data might come from the same source
- * @see #readDataChunk
- * @see #readBuffer
- * @see #readBufferOverflow
- */
- private void filterCR(boolean moreData)
- {
- int i, j;
-
- readBufferOverflow = -1;
-
-loop:
- for (i = j = readBufferPos; j < readBufferLength; i++, j++)
- {
- switch (readBuffer[j])
- {
- case '\r':
- if (j == readBufferLength - 1)
- {
- if (moreData)
- {
- readBufferOverflow = '\r';
- readBufferLength--;
- }
- else // CR at end of buffer
- {
- readBuffer[i++] = '\n';
- }
- break loop;
- }
- else if (readBuffer[j + 1] == '\n')
- {
- j++;
- }
- readBuffer[i] = '\n';
- break;
-
- case '\n':
- default:
- readBuffer[i] = readBuffer[j];
- break;
- }
- }
- readBufferLength = i;
- }
-
- /**
- * Convert a buffer of UTF-8-encoded bytes into UTF-16 characters.
- * <p>When readDataChunk () calls this method, the raw bytes are in
- * rawReadBuffer, and the final characters will appear in
- * readBuffer.
- * <p>Note that as of Unicode 3.1, good practice became a requirement,
- * so that each Unicode character has exactly one UTF-8 representation.
- * @param count The number of bytes to convert.
- * @see #readDataChunk
- * @see #rawReadBuffer
- * @see #readBuffer
- * @see #getNextUtf8Byte
- */
- private void copyUtf8ReadBuffer(int count)
- throws SAXException, IOException
- {
- int i = 0;
- int j = readBufferPos;
- int b1;
- char c = 0;
-
- /*
- // check once, so the runtime won't (if it's smart enough)
- if (count < 0 || count > rawReadBuffer.length)
- throw new ArrayIndexOutOfBoundsException (Integer.toString (count));
- */
-
- while (i < count)
- {
- b1 = rawReadBuffer[i++];
-
- // Determine whether we are dealing
- // with a one-, two-, three-, or four-
- // byte sequence.
- if (b1 < 0)
- {
- if ((b1 & 0xe0) == 0xc0)
- {
- // 2-byte sequence: 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx
- c = (char) (((b1 & 0x1f) << 6)
- | getNextUtf8Byte(i++, count));
- if (c < 0x0080)
- {
- encodingError("Illegal two byte UTF-8 sequence",
- c, 0);
- }
-
- //Sec 2.11
- // [1] the two-character sequence #xD #xA
- // [2] the two-character sequence #xD #x85
- if ((c == 0x0085 || c == 0x000a) && sawCR)
- {
- continue;
- }
-
- // Sec 2.11
- // [3] the single character #x85
-
- if (c == 0x0085 && xmlVersion == XML_11)
- {
- readBuffer[j++] = '\r';
- }
- }
- else if ((b1 & 0xf0) == 0xe0)
- {
- // 3-byte sequence:
- // zzzzyyyyyyxxxxxx = 1110zzzz 10yyyyyy 10xxxxxx
- // most CJKV characters
- c = (char) (((b1 & 0x0f) << 12) |
- (getNextUtf8Byte(i++, count) << 6) |
- getNextUtf8Byte(i++, count));
- //sec 2.11
- //[4] the single character #x2028
- if (c == 0x2028 && xmlVersion == XML_11)
- {
- readBuffer[j++] = '\r';
- sawCR = true;
- continue;
- }
- if (c < 0x0800 || (c >= 0xd800 && c <= 0xdfff))
- {
- encodingError("Illegal three byte UTF-8 sequence",
- c, 0);
- }
- }
- else if ((b1 & 0xf8) == 0xf0)
- {
- // 4-byte sequence: 11101110wwwwzzzzyy + 110111yyyyxxxxxx
- // = 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx
- // (uuuuu = wwww + 1)
- // "Surrogate Pairs" ... from the "Astral Planes"
- // Unicode 3.1 assigned the first characters there
- int iso646 = b1 & 07;
- iso646 = (iso646 << 6) + getNextUtf8Byte(i++, count);
- iso646 = (iso646 << 6) + getNextUtf8Byte(i++, count);
- iso646 = (iso646 << 6) + getNextUtf8Byte(i++, count);
-
- if (iso646 <= 0xffff)
- {
- encodingError("Illegal four byte UTF-8 sequence",
- iso646, 0);
- }
- else
- {
- if (iso646 > 0x0010ffff)
- {
- encodingError("UTF-8 value out of range for Unicode",
- iso646, 0);
- }
- iso646 -= 0x010000;
- readBuffer[j++] = (char) (0xd800 | (iso646 >> 10));
- readBuffer[j++] = (char) (0xdc00 | (iso646 & 0x03ff));
- continue;
- }
- }
- else
- {
- // The five and six byte encodings aren't supported;
- // they exceed the Unicode (and XML) range.
- encodingError("unsupported five or six byte UTF-8 sequence",
- 0xff & b1, i);
- // NOTREACHED
- c = 0;
- }
- }
- else
- {
- // 1-byte sequence: 000000000xxxxxxx = 0xxxxxxx
- // (US-ASCII character, "common" case, one branch to here)
- c = (char) b1;
- }
- readBuffer[j++] = c;
- if (c == '\r')
- {
- sawCR = true;
- }
- }
- // How many characters have we read?
- readBufferLength = j;
- }
-
- /**
- * Return the next byte value in a UTF-8 sequence.
- * If it is not possible to get a byte from the current
- * entity, throw an exception.
- * @param pos The current position in the rawReadBuffer.
- * @param count The number of bytes in the rawReadBuffer
- * @return The significant six bits of a non-initial byte in
- * a UTF-8 sequence.
- * @exception EOFException If the sequence is incomplete.
- */
- private int getNextUtf8Byte(int pos, int count)
- throws SAXException, IOException
- {
- int val;
-
- // Take a character from the buffer
- // or from the actual input stream.
- if (pos < count)
- {
- val = rawReadBuffer[pos];
- }
- else
- {
- val = is.read();
- if (val == -1)
- {
- encodingError("unfinished multi-byte UTF-8 sequence at EOF",
- -1, pos);
- }
- }
-
- // Check for the correct bits at the start.
- if ((val & 0xc0) != 0x80)
- {
- encodingError("bad continuation of multi-byte UTF-8 sequence",
- val, pos + 1);
- }
-
- // Return the significant bits.
- return (val & 0x3f);
- }
-
- /**
- * Convert a buffer of US-ASCII or ISO-8859-1-encoded bytes into
- * UTF-16 characters.
- *
- * <p>When readDataChunk () calls this method, the raw bytes are in
- * rawReadBuffer, and the final characters will appear in
- * readBuffer.
- *
- * @param count The number of bytes to convert.
- * @param mask For ASCII conversion, 0x7f; else, 0xff.
- * @see #readDataChunk
- * @see #rawReadBuffer
- * @see #readBuffer
- */
- private void copyIso8859_1ReadBuffer(int count, char mask)
- throws IOException
- {
- int i, j;
- for (i = 0, j = readBufferPos; i < count; i++, j++)
- {
- char c = (char) (rawReadBuffer[i] & 0xff);
- if ((c & mask) != 0)
- {
- throw new CharConversionException("non-ASCII character U+"
- + Integer.toHexString(c));
- }
- if (c == 0x0085 && xmlVersion == XML_11)
- {
- c = '\r';
- }
- readBuffer[j] = c;
- if (c == '\r')
- {
- sawCR = true;
- }
- }
- readBufferLength = j;
- }
-
- /**
- * Convert a buffer of UCS-2-encoded bytes into UTF-16 characters
- * (as used in Java string manipulation).
- *
- * <p>When readDataChunk () calls this method, the raw bytes are in
- * rawReadBuffer, and the final characters will appear in
- * readBuffer.
- * @param count The number of bytes to convert.
- * @param shift1 The number of bits to shift byte 1.
- * @param shift2 The number of bits to shift byte 2
- * @see #readDataChunk
- * @see #rawReadBuffer
- * @see #readBuffer
- */
- private void copyUcs2ReadBuffer(int count, int shift1, int shift2)
- throws SAXException
- {
- int j = readBufferPos;
-
- if (count > 0 && (count % 2) != 0)
- {
- encodingError("odd number of bytes in UCS-2 encoding", -1, count);
- }
- // The loops are faster with less internal brancing; hence two
- if (shift1 == 0)
- { // "UTF-16-LE"
- for (int i = 0; i < count; i += 2)
- {
- char c = (char) (rawReadBuffer[i + 1] << 8);
- c |= 0xff & rawReadBuffer[i];
- readBuffer[j++] = c;
- if (c == '\r')
- {
- sawCR = true;
- }
- }
- }
- else
- { // "UTF-16-BE"
- for (int i = 0; i < count; i += 2)
- {
- char c = (char) (rawReadBuffer[i] << 8);
- c |= 0xff & rawReadBuffer[i + 1];
- readBuffer[j++] = c;
- if (c == '\r')
- {
- sawCR = true;
- }
- }
- }
- readBufferLength = j;
- }
-
- /**
- * Convert a buffer of UCS-4-encoded bytes into UTF-16 characters.
- *
- * <p>When readDataChunk () calls this method, the raw bytes are in
- * rawReadBuffer, and the final characters will appear in
- * readBuffer.
- * <p>Java has Unicode chars, and this routine uses surrogate pairs
- * for ISO-10646 values between 0x00010000 and 0x000fffff. An
- * exception is thrown if the ISO-10646 character has no Unicode
- * representation.
- *
- * @param count The number of bytes to convert.
- * @param shift1 The number of bits to shift byte 1.
- * @param shift2 The number of bits to shift byte 2
- * @param shift3 The number of bits to shift byte 2
- * @param shift4 The number of bits to shift byte 2
- * @see #readDataChunk
- * @see #rawReadBuffer
- * @see #readBuffer
- */
- private void copyUcs4ReadBuffer(int count, int shift1, int shift2,
- int shift3, int shift4)
- throws SAXException
- {
- int j = readBufferPos;
-
- if (count > 0 && (count % 4) != 0)
- {
- encodingError("number of bytes in UCS-4 encoding " +
- "not divisible by 4",
- -1, count);
- }
- for (int i = 0; i < count; i += 4)
- {
- int value = (((rawReadBuffer [i] & 0xff) << shift1) |
- ((rawReadBuffer [i + 1] & 0xff) << shift2) |
- ((rawReadBuffer [i + 2] & 0xff) << shift3) |
- ((rawReadBuffer [i + 3] & 0xff) << shift4));
- if (value < 0x0000ffff)
- {
- readBuffer [j++] = (char) value;
- if (value == (int) '\r')
- {
- sawCR = true;
- }
- }
- else if (value < 0x0010ffff)
- {
- value -= 0x010000;
- readBuffer[j++] = (char) (0xd8 | ((value >> 10) & 0x03ff));
- readBuffer[j++] = (char) (0xdc | (value & 0x03ff));
- }
- else
- {
- encodingError("UCS-4 value out of range for Unicode",
- value, i);
- }
- }
- readBufferLength = j;
- }
-
- /**
- * Report a character encoding error.
- */
- private void encodingError(String message, int value, int offset)
- throws SAXException
- {
- if (value != -1)
- {
- message = message + " (character code: 0x" +
- Integer.toHexString(value) + ')';
- error(message);
- }
- }
-
- //////////////////////////////////////////////////////////////////////
- // Local Variables.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * Re-initialize the variables for each parse.
- */
- private void initializeVariables()
- {
- // First line
- line = 1;
- column = 0;
-
- // Set up the buffers for data and names
- dataBufferPos = 0;
- dataBuffer = new char[DATA_BUFFER_INITIAL];
- nameBufferPos = 0;
- nameBuffer = new char[NAME_BUFFER_INITIAL];
-
- // Set up the DTD hash tables
- elementInfo = new HashMap();
- entityInfo = new HashMap();
- notationInfo = new HashMap();
- skippedPE = false;
-
- // Set up the variables for the current
- // element context.
- currentElement = null;
- currentElementContent = CONTENT_UNDECLARED;
-
- // Set up the input variables
- sourceType = INPUT_NONE;
- inputStack = new LinkedList();
- entityStack = new LinkedList();
- externalEntity = null;
- tagAttributePos = 0;
- tagAttributes = new String[100];
- rawReadBuffer = new byte[READ_BUFFER_MAX];
- readBufferOverflow = -1;
-
- scratch = new InputSource();
-
- inLiteral = false;
- expandPE = false;
- peIsError = false;
-
- doReport = false;
-
- inCDATA = false;
-
- symbolTable = new Object[SYMBOL_TABLE_LENGTH][];
- }
-
- static class ExternalIdentifiers
- {
-
- String publicId;
- String systemId;
- String baseUri;
-
- ExternalIdentifiers()
- {
- }
-
- ExternalIdentifiers(String publicId, String systemId, String baseUri)
- {
- this.publicId = publicId;
- this.systemId = systemId;
- this.baseUri = baseUri;
- }
-
- }
-
- static class EntityInfo
- {
-
- int type;
- ExternalIdentifiers ids;
- String value;
- String notationName;
-
- }
-
- static class AttributeDecl
- {
-
- String type;
- String value;
- int valueType;
- String enumeration;
- String defaultValue;
-
- }
-
- static class ElementDecl
- {
-
- int contentType;
- String contentModel;
- HashMap attributes;
-
- }
-
- static class Input
- {
-
- int sourceType;
- URLConnection externalEntity;
- char[] readBuffer;
- int readBufferPos;
- int readBufferLength;
- int line;
- int encoding;
- int readBufferOverflow;
- InputStream is;
- int currentByteCount;
- int column;
- Reader reader;
-
- }
-
-}
-
diff --git a/libjava/gnu/xml/aelfred2/XmlReader.java b/libjava/gnu/xml/aelfred2/XmlReader.java
deleted file mode 100644
index a3bd03a8644..00000000000
--- a/libjava/gnu/xml/aelfred2/XmlReader.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/* XmlReader.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.aelfred2;
-
-import java.io.IOException;
-import java.util.Locale;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-
-import gnu.xml.pipeline.EventFilter;
-import gnu.xml.pipeline.ValidationConsumer;
-
-
-/**
- * This SAX2 parser optionally layers a validator over the &AElig;lfred2
- * SAX2 parser. While this will not evaluate every XML validity constraint,
- * it does support all the validity constraints that are of any real utility
- * outside the strict SGML-compatible world. See the documentation for the
- * SAXDriver class for information about the SAX2 features and properties
- * that are supported, and documentation for the ValidationConsumer for
- * information about what validity constraints may not be supported.
- * (&AElig;lfred2 tests some of those, even in non-validating mode, to
- * achieve better conformance.)
- *
- * <p> Note that due to its internal construction, you can't change most
- * handlers until parse() returns. This diverges slightly from SAX, which
- * expects later binding to be supported. Early binding involves less
- * runtime overhead, which is an issue for event pipelines as used inside
- * this parser. Rather than relying on the parser to handle late binding
- * to your own handlers, do it yourself.
- *
- * @see SAXDriver
- * @see gnu.xml.pipeline.ValidationConsumer
- *
- * @author David Brownell
- */
-public final class XmlReader
- implements XMLReader
-{
-
- static class FatalErrorHandler
- extends DefaultHandler2
- {
-
- public void error(SAXParseException e)
- throws SAXException
- {
- throw e;
- }
-
- }
-
- private SAXDriver aelfred2 = new SAXDriver();
- private EventFilter filter = new EventFilter();
- private boolean isValidating;
- private boolean active;
-
- /**
- * Constructs a SAX Parser.
- */
- public XmlReader()
- {
- }
-
- /**
- * Constructs a SAX Parser, optionally treating validity errors
- * as if they were fatal errors.
- */
- public XmlReader(boolean invalidIsFatal)
- {
- if (invalidIsFatal)
- {
- setErrorHandler(new FatalErrorHandler());
- }
- }
-
- /**
- * <b>SAX2</b>: Returns the object used to report the logical
- * content of an XML document.
- */
- public ContentHandler getContentHandler()
- {
- return filter.getContentHandler();
- }
-
- /**
- * <b>SAX2</b>: Assigns the object used to report the logical
- * content of an XML document.
- * @exception IllegalStateException if called mid-parse
- */
- public void setContentHandler(ContentHandler handler)
- {
- if (active)
- {
- throw new IllegalStateException("already parsing");
- }
- filter.setContentHandler(handler);
- }
-
- /**
- * <b>SAX2</b>: Returns the object used to process declarations related
- * to notations and unparsed entities.
- */
- public DTDHandler getDTDHandler()
- {
- return filter.getDTDHandler();
- }
-
- /**
- * <b>SAX1</b> Assigns DTD handler
- * @exception IllegalStateException if called mid-parse
- */
- public void setDTDHandler(DTDHandler handler)
- {
- if (active)
- {
- throw new IllegalStateException("already parsing");
- }
- filter.setDTDHandler(handler);
- }
-
- /**
- * <b>SAX2</b>: Returns the object used when resolving external
- * entities during parsing (both general and parameter entities).
- */
- public EntityResolver getEntityResolver()
- {
- return aelfred2.getEntityResolver();
- }
-
- /**
- * <b>SAX1</b> Assigns parser's entity resolver
- */
- public void setEntityResolver(EntityResolver handler)
- {
- aelfred2.setEntityResolver(handler);
- }
-
- /**
- * <b>SAX2</b>: Returns the object used to receive callbacks for XML
- * errors of all levels (fatal, nonfatal, warning); this is never null;
- */
- public ErrorHandler getErrorHandler()
- {
- return aelfred2.getErrorHandler();
- }
-
- /**
- * <b>SAX1</b> Assigns error handler
- * @exception IllegalStateException if called mid-parse
- */
- public void setErrorHandler(ErrorHandler handler)
- {
- if (active)
- {
- throw new IllegalStateException("already parsing");
- }
- aelfred2.setErrorHandler(handler);
- }
-
- /**
- * <b>SAX2</b>: Assigns the specified property.
- * @exception IllegalStateException if called mid-parse
- */
- public void setProperty(String propertyId, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (active)
- {
- throw new IllegalStateException("already parsing");
- }
- if (getProperty(propertyId) != value)
- {
- filter.setProperty(propertyId, value);
- }
- }
-
- /**
- * <b>SAX2</b>: Returns the specified property.
- */
- public Object getProperty(String propertyId)
- throws SAXNotRecognizedException
- {
- if ((SAXDriver.PROPERTY + "declaration-handler").equals(propertyId)
- || (SAXDriver.PROPERTY + "lexical-handler").equals(propertyId))
- {
- return filter.getProperty(propertyId);
- }
- throw new SAXNotRecognizedException(propertyId);
- }
-
- private void forceValidating()
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- aelfred2.setFeature(SAXDriver.FEATURE + "namespace-prefixes",
- true);
- aelfred2.setFeature(SAXDriver.FEATURE + "external-general-entities",
- true);
- aelfred2.setFeature(SAXDriver.FEATURE + "external-parameter-entities",
- true);
- }
-
- /**
- * <b>SAX2</b>: Sets the state of features supported in this parser.
- * Note that this parser requires reporting of namespace prefixes when
- * validating.
- */
- public void setFeature(String featureId, boolean state)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- boolean value = getFeature(featureId);
-
- if (state == value)
- {
- return;
- }
-
- if ((SAXDriver.FEATURE + "validation").equals(featureId))
- {
- if (active)
- {
- throw new SAXNotSupportedException("already parsing");
- }
- if (state)
- {
- forceValidating();
- }
- isValidating = state;
- }
- else
- {
- aelfred2.setFeature(featureId, state);
- }
- }
-
- /**
- * <b>SAX2</b>: Tells whether this parser supports the specified feature.
- * At this time, this directly parallels the underlying SAXDriver,
- * except that validation is optionally supported.
- *
- * @see SAXDriver
- */
- public boolean getFeature(String featureId)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if ((SAXDriver.FEATURE + "validation").equals(featureId))
- {
- return isValidating;
- }
-
- return aelfred2.getFeature(featureId);
- }
-
- /**
- * <b>SAX1</b>: Sets the locale used for diagnostics; currently,
- * only locales using the English language are supported.
- * @param locale The locale for which diagnostics will be generated
- */
- public void setLocale(Locale locale)
- throws SAXException
- {
- aelfred2.setLocale(locale);
- }
-
- /**
- * <b>SAX1</b>: Preferred API to parse an XML document, using a
- * system identifier (URI).
- */
- public void parse(String systemId)
- throws SAXException, IOException
- {
- parse(new InputSource(systemId));
- }
-
- /**
- * <b>SAX1</b>: Underlying API to parse an XML document, used
- * directly when no URI is available. When this is invoked,
- * and the parser is set to validate, some features will be
- * automatically reset to appropriate values: for reporting
- * namespace prefixes, and incorporating external entities.
- *
- * @param source The XML input source.
- *
- * @exception IllegalStateException if called mid-parse
- * @exception SAXException The handlers may throw any SAXException,
- * and the parser normally throws SAXParseException objects.
- * @exception IOException IOExceptions are normally through through
- * the parser if there are problems reading the source document.
- */
- public void parse(InputSource source)
- throws SAXException, IOException
- {
- EventFilter next;
- boolean nsdecls;
-
- synchronized (aelfred2)
- {
- if (active)
- {
- throw new IllegalStateException("already parsing");
- }
- active = true;
- }
-
- // set up the output pipeline
- if (isValidating)
- {
- forceValidating();
- next = new ValidationConsumer(filter);
- }
- else
- {
- next = filter;
- }
-
- // connect pipeline and error handler
- // don't let _this_ call to bind() affect xmlns* attributes
- nsdecls = aelfred2.getFeature(SAXDriver.FEATURE + "namespace-prefixes");
- EventFilter.bind(aelfred2, next);
- if (!nsdecls)
- {
- aelfred2.setFeature(SAXDriver.FEATURE + "namespace-prefixes",
- false);
- }
-
- // parse, clean up
- try
- {
- aelfred2.parse(source);
- }
- finally
- {
- active = false;
- }
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/Consumer.java b/libjava/gnu/xml/dom/Consumer.java
deleted file mode 100644
index f99e221e998..00000000000
--- a/libjava/gnu/xml/dom/Consumer.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/* Consumer.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.DocumentType;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.Attributes2;
-
-import gnu.xml.pipeline.DomConsumer;
-import gnu.xml.pipeline.EventConsumer;
-
-
-/**
- * Event consumer which constructs DOM documents using the implementation
- * in this package, using SAX2 events. This packages various backdoors
- * into this DOM implementation, as needed to address DOM requirements
- * that can't be met by strictly conforming implementations of DOM.
- *
- * <p> These requirements all relate to {@link DocumentType} nodes and
- * features of that node type. These features are normally not used,
- * because that interface only exposes a subset of the information found
- * in DTDs. More, that subset does not include the most important typing
- * information. For example, it excludes element content models and
- * attribute typing. It does expose some entity management issues,
- * although entity management doesn't relate to document typing.
- *
- * <p> Note that SAX2 does not expose the literal text of the DTD's
- * internal subset, so it will not be present in DOM trees constructed
- * using this API. (Though with a good SAX2 implementation, it could
- * be partially recreated...)
- *
- * @author David Brownell
- */
-public class Consumer extends DomConsumer
-{
- /**
- * Constructs an unconfigured event consumer,
- * as a terminus in a SAX event pipeline.
- */
- // used by PipelineFactory [terminus]
- public Consumer ()
- throws SAXException
- {
- super (DomDocument.class);
- setHandler (new Backdoor (this));
- }
-
- /**
- * Constructs an unconfigured event consumer,
- * as a stage in a SAX event pipeline.
- */
- // used by PipelineFactory [filter]
- public Consumer (EventConsumer next)
- throws SAXException
- {
- super (DomDocument.class, next);
- setHandler (new Backdoor (this));
- }
-
- /**
- * Implements the backdoors needed by DOM.
- * All methods in this class use implementation-specific APIs that are
- * implied by the DOM specification (needed to implement testable
- * behavior) but which are excluded from the DOM specification.
- */
- public static class Backdoor extends DomConsumer.Handler
- {
- /**
- * Constructor.
- * @param consumer must have been initialized to use the
- * {@link DomDocument} class (or a subclass) for
- * constructing DOM trees
- */
- protected Backdoor (DomConsumer consumer)
- throws SAXException
- { super (consumer); }
-
- // helper routine
- private DomDoctype getDoctype ()
- throws SAXException
- {
- DomDocument doc = (DomDocument) getDocument ();
- DocumentType dt = doc.getDoctype ();
-
- if (dt == null)
- throw new SAXException ("doctype missing!");
- return (DomDoctype) dt;
- }
-
- // SAX2 "lexical" event
- public void startDTD (String name, String publicId, String systemId)
- throws SAXException
- {
- DomDocument doc = (DomDocument) getDocument ();
-
- super.startDTD (name, publicId, systemId);
- // DOM L2 doctype creation model is bizarre
- DomDoctype dt = new DomDoctype (doc, name, publicId, systemId);
- doc.appendChild (dt);
- }
-
- // SAX2 "lexical" event
- public void endDTD ()
- throws SAXException
- {
- super.endDTD ();
- // DOM L2 has no way to make things readonly
- getDoctype ().makeReadonly ();
- }
-
- // SAX1 DTD event
- public void notationDecl (
- String name,
- String publicId, String systemId
- ) throws SAXException
- {
- // DOM L2 can't create/save notation nodes
- getDoctype ().declareNotation (name, publicId, systemId);
- }
-
- // SAX1 DTD event
- public void unparsedEntityDecl (
- String name,
- String publicId, String systemId,
- String notationName
- ) throws SAXException
- {
- // DOM L2 can't create/save entity nodes
- getDoctype ().declareEntity (name, publicId, systemId,
- notationName);
- }
-
- // SAX2 declaration event
- public void internalEntityDecl (String name, String value)
- throws SAXException
- {
- // DOM L2 can't create/save entity nodes
- // NOTE: this doesn't save the value as a child of this
- // node, though it could realistically do so.
- getDoctype ().declareEntity (name, null, null, null);
- }
-
- // SAX2 declaration event
- public void externalEntityDecl (
- String name,
- String publicId,
- String systemId
- ) throws SAXException
- {
- // DOM L2 can't create/save entity nodes
- // NOTE: DOM allows for these to have children, if
- // they don't have unbound namespace references.
- getDoctype ().declareEntity (name, publicId, systemId, null);
- }
-
- // SAX2 element
- public void startElement (
- String uri,
- String localName,
- String qName,
- Attributes atts
- ) throws SAXException
- {
- Node top;
-
- super.startElement (uri, localName, qName, atts);
-
- // might there be more work?
- top = getTop ();
- if (!top.hasAttributes () || !(atts instanceof Attributes2))
- return;
-
- // remember any attributes that got defaulted
- DomNamedNodeMap map = (DomNamedNodeMap) top.getAttributes ();
- Attributes2 attrs = (Attributes2) atts;
- int length = atts.getLength ();
-
- //map.compact ();
- for (int i = 0; i < length; i++) {
- if (attrs.isSpecified (i))
- continue;
-
- // value was defaulted.
- String temp = attrs.getQName (i);
- DomAttr attr;
-
- if ("".equals (temp))
- attr = (DomAttr) map.getNamedItemNS (attrs.getURI (i),
- atts.getLocalName (i));
- else
- attr = (DomAttr) map.getNamedItem (temp);
-
- // DOM L2 can't write this flag, only read it
- attr.setSpecified (false);
- }
- }
-
- public void endElement (
- String uri,
- String localName,
- String qName
- ) throws SAXException
- {
- DomNode top = (DomNode) getTop ();
- top.compact ();
- super.endElement (uri, localName, qName);
- }
-
- protected Text createText (
- boolean isCDATA,
- char buf [],
- int off,
- int len
- ) {
- DomDocument doc = (DomDocument) getDocument ();
-
- if (isCDATA)
- return doc.createCDATASection (buf, off, len);
- else
- return doc.createTextNode (buf, off, len);
- }
-
- public void elementDecl(String name, String model)
- throws SAXException
- {
- getDoctype().elementDecl(name, model);
- }
-
- public void attributeDecl (
- String ename,
- String aname,
- String type,
- String mode,
- String value
- ) throws SAXException
- {
- getDoctype().attributeDecl(ename, aname, type, mode, value);
- /*
- if (value == null && !"ID".equals (type))
- return;
-
- DomDoctype.ElementInfo info;
-
- info = getDoctype ().getElementInfo (ename);
- if (value != null)
- info.setAttrDefault (aname, value);
- if ("ID".equals (type))
- info.setIdAttr (aname);
- */
-
- }
-
- // force duplicate name checking off while we're
- // using parser output (don't duplicate the work)
- public void startDocument () throws SAXException
- {
- super.startDocument ();
-
- DomDocument doc = (DomDocument) getDocument ();
- doc.setStrictErrorChecking(false);
- doc.setBuilding(true);
- }
-
- /**
- * Required by DOM Level 3 to report document parameters
- */
- public void xmlDecl(String version,
- String encoding,
- boolean standalone,
- String inputEncoding)
- throws SAXException
- {
- super.xmlDecl(version, encoding, standalone, inputEncoding);
-
- DomDocument doc = (DomDocument) getDocument();
- doc.setXmlEncoding(encoding);
- doc.setInputEncoding(inputEncoding);
- }
-
- public void endDocument ()
- throws SAXException
- {
- DomDocument doc = (DomDocument) getDocument ();
- doc.setStrictErrorChecking(true);
- doc.setBuilding(false);
- doc.compact ();
- DomDoctype doctype = (DomDoctype) doc.getDoctype();
- if (doctype != null)
- {
- doctype.makeReadonly();
- }
- super.endDocument ();
- }
-
- // these three methods collaborate to populate entity
- // refs, marking contents readonly on end-of-entity
-
- public boolean canPopulateEntityRefs ()
- { return true; }
-
- public void startEntity (String name)
- throws SAXException
- {
- if (name.charAt (0) == '%' || "[dtd]".equals (name))
- return;
- super.startEntity (name);
-
- DomNode top = (DomNode) getTop ();
-
- if (top.getNodeType () == Node.ENTITY_REFERENCE_NODE)
- top.readonly = false;
- }
-
- public void endEntity (String name)
- throws SAXException
- {
- if (name.charAt (0) == '%' || "[dtd]".equals (name))
- return;
- DomNode top = (DomNode) getTop ();
-
- if (top.getNodeType () == Node.ENTITY_REFERENCE_NODE) {
- top.compact ();
- top.makeReadonly ();
- }
- super.endEntity (name);
- }
- }
-}
diff --git a/libjava/gnu/xml/dom/DTDAttributeTypeInfo.java b/libjava/gnu/xml/dom/DTDAttributeTypeInfo.java
deleted file mode 100644
index e3c69c43ecb..00000000000
--- a/libjava/gnu/xml/dom/DTDAttributeTypeInfo.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* DTDAttributeTypeInfo.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.TypeInfo;
-
-/**
- * Attribute type information supplied by a DTD attribute declaration.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class DTDAttributeTypeInfo
- implements TypeInfo
-{
-
- final String elementName;
- final String name;
- final String type;
- final String mode;
- final String value;
-
- DTDAttributeTypeInfo(String elementName, String name, String type,
- String mode, String value)
- {
- this.elementName = elementName;
- this.name = name;
- this.type = type;
- this.mode = mode;
- this.value = value;
- }
-
- public final String getTypeName()
- {
- return type;
- }
-
- public final String getTypeNamespace()
- {
- return "http://www.w3.org/TR/REC-xml";
- }
-
- public final boolean isDerivedFrom(String typeNamespace, String typeName,
- int derivationMethod)
- {
- return false;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DTDElementTypeInfo.java b/libjava/gnu/xml/dom/DTDElementTypeInfo.java
deleted file mode 100644
index c5553e20e62..00000000000
--- a/libjava/gnu/xml/dom/DTDElementTypeInfo.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* DTDElementTypeInfo.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.HashMap;
-import java.util.Iterator;
-import org.w3c.dom.TypeInfo;
-
-/**
- * Element type information provided by a DTD element declaration.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class DTDElementTypeInfo
- implements TypeInfo
-{
-
- final String name;
- String model;
- HashMap attributes;
- String idAttrName;
-
- DTDElementTypeInfo(String name, String model)
- {
- this.name = name;
- this.model = model;
- }
-
- public final String getTypeName()
- {
- return null;
- }
-
- public final String getTypeNamespace()
- {
- return "http://www.w3.org/TR/REC-xml";
- }
-
- public final boolean isDerivedFrom(String typeNamespace, String typeName,
- int derivationMethod)
- {
- return false;
- }
-
- DTDAttributeTypeInfo getAttributeTypeInfo(String name)
- {
- if (attributes == null)
- {
- return null;
- }
- return (DTDAttributeTypeInfo) attributes.get(name);
- }
-
- void setAttributeTypeInfo(String name, DTDAttributeTypeInfo info)
- {
- if (attributes == null)
- {
- attributes = new HashMap();
- }
- attributes.put(name, info);
- if ("ID".equals(info.type))
- {
- idAttrName = name;
- }
- }
-
- Iterator attributes()
- {
- if (attributes == null)
- {
- return null;
- }
- return attributes.values().iterator();
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomAttr.java b/libjava/gnu/xml/dom/DomAttr.java
deleted file mode 100644
index 8673a796161..00000000000
--- a/libjava/gnu/xml/dom/DomAttr.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/* DomAttr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.events.MutationEvent;
-
-
-/**
- * <p> "Attr" implementation. In DOM, attributes cost quite a lot of
- * memory because their values are complex structures rather than just
- * simple strings. To reduce your costs, avoid having more than one
- * child of an attribute; stick to a single Text node child, and ignore
- * even that by using the attribute's "nodeValue" property.</p>
- *
- * <p> As a bit of general advice, only look at attribute modification
- * events through the DOMAttrModified event (sent to the associated
- * element). Implementations are not guaranteed to report other events
- * in the same order, so you're very likely to write nonportable code if
- * you monitor events at the "children of Attr" level.</p>
- *
- * <p> At this writing, not all attribute modifications will cause the
- * DOMAttrModified event to be triggered ... only the ones using the string
- * methods (setNodeValue, setValue, and Element.setAttribute) to modify
- * those values. That is, if you manipulate those children directly,
- * elements won't get notified that attribute values have changed.
- * The natural fix for that will report other modifications, but won't
- * be able to expose "previous" attribute value; it'll need to be cached
- * or something (at which point why bother using child nodes). </p>
- *
- * <p><em>You are strongly advised not to use "children" of any attribute
- * nodes you work with.</em> </p>
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomAttr
- extends DomNsNode
- implements Attr
-{
-
- private boolean specified;
- private String value; // string value cache
-
- /**
- * Constructs an Attr node associated with the specified document.
- * The "specified" flag is initialized to true, since this DOM has
- * no current "back door" mechanisms to manage default values so
- * that every value must effectively be "specified".
- *
- * <p>This constructor should only be invoked by a Document as part of
- * its createAttribute functionality, or through a subclass which is
- * similarly used in a "Sub-DOM" style layer.
- *
- * @param owner The document with which this node is associated
- * @param namespaceURI Combined with the local part of the name,
- * this is used to uniquely identify a type of attribute
- * @param name Name of this attribute, which may include a prefix
- */
- protected DomAttr(DomDocument owner, String namespaceURI, String name)
- {
- super(ATTRIBUTE_NODE, owner, namespaceURI, name);
- specified = true;
- length = 1;
-
- // XXX register self to get insertion/removal events
- // and character data change events and when they happen,
- // report self-mutation
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the attribute name (same as getNodeName)
- */
- public final String getName()
- {
- return getNodeName();
- }
-
- /**
- * <b>DOM L1</b>
- * Returns true if a parser reported this was in the source text.
- */
- public final boolean getSpecified()
- {
- return specified;
- }
-
- /**
- * Records whether this attribute was in the source text.
- */
- public final void setSpecified(boolean value)
- {
- specified = value;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the attribute value, with character and entity
- * references substituted.
- * <em>NOTE: entity refs as children aren't currently handled.</em>
- */
- public String getNodeValue()
- {
- // If we have a simple node-value, use that
- if (first == null)
- {
- return (value == null) ? "" : value;
- }
- // Otherwise collect child node-values
- StringBuffer buf = new StringBuffer();
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- switch (ctx.nodeType)
- {
- case Node.TEXT_NODE:
- buf.append(ctx.getNodeValue());
- break;
- case Node.ENTITY_REFERENCE_NODE:
- // TODO
- break;
- }
- }
- return buf.toString();
- }
-
- /**
- * <b>DOM L1</b>
- * Assigns the value of the attribute; it will have one child,
- * which is a text node with the specified value (same as
- * setNodeValue).
- */
- public final void setValue(String value)
- {
- setNodeValue(value);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the value of the attribute as a non-null string; same
- * as getNodeValue.
- * <em>NOTE: entity refs as children aren't currently handled.</em>
- */
- public final String getValue()
- {
- return getNodeValue();
- }
-
- /**
- * <b>DOM L1</b>
- * Assigns the attribute value; using this API, no entity or
- * character references will exist.
- * Causes a DOMAttrModified mutation event to be sent.
- */
- public void setNodeValue(String value)
- {
- if (readonly)
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- if (value == null)
- {
- value = "";
- }
- String oldValue = getNodeValue();
- while (last != null)
- {
- removeChild(last);
- }
- // don't create a new node just for this...
- /*
- Node text = owner.createTextNode(value);
- appendChild(text);
- */
- this.value = value;
- length = 1;
- specified = true;
-
- mutating(oldValue, value, MutationEvent.MODIFICATION);
- }
-
- public final Node getFirstChild()
- {
- // Create a child text node if necessary
- if (first == null)
- {
- length = 0;
- Node text = owner.createTextNode((value == null) ? "" : value);
- appendChild(text);
- }
- return first;
- }
-
- public final Node getLastChild()
- {
- // Create a child text node if necessary
- if (last == null)
- {
- length = 0;
- Node text = owner.createTextNode((value == null) ? "" : value);
- appendChild(text);
- }
- return last;
- }
-
- public Node item(int index)
- {
- // Create a child text node if necessary
- if (first == null)
- {
- length = 0;
- Node text = owner.createTextNode((value == null) ? "" : value);
- appendChild(text);
- }
- return super.item(index);
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the element with which this attribute is associated.
- */
- public final Element getOwnerElement()
- {
- return (Element) parent;
- }
-
- public final Node getNextSibling()
- {
- return null;
- }
-
- public final Node getPreviousSibling()
- {
- return null;
- }
-
- public Node getParentNode()
- {
- return null;
- }
-
- /**
- * Records the element with which this attribute is associated.
- */
- public final void setOwnerElement(Element e)
- {
- if (parent != null)
- {
- throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR);
- }
- if (!(e instanceof DomElement))
- {
- throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR);
- }
- parent = (DomElement) e;
- depth = parent.depth + 1;
- }
-
- /**
- * The base URI of an Attr is always <code>null</code>.
- */
- public final String getBaseURI()
- {
- return null;
- }
-
- /**
- * Shallow clone of the attribute, breaking all ties with any
- * elements.
- */
- public Object clone()
- {
- DomAttr retval = (DomAttr) super.clone();
- retval.specified = true;
- return retval;
- }
-
- private void mutating(String oldValue, String newValue, short why)
- {
- if (!reportMutations || parent == null)
- {
- return;
- }
-
- // EVENT: DOMAttrModified, target = parent,
- // prev/new values provided, also attr name
- MutationEvent event;
-
- event = (MutationEvent) createEvent ("MutationEvents");
- event.initMutationEvent ("DOMAttrModified",
- true /* bubbles */, false /* nocancel */,
- null, oldValue, newValue, getNodeName (), why);
- parent.dispatchEvent (event);
- }
-
- // DOM Level 3 methods
-
- public TypeInfo getSchemaTypeInfo()
- {
- if (parent != null)
- {
- // DTD implementation
- DomDoctype doctype = (DomDoctype) parent.owner.getDoctype();
- if (doctype != null)
- {
- return doctype.getAttributeTypeInfo(parent.getNodeName(),
- getNodeName());
- }
- // TODO XML Schema implementation
- }
- return null;
- }
-
- public boolean isId()
- {
- if (parent != null)
- {
- DomDoctype doctype = (DomDoctype) parent.owner.getDoctype();
- if (doctype != null)
- {
- DTDAttributeTypeInfo info =
- doctype.getAttributeTypeInfo(parent.getNodeName(),
- getNodeName());
- if (info != null && "ID".equals(info.type))
- {
- return true;
- }
- }
- DomElement element = (DomElement) parent;
- if (element.userIdAttrs != null &&
- element.userIdAttrs.contains(this))
- {
- return true;
- }
- // TODO XML Schema implementation
- }
- return false;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomCDATASection.java b/libjava/gnu/xml/dom/DomCDATASection.java
deleted file mode 100644
index e34359e71bf..00000000000
--- a/libjava/gnu/xml/dom/DomCDATASection.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * <p> "CDATASection" implementation.
- * This is a non-core DOM class, supporting the "XML" feature.
- * CDATA sections are just ways to represent text using different
- * delimeters. </p>
- *
- * <p> <em>You are strongly advised not to use CDATASection nodes.</em>
- * The advantage of having slightly prettier ways to print text that may
- * have lots of embedded XML delimiters, such as "&amp;" and "&lt;",
- * can be dwarfed by the cost of dealing with multiple kinds of text
- * nodes in all your algorithms. </p>
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomCDATASection
- extends DomText
- implements CDATASection
-{
-
- /**
- * Constructs a CDATA section node associated with the specified
- * document and holding the specified data.
- *
- * <p>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);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the string "#cdata-section".
- */
- final public String getNodeName()
- {
- return "#cdata-section";
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomCharacterData.java b/libjava/gnu/xml/dom/DomCharacterData.java
deleted file mode 100644
index e94dcc4ecf9..00000000000
--- a/libjava/gnu/xml/dom/DomCharacterData.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/* DomCharacterData.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.CharacterData;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.events.MutationEvent;
-
-
-/**
- * <p> Abstract "CharacterData" implementation. This
- * facilitates reusing code in classes implementing subtypes of that DOM
- * interface (Text, Comment, CDATASection). </p>
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public abstract class DomCharacterData
- extends DomNode
- implements CharacterData
-{
-
- private String text;
-
- // package private
- DomCharacterData(short nodeType, DomDocument doc, String value)
- {
- super(nodeType, doc);
- text = (value == null) ? "" : value;
- }
-
- // package private
- DomCharacterData(short nodeType, DomDocument doc,
- char[] buf, int offset, int length)
- {
- super(nodeType, doc);
- text = (buf == null) ? "" : new String(buf, offset, length);
- }
-
- /**
- * <b>DOM L1</b>
- * Appends the specified data to the value of this node.
- * Causes a DOMCharacterDataModified mutation event to be reported.
- */
- public void appendData(String arg)
- {
- if (isReadonly())
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- String value = text + arg;
- mutating(value);
- text = value;
- }
-
- /**
- * <b>DOM L1</b>
- * Modifies the value of this node.
- * Causes a DOMCharacterDataModified mutation event to be reported.
- */
- public void deleteData(int offset, int count)
- {
- if (isReadonly())
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- char[] raw = text.toCharArray();
- if (offset < 0 || count < 0 || offset > raw.length)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- if ((offset + count) > raw.length)
- {
- count = raw.length - offset;
- }
- if (count == 0)
- {
- return;
- }
- try
- {
- char[] buf = new char[raw.length - count];
- System.arraycopy(raw, 0, buf, 0, offset);
- System.arraycopy(raw, offset + count, buf, offset,
- raw.length - (offset + count));
- String value = new String(buf);
- mutating(value);
- text = value;
- }
- catch (IndexOutOfBoundsException x)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the value of this node.
- */
- public String getNodeValue()
- {
- return text;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the value of this node; same as getNodeValue.
- */
- public final String getData()
- {
- return text;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the length of the data.
- */
- public int getLength()
- {
- return text.length();
- }
-
- /**
- * <b>DOM L1</b>
- * Modifies the value of this node.
- */
- public void insertData(int offset, String arg)
- {
- if (isReadonly())
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- char[] raw = text.toCharArray();
- char[] tmp = arg.toCharArray ();
- char[] buf = new char[raw.length + tmp.length];
-
- try
- {
- System.arraycopy(raw, 0, buf, 0, offset);
- System.arraycopy(tmp, 0, buf, offset, tmp.length);
- System.arraycopy(raw, offset, buf, offset + tmp.length,
- raw.length - offset);
- String value = new String(buf);
- mutating(value);
- text = value;
- }
- catch (IndexOutOfBoundsException x)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Modifies the value of this node. Causes DOMCharacterDataModified
- * mutation events to be reported (at least one).
- */
- public void replaceData(int offset, int count, String arg)
- {
- if (readonly)
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- char[] raw = text.toCharArray();
-
- // deleteData
- if (offset < 0 || count < 0 || offset > raw.length)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- if ((offset + count) > raw.length)
- {
- count = raw.length - offset;
- }
- try
- {
- char[] buf = new char[raw.length - count];
- System.arraycopy(raw, 0, buf, 0, offset);
- System.arraycopy(raw, offset + count, buf, offset,
- raw.length - (offset + count));
-
- // insertData
- char[] tmp = arg.toCharArray ();
- char[] buf2 = new char[buf.length + tmp.length];
- System.arraycopy(raw, 0, buf, 0, offset);
- System.arraycopy(tmp, 0, buf, offset, tmp.length);
- System.arraycopy(raw, offset, buf, offset + tmp.length,
- raw.length - offset);
- String value = new String(buf);
- mutating(value);
- text = value;
- }
- catch (IndexOutOfBoundsException x)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Assigns the value of this node.
- * Causes a DOMCharacterDataModified mutation event to be reported.
- */
- public void setNodeValue(String value)
- {
- if (isReadonly())
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- if (value == null)
- {
- value = "";
- }
- mutating(value);
- text = value;
- }
-
- /**
- * <b>DOM L1</b>
- * Assigns the value of this node; same as setNodeValue.
- */
- final public void setData(String data)
- {
- setNodeValue(data);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the specified substring.
- */
- public String substringData(int offset, int count)
- {
- try
- {
- return text.substring(offset, count);
- }
- catch (StringIndexOutOfBoundsException e)
- {
- if (offset >= 0 && count >= 0 && offset < text.length())
- {
- return text.substring(offset);
- }
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- }
-
- /**
- * The base URI for character data is <code>null</code>.
- * @since DOM Level 3 Core
- */
- public final String getBaseURI()
- {
- return null;
- }
-
- private void mutating(String newValue)
- {
- if (!reportMutations)
- {
- return;
- }
-
- // EVENT: DOMCharacterDataModified, target = this,
- // prev/new values provided
- MutationEvent event;
-
- event = (MutationEvent) createEvent("MutationEvents");
- event.initMutationEvent("DOMCharacterDataModified",
- true /* bubbles */, false /* nocancel */,
- null, text, newValue, null, (short) 0);
- dispatchEvent(event);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomComment.java b/libjava/gnu/xml/dom/DomComment.java
deleted file mode 100644
index 71c8160485f..00000000000
--- a/libjava/gnu/xml/dom/DomComment.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* DomComment.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Comment;
-
-/**
- * <p> "Comment" implementation.
- * Comments hold data intended for direct consumption by people;
- * programs should only use ProcessingInstruction nodes. Note that
- * since SAX makes comment reporting optional, XML systems that
- * rely on comments (such as by using this class) will often lose
- * those comments at some point in the processing pipeline. </p>
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomComment
- extends DomCharacterData
- implements Comment
-{
-
- /**
- * Constructs a comment node associated with the specified
- * document and holding the specified data.
- *
- * <p>This constructor should only be invoked by a Document as part of
- * its createComment functionality, or through a subclass which is
- * similarly used in a "Sub-DOM" style layer.
- */
- protected DomComment(DomDocument owner, String value)
- {
- super(COMMENT_NODE, owner, value);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the string "#comment".
- */
- final public String getNodeName()
- {
- return "#comment";
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomDOMException.java b/libjava/gnu/xml/dom/DomDOMException.java
deleted file mode 100644
index cf93fcf9749..00000000000
--- a/libjava/gnu/xml/dom/DomDOMException.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * <p> DOMException implementation. The version that
- * is provided by the W3C is abstract, so it can't be instantiated.
- *
- * <p> 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;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomDoctype.java b/libjava/gnu/xml/dom/DomDoctype.java
deleted file mode 100644
index d35eedc7f75..00000000000
--- a/libjava/gnu/xml/dom/DomDoctype.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/* DomDoctype.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 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;
-import org.w3c.dom.Node;
-import org.w3c.dom.Notation;
-
-/**
- * <p> "DocumentType" implementation (with no extensions for supporting
- * any document typing information). This is a non-core DOM class,
- * supporting the "XML" feature. </p>
- *
- * <p> <em>Few XML applications will actually care about this partial
- * DTD support</em>, since it doesn't expose any (!) of the data typing
- * facilities which can motivate applications to use DTDs. It does not
- * expose element content models, or information about attribute typing
- * rules. Plus the information it exposes isn't very useful; as one example,
- * DOM exposes information about unparsed ENTITY objects, which is only used
- * with certain element attributes, but does not expose the information about
- * those attributes which is needed to apply that data! </p>
- *
- * <p> Also, note that there are no nonportable ways to associate even the
- * notation and entity information exposed by DOM with a DocumentType. While
- * there is a DOM L2 method to construct a DocumentType, it only gives access
- * to the textual content of the &lt;!DOCTYPE ...&gt; declaration. </p>
- *
- * <p> In short, <em>you are strongly advised not to rely on this incomplete
- * DTD functionality</em> in your application code.</p>
- *
- * @see DomEntity
- * @see DomEntityReference
- * @see DomNotation
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomDoctype
- extends DomExtern
- implements DocumentType
-{
-
- private DomNamedNodeMap notations;
- private DomNamedNodeMap entities;
- private final DOMImplementation implementation;
- private String subset;
-
- private HashMap elements = new HashMap();
- private boolean ids;
-
- /**
- * Constructs a DocumentType node associated with the specified
- * implementation, with the specified name.
- *
- * <p>This constructor should only be invoked by a DOMImplementation as
- * part of its createDocumentType functionality, or through a subclass
- * which is similarly used in a "Sub-DOM" style layer.
- *
- * <p> Note that at this time there is no standard SAX API granting
- * access to the internal subset text, so that relying on that value
- * is not currently portable.
- *
- * @param impl The implementation with which this object is associated
- * @param name Name of this root element
- * @param publicId If non-null, provides the external subset's
- * PUBLIC identifier
- * @param systemId If non-null, provides the external subset's
- * SYSTEM identifier
- * @param internalSubset Provides the literal value (unparsed, no
- * entities expanded) of the DTD's internal subset.
- */
- protected DomDoctype(DOMImplementation impl,
- String name,
- String publicId,
- String systemId,
- String internalSubset)
- {
- super(DOCUMENT_TYPE_NODE, null, name, publicId, systemId);
- implementation = impl;
- subset = internalSubset;
- }
-
- /**
- * JAXP builder constructor.
- * @param doc the document
- * @param name the name of the document element
- * @param publicId the public ID of the document type declaration
- * @param systemId the system ID of the document type declaration
- */
- public DomDoctype(DomDocument doc,
- String name,
- String publicId,
- String systemId)
- {
- super(DOCUMENT_TYPE_NODE, doc, name, publicId, systemId);
- implementation = doc.getImplementation();
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the root element's name (just like getNodeName).
- */
- final public String getName()
- {
- return getNodeName();
- }
-
- /**
- * <b>DOM L1</b>
- * Returns information about any general entities declared
- * in the DTD.
- *
- * <p><em>Note: DOM L1 doesn't throw a DOMException here, but
- * then it doesn't have the strange construction rules of L2.</em>
- *
- * @exception DOMException HIERARCHY_REQUEST_ERR if the DocumentType
- * is not associated with a document.
- */
- public NamedNodeMap getEntities()
- {
- if (entities == null)
- {
- entities = new DomNamedNodeMap(this, Node.ENTITY_NODE);
- }
- return entities;
- }
-
- /**
- * Records the declaration of a general entity in this DocumentType.
- *
- * @param name Name of the entity
- * @param publicId If non-null, provides the entity's PUBLIC identifier
- * @param systemId Provides the entity's SYSTEM identifier
- * @param notation If non-null, provides the entity's notation
- * (indicating an unparsed entity)
- * @return The Entity that was declared, or null if the entity wasn't
- * recorded (because it's a parameter entity or because an entity with
- * this name was already declared).
- *
- * @exception DOMException NO_MODIFICATION_ALLOWED_ERR if the
- * DocumentType is no longer writable.
- * @exception DOMException HIERARCHY_REQUEST_ERR if the DocumentType
- * is not associated with a document.
- */
- public Entity declareEntity(String name,
- String publicId,
- String systemId,
- String notation)
- {
- DomEntity entity;
-
- if (name.charAt(0) == '%' || "[dtd]".equals(name))
- {
- return null;
- }
- if (isReadonly())
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- getEntities();
-
- DomDocument.checkName(name, (owner != null) ?
- "1.1".equals(owner.getXmlVersion()) : false);
- if (entities.getNamedItem(name) != null)
- {
- return null;
- }
-
- entity = new DomEntity(owner, name, publicId, systemId, notation);
- entities.setNamedItem(entity);
- return entity;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns information about any notations declared in the DTD.
- *
- * <p><em>Note: DOM L1 doesn't throw a DOMException here, but
- * then it doesn't have the strange construction rules of L2.</em>
- *
- * @exception DOMException HIERARCHY_REQUEST_ERR if the DocumentType
- * is not associated with a document.
- */
- public NamedNodeMap getNotations()
- {
- if (notations == null)
- {
- notations = new DomNamedNodeMap(this, Node.NOTATION_NODE);
- }
- return notations;
- }
-
- /**
- * Records the declaration of a notation in this DocumentType.
- *
- * @param name Name of the notation
- * @param publicId If non-null, provides the notation's PUBLIC identifier
- * @param systemId If non-null, provides the notation's SYSTEM identifier
- * @return The notation that was declared.
- *
- * @exception DOMException NO_MODIFICATION_ALLOWED_ERR if the
- * DocumentType is no longer writable.
- * @exception DOMException HIERARCHY_REQUEST_ERR if the DocumentType
- * is not associated with a document.
- */
- public Notation declareNotation(String name,
- String publicId,
- String systemId)
- {
- DomNotation notation;
-
- if (isReadonly())
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- getNotations();
-
- DomDocument.checkName(name, (owner != null) ?
- "1.1".equals(owner.getXmlVersion()) : false);
-
- notation = new DomNotation(owner, name, publicId, systemId);
- notations.setNamedItem(notation);
- return notation;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the internal subset of the document, as a string of unparsed
- * XML declarations (and comments, PIs, whitespace); or returns null if
- * there is no such subset. There is no vendor-independent expectation
- * that this attribute be set, or that declarations found in it be
- * reflected in the <em>entities</em> or <em>notations</em> attributes
- * of this Document "Type" object.
- *
- * <p> Some application-specific XML profiles require that documents
- * only use specific PUBLIC identifiers, without an internal subset
- * to modify the interperetation of the declarations associated with
- * that PUBLIC identifier through some standard.
- */
- public String getInternalSubset()
- {
- return subset;
- }
-
- /**
- * The base URI of a DocumentType is always <code>null</code>.
- * See the Infoset Mapping, appendix C.
- */
- public final String getBaseURI()
- {
- return null;
- }
-
- /**
- * Sets the internal "readonly" flag so the node and its associated
- * data (only lists of entities and notations, no type information
- * at the moment) can't be changed.
- */
- public void makeReadonly()
- {
- super.makeReadonly();
- if (entities != null)
- {
- entities.makeReadonly();
- }
- if (notations != null)
- {
- notations.makeReadonly();
- }
- }
-
- void setOwner(DomDocument doc)
- {
- if (entities != null)
- {
- for (DomNode ctx = entities.first; ctx != null; ctx = ctx.next)
- {
- ctx.setOwner(doc);
- }
- }
- if (notations != null)
- {
- for (DomNode ctx = notations.first; ctx != null; ctx = ctx.next)
- {
- ctx.setOwner(doc);
- }
- }
- super.setOwner(doc);
- }
-
- /**
- * <b>DOM L2</b>
- * Consults the DOM implementation to determine if the requested
- * feature is supported.
- */
- final public boolean supports(String feature, String version)
- {
- return implementation.hasFeature(feature, version);
- }
-
- /**
- * Returns the implementation associated with this document type.
- */
- final public DOMImplementation getImplementation()
- {
- return implementation;
- }
-
- public void elementDecl(String name, String model)
- {
- DTDElementTypeInfo info = getElementTypeInfo(name);
- if (info == null)
- {
- info = new DTDElementTypeInfo(name, model);
- elements.put(name, info);
- }
- else
- {
- info.model = model;
- }
- }
-
- DTDElementTypeInfo getElementTypeInfo(String name)
- {
- return (DTDElementTypeInfo) elements.get(name);
- }
-
- public void attributeDecl(String eName, String aName, String type,
- String mode, String value)
- {
- DTDAttributeTypeInfo info = new DTDAttributeTypeInfo(eName, aName, type,
- mode, value);
- DTDElementTypeInfo elementInfo = getElementTypeInfo(eName);
- if (elementInfo == null)
- {
- elementInfo = new DTDElementTypeInfo(eName, null);
- elements.put(eName, elementInfo);
- }
- elementInfo.setAttributeTypeInfo(aName, info);
- if ("ID".equals(type))
- {
- ids = true;
- }
- }
-
- DTDAttributeTypeInfo getAttributeTypeInfo(String elementName, String name)
- {
- DTDElementTypeInfo elementInfo =
- (DTDElementTypeInfo) elements.get(elementName);
- return (elementInfo == null) ? null :
- elementInfo.getAttributeTypeInfo(name);
- }
-
- boolean hasIds()
- {
- return ids;
- }
-
- public boolean isSameNode(Node arg)
- {
- if (equals(arg))
- {
- return true;
- }
- if (!(arg instanceof DocumentType))
- {
- return false;
- }
- DocumentType doctype = (DocumentType) arg;
- if (!equal(getPublicId(), doctype.getPublicId()))
- {
- return false;
- }
- if (!equal(getSystemId(), doctype.getSystemId()))
- {
- return false;
- }
- if (!equal(getInternalSubset(), doctype.getInternalSubset()))
- {
- return false;
- }
- // TODO entities
- // TODO notations
- return true;
- }
-
- /**
- * Shallow clone of the doctype, except that associated
- * entities and notations are (deep) cloned.
- */
- public Object clone()
- {
- DomDoctype node = (DomDoctype) super.clone();
-
- if (entities != null)
- {
- node.entities = new DomNamedNodeMap(node, Node.ENTITY_NODE);
- for (DomNode ctx = entities.first; ctx != null; ctx = ctx.next)
- {
- node.entities.setNamedItem(ctx.cloneNode(true));
- }
- }
- if (notations != null)
- {
- node.notations = new DomNamedNodeMap(node, Node.NOTATION_NODE);
- for (DomNode ctx = notations.first; ctx != null; ctx = ctx.next)
- {
- node.notations.setNamedItem(ctx.cloneNode(true));
- }
- }
- return node;
- }
-
-
-}
diff --git a/libjava/gnu/xml/dom/DomDocument.java b/libjava/gnu/xml/dom/DomDocument.java
deleted file mode 100644
index ec422d1b4de..00000000000
--- a/libjava/gnu/xml/dom/DomDocument.java
+++ /dev/null
@@ -1,1387 +0,0 @@
-/* DomDocument.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.Iterator;
-import javax.xml.XMLConstants;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Notation;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.traversal.DocumentTraversal;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.traversal.TreeWalker;
-import org.w3c.dom.xpath.XPathEvaluator;
-import org.w3c.dom.xpath.XPathException;
-import org.w3c.dom.xpath.XPathExpression;
-import org.w3c.dom.xpath.XPathNSResolver;
-
-/**
- * <p> "Document" and "DocumentTraversal" implementation.
- *
- * <p> Note that when this checks names for legality, it uses an
- * approximation of the XML rules, not the real ones. Specifically,
- * it uses Unicode rules, with sufficient tweaks to pass a majority
- * of basic XML conformance tests. (The huge XML character tables are
- * hairy to implement.)
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomDocument
- extends DomNode
- implements Document, DocumentTraversal, XPathEvaluator
-{
-
- private final DOMImplementation implementation;
- private boolean checkingCharacters = true;
- boolean checkingWellformedness = true;
-
- boolean building; // if true, skip mutation events in the tree
-
- DomDocumentConfiguration config;
-
- String inputEncoding;
- String encoding;
- String version = "1.0";
- boolean standalone;
- String systemId;
-
- /**
- * Constructs a Document node, associating it with an instance
- * of the DomImpl class.
- *
- * <p> Note that this constructor disables character checking.
- * It is normally used when connecting a DOM to an XML parser,
- * and duplicating such checks is undesirable. When used for
- * purposes other than connecting to a parser, you should
- * re-enable that checking.
- *
- * @see #setCheckingCharacters
- */
- public DomDocument()
- {
- this(new DomImpl());
- }
-
- /**
- * Constructs a Document node, associating it with the specified
- * implementation. This should only be used in conjunction with
- * a specialized implementation; it will normally be called by
- * that implementation.
- *
- * @see DomImpl
- * @see #setCheckingCharacters
- */
- protected DomDocument(DOMImplementation impl)
- {
- super(DOCUMENT_NODE, null);
- implementation = impl;
- }
-
- /**
- * Sets the <code>building</code> flag.
- * Mutation events in the document are not reported.
- */
- public void setBuilding(boolean flag)
- {
- building = flag;
- }
-
- /**
- * Sets whether to check for document well-formedness.
- * If true, an exception will be raised if a second doctype or root
- * element node is added to the document.
- */
- public void setCheckWellformedness(boolean flag)
- {
- checkingWellformedness = flag;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the constant "#document".
- */
- final public String getNodeName()
- {
- return "#document";
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the document's root element, or null.
- */
- final public Element getDocumentElement()
- {
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- if (ctx.nodeType == ELEMENT_NODE)
- {
- return (Element) ctx;
- }
- }
- return null;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the document's DocumentType, or null.
- */
- final public DocumentType getDoctype()
- {
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- if (ctx.nodeType == DOCUMENT_TYPE_NODE)
- {
- return (DocumentType) ctx;
- }
- }
- return null;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the document's DOMImplementation.
- */
- final public DOMImplementation getImplementation()
- {
- return implementation;
- }
-
- /**
- * <b>DOM L1 (relocated in DOM L2)</b>
- * Returns the element with the specified "ID" attribute, or null.
- *
- * <p>Returns null unless {@link Consumer} was used to populate internal
- * DTD declaration information, using package-private APIs. If that
- * internal DTD information is available, the document may be searched for
- * the element with that ID.
- */
- public Element getElementById(String id)
- {
- DomDoctype doctype = (DomDoctype) getDoctype();
-
- if (doctype == null || !doctype.hasIds()
- || id == null || id.length() == 0)
- {
- return null;
- }
-
- // yes, this is linear in size of document.
- // it'd be easy enough to maintain a hashtable.
- Node current = getDocumentElement();
- Node temp;
-
- if (current == null)
- {
- return null;
- }
- while (current != this)
- {
- // done?
- if (current.getNodeType() == ELEMENT_NODE)
- {
- DomElement element = (DomElement) current;
- DTDElementTypeInfo info =
- doctype.getElementTypeInfo(current.getNodeName());
- if (info != null &&
- id.equals(element.getAttribute(info.idAttrName)))
- {
- return element;
- }
- else if (element.userIdAttrs != null)
- {
- for (Iterator i = element.userIdAttrs.iterator();
- i.hasNext(); )
- {
- Node idAttr = (Node) i.next();
- if (id.equals(idAttr.getNodeValue()))
- {
- return element;
- }
- }
- }
- }
-
- // descend?
- if (current.hasChildNodes())
- {
- current = current.getFirstChild();
- continue;
- }
-
- // lateral?
- temp = current.getNextSibling();
- if (temp != null)
- {
- current = temp;
- continue;
- }
-
- // back up ...
- do
- {
- temp = current.getParentNode();
- if (temp == null)
- {
- return null;
- }
- current = temp;
- temp = current.getNextSibling();
- }
- while (temp == null);
- current = temp;
- }
- return null;
- }
-
- private void checkNewChild(Node newChild)
- {
- if (newChild.getNodeType() == ELEMENT_NODE
- && getDocumentElement() != null)
- {
- throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
- "document element already present: " +
- getDocumentElement(), newChild, 0);
- }
- if (newChild.getNodeType() == DOCUMENT_TYPE_NODE
- && getDoctype() != null)
- {
- throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
- "document type already present: " +
- getDoctype(), newChild, 0);
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Appends the specified node to this node's list of children,
- * enforcing the constraints that there be only one root element
- * and one document type child.
- */
- public Node appendChild(Node newChild)
- {
- if (checkingWellformedness)
- {
- checkNewChild(newChild);
- }
- return super.appendChild(newChild);
- }
-
- /**
- * <b>DOM L1</b>
- * Inserts the specified node in this node's list of children,
- * enforcing the constraints that there be only one root element
- * and one document type child.
- */
- public Node insertBefore(Node newChild, Node refChild)
- {
- if (checkingWellformedness)
- {
- checkNewChild(newChild);
- }
- return super.insertBefore(newChild, refChild);
- }
-
- /**
- * <b>DOM L1</b>
- * Replaces the specified node in this node's list of children,
- * enforcing the constraints that there be only one root element
- * and one document type child.
- */
- public Node replaceChild(Node newChild, Node refChild)
- {
- if (checkingWellformedness &&
- ((newChild.getNodeType() == ELEMENT_NODE &&
- refChild.getNodeType() != ELEMENT_NODE) ||
- (newChild.getNodeType() == DOCUMENT_TYPE_NODE &&
- refChild.getNodeType() != DOCUMENT_TYPE_NODE)))
- {
- checkNewChild(newChild);
- }
- return super.replaceChild(newChild, refChild);
- }
-
- // NOTE: DOM can't really tell when the name of an entity,
- // notation, or PI must follow the namespace rules (excluding
- // colons) instead of the XML rules (which allow them without
- // much restriction). That's an API issue. verifyXmlName
- // aims to enforce the XML rules, not the namespace rules.
-
- /**
- * Throws a DOM exception if the specified name is not a legal XML 1.0
- * Name.
- * @deprecated This method is deprecated and may be removed in future
- * versions of GNU JAXP
- */
- public static void verifyXmlName(String name)
- {
- // XXX why is this public?
- checkName(name, false);
- }
-
- static void checkName(String name, boolean xml11)
- {
- if (name == null)
- {
- throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0);
- }
- int len = name.length();
- if (len == 0)
- {
- throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0);
- }
-
- // dog: rewritten to use the rules for XML 1.0 and 1.1
-
- // Name start character
- char c = name.charAt(0);
- if (xml11)
- {
- // XML 1.1
- if ((c < 0x0041 || c > 0x005a) &&
- (c < 0x0061 || c > 0x007a) &&
- c != ':' && c != '_' &&
- (c < 0x00c0 || c > 0x00d6) &&
- (c < 0x00d8 || c > 0x00f6) &&
- (c < 0x00f8 || c > 0x02ff) &&
- (c < 0x0370 || c > 0x037d) &&
- (c < 0x037f || c > 0x1fff) &&
- (c < 0x200c || c > 0x200d) &&
- (c < 0x2070 || c > 0x218f) &&
- (c < 0x2c00 || c > 0x2fef) &&
- (c < 0x3001 || c > 0xd7ff) &&
- (c < 0xf900 || c > 0xfdcf) &&
- (c < 0xfdf0 || c > 0xfffd) &&
- (c < 0x10000 || c > 0xeffff))
- {
- throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
- name, null, c);
- }
- }
- else
- {
- // XML 1.0
- int type = Character.getType(c);
- switch (type)
- {
- case Character.LOWERCASE_LETTER: // Ll
- case Character.UPPERCASE_LETTER: // Lu
- case Character.OTHER_LETTER: // Lo
- case Character.TITLECASE_LETTER: // Lt
- case Character.LETTER_NUMBER: // Nl
- if ((c > 0xf900 && c < 0xfffe) ||
- (c >= 0x20dd && c <= 0x20e0))
- {
- // Compatibility area and Unicode 2.0 exclusions
- 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 DomDOMException(DOMException.INVALID_CHARACTER_ERR,
- name, null, c);
- }
- }
- }
-
- // Subsequent characters
- for (int i = 1; i < len; i++)
- {
- c = name.charAt(i);
- if (xml11)
- {
- // XML 1.1
- if ((c < 0x0041 || c > 0x005a) &&
- (c < 0x0061 || c > 0x007a) &&
- (c < 0x0030 || c > 0x0039) &&
- c != ':' && c != '_' && c != '-' && c != '.' &&
- (c < 0x00c0 || c > 0x00d6) &&
- (c < 0x00d8 || c > 0x00f6) &&
- (c < 0x00f8 || c > 0x02ff) &&
- (c < 0x0370 || c > 0x037d) &&
- (c < 0x037f || c > 0x1fff) &&
- (c < 0x200c || c > 0x200d) &&
- (c < 0x2070 || c > 0x218f) &&
- (c < 0x2c00 || c > 0x2fef) &&
- (c < 0x3001 || c > 0xd7ff) &&
- (c < 0xf900 || c > 0xfdcf) &&
- (c < 0xfdf0 || c > 0xfffd) &&
- (c < 0x10000 || c > 0xeffff) &&
- c != 0x00b7 &&
- (c < 0x0300 || c > 0x036f) &&
- (c < 0x203f || c > 0x2040))
- {
- throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name,
- null, c);
- }
- }
- else
- {
- // XML 1.0
- int type = Character.getType(c);
- switch (type)
- {
- case Character.LOWERCASE_LETTER: // Ll
- case Character.UPPERCASE_LETTER: // Lu
- case Character.DECIMAL_DIGIT_NUMBER: // Nd
- case Character.OTHER_LETTER: // Lo
- case Character.TITLECASE_LETTER: // Lt
- case Character.LETTER_NUMBER: // Nl
- case Character.COMBINING_SPACING_MARK: // Mc
- case Character.ENCLOSING_MARK: // Me
- case Character.NON_SPACING_MARK: // Mn
- case Character.MODIFIER_LETTER: // Lm
- if ((c > 0xf900 && c < 0xfffe) ||
- (c >= 0x20dd && c <= 0x20e0))
- {
- // Compatibility area and Unicode 2.0 exclusions
- throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
- name, null, c);
- }
- break;
- default:
- if (c != '-' && c != '.' && c != ':' && c != '_' &&
- c != 0x0387 && (c < 0x02bb || c > 0x02c1) &&
- c != 0x0559 && c != 0x06e5 && c != 0x06e6 && c != 0x00b7)
- {
- throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
- name, null, c);
- }
- }
- }
- }
-
- // FIXME characters with a font or compatibility decomposition (i.e.
- // those with a "compatibility formatting tag" in field 5 of the
- // database -- marked by field 5 beginning with a "<") are not allowed.
- }
-
- // package private
- static void checkNCName(String name, boolean xml11)
- {
- checkName(name, xml11);
- int len = name.length();
- int index = name.indexOf(':');
- if (index != -1)
- {
- if (index == 0 || index == (len - 1) ||
- name.lastIndexOf(':') != index)
- {
- throw new DomDOMException(DOMException.NAMESPACE_ERR,
- name, null, 0);
- }
- }
- }
-
- // package private
- static void checkChar(String value, boolean xml11)
- {
- char[] chars = value.toCharArray();
- checkChar(chars, 0, chars.length, xml11);
- }
-
- static void checkChar(char[] buf, int off, int len, boolean xml11)
- {
- for (int i = 0; i < len; i++)
- {
- char c = buf[i];
-
- // assume surrogate pairing checks out OK, for simplicity
- if ((c >= 0x0020 && c <= 0xd7ff) ||
- (c == 0x000a || c == 0x000d || c == 0x0009) ||
- (c >= 0xe000 && c <= 0xfffd) ||
- (c >= 0x10000 && c <= 0x10ffff))
- {
- continue;
- }
- if (xml11)
- {
- if ((c >= 0x0001 && c <= 0x001f) ||
- (c >= 0x007f && c <= 0x0084) ||
- (c >= 0x0086 && c <= 0x009f))
- {
- continue;
- }
- }
- throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
- new String(buf, off, len), null, c);
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Returns a newly created element with the specified name.
- */
- public Element createElement(String name)
- {
- Element element;
-
- if (checkingCharacters)
- {
- checkName(name, "1.1".equals(version));
- }
- if (name.startsWith("xml:"))
- {
- element = createElementNS(null, name);
- }
- else
- {
- element = new DomElement(this, null, name);
- }
- defaultAttributes(element, name);
- return element;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns a newly created element with the specified name
- * and namespace information.
- */
- public Element createElementNS(String namespaceURI, String name)
- {
- if (checkingCharacters)
- {
- checkNCName(name, "1.1".equals(version));
- }
-
- if ("".equals(namespaceURI))
- {
- namespaceURI = null;
- }
- if (name.startsWith("xml:"))
- {
- if (namespaceURI != null
- && !XMLConstants.XML_NS_URI.equals(namespaceURI))
- {
- 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 DomDOMException(DOMException.NAMESPACE_ERR,
- "xmlns is reserved", this, 0);
- }
- else if (namespaceURI == null && name.indexOf(':') != -1)
- {
- throw new DomDOMException(DOMException.NAMESPACE_ERR,
- "prefixed name '" + name +
- "' needs a URI", this, 0);
- }
-
- Element element = new DomElement(this, namespaceURI, name);
- defaultAttributes(element, name);
- return element;
- }
-
- private void defaultAttributes(Element element, String name)
- {
- DomDoctype doctype = (DomDoctype) getDoctype();
- if (doctype == null)
- {
- return;
- }
-
- // default any attributes that need it
- DTDElementTypeInfo info = doctype.getElementTypeInfo(name);
- if (info != null)
- {
- for (Iterator i = info.attributes(); i != null && i.hasNext(); )
- {
- DTDAttributeTypeInfo attr = (DTDAttributeTypeInfo) i.next();
- DomAttr node = (DomAttr) createAttribute(attr.name);
-
- String value = attr.value;
- if (value == null)
- {
- value = "";
- }
- node.setValue(value);
- node.setSpecified(false);
- element.setAttributeNode(node);
- }
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Returns a newly created document fragment.
- */
- public DocumentFragment createDocumentFragment()
- {
- return new DomDocumentFragment(this);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns a newly created text node with the specified value.
- */
- public Text createTextNode(String value)
- {
- if (checkingCharacters)
- {
- checkChar(value, "1.1".equals(version));
- }
- return new DomText(this, value);
- }
-
- /**
- * Returns a newly created text node with the specified value.
- */
- public Text createTextNode(char[] buf, int off, int len)
- {
- if (checkingCharacters)
- {
- checkChar(buf, off, len, "1.1".equals(version));
- }
- return new DomText(this, buf, off, len);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns a newly created comment node with the specified value.
- */
- public Comment createComment(String value)
- {
- if (checkingCharacters)
- {
- checkChar(value, "1.1".equals(version));
- }
- return new DomComment(this, value);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns a newly created CDATA section node with the specified value.
- */
- public CDATASection createCDATASection(String value)
- {
- if (checkingCharacters)
- {
- checkChar(value, "1.1".equals(version));
- }
- return new DomCDATASection(this, value);
- }
-
- /**
- * Returns a newly created CDATA section node with the specified value.
- */
- public CDATASection createCDATASection(char[] buf, int off, int len)
- {
- if (checkingCharacters)
- {
- checkChar(buf, off, len, "1.1".equals(version));
- }
- return new DomCDATASection(this, buf, off, len);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns a newly created processing instruction.
- */
- public ProcessingInstruction createProcessingInstruction(String target,
- String data)
- {
- if (checkingCharacters)
- {
- boolean xml11 = "1.1".equals(version);
- checkName(target, xml11);
- if ("xml".equalsIgnoreCase(target))
- {
- throw new DomDOMException(DOMException.SYNTAX_ERR,
- "illegal PI target name",
- this, 0);
- }
- checkChar(data, xml11);
- }
- return new DomProcessingInstruction(this, target, data);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns a newly created attribute with the specified name.
- */
- public Attr createAttribute(String name)
- {
- if (checkingCharacters)
- {
- checkName(name, "1.1".equals(version));
- }
- if (name.startsWith("xml:"))
- {
- return createAttributeNS(XMLConstants.XML_NS_URI, name);
- }
- else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) ||
- name.startsWith("xmlns:"))
- {
- return createAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, name);
- }
- else
- {
- return new DomAttr(this, null, name);
- }
- }
-
- /**
- * <b>DOM L2</b>
- * Returns a newly created attribute with the specified name
- * and namespace information.
- */
- public Attr createAttributeNS(String namespaceURI, String name)
- {
- if (checkingCharacters)
- {
- checkNCName(name, "1.1".equals(version));
- }
-
- if ("".equals(namespaceURI))
- {
- namespaceURI = null;
- }
- if (name.startsWith ("xml:"))
- {
- if (namespaceURI == null)
- {
- namespaceURI = XMLConstants.XML_NS_URI;
- }
- else if (!XMLConstants.XML_NS_URI.equals(namespaceURI))
- {
- throw new DomDOMException(DOMException.NAMESPACE_ERR,
- "xml namespace is always " +
- XMLConstants.XML_NS_URI,
- this, 0);
- }
- }
- else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) ||
- name.startsWith("xmlns:"))
- {
- if (namespaceURI == null)
- {
- namespaceURI = XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
- }
- else if (!XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI))
- {
- 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 DomDOMException(DOMException.NAMESPACE_ERR,
- "prefixed name needs a URI: " + name, this, 0);
- }
- return new DomAttr(this, namespaceURI, name);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns a newly created reference to the specified entity.
- * The caller should populate this with the appropriate children
- * and then mark it as readonly.
- *
- * @see DomNode#makeReadonly
- */
- public EntityReference createEntityReference(String name)
- {
- DomEntityReference ret = new DomEntityReference(this, name);
- DocumentType doctype = getDoctype();
- if (doctype != null)
- {
- DomEntity ent = (DomEntity) doctype.getEntities().getNamedItem(name);
- if (ent != null)
- {
- for (DomNode ctx = ent.first; ctx != null; ctx = ctx.next)
- {
- ret.appendChild(ctx.cloneNode(true));
- }
- }
- }
- ret.makeReadonly();
- return ret;
- }
-
- /**
- * <b>DOM L2</b>
- * Makes a copy of the specified node, with all nodes "owned" by
- * this document and with children optionally copied. This type
- * of standard utility has become, well, a standard utility.
- *
- * <p> Note that EntityReference nodes created through this method (either
- * directly, or recursively) never have children, and that there is no
- * portable way to associate them with such children.
- *
- * <p> Note also that there is no requirement that the specified node
- * be associated with a different document. This differs from the
- * <em>cloneNode</em> operation in that the node itself is not given
- * an opportunity to participate, so that any information managed
- * by node subclasses will be lost.
- */
- public Node importNode(Node src, boolean deep)
- {
- Node dst = null;
- switch (src.getNodeType())
- {
- case TEXT_NODE:
- dst = createTextNode(src.getNodeValue());
- break;
- case CDATA_SECTION_NODE:
- dst = createCDATASection(src.getNodeValue());
- break;
- case COMMENT_NODE:
- dst = createComment(src.getNodeValue());
- break;
- case PROCESSING_INSTRUCTION_NODE:
- dst = createProcessingInstruction(src.getNodeName(),
- src.getNodeValue());
- break;
- case NOTATION_NODE:
- // NOTE: There's no standard way to create
- // these, or add them to a doctype. Useless.
- Notation notation = (Notation) src;
- dst = new DomNotation(this, notation.getNodeName(),
- notation.getPublicId(),
- notation.getSystemId());
- break;
- case ENTITY_NODE:
- // NOTE: There's no standard way to create
- // these, or add them to a doctype. Useless.
- Entity entity = (Entity) src;
- dst = new DomEntity(this, entity.getNodeName(),
- entity.getPublicId(),
- entity.getSystemId(),
- entity.getNotationName());
- if (deep)
- {
- for (Node ctx = src.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- dst.appendChild(importNode(ctx, deep));
- }
- }
- break;
- case ENTITY_REFERENCE_NODE:
- dst = createEntityReference(src.getNodeName());
- break;
- case DOCUMENT_FRAGMENT_NODE:
- dst = new DomDocumentFragment(this);
- if (deep)
- {
- for (Node ctx = src.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- dst.appendChild(importNode(ctx, deep));
- }
- }
- break;
- case ATTRIBUTE_NODE:
- String attr_nsuri = src.getNamespaceURI();
- if (attr_nsuri != null)
- {
- dst = createAttributeNS(attr_nsuri, src.getNodeName());
- }
- else
- {
- dst = createAttribute(src.getNodeName());
- }
- // this is _always_ done regardless of "deep" setting
- for (Node ctx = src.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- dst.appendChild(importNode(ctx, false));
- }
- break;
- case ELEMENT_NODE:
- String elem_nsuri = src.getNamespaceURI();
- if (elem_nsuri != null)
- {
- dst = createElementNS(elem_nsuri, src.getNodeName());
- }
- else
- {
- dst = createElement(src.getNodeName());
- }
- NamedNodeMap srcAttrs = src.getAttributes();
- NamedNodeMap dstAttrs = dst.getAttributes();
- int len = srcAttrs.getLength();
- for (int i = 0; i < len; i++)
- {
- Attr a = (Attr) srcAttrs.item(i);
- Attr dflt;
-
- // maybe update defaulted attributes
- dflt = (Attr) dstAttrs.getNamedItem(a.getNodeName());
- if (dflt != null)
- {
- String newval = a.getNodeValue();
- if (!dflt.getNodeValue().equals(newval)
- || a.getSpecified () == true)
- {
- dflt.setNodeValue (newval);
- }
- continue;
- }
-
- dstAttrs.setNamedItem((Attr) importNode(a, false));
- }
- if (deep)
- {
- for (Node ctx = src.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- dst.appendChild(importNode(ctx, true));
- }
- }
- break;
- // can't import document or doctype nodes
- case DOCUMENT_NODE:
- case DOCUMENT_TYPE_NODE:
- // FALLTHROUGH
- // can't import unrecognized or nonstandard nodes
- default:
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, null, src, 0);
- }
-
- // FIXME cleanup a bit -- for deep copies, copy those
- // children in one place, here (code sharing is healthy)
-
- if (src instanceof DomNode)
- {
- ((DomNode) src).notifyUserDataHandlers(UserDataHandler.NODE_IMPORTED,
- src, dst);
- }
- return dst;
- }
-
- /**
- * <b>DOM L2 (Traversal)</b>
- * Returns a newly created node iterator. Don't forget to detach
- * this iterator when you're done using it!
- *
- * @see DomIterator
- */
- public NodeIterator createNodeIterator(Node root,
- int whatToShow,
- NodeFilter filter,
- boolean expandEntities)
- {
- return new DomNodeIterator(root, whatToShow, filter, expandEntities,
- false);
- }
-
- public TreeWalker createTreeWalker(Node root,
- int whatToShow,
- NodeFilter filter,
- boolean expandEntities)
- {
- return new DomNodeIterator(root, whatToShow, filter, expandEntities,
- true);
- }
-
- // DOM Level 3 methods
-
- /**
- * DOM L3
- */
- public String getInputEncoding()
- {
- return inputEncoding;
- }
-
- public void setInputEncoding(String inputEncoding)
- {
- this.inputEncoding = inputEncoding;
- }
-
- /**
- * DOM L3
- */
- public String getXmlEncoding()
- {
- return encoding;
- }
-
- public void setXmlEncoding(String encoding)
- {
- this.encoding = encoding;
- }
-
- public boolean getXmlStandalone()
- {
- return standalone;
- }
-
- public void setXmlStandalone(boolean xmlStandalone)
- {
- standalone = xmlStandalone;
- }
-
- public String getXmlVersion()
- {
- return version;
- }
-
- public void setXmlVersion(String xmlVersion)
- {
- if (xmlVersion == null)
- {
- xmlVersion = "1.0";
- }
- if ("1.0".equals(xmlVersion) ||
- "1.1".equals(xmlVersion))
- {
- version = xmlVersion;
- }
- else
- {
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
- }
-
- public boolean getStrictErrorChecking()
- {
- return checkingCharacters;
- }
-
- public void setStrictErrorChecking(boolean strictErrorChecking)
- {
- checkingCharacters = strictErrorChecking;
- }
-
- public String lookupPrefix(String namespaceURI)
- {
- Node root = getDocumentElement();
- return (root == null) ? null : root.lookupPrefix(namespaceURI);
- }
-
- public boolean isDefaultNamespace(String namespaceURI)
- {
- Node root = getDocumentElement();
- return (root == null) ? false : root.isDefaultNamespace(namespaceURI);
- }
-
- public String lookupNamespaceURI(String prefix)
- {
- Node root = getDocumentElement();
- return (root == null) ? null : root.lookupNamespaceURI(prefix);
- }
-
- public String getBaseURI()
- {
- return getDocumentURI();
- /*
- Node root = getDocumentElement();
- if (root != null)
- {
- NamedNodeMap attrs = root.getAttributes();
- Node xmlBase = attrs.getNamedItemNS(XMLConstants.XML_NS_URI, "base");
- if (xmlBase != null)
- {
- return xmlBase.getNodeValue();
- }
- }
- return systemId;
- */
- }
-
- public String getDocumentURI()
- {
- return systemId;
- }
-
- public void setDocumentURI(String documentURI)
- {
- systemId = documentURI;
- }
-
- public Node adoptNode(Node source)
- {
- switch (source.getNodeType())
- {
- case DOCUMENT_NODE:
- case DOCUMENT_TYPE_NODE:
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
- case ENTITY_NODE:
- case NOTATION_NODE:
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- if (source instanceof DomNode)
- {
- DomNode src = (DomNode) source;
- DomNode dst = src;
- if (dst.parent != null)
- {
- dst = (DomNode) dst.cloneNode(true);
- }
- dst.setOwner(this);
- src.notifyUserDataHandlers(UserDataHandler.NODE_ADOPTED, src, dst);
- return dst;
- }
- return null;
- }
-
- public DOMConfiguration getDomConfig()
- {
- if (config == null)
- {
- config = new DomDocumentConfiguration();
- }
- return config;
- }
-
- public void normalizeDocument()
- {
- boolean save = building;
- building = true;
- normalizeNode(this);
- building = save;
- }
-
- void normalizeNode(DomNode node)
- {
- node.normalize();
- if (config != null)
- {
- switch (node.nodeType)
- {
- case CDATA_SECTION_NODE:
- if (!config.cdataSections)
- {
- // replace CDATA section with text node
- Text text = createTextNode(node.getNodeValue());
- node.parent.insertBefore(text, node);
- node.parent.removeChild(node);
- // merge adjacent text nodes
- String data = text.getWholeText();
- node = (DomNode) text.replaceWholeText(data);
- }
- else if (config.splitCdataSections)
- {
- String value = node.getNodeValue();
- int i = value.indexOf("]]>");
- while (i != -1)
- {
- Node node2 = createCDATASection(value.substring(0, i));
- node.parent.insertBefore(node2, node);
- value = value.substring(i + 3);
- node.setNodeValue(value);
- i = value.indexOf("]]>");
- }
- }
- break;
- case COMMENT_NODE:
- if (!config.comments)
- {
- node.parent.removeChild(node);
- }
- break;
- case TEXT_NODE:
- if (!config.elementContentWhitespace &&
- ((Text) node).isElementContentWhitespace())
- {
- node.parent.removeChild(node);
- }
- break;
- case ENTITY_REFERENCE_NODE:
- if (!config.entities)
- {
- for (DomNode ctx = node.first; ctx != null; )
- {
- DomNode ctxNext = ctx.next;
- node.parent.insertBefore(ctx, node);
- ctx = ctxNext;
- }
- node.parent.removeChild(node);
- }
- break;
- case ELEMENT_NODE:
- if (!config.namespaceDeclarations)
- {
- DomNamedNodeMap attrs =
- (DomNamedNodeMap) node.getAttributes();
- boolean aro = attrs.readonly;
- attrs.readonly = false; // Ensure we can delete if necessary
- int len = attrs.getLength();
- for (int i = 0; i < len; i++)
- {
- Node attr = attrs.item(i);
- String namespace = attr.getNamespaceURI();
- if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespace))
- {
- attrs.removeNamedItemNS(namespace,
- attr.getLocalName());
- i--;
- len--;
- }
- }
- attrs.readonly = aro;
- }
- break;
- }
- }
- for (DomNode ctx = node.first; ctx != null; )
- {
- DomNode ctxNext = ctx.next;
- normalizeNode(ctx);
- ctx = ctxNext;
- }
- }
-
- public Node renameNode(Node n, String namespaceURI, String qualifiedName)
- throws DOMException
- {
- if (n instanceof DomNsNode)
- {
- DomNsNode src = (DomNsNode) n;
- if (src == null)
- {
- throw new DomDOMException(DOMException.NOT_FOUND_ERR);
- }
- if (src.owner != this)
- {
- throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
- null, src, 0);
- }
- boolean xml11 = "1.1".equals(version);
- checkName(qualifiedName, xml11);
- int ci = qualifiedName.indexOf(':');
- if ("".equals(namespaceURI))
- {
- namespaceURI = null;
- }
- if (namespaceURI != null)
- {
- checkNCName(qualifiedName, xml11);
- String prefix = (ci == -1) ? "" :
- qualifiedName.substring(0, ci);
- if (XMLConstants.XML_NS_PREFIX.equals(prefix) &&
- !XMLConstants.XML_NS_URI.equals(namespaceURI))
- {
- throw new DomDOMException(DOMException.NAMESPACE_ERR,
- "xml namespace must be " +
- XMLConstants.XML_NS_URI, src, 0);
- }
- else if (src.nodeType == ATTRIBUTE_NODE &&
- (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) ||
- XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) &&
- !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI))
- {
- 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 DomDOMException(DOMException.NAMESPACE_ERR,
- "xml namespace must be " +
- XMLConstants.XML_NS_URI, src, 0);
- }
- else if (src.nodeType == ATTRIBUTE_NODE &&
- XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) &&
- !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) ||
- XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)))
- {
- throw new DomDOMException(DOMException.NAMESPACE_ERR,
- "xmlns namespace must be " +
- XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0);
- }
-
- }
- src.setNodeName(qualifiedName);
- src.setNamespaceURI(namespaceURI);
- src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src);
- // TODO MutationNameEvents
- // DOMElementNameChanged or DOMAttributeNameChanged
- return src;
- }
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, null, n, 0);
- }
-
- // -- XPathEvaluator --
-
- public XPathExpression createExpression(String expression,
- XPathNSResolver resolver)
- throws XPathException, DOMException
- {
- return new DomXPathExpression(this, expression, resolver);
- }
-
- public XPathNSResolver createNSResolver(Node nodeResolver)
- {
- return new DomXPathNSResolver(nodeResolver);
- }
-
- public Object evaluate(String expression,
- Node contextNode,
- XPathNSResolver resolver,
- short type,
- Object result)
- throws XPathException, DOMException
- {
- XPathExpression xpe =
- new DomXPathExpression(this, expression, resolver);
- return xpe.evaluate(contextNode, type, result);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomDocumentBuilder.java b/libjava/gnu/xml/dom/DomDocumentBuilder.java
deleted file mode 100644
index 66dd2b0edfa..00000000000
--- a/libjava/gnu/xml/dom/DomDocumentBuilder.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* DomDocumentBuilder.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io.InputStream;
-import java.io.IOException;
-import javax.xml.parsers.DocumentBuilder;
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSParser;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Document builder using the GNU DOM Load &amp; Save implementation.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class DomDocumentBuilder
- extends DocumentBuilder
-{
-
- final DOMImplementation impl;
- final DOMImplementationLS ls;
- final LSParser parser;
-
- DomDocumentBuilder(DOMImplementation impl,
- DOMImplementationLS ls,
- LSParser parser)
- {
- this.impl = impl;
- this.ls = ls;
- this.parser = parser;
- }
-
- public boolean isNamespaceAware()
- {
- DOMConfiguration config = parser.getDomConfig();
- return ((Boolean) config.getParameter("namespaces")).booleanValue();
- }
-
- public boolean isValidating()
- {
- DOMConfiguration config = parser.getDomConfig();
- return ((Boolean) config.getParameter("validating")).booleanValue();
- }
-
- public boolean isXIncludeAware()
- {
- DOMConfiguration config = parser.getDomConfig();
- return ((Boolean) config.getParameter("xinclude-aware")).booleanValue();
- }
-
- public void setEntityResolver(EntityResolver resolver)
- {
- DOMConfiguration config = parser.getDomConfig();
- config.setParameter("entity-resolver", resolver);
- }
-
- public void setErrorHandler(ErrorHandler handler)
- {
- DOMConfiguration config = parser.getDomConfig();
- config.setParameter("error-handler", handler);
- }
-
- public DOMImplementation getDOMImplementation()
- {
- return impl;
- }
-
- public Document newDocument()
- {
- return impl.createDocument(null, null, null);
- }
-
- public Document parse(InputStream in)
- throws SAXException, IOException
- {
- LSInput input = ls.createLSInput();
- input.setByteStream(in);
- return parser.parse(input);
- }
-
- public Document parse(InputStream in, String systemId)
- throws SAXException, IOException
- {
- LSInput input = ls.createLSInput();
- input.setByteStream(in);
- input.setSystemId(systemId);
- return parser.parse(input);
- }
-
- public Document parse(String systemId)
- throws SAXException, IOException
- {
- return parser.parseURI(systemId);
- }
-
- public Document parse(InputSource is)
- throws SAXException, IOException
- {
- LSInput input = ls.createLSInput();
- InputStream in = is.getByteStream();
- if (in != null)
- {
- input.setByteStream(in);
- }
- else
- {
- input.setCharacterStream(is.getCharacterStream());
- }
- input.setPublicId(is.getPublicId());
- input.setSystemId(is.getSystemId());
- input.setEncoding(is.getEncoding());
- return parser.parse(input);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomDocumentBuilderFactory.java b/libjava/gnu/xml/dom/DomDocumentBuilderFactory.java
deleted file mode 100644
index 814141c9441..00000000000
--- a/libjava/gnu/xml/dom/DomDocumentBuilderFactory.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* DomDocumentBuilderFactory.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.bootstrap.DOMImplementationRegistry;
-import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.LSParser;
-
-/**
- * Document builder factory that uses a DOM Level 3 Load &amp; Save
- * implementation.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomDocumentBuilderFactory
- extends DocumentBuilderFactory
-{
-
- final DOMImplementation impl;
- final DOMImplementationLS ls;
-
- public DomDocumentBuilderFactory()
- {
- try
- {
- DOMImplementationRegistry reg =
- DOMImplementationRegistry.newInstance();
- impl = reg.getDOMImplementation("LS 3.0");
- if (impl == null)
- {
- throw new FactoryConfigurationError("no LS implementations found");
- }
- ls = (DOMImplementationLS) impl;
- }
- catch (Exception e)
- {
- throw new FactoryConfigurationError(e);
- }
- }
-
- public DocumentBuilder newDocumentBuilder()
- throws ParserConfigurationException
- {
- LSParser parser = ls.createLSParser(DOMImplementationLS.MODE_ASYNCHRONOUS,
- "http://www.w3.org/TR/REC-xml");
- DOMConfiguration config = parser.getDomConfig();
- setParameter(config, "namespaces",
- isNamespaceAware() ? Boolean.TRUE : Boolean.FALSE);
- setParameter(config, "element-content-whitespace",
- isIgnoringElementContentWhitespace() ? Boolean.FALSE :
- Boolean.TRUE);
- setParameter(config, "comments",
- isIgnoringComments() ? Boolean.FALSE : Boolean.TRUE);
- setParameter(config, "expand-entity-references",
- isExpandEntityReferences() ? Boolean.TRUE : Boolean.FALSE);
- setParameter(config, "coalescing",
- isCoalescing() ? Boolean.TRUE : Boolean.FALSE);
- setParameter(config, "validating",
- isValidating() ? Boolean.TRUE : Boolean.FALSE);
- setParameter(config, "xinclude-aware",
- isXIncludeAware() ? Boolean.TRUE : Boolean.FALSE);
- return new DomDocumentBuilder(impl, ls, parser);
- }
-
- void setParameter(DOMConfiguration config, String name, Object value)
- throws ParserConfigurationException
- {
- if (!config.canSetParameter(name, value))
- {
- throw new ParserConfigurationException(name);
- }
- config.setParameter(name, value);
- }
-
- public Object getAttribute(String name)
- {
- // TODO
- return null;
- }
-
- public void setAttribute(String name, Object value)
- {
- // TODO
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomDocumentConfiguration.java b/libjava/gnu/xml/dom/DomDocumentConfiguration.java
deleted file mode 100644
index 5c589f82fe2..00000000000
--- a/libjava/gnu/xml/dom/DomDocumentConfiguration.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/* DomDocumentConfiguration.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.Arrays;
-import java.util.List;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMErrorHandler;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMStringList;
-
-/**
- * Document configuration, used to store normalization and other parameters.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class DomDocumentConfiguration
- implements DOMConfiguration, DOMStringList
-{
-
- private static final List SUPPORTED_PARAMETERS =
- Arrays.asList(new String[] { "cdata-sections",
- "comments",
- "element-content-whitespace",
- "entities",
- "error-handler",
- "namespace-declarations",
- "split-cdata-sections",
- "infoset"});
-
- boolean cdataSections = true;
- boolean comments = true;
- boolean elementContentWhitespace = true;
- boolean entities = true;
- DOMErrorHandler errorHandler;
- boolean namespaceDeclarations = true;
- boolean splitCdataSections = true;
-
- public void setParameter(String name, Object value)
- throws DOMException
- {
- name = name.toLowerCase();
- if ("cdata-sections".equals(name))
- {
- cdataSections = "true".equals(value.toString());
- }
- else if ("comments".equals(name))
- {
- comments = "true".equals(value.toString());
- }
- else if ("element-content-whitespace".equals(name))
- {
- elementContentWhitespace = "true".equals(value.toString());
- }
- else if ("entities".equals(name))
- {
- entities = "true".equals(value.toString());
- }
- else if ("error-handler".equals(name))
- {
- try
- {
- errorHandler = (DOMErrorHandler) value;
- }
- catch (ClassCastException e)
- {
- throw new DomDOMException(DOMException.TYPE_MISMATCH_ERR,
- value.getClass().getName(), null, 0);
- }
- }
- else if ("namespace-declarations".equals(name))
- {
- namespaceDeclarations = "true".equals(value.toString());
- }
- else if ("split-cdata-sections".equals(name))
- {
- comments = "true".equals(value.toString());
- }
- else if ("infoset".equals(name))
- {
- if ("true".equals(value.toString()))
- {
- entities = false;
- cdataSections = false;
- namespaceDeclarations = true;
- elementContentWhitespace = true;
- comments = true;
- }
- }
- else if (("canonical-form".equals(name) ||
- "check-character-normalization".equals(name) ||
- "datatype-normalization".equals(name) ||
- "normalize-characters".equals(name) ||
- "validate".equals(name) ||
- "validate-if-schema".equals(name)) &&
- "false".equals(value.toString()))
- {
- // NOOP
- }
- else if (("namespaces".equals(name) ||
- "well-formed".equals(name)) &&
- "true".equals(value.toString()))
- {
- // NOOP
- }
- else
- {
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR,
- name, null, 0);
- }
- }
-
- public Object getParameter(String name)
- throws DOMException
- {
- name = name.toLowerCase();
- if ("cdata-sections".equals(name))
- {
- return cdataSections ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("comments".equals(name))
- {
- return comments ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("element-content-whitespace".equals(name))
- {
- return elementContentWhitespace ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("entities".equals(name))
- {
- return entities ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("error-handler".equals(name))
- {
- return errorHandler;
- }
- else if ("namespace-declarations".equals(name))
- {
- return namespaceDeclarations ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("split-cdata-sections".equals(name))
- {
- return comments ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("canonical-form".equals(name) ||
- "check-character-normalization".equals(name) ||
- "datatype-normalization".equals(name) ||
- "normalize-characters".equals(name) ||
- "validate".equals(name) ||
- "validate-if-schema".equals(name))
- {
- return Boolean.FALSE;
- }
- else if ("namespaces".equals(name) ||
- "well-formed".equals(name))
- {
- return Boolean.TRUE;
- }
- else if ("infoset".equals(name))
- {
- return (entities == false &&
- cdataSections == false &&
- namespaceDeclarations == true &&
- comments == true) ? Boolean.TRUE : Boolean.FALSE;
- }
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, name, null, 0);
- }
-
- public boolean canSetParameter(String name, Object value)
- {
- name = name.toLowerCase();
- if ("error-handler".equals(name))
- {
- return (value == null || value instanceof DOMErrorHandler);
- }
- else if (contains(name))
- {
- return true;
- }
- else if ("canonical-form".equals(name) ||
- "check-character-normalization".equals(name) ||
- "datatype-normalization".equals(name) ||
- "normalize-characters".equals(name) ||
- "validate".equals(name) ||
- "validate-if-schema".equals(name))
- {
- return "false".equals(value.toString());
- }
- else if ("namespaces".equals(name) ||
- "well-formed".equals(name))
- {
- return "true".equals(value.toString());
- }
- return false;
- }
-
- public DOMStringList getParameterNames()
- {
- return this;
- }
-
- public String item(int i)
- {
- try
- {
- return (String) SUPPORTED_PARAMETERS.get(i);
- }
- catch (IndexOutOfBoundsException e)
- {
- return null;
- }
- }
-
- public int getLength()
- {
- return SUPPORTED_PARAMETERS.size();
- }
-
- public boolean contains(String str)
- {
- str = str.toLowerCase();
- return SUPPORTED_PARAMETERS.contains(str);
- }
-
-}
diff --git a/libjava/gnu/xml/dom/DomDocumentFragment.java b/libjava/gnu/xml/dom/DomDocumentFragment.java
deleted file mode 100644
index 8d260377821..00000000000
--- a/libjava/gnu/xml/dom/DomDocumentFragment.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * <p> "DocumentFragment" implementation. </p>
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomDocumentFragment
- extends DomNode
- implements DocumentFragment
-{
-
- /**
- * Constructs a DocumentFragment node associated with the
- * specified document.
- *
- * <p>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);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the string "#document-fragment".
- */
- final public String getNodeName()
- {
- return "#document-fragment";
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomElement.java b/libjava/gnu/xml/dom/DomElement.java
deleted file mode 100644
index 34509f647bc..00000000000
--- a/libjava/gnu/xml/dom/DomElement.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/* DomElement.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.HashSet;
-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;
-import org.w3c.dom.TypeInfo;
-
-/**
- * <p> "Element" implementation.
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomElement
- extends DomNsNode
- implements Element
-{
-
- /**
- * User-defined ID attributes.
- * Used by DomAttr.isId and DomDocument.getElementById
- */
- Set userIdAttrs;
-
- // Attributes are VERY expensive in DOM, and not just for
- // this implementation. Avoid creating them.
- private DomNamedNodeMap attributes;
-
- // xml:space cache
- String xmlSpace = "";
-
- /**
- * Constructs an Element node associated with the specified document.
- *
- * <p>This constructor should only be invoked by a Document as part
- * of its createElement functionality, or through a subclass which is
- * similarly used in a "Sub-DOM" style layer.
- *
- * @param owner The document with which this node is associated
- * @param namespaceURI Combined with the local part of the name,
- * this is used to uniquely identify a type of element
- * @param name Name of this element, which may include a prefix
- */
- protected DomElement(DomDocument owner, String namespaceURI, String name)
- {
- super(ELEMENT_NODE, owner, namespaceURI, name);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the element's attributes
- */
- public NamedNodeMap getAttributes()
- {
- if (attributes == null)
- {
- attributes = new DomNamedNodeMap(this, Node.ATTRIBUTE_NODE);
- }
- return attributes;
- }
-
- /**
- * <b>DOM L2></b>
- * Returns true iff this is an element node with attributes.
- */
- public boolean hasAttributes()
- {
- return attributes != null && attributes.length != 0;
- }
-
- /**
- * Shallow clone of the element, except that associated
- * attributes are (deep) cloned.
- */
- public Object clone()
- {
- DomElement node = (DomElement) super.clone();
-
- if (attributes != null)
- {
- node.attributes = new DomNamedNodeMap(node, Node.ATTRIBUTE_NODE);
- for (DomNode ctx = attributes.first; ctx != null; ctx = ctx.next)
- {
- node.attributes.setNamedItemNS(ctx.cloneNode(true));
- }
- }
- return node;
- }
-
- void setOwner(DomDocument doc)
- {
- if (attributes != null)
- {
- for (DomNode ctx = attributes.first; ctx != null; ctx = ctx.next)
- {
- ctx.setOwner(doc);
- }
- }
- super.setOwner(doc);
- }
-
- /**
- * Marks this element, its children, and its associated attributes as
- * readonly.
- */
- public void makeReadonly()
- {
- super.makeReadonly();
- if (attributes != null)
- {
- attributes.makeReadonly();
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the element name (same as getNodeName).
- */
- final public String getTagName()
- {
- return getNodeName();
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the value of the specified attribute, or an
- * empty string.
- */
- public String getAttribute(String name)
- {
- if ("xml:space" == name) // NB only works on interned string
- {
- // Use cached value
- return xmlSpace;
- }
- Attr attr = getAttributeNode(name);
- return (attr == null) ? "" : attr.getValue();
- }
-
- /**
- * <b>DOM L2</b>
- * Returns true if the element has an attribute with the
- * specified name (specified or DTD defaulted).
- */
- public boolean hasAttribute(String name)
- {
- return getAttributeNode(name) != null;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns true if the element has an attribute with the
- * specified name (specified or DTD defaulted).
- */
- public boolean hasAttributeNS(String namespaceURI, String local)
- {
- return getAttributeNodeNS(namespaceURI, local) != null;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the value of the specified attribute, or an
- * empty string.
- */
- public String getAttributeNS(String namespaceURI, String local)
- {
- Attr attr = getAttributeNodeNS(namespaceURI, local);
- return (attr == null) ? "" : attr.getValue();
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the appropriate attribute node; the name is the
- * nodeName property of the attribute.
- */
- public Attr getAttributeNode(String name)
- {
- return (attributes == null) ? null :
- (Attr) attributes.getNamedItem(name);
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the appropriate attribute node; the name combines
- * the namespace name and the local part.
- */
- public Attr getAttributeNodeNS(String namespace, String localPart)
- {
- return (attributes == null) ? null :
- (Attr) attributes.getNamedItemNS(namespace, localPart);
- }
-
- /**
- * <b>DOM L1</b>
- * Modifies an existing attribute to have the specified value,
- * or creates a new one with that value. The name used is the
- * nodeName value.
- */
- public void setAttribute(String name, String value)
- {
- Attr attr = getAttributeNode(name);
- if (attr != null)
- {
- attr.setNodeValue(value);
- ((DomAttr) attr).setSpecified(true);
- return;
- }
- attr = owner.createAttribute(name);
- attr.setNodeValue(value);
- setAttributeNode(attr);
- }
-
- /**
- * <b>DOM L2</b>
- * Modifies an existing attribute to have the specified value,
- * or creates a new one with that value.
- */
- public void setAttributeNS(String uri, String aname, String value)
- {
- if (("xmlns".equals (aname) || aname.startsWith ("xmlns:"))
- && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals (uri))
- {
- throw new DomDOMException(DOMException.NAMESPACE_ERR,
- "setting xmlns attribute to illegal value", this, 0);
- }
-
- Attr attr = getAttributeNodeNS(uri, aname);
- if (attr != null)
- {
- attr.setNodeValue(value);
- return;
- }
- attr = owner.createAttributeNS(uri, aname);
- attr.setNodeValue(value);
- setAttributeNodeNS(attr);
- }
-
- /**
- * <b>DOM L1</b>
- * Stores the specified attribute, optionally overwriting any
- * existing one with that name.
- */
- public Attr setAttributeNode(Attr attr)
- {
- return (Attr) getAttributes().setNamedItem(attr);
- }
-
- /**
- * <b>DOM L2</b>
- * Stores the specified attribute, optionally overwriting any
- * existing one with that name.
- */
- public Attr setAttributeNodeNS(Attr attr)
- {
- return (Attr) getAttributes().setNamedItemNS(attr);
- }
-
- /**
- * <b>DOM L1</b>
- * Removes the appropriate attribute node.
- * If there is no such node, this is (bizarrely enough) a NOP so you
- * won't see exceptions if your code deletes non-existent attributes.
- *
- * <p>Note that since there is no portable way for DOM to record
- * DTD information, default values for attributes will never be
- * provided automatically.
- */
- public void removeAttribute(String name)
- {
- if (attributes == null)
- {
- return;
- }
-
- try
- {
- attributes.removeNamedItem(name);
- }
- catch (DomDOMException e)
- {
- if (e.code != DOMException.NOT_FOUND_ERR)
- {
- throw e;
- }
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Removes the appropriate attribute node; the name is the
- * nodeName property of the attribute.
- *
- * <p>Note that since there is no portable way for DOM to record
- * DTD information, default values for attributes will never be
- * provided automatically.
- */
- public Attr removeAttributeNode(Attr node)
- {
- if (attributes == null)
- {
- throw new DomDOMException(DOMException.NOT_FOUND_ERR, null, node, 0);
- }
- return (Attr) attributes.removeNamedItem(node.getNodeName());
- }
-
- /**
- * <b>DOM L2</b>
- * Removes the appropriate attribute node; the name combines
- * the namespace name and the local part.
- *
- * <p>Note that since there is no portable way for DOM to record
- * DTD information, default values for attributes will never be
- * provided automatically.
- */
- public void removeAttributeNS(String namespace, String localPart)
- {
- if (attributes == null)
- {
- throw new DomDOMException(DOMException.NOT_FOUND_ERR, localPart, null, 0);
- }
- attributes.removeNamedItemNS (namespace, localPart);
- }
-
- // DOM Level 3 methods
-
- public String lookupPrefix(String namespaceURI)
- {
- if (namespaceURI == null)
- {
- return null;
- }
- String namespace = getNamespaceURI();
- if (namespace != null && namespace.equals(namespaceURI))
- {
- return getPrefix();
- }
- if (attributes != null)
- {
- for (DomNode ctx = attributes.first; ctx != null; ctx = ctx.next)
- {
- if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI
- .equals(ctx.getNamespaceURI()))
- {
- String value = ctx.getNodeValue();
- if (value.equals(namespaceURI))
- {
- return ctx.getLocalName();
- }
- }
- }
- }
- return super.lookupPrefix(namespaceURI);
- }
-
- public boolean isDefaultNamespace(String namespaceURI)
- {
- String namespace = getNamespaceURI();
- if (namespace != null && namespace.equals(namespaceURI))
- {
- return getPrefix() == null;
- }
- if (attributes != null)
- {
- for (DomNode ctx = attributes.first; ctx != null; ctx = ctx.next)
- {
- if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI
- .equals(ctx.getNamespaceURI()))
- {
- String qName = ctx.getNodeName();
- return (XMLConstants.XMLNS_ATTRIBUTE.equals(qName));
- }
- }
- }
- return super.isDefaultNamespace(namespaceURI);
- }
-
- public String lookupNamespaceURI(String prefix)
- {
- String namespace = getNamespaceURI();
- if (namespace != null && equal(prefix, getPrefix()))
- {
- return namespace;
- }
- if (attributes != null)
- {
- for (DomNode ctx = attributes.first; ctx != null; ctx = ctx.next)
- {
- if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI
- .equals(ctx.getNamespaceURI()))
- {
- if (prefix == null)
- {
- if (XMLConstants.XMLNS_ATTRIBUTE.equals(ctx.getNodeName()))
- {
- return ctx.getNodeValue();
- }
- }
- else
- {
- if (prefix.equals(ctx.getLocalName()))
- {
- return ctx.getNodeValue();
- }
- }
- }
- }
- }
- return super.lookupNamespaceURI(prefix);
- }
-
- public String getBaseURI()
- {
- if (attributes != null)
- {
- Node xmlBase =
- attributes.getNamedItemNS(XMLConstants.XML_NS_URI, "base");
- if (xmlBase != null)
- {
- return xmlBase.getNodeValue();
- }
- }
- return super.getBaseURI();
- }
-
- public TypeInfo getSchemaTypeInfo()
- {
- // DTD implementation
- DomDoctype doctype = (DomDoctype) owner.getDoctype();
- if (doctype != null)
- {
- return doctype.getElementTypeInfo(getNodeName());
- }
- // TODO XML Schema implementation
- return null;
- }
-
- public void setIdAttribute(String name, boolean isId)
- {
- NamedNodeMap attrs = getAttributes();
- Attr attr = (Attr) attrs.getNamedItem(name);
- setIdAttributeNode(attr, isId);
- }
-
- public void setIdAttributeNode(Attr attr, boolean isId)
- {
- if (readonly)
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- if (attr == null || attr.getOwnerElement() != this)
- {
- throw new DomDOMException(DOMException.NOT_FOUND_ERR);
- }
- if (isId)
- {
- if (userIdAttrs == null)
- {
- userIdAttrs = new HashSet();
- }
- userIdAttrs.add(attr);
- }
- else if (userIdAttrs != null)
- {
- userIdAttrs.remove(attr);
- if (userIdAttrs.isEmpty())
- {
- userIdAttrs = null;
- }
- }
- }
-
- public void setIdAttributeNS(String namespaceURI, String localName,
- boolean isId)
- {
- NamedNodeMap attrs = getAttributes();
- Attr attr = (Attr) attrs.getNamedItemNS(namespaceURI, localName);
- setIdAttributeNode(attr, isId);
- }
-
-}
diff --git a/libjava/gnu/xml/dom/DomEntity.java b/libjava/gnu/xml/dom/DomEntity.java
deleted file mode 100644
index 3a76479a389..00000000000
--- a/libjava/gnu/xml/dom/DomEntity.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/* DomEntity.java --
- Copyright (C) 1999,2000,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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Entity;
-
-/**
- * <p> "Entity" implementation. This is a non-core DOM class, supporting the
- * "XML" feature. There are two types of entities, neither of which works
- * particularly well in this API:</p><dl>
- *
- * <dt><em>Unparsed Entities</em></dt>
- * <dd>Since ENTITY/ENTITIES attributes, the only legal use of unparsed
- * entities in XML, can't be detected with DOM, there isn't much point in
- * trying to use unparsed entities in DOM applications. (XML Linking is
- * working to provide a better version of this functionality.) </dd>
- *
- * <dt><em>Parsed Entities</em></dt>
- * <dd> While the DOM specification permits nodes for parsed entities
- * to have a readonly set of children, this is not required and there
- * is no portable way to provide such children. <em>This implementation
- * currently does not permit children to be added to Entities.</em>
- * There are related issues with the use of EntityReference nodes. </dd>
- *
- * </dl>
- *
- * <p> In short, <em>avoid using this DOM functionality</em>.
- *
- * @see DomDoctype
- * @see DomEntityReference
- * @see DomNotation
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomEntity
- extends DomExtern
- implements Entity
-{
-
- private String notation;
-
- /**
- * Constructs an Entity node associated with the specified document,
- * with the specified descriptive data.
- *
- * <p>This constructor should only be invoked by a DomDoctype as part
- * of its declareEntity functionality, or through a subclass which is
- * similarly used in a "Sub-DOM" style layer.
- *
- * @param owner The document with which this entity is associated
- * @param name Name of this entity
- * @param publicId If non-null, provides the entity's PUBLIC identifier
- * @param systemId Provides the entity's SYSTEM identifier (URI)
- * @param notation If non-null, provides the unparsed entity's notation.
- */
- protected DomEntity(DomDocument owner,
- String name,
- String publicId,
- String systemId,
- String notation)
- {
- super(ENTITY_NODE, owner, name, publicId, systemId);
- this.notation = notation;
-
- // NOTE: if notation == null, this is a parsed entity
- // which could reasonably be given child nodes ...
- makeReadonly();
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the NOTATION identifier associated with this entity, if any.
- */
- final public String getNotationName()
- {
- return notation;
- }
-
- // DOM Level 3 methods
-
- public String getInputEncoding()
- {
- // TODO
- return null;
- }
-
- public String getXmlEncoding()
- {
- // TODO
- return null;
- }
-
- public String getXmlVersion()
- {
- // TODO
- return null;
- }
-
- /**
- * The base URI of an external entity is its system ID.
- * The base URI of an internal entity is the parent document's base URI.
- * @since DOM Level 3 Core
- */
- public String getBaseURI()
- {
- String systemId = getSystemId();
- return (systemId == null) ? owner.getBaseURI() : systemId;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomEntityReference.java b/libjava/gnu/xml/dom/DomEntityReference.java
deleted file mode 100644
index d4596b405d4..00000000000
--- a/libjava/gnu/xml/dom/DomEntityReference.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* DomEntityReference.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.DocumentType;
-import org.w3c.dom.Entity;
-import org.w3c.dom.EntityReference;
-
-/**
- * <p> "EntityReference" implementation (reference to parsed entity).
- * This is a non-core DOM class, supporting the "XML" feature.
- * It does not represent builtin entities (such as "&amp;amp;")
- * or character references, which are always directly expanded in
- * DOM trees.</p>
- *
- * <p> Note that while the DOM specification permits these nodes to have
- * a readonly set of children, this is not required. Similarly, it does
- * not require a DOM to couple EntityReference nodes with any Entity nodes
- * that have the same entity name (and equivalent children). It also
- * effectively guarantees that references created directly or indirectly
- * through the <em>Document.ImportNode</em> method will not have children.
- * The level of functionality you may get is extremely variable.
- *
- * <p> Also significant is that even at their most functional level, the fact
- * that EntityReference children must be readonly has caused significant
- * problems when modifying work products held in DOM trees. Other problems
- * include issues related to undeclared namespace prefixes (and references
- * to the current default namespace) that may be found in the text of such
- * parsed entities nodes. These must be contextually bound as part of DOM
- * tree construction. When such nodes are moved, the namespace associated
- * with a given prefix (or default) may change to be in conflict with the
- * namespace bound to the node at creation time.
- *
- * <p> In short, <em>avoid using this DOM functionality</em>.
- *
- * @see DomDoctype
- * @see DomEntity
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomEntityReference
- extends DomNode
- implements EntityReference
-{
-
- private String name;
-
- /**
- * Constructs an EntityReference node associated with the specified
- * document. The creator should populate this with whatever contents
- * are appropriate, and then mark it as readonly.
- *
- * <p>This constructor should only be invoked by a Document as part of
- * its createEntityReference functionality, or through a subclass which
- * is similarly used in a "Sub-DOM" style layer.
- *
- * @see DomNode#makeReadonly
- */
- protected DomEntityReference(DomDocument owner, String name)
- {
- super(ENTITY_REFERENCE_NODE, owner);
- this.name = name;
- }
-
- /**
- * Returns the name of the referenced entity.
- * @since DOM Level 1 Core
- */
- public final String getNodeName()
- {
- return name;
- }
-
- /**
- * The base URI of an entity reference is the base URI where the entity
- * declaration occurs.
- * @since DOM Level 3 Core
- */
- public final String getBaseURI()
- {
- DocumentType doctype = owner.getDoctype();
- if (doctype == null)
- {
- return null;
- }
- Entity entity = (Entity) doctype.getEntities().getNamedItem(name);
- if (entity == null)
- {
- return null;
- }
- return entity.getBaseURI();
- }
-
-}
diff --git a/libjava/gnu/xml/dom/DomEvent.java b/libjava/gnu/xml/dom/DomEvent.java
deleted file mode 100644
index d57eac0e445..00000000000
--- a/libjava/gnu/xml/dom/DomEvent.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/* DomEvent.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.*;
-import org.w3c.dom.events.*;
-import org.w3c.dom.views.AbstractView; // used by UIEvent
-
-/**
- * "Event" implementation. Events are
- * created (through DocumentEvent interface methods on the document object),
- * and are sent to any target node in the document.
- *
- * <p> Applications may define application specific event subclasses, but
- * should otherwise use the <em>DocumentTraversal</em> interface to acquire
- * event objects.
- *
- * @author David Brownell
- */
-public class DomEvent
- implements Event
-{
-
- String type; // init
- EventTarget target;
- EventTarget currentNode;
- short eventPhase;
- boolean bubbles; // init
- boolean cancelable; // init
- long timeStamp; // ?
-
- /** Returns the event's type (name) as initialized */
- public final String getType()
- {
- return type;
- }
-
- /**
- * Returns event's target; delivery of an event is initiated
- * by a <em>target.dispatchEvent(event)</em> invocation.
- */
- public final EventTarget getTarget()
- {
- return target;
- }
-
- /**
- * Returns the target to which events are currently being
- * delivered. When capturing or bubbling, this will not
- * be what <em>getTarget</em> returns.
- */
- public final EventTarget getCurrentTarget()
- {
- return currentNode;
- }
-
- /**
- * Returns CAPTURING_PHASE, AT_TARGET, or BUBBLING;
- * only meaningful within EventListener.handleEvent
- */
- public final short getEventPhase()
- {
- return eventPhase;
- }
-
- /**
- * Returns true if the news of the event bubbles to tree tops
- * (as specified during initialization).
- */
- public final boolean getBubbles()
- {
- return bubbles;
- }
-
- /**
- * Returns true if the default handling may be canceled
- * (as specified during initialization).
- */
- public final boolean getCancelable()
- {
- return cancelable;
- }
-
- /**
- * Returns the event's timestamp.
- */
- public final long getTimeStamp()
- {
- return timeStamp;
- }
-
- boolean stop;
- boolean doDefault;
-
- /**
- * Requests the event no longer be captured or bubbled; only
- * listeners on the event target will see the event, if they
- * haven't yet been notified.
- *
- * <p> <em> Avoid using this </em> except for application-specific
- * events, for which you the protocol explicitly "blesses" the use
- * of this with some event types. Otherwise, you are likely to break
- * algorithms which depend on event notification either directly or
- * through bubbling or capturing. </p>
- *
- * <p> Note that this method is not final, specifically to enable
- * enforcing of policies about events always propagating. </p>
- */
- public void stopPropagation()
- {
- stop = true;
- }
-
- /**
- * Requests that whoever dispatched the event not perform their
- * default processing when event delivery completes. Initializes
- * event timestamp.
- */
- public final void preventDefault()
- {
- doDefault = false;
- }
-
- /** Initializes basic event state. */
- public void initEvent(String typeArg,
- boolean canBubbleArg,
- boolean cancelableArg)
- {
- eventPhase = 0;
- type = typeArg;
- bubbles = canBubbleArg;
- cancelable = cancelableArg;
- timeStamp = System.currentTimeMillis();
- }
-
- /** Constructs, but does not initialize, an event. */
- public DomEvent(String type)
- {
- this.type = type;
- }
-
- /**
- * Returns a basic printable description of the event's type,
- * state, and delivery conditions
- */
- public String toString()
- {
- StringBuffer buf = new StringBuffer("[Event ");
- buf.append(type);
- switch (eventPhase)
- {
- case CAPTURING_PHASE:
- buf.append(", CAPTURING");
- break;
- case AT_TARGET:
- buf.append(", AT TARGET");
- break;
- case BUBBLING_PHASE:
- buf.append(", BUBBLING");
- break;
- default:
- buf.append(", (inactive)");
- break;
- }
- if (bubbles && eventPhase != BUBBLING_PHASE)
- {
- buf.append(", bubbles");
- }
- if (cancelable)
- {
- buf.append(", can cancel");
- }
- // were we to provide subclass info, this's where it'd live
- buf.append("]");
- return buf.toString();
- }
-
- /**
- * "MutationEvent" implementation.
- */
- public static final class DomMutationEvent
- extends DomEvent
- implements MutationEvent
- {
-
- // package private
- Node relatedNode; // init
-
- private String prevValue; // init
- private String newValue; // init
-
- private String attrName; // init
- private short attrChange; // init
-
- /** Returns any "related" node provided by this type of event */
- public final Node getRelatedNode()
- {
- return relatedNode;
- }
-
- /** Returns any "previous value" provided by this type of event */
- public final String getPrevValue()
- {
- return prevValue;
- }
-
- /** Returns any "new value" provided by this type of event */
- public final String getNewValue()
- {
- return newValue;
- }
-
- /** For attribute change events, returns the attribute's name */
- public final String getAttrName()
- {
- return attrName;
- }
-
- /** For attribute change events, returns how the attribuet changed */
- public final short getAttrChange()
- {
- return attrChange;
- }
-
- /** Initializes a mutation event */
- public final void initMutationEvent(String typeArg,
- boolean canBubbleArg,
- boolean cancelableArg,
- Node relatedNodeArg,
- String prevValueArg,
- String newValueArg,
- String attrNameArg,
- short attrChangeArg)
- {
- // super.initEvent is inlined here for speed
- // (mutation events are issued on all DOM changes)
- eventPhase = 0;
- type = typeArg;
- bubbles = canBubbleArg;
- cancelable = cancelableArg;
- timeStamp = System.currentTimeMillis();
-
- relatedNode = relatedNodeArg;
- prevValue = prevValueArg;
- newValue = newValueArg;
- attrName = attrNameArg;
- attrChange = attrChangeArg;
- }
-
- // clear everything that should be GC-able
- void clear()
- {
- type = null;
- target = null;
- relatedNode = null;
- currentNode = null;
- prevValue = newValue = attrName = null;
- }
-
- /** Constructs an uninitialized mutation event. */
- public DomMutationEvent(String type)
- {
- super(type);
- }
-
- }
-
- /**
- * "UIEvent" implementation.
- */
- public static class DomUIEvent
- extends DomEvent
- implements UIEvent
- {
-
- private AbstractView view; // init
- private int detail; // init
-
- /** Constructs an uninitialized User Interface (UI) event */
- public DomUIEvent (String type) { super (type); }
-
- public final AbstractView getView () { return view; }
- public final int getDetail () { return detail; }
-
- /** Initializes a UI event */
- public final void initUIEvent(String typeArg,
- boolean canBubbleArg,
- boolean cancelableArg,
- AbstractView viewArg,
- int detailArg)
- {
- super.initEvent(typeArg, canBubbleArg, cancelableArg);
- view = viewArg;
- detail = detailArg;
- }
-
- }
-
- /*
-
- static final class DomMouseEvent extends DomUIEvent
- implements MouseEvent
- {
- // another half dozen state variables/accessors
- }
-
- */
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomExtern.java b/libjava/gnu/xml/dom/DomExtern.java
deleted file mode 100644
index 87a6909f758..00000000000
--- a/libjava/gnu/xml/dom/DomExtern.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* DomExtern.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * <p> Abstract implemention of nodes describing external DTD-related
- * objects. This facilitates reusing code for Entity, Notation, and
- * DocumentType (really, external subset) nodes. Such support is not
- * part of the core DOM; it's for the "XML" feature. </p>
- *
- * <p> Note that you are strongly advised to avoid using the DOM
- * features that take advantage of this class, since (as of L2) none
- * of them is defined fully enough to permit full use of the
- * XML feature they partially expose. </p>
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public abstract class DomExtern
- extends DomNode
-{
-
- private final String name;
- private final String publicId;
- private final String systemId;
-
- /**
- * Constructs a node associated with the specified document,
- * with the specified descriptive data.
- *
- * @param owner The document with which this object is associated
- * @param name Name of this object
- * @param publicId If non-null, provides the entity's PUBLIC identifier
- * @param systemId If non-null, provides the entity's SYSTEM identifier
- */
- // package private
- DomExtern(short nodeType,
- DomDocument owner,
- String name,
- String publicId,
- String systemId)
- {
- super(nodeType, owner);
- this.name = name;
- this.publicId = publicId;
- this.systemId = systemId;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the SYSTEM identifier associated with this object, if any.
- */
- public final String getSystemId()
- {
- return systemId;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the PUBLIC identifier associated with this object, if any.
- */
- public final String getPublicId()
- {
- return publicId;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the object's name.
- */
- public final String getNodeName()
- {
- return name;
- }
-
- public final String getLocalName()
- {
- return name;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomImpl.java b/libjava/gnu/xml/dom/DomImpl.java
deleted file mode 100644
index cabe741c931..00000000000
--- a/libjava/gnu/xml/dom/DomImpl.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/* DomImpl.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Element;
-import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSOutput;
-import org.w3c.dom.ls.LSParser;
-import org.w3c.dom.ls.LSSerializer;
-import gnu.xml.dom.html2.DomHTMLImpl;
-import gnu.xml.dom.ls.DomLSInput;
-import gnu.xml.dom.ls.DomLSOutput;
-import gnu.xml.dom.ls.DomLSParser;
-import gnu.xml.dom.ls.DomLSSerializer;
-
-/**
- * <p> "DOMImplementation" implementation. </p>
- *
- * <p> At this writing, the following features are supported:
- * "XML" (L1, L2, L3),
- * "Events" (L2), "MutationEvents" (L2), "USER-Events" (a conformant extension),
- * "HTMLEvents" (L2), "UIEvents" (L2), "Traversal" (L2), "XPath" (L3),
- * "LS" (L3) "LS-Async" (L3).
- * It is possible to compile the package so it doesn't support some of these
- * features (notably, Traversal).
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomImpl
- implements DOMImplementation, DOMImplementationLS
-{
-
- /**
- * Constructs a DOMImplementation object which supports
- * "XML" and other DOM Level 2 features.
- */
- public DomImpl()
- {
- }
-
- /**
- * <b>DOM L1</b>
- * Returns true if the specified feature and version are
- * supported. Note that the case of the feature name is ignored.
- */
- public boolean hasFeature(String name, String version)
- {
- if (name.length() == 0)
- {
- return false;
- }
- name = name.toLowerCase();
- if (name.charAt(0) == '+')
- {
- name = name.substring(1);
- }
-
- if ("xml".equals(name) || "core".equals(name))
- {
- return (version == null ||
- "".equals(version) ||
- "1.0".equals(version) ||
- "2.0".equals(version) ||
- "3.0".equals(version));
-
- }
- else if ("ls".equals(name) || "ls-async".equals(name))
- {
- return (version == null ||
- "".equals(version) ||
- "3.0".equals(version));
- }
- else if ("events".equals(name)
- || "mutationevents".equals(name)
- || "uievents".equals(name)
- // || "mouseevents".equals(name)
- || "htmlevents".equals(name))
- {
- return (version == null ||
- "".equals(version) ||
- "2.0".equals(version));
-
- // Extension: "USER-" prefix event types can
- // be created and passed through the DOM.
-
- }
- else if ("user-events".equals(name))
- {
- return (version == null ||
- "".equals(version) ||
- "0.1".equals(version));
-
- // NOTE: "hasFeature" for events is here interpreted to
- // mean the DOM can manufacture those sorts of events,
- // since actually choosing to report the events is more
- // often part of the environment or application. It's
- // only really an issue for mutation events.
-
- }
- else if (DomNode.reportMutations
- && "traversal".equals(name))
- {
- return (version == null ||
- "".equals(version) ||
- "2.0".equals(version));
- }
- else if ("xpath".equals(name))
- {
- return (version == null ||
- "".equals(version) ||
- "3.0".equals(version));
- }
- else if ("html".equals(name) || "xhtml".equals(name))
- {
- return (version == null ||
- "".equals(version) ||
- "2.0".equals(version));
- }
-
- // views
- // stylesheets
- // css, css2
- // range
-
- return false;
- }
-
- /**
- * <b>DOM L2</b>
- * Creates and returns a DocumentType, associated with this
- * implementation. This DocumentType can have no associated
- * objects(notations, entities) until the DocumentType is
- * first associated with a document.
- *
- * <p> Note that there is no implication that this DTD will
- * be parsed by the DOM, or ever have contents. Moreover, the
- * DocumentType created here can only be added to a document by
- * the createDocument method(below). <em>That means that the only
- * portable way to create a Document object is to start parsing,
- * queue comment and processing instruction (PI) nodes, and then only
- * create a DOM Document after <b>(a)</b> it's known if a DocumentType
- * object is needed, and <b>(b) the name and namespace of the root
- * element is known. Queued comment and PI nodes would then be
- * inserted appropriately in the document prologue, both before and
- * after the DTD node, and additional attributes assigned to the
- * root element.</em>
- *(One hopes that the final DOM REC fixes this serious botch.)
- */
- public DocumentType createDocumentType(String rootName,
- String publicId,
- String systemId)
- // CR2 deleted internal subset, ensuring DocumentType
- // is 100% useless instead of just 90% so.
- {
- DomDocument.checkNCName(rootName, false);
- return new DomDoctype(this, rootName, publicId, systemId, null);
- }
-
- /**
- * <b>DOM L2</b>
- * Creates and returns a Document, populated only with a root element and
- * optionally a document type(if that was provided).
- */
- public Document createDocument(String namespaceURI,
- String rootName,
- DocumentType doctype)
- {
- Document doc = createDocument();
- Element root = null;
-
- if (rootName != null)
- {
- root = doc.createElementNS(namespaceURI, rootName);
- if (rootName.startsWith("xmlns:"))
- {
- throw new DomDOMException(DOMException.NAMESPACE_ERR,
- "xmlns is reserved", null, 0);
- }
- }
- // Bleech -- L2 seemingly _requires_ omission of xmlns attributes.
- if (doctype != null)
- {
- doc.appendChild(doctype); // handles WRONG_DOCUMENT error
- }
- if (root != null)
- {
- doc.appendChild(root);
- }
- return doc;
- }
-
- protected Document createDocument()
- {
- return new DomDocument(this);
- }
-
- // DOM Level 3
-
- public Object getFeature(String feature, String version)
- {
- if (hasFeature(feature, version))
- {
- if ("html".equalsIgnoreCase(feature) ||
- "xhtml".equalsIgnoreCase(feature))
- {
- return new DomHTMLImpl();
- }
- return this;
- }
- return null;
- }
-
- // -- DOMImplementationLS --
-
- public LSParser createLSParser(short mode, String schemaType)
- throws DOMException
- {
- return new DomLSParser(mode, schemaType);
- }
-
- public LSSerializer createLSSerializer()
- {
- return new DomLSSerializer();
- }
-
- public LSInput createLSInput()
- {
- return new DomLSInput();
- }
-
- public LSOutput createLSOutput()
- {
- return new DomLSOutput();
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomIterator.java b/libjava/gnu/xml/dom/DomIterator.java
deleted file mode 100644
index 472c6e80585..00000000000
--- a/libjava/gnu/xml/dom/DomIterator.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/* DomIterator.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-import org.w3c.dom.events.Event;
-import org.w3c.dom.events.EventListener;
-import org.w3c.dom.events.EventTarget;
-import org.w3c.dom.events.MutationEvent;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * <p> "NodeIterator" implementation, usable with any L2 DOM which
- * supports MutationEvents. </p>
- *
- * @author David Brownell
- */
-public final class DomIterator
- implements NodeIterator, EventListener
-{
-
- private Node reference;
- private boolean right;
- private boolean done;
-
- private final Node root;
- private final int whatToShow;
- private final NodeFilter filter;
- private final boolean expandEntityReferences;
-
- /**
- * Constructs and initializes an iterator.
- */
- protected DomIterator(Node root,
- int whatToShow,
- NodeFilter filter,
- boolean entityReferenceExpansion)
- {
- if (!root.isSupported("MutationEvents", "2.0"))
- {
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR,
- "Iterator needs mutation events", root, 0);
- }
-
- this.root = root;
- this.whatToShow = whatToShow;
- this.filter = filter;
- this.expandEntityReferences = entityReferenceExpansion;
-
- // start condition: going right, seen nothing yet.
- reference = null;
- right = true;
-
- EventTarget target = (EventTarget) root;
- target.addEventListener("DOMNodeRemoved", this, false);
- }
-
- /**
- * <b>DOM L2</b>
- * Flags the iterator as done, unregistering its event listener so
- * that the iterator can be garbage collected without relying on weak
- * references (a "Java 2" feature) in the event subsystem.
- */
- public void detach()
- {
- EventTarget target = (EventTarget) root;
- target.removeEventListener("DOMNodeRemoved", this, false);
- done = true;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the flag controlling whether iteration descends
- * through entity references.
- */
- public boolean getExpandEntityReferences()
- {
- return expandEntityReferences;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the filter provided during construction.
- */
- public NodeFilter getFilter()
- {
- return filter;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the root of the tree this is iterating through.
- */
- public Node getRoot()
- {
- return root;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the mask of flags provided during construction.
- */
- public int getWhatToShow()
- {
- return whatToShow;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the next node in a forward iteration, masked and filtered.
- * Note that the node may be read-only due to entity expansions.
- * A null return indicates the iteration is complete, but may still
- * be processed backwards.
- */
- public Node nextNode()
- {
- if (done)
- {
- throw new DomDOMException(DOMException.INVALID_STATE_ERR);
- }
- right = true;
- return walk(true);
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the next node in a backward iteration, masked and filtered.
- * Note that the node may be read-only due to entity expansions.
- * A null return indicates the iteration is complete, but may still
- * be processed forwards.
- */
- public Node previousNode()
- {
- if (done)
- {
- throw new DomDOMException(DOMException.INVALID_STATE_ERR);
- }
- Node previous = reference;
- right = false;
- walk(false);
- return previous;
- }
-
- private boolean shouldShow(Node node)
- // raises Runtime exceptions indirectly, via acceptNode()
- {
- if ((whatToShow & (1 << (node.getNodeType() - 1))) == 0)
- {
- return false;
- }
- if (filter == null)
- {
- return true;
- }
- return filter.acceptNode(node) == NodeFilter.FILTER_ACCEPT;
- }
-
- //
- // scenario: root = 1, sequence = 1 2 ... 3 4
- // forward walk: 1 2 ... 3 4 null
- // then backward: 4 3 ... 2 1 null
- //
- // At the leftmost end, "previous" == null
- // At the rightmost end, "previous" == 4
- //
- // The current draft spec really seem to make no sense re the
- // role of the reference node, so what it says is ignored here.
- //
- private Node walk(boolean forward)
- {
- Node here = reference;
-
- while ((here = successor(here, forward)) != null
- && !shouldShow(here))
- {
- continue;
- }
- if (here != null || !forward)
- {
- reference = here;
- }
- return here;
- }
-
- private boolean isLeaf(Node here)
- {
- boolean leaf = !here.hasChildNodes();
- if (!leaf && !expandEntityReferences)
- {
- leaf = (here.getNodeType() == Node.ENTITY_REFERENCE_NODE);
- }
- return leaf;
- }
-
- //
- // Returns the immediate successor in a forward (or backward)
- // document order walk, sans filtering ... except that it knows
- // how to stop, returning null when done. This is a depth first
- // preorder traversal when run in the forward direction.
- //
- private Node successor(Node here, boolean forward)
- {
- Node next;
-
- // the "leftmost" end is funky
- if (here == null)
- {
- return forward ? root : null;
- }
-
- //
- // Forward, this is preorder: children before siblings.
- // Backward, it's postorder: we saw the children already.
- //
- if (forward && !isLeaf(here))
- {
- return here.getFirstChild();
- }
-
- //
- // Siblings ... if forward, we visit them, if backwards
- // we visit their children first.
- //
- if (forward)
- {
- if ((next = here.getNextSibling()) != null)
- {
- return next;
- }
- }
- else if ((next = here.getPreviousSibling()) != null)
- {
- if (isLeaf(next))
- {
- return next;
- }
- next = next.getLastChild();
- while (!isLeaf(next))
- {
- next = next.getLastChild();
- }
- return next;
- }
-
- //
- // We can't go down or lateral -- it's up, then. The logic is
- // the converse of what's above: backwards is easy (the parent
- // is next), forwards isn't.
- //
- next = here.getParentNode();
- if (!forward)
- {
- return next;
- }
-
- Node temp = null;
- while (next != null
- && next != root
- && (temp = next.getNextSibling()) == null)
- {
- next = next.getParentNode();
- }
- if (next == root)
- {
- return null;
- }
- return temp;
- }
-
- /**
- * Not for public use. This lets the iterator know when its
- * reference node will be removed from the tree, so that a new
- * one may be selected.
- *
- * <p> This version works by watching removal events as they
- * bubble up. So, don't prevent them from bubbling.
- */
- public void handleEvent(Event e)
- {
- MutationEvent event;
- Node ancestor, removed;
-
- if (reference == null
- || !"DOMNodeRemoved".equals(e.getType())
- || e.getEventPhase() != Event.BUBBLING_PHASE)
- {
- return;
- }
-
- event = (MutationEvent) e;
- removed = (Node) event.getTarget();
-
- // See if the removal will cause trouble for this iterator
- // by being the reference node or an ancestor of it.
- for (ancestor = reference;
- ancestor != null && ancestor != root;
- ancestor = ancestor.getParentNode())
- {
- if (ancestor == removed)
- {
- break;
- }
- }
- if (ancestor != removed)
- {
- return;
- }
-
- // OK, it'll cause trouble. We want to make the "next"
- // node in our current traversal direction seem right.
- // So we pick the nearest node that's not getting removed,
- // but go in the _opposite_ direction from our current
- // traversal ... so the "next" doesn't skip anything.
- Node candidate;
-
-search:
- while ((candidate = walk(!right)) != null)
- {
- for (ancestor = candidate;
- ancestor != null && ancestor != root;
- ancestor = ancestor.getParentNode())
- {
- if (ancestor == removed)
- {
- continue search;
- }
- }
- return;
- }
-
- // The current DOM WD talks about a special case here;
- // I've not yet seen it.
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomNSResolverContext.java b/libjava/gnu/xml/dom/DomNSResolverContext.java
deleted file mode 100644
index 4cf57772e9b..00000000000
--- a/libjava/gnu/xml/dom/DomNSResolverContext.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* DomNSResolverContext.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.Iterator;
-import javax.xml.namespace.NamespaceContext;
-import org.w3c.dom.xpath.XPathNSResolver;
-
-/**
- * Namespace content wrapper for an XPathNSResolver.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class DomNSResolverContext
- implements NamespaceContext, Iterator
-{
-
- final XPathNSResolver resolver;
-
- DomNSResolverContext(XPathNSResolver resolver)
- {
- this.resolver = resolver;
- }
-
- public String getNamespaceURI(String prefix)
- {
- return resolver.lookupNamespaceURI(prefix);
- }
-
- public String getPrefix(String namespaceURI)
- {
- return null;
- }
-
- public Iterator getPrefixes(String namespaceURI)
- {
- return this;
- }
-
- public boolean hasNext()
- {
- return false;
- }
-
- public Object next()
- {
- return null;
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/libjava/gnu/xml/dom/DomNamedNodeMap.java b/libjava/gnu/xml/dom/DomNamedNodeMap.java
deleted file mode 100644
index fa5ac964b8a..00000000000
--- a/libjava/gnu/xml/dom/DomNamedNodeMap.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/* DomNamedNodeMap.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * <p> "NamedNodeMap" implementation. </p>
- * Used mostly to hold element attributes, but sometimes also
- * to list notations or entities.
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomNamedNodeMap
- implements NamedNodeMap
-{
-
- final DomNode owner;
- final short type;
-
- DomNode first;
- int length;
- boolean readonly;
-
- // package private
- DomNamedNodeMap(DomNode owner, short type)
- {
- this.owner = owner;
- this.type = type;
- }
-
- /**
- * Exposes the internal "readonly" flag. In DOM, all NamedNodeMap
- * objects found in a DocumentType object are read-only (after
- * they are fully constructed), and those holding attributes of
- * a readonly element will also be readonly.
- */
- public final boolean isReadonly()
- {
- return readonly;
- }
-
- /**
- * Sets the internal "readonly" flag so the node and its
- * children can't be changed.
- */
- public void makeReadonly()
- {
- readonly = true;
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- ctx.makeReadonly();
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the named item from the map, or null; names are just
- * the nodeName property.
- */
- public Node getNamedItem(String name)
- {
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- if (ctx.getNodeName().equals(name))
- {
- return ctx;
- }
- }
- return null;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the named item from the map, or null; names are the
- * localName and namespaceURI properties, ignoring any prefix.
- */
- public Node getNamedItemNS(String namespaceURI, String localName)
- {
- if ("".equals(namespaceURI))
- {
- namespaceURI = null;
- }
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- String name = ctx.getLocalName();
- if ((localName == null && name == null) ||
- (localName != null && localName.equals(name)))
- {
- String uri = ctx.getNamespaceURI();
- if ("".equals(uri))
- {
- uri = null;
- }
- if ((namespaceURI == null && uri == null) ||
- (namespaceURI != null && namespaceURI.equals(uri)))
- {
- return ctx;
- }
- }
- }
- return null;
- }
-
- /**
- * <b>DOM L1</b>
- * Stores the named item into the map, optionally overwriting
- * any existing node with that name. The name used is just
- * the nodeName attribute.
- */
- public Node setNamedItem(Node arg)
- {
- return setNamedItem(arg, false);
- }
-
- /**
- * <b>DOM L2</b>
- * Stores the named item into the map, optionally overwriting
- * any existing node with that fully qualified name. The name
- * used incorporates the localName and namespaceURI properties,
- * and ignores any prefix.
- */
- public Node setNamedItemNS(Node arg)
- {
- return setNamedItem(arg, true);
- }
-
- Node setNamedItem(Node arg, boolean ns)
- {
- if (readonly)
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- DomNode node = (DomNode) arg;
- if (node.owner != owner.owner)
- {
- throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR);
- }
- if (node.nodeType != type)
- {
- throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR);
- }
- if (node.nodeType == Node.ATTRIBUTE_NODE)
- {
- DomNode element = node.parent;
- if (element != null && element != owner)
- {
- throw new DomDOMException(DOMException.INUSE_ATTRIBUTE_ERR);
- }
- node.parent = owner;
- node.depth = owner.depth + 1;
- }
-
- String nodeName = node.getNodeName();
- String localName = ns ? node.getLocalName() : null;
- String namespaceURI = ns ? node.getNamespaceURI() : null;
- if ("".equals(namespaceURI))
- {
- namespaceURI = null;
- }
-
- // maybe attribute ADDITION events (?)
- DomNode last = null;
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- boolean test = false;
- if (ns)
- {
- String tln = ctx.getLocalName();
- if (tln.equals(localName))
- {
- String tu = ctx.getNamespaceURI();
- if ((tu == null && namespaceURI == null) ||
- (tu != null && tu.equals(namespaceURI)))
- {
- test = true;
- }
- }
- }
- else
- {
- test = ctx.getNodeName().equals(nodeName);
- }
- if (test)
- {
- // replace
- node.previous = ctx.previous;
- node.next = ctx.next;
- if (ctx.previous != null)
- {
- ctx.previous.next = node;
- }
- if (ctx.next != null)
- {
- ctx.next.previous = node;
- }
- if (first == ctx)
- {
- first = node;
- }
- reparent(node, nodeName, ctx.index);
- ctx.parent = null;
- ctx.next = null;
- ctx.previous = null;
- ctx.setDepth(0);
- ctx.index = 0;
- return ctx;
- }
- last = ctx;
- }
- // append
- if (last != null)
- {
- last.next = node;
- node.previous = last;
- }
- else
- {
- first = node;
- }
- length++;
- reparent(node, nodeName, 0);
- return null;
- }
-
- void reparent(DomNode node, String nodeName, int i)
- {
- node.parent = owner;
- node.setDepth(owner.depth + 1);
- // index renumbering
- for (DomNode ctx = node; ctx != null; ctx = ctx.next)
- {
- ctx.index = i++;
- }
- // cache xml:space
- boolean xmlSpace = "xml:space".equals(nodeName);
- if (xmlSpace && owner instanceof DomElement)
- {
- ((DomElement) owner).xmlSpace = node.getNodeValue();
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Removes the named item from the map, or reports an exception;
- * names are just the nodeName property.
- */
- public Node removeNamedItem(String name)
- {
- return removeNamedItem(null, name, false);
- }
-
- /**
- * <b>DOM L2</b>
- * Removes the named item from the map, or reports an exception;
- * names are the localName and namespaceURI properties.
- */
- public Node removeNamedItemNS(String namespaceURI, String localName)
- {
- return removeNamedItem(namespaceURI, localName, true);
- }
-
- Node removeNamedItem(String uri, String name, boolean ns)
- {
- if (readonly)
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- // report attribute REMOVAL event?
-
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- boolean test = false;
- String nodeName = ctx.getNodeName();
- if (ns)
- {
- String tln = ctx.getLocalName();
- if (tln.equals(name))
- {
- String tu = ctx.getNamespaceURI();
- if ((tu == null && uri == null) ||
- (tu != null && tu.equals(uri)))
- {
- test = true;
- }
- }
- }
- else
- {
- test = nodeName.equals(name);
- }
- if (test)
- {
- // uncache xml:space
- boolean xmlSpace = "xml:space".equals(nodeName);
- if (xmlSpace && owner instanceof DomElement)
- {
- ((DomElement) owner).xmlSpace = "";
- }
- // is this a default attribute?
- if (ctx.nodeType == Node.ATTRIBUTE_NODE)
- {
- String def = getDefaultValue(ctx.getNodeName());
- if (def != null)
- {
- ctx.setNodeValue(def);
- ((DomAttr) ctx).setSpecified(false);
- return null;
- }
- }
- // remove
- if (ctx == first)
- {
- first = ctx.next;
- }
- if (ctx.previous != null)
- {
- ctx.previous.next = ctx.next;
- }
- if (ctx.next != null)
- {
- ctx.next.previous = ctx.previous;
- }
- length--;
- ctx.previous = null;
- ctx.next = null;
- ctx.parent = null;
- ctx.setDepth(0);
- ctx.index = 0;
- return ctx;
- }
- }
- throw new DomDOMException(DOMException.NOT_FOUND_ERR);
- }
-
- String getDefaultValue(String name)
- {
- DomDoctype doctype = (DomDoctype) owner.owner.getDoctype();
- if (doctype == null)
- {
- return null;
- }
- DTDAttributeTypeInfo info =
- doctype.getAttributeTypeInfo(owner.getNodeName(), name);
- if (info == null)
- {
- return null;
- }
- return info.value;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the indexed item from the map, or null.
- */
- public Node item(int index)
- {
- DomNode ctx = first;
- int count = 0;
- while (ctx != null && count < index)
- {
- ctx = ctx.next;
- count++;
- }
- return ctx;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the length of the map.
- */
- public int getLength()
- {
- return length;
- }
-
-}
diff --git a/libjava/gnu/xml/dom/DomNode.java b/libjava/gnu/xml/dom/DomNode.java
deleted file mode 100644
index 761c8de494d..00000000000
--- a/libjava/gnu/xml/dom/DomNode.java
+++ /dev/null
@@ -1,2189 +0,0 @@
-/* DomNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-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 org.w3c.dom.events.DocumentEvent;
-import org.w3c.dom.events.Event;
-import org.w3c.dom.events.EventException;
-import org.w3c.dom.events.EventListener;
-import org.w3c.dom.events.EventTarget;
-import org.w3c.dom.events.MutationEvent;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * <p> "Node", "EventTarget", and "DocumentEvent" implementation.
- * This provides most of the core DOM functionality; only more
- * specialized features are provided by subclasses. Those subclasses may
- * have some particular constraints they must implement, by overriding
- * methods defined here. Such constraints are noted here in the method
- * documentation. </p>
- *
- * <p> Note that you can create events with type names prefixed with "USER-",
- * and pass them through this DOM. This lets you use the DOM event scheme
- * for application specific purposes, although you must use a predefined event
- * structure (such as MutationEvent) to pass data along with those events.
- * Test for existence of this feature with the "USER-Events" DOM feature
- * name.</p>
- *
- * <p> Other kinds of events you can send include the "html" events,
- * like "load", "unload", "abort", "error", and "blur"; and the mutation
- * events. If this DOM has been compiled with mutation event support
- * enabled, it will send mutation events when you change parts of the
- * tree; otherwise you may create and send such events yourself, but
- * they won't be generated by the DOM itself. </p>
- *
- * <p> Note that there is a namespace-aware name comparison method,
- * <em>nameAndTypeEquals</em>, which compares the names (and types) of
- * two nodes in conformance with the "Namespaces in XML" specification.
- * While mostly intended for use with elements and attributes, this should
- * also be helpful for ProcessingInstruction nodes and some others which
- * do not have namespace URIs.
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public abstract class DomNode
- implements Node, NodeList, EventTarget, DocumentEvent, Cloneable, Comparable
-{
-
- // package private
- //final static String xmlNamespace = "http://www.w3.org/XML/1998/namespace";
- //final static String xmlnsURI = "http://www.w3.org/2000/xmlns/";
-
- // tunable
- // NKIDS_* affects arrays of children (which grow)
- // (currently) fixed size:
- // ANCESTORS_* is for event capture/bubbling, # ancestors
- // NOTIFICATIONS_* is for per-node event delivery, # events
- private static final int NKIDS_DELTA = 8;
- private static final int ANCESTORS_INIT = 20;
- private static final int NOTIFICATIONS_INIT = 10;
-
- // tunable: enable mutation events or not? Enabling it costs about
- // 10-15% in DOM construction time, last time it was measured.
-
- // package private !!!
- static final boolean reportMutations = true;
-
- // locking protocol changeable only within this class
- private static final Object lockNode = new Object();
-
- // NON-FINAL class data
-
- // Optimize event dispatch by not allocating memory each time
- private static boolean dispatchDataLock;
- private static DomNode[] ancestors = new DomNode[ANCESTORS_INIT];
- private static ListenerRecord[] notificationSet
- = new ListenerRecord[NOTIFICATIONS_INIT];
-
- // Ditto for the (most common) event object itself!
- private static boolean eventDataLock;
- private static DomEvent.DomMutationEvent mutationEvent
- = new DomEvent.DomMutationEvent(null);
-
- //
- // PER-INSTANCE DATA
- //
-
- DomDocument owner;
- DomNode parent; // parent node;
- DomNode previous; // previous sibling node
- DomNode next; // next sibling node
- DomNode first; // first child node
- DomNode last; // last child node
- int index; // index of this node in its parent's children
- int depth; // depth of the node in the document
- int length; // number of children
- final short nodeType;
-
- // Bleech ... "package private" so a builder can populate entity refs.
- // writable during construction. DOM spec is nasty.
- boolean readonly;
-
- // event registrations
- private ListenerRecord[] listeners;
- private int nListeners;
-
- // DOM Level 3 userData dictionary.
- private HashMap userData;
- private HashMap userDataHandlers;
-
- //
- // Some of the methods here are declared 'final' because
- // knowledge about their implementation is built into this
- // class -- for both integrity and performance.
- //
-
- /**
- * Reduces space utilization for this node.
- */
- public void compact()
- {
- if (listeners != null && listeners.length != nListeners)
- {
- if (nListeners == 0)
- {
- listeners = null;
- }
- else
- {
- ListenerRecord[] l = new ListenerRecord[nListeners];
- System.arraycopy(listeners, 0, l, 0, nListeners);
- listeners = l;
- }
- }
- }
-
- /**
- * Constructs a node and associates it with its owner. Only
- * Document and DocumentType nodes may be created with no owner,
- * and DocumentType nodes get an owner as soon as they are
- * associated with a document.
- */
- protected DomNode(short nodeType, DomDocument owner)
- {
- this.nodeType = nodeType;
-
- if (owner == null)
- {
- // DOM calls never go down this path
- if (nodeType != DOCUMENT_NODE && nodeType != DOCUMENT_TYPE_NODE)
- {
- throw new IllegalArgumentException ("no owner!");
- }
- }
- this.owner = owner;
- }
-
-
- /**
- * <b>DOM L1</b>
- * Returns null; Element subclasses must override this method.
- */
- public NamedNodeMap getAttributes()
- {
- return null;
- }
-
- /**
- * <b>DOM L2></b>
- * Returns true iff this is an element node with attributes.
- */
- public boolean hasAttributes()
- {
- return false;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns a list, possibly empty, of the children of this node.
- * In this implementation, to conserve memory, nodes are the same
- * as their list of children. This can have ramifications for
- * subclasses, which may need to provide their own getLength method
- * for reasons unrelated to the NodeList method of the same name.
- */
- public NodeList getChildNodes()
- {
- return this;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the first child of this node, or null if there are none.
- */
- public Node getFirstChild()
- {
- return first;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the last child of this node, or null if there are none.
- */
- public Node getLastChild()
- {
- return last;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns true if this node has children.
- */
- public boolean hasChildNodes()
- {
- return length != 0;
- }
-
-
- /**
- * Exposes the internal "readonly" flag. In DOM, children of
- * entities and entity references are readonly, as are the
- * objects associated with DocumentType objets.
- */
- public final boolean isReadonly()
- {
- return readonly;
- }
-
- /**
- * Sets the internal "readonly" flag so this subtree can't be changed.
- * Subclasses need to override this method for any associated content
- * that's not a child node, such as an element's attributes or the
- * (few) declarations associated with a DocumentType.
- */
- public void makeReadonly()
- {
- readonly = true;
- for (DomNode child = first; child != null; child = child.next)
- {
- child.makeReadonly();
- }
- }
-
- /**
- * Used to adopt a node to a new document.
- */
- void setOwner(DomDocument doc)
- {
- this.owner = doc;
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- ctx.setOwner(doc);
- }
- }
-
- // just checks the node for inclusion -- may be called many
- // times (docfrag) before anything is allowed to change
- private void checkMisc(DomNode child)
- {
- if (readonly && !owner.building)
- {
- 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 DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
- "can't make ancestor into a child",
- this, 0);
- }
- }
-
- DomDocument owner = (nodeType == DOCUMENT_NODE) ? (DomDocument) this :
- this.owner;
- DomDocument childOwner = child.owner;
- short childNodeType = child.nodeType;
-
- if (childOwner != owner)
- {
- // new in DOM L2, this case -- patch it up later, in reparent()
- if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null))
- {
- throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
- null, child, 0);
- }
- }
-
- // enforce various structural constraints
- switch (nodeType)
- {
- case DOCUMENT_NODE:
- switch (childNodeType)
- {
- case ELEMENT_NODE:
- case PROCESSING_INSTRUCTION_NODE:
- case COMMENT_NODE:
- case DOCUMENT_TYPE_NODE:
- return;
- }
- break;
-
- case ATTRIBUTE_NODE:
- switch (childNodeType)
- {
- case TEXT_NODE:
- case ENTITY_REFERENCE_NODE:
- return;
- }
- break;
-
- case DOCUMENT_FRAGMENT_NODE:
- case ENTITY_REFERENCE_NODE:
- case ELEMENT_NODE:
- case ENTITY_NODE:
- switch (childNodeType)
- {
- case ELEMENT_NODE:
- case TEXT_NODE:
- case COMMENT_NODE:
- case PROCESSING_INSTRUCTION_NODE:
- case CDATA_SECTION_NODE:
- case ENTITY_REFERENCE_NODE:
- return;
- }
- break;
- }
- if (owner.checkingWellformedness)
- {
- throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
- "can't append " +
- nodeTypeToString(childNodeType) +
- " to node of type " +
- nodeTypeToString(nodeType),
- this, 0);
- }
- }
-
- // Here's hoping a good optimizer will detect the case when the
- // next several methods are never called, and won't allocate
- // object code space of any kind. (Case: not reporting any
- // mutation events. We can also remove some static variables
- // listed above.)
-
- private void insertionEvent(DomEvent.DomMutationEvent event,
- DomNode target)
- {
- if (owner == null || owner.building)
- {
- return;
- }
- boolean doFree = false;
-
- if (event == null)
- {
- event = getMutationEvent();
- }
- if (event != null)
- {
- doFree = true;
- }
- else
- {
- event = new DomEvent.DomMutationEvent(null);
- }
- event.initMutationEvent("DOMNodeInserted",
- true /* bubbles */, false /* nocancel */,
- this /* related */, null, null, null, (short) 0);
- target.dispatchEvent(event);
-
- // XXX should really visit every descendant of 'target'
- // and sent a DOMNodeInsertedIntoDocument event to it...
- // bleech, there's no way to keep that acceptably fast.
-
- if (doFree)
- {
- event.target = null;
- event.relatedNode = null;
- event.currentNode = null;
- eventDataLock = false;
- } // else we created work for the GC
- }
-
- private void removalEvent(DomEvent.DomMutationEvent event,
- DomNode target)
- {
- if (owner == null || owner.building)
- {
- return;
- }
- boolean doFree = false;
-
- if (event == null)
- {
- event = getMutationEvent();
- }
- if (event != null)
- {
- doFree = true;
- }
- else
- {
- event = new DomEvent.DomMutationEvent(null);
- }
- event.initMutationEvent("DOMNodeRemoved",
- true /* bubbles */, false /* nocancel */,
- this /* related */, null, null, null, (short) 0);
- target.dispatchEvent(event);
-
- // XXX should really visit every descendant of 'target'
- // and sent a DOMNodeRemovedFromDocument event to it...
- // bleech, there's no way to keep that acceptably fast.
-
- event.target = null;
- event.relatedNode = null;
- event.currentNode = null;
- if (doFree)
- {
- eventDataLock = false;
- }
- // else we created more work for the GC
- }
-
- //
- // Avoid creating lots of memory management work, by using a simple
- // allocation strategy for the mutation event objects that get used
- // at least once per tree modification. We can't use stack allocation,
- // so we do the next simplest thing -- more or less, static allocation.
- // Concurrent notifications should be rare, anyway.
- //
- // Returns the preallocated object, which needs to be carefully freed,
- // or null to indicate the caller needs to allocate their own.
- //
- static private DomEvent.DomMutationEvent getMutationEvent()
- {
- synchronized (lockNode)
- {
- if (eventDataLock)
- {
- return null;
- }
- eventDataLock = true;
- return mutationEvent;
- }
- }
-
- // NOTE: this is manually inlined in the insertion
- // and removal event methods above; change in sync.
- static private void freeMutationEvent()
- {
- // clear fields to enable GC
- mutationEvent.clear();
- eventDataLock = false;
- }
-
- void setDepth(int depth)
- {
- this.depth = depth;
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- ctx.setDepth(depth + 1);
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Appends the specified node to this node's list of children.
- * Document subclasses must override this to enforce the restrictions
- * that there be only one element and document type child.
- *
- * <p> Causes a DOMNodeInserted mutation event to be reported.
- * Will first cause a DOMNodeRemoved event to be reported if the
- * parameter already has a parent. If the new child is a document
- * fragment node, both events will be reported for each child of
- * the fragment; the order in which children are removed and
- * inserted is implementation-specific.
- *
- * <p> If this DOM has been compiled without mutation event support,
- * these events will not be reported.
- */
- public Node appendChild(Node newChild)
- {
- try
- {
- DomNode child = (DomNode) newChild;
-
- if (child.nodeType == DOCUMENT_FRAGMENT_NODE)
- {
- // Append all nodes in the fragment to this node
- for (DomNode ctx = child.first; ctx != null; ctx = ctx.next)
- {
- checkMisc(ctx);
- }
- for (DomNode ctx = child.first; ctx != null; )
- {
- DomNode ctxNext = ctx.next;
- appendChild(ctx);
- ctx = ctxNext;
- }
- }
- else
- {
- checkMisc(child);
- if (child.parent != null)
- {
- child.parent.removeChild(child);
- }
- child.parent = this;
- child.index = length++;
- child.setDepth(depth + 1);
- child.next = null;
- if (last == null)
- {
- first = child;
- child.previous = null;
- }
- else
- {
- last.next = child;
- child.previous = last;
- }
- last = child;
-
- if (reportMutations)
- {
- insertionEvent(null, child);
- }
- }
-
- return child;
- }
- catch (ClassCastException e)
- {
- throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
- null, newChild, 0);
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Inserts the specified node in this node's list of children.
- * Document subclasses must override this to enforce the restrictions
- * that there be only one element and document type child.
- *
- * <p> Causes a DOMNodeInserted mutation event to be reported. Will
- * first cause a DOMNodeRemoved event to be reported if the newChild
- * parameter already has a parent. If the new child is a document
- * fragment node, both events will be reported for each child of
- * the fragment; the order in which children are removed and inserted
- * is implementation-specific.
- *
- * <p> If this DOM has been compiled without mutation event support,
- * these events will not be reported.
- */
- public Node insertBefore(Node newChild, Node refChild)
- {
- if (refChild == null)
- {
- return appendChild(newChild);
- }
-
- try
- {
- DomNode child = (DomNode) newChild;
- DomNode ref = (DomNode) refChild;
-
- if (child.nodeType == DOCUMENT_FRAGMENT_NODE)
- {
- // Append all nodes in the fragment to this node
- for (DomNode ctx = child.first; ctx != null; ctx = ctx.next)
- {
- checkMisc(ctx);
- }
- for (DomNode ctx = child.first; ctx != null; )
- {
- DomNode ctxNext = ctx.next;
- insertBefore(ctx, ref);
- ctx = ctxNext;
- }
- }
- else
- {
- checkMisc(child);
- if (ref == null || ref.parent != this)
- {
- throw new DomDOMException(DOMException.NOT_FOUND_ERR,
- null, ref, 0);
- }
- if (ref == child)
- {
- throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
- "can't insert node before itself",
- ref, 0);
- }
-
- if (child.parent != null)
- {
- child.parent.removeChild(child);
- }
- child.parent = this;
- int i = ref.index;
- child.setDepth(depth + 1);
- child.next = ref;
- if (ref.previous != null)
- {
- ref.previous.next = child;
- }
- child.previous = ref.previous;
- ref.previous = child;
- if (first == ref)
- {
- first = child;
- }
- // index renumbering
- for (DomNode ctx = child; ctx != null; ctx = ctx.next)
- {
- ctx.index = i++;
- }
-
- if (reportMutations)
- {
- insertionEvent(null, child);
- }
- }
-
- return child;
- }
- catch (ClassCastException e)
- {
- throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
- null, newChild, 0);
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Replaces the specified node in this node's list of children.
- * Document subclasses must override this to test the restrictions
- * that there be only one element and document type child.
- *
- * <p> Causes DOMNodeRemoved and DOMNodeInserted mutation event to be
- * reported. Will cause another DOMNodeRemoved event to be reported if
- * the newChild parameter already has a parent. These events may be
- * delivered in any order, except that the event reporting removal
- * from such an existing parent will always be delivered before the
- * event reporting its re-insertion as a child of some other node.
- * The order in which children are removed and inserted is implementation
- * specific.
- *
- * <p> If your application needs to depend on the in which those removal
- * and insertion events are delivered, don't use this API. Instead,
- * invoke the removeChild and insertBefore methods directly, to guarantee
- * a specific delivery order. Similarly, don't use document fragments,
- * Otherwise your application code may not work on a DOM which implements
- * this method differently.
- *
- * <p> If this DOM has been compiled without mutation event support,
- * these events will not be reported.
- */
- public Node replaceChild(Node newChild, Node refChild)
- {
- try
- {
- DomNode child = (DomNode) newChild;
- DomNode ref = (DomNode) refChild;
-
- DomEvent.DomMutationEvent event = getMutationEvent();
- boolean doFree = (event != null);
-
- if (child.nodeType == DOCUMENT_FRAGMENT_NODE)
- {
- // Append all nodes in the fragment to this node
- for (DomNode ctx = child.first; ctx != null; ctx = ctx.next)
- {
- checkMisc(ctx);
- }
- if (ref == null || ref.parent != this)
- {
- throw new DomDOMException(DOMException.NOT_FOUND_ERR,
- null, ref, 0);
- }
-
- if (reportMutations)
- {
- removalEvent(event, ref);
- }
- length--;
- length += child.length;
-
- if (child.length == 0)
- {
- // Removal
- if (ref.previous != null)
- {
- ref.previous.next = ref.next;
- }
- if (ref.next != null)
- {
- ref.next.previous = ref.previous;
- }
- if (first == ref)
- {
- first = ref.next;
- }
- if (last == ref)
- {
- last = ref.previous;
- }
- }
- else
- {
- int i = ref.index;
- for (DomNode ctx = child.first; ctx != null; ctx = ctx.next)
- {
- // Insertion
- ctx.parent = this;
- ctx.index = i++;
- ctx.setDepth(ref.depth);
- if (ctx == child.first)
- {
- ctx.previous = ref.previous;
- }
- if (ctx == child.last)
- {
- ctx.next = ref.next;
- }
- }
- if (first == ref)
- {
- first = child.first;
- }
- if (last == ref)
- {
- last = child.last;
- }
- }
- }
- else
- {
- checkMisc(child);
- if (ref == null || ref.parent != this)
- {
- throw new DomDOMException(DOMException.NOT_FOUND_ERR,
- null, ref, 0);
- }
-
- if (reportMutations)
- {
- removalEvent(event, ref);
- }
-
- if (child.parent != null)
- {
- child.parent.removeChild(child);
- }
- child.parent = this;
- child.index = ref.index;
- child.setDepth(ref.depth);
- if (ref.previous != null)
- {
- ref.previous.next = child;
- }
- child.previous = ref.previous;
- if (ref.next != null)
- {
- ref.next.previous = child;
- }
- child.next = ref.next;
- if (first == ref)
- {
- first = child;
- }
- if (last == ref)
- {
- last = child;
- }
-
- if (reportMutations)
- {
- insertionEvent(event, child);
- }
- if (doFree)
- {
- freeMutationEvent();
- }
- }
- ref.parent = null;
- ref.index = 0;
- ref.setDepth(0);
- ref.previous = null;
- ref.next = null;
-
- return ref;
- }
- catch (ClassCastException e)
- {
- throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
- null, newChild, 0);
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Removes the specified child from this node's list of children,
- * or else reports an exception.
- *
- * <p> Causes a DOMNodeRemoved mutation event to be reported.
- *
- * <p> If this DOM has been compiled without mutation event support,
- * these events will not be reported.
- */
- public Node removeChild(Node refChild)
- {
- try
- {
- DomNode ref = (DomNode) refChild;
-
- if (ref == null || ref.parent != this)
- {
- throw new DomDOMException(DOMException.NOT_FOUND_ERR,
- null, ref, 0);
- }
- if (readonly && !owner.building)
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
- null, this, 0);
- }
-
- for (DomNode child = first; child != null; child = child.next)
- {
- if (child == ref)
- {
- if (reportMutations)
- {
- removalEvent(null, child);
- }
-
- length--;
- if (ref.previous != null)
- {
- ref.previous.next = ref.next;
- }
- if (ref.next != null)
- {
- ref.next.previous = ref.previous;
- }
- if (first == ref)
- {
- first = ref.next;
- }
- if (last == ref)
- {
- last = ref.previous;
- }
- // renumber indices
- int i = 0;
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- ctx.index = i++;
- }
- ref.parent = null;
- ref.setDepth(0);
- ref.index = 0;
- ref.previous = null;
- ref.next = null;
-
- return ref;
- }
- }
- throw new DomDOMException(DOMException.NOT_FOUND_ERR,
- "that's no child of mine", refChild, 0);
- }
- catch (ClassCastException e)
- {
- throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
- null, refChild, 0);
- }
- }
-
- /**
- * <b>DOM L1 (NodeList)</b>
- * Returns the item with the specified index in this NodeList,
- * else null.
- */
- public Node item(int index)
- {
- DomNode child = first;
- int count = 0;
- while (child != null && count < index)
- {
- child = child.next;
- count++;
- }
- return child;
- }
-
- /**
- * <b>DOM L1 (NodeList)</b>
- * Returns the number of elements in this NodeList.
- * (Note that many interfaces have a "Length" property, not just
- * NodeList, and if a node subtype must implement one of those,
- * it will also need to override getChildNodes.)
- */
- public int getLength()
- {
- return length;
- }
-
- /**
- * Minimize extra space consumed by this node to hold children and event
- * listeners.
- */
- public void trimToSize()
- {
- if (listeners != null && listeners.length != nListeners)
- {
- ListenerRecord[] newKids = new ListenerRecord[length];
- System.arraycopy(listeners, 0, newKids, 0, nListeners);
- listeners = newKids;
- }
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the previous sibling, if one is known.
- */
- public Node getNextSibling()
- {
- return next;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the previous sibling, if one is known.
- */
- public Node getPreviousSibling()
- {
- return previous;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the parent node, if one is known.
- */
- public Node getParentNode()
- {
- return parent;
- }
-
- /**
- * <b>DOM L2</b>
- * Consults the DOM implementation to determine if the requested
- * feature is supported. DocumentType subclasses must override
- * this method, and associate themselves directly with the
- * DOMImplementation node used. (This method relies on being able
- * to access the DOMImplementation from the owner document, but
- * DocumentType nodes can be created without an owner.)
- */
- public boolean isSupported(String feature, String version)
- {
- Document doc = owner;
- DOMImplementation impl = null;
-
- if (doc == null && nodeType == DOCUMENT_NODE)
- {
- doc = (Document) this;
- }
-
- if (doc == null)
- {
- // possible for DocumentType
- throw new IllegalStateException ("unbound ownerDocument");
- }
-
- impl = doc.getImplementation();
- return impl.hasFeature(feature, version);
- }
-
- /**
- * <b>DOM L1 (modified in L2)</b>
- * Returns the owner document. This is only null for Document nodes,
- * and (new in L2) for DocumentType nodes which have not yet been
- * associated with the rest of their document.
- */
- final public Document getOwnerDocument()
- {
- return owner;
- }
-
- /**
- * <b>DOM L1</b>
- * Does nothing; this must be overridden (along with the
- * getNodeValue method) for nodes with a non-null defined value.
- */
- public void setNodeValue(String value)
- {
- }
-
- /**
- * <b>DOM L1</b>
- * Returns null; this must be overridden for nodes types with
- * a defined value, along with the setNodeValue method.
- */
- public String getNodeValue()
- {
- return null;
- }
-
- /** This forces GCJ compatibility.
- * Without this method GCJ is unable to compile to byte code.
- */
- public final short getNodeType()
- {
- return nodeType;
- }
-
- /** This forces GCJ compatibility.
- * Without this method GCJ seems unable to natively compile GNUJAXP.
- */
- public abstract String getNodeName();
-
- /**
- * <b>DOM L2</b>
- * Does nothing; this must be overridden (along with the
- * getPrefix method) for element and attribute nodes.
- */
- public void setPrefix(String prefix)
- {
- }
-
- /**
- * <b>DOM L2</b>
- * Returns null; this must be overridden for element and
- * attribute nodes.
- */
- public String getPrefix()
- {
- return null;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns null; this must be overridden for element and
- * attribute nodes.
- */
- public String getNamespaceURI()
- {
- return null;
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the node name; this must be overridden for element and
- * attribute nodes.
- */
- public String getLocalName()
- {
- return null;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns a clone of this node which optionally includes cloned
- * versions of child nodes. Clones are always mutable, except for
- * entity reference nodes.
- */
- public Node cloneNode(boolean deep)
- {
- DomNode node = (DomNode) clone();
-
- if (deep)
- {
- DomDocument doc = (nodeType == DOCUMENT_NODE) ?
- (DomDocument) node : node.owner;
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- DomNode newChild = (DomNode) ctx.cloneNode(deep);
- newChild.setOwner(doc);
- node.appendChild(newChild);
- }
- }
-
- if (nodeType == ENTITY_REFERENCE_NODE)
- {
- node.makeReadonly();
- }
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, this, node);
- return node;
- }
-
- void notifyUserDataHandlers(short op, Node src, Node dst)
- {
- if (userDataHandlers != null)
- {
- for (Iterator i = userDataHandlers.entrySet().iterator(); i.hasNext(); )
- {
- Map.Entry entry = (Map.Entry) i.next();
- String key = (String) entry.getKey();
- UserDataHandler handler = (UserDataHandler) entry.getValue();
- Object data = userData.get(key);
- handler.handle(op, key, data, src, dst);
- }
- }
- }
-
- /**
- * Clones this node; roughly equivalent to cloneNode(false).
- * Element subclasses must provide a new implementation which
- * invokes this method to handle the basics, and then arranges
- * to clone any element attributes directly. Attribute subclasses
- * must make similar arrangements, ensuring that existing ties to
- * elements are broken by cloning.
- */
- public Object clone()
- {
- try
- {
- DomNode node = (DomNode) super.clone();
-
- node.parent = null;
- node.depth = 0;
- node.index = 0;
- node.length = 0;
- node.first = null;
- node.last = null;
- node.previous = null;
- node.next = null;
-
- node.readonly = false;
- node.listeners = null;
- node.nListeners = 0;
- return node;
-
- }
- catch (CloneNotSupportedException x)
- {
- throw new Error("clone didn't work");
- }
- }
-
- // the elements-by-tagname stuff is needed for both
- // elements and documents ... this is in lieu of a
- // common base class between Node and NodeNS.
-
- /**
- * <b>DOM L1</b>
- * Creates a NodeList giving array-style access to elements with
- * the specified name. Access is fastest if indices change by
- * small values, and the DOM is not modified.
- */
- public NodeList getElementsByTagName(String tag)
- {
- return new ShadowList(null, tag);
- }
-
- /**
- * <b>DOM L2</b>
- * Creates a NodeList giving array-style access to elements with
- * the specified namespace and local name. Access is fastest if
- * indices change by small values, and the DOM is not modified.
- */
- public NodeList getElementsByTagNameNS(String namespace, String local)
- {
- return new ShadowList(namespace, local);
- }
-
-
- //
- // This shadow class is GC-able even when the live list it shadows
- // can't be, because of event registration hookups. Its finalizer
- // makes that live list become GC-able.
- //
- final class ShadowList
- implements NodeList
- {
-
- private LiveNodeList liveList;
-
- ShadowList(String ns, String local)
- {
- liveList = new LiveNodeList(ns, local);
- }
-
- public void finalize()
- {
- liveList.detach();
- liveList = null;
- }
-
- public Node item(int index)
- {
- return liveList.item(index);
- }
-
- public int getLength()
- {
- return liveList.getLength();
- }
- }
-
- final class LiveNodeList
- implements NodeList, EventListener, NodeFilter
- {
-
- private final boolean matchAnyURI;
- private final boolean matchAnyName;
- private final String elementURI;
- private final String elementName;
-
- private DomIterator current;
- private int lastIndex;
-
- LiveNodeList(String uri, String name)
- {
- elementURI = uri;
- elementName = name;
- matchAnyURI = "*".equals(uri);
- matchAnyName = "*".equals(name);
-
- DomNode.this.addEventListener("DOMNodeInserted", this, true);
- DomNode.this.addEventListener("DOMNodeRemoved", this, true);
- }
-
- void detach()
- {
- current.detach();
- current = null;
-
- DomNode.this.removeEventListener("DOMNodeInserted", this, true);
- DomNode.this.removeEventListener("DOMNodeRemoved", this, true);
- }
-
- public short acceptNode(Node element)
- {
- if (element == DomNode.this)
- {
- return FILTER_SKIP;
- }
-
- // use namespace-aware matching ...
- if (elementURI != null)
- {
- if (!(matchAnyURI
- || elementURI.equals(element.getNamespaceURI())))
- {
- return FILTER_SKIP;
- }
- if (!(matchAnyName
- || elementName.equals(element.getLocalName())))
- {
- return FILTER_SKIP;
- }
-
- // ... or qName-based kind.
- }
- else
- {
- if (!(matchAnyName
- || elementName.equals(element.getNodeName())))
- {
- return FILTER_SKIP;
- }
- }
- return FILTER_ACCEPT;
- }
-
- private DomIterator createIterator()
- {
- return new DomIterator(DomNode.this,
- NodeFilter.SHOW_ELEMENT,
- this, /* filter */
- true /* expand entity refs */
- );
- }
-
- public void handleEvent(Event e)
- {
- MutationEvent mutation = (MutationEvent) e;
- Node related = mutation.getRelatedNode();
-
- // XXX if it's got children ... check all kids too, they
- // will invalidate our saved index
-
- if (related.getNodeType() != Node.ELEMENT_NODE ||
- related.getNodeName() != elementName ||
- related.getNamespaceURI() != elementURI)
- {
- return;
- }
-
- current = null;
- }
-
- public Node item(int index)
- {
- if (current == null)
- {
- current = createIterator();
- lastIndex = -1;
- }
-
- // last node or before? go backwards
- if (index <= lastIndex) {
- while (index != lastIndex) {
- current.previousNode ();
- lastIndex--;
- }
- Node ret = current.previousNode ();
- current = null;
- return ret;
- }
-
- // somewhere after last node
- while (++lastIndex != index)
- current.nextNode ();
- Node ret = current.nextNode ();
- current = null;
- return ret;
- }
-
- public int getLength()
- {
- int retval = 0;
- NodeIterator iter = createIterator();
-
- while (iter.nextNode() != null)
- {
- retval++;
- }
- current = null;
- return retval;
- }
-
- }
-
- //
- // EventTarget support
- //
- static final class ListenerRecord
- {
-
- String type;
- EventListener listener;
- boolean useCapture;
-
- // XXX use JDK 1.2 java.lang.ref.WeakReference to listener,
- // and we can both get rid of "shadow" classes and remove
- // the need for applications to apply similar trix ... but
- // JDK 1.2 support isn't generally available yet
-
- ListenerRecord(String type, EventListener listener, boolean useCapture)
- {
- this.type = type.intern();
- this.listener = listener;
- this.useCapture = useCapture;
- }
-
- boolean equals(ListenerRecord rec)
- {
- return listener == rec.listener
- && useCapture == rec.useCapture
- && type == rec.type;
- }
-
- }
-
- /**
- * <b>DOM L2 (Events)</b>
- * Returns an instance of the specified type of event object.
- * Understands about DOM Mutation, HTML, and UI events.
- *
- * <p>If the name of the event type begins with "USER-", then an object
- * implementing the "Event" class will be returned; this provides a
- * limited facility for application-defined events to use the DOM event
- * infrastructure. Alternatively, use one of the standard DOM event
- * classes and initialize it using use such a "USER-" event type name;
- * or defin, instantiate, and initialize an application-specific subclass
- * of DomEvent and pass that to dispatchEvent().
- *
- * @param eventType Identifies the particular DOM feature module
- * defining the type of event, such as "MutationEvents".
- * <em>The event "name" is a different kind of "type".</em>
- */
- public Event createEvent(String eventType)
- {
- eventType = eventType.toLowerCase();
-
- if ("mutationevents".equals(eventType))
- {
- return new DomEvent.DomMutationEvent(null);
- }
-
- if ("htmlevents".equals(eventType)
- || "events".equals(eventType)
- || "user-events".equals(eventType))
- {
- return new DomEvent(null);
- }
-
- if ("uievents".equals(eventType))
- {
- return new DomEvent.DomUIEvent(null);
- }
-
- // mouse events
-
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR,
- eventType, null, 0);
- }
-
- /**
- * <b>DOM L2 (Events)</b>
- * Registers an event listener's interest in a class of events.
- */
- public final void addEventListener(String type,
- EventListener listener,
- boolean useCapture)
- {
- if (listeners == null)
- {
- listeners = new ListenerRecord[1];
- }
- else if (nListeners == listeners.length)
- {
- ListenerRecord[] newListeners =
- new ListenerRecord[listeners.length + NKIDS_DELTA];
- System.arraycopy(listeners, 0, newListeners, 0, nListeners);
- listeners = newListeners;
- }
-
- // prune duplicates
- ListenerRecord record;
-
- record = new ListenerRecord(type, listener, useCapture);
- for (int i = 0; i < nListeners; i++)
- {
- if (record.equals(listeners[i]))
- {
- return;
- }
- }
- listeners [nListeners++] = record;
- }
-
- // XXX this exception should be discarded from DOM
-
- // this class can be instantiated, unlike the one in the spec
- static final class DomEventException
- extends EventException
- {
-
- DomEventException()
- {
- super(UNSPECIFIED_EVENT_TYPE_ERR, "unspecified event type");
- }
-
- }
-
- /**
- * <b>DOM L2 (Events)</b>
- * Delivers an event to all relevant listeners, returning true if the
- * caller should perform their default action. Note that the event
- * must have been provided by the createEvent() method on this
- * class, else it can't be dispatched.
- *
- * @see #createEvent
- *
- * @exception NullPointerException When a null event is passed.
- * @exception ClassCastException When the event wasn't provided by
- * the createEvent method, or otherwise isn't a DomEvent.
- * @exception EventException If the event type wasn't specified
- */
- public final boolean dispatchEvent(Event event)
- throws EventException
- {
- DomEvent e = (DomEvent) event;
- DomNode[] ancestors = null;
- int ancestorMax = 0;
- boolean haveDispatchDataLock = false;
-
- if (e.type == null)
- {
- throw new DomEventException();
- }
-
- e.doDefault = true;
- e.target = this;
-
- //
- // Typical case: one nonrecursive dispatchEvent call at a time
- // for this class. If that's our case, we can avoid allocating
- // garbage, which is overall a big win. Even with advanced GCs
- // that deal well with short-lived garbage, and wayfast allocators,
- // it still helps.
- //
- // Remember -- EVERY mutation goes though here at least once.
- //
- // When populating a DOM tree, trying to send mutation events is
- // the primary cost; this dominates the critical path.
- //
- try
- {
- DomNode current;
- int index;
- boolean haveAncestorRegistrations = false;
- ListenerRecord[] notificationSet;
- int ancestorLen;
-
- synchronized (lockNode)
- {
- if (!dispatchDataLock)
- {
- haveDispatchDataLock = dispatchDataLock = true;
- notificationSet = DomNode.notificationSet;
- ancestors = DomNode.ancestors;
- }
- else
- {
- notificationSet = new ListenerRecord[NOTIFICATIONS_INIT];
- ancestors = new DomNode[ANCESTORS_INIT];
- }
- ancestorLen = ancestors.length;
- }
-
- // XXX autogrow ancestors ... based on statistics
-
- // Climb to the top of this subtree and handle capture, letting
- // each node (from the top down) capture until one stops it or
- // until we get to this one.
-
- for (index = 0, current = parent;
- current != null && index < ancestorLen;
- index++, current = current.parent)
- {
- if (current.nListeners != 0)
- {
- haveAncestorRegistrations = true;
- }
- ancestors [index] = current;
- }
- if (current != null)
- {
- throw new RuntimeException("dispatchEvent capture stack size");
- }
-
- ancestorMax = index;
- e.stop = false;
-
- if (haveAncestorRegistrations)
- {
- e.eventPhase = Event.CAPTURING_PHASE;
- while (!e.stop && index-- > 0)
- {
- current = ancestors [index];
- if (current.nListeners != 0)
- {
- notifyNode(e, current, true, notificationSet);
- }
- }
- }
-
- // Always deliver events to the target node (this)
- // unless stopPropagation was called. If we saw
- // no registrations yet (typical!), we never will.
- if (!e.stop && nListeners != 0)
- {
- e.eventPhase = Event.AT_TARGET;
- notifyNode (e, this, false, notificationSet);
- }
- else if (!haveAncestorRegistrations)
- {
- e.stop = true;
- }
-
- // If the event bubbles and propagation wasn't halted,
- // walk back up the ancestor list. Stop bubbling when
- // any bubbled event handler stops it.
-
- if (!e.stop && e.bubbles)
- {
- e.eventPhase = Event.BUBBLING_PHASE;
- for (index = 0;
- !e.stop
- && index < ancestorMax
- && (current = ancestors[index]) != null;
- index++)
- {
- if (current.nListeners != 0)
- {
- notifyNode(e, current, false, notificationSet);
- }
- }
- }
- e.eventPhase = 0;
-
- // Caller chooses whether to perform the default
- // action based on return from this method.
- return e.doDefault;
-
- }
- finally
- {
- if (haveDispatchDataLock)
- {
- // synchronize to force write ordering
- synchronized (lockNode)
- {
- // null out refs to ensure they'll be GC'd
- for (int i = 0; i < ancestorMax; i++)
- {
- ancestors [i] = null;
- }
- // notificationSet handled by notifyNode
-
- dispatchDataLock = false;
- }
- }
- }
- }
-
- private void notifyNode(DomEvent e,
- DomNode current,
- boolean capture,
- ListenerRecord[] notificationSet)
- {
- int count = 0;
-
- // do any of this set of listeners get notified?
- for (int i = 0; i < current.nListeners; i++)
- {
- ListenerRecord rec = current.listeners[i];
-
- if (rec.useCapture != capture)
- {
- continue;
- }
- if (!e.type.equals (rec.type))
- {
- continue;
- }
- if (count >= notificationSet.length)
- {
- // very simple growth algorithm
- int len = Math.max(notificationSet.length, 1);
- ListenerRecord[] tmp = new ListenerRecord[len * 2];
- System.arraycopy(notificationSet, 0, tmp, 0,
- notificationSet.length);
- notificationSet = tmp;
- }
- notificationSet[count++] = rec;
- }
-
- // Notify just those listeners
- e.currentNode = current;
- for (int i = 0; i < count; i++)
- {
- try
- {
- // Late in the DOM CR process (3rd or 4th CR?) the
- // removeEventListener spec became asymmetric with respect
- // to addEventListener ... effect is now immediate.
- for (int j = 0; j < current.nListeners; j++)
- {
- if (current.listeners[j].equals(notificationSet[i]))
- {
- notificationSet[i].listener.handleEvent(e);
- break;
- }
- }
-
- }
- catch (Exception x)
- {
- // ignore all exceptions
- }
- notificationSet[i] = null; // free for GC
- }
- }
-
- /**
- * <b>DOM L2 (Events)</b>
- * Unregisters an event listener.
- */
- public final void removeEventListener(String type,
- EventListener listener,
- boolean useCapture)
- {
- for (int i = 0; i < nListeners; i++)
- {
- if (listeners[i].listener != listener)
- {
- continue;
- }
- if (listeners[i].useCapture != useCapture)
- {
- continue;
- }
- if (!listeners[i].type.equals(type))
- {
- continue;
- }
-
- if (nListeners == 1)
- {
- listeners = null;
- nListeners = 0;
- }
- else
- {
- for (int j = i + 1; j < nListeners; j++)
- {
- listeners[i++] = listeners[j++];
- }
- listeners[--nListeners] = null;
- }
- break;
- }
- // no exceptions reported
- }
-
- /**
- * <b>DOM L1 (relocated in DOM L2)</b>
- * In this node and all contained nodes (including attributes if
- * relevant) merge adjacent text nodes. This is done while ignoring
- * text which happens to use CDATA delimiters).
- */
- public final void normalize()
- {
- // Suspend readonly status
- boolean saved = readonly;
- readonly = false;
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- switch (ctx.nodeType)
- {
- case TEXT_NODE:
- while (ctx.next != null && ctx.next.nodeType == TEXT_NODE)
- {
- Text text = (Text) ctx;
- text.appendData(ctx.next.getNodeValue());
- removeChild(ctx.next);
- }
- break;
- case ELEMENT_NODE:
- NamedNodeMap attrs = ctx.getAttributes();
- int len = attrs.getLength();
- for (int i = 0; i < len; i++)
- {
- attrs.item(i).normalize();
- }
- // Fall through
- case DOCUMENT_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- case ATTRIBUTE_NODE:
- case ENTITY_REFERENCE_NODE:
- ctx.normalize();
- break;
- }
- }
- readonly = saved;
- }
-
- /**
- * Returns true iff node types match, and either (a) both nodes have no
- * namespace and their getNodeName() values are the same, or (b) both
- * nodes have the same getNamespaceURI() and same getLocalName() values.
- *
- * <p>Note that notion of a "Per-Element-Type" attribute name scope, as
- * found in a non-normative appendix of the XML Namespaces specification,
- * is not supported here. Your application must implement that notion,
- * typically by not bothering to check nameAndTypeEquals for attributes
- * without namespace URIs unless you already know their elements are
- * nameAndTypeEquals.
- */
- public boolean nameAndTypeEquals(Node other)
- {
- if (other == this)
- {
- return true;
- }
- // node types must match
- if (nodeType != other.getNodeType())
- {
- return false;
- }
-
- // if both have namespaces, do a "full" comparision
- // this is a "global" partition
- String ns1 = this.getNamespaceURI();
- String ns2 = other.getNamespaceURI();
-
- if (ns1 != null && ns2 != null)
- {
- return ns1.equals(ns2) &&
- getLocalName().equals(other.getLocalName());
- }
-
- // if neither has a namespace, this is a "no-namespace" name.
- if (ns1 == null && ns2 == null)
- {
- if (!getNodeName().equals(other.getNodeName()))
- {
- return false;
- }
- // can test the non-normative "per-element-type" scope here.
- // if this is an attribute node and both nodes have been bound
- // to elements (!!), then return the nameAndTypeEquals()
- // comparison of those elements.
- return true;
- }
-
- // otherwise they're unequal: one scoped, one not.
- return false;
- }
-
- // DOM Level 3 methods
-
- public String getBaseURI()
- {
- return (parent != null) ? parent.getBaseURI() : null;
- }
-
- public short compareDocumentPosition(Node other)
- throws DOMException
- {
- return (short) compareTo(other);
- }
-
- /**
- * DOM nodes have a natural ordering: document order.
- */
- public final int compareTo(Object other)
- {
- if (other instanceof DomNode)
- {
- DomNode n1 = this;
- DomNode n2 = (DomNode) other;
- if (n1.owner != n2.owner)
- {
- return 0;
- }
- int d1 = n1.depth, d2 = n2.depth;
- int delta = d1 - d2;
- while (d1 > d2)
- {
- n1 = n1.parent;
- d1--;
- }
- while (d2 > d1)
- {
- n2 = n2.parent;
- d2--;
- }
- int c = compareTo2(n1, n2);
- return (c != 0) ? c : delta;
- }
- return 0;
- }
-
- /**
- * Compare two nodes at the same depth.
- */
- final int compareTo2(DomNode n1, DomNode n2)
- {
- if (n1 == n2 || n1.depth == 0 || n2.depth == 0)
- {
- return 0;
- }
- int c = compareTo2(n1.parent, n2.parent);
- return (c != 0) ? c : n1.index - n2.index;
- }
-
- public final String getTextContent()
- throws DOMException
- {
- return getTextContent(true);
- }
-
- final String getTextContent(boolean topLevel)
- throws DOMException
- {
- switch (nodeType)
- {
- case ELEMENT_NODE:
- case ENTITY_NODE:
- case ENTITY_REFERENCE_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- StringBuffer buffer = new StringBuffer();
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- String textContent = ctx.getTextContent(false);
- if (textContent != null)
- {
- buffer.append(textContent);
- }
- }
- return buffer.toString();
- case TEXT_NODE:
- case CDATA_SECTION_NODE:
- if (((Text) this).isElementContentWhitespace())
- {
- return "";
- }
- return getNodeValue();
- case ATTRIBUTE_NODE:
- return getNodeValue();
- case COMMENT_NODE:
- case PROCESSING_INSTRUCTION_NODE:
- return topLevel ? getNodeValue() : "";
- default:
- return null;
- }
- }
-
- public void setTextContent(String textContent)
- throws DOMException
- {
- switch (nodeType)
- {
- case ELEMENT_NODE:
- case ATTRIBUTE_NODE:
- case ENTITY_NODE:
- case ENTITY_REFERENCE_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- for (DomNode ctx = first; ctx != null; )
- {
- DomNode n = ctx.next;
- removeChild(ctx);
- ctx = n;
- }
- if (textContent != null)
- {
- Text text = owner.createTextNode(textContent);
- appendChild(text);
- }
- break;
- case TEXT_NODE:
- case CDATA_SECTION_NODE:
- case COMMENT_NODE:
- case PROCESSING_INSTRUCTION_NODE:
- setNodeValue(textContent);
- break;
- }
- }
-
- public boolean isSameNode(Node other)
- {
- return this == other;
- }
-
- public String lookupPrefix(String namespaceURI)
- {
- return (parent == null || parent == owner) ? null :
- parent.lookupPrefix(namespaceURI);
- }
-
- public boolean isDefaultNamespace(String namespaceURI)
- {
- return (parent == null || parent == owner) ? false :
- parent.isDefaultNamespace(namespaceURI);
- }
-
- public String lookupNamespaceURI(String prefix)
- {
- return (parent == null || parent == owner) ? null :
- parent.lookupNamespaceURI(prefix);
- }
-
- public boolean isEqualNode(Node arg)
- {
- if (this == arg)
- {
- return true;
- }
- if (arg == null)
- {
- return false;
- }
- if (nodeType != arg.getNodeType() ||
- !equal(getNodeName(), arg.getNodeName()) ||
- !equal(getLocalName(), arg.getLocalName()) ||
- !equal(getNamespaceURI(), arg.getNamespaceURI()) ||
- !equal(getPrefix(), arg.getPrefix()) ||
- !equal(getNodeValue(), arg.getNodeValue()))
- {
- return false;
- }
- // Children
- Node argCtx = arg.getFirstChild();
- getFirstChild(); // because of DomAttr lazy children
- for (DomNode ctx = first; ctx != null; ctx = ctx.next)
- {
- if (!ctx.isEqualNode(argCtx))
- {
- return false;
- }
- argCtx = argCtx.getNextSibling();
- }
- if (argCtx != null)
- {
- return false;
- }
-
- // TODO Attr NamedNodeMap
- // TODO DocumentType
- return true;
- }
-
- boolean equal(String arg1, String arg2)
- {
- return ((arg1 == null && arg2 == null) ||
- (arg1 != null && arg1.equals(arg2)));
- }
-
- public Object getFeature(String feature, String version)
- {
- DOMImplementation impl = (nodeType == DOCUMENT_NODE) ?
- ((Document) this).getImplementation() : owner.getImplementation();
- if (impl.hasFeature(feature, version))
- {
- return this;
- }
- return null;
- }
-
- public Object setUserData(String key, Object data, UserDataHandler handler)
- {
- if (userData == null)
- {
- userData = new HashMap();
- }
- if (handler != null)
- {
- if (userDataHandlers == null)
- {
- userDataHandlers = new HashMap();
- }
- userDataHandlers.put(key, handler);
- }
- return userData.put(key, data);
- }
-
- public Object getUserData(String key)
- {
- if (userData == null)
- {
- return null;
- }
- return userData.get(key);
- }
-
- public String toString()
- {
- String nodeName = getNodeName();
- String nodeValue = getNodeValue();
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- if (nodeName != null)
- {
- buf.append(nodeName);
- }
- if (nodeValue != null)
- {
- if (nodeName != null)
- {
- buf.append('=');
- }
- buf.append('\'');
- buf.append(encode(nodeValue));
- buf.append('\'');
- }
- buf.append(']');
- return buf.toString();
- }
-
- String encode(String value)
- {
- StringBuffer buf = null;
- int len = value.length();
- for (int i = 0; i < len; i++)
- {
- char c = value.charAt(i);
- if (c == '\n')
- {
- if (buf == null)
- {
- buf = new StringBuffer(value.substring(0, i));
- }
- buf.append("\\n");
- }
- else if (c == '\r')
- {
- if (buf == null)
- {
- buf = new StringBuffer(value.substring(0, i));
- }
- buf.append("\\r");
- }
- else if (buf != null)
- {
- buf.append(c);
- }
- }
- return (buf != null) ? buf.toString() : value;
- }
-
- String nodeTypeToString(short nodeType)
- {
- switch (nodeType)
- {
- case ELEMENT_NODE:
- return "ELEMENT_NODE";
- case ATTRIBUTE_NODE:
- return "ATTRIBUTE_NODE";
- case TEXT_NODE:
- return "TEXT_NODE";
- case CDATA_SECTION_NODE:
- return "CDATA_SECTION_NODE";
- case DOCUMENT_NODE:
- return "DOCUMENT_NODE";
- case DOCUMENT_TYPE_NODE:
- return "DOCUMENT_TYPE_NODE";
- case COMMENT_NODE:
- return "COMMENT_NODE";
- case PROCESSING_INSTRUCTION_NODE:
- return "PROCESSING_INSTRUCTION_NODE";
- case DOCUMENT_FRAGMENT_NODE:
- return "DOCUMENT_FRAGMENT_NODE";
- case ENTITY_NODE:
- return "ENTITY_NODE";
- case ENTITY_REFERENCE_NODE:
- return "ENTITY_REFERENCE_NODE";
- case NOTATION_NODE:
- return "NOTATION_NODE";
- default:
- return "UNKNOWN";
- }
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomNodeIterator.java b/libjava/gnu/xml/dom/DomNodeIterator.java
deleted file mode 100644
index 6079f7a126a..00000000000
--- a/libjava/gnu/xml/dom/DomNodeIterator.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/* DomNodeIterator.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.traversal.TreeWalker;
-
-/**
- * Node iterator and tree walker.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomNodeIterator
- implements NodeIterator, TreeWalker
-{
-
- Node root;
- final int whatToShow;
- final NodeFilter filter;
- final boolean entityReferenceExpansion;
- final boolean walk;
- Node current;
-
- public DomNodeIterator(Node root, int whatToShow, NodeFilter filter,
- boolean entityReferenceExpansion, boolean walk)
- {
- if (root == null)
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "null root");
- }
- this.root = root;
- this.whatToShow = whatToShow;
- this.filter = filter;
- this.entityReferenceExpansion = entityReferenceExpansion;
- this.walk = walk;
- current = root;
- }
-
- public Node getRoot()
- {
- return root;
- }
-
- public int getWhatToShow()
- {
- return whatToShow;
- }
-
- public NodeFilter getFilter()
- {
- return filter;
- }
-
- public boolean getExpandEntityReferences()
- {
- return entityReferenceExpansion;
- }
-
- public Node nextNode()
- throws DOMException
- {
- if (root == null)
- {
- throw new DOMException(DOMException.INVALID_STATE_ERR, "null root");
- }
- Node ret;
- do
- {
- if (current.equals(root))
- {
- ret = root.getFirstChild();
- }
- else if (walk)
- {
- ret = current.getFirstChild();
- if (ret == null)
- {
- ret = current.getNextSibling();
- }
- if (ret == null)
- {
- Node tmp = current;
- ret = tmp.getParentNode();
- while (!ret.equals(root) && tmp.equals(ret.getLastChild()))
- {
- tmp = ret;
- ret = tmp.getParentNode();
- }
- if (ret.equals(root))
- {
- ret = null;
- }
- else
- {
- ret = ret.getNextSibling();
- }
- }
- }
- else
- {
- ret = current.getNextSibling();
- }
- }
- while (!accept(ret));
- current = (ret == null) ? current : ret;
- return ret;
- }
-
- public Node previousNode()
- throws DOMException
- {
- if (root == null)
- {
- throw new DOMException(DOMException.INVALID_STATE_ERR, "null root");
- }
- Node ret;
- do
- {
- if (current.equals(root))
- {
- ret = current.getLastChild();
- }
- else if (walk)
- {
- ret = current.getLastChild();
- if (ret == null)
- {
- ret = current.getPreviousSibling();
- }
- if (ret == null)
- {
- Node tmp = current;
- ret = tmp.getParentNode();
- while (!ret.equals(root) && tmp.equals(ret.getFirstChild()))
- {
- tmp = ret;
- ret = tmp.getParentNode();
- }
- if (ret.equals(root))
- {
- ret = null;
- }
- else
- {
- ret = ret.getPreviousSibling();
- }
- }
- }
- else
- {
- ret = current.getPreviousSibling();
- }
- }
- while (!accept(ret));
- current = (ret == null) ? current : ret;
- return ret;
- }
-
- public Node getCurrentNode()
- {
- return current;
- }
-
- public void setCurrentNode(Node current)
- throws DOMException
- {
- if (current == null)
- {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "null root");
- }
- this.current = current;
- }
-
- public Node parentNode()
- {
- Node ret = current.getParentNode();
- if (!accept (ret))
- {
- ret = null;
- }
- current = (ret == null) ? current : ret;
- return ret;
- }
-
- public Node firstChild ()
- {
- Node ret = current.getFirstChild();
- while (!accept(ret))
- {
- ret = ret.getNextSibling();
- }
- current = (ret == null) ? current : ret;
- return ret;
- }
-
- public Node lastChild()
- {
- Node ret = current.getLastChild();
- while (!accept(ret))
- {
- ret = ret.getPreviousSibling();
- }
- current = (ret == null) ? current : ret;
- return ret;
- }
-
- public Node previousSibling()
- {
- Node ret = current.getPreviousSibling();
- while (!accept(ret))
- {
- ret = ret.getPreviousSibling();
- }
- current = (ret == null) ? current : ret;
- return ret;
- }
-
- public Node nextSibling()
- {
- Node ret = current.getNextSibling();
- while (!accept(ret))
- {
- ret = ret.getNextSibling();
- }
- current = (ret == null) ? current : ret;
- return ret;
- }
-
- public void detach()
- {
- root = null;
- }
-
- boolean accept(Node node)
- {
- if (node == null)
- {
- return true;
- }
- boolean ret;
- switch (node.getNodeType())
- {
- case Node.ATTRIBUTE_NODE:
- ret = (whatToShow & NodeFilter.SHOW_ATTRIBUTE) != 0;
- break;
- case Node.CDATA_SECTION_NODE:
- ret = (whatToShow & NodeFilter.SHOW_CDATA_SECTION) != 0;
- break;
- case Node.COMMENT_NODE:
- ret = (whatToShow & NodeFilter.SHOW_COMMENT) != 0;
- break;
- case Node.DOCUMENT_NODE:
- ret = (whatToShow & NodeFilter.SHOW_DOCUMENT) != 0;
- break;
- case Node.DOCUMENT_FRAGMENT_NODE:
- ret = (whatToShow & NodeFilter.SHOW_DOCUMENT_FRAGMENT) != 0;
- break;
- case Node.DOCUMENT_TYPE_NODE:
- ret = (whatToShow & NodeFilter.SHOW_DOCUMENT_TYPE) != 0;
- break;
- case Node.ELEMENT_NODE:
- ret = (whatToShow & NodeFilter.SHOW_ELEMENT) != 0;
- break;
- case Node.ENTITY_NODE:
- ret = (whatToShow & NodeFilter.SHOW_ENTITY) != 0;
- break;
- case Node.ENTITY_REFERENCE_NODE:
- ret = (whatToShow & NodeFilter.SHOW_ENTITY_REFERENCE) != 0;
- ret = ret && entityReferenceExpansion;
- break;
- case Node.NOTATION_NODE:
- ret = (whatToShow & NodeFilter.SHOW_NOTATION) != 0;
- break;
- case Node.PROCESSING_INSTRUCTION_NODE:
- ret = (whatToShow & NodeFilter.SHOW_PROCESSING_INSTRUCTION) != 0;
- break;
- case Node.TEXT_NODE:
- ret = (whatToShow & NodeFilter.SHOW_TEXT) != 0;
- break;
- default:
- ret = true;
- }
- if (ret && filter != null)
- {
- ret = (filter.acceptNode(node) == NodeFilter.FILTER_ACCEPT);
- }
- return ret;
- }
-
-}
diff --git a/libjava/gnu/xml/dom/DomNotation.java b/libjava/gnu/xml/dom/DomNotation.java
deleted file mode 100644
index 26e78724f27..00000000000
--- a/libjava/gnu/xml/dom/DomNotation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* DomNotation.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Notation;
-
-/**
- * <p> "Notation" implementation. This is a non-core DOM class, supporting
- * the "XML" feature. </p>
- *
- * <p> Although unparsed entities using this notation can be detected using
- * DOM, neither NOTATIONS nor ENTITY/ENTITIES attributes can be so detected.
- * More, there is no portable way to construct a Notation node, so there's
- * no way that vendor-neutral DOM construction APIs could even report a
- * NOTATION used to identify the intended meaning of a ProcessingInstruction.
- * </p>
- *
- * <p> In short, <em>avoid using this DOM functionality</em>.
- *
- * @see DomDoctype
- * @see DomEntity
- * @see DomPI
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomNotation
- extends DomExtern
- implements Notation
-{
-
- /**
- * Constructs a Notation node associated with the specified document,
- * with the specified descriptive data. Note that at least one of
- * the PUBLIC and SYSTEM identifiers must be provided; unlike other
- * external objects in XML, notations may have only a PUBLIC identifier.
- *
- * <p>This constructor should only be invoked by a DomDoctype object
- * as part of its declareNotation functionality, or through a subclass
- * which is similarly used in a "Sub-DOM" style layer.
- *
- * @param owner The document with which this notation is associated
- * @param name Name of this notation
- * @param publicId If non-null, provides the notation's PUBLIC identifier
- * @param systemId If non-null, rovides the notation's SYSTEM identifier
- */
- protected DomNotation(DomDocument owner,
- String name,
- String publicId,
- String systemId)
- {
- super(NOTATION_NODE, owner, name, publicId, systemId);
- makeReadonly();
- }
-
- /**
- * The base URI of an external entity is its system ID.
- * The base URI of an internal entity is the parent document's base URI.
- * @since DOM Level 3 Core
- */
- public String getBaseURI()
- {
- String systemId = getSystemId();
- return (systemId == null) ? owner.getBaseURI() : systemId;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomNsNode.java b/libjava/gnu/xml/dom/DomNsNode.java
deleted file mode 100644
index 4dec5af21d7..00000000000
--- a/libjava/gnu/xml/dom/DomNsNode.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/* DomNsNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.xml.XMLConstants;
-import org.w3c.dom.DOMException;
-
-/**
- * <p> Abstract implemention of namespace support. This facilitates
- * sharing code for attribute and element nodes.
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public abstract class DomNsNode
- extends DomNode
-{
-
- private String name;
- private String namespace;
- private String prefix;
- private String localName;
-
- /**
- * Constructs a node associated with the specified document, and
- * with the specified namespace information.
- *
- * @param owner The document with which this entity is associated
- * @param namespaceURI Combined with the local part of the name,
- * this identifies a type of element or attribute; may be null.
- * If this is the empty string, it is reassigned as null so that
- * applications only need to test that case.
- * @param name Name of this node, which may include a prefix
- */
- // package private
- DomNsNode(short nodeType, DomDocument owner, String namespaceURI, String name)
- {
- super(nodeType, owner);
- setNodeName(name);
- setNamespaceURI(namespaceURI);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the node's name, including any namespace prefix.
- */
- public final String getNodeName()
- {
- return name;
- }
-
- final void setNodeName(String name)
- {
- this.name = name.intern();
- int index = name.indexOf(':');
- if (index == -1)
- {
- prefix = null;
- localName = this.name;
- }
- else
- {
- prefix = name.substring(0, index).intern();
- localName = name.substring(index + 1).intern();
- }
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the node's namespace URI
- * <em>or null</em> if the node name is not namespace scoped.
- */
- public final String getNamespaceURI()
- {
- return namespace;
- }
-
- final void setNamespaceURI(String namespaceURI)
- {
- if ("".equals(namespaceURI))
- {
- namespaceURI = null;
- }
- namespace = (namespaceURI == null) ? null : namespaceURI.intern();
- }
-
- /**
- * <b>DOM L2</b>
- * Returns any prefix part of the node's name (before any colon).
- */
- public final String getPrefix()
- {
- return prefix;
- }
-
- /**
- * <b>DOM L2</b>
- * Assigns the prefix part of the node's name (before any colon).
- */
- public final void setPrefix(String prefix)
- {
- if (readonly)
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- if (prefix == null)
- {
- name = localName;
- return;
- }
- else if (namespace == null)
- {
- 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 DomDOMException(DOMException.NAMESPACE_ERR,
- "illegal prefix " + prefix, this, 0);
- }
-
- if (XMLConstants.XML_NS_PREFIX.equals(prefix)
- && !XMLConstants.XML_NS_URI.equals(namespace))
- {
- 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 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 DomDOMException(DOMException.NAMESPACE_ERR,
- "namespace declarations can't change names",
- this, 0);
- }
-
- this.prefix = prefix.intern();
- }
-
- /**
- * <b>DOM L2</b>
- * Returns the local part of the node's name (after any colon).
- */
- public final String getLocalName()
- {
- return localName;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomProcessingInstruction.java b/libjava/gnu/xml/dom/DomProcessingInstruction.java
deleted file mode 100644
index 2c90967d00f..00000000000
--- a/libjava/gnu/xml/dom/DomProcessingInstruction.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * <p> "ProcessingInstruction" (PI) implementation.
- * This is a non-core DOM class, supporting the "XML" feature. </p>
- *
- * <p> 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.</p>
- *
- * <p> Also of note is that PI support is part of SAX, so that XML
- * systems using PIs can choose among multiple APIs. </p>
- *
- * @see DomNotation
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-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.
- *
- * <p>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;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the target of the processing instruction.
- */
- public final String getTarget()
- {
- return target;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the target of the processing instruction
- * (same as getTarget).
- */
- public final String getNodeName()
- {
- return target;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the data associated with the processing instruction.
- */
- public final String getData()
- {
- return data;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the data associated with the processing instruction
- * (same as getData).
- */
- public final String getNodeValue()
- {
- return data;
- }
-
- /**
- * <b>DOM L1</b>
- * Assigns the data associated with the processing instruction;
- * same as setNodeValue.
- */
- public final void setData(String data)
- {
- setNodeValue(data);
- }
-
- /**
- * <b>DOM L1</b>
- * 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;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomText.java b/libjava/gnu/xml/dom/DomText.java
deleted file mode 100644
index 3ca17dc9b87..00000000000
--- a/libjava/gnu/xml/dom/DomText.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/* DomText.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Text;
-
-/**
- * <p> "Text" implementation. </p>
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomText
- extends DomCharacterData
- implements Text
-{
-
- // NOTE: deleted unused per-instance "isIgnorable"
- // support to reclaim its space.
-
- /**
- * Constructs a text node associated with the specified
- * document and holding the specified data.
- *
- * <p>This constructor should only be invoked by a Document object
- * as part of its createTextNode functionality, or through a subclass
- * which is similarly used in a "Sub-DOM" style layer.
- */
- protected DomText(DomDocument owner, String value)
- {
- super(TEXT_NODE, owner, value);
- }
-
- protected DomText(DomDocument owner, char[] buf, int off, int len)
- {
- super(TEXT_NODE, owner, buf, off, len);
- }
-
- // Used by DomCDATA
- DomText(short nodeType, DomDocument owner, String value)
- {
- super(nodeType, owner, value);
- }
-
- DomText(short nodeType, DomDocument owner, char[] buf, int off, int len)
- {
- super(nodeType, owner, buf, off, len);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the string "#text".
- */
- // can't be 'final' with CDATA subclassing
- public String getNodeName()
- {
- return "#text";
- }
-
- /**
- * <b>DOM L1</b>
- * Splits this text node in two parts at the offset, returning
- * the new text node (the sibling with the second part).
- */
- public Text splitText(int offset)
- {
- if (isReadonly())
- {
- throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
- try
- {
- String text = getNodeValue();
- String before = text.substring(0, offset);
- String after = text.substring(offset);
- Text next;
-
- if (getNodeType() == TEXT_NODE)
- {
- next = owner.createTextNode(after);
- }
- else // CDATA_SECTION_NODE
- {
- next = owner.createCDATASection(after);
- }
-
- if (this.next != null)
- {
- parent.insertBefore(next, this.next);
- }
- else
- {
- parent.appendChild(next);
- }
- setNodeValue(before);
- return next;
-
- }
- catch (IndexOutOfBoundsException x)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- }
-
- // DOM Level 3
-
- public boolean isElementContentWhitespace()
- {
- if (parent != null)
- {
- DomDoctype doctype = (DomDoctype) owner.getDoctype();
- if (doctype != null)
- {
- DTDElementTypeInfo info =
- doctype.getElementTypeInfo(parent.getNodeName());
- if (info != null)
- {
- if (info.model == null && info.model.indexOf("#PCDATA") != -1)
- {
- return false;
- }
- return getNodeValue().trim().length() == 0;
- }
- }
- }
- return false;
- }
-
- public String getWholeText()
- {
- DomNode ref = this;
- DomNode ctx;
- for (ctx = previous; ctx != null &&
- (ctx.nodeType == TEXT_NODE || ctx.nodeType == CDATA_SECTION_NODE);
- ctx = ctx.previous)
- {
- ref = ctx;
- }
- StringBuffer buf = new StringBuffer(ref.getNodeValue());
- for (ctx = ref.next; ctx != null &&
- (ctx.nodeType == TEXT_NODE || ctx.nodeType == CDATA_SECTION_NODE);
- ctx = ctx.next)
- {
- buf.append(ctx.getNodeValue());
- }
- return buf.toString ();
- }
-
- public Text replaceWholeText(String content)
- throws DOMException
- {
- boolean isEmpty = (content == null || content.length () == 0);
- if (!isEmpty)
- {
- setNodeValue(content);
- }
-
- DomNode ref = this;
- DomNode ctx;
- for (ctx = previous; ctx != null &&
- (ctx.nodeType == TEXT_NODE || ctx.nodeType == CDATA_SECTION_NODE);
- ctx = ctx.previous)
- {
- ref = ctx;
- }
- ctx = ref.next;
- if ((isEmpty || ref != this) && parent != null)
- {
- parent.removeChild(ref);
- }
- for (; ctx != null &&
- (ctx.nodeType == TEXT_NODE || ctx.nodeType == CDATA_SECTION_NODE);
- ctx = ref)
- {
- ref = ctx.next;
- if ((isEmpty || ctx != this) && parent != null)
- {
- parent.removeChild(ctx);
- }
- }
- return (isEmpty) ? null : this;
- }
-
-}
diff --git a/libjava/gnu/xml/dom/DomXPathExpression.java b/libjava/gnu/xml/dom/DomXPathExpression.java
deleted file mode 100644
index 25187520c0f..00000000000
--- a/libjava/gnu/xml/dom/DomXPathExpression.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/* DomXPathExpression.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-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;
-import gnu.xml.xpath.DocumentOrderComparator;
-
-/**
- * An XPath expression.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class DomXPathExpression
-implements org.w3c.dom.xpath.XPathExpression
-{
-
- final DomDocument doc;
- final XPathExpression expression;
- final XPathNSResolver resolver;
-
- DomXPathExpression(DomDocument doc, String expression,
- XPathNSResolver resolver)
- throws XPathException
- {
- this.doc = doc;
- this.resolver = resolver;
-
- XPathFactory factory = XPathFactory.newInstance();
- XPath xpath = factory.newXPath();
- if (resolver != null)
- {
- xpath.setNamespaceContext(new DomNSResolverContext(resolver));
- }
- try
- {
- this.expression = xpath.compile(expression);
- }
- catch (XPathExpressionException e)
- {
- throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
- e.getMessage ());
- }
- }
-
- public Object evaluate(Node contextNode, short type, Object result)
- throws XPathException, DOMException
- {
- try
- {
- QName typeName = null;
- switch (type)
- {
- case XPathResult.BOOLEAN_TYPE:
- typeName = XPathConstants.BOOLEAN;
- break;
- case XPathResult.NUMBER_TYPE:
- typeName = XPathConstants.NUMBER;
- break;
- case XPathResult.STRING_TYPE:
- typeName = XPathConstants.STRING;
- break;
- case XPathResult.ANY_UNORDERED_NODE_TYPE:
- case XPathResult.FIRST_ORDERED_NODE_TYPE:
- typeName = XPathConstants.NODE;
- break;
- case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:
- case XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:
- case XPathResult.ORDERED_NODE_ITERATOR_TYPE:
- case XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:
- typeName = XPathConstants.NODESET;
- break;
- default:
- throw new XPathException(XPathException.TYPE_ERR, null);
- }
- Object val = expression.evaluate(contextNode, typeName);
- switch (type)
- {
- case XPathResult.ORDERED_NODE_ITERATOR_TYPE:
- case XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:
- // Sort the nodes
- List ns = new ArrayList((Collection) val);
- Collections.sort(ns, new DocumentOrderComparator());
- val = ns;
- }
- return new DomXPathResult(val, type);
- }
- catch (javax.xml.xpath.XPathException e)
- {
- throw new XPathException(XPathException.TYPE_ERR, e.getMessage());
- }
- }
-
- public String toString ()
- {
- return getClass ().getName () + "[expression=" + expression + "]";
- }
-
-}
diff --git a/libjava/gnu/xml/dom/DomXPathNSResolver.java b/libjava/gnu/xml/dom/DomXPathNSResolver.java
deleted file mode 100644
index 96dfd97d46a..00000000000
--- a/libjava/gnu/xml/dom/DomXPathNSResolver.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* DomXPathNSResolver.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Node;
-import org.w3c.dom.xpath.XPathNSResolver;
-
-/**
- * Generic XPath namespace resolver using a DOM Node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class DomXPathNSResolver
-implements XPathNSResolver
-{
-
- Node node;
-
- DomXPathNSResolver (Node node)
- {
- this.node = node;
- }
-
- public String lookupNamespaceURI (String prefix)
- {
- return node.lookupNamespaceURI (prefix);
- }
-
-}
diff --git a/libjava/gnu/xml/dom/DomXPathResult.java b/libjava/gnu/xml/dom/DomXPathResult.java
deleted file mode 100644
index bed249624f9..00000000000
--- a/libjava/gnu/xml/dom/DomXPathResult.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/* DomXPathResult.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.Collection;
-import java.util.Iterator;
-import org.w3c.dom.Node;
-import org.w3c.dom.xpath.XPathException;
-import org.w3c.dom.xpath.XPathResult;
-
-/**
- * An XPath result object.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class DomXPathResult
-implements XPathResult
-{
-
- final Object value;
- final short type;
- Iterator iterator;
-
- DomXPathResult (Object value, short requestedType)
- {
- this.value = value;
- if (value instanceof Boolean)
- {
- type = XPathResult.BOOLEAN_TYPE;
- }
- else if (value instanceof Double)
- {
- type = XPathResult.NUMBER_TYPE;
- }
- else if (value instanceof String)
- {
- type = XPathResult.STRING_TYPE;
- }
- else if (value instanceof Collection)
- {
- Collection ns = (Collection) value;
- switch (requestedType)
- {
- case XPathResult.ANY_TYPE:
- case XPathResult.ANY_UNORDERED_NODE_TYPE:
- type = (ns.size () == 1) ? XPathResult.FIRST_ORDERED_NODE_TYPE :
- XPathResult.ORDERED_NODE_ITERATOR_TYPE;
- break;
- default:
- type = requestedType;
- }
- iterator = ns.iterator ();
- }
- else
- {
- throw new IllegalArgumentException ();
- }
- }
-
- public boolean getBooleanValue()
- {
- if (type == XPathResult.BOOLEAN_TYPE)
- {
- return ((Boolean) value).booleanValue ();
- }
- throw new XPathException (XPathException.TYPE_ERR, value.toString ());
- }
-
- public boolean getInvalidIteratorState()
- {
- return iterator == null;
- }
-
- public double getNumberValue()
- {
- if (type == XPathResult.NUMBER_TYPE)
- {
- return ((Double) value).doubleValue ();
- }
- throw new XPathException (XPathException.TYPE_ERR, value.toString ());
- }
-
- public short getResultType()
- {
- return type;
- }
-
- public Node getSingleNodeValue()
- {
- switch (type)
- {
- case XPathResult.FIRST_ORDERED_NODE_TYPE:
- case XPathResult.ORDERED_NODE_ITERATOR_TYPE:
- case XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:
- case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:
- case XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:
- Collection ns = (Collection) value;
- if (ns.isEmpty ())
- {
- return null;
- }
- else
- {
- return (Node) ns.iterator ().next ();
- }
- }
- throw new XPathException (XPathException.TYPE_ERR, value.toString ());
- }
-
- public int getSnapshotLength()
- {
- switch (type)
- {
- case XPathResult.FIRST_ORDERED_NODE_TYPE:
- case XPathResult.ORDERED_NODE_ITERATOR_TYPE:
- case XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:
- case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:
- case XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:
- return ((Collection) value).size ();
- }
- throw new XPathException (XPathException.TYPE_ERR, value.toString ());
- }
-
- public String getStringValue()
- {
- if (type == XPathResult.STRING_TYPE)
- {
- return (String) value;
- }
- throw new XPathException (XPathException.TYPE_ERR, value.toString ());
- }
-
- public Node iterateNext()
- {
- if (iterator != null)
- {
- if (iterator.hasNext ())
- {
- return (Node) iterator.next ();
- }
- else
- {
- iterator = null;
- return null;
- }
- }
- throw new XPathException (XPathException.TYPE_ERR, value.toString ());
- }
-
- public Node snapshotItem(int index)
- {
- switch (type)
- {
- case XPathResult.FIRST_ORDERED_NODE_TYPE:
- case XPathResult.ORDERED_NODE_ITERATOR_TYPE:
- case XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:
- case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:
- case XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:
- Collection ns = (Collection) value;
- Node[] nodes = new Node[ns.size ()];
- ns.toArray (nodes);
- return nodes[index];
- }
- throw new XPathException (XPathException.TYPE_ERR, value.toString ());
- }
-
- public String toString ()
- {
- return getClass ().getName () + "[type=" + typeName (type) + ",value=" +
- value + ']';
- }
-
- private String typeName (short type)
- {
- switch (type)
- {
- case XPathResult.BOOLEAN_TYPE:
- return "BOOLEAN_TYPE";
- case XPathResult.NUMBER_TYPE:
- return "NUMBER_TYPE";
- case XPathResult.STRING_TYPE:
- return "STRING_TYPE";
- case XPathResult.FIRST_ORDERED_NODE_TYPE:
- return "FIRST_ORDERED_NODE_TYPE";
- case XPathResult.ORDERED_NODE_ITERATOR_TYPE:
- return "ORDERED_NODE_ITERATOR_TYPE";
- case XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:
- return "ORDERED_NODE_SNAPSHOT_TYPE";
- case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:
- return "UNORDERED_NODE_ITERATOR_TYPE";
- case XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:
- return "UNORDERED_NODE_SNAPSHOT_TYPE";
- default:
- return "(unknown)";
- }
- }
-
-}
diff --git a/libjava/gnu/xml/dom/ImplementationList.java b/libjava/gnu/xml/dom/ImplementationList.java
deleted file mode 100644
index 8c0f4491610..00000000000
--- a/libjava/gnu/xml/dom/ImplementationList.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ImplementationList.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.List;
-
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.DOMImplementationList;
-
-/**
- * Implementation list for GNU JAXP.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class ImplementationList
- implements DOMImplementationList
-{
-
- private List list;
-
- ImplementationList(List list)
- {
- this.list = list;
- }
-
- public int getLength()
- {
- return list.size();
- }
-
- public DOMImplementation item(int index)
- {
- return (DOMImplementation) list.get(index);
- }
-
-}
diff --git a/libjava/gnu/xml/dom/ImplementationSource.java b/libjava/gnu/xml/dom/ImplementationSource.java
deleted file mode 100644
index 913079cd0c3..00000000000
--- a/libjava/gnu/xml/dom/ImplementationSource.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/* ImplementationSource.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.DOMImplementationList;
-import org.w3c.dom.DOMImplementationSource;
-
-/**
- * Implementation source for GNU JAXP.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class ImplementationSource
- implements DOMImplementationSource
-{
-
- private static final String DIGITS = "1234567890";
-
- /*
- * GNU DOM implementations.
- */
- private static final DOMImplementation[] implementations;
-
- static
- {
- List acc = new ArrayList();
- acc.add(new gnu.xml.dom.DomImpl());
- try
- {
- Class t = Class.forName("gnu.xml.libxmlj.dom.GnomeDocumentBuilder");
- acc.add(t.newInstance());
- }
- catch (Exception e)
- {
- // libxmlj not available
- }
- catch (UnsatisfiedLinkError e)
- {
- // libxmlj not available
- }
- implementations = new DOMImplementation[acc.size()];
- acc.toArray(implementations);
- }
-
- public DOMImplementation getDOMImplementation(String features)
- {
- List available = getImplementations(features);
- if (available.isEmpty())
- {
- return null;
- }
- return (DOMImplementation) available.get(0);
- }
-
- public DOMImplementationList getDOMImplementationList(String features)
- {
- List available = getImplementations(features);
- return new ImplementationList(available);
- }
-
- /**
- * Returns a list of the implementations that support the specified
- * features.
- */
- private final List getImplementations(String features)
- {
- List available = new ArrayList(Arrays.asList(implementations));
- for (Iterator i = parseFeatures(features).iterator(); i.hasNext(); )
- {
- String feature = (String) i.next();
- String version = null;
- int si = feature.indexOf(' ');
- if (si != -1)
- {
- version = feature.substring(si + 1);
- feature = feature.substring(0, si);
- }
- for (Iterator j = available.iterator(); j.hasNext(); )
- {
- DOMImplementation impl = (DOMImplementation) j.next();
- if (!impl.hasFeature(feature, version))
- {
- j.remove();
- }
- }
- }
- return available;
- }
-
- /**
- * Parses the feature list into feature tokens.
- */
- final List parseFeatures(String features)
- {
- List list = new ArrayList();
- int pos = 0, start = 0;
- int len = features.length();
- for (; pos < len; pos++)
- {
- char c = features.charAt(pos);
- if (c == ' ')
- {
- if (pos + 1 < len &&
- DIGITS.indexOf(features.charAt(pos + 1)) == -1)
- {
- list.add(getFeature(features, start, pos));
- start = pos + 1;
- }
- }
- }
- if (pos > start)
- {
- list.add(getFeature(features, start, len));
- }
- return list;
- }
-
- final String getFeature(String features, int start, int end)
- {
- if (features.length() > 0 && features.charAt(start) == '+')
- {
- return features.substring(start + 1, end);
- }
- return features.substring(start, end);
- }
-
-}
diff --git a/libjava/gnu/xml/dom/JAXPFactory.java b/libjava/gnu/xml/dom/JAXPFactory.java
deleted file mode 100644
index 8f481fad643..00000000000
--- a/libjava/gnu/xml/dom/JAXPFactory.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/* JAXPFactory.java --
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io.IOException;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMImplementation;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-
-
-/**
- * DOM bootstrapping API, for use with JAXP.
- *
- * @see Consumer
- *
- * @author David Brownell
- */
-public final class JAXPFactory
- extends DocumentBuilderFactory
-{
-
- private static final String PROPERTY = "http://xml.org/sax/properties/";
- private static final String FEATURE = "http://xml.org/sax/features/";
-
- private SAXParserFactory pf;
-
- /**
- * Default constructor.
- */
- public JAXPFactory()
- {
- }
-
- /**
- * Constructs a JAXP document builder which uses the default
- * JAXP SAX2 parser and the DOM implementation in this package.
- */
- public DocumentBuilder newDocumentBuilder()
- throws ParserConfigurationException
- {
- if (pf == null)
- {
- // Force use of AElfred2 since not all JAXP parsers
- // conform very well to the SAX2 API spec ...
- pf = new gnu.xml.aelfred2.JAXPFactory();
- // pf = SAXParserFactory.newInstance ();
- }
-
- // JAXP default: false
- pf.setValidating(isValidating());
-
- // FIXME: this namespace setup may cause errors in some
- // conformant SAX2 parsers, which we CAN patch up by
- // splicing a "NSFilter" stage up front ...
-
- // JAXP default: false
- pf.setNamespaceAware(isNamespaceAware());
-
- try
- {
- // undo rude "namespace-prefixes=false" default
- pf.setFeature(FEATURE + "namespace-prefixes", true);
-
- return new JAXPBuilder(pf.newSAXParser().getXMLReader(), this);
- }
- catch (SAXException e)
- {
- String msg = "can't create JAXP DocumentBuilder: " + e.getMessage();
- throw new ParserConfigurationException(msg);
- }
- }
-
- /** There seems to be no useful specification for attribute names */
- public void setAttribute(String name, Object value)
- throws IllegalArgumentException
- {
- if ("http://java.sun.com/xml/jaxp/properties/schemaLanguage".equals(name))
- {
- // TODO
- }
- else
- {
- throw new IllegalArgumentException(name);
- }
- }
-
- /** There seems to be no useful specification for attribute names */
- public Object getAttribute(String name)
- throws IllegalArgumentException
- {
- throw new IllegalArgumentException(name);
- }
-
- static final class JAXPBuilder
- extends DocumentBuilder
- implements ErrorHandler
- {
-
- private Consumer consumer;
- private XMLReader producer;
- private DomImpl impl;
-
- JAXPBuilder(XMLReader parser, JAXPFactory factory)
- throws ParserConfigurationException
- {
- impl = new DomImpl();
-
- // set up consumer side
- try
- {
- consumer = new Consumer();
- }
- catch (SAXException e)
- {
- throw new ParserConfigurationException(e.getMessage());
- }
-
- // JAXP defaults: true, noise nodes are good (bleech)
- consumer.setHidingReferences(factory.isExpandEntityReferences());
- consumer.setHidingComments(factory.isIgnoringComments());
- consumer.setHidingWhitespace(factory.isIgnoringElementContentWhitespace());
- consumer.setHidingCDATA(factory.isCoalescing());
-
- // set up producer side
- producer = parser;
- producer.setContentHandler(consumer.getContentHandler());
- producer.setDTDHandler(consumer.getDTDHandler());
-
- try
- {
- String id;
-
- // if validating, report validity errors, and default
- // to treating them as fatal
- if (factory.isValidating ())
- {
- producer.setFeature(FEATURE + "validation", true);
- producer.setErrorHandler(this);
- }
-
- // always save prefix info, maybe do namespace processing
- producer.setFeature(FEATURE + "namespace-prefixes", true);
- producer.setFeature(FEATURE + "namespaces",
- factory.isNamespaceAware());
-
- // set important handlers
- id = PROPERTY + "lexical-handler";
- producer.setProperty(id, consumer.getProperty(id));
-
- id = PROPERTY + "declaration-handler";
- producer.setProperty(id, consumer.getProperty(id));
-
- }
- catch (SAXException e)
- {
- throw new ParserConfigurationException(e.getMessage());
- }
- }
-
- public Document parse(InputSource source)
- throws SAXException, IOException
- {
- producer.parse(source);
- Document doc = consumer.getDocument();
- // TODO inputEncoding
- doc.setDocumentURI(source.getSystemId());
- return doc;
- }
-
- public boolean isNamespaceAware()
- {
- try
- {
- return producer.getFeature(FEATURE + "namespaces");
- }
- catch (SAXException e)
- {
- // "can't happen"
- throw new RuntimeException(e.getMessage());
- }
- }
-
- public boolean isValidating()
- {
- try
- {
- return producer.getFeature(FEATURE + "validation");
- }
- catch (SAXException e)
- {
- // "can't happen"
- throw new RuntimeException(e.getMessage());
- }
- }
-
- public void setEntityResolver(EntityResolver resolver)
- {
- producer.setEntityResolver(resolver);
- }
-
- public void setErrorHandler(ErrorHandler handler)
- {
- producer.setErrorHandler(handler);
- consumer.setErrorHandler(handler);
- }
-
- public DOMImplementation getDOMImplementation()
- {
- return impl;
- }
-
- public Document newDocument()
- {
- return new DomDocument();
- }
-
- // implementation of error handler that's used when validating
- public void fatalError(SAXParseException e)
- throws SAXException
- {
- throw e;
- }
-
- public void error(SAXParseException e)
- throws SAXException
- {
- throw e;
- }
-
- public void warning(SAXParseException e)
- throws SAXException
- {
- /* ignore */
- }
-
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLAnchorElement.java b/libjava/gnu/xml/dom/html2/DomHTMLAnchorElement.java
deleted file mode 100644
index 5da91330604..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLAnchorElement.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* DomHTMLAnchorElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLAnchorElement;
-
-/**
- * An HTML 'A' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLAnchorElement
- extends DomHTMLElement
- implements HTMLAnchorElement
-{
-
- protected DomHTMLAnchorElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAccessKey()
- {
- return getHTMLAttribute("accesskey");
- }
-
- public void setAccessKey(String accessKey)
- {
- setHTMLAttribute("accesskey", accessKey);
- }
-
- public String getCharset()
- {
- return getHTMLAttribute("charset");
- }
-
- public void setCharset(String charset)
- {
- setHTMLAttribute("charset", charset);
- }
-
- public String getCoords()
- {
- return getHTMLAttribute("coords");
- }
-
- public void setCoords(String coords)
- {
- setHTMLAttribute("coords", coords);
- }
-
- public String getHref()
- {
- return getHTMLAttribute("href");
- }
-
- public void setHref(String href)
- {
- setHTMLAttribute("href", href);
- }
-
- public String getHreflang()
- {
- return getHTMLAttribute("hreflang");
- }
-
- public void setHreflang(String hreflang)
- {
- setHTMLAttribute("hreflang", hreflang);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public String getRel()
- {
- return getHTMLAttribute("rel");
- }
-
- public void setRel(String rel)
- {
- setHTMLAttribute("rel", rel);
- }
-
- public String getRev()
- {
- return getHTMLAttribute("rev");
- }
-
- public void setRev(String rev)
- {
- setHTMLAttribute("rev", rev);
- }
-
- public String getShape()
- {
- return getHTMLAttribute("shape");
- }
-
- public void setShape(String shape)
- {
- setHTMLAttribute("shape", shape);
- }
-
- public int getTabIndex()
- {
- return getIntHTMLAttribute("tabindex");
- }
-
- public void setTabIndex(int tabIndex)
- {
- setIntHTMLAttribute("tabindex", tabIndex);
- }
-
- public String getTarget()
- {
- return getHTMLAttribute("target");
- }
-
- public void setTarget(String target)
- {
- setHTMLAttribute("target", target);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public void setType(String type)
- {
- setHTMLAttribute("type", type);
- }
-
- public void blur()
- {
- dispatchUIEvent("blur");
- }
-
- public void focus()
- {
- dispatchUIEvent("focus");
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLAppletElement.java b/libjava/gnu/xml/dom/html2/DomHTMLAppletElement.java
deleted file mode 100644
index 8ec4d3c83bb..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLAppletElement.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/* DomHTMLAppletElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLAppletElement;
-
-/**
- * An HTML 'APPLET' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLAppletElement
- extends DomHTMLElement
- implements HTMLAppletElement
-{
-
- protected DomHTMLAppletElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public String getAlt()
- {
- return getHTMLAttribute("alt");
- }
-
- public void setAlt(String alt)
- {
- setHTMLAttribute("alt", alt);
- }
-
- public String getArchive()
- {
- return getHTMLAttribute("archive");
- }
-
- public void setArchive(String archive)
- {
- setHTMLAttribute("archive", archive);
- }
-
- public String getCode()
- {
- return getHTMLAttribute("code");
- }
-
- public void setCode(String code)
- {
- setHTMLAttribute("code", code);
- }
-
- public String getCodeBase()
- {
- return getHTMLAttribute("codebase");
- }
-
- public void setCodeBase(String codeBase)
- {
- setHTMLAttribute("codebase", codeBase);
- }
-
- public String getHeight()
- {
- return getHTMLAttribute("height");
- }
-
- public void setHeight(String height)
- {
- setHTMLAttribute("height", height);
- }
-
- public int getHspace()
- {
- return getIntHTMLAttribute("hspace");
- }
-
- public void setHspace(int hspace)
- {
- setIntHTMLAttribute("hspace", hspace);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public String getObject()
- {
- return getHTMLAttribute("object");
- }
-
- public void setObject(String object)
- {
- setHTMLAttribute("object", object);
- }
-
- public int getVspace()
- {
- return getIntHTMLAttribute("vspace");
- }
-
- public void setVspace(int vspace)
- {
- setIntHTMLAttribute("vspace", vspace);
- }
-
- public String getWidth()
- {
- return getHTMLAttribute("width");
- }
-
- public void setWidth(String width)
- {
- setHTMLAttribute("width", width);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLAreaElement.java b/libjava/gnu/xml/dom/html2/DomHTMLAreaElement.java
deleted file mode 100644
index d7eed07dd1f..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLAreaElement.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/* DomHTMLAreaElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLAreaElement;
-
-/**
- * An HTML 'AREA' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLAreaElement
- extends DomHTMLElement
- implements HTMLAreaElement
-{
-
- protected DomHTMLAreaElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAccessKey()
- {
- return getHTMLAttribute("accesskey");
- }
-
- public void setAccessKey(String accessKey)
- {
- setHTMLAttribute("accesskey", accessKey);
- }
-
- public String getAlt()
- {
- return getHTMLAttribute("alt");
- }
-
- public void setAlt(String alt)
- {
- setHTMLAttribute("alt", alt);
- }
-
- public String getCoords()
- {
- return getHTMLAttribute("coords");
- }
-
- public void setCoords(String coords)
- {
- setHTMLAttribute("coords", coords);
- }
-
- public String getHref()
- {
- return getHTMLAttribute("href");
- }
-
- public void setHref(String href)
- {
- setHTMLAttribute("href", href);
- }
-
- public boolean getNoHref()
- {
- return getBooleanHTMLAttribute("nohref");
- }
-
- public void setNoHref(boolean nohref)
- {
- setBooleanHTMLAttribute("nohref", nohref);
- }
-
- public String getShape()
- {
- return getHTMLAttribute("shape");
- }
-
- public void setShape(String shape)
- {
- setHTMLAttribute("shape", shape);
- }
-
- public int getTabIndex()
- {
- return getIntHTMLAttribute("tabindex");
- }
-
- public void setTabIndex(int tabIndex)
- {
- setIntHTMLAttribute("tabindex", tabIndex);
- }
-
- public String getTarget()
- {
- return getHTMLAttribute("target");
- }
-
- public void setTarget(String target)
- {
- setHTMLAttribute("target", target);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLBRElement.java b/libjava/gnu/xml/dom/html2/DomHTMLBRElement.java
deleted file mode 100644
index 673699d527a..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLBRElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLBRElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLBRElement;
-
-/**
- * An HTML 'BR' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLBRElement
- extends DomHTMLElement
- implements HTMLBRElement
-{
-
- protected DomHTMLBRElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getClear()
- {
- return getHTMLAttribute("clear");
- }
-
- public void setClear(String clear)
- {
- setHTMLAttribute("clear", clear);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLBaseElement.java b/libjava/gnu/xml/dom/html2/DomHTMLBaseElement.java
deleted file mode 100644
index ddc8053079f..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLBaseElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* DomHTMLBaseElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLBaseElement;
-
-/**
- * An HTML 'BASE' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLBaseElement
- extends DomHTMLElement
- implements HTMLBaseElement
-{
-
- protected DomHTMLBaseElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getHref()
- {
- return getHTMLAttribute("href");
- }
-
- public void setHref(String href)
- {
- setHTMLAttribute("href", href);
- }
-
- public String getTarget()
- {
- return getHTMLAttribute("target");
- }
-
- public void setTarget(String target)
- {
- setHTMLAttribute("target", target);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLBaseFontElement.java b/libjava/gnu/xml/dom/html2/DomHTMLBaseFontElement.java
deleted file mode 100644
index 73172d3bf11..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLBaseFontElement.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* DomHTMLBaseFontElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLBaseFontElement;
-
-/**
- * An HTML 'BASEFONT' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLBaseFontElement
- extends DomHTMLElement
- implements HTMLBaseFontElement
-{
-
- protected DomHTMLBaseFontElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getColor()
- {
- return getHTMLAttribute("color");
- }
-
- public void setColor(String color)
- {
- setHTMLAttribute("color", color);
- }
-
- public String getFace()
- {
- return getHTMLAttribute("face");
- }
-
- public void setFace(String face)
- {
- setHTMLAttribute("face", face);
- }
-
- public int getSize()
- {
- return getIntHTMLAttribute("size");
- }
-
- public void setSize(int size)
- {
- setIntHTMLAttribute("size", size);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLBodyElement.java b/libjava/gnu/xml/dom/html2/DomHTMLBodyElement.java
deleted file mode 100644
index 44fbcf23cc5..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLBodyElement.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/* DomHTMLBodyElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLBodyElement;
-
-/**
- * An HTML 'BODY' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLBodyElement
- extends DomHTMLElement
- implements HTMLBodyElement
-{
-
- protected DomHTMLBodyElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getALink()
- {
- return getHTMLAttribute("alink");
- }
-
- public void setALink(String alink)
- {
- setHTMLAttribute("alink", alink);
- }
-
- public String getBackground()
- {
- return getHTMLAttribute("background");
- }
-
- public void setBackground(String background)
- {
- setHTMLAttribute("background", background);
- }
-
- public String getBgColor()
- {
- return getHTMLAttribute("bgcolor");
- }
-
- public void setBgColor(String bgcolor)
- {
- setHTMLAttribute("bgcolor", bgcolor);
- }
-
- public String getLink()
- {
- return getHTMLAttribute("link");
- }
-
- public void setLink(String link)
- {
- setHTMLAttribute("link", link);
- }
-
- public String getText()
- {
- return getHTMLAttribute("text");
- }
-
- public void setText(String text)
- {
- setHTMLAttribute("text", text);
- }
-
- public String getVLink()
- {
- return getHTMLAttribute("vlink");
- }
-
- public void setVLink(String vlink)
- {
- setHTMLAttribute("vlink", vlink);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLButtonElement.java b/libjava/gnu/xml/dom/html2/DomHTMLButtonElement.java
deleted file mode 100644
index 5aff5f8c1a9..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLButtonElement.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* DomHTMLButtonElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.html2.HTMLButtonElement;
-import org.w3c.dom.html2.HTMLFormElement;
-
-/**
- * An HTML 'BUTTON' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLButtonElement
- extends DomHTMLElement
- implements HTMLButtonElement
-{
-
- protected DomHTMLButtonElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public HTMLFormElement getForm()
- {
- return (HTMLFormElement) getParentElement("form");
- }
-
- public String getAccessKey()
- {
- return getHTMLAttribute("accesskey");
- }
-
- public void setAccessKey(String accessKey)
- {
- setHTMLAttribute("accesskey", accessKey);
- }
-
- public boolean getDisabled()
- {
- return getBooleanHTMLAttribute("disabled");
- }
-
- public void setDisabled(boolean disabled)
- {
- setBooleanHTMLAttribute("disabled", disabled);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public int getTabIndex()
- {
- return getIntHTMLAttribute("tabindex");
- }
-
- public void setTabIndex(int tabIndex)
- {
- setIntHTMLAttribute("tabindex", tabIndex);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public String getValue()
- {
- return getHTMLAttribute("value");
- }
-
- public void setValue(String value)
- {
- setHTMLAttribute("value", value);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLCollection.java b/libjava/gnu/xml/dom/html2/DomHTMLCollection.java
deleted file mode 100644
index 05dc99a271b..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLCollection.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/* DomHTMLCollection.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import gnu.xml.dom.DomDOMException;
-import gnu.xml.dom.DomElement;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.html2.HTMLCollection;
-import org.w3c.dom.html2.HTMLOptionsCollection;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * An HTML element collection.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class DomHTMLCollection
- implements HTMLCollection, HTMLOptionsCollection, NodeList, NodeFilter
-{
-
- final DomHTMLDocument doc;
- final Node root;
- List nodeNames;
- List attributeNames;
- List results;
-
- DomHTMLCollection(DomHTMLDocument doc, Node root)
- {
- this.doc = doc;
- this.root = root;
- }
-
- // -- Node name and attribute filtering --
-
- void addNodeName(String name)
- {
- if (nodeNames == null)
- {
- nodeNames = new LinkedList();
- }
- nodeNames.add(name);
- }
-
- void addAttributeName(String name)
- {
- if (attributeNames == null)
- {
- attributeNames = new LinkedList();
- }
- attributeNames.add(name);
- }
-
- public short acceptNode(Node n)
- {
- if (n.getNodeType() != Node.ELEMENT_NODE)
- {
- return NodeFilter.FILTER_SKIP;
- }
- if (nodeNames != null && !acceptName(n.getLocalName()))
- {
- return NodeFilter.FILTER_SKIP;
- }
- if (attributeNames != null && !acceptAttributes(n.getAttributes()))
- {
- return NodeFilter.FILTER_SKIP;
- }
- return NodeFilter.FILTER_ACCEPT;
- }
-
- private boolean acceptName(String name)
- {
- for (Iterator i = nodeNames.iterator(); i.hasNext(); )
- {
- String nodeName = (String) i.next();
- if (nodeName.equalsIgnoreCase(name))
- {
- return true;
- }
- }
- return false;
- }
-
- private boolean acceptAttributes(NamedNodeMap attrs)
- {
- for (Iterator i = attributeNames.iterator(); i.hasNext(); )
- {
- String attributeName = (String) i.next();
- Node attr = getNamedItem(attrs, attributeName);
- if (attr != null)
- {
- // Check that attribute has a non-null value
- String nodeValue = attr.getNodeValue();
- if (nodeValue != null && nodeValue.length() > 0)
- {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Case-insensitive version of getNamedItem.
- */
- private Node getNamedItem(NamedNodeMap attrs, String name)
- {
- int len = attrs.getLength();
- for (int i = 0; i < len; i++)
- {
- Node attr = attrs.item(i);
- String attrName = attr.getLocalName();
- if (name.equalsIgnoreCase(attrName))
- {
- return attr;
- }
- }
- return null;
- }
-
- // -- Perform query --
-
- void evaluate()
- {
- NodeIterator i = doc.createNodeIterator(root, NodeFilter.SHOW_ELEMENT,
- this, true);
- results = new ArrayList();
- for (Node node = i.nextNode(); node != null; node = i.nextNode())
- {
- results.add(node);
- }
- }
-
- // -- HTMLCollection/NodeList interface --
-
- public int getLength()
- {
- return results.size();
- }
-
- public void setLength(int length)
- {
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- public Node item(int index)
- {
- return (Node) results.get(index);
- }
-
- public Node namedItem(String name)
- {
- boolean xhtml = false; // FIXME detect XHTML document
- for (Iterator i = results.iterator(); i.hasNext(); )
- {
- Node node = (Node) i.next();
- NamedNodeMap attrs = node.getAttributes();
- Node attr = getNamedItem(attrs, "id");
- if (name.equals(attr.getTextContent()))
- {
- return node;
- }
- if (!xhtml)
- {
- attr = getNamedItem(attrs, "name");
- if (name.equals(attr.getTextContent()))
- {
- return node;
- }
- }
- }
- return null;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLDListElement.java b/libjava/gnu/xml/dom/html2/DomHTMLDListElement.java
deleted file mode 100644
index 2b9dbf23623..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLDListElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLDListElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLDListElement;
-
-/**
- * An HTML 'DL' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLDListElement
- extends DomHTMLElement
- implements HTMLDListElement
-{
-
- protected DomHTMLDListElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public boolean getCompact()
- {
- return getBooleanHTMLAttribute("compact");
- }
-
- public void setCompact(boolean compact)
- {
- setBooleanHTMLAttribute("compact", compact);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLDirectoryElement.java b/libjava/gnu/xml/dom/html2/DomHTMLDirectoryElement.java
deleted file mode 100644
index 26af97e781b..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLDirectoryElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLDirectoryElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLDirectoryElement;
-
-/**
- * An HTML 'DIR' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLDirectoryElement
- extends DomHTMLElement
- implements HTMLDirectoryElement
-{
-
- protected DomHTMLDirectoryElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public boolean getCompact()
- {
- return getBooleanHTMLAttribute("compact");
- }
-
- public void setCompact(boolean compact)
- {
- setBooleanHTMLAttribute("compact", compact);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLDivElement.java b/libjava/gnu/xml/dom/html2/DomHTMLDivElement.java
deleted file mode 100644
index 462069dcf1a..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLDivElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLDivElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLDivElement;
-
-/**
- * An HTML 'DIV' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLDivElement
- extends DomHTMLElement
- implements HTMLDivElement
-{
-
- protected DomHTMLDivElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLDocument.java b/libjava/gnu/xml/dom/html2/DomHTMLDocument.java
deleted file mode 100644
index 10ee9e74767..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLDocument.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/* DomHTMLDocument.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import gnu.xml.dom.DomDocument;
-import gnu.xml.dom.DomDOMException;
-import java.lang.reflect.Constructor;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.html2.HTMLCollection;
-import org.w3c.dom.html2.HTMLDocument;
-import org.w3c.dom.html2.HTMLElement;
-
-/**
- * An HTML document.
- * This is the factory object used to create HTML elements.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLDocument
- extends DomDocument
- implements HTMLDocument
-{
-
- private static final Class[] ELEMENT_PT = new Class[] {
- DomHTMLDocument.class,
- String.class,
- String.class
- };
-
- private static Map ELEMENT_CLASSES;
- static
- {
- Map map = new HashMap();
- map.put("a", DomHTMLAnchorElement.class);
- map.put("applet", DomHTMLAppletElement.class);
- map.put("area", DomHTMLAreaElement.class);
- map.put("base", DomHTMLBaseElement.class);
- map.put("basefont", DomHTMLBaseFontElement.class);
- map.put("body", DomHTMLBodyElement.class);
- map.put("br", DomHTMLBRElement.class);
- map.put("button", DomHTMLButtonElement.class);
- map.put("dir", DomHTMLDirectoryElement.class);
- map.put("div", DomHTMLDivElement.class);
- map.put("dlist", DomHTMLDListElement.class);
- map.put("fieldset", DomHTMLFieldSetElement.class);
- map.put("font", DomHTMLFontElement.class);
- map.put("form", DomHTMLFormElement.class);
- map.put("frame", DomHTMLFrameElement.class);
- map.put("frameset", DomHTMLFrameSetElement.class);
- map.put("head", DomHTMLHeadElement.class);
- map.put("h1", DomHTMLHeadingElement.class);
- map.put("h2", DomHTMLHeadingElement.class);
- map.put("h3", DomHTMLHeadingElement.class);
- map.put("h4", DomHTMLHeadingElement.class);
- map.put("h5", DomHTMLHeadingElement.class);
- map.put("h6", DomHTMLHeadingElement.class);
- map.put("html", DomHTMLHtmlElement.class);
- map.put("iframe", DomHTMLIFrameElement.class);
- map.put("img", DomHTMLImageElement.class);
- map.put("input", DomHTMLInputElement.class);
- map.put("isindex", DomHTMLIsIndexElement.class);
- map.put("label", DomHTMLLabelElement.class);
- map.put("legend", DomHTMLLegendElement.class);
- map.put("li", DomHTMLLIElement.class);
- map.put("link", DomHTMLLinkElement.class);
- map.put("map", DomHTMLMapElement.class);
- map.put("menu", DomHTMLMenuElement.class);
- map.put("meta", DomHTMLMetaElement.class);
- map.put("ins", DomHTMLModElement.class);
- map.put("del", DomHTMLModElement.class);
- map.put("object", DomHTMLObjectElement.class);
- map.put("ol", DomHTMLOListElement.class);
- map.put("optgroup", DomHTMLOptGroupElement.class);
- map.put("option", DomHTMLOptionElement.class);
- map.put("p", DomHTMLParagraphElement.class);
- map.put("param", DomHTMLParamElement.class);
- map.put("pre", DomHTMLPreElement.class);
- map.put("q", DomHTMLQuoteElement.class);
- map.put("blockquote", DomHTMLQuoteElement.class);
- map.put("script", DomHTMLScriptElement.class);
- map.put("select", DomHTMLSelectElement.class);
- map.put("style", DomHTMLStyleElement.class);
- map.put("caption", DomHTMLTableCaptionElement.class);
- map.put("th", DomHTMLTableCellElement.class);
- map.put("td", DomHTMLTableCellElement.class);
- map.put("col", DomHTMLTableColElement.class);
- map.put("colgroup", DomHTMLTableColElement.class);
- map.put("table", DomHTMLTableElement.class);
- map.put("tr", DomHTMLTableRowElement.class);
- map.put("thead", DomHTMLTableSectionElement.class);
- map.put("tfoot", DomHTMLTableSectionElement.class);
- map.put("tbody", DomHTMLTableSectionElement.class);
- map.put("textarea", DomHTMLTextAreaElement.class);
- map.put("title", DomHTMLTitleElement.class);
- map.put("ul", DomHTMLUListElement.class);
- ELEMENT_CLASSES = Collections.unmodifiableMap(map);
- }
-
- private static Set HTML_NS_URIS;
- static
- {
- Set set = new HashSet();
- set.add("http://www.w3.org/TR/html4/strict");
- set.add("http://www.w3.org/TR/html4/loose");
- set.add("http://www.w3.org/TR/html4/frameset");
- set.add("http://www.w3.org/1999/xhtml");
- set.add("http://www.w3.org/TR/xhtml1/strict");
- set.add("http://www.w3.org/TR/xhtml1/loose");
- set.add("http://www.w3.org/TR/xhtml1/frameset");
- HTML_NS_URIS = Collections.unmodifiableSet(set);
- }
-
- /**
- * Convenience constructor.
- */
- public DomHTMLDocument()
- {
- this(new DomHTMLImpl());
- }
-
- /**
- * Constructor.
- * This is called by the DOMImplementation.
- */
- public DomHTMLDocument(DomHTMLImpl impl)
- {
- super(impl);
- }
-
- private Node getChildNodeByName(Node parent, String name)
- {
- for (Node ctx = parent.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (name.equalsIgnoreCase(ctx.getNodeName()))
- {
- return ctx;
- }
- }
- return null;
- }
-
- public String getTitle()
- {
- Node html = getDocumentElement();
- if (html != null)
- {
- Node head = getChildNodeByName(html, "head");
- if (head != null)
- {
- Node title = getChildNodeByName(head, "title");
- if (title != null)
- {
- return title.getTextContent();
- }
- }
- }
- return null;
- }
-
- public void setTitle(String title)
- {
- Node html = getDocumentElement();
- if (html == null)
- {
- html = createElement("html");
- appendChild(html);
- }
- Node head = getChildNodeByName(html, "head");
- if (head == null)
- {
- head = createElement("head");
- Node first = html.getFirstChild();
- if (first != null)
- {
- html.insertBefore(first, head);
- }
- else
- {
- html.appendChild(head);
- }
- }
- Node titleNode = getChildNodeByName(head, "title");
- if (titleNode == null)
- {
- titleNode = createElement("title");
- Node first = head.getFirstChild();
- if (first != null)
- {
- head.insertBefore(first, titleNode);
- }
- else
- {
- head.appendChild(titleNode);
- }
- }
- titleNode.setTextContent(title);
- }
-
- public String getReferrer()
- {
- // TODO getReferrer
- return null;
- }
-
- public String getDomain()
- {
- try
- {
- URL url = new URL(getDocumentURI());
- return url.getHost();
- }
- catch (MalformedURLException e)
- {
- return null;
- }
- }
-
- public String getURL()
- {
- return getDocumentURI();
- }
-
- public HTMLElement getBody()
- {
- Node html = getDocumentElement();
- if (html != null)
- {
- Node body = getChildNodeByName(html, "body");
- if (body == null)
- {
- body = getChildNodeByName(html, "frameset");
- }
- return (HTMLElement) body;
- }
- return null;
- }
-
- public void setBody(HTMLElement body)
- {
- Node html = getDocumentElement();
- if (html == null)
- {
- html = createElement("html");
- appendChild(html);
- }
- Node ref = getBody();
- if (ref == null)
- {
- html.appendChild(body);
- }
- else
- {
- html.replaceChild(body, ref);
- }
- }
-
- public HTMLCollection getImages()
- {
- DomHTMLCollection ret = new DomHTMLCollection(this, this);
- ret.addNodeName("img");
- ret.evaluate();
- return ret;
- }
-
- public HTMLCollection getApplets()
- {
- DomHTMLCollection ret = new DomHTMLCollection(this, this);
- ret.addNodeName("object");
- ret.addNodeName("applet");
- ret.evaluate();
- return ret;
- }
-
- public HTMLCollection getLinks()
- {
- DomHTMLCollection ret = new DomHTMLCollection(this, this);
- ret.addNodeName("area");
- ret.addNodeName("a");
- ret.evaluate();
- return ret;
- }
-
- public HTMLCollection getForms()
- {
- DomHTMLCollection ret = new DomHTMLCollection(this, this);
- ret.addNodeName("form");
- ret.evaluate();
- return ret;
- }
-
- public HTMLCollection getAnchors()
- {
- DomHTMLCollection ret = new DomHTMLCollection(this, this);
- ret.addNodeName("a");
- ret.addAttributeName("name");
- ret.evaluate();
- return ret;
- }
-
- public String getCookie()
- {
- // TODO getCookie
- return null;
- }
-
- public void setCookie(String cookie)
- {
- // TODO setCookie
- }
-
- public void open()
- {
- // TODO open
- }
-
- public void close()
- {
- // TODO close
- }
-
- public void write(String text)
- {
- // TODO write
- }
-
- public void writeln(String text)
- {
- // TODO write
- }
-
- public NodeList getElementsByName(String name)
- {
- DomHTMLCollection ret = new DomHTMLCollection(this, this);
- ret.addNodeName(name);
- ret.evaluate();
- return ret;
- // TODO xhtml: return only form controls (?)
- }
-
- public Element createElement(String tagName)
- {
- return createElementNS(null, tagName);
- }
-
- public Element createElementNS(String uri, String qName)
- {
- /* If a non-HTML element, use the default implementation. */
- if (uri != null && !HTML_NS_URIS.contains(uri))
- {
- return super.createElementNS(uri, qName);
- }
- String localName = qName.toLowerCase();
- int ci = qName.indexOf(':');
- if (ci != -1)
- {
- localName = qName.substring(ci + 1);
- }
- Class t = (Class) ELEMENT_CLASSES.get(localName);
- /* If a non-HTML element, use the default implementation. */
- if (t == null)
- {
- return super.createElementNS(uri, qName);
- }
- try
- {
- Constructor c = t.getDeclaredConstructor(ELEMENT_PT);
- Object[] args = new Object[] { this, uri, qName };
- return (Element) c.newInstance(args);
- }
- catch (Exception e)
- {
- DOMException e2 = new DomDOMException(DOMException.TYPE_MISMATCH_ERR);
- e2.initCause(e);
- throw e2;
- }
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLElement.java b/libjava/gnu/xml/dom/html2/DomHTMLElement.java
deleted file mode 100644
index 844ffefe49c..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLElement.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/* DomHTMLElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import gnu.xml.dom.DomDOMException;
-import gnu.xml.dom.DomElement;
-import gnu.xml.dom.DomEvent;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.events.UIEvent;
-import org.w3c.dom.html2.HTMLElement;
-
-/**
- * Abstract implementation of an HTML element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public abstract class DomHTMLElement
- extends DomElement
- implements HTMLElement
-{
-
- protected DomHTMLElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- /**
- * Returns the value of the specified attribute.
- * The attribute name is case insensitive.
- */
- protected String getHTMLAttribute(String name)
- {
- if (hasAttributes())
- {
- NamedNodeMap attrs = getAttributes();
- int len = attrs.getLength();
- for (int i = 0; i < len; i++)
- {
- Node attr = attrs.item(i);
- String attrName = attr.getLocalName();
- if (attrName.equalsIgnoreCase(name))
- {
- return attr.getNodeValue();
- }
- }
- }
- return "";
- }
-
- protected int getIntHTMLAttribute(String name)
- {
- String value = getHTMLAttribute(name);
- if (value == null)
- {
- return -1;
- }
- try
- {
- return Integer.parseInt(value);
- }
- catch (NumberFormatException e)
- {
- return -1;
- }
- }
-
- protected boolean getBooleanHTMLAttribute(String name)
- {
- String value = getHTMLAttribute(name);
- return value != null;
- }
-
- /**
- * Sets the value of the specified attribute.
- * The attribute name is case insensitive.
- */
- protected void setHTMLAttribute(String name, String value)
- {
- Node attr;
- NamedNodeMap attrs = getAttributes();
- int len = attrs.getLength();
- for (int i = 0; i < len; i++)
- {
- attr = attrs.item(i);
- String attrName = attr.getLocalName();
- if (attrName.equalsIgnoreCase(name))
- {
- if (value != null)
- {
- attr.setNodeValue(value);
- }
- else
- {
- attrs.removeNamedItem(attr.getNodeName());
- }
- return;
- }
- }
- if (value != null)
- {
- // Create a new attribute
- DomHTMLDocument doc = (DomHTMLDocument) getOwnerDocument();
- // XXX namespace URI for attribute?
- attr = doc.createAttribute(name);
- attr.setNodeValue(value);
- }
- }
-
- protected void setIntHTMLAttribute(String name, int value)
- {
- setHTMLAttribute(name, Integer.toString(value));
- }
-
- protected void setBooleanHTMLAttribute(String name, boolean value)
- {
- setHTMLAttribute(name, value ? name : null);
- }
-
- /**
- * Returns the first parent element with the specified name.
- */
- protected Node getParentElement(String name)
- {
- for (Node parent = getParentNode(); parent != null;
- parent = parent.getParentNode())
- {
- if (name.equalsIgnoreCase(parent.getLocalName()))
- {
- return parent;
- }
- }
- return null;
- }
-
- /**
- * Returns the first child element with the specified name.
- */
- protected Node getChildElement(String name)
- {
- for (Node child = getFirstChild(); child != null;
- child = child.getNextSibling())
- {
- if (name.equalsIgnoreCase(child.getLocalName()))
- {
- return child;
- }
- }
- return null;
- }
-
- /**
- * Returns the index of this element among elements of the same name,
- * relative to its parent.
- */
- protected int getIndex()
- {
- int index = 0;
- Node parent = getParentNode();
- if (parent != null)
- {
- for (Node ctx = parent.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (ctx == this)
- {
- return index;
- }
- index++;
- }
- }
- throw new DomDOMException(DOMException.NOT_FOUND_ERR);
- }
-
- protected void dispatchUIEvent(String name)
- {
- UIEvent event = new DomEvent.DomUIEvent(name);
- dispatchEvent(event);
- }
-
- public String getId()
- {
- return getHTMLAttribute("id");
- }
-
- public void setId(String id)
- {
- setHTMLAttribute("id", id);
- }
-
- public String getTitle()
- {
- return getHTMLAttribute("title");
- }
-
- public void setTitle(String title)
- {
- setHTMLAttribute("title", title);
- }
-
- public String getLang()
- {
- return getHTMLAttribute("lang");
- }
-
- public void setLang(String lang)
- {
- setHTMLAttribute("lang", lang);
- }
-
- public String getDir()
- {
- return getHTMLAttribute("dir");
- }
-
- public void setDir(String dir)
- {
- setHTMLAttribute("dir", dir);
- }
-
- public String getClassName()
- {
- return getHTMLAttribute("class");
- }
-
- public void setClassName(String className)
- {
- setHTMLAttribute("class", className);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLFieldSetElement.java b/libjava/gnu/xml/dom/html2/DomHTMLFieldSetElement.java
deleted file mode 100644
index 2c857721947..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLFieldSetElement.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* DomHTMLFieldSetElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLFieldSetElement;
-import org.w3c.dom.html2.HTMLFormElement;
-
-/**
- * An HTML 'FIELDSET' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLFieldSetElement
- extends DomHTMLElement
- implements HTMLFieldSetElement
-{
-
- protected DomHTMLFieldSetElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public HTMLFormElement getForm()
- {
- return (HTMLFormElement) getParentElement("form");
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLFontElement.java b/libjava/gnu/xml/dom/html2/DomHTMLFontElement.java
deleted file mode 100644
index 08bd349fa62..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLFontElement.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* DomHTMLFontElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLFontElement;
-
-/**
- * An HTML 'FONT' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLFontElement
- extends DomHTMLElement
- implements HTMLFontElement
-{
-
- protected DomHTMLFontElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getColor()
- {
- return getHTMLAttribute("color");
- }
-
- public void setColor(String color)
- {
- setHTMLAttribute("color", color);
- }
-
- public String getFace()
- {
- return getHTMLAttribute("face");
- }
-
- public void setFace(String face)
- {
- setHTMLAttribute("face", face);
- }
-
- public String getSize()
- {
- return getHTMLAttribute("size");
- }
-
- public void setSize(String size)
- {
- setHTMLAttribute("size", size);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLFormElement.java b/libjava/gnu/xml/dom/html2/DomHTMLFormElement.java
deleted file mode 100644
index 119d97eb885..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLFormElement.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/* DomHTMLFormElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLCollection;
-import org.w3c.dom.html2.HTMLFormElement;
-
-/**
- * An HTML 'FORM' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLFormElement
- extends DomHTMLElement
- implements HTMLFormElement
-{
-
- protected DomHTMLFormElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public HTMLCollection getElements()
- {
- DomHTMLCollection ret =
- new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
- ret.addNodeName("input");
- ret.addNodeName("button");
- ret.addNodeName("select");
- ret.addNodeName("textarea");
- ret.addNodeName("isindex");
- ret.addNodeName("label");
- ret.addNodeName("option");
- ret.evaluate();
- return ret;
- }
-
- public int getLength()
- {
- return getElements().getLength();
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public String getAcceptCharset()
- {
- return getHTMLAttribute("accept-charset");
- }
-
- public void setAcceptCharset(String acceptCharset)
- {
- setHTMLAttribute("accept-charset", acceptCharset);
- }
-
- public String getAction()
- {
- return getHTMLAttribute("action");
- }
-
- public void setAction(String action)
- {
- setHTMLAttribute("action", action);
- }
-
- public String getEnctype()
- {
- return getHTMLAttribute("enctype");
- }
-
- public void setEnctype(String enctype)
- {
- setHTMLAttribute("enctype", enctype);
- }
-
- public String getMethod()
- {
- return getHTMLAttribute("method");
- }
-
- public void setMethod(String method)
- {
- setHTMLAttribute("method", method);
- }
-
- public String getTarget()
- {
- return getHTMLAttribute("target");
- }
-
- public void setTarget(String target)
- {
- setHTMLAttribute("target", target);
- }
-
- public void submit()
- {
- dispatchUIEvent("submit");
- }
-
- public void reset()
- {
- dispatchUIEvent("reset");
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLFrameElement.java b/libjava/gnu/xml/dom/html2/DomHTMLFrameElement.java
deleted file mode 100644
index 124f35268e8..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLFrameElement.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/* DomHTMLFrameElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.html2.HTMLFrameElement;
-
-/**
- * An HTML 'FRAME' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLFrameElement
- extends DomHTMLElement
- implements HTMLFrameElement
-{
-
- protected DomHTMLFrameElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getFrameBorder()
- {
- return getHTMLAttribute("frameborder");
- }
-
- public void setFrameBorder(String frameBorder)
- {
- setHTMLAttribute("frameborder", frameBorder);
- }
-
- public String getLongDesc()
- {
- return getHTMLAttribute("longdesc");
- }
-
- public void setLongDesc(String longDesc)
- {
- setHTMLAttribute("longdesc", longDesc);
- }
-
- public String getMarginHeight()
- {
- return getHTMLAttribute("marginheight");
- }
-
- public void setMarginHeight(String marginHeight)
- {
- setHTMLAttribute("marginheight", marginHeight);
- }
-
- public String getMarginWidth()
- {
- return getHTMLAttribute("marginwidth");
- }
-
- public void setMarginWidth(String marginWidth)
- {
- setHTMLAttribute("marginwidth", marginWidth);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public boolean getNoResize()
- {
- return getBooleanHTMLAttribute("noresize");
- }
-
- public void setNoResize(boolean noResize)
- {
- setBooleanHTMLAttribute("noresize", noResize);
- }
-
- public String getScrolling()
- {
- return getHTMLAttribute("scrolling");
- }
-
- public void setScrolling(String scrolling)
- {
- setHTMLAttribute("scrolling", scrolling);
- }
-
- public String getSrc()
- {
- return getHTMLAttribute("src");
- }
-
- public void setSrc(String src)
- {
- setHTMLAttribute("src", src);
- }
-
- public Document getContentDocument()
- {
- // TODO getContentDocument
- return null;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLFrameSetElement.java b/libjava/gnu/xml/dom/html2/DomHTMLFrameSetElement.java
deleted file mode 100644
index 44d317f64a3..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLFrameSetElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* DomHTMLFrameSetElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLFrameSetElement;
-
-/**
- * An HTML 'FRAMESET' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLFrameSetElement
- extends DomHTMLElement
- implements HTMLFrameSetElement
-{
-
- protected DomHTMLFrameSetElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getCols()
- {
- return getHTMLAttribute("cols");
- }
-
- public void setCols(String cols)
- {
- setHTMLAttribute("cols", cols);
- }
-
- public String getRows()
- {
- return getHTMLAttribute("rows");
- }
-
- public void setRows(String rows)
- {
- setHTMLAttribute("rows", rows);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLHRElement.java b/libjava/gnu/xml/dom/html2/DomHTMLHRElement.java
deleted file mode 100644
index d1b48012175..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLHRElement.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* DomHTMLHRElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLHRElement;
-
-/**
- * An HTML 'HR' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLHRElement
- extends DomHTMLElement
- implements HTMLHRElement
-{
-
- protected DomHTMLHRElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public boolean getNoShade()
- {
- return getBooleanHTMLAttribute("noshade");
- }
-
- public void setNoShade(boolean noShade)
- {
- setBooleanHTMLAttribute("noshade", noShade);
- }
-
- public String getSize()
- {
- return getHTMLAttribute("size");
- }
-
- public void setSize(String size)
- {
- setHTMLAttribute("size", size);
- }
-
- public String getWidth()
- {
- return getHTMLAttribute("width");
- }
-
- public void setWidth(String width)
- {
- setHTMLAttribute("width", width);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLHeadElement.java b/libjava/gnu/xml/dom/html2/DomHTMLHeadElement.java
deleted file mode 100644
index f68e8c7fad3..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLHeadElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLHeadElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLHeadElement;
-
-/**
- * An HTML 'HEAD' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLHeadElement
- extends DomHTMLElement
- implements HTMLHeadElement
-{
-
- protected DomHTMLHeadElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getProfile()
- {
- return getHTMLAttribute("profile");
- }
-
- public void setProfile(String profile)
- {
- setHTMLAttribute("profile", profile);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLHeadingElement.java b/libjava/gnu/xml/dom/html2/DomHTMLHeadingElement.java
deleted file mode 100644
index f1427ad89e6..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLHeadingElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLHeadingElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLHeadingElement;
-
-/**
- * An HTML 'H1', 'H2', 'H3', 'H4', 'H5', or 'H6' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLHeadingElement
- extends DomHTMLElement
- implements HTMLHeadingElement
-{
-
- protected DomHTMLHeadingElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLHtmlElement.java b/libjava/gnu/xml/dom/html2/DomHTMLHtmlElement.java
deleted file mode 100644
index 95d45264eee..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLHtmlElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLHtmlElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLHtmlElement;
-
-/**
- * An HTML 'HTML' top-level element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLHtmlElement
- extends DomHTMLElement
- implements HTMLHtmlElement
-{
-
- protected DomHTMLHtmlElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getVersion()
- {
- return getHTMLAttribute("version");
- }
-
- public void setVersion(String version)
- {
- setHTMLAttribute("version", version);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLIFrameElement.java b/libjava/gnu/xml/dom/html2/DomHTMLIFrameElement.java
deleted file mode 100644
index c5ca75d8c21..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLIFrameElement.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/* DomHTMLIFrameElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.html2.HTMLIFrameElement;
-
-/**
- * An HTML 'IFRAME' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLIFrameElement
- extends DomHTMLElement
- implements HTMLIFrameElement
-{
-
- protected DomHTMLIFrameElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public String getFrameBorder()
- {
- return getHTMLAttribute("frameborder");
- }
-
- public void setFrameBorder(String frameBorder)
- {
- setHTMLAttribute("frameborder", frameBorder);
- }
-
- public String getHeight()
- {
- return getHTMLAttribute("height");
- }
-
- public void setHeight(String height)
- {
- setHTMLAttribute("height", height);
- }
-
- public String getLongDesc()
- {
- return getHTMLAttribute("longdesc");
- }
-
- public void setLongDesc(String longDesc)
- {
- setHTMLAttribute("longdesc", longDesc);
- }
-
- public String getMarginHeight()
- {
- return getHTMLAttribute("marginheight");
- }
-
- public void setMarginHeight(String marginHeight)
- {
- setHTMLAttribute("marginheight", marginHeight);
- }
-
- public String getMarginWidth()
- {
- return getHTMLAttribute("marginwidth");
- }
-
- public void setMarginWidth(String marginWidth)
- {
- setHTMLAttribute("marginwidth", marginWidth);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public String getScrolling()
- {
- return getHTMLAttribute("scrolling");
- }
-
- public void setScrolling(String scrolling)
- {
- setHTMLAttribute("scrolling", scrolling);
- }
-
- public String getSrc()
- {
- return getHTMLAttribute("src");
- }
-
- public void setSrc(String src)
- {
- setHTMLAttribute("src", src);
- }
-
- public String getWidth()
- {
- return getHTMLAttribute("width");
- }
-
- public void setWidth(String width)
- {
- setHTMLAttribute("width", width);
- }
-
- public Document getContentDocument()
- {
- // TODO getContentDocument
- return null;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLImageElement.java b/libjava/gnu/xml/dom/html2/DomHTMLImageElement.java
deleted file mode 100644
index c96e5fede4d..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLImageElement.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/* DomHTMLImageElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLImageElement;
-
-/**
- * An HTML 'IMG' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLImageElement
- extends DomHTMLElement
- implements HTMLImageElement
-{
-
- protected DomHTMLImageElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public String getAlt()
- {
- return getHTMLAttribute("alt");
- }
-
- public void setAlt(String alt)
- {
- setHTMLAttribute("alt", alt);
- }
-
- public String getBorder()
- {
- return getHTMLAttribute("border");
- }
-
- public void setBorder(String border)
- {
- setHTMLAttribute("border", border);
- }
-
- public int getHeight()
- {
- return getIntHTMLAttribute("height");
- }
-
- public void setHeight(int height)
- {
- setIntHTMLAttribute("height", height);
- }
-
- public int getHspace()
- {
- return getIntHTMLAttribute("hspace");
- }
-
- public void setHspace(int hspace)
- {
- setIntHTMLAttribute("hspace", hspace);
- }
-
- public boolean getIsMap()
- {
- return getBooleanHTMLAttribute("ismap");
- }
-
- public void setIsMap(boolean isMap)
- {
- setBooleanHTMLAttribute("ismap", isMap);
- }
-
- public String getLongDesc()
- {
- return getHTMLAttribute("longdesc");
- }
-
- public void setLongDesc(String longDesc)
- {
- setHTMLAttribute("longdesc", longDesc);
- }
-
- public String getSrc()
- {
- return getHTMLAttribute("src");
- }
-
- public void setSrc(String src)
- {
- setHTMLAttribute("src", src);
- }
-
- public String getUseMap()
- {
- return getHTMLAttribute("usemap");
- }
-
- public void setUseMap(String useMap)
- {
- setHTMLAttribute("usemap", useMap);
- }
-
- public int getVspace()
- {
- return getIntHTMLAttribute("vspace");
- }
-
- public void setVspace(int vspace)
- {
- setIntHTMLAttribute("vspace", vspace);
- }
-
- public int getWidth()
- {
- return getIntHTMLAttribute("width");
- }
-
- public void setWidth(int width)
- {
- setIntHTMLAttribute("width", width);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLImpl.java b/libjava/gnu/xml/dom/html2/DomHTMLImpl.java
deleted file mode 100644
index 9f0db085040..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLImpl.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* DomHTMLImpl.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import gnu.xml.dom.DomImpl;
-import org.w3c.dom.Document;
-
-/**
- * Specialised DOMImplementation for creating HTML documents.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLImpl
- extends DomImpl
-{
-
- protected Document createDocument()
- {
- return new DomHTMLDocument(this);
- }
-
- public Object getFeature(String feature, String version)
- {
- if (hasFeature(feature, version))
- {
- return this;
- }
- return null;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLInputElement.java b/libjava/gnu/xml/dom/html2/DomHTMLInputElement.java
deleted file mode 100644
index 1dbc9c28de0..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLInputElement.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/* DomHTMLInputElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLFormElement;
-import org.w3c.dom.html2.HTMLInputElement;
-
-/**
- * An HTML 'INPUT' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLInputElement
- extends DomHTMLElement
- implements HTMLInputElement
-{
-
- protected String value;
- protected Boolean checked;
-
- protected DomHTMLInputElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getDefaultValue()
- {
- return getHTMLAttribute("value");
- }
-
- public void setDefaultValue(String defaultValue)
- {
- setHTMLAttribute("value", defaultValue);
- }
-
- public boolean getDefaultChecked()
- {
- return getBooleanHTMLAttribute("checked");
- }
-
- public void setDefaultChecked(boolean defaultChecked)
- {
- setBooleanHTMLAttribute("checked", defaultChecked);
- }
-
- public HTMLFormElement getForm()
- {
- return (HTMLFormElement) getParentElement("form");
- }
-
- public String getAccept()
- {
- return getHTMLAttribute("accept");
- }
-
- public void setAccept(String accept)
- {
- setHTMLAttribute("accept", accept);
- }
-
- public String getAccessKey()
- {
- return getHTMLAttribute("accesskey");
- }
-
- public void setAccessKey(String accessKey)
- {
- setHTMLAttribute("accesskey", accessKey);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public String getAlt()
- {
- return getHTMLAttribute("alt");
- }
-
- public void setAlt(String alt)
- {
- setHTMLAttribute("alt", alt);
- }
-
- public boolean getChecked()
- {
- if (checked == null)
- {
- checked = Boolean.valueOf(getDefaultChecked());
- }
- return checked.booleanValue();
- }
-
- public void setChecked(boolean checked)
- {
- this.checked = Boolean.valueOf(checked);
- }
-
- public boolean getDisabled()
- {
- return getBooleanHTMLAttribute("disabled");
- }
-
- public void setDisabled(boolean disabled)
- {
- setBooleanHTMLAttribute("disabled", disabled);
- }
-
- public int getMaxLength()
- {
- return getIntHTMLAttribute("maxLength");
- }
-
- public void setMaxLength(int maxLength)
- {
- setIntHTMLAttribute("maxLength", maxLength);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public boolean getReadOnly()
- {
- return getBooleanHTMLAttribute("readonly");
- }
-
- public void setReadOnly(boolean readOnly)
- {
- setBooleanHTMLAttribute("readonly", readOnly);
- }
-
- public int getSize()
- {
- return getIntHTMLAttribute("size");
- }
-
- public void setSize(int size)
- {
- setIntHTMLAttribute("size", size);
- }
-
- public String getSrc()
- {
- return getHTMLAttribute("src");
- }
-
- public void setSrc(String src)
- {
- setHTMLAttribute("src", src);
- }
-
- public int getTabIndex()
- {
- return getIntHTMLAttribute("tabindex");
- }
-
- public void setTabIndex(int tabIndex)
- {
- setIntHTMLAttribute("tabindex", tabIndex);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public void setType(String type)
- {
- setHTMLAttribute("type", type);
- }
-
- public String getUseMap()
- {
- return getHTMLAttribute("usemap");
- }
-
- public void setUseMap(String useMap)
- {
- setHTMLAttribute("usemap", useMap);
- }
-
- public String getValue()
- {
- if (value == null)
- {
- value = getDefaultValue();
- }
- return value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
- public void blur()
- {
- dispatchUIEvent("blur");
- }
-
- public void focus()
- {
- dispatchUIEvent("focus");
- }
-
- public void select()
- {
- dispatchUIEvent("select");
- }
-
- public void click()
- {
- dispatchUIEvent("click");
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLIsIndexElement.java b/libjava/gnu/xml/dom/html2/DomHTMLIsIndexElement.java
deleted file mode 100644
index 087f4a0cd79..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLIsIndexElement.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* DomHTMLIsIndexElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLFormElement;
-import org.w3c.dom.html2.HTMLIsIndexElement;
-
-/**
- * An HTML 'ISINDEX' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLIsIndexElement
- extends DomHTMLElement
- implements HTMLIsIndexElement
-{
-
- protected DomHTMLIsIndexElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public HTMLFormElement getForm()
- {
- return (HTMLFormElement) getParentElement("form");
- }
-
- public String getPrompt()
- {
- return getHTMLAttribute("prompt");
- }
-
- public void setPrompt(String prompt)
- {
- setHTMLAttribute("prompt", prompt);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLLIElement.java b/libjava/gnu/xml/dom/html2/DomHTMLLIElement.java
deleted file mode 100644
index 11eccdf5df3..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLLIElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* DomHTMLLIElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLLIElement;
-
-/**
- * An HTML 'LI' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLLIElement
- extends DomHTMLElement
- implements HTMLLIElement
-{
-
- protected DomHTMLLIElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public void setType(String type)
- {
- setHTMLAttribute("type", type);
- }
-
- public int getValue()
- {
- return getIntHTMLAttribute("value");
- }
-
- public void setValue(int value)
- {
- setIntHTMLAttribute("value", value);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLLabelElement.java b/libjava/gnu/xml/dom/html2/DomHTMLLabelElement.java
deleted file mode 100644
index c0cc39f8e96..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLLabelElement.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* DomHTMLLabelElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLFormElement;
-import org.w3c.dom.html2.HTMLLabelElement;
-
-/**
- * An HTML 'LABEL' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLLabelElement
- extends DomHTMLElement
- implements HTMLLabelElement
-{
-
- protected DomHTMLLabelElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public HTMLFormElement getForm()
- {
- return (HTMLFormElement) getParentElement("form");
- }
-
- public String getAccessKey()
- {
- return getHTMLAttribute("accesskey");
- }
-
- public void setAccessKey(String accessKey)
- {
- setHTMLAttribute("accesskey", accessKey);
- }
-
- public String getHtmlFor()
- {
- return getHTMLAttribute("for");
- }
-
- public void setHtmlFor(String htmlFor)
- {
- setHTMLAttribute("for", htmlFor);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLLegendElement.java b/libjava/gnu/xml/dom/html2/DomHTMLLegendElement.java
deleted file mode 100644
index a500f8fa14c..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLLegendElement.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* DomHTMLLegendElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLFormElement;
-import org.w3c.dom.html2.HTMLLegendElement;
-
-/**
- * An HTML 'LEGEND' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLLegendElement
- extends DomHTMLElement
- implements HTMLLegendElement
-{
-
- protected DomHTMLLegendElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public HTMLFormElement getForm()
- {
- return (HTMLFormElement) getParentElement("form");
- }
-
- public String getAccessKey()
- {
- return getHTMLAttribute("accesskey");
- }
-
- public void setAccessKey(String accessKey)
- {
- setHTMLAttribute("accesskey", accessKey);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLLinkElement.java b/libjava/gnu/xml/dom/html2/DomHTMLLinkElement.java
deleted file mode 100644
index 127726ef7e3..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLLinkElement.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* DomHTMLLinkElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLLinkElement;
-
-/**
- * An HTML 'LINK' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLLinkElement
- extends DomHTMLElement
- implements HTMLLinkElement
-{
-
- protected DomHTMLLinkElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public boolean getDisabled()
- {
- return getBooleanHTMLAttribute("disabled");
- }
-
- public void setDisabled(boolean disabled)
- {
- setBooleanHTMLAttribute("disabled", disabled);
- }
-
- public String getCharset()
- {
- return getHTMLAttribute("charset");
- }
-
- public void setCharset(String charset)
- {
- setHTMLAttribute("charset", charset);
- }
-
- public String getHref()
- {
- return getHTMLAttribute("href");
- }
-
- public void setHref(String href)
- {
- setHTMLAttribute("href", href);
- }
-
- public String getHreflang()
- {
- return getHTMLAttribute("hreflang");
- }
-
- public void setHreflang(String hreflang)
- {
- setHTMLAttribute("hreflang", hreflang);
- }
-
- public String getMedia()
- {
- return getHTMLAttribute("media");
- }
-
- public void setMedia(String media)
- {
- setHTMLAttribute("media", media);
- }
-
- public String getRel()
- {
- return getHTMLAttribute("rel");
- }
-
- public void setRel(String rel)
- {
- setHTMLAttribute("rel", rel);
- }
-
- public String getRev()
- {
- return getHTMLAttribute("rev");
- }
-
- public void setRev(String rev)
- {
- setHTMLAttribute("rev", rev);
- }
-
- public String getTarget()
- {
- return getHTMLAttribute("target");
- }
-
- public void setTarget(String target)
- {
- setHTMLAttribute("target", target);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public void setType(String type)
- {
- setHTMLAttribute("type", type);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLMapElement.java b/libjava/gnu/xml/dom/html2/DomHTMLMapElement.java
deleted file mode 100644
index 1f7182f4f29..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLMapElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* DomHTMLMapElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLCollection;
-import org.w3c.dom.html2.HTMLMapElement;
-
-/**
- * An HTML 'MAP' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLMapElement
- extends DomHTMLElement
- implements HTMLMapElement
-{
-
- protected DomHTMLMapElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public HTMLCollection getAreas()
- {
- DomHTMLCollection ret =
- new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
- ret.addNodeName("area");
- ret.evaluate();
- return ret;
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLMenuElement.java b/libjava/gnu/xml/dom/html2/DomHTMLMenuElement.java
deleted file mode 100644
index 17f6f589f9a..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLMenuElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLMenuElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLMenuElement;
-
-/**
- * An HTML 'MENU' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLMenuElement
- extends DomHTMLElement
- implements HTMLMenuElement
-{
-
- protected DomHTMLMenuElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public boolean getCompact()
- {
- return getBooleanHTMLAttribute("compact");
- }
-
- public void setCompact(boolean compact)
- {
- setBooleanHTMLAttribute("compact", compact);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLMetaElement.java b/libjava/gnu/xml/dom/html2/DomHTMLMetaElement.java
deleted file mode 100644
index 1a0440504de..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLMetaElement.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* DomHTMLMetaElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLMetaElement;
-
-/**
- * An HTML 'META' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLMetaElement
- extends DomHTMLElement
- implements HTMLMetaElement
-{
-
- protected DomHTMLMetaElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getContent()
- {
- return getHTMLAttribute("content");
- }
-
- public void setContent(String content)
- {
- setHTMLAttribute("content", content);
- }
-
- public String getHttpEquiv()
- {
- return getHTMLAttribute("http-equiv");
- }
-
- public void setHttpEquiv(String httpEquiv)
- {
- setHTMLAttribute("http-equiv", httpEquiv);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public String getScheme()
- {
- return getHTMLAttribute("scheme");
- }
-
- public void setScheme(String scheme)
- {
- setHTMLAttribute("scheme", scheme);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLModElement.java b/libjava/gnu/xml/dom/html2/DomHTMLModElement.java
deleted file mode 100644
index 493f7242ba1..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLModElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* DomHTMLModElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLModElement;
-
-/**
- * An HTML 'INS' or 'DEL' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLModElement
- extends DomHTMLElement
- implements HTMLModElement
-{
-
- protected DomHTMLModElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getCite()
- {
- return getHTMLAttribute("cite");
- }
-
- public void setCite(String cite)
- {
- setHTMLAttribute("cite", cite);
- }
-
- public String getDateTime()
- {
- return getHTMLAttribute("datetime");
- }
-
- public void setDateTime(String dateTime)
- {
- setHTMLAttribute("datetime", dateTime);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLOListElement.java b/libjava/gnu/xml/dom/html2/DomHTMLOListElement.java
deleted file mode 100644
index fb98cf40d79..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLOListElement.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* DomHTMLOListElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLOListElement;
-
-/**
- * An HTML 'OL' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLOListElement
- extends DomHTMLElement
- implements HTMLOListElement
-{
-
- protected DomHTMLOListElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public boolean getCompact()
- {
- return getBooleanHTMLAttribute("compact");
- }
-
- public void setCompact(boolean compact)
- {
- setBooleanHTMLAttribute("compact", compact);
- }
-
- public int getStart()
- {
- return getIntHTMLAttribute("start");
- }
-
- public void setStart(int start)
- {
- setIntHTMLAttribute("start", start);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public void setType(String type)
- {
- setHTMLAttribute("type", type);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLObjectElement.java b/libjava/gnu/xml/dom/html2/DomHTMLObjectElement.java
deleted file mode 100644
index fdea9b15373..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLObjectElement.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/* DomHTMLObjectElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.html2.HTMLFormElement;
-import org.w3c.dom.html2.HTMLObjectElement;
-
-/**
- * An HTML 'OBJECT' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLObjectElement
- extends DomHTMLElement
- implements HTMLObjectElement
-{
-
- protected DomHTMLObjectElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public HTMLFormElement getForm()
- {
- return (HTMLFormElement) getParentElement("form");
- }
-
- public String getCode()
- {
- return getHTMLAttribute("code");
- }
-
- public void setCode(String code)
- {
- setHTMLAttribute("code", code);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public String getArchive()
- {
- return getHTMLAttribute("archive");
- }
-
- public void setArchive(String archive)
- {
- setHTMLAttribute("archive", archive);
- }
-
- public String getBorder()
- {
- return getHTMLAttribute("border");
- }
-
- public void setBorder(String border)
- {
- setHTMLAttribute("border", border);
- }
-
- public String getCodeBase()
- {
- return getHTMLAttribute("codebase");
- }
-
- public void setCodeBase(String codeBase)
- {
- setHTMLAttribute("codebase", codeBase);
- }
-
- public String getCodeType()
- {
- return getHTMLAttribute("codetype");
- }
-
- public void setCodeType(String codeType)
- {
- setHTMLAttribute("codetype", codeType);
- }
-
- public String getData()
- {
- return getHTMLAttribute("data");
- }
-
- public void setData(String data)
- {
- setHTMLAttribute("data", data);
- }
-
- public boolean getDeclare()
- {
- return getBooleanHTMLAttribute("declare");
- }
-
- public void setDeclare(boolean declare)
- {
- setBooleanHTMLAttribute("declare", declare);
- }
-
- public String getHeight()
- {
- return getHTMLAttribute("height");
- }
-
- public void setHeight(String height)
- {
- setHTMLAttribute("height", height);
- }
-
- public int getHspace()
- {
- return getIntHTMLAttribute("hspace");
- }
-
- public void setHspace(int hspace)
- {
- setIntHTMLAttribute("hspace", hspace);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public String getStandby()
- {
- return getHTMLAttribute("standby");
- }
-
- public void setStandby(String standby)
- {
- setHTMLAttribute("standby", standby);
- }
-
- public int getTabIndex()
- {
- return getIntHTMLAttribute("tabindex");
- }
-
- public void setTabIndex(int tabIndex)
- {
- setIntHTMLAttribute("tabindex", tabIndex);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public void setType(String type)
- {
- setHTMLAttribute("type", type);
- }
-
- public String getUseMap()
- {
- return getHTMLAttribute("usemap");
- }
-
- public void setUseMap(String useMap)
- {
- setHTMLAttribute("usemap", useMap);
- }
-
- public int getVspace()
- {
- return getIntHTMLAttribute("vspace");
- }
-
- public void setVspace(int vspace)
- {
- setIntHTMLAttribute("vspace", vspace);
- }
-
- public String getWidth()
- {
- return getHTMLAttribute("width");
- }
-
- public void setWidth(String width)
- {
- setHTMLAttribute("width", width);
- }
-
- public Document getContentDocument()
- {
- // TODO getContentDocument
- return null;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLOptGroupElement.java b/libjava/gnu/xml/dom/html2/DomHTMLOptGroupElement.java
deleted file mode 100644
index 76545e130cb..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLOptGroupElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* DomHTMLOptGroupElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLOptGroupElement;
-
-/**
- * An HTML 'OPTGROUP' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLOptGroupElement
- extends DomHTMLElement
- implements HTMLOptGroupElement
-{
-
- protected DomHTMLOptGroupElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public boolean getDisabled()
- {
- return getBooleanHTMLAttribute("disabled");
- }
-
- public void setDisabled(boolean disabled)
- {
- setBooleanHTMLAttribute("disabled", disabled);
- }
-
- public String getLabel()
- {
- return getHTMLAttribute("label");
- }
-
- public void setLabel(String label)
- {
- setHTMLAttribute("label", label);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLOptionElement.java b/libjava/gnu/xml/dom/html2/DomHTMLOptionElement.java
deleted file mode 100644
index 69c059d9d43..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLOptionElement.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/* DomHTMLOptionElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLFormElement;
-import org.w3c.dom.html2.HTMLOptionElement;
-
-/**
- * An HTML 'OPTION' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLOptionElement
- extends DomHTMLElement
- implements HTMLOptionElement
-{
-
- protected Boolean selected;
-
- protected DomHTMLOptionElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public HTMLFormElement getForm()
- {
- return (HTMLFormElement) getParentElement("form");
- }
-
- public boolean getDefaultSelected()
- {
- return getBooleanHTMLAttribute("selected");
- }
-
- public void setDefaultSelected(boolean defaultSelected)
- {
- setBooleanHTMLAttribute("selected", defaultSelected);
- }
-
- public String getText()
- {
- return getTextContent();
- }
-
- public int getIndex()
- {
- return super.getIndex();
- }
-
- public boolean getDisabled()
- {
- return getBooleanHTMLAttribute("disabled");
- }
-
- public void setDisabled(boolean disabled)
- {
- setBooleanHTMLAttribute("disabled", disabled);
- }
-
- public String getLabel()
- {
- return getHTMLAttribute("label");
- }
-
- public void setLabel(String label)
- {
- setHTMLAttribute("label", label);
- }
-
- public boolean getSelected()
- {
- if (selected == null)
- {
- selected = Boolean.valueOf(getDefaultSelected());
- }
- return selected.booleanValue();
- }
-
- public void setSelected(boolean selected)
- {
- this.selected = Boolean.valueOf(selected);
- }
-
- public String getValue()
- {
- return getHTMLAttribute("value");
- }
-
- public void setValue(String value)
- {
- setHTMLAttribute("value", value);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLParagraphElement.java b/libjava/gnu/xml/dom/html2/DomHTMLParagraphElement.java
deleted file mode 100644
index 2a8c4f6fb11..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLParagraphElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLParagraphElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLParagraphElement;
-
-/**
- * An HTML 'P' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLParagraphElement
- extends DomHTMLElement
- implements HTMLParagraphElement
-{
-
- protected DomHTMLParagraphElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLParamElement.java b/libjava/gnu/xml/dom/html2/DomHTMLParamElement.java
deleted file mode 100644
index 81c6559529e..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLParamElement.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* DomHTMLParamElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLParamElement;
-
-/**
- * An HTML 'PARAM' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLParamElement
- extends DomHTMLElement
- implements HTMLParamElement
-{
-
- protected DomHTMLParamElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public void setType(String type)
- {
- setHTMLAttribute("type", type);
- }
-
- public String getValue()
- {
- return getHTMLAttribute("value");
- }
-
- public void setValue(String value)
- {
- setHTMLAttribute("value", value);
- }
-
- public String getValueType()
- {
- return getHTMLAttribute("valuetype");
- }
-
- public void setValueType(String valueType)
- {
- setHTMLAttribute("valuetype", valueType);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLParser.java b/libjava/gnu/xml/dom/html2/DomHTMLParser.java
deleted file mode 100644
index 7b445622509..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLParser.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/* DomHTMLParser.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import gnu.javax.swing.text.html.parser.support.Parser;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.LinkedList;
-
-import javax.swing.text.AttributeSet;
-import javax.swing.text.html.HTML;
-import javax.swing.text.html.parser.DTD;
-import javax.swing.text.html.parser.TagElement;
-
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.html2.HTMLDocument;
-
-/**
- * This parser reads HTML from the given stream and stores into
- * {@link HTMLDocument}. The HTML tag becomes the {@link Node}.
- * The tag attributes become the node attributes. The text inside
- * HTML tag is inserted as one or several text nodes. The nested
- * HTML tags are inserted as child nodes.
- *
- * If the strict tree structure, closing the tag means closing all
- * nested tags. To work around this, this parser closes the nested
- * tags and immediately reopens them after the closed tag.
- * In this way, <code>&lt;b&gt;&lt;i&gt;c&lt;/b&gt;d</code>
- * is parsed as <code>&lt;b&gt;&lt;i&gt;c&lt;/i&gt;&lt;/b&gt;&lt;i&gt;d</code> .
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class DomHTMLParser
- extends gnu.javax.swing.text.html.parser.support.Parser
-{
- /**
- * The target where HTML document will be inserted.
- */
- protected DomHTMLDocument document;
-
- /**
- * The subsequently created new nodes will be inserted as the
- * childs of this cursor.
- */
- protected Node cursor;
-
- /**
- * Create parser using the given DTD.
- *
- * @param dtd the DTD (for example,
- * {@link gnu.javax.swing.text.html.parser.HTML_401F}).
- */
- public DomHTMLParser(DTD dtd)
- {
- super(dtd);
- }
-
- /**
- * Parse SGML insertion ( &lt;! ... &gt; ).
- * Currently just treats it as comment.
- */
- public boolean parseMarkupDeclarations(StringBuffer strBuff)
- throws java.io.IOException
- {
- Node c = document.createComment(strBuff.toString());
- cursor.appendChild(c);
- return false;
- }
-
- /**
- * Read the document, present in the given stream, and
- * return the corresponding {@link HTMLDocument}.
- *
- * @param input a stream to read from.
- * @return a document, reflecting the structure of the provided HTML
- * text.
- *
- * @throws IOException if the reader throws one.
- */
- public HTMLDocument parseDocument(Reader input)
- throws IOException
- {
- try
- {
- document = new DomHTMLDocument();
-
- cursor = document;
-
- parse(input);
-
- DomHTMLDocument h = document;
- document = null;
- return h;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- throw new IOException("Exception: " + ex.getMessage());
- }
- }
-
- /**
- * Create a new node.
- * @param name the name of node, case insensitive.
- * @return the created node.
- */
- protected Node createNode(String name)
- {
- Node new_node = document.createElement(name.toLowerCase());
- AttributeSet hatts = getAttributes();
- NamedNodeMap natts = new_node.getAttributes();
-
- Enumeration enumeration = hatts.getAttributeNames();
- Object key;
- Node attribute;
-
- while (hatts != null)
- {
- while (enumeration.hasMoreElements())
- {
- key = enumeration.nextElement();
- attribute = document.createAttribute(key.toString());
- attribute.setNodeValue(hatts.getAttribute(key).toString());
- natts.setNamedItem(attribute);
- }
-
- // The default values are stored in a parent node.
- hatts = hatts.getResolveParent();
- }
-
- return new_node;
- }
-
- /**
- * Handle comment by inserting the comment node.
- * @param text the comment text.
- */
- protected void handleComment(char[] text)
- {
- Node c = document.createComment(new String(text));
- cursor.appendChild(c);
- }
-
- /**
- * Handle the tag with no content.
- * @param tag the tag to handle.
- */
- protected void handleEmptyTag(TagElement tag)
- {
- String name = tag.getHTMLTag().toString();
-
- if (name.equalsIgnoreCase("#pcdata"))
- return;
-
- Node c = createNode(name);
- cursor.appendChild(c);
- }
-
- /**
- * Close the given tag. Close and reopen all nested tags.
- * @param tag the tag to close.
- */
- protected void handleEndTag(TagElement tag)
- {
- String name = tag.getHTMLTag().toString();
- String nname = cursor.getNodeName();
-
- // Closing the current tag.
- if (nname != null && nname.equalsIgnoreCase(name))
- {
- cursor = cursor.getParentNode();
- }
- else
- {
- Node nCursor = cursor.getParentNode();
-
- // Remember the opened nodes.
- LinkedList open = new LinkedList();
- Node close = cursor;
- while (close != null && !close.getNodeName().equalsIgnoreCase(name))
- {
- if (close != document)
- open.addFirst(close);
- close = close.getParentNode();
- }
-
- if (close == null)
- cursor = document;
- else
- cursor = close.getParentNode();
-
- // Insert the copies of the opened nodes.
- Iterator iter = open.iterator();
- while (iter.hasNext())
- {
- Node item = (Node) iter.next();
- Node copy = item.cloneNode(true);
- cursor.appendChild(copy);
- cursor = copy;
- }
- }
- }
-
- /**
- * Handle the start tag by inserting the HTML element.
- * @param tag the tag to handle.
- */
- protected void handleStartTag(TagElement tag)
- {
- HTML.Tag h = tag.getHTMLTag();
- Node c = createNode(h.toString());
- cursor.appendChild(c);
- cursor = c;
- }
-
- /**
- * Handle text by inserting the text node.
- * @param text the text to insert.
- */
- protected void handleText(char[] text)
- {
- Node c = document.createTextNode(text, 0, text.length);
- cursor.appendChild(c);
- }
-}
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLPreElement.java b/libjava/gnu/xml/dom/html2/DomHTMLPreElement.java
deleted file mode 100644
index 9b36a288700..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLPreElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLPreElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLPreElement;
-
-/**
- * An HTML 'PRE' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLPreElement
- extends DomHTMLElement
- implements HTMLPreElement
-{
-
- protected DomHTMLPreElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public int getWidth()
- {
- return getIntHTMLAttribute("width");
- }
-
- public void setWidth(int width)
- {
- setIntHTMLAttribute("width", width);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLQuoteElement.java b/libjava/gnu/xml/dom/html2/DomHTMLQuoteElement.java
deleted file mode 100644
index 678a5ada697..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLQuoteElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLQuoteElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLQuoteElement;
-
-/**
- * An HTML 'Q' or 'BLOCKQUOTE' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLQuoteElement
- extends DomHTMLElement
- implements HTMLQuoteElement
-{
-
- protected DomHTMLQuoteElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getCite()
- {
- return getHTMLAttribute("cite");
- }
-
- public void setCite(String cite)
- {
- setHTMLAttribute("cite", cite);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLScriptElement.java b/libjava/gnu/xml/dom/html2/DomHTMLScriptElement.java
deleted file mode 100644
index 8f8fff58a82..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLScriptElement.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/* DomHTMLScriptElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLScriptElement;
-
-/**
- * An HTML 'SCRIPT' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLScriptElement
- extends DomHTMLElement
- implements HTMLScriptElement
-{
-
- protected DomHTMLScriptElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getText()
- {
- return getTextContent();
- }
-
- public void setText(String text)
- {
- setTextContent(text);
- }
-
- public String getHtmlFor()
- {
- return getHTMLAttribute("for");
- }
-
- public void setHtmlFor(String htmlFor)
- {
- setHTMLAttribute("for", htmlFor);
- }
-
- public String getEvent()
- {
- return getHTMLAttribute("event");
- }
-
- public void setEvent(String event)
- {
- setHTMLAttribute("event", event);
- }
-
- public String getCharset()
- {
- return getHTMLAttribute("charset");
- }
-
- public void setCharset(String charset)
- {
- setHTMLAttribute("charset", charset);
- }
-
- public boolean getDefer()
- {
- return getBooleanHTMLAttribute("defer");
- }
-
- public void setDefer(boolean defer)
- {
- setBooleanHTMLAttribute("defer", defer);
- }
-
- public String getSrc()
- {
- return getHTMLAttribute("src");
- }
-
- public void setSrc(String src)
- {
- setHTMLAttribute("src", src);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public void setType(String type)
- {
- setHTMLAttribute("type", type);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLSelectElement.java b/libjava/gnu/xml/dom/html2/DomHTMLSelectElement.java
deleted file mode 100644
index 09752e1ffe4..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLSelectElement.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/* DomHTMLSelectElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import gnu.xml.dom.DomDOMException;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.html2.HTMLElement;
-import org.w3c.dom.html2.HTMLFormElement;
-import org.w3c.dom.html2.HTMLOptionElement;
-import org.w3c.dom.html2.HTMLOptionsCollection;
-import org.w3c.dom.html2.HTMLSelectElement;
-
-/**
- * An HTML 'SELECT' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLSelectElement
- extends DomHTMLElement
- implements HTMLSelectElement
-{
-
- protected DomHTMLSelectElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public int getSelectedIndex()
- {
- HTMLOptionsCollection options = getOptions();
- int len = options.getLength();
- for (int i = 0; i < len; i++)
- {
- HTMLOptionElement option = (HTMLOptionElement) options.item(i);
- if (option.getSelected())
- {
- return i;
- }
- }
- return -1;
- }
-
- public void setSelectedIndex(int selectedIndex)
- {
- HTMLOptionsCollection options = getOptions();
- int len = options.getLength();
- if (selectedIndex < 0 || selectedIndex >= len)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- for (int i = 0; i < len; i++)
- {
- HTMLOptionElement option = (HTMLOptionElement) options.item(i);
- option.setSelected(i == selectedIndex);
- }
- }
-
- public String getValue()
- {
- return getHTMLAttribute("value");
- }
-
- public void setValue(String value)
- {
- setHTMLAttribute("value", value);
- }
-
- public int getLength()
- {
- return getIntHTMLAttribute("length");
- }
-
- public void setLength(int length)
- {
- setIntHTMLAttribute("length", length);
- }
-
- public HTMLFormElement getForm()
- {
- return (HTMLFormElement) getParentElement("form");
- }
-
- public HTMLOptionsCollection getOptions()
- {
- DomHTMLCollection ret =
- new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
- ret.addNodeName("option");
- ret.evaluate();
- return ret;
- }
-
- public boolean getDisabled()
- {
- return getBooleanHTMLAttribute("disabled");
- }
-
- public void setDisabled(boolean disabled)
- {
- setBooleanHTMLAttribute("disabled", disabled);
- }
-
- public boolean getMultiple()
- {
- return getBooleanHTMLAttribute("multiple");
- }
-
- public void setMultiple(boolean multiple)
- {
- setBooleanHTMLAttribute("multiple", multiple);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public int getSize()
- {
- return getIntHTMLAttribute("size");
- }
-
- public void setSize(int size)
- {
- setIntHTMLAttribute("size", size);
- }
-
- public int getTabIndex()
- {
- return getIntHTMLAttribute("tabindex");
- }
-
- public void setTabIndex(int tabIndex)
- {
- setIntHTMLAttribute("tabindex", tabIndex);
- }
-
- public void add(HTMLElement element, HTMLElement before)
- {
- insertBefore(before, element);
- }
-
- public void remove(int index)
- {
- HTMLOptionsCollection options = getOptions();
- int len = options.getLength();
- if (index < 0 || index >= len)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- HTMLOptionElement option = (HTMLOptionElement) options.item(index);
- option.getParentNode().removeChild(option);
- }
-
- public void blur()
- {
- dispatchUIEvent("blur");
- }
-
- public void focus()
- {
- dispatchUIEvent("focus");
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLStyleElement.java b/libjava/gnu/xml/dom/html2/DomHTMLStyleElement.java
deleted file mode 100644
index f6f1fcc6844..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLStyleElement.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* DomHTMLStyleElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLStyleElement;
-
-/**
- * An HTML 'STYLE' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLStyleElement
- extends DomHTMLElement
- implements HTMLStyleElement
-{
-
- protected DomHTMLStyleElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public boolean getDisabled()
- {
- return getBooleanHTMLAttribute("disabled");
- }
-
- public void setDisabled(boolean disabled)
- {
- setBooleanHTMLAttribute("disabled", disabled);
- }
-
- public String getMedia()
- {
- return getHTMLAttribute("media");
- }
-
- public void setMedia(String media)
- {
- setHTMLAttribute("media", media);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public void setType(String type)
- {
- setHTMLAttribute("type", type);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLTableCaptionElement.java b/libjava/gnu/xml/dom/html2/DomHTMLTableCaptionElement.java
deleted file mode 100644
index 28ea3418895..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLTableCaptionElement.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* DomHTMLTableCaptionElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLTableCaptionElement;
-
-/**
- * An HTML 'CAPTION' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLTableCaptionElement
- extends DomHTMLElement
- implements HTMLTableCaptionElement
-{
-
- protected DomHTMLTableCaptionElement(DomHTMLDocument owner,
- String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLTableCellElement.java b/libjava/gnu/xml/dom/html2/DomHTMLTableCellElement.java
deleted file mode 100644
index 41d33af26f8..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLTableCellElement.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/* DomHTMLTableCellElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLTableCellElement;
-
-/**
- * An HTML 'TH' or 'TD' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLTableCellElement
- extends DomHTMLElement
- implements HTMLTableCellElement
-{
-
- protected DomHTMLTableCellElement(DomHTMLDocument owner,
- String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public int getCellIndex()
- {
- return getIndex();
- }
-
- public String getAbbr()
- {
- return getHTMLAttribute("abbr");
- }
-
- public void setAbbr(String abbr)
- {
- setHTMLAttribute("abbr", abbr);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public String getAxis()
- {
- return getHTMLAttribute("axis");
- }
-
- public void setAxis(String axis)
- {
- setHTMLAttribute("axis", axis);
- }
-
- public String getBgColor()
- {
- return getHTMLAttribute("bgcolor");
- }
-
- public void setBgColor(String bgColor)
- {
- setHTMLAttribute("bgcolor", bgColor);
- }
-
- public String getCh()
- {
- return getHTMLAttribute("char");
- }
-
- public void setCh(String ch)
- {
- setHTMLAttribute("char", ch);
- }
-
- public String getChOff()
- {
- return getHTMLAttribute("charoff");
- }
-
- public void setChOff(String chOff)
- {
- setHTMLAttribute("charoff", chOff);
- }
-
- public int getColSpan()
- {
- return getIntHTMLAttribute("colspan");
- }
-
- public void setColSpan(int colSpan)
- {
- setIntHTMLAttribute("colspan", colSpan);
- }
-
- public String getHeaders()
- {
- return getHTMLAttribute("headers");
- }
-
- public void setHeaders(String headers)
- {
- setHTMLAttribute("headers", headers);
- }
-
- public String getHeight()
- {
- return getHTMLAttribute("height");
- }
-
- public void setHeight(String height)
- {
- setHTMLAttribute("height", height);
- }
-
- public boolean getNoWrap()
- {
- return getBooleanHTMLAttribute("nowrap");
- }
-
- public void setNoWrap(boolean noWrap)
- {
- setBooleanHTMLAttribute("nowrap", noWrap);
- }
-
- public int getRowSpan()
- {
- return getIntHTMLAttribute("rowspan");
- }
-
- public void setRowSpan(int rowSpan)
- {
- setIntHTMLAttribute("rowspan", rowSpan);
- }
-
- public String getScope()
- {
- return getHTMLAttribute("scope");
- }
-
- public void setScope(String scope)
- {
- setHTMLAttribute("scope", scope);
- }
-
- public String getVAlign()
- {
- return getHTMLAttribute("valign");
- }
-
- public void setVAlign(String vAlign)
- {
- setHTMLAttribute("valign", vAlign);
- }
-
- public String getWidth()
- {
- return getHTMLAttribute("width");
- }
-
- public void setWidth(String width)
- {
- setHTMLAttribute("width", width);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLTableColElement.java b/libjava/gnu/xml/dom/html2/DomHTMLTableColElement.java
deleted file mode 100644
index 799447dc81e..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLTableColElement.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/* DomHTMLTableColElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLTableColElement;
-
-/**
- * An HTML 'COL' or 'COLGROUP' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLTableColElement
- extends DomHTMLElement
- implements HTMLTableColElement
-{
-
- protected DomHTMLTableColElement(DomHTMLDocument owner,
- String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public String getCh()
- {
- return getHTMLAttribute("char");
- }
-
- public void setCh(String ch)
- {
- setHTMLAttribute("char", ch);
- }
-
- public String getChOff()
- {
- return getHTMLAttribute("charoff");
- }
-
- public void setChOff(String chOff)
- {
- setHTMLAttribute("charoff", chOff);
- }
-
- public int getSpan()
- {
- return getIntHTMLAttribute("span");
- }
-
- public void setSpan(int span)
- {
- setIntHTMLAttribute("span", span);
- }
-
- public String getVAlign()
- {
- return getHTMLAttribute("valign");
- }
-
- public void setVAlign(String vAlign)
- {
- setHTMLAttribute("valign", vAlign);
- }
-
- public String getWidth()
- {
- return getHTMLAttribute("width");
- }
-
- public void setWidth(String width)
- {
- setHTMLAttribute("width", width);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLTableElement.java b/libjava/gnu/xml/dom/html2/DomHTMLTableElement.java
deleted file mode 100644
index 73a3a45c61d..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLTableElement.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/* DomHTMLTableElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import gnu.xml.dom.DomDOMException;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.html2.HTMLCollection;
-import org.w3c.dom.html2.HTMLElement;
-import org.w3c.dom.html2.HTMLTableCaptionElement;
-import org.w3c.dom.html2.HTMLTableElement;
-import org.w3c.dom.html2.HTMLTableSectionElement;
-
-/**
- * An HTML 'TABLE' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLTableElement
- extends DomHTMLElement
- implements HTMLTableElement
-{
-
- protected DomHTMLTableElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public HTMLTableCaptionElement getCaption()
- {
- return (HTMLTableCaptionElement) getChildElement("caption");
- }
-
- public void setCaption(HTMLTableCaptionElement caption)
- {
- HTMLTableCaptionElement ref = getCaption();
- if (ref == null)
- {
- appendChild(caption);
- }
- else
- {
- replaceChild(caption, ref);
- }
- }
-
- public HTMLTableSectionElement getTHead()
- {
- return (HTMLTableSectionElement) getChildElement("thead");
- }
-
- public void setTHead(HTMLTableSectionElement tHead)
- {
- HTMLTableSectionElement ref = getTHead();
- if (ref == null)
- {
- appendChild(tHead);
- }
- else
- {
- replaceChild(tHead, ref);
- }
- }
-
- public HTMLTableSectionElement getTFoot()
- {
- return (HTMLTableSectionElement) getChildElement("tfoot");
- }
-
- public void setTFoot(HTMLTableSectionElement tFoot)
- {
- HTMLTableSectionElement ref = getTFoot();
- if (ref == null)
- {
- appendChild(tFoot);
- }
- else
- {
- replaceChild(tFoot, ref);
- }
- }
-
- public HTMLCollection getRows()
- {
- DomHTMLCollection ret =
- new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
- ret.addNodeName("tr");
- ret.evaluate();
- return ret;
- }
-
- public HTMLCollection getTBodies()
- {
- DomHTMLCollection ret =
- new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
- ret.addNodeName("tbody");
- ret.evaluate();
- return ret;
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public String getBgColor()
- {
- return getHTMLAttribute("bgcolor");
- }
-
- public void setBgColor(String bgColor)
- {
- setHTMLAttribute("bgcolor", bgColor);
- }
-
- public String getBorder()
- {
- return getHTMLAttribute("border");
- }
-
- public void setBorder(String border)
- {
- setHTMLAttribute("border", border);
- }
-
- public String getCellPadding()
- {
- return getHTMLAttribute("cellpadding");
- }
-
- public void setCellPadding(String cellPadding)
- {
- setHTMLAttribute("cellpadding", cellPadding);
- }
-
- public String getCellSpacing()
- {
- return getHTMLAttribute("cellspacing");
- }
-
- public void setCellSpacing(String cellSpacing)
- {
- setHTMLAttribute("cellspacing", cellSpacing);
- }
-
- public String getFrame()
- {
- return getHTMLAttribute("frame");
- }
-
- public void setFrame(String frame)
- {
- setHTMLAttribute("frame", frame);
- }
-
- public String getRules()
- {
- return getHTMLAttribute("rules");
- }
-
- public void setRules(String rules)
- {
- setHTMLAttribute("rules", rules);
- }
-
- public String getSummary()
- {
- return getHTMLAttribute("summary");
- }
-
- public void setSummary(String summary)
- {
- setHTMLAttribute("summary", summary);
- }
-
- public String getWidth()
- {
- return getHTMLAttribute("width");
- }
-
- public void setWidth(String width)
- {
- setHTMLAttribute("width", width);
- }
-
- public HTMLElement createTHead()
- {
- HTMLTableSectionElement ref = getTHead();
- if (ref == null)
- {
- return (HTMLElement) getOwnerDocument().createElement("thead");
- }
- else
- {
- return ref;
- }
- }
-
- public void deleteTHead()
- {
- HTMLTableSectionElement ref = getTHead();
- if (ref != null)
- {
- removeChild(ref);
- }
- }
-
- public HTMLElement createTFoot()
- {
- HTMLTableSectionElement ref = getTFoot();
- if (ref == null)
- {
- return (HTMLElement) getOwnerDocument().createElement("tfoot");
- }
- else
- {
- return ref;
- }
- }
-
- public void deleteTFoot()
- {
- HTMLTableSectionElement ref = getTFoot();
- if (ref != null)
- {
- removeChild(ref);
- }
- }
-
- public HTMLElement createCaption()
- {
- HTMLTableCaptionElement ref = getCaption();
- if (ref == null)
- {
- return (HTMLElement) getOwnerDocument().createElement("caption");
- }
- else
- {
- return ref;
- }
- }
-
- public void deleteCaption()
- {
- HTMLTableCaptionElement ref = getCaption();
- if (ref != null)
- {
- removeChild(ref);
- }
- }
-
- public HTMLElement insertRow(int index)
- {
- Node ref = getRow(index);
- Node row = getOwnerDocument().createElement("tr");
- if (ref == null)
- {
- Node tbody = getChildElement("tbody");
- if (tbody == null)
- {
- tbody = getOwnerDocument().createElement("tfoot");
- appendChild(tbody);
- }
- tbody.appendChild(row);
- }
- else
- {
- ref.getParentNode().insertBefore(row, ref);
- }
- return (HTMLElement) row;
- }
-
- public void deleteRow(int index)
- {
- Node ref = getRow(index);
- if (ref == null)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- ref.getParentNode().removeChild(ref);
- }
-
- Node getRow(final int index)
- {
- int i = 0;
- Node thead = getChildElement("thead");
- if (thead != null)
- {
- for (Node ctx = thead.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (!"tr".equalsIgnoreCase(ctx.getLocalName()))
- {
- continue;
- }
- if (index == i)
- {
- return ctx;
- }
- i++;
- }
- }
- Node tbody = getChildElement("tbody");
- if (tbody == null)
- {
- tbody = this;
- }
- for (Node ctx = tbody.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (!"tr".equalsIgnoreCase(ctx.getLocalName()))
- {
- continue;
- }
- if (index == i)
- {
- return ctx;
- }
- i++;
- }
- Node tfoot = getChildElement("tfoot");
- if (tfoot != null)
- {
- for (Node ctx = tfoot.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (!"tr".equalsIgnoreCase(ctx.getLocalName()))
- {
- continue;
- }
- if (index == i)
- {
- return ctx;
- }
- i++;
- }
- }
- return null;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLTableRowElement.java b/libjava/gnu/xml/dom/html2/DomHTMLTableRowElement.java
deleted file mode 100644
index 2a1b6785a5d..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLTableRowElement.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/* DomHTMLTableRowElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import gnu.xml.dom.DomDOMException;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.html2.HTMLCollection;
-import org.w3c.dom.html2.HTMLElement;
-import org.w3c.dom.html2.HTMLTableRowElement;
-
-/**
- * An HTML 'TR' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLTableRowElement
- extends DomHTMLElement
- implements HTMLTableRowElement
-{
-
- protected DomHTMLTableRowElement(DomHTMLDocument owner,
- String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public int getRowIndex()
- {
- return getIndex();
- }
-
- public int getSectionRowIndex()
- {
- int index = 0;
- DomHTMLElement parent = (DomHTMLElement) getParentElement("table");
- if (parent != null)
- {
- Node thead = parent.getChildElement("thead");
- if (thead != null)
- {
- for (Node ctx = thead.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (ctx == this)
- {
- return index;
- }
- index++;
- }
- }
- Node tbody = parent.getChildElement("tbody");
- if (tbody != null)
- {
- for (Node ctx = tbody.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (ctx == this)
- {
- return index;
- }
- index++;
- }
- }
- Node tfoot = parent.getChildElement("tfoot");
- if (tfoot != null)
- {
- for (Node ctx = tfoot.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (ctx == this)
- {
- return index;
- }
- index++;
- }
- }
- }
- throw new DomDOMException(DOMException.NOT_FOUND_ERR);
- }
-
- public HTMLCollection getCells()
- {
- DomHTMLCollection ret =
- new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
- ret.addNodeName("th");
- ret.addNodeName("td");
- ret.evaluate();
- return ret;
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public String getBgColor()
- {
- return getHTMLAttribute("bgcolor");
- }
-
- public void setBgColor(String bgColor)
- {
- setHTMLAttribute("bgcolor", bgColor);
- }
-
- public String getCh()
- {
- return getHTMLAttribute("char");
- }
-
- public void setCh(String ch)
- {
- setHTMLAttribute("char", ch);
- }
-
- public String getChOff()
- {
- return getHTMLAttribute("charoff");
- }
-
- public void setChOff(String chOff)
- {
- setHTMLAttribute("charoff", chOff);
- }
-
- public String getVAlign()
- {
- return getHTMLAttribute("valign");
- }
-
- public void setVAlign(String vAlign)
- {
- setHTMLAttribute("valign", vAlign);
- }
-
- public HTMLElement insertCell(int index)
- {
- Node ref = getCell(index);
- Node cell = getOwnerDocument().createElement("td");
- if (ref == null)
- {
- appendChild(cell);
- }
- else
- {
- insertBefore(cell, ref);
- }
- return (HTMLElement) cell;
- }
-
- public void deleteCell(int index)
- {
- Node ref = getCell(index);
- if (ref == null)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- removeChild(ref);
- }
-
- Node getCell(final int index)
- {
- int i = 0;
- for (Node ctx = getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- String name = ctx.getLocalName();
- if (!"td".equalsIgnoreCase(name) &&
- !"th".equalsIgnoreCase(name))
- {
- continue;
- }
- if (index == i)
- {
- return ctx;
- }
- i++;
- }
- return null;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLTableSectionElement.java b/libjava/gnu/xml/dom/html2/DomHTMLTableSectionElement.java
deleted file mode 100644
index 79cce67feeb..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLTableSectionElement.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* DomHTMLTableSectionElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import gnu.xml.dom.DomDOMException;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.html2.HTMLCollection;
-import org.w3c.dom.html2.HTMLElement;
-import org.w3c.dom.html2.HTMLTableSectionElement;
-
-/**
- * An HTML 'THEAD', 'TFOOT', or 'TBODY' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLTableSectionElement
- extends DomHTMLElement
- implements HTMLTableSectionElement
-{
-
- protected DomHTMLTableSectionElement(DomHTMLDocument owner,
- String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getAlign()
- {
- return getHTMLAttribute("align");
- }
-
- public void setAlign(String align)
- {
- setHTMLAttribute("align", align);
- }
-
- public String getCh()
- {
- return getHTMLAttribute("char");
- }
-
- public void setCh(String ch)
- {
- setHTMLAttribute("char", ch);
- }
-
- public String getChOff()
- {
- return getHTMLAttribute("charoff");
- }
-
- public void setChOff(String chOff)
- {
- setHTMLAttribute("charoff", chOff);
- }
-
- public String getVAlign()
- {
- return getHTMLAttribute("valign");
- }
-
- public void setVAlign(String vAlign)
- {
- setHTMLAttribute("valign", vAlign);
- }
-
- public HTMLCollection getRows()
- {
- DomHTMLCollection ret =
- new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
- ret.addNodeName("tr");
- ret.evaluate();
- return ret;
- }
-
- public HTMLElement insertRow(int index)
- {
- Node ref = getRow(index);
- Node row = getOwnerDocument().createElement("tr");
- if (ref == null)
- {
- appendChild(row);
- }
- else
- {
- insertBefore(row, ref);
- }
- return (HTMLElement) row;
- }
-
- public void deleteRow(int index)
- {
- Node ref = getRow(index);
- if (ref == null)
- {
- throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
- }
- removeChild(ref);
- }
-
- Node getRow(final int index)
- {
- int i = 0;
- for (Node ctx = getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (!"tr".equalsIgnoreCase(ctx.getLocalName()))
- {
- continue;
- }
- if (index == i)
- {
- return ctx;
- }
- i++;
- }
- return null;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLTextAreaElement.java b/libjava/gnu/xml/dom/html2/DomHTMLTextAreaElement.java
deleted file mode 100644
index 22d6105696f..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLTextAreaElement.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/* DomHTMLTextAreaElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLFormElement;
-import org.w3c.dom.html2.HTMLTextAreaElement;
-
-/**
- * An HTML 'TEXTAREA' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLTextAreaElement
- extends DomHTMLElement
- implements HTMLTextAreaElement
-{
-
- protected String value;
-
- protected DomHTMLTextAreaElement(DomHTMLDocument owner,
- String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getDefaultValue()
- {
- return getHTMLAttribute("value");
- }
-
- public void setDefaultValue(String defaultValue)
- {
- setHTMLAttribute("value", defaultValue);
- }
-
- public HTMLFormElement getForm()
- {
- return (HTMLFormElement) getParentElement("form");
- }
-
- public String getAccessKey()
- {
- return getHTMLAttribute("accesskey");
- }
-
- public void setAccessKey(String accessKey)
- {
- setHTMLAttribute("accesskey", accessKey);
- }
-
- public int getCols()
- {
- return getIntHTMLAttribute("cols");
- }
-
- public void setCols(int cols)
- {
- setIntHTMLAttribute("cols", cols);
- }
-
- public boolean getDisabled()
- {
- return getBooleanHTMLAttribute("disabled");
- }
-
- public void setDisabled(boolean disabled)
- {
- setBooleanHTMLAttribute("disabled", disabled);
- }
-
- public String getName()
- {
- return getHTMLAttribute("name");
- }
-
- public void setName(String name)
- {
- setHTMLAttribute("name", name);
- }
-
- public boolean getReadOnly()
- {
- return getBooleanHTMLAttribute("readOnly");
- }
-
- public void setReadOnly(boolean readOnly)
- {
- setBooleanHTMLAttribute("readonly", readOnly);
- }
-
- public int getRows()
- {
- return getIntHTMLAttribute("rows");
- }
-
- public void setRows(int rows)
- {
- setIntHTMLAttribute("rows", rows);
- }
-
- public int getTabIndex()
- {
- return getIntHTMLAttribute("tabindex");
- }
-
- public void setTabIndex(int tabIndex)
- {
- setIntHTMLAttribute("tabindex", tabIndex);
- }
-
- public String getType()
- {
- return "textarea";
- }
-
- public String getValue()
- {
- if (value == null)
- {
- value = getDefaultValue();
- }
- return value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
- public void blur()
- {
- dispatchUIEvent("blur");
- }
-
- public void focus()
- {
- dispatchUIEvent("focus");
- }
-
- public void select()
- {
- dispatchUIEvent("select");
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLTitleElement.java b/libjava/gnu/xml/dom/html2/DomHTMLTitleElement.java
deleted file mode 100644
index f62342d6ff5..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLTitleElement.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DomHTMLTitleElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLTitleElement;
-
-/**
- * An HTML 'TITLE' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLTitleElement
- extends DomHTMLElement
- implements HTMLTitleElement
-{
-
- protected DomHTMLTitleElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public String getText()
- {
- return getTextContent();
- }
-
- public void setText(String text)
- {
- setTextContent(text);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/html2/DomHTMLUListElement.java b/libjava/gnu/xml/dom/html2/DomHTMLUListElement.java
deleted file mode 100644
index c07adeabf20..00000000000
--- a/libjava/gnu/xml/dom/html2/DomHTMLUListElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* DomHTMLUListElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.html2;
-
-import org.w3c.dom.html2.HTMLUListElement;
-
-/**
- * An HTML 'UL' element node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomHTMLUListElement
- extends DomHTMLElement
- implements HTMLUListElement
-{
-
- protected DomHTMLUListElement(DomHTMLDocument owner, String namespaceURI,
- String name)
- {
- super(owner, namespaceURI, name);
- }
-
- public boolean getCompact()
- {
- return getBooleanHTMLAttribute("compact");
- }
-
- public void setCompact(boolean compact)
- {
- setBooleanHTMLAttribute("compact", compact);
- }
-
- public String getType()
- {
- return getHTMLAttribute("type");
- }
-
- public void setType(String type)
- {
- setHTMLAttribute("type", type);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/ls/DomLSException.java b/libjava/gnu/xml/dom/ls/DomLSException.java
deleted file mode 100644
index 6ac49e66934..00000000000
--- a/libjava/gnu/xml/dom/ls/DomLSException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomLSException
- extends LSException
-{
-
- public DomLSException(short type, Exception cause)
- {
- super(type, (cause == null) ? null : cause.getMessage());
- initCause(cause);
- }
-
-}
diff --git a/libjava/gnu/xml/dom/ls/DomLSInput.java b/libjava/gnu/xml/dom/ls/DomLSInput.java
deleted file mode 100644
index 44274ec4734..00000000000
--- a/libjava/gnu/xml/dom/ls/DomLSInput.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* DomLSInput.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import org.w3c.dom.ls.LSInput;
-
-/**
- * Specification of XML input to parse.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomLSInput
- implements LSInput
-{
-
- private InputStream in;
- private String systemId;
- private String publicId;
- private String baseURI;
- private String encoding;
- private boolean certifiedText;
-
- public Reader getCharacterStream()
- {
- return new InputStreamReader(in);
- }
-
- public void setCharacterStream(Reader characterStream)
- {
- in = new ReaderInputStream(characterStream);
- }
-
- public InputStream getByteStream()
- {
- return in;
- }
-
- public void setByteStream(InputStream byteStream)
- {
- in = byteStream;
- }
-
- public String getStringData()
- {
- StringBuffer acc = new StringBuffer();
- Reader reader = getCharacterStream();
- try
- {
- char[] buf = new char[4096];
- for (int len = reader.read(buf); len != -1; len = reader.read(buf))
- {
- acc.append(buf, 0, len);
- }
- }
- catch (IOException e)
- {
- return null; // ?
- }
- return acc.toString();
- }
-
- public void setStringData(String stringData)
- {
- in = new ReaderInputStream(new StringReader(stringData));
- }
-
- public String getSystemId()
- {
- return systemId;
- }
-
- public void setSystemId(String systemId)
- {
- this.systemId = systemId;
- }
-
- public String getPublicId()
- {
- return publicId;
- }
-
- public void setPublicId(String publicId)
- {
- this.publicId = publicId;
- }
-
- public String getBaseURI()
- {
- return baseURI;
- }
-
- public void setBaseURI(String baseURI)
- {
- this.baseURI = baseURI;
- }
-
- public String getEncoding()
- {
- return encoding;
- }
-
- public void setEncoding(String encoding)
- {
- this.encoding = encoding;
- }
-
- public boolean getCertifiedText()
- {
- return certifiedText;
- }
-
- public void setCertifiedText(boolean certifiedText)
- {
- this.certifiedText = certifiedText;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/ls/DomLSOutput.java b/libjava/gnu/xml/dom/ls/DomLSOutput.java
deleted file mode 100644
index c2f4d4132ce..00000000000
--- a/libjava/gnu/xml/dom/ls/DomLSOutput.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* DomLSOutput.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import org.w3c.dom.ls.LSOutput;
-
-/**
- * Specification of XML output to produce.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomLSOutput
- implements LSOutput
-{
-
- private OutputStream out;
- private String systemId;
- private String encoding;
-
- public Writer getCharacterStream()
- {
- return new OutputStreamWriter(out);
- }
-
- public void setCharacterStream(Writer characterStream)
- {
- out = new WriterOutputStream(characterStream);
- }
-
- public OutputStream getByteStream()
- {
- return out;
- }
-
- public void setByteStream(OutputStream out)
- {
- this.out = out;
- }
-
- public String getSystemId()
- {
- return systemId;
- }
-
- public void setSystemId(String systemId)
- {
- this.systemId = systemId;
- }
-
- public String getEncoding()
- {
- return encoding;
- }
-
- public void setEncoding(String encoding)
- {
- this.encoding = encoding;
- }
-
-}
diff --git a/libjava/gnu/xml/dom/ls/DomLSParser.java b/libjava/gnu/xml/dom/ls/DomLSParser.java
deleted file mode 100644
index eb7c1c49f3a..00000000000
--- a/libjava/gnu/xml/dom/ls/DomLSParser.java
+++ /dev/null
@@ -1,574 +0,0 @@
-/* DomLSParser.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.File;
-import java.io.InputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMStringList;
-import org.w3c.dom.Node;
-import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.LSException;
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSParser;
-import org.w3c.dom.ls.LSParserFilter;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import gnu.xml.dom.DomDocument;
-import gnu.xml.dom.DomDOMException;
-
-/**
- * Parser implementation for GNU DOM.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomLSParser
- implements LSParser, DOMConfiguration, DOMStringList, ErrorHandler
-{
-
- private static final List SUPPORTED_PARAMETERS
- = Arrays.asList(new String[] { "cdata-sections",
- "comments",
- "element-content-whitespace",
- "namespaces",
- "expand-entity-references",
- "coalescing",
- "validating",
- "xinclude-aware",
- "entity-resolver",
- "error-handler" });
-
- private LSParserFilter filter;
- private final boolean async;
- private String schemaType;
- private SAXEventSink eventSink;
- private SAXParserFactory factory;
- private XMLReader reader;
-
- private boolean namespaceAware = true;
- private boolean ignoreWhitespace;
- private boolean expandEntityReferences;
- private boolean ignoreComments;
- private boolean coalescing;
- private boolean validating;
- private boolean xIncludeAware;
- private EntityResolver entityResolver;
- private ErrorHandler errorHandler;
-
- public DomLSParser(short mode, String schemaType)
- throws DOMException
- {
- switch (mode)
- {
- case DOMImplementationLS.MODE_ASYNCHRONOUS:
- async = true;
- break;
- case DOMImplementationLS.MODE_SYNCHRONOUS:
- async = false;
- break;
- default:
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
- // TODO schemaType
- this.schemaType = schemaType;
- factory = SAXParserFactory.newInstance();
- }
-
- // -- LSParser --
-
- public DOMConfiguration getDomConfig()
- {
- return this;
- }
-
- public LSParserFilter getFilter()
- {
- return filter;
- }
-
- public void setFilter(LSParserFilter filter)
- {
- this.filter = filter;
- }
-
- public boolean getAsync()
- {
- return async;
- }
-
- public boolean getBusy()
- {
- return eventSink != null;
- }
-
- public Document parse(LSInput input)
- throws DOMException, LSException
- {
- if (async)
- {
- return doParse(input);
- }
- else
- {
- synchronized (this)
- {
- return doParse(input);
- }
- }
- }
-
- public Document parseURI(String uri)
- throws DOMException, LSException
- {
- LSInput input = new DomLSInput();
- input.setSystemId(uri);
- return parse(input);
- }
-
- public Node parseWithContext(LSInput input, Node context, short action)
- throws DOMException, LSException
- {
- Document doc = (context.getNodeType() == Node.DOCUMENT_NODE) ?
- (Document) context : context.getOwnerDocument();
- input.setBaseURI(doc.getDocumentURI());
- // TODO use namespaces defined on context node
- Document ret = parse(input);
- Node root = ret.getDocumentElement();
- root = doc.adoptNode(root);
- switch (action)
- {
- case ACTION_APPEND_AS_CHILDREN:
- context.appendChild(root);
- break;
- case ACTION_REPLACE_CHILDREN:
- Node c1 = context.getFirstChild();
- while (c1 != null)
- {
- Node next = c1.getNextSibling();
- context.removeChild(c1);
- c1 = next;
- }
- context.appendChild(root);
- break;
- case ACTION_INSERT_BEFORE:
- Node p1 = context.getParentNode();
- p1.insertBefore(root, context);
- break;
- case ACTION_INSERT_AFTER:
- Node p2 = context.getParentNode();
- Node r1 = context.getNextSibling();
- if (r1 == null)
- {
- p2.appendChild(root);
- }
- else
- {
- p2.insertBefore(root, r1);
- }
- break;
- case ACTION_REPLACE:
- Node p3 = context.getParentNode();
- Node r2 = context.getNextSibling();
- p3.removeChild(context);
- if (r2 == null)
- {
- p3.appendChild(root);
- }
- else
- {
- p3.insertBefore(root, r2);
- }
- break;
- }
- return root;
- }
-
- public void abort()
- {
- if (eventSink != null)
- {
- eventSink.interrupt();
- }
- }
-
- private Document doParse(LSInput input)
- throws DOMException, LSException
- {
- // create event sink
- if (eventSink != null)
- {
- throw new LSException(LSException.PARSE_ERR, "parse in progress");
- }
- InputSource source = getInputSource(input);
- eventSink = (filter == null) ? new SAXEventSink() :
- new FilteredSAXEventSink(filter);
- // configure sink
- eventSink.namespaceAware = namespaceAware;
- eventSink.ignoreWhitespace = ignoreWhitespace;
- eventSink.expandEntityReferences = expandEntityReferences;
- eventSink.ignoreComments = ignoreComments;
- eventSink.coalescing = coalescing;
- // get and configure reader
- XMLReader reader = getXMLReader();
- try
- {
- reader.setContentHandler(eventSink);
- reader.setDTDHandler(eventSink);
- reader.setProperty("http://xml.org/sax/properties/lexical-handler",
- eventSink);
- reader.setProperty("http://xml.org/sax/properties/declaration-handler",
- eventSink);
- reader.setFeature("http://xml.org/sax/features/namespaces",
- namespaceAware);
- reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
- true);
- reader.setFeature("http://xml.org/sax/features/validation",
- validating);
- try
- {
- reader.setFeature("http://xml.org/sax/features/use-attributes2",
- true);
- }
- catch (SAXNotRecognizedException e)
- {
- // ignore
- }
- try
- {
- reader.setFeature("http://xml.org/sax/features/external-general-entities",
- true);
- }
- catch (SAXNotRecognizedException e)
- {
- // ignore
- }
- reader.setEntityResolver(entityResolver);
- reader.setErrorHandler(errorHandler);
- // parse
- reader.parse(source);
- }
- catch (DOMException e)
- {
- reader = null;
- eventSink = null;
- throw e;
- }
- catch (SAXException e)
- {
- reader = null;
- eventSink = null;
- throw new DomLSException(LSException.PARSE_ERR, e);
- }
- catch (IOException e)
- {
- reader = null;
- eventSink = null;
- throw new DomLSException(LSException.PARSE_ERR, e);
- }
- // return document
- Document ret = eventSink.doc;
- String systemId = input.getSystemId();
- if (systemId != null && ret instanceof DomDocument)
- {
- ((DomDocument) ret).setDocumentURI(systemId);
- }
- eventSink = null;
- return ret;
- }
-
- private XMLReader getXMLReader()
- throws LSException
- {
- if (reader == null)
- {
- factory.setNamespaceAware(namespaceAware);
- factory.setValidating(validating);
- factory.setXIncludeAware(xIncludeAware);
- try
- {
- SAXParser parser = factory.newSAXParser();
- reader = parser.getXMLReader();
- }
- catch (ParserConfigurationException e)
- {
- throw new DomLSException(LSException.PARSE_ERR, e);
- }
- catch (SAXException e)
- {
- throw new DomLSException(LSException.PARSE_ERR, e);
- }
- }
- return reader;
- }
-
- private InputSource getInputSource(LSInput input)
- throws LSException
- {
- InputSource source = null;
- String systemId = input.getSystemId();
- InputStream in = input.getByteStream();
- if (in != null)
- {
- source = new InputSource(in);
- source.setSystemId(systemId);
- }
- if (source == null && entityResolver != null)
- {
- String publicId = input.getPublicId();
- try
- {
- source = entityResolver.resolveEntity(publicId, systemId);
- }
- catch (SAXException e)
- {
- throw new DomLSException(LSException.PARSE_ERR, e);
- }
- catch (IOException e)
- {
- throw new DomLSException(LSException.PARSE_ERR, e);
- }
- }
- if (source == null)
- {
- URL url = null;
- String base = input.getBaseURI();
- try
- {
- try
- {
- URL baseURL = (base == null) ? null : new URL(base);
- url = (baseURL == null) ? new URL(systemId) :
- new URL(baseURL, systemId);
- }
- catch (MalformedURLException e)
- {
- File baseFile = (base == null) ? null : new File(base);
- url = (baseFile == null) ? new File(systemId).toURL() :
- new File(baseFile, systemId).toURL();
- }
- in = url.openStream();
- systemId = url.toString();
- source = new InputSource(in);
- source.setSystemId(systemId);
- }
- catch (IOException e)
- {
- throw new DomLSException(LSException.PARSE_ERR, e);
- }
- }
- return source;
- }
-
- // -- DOMConfiguration --
-
- public void setParameter(String name, Object value)
- throws DOMException
- {
- name = name.toLowerCase();
- if ("cdata-sections".equals(name))
- {
- coalescing = !((Boolean) value).booleanValue();
- }
- else if ("comments".equals(name))
- {
- ignoreComments = !((Boolean) value).booleanValue();
- }
- else if ("element-content-whitespace".equals(name))
- {
- ignoreWhitespace = !((Boolean) value).booleanValue();
- }
- else if ("namespaces".equals(name))
- {
- namespaceAware = ((Boolean) value).booleanValue();
- }
- else if ("expand-entity-references".equals(name))
- {
- expandEntityReferences = ((Boolean) value).booleanValue();
- }
- else if ("coalescing".equals(name))
- {
- coalescing = ((Boolean) value).booleanValue();
- }
- else if ("validating".equals(name))
- {
- validating = ((Boolean) value).booleanValue();
- }
- else if ("xinclude-aware".equals(name))
- {
- xIncludeAware = ((Boolean) value).booleanValue();
- }
- else if ("entity-resolver".equals(name))
- {
- entityResolver = (EntityResolver) value;
- }
- else if ("error-handler".equals(name))
- {
- errorHandler = (ErrorHandler) value;
- }
- else
- {
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
- // invalidate reader, a new one will be created
- reader = null;
- }
-
- public Object getParameter(String name)
- throws DOMException
- {
- name = name.toLowerCase();
- if ("cdata-sections".equals(name))
- {
- return coalescing ? Boolean.FALSE : Boolean.TRUE;
- }
- else if ("comments".equals(name))
- {
- return ignoreComments ? Boolean.FALSE : Boolean.TRUE;
- }
- else if ("element-content-whitespace".equals(name))
- {
- return ignoreWhitespace ? Boolean.FALSE : Boolean.TRUE;
- }
- else if ("namespaces".equals(name))
- {
- return namespaceAware ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("expand-entity-references".equals(name))
- {
- return expandEntityReferences ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("coalescing".equals(name))
- {
- return coalescing ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("validating".equals(name))
- {
- return validating ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("xinclude-aware".equals(name))
- {
- return xIncludeAware ? Boolean.TRUE : Boolean.FALSE;
- }
- else if ("entity-resolver".equals(name))
- {
- return entityResolver;
- }
- else if ("error-handler".equals(name))
- {
- return errorHandler;
- }
- else
- {
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
- }
-
- public boolean canSetParameter(String name, Object value)
- {
- return contains(name);
- }
-
- public DOMStringList getParameterNames()
- {
- return this;
- }
-
- // -- DOMStringList --
-
- public String item(int i)
- {
- return (String) SUPPORTED_PARAMETERS.get(i);
- }
-
- public int getLength()
- {
- return SUPPORTED_PARAMETERS.size();
- }
-
- public boolean contains(String str)
- {
- return SUPPORTED_PARAMETERS.contains(str);
- }
-
- // -- ErrorHandler --
-
- public void warning(SAXParseException e)
- throws SAXException
- {
- if (errorHandler != null)
- {
- errorHandler.warning(e);
- }
- }
-
- public void error(SAXParseException e)
- throws SAXException
- {
- if (errorHandler != null)
- {
- errorHandler.error(e);
- }
- }
-
- public void fatalError(SAXParseException e)
- throws SAXException
- {
- if (errorHandler != null)
- {
- errorHandler.fatalError(e);
- }
- abort();
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/ls/DomLSSerializer.java b/libjava/gnu/xml/dom/ls/DomLSSerializer.java
deleted file mode 100644
index cedaf151e70..00000000000
--- a/libjava/gnu/xml/dom/ls/DomLSSerializer.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/* DomLSSerializer.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Arrays;
-import java.util.List;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMStringList;
-import org.w3c.dom.Node;
-import org.w3c.dom.ls.LSException;
-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.DomDOMException;
-import gnu.xml.transform.StreamSerializer;
-
-/**
- * Serialize a DOM node to a stream.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomLSSerializer
- extends StreamSerializer
- implements LSSerializer, DOMConfiguration, DOMStringList
-{
-
- private static final List SUPPORTED_PARAMETERS =
- Arrays.asList(new String[] {"discard-default-content",
- "xml-declaration"});
-
- private LSSerializerFilter filter;
- private StreamSerializer serializer;
-
- public DomLSSerializer()
- {
- super();
- discardDefaultContent = true;
- }
-
- // -- LSSerializer --
-
- public DOMConfiguration getDomConfig()
- {
- return this;
- }
-
- public String getNewLine()
- {
- return eol;
- }
-
- public void setNewLine(String newLine)
- {
- if (newLine == null)
- {
- newLine = System.getProperty("line.separator");
- }
- eol = newLine;
- }
-
- public LSSerializerFilter getFilter()
- {
- return filter;
- }
-
- public void setFilter(LSSerializerFilter filter)
- {
- this.filter = filter;
- }
-
- public boolean write(Node node, LSOutput output)
- throws LSException
- {
- OutputStream out = output.getByteStream();
- try
- {
- if (out == null)
- {
- String systemId = output.getSystemId();
- try
- {
- URL url = new URL(systemId);
- URLConnection connection = url.openConnection();
- connection.setDoOutput(true);
- if (connection instanceof HttpURLConnection)
- {
- ((HttpURLConnection) connection).setRequestMethod("PUT");
- }
- out = connection.getOutputStream();
- }
- catch (MalformedURLException e)
- {
- File file = new File(systemId);
- out = new FileOutputStream(file);
- }
- }
- serialize(node, out);
- out.flush();
- return true;
- }
- catch (IOException e)
- {
- throw new DomLSException(LSException.SERIALIZE_ERR, e);
- }
- }
-
- public boolean writeToURI(Node node, String uri)
- throws LSException
- {
- LSOutput output = new DomLSOutput();
- output.setSystemId(uri);
- return write(node, output);
- }
-
- public String writeToString(Node node)
- throws DOMException, LSException
- {
- Writer writer = new StringWriter();
- LSOutput output = new DomLSOutput();
- output.setCharacterStream(writer);
- write(node, output);
- return writer.toString();
- }
-
- public void serialize(Node node, OutputStream out)
- throws IOException
- {
- if (filter == null)
- {
- super.serialize(node, out);
- }
- else
- {
- int wts = filter.getWhatToShow();
- if (wts != NodeFilter.SHOW_ALL)
- {
- switch (node.getNodeType())
- {
- case Node.ATTRIBUTE_NODE:
- if ((wts & NodeFilter.SHOW_ATTRIBUTE) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.TEXT_NODE:
- if ((wts & NodeFilter.SHOW_TEXT) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.ELEMENT_NODE:
- if ((wts & NodeFilter.SHOW_ELEMENT) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.CDATA_SECTION_NODE:
- if ((wts & NodeFilter.SHOW_CDATA_SECTION) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.COMMENT_NODE:
- if ((wts & NodeFilter.SHOW_COMMENT) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.DOCUMENT_NODE:
- if ((wts & NodeFilter.SHOW_DOCUMENT) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.DOCUMENT_TYPE_NODE:
- if ((wts & NodeFilter.SHOW_DOCUMENT_TYPE) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.PROCESSING_INSTRUCTION_NODE:
- if ((wts & NodeFilter.SHOW_PROCESSING_INSTRUCTION) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.DOCUMENT_FRAGMENT_NODE:
- if ((wts & NodeFilter.SHOW_DOCUMENT_FRAGMENT) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.ENTITY_NODE:
- if ((wts & NodeFilter.SHOW_ENTITY) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.ENTITY_REFERENCE_NODE:
- if ((wts & NodeFilter.SHOW_ENTITY_REFERENCE) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- case Node.NOTATION_NODE:
- if ((wts & NodeFilter.SHOW_NOTATION) == 0)
- {
- super.serialize(node, out);
- return;
- }
- break;
- }
- }
- switch (filter.acceptNode(node))
- {
- case NodeFilter.FILTER_ACCEPT:
- super.serialize(node, out);
- break;
- case NodeFilter.FILTER_REJECT:
- break;
- case NodeFilter.FILTER_SKIP:
- Node first = node.getFirstChild();
- if (first != null)
- {
- serialize(first, out);
- }
- break;
- }
- }
- }
-
- // -- DOMConfiguration --
-
- public void setParameter(String name, Object value)
- throws DOMException
- {
- if ("discard-default-content".equals(name))
- {
- discardDefaultContent = "true".equals(value.toString());
- }
- else if ("xml-declaration".equals(name))
- {
- xmlDeclaration = "false".equals(value.toString());
- }
- else
- {
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
- }
-
- public Object getParameter(String name)
- throws DOMException
- {
- if ("discard-default-content".equals(name))
- {
- return discardDefaultContent ? "true" : "false";
- }
- else if ("xml-declaration".equals(name))
- {
- return xmlDeclaration ? "true" : "false";
- }
- else
- {
- throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
- }
-
- public boolean canSetParameter(String name, Object value)
- {
- return contains(name);
- }
-
- public DOMStringList getParameterNames()
- {
- return this;
- }
-
- // -- DOMStringList --
-
- public String item(int i)
- {
- return (String) SUPPORTED_PARAMETERS.get(i);
- }
-
- public int getLength()
- {
- return SUPPORTED_PARAMETERS.size();
- }
-
- public boolean contains(String str)
- {
- return SUPPORTED_PARAMETERS.contains(str);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/ls/FilteredSAXEventSink.java b/libjava/gnu/xml/dom/ls/FilteredSAXEventSink.java
deleted file mode 100644
index 1c99ee524fa..00000000000
--- a/libjava/gnu/xml/dom/ls/FilteredSAXEventSink.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/* FilteredSAXEventSink.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util.LinkedList;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.w3c.dom.ls.LSParserFilter;
-import org.w3c.dom.traversal.NodeFilter;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-/**
- * A SAX event sink that calls out to a parser filter in order to decide
- * whether to insert nodes into the tree.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class FilteredSAXEventSink
- extends SAXEventSink
-{
-
- final LSParserFilter filter;
- final int whatToShow;
-
- /**
- * Stack of elements to insert.
- */
- LinkedList nodes;
-
- /**
- * Corresponding stack of filter decisions about the nodes.
- */
- LinkedList decisions;
-
- /**
- * True when rejecting child nodes.
- */
- boolean rejecting;
-
- FilteredSAXEventSink(LSParserFilter filter)
- {
- this.filter = filter;
- whatToShow = filter.getWhatToShow();
- }
-
- public void startDocument()
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- nodes = new LinkedList();
- decisions = new LinkedList();
-
- super.startDocument();
- }
-
- public void endDocument()
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- super.endDocument();
-
- switch (getDecision(ctx, false))
- {
- case LSParserFilter.FILTER_REJECT:
- ctx = null;
- doc = null;
- break;
- }
-
- nodes = null;
- decisions = null;
- }
-
- public void startElement(String uri, String localName, String qName,
- Attributes atts)
- throws SAXException
- {
- if (rejecting || interrupted)
- {
- return;
- }
- Element element = createElement(uri, localName, qName, atts);
- ctx = element;
-
- short decision = getDecision(element, true);
- nodes.addLast(element);
- decisions.addLast(new Short(decision));
-
- switch (decision)
- {
- case LSParserFilter.FILTER_REJECT:
- rejecting = true;
- break;
- case LSParserFilter.FILTER_INTERRUPT:
- interrupted = true;
- break;
- }
- }
-
- protected Attr createAttr(Attributes atts, int index)
- {
- Attr attr = super.createAttr(atts, index);
- short decision = getDecision(attr, false);
- switch (decision)
- {
- case LSParserFilter.FILTER_REJECT:
- return null;
- case LSParserFilter.FILTER_INTERRUPT:
- interrupted = true;
- return null;
- }
- return attr;
- }
-
- public void endElement(String uri, String localName, String qName)
- throws SAXException
- {
- if (rejecting || interrupted)
- {
- return;
- }
- super.endElement(uri, localName, qName);
-
- Element element = (Element) nodes.removeLast();
- Node parent = nodes.isEmpty() ? doc : (Node) nodes.getLast();
- ctx = parent;
- short decision = ((Short) decisions.removeLast()).shortValue();
- switch (decision)
- {
- case LSParserFilter.FILTER_SKIP:
- // Add all children of element to parent
- for (Node child = element.getFirstChild(); child != null;
- child = child.getNextSibling())
- {
- parent.insertBefore(child, element);
- }
- return;
- case LSParserFilter.FILTER_REJECT:
- rejecting = false;
- break;
- }
- decision = getDecision(element, false);
- switch (decision)
- {
- case LSParserFilter.FILTER_ACCEPT:
- parent.appendChild(element);
- break;
- case LSParserFilter.FILTER_INTERRUPT:
- interrupted = true;
- break;
- }
- }
-
- public void characters(char[] c, int off, int len)
- throws SAXException
- {
- if (rejecting || interrupted)
- {
- return;
- }
- Text text = createText(c, off, len);
- short decision = getDecision(text, false);
- switch (decision)
- {
- case LSParserFilter.FILTER_ACCEPT:
- ctx.appendChild(text);
- break;
- case LSParserFilter.FILTER_INTERRUPT:
- interrupted = true;
- break;
- }
- }
-
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- if (rejecting || interrupted || inDTD)
- {
- return;
- }
- Node pi = createProcessingInstruction(target, data);
- short decision = getDecision(pi, false);
- switch (decision)
- {
- case LSParserFilter.FILTER_ACCEPT:
- ctx.appendChild(pi);
- break;
- case LSParserFilter.FILTER_INTERRUPT:
- interrupted = true;
- break;
- }
- }
-
- public void startDTD(String name, String publicId, String systemId)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- Node doctype = createDocumentType(name, publicId, systemId);
- ctx = doctype;
- inDTD = true;
- nodes.addLast(doctype);
- decisions.addLast(new Short(LSParserFilter.FILTER_ACCEPT));
- }
-
- public void endDTD()
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- Node doctype = (Node) nodes.removeLast();
- decisions.removeLast();
- inDTD = false;
- ctx = doc;
- short decision = getDecision(doctype, false);
- switch (decision)
- {
- case LSParserFilter.FILTER_ACCEPT:
- ctx.appendChild(doctype);
- break;
- case LSParserFilter.FILTER_INTERRUPT:
- interrupted = true;
- break;
- }
- }
-
- public void comment(char[] c, int off, int len)
- throws SAXException
- {
- if (rejecting || interrupted || inDTD)
- {
- return;
- }
- Node comment = createComment(c, off, len);
- short decision = getDecision(comment, false);
- switch (decision)
- {
- case LSParserFilter.FILTER_ACCEPT:
- ctx.appendChild(comment);
- break;
- case LSParserFilter.FILTER_INTERRUPT:
- interrupted = true;
- break;
- }
- }
-
- // TODO declarations
-
- short getDecision(Node node, boolean start)
- {
- boolean show = (whatToShow == NodeFilter.SHOW_ALL);
- if (!show)
- {
- switch (node.getNodeType())
- {
- case Node.ATTRIBUTE_NODE:
- show = ((whatToShow & NodeFilter.SHOW_ATTRIBUTE) != 0);
- break;
- case Node.TEXT_NODE:
- show = ((whatToShow & NodeFilter.SHOW_TEXT) != 0);
- break;
- case Node.CDATA_SECTION_NODE:
- show = ((whatToShow & NodeFilter.SHOW_CDATA_SECTION) != 0);
- break;
- case Node.ELEMENT_NODE:
- show = ((whatToShow & NodeFilter.SHOW_ELEMENT) != 0);
- break;
- case Node.COMMENT_NODE:
- show = ((whatToShow & NodeFilter.SHOW_COMMENT) != 0);
- break;
- case Node.DOCUMENT_NODE:
- show = ((whatToShow & NodeFilter.SHOW_DOCUMENT) != 0);
- break;
- case Node.PROCESSING_INSTRUCTION_NODE:
- show = ((whatToShow & NodeFilter.SHOW_PROCESSING_INSTRUCTION) != 0);
- break;
- case Node.DOCUMENT_FRAGMENT_NODE:
- show = ((whatToShow & NodeFilter.SHOW_DOCUMENT_FRAGMENT) != 0);
- break;
- case Node.DOCUMENT_TYPE_NODE:
- show = ((whatToShow & NodeFilter.SHOW_DOCUMENT_TYPE) != 0);
- break;
- case Node.ENTITY_REFERENCE_NODE:
- show = ((whatToShow & NodeFilter.SHOW_ENTITY_REFERENCE) != 0);
- break;
- case Node.ENTITY_NODE:
- show = ((whatToShow & NodeFilter.SHOW_ENTITY) != 0);
- break;
- case Node.NOTATION_NODE:
- show = ((whatToShow & NodeFilter.SHOW_NOTATION) != 0);
- break;
- }
- }
- if (!show)
- {
- return LSParserFilter.FILTER_ACCEPT;
- }
- if (start)
- {
- return filter.startElement((Element) node);
- }
- return filter.acceptNode(node);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/ls/ReaderInputStream.java b/libjava/gnu/xml/dom/ls/ReaderInputStream.java
deleted file mode 100644
index 5b41abd3d74..00000000000
--- a/libjava/gnu/xml/dom/ls/ReaderInputStream.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/* ReaderInputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.InputStream;
-import java.io.IOException;
-import java.io.Reader;
-
-/**
- * Character stream wrapper.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- * @author <a href='mailto:mark@klomp.org'>Mark Wielaard</a>
- */
-public class ReaderInputStream
- extends InputStream
-{
-
- private Reader reader;
- private String encoding;
-
- // Holds extra spillover data if necessary
- private byte extra[];
- private int pos;
-
- private byte extra_marked[];
- private int pos_marked;
-
- public ReaderInputStream(Reader reader)
- {
- this.reader = reader;
- this.encoding = "UTF-8";
- }
-
- void setEncoding(String encoding)
- {
- this.encoding = encoding;
- }
-
- public int read()
- throws IOException
- {
- if (extra != null)
- {
- int result = extra[pos];
- pos++;
- if (pos >= extra.length)
- {
- extra = null;
- }
- return result;
- }
- return reader.read();
- }
-
- public int read(byte[] b)
- throws IOException
- {
- return read(b, 0, b.length);
- }
-
- public int read(byte[] b, int off, int len)
- throws IOException
- {
- if (len == 0)
- {
- return 0;
- }
-
- if (extra != null)
- {
- int available = extra.length - pos;
- int l = available < len ? available : len;
- System.arraycopy(extra, 0, b, off, l);
- pos += l;
- if (pos >= extra.length)
- {
- extra = null;
- }
- return l;
- }
-
- char[] c = new char[len];
- int l = reader.read(c, 0, len);
- if (l == -1)
- {
- return -1;
- }
-
- String s = new String(c, 0, l);
- byte[] d = s.getBytes(encoding);
-
- int available = d.length;
- int more = d.length - len;
- if (more > 0)
- {
- extra = new byte[more];
- pos = 0;
- System.arraycopy(d, len, extra, 0, more);
- available -= more;
- }
-
- System.arraycopy(d, 0, b, off, available);
- return available;
- }
-
- public void close()
- throws IOException
- {
- reader.close();
- }
-
- public boolean markSupported()
- {
- return reader.markSupported();
- }
-
- public void mark(int limit)
- {
- if (extra != null)
- {
- extra_marked = new byte[extra.length];
- System.arraycopy(extra, 0, extra_marked, 0, extra.length);
- pos_marked = pos;
- }
- else
- {
- extra_marked = null;
- }
-
- try
- {
- // Note that this might be a bit more than asked for.
- // Because we might also have the extra_marked bytes.
- // That is fine (and necessary for reset() to work).
- reader.mark(limit);
- }
- catch (IOException ioe)
- {
- throw new RuntimeException(ioe);
- }
- }
-
- public void reset()
- throws IOException
- {
- extra = extra_marked;
- pos = pos_marked;
- extra_marked = null;
-
- reader.reset();
- }
-
- public long skip(long n)
- throws IOException
- {
- long done = 0;
- if (extra != null)
- {
- int available = extra.length - pos;
- done = available < n ? available : n;
- pos += done;
- if (pos >= extra.length)
- {
- extra = null;
- }
- }
-
- n -= done;
- if (n > 0)
- {
- return reader.skip(n) + done;
- }
- else
- {
- return done;
- }
- }
-
- /**
- * Returns conservative number of bytes available without blocking.
- * Actual number of bytes that can be read without blocking might
- * be (much) bigger.
- */
- public int available()
- throws IOException
- {
- if (extra != null)
- {
- return pos - extra.length;
- }
-
- return reader.ready() ? 1 : 0;
- }
-
- public String toString()
- {
- return getClass().getName() + "[" + reader + ", " + encoding + "]";
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/ls/SAXEventSink.java b/libjava/gnu/xml/dom/ls/SAXEventSink.java
deleted file mode 100644
index a850460b1e2..00000000000
--- a/libjava/gnu/xml/dom/ls/SAXEventSink.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/* SAXEventSink.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import javax.xml.XMLConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.xml.sax.Attributes;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.Attributes2;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-import gnu.xml.aelfred2.ContentHandler2;
-import gnu.xml.dom.DomAttr;
-import gnu.xml.dom.DomDocument;
-import gnu.xml.dom.DomDoctype;
-
-/**
- * A SAX content and lexical handler used to construct a DOM document.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class SAXEventSink
- implements ContentHandler2, LexicalHandler, DTDHandler, DeclHandler
-{
-
- private static final String XMLNS_URI = XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
- private static final String XMLNS_PREFIX = XMLConstants.XMLNS_ATTRIBUTE;
-
- boolean namespaceAware;
- boolean ignoreWhitespace;
- boolean expandEntityReferences;
- boolean ignoreComments;
- boolean coalescing;
-
- DomDocument doc; // document being constructed
- Node ctx; // current context (parent node)
- LinkedList entityCtx; // entity context
- List pending; // namespace nodes waiting for a declaring element
- Locator locator;
- boolean inCDATA;
- boolean inDTD;
- boolean interrupted;
-
- void interrupt()
- {
- interrupted = true;
- }
-
- // -- ContentHandler2 --
-
- public void setDocumentLocator(Locator locator)
- {
- this.locator = locator;
- }
-
- public void startDocument()
- throws SAXException
- {
- if (namespaceAware)
- {
- pending = new LinkedList();
- }
- doc = new DomDocument();
- doc.setStrictErrorChecking(false);
- doc.setBuilding(true);
- ctx = doc;
- }
-
- public void xmlDecl(String version, String encoding, boolean standalone,
- String inputEncoding)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- doc.setXmlVersion(version);
- doc.setXmlEncoding(encoding);
- doc.setXmlStandalone(standalone);
- doc.setInputEncoding(inputEncoding);
- }
-
- public void endDocument()
- throws SAXException
- {
- doc.setStrictErrorChecking(true);
- doc.setBuilding(false);
- DomDoctype doctype = (DomDoctype) doc.getDoctype();
- if (doctype != null)
- {
- doctype.makeReadonly();
- }
- ctx = null;
- locator = null;
- }
-
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException
- {
- if (namespaceAware)
- {
- String nsName = (prefix != null && prefix.length() > 0) ?
- XMLNS_PREFIX + ":" + prefix : XMLNS_PREFIX;
- DomAttr ns = (DomAttr) doc.createAttributeNS(XMLNS_URI, nsName);
- ns.setNodeValue(uri);
- if (ctx.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- // Add to owner element
- Node target = ((Attr) ctx).getOwnerElement();
- target.getAttributes().setNamedItemNS(ns);
- }
- else
- {
- // Add to pending list; namespace node will be inserted when
- // element is seen
- pending.add(ns);
- }
- }
- }
-
- public void endPrefixMapping(String prefix)
- throws SAXException
- {
- }
-
- public void startElement(String uri, String localName, String qName,
- Attributes atts)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- Element element = createElement(uri, localName, qName, atts);
- // add element to context
- ctx.appendChild(element);
- ctx = element;
- }
-
- protected Element createElement(String uri, String localName, String qName,
- Attributes atts)
- throws SAXException
- {
- // create element node
- Element element = namespaceAware ?
- doc.createElementNS(uri, qName) :
- doc.createElement(qName);
- NamedNodeMap attrs = element.getAttributes();
- if (namespaceAware && !pending.isEmpty())
- {
- // add pending namespace nodes
- for (Iterator i = pending.iterator(); i.hasNext(); )
- {
- Node ns = (Node) i.next();
- attrs.setNamedItemNS(ns);
- }
- pending.clear();
- }
- // add attributes
- int len = atts.getLength();
- for (int i = 0; i < len; i++)
- {
- // create attribute
- Attr attr = createAttr(atts, i);
- if (attr != null)
- {
- // add attribute to element
- if (namespaceAware)
- {
- attrs.setNamedItemNS(attr);
- }
- else
- {
- attrs.setNamedItem(attr);
- }
- }
- }
- return element;
- }
-
- protected Attr createAttr(Attributes atts, int index)
- {
- DomAttr attr;
- if (namespaceAware)
- {
- String a_uri = atts.getURI(index);
- String a_qName = atts.getQName(index);
- attr = (DomAttr) doc.createAttributeNS(a_uri, a_qName);
- }
- else
- {
- String a_qName = atts.getQName(index);
- attr = (DomAttr) doc.createAttribute(a_qName);
- }
- attr.setNodeValue(atts.getValue(index));
- if (atts instanceof Attributes2)
- {
- Attributes2 atts2 = (Attributes2) atts;
- // TODO attr.setDeclared(atts2.isDeclared(index));
- attr.setSpecified(atts2.isSpecified(index));
- }
- return attr;
- }
-
- public void endElement(String uri, String localName, String qName)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- if (namespaceAware)
- {
- pending.clear();
- }
- ctx = ctx.getParentNode();
- }
-
- public void characters(char[] c, int off, int len)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- ctx.appendChild(createText(c, off, len));
- }
-
- protected Text createText(char[] c, int off, int len)
- throws SAXException
- {
- Text text = (inCDATA && !coalescing) ?
- doc.createCDATASection(new String(c, off, len)) :
- doc.createTextNode(new String(c, off, len));
- return text;
- }
-
- public void ignorableWhitespace(char[] c, int off, int len)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- if (!ignoreWhitespace)
- {
- characters(c, off, len);
- }
- }
-
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- if (!inDTD)
- {
- Node pi = createProcessingInstruction(target, data);
- ctx.appendChild(pi);
- }
- }
-
- protected Node createProcessingInstruction(String target, String data)
- {
- return doc.createProcessingInstruction(target, data);
- }
-
- public void skippedEntity(String name)
- throws SAXException
- {
- // This callback is totally pointless
- }
-
- // -- LexicalHandler --
-
- public void startDTD(String name, String publicId, String systemId)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- Node doctype = createDocumentType(name, publicId, systemId);
- doc.appendChild(doctype);
- ctx = doctype;
- inDTD = true;
- }
-
- protected Node createDocumentType(String name, String publicId,
- String systemId)
- {
- return new DomDoctype(doc, name, publicId, systemId);
- }
-
- public void endDTD()
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- inDTD = false;
- ctx = ctx.getParentNode();
- }
-
- public void startEntity(String name)
- throws SAXException
- {
- DocumentType doctype = doc.getDoctype();
- if (doctype == null)
- {
- throw new SAXException("SAX parser error: " +
- "reference to entity in undeclared doctype");
- }
- if ("[dtd]".equals(name) || name.charAt(0) == '%')
- {
- // Ignore DTD and parameter entities
- ctx = doctype;
- return;
- }
- if ("lt".equals(name) ||
- "gt".equals(name) ||
- "amp".equals(name) ||
- "apos".equals(name) ||
- "quot".equals(name))
- {
- return;
- }
- // Get entity
- NamedNodeMap entities = doctype.getEntities();
- Entity entity = (Entity) entities.getNamedItem(name);
- if (entity == null)
- {
- throw new SAXException("SAX parser error: " +
- "reference to undeclared entity: " + name);
- }
- pushEntity(entity);
- }
-
- public void endEntity(String name)
- throws SAXException
- {
- if ("[dtd]".equals(name) || name.charAt(0) == '%')
- {
- // Ignore DTD and parameter entities
- return;
- }
- if ("lt".equals(name) ||
- "gt".equals(name) ||
- "amp".equals(name) ||
- "apos".equals(name) ||
- "quot".equals(name))
- {
- return;
- }
- // Get entity
- Entity entity = popEntity();
- // TODO resolve external entities to ensure that entity has content
- if (expandEntityReferences)
- {
- // Get entity content
- for (Node child = entity.getFirstChild(); child != null;
- child = child.getNextSibling())
- {
- ctx.appendChild(child);
- }
- }
- else
- {
- Node entityReference = doc.createEntityReference(name);
- ctx.appendChild(entityReference);
- }
- }
-
- void pushEntity(Node entity)
- {
- if (entityCtx == null)
- {
- entityCtx = new LinkedList();
- }
- entityCtx.addLast(ctx);
- ctx = entity;
- }
-
- Entity popEntity()
- {
- Entity ret = (Entity) ctx;
- ctx = (Node) entityCtx.removeLast();
- return ret;
- }
-
- public void startCDATA()
- throws SAXException
- {
- inCDATA = true;
- }
-
- public void endCDATA()
- throws SAXException
- {
- inCDATA = false;
- }
-
- public void comment(char[] c, int off, int len)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- if (!inDTD)
- {
- Node comment = createComment(c, off, len);
- ctx.appendChild(comment);
- }
- }
-
- protected Node createComment(char[] c, int off, int len)
- {
- return doc.createComment(new String(c, off, len));
- }
-
- // -- DTDHandler --
-
- public void notationDecl(String name, String publicId, String systemId)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- DomDoctype doctype = (DomDoctype) ctx;
- doctype.declareNotation(name, publicId, systemId);
- }
-
- public void unparsedEntityDecl(String name, String publicId, String systemId,
- String notationName)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- DomDoctype doctype = (DomDoctype) ctx;
- Entity entity = doctype.declareEntity(name, publicId, systemId,
- notationName);
- }
-
- // -- DeclHandler --
-
- public void elementDecl(String name, String model)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- // Ignore fake element declarations generated by ValidationConsumer.
- // If an element is not really declared in the DTD it will not be
- // declared in the document model.
- if (!(ctx instanceof DomDoctype))
- {
- return;
- }
- DomDoctype doctype = (DomDoctype) ctx;
- doctype.elementDecl(name, model);
- }
-
- public void attributeDecl(String eName, String aName, String type,
- String mode, String value)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- DomDoctype doctype = (DomDoctype) ctx;
- doctype.attributeDecl(eName, aName, type, mode, value);
- }
-
- public void internalEntityDecl(String name, String value)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- DomDoctype doctype = (DomDoctype) ctx;
- Entity entity = doctype.declareEntity(name, null, null, null);
- if (entity != null)
- {
- Node text = doc.createTextNode(value);
- entity.appendChild(text);
- }
- }
-
- public void externalEntityDecl(String name, String publicId, String systemId)
- throws SAXException
- {
- if (interrupted)
- {
- return;
- }
- DomDoctype doctype = (DomDoctype) ctx;
- Entity entity = doctype.declareEntity(name, publicId, systemId, null);
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/ls/WriterOutputStream.java b/libjava/gnu/xml/dom/ls/WriterOutputStream.java
deleted file mode 100644
index 2fb20614722..00000000000
--- a/libjava/gnu/xml/dom/ls/WriterOutputStream.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* WriterOutputStream.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-/**
- * Character stream wrapper.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class WriterOutputStream
- extends OutputStream
-{
-
- private Writer writer;
- private String encoding;
-
- public WriterOutputStream(Writer writer)
- {
- this.writer = writer;
- this.encoding = "UTF-8";
- }
-
- void setEncoding(String encoding)
- {
- this.encoding = encoding;
- }
-
- public void write(int c)
- throws IOException
- {
- writer.write(c);
- }
-
- public void write(byte[] b)
- throws IOException
- {
- write(b, 0, b.length);
- }
-
- public void write(byte[] b, int off, int len)
- throws IOException
- {
- writer.write(new String(b, off, len, encoding));
- }
-
- public void close()
- throws IOException
- {
- writer.close();
- }
-
- public void flush()
- throws IOException
- {
- writer.flush();
- }
-
-}
-
diff --git a/libjava/gnu/xml/pipeline/CallFilter.java b/libjava/gnu/xml/pipeline/CallFilter.java
deleted file mode 100644
index 3b337517377..00000000000
--- a/libjava/gnu/xml/pipeline/CallFilter.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/* CallFilter.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-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;
-import gnu.xml.util.XMLWriter;
-
-
-/**
- * Input is sent as an XML request to given URI, and the output of this
- * filter is the parsed response to that request.
- * A connection is opened to the remote URI when the startDocument call is
- * issued through this filter, and the request is finished when the
- * endDocument call is issued. Events should be written quickly enough to
- * prevent the remote HTTP server from aborting the connection due to
- * inactivity; you may want to buffer text in an earlier pipeline stage.
- * If your application requires validity checking of such
- * outputs, have the output pipeline include a validation stage.
- *
- * <p>In effect, this makes a remote procedure call to the URI, with the
- * request and response document syntax as chosen by the application.
- * <em>Note that all the input events must be seen, and sent to the URI,
- * before the first output event can be seen. </em> Clients are delayed
- * at least by waiting for the server to respond, constraining concurrency.
- * Services can thus be used to synchronize concurrent activities, and
- * even to prioritize service among different clients.
- *
- * <p> You are advised to avoid restricting yourself to an "RPC" model
- * for distributed computation. With a World Wide Web, network latencies
- * and failures (e.g. non-availability)
- * are significant; adopting a "procedure" model, rather than a workflow
- * model where bulk requests are sent and worked on asynchronously, is not
- * generally an optimal system-wide architecture. When the messages may
- * need authentication, such as with an OpenPGP signature, or when server
- * loads don't argue in favor of immediate responses, non-RPC models can
- * be advantageous. (So-called "peer to peer" computing models are one
- * additional type of model, though too often that term is applied to
- * systems that still have a centralized control structure.)
- *
- * <p> <em>Be strict in what you send, liberal in what you accept,</em> as
- * the Internet tradition goes. Strictly conformant data should never cause
- * problems to its receiver; make your request pipeline be very strict, and
- * don't compromise on that. Make your response pipeline strict as well,
- * but be ready to tolerate specific mild, temporary, and well-documented
- * variations from specific communications peers.
- *
- * @see XmlServlet
- *
- * @author David Brownell
- */
-final public class CallFilter implements EventConsumer
-{
- private Requestor req;
- private EventConsumer next;
- private URL target;
- private URLConnection conn;
- private ErrorHandler errHandler;
-
-
- /**
- * Initializes a call filter so that its inputs are sent to the
- * specified URI, and its outputs are sent to the next consumer
- * provided.
- *
- * @exception IOException if the URI isn't accepted as a URL
- */
- // constructor used by PipelineFactory
- public CallFilter (String uri, EventConsumer next)
- throws IOException
- {
- this.next = next;
- req = new Requestor ();
- setCallTarget (uri);
- }
-
- /**
- * Assigns the URI of the call target to be used.
- * Does not affect calls currently being made.
- */
- final public void setCallTarget (String uri)
- throws IOException
- {
- target = new URL (uri);
- }
-
- /**
- * Assigns the error handler to be used to present most fatal
- * errors.
- */
- public void setErrorHandler (ErrorHandler handler)
- {
- req.setErrorHandler (handler);
- }
-
-
- /**
- * Returns the call target's URI.
- */
- final public String getCallTarget ()
- {
- return target.toString ();
- }
-
- /** Returns the content handler currently in use. */
- final public org.xml.sax.ContentHandler getContentHandler ()
- {
- return req;
- }
-
- /** Returns the DTD handler currently in use. */
- final public DTDHandler getDTDHandler ()
- {
- return req;
- }
-
-
- /**
- * Returns the declaration or lexical handler currently in
- * use, or throws an exception for other properties.
- */
- final public Object getProperty (String id)
- throws SAXNotRecognizedException
- {
- if (EventFilter.DECL_HANDLER.equals (id))
- return req;
- if (EventFilter.LEXICAL_HANDLER.equals (id))
- return req;
- throw new SAXNotRecognizedException (id);
- }
-
-
- // JDK 1.1 seems to need it to be done this way, sigh
- ErrorHandler getErrorHandler () { return errHandler; }
-
- //
- // Takes input and echoes to server as POST input.
- // Then sends the POST reply to the next pipeline element.
- //
- final class Requestor extends XMLWriter
- {
- Requestor ()
- {
- super ((Writer)null);
- }
-
- public synchronized void startDocument () throws SAXException
- {
- // Connect to remote object and set up to send it XML text
- try {
- if (conn != null)
- throw new IllegalStateException ("call is being made");
-
- conn = target.openConnection ();
- conn.setDoOutput (true);
- conn.setRequestProperty ("Content-Type",
- "application/xml;charset=UTF-8");
-
- setWriter (new OutputStreamWriter (
- conn.getOutputStream (),
- "UTF8"), "UTF-8");
-
- } catch (IOException e) {
- fatal ("can't write (POST) to URI: " + target, e);
- }
-
- // NOW base class can safely write that text!
- super.startDocument ();
- }
-
- public void endDocument () throws SAXException
- {
- //
- // Finish writing the request (for HTTP, a POST);
- // this closes the output stream.
- //
- super.endDocument ();
-
- //
- // Receive the response.
- // Produce events for the next stage.
- //
- InputSource source;
- XMLReader producer;
- String encoding;
-
- try {
-
- source = new InputSource (conn.getInputStream ());
-
-// FIXME if status is anything but success, report it!! It'd be good to
-// save the request data just in case we need to deal with a forward.
-
- encoding = Resolver.getEncoding (conn.getContentType ());
- if (encoding != null)
- source.setEncoding (encoding);
-
- producer = XMLReaderFactory.createXMLReader ();
- producer.setErrorHandler (getErrorHandler ());
- EventFilter.bind (producer, next);
- producer.parse (source);
- conn = null;
-
- } catch (IOException e) {
- fatal ("I/O Exception reading response, " + e.getMessage (), e);
- }
- }
- }
-}
diff --git a/libjava/gnu/xml/pipeline/DomConsumer.java b/libjava/gnu/xml/pipeline/DomConsumer.java
deleted file mode 100644
index 389e02bb387..00000000000
--- a/libjava/gnu/xml/pipeline/DomConsumer.java
+++ /dev/null
@@ -1,982 +0,0 @@
-/* DomConsumer.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import gnu.xml.aelfred2.ContentHandler2;
-import gnu.xml.util.DomParser;
-
-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 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
- * pipeline terminus or as an intermediate buffer. When a document's worth
- * of events has been delivered to this consumer, that document is read with
- * a {@link DomParser} and sent to the next consumer. It is also available
- * as a read-once property.
- *
- * <p>The DOM tree is constructed as faithfully as possible. There are some
- * complications since a DOM should expose behaviors that can't be implemented
- * without API backdoors into that DOM, and because some SAX parsers don't
- * report all the information that DOM permits to be exposed. The general
- * problem areas involve information from the Document Type Declaration (DTD).
- * DOM only represents a limited subset, but has some behaviors that depend
- * on much deeper knowledge of a document's DTD. You shouldn't have much to
- * worry about unless you change handling of "noise" nodes from its default
- * setting (which ignores them all); note if you use JAXP to populate your
- * DOM trees, it wants to save "noise" nodes by default. (Such nodes include
- * ignorable whitespace, comments, entity references and CDATA boundaries.)
- * Otherwise, your
- * main worry will be if you use a SAX parser that doesn't flag ignorable
- * whitespace unless it's validating (few don't).
- *
- * <p> The SAX2 events used as input must contain XML Names for elements
- * and attributes, with original prefixes. In SAX2,
- * this is optional unless the "namespace-prefixes" parser feature is set.
- * Moreover, many application components won't provide completely correct
- * structures anyway. <em>Before you convert a DOM to an output document,
- * you should plan to postprocess it to create or repair such namespace
- * information.</em> The {@link NSFilter} pipeline stage does such work.
- *
- * <p> <em>Note: changes late in DOM L2 process made it impractical to
- * attempt to create the DocumentType node in any implementation-neutral way,
- * much less to populate it (L1 didn't support even creating such nodes).
- * To create and populate such a node, subclass the inner
- * {@link DomConsumer.Handler} class and teach it about the backdoors into
- * whatever DOM implementation you want. It's possible that some revised
- * DOM API (L3?) will make this problem solvable again. </em>
- *
- * @see DomParser
- *
- * @author David Brownell
- */
-public class DomConsumer implements EventConsumer
-{
- private Class domImpl;
-
- private boolean hidingCDATA = true;
- private boolean hidingComments = true;
- private boolean hidingWhitespace = true;
- private boolean hidingReferences = true;
-
- private Handler handler;
- private ErrorHandler errHandler;
-
- private EventConsumer next;
-
- // FIXME: this can't be a generic pipeline stage just now,
- // since its input became a Class not a String (to be turned
- // into a class, using the right class loader)
-
-
- /**
- * Configures this pipeline terminus to use the specified implementation
- * of DOM when constructing its result value.
- *
- * @param impl class implementing {@link org.w3c.dom.Document Document}
- * which publicly exposes a default constructor
- *
- * @exception SAXException when there is a problem creating an
- * empty DOM document using the specified implementation
- */
- public DomConsumer (Class impl)
- throws SAXException
- {
- domImpl = impl;
- handler = new Handler (this);
- }
-
- /**
- * This is the hook through which a subclass provides a handler
- * which knows how to access DOM extensions, specific to some
- * implementation, to record additional data in a DOM.
- * Treat this as part of construction; don't call it except
- * before (or between) parses.
- */
- protected void setHandler (Handler h)
- {
- handler = h;
- }
-
-
- private Document emptyDocument ()
- throws SAXException
- {
- try {
- return (Document) domImpl.newInstance ();
- } catch (IllegalAccessException e) {
- throw new SAXException ("can't access constructor: "
- + e.getMessage ());
- } catch (InstantiationException e) {
- throw new SAXException ("can't instantiate Document: "
- + e.getMessage ());
- }
- }
-
-
- /**
- * Configures this consumer as a buffer/filter, using the specified
- * DOM implementation when constructing its result value.
- *
- * <p> This event consumer acts as a buffer and filter, in that it
- * builds a DOM tree and then writes it out when <em>endDocument</em>
- * is invoked. Because of the limitations of DOM, much information
- * will as a rule not be seen in that replay. To get a full fidelity
- * copy of the input event stream, use a {@link TeeConsumer}.
- *
- * @param impl class implementing {@link org.w3c.dom.Document Document}
- * which publicly exposes a default constructor
- * @param next receives a "replayed" sequence of parse events when
- * the <em>endDocument</em> method is invoked.
- *
- * @exception SAXException when there is a problem creating an
- * empty DOM document using the specified DOM implementation
- */
- public DomConsumer (Class impl, EventConsumer n)
- throws SAXException
- {
- this (impl);
- next = n;
- }
-
-
- /**
- * Returns the document constructed from the preceding
- * sequence of events. This method should not be
- * used again until another sequence of events has been
- * given to this EventConsumer.
- */
- final public Document getDocument ()
- {
- return handler.clearDocument ();
- }
-
- public void setErrorHandler (ErrorHandler handler)
- {
- errHandler = handler;
- }
-
-
- /**
- * Returns true if the consumer is hiding entity references nodes
- * (the default), and false if EntityReference nodes should
- * instead be created. Such EntityReference nodes will normally be
- * empty, unless an implementation arranges to populate them and then
- * turn them back into readonly objects.
- *
- * @see #setHidingReferences
- */
- final public boolean isHidingReferences ()
- { return hidingReferences; }
-
- /**
- * Controls whether the consumer will hide entity expansions,
- * or will instead mark them with entity reference nodes.
- *
- * @see #isHidingReferences
- * @param flag False if entity reference nodes will appear
- */
- final public void setHidingReferences (boolean flag)
- { hidingReferences = flag; }
-
-
- /**
- * Returns true if the consumer is hiding comments (the default),
- * and false if they should be placed into the output document.
- *
- * @see #setHidingComments
- */
- public final boolean isHidingComments ()
- { return hidingComments; }
-
- /**
- * Controls whether the consumer is hiding comments.
- *
- * @see #isHidingComments
- */
- public final void setHidingComments (boolean flag)
- { hidingComments = flag; }
-
-
- /**
- * Returns true if the consumer is hiding ignorable whitespace
- * (the default), and false if such whitespace should be placed
- * into the output document as children of element nodes.
- *
- * @see #setHidingWhitespace
- */
- public final boolean isHidingWhitespace ()
- { return hidingWhitespace; }
-
- /**
- * Controls whether the consumer hides ignorable whitespace
- *
- * @see #isHidingComments
- */
- public final void setHidingWhitespace (boolean flag)
- { hidingWhitespace = flag; }
-
-
- /**
- * Returns true if the consumer is saving CDATA boundaries, or
- * false (the default) otherwise.
- *
- * @see #setHidingCDATA
- */
- final public boolean isHidingCDATA ()
- { return hidingCDATA; }
-
- /**
- * Controls whether the consumer will save CDATA boundaries.
- *
- * @see #isHidingCDATA
- * @param flag True to treat CDATA text differently from other
- * text nodes
- */
- final public void setHidingCDATA (boolean flag)
- { hidingCDATA = flag; }
-
-
-
- /** Returns the document handler being used. */
- final public ContentHandler getContentHandler ()
- { return handler; }
-
- /** Returns the DTD handler being used. */
- final public DTDHandler getDTDHandler ()
- { return handler; }
-
- /**
- * Returns the lexical handler being used.
- * (DOM construction can't really use declaration handlers.)
- */
- final public Object getProperty (String id)
- throws SAXNotRecognizedException
- {
- if ("http://xml.org/sax/properties/lexical-handler".equals (id))
- return handler;
- if ("http://xml.org/sax/properties/declaration-handler".equals (id))
- return handler;
- throw new SAXNotRecognizedException (id);
- }
-
- EventConsumer getNext () { return next; }
-
- ErrorHandler getErrorHandler () { return errHandler; }
-
- /**
- * Class used to intercept various parsing events and use them to
- * populate a DOM document. Subclasses would typically know and use
- * backdoors into specific DOM implementations, used to implement
- * DTD-related functionality.
- *
- * <p> Note that if this ever throws a DOMException (runtime exception)
- * that will indicate a bug in the DOM (e.g. doesn't support something
- * per specification) or the parser (e.g. emitted an illegal name, or
- * accepted illegal input data). </p>
- */
- public static class Handler
- implements ContentHandler2, LexicalHandler,
- DTDHandler, DeclHandler
- {
- protected DomConsumer consumer;
-
- private DOMImplementation impl;
- private Document document;
- private boolean isL2;
-
- private Locator locator;
- private Node top;
- private boolean inCDATA;
- private boolean mergeCDATA;
- private boolean inDTD;
- private String currentEntity;
-
- private boolean recreatedAttrs;
- private AttributesImpl attributes = new AttributesImpl ();
-
- /**
- * Subclasses may use SAX2 events to provide additional
- * behaviors in the resulting DOM.
- */
- protected Handler (DomConsumer consumer)
- throws SAXException
- {
- this.consumer = consumer;
- document = consumer.emptyDocument ();
- impl = document.getImplementation ();
- isL2 = impl.hasFeature ("XML", "2.0");
- }
-
- private void fatal (String message, Exception x)
- throws SAXException
- {
- SAXParseException e;
- ErrorHandler errHandler = consumer.getErrorHandler ();;
-
- if (locator == null)
- e = new SAXParseException (message, null, null, -1, -1, x);
- else
- e = new SAXParseException (message, locator, x);
- if (errHandler != null)
- errHandler.fatalError (e);
- throw e;
- }
-
- /**
- * Returns and forgets the document produced. If the handler is
- * reused, a new document may be created.
- */
- Document clearDocument ()
- {
- Document retval = document;
- document = null;
- locator = null;
- return retval;
- }
-
- /**
- * Returns the document under construction.
- */
- protected Document getDocument ()
- { return document; }
-
- /**
- * Returns the current node being populated. This is usually
- * an Element or Document, but it might be an EntityReference
- * node if some implementation-specific code knows how to put
- * those into the result tree and later mark them as readonly.
- */
- protected Node getTop ()
- { return top; }
-
-
- // SAX1
- public void setDocumentLocator (Locator locator)
- {
- this.locator = locator;
- }
-
- // SAX1
- public void startDocument ()
- throws SAXException
- {
- if (document == null)
- try {
- if (isL2) {
- // couple to original implementation
- document = impl.createDocument (null, "foo", null);
- document.removeChild (document.getFirstChild ());
- } else {
- document = consumer.emptyDocument ();
- }
- } catch (Exception e) {
- fatal ("DOM create document", e);
- }
- top = document;
- }
-
- // ContentHandler2
- public void xmlDecl(String version,
- String encoding,
- boolean standalone,
- String inputEncoding)
- throws SAXException
- {
- if (document != null)
- {
- document.setXmlVersion(version);
- document.setXmlStandalone(standalone);
- }
- }
-
- // SAX1
- public void endDocument ()
- throws SAXException
- {
- try {
- if (consumer.getNext () != null && document != null) {
- DomParser parser = new DomParser (document);
-
- EventFilter.bind (parser, consumer.getNext ());
- parser.parse ("ignored");
- }
- } finally {
- top = null;
- }
- }
-
- // SAX1
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- // we can't create populated entity ref nodes using
- // only public DOM APIs (they've got to be readonly)
- if (currentEntity != null)
- return;
-
- ProcessingInstruction pi;
-
- if (isL2
- // && consumer.isUsingNamespaces ()
- && target.indexOf (':') != -1)
- namespaceError (
- "PI target name is namespace nonconformant: "
- + target);
- if (inDTD)
- return;
- pi = document.createProcessingInstruction (target, data);
- top.appendChild (pi);
- }
-
- /**
- * Subclasses may overrride this method to provide a more efficient
- * way to construct text nodes.
- * Typically, copying the text into a single character array will
- * be more efficient than doing that as well as allocating other
- * needed for a String, including an internal StringBuffer.
- * Those additional memory and CPU costs can be incurred later,
- * if ever needed.
- * Unfortunately the standard DOM factory APIs encourage those costs
- * to be incurred early.
- */
- protected Text createText (
- boolean isCDATA,
- char ch [],
- int start,
- int length
- ) {
- String value = new String (ch, start, length);
-
- if (isCDATA)
- return document.createCDATASection (value);
- else
- return document.createTextNode (value);
- }
-
- // SAX1
- public void characters (char ch [], int start, int length)
- throws SAXException
- {
- // we can't create populated entity ref nodes using
- // only public DOM APIs (they've got to be readonly
- // at creation time)
- if (currentEntity != null)
- return;
-
- Node lastChild = top.getLastChild ();
-
- // merge consecutive text or CDATA nodes if appropriate.
- if (lastChild instanceof Text) {
- if (consumer.isHidingCDATA ()
- // consecutive Text content ... always merge
- || (!inCDATA
- && !(lastChild instanceof CDATASection))
- // consecutive CDATASection content ... don't
- // merge between sections, only within them
- || (inCDATA && mergeCDATA
- && lastChild instanceof CDATASection)
- ) {
- CharacterData last = (CharacterData) lastChild;
- String value = new String (ch, start, length);
-
- last.appendData (value);
- return;
- }
- }
- if (inCDATA && !consumer.isHidingCDATA ()) {
- top.appendChild (createText (true, ch, start, length));
- mergeCDATA = true;
- } else
- top.appendChild (createText (false, ch, start, length));
- }
-
- // SAX2
- public void skippedEntity (String name)
- throws SAXException
- {
- // this callback is useless except to report errors, since
- // we can't know if the ref was in content, within an
- // attribute, within a declaration ... only one of those
- // cases supports more intelligent action than a panic.
- fatal ("skipped entity: " + name, null);
- }
-
- // SAX2
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException
- {
- // reconstruct "xmlns" attributes deleted by all
- // SAX2 parsers without "namespace-prefixes" = true
- if ("".equals (prefix))
- attributes.addAttribute ("", "", "xmlns",
- "CDATA", uri);
- else
- attributes.addAttribute ("", "", "xmlns:" + prefix,
- "CDATA", uri);
- recreatedAttrs = true;
- }
-
- // SAX2
- public void endPrefixMapping (String prefix)
- throws SAXException
- { }
-
- // SAX2
- public void startElement (
- String uri,
- String localName,
- String qName,
- Attributes atts
- ) throws SAXException
- {
- // we can't create populated entity ref nodes using
- // only public DOM APIs (they've got to be readonly)
- if (currentEntity != null)
- return;
-
- // parser discarded basic information; DOM tree isn't writable
- // without massaging to assign prefixes to all nodes.
- // the "NSFilter" class does that massaging.
- if (qName.length () == 0)
- qName = localName;
-
-
- Element element;
- int length = atts.getLength ();
-
- if (!isL2) {
- element = document.createElement (qName);
-
- // first the explicit attributes ...
- length = atts.getLength ();
- for (int i = 0; i < length; i++)
- element.setAttribute (atts.getQName (i),
- atts.getValue (i));
- // ... then any recreated ones (DOM deletes duplicates)
- if (recreatedAttrs) {
- recreatedAttrs = false;
- length = attributes.getLength ();
- for (int i = 0; i < length; i++)
- element.setAttribute (attributes.getQName (i),
- attributes.getValue (i));
- attributes.clear ();
- }
-
- top.appendChild (element);
- top = element;
- return;
- }
-
- // For an L2 DOM when namespace use is enabled, use
- // createElementNS/createAttributeNS except when
- // (a) it's an element in the default namespace, or
- // (b) it's an attribute with no prefix
- String namespace;
-
- if (localName.length () != 0)
- namespace = (uri.length () == 0) ? null : uri;
- else
- namespace = getNamespace (getPrefix (qName), atts);
-
- if (namespace == null)
- element = document.createElement (qName);
- else
- element = document.createElementNS (namespace, qName);
-
- populateAttributes (element, atts);
- if (recreatedAttrs) {
- recreatedAttrs = false;
- // ... DOM deletes any duplicates
- populateAttributes (element, attributes);
- attributes.clear ();
- }
-
- top.appendChild (element);
- top = element;
- }
-
- final static String xmlnsURI = "http://www.w3.org/2000/xmlns/";
-
- private void populateAttributes (Element element, Attributes attrs)
- throws SAXParseException
- {
- int length = attrs.getLength ();
-
- for (int i = 0; i < length; i++) {
- String type = attrs.getType (i);
- String value = attrs.getValue (i);
- String name = attrs.getQName (i);
- String local = attrs.getLocalName (i);
- String uri = attrs.getURI (i);
-
- // parser discarded basic information, DOM tree isn't writable
- if (name.length () == 0)
- name = local;
-
- // all attribute types other than these three may not
- // contain scoped names... enumerated attributes get
- // reported as NMTOKEN, except for NOTATION values
- if (!("CDATA".equals (type)
- || "NMTOKEN".equals (type)
- || "NMTOKENS".equals (type))) {
- if (value.indexOf (':') != -1) {
- namespaceError (
- "namespace nonconformant attribute value: "
- + "<" + element.getNodeName ()
- + " " + name + "='" + value + "' ...>");
- }
- }
-
- // xmlns="" is legal (undoes default NS)
- // xmlns:foo="" is illegal
- String prefix = getPrefix (name);
- String namespace;
-
- if ("xmlns".equals (prefix)) {
- if ("".equals (value))
- namespaceError ("illegal null namespace decl, " + name);
- namespace = xmlnsURI;
- } else if ("xmlns".equals (name))
- namespace = xmlnsURI;
-
- else if (prefix == null)
- namespace = null;
- else if (!"".equals(uri) && uri.length () != 0)
- namespace = uri;
- else
- namespace = getNamespace (prefix, attrs);
-
- if (namespace == null)
- element.setAttribute (name, value);
- else
- element.setAttributeNS (namespace, name, value);
- }
- }
-
- private String getPrefix (String name)
- {
- int temp;
-
- if ((temp = name.indexOf (':')) > 0)
- return name.substring (0, temp);
- return null;
- }
-
- // used with SAX1-level parser output
- private String getNamespace (String prefix, Attributes attrs)
- throws SAXParseException
- {
- String namespace;
- String decl;
-
- // defaulting
- if (prefix == null) {
- decl = "xmlns";
- namespace = attrs.getValue (decl);
- if ("".equals (namespace))
- return null;
- else if (namespace != null)
- return namespace;
-
- // "xmlns" is like a keyword
- // ... according to the Namespace REC, but DOM L2 CR2+
- // and Infoset violate that by assigning a namespace.
- // that conflict is resolved elsewhere.
- } else if ("xmlns".equals (prefix))
- return null;
-
- // "xml" prefix is fixed
- else if ("xml".equals (prefix))
- return "http://www.w3.org/XML/1998/namespace";
-
- // otherwise, expect a declaration
- else {
- decl = "xmlns:" + prefix;
- namespace = attrs.getValue (decl);
- }
-
- // if we found a local declaration, great
- if (namespace != null)
- return namespace;
-
-
- // ELSE ... search up the tree we've been building
- for (Node n = top;
- n != null && n.getNodeType () != Node.DOCUMENT_NODE;
- n = (Node) n.getParentNode ()) {
- if (n.getNodeType () == Node.ENTITY_REFERENCE_NODE)
- continue;
- Element e = (Element) n;
- Attr attr = e.getAttributeNode (decl);
- if (attr != null)
- return attr.getNodeValue ();
- }
- // see above re "xmlns" as keyword
- if ("xmlns".equals (decl))
- return null;
-
- namespaceError ("Undeclared namespace prefix: " + prefix);
- return null;
- }
-
- // SAX2
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- // we can't create populated entity ref nodes using
- // only public DOM APIs (they've got to be readonly)
- if (currentEntity != null)
- return;
-
- top = top.getParentNode ();
- }
-
- // SAX1 (mandatory reporting if validating)
- public void ignorableWhitespace (char ch [], int start, int length)
- throws SAXException
- {
- if (consumer.isHidingWhitespace ())
- return;
- characters (ch, start, length);
- }
-
- // SAX2 lexical event
- public void startCDATA ()
- throws SAXException
- {
- inCDATA = true;
- // true except for the first fragment of a cdata section
- mergeCDATA = false;
- }
-
- // SAX2 lexical event
- public void endCDATA ()
- throws SAXException
- {
- inCDATA = false;
- }
-
- // SAX2 lexical event
- //
- // this SAX2 callback merges two unrelated things:
- // - Declaration of the root element type ... belongs with
- // the other DTD declaration methods, NOT HERE.
- // - IDs for the optional external subset ... belongs here
- // with other lexical information.
- //
- // ...and it doesn't include the internal DTD subset, desired
- // both to support DOM L2 and to enable "pass through" processing
- //
- public void startDTD (String name, String publicId, String SystemId)
- throws SAXException
- {
- // need to filter out comments and PIs within the DTD
- inDTD = true;
- }
-
- // SAX2 lexical event
- public void endDTD ()
- throws SAXException
- {
- inDTD = false;
- }
-
- // SAX2 lexical event
- public void comment (char ch [], int start, int length)
- throws SAXException
- {
- Node comment;
-
- // we can't create populated entity ref nodes using
- // only public DOM APIs (they've got to be readonly)
- if (consumer.isHidingComments ()
- || inDTD
- || currentEntity != null)
- return;
- comment = document.createComment (new String (ch, start, length));
- top.appendChild (comment);
- }
-
- /**
- * May be overridden by subclasses to return true, indicating
- * that entity reference nodes can be populated and then made
- * read-only.
- */
- public boolean canPopulateEntityRefs ()
- { return false; }
-
- // SAX2 lexical event
- public void startEntity (String name)
- throws SAXException
- {
- // are we ignoring what would be contents of an
- // entity ref, since we can't populate it?
- if (currentEntity != null)
- return;
-
- // Are we hiding all entity boundaries?
- if (consumer.isHidingReferences ())
- return;
-
- // SAX2 shows parameter entities; DOM hides them
- if (name.charAt (0) == '%' || "[dtd]".equals (name))
- return;
-
- // Since we can't create a populated entity ref node in any
- // standard way, we create an unpopulated one.
- EntityReference ref = document.createEntityReference (name);
- top.appendChild (ref);
- top = ref;
-
- // ... allowing subclasses to populate them
- if (!canPopulateEntityRefs ())
- currentEntity = name;
- }
-
- // SAX2 lexical event
- public void endEntity (String name)
- throws SAXException
- {
- if (name.charAt (0) == '%' || "[dtd]".equals (name))
- return;
- if (name.equals (currentEntity))
- currentEntity = null;
- if (!consumer.isHidingReferences ())
- top = top.getParentNode ();
- }
-
-
- // SAX1 DTD event
- public void notationDecl (
- String name,
- String publicId, String SystemId
- ) throws SAXException
- {
- /* IGNORE -- no public DOM API lets us store these
- * into the doctype node
- */
- }
-
- // SAX1 DTD event
- public void unparsedEntityDecl (
- String name,
- String publicId, String SystemId,
- String notationName
- ) throws SAXException
- {
- /* IGNORE -- no public DOM API lets us store these
- * into the doctype node
- */
- }
-
- // SAX2 declaration event
- public void elementDecl (String name, String model)
- throws SAXException
- {
- /* IGNORE -- no content model support in DOM L2 */
- }
-
- // SAX2 declaration event
- public void attributeDecl (
- String eName,
- String aName,
- String type,
- String mode,
- String value
- ) throws SAXException
- {
- /* IGNORE -- no attribute model support in DOM L2 */
- }
-
- // SAX2 declaration event
- public void internalEntityDecl (String name, String value)
- throws SAXException
- {
- /* IGNORE -- no public DOM API lets us store these
- * into the doctype node
- */
- }
-
- // SAX2 declaration event
- public void externalEntityDecl (
- String name,
- String publicId,
- String SystemId
- ) throws SAXException
- {
- /* IGNORE -- no public DOM API lets us store these
- * into the doctype node
- */
- }
-
- //
- // These really should offer the option of nonfatal handling,
- // like other validity errors, though that would cause major
- // chaos in the DOM data structures. DOM is already spec'd
- // to treat many of these as fatal, so this is consistent.
- //
- private void namespaceError (String description)
- throws SAXParseException
- {
- SAXParseException err;
-
- err = new SAXParseException (description, locator);
- throw err;
- }
- }
-}
diff --git a/libjava/gnu/xml/pipeline/EventConsumer.java b/libjava/gnu/xml/pipeline/EventConsumer.java
deleted file mode 100644
index 017bc7f74f1..00000000000
--- a/libjava/gnu/xml/pipeline/EventConsumer.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* EventConsumer.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import org.xml.sax.*;
-
-
-/**
- * Collects the event consumption apparatus of a SAX pipeline stage.
- * Consumers which permit some handlers or other characteristics to be
- * configured will provide methods to support that configuration.
- *
- * <p> Two important categories of consumers include <em>filters</em>, which
- * process events and pass them on to other consumers, and <em>terminus</em>
- * (or <em>terminal</em>) stages, which don't pass events on. Filters are not
- * necessarily derived from the {@link EventFilter} class, although that
- * class can substantially simplify their construction by automating the
- * most common activities.
- *
- * <p> Event consumers which follow certain conventions for the signatures
- * of their constructors can be automatically assembled into pipelines
- * by the {@link PipelineFactory} class.
- *
- * @author David Brownell
- */
-public interface EventConsumer
-{
- /** Most stages process these core SAX callbacks. */
- public ContentHandler getContentHandler ();
-
- /** Few stages will use unparsed entities. */
- public DTDHandler getDTDHandler ();
-
- /**
- * This method works like the SAX2 XMLReader method of the same name,
- * and is used to retrieve the optional lexical and declaration handlers
- * in a pipeline.
- *
- * @param id This is a URI identifying the type of property desired.
- * @return The value of that property, if it is defined.
- *
- * @exception SAXNotRecognizedException Thrown if the particular
- * pipeline stage does not understand the specified identifier.
- */
- public Object getProperty (String id)
- throws SAXNotRecognizedException;
-
- /**
- * This method provides a filter stage with a handler that abstracts
- * presentation of warnings and both recoverable and fatal errors.
- * Most pipeline stages should share a single policy and mechanism
- * for such reports, since application components require consistency
- * in such activities. Accordingly, typical responses to this method
- * invocation involve saving the handler for use; filters will pass
- * it on to any other consumers they use.
- *
- * @param handler encapsulates error handling policy for this stage
- */
- public void setErrorHandler (ErrorHandler handler);
-}
diff --git a/libjava/gnu/xml/pipeline/EventFilter.java b/libjava/gnu/xml/pipeline/EventFilter.java
deleted file mode 100644
index 6600271718a..00000000000
--- a/libjava/gnu/xml/pipeline/EventFilter.java
+++ /dev/null
@@ -1,809 +0,0 @@
-/* EventFilter.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-import org.xml.sax.helpers.XMLFilterImpl;
-
-import gnu.xml.aelfred2.ContentHandler2;
-
-/**
- * A customizable event consumer, used to assemble various kinds of filters
- * using SAX handlers and an optional second consumer. It can be constructed
- * in two ways: <ul>
- *
- * <li> To serve as a passthrough, sending all events to a second consumer.
- * The second consumer may be identified through {@link #getNext}.
- *
- * <li> To serve as a dead end, with all handlers null;
- * {@link #getNext} returns null.
- *
- * </ul>
- *
- * <p> Additionally, SAX handlers may be assigned, which completely replace
- * the "upstream" view (through {@link EventConsumer}) of handlers, initially
- * null or the "next" consumer provided to the constructor. To make
- * it easier to build specialized filter classes, this class implements
- * all the standard SAX consumer handlers, and those implementations
- * delegate "downstream" to the consumer accessed by {@link #getNext}.
- *
- * <p> The simplest way to create a custom a filter class is to create a
- * subclass which overrides one or more handler interface methods. The
- * constructor for that subclass then registers itself as a handler for
- * those interfaces using a call such as <em>setContentHandler(this)</em>,
- * so the "upstream" view of event delivery is modified from the state
- * established in the base class constructor. That way,
- * the overridden methods intercept those event callbacks
- * as they go "downstream", and
- * all other event callbacks will pass events to any next consumer.
- * Overridden methods may invoke superclass methods (perhaps after modifying
- * parameters) if they wish to delegate such calls. Such subclasses
- * should use {@link #getErrorHandler} to report errors using the
- * common error reporting mechanism.
- *
- * <p> Another important technique is to construct a filter consisting
- * of only a few specific types of handler. For example, one could easily
- * prune out lexical events or various declarations by providing handlers
- * which don't pass those events downstream, or by providing null handlers.
- *
- * <hr />
- *
- * <p> This may be viewed as the consumer oriented analogue of the SAX2
- * {@link org.xml.sax.helpers.XMLFilterImpl XMLFilterImpl} class.
- * Key differences include: <ul>
- *
- * <li> This fully separates consumer and producer roles: it
- * does not implement the producer side <em>XMLReader</em> or
- * <em>EntityResolver</em> interfaces, so it can only be used
- * in "push" mode (it has no <em>parse()</em> methods).
- *
- * <li> "Extension" handlers are fully supported, enabling a
- * richer set of application requirements.
- * And it implements {@link EventConsumer}, which groups related
- * consumer methods together, rather than leaving them separated.
- *
- * <li> The chaining which is visible is "downstream" to the next
- * consumer, not "upstream" to the preceding producer.
- * It supports "fan-in", where
- * a consumer can be fed by several producers. (For "fan-out",
- * see the {@link TeeConsumer} class.)
- *
- * <li> Event chaining is set up differently. It is intended to
- * work "upstream" from terminus towards producer, during filter
- * construction, as described above.
- * This is part of an early binding model:
- * events don't need to pass through stages which ignore them.
- *
- * <li> ErrorHandler support is separated, on the grounds that
- * pipeline stages need to share the same error handling policy.
- * For the same reason, error handler setup goes "downstream":
- * when error handlers get set, they are passed to subsequent
- * consumers.
- *
- * </ul>
- *
- * <p> The {@link #chainTo chainTo()} convenience routine supports chaining to
- * an XMLFilterImpl, in its role as a limited functionality event
- * consumer. Its event producer role ({@link XMLFilter}) is ignored.
- *
- * <hr />
- *
- * <p> The {@link #bind bind()} routine may be used associate event pipelines
- * with any kind of {@link XMLReader} that will produce the events.
- * Such pipelines don't necessarily need to have any members which are
- * implemented using this class. That routine has some intelligence
- * which supports automatic changes to parser feature flags, letting
- * event piplines become largely independent of the particular feature
- * sets of parsers.
- *
- * @author David Brownell
- */
-public class EventFilter
- implements EventConsumer, ContentHandler2, DTDHandler,
- LexicalHandler, DeclHandler
-{
- // SAX handlers
- private ContentHandler docHandler, docNext;
- private DTDHandler dtdHandler, dtdNext;
- private LexicalHandler lexHandler, lexNext;
- private DeclHandler declHandler, declNext;
- // and ideally, one more for the stuff SAX2 doesn't show
-
- private Locator locator;
- private EventConsumer next;
- private ErrorHandler errHandler;
-
-
- /** SAX2 URI prefix for standard feature flags. */
- public static final String FEATURE_URI
- = "http://xml.org/sax/features/";
- /** SAX2 URI prefix for standard properties (mostly for handlers). */
- public static final String PROPERTY_URI
- = "http://xml.org/sax/properties/";
-
- /** SAX2 property identifier for {@link DeclHandler} events */
- public static final String DECL_HANDLER
- = PROPERTY_URI + "declaration-handler";
- /** SAX2 property identifier for {@link LexicalHandler} events */
- public static final String LEXICAL_HANDLER
- = PROPERTY_URI + "lexical-handler";
-
- //
- // These class objects will be null if the relevant class isn't linked.
- // Small configurations (pJava and some kinds of embedded systems) need
- // to facilitate smaller executables. So "instanceof" is undesirable
- // when bind() sees if it can remove some stages.
- //
- // SECURITY NOTE: assuming all these classes are part of the same sealed
- // package, there's no problem saving these in the instance of this class
- // that's associated with "this" class loader. But that wouldn't be true
- // for classes in another package.
- //
- private static boolean loaded;
- private static Class nsClass;
- private static Class validClass;
- private static Class wfClass;
- private static Class xincClass;
-
- static ClassLoader getClassLoader ()
- {
- Method m = null;
-
- try {
- m = Thread.class.getMethod("getContextClassLoader", null);
- } catch (NoSuchMethodException e) {
- // Assume that we are running JDK 1.1, use the current ClassLoader
- return EventFilter.class.getClassLoader();
- }
-
- try {
- return (ClassLoader) m.invoke(Thread.currentThread(), null);
- } catch (IllegalAccessException e) {
- // assert(false)
- throw new UnknownError(e.getMessage());
- } catch (InvocationTargetException e) {
- // assert(e.getTargetException() instanceof SecurityException)
- throw new UnknownError(e.getMessage());
- }
- }
-
- static Class loadClass (ClassLoader classLoader, String className)
- {
- try {
- if (classLoader == null)
- return Class.forName(className);
- else
- return classLoader.loadClass(className);
- } catch (Exception e) {
- return null;
- }
- }
-
- static private void loadClasses ()
- {
- ClassLoader loader = getClassLoader ();
-
- nsClass = loadClass (loader, "gnu.xml.pipeline.NSFilter");
- validClass = loadClass (loader, "gnu.xml.pipeline.ValidationConsumer");
- wfClass = loadClass (loader, "gnu.xml.pipeline.WellFormednessFilter");
- xincClass = loadClass (loader, "gnu.xml.pipeline.XIncludeFilter");
- loaded = true;
- }
-
-
- /**
- * Binds the standard SAX2 handlers from the specified consumer
- * pipeline to the specified producer. These handlers include the core
- * {@link ContentHandler} and {@link DTDHandler}, plus the extension
- * {@link DeclHandler} and {@link LexicalHandler}. Any additional
- * application-specific handlers need to be bound separately.
- * The {@link ErrorHandler} is handled differently: the producer's
- * error handler is passed through to the consumer pipeline.
- * The producer is told to include namespace prefix information if it
- * can, since many pipeline stages need that Infoset information to
- * work well.
- *
- * <p> At the head of the pipeline, certain standard event filters are
- * recognized and handled specially. This facilitates construction
- * of processing pipelines that work regardless of the capabilities
- * of the XMLReader implementation in use; for example, it permits
- * validating output of a {@link gnu.xml.util.DomParser}. <ul>
- *
- * <li> {@link NSFilter} will be removed if the producer can be
- * told not to discard namespace data, using the "namespace-prefixes"
- * feature flag.
- *
- * <li> {@link ValidationConsumer} will be removed if the producer
- * can be told to validate, using the "validation" feature flag.
- *
- * <li> {@link WellFormednessFilter} is always removed, on the
- * grounds that no XMLReader is permitted to producee malformed
- * event streams and this would just be processing overhead.
- *
- * <li> {@link XIncludeFilter} stops the special handling, except
- * that it's told about the "namespace-prefixes" feature of the
- * event producer so that the event stream is internally consistent.
- *
- * <li> The first consumer which is not one of those classes stops
- * such special handling. This means that if you want to force
- * one of those filters to be used, you could just precede it with
- * an instance of {@link EventFilter} configured as a pass-through.
- * You might need to do that if you are using an {@link NSFilter}
- * subclass to fix names found in attributes or character data.
- *
- * </ul>
- *
- * <p> Other than that, this method works with any kind of event consumer,
- * not just event filters. Note that in all cases, the standard handlers
- * are assigned; any previous handler assignments for the handler will
- * be overridden.
- *
- * @param producer will deliver events to the specified consumer
- * @param consumer pipeline supplying event handlers to be associated
- * with the producer (may not be null)
- */
- public static void bind (XMLReader producer, EventConsumer consumer)
- {
- Class klass = null;
- boolean prefixes;
-
- if (!loaded)
- loadClasses ();
-
- // DOM building, printing, layered validation, and other
- // things don't work well when prefix info is discarded.
- // Include it by default, whenever possible.
- try {
- producer.setFeature (FEATURE_URI + "namespace-prefixes",
- true);
- prefixes = true;
- } catch (SAXException e) {
- prefixes = false;
- }
-
- // NOTE: This loop doesn't use "instanceof", since that
- // would prevent compiling/linking without those classes
- // being present.
- while (consumer != null) {
- klass = consumer.getClass ();
-
- // we might have already changed this problematic SAX2 default.
- if (nsClass != null && nsClass.isAssignableFrom (klass)) {
- if (!prefixes)
- break;
- consumer = ((EventFilter)consumer).getNext ();
-
- // the parser _might_ do DTD validation by default ...
- // if not, maybe we can change this setting.
- } else if (validClass != null
- && validClass.isAssignableFrom (klass)) {
- try {
- producer.setFeature (FEATURE_URI + "validation",
- true);
- consumer = ((ValidationConsumer)consumer).getNext ();
- } catch (SAXException e) {
- break;
- }
-
- // parsers are required not to have such bugs
- } else if (wfClass != null && wfClass.isAssignableFrom (klass)) {
- consumer = ((WellFormednessFilter)consumer).getNext ();
-
- // stop on the first pipeline stage we can't remove
- } else
- break;
-
- if (consumer == null)
- klass = null;
- }
-
- // the actual setting here doesn't matter as much
- // as that producer and consumer agree
- if (xincClass != null && klass != null
- && xincClass.isAssignableFrom (klass))
- ((XIncludeFilter)consumer).setSavingPrefixes (prefixes);
-
- // Some SAX parsers can't handle null handlers -- bleech
- DefaultHandler2 h = new DefaultHandler2 ();
-
- if (consumer != null && consumer.getContentHandler () != null)
- producer.setContentHandler (consumer.getContentHandler ());
- else
- producer.setContentHandler (h);
- if (consumer != null && consumer.getDTDHandler () != null)
- producer.setDTDHandler (consumer.getDTDHandler ());
- else
- producer.setDTDHandler (h);
-
- try {
- Object dh;
-
- if (consumer != null)
- dh = consumer.getProperty (DECL_HANDLER);
- else
- dh = null;
- if (dh == null)
- dh = h;
- producer.setProperty (DECL_HANDLER, dh);
- } catch (Exception e) { /* ignore */ }
- try {
- Object lh;
-
- if (consumer != null)
- lh = consumer.getProperty (LEXICAL_HANDLER);
- else
- lh = null;
- if (lh == null)
- lh = h;
- producer.setProperty (LEXICAL_HANDLER, lh);
- } catch (Exception e) { /* ignore */ }
-
- // this binding goes the other way around
- if (producer.getErrorHandler () == null)
- producer.setErrorHandler (h);
- if (consumer != null)
- consumer.setErrorHandler (producer.getErrorHandler ());
- }
-
- /**
- * Initializes all handlers to null.
- */
- // constructor used by PipelineFactory
- public EventFilter () { }
-
-
- /**
- * Handlers that are not otherwise set will default to those from
- * the specified consumer, making it easy to pass events through.
- * If the consumer is null, all handlers are initialzed to null.
- */
- // constructor used by PipelineFactory
- public EventFilter (EventConsumer consumer)
- {
- if (consumer == null)
- return;
-
- next = consumer;
-
- // We delegate through the "xxNext" handlers, and
- // report the "xxHandler" ones on our input side.
-
- // Normally a subclass would both override handler
- // methods and register itself as the "xxHandler".
-
- docHandler = docNext = consumer.getContentHandler ();
- dtdHandler = dtdNext = consumer.getDTDHandler ();
- try {
- declHandler = declNext = (DeclHandler)
- consumer.getProperty (DECL_HANDLER);
- } catch (SAXException e) { /* leave value null */ }
- try {
- lexHandler = lexNext = (LexicalHandler)
- consumer.getProperty (LEXICAL_HANDLER);
- } catch (SAXException e) { /* leave value null */ }
- }
-
- /**
- * Treats the XMLFilterImpl as a limited functionality event consumer,
- * by arranging to deliver events to it; this lets such classes be
- * "wrapped" as pipeline stages.
- *
- * <p> <em>Upstream Event Setup:</em>
- * If no handlers have been assigned to this EventFilter, then the
- * handlers from specified XMLFilterImpl are returned from this
- * {@link EventConsumer}: the XMLFilterImpl is just "wrapped".
- * Otherwise the specified handlers will be returned.
- *
- * <p> <em>Downstream Event Setup:</em>
- * Subclasses may chain event delivery to the specified XMLFilterImpl
- * by invoking the appropiate superclass methods,
- * as if their constructor passed a "next" EventConsumer to the
- * constructor for this class.
- * If this EventFilter has an ErrorHandler, it is assigned as
- * the error handler for the XMLFilterImpl, just as would be
- * done for a next stage implementing {@link EventConsumer}.
- *
- * @param next the next downstream component of the pipeline.
- * @exception IllegalStateException if the "next" consumer has
- * already been set through the constructor.
- */
- public void chainTo (XMLFilterImpl next)
- {
- if (this.next != null)
- throw new IllegalStateException ();
-
- docNext = next.getContentHandler ();
- if (docHandler == null)
- docHandler = docNext;
- dtdNext = next.getDTDHandler ();
- if (dtdHandler == null)
- dtdHandler = dtdNext;
-
- try {
- declNext = (DeclHandler) next.getProperty (DECL_HANDLER);
- if (declHandler == null)
- declHandler = declNext;
- } catch (SAXException e) { /* leave value null */ }
- try {
- lexNext = (LexicalHandler) next.getProperty (LEXICAL_HANDLER);
- if (lexHandler == null)
- lexHandler = lexNext;
- } catch (SAXException e) { /* leave value null */ }
-
- if (errHandler != null)
- next.setErrorHandler (errHandler);
- }
-
- /**
- * Records the error handler that should be used by this stage, and
- * passes it "downstream" to any subsequent stage.
- */
- final public void setErrorHandler (ErrorHandler handler)
- {
- errHandler = handler;
- if (next != null)
- next.setErrorHandler (handler);
- }
-
- /**
- * Returns the error handler assigned this filter stage, or null
- * if no such assigment has been made.
- */
- final public ErrorHandler getErrorHandler ()
- {
- return errHandler;
- }
-
-
- /**
- * Returns the next event consumer in sequence; or null if there
- * is no such handler.
- */
- final public EventConsumer getNext ()
- { return next; }
-
-
- /**
- * Assigns the content handler to use; a null handler indicates
- * that these events will not be forwarded.
- * This overrides the previous settting for this handler, which was
- * probably pointed to the next consumer by the base class constructor.
- */
- final public void setContentHandler (ContentHandler h)
- {
- docHandler = h;
- }
-
- /** Returns the content handler being used. */
- final public ContentHandler getContentHandler ()
- {
- return docHandler;
- }
-
- /**
- * Assigns the DTD handler to use; a null handler indicates
- * that these events will not be forwarded.
- * This overrides the previous settting for this handler, which was
- * probably pointed to the next consumer by the base class constructor.
- */
- final public void setDTDHandler (DTDHandler h)
- { dtdHandler = h; }
-
- /** Returns the dtd handler being used. */
- final public DTDHandler getDTDHandler ()
- {
- return dtdHandler;
- }
-
- /**
- * Stores the property, normally a handler; a null handler indicates
- * that these events will not be forwarded.
- * This overrides the previous handler settting, which was probably
- * pointed to the next consumer by the base class constructor.
- */
- final public void setProperty (String id, Object o)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- try {
- Object value = getProperty (id);
-
- if (value == o)
- return;
- if (DECL_HANDLER.equals (id)) {
- declHandler = (DeclHandler) o;
- return;
- }
- if (LEXICAL_HANDLER.equals (id)) {
- lexHandler = (LexicalHandler) o;
- return;
- }
- throw new SAXNotSupportedException (id);
-
- } catch (ClassCastException e) {
- throw new SAXNotSupportedException (id);
- }
- }
-
- /** Retrieves a property of unknown intent (usually a handler) */
- final public Object getProperty (String id)
- throws SAXNotRecognizedException
- {
- if (DECL_HANDLER.equals (id))
- return declHandler;
- if (LEXICAL_HANDLER.equals (id))
- return lexHandler;
-
- throw new SAXNotRecognizedException (id);
- }
-
- /**
- * Returns any locator provided to the next consumer, if this class
- * (or a subclass) is handling {@link ContentHandler } events.
- */
- public Locator getDocumentLocator ()
- { return locator; }
-
-
- // CONTENT HANDLER DELEGATIONS
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void setDocumentLocator (Locator locator)
- {
- this.locator = locator;
- if (docNext != null)
- docNext.setDocumentLocator (locator);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void startDocument () throws SAXException
- {
- if (docNext != null)
- docNext.startDocument ();
- }
-
- public void xmlDecl(String version, String encoding, boolean standalone,
- String inputEncoding)
- throws SAXException
- {
- if (docNext != null && docNext instanceof ContentHandler2)
- {
- ((ContentHandler2) docNext).xmlDecl(version, encoding, standalone,
- inputEncoding);
- }
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void skippedEntity (String name) throws SAXException
- {
- if (docNext != null)
- docNext.skippedEntity (name);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- if (docNext != null)
- docNext.processingInstruction (target, data);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void characters (char ch [], int start, int length)
- throws SAXException
- {
- if (docNext != null)
- docNext.characters (ch, start, length);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void ignorableWhitespace (char ch [], int start, int length)
- throws SAXException
- {
- if (docNext != null)
- docNext.ignorableWhitespace (ch, start, length);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException
- {
- if (docNext != null)
- docNext.startPrefixMapping (prefix, uri);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void startElement (
- String uri, String localName,
- String qName, Attributes atts
- ) throws SAXException
- {
- if (docNext != null)
- docNext.startElement (uri, localName, qName, atts);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- if (docNext != null)
- docNext.endElement (uri, localName, qName);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void endPrefixMapping (String prefix) throws SAXException
- {
- if (docNext != null)
- docNext.endPrefixMapping (prefix);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void endDocument () throws SAXException
- {
- if (docNext != null)
- docNext.endDocument ();
- locator = null;
- }
-
-
- // DTD HANDLER DELEGATIONS
-
- /** <b>SAX1:</b> passes this callback to the next consumer, if any */
- public void unparsedEntityDecl (
- String name,
- String publicId,
- String systemId,
- String notationName
- ) throws SAXException
- {
- if (dtdNext != null)
- dtdNext.unparsedEntityDecl (name, publicId, systemId, notationName);
- }
-
- /** <b>SAX1:</b> passes this callback to the next consumer, if any */
- public void notationDecl (String name, String publicId, String systemId)
- throws SAXException
- {
- if (dtdNext != null)
- dtdNext.notationDecl (name, publicId, systemId);
- }
-
-
- // LEXICAL HANDLER DELEGATIONS
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void startDTD (String name, String publicId, String systemId)
- throws SAXException
- {
- if (lexNext != null)
- lexNext.startDTD (name, publicId, systemId);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void endDTD ()
- throws SAXException
- {
- if (lexNext != null)
- lexNext.endDTD ();
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void comment (char ch [], int start, int length)
- throws SAXException
- {
- if (lexNext != null)
- lexNext.comment (ch, start, length);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void startCDATA ()
- throws SAXException
- {
- if (lexNext != null)
- lexNext.startCDATA ();
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void endCDATA ()
- throws SAXException
- {
- if (lexNext != null)
- lexNext.endCDATA ();
- }
-
- /**
- * <b>SAX2:</b> passes this callback to the next consumer, if any.
- */
- public void startEntity (String name)
- throws SAXException
- {
- if (lexNext != null)
- lexNext.startEntity (name);
- }
-
- /**
- * <b>SAX2:</b> passes this callback to the next consumer, if any.
- */
- public void endEntity (String name)
- throws SAXException
- {
- if (lexNext != null)
- lexNext.endEntity (name);
- }
-
-
- // DECLARATION HANDLER DELEGATIONS
-
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void elementDecl (String name, String model)
- throws SAXException
- {
- if (declNext != null)
- declNext.elementDecl (name, model);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void attributeDecl (String eName, String aName,
- String type, String mode, String value)
- throws SAXException
- {
- if (declNext != null)
- declNext.attributeDecl (eName, aName, type, mode, value);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void externalEntityDecl (String name,
- String publicId, String systemId)
- throws SAXException
- {
- if (declNext != null)
- declNext.externalEntityDecl (name, publicId, systemId);
- }
-
- /** <b>SAX2:</b> passes this callback to the next consumer, if any */
- public void internalEntityDecl (String name, String value)
- throws SAXException
- {
- if (declNext != null)
- declNext.internalEntityDecl (name, value);
- }
-}
diff --git a/libjava/gnu/xml/pipeline/LinkFilter.java b/libjava/gnu/xml/pipeline/LinkFilter.java
deleted file mode 100644
index ddb9fda2e75..00000000000
--- a/libjava/gnu/xml/pipeline/LinkFilter.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/* LinkFilter.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-
-/**
- * Pipeline filter to remember XHTML links found in a document,
- * so they can later be crawled. Fragments are not counted, and duplicates
- * are ignored. Callers are responsible for filtering out URLs they aren't
- * interested in. Events are passed through unmodified.
- *
- * <p> Input MUST include a setDocumentLocator() call, as it's used to
- * resolve relative links in the absence of a "base" element. Input MUST
- * also include namespace identifiers, since it is the XHTML namespace
- * identifier which is used to identify the relevant elements.
- *
- * <p><em>FIXME:</em> handle xml:base attribute ... in association with
- * a stack of base URIs. Similarly, recognize/support XLink data.
- *
- * @author David Brownell
- */
-public class LinkFilter extends EventFilter
-{
- // for storing URIs
- private Vector vector = new Vector ();
-
- // struct for "full" link record (tbd)
- // these for troubleshooting original source:
- // original uri
- // uri as resolved (base, relative, etc)
- // URI of originating doc
- // line #
- // original element + attrs (img src, desc, etc)
-
- // XLink model of the link ... for inter-site pairups ?
-
- private String baseURI;
-
- private boolean siteRestricted = false;
-
- //
- // XXX leverage blacklist info (like robots.txt)
- //
- // XXX constructor w/param ... pipeline for sending link data
- // probably XHTML --> XLink, providing info as sketched above
- //
-
-
- /**
- * Constructs a new event filter, which collects links in private data
- * structure for later enumeration.
- */
- // constructor used by PipelineFactory
- public LinkFilter ()
- {
- super.setContentHandler (this);
- }
-
-
- /**
- * Constructs a new event filter, which collects links in private data
- * structure for later enumeration and passes all events, unmodified,
- * to the next consumer.
- */
- // constructor used by PipelineFactory
- public LinkFilter (EventConsumer next)
- {
- super (next);
- super.setContentHandler (this);
- }
-
-
- /**
- * Returns an enumeration of the links found since the filter
- * was constructed, or since removeAllLinks() was called.
- *
- * @return enumeration of strings.
- */
- public Enumeration getLinks ()
- {
- return vector.elements ();
- }
-
- /**
- * Removes records about all links reported to the event
- * stream, as if the filter were newly created.
- */
- public void removeAllLinks ()
- {
- vector = new Vector ();
- }
-
-
- /**
- * Collects URIs for (X)HTML content from elements which hold them.
- */
- public void startElement (
- String uri,
- String localName,
- String qName,
- Attributes atts
- ) throws SAXException
- {
- String link;
-
- // Recognize XHTML links.
- if ("http://www.w3.org/1999/xhtml".equals (uri)) {
-
- if ("a".equals (localName) || "base".equals (localName)
- || "area".equals (localName))
- link = atts.getValue ("href");
- else if ("iframe".equals (localName) || "frame".equals (localName))
- link = atts.getValue ("src");
- else if ("blockquote".equals (localName) || "q".equals (localName)
- || "ins".equals (localName) || "del".equals (localName))
- link = atts.getValue ("cite");
- else
- link = null;
- link = maybeAddLink (link);
-
- // "base" modifies designated baseURI
- if ("base".equals (localName) && link != null)
- baseURI = link;
-
- if ("iframe".equals (localName) || "img".equals (localName))
- maybeAddLink (atts.getValue ("longdesc"));
- }
-
- super.startElement (uri, localName, qName, atts);
- }
-
- private String maybeAddLink (String link)
- {
- int index;
-
- // ignore empty links and fragments inside docs
- if (link == null)
- return null;
- if ((index = link.indexOf ("#")) >= 0)
- link = link.substring (0, index);
- if (link.equals (""))
- return null;
-
- try {
- // get the real URI
- URL base = new URL ((baseURI != null)
- ? baseURI
- : getDocumentLocator ().getSystemId ());
- URL url = new URL (base, link);
-
- link = url.toString ();
-
- // ignore duplicates
- if (vector.contains (link))
- return link;
-
- // other than what "base" does, stick to original site:
- if (siteRestricted) {
- // don't switch protocols
- if (!base.getProtocol ().equals (url.getProtocol ()))
- return link;
- // don't switch servers
- if (base.getHost () != null
- && !base.getHost ().equals (url.getHost ()))
- return link;
- }
-
- vector.addElement (link);
-
- return link;
-
- } catch (IOException e) {
- // bad URLs we don't want
- }
- return null;
- }
-
- /**
- * Reports an error if no Locator has been made available.
- */
- public void startDocument ()
- throws SAXException
- {
- if (getDocumentLocator () == null)
- throw new SAXException ("no Locator!");
- }
-
- /**
- * Forgets about any base URI information that may be recorded.
- * Applications will often want to call removeAllLinks(), likely
- * after examining the links which were reported.
- */
- public void endDocument ()
- throws SAXException
- {
- baseURI = null;
- super.endDocument ();
- }
-}
diff --git a/libjava/gnu/xml/pipeline/NSFilter.java b/libjava/gnu/xml/pipeline/NSFilter.java
deleted file mode 100644
index db875e1debf..00000000000
--- a/libjava/gnu/xml/pipeline/NSFilter.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/* NSFilter.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import java.util.Enumeration;
-import java.util.Stack;
-
-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
- * like writing XML text, and validating against DTDs: names or their prefixes
- * may have been discarded, although they are essential to the exchange of
- * information using XML. There are various common ways that such data
- * gets discarded: <ul>
- *
- * <li> By default, SAX2 parsers must discard the "xmlns*"
- * attributes, and may also choose not to report properly prefixed
- * names for elements or attributes. (Some parsers may support
- * changing the <em>namespace-prefixes</em> value from the default
- * to <em>true</em>, effectively eliminating the need to use this
- * filter on their output.)
- *
- * <li> When event streams are generated from a DOM tree, they may
- * have never have had prefixes or declarations for namespaces; or
- * the existing prefixes or declarations may have been invalidated
- * by structural modifications to that DOM tree.
- *
- * <li> Other software writing SAX event streams won't necessarily
- * be worrying about prefix management, and so they will need to
- * have a transparent solution for managing them.
- *
- * </ul>
- *
- * <p> This filter uses a heuristic to choose the prefix to assign to any
- * particular name which wasn't already corectly prefixed. The associated
- * namespace will be correct, and the prefix will be declared. Original
- * structures facilitating text editing, such as conventions about use of
- * mnemonic prefix names or the scoping of prefixes, can't always be
- * reconstructed after they are discarded, as strongly encouraged by the
- * current SAX2 defaults.
- *
- * <p> Note that this can't possibly know whether values inside attribute
- * value or document content involve prefixed names. If your application
- * requires using prefixed names in such locations you'll need to add some
- * appropriate logic (perhaps adding additional heuristics in a subclass).
- *
- * @author David Brownell
- */
-public class NSFilter extends EventFilter
-{
- private NamespaceSupport nsStack = new NamespaceSupport ();
- private Stack elementStack = new Stack ();
-
- private boolean pushedContext;
- private String nsTemp [] = new String [3];
- private AttributesImpl attributes = new AttributesImpl ();
- private boolean usedDefault;
-
- // gensymmed prefixes use this root name
- private static final String prefixRoot = "prefix-";
-
-
- /**
- * Passes events through to the specified consumer, after first
- * processing them.
- *
- * @param next the next event consumer to receive events.
- */
- // constructor used by PipelineFactory
- public NSFilter (EventConsumer next)
- {
- super (next);
-
- setContentHandler (this);
- }
-
- private void fatalError (String message)
- throws SAXException
- {
- SAXParseException e;
- ErrorHandler handler = getErrorHandler ();
- Locator locator = getDocumentLocator ();
-
- if (locator == null)
- e = new SAXParseException (message, null, null, -1, -1);
- else
- e = new SAXParseException (message, locator);
- if (handler != null)
- handler.fatalError (e);
- throw e;
- }
-
-
- public void startDocument () throws SAXException
- {
- elementStack.removeAllElements ();
- nsStack.reset ();
- pushedContext = false;
- super.startDocument ();
- }
-
- /**
- * This call is not passed to the next consumer in the chain.
- * Prefix declarations and scopes are only exposed in the form
- * of attributes; this callback just records a declaration that
- * will be exposed as an attribute.
- */
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException
- {
- if (pushedContext == false) {
- nsStack.pushContext ();
- pushedContext = true;
- }
-
- // this check is awkward, but the paranoia prevents big trouble
- for (Enumeration e = nsStack.getDeclaredPrefixes ();
- e.hasMoreElements ();
- /* NOP */ ) {
- String declared = (String) e.nextElement ();
-
- if (!declared.equals (prefix))
- continue;
- if (uri.equals (nsStack.getURI (prefix)))
- return;
- fatalError ("inconsistent binding for prefix '" + prefix
- + "' ... " + uri + " (was " + nsStack.getURI (prefix) + ")");
- }
-
- if (!nsStack.declarePrefix (prefix, uri))
- fatalError ("illegal prefix declared: " + prefix);
- }
-
- private String fixName (String ns, String l, String name, boolean isAttr)
- throws SAXException
- {
- if ("".equals (name) || name == null) {
- name = l;
- if ("".equals (name) || name == null)
- fatalError ("empty/null name");
- }
-
- // can we correctly process the name as-is?
- // handles "element scope" attribute names here.
- if (nsStack.processName (name, nsTemp, isAttr) != null
- && nsTemp [0].equals (ns)
- ) {
- return nsTemp [2];
- }
-
- // nope, gotta modify the name or declare a default mapping
- int temp;
-
- // get rid of any current prefix
- if ((temp = name.indexOf (':')) >= 0) {
- name = name.substring (temp + 1);
-
- // ... maybe that's enough (use/prefer default namespace) ...
- if (!isAttr && nsStack.processName (name, nsTemp, false) != null
- && nsTemp [0].equals (ns)
- ) {
- return nsTemp [2];
- }
- }
-
- // must we define and use the default/undefined prefix?
- if ("".equals (ns)) {
- if (isAttr)
- fatalError ("processName bug");
- if (attributes.getIndex ("xmlns") != -1)
- fatalError ("need to undefine default NS, but it's bound: "
- + attributes.getValue ("xmlns"));
-
- nsStack.declarePrefix ("", "");
- attributes.addAttribute ("", "", "xmlns", "CDATA", "");
- return name;
- }
-
- // is there at least one non-null prefix we can use?
- for (Enumeration e = nsStack.getDeclaredPrefixes ();
- e.hasMoreElements ();
- /* NOP */) {
- String prefix = (String) e.nextElement ();
- String uri = nsStack.getURI (prefix);
-
- if (uri == null || !uri.equals (ns))
- continue;
- return prefix + ":" + name;
- }
-
- // no such luck. create a prefix name, declare it, use it.
- for (temp = 0; temp >= 0; temp++) {
- String prefix = prefixRoot + temp;
-
- if (nsStack.getURI (prefix) == null) {
- nsStack.declarePrefix (prefix, ns);
- attributes.addAttribute ("", "", "xmlns:" + prefix,
- "CDATA", ns);
- return prefix + ":" + name;
- }
- }
- fatalError ("too many prefixes genned");
- // NOTREACHED
- return null;
- }
-
- public void startElement (
- String uri, String localName,
- String qName, Attributes atts
- ) throws SAXException
- {
- if (!pushedContext)
- nsStack.pushContext ();
- pushedContext = false;
-
- // make sure we have all NS declarations handy before we start
- int length = atts.getLength ();
-
- for (int i = 0; i < length; i++) {
- String aName = atts.getQName (i);
-
- if (!aName.startsWith ("xmlns"))
- continue;
-
- String prefix;
-
- if ("xmlns".equals (aName))
- prefix = "";
- else if (aName.indexOf (':') == 5)
- prefix = aName.substring (6);
- else // "xmlnsfoo" etc.
- continue;
- startPrefixMapping (prefix, atts.getValue (i));
- }
-
- // put namespace decls at the start of our regenned attlist
- attributes.clear ();
- for (Enumeration e = nsStack.getDeclaredPrefixes ();
- e.hasMoreElements ();
- /* NOP */) {
- String prefix = (String) e.nextElement ();
-
- attributes.addAttribute ("", "",
- ("".equals (prefix)
- ? "xmlns"
- : "xmlns:" + prefix),
- "CDATA",
- nsStack.getURI (prefix));
- }
-
- // name fixups: element, then attributes.
- // fixName may declare a new prefix or, for the element,
- // redeclare the default (if element name needs it).
- qName = fixName (uri, localName, qName, false);
-
- for (int i = 0; i < length; i++) {
- String aName = atts.getQName (i);
- String aNS = atts.getURI (i);
- String aLocal = atts.getLocalName (i);
- String aType = atts.getType (i);
- String aValue = atts.getValue (i);
-
- if (aName.startsWith ("xmlns"))
- continue;
- aName = fixName (aNS, aLocal, aName, true);
- attributes.addAttribute (aNS, aLocal, aName, aType, aValue);
- }
-
- elementStack.push (qName);
-
- // pass event along, with cleaned-up names and decls.
- super.startElement (uri, localName, qName, attributes);
- }
-
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- nsStack.popContext ();
- qName = (String) elementStack.pop ();
- super.endElement (uri, localName, qName);
- }
-
- /**
- * This call is not passed to the next consumer in the chain.
- * Prefix declarations and scopes are only exposed in their
- * attribute form.
- */
- public void endPrefixMapping (String prefix)
- throws SAXException
- { }
-
- public void endDocument () throws SAXException
- {
- elementStack.removeAllElements ();
- nsStack.reset ();
- super.endDocument ();
- }
-}
diff --git a/libjava/gnu/xml/pipeline/PipelineFactory.java b/libjava/gnu/xml/pipeline/PipelineFactory.java
deleted file mode 100644
index f88ab164311..00000000000
--- a/libjava/gnu/xml/pipeline/PipelineFactory.java
+++ /dev/null
@@ -1,723 +0,0 @@
-/* PipelineFactory.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.lang.reflect.Constructor;
-import java.util.StringTokenizer;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-
-
-/**
- * This provides static factory methods for creating simple event pipelines.
- * These pipelines are specified by strings, suitable for passing on
- * command lines or embedding in element attributes. For example, one way
- * to write a pipeline that restores namespace syntax, validates (stopping
- * the pipeline on validity errors) and then writes valid data to standard
- * output is this: <pre>
- * nsfix | validate | write ( stdout )</pre>
- *
- * <p> In this syntax, the tokens are always separated by whitespace, and each
- * stage of the pipeline may optionally have a parameter (which can be a
- * pipeline) in parentheses. Interior stages are called filters, and the
- * rightmost end of a pipeline is called a terminus.
- *
- * <p> Stages are usually implemented by a single class, which may not be
- * able to act as both a filter and a terminus; but any terminus can be
- * automatically turned into a filter, through use of a {@link TeeConsumer}.
- * The stage identifiers are either class names, or are one of the following
- * short identifiers built into this class. (Most of these identifiers are
- * no more than aliases for classes.) The built-in identifiers include:</p>
-
- <table border="1" cellpadding="3" cellspacing="0">
- <tr bgcolor="#ccccff" class="TableHeadingColor">
- <th align="center" width="5%">Stage</th>
- <th align="center" width="9%">Parameter</th>
- <th align="center" width="1%">Terminus</th>
- <th align="center">Description</th>
- </tr>
-
- <tr valign="top" align="center">
- <td><a href="../dom/Consumer.html">dom</a></td>
- <td><em>none</em></td>
- <td> yes </td>
- <td align="left"> Applications code can access a DOM Document built
- from the input event stream. When used as a filter, this buffers
- data up to an <em>endDocument</em> call, and then uses a DOM parser
- to report everything that has been recorded (which can easily be
- less than what was reported to it). </td>
- </tr>
- <tr valign="top" align="center">
- <td><a href="NSFilter.html">nsfix</a></td>
- <td><em>none</em></td>
- <td>no</td>
- <td align="left">This stage ensures that the XML element and attribute
- names in its output use namespace prefixes and declarations correctly.
- That is, so that they match the "Namespace plus LocalName" naming data
- with which each XML element and attribute is already associated. </td>
- </tr>
- <tr valign="top" align="center">
- <td><a href="EventFilter.html">null</a></td>
- <td><em>none</em></td>
- <td>yes</td>
- <td align="left">This stage ignores all input event data.</td>
- </tr>
- <tr valign="top" align="center">
- <td><a href="CallFilter.html">server</a></td>
- <td><em>required</em><br> server URL </td>
- <td>no</td>
- <td align="left">Sends its input as XML request to a remote server,
- normally a web application server using the HTTP or HTTPS protocols.
- The output of this stage is the parsed response from that server.</td>
- </tr>
- <tr valign="top" align="center">
- <td><a href="TeeConsumer.html">tee</a></td>
- <td><em>required</em><br> first pipeline</td>
- <td>no</td>
- <td align="left">This sends its events down two paths; its parameter
- is a pipeline descriptor for the first path, and the second path
- is the output of this stage.</td>
- </tr>
-
- <tr valign="top" align="center">
- <td><a href="ValidationConsumer.html">validate</a></td>
- <td><em>none</em></td>
- <td>yes</td>
- <td align="left">This checks for validity errors, and reports them
- through its error handler. The input must include declaration events
- and some lexical events. </td>
- </tr>
- <tr valign="top" align="center">
- <td><a href="WellFormednessFilter.html">wf</a></td>
- <td><em>none</em></td>
- <td>yes</td>
- <td align="left"> This class provides some basic "well formedness"
- tests on the input event stream, and reports a fatal error if any
- of them fail. One example: start/end calls for elements must match.
- No SAX parser is permitted to produce malformed output, but other
- components can easily do so.</td>
- </tr>
- <tr valign="top" align="center">
- <td>write</td>
- <td><em>required</em><br> "stdout", "stderr", or filename</td>
- <td>yes</td>
- <td align="left"> Writes its input to the specified output, as pretty
- printed XML text encoded using UTF-8. Input events must be well
- formed and "namespace fixed", else the output won't be XML (or possibly
- namespace) conformant. The symbolic names represent
- <em>System.out</em> and <em>System.err</em> respectively; names must
- correspond to files which don't yet exist.</td>
- </tr>
- <tr valign="top" align="center">
- <td>xhtml</td>
- <td><em>required</em><br> "stdout", "stderr", or filename</td>
- <td>yes</td>
- <td align="left"> Like <em>write</em> (above), except that XHTML rules
- are followed. The XHTML 1.0 Transitional document type is declared,
- and only ASCII characters are written (for interoperability). Other
- characters are written as entity or character references; the text is
- pretty printed.</td>
- </tr>
- <tr valign="top" align="center">
- <td><a href="XIncludeFilter.html">xinclude</a></td>
- <td><em>none</em></td>
- <td>no</td>
- <td align="left">This stage handles XInclude processing.
- This is like entity inclusion, except that the included content
- is declared in-line rather than in the DTD at the beginning of
- a document.
- </td>
- </tr>
- <tr valign="top" align="center">
- <td><a href="XsltFilter.html">xslt</a></td>
- <td><em>required</em><br> XSLT stylesheet URI</td>
- <td>no</td>
- <td align="left">This stage handles XSLT transformation
- according to a stylesheet.
- The implementation of the transformation may not actually
- stream data, although if such an XSLT engine is in use
- then that can happen.
- </td>
- </tr>
-
- </table>
-
- * <p> Note that {@link EventFilter#bind} can automatically eliminate
- * some filters by setting SAX2 parser features appropriately. This means
- * that you can routinely put filters like "nsfix", "validate", or "wf" at the
- * front of a pipeline (for components that need inputs conditioned to match
- * that level of correctness), and know that it won't actually be used unless
- * it's absolutely necessary.
- *
- * @author David Brownell
- */
-public class PipelineFactory
-{
- /**
- * Creates a simple pipeline according to the description string passed in.
- */
- public static EventConsumer createPipeline (String description)
- throws IOException
- {
- return createPipeline (description, null);
- }
-
- /**
- * Extends an existing pipeline by prepending the filter pipeline to the
- * specified consumer. Some pipelines need more customization than can
- * be done through this simplified syntax. When they are set up with
- * direct API calls, use this method to merge more complex pipeline
- * segments with easily configured ones.
- */
- public static EventConsumer createPipeline (
- String description,
- EventConsumer next
- ) throws IOException
- {
- // tokens are (for now) what's separated by whitespace;
- // very easy to parse, but IDs never have spaces.
-
- StringTokenizer tokenizer;
- String tokens [];
-
- tokenizer = new StringTokenizer (description);
- tokens = new String [tokenizer.countTokens ()];
- for (int i = 0; i < tokens.length; i++)
- tokens [i] = tokenizer.nextToken ();
-
- PipelineFactory factory = new PipelineFactory ();
- Pipeline pipeline = factory.parsePipeline (tokens, next);
-
- return pipeline.createPipeline ();
- }
-
-
- private PipelineFactory () { /* NYET */ }
-
-
- /**
- * Extends an existing pipeline by prepending a pre-tokenized filter
- * pipeline to the specified consumer. Tokens are class names (or the
- * predefined aliases) left and right parenthesis, and the vertical bar.
- */
- public static EventConsumer createPipeline (
- String tokens [],
- EventConsumer next
- ) throws IOException
- {
- PipelineFactory factory = new PipelineFactory ();
- Pipeline pipeline = factory.parsePipeline (tokens, next);
-
- return pipeline.createPipeline ();
- }
-
-
- private String tokens [];
- private int index;
-
- private Pipeline parsePipeline (String toks [], EventConsumer next)
- {
- tokens = toks;
- index = 0;
-
- Pipeline retval = parsePipeline (next);
-
- if (index != toks.length)
- throw new ArrayIndexOutOfBoundsException (
- "extra token: " + tokens [index]);
- return retval;
- }
-
- // pipeline ::= stage | stage '|' pipeline
- private Pipeline parsePipeline (EventConsumer next)
- {
- Pipeline retval = new Pipeline (parseStage ());
-
- // minimal pipelines: "stage" and "... | id"
- if (index > (tokens.length - 2)
- || !"|".equals (tokens [index])
- ) {
- retval.next = next;
- return retval;
- }
- index++;
- retval.rest = parsePipeline (next);
- return retval;
- }
-
- // stage ::= id | id '(' pipeline ')'
- private Stage parseStage ()
- {
- Stage retval = new Stage (tokens [index++]);
-
- // minimal stages: "id" and "id ( id )"
- if (index > (tokens.length - 2)
- || !"(".equals (tokens [index]) /*)*/
- )
- return retval;
-
- index++;
- retval.param = parsePipeline (null);
- if (index >= tokens.length)
- throw new ArrayIndexOutOfBoundsException (
- "missing right paren");
- if (/*(*/ !")".equals (tokens [index++]))
- throw new ArrayIndexOutOfBoundsException (
- "required right paren, not: " + tokens [index - 1]);
- return retval;
- }
-
-
- //
- // these classes obey the conventions for constructors, so they're
- // only built in to this table of shortnames
- //
- // - filter (one or two types of arglist)
- // * last constructor is 'next' element
- // * optional (first) string parameter
- //
- // - terminus (one or types of arglist)
- // * optional (only) string parameter
- //
- // terminus stages are transformed into filters if needed, by
- // creating a "tee". filter stages aren't turned to terminus
- // stages though; either eliminate such stages, or add some
- // terminus explicitly.
- //
- private static final String builtinStages [][] = {
- { "dom", "gnu.xml.dom.Consumer" },
- { "nsfix", "gnu.xml.pipeline.NSFilter" },
- { "null", "gnu.xml.pipeline.EventFilter" },
- { "server", "gnu.xml.pipeline.CallFilter" },
- { "tee", "gnu.xml.pipeline.TeeConsumer" },
- { "validate", "gnu.xml.pipeline.ValidationConsumer" },
- { "wf", "gnu.xml.pipeline.WellFormednessFilter" },
- { "xinclude", "gnu.xml.pipeline.XIncludeFilter" },
- { "xslt", "gnu.xml.pipeline.XsltFilter" },
-
-// XXX want: option for validate, to preload external part of a DTD
-
- // xhtml, write ... nyet generic-ready
- };
-
- private static class Stage
- {
- String id;
- Pipeline param;
-
- Stage (String name)
- { id = name; }
-
- public String toString ()
- {
- if (param == null)
- return id;
- return id + " ( " + param + " )";
- }
-
- private void fail (String message)
- throws IOException
- {
- throw new IOException ("in '" + id
- + "' stage of pipeline, " + message);
- }
-
- EventConsumer createStage (EventConsumer next)
- throws IOException
- {
- String name = id;
-
- // most builtins are just class aliases
- for (int i = 0; i < builtinStages.length; i++) {
- if (id.equals (builtinStages [i][0])) {
- name = builtinStages [i][1];
- break;
- }
- }
-
- // Save output as XML or XHTML text
- if ("write".equals (name) || "xhtml".equals (name)) {
- String filename;
- boolean isXhtml = "xhtml".equals (name);
- OutputStream out = null;
- TextConsumer consumer;
-
- if (param == null)
- fail ("parameter is required");
-
- filename = param.toString ();
- if ("stdout".equals (filename))
- out = System.out;
- else if ("stderr".equals (filename))
- out = System.err;
- else {
- File f = new File (filename);
-
-/*
- if (!f.isAbsolute ())
- fail ("require absolute file paths");
- */
- if (f.exists ())
- fail ("file already exists: " + f.getName ());
-
-// XXX this races against the existence test
- out = new FileOutputStream (f);
- }
-
- if (!isXhtml)
- consumer = new TextConsumer (out);
- else
- consumer = new TextConsumer (
- new OutputStreamWriter (out, "8859_1"),
- true);
-
- consumer.setPrettyPrinting (true);
- if (next == null)
- return consumer;
- return new TeeConsumer (consumer, next);
-
- } else {
- //
- // Here go all the builtins that are just aliases for
- // classes, and all stage IDs that started out as such
- // class names. The following logic relies on several
- // documented conventions for constructor invocation.
- //
- String msg = null;
-
- try {
- Class klass = Class.forName (name);
- Class argTypes [] = null;
- Constructor constructor = null;
- boolean filter = false;
- Object params [] = null;
- Object obj = null;
-
- // do we need a filter stage?
- if (next != null) {
- // "next" consumer is always passed, with
- // or without the optional string param
- if (param == null) {
- argTypes = new Class [1];
- argTypes [0] = EventConsumer.class;
-
- params = new Object [1];
- params [0] = next;
-
- msg = "no-param filter";
- } else {
- argTypes = new Class [2];
- argTypes [0] = String.class;
- argTypes [1] = EventConsumer.class;
-
- params = new Object [2];
- params [0] = param.toString ();
- params [1] = next;
-
- msg = "one-param filter";
- }
-
-
- try {
- constructor = klass.getConstructor (argTypes);
- } catch (NoSuchMethodException e) {
- // try creating a filter from a
- // terminus and a tee
- filter = true;
- msg += " built from ";
- }
- }
-
- // build from a terminus stage, with or
- // without the optional string param
- if (constructor == null) {
- String tmp;
-
- if (param == null) {
- argTypes = new Class [0];
- params = new Object [0];
-
- tmp = "no-param terminus";
- } else {
- argTypes = new Class [1];
- argTypes [0] = String.class;
-
- params = new Object [1];
- params [0] = param.toString ();
-
- tmp = "one-param terminus";
- }
- if (msg == null)
- msg = tmp;
- else
- msg += tmp;
- constructor = klass.getConstructor (argTypes);
- // NOT creating terminus by dead-ending
- // filters ... users should think about
- // that one, something's likely wrong
- }
-
- obj = constructor.newInstance (params);
-
- // return EventConsumers directly, perhaps after
- // turning them into a filter
- if (obj instanceof EventConsumer) {
- if (filter)
- return new TeeConsumer ((EventConsumer) obj, next);
- return (EventConsumer) obj;
- }
-
- // if it's not a handler, it's an error
- // we can wrap handlers in a filter
- EventFilter retval = new EventFilter ();
- boolean updated = false;
-
- if (obj instanceof ContentHandler) {
- retval.setContentHandler ((ContentHandler) obj);
- updated = true;
- }
- if (obj instanceof DTDHandler) {
- retval.setDTDHandler ((DTDHandler) obj);
- updated = true;
- }
- if (obj instanceof LexicalHandler) {
- retval.setProperty (
- EventFilter.PROPERTY_URI + "lexical-handler",
- obj);
- updated = true;
- }
- if (obj instanceof DeclHandler) {
- retval.setProperty (
- EventFilter.PROPERTY_URI + "declaration-handler",
- obj);
- updated = true;
- }
-
- if (!updated)
- fail ("class is neither Consumer nor Handler");
-
- if (filter)
- return new TeeConsumer (retval, next);
- return retval;
-
- } catch (IOException e) {
- throw e;
-
- } catch (NoSuchMethodException e) {
- fail (name + " constructor missing -- " + msg);
-
- } catch (ClassNotFoundException e) {
- fail (name + " class not found");
-
- } catch (Exception e) {
- // e.printStackTrace ();
- fail ("stage not available: " + e.getMessage ());
- }
- }
- // NOTREACHED
- return null;
- }
- }
-
- private static class Pipeline
- {
- Stage stage;
-
- // rest may be null
- Pipeline rest;
- EventConsumer next;
-
- Pipeline (Stage s)
- { stage = s; }
-
- public String toString ()
- {
- if (rest == null && next == null)
- return stage.toString ();
- if (rest != null)
- return stage + " | " + rest;
- throw new IllegalArgumentException ("next");
- }
-
- EventConsumer createPipeline ()
- throws IOException
- {
- if (next == null) {
- if (rest == null)
- next = stage.createStage (null);
- else
- next = stage.createStage (rest.createPipeline ());
- }
- return next;
- }
- }
-
-/*
- public static void main (String argv [])
- {
- try {
- // three basic terminus cases
- createPipeline ("null");
- createPipeline ("validate");
- createPipeline ("write ( stdout )");
-
- // four basic filters
- createPipeline ("nsfix | write ( stderr )");
- createPipeline ("wf | null");
- createPipeline ("null | null");
- createPipeline (
-"call ( http://www.example.com/services/xml-1a ) | xhtml ( stdout )");
-
- // tee junctions
- createPipeline ("tee ( validate ) | write ( stdout )");
- createPipeline ("tee ( nsfix | write ( stdout ) ) | validate");
-
- // longer pipeline
- createPipeline ("nsfix | tee ( validate ) | write ( stdout )");
- createPipeline (
- "null | wf | nsfix | tee ( validate ) | write ( stdout )");
-
- // try some parsing error cases
- try {
- createPipeline ("null ("); // extra token '('
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
-
- try {
- createPipeline ("nsfix |"); // extra token '|'
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
-
- try {
- createPipeline ("xhtml ( foo"); // missing right paren
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
-
- try {
- createPipeline ("xhtml ( foo bar"); // required right paren
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
-
- try {
- createPipeline ("tee ( nsfix | validate");// missing right paren
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
-
- // try some construction error cases
-
- try {
- createPipeline ("call"); // missing param
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
- try {
- createPipeline ("call ( foobar )"); // broken param
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
- try {
- createPipeline ("nsfix ( foobar )"); // illegal param
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
- try {
- createPipeline ("null ( foobar )"); // illegal param
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
- try {
- createPipeline ("wf ( foobar )"); // illegal param
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
- try {
- createPipeline ("xhtml ( foobar.html )");
- new File ("foobar.html").delete ();
- // now supported
- } catch (Exception e) {
- System.err.println ("** err: " + e.getMessage ()); }
- try {
- createPipeline ("xhtml"); // missing param
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
- try {
- createPipeline ("write ( stdout ) | null"); // nonterminal
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
- try {
- createPipeline ("validate | null");
- // now supported
- } catch (Exception e) {
- System.err.println ("** err: " + e.getMessage ()); }
- try {
- createPipeline ("validate ( foo )"); // illegal param
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
- try {
- createPipeline ("tee"); // missing param
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
- try {
- // only builtins so far
- createPipeline ("com.example.xml.FilterClass");
- System.err.println ("** didn't report error");
- } catch (Exception e) {
- System.err.println ("== err: " + e.getMessage ()); }
-
- } catch (Exception e) {
- e.printStackTrace ();
- }
- }
-/**/
-
-}
diff --git a/libjava/gnu/xml/pipeline/TeeConsumer.java b/libjava/gnu/xml/pipeline/TeeConsumer.java
deleted file mode 100644
index 8186de4df66..00000000000
--- a/libjava/gnu/xml/pipeline/TeeConsumer.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/* TeeConsumer.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-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
- * event pipeline. Networks can be assembled with multiple output points.
- *
- * <p> Error handling should be simple if you remember that exceptions
- * you throw will cancel later stages in that callback's pipeline, and
- * generally the producer will stop if it sees such an exception. You
- * may want to protect your pipeline against such backflows, making a
- * kind of reverse filter (or valve?) so that certain exceptions thrown by
- * your pipeline will caught and handled before the producer sees them.
- * Just use a "try/catch" block, rememebering that really important
- * cleanup tasks should be in "finally" clauses.
- *
- * <p> That issue isn't unique to "tee" consumers, but tee consumers have
- * the additional twist that exceptions thrown by the first consumer
- * will cause the second consumer not to see the callback (except for
- * the endDocument callback, which signals state cleanup).
- *
- * @author David Brownell
- */
-final public class TeeConsumer
- implements EventConsumer,
- ContentHandler, DTDHandler,
- LexicalHandler,DeclHandler
-{
- private EventConsumer first, rest;
-
- // cached to minimize time overhead
- private ContentHandler docFirst, docRest;
- private DeclHandler declFirst, declRest;
- private LexicalHandler lexFirst, lexRest;
-
-
- /**
- * Constructs a consumer which sends all its events to the first
- * consumer, and then the second one. If the first consumer throws
- * an exception, the second one will not see the event which
- * caused that exception to be reported.
- *
- * @param car The first consumer to get the events
- * @param cdr The second consumer to get the events
- */
- public TeeConsumer (EventConsumer car, EventConsumer cdr)
- {
- if (car == null || cdr == null)
- throw new NullPointerException ();
- first = car;
- rest = cdr;
-
- //
- // Cache the handlers.
- //
- docFirst = first.getContentHandler ();
- docRest = rest.getContentHandler ();
- // DTD handler isn't cached (rarely needed)
-
- try {
- declFirst = null;
- declFirst = (DeclHandler) first.getProperty (
- EventFilter.DECL_HANDLER);
- } catch (SAXException e) {}
- try {
- declRest = null;
- declRest = (DeclHandler) rest.getProperty (
- EventFilter.DECL_HANDLER);
- } catch (SAXException e) {}
-
- try {
- lexFirst = null;
- lexFirst = (LexicalHandler) first.getProperty (
- EventFilter.LEXICAL_HANDLER);
- } catch (SAXException e) {}
- try {
- lexRest = null;
- lexRest = (LexicalHandler) rest.getProperty (
- EventFilter.LEXICAL_HANDLER);
- } catch (SAXException e) {}
- }
-
-/* FIXME
- /**
- * Constructs a pipeline, and is otherwise a shorthand for the
- * two-consumer constructor for this class.
- *
- * @param first Description of the first pipeline to get events,
- * which will be passed to {@link PipelineFactory#createPipeline}
- * @param rest The second pipeline to get the events
- * /
- // constructor used by PipelineFactory
- public TeeConsumer (String first, EventConsumer rest)
- throws IOException
- {
- this (PipelineFactory.createPipeline (first), rest);
- }
-*/
-
- /** Returns the first pipeline to get event calls. */
- public EventConsumer getFirst ()
- { return first; }
-
- /** Returns the second pipeline to get event calls. */
- public EventConsumer getRest ()
- { return rest; }
-
- /** Returns the content handler being used. */
- final public ContentHandler getContentHandler ()
- {
- if (docRest == null)
- return docFirst;
- if (docFirst == null)
- return docRest;
- return this;
- }
-
- /** Returns the dtd handler being used. */
- final public DTDHandler getDTDHandler ()
- {
- // not cached (hardly used)
- if (rest.getDTDHandler () == null)
- return first.getDTDHandler ();
- if (first.getDTDHandler () == null)
- return rest.getDTDHandler ();
- return this;
- }
-
- /** Returns the declaration or lexical handler being used. */
- final public Object getProperty (String id)
- throws SAXNotRecognizedException
- {
- //
- // in degenerate cases, we have no work to do.
- //
- Object firstProp = null, restProp = null;
-
- try { firstProp = first.getProperty (id); }
- catch (SAXNotRecognizedException e) { /* ignore */ }
- try { restProp = rest.getProperty (id); }
- catch (SAXNotRecognizedException e) { /* ignore */ }
-
- if (restProp == null)
- return firstProp;
- if (firstProp == null)
- return restProp;
-
- //
- // we've got work to do; handle two builtin cases.
- //
- if (EventFilter.DECL_HANDLER.equals (id))
- return this;
- if (EventFilter.LEXICAL_HANDLER.equals (id))
- return this;
-
- //
- // non-degenerate, handled by both consumers, but we don't know
- // how to handle this.
- //
- throw new SAXNotRecognizedException ("can't tee: " + id);
- }
-
- /**
- * Provides the error handler to both subsequent nodes of
- * this filter stage.
- */
- public void setErrorHandler (ErrorHandler handler)
- {
- first.setErrorHandler (handler);
- rest.setErrorHandler (handler);
- }
-
-
- //
- // ContentHandler
- //
- public void setDocumentLocator (Locator locator)
- {
- // this call is not made by all parsers
- docFirst.setDocumentLocator (locator);
- docRest.setDocumentLocator (locator);
- }
-
- public void startDocument ()
- throws SAXException
- {
- docFirst.startDocument ();
- docRest.startDocument ();
- }
-
- public void endDocument ()
- throws SAXException
- {
- try {
- docFirst.endDocument ();
- } finally {
- docRest.endDocument ();
- }
- }
-
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException
- {
- docFirst.startPrefixMapping (prefix, uri);
- docRest.startPrefixMapping (prefix, uri);
- }
-
- public void endPrefixMapping (String prefix)
- throws SAXException
- {
- docFirst.endPrefixMapping (prefix);
- docRest.endPrefixMapping (prefix);
- }
-
- public void skippedEntity (String name)
- throws SAXException
- {
- docFirst.skippedEntity (name);
- docRest.skippedEntity (name);
- }
-
- public void startElement (String uri, String localName,
- String qName, Attributes atts)
- throws SAXException
- {
- docFirst.startElement (uri, localName, qName, atts);
- docRest.startElement (uri, localName, qName, atts);
- }
-
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- docFirst.endElement (uri, localName, qName);
- docRest.endElement (uri, localName, qName);
- }
-
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- docFirst.processingInstruction (target, data);
- docRest.processingInstruction (target, data);
- }
-
- public void characters (char ch [], int start, int length)
- throws SAXException
- {
- docFirst.characters (ch, start, length);
- docRest.characters (ch, start, length);
- }
-
- public void ignorableWhitespace (char ch [], int start, int length)
- throws SAXException
- {
- docFirst.ignorableWhitespace (ch, start, length);
- docRest.ignorableWhitespace (ch, start, length);
- }
-
-
- //
- // DTDHandler
- //
- public void notationDecl (String name, String publicId, String systemId)
- throws SAXException
- {
- DTDHandler l1 = first.getDTDHandler ();
- DTDHandler l2 = rest.getDTDHandler ();
-
- l1.notationDecl (name, publicId, systemId);
- l2.notationDecl (name, publicId, systemId);
- }
-
- public void unparsedEntityDecl (String name,
- String publicId, String systemId,
- String notationName
- ) throws SAXException
- {
- DTDHandler l1 = first.getDTDHandler ();
- DTDHandler l2 = rest.getDTDHandler ();
-
- l1.unparsedEntityDecl (name, publicId, systemId, notationName);
- l2.unparsedEntityDecl (name, publicId, systemId, notationName);
- }
-
-
- //
- // DeclHandler
- //
- public void attributeDecl (String eName, String aName,
- String type,
- String mode, String value)
- throws SAXException
- {
- declFirst.attributeDecl (eName, aName, type, mode, value);
- declRest.attributeDecl (eName, aName, type, mode, value);
- }
-
- public void elementDecl (String name, String model)
- throws SAXException
- {
- declFirst.elementDecl (name, model);
- declRest.elementDecl (name, model);
- }
-
- public void externalEntityDecl (String name,
- String publicId, String systemId)
- throws SAXException
- {
- declFirst.externalEntityDecl (name, publicId, systemId);
- declRest.externalEntityDecl (name, publicId, systemId);
- }
-
- public void internalEntityDecl (String name, String value)
- throws SAXException
- {
- declFirst.internalEntityDecl (name, value);
- declRest.internalEntityDecl (name, value);
- }
-
-
- //
- // LexicalHandler
- //
- public void comment (char ch [], int start, int length)
- throws SAXException
- {
- lexFirst.comment (ch, start, length);
- lexRest.comment (ch, start, length);
- }
-
- public void startCDATA ()
- throws SAXException
- {
- lexFirst.startCDATA ();
- lexRest.startCDATA ();
- }
-
- public void endCDATA ()
- throws SAXException
- {
- lexFirst.endCDATA ();
- lexRest.endCDATA ();
- }
-
- public void startEntity (String name)
- throws SAXException
- {
- lexFirst.startEntity (name);
- lexRest.startEntity (name);
- }
-
- public void endEntity (String name)
- throws SAXException
- {
- lexFirst.endEntity (name);
- lexRest.endEntity (name);
- }
-
- public void startDTD (String name, String publicId, String systemId)
- throws SAXException
- {
- lexFirst.startDTD (name, publicId, systemId);
- lexRest.startDTD (name, publicId, systemId);
- }
-
- public void endDTD ()
- throws SAXException
- {
- lexFirst.endDTD ();
- lexRest.endDTD ();
- }
-}
diff --git a/libjava/gnu/xml/pipeline/TextConsumer.java b/libjava/gnu/xml/pipeline/TextConsumer.java
deleted file mode 100644
index 67bd23b00d6..00000000000
--- a/libjava/gnu/xml/pipeline/TextConsumer.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* TextConsumer.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import java.io.*;
-
-import org.xml.sax.*;
-
-import gnu.xml.util.XMLWriter;
-
-
-/**
- * Terminates a pipeline, consuming events to print them as well formed
- * XML (or XHTML) text.
- *
- * <p> Input must be well formed, and must include XML names (e.g. the
- * prefixes and prefix declarations must be present), or the output of
- * this class is undefined.
- *
- * @see NSFilter
- * @see WellFormednessFilter
- *
- * @author David Brownell
- */
-public class TextConsumer extends XMLWriter implements EventConsumer
-{
- /**
- * Constructs an event consumer which echoes its input as text,
- * optionally adhering to some basic XHTML formatting options
- * which increase interoperability with old (v3) browsers.
- *
- * <p> For the best interoperability, when writing as XHTML only
- * ASCII characters are emitted; other characters are turned to
- * entity or character references as needed, and no XML declaration
- * is provided in the document.
- */
- public TextConsumer (Writer w, boolean isXhtml)
- throws IOException
- {
- super (w, isXhtml ? "US-ASCII" : null);
- setXhtml (isXhtml);
- }
-
- /**
- * Constructs a consumer that writes its input as XML text.
- * XHTML rules are not followed.
- */
- public TextConsumer (Writer w)
- throws IOException
- {
- this (w, false);
- }
-
- /**
- * Constructs a consumer that writes its input as XML text,
- * encoded in UTF-8. XHTML rules are not followed.
- */
- public TextConsumer (OutputStream out)
- throws IOException
- {
- this (new OutputStreamWriter (out, "UTF8"), false);
- }
-
- /** <b>EventConsumer</b> Returns the document handler being used. */
- public ContentHandler getContentHandler ()
- { return this; }
-
- /** <b>EventConsumer</b> Returns the dtd handler being used. */
- public DTDHandler getDTDHandler ()
- { return this; }
-
- /** <b>XMLReader</b>Retrieves a property (lexical and decl handlers) */
- public Object getProperty (String propertyId)
- throws SAXNotRecognizedException
- {
- if (EventFilter.LEXICAL_HANDLER.equals (propertyId))
- return this;
- if (EventFilter.DECL_HANDLER.equals (propertyId))
- return this;
- throw new SAXNotRecognizedException (propertyId);
- }
-}
diff --git a/libjava/gnu/xml/pipeline/ValidationConsumer.java b/libjava/gnu/xml/pipeline/ValidationConsumer.java
deleted file mode 100644
index 2510c768cfb..00000000000
--- a/libjava/gnu/xml/pipeline/ValidationConsumer.java
+++ /dev/null
@@ -1,1929 +0,0 @@
-/* ValidationConsumer.java --
- Copyright (C) 1999,2000,2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.EmptyStackException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-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
- * producer of SAX events to: </p> <ol>
- *
- * <li> Conform to the specification of a non-validating XML parser that
- * reads all external entities, reported using SAX2 events. </li>
- *
- * <li> Report ignorable whitespace as such (through the ContentHandler
- * interface). This is, strictly speaking, optional for nonvalidating
- * XML processors. </li>
- *
- * <li> Make SAX2 DeclHandler callbacks, with default
- * attribute values already normalized (and without "&lt;").</li>
- *
- * <li> Make SAX2 LexicalHandler startDTD() and endDTD ()
- * callbacks. </li>
- *
- * <li> Act as if the <em>(URI)/namespace-prefixes</em> property were
- * set to true, by providing XML 1.0 names and all <code>xmlns*</code>
- * attributes (rather than omitting either or both). </li>
- *
- * </ol>
- *
- * <p> At this writing, the major SAX2 parsers (such as &AElig;lfred2,
- * Crimson, and Xerces) meet these requirements, and this validation
- * module is used by the optional &AElig;lfred2 validation support.
- * </p>
- *
- * <p> Note that because this is a layered validator, it has to duplicate some
- * work that the parser is doing; there are also other cost to layering.
- * However, <em>because of layering it doesn't need a parser</em> in order
- * to work! You can use it with anything that generates SAX events, such
- * as an application component that wants to detect invalid content in
- * a changed area without validating an entire document, or which wants to
- * ensure that it doesn't write invalid data to a communications partner.</p>
- *
- * <p> Also, note that because this is a layered validator, the line numbers
- * reported for some errors may seem strange. For example, if an element does
- * not permit character content, the validator
- * will use the locator provided to it.
- * That might reflect the last character of a <em>characters</em> event
- * callback, rather than the first non-whitespace character. </p>
- *
- * <hr />
- *
- * <!--
- * <p> Of interest is the fact that unlike most currently known XML validators,
- * this one can report some cases of non-determinism in element content models.
- * It is a compile-time option, enabled by default. This will only report
- * such XML errors if they relate to content actually appearing in a document;
- * content models aren't aggressively scanned for non-deterministic structure.
- * Documents which trigger such non-deterministic transitions may be handled
- * differently by different validating parsers, without losing conformance
- * to the XML specification. </p>
- * -->
- *
- * <p> Current limitations of the validation performed are in roughly three
- * categories. </p>
- *
- * <p> The first category represents constraints which demand violations
- * of software layering: exposing lexical details, one of the first things
- * that <em>application</em> programming interfaces (APIs) hide. These
- * invariably relate to XML entity handling, and to historical oddities
- * of the XML validation semantics. Curiously,
- * recent (Autumn 1999) conformance testing showed that these constraints are
- * among those handled worst by existing XML validating parsers. Arguments
- * have been made that each of these VCs should be turned into WFCs (most
- * of them) or discarded (popular for the standalone declaration); in short,
- * that these are bugs in the XML specification (not all via SGML): </p><ul>
- *
- * <li> The <em>Proper Declaration/PE Nesting</em> and
- * <em>Proper Group/PE Nesting</em> VCs can't be tested because they
- * require access to particularly low level lexical level information.
- * In essence, the reason XML isn't a simple thing to parse is that
- * it's not a context free grammar, and these constraints elevate that
- * SGML-derived context sensitivity to the level of a semantic rule.
- *
- * <li> The <em>Standalone Document Declaration</em> VC can't be
- * tested. This is for two reasons. First, this flag isn't made
- * available through SAX2. Second, it also requires breaking that
- * lexical layering boundary. (If you ever wondered why classes
- * in compiler construction or language design barely mention the
- * existence of context-sensitive grammars, it's because of messy
- * issues like these.)
- *
- * <li> The <em>Entity Declared</em> VC can't be tested, because it
- * also requires breaking that lexical layering boundary! There's also
- * another issue: the VC wording (and seemingly intent) is ambiguous.
- * (This is still true in the "Second edition" XML spec.)
- * Since there is a WFC of the same name, everyone's life would be
- * easier if references to undeclared parsed entities were always well
- * formedness errors, regardless of whether they're parameter entities
- * or not. (Note that nonvalidating parsers are not required
- * to report all such well formedness errors if they don't read external
- * parameter entities, although currently most XML parsers read them
- * in an attempt to avoid problems from inconsistent parser behavior.)
- *
- * </ul>
- *
- * <p> The second category of limitations on this validation represent
- * constraints associated with information that is not guaranteed to be
- * available (or in one case, <em>is guaranteed not to be available</em>,
- * through the SAX2 API: </p><ul>
- *
- * <li> The <em>Unique Element Type Declaration</em> VC may not be
- * reportable, if the underlying parser happens not to expose
- * multiple declarations. (&AElig;lfred2 reports these validity
- * errors directly.)</li>
- *
- * <li> Similarly, the <em>Unique Notation Name</em> VC, added in the
- * 14-January-2000 XML spec errata to restrict typing models used by
- * elements, may not be reportable. (&AElig;lfred reports these
- * validity errors directly.) </li>
- *
- * </ul>
- *
- * <p> A third category relates to ease of implementation. (Think of this
- * as "bugs".) The most notable issue here is character handling. Rather
- * than attempting to implement the voluminous character tables in the XML
- * specification (Appendix B), Unicode rules are used directly from
- * the java.lang.Character class. Recent JVMs have begun to diverge from
- * the original specification for that class (Unicode 2.0), meaning that
- * different JVMs may handle that aspect of conformance differently.
- * </p>
- *
- * <p> Note that for some of the validity errors that SAX2 does not
- * expose, a nonvalidating parser is permitted (by the XML specification)
- * to report validity errors. When used with a parser that does so for
- * the validity constraints mentioned above (or any other SAX2 event
- * stream producer that does the same thing), overall conformance is
- * substantially improved.
- *
- * @see gnu.xml.aelfred2.SAXDriver
- * @see gnu.xml.aelfred2.XmlReader
- *
- * @author David Brownell
- */
-public final class ValidationConsumer extends EventFilter
-{
- // report error if we happen to notice a non-deterministic choice?
- // we won't report buggy content models; just buggy instances
- private static final boolean warnNonDeterministic = false;
-
- // for tracking active content models
- private String rootName;
- private Stack contentStack = new Stack ();
-
- // flags for "saved DTD" processing
- private boolean disableDeclarations;
- private boolean disableReset;
-
- //
- // most VCs get tested when we see element start tags. the per-element
- // info (including attributes) recorded here duplicates that found inside
- // many nonvalidating parsers, hence dual lookups etc ... that's why a
- // layered validator isn't going to be as fast as a non-layered one.
- //
-
- // key = element name; value = ElementInfo
- private Hashtable elements = new Hashtable ();
-
- // some VCs relate to ID/IDREF/IDREFS attributes
- // key = id; value = boolean true (defd) or false (refd)
- private Hashtable ids = new Hashtable ();
-
- // we just record declared notation and unparsed entity names.
- // the implementation here is simple/slow; these features
- // are seldom used, one hopes they'll wither away soon
- private Vector notations = new Vector (5, 5);
- private Vector nDeferred = new Vector (5, 5);
- private Vector unparsed = new Vector (5, 5);
- private Vector uDeferred = new Vector (5, 5);
-
- // note: DocBk 3.1.7 XML defines over 2 dozen notations,
- // used when defining unparsed entities for graphics
- // (and maybe in other places)
-
-
-
- /**
- * Creates a pipeline terminus which consumes all events passed to
- * it; this will report validity errors as if they were fatal errors,
- * unless an error handler is assigned.
- *
- * @see #setErrorHandler
- */
- // constructor used by PipelineFactory
- // ... and want one taking system ID of an external subset
- public ValidationConsumer ()
- {
- this (null);
- }
-
- /**
- * Creates a pipeline filter which reports validity errors and then
- * passes events on to the next consumer if they were not fatal.
- *
- * @see #setErrorHandler
- */
- // constructor used by PipelineFactory
- // ... and want one taking system ID of an external subset
- // (which won't send declaration events)
- public ValidationConsumer (EventConsumer next)
- {
- super (next);
-
- setContentHandler (this);
- setDTDHandler (this);
- try { setProperty (DECL_HANDLER, this); }
- catch (Exception e) { /* "can't happen" */ }
- try { setProperty (LEXICAL_HANDLER, this); }
- catch (Exception e) { /* "can't happen" */ }
- }
-
-
- private static final String fakeRootName
- = ":Nobody:in:their_Right.Mind_would:use:this-name:1x:";
-
- /**
- * Creates a validation consumer which is preloaded with the DTD provided.
- * It does this by constructing a document with that DTD, then parsing
- * that document and recording its DTD declarations. Then it arranges
- * not to modify that information.
- *
- * <p> The resulting validation consumer will only validate against
- * the specified DTD, regardless of whether some other DTD is found
- * in a document being parsed.
- *
- * @param rootName The name of the required root element; if this is
- * null, any root element name will be accepted.
- * @param publicId If non-null and there is a non-null systemId, this
- * identifier provides an alternate access identifier for the DTD's
- * external subset.
- * @param systemId If non-null, this is a URI (normally URL) that
- * may be used to access the DTD's external subset.
- * @param internalSubset If non-null, holds literal markup declarations
- * comprising the DTD's internal subset.
- * @param resolver If non-null, this will be provided to the parser for
- * use when resolving parameter entities (including any external subset).
- * @param resolver If non-null, this will be provided to the parser for
- * use when resolving parameter entities (including any external subset).
- * @param minimalElement If non-null, a minimal valid document.
- *
- * @exception SAXNotSupportedException If the default SAX parser does
- * not support the standard lexical or declaration handlers.
- * @exception SAXParseException If the specified DTD has either
- * well-formedness or validity errors
- * @exception IOException If the specified DTD can't be read for
- * some reason
- */
- public ValidationConsumer (
- String rootName,
- String publicId,
- String systemId,
- String internalSubset,
- EntityResolver resolver,
- String minimalDocument
- ) throws SAXException, IOException
- {
- this (null);
-
- disableReset = true;
- if (rootName == null)
- rootName = fakeRootName;
-
- //
- // Synthesize document with that DTD; is it possible to do
- // better for the declaration of the root element?
- //
- // NOTE: can't use SAX2 to write internal subsets.
- //
- StringWriter writer = new StringWriter ();
-
- writer.write ("<!DOCTYPE ");
- writer.write (rootName);
- if (systemId != null) {
- writer.write ("\n ");
- if (publicId != null) {
- writer.write ("PUBLIC '");
- writer.write (publicId);
- writer.write ("'\n\t'");
- } else
- writer.write ("SYSTEM '");
- writer.write (systemId);
- writer.write ("'");
- }
- writer.write (" [ ");
- if (rootName == fakeRootName) {
- writer.write ("\n<!ELEMENT ");
- writer.write (rootName);
- writer.write (" EMPTY>");
- }
- if (internalSubset != null)
- writer.write (internalSubset);
- writer.write ("\n ]>");
-
- if (minimalDocument != null) {
- writer.write ("\n");
- writer.write (minimalDocument);
- writer.write ("\n");
- } else {
- writer.write (" <");
- writer.write (rootName);
- writer.write ("/>\n");
- }
- minimalDocument = writer.toString ();
-
- //
- // OK, load it
- //
- XMLReader producer;
-
- producer = XMLReaderFactory.createXMLReader ();
- bind (producer, this);
-
- if (resolver != null)
- producer.setEntityResolver (resolver);
-
- InputSource in;
-
- in = new InputSource (new StringReader (minimalDocument));
- producer.parse (in);
-
- disableDeclarations = true;
- if (rootName == fakeRootName)
- this.rootName = null;
- }
-
- private void resetState ()
- {
- if (!disableReset) {
- rootName = null;
- contentStack.removeAllElements ();
- elements.clear ();
- ids.clear ();
-
- notations.removeAllElements ();
- nDeferred.removeAllElements ();
- unparsed.removeAllElements ();
- uDeferred.removeAllElements ();
- }
- }
-
-
- private void warning (String description)
- throws SAXException
- {
- ErrorHandler errHandler = getErrorHandler ();
- Locator locator = getDocumentLocator ();
- SAXParseException err;
-
- if (errHandler == null)
- return;
-
- if (locator == null)
- err = new SAXParseException (description, null, null, -1, -1);
- else
- err = new SAXParseException (description, locator);
- errHandler.warning (err);
- }
-
- // package private (for ChildrenRecognizer)
- private void error (String description)
- throws SAXException
- {
- ErrorHandler errHandler = getErrorHandler ();
- Locator locator = getDocumentLocator ();
- SAXParseException err;
-
- if (locator == null)
- err = new SAXParseException (description, null, null, -1, -1);
- else
- err = new SAXParseException (description, locator);
- if (errHandler != null)
- errHandler.error (err);
- else // else we always treat it as fatal!
- throw err;
- }
-
- private void fatalError (String description)
- throws SAXException
- {
- ErrorHandler errHandler = getErrorHandler ();
- Locator locator = getDocumentLocator ();
- SAXParseException err;
-
- if (locator != null)
- err = new SAXParseException (description, locator);
- else
- err = new SAXParseException (description, null, null, -1, -1);
- if (errHandler != null)
- errHandler.fatalError (err);
- // we always treat this as fatal, regardless of the handler
- throw err;
- }
-
-
- private static boolean isExtender (char c)
- {
- // [88] Extender ::= ...
- return c == 0x00b7 || c == 0x02d0 || c == 0x02d1 || c == 0x0387
- || c == 0x0640 || c == 0x0e46 || c == 0x0ec6 || c == 0x3005
- || (c >= 0x3031 && c <= 0x3035)
- || (c >= 0x309d && c <= 0x309e)
- || (c >= 0x30fc && c <= 0x30fe);
- }
-
-
- // use augmented Unicode rules, not full XML rules
- private boolean isName (String name, String context, String id)
- throws SAXException
- {
- char buf [] = name.toCharArray ();
- boolean pass = true;
-
- if (!Character.isUnicodeIdentifierStart (buf [0])
- && ":_".indexOf (buf [0]) == -1)
- pass = false;
- else {
- int max = buf.length;
- for (int i = 1; pass && i < max; i++) {
- char c = buf [i];
- if (!Character.isUnicodeIdentifierPart (c)
- && ":-_.".indexOf (c) == -1
- && !isExtender (c))
- pass = false;
- }
- }
-
- if (!pass)
- error ("In " + context + " for " + id
- + ", '" + name + "' is not a name");
- return pass; // true == OK
- }
-
- // use augmented Unicode rules, not full XML rules
- private boolean isNmtoken (String nmtoken, String context, String id)
- throws SAXException
- {
- char buf [] = nmtoken.toCharArray ();
- boolean pass = true;
- int max = buf.length;
-
- // XXX make this share code with isName
-
- for (int i = 0; pass && i < max; i++) {
- char c = buf [i];
- if (!Character.isUnicodeIdentifierPart (c)
- && ":-_.".indexOf (c) == -1
- && !isExtender (c))
- pass = false;
- }
-
- if (!pass)
- error ("In " + context + " for " + id
- + ", '" + nmtoken + "' is not a name token");
- return pass; // true == OK
- }
-
- private void checkEnumeration (String value, String type, String name)
- throws SAXException
- {
- if (!hasMatch (value, type))
- // VC: Enumeration
- error ("Value '" + value
- + "' for attribute '" + name
- + "' is not permitted: " + type);
- }
-
- // used to test enumerated attributes and mixed content models
- // package private
- static boolean hasMatch (String value, String orList)
- {
- int len = value.length ();
- int max = orList.length () - len;
-
- for (int start = 0;
- (start = orList.indexOf (value, start)) != -1;
- start++) {
- char c;
-
- if (start > max)
- break;
- c = orList.charAt (start - 1);
- if (c != '|' && c != '('/*)*/)
- continue;
- c = orList.charAt (start + len);
- if (c != '|' && /*(*/ c != ')')
- continue;
- return true;
- }
- return false;
- }
-
- /**
- * <b>LexicalHandler</b> Records the declaration of the root
- * element, so it can be verified later.
- * Passed to the next consumer, unless this one was
- * preloaded with a particular DTD.
- */
- public void startDTD (String name, String publicId, String systemId)
- throws SAXException
- {
- if (disableDeclarations)
- return;
-
- rootName = name;
- super.startDTD (name, publicId, systemId);
- }
-
- /**
- * <b>LexicalHandler</b> Verifies that all referenced notations
- * and unparsed entities have been declared.
- * Passed to the next consumer, unless this one was
- * preloaded with a particular DTD.
- */
- public void endDTD ()
- throws SAXException
- {
- if (disableDeclarations)
- return;
-
- // this is a convenient hook for end-of-dtd checks, but we
- // could also trigger it in the first startElement call.
- // locator info is more appropriate here though.
-
- // VC: Notation Declared (NDATA can refer to them before decls,
- // as can NOTATION attribute enumerations and defaults)
- int length = nDeferred.size ();
- for (int i = 0; i < length; i++) {
- String notation = (String) nDeferred.elementAt (i);
- if (!notations.contains (notation)) {
- error ("A declaration referred to notation '" + notation
- + "' which was never declared");
- }
- }
- nDeferred.removeAllElements ();
-
- // VC: Entity Name (attribute values can refer to them
- // before they're declared); VC Attribute Default Legal
- length = uDeferred.size ();
- for (int i = 0; i < length; i++) {
- String entity = (String) uDeferred.elementAt (i);
- if (!unparsed.contains (entity)) {
- error ("An attribute default referred to entity '" + entity
- + "' which was never declared");
- }
- }
- uDeferred.removeAllElements ();
- super.endDTD ();
- }
-
-
- // These are interned, so we can rely on "==" to find the type of
- // all attributes except enumerations ...
- // "(this|or|that|...)" and "NOTATION (this|or|that|...)"
- static final String types [] = {
- "CDATA",
- "ID", "IDREF", "IDREFS",
- "NMTOKEN", "NMTOKENS",
- "ENTITY", "ENTITIES"
- };
-
-
- /**
- * <b>DecllHandler</b> Records attribute declaration for later use
- * in validating document content, and checks validity constraints
- * that are applicable to attribute declarations.
- * Passed to the next consumer, unless this one was
- * preloaded with a particular DTD.
- */
- public void attributeDecl (
- String eName,
- String aName,
- String type,
- String mode,
- String value
- ) throws SAXException
- {
- if (disableDeclarations)
- return;
-
- ElementInfo info = (ElementInfo) elements.get (eName);
- AttributeInfo ainfo = new AttributeInfo ();
- boolean checkOne = false;
- boolean interned = false;
-
- // cheap interning of type names and #FIXED, #REQUIRED
- // for faster startElement (we can use "==")
- for (int i = 0; i < types.length; i++) {
- if (types [i].equals (type)) {
- type = types [i];
- interned = true;
- break;
- }
- }
- if ("#FIXED".equals (mode))
- mode = "#FIXED";
- else if ("#REQUIRED".equals (mode))
- mode = "#REQUIRED";
-
- ainfo.type = type;
- ainfo.mode = mode;
- ainfo.value = value;
-
- // we might not have seen the content model yet
- if (info == null) {
- info = new ElementInfo (eName);
- elements.put (eName, info);
- }
- if ("ID" == type) {
- checkOne = true;
- if (!("#REQUIRED" == mode || "#IMPLIED".equals (mode))) {
- // VC: ID Attribute Default
- error ("ID attribute '" + aName
- + "' must be #IMPLIED or #REQUIRED");
- }
-
- } else if (!interned && type.startsWith ("NOTATION ")) {
- checkOne = true;
-
- // VC: Notation Attributes (notations must be declared)
- StringTokenizer tokens = new StringTokenizer (
- type.substring (10, type.lastIndexOf (')')),
- "|");
- while (tokens.hasMoreTokens ()) {
- String token = tokens.nextToken ();
- if (!notations.contains (token))
- nDeferred.addElement (token);
- }
- }
- if (checkOne) {
- for (Enumeration e = info.attributes.keys ();
- e.hasMoreElements ();
- /* NOP */) {
- String name;
- AttributeInfo ainfo2;
-
- name = (String) e.nextElement ();
- ainfo2 = (AttributeInfo) info.attributes.get (name);
- if (type == ainfo2.type || !interned /* NOTATION */) {
- // VC: One ID per Element Type
- // VC: One Notation per Element TYpe
- error ("Element '" + eName
- + "' already has an attribute of type "
- + (interned ? "NOTATION" : type)
- + " ('" + name
- + "') so '" + aName
- + "' is a validity error");
- }
- }
- }
-
- // VC: Attribute Default Legal
- if (value != null) {
-
- if ("CDATA" == type) {
- // event source rejected '<'
-
- } else if ("NMTOKEN" == type) {
- // VC: Name Token (is a nmtoken)
- isNmtoken (value, "attribute default", aName);
-
- } else if ("NMTOKENS" == type) {
- // VC: Name Token (is a nmtoken; at least one value)
- StringTokenizer tokens = new StringTokenizer (value);
- if (!tokens.hasMoreTokens ())
- error ("Default for attribute '" + aName
- + "' must have at least one name token.");
- else do {
- String token = tokens.nextToken ();
- isNmtoken (token, "attribute default", aName);
- } while (tokens.hasMoreTokens ());
-
- } else if ("IDREF" == type || "ENTITY" == type) {
- // VC: Entity Name (is a name)
- // VC: IDREF (is a name) (is declared)
- isName (value, "attribute default", aName);
- if ("ENTITY" == type && !unparsed.contains (value))
- uDeferred.addElement (value);
-
- } else if ("IDREFS" == type || "ENTITIES" == type) {
- // VC: Entity Name (is a name; at least one value)
- // VC: IDREF (is a name; at least one value)
- StringTokenizer names = new StringTokenizer (value);
- if (!names.hasMoreTokens ())
- error ("Default for attribute '" + aName
- + "' must have at least one name.");
- else do {
- String name = names.nextToken ();
- isName (name, "attribute default", aName);
- if ("ENTITIES" == type && !unparsed.contains (name))
- uDeferred.addElement (value);
- } while (names.hasMoreTokens ());
-
- } else if (type.charAt (0) == '(' /*)*/ ) {
- // VC: Enumeration (must match)
- checkEnumeration (value, type, aName);
-
- } else if (!interned && checkOne) { /* NOTATION */
- // VC: Notation attributes (must be names)
- isName (value, "attribute default", aName);
-
- // VC: Notation attributes (must be declared)
- if (!notations.contains (value))
- nDeferred.addElement (value);
-
- // VC: Enumeration (must match)
- checkEnumeration (value, type, aName);
-
- } else if ("ID" != type)
- throw new RuntimeException ("illegal attribute type: " + type);
- }
-
- if (info.attributes.get (aName) == null)
- info.attributes.put (aName, ainfo);
- /*
- else
- warning ("Element '" + eName
- + "' already has an attribute named '" + aName + "'");
- */
-
- if ("xml:space".equals (aName)) {
- if (!("(default|preserve)".equals (type)
- || "(preserve|default)".equals (type)
- // these next two are arguable; XHTML's DTD doesn't
- // deserve errors. After all, it's not like any
- // illegal _value_ could pass ...
- || "(preserve)".equals (type)
- || "(default)".equals (type)
- ))
- error (
- "xml:space attribute type must be like '(default|preserve)'"
- + " not '" + type + "'"
- );
-
- }
- super.attributeDecl (eName, aName, type, mode, value);
- }
-
- /**
- * <b>DecllHandler</b> Records the element declaration for later use
- * when checking document content, and checks validity constraints that
- * apply to element declarations. Passed to the next consumer, unless
- * this one was preloaded with a particular DTD.
- */
- public void elementDecl (String name, String model)
- throws SAXException
- {
- if (disableDeclarations)
- return;
-
- ElementInfo info = (ElementInfo) elements.get (name);
-
- // we might have seen an attribute decl already
- if (info == null) {
- info = new ElementInfo (name);
- elements.put (name, info);
- }
- if (info.model != null) {
- // NOTE: not all parsers can report such duplicates.
- // VC: Unique Element Type Declaration
- error ("Element type '" + name
- + "' was already declared.");
- } else {
- info.model = model;
-
- // VC: No Duplicate Types (in mixed content models)
- if (model.charAt (1) == '#') // (#PCDATA...
- info.getRecognizer (this);
- }
- super.elementDecl (name, model);
- }
-
- /**
- * <b>DecllHandler</b> passed to the next consumer, unless this
- * one was preloaded with a particular DTD
- */
- public void internalEntityDecl (String name, String value)
- throws SAXException
- {
- if (!disableDeclarations)
- super.internalEntityDecl (name, value);
- }
-
- /**
- * <b>DecllHandler</b> passed to the next consumer, unless this
- * one was preloaded with a particular DTD
- */
- public void externalEntityDecl (String name,
- String publicId, String systemId)
- throws SAXException
- {
- if (!disableDeclarations)
- super.externalEntityDecl (name, publicId, systemId);
- }
-
-
- /**
- * <b>DTDHandler</b> Records the notation name, for checking
- * NOTATIONS attribute values and declararations of unparsed
- * entities. Passed to the next consumer, unless this one was
- * preloaded with a particular DTD.
- */
- public void notationDecl (String name, String publicId, String systemId)
- throws SAXException
- {
- if (disableDeclarations)
- return;
-
- notations.addElement (name);
- super.notationDecl (name, publicId, systemId);
- }
-
- /**
- * <b>DTDHandler</b> Records the entity name, for checking
- * ENTITY and ENTITIES attribute values; records the notation
- * name if it hasn't yet been declared. Passed to the next consumer,
- * unless this one was preloaded with a particular DTD.
- */
- public void unparsedEntityDecl (
- String name,
- String publicId,
- String systemId,
- String notationName
- ) throws SAXException
- {
- if (disableDeclarations)
- return;
-
- unparsed.addElement (name);
- if (!notations.contains (notationName))
- nDeferred.addElement (notationName);
- super.unparsedEntityDecl (name, publicId, systemId, notationName);
- }
-
-
- /**
- * <b>ContentHandler</b> Ensures that state from any previous parse
- * has been deleted.
- * Passed to the next consumer.
- */
- public void startDocument ()
- throws SAXException
- {
- resetState ();
- super.startDocument ();
- }
-
-
- private static boolean isAsciiLetter (char c)
- {
- return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
- }
-
-
- /**
- * <b>ContentHandler</b> Reports a fatal exception. Validating
- * XML processors may not skip any entities.
- */
- public void skippedEntity (String name)
- throws SAXException
- {
- fatalError ("may not skip entities");
- }
-
- /*
- * SAX2 doesn't expand non-PE refs in attribute defaults...
- */
- private String expandDefaultRefs (String s)
- throws SAXException
- {
- if (s.indexOf ('&') < 0)
- return s;
-
-// FIXME: handle &#nn; &#xnn; &name;
- String message = "Can't expand refs in attribute default: " + s;
- warning (message);
-
- return s;
- }
-
- /**
- * <b>ContentHandler</b> Performs validity checks against element
- * (and document) content models, and attribute values.
- * Passed to the next consumer.
- */
- public void startElement (
- String uri,
- String localName,
- String qName,
- Attributes atts
- ) throws SAXException
- {
- //
- // First check content model for the enclosing scope.
- //
- if (contentStack.isEmpty ()) {
- // VC: Root Element Type
- if (!qName.equals (rootName)) {
- if (rootName == null)
- warning ("This document has no DTD, can't be valid");
- else
- error ("Root element type '" + qName
- + "' was declared to be '" + rootName + "'");
- }
- } else {
- Recognizer state = (Recognizer) contentStack.peek ();
-
- if (state != null) {
- Recognizer newstate = state.acceptElement (qName);
-
- if (newstate == null)
- error ("Element type '" + qName
- + "' in element '" + state.type.name
- + "' violates content model " + state.type.model
- );
- if (newstate != state) {
- contentStack.pop ();
- contentStack.push (newstate);
- }
- }
- }
-
- //
- // Then check that this element was declared, and push the
- // object used to validate its content model onto our stack.
- //
- // This is where the recognizer gets created, if needed; if
- // it's a "children" (elements) content model, an NDFA is
- // created. (One recognizer is used per content type, no
- // matter how complex that recognizer is.)
- //
- ElementInfo info;
-
- info = (ElementInfo) elements.get (qName);
- if (info == null || info.model == null) {
- // VC: Element Valid (base clause)
- error ("Element type '" + qName + "' was not declared");
- contentStack.push (null);
-
- // for less diagnostic noise, fake a declaration.
- elementDecl (qName, "ANY");
- } else
- contentStack.push (info.getRecognizer (this));
-
- //
- // Then check each attribute present
- //
- int len;
- String aname;
- AttributeInfo ainfo;
-
- if (atts != null)
- len = atts.getLength ();
- else
- len = 0;
-
- for (int i = 0; i < len; i++) {
- aname = atts.getQName (i);
-
- if (info == null
- || (ainfo = (AttributeInfo) info.attributes.get (aname))
- == null) {
- // VC: Attribute Value Type
- error ("Attribute '" + aname
- + "' was not declared for element type " + qName);
- continue;
- }
-
- String value = atts.getValue (i);
-
- // note that "==" for type names and "#FIXED" is correct
- // (and fast) since we've interned those literals.
-
- if ("#FIXED" == ainfo.mode) {
- String expanded = expandDefaultRefs (ainfo.value);
-
- // VC: Fixed Attribute Default
- if (!value.equals (expanded)) {
- error ("Attribute '" + aname
- + "' must match " + expanded
- );
- continue;
- }
- }
-
- if ("CDATA" == ainfo.type)
- continue;
-
- //
- // For all other attribute types, there are various
- // rules to follow.
- //
-
- if ("ID" == ainfo.type) {
- // VC: ID (must be a name)
- if (isName (value, "ID attribute", aname)) {
- if (Boolean.TRUE == ids.get (value))
- // VC: ID (appears once)
- error ("ID attribute " + aname
- + " uses an ID value '" + value
- + "' which was already declared.");
- else
- // any forward refs are no longer problems
- ids.put (value, Boolean.TRUE);
- }
- continue;
- }
-
- if ("IDREF" == ainfo.type) {
- // VC: IDREF (value must be a name)
- if (isName (value, "IDREF attribute", aname)) {
- // VC: IDREF (must match some ID attribute)
- if (ids.get (value) == null)
- // new -- assume it's a forward ref
- ids.put (value, Boolean.FALSE);
- }
- continue;
- }
-
- if ("IDREFS" == ainfo.type) {
- StringTokenizer tokens = new StringTokenizer (value, " ");
-
- if (!tokens.hasMoreTokens ()) {
- // VC: IDREF (one or more values)
- error ("IDREFS attribute " + aname
- + " must have at least one ID ref");
- } else do {
- String id = tokens.nextToken ();
-
- // VC: IDREF (value must be a name)
- if (isName (id, "IDREFS attribute", aname)) {
- // VC: IDREF (must match some ID attribute)
- if (ids.get (id) == null)
- // new -- assume it's a forward ref
- ids.put (id, Boolean.FALSE);
- }
- } while (tokens.hasMoreTokens ());
- continue;
- }
-
- if ("NMTOKEN" == ainfo.type) {
- // VC: Name Token (is a name token)
- isNmtoken (value, "NMTOKEN attribute", aname);
- continue;
- }
-
- if ("NMTOKENS" == ainfo.type) {
- StringTokenizer tokens = new StringTokenizer (value, " ");
-
- if (!tokens.hasMoreTokens ()) {
- // VC: Name Token (one or more values)
- error ("NMTOKENS attribute " + aname
- + " must have at least one name token");
- } else do {
- String token = tokens.nextToken ();
-
- // VC: Name Token (is a name token)
- isNmtoken (token, "NMTOKENS attribute", aname);
- } while (tokens.hasMoreTokens ());
- continue;
- }
-
- if ("ENTITY" == ainfo.type) {
- if (!unparsed.contains (value))
- // VC: Entity Name
- error ("Value of attribute '" + aname
- + "' refers to unparsed entity '" + value
- + "' which was not declared.");
- continue;
- }
-
- if ("ENTITIES" == ainfo.type) {
- StringTokenizer tokens = new StringTokenizer (value, " ");
-
- if (!tokens.hasMoreTokens ()) {
- // VC: Entity Name (one or more values)
- error ("ENTITIES attribute " + aname
- + " must have at least one name token");
- } else do {
- String entity = tokens.nextToken ();
-
- if (!unparsed.contains (entity))
- // VC: Entity Name
- error ("Value of attribute '" + aname
- + "' refers to unparsed entity '" + entity
- + "' which was not declared.");
- } while (tokens.hasMoreTokens ());
- continue;
- }
-
- //
- // check for enumerations last; more expensive
- //
- if (ainfo.type.charAt (0) == '(' /*)*/
- || ainfo.type.startsWith ("NOTATION ")
- ) {
- // VC: Enumeration (value must be defined)
- checkEnumeration (value, ainfo.type, aname);
- continue;
- }
- }
-
- //
- // Last, check that all #REQUIRED attributes were provided
- //
- if (info != null) {
- Hashtable table = info.attributes;
-
- if (table.size () != 0) {
- Enumeration e = table.keys ();
-
- // XXX table.keys uses the heap, bleech -- slows things
-
- while (e.hasMoreElements ()) {
- aname = (String) e.nextElement ();
- ainfo = (AttributeInfo) table.get (aname);
-
- // "#REQUIRED" mode was interned in attributeDecl
- if ("#REQUIRED" == ainfo.mode
- && atts.getValue (aname) == null) {
- // VC: Required Attribute
- error ("Attribute '" + aname + "' must be specified "
- + "for element type " + qName);
- }
- }
- }
- }
- super.startElement (uri, localName, qName, atts);
- }
-
- /**
- * <b>ContentHandler</b> Reports a validity error if the element's content
- * model does not permit character data.
- * Passed to the next consumer.
- */
- public void characters (char ch [], int start, int length)
- throws SAXException
- {
- Recognizer state;
-
- if (contentStack.empty ())
- state = null;
- else
- state = (Recognizer) contentStack.peek ();
-
- // NOTE: if this ever supports with SAX parsers that don't
- // report ignorable whitespace as such (only XP?), this class
- // needs to morph it into ignorableWhitespace() as needed ...
-
- if (state != null && !state.acceptCharacters ())
- // VC: Element Valid (clauses three, four -- see recognizer)
- error ("Character content not allowed in element "
- + state.type.name);
-
- super.characters (ch, start, length);
- }
-
-
- /**
- * <b>ContentHandler</b> Reports a validity error if the element's content
- * model does not permit end-of-element yet, or a well formedness error
- * if there was no matching startElement call.
- * Passed to the next consumer.
- */
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- try {
- Recognizer state = (Recognizer) contentStack.pop ();
-
- if (state != null && !state.completed ())
- // VC: Element valid (clauses two, three, four; see Recognizer)
- error ("Premature end for element '"
- + state.type.name
- + "', content model "
- + state.type.model);
-
- // could insist on match of start element, but that's
- // something the input stream must to guarantee.
-
- } catch (EmptyStackException e) {
- fatalError ("endElement without startElement: " + qName
- + ((uri == null)
- ? ""
- : ( " { '" + uri + "', " + localName + " }")));
- }
- super.endElement (uri, localName, qName);
- }
-
- /**
- * <b>ContentHandler</b> Checks whether all ID values that were
- * referenced have been declared, and releases all resources.
- * Passed to the next consumer.
- *
- * @see #setDocumentLocator
- */
- public void endDocument ()
- throws SAXException
- {
- for (Enumeration idNames = ids.keys ();
- idNames.hasMoreElements ();
- /* NOP */) {
- String id = (String) idNames.nextElement ();
-
- if (Boolean.FALSE == ids.get (id)) {
- // VC: IDREF (must match ID)
- error ("Undeclared ID value '" + id
- + "' was referred to by an IDREF/IDREFS attribute");
- }
- }
-
- resetState ();
- super.endDocument ();
- }
-
-
- /** Holds per-element declarations */
- static private final class ElementInfo
- {
- String name;
- String model;
-
- // key = attribute name; value = AttributeInfo
- Hashtable attributes = new Hashtable (11);
-
- ElementInfo (String n) { name = n; }
-
- private Recognizer recognizer;
-
- // for validating content models: one per type, shared,
- // and constructed only on demand ... so unused elements do
- // not need to consume resources.
- Recognizer getRecognizer (ValidationConsumer consumer)
- throws SAXException
- {
- if (recognizer == null) {
- if ("ANY".equals (model))
- recognizer = ANY;
- else if ("EMPTY".equals (model))
- recognizer = new EmptyRecognizer (this);
- else if ('#' == model.charAt (1))
- // n.b. this constructor does a validity check
- recognizer = new MixedRecognizer (this, consumer);
- else
- recognizer = new ChildrenRecognizer (this, consumer);
- }
- return recognizer;
- }
- }
-
- /** Holds per-attribute declarations */
- static private final class AttributeInfo
- {
- String type;
- String mode; // #REQUIRED, etc (or null)
- String value; // or null
- }
-
-
- //
- // Content model validation
- //
-
- // GCJ LOCAL: package private to work around gcj bug.
- static final Recognizer ANY = new Recognizer (null);
-
-
- // Base class defines the calls used to validate content,
- // and supports the "ANY" content model
- static private class Recognizer
- {
- final ElementInfo type;
-
- Recognizer (ElementInfo t) { type = t; }
-
- // return true iff character data is legal here
- boolean acceptCharacters ()
- throws SAXException
- // VC: Element Valid (third and fourth clauses)
- { return true; }
-
- // null return = failure
- // otherwise, next state (like an FSM)
- // prerequisite: tested that name was declared
- Recognizer acceptElement (String name)
- throws SAXException
- // VC: Element Valid (fourth clause)
- { return this; }
-
- // return true iff model is completed, can finish
- boolean completed ()
- throws SAXException
- // VC: Element Valid (fourth clause)
- { return true; }
-
- public String toString ()
- // n.b. "children" is the interesting case!
- { return (type == null) ? "ANY" : type.model; }
- }
-
- // "EMPTY" content model -- no characters or elements
- private static final class EmptyRecognizer extends Recognizer
- {
- public EmptyRecognizer (ElementInfo type)
- { super (type); }
-
- // VC: Element Valid (first clause)
- boolean acceptCharacters ()
- { return false; }
-
- // VC: Element Valid (first clause)
- Recognizer acceptElement (String name)
- { return null; }
- }
-
- // "Mixed" content model -- ANY, but restricts elements
- private static final class MixedRecognizer extends Recognizer
- {
- private String permitted [];
-
- // N.B. constructor tests for duplicated element names (VC)
- public MixedRecognizer (ElementInfo t, ValidationConsumer v)
- throws SAXException
- {
- super (t);
-
- // (#PCDATA...)* or (#PCDATA) ==> ... or empty
- // with the "..." being "|elname|..."
- StringTokenizer tokens = new StringTokenizer (
- t.model.substring (8, t.model.lastIndexOf (')')),
- "|");
- Vector vec = new Vector ();
-
- while (tokens.hasMoreTokens ()) {
- String token = tokens.nextToken ();
-
- if (vec.contains (token))
- v.error ("element " + token
- + " is repeated in mixed content model: "
- + t.model);
- else
- vec.addElement (token.intern ());
- }
- permitted = new String [vec.size ()];
- for (int i = 0; i < permitted.length; i++)
- permitted [i] = (String) vec.elementAt (i);
-
- // in one large machine-derived DTD sample, most of about
- // 250 mixed content models were empty, and 25 had ten or
- // more entries. 2 had over a hundred elements. Linear
- // search isn't obviously wrong.
- }
-
- // VC: Element Valid (third clause)
- Recognizer acceptElement (String name)
- {
- int length = permitted.length;
-
- // first pass -- optimistic w.r.t. event source interning
- // (and document validity)
- for (int i = 0; i < length; i++)
- if (permitted [i] == name)
- return this;
- // second pass -- pessimistic w.r.t. event source interning
- for (int i = 0; i < length; i++)
- if (permitted [i].equals (name))
- return this;
- return null;
- }
- }
-
-
- // recognizer loop flags, see later
- private static final int F_LOOPHEAD = 0x01;
- private static final int F_LOOPNEXT = 0x02;
-
- // for debugging -- used to label/count nodes in toString()
- private static int nodeCount;
-
- /**
- * "Children" content model -- these are nodes in NDFA state graphs.
- * They work in fixed space. Note that these graphs commonly have
- * cycles, handling features such as zero-or-more and one-or-more.
- *
- * <p>It's readonly, so only one copy is ever needed. The content model
- * stack may have any number of pointers into each graph, when a model
- * happens to be needed more than once due to element nesting. Since
- * traversing the graph just moves to another node, and never changes
- * it, traversals never interfere with each other.
- *
- * <p>There is an option to report non-deterministic models. These are
- * always XML errors, but ones which are not often reported despite the
- * fact that they can lead to different validating parsers giving
- * different results for the same input. (The XML spec doesn't require
- * them to be reported.)
- *
- * <p><b>FIXME</b> There's currently at least one known bug here, in that
- * it's not actually detecting the non-determinism it tries to detect.
- * (Of the "optional.xml" test, the once-or-twice-2* tests are all non-D;
- * maybe some others.) This may relate to the issue flagged below as
- * "should not" happen (but it was), which showed up when patching the
- * graph to have one exit node (or more EMPTY nodes).
- */
- private static final class ChildrenRecognizer extends Recognizer
- implements Cloneable
- {
- // for reporting non-deterministic content models
- // ... a waste of space if we're not reporting those!
- // ... along with the 'model' member (in base class)
- private ValidationConsumer consumer;
-
- // for CHOICE nodes -- each component is an arc that
- // accepts a different NAME (or is EMPTY indicating
- // NDFA termination).
- private Recognizer components [];
-
- // for NAME/SEQUENCE nodes -- accepts that NAME and
- // then goes to the next node (CHOICE, NAME, EMPTY).
- private String name;
- private Recognizer next;
-
- // loops always point back to a CHOICE node. we mark such choice
- // nodes (F_LOOPHEAD) for diagnostics and faster deep cloning.
- // We also mark nodes before back pointers (F_LOOPNEXT), to ensure
- // termination when we patch sequences and loops.
- private int flags;
-
-
- // prevent a needless indirection between 'this' and 'node'
- private void copyIn (ChildrenRecognizer node)
- {
- // model & consumer are already set
- components = node.components;
- name = node.name;
- next = node.next;
- flags = node.flags;
- }
-
- // used to construct top level "children" content models,
- public ChildrenRecognizer (ElementInfo type, ValidationConsumer vc)
- {
- this (vc, type);
- populate (type.model.toCharArray (), 0);
- patchNext (new EmptyRecognizer (type), null);
- }
-
- // used internally; populating is separate
- private ChildrenRecognizer (ValidationConsumer vc, ElementInfo type)
- {
- super (type);
- consumer = vc;
- }
-
-
- //
- // When rewriting some graph nodes we need deep clones in one case;
- // mostly shallow clones (what the JVM handles for us) are fine.
- //
- private ChildrenRecognizer shallowClone ()
- {
- try {
- return (ChildrenRecognizer) clone ();
- } catch (CloneNotSupportedException e) {
- throw new Error ("clone");
- }
- }
-
- private ChildrenRecognizer deepClone ()
- {
- return deepClone (new Hashtable (37));
- }
-
- private ChildrenRecognizer deepClone (Hashtable table)
- {
- ChildrenRecognizer retval;
-
- if ((flags & F_LOOPHEAD) != 0) {
- retval = (ChildrenRecognizer) table.get (this);
- if (retval != null)
- return this;
-
- retval = shallowClone ();
- table.put (this, retval);
- } else
- retval = shallowClone ();
-
- if (next != null) {
- if (next instanceof ChildrenRecognizer)
- retval.next = ((ChildrenRecognizer)next)
- .deepClone (table);
- else if (!(next instanceof EmptyRecognizer))
- throw new RuntimeException ("deepClone");
- }
-
- if (components != null) {
- retval.components = new Recognizer [components.length];
- for (int i = 0; i < components.length; i++) {
- Recognizer temp = components [i];
-
- if (temp == null)
- retval.components [i] = null;
- else if (temp instanceof ChildrenRecognizer)
- retval.components [i] = ((ChildrenRecognizer)temp)
- .deepClone (table);
- else if (!(temp instanceof EmptyRecognizer))
- throw new RuntimeException ("deepClone");
- }
- }
-
- return retval;
- }
-
- // connect subgraphs, first to next (sequencing)
- private void patchNext (Recognizer theNext, Hashtable table)
- {
- // backpointers must not be repatched or followed
- if ((flags & F_LOOPNEXT) != 0)
- return;
-
- // XXX this table "shouldn't" be needed, right?
- // but some choice nodes looped if it isn't there.
- if (table != null && table.get (this) != null)
- return;
- if (table == null)
- table = new Hashtable ();
-
- // NAME/SEQUENCE
- if (name != null) {
- if (next == null)
- next = theNext;
- else if (next instanceof ChildrenRecognizer) {
- ((ChildrenRecognizer)next).patchNext (theNext, table);
- } else if (!(next instanceof EmptyRecognizer))
- throw new RuntimeException ("patchNext");
- return;
- }
-
- // CHOICE
- for (int i = 0; i < components.length; i++) {
- if (components [i] == null)
- components [i] = theNext;
- else if (components [i] instanceof ChildrenRecognizer) {
- ((ChildrenRecognizer)components [i])
- .patchNext (theNext, table);
- } else if (!(components [i] instanceof EmptyRecognizer))
- throw new RuntimeException ("patchNext");
- }
-
- if (table != null && (flags | F_LOOPHEAD) != 0)
- table.put (this, this);
- }
-
- /**
- * Parses a 'children' spec (or recursively 'cp') and makes this
- * become a regular graph node.
- *
- * @return index after this particle
- */
- private int populate (char parseBuf [], int startPos)
- {
- int nextPos = startPos + 1;
- char c;
-
- if (nextPos < 0 || nextPos >= parseBuf.length)
- throw new IndexOutOfBoundsException ();
-
- // Grammar of the string is from the XML spec, but
- // with whitespace removed by the SAX parser.
-
- // children ::= (choice | seq) ('?' | '*' | '+')?
- // cp ::= (Name | choice | seq) ('?' | '*' | '+')?
- // choice ::= '(' cp ('|' choice)* ')'
- // seq ::= '(' cp (',' choice)* ')'
-
- // interior nodes only
- // cp ::= name ...
- if (parseBuf [startPos] != '('/*)*/) {
- boolean done = false;
- do {
- switch (c = parseBuf [nextPos]) {
- case '?': case '*': case '+':
- case '|': case ',':
- case /*(*/ ')':
- done = true;
- continue;
- default:
- nextPos++;
- continue;
- }
- } while (!done);
- name = new String (parseBuf, startPos, nextPos - startPos);
-
- // interior OR toplevel nodes
- // cp ::= choice ..
- // cp ::= seq ..
- } else {
- // collect everything as a separate list, and merge it
- // into "this" later if we can (SEQUENCE or singleton)
- ChildrenRecognizer first;
-
- first = new ChildrenRecognizer (consumer, type);
- nextPos = first.populate (parseBuf, nextPos);
- c = parseBuf [nextPos++];
-
- if (c == ',' || c == '|') {
- ChildrenRecognizer current = first;
- char separator = c;
- Vector v = null;
-
- if (separator == '|') {
- v = new Vector ();
- v.addElement (first);
- }
-
- do {
- ChildrenRecognizer link;
-
- link = new ChildrenRecognizer (consumer, type);
- nextPos = link.populate (parseBuf, nextPos);
-
- if (separator == ',') {
- current.patchNext (link, null);
- current = link;
- } else
- v.addElement (link);
-
- c = parseBuf [nextPos++];
- } while (c == separator);
-
- // choice ... collect everything into one array.
- if (separator == '|') {
- // assert v.size() > 1
- components = new Recognizer [v.size ()];
- for (int i = 0; i < components.length; i++) {
- components [i] = (Recognizer)
- v.elementAt (i);
- }
- // assert flags == 0
-
- // sequence ... merge into "this" to be smaller.
- } else
- copyIn (first);
-
- // treat singletons like one-node sequences.
- } else
- copyIn (first);
-
- if (c != /*(*/ ')')
- throw new RuntimeException ("corrupt content model");
- }
-
- //
- // Arity is optional, and the root of all fun. We keep the
- // FSM state graph simple by only having NAME/SEQUENCE and
- // CHOICE nodes (or EMPTY to terminate a model), easily
- // evaluated. So we rewrite each node that has arity, using
- // those primitives. We create loops here, if needed.
- //
- if (nextPos < parseBuf.length) {
- c = parseBuf [nextPos];
- if (c == '?' || c == '*' || c == '+') {
- nextPos++;
-
- // Rewrite 'zero-or-one' "?" arity to a CHOICE:
- // - SEQUENCE (clone, what's next)
- // - or, what's next
- // Size cost: N --> N + 1
- if (c == '?') {
- Recognizer once = shallowClone ();
-
- components = new Recognizer [2];
- components [0] = once;
- // components [1] initted to null
- name = null;
- next = null;
- flags = 0;
-
-
- // Rewrite 'zero-or-more' "*" arity to a CHOICE.
- // - LOOP (clone, back to this CHOICE)
- // - or, what's next
- // Size cost: N --> N + 1
- } else if (c == '*') {
- ChildrenRecognizer loop = shallowClone ();
-
- loop.patchNext (this, null);
- loop.flags |= F_LOOPNEXT;
- flags = F_LOOPHEAD;
-
- components = new Recognizer [2];
- components [0] = loop;
- // components [1] initted to null
- name = null;
- next = null;
-
-
- // Rewrite 'one-or-more' "+" arity to a SEQUENCE.
- // Basically (a)+ --> ((a),(a)*).
- // - this
- // - CHOICE
- // * LOOP (clone, back to the CHOICE)
- // * or, whatever's next
- // Size cost: N --> 2N + 1
- } else if (c == '+') {
- ChildrenRecognizer loop = deepClone ();
- ChildrenRecognizer choice;
-
- choice = new ChildrenRecognizer (consumer, type);
- loop.patchNext (choice, null);
- loop.flags |= F_LOOPNEXT;
- choice.flags = F_LOOPHEAD;
-
- choice.components = new Recognizer [2];
- choice.components [0] = loop;
- // choice.components [1] initted to null
- // choice.name, choice.next initted to null
-
- patchNext (choice, null);
- }
- }
- }
-
- return nextPos;
- }
-
- // VC: Element Valid (second clause)
- boolean acceptCharacters ()
- { return false; }
-
- // VC: Element Valid (second clause)
- Recognizer acceptElement (String type)
- throws SAXException
- {
- // NAME/SEQUENCE
- if (name != null) {
- if (name.equals (type))
- return next;
- return null;
- }
-
- // CHOICE ... optionally reporting nondeterminism we
- // run across. we won't check out every transition
- // for nondeterminism; only the ones we follow.
- Recognizer retval = null;
-
- for (int i = 0; i < components.length; i++) {
- Recognizer temp = components [i].acceptElement (type);
-
- if (temp == null)
- continue;
- else if (!warnNonDeterministic)
- return temp;
- else if (retval == null)
- retval = temp;
- else if (retval != temp)
- consumer.error ("Content model " + this.type.model
- + " is non-deterministic for " + type);
- }
- return retval;
- }
-
- // VC: Element Valid (second clause)
- boolean completed ()
- throws SAXException
- {
- // expecting a specific element
- if (name != null)
- return false;
-
- // choice, some sequences
- for (int i = 0; i < components.length; i++) {
- if (components [i].completed ())
- return true;
- }
-
- return false;
- }
-
-/** /
- // FOR DEBUGGING ... flattens the graph for printing.
-
- public String toString ()
- {
- StringBuffer buf = new StringBuffer ();
-
- // only one set of loop labels can be generated
- // at a time...
- synchronized (ANY) {
- nodeCount = 0;
-
- toString (buf, new Hashtable ());
- return buf.toString ();
- }
- }
-
- private void toString (StringBuffer buf, Hashtable table)
- {
- // When we visit a node, label and count it.
- // Nodes are never visited/counted more than once.
- // For small models labels waste space, but if arity
- // mappings were used the savings are substantial.
- // (Plus, the output can be more readily understood.)
- String temp = (String) table.get (this);
-
- if (temp != null) {
- buf.append ('{');
- buf.append (temp);
- buf.append ('}');
- return;
- } else {
- StringBuffer scratch = new StringBuffer (15);
-
- if ((flags & F_LOOPHEAD) != 0)
- scratch.append ("loop");
- else
- scratch.append ("node");
- scratch.append ('-');
- scratch.append (++nodeCount);
- temp = scratch.toString ();
-
- table.put (this, temp);
- buf.append ('[');
- buf.append (temp);
- buf.append (']');
- buf.append (':');
- }
-
- // NAME/SEQUENCE
- if (name != null) {
- // n.b. some output encodings turn some name chars into '?'
- // e.g. with Japanese names and ASCII output
- buf.append (name);
- if (components != null) // bug!
- buf.append ('$');
- if (next == null)
- buf.append (",*");
- else if (next instanceof EmptyRecognizer) // patch-to-next
- buf.append (",{}");
- else if (next instanceof ChildrenRecognizer) {
- buf.append (',');
- ((ChildrenRecognizer)next).toString (buf, table);
- } else // bug!
- buf.append (",+");
- return;
- }
-
- // CHOICE
- buf.append ("<");
- for (int i = 0; i < components.length; i++) {
- if (i != 0)
- buf.append ("|");
- if (components [i] instanceof EmptyRecognizer) {
- buf.append ("{}");
- } else if (components [i] == null) { // patch-to-next
- buf.append ('*');
- } else {
- ChildrenRecognizer r;
-
- r = (ChildrenRecognizer) components [i];
- r.toString (buf, table);
- }
- }
- buf.append (">");
- }
-/**/
- }
-}
diff --git a/libjava/gnu/xml/pipeline/WellFormednessFilter.java b/libjava/gnu/xml/pipeline/WellFormednessFilter.java
deleted file mode 100644
index ef430165203..00000000000
--- a/libjava/gnu/xml/pipeline/WellFormednessFilter.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/* WellFormednessFilter.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import java.util.EmptyStackException;
-import java.util.Stack;
-
-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
- * are not well formed. The rules currently tested include: <ul>
- *
- * <li>setDocumentLocator ... may be called only before startDocument
- *
- * <li>startDocument/endDocument ... must be paired, and all other
- * calls (except setDocumentLocator) must be nested within these.
- *
- * <li>startElement/endElement ... must be correctly paired, and
- * may never appear within CDATA sections.
- *
- * <li>comment ... can't contain "--"
- *
- * <li>character data ... can't contain "]]&gt;"
- *
- * <li>whitespace ... can't contain CR
- *
- * <li>whitespace and character data must be within an element
- *
- * <li>processing instruction ... can't contain "?&gt;" or CR
- *
- * <li>startCDATA/endCDATA ... must be correctly paired.
- *
- * </ul>
- *
- * <p> Other checks for event stream correctness may be provided in
- * the future. For example, insisting that
- * entity boundaries nest correctly,
- * namespace scopes nest correctly,
- * namespace values never contain relative URIs,
- * attributes don't have "&lt;" characters;
- * and more.
- *
- * @author David Brownell
- */
-public final class WellFormednessFilter extends EventFilter
-{
- private boolean startedDoc;
- private Stack elementStack = new Stack ();
- private boolean startedCDATA;
- private String dtdState = "before";
-
-
- /**
- * Swallows all events after performing well formedness checks.
- */
- // constructor used by PipelineFactory
- public WellFormednessFilter ()
- { this (null); }
-
-
- /**
- * Passes events through to the specified consumer, after first
- * processing them.
- */
- // constructor used by PipelineFactory
- public WellFormednessFilter (EventConsumer consumer)
- {
- super (consumer);
-
- setContentHandler (this);
- setDTDHandler (this);
-
- try {
- setProperty (LEXICAL_HANDLER, this);
- } catch (SAXException e) { /* can't happen */ }
- }
-
- /**
- * Resets state as if any preceding event stream was well formed.
- * Particularly useful if it ended through some sort of error,
- * and the endDocument call wasn't made.
- */
- public void reset ()
- {
- startedDoc = false;
- startedCDATA = false;
- elementStack.removeAllElements ();
- }
-
-
- private SAXParseException getException (String message)
- {
- SAXParseException e;
- Locator locator = getDocumentLocator ();
-
- if (locator == null)
- return new SAXParseException (message, null, null, -1, -1);
- else
- return new SAXParseException (message, locator);
- }
-
- private void fatalError (String message)
- throws SAXException
- {
- SAXParseException e = getException (message);
- ErrorHandler handler = getErrorHandler ();
-
- if (handler != null)
- handler.fatalError (e);
- throw e;
- }
-
- /**
- * Throws an exception when called after startDocument.
- *
- * @param locator the locator, to be used in error reporting or relative
- * URI resolution.
- *
- * @exception IllegalStateException when called after the document
- * has already been started
- */
- public void setDocumentLocator (Locator locator)
- {
- if (startedDoc)
- throw new IllegalStateException (
- "setDocumentLocator called after startDocument");
- super.setDocumentLocator (locator);
- }
-
- public void startDocument () throws SAXException
- {
- if (startedDoc)
- fatalError ("startDocument called more than once");
- startedDoc = true;
- startedCDATA = false;
- elementStack.removeAllElements ();
- super.startDocument ();
- }
-
- public void startElement (
- String uri, String localName,
- String qName, Attributes atts
- ) throws SAXException
- {
- if (!startedDoc)
- fatalError ("callback outside of document?");
- if ("inside".equals (dtdState))
- fatalError ("element inside DTD?");
- else
- dtdState = "after";
- if (startedCDATA)
- fatalError ("element inside CDATA section");
- if (qName == null || "".equals (qName))
- fatalError ("startElement name missing");
- elementStack.push (qName);
- super.startElement (uri, localName, qName, atts);
- }
-
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- if (!startedDoc)
- fatalError ("callback outside of document?");
- if (startedCDATA)
- fatalError ("element inside CDATA section");
- if (qName == null || "".equals (qName))
- fatalError ("endElement name missing");
-
- try {
- String top = (String) elementStack.pop ();
-
- if (!qName.equals (top))
- fatalError ("<" + top + " ...>...</" + qName + ">");
- // XXX could record/test namespace info
- } catch (EmptyStackException e) {
- fatalError ("endElement without startElement: </" + qName + ">");
- }
- super.endElement (uri, localName, qName);
- }
-
- public void endDocument () throws SAXException
- {
- if (!startedDoc)
- fatalError ("callback outside of document?");
- dtdState = "before";
- startedDoc = false;
- super.endDocument ();
- }
-
-
- public void startDTD (String root, String publicId, String systemId)
- throws SAXException
- {
- if (!startedDoc)
- fatalError ("callback outside of document?");
- if ("before" != dtdState)
- fatalError ("two DTDs?");
- if (!elementStack.empty ())
- fatalError ("DTD must precede root element");
- dtdState = "inside";
- super.startDTD (root, publicId, systemId);
- }
-
- public void notationDecl (String name, String publicId, String systemId)
- throws SAXException
- {
-// FIXME: not all parsers will report startDTD() ...
-// we'd rather insist we're "inside".
- if ("after" == dtdState)
- fatalError ("not inside DTD");
- super.notationDecl (name, publicId, systemId);
- }
-
- public void unparsedEntityDecl (String name,
- String publicId, String systemId, String notationName)
- throws SAXException
- {
-// FIXME: not all parsers will report startDTD() ...
-// we'd rather insist we're "inside".
- if ("after" == dtdState)
- fatalError ("not inside DTD");
- super.unparsedEntityDecl (name, publicId, systemId, notationName);
- }
-
- // FIXME: add the four DeclHandler calls too
-
- public void endDTD ()
- throws SAXException
- {
- if (!startedDoc)
- fatalError ("callback outside of document?");
- if ("inside" != dtdState)
- fatalError ("DTD ends without start?");
- dtdState = "after";
- super.endDTD ();
- }
-
- public void characters (char ch [], int start, int length)
- throws SAXException
- {
- int here = start, end = start + length;
- if (elementStack.empty ())
- fatalError ("characters must be in an element");
- while (here < end) {
- if (ch [here++] != ']')
- continue;
- if (here == end) // potential problem ...
- continue;
- if (ch [here++] != ']')
- continue;
- if (here == end) // potential problem ...
- continue;
- if (ch [here++] == '>')
- fatalError ("character data can't contain \"]]>\"");
- }
- super.characters (ch, start, length);
- }
-
- public void ignorableWhitespace (char ch [], int start, int length)
- throws SAXException
- {
- int here = start, end = start + length;
- if (elementStack.empty ())
- fatalError ("characters must be in an element");
- while (here < end) {
- if (ch [here++] == '\r')
- fatalError ("whitespace can't contain CR");
- }
- super.ignorableWhitespace (ch, start, length);
- }
-
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- if (data.indexOf ('\r') > 0)
- fatalError ("PIs can't contain CR");
- if (data.indexOf ("?>") > 0)
- fatalError ("PIs can't contain \"?>\"");
- }
-
- public void comment (char ch [], int start, int length)
- throws SAXException
- {
- if (!startedDoc)
- fatalError ("callback outside of document?");
- if (startedCDATA)
- fatalError ("comments can't nest in CDATA");
- int here = start, end = start + length;
- while (here < end) {
- if (ch [here] == '\r')
- fatalError ("comments can't contain CR");
- if (ch [here++] != '-')
- continue;
- if (here == end)
- fatalError ("comments can't end with \"--->\"");
- if (ch [here++] == '-')
- fatalError ("comments can't contain \"--\"");
- }
- super.comment (ch, start, length);
- }
-
- public void startCDATA ()
- throws SAXException
- {
- if (!startedDoc)
- fatalError ("callback outside of document?");
- if (startedCDATA)
- fatalError ("CDATA starts can't nest");
- startedCDATA = true;
- super.startCDATA ();
- }
-
- public void endCDATA ()
- throws SAXException
- {
- if (!startedDoc)
- fatalError ("callback outside of document?");
- if (!startedCDATA)
- fatalError ("CDATA end without start?");
- startedCDATA = false;
- super.endCDATA ();
- }
-}
diff --git a/libjava/gnu/xml/pipeline/XIncludeFilter.java b/libjava/gnu/xml/pipeline/XIncludeFilter.java
deleted file mode 100644
index 02607a4e06d..00000000000
--- a/libjava/gnu/xml/pipeline/XIncludeFilter.java
+++ /dev/null
@@ -1,579 +0,0 @@
-/* XIncludeFilter.java --
- Copyright (C) 2001,2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.xml.sax.Attributes;
-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;
-
-import gnu.xml.util.Resolver;
-
-
-
-/**
- * Filter to process an XPointer-free subset of
- * <a href="http://www.w3.org/TR/xinclude">XInclude</a>, supporting its
- * use as a kind of replacement for parsed general entities.
- * XInclude works much like the <code>#include</code> of C/C++ but
- * works for XML documents as well as unparsed text files.
- * Restrictions from the 17-Sept-2002 CR draft of XInclude are as follows:
- *
- * <ul>
- *
- * <li> URIs must not include fragment identifiers.
- * The CR specifies support for XPointer <em>element()</em> fragment IDs,
- * which is not currently implemented here.
- *
- * <li> <em>xi:fallback</em> handling of resource errors is not
- * currently supported.
- *
- * <li> DTDs are not supported in included files, since the SAX DTD events
- * must have completely preceded any included file.
- * The CR explicitly allows the DTD related portions of the infoset to
- * grow as an effect of including XML documents.
- *
- * <li> <em>xml:base</em> fixup isn't done.
- *
- * </ul>
- *
- * <p> XML documents that are included will normally be processed using
- * the default SAX namespace rules, meaning that prefix information may
- * be discarded. This may be changed with {@link #setSavingPrefixes
- * setSavingPrefixes()}. <em>You are strongly advised to do this.</em>
- *
- * <p> Note that XInclude allows highly incompatible implementations, which
- * are specialized to handle application-specific infoset extensions. Some
- * such implementations can be implemented by subclassing this one, but
- * they may only be substituted in applications at "user option".
- *
- * <p>TBD: "IURI" handling.
- *
- * @author David Brownell
- */
-public class XIncludeFilter extends EventFilter implements Locator
-{
- private Hashtable extEntities = new Hashtable (5, 5);
- private int ignoreCount;
- private Stack uris = new Stack ();
- private Locator locator;
- private Vector inclusions = new Vector (5, 5);
- private boolean savingPrefixes;
-
- /**
- */
- public XIncludeFilter (EventConsumer next)
- throws SAXException
- {
- super (next);
- setContentHandler (this);
- // DTDHandler callbacks pass straight through
- setProperty (DECL_HANDLER, this);
- setProperty (LEXICAL_HANDLER, this);
- }
-
- private void fatal (SAXParseException e) throws SAXException
- {
- ErrorHandler eh;
-
- eh = getErrorHandler ();
- if (eh != null)
- eh.fatalError (e);
- throw e;
- }
-
- /**
- * Passes "this" down the filter chain as a proxy locator.
- */
- public void setDocumentLocator (Locator locator)
- {
- this.locator = locator;
- super.setDocumentLocator (this);
- }
-
- /** Used for proxy locator; do not call directly. */
- public String getSystemId ()
- { return (locator == null) ? null : locator.getSystemId (); }
- /** Used for proxy locator; do not call directly. */
- public String getPublicId ()
- { return (locator == null) ? null : locator.getPublicId (); }
- /** Used for proxy locator; do not call directly. */
- public int getLineNumber ()
- { return (locator == null) ? -1 : locator.getLineNumber (); }
- /** Used for proxy locator; do not call directly. */
- public int getColumnNumber ()
- { return (locator == null) ? -1 : locator.getColumnNumber (); }
-
- /**
- * Assigns the flag controlling the setting of the SAX2
- * <em>namespace-prefixes</em> flag.
- */
- public void setSavingPrefixes (boolean flag)
- { savingPrefixes = flag; }
-
- /**
- * Returns the flag controlling the setting of the SAX2
- * <em>namespace-prefixes</em> flag when parsing included documents.
- * The default value is the SAX2 default (false), which discards
- * information that can be useful.
- */
- public boolean isSavingPrefixes ()
- { return savingPrefixes; }
-
- //
- // Two mechanisms are interacting here.
- //
- // - XML Base implies a stack of base URIs, updated both by
- // "real entity" boundaries and element boundaries.
- //
- // - Active "Real Entities" (for document and general entities,
- // and by xincluded files) are tracked to prevent circular
- // inclusions.
- //
- private String addMarker (String uri)
- throws SAXException
- {
- if (locator != null && locator.getSystemId () != null)
- uri = locator.getSystemId ();
-
- // guard against InputSource objects without system IDs
- if (uri == null)
- fatal (new SAXParseException ("Entity URI is unknown", locator));
-
- try {
- URL url = new URL (uri);
-
- uri = url.toString ();
- if (inclusions.contains (uri))
- fatal (new SAXParseException (
- "XInclude, circular inclusion", locator));
- inclusions.addElement (uri);
- uris.push (url);
- } catch (IOException e) {
- // guard against illegal relative URIs (Xerces)
- fatal (new SAXParseException ("parser bug: relative URI",
- locator, e));
- }
- return uri;
- }
-
- private void pop (String uri)
- {
- inclusions.removeElement (uri);
- uris.pop ();
- }
-
- //
- // Document entity boundaries get both treatments.
- //
- public void startDocument () throws SAXException
- {
- ignoreCount = 0;
- addMarker (null);
- super.startDocument ();
- }
-
- public void endDocument () throws SAXException
- {
- inclusions.setSize (0);
- extEntities.clear ();
- uris.setSize (0);
- super.endDocument ();
- }
-
- //
- // External general entity boundaries get both treatments.
- //
- public void externalEntityDecl (String name,
- String publicId, String systemId)
- throws SAXException
- {
- if (name.charAt (0) == '%')
- return;
- try {
- URL url = new URL (locator.getSystemId ());
- systemId = new URL (url, systemId).toString ();
- } catch (IOException e) {
- // what could we do?
- }
- extEntities.put (name, systemId);
- }
-
- public void startEntity (String name)
- throws SAXException
- {
- if (ignoreCount != 0) {
- ignoreCount++;
- return;
- }
-
- String uri = (String) extEntities.get (name);
- if (uri != null)
- addMarker (uri);
- super.startEntity (name);
- }
-
- public void endEntity (String name)
- throws SAXException
- {
- if (ignoreCount != 0) {
- if (--ignoreCount != 0)
- return;
- }
-
- String uri = (String) extEntities.get (name);
-
- if (uri != null)
- pop (uri);
- super.endEntity (name);
- }
-
- //
- // element boundaries only affect the base URI stack,
- // unless they're XInclude elements.
- //
- public void
- startElement (String uri, String localName, String qName, Attributes atts)
- throws SAXException
- {
- if (ignoreCount != 0) {
- ignoreCount++;
- return;
- }
-
- URL baseURI = (URL) uris.peek ();
- String base;
-
- base = atts.getValue ("http://www.w3.org/XML/1998/namespace", "base");
- if (base == null)
- uris.push (baseURI);
- else {
- URL url;
-
- if (base.indexOf ('#') != -1)
- fatal (new SAXParseException (
- "xml:base with fragment: " + base,
- locator));
-
- try {
- baseURI = new URL (baseURI, base);
- uris.push (baseURI);
- } catch (Exception e) {
- fatal (new SAXParseException (
- "xml:base with illegal uri: " + base,
- locator, e));
- }
- }
-
- if (!"http://www.w3.org/2001/XInclude".equals (uri)) {
- super.startElement (uri, localName, qName, atts);
- return;
- }
-
- if ("include".equals (localName)) {
- String href = atts.getValue ("href");
- String parse = atts.getValue ("parse");
- String encoding = atts.getValue ("encoding");
- URL url = (URL) uris.peek ();
- SAXParseException x = null;
-
- if (href == null)
- fatal (new SAXParseException (
- "XInclude missing href",
- locator));
- if (href.indexOf ('#') != -1)
- fatal (new SAXParseException (
- "XInclude with fragment: " + href,
- locator));
-
- if (parse == null || "xml".equals (parse))
- x = xinclude (url, href);
- else if ("text".equals (parse))
- x = readText (url, href, encoding);
- else
- fatal (new SAXParseException (
- "unknown XInclude parsing mode: " + parse,
- locator));
- if (x == null) {
- // strip out all child content
- ignoreCount++;
- return;
- }
-
- // FIXME the 17-Sept-2002 CR of XInclude says we "must"
- // use xi:fallback elements to handle resource errors,
- // if they exist.
- fatal (x);
-
- } else if ("fallback".equals (localName)) {
- fatal (new SAXParseException (
- "illegal top level XInclude 'fallback' element",
- locator));
- } else {
- ErrorHandler eh = getErrorHandler ();
-
- // CR doesn't say this is an error
- if (eh != null)
- eh.warning (new SAXParseException (
- "unrecognized toplevel XInclude element: " + localName,
- locator));
- super.startElement (uri, localName, qName, atts);
- }
- }
-
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- if (ignoreCount != 0) {
- if (--ignoreCount != 0)
- return;
- }
-
- uris.pop ();
- if (!("http://www.w3.org/2001/XInclude".equals (uri)
- && "include".equals (localName)))
- super.endElement (uri, localName, qName);
- }
-
- //
- // ignore all content within non-empty xi:include elements
- //
- public void characters (char ch [], int start, int length)
- throws SAXException
- {
- if (ignoreCount == 0)
- super.characters (ch, start, length);
- }
-
- public void processingInstruction (String target, String value)
- throws SAXException
- {
- if (ignoreCount == 0)
- super.processingInstruction (target, value);
- }
-
- public void ignorableWhitespace (char ch [], int start, int length)
- throws SAXException
- {
- if (ignoreCount == 0)
- super.ignorableWhitespace (ch, start, length);
- }
-
- public void comment (char ch [], int start, int length)
- throws SAXException
- {
- if (ignoreCount == 0)
- super.comment (ch, start, length);
- }
-
- public void startCDATA () throws SAXException
- {
- if (ignoreCount == 0)
- super.startCDATA ();
- }
-
- public void endCDATA () throws SAXException
- {
- if (ignoreCount == 0)
- super.endCDATA ();
- }
-
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException
- {
- if (ignoreCount == 0)
- super.startPrefixMapping (prefix, uri);
- }
-
- public void endPrefixMapping (String prefix) throws SAXException
- {
- if (ignoreCount == 0)
- super.endPrefixMapping (prefix);
- }
-
- public void skippedEntity (String name) throws SAXException
- {
- if (ignoreCount == 0)
- super.skippedEntity (name);
- }
-
- // JDK 1.1 seems to need it to be done this way, sigh
- void setLocator (Locator l) { locator = l; }
- Locator getLocator () { return locator; }
-
-
- //
- // for XIncluded entities, manage the current locator and
- // filter out events that would be incorrect to report
- //
- private class Scrubber extends EventFilter
- {
- Scrubber (EventFilter f)
- throws SAXException
- {
- // delegation passes to next in chain
- super (f);
-
- // process all content events
- super.setContentHandler (this);
- super.setProperty (LEXICAL_HANDLER, this);
-
- // drop all DTD events
- super.setDTDHandler (null);
- super.setProperty (DECL_HANDLER, null);
- }
-
- // maintain proxy locator
- // only one startDocument()/endDocument() pair per event stream
- public void setDocumentLocator (Locator l)
- { setLocator (l); }
- public void startDocument ()
- { }
- public void endDocument ()
- { }
-
- private void reject (String message) throws SAXException
- { fatal (new SAXParseException (message, getLocator ())); }
-
- // only the DTD from the "base document" gets reported
- public void startDTD (String root, String publicId, String systemId)
- throws SAXException
- { reject ("XIncluded DTD: " + systemId); }
- public void endDTD ()
- throws SAXException
- { reject ("XIncluded DTD"); }
- // ... so this should never happen
- public void skippedEntity (String name) throws SAXException
- { reject ("XInclude skipped entity: " + name); }
-
- // since we rejected DTDs, only builtin entities can be reported
- }
-
- // <xi:include parse='xml' ...>
- // relative to the base URI passed
- private SAXParseException xinclude (URL url, String href)
- throws SAXException
- {
- XMLReader helper;
- Scrubber scrubber;
- Locator savedLocator = locator;
-
- // start with a parser acting just like our input
- // modulo DTD-ish stuff (validation flag, entity resolver)
- helper = XMLReaderFactory.createXMLReader ();
- helper.setErrorHandler (getErrorHandler ());
- helper.setFeature (FEATURE_URI + "namespace-prefixes", true);
-
- // Set up the proxy locator and event filter.
- scrubber = new Scrubber (this);
- locator = null;
- bind (helper, scrubber);
-
- // Merge the included document, except its DTD
- try {
- url = new URL (url, href);
- href = url.toString ();
-
- if (inclusions.contains (href))
- fatal (new SAXParseException (
- "XInclude, circular inclusion", locator));
-
- inclusions.addElement (href);
- uris.push (url);
- helper.parse (new InputSource (href));
- return null;
- } catch (java.io.IOException e) {
- return new SAXParseException (href, locator, e);
- } finally {
- pop (href);
- locator = savedLocator;
- }
- }
-
- // <xi:include parse='text' ...>
- // relative to the base URI passed
- private SAXParseException readText (URL url, String href, String encoding)
- throws SAXException
- {
- InputStream in = null;
-
- try {
- URLConnection conn;
- InputStreamReader reader;
- char buf [] = new char [4096];
- int count;
-
- url = new URL (url, href);
- conn = url.openConnection ();
- in = conn.getInputStream ();
- if (encoding == null)
- encoding = Resolver.getEncoding (conn.getContentType ());
- if (encoding == null) {
- ErrorHandler eh = getErrorHandler ();
- if (eh != null)
- eh.warning (new SAXParseException (
- "guessing text encoding for URL: " + url,
- locator));
- reader = new InputStreamReader (in);
- } else
- reader = new InputStreamReader (in, encoding);
-
- while ((count = reader.read (buf, 0, buf.length)) != -1)
- super.characters (buf, 0, count);
- in.close ();
- return null;
- } catch (IOException e) {
- return new SAXParseException (
- "can't XInclude text",
- locator, e);
- }
- }
-}
diff --git a/libjava/gnu/xml/pipeline/XsltFilter.java b/libjava/gnu/xml/pipeline/XsltFilter.java
deleted file mode 100644
index 0a1872c5a80..00000000000
--- a/libjava/gnu/xml/pipeline/XsltFilter.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* XsltFilter.java --
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.pipeline;
-
-import java.io.IOException;
-
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.sax.*;
-import javax.xml.transform.stream.StreamSource;
-
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-
-
-/**
- * Packages an XSLT transform as a pipeline component.
- * Note that all DTD events (callbacks to DeclHandler and DTDHandler
- * interfaces) are discarded, although XSLT transforms may be set up to
- * use the LexicalHandler to write DTDs with only an external subset.
- * Not every XSLT engine will necessarily be usable with this filter,
- * but current versions of
- * <a href="http://saxon.sourceforge.net">SAXON</a> and
- * <a href="http://xml.apache.org/xalan-j">Xalan</a> should work well.
- *
- * @see TransformerFactory
- *
- * @author David Brownell
- */
-final public class XsltFilter extends EventFilter
-{
- /**
- * Creates a filter that performs the specified transform.
- * Uses the JAXP 1.1 interfaces to access the default XSLT
- * engine configured for in the current execution context,
- * and parses the stylesheet without custom EntityResolver
- * or ErrorHandler support.
- *
- * @param stylesheet URI for the stylesheet specifying the
- * XSLT transform
- * @param next provides the ContentHandler and LexicalHandler
- * to receive XSLT output.
- * @exception SAXException if the stylesheet can't be parsed
- * @exception IOException if there are difficulties
- * bootstrapping the XSLT engine, such as it not supporting
- * SAX well enough to use this way.
- */
- public XsltFilter (String stylesheet, EventConsumer next)
- throws SAXException, IOException
- {
- // First, get a transformer with the stylesheet preloaded
- TransformerFactory tf = null;
- TransformerHandler th;
-
- try {
- SAXTransformerFactory stf;
-
- tf = TransformerFactory.newInstance ();
- if (!tf.getFeature (SAXTransformerFactory.FEATURE) // sax inputs
- || !tf.getFeature (SAXResult.FEATURE) // sax outputs
- || !tf.getFeature (StreamSource.FEATURE) // stylesheet
- )
- throw new IOException ("XSLT factory ("
- + tf.getClass ().getName ()
- + ") does not support SAX");
- stf = (SAXTransformerFactory) tf;
- th = stf.newTransformerHandler (new StreamSource (stylesheet));
- } catch (TransformerConfigurationException e) {
- throw new IOException ("XSLT factory ("
- + (tf == null
- ? "none available"
- : tf.getClass ().getName ())
- + ") configuration error, "
- + e.getMessage ()
- );
- }
-
- // Hook its outputs up to the pipeline ...
- SAXResult out = new SAXResult ();
-
- out.setHandler (next.getContentHandler ());
- try {
- LexicalHandler lh;
- lh = (LexicalHandler) next.getProperty (LEXICAL_HANDLER);
- out.setLexicalHandler (lh);
- } catch (Exception e) {
- // ignore
- }
- th.setResult (out);
-
- // ... and make sure its inputs look like ours.
- setContentHandler (th);
- setProperty (LEXICAL_HANDLER, th);
- }
-}
diff --git a/libjava/gnu/xml/transform/AbstractNumberNode.java b/libjava/gnu/xml/transform/AbstractNumberNode.java
deleted file mode 100644
index 01c2dbb83d8..00000000000
--- a/libjava/gnu/xml/transform/AbstractNumberNode.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/* AbstractNumberNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing the XSL <code>number</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-abstract class AbstractNumberNode
- extends TemplateNode
-{
-
- static final int ALPHABETIC = 0;
- static final int TRADITIONAL = 1;
-
- final TemplateNode format;
- final String lang;
- final int letterValue;
- final String groupingSeparator;
- final int groupingSize;
-
- AbstractNumberNode(TemplateNode children, TemplateNode next,
- TemplateNode format, String lang,
- int letterValue, String groupingSeparator,
- int groupingSize)
- {
- super(children, next);
- this.format = format;
- this.lang = lang;
- this.letterValue = letterValue;
- this.groupingSeparator = groupingSeparator;
- this.groupingSize = groupingSize;
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Document doc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- DocumentFragment fragment = doc.createDocumentFragment();
- format.apply(stylesheet, mode, context, pos, len, fragment, null);
- String f = Expr._string(context, Collections.singleton(fragment));
- String value = format(f, compute(stylesheet, context, pos, len));
- Text text = doc.createTextNode(value);
- if (nextSibling != null)
- {
- parent.insertBefore(text, nextSibling);
- }
- else
- {
- parent.appendChild(text);
- }
- // xsl:number doesn't process children
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- String format(String format, int[] number)
- {
- if (number.length == 0)
- {
- return "";
- }
- int start = 0, end = 0, len = format.length(); // region of format
- // Tokenize
- List tokens = new ArrayList((number.length * 2) + 1);
- List types = new ArrayList(tokens.size());
- while (end < len)
- {
- while (end < len && !isAlphanumeric(format.charAt(end)))
- {
- end++;
- }
- if (end > start)
- {
- tokens.add(format.substring(start, end));
- types.add(Boolean.FALSE);
- }
- start = end;
- while (end < len && isAlphanumeric(format.charAt(end)))
- {
- end++;
- }
- if (end > start)
- {
- tokens.add(format.substring(start, end));
- types.add(Boolean.TRUE);
- }
- start = end;
- }
- // Process tokens
- StringBuffer buf = new StringBuffer();
- len = tokens.size();
- int pos = 0;
- for (int i = 0; i < len; i++)
- {
- String token = (i < 0) ? "." : (String) tokens.get(i);
- boolean alpha = (i < 0) ? true :
- ((Boolean) types.get(i)).booleanValue();
- if (!alpha)
- {
- buf.append(token);
- }
- else
- {
- if (pos < number.length)
- {
- format(buf, number[pos++], token);
- if (((i + 1 == len) || (i + 2 == len)) &&
- (pos < number.length))
- {
- // More numbers than tokens, reuse last token
- i -= 2;
- }
- }
- if (pos == number.length && i < (len - 2))
- {
- // No more numbers. Skip to the end...
- i = len - 2;
- if (((Boolean) types.get(i + 1)).booleanValue())
- {
- // number formatting token, ignore
- i++;
- }
- }
- }
- }
- //System.err.println("format: '"+format+"' "+asList(number)+" = '"+buf.toString()+"'");
- return buf.toString();
- }
-
- /*List asList(int[] number)
- {
- List l = new ArrayList();
- for (int i = 0; i < number.length; i++)
- l.add(new Integer(number[i]));
- return l;
- }*/
-
- void format(StringBuffer buf, int number, String formatToken)
- {
- int len = formatToken.length();
- char c = formatToken.charAt(len - 1);
- if (Character.digit(c, 10) == 1)
- {
- // Check preceding characters
- for (int i = len - 2; i >= 0; i--)
- {
- if (formatToken.charAt(i) != (c - 1))
- {
- format(buf, number, "1");
- return;
- }
- }
- // Decimal representation
- String val = Integer.toString(number);
- for (int d = len - val.length(); d > 0; d--)
- {
- buf.append('0');
- }
- buf.append(val);
- }
- else if ("A".equals(formatToken))
- {
- buf.append(alphabetic('@', number));
- }
- else if ("a".equals(formatToken))
- {
- buf.append(alphabetic('`', number));
- }
- else if ("i".equals(formatToken))
- {
- buf.append(roman(false, number));
- }
- else if ("I".equals(formatToken))
- {
- buf.append(roman(true, number));
- }
- else
- {
- // Unknown numbering sequence
- format(buf, number, "1");
- }
- }
-
- static final boolean isAlphanumeric(char c)
- {
- switch (Character.getType(c))
- {
- case Character.DECIMAL_DIGIT_NUMBER: // Nd
- case Character.LETTER_NUMBER: // Nl
- case Character.OTHER_NUMBER: // No
- case Character.UPPERCASE_LETTER: // Lu
- case Character.LOWERCASE_LETTER: // Ll
- case Character.TITLECASE_LETTER: // Lt
- case Character.MODIFIER_LETTER: // Lm
- case Character.OTHER_LETTER: // Lo
- return true;
- default:
- return false;
- }
- }
-
- static final String alphabetic(char offset, int number)
- {
- StringBuffer buf = new StringBuffer();
- while (number > 0)
- {
- int r = number % 26;
- number = number / 26;
- buf.insert(0, (char) (offset + r));
- }
- return buf.toString();
- }
-
- static final int[] roman_numbers = {1, 5, 10, 50, 100, 500, 1000};
- static final char[] roman_chars = {'i', 'v', 'x', 'l', 'c', 'd', 'm'};
-
- static final String roman(boolean upper, int number)
- {
- StringBuffer buf = new StringBuffer();
- for (int pos = roman_numbers.length - 1; pos >= 0; pos -= 2)
- {
- int f = number / roman_numbers[pos];
- if (f != 0)
- {
- number = number % (f * roman_numbers[pos]);
- }
- if (f > 4 && f < 9)
- {
- buf.append(roman_chars[pos + 1]);
- f -= 5;
- }
- if (f == 4)
- {
- buf.append(roman_chars[pos]);
- buf.append(roman_chars[pos + 1]);
- }
- else if (f == 9)
- {
- buf.append(roman_chars[pos]);
- buf.append(roman_chars[pos + 2]);
- }
- else
- {
- for (; f > 0; f--)
- {
- buf.append(roman_chars[pos]);
- }
- }
- }
- return upper ? buf.toString().toUpperCase() : buf.toString();
- }
-
- abstract int[] compute(Stylesheet stylesheet, Node context, int pos, int len)
- throws TransformerException;
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("format=");
- buf.append(format);
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/ApplyImportsNode.java b/libjava/gnu/xml/transform/ApplyImportsNode.java
deleted file mode 100644
index 4d171b7acf6..00000000000
--- a/libjava/gnu/xml/transform/ApplyImportsNode.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ApplyImportsNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-
-/**
- * A template node representing an XSLT <code>apply-imports</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ApplyImportsNode
- extends TemplateNode
-{
-
- ApplyImportsNode(TemplateNode children, TemplateNode next)
- {
- super(children, next);
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new ApplyImportsNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet));
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- TemplateNode t = stylesheet.getTemplate(mode, context, true);
- if (t != null)
- {
- t.apply(stylesheet, mode, context, pos, len,
- parent, nextSibling);
- }
- if (next != null)
- {
- next.apply(stylesheet, mode, context, pos, len,
- parent, nextSibling);
- }
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/ApplyTemplatesNode.java b/libjava/gnu/xml/transform/ApplyTemplatesNode.java
deleted file mode 100644
index bf267212013..00000000000
--- a/libjava/gnu/xml/transform/ApplyTemplatesNode.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/* ApplyTemplatesNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing the XSL <code>apply-templates</code>
- * instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ApplyTemplatesNode
- extends TemplateNode
-{
-
- final Expr select;
- final QName mode;
- final List sortKeys;
- final List withParams;
- final boolean isDefault;
-
- ApplyTemplatesNode(TemplateNode children, TemplateNode next,
- Expr select, QName mode,
- List sortKeys, List withParams, boolean isDefault)
- {
- super(children, next);
- this.select = select;
- this.mode = mode;
- this.sortKeys = sortKeys;
- this.withParams = withParams;
- this.isDefault = isDefault;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- int len = sortKeys.size();
- List sortKeys2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet));
- }
- len = withParams.size();
- List withParams2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet));
- }
- return new ApplyTemplatesNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- select.clone(stylesheet),
- mode, sortKeys2, withParams2, isDefault);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Object ret = select.evaluate(context, pos, len);
- if (ret != null && ret instanceof Collection)
- {
- if (withParams != null)
- {
- // push the parameter context
- stylesheet.bindings.push(false);
- // set the parameters
- for (Iterator i = withParams.iterator(); i.hasNext(); )
- {
- WithParam p = (WithParam) i.next();
- Object value = p.getValue(stylesheet, mode, context, pos, len);
- stylesheet.bindings.set(p.name, value, false);
- }
- }
- Collection ns = (Collection) ret;
- List nodes = new ArrayList(ns);
- if (sortKeys != null)
- {
- for (Iterator i = sortKeys.iterator(); i.hasNext(); )
- {
- SortKey sortKey = (SortKey) i.next();
- sortKey.init(stylesheet, mode, context, pos, len, parent,
- nextSibling);
- }
- Collections.sort(nodes, new XSLComparator(sortKeys));
- }
- else
- {
- Collections.sort(nodes, documentOrderComparator);
- }
- int l = nodes.size();
- QName effectiveMode = isDefault ? mode : this.mode;
- for (int i = 0; i < l; i++)
- {
- Node node = (Node) nodes.get(i);
- TemplateNode t = stylesheet.getTemplate(effectiveMode, node,
- false);
- if (t != null)
- {
- if (stylesheet.debug)
- {
- System.err.println("Applying " + t);
- }
- stylesheet.current = node;
- t.apply(stylesheet, effectiveMode, node, i + 1, l,
- parent, nextSibling);
- }
- }
- if (withParams != null)
- {
- // pop the variable context
- stylesheet.bindings.pop(false);
- }
- }
- // apply-templates doesn't have processable children
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- boolean o = false;
- if (select != null)
- {
- buf.append("select=");
- buf.append(select);
- o = true;
- }
- if (mode != null)
- {
- if (o)
- {
- buf.append(',');
- }
- buf.append("mode=");
- buf.append(mode);
- }
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/AttributeNode.java b/libjava/gnu/xml/transform/AttributeNode.java
deleted file mode 100644
index c26a7f6f52b..00000000000
--- a/libjava/gnu/xml/transform/AttributeNode.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/* AttributeNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing an XSL <code>attribute</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class AttributeNode
- extends TemplateNode
-{
-
- final TemplateNode name;
- final TemplateNode namespace;
- final Node source;
-
- AttributeNode(TemplateNode children, TemplateNode next, TemplateNode name,
- TemplateNode namespace, Node source)
- {
- super(children, next);
- this.name = name;
- this.namespace = namespace;
- this.source = source;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new AttributeNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null : next.clone(stylesheet),
- name.clone(stylesheet),
- (namespace == null) ? null :
- namespace.clone(stylesheet),
- source);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Document doc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- // Create a document fragment to hold the name
- DocumentFragment fragment = doc.createDocumentFragment();
- // Apply name to the fragment
- name.apply(stylesheet, mode,
- context, pos, len,
- fragment, null);
- // Use XPath string-value of fragment
- String nameValue = Expr.stringValue(fragment);
-
- String namespaceValue = null;
- if (namespace != null)
- {
- // Create a document fragment to hold the namespace
- fragment = doc.createDocumentFragment();
- // Apply namespace to the fragment
- namespace.apply(stylesheet, mode,
- context, pos, len,
- fragment, null);
- // Use XPath string-value of fragment
- namespaceValue = Expr.stringValue(fragment);
- if (namespaceValue.length() == 0)
- {
- namespaceValue = null;
- }
- }
-
- String prefix = getPrefix(nameValue);
- if (namespaceValue == null)
- {
- if (prefix != null)
- {
- if (XMLConstants.XML_NS_PREFIX.equals(prefix))
- {
- namespaceValue = XMLConstants.XML_NS_URI;
- }
- else
- {
- // Resolve namespace for this prefix
- namespaceValue = source.lookupNamespaceURI(prefix);
- }
- }
- }
- else
- {
- if (prefix != null)
- {
- String ns2 = source.lookupNamespaceURI(prefix);
- if (ns2 != null && !ns2.equals(namespaceValue))
- {
- // prefix clashes, reset it
- prefix = null;
- int ci = nameValue.indexOf(':');
- nameValue = nameValue.substring(ci + 1);
- }
- }
- }
- if (prefix == null)
- {
- // Resolve prefix for this namespace
- prefix = source.lookupPrefix(namespaceValue);
- if (prefix != null)
- {
- nameValue = prefix + ":" + nameValue;
- }
- else
- {
- if (namespaceValue != null)
- {
- // Must invent a prefix
- prefix = inventPrefix(parent);
- nameValue = prefix + ":" + nameValue;
- }
- }
- }
- NamedNodeMap attrs = parent.getAttributes();
- boolean insert = true;
- if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceValue) ||
- XMLConstants.XMLNS_ATTRIBUTE.equals(nameValue) ||
- nameValue.startsWith("xmlns:"))
- {
- // Namespace declaration, do not output
- insert = false;
- }
- if (prefix != null && namespaceValue == null)
- {
- // Not a QName
- insert = false;
- }
- if (parent.getNodeType() == Node.ELEMENT_NODE &&
- parent.getFirstChild() != null)
- {
- // XSLT 7.1.3 Adding an attribute to an element after children have
- // been added to it is an error
- insert = false;
- }
- if (insert)
- {
- // Insert attribute
- Attr attr = (namespaceValue != null) ?
- doc.createAttributeNS(namespaceValue, nameValue) :
- doc.createAttribute(nameValue);
- if (attrs != null)
- {
- if (namespace != null)
- {
- attrs.setNamedItemNS(attr);
- }
- else
- {
- attrs.setNamedItem(attr);
- }
- }
- if (children != null)
- {
- children.apply(stylesheet, mode,
- context, pos, len,
- attr, null);
- }
- }
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- final String getPrefix(String name)
- {
- int ci = name.indexOf(':');
- return (ci == -1) ? null : name.substring(0, ci);
- }
-
- final String inventPrefix(Node parent)
- {
- String base = "ns";
- int count = 0;
- String ret = base + Integer.toString(count);
- while (parent.lookupNamespaceURI(ret) != null)
- {
- count++;
- ret = base + Integer.toString(count);
- }
- return ret;
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("name=");
- buf.append(name);
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/AttributeSet.java b/libjava/gnu/xml/transform/AttributeSet.java
deleted file mode 100644
index 3ece9c83f5e..00000000000
--- a/libjava/gnu/xml/transform/AttributeSet.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* AttributeSet.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-/**
- * An attribute-set entry in a stylesheet.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class AttributeSet
-{
-
- final TemplateNode children;
- final String name;
- final String uas;
-
- AttributeSet(TemplateNode children, String name, String uas)
- {
- this.children = children;
- this.name = name;
- this.uas = uas;
- }
-
- AttributeSet clone(Stylesheet stylesheet)
- {
- return new AttributeSet((children == null) ? null :
- children.clone(stylesheet),
- name, uas);
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/Bindings.java b/libjava/gnu/xml/transform/Bindings.java
deleted file mode 100644
index 7bea4e8231d..00000000000
--- a/libjava/gnu/xml/transform/Bindings.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/* Bindings.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathVariableResolver;
-import org.w3c.dom.Node;
-
-/**
- * The set of variable bindings in effect for a stylesheet.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class Bindings
- implements XPathVariableResolver, Cloneable
-{
-
- final Stylesheet stylesheet;
-
- /**
- * Global variables.
- */
- final LinkedList variables;
-
- /**
- * Parameter value stack.
- */
- final LinkedList parameters;
-
- Bindings(Stylesheet stylesheet)
- {
- this.stylesheet = stylesheet;
- variables = new LinkedList();
- parameters = new LinkedList();
- push(true);
- push(false);
- }
-
- public Object clone()
- {
- try
- {
- return (Bindings) super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw new Error(e.getMessage());
- }
- }
-
- void push(boolean global)
- {
- if (global)
- {
- variables.addFirst(new HashMap());
- }
- else
- {
- parameters.addFirst(new HashMap());
- }
- }
-
- void pop(boolean global)
- {
- if (global)
- {
- variables.removeFirst();
- }
- else
- {
- parameters.removeFirst();
- }
- }
-
- public boolean containsKey(String name, boolean global)
- {
- Iterator i = global ? variables.iterator() : parameters.iterator();
- while (i.hasNext())
- {
- Map ctx = (Map) i.next();
- if (ctx.containsKey(name))
- {
- return true;
- }
- }
- return false;
- }
-
- public Object get(String name, Node context, int pos, int len)
- {
- //System.err.println("bindings.get: "+name);
- //System.err.println("\t"+toString());
- Object ret = null;
- for (Iterator i = variables.iterator(); i.hasNext() && ret == null; )
- {
- Map vctx = (Map) i.next();
- ret = vctx.get(name);
- }
- if (ret == null)
- {
- for (Iterator i = parameters.iterator(); i.hasNext() && ret == null; )
- {
- Map pctx = (Map) i.next();
- ret = pctx.get(name);
- }
- }
- /*if (ret instanceof Expr && context != null)
- {
- Expr expr = (Expr) ret;
- ret = expr.evaluate(context, 1, 1);
- }*/
- if (ret instanceof Node)
- {
- ret = Collections.singleton(ret);
- }
- if (ret == null)
- {
- ret = "";
- }
- //System.err.println("\tret="+ret);
- return ret;
- }
-
- void set(String name, Object value, boolean global)
- {
- if (global)
- {
- Map context = (Map) variables.getFirst();
- context.put(name, value);
- }
- else
- {
- Map context = (Map) parameters.getFirst();
- context.put(name, value);
- }
- }
-
- public Object resolveVariable(QName qName)
- {
- return get(qName.toString(), null, 1, 1);
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer();
- boolean next = false;
- Collection seen = new HashSet();
- buf.append('{');
- for (Iterator i = variables.iterator(); i.hasNext(); )
- {
- Map ctx = (Map) i.next();
- for (Iterator j = ctx.entrySet().iterator(); j.hasNext(); )
- {
- if (next)
- {
- buf.append(',');
- }
- else
- {
- next = true;
- }
- Map.Entry entry = (Map.Entry) j.next();
- Object key = entry.getKey();
- if (!seen.contains(key))
- {
- buf.append(key);
- buf.append('=');
- buf.append(entry.getValue());
- seen.add(key);
- }
- }
- }
- for (Iterator i = parameters.iterator(); i.hasNext(); )
- {
- Map ctx = (Map) i.next();
- for (Iterator j = ctx.entrySet().iterator(); j.hasNext(); )
- {
- if (next)
- {
- buf.append(',');
- }
- else
- {
- next = true;
- }
- Map.Entry entry = (Map.Entry) j.next();
- Object key = entry.getKey();
- if (!seen.contains(key))
- {
- buf.append(key);
- buf.append('=');
- buf.append(entry.getValue());
- seen.add(key);
- }
- }
- }
- buf.append('}');
- return buf.toString();
- }
-}
diff --git a/libjava/gnu/xml/transform/CallTemplateNode.java b/libjava/gnu/xml/transform/CallTemplateNode.java
deleted file mode 100644
index bb494084f7c..00000000000
--- a/libjava/gnu/xml/transform/CallTemplateNode.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* CallTemplateNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-
-/**
- * A template node representing the XSL <code>call-template</code>
- * instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class CallTemplateNode
- extends TemplateNode
-{
-
- final QName name;
- final List withParams;
-
- CallTemplateNode(TemplateNode children, TemplateNode next,
- QName name, List withParams)
- {
- super(children, next);
- this.name = name;
- this.withParams = withParams;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- int len = withParams.size();
- List withParams2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet));
- }
- return new CallTemplateNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- name, withParams2);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- if (withParams != null)
- {
- // push the parameter context
- stylesheet.bindings.push(false);
- // set the parameters
- for (Iterator i = withParams.iterator(); i.hasNext(); )
- {
- WithParam p = (WithParam) i.next();
- Object value = p.getValue(stylesheet, mode, context, pos, len);
- stylesheet.bindings.set(p.name, value, false);
- }
- }
- TemplateNode t = stylesheet.getTemplate(mode, name);
- if (t != null)
- {
- t.apply(stylesheet, mode, context, pos, len,
- parent, nextSibling);
- }
- if (withParams != null)
- {
- // pop the variable context
- stylesheet.bindings.pop(false);
- }
- // call-template doesn't have processable children
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("name=");
- buf.append(name);
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/ChooseNode.java b/libjava/gnu/xml/transform/ChooseNode.java
deleted file mode 100644
index 4a34712e43c..00000000000
--- a/libjava/gnu/xml/transform/ChooseNode.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ChooseNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-
-/**
- * A template node representing an XSL <code>choose</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ChooseNode
- extends TemplateNode
-{
-
- ChooseNode(TemplateNode children, TemplateNode next)
- {
- super(children, next);
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new ChooseNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet));
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- if (children != null)
- {
- children.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/CommentNode.java b/libjava/gnu/xml/transform/CommentNode.java
deleted file mode 100644
index 969555e8419..00000000000
--- a/libjava/gnu/xml/transform/CommentNode.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* CommentNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing the XSL <code>comment</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class CommentNode
- extends TemplateNode
-{
-
- CommentNode(TemplateNode children, TemplateNode next)
- {
- super(children, next);
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new CommentNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet));
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- String value = "";
- Document doc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- if (children != null)
- {
- // Create a document fragment to hold the text
- DocumentFragment fragment = doc.createDocumentFragment();
- // Apply children to the fragment
- children.apply(stylesheet, mode,
- context, pos, len,
- fragment, null);
- // Use XPath string-value of fragment
- value = Expr.stringValue(fragment);
- }
- Comment comment = doc.createComment(value);
- // Insert into result tree
- if (nextSibling != null)
- {
- parent.insertBefore(comment, nextSibling);
- }
- else
- {
- parent.appendChild(comment);
- }
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/CopyNode.java b/libjava/gnu/xml/transform/CopyNode.java
deleted file mode 100644
index b2c81b725ec..00000000000
--- a/libjava/gnu/xml/transform/CopyNode.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/* CopyNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.Iterator;
-import java.util.StringTokenizer;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * A template node representing the XSL <code>copy</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class CopyNode
- extends TemplateNode
-{
-
- final String uas;
-
- CopyNode(TemplateNode children, TemplateNode next, String uas)
- {
- super(children, next);
- this.uas = uas;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new CopyNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- uas);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Node copy = parent;
- switch (context.getNodeType())
- {
- case Node.TEXT_NODE:
- case Node.ATTRIBUTE_NODE:
- case Node.ELEMENT_NODE:
- case Node.PROCESSING_INSTRUCTION_NODE:
- case Node.COMMENT_NODE:
- Document doc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- copy = context.cloneNode(false);
- copy = doc.adoptNode(copy);
- if (copy.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- if (parent.getFirstChild() != null)
- {
- // Ignore attempt to add attribute after children
- }
- else
- {
- NamedNodeMap attrs = parent.getAttributes();
- if (attrs != null)
- {
- attrs.setNamedItemNS(copy);
- }
- }
- }
- else
- {
- if (nextSibling != null)
- {
- parent.insertBefore(copy, nextSibling);
- }
- else
- {
- parent.appendChild(copy);
- }
- }
- }
- if (uas != null)
- {
- StringTokenizer st = new StringTokenizer(uas, " ");
- while (st.hasMoreTokens())
- {
- addAttributeSet(stylesheet, mode, context, pos, len,
- copy, null, st.nextToken());
- }
- }
- if (children != null)
- {
- children.apply(stylesheet, mode,
- context, pos, len,
- copy, null);
- }
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- void addAttributeSet(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling, String attributeSet)
- throws TransformerException
- {
- for (Iterator i = stylesheet.attributeSets.iterator(); i.hasNext(); )
- {
- AttributeSet as = (AttributeSet) i.next();
- if (!as.name.equals(attributeSet))
- {
- continue;
- }
- if (as.uas != null)
- {
- StringTokenizer st = new StringTokenizer(as.uas, " ");
- while (st.hasMoreTokens())
- {
- addAttributeSet(stylesheet, mode, context, pos, len,
- parent, nextSibling, st.nextToken());
- }
- }
- if (as.children != null)
- {
- as.children.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/CopyOfNode.java b/libjava/gnu/xml/transform/CopyOfNode.java
deleted file mode 100644
index 4e09eeffb63..00000000000
--- a/libjava/gnu/xml/transform/CopyOfNode.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/* CopyOfNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing an XSLT <code>copy-of</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class CopyOfNode
- extends TemplateNode
-{
-
- final Expr select;
-
- CopyOfNode(TemplateNode children, TemplateNode next, Expr select)
- {
- super(children, next);
- this.select = select;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new CopyOfNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- select.clone(stylesheet));
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Object ret = select.evaluate(context, pos, len);
- Document doc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- if (ret instanceof Collection)
- {
- Collection ns = (Collection) ret;
- List list = new ArrayList(ns);
- Collections.sort(list, documentOrderComparator);
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Node src = (Node) i.next();
- short nodeType = src.getNodeType();
- if (nodeType == Node.DOCUMENT_NODE)
- {
- // Use document element
- src = ((Document) src).getDocumentElement();
- if (src == null)
- {
- continue;
- }
- nodeType = Node.ELEMENT_NODE;
- }
- else if (nodeType == Node.ATTRIBUTE_NODE)
- {
- if (parent.getFirstChild() != null)
- {
- // Ignore attempt to add attribute after children
- continue;
- }
- }
- if (parent.getNodeType() == Node.ATTRIBUTE_NODE &&
- nodeType != Node.TEXT_NODE &&
- nodeType != Node.ENTITY_REFERENCE_NODE)
- {
- // Ignore
- continue;
- }
- Node node = src.cloneNode(true);
- node = doc.adoptNode(node);
- if (nodeType == Node.ATTRIBUTE_NODE)
- {
- NamedNodeMap attrs = parent.getAttributes();
- if (attrs != null)
- {
- attrs.setNamedItemNS(node);
- }
- }
- else
- {
- if (nextSibling != null)
- {
- parent.insertBefore(node, nextSibling);
- }
- else
- {
- parent.appendChild(node);
- }
- }
- }
- }
- else
- {
- String value = Expr._string(context, ret);
- if (value != null && value.length() > 0)
- {
- Text textNode = doc.createTextNode(value);
- if (nextSibling != null)
- {
- parent.insertBefore(textNode, nextSibling);
- }
- else
- {
- parent.appendChild(textNode);
- }
- }
- }
- // copy-of doesn't process children
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("select=");
- buf.append(select);
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/CurrentFunction.java b/libjava/gnu/xml/transform/CurrentFunction.java
deleted file mode 100644
index 845793ac795..00000000000
--- a/libjava/gnu/xml/transform/CurrentFunction.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* CurrentFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.Collections;
-import java.util.List;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Function;
-
-/**
- * The XSLT <code>current()</code>function.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class CurrentFunction
- extends Expr
- implements Function, XPathFunction
-{
-
- final Stylesheet stylesheet;
-
- CurrentFunction(Stylesheet stylesheet)
- {
- this.stylesheet = stylesheet;
- }
-
- public Object evaluate(List args)
- throws XPathFunctionException
- {
- // We can't do anything useful here.
- // So much for the JAXP API...
- return Collections.EMPTY_SET;
- }
-
- public void setArguments(List args)
- {
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- return Collections.singleton(stylesheet.current);
- }
-
- public Expr clone(Object context)
- {
- Stylesheet s = stylesheet;
- if (context instanceof Stylesheet)
- {
- s = (Stylesheet) context;
- }
- return new CurrentFunction(s);
- }
-
- public String toString()
- {
- return "current()";
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/DOMSourceLocator.java b/libjava/gnu/xml/transform/DOMSourceLocator.java
deleted file mode 100644
index 9bc8fb1b6c8..00000000000
--- a/libjava/gnu/xml/transform/DOMSourceLocator.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* DOMSourceLocator.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.transform.dom.DOMLocator;
-import org.w3c.dom.Node;
-
-/**
- * Simple DOMLocator implementation.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class DOMSourceLocator
- implements DOMLocator
-{
-
- final Node node;
-
- DOMSourceLocator(Node node)
- {
- this.node = node;
- }
-
- public Node getOriginatingNode()
- {
- return node;
- }
-
- public String getPublicId()
- {
- return null;
- }
-
- public String getSystemId()
- {
- return null;
- }
-
- public int getLineNumber()
- {
- return -1;
- }
-
- public int getColumnNumber()
- {
- return -1;
- }
-
-}
diff --git a/libjava/gnu/xml/transform/DocumentFunction.java b/libjava/gnu/xml/transform/DocumentFunction.java
deleted file mode 100644
index 22dac75db12..00000000000
--- a/libjava/gnu/xml/transform/DocumentFunction.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/* DocumentFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-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.TransformerException;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Constant;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Function;
-import gnu.xml.xpath.IdFunction;
-
-/**
- * The XSLT <code>document()</code>function.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class DocumentFunction
- extends Expr
- implements Function, XPathFunction
-{
-
- final Stylesheet stylesheet;
- final Node base;
- List args;
- List values;
-
- DocumentFunction(Stylesheet stylesheet, Node base)
- {
- this.stylesheet = stylesheet;
- this.base = base;
- }
-
- public Object evaluate(List args)
- throws XPathFunctionException
- {
- values = args;
- return evaluate(null, 1, 1);
- }
-
- public void setArguments(List args)
- {
- this.args = args;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- int arity = args.size();
- if (values == null)
- {
- values = new ArrayList(arity);
- for (int i = 0; i < arity; i++)
- {
- Expr arg = (Expr) args.get(i);
- values.add(arg.evaluate(context, pos, len));
- }
- }
- Object ret;
- switch (arity)
- {
- case 1:
- Object arg = values.get(0);
- if (arg instanceof Collection)
- {
- Collection ns = (Collection) arg;
- Collection acc = new TreeSet();
- for (Iterator i = ns.iterator(); i.hasNext(); )
- {
- Node node = (Node) i.next();
- String s = Expr.stringValue(node);
- acc.addAll(document(s, node.getBaseURI()));
- }
- ret = acc;
- }
- else
- {
- String s = Expr._string(context, arg);
- ret = document(s, base.getBaseURI());
- }
- break;
- case 2:
- Object arg1 = values.get(0);
- Object arg2 = values.get(1);
- if (!(arg2 instanceof Collection))
- {
- throw new RuntimeException("second argument is not a node-set");
- }
- Collection arg2ns = (Collection) arg2;
- String base2 = arg2ns.isEmpty() ? null :
- ((Node) arg2ns.iterator().next()).getBaseURI();
- if (arg1 instanceof Collection)
- {
- Collection arg1ns = (Collection) arg1;
- Collection acc = new TreeSet();
- for (Iterator i = arg1ns.iterator(); i.hasNext(); )
- {
- Node node = (Node) i.next();
- String s = Expr.stringValue(node);
- acc.addAll(document(s, base2));
- }
- ret = acc;
- }
- else
- {
- String s = Expr._string(context, arg1);
- ret = document(s, base2);
- }
- break;
- default:
- throw new RuntimeException("invalid arity");
- }
- values = null;
- return ret;
- }
-
- /**
- * The XSL <code>document</code> function.
- * @see XSLT 12.1
- * @param uri the URI from which to retrieve nodes
- * @param base the base URI for relative URIs
- */
- Collection document(String uri, String base)
- {
- if ("".equals(uri) || uri == null)
- {
- uri = this.base.getBaseURI();
- }
-
- // Get fragment
- Expr fragment = null;
- int hi = uri.indexOf('#');
- if (hi != -1)
- {
- String f = uri.substring(hi + 1);
- uri = uri.substring(0, hi);
- // TODO handle xpointer() here
- // this only handles IDs
- fragment = new IdFunction(new Constant(f));
- }
-
- // Get document source
- try
- {
- DOMSource source;
- XSLURIResolver resolver = stylesheet.factory.resolver;
- synchronized (resolver)
- {
- if (stylesheet.transformer != null)
- {
- resolver.setUserResolver(stylesheet.transformer.uriResolver);
- resolver.setUserListener(stylesheet.transformer.errorListener);
- }
- source = resolver.resolveDOM(null, base, uri);
- }
- Node node = source.getNode();
- if (fragment == null)
- {
- return Collections.singleton(node);
- }
- else
- {
- Object ret = fragment.evaluate(node, 1, 1);
- if (!(ret instanceof Collection))
- {
- // XXX Report error?
- return Collections.EMPTY_SET;
- }
- return (Collection) ret;
- }
- }
- catch (TransformerException e)
- {
- String msg = "can't open " + uri;
- if (base != null)
- {
- msg += " with base " + base;
- }
- throw new RuntimeException(msg);
- }
- }
-
- public Expr clone(Object context)
- {
- Stylesheet s = stylesheet;
- if (context instanceof Stylesheet)
- {
- s = (Stylesheet) context;
- }
- DocumentFunction f = new DocumentFunction(s, base);
- int len = args.size();
- List args2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- args2.add(((Expr) args.get(i)).clone(context));
- }
- f.setArguments(args2);
- return f;
- }
-
-}
diff --git a/libjava/gnu/xml/transform/ElementAvailableFunction.java b/libjava/gnu/xml/transform/ElementAvailableFunction.java
deleted file mode 100644
index 7cf00d3252d..00000000000
--- a/libjava/gnu/xml/transform/ElementAvailableFunction.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/* ElementAvailableFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.TreeSet;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Function;
-
-/**
- * The XSLT <code>element-available</code> function.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class ElementAvailableFunction
- extends Expr
- implements Function, XPathFunction
-{
-
- static final Collection elements;
- static
- {
- TreeSet acc = new TreeSet();
- acc.add("stylesheet");
- acc.add("template");
- acc.add("param");
- acc.add("variable");
- acc.add("include");
- acc.add("import");
- acc.add("output");
- acc.add("preserve-space");
- acc.add("strip-space");
- acc.add("key");
- acc.add("decimal-format");
- acc.add("namespace-alias");
- acc.add("attribute-set");
- acc.add("apply-templates");
- acc.add("call-template");
- acc.add("value-of");
- acc.add("for-each");
- acc.add("if");
- acc.add("choose");
- acc.add("when");
- acc.add("otherwise");
- acc.add("element");
- acc.add("attribute");
- acc.add("text");
- acc.add("copy");
- acc.add("processing-instruction");
- acc.add("comment");
- acc.add("number");
- acc.add("copy-of");
- acc.add("message");
- acc.add("sort");
- acc.add("with-param");
- acc.add("fallback");
- acc.add("apply-imports");
- elements = Collections.unmodifiableSet(acc);
- }
-
- final NamespaceContext nsctx;
- List args;
-
- ElementAvailableFunction(NamespaceContext nsctx)
- {
- this.nsctx = nsctx;
- }
-
- public Object evaluate(List args)
- throws XPathFunctionException
- {
- // Useless...
- return Collections.EMPTY_SET;
- }
-
- public void setArguments(List args)
- {
- this.args = args;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Expr arg = (Expr) args.get(0);
- Object val = arg.evaluate(context, pos, len);
- String name = _string(context, val);
- String prefix, localName, uri;
- int ci = name.indexOf(':');
- if (ci == -1)
- {
- prefix = null;
- localName = name;
- }
- else
- {
- prefix = name.substring(0, ci);
- localName = name.substring(ci + 1);
- }
- uri = nsctx.getNamespaceURI(prefix);
- if (Stylesheet.XSL_NS.equals(uri))
- {
- return elements.contains(localName) ?
- Boolean.TRUE : Boolean.FALSE;
- // TODO extension elements
- }
- return Boolean.FALSE;
- }
-
- public Expr clone(Object context)
- {
- NamespaceContext n = nsctx;
- if (context instanceof NamespaceContext)
- {
- n = (NamespaceContext) context;
- }
- ElementAvailableFunction f = new ElementAvailableFunction(n);
- int len = args.size();
- List args2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- args2.add(((Expr) args.get(i)).clone(context));
- }
- f.setArguments(args2);
- return f;
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/ElementNode.java b/libjava/gnu/xml/transform/ElementNode.java
deleted file mode 100644
index 3609f0e0c19..00000000000
--- a/libjava/gnu/xml/transform/ElementNode.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/* ElementNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing an XSL <code>element</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ElementNode
- extends TemplateNode
-{
-
- final TemplateNode name;
- final TemplateNode namespace;
- final String uas;
- final Node source;
- final Collection elementExcludeResultPrefixes;
-
- ElementNode(TemplateNode children, TemplateNode next, TemplateNode name,
- TemplateNode namespace, String uas, Node source)
- {
- super(children, next);
- this.name = name;
- this.namespace = namespace;
- this.uas = uas;
- this.source = source;
- NamedNodeMap attrs = source.getAttributes();
- Node attr = attrs.getNamedItemNS(Stylesheet.XSL_NS,
- "exclude-result-prefixes");
- if (attr != null)
- {
- elementExcludeResultPrefixes = new HashSet();
- StringTokenizer st = new StringTokenizer(attr.getNodeValue());
- while (st.hasMoreTokens())
- {
- elementExcludeResultPrefixes.add(st.nextToken());
- }
- }
- else
- {
- elementExcludeResultPrefixes = Collections.EMPTY_SET;
- }
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new ElementNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- name.clone(stylesheet),
- (namespace == null) ? null :
- namespace.clone(stylesheet),
- uas, source);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Document doc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- // Create a document fragment to hold the name
- DocumentFragment fragment = doc.createDocumentFragment();
- // Apply name to the fragment
- name.apply(stylesheet, mode,
- context, pos, len,
- fragment, null);
- // Use XPath string-value of fragment
- String nameValue = Expr.stringValue(fragment);
-
- String namespaceValue = null;
- if (namespace != null)
- {
- // Create a document fragment to hold the namespace
- fragment = doc.createDocumentFragment();
- // Apply namespace to the fragment
- namespace.apply(stylesheet, mode,
- context, pos, len,
- fragment, null);
- // Use XPath string-value of fragment
- namespaceValue = Expr.stringValue(fragment);
- if (namespaceValue.length() == 0)
- {
- namespaceValue = null;
- }
- }
-
- String prefix = getPrefix(nameValue);
- if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix))
- {
- int ci = nameValue.indexOf(':');
- nameValue = nameValue.substring(ci + 1);
- }
- else
- {
- // Namespace aliasing
- if (prefix == null)
- {
- prefix = "#default";
- }
- String resultPrefix =
- (String) stylesheet.namespaceAliases.get(prefix);
- if (resultPrefix != null)
- {
- if ("#default".equals(resultPrefix))
- {
- resultPrefix = null;
- }
- namespaceValue = source.lookupNamespaceURI(resultPrefix);
- }
- if (prefix == "#default")
- {
- prefix = null;
- }
- // Look up ordinary namespace for this prefix
- if (namespaceValue == null)
- {
- if (XMLConstants.XML_NS_PREFIX.equals(prefix))
- {
- namespaceValue = XMLConstants.XML_NS_URI;
- }
- else
- {
- // Resolve namespace for this prefix
- namespaceValue = source.lookupNamespaceURI(prefix);
- }
- }
- /*if (prefix == null)
- {
- // Resolve prefix for this namespace
- prefix = parent.lookupPrefix(namespaceValue);
- if (prefix != null)
- {
- nameValue = prefix + ":" + nameValue;
- }
- }*/
- }
- // Create element
- Element element = (namespaceValue != null) ?
- doc.createElementNS(namespaceValue, nameValue) :
- doc.createElement(nameValue);
- if (nextSibling != null)
- {
- parent.insertBefore(element, nextSibling);
- }
- else
- {
- parent.appendChild(element);
- }
- stylesheet.addNamespaceNodes(source, element, doc,
- elementExcludeResultPrefixes);
- if (uas != null)
- {
- StringTokenizer st = new StringTokenizer(uas, " ");
- while (st.hasMoreTokens())
- {
- addAttributeSet(stylesheet, mode, context, pos, len,
- element, null, st.nextToken());
- }
- }
- if (children != null)
- {
- children.apply(stylesheet, mode,
- context, pos, len,
- element, null);
- }
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- final String getPrefix(String name)
- {
- int ci = name.indexOf(':');
- return (ci == -1) ? null : name.substring(0, ci);
- }
-
- void addAttributeSet(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling, String attributeSet)
- throws TransformerException
- {
- for (Iterator i = stylesheet.attributeSets.iterator(); i.hasNext(); )
- {
- AttributeSet as = (AttributeSet) i.next();
- if (!as.name.equals(attributeSet))
- {
- continue;
- }
- if (as.uas != null)
- {
- StringTokenizer st = new StringTokenizer(as.uas, " ");
- while (st.hasMoreTokens())
- {
- addAttributeSet(stylesheet, mode, context, pos, len,
- parent, nextSibling, st.nextToken());
- }
- }
- if (as.children != null)
- {
- as.children.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("name=");
- buf.append(name);
- if (uas != null)
- {
- buf.append(",uas=");
- buf.append(uas);
- }
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/ErrorListenerErrorHandler.java b/libjava/gnu/xml/transform/ErrorListenerErrorHandler.java
deleted file mode 100644
index d79bb15467a..00000000000
--- a/libjava/gnu/xml/transform/ErrorListenerErrorHandler.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* ErrorListenerErrorHandler.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.TransformerException;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * An ErrorHandler that wraps an ErrorListener.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class ErrorListenerErrorHandler
- implements ErrorHandler
-{
-
- final ErrorListener listener;
-
- ErrorListenerErrorHandler(ErrorListener listener)
- {
- this.listener = listener;
- }
-
- public void warning(SAXParseException e)
- throws SAXException
- {
- try
- {
- listener.warning(new TransformerException(e));
- }
- catch (TransformerException e2)
- {
- throw new SAXException(e2);
- }
- }
-
- public void error(SAXParseException e)
- throws SAXException
- {
- try
- {
- listener.error(new TransformerException(e));
- }
- catch (TransformerException e2)
- {
- throw new SAXException(e2);
- }
- }
-
- public void fatalError(SAXParseException e)
- throws SAXException
- {
- try
- {
- listener.fatalError(new TransformerException(e));
- }
- catch (TransformerException e2)
- {
- throw new SAXException(e2);
- }
- }
-
-}
diff --git a/libjava/gnu/xml/transform/ForEachNode.java b/libjava/gnu/xml/transform/ForEachNode.java
deleted file mode 100644
index fd9797dd474..00000000000
--- a/libjava/gnu/xml/transform/ForEachNode.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* ForEachNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing an XSLT <code>for-each</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ForEachNode
- extends TemplateNode
-{
-
- final Expr select;
- final List sortKeys;
-
- ForEachNode(TemplateNode children, TemplateNode next, Expr select,
- List sortKeys)
- {
- super(children, next);
- this.select = select;
- this.sortKeys = sortKeys;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- int len = sortKeys.size();
- List sortKeys2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet));
- }
- return new ForEachNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- select.clone(stylesheet),
- sortKeys2);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- if (children != null)
- {
- // Set current template to null
- Template saved = stylesheet.currentTemplate;
- stylesheet.currentTemplate = null;
- Object ret = select.evaluate(context, pos, len);
- //System.err.println(toString() + ": " + context+" -> "+ret);
- if (ret instanceof Collection)
- {
- Collection ns = (Collection) ret;
- List list = new ArrayList(ns);
- if (sortKeys != null)
- {
- for (Iterator i = sortKeys.iterator(); i.hasNext(); )
- {
- SortKey sortKey = (SortKey) i.next();
- sortKey.init(stylesheet, mode, context, pos, len, parent,
- nextSibling);
- }
- Collections.sort(list, new XSLComparator(sortKeys));
- }
- else
- {
- Collections.sort(list, documentOrderComparator);
- }
- // Perform children for each node
- int l = list.size();
- int p = 1;
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Node node = (Node) i.next();
- stylesheet.current = node;
- children.apply(stylesheet, mode,
- node, p++, l,
- parent, nextSibling);
- }
- }
- // Restore current template
- stylesheet.currentTemplate = saved;
- }
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("select=");
- buf.append(select);
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/FormatNumberFunction.java b/libjava/gnu/xml/transform/FormatNumberFunction.java
deleted file mode 100644
index aaa015b4ae9..00000000000
--- a/libjava/gnu/xml/transform/FormatNumberFunction.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/* FormatNumberFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Function;
-
-/**
- * The XSLT <code>format-number()</code>function.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class FormatNumberFunction
- extends Expr
- implements XPathFunction, Function
-{
-
- final Stylesheet stylesheet;
- List args;
-
- FormatNumberFunction(Stylesheet stylesheet)
- {
- this.stylesheet = stylesheet;
- }
-
- public Object evaluate(List args)
- throws XPathFunctionException
- {
- // Useless...
- return Collections.EMPTY_SET;
- }
-
- public void setArguments(List args)
- {
- this.args = args;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- int arity = args.size();
- List values = new ArrayList(arity);
- for (int i = 0; i < arity; i++)
- {
- Expr arg = (Expr) args.get(i);
- values.add(arg.evaluate(context, pos, len));
- }
- double number = _number(context, values.get(0));
- String pattern = _string(context, values.get(1));
- // Currency symbol &#x00a4; is not supposed to be present
- if (pattern.indexOf('\u00a4') != -1)
- {
- // Replace with $ (Xalan does this)
- pattern = pattern.replace('\u00a4', '$');
- }
- String dfName = null;
- if (arity > 2)
- {
- dfName = _string(context, values.get(2));
- // otherwise the default decimal-format will be used
- }
- DecimalFormat df = (DecimalFormat) stylesheet.decimalFormats.get(dfName);
- if (df == null)
- {
- throw new IllegalArgumentException("No such decimal-format: " +
- dfName);
- }
- df.applyLocalizedPattern(pattern);
- return df.format(number);
- }
-
- public Expr clone(Object context)
- {
- Stylesheet s = stylesheet;
- if (context instanceof Stylesheet)
- {
- s = (Stylesheet) context;
- }
- FormatNumberFunction f = new FormatNumberFunction(s);
- int len = args.size();
- List args2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- args2.add(((Expr) args.get(i)).clone(context));
- }
- f.setArguments(args2);
- return f;
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/FunctionAvailableFunction.java b/libjava/gnu/xml/transform/FunctionAvailableFunction.java
deleted file mode 100644
index b7dfb6192ff..00000000000
--- a/libjava/gnu/xml/transform/FunctionAvailableFunction.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* FunctionAvailableFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.TreeSet;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Function;
-
-/**
- * The XSLT <code>function-available</code> function.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class FunctionAvailableFunction
- extends Expr
- implements Function, XPathFunction
-{
-
- static final Collection xsltFunctions;
- static final Collection xpathFunctions;
- static
- {
- TreeSet acc = new TreeSet();
- acc.add("document");
- acc.add("key");
- acc.add("format-number");
- acc.add("current");
- acc.add("unparsed-entity-uri");
- acc.add("generate-id");
- acc.add("system-property");
- acc.add("element-available");
- acc.add("function-available");
- xsltFunctions = Collections.unmodifiableSet(acc);
- acc = new TreeSet();
- acc.add("boolean");
- acc.add("ceiling");
- acc.add("concat");
- acc.add("contains");
- acc.add("count");
- acc.add("false");
- acc.add("floor");
- acc.add("id");
- acc.add("lang");
- acc.add("last");
- acc.add("local-name");
- acc.add("name");
- acc.add("namespace-uri");
- acc.add("normalize-space");
- acc.add("not");
- acc.add("number");
- acc.add("position");
- acc.add("round");
- acc.add("starts-with");
- acc.add("string");
- acc.add("string-length");
- acc.add("substring-after");
- acc.add("substring-before");
- acc.add("substring");
- acc.add("sum");
- acc.add("translate");
- acc.add("true");
- xpathFunctions = Collections.unmodifiableSet(acc);
- }
-
- final NamespaceContext nsctx;
- List args;
-
- FunctionAvailableFunction(NamespaceContext nsctx)
- {
- this.nsctx = nsctx;
- }
-
- public Object evaluate(List args)
- throws XPathFunctionException
- {
- // Useless...
- return Collections.EMPTY_SET;
- }
-
- public void setArguments(List args)
- {
- this.args = args;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Expr arg = (Expr) args.get(0);
- Object val = arg.evaluate(context, pos, len);
- String name = _string(context, val);
- String prefix, localName, uri;
- int ci = name.indexOf(':');
- if (ci == -1)
- {
- prefix = null;
- localName = name;
- }
- else
- {
- prefix = name.substring(0, ci);
- localName = name.substring(ci + 1);
- }
- uri = nsctx.getNamespaceURI(prefix);
- if (uri == null)
- {
- return xsltFunctions.contains(localName) ||
- xpathFunctions.contains(localName) ?
- Boolean.TRUE : Boolean.FALSE;
- // TODO extension functions
- }
- return Boolean.FALSE;
- }
-
- public Expr clone(Object context)
- {
- NamespaceContext n = nsctx;
- if (context instanceof NamespaceContext)
- {
- n = (NamespaceContext) context;
- }
- FunctionAvailableFunction f = new FunctionAvailableFunction(n);
- int len = args.size();
- List args2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- args2.add(((Expr) args.get(i)).clone(context));
- }
- f.setArguments(args2);
- return f;
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/GenerateIdFunction.java b/libjava/gnu/xml/transform/GenerateIdFunction.java
deleted file mode 100644
index a7682c91802..00000000000
--- a/libjava/gnu/xml/transform/GenerateIdFunction.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* GenerateIdFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Function;
-
-/**
- * The XSLT <code>generate-id()</code>function.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class GenerateIdFunction
- extends Expr
- implements XPathFunction, Function
-{
-
- List args;
-
- public Object evaluate(List args)
- throws XPathFunctionException
- {
- // Useless...
- return Collections.EMPTY_SET;
- }
-
- public void setArguments(List args)
- {
- this.args = args;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- int arity = args.size();
- List values = new ArrayList(arity);
- for (int i = 0; i < arity; i++)
- {
- Expr arg = (Expr) args.get(i);
- values.add(arg.evaluate(context, pos, len));
- }
- Node node;
- Collection ns = (arity == 0) ? Collections.EMPTY_SET :
- (Collection) values.get(0);
- if (ns.isEmpty())
- {
- node = context;
- }
- else
- {
- List list = new ArrayList(ns);
- Collections.sort(list, documentOrderComparator);
- node = (Node) list.get(0);
- }
-
- String name = node.getNodeName();
- int index = 0, depth = 0;
- for (Node ctx = node.getPreviousSibling(); ctx != null;
- ctx = ctx.getPreviousSibling())
- {
- index++;
- }
- for (Node ctx = node.getParentNode(); ctx != null;
- ctx = ctx.getParentNode())
- {
- depth++;
- }
- return name + "-" + index + "-" + depth;
- }
-
- public Expr clone(Object context)
- {
- GenerateIdFunction f = new GenerateIdFunction();
- int len = args.size();
- List args2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- args2.add(((Expr) args.get(i)).clone(context));
- }
- f.setArguments(args2);
- return f;
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/IfNode.java b/libjava/gnu/xml/transform/IfNode.java
deleted file mode 100644
index f277cce07b9..00000000000
--- a/libjava/gnu/xml/transform/IfNode.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* IfNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing an XSL <code>if</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class IfNode
- extends TemplateNode
-{
-
- final Expr test;
-
- IfNode(TemplateNode children, TemplateNode next, Expr test)
- {
- super(children, next);
- this.test = test;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new IfNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- test.clone(stylesheet));
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Object ret = test.evaluate(context, pos, len);
- boolean success = (ret instanceof Boolean) ?
- ((Boolean) ret).booleanValue() :
- Expr._boolean(context, ret);
- if (success)
- {
- if (children != null)
- {
- children.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("test=");
- buf.append(test);
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/Key.java b/libjava/gnu/xml/transform/Key.java
deleted file mode 100644
index 72bd90aedb0..00000000000
--- a/libjava/gnu/xml/transform/Key.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Key.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Pattern;
-
-/**
- * An XSL key.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class Key
-{
-
- final QName name;
- final Pattern match;
- final Expr use;
-
- Key(QName name, Pattern match, Expr use)
- {
- this.name = name;
- this.match = match;
- this.use = use;
- }
-
- Key clone(Stylesheet stylesheet)
- {
- return new Key(name,
- (Pattern) match.clone(stylesheet),
- use.clone(stylesheet));
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/KeyFunction.java b/libjava/gnu/xml/transform/KeyFunction.java
deleted file mode 100644
index eb842f289c9..00000000000
--- a/libjava/gnu/xml/transform/KeyFunction.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/* KeyFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Function;
-import gnu.xml.xpath.Pattern;
-
-/**
- * The XSLT <code>key()</code>function.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class KeyFunction
- extends Pattern
- implements XPathFunction, Function
-{
-
- final Stylesheet stylesheet;
- List args;
-
- KeyFunction(Stylesheet stylesheet)
- {
- this.stylesheet = stylesheet;
- }
-
- public Object evaluate(List args)
- throws XPathFunctionException
- {
- // Useless...
- return Collections.EMPTY_SET;
- }
-
- public void setArguments(List args)
- {
- this.args = args;
- }
-
- public boolean matches(Node context)
- {
- Object ret = evaluate(context, 1, 1);
- return !((Collection) ret).isEmpty();
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- // Evaluate arguments
- int arity = args.size();
- List values = new ArrayList(arity);
- for (int i = 0; i < arity; i++)
- {
- Expr arg = (Expr) args.get(i);
- values.add(arg.evaluate(context, pos, len));
- }
- // Get key name
- QName keyName = QName.valueOf(_string(context, values.get(0)));
- // Expand qualified name
- String uri = keyName.getNamespaceURI();
- String prefix = keyName.getPrefix();
- if ((uri == null || uri.length() == 0) &&
- (prefix != null && prefix.length() > 0))
- {
- uri = stylesheet.getNamespaceURI(prefix);
- if (uri != null && uri.length() > 0)
- {
- String localName = keyName.getLocalPart();
- keyName = new QName(uri, localName, prefix);
- }
- }
- // Compute matching key set
- Collection keySet = new LinkedList();
- for (Iterator i = stylesheet.keys.iterator(); i.hasNext(); )
- {
- Key key = (Key) i.next();
- if (key.name.equals(keyName))
- {
- keySet.add(key);
- }
- }
- // Get target
- Object target = values.get(1);
- Collection acc = new LinkedHashSet();
- Document doc = (context instanceof Document) ? (Document) context :
- context.getOwnerDocument();
- if (target instanceof Collection)
- {
- for (Iterator i = ((Collection) target).iterator(); i.hasNext(); )
- {
- String val = Expr.stringValue((Node) i.next());
- addKeyNodes(doc, keySet, val, acc);
- }
- }
- else
- {
- String val = Expr._string(context, target);
- addKeyNodes(doc, keySet, val, acc);
- }
- List ret = new ArrayList(acc);
- Collections.sort(ret, documentOrderComparator);
- return ret;
- }
-
- final void addKeyNodes(Node node, Collection keySet,
- String value, Collection acc)
- {
- addKeyNodeIfMatch(node, keySet, value, acc);
- // Apply children
- for (Node ctx = node.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- addKeyNodes(ctx, keySet, value, acc);
- }
- }
-
- final void addKeyNodeIfMatch(Node node, Collection keySet,
- String value, Collection acc)
- {
- for (Iterator i = keySet.iterator(); i.hasNext(); )
- {
- Key key = (Key) i.next();
- if (key.match.matches(node))
- {
- Object eval = key.use.evaluate(node, 1, 1);
- if (eval instanceof Collection)
- {
- for (Iterator j = ((Collection) eval).iterator();
- j.hasNext(); )
- {
- String keyValue = Expr.stringValue((Node) j.next());
- if (value.equals(keyValue))
- {
- acc.add(node);
- return;
- }
- }
- }
- else
- {
- String keyValue = Expr._string(node, eval);
- if (value.equals(keyValue))
- {
- acc.add(node);
- return;
- }
- }
- }
- }
- }
-
- public Expr clone(Object context)
- {
- Stylesheet s = stylesheet;
- if (context instanceof Stylesheet)
- {
- s = (Stylesheet) context;
- }
- KeyFunction f = new KeyFunction(s);
- int len = args.size();
- List args2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- args2.add(((Expr) args.get(i)).clone(context));
- }
- f.setArguments(args2);
- return f;
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/LiteralNode.java b/libjava/gnu/xml/transform/LiteralNode.java
deleted file mode 100644
index b053727d7f3..00000000000
--- a/libjava/gnu/xml/transform/LiteralNode.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/* LiteralNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.StringTokenizer;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * A template node that copies a DOM node in the template to the result
- * tree.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class LiteralNode
- extends TemplateNode
-{
-
- /**
- * The source node in the XSL template.
- */
- final Node source;
-
- final Collection elementExcludeResultPrefixes;
-
- LiteralNode(TemplateNode children, TemplateNode next, Node source)
- {
- super(children, next);
- this.source = source;
- if (source.getNodeType() == Node.ELEMENT_NODE)
- {
- NamedNodeMap attrs = source.getAttributes();
- Node attr = attrs.getNamedItemNS(Stylesheet.XSL_NS,
- "exclude-result-prefixes");
- if (attr != null)
- {
- elementExcludeResultPrefixes = new HashSet();
- StringTokenizer st = new StringTokenizer(attr.getNodeValue());
- while (st.hasMoreTokens())
- {
- elementExcludeResultPrefixes.add(st.nextToken());
- }
- }
- else
- {
- elementExcludeResultPrefixes = Collections.EMPTY_SET;
- }
- }
- else
- {
- elementExcludeResultPrefixes = null;
- }
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new LiteralNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- source);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Node result = null;
- Document doc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- short nodeType = source.getNodeType();
- if (nodeType == Node.ATTRIBUTE_NODE &&
- parent.getFirstChild() != null)
- {
- // Ignore attributes added after child elements
- }
- else
- {
- // Namespace aliasing
- if (nodeType == Node.ELEMENT_NODE)
- {
- String prefix = source.getPrefix();
- if (prefix == null)
- {
- prefix = "#default";
- }
- String resultPrefix =
- (String) stylesheet.namespaceAliases.get(prefix);
- if (resultPrefix != null)
- {
- if ("#default".equals(resultPrefix))
- {
- resultPrefix = null;
- }
- String uri = source.lookupNamespaceURI(resultPrefix);
- String name = source.getNodeName();
- // Create a new element node in the result document
- result = doc.createElementNS(uri, name);
- // copy attributes
- NamedNodeMap srcAttrs = source.getAttributes();
- NamedNodeMap dstAttrs = result.getAttributes();
- int l = srcAttrs.getLength();
- for (int i = 0; i < l; i++)
- {
- Node attr = srcAttrs.item(i);
- if (!Stylesheet.XSL_NS.equals(attr.getNamespaceURI()))
- {
- attr = attr.cloneNode(true);
- attr = doc.adoptNode(attr);
- dstAttrs.setNamedItemNS(attr);
- }
- }
- }
- }
- if (result == null)
- {
- // Create result node
- result = source.cloneNode(false);
- // Remove any XSL attributes
- NamedNodeMap attrs = result.getAttributes();
- if (attrs != null)
- {
- int l = attrs.getLength();
- for (int i = 0; i < l; i++)
- {
- Node attr = attrs.item(i);
- if (Stylesheet.XSL_NS.equals(attr.getNamespaceURI()))
- {
- attrs.removeNamedItem(attr.getNodeName());
- i--;
- l--;
- }
- }
- }
- result = doc.adoptNode(result);
- if (result == null)
- {
- String msg = "Error adopting node to result tree";
- DOMSourceLocator l = new DOMSourceLocator(context);
- throw new TransformerException(msg, l);
- }
- }
- if (nextSibling != null)
- {
- parent.insertBefore(result, nextSibling);
- }
- else
- {
- parent.appendChild(result);
- }
- if (nodeType == Node.ELEMENT_NODE)
- {
- stylesheet.addNamespaceNodes(source, result, doc,
- elementExcludeResultPrefixes);
- }
- // children
- if (children != null)
- {
- children.apply(stylesheet, mode,
- context, pos, len,
- result, null);
- }
- }
- // next sibling
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("source=");
- buf.append(source);
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/MessageNode.java b/libjava/gnu/xml/transform/MessageNode.java
deleted file mode 100644
index 9feeb752788..00000000000
--- a/libjava/gnu/xml/transform/MessageNode.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* MessageNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * An XSL <code>message</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class MessageNode
- extends TemplateNode
-{
-
- final boolean terminate;
-
- MessageNode(TemplateNode children, TemplateNode next, boolean terminate)
- {
- super(children, next);
- this.terminate = terminate;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new MessageNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- terminate);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- if (children != null)
- {
- Document doc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- DocumentFragment fragment = doc.createDocumentFragment();
- children.apply(stylesheet, mode, context, pos, len, fragment, null);
- String message = Expr.stringValue(fragment);
- System.err.println(message);
- if (terminate)
- {
- stylesheet.terminated = true;
- }
- }
- if (next != null && !terminate)
- {
- next.apply(stylesheet, mode, context, pos, len, parent, nextSibling);
- }
- }
-
-}
diff --git a/libjava/gnu/xml/transform/NodeNumberNode.java b/libjava/gnu/xml/transform/NodeNumberNode.java
deleted file mode 100644
index 99ffe8bbb24..00000000000
--- a/libjava/gnu/xml/transform/NodeNumberNode.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/* NodeNumberNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Pattern;
-import gnu.xml.xpath.Selector;
-import gnu.xml.xpath.UnionExpr;
-
-/**
- * A template node representing the XSL <code>number</code> instruction
- * with no <code>value</code> expression, i.e. the value is computed from
- * the document position of the context node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class NodeNumberNode
- extends AbstractNumberNode
-{
-
- static final int SINGLE = 0;
- static final int MULTIPLE = 1;
- static final int ANY = 2;
-
- final int level;
- final Pattern count;
- final Pattern from;
-
- NodeNumberNode(TemplateNode children, TemplateNode next,
- int level, Pattern count, Pattern from,
- TemplateNode format, String lang,
- int letterValue, String groupingSeparator, int groupingSize)
- {
- super(children, next, format, lang, letterValue, groupingSeparator,
- groupingSize);
- this.level = level;
- this.count = count;
- this.from = from;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new NodeNumberNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- level,
- (count == null) ? null :
- (Pattern) count.clone(stylesheet),
- (from == null) ? from :
- (Pattern) from.clone(stylesheet),
- format, lang, letterValue,
- groupingSeparator, groupingSize);
- }
-
- int[] compute(Stylesheet stylesheet, Node context, int pos, int len)
- throws TransformerException
- {
- /*if (from != null)
- {
- Object ret = from.evaluate(context, pos, len);
- if (ret instanceof Collection)
- {
- Collection ns = (Collection) ret;
- if (ns.size() > 0)
- {
- List list = new ArrayList(ns);
- Collections.sort(list, documentOrderComparator);
- context = (Node) list.get(0);
- }
- else
- {
- return new int[0];
- }
- }
- else
- {
- return new int[0];
- }
- }*/
- Node current = context;
- switch (level)
- {
- case SINGLE:
- if (from == null)
- {
- while (context != null && !countMatches(current, context))
- {
- context = context.getParentNode();
- }
- }
- else
- {
- while (context != null && !countMatches(current, context) &&
- !fromMatches(context))
- {
- context = context.getParentNode();
- }
- }
- return (context == null) ? new int[0] :
- new int[] { (context == current) ? pos : getIndex(current, context) };
- case MULTIPLE:
- List ancestors = new ArrayList();
- while (context != null)
- {
- if (countMatches(current, context))
- {
- if (from == null || fromMatches(context))
- {
- ancestors.add(context);
- }
- }
- context = context.getParentNode();
- }
- Collections.sort(ancestors, documentOrderComparator);
- int[] ret = new int[ancestors.size()];
- for (int i = 0; i < ret.length; i++)
- {
- ret[i] = getIndex(current, (Node) ancestors.get(i));
- }
- return ret;
- case ANY:
- Expr preceding = new Selector(Selector.PRECEDING,
- Collections.EMPTY_LIST);
- Expr ancestorOrSelf = new Selector(Selector.ANCESTOR_OR_SELF,
- Collections.EMPTY_LIST);
- Expr any = new UnionExpr(preceding, ancestorOrSelf);
- Object eval = any.evaluate(context, pos, len);
- if (eval instanceof Collection)
- {
- Collection ns = (Collection) eval;
- List candidates = new ArrayList();
- for (Iterator i = ns.iterator(); i.hasNext(); )
- {
- Node candidate = (Node) i.next();
- if (countMatches(current, candidate))
- {
- candidates.add(candidate);
- if (from != null && from.matches(candidate))
- {
- break;
- }
- }
- }
- return new int[] { candidates.size() };
- }
- return new int[0];
- default:
- throw new TransformerException("invalid level");
- }
- }
-
- boolean countMatches(Node current, Node node)
- {
- if (count == null)
- {
- int cnt = current.getNodeType();
- int nnt = node.getNodeType();
- if (cnt != nnt)
- {
- return false;
- }
- if (nnt == Node.ELEMENT_NODE || nnt == Node.ATTRIBUTE_NODE)
- {
- String curi = current.getNamespaceURI();
- String nuri = node.getNamespaceURI();
- if ((curi == null && nuri != null) ||
- (curi != null && !curi.equals(nuri)))
- {
- return false;
- }
- String cn = current.getLocalName();
- String nn = current.getLocalName();
- if (!cn.equals(nn))
- {
- return false;
- }
- }
- return true;
- }
- else
- {
- return count.matches(node);
- }
- }
-
- boolean fromMatches(Node node)
- {
- for (Node ctx = node.getParentNode(); ctx != null;
- ctx = ctx.getParentNode())
- {
- if (from.matches(ctx))
- {
- return true;
- }
- }
- return false;
- }
-
- int getIndex(Node current, Node node)
- {
- int index = 0;
- do
- {
- do
- {
- node = node.getPreviousSibling();
- }
- while (node != null && !countMatches(current, node));
- index++;
- }
- while (node != null);
- return index;
- }
-
-}
diff --git a/libjava/gnu/xml/transform/NumberNode.java b/libjava/gnu/xml/transform/NumberNode.java
deleted file mode 100644
index c16324b63a4..00000000000
--- a/libjava/gnu/xml/transform/NumberNode.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* NumberNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing the XSL <code>number</code> instruction
- * with a <code>value</code> expression.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class NumberNode
- extends AbstractNumberNode
-{
-
- final Expr value;
-
- NumberNode(TemplateNode children, TemplateNode next,
- Expr value, TemplateNode format, String lang,
- int letterValue, String groupingSeparator, int groupingSize)
- {
- super(children, next, format, lang, letterValue, groupingSeparator,
- groupingSize);
- this.value = value;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new NumberNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- value.clone(stylesheet),
- format, lang, letterValue,
- groupingSeparator, groupingSize);
- }
-
- int[] compute(Stylesheet stylesheet, Node context, int pos, int len)
- throws TransformerException
- {
- Object ret = value.evaluate(context, pos, len);
- Double d = (ret instanceof Double) ? ((Double) ret) :
- new Double(Expr._number(context, ret));
- return new int[] { d.intValue() };
- }
-
-}
diff --git a/libjava/gnu/xml/transform/OtherwiseNode.java b/libjava/gnu/xml/transform/OtherwiseNode.java
deleted file mode 100644
index 00a3d9d3c81..00000000000
--- a/libjava/gnu/xml/transform/OtherwiseNode.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/* OtherwiseNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-
-/**
- * A template node representing an XSL <code>otherwise</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class OtherwiseNode
- extends TemplateNode
-{
-
- OtherwiseNode(TemplateNode children, TemplateNode next)
- {
- super(children, next);
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new OtherwiseNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet));
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- if (children != null)
- {
- children.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/ParameterNode.java b/libjava/gnu/xml/transform/ParameterNode.java
deleted file mode 100644
index 8d709f80115..00000000000
--- a/libjava/gnu/xml/transform/ParameterNode.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* ParameterNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.Collections;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node that sets a variable or parameter during template
- * processing.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ParameterNode
- extends TemplateNode
-{
-
- final String name;
- final Expr select;
- final boolean global;
-
- ParameterNode(TemplateNode children, TemplateNode next,
- String name, Expr select, boolean global)
- {
- super(children, next);
- this.name = name;
- this.select = select;
- this.global = global;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new ParameterNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- name,
- select.clone(stylesheet),
- global);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- boolean apply = global || !stylesheet.bindings.containsKey(name, global);
- if (apply)
- {
- // push the variable context
- stylesheet.bindings.push(global);
- // set the variable
- Object value = getValue(stylesheet, mode, context, pos, len);
- if (value != null)
- {
- stylesheet.bindings.set(name, value, global);
- }
- }
- // variable and param don't process children as such
- // all subsequent instructions are processed with that variable context
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- if (apply)
- {
- // pop the variable context
- stylesheet.bindings.pop(global);
- }
- }
-
- Object getValue(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len)
- throws TransformerException
- {
- if (select != null)
- {
- return select.evaluate(context, pos, len);
- }
- else if (children != null)
- {
- Document doc = (context instanceof Document) ? (Document) context :
- context.getOwnerDocument();
- DocumentFragment fragment = doc.createDocumentFragment();
- children.apply(stylesheet, mode, context, pos, len, fragment, null);
- return Collections.singleton(fragment);
- }
- else
- {
- return null;
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("name=");
- buf.append(name);
- if (select != null)
- {
- buf.append(",select=");
- buf.append(select);
- }
- if (global)
- {
- buf.append(",global");
- }
- buf.append(']');
- return buf.toString();
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/ProcessingInstructionNode.java b/libjava/gnu/xml/transform/ProcessingInstructionNode.java
deleted file mode 100644
index e6823a5b2c6..00000000000
--- a/libjava/gnu/xml/transform/ProcessingInstructionNode.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/* ProcessingInstructionNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing the XSL <code>processing-instruction</code>
- * instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ProcessingInstructionNode
- extends TemplateNode
-{
-
- final String name;
-
- ProcessingInstructionNode(TemplateNode children, TemplateNode next,
- String name)
- {
- super(children, next);
- this.name = name;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new ProcessingInstructionNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- name);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- String data = null;
- Document doc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- if (children != null)
- {
- // Create a document fragment to hold the text
- DocumentFragment fragment = doc.createDocumentFragment();
- // Apply children to the fragment
- children.apply(stylesheet, mode,
- context, pos, len,
- fragment, null);
- // Use XPath string-value of fragment
- data = Expr.stringValue(fragment);
- }
- ProcessingInstruction pi = doc.createProcessingInstruction(name, data);
- // Insert into result tree
- if (nextSibling != null)
- {
- parent.insertBefore(pi, nextSibling);
- }
- else
- {
- parent.appendChild(pi);
- }
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("name=");
- buf.append(name);
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/SAXSerializer.java b/libjava/gnu/xml/transform/SAXSerializer.java
deleted file mode 100644
index 9650e3e052d..00000000000
--- a/libjava/gnu/xml/transform/SAXSerializer.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/* SAXSerializer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * Serializes a DOM node to a sequence of SAX events.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class SAXSerializer
- implements Attributes
-{
-
- transient NamedNodeMap attrs;
- transient LinkedList namespaces = new LinkedList();
-
- boolean isDefined(String prefix, String uri)
- {
- for (Iterator i = namespaces.iterator(); i.hasNext(); )
- {
- HashMap ctx = (HashMap) i.next();
- if (uri.equals(ctx.get(prefix)))
- {
- return true;
- }
- }
- return false;
- }
-
- void define(String prefix, String uri)
- {
- for (Iterator i = namespaces.iterator(); i.hasNext(); )
- {
- HashMap ctx = (HashMap) i.next();
- if (ctx.containsKey(prefix))
- {
- HashMap newCtx = new HashMap();
- newCtx.put(prefix, uri);
- namespaces.addFirst(newCtx);
- return;
- }
- }
- HashMap ctx;
- if (namespaces.isEmpty())
- {
- ctx = new HashMap();
- namespaces.add(ctx);
- }
- else
- {
- ctx = (HashMap) namespaces.getFirst();
- }
- ctx.put(prefix, uri);
- }
-
- void undefine(String prefix, String uri)
- {
- for (Iterator i = namespaces.iterator(); i.hasNext(); )
- {
- HashMap ctx = (HashMap) i.next();
- if (uri.equals(ctx.get(prefix)))
- {
- ctx.remove(prefix);
- if (ctx.isEmpty())
- {
- namespaces.remove(ctx);
- }
- return;
- }
- }
- }
-
- public int getLength()
- {
- return attrs.getLength();
- }
-
- public String getURI(int index)
- {
- return attrs.item(index).getNamespaceURI();
- }
-
- public String getLocalName(int index)
- {
- return attrs.item(index).getLocalName();
- }
-
- public String getQName(int index)
- {
- return attrs.item(index).getNodeName();
- }
-
- public String getType(int index)
- {
- Attr attr = (Attr) attrs.item(index);
- return attr.isId() ? "ID" : "CDATA";
- }
-
- public String getValue(int index)
- {
- return attrs.item(index).getNodeValue();
- }
-
- public int getIndex(String uri, String localName)
- {
- int len = attrs.getLength();
- for (int i = 0; i < len; i++)
- {
- Node attr = attrs.item(i);
- String a_uri = attr.getNamespaceURI();
- String a_localName = attr.getLocalName();
- if (((a_uri == null && uri == null) ||
- (a_uri != null && a_uri.equals(uri))) &&
- a_localName.equals(localName))
- {
- return i;
- }
- }
- return -1;
- }
-
- public int getIndex(String qName)
- {
- int len = attrs.getLength();
- for (int i = 0; i < len; i++)
- {
- Node attr = attrs.item(i);
- String a_name = attr.getNodeName();
- if (a_name.equals(qName))
- {
- return i;
- }
- }
- return -1;
- }
-
- public String getType(String uri, String localName)
- {
- Attr attr = (Attr) attrs.getNamedItemNS(uri, localName);
- return attr.isId() ? "ID" : "CDATA";
- }
-
- public String getType(String qName)
- {
- Attr attr = (Attr) attrs.getNamedItem(qName);
- return attr.isId() ? "ID" : "CDATA";
- }
-
- public String getValue(String uri, String localName)
- {
- return attrs.getNamedItemNS(uri, localName).getNodeValue();
- }
-
- public String getValue(String qName)
- {
- return attrs.getNamedItem(qName).getNodeValue();
- }
-
- void serialize(Node node, ContentHandler ch, LexicalHandler lh)
- throws SAXException
- {
- attrs = node.getAttributes();
- Node children;
- Node next = node.getNextSibling();
- switch (node.getNodeType())
- {
- case Node.ELEMENT_NODE:
- String uri = node.getNamespaceURI();
- String prefix = node.getPrefix();
- boolean defined = isDefined(prefix, uri);
- if (!defined)
- {
- define(prefix, uri);
- ch.startPrefixMapping(prefix, uri);
- }
- String localName = node.getLocalName();
- String qName = node.getNodeName();
- ch.startElement(uri, localName, qName, this);
- children = node.getFirstChild();
- if (children != null)
- {
- serialize(children, ch, lh);
- }
- ch.endElement(uri, localName, qName);
- if (!defined)
- {
- ch.endPrefixMapping(prefix);
- undefine(prefix, uri);
- }
- break;
- case Node.TEXT_NODE:
- char[] chars = node.getNodeValue().toCharArray();
- ch.characters(chars, 0, chars.length);
- break;
- case Node.CDATA_SECTION_NODE:
- char[] cdata = node.getNodeValue().toCharArray();
- if (lh != null)
- {
- lh.startCDATA();
- ch.characters(cdata, 0, cdata.length);
- lh.endCDATA();
- }
- else
- {
- ch.characters(cdata, 0, cdata.length);
- }
- break;
- case Node.COMMENT_NODE:
- if (lh != null)
- {
- char[] comment = node.getNodeValue().toCharArray();
- lh.comment(comment, 0, comment.length);
- }
- break;
- case Node.DOCUMENT_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- ch.startDocument();
- children = node.getFirstChild();
- if (children != null)
- {
- serialize(children, ch, lh);
- }
- ch.endDocument();
- break;
- case Node.DOCUMENT_TYPE_NODE:
- if (lh != null)
- {
- DocumentType doctype = (DocumentType) node;
- String publicId = doctype.getPublicId();
- String systemId = doctype.getSystemId();
- lh.startDTD(node.getNodeName(), publicId, systemId);
- NamedNodeMap entities = doctype.getEntities();
- int len = entities.getLength();
- for (int i = 0; i < len; i++)
- {
- Node entity = entities.item(i);
- String entityName = entity.getNodeName();
- lh.startEntity(entityName);
- lh.endEntity(entityName);
- }
- lh.endDTD();
- }
- break;
- case Node.PROCESSING_INSTRUCTION_NODE:
- ch.processingInstruction(node.getNodeName(), node.getNodeValue());
- break;
- case Node.ENTITY_REFERENCE_NODE:
- ch.skippedEntity(node.getNodeName());
- break;
- }
- attrs = null;
- if (next != null)
- {
- serialize(next, ch, lh);
- }
- }
-
-}
diff --git a/libjava/gnu/xml/transform/SortKey.java b/libjava/gnu/xml/transform/SortKey.java
deleted file mode 100644
index 1ec9bdd57b9..00000000000
--- a/libjava/gnu/xml/transform/SortKey.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/* SortKey.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * An XSL sort key.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class SortKey
-{
-
- static final int DEFAULT = 0;
- static final int UPPER_FIRST = 1;
- static final int LOWER_FIRST = 2;
-
- final Expr select;
- final TemplateNode langTemplate;
- final TemplateNode dataTypeTemplate;
- final TemplateNode orderTemplate;
- final TemplateNode caseOrderTemplate;
-
- transient String lang;
- transient String dataType;
- transient boolean descending;
- transient int caseOrder;
-
- SortKey(Expr select, TemplateNode lang, TemplateNode dataType,
- TemplateNode order, TemplateNode caseOrder)
- {
- this.select = select;
- this.langTemplate = lang;
- this.dataTypeTemplate = dataType;
- this.orderTemplate = order;
- this.caseOrderTemplate = caseOrder;
- }
-
- String key(Node node)
- {
- Object ret = select.evaluate(node, 1, 1);
- if (ret instanceof String)
- {
- return (String) ret;
- }
- else
- {
- return Expr._string(node, ret);
- }
- }
-
- /**
- * Prepare for a sort.
- * This sets all transient variables from their AVTs.
- */
- void init(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Document doc = (context instanceof Document) ? (Document) context :
- context.getOwnerDocument();
- if (langTemplate == null)
- {
- lang = null;
- }
- else
- {
- DocumentFragment fragment = doc.createDocumentFragment();
- langTemplate.apply(stylesheet, mode, context, pos, len,
- fragment, null);
- lang = Expr.stringValue(fragment);
- }
- if (dataTypeTemplate == null)
- {
- dataType = "text";
- }
- else
- {
- DocumentFragment fragment = doc.createDocumentFragment();
- dataTypeTemplate.apply(stylesheet, mode, context, pos, len,
- fragment, null);
- dataType = Expr.stringValue(fragment);
- }
- if (orderTemplate == null)
- {
- descending = false;
- }
- else
- {
- DocumentFragment fragment = doc.createDocumentFragment();
- orderTemplate.apply(stylesheet, mode, context, pos, len,
- fragment, null);
- String order = Expr.stringValue(fragment);
- descending = "descending".equals(order);
- }
- if (caseOrderTemplate == null)
- {
- caseOrder = DEFAULT;
- }
- else
- {
- DocumentFragment fragment = doc.createDocumentFragment();
- caseOrderTemplate.apply(stylesheet, mode, context, pos, len,
- fragment, null);
- String co = Expr.stringValue(fragment);
- caseOrder = "upper-first".equals(co) ? UPPER_FIRST :
- "lower-first".equals(co) ? LOWER_FIRST :
- DEFAULT;
- }
- }
-
-}
diff --git a/libjava/gnu/xml/transform/StreamSerializer.java b/libjava/gnu/xml/transform/StreamSerializer.java
deleted file mode 100644
index 80a1f7016a5..00000000000
--- a/libjava/gnu/xml/transform/StreamSerializer.java
+++ /dev/null
@@ -1,632 +0,0 @@
-/* StreamSerializer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.XMLConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Serializes a DOM node to an output stream.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class StreamSerializer
-{
-
- static final int SPACE = 0x20;
- static final int BANG = 0x21; // !
- static final int APOS = 0x27; // '
- static final int SLASH = 0x2f; // /
- static final int BRA = 0x3c; // <
- static final int KET = 0x3e; // >
- static final int EQ = 0x3d; // =
-
- protected String encoding;
- boolean compatibilityMode;
- final int mode;
- final Map namespaces;
- protected String eol;
- Collection cdataSectionElements = Collections.EMPTY_SET;
-
- protected boolean discardDefaultContent;
- protected boolean xmlDeclaration = true;
-
- public StreamSerializer()
- {
- this(Stylesheet.OUTPUT_XML, null, null);
- }
-
- public StreamSerializer(String encoding)
- {
- this(Stylesheet.OUTPUT_XML, encoding, null);
- }
-
- public StreamSerializer(int mode, String encoding, String eol)
- {
- this.mode = mode;
- if (encoding == null)
- {
- encoding = "UTF-8";
- }
- this.encoding = encoding.intern();
- compatibilityMode = true;
- if (encoding.length() > 3)
- {
- String p = encoding.substring(0, 3);
- if (p.equalsIgnoreCase("UTF") ||
- p.equalsIgnoreCase("UCS"))
- {
- compatibilityMode = false;
- }
- }
- this.eol = (eol != null) ? eol : System.getProperty("line.separator");
- namespaces = new HashMap();
- }
-
- void setCdataSectionElements(Collection c)
- {
- cdataSectionElements = c;
- }
-
- public void serialize(final Node node, final OutputStream out)
- throws IOException
- {
- serialize(node, out, false);
- }
-
- void serialize(final Node node, final OutputStream out,
- boolean convertToCdata)
- throws IOException
- {
- if (out == null)
- {
- throw new NullPointerException("no output stream");
- }
- String value, prefix;
- Node children;
- Node next = node.getNextSibling();
- String uri = node.getNamespaceURI();
- boolean defined = false;
- short nt = node.getNodeType();
- if (convertToCdata && nt == Node.TEXT_NODE)
- {
- nt = Node.CDATA_SECTION_NODE;
- }
- switch (nt)
- {
- case Node.ATTRIBUTE_NODE:
- prefix = node.getPrefix();
- if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri) ||
- XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) ||
- (prefix != null && prefix.startsWith("xmlns:")))
- {
- String nsuri = node.getNodeValue();
- if (isDefined(nsuri))
- {
- break;
- }
- define(nsuri, node.getLocalName());
- }
- else if (uri != null && !isDefined(uri))
- {
- prefix = define(uri, prefix);
- String nsname = (prefix == null) ? "xmlns" : "xmlns:" + prefix;
- out.write(SPACE);
- out.write(encodeText(nsname));
- out.write(EQ);
- String nsvalue = "'" + encode(uri, true, true) + "'";
- out.write(nsvalue.getBytes(encoding));
- defined = true;
- }
- out.write(SPACE);
- String a_nodeName = node.getNodeName();
- out.write(encodeText(a_nodeName));
- String a_nodeValue = node.getNodeValue();
- if (mode == Stylesheet.OUTPUT_HTML &&
- a_nodeName.equals(a_nodeValue))
- {
- break;
- }
- out.write(EQ);
- value = "'" + encode(a_nodeValue, true, true) + "'";
- out.write(encodeText(value));
- break;
- case Node.ELEMENT_NODE:
- value = node.getNodeName();
- out.write(BRA);
- out.write(encodeText(value));
- if (uri != null && !isDefined(uri))
- {
- prefix = define(uri, node.getPrefix());
- String nsname = (prefix == null) ? "xmlns" : "xmlns:" + prefix;
- out.write(SPACE);
- out.write(encodeText(nsname));
- out.write(EQ);
- String nsvalue = "'" + encode(uri, true, true) + "'";
- out.write(encodeText(nsvalue));
- defined = true;
- }
- NamedNodeMap attrs = node.getAttributes();
- if (attrs != null)
- {
- int len = attrs.getLength();
- for (int i = 0; i < len; i++)
- {
- Attr attr = (Attr) attrs.item(i);
- if (discardDefaultContent && !attr.getSpecified())
- {
- // NOOP
- }
- else
- {
- serialize(attr, out, false);
- }
- }
- }
- convertToCdata = cdataSectionElements.contains(value);
- children = node.getFirstChild();
- if (children == null)
- {
- out.write(SLASH);
- out.write(KET);
- }
- else
- {
- out.write(KET);
- serialize(children, out, convertToCdata);
- out.write(BRA);
- out.write(SLASH);
- out.write(encodeText(value));
- out.write(KET);
- }
- break;
- case Node.TEXT_NODE:
- value = node.getNodeValue();
- if (!"yes".equals(node.getUserData("disable-output-escaping")))
- {
- value = encode(value, false, false);
- }
- out.write(encodeText(value));
- break;
- case Node.CDATA_SECTION_NODE:
- value = "<![CDATA[" + node.getNodeValue() + "]]>";
- out.write(encodeText(value));
- break;
- case Node.COMMENT_NODE:
- value = "<!--" + node.getNodeValue() + "-->";
- out.write(encodeText(value));
- Node cp = node.getParentNode();
- if (cp != null && cp.getNodeType() == Node.DOCUMENT_NODE)
- {
- out.write(encodeText(eol));
- }
- break;
- case Node.DOCUMENT_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- if (mode == Stylesheet.OUTPUT_XML)
- {
- if ("UTF-16".equalsIgnoreCase(encoding))
- {
- out.write(0xfe);
- out.write(0xff);
- }
- if (!"yes".equals(node.getUserData("omit-xml-declaration")) &&
- xmlDeclaration)
- {
- Document doc = (node instanceof Document) ?
- (Document) node : null;
- String version = (doc != null) ? doc.getXmlVersion() : null;
- if (version == null)
- {
- version = (String) node.getUserData("version");
- }
- if (version == null)
- {
- version = "1.0";
- }
- out.write(BRA);
- out.write(0x3f);
- out.write("xml version='".getBytes("US-ASCII"));
- out.write(version.getBytes("US-ASCII"));
- out.write(APOS);
- if (!("UTF-8".equalsIgnoreCase(encoding)))
- {
- out.write(" encoding='".getBytes("US-ASCII"));
- out.write(encoding.getBytes("US-ASCII"));
- out.write(APOS);
- }
- if ((doc != null && doc.getXmlStandalone()) ||
- "yes".equals(node.getUserData("standalone")))
- {
- out.write(" standalone='yes'".getBytes("US-ASCII"));
- }
- out.write(0x3f);
- out.write(KET);
- out.write(encodeText(eol));
- }
- // TODO warn if not outputting the declaration would be a
- // problem
- }
- else if (mode == Stylesheet.OUTPUT_HTML)
- {
- // Ensure that encoding is accessible
- String mediaType = (String) node.getUserData("media-type");
- if (mediaType == null)
- {
- mediaType = "text/html";
- }
- String contentType = mediaType + "; charset=" +
- ((encoding.indexOf(' ') != -1) ?
- "\"" + encoding + "\"" :
- encoding);
- Document doc = (node instanceof Document) ? (Document) node :
- node.getOwnerDocument();
- Node html = null;
- for (Node ctx = node.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (ctx.getNodeType() == Node.ELEMENT_NODE)
- {
- html = ctx;
- break;
- }
- }
- if (html == null)
- {
- html = doc.createElement("html");
- node.appendChild(html);
- }
- Node head = null;
- for (Node ctx = html.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (ctx.getNodeType() == Node.ELEMENT_NODE &&
- "head".equalsIgnoreCase(ctx.getLocalName()))
- {
- head = ctx;
- break;
- }
- }
- if (head == null)
- {
- head = doc.createElement("head");
- Node c1 = null;
- for (Node ctx = html.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (ctx.getNodeType() == Node.ELEMENT_NODE)
- {
- c1 = ctx;
- break;
- }
- }
- if (c1 != null)
- {
- html.insertBefore(head, c1);
- }
- else
- {
- html.appendChild(head);
- }
- }
- Node meta = null;
- Node metaContent = null;
- for (Node ctx = head.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- if (ctx.getNodeType() == Node.ELEMENT_NODE &&
- "meta".equalsIgnoreCase(ctx.getLocalName()))
- {
- NamedNodeMap metaAttrs = ctx.getAttributes();
- int len = metaAttrs.getLength();
- String httpEquiv = null;
- Node content = null;
- for (int i = 0; i < len; i++)
- {
- Node attr = metaAttrs.item(i);
- String attrName = attr.getNodeName();
- if ("http-equiv".equalsIgnoreCase(attrName))
- {
- httpEquiv = attr.getNodeValue();
- }
- else if ("content".equalsIgnoreCase(attrName))
- {
- content = attr;
- }
- }
- if ("Content-Type".equalsIgnoreCase(httpEquiv))
- {
- meta = ctx;
- metaContent = content;
- break;
- }
- }
- }
- if (meta == null)
- {
- meta = doc.createElement("meta");
- // Insert first
- Node first = head.getFirstChild();
- if (first == null)
- {
- head.appendChild(meta);
- }
- else
- {
- head.insertBefore(meta, first);
- }
- Node metaHttpEquiv = doc.createAttribute("http-equiv");
- meta.getAttributes().setNamedItem(metaHttpEquiv);
- metaHttpEquiv.setNodeValue("Content-Type");
- }
- if (metaContent == null)
- {
- metaContent = doc.createAttribute("content");
- meta.getAttributes().setNamedItem(metaContent);
- }
- metaContent.setNodeValue(contentType);
- // phew
- }
- children = node.getFirstChild();
- if (children != null)
- {
- serialize(children, out, convertToCdata);
- }
- break;
- case Node.DOCUMENT_TYPE_NODE:
- DocumentType doctype = (DocumentType) node;
- out.write(BRA);
- out.write(BANG);
- value = doctype.getNodeName();
- out.write(encodeText(value));
- String publicId = doctype.getPublicId();
- if (publicId != null)
- {
- out.write(encodeText(" PUBLIC "));
- out.write(APOS);
- out.write(encodeText(publicId));
- out.write(APOS);
- }
- String systemId = doctype.getSystemId();
- if (systemId != null)
- {
- out.write(encodeText(" SYSTEM "));
- out.write(APOS);
- out.write(encodeText(systemId));
- out.write(APOS);
- }
- String internalSubset = doctype.getInternalSubset();
- if (internalSubset != null)
- {
- out.write(encodeText(internalSubset));
- }
- out.write(KET);
- out.write(eol.getBytes(encoding));
- break;
- case Node.ENTITY_REFERENCE_NODE:
- value = "&" + node.getNodeValue() + ";";
- out.write(encodeText(value));
- break;
- case Node.PROCESSING_INSTRUCTION_NODE:
- value = "<?" + node.getNodeName() + " " + node.getNodeValue() + "?>";
- out.write(encodeText(value));
- Node pp = node.getParentNode();
- if (pp != null && pp.getNodeType() == Node.DOCUMENT_NODE)
- {
- out.write(encodeText(eol));
- }
- break;
- }
- if (defined)
- {
- undefine(uri);
- }
- if (next != null)
- {
- serialize(next, out, convertToCdata);
- }
- }
-
- boolean isDefined(String uri)
- {
- return XMLConstants.XML_NS_URI.equals(uri) ||
- XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri) ||
- namespaces.containsKey(uri);
- }
-
- String define(String uri, String prefix)
- {
- while (namespaces.containsValue(prefix))
- {
- // Fabricate new prefix
- prefix = prefix + "_";
- }
- namespaces.put(uri, prefix);
- return prefix;
- }
-
- void undefine(String uri)
- {
- namespaces.remove(uri);
- }
-
- final byte[] encodeText(String text)
- throws UnsupportedEncodingException
- {
- if (compatibilityMode)
- {
- int len = text.length();
- StringBuffer buf = null;
- for (int i = 0; i < len; i++)
- {
- char c = text.charAt(i);
- if (c >= 127)
- {
- if (buf == null)
- {
- buf = new StringBuffer(text.substring(0, i));
- }
- buf.append('&');
- buf.append('#');
- buf.append((int) c);
- buf.append(';');
- }
- else if (buf != null)
- {
- buf.append(c);
- }
- }
- if (buf != null)
- {
- text = buf.toString();
- }
- }
- return text.getBytes(encoding);
- }
-
- String encode(String text, boolean encodeCtl, boolean inAttr)
- {
- int len = text.length();
- StringBuffer buf = null;
- for (int i = 0; i < len; i++)
- {
- char c = text.charAt(i);
- if (c == '<')
- {
- if (buf == null)
- {
- buf = new StringBuffer(text.substring(0, i));
- }
- buf.append("&lt;");
- }
- else if (c == '>')
- {
- if (buf == null)
- {
- buf = new StringBuffer(text.substring(0, i));
- }
- buf.append("&gt;");
- }
- else if (c == '&')
- {
- if (mode == Stylesheet.OUTPUT_HTML && (i + 1) < len &&
- text.charAt(i + 1) == '{')
- {
- if (buf != null)
- {
- buf.append(c);
- }
- }
- else
- {
- if (buf == null)
- {
- buf = new StringBuffer(text.substring(0, i));
- }
- buf.append("&amp;");
- }
- }
- else if (c == '\'' && inAttr)
- {
- if (buf == null)
- {
- buf = new StringBuffer(text.substring(0, i));
- }
- buf.append("&apos;");
- }
- else if (c == '"' && inAttr)
- {
- if (buf == null)
- {
- buf = new StringBuffer(text.substring(0, i));
- }
- buf.append("&quot;");
- }
- else if (encodeCtl)
- {
- if (c < 0x20)
- {
- if (buf == null)
- {
- buf = new StringBuffer(text.substring(0, i));
- }
- buf.append('&');
- buf.append('#');
- buf.append((int) c);
- buf.append(';');
- }
- else if (buf != null)
- {
- buf.append(c);
- }
- }
- else if (buf != null)
- {
- buf.append(c);
- }
- }
- return (buf == null) ? text : buf.toString();
- }
-
- String toString(Node node)
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- try
- {
- serialize(node, out);
- return new String(out.toByteArray(), encoding);
- }
- catch (IOException e)
- {
- throw new RuntimeException(e.getMessage());
- }
- }
-
-}
diff --git a/libjava/gnu/xml/transform/Stylesheet.java b/libjava/gnu/xml/transform/Stylesheet.java
deleted file mode 100644
index 5efd5ca3e3e..00000000000
--- a/libjava/gnu/xml/transform/Stylesheet.java
+++ /dev/null
@@ -1,1728 +0,0 @@
-/* Stylesheet.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.TreeSet;
-import javax.xml.XMLConstants;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionResolver;
-import javax.xml.xpath.XPathExpressionException;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.w3c.dom.UserDataHandler;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.NameTest;
-import gnu.xml.xpath.NodeTypeTest;
-import gnu.xml.xpath.Pattern;
-import gnu.xml.xpath.Selector;
-import gnu.xml.xpath.Root;
-import gnu.xml.xpath.Test;
-import gnu.xml.xpath.XPathImpl;
-
-/**
- * An XSL stylesheet.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class Stylesheet
- implements NamespaceContext, XPathFunctionResolver, UserDataHandler, Cloneable
-{
-
- static final String XSL_NS = "http://www.w3.org/1999/XSL/Transform";
-
- static final int OUTPUT_XML = 0;
- static final int OUTPUT_HTML = 1;
- static final int OUTPUT_TEXT = 2;
-
- final TransformerFactoryImpl factory;
- TransformerImpl transformer;
- Stylesheet parent;
- final XPathImpl xpath;
- final String systemId;
- final int precedence;
-
- final boolean debug;
-
- /**
- * Version of XSLT.
- */
- String version;
-
- Collection extensionElementPrefixes;
- Collection excludeResultPrefixes;
-
- /**
- * Set of element names for which we should strip whitespace.
- */
- Set stripSpace;
-
- /**
- * Set of element names for which we should preserve whitespace.
- */
- Set preserveSpace;
-
- /**
- * Output options.
- */
- int outputMethod;
- String outputVersion;
- String outputEncoding;
- boolean outputOmitXmlDeclaration;
- boolean outputStandalone;
- String outputPublicId;
- String outputSystemId;
- Collection outputCdataSectionElements;
- boolean outputIndent;
- String outputMediaType;
-
- /**
- * Keys.
- */
- Collection keys;
-
- /**
- * Decimal formats.
- */
- Map decimalFormats;
-
- /**
- * Namespace aliases.
- */
- Map namespaceAliases;
-
- /**
- * Attribute-sets.
- */
- List attributeSets;
-
- /**
- * Variables.
- */
- List variables;
-
- /**
- * Variable and parameter bindings.
- */
- Bindings bindings;
-
- /**
- * Templates.
- */
- LinkedList templates;
-
- TemplateNode builtInNodeTemplate;
- TemplateNode builtInTextTemplate;
-
- /**
- * Holds the current node while parsing.
- * Necessary to associate the document function with its declaring node,
- * to resolve namespaces, and to maintain the current node for the
- * current() function.
- */
- Node current;
-
- /**
- * Set by a terminating message.
- */
- transient boolean terminated;
-
- /**
- * Current template in force.
- */
- transient Template currentTemplate;
-
- Stylesheet(TransformerFactoryImpl factory,
- Stylesheet parent,
- Document doc,
- String systemId,
- int precedence)
- throws TransformerConfigurationException
- {
- this.factory = factory;
- this.systemId = systemId;
- this.precedence = precedence;
- this.parent = parent;
- extensionElementPrefixes = new HashSet();
- excludeResultPrefixes = new HashSet();
- stripSpace = new LinkedHashSet();
- preserveSpace = new LinkedHashSet();
- outputCdataSectionElements = new LinkedHashSet();
- xpath = (XPathImpl) factory.xpathFactory.newXPath();
- if (parent == null)
- {
- bindings = new Bindings(this);
- attributeSets = new LinkedList();
- variables = new LinkedList();
- namespaceAliases = new LinkedHashMap();
- templates = new LinkedList();
- keys = new LinkedList();
- decimalFormats = new LinkedHashMap();
- initDefaultDecimalFormat();
- xpath.setNamespaceContext(this);
- xpath.setXPathFunctionResolver(this);
- }
- else
- {
- /* Test for import circularity */
- for (Stylesheet ctx = this; ctx.parent != null; ctx = ctx.parent)
- {
- if (systemId != null && systemId.equals(ctx.parent.systemId))
- {
- String msg = "circularity importing " + systemId;
- throw new TransformerConfigurationException(msg);
- }
- }
- /* OK */
- Stylesheet root = getRootStylesheet();
- bindings = root.bindings;
- attributeSets = root.attributeSets;
- variables = root.variables;
- namespaceAliases = root.namespaceAliases;
- templates = root.templates;
- keys = root.keys;
- decimalFormats = root.decimalFormats;
- xpath.setNamespaceContext(root);
- xpath.setXPathFunctionResolver(root);
- }
- xpath.setXPathVariableResolver(bindings);
-
- Test anyNode = new NodeTypeTest((short) 0);
- List tests = Collections.singletonList(anyNode);
- builtInNodeTemplate =
- new ApplyTemplatesNode(null, null,
- new Selector(Selector.CHILD, tests),
- null, null, null, true);
- builtInTextTemplate =
- new ValueOfNode(null, null,
- new Selector(Selector.SELF, tests),
- false);
-
- parse(doc.getDocumentElement(), true);
- current = doc; // Alow namespace resolution during processing
-
- debug = ("yes".equals(System.getProperty("xsl.debug")));
-
- if (debug)
- {
- System.err.println("Stylesheet: " + doc.getDocumentURI());
- for (Iterator i = templates.iterator(); i.hasNext(); )
- {
- Template t = (Template) i.next();
- t.list(System.err);
- System.err.println("--------------------");
- }
- }
- }
-
- Stylesheet getRootStylesheet()
- {
- Stylesheet stylesheet = this;
- while (stylesheet.parent != null)
- {
- stylesheet = stylesheet.parent;
- }
- return stylesheet;
- }
-
- void initDefaultDecimalFormat()
- {
- DecimalFormat defaultDecimalFormat = new DecimalFormat();
- DecimalFormatSymbols symbols = new DecimalFormatSymbols();
- symbols.setDecimalSeparator('.');
- symbols.setGroupingSeparator(',');
- symbols.setPercent('%');
- symbols.setPerMill('\u2030');
- symbols.setZeroDigit('0');
- symbols.setDigit('#');
- symbols.setPatternSeparator(';');
- symbols.setInfinity("Infinity");
- symbols.setNaN("NaN");
- symbols.setMinusSign('-');
- defaultDecimalFormat.setDecimalFormatSymbols(symbols);
- decimalFormats.put(null, defaultDecimalFormat);
- }
-
- // -- Cloneable --
-
- public Object clone()
- {
- try
- {
- Stylesheet clone = (Stylesheet) super.clone();
- clone.bindings = (Bindings) bindings.clone();
-
- LinkedList templates2 = new LinkedList();
- for (Iterator i = templates.iterator(); i.hasNext(); )
- {
- Template t = (Template) i.next();
- templates2.add(t.clone(clone));
- }
- clone.templates = templates2;
-
- LinkedList attributeSets2 = new LinkedList();
- for (Iterator i = attributeSets.iterator(); i.hasNext(); )
- {
- AttributeSet as = (AttributeSet) i.next();
- attributeSets2.add(as.clone(clone));
- }
- clone.attributeSets = attributeSets2;
-
- LinkedList variables2 = new LinkedList();
- for (Iterator i = variables.iterator(); i.hasNext(); )
- {
- ParameterNode var = (ParameterNode) i.next();
- variables2.add(var.clone(clone));
- }
- clone.variables = variables2;
-
- LinkedList keys2 = new LinkedList();
- for (Iterator i = keys.iterator(); i.hasNext(); )
- {
- Key k = (Key) i.next();
- keys2.add(k.clone(clone));
- }
- clone.keys = keys2;
-
- return clone;
- }
- catch (CloneNotSupportedException e)
- {
- throw new Error(e.getMessage());
- }
- }
-
- // -- Variable evaluation --
-
- void initTopLevelVariables(Node context)
- throws TransformerException
- {
- for (Iterator i = variables.iterator(); i.hasNext(); )
- {
- ParameterNode var = (ParameterNode) i.next();
- bindings.set(var.name,
- var.getValue(this, null, context, 1, 1),
- var.global);
- }
- }
-
- // -- NamespaceContext --
-
- public String getNamespaceURI(String prefix)
- {
- return (current == null) ? null : current.lookupNamespaceURI(prefix);
- }
-
- public String getPrefix(String namespaceURI)
- {
- return (current == null) ? null : current.lookupPrefix(namespaceURI);
- }
-
- public Iterator getPrefixes(String namespaceURI)
- {
- // TODO
- return Collections.singleton(getPrefix(namespaceURI)).iterator();
- }
-
- // -- Template selection --
-
- TemplateNode getTemplate(QName mode, Node context, boolean applyImports)
- throws TransformerException
- {
- //System.err.println("getTemplate: mode="+mode+" context="+context);
- Set candidates = new TreeSet();
- for (Iterator j = templates.iterator(); j.hasNext(); )
- {
- Template t = (Template) j.next();
- boolean isMatch = t.matches(mode, context);
- if (applyImports)
- {
- if (currentTemplate == null)
- {
- String msg = "current template may not be null " +
- "during apply-imports";
- throw new TransformerException(msg);
- }
- if (!currentTemplate.imports(t))
- {
- isMatch = false;
- }
- }
- //System.err.println("\t"+context+" "+t+"="+isMatch);
- if (isMatch)
- {
- candidates.add(t);
- }
- }
- //System.err.println("\tcandidates="+candidates);
- if (candidates.isEmpty())
- {
- // Apply built-in template
- // Current template is unchanged
- //System.err.println("\tbuiltInTemplate context="+context);
- switch (context.getNodeType())
- {
- case Node.ELEMENT_NODE:
- case Node.DOCUMENT_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.PROCESSING_INSTRUCTION_NODE:
- case Node.COMMENT_NODE:
- return builtInNodeTemplate;
- case Node.TEXT_NODE:
- case Node.ATTRIBUTE_NODE:
- return builtInTextTemplate;
- default:
- return null;
- }
- }
- else
- {
- Template t = (Template) candidates.iterator().next();
- // Set current template
- currentTemplate = t;
- //System.err.println("\ttemplate="+t+" context="+context);
- return t.node;
- }
- }
-
- TemplateNode getTemplate(QName mode, QName name)
- throws TransformerException
- {
- //System.err.println("getTemplate: mode="+mode+" name="+name);
- Set candidates = new TreeSet();
- for (Iterator j = templates.iterator(); j.hasNext(); )
- {
- Template t = (Template) j.next();
- boolean isMatch = t.matches(name);
- //System.err.println("\t"+name+" "+t+"="+isMatch);
- if (isMatch)
- {
- candidates.add(t);
- }
- }
- if (candidates.isEmpty())
- {
- return null;
- //throw new TransformerException("template '" + name + "' not found");
- }
- Template t = (Template) candidates.iterator().next();
- //System.err.println("\ttemplate="+t+" context="+context);
- return t.node;
- }
-
- /**
- * template
- */
- final Template parseTemplate(Node node, NamedNodeMap attrs)
- throws TransformerConfigurationException, XPathExpressionException
- {
- String n = getAttribute(attrs, "name");
- QName name = (n == null) ? null : getQName(n);
- String m = getAttribute(attrs, "match");
- Pattern match = null;
- if (m != null)
- {
- try
- {
- match = (Pattern) xpath.compile(m);
- }
- catch (ClassCastException e)
- {
- String msg = "illegal pattern: " + m;
- throw new TransformerConfigurationException(msg);
- }
- }
- String p = getAttribute(attrs, "priority");
- String mm = getAttribute(attrs, "mode");
- QName mode = (mm == null) ? null : getQName(mm);
- double priority = (p == null) ? Template.DEFAULT_PRIORITY :
- Double.parseDouble(p);
- return new Template(this, name, match, parse(node.getFirstChild()),
- precedence, priority, mode);
- }
-
- /**
- * output
- */
- final void parseOutput(Node node, NamedNodeMap attrs)
- throws TransformerConfigurationException
- {
- String method = getAttribute(attrs, "method");
- if ("xml".equals(method) || method == null)
- {
- outputMethod = OUTPUT_XML;
- }
- else if ("html".equals(method))
- {
- outputMethod = OUTPUT_HTML;
- }
- else if ("text".equals(method))
- {
- outputMethod = OUTPUT_TEXT;
- }
- else
- {
- String msg = "unsupported output method: " + method;
- DOMSourceLocator l = new DOMSourceLocator(node);
- throw new TransformerConfigurationException(msg, l);
- }
- outputPublicId = getAttribute(attrs, "public-id");
- outputSystemId = getAttribute(attrs, "system-id");
- outputEncoding = getAttribute(attrs, "encoding");
- String indent = getAttribute(attrs, "indent");
- if (indent != null)
- {
- outputIndent = "yes".equals(indent);
- }
- outputVersion = getAttribute(attrs, "version");
- String omitXmlDecl = getAttribute(attrs, "omit-xml-declaration");
- if (omitXmlDecl != null)
- {
- outputOmitXmlDeclaration = "yes".equals(omitXmlDecl);
- }
- String standalone = getAttribute(attrs, "standalone");
- if (standalone != null)
- {
- outputStandalone = "yes".equals(standalone);
- }
- outputMediaType = getAttribute(attrs, "media-type");
- String cdataSectionElements =
- getAttribute(attrs, "cdata-section-elements");
- if (cdataSectionElements != null)
- {
- StringTokenizer st = new StringTokenizer(cdataSectionElements, " ");
- while (st.hasMoreTokens())
- {
- outputCdataSectionElements.add(st.nextToken());
- }
- }
- }
-
- /**
- * key
- */
- final void parseKey(Node node, NamedNodeMap attrs)
- throws TransformerConfigurationException, XPathExpressionException
- {
- String n = getRequiredAttribute(attrs, "name", node);
- String m = getRequiredAttribute(attrs, "match", node);
- String u = getRequiredAttribute(attrs, "use", node);
- QName name = getQName(n);
- Expr use = (Expr) xpath.compile(u);
- try
- {
- Pattern match = (Pattern) xpath.compile(m);
- Key key = new Key(name, match, use);
- keys.add(key);
- }
- catch (ClassCastException e)
- {
- throw new TransformerConfigurationException("invalid pattern: " + m);
- }
- }
-
- /**
- * decimal-format
- */
- final void parseDecimalFormat(Node node, NamedNodeMap attrs)
- throws TransformerConfigurationException
- {
- String dfName = getAttribute(attrs, "name");
- DecimalFormat df = new DecimalFormat();
- DecimalFormatSymbols symbols = new DecimalFormatSymbols();
- symbols.setDecimalSeparator(parseDFChar(attrs, "decimal-separator", '.'));
- symbols.setGroupingSeparator(parseDFChar(attrs, "grouping-separator", ','));
- symbols.setInfinity(parseDFString(attrs, "infinity", "Infinity"));
- symbols.setMinusSign(parseDFChar(attrs, "minus-sign", '-'));
- symbols.setNaN(parseDFString(attrs, "NaN", "NaN"));
- symbols.setPercent(parseDFChar(attrs, "percent", '%'));
- symbols.setPerMill(parseDFChar(attrs, "per-mille", '\u2030'));
- symbols.setZeroDigit(parseDFChar(attrs, "zero-digit", '0'));
- symbols.setDigit(parseDFChar(attrs, "digit", '#'));
- symbols.setPatternSeparator(parseDFChar(attrs, "pattern-separator", ';'));
- df.setDecimalFormatSymbols(symbols);
- decimalFormats.put(dfName, df);
- }
-
- private final char parseDFChar(NamedNodeMap attrs, String name, char def)
- throws TransformerConfigurationException
- {
- Node attr = attrs.getNamedItem(name);
- try
- {
- return (attr == null) ? def : attr.getNodeValue().charAt(0);
- }
- catch (StringIndexOutOfBoundsException e)
- {
- throw new TransformerConfigurationException("empty attribute '" +
- name +
- "' in decimal-format", e);
- }
- }
-
- private final String parseDFString(NamedNodeMap attrs, String name,
- String def)
- {
- Node attr = attrs.getNamedItem(name);
- return (attr == null) ? def : attr.getNodeValue();
- }
-
- /**
- * namespace-alias
- */
- final void parseNamespaceAlias(Node node, NamedNodeMap attrs)
- throws TransformerConfigurationException
- {
- String sp = getRequiredAttribute(attrs, "stylesheet-prefix", node);
- String rp = getRequiredAttribute(attrs, "result-prefix", node);
- namespaceAliases.put(sp, rp);
- }
-
- /**
- * attribute-set
- */
- final void parseAttributeSet(Node node, NamedNodeMap attrs)
- throws TransformerConfigurationException, XPathExpressionException
- {
- TemplateNode children = parse(node.getFirstChild());
- String name = getRequiredAttribute(attrs, "name", node);
- String uas = getAttribute(attrs, "use-attribute-sets");
- attributeSets.add(new AttributeSet(children, name, uas));
- }
-
- /**
- * Parse top-level elements.
- */
- void parse(Node node, boolean root)
- throws TransformerConfigurationException
- {
- if (node == null)
- {
- return;
- }
- current = node;
- try
- {
- String namespaceUri = node.getNamespaceURI();
- if (XSL_NS.equals(namespaceUri) &&
- node.getNodeType() == Node.ELEMENT_NODE)
- {
- String name = node.getLocalName();
- NamedNodeMap attrs = node.getAttributes();
- if ("stylesheet".equals(name))
- {
- version = getAttribute(attrs, "version");
- String eep = getAttribute(attrs, "extension-element-prefixes");
- if (eep != null)
- {
- StringTokenizer st = new StringTokenizer(eep);
- while (st.hasMoreTokens())
- {
- extensionElementPrefixes.add(st.nextToken());
- }
- }
- String erp = getAttribute(attrs, "exclude-result-prefixes");
- if (erp != null)
- {
- StringTokenizer st = new StringTokenizer(erp);
- while (st.hasMoreTokens())
- {
- excludeResultPrefixes.add(st.nextToken());
- }
- }
- parse(node.getFirstChild(), false);
- return;
- }
- else if ("template".equals(name))
- {
- templates.addFirst(parseTemplate(node, attrs));
- }
- else if ("param".equals(name) ||
- "variable".equals(name))
- {
- boolean global = "variable".equals(name);
- TemplateNode content = parse(node.getFirstChild());
- String paramName = getRequiredAttribute(attrs, "name", node);
- String select = getAttribute(attrs, "select");
- if (select != null && select.length() > 0)
- {
- if (content != null)
- {
- String msg = "parameter '" + paramName +
- "' has both select and content";
- DOMSourceLocator l = new DOMSourceLocator(node);
- throw new TransformerConfigurationException(msg, l);
- }
- Expr expr = (Expr) xpath.compile(select);
- variables.add(new ParameterNode(null, null,
- paramName,
- expr, global));
- }
- else
- {
- variables.add(new ParameterNode(content, null,
- paramName,
- null, global));
- }
- bindings.set(paramName, content, global);
- }
- else if ("include".equals(name) || "import".equals(name))
- {
- int delta = "import".equals(name) ? -1 : 0;
- String href = getRequiredAttribute(attrs, "href", node);
- Source source;
- synchronized (factory.resolver)
- {
- if (transformer != null)
- {
- factory.resolver
- .setUserResolver(transformer.getURIResolver());
- factory.resolver
- .setUserListener(transformer.getErrorListener());
- }
- source = factory.resolver.resolve(systemId, href);
- }
- factory.newStylesheet(source, precedence + delta, this);
- }
- else if ("output".equals(name))
- {
- parseOutput(node, attrs);
- }
- else if ("preserve-space".equals(name))
- {
- String elements =
- getRequiredAttribute(attrs, "elements", node);
- StringTokenizer st = new StringTokenizer(elements,
- " \t\n\r");
- while (st.hasMoreTokens())
- {
- preserveSpace.add(parseNameTest(st.nextToken()));
- }
- }
- else if ("strip-space".equals(name))
- {
- String elements =
- getRequiredAttribute(attrs, "elements", node);
- StringTokenizer st = new StringTokenizer(elements,
- " \t\n\r");
- while (st.hasMoreTokens())
- {
- stripSpace.add(parseNameTest(st.nextToken()));
- }
- }
- else if ("key".equals(name))
- {
- parseKey(node, attrs);
- }
- else if ("decimal-format".equals(name))
- {
- parseDecimalFormat(node, attrs);
- }
- else if ("namespace-alias".equals(name))
- {
- parseNamespaceAlias(node, attrs);
- }
- else if ("attribute-set".equals(name))
- {
- parseAttributeSet(node, attrs);
- }
- parse(node.getNextSibling(), false);
- }
- else if (root)
- {
- // Literal document element
- Attr versionNode =
- ((Element)node).getAttributeNodeNS(XSL_NS, "version");
- if (versionNode == null)
- {
- String msg = "no xsl:version attribute on literal result node";
- DOMSourceLocator l = new DOMSourceLocator(node);
- throw new TransformerConfigurationException(msg, l);
- }
- version = versionNode.getValue();
- Node rootClone = node.cloneNode(true);
- NamedNodeMap attrs = rootClone.getAttributes();
- attrs.removeNamedItemNS(XSL_NS, "version");
- templates.add(new Template(this, null, new Root(),
- parse(rootClone),
- precedence,
- Template.DEFAULT_PRIORITY,
- null));
- }
- else
- {
- // Skip unknown elements, text, comments, etc
- parse(node.getNextSibling(), false);
- }
- }
- catch (TransformerException e)
- {
- DOMSourceLocator l = new DOMSourceLocator(node);
- throw new TransformerConfigurationException(e.getMessage(), l, e);
- }
- catch (DOMException e)
- {
- DOMSourceLocator l = new DOMSourceLocator(node);
- throw new TransformerConfigurationException(e.getMessage(), l, e);
- }
- catch (XPathExpressionException e)
- {
- DOMSourceLocator l = new DOMSourceLocator(node);
- throw new TransformerConfigurationException(e.getMessage(), l, e);
- }
- }
-
- final NameTest parseNameTest(String token)
- {
- if ("*".equals(token))
- {
- return new NameTest(null, true, true);
- }
- else if (token.endsWith(":*"))
- {
- QName qName = getQName(token.substring(0, token.length() - 2));
- return new NameTest(qName, true, false);
- }
- else
- {
- QName qName = getQName(token);
- return new NameTest(qName, false, false);
- }
- }
-
- final QName getQName(String name)
- {
- QName qName = QName.valueOf(name);
- String prefix = qName.getPrefix();
- String uri = qName.getNamespaceURI();
- if (prefix != null && (uri == null || uri.length() == 0))
- {
- uri = getNamespaceURI(prefix);
- String localName = qName.getLocalPart();
- qName = new QName(uri, localName, prefix);
- }
- return qName;
- }
-
- final TemplateNode parseAttributeValueTemplate(String value, Node source)
- throws TransformerConfigurationException, XPathExpressionException
- {
- current = source;
- // Tokenize
- int len = value.length();
- int off = 0;
- List tokens = new ArrayList(); // text tokens
- List types = new ArrayList(); // literal or expression
- int depth = 0;
- for (int i = 0; i < len; i++)
- {
- char c = value.charAt(i);
- if (c == '{')
- {
- if (i < (len - 1) && value.charAt(i + 1) == '{')
- {
- tokens.add(value.substring(off, i + 1));
- types.add(Boolean.FALSE);
- i++;
- off = i + 1;
- continue;
- }
- if (depth == 0)
- {
- if (i - off > 0)
- {
- tokens.add(value.substring(off, i));
- types.add(Boolean.FALSE);
- }
- off = i + 1;
- }
- depth++;
- }
- else if (c == '}')
- {
- if (i < (len - 1) && value.charAt(i + 1) == '}')
- {
- tokens.add(value.substring(off, i + 1));
- types.add(Boolean.FALSE);
- i++;
- off = i + 1;
- continue;
- }
- if (depth == 1)
- {
- if (i - off > 0)
- {
- tokens.add(value.substring(off, i));
- types.add(Boolean.TRUE);
- }
- else
- {
- String msg = "attribute value template " +
- "must contain expression: " + value;
- DOMSourceLocator l = new DOMSourceLocator(source);
- throw new TransformerConfigurationException(msg, l);
- }
- off = i + 1;
- }
- depth--;
- }
- }
- if (depth > 0)
- {
- String msg = "invalid attribute value template: " + value;
- throw new TransformerConfigurationException(msg);
- }
- if (len - off > 0)
- {
- // Trailing text
- tokens.add(value.substring(off));
- types.add(Boolean.FALSE);
- }
-
- // Construct template node tree
- TemplateNode ret = null;
- Document doc = source.getOwnerDocument();
- len = tokens.size();
- for (int i = len - 1; i >= 0; i--)
- {
- String token = (String) tokens.get(i);
- Boolean type = (Boolean) types.get(i);
- if (type == Boolean.TRUE)
- {
- // Expression text
- Expr select = (Expr) xpath.compile(token);
- ret = new ValueOfNode(null, ret, select, false);
- }
- else
- {
- // Verbatim text
- ret = new LiteralNode(null, ret, doc.createTextNode(token));
- }
- }
- return ret;
- }
-
- boolean isPreserved(Text text)
- throws TransformerConfigurationException
- {
- // Check characters in text
- String value = text.getData();
- if (value != null)
- {
- int len = value.length();
- for (int i = 0; i < len; i++)
- {
- char c = value.charAt(i);
- if (c != 0x20 && c != 0x09 && c != 0x0a && c != 0x0d)
- {
- return true;
- }
- }
- }
- // Check parent node
- Node ctx = text.getParentNode();
- if (!preserveSpace.isEmpty())
- {
- for (Iterator i = preserveSpace.iterator(); i.hasNext(); )
- {
- NameTest preserveTest = (NameTest) i.next();
- if (preserveTest.matches(ctx, 1, 1))
- {
- boolean override = false;
- if (!stripSpace.isEmpty())
- {
- for (Iterator j = stripSpace.iterator(); j.hasNext(); )
- {
- NameTest stripTest = (NameTest) j.next();
- if (stripTest.matches(ctx, 1, 1))
- {
- override = true;
- break;
- }
- }
- }
- if (!override)
- {
- return true;
- }
- }
- }
- }
- // Check whether any ancestor specified xml:space
- while (ctx != null)
- {
- if (ctx.getNodeType() == Node.ELEMENT_NODE)
- {
- Element element = (Element) ctx;
- String xmlSpace = element.getAttribute("xml:space");
- if ("default".equals(xmlSpace))
- {
- break;
- }
- else if ("preserve".equals(xmlSpace))
- {
- return true;
- }
- else if (xmlSpace.length() > 0)
- {
- String msg = "Illegal value for xml:space: " + xmlSpace;
- throw new TransformerConfigurationException(msg);
- }
- else if ("text".equals(ctx.getLocalName()) &&
- XSL_NS.equals(ctx.getNamespaceURI()))
- {
- // xsl:text implies xml:space='preserve'
- return true;
- }
- }
- ctx = ctx.getParentNode();
- }
- return false;
- }
-
- public XPathFunction resolveFunction(QName name, int arity)
- {
- String uri = name.getNamespaceURI();
- if (XSL_NS.equals(uri) || uri == null || uri.length() == 0)
- {
- String localName = name.getLocalPart();
- if ("document".equals(localName) && (arity == 1 || arity == 2))
- {
- if (current == null)
- {
- throw new RuntimeException("current is null");
- }
- return new DocumentFunction(getRootStylesheet(), current);
- }
- else if ("key".equals(localName) && (arity == 2))
- {
- return new KeyFunction(getRootStylesheet());
- }
- else if ("format-number".equals(localName) &&
- (arity == 2 || arity == 3))
- {
- return new FormatNumberFunction(getRootStylesheet());
- }
- else if ("current".equals(localName) && (arity == 0))
- {
- return new CurrentFunction(getRootStylesheet());
- }
- else if ("unparsed-entity-uri".equals(localName) && (arity == 1))
- {
- return new UnparsedEntityUriFunction();
- }
- else if ("generate-id".equals(localName) &&
- (arity == 1 || arity == 0))
- {
- return new GenerateIdFunction();
- }
- else if ("system-property".equals(localName) && (arity == 1))
- {
- return new SystemPropertyFunction();
- }
- else if ("element-available".equals(localName) && (arity == 1))
- {
- return new ElementAvailableFunction(this);
- }
- else if ("function-available".equals(localName) && (arity == 1))
- {
- return new FunctionAvailableFunction(this);
- }
- }
- return null;
- }
-
- // -- Parsing --
-
- /**
- * apply-templates
- */
- final TemplateNode parseApplyTemplates(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String m = getAttribute(attrs, "mode");
- QName mode = (m == null) ? null : getQName(m);
- String s = getAttribute(attrs, "select");
- if (s == null)
- {
- s = "child::node()";
- }
- List sortKeys = parseSortKeys(children);
- List withParams = parseWithParams(children);
- Expr select = (Expr) xpath.compile(s);
- return new ApplyTemplatesNode(null, parse(next),
- select, mode,
- sortKeys, withParams, false);
- }
-
- /**
- * call-template
- */
- final TemplateNode parseCallTemplate(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String n = getRequiredAttribute(attrs, "name", node);
- QName name = getQName(n);
- List withParams = parseWithParams(children);
- return new CallTemplateNode(null, parse(next), name,
- withParams);
- }
-
- /**
- * value-of
- */
- final TemplateNode parseValueOf(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String s = getRequiredAttribute(attrs, "select", node);
- String doe = getAttribute(attrs, "disable-output-escaping");
- boolean d = "yes".equals(doe);
- Expr select = (Expr) xpath.compile(s);
- return new ValueOfNode(null, parse(next), select, d);
- }
-
- /**
- * for-each
- */
- final TemplateNode parseForEach(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String s = getRequiredAttribute(attrs, "select", node);
- List sortKeys = parseSortKeys(children);
- Expr select = (Expr) xpath.compile(s);
- return new ForEachNode(parse(children), parse(next), select, sortKeys);
- }
-
- /**
- * if
- */
- final TemplateNode parseIf(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String t = getRequiredAttribute(attrs, "test", node);
- Expr test = (Expr) xpath.compile(t);
- return new IfNode(parse(children), parse(next), test);
- }
-
- /**
- * when
- */
- final TemplateNode parseWhen(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String t = getRequiredAttribute(attrs, "test", node);
- Expr test = (Expr) xpath.compile(t);
- return new WhenNode(parse(children), parse(next), test);
- }
-
- /**
- * element
- */
- final TemplateNode parseElement(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String name = getRequiredAttribute(attrs, "name", node);
- String namespace = getAttribute(attrs, "namespace");
- String uas = getAttribute(attrs, "use-attribute-sets");
- TemplateNode n = parseAttributeValueTemplate(name, node);
- TemplateNode ns = (namespace == null) ? null :
- parseAttributeValueTemplate(namespace, node);
- return new ElementNode(parse(children), parse(next), n, ns, uas, node);
- }
-
- /**
- * attribute
- */
- final TemplateNode parseAttribute(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String name = getRequiredAttribute(attrs, "name", node);
- String namespace = getAttribute(attrs, "namespace");
- TemplateNode n = parseAttributeValueTemplate(name, node);
- TemplateNode ns = (namespace == null) ? null :
- parseAttributeValueTemplate(namespace, node);
- return new AttributeNode(parse(children), parse(next), n, ns, node);
- }
-
- /**
- * text
- */
- final TemplateNode parseText(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String doe = getAttribute(attrs, "disable-output-escaping");
- boolean d = "yes".equals(doe);
- return new TextNode(parse(children), parse(next), d);
- }
-
- /**
- * copy
- */
- final TemplateNode parseCopy(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String uas = getAttribute(attrs, "use-attribute-sets");
- return new CopyNode(parse(children), parse(next), uas);
- }
-
- /**
- * processing-instruction
- */
- final TemplateNode parseProcessingInstruction(Node node, Node children,
- Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String name = getRequiredAttribute(attrs, "name", node);
- return new ProcessingInstructionNode(parse(children),
- parse(next), name);
- }
-
- /**
- * number
- */
- final TemplateNode parseNumber(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String v = getAttribute(attrs, "value");
- String ff = getAttribute(attrs, "format");
- if (ff == null)
- {
- ff = "1";
- }
- TemplateNode format = parseAttributeValueTemplate(ff, node);
- String lang = getAttribute(attrs, "lang");
- String lv = getAttribute(attrs, "letter-value");
- int letterValue = "traditional".equals(lv) ?
- AbstractNumberNode.TRADITIONAL :
- AbstractNumberNode.ALPHABETIC;
- String gs = getAttribute(attrs, "grouping-separator");
- String gz = getAttribute(attrs, "grouping-size");
- int gz2 = (gz != null && gz.length() > 0) ?
- Integer.parseInt(gz) : 1;
- if (v != null && v.length() > 0)
- {
- Expr value = (Expr) xpath.compile(v);
- return new NumberNode(parse(children), parse(next),
- value, format, lang,
- letterValue, gs, gz2);
- }
- else
- {
- String l = getAttribute(attrs, "level");
- int level =
- "multiple".equals(l) ? NodeNumberNode.MULTIPLE :
- "any".equals(l) ? NodeNumberNode.ANY :
- NodeNumberNode.SINGLE;
- String c = getAttribute(attrs, "count");
- String f = getAttribute(attrs, "from");
- Pattern count = null;
- Pattern from = null;
- if (c != null)
- {
- try
- {
- count = (Pattern) xpath.compile(c);
- }
- catch (ClassCastException e)
- {
- String msg = "invalid pattern: " + c;
- throw new TransformerConfigurationException(msg);
- }
- }
- if (f != null)
- {
- try
- {
- from = (Pattern) xpath.compile(f);
- }
- catch (ClassCastException e)
- {
- String msg = "invalid pattern: " + f;
- throw new TransformerConfigurationException(msg);
- }
- }
- return new NodeNumberNode(parse(children), parse(next),
- level, count, from,
- format, lang,
- letterValue, gs, gz2);
- }
- }
-
- /**
- * copy-of
- */
- final TemplateNode parseCopyOf(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String s = getRequiredAttribute(attrs, "select", node);
- Expr select = (Expr) xpath.compile(s);
- return new CopyOfNode(parse(children), parse(next), select);
- }
-
- /**
- * message
- */
- final TemplateNode parseMessage(Node node, Node children, Node next)
- throws TransformerConfigurationException, XPathExpressionException
- {
- NamedNodeMap attrs = node.getAttributes();
- String t = getAttribute(attrs, "terminate");
- boolean terminate = "yes".equals(t);
- return new MessageNode(parse(children), parse(next), terminate);
- }
-
- /**
- * Parse template-level elements.
- */
- final TemplateNode parse(Node node)
- throws TransformerConfigurationException
- {
- if (node == null)
- {
- return null;
- }
- // Hack to associate the document function with its declaring node
- current = node;
- Node children = node.getFirstChild();
- Node next = node.getNextSibling();
- try
- {
- String namespaceUri = node.getNamespaceURI();
- if (Stylesheet.XSL_NS.equals(namespaceUri) &&
- Node.ELEMENT_NODE == node.getNodeType())
- {
- String name = node.getLocalName();
- if ("apply-templates".equals(name))
- {
- return parseApplyTemplates(node, children, next);
- }
- else if ("call-template".equals(name))
- {
- return parseCallTemplate(node, children, next);
- }
- else if ("value-of".equals(name))
- {
- return parseValueOf(node, children, next);
- }
- else if ("for-each".equals(name))
- {
- return parseForEach(node, children, next);
- }
- else if ("if".equals(name))
- {
- return parseIf(node, children, next);
- }
- else if ("choose".equals(name))
- {
- return new ChooseNode(parse(children), parse(next));
- }
- else if ("when".equals(name))
- {
- return parseWhen(node, children, next);
- }
- else if ("otherwise".equals(name))
- {
- return new OtherwiseNode(parse(children), parse(next));
- }
- else if ("element".equals(name))
- {
- return parseElement(node, children, next);
- }
- else if ("attribute".equals(name))
- {
- return parseAttribute(node, children, next);
- }
- else if ("text".equals(name))
- {
- return parseText(node, children, next);
- }
- else if ("copy".equals(name))
- {
- return parseCopy(node, children, next);
- }
- else if ("processing-instruction".equals(name))
- {
- return parseProcessingInstruction(node, children, next);
- }
- else if ("comment".equals(name))
- {
- return new CommentNode(parse(children), parse(next));
- }
- else if ("number".equals(name))
- {
- return parseNumber(node, children, next);
- }
- else if ("param".equals(name) ||
- "variable".equals(name))
- {
- boolean global = "variable".equals(name);
- NamedNodeMap attrs = node.getAttributes();
- TemplateNode content = parse(children);
- String paramName = getRequiredAttribute(attrs, "name", node);
- String select = getAttribute(attrs, "select");
- if (select != null)
- {
- if (content != null)
- {
- String msg = "parameter '" + paramName +
- "' has both select and content";
- DOMSourceLocator l = new DOMSourceLocator(node);
- throw new TransformerConfigurationException(msg, l);
- }
- Expr expr = (Expr) xpath.compile(select);
- return new ParameterNode(null, parse(next),
- paramName, expr, global);
- }
- else
- {
- return new ParameterNode(content, parse(next),
- paramName, null, global);
- }
- }
- else if ("copy-of".equals(name))
- {
- return parseCopyOf(node, children, next);
- }
- else if ("message".equals(name))
- {
- return parseMessage(node, children, next);
- }
- else if ("apply-imports".equals(name))
- {
- return new ApplyImportsNode(parse(children), parse(next));
- }
- else
- {
- // xsl:fallback
- // Pass over any other XSLT nodes
- return parse(next);
- }
- }
- String prefix = node.getPrefix();
- if (extensionElementPrefixes.contains(prefix))
- {
- // Pass over extension elements
- return parse(next);
- }
- switch (node.getNodeType())
- {
- case Node.TEXT_NODE:
- // Determine whether to strip whitespace
- Text text = (Text) node;
- if (!isPreserved(text))
- {
- // Strip
- text.getParentNode().removeChild(text);
- return parse(next);
- }
- break;
- case Node.COMMENT_NODE:
- // Ignore comments
- return parse(next);
- case Node.ELEMENT_NODE:
- // Check for attribute value templates and use-attribute-sets
- NamedNodeMap attrs = node.getAttributes();
- boolean convert = false;
- String useAttributeSets = null;
- int len = attrs.getLength();
- for (int i = 0; i < len; i++)
- {
- Node attr = attrs.item(i);
- String value = attr.getNodeValue();
- if (Stylesheet.XSL_NS.equals(attr.getNamespaceURI()) &&
- "use-attribute-sets".equals(attr.getLocalName()))
- {
- useAttributeSets = value;
- convert = true;
- break;
- }
- int start = value.indexOf('{');
- int end = value.indexOf('}');
- if (start != -1 || end != -1)
- {
- convert = true;
- break;
- }
- }
- if (convert)
- {
- // Create an element-producing template node instead
- // with appropriate attribute-producing child template nodes
- TemplateNode child = parse(children);
- for (int i = 0; i < len; i++)
- {
- Node attr = attrs.item(i);
- String ans = attr.getNamespaceURI();
- String aname = attr.getNodeName();
- if (Stylesheet.XSL_NS.equals(ans) &&
- "use-attribute-sets".equals(attr.getLocalName()))
- {
- continue;
- }
- String value = attr.getNodeValue();
- TemplateNode grandchild =
- parseAttributeValueTemplate(value, node);
- TemplateNode n =
- parseAttributeValueTemplate(aname, node);
- TemplateNode ns = (ans == null) ? null :
- parseAttributeValueTemplate(ans, node);
- child = new AttributeNode(grandchild, child, n, ns, attr);
- }
- String ename = node.getNodeName();
- TemplateNode n = parseAttributeValueTemplate(ename, node);
- TemplateNode ns = (namespaceUri == null) ? null :
- parseAttributeValueTemplate(namespaceUri, node);
- return new ElementNode(child, parse(next),
- n, ns, useAttributeSets,
- node);
- }
- // Otherwise fall through
- break;
- }
- }
- catch (XPathExpressionException e)
- {
- DOMSourceLocator l = new DOMSourceLocator(node);
- throw new TransformerConfigurationException(e.getMessage(), l, e);
- }
- return new LiteralNode(parse(children), parse(next), node);
- }
-
- final List parseSortKeys(Node node)
- throws TransformerConfigurationException, XPathExpressionException
- {
- List ret = new LinkedList();
- while (node != null)
- {
- String namespaceUri = node.getNamespaceURI();
- if (Stylesheet.XSL_NS.equals(namespaceUri) &&
- Node.ELEMENT_NODE == node.getNodeType() &&
- "sort".equals(node.getLocalName()))
- {
- NamedNodeMap attrs = node.getAttributes();
- String s = getAttribute(attrs, "select");
- if (s == null)
- {
- s = ".";
- }
- Expr select = (Expr) xpath.compile(s);
- String l = getAttribute(attrs, "lang");
- TemplateNode lang = (l == null) ? null :
- parseAttributeValueTemplate(l, node);
- String dt = getAttribute(attrs, "data-type");
- TemplateNode dataType = (dt == null) ? null :
- parseAttributeValueTemplate(dt, node);
- String o = getAttribute(attrs, "order");
- TemplateNode order = (o == null) ? null :
- parseAttributeValueTemplate(o, node);
- String co = getAttribute(attrs, "case-order");
- TemplateNode caseOrder = (co == null) ? null :
- parseAttributeValueTemplate(co, node);
- ret.add(new SortKey(select, lang, dataType, order, caseOrder));
- }
- node = node.getNextSibling();
- }
- return ret.isEmpty() ? null : ret;
- }
-
- final List parseWithParams(Node node)
- throws TransformerConfigurationException, XPathExpressionException
- {
- List ret = new LinkedList();
- while (node != null)
- {
- String namespaceUri = node.getNamespaceURI();
- if (Stylesheet.XSL_NS.equals(namespaceUri) &&
- Node.ELEMENT_NODE == node.getNodeType() &&
- "with-param".equals(node.getLocalName()))
- {
- NamedNodeMap attrs = node.getAttributes();
- TemplateNode content = parse(node.getFirstChild());
- String name = getRequiredAttribute(attrs, "name", node);
- String select = getAttribute(attrs, "select");
- if (select != null)
- {
- if (content != null)
- {
- String msg = "parameter '" + name +
- "' has both select and content";
- DOMSourceLocator l = new DOMSourceLocator(node);
- throw new TransformerConfigurationException(msg, l);
- }
- Expr expr = (Expr) xpath.compile(select);
- ret.add(new WithParam(name, expr));
- }
- else
- {
- ret.add(new WithParam(name, content));
- }
- }
- node = node.getNextSibling();
- }
- return ret.isEmpty() ? null : ret;
- }
-
- /**
- * Created element nodes have a copy of the namespace nodes in the
- * stylesheet, except the XSLT namespace, extension namespaces, and
- * exclude-result-prefixes.
- */
- final void addNamespaceNodes(Node source, Node target, Document doc,
- Collection elementExcludeResultPrefixes)
- {
- NamedNodeMap attrs = source.getAttributes();
- if (attrs != null)
- {
- int len = attrs.getLength();
- for (int i = 0; i < len; i++)
- {
- Node attr = attrs.item(i);
- String uri = attr.getNamespaceURI();
- if (uri == XMLConstants.XMLNS_ATTRIBUTE_NS_URI)
- {
- String prefix = attr.getLocalName();
- if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix))
- {
- prefix = "#default";
- }
- String ns = attr.getNodeValue();
- // Should the namespace be excluded?
- if (XSL_NS.equals(ns) ||
- extensionElementPrefixes.contains(prefix) ||
- elementExcludeResultPrefixes.contains(prefix) ||
- excludeResultPrefixes.contains(prefix))
- {
- continue;
- }
- // Is the namespace already defined on the target?
- if (prefix == "#default")
- {
- prefix = null;
- }
- if (target.lookupNamespaceURI(prefix) != null)
- {
- continue;
- }
- attr = attr.cloneNode(true);
- attr = doc.adoptNode(attr);
- target.getAttributes().setNamedItemNS(attr);
- }
- }
- }
- Node parent = source.getParentNode();
- if (parent != null)
- {
- addNamespaceNodes(parent, target, doc, elementExcludeResultPrefixes);
- }
- }
-
- static final String getAttribute(NamedNodeMap attrs, String name)
- {
- Node attr = attrs.getNamedItem(name);
- if (attr == null)
- {
- return null;
- }
- String ret = attr.getNodeValue();
- if (ret.length() == 0)
- {
- return null;
- }
- return ret;
- }
-
- static final String getRequiredAttribute(NamedNodeMap attrs, String name,
- Node source)
- throws TransformerConfigurationException
- {
- String value = getAttribute(attrs, name);
- if (value == null || value.length() == 0)
- {
- String msg =
- name + " attribute is required on " + source.getNodeName();
- DOMSourceLocator l = new DOMSourceLocator(source);
- throw new TransformerConfigurationException(msg, l);
- }
- return value;
- }
-
- // Handle user data changes when nodes are cloned etc
-
- public void handle(short op, String key, Object data, Node src, Node dst)
- {
- dst.setUserData(key, data, this);
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/SystemPropertyFunction.java b/libjava/gnu/xml/transform/SystemPropertyFunction.java
deleted file mode 100644
index 33616d39628..00000000000
--- a/libjava/gnu/xml/transform/SystemPropertyFunction.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* SystemPropertyFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Function;
-
-/**
- * The XSLT <code>system-property()</code>function.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class SystemPropertyFunction
- extends Expr
- implements XPathFunction, Function
-{
-
- List args;
-
- public Object evaluate(List args)
- throws XPathFunctionException
- {
- String name = (String) args.get(0);
- return systemProperty(QName.valueOf(name));
- }
-
- public void setArguments(List args)
- {
- this.args = args;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- int arity = args.size();
- List values = new ArrayList(arity);
- for (int i = 0; i < arity; i++)
- {
- Expr arg = (Expr) args.get(i);
- values.add(arg.evaluate(context, pos, len));
- }
- String name = _string(context, values.get(0));
- return systemProperty(QName.valueOf(name));
- }
-
- Object systemProperty(QName name)
- {
- String localName = name.getLocalPart();
- String prefix = name.getPrefix();
- String uri = name.getNamespaceURI();
- if (Stylesheet.XSL_NS.equals(uri) ||
- "xsl".equals(prefix))
- {
- if ("version".equals(localName))
- {
- return new Double(1.0d);
- }
- else if ("vendor".equals(localName))
- {
- return "The Free Software Foundation";
- }
- else if ("vendor-url".equals(localName))
- {
- return "http://www.gnu.org/";
- }
- else
- {
- return "";
- }
- }
- return System.getProperty(localName);
- }
-
- public Expr clone(Object context)
- {
- SystemPropertyFunction f = new SystemPropertyFunction();
- int len = args.size();
- List args2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- args2.add(((Expr) args.get(i)).clone(context));
- }
- f.setArguments(args2);
- return f;
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/Template.java b/libjava/gnu/xml/transform/Template.java
deleted file mode 100644
index 1673a8aa63b..00000000000
--- a/libjava/gnu/xml/transform/Template.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/* Template.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.io.PrintStream;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.NameTest;
-import gnu.xml.xpath.NodeTypeTest;
-import gnu.xml.xpath.Pattern;
-import gnu.xml.xpath.Selector;
-import gnu.xml.xpath.Test;
-
-/**
- * A template in an XSL stylesheet.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class Template
- implements Comparable
-{
-
- static final double DEFAULT_PRIORITY = 0.5d;
-
- final Stylesheet stylesheet;
- final QName name;
- final Pattern match;
- final TemplateNode node;
- final double priority;
- final int precedence;
- final QName mode;
-
- Template(Stylesheet stylesheet,
- QName name, Pattern match, TemplateNode node,
- int precedence, double priority, QName mode)
- {
- this.stylesheet = stylesheet;
- this.name = name;
- this.match = match;
- this.node = node;
- // adjust priority if necessary
- // see XSLT section 5.5
- Test test = getNodeTest(match);
- if (test != null)
- {
- if (test instanceof NameTest)
- {
- NameTest nameTest = (NameTest) test;
- if (nameTest.matchesAny() ||
- nameTest.matchesAnyLocalName())
- {
- priority = -0.25d;
- }
- else
- {
- priority = 0.0d;
- }
- }
- else
- {
- NodeTypeTest nodeTypeTest = (NodeTypeTest) test;
- if (nodeTypeTest.getNodeType() ==
- Node.PROCESSING_INSTRUCTION_NODE &&
- nodeTypeTest.getData() != null)
- {
- priority = 0.0d;
- }
- else
- {
- priority = -0.5d;
- }
- }
- }
- this.precedence = precedence;
- this.priority = priority;
- this.mode = mode;
- }
-
- Template clone(Stylesheet stylesheet)
- {
- // FIXME by cloning we lose the imports() functionality, so
- // apply-imports will be broken.
- return new Template(stylesheet,
- name,
- (match == null) ? null :
- (Pattern) match.clone(stylesheet),
- (node == null) ? null : node.clone(stylesheet),
- precedence,
- priority,
- mode);
- }
-
- public int compareTo(Object other)
- {
- if (other instanceof Template)
- {
- Template t = (Template) other;
- int d = t.precedence - precedence;
- if (d != 0)
- {
- return d;
- }
- double d2 = t.priority - priority;
- if (d2 != 0.0d)
- {
- return (int) Math.round(d2 * 1000.0d);
- }
- }
- return 0;
- }
-
- Test getNodeTest(Expr expr)
- {
- if (expr instanceof Selector)
- {
- Selector selector = (Selector) expr;
- Test[] tests = selector.getTests();
- if (tests.length > 0)
- {
- return tests[0];
- }
- }
- return null;
- }
-
- boolean matches(QName mode, Node node)
- {
- if ((mode == null && this.mode != null) ||
- (mode != null && !mode.equals(this.mode)))
- {
- return false;
- }
- if (match == null)
- {
- return false;
- }
- return match.matches(node);
- }
-
- boolean matches(QName name)
- {
- return name.equals(this.name);
- }
-
- boolean imports(Template other)
- {
- for (Stylesheet ctx = other.stylesheet.parent;
- ctx != null;
- ctx = ctx.parent)
- {
- if (ctx == stylesheet)
- {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @param stylesheet the stylesheet
- * @param parent the parent of result nodes
- * @param context the context node in the source document
- * @param pos the context position
- * @param len the context size
- * @param nextSibling if non-null, add result nodes before this node
- */
- void apply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- //System.err.println("...applying " + toString() + " to " + context);
- if (node != null)
- {
- node.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- if (name != null)
- {
- buf.append("name=");
- buf.append(name);
- }
- else if (match != null)
- {
- buf.append("match=");
- buf.append(match);
- }
- if (mode != null)
- {
- buf.append(",mode=");
- buf.append(mode);
- }
- buf.append(']');
- return buf.toString();
-
- //return (name != null) ? name.toString() : match.toString();
- }
-
- void list(PrintStream out)
- {
- out.println(toString());
- if (node != null)
- {
- node.list(1, out, true);
- }
- }
-
-}
diff --git a/libjava/gnu/xml/transform/TemplateNode.java b/libjava/gnu/xml/transform/TemplateNode.java
deleted file mode 100644
index df13a4d1ec0..00000000000
--- a/libjava/gnu/xml/transform/TemplateNode.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* TemplateNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.io.PrintStream;
-import java.util.Comparator;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.DocumentOrderComparator;
-
-/**
- * Wrapper for a source node in a template.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-abstract class TemplateNode
-{
-
- static final Comparator documentOrderComparator =
- new DocumentOrderComparator();
-
- final TemplateNode children;
- final TemplateNode next;
-
- TemplateNode(TemplateNode children, TemplateNode next)
- {
- this.children = children;
- this.next = next;
- }
-
- final void apply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- if (stylesheet.terminated)
- {
- return;
- }
- if (Thread.currentThread().isInterrupted())
- {
- // Try to head off any infinite loops at the pass
- return;
- }
- if (stylesheet.debug)
- {
- System.err.println("Applying " + toString());
- }
- doApply(stylesheet, mode, context, pos, len, parent, nextSibling);
- }
-
- abstract void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException;
-
- abstract TemplateNode clone(Stylesheet stylesheet);
-
- /**
- * Debugging
- */
- void list(int depth, PrintStream out, boolean listNext)
- {
- for (int i = 0; i < depth; i++)
- {
- out.print(" ");
- }
- out.println(toString());
- if (children != null)
- {
- children.list(depth + 1, out, true);
- }
- if (listNext && next != null)
- {
- next.list(depth, out, listNext);
- }
- }
-
-}
diff --git a/libjava/gnu/xml/transform/TemplatesImpl.java b/libjava/gnu/xml/transform/TemplatesImpl.java
deleted file mode 100644
index 527bd979db0..00000000000
--- a/libjava/gnu/xml/transform/TemplatesImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* TemplatesImpl.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.Properties;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-
-/**
- * GNU precompiled stylesheet implementation.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class TemplatesImpl
- implements Templates
-{
-
- final TransformerFactoryImpl factory;
- final Stylesheet stylesheet;
- final Properties outputProperties;
-
- TemplatesImpl(TransformerFactoryImpl factory, Stylesheet stylesheet)
- {
- this.factory = factory;
- this.stylesheet = stylesheet;
- outputProperties = new TransformerOutputProperties(stylesheet);
- }
-
- public Transformer newTransformer()
- throws TransformerConfigurationException
- {
- Stylesheet stylesheet = (Stylesheet) this.stylesheet.clone();
- TransformerImpl transformer =
- new TransformerImpl(factory, stylesheet, outputProperties);
- stylesheet.transformer = transformer;
- return transformer;
- }
-
- public Properties getOutputProperties()
- {
- return (Properties) outputProperties.clone();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/TextNode.java b/libjava/gnu/xml/transform/TextNode.java
deleted file mode 100644
index b5ea1b57af7..00000000000
--- a/libjava/gnu/xml/transform/TextNode.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/* TextNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing the XSL <code>text</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class TextNode
- extends TemplateNode
-{
-
- final boolean disableOutputEscaping;
-
- TextNode(TemplateNode children, TemplateNode next,
- boolean disableOutputEscaping)
- {
- super(children, next);
- this.disableOutputEscaping = disableOutputEscaping;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new TextNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- disableOutputEscaping);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- String value = "";
- Document doc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- if (children != null)
- {
- // Create a document fragment to hold the text
- DocumentFragment fragment = doc.createDocumentFragment();
- // Apply children to the fragment
- children.apply(stylesheet, mode,
- context, pos, len,
- fragment, null);
- // Use XPath string-value of fragment
- value = Expr.stringValue(fragment);
- }
- Text text = doc.createTextNode(value);
- if (disableOutputEscaping)
- {
- text.setUserData("disable-output-escaping", "yes", stylesheet);
- }
- // Insert into result tree
- if (nextSibling != null)
- {
- parent.insertBefore(text, nextSibling);
- }
- else
- {
- parent.appendChild(text);
- }
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
-}
diff --git a/libjava/gnu/xml/transform/TransformerFactoryImpl.java b/libjava/gnu/xml/transform/TransformerFactoryImpl.java
deleted file mode 100644
index dde2017ff6b..00000000000
--- a/libjava/gnu/xml/transform/TransformerFactoryImpl.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/* TransformerFactoryImpl.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.Map;
-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.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.xpath.XPathFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import gnu.xml.dom.DomDocument;
-
-/**
- * GNU transformer factory implementation.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class TransformerFactoryImpl
- extends TransformerFactory
-{
-
- final XPathFactory xpathFactory;
- final XSLURIResolver resolver;
- ErrorListener userListener;
- URIResolver userResolver;
-
- public TransformerFactoryImpl()
- {
- xpathFactory = new gnu.xml.xpath.XPathFactoryImpl();
- resolver = new XSLURIResolver();
- }
-
- public Transformer newTransformer(Source source)
- throws TransformerConfigurationException
- {
- Stylesheet stylesheet = newStylesheet(source, 0, null);
- Properties outputProperties =
- new TransformerOutputProperties(stylesheet);
- TransformerImpl transformer =
- new TransformerImpl(this, stylesheet, outputProperties);
- stylesheet.transformer = transformer;
- return transformer;
- }
-
- public Transformer newTransformer()
- throws TransformerConfigurationException
- {
- return new TransformerImpl(this, null, new Properties());
- }
-
- public Templates newTemplates(Source source)
- throws TransformerConfigurationException
- {
- Stylesheet stylesheet = newStylesheet(source, 0, null);
- return new TemplatesImpl(this, stylesheet);
- }
-
- Stylesheet newStylesheet(Source source, int precedence, Stylesheet parent)
- throws TransformerConfigurationException
- {
- Document doc = null;
- String systemId = null;
- if (source != null)
- {
- try
- {
- DOMSource ds;
- synchronized (resolver)
- {
- resolver.setUserResolver(userResolver);
- resolver.setUserListener(userListener);
- ds = resolver.resolveDOM(source, null, null);
- }
- Node node = ds.getNode();
- if (node == null)
- {
- throw new TransformerConfigurationException("no source document");
- }
- doc = (node instanceof Document) ? (Document) node :
- node.getOwnerDocument();
- systemId = ds.getSystemId();
- }
- catch (TransformerException e)
- {
- throw new TransformerConfigurationException(e);
- }
- }
- return new Stylesheet(this, parent, doc, systemId, precedence);
- }
-
- public Source getAssociatedStylesheet(Source source,
- String media,
- String title,
- String charset)
- throws TransformerConfigurationException
- {
- try
- {
- DOMSource ds;
- synchronized (resolver)
- {
- resolver.setUserResolver(userResolver);
- resolver.setUserListener(userListener);
- ds = resolver.resolveDOM(source, null, null);
- }
- Node node = ds.getNode();
- if (node == null)
- {
- throw new TransformerConfigurationException("no source document");
- }
- Document doc = (node instanceof Document) ? (Document) node :
- node.getOwnerDocument();
- LinkedList matches = new LinkedList();
- for (node = doc.getFirstChild();
- node != null;
- node = node.getNextSibling())
- {
- if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE &&
- "xml-stylesheet".equals(node.getNodeName()))
- {
- Map params = parseParameters(node.getNodeValue());
- if (media != null && !media.equals(params.get("media")))
- {
- continue;
- }
- if (title != null && !title.equals(params.get("title")))
- {
- continue;
- }
- if (charset != null && !charset.equals(params.get("charset")))
- {
- continue;
- }
- String href = (String) params.get("href");
- URL url = resolver.resolveURL(null, node.getBaseURI(), href);
- matches.add(url);
- }
- }
- switch (matches.size())
- {
- case 0:
- return null;
- case 1:
- return new StreamSource(((URL) matches.getFirst()).toString());
- default:
- // Create a source representing a stylesheet with a list of
- // imports
- DomDocument ssDoc = new DomDocument();
- ssDoc.setBuilding(true);
- // Create document element
- Node root =
- ssDoc.createElementNS(Stylesheet.XSL_NS, "stylesheet");
- Node version =
- ssDoc.createAttributeNS(null, "version");
- version.setNodeValue("1.0");
- root.getAttributes().setNamedItemNS(version);
- ssDoc.appendChild(root);
- // Create xsl:import for each URL
- for (Iterator i = matches.iterator(); i.hasNext(); )
- {
- URL url = (URL) i.next();
- Node imp =
- ssDoc.createElementNS(Stylesheet.XSL_NS, "import");
- Node href =
- ssDoc.createAttributeNS(null, "href");
- href.setNodeValue(url.toString());
- imp.getAttributes().setNamedItemNS(href);
- root.appendChild(imp);
- }
- ssDoc.setBuilding(false);
- return new DOMSource(ssDoc);
- }
- }
- catch (IOException e)
- {
- throw new TransformerConfigurationException(e);
- }
- catch (TransformerException e)
- {
- throw new TransformerConfigurationException(e);
- }
- }
-
- Map parseParameters(String data)
- {
- Map ret = new LinkedHashMap();
- int len = data.length();
- String key = null;
- int start = 0;
- char quoteChar = '\u0000';
- for (int i = 0; i < len; i++)
- {
- char c = data.charAt(i);
- if (quoteChar == '\u0000' && c == ' ')
- {
- if (key == null && start < i)
- {
- key = data.substring(start, i);
- }
- else
- {
- String val = unquote(data.substring(start, i).trim());
- ret.put(key, val);
- key = null;
- }
- start = i + 1;
- }
- else if (c == '"')
- {
- quoteChar = (quoteChar == c) ? '\u0000' : c;
- }
- else if (c == '\'')
- {
- quoteChar = (quoteChar == c) ? '\u0000' : c;
- }
- }
- if (start < len && key != null)
- {
- String val = unquote(data.substring(start, len).trim());
- ret.put(key, val);
- }
- return ret;
- }
-
- String unquote(String text)
- {
- int end = text.length() - 1;
- if (text.charAt(0) == '\'' && text.charAt(end) == '\'')
- {
- return text.substring(1, end);
- }
- if (text.charAt(0) == '"' && text.charAt(end) == '"')
- {
- return text.substring(1, end);
- }
- return text;
- }
-
- public void setURIResolver(URIResolver resolver)
- {
- userResolver = resolver;
- }
-
- public URIResolver getURIResolver()
- {
- return userResolver;
- }
-
- public void setFeature(String name, boolean value)
- throws TransformerConfigurationException
- {
- throw new TransformerConfigurationException("not supported");
- }
-
- public boolean getFeature(String name)
- {
- if (SAXSource.FEATURE.equals(name) ||
- SAXResult.FEATURE.equals(name) ||
- StreamSource.FEATURE.equals(name) ||
- StreamResult.FEATURE.equals(name) ||
- DOMSource.FEATURE.equals(name) ||
- DOMResult.FEATURE.equals(name))
- {
- return true;
- }
- return false;
- }
-
- public void setAttribute(String name, Object value)
- throws IllegalArgumentException
- {
- throw new IllegalArgumentException("not supported");
- }
-
- public Object getAttribute(String name)
- throws IllegalArgumentException
- {
- throw new IllegalArgumentException("not supported");
- }
-
- public void setErrorListener(ErrorListener listener)
- throws IllegalArgumentException
- {
- userListener = listener;
- }
-
- public ErrorListener getErrorListener()
- {
- return userListener;
- }
-
-}
diff --git a/libjava/gnu/xml/transform/TransformerImpl.java b/libjava/gnu/xml/transform/TransformerImpl.java
deleted file mode 100644
index 73c4c0a4e08..00000000000
--- a/libjava/gnu/xml/transform/TransformerImpl.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/* TransformerImpl.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.io.BufferedOutputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.net.MalformedURLException;
-import java.net.UnknownServiceException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Collection;
-import java.util.Properties;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.stream.StreamResult;
-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.ContentHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-import gnu.xml.dom.DomDoctype;
-import gnu.xml.dom.DomDocument;
-import gnu.xml.dom.ls.WriterOutputStream;
-
-/**
- * The transformation process for a given stylesheet.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class TransformerImpl
- extends Transformer
-{
-
- final TransformerFactoryImpl factory;
- final Stylesheet stylesheet;
- URIResolver uriResolver;
- ErrorListener errorListener;
- Properties outputProperties;
-
- TransformerImpl(TransformerFactoryImpl factory,
- Stylesheet stylesheet,
- Properties outputProperties)
- throws TransformerConfigurationException
- {
- this.factory = factory;
- uriResolver = factory.userResolver;
- errorListener = factory.userListener;
- this.stylesheet = stylesheet;
- this.outputProperties = outputProperties;
- if (stylesheet != null)
- {
- // Set up parameter context for this transformer
- stylesheet.bindings.push(false);
- }
- }
-
- public void transform(Source xmlSource, Result outputTarget)
- throws TransformerException
- {
- // Get the source tree
- DOMSource source;
- synchronized (factory.resolver)
- {
- factory.resolver.setUserResolver(uriResolver);
- factory.resolver.setUserListener(errorListener);
- source = factory.resolver.resolveDOM(xmlSource, null, null);
- }
- Node context = source.getNode();
- Document doc = (context instanceof Document) ? (Document) context :
- context.getOwnerDocument();
- if (doc instanceof DomDocument)
- {
- // Suppress mutation events
- ((DomDocument) doc).setBuilding(true);
- // TODO find a better/more generic way of doing this than
- // casting
- }
- // Get the result tree
- Node parent = null, nextSibling = null;
- if (outputTarget instanceof DOMResult)
- {
- DOMResult dr = (DOMResult) outputTarget;
- parent = dr.getNode();
- nextSibling = dr.getNextSibling();
-
- Document rdoc = (parent instanceof Document) ? (Document) parent :
- parent.getOwnerDocument();
- if (rdoc instanceof DomDocument)
- {
- // Suppress mutation events and allow multiple root elements
- DomDocument drdoc = (DomDocument) rdoc;
- drdoc.setBuilding(true);
- drdoc.setCheckWellformedness(false);
- // TODO find a better/more generic way of doing this than
- // casting
- }
- }
- boolean created = false;
- // Transformation
- if (stylesheet != null)
- {
- if (parent == null)
- {
- // Create a new document to hold the result
- DomDocument resultDoc = new DomDocument();
- resultDoc.setBuilding(true);
- resultDoc.setCheckWellformedness(false);
- parent = resultDoc;
- created = true;
- }
- // Make a copy of the source node, and strip it
- context = context.cloneNode(true);
- strip(context);
- // XSLT transformation
- try
- {
- // Set output properties in the underlying stylesheet
- ((TransformerOutputProperties) outputProperties).apply();
- stylesheet.initTopLevelVariables(context);
- TemplateNode t = stylesheet.getTemplate(null, context, false);
- if (t != null)
- {
- stylesheet.current = context;
- t.apply(stylesheet, null, context, 1, 1, parent, nextSibling);
- }
- }
- catch (TransformerException e)
- {
- // Done transforming, reset document
- if (doc instanceof DomDocument)
- {
- ((DomDocument) doc).setBuilding(false);
- }
- throw e;
- }
- }
- else
- {
- // Identity transform
- Node clone = context.cloneNode(true);
- if (context.getNodeType() != Node.DOCUMENT_NODE)
- {
- Document resultDoc;
- if (parent == null)
- {
- // Create a new document to hold the result
- DomDocument rd = new DomDocument();
- rd.setBuilding(true);
- rd.setCheckWellformedness(false);
- parent = resultDoc = rd;
- created = true;
- }
- else
- {
- resultDoc = (parent instanceof Document) ?
- (Document) parent :
- parent.getOwnerDocument();
- }
- Document sourceDoc = context.getOwnerDocument();
- if (sourceDoc != resultDoc)
- {
- clone = resultDoc.adoptNode(clone);
- }
- if (nextSibling != null)
- {
- parent.insertBefore(clone, nextSibling);
- }
- else
- {
- parent.appendChild(clone);
- }
- }
- else
- {
- // Cannot append document to another tree
- parent = clone;
- created = true;
- }
- }
- String method = outputProperties.getProperty(OutputKeys.METHOD);
- int outputMethod = "html".equals(method) ? Stylesheet.OUTPUT_HTML :
- "text".equals(method) ? Stylesheet.OUTPUT_TEXT :
- Stylesheet.OUTPUT_XML;
- String encoding = outputProperties.getProperty(OutputKeys.ENCODING);
- String publicId = outputProperties.getProperty(OutputKeys.DOCTYPE_PUBLIC);
- String systemId = outputProperties.getProperty(OutputKeys.DOCTYPE_SYSTEM);
- String version = outputProperties.getProperty(OutputKeys.VERSION);
- boolean omitXmlDeclaration =
- "yes".equals(outputProperties.getProperty(OutputKeys.OMIT_XML_DECLARATION));
- boolean standalone =
- "yes".equals(outputProperties.getProperty(OutputKeys.STANDALONE));
- String mediaType = outputProperties.getProperty(OutputKeys.MEDIA_TYPE);
- // TODO cdata-section-elements
- // TODO indent
- if (created)
- {
- // Discover document element
- DomDocument resultDoc = (DomDocument) parent;
- Node root = resultDoc.getDocumentElement();
- // Add doctype if specified
- if ((publicId != null || systemId != null) &&
- root != null)
- {
- // We must know the name of the root element to
- // create the document type
- resultDoc.appendChild(new DomDoctype(resultDoc,
- root.getNodeName(),
- publicId,
- systemId));
- }
- resultDoc.setBuilding(false);
- resultDoc.setCheckWellformedness(true);
- }
- else if (publicId != null || systemId != null)
- {
- switch (parent.getNodeType())
- {
- case Node.DOCUMENT_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- Document resultDoc = (parent instanceof Document) ?
- (Document) parent :
- parent.getOwnerDocument();
- DOMImplementation impl = resultDoc.getImplementation();
- DocumentType doctype =
- impl.createDocumentType(resultDoc.getNodeName(),
- publicId,
- systemId);
- // Try to insert doctype before first element
- Node ctx = parent.getFirstChild();
- for (; ctx != null &&
- ctx.getNodeType() != Node.ELEMENT_NODE;
- ctx = ctx.getNextSibling())
- {
- }
- if (ctx != null)
- {
- parent.insertBefore(doctype, ctx);
- }
- else
- {
- parent.appendChild(doctype);
- }
- }
- }
- if (version != null)
- {
- parent.setUserData("version", version, stylesheet);
- }
- if (omitXmlDeclaration)
- {
- parent.setUserData("omit-xml-declaration", "yes", stylesheet);
- }
- if (standalone)
- {
- parent.setUserData("standalone", "yes", stylesheet);
- }
- if (mediaType != null)
- {
- parent.setUserData("media-type", mediaType, stylesheet);
- }
- // Render result to the target device
- if (outputTarget instanceof DOMResult)
- {
- if (created)
- {
- DOMResult dr = (DOMResult) outputTarget;
- dr.setNode(parent);
- dr.setNextSibling(null);
- }
- }
- else if (outputTarget instanceof StreamResult)
- {
- StreamResult sr = (StreamResult) outputTarget;
- IOException ex = null;
- try
- {
- writeStreamResult(parent, sr, outputMethod, encoding);
- }
- catch (UnsupportedEncodingException e)
- {
- try
- {
- writeStreamResult(parent, sr, outputMethod, "UTF-8");
- }
- catch (IOException e2)
- {
- ex = e2;
- }
- }
- catch (IOException e)
- {
- ex = e;
- }
- if (ex != null)
- {
- if (errorListener != null)
- {
- errorListener.error(new TransformerException(ex));
- }
- else
- {
- ex.printStackTrace(System.err);
- }
- }
- }
- else if (outputTarget instanceof SAXResult)
- {
- SAXResult sr = (SAXResult) outputTarget;
- try
- {
- ContentHandler ch = sr.getHandler();
- LexicalHandler lh = sr.getLexicalHandler();
- if (lh == null && ch instanceof LexicalHandler)
- {
- lh = (LexicalHandler) ch;
- }
- SAXSerializer serializer = new SAXSerializer();
- serializer.serialize(parent, ch, lh);
- }
- catch (SAXException e)
- {
- if (errorListener != null)
- {
- errorListener.error(new TransformerException(e));
- }
- else
- {
- e.printStackTrace(System.err);
- }
- }
- }
- }
-
- /**
- * Strip whitespace from the source tree.
- */
- void strip(Node node)
- throws TransformerConfigurationException
- {
- short nt = node.getNodeType();
- if (nt == Node.ENTITY_REFERENCE_NODE)
- {
- // Replace entity reference with its content
- Node parent = node.getParentNode();
- Node child = node.getFirstChild();
- if (child != null)
- {
- strip(child);
- }
- while (child != null)
- {
- Node next = child.getNextSibling();
- node.removeChild(child);
- parent.insertBefore(child, node);
- child = next;
- }
- parent.removeChild(node);
- }
- if (nt == Node.TEXT_NODE) // CDATA sections ?
- {
- if (!stylesheet.isPreserved((Text) node))
- {
- node.getParentNode().removeChild(node);
- }
- }
- else
- {
- for (Node child = node.getFirstChild(); child != null;
- child = child.getNextSibling())
- {
- strip(child);
- }
- }
- }
-
- /**
- * Obtain a suitable output stream for writing the result to,
- * and use the StreamSerializer to write the result tree to the stream.
- */
- void writeStreamResult(Node node, StreamResult sr, int outputMethod,
- String encoding)
- throws IOException
- {
- OutputStream out = null;
- try
- {
- out = sr.getOutputStream();
- if (out == null)
- {
- Writer writer = sr.getWriter();
- if (writer != null)
- {
- out = new WriterOutputStream(writer);
- }
- }
- if (out == null)
- {
- String systemId = sr.getSystemId();
- try
- {
- URL url = new URL(systemId);
- URLConnection connection = url.openConnection();
- connection.setDoOutput(true);
- out = connection.getOutputStream();
- }
- catch (MalformedURLException e)
- {
- out = new FileOutputStream(systemId);
- }
- catch (UnknownServiceException e)
- {
- URL url = new URL(systemId);
- out = new FileOutputStream(url.getPath());
- }
- }
- out = new BufferedOutputStream(out);
- StreamSerializer serializer =
- new StreamSerializer(outputMethod, encoding, null);
- if (stylesheet != null)
- {
- Collection celem = stylesheet.outputCdataSectionElements;
- serializer.setCdataSectionElements(celem);
- }
- serializer.serialize(node, out);
- out.flush();
- }
- finally
- {
- try
- {
- if (out != null)
- {
- out.close();
- }
- }
- catch (IOException e)
- {
- }
- }
- }
-
- void copyChildren(Document dstDoc, Node src, Node dst)
- {
- Node srcChild = src.getFirstChild();
- while (srcChild != null)
- {
- Node dstChild = dstDoc.adoptNode(srcChild);
- dst.appendChild(dstChild);
- srcChild = srcChild.getNextSibling();
- }
- }
-
- public void setParameter(String name, Object value)
- {
- if (stylesheet != null)
- {
- stylesheet.bindings.set(name, value, false);
- }
- }
-
- public Object getParameter(String name)
- {
- if (stylesheet != null)
- {
- return stylesheet.bindings.get(name, null, 1, 1);
- }
- return null;
- }
-
- public void clearParameters()
- {
- if (stylesheet != null)
- {
- stylesheet.bindings.pop(false);
- stylesheet.bindings.push(false);
- }
- }
-
- public void setURIResolver(URIResolver resolver)
- {
- uriResolver = resolver;
- }
-
- public URIResolver getURIResolver()
- {
- return uriResolver;
- }
-
- public void setOutputProperties(Properties oformat)
- throws IllegalArgumentException
- {
- if (oformat == null)
- {
- outputProperties.clear();
- }
- else
- {
- outputProperties.putAll(oformat);
- }
- }
-
- public Properties getOutputProperties()
- {
- return (Properties) outputProperties.clone();
- }
-
- public void setOutputProperty(String name, String value)
- throws IllegalArgumentException
- {
- outputProperties.put(name, value);
- }
-
- public String getOutputProperty(String name)
- throws IllegalArgumentException
- {
- return outputProperties.getProperty(name);
- }
-
- public void setErrorListener(ErrorListener listener)
- {
- errorListener = listener;
- }
-
- public ErrorListener getErrorListener()
- {
- return errorListener;
- }
-
-}
diff --git a/libjava/gnu/xml/transform/TransformerOutputProperties.java b/libjava/gnu/xml/transform/TransformerOutputProperties.java
deleted file mode 100644
index cc8593c4601..00000000000
--- a/libjava/gnu/xml/transform/TransformerOutputProperties.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/* TransformerOutputProperties.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import javax.xml.transform.OutputKeys;
-
-/**
- * Helper class to manage JAXP user setting of output properties.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class TransformerOutputProperties
- extends Properties
-{
-
- final Properties defaultProperties;
- final Stylesheet stylesheet;
- boolean dirty;
-
- TransformerOutputProperties(Stylesheet stylesheet)
- {
- this.stylesheet = stylesheet;
- defaultProperties = new Properties();
- switch (stylesheet.outputMethod)
- {
- case Stylesheet.OUTPUT_XML:
- defaultProperties.put(OutputKeys.METHOD, "xml");
- break;
- case Stylesheet.OUTPUT_HTML:
- defaultProperties.put(OutputKeys.METHOD, "html");
- break;
- case Stylesheet.OUTPUT_TEXT:
- defaultProperties.put(OutputKeys.METHOD, "text");
- break;
- }
- if (stylesheet.outputVersion != null)
- {
- defaultProperties.put(OutputKeys.VERSION, stylesheet.outputVersion);
- }
- if (stylesheet.outputEncoding != null)
- {
- defaultProperties.put(OutputKeys.ENCODING, stylesheet.outputEncoding);
- }
- defaultProperties.put(OutputKeys.OMIT_XML_DECLARATION,
- stylesheet.outputOmitXmlDeclaration ? "yes" : "no");
- defaultProperties.put(OutputKeys.STANDALONE,
- stylesheet.outputStandalone ? "yes" : "no");
- if (stylesheet.outputPublicId != null)
- {
- defaultProperties.put(OutputKeys.DOCTYPE_PUBLIC,
- stylesheet.outputPublicId);
- }
- if (stylesheet.outputSystemId != null)
- {
- defaultProperties.put(OutputKeys.DOCTYPE_SYSTEM,
- stylesheet.outputSystemId);
- }
- StringBuffer buf = new StringBuffer();
- for (Iterator i = stylesheet.outputCdataSectionElements.iterator();
- i.hasNext(); )
- {
- if (buf.length() > 0)
- {
- buf.append(' ');
- }
- buf.append((String) i.next());
- }
- defaultProperties.put(OutputKeys.CDATA_SECTION_ELEMENTS, buf.toString());
- defaultProperties.put(OutputKeys.INDENT,
- stylesheet.outputIndent ? "yes" : "no");
- if (stylesheet.outputMediaType != null)
- {
- defaultProperties.put(OutputKeys.MEDIA_TYPE,
- stylesheet.outputMediaType);
- }
- }
-
- public String getProperty(String key)
- {
- String val = super.getProperty(key);
- if (val == null)
- {
- val = defaultProperties.getProperty(key);
- }
- return val;
- }
-
- public Object put(Object key, Object value)
- {
- Object ret = super.put(key, value);
- dirty = true;
- return ret;
- }
-
- public void clear()
- {
- super.clear();
- dirty = true;
- }
-
- /**
- * Applies the current set of properties to the underlying stylesheet.
- */
- void apply()
- {
- if (!dirty)
- {
- return;
- }
- String method = getProperty(OutputKeys.METHOD);
- if ("xml".equals(method))
- {
- stylesheet.outputMethod = Stylesheet.OUTPUT_XML;
- }
- else if ("html".equals(method))
- {
- stylesheet.outputMethod = Stylesheet.OUTPUT_HTML;
- }
- else if ("text".equals(method))
- {
- stylesheet.outputMethod = Stylesheet.OUTPUT_TEXT;
- }
- stylesheet.outputVersion = getProperty(OutputKeys.VERSION);
- stylesheet.outputEncoding = getProperty(OutputKeys.ENCODING);
- stylesheet.outputOmitXmlDeclaration =
- "yes".equals(getProperty(OutputKeys.OMIT_XML_DECLARATION));
- stylesheet.outputStandalone =
- "yes".equals(getProperty(OutputKeys.STANDALONE));
- stylesheet.outputPublicId = getProperty(OutputKeys.DOCTYPE_PUBLIC);
- stylesheet.outputSystemId = getProperty(OutputKeys.DOCTYPE_SYSTEM);
- StringTokenizer st =
- new StringTokenizer(getProperty(OutputKeys.CDATA_SECTION_ELEMENTS));
- Collection acc = new LinkedHashSet();
- while (st.hasMoreTokens())
- {
- acc.add(st.nextToken());
- }
- stylesheet.outputCdataSectionElements = acc;
- stylesheet.outputIndent = "yes".equals(getProperty(OutputKeys.INDENT));
- stylesheet.outputMediaType = getProperty(OutputKeys.MEDIA_TYPE);
- dirty = false;
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/URIResolverEntityResolver.java b/libjava/gnu/xml/transform/URIResolverEntityResolver.java
deleted file mode 100644
index 762416fde36..00000000000
--- a/libjava/gnu/xml/transform/URIResolverEntityResolver.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* URIResolverEntityResolver.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.io.IOException;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.sax.SAXSource;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * EntityResolver that wraps a URIResolver.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class URIResolverEntityResolver
- implements EntityResolver
-{
-
- final URIResolver resolver;
-
- URIResolverEntityResolver(URIResolver resolver)
- {
- this.resolver = resolver;
- }
-
- public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException, IOException
- {
- try
- {
- Source source = resolver.resolve(null, systemId);
- if (source == null)
- {
- return null;
- }
- return SAXSource.sourceToInputSource(source);
- }
- catch (TransformerException e)
- {
- throw new SAXException(e);
- }
- }
-
-}
diff --git a/libjava/gnu/xml/transform/UnparsedEntityUriFunction.java b/libjava/gnu/xml/transform/UnparsedEntityUriFunction.java
deleted file mode 100644
index ca72b6534df..00000000000
--- a/libjava/gnu/xml/transform/UnparsedEntityUriFunction.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/* UnparsedEntityUriFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Notation;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Function;
-
-/**
- * The XSLT <code>unparsed-entity-uri()</code>function.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class UnparsedEntityUriFunction
- extends Expr
- implements XPathFunction, Function
-{
-
- List args;
-
- public Object evaluate(List args)
- throws XPathFunctionException
- {
- // Useless...
- return Collections.EMPTY_SET;
- }
-
- public void setArguments(List args)
- {
- this.args = args;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- int arity = args.size();
- List values = new ArrayList(arity);
- for (int i = 0; i < arity; i++)
- {
- Expr arg = (Expr) args.get(i);
- values.add(arg.evaluate(context, pos, len));
- }
- String name = _string(context, values.get(0));
- DocumentType doctype = context.getOwnerDocument().getDoctype();
- if (doctype != null)
- {
- NamedNodeMap notations = doctype.getNotations();
- Notation notation = (Notation) notations.getNamedItem(name);
- if (notation != null)
- {
- String systemId = notation.getSystemId();
- // XXX absolutize?
- if (systemId != null)
- {
- return systemId;
- }
- }
- }
- return "";
- }
-
- public Expr clone(Object context)
- {
- UnparsedEntityUriFunction f = new UnparsedEntityUriFunction();
- int len = args.size();
- List args2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- args2.add(((Expr) args.get(i)).clone(context));
- }
- f.setArguments(args2);
- return f;
- }
-
-}
-
diff --git a/libjava/gnu/xml/transform/ValueOfNode.java b/libjava/gnu/xml/transform/ValueOfNode.java
deleted file mode 100644
index 88ab166911d..00000000000
--- a/libjava/gnu/xml/transform/ValueOfNode.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* ValueOfNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-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 <code>value-of</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ValueOfNode
- extends TemplateNode
-{
-
- final Expr select;
- final boolean disableOutputEscaping;
-
- ValueOfNode(TemplateNode children, TemplateNode next, Expr select,
- boolean disableOutputEscaping)
- {
- super(children, next);
- this.select = select;
- this.disableOutputEscaping = disableOutputEscaping;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new ValueOfNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- select.clone(stylesheet),
- disableOutputEscaping);
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Object ret = select.evaluate(context, pos, len);
- String value = Expr._string(context, ret);
- //System.err.println("value-of: "+context+" "+ select + " -> "+ value);
- if (value != null && value.length() > 0)
- {
- Document doc = (parent instanceof Document) ?
- (Document) parent : parent.getOwnerDocument();
- Text textNode = doc.createTextNode(value);
- if (disableOutputEscaping)
- {
- textNode.setUserData("disable-output-escaping", "yes", stylesheet);
- }
- if (nextSibling != null)
- {
- parent.insertBefore(textNode, nextSibling);
- }
- else
- {
- parent.appendChild(textNode);
- }
- }
- // value-of doesn't process children
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("select=");
- buf.append(select);
- if (disableOutputEscaping)
- {
- buf.append(",disableOutputEscaping");
- }
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/WhenNode.java b/libjava/gnu/xml/transform/WhenNode.java
deleted file mode 100644
index 8c292fb279b..00000000000
--- a/libjava/gnu/xml/transform/WhenNode.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/* WhenNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * A template node representing an XSL <code>when</code> instruction.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class WhenNode
- extends TemplateNode
-{
-
- final Expr test;
-
- WhenNode(TemplateNode children, TemplateNode next, Expr test)
- {
- super(children, next);
- this.test = test;
- }
-
- TemplateNode clone(Stylesheet stylesheet)
- {
- return new WhenNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- test.clone(stylesheet));
- }
-
- void doApply(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len,
- Node parent, Node nextSibling)
- throws TransformerException
- {
- Object ret = test.evaluate(context, pos, len);
- boolean success = (ret instanceof Boolean) ?
- ((Boolean) ret).booleanValue() :
- Expr._boolean(context, ret);
- if (success)
- {
- if (children != null)
- {
- children.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
- else
- {
- if (next != null)
- {
- next.apply(stylesheet, mode,
- context, pos, len,
- parent, nextSibling);
- }
- }
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append('[');
- buf.append("test=");
- buf.append(test);
- buf.append(']');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/transform/WithParam.java b/libjava/gnu/xml/transform/WithParam.java
deleted file mode 100644
index 7c3379833ce..00000000000
--- a/libjava/gnu/xml/transform/WithParam.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/* WithParam.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.Collections;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * A specification for setting a variable or parameter during template
- * processing with <code>apply-templates</code> or
- * <code>call-template</code>.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class WithParam
-{
-
- final String name;
- final Expr select;
- final TemplateNode content;
-
- WithParam(String name, Expr select)
- {
- this.name = name;
- this.select = select;
- content = null;
- }
-
- WithParam(String name, TemplateNode content)
- {
- this.name = name;
- this.content = content;
- select = null;
- }
-
- Object getValue(Stylesheet stylesheet, QName mode,
- Node context, int pos, int len)
- throws TransformerException
- {
- if (select != null)
- {
- return select.evaluate(context, pos, len);
- }
- else
- {
- Document doc = (context instanceof Document) ? (Document) context :
- context.getOwnerDocument();
- DocumentFragment fragment = doc.createDocumentFragment();
- content.apply(stylesheet, mode,
- context, pos, len,
- fragment, null);
- return Collections.singleton(fragment);
- }
- }
-
- WithParam clone(Stylesheet stylesheet)
- {
- if (content == null)
- {
- return new WithParam(name,
- select.clone(stylesheet));
- }
- else
- {
- return new WithParam(name,
- content.clone(stylesheet));
- }
- }
-
-}
diff --git a/libjava/gnu/xml/transform/XSLComparator.java b/libjava/gnu/xml/transform/XSLComparator.java
deleted file mode 100644
index 222f370c8b9..00000000000
--- a/libjava/gnu/xml/transform/XSLComparator.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/* XSLComparator.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.text.Collator;
-import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
-
-/**
- * Comparator for sorting lists of nodes according to a list of sort keys.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class XSLComparator
- implements Comparator
-{
-
- final List sortKeys;
-
- XSLComparator(List sortKeys)
- {
- this.sortKeys = sortKeys;
- }
-
- public int compare(Object o1, Object o2)
- {
- if (o1 instanceof Node && o2 instanceof Node)
- {
- Node n1 = (Node) o1;
- Node n2 = (Node) o2;
- for (Iterator i = sortKeys.iterator(); i.hasNext(); )
- {
- SortKey sortKey = (SortKey) i.next();
- String k1 = sortKey.key(n1);
- String k2 = sortKey.key(n2);
- if ("text".equals(sortKey.dataType))
- {
- Locale locale = (sortKey.lang == null) ? Locale.getDefault() :
- new Locale(sortKey.lang);
- Collator collator = Collator.getInstance(locale);
- int d = collator.compare(k1, k2);
- if (d != 0)
- {
- switch (sortKey.caseOrder)
- {
- case SortKey.UPPER_FIRST:
- // TODO
- break;
- case SortKey.LOWER_FIRST:
- // TODO
- break;
- }
- if (sortKey.descending)
- {
- d = -d;
- }
- return d;
- }
- }
- else if ("number".equals(sortKey.dataType))
- {
- double kn1 = Expr._number(n1, k1);
- double kn2 = Expr._number(n2, k2);
- int d;
- if (Double.isNaN(kn1) || Double.isInfinite(kn2))
- {
- d = -1;
- }
- else if (Double.isNaN(kn2) || Double.isInfinite(kn1))
- {
- d = 1;
- }
- else
- {
- // conversion to int may give 0 for small numbers
- d = (kn1 > kn2) ? 1 : (kn1 < kn2) ? -1 : 0;
- }
- return (sortKey.descending) ? -d : d;
- }
- }
- }
- return 0;
- }
-
-}
diff --git a/libjava/gnu/xml/transform/XSLURIResolver.java b/libjava/gnu/xml/transform/XSLURIResolver.java
deleted file mode 100644
index 2e4e6545a87..00000000000
--- a/libjava/gnu/xml/transform/XSLURIResolver.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/* XSLURIResolver.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transform;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.Reader;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import gnu.xml.dom.ls.ReaderInputStream;
-
-/**
- * URI resolver for XSLT.
- * This resolver parses external entities into DOMSources. It
- * maintains a cache of URIs to DOMSources to avoid expensive re-parsing.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class XSLURIResolver
- implements URIResolver
-{
-
- Map lastModifiedCache = new HashMap();
- Map nodeCache = new HashMap();
- DocumentBuilder builder;
- URIResolver userResolver;
- ErrorListener userListener;
-
- void setUserResolver(URIResolver userResolver)
- {
- this.userResolver = userResolver;
- }
-
- void setUserListener(ErrorListener userListener)
- {
- this.userListener = userListener;
- }
-
- /**
- * Clear the cache.
- */
- void flush()
- {
- lastModifiedCache.clear();
- nodeCache.clear();
- }
-
- public Source resolve(String href, String base)
- throws TransformerException
- {
- Source source = null;
- if (userResolver != null)
- {
- source = userResolver.resolve(base, href);
- }
- return resolveDOM(source, href, base);
- }
-
- DOMSource resolveDOM(Source source, String base, String href)
- throws TransformerException
- {
- if (source != null && source instanceof DOMSource)
- {
- return (DOMSource) source;
- }
- String systemId = (source == null) ? null : source.getSystemId();
- long lastModified = 0L, lastLastModified = 0L;
-
- try
- {
- URL url = resolveURL(systemId, base, href);
- Node node = null;
- InputStream in = null;
- if (source instanceof StreamSource)
- {
- StreamSource ss = (StreamSource) source;
- in = ss.getInputStream();
- if (in == null)
- {
- Reader reader = ss.getReader();
- if (reader != null)
- {
- in = new ReaderInputStream(reader);
- }
- }
- }
- if (in == null && url != null)
- {
- systemId = url.toString();
- node = (Node) nodeCache.get(systemId);
- // Is the resource up to date?
- URLConnection conn = url.openConnection();
- Long llm = (Long) lastModifiedCache.get(systemId);
- if (llm != null)
- {
- lastLastModified = llm.longValue();
- conn.setIfModifiedSince(lastLastModified);
- }
- conn.connect();
- lastModified = conn.getLastModified();
- if (node != null &&
- lastModified > 0L &&
- lastModified <= lastLastModified)
- {
- // Resource unchanged
- return new DOMSource(node, systemId);
- }
- else
- {
- // Resource new or modified
- in = conn.getInputStream();
- nodeCache.put(systemId, node);
- lastModifiedCache.put(systemId, new Long(lastModified));
- }
- }
- InputSource input = new InputSource(in);
- input.setSystemId(systemId);
- DocumentBuilder builder = getDocumentBuilder();
- node = builder.parse(input);
- return new DOMSource(node, systemId);
- }
- catch (IOException e)
- {
- throw new TransformerException(e);
- }
- catch (SAXException e)
- {
- throw new TransformerException(e);
- }
- }
-
- URL resolveURL(String systemId, String base, String href)
- throws IOException
- {
- URL url = null;
- try
- {
- if (systemId != null)
- {
- try
- {
- url = new URL(systemId);
- }
- catch (MalformedURLException e)
- {
- // Try building from base + href
- }
- }
- if (url == null)
- {
- if (base != null)
- {
- URL baseURL = new URL(base);
- url = new URL(baseURL, href);
- }
- else if (href != null)
- {
- url = new URL(href);
- }
- }
- return url;
- }
- catch (MalformedURLException e)
- {
- // Fall back to local filesystem
- File file = null;
- if (href == null)
- {
- href = systemId;
- }
- if (base != null)
- {
- int lsi = base.lastIndexOf(File.separatorChar);
- if (lsi != -1 && lsi < base.length() - 1)
- {
- base = base.substring(0, lsi);
- }
- File baseFile = new File(base);
- file = new File(baseFile, href);
- }
- else if (href != null)
- {
- file = new File(href);
- }
- return (file == null) ? null : file.toURL();
- }
- }
-
- DocumentBuilder getDocumentBuilder()
- throws TransformerException
- {
- try
- {
- if (builder == null)
- {
- DocumentBuilderFactory factory =
- DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- factory.setExpandEntityReferences(true);
- builder = factory.newDocumentBuilder();
- }
- if (userResolver != null)
- {
- builder.setEntityResolver(new URIResolverEntityResolver(userResolver));
- }
- if (userListener != null)
- {
- builder.setErrorHandler(new ErrorListenerErrorHandler(userListener));
- }
- return builder;
- }
- catch (Exception e)
- {
- throw new TransformerException(e);
- }
- }
-
-}
-
diff --git a/libjava/gnu/xml/util/DoParse.java b/libjava/gnu/xml/util/DoParse.java
deleted file mode 100644
index 5da086ed8f9..00000000000
--- a/libjava/gnu/xml/util/DoParse.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/* DoParse.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util;
-
-import java.io.IOException;
-
-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 gnu.xml.pipeline.EventConsumer;
-import gnu.xml.pipeline.EventFilter;
-import gnu.xml.pipeline.NSFilter;
-import gnu.xml.pipeline.PipelineFactory;
-import gnu.xml.pipeline.TeeConsumer;
-import gnu.xml.pipeline.ValidationConsumer;
-import gnu.xml.pipeline.WellFormednessFilter;
-
-/**
- * This class provides a driver which may be invoked from the command line
- * to process a document using a SAX2 parser and a specified XML processing
- * pipeline.
- * This facilitates some common types of command line tools, such as parsing an
- * XML document in order test it for well formedness or validity.
- *
- * <p>The SAX2 XMLReaderFactory should return a SAX2 XML parser which
- * supports both of the standardized extension handlers (for declaration
- * and lexical events). That parser will be used to produce events.
- *
- * <p>The first parameter to the command gives the name of the document that
- * will be given to that processor. If it is a file name, it is converted
- * to a URL first.
- *
- * <p>The second parameter describes a simple processing pipeline, and will
- * be used as input to {@link gnu.xml.pipeline.PipelineFactory}
- * methods which identify the processing to be done. Examples of such a
- * pipeline include <pre>
- *
- * nsfix | validate <em>to validate the input document </em>
- * nsfix | write ( stdout ) <em>to echo the file as XML text</em>
- * dom | nsfix | write ( stdout ) <em>parse into DOM, print the result</em>
- * </pre>
- *
- * <p> Relatively complex pipelines can be described on the command line, but
- * not all interesting ones will require as little configuration as can be done
- * in that way. Put filters like "nsfix", perhaps followed by "validate",
- * at the front of the pipeline so they can be optimized out if a parser
- * supports those modes natively.
- *
- * <p> If the parsing is aborted for any reason, the JVM will exit with a
- * failure code. If a validating parse was done then both validation and
- * well formedness errors will cause a failure. A non-validating parse
- * will report failure on well formedness errors.
- *
- * @see gnu.xml.pipeline.PipelineFactory
- *
- * @author David Brownell
- */
-final public class DoParse
-{
- private DoParse () { /* no instances allowed */ }
-
- // first reported nonrecoverable error
- private static SAXParseException fatal;
-
- // error categories
- private static int errorCount;
- private static int fatalCount;
-
- /**
- * Command line invoker for this class; pass a filename or URL
- * as the first argument, and a pipeline description as the second.
- * Make sure to use filters to condition the input to stages that
- * require it; an <em>nsfix</em> filter will be a common requirement,
- * to restore syntax that SAX2 parsers delete by default. Some
- * conditioning filters may be eliminated by setting parser options.
- * (For example, "nsfix" can set the "namespace-prefixes" feature to
- * a non-default value of "true". In the same way, "validate" can set
- * the "validation" feature to "true".)
- */
- public static void main (String argv [])
- throws IOException
- {
- int exitStatus = 1;
-
- if (argv.length != 2) {
- System.err.println ("Usage: DoParse [filename|URL] pipeline-spec");
- System.err.println ("Example pipeline specs:");
- System.err.println (" 'nsfix | validate'");
- System.err.println (
- " ... restore namespace syntax, validate");
- System.err.println (" 'nsfix | write ( stdout )'");
- System.err.println (
- " ... restore namespace syntax, write to stdout as XML"
- );
- System.exit (1);
- }
-
- try {
- //
- // Get input source for specified document (or try ;-)
- //
- argv [0] = Resolver.getURL (argv [0]);
- InputSource input = new InputSource (argv [0]);
-
- //
- // Get the producer, using the system default parser (which
- // can be overridden for this particular invocation).
- //
- // And the pipeline, using commandline options.
- //
- XMLReader producer;
- EventConsumer consumer;
-
- producer = XMLReaderFactory.createXMLReader ();
-
- //
- // XXX pipeline factory now has a pre-tokenized input
- // method, use it ... that way at least some params
- // can be written using quotes (have spaces, ...)
- //
- consumer = PipelineFactory.createPipeline (argv [1]);
-
- //
- // XXX want commandline option for tweaking error handler.
- // Want to be able to present warnings.
- //
- producer.setErrorHandler (new MyErrorHandler ());
-
- // XXX need facility enabling resolving to local DTDs
-
- //
- // Parse. The pipeline may get optimized a bit, so we
- // can't always fail cleanly for validation without taking
- // a look at the filter stages.
- //
- EventFilter.bind (producer, consumer);
- producer.parse (input);
-
- try {
- if (producer.getFeature (
- "http://org.xml/sax/features/validation"))
- exitStatus = ((errorCount + fatalCount) > 0) ? 1 : 0;
- else if (fatalCount == 0)
- exitStatus = 0;
- } catch (SAXException e) {
- if (hasValidator (consumer))
- exitStatus = ((errorCount + fatalCount) > 0) ? 1 : 0;
- else if (fatalCount == 0)
- exitStatus = 0;
- }
-
- } catch (java.net.MalformedURLException e) {
- System.err.println ("** Malformed URL: " + e.getMessage ());
- System.err.println ("Is '" + argv [0] + "' a non-existent file?");
- e.printStackTrace ();
- // e.g. FNF
-
- } catch (SAXParseException e) {
- if (e != fatal) {
- System.err.print (printParseException ("Parsing Aborted", e));
- e.printStackTrace ();
- if (e.getException () != null) {
- System.err.println ("++ Wrapped exception:");
- e.getException ().printStackTrace ();
- }
- }
-
- } catch (SAXException e) {
- Exception x = e;
- if (e.getException () != null)
- x = e.getException ();
- x.printStackTrace ();
-
- } catch (Throwable t) {
- t.printStackTrace ();
- }
-
- System.exit (exitStatus);
- }
-
- // returns true if saw a validator (before end or unrecognized node)
- // false otherwise
- private static boolean hasValidator (EventConsumer e)
- {
- if (e == null)
- return false;
- if (e instanceof ValidationConsumer)
- return true;
- if (e instanceof TeeConsumer) {
- TeeConsumer t = (TeeConsumer) e;
- return hasValidator (t.getFirst ())
- || hasValidator (t.getRest ());
- }
- if (e instanceof WellFormednessFilter
- || e instanceof NSFilter
- )
- return hasValidator (((EventFilter)e).getNext ());
-
- // else ... gee, we can't know. Assume not.
-
- return false;
- }
-
- static class MyErrorHandler implements ErrorHandler
- {
- // dump validation errors, but continue
- public void error (SAXParseException e)
- throws SAXParseException
- {
- errorCount++;
- System.err.print (printParseException ("Error", e));
- }
-
- public void warning (SAXParseException e)
- throws SAXParseException
- {
- // System.err.print (printParseException ("Warning", e));
- }
-
- // try to continue fatal errors, in case a parser reports more
- public void fatalError (SAXParseException e)
- throws SAXParseException
- {
- fatalCount++;
- if (fatal == null)
- fatal = e;
- System.err.print (printParseException ("Nonrecoverable Error", e));
- }
- }
-
- static private String printParseException (
- String label,
- SAXParseException e
- ) {
- StringBuffer buf = new StringBuffer ();
- int temp;
-
- buf.append ("** ");
- buf.append (label);
- buf.append (": ");
- buf.append (e.getMessage ());
- buf.append ('\n');
- if (e.getSystemId () != null) {
- buf.append (" URI: ");
- buf.append (e.getSystemId ());
- buf.append ('\n');
- }
- if ((temp = e.getLineNumber ()) != -1) {
- buf.append (" line: ");
- buf.append (temp);
- buf.append ('\n');
- }
- if ((temp = e.getColumnNumber ()) != -1) {
- buf.append (" char: ");
- buf.append (temp);
- buf.append ('\n');
- }
-
- return buf.toString ();
- }
-}
diff --git a/libjava/gnu/xml/util/DomParser.java b/libjava/gnu/xml/util/DomParser.java
deleted file mode 100644
index b28b6103b70..00000000000
--- a/libjava/gnu/xml/util/DomParser.java
+++ /dev/null
@@ -1,804 +0,0 @@
-/* DomParser.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util;
-
-import java.util.Enumeration;
-import java.util.Locale;
-
-import org.xml.sax.*;
-import org.xml.sax.helpers.AttributesImpl;
-import org.xml.sax.helpers.NamespaceSupport;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.DefaultHandler2;
-import org.xml.sax.ext.LexicalHandler;
-
-import org.w3c.dom.*;
-
-
-/**
- * This parser emits SAX2 parsing events as it traverses a DOM tree, using
- * any conformant implementation of DOM. It exposes all SAX1 features,
- * and the following SAX2 features and properties (as
- * identified by standard URIs which are not fully provided here). Note
- * that if a Level 1 DOM implementation is given, then this behaves as if
- * namespaces were disabled, and namespace prefixes were enabled. </p>
- *
- * <table border="1" width='100%' cellpadding='3' cellspacing='0'>
- * <tr bgcolor='#ccccff'>
- * <th><font size='+1'>Name</font></th>
- * <th><font size='+1'>Notes</font></th></tr>
- *
- * <tr><td colspan=2><center><em>Features ... URL prefix is
- * <b>http://xml.org/sax/features/</b></em></center></td></tr>
- *
- * <tr><td>(URL)/external-general-entities</td>
- * <td>false (does no parsing)</td></tr>
- * <tr><td>(URL)/external-parameter-entities</td>
- * <td>false (does no parsing)</td></tr>
- * <tr><td>(URL)/namespaces</td>
- * <td>Value is fixed at <em>true</em></td></tr>
- * <tr><td>(URL)/namespace-prefixes</td>
- * <td>Value is settable, defaulting to <em>false</em>
- * (<code>xmlns</code> attributes hidden, and names aren't prefixed)
- * </td></tr>
- * <tr><td>(URL)/string-interning</td>
- * <td>Value is fixed at <em>false</em> (DOM provides no
- * guarantees as to interning)</td></tr>
- * <tr><td>(URL)/validation</td>
- * <td>false (does no parsing)</td></tr>
- * <tr><td>(URL)/lexical-handler/parameter-entities</td>
- * <td>false (DOM doesn't do parameter entities)</td></tr>
- *
- * <tr><td colspan=2><center><em>Properties ... URL prefix is
- * <b>http://xml.org/sax/properties/</b></em></center></td></tr>
- *
- *
- * <tr><td>(URL)/dom-node</td>
- * <td>This property may be set before parsing to hold a DOM
- * <em>Document</em> node; any arguments given to <em>parse</em>
- * methods are ignored. When retrieved
- * during a parse, this value contains the "current" DOM node.
- * </td></tr>
- * <tr><td>(URL)/declaration-handler</td>
- * <td>A declaration handler may be provided. Declaration of external
- * general entities is exposed, but not parameter entities; none of the
- * entity names reported here will begin with "%". </td></tr>
- * <tr><td>(URL)/lexical-handler</td>
- * <td>A lexical handler may be provided. While the start and end of
- * any external subset are reported, expansion of other parameter
- * entities (e.g. inside attribute list declarations) is not exposed.
- * Expansion of general entities within attributes is also not exposed
- * (see below).</td></tr>
- * </table>
- *
- * <P> The consequences of modifying a DOM document tree as it is being walked
- * by this "parser" are unspecified; don't do it! </P>
- *
- * @author David Brownell
- */
-final public class DomParser implements XMLReader
-{
- // Stuff used internally to route events correctly
- private DefaultHandler2 defaultHandler = new DefaultHandler2 ();
-
- // per-parse SAX stuff
- private ContentHandler contentHandler = defaultHandler;
- private DTDHandler dtdHandler = defaultHandler;
- private DeclHandler declHandler = defaultHandler;
- private LexicalHandler lexicalHandler = defaultHandler;
-
- // shared context
- private ErrorHandler errHandler = defaultHandler;
- private EntityResolver resolver = defaultHandler;
- private Locale locale = Locale.getDefault ();
-
- // parser state
- private Node start;
- private Node current;
- private boolean isL2;
- private boolean showNamespaces = true;
- private boolean showXML1_0 = false;
- private NamespaceSupport prefixStack = new NamespaceSupport ();
- private boolean isDocument;
-
-
- /**
- * Constructs an unitialized <b>SAX2</b> parser.
- */
- public DomParser () {
- }
-
- /**
- * Constructs an <b>SAX2</b> parser initialized to traverse the specified
- * DOM tree. If the node is a document, the startDocument() and
- * endDocument() calls bracket the calls exposing children.
- */
- public DomParser (Node node) {
- setStart (node);
- }
-
-
- // stuff that most components in an application should be sharing:
- // resolver and error locale.
-
- /**
- * <b>SAX2</b>: Returns the object used when resolving external
- * entities during parsing (both general and parameter entities).
- */
- public EntityResolver getEntityResolver ()
- {
- return resolver;
- }
-
- /**
- * <b>SAX1</b>: Provides an object which may be used when resolving external
- * entities during parsing (both general and parameter entities).
- */
- public void setEntityResolver (EntityResolver resolver)
- {
- if (resolver == null)
- resolver = defaultHandler;
- this.resolver = resolver;
- }
-
- /**
- * <b>SAX1</b>: Identifies the locale which the parser should use for the
- * diagnostics it provides.
- *
- * @exception SAXException as defined in the specification for
- * <em>org.xml.sax.Parser.setLocale()</em>
- */
- public void setLocale (Locale locale)
- throws SAXException
- {
- if (locale == null)
- locale = Locale.getDefault ();
- this.locale = locale;
- }
-
-
- // different modules will tend to handle error handling the same,
- // but it may not be the same through the whole app
-
- /**
- * <b>SAX2</b>: Returns the object used to receive callbacks for XML
- * errors of all levels (fatal, nonfatal, warning).
- */
- public ErrorHandler getErrorHandler ()
- {
- return errHandler;
- }
-
- /**
- * <b>SAX1</b>: Provides an object which receives callbacks for XML errors
- * of all levels (fatal, nonfatal, warning).
- */
- public void setErrorHandler (ErrorHandler handler)
- {
- if (handler == null)
- handler = defaultHandler;
- errHandler = handler;
- }
-
-
- // stuff different parts of a module will handle differently
-
- /**
- * <b>SAX2</b>: Returns the object used to report the logical
- * content of an XML document.
- */
- public ContentHandler getContentHandler ()
- {
- return contentHandler;
- }
-
- /**
- * <b>SAX2</b>: Assigns the object used to report the logical
- * content of an XML document.
- */
- public void setContentHandler (ContentHandler handler)
- {
- if (handler == null)
- handler = defaultHandler;
- contentHandler = handler;
- }
-
- /**
- * <b>SAX2</b>: Returns the object used to process declarations related
- * to notations and unparsed entities.
- */
- public DTDHandler getDTDHandler ()
- {
- return dtdHandler;
- }
-
- /**
- * <b>SAX1</b>: Provides an object which may be used to intercept
- * declarations related to notations and unparsed entities.
- */
- public void setDTDHandler (DTDHandler handler)
- {
- if (handler == null)
- handler = defaultHandler;
- dtdHandler = handler;
- }
-
-
- /**
- * <b>SAX1</b>: Parses the previously provided DOM document (the
- * input parameter is ignored). When this returns, that same
- * document may be parsed again without needing a "reset".
- *
- * @param uri ignored (pass an empty string)
- * @exception SAXException as defined in the specification for
- * <em>org.xml.sax.Parser.parse()</em>
- */
- public void parse (String uri) throws SAXException
- {
- parse ();
- }
-
- /**
- * <b>SAX1</b>: Parses the previously provided DOM document (the
- * input parameter is ignored). When this returns, that same
- * document may be parsed again without needing a "reset".
- *
- * @param input ignored
- * @exception SAXException as defined in the specification for
- * <em>org.xml.sax.Parser.parse()</em>
- */
- public void parse (InputSource input) throws SAXException
- {
- parse ();
- }
-
- private void parse () throws SAXException
- {
- try {
- walk ();
- } finally {
- if (isDocument)
- contentHandler.endDocument ();
- current = null;
- prefixStack.reset ();
- }
- }
-
- private boolean getIsL2 (Node node)
- {
- DOMImplementation impl;
- Document doc;
-
- if (node instanceof Document)
- doc = (Document) node;
- else
- doc = node.getOwnerDocument ();
- if (doc == null)
- throw new RuntimeException ("? unowned node - L2 DTD ?");
- impl = doc.getImplementation ();
- return impl.hasFeature ("XML", "2.0");
- }
-
-
- private static final String FEATURES = "http://xml.org/sax/features/";
- private static final String HANDLERS = "http://xml.org/sax/properties/";
-
- /**
- * <b>SAX2</b>: Tells whether this parser supports the specified feature.
- */
- public boolean getFeature (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- // basically, none are relevant -- they relate more to
- // parsing than to walking a "parse tree".
-
- // FIXME: DOM feature to expose interning?
-
- if ((FEATURES + "validation").equals (name)
- || (FEATURES + "external-general-entities")
- .equals (name)
- || (FEATURES + "external-parameter-entities")
- .equals (name)
- || (FEATURES + "string-interning").equals (name)
- )
- return false;
-
- if ((FEATURES + "namespaces").equals (name))
- return showNamespaces;
- if ((FEATURES + "namespace-prefixes").equals (name))
- return showXML1_0;
-
- throw new SAXNotRecognizedException (name);
- }
-
- /**
- * <b>SAX2</b>: Returns the specified property. At this time only
- * the declaration and lexical handlers, and current the "DOM" node,
- * are supported.
- */
- public Object getProperty (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if ((HANDLERS + "declaration-handler").equals (name))
- return declHandler == defaultHandler ? null : declHandler;
- if ((HANDLERS + "lexical-handler").equals (name))
- return lexicalHandler == defaultHandler ? null : lexicalHandler;
-
- if ((HANDLERS + "dom-node").equals (name))
- return current;
-
- // unknown properties
- throw new SAXNotRecognizedException (name);
- }
-
- /**
- * <b>SAX2</b>: Sets the state of features supported in this parser.
- * Only the namespace support features are mutable.
- */
- public void setFeature (String name, boolean state)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (current != null)
- throw new IllegalStateException ("feature change midparse");
-
- boolean value = getFeature (name);
-
- if (value == state)
- return;
-
- if ((FEATURES + "namespaces").equals (name)) {
- if (!showXML1_0 && state == false)
- throw new SAXNotSupportedException ("Illegal namespace "
- + "processing configuration");
- showNamespaces = state;
- return;
- }
- if ((FEATURES + "namespace-prefixes").equals (name)) {
- if (!showNamespaces && state == false)
- throw new SAXNotSupportedException ("Illegal namespace "
- + "processing configuration");
- showXML1_0 = state;
- return;
- }
-
- throw new SAXNotSupportedException (name);
- }
-
- /**
- * <b>SAX2</b>: Assigns the specified property. At this time only
- * declaration and lexical handlers, and the initial DOM document, are
- * supported. These must not be changed to values of the wrong type.
- * Like SAX1 handlers, these handlers may be changed at any time.
- * Like SAX1 input source or document URI, the initial DOM document
- * may not be changed during a parse.
- */
- public void setProperty (String name, Object state)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if ((HANDLERS + "declaration-handler").equals (name)) {
- if (!(state instanceof DeclHandler || state == null))
- throw new SAXNotSupportedException (name);
- declHandler = (DeclHandler) state;
- return;
- }
-
- if ((HANDLERS + "lexical-handler").equals (name)) {
- if (!(state instanceof LexicalHandler || state == null))
- throw new SAXNotSupportedException (name);
- lexicalHandler = (LexicalHandler) state;
- return;
- }
-
- if ((HANDLERS + "dom-node").equals (name)) {
- if (state == null || state instanceof Node) {
- if (current != null)
- throw new SAXNotSupportedException (
- "property is readonly during parse: " + name);
- setStart ((Node) state);
- return;
- }
- throw new SAXNotSupportedException ("not a DOM Node");
- }
-
- // unknown properties
- throw new SAXNotRecognizedException (name);
- }
-
- private void setStart (Node property)
- {
- start = property;
- if (start != null) {
- isL2 = getIsL2 (start);
- isDocument = (start instanceof Document);
- }
- }
-
- //
- // Non-recursive walk, using DOM state when backtracking is needed
- //
- private void walk ()
- throws SAXException
- {
- int type;
- NamedNodeMap nodes;
- int length;
- AttributesImpl attrs = new AttributesImpl ();
- char chars [];
- String ns, local;
-
- synchronized (this) {
- if (current != null)
- throw new IllegalStateException ("already walking tree");
-
- // JVM guarantees assignments are atomic; so no other
- // thread could get this far till this walk's done.
- current = start;
- }
-
- for (;;) {
- type = current.getNodeType ();
-
- //
- // First, visit the current node, including any "start" calls
- //
- switch (type) {
-
- case Node.DOCUMENT_NODE:
- contentHandler.startDocument ();
- break;
-
- case Node.ELEMENT_NODE:
- nodes = current.getAttributes ();
- length = nodes.getLength ();
- prefixStack.pushContext ();
- for (int i = 0; i < length; i++) {
- Attr attr = (Attr) nodes.item (i);
- String name = attr.getNodeName ();
-
- if (showNamespaces && name.startsWith ("xmlns")) {
- String prefix;
- String uri;
-
- // NOTE: DOM L2 (CR2+ and REC) violate the
- // Namespaces REC, treat "xmlns" like a strange
- // attribute instead of a magic token
- if ("xmlns".equals (name))
- prefix = "";
- else
- prefix = name.substring (6);
- uri = attr.getNodeValue ();
-
- prefixStack.declarePrefix (prefix, uri);
- contentHandler.startPrefixMapping (prefix, uri);
-
- if (!showXML1_0)
- continue;
- }
-
- //
- // NOTE: DOM doesn't record the attribute type info
- // which SAX exposes; so this always reports CDATA.
- //
- // NOTE: SAX doesn't expose the isSpecified info which
- // DOM exposes; that's discarded here. Similarly with
- // the information DOM hides inside itself about what
- // the default values for an attribute are.
- //
- if (showNamespaces) {
- if (isL2) {
- if ((ns = attr.getNamespaceURI ()) == null)
- ns = "";
- // Note: SAX2 and DOM handle "local" names
- // differently
- if ((local = attr.getLocalName ()) == null)
- local = name;
- } else {
-// XXX
- throw new RuntimeException (
- "NYI, ns lookup when parsing L1 DOM");
- }
- } else
- ns = local = "";
- attrs.addAttribute (ns, local, name,
- "CDATA", attr.getNodeValue ());
- }
- if (showNamespaces) {
- if (isL2) {
- if ((ns = current.getNamespaceURI ()) == null)
- ns = "";
- // Note: SAX2 and DOM handle "local" names differently
- if ((local = current.getLocalName ()) == null)
- local = current.getNodeName ();
- } else {
-// XXX
- throw new RuntimeException (
- "NYI, ns lookup when parsing L1 DOM");
- }
- } else
- ns = local = "";
- contentHandler.startElement (ns, local,
- current.getNodeName (), attrs);
- if (length != 0)
- attrs.clear ();
- break;
-
- case Node.CDATA_SECTION_NODE:
- lexicalHandler.startCDATA ();
- chars = current.getNodeValue ().toCharArray ();
- contentHandler.characters (chars, 0, chars.length);
- lexicalHandler.endCDATA ();
- break;
-
- case Node.COMMENT_NODE:
- chars = current.getNodeValue ().toCharArray ();
- lexicalHandler.comment (chars, 0, chars.length);
- break;
-
- case Node.DOCUMENT_TYPE_NODE:
- {
- DocumentType doctype = (DocumentType) current;
-
- //
- // Only DOM L2 supports recreating even some DTDs in full.
- //
- if (isL2) {
- lexicalHandler.startDTD (doctype.getName (),
- doctype.getPublicId (),
- doctype.getSystemId ());
- } else
- lexicalHandler.startDTD (doctype.getName (),
- null, null);
-
- //
- // The only sure way to recreate is to provide both the
- // internal and external subsets. Otherwise, only part
- // of the job can be done ... because from the DTD, DOM
- // discards both the critical data, like the attribute and
- // element declarations, as well as the PIs and comments
- // that are used to hold their documentation.
- //
- // Even the entity and notation declarations that it can
- // expose can't be recorded without proprietary extensions.
- //
- // We construct a comment to tell what we know about how
- // (in)complete this particular really DTD is.
- //
- {
- String message;
- char buf [];
-
- //
- // Though DOM L2 lets the whole doctype be recreated,
- // SAX2 can't represent it (input or output).
- // So this will be the typical case.
- //
- if (isL2 && doctype.getInternalSubset () != null)
- message =
- " Full DTD known; can't be shown using SAX2. ";
-
- //
- // Otherwise, we'll concoct a partial DTD. If there's
- // any more data here at all, it was provided using a
- // (proprietary) extension to DOM.
- //
- else
- message =
- " This DTD was was recreated using incomplete DOM L2 records. ";
-
- buf = message.toCharArray ();
- lexicalHandler.comment (buf, 0, buf.length);
- }
-
- // report notations first
- nodes = doctype.getNotations ();
- length = nodes.getLength ();
- for (int i = 0; i < length; i++) {
- Notation notation = (Notation) nodes.item (i);
- dtdHandler.notationDecl (
- notation.getNodeName (),
- notation.getPublicId (),
- notation.getSystemId ());
- }
-
- // then parsed and unparsed external general entities
- nodes = doctype.getEntities ();
- length = nodes.getLength ();
- for (int i = 0; i < length; i++) {
- Entity entity = (Entity) nodes.item (i);
- String notation = entity.getNotationName ();
-
- if (notation != null)
- dtdHandler.unparsedEntityDecl (
- entity.getNodeName (),
- entity.getPublicId (),
- entity.getSystemId (),
- notation);
- else if (entity.getSystemId () != null)
- declHandler.externalEntityDecl (
- entity.getNodeName (),
- entity.getPublicId (),
- entity.getSystemId ());
-
- //
- // NOTE: DOM doesn't clearly provide internal
- // entity support; but in case someone tries to
- // fudge such support, we defend ourselves above.
- //
- // NOTE: DOM doesn't expose parameter entities
- // (thank you thank you thank you thank you)
- //
- }
-
- //
- // NOTE: DOM (levels 1 and 2) doesn't expose real
- // typing information (element or attribute decls),
- // as exposed by SAX2 declaration handlers.
- //
- lexicalHandler.endDTD ();
- }
- break;
-
- case Node.ENTITY_REFERENCE_NODE:
- // this isn't done except (a) in content, and
- // (b) not within a start tag (att value)
- lexicalHandler.startEntity (current.getNodeName ());
- break;
-
- case Node.PROCESSING_INSTRUCTION_NODE:
- contentHandler.processingInstruction (
- current.getNodeName (), current.getNodeValue ());
- break;
-
- case Node.TEXT_NODE:
- chars = current.getNodeValue ().toCharArray ();
- contentHandler.characters (chars, 0, chars.length);
- break;
-
- default:
- // e.g. fragments, entities, notations, attributes
- throw new SAXException ("Illegal DOM Node type in Document: "
- + current.getNodeType ());
- }
-
- //
- // Then, pick the next node to visit. If the next node isn't
- // a child, an "end" call may be needed before moving on.
- // If there's no next node, we're done.
- //
- Node next;
-
- switch (type) {
- case Node.DOCUMENT_NODE:
- case Node.ELEMENT_NODE:
- case Node.ENTITY_REFERENCE_NODE:
- //
- // For elements that can have children, visit those
- // children before any siblings (i.e. depth first)
- // and after visiting this node (i.e. preorder)
- //
- next = current.getFirstChild ();
- if (next != null) {
- current = next;
- break;
- }
- //
- // Else treat this like other childless nodes, but
- // handle this node's "end" immediately.
- //
- callEnd (current);
-
- // FALLTHROUGH
-
- case Node.CDATA_SECTION_NODE:
- case Node.COMMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- case Node.ENTITY_NODE:
- case Node.PROCESSING_INSTRUCTION_NODE:
- case Node.TEXT_NODE:
- //
- // Use next sibling, if there is one.
- // Else, climb up a level (calling "end")
- // until we find an ancestral sibling
- // or until we we climb off the top (FINISH)
- //
- for (;;) {
- if ((next = current.getNextSibling ()) != null)
- break;
- current = current.getParentNode ();
- if (current == null || current == start)
- return;
- callEnd (current);
- }
- current = next;
- break;
-
- default:
- throw new SAXException (
- "Illegal DOM Node type found: " + current.getNodeType ());
- }
- }
- }
-
- private void callEnd (Node node) throws SAXException
- {
- switch (node.getNodeType ()) {
- // only these three container types may ever be found
- // directly inside a Document.
- case Node.DOCUMENT_NODE:
- // for SAX conformance, endDocument must always
- // be called ... it's done in a "finally" clause)
- return;
-
- case Node.ELEMENT_NODE:
- if (showNamespaces) {
- if (isL2)
- contentHandler.endElement (
- node.getNamespaceURI (),
- node.getLocalName (),
- node.getNodeName ());
- else
-// XXX
- throw new RuntimeException (
- "NYI, ns lookup when parsing L1 DOM");
- for (Enumeration e = prefixStack.getDeclaredPrefixes ();
- e.hasMoreElements ();
- ) {
- contentHandler.endPrefixMapping ((String) e.nextElement ());
- }
- } else
- contentHandler.endElement ("", "", node.getNodeName ());
- prefixStack.popContext ();
- return;
-
- case Node.ENTITY_REFERENCE_NODE:
- // see above -- in content, outside start tags.
- lexicalHandler.endEntity (node.getNodeName ());
- return;
-
- // these can be given at the top level
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.ATTRIBUTE_NODE:
- return;
-
- default:
- throw new SAXException (
- "Illegal DOM container type found: "
- + current.getNodeType ());
- }
- }
-}
diff --git a/libjava/gnu/xml/util/Resolver.java b/libjava/gnu/xml/util/Resolver.java
deleted file mode 100644
index e84b5ade106..00000000000
--- a/libjava/gnu/xml/util/Resolver.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/* Resolver.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Dictionary;
-
-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
- * network utilization of SAX based XML components. It does this by
- * supporting local caches of external entities.
- * SAX parsers <em>should</em> use such local caches when possible.
- *
- * @see XCat
- */
-public class Resolver implements EntityResolver, Cloneable
-{
- /**
- * Updates a dictionary used to map PUBLIC identifiers to file names,
- * so that it uses the mappings in a specified directory.
- *
- * @param mappings Array of string pairs, where the first member
- * of each pair is a PUBLIC identifier and the second is the
- * name of a file, relative to the specified directory.
- * @param directory File holding the specified files.
- */
- public static void addDirectoryMapping (
- Dictionary table,
- String mappings [][],
- File directory
- ) throws IOException
- {
- for (int i = 0; i < mappings.length; i++) {
- File file = new File (directory, mappings [i][1]);
- String temp;
-
- if (!file.exists ()) // ?? log a warning ??
- continue;
-
- temp = fileToURL (file);
- table.put (mappings [i][0], temp);
- }
- }
-
- // FIXME: these *URL routines don't quite belong here, except
- // that they're all in the same spirit of making it easy to
- // use local filesystem URIs with XML parsers.
-
- /**
- * Provides the URL for a named file, without relying on the JDK 1.2
- * {@link java.io.File#toURL File.toURL}() utility method.
- *
- * @param filename the file name to convert. Relative file names
- * are resolved the way the JVM resolves them (current to the
- * process-global current working directory).
- *
- * @exception IOException if the file does not exist
- */
- public static String fileNameToURL (String filename)
- throws IOException
- {
- return fileToURL (new File (filename));
- }
-
- /**
- * Provides the URL for a file, without relying on the JDK 1.2
- * {@link java.io.File#toURL File.toURL}() utility method.
- *
- * @param f the file to convert. Relative file names
- * are resolved the way the JVM resolves them (current to the
- * process-global current working directory).
- *
- * @exception IOException if the file does not exist
- */
- public static String fileToURL (File f)
- throws IOException
- {
- String temp;
-
- // NOTE: the javax.xml.parsers.DocumentBuilder and
- // javax.xml.transform.stream.StreamSource versions
- // of this don't have this test. Some JVM versions
- // don't report this error sanely through URL code.
- if (!f.exists ())
- throw new IOException ("no such file: " + f.getName ());
-
- // FIXME: getAbsolutePath() seems buggy; I'm seeing components
- // like "/foo/../" which are clearly not "absolute"
- // and should have been resolved with the filesystem.
-
- // Substituting "/" would be wrong, "foo" may have been
- // symlinked ... the URL code will make that change
- // later, so that things can get _really_ broken!
-
- temp = f.getAbsolutePath ();
-
- if (File.separatorChar != '/')
- temp = temp.replace (File.separatorChar, '/');
- if (!temp.startsWith ("/"))
- temp = "/" + temp;
- if (!temp.endsWith ("/") && f.isDirectory ())
- temp = temp + "/";
- return "file:" + temp;
- }
-
-
- /**
- * Returns a URL string. Note that if a malformed URL is provided, or
- * the parameter names a nonexistent file, the resulting URL may be
- * malformed.
- *
- * @param fileOrURL If this is the name of a file which exists,
- * then its URL is returned. Otherwise the argument is returned.
- */
- public static String getURL (String fileOrURL)
- {
- try {
- return fileNameToURL (fileOrURL);
- } catch (Exception e) {
- return fileOrURL;
- }
- }
-
-
-
- // note: cloneable, this is just copied; unguarded against mods
- private Dictionary pubidMapping;
-
- /**
- * Constructs a resolver which understands how to map PUBLIC identifiers
- * to other URIs, typically for local copies of standard DTD components.
- *
- * @param dictionary maps PUBLIC identifiers to URIs. This is not
- * copied; subsequent modifications will be reported through the
- * resolution operations.
- */
- public Resolver (Dictionary dict)
- { pubidMapping = dict; }
-
-
- // FIXME: want notion of a "system default" resolver, presumably
- // loaded with all sorts of useful stuff. At the same time need
- // a notion of resolver chaining (failure --> next) so that subsystems
- // can set up things that won't interfere with other ones.
-
- /**
- * This parses most MIME content type strings that have <em>charset=...</em>
- * encoding declarations to and returns the specified encoding. This
- * conforms to RFC 3023, and is useful when constructing InputSource
- * objects from URLConnection objects or other objects using MIME
- * content typing.
- *
- * @param contentType the MIME content type that will be parsed; must
- * not be null.
- * @return the appropriate encoding, or null if the content type is
- * not text and there's no <code>charset=...</code> attribute
- */
- static public String getEncoding (String contentType)
- {
- // currently a dumb parsing algorithm that works "mostly" and handles
- // ..anything...charset=ABC
- // ..anything...charset=ABC;otherAttr=DEF
- // ..anything...charset=ABC (comment);otherAttr=DEF
- // ..anything...charset= "ABC" (comment);otherAttr=DEF
-
- int temp;
- String encoding;
- String defValue = null;
-
- if (contentType.startsWith ("text/"))
- defValue = contentType.startsWith ("text/html")
- ? "ISO-8859-1" : "US-ASCII";
-
- // Assumes 'charset' is only an attribute name, not part
- // of a value, comment, or other attribute name
- // ALSO assumes no escaped values like "\;" or "\)"
- if ((temp = contentType.indexOf ("charset")) != -1) {
- // strip out everything up to '=' ...
- temp = contentType.indexOf ('=', temp);
- if (temp == -1)
- return defValue;
- encoding = contentType.substring (temp + 1);
- // ... and any subsequent attributes
- if ((temp = encoding.indexOf (';')) != -1)
- encoding = encoding.substring (0, temp);
- // ... and any comments after value
- if ((temp = encoding.indexOf ('(')) != -1)
- encoding = encoding.substring (0, temp);
- // ... then whitespace, and any (double) quotes
- encoding = encoding.trim ();
- if (encoding.charAt (0) == '"')
- encoding = encoding.substring (1, encoding.length () - 1);
- } else
- encoding = defValue;
- return encoding;
- }
-
-
- /**
- * Uses a local dictionary of public identifiers to resolve URIs,
- * normally with the goal of minimizing network traffic or latencies.
- */
- public InputSource resolveEntity (String publicId, String systemId)
- throws IOException, SAXException
- {
- InputSource retval = null;
- String uri;
-
- if (publicId != null
- && ((uri = (String) pubidMapping.get (publicId)) != null)) {
- retval = new InputSource (uri);
- retval.setPublicId (publicId);
- }
-
- // Could do URN resolution here
-
- // URL resolution always done by parser
-
- // FIXME: chain to "next" resolver
-
- return retval;
- }
-}
diff --git a/libjava/gnu/xml/util/SAXNullTransformerFactory.java b/libjava/gnu/xml/util/SAXNullTransformerFactory.java
deleted file mode 100644
index 81ad8231270..00000000000
--- a/libjava/gnu/xml/util/SAXNullTransformerFactory.java
+++ /dev/null
@@ -1,676 +0,0 @@
-/* SAXNullTransformerFactory.java --
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Hashtable;
-import java.util.Properties;
-
-import gnu.xml.dom.Consumer;
-import gnu.xml.dom.DomDocument;
-import gnu.xml.pipeline.DomConsumer;
-import gnu.xml.pipeline.EventFilter;
-
-import javax.xml.transform.*;
-import javax.xml.transform.dom.*;
-import javax.xml.transform.sax.*;
-import javax.xml.transform.stream.*;
-
-import org.xml.sax.*;
-import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.helpers.LocatorImpl;
-
-
-/**
- * Implements null transforms. XSLT stylesheets are not supported.
- * This class provides a way to translate three representations of
- * XML data (SAX event stream, DOM tree, and XML text) into each other.
- * In essence it's a thinnish wrapper around basic SAX event
- * <a href="../pipeline/package-summary.html">pipeline</a> facilities, which
- * exposes only limited functionality. The <em>javax.xml.transform</em>
- * functionality is implemented as follows: <ul>
- *
- * <li>The {@link javax.xml.transform.sax.SAXSource SAXSource} class
- * just wraps an {@link XMLReader} and {@link InputSource}, while the
- * {@link javax.xml.transform.sax.SAXResult SAXResult} class is less
- * functional than a {@link gnu.xml.pipeline.EventConsumer EventConsumer}.
- * (Notably, it drops all but one declaration from any DTD.)</li>
- *
- * <li>The {@link javax.xml.transform.dom.DOMSource DOMSource} class
- * corresponds to special SAX parsers like {@link DomParser}, and the
- * {@link javax.xml.transform.dom.DOMResult DOMResult} class corresponds
- * to a {@link gnu.xml.pipeline.DomConsumer DomConsumer}.</li>
- *
- * <li>The {@link javax.xml.transform.stream.StreamSource StreamSource}
- * class corresponds to a SAX {@link InputSource}, and the
- * {@link javax.xml.transform.stream.StreamResult StreamResult} class
- * corresponds to a {@link gnu.xml.pipeline.TextConsumer TextConsumer}.</li>
- *
- * </ul>
- *
- * <p><em>This implementation is preliminary.</em>
- *
- * @see gnu.xml.pipeline.XsltFilter
- *
- * @author David Brownell
- */
-public class SAXNullTransformerFactory extends SAXTransformerFactory
-{
-
- private ErrorListener errListener;
- private URIResolver uriResolver;
-
- /** Default constructor */
- public SAXNullTransformerFactory () { }
-
- //
- // only has stuff that makes sense with null transforms
- //
-
- /**
- * Returns true if the requested feature is supported.
- * All three kinds of input and output are accepted:
- * XML text, SAX events, and DOM nodes.
- */
- public boolean getFeature (String feature)
- {
- return SAXTransformerFactory.FEATURE.equals (feature)
- || SAXResult.FEATURE.equals (feature)
- || SAXSource.FEATURE.equals (feature)
- || DOMResult.FEATURE.equals (feature)
- || DOMSource.FEATURE.equals (feature)
- || StreamResult.FEATURE.equals (feature)
- || StreamSource.FEATURE.equals (feature)
- ;
- }
-
- public void setFeature(String name, boolean value)
- throws TransformerConfigurationException
- {
- throw new TransformerConfigurationException(name);
- }
-
-
- /** Throws an exception (no implementation attributes are supported) */
- public void setAttribute (String key, Object value)
- {
- throw new IllegalArgumentException ();
- }
-
- /** Throws an exception (no implementation attributes are supported) */
- public Object getAttribute (String key)
- {
- throw new IllegalArgumentException ();
- }
-
- /** (not yet implemented) */
- public Source getAssociatedStylesheet (Source source,
- String media,
- String title,
- String charset)
- throws TransformerConfigurationException
- {
- // parse, and find the appropriate xsl-stylesheet PI contents
- throw new IllegalArgumentException ();
- }
-
- public Transformer newTransformer ()
- throws TransformerConfigurationException
- {
- return new NullTransformer ();
- }
-
- /**
- * Returns a TransformerHandler that knows how to generate output
- * in all three standard formats. Output text is generated using
- * {@link XMLWriter}, and the GNU implementation of
- * {@link DomDocument DOM} is used.
- *
- * @see SAXResult
- * @see StreamResult
- * @see DOMResult
- */
- public TransformerHandler newTransformerHandler ()
- throws TransformerConfigurationException
- {
- NullTransformer transformer = new NullTransformer ();
- return transformer.handler;
- }
-
- //
- // Stuff that depends on XSLT support, which we don't provide
- //
- private static final String noXSLT = "No XSLT support";
-
- /** Throws an exception (XSLT is not supported). */
- public Transformer newTransformer (Source stylesheet)
- throws TransformerConfigurationException
- {
- throw new TransformerConfigurationException (noXSLT);
- }
-
- /** Throws an exception (XSLT is not supported). */
- public Templates newTemplates (Source stylesheet)
- throws TransformerConfigurationException
- {
- throw new TransformerConfigurationException (noXSLT);
- }
-
- /** Throws an exception (XSLT is not supported). */
- public TemplatesHandler newTemplatesHandler ()
- throws TransformerConfigurationException
- {
- throw new TransformerConfigurationException (noXSLT);
- }
-
- /** Throws an exception (XSLT is not supported). */
- public TransformerHandler newTransformerHandler (Source stylesheet)
- throws TransformerConfigurationException
- {
- throw new TransformerConfigurationException (noXSLT);
- }
-
- /** Throws an exception (XSLT is not supported). */
- public TransformerHandler newTransformerHandler (Templates stylesheet)
- throws TransformerConfigurationException
- {
- throw new TransformerConfigurationException (noXSLT);
- }
-
- /** Throws an exception (XSLT is not supported). */
- public XMLFilter newXMLFilter (Source stylesheet)
- throws TransformerConfigurationException
- {
- throw new TransformerConfigurationException (noXSLT);
- }
-
- /** Throws an exception (XSLT is not supported). */
- public XMLFilter newXMLFilter (Templates stylesheet)
- throws TransformerConfigurationException
- {
- throw new TransformerConfigurationException (noXSLT);
- }
-
- /** Returns the value assigned by {@link #setErrorListener}. */
- public ErrorListener getErrorListener ()
- {
- return errListener;
- }
-
- /** Assigns a value that would be used when parsing stylesheets */
- public void setErrorListener (ErrorListener e)
- {
- errListener = e;
- }
-
- /** Returns the value assigned by {@link #setURIResolver}. */
- public URIResolver getURIResolver ()
- {
- return uriResolver;
- }
-
- /** Assigns a value that would be used when parsing stylesheets */
- public void setURIResolver (URIResolver u)
- {
- uriResolver = u;
- }
-
-
- //
- // Helper classes. These might in theory be subclassed
- // by an XSLT implementation, if they were exported.
- //
-
- static class DomTerminus
- extends DomConsumer
- {
-
- DomTerminus (DOMResult result)
- throws SAXException
- {
- // won't really throw SAXException
- super (DomDocument.class);
- setHandler (new DomHandler (this, result));
- }
-
- }
-
- static class DomHandler
- extends Consumer.Backdoor
- {
-
- private DOMResult result;
-
- DomHandler (DomConsumer c, DOMResult r)
- throws SAXException
- {
- // won't really throw SAXException
- super (c);
- result = r;
- }
-
- public void endDocument ()
- throws SAXException
- {
- super.endDocument ();
- result.setNode (getDocument ());
- }
-
- }
-
- private static OutputStream getOutputStream (String uri)
- throws IOException
- {
- // JDK stupidity: file "protocol does not support output" ...
- if (uri.startsWith ("file:"))
- return new FileOutputStream (uri.substring (5));
-
- // Otherwise ...
- URL url = new URL (uri);
- URLConnection conn = url.openConnection ();
-
- conn.setDoOutput (true);
- return conn.getOutputStream ();
- }
-
-
- static class NullHandler
- extends EventFilter
- implements TransformerHandler
- {
-
- private String systemId;
- private Transformer transformer;
-
- NullHandler (Transformer t)
- {
- transformer = t;
- }
-
- public Transformer getTransformer ()
- {
- return transformer;
- }
-
- public String getSystemId ()
- {
- return systemId;
- }
-
- public void setSystemId (String id)
- {
- systemId = id;
- }
-
- public void setResult (Result result)
- {
- if (result.getSystemId () != null)
- systemId = result.getSystemId ();
-
- try
- {
-
- // output to partial SAX event stream?
- if (result instanceof SAXResult)
- {
- SAXResult r = (SAXResult) result;
-
- setContentHandler (r.getHandler ());
- setProperty (LEXICAL_HANDLER, r.getLexicalHandler ());
- // DTD info is filtered out by javax.transform
-
- // output to DOM tree?
- }
- else if (result instanceof DOMResult)
- {
- DomTerminus out = new DomTerminus ((DOMResult) result);
-
- setContentHandler (out.getContentHandler ());
- setProperty (LEXICAL_HANDLER,
- out.getProperty (LEXICAL_HANDLER));
- // save DTD-derived info, if any.
- setDTDHandler (out.getDTDHandler ());
- setProperty (DECL_HANDLER,
- out.getProperty (DECL_HANDLER));
-
- // node is saved into result on endDocument()
-
- // output to (XML) text?
- }
- else if (result instanceof StreamResult)
- {
- StreamResult r = (StreamResult) result;
- XMLWriter out;
-
- // FIXME: when do output properties take effect?
- // encoding, standalone decl, xml/xhtml/... ...
-
- // FIXME: maybe put nsfix filter up front
-
- try
- {
- if (r.getWriter () != null)
- out = new XMLWriter (r.getWriter ());
- else if (r.getOutputStream () != null)
- out = new XMLWriter (r.getOutputStream ());
- else if (r.getSystemId () != null)
- out = new XMLWriter (
- getOutputStream (r.getSystemId ()));
- else
- throw new IllegalArgumentException (
- "bad StreamResult");
- }
- catch (IOException e)
- {
- e.printStackTrace ();
- // on jdk 1.4, pass the root cause ...
- throw new IllegalArgumentException (e.getMessage ());
- }
-
- // out.setExpandingEntities (true);
- // out.setPrettyPrinting (true);
- // out.setXhtml (true);
-
- setContentHandler (out);
- setProperty (LEXICAL_HANDLER, out);
- // save DTD info, if any; why not?
- setDTDHandler (out);
- setProperty (DECL_HANDLER, out);
- }
-
- }
- catch (SAXException e)
- {
- // SAXNotSupportedException or SAXNotRecognizedException:
- // "can't happen" ... but SAXException for DOM build probs
- // could happen, so ...
- // on jdk 1.4, pass the root cause ...
- throw new IllegalArgumentException (e.getMessage ());
- }
- }
- }
-
- // an interface that adds no value
- static class LocatorAdapter
- extends LocatorImpl
- implements SourceLocator
- {
-
- LocatorAdapter (SAXParseException e)
- {
- setSystemId (e.getSystemId ());
- setPublicId (e.getPublicId ());
- setLineNumber (e.getLineNumber ());
- setColumnNumber (e.getColumnNumber ());
- }
-
- }
-
- // another interface that adds no value
- static class ListenerAdapter
- implements ErrorHandler
- {
-
- NullTransformer transformer;
-
- ListenerAdapter (NullTransformer t)
- {
- transformer = t;
- }
-
- private TransformerException map (SAXParseException e)
- {
- return new TransformerException (
- e.getMessage (),
- new LocatorAdapter (e),
- e);
- }
-
- public void error (SAXParseException e)
- throws SAXParseException
- {
- try
- {
- if (transformer.errListener != null)
- transformer.errListener.error (map (e));
- }
- catch (TransformerException ex)
- {
- transformer.ex = ex;
- throw e;
- }
- }
-
- public void fatalError (SAXParseException e)
- throws SAXParseException
- {
- try
- {
- if (transformer.errListener != null)
- transformer.errListener.fatalError (map (e));
- else
- throw map (e);
- } catch (TransformerException ex) {
- transformer.ex = ex;
- throw e;
- }
- }
-
- public void warning (SAXParseException e)
- throws SAXParseException
- {
- try
- {
- if (transformer.errListener != null)
- transformer.errListener.warning (map (e));
- }
- catch (TransformerException ex)
- {
- transformer.ex = ex;
- throw e;
- }
- }
- }
-
- static class NullTransformer
- extends Transformer
- {
-
- private URIResolver uriResolver;
- private Properties props = new Properties ();
- private Hashtable params = new Hashtable (7);
-
- ErrorListener errListener = null;
- TransformerException ex = null;
- NullHandler handler;
-
- NullTransformer ()
- {
- super ();
- handler = new NullHandler (this);
- }
-
- public ErrorListener getErrorListener ()
- {
- return errListener;
- }
-
- public void setErrorListener (ErrorListener e)
- {
- errListener = e;
- }
-
- public URIResolver getURIResolver ()
- {
- return uriResolver;
- }
-
- public void setURIResolver (URIResolver u)
- {
- uriResolver = u;
- }
-
- public void setOutputProperties (Properties p)
- {
- props = (Properties) p.clone ();
- }
-
- public Properties getOutputProperties ()
- {
- return (Properties) props.clone ();
- }
-
- public void setOutputProperty (String name, String value)
- {
- props.setProperty (name, value);
- }
-
- public String getOutputProperty (String name)
- {
- return props.getProperty (name);
- }
-
- public void clearParameters ()
- {
- params.clear ();
- }
-
- public void setParameter (String name, Object value)
- {
- props.put (name, value);
- }
-
- public Object getParameter (String name)
- {
- return props.get (name);
- }
-
- public void transform (Source in, Result out)
- throws TransformerException
- {
- try
- {
- XMLReader producer;
- InputSource input;
-
- // Input from DOM?
- if (in instanceof DOMSource)
- {
- DOMSource source = (DOMSource) in;
-
- if (source.getNode () == null)
- throw new IllegalArgumentException ("no DOM node");
- producer = new DomParser (source.getNode ());
- input = null;
-
- // Input from SAX?
- }
- else if (in instanceof SAXSource)
- {
- SAXSource source = (SAXSource) in;
-
- producer = source.getXMLReader ();
- if (producer == null)
- producer = XMLReaderFactory.createXMLReader ();
-
- input = source.getInputSource ();
- if (input == null)
- {
- if (source.getSystemId () != null)
- input = new InputSource (source.getSystemId ());
- else
- throw new IllegalArgumentException (
- "missing SAX input");
- }
-
- // Input from a stream or something?
- }
- else
- {
- producer = XMLReaderFactory.createXMLReader ();
- input = SAXSource.sourceToInputSource (in);
- if (input == null)
- throw new IllegalArgumentException ("missing input");
- }
-
- // preserve original namespace prefixes
- try
- {
- producer.setFeature(EventFilter.FEATURE_URI +
- "namespace-prefixes",
- true);
- }
- catch (Exception e)
- {
- /* ignore */
- // FIXME if we couldn't, "NsFix" stage before the output ..
- }
-
- // arrange the output
- handler.setResult (out);
- EventFilter.bind (producer, handler);
-
- // then parse ... single element pipeline
- producer.parse (input);
-
- }
- catch (IOException e)
- {
- throw new TransformerException ("transform failed", e);
-
- }
- catch (SAXException e)
- {
- if (ex == null && ex.getCause () == e)
- throw ex;
- else
- throw new TransformerException ("transform failed", e);
-
- }
- finally
- {
- ex = null;
- }
- }
- }
-
-}
diff --git a/libjava/gnu/xml/util/XCat.java b/libjava/gnu/xml/util/XCat.java
deleted file mode 100644
index 0f163387081..00000000000
--- a/libjava/gnu/xml/util/XCat.java
+++ /dev/null
@@ -1,1609 +0,0 @@
-/* XCat.java --
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-
-import org.xml.sax.ext.DefaultHandler2;
-import org.xml.sax.ext.EntityResolver2;
-
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * Packages <a href=
- "http://www.oasis-open.org/committees/entity/spec-2001-08-06.html"
- >OASIS XML Catalogs</a>,
- * primarily for entity resolution by parsers.
- * That specification defines an XML syntax for mappings between
- * identifiers declared in DTDs (particularly PUBLIC identifiers) and
- * locations. SAX has always supported such mappings, but conventions for
- * an XML file syntax to maintain them have previously been lacking.
- *
- * <p> This has three main operational modes. The primary intended mode is
- * to create a resolver, then preloading it with one or more site-standard
- * catalogs before using it with one or more SAX parsers: <pre>
- * XCat catalog = new XCat ();
- * catalog.setErrorHandler (diagnosticErrorHandler);
- * catalog.loadCatalog ("file:/local/catalogs/catalog.cat");
- * catalog.loadCatalog ("http://shared/catalog.cat");
- * ...
- * catalog.disableLoading ();
- * parser1.setEntityResolver (catalog);
- * parser2.setEntityResolver (catalog);
- * ...</pre>
- *
- * <p>A second mode is to arrange that your application uses instances of
- * this class as its entity resolver, and automatically loads catalogs
- * referenced by <em>&lt;?oasis-xml-catalog...?&gt;</em> processing
- * instructions found before the DTD in documents it parses.
- * It would then discard the resolver after each parse.
- *
- * <p> A third mode applies catalogs in contexts other than entity
- * resolution for parsers.
- * The {@link #resolveURI resolveURI()} method supports resolving URIs
- * stored in XML application data, rather than inside DTDs.
- * Catalogs would be loaded as shown above, and the catalog could
- * be used concurrently for parser entity resolution and for
- * application URI resolution.
- * </p>
- *
- * <center><hr width='70%'></center>
- *
- * <p>Errors in catalogs implicitly loaded (during resolution) are ignored
- * beyond being reported through any <em>ErrorHandler</em> assigned using
- * {@link #setErrorHandler setErrorHandler()}. SAX exceptions
- * thrown from such a handler won't abort resolution, although throwing a
- * <em>RuntimeException</em> or <em>Error</em> will normally abort both
- * resolution and parsing. Useful diagnostic information is available to
- * any <em>ErrorHandler</em> used to report problems, or from any exception
- * thrown from an explicit {@link #loadCatalog loadCatalog()} invocation.
- * Applications can use that information as troubleshooting aids.
- *
- * <p>While this class requires <em>SAX2 Extensions 1.1</em> classes in
- * its class path, basic functionality does not require using a SAX2
- * parser that supports the extended entity resolution functionality.
- * See the original SAX1
- * {@link #resolveEntity(java.lang.String,java.lang.String) resolveEntity()}
- * method for a list of restrictions which apply when it is used with
- * older SAX parsers.
- *
- * @see EntityResolver2
- *
- * @author David Brownell
- */
-public class XCat implements EntityResolver2
-{
- private Catalog catalogs [];
- private boolean usingPublic = true;
- private boolean loadingPermitted = true;
- private boolean unified = true;
- private String parserClass;
- private ErrorHandler errorHandler;
-
- // private EntityResolver next; // chain to next if we fail...
-
- //
- // NOTE: This is a straightforward implementation, and if
- // there are lots of "nextCatalog" or "delegate*" entries
- // in use, two tweaks would be worth considering:
- //
- // - Centralize some sort of cache (key by URI) for individual
- // resolvers. That'd avoid multiple copies of a given catalog.
- //
- // - Have resolution track what catalogs (+modes) have been
- // searched. This would support loop detection.
- //
-
-
- /**
- * Initializes without preloading a catalog.
- * This API is convenient when you may want to arrange that catalogs
- * are automatically loaded when explicitly referenced in documents,
- * using the <em>oasis-xml-catalog</em> processing instruction.
- * In such cases you won't usually be able to preload catalogs.
- */
- public XCat () { }
-
- /**
- * Initializes, and preloads a catalog using the default SAX parser.
- * This API is convenient when you operate with one or more standard
- * catalogs.
- *
- * <p> This just delegates to {@link #loadCatalog loadCatalog()};
- * see it for exception information.
- *
- * @param uri absolute URI for the catalog file.
- */
- public XCat (String uri)
- throws SAXException, IOException
- { loadCatalog (uri); }
-
-
- /**
- * Loads an OASIS XML Catalog.
- * It is appended to the list of currently active catalogs, or
- * reloaded if a catalog with the same URI was already loaded.
- * Callers have control over what parser is used, how catalog parsing
- * errors are reported, and whether URIs will be resolved consistently.
- *
- * <p> The OASIS specification says that errors detected when loading
- * catalogs "must recover by ignoring the catalog entry file that
- * failed, and proceeding." In this API, that action can be the
- * responsibility of applications, when they explicitly load any
- * catalog using this method.
- *
- * <p>Note that catalogs referenced by this one will not be loaded
- * at this time. Catalogs referenced through <em>nextCatalog</em>
- * or <em>delegate*</em> elements are normally loaded only if needed.
- *
- * @see #setErrorHandler
- * @see #setParserClass
- * @see #setUnified
- *
- * @param uri absolute URI for the catalog file.
- *
- * @exception IOException As thrown by the parser, typically to
- * indicate problems reading data from that URI.
- * @exception SAXException As thrown by the parser, typically to
- * indicate problems parsing data from that URI. It may also
- * be thrown if the parser doesn't support necessary handlers.
- * @exception IllegalStateException When attempting to load a
- * catalog after loading has been {@link #disableLoading disabled},
- * such as after any entity or URI lookup has been performed.
- */
- public synchronized void loadCatalog (String uri)
- throws SAXException, IOException
- {
- Catalog catalog;
- int index = -1;
-
- if (!loadingPermitted)
- throw new IllegalStateException ();
-
- uri = normalizeURI (uri);
- if (catalogs != null) {
- // maybe just reload
- for (index = 0; index < catalogs.length; index++)
- if (uri.equals (catalogs [index].catalogURI))
- break;
- }
- catalog = loadCatalog (parserClass, errorHandler, uri, unified);
-
- // add to list of catalogs
- if (catalogs == null) {
- index = 0;
- catalogs = new Catalog [1];
- } else if (index == catalogs.length) {
- Catalog tmp [];
-
- tmp = new Catalog [index + 1];
- System.arraycopy (catalogs, 0, tmp, 0, index);
- catalogs = tmp;
- }
- catalogs [index] = catalog;
- }
-
-
- /**
- * "New Style" external entity resolution for parsers.
- * Calls to this method prevent explicit loading of additional catalogs
- * using {@link #loadCatalog loadCatalog()}.
- *
- * <p>This supports the full core catalog functionality for locating
- * (and relocating) parsed entities that have been declared in a
- * document's DTD.
- *
- * @param name Entity name, such as "dudley", "%nell", or "[dtd]".
- * @param publicId Either a normalized public ID, or null.
- * @param baseURI Absolute base URI associated with systemId.
- * @param systemId URI found in entity declaration (may be
- * relative to baseURI).
- *
- * @return Input source for accessing the external entity, or null
- * if no mapping was found. The input source may have opened
- * the stream, and will have a fully resolved URI.
- *
- * @see #getExternalSubset
- */
- public InputSource resolveEntity (
- String name, // UNUSED ... systemId is always non-null
- String publicId,
- String baseURI, // UNUSED ... it just lets sysId be relative
- String systemId
- ) throws SAXException, IOException
- {
- if (loadingPermitted)
- disableLoading ();
-
- try {
- // steps as found in OASIS XML catalog spec 7.1.2
- // steps 1, 8 involve looping over the list of catalogs
- for (int i = 0; i < catalogs.length; i++) {
- InputSource retval;
- retval = catalogs [i].resolve (usingPublic, publicId, systemId);
- if (retval != null)
- return retval;;
- }
- } catch (DoneDelegation x) {
- // done!
- }
- // step 9 involves returning "no match"
- return null;
- }
-
-
- /**
- * "New Style" parser callback to add an external subset.
- * For documents that don't include an external subset, this may
- * return one according to <em>doctype</em> catalog entries.
- * (This functionality is not a core part of the OASIS XML Catalog
- * specification, though it's presented in an appendix.)
- * If no such entry is defined, this returns null to indicate that
- * this document will not be modified to include such a subset.
- * Calls to this method prevent explicit loading of additional catalogs
- * using {@link #loadCatalog loadCatalog()}.
- *
- * <p><em>Warning:</em> That catalog functionality can be dangerous.
- * It can provide definitions of general entities, and thereby mask
- * certain well formedess errors.
- *
- * @param name Name of the document element, either as declared in
- * a DOCTYPE declaration or as observed in the text.
- * @param baseURI Document's base URI (absolute).
- *
- * @return Input source for accessing the external subset, or null
- * if no mapping was found. The input source may have opened
- * the stream, and will have a fully resolved URI.
- */
- public InputSource getExternalSubset (String name, String baseURI)
- throws SAXException, IOException
- {
- if (loadingPermitted)
- disableLoading ();
- try {
- for (int i = 0; i < catalogs.length; i++) {
- InputSource retval = catalogs [i].getExternalSubset (name);
- if (retval != null)
- return retval;
- }
- } catch (DoneDelegation x) {
- // done!
- }
- return null;
- }
-
-
- /**
- * "Old Style" external entity resolution for parsers.
- * This API provides only core functionality.
- * Calls to this method prevent explicit loading of additional catalogs
- * using {@link #loadCatalog loadCatalog()}.
- *
- * <p>The functional limitations of this interface include:</p><ul>
- *
- * <li>Since system IDs will be absolutized before the resolver
- * sees them, matching against relative URIs won't work.
- * This may affect <em>system</em>, <em>rewriteSystem</em>,
- * and <em>delegateSystem</em> catalog entries.
- *
- * <li>Because of that absolutization, documents declaring entities
- * with system IDs using URI schemes that the JVM does not recognize
- * may be unparsable. URI schemes such as <em>file:/</em>,
- * <em>http://</em>, <em>https://</em>, and <em>ftp://</em>
- * will usually work reliably.
- *
- * <li>Because missing external subsets can't be provided, the
- * <em>doctype</em> catalog entries will be ignored.
- * (The {@link #getExternalSubset getExternalSubset()} method is
- * a "New Style" resolution option.)
- *
- * </ul>
- *
- * <p>Applications can tell whether this limited functionality will be
- * used: if the feature flag associated with the {@link EntityResolver2}
- * interface is not <em>true</em>, the limitations apply. Applications
- * can't usually know whether a given document and catalog will trigger
- * those limitations. The issue can only be bypassed by operational
- * procedures such as not using catalogs or documents which involve
- * those features.
- *
- * @param publicId Either a normalized public ID, or null
- * @param systemId Always an absolute URI.
- *
- * @return Input source for accessing the external entity, or null
- * if no mapping was found. The input source may have opened
- * the stream, and will have a fully resolved URI.
- */
- final public InputSource resolveEntity (String publicId, String systemId)
- throws SAXException, IOException
- {
- return resolveEntity (null, publicId, null, systemId);
- }
-
-
- /**
- * Resolves a URI reference that's not defined to the DTD.
- * This is intended for use with URIs found in document text, such as
- * <em>xml-stylesheet</em> processing instructions and in attribute
- * values, where they are not recognized as URIs by XML parsers.
- * Calls to this method prevent explicit loading of additional catalogs
- * using {@link #loadCatalog loadCatalog()}.
- *
- * <p>This functionality is supported by the OASIS XML Catalog
- * specification, but will never be invoked by an XML parser.
- * It corresponds closely to functionality for mapping system
- * identifiers for entities declared in DTDs; closely enough that
- * this implementation's default behavior is that they be
- * identical, to minimize potential confusion.
- *
- * <p>This method could be useful when implementing the
- * {@link javax.xml.transform.URIResolver} interface, wrapping the
- * input source in a {@link javax.xml.transform.sax.SAXSource}.
- *
- * @see #isUnified
- * @see #setUnified
- *
- * @param baseURI The relevant base URI as specified by the XML Base
- * specification. This recognizes <em>xml:base</em> attributes
- * as overriding the actual (physical) base URI.
- * @param uri Either an absolute URI, or one relative to baseURI
- *
- * @return Input source for accessing the mapped URI, or null
- * if no mapping was found. The input source may have opened
- * the stream, and will have a fully resolved URI.
- */
- public InputSource resolveURI (String baseURI, String uri)
- throws SAXException, IOException
- {
- if (loadingPermitted)
- disableLoading ();
-
- // NOTE: baseURI isn't used here, but caller MUST have it,
- // and heuristics _might_ use it in the future ... plus,
- // it's symmetric with resolveEntity ().
-
- // steps 1, 6 involve looping
- try {
- for (int i = 0; i < catalogs.length; i++) {
- InputSource tmp = catalogs [i].resolveURI (uri);
- if (tmp != null)
- return tmp;
- }
- } catch (DoneDelegation x) {
- // done
- }
- // step 7 reports no match
- return null;
- }
-
-
- /**
- * Records that catalog loading is no longer permitted.
- * Loading is automatically disabled when lookups are performed,
- * and should be manually disabled when <em>startDTD()</em> (or
- * any other DTD declaration callback) is invoked, or at the latest
- * when the document root element is seen.
- */
- public synchronized void disableLoading ()
- {
- // NOTE: this method and loadCatalog() are synchronized
- // so that it's impossible to load (top level) catalogs
- // after lookups start. Likewise, deferred loading is also
- // synchronized (for "next" and delegated catalogs) to
- // ensure that parsers can share resolvers.
- loadingPermitted = false;
- }
-
-
- /**
- * Returns the error handler used to report catalog errors.
- * Null is returned if the parser's default error handling
- * will be used.
- *
- * @see #setErrorHandler
- */
- public ErrorHandler getErrorHandler ()
- { return errorHandler; }
-
- /**
- * Assigns the error handler used to report catalog errors.
- * These errors may come either from the SAX2 parser or
- * from the catalog parsing code driven by the parser.
- *
- * <p> If you're sharing the resolver between parsers, don't
- * change this once lookups have begun.
- *
- * @see #getErrorHandler
- *
- * @param parser The error handler, or null saying to use the default
- * (no diagnostics, and only fatal errors terminate loading).
- */
- public void setErrorHandler (ErrorHandler handler)
- { errorHandler = handler; }
-
-
- /**
- * Returns the name of the SAX2 parser class used to parse catalogs.
- * Null is returned if the system default is used.
- * @see #setParserClass
- */
- public String getParserClass ()
- { return parserClass; }
-
- /**
- * Names the SAX2 parser class used to parse catalogs.
- *
- * <p> If you're sharing the resolver between parsers, don't change
- * this once lookups have begun.
- *
- * <p> Note that in order to properly support the <em>xml:base</em>
- * attribute and relative URI resolution, the SAX parser used to parse
- * the catalog must provide a {@link Locator} and support the optional
- * declaration and lexical handlers.
- *
- * @see #getParserClass
- *
- * @param parser The parser class name, or null saying to use the
- * system default SAX2 parser.
- */
- public void setParserClass (String parser)
- { parserClass = parser; }
-
-
- /**
- * Returns true (the default) if all methods resolve
- * a given URI in the same way.
- * Returns false if calls resolving URIs as entities (such as
- * {@link #resolveEntity resolveEntity()}) use different catalog entries
- * than those resolving them as URIs ({@link #resolveURI resolveURI()}),
- * which will generally produce different results.
- *
- * <p>The OASIS XML Catalog specification defines two related schemes
- * to map URIs "as URIs" or "as system IDs".
- * URIs use <em>uri</em>, <em>rewriteURI</em>, and <em>delegateURI</em>
- * elements. System IDs do the same things with <em>systemId</em>,
- * <em>rewriteSystemId</em>, and <em>delegateSystemId</em>.
- * It's confusing and error prone to maintain two parallel copies of
- * such data. Accordingly, this class makes that behavior optional.
- * The <em>unified</em> interpretation of URI mappings is preferred,
- * since it prevents surprises where one URI gets mapped to different
- * contents depending on whether the reference happens to have come
- * from a DTD (or not).
- *
- * @see #setUnified
- */
- public boolean isUnified ()
- { return unified; }
-
- /**
- * Assigns the value of the flag returned by {@link #isUnified}.
- * Set it to false to be strictly conformant with the OASIS XML Catalog
- * specification. Set it to true to make all mappings for a given URI
- * give the same result, regardless of the reason for the mapping.
- *
- * <p>Don't change this once you've loaded the first catalog.
- *
- * @param value new flag setting
- */
- public void setUnified (boolean value)
- { unified = value; }
-
-
- /**
- * Returns true (the default) if a catalog's public identifier
- * mappings will be used.
- * When false is returned, such mappings are ignored except when
- * system IDs are discarded, such as for
- * entities using the <em>urn:publicid:</em> URI scheme in their
- * system identifiers. (See RFC 3151 for information about that
- * URI scheme. Using it in system identifiers may not work well
- * with many SAX parsers unless the <em>resolve-dtd-uris</em>
- * feature flag is set to false.)
- * @see #setUsingPublic
- */
- public boolean isUsingPublic ()
- { return usingPublic; }
-
- /**
- * Specifies which catalog search mode is used.
- * By default, public identifier mappings are able to override system
- * identifiers when both are available.
- * Applications may choose to ignore public
- * identifier mappings in such cases, so that system identifiers
- * declared in DTDs will only be overridden by an explicit catalog
- * match for that system ID.
- *
- * <p> If you're sharing the resolver between parsers, don't
- * change this once lookups have begun.
- * @see #isUsingPublic
- *
- * @param value true to always use public identifier mappings,
- * false to only use them for system ids using the <em>urn:publicid:</em>
- * URI scheme.
- */
- public void setUsingPublic (boolean value)
- { usingPublic = value; }
-
-
-
- // hmm, what's this do? :)
- private static Catalog loadCatalog (
- String parserClass,
- ErrorHandler eh,
- String uri,
- boolean unified
- ) throws SAXException, IOException
- {
- XMLReader parser;
- Loader loader;
- boolean doesIntern = false;
-
- if (parserClass == null)
- parser = XMLReaderFactory.createXMLReader ();
- else
- parser = XMLReaderFactory.createXMLReader (parserClass);
- if (eh != null)
- parser.setErrorHandler (eh);
- // resolve-dtd-entities is at default value (unrecognized == true)
-
- try {
- doesIntern = parser.getFeature (
- "http://xml.org/sax/features/string-interning");
- } catch (SAXNotRecognizedException e) { }
-
- loader = new Loader (doesIntern, eh, unified);
- loader.cat.parserClass = parserClass;
- loader.cat.catalogURI = uri;
-
- parser.setContentHandler (loader);
- parser.setProperty (
- "http://xml.org/sax/properties/declaration-handler",
- loader);
- parser.setProperty (
- "http://xml.org/sax/properties/lexical-handler",
- loader);
- parser.parse (uri);
-
- return loader.cat;
- }
-
- // perform one or both the normalizations for public ids
- private static String normalizePublicId (boolean full, String publicId)
- {
- if (publicId.startsWith ("urn:publicid:")) {
- StringBuffer buf = new StringBuffer ();
- char chars [] = publicId.toCharArray ();
-boolean hasbug = false;
-
- for (int i = 13; i < chars.length; i++) {
- switch (chars [i]) {
- case '+': buf.append (' '); continue;
- case ':': buf.append ("//"); continue;
- case ';': buf.append ("::"); continue;
- case '%':
-// FIXME unhex that char! meanwhile, warn and fallthrough ...
- hasbug = true;
- default: buf.append (chars [i]); continue;
- }
- }
- publicId = buf.toString ();
-if (hasbug)
-System.err.println ("nyet unhexing public id: " + publicId);
- full = true;
- }
-
- // SAX parsers do everything except that URN mapping, but
- // we can't trust other sources to normalize correctly
- if (full) {
- StringTokenizer tokens;
- String token;
-
- tokens = new StringTokenizer (publicId, " \r\n");
- publicId = null;
- while (tokens.hasMoreTokens ()) {
- if (publicId == null)
- publicId = tokens.nextToken ();
- else
- publicId += " " + tokens.nextToken ();
- }
- }
- return publicId;
- }
-
- private static boolean isUriExcluded (int c)
- { return c <= 0x20 || c >= 0x7f || "\"<>^`{|}".indexOf (c) != -1; }
-
- private static int hexNibble (int c)
- {
- if (c < 10)
- return c + '0';
- return ('a' - 10) + c;
- }
-
- // handles URIs with "excluded" characters
- private static String normalizeURI (String systemId)
- {
- int length = systemId.length ();
-
- for (int i = 0; i < length; i++) {
- char c = systemId.charAt (i);
-
- // escape non-ASCII plus "excluded" characters
- if (isUriExcluded (c)) {
- byte buf [];
- ByteArrayOutputStream out;
- int b;
-
- // a JVM that doesn't know UTF8 and 8859_1 is unusable!
- try {
- buf = systemId.getBytes ("UTF8");
- out = new ByteArrayOutputStream (buf.length + 10);
-
- for (i = 0; i < buf.length; i++) {
- b = buf [i] & 0x0ff;
- if (isUriExcluded (b)) {
- out.write ((int) '%');
- out.write (hexNibble (b >> 4));
- out.write (hexNibble (b & 0x0f));
- } else
- out.write (b);
- }
- return out.toString ("8859_1");
- } catch (IOException e) {
- throw new RuntimeException (
- "can't normalize URI: " + e.getMessage ());
- }
- }
- }
- return systemId;
- }
-
- // thrown to mark authoritative end of a search
- private static class DoneDelegation extends SAXException
- {
- DoneDelegation () { }
- }
-
-
- /**
- * Represents a OASIS XML Catalog, and encapsulates much of
- * the catalog functionality.
- */
- private static class Catalog
- {
- // loading infrastructure
- String catalogURI;
- ErrorHandler eh;
- boolean unified;
- String parserClass;
-
- // catalog data
- boolean hasPreference;
- boolean usingPublic;
-
- Hashtable publicIds;
- Hashtable publicDelegations;
-
- Hashtable systemIds;
- Hashtable systemRewrites;
- Hashtable systemDelegations;
-
- Hashtable uris;
- Hashtable uriRewrites;
- Hashtable uriDelegations;
-
- Hashtable doctypes;
-
- Vector next;
-
- // nonpublic!
- Catalog () { }
-
-
- // steps as found in OASIS XML catalog spec 7.1.2
- private InputSource locatePublicId (String publicId)
- throws SAXException, IOException
- {
- // 5. return (first) 'public' entry
- if (publicIds != null) {
- String retval = (String) publicIds.get (publicId);
- if (retval != null) {
- // IF the URI is accessible ...
- return new InputSource (retval);
- }
- }
-
- // 6. return delegatePublic catalog match [complex]
- if (publicDelegations != null)
- return checkDelegations (publicDelegations, publicId,
- publicId, null);
-
- return null;
- }
-
- // steps as found in OASIS XML catalog spec 7.1.2 or 7.2.2
- private InputSource mapURI (
- String uri,
- Hashtable ids,
- Hashtable rewrites,
- Hashtable delegations
- ) throws SAXException, IOException
- {
- // 7.1.2: 2. return (first) 'system' entry
- // 7.2.2: 2. return (first) 'uri' entry
- if (ids != null) {
- String retval = (String) ids.get (uri);
- if (retval != null) {
- // IF the URI is accessible ...
- return new InputSource (retval);
- }
- }
-
- // 7.1.2: 3. return 'rewriteSystem' entries
- // 7.2.2: 3. return 'rewriteURI' entries
- if (rewrites != null) {
- String prefix = null;
- String replace = null;
- int prefixLen = -1;
-
- for (Enumeration e = rewrites.keys ();
- e.hasMoreElements ();
- /* NOP */) {
- String temp = (String) e.nextElement ();
- int len = -1;
-
- if (!uri.startsWith (temp))
- continue;
- if (prefix != null
- && (len = temp.length ()) < prefixLen)
- continue;
- prefix = temp;
- prefixLen = len;
- replace = (String) rewrites.get (temp);
- }
- if (prefix != null) {
- StringBuffer buf = new StringBuffer (replace);
- buf.append (uri.substring (prefixLen));
- // IF the URI is accessible ...
- return new InputSource (buf.toString ());
- }
- }
-
- // 7.1.2: 4. return 'delegateSystem' catalog match [complex]
- // 7.2.2: 4. return 'delegateURI' catalog match [complex]
- if (delegations != null)
- return checkDelegations (delegations, uri, null, uri);
-
- return null;
- }
-
-
- /**
- * Returns a URI for an external entity.
- */
- public InputSource resolve (
- boolean usingPublic,
- String publicId,
- String systemId
- ) throws SAXException, IOException
- {
- boolean preferSystem;
- InputSource retval;
-
- if (hasPreference)
- preferSystem = !this.usingPublic;
- else
- preferSystem = !usingPublic;
-
- if (publicId != null)
- publicId = normalizePublicId (false, publicId);
-
- // behavior here matches section 7.1.1 of the oasis spec
- if (systemId != null) {
- if (systemId.startsWith ("urn:publicid:")) {
- String temp = normalizePublicId (true, systemId);
- if (publicId == null) {
- publicId = temp;
- systemId = null;
- } else if (!publicId.equals (temp)) {
- // error; ok to recover by:
- systemId = null;
- }
- } else
- systemId = normalizeURI (systemId);
- }
-
- if (systemId == null && publicId == null)
- return null;
-
- if (systemId != null) {
- retval = mapURI (systemId, systemIds, systemRewrites,
- systemDelegations);
- if (retval != null) {
- retval.setPublicId (publicId);
- return retval;
- }
- }
-
- if (publicId != null
- && !(systemId != null && preferSystem)) {
- retval = locatePublicId (publicId);
- if (retval != null) {
- retval.setPublicId (publicId);
- return retval;
- }
- }
-
- // 7. apply nextCatalog entries
- if (next != null) {
- int length = next.size ();
- for (int i = 0; i < length; i++) {
- Catalog n = getNext (i);
- retval = n.resolve (usingPublic, publicId, systemId);
- if (retval != null)
- return retval;
- }
- }
-
- return null;
- }
-
- /**
- * Maps one URI into another, for resources that are not defined
- * using XML external entity or notation syntax.
- */
- public InputSource resolveURI (String uri)
- throws SAXException, IOException
- {
- if (uri.startsWith ("urn:publicid:"))
- return resolve (true, normalizePublicId (true, uri), null);
-
- InputSource retval;
-
- uri = normalizeURI (uri);
-
- // 7.2.2 steps 2-4
- retval = mapURI (uri, uris, uriRewrites, uriDelegations);
- if (retval != null)
- return retval;
-
- // 7.2.2 step 5. apply nextCatalog entries
- if (next != null) {
- int length = next.size ();
- for (int i = 0; i < length; i++) {
- Catalog n = getNext (i);
- retval = n.resolveURI (uri);
- if (retval != null)
- return retval;
- }
- }
-
- return null;
- }
-
-
- /**
- * Finds the external subset associated with a given root element.
- */
- public InputSource getExternalSubset (String name)
- throws SAXException, IOException
- {
- if (doctypes != null) {
- String value = (String) doctypes.get (name);
- if (value != null) {
- // IF the URI is accessible ...
- return new InputSource (value);
- }
- }
- if (next != null) {
- int length = next.size ();
- for (int i = 0; i < length; i++) {
- Catalog n = getNext (i);
- if (n == null)
- continue;
- InputSource retval = n.getExternalSubset (name);
- if (retval != null)
- return retval;
- }
- }
- return null;
- }
-
- private synchronized Catalog getNext (int i)
- throws SAXException, IOException
- {
- Object obj;
-
- if (next == null || i < 0 || i >= next.size ())
- return null;
- obj = next.elementAt (i);
- if (obj instanceof Catalog)
- return (Catalog) obj;
-
- // ok, we deferred reading that catalog till now.
- // load and cache it.
- Catalog cat = null;
-
- try {
- cat = loadCatalog (parserClass, eh, (String) obj, unified);
- next.setElementAt (cat, i);
- } catch (SAXException e) {
- // must fail quietly, says the OASIS spec
- } catch (IOException e) {
- // same applies here
- }
- return cat;
- }
-
- private InputSource checkDelegations (
- Hashtable delegations,
- String id,
- String publicId, // only one of public/system
- String systemId // will be non-null...
- ) throws SAXException, IOException
- {
- Vector matches = null;
- int length = 0;
-
- // first, see if any prefixes match.
- for (Enumeration e = delegations.keys ();
- e.hasMoreElements ();
- /* NOP */) {
- String prefix = (String) e.nextElement ();
-
- if (!id.startsWith (prefix))
- continue;
- if (matches == null)
- matches = new Vector ();
-
- // maintain in longer->shorter sorted order
- // NOTE: assumes not many matches will fire!
- int index;
-
- for (index = 0; index < length; index++) {
- String temp = (String) matches.elementAt (index);
- if (prefix.length () > temp.length ()) {
- matches.insertElementAt (prefix, index);
- break;
- }
- }
- if (index == length)
- matches.addElement (prefix);
- length++;
- }
- if (matches == null)
- return null;
-
- // now we know the list of catalogs to replace our "top level"
- // list ... we use it here, rather than somehow going back and
- // restarting, since this helps avoid reading most catalogs.
- // this assumes stackspace won't be a problem.
- for (int i = 0; i < length; i++) {
- Catalog catalog = null;
- InputSource result;
-
- // get this catalog. we may not have read it yet.
- synchronized (delegations) {
- Object prefix = matches.elementAt (i);
- Object cat = delegations.get (prefix);
-
- if (cat instanceof Catalog)
- catalog = (Catalog) cat;
- else {
- try {
- // load and cache that catalog
- catalog = loadCatalog (parserClass, eh,
- (String) cat, unified);
- delegations.put (prefix, catalog);
- } catch (SAXException e) {
- // must ignore, says the OASIS spec
- } catch (IOException e) {
- // same applies here
- }
- }
- }
-
- // ignore failed loads, and proceed
- if (catalog == null)
- continue;
-
- // we have a catalog ... resolve!
- // usingPublic value can't matter, there's no choice
- result = catalog.resolve (true, publicId, systemId);
- if (result != null)
- return result;
- }
-
- // if there were no successes, the entire
- // lookup failed (all the way to top level)
- throw new DoneDelegation ();
- }
- }
-
-
- /** This is the namespace URI used for OASIS XML Catalogs. */
- private static final String catalogNamespace =
- "urn:oasis:names:tc:entity:xmlns:xml:catalog";
-
-
- /**
- * Loads/unmarshals one catalog.
- */
- private static class Loader extends DefaultHandler2
- {
- private boolean preInterned;
- private ErrorHandler handler;
- private boolean unified;
- private int ignoreDepth;
- private Locator locator;
- private boolean started;
- private Hashtable externals;
- private Stack bases;
-
- Catalog cat = new Catalog ();
-
-
- /**
- * Constructor.
- * @param flag true iff the parser already interns strings.
- * @param eh Errors and warnings are delegated to this.
- * @param unified true keeps one table for URI mappings;
- * false matches OASIS spec, storing mappings
- * for URIs and SYSTEM ids in parallel tables.
- */
- Loader (boolean flag, ErrorHandler eh, boolean unified)
- {
- preInterned = flag;
- handler = eh;
- this.unified = unified;
- cat.unified = unified;
- cat.eh = eh;
- }
-
-
- // strips out fragments
- private String nofrag (String uri)
- throws SAXException
- {
- if (uri.indexOf ('#') != -1) {
- warn ("URI with fragment: " + uri);
- uri = uri.substring (0, uri.indexOf ('#'));
- }
- return uri;
- }
-
- // absolutizes relative URIs
- private String absolutize (String uri)
- throws SAXException
- {
- // avoid creating URLs if they're already absolutized,
- // or if the URI is already using a known scheme
- if (uri.startsWith ("file:/")
- || uri.startsWith ("http:/")
- || uri.startsWith ("https:/")
- || uri.startsWith ("ftp:/")
- || uri.startsWith ("urn:")
- )
- return uri;
-
- // otherwise, let's hope the JDK handles this URI scheme.
- try {
- URL base = (URL) bases.peek ();
- return new URL (base, uri).toString ();
- } catch (Exception e) {
- fatal ("can't absolutize URI: " + uri);
- return null;
- }
- }
-
- // recoverable error
- private void error (String message)
- throws SAXException
- {
- if (handler == null)
- return;
- handler.error (new SAXParseException (message, locator));
- }
-
- // nonrecoverable error
- private void fatal (String message)
- throws SAXException
- {
- SAXParseException spe;
-
- spe = new SAXParseException (message, locator);
- if (handler != null)
- handler.fatalError (spe);
- throw spe;
- }
-
- // low severity problem
- private void warn (String message)
- throws SAXException
- {
- if (handler == null)
- return;
- handler.warning (new SAXParseException (message, locator));
- }
-
- // callbacks:
-
- public void setDocumentLocator (Locator l)
- { locator = l; }
-
- public void startDocument ()
- throws SAXException
- {
- if (locator == null)
- error ("no locator!");
- bases = new Stack ();
- String uri = locator.getSystemId ();
- try {
- bases.push (new URL (uri));
- } catch (IOException e) {
- fatal ("bad document base URI: " + uri);
- }
- }
-
- public void endDocument ()
- throws SAXException
- {
- try {
- if (!started)
- error ("not a catalog!");
- } finally {
- locator = null;
- handler = null;
- externals = null;
- bases = null;
- }
- }
-
- // XML Base support for external entities.
-
- // NOTE: expects parser is in default "resolve-dtd-uris" mode.
- public void externalEntityDecl (String name, String pub, String sys)
- throws SAXException
- {
- if (externals == null)
- externals = new Hashtable ();
- if (externals.get (name) == null)
- externals.put (name, pub);
- }
-
- public void startEntity (String name)
- throws SAXException
- {
- if (externals == null)
- return;
- String uri = (String) externals.get (name);
-
- // NOTE: breaks if an EntityResolver substitutes these URIs.
- // If toplevel loader supports one, must intercept calls...
- if (uri != null) {
- try {
- bases.push (new URL (uri));
- } catch (IOException e) {
- fatal ("entity '" + name + "', bad URI: " + uri);
- }
- }
- }
-
- public void endEntity (String name)
- {
- if (externals == null)
- return;
- String value = (String) externals.get (name);
-
- if (value != null)
- bases.pop ();
- }
-
- /**
- * Processes catalog elements, saving their data.
- */
- public void startElement (String namespace, String local,
- String qName, Attributes atts)
- throws SAXException
- {
- // must ignore non-catalog elements, and their contents
- if (ignoreDepth != 0 || !catalogNamespace.equals (namespace)) {
- ignoreDepth++;
- return;
- }
-
- // basic sanity checks
- if (!preInterned)
- local = local.intern ();
- if (!started) {
- started = true;
- if ("catalog" != local)
- fatal ("root element not 'catalog': " + local);
- }
-
- // Handle any xml:base attribute
- String xmlbase = atts.getValue ("xml:base");
-
- if (xmlbase != null) {
- URL base = (URL) bases.peek ();
- try {
- base = new URL (base, xmlbase);
- } catch (IOException e) {
- fatal ("can't resolve xml:base attribute: " + xmlbase);
- }
- bases.push (base);
- } else
- bases.push (bases.peek ());
-
- // fetch multi-element attributes, apply standard tweaks
- // values (uri, catalog, rewritePrefix) get normalized too,
- // as a precaution and since we may compare the values
- String catalog = atts.getValue ("catalog");
- if (catalog != null)
- catalog = normalizeURI (absolutize (catalog));
-
- String rewritePrefix = atts.getValue ("rewritePrefix");
- if (rewritePrefix != null)
- rewritePrefix = normalizeURI (absolutize (rewritePrefix));
-
- String systemIdStartString;
- systemIdStartString = atts.getValue ("systemIdStartString");
- if (systemIdStartString != null) {
- systemIdStartString = normalizeURI (systemIdStartString);
- // unmatchable <rewriteSystemId>, <delegateSystemId> elements
- if (systemIdStartString.startsWith ("urn:publicid:")) {
- error ("systemIdStartString is really a publicId!!");
- return;
- }
- }
-
- String uri = atts.getValue ("uri");
- if (uri != null)
- uri = normalizeURI (absolutize (uri));
-
- String uriStartString;
- uriStartString = atts.getValue ("uriStartString");
- if (uriStartString != null) {
- uriStartString = normalizeURI (uriStartString);
- // unmatchable <rewriteURI>, <delegateURI> elements
- if (uriStartString.startsWith ("urn:publicid:")) {
- error ("uriStartString is really a publicId!!");
- return;
- }
- }
-
- // strictly speaking "group" and "catalog" shouldn't nest
- // ... arbitrary restriction, no evident motivation
-
-// FIXME stack "prefer" settings (two elements only!) and use
-// them to populate different public mapping/delegation tables
-
- if ("catalog" == local || "group" == local) {
- String prefer = atts.getValue ("prefer");
-
- if (prefer != null && !"public".equals (prefer)) {
- if (!"system".equals (prefer)) {
- error ("in <" + local + " ... prefer='...'>, "
- + "assuming 'public'");
- prefer = "public";
- }
- }
- if (prefer != null) {
- if ("catalog" == local) {
- cat.hasPreference = true;
- cat.usingPublic = "public".equals (prefer);
- } else {
- if (!cat.hasPreference || cat.usingPublic
- != "public".equals (prefer)) {
-fatal ("<group prefer=...> case not handled");
- }
- }
- } else if ("group" == local && cat.hasPreference) {
-fatal ("<group prefer=...> case not handled");
- }
-
- //
- // PUBLIC ids: cleanly set up for id substitution
- //
- } else if ("public" == local) {
- String publicId = atts.getValue ("publicId");
- String value = null;
-
- if (publicId == null || uri == null) {
- error ("expecting <public publicId=... uri=.../>");
- return;
- }
- publicId = normalizePublicId (true, publicId);
- uri = nofrag (uri);
- if (cat.publicIds == null)
- cat.publicIds = new Hashtable ();
- else
- value = (String) cat.publicIds.get (publicId);
- if (value != null) {
- if (!value.equals (uri))
- warn ("ignoring <public...> entry for " + publicId);
- } else
- cat.publicIds.put (publicId, uri);
-
- } else if ("delegatePublic" == local) {
- String publicIdStartString;
- Object value = null;
-
- publicIdStartString = atts.getValue ("publicIdStartString");
- if (publicIdStartString == null || catalog == null) {
- error ("expecting <delegatePublic "
- + "publicIdStartString=... catalog=.../>");
- return;
- }
- publicIdStartString = normalizePublicId (true,
- publicIdStartString);
- if (cat.publicDelegations == null)
- cat.publicDelegations = new Hashtable ();
- else
- value = cat.publicDelegations.get (publicIdStartString);
- if (value != null) {
- if (!value.equals (catalog))
- warn ("ignoring <delegatePublic...> entry for "
- + uriStartString);
- } else
- cat.publicDelegations.put (publicIdStartString, catalog);
-
-
- //
- // SYSTEM ids: need substitution due to operational issues
- //
- } else if ("system" == local) {
- String systemId = atts.getValue ("systemId");
- String value = null;
-
- if (systemId == null || uri == null) {
- error ("expecting <system systemId=... uri=.../>");
- return;
- }
- systemId = normalizeURI (systemId);
- uri = nofrag (uri);
- if (systemId.startsWith ("urn:publicid:")) {
- error ("systemId is really a publicId!!");
- return;
- }
- if (cat.systemIds == null) {
- cat.systemIds = new Hashtable ();
- if (unified)
- cat.uris = cat.systemIds;
- } else
- value = (String) cat.systemIds.get (systemId);
- if (value != null) {
- if (!value.equals (uri))
- warn ("ignoring <system...> entry for " + systemId);
- } else
- cat.systemIds.put (systemId, uri);
-
- } else if ("rewriteSystem" == local) {
- String value = null;
-
- if (systemIdStartString == null || rewritePrefix == null
- || systemIdStartString.length () == 0
- || rewritePrefix.length () == 0
- ) {
- error ("expecting <rewriteSystem "
- + "systemIdStartString=... rewritePrefix=.../>");
- return;
- }
- if (cat.systemRewrites == null) {
- cat.systemRewrites = new Hashtable ();
- if (unified)
- cat.uriRewrites = cat.systemRewrites;
- } else
- value = (String) cat.systemRewrites.get (
- systemIdStartString);
- if (value != null) {
- if (!value.equals (rewritePrefix))
- warn ("ignoring <rewriteSystem...> entry for "
- + systemIdStartString);
- } else
- cat.systemRewrites.put (systemIdStartString,
- rewritePrefix);
-
- } else if ("delegateSystem" == local) {
- Object value = null;
-
- if (systemIdStartString == null || catalog == null) {
- error ("expecting <delegateSystem "
- + "systemIdStartString=... catalog=.../>");
- return;
- }
- if (cat.systemDelegations == null) {
- cat.systemDelegations = new Hashtable ();
- if (unified)
- cat.uriDelegations = cat.systemDelegations;
- } else
- value = cat.systemDelegations.get (systemIdStartString);
- if (value != null) {
- if (!value.equals (catalog))
- warn ("ignoring <delegateSystem...> entry for "
- + uriStartString);
- } else
- cat.systemDelegations.put (systemIdStartString, catalog);
-
-
- //
- // URI: just like "system" ID support, except that
- // fragment IDs are disallowed in "system" elements.
- //
- } else if ("uri" == local) {
- String name = atts.getValue ("name");
- String value = null;
-
- if (name == null || uri == null) {
- error ("expecting <uri name=... uri=.../>");
- return;
- }
- if (name.startsWith ("urn:publicid:")) {
- error ("name is really a publicId!!");
- return;
- }
- name = normalizeURI (name);
- if (cat.uris == null) {
- cat.uris = new Hashtable ();
- if (unified)
- cat.systemIds = cat.uris;
- } else
- value = (String) cat.uris.get (name);
- if (value != null) {
- if (!value.equals (uri))
- warn ("ignoring <uri...> entry for " + name);
- } else
- cat.uris.put (name, uri);
-
- } else if ("rewriteURI" == local) {
- String value = null;
-
- if (uriStartString == null || rewritePrefix == null
- || uriStartString.length () == 0
- || rewritePrefix.length () == 0
- ) {
- error ("expecting <rewriteURI "
- + "uriStartString=... rewritePrefix=.../>");
- return;
- }
- if (cat.uriRewrites == null) {
- cat.uriRewrites = new Hashtable ();
- if (unified)
- cat.systemRewrites = cat.uriRewrites;
- } else
- value = (String) cat.uriRewrites.get (uriStartString);
- if (value != null) {
- if (!value.equals (rewritePrefix))
- warn ("ignoring <rewriteURI...> entry for "
- + uriStartString);
- } else
- cat.uriRewrites.put (uriStartString, rewritePrefix);
-
- } else if ("delegateURI" == local) {
- Object value = null;
-
- if (uriStartString == null || catalog == null) {
- error ("expecting <delegateURI "
- + "uriStartString=... catalog=.../>");
- return;
- }
- if (cat.uriDelegations == null) {
- cat.uriDelegations = new Hashtable ();
- if (unified)
- cat.systemDelegations = cat.uriDelegations;
- } else
- value = cat.uriDelegations.get (uriStartString);
- if (value != null) {
- if (!value.equals (catalog))
- warn ("ignoring <delegateURI...> entry for "
- + uriStartString);
- } else
- cat.uriDelegations.put (uriStartString, catalog);
-
- //
- // NON-DELEGATING approach to modularity
- //
- } else if ("nextCatalog" == local) {
- if (catalog == null) {
- error ("expecting <nextCatalog catalog=.../>");
- return;
- }
- if (cat.next == null)
- cat.next = new Vector ();
- cat.next.addElement (catalog);
-
- //
- // EXTENSIONS from appendix E
- //
- } else if ("doctype" == local) {
- String name = atts.getValue ("name");
- String value = null;
-
- if (name == null || uri == null) {
- error ("expecting <doctype name=... uri=.../>");
- return;
- }
- name = normalizeURI (name);
- if (cat.doctypes == null)
- cat.doctypes = new Hashtable ();
- else
- value = (String) cat.doctypes.get (name);
- if (value != null) {
- if (!value.equals (uri))
- warn ("ignoring <doctype...> entry for "
- + uriStartString);
- } else
- cat.doctypes.put (name, uri);
-
-
- //
- // RESERVED ... ignore (like reserved attributes) but warn
- //
- } else {
- warn ("ignoring unknown catalog element: " + local);
- ignoreDepth++;
- }
- }
-
- public void endElement (String uri, String local, String qName)
- throws SAXException
- {
- if (ignoreDepth != 0)
- ignoreDepth--;
- else
- bases.pop ();
- }
- }
-}
diff --git a/libjava/gnu/xml/util/XHTMLWriter.java b/libjava/gnu/xml/util/XHTMLWriter.java
deleted file mode 100644
index 272c66cd34c..00000000000
--- a/libjava/gnu/xml/util/XHTMLWriter.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* XHTMLWriter.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-
-
-/**
- * This extends XMLWriter to create a class which defaults to writing
- * XHTML text, preferring the US-ASCII encoding. It adds no unique
- * functionality, only changing the defaults slightly to simplify writing
- * XHTML processing components by providing a bean class whose properties
- * have more convenient defaults. An artifact of using the US-ASCII
- * encoding is that no XML declaration is written, so that HTML tools
- * that can't accept them will not become confused. Components can treat
- * the output as UTF-8, ISO-8859-1, or US-ASCII without incurring any
- * data loss.
- *
- * @author David Brownell
- */
-public class XHTMLWriter extends XMLWriter
-{
- /**
- * Constructs this handler with System.out used to write
- * SAX events using the US-ASCII encoding, as XHTML.
- */
- public XHTMLWriter ()
- throws IOException
- {
- this (System.out);
- }
-
- /**
- * Constructs this handler such that the specified output stream
- * is used to write SAX events in the US-ASCII encoding, as XHTML.
- *
- * @param out Where US-ASCII encoding of the stream of SAX
- * events will be sent.
- */
- public XHTMLWriter (OutputStream out)
- throws IOException
- {
- // not all JVMs understand "ASCII" as an encoding name, so
- // we use 8859_1 (they all seem to handle that one) and
- // make the echo handler filter out non-ASCII characters
- this (new OutputStreamWriter (out, "8859_1"), "US-ASCII");
- }
-
- /**
- * Constructs this handler such that the specified output stream
- * is used to write SAX events as XHTML.
- *
- * @param out Where the stream of SAX events will be written.
- */
- public XHTMLWriter (Writer out)
- {
- this (out, null);
- }
-
- /**
- * Constructs this handler such that the specified output stream
- * is used to write SAX events as XHTML, labeled with the specified
- * encoding.
- *
- * @param out Where the stream of SAX events will be written.
- * @param encoding If non-null, this names the encoding to be
- * placed in the encoding declaration.
- */
- public XHTMLWriter (Writer out, String encoding)
- {
- super (out, encoding);
- setXhtml (true);
- }
-}
diff --git a/libjava/gnu/xml/util/XMLWriter.java b/libjava/gnu/xml/util/XMLWriter.java
deleted file mode 100644
index fd36b715325..00000000000
--- a/libjava/gnu/xml/util/XMLWriter.java
+++ /dev/null
@@ -1,1927 +0,0 @@
-/* XMLWriter.java --
- Copyright (C) 1999,2000,2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util;
-
-import java.io.BufferedWriter;
-import java.io.CharConversionException;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.Stack;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-import org.xml.sax.helpers.*;
-
-
-/**
- * This class is a SAX handler which writes all its input as a well formed
- * XML or XHTML document. If driven using SAX2 events, this output may
- * include a recreated document type declaration, subject to limitations
- * of SAX (no internal subset exposed) or DOM (the important declarations,
- * with their documentation, are discarded).
- *
- * <p> By default, text is generated "as-is", but some optional modes
- * are supported. Pretty-printing is supported, to make life easier
- * for people reading the output. XHTML (1.0) output has can be made
- * particularly pretty; all the built-in character entities are known.
- * Canonical XML can also be generated, assuming the input is properly
- * formed.
- *
- * <hr>
- *
- * <p> Some of the methods on this class are intended for applications to
- * use directly, rather than as pure SAX2 event callbacks. Some of those
- * methods access the JavaBeans properties (used to tweak output formats,
- * for example canonicalization and pretty printing). Subclasses
- * are expected to add new behaviors, not to modify current behavior, so
- * many such methods are final.</p>
- *
- * <p> The <em>write*()</em> methods may be slightly simpler for some
- * applications to use than direct callbacks. For example, they support
- * a simple policy for encoding data items as the content of a single element.
- *
- * <p> To reuse an XMLWriter you must provide it with a new Writer, since
- * this handler closes the writer it was given as part of its endDocument()
- * handling. (XML documents have an end of input, and the way to encode
- * that on a stream is to close it.) </p>
- *
- * <hr>
- *
- * <p> Note that any relative URIs in the source document, as found in
- * entity and notation declarations, ought to have been fully resolved by
- * the parser providing events to this handler. This means that the
- * output text should only have fully resolved URIs, which may not be
- * the desired behavior in cases where later binding is desired. </p>
- *
- * <p> <em>Note that due to SAX2 defaults, you may need to manually
- * ensure that the input events are XML-conformant with respect to namespace
- * prefixes and declarations. {@link gnu.xml.pipeline.NSFilter} is
- * one solution to this problem, in the context of processing pipelines.</em>
- * Something as simple as connecting this handler to a parser might not
- * generate the correct output. Another workaround is to ensure that the
- * <em>namespace-prefixes</em> feature is always set to true, if you're
- * hooking this directly up to some XMLReader implementation.
- *
- * @see gnu.xml.pipeline.TextConsumer
- *
- * @author David Brownell
- */
-public class XMLWriter
- implements ContentHandler, LexicalHandler, DTDHandler, DeclHandler
-{
- // text prints/escapes differently depending on context
- // CTX_ENTITY ... entity literal value
- // CTX_ATTRIBUTE ... attribute literal value
- // CTX_CONTENT ... content of an element
- // CTX_UNPARSED ... CDATA, comment, PI, names, etc
- // CTX_NAME ... name or nmtoken, no escapes possible
- private static final int CTX_ENTITY = 1;
- private static final int CTX_ATTRIBUTE = 2;
- private static final int CTX_CONTENT = 3;
- private static final int CTX_UNPARSED = 4;
- private static final int CTX_NAME = 5;
-
-// FIXME: names (element, attribute, PI, notation, etc) are not
-// currently written out with range checks (escapeChars).
-// In non-XHTML, some names can't be directly written; panic!
-
- private static String sysEOL;
-
- static {
- try {
- sysEOL = System.getProperty ("line.separator", "\n");
-
- // don't use the system's EOL if it's illegal XML.
- if (!isLineEnd (sysEOL))
- sysEOL = "\n";
-
- } catch (SecurityException e) {
- sysEOL = "\n";
- }
- }
-
- private static boolean isLineEnd (String eol)
- {
- return "\n".equals (eol)
- || "\r".equals (eol)
- || "\r\n".equals (eol);
- }
-
- private Writer out;
- private boolean inCDATA;
- private int elementNestLevel;
- private String eol = sysEOL;
-
- private short dangerMask;
- private StringBuffer stringBuf;
- private Locator locator;
- private ErrorHandler errHandler;
-
- private boolean expandingEntities = false;
- private int entityNestLevel;
- private boolean xhtml;
- private boolean startedDoctype;
- private String encoding;
-
- private boolean canonical;
- private boolean inDoctype;
- private boolean inEpilogue;
-
- // pretty printing controls
- private boolean prettyPrinting;
- private int column;
- private boolean noWrap;
- private Stack space = new Stack ();
-
- // this is not a hard'n'fast rule -- longer lines are OK,
- // but are to be avoided. Here, prettyprinting is more to
- // show structure "cleanly" than to be precise about it.
- // better to have ragged layout than one line 24Kb long.
- private static final int lineLength = 75;
-
-
- /**
- * Constructs this handler with System.out used to write SAX events
- * using the UTF-8 encoding. Avoid using this except when you know
- * it's safe to close System.out at the end of the document.
- */
- public XMLWriter () throws IOException
- { this (System.out); }
-
- /**
- * Constructs a handler which writes all input to the output stream
- * in the UTF-8 encoding, and closes it when endDocument is called.
- * (Yes it's annoying that this throws an exception -- but there's
- * really no way around it, since it's barely possible a JDK may
- * exist somewhere that doesn't know how to emit UTF-8.)
- */
- public XMLWriter (OutputStream out) throws IOException
- {
- this (new OutputStreamWriter (out, "UTF8"));
- }
-
- /**
- * Constructs a handler which writes all input to the writer, and then
- * closes the writer when the document ends. If an XML declaration is
- * written onto the output, and this class can determine the name of
- * the character encoding for this writer, that encoding name will be
- * included in the XML declaration.
- *
- * <P> See the description of the constructor which takes an encoding
- * name for imporant information about selection of encodings.
- *
- * @param writer XML text is written to this writer.
- */
- public XMLWriter (Writer writer)
- {
- this (writer, null);
- }
-
- /**
- * Constructs a handler which writes all input to the writer, and then
- * closes the writer when the document ends. If an XML declaration is
- * written onto the output, this class will use the specified encoding
- * name in that declaration. If no encoding name is specified, no
- * encoding name will be declared unless this class can otherwise
- * determine the name of the character encoding for this writer.
- *
- * <P> At this time, only the UTF-8 ("UTF8") and UTF-16 ("Unicode")
- * output encodings are fully lossless with respect to XML data. If you
- * use any other encoding you risk having your data be silently mangled
- * on output, as the standard Java character encoding subsystem silently
- * maps non-encodable characters to a question mark ("?") and will not
- * report such errors to applications.
- *
- * <p> For a few other encodings the risk can be reduced. If the writer is
- * a java.io.OutputStreamWriter, and uses either the ISO-8859-1 ("8859_1",
- * "ISO8859_1", etc) or US-ASCII ("ASCII") encodings, content which
- * can't be encoded in those encodings will be written safely. Where
- * relevant, the XHTML entity names will be used; otherwise, numeric
- * character references will be emitted.
- *
- * <P> However, there remain a number of cases where substituting such
- * entity or character references is not an option. Such references are
- * not usable within a DTD, comment, PI, or CDATA section. Neither may
- * they be used when element, attribute, entity, or notation names have
- * the problematic characters.
- *
- * @param writer XML text is written to this writer.
- * @param encoding if non-null, and an XML declaration is written,
- * this is the name that will be used for the character encoding.
- */
- public XMLWriter (Writer writer, String encoding)
- {
- setWriter (writer, encoding);
- }
-
- private void setEncoding (String encoding)
- {
- if (encoding == null && out instanceof OutputStreamWriter)
- encoding = ((OutputStreamWriter)out).getEncoding ();
-
- if (encoding != null) {
- encoding = encoding.toUpperCase ();
-
- // Use official encoding names where we know them,
- // avoiding the Java-only names. When using common
- // encodings where we can easily tell if characters
- // are out of range, we'll escape out-of-range
- // characters using character refs for safety.
-
- // I _think_ these are all the main synonyms for these!
- if ("UTF8".equals (encoding)) {
- encoding = "UTF-8";
- } else if ("US-ASCII".equals (encoding)
- || "ASCII".equals (encoding)) {
- dangerMask = (short) 0xff80;
- encoding = "US-ASCII";
- } else if ("ISO-8859-1".equals (encoding)
- || "8859_1".equals (encoding)
- || "ISO8859_1".equals (encoding)) {
- dangerMask = (short) 0xff00;
- encoding = "ISO-8859-1";
- } else if ("UNICODE".equals (encoding)
- || "UNICODE-BIG".equals (encoding)
- || "UNICODE-LITTLE".equals (encoding)) {
- encoding = "UTF-16";
-
- // TODO: UTF-16BE, UTF-16LE ... no BOM; what
- // release of JDK supports those Unicode names?
- }
-
- if (dangerMask != 0)
- stringBuf = new StringBuffer ();
- }
-
- this.encoding = encoding;
- }
-
-
- /**
- * Resets the handler to write a new text document.
- *
- * @param writer XML text is written to this writer.
- * @param encoding if non-null, and an XML declaration is written,
- * this is the name that will be used for the character encoding.
- *
- * @exception IllegalStateException if the current
- * document hasn't yet ended (with {@link #endDocument})
- */
- final public void setWriter (Writer writer, String encoding)
- {
- if (out != null)
- throw new IllegalStateException (
- "can't change stream in mid course");
- out = writer;
- if (out != null)
- setEncoding (encoding);
- if (!(out instanceof BufferedWriter))
- out = new BufferedWriter (out);
- space.push ("default");
- }
-
- /**
- * Assigns the line ending style to be used on output.
- * @param eolString null to use the system default; else
- * "\n", "\r", or "\r\n".
- */
- final public void setEOL (String eolString)
- {
- if (eolString == null)
- eol = sysEOL;
- else if (!isLineEnd (eolString))
- eol = eolString;
- else
- throw new IllegalArgumentException (eolString);
- }
-
- /**
- * Assigns the error handler to be used to present most fatal
- * errors.
- */
- public void setErrorHandler (ErrorHandler handler)
- {
- errHandler = handler;
- }
-
- /**
- * Used internally and by subclasses, this encapsulates the logic
- * involved in reporting fatal errors. It uses locator information
- * for good diagnostics, if available, and gives the application's
- * ErrorHandler the opportunity to handle the error before throwing
- * an exception.
- */
- protected void fatal (String message, Exception e)
- throws SAXException
- {
- SAXParseException x;
-
- if (locator == null)
- x = new SAXParseException (message, null, null, -1, -1, e);
- else
- x = new SAXParseException (message, locator, e);
- if (errHandler != null)
- errHandler.fatalError (x);
- throw x;
- }
-
-
- // JavaBeans properties
-
- /**
- * Controls whether the output should attempt to follow the "transitional"
- * XHTML rules so that it meets the "HTML Compatibility Guidelines"
- * appendix in the XHTML specification. A "transitional" Document Type
- * Declaration (DTD) is placed near the beginning of the output document,
- * instead of whatever DTD would otherwise have been placed there, and
- * XHTML empty elements are printed specially. When writing text in
- * US-ASCII or ISO-8859-1 encodings, the predefined XHTML internal
- * entity names are used (in preference to character references) when
- * writing content characters which can't be expressed in those encodings.
- *
- * <p> When this option is enabled, it is the caller's responsibility
- * to ensure that the input is otherwise valid as XHTML. Things to
- * be careful of in all cases, as described in the appendix referenced
- * above, include: <ul>
- *
- * <li> Element and attribute names must be in lower case, both
- * in the document and in any CSS style sheet.
- * <li> All XML constructs must be valid as defined by the XHTML
- * "transitional" DTD (including all familiar constructs,
- * even deprecated ones).
- * <li> The root element must be "html".
- * <li> Elements that must be empty (such as <em>&lt;br&gt;</em>
- * must have no content.
- * <li> Use both <em>lang</em> and <em>xml:lang</em> attributes
- * when specifying language.
- * <li> Similarly, use both <em>id</em> and <em>name</em> attributes
- * when defining elements that may be referred to through
- * URI fragment identifiers ... and make sure that the
- * value is a legal NMTOKEN, since not all such HTML 4.0
- * identifiers are valid in XML.
- * <li> Be careful with character encodings; make sure you provide
- * a <em>&lt;meta http-equiv="Content-type"
- * content="text/xml;charset=..." /&gt;</em> element in
- * the HTML "head" element, naming the same encoding
- * used to create this handler. Also, if that encoding
- * is anything other than US-ASCII, make sure that if
- * the document is given a MIME content type, it has
- * a <em>charset=...</em> attribute with that encoding.
- * </ul>
- *
- * <p> Additionally, some of the oldest browsers have additional
- * quirks, to address with guidelines such as: <ul>
- *
- * <li> Processing instructions may be rendered, so avoid them.
- * (Similarly for an XML declaration.)
- * <li> Embedded style sheets and scripts should not contain XML
- * markup delimiters: &amp;, &lt;, and ]]&gt; are trouble.
- * <li> Attribute values should not have line breaks or multiple
- * consecutive white space characters.
- * <li> Use no more than one of the deprecated (transitional)
- * <em>&lt;isindex&gt;</em> elements.
- * <li> Some boolean attributes (such as <em>compact, checked,
- * disabled, readonly, selected,</em> and more) confuse
- * some browsers, since they only understand minimized
- * versions which are illegal in XML.
- * </ul>
- *
- * <p> Also, some characteristics of the resulting output may be
- * a function of whether the document is later given a MIME
- * content type of <em>text/html</em> rather than one indicating
- * XML (<em>application/xml</em> or <em>text/xml</em>). Worse,
- * some browsers ignore MIME content types and prefer to rely URI
- * name suffixes -- so an "index.xml" could always be XML, never
- * XHTML, no matter its MIME type.
- */
- final public void setXhtml (boolean value)
- {
- if (locator != null)
- throw new IllegalStateException ("started parsing");
- xhtml = value;
- if (xhtml)
- canonical = false;
- }
-
- /**
- * Returns true if the output attempts to echo the input following
- * "transitional" XHTML rules and matching the "HTML Compatibility
- * Guidelines" so that an HTML version 3 browser can read the output
- * as HTML; returns false (the default) othewise.
- */
- final public boolean isXhtml ()
- {
- return xhtml;
- }
-
- /**
- * Controls whether the output text contains references to
- * entities (the default), or instead contains the expanded
- * values of those entities.
- */
- final public void setExpandingEntities (boolean value)
- {
- if (locator != null)
- throw new IllegalStateException ("started parsing");
- expandingEntities = value;
- if (!expandingEntities)
- canonical = false;
- }
-
- /**
- * Returns true if the output will have no entity references;
- * returns false (the default) otherwise.
- */
- final public boolean isExpandingEntities ()
- {
- return expandingEntities;
- }
-
- /**
- * Controls pretty-printing, which by default is not enabled
- * (and currently is most useful for XHTML output).
- * Pretty printing enables structural indentation, sorting of attributes
- * by name, line wrapping, and potentially other mechanisms for making
- * output more or less readable.
- *
- * <p> At this writing, structural indentation and line wrapping are
- * enabled when pretty printing is enabled and the <em>xml:space</em>
- * attribute has the value <em>default</em> (its other legal value is
- * <em>preserve</em>, as defined in the XML specification). The three
- * XHTML element types which use another value are recognized by their
- * names (namespaces are ignored).
- *
- * <p> Also, for the record, the "pretty" aspect of printing here
- * is more to provide basic structure on outputs that would otherwise
- * risk being a single long line of text. For now, expect the
- * structure to be ragged ... unless you'd like to submit a patch
- * to make this be more strictly formatted!
- *
- * @exception IllegalStateException thrown if this method is invoked
- * after output has begun.
- */
- final public void setPrettyPrinting (boolean value)
- {
- if (locator != null)
- throw new IllegalStateException ("started parsing");
- prettyPrinting = value;
- if (prettyPrinting)
- canonical = false;
- }
-
- /**
- * Returns value of flag controlling pretty printing.
- */
- final public boolean isPrettyPrinting ()
- {
- return prettyPrinting;
- }
-
-
- /**
- * Sets the output style to be canonicalized. Input events must
- * meet requirements that are slightly more stringent than the
- * basic well-formedness ones, and include: <ul>
- *
- * <li> Namespace prefixes must not have been changed from those
- * in the original document. (This may only be ensured by setting
- * the SAX2 XMLReader <em>namespace-prefixes</em> feature flag;
- * by default, it is cleared.)
- *
- * <li> Redundant namespace declaration attributes have been
- * removed. (If an ancestor element defines a namespace prefix
- * and that declaration hasn't been overriden, an element must
- * not redeclare it.)
- *
- * <li> If comments are not to be included in the canonical output,
- * they must first be removed from the input event stream; this
- * <em>Canonical XML with comments</em> by default.
- *
- * <li> If the input character encoding was not UCS-based, the
- * character data must have been normalized using Unicode
- * Normalization Form C. (UTF-8 and UTF-16 are UCS-based.)
- *
- * <li> Attribute values must have been normalized, as is done
- * by any conformant XML processor which processes all external
- * parameter entities.
- *
- * <li> Similarly, attribute value defaulting has been performed.
- *
- * </ul>
- *
- * <p> Note that fragments of XML documents, as specified by an XPath
- * node set, may be canonicalized. In such cases, elements may need
- * some fixup (for <em>xml:*</em> attributes and application-specific
- * context).
- *
- * @exception IllegalArgumentException if the output encoding
- * is anything other than UTF-8.
- */
- final public void setCanonical (boolean value)
- {
- if (value && !"UTF-8".equals (encoding))
- throw new IllegalArgumentException ("encoding != UTF-8");
- canonical = value;
- if (canonical) {
- prettyPrinting = xhtml = false;
- expandingEntities = true;
- eol = "\n";
- }
- }
-
-
- /**
- * Returns value of flag controlling canonical output.
- */
- final public boolean isCanonical ()
- {
- return canonical;
- }
-
-
- /**
- * Flushes the output stream. When this handler is used in long lived
- * pipelines, it can be important to flush buffered state, for example
- * so that it can reach the disk as part of a state checkpoint.
- */
- final public void flush ()
- throws IOException
- {
- if (out != null)
- out.flush ();
- }
-
-
- // convenience routines
-
-// FIXME: probably want a subclass that holds a lot of these...
-// and maybe more!
-
- /**
- * Writes the string as if characters() had been called on the contents
- * of the string. This is particularly useful when applications act as
- * producers and write data directly to event consumers.
- */
- final public void write (String data)
- throws SAXException
- {
- char buf [] = data.toCharArray ();
- characters (buf, 0, buf.length);
- }
-
-
- /**
- * Writes an element that has content consisting of a single string.
- * @see #writeEmptyElement
- * @see #startElement
- */
- public void writeElement (
- String uri,
- String localName,
- String qName,
- Attributes atts,
- String content
- ) throws SAXException
- {
- if (content == null || content.length () == 0) {
- writeEmptyElement (uri, localName, qName, atts);
- return;
- }
- startElement (uri, localName, qName, atts);
- char chars [] = content.toCharArray ();
- characters (chars, 0, chars.length);
- endElement (uri, localName, qName);
- }
-
-
- /**
- * Writes an element that has content consisting of a single integer,
- * encoded as a decimal string.
- * @see #writeEmptyElement
- * @see #startElement
- */
- public void writeElement (
- String uri,
- String localName,
- String qName,
- Attributes atts,
- int content
- ) throws SAXException
- {
- writeElement (uri, localName, qName, atts, Integer.toString (content));
- }
-
-
- // SAX1 ContentHandler
- /** <b>SAX1</b>: provides parser status information */
- final public void setDocumentLocator (Locator l)
- {
- locator = l;
- }
-
-
- // URL for dtd that validates against all normal HTML constructs
- private static final String xhtmlFullDTD =
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";
-
-
- /**
- * <b>SAX1</b>: indicates the beginning of a document parse.
- * If you're writing (well formed) fragments of XML, neither
- * this nor endDocument should be called.
- */
- // NOT final
- public void startDocument ()
- throws SAXException
- {
- try {
- if (out == null)
- throw new IllegalStateException (
- "null Writer given to XMLWriter");
-
- // Not all parsers provide the locator we want; this also
- // flags whether events are being sent to this object yet.
- // We could only have this one call if we only printed whole
- // documents ... but we also print fragments, so most of the
- // callbacks here replicate this test.
-
- if (locator == null)
- locator = new LocatorImpl ();
-
- // Unless the data is in US-ASCII or we're canonicalizing, write
- // the XML declaration if we know the encoding. US-ASCII won't
- // normally get mangled by web server confusion about the
- // character encodings used. Plus, it's an easy way to
- // ensure we can write ASCII that's unlikely to confuse
- // elderly HTML parsers.
-
- if (!canonical
- && dangerMask != (short) 0xff80
- && encoding != null) {
- rawWrite ("<?xml version='1.0'");
- rawWrite (" encoding='" + encoding + "'");
- rawWrite ("?>");
- newline ();
- }
-
- if (xhtml) {
-
- rawWrite ("<!DOCTYPE html PUBLIC");
- newline ();
- rawWrite (" '-//W3C//DTD XHTML 1.0 Transitional//EN'");
- newline ();
- rawWrite (" '");
- // NOTE: URL (above) matches the REC
- rawWrite (xhtmlFullDTD);
- rawWrite ("'>");
- newline ();
- newline ();
-
- // fake the rest of the handler into ignoring
- // everything until the root element, so any
- // XHTML DTD comments, PIs, etc are ignored
- startedDoctype = true;
- }
-
- entityNestLevel = 0;
-
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /**
- * <b>SAX1</b>: indicates the completion of a parse.
- * Note that all complete SAX event streams make this call, even
- * if an error is reported during a parse.
- */
- // NOT final
- public void endDocument ()
- throws SAXException
- {
- try {
- if (!canonical) {
- newline ();
- newline ();
- }
- out.close ();
- out = null;
- locator = null;
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- // XHTML elements declared as EMPTY print differently
- final private static boolean isEmptyElementTag (String tag)
- {
- switch (tag.charAt (0)) {
- case 'a': return "area".equals (tag);
- case 'b': return "base".equals (tag)
- || "basefont".equals (tag)
- || "br".equals (tag);
- case 'c': return "col".equals (tag);
- case 'f': return "frame".equals (tag);
- case 'h': return "hr".equals (tag);
- case 'i': return "img".equals (tag)
- || "input".equals (tag)
- || "isindex".equals (tag);
- case 'l': return "link".equals (tag);
- case 'm': return "meta".equals (tag);
- case 'p': return "param".equals (tag);
- }
- return false;
- }
-
- private static boolean indentBefore (String tag)
- {
- // basically indent before block content
- // and within structure like tables, lists
- switch (tag.charAt (0)) {
- case 'a': return "applet".equals (tag);
- case 'b': return "body".equals (tag)
- || "blockquote".equals (tag);
- case 'c': return "center".equals (tag);
- case 'f': return "frame".equals (tag)
- || "frameset".equals (tag);
- case 'h': return "head".equals (tag);
- case 'm': return "meta".equals (tag);
- case 'o': return "object".equals (tag);
- case 'p': return "param".equals (tag)
- || "pre".equals (tag);
- case 's': return "style".equals (tag);
- case 't': return "title".equals (tag)
- || "td".equals (tag)
- || "th".equals (tag);
- }
- // ... but not inline elements like "em", "b", "font"
- return false;
- }
-
- private static boolean spaceBefore (String tag)
- {
- // blank line AND INDENT before certain structural content
- switch (tag.charAt (0)) {
- case 'h': return "h1".equals (tag)
- || "h2".equals (tag)
- || "h3".equals (tag)
- || "h4".equals (tag)
- || "h5".equals (tag)
- || "h6".equals (tag)
- || "hr".equals (tag);
- case 'l': return "li".equals (tag);
- case 'o': return "ol".equals (tag);
- case 'p': return "p".equals (tag);
- case 't': return "table".equals (tag)
- || "tr".equals (tag);
- case 'u': return "ul".equals (tag);
- }
- return false;
- }
-
- // XHTML DTDs say these three have xml:space="preserve"
- private static boolean spacePreserve (String tag)
- {
- return "pre".equals (tag)
- || "style".equals (tag)
- || "script".equals (tag);
- }
-
- /**
- * <b>SAX2</b>: ignored.
- */
- final public void startPrefixMapping (String prefix, String uri)
- {}
-
- /**
- * <b>SAX2</b>: ignored.
- */
- final public void endPrefixMapping (String prefix)
- {}
-
- private void writeStartTag (
- String name,
- Attributes atts,
- boolean isEmpty
- ) throws SAXException, IOException
- {
- rawWrite ('<');
- rawWrite (name);
-
- // write out attributes ... sorting is particularly useful
- // with output that's been heavily defaulted.
- if (atts != null && atts.getLength () != 0) {
-
- // Set up to write, with optional sorting
- int indices [] = new int [atts.getLength ()];
-
- for (int i= 0; i < indices.length; i++)
- indices [i] = i;
-
- // optionally sort
-
-// FIXME: canon xml demands xmlns nodes go first,
-// and sorting by URI first (empty first) then localname
-// it should maybe use a different sort
-
- if (canonical || prettyPrinting) {
-
- // insertion sort by attribute name
- for (int i = 1; i < indices.length; i++) {
- int n = indices [i], j;
- String s = atts.getQName (n);
-
- for (j = i - 1; j >= 0; j--) {
- if (s.compareTo (atts.getQName (indices [j]))
- >= 0)
- break;
- indices [j + 1] = indices [j];
- }
- indices [j + 1] = n;
- }
- }
-
- // write, sorted or no
- for (int i= 0; i < indices.length; i++) {
- String s = atts.getQName (indices [i]);
-
- if (s == null || "".equals (s))
- throw new IllegalArgumentException ("no XML name");
- rawWrite (" ");
- rawWrite (s);
- rawWrite ("=");
- writeQuotedValue (atts.getValue (indices [i]),
- CTX_ATTRIBUTE);
- }
- }
- if (isEmpty)
- rawWrite (" /");
- rawWrite ('>');
- }
-
- /**
- * <b>SAX2</b>: indicates the start of an element.
- * When XHTML is in use, avoid attribute values with
- * line breaks or multiple whitespace characters, since
- * not all user agents handle them correctly.
- */
- final public void startElement (
- String uri,
- String localName,
- String qName,
- Attributes atts
- ) throws SAXException
- {
- startedDoctype = false;
-
- if (locator == null)
- locator = new LocatorImpl ();
-
- if (qName == null || "".equals (qName))
- throw new IllegalArgumentException ("no XML name");
-
- try {
- if (entityNestLevel != 0)
- return;
- if (prettyPrinting) {
- String whitespace = null;
-
- if (xhtml && spacePreserve (qName))
- whitespace = "preserve";
- else if (atts != null)
- whitespace = atts.getValue ("xml:space");
- if (whitespace == null)
- whitespace = (String) space.peek ();
- space.push (whitespace);
-
- if ("default".equals (whitespace)) {
- if (xhtml) {
- if (spaceBefore (qName)) {
- newline ();
- doIndent ();
- } else if (indentBefore (qName))
- doIndent ();
- // else it's inlined, modulo line length
- // FIXME: incrementing element nest level
- // for inlined elements causes ugliness
- } else
- doIndent ();
- }
- }
- elementNestLevel++;
- writeStartTag (qName, atts, xhtml && isEmptyElementTag (qName));
-
- if (xhtml) {
-// FIXME: if this is an XHTML "pre" element, turn
-// off automatic wrapping.
- }
-
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /**
- * Writes an empty element.
- * @see #startElement
- */
- public void writeEmptyElement (
- String uri,
- String localName,
- String qName,
- Attributes atts
- ) throws SAXException
- {
- if (canonical) {
- startElement (uri, localName, qName, atts);
- endElement (uri, localName, qName);
- } else {
- try {
- writeStartTag (qName, atts, true);
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
- }
-
-
- /** <b>SAX2</b>: indicates the end of an element */
- final public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- if (qName == null || "".equals (qName))
- throw new IllegalArgumentException ("no XML name");
-
- try {
- elementNestLevel--;
- if (entityNestLevel != 0)
- return;
- if (xhtml && isEmptyElementTag (qName))
- return;
- rawWrite ("</");
- rawWrite (qName);
- rawWrite ('>');
-
- if (prettyPrinting) {
- if (!space.empty ())
- space.pop ();
- else
- fatal ("stack discipline", null);
- }
- if (elementNestLevel == 0)
- inEpilogue = true;
-
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /** <b>SAX1</b>: reports content characters */
- final public void characters (char ch [], int start, int length)
- throws SAXException
- {
- if (locator == null)
- locator = new LocatorImpl ();
-
- try {
- if (entityNestLevel != 0)
- return;
- if (inCDATA) {
- escapeChars (ch, start, length, CTX_UNPARSED);
- } else {
- escapeChars (ch, start, length, CTX_CONTENT);
- }
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /** <b>SAX1</b>: reports ignorable whitespace */
- final public void ignorableWhitespace (char ch [], int start, int length)
- throws SAXException
- {
- if (locator == null)
- locator = new LocatorImpl ();
-
- try {
- if (entityNestLevel != 0)
- return;
- // don't forget to map NL to CRLF, CR, etc
- escapeChars (ch, start, length, CTX_CONTENT);
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /**
- * <b>SAX1</b>: reports a PI.
- * This doesn't check for illegal target names, such as "xml" or "XML",
- * or namespace-incompatible ones like "big:dog"; the caller is
- * responsible for ensuring those names are legal.
- */
- final public void processingInstruction (String target, String data)
- throws SAXException
- {
- if (locator == null)
- locator = new LocatorImpl ();
-
- // don't print internal subset for XHTML
- if (xhtml && startedDoctype)
- return;
-
- // ancient HTML browsers might render these ... their loss.
- // to prevent: "if (xhtml) return;".
-
- try {
- if (entityNestLevel != 0)
- return;
- if (canonical && inEpilogue)
- newline ();
- rawWrite ("<?");
- rawWrite (target);
- rawWrite (' ');
- escapeChars (data.toCharArray (), -1, -1, CTX_UNPARSED);
- rawWrite ("?>");
- if (elementNestLevel == 0 && !(canonical && inEpilogue))
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /** <b>SAX1</b>: indicates a non-expanded entity reference */
- public void skippedEntity (String name)
- throws SAXException
- {
- try {
- rawWrite ("&");
- rawWrite (name);
- rawWrite (";");
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- // SAX2 LexicalHandler
-
- /** <b>SAX2</b>: called before parsing CDATA characters */
- final public void startCDATA ()
- throws SAXException
- {
- if (locator == null)
- locator = new LocatorImpl ();
-
- if (canonical)
- return;
-
- try {
- inCDATA = true;
- if (entityNestLevel == 0)
- rawWrite ("<![CDATA[");
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /** <b>SAX2</b>: called after parsing CDATA characters */
- final public void endCDATA ()
- throws SAXException
- {
- if (canonical)
- return;
-
- try {
- inCDATA = false;
- if (entityNestLevel == 0)
- rawWrite ("]]>");
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /**
- * <b>SAX2</b>: called when the doctype is partially parsed
- * Note that this, like other doctype related calls, is ignored
- * when XHTML is in use.
- */
- final public void startDTD (String name, String publicId, String systemId)
- throws SAXException
- {
- if (locator == null)
- locator = new LocatorImpl ();
- if (xhtml)
- return;
- try {
- inDoctype = startedDoctype = true;
- if (canonical)
- return;
- rawWrite ("<!DOCTYPE ");
- rawWrite (name);
- rawWrite (' ');
-
- if (!expandingEntities) {
- if (publicId != null)
- rawWrite ("PUBLIC '" + publicId + "' '" + systemId + "' ");
- else if (systemId != null)
- rawWrite ("SYSTEM '" + systemId + "' ");
- }
-
- rawWrite ('[');
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /** <b>SAX2</b>: called after the doctype is parsed */
- final public void endDTD ()
- throws SAXException
- {
- inDoctype = false;
- if (canonical || xhtml)
- return;
- try {
- rawWrite ("]>");
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /**
- * <b>SAX2</b>: called before parsing a general entity in content
- */
- final public void startEntity (String name)
- throws SAXException
- {
- try {
- boolean writeEOL = true;
-
- // Predefined XHTML entities (for characters) will get
- // mapped back later.
- if (xhtml || expandingEntities)
- return;
-
- entityNestLevel++;
- if (name.equals ("[dtd]"))
- return;
- if (entityNestLevel != 1)
- return;
- if (!name.startsWith ("%")) {
- writeEOL = false;
- rawWrite ('&');
- }
- rawWrite (name);
- rawWrite (';');
- if (writeEOL)
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /**
- * <b>SAX2</b>: called after parsing a general entity in content
- */
- final public void endEntity (String name)
- throws SAXException
- {
- if (xhtml || expandingEntities)
- return;
- entityNestLevel--;
- }
-
- /**
- * <b>SAX2</b>: called when comments are parsed.
- * When XHTML is used, the old HTML tradition of using comments
- * to for inline CSS, or for JavaScript code is discouraged.
- * This is because XML processors are encouraged to discard, on
- * the grounds that comments are for users (and perhaps text
- * editors) not programs. Instead, use external scripts
- */
- final public void comment (char ch [], int start, int length)
- throws SAXException
- {
- if (locator == null)
- locator = new LocatorImpl ();
-
- // don't print internal subset for XHTML
- if (xhtml && startedDoctype)
- return;
- // don't print comment in doctype for canon xml
- if (canonical && inDoctype)
- return;
-
- try {
- boolean indent;
-
- if (prettyPrinting && space.empty ())
- fatal ("stack discipline", null);
- indent = prettyPrinting && "default".equals (space.peek ());
- if (entityNestLevel != 0)
- return;
- if (indent)
- doIndent ();
- if (canonical && inEpilogue)
- newline ();
- rawWrite ("<!--");
- escapeChars (ch, start, length, CTX_UNPARSED);
- rawWrite ("-->");
- if (indent)
- doIndent ();
- if (elementNestLevel == 0 && !(canonical && inEpilogue))
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- // SAX1 DTDHandler
-
- /** <b>SAX1</b>: called on notation declarations */
- final public void notationDecl (String name,
- String publicId, String systemId)
- throws SAXException
- {
- if (xhtml)
- return;
- try {
- // At this time, only SAX2 callbacks start these.
- if (!startedDoctype)
- return;
-
- if (entityNestLevel != 0)
- return;
- rawWrite ("<!NOTATION " + name + " ");
- if (publicId != null)
- rawWrite ("PUBLIC \"" + publicId + '"');
- else
- rawWrite ("SYSTEM ");
- if (systemId != null)
- rawWrite ('"' + systemId + '"');
- rawWrite (">");
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /** <b>SAX1</b>: called on unparsed entity declarations */
- final public void unparsedEntityDecl (String name,
- String publicId, String systemId,
- String notationName)
- throws SAXException
- {
- if (xhtml)
- return;
- try {
- // At this time, only SAX2 callbacks start these.
- if (!startedDoctype) {
- // FIXME: write to temporary buffer, and make the start
- // of the root element write these declarations.
- return;
- }
-
- if (entityNestLevel != 0)
- return;
- rawWrite ("<!ENTITY " + name + " ");
- if (publicId != null)
- rawWrite ("PUBLIC \"" + publicId + '"');
- else
- rawWrite ("SYSTEM ");
- rawWrite ('"' + systemId + '"');
- rawWrite (" NDATA " + notationName + ">");
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- // SAX2 DeclHandler
-
- /** <b>SAX2</b>: called on attribute declarations */
- final public void attributeDecl (String eName, String aName,
- String type, String mode, String value)
- throws SAXException
- {
- if (xhtml)
- return;
- try {
- // At this time, only SAX2 callbacks start these.
- if (!startedDoctype)
- return;
- if (entityNestLevel != 0)
- return;
- rawWrite ("<!ATTLIST " + eName + ' ' + aName + ' ');
- rawWrite (type);
- rawWrite (' ');
- if (mode != null)
- rawWrite (mode + ' ');
- if (value != null)
- writeQuotedValue (value, CTX_ATTRIBUTE);
- rawWrite ('>');
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /** <b>SAX2</b>: called on element declarations */
- final public void elementDecl (String name, String model)
- throws SAXException
- {
- if (xhtml)
- return;
- try {
- // At this time, only SAX2 callbacks start these.
- if (!startedDoctype)
- return;
- if (entityNestLevel != 0)
- return;
- rawWrite ("<!ELEMENT " + name + ' ' + model + '>');
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /** <b>SAX2</b>: called on external entity declarations */
- final public void externalEntityDecl (
- String name,
- String publicId,
- String systemId)
- throws SAXException
- {
- if (xhtml)
- return;
- try {
- // At this time, only SAX2 callbacks start these.
- if (!startedDoctype)
- return;
- if (entityNestLevel != 0)
- return;
- rawWrite ("<!ENTITY ");
- if (name.startsWith ("%")) {
- rawWrite ("% ");
- rawWrite (name.substring (1));
- } else
- rawWrite (name);
- if (publicId != null)
- rawWrite (" PUBLIC \"" + publicId + '"');
- else
- rawWrite (" SYSTEM ");
- rawWrite ('"' + systemId + "\">");
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- /** <b>SAX2</b>: called on internal entity declarations */
- final public void internalEntityDecl (String name, String value)
- throws SAXException
- {
- if (xhtml)
- return;
- try {
- // At this time, only SAX2 callbacks start these.
- if (!startedDoctype)
- return;
- if (entityNestLevel != 0)
- return;
- rawWrite ("<!ENTITY ");
- if (name.startsWith ("%")) {
- rawWrite ("% ");
- rawWrite (name.substring (1));
- } else
- rawWrite (name);
- rawWrite (' ');
- writeQuotedValue (value, CTX_ENTITY);
- rawWrite ('>');
- newline ();
- } catch (IOException e) {
- fatal ("can't write", e);
- }
- }
-
- private void writeQuotedValue (String value, int code)
- throws SAXException, IOException
- {
- char buf [] = value.toCharArray ();
- int off = 0, len = buf.length;
-
- // we can't add line breaks to attribute/entity/... values
- noWrap = true;
- rawWrite ('"');
- escapeChars (buf, off, len, code);
- rawWrite ('"');
- noWrap = false;
- }
-
- // From "HTMLlat1x.ent" ... names of entities for ISO-8859-1
- // (Latin/1) characters, all codes: 160-255 (0xA0-0xFF).
- // Codes 128-159 have no assigned values.
- private static final String HTMLlat1x [] = {
- // 160
- "nbsp", "iexcl", "cent", "pound", "curren",
- "yen", "brvbar", "sect", "uml", "copy",
-
- // 170
- "ordf", "laquo", "not", "shy", "reg",
- "macr", "deg", "plusmn", "sup2", "sup3",
-
- // 180
- "acute", "micro", "para", "middot", "cedil",
- "sup1", "ordm", "raquo", "frac14", "frac12",
-
- // 190
- "frac34", "iquest", "Agrave", "Aacute", "Acirc",
- "Atilde", "Auml", "Aring", "AElig", "Ccedil",
-
- // 200
- "Egrave", "Eacute", "Ecirc", "Euml", "Igrave",
- "Iacute", "Icirc", "Iuml", "ETH", "Ntilde",
-
- // 210
- "Ograve", "Oacute", "Ocirc", "Otilde", "Ouml",
- "times", "Oslash", "Ugrave", "Uacute", "Ucirc",
-
- // 220
- "Uuml", "Yacute", "THORN", "szlig", "agrave",
- "aacute", "acirc", "atilde", "auml", "aring",
-
- // 230
- "aelig", "ccedil", "egrave", "eacute", "ecirc",
- "euml", "igrave", "iacute", "icirc", "iuml",
-
- // 240
- "eth", "ntilde", "ograve", "oacute", "ocirc",
- "otilde", "ouml", "divide", "oslash", "ugrave",
-
- // 250
- "uacute", "ucirc", "uuml", "yacute", "thorn",
- "yuml"
- };
-
- // From "HTMLsymbolx.ent" ... some of the symbols that
- // we can conveniently handle. Entities for the Greek.
- // alphabet (upper and lower cases) are compact.
- private static final String HTMLsymbolx_GR [] = {
- // 913
- "Alpha", "Beta", "Gamma", "Delta", "Epsilon",
- "Zeta", "Eta", "Theta", "Iota", "Kappa",
-
- // 923
- "Lambda", "Mu", "Nu", "Xi", "Omicron",
- "Pi", "Rho", null, "Sigma", "Tau",
-
- // 933
- "Upsilon", "Phi", "Chi", "Psi", "Omega"
- };
-
- private static final String HTMLsymbolx_gr [] = {
- // 945
- "alpha", "beta", "gamma", "delta", "epsilon",
- "zeta", "eta", "theta", "iota", "kappa",
-
- // 955
- "lambda", "mu", "nu", "xi", "omicron",
- "pi", "rho", "sigmaf", "sigma", "tau",
-
- // 965
- "upsilon", "phi", "chi", "psi", "omega"
- };
-
-
- // General routine to write text and substitute predefined
- // entities (XML, and a special case for XHTML) as needed.
- private void escapeChars (char buf [], int off, int len, int code)
- throws SAXException, IOException
- {
- int first = 0;
-
- if (off < 0) {
- off = 0;
- len = buf.length;
- }
- for (int i = 0; i < len; i++) {
- String esc;
- char c = buf [off + i];
-
- switch (c) {
- // Note that CTX_ATTRIBUTE isn't explicitly tested here;
- // all syntax delimiters are escaped in CTX_ATTRIBUTE,
- // otherwise it's similar to CTX_CONTENT
-
- // ampersand flags entity references; entity replacement
- // text has unexpanded references, other text doesn't.
- case '&':
- if (code == CTX_ENTITY || code == CTX_UNPARSED)
- continue;
- esc = "amp";
- break;
-
- // attributes and text may NOT have literal '<', but
- // entities may have markup constructs
- case '<':
- if (code == CTX_ENTITY || code == CTX_UNPARSED)
- continue;
- esc = "lt";
- break;
-
- // as above re markup constructs; but otherwise
- // except when canonicalizing, this is for consistency
- case '>':
- if (code == CTX_ENTITY || code == CTX_UNPARSED)
- continue;
- esc = "gt";
- break;
- case '\'':
- if (code == CTX_CONTENT || code == CTX_UNPARSED)
- continue;
- if (canonical)
- continue;
- esc = "apos";
- break;
-
- // needed when printing quoted attribute/entity values
- case '"':
- if (code == CTX_CONTENT || code == CTX_UNPARSED)
- continue;
- esc = "quot";
- break;
-
- // make line ends work per host OS convention
- case '\n':
- esc = eol;
- break;
-
- //
- // No other characters NEED special treatment ... except
- // for encoding-specific issues, like whether the character
- // can really be represented in that encoding.
- //
- default:
- //
- // There are characters we can never write safely; getting
- // them is an error.
- //
- // (a) They're never legal in XML ... detected by range
- // checks, and (eventually) by remerging surrogate
- // pairs on output. (Easy error for apps to prevent.)
- //
- // (b) This encoding can't represent them, and we
- // can't make reference substitution (e.g. inside
- // CDATA sections, names, PI data, etc). (Hard for
- // apps to prevent, except by using UTF-8 or UTF-16
- // as their output encoding.)
- //
- // We know a very little bit about what characters
- // the US-ASCII and ISO-8859-1 encodings support. For
- // other encodings we can't detect the second type of
- // error at all. (Never an issue for UTF-8 or UTF-16.)
- //
-
-// FIXME: CR in CDATA is an error; in text, turn to a char ref
-
-// FIXME: CR/LF/TAB in attributes should become char refs
-
- if ((c > 0xfffd)
- || ((c < 0x0020) && !((c == 0x0009)
- || (c == 0x000A) || (c == 0x000D)))
- || (((c & dangerMask) != 0)
- && (code == CTX_UNPARSED))) {
-
- // if case (b) in CDATA, we might end the section,
- // write a reference, then restart ... possible
- // in one DOM L3 draft.
-
- throw new CharConversionException (
- "Illegal or non-writable character: U+"
- + Integer.toHexString (c));
- }
-
- //
- // If the output encoding represents the character
- // directly, let it do so! Else we'll escape it.
- //
- if ((c & dangerMask) == 0)
- continue;
- esc = null;
-
- // Avoid numeric refs where symbolic ones exist, as
- // symbolic ones make more sense to humans reading!
- if (xhtml) {
- // all the HTMLlat1x.ent entities
- // (all the "ISO-8859-1" characters)
- if (c >= 160 && c <= 255)
- esc = HTMLlat1x [c - 160];
-
- // not quite half the HTMLsymbolx.ent entities
- else if (c >= 913 && c <= 937)
- esc = HTMLsymbolx_GR [c - 913];
- else if (c >= 945 && c <= 969)
- esc = HTMLsymbolx_gr [c - 945];
-
- else switch (c) {
- // all of the HTMLspecialx.ent entities
- case 338: esc = "OElig"; break;
- case 339: esc = "oelig"; break;
- case 352: esc = "Scaron"; break;
- case 353: esc = "scaron"; break;
- case 376: esc = "Yuml"; break;
- case 710: esc = "circ"; break;
- case 732: esc = "tilde"; break;
- case 8194: esc = "ensp"; break;
- case 8195: esc = "emsp"; break;
- case 8201: esc = "thinsp"; break;
- case 8204: esc = "zwnj"; break;
- case 8205: esc = "zwj"; break;
- case 8206: esc = "lrm"; break;
- case 8207: esc = "rlm"; break;
- case 8211: esc = "ndash"; break;
- case 8212: esc = "mdash"; break;
- case 8216: esc = "lsquo"; break;
- case 8217: esc = "rsquo"; break;
- case 8218: esc = "sbquo"; break;
- case 8220: esc = "ldquo"; break;
- case 8221: esc = "rdquo"; break;
- case 8222: esc = "bdquo"; break;
- case 8224: esc = "dagger"; break;
- case 8225: esc = "Dagger"; break;
- case 8240: esc = "permil"; break;
- case 8249: esc = "lsaquo"; break;
- case 8250: esc = "rsaquo"; break;
- case 8364: esc = "euro"; break;
-
- // the other HTMLsymbox.ent entities
- case 402: esc = "fnof"; break;
- case 977: esc = "thetasym"; break;
- case 978: esc = "upsih"; break;
- case 982: esc = "piv"; break;
- case 8226: esc = "bull"; break;
- case 8230: esc = "hellip"; break;
- case 8242: esc = "prime"; break;
- case 8243: esc = "Prime"; break;
- case 8254: esc = "oline"; break;
- case 8260: esc = "frasl"; break;
- case 8472: esc = "weierp"; break;
- case 8465: esc = "image"; break;
- case 8476: esc = "real"; break;
- case 8482: esc = "trade"; break;
- case 8501: esc = "alefsym"; break;
- case 8592: esc = "larr"; break;
- case 8593: esc = "uarr"; break;
- case 8594: esc = "rarr"; break;
- case 8595: esc = "darr"; break;
- case 8596: esc = "harr"; break;
- case 8629: esc = "crarr"; break;
- case 8656: esc = "lArr"; break;
- case 8657: esc = "uArr"; break;
- case 8658: esc = "rArr"; break;
- case 8659: esc = "dArr"; break;
- case 8660: esc = "hArr"; break;
- case 8704: esc = "forall"; break;
- case 8706: esc = "part"; break;
- case 8707: esc = "exist"; break;
- case 8709: esc = "empty"; break;
- case 8711: esc = "nabla"; break;
- case 8712: esc = "isin"; break;
- case 8713: esc = "notin"; break;
- case 8715: esc = "ni"; break;
- case 8719: esc = "prod"; break;
- case 8721: esc = "sum"; break;
- case 8722: esc = "minus"; break;
- case 8727: esc = "lowast"; break;
- case 8730: esc = "radic"; break;
- case 8733: esc = "prop"; break;
- case 8734: esc = "infin"; break;
- case 8736: esc = "ang"; break;
- case 8743: esc = "and"; break;
- case 8744: esc = "or"; break;
- case 8745: esc = "cap"; break;
- case 8746: esc = "cup"; break;
- case 8747: esc = "int"; break;
- case 8756: esc = "there4"; break;
- case 8764: esc = "sim"; break;
- case 8773: esc = "cong"; break;
- case 8776: esc = "asymp"; break;
- case 8800: esc = "ne"; break;
- case 8801: esc = "equiv"; break;
- case 8804: esc = "le"; break;
- case 8805: esc = "ge"; break;
- case 8834: esc = "sub"; break;
- case 8835: esc = "sup"; break;
- case 8836: esc = "nsub"; break;
- case 8838: esc = "sube"; break;
- case 8839: esc = "supe"; break;
- case 8853: esc = "oplus"; break;
- case 8855: esc = "otimes"; break;
- case 8869: esc = "perp"; break;
- case 8901: esc = "sdot"; break;
- case 8968: esc = "lceil"; break;
- case 8969: esc = "rceil"; break;
- case 8970: esc = "lfloor"; break;
- case 8971: esc = "rfloor"; break;
- case 9001: esc = "lang"; break;
- case 9002: esc = "rang"; break;
- case 9674: esc = "loz"; break;
- case 9824: esc = "spades"; break;
- case 9827: esc = "clubs"; break;
- case 9829: esc = "hearts"; break;
- case 9830: esc = "diams"; break;
- }
- }
-
- // else escape with numeric char refs
- if (esc == null) {
- stringBuf.setLength (0);
- stringBuf.append ("#x");
- stringBuf.append (Integer.toHexString (c).toUpperCase ());
- esc = stringBuf.toString ();
-
- // FIXME: We don't write surrogate pairs correctly.
- // They should work as one ref per character, since
- // each pair is one character. For reading back into
- // Unicode, it matters beginning in Unicode 3.1 ...
- }
- break;
- }
- if (i != first)
- rawWrite (buf, off + first, i - first);
- first = i + 1;
- if (esc == eol)
- newline ();
- else {
- rawWrite ('&');
- rawWrite (esc);
- rawWrite (';');
- }
- }
- if (first < len)
- rawWrite (buf, off + first, len - first);
- }
-
-
-
- private void newline ()
- throws SAXException, IOException
- {
- out.write (eol);
- column = 0;
- }
-
- private void doIndent ()
- throws SAXException, IOException
- {
- int space = elementNestLevel * 2;
-
- newline ();
- column = space;
- // track tabs only at line starts
- while (space > 8) {
- out.write ("\t");
- space -= 8;
- }
- while (space > 0) {
- out.write (" ");
- space -= 2;
- }
- }
-
- private void rawWrite (char c)
- throws IOException
- {
- out.write (c);
- column++;
- }
-
- private void rawWrite (String s)
- throws SAXException, IOException
- {
- if (prettyPrinting && "default".equals (space.peek ())) {
- char data [] = s.toCharArray ();
- rawWrite (data, 0, data.length);
- } else {
- out.write (s);
- column += s.length ();
- }
- }
-
- // NOTE: if xhtml, the REC gives some rules about whitespace
- // which we could follow ... notably, many places where conformant
- // agents "must" consolidate/normalize whitespace. Line ends can
- // be removed there, etc. This may not be the right place to do
- // such mappings though.
-
- // Line buffering may help clarify algorithms and improve results.
-
- // It's likely xml:space needs more attention.
-
- private void rawWrite (char buf [], int offset, int length)
- throws SAXException, IOException
- {
- boolean wrap;
-
- if (prettyPrinting && space.empty ())
- fatal ("stack discipline", null);
-
- wrap = prettyPrinting && "default".equals (space.peek ());
- if (!wrap) {
- out.write (buf, offset, length);
- column += length;
- return;
- }
-
- // we're pretty printing and want to fill lines out only
- // to the desired line length.
- while (length > 0) {
- int target = lineLength - column;
- boolean wrote = false;
-
- // Do we even have a problem?
- if (target > length || noWrap) {
- out.write (buf, offset, length);
- column += length;
- return;
- }
-
- // break the line at a space character, trying to fill
- // as much of the line as possible.
- char c;
-
- for (int i = target - 1; i >= 0; i--) {
- if ((c = buf [offset + i]) == ' ' || c == '\t') {
- i++;
- out.write (buf, offset, i);
- doIndent ();
- offset += i;
- length -= i;
- wrote = true;
- break;
- }
- }
- if (wrote)
- continue;
-
- // no space character permitting break before target
- // line length is filled. So, take the next one.
- if (target < 0)
- target = 0;
- for (int i = target; i < length; i++)
- if ((c = buf [offset + i]) == ' ' || c == '\t') {
- i++;
- out.write (buf, offset, i);
- doIndent ();
- offset += i;
- length -= i;
- wrote = true;
- break;
- }
- if (wrote)
- continue;
-
- // no such luck.
- out.write (buf, offset, length);
- column += length;
- break;
- }
- }
-}
diff --git a/libjava/gnu/xml/xpath/AndExpr.java b/libjava/gnu/xml/xpath/AndExpr.java
deleted file mode 100644
index 680e84792fb..00000000000
--- a/libjava/gnu/xml/xpath/AndExpr.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* AndExpr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * Logical and.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class AndExpr
- extends Expr
-{
-
- final Expr lhs;
- final Expr rhs;
-
- public AndExpr(Expr lhs, Expr rhs)
- {
- this.lhs = lhs;
- this.rhs = rhs;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object left = lhs.evaluate(context, pos, len);
- if (!_boolean(context, left))
- {
- return Boolean.FALSE;
- }
- Object right = rhs.evaluate(context, pos, len);
- return _boolean(context, right) ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public Expr clone(Object context)
- {
- return new AndExpr(lhs.clone(context), rhs.clone(context));
- }
-
- public String toString()
- {
- return lhs + " and " + rhs;
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/ArithmeticExpr.java b/libjava/gnu/xml/xpath/ArithmeticExpr.java
deleted file mode 100644
index f972d7d4afd..00000000000
--- a/libjava/gnu/xml/xpath/ArithmeticExpr.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/* ArithmeticExpr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * Binary arithmetic expression.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ArithmeticExpr
- extends Expr
-{
-
- static final int ADD = 0;
- static final int SUBTRACT = 1;
- static final int MULTIPLY = 2;
- static final int DIVIDE = 3;
- static final int MODULO = 4;
-
- final Expr lhs;
- final Expr rhs;
- final int op;
-
- ArithmeticExpr(Expr lhs, Expr rhs, int op)
- {
- this.lhs = lhs;
- this.rhs = rhs;
- switch (op)
- {
- case ADD:
- case SUBTRACT:
- case MULTIPLY:
- case DIVIDE:
- case MODULO:
- this.op = op;
- break;
- default:
- throw new IllegalArgumentException();
- }
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object left = lhs.evaluate(context, pos, len);
- Object right = rhs.evaluate(context, pos, len);
-
- double ln = _number(context, left);
- double rn = _number(context, right);
- switch (op)
- {
- case ADD:
- return new Double(ln + rn);
- case SUBTRACT:
- return new Double(ln - rn);
- case MULTIPLY:
- return new Double(ln * rn);
- case DIVIDE:
- if (rn == 0.0d || rn == -0.0d)
- {
- return new Double(ln < 0.0d ?
- Double.NEGATIVE_INFINITY :
- Double.POSITIVE_INFINITY);
- }
- return new Double(ln / rn);
- case MODULO:
- if (rn == 0.0d || rn == -0.0d)
- {
- return new Double(ln < 0.0d ?
- Double.NEGATIVE_INFINITY :
- Double.POSITIVE_INFINITY);
- }
- return new Double(ln % rn);
- default:
- throw new IllegalStateException();
- }
- }
-
- public Expr clone(Object context)
- {
- return new ArithmeticExpr(lhs.clone(context), rhs.clone(context), op);
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer();
- buf.append(lhs);
- buf.append(' ');
- switch (op)
- {
- case ADD:
- buf.append('+');
- break;
- case SUBTRACT:
- buf.append('-');
- break;
- case MULTIPLY:
- buf.append('*');
- break;
- case DIVIDE:
- buf.append("div");
- break;
- case MODULO:
- buf.append("mod");
- break;
- }
- buf.append(' ');
- buf.append(rhs);
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/BooleanFunction.java b/libjava/gnu/xml/xpath/BooleanFunction.java
deleted file mode 100644
index 018348ff2e7..00000000000
--- a/libjava/gnu/xml/xpath/BooleanFunction.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* BooleanFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>boolean</code> function converts its argument to a boolean as
- * follows:
- * <ul>
- * <li>a number is true if and only if it is neither positive or negative
- * zero nor NaN</li>
- * <li>a node-set is true if and only if it is non-empty</li>
- * <li>a string is true if and only if its length is non-zero</li>
- * <li>an object of a type other than the four basic types is converted to a
- * boolean in a way that is dependent on that type</li>
- * </ul>
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class BooleanFunction
- extends Expr
-{
-
- final Expr arg;
-
- BooleanFunction(List args)
- {
- this((Expr) args.get(0));
- }
-
- BooleanFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = arg.evaluate(context, pos, len);
- return _boolean(context, val) ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public Expr clone(Object context)
- {
- return new BooleanFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return "boolean(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/CeilingFunction.java b/libjava/gnu/xml/xpath/CeilingFunction.java
deleted file mode 100644
index 50dc45d550f..00000000000
--- a/libjava/gnu/xml/xpath/CeilingFunction.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* CeilingFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>ceiling</code> function returns the smallest (closest to
- * negative infinity) number that is not less than the argument and that
- * is an integer.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class CeilingFunction
- extends Expr
-{
-
- final Expr arg;
-
- CeilingFunction(List args)
- {
- this((Expr) args.get(0));
- }
-
- CeilingFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = arg.evaluate(context, pos, len);
- double n = _number(context, val);
- return new Double(Math.ceil(n));
- }
-
- public Expr clone(Object context)
- {
- return new CeilingFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return "ceiling(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/ConcatFunction.java b/libjava/gnu/xml/xpath/ConcatFunction.java
deleted file mode 100644
index 60802081d92..00000000000
--- a/libjava/gnu/xml/xpath/ConcatFunction.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* ConcatFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>concat</code> function returns the concatenation of its arguments.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ConcatFunction
- extends Expr
-{
-
- final List args;
-
- ConcatFunction(List args)
- {
- this.args = args;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- StringBuffer buf = new StringBuffer();
- for (Iterator i = args.iterator(); i.hasNext(); )
- {
- Expr arg = (Expr) i.next();
- Object val = arg.evaluate(context, pos, len);
- buf.append(_string(context, val));
- }
- return buf.toString();
- }
-
- public Expr clone(Object context)
- {
- int len = args.size();
- List args2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- args2.add(((Expr) args.get(i)).clone(context));
- }
- return new ConcatFunction(args2);
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer("concat(");
- int len = args.size();
- for (int i = 0; i < len; i++)
- {
- if (i > 0)
- {
- buf.append(',');
- }
- buf.append(args.get(i));
- }
- buf.append(')');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/Constant.java b/libjava/gnu/xml/xpath/Constant.java
deleted file mode 100644
index ca7c1d674b0..00000000000
--- a/libjava/gnu/xml/xpath/Constant.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Constant.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * Constant value (string literal or number).
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class Constant
- extends Expr
-{
-
- final Object value;
-
- public Constant(Object value)
- {
- this.value = value;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- return value;
- }
-
- public Expr clone(Object context)
- {
- return new Constant(value);
- }
-
- public String toString()
- {
- String ret = value.toString();
- if (value instanceof String)
- {
- if (ret.indexOf('\'') == -1)
- {
- return '\'' + ret + '\'';
- }
- else
- {
- return '"' + ret + '"';
- }
- }
- if (value instanceof Double)
- {
- if (ret.endsWith(".0"))
- {
- ret = ret.substring(0, ret.length() - 2);
- }
- }
- return ret;
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/ContainsFunction.java b/libjava/gnu/xml/xpath/ContainsFunction.java
deleted file mode 100644
index 3910d15ef26..00000000000
--- a/libjava/gnu/xml/xpath/ContainsFunction.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* ContainsFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>contains</code> function returns true if the first argument
- * string contains the second argument string, and otherwise returns false.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ContainsFunction
- extends Expr
-{
-
- final Expr arg1;
- final Expr arg2;
-
- ContainsFunction(List args)
- {
- this((Expr) args.get(0), (Expr) args.get(1));
- }
-
- ContainsFunction(Expr arg1, Expr arg2)
- {
- this.arg1 = arg1;
- this.arg2 = arg2;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val1 = arg1.evaluate(context, pos, len);
- Object val2 = arg2.evaluate(context, pos, len);
- String s1 = _string(context, val1);
- String s2 = _string(context, val2);
- return (s1.indexOf(s2) != -1) ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public Expr clone(Object context)
- {
- return new ContainsFunction(arg1.clone(context), arg2.clone(context));
- }
-
- public String toString()
- {
- return "contains(" + arg1 + "," + arg2 + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/CountFunction.java b/libjava/gnu/xml/xpath/CountFunction.java
deleted file mode 100644
index 4164f69f321..00000000000
--- a/libjava/gnu/xml/xpath/CountFunction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* CountFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Collection;
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>count</code> function returns the number of nodes in the
- * argument node-set.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class CountFunction
- extends Expr
-{
-
- final Expr arg;
-
- CountFunction(List args)
- {
- this((Expr) args.get(0));
- }
-
- CountFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = arg.evaluate(context, pos, len);
- return new Double((double) ((Collection) val).size());
- }
-
- public Expr clone(Object context)
- {
- return new CountFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return "count(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/DocumentOrderComparator.java b/libjava/gnu/xml/xpath/DocumentOrderComparator.java
deleted file mode 100644
index c7d7de9f7c7..00000000000
--- a/libjava/gnu/xml/xpath/DocumentOrderComparator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* DocumentOrderComparator.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Comparator;
-import org.w3c.dom.Node;
-
-/**
- * Sorts nodes into document order.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DocumentOrderComparator
- implements Comparator
-{
-
- public int compare(Object o1, Object o2)
- {
- if (o1 instanceof Node && o2 instanceof Node)
- {
- Node n1 = (Node)o1;
- Node n2 = (Node)o2;
- return (int) n1.compareDocumentPosition(n2);
- }
- return 0;
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/EqualityExpr.java b/libjava/gnu/xml/xpath/EqualityExpr.java
deleted file mode 100644
index d4a2f6890f0..00000000000
--- a/libjava/gnu/xml/xpath/EqualityExpr.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/* EqualityExpr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.w3c.dom.Node;
-
-/**
- * Boolean equality expression.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class EqualityExpr
- extends Expr
-{
-
- final Expr lhs;
- final Expr rhs;
- final boolean invert;
-
- EqualityExpr(Expr lhs, Expr rhs, boolean invert)
- {
- this.lhs = lhs;
- this.rhs = rhs;
- this.invert = invert;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- boolean val = evaluateImpl(context, pos, len);
- if (invert)
- {
- return val ? Boolean.FALSE : Boolean.TRUE;
- }
- else
- {
- return val ? Boolean.TRUE : Boolean.FALSE;
- }
- }
-
- private boolean evaluateImpl(Node context, int pos, int len)
- {
- Object left = lhs.evaluate(context, pos, len);
- Object right = rhs.evaluate(context, pos, len);
-
- /*
- * If both objects to be compared are node-sets, then the comparison
- * will be true if and only if there is a node in the first node-set and
- * a node in the second node-set such that the result of performing the
- * comparison on the string-values of the two nodes is true.
- */
- boolean flns = left instanceof Collection;
- boolean frns = right instanceof Collection;
- if (flns && frns)
- {
- Collection lns = (Collection) left;
- Collection rns = (Collection) right;
- boolean all = true;
- for (Iterator i = lns.iterator(); i.hasNext(); )
- {
- Node ltest = (Node) i.next();
- for (Iterator j = rns.iterator(); j.hasNext(); )
- {
- Node rtest = (Node) j.next();
- if (ltest == rtest || ltest.equals(rtest))
- {
- // much shorter
- if (!invert)
- {
- return true;
- }
- }
- else if (stringValue(ltest).equals(stringValue(rtest)))
- {
- if (!invert)
- {
- return true;
- }
- }
- else
- {
- all = false;
- }
- }
- }
- return false;
- }
- /*
- * If one object to be compared is a node-set and the other is a number,
- * then the comparison will be true if and only if there is a node in
- * the node-set such that the result of performing the comparison on the
- * number to be compared and on the result of converting the
- * string-value of that node to a number using the number function is
- * true.
- */
- boolean fln = left instanceof Double;
- boolean frn = right instanceof Double;
- if ((flns && frn) || (frns && fln))
- {
- Collection ns = flns ? (Collection) left : (Collection) right;
- double n = fln ? ((Double) left).doubleValue() :
- ((Double) right).doubleValue();
- boolean all = true;
- for (Iterator i = ns.iterator(); i.hasNext(); )
- {
- Node test = (Node) i.next();
- double nn = _number(context, stringValue(test));
- if (nn == n)
- {
- if (!invert)
- {
- return true;
- }
- }
- else
- {
- all = false;
- }
- }
- return invert ? all : false;
- }
- /*
- * If one object to be compared is a node-set and the other is a
- * string, then the comparison will be true if and only if there is a
- * node in the node-set such that the result of performing the
- * comparison on the string-value of the node and the other string is
- * true.
- */
- boolean fls = left instanceof String;
- boolean frs = right instanceof String;
- if ((flns && frs) || (frns && fls))
- {
- Collection ns = flns ? (Collection) left : (Collection) right;
- String s = fls ? (String) left : (String) right;
- boolean all = true;
- for (Iterator i = ns.iterator(); i.hasNext(); )
- {
- Node test = (Node) i.next();
- if (stringValue(test).equals(s))
- {
- if (!invert)
- {
- return true;
- }
- }
- else
- {
- all = false;
- }
- }
- return invert ? all : false;
- }
- /*
- * If one object to be compared is a node-set and the other is a
- * boolean, then the comparison will be true if and only if the result
- * of performing the comparison on the boolean and on the result of
- * converting the node-set to a boolean using the boolean function is
- * true.
- */
- boolean flb = left instanceof Boolean;
- boolean frb = right instanceof Boolean;
- if ((flns && frb) || (frns && flb))
- {
- Collection ns = flns ? (Collection) left : (Collection) right;
- boolean b = flb ? ((Boolean) left).booleanValue() :
- ((Boolean) right).booleanValue();
- return _boolean(context, ns) == b;
- }
- /*
- * If at least one object to be compared is a boolean, then each object
- * to be compared is converted to a boolean as if by applying the
- * boolean function.
- */
- if (flb || frb)
- {
- boolean lb = flb ? ((Boolean) left).booleanValue() :
- _boolean(context, left);
- boolean rb = frb ? ((Boolean) right).booleanValue() :
- _boolean(context, right);
- return lb == rb;
- }
- /*
- * Otherwise, if at least one object to be compared is
- * a number, then each object to be compared is converted to a number as
- * if by applying the number function.
- */
- if (fln || frn)
- {
- double ln = fln ? ((Double) left).doubleValue() :
- _number(context, left);
- double rn = frn ? ((Double) right).doubleValue() :
- _number(context, right);
- return ln == rn;
- }
- /*
- * Otherwise, both objects to be
- * compared are converted to strings as if by applying the string
- * function.
- */
- String ls = fls ? (String) left : _string(context, left);
- String rs = frs ? (String) right : _string(context, right);
- return ls.equals(rs);
- }
-
- public Expr clone(Object context)
- {
- return new EqualityExpr(lhs.clone(context), rhs.clone(context), invert);
- }
-
- public String toString()
- {
- if (invert)
- {
- return lhs + " != " + rhs;
- }
- else
- {
- return lhs + " = " + rhs;
- }
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/Expr.java b/libjava/gnu/xml/xpath/Expr.java
deleted file mode 100644
index 5957828522e..00000000000
--- a/libjava/gnu/xml/xpath/Expr.java
+++ /dev/null
@@ -1,474 +0,0 @@
-/* Expr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.io.IOException;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Set;
-import java.util.StringTokenizer;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * An XPath expression.
- * This can be evaluated in the context of a node to produce a result.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public abstract class Expr
- implements XPathExpression
-{
-
- protected static final Comparator documentOrderComparator =
- new DocumentOrderComparator();
-
- protected static final DecimalFormat decimalFormat =
- new DecimalFormat("####################################################" +
- ".####################################################",
- new DecimalFormatSymbols(Locale.US));
-
- public Object evaluate(Object item, QName returnType)
- throws XPathExpressionException
- {
- Object ret = null;
- Node context = null;
- if (item instanceof Node)
- {
- context = (Node) item;
- ret = evaluate(context, 1, 1);
- if (XPathConstants.STRING == returnType &&
- !(ret instanceof String))
- {
- ret = _string(context, ret);
- }
- else if (XPathConstants.NUMBER == returnType &&
- !(ret instanceof Double))
- {
- ret = new Double(_number(context, ret));
- }
- else if (XPathConstants.BOOLEAN == returnType &&
- !(ret instanceof Boolean))
- {
- ret = _boolean(context, ret) ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (XPathConstants.NODE == returnType)
- {
- if (ret instanceof Collection)
- {
- Collection ns = (Collection) ret;
- switch (ns.size())
- {
- case 0:
- ret = null;
- break;
- case 1:
- ret = (Node) ns.iterator().next();
- break;
- default:
- throw new XPathExpressionException("multiple nodes in node-set");
- }
- }
- else if (ret != null)
- {
- throw new XPathExpressionException("return value is not a node-set");
- }
- }
- else if (XPathConstants.NODESET == returnType)
- {
- if (ret != null && !(ret instanceof Collection))
- {
- throw new XPathExpressionException("return value is not a node-set");
- }
- }
- }
- return ret;
- }
-
- public String evaluate(Object item)
- throws XPathExpressionException
- {
- return (String) evaluate(item, XPathConstants.STRING);
- }
-
- public Object evaluate(InputSource source, QName returnType)
- throws XPathExpressionException
- {
- try
- {
- DocumentBuilderFactory factory =
- new gnu.xml.dom.JAXPFactory();
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.parse(source);
- return evaluate(doc, returnType);
- }
- catch (ParserConfigurationException e)
- {
- throw new XPathExpressionException(e);
- }
- catch (SAXException e)
- {
- throw new XPathExpressionException(e);
- }
- catch (IOException e)
- {
- throw new XPathExpressionException(e);
- }
- }
-
- public String evaluate(InputSource source)
- throws XPathExpressionException
- {
- return (String) evaluate(source, XPathConstants.STRING);
- }
-
- public abstract Object evaluate(Node context, int pos, int len);
-
- public abstract Expr clone(Object context);
-
- /* -- 4.1 Node Set Functions -- */
-
- /**
- * The id function selects elements by their unique ID.
- * When the argument to id is of type node-set, then the result is
- * the union of the result of applying id to the string-value of each of
- * the nodes in the argument node-set. When the argument to id is of any
- * other type, the argument is converted to a string as if by a call to
- * the string function; the string is split into a whitespace-separated
- * list of tokens (whitespace is any sequence of characters matching the
- * production S); the result is a node-set containing the elements in the
- * same document as the context node that have a unique ID equal to any of
- * the tokens in the list.
- */
- public static Collection _id(Node context, Object object)
- {
- Set ret = new HashSet();
- if (object instanceof Collection)
- {
- Collection nodeSet = (Collection) object;
- for (Iterator i = nodeSet.iterator(); i.hasNext(); )
- {
- String string = stringValue((Node) i.next());
- ret.addAll(_id (context, string));
- }
- }
- else
- {
- Document doc = (context instanceof Document) ? (Document) context :
- context.getOwnerDocument();
- String string = _string(context, object);
- StringTokenizer st = new StringTokenizer(string, " \t\r\n");
- while (st.hasMoreTokens())
- {
- Node element = doc.getElementById(st.nextToken());
- if (element != null)
- {
- ret.add(element);
- }
- }
- }
- return ret;
- }
-
- /**
- * The local-name function returns the local part of the expanded-name of
- * the node in the argument node-set that is first in document order. If
- * the argument node-set is empty or the first node has no expanded-name,
- * an empty string is returned. If the argument is omitted, it defaults to
- * a node-set with the context node as its only member.
- */
- public static String _local_name(Node context, Collection nodeSet)
- {
- Node node = (nodeSet == null || nodeSet.size() == 0) ? context :
- firstNode(nodeSet);
- return node.getLocalName();
- }
-
- /**
- * The namespace-uri function returns the namespace URI of the
- * expanded-name of the node in the argument node-set that is first in
- * document order. If the argument node-set is empty, the first node has
- * no expanded-name, or the namespace URI of the expanded-name is null, an
- * empty string is returned. If the argument is omitted, it defaults to a
- * node-set with the context node as its only member.
- */
- public static String _namespace_uri(Node context, Collection nodeSet)
- {
- Node node = (nodeSet == null || nodeSet.size() == 0) ? context :
- firstNode(nodeSet);
- return node.getNamespaceURI();
- }
-
- /**
- * The name function returns a string containing a QName representing the
- * expanded-name of the node in the argument node-set that is first in
- * document order. The QName must represent the expanded-name with respect
- * to the namespace declarations in effect on the node whose expanded-name
- * is being represented. Typically, this will be the QName that occurred
- * in the XML source. This need not be the case if there are namespace
- * declarations in effect on the node that associate multiple prefixes
- * with the same namespace. However, an implementation may include
- * information about the original prefix in its representation of nodes;
- * in this case, an implementation can ensure that the returned string is
- * always the same as the QName used in the XML source. If the argument
- * node-set is empty or the first node has no expanded-name, an empty
- * string is returned. If the argument it omitted, it defaults to a
- * node-set with the context node as its only member.
- */
- public static String _name(Node context, Collection nodeSet)
- {
- Node node = (nodeSet == null || nodeSet.size() == 0) ? context :
- firstNode(nodeSet);
- switch (node.getNodeType())
- {
- case Node.ATTRIBUTE_NODE:
- case Node.ELEMENT_NODE:
- case Node.PROCESSING_INSTRUCTION_NODE:
- return node.getNodeName();
- default:
- return "";
- }
- }
-
- /**
- * Returns the first node in the set in document order.
- */
- static Node firstNode(Collection nodeSet)
- {
- List list = new ArrayList(nodeSet);
- Collections.sort(list, documentOrderComparator);
- return (Node) list.get(0);
- }
-
- /* -- 4.2 String Functions -- */
-
- /**
- * Implementation of the XPath <code>string</code> function.
- */
- public static String _string(Node context, Object object)
- {
- if (object == null)
- {
- return stringValue(context);
- }
- if (object instanceof String)
- {
- return (String) object;
- }
- if (object instanceof Boolean)
- {
- return object.toString();
- }
- if (object instanceof Double)
- {
- double d = ((Double) object).doubleValue();
- if (Double.isNaN(d))
- {
- return "NaN";
- }
- else if (d == 0.0d)
- {
- return "0";
- }
- else if (Double.isInfinite(d))
- {
- if (d < 0)
- {
- return "-Infinity";
- }
- else
- {
- return "Infinity";
- }
- }
- else
- {
- String ret = decimalFormat.format(d);
- if (ret.endsWith (".0"))
- {
- ret = ret.substring(0, ret.length() - 2);
- }
- return ret;
- }
- }
- if (object instanceof Collection)
- {
- Collection nodeSet = (Collection) object;
- if (nodeSet.isEmpty())
- {
- return "";
- }
- Node node = firstNode(nodeSet);
- return stringValue(node);
- }
- throw new IllegalArgumentException(object.toString());
- }
-
- /* -- 4.3 Boolean Functions -- */
-
- /**
- * Implementation of the XPath <code>boolean</code> function.
- */
- public static boolean _boolean(Node context, Object object)
- {
- if (object instanceof Boolean)
- {
- return ((Boolean) object).booleanValue();
- }
- if (object instanceof Double)
- {
- return ((Double) object).doubleValue() != 0.0;
- }
- if (object instanceof String)
- {
- return ((String) object).length() != 0;
- }
- if (object instanceof Collection)
- {
- return ((Collection) object).size() != 0;
- }
- return false; // TODO user defined types
- }
-
- /* -- 4.4 Number Functions -- */
-
- /**
- * Implementation of the XPath <code>number</code> function.
- */
- public static double _number(Node context, Object object)
- {
- if (object == null)
- {
- object = Collections.singleton(context);
- }
- if (object instanceof Double)
- {
- return ((Double) object).doubleValue();
- }
- if (object instanceof Boolean)
- {
- return ((Boolean) object).booleanValue() ? 1.0 : 0.0;
- }
- if (object instanceof Collection)
- {
- // Convert node-set to string
- object = stringValue((Collection) object);
- }
- if (object instanceof String)
- {
- String string = ((String) object).trim();
- try
- {
- return Double.parseDouble(string);
- }
- catch (NumberFormatException e)
- {
- return Double.NaN;
- }
- }
- return Double.NaN; // TODO user-defined types
- }
-
- /**
- * Computes the XPath string-value of the specified node-set.
- */
- public static String stringValue(Collection nodeSet)
- {
- StringBuffer buf = new StringBuffer();
- for (Iterator i = nodeSet.iterator(); i.hasNext(); )
- {
- buf.append(stringValue((Node) i.next()));
- }
- return buf.toString();
- }
-
- /**
- * Computes the XPath string-value of the specified node.
- */
- public static String stringValue(Node node)
- {
- return stringValue(node, false);
- }
-
- static String stringValue(Node node, boolean elementMode)
- {
- switch (node.getNodeType())
- {
- case Node.DOCUMENT_NODE: // 5.1 Root Node
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.ELEMENT_NODE: // 5.2 Element Nodes
- StringBuffer buf = new StringBuffer();
- for (Node ctx = node.getFirstChild(); ctx != null;
- ctx = ctx.getNextSibling())
- {
- buf.append(stringValue(ctx, true));
- }
- return buf.toString();
- case Node.TEXT_NODE: // 5.7 Text Nodes
- case Node.CDATA_SECTION_NODE:
- return node.getNodeValue();
- case Node.ATTRIBUTE_NODE: // 5.3 Attribute Nodes
- case Node.PROCESSING_INSTRUCTION_NODE: // 5.5 Processing Instruction
- case Node.COMMENT_NODE: // 5.6 Comment Nodes
- if (!elementMode)
- {
- return node.getNodeValue();
- }
- default:
- return "";
- }
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/FalseFunction.java b/libjava/gnu/xml/xpath/FalseFunction.java
deleted file mode 100644
index ca07b7870e8..00000000000
--- a/libjava/gnu/xml/xpath/FalseFunction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* FalseFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * The <code>false</code> function returns false.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class FalseFunction
- extends Expr
-{
-
- public Object evaluate(Node context, int pos, int len)
- {
- return Boolean.FALSE;
- }
-
- public Expr clone(Object context)
- {
- return new FalseFunction();
- }
-
- public String toString()
- {
- return "false()";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/FloorFunction.java b/libjava/gnu/xml/xpath/FloorFunction.java
deleted file mode 100644
index c8608cdc1f5..00000000000
--- a/libjava/gnu/xml/xpath/FloorFunction.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* FloorFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>floor</code> function returns the largest (closest to positive
- * infinity) number that is not greater than the argument and that is an
- * integer.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class FloorFunction
- extends Expr
-{
-
- final Expr arg;
-
- FloorFunction(List args)
- {
- this((Expr) args.get(0));
- }
-
- FloorFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = arg.evaluate(context, pos, len);
- double n = _number(context, val);
- return new Double(Math.floor(n));
- }
-
- public Expr clone(Object context)
- {
- return new FloorFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return "floor(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/Function.java b/libjava/gnu/xml/xpath/Function.java
deleted file mode 100644
index aecd49d9c73..00000000000
--- a/libjava/gnu/xml/xpath/Function.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Function.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-
-/**
- * Interface to be implemented by external functions that need to receive
- * parameter values.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public interface Function
-{
-
- /**
- * Sets the list of expressions to evaluate as parameter values.
- */
- void setArguments(List args);
-
-}
-
diff --git a/libjava/gnu/xml/xpath/FunctionCall.java b/libjava/gnu/xml/xpath/FunctionCall.java
deleted file mode 100644
index 97763e09764..00000000000
--- a/libjava/gnu/xml/xpath/FunctionCall.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/* FunctionCall.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import javax.xml.xpath.XPathFunctionResolver;
-import org.w3c.dom.Node;
-
-/**
- * Executes an XPath core or extension function.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class FunctionCall
- extends Expr
-{
-
- final XPathFunctionResolver resolver;
- final String name;
- final List args;
-
- public FunctionCall(XPathFunctionResolver resolver, String name)
- {
- this(resolver, name, Collections.EMPTY_LIST);
- }
-
- public FunctionCall(XPathFunctionResolver resolver, String name, List args)
- {
- this.resolver = resolver;
- this.name = name;
- this.args = args;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- if (resolver != null)
- {
- QName qname = QName.valueOf(name);
- int arity = args.size();
- XPathFunction function = resolver.resolveFunction(qname, arity);
- if (function != null)
- {
- //System.err.println("Calling "+toString()+" with "+values);
- if (function instanceof Expr)
- {
- if (function instanceof Function)
- {
- ((Function) function).setArguments(args);
- }
- return ((Expr) function).evaluate(context, pos, len);
- }
- else
- {
- List values = new ArrayList(arity);
- for (int i = 0; i < arity; i++)
- {
- Expr arg = (Expr) args.get(i);
- values.add(arg.evaluate(context, pos, len));
- }
- try
- {
- return function.evaluate(values);
- }
- catch (XPathFunctionException e)
- {
- e.printStackTrace(System.err); // FIXME
- throw new RuntimeException(e.getMessage(), e);
- }
- }
- }
- }
- throw new IllegalArgumentException("Invalid function call: " +
- toString());
- }
-
- public Expr clone(Object context)
- {
- int len = args.size();
- List args2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- args2.add(((Expr) args.get(i)).clone(context));
- }
- XPathFunctionResolver r = resolver;
- if (context instanceof XPathFunctionResolver)
- {
- r = (XPathFunctionResolver) context;
- }
- return new FunctionCall(r, name, args2);
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer();
- buf.append(name);
- buf.append('(');
- int len = args.size();
- for (int i = 0; i < len; i++)
- {
- if (i > 0)
- {
- buf.append(',');
- }
- buf.append(args.get(i));
- }
- buf.append(')');
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/IdFunction.java b/libjava/gnu/xml/xpath/IdFunction.java
deleted file mode 100644
index 164e141a7c4..00000000000
--- a/libjava/gnu/xml/xpath/IdFunction.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* IdFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Collection;
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>id</code> function selects elements by their unique ID.
- * When the argument to id is of type node-set, then the result is
- * the union of the result of applying id to the string-value of each of the
- * nodes in the argument node-set. When the argument to id is of any other
- * type, the argument is converted to a string as if by a call to the string
- * function; the string is split into a whitespace-separated list of tokens
- * (whitespace is any sequence of characters matching the production S); the
- * result is a node-set containing the elements in the same document as the
- * context node that have a unique ID equal to any of the tokens in the
- * list.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class IdFunction
- extends Pattern
-{
-
- final Expr arg;
-
- IdFunction(List args)
- {
- this((Expr) args.get(0));
- }
-
- public IdFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public boolean matches(Node context)
- {
- Object ret = evaluate(context, 1, 1);
- return !((Collection) ret).isEmpty();
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = arg.evaluate(context, pos, len);
- return _id(context, val);
- }
-
- public Expr clone(Object context)
- {
- return new IdFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return "id(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/LangFunction.java b/libjava/gnu/xml/xpath/LangFunction.java
deleted file mode 100644
index fbf3af1f95c..00000000000
--- a/libjava/gnu/xml/xpath/LangFunction.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/* LangFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * The <code>lang</code> function returns true or false depending on whether
- * the language of the context node as specified by xml:lang attributes is
- * the same as or is a sublanguage of the language specified by the argument
- * string. The language of the context node is determined by the value of
- * the xml:lang attribute on the context node, or, if the context node has
- * no xml:lang attribute, by the value of the xml:lang attribute on the
- * nearest ancestor of the context node that has an xml:lang attribute. If
- * there is no such attribute, then lang returns false. If there is such an
- * attribute, then lang returns true if the attribute value is equal to the
- * argument ignoring case, or if there is some suffix starting with - such
- * that the attribute value is equal to the argument ignoring that suffix of
- * the attribute value and ignoring case.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class LangFunction
- extends Expr
-{
-
- final Expr arg;
-
- LangFunction(List args)
- {
- this((Expr) args.get(0));
- }
-
- LangFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = arg.evaluate(context, pos, len);
- String lang = _string(context, val);
- String clang = getLang(context);
- while (clang == null && context != null)
- {
- context = context.getParentNode();
- clang = getLang(context);
- }
- boolean ret = (clang == null) ? false :
- clang.toLowerCase().startsWith(lang.toLowerCase());
- return ret ? Boolean.TRUE : Boolean.FALSE;
- }
-
- String getLang(Node node)
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- return ((Element) node).getAttribute("xml:lang");
- }
- return null;
- }
-
- public Expr clone(Object context)
- {
- return new IdFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return "lang(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/LastFunction.java b/libjava/gnu/xml/xpath/LastFunction.java
deleted file mode 100644
index b24e0482d90..00000000000
--- a/libjava/gnu/xml/xpath/LastFunction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* LastFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * The <code>last</code> function returns a number equal to the context
- * size from the expression evaluation context.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class LastFunction
- extends Expr
-{
-
- public Object evaluate(Node context, int pos, int len)
- {
- return new Double((double) len);
- }
-
- public Expr clone(Object context)
- {
- return new LastFunction();
- }
-
- public String toString()
- {
- return "last()";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/LocalNameFunction.java b/libjava/gnu/xml/xpath/LocalNameFunction.java
deleted file mode 100644
index 342d9331a74..00000000000
--- a/libjava/gnu/xml/xpath/LocalNameFunction.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* LocalNameFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Collection;
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>local-name</code> function returns the local part of the
- * expanded-name of the node in the argument node-set that is first in
- * document order.
- * If the argument node-set is empty or the first node has no expanded-name,
- * an empty string is returned. If the argument is omitted, it defaults to a
- * node-set with the context node as its only member.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class LocalNameFunction
- extends Expr
-{
-
- final Expr arg;
-
- LocalNameFunction(List args)
- {
- this(args.size() > 0 ? (Expr) args.get(0) : null);
- }
-
- LocalNameFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = (arg == null) ? null : arg.evaluate(context, pos, len);
- return _local_name(context, (Collection) val);
- }
-
- public Expr clone(Object context)
- {
- return new LocalNameFunction((arg == null) ? null :
- arg.clone(context));
- }
-
- public String toString()
- {
- return (arg == null) ? "local-name()" : "local-name(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/NameFunction.java b/libjava/gnu/xml/xpath/NameFunction.java
deleted file mode 100644
index bd34325a097..00000000000
--- a/libjava/gnu/xml/xpath/NameFunction.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* NameFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Collection;
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>name</code> function returns a string containing a QName
- * representing the expanded-name of the node in the argument node-set that
- * is first in document order. The QName must represent the expanded-name
- * with respect to the namespace declarations in effect on the node whose
- * expanded-name is being represented. Typically, this will be the QName
- * that occurred in the XML source. This need not be the case if there are
- * namespace declarations in effect on the node that associate multiple
- * prefixes with the same namespace. However, an implementation may include
- * information about the original prefix in its representation of nodes; in
- * this case, an implementation can ensure that the returned string is
- * always the same as the QName used in the XML source. If the argument
- * node-set is empty or the first node has no expanded-name, an empty string
- * is returned. If the argument it omitted, it defaults to a node-set with
- * the context node as its only member.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class NameFunction
- extends Expr
-{
-
- final Expr arg;
-
- NameFunction(List args)
- {
- this(args.size() > 0 ? (Expr) args.get(0) : null);
- }
-
- NameFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = (arg == null) ? null : arg.evaluate(context, pos, len);
- return _name(context, (Collection) val);
- }
-
- public Expr clone(Object context)
- {
- return new NameFunction((arg == null) ? null :
- arg.clone(context));
- }
-
- public String toString()
- {
- return (arg == null) ? "name()" : "name(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/NameTest.java b/libjava/gnu/xml/xpath/NameTest.java
deleted file mode 100644
index d2e892beb2b..00000000000
--- a/libjava/gnu/xml/xpath/NameTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/* NameTest.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Node;
-
-/**
- * Tests whether a node has the specified name.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class NameTest
- extends Test
-{
-
- final QName qName;
- final boolean anyLocalName;
- final boolean any;
-
- public NameTest(QName qName, boolean anyLocalName, boolean any)
- {
- this.anyLocalName = anyLocalName;
- this.any = any;
- this.qName = qName;
- }
-
- public boolean matchesAny()
- {
- return any;
- }
-
- public boolean matchesAnyLocalName()
- {
- return anyLocalName;
- }
-
- public boolean matches(Node node, int pos, int len)
- {
- switch (node.getNodeType())
- {
- case Node.ATTRIBUTE_NODE:
- // Do not match namespace attributes
- String uri = node.getNamespaceURI();
- if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri) ||
- XMLConstants.XMLNS_ATTRIBUTE.equals(node.getPrefix()) ||
- XMLConstants.XMLNS_ATTRIBUTE.equals(node.getNodeName()))
- {
- return false;
- }
- // Fall through
- case Node.ELEMENT_NODE:
- break;
- default:
- return false;
- }
- if (any)
- {
- return true;
- }
- String uri = qName.getNamespaceURI();
- if (!equal(uri, node.getNamespaceURI()))
- {
- return false;
- }
- if (anyLocalName)
- {
- return true;
- }
- String localName = qName.getLocalPart();
- return (localName.equals(node.getLocalName()));
- }
-
- final boolean equal(String s1, String s2)
- {
- return (((s1 == null || s1.length() == 0) &&
- (s2 == null || s2.length() == 0)) ||
- s1 != null && s1.equals(s2));
- }
-
- public Test clone(Object context)
- {
- return new NameTest(qName, anyLocalName, any);
- }
-
- public String toString ()
- {
- if (any)
- {
- return "*";
- }
- return qName.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/NamespaceTest.java b/libjava/gnu/xml/xpath/NamespaceTest.java
deleted file mode 100644
index 8240bf8deaf..00000000000
--- a/libjava/gnu/xml/xpath/NamespaceTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/* NamespaceTest.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Node;
-
-/**
- * Tests whether a namespace attribute has the specified name.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class NamespaceTest
- extends Test
-{
-
- final QName qName;
- final boolean anyLocalName;
- final boolean any;
-
- public NamespaceTest(QName qName, boolean anyLocalName, boolean any)
- {
- this.anyLocalName = anyLocalName;
- this.any = any;
- this.qName = qName;
- }
-
- public boolean matchesAny()
- {
- return any;
- }
-
- public boolean matchesAnyLocalName()
- {
- return anyLocalName;
- }
-
- public boolean matches(Node node, int pos, int len)
- {
- switch (node.getNodeType())
- {
- case Node.ATTRIBUTE_NODE:
- // Only match namespace attributes
- String uri = node.getNamespaceURI();
- if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri) ||
- XMLConstants.XMLNS_ATTRIBUTE.equals(node.getPrefix()) ||
- XMLConstants.XMLNS_ATTRIBUTE.equals(node.getNodeName()))
- {
- break;
- }
- // Fall through
- default:
- // Only process namespace attributes
- return false;
- }
- if (any)
- {
- return true;
- }
- if (anyLocalName)
- {
- return true;
- }
- String localName = qName.getLocalPart();
- return (localName.equals(node.getLocalName()));
- }
-
- public Test clone(Object context)
- {
- return new NamespaceTest(qName, anyLocalName, any);
- }
-
- public String toString ()
- {
- if (any)
- {
- return "*";
- }
- return qName.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/NamespaceUriFunction.java b/libjava/gnu/xml/xpath/NamespaceUriFunction.java
deleted file mode 100644
index 9a42e775488..00000000000
--- a/libjava/gnu/xml/xpath/NamespaceUriFunction.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* NamespaceUriFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Collection;
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>namespace-uri</code> function returns the namespace URI of the
- * expanded-name of the node in the argument node-set that is first in
- * document order. If the argument node-set is empty, the first node has no
- * expanded-name, or the namespace URI of the expanded-name is null, an
- * empty string is returned. If the argument is omitted, it defaults to a
- * node-set with the context node as its only member.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class NamespaceUriFunction
- extends Expr
-{
-
- final Expr arg;
-
- NamespaceUriFunction(List args)
- {
- this(args.size() > 0 ? (Expr) args.get(0) : null);
- }
-
- NamespaceUriFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = (arg == null) ? null : arg.evaluate(context, pos, len);
- return _namespace_uri(context, (Collection) val);
- }
-
- public Expr clone(Object context)
- {
- return new NamespaceUriFunction((arg == null) ? null :
- arg.clone(context));
- }
-
- public String toString()
- {
- return (arg == null) ? "namespace-uri()" : "namespace-uri(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/NegativeExpr.java b/libjava/gnu/xml/xpath/NegativeExpr.java
deleted file mode 100644
index bb84eebf05e..00000000000
--- a/libjava/gnu/xml/xpath/NegativeExpr.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* NegativeExpr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * Unary negative.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class NegativeExpr
- extends Expr
-{
-
- final Expr expr;
-
- NegativeExpr(Expr expr)
- {
- this.expr = expr;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = expr.evaluate(context, pos, len);
- double n = _number(context, val);
- return new Double(-n);
- }
-
- public Expr clone(Object context)
- {
- return new NegativeExpr(expr.clone(context));
- }
-
- public String toString()
- {
- return "-" + expr;
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/NodeTypeTest.java b/libjava/gnu/xml/xpath/NodeTypeTest.java
deleted file mode 100644
index 521104cdb75..00000000000
--- a/libjava/gnu/xml/xpath/NodeTypeTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* NodeTypeTest.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * Tests whether a node is of a given type.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class NodeTypeTest
- extends Test
-{
-
- final short type;
- final String data;
-
- public NodeTypeTest(short type)
- {
- this(type, null);
- }
-
- public NodeTypeTest(short type, String data)
- {
- this.type = type;
- this.data = data;
- }
-
- public short getNodeType()
- {
- return type;
- }
-
- public String getData()
- {
- return data;
- }
-
- public boolean matches(Node node, int pos, int len)
- {
- short nodeType = node.getNodeType();
- switch (nodeType)
- {
- case Node.ELEMENT_NODE:
- case Node.ATTRIBUTE_NODE:
- case Node.TEXT_NODE:
- case Node.CDATA_SECTION_NODE:
- case Node.COMMENT_NODE:
- case Node.PROCESSING_INSTRUCTION_NODE:
- if (type > 0)
- {
- if (nodeType != type)
- {
- return false;
- }
- if (data != null && !data.equals(node.getNodeValue()))
- {
- return false;
- }
- }
- return true;
- default:
- // Not part of XPath data model
- return false;
- }
- }
-
- public Test clone(Object context)
- {
- return new NodeTypeTest(type, data);
- }
-
- public String toString()
- {
- switch (type)
- {
- case 0:
- return "node()";
- case Node.TEXT_NODE:
- return "text()";
- case Node.COMMENT_NODE:
- return "comment()";
- case Node.PROCESSING_INSTRUCTION_NODE:
- if (data != null)
- {
- return "processing-instruction('" + data + "')";
- }
- return "processing-instruction()";
- default:
- throw new IllegalStateException();
- }
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/NormalizeSpaceFunction.java b/libjava/gnu/xml/xpath/NormalizeSpaceFunction.java
deleted file mode 100644
index a61e118f2e5..00000000000
--- a/libjava/gnu/xml/xpath/NormalizeSpaceFunction.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* NormalizeSpaceFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import java.util.StringTokenizer;
-import org.w3c.dom.Node;
-
-/**
- * The <code>normalize-space</code> function returns the argument string
- * with whitespace normalized by stripping leading and trailing whitespace
- * and replacing sequences of whitespace characters by a single space.
- * Whitespace characters are the same as those allowed by the S production
- * in XML. If the argument is omitted, it defaults to the context node
- * converted to a string, in other words the string-value of the context
- * node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class NormalizeSpaceFunction
- extends Expr
-{
-
- final Expr arg;
-
- NormalizeSpaceFunction(List args)
- {
- this((Expr) args.get(0));
- }
-
- NormalizeSpaceFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = (arg == null) ? null : arg.evaluate(context, pos, len);
- String s = _string(context, val);
- StringTokenizer st = new StringTokenizer(s, " \t\r\n");
- StringBuffer buf = new StringBuffer();
- if (st.hasMoreTokens())
- {
- buf.append(st.nextToken());
- while (st.hasMoreTokens())
- {
- buf.append(' ');
- buf.append(st.nextToken());
- }
- }
- return buf.toString();
- }
-
- public Expr clone(Object context)
- {
- return new NormalizeSpaceFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return (arg == null) ? "normalize-space()" : "normalize-space(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/NotFunction.java b/libjava/gnu/xml/xpath/NotFunction.java
deleted file mode 100644
index dcb7ad4fb68..00000000000
--- a/libjava/gnu/xml/xpath/NotFunction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* NotFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>not</code> function returns true if its argument is false,
- * and false otherwise.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class NotFunction
- extends Expr
-{
-
- final Expr arg;
-
- NotFunction(List args)
- {
- this((Expr) args.get(0));
- }
-
- NotFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = arg.evaluate(context, pos, len);
- return _boolean(context, val) ? Boolean.FALSE : Boolean.TRUE;
- }
-
- public Expr clone(Object context)
- {
- return new NotFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return "not(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/NumberFunction.java b/libjava/gnu/xml/xpath/NumberFunction.java
deleted file mode 100644
index a27eb7a46cf..00000000000
--- a/libjava/gnu/xml/xpath/NumberFunction.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* NumberFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>number</code> function converts its argument to a number as
- * follows:
- * <ul>
- * <li>a string that consists of optional whitespace followed by an optional
- * minus sign followed by a Number followed by whitespace is converted to
- * the IEEE 754 number that is nearest (according to the IEEE 754
- * round-to-nearest rule) to the mathematical value represented by the
- * string; any other string is converted to NaN</li>
- * <li>boolean true is converted to 1; boolean false is converted to 0</li>
- * <li>a node-set is first converted to a string as if by a call to the
- * string function and then converted in the same way as a string
- * argument</li>
- * <li>an object of a type other than the four basic types is converted to a
- * number in a way that is dependent on that type</li>
- * </ul>
- * If the argument is omitted, it defaults to a node-set with the context
- * node as its only member.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class NumberFunction
- extends Expr
-{
-
- final Expr arg;
-
- NumberFunction(List args)
- {
- this(args.size() > 0 ? (Expr) args.get(0) : null);
- }
-
- NumberFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = (arg == null) ? null : arg.evaluate(context, pos, len);
- return new Double(_number(context, val));
- }
-
- public Expr clone(Object context)
- {
- return new NumberFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return "number(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/OrExpr.java b/libjava/gnu/xml/xpath/OrExpr.java
deleted file mode 100644
index ca3fd227718..00000000000
--- a/libjava/gnu/xml/xpath/OrExpr.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* OrExpr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * Logical or.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class OrExpr
- extends Expr
-{
-
- final Expr lhs;
- final Expr rhs;
-
- public OrExpr(Expr lhs, Expr rhs)
- {
- this.lhs = lhs;
- this.rhs = rhs;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object left = lhs.evaluate(context, pos, len);
- if (_boolean(context, left))
- {
- return Boolean.TRUE;
- }
- Object right = rhs.evaluate(context, pos, len);
- return _boolean(context, right) ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public Expr clone(Object context)
- {
- return new OrExpr(lhs.clone(context), rhs.clone(context));
- }
-
- public String toString()
- {
- return lhs + " or " + rhs;
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/ParenthesizedExpr.java b/libjava/gnu/xml/xpath/ParenthesizedExpr.java
deleted file mode 100644
index 6a8bb12fa32..00000000000
--- a/libjava/gnu/xml/xpath/ParenthesizedExpr.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ParenthesizedExpr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * Simple subexpression.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class ParenthesizedExpr
- extends Expr
-{
-
- final Expr expr;
-
- ParenthesizedExpr(Expr expr)
- {
- this.expr = expr;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object ret = expr.evaluate(context, pos, len);
- if (ret instanceof Collection)
- {
- List list = new ArrayList((Collection) ret);
- Collections.sort(list, documentOrderComparator);
- ret = list;
- }
- return ret;
- }
-
- public Expr clone(Object context)
- {
- return new ParenthesizedExpr(expr.clone(context));
- }
-
- public String toString()
- {
- return "(" + expr + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/Path.java b/libjava/gnu/xml/xpath/Path.java
deleted file mode 100644
index 4b01f0918ab..00000000000
--- a/libjava/gnu/xml/xpath/Path.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Path.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Collection;
-import org.w3c.dom.Node;
-
-/**
- * An XPath path component expression.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-abstract class Path
- extends Pattern
-{
-
- abstract Collection evaluate(Node context, Collection nodeSet);
-
-}
diff --git a/libjava/gnu/xml/xpath/Pattern.java b/libjava/gnu/xml/xpath/Pattern.java
deleted file mode 100644
index d992c6d4e63..00000000000
--- a/libjava/gnu/xml/xpath/Pattern.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Pattern.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * Interface implemented by expressions that can for part of XSL patterns.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public abstract class Pattern
- extends Expr
-{
-
- public abstract boolean matches(Node context);
-
-}
-
diff --git a/libjava/gnu/xml/xpath/PositionFunction.java b/libjava/gnu/xml/xpath/PositionFunction.java
deleted file mode 100644
index 790b0e005cf..00000000000
--- a/libjava/gnu/xml/xpath/PositionFunction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* PositionFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * The <code>position</code> function returns a number equal to the context
- * position from the expression evaluation context.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class PositionFunction
- extends Expr
-{
-
- public Object evaluate(Node context, int pos, int len)
- {
- return new Double((double) pos);
- }
-
- public Expr clone(Object context)
- {
- return new PositionFunction();
- }
-
- public String toString()
- {
- return "position()";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/Predicate.java b/libjava/gnu/xml/xpath/Predicate.java
deleted file mode 100644
index d495440fdbb..00000000000
--- a/libjava/gnu/xml/xpath/Predicate.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Predicate.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * Tests whether an expression matches against a given context node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-class Predicate
- extends Test
-{
-
- final Expr expr;
-
- Predicate(Expr expr)
- {
- this.expr = expr;
- }
-
- public boolean matches(Node node, int pos, int len)
- {
- Object ret = expr.evaluate(node, pos, len);
- if (ret instanceof Double)
- {
- // Same as [position() = x]
- return ((Double) ret).intValue() == pos;
- }
- return Expr._boolean(node, expr.evaluate(node, pos, len));
- }
-
- public Test clone(Object context)
- {
- return new Predicate(expr.clone(context));
- }
-
- public String toString()
- {
- return "[" + expr + "]";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/RelationalExpr.java b/libjava/gnu/xml/xpath/RelationalExpr.java
deleted file mode 100644
index 622d2290106..00000000000
--- a/libjava/gnu/xml/xpath/RelationalExpr.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* RelationalExpr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * Numerical comparison expression.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class RelationalExpr
- extends Expr
-{
-
- final Expr lhs;
- final Expr rhs;
- final boolean lt;
- final boolean eq;
-
- RelationalExpr(Expr lhs, Expr rhs, boolean lt, boolean eq)
- {
- this.lhs = lhs;
- this.rhs = rhs;
- this.lt = lt;
- this.eq = eq;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object left = lhs.evaluate(context, pos, len);
- Object right = rhs.evaluate(context, pos, len);
- double ln = _number(context, left);
- double rn = _number(context, right);
- if (eq && ln == rn)
- {
- return Boolean.TRUE;
- }
- if (lt)
- {
- if (ln < rn || Double.isInfinite(rn))
- {
- return Boolean.TRUE;
- }
- }
- else
- {
- if (ln > rn || Double.isInfinite(ln))
- {
- return Boolean.TRUE;
- }
- }
- return Boolean.FALSE;
- }
-
- public Expr clone(Object context)
- {
- return new RelationalExpr(lhs.clone(context), rhs.clone(context), lt, eq);
- }
-
- public String toString()
- {
- return lhs + " " + (lt ? "<" : ">") + (eq ? "=" : "") + " " + rhs;
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/Root.java b/libjava/gnu/xml/xpath/Root.java
deleted file mode 100644
index cf8f8d17e54..00000000000
--- a/libjava/gnu/xml/xpath/Root.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Root.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Collection;
-import java.util.Collections;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Expression that evaluates to the document root.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class Root
- extends Path
-{
-
- public boolean matches(Node node)
- {
- return (node.getNodeType() == Node.DOCUMENT_NODE);
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- return evaluate(context, Collections.EMPTY_SET);
- }
-
- Collection evaluate(Node context, Collection ns)
- {
- Document doc = (context instanceof Document) ? (Document) context :
- context.getOwnerDocument();
- return Collections.singleton(doc);
- }
-
- public Expr clone(Object context)
- {
- return new Root();
- }
-
- public String toString()
- {
- return "/";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/RoundFunction.java b/libjava/gnu/xml/xpath/RoundFunction.java
deleted file mode 100644
index 7f9ff2a96a3..00000000000
--- a/libjava/gnu/xml/xpath/RoundFunction.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* RoundFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>round</code> function returns the number that is closest to the
- * argument and that is an integer. If there are two such numbers, then the
- * one that is closest to positive infinity is returned. If the argument is
- * NaN, then NaN is returned. If the argument is positive infinity, then
- * positive infinity is returned. If the argument is negative infinity, then
- * negative infinity is returned. If the argument is positive zero, then
- * positive zero is returned. If the argument is negative zero, then
- * negative zero is returned. If the argument is less than zero, but greater
- * than or equal to -0.5, then negative zero is returned.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class RoundFunction
- extends Expr
-{
-
- final Expr arg;
-
- RoundFunction(List args)
- {
- this((Expr) args.get(0));
- }
-
- RoundFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = arg.evaluate(context, pos, len);
- double n = _number(context, val);
- return (Double.isNaN(n) || Double.isInfinite(n)) ?
- new Double(n) : new Double(Math.round(n));
- }
-
- public Expr clone(Object context)
- {
- return new RoundFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return "round(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/Selector.java b/libjava/gnu/xml/xpath/Selector.java
deleted file mode 100644
index 383893d9280..00000000000
--- a/libjava/gnu/xml/xpath/Selector.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/* Selector.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import javax.xml.XMLConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * A single component of a location path.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class Selector
- extends Path
-{
-
- public static final int ANCESTOR = 0;
- public static final int ANCESTOR_OR_SELF = 1;
- public static final int ATTRIBUTE = 2;
- public static final int CHILD = 3;
- public static final int DESCENDANT = 4;
- public static final int DESCENDANT_OR_SELF = 5;
- public static final int FOLLOWING = 6;
- public static final int FOLLOWING_SIBLING = 7;
- public static final int NAMESPACE = 8;
- public static final int PARENT = 9;
- public static final int PRECEDING = 10;
- public static final int PRECEDING_SIBLING = 11;
- public static final int SELF = 12;
-
- /**
- * Axis to select nodes in.
- */
- final int axis;
-
- /**
- * List of tests to perform on candidates.
- */
- final Test[] tests;
-
- public Selector(int axis, List tests)
- {
- this.axis = axis;
- this.tests = new Test[tests.size()];
- tests.toArray(this.tests);
- if (axis == NAMESPACE &&
- this.tests.length > 0 &&
- this.tests[0] instanceof NameTest)
- {
- NameTest nt = (NameTest) this.tests[0];
- this.tests[0] = new NamespaceTest(nt.qName, nt.anyLocalName, nt.any);
- }
- }
-
- /**
- * Returns the list of tests to perform on candidates.
- */
- public Test[] getTests()
- {
- return tests;
- }
-
- public boolean matches(Node context)
- {
- short nodeType = context.getNodeType();
- switch (axis)
- {
- case CHILD:
- if (nodeType == Node.ATTRIBUTE_NODE)
- {
- return false;
- }
- break;
- case ATTRIBUTE:
- case NAMESPACE:
- if (nodeType != Node.ATTRIBUTE_NODE)
- {
- return false;
- }
- break;
- case DESCENDANT_OR_SELF:
- return true;
- default:
- return false;
- }
- int tlen = tests.length;
- if (tlen > 0)
- {
- int pos = getContextPosition(context);
- int len = getContextSize(context);
- for (int j = 0; j < tlen && len > 0; j++)
- {
- Test test = tests[j];
- if (!test.matches(context, pos, len))
- {
- return false;
- }
- }
- }
- return true;
- }
-
- private int getContextPosition(Node ctx)
- {
- int pos = 1;
- for (ctx = ctx.getPreviousSibling(); ctx != null;
- ctx = ctx.getPreviousSibling())
- {
- pos++;
- }
- return pos;
- }
-
- private int getContextSize(Node ctx)
- {
- if (ctx.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- Node parent = ((Attr) ctx).getOwnerElement();
- return parent.getAttributes().getLength();
- }
- Node parent = ctx.getParentNode();
- if (parent != null)
- {
- return parent.getChildNodes().getLength();
- }
- return 1;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Set acc = new LinkedHashSet();
- addCandidates(context, acc);
- List candidates = new ArrayList(acc);
- //Collections.sort(candidates, documentOrderComparator);
- List ret = filterCandidates(candidates, false);
- return ret;
- }
-
- Collection evaluate(Node context, Collection ns)
- {
- Set acc = new LinkedHashSet();
- for (Iterator i = ns.iterator(); i.hasNext(); )
- {
- addCandidates((Node) i.next(), acc);
- }
- List candidates = new ArrayList(acc);
- //Collections.sort(candidates, documentOrderComparator);
- List ret = filterCandidates(candidates, true);
- return ret;
- }
-
- /**
- * Filter the given list of candidates according to the node tests.
- */
- List filterCandidates(List candidates, boolean cascade)
- {
- int len = candidates.size();
- int tlen = tests.length;
- if (tlen > 0 && len > 0)
- {
- // Present the result of each successful generation to the next test
- for (int j = 0; j < tlen && len > 0; j++)
- {
- Test test = tests[j];
- List successful = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- Node node = (Node) candidates.get(i);
- if (cascade)
- {
- // Documents and DocumentFragments should be considered
- // if part of a location path where the axis involves
- // the SELF concept
- short nodeType = node.getNodeType();
- if ((nodeType == Node.DOCUMENT_NODE ||
- nodeType == Node.DOCUMENT_FRAGMENT_NODE) &&
- (axis == DESCENDANT_OR_SELF ||
- axis == ANCESTOR_OR_SELF ||
- axis == SELF) &&
- (tests.length == 1 &&
- tests[0] instanceof NodeTypeTest &&
- ((NodeTypeTest) tests[0]).type == (short) 0))
- {
- successful.add(node);
- continue;
- }
- }
- if (test.matches(node, i + 1, len))
- {
- successful.add(node);
- }
- /*
- System.err.println("Testing "+node);
- int p = getContextPosition(node);
- int l = getContextSize(node);
- if (test.matches(node, p, l))
- {
- successful.add(node);
- }*/
- }
- candidates = successful;
- len = candidates.size();
- }
- }
- return candidates;
- }
-
- void addCandidates(Node context, Collection candidates)
- {
- // Build list of candidates
- switch (axis)
- {
- case CHILD:
- addChildNodes(context, candidates, false);
- break;
- case DESCENDANT:
- addChildNodes(context, candidates, true);
- break;
- case DESCENDANT_OR_SELF:
- candidates.add (context);
- addChildNodes(context, candidates, true);
- break;
- case PARENT:
- addParentNode(context, candidates, false);
- break;
- case ANCESTOR:
- addParentNode(context, candidates, true);
- break;
- case ANCESTOR_OR_SELF:
- candidates.add(context);
- addParentNode(context, candidates, true);
- break;
- case FOLLOWING_SIBLING:
- addFollowingNodes(context, candidates, false);
- break;
- case PRECEDING_SIBLING:
- addPrecedingNodes(context, candidates, false);
- break;
- case FOLLOWING:
- addFollowingNodes(context, candidates, true);
- break;
- case PRECEDING:
- addPrecedingNodes(context, candidates, true);
- break;
- case ATTRIBUTE:
- addAttributes(context, candidates);
- break;
- case NAMESPACE:
- addNamespaceAttributes(context, candidates);
- break;
- case SELF:
- candidates.add(context);
- break;
- }
- }
-
- void addChildNodes(Node context, Collection acc, boolean recurse)
- {
- Node child = context.getFirstChild();
- while (child != null)
- {
- acc.add(child);
- if (recurse)
- {
- addChildNodes(child, acc, recurse);
- }
- child = child.getNextSibling();
- }
- }
-
- void addParentNode(Node context, Collection acc, boolean recurse)
- {
- Node parent = (context.getNodeType() == Node.ATTRIBUTE_NODE) ?
- ((Attr) context).getOwnerElement() : context.getParentNode();
- if (parent != null)
- {
- acc.add(parent);
- if (recurse)
- {
- addParentNode(parent, acc, recurse);
- }
- }
- }
-
- void addFollowingNodes(Node context, Collection acc, boolean recurse)
- {
- Node cur = context.getNextSibling();
- while (cur != null)
- {
- acc.add(cur);
- if (recurse)
- {
- addChildNodes(cur, acc, true);
- }
- cur = cur.getNextSibling();
- }
- if (recurse)
- {
- context = (context.getNodeType() == Node.ATTRIBUTE_NODE) ?
- ((Attr) context).getOwnerElement() : context.getParentNode();
- if (context != null)
- {
- addFollowingNodes(context, acc, recurse);
- }
- }
- }
-
- void addPrecedingNodes(Node context, Collection acc, boolean recurse)
- {
- Node cur = context.getPreviousSibling();
- while (cur != null)
- {
- acc.add(cur);
- if (recurse)
- {
- addChildNodes(cur, acc, true);
- }
- cur = cur.getPreviousSibling();
- }
- if (recurse)
- {
- context = (context.getNodeType() == Node.ATTRIBUTE_NODE) ?
- ((Attr) context).getOwnerElement() : context.getParentNode();
- if (context != null)
- {
- addPrecedingNodes(context, acc, recurse);
- }
- }
- }
-
- void addAttributes(Node context, Collection acc)
- {
- NamedNodeMap attrs = context.getAttributes();
- if (attrs != null)
- {
- int attrLen = attrs.getLength();
- for (int i = 0; i < attrLen; i++)
- {
- Node attr = attrs.item(i);
- if (!isNamespaceAttribute(attr))
- {
- acc.add(attr);
- }
- }
- }
- }
-
- void addNamespaceAttributes(Node context, Collection acc)
- {
- NamedNodeMap attrs = context.getAttributes();
- if (attrs != null)
- {
- int attrLen = attrs.getLength();
- for (int i = 0; i < attrLen; i++)
- {
- Node attr = attrs.item(i);
- if (isNamespaceAttribute(attr))
- {
- acc.add(attr);
- }
- }
- }
- }
-
- final boolean isNamespaceAttribute(Node node)
- {
- String uri = node.getNamespaceURI();
- return (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri) ||
- XMLConstants.XMLNS_ATTRIBUTE.equals(node.getPrefix()) ||
- XMLConstants.XMLNS_ATTRIBUTE.equals(node.getNodeName()));
- }
-
- public Expr clone(Object context)
- {
- int len = tests.length;
- List tests2 = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- tests2.add(tests[i].clone(context));
- }
- return new Selector(axis, tests2);
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer();
- switch (axis)
- {
- case ANCESTOR:
- buf.append("ancestor::");
- break;
- case ANCESTOR_OR_SELF:
- buf.append("ancestor-or-self::");
- break;
- case ATTRIBUTE:
- buf.append("attribute::");
- break;
- case CHILD:
- //buf.append("child::");
- break;
- case DESCENDANT:
- buf.append("descendant::");
- break;
- case DESCENDANT_OR_SELF:
- buf.append("descendant-or-self::");
- break;
- case FOLLOWING:
- buf.append("following::");
- break;
- case FOLLOWING_SIBLING:
- buf.append("following-sibling::");
- break;
- case NAMESPACE:
- buf.append("namespace::");
- break;
- case PARENT:
- if (tests.length == 0 ||
- (tests[0] instanceof NodeTypeTest &&
- ((NodeTypeTest) tests[0]).type == 0))
- {
- return "..";
- }
- buf.append("parent::");
- break;
- case PRECEDING:
- buf.append("preceding::");
- break;
- case PRECEDING_SIBLING:
- buf.append("preceding-sibling::");
- break;
- case SELF:
- if (tests.length == 0 ||
- (tests[0] instanceof NodeTypeTest &&
- ((NodeTypeTest) tests[0]).type == 0))
- {
- return ".";
- }
- buf.append("self::");
- break;
- }
- if (tests.length == 0)
- {
- buf.append('*');
- }
- else
- {
- for (int i = 0; i < tests.length; i++)
- {
- buf.append(tests[i]);
- }
- }
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/StartsWithFunction.java b/libjava/gnu/xml/xpath/StartsWithFunction.java
deleted file mode 100644
index 2cee8555fbf..00000000000
--- a/libjava/gnu/xml/xpath/StartsWithFunction.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* StartsWithFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>starts-with</code> function returns true if the first argument
- * string starts with the second argument string, and otherwise returns false.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class StartsWithFunction
- extends Expr
-{
-
- final Expr arg1;
- final Expr arg2;
-
- StartsWithFunction(List args)
- {
- this((Expr) args.get(0), (Expr) args.get(1));
- }
-
- StartsWithFunction(Expr arg1, Expr arg2)
- {
- this.arg1 = arg1;
- this.arg2 = arg2;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val1 = arg1.evaluate(context, pos, len);
- Object val2 = arg2.evaluate(context, pos, len);
- String s1 = _string(context, val1);
- String s2 = _string(context, val2);
- return s1.startsWith(s2) ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public Expr clone(Object context)
- {
- return new StartsWithFunction(arg1.clone(context), arg2.clone(context));
- }
-
- public String toString()
- {
- return "starts-with(" + arg1 + "," + arg2 + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/Steps.java b/libjava/gnu/xml/xpath/Steps.java
deleted file mode 100644
index e8cbc4e619b..00000000000
--- a/libjava/gnu/xml/xpath/Steps.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/* Steps.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.Set;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- * A list of transitions between components in a location path.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class Steps
- extends Path
-{
-
- final LinkedList path;
-
- public Steps()
- {
- this(new LinkedList());
- }
-
- Steps(LinkedList path)
- {
- this.path = path;
- }
-
- public boolean matches(Node context)
- {
- // Right to left
- return matches(context, path.size() - 1);
- }
-
- boolean matches(Node context, int pos)
- {
- Pattern right = (Pattern) path.get(pos);
- if (!right.matches(context))
- {
- return false;
- }
- if (pos > 0)
- {
- Pattern left = (Pattern) path.get(pos - 1);
- Iterator j = possibleContexts(right, context).iterator();
- while (j.hasNext())
- {
- Node candidate = (Node) j.next();
- if (left.matches(candidate) &&
- matches(candidate, pos - 1))
- {
- return true;
- }
- // keep going, there may be another candidate
- }
- return false;
- }
- return true;
- }
-
- /**
- * Essentially the reverse of Selector.addCandidates.
- * The idea is to determine possible context nodes for a match.
- */
- Collection possibleContexts(Pattern pattern, Node context)
- {
- if (pattern instanceof Selector)
- {
- Selector s = (Selector) pattern;
- Collection candidates = new LinkedHashSet();
- switch (s.axis)
- {
- case Selector.PARENT:
- s.addChildNodes(context, candidates, false);
- break;
- case Selector.ANCESTOR:
- s.addChildNodes(context, candidates, true);
- break;
- case Selector.ANCESTOR_OR_SELF:
- candidates.add (context);
- s.addChildNodes(context, candidates, true);
- break;
- case Selector.CHILD:
- s.addParentNode(context, candidates, false);
- break;
- case Selector.DESCENDANT:
- s.addParentNode(context, candidates, true);
- break;
- case Selector.DESCENDANT_OR_SELF:
- candidates.add(context);
- s.addParentNode(context, candidates, true);
- break;
- case Selector.PRECEDING_SIBLING:
- s.addFollowingNodes(context, candidates, false);
- break;
- case Selector.FOLLOWING_SIBLING:
- s.addPrecedingNodes(context, candidates, false);
- break;
- case Selector.PRECEDING:
- s.addFollowingNodes(context, candidates, true);
- break;
- case Selector.FOLLOWING:
- s.addPrecedingNodes(context, candidates, true);
- break;
- case Selector.ATTRIBUTE:
- case Selector.NAMESPACE:
- if (context.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- candidates.add(((Attr) context).getOwnerElement());
- }
- break;
- case Selector.SELF:
- candidates.add(context);
- break;
- }
- return candidates;
- }
- return Collections.EMPTY_SET;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- //System.err.println(toString()+" evaluate");
- // Left to right
- Iterator i = path.iterator();
- Expr lhs = (Expr) i.next();
- Object val = lhs.evaluate(context, pos, len);
- //System.err.println("\tevaluate "+lhs+" = "+val);
- while (val instanceof Collection && i.hasNext())
- {
- Path rhs = (Path) i.next();
- val = rhs.evaluate(context, (Collection) val);
- //System.err.println("\tevaluate "+rhs+" = "+val);
- }
- return val;
- }
-
- Collection evaluate(Node context, Collection ns)
- {
- // Left to right
- Iterator i = path.iterator();
- Expr lhs = (Expr) i.next();
- if (lhs instanceof Path)
- {
- ns = ((Path) lhs).evaluate(context, ns);
- }
- else
- {
- Set acc = new LinkedHashSet();
- int pos = 1, len = ns.size();
- for (Iterator j = ns.iterator(); j.hasNext(); )
- {
- Node node = (Node) j.next();
- Object ret = lhs.evaluate(node, pos++, len);
- if (ret instanceof Collection)
- {
- acc.addAll((Collection) ret);
- }
- }
- ns = acc;
- }
- while (i.hasNext())
- {
- Path rhs = (Path) i.next();
- ns = rhs.evaluate(context, ns);
- }
- return ns;
- }
-
- public Expr clone(Object context)
- {
- int len = path.size();
- LinkedList path2 = new LinkedList();
- for (int i = 0; i < len; i++)
- {
- path2.add(((Expr) path.get(i)).clone(context));
- }
- return new Steps(path2);
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer();
- Iterator i = path.iterator();
- Expr expr = (Expr) i.next();
- if (!(expr instanceof Root))
- {
- buf.append(expr);
- }
- while (i.hasNext())
- {
- expr = (Expr) i.next();
- buf.append('/');
- buf.append(expr);
- }
- return buf.toString();
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/StringFunction.java b/libjava/gnu/xml/xpath/StringFunction.java
deleted file mode 100644
index fac15050aaf..00000000000
--- a/libjava/gnu/xml/xpath/StringFunction.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* StringFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>string function converts an object to a string as follows:
- * <ul>
- * <li>A node-set is converted to a string by returning the string-value of
- * the node in the node-set that is first in document order. If the node-set
- * is empty, an empty string is returned.</li>
- * <li>A number is converted to a string as follows
- * <ul>
- * <li>NaN is converted to the string NaN</li>
- * <li>positive zero is converted to the string 0</li>
- * <li>negative zero is converted to the string 0</li>
- * <li>positive infinity is converted to the string Infinity</li>
- * <li>negative infinity is converted to the string -Infinity</li>
- * <li>if the number is an integer, the number is represented in decimal
- * form as a Number with no decimal point and no leading zeros, preceded by
- * a minus sign (-) if the number is negative</li>
- * <li>otherwise, the number is represented in decimal form as a Number
- * including a decimal point with at least one digit before the decimal
- * point and at least one digit after the decimal point, preceded by a minus
- * sign (-) if the number is negative; there must be no leading zeros before
- * the decimal point apart possibly from the one required digit immediately
- * before the decimal point; beyond the one required digit after the decimal
- * point there must be as many, but only as many, more digits as are needed
- * to uniquely distinguish the number from all other IEEE 754 numeric
- * values.</li>
- * </ul>
- * </li>
- * <li>The boolean false value is converted to the string false. The boolean
- * true value is converted to the string true.</li>
- * <li>An object of a type other than the four basic types is converted to a
- * string in a way that is dependent on that type.</li>
- * </ul>
- * If the argument is omitted, it defaults to a node-set with the context
- * node as its only member.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class StringFunction
- extends Expr
-{
-
- final Expr arg;
-
- StringFunction(List args)
- {
- this(args.size() > 0 ? (Expr) args.get(0) : null);
- }
-
- StringFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = (arg == null) ? null : arg.evaluate(context, pos, len);
- return _string(context, val);
- }
-
- public Expr clone(Object context)
- {
- return new StringFunction((arg == null) ? null :
- arg.clone(context));
- }
-
- public String toString()
- {
- return (arg == null) ? "string()" : "string(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/StringLengthFunction.java b/libjava/gnu/xml/xpath/StringLengthFunction.java
deleted file mode 100644
index 4545c895fec..00000000000
--- a/libjava/gnu/xml/xpath/StringLengthFunction.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* StringLengthFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>string-length</code> function returns the number of characters
- * in the string.
- * If the argument is omitted, it defaults to the context node converted to
- * a string, in other words the string-value of the context node.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class StringLengthFunction
- extends Expr
-{
-
- final Expr arg;
-
- StringLengthFunction(List args)
- {
- this(args.isEmpty() ? null : (Expr) args.get(0));
- }
-
- StringLengthFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = (arg == null) ? null : arg.evaluate(context, pos, len);
- String s = _string(context, val);
- return new Double((double) s.length());
- }
-
- public Expr clone(Object context)
- {
- return new StringLengthFunction((arg == null) ? null :
- arg.clone(context));
- }
-
- public String toString()
- {
- return (arg == null) ? "string-length()" : "string-length(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/SubstringAfterFunction.java b/libjava/gnu/xml/xpath/SubstringAfterFunction.java
deleted file mode 100644
index dcdff31f165..00000000000
--- a/libjava/gnu/xml/xpath/SubstringAfterFunction.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* SubstringAfterFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>substring-after</code> function returns the substring of the
- * first argument string that follows the first occurrence of the second
- * argument string in the first argument string, or the empty string if the
- * first argument string does not contain the second argument string. For
- * example, substring-after("1999/04/01","/") returns 04/01, and
- * substring-after("1999/04/01","19") returns 99/04/01.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class SubstringAfterFunction
- extends Expr
-{
-
- final Expr arg1;
- final Expr arg2;
-
- SubstringAfterFunction(List args)
- {
- this((Expr) args.get(0), (Expr) args.get(1));
- }
-
- SubstringAfterFunction(Expr arg1, Expr arg2)
- {
- this.arg1 = arg1;
- this.arg2 = arg2;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val1 = arg1.evaluate(context, pos, len);
- Object val2 = arg2.evaluate(context, pos, len);
- String s1 = _string(context, val1);
- String s2 = _string(context, val2);
- int index = s1.indexOf(s2);
- return (index == -1) ? "" : s1.substring(index + s2.length());
- }
-
- public Expr clone(Object context)
- {
- return new SubstringAfterFunction(arg1.clone(context),
- arg2.clone(context));
- }
-
- public String toString()
- {
- return "substring-after(" + arg1 + "," + arg2 + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/SubstringBeforeFunction.java b/libjava/gnu/xml/xpath/SubstringBeforeFunction.java
deleted file mode 100644
index 4322bcd691b..00000000000
--- a/libjava/gnu/xml/xpath/SubstringBeforeFunction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/* SubstringBeforeFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>substring-before</code> function returns the substring of the
- * first argument string that precedes the first occurrence of the second
- * argument string in the first argument string, or the empty string if the
- * first argument string does not contain the second argument string. For
- * example, substring-before("1999/04/01","/") returns 1999.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class SubstringBeforeFunction
- extends Expr
-{
-
- final Expr arg1;
- final Expr arg2;
-
- SubstringBeforeFunction(List args)
- {
- this((Expr) args.get(0), (Expr) args.get(1));
- }
-
- SubstringBeforeFunction(Expr arg1, Expr arg2)
- {
- this.arg1 = arg1;
- this.arg2 = arg2;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val1 = arg1.evaluate(context, pos, len);
- Object val2 = arg2.evaluate(context, pos, len);
- String s1 = _string(context, val1);
- String s2 = _string(context, val2);
- int index = s1.indexOf(s2);
- return (index == -1) ? "" : s1.substring(0, index);
- }
-
- public Expr clone(Object context)
- {
- return new SubstringBeforeFunction(arg1.clone(context),
- arg2.clone(context));
- }
-
- public String toString()
- {
- return "substring-before(" + arg1 + "," + arg2 + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/SubstringFunction.java b/libjava/gnu/xml/xpath/SubstringFunction.java
deleted file mode 100644
index a554045cff0..00000000000
--- a/libjava/gnu/xml/xpath/SubstringFunction.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/* SubstringFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The substring function returns the substring of the first argument
- * starting at the position specified in the second argument with length
- * specified in the third argument. For example, substring("12345",2,3)
- * returns "234". If the third argument is not specified, it returns the
- * substring starting at the position specified in the second argument and
- * continuing to the end of the string. For example, substring("12345",2)
- * returns "2345".
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class SubstringFunction
- extends Expr
-{
-
- final Expr arg1;
- final Expr arg2;
- final Expr arg3;
-
- SubstringFunction(List args)
- {
- this((Expr) args.get(0), (Expr) args.get(1),
- (args.size() > 2) ? (Expr) args.get(2) : null);
- }
-
- SubstringFunction(Expr arg1, Expr arg2, Expr arg3)
- {
- this.arg1 = arg1;
- this.arg2 = arg2;
- this.arg3 = arg3;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val1 = arg1.evaluate(context, pos, len);
- Object val2 = arg2.evaluate(context, pos, len);
- String s = _string(context, val1);
- int p = (val2 instanceof Double) ?
- ((Double) val2).intValue() :
- (int) Math.round(_number(context, val2));
- p--;
- if (p < 0)
- {
- p = 0;
- }
-
- int l = s.length() - p;
- if (l <= 0)
- {
- return "";
- }
-
- if (arg3 != null)
- {
- Object val3 = arg3.evaluate(context, pos, len);
- int v3 = (val3 instanceof Double) ?
- ((Double) val3).intValue() :
- (int) Math.round(_number(context, val3));
- if (v3 < l)
- {
- l = v3;
- }
- }
-
- return s.substring(p, p + l);
- }
-
- public Expr clone(Object context)
- {
- return new SubstringFunction(arg1.clone(context), arg2.clone(context),
- (arg3 == null) ? null : arg3.clone(context));
- }
-
- public String toString()
- {
- return (arg3 == null) ? "substring(" + arg1 + "," + arg2 + ")" :
- "substring(" + arg1 + "," + arg2 + "," + arg3 + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/SumFunction.java b/libjava/gnu/xml/xpath/SumFunction.java
deleted file mode 100644
index 61452f80947..00000000000
--- a/libjava/gnu/xml/xpath/SumFunction.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* SumFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>sum</code> function returns the sum, for each node in the
- * argument node-set, of the result of converting the string-values of the
- * node to a number.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class SumFunction
- extends Expr
-{
-
- final Expr arg;
-
- SumFunction(List args)
- {
- this((Expr) args.get(0));
- }
-
- SumFunction(Expr arg)
- {
- this.arg = arg;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val = arg.evaluate(context, pos, len);
- double sum = 0.0d;
- if (val instanceof Collection)
- {
- for (Iterator i = ((Collection) val).iterator(); i.hasNext(); )
- {
- Node node = (Node) i.next();
- String s = stringValue(node);
- sum += _number(context, s);
- }
- }
- return new Double(sum);
- }
-
- public Expr clone(Object context)
- {
- return new SumFunction(arg.clone(context));
- }
-
- public String toString()
- {
- return "sum(" + arg + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/Test.java b/libjava/gnu/xml/xpath/Test.java
deleted file mode 100644
index 1ea4bc473a4..00000000000
--- a/libjava/gnu/xml/xpath/Test.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Test.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * A test that can be performed on a node to determine whether to include it
- * in a selection.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public abstract class Test
-{
-
- public abstract boolean matches(Node node, int pos, int len);
-
- public abstract Test clone(Object context);
-
-}
diff --git a/libjava/gnu/xml/xpath/TranslateFunction.java b/libjava/gnu/xml/xpath/TranslateFunction.java
deleted file mode 100644
index b62180734ce..00000000000
--- a/libjava/gnu/xml/xpath/TranslateFunction.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* TranslateFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.List;
-import org.w3c.dom.Node;
-
-/**
- * The <code>translate</code> function returns the first argument string
- * with occurrences of characters in the second argument string replaced by
- * the character at the corresponding position in the third argument string.
- * For example, translate("bar","abc","ABC") returns the string BAr. If
- * there is a character in the second argument string with no character at a
- * corresponding position in the third argument string (because the second
- * argument string is longer than the third argument string), then
- * occurrences of that character in the first argument string are removed.
- * For example, translate("--aaa--","abc-","ABC") returns "AAA". If a
- * character occurs more than once in the second argument string, then the
- * first occurrence determines the replacement character. If the third
- * argument string is longer than the second argument string, then excess
- * characters are ignored.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class TranslateFunction
- extends Expr
-{
-
- final Expr arg1;
- final Expr arg2;
- final Expr arg3;
-
- TranslateFunction(List args)
- {
- this((Expr) args.get(0), (Expr) args.get(1), (Expr) args.get(2));
- }
-
- TranslateFunction(Expr arg1, Expr arg2, Expr arg3)
- {
- this.arg1 = arg1;
- this.arg2 = arg2;
- this.arg3 = arg3;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object val1 = arg1.evaluate(context, pos, len);
- Object val2 = arg2.evaluate(context, pos, len);
- Object val3 = arg3.evaluate(context, pos, len);
- String string = _string(context, val1);
- String search = _string(context, val2);
- String replace = _string(context, val3);
- StringBuffer buf = new StringBuffer();
- int l1 = string.length();
- int l2 = search.length();
- int l3 = replace.length();
- for (int i = 0; i < l1; i++)
- {
- char c = string.charAt(i);
- boolean replaced = false;
- for (int j = 0; j < l2; j++)
- {
- if (c == search.charAt(j))
- {
- if (j < l3)
- {
- buf.append(replace.charAt(j));
- }
- replaced = true;
- }
- }
- if (!replaced)
- {
- buf.append(c);
- }
- }
- return new String(buf);
- }
-
- public Expr clone(Object context)
- {
- return new TranslateFunction(arg1.clone(context), arg2.clone(context),
- arg3.clone(context));
- }
-
- public String toString()
- {
- return "translate(" + arg1 + "," + arg2 + "," + arg3 + ")";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/TrueFunction.java b/libjava/gnu/xml/xpath/TrueFunction.java
deleted file mode 100644
index 3dd68bd5aa4..00000000000
--- a/libjava/gnu/xml/xpath/TrueFunction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* TrueFunction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import org.w3c.dom.Node;
-
-/**
- * The <code>true</code> function returns true.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-final class TrueFunction
- extends Expr
-{
-
- public Object evaluate(Node context, int pos, int len)
- {
- return Boolean.TRUE;
- }
-
- public Expr clone(Object context)
- {
- return new TrueFunction();
- }
-
- public String toString()
- {
- return "true()";
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/UnionExpr.java b/libjava/gnu/xml/xpath/UnionExpr.java
deleted file mode 100644
index 58c28a4d176..00000000000
--- a/libjava/gnu/xml/xpath/UnionExpr.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* UnionExpr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import org.w3c.dom.Node;
-
-/**
- * The union of two node-sets.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public final class UnionExpr
- extends Pattern
-{
-
- final Expr lhs;
- final Expr rhs;
-
- public UnionExpr(Expr lhs, Expr rhs)
- {
- this.lhs = lhs;
- this.rhs = rhs;
- }
-
- public boolean matches(Node context)
- {
- if (lhs instanceof Pattern && rhs instanceof Pattern)
- {
- return ((Pattern) lhs).matches(context) ||
- ((Pattern) rhs).matches(context);
- }
- return false;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- Object left = lhs.evaluate(context, pos, len);
- Object right = rhs.evaluate(context, pos, len);
- if (left instanceof Collection && right instanceof Collection)
- {
- Set set = new HashSet();
- set.addAll ((Collection) left);
- set.addAll ((Collection) right);
- List list = new ArrayList(set);
- Collections.sort(list, documentOrderComparator);
- return list;
- }
- return Collections.EMPTY_SET;
- }
-
- public Expr clone(Object context)
- {
- return new UnionExpr(lhs.clone(context), rhs.clone(context));
- }
-
- public String toString()
- {
- return lhs + " | " + rhs;
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/VariableReference.java b/libjava/gnu/xml/xpath/VariableReference.java
deleted file mode 100644
index e53d1faa858..00000000000
--- a/libjava/gnu/xml/xpath/VariableReference.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* VariableReference.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathVariableResolver;
-import org.w3c.dom.Node;
-import gnu.xml.transform.Bindings;
-
-public class VariableReference
- extends Expr
-{
-
- final XPathVariableResolver resolver;
- final String name;
-
- public VariableReference(XPathVariableResolver resolver, String name)
- {
- this.resolver = resolver;
- this.name = name;
- }
-
- public Object evaluate(Node context, int pos, int len)
- {
- if (resolver != null)
- {
- if (resolver instanceof Bindings)
- {
- // Needs context to operate properly
- return ((Bindings) resolver).get(name, context, pos, len);
- }
- QName qname = QName.valueOf(name);
- return resolver.resolveVariable(qname);
- }
- throw new IllegalStateException("no variable resolver");
- }
-
- public Expr clone(Object context)
- {
- XPathVariableResolver r = resolver;
- if (context instanceof XPathVariableResolver)
- {
- r = (XPathVariableResolver) context;
- }
- return new VariableReference(r, name);
- }
-
- public String toString()
- {
- return "$" + name;
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/XPathFactoryImpl.java b/libjava/gnu/xml/xpath/XPathFactoryImpl.java
deleted file mode 100644
index 45dc57ed14a..00000000000
--- a/libjava/gnu/xml/xpath/XPathFactoryImpl.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* XPathFactoryImpl.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathFactory;
-import javax.xml.xpath.XPathFactoryConfigurationException;
-import javax.xml.xpath.XPathFunctionResolver;
-import javax.xml.xpath.XPathVariableResolver;
-
-/**
- * GNU XPath factory implementation.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class XPathFactoryImpl
- extends XPathFactory
-{
-
- XPathVariableResolver variableResolver;
- XPathFunctionResolver functionResolver;
-
- public boolean isObjectModelSupported(String objectModel)
- {
- return XPathFactory.DEFAULT_OBJECT_MODEL_URI.equals(objectModel);
- }
-
- public void setFeature(String name, boolean value)
- throws XPathFactoryConfigurationException
- {
- throw new XPathFactoryConfigurationException(name);
- }
-
- public boolean getFeature(String name)
- throws XPathFactoryConfigurationException
- {
- throw new XPathFactoryConfigurationException(name);
- }
-
- public void setXPathVariableResolver(XPathVariableResolver resolver)
- {
- variableResolver = resolver;
- }
-
- public void setXPathFunctionResolver(XPathFunctionResolver resolver)
- {
- functionResolver = resolver;
- }
-
- public XPath newXPath()
- {
- return new XPathImpl(null, variableResolver, functionResolver);
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/XPathImpl.java b/libjava/gnu/xml/xpath/XPathImpl.java
deleted file mode 100644
index 3511834ca90..00000000000
--- a/libjava/gnu/xml/xpath/XPathImpl.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/* XPathImpl.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.io.IOException;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFunctionResolver;
-import javax.xml.xpath.XPathVariableResolver;
-import org.xml.sax.InputSource;
-
-/**
- * JAXP XPath implementation.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class XPathImpl
- implements XPath
-{
-
- XPathParser parser;
- NamespaceContext namespaceContext;
- XPathVariableResolver variableResolver;
- XPathFunctionResolver functionResolver;
-
- XPathImpl(NamespaceContext namespaceContext,
- XPathVariableResolver variableResolver,
- XPathFunctionResolver functionResolver)
- {
- parser = new XPathParser();
- this.namespaceContext = namespaceContext;
- this.variableResolver = variableResolver;
- this.functionResolver = functionResolver;
- reset();
- }
-
- public void reset()
- {
- parser.namespaceContext = namespaceContext;
- parser.variableResolver = variableResolver;
- parser.functionResolver = functionResolver;
- }
-
- public void setXPathVariableResolver(XPathVariableResolver resolver)
- {
- parser.variableResolver = resolver;
- }
-
- public XPathVariableResolver getXPathVariableResolver()
- {
- return parser.variableResolver;
- }
-
- public void setXPathFunctionResolver(XPathFunctionResolver resolver)
- {
- parser.functionResolver = resolver;
- }
-
- public XPathFunctionResolver getXPathFunctionResolver()
- {
- return parser.functionResolver;
- }
-
- public void setNamespaceContext(NamespaceContext nsContext)
- {
- parser.namespaceContext = nsContext;
- }
-
- public NamespaceContext getNamespaceContext()
- {
- return parser.namespaceContext;
- }
-
- public XPathExpression compile(String expression)
- throws XPathExpressionException
- {
- XPathTokenizer tokenizer = new XPathTokenizer(expression);
- try
- {
- return (Expr) parser.yyparse(tokenizer);
- }
- catch (IOException e)
- {
- throw new XPathExpressionException(e);
- }
- catch (XPathParser.yyException e)
- {
- throw new XPathExpressionException(expression);
- }
- }
-
- public Object evaluate(String expression,
- Object item,
- QName returnType)
- throws XPathExpressionException
- {
- XPathExpression expr = compile(expression);
- return expr.evaluate(item, returnType);
- }
-
- public String evaluate(String expression,
- Object item)
- throws XPathExpressionException
- {
- XPathExpression expr = compile(expression);
- return expr.evaluate(item);
- }
-
- public Object evaluate(String expression,
- InputSource source,
- QName returnType)
- throws XPathExpressionException
- {
- XPathExpression expr = compile(expression);
- return expr.evaluate(source, returnType);
- }
-
- public String evaluate(String expression,
- InputSource source)
- throws XPathExpressionException
- {
- XPathExpression expr = compile(expression);
- return expr.evaluate(source);
- }
-
-}
diff --git a/libjava/gnu/xml/xpath/XPathParser.java b/libjava/gnu/xml/xpath/XPathParser.java
deleted file mode 100644
index 01c744790dc..00000000000
--- a/libjava/gnu/xml/xpath/XPathParser.java
+++ /dev/null
@@ -1,1461 +0,0 @@
-// created by jay 0.8 (c) 1998 Axel.Schreiner@informatik.uni-osnabrueck.de
-
- // line 2 "XPathParser.y"
-/* XPathParser.java -- An XPath 1.0 parser.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathFunctionResolver;
-import javax.xml.xpath.XPathVariableResolver;
-import org.w3c.dom.Node;
-
-/**
- * An XPath 1.0 parser.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class XPathParser
-{
-
- NamespaceContext namespaceContext;
- XPathVariableResolver variableResolver;
- XPathFunctionResolver functionResolver;
-
- QName getQName(String name)
- {
- QName qName = QName.valueOf(name);
- if (namespaceContext != null)
- {
- String prefix = qName.getPrefix();
- String uri = qName.getNamespaceURI();
- if (prefix != null && (uri == null || uri.length() == 0))
- {
- uri = namespaceContext.getNamespaceURI(prefix);
- String localName = qName.getLocalPart();
- qName = new QName(uri, localName, prefix);
- }
- }
- return qName;
- }
-
- Expr lookupFunction(String name, List args)
- {
- int arity = args.size();
- if ("position".equals(name) && arity == 0)
- {
- return new PositionFunction();
- }
- else if ("last".equals(name) && arity == 0)
- {
- return new LastFunction();
- }
- else if ("string".equals(name) && (arity == 1 || arity == 0))
- {
- return new StringFunction(args);
- }
- else if ("number".equals(name) && (arity == 1 || arity == 0))
- {
- return new NumberFunction(args);
- }
- else if ("boolean".equals(name) && arity == 1)
- {
- return new BooleanFunction(args);
- }
- else if ("count".equals(name) && arity == 1)
- {
- return new CountFunction(args);
- }
- else if ("not".equals(name) && arity == 1)
- {
- return new NotFunction(args);
- }
- else if ("id".equals(name) && arity == 1)
- {
- return new IdFunction(args);
- }
- else if ("concat".equals(name) && arity > 1)
- {
- return new ConcatFunction(args);
- }
- else if ("true".equals(name) && arity == 0)
- {
- return new TrueFunction();
- }
- else if ("false".equals(name) && arity == 0)
- {
- return new FalseFunction();
- }
- else if ("name".equals(name) && (arity == 1 || arity == 0))
- {
- return new NameFunction(args);
- }
- else if ("local-name".equals(name) && (arity == 1 || arity == 0))
- {
- return new LocalNameFunction(args);
- }
- else if ("namespace-uri".equals(name) && (arity == 1 || arity == 0))
- {
- return new NamespaceUriFunction(args);
- }
- else if ("starts-with".equals(name) && arity == 2)
- {
- return new StartsWithFunction(args);
- }
- else if ("contains".equals(name) && arity == 2)
- {
- return new ContainsFunction(args);
- }
- else if ("string-length".equals(name) && (arity == 1 || arity == 0))
- {
- return new StringLengthFunction(args);
- }
- else if ("translate".equals(name) && arity == 3)
- {
- return new TranslateFunction(args);
- }
- else if ("normalize-space".equals(name) && (arity == 1 || arity == 0))
- {
- return new NormalizeSpaceFunction(args);
- }
- else if ("substring".equals(name) && (arity == 2 || arity == 3))
- {
- return new SubstringFunction(args);
- }
- else if ("substring-before".equals(name) && arity == 2)
- {
- return new SubstringBeforeFunction(args);
- }
- else if ("substring-after".equals(name) && arity == 2)
- {
- return new SubstringAfterFunction(args);
- }
- else if ("lang".equals(name) && arity == 1)
- {
- return new LangFunction(args);
- }
- else if ("sum".equals(name) && arity == 1)
- {
- return new SumFunction(args);
- }
- else if ("floor".equals(name) && arity == 1)
- {
- return new FloorFunction(args);
- }
- else if ("ceiling".equals(name) && arity == 1)
- {
- return new CeilingFunction(args);
- }
- else if ("round".equals(name) && arity == 1)
- {
- return new RoundFunction(args);
- }
- else if (functionResolver != null)
- {
- QName qName = QName.valueOf(name);
- Object function = functionResolver.resolveFunction(qName, arity);
- if (function != null &&
- function instanceof Function &&
- function instanceof Expr)
- {
- Function f = (Function) function;
- f.setArguments(args);
- return (Expr) function;
- }
- }
- return new FunctionCall(functionResolver, name, args);
- }
-
- // line 210 "-"
-// %token constants
-
- public static final int LITERAL = 257;
- public static final int DIGITS = 258;
- public static final int NAME = 259;
- public static final int LP = 260;
- public static final int RP = 261;
- public static final int LB = 262;
- public static final int RB = 263;
- public static final int COMMA = 264;
- public static final int PIPE = 265;
- public static final int SLASH = 266;
- public static final int DOUBLE_SLASH = 267;
- public static final int EQ = 268;
- public static final int NE = 269;
- public static final int GT = 270;
- public static final int LT = 271;
- public static final int GTE = 272;
- public static final int LTE = 273;
- public static final int PLUS = 274;
- public static final int MINUS = 275;
- public static final int AT = 276;
- public static final int STAR = 277;
- public static final int DOLLAR = 278;
- public static final int COLON = 279;
- public static final int DOUBLE_COLON = 280;
- public static final int DOT = 281;
- public static final int DOUBLE_DOT = 282;
- public static final int ANCESTOR = 283;
- public static final int ANCESTOR_OR_SELF = 284;
- public static final int ATTRIBUTE = 285;
- public static final int CHILD = 286;
- public static final int DESCENDANT = 287;
- public static final int DESCENDANT_OR_SELF = 288;
- public static final int FOLLOWING = 289;
- public static final int FOLLOWING_SIBLING = 290;
- public static final int NAMESPACE = 291;
- public static final int PARENT = 292;
- public static final int PRECEDING = 293;
- public static final int PRECEDING_SIBLING = 294;
- public static final int SELF = 295;
- public static final int DIV = 296;
- public static final int MOD = 297;
- public static final int OR = 298;
- public static final int AND = 299;
- public static final int COMMENT = 300;
- public static final int PROCESSING_INSTRUCTION = 301;
- public static final int TEXT = 302;
- public static final int NODE = 303;
- public static final int UNARY = 304;
- public static final int yyErrorCode = 256;
-
- /** thrown for irrecoverable syntax errors and stack overflow.
- */
- public static class yyException extends java.lang.Exception {
- public yyException (String message) {
- super(message);
- }
- }
-
- /** must be implemented by a scanner object to supply input to the parser.
- */
- public interface yyInput {
- /** move on to next token.
- @return false if positioned beyond tokens.
- @throws IOException on input error.
- */
- boolean advance () throws java.io.IOException;
- /** classifies current token.
- Should not be called if advance() returned false.
- @return current %token or single character.
- */
- int token ();
- /** associated with current token.
- Should not be called if advance() returned false.
- @return value for token().
- */
- Object value ();
- }
-
- /** simplified error message.
- @see <a href="#yyerror(java.lang.String, java.lang.String[])">yyerror</a>
- */
- public void yyerror (String message) {
- yyerror(message, null);
- }
-
- /** (syntax) error message.
- Can be overwritten to control message format.
- @param message text to be displayed.
- @param expected vector of acceptable tokens, if available.
- */
- public void yyerror (String message, String[] expected) {
- if (expected != null && expected.length > 0) {
- System.err.print(message+", expecting");
- for (int n = 0; n < expected.length; ++ n)
- System.err.print(" "+expected[n]);
- System.err.println();
- } else
- System.err.println(message);
- }
-
- /** debugging support, requires the package jay.yydebug.
- Set to null to suppress debugging messages.
- */
-//t protected jay.yydebug.yyDebug yydebug;
-
- protected static final int yyFinal = 30;
-
- /** index-checked interface to yyName[].
- @param token single character or %token value.
- @return token name or [illegal] or [unknown].
- */
-//t public static final String yyname (int token) {
-//t if (token < 0 || token > YyNameClass.yyName.length) return "[illegal]";
-//t String name;
-//t if ((name = YyNameClass.yyName[token]) != null) return name;
-//t return "[unknown]";
-//t }
-
- /** computes list of expected tokens on error by tracing the tables.
- @param state for which to compute the list.
- @return list of token names.
- */
- protected String[] yyExpecting (int state) {
- int token, n, len = 0;
- boolean[] ok = new boolean[YyNameClass.yyName.length];
-
- if ((n = YySindexClass.yySindex[state]) != 0)
- for (token = n < 0 ? -n : 0;
- token < YyNameClass.yyName.length && n+token < YyTableClass.yyTable.length; ++ token)
- if (YyCheckClass.yyCheck[n+token] == token && !ok[token] && YyNameClass.yyName[token] != null) {
- ++ len;
- ok[token] = true;
- }
- if ((n = YyRindexClass.yyRindex[state]) != 0)
- for (token = n < 0 ? -n : 0;
- token < YyNameClass.yyName.length && n+token < YyTableClass.yyTable.length; ++ token)
- if (YyCheckClass.yyCheck[n+token] == token && !ok[token] && YyNameClass.yyName[token] != null) {
- ++ len;
- ok[token] = true;
- }
-
- String result[] = new String[len];
- for (n = token = 0; n < len; ++ token)
- if (ok[token]) result[n++] = YyNameClass.yyName[token];
- return result;
- }
-
- /** the generated parser, with debugging messages.
- Maintains a state and a value stack, currently with fixed maximum size.
- @param yyLex scanner.
- @param yydebug debug message writer implementing yyDebug, or null.
- @return result of the last reduction, if any.
- @throws yyException on irrecoverable parse error.
- */
- public Object yyparse (yyInput yyLex, Object yydebug)
- throws java.io.IOException, yyException {
-//t this.yydebug = (jay.yydebug.yyDebug)yydebug;
- return yyparse(yyLex);
- }
-
- /** initial size and increment of the state/value stack [default 256].
- This is not final so that it can be overwritten outside of invocations
- of yyparse().
- */
- protected int yyMax;
-
- /** executed at the beginning of a reduce action.
- Used as $$ = yyDefault($1), prior to the user-specified action, if any.
- Can be overwritten to provide deep copy, etc.
- @param first value for $1, or null.
- @return first.
- */
- protected Object yyDefault (Object first) {
- return first;
- }
-
- /** the generated parser.
- Maintains a state and a value stack, currently with fixed maximum size.
- @param yyLex scanner.
- @return result of the last reduction, if any.
- @throws yyException on irrecoverable parse error.
- */
- public Object yyparse (yyInput yyLex)
- throws java.io.IOException, yyException {
- if (yyMax <= 0) yyMax = 256; // initial size
- int yyState = 0, yyStates[] = new int[yyMax]; // state stack
- Object yyVal = null, yyVals[] = new Object[yyMax]; // value stack
- int yyToken = -1; // current input
- int yyErrorFlag = 0; // #tks to shift
-
- yyLoop: for (int yyTop = 0;; ++ yyTop) {
- if (yyTop >= yyStates.length) { // dynamically increase
- int[] i = new int[yyStates.length+yyMax];
- System.arraycopy(yyStates, 0, i, 0, yyStates.length);
- yyStates = i;
- Object[] o = new Object[yyVals.length+yyMax];
- System.arraycopy(yyVals, 0, o, 0, yyVals.length);
- yyVals = o;
- }
- yyStates[yyTop] = yyState;
- yyVals[yyTop] = yyVal;
-//t if (yydebug != null) yydebug.push(yyState, yyVal);
-
- yyDiscarded: for (;;) { // discarding a token does not change stack
- int yyN;
- if ((yyN = YyDefRedClass.yyDefRed[yyState]) == 0) { // else [default] reduce (yyN)
- if (yyToken < 0) {
- yyToken = yyLex.advance() ? yyLex.token() : 0;
-//t if (yydebug != null)
-//t yydebug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
- }
- if ((yyN = YySindexClass.yySindex[yyState]) != 0 && (yyN += yyToken) >= 0
- && yyN < YyTableClass.yyTable.length && YyCheckClass.yyCheck[yyN] == yyToken) {
-//t if (yydebug != null)
-//t yydebug.shift(yyState, YyTableClass.yyTable[yyN], yyErrorFlag-1);
- yyState = YyTableClass.yyTable[yyN]; // shift to yyN
- yyVal = yyLex.value();
- yyToken = -1;
- if (yyErrorFlag > 0) -- yyErrorFlag;
- continue yyLoop;
- }
- if ((yyN = YyRindexClass.yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
- && yyN < YyTableClass.yyTable.length && YyCheckClass.yyCheck[yyN] == yyToken)
- yyN = YyTableClass.yyTable[yyN]; // reduce (yyN)
- else
- switch (yyErrorFlag) {
-
- case 0:
- yyerror("syntax error", yyExpecting(yyState));
-//t if (yydebug != null) yydebug.error("syntax error");
-
- case 1: case 2:
- yyErrorFlag = 3;
- do {
- if ((yyN = YySindexClass.yySindex[yyStates[yyTop]]) != 0
- && (yyN += yyErrorCode) >= 0 && yyN < YyTableClass.yyTable.length
- && YyCheckClass.yyCheck[yyN] == yyErrorCode) {
-//t if (yydebug != null)
-//t yydebug.shift(yyStates[yyTop], YyTableClass.yyTable[yyN], 3);
- yyState = YyTableClass.yyTable[yyN];
- yyVal = yyLex.value();
- continue yyLoop;
- }
-//t if (yydebug != null) yydebug.pop(yyStates[yyTop]);
- } while (-- yyTop >= 0);
-//t if (yydebug != null) yydebug.reject();
- throw new yyException("irrecoverable syntax error");
-
- case 3:
- if (yyToken == 0) {
-//t if (yydebug != null) yydebug.reject();
- throw new yyException("irrecoverable syntax error at end-of-file");
- }
-//t if (yydebug != null)
-//t yydebug.discard(yyState, yyToken, yyname(yyToken),
-//t yyLex.value());
- yyToken = -1;
- continue yyDiscarded; // leave stack alone
- }
- }
- int yyV = yyTop + 1-YyLenClass.yyLen[yyN];
-//t if (yydebug != null)
-//t yydebug.reduce(yyState, yyStates[yyV-1], yyN, YyRuleClass.yyRule[yyN], YyLenClass.yyLen[yyN]);
- yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
- switch (yyN) {
-case 4:
- // line 276 "XPathParser.y"
- {
- yyVal = new Root();
- }
- break;
-case 5:
- // line 280 "XPathParser.y"
- {
- Steps steps;
- if (yyVals[0+yyTop] instanceof Steps)
- {
- steps = (Steps) yyVals[0+yyTop];
- }
- else
- {
- steps = new Steps();
- steps.path.addFirst(yyVals[0+yyTop]);
- }
- steps.path.addFirst(new Root());
- yyVal = steps;
- /*$$ = new Step(new Root(), (Path) $2);*/
- }
- break;
-case 6:
- // line 296 "XPathParser.y"
- {
- Test nt = new NodeTypeTest((short) 0);
- Selector s = new Selector(Selector.DESCENDANT_OR_SELF,
- Collections.singletonList (nt));
- Steps steps;
- if (yyVals[0+yyTop] instanceof Steps)
- {
- steps = (Steps) yyVals[0+yyTop];
- }
- else
- {
- steps = new Steps();
- steps.path.addFirst(yyVals[0+yyTop]);
- }
- steps.path.addFirst(s);
- steps.path.addFirst(new Root());
- yyVal = steps;
- /*Step step = new Step(s, (Path) $2);*/
- /*$$ = new Step(new Root(), step);*/
- }
- break;
-case 8:
- // line 321 "XPathParser.y"
- {
- Steps steps;
- if (yyVals[-2+yyTop] instanceof Steps)
- {
- steps = (Steps) yyVals[-2+yyTop];
- }
- else
- {
- steps = new Steps();
- steps.path.addFirst(yyVals[-2+yyTop]);
- }
- steps.path.addLast(yyVals[0+yyTop]);
- yyVal = steps;
- /*$$ = new Step((Expr) $1, (Path) $3);*/
- }
- break;
-case 9:
- // line 337 "XPathParser.y"
- {
- Test nt = new NodeTypeTest((short) 0);
- Selector s = new Selector(Selector.DESCENDANT_OR_SELF,
- Collections.singletonList (nt));
- Steps steps;
- if (yyVals[-2+yyTop] instanceof Steps)
- {
- steps = (Steps) yyVals[-2+yyTop];
- }
- else
- {
- steps = new Steps();
- steps.path.addFirst(yyVals[-2+yyTop]);
- }
- steps.path.addLast(s);
- steps.path.addLast(yyVals[0+yyTop]);
- yyVal = steps;
- /*Step step = new Step(s, (Path) $3);*/
- /*$$ = new Step((Expr) $1, step);*/
- }
- break;
-case 10:
- // line 361 "XPathParser.y"
- {
- yyVal = new Selector (Selector.CHILD, (List) yyVals[0+yyTop]);
- }
- break;
-case 11:
- // line 365 "XPathParser.y"
- {
- yyVal = new Selector (Selector.ATTRIBUTE, (List) yyVals[0+yyTop]);
- }
- break;
-case 12:
- // line 369 "XPathParser.y"
- {
- yyVal = new Selector (((Integer) yyVals[-2+yyTop]).intValue (), (List) yyVals[0+yyTop]);
- }
- break;
-case 13:
- // line 373 "XPathParser.y"
- {
- yyVal = new Selector (Selector.SELF, Collections.EMPTY_LIST);
- }
- break;
-case 14:
- // line 377 "XPathParser.y"
- {
- yyVal = new Selector (Selector.PARENT, Collections.EMPTY_LIST);
- }
- break;
-case 15:
- // line 384 "XPathParser.y"
- {
- List list = new ArrayList();
- list.add(yyVals[0+yyTop]);
- yyVal = list;
- }
- break;
-case 16:
- // line 390 "XPathParser.y"
- {
- List list = (List)yyVals[-1+yyTop];
- list.add(yyVals[0+yyTop]);
- yyVal = list;
- }
- break;
-case 17:
- // line 414 "XPathParser.y"
- {
- yyVal = new Integer(Selector.ANCESTOR);
- }
- break;
-case 18:
- // line 418 "XPathParser.y"
- {
- yyVal = new Integer(Selector.ANCESTOR_OR_SELF);
- }
- break;
-case 19:
- // line 422 "XPathParser.y"
- {
- yyVal = new Integer(Selector.ATTRIBUTE);
- }
- break;
-case 20:
- // line 426 "XPathParser.y"
- {
- yyVal = new Integer(Selector.CHILD);
- }
- break;
-case 21:
- // line 430 "XPathParser.y"
- {
- yyVal = new Integer(Selector.DESCENDANT);
- }
- break;
-case 22:
- // line 434 "XPathParser.y"
- {
- yyVal = new Integer(Selector.DESCENDANT_OR_SELF);
- }
- break;
-case 23:
- // line 438 "XPathParser.y"
- {
- yyVal = new Integer(Selector.FOLLOWING);
- }
- break;
-case 24:
- // line 442 "XPathParser.y"
- {
- yyVal = new Integer(Selector.FOLLOWING_SIBLING);
- }
- break;
-case 25:
- // line 446 "XPathParser.y"
- {
- yyVal = new Integer(Selector.NAMESPACE);
- }
- break;
-case 26:
- // line 450 "XPathParser.y"
- {
- yyVal = new Integer(Selector.PARENT);
- }
- break;
-case 27:
- // line 454 "XPathParser.y"
- {
- yyVal = new Integer(Selector.PRECEDING);
- }
- break;
-case 28:
- // line 458 "XPathParser.y"
- {
- yyVal = new Integer(Selector.PRECEDING_SIBLING);
- }
- break;
-case 29:
- // line 462 "XPathParser.y"
- {
- yyVal = new Integer(Selector.SELF);
- }
- break;
-case 31:
- // line 471 "XPathParser.y"
- {
- yyVal = new NodeTypeTest(Node.PROCESSING_INSTRUCTION_NODE, (String) yyVals[-1+yyTop]);
- }
- break;
-case 32:
- // line 476 "XPathParser.y"
- {
- yyVal = new NodeTypeTest(((Short) yyVals[-1+yyTop]).shortValue());
- }
- break;
-case 33:
- // line 483 "XPathParser.y"
- {
- yyVal = new Predicate((Expr) yyVals[-1+yyTop]);
- }
- break;
-case 35:
- // line 491 "XPathParser.y"
- {
- yyVal = new ParenthesizedExpr((Expr) yyVals[-1+yyTop]);
- }
- break;
-case 36:
- // line 495 "XPathParser.y"
- {
- yyVal = new Constant(yyVals[0+yyTop]);
- }
- break;
-case 37:
- // line 499 "XPathParser.y"
- {
- yyVal = new Constant(yyVals[0+yyTop]);
- }
- break;
-case 39:
- // line 507 "XPathParser.y"
- {
- yyVal = lookupFunction((String) yyVals[-2+yyTop], Collections.EMPTY_LIST);
- }
- break;
-case 40:
- // line 511 "XPathParser.y"
- {
- yyVal = lookupFunction((String) yyVals[-3+yyTop], (List) yyVals[-1+yyTop]);
- }
- break;
-case 41:
- // line 518 "XPathParser.y"
- {
- List list = new ArrayList();
- list.add(yyVals[0+yyTop]);
- yyVal = list;
- }
- break;
-case 42:
- // line 524 "XPathParser.y"
- {
- List list = (List) yyVals[0+yyTop];
- list.add(0, yyVals[-2+yyTop]);
- yyVal = list;
- }
- break;
-case 44:
- // line 534 "XPathParser.y"
- {
- yyVal = new UnionExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop]);
- }
- break;
-case 47:
- // line 543 "XPathParser.y"
- {
- Steps steps;
- if (yyVals[0+yyTop] instanceof Steps)
- {
- steps = (Steps) yyVals[0+yyTop];
- }
- else
- {
- steps = new Steps();
- steps.path.addFirst(yyVals[0+yyTop]);
- }
- steps.path.addFirst(yyVals[-2+yyTop]);
- yyVal = steps;
- /*$$ = new Step ((Expr) $1, (Path) $3);*/
- }
- break;
-case 48:
- // line 559 "XPathParser.y"
- {
- Test nt = new NodeTypeTest((short) 0);
- Selector s = new Selector(Selector.DESCENDANT_OR_SELF,
- Collections.singletonList(nt));
- Steps steps;
- if (yyVals[0+yyTop] instanceof Steps)
- {
- steps = (Steps) yyVals[0+yyTop];
- }
- else
- {
- steps = new Steps();
- steps.path.addFirst(yyVals[0+yyTop]);
- }
- steps.path.addFirst(s);
- steps.path.addFirst(yyVals[-2+yyTop]);
- yyVal = steps;
- /*Step step = new Step (s, (Path) $3);*/
- /*$$ = new Step ((Expr) $1, step);*/
- }
- break;
-case 50:
- // line 584 "XPathParser.y"
- {
- Predicate filter = (Predicate) yyVals[0+yyTop];
- Selector s = new Selector(Selector.SELF,
- Collections.singletonList(filter));
- Steps steps;
- if (yyVals[-1+yyTop] instanceof Steps)
- {
- steps = (Steps) yyVals[-1+yyTop];
- }
- else
- {
- steps = new Steps();
- steps.path.addFirst(yyVals[-1+yyTop]);
- }
- steps.path.addLast(s);
- yyVal = steps;
- /*$$ = new Step ((Expr) $1, s);*/
- }
- break;
-case 52:
- // line 607 "XPathParser.y"
- {
- yyVal = new OrExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop]);
- }
- break;
-case 54:
- // line 615 "XPathParser.y"
- {
- yyVal = new AndExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop]);
- }
- break;
-case 56:
- // line 623 "XPathParser.y"
- {
- yyVal = new EqualityExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], false);
- }
- break;
-case 57:
- // line 627 "XPathParser.y"
- {
- yyVal = new EqualityExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], true);
- }
- break;
-case 59:
- // line 635 "XPathParser.y"
- {
- yyVal = new RelationalExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], true, false);
- }
- break;
-case 60:
- // line 639 "XPathParser.y"
- {
- yyVal = new RelationalExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], false, false);
- }
- break;
-case 61:
- // line 643 "XPathParser.y"
- {
- yyVal = new RelationalExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], true, true);
- }
- break;
-case 62:
- // line 647 "XPathParser.y"
- {
- yyVal = new RelationalExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], false, true);
- }
- break;
-case 64:
- // line 655 "XPathParser.y"
- {
- yyVal = new ArithmeticExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], ArithmeticExpr.ADD);
- }
- break;
-case 65:
- // line 659 "XPathParser.y"
- {
- yyVal = new ArithmeticExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], ArithmeticExpr.SUBTRACT);
- }
- break;
-case 67:
- // line 667 "XPathParser.y"
- {
- yyVal = new ArithmeticExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], ArithmeticExpr.MULTIPLY);
- }
- break;
-case 68:
- // line 671 "XPathParser.y"
- {
- yyVal = new ArithmeticExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], ArithmeticExpr.DIVIDE);
- }
- break;
-case 69:
- // line 675 "XPathParser.y"
- {
- yyVal = new ArithmeticExpr((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], ArithmeticExpr.MODULO);
- }
- break;
-case 71:
- // line 683 "XPathParser.y"
- {
- yyVal = new NegativeExpr((Expr) yyVals[0+yyTop]);
- }
- break;
-case 72:
- // line 690 "XPathParser.y"
- {
- yyVal = new Double((String) yyVals[0+yyTop] + ".0");
- }
- break;
-case 73:
- // line 694 "XPathParser.y"
- {
- yyVal = new Double((String) yyVals[-1+yyTop] + ".0");
- }
- break;
-case 74:
- // line 698 "XPathParser.y"
- {
- yyVal = new Double((String) yyVals[-2+yyTop] + "." + (String) yyVals[0+yyTop]);
- }
- break;
-case 75:
- // line 702 "XPathParser.y"
- {
- yyVal = new Double("0." + (String) yyVals[0+yyTop]);
- }
- break;
-case 77:
- // line 731 "XPathParser.y"
- {
- yyVal = new VariableReference(variableResolver, (String) yyVals[0+yyTop]);
- }
- break;
-case 78:
- // line 738 "XPathParser.y"
- {
- yyVal = new NameTest(null, true, true);
- }
- break;
-case 79:
- // line 742 "XPathParser.y"
- {
- QName qName = getQName((String) yyVals[-2+yyTop]);
- yyVal = new NameTest(qName, true, false);
- }
- break;
-case 80:
- // line 747 "XPathParser.y"
- {
- QName qName = getQName((String) yyVals[0+yyTop]);
- yyVal = new NameTest(qName, false, false);
- }
- break;
-case 82:
- // line 756 "XPathParser.y"
- {
- yyVal = (String) yyVals[-2+yyTop] + ':' + (String) yyVals[0+yyTop];
- }
- break;
-case 83:
- // line 763 "XPathParser.y"
- {
- yyVal = new Short(Node.COMMENT_NODE);
- }
- break;
-case 84:
- // line 767 "XPathParser.y"
- {
- yyVal = new Short(Node.TEXT_NODE);
- }
- break;
-case 85:
- // line 771 "XPathParser.y"
- {
- yyVal = new Short(Node.PROCESSING_INSTRUCTION_NODE);
- }
- break;
-case 86:
- // line 775 "XPathParser.y"
- {
- yyVal = new Short((short) 0);
- }
- break;
- // line 986 "-"
- }
- yyTop -= YyLenClass.yyLen[yyN];
- yyState = yyStates[yyTop];
- int yyM = YyLhsClass.yyLhs[yyN];
- if (yyState == 0 && yyM == 0) {
-//t if (yydebug != null) yydebug.shift(0, yyFinal);
- yyState = yyFinal;
- if (yyToken < 0) {
- yyToken = yyLex.advance() ? yyLex.token() : 0;
-//t if (yydebug != null)
-//t yydebug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
- }
- if (yyToken == 0) {
-//t if (yydebug != null) yydebug.accept(yyVal);
- return yyVal;
- }
- continue yyLoop;
- }
- if ((yyN = YyGindexClass.yyGindex[yyM]) != 0 && (yyN += yyState) >= 0
- && yyN < YyTableClass.yyTable.length && YyCheckClass.yyCheck[yyN] == yyState)
- yyState = YyTableClass.yyTable[yyN];
- else
- yyState = YyDgotoClass.yyDgoto[yyM];
-//t if (yydebug != null) yydebug.shift(yyStates[yyTop], yyState);
- continue yyLoop;
- }
- }
- }
-
- protected static final class YyLhsClass {
-
- public static final short yyLhs [] = { -1,
- 0, 2, 2, 4, 4, 4, 3, 3, 3, 5,
- 5, 5, 5, 5, 6, 6, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 8,
- 8, 8, 9, 12, 12, 12, 12, 12, 15, 15,
- 17, 17, 18, 18, 19, 19, 19, 19, 20, 20,
- 1, 1, 21, 21, 22, 22, 22, 23, 23, 23,
- 23, 23, 24, 24, 24, 25, 25, 25, 25, 26,
- 26, 14, 14, 14, 14, 16, 13, 10, 10, 10,
- 27, 27, 11, 11, 11, 11,
- };
- } /* End of class YyLhsClass */
-
- protected static final class YyLenClass {
-
- public static final short yyLen [] = { 2,
- 1, 1, 1, 1, 2, 2, 1, 3, 3, 1,
- 2, 3, 1, 1, 1, 2, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 3, 2, 3, 1, 3, 1, 1, 1, 3, 4,
- 1, 3, 1, 3, 1, 1, 3, 3, 1, 2,
- 1, 3, 1, 3, 1, 3, 3, 1, 3, 3,
- 3, 3, 1, 3, 3, 1, 3, 3, 3, 1,
- 2, 1, 2, 3, 2, 1, 2, 1, 3, 1,
- 1, 3, 1, 1, 1, 1,
- };
- } /* End class YyLenClass */
-
- protected static final class YyDefRedClass {
-
- public static final short yyDefRed [] = { 0,
- 36, 0, 0, 0, 0, 0, 0, 0, 78, 0,
- 0, 14, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 83, 0, 84, 86, 0,
- 0, 45, 0, 3, 7, 0, 0, 15, 30, 0,
- 49, 34, 37, 38, 0, 0, 43, 0, 0, 0,
- 0, 0, 0, 66, 0, 0, 0, 0, 13, 0,
- 80, 0, 71, 0, 0, 77, 75, 0, 0, 0,
- 0, 0, 16, 0, 32, 0, 0, 0, 0, 50,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 74, 82, 79, 35, 0, 31, 0, 8,
- 9, 0, 0, 39, 0, 0, 44, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 67, 68,
- 69, 33, 0, 40, 42,
- };
- } /* End of class YyDefRedClass */
-
- protected static final class YyDgotoClass {
-
- public static final short yyDgoto [] = { 105,
- 31, 32, 33, 34, 35, 36, 37, 38, 73, 39,
- 40, 41, 42, 43, 44, 45, 106, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55,
- };
- } /* End of class YyDgotoClass */
-
- protected static final class YySindexClass {
-
- public static final short yySindex [] = { -97,
- 0, -271, -267, -97, -239, -239, -97, -199, 0, -236,
- -222, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, -218, 0, 0, 0,
- -257, 0, -241, 0, 0, -205, -221, 0, 0, -194,
- 0, 0, 0, 0, -190, -185, 0, -238, -211, -234,
- -255, -209, -275, 0, 0, -169, -250, -168, 0, -241,
- 0, -241, 0, -205, -187, 0, 0, -167, -97, -239,
- -239, -97, 0, -199, 0, -151, -43, -239, -239, 0,
- -97, -97, -97, -97, -97, -97, -97, -97, -97, -97,
- -97, -97, 0, 0, 0, 0, -164, 0, -211, 0,
- 0, -166, -205, 0, -165, -163, 0, -241, -241, -234,
- -255, -255, -209, -209, -209, -209, -275, -275, 0, 0,
- 0, 0, -97, 0, 0,
- };
- } /* End of class YySindexClass */
-
- protected static final class YyRindexClass {
-
- public static final short yyRindex [] = { 0,
- 0, 58, 1, 0, 420, 0, 0, 0, 0, 0,
- 129, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, -161, 0, 0, 0,
- 40, 0, 237, 0, 0, 168, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 459, 0, 277, 557, 544,
- 656, 561, 474, 0, 19, 75, 0, 0, 0, 295,
- 0, 334, 0, 183, 114, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 686, 0,
- 0, 0, 222, 0, -156, 0, 0, 351, 405, 553,
- 665, 697, 577, 600, 617, 639, 513, 528, 0, 0,
- 0, 0, 0, 0, 0,
- };
- } /* End of class YyRindexClass */
-
- protected static final class YyGindexClass {
-
- public static final short yyGindex [] = { 7,
- 0, 0, 8, 0, 3, -3, 0, 0, 48, 0,
- 0, 0, 0, 0, 0, 0, -12, 0, 35, 0,
- 44, 36, -1, -54, 2, -7, -2,
- };
- } /* End of class YyGindexClass */
-
- protected static final class YyTableClass {
-
- public static final short yyTable [] = { 63,
- 81, 90, 61, 61, 64, 61, 30, 66, 94, 56,
- 58, 57, 60, 62, 84, 85, 86, 87, 80, 3,
- 91, 92, 65, 72, 70, 71, 95, 78, 79, 113,
- 114, 115, 116, 82, 83, 67, 8, 9, 68, 1,
- 69, 59, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 72, 72, 74, 3,
- 26, 27, 28, 29, 88, 89, 75, 61, 61, 76,
- 103, 61, 100, 101, 73, 61, 61, 9, 102, 77,
- 111, 112, 119, 120, 121, 108, 109, 81, 93, 117,
- 118, 97, 96, 98, 94, 80, 122, 124, 123, 85,
- 26, 27, 28, 29, 41, 1, 2, 3, 4, 104,
- 125, 107, 99, 81, 5, 6, 110, 0, 0, 0,
- 0, 0, 0, 7, 8, 9, 10, 0, 13, 11,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 0, 0, 0, 0, 26, 27,
- 28, 29, 0, 0, 0, 0, 0, 0, 0, 1,
- 2, 3, 4, 0, 0, 0, 0, 10, 5, 6,
- 0, 0, 0, 0, 0, 0, 0, 7, 8, 9,
- 10, 0, 11, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 23, 24, 25, 0, 0,
- 0, 0, 26, 27, 28, 29, 0, 0, 0, 0,
- 0, 0, 0, 1, 2, 3, 4, 0, 0, 0,
- 0, 12, 5, 6, 0, 0, 0, 0, 0, 0,
- 0, 0, 8, 9, 10, 0, 2, 11, 12, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 0, 0, 0, 0, 26, 27, 28, 29,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 81, 81, 81, 46, 81, 76, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 5, 80, 81, 81, 81, 81,
- 1, 0, 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 80, 80, 80, 80, 72, 72,
- 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
- 72, 72, 72, 6, 72, 73, 73, 73, 73, 73,
- 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
- 47, 73, 0, 72, 72, 72, 72, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 73, 73, 73, 73, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 13,
- 81, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 48, 13, 0, 0, 0, 81,
- 81, 81, 81, 0, 0, 0, 0, 0, 0, 4,
- 0, 0, 0, 0, 13, 13, 13, 13, 10, 0,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 11, 10, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 70, 11,
- 0, 0, 0, 10, 10, 10, 10, 0, 0, 0,
- 0, 0, 0, 63, 0, 0, 0, 0, 11, 11,
- 11, 11, 12, 0, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 2, 12, 2,
- 2, 2, 0, 0, 2, 2, 2, 2, 2, 2,
- 2, 2, 64, 2, 0, 0, 0, 12, 12, 12,
- 12, 0, 0, 0, 0, 0, 0, 65, 0, 0,
- 0, 0, 2, 2, 2, 2, 0, 46, 0, 46,
- 46, 46, 0, 53, 46, 46, 46, 46, 46, 46,
- 46, 46, 54, 46, 0, 5, 51, 5, 5, 5,
- 58, 0, 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 5, 46, 46, 46, 46, 60, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 6, 0, 6, 6, 6, 59,
- 0, 6, 6, 6, 6, 6, 6, 6, 6, 0,
- 6, 47, 0, 47, 47, 47, 62, 0, 47, 47,
- 47, 47, 47, 47, 47, 47, 0, 47, 0, 6,
- 6, 6, 6, 0, 0, 0, 0, 0, 61, 0,
- 0, 0, 0, 0, 0, 0, 47, 47, 47, 47,
- 0, 0, 0, 0, 0, 55, 0, 0, 0, 0,
- 0, 0, 0, 0, 56, 48, 0, 48, 48, 48,
- 0, 0, 48, 48, 48, 48, 48, 48, 48, 48,
- 4, 48, 4, 4, 4, 52, 0, 4, 4, 4,
- 4, 4, 4, 4, 4, 0, 57, 0, 0, 0,
- 48, 48, 48, 48, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 4, 4, 4, 4, 70,
- 0, 70, 70, 0, 0, 0, 70, 70, 70, 70,
- 70, 70, 70, 70, 63, 70, 63, 63, 0, 0,
- 0, 63, 63, 63, 63, 63, 63, 63, 63, 0,
- 0, 0, 0, 0, 70, 70, 70, 70, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 63, 63, 64, 0, 64, 64, 0, 0, 0,
- 64, 64, 64, 64, 64, 64, 64, 64, 65, 0,
- 65, 65, 0, 0, 0, 65, 65, 65, 65, 65,
- 65, 65, 65, 0, 53, 0, 53, 53, 0, 0,
- 64, 64, 0, 54, 0, 54, 54, 51, 0, 51,
- 51, 58, 0, 58, 58, 65, 65, 0, 58, 58,
- 58, 58, 58, 58, 0, 0, 0, 60, 0, 60,
- 60, 53, 53, 0, 60, 60, 60, 60, 60, 60,
- 54, 54, 0, 0, 51, 0, 0, 0, 58, 58,
- 59, 0, 59, 59, 0, 0, 0, 59, 59, 59,
- 59, 59, 59, 0, 60, 60, 0, 62, 0, 62,
- 62, 0, 0, 0, 62, 62, 62, 62, 62, 62,
- 0, 0, 0, 0, 0, 0, 0, 59, 59, 61,
- 0, 61, 61, 0, 0, 0, 61, 61, 61, 61,
- 61, 61, 0, 0, 62, 62, 55, 0, 55, 55,
- 0, 0, 0, 55, 55, 56, 0, 56, 56, 0,
- 0, 0, 56, 56, 0, 0, 61, 61, 0, 0,
- 0, 0, 0, 0, 0, 0, 52, 0, 52, 52,
- 0, 0, 0, 55, 55, 0, 0, 57, 0, 57,
- 57, 0, 56, 56, 57, 57, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 52, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 57, 57,
- };
- } /* End of class YyTableClass */
-
- protected static final class YyCheckClass {
-
- public static final short yyCheck [] = { 7,
- 0, 277, 5, 6, 8, 8, 0, 10, 259, 281,
- 4, 279, 5, 6, 270, 271, 272, 273, 0, 259,
- 296, 297, 259, 262, 266, 267, 277, 266, 267, 84,
- 85, 86, 87, 268, 269, 258, 276, 277, 257, 0,
- 298, 281, 282, 283, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 294, 295, 262, 0, 280, 259,
- 300, 301, 302, 303, 274, 275, 261, 70, 71, 260,
- 74, 74, 70, 71, 0, 78, 79, 277, 72, 265,
- 82, 83, 90, 91, 92, 78, 79, 299, 258, 88,
- 89, 279, 261, 261, 259, 48, 263, 261, 264, 261,
- 300, 301, 302, 303, 261, 257, 258, 259, 260, 261,
- 123, 77, 69, 0, 266, 267, 81, -1, -1, -1,
- -1, -1, -1, 275, 276, 277, 278, -1, 0, 281,
- 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, -1, -1, -1, -1, 300, 301,
- 302, 303, -1, -1, -1, -1, -1, -1, -1, 257,
- 258, 259, 260, -1, -1, -1, -1, 0, 266, 267,
- -1, -1, -1, -1, -1, -1, -1, 275, 276, 277,
- 278, -1, 0, 281, 282, 283, 284, 285, 286, 287,
- 288, 289, 290, 291, 292, 293, 294, 295, -1, -1,
- -1, -1, 300, 301, 302, 303, -1, -1, -1, -1,
- -1, -1, -1, 257, 258, 259, 260, -1, -1, -1,
- -1, 0, 266, 267, -1, -1, -1, -1, -1, -1,
- -1, -1, 276, 277, 278, -1, 0, 281, 282, 283,
- 284, 285, 286, 287, 288, 289, 290, 291, 292, 293,
- 294, 295, -1, -1, -1, -1, 300, 301, 302, 303,
- 260, 261, 262, 263, 264, 265, 266, 267, 268, 269,
- 270, 271, 272, 273, 274, 275, 0, 277, 260, 261,
- 262, 263, 264, 265, 266, 267, 268, 269, 270, 271,
- 272, 273, 274, 275, 0, 277, 296, 297, 298, 299,
- 261, -1, 263, 264, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 296, 297, 298, 299, 261, 262,
- 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
- 273, 274, 275, 0, 277, 261, 262, 263, 264, 265,
- 266, 267, 268, 269, 270, 271, 272, 273, 274, 275,
- 0, 277, -1, 296, 297, 298, 299, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 296, 297, 298, 299, 261, 262, 263, 264, 265, 266,
- 267, 268, 269, 270, 271, 272, 273, 274, 275, 261,
- 277, 263, 264, 265, 266, 267, 268, 269, 270, 271,
- 272, 273, 274, 275, 0, 277, -1, -1, -1, 296,
- 297, 298, 299, -1, -1, -1, -1, -1, -1, 0,
- -1, -1, -1, -1, 296, 297, 298, 299, 261, -1,
- 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
- 273, 274, 275, 261, 277, 263, 264, 265, 266, 267,
- 268, 269, 270, 271, 272, 273, 274, 275, 0, 277,
- -1, -1, -1, 296, 297, 298, 299, -1, -1, -1,
- -1, -1, -1, 0, -1, -1, -1, -1, 296, 297,
- 298, 299, 261, -1, 263, 264, 265, 266, 267, 268,
- 269, 270, 271, 272, 273, 274, 275, 261, 277, 263,
- 264, 265, -1, -1, 268, 269, 270, 271, 272, 273,
- 274, 275, 0, 277, -1, -1, -1, 296, 297, 298,
- 299, -1, -1, -1, -1, -1, -1, 0, -1, -1,
- -1, -1, 296, 297, 298, 299, -1, 261, -1, 263,
- 264, 265, -1, 0, 268, 269, 270, 271, 272, 273,
- 274, 275, 0, 277, -1, 261, 0, 263, 264, 265,
- 0, -1, 268, 269, 270, 271, 272, 273, 274, 275,
- -1, 277, 296, 297, 298, 299, 0, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 296, 297, 298, 299, 261, -1, 263, 264, 265, 0,
- -1, 268, 269, 270, 271, 272, 273, 274, 275, -1,
- 277, 261, -1, 263, 264, 265, 0, -1, 268, 269,
- 270, 271, 272, 273, 274, 275, -1, 277, -1, 296,
- 297, 298, 299, -1, -1, -1, -1, -1, 0, -1,
- -1, -1, -1, -1, -1, -1, 296, 297, 298, 299,
- -1, -1, -1, -1, -1, 0, -1, -1, -1, -1,
- -1, -1, -1, -1, 0, 261, -1, 263, 264, 265,
- -1, -1, 268, 269, 270, 271, 272, 273, 274, 275,
- 261, 277, 263, 264, 265, 0, -1, 268, 269, 270,
- 271, 272, 273, 274, 275, -1, 0, -1, -1, -1,
- 296, 297, 298, 299, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 296, 297, 298, 299, 261,
- -1, 263, 264, -1, -1, -1, 268, 269, 270, 271,
- 272, 273, 274, 275, 261, 277, 263, 264, -1, -1,
- -1, 268, 269, 270, 271, 272, 273, 274, 275, -1,
- -1, -1, -1, -1, 296, 297, 298, 299, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 298, 299, 261, -1, 263, 264, -1, -1, -1,
- 268, 269, 270, 271, 272, 273, 274, 275, 261, -1,
- 263, 264, -1, -1, -1, 268, 269, 270, 271, 272,
- 273, 274, 275, -1, 261, -1, 263, 264, -1, -1,
- 298, 299, -1, 261, -1, 263, 264, 261, -1, 263,
- 264, 261, -1, 263, 264, 298, 299, -1, 268, 269,
- 270, 271, 272, 273, -1, -1, -1, 261, -1, 263,
- 264, 298, 299, -1, 268, 269, 270, 271, 272, 273,
- 298, 299, -1, -1, 298, -1, -1, -1, 298, 299,
- 261, -1, 263, 264, -1, -1, -1, 268, 269, 270,
- 271, 272, 273, -1, 298, 299, -1, 261, -1, 263,
- 264, -1, -1, -1, 268, 269, 270, 271, 272, 273,
- -1, -1, -1, -1, -1, -1, -1, 298, 299, 261,
- -1, 263, 264, -1, -1, -1, 268, 269, 270, 271,
- 272, 273, -1, -1, 298, 299, 261, -1, 263, 264,
- -1, -1, -1, 268, 269, 261, -1, 263, 264, -1,
- -1, -1, 268, 269, -1, -1, 298, 299, -1, -1,
- -1, -1, -1, -1, -1, -1, 261, -1, 263, 264,
- -1, -1, -1, 298, 299, -1, -1, 261, -1, 263,
- 264, -1, 298, 299, 268, 269, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 298, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 298, 299,
- };
- } /* End of class YyCheckClass */
-
-
-//t protected static final class YyRuleClass {
-
-//t public static final String yyRule [] = {
-//t "$accept : expr",
-//t "expr : or_expr",
-//t "location_path : relative_location_path",
-//t "location_path : absolute_location_path",
-//t "absolute_location_path : SLASH",
-//t "absolute_location_path : SLASH relative_location_path",
-//t "absolute_location_path : DOUBLE_SLASH relative_location_path",
-//t "relative_location_path : step",
-//t "relative_location_path : relative_location_path SLASH step",
-//t "relative_location_path : relative_location_path DOUBLE_SLASH step",
-//t "step : step_node_test",
-//t "step : AT step_node_test",
-//t "step : axis_name DOUBLE_COLON step_node_test",
-//t "step : DOT",
-//t "step : DOUBLE_DOT",
-//t "step_node_test : node_test",
-//t "step_node_test : step_node_test predicate",
-//t "axis_name : ANCESTOR",
-//t "axis_name : ANCESTOR_OR_SELF",
-//t "axis_name : ATTRIBUTE",
-//t "axis_name : CHILD",
-//t "axis_name : DESCENDANT",
-//t "axis_name : DESCENDANT_OR_SELF",
-//t "axis_name : FOLLOWING",
-//t "axis_name : FOLLOWING_SIBLING",
-//t "axis_name : NAMESPACE",
-//t "axis_name : PARENT",
-//t "axis_name : PRECEDING",
-//t "axis_name : PRECEDING_SIBLING",
-//t "axis_name : SELF",
-//t "node_test : name_test",
-//t "node_test : PROCESSING_INSTRUCTION LITERAL RP",
-//t "node_test : node_type RP",
-//t "predicate : LB expr RB",
-//t "primary_expr : variable_reference",
-//t "primary_expr : LP expr RP",
-//t "primary_expr : LITERAL",
-//t "primary_expr : number",
-//t "primary_expr : function_call",
-//t "function_call : function_name LP RP",
-//t "function_call : function_name LP argument_list RP",
-//t "argument_list : expr",
-//t "argument_list : expr COMMA argument_list",
-//t "union_expr : path_expr",
-//t "union_expr : union_expr PIPE path_expr",
-//t "path_expr : location_path",
-//t "path_expr : filter_expr",
-//t "path_expr : filter_expr SLASH relative_location_path",
-//t "path_expr : filter_expr DOUBLE_SLASH relative_location_path",
-//t "filter_expr : primary_expr",
-//t "filter_expr : filter_expr predicate",
-//t "or_expr : and_expr",
-//t "or_expr : or_expr OR and_expr",
-//t "and_expr : equality_expr",
-//t "and_expr : and_expr AND equality_expr",
-//t "equality_expr : relational_expr",
-//t "equality_expr : equality_expr EQ relational_expr",
-//t "equality_expr : equality_expr NE relational_expr",
-//t "relational_expr : additive_expr",
-//t "relational_expr : relational_expr LT additive_expr",
-//t "relational_expr : relational_expr GT additive_expr",
-//t "relational_expr : relational_expr LTE additive_expr",
-//t "relational_expr : relational_expr GTE additive_expr",
-//t "additive_expr : multiplicative_expr",
-//t "additive_expr : additive_expr PLUS multiplicative_expr",
-//t "additive_expr : additive_expr MINUS multiplicative_expr",
-//t "multiplicative_expr : unary_expr",
-//t "multiplicative_expr : multiplicative_expr STAR unary_expr",
-//t "multiplicative_expr : multiplicative_expr DIV unary_expr",
-//t "multiplicative_expr : multiplicative_expr MOD unary_expr",
-//t "unary_expr : union_expr",
-//t "unary_expr : MINUS unary_expr",
-//t "number : DIGITS",
-//t "number : DIGITS DOT",
-//t "number : DIGITS DOT DIGITS",
-//t "number : DOT DIGITS",
-//t "function_name : qname",
-//t "variable_reference : DOLLAR qname",
-//t "name_test : STAR",
-//t "name_test : NAME COLON STAR",
-//t "name_test : qname",
-//t "qname : NAME",
-//t "qname : NAME COLON NAME",
-//t "node_type : COMMENT",
-//t "node_type : TEXT",
-//t "node_type : PROCESSING_INSTRUCTION",
-//t "node_type : NODE",
-//t };
-//t } /* End of class YyRuleClass */
-
- protected static final class YyNameClass {
-
- public static final String yyName [] = {
- "end-of-file",null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,"LITERAL","DIGITS","NAME","LP",
- "RP","LB","RB","COMMA","PIPE","SLASH","DOUBLE_SLASH","EQ","NE","GT",
- "LT","GTE","LTE","PLUS","MINUS","AT","STAR","DOLLAR","COLON",
- "DOUBLE_COLON","DOT","DOUBLE_DOT","ANCESTOR","ANCESTOR_OR_SELF",
- "ATTRIBUTE","CHILD","DESCENDANT","DESCENDANT_OR_SELF","FOLLOWING",
- "FOLLOWING_SIBLING","NAMESPACE","PARENT","PRECEDING",
- "PRECEDING_SIBLING","SELF","DIV","MOD","OR","AND","COMMENT",
- "PROCESSING_INSTRUCTION","TEXT","NODE","UNARY",
- };
- } /* End of class YyNameClass */
-
-
- // line 781 "XPathParser.y"
-
-}
- // line 1461 "-"
diff --git a/libjava/gnu/xml/xpath/XPathTokenizer.java b/libjava/gnu/xml/xpath/XPathTokenizer.java
deleted file mode 100644
index a287137827b..00000000000
--- a/libjava/gnu/xml/xpath/XPathTokenizer.java
+++ /dev/null
@@ -1,592 +0,0 @@
-/* XPathTokenizer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xpath;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Map;
-import java.util.TreeMap;
-
-/*import antlr.Token;
-import antlr.TokenStream;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;*/
-
-/**
- * XPath 1.0 expression tokenizer.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class XPathTokenizer
-implements XPathParser.yyInput
-//implements TokenStream
-{
-
- static class XPathToken
- //extends Token
- {
-
- int type;
- String val;
-
- XPathToken (int type)
- {
- this (type, null);
- }
-
- XPathToken (int type, String val)
- {
- //super (type);
- this.type = type;
- this.val = val;
- }
-
- public String getText ()
- {
- return val;
- }
-
- public String toString ()
- {
- return val;
- }
-
- }
-
- static final Map keywords = new TreeMap ();
- static
- {
- keywords.put ("ancestor", new Integer (XPathParser.ANCESTOR));
- keywords.put ("ancestor-or-self", new Integer (XPathParser.ANCESTOR_OR_SELF));
- keywords.put ("attribute", new Integer (XPathParser.ATTRIBUTE));
- keywords.put ("child", new Integer (XPathParser.CHILD));
- keywords.put ("descendant", new Integer (XPathParser.DESCENDANT));
- keywords.put ("descendant-or-self", new Integer (XPathParser.DESCENDANT_OR_SELF));
- keywords.put ("following", new Integer (XPathParser.FOLLOWING));
- keywords.put ("following-sibling", new Integer (XPathParser.FOLLOWING_SIBLING));
- keywords.put ("namespace", new Integer (XPathParser.NAMESPACE));
- keywords.put ("parent", new Integer (XPathParser.PARENT));
- keywords.put ("preceding", new Integer (XPathParser.PRECEDING));
- keywords.put ("preceding-sibling", new Integer (XPathParser.PRECEDING_SIBLING));
- keywords.put ("self", new Integer (XPathParser.SELF));
- keywords.put ("div", new Integer (XPathParser.DIV));
- keywords.put ("mod", new Integer (XPathParser.MOD));
- keywords.put ("or", new Integer (XPathParser.OR));
- keywords.put ("and", new Integer (XPathParser.AND));
- keywords.put ("comment", new Integer (XPathParser.COMMENT));
- keywords.put ("processing-instruction", new Integer (XPathParser.PROCESSING_INSTRUCTION));
- keywords.put ("text", new Integer (XPathParser.TEXT));
- keywords.put ("node", new Integer (XPathParser.NODE));
- }
-
- Reader in;
- XPathToken token;
- XPathToken lastToken;
-
- public XPathTokenizer (String expr)
- {
- this (new StringReader (expr));
- }
-
- XPathTokenizer (Reader in)
- {
- this.in = in.markSupported () ? in : new BufferedReader (in);
- }
-
- /* Begin ANTLR specific *
-
- public Token nextToken ()
- throws TokenStreamException
- {
- try
- {
- if (!advance ())
- {
- throw new TokenStreamException ("eof");
- }
- token ();
- return token;
- }
- catch (IOException e)
- {
- throw new TokenStreamIOException (e);
- }
- }
-
- * End ANTLR specific */
-
- public boolean advance ()
- throws IOException
- {
- lastToken = token;
- int c = in.read ();
- switch (c)
- {
- case -1: // eof
- return false;
- case 0x20:
- case 0x09:
- case 0x0d:
- case 0x0a: // skip whitespace
- return advance ();
- case 0x22: // "
- case 0x27: // '
- token = consume_literal (c);
- break;
- case 0x28: // (
- token = new XPathToken (XPathParser.LP);
- break;
- case 0x29: // )
- token = new XPathToken (XPathParser.RP);
- break;
- case 0x5b: // [
- token = new XPathToken (XPathParser.LB);
- break;
- case 0x5d: // ]
- token = new XPathToken (XPathParser.RB);
- break;
- case 0x2c: // ,
- token = new XPathToken (XPathParser.COMMA);
- break;
- case 0x7c: // |
- token = new XPathToken (XPathParser.PIPE);
- break;
- case 0x2f: // /
- in.mark (1);
- int d1 = in.read ();
- if (d1 == 0x2f)
- {
- token = new XPathToken (XPathParser.DOUBLE_SLASH);
- }
- else
- {
- in.reset ();
- token = new XPathToken (XPathParser.SLASH);
- }
- break;
- case 0x3d: // =
- token = new XPathToken (XPathParser.EQ);
- break;
- case 0x21: // !
- in.mark (1);
- int d2 = in.read ();
- if (d2 == 0x3d) // =
- {
- token = new XPathToken (XPathParser.NE);
- }
- else
- {
- in.reset ();
- token = new XPathToken (XPathParser.yyErrorCode);
- }
- break;
- case 0x3e: // >
- in.mark (1);
- int d3 = in.read ();
- if (d3 == 0x3d) // =
- {
- token = new XPathToken (XPathParser.GTE);
- }
- else
- {
- in.reset ();
- token = new XPathToken (XPathParser.GT);
- }
- break;
- case 0x3c: // <
- in.mark (1);
- int d4 = in.read ();
- if (d4 == 0x3d) // =
- {
- token = new XPathToken (XPathParser.LTE);
- }
- else
- {
- in.reset ();
- token = new XPathToken (XPathParser.LT);
- }
- break;
- case 0x2b: // +
- token = new XPathToken (XPathParser.PLUS);
- break;
- case 0x2d: // -
- token = new XPathToken (XPathParser.MINUS);
- break;
- case 0x40: // @
- token = new XPathToken (XPathParser.AT);
- break;
- case 0x2a: // *
- token = new XPathToken (XPathParser.STAR);
- break;
- case 0x24: // $
- token = new XPathToken (XPathParser.DOLLAR);
- break;
- case 0x3a: // :
- in.mark (1);
- int d5 = in.read ();
- if (d5 == 0x3a)
- {
- token = new XPathToken (XPathParser.DOUBLE_COLON);
- }
- else
- {
- in.reset ();
- token = new XPathToken (XPathParser.COLON);
- }
- break;
- case 0x2e: // .
- in.mark (1);
- int d6 = in.read ();
- if (d6 == 0x2e)
- {
- token = new XPathToken (XPathParser.DOUBLE_DOT);
- }
- else
- {
- in.reset ();
- token = new XPathToken (XPathParser.DOT);
- }
- break;
- default:
- if (c >= 0x30 && c <= 0x39)
- {
- token = consume_digits (c);
- }
- else if (c == 0x5f || Character.isLetter ((char) c))
- {
- token = consume_name (c);
- }
- else
- {
- token = new XPathToken (XPathParser.yyErrorCode);
- }
- }
- return true;
- }
-
- public int token ()
- {
- return token.type;
- }
-
- public Object value ()
- {
- return token.val;
- }
-
- XPathToken consume_literal (int delimiter)
- throws IOException
- {
- StringBuffer buf = new StringBuffer ();
- while (true)
- {
- int c = in.read ();
- if (c == -1)
- {
- return new XPathToken (XPathParser.yyErrorCode);
- }
- else if (c == delimiter)
- {
- return new XPathToken (XPathParser.LITERAL, buf.toString ());
- }
- else
- {
- buf.append ((char) c);
- }
- }
- }
-
- XPathToken consume_digits (int c)
- throws IOException
- {
- StringBuffer buf = new StringBuffer ();
- buf.append ((char) c);
- while (true)
- {
- in.mark (1);
- c = in.read ();
- if (c >= 0x30 && c <= 0x39)
- {
- buf.append ((char) c);
- }
- else
- {
- in.reset ();
- return new XPathToken (XPathParser.DIGITS, buf.toString ());
- }
- }
- }
-
- XPathToken consume_name (int c)
- throws IOException
- {
- StringBuffer buf = new StringBuffer ();
- buf.append ((char) c);
- while (true)
- {
- in.mark (1);
- c = in.read ();
- if (isNameChar (c))
- {
- buf.append ((char) c);
- }
- else
- {
- in.reset ();
- String name = buf.toString ();
- Integer keyword = (Integer) keywords.get (name);
- if (keyword == null)
- {
- return new XPathToken (XPathParser.NAME, name);
- }
- else
- {
- int val = keyword.intValue ();
- switch (val)
- {
- case XPathParser.NODE:
- case XPathParser.COMMENT:
- case XPathParser.TEXT:
- case XPathParser.PROCESSING_INSTRUCTION:
- // Consume subsequent (
- in.mark (1);
- do
- {
- c = in.read ();
- }
- while (c == 0x20 || c == 0x09);
- if (c != 0x28)
- {
- in.reset ();
- return new XPathToken (XPathParser.NAME, name);
- }
- break;
- case XPathParser.CHILD:
- case XPathParser.PARENT:
- case XPathParser.SELF:
- case XPathParser.DESCENDANT:
- case XPathParser.ANCESTOR:
- case XPathParser.DESCENDANT_OR_SELF:
- case XPathParser.ANCESTOR_OR_SELF:
- case XPathParser.ATTRIBUTE:
- case XPathParser.NAMESPACE:
- case XPathParser.FOLLOWING:
- case XPathParser.FOLLOWING_SIBLING:
- case XPathParser.PRECEDING:
- case XPathParser.PRECEDING_SIBLING:
- // Check that this is an axis specifier
- in.mark(1);
- do
- {
- c = in.read();
- }
- while (c == 0x20 || c == 0x09);
- if (c == 0x3a)
- {
- c = in.read();
- if (c == 0x3a)
- {
- in.reset();
- return new XPathToken(val);
- }
- }
- in.reset();
- return new XPathToken(XPathParser.NAME, name);
- case XPathParser.DIV:
- case XPathParser.MOD:
- // May be a name
- if (lastToken == null)
- {
- return new XPathToken(XPathParser.NAME, name);
- }
- switch (lastToken.type)
- {
- case XPathParser.LP:
- case XPathParser.LB:
- case XPathParser.COMMA:
- case XPathParser.PIPE:
- case XPathParser.EQ:
- case XPathParser.NE:
- case XPathParser.GT:
- case XPathParser.LT:
- case XPathParser.GTE:
- case XPathParser.LTE:
- case XPathParser.PLUS:
- case XPathParser.MINUS:
- case XPathParser.STAR:
- case XPathParser.AT:
- case XPathParser.DOLLAR:
- case XPathParser.COLON:
- case XPathParser.DOUBLE_COLON:
- case XPathParser.DIV:
- case XPathParser.MOD:
- case XPathParser.OR:
- case XPathParser.AND:
- case XPathParser.SLASH:
- return new XPathToken(XPathParser.NAME, name);
- }
- break;
- }
- return new XPathToken (val);
- }
- }
- }
- }
-
- boolean isNameChar (int c)
- {
- /* Name */
- return (c == 0x5f
- || c == 0x2d
- || c == 0x2e
- || (c >= 0x30 && c <= 0x39)
- /* CombiningChar */
- || (c >= 0x0300 && c <= 0x0345)
- || (c >= 0x0360 && c <= 0x0361)
- || (c >= 0x0483 && c <= 0x0486)
- || (c >= 0x0591 && c <= 0x05A1)
- || (c >= 0x05A3 && c <= 0x05B9)
- || (c >= 0x05BB && c <= 0x05BD)
- || c == 0x05BF
- || (c >= 0x05C1 && c <= 0x05C2)
- || c == 0x05C4
- || (c >= 0x064B && c <= 0x0652)
- || c == 0x0670
- || (c >= 0x06D6 && c <= 0x06DC)
- || (c >= 0x06DD && c <= 0x06DF)
- || (c >= 0x06E0 && c <= 0x06E4)
- || (c >= 0x06E7 && c <= 0x06E8)
- || (c >= 0x06EA && c <= 0x06ED)
- || (c >= 0x0901 && c <= 0x0903)
- || c == 0x093C
- || (c >= 0x093E && c <= 0x094C)
- || c == 0x094D
- || (c >= 0x0951 && c <= 0x0954)
- || (c >= 0x0962 && c <= 0x0963)
- || (c >= 0x0981 && c <= 0x0983)
- || c == 0x09BC
- || c == 0x09BE
- || c == 0x09BF
- || (c >= 0x09C0 && c <= 0x09C4)
- || (c >= 0x09C7 && c <= 0x09C8)
- || (c >= 0x09CB && c <= 0x09CD)
- || c == 0x09D7
- || (c >= 0x09E2 && c <= 0x09E3)
- || c == 0x0A02
- || c == 0x0A3C
- || c == 0x0A3E
- || c == 0x0A3F
- || (c >= 0x0A40 && c <= 0x0A42)
- || (c >= 0x0A47 && c <= 0x0A48)
- || (c >= 0x0A4B && c <= 0x0A4D)
- || (c >= 0x0A70 && c <= 0x0A71)
- || (c >= 0x0A81 && c <= 0x0A83)
- || c == 0x0ABC
- || (c >= 0x0ABE && c <= 0x0AC5)
- || (c >= 0x0AC7 && c <= 0x0AC9)
- || (c >= 0x0ACB && c <= 0x0ACD)
- || (c >= 0x0B01 && c <= 0x0B03)
- || c == 0x0B3C
- || (c >= 0x0B3E && c <= 0x0B43)
- || (c >= 0x0B47 && c <= 0x0B48)
- || (c >= 0x0B4B && c <= 0x0B4D)
- || (c >= 0x0B56 && c <= 0x0B57)
- || (c >= 0x0B82 && c <= 0x0B83)
- || (c >= 0x0BBE && c <= 0x0BC2)
- || (c >= 0x0BC6 && c <= 0x0BC8)
- || (c >= 0x0BCA && c <= 0x0BCD)
- || c == 0x0BD7
- || (c >= 0x0C01 && c <= 0x0C03)
- || (c >= 0x0C3E && c <= 0x0C44)
- || (c >= 0x0C46 && c <= 0x0C48)
- || (c >= 0x0C4A && c <= 0x0C4D)
- || (c >= 0x0C55 && c <= 0x0C56)
- || (c >= 0x0C82 && c <= 0x0C83)
- || (c >= 0x0CBE && c <= 0x0CC4)
- || (c >= 0x0CC6 && c <= 0x0CC8)
- || (c >= 0x0CCA && c <= 0x0CCD)
- || (c >= 0x0CD5 && c <= 0x0CD6)
- || (c >= 0x0D02 && c <= 0x0D03)
- || (c >= 0x0D3E && c <= 0x0D43)
- || (c >= 0x0D46 && c <= 0x0D48)
- || (c >= 0x0D4A && c <= 0x0D4D)
- || c == 0x0D57
- || c == 0x0E31
- || (c >= 0x0E34 && c <= 0x0E3A)
- || (c >= 0x0E47 && c <= 0x0E4E)
- || c == 0x0EB1
- || (c >= 0x0EB4 && c <= 0x0EB9)
- || (c >= 0x0EBB && c <= 0x0EBC)
- || (c >= 0x0EC8 && c <= 0x0ECD)
- || (c >= 0x0F18 && c <= 0x0F19)
- || c == 0x0F35
- || c == 0x0F37
- || c == 0x0F39
- || c == 0x0F3E
- || c == 0x0F3F
- || (c >= 0x0F71 && c <= 0x0F84)
- || (c >= 0x0F86 && c <= 0x0F8B)
- || (c >= 0x0F90 && c <= 0x0F95)
- || c == 0x0F97
- || (c >= 0x0F99 && c <= 0x0FAD)
- || (c >= 0x0FB1 && c <= 0x0FB7)
- || c == 0x0FB9
- || (c >= 0x20D0 && c <= 0x20DC)
- || c == 0x20E1
- || (c >= 0x302A && c <= 0x302F)
- || c == 0x3099
- || c == 0x309A
- /* Extender */
- || c == 0x00B7
- || c == 0x02D0
- || c == 0x02D1
- || c == 0x0387
- || c == 0x0640
- || c == 0x0E46
- || c == 0x0EC6
- || c == 0x3005
- || (c >= 0x3031 && c <= 0x3035)
- || (c >= 0x309D && c <= 0x309E)
- || (c >= 0x30FC && c <= 0x30FE)
- /* Name */
- || Character.isLetter ((char) c));
- }
-
-}
diff --git a/libjava/include/Makefile.am b/libjava/include/Makefile.am
index f1d78390061..77cd99cea90 100644
--- a/libjava/include/Makefile.am
+++ b/libjava/include/Makefile.am
@@ -9,4 +9,4 @@ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
target_noncanonical = @target_noncanonical@
tool_include_dir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
-tool_include__HEADERS = jni.h jni_md.h jawt.h jawt_md.h jvmpi.h
+tool_include__HEADERS = jni_md.h jawt.h jawt_md.h jvmpi.h
diff --git a/libjava/include/Makefile.in b/libjava/include/Makefile.in
index 582be691c2e..704313cb2c6 100644
--- a/libjava/include/Makefile.in
+++ b/libjava/include/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004 Free Software Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -42,14 +42,12 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(tool_include__HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
- $(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
$(top_srcdir)/../config/iconv.m4 \
$(top_srcdir)/../config/lcmessage.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
$(top_srcdir)/../config/lib-link.m4 \
- $(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
+ $(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
@@ -297,7 +295,7 @@ AUTOMAKE_OPTIONS = foreign
# May be used by various substitution variables.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
tool_include_dir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
-tool_include__HEADERS = jni.h jni_md.h jawt.h jawt_md.h jvmpi.h
+tool_include__HEADERS = jni_md.h jawt.h jawt_md.h jvmpi.h
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
diff --git a/libjava/include/jni.h b/libjava/include/jni.h
deleted file mode 100644
index 8ebf3f7f7e9..00000000000
--- a/libjava/include/jni.h
+++ /dev/null
@@ -1,1599 +0,0 @@
-/* jni.h
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-
-/* Note: this file must be compilable by the C compiler (for now,
- assuming GNU C is ok). This means you must never use `//'
- comments, and all C++-specific code must be conditional on
- __cplusplus. */
-
-#ifndef _CLASSPATH_JNI_H
-#define _CLASSPATH_JNI_H
-
-/* We include <stdio.h> for compatibility with Sun's <jni.h>. */
-#include <stdio.h>
-
-#include <stdarg.h>
-
-#include "jni_md.h"
-
-/* The VM might define jobject and friends. */
-#ifndef _CLASSPATH_VM_JNI_TYPES_DEFINED
-
-# ifdef __cplusplus
-
-/* Define dummy classes and then define the JNI types as pointers. */
-struct __jobject {};
-struct __jclass : __jobject {};
-struct __jstring : __jobject {};
-struct __jthrowable : __jobject {};
-struct __jweak : __jobject {};
-struct __jarray : __jobject {};
-struct __jobjectArray : __jarray {};
-struct __jbyteArray : __jarray {};
-struct __jshortArray : __jarray {};
-struct __jintArray : __jarray {};
-struct __jlongArray : __jarray {};
-struct __jbooleanArray : __jarray {};
-struct __jcharArray : __jarray {};
-struct __jfloatArray : __jarray {};
-struct __jdoubleArray : __jarray {};
-
-typedef __jobject *jobject;
-typedef __jclass *jclass;
-typedef __jstring *jstring;
-typedef __jthrowable *jthrowable;
-typedef __jweak *jweak;
-typedef __jarray *jarray;
-typedef __jobjectArray *jobjectArray;
-typedef __jbyteArray *jbyteArray;
-typedef __jshortArray *jshortArray;
-typedef __jintArray *jintArray;
-typedef __jlongArray *jlongArray;
-typedef __jbooleanArray *jbooleanArray;
-typedef __jcharArray *jcharArray;
-typedef __jfloatArray *jfloatArray;
-typedef __jdoubleArray *jdoubleArray;
-
-#define JNI_TRUE true
-#define JNI_FALSE false
-
-typedef struct _Jv_JNIEnv JNIEnv;
-typedef struct _Jv_JavaVM JavaVM;
-
-# else /* __cplusplus */
-
-/* For C, simply define the class types as generic pointers. */
-typedef void *jobject;
-typedef jobject jclass;
-typedef jobject jstring;
-typedef jobject jthrowable;
-typedef jobject jweak;
-typedef jobject jarray;
-typedef jobject jobjectArray;
-typedef jobject jbyteArray;
-typedef jobject jshortArray;
-typedef jobject jintArray;
-typedef jobject jlongArray;
-typedef jobject jbooleanArray;
-typedef jobject jcharArray;
-typedef jobject jfloatArray;
-typedef jobject jdoubleArray;
-
-#define JNI_TRUE 1
-#define JNI_FALSE 0
-
-typedef const struct JNINativeInterface *JNIEnv;
-typedef const struct JNIInvokeInterface *JavaVM;
-
-# endif /* __cplusplus */
-
-#endif /* _CLASSPATH_VM_JNI_TYPES_DEFINED */
-
-/*
- * Before jni.h is #included within a typical JVM, the source code should
- * #define _JNI_VM_INTERNAL_TYPES_DEFINED and provide the real declarations
- * for 'jobject', 'jfieldID', 'jmethodID' and other implementation types.
- * If _JNI_VM_INTERNAL_TYPES_DEFINED is not defined, the following
- * declares the old versions of the types.
- */
-#ifndef _CLASSPATH_VM_INTERNAL_TYPES_DEFINED
-struct _jfieldID;
-struct _jmethodID;
-typedef struct _jfieldID *jfieldID;
-typedef struct _jmethodID *jmethodID;
-#endif
-
-/* Version numbers. */
-#define JNI_VERSION_1_1 0x00010001
-#define JNI_VERSION_1_2 0x00010002
-#define JNI_VERSION_1_4 0x00010004
-
-/* Used when releasing array elements. */
-#define JNI_COMMIT 1
-#define JNI_ABORT 2
-
-/* Error codes */
-#define JNI_OK 0
-#define JNI_ERR (-1)
-#define JNI_EDETACHED (-2)
-#define JNI_EVERSION (-3)
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif /* __cplusplus */
-
-/* These functions might be defined in libraries which we load; the
- JNI implementation calls them at the appropriate times. */
-extern JNIEXPORT jint JNICALL JNI_OnLoad (JavaVM *, void *);
-extern JNIEXPORT void JNICALL JNI_OnUnload (JavaVM *, void *);
-
-/* This can be defined as JNIIMPORT or JNIEXPORT by the md file,
- depending on whether this is the implementation or a user. */
-#ifndef _CLASSPATH_JNIIMPEXP
-#define _CLASSPATH_JNIIMPEXP JNIIMPORT
-#endif
-
-/* These functions are called by user code to start using the
- invocation API. */
-extern _CLASSPATH_JNIIMPEXP jint JNICALL
-JNI_GetDefaultJavaVMInitArgs (void *);
-
-extern _CLASSPATH_JNIIMPEXP jint JNICALL
-JNI_CreateJavaVM (JavaVM **, void **, void *);
-
-extern _CLASSPATH_JNIIMPEXP jint JNICALL
-JNI_GetCreatedJavaVMs (JavaVM **, jsize, jsize *);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-typedef union jvalue
-{
- jboolean z;
- jbyte b;
- jchar c;
- jshort s;
- jint i;
- jlong j;
- jfloat f;
- jdouble d;
- jobject l;
-} jvalue;
-
-/* This structure is used when registering native methods. */
-typedef struct
-{
- char *name;
- char *signature;
- void *fnPtr; /* Sigh. */
-} JNINativeMethod;
-
-struct JNINativeInterface
-{
- void *reserved0;
- void *reserved1;
- void *reserved2;
- void *reserved3;
-
- jint (JNICALL *GetVersion) (JNIEnv *);
- jclass (JNICALL *DefineClass) (JNIEnv *, const char *,
- jobject, const jbyte *,
- jsize);
- jclass (JNICALL *FindClass) (JNIEnv *, const char *);
-
- jmethodID (JNICALL *FromReflectedMethod) (JNIEnv *, jobject);
- jfieldID (JNICALL *FromReflectedField) (JNIEnv *, jobject);
- jobject (JNICALL *ToReflectedMethod) (JNIEnv *, jclass,
- jmethodID, jboolean);
-
- jclass (JNICALL *GetSuperclass) (JNIEnv *, jclass);
- jboolean (JNICALL *IsAssignableFrom) (JNIEnv *, jclass, jclass);
-
- jobject (JNICALL *ToReflectedField) (JNIEnv *, jclass, jfieldID,
- jboolean);
-
- jint (JNICALL *Throw) (JNIEnv *, jthrowable);
- jint (JNICALL *ThrowNew) (JNIEnv *, jclass,
- const char *);
- jthrowable (JNICALL *ExceptionOccurred) (JNIEnv *);
- void (JNICALL *ExceptionDescribe) (JNIEnv *);
- void (JNICALL *ExceptionClear) (JNIEnv *);
- void (JNICALL *FatalError) (JNIEnv *, const char *);
-
- jint (JNICALL *PushLocalFrame) (JNIEnv *, jint);
- jobject (JNICALL *PopLocalFrame) (JNIEnv *, jobject);
-
- jobject (JNICALL *NewGlobalRef) (JNIEnv *, jobject);
- void (JNICALL *DeleteGlobalRef) (JNIEnv *, jobject);
- void (JNICALL *DeleteLocalRef) (JNIEnv *, jobject);
- jboolean (JNICALL *IsSameObject) (JNIEnv *, jobject,
- jobject);
-
- jobject (JNICALL *NewLocalRef) (JNIEnv *, jobject);
- jint (JNICALL *EnsureLocalCapacity) (JNIEnv *, jint);
-
- jobject (JNICALL *AllocObject) (JNIEnv *, jclass);
- jobject (JNICALL *NewObject) (JNIEnv *, jclass,
- jmethodID, ...);
- jobject (JNICALL *NewObjectV) (JNIEnv *, jclass,
- jmethodID, va_list);
- jobject (JNICALL *NewObjectA) (JNIEnv *, jclass,
- jmethodID, jvalue *);
-
- jclass (JNICALL *GetObjectClass) (JNIEnv *, jobject);
- jboolean (JNICALL *IsInstanceOf) (JNIEnv *, jobject, jclass);
- jmethodID (JNICALL *GetMethodID) (JNIEnv *, jclass,
- const char *, const char *);
-
- jobject (JNICALL *CallObjectMethod) (JNIEnv *, jobject, jmethodID, ...);
- jobject (JNICALL *CallObjectMethodV) (JNIEnv *, jobject, jmethodID,
- va_list);
- jobject (JNICALL *CallObjectMethodA) (JNIEnv *, jobject, jmethodID,
- jvalue *);
- jboolean (JNICALL *CallBooleanMethod) (JNIEnv *, jobject, jmethodID,
- ...);
- jboolean (JNICALL *CallBooleanMethodV) (JNIEnv *, jobject, jmethodID,
- va_list);
- jboolean (JNICALL *CallBooleanMethodA) (JNIEnv *, jobject, jmethodID,
- jvalue *);
- jbyte (JNICALL *CallByteMethod) (JNIEnv *, jobject, jmethodID, ...);
- jbyte (JNICALL *CallByteMethodV) (JNIEnv *, jobject, jmethodID,
- va_list);
- jbyte (JNICALL *CallByteMethodA) (JNIEnv *, jobject, jmethodID,
- jvalue *);
- jchar (JNICALL *CallCharMethod) (JNIEnv *, jobject, jmethodID, ...);
- jchar (JNICALL *CallCharMethodV) (JNIEnv *, jobject, jmethodID,
- va_list);
- jchar (JNICALL *CallCharMethodA) (JNIEnv *, jobject, jmethodID,
- jvalue *);
- jshort (JNICALL *CallShortMethod) (JNIEnv *, jobject, jmethodID, ...);
- jshort (JNICALL *CallShortMethodV) (JNIEnv *, jobject, jmethodID,
- va_list);
- jshort (JNICALL *CallShortMethodA) (JNIEnv *, jobject, jmethodID,
- jvalue *);
- jint (JNICALL *CallIntMethod) (JNIEnv *, jobject, jmethodID, ...);
- jint (JNICALL *CallIntMethodV) (JNIEnv *, jobject, jmethodID,
- va_list);
- jint (JNICALL *CallIntMethodA) (JNIEnv *, jobject, jmethodID,
- jvalue *);
- jlong (JNICALL *CallLongMethod) (JNIEnv *, jobject, jmethodID, ...);
- jlong (JNICALL *CallLongMethodV) (JNIEnv *, jobject, jmethodID,
- va_list);
- jlong (JNICALL *CallLongMethodA) (JNIEnv *, jobject, jmethodID,
- jvalue *);
- jfloat (JNICALL *CallFloatMethod) (JNIEnv *, jobject, jmethodID, ...);
- jfloat (JNICALL *CallFloatMethodV) (JNIEnv *, jobject, jmethodID,
- va_list);
- jfloat (JNICALL *CallFloatMethodA) (JNIEnv *, jobject, jmethodID,
- jvalue *);
- jdouble (JNICALL *CallDoubleMethod) (JNIEnv *, jobject, jmethodID, ...);
- jdouble (JNICALL *CallDoubleMethodV) (JNIEnv *, jobject, jmethodID,
- va_list);
- jdouble (JNICALL *CallDoubleMethodA) (JNIEnv *, jobject, jmethodID,
- jvalue *);
- void (JNICALL *CallVoidMethod) (JNIEnv *, jobject, jmethodID, ...);
- void (JNICALL *CallVoidMethodV) (JNIEnv *, jobject, jmethodID,
- va_list);
- void (JNICALL *CallVoidMethodA) (JNIEnv *, jobject, jmethodID,
- jvalue *);
-
- jobject (JNICALL *CallNonvirtualObjectMethod) (JNIEnv *, jobject, jclass,
- jmethodID, ...);
- jobject (JNICALL *CallNonvirtualObjectMethodV) (JNIEnv *, jobject, jclass,
- jmethodID, va_list);
- jobject (JNICALL *CallNonvirtualObjectMethodA) (JNIEnv *, jobject, jclass,
- jmethodID, jvalue *);
- jboolean (JNICALL *CallNonvirtualBooleanMethod) (JNIEnv *, jobject, jclass,
- jmethodID, ...);
- jboolean (JNICALL *CallNonvirtualBooleanMethodV) (JNIEnv *, jobject, jclass,
- jmethodID, va_list);
- jboolean (JNICALL *CallNonvirtualBooleanMethodA) (JNIEnv *, jobject, jclass,
- jmethodID, jvalue *);
- jbyte (JNICALL *CallNonvirtualByteMethod) (JNIEnv *, jobject, jclass,
- jmethodID, ...);
- jbyte (JNICALL *CallNonvirtualByteMethodV) (JNIEnv *, jobject, jclass,
- jmethodID, va_list);
- jbyte (JNICALL *CallNonvirtualByteMethodA) (JNIEnv *, jobject, jclass,
- jmethodID, jvalue *);
- jchar (JNICALL *CallNonvirtualCharMethod) (JNIEnv *, jobject, jclass,
- jmethodID, ...);
- jchar (JNICALL *CallNonvirtualCharMethodV) (JNIEnv *, jobject, jclass,
- jmethodID, va_list);
- jchar (JNICALL *CallNonvirtualCharMethodA) (JNIEnv *, jobject, jclass,
- jmethodID, jvalue *);
- jshort (JNICALL *CallNonvirtualShortMethod) (JNIEnv *, jobject, jclass,
- jmethodID, ...);
- jshort (JNICALL *CallNonvirtualShortMethodV) (JNIEnv *, jobject, jclass,
- jmethodID, va_list);
- jshort (JNICALL *CallNonvirtualShortMethodA) (JNIEnv *, jobject, jclass,
- jmethodID, jvalue *);
- jint (JNICALL *CallNonvirtualIntMethod) (JNIEnv *, jobject, jclass,
- jmethodID, ...);
- jint (JNICALL *CallNonvirtualIntMethodV) (JNIEnv *, jobject, jclass,
- jmethodID, va_list);
- jint (JNICALL *CallNonvirtualIntMethodA) (JNIEnv *, jobject, jclass,
- jmethodID, jvalue *);
- jlong (JNICALL *CallNonvirtualLongMethod) (JNIEnv *, jobject, jclass,
- jmethodID, ...);
- jlong (JNICALL *CallNonvirtualLongMethodV) (JNIEnv *, jobject, jclass,
- jmethodID, va_list);
- jlong (JNICALL *CallNonvirtualLongMethodA) (JNIEnv *, jobject, jclass,
- jmethodID, jvalue *);
- jfloat (JNICALL *CallNonvirtualFloatMethod) (JNIEnv *, jobject, jclass,
- jmethodID, ...);
- jfloat (JNICALL *CallNonvirtualFloatMethodV) (JNIEnv *, jobject, jclass,
- jmethodID, va_list);
- jfloat (JNICALL *CallNonvirtualFloatMethodA) (JNIEnv *, jobject, jclass,
- jmethodID, jvalue *);
- jdouble (JNICALL *CallNonvirtualDoubleMethod) (JNIEnv *, jobject, jclass,
- jmethodID, ...);
- jdouble (JNICALL *CallNonvirtualDoubleMethodV) (JNIEnv *, jobject, jclass,
- jmethodID, va_list);
- jdouble (JNICALL *CallNonvirtualDoubleMethodA) (JNIEnv *, jobject, jclass,
- jmethodID, jvalue *);
- void (JNICALL *CallNonvirtualVoidMethod) (JNIEnv *, jobject, jclass,
- jmethodID, ...);
- void (JNICALL *CallNonvirtualVoidMethodV) (JNIEnv *, jobject, jclass,
- jmethodID, va_list);
- void (JNICALL *CallNonvirtualVoidMethodA) (JNIEnv *, jobject, jclass,
- jmethodID, jvalue *);
-
- jfieldID (JNICALL *GetFieldID) (JNIEnv *, jclass, const char *,
- const char *);
-
- jobject (JNICALL *GetObjectField) (JNIEnv *, jobject, jfieldID);
- jboolean (JNICALL *GetBooleanField) (JNIEnv *, jobject, jfieldID);
- jbyte (JNICALL *GetByteField) (JNIEnv *, jobject, jfieldID);
- jchar (JNICALL *GetCharField) (JNIEnv *, jobject, jfieldID);
- jshort (JNICALL *GetShortField) (JNIEnv *, jobject, jfieldID);
- jint (JNICALL *GetIntField) (JNIEnv *, jobject, jfieldID);
- jlong (JNICALL *GetLongField) (JNIEnv *, jobject, jfieldID);
- jfloat (JNICALL *GetFloatField) (JNIEnv *, jobject, jfieldID);
- jdouble (JNICALL *GetDoubleField) (JNIEnv *, jobject, jfieldID);
-
- void (JNICALL *SetObjectField) (JNIEnv *, jobject,
- jfieldID, jobject);
- void (JNICALL *SetBooleanField) (JNIEnv *, jobject,
- jfieldID, jboolean);
- void (JNICALL *SetByteField) (JNIEnv *, jobject,
- jfieldID, jbyte);
- void (JNICALL *SetCharField) (JNIEnv *, jobject,
- jfieldID, jchar);
- void (JNICALL *SetShortField) (JNIEnv *, jobject,
- jfieldID, jshort);
- void (JNICALL *SetIntField) (JNIEnv *, jobject,
- jfieldID, jint);
- void (JNICALL *SetLongField) (JNIEnv *, jobject,
- jfieldID, jlong);
- void (JNICALL *SetFloatField) (JNIEnv *, jobject,
- jfieldID, jfloat);
- void (JNICALL *SetDoubleField) (JNIEnv *, jobject,
- jfieldID, jdouble);
-
- jmethodID (JNICALL *GetStaticMethodID) (JNIEnv *, jclass, const char *,
- const char *);
-
- jobject (JNICALL *CallStaticObjectMethod) (JNIEnv *, jclass, jmethodID,
- ...);
- jobject (JNICALL *CallStaticObjectMethodV) (JNIEnv *, jclass, jmethodID,
- va_list);
- jobject (JNICALL *CallStaticObjectMethodA) (JNIEnv *, jclass, jmethodID,
- jvalue *);
- jboolean (JNICALL *CallStaticBooleanMethod) (JNIEnv *, jclass, jmethodID,
- ...);
- jboolean (JNICALL *CallStaticBooleanMethodV) (JNIEnv *, jclass, jmethodID,
- va_list);
- jboolean (JNICALL *CallStaticBooleanMethodA) (JNIEnv *, jclass, jmethodID,
- jvalue *);
- jbyte (JNICALL *CallStaticByteMethod) (JNIEnv *, jclass, jmethodID,
- ...);
- jbyte (JNICALL *CallStaticByteMethodV) (JNIEnv *, jclass, jmethodID,
- va_list);
- jbyte (JNICALL *CallStaticByteMethodA) (JNIEnv *, jclass, jmethodID,
- jvalue *);
- jchar (JNICALL *CallStaticCharMethod) (JNIEnv *, jclass, jmethodID,
- ...);
- jchar (JNICALL *CallStaticCharMethodV) (JNIEnv *, jclass, jmethodID,
- va_list);
- jchar (JNICALL *CallStaticCharMethodA) (JNIEnv *, jclass, jmethodID,
- jvalue *);
- jshort (JNICALL *CallStaticShortMethod) (JNIEnv *, jclass, jmethodID,
- ...);
- jshort (JNICALL *CallStaticShortMethodV) (JNIEnv *, jclass, jmethodID,
- va_list);
- jshort (JNICALL *CallStaticShortMethodA) (JNIEnv *, jclass, jmethodID,
- jvalue *);
- jint (JNICALL *CallStaticIntMethod) (JNIEnv *, jclass, jmethodID,
- ...);
- jint (JNICALL *CallStaticIntMethodV) (JNIEnv *, jclass, jmethodID,
- va_list);
- jint (JNICALL *CallStaticIntMethodA) (JNIEnv *, jclass, jmethodID,
- jvalue *);
- jlong (JNICALL *CallStaticLongMethod) (JNIEnv *, jclass, jmethodID,
- ...);
- jlong (JNICALL *CallStaticLongMethodV) (JNIEnv *, jclass, jmethodID,
- va_list);
- jlong (JNICALL *CallStaticLongMethodA) (JNIEnv *, jclass, jmethodID,
- jvalue *);
- jfloat (JNICALL *CallStaticFloatMethod) (JNIEnv *, jclass, jmethodID,
- ...);
- jfloat (JNICALL *CallStaticFloatMethodV) (JNIEnv *, jclass, jmethodID,
- va_list);
- jfloat (JNICALL *CallStaticFloatMethodA) (JNIEnv *, jclass, jmethodID,
- jvalue *);
- jdouble (JNICALL *CallStaticDoubleMethod) (JNIEnv *, jclass, jmethodID,
- ...);
- jdouble (JNICALL *CallStaticDoubleMethodV) (JNIEnv *, jclass, jmethodID,
- va_list);
- jdouble (JNICALL *CallStaticDoubleMethodA) (JNIEnv *, jclass, jmethodID,
- jvalue *);
- void (JNICALL *CallStaticVoidMethod) (JNIEnv *, jclass, jmethodID,
- ...);
- void (JNICALL *CallStaticVoidMethodV) (JNIEnv *, jclass, jmethodID,
- va_list);
- void (JNICALL *CallStaticVoidMethodA) (JNIEnv *, jclass, jmethodID,
- jvalue *);
-
- jfieldID (JNICALL *GetStaticFieldID) (JNIEnv *, jclass, const char *,
- const char *);
-
- jobject (JNICALL *GetStaticObjectField) (JNIEnv *, jclass, jfieldID);
- jboolean (JNICALL *GetStaticBooleanField) (JNIEnv *, jclass, jfieldID);
- jbyte (JNICALL *GetStaticByteField) (JNIEnv *, jclass, jfieldID);
- jchar (JNICALL *GetStaticCharField) (JNIEnv *, jclass, jfieldID);
- jshort (JNICALL *GetStaticShortField) (JNIEnv *, jclass, jfieldID);
- jint (JNICALL *GetStaticIntField) (JNIEnv *, jclass, jfieldID);
- jlong (JNICALL *GetStaticLongField) (JNIEnv *, jclass, jfieldID);
- jfloat (JNICALL *GetStaticFloatField) (JNIEnv *, jclass, jfieldID);
- jdouble (JNICALL *GetStaticDoubleField) (JNIEnv *, jclass, jfieldID);
-
- void (JNICALL *SetStaticObjectField) (JNIEnv *, jclass,
- jfieldID, jobject);
- void (JNICALL *SetStaticBooleanField) (JNIEnv *, jclass,
- jfieldID, jboolean);
- void (JNICALL *SetStaticByteField) (JNIEnv *, jclass,
- jfieldID, jbyte);
- void (JNICALL *SetStaticCharField) (JNIEnv *, jclass,
- jfieldID, jchar);
- void (JNICALL *SetStaticShortField) (JNIEnv *, jclass,
- jfieldID, jshort);
- void (JNICALL *SetStaticIntField) (JNIEnv *, jclass,
- jfieldID, jint);
- void (JNICALL *SetStaticLongField) (JNIEnv *, jclass,
- jfieldID, jlong);
- void (JNICALL *SetStaticFloatField) (JNIEnv *, jclass,
- jfieldID, jfloat);
- void (JNICALL *SetStaticDoubleField) (JNIEnv *, jclass,
- jfieldID, jdouble);
-
- jstring (JNICALL *NewString) (JNIEnv *, const jchar *, jsize);
- jsize (JNICALL *GetStringLength) (JNIEnv *, jstring);
- const jchar * (JNICALL *GetStringChars) (JNIEnv *, jstring, jboolean *);
- void (JNICALL *ReleaseStringChars) (JNIEnv *, jstring, const jchar *);
- jstring (JNICALL *NewStringUTF) (JNIEnv *, const char *);
- jsize (JNICALL *GetStringUTFLength) (JNIEnv *, jstring);
- const char * (JNICALL *GetStringUTFChars) (JNIEnv *, jstring, jboolean *);
- void (JNICALL *ReleaseStringUTFChars) (JNIEnv *, jstring, const char *);
- jsize (JNICALL *GetArrayLength) (JNIEnv *, jarray);
- jobjectArray (JNICALL *NewObjectArray) (JNIEnv *, jsize, jclass, jobject);
- jobject (JNICALL *GetObjectArrayElement) (JNIEnv *, jobjectArray, jsize);
- void (JNICALL *SetObjectArrayElement) (JNIEnv *, jobjectArray, jsize,
- jobject);
-
- jbooleanArray (JNICALL *NewBooleanArray) (JNIEnv *, jsize);
- jbyteArray (JNICALL *NewByteArray) (JNIEnv *, jsize);
- jcharArray (JNICALL *NewCharArray) (JNIEnv *, jsize);
- jshortArray (JNICALL *NewShortArray) (JNIEnv *, jsize);
- jintArray (JNICALL *NewIntArray) (JNIEnv *, jsize);
- jlongArray (JNICALL *NewLongArray) (JNIEnv *, jsize);
- jfloatArray (JNICALL *NewFloatArray) (JNIEnv *, jsize);
- jdoubleArray (JNICALL *NewDoubleArray) (JNIEnv *, jsize);
-
- jboolean * (JNICALL *GetBooleanArrayElements) (JNIEnv *, jbooleanArray,
- jboolean *);
- jbyte * (JNICALL *GetByteArrayElements) (JNIEnv *, jbyteArray,
- jboolean *);
- jchar * (JNICALL *GetCharArrayElements) (JNIEnv *, jcharArray,
- jboolean *);
- jshort * (JNICALL *GetShortArrayElements) (JNIEnv *, jshortArray,
- jboolean *);
- jint * (JNICALL *GetIntArrayElements) (JNIEnv *, jintArray,
- jboolean *);
- jlong * (JNICALL *GetLongArrayElements) (JNIEnv *, jlongArray,
- jboolean *);
- jfloat * (JNICALL *GetFloatArrayElements) (JNIEnv *, jfloatArray,
- jboolean *);
- jdouble * (JNICALL *GetDoubleArrayElements) (JNIEnv *, jdoubleArray,
- jboolean *);
-
- void (JNICALL *ReleaseBooleanArrayElements) (JNIEnv *, jbooleanArray,
- jboolean *, jint);
- void (JNICALL *ReleaseByteArrayElements) (JNIEnv *, jbyteArray,
- jbyte *, jint);
- void (JNICALL *ReleaseCharArrayElements) (JNIEnv *, jcharArray,
- jchar *, jint);
- void (JNICALL *ReleaseShortArrayElements) (JNIEnv *, jshortArray,
- jshort *, jint);
- void (JNICALL *ReleaseIntArrayElements) (JNIEnv *, jintArray,
- jint *, jint);
- void (JNICALL *ReleaseLongArrayElements) (JNIEnv *, jlongArray,
- jlong *, jint);
- void (JNICALL *ReleaseFloatArrayElements) (JNIEnv *, jfloatArray,
- jfloat *, jint);
- void (JNICALL *ReleaseDoubleArrayElements) (JNIEnv *, jdoubleArray,
- jdouble *, jint);
-
- void (JNICALL *GetBooleanArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (JNICALL *GetByteArrayRegion) (JNIEnv *, jbyteArray,
- jsize, jsize, jbyte *);
- void (JNICALL *GetCharArrayRegion) (JNIEnv *, jcharArray,
- jsize, jsize, jchar *);
- void (JNICALL *GetShortArrayRegion) (JNIEnv *, jshortArray,
- jsize, jsize, jshort *);
- void (JNICALL *GetIntArrayRegion) (JNIEnv *, jintArray,
- jsize, jsize, jint *);
- void (JNICALL *GetLongArrayRegion) (JNIEnv *, jlongArray,
- jsize, jsize, jlong *);
- void (JNICALL *GetFloatArrayRegion) (JNIEnv *, jfloatArray,
- jsize, jsize, jfloat *);
- void (JNICALL *GetDoubleArrayRegion) (JNIEnv *, jdoubleArray,
- jsize, jsize, jdouble *);
-
- void (JNICALL *SetBooleanArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (JNICALL *SetByteArrayRegion) (JNIEnv *, jbyteArray,
- jsize, jsize, jbyte *);
- void (JNICALL *SetCharArrayRegion) (JNIEnv *, jcharArray,
- jsize, jsize, jchar *);
- void (JNICALL *SetShortArrayRegion) (JNIEnv *, jshortArray,
- jsize, jsize, jshort *);
- void (JNICALL *SetIntArrayRegion) (JNIEnv *, jintArray,
- jsize, jsize, jint *);
- void (JNICALL *SetLongArrayRegion) (JNIEnv *, jlongArray,
- jsize, jsize, jlong *);
- void (JNICALL *SetFloatArrayRegion) (JNIEnv *, jfloatArray,
- jsize, jsize, jfloat *);
- void (JNICALL *SetDoubleArrayRegion) (JNIEnv *, jdoubleArray,
- jsize, jsize, jdouble *);
-
- jint (JNICALL *RegisterNatives) (JNIEnv *, jclass,
- const JNINativeMethod *,
- jint);
- jint (JNICALL *UnregisterNatives) (JNIEnv *, jclass);
- jint (JNICALL *MonitorEnter) (JNIEnv *, jobject);
- jint (JNICALL *MonitorExit) (JNIEnv *, jobject);
- jint (JNICALL *GetJavaVM) (JNIEnv *, JavaVM **);
-
- /* ---- JNI 1.2 functions ---- */
- void (JNICALL *GetStringRegion) (JNIEnv *, jstring, jsize,
- jsize, jchar *);
- void (JNICALL *GetStringUTFRegion) (JNIEnv *, jstring, jsize,
- jsize, char *);
-
- void * (JNICALL *GetPrimitiveArrayCritical) (JNIEnv *, jarray,
- jboolean *);
- void (JNICALL *ReleasePrimitiveArrayCritical) (JNIEnv *, jarray, void *,
- jint);
-
- const jchar * (JNICALL *GetStringCritical) (JNIEnv *, jstring,
- jboolean *);
- void (JNICALL *ReleaseStringCritical) (JNIEnv *, jstring,
- const jchar *);
-
- jweak (JNICALL *NewWeakGlobalRef) (JNIEnv *, jobject);
- void (JNICALL *DeleteWeakGlobalRef) (JNIEnv *, jweak);
-
- jboolean (JNICALL *ExceptionCheck) (JNIEnv *);
-
- /* ---- JNI 1.4 functions ---- */
- jobject (JNICALL *NewDirectByteBuffer) (JNIEnv *, void *, jlong);
- void * (JNICALL *GetDirectBufferAddress) (JNIEnv *, jobject);
- jlong (JNICALL *GetDirectBufferCapacity) (JNIEnv *, jobject);
-};
-
-#ifdef __cplusplus
-
-class _Jv_JNIEnv
-{
-public:
- /* The method table. */
- struct JNINativeInterface *p;
-
-#ifdef _CLASSPATH_JNIENV_CONTENTS
- _CLASSPATH_JNIENV_CONTENTS
-#endif
-
- jint GetVersion ()
- { return p->GetVersion (this); }
-
- jclass DefineClass (const char *name, jobject obj0, const jbyte * val1,
- jsize val2)
- { return p->DefineClass (this, name, obj0, val1, val2); }
-
- jclass FindClass (const char * val0)
- { return p->FindClass (this, val0); }
-
- jmethodID FromReflectedMethod (jobject obj0)
- { return p->FromReflectedMethod (this, obj0); }
-
- jfieldID FromReflectedField (jobject obj0)
- { return p->FromReflectedField (this, obj0); }
-
- jobject ToReflectedMethod (jclass cl0, jmethodID meth1, jboolean val2)
- { return p->ToReflectedMethod (this, cl0, meth1, val2); }
-
- jclass GetSuperclass (jclass cl0)
- { return p->GetSuperclass (this, cl0); }
-
- jboolean IsAssignableFrom (jclass cl0, jclass cl1)
- { return p->IsAssignableFrom (this, cl0, cl1); }
-
- jobject ToReflectedField (jclass cl0, jfieldID fld1, jboolean val2)
- { return p->ToReflectedField (this, cl0, fld1, val2); }
-
- jint Throw (jthrowable val0)
- { return p->Throw (this, val0); }
-
- jint ThrowNew (jclass cl0, const char * val1)
- { return p->ThrowNew (this, cl0, val1); }
-
- jthrowable ExceptionOccurred ()
- { return p->ExceptionOccurred (this); }
-
- void ExceptionDescribe ()
- { p->ExceptionDescribe (this); }
-
- void ExceptionClear ()
- { p->ExceptionClear (this); }
-
- void FatalError (const char * val0)
- { p->FatalError (this, val0); }
-
- jint PushLocalFrame (jint val0)
- { return p->PushLocalFrame (this, val0); }
-
- jobject PopLocalFrame (jobject obj0)
- { return p->PopLocalFrame (this, obj0); }
-
- jobject NewGlobalRef (jobject obj0)
- { return p->NewGlobalRef (this, obj0); }
-
- void DeleteGlobalRef (jobject obj0)
- { p->DeleteGlobalRef (this, obj0); }
-
- void DeleteLocalRef (jobject obj0)
- { p->DeleteLocalRef (this, obj0); }
-
- jboolean IsSameObject (jobject obj0, jobject obj1)
- { return p->IsSameObject (this, obj0, obj1); }
-
- jobject NewLocalRef (jobject obj0)
- { return p->NewLocalRef (this, obj0); }
-
- jint EnsureLocalCapacity (jint val0)
- { return p->EnsureLocalCapacity (this, val0); }
-
- jobject AllocObject (jclass cl0)
- { return p->AllocObject (this, cl0); }
-
- jobject NewObject (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jobject result = p->NewObjectV (this, cl0, meth1, args);
- va_end (args);
- return result;
- }
-
- jobject NewObjectV (jclass cl0, jmethodID meth1, va_list val2)
- { return p->NewObjectV (this, cl0, meth1, val2); }
-
- jobject NewObjectA (jclass cl0, jmethodID meth1, jvalue * val2)
- { return p->NewObjectA (this, cl0, meth1, val2); }
-
- jclass GetObjectClass (jobject obj0)
- { return p->GetObjectClass (this, obj0); }
-
- jboolean IsInstanceOf (jobject obj0, jclass cl1)
- { return p->IsInstanceOf (this, obj0, cl1); }
-
- jmethodID GetMethodID (jclass cl0, const char * val1, const char * val2)
- { return p->GetMethodID (this, cl0, val1, val2); }
-
- jobject CallObjectMethod (jobject obj0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jobject result = p->CallObjectMethodV (this, obj0, meth1, args);
- va_end (args);
- return result;
- }
-
- jobject CallObjectMethodV (jobject obj0, jmethodID meth1, va_list val2)
- { return p->CallObjectMethodV (this, obj0, meth1, val2); }
-
- jobject CallObjectMethodA (jobject obj0, jmethodID meth1, jvalue * val2)
- { return p->CallObjectMethodA (this, obj0, meth1, val2); }
-
- jboolean CallBooleanMethod (jobject obj0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jboolean result = p->CallBooleanMethodV (this, obj0, meth1, args);
- va_end (args);
- return result;
- }
-
- jboolean CallBooleanMethodV (jobject obj0, jmethodID meth1, va_list val2)
- { return p->CallBooleanMethodV (this, obj0, meth1, val2); }
-
- jboolean CallBooleanMethodA (jobject obj0, jmethodID meth1, jvalue * val2)
- { return p->CallBooleanMethodA (this, obj0, meth1, val2); }
-
- jbyte CallByteMethod (jobject obj0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jbyte result = p->CallByteMethodV (this, obj0, meth1, args);
- va_end (args);
- return result;
- }
-
- jbyte CallByteMethodV (jobject obj0, jmethodID meth1, va_list val2)
- { return p->CallByteMethodV (this, obj0, meth1, val2); }
-
- jbyte CallByteMethodA (jobject obj0, jmethodID meth1, jvalue * val2)
- { return p->CallByteMethodA (this, obj0, meth1, val2); }
-
- jchar CallCharMethod (jobject obj0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jchar result = p->CallCharMethodV (this, obj0, meth1, args);
- va_end (args);
- return result;
- }
-
- jchar CallCharMethodV (jobject obj0, jmethodID meth1, va_list val2)
- { return p->CallCharMethodV (this, obj0, meth1, val2); }
-
- jchar CallCharMethodA (jobject obj0, jmethodID meth1, jvalue * val2)
- { return p->CallCharMethodA (this, obj0, meth1, val2); }
-
- jshort CallShortMethod (jobject obj0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jshort result = p->CallShortMethodV (this, obj0, meth1, args);
- va_end (args);
- return result;
- }
-
- jshort CallShortMethodV (jobject obj0, jmethodID meth1, va_list val2)
- { return p->CallShortMethodV (this, obj0, meth1, val2); }
-
- jshort CallShortMethodA (jobject obj0, jmethodID meth1, jvalue * val2)
- { return p->CallShortMethodA (this, obj0, meth1, val2); }
-
- jint CallIntMethod (jobject obj0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jint result = p->CallIntMethodV (this, obj0, meth1, args);
- va_end (args);
- return result;
- }
-
- jint CallIntMethodV (jobject obj0, jmethodID meth1, va_list val2)
- { return p->CallIntMethodV (this, obj0, meth1, val2); }
-
- jint CallIntMethodA (jobject obj0, jmethodID meth1, jvalue * val2)
- { return p->CallIntMethodA (this, obj0, meth1, val2); }
-
- jlong CallLongMethod (jobject obj0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jlong result = p->CallLongMethodV (this, obj0, meth1, args);
- va_end (args);
- return result;
- }
-
- jlong CallLongMethodV (jobject obj0, jmethodID meth1, va_list val2)
- { return p->CallLongMethodV (this, obj0, meth1, val2); }
-
- jlong CallLongMethodA (jobject obj0, jmethodID meth1, jvalue * val2)
- { return p->CallLongMethodA (this, obj0, meth1, val2); }
-
- jfloat CallFloatMethod (jobject obj0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jfloat result = p->CallFloatMethodV (this, obj0, meth1, args);
- va_end (args);
- return result;
- }
-
- jfloat CallFloatMethodV (jobject obj0, jmethodID meth1, va_list val2)
- { return p->CallFloatMethodV (this, obj0, meth1, val2); }
-
- jfloat CallFloatMethodA (jobject obj0, jmethodID meth1, jvalue * val2)
- { return p->CallFloatMethodA (this, obj0, meth1, val2); }
-
- jdouble CallDoubleMethod (jobject obj0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jdouble result = p->CallDoubleMethodV (this, obj0, meth1, args);
- va_end (args);
- return result;
- }
-
- jdouble CallDoubleMethodV (jobject obj0, jmethodID meth1, va_list val2)
- { return p->CallDoubleMethodV (this, obj0, meth1, val2); }
-
- jdouble CallDoubleMethodA (jobject obj0, jmethodID meth1, jvalue * val2)
- { return p->CallDoubleMethodA (this, obj0, meth1, val2); }
-
- void CallVoidMethod (jobject obj0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- p->CallVoidMethodV (this, obj0, meth1, args);
- va_end (args);
- }
-
- void CallVoidMethodV (jobject obj0, jmethodID meth1, va_list val2)
- { p->CallVoidMethodV (this, obj0, meth1, val2); }
-
- void CallVoidMethodA (jobject obj0, jmethodID meth1, jvalue * val2)
- { p->CallVoidMethodA (this, obj0, meth1, val2); }
-
- jobject CallNonvirtualObjectMethod (jobject obj0, jclass cl1, jmethodID meth2, ...)
- {
- va_list args;
- va_start (args, meth2);
- jobject result = p->CallNonvirtualObjectMethodV (this, obj0, cl1, meth2, args);
- va_end (args);
- return result;
- }
-
- jobject CallNonvirtualObjectMethodV (jobject obj0, jclass cl1, jmethodID meth2, va_list val3)
- { return p->CallNonvirtualObjectMethodV (this, obj0, cl1, meth2, val3); }
-
- jobject CallNonvirtualObjectMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3)
- { return p->CallNonvirtualObjectMethodA (this, obj0, cl1, meth2, val3); }
-
- jboolean CallNonvirtualBooleanMethod (jobject obj0, jclass cl1, jmethodID meth2, ...)
- {
- va_list args;
- va_start (args, meth2);
- jboolean result = p->CallNonvirtualBooleanMethodV (this, obj0, cl1, meth2, args);
- va_end (args);
- return result;
- }
-
- jboolean CallNonvirtualBooleanMethodV (jobject obj0, jclass cl1, jmethodID meth2, va_list val3)
- { return p->CallNonvirtualBooleanMethodV (this, obj0, cl1, meth2, val3); }
-
- jboolean CallNonvirtualBooleanMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3)
- { return p->CallNonvirtualBooleanMethodA (this, obj0, cl1, meth2, val3); }
-
- jbyte CallNonvirtualByteMethod (jobject obj0, jclass cl1, jmethodID meth2, ...)
- {
- va_list args;
- va_start (args, meth2);
- jbyte result = p->CallNonvirtualByteMethodV (this, obj0, cl1, meth2, args);
- va_end (args);
- return result;
- }
-
- jbyte CallNonvirtualByteMethodV (jobject obj0, jclass cl1, jmethodID meth2, va_list val3)
- { return p->CallNonvirtualByteMethodV (this, obj0, cl1, meth2, val3); }
-
- jbyte CallNonvirtualByteMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3)
- { return p->CallNonvirtualByteMethodA (this, obj0, cl1, meth2, val3); }
-
- jchar CallNonvirtualCharMethod (jobject obj0, jclass cl1, jmethodID meth2, ...)
- {
- va_list args;
- va_start (args, meth2);
- jchar result = p->CallNonvirtualCharMethodV (this, obj0, cl1, meth2, args);
- va_end (args);
- return result;
- }
-
- jchar CallNonvirtualCharMethodV (jobject obj0, jclass cl1, jmethodID meth2, va_list val3)
- { return p->CallNonvirtualCharMethodV (this, obj0, cl1, meth2, val3); }
-
- jchar CallNonvirtualCharMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3)
- { return p->CallNonvirtualCharMethodA (this, obj0, cl1, meth2, val3); }
-
- jshort CallNonvirtualShortMethod (jobject obj0, jclass cl1, jmethodID meth2, ...)
- {
- va_list args;
- va_start (args, meth2);
- jshort result = p->CallNonvirtualShortMethodV (this, obj0, cl1, meth2, args);
- va_end (args);
- return result;
- }
-
- jshort CallNonvirtualShortMethodV (jobject obj0, jclass cl1, jmethodID meth2, va_list val3)
- { return p->CallNonvirtualShortMethodV (this, obj0, cl1, meth2, val3); }
-
- jshort CallNonvirtualShortMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3)
- { return p->CallNonvirtualShortMethodA (this, obj0, cl1, meth2, val3); }
-
- jint CallNonvirtualIntMethod (jobject obj0, jclass cl1, jmethodID meth2, ...)
- {
- va_list args;
- va_start (args, meth2);
- jint result = p->CallNonvirtualIntMethodV (this, obj0, cl1, meth2, args);
- va_end (args);
- return result;
- }
-
- jint CallNonvirtualIntMethodV (jobject obj0, jclass cl1, jmethodID meth2, va_list val3)
- { return p->CallNonvirtualIntMethodV (this, obj0, cl1, meth2, val3); }
-
- jint CallNonvirtualIntMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3)
- { return p->CallNonvirtualIntMethodA (this, obj0, cl1, meth2, val3); }
-
- jlong CallNonvirtualLongMethod (jobject obj0, jclass cl1, jmethodID meth2, ...)
- {
- va_list args;
- va_start (args, meth2);
- jlong result = p->CallNonvirtualLongMethodV (this, obj0, cl1, meth2, args);
- va_end (args);
- return result;
- }
-
- jlong CallNonvirtualLongMethodV (jobject obj0, jclass cl1, jmethodID meth2, va_list val3)
- { return p->CallNonvirtualLongMethodV (this, obj0, cl1, meth2, val3); }
-
- jlong CallNonvirtualLongMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3)
- { return p->CallNonvirtualLongMethodA (this, obj0, cl1, meth2, val3); }
-
- jfloat CallNonvirtualFloatMethod (jobject obj0, jclass cl1, jmethodID meth2, ...)
- {
- va_list args;
- va_start (args, meth2);
- jfloat result = p->CallNonvirtualFloatMethodV (this, obj0, cl1, meth2, args);
- va_end (args);
- return result;
- }
-
- jfloat CallNonvirtualFloatMethodV (jobject obj0, jclass cl1, jmethodID meth2, va_list val3)
- { return p->CallNonvirtualFloatMethodV (this, obj0, cl1, meth2, val3); }
-
- jfloat CallNonvirtualFloatMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3)
- { return p->CallNonvirtualFloatMethodA (this, obj0, cl1, meth2, val3); }
-
- jdouble CallNonvirtualDoubleMethod (jobject obj0, jclass cl1, jmethodID meth2, ...)
- {
- va_list args;
- va_start (args, meth2);
- jdouble result = p->CallNonvirtualDoubleMethodV (this, obj0, cl1, meth2, args);
- va_end (args);
- return result;
- }
-
- jdouble CallNonvirtualDoubleMethodV (jobject obj0, jclass cl1, jmethodID meth2, va_list val3)
- { return p->CallNonvirtualDoubleMethodV (this, obj0, cl1, meth2, val3); }
-
- jdouble CallNonvirtualDoubleMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3)
- { return p->CallNonvirtualDoubleMethodA (this, obj0, cl1, meth2, val3); }
-
- void CallNonvirtualVoidMethod (jobject obj0, jclass cl1, jmethodID meth2, ...)
- {
- va_list args;
- va_start (args, meth2);
- p->CallNonvirtualVoidMethodV (this, obj0, cl1, meth2, args);
- va_end (args);
- }
-
- void CallNonvirtualVoidMethodV (jobject obj0, jclass cl1, jmethodID meth2, va_list val3)
- { p->CallNonvirtualVoidMethodV (this, obj0, cl1, meth2, val3); }
-
- void CallNonvirtualVoidMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3)
- { p->CallNonvirtualVoidMethodA (this, obj0, cl1, meth2, val3); }
-
- jfieldID GetFieldID (jclass cl0, const char * val1, const char * val2)
- { return p->GetFieldID (this, cl0, val1, val2); }
-
- jobject GetObjectField (jobject obj0, jfieldID fld1)
- { return p->GetObjectField (this, obj0, fld1); }
-
- jboolean GetBooleanField (jobject obj0, jfieldID fld1)
- { return p->GetBooleanField (this, obj0, fld1); }
-
- jbyte GetByteField (jobject obj0, jfieldID fld1)
- { return p->GetByteField (this, obj0, fld1); }
-
- jchar GetCharField (jobject obj0, jfieldID fld1)
- { return p->GetCharField (this, obj0, fld1); }
-
- jshort GetShortField (jobject obj0, jfieldID fld1)
- { return p->GetShortField (this, obj0, fld1); }
-
- jint GetIntField (jobject obj0, jfieldID fld1)
- { return p->GetIntField (this, obj0, fld1); }
-
- jlong GetLongField (jobject obj0, jfieldID fld1)
- { return p->GetLongField (this, obj0, fld1); }
-
- jfloat GetFloatField (jobject obj0, jfieldID fld1)
- { return p->GetFloatField (this, obj0, fld1); }
-
- jdouble GetDoubleField (jobject obj0, jfieldID fld1)
- { return p->GetDoubleField (this, obj0, fld1); }
-
- void SetObjectField (jobject obj0, jfieldID fld1, jobject obj2)
- { p->SetObjectField (this, obj0, fld1, obj2); }
-
- void SetBooleanField (jobject obj0, jfieldID fld1, jboolean val2)
- { p->SetBooleanField (this, obj0, fld1, val2); }
-
- void SetByteField (jobject obj0, jfieldID fld1, jbyte val2)
- { p->SetByteField (this, obj0, fld1, val2); }
-
- void SetCharField (jobject obj0, jfieldID fld1, jchar val2)
- { p->SetCharField (this, obj0, fld1, val2); }
-
- void SetShortField (jobject obj0, jfieldID fld1, jshort val2)
- { p->SetShortField (this, obj0, fld1, val2); }
-
- void SetIntField (jobject obj0, jfieldID fld1, jint val2)
- { p->SetIntField (this, obj0, fld1, val2); }
-
- void SetLongField (jobject obj0, jfieldID fld1, jlong val2)
- { p->SetLongField (this, obj0, fld1, val2); }
-
- void SetFloatField (jobject obj0, jfieldID fld1, jfloat val2)
- { p->SetFloatField (this, obj0, fld1, val2); }
-
- void SetDoubleField (jobject obj0, jfieldID fld1, jdouble val2)
- { p->SetDoubleField (this, obj0, fld1, val2); }
-
- jmethodID GetStaticMethodID (jclass cl0, const char * val1, const char * val2)
- { return p->GetStaticMethodID (this, cl0, val1, val2); }
-
- jobject CallStaticObjectMethod (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jobject result = p->CallStaticObjectMethodV (this, cl0, meth1, args);
- va_end (args);
- return result;
- }
-
- jobject CallStaticObjectMethodV (jclass cl0, jmethodID meth1, va_list val2)
- { return p->CallStaticObjectMethodV (this, cl0, meth1, val2); }
-
- jobject CallStaticObjectMethodA (jclass cl0, jmethodID meth1, jvalue * val2)
- { return p->CallStaticObjectMethodA (this, cl0, meth1, val2); }
-
- jboolean CallStaticBooleanMethod (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jboolean result = p->CallStaticBooleanMethodV (this, cl0, meth1, args);
- va_end (args);
- return result;
- }
-
- jboolean CallStaticBooleanMethodV (jclass cl0, jmethodID meth1, va_list val2)
- { return p->CallStaticBooleanMethodV (this, cl0, meth1, val2); }
-
- jboolean CallStaticBooleanMethodA (jclass cl0, jmethodID meth1, jvalue * val2)
- { return p->CallStaticBooleanMethodA (this, cl0, meth1, val2); }
-
- jbyte CallStaticByteMethod (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jbyte result = p->CallStaticByteMethodV (this, cl0, meth1, args);
- va_end (args);
- return result;
- }
-
- jbyte CallStaticByteMethodV (jclass cl0, jmethodID meth1, va_list val2)
- { return p->CallStaticByteMethodV (this, cl0, meth1, val2); }
-
- jbyte CallStaticByteMethodA (jclass cl0, jmethodID meth1, jvalue * val2)
- { return p->CallStaticByteMethodA (this, cl0, meth1, val2); }
-
- jchar CallStaticCharMethod (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jchar result = p->CallStaticCharMethodV (this, cl0, meth1, args);
- va_end (args);
- return result;
- }
-
- jchar CallStaticCharMethodV (jclass cl0, jmethodID meth1, va_list val2)
- { return p->CallStaticCharMethodV (this, cl0, meth1, val2); }
-
- jchar CallStaticCharMethodA (jclass cl0, jmethodID meth1, jvalue * val2)
- { return p->CallStaticCharMethodA (this, cl0, meth1, val2); }
-
- jshort CallStaticShortMethod (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jshort result = p->CallStaticShortMethodV (this, cl0, meth1, args);
- va_end (args);
- return result;
- }
-
- jshort CallStaticShortMethodV (jclass cl0, jmethodID meth1, va_list val2)
- { return p->CallStaticShortMethodV (this, cl0, meth1, val2); }
-
- jshort CallStaticShortMethodA (jclass cl0, jmethodID meth1, jvalue * val2)
- { return p->CallStaticShortMethodA (this, cl0, meth1, val2); }
-
- jint CallStaticIntMethod (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jint result = p->CallStaticIntMethodV (this, cl0, meth1, args);
- va_end (args);
- return result;
- }
-
- jint CallStaticIntMethodV (jclass cl0, jmethodID meth1, va_list val2)
- { return p->CallStaticIntMethodV (this, cl0, meth1, val2); }
-
- jint CallStaticIntMethodA (jclass cl0, jmethodID meth1, jvalue * val2)
- { return p->CallStaticIntMethodA (this, cl0, meth1, val2); }
-
- jlong CallStaticLongMethod (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jlong result = p->CallStaticLongMethodV (this, cl0, meth1, args);
- va_end (args);
- return result;
- }
-
- jlong CallStaticLongMethodV (jclass cl0, jmethodID meth1, va_list val2)
- { return p->CallStaticLongMethodV (this, cl0, meth1, val2); }
-
- jlong CallStaticLongMethodA (jclass cl0, jmethodID meth1, jvalue * val2)
- { return p->CallStaticLongMethodA (this, cl0, meth1, val2); }
-
- jfloat CallStaticFloatMethod (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jfloat result = p->CallStaticFloatMethodV (this, cl0, meth1, args);
- va_end (args);
- return result;
- }
-
- jfloat CallStaticFloatMethodV (jclass cl0, jmethodID meth1, va_list val2)
- { return p->CallStaticFloatMethodV (this, cl0, meth1, val2); }
-
- jfloat CallStaticFloatMethodA (jclass cl0, jmethodID meth1, jvalue * val2)
- { return p->CallStaticFloatMethodA (this, cl0, meth1, val2); }
-
- jdouble CallStaticDoubleMethod (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- jdouble result = p->CallStaticDoubleMethodV (this, cl0, meth1, args);
- va_end (args);
- return result;
- }
-
- jdouble CallStaticDoubleMethodV (jclass cl0, jmethodID meth1, va_list val2)
- { return p->CallStaticDoubleMethodV (this, cl0, meth1, val2); }
-
- jdouble CallStaticDoubleMethodA (jclass cl0, jmethodID meth1, jvalue * val2)
- { return p->CallStaticDoubleMethodA (this, cl0, meth1, val2); }
-
- void CallStaticVoidMethod (jclass cl0, jmethodID meth1, ...)
- {
- va_list args;
- va_start (args, meth1);
- p->CallStaticVoidMethodV (this, cl0, meth1, args);
- va_end (args);
- }
-
- void CallStaticVoidMethodV (jclass cl0, jmethodID meth1, va_list val2)
- { p->CallStaticVoidMethodV (this, cl0, meth1, val2); }
-
- void CallStaticVoidMethodA (jclass cl0, jmethodID meth1, jvalue * val2)
- { p->CallStaticVoidMethodA (this, cl0, meth1, val2); }
-
- jfieldID GetStaticFieldID (jclass cl0, const char * val1, const char * val2)
- { return p->GetStaticFieldID (this, cl0, val1, val2); }
-
- jobject GetStaticObjectField (jclass cl0, jfieldID fld1)
- { return p->GetStaticObjectField (this, cl0, fld1); }
-
- jboolean GetStaticBooleanField (jclass cl0, jfieldID fld1)
- { return p->GetStaticBooleanField (this, cl0, fld1); }
-
- jbyte GetStaticByteField (jclass cl0, jfieldID fld1)
- { return p->GetStaticByteField (this, cl0, fld1); }
-
- jchar GetStaticCharField (jclass cl0, jfieldID fld1)
- { return p->GetStaticCharField (this, cl0, fld1); }
-
- jshort GetStaticShortField (jclass cl0, jfieldID fld1)
- { return p->GetStaticShortField (this, cl0, fld1); }
-
- jint GetStaticIntField (jclass cl0, jfieldID fld1)
- { return p->GetStaticIntField (this, cl0, fld1); }
-
- jlong GetStaticLongField (jclass cl0, jfieldID fld1)
- { return p->GetStaticLongField (this, cl0, fld1); }
-
- jfloat GetStaticFloatField (jclass cl0, jfieldID fld1)
- { return p->GetStaticFloatField (this, cl0, fld1); }
-
- jdouble GetStaticDoubleField (jclass cl0, jfieldID fld1)
- { return p->GetStaticDoubleField (this, cl0, fld1); }
-
- void SetStaticObjectField (jclass cl0, jfieldID fld1, jobject obj2)
- { p->SetStaticObjectField (this, cl0, fld1, obj2); }
-
- void SetStaticBooleanField (jclass cl0, jfieldID fld1, jboolean val2)
- { p->SetStaticBooleanField (this, cl0, fld1, val2); }
-
- void SetStaticByteField (jclass cl0, jfieldID fld1, jbyte val2)
- { p->SetStaticByteField (this, cl0, fld1, val2); }
-
- void SetStaticCharField (jclass cl0, jfieldID fld1, jchar val2)
- { p->SetStaticCharField (this, cl0, fld1, val2); }
-
- void SetStaticShortField (jclass cl0, jfieldID fld1, jshort val2)
- { p->SetStaticShortField (this, cl0, fld1, val2); }
-
- void SetStaticIntField (jclass cl0, jfieldID fld1, jint val2)
- { p->SetStaticIntField (this, cl0, fld1, val2); }
-
- void SetStaticLongField (jclass cl0, jfieldID fld1, jlong val2)
- { p->SetStaticLongField (this, cl0, fld1, val2); }
-
- void SetStaticFloatField (jclass cl0, jfieldID fld1, jfloat val2)
- { p->SetStaticFloatField (this, cl0, fld1, val2); }
-
- void SetStaticDoubleField (jclass cl0, jfieldID fld1, jdouble val2)
- { p->SetStaticDoubleField (this, cl0, fld1, val2); }
-
- jstring NewString (const jchar * val0, jsize val1)
- { return p->NewString (this, val0, val1); }
-
- jint GetStringLength (jstring val0)
- { return p->GetStringLength (this, val0); }
-
- const jchar * GetStringChars (jstring val0, jboolean * val1)
- { return p->GetStringChars (this, val0, val1); }
-
- void ReleaseStringChars (jstring val0, const jchar * val1)
- { p->ReleaseStringChars (this, val0, val1); }
-
- jstring NewStringUTF (const char * val0)
- { return p->NewStringUTF (this, val0); }
-
- jsize GetStringUTFLength (jstring val0)
- { return p->GetStringUTFLength (this, val0); }
-
- const char * GetStringUTFChars (jstring val0, jboolean * val1)
- { return p->GetStringUTFChars (this, val0, val1); }
-
- void ReleaseStringUTFChars (jstring val0, const char * val1)
- { p->ReleaseStringUTFChars (this, val0, val1); }
-
- jsize GetArrayLength (jarray val0)
- { return p->GetArrayLength (this, val0); }
-
- jobjectArray NewObjectArray (jsize val0, jclass cl1, jobject obj2)
- { return p->NewObjectArray (this, val0, cl1, obj2); }
-
- jobject GetObjectArrayElement (jobjectArray val0, jsize val1)
- { return p->GetObjectArrayElement (this, val0, val1); }
-
- void SetObjectArrayElement (jobjectArray val0, jsize val1, jobject obj2)
- { p->SetObjectArrayElement (this, val0, val1, obj2); }
-
- jbooleanArray NewBooleanArray (jsize val0)
- { return p->NewBooleanArray (this, val0); }
-
- jbyteArray NewByteArray (jsize val0)
- { return p->NewByteArray (this, val0); }
-
- jcharArray NewCharArray (jsize val0)
- { return p->NewCharArray (this, val0); }
-
- jshortArray NewShortArray (jsize val0)
- { return p->NewShortArray (this, val0); }
-
- jintArray NewIntArray (jsize val0)
- { return p->NewIntArray (this, val0); }
-
- jlongArray NewLongArray (jsize val0)
- { return p->NewLongArray (this, val0); }
-
- jfloatArray NewFloatArray (jsize val0)
- { return p->NewFloatArray (this, val0); }
-
- jdoubleArray NewDoubleArray (jsize val0)
- { return p->NewDoubleArray (this, val0); }
-
- jboolean * GetBooleanArrayElements (jbooleanArray val0, jboolean * val1)
- { return p->GetBooleanArrayElements (this, val0, val1); }
-
- jbyte * GetByteArrayElements (jbyteArray val0, jboolean * val1)
- { return p->GetByteArrayElements (this, val0, val1); }
-
- jchar * GetCharArrayElements (jcharArray val0, jboolean * val1)
- { return p->GetCharArrayElements (this, val0, val1); }
-
- jshort * GetShortArrayElements (jshortArray val0, jboolean * val1)
- { return p->GetShortArrayElements (this, val0, val1); }
-
- jint * GetIntArrayElements (jintArray val0, jboolean * val1)
- { return p->GetIntArrayElements (this, val0, val1); }
-
- jlong * GetLongArrayElements (jlongArray val0, jboolean * val1)
- { return p->GetLongArrayElements (this, val0, val1); }
-
- jfloat * GetFloatArrayElements (jfloatArray val0, jboolean * val1)
- { return p->GetFloatArrayElements (this, val0, val1); }
-
- jdouble * GetDoubleArrayElements (jdoubleArray val0, jboolean * val1)
- { return p->GetDoubleArrayElements (this, val0, val1); }
-
- void ReleaseBooleanArrayElements (jbooleanArray val0, jboolean * val1, jint val2)
- { p->ReleaseBooleanArrayElements (this, val0, val1, val2); }
-
- void ReleaseByteArrayElements (jbyteArray val0, jbyte * val1, jint val2)
- { p->ReleaseByteArrayElements (this, val0, val1, val2); }
-
- void ReleaseCharArrayElements (jcharArray val0, jchar * val1, jint val2)
- { p->ReleaseCharArrayElements (this, val0, val1, val2); }
-
- void ReleaseShortArrayElements (jshortArray val0, jshort * val1, jint val2)
- { p->ReleaseShortArrayElements (this, val0, val1, val2); }
-
- void ReleaseIntArrayElements (jintArray val0, jint * val1, jint val2)
- { p->ReleaseIntArrayElements (this, val0, val1, val2); }
-
- void ReleaseLongArrayElements (jlongArray val0, jlong * val1, jint val2)
- { p->ReleaseLongArrayElements (this, val0, val1, val2); }
-
- void ReleaseFloatArrayElements (jfloatArray val0, jfloat * val1, jint val2)
- { p->ReleaseFloatArrayElements (this, val0, val1, val2); }
-
- void ReleaseDoubleArrayElements (jdoubleArray val0, jdouble * val1, jint val2)
- { p->ReleaseDoubleArrayElements (this, val0, val1, val2); }
-
- void GetBooleanArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
- { p->GetBooleanArrayRegion (this, val0, val1, val2, val3); }
-
- void GetByteArrayRegion (jbyteArray val0, jsize val1, jsize val2, jbyte * val3)
- { p->GetByteArrayRegion (this, val0, val1, val2, val3); }
-
- void GetCharArrayRegion (jcharArray val0, jsize val1, jsize val2, jchar * val3)
- { p->GetCharArrayRegion (this, val0, val1, val2, val3); }
-
- void GetShortArrayRegion (jshortArray val0, jsize val1, jsize val2, jshort * val3)
- { p->GetShortArrayRegion (this, val0, val1, val2, val3); }
-
- void GetIntArrayRegion (jintArray val0, jsize val1, jsize val2, jint * val3)
- { p->GetIntArrayRegion (this, val0, val1, val2, val3); }
-
- void GetLongArrayRegion (jlongArray val0, jsize val1, jsize val2, jlong * val3)
- { p->GetLongArrayRegion (this, val0, val1, val2, val3); }
-
- void GetFloatArrayRegion (jfloatArray val0, jsize val1, jsize val2, jfloat * val3)
- { p->GetFloatArrayRegion (this, val0, val1, val2, val3); }
-
- void GetDoubleArrayRegion (jdoubleArray val0, jsize val1, jsize val2, jdouble * val3)
- { p->GetDoubleArrayRegion (this, val0, val1, val2, val3); }
-
- void SetBooleanArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
- { p->SetBooleanArrayRegion (this, val0, val1, val2, val3); }
-
- void SetByteArrayRegion (jbyteArray val0, jsize val1, jsize val2, jbyte * val3)
- { p->SetByteArrayRegion (this, val0, val1, val2, val3); }
-
- void SetCharArrayRegion (jcharArray val0, jsize val1, jsize val2, jchar * val3)
- { p->SetCharArrayRegion (this, val0, val1, val2, val3); }
-
- void SetShortArrayRegion (jshortArray val0, jsize val1, jsize val2, jshort * val3)
- { p->SetShortArrayRegion (this, val0, val1, val2, val3); }
-
- void SetIntArrayRegion (jintArray val0, jsize val1, jsize val2, jint * val3)
- { p->SetIntArrayRegion (this, val0, val1, val2, val3); }
-
- void SetLongArrayRegion (jlongArray val0, jsize val1, jsize val2, jlong * val3)
- { p->SetLongArrayRegion (this, val0, val1, val2, val3); }
-
- void SetFloatArrayRegion (jfloatArray val0, jsize val1, jsize val2, jfloat * val3)
- { p->SetFloatArrayRegion (this, val0, val1, val2, val3); }
-
- void SetDoubleArrayRegion (jdoubleArray val0, jsize val1, jsize val2, jdouble * val3)
- { p->SetDoubleArrayRegion (this, val0, val1, val2, val3); }
-
- jint RegisterNatives (jclass cl0, const JNINativeMethod * val1, jint val2)
- { return p->RegisterNatives (this, cl0, val1, val2); }
-
- jint UnregisterNatives (jclass cl0)
- { return p->UnregisterNatives (this, cl0); }
-
- jint MonitorEnter (jobject obj0)
- { return p->MonitorEnter (this, obj0); }
-
- jint MonitorExit (jobject obj0)
- { return p->MonitorExit (this, obj0); }
-
- jint GetJavaVM (JavaVM ** val0)
- { return p->GetJavaVM (this, val0); }
-
- void GetStringRegion (jstring val0, jsize val1, jsize val2, jchar * val3)
- { p->GetStringRegion (this, val0, val1, val2, val3); }
-
- void GetStringUTFRegion (jstring val0, jsize val1, jsize val2, char * val3)
- { p->GetStringUTFRegion (this, val0, val1, val2, val3); }
-
- void * GetPrimitiveArrayCritical (jarray val0, jboolean * val1)
- { return p->GetPrimitiveArrayCritical (this, val0, val1); }
-
- void ReleasePrimitiveArrayCritical (jarray val0, void * val1, jint val2)
- { p->ReleasePrimitiveArrayCritical (this, val0, val1, val2); }
-
- const jchar * GetStringCritical (jstring val0, jboolean * val1)
- { return p->GetStringCritical (this, val0, val1); }
-
- void ReleaseStringCritical (jstring val0, const jchar * val1)
- { p->ReleaseStringCritical (this, val0, val1); }
-
- jweak NewWeakGlobalRef (jobject obj0)
- { return p->NewWeakGlobalRef (this, obj0); }
-
- void DeleteWeakGlobalRef (jweak val0)
- { p->DeleteWeakGlobalRef (this, val0); }
-
- jboolean ExceptionCheck ()
- { return p->ExceptionCheck (this); }
-
- jobject NewDirectByteBuffer (void *addr, jlong capacity)
- { return p->NewDirectByteBuffer (this, addr, capacity); }
-
- void *GetDirectBufferAddress (jobject buf)
- { return p->GetDirectBufferAddress (this, buf); }
-
- jlong GetDirectBufferCapacity (jobject buf)
- { return p->GetDirectBufferCapacity (this, buf); }
-};
-
-#endif /* __cplusplus */
-
-/*
- * Invocation API.
- */
-
-struct JNIInvokeInterface
-{
- void *reserved0;
- void *reserved1;
- void *reserved2;
-
- jint (JNICALL *DestroyJavaVM) (JavaVM *);
- jint (JNICALL *AttachCurrentThread) (JavaVM *, void **, void *);
- jint (JNICALL *DetachCurrentThread) (JavaVM *);
- jint (JNICALL *GetEnv) (JavaVM *, void **, jint);
- jint (JNICALL *AttachCurrentThreadAsDaemon) (JavaVM *, void **, void *);
-};
-
-#ifdef __cplusplus
-
-class _Jv_JavaVM
-{
-public:
- const struct JNIInvokeInterface *functions;
-
- jint DestroyJavaVM ()
- { return functions->DestroyJavaVM (this); }
-
- jint AttachCurrentThread (void **penv, void *args)
- { return functions->AttachCurrentThread (this, penv, args); }
-
- jint DetachCurrentThread ()
- { return functions->DetachCurrentThread (this); }
-
- jint GetEnv (void **penv, jint version)
- { return functions->GetEnv (this, penv, version); }
-
- jint AttachCurrentThreadAsDaemon (void **penv, void *args)
- { return functions->AttachCurrentThreadAsDaemon (this, penv, args); }
-};
-
-#endif /* __cplusplus */
-
-typedef struct JavaVMAttachArgs
-{
- jint version; /* Must be JNI_VERSION_1_2. */
- char *name; /* The name of the thread (or NULL). */
- jobject group; /* Global ref of a ThreadGroup object
- (or NULL). */
-} JavaVMAttachArgs;
-
-typedef struct JavaVMOption
-{
- char *optionString;
- void *extraInfo;
-} JavaVMOption;
-
-typedef struct JavaVMInitArgs
-{
- /* Must be JNI_VERSION_1_2. */
- jint version;
-
- /* Number of options. */
- jint nOptions;
-
- /* Options to the VM. */
- JavaVMOption *options;
-
- /* Whether we should ignore unrecognized options. */
- jboolean ignoreUnrecognized;
-} JavaVMInitArgs;
-
-
-
-/* Keep c-font-lock-extra-types in alphabetical order. */
-/* Local Variables: */
-/* c-font-lock-extra-types: ("\\sw+_t"
- "JNIEnv" "JNINativeMethod" "JavaVM" "JavaVMOption" "jarray"
- "jboolean" "jbooleanArray" "jbyte" "jbyteArray" "jchar" "jcharArray"
- "jclass" "jdouble" "jdoubleArray" "jfieldID" "jfloat" "jfloatArray"
- "jint" "jintArray" "jlong" "jlongArray" "jmethodID" "jobject" "jstring" "jthrowable"
- "jvalue" "jweak") */
-/* End: */
-
-#endif /* _CLASSPATH_JNI_H */
diff --git a/libjava/java/applet/Applet.java b/libjava/java/applet/Applet.java
deleted file mode 100644
index 861aaa95bff..00000000000
--- a/libjava/java/applet/Applet.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/* Applet.java -- Java base applet class
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.applet;
-
-import java.awt.Dimension;
-import java.awt.GraphicsEnvironment;
-import java.awt.HeadlessException;
-import java.awt.Image;
-import java.awt.Panel;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Locale;
-
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleState;
-import javax.accessibility.AccessibleStateSet;
-
-/**
- * This is the base applet class. An applet is a Java program that
- * runs inside a web browser or other applet viewer in a restricted
- * environment.
- *
- * <p>To be useful, a subclass should override at least start(). Also useful
- * are init, stop, and destroy for control purposes, and getAppletInfo and
- * getParameterInfo for descriptive purposes.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status updated to 1.4
- */
-public class Applet extends Panel
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -5836846270535785031L;
-
- /** The applet stub for this applet. */
- private transient AppletStub stub;
-
- /** Some applets call setSize in their constructors. In that case,
- these fields are used to store width and height values until a
- stub is set. */
- private transient int width;
- private transient int height;
-
- /**
- * The accessibility context for this applet.
- *
- * @serial the accessibleContext for this
- * @since 1.2
- */
- private AccessibleContext accessibleContext;
-
- /**
- * Default constructor for subclasses.
- *
- * @throws HeadlessException if in a headless environment
- */
- public Applet()
- {
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException();
- }
-
- /**
- * The browser calls this method to set the applet's stub, which is the
- * low level interface to the browser. Manually setting this to null is
- * asking for problems down the road.
- *
- * @param stub the applet stub for this applet
- */
- public final void setStub(AppletStub stub)
- {
- this.stub = stub;
-
- if (width != 0 && height != 0)
- stub.appletResize (width, height);
- }
-
- /**
- * Tests whether or not this applet is currently active. An applet is active
- * just before the browser invokes start(), and becomes inactive just
- * before the browser invokes stop().
- *
- * @return <code>true</code> if this applet is active
- */
- public boolean isActive()
- {
- return stub.isActive();
- }
-
- /**
- * Returns the basename URL of the document this applet is embedded in. This
- * is everything up to the final '/'.
- *
- * @return the URL of the document this applet is embedded in
- * @see #getCodeBase()
- */
- public URL getDocumentBase()
- {
- return stub.getDocumentBase();
- }
-
- /**
- * Returns the URL of the code base for this applet.
- *
- * @return the URL of the code base for this applet
- */
- public URL getCodeBase()
- {
- return stub.getCodeBase();
- }
-
- /**
- * Returns the value of the specified parameter that was specified in
- * the <code>&lt;APPLET&gt;</code> tag for this applet.
- *
- * @param name the parameter name
- * @return the parameter value, or null if the parameter does not exist
- * @throws NullPointerException if name is null
- */
- public String getParameter(String name)
- {
- return stub.getParameter(name);
- }
-
- /**
- * Returns the applet context for this applet.
- *
- * @return the applet context for this applet
- */
- public AppletContext getAppletContext()
- {
- return stub.getAppletContext();
- }
-
- /**
- * Requests that the applet window for this applet be resized.
- *
- * @param width the new width in pixels
- * @param height the new height in pixels
- */
- public void resize(int width, int height)
- {
- if (stub == null)
- {
- this.width = width;
- this.height = height;
- }
- else
- stub.appletResize(width, height);
- }
-
- /**
- * Requests that the applet window for this applet be resized.
- *
- * @param dim the requested dimensions
- * @throws NullPointerException if dim is null
- */
- public void resize(Dimension dim)
- {
- resize(dim.width, dim.height);
- }
-
- /**
- * Displays the specified message in the status window if that window
- * exists.
- *
- * @param message the status message, may be null
- */
- public void showStatus(String message)
- {
- getAppletContext().showStatus(message);
- }
-
- /**
- * Returns an image from the specified URL. Note that the image is not
- * actually retrieved until the applet attempts to display it, so this
- * method returns immediately.
- *
- * @param url the URL of the image
- * @return the retrieved image
- * @throws NullPointerException if url is null
- */
- public Image getImage(URL url)
- {
- return getAppletContext().getImage(url);
- }
-
- /**
- * Returns an image from the specified absolute URL, and relative path
- * from that URL. Note that the image is not actually retrieved until the
- * applet attempts to display it, so this method returns immediately.
- * This calls <code>getImage(new URL(url, name))</code>, but if building
- * the new URL fails, this returns null.
- *
- * @param url the base URL of the image
- * @param name the name of the image relative to the URL
- * @return the retrieved image, or null on failure
- * @see #getImage(URL)
- */
- public Image getImage(URL url, String name)
- {
- try
- {
- return getImage(new URL(url, name));
- }
- catch (MalformedURLException e)
- {
- return null;
- }
- }
-
- /**
- * Returns an audio clip from the specified URL. This clip is not tied to
- * any particular applet.
- *
- * XXX Classpath does not yet implement this.
- *
- * @param url the URL of the audio clip
- * @return the retrieved audio clip
- * @throws NullPointerException if url is null
- * @see #getAudioClip(URL)
- * @since 1.2
- */
- public static final AudioClip newAudioClip(URL url)
- {
- // This requires an implementation of AudioClip in gnu.java.applet.
- throw new Error("Not implemented");
- }
-
- /**
- * Returns an audio clip from the specified URL. Note that the clip is not
- * actually retrieved until the applet attempts to play it, so this method
- * returns immediately.
- *
- * @param url the URL of the audio clip
- * @return the retrieved audio clip
- * @throws NullPointerException if url is null
- */
- public AudioClip getAudioClip(URL url)
- {
- return getAppletContext().getAudioClip(url);
- }
-
- /**
- * Returns an audio clip from the specified absolute URL, and relative path
- * from that URL. Note that the clip is not actually retrieved until the
- * applet attempts to play it, so this method returns immediately. This
- * calls <code>getAudioClip(new URL(url, name))</code>, but if building
- * the new URL fails, this returns null.
- *
- * @param url the base URL of the audio clip
- * @param name the name of the clip relative to the URL
- * @return the retrieved audio clip, or null on failure
- * @see #getAudioClip(URL)
- */
- public AudioClip getAudioClip(URL url, String name)
- {
- try
- {
- return getAudioClip(new URL(url, name));
- }
- catch (MalformedURLException e)
- {
- return null;
- }
- }
-
- /**
- * Returns a descriptive string with applet defined information. The
- * implementation in this class returns <code>null</code>, so subclasses
- * must override to return information.
- *
- * @return a string describing the author, version, and applet copyright
- */
- public String getAppletInfo()
- {
- return null;
- }
-
- /**
- * Returns the locale for this applet, if it has been set. If no applet
- * specific locale has been set, the default locale is returned.
- *
- * @return the locale for this applet
- * @see Component#setLocale(Locale)
- * @since 1.1
- */
- public Locale getLocale()
- {
- return super.getLocale();
- }
-
- /**
- * Returns a list of parameters this applet supports. Each element of
- * the outer array is an array of three strings with the name of the
- * parameter, the data type or valid values, and a description. This
- * method is optional and the default implementation returns null.
- *
- * @return the list of parameters supported by this applet
- */
- public String[][] getParameterInfo()
- {
- return null;
- }
-
- /**
- * Loads and plays the audio clip pointed to by the specified URL. This does
- * nothing if the URL does not point to a valid audio clip.
- *
- * @param url the URL of the audio clip
- * @throws NullPointerException if url is null
- * @see #getAudioClip(URL)
- */
- public void play(URL url)
- {
- AudioClip ac = getAudioClip(url);
- try
- {
- ac.play();
- }
- catch (Exception ignored)
- {
- }
- }
-
- /**
- * Loads and plays the audio clip pointed to by the specified absolute URL,
- * and relative path from that URL. This does nothing if the URL cannot be
- * constructed, or if it does not point to a valid audio clip.
- *
- * @param url the base URL of the audio clip
- * @param name the name of the audio clip relative to the URL
- * @see #getAudioClip(URL, String)
- * @see #play(URL)
- */
- public void play(URL url, String name)
- {
- try
- {
- getAudioClip(url, name).play();
- }
- catch (Exception ignored)
- {
- }
- }
-
- /**
- * This method is called when the applet is first loaded, before start().
- * The default implementation does nothing; override to do any one-time
- * initialization.
- *
- * @see #start()
- * @see #stop()
- * @see #destroy()
- */
- public void init()
- {
- }
-
- /**
- * This method is called when the applet should start running. This is
- * normally each time a web page containing it is loaded. The default
- * implemention does nothing; override for your applet to be useful.
- *
- * @see #init()
- * @see #stop()
- * @see #destroy()
- */
- public void start()
- {
- }
-
- /**
- * This method is called when the applet should stop running. This is
- * normally when the next web page is loaded. The default implementation
- * does nothing; override for your applet to stop using resources when
- * it is no longer visible, but may be restarted soon.
- *
- * @see #init()
- * @see #start()
- * @see #destroy()
- */
- public void stop()
- {
- }
-
- /**
- * This method is called when the applet is being unloaded. The default
- * implementation does nothing; override for your applet to clean up
- * resources on exit.
- *
- * @see #init()
- * @see #start()
- * @see #stop()
- */
- public void destroy()
- {
- }
-
- /**
- * Gets the AccessibleContext associated with this applet, creating one if
- * necessary. This always returns an instance of {@link AccessibleApplet}.
- *
- * @return the accessibility context of this applet
- * @since 1.3
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleApplet();
- return accessibleContext;
- }
-
- /**
- * Read an applet from an object stream. This checks for a headless
- * environment, then does the normal read.
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if a class is not found
- * @throws IOException if deserialization fails
- * @throws HeadlessException if this is a headless environment
- * @see GraphicsEnvironment#isHeadless()
- * @since 1.4
- */
- private void readObject(ObjectInputStream s)
- throws ClassNotFoundException, IOException
- {
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException();
- s.defaultReadObject();
- }
-
- /**
- * This class provides accessibility support for Applets, and is the
- * runtime type returned by {@link #getAccessibleContext()}.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- */
- protected class AccessibleApplet extends AccessibleAWTPanel
- {
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = 8127374778187708896L;
-
- /**
- * The default constructor.
- */
- protected AccessibleApplet()
- {
- }
-
- /**
- * Get the role of this accessible object, a frame.
- *
- * @return the role of the object
- * @see AccessibleRole#FRAME
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.FRAME;
- }
-
- /**
- * Get the state set of this accessible object. In addition to the default
- * states of a Component, the applet can also be active.
- *
- * @return the role of the object
- * @see AccessibleState
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- AccessibleStateSet s = super.getAccessibleStateSet();
- if (isActive())
- s.add(AccessibleState.ACTIVE);
- return s;
- }
- } // class AccessibleApplet
-} // class Applet
diff --git a/libjava/java/applet/AppletContext.java b/libjava/java/applet/AppletContext.java
deleted file mode 100644
index a17508fd4a4..00000000000
--- a/libjava/java/applet/AppletContext.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/* AppletContext.java -- access the applet's runtime environment
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.applet;
-
-import java.awt.Image;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Iterator;
-
-/**
- * This interface allows an applet access to the browser to retrieve
- * additional data files and display documents. It also allows the
- * applet to find out other applets in the same document.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.0
- * @status updated to 1.4
- */
-public interface AppletContext
-{
- /**
- * Returns an audio clip from the specified URL.
- *
- * @param url the URL of the audio clip
- * @return the retrieved audio clip
- * @throws NullPointerException if url is null
- */
- AudioClip getAudioClip(URL url);
-
- /**
- * Returns an image from the specified URL. Note that the image is not
- * actually retrieved until the applet attempts to display it, so this
- * method returns immediately.
- *
- * @param url the absolute URL of the image
- * @return the retrieved image
- * @throws NullPointerException if url is null
- */
- Image getImage(URL url);
-
- /**
- * Returns the applet in the document for this object that has the
- * specified name.
- *
- * @param name the applet name
- * @return the requested applet, or <code>null</code> if not found
- */
- Applet getApplet(String name);
-
- /**
- * Returns a list of all the applets in the document for this object.
- *
- * @return a list of all the applets
- */
- Enumeration getApplets();
-
- /**
- * Displays the web page pointed to by the specified URL in the window
- * for this object. This page replaces the document that is currently
- * there.
- *
- * @param url the URL of the web page to load; unspecified on an error
- */
- void showDocument(URL url);
-
- /**
- * Displays the web page pointed to be the sepcified URL in the window
- * with the specified name. The standard names "_top", "_blank",
- * "_parent", and "_self" are allowed. An applet viewer may disregard
- * this request.
- *
- * @param url the URL of the web page to load
- * @param target the target window
- */
- void showDocument(URL url, String target);
-
- /**
- * Displays the specified message in the status window if that window
- * exists.
- *
- * @param message the status message, may be null
- */
- void showStatus(String message);
-
- /**
- * Associate a stream to a key for this applet context, possibly replacing
- * the old value. Stream associations are local to the applet context, for
- * security purposes.
- *
- * @param key the key to associate with
- * @param stream the stream value to tie to the key, or null to remove
- * @throws IOException if the stream is too large
- * @since 1.4
- */
- void setStream(String key, InputStream stream) throws IOException;
-
- /**
- * Return the stream associated with a given key in this applet context, or
- * null if nothing is associated. Stream associations are local to the
- * applet context, for security purposes.
- *
- * @param key the key to look up
- * @return the associated stream, or null
- * @since 1.4
- */
- InputStream getStream(String key);
-
- /**
- * Iterate over all keys that have associated streams. Stream associated
- * are local to the applet context, for security purposes.
- *
- * @return an iterator over the association keys
- * @since 1.4
- */
- Iterator getStreamKeys();
-} // interface AppletContext
diff --git a/libjava/java/applet/AppletStub.java b/libjava/java/applet/AppletStub.java
deleted file mode 100644
index 879a01638a5..00000000000
--- a/libjava/java/applet/AppletStub.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* AppletStub.java -- low level interface to the browser
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.applet;
-
-import java.net.URL;
-
-/**
- * This interface is the low level interface between the applet and the
- * browser.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Applet#setStub(AppletStub)
- * @since 1.0
- * @status updated to 1.4
- */
-public interface AppletStub
-{
- /**
- * Tests whether or not this applet is currently active. An applet is active
- * just before the browser invokes start(), and becomes inactive just
- * before the browser invokes stop().
- *
- * @return <code>true</code> if this applet is active
- */
- boolean isActive();
-
- /**
- * Returns the basename URL of the document this applet is embedded in. This
- * is everything up to the final '/'.
- *
- * @return the URL of the document this applet is embedded in
- * @see #getCodeBase()
- */
- URL getDocumentBase();
-
- /**
- * Returns the URL of the code base for this applet.
- *
- * @return the URL of the code base for this applet
- */
- URL getCodeBase();
-
- /**
- * Returns the value of the specified parameter that was specified in
- * the <code>&lt;APPLET&gt;</code> tag for this applet.
- *
- * @param name the parameter name
- * @return the parameter value, or null if the parameter does not exist
- * @throws NullPointerException if name is null
- */
- String getParameter(String name);
-
- /**
- * Returns the applet context for this applet.
- *
- * @return the applet context for this applet
- */
- AppletContext getAppletContext();
-
- /**
- * Requests that the applet window for this applet be resized.
- *
- * @param width the new width in pixels
- * @param height the new height in pixels
- */
- void appletResize(int width, int height);
-} // interface AppletStub
diff --git a/libjava/java/applet/AudioClip.java b/libjava/java/applet/AudioClip.java
deleted file mode 100644
index eeafa8aa7a8..00000000000
--- a/libjava/java/applet/AudioClip.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* AudioClip.java -- play an audio clip in an applet
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.applet;
-
-
-/**
- * This interface provides a simple mechanism for playing audio clips.
- * If multiple clips are played at once, the browser combines them into a
- * composite clip.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.0
- * @status updated to 1.4
- */
-public interface AudioClip
-{
- /**
- * Plays the audio clip starting from the beginning.
- */
- void play();
-
- /**
- * Stops playing this audio clip. There is no mechanism for restarting
- * at the point where the clip is stopped.
- */
- void stop();
-
- /**
- * Plays this audio clip in a continuous loop.
- */
- void loop();
-} // interface AudioClip
diff --git a/libjava/java/awt/AWTError.java b/libjava/java/awt/AWTError.java
deleted file mode 100644
index 80356eee440..00000000000
--- a/libjava/java/awt/AWTError.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* AWTError.java -- A serious AWT error occurred.
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This error is thrown when a critical Abstract Window Toolkit (AWT) error
- * occurs.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class AWTError extends Error
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -1819846354050686206L;
-
- /**
- * Create a new instance with the specified descriptive error message.
- *
- * @param message the descriptive error message
- */
- public AWTError(String message)
- {
- super(message);
- }
-} // class AWTError
diff --git a/libjava/java/awt/AWTEvent.java b/libjava/java/awt/AWTEvent.java
deleted file mode 100644
index b90a9090988..00000000000
--- a/libjava/java/awt/AWTEvent.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/* AWTEvent.java -- the root event in AWT
- Copyright (C) 1999, 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.util.EventObject;
-
-/**
- * AWTEvent is the root event class for all AWT events in the JDK 1.1 event
- * model. It supersedes the Event class from JDK 1.0. Subclasses outside of
- * the java.awt package should have IDs greater than RESERVED_ID_MAX.
- *
- * <p>Event masks defined here are used by components in
- * <code>enableEvents</code> to select event types not selected by registered
- * listeners. Event masks are appropriately set when registering on
- * components.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class AWTEvent extends EventObject
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -1825314779160409405L;
-
- /**
- * The ID of the event.
- *
- * @see #getID()
- * @see #AWTEvent(Object, int)
- * @serial the identifier number of this event
- */
- protected int id;
-
- /**
- * Indicates if the event has been consumed. False mean it is passed to
- * the peer, true means it has already been processed. Semantic events
- * generated by low-level events always have the value true.
- *
- * @see #consume()
- * @see #isConsumed()
- * @serial whether the event has been consumed
- */
- protected boolean consumed;
-
- /**
- * Who knows? It's in the serial version.
- *
- * @serial No idea what this is for.
- */
- byte[] bdata;
-
- /** Mask for selecting component events. */
- public static final long COMPONENT_EVENT_MASK = 0x00001;
-
- /** Mask for selecting container events. */
- public static final long CONTAINER_EVENT_MASK = 0x00002;
-
- /** Mask for selecting component focus events. */
- public static final long FOCUS_EVENT_MASK = 0x00004;
-
- /** Mask for selecting keyboard events. */
- public static final long KEY_EVENT_MASK = 0x00008;
-
- /** Mask for mouse button events. */
- public static final long MOUSE_EVENT_MASK = 0x00010;
-
- /** Mask for mouse motion events. */
- public static final long MOUSE_MOTION_EVENT_MASK = 0x00020;
-
- /** Mask for window events. */
- public static final long WINDOW_EVENT_MASK = 0x00040;
-
- /** Mask for action events. */
- public static final long ACTION_EVENT_MASK = 0x00080;
-
- /** Mask for adjustment events. */
- public static final long ADJUSTMENT_EVENT_MASK = 0x00100;
-
- /** Mask for item events. */
- public static final long ITEM_EVENT_MASK = 0x00200;
-
- /** Mask for text events. */
- public static final long TEXT_EVENT_MASK = 0x00400;
-
- /**
- * Mask for input method events.
- * @since 1.3
- */
- public static final long INPUT_METHOD_EVENT_MASK = 0x00800;
-
- /**
- * Mask if input methods are enabled. Package visible only.
- */
- static final long INPUT_ENABLED_EVENT_MASK = 0x01000;
-
- /**
- * Mask for paint events.
- * @since 1.3
- */
- public static final long PAINT_EVENT_MASK = 0x02000;
-
- /**
- * Mask for invocation events.
- * @since 1.3
- */
- public static final long INVOCATION_EVENT_MASK = 0x04000;
-
- /**
- * Mask for hierarchy events.
- * @since 1.3
- */
- public static final long HIERARCHY_EVENT_MASK = 0x08000;
-
- /**
- * Mask for hierarchy bounds events.
- * @since 1.3
- */
- public static final long HIERARCHY_BOUNDS_EVENT_MASK = 0x10000;
-
- /**
- * Mask for mouse wheel events.
- * @since 1.4
- */
- public static final long MOUSE_WHEEL_EVENT_MASK = 0x20000;
-
- /**
- * Mask for window state events.
- * @since 1.4
- */
- public static final long WINDOW_STATE_EVENT_MASK = 0x40000;
-
- /**
- * Mask for window focus events.
- * @since 1.4
- */
- public static final long WINDOW_FOCUS_EVENT_MASK = 0x80000;
-
- /**
- * This is the highest number for event ids that are reserved for use by
- * the AWT system itself. Subclasses outside of java.awt should use higher
- * ids.
- */
- public static final int RESERVED_ID_MAX = 1999;
-
-
- /**
- * Initializes a new AWTEvent from the old Java 1.0 event object.
- *
- * @param event the old-style event
- * @throws NullPointerException if event is null
- */
- public AWTEvent(Event event)
- {
- this(event.target, event.id);
- consumed = event.consumed;
- }
-
- /**
- * Create an event on the specified source object and id.
- *
- * @param source the object that caused the event
- * @param id the event id
- * @throws IllegalArgumentException if source is null
- */
- public AWTEvent(Object source, int id)
- {
- super(source);
- this.id = id;
- }
-
- /**
- * Retarget the event, such as converting a heavyweight component to a
- * lightweight child of the original. This is not for general use, but
- * is for event targeting systems like KeyboardFocusManager.
- *
- * @param source the new source
- */
- public void setSource(Object source)
- {
- this.source = source;
- }
-
- /**
- * Returns the event type id.
- *
- * @return the id number of this event
- */
- public int getID()
- {
- return id;
- }
-
- /**
- * Create a string that represents this event in the format
- * <code>classname[eventstring] on sourcecomponentname</code>.
- *
- * @return a string representing this event
- */
- public String toString ()
- {
- String string = null;
-
- if (source instanceof Component)
- string = getClass ().getName () + "[" + paramString () + "] on "
- + ((Component) source).getName ();
- else if (source instanceof MenuComponent)
- string = getClass ().getName () + "[" + paramString () + "] on "
- + ((MenuComponent) source).getName ();
- else
- string = getClass ().getName () + "[" + paramString () + "] on "
- + source;
-
- return string;
- }
-
- /**
- * Returns a string representation of the state of this event. It may be
- * empty, but must not be null; it is implementation defined.
- *
- * @return a string representation of this event
- */
- public String paramString()
- {
- return "";
- }
-
- /**
- * Consumes this event so that it will not be processed in the default
- * manner.
- */
- protected void consume()
- {
- consumed = true;
- }
-
- /**
- * Tests whether not not this event has been consumed. A consumed event
- * is not processed in the default manner.
- *
- * @return true if this event has been consumed
- */
- protected boolean isConsumed()
- {
- return consumed;
- }
-} // class AWTEvent
diff --git a/libjava/java/awt/AWTEventMulticaster.java b/libjava/java/awt/AWTEventMulticaster.java
deleted file mode 100644
index f7b9163cf67..00000000000
--- a/libjava/java/awt/AWTEventMulticaster.java
+++ /dev/null
@@ -1,1209 +0,0 @@
-/* AWTEventMulticaster.java -- allows multicast chaining of listeners
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.AdjustmentEvent;
-import java.awt.event.AdjustmentListener;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.ContainerEvent;
-import java.awt.event.ContainerListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.HierarchyBoundsListener;
-import java.awt.event.HierarchyEvent;
-import java.awt.event.HierarchyListener;
-import java.awt.event.InputMethodEvent;
-import java.awt.event.InputMethodListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
-import java.awt.event.TextEvent;
-import java.awt.event.TextListener;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowFocusListener;
-import java.awt.event.WindowListener;
-import java.awt.event.WindowStateListener;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.EventListener;
-
-/**
- * This class is used to implement a chain of event handlers. Dispatching
- * using this class is thread safe. Here is a quick example of how to
- * add and delete listeners using this class. For this example, we will
- * assume are firing <code>AdjustmentEvent</code>'s. However, this
- * same approach is useful for all events in the <code>java.awt.event</code>
- * package, and more if this class is subclassed.
- *
- * <p><code>
- * AdjustmentListener al;
- * public void addAdjustmentListener(AdjustmentListener listener)
- * {
- * al = AWTEventMulticaster.add(al, listener);
- * }
- * public void removeAdjustmentListener(AdjustmentListener listener)
- * {
- * al = AWTEventMulticaster.remove(al, listener);
- * }
- * </code>
- *
- * <p>When it come time to process an event, simply call <code>al</code>,
- * assuming it is not <code>null</code>, and all listeners in the chain will
- * be fired.
- *
- * <p>The first time <code>add</code> is called it is passed
- * <code>null</code> and <code>listener</code> as its arguments. This
- * starts building the chain. This class returns <code>listener</code>
- * which becomes the new <code>al</code>. The next time, <code>add</code>
- * is called with <code>al</code> and <code>listener</code> and the
- * new listener is then chained to the old.
- *
- * @author Bryce McKinlay
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status updated to 1.4
- */
-public class AWTEventMulticaster
- implements ComponentListener, ContainerListener, FocusListener, KeyListener,
- MouseListener, MouseMotionListener, WindowListener,
- WindowFocusListener, WindowStateListener, ActionListener,
- ItemListener, AdjustmentListener, TextListener,
- InputMethodListener, HierarchyListener, HierarchyBoundsListener,
- MouseWheelListener
-{
- /**
- * A variable in the event chain.
- */
- protected final EventListener a;
-
- /**
- * A variable in the event chain.
- */
- protected final EventListener b;
-
- /**
- * Initializes a new instance of <code>AWTEventMulticaster</code> with
- * the specified event listener parameters. The parameters should not be
- * null, although it is not required to enforce this with a
- * NullPointerException.
- *
- * @param a the "a" listener object
- * @param b the "b" listener object
- */
- protected AWTEventMulticaster(EventListener a, EventListener b)
- {
- this.a = a;
- this.b = b;
- }
-
- /**
- * Removes one instance of the specified listener from this multicaster
- * chain. This descends recursively if either child is a multicaster, and
- * returns a multicaster chain with the old listener removed.
- *
- * @param oldl the object to remove from this multicaster
- * @return the resulting multicaster with the specified listener removed
- */
- protected EventListener remove(EventListener oldl)
- {
- // If oldl is an immediate child, return the other child.
- if (a == oldl)
- return b;
- if (b == oldl)
- return a;
- // If a and/or b are Multicaster's, search them recursively.
- if (a instanceof AWTEventMulticaster)
- {
- EventListener newa = ((AWTEventMulticaster) a).remove(oldl);
- if (newa != a)
- return new AWTEventMulticaster(newa, b);
- }
- if (b instanceof AWTEventMulticaster)
- {
- EventListener newb = ((AWTEventMulticaster) b).remove(oldl);
- if (newb != b)
- return new AWTEventMulticaster(a, newb);
- }
- // oldl was not found.
- return this;
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void componentResized(ComponentEvent e)
- {
- ((ComponentListener) a).componentResized(e);
- ((ComponentListener) b).componentResized(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void componentMoved(ComponentEvent e)
- {
- ((ComponentListener) a).componentMoved(e);
- ((ComponentListener) b).componentMoved(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void componentShown(ComponentEvent e)
- {
- ((ComponentListener) a).componentShown(e);
- ((ComponentListener) b).componentShown(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void componentHidden(ComponentEvent e)
- {
- ((ComponentListener) a).componentHidden(e);
- ((ComponentListener) b).componentHidden(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void componentAdded(ContainerEvent e)
- {
- ((ContainerListener) a).componentAdded(e);
- ((ContainerListener) b).componentAdded(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void componentRemoved(ContainerEvent e)
- {
- ((ContainerListener) a).componentRemoved(e);
- ((ContainerListener) b).componentRemoved(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void focusGained(FocusEvent e)
- {
- ((FocusListener) a).focusGained(e);
- ((FocusListener) b).focusGained(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void focusLost(FocusEvent e)
- {
- ((FocusListener) a).focusLost(e);
- ((FocusListener) b).focusLost(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void keyTyped(KeyEvent e)
- {
- ((KeyListener) a).keyTyped(e);
- ((KeyListener) b).keyTyped(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void keyPressed(KeyEvent e)
- {
- ((KeyListener) a).keyPressed(e);
- ((KeyListener) b).keyPressed(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void keyReleased(KeyEvent e)
- {
- ((KeyListener) a).keyReleased(e);
- ((KeyListener) b).keyReleased(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void mouseClicked(MouseEvent e)
- {
- ((MouseListener) a).mouseClicked(e);
- ((MouseListener) b).mouseClicked(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void mousePressed(MouseEvent e)
- {
- ((MouseListener) a).mousePressed(e);
- ((MouseListener) b).mousePressed(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void mouseReleased(MouseEvent e)
- {
- ((MouseListener) a).mouseReleased(e);
- ((MouseListener) b).mouseReleased(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void mouseEntered(MouseEvent e)
- {
- ((MouseListener) a).mouseEntered(e);
- ((MouseListener) b).mouseEntered(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void mouseExited(MouseEvent e)
- {
- ((MouseListener) a).mouseExited(e);
- ((MouseListener) b).mouseExited(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void mouseDragged(MouseEvent e)
- {
- ((MouseMotionListener) a).mouseDragged(e);
- ((MouseMotionListener) b).mouseDragged(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void mouseMoved(MouseEvent e)
- {
- ((MouseMotionListener) a).mouseMoved(e);
- ((MouseMotionListener) b).mouseMoved(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void windowOpened(WindowEvent e)
- {
- ((WindowListener) a).windowOpened(e);
- ((WindowListener) b).windowOpened(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void windowClosing(WindowEvent e)
- {
- ((WindowListener) a).windowClosing(e);
- ((WindowListener) b).windowClosing(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void windowClosed(WindowEvent e)
- {
- ((WindowListener) a).windowClosed(e);
- ((WindowListener) b).windowClosed(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void windowIconified(WindowEvent e)
- {
- ((WindowListener) a).windowIconified(e);
- ((WindowListener) b).windowIconified(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void windowDeiconified(WindowEvent e)
- {
- ((WindowListener) a).windowDeiconified(e);
- ((WindowListener) b).windowDeiconified(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void windowActivated(WindowEvent e)
- {
- ((WindowListener) a).windowActivated(e);
- ((WindowListener) b).windowActivated(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void windowDeactivated(WindowEvent e)
- {
- ((WindowListener) a).windowDeactivated(e);
- ((WindowListener) b).windowDeactivated(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- * @since 1.4
- */
- public void windowStateChanged(WindowEvent e)
- {
- ((WindowStateListener) a).windowStateChanged(e);
- ((WindowStateListener) b).windowStateChanged(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- * @since 1.4
- */
- public void windowGainedFocus(WindowEvent e)
- {
- ((WindowFocusListener) a).windowGainedFocus(e);
- ((WindowFocusListener) b).windowGainedFocus(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- * @since 1.4
- */
- public void windowLostFocus(WindowEvent e)
- {
- ((WindowFocusListener) a).windowLostFocus(e);
- ((WindowFocusListener) b).windowLostFocus(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void actionPerformed(ActionEvent e)
- {
- ((ActionListener) a).actionPerformed(e);
- ((ActionListener) b).actionPerformed(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void itemStateChanged(ItemEvent e)
- {
- ((ItemListener) a).itemStateChanged(e);
- ((ItemListener) b).itemStateChanged(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void adjustmentValueChanged(AdjustmentEvent e)
- {
- ((AdjustmentListener) a).adjustmentValueChanged(e);
- ((AdjustmentListener) b).adjustmentValueChanged(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- */
- public void textValueChanged(TextEvent e)
- {
- ((TextListener) a).textValueChanged(e);
- ((TextListener) b).textValueChanged(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- * @since 1.2
- */
- public void inputMethodTextChanged(InputMethodEvent e)
- {
- ((InputMethodListener) a).inputMethodTextChanged(e);
- ((InputMethodListener) b).inputMethodTextChanged(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- * @since 1.2
- */
- public void caretPositionChanged(InputMethodEvent e)
- {
- ((InputMethodListener) a).caretPositionChanged(e);
- ((InputMethodListener) b).caretPositionChanged(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- * @since 1.3
- */
- public void hierarchyChanged(HierarchyEvent e)
- {
- ((HierarchyListener) a).hierarchyChanged(e);
- ((HierarchyListener) b).hierarchyChanged(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- * @since 1.3
- */
- public void ancestorMoved(HierarchyEvent e)
- {
- ((HierarchyBoundsListener) a).ancestorMoved(e);
- ((HierarchyBoundsListener) b).ancestorMoved(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- * @since 1.3
- */
- public void ancestorResized(HierarchyEvent e)
- {
- ((HierarchyBoundsListener) a).ancestorResized(e);
- ((HierarchyBoundsListener) b).ancestorResized(e);
- }
-
- /**
- * Handles this event by dispatching it to the "a" and "b" listener
- * instances.
- *
- * @param e the event to handle
- * @since 1.4
- */
- public void mouseWheelMoved(MouseWheelEvent e)
- {
- ((MouseWheelListener) a).mouseWheelMoved(e);
- ((MouseWheelListener) b).mouseWheelMoved(e);
- }
-
- /**
- * Chain <code>ComponentListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static ComponentListener add(ComponentListener a, ComponentListener b)
- {
- return (ComponentListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>ContainerListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static ContainerListener add(ContainerListener a, ContainerListener b)
- {
- return (ContainerListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>FocusListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static FocusListener add(FocusListener a, FocusListener b)
- {
- return (FocusListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>KeyListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static KeyListener add(KeyListener a, KeyListener b)
- {
- return (KeyListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>MouseListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static MouseListener add(MouseListener a, MouseListener b)
- {
- return (MouseListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>MouseMotionListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static MouseMotionListener add(MouseMotionListener a,
- MouseMotionListener b)
- {
- return (MouseMotionListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>WindowListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static WindowListener add(WindowListener a, WindowListener b)
- {
- return (WindowListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>WindowStateListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- * @since 1.4
- */
- public static WindowStateListener add(WindowStateListener a,
- WindowStateListener b)
- {
- return (WindowStateListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>WindowFocusListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- * @since 1.4
- */
- public static WindowFocusListener add(WindowFocusListener a,
- WindowFocusListener b)
- {
- return (WindowFocusListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>ActionListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static ActionListener add(ActionListener a, ActionListener b)
- {
- return (ActionListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>ItemListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static ItemListener add(ItemListener a, ItemListener b)
- {
- return (ItemListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>AdjustmentListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static AdjustmentListener add(AdjustmentListener a,
- AdjustmentListener b)
- {
- return (AdjustmentListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>AdjustmentListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- public static TextListener add(TextListener a, TextListener b)
- {
- return (TextListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>InputMethodListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- * @since 1.2
- */
- public static InputMethodListener add(InputMethodListener a,
- InputMethodListener b)
- {
- return (InputMethodListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>HierarchyListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- * @since 1.3
- */
- public static HierarchyListener add(HierarchyListener a, HierarchyListener b)
- {
- return (HierarchyListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>HierarchyBoundsListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- * @since 1.3
- */
- public static HierarchyBoundsListener add(HierarchyBoundsListener a,
- HierarchyBoundsListener b)
- {
- return (HierarchyBoundsListener) addInternal(a, b);
- }
-
- /**
- * Chain <code>MouseWheelListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- * @since 1.4
- */
- public static MouseWheelListener add(MouseWheelListener a,
- MouseWheelListener b)
- {
- return (MouseWheelListener) addInternal(a, b);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static ComponentListener remove(ComponentListener l,
- ComponentListener oldl)
- {
- return (ComponentListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static ContainerListener remove(ContainerListener l,
- ContainerListener oldl)
- {
- return (ContainerListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static FocusListener remove(FocusListener l, FocusListener oldl)
- {
- return (FocusListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static KeyListener remove(KeyListener l, KeyListener oldl)
- {
- return (KeyListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static MouseListener remove(MouseListener l, MouseListener oldl)
- {
- return (MouseListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static MouseMotionListener remove(MouseMotionListener l,
- MouseMotionListener oldl)
- {
- return (MouseMotionListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static WindowListener remove(WindowListener l, WindowListener oldl)
- {
- return (WindowListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- * @since 1.4
- */
- public static WindowStateListener remove(WindowStateListener l,
- WindowStateListener oldl)
- {
- return (WindowStateListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- * @since 1.4
- */
- public static WindowFocusListener remove(WindowFocusListener l,
- WindowFocusListener oldl)
- {
- return (WindowFocusListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static ActionListener remove(ActionListener l, ActionListener oldl)
- {
- return (ActionListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static ItemListener remove(ItemListener l, ItemListener oldl)
- {
- return (ItemListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static AdjustmentListener remove(AdjustmentListener l,
- AdjustmentListener oldl)
- {
- return (AdjustmentListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- public static TextListener remove(TextListener l, TextListener oldl)
- {
- return (TextListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- * @since 1.2
- */
- public static InputMethodListener remove(InputMethodListener l,
- InputMethodListener oldl)
- {
- return (InputMethodListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- * @since 1.3
- */
- public static HierarchyListener remove(HierarchyListener l,
- HierarchyListener oldl)
- {
- return (HierarchyListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- * @since 1.3
- */
- public static HierarchyBoundsListener remove(HierarchyBoundsListener l,
- HierarchyBoundsListener oldl)
- {
- return (HierarchyBoundsListener) removeInternal(l, oldl);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- * @since 1.4
- */
- public static MouseWheelListener remove(MouseWheelListener l,
- MouseWheelListener oldl)
- {
- return (MouseWheelListener) removeInternal(l, oldl);
- }
-
- /**
- * Chain <code>EventListener</code> a and b.
- *
- * @param a the "a" listener, may be null
- * @param b the "b" listener, may be null
- * @return latest entry in the chain
- */
- protected static EventListener addInternal(EventListener a, EventListener b)
- {
- if (a == null)
- return b;
- if (b == null)
- return a;
- return new AWTEventMulticaster(a, b);
- }
-
- /**
- * Removes the listener <code>oldl</code> from the listener <code>l</code>.
- *
- * @param l the listener chain to reduce
- * @param oldl the listener to remove
- * @return the resulting listener chain
- */
- protected static EventListener removeInternal(EventListener l,
- EventListener oldl)
- {
- if (l == oldl)
- return null;
- if (l instanceof AWTEventMulticaster)
- return ((AWTEventMulticaster) l).remove(oldl);
- return l;
- }
-
- /**
- * Saves all Serializable listeners to a serialization stream.
- *
- * @param s the stream to save to
- * @param k a prefix stream put before each serializable listener
- * @throws IOException if serialization fails
- */
- protected void saveInternal(ObjectOutputStream s, String k)
- throws IOException
- {
- // This is not documented by Sun, but I think it is correct.
- if (a instanceof AWTEventMulticaster)
- ((AWTEventMulticaster) a).saveInternal(s, k);
- else if (a instanceof Serializable)
- {
- s.writeObject(k);
- s.writeObject(a);
- }
- if (b instanceof AWTEventMulticaster)
- ((AWTEventMulticaster) b).saveInternal(s, k);
- else if (b instanceof Serializable)
- {
- s.writeObject(k);
- s.writeObject(b);
- }
- }
-
- /**
- * Saves a Serializable listener chain to a serialization stream.
- *
- * @param s the stream to save to
- * @param k a prefix stream put before each serializable listener
- * @param l the listener chain to save
- * @throws IOException if serialization fails
- */
- protected static void save(ObjectOutputStream s, String k, EventListener l)
- throws IOException
- {
- // This is not documented by Sun, but I think it is correct.
- if (l instanceof AWTEventMulticaster)
- ((AWTEventMulticaster) l).saveInternal(s, k);
- else if (l instanceof Serializable)
- {
- s.writeObject(k);
- s.writeObject(l);
- }
- }
-
- /**
- * Returns an array of all chained listeners of the specified type in the
- * given chain. A null listener returns an empty array, and a listener
- * which is not an AWTEventMulticaster returns an array of one element. If
- * no listeners in the chain are of the specified type, an empty array is
- * returned.
- *
- * @param l the listener chain to convert to an array
- * @param type the type of listeners to collect
- * @return an array of the listeners of that type in the chain
- * @throws ClassCastException if type is not assignable from EventListener
- * @throws NullPointerException if type is null
- * @throws IllegalArgumentException if type is Void.TYPE
- * @since 1.4
- */
- public static EventListener[] getListeners(EventListener l, Class type)
- {
- ArrayList list = new ArrayList();
- if (l instanceof AWTEventMulticaster)
- ((AWTEventMulticaster) l).getListeners(list, type);
- else if (type.isInstance(l))
- list.add(l);
- EventListener[] r = (EventListener[]) Array.newInstance(type, list.size());
- list.toArray(r);
- return r;
- }
-
- /**
- * Collects all instances of the given type in the chain into the list.
- *
- * @param l the list to collect into
- * @param type the type of listeners to collect
- * @throws NullPointerException if type is null
- * @see #getListeners(EventListener, Class)
- */
- private void getListeners(ArrayList l, Class type)
- {
- if (a instanceof AWTEventMulticaster)
- ((AWTEventMulticaster) a).getListeners(l, type);
- else if (type.isInstance(a))
- l.add(a);
- if (b instanceof AWTEventMulticaster)
- ((AWTEventMulticaster) b).getListeners(l, type);
- else if (type.isInstance(b))
- l.add(b);
- }
-} // class AWTEventMulticaster
diff --git a/libjava/java/awt/AWTException.java b/libjava/java/awt/AWTException.java
deleted file mode 100644
index 2df3dd80102..00000000000
--- a/libjava/java/awt/AWTException.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* AWTException.java -- Generic AWT exception
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This is a generic exception that indicates an exception occurred in the
- * Abstract Window Toolkit (AWT) system.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class AWTException extends Exception
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -1900414231151323879L;
-
- /**
- * Create a new instance with the specified detailed error message.
- *
- * @param message the detailed error message
- */
- public AWTException(String message)
- {
- super(message);
- }
-} // class AWTException
diff --git a/libjava/java/awt/AWTKeyStroke.java b/libjava/java/awt/AWTKeyStroke.java
deleted file mode 100644
index 01d169366e0..00000000000
--- a/libjava/java/awt/AWTKeyStroke.java
+++ /dev/null
@@ -1,659 +0,0 @@
-/* AWTKeyStroke.java -- an immutable key stroke
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.KeyEvent;
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-/**
- * This class mirrors KeyEvents, representing both low-level key presses and
- * key releases, and high level key typed inputs. However, this class forms
- * immutable strokes, and can be efficiently reused via the factory methods
- * for creating them.
- *
- * <p>For backwards compatibility with Swing, this supports a way to build
- * instances of a subclass, using reflection, provided the subclass has a
- * no-arg constructor (of any accessibility).
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see #getAWTKeyStroke(char)
- * @since 1.4
- * @status updated to 1.4
- */
-public class AWTKeyStroke implements Serializable
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = -6430539691155161871L;
-
- /** The mask for modifiers. */
- private static final int MODIFIERS_MASK = 0x3fef;
-
- /**
- * The cache of recently created keystrokes. This maps KeyStrokes to
- * KeyStrokes in a cache which removes the least recently accessed entry,
- * under the assumption that garbage collection of a new keystroke is
- * easy when we find the old one that it matches in the cache.
- */
- private static final LinkedHashMap cache = new LinkedHashMap(11, 0.75f, true)
- {
- /** The largest the keystroke cache can grow. */
- private static final int MAX_CACHE_SIZE = 2048;
-
- /** Prune stale entries. */
- protected boolean removeEldestEntry(Map.Entry eldest)
- { // XXX - FIXME Use Map.Entry, not just Entry as gcj 3.1 workaround.
- return size() > MAX_CACHE_SIZE;
- }
- };
-
- /** The most recently generated keystroke, or null. */
- private static AWTKeyStroke recent;
-
- /**
- * The no-arg constructor of a subclass, or null to use AWTKeyStroke. Note
- * that this will be left accessible, to get around private access; but
- * it should not be a security risk as it is highly unlikely that creating
- * protected instances of the subclass via reflection will do much damage.
- */
- private static Constructor ctor;
-
- /**
- * A table of keyCode names to values. This is package-private to
- * avoid an accessor method.
- *
- * @see #getAWTKeyStroke(String)
- */
- static final HashMap vktable = new HashMap();
- static
- {
- // Using reflection saves the hassle of keeping this in sync with KeyEvent,
- // at the price of an expensive initialization.
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- Field[] fields = KeyEvent.class.getFields();
- int i = fields.length;
- try
- {
- while (--i >= 0)
- {
- Field f = fields[i];
- String name = f.getName();
- if (name.startsWith("VK_"))
- vktable.put(name.substring(3), f.get(null));
- }
- }
- catch (Exception e)
- {
- throw (Error) new InternalError().initCause(e);
- }
- return null;
- }
- });
- }
-
- /**
- * The typed character, or CHAR_UNDEFINED for key presses and releases.
- *
- * @serial the keyChar
- */
- private char keyChar;
-
- /**
- * The virtual key code, or VK_UNDEFINED for key typed. Package visible for
- * use by Component.
- *
- * @serial the keyCode
- */
- int keyCode;
-
- /**
- * The modifiers in effect. To match Sun, this stores the old style masks
- * for shift, control, alt, meta, and alt-graph (but not button1); as well
- * as the new style of extended modifiers for all modifiers.
- *
- * @serial bitwise or of the *_DOWN_MASK modifiers
- */
- private int modifiers;
-
- /**
- * True if this is a key release; should only be true if keyChar is
- * CHAR_UNDEFINED.
- *
- * @serial true to distinguish key pressed from key released
- */
- private boolean onKeyRelease;
-
- /**
- * Construct a keystroke with default values: it will be interpreted as a
- * key typed event with an invalid character and no modifiers. Client code
- * should use the factory methods instead.
- *
- * @see #getAWTKeyStroke(char)
- * @see #getAWTKeyStroke(Character, int)
- * @see #getAWTKeyStroke(int, int, boolean)
- * @see #getAWTKeyStroke(int, int)
- * @see #getAWTKeyStrokeForEvent(KeyEvent)
- * @see #getAWTKeyStroke(String)
- */
- protected AWTKeyStroke()
- {
- keyChar = KeyEvent.CHAR_UNDEFINED;
- }
-
- /**
- * Construct a keystroke with the given values. Client code should use the
- * factory methods instead.
- *
- * @param keyChar the character entered, if this is a key typed
- * @param keyCode the key pressed or released, or VK_UNDEFINED for key typed
- * @param modifiers the modifier keys for the keystroke, in old or new style
- * @param onKeyRelease true if this is a key release instead of a press
- * @see #getAWTKeyStroke(char)
- * @see #getAWTKeyStroke(Character, int)
- * @see #getAWTKeyStroke(int, int, boolean)
- * @see #getAWTKeyStroke(int, int)
- * @see #getAWTKeyStrokeForEvent(KeyEvent)
- * @see #getAWTKeyStroke(String)
- */
- protected AWTKeyStroke(char keyChar, int keyCode, int modifiers,
- boolean onKeyRelease)
- {
- this.keyChar = keyChar;
- this.keyCode = keyCode;
- // No need to call extend(), as only trusted code calls this constructor.
- this.modifiers = modifiers;
- this.onKeyRelease = onKeyRelease;
- }
-
- /**
- * Registers a new subclass as being the type of keystrokes to generate in
- * the factory methods. This operation flushes the cache of stored keystrokes
- * if the class differs from the current one. The new class must be
- * AWTKeyStroke or a subclass, and must have a no-arg constructor (which may
- * be private).
- *
- * @param subclass the new runtime type of generated keystrokes
- * @throws IllegalArgumentException subclass doesn't have no-arg constructor
- * @throws ClassCastException subclass doesn't extend AWTKeyStroke
- */
- protected static void registerSubclass(final Class subclass)
- {
- if (subclass == null)
- throw new IllegalArgumentException();
- if (subclass.equals(ctor == null ? AWTKeyStroke.class
- : ctor.getDeclaringClass()))
- return;
- if (subclass.equals(AWTKeyStroke.class))
- {
- cache.clear();
- recent = null;
- ctor = null;
- return;
- }
- try
- {
- ctor = (Constructor) AccessController.doPrivileged
- (new PrivilegedExceptionAction()
- {
- public Object run()
- throws NoSuchMethodException, InstantiationException,
- IllegalAccessException, InvocationTargetException
- {
- Constructor c = subclass.getDeclaredConstructor(null);
- c.setAccessible(true);
- // Create a new instance, to make sure that we can, and
- // to cause any ClassCastException.
- AWTKeyStroke dummy = (AWTKeyStroke) c.newInstance(null);
- return c;
- }
- });
- }
- catch (PrivilegedActionException e)
- {
- // e.getCause() will not ever be ClassCastException; that should
- // escape on its own.
- throw (RuntimeException)
- new IllegalArgumentException().initCause(e.getCause());
- }
- cache.clear();
- recent = null;
- }
-
- /**
- * Returns a keystroke representing a typed character.
- *
- * @param keyChar the typed character
- * @return the specified keystroke
- */
- public static AWTKeyStroke getAWTKeyStroke(char keyChar)
- {
- return getAWTKeyStroke(keyChar, KeyEvent.VK_UNDEFINED, 0, false);
- }
-
- /**
- * Returns a keystroke representing a typed character with the given
- * modifiers. Note that keyChar is a <code>Character</code> instead of a
- * <code>char</code> to avoid accidental ambiguity with
- * <code>getAWTKeyStroke(int, int)</code>. The modifiers are the bitwise
- * or of the masks found in {@link InputEvent}; the new style (*_DOWN_MASK)
- * is preferred, but the old style will work.
- *
- * @param keyChar the typed character
- * @param modifiers the modifiers, or 0
- * @return the specified keystroke
- * @throws IllegalArgumentException if keyChar is null
- */
- public static AWTKeyStroke getAWTKeyStroke(Character keyChar, int modifiers)
- {
- if (keyChar == null)
- throw new IllegalArgumentException();
- return getAWTKeyStroke(keyChar.charValue(), KeyEvent.VK_UNDEFINED,
- extend(modifiers), false);
- }
-
- /**
- * Returns a keystroke representing a pressed or released key event, with
- * the given modifiers. The "virtual key" should be one of the VK_*
- * constants in {@link KeyEvent}. The modifiers are the bitwise or of the
- * masks found in {@link InputEvent}; the new style (*_DOWN_MASK) is
- * preferred, but the old style will work.
- *
- * @param keyCode the virtual key
- * @param modifiers the modifiers, or 0
- * @param release true if this is a key release instead of a key press
- * @return the specified keystroke
- */
- public static AWTKeyStroke getAWTKeyStroke(int keyCode, int modifiers,
- boolean release)
- {
- return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, keyCode,
- extend(modifiers), release);
- }
-
- /**
- * Returns a keystroke representing a pressed key event, with the given
- * modifiers. The "virtual key" should be one of the VK_* constants in
- * {@link KeyEvent}. The modifiers are the bitwise or of the masks found
- * in {@link InputEvent}; the new style (*_DOWN_MASK) is preferred, but the
- * old style will work.
- *
- * @param keyCode the virtual key
- * @param modifiers the modifiers, or 0
- * @return the specified keystroke
- */
- public static AWTKeyStroke getAWTKeyStroke(int keyCode, int modifiers)
- {
- return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, keyCode,
- extend(modifiers), false);
- }
-
- /**
- * Returns a keystroke representing what caused the key event.
- *
- * @param event the key event to convert
- * @return the specified keystroke, or null if the event is invalid
- * @throws NullPointerException if event is null
- */
- public static AWTKeyStroke getAWTKeyStrokeForEvent(KeyEvent event)
- {
- switch (event.id)
- {
- case KeyEvent.KEY_TYPED:
- return getAWTKeyStroke(event.getKeyChar(), KeyEvent.VK_UNDEFINED,
- extend(event.getModifiersEx()), false);
- case KeyEvent.KEY_PRESSED:
- return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, event.getKeyCode(),
- extend(event.getModifiersEx()), false);
- case KeyEvent.KEY_RELEASED:
- return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, event.getKeyCode(),
- extend(event.getModifiersEx()), true);
- default:
- return null;
- }
- }
-
- /**
- * Parses a string and returns the keystroke that it represents. The syntax
- * for keystrokes is listed below, with tokens separated by an arbitrary
- * number of spaces:
- * <pre>
- * keyStroke := &lt;modifiers&gt;* ( &lt;typedID&gt; | &lt;codeID&gt; )
- * modifiers := ( shift | control | ctrl | meta | alt
- * | button1 | button2 | button3 )
- * typedID := typed &lt;single Unicode character&gt;
- * codeID := ( pressed | released )? &lt;name&gt;
- * name := &lt;the KeyEvent field name less the leading "VK_"&gt;
- * </pre>
- *
- * <p>Note that the grammar is rather weak, and not all valid keystrokes
- * can be generated in this manner (for example, a typed space, or anything
- * with the alt-graph modifier!). The output of AWTKeyStroke.toString()
- * will not meet the grammar. If pressed or released is not specified,
- * pressed is assumed. Examples:<br>
- * <code>
- * "INSERT" =&gt; getAWTKeyStroke(KeyEvent.VK_INSERT, 0);<br>
- * "control DELETE" =&gt;
- * getAWTKeyStroke(KeyEvent.VK_DELETE, InputEvent.CTRL_MASK);<br>
- * "alt shift X" =&gt; getAWTKeyStroke(KeyEvent.VK_X,
- * InputEvent.ALT_MASK | InputEvent.SHIFT_MASK);<br>
- * "alt shift released X" =&gt; getAWTKeyStroke(KeyEvent.VK_X,
- * InputEvent.ALT_MASK | InputEvent.SHIFT_MASK, true);<br>
- * "typed a" =&gt; getAWTKeyStroke('a');
- * </code>
- *
- * @param s the string to parse
- * @throws IllegalArgumentException if s is null or cannot be parsed
- * @return the specified keystroke
- */
- public static AWTKeyStroke getAWTKeyStroke(String s)
- {
- if (s == null)
- throw new IllegalArgumentException("null argument");
- StringTokenizer t = new StringTokenizer(s, " ");
- if (! t.hasMoreTokens())
- throw new IllegalArgumentException("no tokens '" + s + "'");
- int modifiers = 0;
- boolean released = false;
- String token = null;
- do
- {
- token = t.nextToken();
- if ("shift".equals(token))
- modifiers |= KeyEvent.SHIFT_DOWN_MASK;
- else if ("ctrl".equals(token) || "control".equals(token))
- modifiers |= KeyEvent.CTRL_DOWN_MASK;
- else if ("meta".equals(token))
- modifiers |= KeyEvent.META_DOWN_MASK;
- else if ("alt".equals(token))
- modifiers |= KeyEvent.ALT_DOWN_MASK;
- else if ("button1".equals(token))
- modifiers |= KeyEvent.BUTTON1_DOWN_MASK;
- else if ("button2".equals(token))
- modifiers |= KeyEvent.BUTTON2_DOWN_MASK;
- else if ("button3".equals(token))
- modifiers |= KeyEvent.BUTTON3_DOWN_MASK;
- else if ("typed".equals(token))
- {
- if (t.hasMoreTokens())
- {
- token = t.nextToken();
- if (! t.hasMoreTokens() && token.length() == 1)
- return getAWTKeyStroke(token.charAt(0),
- KeyEvent.VK_UNDEFINED, modifiers,
- false);
- }
- throw new IllegalArgumentException("Invalid 'typed' argument '"
- + s + "'");
- }
- else if ("pressed".equals(token))
- {
- if (t.hasMoreTokens())
- token = t.nextToken();
- break;
- }
- else if ("released".equals(token))
- {
- released = true;
- if (t.hasMoreTokens())
- token = t.nextToken();
- break;
- }
- else
- break;
- }
- while (t.hasMoreTokens());
- // Now token contains the VK name we must parse.
- Integer code = (Integer) vktable.get(token);
- if (code == null)
- throw new IllegalArgumentException("Unknown token '" + token
- + "' in '" + s + "'");
- if (t.hasMoreTokens())
- throw new IllegalArgumentException("Too many tokens: " + s);
- return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, code.intValue(),
- modifiers, released);
- }
-
- /**
- * Returns the character of this keystroke, if it was typed.
- *
- * @return the character value, or CHAR_UNDEFINED
- * @see #getAWTKeyStroke(char)
- */
- public final char getKeyChar()
- {
- return keyChar;
- }
-
- /**
- * Returns the virtual key code of this keystroke, if it was pressed or
- * released. This will be a VK_* constant from KeyEvent.
- *
- * @return the virtual key code value, or VK_UNDEFINED
- * @see #getAWTKeyStroke(int, int)
- */
- public final int getKeyCode()
- {
- return keyCode;
- }
-
- /**
- * Returns the modifiers for this keystroke. This will be a bitwise or of
- * constants from InputEvent; it includes the old style masks for shift,
- * control, alt, meta, and alt-graph (but not button1); as well as the new
- * style of extended modifiers for all modifiers.
- *
- * @return the modifiers
- * @see #getAWTKeyStroke(Character, int)
- * @see #getAWTKeyStroke(int, int)
- */
- public final int getModifiers()
- {
- return modifiers;
- }
-
- /**
- * Tests if this keystroke is a key release.
- *
- * @return true if this is a key release
- * @see #getAWTKeyStroke(int, int, boolean)
- */
- public final boolean isOnKeyRelease()
- {
- return onKeyRelease;
- }
-
- /**
- * Returns the AWT event type of this keystroke. This is one of
- * {@link KeyEvent#KEY_TYPED}, {@link KeyEvent#KEY_PRESSED}, or
- * {@link KeyEvent#KEY_RELEASED}.
- *
- * @return the key event type
- */
- public final int getKeyEventType()
- {
- return keyCode == KeyEvent.VK_UNDEFINED ? KeyEvent.KEY_TYPED
- : onKeyRelease ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED;
- }
-
- /**
- * Returns a hashcode for this key event. It is not documented, but appears
- * to be: <code>(getKeyChar() + 1) * (getKeyCode() + 1)
- * * (getModifiers() + 1) * 2 + (isOnKeyRelease() ? 1 : 2)</code>.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return (keyChar + 1) * (keyCode + 1) * (modifiers + 1) * 2
- + (onKeyRelease ? 1 : 2);
- }
-
- /**
- * Tests two keystrokes for equality.
- *
- * @param o the object to test
- * @return true if it is equal
- */
- public final boolean equals(Object o)
- {
- if (! (o instanceof AWTKeyStroke))
- return false;
- AWTKeyStroke s = (AWTKeyStroke) o;
- return this == o || (keyChar == s.keyChar && keyCode == s.keyCode
- && modifiers == s.modifiers
- && onKeyRelease == s.onKeyRelease);
- }
-
- /**
- * Returns a string representation of this keystroke. For typed keystrokes,
- * this is <code>"keyChar " + KeyEvent.getKeyModifiersText(getModifiers())
- + getKeyChar()</code>; for pressed and released keystrokes, this is
- * <code>"keyCode " + KeyEvent.getKeyModifiersText(getModifiers())
- * + KeyEvent.getKeyText(getKeyCode())
- * + (isOnKeyRelease() ? "-R" : "-P")</code>.
- *
- * @return a string representation
- */
- public String toString()
- {
- if (keyCode == KeyEvent.VK_UNDEFINED)
- return "keyChar " + KeyEvent.getKeyModifiersText(modifiers) + keyChar;
- return "keyCode " + KeyEvent.getKeyModifiersText(modifiers)
- + KeyEvent.getKeyText(keyCode) + (onKeyRelease ? "-R" : "-P");
- }
-
- /**
- * Returns a cached version of the deserialized keystroke, if available.
- *
- * @return a cached replacement
- * @throws ObjectStreamException if something goes wrong
- */
- protected Object readResolve() throws ObjectStreamException
- {
- AWTKeyStroke s = (AWTKeyStroke) cache.get(this);
- if (s != null)
- return s;
- cache.put(this, this);
- return this;
- }
-
- /**
- * Gets the appropriate keystroke, creating one if necessary.
- *
- * @param keyChar the keyChar
- * @param keyCode the keyCode
- * @param modifiers the modifiers
- * @param release true for key release
- * @return the specified keystroke
- */
- private static AWTKeyStroke getAWTKeyStroke(char keyChar, int keyCode,
- int modifiers, boolean release)
- {
- // Check level 0 cache.
- AWTKeyStroke stroke = recent; // Avoid thread races.
- if (stroke != null && stroke.keyChar == keyChar
- && stroke.keyCode == keyCode && stroke.modifiers == modifiers
- && stroke.onKeyRelease == release)
- return stroke;
- // Create a new object, on the assumption that if it has a match in the
- // cache, the VM can easily garbage collect it as it is temporary.
- Constructor c = ctor; // Avoid thread races.
- if (c == null)
- stroke = new AWTKeyStroke(keyChar, keyCode, modifiers, release);
- else
- try
- {
- stroke = (AWTKeyStroke) c.newInstance(null);
- stroke.keyChar = keyChar;
- stroke.keyCode = keyCode;
- stroke.modifiers = modifiers;
- stroke.onKeyRelease = release;
- }
- catch (Exception e)
- {
- throw (Error) new InternalError().initCause(e);
- }
- // Check level 1 cache.
- AWTKeyStroke cached = (AWTKeyStroke) cache.get(stroke);
- if (cached == null)
- cache.put(stroke, stroke);
- else
- stroke = cached;
- return recent = stroke;
- }
-
- /**
- * Converts the modifiers to the appropriate format.
- *
- * @param mod the modifiers to convert
- * @return the adjusted modifiers
- */
- private static int extend(int mod)
- {
- if ((mod & (KeyEvent.SHIFT_MASK | KeyEvent.SHIFT_DOWN_MASK)) != 0)
- mod |= KeyEvent.SHIFT_MASK | KeyEvent.SHIFT_DOWN_MASK;
- if ((mod & (KeyEvent.CTRL_MASK | KeyEvent.CTRL_DOWN_MASK)) != 0)
- mod |= KeyEvent.CTRL_MASK | KeyEvent.CTRL_DOWN_MASK;
- if ((mod & (KeyEvent.META_MASK | KeyEvent.META_DOWN_MASK)) != 0)
- mod |= KeyEvent.META_MASK | KeyEvent.META_DOWN_MASK;
- if ((mod & (KeyEvent.ALT_MASK | KeyEvent.ALT_DOWN_MASK)) != 0)
- mod |= KeyEvent.ALT_MASK | KeyEvent.ALT_DOWN_MASK;
- if ((mod & (KeyEvent.ALT_GRAPH_MASK | KeyEvent.ALT_GRAPH_DOWN_MASK)) != 0)
- mod |= KeyEvent.ALT_GRAPH_MASK | KeyEvent.ALT_GRAPH_DOWN_MASK;
- if ((mod & KeyEvent.BUTTON1_MASK) != 0)
- mod |= KeyEvent.BUTTON1_DOWN_MASK;
- return mod & MODIFIERS_MASK;
- }
-} // class AWTKeyStroke
diff --git a/libjava/java/awt/AWTPermission.java b/libjava/java/awt/AWTPermission.java
deleted file mode 100644
index 3e50c059f88..00000000000
--- a/libjava/java/awt/AWTPermission.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* AWTPermission.java -- AWT related permissions
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.security.BasicPermission;
-
-/**
- * This class implements permissions for AWT. This is a named
- * permission. No actions are defined.
- *
- * <p>The following table provides a list of all the possible AWTPermission
- * permission names with a description of what that permission allows.<br>
- * <table border=1>
- * <tr><th>Permission Name</th><th>Permission Allows</th><th>Risks</th</tr>
- * <tr>
- * <td><code>accessClipboard</code></td>
- * <td>posting and reading the AWT clipboard</td>
- * <td>the clipboard may contain sensitive data</td></tr>
- * <tr>
- * <td><code>accessEventQueue</code></td>
- * <td>access to the AWT event queue</td>
- * <td>malicious code could remove real events and replace them with bogus
- * ones, including simulating the user granting permission</td></tr>
- * <tr>
- * <td><code>listenToAllAWTEvents</code></td>
- * <td>listen to system-wide AWT events</td>
- * <td>malicious code can read passwords entered in an AWT event, and in
- * combination with accessEventQueue, could fake system events</td></tr>
- * <tr>
- * <td><code>showWindowWithoutWarningBanner</code></td>
- * <td>display a window without a banner notification of insecurity</td>
- * <td>malicious code could install a Trojan horse applet that looks like
- * a normal window, and thus steal data like passwords</td></tr>
- * <tr>
- * <td><code>readDisplayPixels</code></td>
- * <td>read back pixels from the display screen</td>
- * <td>malicious code could snoop on the user's actions</td></tr>
- * <tr>
- * <td><code>createRobot</code></td>
- * <td>create an instance of java.awt.Robot</td>
- * <td>these objects can generate events as though they were the user; so
- * malicious code could control the system</td></tr>
- * <tr>
- * <td><code>fullScreenExclusive</code></td>
- * <td>enter full-screen exclusive mode</td>
- * <td>malicious code could masquerade as a trusted program</td></tr>
- * </table>
- *
- * @author Tom Tromey (tromey@redhat.com)
- * @since 1.2
- * @status updated to 1.4
- */
-public final class AWTPermission extends BasicPermission
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 8890392402588814465L;
-
- /**
- * Construct a AWTPermission with the given name.
- *
- * @param name the permission name
- * @throws NullPointerException if name is null
- * @throws IllegalArgumentException if name is invalid
- */
- public AWTPermission(String name)
- {
- super(name);
- }
-
- /**
- * Create a new permission with the specified name. The actions argument
- * is ignored, as AWT permissions have no actions.
- *
- * @param name the permission name
- * @param actions ignored
- * @throws NullPointerException if name is null
- * @throws IllegalArgumentException if name is invalid
- */
- public AWTPermission(String name, String actions)
- {
- super(name);
- }
-} // class AWTPermission
diff --git a/libjava/java/awt/ActiveEvent.java b/libjava/java/awt/ActiveEvent.java
deleted file mode 100644
index e42959fe3d6..00000000000
--- a/libjava/java/awt/ActiveEvent.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ActiveEvent.java -- a self-dispatching event
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * An interface for events which can dispatch themselves in another thread.
- * This has two uses: first, if your code is in a critical section, calling a
- * synchronized method might deadlock. But by using an ActiveEvent to call
- * the second section, it will not obtain the lock until you have left the
- * critical section, avoiding deadlock. The second use is for calling
- * untrusted code. For example, system code should use an ActiveEvent to
- * invoke user code securely.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @since 1.2
- * @status updated to 1.4
- */
-public interface ActiveEvent
-{
- /**
- * Dispatch the event, according to what the event needs done. Invoked
- * automatically if this is placed on the <code>EventDispatchQueue</code>.
- */
- void dispatch();
-} // interface ActiveEvent
diff --git a/libjava/java/awt/Adjustable.java b/libjava/java/awt/Adjustable.java
deleted file mode 100644
index 8f633e91a62..00000000000
--- a/libjava/java/awt/Adjustable.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* Adjustable.java -- Objects with a numeric adjustment scale
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.AdjustmentListener;
-
-/**
- * This interface is for objects that take a numeric value that can be
- * adjusted within a bounded range. For example, a scroll bar.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.0
- * @status updated to 1.4
- */
-public interface Adjustable
-{
- /** Constant for an adjustable object with horizontal orientation. */
- int HORIZONTAL = 0;
-
- /** Constant for an adjustable object with vertical orientation. */
- int VERTICAL = 1;
-
- /** Constant for an adjustable object with no orientation. */
- int NO_ORIENTATION = 2;
-
- /**
- * Returns a constant representing the orientation of the object.
- *
- * @return the orientation of this object
- * @see #HORIZONTAL
- * @see #VERTICAL
- * @see #NO_ORIENTATION
- */
- int getOrientation();
-
- /**
- * Sets the minimum value this object can have.
- *
- * @param minimum the new minimum value
- */
- void setMinimum(int minimum);
-
- /**
- * Returns the minimum value this object can have.
- *
- * @return the minimum value
- */
- int getMinimum();
-
- /**
- * Sets the maximum value this object can have.
- *
- * @param maximum the new maximum value
- */
- void setMaximum(int maximum);
-
- /**
- * Returns the maximum value this object can have.
- *
- * @return the maximum value
- */
- int getMaximum();
-
- /**
- * Sets the increment value for incrementing the value by units.
- *
- * @param increment the unit increment value
- */
- void setUnitIncrement(int increment);
-
- /**
- * Returns the increment value for incrementing the value by units.
- *
- * @return the unit increment value
- */
- int getUnitIncrement();
-
- /**
- * Sets the increment value for incrementing the value by blocks.
- *
- * @param increment the block increment value
- */
- void setBlockIncrement(int increment);
-
- /**
- * Returns the increment value for incrementing the value by blocks.
- *
- * @return the block increment value
- */
- int getBlockIncrement();
-
- /**
- * Sets the length of the indicator for this object to the specified value.
- *
- * @param length the indicator length
- */
- void setVisibleAmount(int length);
-
- /**
- * Returns the length of the indicator for this object.
- *
- * @return the indicator length
- */
- int getVisibleAmount();
-
- /**
- * Sets the current value of the object.
- *
- * @param value the new value
- */
- void setValue(int value);
-
- /**
- * Returns the current value of the object.
- *
- * @return the current value
- */
- int getValue();
-
- /**
- * Adds a listener that will receive adjustment events for this object.
- *
- * @param listener the adjustment listener to add
- * @see java.awt.event.AdjustmentEvent
- */
- void addAdjustmentListener(AdjustmentListener listener);
-
- /**
- * Removes an adjustment listener from this object.
- *
- * @param listener the adjustment listener to remove
- * @see java.awt.event.AdjustmentEvent
- */
- void removeAdjustmentListener(AdjustmentListener listener);
-} // interface Adjustable
diff --git a/libjava/java/awt/AlphaComposite.java b/libjava/java/awt/AlphaComposite.java
deleted file mode 100644
index 435cfd054c3..00000000000
--- a/libjava/java/awt/AlphaComposite.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/* AlphaComposite.java -- provides a context for performing alpha compositing
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.image.ColorModel;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Composite
- * @see CompositeContext
- * @since 1.3
- * @status updated to 1.4 except for createContext, needs documentation
- */
-public final class AlphaComposite implements Composite
-{
- /** Map Long to AlphaComposites. See getInstance for details. */
- private static final LinkedHashMap cache = new LinkedHashMap(11, 0.75f, true)
- {
- /** The largest the alpha composite cache can grow. */
- private static final int MAX_CACHE_SIZE = 2048;
-
- /** Prune stale entries. */
- protected boolean removeEldestEntry(Map.Entry eldest)
- { // XXX - FIXME Use Map.Entry, not just Entry as gcj 3.1 workaround.
- return size() > MAX_CACHE_SIZE;
- }
- };
-
- public static final int CLEAR = 1;
- public static final int SRC = 2;
- public static final int DST = 9;
- public static final int SRC_OVER = 3;
- public static final int DST_OVER = 4;
- public static final int SRC_IN = 5;
- public static final int DST_IN = 6;
- public static final int SRC_OUT = 7;
- public static final int DST_OUT = 8;
- public static final int SRC_ATOP = 10;
- public static final int DST_ATOP = 11;
- public static final int XOR = 12;
- public static final AlphaComposite Clear = getInstance(CLEAR);
- public static final AlphaComposite Src = getInstance(SRC);
- public static final AlphaComposite Dst = getInstance(DST);
- public static final AlphaComposite SrcOver = getInstance(SRC_OVER);
- public static final AlphaComposite DstOver = getInstance(DST_OVER);
- public static final AlphaComposite SrcIn = getInstance(SRC_IN);
- public static final AlphaComposite DstIn = getInstance(DST_IN);
- public static final AlphaComposite SrcOut = getInstance(SRC_OUT);
- public static final AlphaComposite DstOut = getInstance(DST_OUT);
- public static final AlphaComposite SrcAtop = getInstance(SRC_ATOP);
- public static final AlphaComposite DstAtop = getInstance(DST_ATOP);
- public static final AlphaComposite Xor = getInstance(XOR);
-
- private final int rule;
- private final float alpha;
- private AlphaComposite(int rule, float alpha)
- {
- this.rule = rule;
- this.alpha = alpha;
- }
-
- /**
- * Creates an AlphaComposite object with the specified rule.
- *
- * @param rule The compositing rule.
- *
- * @exception IllegalArgumentException If rule is not one of the following:
- * CLEAR, SRC, DST, SRC_OVER, DST_OVER, SRC_IN, DST_IN, SRC_OUT, DST_OUT,
- * SRC_ATOP, DST_ATOP, or XOR.
- */
- public static AlphaComposite getInstance(int rule)
- {
- return getInstance(rule, 1);
- }
-
- /**
- * Creates an AlphaComposite object with the specified rule and the constant
- * alpha to multiply with the alpha of the source. The source is multiplied
- * with the specified alpha before being composited with the destination.
- *
- * @param rule The compositing rule.
- *
- * @exception IllegalArgumentException If rule is not one of the following:
- * CLEAR, SRC, DST, SRC_OVER, DST_OVER, SRC_IN, DST_IN, SRC_OUT, DST_OUT,
- * SRC_ATOP, DST_ATOP, or XOR.
- */
- public static AlphaComposite getInstance(int rule, float alpha)
- {
- if (rule < CLEAR || rule > XOR || ! (alpha >= 0 && alpha <= 1))
- throw new IllegalArgumentException();
- // This long is guaranteed unique for all valid alpha composites.
- Long l = new Long(rule + Double.doubleToLongBits(alpha));
- AlphaComposite a = (AlphaComposite) cache.get(l);
- if (a == null)
- {
- a = new AlphaComposite(rule, alpha);
- cache.put(l, a);
- }
- return a;
- }
- public CompositeContext createContext(ColorModel srcColorModel,
- ColorModel dstColorModel,
- RenderingHints hints)
- {
- // XXX Implement. Sun uses undocumented implementation class
- // sun.java2d.SunCompositeContext.
- throw new Error("not implemented");
- }
- public float getAlpha()
- {
- return alpha;
- }
- public int getRule()
- {
- return rule;
- }
- public int hashCode()
- {
- return 31 * Float.floatToIntBits(alpha) + rule;
- }
- public boolean equals(Object o)
- {
- if (! (o instanceof AlphaComposite))
- return false;
- AlphaComposite a = (AlphaComposite) o;
- return rule == a.rule && alpha == a.alpha;
- }
-} // class AlphaComposite
diff --git a/libjava/java/awt/AttributeValue.java b/libjava/java/awt/AttributeValue.java
deleted file mode 100644
index 080e92e221f..00000000000
--- a/libjava/java/awt/AttributeValue.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* AttributeValue.java -- parent of type-safe enums of attributes
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This class is undocumented by Sun, but it is the parent of several other
- * classes, all of which are type-safe enumerations. This takes care of
- * <code>equals</code>, <code>toString</code>, and <code>hashCode</code>, so
- * that you don't have to (although hashCode is commonly overridden).
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
-class AttributeValue
-{
- /** The value of the enumeration. Package visible for speed. */
- final int value;
-
- /** The list of enumeration names for the given subclass. */
- private final String[] names;
-
- /**
- * Construct a type-safe enumeration element. For example,<br>
- * <pre>
- * class Foo extends AttributeValue
- * {
- * private static final String[] names = { "one", "two" }
- * public static final Foo ONE = new Foo(0);
- * public static final Foo TWO = new Foo(1);
- * private Foo(int value) { super(value, names); }
- * }
- * </pre>
- *
- * @param value the position of this enumeration element, consecutive from 0
- * @param names the constant list of enumeration names for the subclass
- */
- AttributeValue(int value, String[] names)
- {
- this.value = value;
- this.names = names;
- }
-
- /**
- * Returns the hashcode of this element. This is the index of the element
- * in the enumeration. Note that equals defaults to the == relation.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return value;
- }
-
- /**
- * Returns the name of this enumeration element.
- *
- * @return the element name
- */
- public String toString()
- {
- return names[value];
- }
-} // class AttributeValue
diff --git a/libjava/java/awt/BasicStroke.java b/libjava/java/awt/BasicStroke.java
deleted file mode 100644
index bb008e4c791..00000000000
--- a/libjava/java/awt/BasicStroke.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/* BasicStroke.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.util.Arrays;
-
-/**
- * STUB CLASS ONLY
- */
-public class BasicStroke implements Stroke
-{
- public static final int JOIN_MITER = 0;
- public static final int JOIN_ROUND = 1;
- public static final int JOIN_BEVEL = 2;
-
- public static final int CAP_BUTT = 0;
- public static final int CAP_ROUND = 1;
- public static final int CAP_SQUARE = 2;
-
- private final float width;
- private final int cap;
- private final int join;
- private final float limit;
- private final float[] dash;
- private final float phase;
-
- /**
- * Creates a basic stroke.
- *
- * @param width May not be negative .
- * @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE.
- * @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
- * @param miterlimit the limit to trim the miter join. The miterlimit must be
- * greater than or equal to 1.0f.
- * @param dash The array representing the dashing pattern. There must be at
- * least one non-zero entry.
- * @param dashPhase is negative and dash is not null.
- *
- * @exception IllegalArgumentException If one input parameter doesn't meet
- * its needs.
- */
- public BasicStroke(float width, int cap, int join, float miterlimit,
- float[] dash, float dashPhase)
- {
- if (width < 0.0f )
- throw new IllegalArgumentException("width " + width + " < 0");
- else if (cap < CAP_BUTT || cap > CAP_SQUARE)
- throw new IllegalArgumentException("cap " + cap + " out of range ["
- + CAP_BUTT + ".." + CAP_SQUARE + "]");
- else if (miterlimit < 1.0f && join == JOIN_MITER)
- throw new IllegalArgumentException("miterlimit " + miterlimit
- + " < 1.0f while join == JOIN_MITER");
- else if (join < JOIN_MITER || join > JOIN_BEVEL)
- throw new IllegalArgumentException("join " + join + " out of range ["
- + JOIN_MITER + ".." + JOIN_BEVEL
- + "]");
- else if (dashPhase < 0.0f && dash != null)
- throw new IllegalArgumentException("dashPhase " + dashPhase
- + " < 0.0f while dash != null");
- else if (dash != null)
- if (dash.length == 0)
- throw new IllegalArgumentException("dash.length is 0");
- else
- {
- boolean allZero = true;
-
- for ( int i = 0; i < dash.length; ++i)
- {
- if (dash[i] != 0.0f)
- {
- allZero = false;
- break;
- }
- }
-
- if (allZero)
- throw new IllegalArgumentException("all dashes are 0.0f");
- }
-
- this.width = width;
- this.cap = cap;
- this.join = join;
- limit = miterlimit;
- this.dash = dash == null ? null : (float[]) dash.clone();
- phase = dashPhase;
- }
-
- /**
- * Creates a basic stroke.
- *
- * @param width The width of the BasicStroke. May not be negative .
- * @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE.
- * @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
- * @param miterlimit the limit to trim the miter join. The miterlimit must be
- * greater than or equal to 1.0f.
- *
- * @exception IllegalArgumentException If one input parameter doesn't meet
- * its needs.
- */
- public BasicStroke(float width, int cap, int join, float miterlimit)
- {
- this(width, cap, join, miterlimit, null, 0);
- }
-
- /**
- * Creates a basic stroke.
- *
- * @param width The width of the BasicStroke. May not be nehative.
- * @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE.
- * @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
- *
- * @exception IllegalArgumentException If one input parameter doesn't meet
- * its needs.
- * @exception IllegalArgumentException FIXME
- */
- public BasicStroke(float width, int cap, int join)
- {
- this(width, cap, join, 10, null, 0);
- }
-
- /**
- * Creates a basic stroke.
- *
- * @param width The width of the BasicStroke.
- *
- * @exception IllegalArgumentException If width is negative.
- */
- public BasicStroke(float width)
- {
- this(width, CAP_SQUARE, JOIN_MITER, 10, null, 0);
- }
-
- /**
- * Creates a basic stroke.
- */
- public BasicStroke()
- {
- this(1, CAP_SQUARE, JOIN_MITER, 10, null, 0);
- }
-
- public Shape createStrokedShape(Shape s)
- {
- throw new Error("not implemented");
- }
-
- public float getLineWidth()
- {
- return width;
- }
-
- public int getEndCap()
- {
- return cap;
- }
-
- public int getLineJoin()
- {
- return join;
- }
-
- public float getMiterLimit()
- {
- return limit;
- }
-
- public float[] getDashArray()
- {
- return dash;
- }
-
- public float getDashPhase()
- {
- return phase;
- }
-
- /**
- * Returns the hash code for this object. The hash is calculated by
- * xoring the hash, cap, join, limit, dash array and phase values
- * (converted to <code>int</code> first with
- * <code>Float.floatToIntBits()</code> if the value is a
- * <code>float</code>).
- */
- public int hashCode()
- {
- int hash = Float.floatToIntBits(width);
- hash ^= cap;
- hash ^= join;
- hash ^= Float.floatToIntBits(limit);
-
- if (dash != null)
- for (int i = 0; i < dash.length; i++)
- hash ^= Float.floatToIntBits(dash[i]);
-
- hash ^= Float.floatToIntBits(phase);
-
- return hash;
- }
-
- /**
- * Returns true if the given Object is an instance of BasicStroke
- * and the width, cap, join, limit, dash array and phase are all
- * equal.
- */
- public boolean equals(Object o)
- {
- if (! (o instanceof BasicStroke))
- return false;
- BasicStroke s = (BasicStroke) o;
- return width == s.width && cap == s.cap && join == s.join
- && limit == s.limit && Arrays.equals(dash, s.dash) && phase == s.phase;
- }
-} // class BasicStroke
diff --git a/libjava/java/awt/BorderLayout.java b/libjava/java/awt/BorderLayout.java
deleted file mode 100644
index c9eb5dd8c37..00000000000
--- a/libjava/java/awt/BorderLayout.java
+++ /dev/null
@@ -1,731 +0,0 @@
-/* BorderLayout.java -- A layout manager class
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This class implements a layout manager that positions components
- * in certain sectors of the parent container.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public class BorderLayout implements LayoutManager2, java.io.Serializable
-{
-
-/*
- * Static Variables
- */
-
-/**
- * Constant indicating the top of the container
- */
-public static final String NORTH = "North";
-
-/**
- * Constant indicating the bottom of the container
- */
-public static final String SOUTH = "South";
-
-/**
- * Constant indicating the right side of the container
- */
-public static final String EAST = "East";
-
-/**
- * Constant indicating the left side of the container
- */
-public static final String WEST = "West";
-
-/**
- * Constant indicating the center of the container
- */
-public static final String CENTER = "Center";
-
-
- /**
- * The constant indicating the position before the first line of the
- * layout. The exact position depends on the writing system: For a
- * top-to-bottom orientation, it is the same as {@link #NORTH}, for
- * a bottom-to-top orientation, it is the same as {@link #SOUTH}.
- *
- * <p>This constant is an older name for {@link #PAGE_START} which
- * has exactly the same value.
- *
- * @since 1.2
- */
- public static final String BEFORE_FIRST_LINE = "First";
-
-
- /**
- * The constant indicating the position after the last line of the
- * layout. The exact position depends on the writing system: For a
- * top-to-bottom orientation, it is the same as {@link #SOUTH}, for
- * a bottom-to-top orientation, it is the same as {@link #NORTH}.
- *
- * <p>This constant is an older name for {@link #PAGE_END} which
- * has exactly the same value.
- *
- * @since 1.2
- */
- public static final String AFTER_LAST_LINE = "Last";
-
-
- /**
- * The constant indicating the position before the first item of the
- * layout. The exact position depends on the writing system: For a
- * left-to-right orientation, it is the same as {@link #WEST}, for
- * a right-to-left orientation, it is the same as {@link #EAST}.
- *
- * <p>This constant is an older name for {@link #LINE_START} which
- * has exactly the same value.
- *
- * @since 1.2
- */
- public static final String BEFORE_LINE_BEGINS = "Before";
-
-
- /**
- * The constant indicating the position after the last item of the
- * layout. The exact position depends on the writing system: For a
- * left-to-right orientation, it is the same as {@link #EAST}, for
- * a right-to-left orientation, it is the same as {@link #WEST}.
- *
- * <p>This constant is an older name for {@link #LINE_END} which
- * has exactly the same value.
- *
- * @since 1.2
- */
- public static final String AFTER_LINE_ENDS = "After";
-
-
- /**
- * The constant indicating the position before the first line of the
- * layout. The exact position depends on the writing system: For a
- * top-to-bottom orientation, it is the same as {@link #NORTH}, for
- * a bottom-to-top orientation, it is the same as {@link #SOUTH}.
- *
- * @since 1.4
- */
- public static final String PAGE_START = BEFORE_FIRST_LINE;
-
-
- /**
- * The constant indicating the position after the last line of the
- * layout. The exact position depends on the writing system: For a
- * top-to-bottom orientation, it is the same as {@link #SOUTH}, for
- * a bottom-to-top orientation, it is the same as {@link #NORTH}.
- *
- * @since 1.4
- */
- public static final String PAGE_END = AFTER_LAST_LINE;
-
-
- /**
- * The constant indicating the position before the first item of the
- * layout. The exact position depends on the writing system: For a
- * left-to-right orientation, it is the same as {@link #WEST}, for
- * a right-to-left orientation, it is the same as {@link #EAST}.
- *
- * @since 1.4
- */
- public static final String LINE_START = BEFORE_LINE_BEGINS;
-
-
- /**
- * The constant indicating the position after the last item of the
- * layout. The exact position depends on the writing system: For a
- * left-to-right orientation, it is the same as {@link #EAST}, for
- * a right-to-left orientation, it is the same as {@link #WEST}.
- *
- * @since 1.4
- */
- public static final String LINE_END = AFTER_LINE_ENDS;
-
-
-
-// Serialization constant
-private static final long serialVersionUID = -8658291919501921765L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial
- */
-private Component north;
-
-/**
- * @serial
- */
-private Component south;
-
-/**
- * @serial
- */
-private Component east;
-
-/**
- * @serial
- */
-private Component west;
-
-/**
- * @serial
- */
-private Component center;
-
-/**
- * @serial
- */
-private Component firstLine;
-
-/**
- * @serial
- */
-private Component lastLine;
-
-/**
- * @serial
- */
-private Component firstItem;
-
-/**
- * @serial
- */
-private Component lastItem;
-
-/**
- * @serial The horizontal gap between components
- */
-private int hgap;
-
-/**
- * @serial The vertical gap between components
- */
-private int vgap;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>BorderLayout</code> with no
- * horiztonal or vertical gaps between components.
- */
-public
-BorderLayout()
-{
- this(0,0);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>BorderLayout</code> with the
- * specified horiztonal and vertical gaps between components.
- *
- * @param hgap The horizontal gap between components.
- * @param vgap The vertical gap between components.
- */
-public
-BorderLayout(int hgap, int vgap)
-{
- this.hgap = hgap;
- this.vgap = vgap;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * Returns the horitzontal gap value.
- *
- * @return The horitzontal gap value.
- */
-public int
-getHgap()
-{
- return(hgap);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the horizontal gap to the specified value.
- *
- * @param hgap The new horizontal gap.
- */
-public void
-setHgap(int hgap)
-{
- this.hgap = hgap;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the vertical gap value.
- *
- * @return The vertical gap value.
- */
-public int
-getVgap()
-{
- return(vgap);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the vertical gap to the specified value.
- *
- * @param vgap The new vertical gap value.
- */
-public void
-setVgap(int vgap)
-{
- this.vgap = vgap;
-}
-
-/*************************************************************************/
-
-/**
- * Adds a component to the layout in the specified constraint position,
- * which must be one of the string constants defined in this class.
- *
- * @param component The component to add.
- * @param constraints The constraint string.
- *
- * @exception IllegalArgumentException If the constraint object is not
- * a string, or is not one of the specified constants in this class.
- */
-public void
-addLayoutComponent(Component component, Object constraints)
-{
- if (constraints != null && ! (constraints instanceof String))
- throw new IllegalArgumentException("Constraint must be a string");
-
- addLayoutComponent((String) constraints, component);
-}
-
-/*************************************************************************/
-
-/**
- * Adds a component to the layout in the specified constraint position,
- * which must be one of the string constants defined in this class.
- *
- * @param constraints The constraint string.
- * @param component The component to add.
- *
- * @exception IllegalArgumentException If the constraint object is not
- * one of the specified constants in this class.
- *
- * @deprecated This method is deprecated in favor of
- * <code>addLayoutComponent(Component, Object)</code>.
- */
-public void
-addLayoutComponent(String constraints, Component component)
-{
- String str = constraints;
-
- if (str == null || str.equals(CENTER))
- center = component;
- else if (str.equals(NORTH))
- north = component;
- else if (str.equals(SOUTH))
- south = component;
- else if (str.equals(EAST))
- east = component;
- else if (str.equals(WEST))
- west = component;
- else if (str.equals(BEFORE_FIRST_LINE))
- firstLine = component;
- else if (str.equals(AFTER_LAST_LINE))
- lastLine = component;
- else if (str.equals(BEFORE_LINE_BEGINS))
- firstItem = component;
- else if (str.equals(AFTER_LINE_ENDS))
- lastItem = component;
- else
- throw new IllegalArgumentException("Constraint value not valid: " + str);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified component from the layout.
- *
- * @param component The component to remove from the layout.
- */
-public void
-removeLayoutComponent(Component component)
-{
- if (north == component)
- north = null;
- if (south == component)
- south = null;
- if (east == component)
- east = null;
- if (west == component)
- west = null;
- if (center == component)
- center = null;
- if (firstItem == component)
- firstItem = null;
- if (lastItem == component)
- lastItem = null;
- if (firstLine == component)
- firstLine = null;
- if (lastLine == component)
- lastLine = null;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of the specified container using this layout.
- *
- * @param target The container to calculate the minimum size for.
- *
- * @return The minimum size of the container
- */
-public Dimension
-minimumLayoutSize(Container target)
-{
- return calcSize(target, MIN);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of the specified container using this layout.
- *
- * @param target The container to calculate the preferred size for.
- *
- * @return The preferred size of the container
- */
-public Dimension
-preferredLayoutSize(Container target)
-{
- return calcSize(target, PREF);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the maximum size of the specified container using this layout.
- *
- * @param target The container to calculate the maximum size for.
- *
- * @return The maximum size of the container
- */
-public Dimension
-maximumLayoutSize(Container target)
-{
- return calcSize(target, MAX);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the X axis alignment, which is a <code>float</code> indicating
- * where along the X axis this container wishs to position its layout.
- * 0 indicates align to the left, 1 indicates align to the right, and 0.5
- * indicates align to the center.
- *
- * @param parent The parent container.
- *
- * @return The X alignment value.
- */
-public float
-getLayoutAlignmentX(Container parent)
-{
- return(parent.getAlignmentX());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the Y axis alignment, which is a <code>float</code> indicating
- * where along the Y axis this container wishs to position its layout.
- * 0 indicates align to the top, 1 indicates align to the bottom, and 0.5
- * indicates align to the center.
- *
- * @param parent The parent container.
- *
- * @return The Y alignment value.
- */
-public float
-getLayoutAlignmentY(Container parent)
-{
- return(parent.getAlignmentY());
-}
-
-/*************************************************************************/
-
-/**
- * Instructs this object to discard any layout information it might
- * have cached.
- *
- * @param parent The parent container.
- */
-public void
-invalidateLayout(Container parent)
-{
-}
-
-/*************************************************************************/
-
-/**
- * Lays out the specified container according to the constraints
- * in this object.
- *
- * @param target The container to lay out.
- */
-public void
-layoutContainer(Container target)
-{
- synchronized (target.getTreeLock ())
- {
- Insets i = target.getInsets();
-
- ComponentOrientation orient = target.getComponentOrientation ();
- boolean left_to_right = orient.isLeftToRight ();
-
- Component my_north = north;
- Component my_east = east;
- Component my_south = south;
- Component my_west = west;
-
- // Note that we currently don't handle vertical layouts. Neither
- // does JDK 1.3.
- if (firstLine != null)
- my_north = firstLine;
- if (lastLine != null)
- my_south = lastLine;
- if (firstItem != null)
- {
- if (left_to_right)
- my_west = firstItem;
- else
- my_east = firstItem;
- }
- if (lastItem != null)
- {
- if (left_to_right)
- my_east = lastItem;
- else
- my_west = lastItem;
- }
-
- Dimension c = calcCompSize(center, PREF);
- Dimension n = calcCompSize(my_north, PREF);
- Dimension s = calcCompSize(my_south, PREF);
- Dimension e = calcCompSize(my_east, PREF);
- Dimension w = calcCompSize(my_west, PREF);
- Dimension t = target.getSize();
-
- /*
- <-> hgap <-> hgap
- +----------------------------+ }
- |t | } i.top
- | +----------------------+ | --- y1 }
- | |n | |
- | +----------------------+ | } vgap
- | +---+ +----------+ +---+ | --- y2 } }
- | |w | |c | |e | | } hh
- | +---+ +----------+ +---+ | } vgap }
- | +----------------------+ | --- y3 }
- | |s | |
- | +----------------------+ | }
- | | } i.bottom
- +----------------------------+ }
- |x1 |x2 |x3
- <---------------------->
- <--> ww <-->
- i.left i.right
- */
-
- int x1 = i.left;
- int x2 = x1 + w.width + hgap;
- int x3;
- if (t.width <= i.right + e.width)
- x3 = x2 + w.width + hgap;
- else
- x3 = t.width - i.right - e.width;
- int ww = t.width - i.right - i.left;
-
- int y1 = i.top;
- int y2 = y1 + n.height + vgap;
- int midh = Math.max(e.height, Math.max(w.height, c.height));
- int y3;
- if (t.height <= i.bottom + s.height)
- y3 = y2 + midh + vgap;
- else
- y3 = t.height - i.bottom - s.height;
- int hh = y3-y2-vgap;
-
- setBounds(center, x2, y2, x3-x2-hgap, hh);
- setBounds(my_north, x1, y1, ww, n.height);
- setBounds(my_south, x1, y3, ww, s.height);
- setBounds(my_west, x1, y2, w.width, hh);
- setBounds(my_east, x3, y2, e.width, hh);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns a string representation of this layout manager.
- *
- * @return A string representation of this object.
- */
-public String
-toString()
-{
- return getClass().getName() + "[hgap=" + hgap + ",vgap=" + vgap + "]";
-}
-
-private void
-setBounds(Component comp, int x, int y, int w, int h)
-{
- if (comp == null)
- return;
- comp.setBounds(x, y, w, h);
-}
-
-// Some constants for use with calcSize().
-private static final int MIN = 0;
-private static final int MAX = 1;
-private static final int PREF = 2;
-
-private Dimension
-calcCompSize(Component comp, int what)
-{
- if (comp == null || !comp.isVisible())
- return new Dimension(0, 0);
- if (what == MIN)
- return comp.getMinimumSize();
- else if (what == MAX)
- return comp.getMaximumSize();
- return comp.getPreferredSize();
-}
-
-// This is a helper function used to compute the various sizes for
-// this layout.
-private Dimension
-calcSize(Container target, int what)
-{
- synchronized (target.getTreeLock ())
- {
- Insets ins = target.getInsets();
-
- ComponentOrientation orient = target.getComponentOrientation ();
- boolean left_to_right = orient.isLeftToRight ();
-
- Component my_north = north;
- Component my_east = east;
- Component my_south = south;
- Component my_west = west;
-
- // Note that we currently don't handle vertical layouts. Neither
- // does JDK 1.3.
- if (firstLine != null)
- my_north = firstLine;
- if (lastLine != null)
- my_south = lastLine;
- if (firstItem != null)
- {
- if (left_to_right)
- my_west = firstItem;
- else
- my_east = firstItem;
- }
- if (lastItem != null)
- {
- if (left_to_right)
- my_east = lastItem;
- else
- my_west = lastItem;
- }
-
- Dimension ndim = calcCompSize(my_north, what);
- Dimension sdim = calcCompSize(my_south, what);
- Dimension edim = calcCompSize(my_east, what);
- Dimension wdim = calcCompSize(my_west, what);
- Dimension cdim = calcCompSize(center, what);
-
- int width = edim.width + cdim.width + wdim.width + (hgap * 2);
- // check for overflow
- if (width < edim.width || width < cdim.width || width < cdim.width)
- width = Integer.MAX_VALUE;
-
- if (ndim.width > width)
- width = ndim.width;
- if (sdim.width > width)
- width = sdim.width;
-
- width += (ins.left + ins.right);
-
- int height = edim.height;
- if (cdim.height > height)
- height = cdim.height;
- if (wdim.height > height)
- height = wdim.height;
-
- int addedHeight = height + (ndim.height + sdim.height + (vgap * 2)
- + ins.top + ins.bottom);
- // check for overflow
- if (addedHeight < height)
- height = Integer.MAX_VALUE;
- else
- height = addedHeight;
-
- return(new Dimension(width, height));
- }
-}
-} // class BorderLayout
diff --git a/libjava/java/awt/BufferCapabilities.java b/libjava/java/awt/BufferCapabilities.java
deleted file mode 100644
index 7cc49730cdc..00000000000
--- a/libjava/java/awt/BufferCapabilities.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/* BufferCapabilities.java -- double-buffering capabilities descriptor
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * A double-buffering capability descriptor. This class exposes
- * details about the double-buffering algorithms used by image
- * buffers.
- *
- * BufferCapabilities represents algorithms that involve at least two
- * buffers but it can also specify so-called "multi-buffer" schemes
- * involving more than two buffers. This class describes the
- * capabilities of the front and back buffers as well as the results
- * of "flipping" -- that is, what happens when an image is transferred
- * from the back buffer to the front buffer.
- *
- * Flipping may or may not be supported or may be supported only in
- * fullscreen mode. If it is not supported then "blitting" is implied
- * -- that is, the contents of the back buffer are copied using a fast
- * block transfer operation from the back buffer to the front buffer.
- *
- * The front buffer is the one that is displayed.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- *
- * @see BufferStrategy#getCapabilities()
- * @see GraphicsConfiguration#getCapabilities()
- *
- * @since 1.4
- */
-public class BufferCapabilities implements Cloneable
-{
- /**
- * A type-safe enumeration of buffer flipping results.
- *
- * @see AttributeValue
- */
- public static final class FlipContents extends AttributeValue
- {
- /**
- * The names of the different flipping results.
- */
- private static final String[] NAMES
- = { "undefined", "background", "prior", "copied" };
-
- /**
- * The contents of the back buffer are undefined after flipping.
- */
- public static final FlipContents UNDEFINED = new FlipContents(0);
-
- /**
- * The back buffer is cleared with the background color after
- * flipping.
- */
- public static final FlipContents BACKGROUND = new FlipContents(1);
-
- /**
- * The back buffer contains the pre-flipping contents of the front
- * buffer after flipping. In other words a true "flip" has been
- * performed.
- */
- public static final FlipContents PRIOR = new FlipContents(2);
-
- /**
- * The back buffer has the same contents as the front buffer after
- * flipping.
- */
- public static final FlipContents COPIED = new FlipContents(3);
-
- /**
- * Create a new flipping result descriptor.
- *
- * @param value the enumeration value
- */
- private FlipContents(int value)
- {
- super(value, NAMES);
- }
- }
-
- /**
- * Front buffer capabilities descriptor.
- */
- private final ImageCapabilities front;
-
- /**
- * Back buffer capabilities descriptor.
- */
- private final ImageCapabilities back;
-
- /**
- * Describes the results of a "flip" operation.
- */
- private final FlipContents flip;
-
- /**
- * Creates a buffer capabilities object.
- *
- * @param frontCaps front buffer capabilities descriptor
- * @param backCaps back buffer capabilities descriptor
- * @param flip the results of a flip operation or null if
- * flipping is not supported
- *
- * @exception IllegalArgumentException if frontCaps or backCaps is
- * null
- */
- public BufferCapabilities(ImageCapabilities frontCaps,
- ImageCapabilities backCaps,
- FlipContents flip)
- {
- if (frontCaps == null || backCaps == null)
- throw new IllegalArgumentException();
- this.front = frontCaps;
- this.back = backCaps;
- this.flip = flip;
- }
-
- /**
- * Retrieve the front buffer's image capabilities.
- *
- * @return the front buffer's image capabilities
- */
- public ImageCapabilities getFrontBufferCapabilities()
- {
- return front;
- }
-
- /**
- * Retrieve the back buffer's image capabilities.
- *
- * @return the back buffer's image capabilities
- */
- public ImageCapabilities getBackBufferCapabilities()
- {
- return back;
- }
-
- /**
- * Return whether or not flipping is supported.
- *
- * @return true if flipping is supported, false otherwise
- */
- public boolean isPageFlipping()
- {
- return flip != null;
- }
-
- /**
- * Retrieve the result of a flipping operation. If this method
- * returns null then flipping is not supported. This implies that
- * "blitting", a fast block transfer, is used to copy the contents
- * of the back buffer to the front buffer. Other possible return
- * values are:
- * <ul>
- * <li><code>FlipContents.UNDEFINED</code> the contents of the
- * back buffer are undefined after flipping.</li>
- * <li><code>FlipContents.BACKGROUND</code> the contents of the
- * back buffer are cleared to the background color after
- * flipping.</li>
- * <li><code>FlipContents.PRIOR</code> the back buffer contains
- * the pre-flipping contents of the front * buffer after
- * flipping.</li>
- * <li><code>FlipContents.COPIED</code> the back buffer has the
- * same contents as the front buffer after flipping.</li>
- * </ul>
- *
- * @return the result of a flipping operation or null if flipping is
- * not supported
- */
- public FlipContents getFlipContents()
- {
- return flip;
- }
-
- /**
- * Returns true if flipping is only supported in fullscreen mode.
- *
- * @return true if flipping is only supported in fullscreen mode,
- * false otherwise
- */
- public boolean isFullScreenRequired()
- {
- return true;
- }
-
- /**
- * Returns true if flipping can involve more than two buffers. One
- * or more intermediate buffers may be available in addition to the
- * front and back buffers.
- *
- * @return true if there are more than two buffers available for
- * flipping, false otherwise
- */
- public boolean isMultiBufferAvailable()
- {
- return false;
- }
-
- /**
- * Clone this buffering capability descriptor.
- *
- * @return a clone of this buffer capability descriptor
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e);
- }
- }
-}
diff --git a/libjava/java/awt/Button.java b/libjava/java/awt/Button.java
deleted file mode 100644
index 90be1e5b111..00000000000
--- a/libjava/java/awt/Button.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/* Button.java -- AWT button widget
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.peer.ButtonPeer;
-import java.lang.reflect.Array;
-import java.util.EventListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleAction;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleValue;
-
-/**
- * This class provides a button widget for the AWT.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- */
-public class Button extends Component
- implements java.io.Serializable, Accessible
-{
-
-/*
- * Static Variables
- */
-
-// FIXME: Need readObject/writeObject for serialization
-
-// Serialization version constant
-private static final long serialVersionUID = -8774683716313001058L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The action command name for this button.
- * This is package-private to avoid an accessor method.
- */
-String actionCommand;
-
-/**
- * @serial The label for this button.
- * This is package-private to avoid an accessor method.
- */
-String label;
-
-// List of ActionListeners for this class.
-private transient ActionListener action_listeners;
-
- /*
- * The number used to generate the name returned by getName.
- */
- private static transient long next_button_number;
-
- protected class AccessibleAWTButton extends AccessibleAWTComponent
- implements AccessibleAction, AccessibleValue
- {
- protected AccessibleAWTButton()
- {
- // Do nothing here.
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleAction#getAccessibleActionCount()
- */
- public int getAccessibleActionCount()
- {
- // Only 1 action possible
- return 1;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleAction#getAccessibleActionDescription(int)
- */
- public String getAccessibleActionDescription(int i)
- {
- // JDK 1.4.2 returns the string "click" for action 0. However, the API
- // docs don't say what the string to be returned is, beyond being a
- // description of the action. So we return the same thing for
- // compatibility with 1.4.2.
- if (i == 0)
- return "click";
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleAction#doAccessibleAction(int)
- */
- public boolean doAccessibleAction(int i)
- {
- if (i != 0)
- return false;
- processActionEvent(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, actionCommand));
- return true;
- }
-
- public String getAccessibleName()
- {
- return label;
- }
-
- public AccessibleAction getAccessibleAction()
- {
- return this;
- }
-
- public AccessibleValue getAccessibleValue()
- {
- return this;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
- */
- public Number getCurrentAccessibleValue()
- {
- // Docs say return 1 if selected, but buttons can't be selected, right?
- return new Integer(0);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#setCurrentAccessibleValue(java.lang.Number)
- */
- public boolean setCurrentAccessibleValue(Number number)
- {
- // Since there's no selection with buttons, we're ignoring this.
- // TODO someone who knows shoulw check this.
- return false;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
- */
- public Number getMinimumAccessibleValue()
- {
- return new Integer(0);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
- */
- public Number getMaximumAccessibleValue()
- {
- return new Integer(0);
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.PUSH_BUTTON;
- }
- }
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>Button</code> with no label.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true
- */
-public
-Button()
-{
- this("");
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Button</code> with the specified
- * label. The action command name is also initialized to this value.
- *
- * @param label The label to display on the button.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true
- */
-public
-Button(String label)
-{
- this.label = label;
- actionCommand = label;
-
- if (GraphicsEnvironment.isHeadless ())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * Returns the label for this button.
- *
- * @return The label for this button.
- */
-public String
-getLabel()
-{
- return(label);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the label for this button to the specified value.
- *
- * @param label The new label for this button.
- */
-public synchronized void
-setLabel(String label)
-{
- this.label = label;
- actionCommand = label;
- if (peer != null)
- {
- ButtonPeer bp = (ButtonPeer) peer;
- bp.setLabel (label);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns the action command name for this button.
- *
- * @return The action command name for this button.
- */
-public String
-getActionCommand()
-{
- return(actionCommand);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the action command name for this button to the specified value.
- *
- * @param actionCommand The new action command name.
- */
-public void
-setActionCommand(String actionCommand)
-{
- this.actionCommand = actionCommand == null ? label : actionCommand;
-}
-
-/*************************************************************************/
-
-/**
- * Adds a new entry to the list of listeners that will receive
- * action events from this button.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.add(action_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified listener from the list of listeners that will
- * receive action events from this button.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.remove(action_listeners, listener);
-}
-
- /**
- * Returns all added <code>ActionListener</code> objects.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public synchronized ActionListener[] getActionListeners()
- {
- return (ActionListener[])
- AWTEventMulticaster.getListeners(action_listeners,
- ActionListener.class);
- }
-
-/**
- * Returns all registered EventListers of the given listenerType.
- * listenerType must be a subclass of EventListener, or a
- * ClassClassException is thrown.
- *
- * @param listenerType the listener type to return
- *
- * @return an array of listeners
- *
- * @exception ClassCastException If listenerType doesn't specify a class or
- * interface that implements @see java.util.EventListener.
- *
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerType)
- {
- if (listenerType == ActionListener.class)
- return getActionListeners();
- return (EventListener[]) Array.newInstance(listenerType, 0);
- }
-
-/*************************************************************************/
-
-/**
- * Notifies this button that it should create its native peer object.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createButton (this);
- super.addNotify();
-}
-
-/*************************************************************************/
-
-/**
- * Processes an event for this button. If the specified event is an
- * instance of <code>ActionEvent</code>, then the
- * <code>processActionEvent()</code> method is called to dispatch it
- * to any registered listeners. Otherwise, the superclass method
- * will be invoked. Note that this method will not be called at all
- * unless <code>ActionEvent</code>'s are enabled. This will be done
- * implicitly if any listeners are added.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof ActionEvent)
- processActionEvent((ActionEvent)event);
- else
- super.processEvent(event);
-}
-
-/*************************************************************************/
-
-/**
- * This method dispatches an action event for this button to any
- * registered listeners.
- *
- * @param event The event to process.
- */
-protected void
-processActionEvent(ActionEvent event)
-{
- if (action_listeners != null)
- action_listeners.actionPerformed(event);
-}
-
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= ActionEvent.ACTION_LAST
- && e.id >= ActionEvent.ACTION_FIRST
- && (action_listeners != null
- || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this button.
- *
- * @return A debugging string for this button.
- */
-protected String
-paramString()
-{
- return getName () + "," + getX () + "," + getY () + ","
- + getWidth () + "x" + getHeight () + ",label=" + getLabel ();
-}
-
-/**
- * Gets the AccessibleContext associated with this <code>Button</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
-public AccessibleContext getAccessibleContext()
-{
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTButton();
- return accessibleContext;
-}
-
- /**
- * Generate a unique name for this button.
- *
- * @return A unique name for this button.
- */
- String generateName ()
- {
- return "button" + getUniqueLong ();
- }
-
- private static synchronized long getUniqueLong ()
- {
- return next_button_number++;
- }
-
-} // class Button
-
diff --git a/libjava/java/awt/Canvas.java b/libjava/java/awt/Canvas.java
deleted file mode 100644
index 79f836edca3..00000000000
--- a/libjava/java/awt/Canvas.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/* Canvas.java --
- Copyright (C) 1999, 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.image.BufferStrategy;
-import java.awt.peer.ComponentPeer;
-import java.io.Serializable;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * The <code>Canvas</code> component provides a blank rectangular
- * area, which the client application can use for drawing and for
- * capturing events. By overriding the <code>paint()</code> method,
- * the canvas can be used for anything from simple line drawings to
- * full-scale custom components.
- *
- * @author Original author unknown
- * @author Tom Tromey (tromey@redhat.com)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.0
- */
-
-public class Canvas
- extends Component
- implements Serializable, Accessible
-{
-
- /**
- * Compatible with Sun's JDK.
- */
- private static final long serialVersionUID = -2284879212465893870L;
-
- /**
- * The graphics configuration associated with the canvas.
- */
- transient GraphicsConfiguration graphicsConfiguration;
-
- /**
- * The buffer strategy associated with this canvas.
- */
- transient BufferStrategy bufferStrategy;
-
- /**
- * Initializes a new instance of <code>Canvas</code>.
- */
- public Canvas()
- {
- }
-
- /**
- * Initializes a new instance of <code>Canvas</code>
- * with the supplied graphics configuration.
- *
- * @param graphicsConfiguration the graphics configuration to use
- * for this particular canvas.
- */
- public Canvas(GraphicsConfiguration graphicsConfiguration)
- {
- this.graphicsConfiguration = graphicsConfiguration;
- }
-
- GraphicsConfiguration getGraphicsConfigurationImpl()
- {
- if (graphicsConfiguration != null)
- return graphicsConfiguration;
- return super.getGraphicsConfigurationImpl();
- }
-
- /**
- * Creates the native peer for this object.
- */
- public void addNotify()
- {
- if (peer == null)
- peer = (ComponentPeer) getToolkit().createCanvas(this);
- super.addNotify();
- }
-
- /**
- * Repaints the canvas window. This method should be overridden by
- * a subclass to do something useful, as this method simply paints
- * the window with the background color.
- *
- * @param gfx the <code>Graphics</code> to use for painting
- */
- public void paint(Graphics gfx)
- {
- /* This implementation doesn't make much sense since the filling
- of background color is guaranteed for heavyweight components
- such as this. But there's no need to worry, since paint() is
- usually overridden anyway. */
- gfx.setColor(getBackground());
- Dimension size = getSize();
- gfx.fillRect(0, 0, size.width, size.height);
- }
-
- /**
- * This class provides accessibility support for the canvas.
- */
- protected class AccessibleAWTCanvas
- extends AccessibleAWTComponent
- {
- /**
- * For compatability with Sun's JDK
- */
- private static final long serialVersionUID = -6325592262103146699L;
-
- /**
- * Constructor for the accessible canvas.
- */
- protected AccessibleAWTCanvas()
- {
- }
-
- /**
- * Returns the accessible role for the canvas.
- *
- * @return an instance of <code>AccessibleRole</code>, describing
- * the role of the canvas.
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.CANVAS;
- }
-
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>Canvas</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTCanvas();
- return accessibleContext;
- }
-
- /**
- * A BltBufferStrategy for canvases.
- */
- private class CanvasBltBufferStrategy extends BltBufferStrategy
- {
- /**
- * Creates a block transfer strategy for this canvas.
- *
- * @param numBuffers the number of buffers in this strategy
- * @param accelerated true if the buffer should be accelerated,
- * false otherwise
- */
- CanvasBltBufferStrategy(int numBuffers, boolean accelerated)
- {
- super(numBuffers,
- new BufferCapabilities(new ImageCapabilities(accelerated),
- new ImageCapabilities(accelerated),
- BufferCapabilities.FlipContents.COPIED));
- }
- }
-
- /**
- * A FlipBufferStrategy for canvases.
- */
- private class CanvasFlipBufferStrategy extends FlipBufferStrategy
- {
- /**
- * Creates a flip buffer strategy for this canvas.
- *
- * @param numBuffers the number of buffers in this strategy
- *
- * @throws AWTException if the requested number of buffers is not
- * supported
- */
- CanvasFlipBufferStrategy(int numBuffers)
- throws AWTException
- {
- super(numBuffers,
- new BufferCapabilities(new ImageCapabilities(true),
- new ImageCapabilities(true),
- BufferCapabilities.FlipContents.COPIED));
- }
- }
-
- /**
- * Creates a buffering strategy that manages how this canvas is
- * repainted. This method attempts to create the optimum strategy
- * based on the desired number of buffers. Hardware or software
- * acceleration may be used.
- *
- * createBufferStrategy attempts different levels of optimization,
- * but guarantees that some strategy with the requested number of
- * buffers will be created even if it is not optimal. First it
- * attempts to create a page flipping strategy, then an accelerated
- * blitting strategy, then an unaccelerated blitting strategy.
- *
- * Calling this method causes any existing buffer strategy to be
- * destroyed.
- *
- * @param numBuffers the number of buffers in this strategy
- *
- * @throws IllegalArgumentException if requested number of buffers
- * is less than one
- * @throws IllegalStateException if this canvas is not displayable
- *
- * @since 1.4
- */
- public void createBufferStrategy(int numBuffers)
- {
- if (numBuffers < 1)
- throw new IllegalArgumentException("Canvas.createBufferStrategy: number"
- + " of buffers is less than one");
-
- if (!isDisplayable())
- throw new IllegalStateException("Canvas.createBufferStrategy: canvas is"
- + " not displayable");
-
- // try a flipping strategy
- try
- {
- bufferStrategy = new CanvasFlipBufferStrategy(numBuffers);
- return;
- }
- catch (AWTException e)
- {
- }
-
- // try an accelerated blitting strategy
- try
- {
- bufferStrategy = new CanvasBltBufferStrategy(numBuffers, true);
- }
- catch (AWTException e)
- {
- }
-
- // fall back to an unaccelerated blitting strategy
- try
- {
- bufferStrategy = new CanvasBltBufferStrategy(numBuffers, false);
- }
- catch (AWTException e)
- {
- }
- }
-
- /**
- * Creates a buffering strategy that manages how this canvas is
- * repainted. This method attempts to create a strategy based on
- * the specified capabilities and throws an exception if the
- * requested strategy is not supported.
- *
- * Calling this method causes any existing buffer strategy to be
- * destroyed.
- *
- * @param numBuffers the number of buffers in this strategy
- * @param caps the requested buffering capabilities
- *
- * @throws AWTException if the requested capabilities are not
- * supported
- * @throws IllegalArgumentException if requested number of buffers
- * is less than one or if caps is null
- *
- * @since 1.4
- */
- public void createBufferStrategy(int numBuffers,
- BufferCapabilities caps)
- {
- if (numBuffers < 1)
- throw new IllegalArgumentException("Canvas.createBufferStrategy: number"
- + " of buffers is less than one");
-
- if (caps == null)
- throw new IllegalArgumentException("Canvas.createBufferStrategy:"
- + " capabilities object is null");
-
- // a flipping strategy was requested
- if (caps.isPageFlipping())
- {
- try
- {
- bufferStrategy = new CanvasFlipBufferStrategy(numBuffers);
- }
- catch (AWTException e)
- {
- }
- }
- else
- bufferStrategy = new CanvasBltBufferStrategy(numBuffers, true);
- }
-
- /**
- * Returns the buffer strategy used by the canvas.
- *
- * @return the buffer strategy.
- * @since 1.4
- */
- public BufferStrategy getBufferStrategy()
- {
- return bufferStrategy;
- }
-
- /**
- * Updates the canvas in response to a request to
- * <code>repaint()</code> it. The canvas is cleared
- * with the current background colour, before <code>paint()</code>
- * is called to add the new contents. Subclasses
- * which override this method should either call this
- * method via <code>super.update(graphics)</code> or re-implement
- * this behaviour, so as to ensure that the canvas is
- * clear before painting takes place.
- *
- * @param graphics the graphics context.
- */
- public void update(Graphics graphics)
- {
- Dimension size;
-
- /* Clear the canvas */
- size = getSize();
- graphics.clearRect(0, 0, size.width, size.height);
- /* Call the paint method */
- paint(graphics);
- }
-}
diff --git a/libjava/java/awt/CardLayout.java b/libjava/java/awt/CardLayout.java
deleted file mode 100644
index 8582c5f099b..00000000000
--- a/libjava/java/awt/CardLayout.java
+++ /dev/null
@@ -1,483 +0,0 @@
-/* CardLayout.java -- Card-based layout engine
- Copyright (C) 1999, 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-/**
- * This class implements a card-based layout scheme. Each included
- * component is treated as a card. Only one card can be shown at a
- * time. This class includes methods for changing which card is
- * shown.
- *
- * @author Tom Tromey (tromey@redhat.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class CardLayout implements LayoutManager2, Serializable
-{
- private static final long serialVersionUID = -4328196481005934313L;
-
- /**
- * Initializes a new instance of <code>CardLayout</code> with horizontal
- * and vertical gaps of 0.
- */
- public CardLayout ()
- {
- this (0, 0);
- }
-
- /**
- * Create a new <code>CardLayout</code> object with the specified
- * horizontal and vertical gaps.
- *
- * @param hgap The horizontal gap
- * @param vgap The vertical gap
- */
- public CardLayout (int hgap, int vgap)
- {
- this.hgap = hgap;
- this.vgap = vgap;
- this.tab = new Hashtable ();
- }
-
- /**
- * Add a new component to the layout. The constraint must be a
- * string which is used to name the component. This string can
- * later be used to refer to the particular component.
- *
- * @param comp The component to add
- * @param constraints The name by which the component can later be called
- *
- * @exception IllegalArgumentException If `constraints' is not a
- * <code>String</code>
- */
- public void addLayoutComponent (Component comp, Object constraints)
- {
- if (! (constraints instanceof String))
- throw new IllegalArgumentException ("Object " + constraints
- + " is not a string");
- addLayoutComponent ((String) constraints, comp);
- }
-
- /**
- * Add a new component to the layout. The name can be used later
- * to refer to the component.
- *
- * @param name The name by which the component can later be called
- * @param comp The component to add
- *
- * @deprecated This method is deprecated in favor of
- * <code>addLayoutComponent(Component, Object)</code>.
- */
- public void addLayoutComponent (String name, Component comp)
- {
- tab.put (name, comp);
- // First component added is the default component.
- comp.setVisible(tab.size() == 1);
- }
-
- /**
- * Cause the first component in the container to be displayed.
- *
- * @param parent The parent container
- */
- public void first (Container parent)
- {
- gotoComponent (parent, FIRST);
- }
-
- /**
- * Return this layout manager's horizontal gap.
- *
- * @return the horizontal gap
- */
- public int getHgap ()
- {
- return hgap;
- }
-
- /**
- * Return this layout manager's x alignment. This method always
- * returns Component.CENTER_ALIGNMENT.
- *
- * @param parent Container using this layout manager instance
- *
- * @return the x-axis alignment
- */
- public float getLayoutAlignmentX (Container parent)
- {
- return Component.CENTER_ALIGNMENT;
- }
-
- /**
- * Returns this layout manager's y alignment. This method always
- * returns Component.CENTER_ALIGNMENT.
- *
- * @param parent Container using this layout manager instance
- *
- * @return the y-axis alignment
- */
- public float getLayoutAlignmentY (Container parent)
- {
- return Component.CENTER_ALIGNMENT;
- }
-
- /**
- * Return this layout manager's vertical gap.
- *
- * @return the vertical gap
- */
- public int getVgap ()
- {
- return vgap;
- }
-
- /**
- * Invalidate this layout manager's state.
- */
- public void invalidateLayout (Container target)
- {
- // Do nothing.
- }
-
- /**
- * Cause the last component in the container to be displayed.
- *
- * @param parent The parent container
- */
- public void last (Container parent)
- {
- gotoComponent (parent, LAST);
- }
-
- /**
- * Lays out the container. This is done by resizing the child components
- * to be the same size as the parent, less insets and gaps.
- *
- * @param parent The parent container.
- */
- public void layoutContainer (Container parent)
- {
- synchronized (parent.getTreeLock ())
- {
- int width = parent.width;
- int height = parent.height;
-
- Insets ins = parent.getInsets ();
-
- int num = parent.ncomponents;
- Component[] comps = parent.component;
-
- int x = ins.left + hgap;
- int y = ins.top + vgap;
- width = width - 2 * hgap - ins.left - ins.right;
- height = height - 2 * vgap - ins.top - ins.bottom;
-
- for (int i = 0; i < num; ++i)
- comps[i].setBounds (x, y, width, height);
- }
- }
-
- /**
- * Get the maximum layout size of the container.
- *
- * @param target The parent container
- *
- * @return the maximum layout size
- */
- public Dimension maximumLayoutSize (Container target)
- {
- // The JCL says that this returns Integer.MAX_VALUE for both
- // dimensions. But that just seems wrong to me.
- return getSize (target, MAX);
- }
-
- /**
- * Get the minimum layout size of the container.
- *
- * @param target The parent container
- *
- * @return the minimum layout size
- */
- public Dimension minimumLayoutSize (Container target)
- {
- return getSize (target, MIN);
- }
-
- /**
- * Cause the next component in the container to be displayed. If
- * this current card is the last one in the deck, the first
- * component is displayed.
- *
- * @param parent The parent container
- */
- public void next (Container parent)
- {
- gotoComponent (parent, NEXT);
- }
-
- /**
- * Get the preferred layout size of the container.
- *
- * @param parent The parent container
- *
- * @return the preferred layout size
- */
- public Dimension preferredLayoutSize (Container parent)
- {
- return getSize (parent, PREF);
- }
-
- /**
- * Cause the previous component in the container to be displayed.
- * If this current card is the first one in the deck, the last
- * component is displayed.
- *
- * @param parent The parent container
- */
- public void previous (Container parent)
- {
- gotoComponent (parent, PREV);
- }
-
- /**
- * Remove the indicated component from this layout manager.
- *
- * @param comp The component to remove
- */
- public void removeLayoutComponent (Component comp)
- {
- Enumeration e = tab.keys ();
- while (e.hasMoreElements ())
- {
- Object key = e.nextElement ();
- if (tab.get (key) == comp)
- {
- tab.remove (key);
- Container parent = comp.getParent();
- next(parent);
- break;
- }
- }
- }
-
- /**
- * Set this layout manager's horizontal gap.
- *
- * @param hgap The new gap
- */
- public void setHgap (int hgap)
- {
- this.hgap = hgap;
- }
-
- /**
- * Set this layout manager's vertical gap.
- *
- * @param vgap The new gap
- */
- public void setVgap (int vgap)
- {
- this.vgap = vgap;
- }
-
- /**
- * Cause the named component to be shown. If the component name is
- * unknown, this method does nothing.
- *
- * @param parent The parent container
- * @param name The name of the component to show
- */
- public void show (Container parent, String name)
- {
- Object target = tab.get (name);
- if (target != null)
- {
- int num = parent.ncomponents;
- // This is more efficient than calling getComponents().
- Component[] comps = parent.component;
- for (int i = 0; i < num; ++i)
- {
- if (comps[i].isVisible())
- {
- if (target == comps[i])
- return;
- comps[i].setVisible (false);
- }
- }
- ((Component) target).setVisible (true);
- }
- }
-
- /**
- * Returns a string representation of this layout manager.
- *
- * @return A string representation of this object.
- */
- public String toString ()
- {
- return getClass ().getName () + "[" + hgap + "," + vgap + "]";
- }
-
- /**
- * This implements first(), last(), next(), and previous().
- *
- * @param parent The parent container
- * @param what The type of goto: FIRST, LAST, NEXT or PREV
- */
- private void gotoComponent (Container parent, int what)
- {
- synchronized (parent.getTreeLock ())
- {
- int num = parent.ncomponents;
- // This is more efficient than calling getComponents().
- Component[] comps = parent.component;
-
- if (num == 1)
- {
- comps[0].setVisible(true);
- return;
- }
-
- int choice = -1;
-
- if (what == FIRST)
- choice = 0;
- else if (what == LAST)
- choice = num - 1;
-
- for (int i = 0; i < num; ++i)
- {
- if (comps[i].isVisible ())
- {
- if (what == NEXT)
- {
- choice = i + 1;
- if (choice == num)
- choice = 0;
- }
- else if (what == PREV)
- {
- choice = i - 1;
- if (choice < 0)
- choice = num - 1;
- }
- else if (choice == i)
- {
- // Do nothing if we're already looking at the right
- // component.
- return;
- }
- comps[i].setVisible (false);
-
- if (choice >= 0)
- break;
- }
- }
-
- if (choice >= 0 && choice < num)
- comps[choice].setVisible (true);
- }
- }
-
- // Compute the size according to WHAT.
- private Dimension getSize (Container parent, int what)
- {
- synchronized (parent.getTreeLock ())
- {
- int w = 0, h = 0, num = parent.ncomponents;
- Component[] comps = parent.component;
-
- for (int i = 0; i < num; ++i)
- {
- Dimension d;
-
- if (what == MIN)
- d = comps[i].getMinimumSize ();
- else if (what == MAX)
- d = comps[i].getMaximumSize ();
- else
- d = comps[i].getPreferredSize ();
-
- w = Math.max (d.width, w);
- h = Math.max (d.height, h);
- }
-
- Insets i = parent.getInsets ();
- w += 2 * hgap + i.right + i.left;
- h += 2 * vgap + i.bottom + i.top;
-
- // Handle overflow.
- if (w < 0)
- w = Integer.MAX_VALUE;
- if (h < 0)
- h = Integer.MAX_VALUE;
-
- return new Dimension (w, h);
- }
- }
-
- /**
- * @serial Horizontal gap value.
- */
- private int hgap;
-
- /**
- * @serial Vertical gap value.
- */
- private int vgap;
-
- /**
- * @serial Table of named components.
- */
- private Hashtable tab;
-
- // These constants are used by the private gotoComponent method.
- private static final int FIRST = 0;
- private static final int LAST = 1;
- private static final int NEXT = 2;
- private static final int PREV = 3;
-
- // These constants are used by the private getSize method.
- private static final int MIN = 0;
- private static final int MAX = 1;
- private static final int PREF = 2;
-}
diff --git a/libjava/java/awt/Checkbox.java b/libjava/java/awt/Checkbox.java
deleted file mode 100644
index cd39ad43617..00000000000
--- a/libjava/java/awt/Checkbox.java
+++ /dev/null
@@ -1,649 +0,0 @@
-/* Checkbox.java -- An AWT checkbox widget
- Copyright (C) 1999, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.peer.CheckboxPeer;
-import java.io.Serializable;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleAction;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleState;
-import javax.accessibility.AccessibleStateSet;
-import javax.accessibility.AccessibleValue;
-
-/**
- * This class implements a component which has an on/off state. Two
- * or more Checkboxes can be grouped by a CheckboxGroup.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@redhat.com)
- */
-public class Checkbox extends Component
- implements ItemSelectable, Accessible, Serializable
-{
-
-// FIXME: Need readObject/writeObject for this.
-
-/*
- * Static Variables
- */
-
-// Serialization Constant
-private static final long serialVersionUID = 7270714317450821763L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The checkbox group for this checkbox.
- */
-private CheckboxGroup group;
-
-/**
- * @serial The label on this checkbox.
- */
-private String label;
-
-/**
- * @serial The state of this checkbox.
- * This is package-private to avoid an accessor method.
- */
-boolean state;
-
-// The list of listeners for this object.
-private transient ItemListener item_listeners;
-
- /*
- * The number used to generate the name returned by getName.
- */
- private static transient long next_checkbox_number;
-
-/**
- * This class provides accessibility support for the
- * checkbox.
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- */
-protected class AccessibleAWTCheckbox
- extends AccessibleAWTComponent
- implements ItemListener, AccessibleAction, AccessibleValue
-{
- /**
- * Serialization constant to match JDK 1.5
- */
- private static final long serialVersionUID = 7881579233144754107L;
-
- /**
- * Default constructor which simply calls the
- * super class for generic component accessibility
- * handling.
- */
- public AccessibleAWTCheckbox()
- {
- super();
- }
-
- /**
- * Captures changes to the state of the checkbox and
- * fires appropriate accessible property change events.
- *
- * @param event the event fired.
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- */
- public void itemStateChanged(ItemEvent event)
- {
- firePropertyChange(ACCESSIBLE_STATE_PROPERTY,
- state ? null : AccessibleState.CHECKED,
- state ? AccessibleState.CHECKED : null);
- }
-
- /**
- * Returns an implementation of the <code>AccessibleAction</code>
- * interface for this accessible object. In this case, the
- * current instance is simply returned (with a more appropriate
- * type), as it also implements the accessible action as well as
- * the context.
- *
- * @return the accessible action associated with this context.
- * @see javax.accessibility.AccessibleAction
- */
- public AccessibleAction getAccessibleAction()
- {
- return this;
- }
-
- /**
- * Returns an implementation of the <code>AccessibleValue</code>
- * interface for this accessible object. In this case, the
- * current instance is simply returned (with a more appropriate
- * type), as it also implements the accessible value as well as
- * the context.
- *
- * @return the accessible value associated with this context.
- * @see javax.accessibility.AccessibleValue
- */
- public AccessibleValue getAccessibleValue()
- {
- return this;
- }
-
- /*
- * The following methods are implemented in the JDK (up to
- * 1.5) as stubs. We do likewise here.
- */
-
- /**
- * Returns the number of actions associated with this accessible
- * object. This default implementation returns 0.
- *
- * @return the number of accessible actions available.
- * @see javax.accessibility.AccessibleAction#getAccessibleActionCount()
- */
- public int getAccessibleActionCount()
- {
- // 1.4.1 and 1.5 do this
- return 0;
- }
-
- /**
- * Returns a description of the action with the supplied id.
- * This default implementation always returns null.
- *
- * @param i the id of the action whose description should be
- * retrieved.
- * @return a <code>String</code> describing the action.
- * @see javax.accessibility.AccessibleAction#getAccessibleActionDescription(int)
- */
- public String getAccessibleActionDescription(int i)
- {
- // 1.5 does this
- return null;
- }
-
- /**
- * Executes the action with the specified id. This
- * default implementation simply returns false.
- *
- * @param i the id of the action to perform.
- * @return true if the action was performed.
- * @see javax.accessibility.AccessibleAction#doAccessibleAction(int)
- */
- public boolean doAccessibleAction(int i)
- {
- // 1.5 does this
- return false;
- }
-
- /**
- * Returns the current value of this accessible object.
- * If no value has been set, null is returned. This
- * default implementation always returns null, regardless.
- *
- * @return the numeric value of this object, or null if
- * no value has been set.
- * @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
- */
- public Number getCurrentAccessibleValue()
- {
- // 1.5 does this
- return null;
- }
-
- /**
- * Sets the current value of this accessible object
- * to that supplied. In this default implementation,
- * the value is never set and the method always returns
- * false.
- *
- * @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)
- {
- // 1.5 does this
- return false;
- }
-
- /**
- * Returns the minimum acceptable accessible value used
- * by this object, or null if no minimum value exists.
- * This default implementation always returns null.
- *
- * @return the minimum acceptable accessible value, or null
- * if there is no minimum.
- * @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
- */
- public Number getMinimumAccessibleValue()
- {
- return null;
- }
-
- /**
- * Returns the maximum acceptable accessible value used
- * by this object, or null if no maximum value exists.
- * This default implementation always returns null.
- *
- * @return the maximum acceptable accessible value, or null
- * if there is no maximum.
- * @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
- */
- public Number getMaximumAccessibleValue()
- {
- return null;
- }
-
- /**
- * Returns the role of this accessible object.
- *
- * @return the instance of <code>AccessibleRole</code>,
- * which describes this object.
- * @see javax.accessibility.AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.CHECK_BOX;
- }
-
- /**
- * Returns the state set of this accessible object.
- *
- * @return a set of <code>AccessibleState</code>s
- * which represent the current state of the
- * accessible object.
- * @see javax.accessibility.AccessibleState
- * @see javax.accessibility.AccessibleStateSet
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- AccessibleStateSet set = super.getAccessibleStateSet();
- if (state)
- set.add(AccessibleState.CHECKED);
- return set;
- }
-
-}
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>Checkbox</code> with no label,
- * an initial state of off, and that is not part of any checkbox group.
- */
-public
-Checkbox()
-{
- this("", false, null);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Checkbox</code> with the specified
- * label, an initial state of off, and that is not part of any checkbox
- * group.
- *
- * @param label The label for this checkbox.
- */
-public
-Checkbox(String label)
-{
- this(label, false, null);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Checkbox</code> with the specified
- * label and initial state, and that is not part of any checkbox
- * group.
- *
- * @param label The label for this checkbox.
- * @param state The initial state of the checkbox, <code>true</code> for
- * on, <code>false</code> for off.
- */
-public
-Checkbox(String label, boolean state)
-{
- this(label, state, null);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Checkbox</code> with the specified
- * label, initial state, and checkbox group.
- *
- * @param label The label for this checkbox.
- * @param group The checkbox group for this box, or <code>null</code>
- * if there is no checkbox group.
- * @param state The initial state of the checkbox, <code>true</code> for
- * on, <code>false</code> for off.
- */
-public
-Checkbox(String label, CheckboxGroup group, boolean state)
-{
- this(label, state, group);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Checkbox</code> with the specified
- * label, initial state, and checkbox group.
- *
- * @param label The label for this checkbox.
- * @param state The initial state of the checkbox, <code>true</code> for
- * on, <code>false</code> for off.
- * @param group The checkbox group for this box, or <code>null</code>
- * if there is no checkbox group.
- */
-public
-Checkbox(String label, boolean state, CheckboxGroup group)
-{
- this.label = label;
- this.state = state;
- this.group = group;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * Returns the label for this checkbox.
- *
- * @return The label for this checkbox.
- */
-public String
-getLabel()
-{
- return(label);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the label for this checkbox to the specified value.
- *
- * @param label The new checkbox label.
- */
-public synchronized void
-setLabel(String label)
-{
- this.label = label;
- if (peer != null)
- {
- CheckboxPeer cp = (CheckboxPeer) peer;
- cp.setLabel(label);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns the state of this checkbox.
- *
- * @return The state of this checkbox, which will be <code>true</code> for
- * on and <code>false</code> for off.
- */
-public boolean
-getState()
-{
- return(state);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the state of this checkbox to the specified value.
- *
- * @param state The new state of the checkbox, which will be <code>true</code>
- * for on or <code>false</code> for off.
- */
-public synchronized void
-setState(boolean state)
-{
- this.state = state;
- if (peer != null)
- {
- CheckboxPeer cp = (CheckboxPeer) peer;
- cp.setState (state);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns an array of length one containing the checkbox label if this
- * checkbox is selected. Otherwise <code>null</code> is returned.
- *
- * @return The selection state of this checkbox.
- */
-public Object[]
-getSelectedObjects()
-{
- if (state == false)
- return(null);
-
- Object[] objs = new Object[1];
- objs[0] = label;
-
- return(objs);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the checkbox group this object is a member of, if any.
- *
- * @return This object's checkbox group, of <code>null</code> if it is
- * not a member of any group.
- */
-public CheckboxGroup
-getCheckboxGroup()
-{
- return(group);
-}
-
-/*************************************************************************/
-
-/**
- * Sets this object's checkbox group to the specified group.
- *
- * @param group The new checkbox group, or <code>null</code> to make this
- * object part of no checkbox group.
- */
-public synchronized void
-setCheckboxGroup(CheckboxGroup group)
-{
- this.group = group;
- if (peer != null)
- {
- CheckboxPeer cp = (CheckboxPeer) peer;
- cp.setCheckboxGroup (group);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Creates this object's native peer.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createCheckbox (this);
- super.addNotify ();
-}
-
- public ItemListener[] getItemListeners ()
- {
- return (ItemListener[])
- AWTEventMulticaster.getListeners (item_listeners, ItemListener.class);
- }
-
-/**
- * Adds a new listeners to the list of registered listeners for this object.
- *
- * @param listener The new listener to add.
- */
-public synchronized void
-addItemListener(ItemListener listener)
-{
- item_listeners = AWTEventMulticaster.add(item_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Removes a listener from the list of registered listeners for this object.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeItemListener(ItemListener listener)
-{
- item_listeners = AWTEventMulticaster.remove(item_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Processes this event by calling <code>processItemEvent()</code> if it
- * is any instance of <code>ItemEvent</code>. Otherwise it is passed to
- * the superclass for processing.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof ItemEvent)
- processItemEvent((ItemEvent)event);
- else
- super.processEvent(event);
-}
-
-/*************************************************************************/
-
-/**
- * Processes this event by dispatching it to any registered listeners.
- *
- * @param event The <code>ItemEvent</code> to process.
- */
-protected void
-processItemEvent(ItemEvent event)
-{
- if (item_listeners != null)
- item_listeners.itemStateChanged(event);
-}
-
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= ItemEvent.ITEM_LAST
- && e.id >= ItemEvent.ITEM_FIRST
- && (item_listeners != null
- || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this object.
- */
-protected String
-paramString()
-{
- return ("label=" + label + ",state=" + state + ",group=" + group
- + "," + super.paramString());
-}
-
-/**
- * Gets the AccessibleContext associated with this <code>Checkbox</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
-public AccessibleContext getAccessibleContext()
-{
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- {
- AccessibleAWTCheckbox ac = new AccessibleAWTCheckbox();
- accessibleContext = ac;
- addItemListener(ac);
- }
- return accessibleContext;
-}
-
- /**
- * Generate a unique name for this checkbox.
- *
- * @return A unique name for this checkbox.
- */
- String generateName()
- {
- return "checkbox" + getUniqueLong();
- }
-
- private static synchronized long getUniqueLong()
- {
- return next_checkbox_number++;
- }
-}
diff --git a/libjava/java/awt/CheckboxGroup.java b/libjava/java/awt/CheckboxGroup.java
deleted file mode 100644
index 31b573e654d..00000000000
--- a/libjava/java/awt/CheckboxGroup.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/* CheckboxGroup.java -- A grouping class for checkboxes.
- Copyright (C) 1999, 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This class if for combining checkboxes into groups so that only
- * one checkbox in the group can be selected at any one time.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@redhat.com)
- */
-public class CheckboxGroup implements java.io.Serializable
-{
-
-/*
- * Static Variables
- */
-
-// Serialization constant
-private static final long serialVersionUID = 3729780091441768983L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The currently selected checkbox.
- */
-private Checkbox selectedCheckbox;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>CheckboxGroup</code>.
- */
-public
-CheckboxGroup()
-{
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the currently selected checkbox, or <code>null</code> if none
- * of the checkboxes in this group are selected.
- *
- * @return The selected checkbox.
- */
-public Checkbox
-getSelectedCheckbox()
-{
- return getCurrent ();
-}
-
-/*************************************************************************/
-
-/**
- * Returns the currently selected checkbox, or <code>null</code> if none
- * of the checkboxes in this group are selected.
- *
- * @return The selected checkbox.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getSelectedCheckbox()</code>.
- */
-public Checkbox
-getCurrent()
-{
- return(selectedCheckbox);
-}
-
-/*************************************************************************/
-
-/**
- * This method sets the specified checkbox to be the selected on in this
- * group, and unsets all others.
- *
- * @param selectedCheckbox The new selected checkbox.
- */
-public void
-setSelectedCheckbox(Checkbox selectedCheckbox)
-{
- setCurrent (selectedCheckbox);
-}
-
-/*************************************************************************/
-
-/**
- * This method sets the specified checkbox to be the selected on in this
- * group, and unsets all others.
- *
- * @param selectedCheckbox The new selected checkbox.
- *
- * @deprecated This method is deprecated in favor of
- * <code>setSelectedCheckbox()</code>.
- */
-public void
-setCurrent(Checkbox selectedCheckbox)
-{
- if (this.selectedCheckbox != null)
- {
- if (this.selectedCheckbox.getCheckboxGroup() != this)
- return;
-
- this.selectedCheckbox.setState(false);
- }
-
- this.selectedCheckbox = selectedCheckbox;
- if (selectedCheckbox != null)
- selectedCheckbox.setState(true);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a string representation of this checkbox group.
- *
- * @return A string representation of this checkbox group.
- */
-public String
-toString()
-{
- return(getClass().getName() + "[selectedCheckbox=" + selectedCheckbox + "]");
-}
-
-} // class CheckboxGroup
-
diff --git a/libjava/java/awt/CheckboxMenuItem.java b/libjava/java/awt/CheckboxMenuItem.java
deleted file mode 100644
index 5e446b84c8b..00000000000
--- a/libjava/java/awt/CheckboxMenuItem.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/* CheckboxMenuItem.java -- A menu option with a checkbox on it.
- Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.peer.CheckboxMenuItemPeer;
-import java.util.EventListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleAction;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleValue;
-
-/**
- * This class implements a menu item that has a checkbox on it indicating
- * the selected state of some option.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@redhat.com)
- */
-public class CheckboxMenuItem extends MenuItem
- implements ItemSelectable, Accessible
-{
-
-/*
- * Static Variables
- */
-
-// Serialization constant
-private static final long serialVersionUID = 6190621106981774043L;
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The state of the checkbox, with <code>true</code> being on and
- * <code>false</code> being off.
- */
-private boolean state;
-
-// List of registered ItemListeners
-private transient ItemListener item_listeners;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>CheckboxMenuItem</code> with no
- * label and an initial state of off.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
-public
-CheckboxMenuItem()
-{
- this("", false);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>CheckboxMenuItem</code> with the
- * specified label and an initial state of off.
- *
- * @param label The label of the menu item.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
-public
-CheckboxMenuItem(String label)
-{
- this(label, false);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>CheckboxMenuItem</code> with the
- * specified label and initial state.
- *
- * @param label The label of the menu item.
- * @param state The initial state of the menu item, where <code>true</code>
- * is on, and <code>false</code> is off.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
-public
-CheckboxMenuItem(String label, boolean state)
-{
- super(label);
- this.state = state;
-
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the state of this menu item.
- *
- * @return The state of this menu item.
- */
-public boolean
-getState()
-{
- return(state);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the state of this menu item.
- *
- * @param state The initial state of the menu item, where <code>true</code>
- * is on, and <code>false</code> is off.
- */
-public synchronized void
-setState(boolean state)
-{
- this.state = state;
- if (peer != null)
- {
- CheckboxMenuItemPeer cp = (CheckboxMenuItemPeer) peer;
- cp.setState (state);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns an array of length 1 with the menu item label for this object
- * if the state is on. Otherwise <code>null</code> is returned.
- *
- * @return An array with this menu item's label if it has a state of on,
- * or <code>null</code> otherwise.
- */
-public Object[]
-getSelectedObjects()
-{
- if (state == false)
- return(null);
-
- Object[] obj = new Object[1];
- obj[0] = getLabel();
-
- return(obj);
-}
-
-/*************************************************************************/
-
-/**
- * Create's this object's native peer
- */
-public synchronized void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit().createCheckboxMenuItem(this);
-
- super.addNotify ();
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified listener to the list of registered item listeners
- * for this object.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addItemListener(ItemListener listener)
-{
- item_listeners = AWTEventMulticaster.add(item_listeners, listener);
-
- enableEvents(AWTEvent.ITEM_EVENT_MASK);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified listener from the list of registered item
- * listeners for this object.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeItemListener(ItemListener listener)
-{
- item_listeners = AWTEventMulticaster.remove(item_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Processes the specified event by calling <code>processItemEvent()</code>
- * if it is an instance of <code>ItemEvent</code> or calling the superclass
- * method otherwise.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof ItemEvent)
- processItemEvent((ItemEvent)event);
- else
- super.processEvent(event);
-}
-
-/*************************************************************************/
-
-/**
- * Processes the specified event by dispatching it to any registered listeners.
- *
- * @param event The event to process.
- */
-protected void
-processItemEvent(ItemEvent event)
-{
- if (item_listeners != null)
- item_listeners.itemStateChanged(event);
-}
-
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e instanceof ItemEvent)
- {
- synchronized (this)
- {
- state = (((ItemEvent) e).getStateChange() == ItemEvent.SELECTED);
- }
- }
-
- if (e.id <= ItemEvent.ITEM_LAST
- && e.id >= ItemEvent.ITEM_FIRST
- && (item_listeners != null
- || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this object.
- *
- * @return A debugging string for this object.
- */
-public String
-paramString()
-{
- return ("label=" + getLabel() + ",state=" + state
- + "," + super.paramString());
-}
-
- /**
- * Returns an array of all the objects currently registered as FooListeners
- * upon this <code>CheckboxMenuItem</code>. 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)
- {
- if (listenerType == ItemListener.class)
- return AWTEventMulticaster.getListeners (item_listeners, listenerType);
-
- return super.getListeners (listenerType);
- }
-
- /**
- * Returns an aray of all item listeners currently registered to this
- * <code>CheckBoxMenuItem</code>.
- */
- public ItemListener[] getItemListeners ()
- {
- return (ItemListener[]) getListeners (ItemListener.class);
- }
-
-
- protected class AccessibleAWTCheckboxMenuItem extends AccessibleAWTMenuItem
- implements AccessibleAction, AccessibleValue
- {
- // I think the base class provides the necessary implementation
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>CheckboxMenuItem</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTCheckboxMenuItem();
- return accessibleContext;
- }
-
-} // class CheckboxMenuItem
-
diff --git a/libjava/java/awt/Choice.java b/libjava/java/awt/Choice.java
deleted file mode 100644
index 5075ea92d83..00000000000
--- a/libjava/java/awt/Choice.java
+++ /dev/null
@@ -1,638 +0,0 @@
-/* Choice.java -- Java choice button widget.
- Copyright (C) 1999, 2000, 2001, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.peer.ChoicePeer;
-import java.io.Serializable;
-import java.util.EventListener;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleAction;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * This class implements a drop down choice list.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Choice extends Component
- implements ItemSelectable, Serializable, Accessible
-{
-
-/*
- * Static Variables
- */
-
-// Serialization constant
-private static final long serialVersionUID = -4075310674757313071L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial A list of items for the choice box, which can be <code>null</code>.
- * This is package-private to avoid an accessor method.
- */
-Vector pItems = new Vector();
-
-/**
- * @serial The index of the selected item in the choice box.
- */
-private int selectedIndex = -1;
-
-// Listener chain
-private ItemListener item_listeners;
-
-/**
- * This class provides accessibility support for the
- * combo box.
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- */
- protected class AccessibleAWTChoice
- extends AccessibleAWTComponent
- implements AccessibleAction
- {
-
- /**
- * Serialization constant to match JDK 1.5
- */
- private static final long serialVersionUID = 7175603582428509322L;
-
- /**
- * Default constructor which simply calls the
- * super class for generic component accessibility
- * handling.
- */
- public AccessibleAWTChoice()
- {
- super();
- }
-
- /**
- * Returns an implementation of the <code>AccessibleAction</code>
- * interface for this accessible object. In this case, the
- * current instance is simply returned (with a more appropriate
- * type), as it also implements the accessible action as well as
- * the context.
- *
- * @return the accessible action associated with this context.
- * @see javax.accessibility.AccessibleAction
- */
- public AccessibleAction getAccessibleAction()
- {
- return this;
- }
-
- /**
- * Returns the role of this accessible object.
- *
- * @return the instance of <code>AccessibleRole</code>,
- * which describes this object.
- * @see javax.accessibility.AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.COMBO_BOX;
- }
-
- /**
- * Returns the number of actions associated with this accessible
- * object. In this case, it is the number of choices available.
- *
- * @return the number of choices available.
- * @see javax.accessibility.AccessibleAction#getAccessibleActionCount()
- */
- public int getAccessibleActionCount()
- {
- return pItems.size();
- }
-
- /**
- * Returns a description of the action with the supplied id.
- * In this case, it is the text used in displaying the particular
- * choice on-screen.
- *
- * @param i the id of the choice whose description should be
- * retrieved.
- * @return the <code>String</code> used to describe the choice.
- * @see javax.accessibility.AccessibleAction#getAccessibleActionDescription(int)
- */
- public String getAccessibleActionDescription(int i)
- {
- return (String) pItems.get(i);
- }
-
- /**
- * Executes the action with the specified id. In this case,
- * calling this method provides the same behaviour as would
- * choosing a choice from the list in a visual manner.
- *
- * @param i the id of the choice to select.
- * @return true if a valid choice was specified.
- * @see javax.accessibility.AccessibleAction#doAccessibleAction(int)
- */
- public boolean doAccessibleAction(int i)
- {
- if (i < 0 || i >= pItems.size())
- return false;
-
- Choice.this.processItemEvent(new ItemEvent(Choice.this,
- ItemEvent.ITEM_STATE_CHANGED,
- this, ItemEvent.SELECTED));
- return true;
- }
- }
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
- /**
- * Initializes a new instance of <code>Choice</code>.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true
- */
- public Choice()
- {
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
- }
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the number of items in the list.
- *
- * @return The number of items in the list.
- */
-public int
-getItemCount()
-{
- return countItems ();
-}
-
-/*************************************************************************/
-
-/**
- * Returns the number of items in the list.
- *
- * @return The number of items in the list.
- *
- * @deprecated This method is deprecated in favor of <code>getItemCount</code>.
- */
-public int
-countItems()
-{
- return(pItems.size());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the item at the specified index in the list.
- *
- * @param index The index into the list to return the item from.
- *
- * @exception ArrayIndexOutOfBoundsException If the index is invalid.
- */
-public String
-getItem(int index)
-{
- return((String)pItems.elementAt(index));
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified item to this choice box.
- *
- * @param item The item to add.
- *
- * @exception NullPointerException If the item's value is null
- *
- * @since 1.1
- */
-public synchronized void
-add(String item)
-{
- if (item == null)
- throw new NullPointerException ("item must be non-null");
-
- pItems.addElement(item);
-
- int i = pItems.size () - 1;
- if (peer != null)
- {
- ChoicePeer cp = (ChoicePeer) peer;
- cp.add (item, i);
- }
- else if (selectedIndex == -1)
- select(0);
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified item to this choice box.
- *
- * This method is oboslete since Java 2 platform 1.1. Please use @see add
- * instead.
- *
- * @param item The item to add.
- *
- * @exception NullPointerException If the item's value is equal to null
- */
-public synchronized void
-addItem(String item)
-{
- add(item);
-}
-
-/*************************************************************************/
-
-/** Inserts an item into this Choice. Existing items are shifted
- * upwards. If the new item is the only item, then it is selected.
- * If the currently selected item is shifted, then the first item is
- * selected. If the currently selected item is not shifted, then it
- * remains selected.
- *
- * @param item The item to add.
- * @param index The index at which the item should be inserted.
- *
- * @exception IllegalArgumentException If index is less than 0
- */
-public synchronized void
-insert(String item, int index)
-{
- if (index < 0)
- throw new IllegalArgumentException ("index may not be less then 0");
-
- if (index > getItemCount ())
- index = getItemCount ();
-
- pItems.insertElementAt(item, index);
-
- if (peer != null)
- {
- ChoicePeer cp = (ChoicePeer) peer;
- cp.add (item, index);
- }
- else if (selectedIndex == -1 || selectedIndex >= index)
- select(0);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified item from the choice box.
- *
- * @param item The item to remove.
- *
- * @exception IllegalArgumentException If the specified item doesn't exist.
- */
-public synchronized void
-remove(String item)
-{
- int index = pItems.indexOf(item);
- if (index == -1)
- throw new IllegalArgumentException ("item \""
- + item + "\" not found in Choice");
- remove(index);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the item at the specified index from the choice box.
- *
- * @param index The index of the item to remove.
- *
- * @exception IndexOutOfBoundsException If the index is not valid.
- */
-public synchronized void
-remove(int index)
-{
- if ((index < 0) || (index > getItemCount()))
- throw new IllegalArgumentException("Bad index: " + index);
-
- pItems.removeElementAt(index);
-
- if (peer != null)
- {
- ChoicePeer cp = (ChoicePeer) peer;
- cp.remove (index);
- }
- else
- {
- if (getItemCount() == 0)
- selectedIndex = -1;
- else if (index == selectedIndex)
- select(0);
- }
-
- if (selectedIndex > index)
- --selectedIndex;
-}
-
-/*************************************************************************/
-
-/**
- * Removes all of the objects from this choice box.
- */
-public synchronized void
-removeAll()
-{
- if (getItemCount() <= 0)
- return;
-
- pItems.removeAllElements ();
-
- if (peer != null)
- {
- ChoicePeer cp = (ChoicePeer) peer;
- cp.removeAll ();
- }
-
- selectedIndex = -1;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the currently selected item, or null if no item is
- * selected.
- *
- * @return The currently selected item.
- */
-public synchronized String
-getSelectedItem()
-{
- return (selectedIndex == -1
- ? null
- : ((String)pItems.elementAt(selectedIndex)));
-}
-
-/*************************************************************************/
-
-/**
- * Returns an array with one row containing the selected item.
- *
- * @return An array containing the selected item.
- */
-public synchronized Object[]
-getSelectedObjects()
-{
- if (selectedIndex == -1)
- return null;
-
- Object[] objs = new Object[1];
- objs[0] = pItems.elementAt(selectedIndex);
-
- return(objs);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the index of the selected item.
- *
- * @return The index of the selected item.
- */
-public int
-getSelectedIndex()
-{
- return(selectedIndex);
-}
-
-/*************************************************************************/
-
-/**
- * Forces the item at the specified index to be selected.
- *
- * @param index The index of the row to make selected.
- *
- * @exception IllegalArgumentException If the specified index is invalid.
- */
-public synchronized void
-select(int index)
-{
- if ((index < 0) || (index > getItemCount()))
- throw new IllegalArgumentException("Bad index: " + index);
-
- this.selectedIndex = index;
- if (peer != null)
- {
- ChoicePeer cp = (ChoicePeer) peer;
- cp.select (index);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Forces the named item to be selected.
- *
- * @param item The item to be selected.
- *
- * @exception IllegalArgumentException If the specified item does not exist.
- */
-public synchronized void
-select(String item)
-{
- int index = pItems.indexOf(item);
- if (index >= 0)
- select(index);
-}
-
-/*************************************************************************/
-
-/**
- * Creates the native peer for this object.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createChoice (this);
- super.addNotify ();
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified listener to the list of registered listeners for
- * this object.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addItemListener(ItemListener listener)
-{
- item_listeners = AWTEventMulticaster.add(item_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified listener from the list of registered listeners for
- * this object.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeItemListener(ItemListener listener)
-{
- item_listeners = AWTEventMulticaster.remove(item_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Processes this event by invoking <code>processItemEvent()</code> if the
- * event is an instance of <code>ItemEvent</code>, otherwise the event
- * is passed to the superclass.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof ItemEvent)
- processItemEvent((ItemEvent)event);
- else
- super.processEvent(event);
-}
-
-/*************************************************************************/
-
-/**
- * Processes item event by dispatching to any registered listeners.
- *
- * @param event The event to process.
- */
-protected void
-processItemEvent(ItemEvent event)
-{
- if (item_listeners != null)
- item_listeners.itemStateChanged(event);
-}
-
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= ItemEvent.ITEM_LAST
- && e.id >= ItemEvent.ITEM_FIRST
- && (item_listeners != null
- || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this object.
- *
- * @return A debugging string for this object.
- */
-protected String
-paramString()
-{
- return ("selectedIndex=" + selectedIndex + "," + super.paramString());
-}
-
- /**
- * Returns an array of all the objects currently registered as FooListeners
- * upon this Choice. FooListeners are registered using the addFooListener
- * method.
- *
- * @exception ClassCastException If listenerType doesn't specify a class or
- * interface that implements java.util.EventListener.
- *
- * @since 1.3
- */
- public EventListener[] getListeners (Class listenerType)
- {
- if (listenerType == ItemListener.class)
- return AWTEventMulticaster.getListeners (item_listeners, listenerType);
-
- return super.getListeners (listenerType);
- }
-
- /**
- * Returns all registered item listeners.
- *
- * @since 1.4
- */
- public ItemListener[] getItemListeners ()
- {
- return (ItemListener[]) getListeners (ItemListener.class);
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>Choice</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTChoice();
- return accessibleContext;
- }
-} // class Choice
diff --git a/libjava/java/awt/Color.java b/libjava/java/awt/Color.java
deleted file mode 100644
index 4ad46d0c07c..00000000000
--- a/libjava/java/awt/Color.java
+++ /dev/null
@@ -1,1008 +0,0 @@
-/* Color.java -- represents a color in Java
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.color.ColorSpace;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.ColorModel;
-import java.io.Serializable;
-
-/**
- * This class represents a color value in the AWT system. It uses the sRGB
- * (standard Red-Green-Blue) system, along with an alpha value ranging from
- * transparent (0.0f or 0) and opaque (1.0f or 255). The color is not
- * pre-multiplied by the alpha value an any of the accessor methods. Further
- * information about sRGB can be found at
- * <a href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
- * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html</a>.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ColorSpace
- * @see AlphaComposite
- * @since 1.0
- * @status updated to 1.4
- */
-public class Color implements Paint, Serializable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 118526816881161077L;
-
- /** Constant for the color white: R=255, G=255, B=255. */
- public static final Color white = new Color(0xffffff, false);
-
- /**
- * Constant for the color white: R=255, G=255, B=255.
- *
- * @since 1.4
- */
- public static final Color WHITE = white;
-
- /** Constant for the color light gray: R=192, G=192, B=192. */
- public static final Color lightGray = new Color(0xc0c0c0, false);
-
- /**
- * Constant for the color light gray: R=192, G=192, B=192.
- *
- * @since 1.4
- */
- public static final Color LIGHT_GRAY = lightGray;
-
- /** Constant for the color gray: R=128, G=128, B=128. */
- public static final Color gray = new Color(0x808080, false);
-
- /**
- * Constant for the color gray: R=128, G=128, B=128.
- *
- * @since 1.4
- */
- public static final Color GRAY = gray;
-
- /** Constant for the color dark gray: R=64, G=64, B=64. */
- public static final Color darkGray = new Color(0x404040, false);
-
- /**
- * Constant for the color dark gray: R=64, G=64, B=64.
- *
- * @since 1.4
- */
- public static final Color DARK_GRAY = darkGray;
-
- /** Constant for the color black: R=0, G=0, B=0. */
- public static final Color black = new Color(0x000000, false);
-
- /**
- * Constant for the color black: R=0, G=0, B=0.
- *
- * @since 1.4
- */
- public static final Color BLACK = black;
-
- /** Constant for the color red: R=255, G=0, B=0. */
- public static final Color red = new Color(0xff0000, false);
-
- /**
- * Constant for the color red: R=255, G=0, B=0.
- *
- * @since 1.4
- */
- public static final Color RED = red;
-
- /** Constant for the color pink: R=255, G=175, B=175. */
- public static final Color pink = new Color(0xffafaf, false);
-
- /**
- * Constant for the color pink: R=255, G=175, B=175.
- *
- * @since 1.4
- */
- public static final Color PINK = pink;
-
- /** Constant for the color orange: R=255, G=200, B=0. */
- public static final Color orange = new Color(0xffc800, false);
-
- /**
- * Constant for the color orange: R=255, G=200, B=0.
- *
- * @since 1.4
- */
- public static final Color ORANGE = orange;
-
- /** Constant for the color yellow: R=255, G=255, B=0. */
- public static final Color yellow = new Color(0xffff00, false);
-
- /**
- * Constant for the color yellow: R=255, G=255, B=0.
- *
- * @since 1.4
- */
- public static final Color YELLOW = yellow;
-
- /** Constant for the color green: R=0, G=255, B=0. */
- public static final Color green = new Color(0x00ff00, false);
-
- /**
- * Constant for the color green: R=0, G=255, B=0.
- *
- * @since 1.4
- */
- public static final Color GREEN = green;
-
- /** Constant for the color magenta: R=255, G=0, B=255. */
- public static final Color magenta = new Color(0xff00ff, false);
-
- /**
- * Constant for the color magenta: R=255, G=0, B=255.
- *
- * @since 1.4
- */
- public static final Color MAGENTA = magenta;
-
- /** Constant for the color cyan: R=0, G=255, B=255. */
- public static final Color cyan = new Color(0x00ffff, false);
-
- /**
- * Constant for the color cyan: R=0, G=255, B=255.
- *
- * @since 1.4
- */
- public static final Color CYAN = cyan;
-
- /** Constant for the color blue: R=0, G=0, B=255. */
- public static final Color blue = new Color(0x0000ff, false);
-
- /**
- * Constant for the color blue: R=0, G=0, B=255.
- *
- * @since 1.4
- */
- public static final Color BLUE = blue;
-
- /** Internal mask for red. */
- private static final int RED_MASK = 255 << 16;
-
- /** Internal mask for green. */
- private static final int GREEN_MASK = 255 << 8;
-
- /** Internal mask for blue. */
- private static final int BLUE_MASK = 255;
-
- /** Internal mask for alpha. Package visible for use in subclass. */
- static final int ALPHA_MASK = 255 << 24;
-
- /** Amount to scale a color by when brightening or darkening. */
- private static final float BRIGHT_SCALE = 0.7f;
-
- /**
- * The color value, in sRGB. Note that the actual color may be more
- * precise if frgbvalue or fvalue is non-null. This class stores alpha, red,
- * green, and blue, each 0-255, packed in an int. However, the subclass
- * SystemColor stores an index into an array. Therefore, for serial
- * compatibility (and because of poor design on Sun's part), this value
- * cannot be used directly; instead you must use <code>getRGB()</code>.
- *
- * @see #getRGB()
- * @serial the value of the color, whether an RGB literal or array index
- */
- final int value;
-
- /**
- * The color value, in sRGB. This may be null if the color was constructed
- * with ints; and it does not include alpha. This stores red, green, and
- * blue, in the range 0.0f - 1.0f.
- *
- * @see #getRGBColorComponents(float[])
- * @see #getRGBComponents(float[])
- * @serial the rgb components of the value
- * @since 1.2
- */
- private float[] frgbvalue;
-
- /**
- * The color value, in the native ColorSpace components. This may be null
- * if the color was constructed with ints or in the sRGB color space; and
- * it does not include alpha.
- *
- * @see #getRGBColorComponents(float[])
- * @see #getRGBComponents(float[])
- * @serial the original color space components of the color
- * @since 1.2
- */
- private float[] fvalue;
-
- /**
- * The alpha value. This is in the range 0.0f - 1.0f, but is invalid if
- * deserialized as 0.0 when frgbvalue is null.
- *
- * @see #getRGBComponents(float[])
- * @see #getComponents(float[])
- * @serial the alpha component of this color
- * @since 1.2
- */
- private final float falpha;
-
- /**
- * The ColorSpace. Null means the default sRGB space.
- *
- * @see #getColor(String)
- * @see #getColorSpace()
- * @see #getColorComponents(float[])
- * @serial the color space for this color
- * @since 1.2
- */
- private final ColorSpace cs;
-
- /**
- * The paint context for this solid color. Package visible for use in
- * subclass.
- */
- transient ColorPaintContext context;
-
- /**
- * Initializes a new instance of <code>Color</code> using the specified
- * red, green, and blue values, which must be given as integers in the
- * range of 0-255. Alpha will default to 255 (opaque). When drawing to
- * screen, the actual color may be adjusted to the best match of hardware
- * capabilities.
- *
- * @param red the red component of the RGB value
- * @param green the green component of the RGB value
- * @param blue the blue component of the RGB value
- * @throws IllegalArgumentException if the values are out of range 0-255
- * @see #getRed()
- * @see #getGreen()
- * @see #getBlue()
- * @see #getRGB()
- * @see #Color(int, int, int, int)
- */
- public Color(int red, int green, int blue)
- {
- this(red, green, blue, 255);
- }
-
- /**
- * Initializes a new instance of <code>Color</code> using the specified
- * red, green, blue, and alpha values, which must be given as integers in
- * the range of 0-255. When drawing to screen, the actual color may be
- * adjusted to the best match of hardware capabilities.
- *
- * @param red the red component of the RGB value
- * @param green the green component of the RGB value
- * @param blue the blue component of the RGB value
- * @param alpha the alpha value of the color
- * @throws IllegalArgumentException if the values are out of range 0-255
- * @see #getRed()
- * @see #getGreen()
- * @see #getBlue()
- * @see #getAlpha()
- * @see #getRGB()
- */
- public Color(int red, int green, int blue, int alpha)
- {
- if ((red & 255) != red || (green & 255) != green || (blue & 255) != blue
- || (alpha & 255) != alpha)
- throw new IllegalArgumentException("Bad RGB values"
- +" red=0x"+Integer.toHexString(red)
- +" green=0x"+Integer.toHexString(green)
- +" blue=0x"+Integer.toHexString(blue)
- +" alpha=0x"+Integer.toHexString(alpha) );
-
- value = (alpha << 24) | (red << 16) | (green << 8) | blue;
- falpha = 1;
- cs = null;
- }
-
- /**
- * Initializes a new instance of <code>Color</code> using the specified
- * RGB value. The blue value is in bits 0-7, green in bits 8-15, and
- * red in bits 16-23. The other bits are ignored. The alpha value is set
- * to 255 (opaque). When drawing to screen, the actual color may be
- * adjusted to the best match of hardware capabilities.
- *
- * @param value the RGB value
- * @see ColorModel#getRGBdefault()
- * @see #getRed()
- * @see #getGreen()
- * @see #getBlue()
- * @see #getRGB()
- * @see #Color(int, boolean)
- */
- public Color(int value)
- {
- this(value, false);
- }
-
- /**
- * Initializes a new instance of <code>Color</code> using the specified
- * RGB value. The blue value is in bits 0-7, green in bits 8-15, and
- * red in bits 16-23. The alpha value is in bits 24-31, unless hasalpha
- * is false, in which case alpha is set to 255. When drawing to screen, the
- * actual color may be adjusted to the best match of hardware capabilities.
- *
- * @param value the RGB value
- * @param hasalpha true if value includes the alpha
- * @see ColorModel#getRGBdefault()
- * @see #getRed()
- * @see #getGreen()
- * @see #getBlue()
- * @see #getAlpha()
- * @see #getRGB()
- */
- public Color(int value, boolean hasalpha)
- {
- // Note: SystemColor calls this constructor, setting falpha to 0; but
- // code in getRGBComponents correctly reports falpha as 1.0 to the user
- // for all instances of SystemColor since frgbvalue is left null here.
- if (hasalpha)
- falpha = ((value & ALPHA_MASK) >> 24) / 255f;
- else
- {
- value |= ALPHA_MASK;
- falpha = 1;
- }
- this.value = value;
- cs = null;
- }
-
- /**
- * Initializes a new instance of <code>Color</code> using the specified
- * RGB values. These must be in the range of 0.0-1.0. Alpha is assigned
- * the value of 1.0 (opaque). When drawing to screen, the actual color may
- * be adjusted to the best match of hardware capabilities.
- *
- * @param red the red component of the RGB value
- * @param green the green component of the RGB value
- * @param blue the blue component of the RGB value
- * @throws IllegalArgumentException tf the values are out of range 0.0f-1.0f
- * @see #getRed()
- * @see #getGreen()
- * @see #getBlue()
- * @see #getRGB()
- * @see #Color(float, float, float, float)
- */
- public Color(float red, float green, float blue)
- {
- this(red, green, blue, 1.0f);
- }
-
- /**
- * Initializes a new instance of <code>Color</code> using the specified
- * RGB and alpha values. These must be in the range of 0.0-1.0. When drawing
- * to screen, the actual color may be adjusted to the best match of
- * hardware capabilities.
- *
- * @param red the red component of the RGB value
- * @param green the green component of the RGB value
- * @param blue the blue component of the RGB value
- * @param alpha the alpha value of the color
- * @throws IllegalArgumentException tf the values are out of range 0.0f-1.0f
- * @see #getRed()
- * @see #getGreen()
- * @see #getBlue()
- * @see #getAlpha()
- * @see #getRGB()
- */
- public Color(float red, float green, float blue, float alpha)
- {
- value = convert(red, green, blue, alpha);
- frgbvalue = new float[] {red, green, blue};
- falpha = alpha;
- cs = null;
- }
-
- /**
- * Creates a color in the given ColorSpace with the specified alpha. The
- * array must be non-null and have enough elements for the color space
- * (for example, RGB requires 3 elements, CMYK requires 4). When drawing
- * to screen, the actual color may be adjusted to the best match of
- * hardware capabilities.
- *
- * @param space the color space of components
- * @param components the color components, except alpha
- * @param alpha the alpha value of the color
- * @throws NullPointerException if cpsace or components is null
- * @throws ArrayIndexOutOfBoundsException if components is too small
- * @throws IllegalArgumentException if alpha or any component is out of range
- * @see #getComponents(float[])
- * @see #getColorComponents(float[])
- */
- public Color(ColorSpace space, float[] components, float alpha)
- {
- frgbvalue = space.toRGB(components);
- fvalue = components;
- falpha = alpha;
- cs = space;
- value = convert(frgbvalue[0], frgbvalue[1], frgbvalue[2], alpha);
- }
-
- /**
- * Returns the red value for this color, as an integer in the range 0-255
- * in the sRGB color space.
- *
- * @return the red value for this color
- * @see #getRGB()
- */
- public int getRed()
- {
- // Do not inline getRGB() to value, because of SystemColor.
- return (getRGB() & RED_MASK) >> 16;
- }
-
- /**
- * Returns the green value for this color, as an integer in the range 0-255
- * in the sRGB color space.
- *
- * @return the green value for this color
- * @see #getRGB()
- */
- public int getGreen()
- {
- // Do not inline getRGB() to value, because of SystemColor.
- return (getRGB() & GREEN_MASK) >> 8;
- }
-
- /**
- * Returns the blue value for this color, as an integer in the range 0-255
- * in the sRGB color space.
- *
- * @return the blue value for this color
- * @see #getRGB()
- */
- public int getBlue()
- {
- // Do not inline getRGB() to value, because of SystemColor.
- return getRGB() & BLUE_MASK;
- }
-
- /**
- * Returns the alpha value for this color, as an integer in the range 0-255.
- *
- * @return the alpha value for this color
- * @see #getRGB()
- */
- public int getAlpha()
- {
- // Do not inline getRGB() to value, because of SystemColor.
- return (getRGB() & ALPHA_MASK) >>> 24;
- }
-
- /**
- * Returns the RGB value for this color, in the sRGB color space. The blue
- * value will be in bits 0-7, green in 8-15, red in 16-23, and alpha value in
- * 24-31.
- *
- * @return the RGB value for this color
- * @see ColorModel#getRGBdefault()
- * @see #getRed()
- * @see #getGreen()
- * @see #getBlue()
- * @see #getAlpha()
- */
- public int getRGB()
- {
- return value;
- }
-
- /**
- * Returns a brighter version of this color. This is done by increasing the
- * RGB values by an arbitrary scale factor. The new color is opaque (an
- * alpha of 255). Note that this method and the <code>darker()</code>
- * method are not necessarily inverses.
- *
- * @return a brighter version of this color
- * @see #darker()
- */
- public Color brighter()
- {
- // Do not inline getRGB() to this.value, because of SystemColor.
- int value = getRGB();
- int red = (value & RED_MASK) >> 16;
- int green = (value & GREEN_MASK) >> 8;
- int blue = value & BLUE_MASK;
- // We have to special case 0-2 because they won't scale by division.
- red = red < 3 ? 3 : (int) Math.min(255, red / BRIGHT_SCALE);
- green = green < 3 ? 3 : (int) Math.min(255, green / BRIGHT_SCALE);
- blue = blue < 3 ? 3 : (int) Math.min(255, blue / BRIGHT_SCALE);
- return new Color(red, green, blue, 255);
- }
-
- /**
- * Returns a darker version of this color. This is done by decreasing the
- * RGB values by an arbitrary scale factor. The new color is opaque (an
- * alpha of 255). Note that this method and the <code>brighter()</code>
- * method are not necessarily inverses.
- *
- * @return a darker version of this color
- * @see #brighter()
- */
- public Color darker()
- {
- // Do not inline getRGB() to this.value, because of SystemColor.
- int value = getRGB();
- return new Color((int) (((value & RED_MASK) >> 16) * BRIGHT_SCALE),
- (int) (((value & GREEN_MASK) >> 8) * BRIGHT_SCALE),
- (int) ((value & BLUE_MASK) * BRIGHT_SCALE), 255);
- }
-
- /**
- * Returns a hash value for this color. This is simply the color in 8-bit
- * precision, in the format 0xAARRGGBB (alpha, red, green, blue).
- *
- * @return a hash value for this color
- */
- public int hashCode()
- {
- return value;
- }
-
- /**
- * Tests this object for equality against the specified object. This will
- * be true if and only if the specified object is an instance of
- * <code>Color</code> and has the same 8-bit integer red, green, and blue
- * values as this object. Note that two colors may be slightly different
- * as float values, but round to the same integer values. Also note that
- * this does not accurately compare SystemColors, since that class does
- * not store its internal data in RGB format like regular colors.
- *
- * @param obj the object to compare to
- * @return true if the specified object is semantically equal to this one
- */
- public boolean equals(Object obj)
- {
- return obj instanceof Color && ((Color) obj).value == value;
- }
-
- /**
- * Returns a string representation of this object. Subclasses may return
- * any desired format, except for null, but this implementation returns
- * <code>getClass().getName() + "[r=" + getRed() + ",g=" + getGreen()
- * + ",b=" + getBlue() + ']'</code>.
- *
- * @return a string representation of this object
- */
- public String toString()
- {
- return getClass().getName() + "[r=" + ((value & RED_MASK) >> 16)
- + ",g=" + ((value & GREEN_MASK) >> 8) + ",b=" + (value & BLUE_MASK)
- + ']';
- }
-
- /**
- * Converts the specified string to a number, using Integer.decode, and
- * creates a new instance of <code>Color</code> from the value. The alpha
- * value will be 255 (opaque).
- *
- * @param str the numeric color string
- * @return a new instance of <code>Color</code> for the string
- * @throws NumberFormatException if the string cannot be parsed
- * @throws NullPointerException if the string is null
- * @see Integer#decode(String)
- * @see #Color(int)
- * @since 1.1
- */
- public static Color decode(String str)
- {
- return new Color(Integer.decode(str).intValue(), false);
- }
-
- /**
- * Returns a new instance of <code>Color</code> from the value of the
- * system property named by the specified string. If the property does not
- * exist, or cannot be parsed, then <code>null</code> will be returned.
- *
- * @param prop the system property to retrieve
- * @throws SecurityException if getting the property is denied
- * @see #getColor(String, Color)
- * @see Integer#getInteger(String)
- */
- public static Color getColor(String prop)
- {
- return getColor(prop, null);
- }
-
- /**
- * Returns a new instance of <code>Color</code> from the value of the
- * system property named by the specified string. If the property does
- * not exist, or cannot be parsed, then the default color value will be
- * returned.
- *
- * @param prop the system property to retrieve
- * @param defcolor the default color
- * @throws SecurityException if getting the property is denied
- * @see Integer#getInteger(String)
- */
- public static Color getColor(String prop, Color defcolor)
- {
- Integer val = Integer.getInteger(prop, null);
- return val == null ? defcolor
- : new Color(val.intValue(), false);
- }
-
- /**
- * Returns a new instance of <code>Color</code> from the value of the
- * system property named by the specified string. If the property does
- * not exist, or cannot be parsed, then the default RGB value will be
- * used to create a return value.
- *
- * @param prop the system property to retrieve
- * @param defrgb the default RGB value
- * @throws SecurityException if getting the property is denied
- * @see #getColor(String, Color)
- * @see Integer#getInteger(String, int)
- */
- public static Color getColor(String prop, int defrgb)
- {
- Color c = getColor(prop, null);
- return c == null ? new Color(defrgb, false) : c;
- }
-
- /**
- * Converts from the HSB (hue, saturation, brightness) color model to the
- * RGB (red, green, blue) color model. The hue may be any floating point;
- * it's fractional portion is used to select the angle in the HSB model.
- * The saturation and brightness must be between 0 and 1. The result is
- * suitable for creating an RGB color with the one-argument constructor.
- *
- * @param hue the hue of the HSB value
- * @param saturation the saturation of the HSB value
- * @param brightness the brightness of the HSB value
- * @return the RGB value
- * @see #getRGB()
- * @see #Color(int)
- * @see ColorModel#getRGBdefault()
- */
- public static int HSBtoRGB(float hue, float saturation, float brightness)
- {
- if (saturation == 0)
- return convert(brightness, brightness, brightness, 0);
- if (saturation < 0 || saturation > 1 || brightness < 0 || brightness > 1)
- throw new IllegalArgumentException();
- hue = hue - (float) Math.floor(hue);
- int i = (int) (6 * hue);
- float f = 6 * hue - i;
- float p = brightness * (1 - saturation);
- float q = brightness * (1 - saturation * f);
- float t = brightness * (1 - saturation * (1 - f));
- switch (i)
- {
- case 0:
- return convert(brightness, t, p, 0);
- case 1:
- return convert(q, brightness, p, 0);
- case 2:
- return convert(p, brightness, t, 0);
- case 3:
- return convert(p, q, brightness, 0);
- case 4:
- return convert(t, p, brightness, 0);
- case 5:
- return convert(brightness, p, q, 0);
- default:
- throw new InternalError("impossible");
- }
- }
-
- /**
- * Converts from the RGB (red, green, blue) color model to the HSB (hue,
- * saturation, brightness) color model. If the array is null, a new one
- * is created, otherwise it is recycled. The results will be in the range
- * 0.0-1.0 if the inputs are in the range 0-255.
- *
- * @param red the red part of the RGB value
- * @param green the green part of the RGB value
- * @param blue the blue part of the RGB value
- * @param array an array for the result (at least 3 elements), or null
- * @return the array containing HSB value
- * @throws ArrayIndexOutOfBoundsException of array is too small
- * @see #getRGB()
- * @see #Color(int)
- * @see ColorModel#getRGBdefault()
- */
- public static float[] RGBtoHSB(int red, int green, int blue, float array[])
- {
- if (array == null)
- array = new float[3];
- // Calculate brightness.
- int min;
- int max;
- if (red < green)
- {
- min = red;
- max = green;
- }
- else
- {
- min = green;
- max = red;
- }
- if (blue > max)
- max = blue;
- else if (blue < min)
- min = blue;
- array[2] = max / 255f;
- // Calculate saturation.
- if (max == 0)
- array[1] = 0;
- else
- array[1] = (max - min) / max;
- // Calculate hue.
- if (array[1] == 0)
- array[0] = 0;
- else
- {
- float delta = (max - min) * 6;
- if (red == max)
- array[0] = (green - blue) / delta;
- else if (green == max)
- array[0] = 1f / 3 + (blue - red) / delta;
- else
- array[0] = 2f / 3 + (red - green) / delta;
- if (array[0] < 0)
- array[0]++;
- }
- return array;
- }
-
- /**
- * Returns a new instance of <code>Color</code> based on the specified
- * HSB values. The hue may be any floating point; it's fractional portion
- * is used to select the angle in the HSB model. The saturation and
- * brightness must be between 0 and 1.
- *
- * @param hue the hue of the HSB value
- * @param saturation the saturation of the HSB value
- * @param brightness the brightness of the HSB value
- * @return the new <code>Color</code> object
- */
- public static Color getHSBColor(float hue, float saturation,
- float brightness)
- {
- return new Color(HSBtoRGB(hue, saturation, brightness), false);
- }
-
- /**
- * Returns a float array with the red, green, and blue components, and the
- * alpha value, in the default sRGB space, with values in the range 0.0-1.0.
- * If the array is null, a new one is created, otherwise it is recycled.
- *
- * @param array the array to put results into (at least 4 elements), or null
- * @return the RGB components and alpha value
- * @throws ArrayIndexOutOfBoundsException if array is too small
- */
- public float[] getRGBComponents(float[] array)
- {
- if (array == null)
- array = new float[4];
- getRGBColorComponents(array);
- // Stupid serialization issues require this check.
- array[3] = (falpha == 0 && frgbvalue == null
- ? ((getRGB() & ALPHA_MASK) >> 24) / 255f : falpha);
- return array;
- }
-
- /**
- * Returns a float array with the red, green, and blue components, in the
- * default sRGB space, with values in the range 0.0-1.0. If the array is
- * null, a new one is created, otherwise it is recycled.
- *
- * @param array the array to put results into (at least 3 elements), or null
- * @return the RGB components
- * @throws ArrayIndexOutOfBoundsException if array is too small
- */
- public float[] getRGBColorComponents(float[] array)
- {
- if (array == null)
- array = new float[3];
- else if (array == frgbvalue)
- return array; // Optimization for getColorComponents(float[]).
- if (frgbvalue == null)
- {
- // Do not inline getRGB() to this.value, because of SystemColor.
- int value = getRGB();
- frgbvalue = new float[] { ((value & RED_MASK) >> 16) / 255f,
- ((value & GREEN_MASK) >> 8) / 255f,
- (value & BLUE_MASK) / 255f };
- }
- array[0] = frgbvalue[0];
- array[1] = frgbvalue[1];
- array[2] = frgbvalue[2];
- return array;
- }
-
- /**
- * Returns a float array containing the color and alpha components of this
- * color in the ColorSpace it was created with (the constructors which do
- * not take a ColorSpace parameter use a default sRGB ColorSpace). If the
- * array is null, a new one is created, otherwise it is recycled, and must
- * have at least one more position than components used in the color space.
- *
- * @param array the array to put results into, or null
- * @return the original color space components and alpha value
- * @throws ArrayIndexOutOfBoundsException if array is too small
- */
- public float[] getComponents(float[] array)
- {
- int numComponents = cs == null ? 3 : cs.getNumComponents();
- if (array == null)
- array = new float[1 + numComponents];
- getColorComponents(array);
- // Stupid serialization issues require this check.
- array[numComponents] = (falpha == 0 && frgbvalue == null
- ? ((getRGB() & ALPHA_MASK) >> 24) / 255f : falpha);
- return array;
- }
-
- /**
- * Returns a float array containing the color components of this color in
- * the ColorSpace it was created with (the constructors which do not take
- * a ColorSpace parameter use a default sRGB ColorSpace). If the array is
- * null, a new one is created, otherwise it is recycled, and must have at
- * least as many positions as used in the color space.
- *
- * @param array the array to put results into, or null
- * @return the original color space components
- * @throws ArrayIndexOutOfBoundsException if array is too small
- */
- public float[] getColorComponents(float[] array)
- {
- int numComponents = cs == null ? 3 : cs.getNumComponents();
- if (array == null)
- array = new float[numComponents];
- if (fvalue == null) // If fvalue is null, cs should be null too.
- fvalue = getRGBColorComponents(frgbvalue);
- System.arraycopy(fvalue, 0, array, 0, numComponents);
- return array;
- }
-
- /**
- * Returns a float array containing the color and alpha components of this
- * color in the given ColorSpace. If the array is null, a new one is
- * created, otherwise it is recycled, and must have at least one more
- * position than components used in the color space.
- *
- * @param space the color space to translate to
- * @param array the array to put results into, or null
- * @return the color space components and alpha value
- * @throws ArrayIndexOutOfBoundsException if array is too small
- * @throws NullPointerException if space is null
- */
- public float[] getComponents(ColorSpace space, float[] array)
- {
- int numComponents = space.getNumComponents();
- if (array == null)
- array = new float[1 + numComponents];
- getColorComponents(space, array);
- // Stupid serialization issues require this check.
- array[numComponents] = (falpha == 0 && frgbvalue == null
- ? ((getRGB() & ALPHA_MASK) >> 24) / 255f : falpha);
- return array;
- }
-
- /**
- * Returns a float array containing the color components of this color in
- * the given ColorSpace. If the array is null, a new one is created,
- * otherwise it is recycled, and must have at least as many positions as
- * used in the color space.
- *
- * @param space the color space to translate to
- * @return the color space components
- * @throws ArrayIndexOutOfBoundsException if array is too small
- * @throws NullPointerException if space is null
- */
- public float[] getColorComponents(ColorSpace space, float[] array)
- {
- float[] components = space.fromRGB(getRGBColorComponents(frgbvalue));
- if (array == null)
- return components;
- System.arraycopy(components, 0, array, 0, components.length);
- return array;
- }
-
- /**
- * Returns the color space of this color. Except for the constructor which
- * takes a ColorSpace argument, this will be an implementation of
- * ColorSpace.CS_sRGB.
- *
- * @return the color space
- */
- public ColorSpace getColorSpace()
- {
- return cs == null ? ColorSpace.getInstance(ColorSpace.CS_sRGB) : cs;
- }
-
- /**
- * Returns a paint context, used for filling areas of a raster scan with
- * this color. Since the color is constant across the entire rectangle, and
- * since it is always in sRGB space, this implementation returns the same
- * object, regardless of the parameters. Subclasses, however, may have a
- * mutable result.
- *
- * @param cm the requested color model
- * @param deviceBounds the bounding box in device coordinates, ignored
- * @param userBounds the bounding box in user coordinates, ignored
- * @param xform the bounds transformation, ignored
- * @param hints any rendering hints, ignored
- * @return a context for painting this solid color
- */
- public PaintContext createContext(ColorModel cm, Rectangle deviceBounds,
- Rectangle2D userBounds,
- AffineTransform xform,
- RenderingHints hints)
- {
- if (context == null || !context.getColorModel().equals(cm))
- context = new ColorPaintContext(cm,value);
- return context;
- }
-
- /**
- * Returns the transparency level of this color.
- *
- * @return one of {@link #OPAQUE}, {@link #BITMASK}, or {@link #TRANSLUCENT}
- */
- public int getTransparency()
- {
- // Do not inline getRGB() to this.value, because of SystemColor.
- int alpha = getRGB() & ALPHA_MASK;
- return alpha == (255 << 24) ? OPAQUE : alpha == 0 ? BITMASK : TRANSLUCENT;
- }
-
- /**
- * Converts float values to integer value.
- *
- * @param red the red value
- * @param green the green value
- * @param blue the blue value
- * @param alpha the alpha value
- * @return the integer value made of 8-bit sections
- * @throws IllegalArgumentException if parameters are out of range 0.0-1.0
- */
- private static int convert(float red, float green, float blue, float alpha)
- {
- if (red < 0 || red > 1 || green < 0 || green > 1 || blue < 0 || blue > 1
- || alpha < 0 || alpha > 1)
- throw new IllegalArgumentException("Bad RGB values");
- int redval = Math.round(255 * red);
- int greenval = Math.round(255 * green);
- int blueval = Math.round(255 * blue);
- int alphaval = Math.round(255 * alpha);
- return (alphaval << 24) | (redval << 16) | (greenval << 8) | blueval;
- }
-} // class Color
diff --git a/libjava/java/awt/ColorPaintContext.java b/libjava/java/awt/ColorPaintContext.java
deleted file mode 100644
index 8396fcd6317..00000000000
--- a/libjava/java/awt/ColorPaintContext.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/* ColorPaintContext.java -- context for painting solid colors
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.image.ColorModel;
-import java.awt.image.Raster;
-
-/**
- * This class provides a paint context which will fill a rectanglar region of
- * a raster scan with the given color. However, it is not yet completely
- * implemented.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
-class ColorPaintContext implements PaintContext
-{
- /**
- * The color to fill any raster with. Package visible for use in
- * SystemColor.
- */
- final int color;
- final ColorModel colorModel;
-
- private ColorRaster cachedRaster;
-
-
- /**
- * Create the context for a given color.
- *
- * @param c The solid color to use.
- */
- ColorPaintContext(int colorRGB)
- {
- this(ColorModel.getRGBdefault(), colorRGB);
- }
-
- /**
- * Create the context for a given color.
- *
- * @param cm The color model of this context.
- * @param c The solid color to use.
- */
- ColorPaintContext(ColorModel cm,int colorRGB)
- {
- color = colorRGB;
- colorModel = cm;
- }
-
- /**
- * Release the resources allocated for the paint. As the color is constant,
- * there aren't any resources.
- */
- public void dispose()
- {
- }
-
- /**
- * Return the color model of this context.
- *
- * @return the context color model
- */
- public ColorModel getColorModel()
- {
- return colorModel;
- }
-
- /**
- * Return a raster containing the colors for the graphics operation.
- *
- * @param x the x-coordinate, in device space
- * @param y the y-coordinate, in device space
- * @param w the width, in device space
- * @param h the height, in device space
- * @return a raster for the given area and color
- */
- public Raster getRaster(int x, int y, int width, int height)
- {
- if( cachedRaster == null
- || cachedRaster.getWidth() < width
- || cachedRaster.getHeight() < height)
- {
- cachedRaster = new ColorRaster(colorModel, 0, 0, width, height, color);
- }
- return cachedRaster.createChild(0 ,0 ,width ,height ,x ,y , null);
- }
-
- /**
- * A ColorRaster is a raster that is completely filled with one color. The
- * data layout is taken from the color model given to the constructor.
- */
- private class ColorRaster extends Raster
- {
-
- /**
- * Create a raster that is compaltible with the given color model and
- * filled with the given color.
- * @param cm The color model for this raster.
- * @param x The smallest horizontal corrdinate in the raster.
- * @param y The smallest vertical coordinate in the raster.
- * @param width The width of the raster.
- * @param height The height of the raster.
- * @param rgbPixel The RGB value of the color for this raster.
- */
- ColorRaster(ColorModel cm,int x, int y, int width, int height, int rgbPixel)
- {
- super(cm.createCompatibleSampleModel(width,height),new Point(x,y));
- Object pixel = cm.getDataElements(rgbPixel,null);
- getSampleModel().setDataElements(0, 0,
- width, height,
- multiplyData(pixel,null,width*height),
- dataBuffer);
- }
-
-
-
- private Object multiplyData(Object src, Object dest, int factor)
- {
- Object from;
- int srcLength = 0;
- if (src instanceof byte[])
- {
- srcLength = ((byte[])src).length;
-
- if (dest == null) dest = new byte[factor * srcLength];
- }
- else if (src instanceof short[])
- {
- srcLength = ((short[])src).length;
- if (dest == null) dest = new short[factor * srcLength];
- }
- else if (src instanceof int[])
- {
- srcLength = ((int[]) src).length;
- if (dest == null) dest = new int[factor * srcLength];
- }
- else
- {
- throw new ClassCastException("Unknown data buffer type");
- }
-
- System.arraycopy(src,0,dest,0,srcLength);
-
- int count = 1;
- while(count*2 < factor)
- {
- System.arraycopy(dest, 0, dest, count * srcLength, count*srcLength);
- count *= 2;
- }
-
- if(factor > count)
- System.arraycopy(dest,0, dest, count * srcLength,
- (factor - count) * srcLength );
-
- return dest;
- }
-
- }
-
-} // class ColorPaintContext
diff --git a/libjava/java/awt/Component.java b/libjava/java/awt/Component.java
deleted file mode 100644
index 8b99321a64d..00000000000
--- a/libjava/java/awt/Component.java
+++ /dev/null
@@ -1,6005 +0,0 @@
-/* Component.java -- a graphics component
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.dnd.DropTarget;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.HierarchyBoundsListener;
-import java.awt.event.HierarchyEvent;
-import java.awt.event.HierarchyListener;
-import java.awt.event.InputEvent;
-import java.awt.event.InputMethodEvent;
-import java.awt.event.InputMethodListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
-import java.awt.event.PaintEvent;
-import java.awt.event.WindowEvent;
-import java.awt.im.InputContext;
-import java.awt.im.InputMethodRequests;
-import java.awt.image.BufferStrategy;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageObserver;
-import java.awt.image.ImageProducer;
-import java.awt.image.VolatileImage;
-import java.awt.peer.ComponentPeer;
-import java.awt.peer.LightweightPeer;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.util.Collections;
-import java.util.EventListener;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleComponent;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleState;
-import javax.accessibility.AccessibleStateSet;
-
-/**
- * The root of all evil. All graphical representations are subclasses of this
- * giant class, which is designed for screen display and user interaction.
- * This class can be extended directly to build a lightweight component (one
- * not associated with a native window); lightweight components must reside
- * inside a heavyweight window.
- *
- * <p>This class is Serializable, which has some big implications. A user can
- * save the state of all graphical components in one VM, and reload them in
- * another. Note that this class will only save Serializable listeners, and
- * ignore the rest, without causing any serialization exceptions. However, by
- * making a listener serializable, and adding it to another element, you link
- * in that entire element to the state of this component. To get around this,
- * use the idiom shown in the example below - make listeners non-serializable
- * in inner classes, rather than using this object itself as the listener, if
- * external objects do not need to save the state of this object.
- *
- * <pre>
- * import java.awt.*;
- * import java.awt.event.*;
- * import java.io.Serializable;
- * class MyApp implements Serializable
- * {
- * BigObjectThatShouldNotBeSerializedWithAButton bigOne;
- * // Serializing aButton will not suck in an instance of MyApp, with its
- * // accompanying field bigOne.
- * Button aButton = new Button();
- * class MyActionListener implements ActionListener
- * {
- * public void actionPerformed(ActionEvent e)
- * {
- * System.out.println("Hello There");
- * }
- * }
- * MyApp()
- * {
- * aButton.addActionListener(new MyActionListener());
- * }
- * }
- * </pre>
- *
- * <p>Status: Incomplete. The event dispatch mechanism is implemented. All
- * other methods defined in the J2SE 1.3 API javadoc exist, but are mostly
- * incomplete or only stubs; except for methods relating to the Drag and
- * Drop, Input Method, and Accessibility frameworks: These methods are
- * present but commented out.
- *
- * @author original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status still missing 1.4 support
- */
-public abstract class Component
- implements ImageObserver, MenuContainer, Serializable
-{
- // Word to the wise - this file is huge. Search for '\f' (^L) for logical
- // sectioning by fields, public API, private API, and nested classes.
-
-
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -7644114512714619750L;
-
- /**
- * Constant returned by the <code>getAlignmentY</code> method to indicate
- * that the component wishes to be aligned to the top relative to
- * other components.
- *
- * @see #getAlignmentY()
- */
- public static final float TOP_ALIGNMENT = 0;
-
- /**
- * Constant returned by the <code>getAlignmentY</code> and
- * <code>getAlignmentX</code> methods to indicate
- * that the component wishes to be aligned to the center relative to
- * other components.
- *
- * @see #getAlignmentX()
- * @see #getAlignmentY()
- */
- public static final float CENTER_ALIGNMENT = 0.5f;
-
- /**
- * Constant returned by the <code>getAlignmentY</code> method to indicate
- * that the component wishes to be aligned to the bottom relative to
- * other components.
- *
- * @see #getAlignmentY()
- */
- public static final float BOTTOM_ALIGNMENT = 1;
-
- /**
- * Constant returned by the <code>getAlignmentX</code> method to indicate
- * that the component wishes to be aligned to the right relative to
- * other components.
- *
- * @see #getAlignmentX()
- */
- public static final float RIGHT_ALIGNMENT = 1;
-
- /**
- * Constant returned by the <code>getAlignmentX</code> method to indicate
- * that the component wishes to be aligned to the left relative to
- * other components.
- *
- * @see #getAlignmentX()
- */
- public static final float LEFT_ALIGNMENT = 0;
-
- /**
- * Make the treelock a String so that it can easily be identified
- * in debug dumps. We clone the String in order to avoid a conflict in
- * the unlikely event that some other package uses exactly the same string
- * as a lock object.
- */
- static final Object treeLock = new String("AWT_TREE_LOCK");
-
- // Serialized fields from the serialization spec.
-
- /**
- * The x position of the component in the parent's coordinate system.
- *
- * @see #getLocation()
- * @serial the x position
- */
- int x;
-
- /**
- * The y position of the component in the parent's coordinate system.
- *
- * @see #getLocation()
- * @serial the y position
- */
- int y;
-
- /**
- * The component width.
- *
- * @see #getSize()
- * @serial the width
- */
- int width;
-
- /**
- * The component height.
- *
- * @see #getSize()
- * @serial the height
- */
- int height;
-
- /**
- * The foreground color for the component. This may be null.
- *
- * @see #getForeground()
- * @see #setForeground(Color)
- * @serial the foreground color
- */
- Color foreground;
-
- /**
- * The background color for the component. This may be null.
- *
- * @see #getBackground()
- * @see #setBackground(Color)
- * @serial the background color
- */
- Color background;
-
- /**
- * The default font used in the component. This may be null.
- *
- * @see #getFont()
- * @see #setFont(Font)
- * @serial the font
- */
- Font font;
-
- /**
- * The font in use by the peer, or null if there is no peer.
- *
- * @serial the peer's font
- */
- Font peerFont;
-
- /**
- * The cursor displayed when the pointer is over this component. This may
- * be null.
- *
- * @see #getCursor()
- * @see #setCursor(Cursor)
- */
- Cursor cursor;
-
- /**
- * The locale for the component.
- *
- * @see #getLocale()
- * @see #setLocale(Locale)
- */
- Locale locale = Locale.getDefault ();
-
- /**
- * True if the object should ignore repaint events (usually because it is
- * not showing).
- *
- * @see #getIgnoreRepaint()
- * @see #setIgnoreRepaint(boolean)
- * @serial true to ignore repaints
- * @since 1.4
- */
- boolean ignoreRepaint;
-
- /**
- * True when the object is visible (although it is only showing if all
- * ancestors are likewise visible). For component, this defaults to true.
- *
- * @see #isVisible()
- * @see #setVisible(boolean)
- * @serial true if visible
- */
- boolean visible = true;
-
- /**
- * True if the object is enabled, meaning it can interact with the user.
- * For component, this defaults to true.
- *
- * @see #isEnabled()
- * @see #setEnabled(boolean)
- * @serial true if enabled
- */
- boolean enabled = true;
-
- /**
- * True if the object is valid. This is set to false any time a size
- * adjustment means the component need to be layed out again.
- *
- * @see #isValid()
- * @see #validate()
- * @see #invalidate()
- * @serial true if layout is valid
- */
- boolean valid;
-
- /**
- * The DropTarget for drag-and-drop operations.
- *
- * @see #getDropTarget()
- * @see #setDropTarget(DropTarget)
- * @serial the drop target, or null
- * @since 1.2
- */
- DropTarget dropTarget;
-
- /**
- * The list of popup menus for this component.
- *
- * @see #add(PopupMenu)
- * @serial the list of popups
- */
- Vector popups;
-
- /**
- * The component's name. May be null, in which case a default name is
- * generated on the first use.
- *
- * @see #getName()
- * @see #setName(String)
- * @serial the name
- */
- String name;
-
- /**
- * True once the user has set the name. Note that the user may set the name
- * to null.
- *
- * @see #name
- * @see #getName()
- * @see #setName(String)
- * @serial true if the name has been explicitly set
- */
- boolean nameExplicitlySet;
-
- /**
- * Indicates if the object can be focused. Defaults to true for components.
- *
- * @see #isFocusable()
- * @see #setFocusable(boolean)
- * @since 1.4
- */
- boolean focusable = true;
-
- /**
- * Tracks whether this component's {@link #isFocusTraversable}
- * method has been overridden.
- *
- * @since 1.4
- */
- int isFocusTraversableOverridden;
-
- /**
- * The focus traversal keys, if not inherited from the parent or
- * default keyboard focus manager. These sets will contain only
- * AWTKeyStrokes that represent press and release events to use as
- * focus control.
- *
- * @see #getFocusTraversalKeys(int)
- * @see #setFocusTraversalKeys(int, Set)
- * @since 1.4
- */
- Set[] focusTraversalKeys;
-
- /**
- * True if focus traversal keys are enabled. This defaults to true for
- * Component. If this is true, keystrokes in focusTraversalKeys are trapped
- * and processed automatically rather than being passed on to the component.
- *
- * @see #getFocusTraversalKeysEnabled()
- * @see #setFocusTraversalKeysEnabled(boolean)
- * @since 1.4
- */
- boolean focusTraversalKeysEnabled = true;
-
- /**
- * Cached information on the minimum size. Should have been transient.
- *
- * @serial ignore
- */
- Dimension minSize;
-
- /**
- * Cached information on the preferred size. Should have been transient.
- *
- * @serial ignore
- */
- Dimension prefSize;
-
- /**
- * Set to true if an event is to be handled by this component, false if
- * it is to be passed up the hierarcy.
- *
- * @see #dispatchEvent(AWTEvent)
- * @serial true to process event locally
- */
- boolean newEventsOnly;
-
- /**
- * Set by subclasses to enable event handling of particular events, and
- * left alone when modifying listeners. For component, this defaults to
- * enabling only input methods.
- *
- * @see #enableInputMethods(boolean)
- * @see AWTEvent
- * @serial the mask of events to process
- */
- long eventMask = AWTEvent.INPUT_ENABLED_EVENT_MASK;
-
- /**
- * Describes all registered PropertyChangeListeners.
- *
- * @see #addPropertyChangeListener(PropertyChangeListener)
- * @see #removePropertyChangeListener(PropertyChangeListener)
- * @see #firePropertyChange(String, Object, Object)
- * @serial the property change listeners
- * @since 1.2
- */
- PropertyChangeSupport changeSupport;
-
- /**
- * True if the component has been packed (layed out).
- *
- * @serial true if this is packed
- */
- boolean isPacked;
-
- /**
- * The serialization version for this class. Currently at version 4.
- *
- * XXX How do we handle prior versions?
- *
- * @serial the serialization version
- */
- int componentSerializedDataVersion = 4;
-
- /**
- * The accessible context associated with this component. This is only set
- * by subclasses.
- *
- * @see #getAccessibleContext()
- * @serial the accessibility context
- * @since 1.2
- */
- AccessibleContext accessibleContext;
-
-
- // Guess what - listeners are special cased in serialization. See
- // readObject and writeObject.
-
- /** Component listener chain. */
- transient ComponentListener componentListener;
-
- /** Focus listener chain. */
- transient FocusListener focusListener;
-
- /** Key listener chain. */
- transient KeyListener keyListener;
-
- /** Mouse listener chain. */
- transient MouseListener mouseListener;
-
- /** Mouse motion listener chain. */
- transient MouseMotionListener mouseMotionListener;
-
- /**
- * Mouse wheel listener chain.
- *
- * @since 1.4
- */
- transient MouseWheelListener mouseWheelListener;
-
- /**
- * Input method listener chain.
- *
- * @since 1.2
- */
- transient InputMethodListener inputMethodListener;
-
- /**
- * Hierarcy listener chain.
- *
- * @since 1.3
- */
- transient HierarchyListener hierarchyListener;
-
- /**
- * Hierarcy bounds listener chain.
- *
- * @since 1.3
- */
- transient HierarchyBoundsListener hierarchyBoundsListener;
-
- // Anything else is non-serializable, and should be declared "transient".
-
- /** The parent. */
- transient Container parent;
-
- /** The associated native peer. */
- transient ComponentPeer peer;
-
- /** The preferred component orientation. */
- transient ComponentOrientation orientation = ComponentOrientation.UNKNOWN;
-
- /**
- * The associated graphics configuration.
- *
- * @since 1.4
- */
- transient GraphicsConfiguration graphicsConfig;
-
- /**
- * The buffer strategy for repainting.
- *
- * @since 1.4
- */
- transient BufferStrategy bufferStrategy;
-
- /**
- * true if requestFocus was called on this component when its
- * top-level ancestor was not focusable.
- */
- private transient FocusEvent pendingFocusRequest = null;
-
- /**
- * The system properties that affect image updating.
- */
- private static transient boolean incrementalDraw;
- private static transient Long redrawRate;
-
- static
- {
- incrementalDraw = Boolean.getBoolean ("awt.image.incrementalDraw");
- redrawRate = Long.getLong ("awt.image.redrawrate");
- }
-
- // Public and protected API.
-
- /**
- * Default constructor for subclasses. When Component is extended directly,
- * it forms a lightweight component that must be hosted in an opaque native
- * container higher in the tree.
- */
- protected Component()
- {
- }
-
- /**
- * Returns the name of this component.
- *
- * @return the name of this component
- * @see #setName(String)
- * @since 1.1
- */
- public String getName()
- {
- if (name == null && ! nameExplicitlySet)
- name = generateName();
- return name;
- }
-
- /**
- * Sets the name of this component to the specified name.
- *
- * @param name the new name of this component
- * @see #getName()
- * @since 1.1
- */
- public void setName(String name)
- {
- nameExplicitlySet = true;
- this.name = name;
- }
-
- /**
- * Returns the parent of this component.
- *
- * @return the parent of this component
- */
- public Container getParent()
- {
- return parent;
- }
-
- /**
- * Returns the native windowing system peer for this component. Only the
- * platform specific implementation code should call this method.
- *
- * @return the peer for this component
- * @deprecated user programs should not directly manipulate peers; use
- * {@link #isDisplayable()} instead
- */
- // Classpath's Gtk peers rely on this.
- public ComponentPeer getPeer()
- {
- return peer;
- }
-
- /**
- * Set the associated drag-and-drop target, which receives events when this
- * is enabled.
- *
- * @param dt the new drop target
- * @see #isEnabled()
- */
- public void setDropTarget(DropTarget dt)
- {
- this.dropTarget = dt;
- }
-
- /**
- * Gets the associated drag-and-drop target, if there is one.
- *
- * @return the drop target
- */
- public DropTarget getDropTarget()
- {
- return dropTarget;
- }
-
- /**
- * Returns the graphics configuration of this component, if there is one.
- * If it has not been set, it is inherited from the parent.
- *
- * @return the graphics configuration, or null
- * @since 1.3
- */
- public GraphicsConfiguration getGraphicsConfiguration()
- {
- return getGraphicsConfigurationImpl();
- }
-
- /**
- * Returns the object used for synchronization locks on this component
- * when performing tree and layout functions.
- *
- * @return the synchronization lock for this component
- */
- public final Object getTreeLock()
- {
- return treeLock;
- }
-
- /**
- * Returns the toolkit in use for this component. The toolkit is associated
- * with the frame this component belongs to.
- *
- * @return the toolkit for this component
- */
- public Toolkit getToolkit()
- {
- if (peer != null)
- {
- Toolkit tk = peer.getToolkit();
- if (tk != null)
- return tk;
- }
- // Get toolkit for lightweight component.
- if (parent != null)
- return parent.getToolkit();
- return Toolkit.getDefaultToolkit();
- }
-
- /**
- * Tests whether or not this component is valid. A invalid component needs
- * to have its layout redone.
- *
- * @return true if this component is valid
- * @see #validate()
- * @see #invalidate()
- */
- public boolean isValid()
- {
- return valid;
- }
-
- /**
- * Tests if the component is displayable. It must be connected to a native
- * screen resource, and all its ancestors must be displayable. A containment
- * hierarchy is made displayable when a window is packed or made visible.
- *
- * @return true if the component is displayable
- * @see Container#add(Component)
- * @see Container#remove(Component)
- * @see Window#pack()
- * @see Window#show()
- * @see Window#dispose()
- * @since 1.2
- */
- public boolean isDisplayable()
- {
- if (parent != null)
- return parent.isDisplayable();
- return false;
- }
-
- /**
- * Tests whether or not this component is visible. Except for top-level
- * frames, components are initially visible.
- *
- * @return true if the component is visible
- * @see #setVisible(boolean)
- */
- public boolean isVisible()
- {
- return visible;
- }
-
- /**
- * Tests whether or not this component is actually being shown on
- * the screen. This will be true if and only if it this component is
- * visible and its parent components are all visible.
- *
- * @return true if the component is showing on the screen
- * @see #setVisible(boolean)
- */
- public boolean isShowing()
- {
- if (! visible || peer == null)
- return false;
-
- return parent == null ? true : parent.isShowing();
- }
-
- /**
- * Tests whether or not this component is enabled. Components are enabled
- * by default, and must be enabled to receive user input or generate events.
- *
- * @return true if the component is enabled
- * @see #setEnabled(boolean)
- */
- public boolean isEnabled()
- {
- return enabled;
- }
-
- /**
- * Enables or disables this component. The component must be enabled to
- * receive events (except that lightweight components always receive mouse
- * events).
- *
- * @param enabled true to enable this component
- *
- * @see #isEnabled()
- * @see #isLightweight()
- *
- * @since 1.1
- */
- public void setEnabled(boolean enabled)
- {
- enable(enabled);
- }
-
- /**
- * Enables this component.
- *
- * @deprecated use {@link #setEnabled(boolean)} instead
- */
- public void enable()
- {
- this.enabled = true;
- if (peer != null)
- peer.setEnabled (true);
- }
-
- /**
- * Enables or disables this component.
- *
- * @param enabled true to enable this component
- *
- * @deprecated use {@link #setEnabled(boolean)} instead
- */
- public void enable(boolean enabled)
- {
- if (enabled)
- enable();
- else
- disable();
- }
-
- /**
- * Disables this component.
- *
- * @deprecated use {@link #setEnabled(boolean)} instead
- */
- public void disable()
- {
- this.enabled = false;
- if (peer != null)
- peer.setEnabled (false);
- }
-
- /**
- * Checks if this image is painted to an offscreen image buffer that is
- * later copied to screen (double buffering reduces flicker). This version
- * returns false, so subclasses must override it if they provide double
- * buffering.
- *
- * @return true if this is double buffered; defaults to false
- */
- public boolean isDoubleBuffered()
- {
- return false;
- }
-
- /**
- * Enables or disables input method support for this component. By default,
- * components have this enabled. Input methods are given the opportunity
- * to process key events before this component and its listeners.
- *
- * @param enable true to enable input method processing
- * @see #processKeyEvent(KeyEvent)
- * @since 1.2
- */
- public void enableInputMethods(boolean enable)
- {
- // XXX Implement.
- throw new Error("not implemented");
- }
-
- /**
- * Makes this component visible or invisible. Note that it wtill might
- * not show the component, if a parent is invisible.
- *
- * @param visible true to make this component visible
- *
- * @see #isVisible()
- *
- * @since 1.1
- */
- public void setVisible(boolean visible)
- {
- // Inspection by subclassing shows that Sun's implementation calls
- // show(boolean) which then calls show() or hide(). It is the show()
- // method that is overriden in subclasses like Window.
- show(visible);
- }
-
- /**
- * Makes this component visible on the screen.
- *
- * @deprecated use {@link #setVisible(boolean)} instead
- */
- public void show()
- {
- // We must set visible before showing the peer. Otherwise the
- // peer could post paint events before visible is true, in which
- // case lightweight components are not initially painted --
- // Container.paint first calls isShowing () before painting itself
- // and its children.
- if(!isVisible())
- {
- this.visible = true;
- if (peer != null)
- peer.setVisible(true);
- invalidate();
- ComponentEvent ce =
- new ComponentEvent(this,ComponentEvent.COMPONENT_SHOWN);
- getToolkit().getSystemEventQueue().postEvent(ce);
- }
- }
-
- /**
- * Makes this component visible or invisible.
- *
- * @param visible true to make this component visible
- *
- * @deprecated use {@link #setVisible(boolean)} instead
- */
- public void show(boolean visible)
- {
- if (visible)
- show();
- else
- hide();
- }
-
- /**
- * Hides this component so that it is no longer shown on the screen.
- *
- * @deprecated use {@link #setVisible(boolean)} instead
- */
- public void hide()
- {
- if (isVisible())
- {
- if (peer != null)
- peer.setVisible(false);
- this.visible = false;
- invalidate();
- ComponentEvent ce =
- new ComponentEvent(this,ComponentEvent.COMPONENT_HIDDEN);
- getToolkit().getSystemEventQueue().postEvent(ce);
- }
- }
-
- /**
- * Returns this component's foreground color. If not set, this is inherited
- * from the parent.
- *
- * @return this component's foreground color, or null
- * @see #setForeground(Color)
- */
- public Color getForeground()
- {
- if (foreground != null)
- return foreground;
- return parent == null ? SystemColor.windowText : parent.getForeground();
- }
-
- /**
- * Sets this component's foreground color to the specified color. This is a
- * bound property.
- *
- * @param c the new foreground color
- * @see #getForeground()
- */
- public void setForeground(Color c)
- {
- firePropertyChange("foreground", foreground, c);
- if (peer != null)
- peer.setForeground(c);
- foreground = c;
- }
-
- /**
- * Tests if the foreground was explicitly set, or just inherited from the
- * parent.
- *
- * @return true if the foreground has been set
- * @since 1.4
- */
- public boolean isForegroundSet()
- {
- return foreground != null;
- }
-
- /**
- * Returns this component's background color. If not set, this is inherited
- * from the parent.
- *
- * @return the background color of the component, or null
- * @see #setBackground(Color)
- */
- public Color getBackground()
- {
- if (background != null)
- return background;
- return parent == null ? SystemColor.window : parent.getBackground();
- }
-
- /**
- * Sets this component's background color to the specified color. The parts
- * of the component affected by the background color may by system dependent.
- * This is a bound property.
- *
- * @param c the new background color
- * @see #getBackground()
- */
- public void setBackground(Color c)
- {
- // If c is null, inherit from closest ancestor whose bg is set.
- if (c == null && parent != null)
- c = parent.getBackground();
- firePropertyChange("background", background, c);
- if (peer != null && c != null)
- peer.setBackground(c);
- background = c;
- }
-
- /**
- * Tests if the background was explicitly set, or just inherited from the
- * parent.
- *
- * @return true if the background has been set
- * @since 1.4
- */
- public boolean isBackgroundSet()
- {
- return background != null;
- }
-
- /**
- * Returns the font in use for this component. If not set, this is inherited
- * from the parent.
- *
- * @return the font for this component
- * @see #setFont(Font)
- */
- public Font getFont()
- {
- if (font != null)
- return font;
-
- if (parent != null)
- return parent.getFont ();
- else
- return new Font ("Dialog", Font.PLAIN, 12);
- }
-
- /**
- * Sets the font for this component to the specified font. This is a bound
- * property.
- *
- * @param newFont the new font for this component
- *
- * @see #getFont()
- */
- public void setFont(Font newFont)
- {
- if (font == newFont)
- return;
-
- Font oldFont = font;
- font = newFont;
- if (peer != null)
- peer.setFont(font);
- firePropertyChange("font", oldFont, newFont);
- invalidate();
- }
-
- /**
- * Tests if the font was explicitly set, or just inherited from the parent.
- *
- * @return true if the font has been set
- * @since 1.4
- */
- public boolean isFontSet()
- {
- return font != null;
- }
-
- /**
- * Returns the locale for this component. If this component does not
- * have a locale, the locale of the parent component is returned.
- *
- * @return the locale for this component
- * @throws IllegalComponentStateException if it has no locale or parent
- * @see #setLocale(Locale)
- * @since 1.1
- */
- public Locale getLocale()
- {
- if (locale != null)
- return locale;
- if (parent == null)
- throw new IllegalComponentStateException
- ("Component has no parent: can't determine Locale");
- return parent.getLocale();
- }
-
- /**
- * Sets the locale for this component to the specified locale. This is a
- * bound property.
- *
- * @param newLocale the new locale for this component
- */
- public void setLocale(Locale newLocale)
- {
- if (locale == newLocale)
- return;
-
- Locale oldLocale = locale;
- locale = newLocale;
- firePropertyChange("locale", oldLocale, newLocale);
- // New writing/layout direction or more/less room for localized labels.
- invalidate();
- }
-
- /**
- * Returns the color model of the device this componet is displayed on.
- *
- * @return this object's color model
- * @see Toolkit#getColorModel()
- */
- public ColorModel getColorModel()
- {
- GraphicsConfiguration config = getGraphicsConfiguration();
- return config != null ? config.getColorModel()
- : getToolkit().getColorModel();
- }
-
- /**
- * Returns the location of this component's top left corner relative to
- * its parent component. This may be outdated, so for synchronous behavior,
- * you should use a component listner.
- *
- * @return the location of this component
- * @see #setLocation(int, int)
- * @see #getLocationOnScreen()
- * @since 1.1
- */
- public Point getLocation()
- {
- return location ();
- }
-
- /**
- * Returns the location of this component's top left corner in screen
- * coordinates.
- *
- * @return the location of this component in screen coordinates
- * @throws IllegalComponentStateException if the component is not showing
- */
- public Point getLocationOnScreen()
- {
- if (! isShowing())
- throw new IllegalComponentStateException("component not showing");
- // We know peer != null here.
- return peer.getLocationOnScreen();
- }
-
- /**
- * Returns the location of this component's top left corner relative to
- * its parent component.
- *
- * @return the location of this component
- * @deprecated use {@link #getLocation()} instead
- */
- public Point location()
- {
- return new Point (x, y);
- }
-
- /**
- * Moves this component to the specified location, relative to the parent's
- * coordinates. The coordinates are the new upper left corner of this
- * component.
- *
- * @param x the new X coordinate of this component
- * @param y the new Y coordinate of this component
- * @see #getLocation()
- * @see #setBounds(int, int, int, int)
- */
- public void setLocation(int x, int y)
- {
- move (x, y);
- }
-
- /**
- * Moves this component to the specified location, relative to the parent's
- * coordinates. The coordinates are the new upper left corner of this
- * component.
- *
- * @param x the new X coordinate of this component
- * @param y the new Y coordinate of this component
- * @deprecated use {@link #setLocation(int, int)} instead
- */
- public void move(int x, int y)
- {
- setBounds(x, y, this.width, this.height);
- }
-
- /**
- * Moves this component to the specified location, relative to the parent's
- * coordinates. The coordinates are the new upper left corner of this
- * component.
- *
- * @param p new coordinates for this component
- * @throws NullPointerException if p is null
- * @see #getLocation()
- * @see #setBounds(int, int, int, int)
- * @since 1.1
- */
- public void setLocation(Point p)
- {
- setLocation(p.x, p.y);
- }
-
- /**
- * Returns the size of this object.
- *
- * @return the size of this object
- * @see #setSize(int, int)
- * @since 1.1
- */
- public Dimension getSize()
- {
- return size ();
- }
-
- /**
- * Returns the size of this object.
- *
- * @return the size of this object
- * @deprecated use {@link #getSize()} instead
- */
- public Dimension size()
- {
- return new Dimension (width, height);
- }
-
- /**
- * Sets the size of this component to the specified width and height.
- *
- * @param width the new width of this component
- * @param height the new height of this component
- * @see #getSize()
- * @see #setBounds(int, int, int, int)
- */
- public void setSize(int width, int height)
- {
- resize (width, height);
- }
-
- /**
- * Sets the size of this component to the specified value.
- *
- * @param width the new width of the component
- * @param height the new height of the component
- * @deprecated use {@link #setSize(int, int)} instead
- */
- public void resize(int width, int height)
- {
- setBounds(this.x, this.y, width, height);
- }
-
- /**
- * Sets the size of this component to the specified value.
- *
- * @param d the new size of this component
- * @throws NullPointerException if d is null
- * @see #setSize(int, int)
- * @see #setBounds(int, int, int, int)
- * @since 1.1
- */
- public void setSize(Dimension d)
- {
- resize (d);
- }
-
- /**
- * Sets the size of this component to the specified value.
- *
- * @param d the new size of this component
- * @throws NullPointerException if d is null
- * @deprecated use {@link #setSize(Dimension)} instead
- */
- public void resize(Dimension d)
- {
- resize (d.width, d.height);
- }
-
- /**
- * Returns a bounding rectangle for this component. Note that the
- * returned rectange is relative to this component's parent, not to
- * the screen.
- *
- * @return the bounding rectangle for this component
- * @see #setBounds(int, int, int, int)
- * @see #getLocation()
- * @see #getSize()
- */
- public Rectangle getBounds()
- {
- return bounds ();
- }
-
- /**
- * Returns a bounding rectangle for this component. Note that the
- * returned rectange is relative to this component's parent, not to
- * the screen.
- *
- * @return the bounding rectangle for this component
- * @deprecated use {@link #getBounds()} instead
- */
- public Rectangle bounds()
- {
- return new Rectangle (x, y, width, height);
- }
-
- /**
- * Sets the bounding rectangle for this component to the specified values.
- * Note that these coordinates are relative to the parent, not to the screen.
- *
- * @param x the X coordinate of the upper left corner of the rectangle
- * @param y the Y coordinate of the upper left corner of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @see #getBounds()
- * @see #setLocation(int, int)
- * @see #setLocation(Point)
- * @see #setSize(int, int)
- * @see #setSize(Dimension)
- * @since 1.1
- */
- public void setBounds(int x, int y, int w, int h)
- {
- reshape (x, y, w, h);
- }
-
- /**
- * Sets the bounding rectangle for this component to the specified values.
- * Note that these coordinates are relative to the parent, not to the screen.
- *
- * @param x the X coordinate of the upper left corner of the rectangle
- * @param y the Y coordinate of the upper left corner of the rectangle
- * @param width the width of the rectangle
- * @param height the height of the rectangle
- * @deprecated use {@link #setBounds(int, int, int, int)} instead
- */
- public void reshape(int x, int y, int width, int height)
- {
- int oldx = this.x;
- int oldy = this.y;
- int oldwidth = this.width;
- int oldheight = this.height;
-
- if (this.x == x && this.y == y
- && this.width == width && this.height == height)
- return;
- invalidate ();
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- if (peer != null)
- peer.setBounds (x, y, width, height);
-
- // Erase old bounds and repaint new bounds for lightweights.
- if (isLightweight() && isShowing ())
- {
- boolean shouldRepaintParent = false;
- boolean shouldRepaintSelf = false;
-
- if (parent != null)
- {
- Rectangle parentBounds = parent.getBounds();
- Rectangle oldBounds = new Rectangle(parent.getX() + oldx,
- parent.getY() + oldy,
- oldwidth, oldheight);
- Rectangle newBounds = new Rectangle(parent.getX() + x,
- parent.getY() + y,
- width, height);
- shouldRepaintParent = parentBounds.intersects(oldBounds);
- shouldRepaintSelf = parentBounds.intersects(newBounds);
- }
-
- if (shouldRepaintParent && parent != null)
- parent.repaint(oldx, oldy, oldwidth, oldheight);
- if (shouldRepaintSelf)
- repaint();
- }
-
- // Only post event if this component is visible and has changed size.
- if (isShowing ()
- && (oldx != x || oldy != y))
- {
- ComponentEvent ce = new ComponentEvent(this,
- ComponentEvent.COMPONENT_MOVED);
- getToolkit().getSystemEventQueue().postEvent(ce);
- }
- if (isShowing ()
- && (oldwidth != width || oldheight != height))
- {
- ComponentEvent ce = new ComponentEvent(this,
- ComponentEvent.COMPONENT_RESIZED);
- getToolkit().getSystemEventQueue().postEvent(ce);
- }
- }
-
- /**
- * Sets the bounding rectangle for this component to the specified
- * rectangle. Note that these coordinates are relative to the parent, not
- * to the screen.
- *
- * @param r the new bounding rectangle
- * @throws NullPointerException if r is null
- * @see #getBounds()
- * @see #setLocation(Point)
- * @see #setSize(Dimension)
- * @since 1.1
- */
- public void setBounds(Rectangle r)
- {
- setBounds (r.x, r.y, r.width, r.height);
- }
-
- /**
- * Gets the x coordinate of the upper left corner. This is more efficient
- * than getBounds().x or getLocation().x.
- *
- * @return the current x coordinate
- * @since 1.2
- */
- public int getX()
- {
- return x;
- }
-
- /**
- * Gets the y coordinate of the upper left corner. This is more efficient
- * than getBounds().y or getLocation().y.
- *
- * @return the current y coordinate
- * @since 1.2
- */
- public int getY()
- {
- return y;
- }
-
- /**
- * Gets the width of the component. This is more efficient than
- * getBounds().width or getSize().width.
- *
- * @return the current width
- * @since 1.2
- */
- public int getWidth()
- {
- return width;
- }
-
- /**
- * Gets the height of the component. This is more efficient than
- * getBounds().height or getSize().height.
- *
- * @return the current width
- * @since 1.2
- */
- public int getHeight()
- {
- return height;
- }
-
- /**
- * Returns the bounds of this component. This allows reuse of an existing
- * rectangle, if r is non-null.
- *
- * @param r the rectangle to use, or null
- * @return the bounds
- */
- public Rectangle getBounds(Rectangle r)
- {
- if (r == null)
- r = new Rectangle();
- r.x = x;
- r.y = y;
- r.width = width;
- r.height = height;
- return r;
- }
-
- /**
- * Returns the size of this component. This allows reuse of an existing
- * dimension, if d is non-null.
- *
- * @param d the dimension to use, or null
- * @return the size
- */
- public Dimension getSize(Dimension d)
- {
- if (d == null)
- d = new Dimension();
- d.width = width;
- d.height = height;
- return d;
- }
-
- /**
- * Returns the location of this component. This allows reuse of an existing
- * point, if p is non-null.
- *
- * @param p the point to use, or null
- * @return the location
- */
- public Point getLocation(Point p)
- {
- if (p == null)
- p = new Point();
- p.x = x;
- p.y = y;
- return p;
- }
-
- /**
- * Tests if this component is opaque. All "heavyweight" (natively-drawn)
- * components are opaque. A component is opaque if it draws all pixels in
- * the bounds; a lightweight component is partially transparent if it lets
- * pixels underneath show through. Subclasses that guarantee that all pixels
- * will be drawn should override this.
- *
- * @return true if this is opaque
- * @see #isLightweight()
- * @since 1.2
- */
- public boolean isOpaque()
- {
- return ! isLightweight();
- }
-
- /**
- * Return whether the component is lightweight. That means the component has
- * no native peer, but is displayable. This applies to subclasses of
- * Component not in this package, such as javax.swing.
- *
- * @return true if the component has a lightweight peer
- * @see #isDisplayable()
- * @since 1.2
- */
- public boolean isLightweight()
- {
- return peer instanceof LightweightPeer;
- }
-
- /**
- * Returns the component's preferred size.
- *
- * @return the component's preferred size
- * @see #getMinimumSize()
- * @see LayoutManager
- */
- public Dimension getPreferredSize()
- {
- return preferredSize();
- }
-
- /**
- * Returns the component's preferred size.
- *
- * @return the component's preferred size
- * @deprecated use {@link #getPreferredSize()} instead
- */
- public Dimension preferredSize()
- {
- if (prefSize == null)
- if (peer == null)
- return new Dimension(width, height);
- else
- prefSize = peer.getPreferredSize();
- return prefSize;
- }
-
- /**
- * Returns the component's minimum size.
- *
- * @return the component's minimum size
- * @see #getPreferredSize()
- * @see LayoutManager
- */
- public Dimension getMinimumSize()
- {
- return minimumSize();
- }
-
- /**
- * Returns the component's minimum size.
- *
- * @return the component's minimum size
- * @deprecated use {@link #getMinimumSize()} instead
- */
- public Dimension minimumSize()
- {
- if (minSize == null)
- minSize = (peer != null ? peer.getMinimumSize()
- : new Dimension(width, height));
- return minSize;
- }
-
- /**
- * Returns the component's maximum size.
- *
- * @return the component's maximum size
- * @see #getMinimumSize()
- * @see #getPreferredSize()
- * @see LayoutManager
- */
- public Dimension getMaximumSize()
- {
- return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
- }
-
- /**
- * Returns the preferred horizontal alignment of this component. The value
- * returned will be between {@link #LEFT_ALIGNMENT} and
- * {@link #RIGHT_ALIGNMENT}, inclusive.
- *
- * @return the preferred horizontal alignment of this component
- */
- public float getAlignmentX()
- {
- return CENTER_ALIGNMENT;
- }
-
- /**
- * Returns the preferred vertical alignment of this component. The value
- * returned will be between {@link #TOP_ALIGNMENT} and
- * {@link #BOTTOM_ALIGNMENT}, inclusive.
- *
- * @return the preferred vertical alignment of this component
- */
- public float getAlignmentY()
- {
- return CENTER_ALIGNMENT;
- }
-
- /**
- * Calls the layout manager to re-layout the component. This is called
- * during validation of a container in most cases.
- *
- * @see #validate()
- * @see LayoutManager
- */
- public void doLayout()
- {
- layout ();
- }
-
- /**
- * Calls the layout manager to re-layout the component. This is called
- * during validation of a container in most cases.
- *
- * @deprecated use {@link #doLayout()} instead
- */
- public void layout()
- {
- // Nothing to do unless we're a container.
- }
-
- /**
- * Called to ensure that the layout for this component is valid. This is
- * usually called on containers.
- *
- * @see #invalidate()
- * @see #doLayout()
- * @see LayoutManager
- * @see Container#validate()
- */
- public void validate()
- {
- valid = true;
- }
-
- /**
- * Invalidates this component and all of its parent components. This will
- * cause them to have their layout redone. This is called frequently, so
- * make it fast.
- */
- public void invalidate()
- {
- valid = false;
- prefSize = null;
- minSize = null;
- if (parent != null && parent.valid)
- parent.invalidate();
- }
-
- /**
- * Returns a graphics object for this component. Returns <code>null</code>
- * if this component is not currently displayed on the screen.
- *
- * @return a graphics object for this component
- * @see #paint(Graphics)
- */
- public Graphics getGraphics()
- {
- if (peer != null)
- {
- Graphics gfx = peer.getGraphics();
- if (gfx != null)
- return gfx;
- // create graphics for lightweight:
- Container parent = getParent();
- if (parent != null)
- {
- gfx = parent.getGraphics();
- Rectangle bounds = getBounds();
- gfx.setClip(bounds);
- gfx.translate(bounds.x, bounds.y);
- return gfx;
- }
- }
- return null;
- }
-
- /**
- * Returns the font metrics for the specified font in this component.
- *
- * @param font the font to retrieve metrics for
- * @return the font metrics for the specified font
- * @throws NullPointerException if font is null
- * @see #getFont()
- * @see Toolkit#getFontMetrics(Font)
- */
- public FontMetrics getFontMetrics(Font font)
- {
- return peer == null ? getToolkit().getFontMetrics(font)
- : peer.getFontMetrics(font);
- }
-
- /**
- * Sets the cursor for this component to the specified cursor. The cursor
- * is displayed when the point is contained by the component, and the
- * component is visible, displayable, and enabled. This is inherited by
- * subcomponents unless they set their own cursor.
- *
- * @param cursor the new cursor for this component
- * @see #isEnabled()
- * @see #isShowing()
- * @see #getCursor()
- * @see #contains(int, int)
- * @see Toolkit#createCustomCursor(Image, Point, String)
- */
- public void setCursor(Cursor cursor)
- {
- this.cursor = cursor;
- if (peer != null)
- peer.setCursor(cursor);
- }
-
- /**
- * Returns the cursor for this component. If not set, this is inherited
- * from the parent, or from Cursor.getDefaultCursor().
- *
- * @return the cursor for this component
- */
- public Cursor getCursor()
- {
- if (cursor != null)
- return cursor;
- return parent != null ? parent.getCursor() : Cursor.getDefaultCursor();
- }
-
- /**
- * Tests if the cursor was explicitly set, or just inherited from the parent.
- *
- * @return true if the cursor has been set
- * @since 1.4
- */
- public boolean isCursorSet()
- {
- return cursor != null;
- }
-
- /**
- * Paints this component on the screen. The clipping region in the graphics
- * context will indicate the region that requires painting. This is called
- * whenever the component first shows, or needs to be repaired because
- * something was temporarily drawn on top. It is not necessary for
- * subclasses to call <code>super.paint(g)</code>. Components with no area
- * are not painted.
- *
- * @param g the graphics context for this paint job
- * @see #update(Graphics)
- */
- public void paint(Graphics g)
- {
- // Paint the heavyweight peer
- if (!isLightweight() && peer != null)
- peer.paint(g);
- }
-
- /**
- * Updates this component. This is called in response to
- * <code>repaint</code>. This method fills the component with the
- * background color, then sets the foreground color of the specified
- * graphics context to the foreground color of this component and calls
- * the <code>paint()</code> method. The coordinates of the graphics are
- * relative to this component. Subclasses should call either
- * <code>super.update(g)</code> or <code>paint(g)</code>.
- *
- * @param g the graphics context for this update
- *
- * @see #paint(Graphics)
- * @see #repaint()
- */
- public void update(Graphics g)
- {
- if (!isLightweight())
- {
- Rectangle clip = g.getClipBounds();
- if (clip == null)
- g.clearRect(0, 0, width, height);
- else
- g.clearRect(clip.x, clip.y, clip.width, clip.height);
- }
-
- paint(g);
- }
-
- /**
- * Paints this entire component, including any sub-components.
- *
- * @param g the graphics context for this paint job
- *
- * @see #paint(Graphics)
- */
- public void paintAll(Graphics g)
- {
- if (! visible)
- return;
- paint(g);
- }
-
- /**
- * Repaint this entire component. The <code>update()</code> method
- * on this component will be called as soon as possible.
- *
- * @see #update(Graphics)
- * @see #repaint(long, int, int, int, int)
- */
- public void repaint()
- {
- repaint(0, 0, 0, width, height);
- }
-
- /**
- * Repaint this entire component. The <code>update()</code> method on this
- * component will be called in approximate the specified number of
- * milliseconds.
- *
- * @param tm milliseconds before this component should be repainted
- * @see #paint(Graphics)
- * @see #repaint(long, int, int, int, int)
- */
- public void repaint(long tm)
- {
- repaint(tm, 0, 0, width, height);
- }
-
- /**
- * Repaints the specified rectangular region within this component. The
- * <code>update</code> method on this component will be called as soon as
- * possible. The coordinates are relative to this component.
- *
- * @param x the X coordinate of the upper left of the region to repaint
- * @param y the Y coordinate of the upper left of the region to repaint
- * @param w the width of the region to repaint
- * @param h the height of the region to repaint
- * @see #update(Graphics)
- * @see #repaint(long, int, int, int, int)
- */
- public void repaint(int x, int y, int w, int h)
- {
- repaint(0, x, y, w, h);
- }
-
- /**
- * Repaints the specified rectangular region within this component. The
- * <code>update</code> method on this component will be called in
- * approximately the specified number of milliseconds. The coordinates
- * are relative to this component.
- *
- * @param tm milliseconds before this component should be repainted
- * @param x the X coordinate of the upper left of the region to repaint
- * @param y the Y coordinate of the upper left of the region to repaint
- * @param width the width of the region to repaint
- * @param height the height of the region to repaint
- * @see #update(Graphics)
- */
- public void repaint(long tm, int x, int y, int width, int height)
- {
- // Handle lightweight repainting by forwarding to native parent
- if (isLightweight() && parent != null)
- {
- if (parent != null)
- parent.repaint(tm, x + getX(), y + getY(), width, height);
- }
- else if (peer != null)
- peer.repaint(tm, x, y, width, height);
- }
-
- /**
- * Prints this component. This method is provided so that printing can be
- * done in a different manner from painting. However, the implementation
- * in this class simply calls the <code>paint()</code> method.
- *
- * @param g the graphics context of the print device
- *
- * @see #paint(Graphics)
- */
- public void print(Graphics g)
- {
- paint(g);
- }
-
- /**
- * Prints this component, including all sub-components. This method is
- * provided so that printing can be done in a different manner from
- * painting. However, the implementation in this class simply calls the
- * <code>paintAll()</code> method.
- *
- * @param g the graphics context of the print device
- *
- * @see #paintAll(Graphics)
- */
- public void printAll(Graphics g)
- {
- paintAll(g);
- }
-
- /**
- * Called when an image has changed so that this component is repainted.
- * This incrementally draws an image as more bits are available, when
- * possible. Incremental drawing is enabled if the system property
- * <code>awt.image.incrementalDraw</code> is not present or is true, in which
- * case the redraw rate is set to 100ms or the value of the system property
- * <code>awt.image.redrawrate</code>.
- *
- * <p>The coordinate system used depends on the particular flags.
- *
- * @param img the image that has been updated
- * @param flags tlags as specified in <code>ImageObserver</code>
- * @param x the X coordinate
- * @param y the Y coordinate
- * @param w the width
- * @param h the height
- * @return false if the image is completely loaded, loading has been
- * aborted, or an error has occurred. true if more updates are
- * required.
- * @see ImageObserver
- * @see Graphics#drawImage(Image, int, int, Color, ImageObserver)
- * @see Graphics#drawImage(Image, int, int, ImageObserver)
- * @see Graphics#drawImage(Image, int, int, int, int, Color, ImageObserver)
- * @see Graphics#drawImage(Image, int, int, int, int, ImageObserver)
- * @see ImageObserver#imageUpdate(Image, int, int, int, int, int)
- */
- public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h)
- {
- if ((flags & (FRAMEBITS | ALLBITS)) != 0)
- repaint ();
- else if ((flags & SOMEBITS) != 0)
- {
- if (incrementalDraw)
- {
- if (redrawRate != null)
- {
- long tm = redrawRate.longValue();
- if (tm < 0)
- tm = 0;
- repaint (tm);
- }
- else
- repaint (100);
- }
- }
- return (flags & (ALLBITS | ABORT | ERROR)) == 0;
- }
-
- /**
- * Creates an image from the specified producer.
- *
- * @param producer the image procedure to create the image from
- * @return the resulting image
- */
- public Image createImage(ImageProducer producer)
- {
- // Sun allows producer to be null.
- if (peer != null)
- return peer.createImage(producer);
- else
- return getToolkit().createImage(producer);
- }
-
- /**
- * Creates an image with the specified width and height for use in
- * double buffering. Headless environments do not support images.
- *
- * @param width the width of the image
- * @param height the height of the image
- * @return the requested image, or null if it is not supported
- */
- public Image createImage (int width, int height)
- {
- Image returnValue = null;
- if (!GraphicsEnvironment.isHeadless ())
- {
- if (isLightweight () && parent != null)
- returnValue = parent.createImage (width, height);
- else if (peer != null)
- returnValue = peer.createImage (width, height);
- }
- return returnValue;
- }
-
- /**
- * Creates an image with the specified width and height for use in
- * double buffering. Headless environments do not support images.
- *
- * @param width the width of the image
- * @param height the height of the image
- * @return the requested image, or null if it is not supported
- * @since 1.4
- */
- public VolatileImage createVolatileImage(int width, int height)
- {
- if (GraphicsEnvironment.isHeadless())
- return null;
- GraphicsConfiguration config = getGraphicsConfiguration();
- return config == null ? null
- : config.createCompatibleVolatileImage(width, height);
- }
-
- /**
- * Creates an image with the specified width and height for use in
- * double buffering. Headless environments do not support images. The image
- * will support the specified capabilities.
- *
- * @param width the width of the image
- * @param height the height of the image
- * @param caps the requested capabilities
- * @return the requested image, or null if it is not supported
- * @throws AWTException if a buffer with the capabilities cannot be created
- * @since 1.4
- */
- public VolatileImage createVolatileImage(int width, int height,
- ImageCapabilities caps)
- throws AWTException
- {
- if (GraphicsEnvironment.isHeadless())
- return null;
- GraphicsConfiguration config = getGraphicsConfiguration();
- return config == null ? null
- : config.createCompatibleVolatileImage(width, height, caps);
- }
-
- /**
- * Prepares the specified image for rendering on this component.
- *
- * @param image the image to prepare for rendering
- * @param observer the observer to notify of image preparation status
- * @return true if the image is already fully prepared
- * @throws NullPointerException if image is null
- */
- public boolean prepareImage(Image image, ImageObserver observer)
- {
- return prepareImage(image, image.getWidth(observer),
- image.getHeight(observer), observer);
- }
-
- /**
- * Prepares the specified image for rendering on this component at the
- * specified scaled width and height
- *
- * @param image the image to prepare for rendering
- * @param width the scaled width of the image
- * @param height the scaled height of the image
- * @param observer the observer to notify of image preparation status
- * @return true if the image is already fully prepared
- */
- public boolean prepareImage(Image image, int width, int height,
- ImageObserver observer)
- {
- if (peer != null)
- return peer.prepareImage(image, width, height, observer);
- else
- return getToolkit().prepareImage(image, width, height, observer);
- }
-
- /**
- * Returns the status of the loading of the specified image. The value
- * returned will be those flags defined in <code>ImageObserver</code>.
- *
- * @param image the image to check on
- * @param observer the observer to notify of image loading progress
- * @return the image observer flags indicating the status of the load
- * @see #prepareImage(Image, int, int, ImageObserver)
- * @see Toolkit#checkImage(Image, int, int, ImageObserver)
- * @throws NullPointerException if image is null
- */
- public int checkImage(Image image, ImageObserver observer)
- {
- return checkImage(image, -1, -1, observer);
- }
-
- /**
- * Returns the status of the loading of the specified image. The value
- * returned will be those flags defined in <code>ImageObserver</code>.
- *
- * @param image the image to check on
- * @param width the scaled image width
- * @param height the scaled image height
- * @param observer the observer to notify of image loading progress
- * @return the image observer flags indicating the status of the load
- * @see #prepareImage(Image, int, int, ImageObserver)
- * @see Toolkit#checkImage(Image, int, int, ImageObserver)
- */
- public int checkImage(Image image, int width, int height,
- ImageObserver observer)
- {
- if (peer != null)
- return peer.checkImage(image, width, height, observer);
- return getToolkit().checkImage(image, width, height, observer);
- }
-
- /**
- * Sets whether paint messages delivered by the operating system should be
- * ignored. This does not affect messages from AWT, except for those
- * triggered by OS messages. Setting this to true can allow faster
- * performance in full-screen mode or page-flipping.
- *
- * @param ignoreRepaint the new setting for ignoring repaint events
- * @see #getIgnoreRepaint()
- * @see BufferStrategy
- * @see GraphicsDevice#setFullScreenWindow(Window)
- * @since 1.4
- */
- public void setIgnoreRepaint(boolean ignoreRepaint)
- {
- this.ignoreRepaint = ignoreRepaint;
- }
-
- /**
- * Test whether paint events from the operating system are ignored.
- *
- * @return the status of ignoring paint events
- * @see #setIgnoreRepaint(boolean)
- * @since 1.4
- */
- public boolean getIgnoreRepaint()
- {
- return ignoreRepaint;
- }
-
- /**
- * Tests whether or not the specified point is contained within this
- * component. Coordinates are relative to this component.
- *
- * @param x the X coordinate of the point to test
- * @param y the Y coordinate of the point to test
- * @return true if the point is within this component
- * @see #getComponentAt(int, int)
- */
- public boolean contains(int x, int y)
- {
- return inside (x, y);
- }
-
- /**
- * Tests whether or not the specified point is contained within this
- * component. Coordinates are relative to this component.
- *
- * @param x the X coordinate of the point to test
- * @param y the Y coordinate of the point to test
- * @return true if the point is within this component
- * @deprecated use {@link #contains(int, int)} instead
- */
- public boolean inside(int x, int y)
- {
- return x >= 0 && y >= 0 && x < width && y < height;
- }
-
- /**
- * Tests whether or not the specified point is contained within this
- * component. Coordinates are relative to this component.
- *
- * @param p the point to test
- * @return true if the point is within this component
- * @throws NullPointerException if p is null
- * @see #getComponentAt(Point)
- * @since 1.1
- */
- public boolean contains(Point p)
- {
- return contains (p.x, p.y);
- }
-
- /**
- * Returns the component occupying the position (x,y). This will either
- * be this component, an immediate child component, or <code>null</code>
- * if neither of the first two occupies the specified location.
- *
- * @param x the X coordinate to search for components at
- * @param y the Y coordinate to search for components at
- * @return the component at the specified location, or null
- * @see #contains(int, int)
- */
- public Component getComponentAt(int x, int y)
- {
- return locate (x, y);
- }
-
- /**
- * Returns the component occupying the position (x,y). This will either
- * be this component, an immediate child component, or <code>null</code>
- * if neither of the first two occupies the specified location.
- *
- * @param x the X coordinate to search for components at
- * @param y the Y coordinate to search for components at
- * @return the component at the specified location, or null
- * @deprecated use {@link #getComponentAt(int, int)} instead
- */
- public Component locate(int x, int y)
- {
- return contains (x, y) ? this : null;
- }
-
- /**
- * Returns the component occupying the position (x,y). This will either
- * be this component, an immediate child component, or <code>null</code>
- * if neither of the first two occupies the specified location.
- *
- * @param p the point to search for components at
- * @return the component at the specified location, or null
- * @throws NullPointerException if p is null
- * @see #contains(Point)
- * @since 1.1
- */
- public Component getComponentAt(Point p)
- {
- return getComponentAt (p.x, p.y);
- }
-
- /**
- * AWT 1.0 event delivery.
- *
- * Deliver an AWT 1.0 event to this Component. This method simply
- * calls {@link #postEvent}.
- *
- * @param e the event to deliver
- * @deprecated use {@link #dispatchEvent (AWTEvent)} instead
- */
- public void deliverEvent (Event e)
- {
- postEvent (e);
- }
-
- /**
- * Forwards AWT events to processEvent() if:<ul>
- * <li>Events have been enabled for this type of event via
- * <code>enableEvents()</code></li>,
- * <li>There is at least one registered listener for this type of event</li>
- * </ul>
- *
- * @param e the event to dispatch
- */
- public final void dispatchEvent(AWTEvent e)
- {
- // Some subclasses in the AWT package need to override this behavior,
- // hence the use of dispatchEventImpl().
- dispatchEventImpl(e);
- if (peer != null && ! e.consumed)
- peer.handleEvent(e);
- }
-
- /**
- * AWT 1.0 event handler.
- *
- * This method simply calls handleEvent and returns the result.
- *
- * @param e the event to handle
- * @return true if the event was handled, false otherwise
- * @deprecated use {@link #dispatchEvent(AWTEvent)} instead
- */
- public boolean postEvent (Event e)
- {
- boolean handled = handleEvent (e);
-
- if (!handled && getParent() != null)
- // FIXME: need to translate event coordinates to parent's
- // coordinate space.
- handled = getParent ().postEvent (e);
-
- return handled;
- }
-
- /**
- * Adds the specified listener to this component. This is harmless if the
- * listener is null, but if the listener has already been registered, it
- * will now be registered twice.
- *
- * @param listener the new listener to add
- * @see ComponentEvent
- * @see #removeComponentListener(ComponentListener)
- * @see #getComponentListeners()
- * @since 1.1
- */
- public synchronized void addComponentListener(ComponentListener listener)
- {
- componentListener = AWTEventMulticaster.add(componentListener, listener);
- if (componentListener != null)
- enableEvents(AWTEvent.COMPONENT_EVENT_MASK);
- }
-
- /**
- * Removes the specified listener from the component. This is harmless if
- * the listener was not previously registered.
- *
- * @param listener the listener to remove
- * @see ComponentEvent
- * @see #addComponentListener(ComponentListener)
- * @see #getComponentListeners()
- * @since 1.1
- */
- public synchronized void removeComponentListener(ComponentListener listener)
- {
- componentListener = AWTEventMulticaster.remove(componentListener, listener);
- }
-
- /**
- * Returns an array of all specified listeners registered on this component.
- *
- * @return an array of listeners
- * @see #addComponentListener(ComponentListener)
- * @see #removeComponentListener(ComponentListener)
- * @since 1.4
- */
- public synchronized ComponentListener[] getComponentListeners()
- {
- return (ComponentListener[])
- AWTEventMulticaster.getListeners(componentListener,
- ComponentListener.class);
- }
-
- /**
- * Adds the specified listener to this component. This is harmless if the
- * listener is null, but if the listener has already been registered, it
- * will now be registered twice.
- *
- * @param listener the new listener to add
- * @see FocusEvent
- * @see #removeFocusListener(FocusListener)
- * @see #getFocusListeners()
- * @since 1.1
- */
- public synchronized void addFocusListener(FocusListener listener)
- {
- focusListener = AWTEventMulticaster.add(focusListener, listener);
- if (focusListener != null)
- enableEvents(AWTEvent.FOCUS_EVENT_MASK);
- }
-
- /**
- * Removes the specified listener from the component. This is harmless if
- * the listener was not previously registered.
- *
- * @param listener the listener to remove
- * @see FocusEvent
- * @see #addFocusListener(FocusListener)
- * @see #getFocusListeners()
- * @since 1.1
- */
- public synchronized void removeFocusListener(FocusListener listener)
- {
- focusListener = AWTEventMulticaster.remove(focusListener, listener);
- }
-
- /**
- * Returns an array of all specified listeners registered on this component.
- *
- * @return an array of listeners
- * @see #addFocusListener(FocusListener)
- * @see #removeFocusListener(FocusListener)
- * @since 1.4
- */
- public synchronized FocusListener[] getFocusListeners()
- {
- return (FocusListener[])
- AWTEventMulticaster.getListeners(focusListener, FocusListener.class);
- }
-
- /**
- * Adds the specified listener to this component. This is harmless if the
- * listener is null, but if the listener has already been registered, it
- * will now be registered twice.
- *
- * @param listener the new listener to add
- * @see HierarchyEvent
- * @see #removeHierarchyListener(HierarchyListener)
- * @see #getHierarchyListeners()
- * @since 1.3
- */
- public synchronized void addHierarchyListener(HierarchyListener listener)
- {
- hierarchyListener = AWTEventMulticaster.add(hierarchyListener, listener);
- if (hierarchyListener != null)
- enableEvents(AWTEvent.HIERARCHY_EVENT_MASK);
- }
-
- /**
- * Removes the specified listener from the component. This is harmless if
- * the listener was not previously registered.
- *
- * @param listener the listener to remove
- * @see HierarchyEvent
- * @see #addHierarchyListener(HierarchyListener)
- * @see #getHierarchyListeners()
- * @since 1.3
- */
- public synchronized void removeHierarchyListener(HierarchyListener listener)
- {
- hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, listener);
- }
-
- /**
- * Returns an array of all specified listeners registered on this component.
- *
- * @return an array of listeners
- * @see #addHierarchyListener(HierarchyListener)
- * @see #removeHierarchyListener(HierarchyListener)
- * @since 1.4
- */
- public synchronized HierarchyListener[] getHierarchyListeners()
- {
- return (HierarchyListener[])
- AWTEventMulticaster.getListeners(hierarchyListener,
- HierarchyListener.class);
- }
-
- /**
- * Adds the specified listener to this component. This is harmless if the
- * listener is null, but if the listener has already been registered, it
- * will now be registered twice.
- *
- * @param listener the new listener to add
- * @see HierarchyEvent
- * @see #removeHierarchyBoundsListener(HierarchyBoundsListener)
- * @see #getHierarchyBoundsListeners()
- * @since 1.3
- */
- public synchronized void
- addHierarchyBoundsListener(HierarchyBoundsListener listener)
- {
- hierarchyBoundsListener =
- AWTEventMulticaster.add(hierarchyBoundsListener, listener);
- if (hierarchyBoundsListener != null)
- enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
- }
-
- /**
- * Removes the specified listener from the component. This is harmless if
- * the listener was not previously registered.
- *
- * @param listener the listener to remove
- * @see HierarchyEvent
- * @see #addHierarchyBoundsListener(HierarchyBoundsListener)
- * @see #getHierarchyBoundsListeners()
- * @since 1.3
- */
- public synchronized void
- removeHierarchyBoundsListener(HierarchyBoundsListener listener)
- {
- hierarchyBoundsListener =
- AWTEventMulticaster.remove(hierarchyBoundsListener, listener);
- }
-
- /**
- * Returns an array of all specified listeners registered on this component.
- *
- * @return an array of listeners
- * @see #addHierarchyBoundsListener(HierarchyBoundsListener)
- * @see #removeHierarchyBoundsListener(HierarchyBoundsListener)
- * @since 1.4
- */
- public synchronized HierarchyBoundsListener[] getHierarchyBoundsListeners()
- {
- return (HierarchyBoundsListener[])
- AWTEventMulticaster.getListeners(hierarchyBoundsListener,
- HierarchyBoundsListener.class);
- }
-
- /**
- * Adds the specified listener to this component. This is harmless if the
- * listener is null, but if the listener has already been registered, it
- * will now be registered twice.
- *
- * @param listener the new listener to add
- * @see KeyEvent
- * @see #removeKeyListener(KeyListener)
- * @see #getKeyListeners()
- * @since 1.1
- */
- public synchronized void addKeyListener(KeyListener listener)
- {
- keyListener = AWTEventMulticaster.add(keyListener, listener);
- if (keyListener != null)
- enableEvents(AWTEvent.KEY_EVENT_MASK);
- }
-
- /**
- * Removes the specified listener from the component. This is harmless if
- * the listener was not previously registered.
- *
- * @param listener the listener to remove
- * @see KeyEvent
- * @see #addKeyListener(KeyListener)
- * @see #getKeyListeners()
- * @since 1.1
- */
- public synchronized void removeKeyListener(KeyListener listener)
- {
- keyListener = AWTEventMulticaster.remove(keyListener, listener);
- }
-
- /**
- * Returns an array of all specified listeners registered on this component.
- *
- * @return an array of listeners
- * @see #addKeyListener(KeyListener)
- * @see #removeKeyListener(KeyListener)
- * @since 1.4
- */
- public synchronized KeyListener[] getKeyListeners()
- {
- return (KeyListener[])
- AWTEventMulticaster.getListeners(keyListener, KeyListener.class);
- }
-
- /**
- * Adds the specified listener to this component. This is harmless if the
- * listener is null, but if the listener has already been registered, it
- * will now be registered twice.
- *
- * @param listener the new listener to add
- * @see MouseEvent
- * @see #removeMouseListener(MouseListener)
- * @see #getMouseListeners()
- * @since 1.1
- */
- public synchronized void addMouseListener(MouseListener listener)
- {
- mouseListener = AWTEventMulticaster.add(mouseListener, listener);
- if (mouseListener != null)
- enableEvents(AWTEvent.MOUSE_EVENT_MASK);
- }
-
- /**
- * Removes the specified listener from the component. This is harmless if
- * the listener was not previously registered.
- *
- * @param listener the listener to remove
- * @see MouseEvent
- * @see #addMouseListener(MouseListener)
- * @see #getMouseListeners()
- * @since 1.1
- */
- public synchronized void removeMouseListener(MouseListener listener)
- {
- mouseListener = AWTEventMulticaster.remove(mouseListener, listener);
- }
-
- /**
- * Returns an array of all specified listeners registered on this component.
- *
- * @return an array of listeners
- * @see #addMouseListener(MouseListener)
- * @see #removeMouseListener(MouseListener)
- * @since 1.4
- */
- public synchronized MouseListener[] getMouseListeners()
- {
- return (MouseListener[])
- AWTEventMulticaster.getListeners(mouseListener, MouseListener.class);
- }
-
- /**
- * Adds the specified listener to this component. This is harmless if the
- * listener is null, but if the listener has already been registered, it
- * will now be registered twice.
- *
- * @param listener the new listener to add
- * @see MouseEvent
- * @see #removeMouseMotionListener(MouseMotionListener)
- * @see #getMouseMotionListeners()
- * @since 1.1
- */
- public synchronized void addMouseMotionListener(MouseMotionListener listener)
- {
- mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener);
- if (mouseMotionListener != null)
- enableEvents(AWTEvent.MOUSE_EVENT_MASK);
- }
-
- /**
- * Removes the specified listener from the component. This is harmless if
- * the listener was not previously registered.
- *
- * @param listener the listener to remove
- * @see MouseEvent
- * @see #addMouseMotionListener(MouseMotionListener)
- * @see #getMouseMotionListeners()
- * @since 1.1
- */
- public synchronized void removeMouseMotionListener(MouseMotionListener listener)
- {
- mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, listener);
- }
-
- /**
- * Returns an array of all specified listeners registered on this component.
- *
- * @return an array of listeners
- * @see #addMouseMotionListener(MouseMotionListener)
- * @see #removeMouseMotionListener(MouseMotionListener)
- * @since 1.4
- */
- public synchronized MouseMotionListener[] getMouseMotionListeners()
- {
- return (MouseMotionListener[])
- AWTEventMulticaster.getListeners(mouseMotionListener,
- MouseMotionListener.class);
- }
-
- /**
- * Adds the specified listener to this component. This is harmless if the
- * listener is null, but if the listener has already been registered, it
- * will now be registered twice.
- *
- * @param listener the new listener to add
- * @see MouseEvent
- * @see MouseWheelEvent
- * @see #removeMouseWheelListener(MouseWheelListener)
- * @see #getMouseWheelListeners()
- * @since 1.4
- */
- public synchronized void addMouseWheelListener(MouseWheelListener listener)
- {
- mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, listener);
- if (mouseWheelListener != null)
- enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK);
- }
-
- /**
- * Removes the specified listener from the component. This is harmless if
- * the listener was not previously registered.
- *
- * @param listener the listener to remove
- * @see MouseEvent
- * @see MouseWheelEvent
- * @see #addMouseWheelListener(MouseWheelListener)
- * @see #getMouseWheelListeners()
- * @since 1.4
- */
- public synchronized void removeMouseWheelListener(MouseWheelListener listener)
- {
- mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, listener);
- }
-
- /**
- * Returns an array of all specified listeners registered on this component.
- *
- * @return an array of listeners
- * @see #addMouseWheelListener(MouseWheelListener)
- * @see #removeMouseWheelListener(MouseWheelListener)
- * @since 1.4
- */
- public synchronized MouseWheelListener[] getMouseWheelListeners()
- {
- return (MouseWheelListener[])
- AWTEventMulticaster.getListeners(mouseWheelListener,
- MouseWheelListener.class);
- }
-
- /**
- * Adds the specified listener to this component. This is harmless if the
- * listener is null, but if the listener has already been registered, it
- * will now be registered twice.
- *
- * @param listener the new listener to add
- * @see InputMethodEvent
- * @see #removeInputMethodListener(InputMethodListener)
- * @see #getInputMethodListeners()
- * @see #getInputMethodRequests()
- * @since 1.2
- */
- public synchronized void addInputMethodListener(InputMethodListener listener)
- {
- inputMethodListener = AWTEventMulticaster.add(inputMethodListener, listener);
- if (inputMethodListener != null)
- enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK);
- }
-
- /**
- * Removes the specified listener from the component. This is harmless if
- * the listener was not previously registered.
- *
- * @param listener the listener to remove
- * @see InputMethodEvent
- * @see #addInputMethodListener(InputMethodListener)
- * @see #getInputMethodRequests()
- * @since 1.2
- */
- public synchronized void removeInputMethodListener(InputMethodListener listener)
- {
- inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, listener);
- }
-
- /**
- * Returns an array of all specified listeners registered on this component.
- *
- * @return an array of listeners
- * @see #addInputMethodListener(InputMethodListener)
- * @see #removeInputMethodListener(InputMethodListener)
- * @since 1.4
- */
- public synchronized InputMethodListener[] getInputMethodListeners()
- {
- return (InputMethodListener[])
- AWTEventMulticaster.getListeners(inputMethodListener,
- InputMethodListener.class);
- }
-
- /**
- * Returns all registered EventListers of the given listenerType.
- *
- * @param listenerType the class of listeners to filter
- * @return an array of registered listeners
- * @see #getComponentListeners()
- * @see #getFocusListeners()
- * @see #getHierarchyListeners()
- * @see #getHierarchyBoundsListeners()
- * @see #getKeyListeners()
- * @see #getMouseListeners()
- * @see #getMouseMotionListeners()
- * @see #getMouseWheelListeners()
- * @see #getInputMethodListeners()
- * @see #getPropertyChangeListeners()
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerType)
- {
- if (listenerType == ComponentListener.class)
- return getComponentListeners();
- if (listenerType == FocusListener.class)
- return getFocusListeners();
- if (listenerType == HierarchyListener.class)
- return getHierarchyListeners();
- if (listenerType == HierarchyBoundsListener.class)
- return getHierarchyBoundsListeners();
- if (listenerType == KeyListener.class)
- return getKeyListeners();
- if (listenerType == MouseListener.class)
- return getMouseListeners();
- if (listenerType == MouseMotionListener.class)
- return getMouseMotionListeners();
- if (listenerType == MouseWheelListener.class)
- return getMouseWheelListeners();
- if (listenerType == InputMethodListener.class)
- return getInputMethodListeners();
- if (listenerType == PropertyChangeListener.class)
- return getPropertyChangeListeners();
- return (EventListener[]) Array.newInstance(listenerType, 0);
- }
-
- /**
- * Returns the input method request handler, for subclasses which support
- * on-the-spot text input. By default, input methods are handled by AWT,
- * and this returns null.
- *
- * @return the input method handler, null by default
- * @since 1.2
- */
- public InputMethodRequests getInputMethodRequests()
- {
- return null;
- }
-
- /**
- * Gets the input context of this component, which is inherited from the
- * parent unless this is overridden.
- *
- * @return the text input context
- * @since 1.2
- */
- public InputContext getInputContext()
- {
- return parent == null ? null : parent.getInputContext();
- }
-
- /**
- * Enables the specified events. The events to enable are specified
- * by OR-ing together the desired masks from <code>AWTEvent</code>.
- *
- * <p>Events are enabled by default when a listener is attached to the
- * component for that event type. This method can be used by subclasses
- * to ensure the delivery of a specified event regardless of whether
- * or not a listener is attached.
- *
- * @param eventsToEnable the desired events to enable
- * @see #processEvent(AWTEvent)
- * @see #disableEvents(long)
- * @see AWTEvent
- * @since 1.1
- */
- protected final void enableEvents(long eventsToEnable)
- {
- eventMask |= eventsToEnable;
- // TODO: Unlike Sun's implementation, I think we should try and
- // enable/disable events at the peer (gtk/X) level. This will avoid
- // clogging the event pipeline with useless mousemove events that
- // we arn't interested in, etc. This will involve extending the peer
- // interface, but thats okay because the peer interfaces have been
- // deprecated for a long time, and no longer feature in the
- // API specification at all.
- if (isLightweight() && parent != null)
- parent.enableEvents(eventsToEnable);
- else if (peer != null)
- peer.setEventMask(eventMask);
- }
-
- /**
- * Disables the specified events. The events to disable are specified
- * by OR-ing together the desired masks from <code>AWTEvent</code>.
- *
- * @param eventsToDisable the desired events to disable
- * @see #enableEvents(long)
- * @since 1.1
- */
- protected final void disableEvents(long eventsToDisable)
- {
- eventMask &= ~eventsToDisable;
- // forward new event mask to peer?
- }
-
- /**
- * This is called by the EventQueue if two events with the same event id
- * and owner component are queued. Returns a new combined event, or null if
- * no combining is done. The coelesced events are currently mouse moves
- * (intermediate ones are discarded) and paint events (a merged paint is
- * created in place of the two events).
- *
- * @param existingEvent the event on the queue
- * @param newEvent the new event that might be entered on the queue
- * @return null if both events are kept, or the replacement coelesced event
- */
- protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent)
- {
- switch (existingEvent.id)
- {
- case MouseEvent.MOUSE_MOVED:
- case MouseEvent.MOUSE_DRAGGED:
- // Just drop the old (intermediate) event and return the new one.
- return newEvent;
- case PaintEvent.PAINT:
- case PaintEvent.UPDATE:
- return coalescePaintEvents((PaintEvent) existingEvent,
- (PaintEvent) newEvent);
- default:
- return null;
- }
- }
-
- /**
- * Processes the specified event. In this class, this method simply
- * calls one of the more specific event handlers.
- *
- * @param e the event to process
- * @throws NullPointerException if e is null
- * @see #processComponentEvent(ComponentEvent)
- * @see #processFocusEvent(FocusEvent)
- * @see #processKeyEvent(KeyEvent)
- * @see #processMouseEvent(MouseEvent)
- * @see #processMouseMotionEvent(MouseEvent)
- * @see #processInputMethodEvent(InputMethodEvent)
- * @see #processHierarchyEvent(HierarchyEvent)
- * @see #processMouseWheelEvent(MouseWheelEvent)
- * @since 1.1
- */
- protected void processEvent(AWTEvent e)
- {
- /* Note: the order of these if statements are
- important. Subclasses must be checked first. Eg. MouseEvent
- must be checked before ComponentEvent, since a MouseEvent
- object is also an instance of a ComponentEvent. */
-
- if (e instanceof FocusEvent)
- processFocusEvent((FocusEvent) e);
- else if (e instanceof MouseWheelEvent)
- processMouseWheelEvent((MouseWheelEvent) e);
- else if (e instanceof MouseEvent)
- {
- if (e.id == MouseEvent.MOUSE_MOVED
- || e.id == MouseEvent.MOUSE_DRAGGED)
- processMouseMotionEvent((MouseEvent) e);
- else
- processMouseEvent((MouseEvent) e);
- }
- else if (e instanceof KeyEvent)
- processKeyEvent((KeyEvent) e);
- else if (e instanceof InputMethodEvent)
- processInputMethodEvent((InputMethodEvent) e);
- else if (e instanceof ComponentEvent)
- processComponentEvent((ComponentEvent) e);
- else if (e instanceof HierarchyEvent)
- {
- if (e.id == HierarchyEvent.HIERARCHY_CHANGED)
- processHierarchyEvent((HierarchyEvent) e);
- else
- processHierarchyBoundsEvent((HierarchyEvent) e);
- }
- }
-
- /**
- * Called when a component event is dispatched and component events are
- * enabled. This method passes the event along to any listeners
- * that are attached.
- *
- * @param e the <code>ComponentEvent</code> to process
- * @throws NullPointerException if e is null
- * @see ComponentListener
- * @see #addComponentListener(ComponentListener)
- * @see #enableEvents(long)
- * @since 1.1
- */
- protected void processComponentEvent(ComponentEvent e)
- {
- if (componentListener == null)
- return;
- switch (e.id)
- {
- case ComponentEvent.COMPONENT_HIDDEN:
- componentListener.componentHidden(e);
- break;
- case ComponentEvent.COMPONENT_MOVED:
- componentListener.componentMoved(e);
- break;
- case ComponentEvent.COMPONENT_RESIZED:
- componentListener.componentResized(e);
- break;
- case ComponentEvent.COMPONENT_SHOWN:
- componentListener.componentShown(e);
- break;
- }
- }
-
- /**
- * Called when a focus event is dispatched and component events are
- * enabled. This method passes the event along to any listeners
- * that are attached.
- *
- * @param e the <code>FocusEvent</code> to process
- * @throws NullPointerException if e is null
- * @see FocusListener
- * @see #addFocusListener(FocusListener)
- * @see #enableEvents(long)
- * @since 1.1
- */
- protected void processFocusEvent(FocusEvent e)
- {
- if (focusListener == null)
- return;
-
- switch (e.id)
- {
- case FocusEvent.FOCUS_GAINED:
- focusListener.focusGained(e);
- break;
- case FocusEvent.FOCUS_LOST:
- focusListener.focusLost(e);
- break;
- }
- }
-
- /**
- * Called when a key event is dispatched and component events are
- * enabled. This method passes the event along to any listeners
- * that are attached.
- *
- * @param e the <code>KeyEvent</code> to process
- * @throws NullPointerException if e is null
- * @see KeyListener
- * @see #addKeyListener(KeyListener)
- * @see #enableEvents(long)
- * @since 1.1
- */
- protected void processKeyEvent(KeyEvent e)
- {
- if (keyListener == null)
- return;
- switch (e.id)
- {
- case KeyEvent.KEY_PRESSED:
- keyListener.keyPressed(e);
- break;
- case KeyEvent.KEY_RELEASED:
- keyListener.keyReleased(e);
- break;
- case KeyEvent.KEY_TYPED:
- keyListener.keyTyped(e);
- break;
- }
- }
-
- /**
- * Called when a regular mouse event is dispatched and component events are
- * enabled. This method passes the event along to any listeners
- * that are attached.
- *
- * @param e the <code>MouseEvent</code> to process
- * @throws NullPointerException if e is null
- * @see MouseListener
- * @see #addMouseListener(MouseListener)
- * @see #enableEvents(long)
- * @since 1.1
- */
- protected void processMouseEvent(MouseEvent e)
- {
- if (mouseListener == null)
- return;
- switch (e.id)
- {
- case MouseEvent.MOUSE_CLICKED:
- mouseListener.mouseClicked(e);
- break;
- case MouseEvent.MOUSE_ENTERED:
- mouseListener.mouseEntered(e);
- break;
- case MouseEvent.MOUSE_EXITED:
- mouseListener.mouseExited(e);
- break;
- case MouseEvent.MOUSE_PRESSED:
- mouseListener.mousePressed(e);
- break;
- case MouseEvent.MOUSE_RELEASED:
- mouseListener.mouseReleased(e);
- break;
- }
- e.consume();
- }
-
- /**
- * Called when a mouse motion event is dispatched and component events are
- * enabled. This method passes the event along to any listeners
- * that are attached.
- *
- * @param e the <code>MouseMotionEvent</code> to process
- * @throws NullPointerException if e is null
- * @see MouseMotionListener
- * @see #addMouseMotionListener(MouseMotionListener)
- * @see #enableEvents(long)
- * @since 1.1
- */
- protected void processMouseMotionEvent(MouseEvent e)
- {
- if (mouseMotionListener == null)
- return;
- switch (e.id)
- {
- case MouseEvent.MOUSE_DRAGGED:
- mouseMotionListener.mouseDragged(e);
- break;
- case MouseEvent.MOUSE_MOVED:
- mouseMotionListener.mouseMoved(e);
- break;
- }
- e.consume();
- }
-
- /**
- * Called when a mouse wheel event is dispatched and component events are
- * enabled. This method passes the event along to any listeners that are
- * attached.
- *
- * @param e the <code>MouseWheelEvent</code> to process
- * @throws NullPointerException if e is null
- * @see MouseWheelListener
- * @see #addMouseWheelListener(MouseWheelListener)
- * @see #enableEvents(long)
- * @since 1.4
- */
- protected void processMouseWheelEvent(MouseWheelEvent e)
- {
- if (mouseWheelListener != null
- && e.id == MouseEvent.MOUSE_WHEEL)
- {
- mouseWheelListener.mouseWheelMoved(e);
- e.consume();
- }
- }
-
- /**
- * Called when an input method event is dispatched and component events are
- * enabled. This method passes the event along to any listeners that are
- * attached.
- *
- * @param e the <code>InputMethodEvent</code> to process
- * @throws NullPointerException if e is null
- * @see InputMethodListener
- * @see #addInputMethodListener(InputMethodListener)
- * @see #enableEvents(long)
- * @since 1.2
- */
- protected void processInputMethodEvent(InputMethodEvent e)
- {
- if (inputMethodListener == null)
- return;
- switch (e.id)
- {
- case InputMethodEvent.CARET_POSITION_CHANGED:
- inputMethodListener.caretPositionChanged(e);
- break;
- case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED:
- inputMethodListener.inputMethodTextChanged(e);
- break;
- }
- }
-
- /**
- * Called when a hierarchy change event is dispatched and component events
- * are enabled. This method passes the event along to any listeners that are
- * attached.
- *
- * @param e the <code>HierarchyEvent</code> to process
- * @throws NullPointerException if e is null
- * @see HierarchyListener
- * @see #addHierarchyListener(HierarchyListener)
- * @see #enableEvents(long)
- * @since 1.3
- */
- protected void processHierarchyEvent(HierarchyEvent e)
- {
- if (hierarchyListener == null)
- return;
- if (e.id == HierarchyEvent.HIERARCHY_CHANGED)
- hierarchyListener.hierarchyChanged(e);
- }
-
- /**
- * Called when a hierarchy bounds event is dispatched and component events
- * are enabled. This method passes the event along to any listeners that are
- * attached.
- *
- * @param e the <code>HierarchyEvent</code> to process
- * @throws NullPointerException if e is null
- * @see HierarchyBoundsListener
- * @see #addHierarchyBoundsListener(HierarchyBoundsListener)
- * @see #enableEvents(long)
- * @since 1.3
- */
- protected void processHierarchyBoundsEvent(HierarchyEvent e)
- {
- if (hierarchyBoundsListener == null)
- return;
- switch (e.id)
- {
- case HierarchyEvent.ANCESTOR_MOVED:
- hierarchyBoundsListener.ancestorMoved(e);
- break;
- case HierarchyEvent.ANCESTOR_RESIZED:
- hierarchyBoundsListener.ancestorResized(e);
- break;
- }
- }
-
- /**
- * AWT 1.0 event handler.
- *
- * This method calls one of the event-specific handler methods. For
- * example for key events, either {@link #keyDown(Event,int)}
- * or {@link #keyUp(Event,int)} is called. A derived
- * component can override one of these event-specific methods if it
- * only needs to handle certain event types. Otherwise it can
- * override handleEvent itself and handle any event.
- *
- * @param evt the event to handle
- * @return true if the event was handled, false otherwise
- * @deprecated use {@link #processEvent(AWTEvent)} instead
- */
- public boolean handleEvent (Event evt)
- {
- switch (evt.id)
- {
- // Handle key events.
- case Event.KEY_ACTION:
- case Event.KEY_PRESS:
- return keyDown (evt, evt.key);
- case Event.KEY_ACTION_RELEASE:
- case Event.KEY_RELEASE:
- return keyUp (evt, evt.key);
-
- // Handle mouse events.
- case Event.MOUSE_DOWN:
- return mouseDown (evt, evt.x, evt.y);
- case Event.MOUSE_UP:
- return mouseUp (evt, evt.x, evt.y);
- case Event.MOUSE_MOVE:
- return mouseMove (evt, evt.x, evt.y);
- case Event.MOUSE_DRAG:
- return mouseDrag (evt, evt.x, evt.y);
- case Event.MOUSE_ENTER:
- return mouseEnter (evt, evt.x, evt.y);
- case Event.MOUSE_EXIT:
- return mouseExit (evt, evt.x, evt.y);
-
- // Handle focus events.
- case Event.GOT_FOCUS:
- return gotFocus (evt, evt.arg);
- case Event.LOST_FOCUS:
- return lostFocus (evt, evt.arg);
-
- // Handle action event.
- case Event.ACTION_EVENT:
- return action (evt, evt.arg);
- }
- // Unknown event.
- return false;
- }
-
- /**
- * AWT 1.0 MOUSE_DOWN event handler. This method is meant to be
- * overridden by components providing their own MOUSE_DOWN handler.
- * The default implementation simply returns false.
- *
- * @param evt the event to handle
- * @param x the x coordinate, ignored
- * @param y the y coordinate, ignored
- * @return false
- * @deprecated use {@link #processMouseEvent(MouseEvent)} instead
- */
- public boolean mouseDown(Event evt, int x, int y)
- {
- return false;
- }
-
- /**
- * AWT 1.0 MOUSE_DRAG event handler. This method is meant to be
- * overridden by components providing their own MOUSE_DRAG handler.
- * The default implementation simply returns false.
- *
- * @param evt the event to handle
- * @param x the x coordinate, ignored
- * @param y the y coordinate, ignored
- * @return false
- * @deprecated use {@link #processMouseMotionEvent(MouseEvent)} instead
- */
- public boolean mouseDrag(Event evt, int x, int y)
- {
- return false;
- }
-
- /**
- * AWT 1.0 MOUSE_UP event handler. This method is meant to be
- * overridden by components providing their own MOUSE_UP handler.
- * The default implementation simply returns false.
- *
- * @param evt the event to handle
- * @param x the x coordinate, ignored
- * @param y the y coordinate, ignored
- * @return false
- * @deprecated use {@link #processMouseEvent(MouseEvent)} instead
- */
- public boolean mouseUp(Event evt, int x, int y)
- {
- return false;
- }
-
- /**
- * AWT 1.0 MOUSE_MOVE event handler. This method is meant to be
- * overridden by components providing their own MOUSE_MOVE handler.
- * The default implementation simply returns false.
- *
- * @param evt the event to handle
- * @param x the x coordinate, ignored
- * @param y the y coordinate, ignored
- * @return false
- * @deprecated use {@link #processMouseMotionEvent(MouseEvent)} instead
- */
- public boolean mouseMove(Event evt, int x, int y)
- {
- return false;
- }
-
- /**
- * AWT 1.0 MOUSE_ENTER event handler. This method is meant to be
- * overridden by components providing their own MOUSE_ENTER handler.
- * The default implementation simply returns false.
- *
- * @param evt the event to handle
- * @param x the x coordinate, ignored
- * @param y the y coordinate, ignored
- * @return false
- * @deprecated use {@link #processMouseEvent(MouseEvent)} instead
- */
- public boolean mouseEnter(Event evt, int x, int y)
- {
- return false;
- }
-
- /**
- * AWT 1.0 MOUSE_EXIT event handler. This method is meant to be
- * overridden by components providing their own MOUSE_EXIT handler.
- * The default implementation simply returns false.
- *
- * @param evt the event to handle
- * @param x the x coordinate, ignored
- * @param y the y coordinate, ignored
- * @return false
- * @deprecated use {@link #processMouseEvent(MouseEvent)} instead
- */
- public boolean mouseExit(Event evt, int x, int y)
- {
- return false;
- }
-
- /**
- * AWT 1.0 KEY_PRESS and KEY_ACTION event handler. This method is
- * meant to be overridden by components providing their own key
- * press handler. The default implementation simply returns false.
- *
- * @param evt the event to handle
- * @param key the key pressed, ignored
- * @return false
- * @deprecated use {@link #processKeyEvent(KeyEvent)} instead
- */
- public boolean keyDown(Event evt, int key)
- {
- return false;
- }
-
- /**
- * AWT 1.0 KEY_RELEASE and KEY_ACTION_RELEASE event handler. This
- * method is meant to be overridden by components providing their
- * own key release handler. The default implementation simply
- * returns false.
- *
- * @param evt the event to handle
- * @param key the key pressed, ignored
- * @return false
- * @deprecated use {@link #processKeyEvent(KeyEvent)} instead
- */
- public boolean keyUp(Event evt, int key)
- {
- return false;
- }
-
- /**
- * AWT 1.0 ACTION_EVENT event handler. This method is meant to be
- * overridden by components providing their own action event
- * handler. The default implementation simply returns false.
- *
- * @param evt the event to handle
- * @param what the object acted on, ignored
- * @return false
- * @deprecated in classes which support actions, use
- * <code>processActionEvent(ActionEvent)</code> instead
- */
- public boolean action(Event evt, Object what)
- {
- return false;
- }
-
- /**
- * Called to inform this component it has been added to a container.
- * A native peer - if any - is created at this time. This method is
- * called automatically by the AWT system and should not be called by
- * user level code.
- *
- * @see #isDisplayable()
- * @see #removeNotify()
- */
- public void addNotify()
- {
- if (peer == null)
- peer = getToolkit().createComponent(this);
- /* Now that all the children has gotten their peers, we should
- have the event mask needed for this component and its
- lightweight subcomponents. */
- peer.setEventMask(eventMask);
- /* We do not invalidate here, but rather leave that job up to
- the peer. For efficiency, the peer can choose not to
- invalidate if it is happy with the current dimensions,
- etc. */
- }
-
- /**
- * Called to inform this component is has been removed from its
- * container. Its native peer - if any - is destroyed at this time.
- * This method is called automatically by the AWT system and should
- * not be called by user level code.
- *
- * @see #isDisplayable()
- * @see #addNotify()
- */
- public void removeNotify()
- {
- // We null our peer field before disposing of it, such that if we're
- // not the event dispatch thread and the dispatch thread is awoken by
- // the dispose call, there will be no race checking the peer's null
- // status.
-
- ComponentPeer tmp = peer;
- peer = null;
- if (tmp != null)
- tmp.dispose();
- }
-
- /**
- * AWT 1.0 GOT_FOCUS event handler. This method is meant to be
- * overridden by components providing their own GOT_FOCUS handler.
- * The default implementation simply returns false.
- *
- * @param evt the event to handle
- * @param what the Object focused, ignored
- * @return false
- * @deprecated use {@link #processFocusEvent(FocusEvent)} instead
- */
- public boolean gotFocus(Event evt, Object what)
- {
- return false;
- }
-
- /**
- * AWT 1.0 LOST_FOCUS event handler. This method is meant to be
- * overridden by components providing their own LOST_FOCUS handler.
- * The default implementation simply returns false.
- *
- * @param evt the event to handle
- * @param what the Object focused, ignored
- * @return false
- * @deprecated use {@link #processFocusEvent(FocusEvent)} instead
- */
- public boolean lostFocus(Event evt, Object what)
- {
- return false;
- }
-
- /**
- * Tests whether or not this component is in the group that can be
- * traversed using the keyboard traversal mechanism (such as the TAB key).
- *
- * @return true if the component is traversed via the TAB key
- * @see #setFocusable(boolean)
- * @since 1.1
- * @deprecated use {@link #isFocusable()} instead
- */
- public boolean isFocusTraversable()
- {
- return enabled && visible && (peer == null || isLightweight() || peer.isFocusTraversable());
- }
-
- /**
- * Tests if this component can receive focus.
- *
- * @return true if this component can receive focus
- * @since 1.4
- */
- public boolean isFocusable()
- {
- return focusable;
- }
-
- /**
- * Specify whether this component can receive focus. This method also
- * sets the {@link #isFocusTraversableOverridden} field to 1, which
- * appears to be the undocumented way {@link
- * DefaultFocusTraversalPolicy#accept(Component)} determines whether to
- * respect the {@link #isFocusable()} method of the component.
- *
- * @param focusable the new focusable status
- * @since 1.4
- */
- public void setFocusable(boolean focusable)
- {
- firePropertyChange("focusable", this.focusable, focusable);
- this.focusable = focusable;
- this.isFocusTraversableOverridden = 1;
- }
-
- /**
- * Sets the focus traversal keys for one of the three focus
- * traversal directions supported by Components:
- * {@link #KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS},
- * {@link #KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS}, or
- * {@link #KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS}. Normally, the
- * default values should match the operating system's native
- * choices. To disable a given traversal, use
- * <code>Collections.EMPTY_SET</code>. The event dispatcher will
- * consume PRESSED, RELEASED, and TYPED events for the specified
- * key, although focus can only transfer on PRESSED or RELEASED.
- *
- * <p>The defaults are:
- * <table>
- * <th><td>Identifier</td><td>Meaning</td><td>Default</td></th>
- * <tr><td>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</td>
- * <td>Normal forward traversal</td>
- * <td>TAB on KEY_PRESSED, Ctrl-TAB on KEY_PRESSED</td></tr>
- * <tr><td>KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS</td>
- * <td>Normal backward traversal</td>
- * <td>Shift-TAB on KEY_PRESSED, Ctrl-Shift-TAB on KEY_PRESSED</td></tr>
- * <tr><td>KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS</td>
- * <td>Go up a traversal cycle</td><td>None</td></tr>
- * </table>
- *
- * If keystrokes is null, this component's focus traversal key set
- * is inherited from one of its ancestors. If none of its ancestors
- * has its own set of focus traversal keys, the focus traversal keys
- * are set to the defaults retrieved from the current
- * KeyboardFocusManager. If not null, the set must contain only
- * AWTKeyStrokes that are not already focus keys and are not
- * KEY_TYPED events.
- *
- * @param id one of FORWARD_TRAVERSAL_KEYS, BACKWARD_TRAVERSAL_KEYS, or
- * UP_CYCLE_TRAVERSAL_KEYS
- * @param keystrokes a set of keys, or null
- * @throws IllegalArgumentException if id or keystrokes is invalid
- * @see #getFocusTraversalKeys(int)
- * @see KeyboardFocusManager#FORWARD_TRAVERSAL_KEYS
- * @see KeyboardFocusManager#BACKWARD_TRAVERSAL_KEYS
- * @see KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS
- * @since 1.4
- */
- public void setFocusTraversalKeys(int id, Set keystrokes)
- {
- if (keystrokes == null)
- {
- Container parent = getParent ();
-
- while (parent != null)
- {
- if (parent.areFocusTraversalKeysSet (id))
- {
- keystrokes = parent.getFocusTraversalKeys (id);
- break;
- }
- parent = parent.getParent ();
- }
-
- if (keystrokes == null)
- keystrokes = KeyboardFocusManager.getCurrentKeyboardFocusManager ().
- getDefaultFocusTraversalKeys (id);
- }
-
- Set sa;
- Set sb;
- String name;
- switch (id)
- {
- case KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS:
- sa = getFocusTraversalKeys
- (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
- sb = getFocusTraversalKeys
- (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS);
- name = "forwardFocusTraversalKeys";
- break;
- case KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS:
- sa = getFocusTraversalKeys
- (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
- sb = getFocusTraversalKeys
- (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS);
- name = "backwardFocusTraversalKeys";
- break;
- case KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS:
- sa = getFocusTraversalKeys
- (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
- sb = getFocusTraversalKeys
- (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
- name = "upCycleFocusTraversalKeys";
- break;
- default:
- throw new IllegalArgumentException ();
- }
-
- int i = keystrokes.size ();
- Iterator iter = keystrokes.iterator ();
-
- while (--i >= 0)
- {
- Object o = iter.next ();
- if (!(o instanceof AWTKeyStroke)
- || sa.contains (o) || sb.contains (o)
- || ((AWTKeyStroke) o).keyCode == KeyEvent.VK_UNDEFINED)
- throw new IllegalArgumentException ();
- }
-
- if (focusTraversalKeys == null)
- focusTraversalKeys = new Set[3];
-
- keystrokes = Collections.unmodifiableSet (new HashSet (keystrokes));
- firePropertyChange (name, focusTraversalKeys[id], keystrokes);
-
- focusTraversalKeys[id] = keystrokes;
- }
-
- /**
- * Returns the set of keys for a given focus traversal action, as
- * defined in <code>setFocusTraversalKeys</code>. If not set, this
- * is inherited from the parent component, which may have gotten it
- * from the KeyboardFocusManager.
- *
- * @param id one of FORWARD_TRAVERSAL_KEYS, BACKWARD_TRAVERSAL_KEYS,
- * or UP_CYCLE_TRAVERSAL_KEYS
- *
- * @return set of traversal keys
- *
- * @throws IllegalArgumentException if id is invalid
- *
- * @see #setFocusTraversalKeys (int, Set)
- * @see KeyboardFocusManager#FORWARD_TRAVERSAL_KEYS
- * @see KeyboardFocusManager#BACKWARD_TRAVERSAL_KEYS
- * @see KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS
- *
- * @since 1.4
- */
- public Set getFocusTraversalKeys (int id)
- {
- if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS)
- throw new IllegalArgumentException();
-
- Set s = null;
-
- if (focusTraversalKeys != null)
- s = focusTraversalKeys[id];
-
- if (s == null && parent != null)
- s = parent.getFocusTraversalKeys (id);
-
- return s == null ? (KeyboardFocusManager.getCurrentKeyboardFocusManager()
- .getDefaultFocusTraversalKeys(id)) : s;
- }
-
- /**
- * Tests whether the focus traversal keys for a given action are explicitly
- * set or inherited.
- *
- * @param id one of FORWARD_TRAVERSAL_KEYS, BACKWARD_TRAVERSAL_KEYS,
- * or UP_CYCLE_TRAVERSAL_KEYS
- * @return true if that set is explicitly specified
- * @throws IllegalArgumentException if id is invalid
- * @see #getFocusTraversalKeys (int)
- * @see KeyboardFocusManager#FORWARD_TRAVERSAL_KEYS
- * @see KeyboardFocusManager#BACKWARD_TRAVERSAL_KEYS
- * @see KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS
- * @since 1.4
- */
- public boolean areFocusTraversalKeysSet (int id)
- {
- if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS)
- throw new IllegalArgumentException ();
-
- return focusTraversalKeys != null && focusTraversalKeys[id] != null;
- }
-
- /**
- * Enable or disable focus traversal keys on this Component. If
- * they are, then the keyboard focus manager consumes and acts on
- * key press and release events that trigger focus traversal, and
- * discards the corresponding key typed events. If focus traversal
- * keys are disabled, then all key events that would otherwise
- * trigger focus traversal are sent to this Component.
- *
- * @param focusTraversalKeysEnabled the new value of the flag
- * @see #getFocusTraversalKeysEnabled ()
- * @see #setFocusTraversalKeys (int, Set)
- * @see #getFocusTraversalKeys (int)
- * @since 1.4
- */
- public void setFocusTraversalKeysEnabled (boolean focusTraversalKeysEnabled)
- {
- firePropertyChange ("focusTraversalKeysEnabled",
- this.focusTraversalKeysEnabled,
- focusTraversalKeysEnabled);
- this.focusTraversalKeysEnabled = focusTraversalKeysEnabled;
- }
-
- /**
- * Check whether or not focus traversal keys are enabled on this
- * Component. If they are, then the keyboard focus manager consumes
- * and acts on key press and release events that trigger focus
- * traversal, and discards the corresponding key typed events. If
- * focus traversal keys are disabled, then all key events that would
- * otherwise trigger focus traversal are sent to this Component.
- *
- * @return true if focus traversal keys are enabled
- * @see #setFocusTraversalKeysEnabled (boolean)
- * @see #setFocusTraversalKeys (int, Set)
- * @see #getFocusTraversalKeys (int)
- * @since 1.4
- */
- public boolean getFocusTraversalKeysEnabled ()
- {
- return focusTraversalKeysEnabled;
- }
-
- /**
- * Request that this Component be given the keyboard input focus and
- * that its top-level ancestor become the focused Window.
- *
- * For the request to be granted, the Component must be focusable,
- * displayable and showing and the top-level Window to which it
- * belongs must be focusable. If the request is initially denied on
- * the basis that the top-level Window is not focusable, the request
- * will be remembered and granted when the Window does become
- * focused.
- *
- * Never assume that this Component is the focus owner until it
- * receives a FOCUS_GAINED event.
- *
- * The behaviour of this method is platform-dependent.
- * {@link #requestFocusInWindow()} should be used instead.
- *
- * @see #requestFocusInWindow ()
- * @see FocusEvent
- * @see #addFocusListener (FocusListener)
- * @see #isFocusable ()
- * @see #isDisplayable ()
- * @see KeyboardFocusManager#clearGlobalFocusOwner ()
- */
- public void requestFocus ()
- {
- if (isDisplayable ()
- && isShowing ()
- && isFocusable ())
- {
- synchronized (getTreeLock ())
- {
- // Find this Component's top-level ancestor.
- Container parent = getParent ();
-
- while (parent != null
- && !(parent instanceof Window))
- parent = parent.getParent ();
-
- Window toplevel = (Window) parent;
- if (toplevel.isFocusableWindow ())
- {
- if (peer != null && !isLightweight())
- // This call will cause a FOCUS_GAINED event to be
- // posted to the system event queue if the native
- // windowing system grants the focus request.
- peer.requestFocus ();
- else
- {
- // Either our peer hasn't been created yet or we're a
- // lightweight component. In either case we want to
- // post a FOCUS_GAINED event.
- EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
- synchronized (eq)
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
- Component currentFocusOwner = manager.getGlobalPermanentFocusOwner ();
- if (currentFocusOwner != null)
- {
- eq.postEvent (new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST,
- false, this));
- eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, false,
- currentFocusOwner));
- }
- else
- eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, false));
- }
- }
- }
- else
- pendingFocusRequest = new FocusEvent(this, FocusEvent.FOCUS_GAINED);
- }
- }
- }
-
- /**
- * Request that this Component be given the keyboard input focus and
- * that its top-level ancestor become the focused Window.
- *
- * For the request to be granted, the Component must be focusable,
- * displayable and showing and the top-level Window to which it
- * belongs must be focusable. If the request is initially denied on
- * the basis that the top-level Window is not focusable, the request
- * will be remembered and granted when the Window does become
- * focused.
- *
- * Never assume that this Component is the focus owner until it
- * receives a FOCUS_GAINED event.
- *
- * The behaviour of this method is platform-dependent.
- * {@link #requestFocusInWindow()} should be used instead.
- *
- * If the return value is false, the request is guaranteed to fail.
- * If the return value is true, the request will succeed unless it
- * is vetoed or something in the native windowing system intervenes,
- * preventing this Component's top-level ancestor from becoming
- * focused. This method is meant to be called by derived
- * lightweight Components that want to avoid unnecessary repainting
- * when they know a given focus transfer need only be temporary.
- *
- * @param temporary true if the focus request is temporary
- * @return true if the request has a chance of success
- * @see #requestFocusInWindow ()
- * @see FocusEvent
- * @see #addFocusListener (FocusListener)
- * @see #isFocusable ()
- * @see #isDisplayable ()
- * @see KeyboardFocusManager#clearGlobalFocusOwner ()
- * @since 1.4
- */
- protected boolean requestFocus (boolean temporary)
- {
- if (isDisplayable ()
- && isShowing ()
- && isFocusable ())
- {
- synchronized (getTreeLock ())
- {
- // Find this Component's top-level ancestor.
- Container parent = getParent ();
-
- while (parent != null
- && !(parent instanceof Window))
- parent = parent.getParent ();
-
- Window toplevel = (Window) parent;
- if (toplevel.isFocusableWindow ())
- {
- if (peer != null && !isLightweight())
- // This call will cause a FOCUS_GAINED event to be
- // posted to the system event queue if the native
- // windowing system grants the focus request.
- peer.requestFocus ();
- else
- {
- // Either our peer hasn't been created yet or we're a
- // lightweight component. In either case we want to
- // post a FOCUS_GAINED event.
- EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
- synchronized (eq)
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
- Component currentFocusOwner = manager.getGlobalPermanentFocusOwner ();
- if (currentFocusOwner != null)
- {
- eq.postEvent (new FocusEvent(currentFocusOwner,
- FocusEvent.FOCUS_LOST,
- temporary, this));
- eq.postEvent (new FocusEvent(this,
- FocusEvent.FOCUS_GAINED,
- temporary,
- currentFocusOwner));
- }
- else
- eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, temporary));
- }
- }
- }
- else
- // FIXME: need to add a focus listener to our top-level
- // ancestor, so that we can post this event when it becomes
- // the focused window.
- pendingFocusRequest = new FocusEvent(this, FocusEvent.FOCUS_GAINED, temporary);
- }
- }
- // Always return true.
- return true;
- }
-
- /**
- * Request that this component be given the keyboard input focus, if
- * its top-level ancestor is the currently focused Window. A
- * <code>FOCUS_GAINED</code> event will be fired if and only if this
- * request is successful. To be successful, the component must be
- * displayable, showing, and focusable, and its ancestor top-level
- * Window must be focused.
- *
- * If the return value is false, the request is guaranteed to fail.
- * If the return value is true, the request will succeed unless it
- * is vetoed or something in the native windowing system intervenes,
- * preventing this Component's top-level ancestor from becoming
- * focused.
- *
- * @return true if the request has a chance of success
- * @see #requestFocus ()
- * @see FocusEvent
- * @see #addFocusListener (FocusListener)
- * @see #isFocusable ()
- * @see #isDisplayable ()
- * @see KeyboardFocusManager#clearGlobalFocusOwner ()
- * @since 1.4
- */
- public boolean requestFocusInWindow ()
- {
- return requestFocusInWindow (false);
- }
-
- /**
- * Request that this component be given the keyboard input focus, if
- * its top-level ancestor is the currently focused Window. A
- * <code>FOCUS_GAINED</code> event will be fired if and only if this
- * request is successful. To be successful, the component must be
- * displayable, showing, and focusable, and its ancestor top-level
- * Window must be focused.
- *
- * If the return value is false, the request is guaranteed to fail.
- * If the return value is true, the request will succeed unless it
- * is vetoed or something in the native windowing system intervenes,
- * preventing this Component's top-level ancestor from becoming
- * focused. This method is meant to be called by derived
- * lightweight Components that want to avoid unnecessary repainting
- * when they know a given focus transfer need only be temporary.
- *
- * @param temporary true if the focus request is temporary
- * @return true if the request has a chance of success
- * @see #requestFocus ()
- * @see FocusEvent
- * @see #addFocusListener (FocusListener)
- * @see #isFocusable ()
- * @see #isDisplayable ()
- * @see KeyboardFocusManager#clearGlobalFocusOwner ()
- * @since 1.4
- */
- protected boolean requestFocusInWindow (boolean temporary)
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
-
- Window focusedWindow = manager.getFocusedWindow ();
-
- if (isDisplayable ()
- && isShowing ()
- && isFocusable ())
- {
- if (focusedWindow != null)
- {
- synchronized (getTreeLock ())
- {
- Container parent = getParent ();
-
- while (parent != null
- && !(parent instanceof Window))
- parent = parent.getParent ();
-
- Window toplevel = (Window) parent;
-
- // Check if top-level ancestor is currently focused window.
- if (focusedWindow == toplevel)
- {
- if (peer != null
- && !isLightweight()
- && !(this instanceof Window))
- // This call will cause a FOCUS_GAINED event to be
- // posted to the system event queue if the native
- // windowing system grants the focus request.
- peer.requestFocus ();
- else
- {
- // Either our peer hasn't been created yet or we're a
- // lightweight component. In either case we want to
- // post a FOCUS_GAINED event.
- EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
- synchronized (eq)
- {
- Component currentFocusOwner = manager.getGlobalPermanentFocusOwner ();
- if (currentFocusOwner != null)
- {
- eq.postEvent (new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST,
- temporary, this));
- eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, temporary,
- currentFocusOwner));
- }
- else
- eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, temporary));
- }
- }
- }
- else
- return false;
- }
- }
-
- return true;
- }
- return false;
- }
-
- /**
- * Transfers focus to the next component in the focus traversal
- * order, as though this were the current focus owner.
- *
- * @see #requestFocus()
- * @since 1.1
- */
- public void transferFocus ()
- {
- nextFocus ();
- }
-
- /**
- * Returns the root container that owns the focus cycle where this
- * component resides. A focus cycle root is in two cycles, one as
- * the ancestor, and one as the focusable element; this call always
- * returns the ancestor.
- *
- * @return the ancestor container that owns the focus cycle
- * @since 1.4
- */
- public Container getFocusCycleRootAncestor ()
- {
- if (this instanceof Window
- && ((Container) this).isFocusCycleRoot ())
- return (Container) this;
-
- Container parent = getParent ();
-
- while (parent != null
- && !parent.isFocusCycleRoot ())
- parent = parent.getParent ();
-
- return parent;
- }
-
- /**
- * Tests if the container is the ancestor of the focus cycle that
- * this component belongs to.
- *
- * @param c the container to test
- * @return true if c is the focus cycle root
- * @since 1.4
- */
- public boolean isFocusCycleRoot (Container c)
- {
- return c == getFocusCycleRootAncestor ();
- }
-
- /**
- * AWT 1.0 focus event processor. Transfers focus to the next
- * component in the focus traversal order, as though this were the
- * current focus owner.
- *
- * @deprecated use {@link #transferFocus ()} instead
- */
- public void nextFocus ()
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
-
- manager.focusNextComponent (this);
- }
-
- /**
- * Transfers focus to the previous component in the focus traversal
- * order, as though this were the current focus owner.
- *
- * @see #requestFocus ()
- * @since 1.4
- */
- public void transferFocusBackward ()
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
-
- manager.focusPreviousComponent (this);
- }
-
- /**
- * Transfers focus to the focus cycle root of this component.
- * However, if this is a Window, the default focus owner in the
- * window in the current focus cycle is focused instead.
- *
- * @see #requestFocus()
- * @see #isFocusCycleRoot(Container)
- * @since 1.4
- */
- public void transferFocusUpCycle ()
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
-
- manager.upFocusCycle (this);
- }
-
- /**
- * Tests if this component is the focus owner. Use {@link
- * #isFocusOwner ()} instead.
- *
- * @return true if this component owns focus
- * @since 1.2
- */
- public boolean hasFocus ()
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
-
- Component focusOwner = manager.getFocusOwner ();
-
- return this == focusOwner;
- }
-
- /**
- * Tests if this component is the focus owner.
- *
- * @return true if this component owns focus
- * @since 1.4
- */
- public boolean isFocusOwner()
- {
- return hasFocus ();
- }
-
- /**
- * Adds the specified popup menu to this component.
- *
- * @param popup the popup menu to be added
- *
- * @see #remove(MenuComponent)
- *
- * @since 1.1
- */
- public synchronized void add(PopupMenu popup)
- {
- if (popups == null)
- popups = new Vector();
- popups.add(popup);
-
- if (popup.parent != null)
- popup.parent.remove(popup);
- popup.parent = this;
- if (peer != null)
- popup.addNotify();
- }
-
- /**
- * Removes the specified popup menu from this component.
- *
- * @param popup the popup menu to remove
- * @see #add(PopupMenu)
- * @since 1.1
- */
- public synchronized void remove(MenuComponent popup)
- {
- if (popups != null)
- popups.remove(popup);
- }
-
- /**
- * Returns a debugging string representing this component. The string may
- * be empty but not null.
- *
- * @return a string representing this component
- */
- protected String paramString()
- {
- StringBuffer param = new StringBuffer();
- String name = getName();
- if (name != null)
- param.append(name).append(",");
- param.append(x).append(",").append(y).append(",").append(width)
- .append("x").append(height);
- if (! isValid())
- param.append(",invalid");
- if (! isVisible())
- param.append(",invisible");
- if (! isEnabled())
- param.append(",disabled");
- if (! isOpaque())
- param.append(",translucent");
- if (isDoubleBuffered())
- param.append(",doublebuffered");
- return param.toString();
- }
-
- /**
- * Returns a string representation of this component. This is implemented
- * as <code>getClass().getName() + '[' + paramString() + ']'</code>.
- *
- * @return a string representation of this component
- */
- public String toString()
- {
- return getClass().getName() + '[' + paramString() + ']';
- }
-
- /**
- * Prints a listing of this component to <code>System.out</code>.
- *
- * @see #list(PrintStream)
- */
- public void list()
- {
- list(System.out, 0);
- }
-
- /**
- * Prints a listing of this component to the specified print stream.
- *
- * @param out the <code>PrintStream</code> to print to
- */
- public void list(PrintStream out)
- {
- list(out, 0);
- }
-
- /**
- * Prints a listing of this component to the specified print stream,
- * starting at the specified indentation point.
- *
- * @param out the <code>PrintStream</code> to print to
- * @param indent the indentation point
- */
- public void list(PrintStream out, int indent)
- {
- for (int i = 0; i < indent; ++i)
- out.print(' ');
- out.println(toString());
- }
-
- /**
- * Prints a listing of this component to the specified print writer.
- *
- * @param out the <code>PrintWrinter</code> to print to
- * @since 1.1
- */
- public void list(PrintWriter out)
- {
- list(out, 0);
- }
-
- /**
- * Prints a listing of this component to the specified print writer,
- * starting at the specified indentation point.
- *
- * @param out the <code>PrintWriter</code> to print to
- * @param indent the indentation point
- * @since 1.1
- */
- public void list(PrintWriter out, int indent)
- {
- for (int i = 0; i < indent; ++i)
- out.print(' ');
- out.println(toString());
- }
-
- /**
- * Adds the specified property listener to this component. This is harmless
- * if the listener is null, but if the listener has already been registered,
- * it will now be registered twice. The property listener ignores inherited
- * properties. Recognized properties include:<br>
- * <ul>
- * <li>the font (<code>"font"</code>)</li>
- * <li>the background color (<code>"background"</code>)</li>
- * <li>the foreground color (<code>"foreground"</code>)</li>
- * <li>the focusability (<code>"focusable"</code>)</li>
- * <li>the focus key traversal enabled state
- * (<code>"focusTraversalKeysEnabled"</code>)</li>
- * <li>the set of forward traversal keys
- * (<code>"forwardFocusTraversalKeys"</code>)</li>
- * <li>the set of backward traversal keys
- * (<code>"backwardFocusTraversalKeys"</code>)</li>
- * <li>the set of up-cycle traversal keys
- * (<code>"upCycleFocusTraversalKeys"</code>)</li>
- * </ul>
- *
- * @param listener the new listener to add
- * @see #removePropertyChangeListener(PropertyChangeListener)
- * @see #getPropertyChangeListeners()
- * @see #addPropertyChangeListener(String, PropertyChangeListener)
- * @since 1.1
- */
- public void addPropertyChangeListener(PropertyChangeListener listener)
- {
- if (changeSupport == null)
- changeSupport = new PropertyChangeSupport(this);
- changeSupport.addPropertyChangeListener(listener);
- }
-
- /**
- * Removes the specified property listener from the component. This is
- * harmless if the listener was not previously registered.
- *
- * @param listener the listener to remove
- * @see #addPropertyChangeListener(PropertyChangeListener)
- * @see #getPropertyChangeListeners()
- * @see #removePropertyChangeListener(String, PropertyChangeListener)
- * @since 1.1
- */
- public void removePropertyChangeListener(PropertyChangeListener listener)
- {
- if (changeSupport != null)
- changeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * Returns an array of all specified listeners registered on this component.
- *
- * @return an array of listeners
- * @see #addPropertyChangeListener(PropertyChangeListener)
- * @see #removePropertyChangeListener(PropertyChangeListener)
- * @see #getPropertyChangeListeners(String)
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners()
- {
- return changeSupport == null ? new PropertyChangeListener[0]
- : changeSupport.getPropertyChangeListeners();
- }
-
- /**
- * Adds the specified property listener to this component. This is harmless
- * if the listener is null, but if the listener has already been registered,
- * it will now be registered twice. The property listener ignores inherited
- * properties. The listener is keyed to a single property. Recognized
- * properties include:<br>
- * <ul>
- * <li>the font (<code>"font"</code>)</li>
- * <li>the background color (<code>"background"</code>)</li>
- * <li>the foreground color (<code>"foreground"</code>)</li>
- * <li>the focusability (<code>"focusable"</code>)</li>
- * <li>the focus key traversal enabled state
- * (<code>"focusTraversalKeysEnabled"</code>)</li>
- * <li>the set of forward traversal keys
- * (<code>"forwardFocusTraversalKeys"</code>)</li>
-p * <li>the set of backward traversal keys
- * (<code>"backwardFocusTraversalKeys"</code>)</li>
- * <li>the set of up-cycle traversal keys
- * (<code>"upCycleFocusTraversalKeys"</code>)</li>
- * </ul>
- *
- * @param propertyName the property name to filter on
- * @param listener the new listener to add
- * @see #removePropertyChangeListener(String, PropertyChangeListener)
- * @see #getPropertyChangeListeners(String)
- * @see #addPropertyChangeListener(PropertyChangeListener)
- * @since 1.1
- */
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener listener)
- {
- if (changeSupport == null)
- changeSupport = new PropertyChangeSupport(this);
- changeSupport.addPropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Removes the specified property listener on a particular property from
- * the component. This is harmless if the listener was not previously
- * registered.
- *
- * @param propertyName the property name to filter on
- * @param listener the listener to remove
- * @see #addPropertyChangeListener(String, PropertyChangeListener)
- * @see #getPropertyChangeListeners(String)
- * @see #removePropertyChangeListener(PropertyChangeListener)
- * @since 1.1
- */
- public void removePropertyChangeListener(String propertyName,
- PropertyChangeListener listener)
- {
- if (changeSupport != null)
- changeSupport.removePropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Returns an array of all specified listeners on the named property that
- * are registered on this component.
- *
- * @return an array of listeners
- * @see #addPropertyChangeListener(String, PropertyChangeListener)
- * @see #removePropertyChangeListener(String, PropertyChangeListener)
- * @see #getPropertyChangeListeners()
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners(String property)
- {
- return changeSupport == null ? new PropertyChangeListener[0]
- : changeSupport.getPropertyChangeListeners(property);
- }
-
- /**
- * Report a change in a bound property to any registered property listeners.
- *
- * @param propertyName the property that changed
- * @param oldValue the old property value
- * @param newValue the new property value
- */
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
- /**
- * Report a change in a bound property to any registered property listeners.
- *
- * @param propertyName the property that changed
- * @param oldValue the old property value
- * @param newValue the new property value
- */
- protected void firePropertyChange(String propertyName, boolean oldValue,
- boolean newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
- /**
- * Report a change in a bound property to any registered property listeners.
- *
- * @param propertyName the property that changed
- * @param oldValue the old property value
- * @param newValue the new property value
- */
- protected void firePropertyChange(String propertyName, int oldValue,
- int newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
- /**
- * Sets the text layout orientation of this component. New components default
- * to UNKNOWN (which behaves like LEFT_TO_RIGHT). This method affects only
- * the current component, while
- * {@link #applyComponentOrientation(ComponentOrientation)} affects the
- * entire hierarchy.
- *
- * @param o the new orientation
- * @throws NullPointerException if o is null
- * @see #getComponentOrientation()
- */
- public void setComponentOrientation(ComponentOrientation o)
- {
- if (o == null)
- throw new NullPointerException();
- ComponentOrientation oldOrientation = orientation;
- orientation = o;
- firePropertyChange("componentOrientation", oldOrientation, o);
- }
-
- /**
- * Determines the text layout orientation used by this component.
- *
- * @return the component orientation
- * @see #setComponentOrientation(ComponentOrientation)
- */
- public ComponentOrientation getComponentOrientation()
- {
- return orientation;
- }
-
- /**
- * Sets the text layout orientation of this component. New components default
- * to UNKNOWN (which behaves like LEFT_TO_RIGHT). This method affects the
- * entire hierarchy, while
- * {@link #setComponentOrientation(ComponentOrientation)} affects only the
- * current component.
- *
- * @param o the new orientation
- * @throws NullPointerException if o is null
- * @see #getComponentOrientation()
- * @since 1.4
- */
- public void applyComponentOrientation(ComponentOrientation o)
- {
- setComponentOrientation(o);
- }
-
- /**
- * Returns the accessibility framework context of this class. Component is
- * not accessible, so the default implementation returns null. Subclasses
- * must override this behavior, and return an appropriate subclass of
- * {@link AccessibleAWTComponent}.
- *
- * @return the accessibility context
- */
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
-
- // Helper methods; some are package visible for use by subclasses.
-
- /**
- * Subclasses should override this to return unique component names like
- * "menuitem0".
- *
- * @return the generated name for this component
- */
- String generateName()
- {
- // Component is abstract.
- return null;
- }
-
- /**
- * Sets the peer for this component.
- *
- * @param peer the new peer
- */
- final void setPeer(ComponentPeer peer)
- {
- this.peer = peer;
- }
-
- /**
- * Implementation method that allows classes such as Canvas and Window to
- * override the graphics configuration without violating the published API.
- *
- * @return the graphics configuration
- */
- GraphicsConfiguration getGraphicsConfigurationImpl()
- {
- if (peer != null)
- {
- GraphicsConfiguration config = peer.getGraphicsConfiguration();
- if (config != null)
- return config;
- }
-
- if (parent != null)
- return parent.getGraphicsConfiguration();
-
- return null;
- }
-
- /**
- * Translate an AWT 1.1 event ({@link AWTEvent}) into an AWT 1.0
- * event ({@link Event}).
- *
- * @param e an AWT 1.1 event to translate
- *
- * @return an AWT 1.0 event representing e
- */
- static Event translateEvent (AWTEvent e)
- {
- Component target = (Component) e.getSource ();
- Event translated = null;
-
- if (e instanceof InputEvent)
- {
- InputEvent ie = (InputEvent) e;
- long when = ie.getWhen ();
-
- int oldID = 0;
- int id = e.getID ();
-
- int oldMods = 0;
- int mods = ie.getModifiersEx ();
-
- if ((mods & InputEvent.BUTTON2_DOWN_MASK) != 0)
- oldMods |= Event.META_MASK;
- else if ((mods & InputEvent.BUTTON3_DOWN_MASK) != 0)
- oldMods |= Event.ALT_MASK;
-
- if ((mods & InputEvent.SHIFT_DOWN_MASK) != 0)
- oldMods |= Event.SHIFT_MASK;
-
- if ((mods & InputEvent.CTRL_DOWN_MASK) != 0)
- oldMods |= Event.CTRL_MASK;
-
- if ((mods & InputEvent.META_DOWN_MASK) != 0)
- oldMods |= Event.META_MASK;
-
- if ((mods & InputEvent.ALT_DOWN_MASK) != 0)
- oldMods |= Event.ALT_MASK;
-
- if (e instanceof MouseEvent)
- {
- if (id == MouseEvent.MOUSE_PRESSED)
- oldID = Event.MOUSE_DOWN;
- else if (id == MouseEvent.MOUSE_RELEASED)
- oldID = Event.MOUSE_UP;
- else if (id == MouseEvent.MOUSE_MOVED)
- oldID = Event.MOUSE_MOVE;
- else if (id == MouseEvent.MOUSE_DRAGGED)
- oldID = Event.MOUSE_DRAG;
- else if (id == MouseEvent.MOUSE_ENTERED)
- oldID = Event.MOUSE_ENTER;
- else if (id == MouseEvent.MOUSE_EXITED)
- oldID = Event.MOUSE_EXIT;
- else
- // No analogous AWT 1.0 mouse event.
- return null;
-
- MouseEvent me = (MouseEvent) e;
-
- translated = new Event (target, when, oldID,
- me.getX (), me.getY (), 0, oldMods);
- }
- else if (e instanceof KeyEvent)
- {
- if (id == KeyEvent.KEY_PRESSED)
- oldID = Event.KEY_PRESS;
- else if (e.getID () == KeyEvent.KEY_RELEASED)
- oldID = Event.KEY_RELEASE;
- else
- // No analogous AWT 1.0 key event.
- return null;
-
- int oldKey = 0;
- int newKey = ((KeyEvent) e).getKeyCode ();
- switch (newKey)
- {
- case KeyEvent.VK_BACK_SPACE:
- oldKey = Event.BACK_SPACE;
- break;
- case KeyEvent.VK_CAPS_LOCK:
- oldKey = Event.CAPS_LOCK;
- break;
- case KeyEvent.VK_DELETE:
- oldKey = Event.DELETE;
- break;
- case KeyEvent.VK_DOWN:
- case KeyEvent.VK_KP_DOWN:
- oldKey = Event.DOWN;
- break;
- case KeyEvent.VK_END:
- oldKey = Event.END;
- break;
- case KeyEvent.VK_ENTER:
- oldKey = Event.ENTER;
- break;
- case KeyEvent.VK_ESCAPE:
- oldKey = Event.ESCAPE;
- break;
- case KeyEvent.VK_F1:
- oldKey = Event.F1;
- break;
- case KeyEvent.VK_F10:
- oldKey = Event.F10;
- break;
- case KeyEvent.VK_F11:
- oldKey = Event.F11;
- break;
- case KeyEvent.VK_F12:
- oldKey = Event.F12;
- break;
- case KeyEvent.VK_F2:
- oldKey = Event.F2;
- break;
- case KeyEvent.VK_F3:
- oldKey = Event.F3;
- break;
- case KeyEvent.VK_F4:
- oldKey = Event.F4;
- break;
- case KeyEvent.VK_F5:
- oldKey = Event.F5;
- break;
- case KeyEvent.VK_F6:
- oldKey = Event.F6;
- break;
- case KeyEvent.VK_F7:
- oldKey = Event.F7;
- break;
- case KeyEvent.VK_F8:
- oldKey = Event.F8;
- break;
- case KeyEvent.VK_F9:
- oldKey = Event.F9;
- break;
- case KeyEvent.VK_HOME:
- oldKey = Event.HOME;
- break;
- case KeyEvent.VK_INSERT:
- oldKey = Event.INSERT;
- break;
- case KeyEvent.VK_LEFT:
- case KeyEvent.VK_KP_LEFT:
- oldKey = Event.LEFT;
- break;
- case KeyEvent.VK_NUM_LOCK:
- oldKey = Event.NUM_LOCK;
- break;
- case KeyEvent.VK_PAUSE:
- oldKey = Event.PAUSE;
- break;
- case KeyEvent.VK_PAGE_DOWN:
- oldKey = Event.PGDN;
- break;
- case KeyEvent.VK_PAGE_UP:
- oldKey = Event.PGUP;
- break;
- case KeyEvent.VK_PRINTSCREEN:
- oldKey = Event.PRINT_SCREEN;
- break;
- case KeyEvent.VK_RIGHT:
- case KeyEvent.VK_KP_RIGHT:
- oldKey = Event.RIGHT;
- break;
- case KeyEvent.VK_SCROLL_LOCK:
- oldKey = Event.SCROLL_LOCK;
- break;
- case KeyEvent.VK_TAB:
- oldKey = Event.TAB;
- break;
- case KeyEvent.VK_UP:
- case KeyEvent.VK_KP_UP:
- oldKey = Event.UP;
- break;
- default:
- oldKey = newKey;
- }
-
- translated = new Event (target, when, oldID,
- 0, 0, oldKey, oldMods);
- }
- }
- else if (e instanceof ActionEvent)
- translated = new Event (target, Event.ACTION_EVENT,
- ((ActionEvent) e).getActionCommand ());
-
- return translated;
- }
-
- /**
- * Implementation of dispatchEvent. Allows trusted package classes
- * to dispatch additional events first. This implementation first
- * translates <code>e</code> to an AWT 1.0 event and sends the
- * result to {@link #postEvent}. If the AWT 1.0 event is not
- * handled, and events of type <code>e</code> are enabled for this
- * component, e is passed on to {@link #processEvent}.
- *
- * @param e the event to dispatch
- */
-
- void dispatchEventImpl (AWTEvent e)
- {
- Event oldEvent = translateEvent (e);
-
- if (oldEvent != null)
- postEvent (oldEvent);
-
- if (eventTypeEnabled (e.id))
- {
- // the trick we use to communicate between dispatch and redispatch
- // is to have KeyboardFocusManager.redispatch synchronize on the
- // object itself. we then do not redispatch to KeyboardFocusManager
- // if we are already holding the lock.
- if (! Thread.holdsLock(e))
- {
- switch (e.id)
- {
- case WindowEvent.WINDOW_GAINED_FOCUS:
- case WindowEvent.WINDOW_LOST_FOCUS:
- case KeyEvent.KEY_PRESSED:
- case KeyEvent.KEY_RELEASED:
- case KeyEvent.KEY_TYPED:
- case FocusEvent.FOCUS_GAINED:
- case FocusEvent.FOCUS_LOST:
- if (KeyboardFocusManager
- .getCurrentKeyboardFocusManager()
- .dispatchEvent(e))
- return;
- }
- }
- processEvent (e);
- }
- }
-
- /**
- * Tells whether or not an event type is enabled.
- */
- boolean eventTypeEnabled (int type)
- {
- if (type > AWTEvent.RESERVED_ID_MAX)
- return true;
-
- switch (type)
- {
- case ComponentEvent.COMPONENT_HIDDEN:
- case ComponentEvent.COMPONENT_MOVED:
- case ComponentEvent.COMPONENT_RESIZED:
- case ComponentEvent.COMPONENT_SHOWN:
- return (componentListener != null
- || (eventMask & AWTEvent.COMPONENT_EVENT_MASK) != 0);
-
- case KeyEvent.KEY_PRESSED:
- case KeyEvent.KEY_RELEASED:
- case KeyEvent.KEY_TYPED:
- return (keyListener != null
- || (eventMask & AWTEvent.KEY_EVENT_MASK) != 0);
-
- case MouseEvent.MOUSE_CLICKED:
- case MouseEvent.MOUSE_ENTERED:
- case MouseEvent.MOUSE_EXITED:
- case MouseEvent.MOUSE_PRESSED:
- case MouseEvent.MOUSE_RELEASED:
- case MouseEvent.MOUSE_MOVED:
- case MouseEvent.MOUSE_DRAGGED:
- return (mouseListener != null
- || mouseMotionListener != null
- || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0);
-
- case FocusEvent.FOCUS_GAINED:
- case FocusEvent.FOCUS_LOST:
- return (focusListener != null
- || (eventMask & AWTEvent.FOCUS_EVENT_MASK) != 0);
-
- case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED:
- case InputMethodEvent.CARET_POSITION_CHANGED:
- return (inputMethodListener != null
- || (eventMask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0);
-
- case PaintEvent.PAINT:
- case PaintEvent.UPDATE:
- return (eventMask & AWTEvent.PAINT_EVENT_MASK) != 0;
-
- default:
- return false;
- }
- }
-
- /**
- * Coalesce paint events. Current heuristic is: Merge if the union of
- * areas is less than twice that of the sum of the areas. The X server
- * tend to create a lot of paint events that are adjacent but not
- * overlapping.
- *
- * <pre>
- * +------+
- * | +-----+ ...will be merged
- * | | |
- * | | |
- * +------+ |
- * +-----+
- *
- * +---------------+--+
- * | | | ...will not be merged
- * +---------------+ |
- * | |
- * | |
- * | |
- * | |
- * | |
- * +--+
- * </pre>
- *
- * @param queuedEvent the first paint event
- * @param newEvent the second paint event
- * @return the combined paint event, or null
- */
- private PaintEvent coalescePaintEvents(PaintEvent queuedEvent,
- PaintEvent newEvent)
- {
- Rectangle r1 = queuedEvent.getUpdateRect();
- Rectangle r2 = newEvent.getUpdateRect();
- Rectangle union = r1.union(r2);
-
- int r1a = r1.width * r1.height;
- int r2a = r2.width * r2.height;
- int ua = union.width * union.height;
-
- if (ua > (r1a+r2a)*2)
- return null;
- /* The 2 factor should maybe be reconsidered. Perhaps 3/2
- would be better? */
-
- newEvent.setUpdateRect(union);
- return newEvent;
- }
-
- /**
- * This method is used to implement transferFocus(). CHILD is the child
- * making the request. This is overridden by Container; when called for an
- * ordinary component there is no child and so we always return null.
- *
- * FIXME: is this still needed, in light of focus traversal policies?
- *
- * @param child the component making the request
- * @return the next component to focus on
- */
- Component findNextFocusComponent(Component child)
- {
- return null;
- }
-
- /**
- * Deserializes this component. This regenerates all serializable listeners
- * which were registered originally.
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if deserialization fails
- * @throws IOException if the stream fails
- */
- private void readObject(ObjectInputStream s)
- throws ClassNotFoundException, IOException
- {
- s.defaultReadObject();
- String key = (String) s.readObject();
- while (key != null)
- {
- Object listener = s.readObject();
- if ("componentL".equals(key))
- addComponentListener((ComponentListener) listener);
- else if ("focusL".equals(key))
- addFocusListener((FocusListener) listener);
- else if ("keyL".equals(key))
- addKeyListener((KeyListener) listener);
- else if ("mouseL".equals(key))
- addMouseListener((MouseListener) listener);
- else if ("mouseMotionL".equals(key))
- addMouseMotionListener((MouseMotionListener) listener);
- else if ("inputMethodL".equals(key))
- addInputMethodListener((InputMethodListener) listener);
- else if ("hierarchyL".equals(key))
- addHierarchyListener((HierarchyListener) listener);
- else if ("hierarchyBoundsL".equals(key))
- addHierarchyBoundsListener((HierarchyBoundsListener) listener);
- else if ("mouseWheelL".equals(key))
- addMouseWheelListener((MouseWheelListener) listener);
- key = (String) s.readObject();
- }
- }
-
- /**
- * Serializes this component. This ignores all listeners which do not
- * implement Serializable, but includes those that do.
- *
- * @param s the stream to write to
- * @throws IOException if the stream fails
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- s.defaultWriteObject();
- AWTEventMulticaster.save(s, "componentL", componentListener);
- AWTEventMulticaster.save(s, "focusL", focusListener);
- AWTEventMulticaster.save(s, "keyL", keyListener);
- AWTEventMulticaster.save(s, "mouseL", mouseListener);
- AWTEventMulticaster.save(s, "mouseMotionL", mouseMotionListener);
- AWTEventMulticaster.save(s, "inputMethodL", inputMethodListener);
- AWTEventMulticaster.save(s, "hierarchyL", hierarchyListener);
- AWTEventMulticaster.save(s, "hierarchyBoundsL", hierarchyBoundsListener);
- AWTEventMulticaster.save(s, "mouseWheelL", mouseWheelListener);
- s.writeObject(null);
- }
-
-
- // Nested classes.
-
- /**
- * This class provides accessibility support for subclasses of container.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- * @status updated to 1.4
- */
- protected abstract class AccessibleAWTComponent extends AccessibleContext
- implements Serializable, AccessibleComponent
- {
- /**
- * Compatible with JDK 1.3+.
- */
- private static final long serialVersionUID = 642321655757800191L;
-
- /**
- * Converts show/hide events to PropertyChange events, and is registered
- * as a component listener on this component.
- *
- * @serial the component handler
- */
- protected ComponentListener accessibleAWTComponentHandler
- = new AccessibleAWTComponentHandler();
-
- /**
- * Converts focus events to PropertyChange events, and is registered
- * as a focus listener on this component.
- *
- * @serial the focus handler
- */
- protected FocusListener accessibleAWTFocusHandler
- = new AccessibleAWTFocusHandler();
-
- /**
- * The default constructor.
- */
- protected AccessibleAWTComponent()
- {
- Component.this.addComponentListener(accessibleAWTComponentHandler);
- Component.this.addFocusListener(accessibleAWTFocusHandler);
- }
-
- /**
- * Adds a global property change listener to the accessible component.
- *
- * @param l the listener to add
- * @see #ACCESSIBLE_NAME_PROPERTY
- * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
- * @see #ACCESSIBLE_STATE_PROPERTY
- * @see #ACCESSIBLE_VALUE_PROPERTY
- * @see #ACCESSIBLE_SELECTION_PROPERTY
- * @see #ACCESSIBLE_TEXT_PROPERTY
- * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
- */
- public void addPropertyChangeListener(PropertyChangeListener l)
- {
- Component.this.addPropertyChangeListener(l);
- super.addPropertyChangeListener(l);
- }
-
- /**
- * Removes a global property change listener from this accessible
- * component.
- *
- * @param l the listener to remove
- */
- public void removePropertyChangeListener(PropertyChangeListener l)
- {
- Component.this.removePropertyChangeListener(l);
- super.removePropertyChangeListener(l);
- }
-
- /**
- * Returns the accessible name of this component. It is almost always
- * wrong to return getName(), since it is not localized. In fact, for
- * things like buttons, this should be the text of the button, not the
- * name of the object. The tooltip text might also be appropriate.
- *
- * @return the name
- * @see #setAccessibleName(String)
- */
- public String getAccessibleName()
- {
- return accessibleName == null ? getName() : accessibleName;
- }
-
- /**
- * Returns a brief description of this accessible context. This should
- * be localized.
- *
- * @return a description of this component
- * @see #setAccessibleDescription(String)
- */
- public String getAccessibleDescription()
- {
- return accessibleDescription;
- }
-
- /**
- * Returns the role of this component.
- *
- * @return the accessible role
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.AWT_COMPONENT;
- }
-
- /**
- * Returns a state set describing this component's state.
- *
- * @return a new state set
- * @see AccessibleState
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- AccessibleStateSet s = new AccessibleStateSet();
- if (Component.this.isEnabled())
- s.add(AccessibleState.ENABLED);
- if (isFocusable())
- s.add(AccessibleState.FOCUSABLE);
- if (isFocusOwner())
- s.add(AccessibleState.FOCUSED);
- if (isOpaque())
- s.add(AccessibleState.OPAQUE);
- if (Component.this.isShowing())
- s.add(AccessibleState.SHOWING);
- if (Component.this.isVisible())
- s.add(AccessibleState.VISIBLE);
- return s;
- }
-
- /**
- * Returns the parent of this component, if it is accessible.
- *
- * @return the accessible parent
- */
- public Accessible getAccessibleParent()
- {
- if (accessibleParent == null)
- {
- Container parent = getParent();
- accessibleParent = parent instanceof Accessible
- ? (Accessible) parent : null;
- }
- return accessibleParent;
- }
-
- /**
- * Returns the index of this component in its accessible parent.
- *
- * @return the index, or -1 if the parent is not accessible
- * @see #getAccessibleParent()
- */
- public int getAccessibleIndexInParent()
- {
- if (getAccessibleParent() == null)
- return -1;
- AccessibleContext context
- = ((Component) accessibleParent).getAccessibleContext();
- if (context == null)
- return -1;
- for (int i = context.getAccessibleChildrenCount(); --i >= 0; )
- if (context.getAccessibleChild(i) == Component.this)
- return i;
- return -1;
- }
-
- /**
- * Returns the number of children of this component which implement
- * Accessible. Subclasses must override this if they can have children.
- *
- * @return the number of accessible children, default 0
- */
- public int getAccessibleChildrenCount()
- {
- return 0;
- }
-
- /**
- * Returns the ith accessible child. Subclasses must override this if
- * they can have children.
- *
- * @return the ith accessible child, or null
- * @see #getAccessibleChildrenCount()
- */
- public Accessible getAccessibleChild(int i)
- {
- return null;
- }
-
- /**
- * Returns the locale of this component.
- *
- * @return the locale
- * @throws IllegalComponentStateException if the locale is unknown
- */
- public Locale getLocale()
- {
- return Component.this.getLocale();
- }
-
- /**
- * Returns this, since it is an accessible component.
- *
- * @return the accessible component
- */
- public AccessibleComponent getAccessibleComponent()
- {
- return this;
- }
-
- /**
- * Gets the background color.
- *
- * @return the background color
- * @see #setBackground(Color)
- */
- public Color getBackground()
- {
- return Component.this.getBackground();
- }
-
- /**
- * Sets the background color.
- *
- * @param c the background color
- * @see #getBackground()
- * @see #isOpaque()
- */
- public void setBackground(Color c)
- {
- Component.this.setBackground(c);
- }
-
- /**
- * Gets the foreground color.
- *
- * @return the foreground color
- * @see #setForeground(Color)
- */
- public Color getForeground()
- {
- return Component.this.getForeground();
- }
-
- /**
- * Sets the foreground color.
- *
- * @param c the foreground color
- * @see #getForeground()
- */
- public void setForeground(Color c)
- {
- Component.this.setForeground(c);
- }
-
- /**
- * Gets the cursor.
- *
- * @return the cursor
- * @see #setCursor(Cursor)
- */
- public Cursor getCursor()
- {
- return Component.this.getCursor();
- }
-
- /**
- * Sets the cursor.
- *
- * @param cursor the cursor
- * @see #getCursor()
- */
- public void setCursor(Cursor cursor)
- {
- Component.this.setCursor(cursor);
- }
-
- /**
- * Gets the font.
- *
- * @return the font
- * @see #setFont(Font)
- */
- public Font getFont()
- {
- return Component.this.getFont();
- }
-
- /**
- * Sets the font.
- *
- * @param f the font
- * @see #getFont()
- */
- public void setFont(Font f)
- {
- Component.this.setFont(f);
- }
-
- /**
- * Gets the font metrics for a font.
- *
- * @param f the font to look up
- * @return its metrics
- * @throws NullPointerException if f is null
- * @see #getFont()
- */
- public FontMetrics getFontMetrics(Font f)
- {
- return Component.this.getFontMetrics(f);
- }
-
- /**
- * Tests if the component is enabled.
- *
- * @return true if the component is enabled
- * @see #setEnabled(boolean)
- * @see #getAccessibleStateSet()
- * @see AccessibleState#ENABLED
- */
- public boolean isEnabled()
- {
- return Component.this.isEnabled();
- }
-
- /**
- * Set whether the component is enabled.
- *
- * @param b the new enabled status
- * @see #isEnabled()
- */
- public void setEnabled(boolean b)
- {
- Component.this.setEnabled(b);
- }
-
- /**
- * Test whether the component is visible (not necesarily showing).
- *
- * @return true if it is visible
- * @see #setVisible(boolean)
- * @see #getAccessibleStateSet()
- * @see AccessibleState#VISIBLE
- */
- public boolean isVisible()
- {
- return Component.this.isVisible();
- }
-
- /**
- * Sets the visibility of this component.
- *
- * @param b the desired visibility
- * @see #isVisible()
- */
- public void setVisible(boolean b)
- {
- Component.this.setVisible(b);
- }
-
- /**
- * Tests if the component is showing.
- *
- * @return true if this is showing
- */
- public boolean isShowing()
- {
- return Component.this.isShowing();
- }
-
- /**
- * Tests if the point is contained in this component.
- *
- * @param p the point to check
- * @return true if it is contained
- * @throws NullPointerException if p is null
- */
- public boolean contains(Point p)
- {
- return Component.this.contains(p.x, p.y);
- }
-
- /**
- * Returns the location of this object on the screen, or null if it is
- * not showing.
- *
- * @return the location relative to screen coordinates, if showing
- * @see #getBounds()
- * @see #getLocation()
- */
- public Point getLocationOnScreen()
- {
- return Component.this.isShowing() ? Component.this.getLocationOnScreen()
- : null;
- }
-
- /**
- * Returns the location of this object relative to its parent's coordinate
- * system, or null if it is not showing.
- *
- * @return the location
- * @see #getBounds()
- * @see #getLocationOnScreen()
- */
- public Point getLocation()
- {
- return Component.this.isShowing() ? Component.this.getLocation() : null;
- }
-
- /**
- * Sets the location of this relative to its parent's coordinate system.
- *
- * @param p the location
- * @throws NullPointerException if p is null
- * @see #getLocation()
- */
- public void setLocation(Point p)
- {
- Component.this.setLocation(p.x, p.y);
- }
-
- /**
- * Gets the bounds of this component, or null if it is not on screen.
- *
- * @return the bounds
- * @see #contains(Point)
- * @see #setBounds(Rectangle)
- */
- public Rectangle getBounds()
- {
- return Component.this.isShowing() ? Component.this.getBounds() : null;
- }
-
- /**
- * Sets the bounds of this component.
- *
- * @param r the bounds
- * @throws NullPointerException if r is null
- * @see #getBounds()
- */
- public void setBounds(Rectangle r)
- {
- Component.this.setBounds(r.x, r.y, r.width, r.height);
- }
-
- /**
- * Gets the size of this component, or null if it is not showing.
- *
- * @return the size
- * @see #setSize(Dimension)
- */
- public Dimension getSize()
- {
- return Component.this.isShowing() ? Component.this.getSize() : null;
- }
-
- /**
- * Sets the size of this component.
- *
- * @param d the size
- * @throws NullPointerException if d is null
- * @see #getSize()
- */
- public void setSize(Dimension d)
- {
- Component.this.setSize(d.width, d.height);
- }
-
- /**
- * Returns the Accessible child at a point relative to the coordinate
- * system of this component, if one exists, or null. Since components
- * have no children, subclasses must override this to get anything besides
- * null.
- *
- * @param p the point to check
- * @return the accessible child at that point
- * @throws NullPointerException if p is null
- */
- public Accessible getAccessibleAt(Point p)
- {
- return null;
- }
-
- /**
- * Tests whether this component can accept focus.
- *
- * @return true if this is focus traversable
- * @see #getAccessibleStateSet ()
- * @see AccessibleState#FOCUSABLE
- * @see AccessibleState#FOCUSED
- */
- public boolean isFocusTraversable ()
- {
- return Component.this.isFocusTraversable ();
- }
-
- /**
- * Requests focus for this component.
- *
- * @see #isFocusTraversable ()
- */
- public void requestFocus ()
- {
- Component.this.requestFocus ();
- }
-
- /**
- * Adds a focus listener.
- *
- * @param l the listener to add
- */
- public void addFocusListener(FocusListener l)
- {
- Component.this.addFocusListener(l);
- }
-
- /**
- * Removes a focus listener.
- *
- * @param l the listener to remove
- */
- public void removeFocusListener(FocusListener l)
- {
- Component.this.removeFocusListener(l);
- }
-
- /**
- * Converts component changes into property changes.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- * @status updated to 1.4
- */
- protected class AccessibleAWTComponentHandler implements ComponentListener
- {
- /**
- * Default constructor.
- */
- protected AccessibleAWTComponentHandler()
- {
- }
-
- /**
- * Convert a component hidden to a property change.
- *
- * @param e the event to convert
- */
- public void componentHidden(ComponentEvent e)
- {
- AccessibleAWTComponent.this.firePropertyChange
- (ACCESSIBLE_STATE_PROPERTY, AccessibleState.VISIBLE, null);
- }
-
- /**
- * Convert a component shown to a property change.
- *
- * @param e the event to convert
- */
- public void componentShown(ComponentEvent e)
- {
- AccessibleAWTComponent.this.firePropertyChange
- (ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.VISIBLE);
- }
-
- /**
- * Moving a component does not affect properties.
- *
- * @param e ignored
- */
- public void componentMoved(ComponentEvent e)
- {
- }
-
- /**
- * Resizing a component does not affect properties.
- *
- * @param e ignored
- */
- public void componentResized(ComponentEvent e)
- {
- }
- } // class AccessibleAWTComponentHandler
-
- /**
- * Converts focus changes into property changes.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- * @status updated to 1.4
- */
- protected class AccessibleAWTFocusHandler implements FocusListener
- {
- /**
- * Default constructor.
- */
- protected AccessibleAWTFocusHandler()
- {
- }
-
- /**
- * Convert a focus gained to a property change.
- *
- * @param e the event to convert
- */
- public void focusGained(FocusEvent e)
- {
- AccessibleAWTComponent.this.firePropertyChange
- (ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.FOCUSED);
- }
-
- /**
- * Convert a focus lost to a property change.
- *
- * @param e the event to convert
- */
- public void focusLost(FocusEvent e)
- {
- AccessibleAWTComponent.this.firePropertyChange
- (ACCESSIBLE_STATE_PROPERTY, AccessibleState.FOCUSED, null);
- }
- } // class AccessibleAWTComponentHandler
- } // class AccessibleAWTComponent
-
- /**
- * This class provides support for blitting offscreen surfaces to a
- * component.
- *
- * @see BufferStrategy
- *
- * @since 1.4
- */
- protected class BltBufferStrategy extends BufferStrategy
- {
- /**
- * The capabilities of the image buffer.
- */
- protected BufferCapabilities caps;
-
- /**
- * The back buffers used in this strategy.
- */
- protected VolatileImage[] backBuffers;
-
- /**
- * Whether or not the image buffer resources are allocated and
- * ready to be drawn into.
- */
- protected boolean validatedContents;
-
- /**
- * The width of the back buffers.
- */
- protected int width;
-
- /**
- * The height of the back buffers.
- */
- protected int height;
-
- /**
- * The front buffer.
- */
- private VolatileImage frontBuffer;
-
- /**
- * Creates a blitting buffer strategy.
- *
- * @param numBuffers the number of buffers, including the front
- * buffer
- * @param caps the capabilities of this strategy
- */
- protected BltBufferStrategy(int numBuffers, BufferCapabilities caps)
- {
- this.caps = caps;
- createBackBuffers(numBuffers - 1);
- width = getWidth();
- height = getHeight();
- }
-
- /**
- * Initializes the backBuffers field with an array of numBuffers
- * VolatileImages.
- *
- * @param numBuffers the number of backbuffers to create
- */
- protected void createBackBuffers(int numBuffers)
- {
- GraphicsConfiguration c =
- GraphicsEnvironment.getLocalGraphicsEnvironment()
- .getDefaultScreenDevice().getDefaultConfiguration();
-
- backBuffers = new VolatileImage[numBuffers];
-
- for (int i = 0; i < numBuffers; i++)
- backBuffers[i] = c.createCompatibleVolatileImage(width, height);
- }
-
- /**
- * Retrieves the capabilities of this buffer strategy.
- *
- * @return the capabilities of this buffer strategy
- */
- public BufferCapabilities getCapabilities()
- {
- return caps;
- }
-
- /**
- * Retrieves a graphics object that can be used to draw into this
- * strategy's image buffer.
- *
- * @return a graphics object
- */
- public Graphics getDrawGraphics()
- {
- // Return the backmost buffer's graphics.
- return backBuffers[0].getGraphics();
- }
-
- /**
- * Bring the contents of the back buffer to the front buffer.
- */
- public void show()
- {
- GraphicsConfiguration c =
- GraphicsEnvironment.getLocalGraphicsEnvironment()
- .getDefaultScreenDevice().getDefaultConfiguration();
-
- // draw the front buffer.
- getGraphics().drawImage(backBuffers[backBuffers.length - 1],
- width, height, null);
-
- BufferCapabilities.FlipContents f = getCapabilities().getFlipContents();
-
- // blit the back buffers.
- for (int i = backBuffers.length - 1; i > 0 ; i--)
- backBuffers[i] = backBuffers[i - 1];
-
- // create new backmost buffer.
- if (f == BufferCapabilities.FlipContents.UNDEFINED)
- backBuffers[0] = c.createCompatibleVolatileImage(width, height);
-
- // create new backmost buffer and clear it to the background
- // color.
- if (f == BufferCapabilities.FlipContents.BACKGROUND)
- {
- backBuffers[0] = c.createCompatibleVolatileImage(width, height);
- backBuffers[0].getGraphics().clearRect(0, 0, width, height);
- }
-
- // FIXME: set the backmost buffer to the prior contents of the
- // front buffer. How do we retrieve the contents of the front
- // buffer?
- //
- // if (f == BufferCapabilities.FlipContents.PRIOR)
-
- // set the backmost buffer to a copy of the new front buffer.
- if (f == BufferCapabilities.FlipContents.COPIED)
- backBuffers[0] = backBuffers[backBuffers.length - 1];
- }
-
- /**
- * Re-create the image buffer resources if they've been lost.
- */
- protected void revalidate()
- {
- GraphicsConfiguration c =
- GraphicsEnvironment.getLocalGraphicsEnvironment()
- .getDefaultScreenDevice().getDefaultConfiguration();
-
- for (int i = 0; i < backBuffers.length; i++)
- {
- int result = backBuffers[i].validate(c);
- if (result == VolatileImage.IMAGE_INCOMPATIBLE)
- backBuffers[i] = c.createCompatibleVolatileImage(width, height);
- }
- validatedContents = true;
- }
-
- /**
- * Returns whether or not the image buffer resources have been
- * lost.
- *
- * @return true if the resources have been lost, false otherwise
- */
- public boolean contentsLost()
- {
- for (int i = 0; i < backBuffers.length; i++)
- {
- if (backBuffers[i].contentsLost())
- {
- validatedContents = false;
- return true;
- }
- }
- // we know that the buffer resources are valid now because we
- // just checked them
- validatedContents = true;
- return false;
- }
-
- /**
- * Returns whether or not the image buffer resources have been
- * restored.
- *
- * @return true if the resources have been restored, false
- * otherwise
- */
- public boolean contentsRestored()
- {
- GraphicsConfiguration c =
- GraphicsEnvironment.getLocalGraphicsEnvironment()
- .getDefaultScreenDevice().getDefaultConfiguration();
-
- boolean imageRestored = false;
-
- for (int i = 0; i < backBuffers.length; i++)
- {
- int result = backBuffers[i].validate(c);
- if (result == VolatileImage.IMAGE_RESTORED)
- imageRestored = true;
- else if (result == VolatileImage.IMAGE_INCOMPATIBLE)
- return false;
- }
- // we know that the buffer resources are valid now because we
- // just checked them
- validatedContents = true;
- return imageRestored;
- }
- }
-
- /**
- * This class provides support for flipping component buffers. It
- * can only be used on Canvases and Windows.
- *
- * @since 1.4
- */
- protected class FlipBufferStrategy extends BufferStrategy
- {
- /**
- * The number of buffers.
- */
- protected int numBuffers;
-
- /**
- * The capabilities of this buffering strategy.
- */
- protected BufferCapabilities caps;
-
- /**
- * An Image reference to the drawing buffer.
- */
- protected Image drawBuffer;
-
- /**
- * A VolatileImage reference to the drawing buffer.
- */
- protected VolatileImage drawVBuffer;
-
- /**
- * Whether or not the image buffer resources are allocated and
- * ready to be drawn into.
- */
- protected boolean validatedContents;
-
- /**
- * The width of the back buffer.
- */
- private int width;
-
- /**
- * The height of the back buffer.
- */
- private int height;
-
- /**
- * Creates a flipping buffer strategy. The only supported
- * strategy for FlipBufferStrategy itself is a double-buffer page
- * flipping strategy. It forms the basis for more complex derived
- * strategies.
- *
- * @param numBuffers the number of buffers
- * @param caps the capabilities of this buffering strategy
- *
- * @throws AWTException if the requested
- * number-of-buffers/capabilities combination is not supported
- */
- protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
- throws AWTException
- {
- this.caps = caps;
- width = getWidth();
- height = getHeight();
-
- if (numBuffers > 1)
- createBuffers(numBuffers, caps);
- else
- {
- drawVBuffer = peer.createVolatileImage(width, height);
- drawBuffer = drawVBuffer;
- }
- }
-
- /**
- * Creates a multi-buffer flipping strategy. The number of
- * buffers must be greater than one and the buffer capabilities
- * must specify page flipping.
- *
- * @param numBuffers the number of flipping buffers; must be
- * greater than one
- * @param caps the buffering capabilities; caps.isPageFlipping()
- * must return true
- *
- * @throws IllegalArgumentException if numBuffers is not greater
- * than one or if the page flipping capability is not requested
- *
- * @throws AWTException if the requested flipping strategy is not
- * supported
- */
- protected void createBuffers(int numBuffers, BufferCapabilities caps)
- throws AWTException
- {
- if (numBuffers <= 1)
- throw new IllegalArgumentException("FlipBufferStrategy.createBuffers:"
- + " numBuffers must be greater than"
- + " one.");
-
- if (!caps.isPageFlipping())
- throw new IllegalArgumentException("FlipBufferStrategy.createBuffers:"
- + " flipping must be a specified"
- + " capability.");
-
- peer.createBuffers(numBuffers, caps);
- }
-
- /**
- * Return a direct reference to the back buffer image.
- *
- * @return a direct reference to the back buffer image.
- */
- protected Image getBackBuffer()
- {
- return peer.getBackBuffer();
- }
-
- /**
- * Perform a flip operation to transfer the contents of the back
- * buffer to the front buffer.
- */
- protected void flip(BufferCapabilities.FlipContents flipAction)
- {
- peer.flip(flipAction);
- }
-
- /**
- * Release the back buffer's resources.
- */
- protected void destroyBuffers()
- {
- peer.destroyBuffers();
- }
-
- /**
- * Retrieves the capabilities of this buffer strategy.
- *
- * @return the capabilities of this buffer strategy
- */
- public BufferCapabilities getCapabilities()
- {
- return caps;
- }
-
- /**
- * Retrieves a graphics object that can be used to draw into this
- * strategy's image buffer.
- *
- * @return a graphics object
- */
- public Graphics getDrawGraphics()
- {
- return drawVBuffer.getGraphics();
- }
-
- /**
- * Re-create the image buffer resources if they've been lost.
- */
- protected void revalidate()
- {
- GraphicsConfiguration c =
- GraphicsEnvironment.getLocalGraphicsEnvironment()
- .getDefaultScreenDevice().getDefaultConfiguration();
-
- if (drawVBuffer.validate(c) == VolatileImage.IMAGE_INCOMPATIBLE)
- drawVBuffer = peer.createVolatileImage(width, height);
- validatedContents = true;
- }
-
- /**
- * Returns whether or not the image buffer resources have been
- * lost.
- *
- * @return true if the resources have been lost, false otherwise
- */
- public boolean contentsLost()
- {
- if (drawVBuffer.contentsLost())
- {
- validatedContents = false;
- return true;
- }
- // we know that the buffer resources are valid now because we
- // just checked them
- validatedContents = true;
- return false;
- }
-
- /**
- * Returns whether or not the image buffer resources have been
- * restored.
- *
- * @return true if the resources have been restored, false
- * otherwise
- */
- public boolean contentsRestored()
- {
- GraphicsConfiguration c =
- GraphicsEnvironment.getLocalGraphicsEnvironment()
- .getDefaultScreenDevice().getDefaultConfiguration();
-
- int result = drawVBuffer.validate(c);
-
- boolean imageRestored = false;
-
- if (result == VolatileImage.IMAGE_RESTORED)
- imageRestored = true;
- else if (result == VolatileImage.IMAGE_INCOMPATIBLE)
- return false;
-
- // we know that the buffer resources are valid now because we
- // just checked them
- validatedContents = true;
- return imageRestored;
- }
-
- /**
- * Bring the contents of the back buffer to the front buffer.
- */
- public void show()
- {
- flip(caps.getFlipContents());
- }
- }
-}
diff --git a/libjava/java/awt/ComponentOrientation.java b/libjava/java/awt/ComponentOrientation.java
deleted file mode 100644
index 69b14c7553f..00000000000
--- a/libjava/java/awt/ComponentOrientation.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/* ComponentOrientation.java -- describes a component's orientation
- Copyright (C) 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.io.Serializable;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * This class is used to differentiate different orientations for text layout.
- * It controls whether text flows left-to-right or right-to-left, and whether
- * lines are horizontal or vertical, as in this table:<br>
- * <pre>
- * LT RT TL TR
- * A B C C B A A D G G D A
- * D E F F E D B E H H E B
- * G H I I H G C F I I F C
- * </pre>
- * <b>LT</b> languages are most common (left-to-right lines, top-to-bottom).
- * This includes Western European languages, and optionally includes Japanese,
- * Chinese, and Korean. <b>RT</b> languages (right-to-left lines,
- * top-to-bottom) are mainly middle eastern, such as Hebrew and Arabic.
- * <b>TR</b> languages flow top-to-bottom in a line, right-to-left, and are
- * the basis of Japanese, Chinese, and Korean. Finally, <b>TL</b> languages
- * flow top-to-bottom in a line, left-to-right, as in Mongolian.
- *
- * <p>This is a pretty poor excuse for a type-safe enum, since it is not
- * guaranteed that orientation objects are unique (thanks to serialization),
- * yet there is no equals() method. You would be wise to compare the output
- * of isHorizontal() and isLeftToRight() rather than comparing objects with
- * ==, especially since more constants may be added in the future.
- *
- * @author Bryce McKinlay (bryce@albatross.co.nz)
- * @since 1.0
- * @status updated to 1.4
- */
-public final class ComponentOrientation implements Serializable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -4113291392143563828L;
-
- /** Constant for unknown orientation. */
- private static final int UNKNOWN_ID = 1;
-
- /** Constant for horizontal line orientation. */
- private static final int HORIZONTAL_ID = 2;
-
- /** Constant for left-to-right orientation. */
- private static final int LEFT_TO_RIGHT_ID = 4;
-
- /**
- * Items run left to right, and lines flow top to bottom. Examples: English,
- * French.
- */
- public static final ComponentOrientation LEFT_TO_RIGHT
- = new ComponentOrientation(HORIZONTAL_ID | LEFT_TO_RIGHT_ID);
-
- /**
- * Items run right to left, and lines flow top to bottom. Examples: Arabic,
- * Hebrew.
- */
- public static final ComponentOrientation RIGHT_TO_LEFT
- = new ComponentOrientation(HORIZONTAL_ID);
-
- /**
- * The orientation is unknown for the locale. For backwards compatibility,
- * this behaves like LEFT_TO_RIGHT in the instance methods.
- */
- public static final ComponentOrientation UNKNOWN
- = new ComponentOrientation(UNKNOWN_ID | HORIZONTAL_ID | LEFT_TO_RIGHT_ID);
-
- /**
- * The orientation of this object; bitwise-or of unknown (1), horizontal (2),
- * and left-to-right (4).
- *
- * @serial the orientation
- */
- private final int orientation;
-
- /**
- * Construct a given orientation.
- *
- * @param orientation the orientation
- */
- private ComponentOrientation(int orientation)
- {
- this.orientation = orientation;
- }
-
- /**
- * Returns true if the lines are horizontal, in which case lines flow
- * top-to-bottom. For example, English, Hebrew. Counterexamples: Japanese,
- * Chinese, Korean, Mongolian.
- *
- * @return true if this orientation has horizontal lines
- */
- public boolean isHorizontal()
- {
- return (orientation & HORIZONTAL_ID) != 0;
- }
-
- /**
- * If isHorizontal() returns true, then this determines whether items in
- * the line flow left-to-right. If isHorizontal() returns false, items in
- * a line flow top-to-bottom, and this determines if lines flow
- * left-to-right.
- *
- * @return true if this orientation flows left-to-right
- */
- public boolean isLeftToRight()
- {
- return (orientation & LEFT_TO_RIGHT_ID) != 0;
- }
-
- /**
- * Gets an orientation appropriate for the locale.
- *
- * @param locale the locale
- * @return the orientation for that locale
- * @throws NullPointerException if locale is null
- */
- public static ComponentOrientation getOrientation(Locale locale)
- {
- // Based on iterating over all languages defined in JDK 1.4, this behavior
- // matches Sun's. However, it makes me wonder if any non-horizontal
- // orientations even exist, as it sure contradicts their documentation.
- String language = locale.getLanguage();
- if ("ar".equals(language) || "fa".equals(language) || "iw".equals(language)
- || "ur".equals(language))
- return RIGHT_TO_LEFT;
- return LEFT_TO_RIGHT;
- }
-
- /**
- * Gets an orientation from a resource bundle. This tries the following:
- *
- * <ul>
- * <li>Use the key "Orientation" to find an instance of ComponentOrientation
- * in the bundle.</li>
- * <li>Get the locale of the resource bundle, and get the orientation of
- * that locale.</li>
- * <li>Give up and get the orientation of the default locale.</li>
- * </ul>
- *
- * @param bdl the bundle to use
- * @return the orientation
- * @throws NullPointerException if bdl is null
- * @deprecated use {@link #getOrientation(Locale)} instead
- */
- public static ComponentOrientation getOrientation(ResourceBundle bdl)
- {
- ComponentOrientation r;
- try
- {
- r = (ComponentOrientation) bdl.getObject("Orientation");
- if (r != null)
- return r;
- }
- catch (MissingResourceException ignored)
- {
- }
- catch (ClassCastException ignored)
- {
- }
- try
- {
- r = getOrientation(bdl.getLocale());
- if (r != null)
- return r;
- }
- catch (Exception ignored)
- {
- }
- return getOrientation(Locale.getDefault());
- }
-} // class ComponentOrientation
diff --git a/libjava/java/awt/Composite.java b/libjava/java/awt/Composite.java
deleted file mode 100644
index ca3abe4d1ee..00000000000
--- a/libjava/java/awt/Composite.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Composite.java -- graphics formed from composite layers
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.image.ColorModel;
-
-/**
- * This interface is for graphics which are formed as composites of others.
- * It combines {@link Graphics2D} shapes according to defined rules to form
- * the new image. Implementations of this interface must be immutable, because
- * they are not cloned when a Graphics2D container is cloned.
- *
- * <p>Since this can expose pixels to untrusted code, there is a security
- * check on custom objects, <code>readDisplayPixels</code>, to prevent leaking
- * restricted information graphically.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see AlphaComposite
- * @see CompositeContext
- * @see Graphics2D#setComposite(Composite)
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Composite
-{
- /**
- * Create a context state for performing the compositing operation. Several
- * contexts may exist for this object, in a multi-threaded environment.
- *
- * @param srcColorModel the color model of the source
- * @param dstColorModel the color model of the destination
- * @param hints hints for choosing between rendering alternatives
- */
- CompositeContext createContext(ColorModel srcColorModel,
- ColorModel dstColorModel,
- RenderingHints hints);
-} // interface Composite
diff --git a/libjava/java/awt/CompositeContext.java b/libjava/java/awt/CompositeContext.java
deleted file mode 100644
index 018a27071dd..00000000000
--- a/libjava/java/awt/CompositeContext.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Composite.java -- the context for compositing graphics layers
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.image.Raster;
-import java.awt.image.WritableRaster;
-
-/**
- * This interface provides an optimized environment for compositing graphics.
- * Several such contexts may exist for a given <code>Composite</code> object.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Composite
- * @since 1.2
- * @status updated to 1.4
- */
-public interface CompositeContext
-{
- /**
- * Release resources allocated for the compositing.
- */
- void dispose();
-
- /**
- * Compose the two source images into the composite image. The destination
- * can be the same as one of the two inputs, and the destination must be
- * compatible with the ColorModel chosen in {@link Composite#createContext}.
- *
- * @param src the lower image source in compositing
- * @param dstIn the upper image source in compositing
- * @param dstOut the destination for the composite
- * @see Composite
- */
- void compose(Raster src, Raster dstIn, WritableRaster dstOut);
-} // interface CompositeContext
diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java
deleted file mode 100644
index e68adf492be..00000000000
--- a/libjava/java/awt/Container.java
+++ /dev/null
@@ -1,2023 +0,0 @@
-/* Container.java -- parent container class in AWT
- Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ContainerEvent;
-import java.awt.event.ContainerListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.peer.ContainerPeer;
-import java.awt.peer.LightweightPeer;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.EventListener;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.accessibility.Accessible;
-import javax.swing.SwingUtilities;
-
-/**
- * A generic window toolkit object that acts as a container for other objects.
- * Components are tracked in a list, and new elements are at the end of the
- * list or bottom of the stacking order.
- *
- * @author original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- *
- * @since 1.0
- *
- * @status still missing 1.4 support
- */
-public class Container extends Component
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 4613797578919906343L;
-
- /* Serialized fields from the serialization spec. */
- int ncomponents;
- Component[] component;
- LayoutManager layoutMgr;
-
- LightweightDispatcher dispatcher;
-
- Dimension maxSize;
-
- /**
- * @since 1.4
- */
- boolean focusCycleRoot;
-
- int containerSerializedDataVersion;
-
- /* Anything else is non-serializable, and should be declared "transient". */
- transient ContainerListener containerListener;
- transient PropertyChangeSupport changeSupport;
-
- /** The focus traversal policy that determines how focus is
- transferred between this Container and its children. */
- private FocusTraversalPolicy focusTraversalPolicy;
-
- /**
- * The focus traversal keys, if not inherited from the parent or default
- * keyboard manager. These sets will contain only AWTKeyStrokes that
- * represent press and release events to use as focus control.
- *
- * @see #getFocusTraversalKeys(int)
- * @see #setFocusTraversalKeys(int, Set)
- * @since 1.4
- */
- transient Set[] focusTraversalKeys;
-
- /**
- * Default constructor for subclasses.
- */
- public Container()
- {
- }
-
- /**
- * Returns the number of components in this container.
- *
- * @return The number of components in this container.
- */
- public int getComponentCount()
- {
- return countComponents ();
- }
-
- /**
- * Returns the number of components in this container.
- *
- * @return The number of components in this container.
- *
- * @deprecated use {@link #getComponentCount()} instead
- */
- public int countComponents()
- {
- return ncomponents;
- }
-
- /**
- * Returns the component at the specified index.
- *
- * @param n The index of the component to retrieve.
- *
- * @return The requested component.
- *
- * @throws ArrayIndexOutOfBoundsException If the specified index is invalid
- */
- public Component getComponent(int n)
- {
- synchronized (getTreeLock ())
- {
- if (n < 0 || n >= ncomponents)
- throw new ArrayIndexOutOfBoundsException("no such component");
-
- return component[n];
- }
- }
-
- /**
- * Returns an array of the components in this container.
- *
- * @return The components in this container.
- */
- public Component[] getComponents()
- {
- synchronized (getTreeLock ())
- {
- Component[] result = new Component[ncomponents];
-
- if (ncomponents > 0)
- System.arraycopy(component, 0, result, 0, ncomponents);
-
- return result;
- }
- }
-
- /**
- * Swaps the components at position i and j, in the container.
- */
-
- protected void swapComponents (int i, int j)
- {
- synchronized (getTreeLock ())
- {
- if (i < 0
- || i >= component.length
- || j < 0
- || j >= component.length)
- throw new ArrayIndexOutOfBoundsException ();
- Component tmp = component[i];
- component[i] = component[j];
- component[j] = tmp;
- }
- }
-
- /**
- * Returns the insets for this container, which is the space used for
- * borders, the margin, etc.
- *
- * @return The insets for this container.
- */
- public Insets getInsets()
- {
- return insets ();
- }
-
- /**
- * Returns the insets for this container, which is the space used for
- * borders, the margin, etc.
- *
- * @return The insets for this container.
- * @deprecated use {@link #getInsets()} instead
- */
- public Insets insets()
- {
- if (peer == null)
- return new Insets (0, 0, 0, 0);
-
- return ((ContainerPeer) peer).getInsets ();
- }
-
- /**
- * Adds the specified component to this container at the end of the
- * component list.
- *
- * @param comp The component to add to the container.
- *
- * @return The same component that was added.
- */
- public Component add(Component comp)
- {
- addImpl(comp, null, -1);
- return comp;
- }
-
- /**
- * Adds the specified component to the container at the end of the
- * component list. This method should not be used. Instead, use
- * <code>add(Component, Object)</code>.
- *
- * @param name The name of the component to be added.
- * @param comp The component to be added.
- *
- * @return The same component that was added.
- *
- * @see #add(Component,Object)
- */
- public Component add(String name, Component comp)
- {
- addImpl(comp, name, -1);
- return comp;
- }
-
- /**
- * Adds the specified component to this container at the specified index
- * in the component list.
- *
- * @param comp The component to be added.
- * @param index The index in the component list to insert this child
- * at, or -1 to add at the end of the list.
- *
- * @return The same component that was added.
- *
- * @throws ArrayIndexOutOfBounds If the specified index is invalid.
- */
- public Component add(Component comp, int index)
- {
- addImpl(comp, null, index);
- return comp;
- }
-
- /**
- * Adds the specified component to this container at the end of the
- * component list. The layout manager will use the specified constraints
- * when laying out this component.
- *
- * @param comp The component to be added to this container.
- * @param constraints The layout constraints for this component.
- */
- public void add(Component comp, Object constraints)
- {
- addImpl(comp, constraints, -1);
- }
-
- /**
- * Adds the specified component to this container at the specified index
- * in the component list. The layout manager will use the specified
- * constraints when layout out this component.
- *
- * @param comp The component to be added.
- * @param constraints The layout constraints for this component.
- * @param index The index in the component list to insert this child
- * at, or -1 to add at the end of the list.
- *
- * @throws ArrayIndexOutOfBounds If the specified index is invalid.
- */
- public void add(Component comp, Object constraints, int index)
- {
- addImpl(comp, constraints, index);
- }
-
- /**
- * This method is called by all the <code>add()</code> methods to perform
- * the actual adding of the component. Subclasses who wish to perform
- * their own processing when a component is added should override this
- * method. Any subclass doing this must call the superclass version of
- * this method in order to ensure proper functioning of the container.
- *
- * @param comp The component to be added.
- * @param constraints The layout constraints for this component, or
- * <code>null</code> if there are no constraints.
- * @param index The index in the component list to insert this child
- * at, or -1 to add at the end of the list.
- *
- * @throws ArrayIndexOutOfBounds If the specified index is invalid.
- */
- protected void addImpl(Component comp, Object constraints, int index)
- {
- synchronized (getTreeLock ())
- {
- if (index > ncomponents
- || (index < 0 && index != -1)
- || comp instanceof Window
- || (comp instanceof Container
- && ((Container) comp).isAncestorOf(this)))
- throw new IllegalArgumentException();
-
- // Reparent component, and make sure component is instantiated if
- // we are.
- if (comp.parent != null)
- comp.parent.remove(comp);
- comp.parent = this;
- if (peer != null)
- {
- if (comp.isLightweight ())
- {
- enableEvents (comp.eventMask);
- if (!isLightweight ())
- enableEvents (AWTEvent.PAINT_EVENT_MASK);
- }
- }
-
- invalidate();
-
- if (component == null)
- component = new Component[4]; // FIXME, better initial size?
-
- // This isn't the most efficient implementation. We could do less
- // copying when growing the array. It probably doesn't matter.
- if (ncomponents >= component.length)
- {
- int nl = component.length * 2;
- Component[] c = new Component[nl];
- System.arraycopy(component, 0, c, 0, ncomponents);
- component = c;
- }
-
- if (index == -1)
- component[ncomponents++] = comp;
- else
- {
- System.arraycopy(component, index, component, index + 1,
- ncomponents - index);
- component[index] = comp;
- ++ncomponents;
- }
-
- // Notify the layout manager.
- if (layoutMgr != null)
- {
- if (layoutMgr instanceof LayoutManager2)
- {
- LayoutManager2 lm2 = (LayoutManager2) layoutMgr;
- lm2.addLayoutComponent(comp, constraints);
- }
- else if (constraints instanceof String)
- layoutMgr.addLayoutComponent((String) constraints, comp);
- else
- layoutMgr.addLayoutComponent(null, comp);
- }
-
- if (isShowing ())
- {
- // Post event to notify of adding the component.
- ContainerEvent ce = new ContainerEvent(this,
- ContainerEvent.COMPONENT_ADDED,
- comp);
- getToolkit().getSystemEventQueue().postEvent(ce);
- }
- }
- }
-
- /**
- * Removes the component at the specified index from this container.
- *
- * @param index The index of the component to remove.
- */
- public void remove(int index)
- {
- synchronized (getTreeLock ())
- {
- Component r = component[index];
-
- r.removeNotify();
-
- System.arraycopy(component, index + 1, component, index,
- ncomponents - index - 1);
- component[--ncomponents] = null;
-
- invalidate();
-
- if (layoutMgr != null)
- layoutMgr.removeLayoutComponent(r);
-
- r.parent = null;
-
- if (isShowing ())
- {
- // Post event to notify of removing the component.
- ContainerEvent ce = new ContainerEvent(this,
- ContainerEvent.COMPONENT_REMOVED,
- r);
- getToolkit().getSystemEventQueue().postEvent(ce);
- }
- }
- }
-
- /**
- * Removes the specified component from this container.
- *
- * @return component The component to remove from this container.
- */
- public void remove(Component comp)
- {
- synchronized (getTreeLock ())
- {
- for (int i = 0; i < ncomponents; ++i)
- {
- if (component[i] == comp)
- {
- remove(i);
- break;
- }
- }
- }
- }
-
- /**
- * Removes all components from this container.
- */
- public void removeAll()
- {
- synchronized (getTreeLock ())
- {
- while (ncomponents > 0)
- remove(0);
- }
- }
-
- /**
- * Returns the current layout manager for this container.
- *
- * @return The layout manager for this container.
- */
- public LayoutManager getLayout()
- {
- return layoutMgr;
- }
-
- /**
- * Sets the layout manager for this container to the specified layout
- * manager.
- *
- * @param mgr The new layout manager for this container.
- */
- public void setLayout(LayoutManager mgr)
- {
- layoutMgr = mgr;
- invalidate();
- }
-
- /**
- * Layout the components in this container.
- */
- public void doLayout()
- {
- layout ();
- }
-
- /**
- * Layout the components in this container.
- *
- * @deprecated use {@link #doLayout()} instead
- */
- public void layout()
- {
- if (layoutMgr != null)
- layoutMgr.layoutContainer (this);
- }
-
- /**
- * Invalidates this container to indicate that it (and all parent
- * containers) need to be laid out.
- */
- public void invalidate()
- {
- super.invalidate();
- }
-
- /**
- * Re-lays out the components in this container.
- */
- public void validate()
- {
- synchronized (getTreeLock ())
- {
- if (! isValid() && peer != null)
- {
- validateTree();
- }
- }
- }
-
- /**
- * Recursively invalidates the container tree.
- */
- void invalidateTree()
- {
- for (int i = 0; i < ncomponents; i++)
- {
- Component comp = component[i];
- comp.invalidate();
- if (comp instanceof Container)
- ((Container) comp).invalidateTree();
- }
- }
-
- /**
- * Recursively validates the container tree, recomputing any invalid
- * layouts.
- */
- protected void validateTree()
- {
- if (valid)
- return;
-
- ContainerPeer cPeer = null;
- if (peer != null && ! (peer instanceof LightweightPeer))
- {
- cPeer = (ContainerPeer) peer;
- cPeer.beginValidate();
- }
-
- for (int i = 0; i < ncomponents; ++i)
- {
- Component comp = component[i];
-
- if (comp.getPeer () == null)
- comp.addNotify();
- }
-
- doLayout ();
- for (int i = 0; i < ncomponents; ++i)
- {
- Component comp = component[i];
-
- if (! comp.isValid())
- {
- if (comp instanceof Container)
- {
- ((Container) comp).validateTree();
- }
- else
- {
- component[i].validate();
- }
- }
- }
-
- /* children will call invalidate() when they are layed out. It
- is therefore important that valid is not set to true
- until after the children have been layed out. */
- valid = true;
-
- if (cPeer != null)
- cPeer.endValidate();
- }
-
- public void setFont(Font f)
- {
- super.setFont(f);
- // FIXME: Although it might make more sense to invalidate only
- // those children whose font == null, Sun invalidates all children.
- // So we'll do the same.
- invalidateTree();
- }
-
- /**
- * Returns the preferred size of this container.
- *
- * @return The preferred size of this container.
- */
- public Dimension getPreferredSize()
- {
- return preferredSize ();
- }
-
- /**
- * Returns the preferred size of this container.
- *
- * @return The preferred size of this container.
- *
- * @deprecated use {@link #getPreferredSize()} instead
- */
- public Dimension preferredSize()
- {
- if (layoutMgr != null)
- return layoutMgr.preferredLayoutSize (this);
- else
- return super.preferredSize ();
- }
-
- /**
- * Returns the minimum size of this container.
- *
- * @return The minimum size of this container.
- */
- public Dimension getMinimumSize()
- {
- return minimumSize ();
- }
-
- /**
- * Returns the minimum size of this container.
- *
- * @return The minimum size of this container.
- *
- * @deprecated use {@link #getMinimumSize()} instead
- */
- public Dimension minimumSize()
- {
- if (layoutMgr != null)
- return layoutMgr.minimumLayoutSize (this);
- else
- return super.minimumSize ();
- }
-
- /**
- * Returns the maximum size of this container.
- *
- * @return The maximum size of this container.
- */
- public Dimension getMaximumSize()
- {
- if (layoutMgr != null && layoutMgr instanceof LayoutManager2)
- {
- LayoutManager2 lm2 = (LayoutManager2) layoutMgr;
- return lm2.maximumLayoutSize(this);
- }
- else
- return super.getMaximumSize();
- }
-
- /**
- * Returns the preferred alignment along the X axis. This is a value
- * between 0 and 1 where 0 represents alignment flush left and
- * 1 means alignment flush right, and 0.5 means centered.
- *
- * @return The preferred alignment along the X axis.
- */
- public float getAlignmentX()
- {
- if (layoutMgr instanceof LayoutManager2)
- {
- LayoutManager2 lm2 = (LayoutManager2) layoutMgr;
- return lm2.getLayoutAlignmentX(this);
- }
- else
- return super.getAlignmentX();
- }
-
- /**
- * Returns the preferred alignment along the Y axis. This is a value
- * between 0 and 1 where 0 represents alignment flush top and
- * 1 means alignment flush bottom, and 0.5 means centered.
- *
- * @return The preferred alignment along the Y axis.
- */
- public float getAlignmentY()
- {
- if (layoutMgr instanceof LayoutManager2)
- {
- LayoutManager2 lm2 = (LayoutManager2) layoutMgr;
- return lm2.getLayoutAlignmentY(this);
- }
- else
- return super.getAlignmentY();
- }
-
- /**
- * Paints this container. The implementation of this method in this
- * class forwards to any lightweight components in this container. If
- * this method is subclassed, this method should still be invoked as
- * a superclass method so that lightweight components are properly
- * drawn.
- *
- * @param g The graphics context for this paint job.
- */
- public void paint(Graphics g)
- {
- if (!isShowing())
- return;
- // Paint self first.
- super.paint(g);
- // Visit heavyweights as well, in case they were
- // erased when we cleared the background for this container.
- visitChildren(g, GfxPaintVisitor.INSTANCE, false);
- }
-
- /**
- * Updates this container. The implementation of this method in this
- * class forwards to any lightweight components in this container. If
- * this method is subclassed, this method should still be invoked as
- * a superclass method so that lightweight components are properly
- * drawn.
- *
- * @param g The graphics context for this update.
- */
- public void update(Graphics g)
- {
- super.update(g);
- }
-
- /**
- * Prints this container. The implementation of this method in this
- * class forwards to any lightweight components in this container. If
- * this method is subclassed, this method should still be invoked as
- * a superclass method so that lightweight components are properly
- * drawn.
- *
- * @param g The graphics context for this print job.
- */
- public void print(Graphics g)
- {
- super.print(g);
- visitChildren(g, GfxPrintVisitor.INSTANCE, true);
- }
-
- /**
- * Paints all of the components in this container.
- *
- * @param g The graphics context for this paint job.
- */
- public void paintComponents(Graphics g)
- {
- super.paint(g);
- visitChildren(g, GfxPaintAllVisitor.INSTANCE, true);
- }
-
- /**
- * Prints all of the components in this container.
- *
- * @param g The graphics context for this print job.
- */
- public void printComponents(Graphics g)
- {
- super.paint(g);
- visitChildren(g, GfxPrintAllVisitor.INSTANCE, true);
- }
-
- /**
- * Adds the specified container listener to this object's list of
- * container listeners.
- *
- * @param listener The listener to add.
- */
- public synchronized void addContainerListener(ContainerListener listener)
- {
- containerListener = AWTEventMulticaster.add(containerListener, listener);
- }
-
- /**
- * Removes the specified container listener from this object's list of
- * container listeners.
- *
- * @param listener The listener to remove.
- */
- public synchronized void removeContainerListener(ContainerListener listener)
- {
- containerListener = AWTEventMulticaster.remove(containerListener, listener);
- }
-
- /**
- * @since 1.4
- */
- public synchronized ContainerListener[] getContainerListeners()
- {
- return (ContainerListener[])
- AWTEventMulticaster.getListeners(containerListener,
- ContainerListener.class);
- }
-
- /**
- * Returns an array of all the objects currently registered as FooListeners
- * upon this Container. FooListeners are registered using the addFooListener
- * method.
- *
- * @exception ClassCastException If listenerType doesn't specify a class or
- * interface that implements @see java.util.EventListener.
- *
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerType)
- {
- if (listenerType == ContainerListener.class)
- return getContainerListeners();
- return super.getListeners(listenerType);
- }
-
- /**
- * Processes the specified event. This method calls
- * <code>processContainerEvent()</code> if this method is a
- * <code>ContainerEvent</code>, otherwise it calls the superclass
- * method.
- *
- * @param e The event to be processed.
- */
- protected void processEvent(AWTEvent e)
- {
- if (e instanceof ContainerEvent)
- processContainerEvent((ContainerEvent) e);
- else
- super.processEvent(e);
- }
-
- /**
- * Called when a container event occurs if container events are enabled.
- * This method calls any registered listeners.
- *
- * @param e The event that occurred.
- */
- protected void processContainerEvent(ContainerEvent e)
- {
- if (containerListener == null)
- return;
- switch (e.id)
- {
- case ContainerEvent.COMPONENT_ADDED:
- containerListener.componentAdded(e);
- break;
-
- case ContainerEvent.COMPONENT_REMOVED:
- containerListener.componentRemoved(e);
- break;
- }
- }
-
- /**
- * AWT 1.0 event processor.
- *
- * @param e The event that occurred.
- *
- * @deprecated use {@link #dispatchEvent(AWTEvent)} instead
- */
- public void deliverEvent(Event e)
- {
- if (!handleEvent (e))
- {
- synchronized (getTreeLock ())
- {
- Component parent = getParent ();
-
- if (parent != null)
- parent.deliverEvent (e);
- }
- }
- }
-
- /**
- * Returns the component located at the specified point. This is done
- * by checking whether or not a child component claims to contain this
- * point. The first child component that does is returned. If no
- * child component claims the point, the container itself is returned,
- * unless the point does not exist within this container, in which
- * case <code>null</code> is returned.
- *
- * @param x The X coordinate of the point.
- * @param y The Y coordinate of the point.
- *
- * @return The component containing the specified point, or
- * <code>null</code> if there is no such point.
- */
- public Component getComponentAt(int x, int y)
- {
- return locate (x, y);
- }
-
- /**
- * Returns the component located at the specified point. This is done
- * by checking whether or not a child component claims to contain this
- * point. The first child component that does is returned. If no
- * child component claims the point, the container itself is returned,
- * unless the point does not exist within this container, in which
- * case <code>null</code> is returned.
- *
- * @param x The x position of the point to return the component at.
- * @param y The y position of the point to return the component at.
- *
- * @return The component containing the specified point, or <code>null</code>
- * if there is no such point.
- *
- * @deprecated use {@link #getComponentAt(int, int)} instead
- */
- public Component locate(int x, int y)
- {
- synchronized (getTreeLock ())
- {
- if (!contains (x, y))
- return null;
- for (int i = 0; i < ncomponents; ++i)
- {
- // Ignore invisible children...
- if (!component[i].isVisible ())
- continue;
-
- int x2 = x - component[i].x;
- int y2 = y - component[i].y;
- if (component[i].contains (x2, y2))
- return component[i];
- }
- return this;
- }
- }
-
- /**
- * Returns the component located at the specified point. This is done
- * by checking whether or not a child component claims to contain this
- * point. The first child component that does is returned. If no
- * child component claims the point, the container itself is returned,
- * unless the point does not exist within this container, in which
- * case <code>null</code> is returned.
- *
- * @param p The point to return the component at.
- * @return The component containing the specified point, or <code>null</code>
- * if there is no such point.
- */
- public Component getComponentAt(Point p)
- {
- return getComponentAt (p.x, p.y);
- }
-
- public Component findComponentAt(int x, int y)
- {
- synchronized (getTreeLock ())
- {
- if (! contains(x, y))
- return null;
-
- for (int i = 0; i < ncomponents; ++i)
- {
- // Ignore invisible children...
- if (!component[i].isVisible())
- continue;
-
- int x2 = x - component[i].x;
- int y2 = y - component[i].y;
- // We don't do the contains() check right away because
- // findComponentAt would redundantly do it first thing.
- if (component[i] instanceof Container)
- {
- Container k = (Container) component[i];
- Component r = k.findComponentAt(x2, y2);
- if (r != null)
- return r;
- }
- else if (component[i].contains(x2, y2))
- return component[i];
- }
-
- return this;
- }
- }
-
- public Component findComponentAt(Point p)
- {
- return findComponentAt(p.x, p.y);
- }
-
- /**
- * Called when this container is added to another container to inform it
- * to create its peer. Peers for any child components will also be
- * created.
- */
- public void addNotify()
- {
- super.addNotify();
- addNotifyContainerChildren();
- }
-
- /**
- * Called when this container is removed from its parent container to
- * inform it to destroy its peer. This causes the peers of all child
- * component to be destroyed as well.
- */
- public void removeNotify()
- {
- synchronized (getTreeLock ())
- {
- for (int i = 0; i < ncomponents; ++i)
- component[i].removeNotify();
- super.removeNotify();
- }
- }
-
- /**
- * Tests whether or not the specified component is contained within
- * this components subtree.
- *
- * @param comp The component to test.
- *
- * @return <code>true</code> if this container is an ancestor of the
- * specified component, <code>false</code> otherwise.
- */
- public boolean isAncestorOf(Component comp)
- {
- synchronized (getTreeLock ())
- {
- while (true)
- {
- if (comp == null)
- return false;
- if (comp == this)
- return true;
- comp = comp.getParent();
- }
- }
- }
-
- /**
- * Returns a string representing the state of this container for
- * debugging purposes.
- *
- * @return A string representing the state of this container.
- */
- protected String paramString()
- {
- if (layoutMgr == null)
- return super.paramString();
-
- StringBuffer sb = new StringBuffer();
- sb.append(super.paramString());
- sb.append(",layout=");
- sb.append(layoutMgr.getClass().getName());
- return sb.toString();
- }
-
- /**
- * Writes a listing of this container to the specified stream starting
- * at the specified indentation point.
- *
- * @param out The <code>PrintStream</code> to write to.
- * @param indent The indentation point.
- */
- public void list(PrintStream out, int indent)
- {
- synchronized (getTreeLock ())
- {
- super.list(out, indent);
- for (int i = 0; i < ncomponents; ++i)
- component[i].list(out, indent + 2);
- }
- }
-
- /**
- * Writes a listing of this container to the specified stream starting
- * at the specified indentation point.
- *
- * @param out The <code>PrintWriter</code> to write to.
- * @param indent The indentation point.
- */
- public void list(PrintWriter out, int indent)
- {
- synchronized (getTreeLock ())
- {
- super.list(out, indent);
- for (int i = 0; i < ncomponents; ++i)
- component[i].list(out, indent + 2);
- }
- }
-
- /**
- * Sets the focus traversal keys for a given traversal operation for this
- * Container.
- *
- * @exception IllegalArgumentException If id is not one of
- * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
- * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
- * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS,
- * or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS,
- * or if keystrokes contains null, or if any Object in keystrokes is not an
- * AWTKeyStroke, or if any keystroke represents a KEY_TYPED event, or if any
- * keystroke already maps to another focus traversal operation for this
- * Container.
- *
- * @since 1.4
- */
- public void setFocusTraversalKeys(int id, Set keystrokes)
- {
- if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS)
- throw new IllegalArgumentException ();
-
- if (keystrokes == null)
- {
- Container parent = getParent ();
-
- while (parent != null)
- {
- if (parent.areFocusTraversalKeysSet (id))
- {
- keystrokes = parent.getFocusTraversalKeys (id);
- break;
- }
- parent = parent.getParent ();
- }
-
- if (keystrokes == null)
- keystrokes = KeyboardFocusManager.getCurrentKeyboardFocusManager ().
- getDefaultFocusTraversalKeys (id);
- }
-
- Set sa;
- Set sb;
- Set sc;
- String name;
- switch (id)
- {
- case KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS:
- sa = getFocusTraversalKeys
- (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
- sb = getFocusTraversalKeys
- (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS);
- sc = getFocusTraversalKeys
- (KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS);
- name = "forwardFocusTraversalKeys";
- break;
- case KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS:
- sa = getFocusTraversalKeys
- (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
- sb = getFocusTraversalKeys
- (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS);
- sc = getFocusTraversalKeys
- (KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS);
- name = "backwardFocusTraversalKeys";
- break;
- case KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS:
- sa = getFocusTraversalKeys
- (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
- sb = getFocusTraversalKeys
- (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
- sc = getFocusTraversalKeys
- (KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS);
- name = "upCycleFocusTraversalKeys";
- break;
- case KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS:
- sa = getFocusTraversalKeys
- (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
- sb = getFocusTraversalKeys
- (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
- sc = getFocusTraversalKeys
- (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS);
- name = "downCycleFocusTraversalKeys";
- break;
- default:
- throw new IllegalArgumentException ();
- }
-
- int i = keystrokes.size ();
- Iterator iter = keystrokes.iterator ();
-
- while (--i >= 0)
- {
- Object o = iter.next ();
- if (!(o instanceof AWTKeyStroke)
- || sa.contains (o) || sb.contains (o) || sc.contains (o)
- || ((AWTKeyStroke) o).keyCode == KeyEvent.VK_UNDEFINED)
- throw new IllegalArgumentException ();
- }
-
- if (focusTraversalKeys == null)
- focusTraversalKeys = new Set[3];
-
- keystrokes = Collections.unmodifiableSet (new HashSet (keystrokes));
- firePropertyChange (name, focusTraversalKeys[id], keystrokes);
-
- focusTraversalKeys[id] = keystrokes;
- }
-
- /**
- * Returns the Set of focus traversal keys for a given traversal operation for
- * this Container.
- *
- * @exception IllegalArgumentException If id is not one of
- * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
- * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
- * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS,
- * or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS.
- *
- * @since 1.4
- */
- public Set getFocusTraversalKeys (int id)
- {
- if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS)
- throw new IllegalArgumentException ();
-
- Set s = null;
-
- if (focusTraversalKeys != null)
- s = focusTraversalKeys[id];
-
- if (s == null && parent != null)
- s = parent.getFocusTraversalKeys (id);
-
- return s == null ? (KeyboardFocusManager.getCurrentKeyboardFocusManager()
- .getDefaultFocusTraversalKeys(id)) : s;
- }
-
- /**
- * Returns whether the Set of focus traversal keys for the given focus
- * traversal operation has been explicitly defined for this Container.
- * If this method returns false, this Container is inheriting the Set from
- * an ancestor, or from the current KeyboardFocusManager.
- *
- * @exception IllegalArgumentException If id is not one of
- * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
- * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
- * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS,
- * or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS.
- *
- * @since 1.4
- */
- public boolean areFocusTraversalKeysSet (int id)
- {
- if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS)
- throw new IllegalArgumentException ();
-
- return focusTraversalKeys != null && focusTraversalKeys[id] != null;
- }
-
- /**
- * Check whether the given Container is the focus cycle root of this
- * Container's focus traversal cycle. If this Container is a focus
- * cycle root itself, then it will be in two different focus cycles
- * -- it's own, and that of its ancestor focus cycle root's. In
- * that case, if <code>c</code> is either of those containers, this
- * method will return true.
- *
- * @param c the candidate Container
- *
- * @return true if c is the focus cycle root of the focus traversal
- * cycle to which this Container belongs, false otherwise
- *
- * @since 1.4
- */
- public boolean isFocusCycleRoot (Container c)
- {
- if (this == c
- && isFocusCycleRoot ())
- return true;
-
- Container ancestor = getFocusCycleRootAncestor ();
-
- if (c == ancestor)
- return true;
-
- return false;
- }
-
- /**
- * If this Container is a focus cycle root, set the focus traversal
- * policy that determines the focus traversal order for its
- * children. If non-null, this policy will be inherited by all
- * inferior focus cycle roots. If <code>policy</code> is null, this
- * Container will inherit its policy from the closest ancestor focus
- * cycle root that's had its policy set.
- *
- * @param policy the new focus traversal policy for this Container or null
- *
- * @since 1.4
- */
- public void setFocusTraversalPolicy (FocusTraversalPolicy policy)
- {
- focusTraversalPolicy = policy;
- }
-
- /**
- * Return the focus traversal policy that determines the focus
- * traversal order for this Container's children. This method
- * returns null if this Container is not a focus cycle root. If the
- * focus traversal policy has not been set explicitly, then this
- * method will return an ancestor focus cycle root's policy instead.
- *
- * @return this Container's focus traversal policy or null
- *
- * @since 1.4
- */
- public FocusTraversalPolicy getFocusTraversalPolicy ()
- {
- if (!isFocusCycleRoot ())
- return null;
-
- if (focusTraversalPolicy == null)
- {
- Container ancestor = getFocusCycleRootAncestor ();
-
- if (ancestor != this)
- return ancestor.getFocusTraversalPolicy ();
- else
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
-
- return manager.getDefaultFocusTraversalPolicy ();
- }
- }
- else
- return focusTraversalPolicy;
- }
-
- /**
- * Check whether this Container's focus traversal policy has been
- * explicitly set. If it has not, then this Container will inherit
- * its focus traversal policy from one of its ancestor focus cycle
- * roots.
- *
- * @return true if focus traversal policy is set, false otherwise
- */
- public boolean isFocusTraversalPolicySet ()
- {
- return focusTraversalPolicy == null;
- }
-
- /**
- * Set whether or not this Container is the root of a focus
- * traversal cycle. This Container's focus traversal policy
- * determines the order of focus traversal. Some policies prevent
- * the focus from being transferred between two traversal cycles
- * until an up or down traversal operation is performed. In that
- * case, normal traversal (not up or down) is limited to this
- * Container and all of this Container's descendents that are not
- * descendents of inferior focus cycle roots. In the default case
- * however, ContainerOrderFocusTraversalPolicy is in effect, and it
- * supports implicit down-cycle traversal operations.
- *
- * @return true if this is a focus cycle root, false otherwise
- *
- * @since 1.4
- */
- public void setFocusCycleRoot (boolean focusCycleRoot)
- {
- this.focusCycleRoot = focusCycleRoot;
- }
-
- /**
- * Check whether this Container is a focus cycle root.
- *
- * @return true if this is a focus cycle root, false otherwise
- *
- * @since 1.4
- */
- public boolean isFocusCycleRoot ()
- {
- return focusCycleRoot;
- }
-
- /**
- * Transfer focus down one focus traversal cycle. If this Container
- * is a focus cycle root, then its default component becomes the
- * focus owner, and this Container becomes the current focus cycle
- * root. No traversal will occur if this Container is not a focus
- * cycle root.
- *
- * @since 1.4
- */
- public void transferFocusDownCycle ()
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
-
- manager.downFocusCycle (this);
- }
-
- /**
- * Sets the ComponentOrientation property of this container and all components
- * contained within it.
- *
- * @exception NullPointerException If orientation is null
- *
- * @since 1.4
- */
- public void applyComponentOrientation (ComponentOrientation orientation)
- {
- if (orientation == null)
- throw new NullPointerException ();
- }
-
- public void addPropertyChangeListener (PropertyChangeListener listener)
- {
- if (listener == null)
- return;
-
- if (changeSupport == null)
- changeSupport = new PropertyChangeSupport (this);
-
- changeSupport.addPropertyChangeListener (listener);
- }
-
- public void addPropertyChangeListener (String name,
- PropertyChangeListener listener)
- {
- if (listener == null)
- return;
-
- if (changeSupport == null)
- changeSupport = new PropertyChangeSupport (this);
-
- changeSupport.addPropertyChangeListener (name, listener);
- }
-
- // Hidden helper methods.
-
- /**
- * Perform a graphics operation on the children of this container.
- * For each applicable child, the visitChild() method will be called
- * to perform the graphics operation.
- *
- * @param gfx The graphics object that will be used to derive new
- * graphics objects for the children.
- *
- * @param visitor Object encapsulating the graphics operation that
- * should be performed.
- *
- * @param lightweightOnly If true, only lightweight components will
- * be visited.
- */
- private void visitChildren(Graphics gfx, GfxVisitor visitor,
- boolean lightweightOnly)
- {
- synchronized (getTreeLock ())
- {
- for (int i = ncomponents - 1; i >= 0; --i)
- {
- Component comp = component[i];
- // If we're visiting heavyweights as well,
- // don't recurse into Containers here. This avoids
- // painting the same nested child multiple times.
- boolean applicable = comp.isVisible()
- && (comp.isLightweight()
- || !lightweightOnly && ! (comp instanceof Container));
-
- if (applicable)
- visitChild(gfx, visitor, comp);
- }
- }
- }
-
- /**
- * Perform a graphics operation on a child. A translated and clipped
- * graphics object will be created, and the visit() method of the
- * visitor will be called to perform the operation.
- *
- * @param gfx The graphics object that will be used to derive new
- * graphics objects for the child.
- *
- * @param visitor Object encapsulating the graphics operation that
- * should be performed.
- *
- * @param comp The child component that should be visited.
- */
- private void visitChild(Graphics gfx, GfxVisitor visitor,
- Component comp)
- {
- Rectangle bounds = comp.getBounds();
- Rectangle oldClip = gfx.getClipBounds();
- if (oldClip == null)
- oldClip = bounds;
-
- Rectangle clip = oldClip.intersection(bounds);
-
- if (clip.isEmpty()) return;
-
- boolean clipped = false;
- boolean translated = false;
- try
- {
- gfx.setClip(clip.x, clip.y, clip.width, clip.height);
- clipped = true;
- gfx.translate(bounds.x, bounds.y);
- translated = true;
- visitor.visit(comp, gfx);
- }
- finally
- {
- if (translated)
- gfx.translate (-bounds.x, -bounds.y);
- if (clipped)
- gfx.setClip (oldClip.x, oldClip.y, oldClip.width, oldClip.height);
- }
- }
-
- void dispatchEventImpl(AWTEvent e)
- {
- // Give lightweight dispatcher a chance to handle it.
- if (eventTypeEnabled (e.id)
- && dispatcher != null
- && dispatcher.handleEvent (e))
- return;
-
- if ((e.id <= ContainerEvent.CONTAINER_LAST
- && e.id >= ContainerEvent.CONTAINER_FIRST)
- && (containerListener != null
- || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
- }
-
- // This is used to implement Component.transferFocus.
- Component findNextFocusComponent(Component child)
- {
- synchronized (getTreeLock ())
- {
- int start, end;
- if (child != null)
- {
- for (start = 0; start < ncomponents; ++start)
- {
- if (component[start] == child)
- break;
- }
- end = start;
- // This special case lets us be sure to terminate.
- if (end == 0)
- end = ncomponents;
- ++start;
- }
- else
- {
- start = 0;
- end = ncomponents;
- }
-
- for (int j = start; j != end; ++j)
- {
- if (j >= ncomponents)
- {
- // The JCL says that we should wrap here. However, that
- // seems wrong. To me it seems that focus order should be
- // global within in given window. So instead if we reach
- // the end we try to look in our parent, if we have one.
- if (parent != null)
- return parent.findNextFocusComponent(this);
- j -= ncomponents;
- }
- if (component[j] instanceof Container)
- {
- Component c = component[j];
- c = c.findNextFocusComponent(null);
- if (c != null)
- return c;
- }
- else if (component[j].isFocusTraversable())
- return component[j];
- }
-
- return null;
- }
- }
-
- private void addNotifyContainerChildren()
- {
- synchronized (getTreeLock ())
- {
- for (int i = ncomponents; --i >= 0; )
- {
- component[i].addNotify();
- if (component[i].isLightweight ())
- {
-
- // If we're not lightweight, and we just got a lightweight
- // child, we need a lightweight dispatcher to feed it events.
- if (! this.isLightweight())
- {
- if (dispatcher == null)
- dispatcher = new LightweightDispatcher (this);
- }
-
-
- enableEvents(component[i].eventMask);
- if (peer != null && !isLightweight ())
- enableEvents (AWTEvent.PAINT_EVENT_MASK);
- }
- }
- }
- }
-
- /**
- * Deserialize this Container:
- * <ol>
- * <li>Read from the stream the default serializable fields.</li>
- * <li>Read a list of serializable ContainerListeners as optional
- * data. If the list is null, no listeners will be registered.</li>
- * <li>Read this Container's FocusTraversalPolicy as optional data.
- * If this is null, then this Container will use a
- * DefaultFocusTraversalPolicy.</li>
- * </ol>
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if deserialization fails
- * @throws IOException if the stream fails
- */
- private void readObject (ObjectInputStream s)
- throws ClassNotFoundException, IOException
- {
- s.defaultReadObject ();
- String key = (String) s.readObject ();
- while (key != null)
- {
- Object object = s.readObject ();
- if ("containerL".equals (key))
- addContainerListener((ContainerListener) object);
- // FIXME: under what key is the focus traversal policy stored?
- else if ("focusTraversalPolicy".equals (key))
- setFocusTraversalPolicy ((FocusTraversalPolicy) object);
-
- key = (String) s.readObject();
- }
- }
-
- /**
- * Serialize this Container:
- * <ol>
- * <li>Write to the stream the default serializable fields.</li>
- * <li>Write the list of serializable ContainerListeners as optional
- * data.</li>
- * <li>Write this Container's FocusTraversalPolicy as optional data.</li>
- * </ol>
- *
- * @param s the stream to write to
- * @throws IOException if the stream fails
- */
- private void writeObject (ObjectOutputStream s) throws IOException
- {
- s.defaultWriteObject ();
- AWTEventMulticaster.save (s, "containerL", containerListener);
- if (focusTraversalPolicy instanceof Serializable)
- s.writeObject (focusTraversalPolicy);
- else
- s.writeObject (null);
- }
-
- // Nested classes.
-
- /* The following classes are used in concert with the
- visitChildren() method to implement all the graphics operations
- that requires traversal of the containment hierarchy. */
-
- abstract static class GfxVisitor
- {
- public abstract void visit(Component c, Graphics gfx);
- }
-
- static class GfxPaintVisitor extends GfxVisitor
- {
- public static final GfxVisitor INSTANCE = new GfxPaintVisitor();
-
- public void visit(Component c, Graphics gfx)
- {
- c.paint(gfx);
- }
- }
-
- static class GfxPrintVisitor extends GfxVisitor
- {
- public static final GfxVisitor INSTANCE = new GfxPrintVisitor();
-
- public void visit(Component c, Graphics gfx)
- {
- c.print(gfx);
- }
- }
-
- static class GfxPaintAllVisitor extends GfxVisitor
- {
- public static final GfxVisitor INSTANCE = new GfxPaintAllVisitor();
-
- public void visit(Component c, Graphics gfx)
- {
- c.paintAll(gfx);
- }
- }
-
- static class GfxPrintAllVisitor extends GfxVisitor
- {
- public static final GfxVisitor INSTANCE = new GfxPrintAllVisitor();
-
- public void visit(Component c, Graphics gfx)
- {
- c.printAll(gfx);
- }
- }
-
- /**
- * This class provides accessibility support for subclasses of container.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- *
- * @since 1.3
- */
- protected class AccessibleAWTContainer extends AccessibleAWTComponent
- {
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = 5081320404842566097L;
-
- /**
- * The handler to fire PropertyChange when children are added or removed.
- *
- * @serial the handler for property changes
- */
- protected ContainerListener accessibleContainerHandler
- = new AccessibleContainerHandler();
-
- /**
- * The default constructor.
- */
- protected AccessibleAWTContainer()
- {
- Container.this.addContainerListener(accessibleContainerHandler);
- }
-
- /**
- * Return the number of accessible children of the containing accessible
- * object (at most the total number of its children).
- *
- * @return the number of accessible children
- */
- public int getAccessibleChildrenCount()
- {
- synchronized (getTreeLock ())
- {
- int count = 0;
- int i = component == null ? 0 : component.length;
- while (--i >= 0)
- if (component[i] instanceof Accessible)
- count++;
- return count;
- }
- }
-
- /**
- * Return the nth accessible child of the containing accessible object.
- *
- * @param i the child to grab, zero-based
- * @return the accessible child, or null
- */
- public Accessible getAccessibleChild(int i)
- {
- synchronized (getTreeLock ())
- {
- if (component == null)
- return null;
- int index = -1;
- while (i >= 0 && ++index < component.length)
- if (component[index] instanceof Accessible)
- i--;
- if (i < 0)
- return (Accessible) component[index];
- return null;
- }
- }
-
- /**
- * Return the accessible child located at point (in the parent's
- * coordinates), if one exists.
- *
- * @param p the point to look at
- *
- * @return an accessible object at that point, or null
- *
- * @throws NullPointerException if p is null
- */
- public Accessible getAccessibleAt(Point p)
- {
- Component c = getComponentAt(p.x, p.y);
- return c != Container.this && c instanceof Accessible ? (Accessible) c
- : null;
- }
-
- /**
- * This class fires a <code>PropertyChange</code> listener, if registered,
- * when children are added or removed from the enclosing accessible object.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- *
- * @since 1.3
- */
- protected class AccessibleContainerHandler implements ContainerListener
- {
- /**
- * Default constructor.
- */
- protected AccessibleContainerHandler()
- {
- }
-
- /**
- * Fired when a component is added; forwards to the PropertyChange
- * listener.
- *
- * @param e the container event for adding
- */
- public void componentAdded(ContainerEvent e)
- {
- AccessibleAWTContainer.this.firePropertyChange
- (ACCESSIBLE_CHILD_PROPERTY, null, e.getChild());
- }
-
- /**
- * Fired when a component is removed; forwards to the PropertyChange
- * listener.
- *
- * @param e the container event for removing
- */
- public void componentRemoved(ContainerEvent e)
- {
- AccessibleAWTContainer.this.firePropertyChange
- (ACCESSIBLE_CHILD_PROPERTY, e.getChild(), null);
- }
- } // class AccessibleContainerHandler
- } // class AccessibleAWTContainer
-} // class Container
-
-/**
- * There is a helper class implied from stack traces called
- * LightweightDispatcher, but since it is not part of the public API,
- * rather than mimic it exactly we write something which does "roughly
- * the same thing".
- */
-
-class LightweightDispatcher implements Serializable
-{
- private static final long serialVersionUID = 5184291520170872969L;
- private Container nativeContainer;
- private Cursor nativeCursor;
- private long eventMask;
-
- private transient Component mouseEventTarget;
- private transient Component pressedComponent;
- private transient Component lastComponentEntered;
- private transient int pressCount;
-
- LightweightDispatcher(Container c)
- {
- nativeContainer = c;
- }
-
- void acquireComponentForMouseEvent(MouseEvent me)
- {
- int x = me.getX ();
- int y = me.getY ();
-
- // Find the candidate which should receive this event.
- Component parent = nativeContainer;
- Component candidate = null;
- Point p = me.getPoint();
- while (candidate == null && parent != null)
- {
- candidate =
- SwingUtilities.getDeepestComponentAt(parent, p.x, p.y);
- if (candidate == null || (candidate.eventMask & me.getID()) == 0)
- {
- candidate = null;
- p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent);
- parent = parent.parent;
- }
- }
-
- // If the only candidate we found was the native container itself,
- // don't dispatch any event at all. We only care about the lightweight
- // children here.
- if (candidate == nativeContainer)
- candidate = null;
-
- // If our candidate is new, inform the old target we're leaving.
- if (lastComponentEntered != null
- && lastComponentEntered.isShowing()
- && lastComponentEntered != candidate)
- {
- // Old candidate could have been removed from
- // the nativeContainer so we check first.
- if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer))
- {
- Point tp =
- SwingUtilities.convertPoint(nativeContainer,
- x, y, lastComponentEntered);
- MouseEvent exited = new MouseEvent (lastComponentEntered,
- MouseEvent.MOUSE_EXITED,
- me.getWhen (),
- me.getModifiersEx (),
- tp.x, tp.y,
- me.getClickCount (),
- me.isPopupTrigger (),
- me.getButton ());
- lastComponentEntered.dispatchEvent (exited);
- }
- lastComponentEntered = null;
- }
- // If we have a candidate, maybe enter it.
- if (candidate != null)
- {
- mouseEventTarget = candidate;
- if (candidate.isLightweight()
- && candidate.isShowing()
- && candidate != nativeContainer
- && candidate != lastComponentEntered)
- {
- lastComponentEntered = mouseEventTarget;
- Point cp = SwingUtilities.convertPoint(nativeContainer,
- x, y, lastComponentEntered);
- MouseEvent entered = new MouseEvent (lastComponentEntered,
- MouseEvent.MOUSE_ENTERED,
- me.getWhen (),
- me.getModifiersEx (),
- cp.x, cp.y,
- me.getClickCount (),
- me.isPopupTrigger (),
- me.getButton ());
- lastComponentEntered.dispatchEvent (entered);
- }
- }
-
- if (me.getID() == MouseEvent.MOUSE_RELEASED
- || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0
- || me.getID() == MouseEvent.MOUSE_DRAGGED)
- // If any of the following events occur while a button is held down,
- // they should be dispatched to the same component to which the
- // original MOUSE_PRESSED event was dispatched:
- // - MOUSE_RELEASED
- // - MOUSE_PRESSED: another button pressed while the first is held down
- // - MOUSE_DRAGGED
- if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer))
- mouseEventTarget = pressedComponent;
- else if (me.getID() == MouseEvent.MOUSE_CLICKED)
- {
- // Don't dispatch CLICKED events whose target is not the same as the
- // target for the original PRESSED event.
- if (candidate != pressedComponent)
- mouseEventTarget = null;
- else if (pressCount == 0)
- pressedComponent = null;
- }
- }
-
- boolean handleEvent(AWTEvent e)
- {
- if (e instanceof MouseEvent)
- {
- MouseEvent me = (MouseEvent) e;
-
- acquireComponentForMouseEvent(me);
-
- // Avoid dispatching ENTERED and EXITED events twice.
- if (mouseEventTarget != null
- && mouseEventTarget.isShowing()
- && e.getID() != MouseEvent.MOUSE_ENTERED
- && e.getID() != MouseEvent.MOUSE_EXITED)
- {
- MouseEvent newEvt =
- SwingUtilities.convertMouseEvent(nativeContainer, me,
- mouseEventTarget);
- mouseEventTarget.dispatchEvent(newEvt);
-
- switch (e.getID())
- {
- case MouseEvent.MOUSE_PRESSED:
- if (pressCount++ == 0)
- pressedComponent = mouseEventTarget;
- break;
-
- case MouseEvent.MOUSE_RELEASED:
- // Clear our memory of the original PRESSED event, only if
- // we're not expecting a CLICKED event after this. If
- // there is a CLICKED event after this, it will do clean up.
- if (--pressCount == 0
- && mouseEventTarget != pressedComponent)
- pressedComponent = null;
- break;
- }
- if (newEvt.isConsumed())
- e.consume();
- }
- }
-
- return e.isConsumed();
- }
-
-} // class LightweightDispatcher
diff --git a/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java b/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
deleted file mode 100644
index 152482c887b..00000000000
--- a/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/* ContainerOrderFocusTraversalPolicy.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.io.Serializable;
-
-/**
- * ContainerOrderFocusTraversalPolicy defines a focus traversal order
- * based on the order in which Components were packed in a Container.
- * This policy performs a pre-order traversal of the Component
- * hierarchy starting from a given focus cycle root. Portions of the
- * hierarchy that are not visible and displayable are skipped.
- *
- * By default, this policy transfers focus down-cycle implicitly.
- * That is, if a forward traversal is requested on a focus cycle root
- * and the focus cycle root has focusable children, the focus will
- * automatically be transfered down to the lower focus cycle.
- *
- * The default implementation of accept accepts only Components that
- * are visible, displayable, enabled and focusable. Derived classes
- * can override these acceptance criteria by overriding accept.
- *
- * @author Michael Koch
- * @author Thomas Fitzsimmons (fitzsim@redhat.com)
- * @since 1.4
- */
-public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
- implements Serializable
-{
- /**
- * Compatible to JDK 1.4+
- */
- static final long serialVersionUID = 486933713763926351L;
-
- /**
- * True if implicit down cycling is enabled.
- */
- private boolean implicitDownCycleTraversal = true;
-
- /**
- * Creates the <code>ContainerOrderFocusTraversalPolicy</code> object.
- */
- public ContainerOrderFocusTraversalPolicy ()
- {
- // Nothing to do here
- }
-
- /**
- * Returns the Component that should receive the focus after current.
- * root must be a focus cycle root of current.
- *
- * @param root a focus cycle root of current
- * @param current a (possibly indirect) child of root, or root itself
- *
- * @return the next Component in the focus traversal order for root,
- * or null if no acceptable Component exists.
- *
- * @exception IllegalArgumentException If root is not a focus cycle
- * root of current, or if either root or current is null.
- */
- public Component getComponentAfter (Container root, Component current)
- {
- if (root == null)
- throw new IllegalArgumentException ("focus cycle root is null");
- if (current == null)
- throw new IllegalArgumentException ("current component is null");
-
- if (!root.isFocusCycleRoot ())
- throw new IllegalArgumentException ("root is not a focus cycle root");
-
- Container ancestor = current.getFocusCycleRootAncestor ();
- Container prevAncestor = ancestor;
- while (ancestor != root)
- {
- ancestor = current.getFocusCycleRootAncestor ();
- if (ancestor == prevAncestor)
- {
- // We've reached the top focus cycle root ancestor. Check
- // if it is root.
- if (ancestor != root)
- throw new IllegalArgumentException ("the given container is not"
- + " a focus cycle root of the"
- + " current component");
- else
- break;
- }
- prevAncestor = ancestor;
- }
-
- // FIXME: is this the right thing to do here? It moves the context
- // for traversal up one focus traversal cycle. We'll need a test
- // for this.
- if ((Component) root == current)
- root = current.getFocusCycleRootAncestor ();
-
- // Check if we've reached the top of the component hierarchy. If
- // so then we want to loop around to the first component in the
- // focus traversal cycle.
- if (current instanceof Window)
- return getFirstComponent ((Container) current);
-
- Container parent = current.getParent ();
-
- synchronized (parent.getTreeLock ())
- {
- Component[] components = parent.getComponents ();
- int componentIndex = 0;
- int numComponents = parent.getComponentCount ();
-
- // Find component's index.
- for (int i = 0; i < numComponents; i++)
- {
- if (components[i] == current)
- componentIndex = i;
- }
-
- // Search forward for the next acceptable component.
- for (int i = componentIndex + 1; i < numComponents; i++)
- {
- if (accept (components[i]))
- return components[i];
-
- if (components[i] instanceof Container)
- {
- Component result = getFirstComponent ((Container) components[i]);
-
- if (result != null
- && implicitDownCycleTraversal)
- return result;
- }
- }
-
- // No focusable components after current in its Container. So go
- // to the next Component after current's Container (parent).
- Component result = getComponentAfter (root, parent);
-
- return result;
- }
- }
-
- /**
- * Returns the Component that should receive the focus before
- * <code>current</code>. <code>root</code> must be a focus cycle
- * root of current.
- *
- * @param root a focus cycle root of current
- * @param current a (possibly indirect) child of root, or root itself
- *
- * @return the previous Component in the focus traversal order for
- * root, or null if no acceptable Component exists.
- *
- * @exception IllegalArgumentException If root is not a focus cycle
- * root of current, or if either root or current is null.
- */
- public Component getComponentBefore (Container root, Component current)
- {
- if (root == null)
- throw new IllegalArgumentException ("focus cycle root is null");
- if (current == null)
- throw new IllegalArgumentException ("current component is null");
-
- if (!root.isFocusCycleRoot ())
- throw new IllegalArgumentException ("root is not a focus cycle root");
-
- Container ancestor = current.getFocusCycleRootAncestor ();
- Container prevAncestor = ancestor;
- while (ancestor != root)
- {
- ancestor = current.getFocusCycleRootAncestor ();
- if (ancestor == prevAncestor)
- {
- // We've reached the top focus cycle root ancestor. Check
- // if it is root.
- if (ancestor != root)
- throw new IllegalArgumentException ("the given container is not"
- + " a focus cycle root of the"
- + " current component");
- else
- break;
- }
- prevAncestor = ancestor;
- }
-
- // FIXME: is this the right thing to do here? It moves the context
- // for traversal up one focus traversal cycle. We'll need a test
- // for this.
- if ((Component) root == current)
- root = current.getFocusCycleRootAncestor ();
-
- // Check if we've reached the top of the component hierarchy. If
- // so then we want to loop around to the last component in the
- // focus traversal cycle.
- if (current instanceof Window)
- return getLastComponent ((Container) current);
-
- Container parent = current.getParent ();
-
- synchronized (parent.getTreeLock ())
- {
- Component[] components = parent.getComponents ();
- int componentIndex = 0;
- int numComponents = parent.getComponentCount ();
-
- // Find component's index.
- for (int i = 0; i < numComponents; i++)
- {
- if (components[i] == current)
- componentIndex = i;
- }
-
- // Search backward for the next acceptable component.
- for (int i = componentIndex - 1; i >= 0; i--)
- {
- if (accept (components[i]))
- return components[i];
-
- if (components[i] instanceof Container)
- {
- Component result = getLastComponent ((Container) components[i]);
-
- if (result != null)
- return result;
- }
- }
-
- // No focusable components before current in its Container. So go
- // to the previous Component before current's Container (parent).
- Component result = getComponentBefore (root, parent);
-
- return result;
- }
- }
-
- /**
- * Returns the first Component of root that should receive the focus.
- *
- * @param root a focus cycle root
- *
- * @return the first Component in the focus traversal order for
- * root, or null if no acceptable Component exists.
- *
- * @exception IllegalArgumentException If root is null.
- */
- public Component getFirstComponent(Container root)
- {
- if (root == null)
- throw new IllegalArgumentException ();
-
- if (!root.isVisible ()
- || !root.isDisplayable ())
- return null;
-
- if (accept (root))
- return root;
-
- Component[] componentArray = root.getComponents ();
-
- for (int i = 0; i < componentArray.length; i++)
- {
- Component component = componentArray [i];
-
- if (accept (component))
- return component;
-
- if (component instanceof Container)
- {
- Component result = getFirstComponent ((Container) component);
-
- if (result != null)
- return result;
- }
- }
-
- return null;
- }
-
- /**
- * Returns the last Component of root that should receive the focus.
- *
- * @param root a focus cycle root
- *
- * @return the last Component in the focus traversal order for
- * root, or null if no acceptable Component exists.
- *
- * @exception IllegalArgumentException If root is null.
- */
- public Component getLastComponent (Container root)
- {
- if (root == null)
- throw new IllegalArgumentException ();
-
- if (!root.isVisible ()
- || !root.isDisplayable ())
- return null;
-
- if (accept (root))
- return root;
-
- Component[] componentArray = root.getComponents ();
-
- for (int i = componentArray.length - 1; i >= 0; i--)
- {
- Component component = componentArray [i];
-
- if (accept (component))
- return component;
-
- if (component instanceof Container)
- {
- Component result = getLastComponent ((Container) component);
-
- if (result != null)
- return result;
- }
- }
-
- return null;
- }
-
- /**
- * Returns the default Component of root that should receive the focus.
- *
- * @param root a focus cycle root
- *
- * @return the default Component in the focus traversal order for
- * root, or null if no acceptable Component exists.
- *
- * @exception IllegalArgumentException If root is null.
- */
- public Component getDefaultComponent (Container root)
- {
- return getFirstComponent (root);
- }
-
- /**
- * Set whether or not implicit down cycling is enabled. If it is,
- * then initiating a forward focus traversal operation onto a focus
- * cycle root, the focus will be implicitly transferred into the
- * root container's focus cycle.
- *
- * @param value the setting for implicit down cycling
- */
- public void setImplicitDownCycleTraversal (boolean value)
- {
- implicitDownCycleTraversal = value;
- }
-
- /**
- * Check whether or not implicit down cycling is enabled. If it is,
- * then initiating a forward focus traversal operation onto a focus
- * cycle root, the focus will be implicitly transferred into the
- * root container's focus cycle.
- *
- * @return true if the focus will be transferred down-cycle
- * implicitly
- */
- public boolean getImplicitDownCycleTraversal ()
- {
- return implicitDownCycleTraversal;
- }
-
- /**
- * Check whether the given Component is an acceptable target for the
- * keyboard input focus.
- *
- * @param current the Component to check
- *
- * @return true if current is acceptable, false otherwise
- */
- protected boolean accept (Component current)
- {
- return (current.visible
- && current.isDisplayable ()
- && current.enabled
- && current.focusable);
- }
-}
diff --git a/libjava/java/awt/Cursor.java b/libjava/java/awt/Cursor.java
deleted file mode 100644
index 48a63f06f4f..00000000000
--- a/libjava/java/awt/Cursor.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/* Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This class represents various predefined cursor types.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Cursor implements java.io.Serializable
-{
- static final long serialVersionUID = 8028237497568985504L;
-
- /**
- * Constant for the system default cursor type
- */
- public static final int DEFAULT_CURSOR = 0;
-
- /**
- * Constant for a cross-hair cursor.
- */
- public static final int CROSSHAIR_CURSOR = 1;
-
- /**
- * Constant for a cursor over a text field.
- */
- public static final int TEXT_CURSOR = 2;
-
- /**
- * Constant for a cursor to display while waiting for an action to complete.
- */
- public static final int WAIT_CURSOR = 3;
-
- /**
- * Cursor used over SW corner of window decorations.
- */
- public static final int SW_RESIZE_CURSOR = 4;
-
- /**
- * Cursor used over SE corner of window decorations.
- */
- public static final int SE_RESIZE_CURSOR = 5;
-
- /**
- * Cursor used over NW corner of window decorations.
- */
- public static final int NW_RESIZE_CURSOR = 6;
-
- /**
- * Cursor used over NE corner of window decorations.
- */
- public static final int NE_RESIZE_CURSOR = 7;
-
- /**
- * Cursor used over N edge of window decorations.
- */
- public static final int N_RESIZE_CURSOR = 8;
-
- /**
- * Cursor used over S edge of window decorations.
- */
- public static final int S_RESIZE_CURSOR = 9;
-
- /**
- * Cursor used over W edge of window decorations.
- */
- public static final int W_RESIZE_CURSOR = 10;
-
- /**
- * Cursor used over E edge of window decorations.
- */
- public static final int E_RESIZE_CURSOR = 11;
-
- /**
- * Constant for a hand cursor.
- */
- public static final int HAND_CURSOR = 12;
-
- /**
- * Constant for a cursor used during window move operations.
- */
- public static final int MOVE_CURSOR = 13;
-
- public static final int CUSTOM_CURSOR = 0xFFFFFFFF;
-
- private static final int PREDEFINED_COUNT = 14;
-
- protected static Cursor[] predefined = new Cursor[PREDEFINED_COUNT];
- protected String name;
-
- /**
- * @serial The numeric id of this cursor.
- */
- int type;
-
- /**
- * Initializes a new instance of <code>Cursor</code> with the specified
- * type.
- *
- * @param type The cursor type.
- *
- * @exception IllegalArgumentException If the specified cursor type is invalid
- */
- public Cursor(int type)
- {
- if (type < 0 || type >= PREDEFINED_COUNT)
- throw new IllegalArgumentException ("invalid cursor " + type);
-
- this.type = type;
- // FIXME: lookup and set name?
- }
-
- /** This constructor is used internally only.
- * Application code should call Toolkit.createCustomCursor().
- */
- protected Cursor(String name)
- {
- this.name = name;
- this.type = CUSTOM_CURSOR;
- }
-
- /**
- * Returns an instance of <code>Cursor</code> for one of the specified
- * predetermined types.
- *
- * @param type The type contant from this class.
- *
- * @return The requested predefined cursor.
- *
- * @exception IllegalArgumentException If the constant is not one of the
- * predefined cursor type constants from this class.
- */
- public static Cursor getPredefinedCursor(int type)
- {
- if (type < 0 || type >= PREDEFINED_COUNT)
- throw new IllegalArgumentException ("invalid cursor " + type);
- if (predefined[type] == null)
- predefined[type] = new Cursor(type);
- return predefined[type];
- }
-
- /**
- * Retrieves the system specific custom Cursor named Cursor names are,
- * for example: "Invalid.16x16".
- *
- * @exception AWTException
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
- public static Cursor getSystemCustomCursor(String name)
- throws AWTException
- {
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-
- // FIXME
- return null;
- }
-
- /**
- * Returns an instance of the system default cursor type.
- *
- * @return The system default cursor.
- */
- public static Cursor getDefaultCursor()
- {
- return getPredefinedCursor(DEFAULT_CURSOR);
- }
-
- /**
- * Returns the numeric type identifier for this cursor.
- *
- * @return The cursor id.
- */
- public int getType()
- {
- return type;
- }
-
- public String getName()
- {
- return name;
- }
-
- public String toString()
- {
- return (this.getClass() + "[" + getName() + "]");
- }
-}
diff --git a/libjava/java/awt/DefaultFocusTraversalPolicy.java b/libjava/java/awt/DefaultFocusTraversalPolicy.java
deleted file mode 100644
index 46b56d3fc29..00000000000
--- a/libjava/java/awt/DefaultFocusTraversalPolicy.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* DefaultFocusTraversalPolicy.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * DefaultFocusTraversalPolicy is the default focus traversal policy
- * used by Containers.
- *
- * This policy sharpens ContainerOrderFocusTraversalPolicy's
- * acceptance criteria, to reject those Components that have
- * unfocusable peers. Despite this extra strictness, this policy will
- * always accept a Component that has explicitly been set focusable by
- * any means.
- *
- * This AWT implementation assumes that the peers of the following
- * Components are not focusable: Canvas, Panel, Label, ScrollPane,
- * Scrollbar, Window, and any lightweight Component.
- *
- * A Component's focusability is independent of the focusability of
- * its peer.
- *
- * @author Thomas Fitzsimmons (fitzsim@redhat.com)
- * @since 1.4
- */
-public class DefaultFocusTraversalPolicy
- extends ContainerOrderFocusTraversalPolicy
-{
- /**
- * Construct a default focus traversal policy.
- */
- public DefaultFocusTraversalPolicy ()
- {
- }
-
- /**
- * Check whether a given Component would be acceptable as a focus
- * owner. The Component must be displayable, visible and enabled to
- * be acceptable. If the Component's focus traversability has been
- * overridden, by overriding Component.isFocusTraversable or
- * Component.isFocusable, or by calling Component.setFocusable, then
- * the Component will be accepted if it is focusable. If the
- * Component uses the default focus traversable behaviour, then
- * <code>comp</code> will always be rejected if it is a Canvas,
- * Panel, Label, ScrollPane, Scrollbar, Window or lightweight
- * Component.
- *
- * @param comp the Component to check
- *
- * @return true if the Component is an acceptable target for
- * keyboard input focus, false otherwise
- */
- protected boolean accept (Component comp)
- {
- if (comp.visible
- && comp.isDisplayable ()
- && comp.enabled)
- {
- if (comp.isFocusTraversableOverridden != 0
- && (comp.isFocusTraversable () || comp.isFocusable()))
- return true;
-
- if (!(comp instanceof Canvas
- || comp instanceof Panel
- || comp instanceof Label
- || comp instanceof ScrollPane
- || comp instanceof Scrollbar
- || comp instanceof Window
- || comp.isLightweight ()))
- return true;
- }
- return false;
- }
-}
diff --git a/libjava/java/awt/DefaultKeyboardFocusManager.java b/libjava/java/awt/DefaultKeyboardFocusManager.java
deleted file mode 100644
index 8362a97481b..00000000000
--- a/libjava/java/awt/DefaultKeyboardFocusManager.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/* DefaultKeyboardFocusManager.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.FocusEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.WindowEvent;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-// FIXME: finish documentation
-public class DefaultKeyboardFocusManager extends KeyboardFocusManager
-{
- /**
- * This class models a request to delay the dispatch of events that
- * arrive after a certain time, until a certain component becomes
- * the focus owner.
- */
- private class EventDelayRequest implements Comparable
- {
- /** A {@link java.util.List} of {@link java.awt.event.KeyEvent}s
- that are being delayed, pending this request's {@link
- Component} receiving the keyboard focus. */
- private LinkedList enqueuedKeyEvents = new LinkedList ();
-
- /** An event timestamp. All events that arrive after this time
- should be queued in the {@link #enqueuedKeyEvents} {@link
- java.util.List}. */
- public long timestamp;
- /** When this {@link Component} becomes focused, all events
- between this EventDelayRequest and the next one in will be
- dispatched from {@link #enqueuedKeyEvents}. */
- public Component focusedComp;
-
- /**
- * Construct a new EventDelayRequest.
- *
- * @param timestamp events that arrive after this time will be
- * delayed
- * @param focusedComp the Component that needs to receive focus
- * before events are dispatched
- */
- public EventDelayRequest (long timestamp, Component focusedComp)
- {
- this.timestamp = timestamp;
- this.focusedComp = focusedComp;
- }
-
- public int compareTo (Object o)
- {
- if (!(o instanceof EventDelayRequest))
- throw new ClassCastException ();
-
- EventDelayRequest request = (EventDelayRequest) o;
-
- if (request.timestamp < timestamp)
- return -1;
- else if (request.timestamp == timestamp)
- return 0;
- else
- return 1;
- }
-
- public boolean equals (Object o)
- {
- if (!(o instanceof EventDelayRequest) || o == null)
- return false;
-
- EventDelayRequest request = (EventDelayRequest) o;
-
- return (request.timestamp == timestamp
- && request.focusedComp == focusedComp);
- }
-
- public void enqueueEvent (KeyEvent e)
- {
- KeyEvent last = (KeyEvent) enqueuedKeyEvents.getLast ();
- if (last != null && e.getWhen () < last.getWhen ())
- throw new RuntimeException ("KeyEvents enqueued out-of-order");
-
- if (e.getWhen () <= timestamp)
- throw new RuntimeException ("KeyEvents enqueued before starting timestamp");
-
- enqueuedKeyEvents.add (e);
- }
-
- public void dispatchEvents ()
- {
- int size = enqueuedKeyEvents.size ();
- for (int i = 0; i < size; i++)
- {
- KeyEvent e = (KeyEvent) enqueuedKeyEvents.remove (0);
- dispatchKeyEvent (e);
- }
- }
-
- public void discardEvents ()
- {
- enqueuedKeyEvents.clear ();
- }
- }
-
- /** The {@link java.util.SortedSet} of current {@link
- #EventDelayRequest}s. */
- private SortedSet delayRequests = new TreeSet ();
-
- public DefaultKeyboardFocusManager ()
- {
- }
-
- public boolean dispatchEvent (AWTEvent e)
- {
- if (e instanceof WindowEvent)
- {
- Window target = (Window) e.getSource ();
-
- if (e.id == WindowEvent.WINDOW_ACTIVATED)
- setGlobalActiveWindow (target);
- else if (e.id == WindowEvent.WINDOW_GAINED_FOCUS)
- setGlobalFocusedWindow (target);
- else if (e.id != WindowEvent.WINDOW_LOST_FOCUS
- && e.id != WindowEvent.WINDOW_DEACTIVATED)
- return false;
-
- redispatchEvent(target, e);
- return true;
- }
- else if (e instanceof FocusEvent)
- {
- Component target = (Component) e.getSource ();
-
- if (e.id == FocusEvent.FOCUS_GAINED)
- {
- if (! (target instanceof Window))
- {
- if (((FocusEvent) e).isTemporary ())
- setGlobalFocusOwner (target);
- else
- setGlobalPermanentFocusOwner (target);
- }
-
- // Keep track of this window's focus owner.
-
- // Find the target Component's top-level ancestor.
- Container parent = target.getParent ();
-
- while (parent != null
- && !(parent instanceof Window))
- parent = parent.getParent ();
-
- Window toplevel = parent == null ?
- (Window) target : (Window) parent;
-
- Component focusOwner = getFocusOwner ();
- if (focusOwner != null
- && ! (focusOwner instanceof Window))
- toplevel.setFocusOwner (focusOwner);
- }
- else if (e.id == FocusEvent.FOCUS_LOST)
- {
- if (((FocusEvent) e).isTemporary ())
- setGlobalFocusOwner (null);
- else
- setGlobalPermanentFocusOwner (null);
- }
-
- redispatchEvent(target, e);
-
- return true;
- }
- else if (e instanceof KeyEvent)
- {
- // Loop through all registered KeyEventDispatchers, giving
- // each a chance to handle this event.
- Iterator i = getKeyEventDispatchers().iterator();
-
- while (i.hasNext ())
- {
- KeyEventDispatcher dispatcher = (KeyEventDispatcher) i.next ();
- if (dispatcher.dispatchKeyEvent ((KeyEvent) e))
- return true;
- }
-
- // processKeyEvent checks if this event represents a focus
- // traversal key stroke.
- Component focusOwner = getGlobalPermanentFocusOwner ();
-
- if (focusOwner != null)
- processKeyEvent (focusOwner, (KeyEvent) e);
-
- if (e.isConsumed ())
- return true;
-
- if (enqueueKeyEvent ((KeyEvent) e))
- // This event was enqueued for dispatch at a later time.
- return true;
- else
- // This event wasn't handled by any of the registered
- // KeyEventDispatchers, and wasn't enqueued for dispatch
- // later, so send it to the default dispatcher.
- return dispatchKeyEvent ((KeyEvent) e);
- }
-
- return false;
- }
-
- private boolean enqueueKeyEvent (KeyEvent e)
- {
- Iterator i = delayRequests.iterator ();
- boolean oneEnqueued = false;
- while (i.hasNext ())
- {
- EventDelayRequest request = (EventDelayRequest) i.next ();
- if (e.getWhen () > request.timestamp)
- {
- request.enqueueEvent (e);
- oneEnqueued = true;
- }
- }
- return oneEnqueued;
- }
-
- public boolean dispatchKeyEvent (KeyEvent e)
- {
- Component focusOwner = getGlobalPermanentFocusOwner ();
-
- if (focusOwner != null)
- redispatchEvent(focusOwner, e);
-
- // Loop through all registered KeyEventPostProcessors, giving
- // each a chance to process this event.
- Iterator i = getKeyEventPostProcessors().iterator();
-
- while (i.hasNext ())
- {
- KeyEventPostProcessor processor = (KeyEventPostProcessor) i.next ();
- if (processor.postProcessKeyEvent ((KeyEvent) e))
- return true;
- }
-
- // The event hasn't been consumed yet. Check if it is an
- // MenuShortcut.
- if (postProcessKeyEvent (e))
- return true;
-
- // Always return true.
- return true;
- }
-
- public boolean postProcessKeyEvent (KeyEvent e)
- {
- // Check if this event represents a menu shortcut.
-
- // MenuShortcuts are activated by Ctrl- KeyEvents, only on KEY_PRESSED.
- int modifiers = e.getModifiersEx ();
- if (e.getID() == KeyEvent.KEY_PRESSED
- && (modifiers & KeyEvent.CTRL_DOWN_MASK) != 0)
- {
- Window focusedWindow = getGlobalFocusedWindow ();
- if (focusedWindow instanceof Frame)
- {
- MenuBar menubar = ((Frame) focusedWindow).getMenuBar ();
-
- if (menubar != null)
- {
- // If there's a menubar, loop through all menu items,
- // checking whether each one has a shortcut, and if
- // so, whether this key event should activate it.
- int numMenus = menubar.getMenuCount ();
-
- for (int i = 0; i < numMenus; i++)
- {
- Menu menu = menubar.getMenu (i);
- int numItems = menu.getItemCount ();
-
- for (int j = 0; j < numItems; j++)
- {
- MenuItem item = menu.getItem (j);
- MenuShortcut shortcut = item.getShortcut ();
-
- if (item.isEnabled() && shortcut != null)
- {
- // Dispatch a new ActionEvent if:
- //
- // a) this is a Shift- KeyEvent, and the
- // shortcut requires the Shift modifier
- //
- // or, b) this is not a Shift- KeyEvent, and the
- // shortcut does not require the Shift
- // modifier.
- if (shortcut.getKey () == e.getKeyCode ()
- && ((shortcut.usesShiftModifier ()
- && (modifiers & KeyEvent.SHIFT_DOWN_MASK) != 0)
- || (! shortcut.usesShiftModifier ()
- && (modifiers & KeyEvent.SHIFT_DOWN_MASK) == 0)))
- {
- item.dispatchEvent (new ActionEvent (item,
- ActionEvent.ACTION_PERFORMED,
- item.getActionCommand (),
- modifiers));
- // The event was dispatched.
- return true;
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- public void processKeyEvent (Component comp, KeyEvent e)
- {
- AWTKeyStroke eventKeystroke = AWTKeyStroke.getAWTKeyStrokeForEvent (e);
- // For every focus traversal keystroke, we need to also consume
- // the other two key event types for the same key (e.g. if
- // KEY_PRESSED TAB is a focus traversal keystroke, we also need to
- // consume KEY_RELEASED and KEY_TYPED TAB key events).
- AWTKeyStroke oppositeKeystroke = AWTKeyStroke.getAWTKeyStroke (e.getKeyCode (),
- e.getModifiersEx (),
- !(e.id == KeyEvent.KEY_RELEASED));
-
- Set forwardKeystrokes = comp.getFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
- Set backwardKeystrokes = comp.getFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
- Set upKeystrokes = comp.getFocusTraversalKeys (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS);
- Set downKeystrokes = null;
- if (comp instanceof Container)
- downKeystrokes = comp.getFocusTraversalKeys (KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS);
-
- if (forwardKeystrokes.contains (eventKeystroke))
- {
- focusNextComponent (comp);
- e.consume ();
- }
- else if (backwardKeystrokes.contains (eventKeystroke))
- {
- focusPreviousComponent (comp);
- e.consume ();
- }
- else if (upKeystrokes.contains (eventKeystroke))
- {
- upFocusCycle (comp);
- e.consume ();
- }
- else if (comp instanceof Container
- && downKeystrokes.contains (eventKeystroke))
- {
- downFocusCycle ((Container) comp);
- e.consume ();
- }
- else if (forwardKeystrokes.contains (oppositeKeystroke)
- || backwardKeystrokes.contains (oppositeKeystroke)
- || upKeystrokes.contains (oppositeKeystroke)
- || (comp instanceof Container &&
- downKeystrokes.contains (oppositeKeystroke)))
- e.consume ();
- }
-
- protected void enqueueKeyEvents (long after, Component untilFocused)
- {
- delayRequests.add (new EventDelayRequest (after, untilFocused));
- }
-
- protected void dequeueKeyEvents (long after, Component untilFocused)
- {
- // FIXME: need synchronization on delayRequests and enqueuedKeyEvents.
-
- // Remove the KeyEvent with the oldest timestamp, which should be
- // the first element in the SortedSet.
- if (after < 0)
- {
- int size = delayRequests.size ();
- if (size > 0)
- delayRequests.remove (delayRequests.first ());
- }
- else
- {
- EventDelayRequest template = new EventDelayRequest (after, untilFocused);
- if (delayRequests.contains (template))
- {
- EventDelayRequest actual = (EventDelayRequest) delayRequests.tailSet (template).first ();
- delayRequests.remove (actual);
- actual.dispatchEvents ();
- }
- }
- }
-
- protected void discardKeyEvents (Component comp)
- {
- // FIXME: need synchronization on delayRequests and enqueuedKeyEvents.
-
- Iterator i = delayRequests.iterator ();
-
- while (i.hasNext ())
- {
- EventDelayRequest request = (EventDelayRequest) i.next ();
-
- if (request.focusedComp == comp
- || (comp instanceof Container
- && ((Container) comp).isAncestorOf (request.focusedComp)))
- request.discardEvents ();
- }
- }
-
- public void focusPreviousComponent (Component comp)
- {
- Component focusComp = (comp == null) ? getGlobalFocusOwner () : comp;
- Container focusCycleRoot = focusComp.getFocusCycleRootAncestor ();
- FocusTraversalPolicy policy = focusCycleRoot.getFocusTraversalPolicy ();
-
- Component previous = policy.getComponentBefore (focusCycleRoot, focusComp);
- if (previous != null)
- previous.requestFocusInWindow ();
- }
-
- public void focusNextComponent (Component comp)
- {
- Component focusComp = (comp == null) ? getGlobalFocusOwner () : comp;
- Container focusCycleRoot = focusComp.getFocusCycleRootAncestor ();
- FocusTraversalPolicy policy = focusCycleRoot.getFocusTraversalPolicy ();
-
- Component next = policy.getComponentAfter (focusCycleRoot, focusComp);
- if (next != null)
- next.requestFocusInWindow ();
- }
-
- public void upFocusCycle (Component comp)
- {
- Component focusComp = (comp == null) ? getGlobalFocusOwner () : comp;
- Container focusCycleRoot = focusComp.getFocusCycleRootAncestor ();
-
- if (focusCycleRoot instanceof Window)
- {
- FocusTraversalPolicy policy = focusCycleRoot.getFocusTraversalPolicy ();
- Component defaultComponent = policy.getDefaultComponent (focusCycleRoot);
- if (defaultComponent != null)
- defaultComponent.requestFocusInWindow ();
- }
- else
- {
- Container parentFocusCycleRoot = focusCycleRoot.getFocusCycleRootAncestor ();
-
- focusCycleRoot.requestFocusInWindow ();
- setGlobalCurrentFocusCycleRoot (parentFocusCycleRoot);
- }
- }
-
- public void downFocusCycle (Container cont)
- {
- if (cont == null)
- return;
-
- if (cont.isFocusCycleRoot (cont))
- {
- FocusTraversalPolicy policy = cont.getFocusTraversalPolicy ();
- Component defaultComponent = policy.getDefaultComponent (cont);
- if (defaultComponent != null)
- defaultComponent.requestFocusInWindow ();
- setGlobalCurrentFocusCycleRoot (cont);
- }
- }
-} // class DefaultKeyboardFocusManager
diff --git a/libjava/java/awt/Dialog.java b/libjava/java/awt/Dialog.java
deleted file mode 100644
index d3eb975a86d..00000000000
--- a/libjava/java/awt/Dialog.java
+++ /dev/null
@@ -1,553 +0,0 @@
-/* Dialog.java -- An AWT dialog box
- Copyright (C) 1999, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.peer.DialogPeer;
-
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleState;
-import javax.accessibility.AccessibleStateSet;
-
-/**
- * A dialog box widget class.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@redhat.com)
- */
-public class Dialog extends Window
-{
-
-/*
- * Static Variables
- */
-
-// Serialization constant
-private static final long serialVersionUID = 5920926903803293709L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial Indicates whether or not this dialog box is modal.
- */
-private boolean modal;
-
-/**
- * @serial Indicates whether or not this dialog box is resizable.
- */
-private boolean resizable = true;
-
-/**
- * @serial The title string for this dialog box, which can be
- * <code>null</code>.
- */
-private String title;
-
-/**
- * This field indicates whether the dialog is undecorated or not.
- */
-private boolean undecorated = false;
-
-/**
- * Indicates that we are blocked for modality in show
- */
-private boolean blocked = false;
-
-/**
- * Secondary EventQueue to handle AWT events while
- * we are blocked for modality in show
- */
-private EventQueue eq2 = null;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>Dialog</code> with the specified
- * parent, that is resizable and not modal, and which has no title.
- *
- * @param parent The parent frame of this dialog box.
- *
- * @exception IllegalArgumentException If the owner's GraphicsConfiguration
- * is not from a screen device, or if owner is null. This exception is always
- * thrown when GraphicsEnvironment.isHeadless() returns true.
- */
-public
-Dialog(Frame parent)
-{
- this(parent, "", false);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Dialog</code> with the specified
- * parent and modality, that is resizable and which has no title.
- *
- * @param parent The parent frame of this dialog box.
- * @param modal <code>true</code> if this dialog box is modal,
- * <code>false</code> otherwise.
- *
- * @exception IllegalArgumentException If the owner's GraphicsConfiguration
- * is not from a screen device, or if owner is null. This exception is always
- * thrown when GraphicsEnvironment.isHeadless() returns true.
- */
-public
-Dialog(Frame parent, boolean modal)
-{
- this(parent, "", modal);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Dialog</code> with the specified
- * parent, that is resizable and not modal, and which has the specified
- * title.
- *
- * @param parent The parent frame of this dialog box.
- * @param title The title string for this dialog box.
- *
- * @exception IllegalArgumentException If the owner's GraphicsConfiguration
- * is not from a screen device, or if owner is null. This exception is always
- * thrown when GraphicsEnvironment.isHeadless() returns true.
- */
-public
-Dialog(Frame parent, String title)
-{
- this(parent, title, false);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Dialog</code> with the specified,
- * parent, title, and modality, that is resizable.
- *
- * @param parent The parent frame of this dialog box.
- * @param title The title string for this dialog box.
- * @param modal <code>true</code> if this dialog box is modal,
- * <code>false</code> otherwise.
- *
- * @exception IllegalArgumentException If owner is null or
- * GraphicsEnvironment.isHeadless() returns true.
- */
-public
-Dialog(Frame parent, String title, boolean modal)
-{
- this (parent, title, modal, parent.getGraphicsConfiguration ());
-}
-
-/**
- * Initializes a new instance of <code>Dialog</code> with the specified,
- * parent, title, modality and <code>GraphicsConfiguration</code>,
- * that is resizable.
- *
- * @param parent The parent frame of this dialog box.
- * @param title The title string for this dialog box.
- * @param modal <code>true</code> if this dialog box is modal,
- * <code>false</code> otherwise.
- * @param gc The <code>GraphicsConfiguration</code> object to use.
- *
- * @exception IllegalArgumentException If owner is null, the
- * GraphicsConfiguration is not a screen device or
- * GraphicsEnvironment.isHeadless() returns true.
- *
- * @since 1.4
- */
-public
-Dialog (Frame parent, String title, boolean modal, GraphicsConfiguration gc)
-{
- super (parent, gc);
-
- // A null title is equivalent to an empty title
- this.title = (title != null) ? title : "";
- this.modal = modal;
- visible = false;
-
- setLayout(new BorderLayout());
-}
-
-/**
- * Initializes a new instance of <code>Dialog</code> with the specified,
- * parent, that is resizable.
- *
- * @exception IllegalArgumentException If parent is null. This exception is
- * always thrown when GraphicsEnvironment.isHeadless() returns true.
- *
- * @since 1.2
- */
-public
-Dialog (Dialog owner)
-{
- this (owner, "", false, owner.getGraphicsConfiguration ());
-}
-
-/**
- * Initializes a new instance of <code>Dialog</code> with the specified,
- * parent and title, that is resizable.
- *
- * @exception IllegalArgumentException If parent is null. This exception is
- * always thrown when GraphicsEnvironment.isHeadless() returns true.
- *
- * @since 1.2
- */
-public
-Dialog (Dialog owner, String title)
-{
- this (owner, title, false, owner.getGraphicsConfiguration ());
-}
-
-/**
- * Initializes a new instance of <code>Dialog</code> with the specified,
- * parent, title and modality, that is resizable.
- *
- * @exception IllegalArgumentException If parent is null. This exception is
- * always thrown when GraphicsEnvironment.isHeadless() returns true.
- *
- * @since 1.2
- */
-public
-Dialog (Dialog owner, String title, boolean modal)
-{
- this (owner, title, modal, owner.getGraphicsConfiguration ());
-}
-
-/**
- * Initializes a new instance of <code>Dialog</code> with the specified,
- * parent, title, modality and <code>GraphicsConfiguration</code>,
- * that is resizable.
- *
- * @exception IllegalArgumentException If parent is null, the
- * GraphicsConfiguration is not a screen device or
- * GraphicsEnvironment.isHeadless() returns true.
- *
- * @since 1.4
- */
-public
-Dialog (Dialog parent, String title, boolean modal, GraphicsConfiguration gc)
-{
- super (parent, parent.getGraphicsConfiguration ());
-
- // A null title is equivalent to an empty title
- this.title = (title != null) ? title : "";
- this.modal = modal;
- visible = false;
-
- setLayout (new BorderLayout ());
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * Returns the title of this dialog box.
- *
- * @return The title of this dialog box.
- */
-public String
-getTitle()
-{
- return(title);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the title of this dialog box to the specified string.
- *
- * @param title The new title.
- */
-public synchronized void
-setTitle(String title)
-{
- // A null title is equivalent to an empty title
- this.title = (title != null) ? title : "";
-
- if (peer != null)
- {
- DialogPeer d = (DialogPeer) peer;
- d.setTitle (title);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this dialog box is modal.
- *
- * @return <code>true</code> if this dialog box is modal,
- * <code>false</code> otherwise.
- */
-public boolean
-isModal()
-{
- return(modal);
-}
-
-/*************************************************************************/
-
-/**
- * Changes the modality of this dialog box. This can only be done before
- * the peer is created.
- *
- * @param modal <code>true</code> to make this dialog box modal,
- * <code>false</code> to make it non-modal.
- */
-public void
-setModal(boolean modal)
-{
- this.modal = modal;
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this dialog box is resizable.
- *
- * @return <code>true</code> if this dialog is resizable, <code>false</code>,
- * otherwise.
- */
-public boolean
-isResizable()
-{
- return(resizable);
-}
-
-/*************************************************************************/
-
-/**
- * Changes the resizability of this dialog box.
- *
- * @param resizable <code>true</code> to make this dialog resizable,
- * <code>false</code> to make it non-resizable.
- */
-public synchronized void
-setResizable(boolean resizable)
-{
- this.resizable = resizable;
- if (peer != null)
- {
- DialogPeer d = (DialogPeer) peer;
- d.setResizable (resizable);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Creates this object's native peer.
- */
-public synchronized void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createDialog (this);
- super.addNotify ();
-}
-
-/*************************************************************************/
-
-/**
- * Makes this dialog visible and brings it to the front.
- * If the dialog is modal and is not already visible, this call will not
- * return until the dialog is hidden by someone calling hide or dispose.
- * If this is the event dispatching thread we must ensure that another event
- * thread runs while the one which invoked this method is blocked.
- */
-public synchronized void
-show()
-{
- super.show();
-
- if (isModal())
- {
- // If already shown (and blocked) just return
- if (blocked)
- return;
-
- /* If show is called in the dispatch thread for a modal dialog it will
- block so we must run another thread so the events keep being
- dispatched.*/
- if (EventQueue.isDispatchThread ())
- {
- EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
- eq2 = new EventQueue ();
- eq.push (eq2);
- }
-
- try
- {
- blocked = true;
- wait ();
- blocked = false;
- }
- catch (InterruptedException e)
- {
- blocked = false;
- }
-
- if (eq2 != null)
- {
- eq2.pop ();
- eq2 = null;
- }
- }
-}
-
-/*************************************************************************/
-
-/**
- * Hides the Dialog and then
- * causes show() to return if it is currently blocked.
- */
-
-public synchronized void
-hide ()
-{
- if (blocked)
- {
- notifyAll ();
- }
-
- super.hide();
-}
-
-/*************************************************************************/
-
-/**
- * Disposes the Dialog and then causes show() to return
- * if it is currently blocked.
- */
-
-public synchronized void
-dispose ()
-{
- if (blocked)
- {
- notifyAll ();
- }
-
- super.dispose();
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this component.
- *
- * @return A debugging string for this component.
- */
-protected String
-paramString()
-{
- return ("title+" + title + ",modal=" + modal +
- ",resizable=" + resizable + "," + super.paramString());
-}
-
- /**
- * Returns whether this frame is undecorated or not.
- *
- * @since 1.4
- */
- public boolean isUndecorated ()
- {
- return undecorated;
- }
-
- /**
- * Disables or enables decorations for this frame. This method can only be
- * called while the frame is not displayable.
- *
- * @exception IllegalComponentStateException If this frame is displayable.
- *
- * @since 1.4
- */
- public void setUndecorated (boolean undecorated)
- {
- if (isDisplayable ())
- throw new IllegalComponentStateException ();
-
- this.undecorated = undecorated;
- }
-
- protected class AccessibleAWTDialog extends AccessibleAWTWindow
- {
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.DIALOG;
- }
-
- public AccessibleStateSet getAccessibleState()
- {
- AccessibleStateSet states = super.getAccessibleStateSet();
- if (isResizable())
- states.add(AccessibleState.RESIZABLE);
- if (isModal())
- states.add(AccessibleState.MODAL);
- return states;
- }
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>Dialog</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTDialog();
- return accessibleContext;
- }
-
-} // class Dialog
-
diff --git a/libjava/java/awt/Dimension.java b/libjava/java/awt/Dimension.java
deleted file mode 100644
index 4c1a07bf920..00000000000
--- a/libjava/java/awt/Dimension.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/* Dimension.java -- represents a 2-dimensional span
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.geom.Dimension2D;
-import java.io.Serializable;
-
-/**
- * This class holds a width and height value pair. This is used in plenty
- * of windowing classes, but also has geometric meaning.
- *
- * <p>It is valid for a dimension to have negative width or height; but it
- * is considered to have no area. Therefore, the behavior in various methods
- * is undefined in such a case.
- *
- * <p>There are some public fields; if you mess with them in an inconsistent
- * manner, it is your own fault when you get invalid results. Also, this
- * class is not threadsafe.
- *
- * @author Per Bothner (bothner@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Component
- * @see LayoutManager
- * @since 1.0
- * @status updated to 1.14
- */
-public class Dimension extends Dimension2D implements Serializable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 4723952579491349524L;
-
- /**
- * The width of this object.
- *
- * @see #getSize()
- * @see #setSize(double, double)
- * @serial the width
- */
- public int width;
-
- /**
- * The height of this object.
- *
- * @see #getSize()
- * @see #setSize(double, double)
- * @serial the height
- */
- public int height;
-
- /**
- * Create a new Dimension with a width and height of zero.
- */
- public Dimension()
- {
- }
-
- /**
- * Create a new Dimension with width and height identical to that of the
- * specified dimension.
- *
- * @param d the Dimension to copy
- * @throws NullPointerException if d is null
- */
- public Dimension(Dimension d)
- {
- width = d.width;
- height = d.height;
- }
-
- /**
- * Create a new Dimension with the specified width and height.
- *
- * @param w the width of this object
- * @param h the height of this object
- */
- public Dimension(int w, int h)
- {
- width = w;
- height = h;
- }
-
- /**
- * Gets the width of this dimension.
- *
- * @return the width, as a double
- */
- public double getWidth()
- {
- return width;
- }
-
- /**
- * Gets the height of this dimension.
- *
- * @return the height, as a double
- */
- public double getHeight()
- {
- return height;
- }
-
- /**
- * Sets the size of this dimension. The values are rounded to int.
- *
- * @param w the new width
- * @param h the new height
- * @since 1.2
- */
- public void setSize(double w, double h)
- {
- width = (int) w;
- height = (int) h;
- }
-
- /**
- * Returns the size of this dimension. A pretty useless method, as this is
- * already a dimension.
- *
- * @return a copy of this dimension
- * @see #setSize(Dimension)
- * @since 1.1
- */
- public Dimension getSize()
- {
- return new Dimension(width, height);
- }
-
- /**
- * Sets the width and height of this object to match that of the
- * specified object.
- *
- * @param d the Dimension to get the new width and height from
- * @throws NullPointerException if d is null
- * @see #getSize()
- * @since 1.1
- */
- public void setSize(Dimension d)
- {
- width = d.width;
- height = d.height;
- }
-
- /**
- * Sets the width and height of this object to the specified values.
- *
- * @param w the new width value
- * @param h the new height value
- */
- public void setSize(int w, int h)
- {
- width = w;
- height = h;
- }
-
- /**
- * Tests this object for equality against the specified object. This will
- * be true if and only if the specified object is an instance of
- * Dimension2D, and has the same width and height.
- *
- * @param obj the object to test against
- * @return true if the object is equal to this
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof Dimension))
- return false;
- Dimension dim = (Dimension) obj;
- return height == dim.height && width == dim.width;
- }
-
- /**
- * Return the hashcode for this object. It is not documented, but appears
- * to be <code>((width + height) * (width + height + 1) / 2) + width</code>.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- // Reverse engineering this was fun!
- return (width + height) * (width + height + 1) / 2 + width;
- }
-
- /**
- * Returns a string representation of this object. The format is:
- * <code>getClass().getName() + "[width=" + width + ",height=" + height
- * + ']'</code>.
- *
- * @return a string representation of this object
- */
- public String toString()
- {
- return getClass().getName()
- + "[width=" + width + ",height=" + height + ']';
- }
-} // class Dimension
diff --git a/libjava/java/awt/DisplayMode.java b/libjava/java/awt/DisplayMode.java
deleted file mode 100644
index d41d4a87f57..00000000000
--- a/libjava/java/awt/DisplayMode.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/* DisplayMode.java -- a description of display mode configurations
- Copyright (C) 2002, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This encapsulates information about the display mode for a graphics
- * device configuration. They are device dependent, and may not always be
- * available.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see GraphicsDevice
- * @since 1.4
- * @status updated to 1.4
- */
-public final class DisplayMode
-{
- /**
- * Value of the bit depth if multiple depths are supported.
- *
- * @see #getBitDepth()
- */
- public static final int BIT_DEPTH_MULTI = -1;
-
- /**
- * Value of an unknown refresh rate.
- *
- * @see #getRefreshRate()
- */
- public static final int REFRESH_RATE_UNKNOWN = 0;
-
- /** The width. */
- private final int width;
-
- /** The height. */
- private final int height;
-
- /** The bit depth. */
- private final int bitDepth;
-
- /** The refresh rate. */
- private final int refreshRate;
-
- /**
- * Create a mode with the given parameters.
- *
- * @param width the width
- * @param height the height
- * @param bitDepth the bitDepth
- * @param refreshRate the refreshRate
- * @see #BIT_DEPTH_MULTI
- * @see #REFRESH_RATE_UNKNOWN
- */
- public DisplayMode(int width, int height, int bitDepth, int refreshRate)
- {
- this.width = width;
- this.height = height;
- this.bitDepth = bitDepth;
- this.refreshRate = refreshRate;
- }
-
- /**
- * Returns the height, in pixels.
- *
- * @return the height
- */
- public int getHeight()
- {
- return height;
- }
-
- /**
- * Returns the width, in pixels.
- *
- * @return the width
- */
- public int getWidth()
- {
- return width;
- }
-
- /**
- * Returns the bit depth, in bits per pixel. This may be BIT_DEPTH_MULTI.
- *
- * @return the bit depth
- * @see #BIT_DEPTH_MULTI
- */
- public int getBitDepth()
- {
- return bitDepth;
- }
-
- /**
- * Returns the refresh rate, in hertz. This may be REFRESH_RATE_UNKNOWN.
- *
- * @return the refresh rate
- * @see #REFRESH_RATE_UNKNOWN
- */
- public int getRefreshRate()
- {
- return refreshRate;
- }
-
- /**
- * Test for equality. This returns true for two modes with identical
- * parameters.
- *
- * @param dm The display mode to compare to
- *
- * @return true if it is equal
- */
- public boolean equals (DisplayMode dm)
- {
- return (width == dm.width
- && height == dm.height
- && bitDepth == dm.bitDepth
- && refreshRate == dm.refreshRate);
- }
-
- /**
- * Returns a hash code for the display mode.
- *
- * @return the hash code
- */
- public int hashCode()
- {
- return width + height + bitDepth + refreshRate;
- }
-} // class DisplayMode
diff --git a/libjava/java/awt/Event.java b/libjava/java/awt/Event.java
deleted file mode 100644
index 648139cc850..00000000000
--- a/libjava/java/awt/Event.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/* Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-public class Event implements java.io.Serializable
-{
- static final long serialVersionUID = 5488922509400504703L;
-
- public static final int SHIFT_MASK = 1;
- public static final int CTRL_MASK = 2;
- public static final int META_MASK = 4;
- public static final int ALT_MASK = 8;
-
- public static final int ACTION_EVENT = 1001;
- public static final int BACK_SPACE = 8;
- public static final int CAPS_LOCK = 1022;
- public static final int DELETE = 127;
- public static final int DOWN = 1005;
- public static final int END = 1001;
- public static final int ENTER = 10;
- public static final int ESCAPE = 27;
- public static final int F1 = 1008;
- public static final int F10 = 1017;
- public static final int F11 = 1018;
- public static final int F12 = 1019;
- public static final int F2 = 1009;
- public static final int F3 = 1010;
- public static final int F4 = 1011;
- public static final int F5 = 1012;
- public static final int F6 = 1013;
- public static final int F7 = 1014;
- public static final int F8 = 1015;
- public static final int F9 = 1016;
- public static final int GOT_FOCUS = 1004;
- public static final int HOME = 1000;
- public static final int INSERT = 1025;
- public static final int KEY_ACTION = 403;
- public static final int KEY_ACTION_RELEASE = 404;
- public static final int KEY_PRESS = 401;
- public static final int KEY_RELEASE = 402;
- public static final int LEFT = 1006;
- public static final int LIST_DESELECT = 702;
- public static final int LIST_SELECT = 701;
- public static final int LOAD_FILE = 1002;
- public static final int LOST_FOCUS = 1005;
- public static final int MOUSE_DOWN = 501;
- public static final int MOUSE_DRAG = 506;
- public static final int MOUSE_ENTER = 504;
- public static final int MOUSE_EXIT = 505;
- public static final int MOUSE_MOVE = 503;
- public static final int MOUSE_UP = 502;
- public static final int NUM_LOCK = 1023;
- public static final int PAUSE = 1024;
- public static final int PGDN = 1003;
- public static final int PGUP = 1002;
- public static final int PRINT_SCREEN = 1020;
- public static final int RIGHT = 1007;
- public static final int SAVE_FILE = 1003;
- public static final int SCROLL_ABSOLUTE = 605;
- public static final int SCROLL_BEGIN = 606;
- public static final int SCROLL_END = 607;
- public static final int SCROLL_LINE_DOWN = 602;
- public static final int SCROLL_LINE_UP = 601;
- public static final int SCROLL_LOCK = 1021;
- public static final int SCROLL_PAGE_DOWN = 604;
- public static final int SCROLL_PAGE_UP = 603;
- public static final int TAB = 9;
- public static final int UP = 1004;
- public static final int WINDOW_DEICONIFY = 204;
- public static final int WINDOW_DESTROY = 201;
- public static final int WINDOW_EXPOSE = 202;
- public static final int WINDOW_ICONIFY = 203;
- public static final int WINDOW_MOVED = 205;
-
- public Object arg;
- public int clickCount;
- boolean consumed; // Required by serialization spec.
- public Event evt;
- public int id;
- public int key;
- public int modifiers;
- public Object target;
- public long when;
- public int x;
- public int y;
-
- public Event (Object target, int id, Object arg)
- {
- this.id = id;
- this.target = target;
- this.arg = arg;
- }
-
- public Event (Object target, long when, int id, int x, int y, int key,
- int modifiers)
- {
- this.target = target;
- this.when = when;
- this.id = id;
- this.x = x;
- this.y = y;
- this.key = key;
- this.modifiers = modifiers;
- }
-
- public Event (Object target, long when, int id, int x, int y, int key,
- int modifiers, Object arg)
- {
- this (target, when, id, x, y, key, modifiers);
- this.arg = arg;
- }
-
- public boolean controlDown ()
- {
- return ((modifiers & CTRL_MASK) == 0 ? false : true);
- }
-
- public boolean metaDown ()
- {
- return ((modifiers & META_MASK) == 0 ? false : true);
- }
-
- protected String paramString ()
- {
- return "id=" + id + ",x=" + x + ",y=" + y
- + ",target=" + target + ",arg=" + arg;
- }
-
- public boolean shiftDown()
- {
- return ((modifiers & SHIFT_MASK) == 0 ? false : true);
- }
-
- public String toString()
- {
- return getClass().getName() + "[" + paramString() + "]";
- }
-
- public void translate (int x, int y)
- {
- this.x += x;
- this.y += y;
- }
-}
diff --git a/libjava/java/awt/EventDispatchThread.java b/libjava/java/awt/EventDispatchThread.java
deleted file mode 100644
index a64cdae8567..00000000000
--- a/libjava/java/awt/EventDispatchThread.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* EventDispatchThread.java -
- Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * @author Bryce McKinlay
- * @status believed complete, but untested.
- */
-class EventDispatchThread extends Thread
-{
- private static int dispatchThreadNum;
-
- private EventQueue queue;
-
- EventDispatchThread(EventQueue queue)
- {
- super();
- setName("AWT-EventQueue-" + ++dispatchThreadNum);
- this.queue = queue;
- setPriority(NORM_PRIORITY + 1);
- }
-
- public void run()
- {
- while (true)
- {
- try
- {
- AWTEvent evt = queue.getNextEvent();
-
- KeyboardFocusManager manager;
- manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
-
- // Try to dispatch this event to the current keyboard focus
- // manager. It will dispatch all FocusEvents, all
- // WindowEvents related to focus, and all KeyEvents,
- // returning true. Otherwise, it returns false and we
- // dispatch the event normally.
- if (!manager.dispatchEvent (evt))
- queue.dispatchEvent(evt);
- }
- catch (ThreadDeath death)
- {
- // If someone wants to kill us, let them.
- return;
- }
- catch (InterruptedException ie)
- {
- // We are interrupted when we should finish executing
- return;
- }
- catch (Throwable x)
- {
- System.err.println("Exception during event dispatch:");
- x.printStackTrace(System.err);
- }
- }
- }
-}
diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java
deleted file mode 100644
index f5b67f3a999..00000000000
--- a/libjava/java/awt/EventQueue.java
+++ /dev/null
@@ -1,551 +0,0 @@
-/* EventQueue.java --
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import gnu.java.awt.ClasspathToolkit;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.InputEvent;
-import java.awt.event.InvocationEvent;
-import java.awt.event.WindowEvent;
-import java.lang.reflect.InvocationTargetException;
-import java.util.EmptyStackException;
-
-/* Written using on-line Java 2 Platform Standard Edition v1.3 API
- * Specification, as well as "The Java Class Libraries", 2nd edition
- * (Addison-Wesley, 1998).
- * Status: Believed complete, but untested.
- */
-
-/**
- * This class manages a queue of <code>AWTEvent</code> objects that
- * are posted to it. The AWT system uses only one event queue for all
- * events.
- *
- * @author Bryce McKinlay
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class EventQueue
-{
- private static final int INITIAL_QUEUE_DEPTH = 8;
- private AWTEvent[] queue = new AWTEvent[INITIAL_QUEUE_DEPTH];
-
- private int next_in = 0; // Index where next event will be added to queue
- private int next_out = 0; // Index of next event to be removed from queue
-
- private EventQueue next;
- private EventQueue prev;
- private AWTEvent currentEvent;
- private long lastWhen = System.currentTimeMillis();
-
- private EventDispatchThread dispatchThread = new EventDispatchThread(this);
- private boolean shutdown = false;
-
- private long lastNativeQueueAccess = 0;
- private long humanLatencyThreshold = 100;
-
- synchronized void setShutdown (boolean b)
- {
- shutdown = b;
- }
-
- synchronized boolean isShutdown ()
- {
- if (shutdown)
- return true;
-
- // This is the exact self-shutdown condition specified in J2SE:
- // http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/AWTThreadIssues.html
-
- if (peekEvent() == null
- && ((ClasspathToolkit) Toolkit.getDefaultToolkit()).nativeQueueEmpty())
- {
- Frame[] frames = Frame.getFrames();
- for (int i = 0; i < frames.length; ++i)
- if (frames[i].isDisplayable())
- return false;
- return true;
- }
- return false;
- }
-
- /**
- * Initializes a new instance of <code>EventQueue</code>.
- */
- public EventQueue()
- {
- }
-
- /**
- * Returns the next event in the queue. This method will block until
- * an event is available or until the thread is interrupted.
- *
- * @return The next event in the queue.
- *
- * @exception InterruptedException If this thread is interrupted while
- * waiting for an event to be posted to the queue.
- */
- public synchronized AWTEvent getNextEvent()
- throws InterruptedException
- {
- if (next != null)
- return next.getNextEvent();
-
- ClasspathToolkit tk = ((ClasspathToolkit) Toolkit.getDefaultToolkit());
- long curr = System.currentTimeMillis();
-
- if (! tk.nativeQueueEmpty() &&
- (curr - lastNativeQueueAccess > humanLatencyThreshold))
- {
- tk.iterateNativeQueue(this, false);
- lastNativeQueueAccess = curr;
- }
-
- while (next_in == next_out)
- {
- // Only the EventDispatchThread associated with the top of the stack is
- // allowed to get events from the native source; everyone else just
- // waits on the head of the queue.
-
- if (isDispatchThread())
- {
- // We are not allowed to return null from this method, yet it
- // is possible that we actually have run out of native events
- // in the enclosing while() loop, and none of the native events
- // happened to cause AWT events. We therefore ought to check
- // the isShutdown() condition here, before risking a "native
- // wait". If we check it before entering this function we may
- // wait forever for events after the shutdown condition has
- // arisen.
-
- if (isShutdown())
- throw new InterruptedException();
-
- tk.iterateNativeQueue(this, true);
- lastNativeQueueAccess = System.currentTimeMillis();
- }
- else
- {
- try
- {
- wait();
- }
- catch (InterruptedException ie)
- {
- }
- }
- }
-
- AWTEvent res = queue[next_out];
-
- if (++next_out == queue.length)
- next_out = 0;
- return res;
- }
-
- /**
- * Returns the next event in the queue without removing it from the queue.
- * This method will block until an event is available or until the thread
- * is interrupted.
- *
- * @return The next event in the queue.
- * @specnote Does not block. Returns null if there are no events on the
- * queue.
- */
- public synchronized AWTEvent peekEvent()
- {
- if (next != null)
- return next.peekEvent();
-
- if (next_in != next_out)
- return queue[next_out];
- else
- return null;
- }
-
- /**
- * Returns the next event in the queue that has the specified id
- * without removing it from the queue.
- * This method will block until an event is available or until the thread
- * is interrupted.
- *
- * @param id The event id to return.
- *
- * @return The next event in the queue.
- *
- * @specnote Does not block. Returns null if there are no matching events
- * on the queue.
- */
- public synchronized AWTEvent peekEvent(int id)
- {
- if (next != null)
- return next.peekEvent(id);
-
- int i = next_out;
- while (i != next_in)
- {
- AWTEvent qevt = queue[i];
- if (qevt.id == id)
- return qevt;
- }
- return null;
- }
-
- /**
- * Posts a new event to the queue.
- *
- * @param evt The event to post to the queue.
- *
- * @exception NullPointerException If event is null.
- */
- public synchronized void postEvent(AWTEvent evt)
- {
- if (evt == null)
- throw new NullPointerException();
-
- if (next != null)
- {
- next.postEvent(evt);
- return;
- }
-
- /* Check for any events already on the queue with the same source
- and ID. */
- int i = next_out;
- while (i != next_in)
- {
- AWTEvent qevt = queue[i];
- Object src;
- if (qevt.id == evt.id
- && (src = qevt.getSource()) == evt.getSource()
- && src instanceof Component)
- {
- /* If there are, call coalesceEvents on the source component
- to see if they can be combined. */
- Component srccmp = (Component) src;
- AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt);
- if (coalesced_evt != null)
- {
- /* Yes. Replace the existing event with the combined event. */
- queue[i] = coalesced_evt;
- return;
- }
- break;
- }
- if (++i == queue.length)
- i = 0;
- }
-
- queue[next_in] = evt;
- if (++next_in == queue.length)
- next_in = 0;
-
- if (next_in == next_out)
- {
- /* Queue is full. Extend it. */
- AWTEvent[] oldQueue = queue;
- queue = new AWTEvent[queue.length * 2];
-
- int len = oldQueue.length - next_out;
- System.arraycopy(oldQueue, next_out, queue, 0, len);
- if (next_out != 0)
- System.arraycopy(oldQueue, 0, queue, len, next_out);
-
- next_out = 0;
- next_in = oldQueue.length;
- }
-
- if (dispatchThread == null || !dispatchThread.isAlive())
- {
- dispatchThread = new EventDispatchThread(this);
- dispatchThread.start();
- }
-
- // Window events might represent the closing of a window, which
- // might cause the end of the dispatch thread's life, so we'll wake
- // it up here to give it a chance to check for shutdown.
-
- if (!isDispatchThread()
- || (evt.getID() == WindowEvent.WINDOW_CLOSED)
- || (evt.getID() == WindowEvent.WINDOW_CLOSING))
- ((ClasspathToolkit) Toolkit.getDefaultToolkit()).wakeNativeQueue();
-
- notify();
- }
-
- /**
- * Causes runnable to have its run method called in the dispatch thread of the
- * EventQueue. This will happen after all pending events are processed. The
- * call blocks until this has happened. This method will throw an Error if
- * called from the event dispatcher thread.
- *
- * @exception InterruptedException If another thread has interrupted
- * this thread.
- * @exception InvocationTargetException If an exception is thrown when running
- * runnable.
- *
- * @since 1.2
- */
- public static void invokeAndWait(Runnable runnable)
- throws InterruptedException, InvocationTargetException
- {
- if (isDispatchThread ())
- throw new Error("Can't call invokeAndWait from event dispatch thread");
-
- EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
- Thread current = Thread.currentThread();
-
- InvocationEvent ie =
- new InvocationEvent(eq, runnable, current, true);
-
- synchronized (current)
- {
- eq.postEvent(ie);
- current.wait();
- }
-
- Exception exception;
-
- if ((exception = ie.getException()) != null)
- throw new InvocationTargetException(exception);
- }
-
- /**
- * This arranges for runnable to have its run method called in the
- * dispatch thread of the EventQueue. This will happen after all
- * pending events are processed.
- *
- * @since 1.2
- */
- public static void invokeLater(Runnable runnable)
- {
- EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
-
- InvocationEvent ie =
- new InvocationEvent(eq, runnable, null, false);
-
- eq.postEvent(ie);
- }
-
- /**
- * Return true if the current thread is the current AWT event dispatch
- * thread.
- */
- public static boolean isDispatchThread()
- {
- EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
-
- /* Find last EventQueue in chain */
- while (eq.next != null)
- eq = eq.next;
-
- return (Thread.currentThread() == eq.dispatchThread);
- }
-
- /**
- * Return the event currently being dispatched by the event
- * dispatch thread. If the current thread is not the event
- * dispatch thread, this method returns null.
- *
- * @since 1.4
- */
- public static AWTEvent getCurrentEvent()
- {
- EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
- Thread ct = Thread.currentThread();
-
- /* Find out if this thread is the dispatch thread for any of the
- EventQueues in the chain */
- while (ct != eq.dispatchThread)
- {
- // Try next EventQueue, if any
- if (eq.next == null)
- return null; // Not an event dispatch thread
- eq = eq.next;
- }
-
- return eq.currentEvent;
- }
-
- /**
- * Allows a custom EventQueue implementation to replace this one.
- * All pending events are transferred to the new queue. Calls to postEvent,
- * getNextEvent, and peekEvent and others are forwarded to the pushed queue
- * until it is removed with a pop().
- *
- * @exception NullPointerException if newEventQueue is null.
- */
- public synchronized void push(EventQueue newEventQueue)
- {
- if (newEventQueue == null)
- throw new NullPointerException ();
-
- /* Make sure we are at the top of the stack because callers can
- only get a reference to the one at the bottom using
- Toolkit.getDefaultToolkit().getSystemEventQueue() */
- if (next != null)
- {
- next.push (newEventQueue);
- return;
- }
-
- /* Make sure we have a live dispatch thread to drive the queue */
- if (dispatchThread == null)
- dispatchThread = new EventDispatchThread(this);
-
- int i = next_out;
- while (i != next_in)
- {
- newEventQueue.postEvent(queue[i]);
- next_out = i;
- if (++i == queue.length)
- i = 0;
- }
-
- next = newEventQueue;
- newEventQueue.prev = this;
- }
-
- /** Transfer any pending events from this queue back to the parent queue that
- * was previously push()ed. Event dispatch from this queue is suspended.
- *
- * @exception EmptyStackException If no previous push was made on this
- * EventQueue.
- */
- protected void pop() throws EmptyStackException
- {
- if (prev == null)
- throw new EmptyStackException();
-
- /* The order is important here, we must get the prev lock first,
- or deadlock could occur as callers usually get here following
- prev's next pointer, and thus obtain prev's lock before trying
- to get this lock. */
- synchronized (prev)
- {
- prev.next = next;
- if (next != null)
- next.prev = prev;
-
- synchronized (this)
- {
- int i = next_out;
- while (i != next_in)
- {
- prev.postEvent(queue[i]);
- next_out = i;
- if (++i == queue.length)
- i = 0;
- }
- // Empty the queue so it can be reused
- next_in = 0;
- next_out = 0;
-
- ((ClasspathToolkit) Toolkit.getDefaultToolkit()).wakeNativeQueue();
- setShutdown(true);
- dispatchThread = null;
- this.notifyAll();
- }
- }
- }
-
- /**
- * Dispatches an event. The manner in which the event is dispatched depends
- * upon the type of the event and the type of the event's source object.
- *
- * @exception NullPointerException If event is null.
- */
- protected void dispatchEvent(AWTEvent evt)
- {
- currentEvent = evt;
-
- if (evt instanceof InputEvent)
- lastWhen = ((InputEvent) evt).getWhen();
- else if (evt instanceof ActionEvent)
- lastWhen = ((ActionEvent) evt).getWhen();
- else if (evt instanceof InvocationEvent)
- lastWhen = ((InvocationEvent) evt).getWhen();
-
- if (evt instanceof ActiveEvent)
- {
- ActiveEvent active_evt = (ActiveEvent) evt;
- active_evt.dispatch();
- }
- else
- {
- Object source = evt.getSource();
-
- if (source instanceof Component)
- {
- Component srccmp = (Component) source;
- srccmp.dispatchEvent(evt);
- }
- else if (source instanceof MenuComponent)
- {
- MenuComponent srccmp = (MenuComponent) source;
- srccmp.dispatchEvent(evt);
- }
- }
- }
-
- /**
- * Returns the timestamp of the most recent event that had a timestamp, or
- * the initialization time of the event queue if no events have been fired.
- * At present, only <code>InputEvent</code>s, <code>ActionEvent</code>s,
- * <code>InputMethodEvent</code>s, and <code>InvocationEvent</code>s have
- * timestamps, but this may be added to other events in future versions.
- * If this is called by the event dispatching thread, it can be any
- * (sequential) value, but to other threads, the safest bet is to return
- * System.currentTimeMillis().
- *
- * @return the most recent timestamp
- * @see InputEvent#getWhen()
- * @see ActionEvent#getWhen()
- * @see InvocationEvent#getWhen()
- * @see InputMethodEvent#getWhen()
- * @since 1.4
- */
- public static long getMostRecentEventTime()
- {
- EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
- if (Thread.currentThread() != eq.dispatchThread)
- return System.currentTimeMillis();
- return eq.lastWhen;
- }
-}
diff --git a/libjava/java/awt/FileDialog.java b/libjava/java/awt/FileDialog.java
deleted file mode 100644
index 7f2723e7e9a..00000000000
--- a/libjava/java/awt/FileDialog.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/* FileDialog.java -- A filename selection dialog box
- Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.peer.FileDialogPeer;
-import java.io.FilenameFilter;
-import java.io.Serializable;
-
-/**
- * This class implements a file selection dialog box widget.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@redhat.com)
- */
-public class FileDialog extends Dialog implements Serializable
-{
-
-/*
- * Static Variables
- */
-
-/**
- * Indicates that the purpose of the dialog is for opening a file.
- */
-public static final int LOAD = 0;
-
-/**
- * Indicates that the purpose of the dialog is for saving a file.
- */
-public static final int SAVE = 1;
-
-// Serialization constant
-private static final long serialVersionUID = 5035145889651310422L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The directory for this file dialog.
- */
-private String dir;
-
-/**
- * @serial The filename for this file dialog
- */
-private String file;
-
-/**
- * @serial The filter for selecting filenames to display
- */
-private FilenameFilter filter;
-
-/**
- * @serial The mode of this dialog, either <code>LOAD</code> or
- * <code>SAVE</code>.
- */
-private int mode;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>FileDialog</code> with the
- * specified parent. This dialog will have no title and will be for
- * loading a file.
- *
- * @param parent The parent frame for this dialog.
- */
-public
-FileDialog(Frame parent)
-{
- this(parent, "", LOAD);
-}
-
-/*************************************************************************/
-
-/**
- * Initialized a new instance of <code>FileDialog</code> with the
- * specified parent and title. This dialog will be for opening a file.
- *
- * @param parent The parent frame for this dialog.
- * @param title The title for this dialog.
- */
-public
-FileDialog(Frame parent, String title)
-{
- this(parent, title, LOAD);
-}
-
-/*************************************************************************/
-
-/**
- * Initialized a new instance of <code>FileDialog</code> with the
- * specified parent, title, and mode.
- *
- * @param parent The parent frame for this dialog.
- * @param title The title for this dialog.
- * @param mode The mode of the dialog, either <code>LOAD</code> or
- * <code>SAVE</code>.
- *
- * @exception IllegalArgumentException If an illegal file dialog mode
- * is supplied.
- */
-public
-FileDialog(Frame parent, String title, int mode)
-{
- super(parent, title, true);
-
- if ((mode != LOAD) && (mode != SAVE))
- throw new IllegalArgumentException (
- "Mode argument must be either LOAD or SAVE");
-
- setMode (mode);
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the mode of this dialog, either <code>LOAD</code> or
- * <code>SAVE</code>.
- *
- * @return The mode of this dialog.
- */
-public int
-getMode()
-{
- return(mode);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the mode of this dialog to either <code>LOAD</code> or
- * <code>SAVE</code>. This method is only effective before the native
- * peer is created.
- *
- * @param mode The new mode of this file dialog.
- *
- * @exception IllegalArgumentException If an illegal file dialog mode
- * is supplied.
- */
-public void
-setMode(int mode)
-{
- if ((mode != LOAD) && (mode != SAVE))
- throw new IllegalArgumentException("Bad mode: " + mode);
-
- this.mode = mode;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the directory for this file dialog.
- *
- * @return The directory for this file dialog.
- */
-public String
-getDirectory()
-{
- return(dir);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the directory for this file dialog.
- *
- * @param dir The new directory for this file dialog.
- */
-public synchronized void
-setDirectory(String dir)
-{
- this.dir = dir;
- if (peer != null)
- {
- FileDialogPeer f = (FileDialogPeer) peer;
- f.setDirectory (dir);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns the file that is selected in this dialog.
- *
- * @return The file that is selected in this dialog.
- */
-public String
-getFile()
-{
- return(file);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the selected file for this dialog.
- *
- * @param file The selected file for this dialog.
- */
-public synchronized void
-setFile(String file)
-{
- this.file = file;
- if (peer != null)
- {
- FileDialogPeer f = (FileDialogPeer) peer;
- f.setFile (file);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns the filename filter being used by this dialog.
- *
- * @return The filename filter being used by this dialog.
- */
-public FilenameFilter
-getFilenameFilter()
-{
- return(filter);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the filename filter used by this dialog.
- *
- * @param filter The new filename filter for this file dialog box.
- */
-public synchronized void
-setFilenameFilter(FilenameFilter filter)
-{
- this.filter = filter;
- if (peer != null)
- {
- FileDialogPeer f = (FileDialogPeer) peer;
- f.setFilenameFilter (filter);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Creates the native peer for this file dialog box.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createFileDialog (this);
- super.addNotify ();
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this object.
- *
- * @return A debugging string for this object.
- */
-protected String
-paramString()
-{
- return ("dir=" + dir + ",file=" + file +
- ",mode=" + mode + "," + super.paramString());
-}
-
-} // class FileDialog
-
diff --git a/libjava/java/awt/FlowLayout.java b/libjava/java/awt/FlowLayout.java
deleted file mode 100644
index 4674990ac52..00000000000
--- a/libjava/java/awt/FlowLayout.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/* FlowLayout.java -- Grid-based layout engine
- Copyright (C) 1999, 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.io.Serializable;
-
-/** This class implements a flow-based layout. Components are laid
- * out in order from left to right. When a component cannot be placed
- * without horizontal clipping, a new row is started. This class
- * supports horizontal and vertical gaps. These are used for spacing
- * between components.
- *
- * @author Tom Tromey (tromey@redhat.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class FlowLayout implements LayoutManager, Serializable
-{
- /** Constant that specifies left alignment. */
- public static final int LEFT = 0;
- /** Constant that specifies center alignment. */
- public static final int CENTER = 1;
- /** Constant that specifies right alignment. */
- public static final int RIGHT = 2;
-
- /** Constant that specifies alignment to leading edge of container's
- * orientation. */
- public static final int LEADING = 3;
- /** Constant that specifies alignment to trailing edge of container's
- * orientation. */
- public static final int TRAILING = 4;
-
- // Serialization constant
- private static final long serialVersionUID = -7262534875583282631L;
-
- /**
- * Add a new component to the layout. This particular implementation
- * does nothing.
- *
- * @param name the name
- * @param comp the component
- */
- public void addLayoutComponent (String name, Component comp)
- {
- // Nothing.
- }
-
- /**
- * Returns the current justification value for this object.
- *
- * @return The current justification value for this object.
- */
- public int getAlignment ()
- {
- return align;
- }
-
- /**
- * Returns the horizontal gap between components.
- *
- * @return The horizontal gap between components.
- */
- public int getHgap ()
- {
- return hgap;
- }
-
- /**
- * Returns the vertical gap between lines of components.
- *
- * @return The vertical gap between lines of components.
- */
- public int getVgap ()
- {
- return vgap;
- }
-
- /**
- * Initializes a new instance of <code>FlowLayout</code> with a center
- * justification and a default horizontal and vertical gap of 5.
- */
- public FlowLayout ()
- {
- this (CENTER, 5, 5);
- }
-
- /**
- * Initializes a new instance of <code>FlowLayout</code> with the specified
- * justification and a default horizontal and vertical gap of 5.
- *
- * @param align The justification setting, which should be one of the
- * contants in this class.
- */
- public FlowLayout (int align)
- {
- this (align, 5, 5);
- }
-
- /**
- * Initializes a new instance of <code>FlowLayout</code> with the specified
- * justification and gap values
- * @param align Alignment
- * @param hgap The horizontal gap
- * @param vgap The vertical gap
- * @exception IllegalArgumentException If either gap is negative
- */
- public FlowLayout (int align, int hgap, int vgap)
- {
- // Use methods to set fields so that we can have all the checking
- // in one place.
- setVgap (vgap);
- setHgap (hgap);
- setAlignment (align);
- }
-
- /** Lay out the container's components based on current settings.
- * @param parent The parent container
- */
- public void layoutContainer (Container parent)
- {
- synchronized (parent.getTreeLock ())
- {
- int num = parent.getComponentCount ();
- // This is more efficient than calling getComponents().
- Component[] comps = parent.component;
-
- Dimension d = parent.getSize ();
- Insets ins = parent.getInsets ();
-
- ComponentOrientation orient = parent.getComponentOrientation ();
- boolean left_to_right = orient.isLeftToRight ();
-
- int y = ins.top + vgap;
- int i = 0;
- while (i < num)
- {
- // Find the components which go in the current row.
- int new_w = ins.left + hgap + ins.right;
- int new_h = 0;
- int j;
- boolean found_one = false;
- for (j = i; j < num; ++j)
- {
- // Skip invisible items.
- if (! comps[j].visible)
- continue;
-
- Dimension c = comps[j].getPreferredSize ();
-
- int next_w = new_w + hgap + c.width;
- if (next_w <= d.width || ! found_one)
- {
- new_w = next_w;
- new_h = Math.max (new_h, c.height);
- found_one = true;
- }
- else
- {
- // Must start a new row, and we already found an item
- break;
- }
- }
-
- // Set the location of each component for this row.
- int x;
-
- int myalign = align;
- if (align == LEADING)
- myalign = left_to_right ? LEFT : RIGHT;
- else if (align == TRAILING)
- myalign = left_to_right ? RIGHT : LEFT;
-
- if (myalign == LEFT)
- x = ins.left + hgap;
- else if (myalign == CENTER)
- x = ins.left + (d.width - new_w) / 2 + hgap;
- else
- x = ins.left + (d.width - new_w) + hgap;
-
- for (int k = i; k < j; ++k)
- {
- if (comps[k].visible)
- {
- Dimension c = comps[k].getPreferredSize ();
- comps[k].setBounds (x, y + (new_h - c.height) / 2,
- c.width, c.height);
- x += c.width + hgap;
- }
- }
-
- // Advance to next row.
- i = j;
- y += new_h + vgap;
- }
- }
- }
-
- /**
- * Returns the minimum layout size for the specified container using
- * this layout.
- * @param cont The parent container
- * @return The minimum layout size.
- */
- public Dimension minimumLayoutSize (Container cont)
- {
- return getSize (cont, true);
- }
-
- /**
- * Returns the preferred layout size for the specified container using
- * this layout.
- * @param cont The parent container
- * @return The preferred layout size.
- */
- public Dimension preferredLayoutSize (Container cont)
- {
- return getSize (cont, false);
- }
-
- /** Remove the indicated component from this layout manager.
- * This particular implementation does nothing.
- * @param comp The component to remove
- */
- public void removeLayoutComponent (Component comp)
- {
- // Nothing.
- }
-
- /**
- * Sets the justification value for this object to the specified value.
- *
- * @param align The new justification value for this object, which must
- * be one of the constants in this class.
- */
- public void setAlignment (int align)
- {
- if (align != LEFT && align != RIGHT && align != CENTER
- && align != LEADING && align != TRAILING)
- throw new IllegalArgumentException ("invalid alignment: " + align);
- this.align = align;
- }
-
- /**
- * Sets the horizontal gap between components to the specified value.
- *
- * @param hgap The new horizontal gap between components.
- */
- public void setHgap (int hgap)
- {
- if (hgap < 0)
- throw new IllegalArgumentException ("horizontal gap must be nonnegative");
- this.hgap = hgap;
- }
-
- /**
- * Sets the vertical gap between lines of components to the specified value.
- *
- * @param vgap The new vertical gap.
- */
- public void setVgap (int vgap)
- {
- if (vgap < 0)
- throw new IllegalArgumentException ("vertical gap must be nonnegative");
- this.vgap = vgap;
- }
-
- /** Return String description of this object.
- * @return A string representation of this object.
- */
- public String toString ()
- {
- return ("[" + getClass ().getName () + ",hgap=" + hgap + ",vgap=" + vgap
- + ",align=" + align + "]");
- }
-
- // This method is used to compute the various sizes.
- private Dimension getSize (Container parent, boolean is_min)
- {
- synchronized (parent.getTreeLock ())
- {
- int w, h, num = parent.getComponentCount ();
- // This is more efficient than calling getComponents().
- Component[] comps = parent.component;
-
- w = 0;
- h = 0;
- for (int i = 0; i < num; ++i)
- {
- if (! comps[i].visible)
- continue;
-
- // FIXME: can we just directly read the fields in Component?
- // Or will that not work with subclassing?
- Dimension d;
-
- if (is_min)
- d = comps[i].getMinimumSize ();
- else
- d = comps[i].getPreferredSize ();
-
- w += d.width;
- h = Math.max (d.height, h);
- }
-
- Insets ins = parent.getInsets ();
-
- w += (num + 1) * hgap + ins.left + ins.right;
- h += 2 * vgap + ins.top + ins.bottom;
-
- return new Dimension (w, h);
- }
- }
-
- /**
- * @serial The justification alignment of the lines of components, which
- * will be one of the constants defined in this class.
- */
- private int align;
-
- /**
- * @serial The horizontal gap between components.
- */
- private int hgap;
-
- /**
- * @serial The vertical gap between lines of components.
- */
- private int vgap;
-}
diff --git a/libjava/java/awt/FocusTraversalPolicy.java b/libjava/java/awt/FocusTraversalPolicy.java
deleted file mode 100644
index a7f1558dde9..00000000000
--- a/libjava/java/awt/FocusTraversalPolicy.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* FocusTraversalPolicy.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * @since 1.4
- */
-public abstract class FocusTraversalPolicy
-{
- /**
- * Creates a <code>FocusTraversalPolicy</code> object.
- */
- public FocusTraversalPolicy()
- {
- // Do nothing in here.
- }
-
- /**
- * Returns the Component that should receive the focus after a Component.
- *
- * @exception IllegalArgumentException If root or current is null,
- * or if root is not a focus cycle root of current.
- */
- public abstract Component getComponentAfter(Container root,
- Component current);
-
- /**
- * Returns the Component that should receive the focus before a Component.
- *
- * @exception IllegalArgumentException If root or current is null,
- * or if root is not a focus cycle root of current.
- */
- public abstract Component getComponentBefore(Container root,
- Component current);
-
- /**
- * Returns the first Component in the traversal cycle.
- *
- * @exception IllegalArgumentException If root is null.
- */
- public abstract Component getFirstComponent(Container root);
-
- /**
- * Returns the last Component in the traversal cycle.
- *
- * @exception IllegalArgumentException If root is null.
- */
- public abstract Component getLastComponent(Container root);
-
- /**
- * Returns the default Component to focus.
- *
- * @exception IllegalArgumentException If root is null.
- */
- public abstract Component getDefaultComponent(Container root);
-
- /**
- * Returns the Component that should receive the focus when a Window is made
- * visible for the first time.
- *
- * @exception IllegalArgumentException If window is null.
- */
- public Component getInitialComponent(Window window)
- {
- return getDefaultComponent(window);
- }
-} // class FocusTraversalPolicy
diff --git a/libjava/java/awt/Font.java b/libjava/java/awt/Font.java
deleted file mode 100644
index f6833484474..00000000000
--- a/libjava/java/awt/Font.java
+++ /dev/null
@@ -1,1335 +0,0 @@
-/* Font.java -- Font object
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import gnu.java.awt.ClasspathToolkit;
-import gnu.java.awt.peer.ClasspathFontPeer;
-
-import java.awt.font.FontRenderContext;
-import java.awt.font.GlyphVector;
-import java.awt.font.LineMetrics;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-import java.awt.peer.FontPeer;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.text.AttributedCharacterIterator;
-import java.text.CharacterIterator;
-import java.text.StringCharacterIterator;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-/**
- * This class represents a windowing system font.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Graydon Hoare (graydon@redhat.com)
- */
-public class Font implements Serializable
-{
-
-/*
- * Static Variables
- */
-
-/**
- * Constant indicating a "plain" font.
- */
-public static final int PLAIN = 0;
-
-/**
- * Constant indicating a "bold" font.
- */
-public static final int BOLD = 1;
-
-/**
- * Constant indicating an "italic" font.
- */
-public static final int ITALIC = 2;
-
-/**
- * Constant indicating the baseline mode characteristic of Roman.
- */
-public static final int ROMAN_BASELINE = 0;
-
-/**
- * Constant indicating the baseline mode characteristic of Chinese.
- */
-public static final int CENTER_BASELINE = 1;
-
-/**
- * Constant indicating the baseline mode characteristic of Devanigri.
- */
-public static final int HANGING_BASELINE = 2;
-
-
- /**
- * Indicates to <code>createFont</code> that the supplied font data
- * is in TrueType format.
- *
- * <p><em>Specification Note:</em> The Sun JavaDoc for J2SE 1.4 does
- * not indicate whether this value also subsumes OpenType. OpenType
- * is essentially the same format as TrueType, but allows to define
- * glyph shapes in the same way as PostScript, using cubic bezier
- * curves.
- *
- * @since 1.3
- */
- public static final int TRUETYPE_FONT = 0;
-
-
- /**
- * A flag for <code>layoutGlyphVector</code>, indicating that the
- * orientation of a text run is from left to right.
- *
- * @since 1.4
- */
- public static final int LAYOUT_LEFT_TO_RIGHT = 0;
-
-
- /**
- * A flag for <code>layoutGlyphVector</code>, indicating that the
- * orientation of a text run is from right to left.
- *
- * @since 1.4
- */
- public static final int LAYOUT_RIGHT_TO_LEFT = 1;
-
-
- /**
- * A flag for <code>layoutGlyphVector</code>, indicating that the
- * text does not contain valid characters before the
- * <code>start</code> position. If this flag is set,
- * <code>layoutGlyphVector</code> does not examine the text before
- * <code>start</code>, even if this would be necessary to select the
- * correct glyphs (e.g., for Arabic text).
- *
- * @since 1.4
- */
- public static final int LAYOUT_NO_START_CONTEXT = 2;
-
-
- /**
- * A flag for <code>layoutGlyphVector</code>, indicating that the
- * text does not contain valid characters after the
- * <code>limit</code> position. If this flag is set,
- * <code>layoutGlyphVector</code> does not examine the text after
- * <code>limit</code>, even if this would be necessary to select the
- * correct glyphs (e.g., for Arabic text).
- *
- * @since 1.4
- */
- public static final int LAYOUT_NO_LIMIT_CONTEXT = 4;
-
- /**
- * The logical name of this font.
- *
- * @since 1.0
- */
- protected String name;
-
- /**
- * The size of this font in pixels.
- *
- * @since 1.0
- */
- protected int size;
-
- /**
- * The style of this font -- PLAIN, BOLD, ITALIC or BOLD+ITALIC.
- *
- * @since 1.0
- */
- protected int style;
-
-// Serialization constant
-private static final long serialVersionUID = -4206021311591459213L;
-
-
- // The ClasspathToolkit-provided peer which implements this font
- private ClasspathFontPeer peer;
-
-/*************************************************************************/
-
-/*
- * Static Methods
- */
-
-/**
- * Creates a <code>Font</code> object from the specified string, which
- * is in one of the following formats:
- * <p>
- * <ul>
- * <li>fontname-style-pointsize
- * <li>fontname-style
- * <li>fontname-pointsize
- * <li>fontname
- * </ul>
- * <p>
- * The style should be one of BOLD, ITALIC, or BOLDITALIC. The default
- * style if none is specified is PLAIN. The default size if none
- * is specified is 12.
- *
- * @param fontspec a string specifying the required font (<code>null</code>
- * permitted, interpreted as 'Dialog-PLAIN-12').
- *
- * @return A font.
- */
- public static Font decode (String fontspec)
-{
- if (fontspec == null)
- fontspec = "Dialog-PLAIN-12";
- String name = null;
- int style = PLAIN;
- int size = 12;
-
- StringTokenizer st = new StringTokenizer(fontspec, "- ");
- while (st.hasMoreTokens())
- {
- String token = st.nextToken();
- if (name == null)
- {
- name = token;
- continue;
- }
-
- if (token.toUpperCase().equals("BOLD"))
- {
- style = BOLD;
- continue;
- }
- if (token.toUpperCase().equals("ITALIC"))
- {
- style = ITALIC;
- continue;
- }
- if (token.toUpperCase().equals("BOLDITALIC"))
- {
- style = BOLD | ITALIC;
- continue;
- }
-
- int tokenval = 0;
- try
- {
- tokenval = Integer.parseInt(token);
- }
- catch(NumberFormatException e)
- {
- // Ignored.
- }
-
- if (tokenval != 0)
- size = tokenval;
- }
-
- HashMap attrs = new HashMap();
- ClasspathFontPeer.copyStyleToAttrs (style, attrs);
- ClasspathFontPeer.copySizeToAttrs (size, attrs);
-
- return getFontFromToolkit (name, attrs);
-}
-
- /* These methods delegate to the toolkit. */
-
- protected static ClasspathToolkit tk ()
- {
- return (ClasspathToolkit)(Toolkit.getDefaultToolkit ());
- }
-
- /* Every factory method in Font should eventually call this. */
- protected static Font getFontFromToolkit (String name, Map attribs)
- {
- return tk ().getFont (name, attribs);
- }
-
- /* Every Font constructor should eventually call this. */
- protected static ClasspathFontPeer getPeerFromToolkit (String name, Map attrs)
- {
- return tk ().getClasspathFontPeer (name, attrs);
- }
-
-
-/*************************************************************************/
-
-/**
- * Returns a <code>Font</code> object from the passed property name.
- *
- * @param propname The name of the system property.
- * @param defval Value to use if the property is not found.
- *
- * @return The requested font, or <code>default</code> if the property
- * not exist or is malformed.
- */
- public static Font getFont (String propname, Font defval)
-{
- String propval = System.getProperty(propname);
- if (propval != null)
- return decode (propval);
- return defval;
-}
-
-/*************************************************************************/
-
-/**
- * Returns a <code>Font</code> object from the passed property name.
- *
- * @param propname The name of the system property.
- *
- * @return The requested font, or <code>null</code> if the property
- * not exist or is malformed.
- */
- public static Font getFont (String propname)
-{
- return getFont (propname, (Font)null);
-}
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>Font</code> with the specified
- * attributes.
- *
- * @param name The name of the font.
- * @param style The font style.
- * @param size The font point size.
- */
-
- public Font (String name, int style, int size)
- {
- HashMap attrs = new HashMap();
- ClasspathFontPeer.copyStyleToAttrs (style, attrs);
- ClasspathFontPeer.copySizeToAttrs (size, attrs);
- this.peer = getPeerFromToolkit (name, attrs);
- }
-
- public Font (Map attrs)
- {
- this(null, attrs);
- }
-
- /* This extra constructor is here to permit ClasspathToolkit and to build
- a font with a "logical name" as well as attrs. */
- public Font (String name, Map attrs)
- {
- // If attrs is null, setting it to an empty HashMap will give this
- // Font default attributes.
- if (attrs == null)
- attrs = new HashMap();
- this.peer = getPeerFromToolkit (name, attrs);
- }
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the logical name of the font. A logical name is the name the
- * font was constructed with. It may be the name of a logical font (one
- * of 6 required names in all java environments) or it may be a face
- * name.
- *
- * @return The logical name of the font.
- *
- * @see getFamily()
- * @see getFontName()
- */
- public String getName ()
-{
- return peer.getName (this);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the style of the font.
- *
- * @return The font style.
- */
- public int getSize ()
-{
- return (int) peer.getSize (this);
-}
-
- public float getSize2D ()
-{
- return peer.getSize (this);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this is a plain font. This will be true if
- * and only if neither the bold nor the italics style is set.
- *
- * @return <code>true</code> if this is a plain font, <code>false</code>
- * otherwise.
- */
- public boolean isPlain ()
-{
- return peer.isPlain (this);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this font is bold.
- *
- * @return <code>true</code> if this font is bold, <code>false</code>
- * otherwise.
- */
- public boolean isBold ()
-{
- return peer.isBold (this);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this font is italic.
- *
- * @return <code>true</code> if this font is italic, <code>false</code>
- * otherwise.
- */
- public boolean isItalic ()
-{
- return peer.isItalic (this);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the family name of this font. A family name describes a design
- * or "brand name" (such as Helvetica or Palatino). It is less specific
- * than a font face name (such as Helvetica Bold).
- *
- * @return A string containing the font family name.
- *
- * @since 1.2
- *
- * @see getName()
- * @see getFontName()
- * @see GraphicsEnvironment.getAvailableFontFamilyNames()
- */
- public String getFamily ()
-{
- return peer.getFamily (this);
-}
-
-/**
- * Returns integer code representing the sum of style flags of this font, a
- * combination of either {@link PLAIN}, {@link BOLD}, or {@link ITALIC}.
- *
- * @return code representing the style of this font.
- *
- * @see isPlain()
- * @see isBold()
- * @see isItalic()
- */
- public int getStyle ()
-{
- return peer.getStyle (this);
-}
-
-/**
- * Checks if specified character maps to a glyph in this font.
- *
- * @param c The character to check.
- *
- * @return Whether the character has a corresponding glyph in this font.
- *
- * @since 1.2
- */
- public boolean canDisplay (char c)
-{
- return peer.canDisplay (this, c);
-}
-
-/**
- * Checks how much of a given string can be mapped to glyphs in
- * this font.
- *
- * @param s The string to check.
- *
- * @return The index of the first character in <code>s</code> which cannot
- * be converted to a glyph by this font, or <code>-1</code> if all
- * characters can be mapped to glyphs.
- *
- * @since 1.2
- */
- public int canDisplayUpTo (String s)
-{
- return peer.canDisplayUpTo (this, new StringCharacterIterator (s),
- 0, s.length () - 1);
-}
-
-/**
- * Checks how much of a given sequence of text can be mapped to glyphs in
- * this font.
- *
- * @param text Array containing the text to check.
- * @param start Position of first character to check in <code>text</code>.
- * @param limit Position of last character to check in <code>text</code>.
- *
- * @return The index of the first character in the indicated range which
- * cannot be converted to a glyph by this font, or <code>-1</code> if all
- * characters can be mapped to glyphs.
- *
- * @since 1.2
- *
- * @throws IndexOutOfBoundsException if the range [start, limit] is
- * invalid in <code>text</code>.
- */
- public int canDisplayUpTo (char[] text, int start, int limit)
-{
- return peer.canDisplayUpTo
- (this, new StringCharacterIterator (new String (text)), start, limit);
-}
-
-/**
- * Checks how much of a given sequence of text can be mapped to glyphs in
- * this font.
- *
- * @param i Iterator over the text to check.
- * @param start Position of first character to check in <code>i</code>.
- * @param limit Position of last character to check in <code>i</code>.
- *
- * @return The index of the first character in the indicated range which
- * cannot be converted to a glyph by this font, or <code>-1</code> if all
- * characters can be mapped to glyphs.
- *
- * @since 1.2
- *
- * @throws IndexOutOfBoundsException if the range [start, limit] is
- * invalid in <code>i</code>.
- */
- public int canDisplayUpTo (CharacterIterator i, int start, int limit)
-{
- return peer.canDisplayUpTo (this, i, start, limit);
-}
-
-/**
- * Creates a new font with point size 1 and {@link PLAIN} style,
- * reading font data from the provided input stream. The resulting font
- * can have further fonts derived from it using its
- * <code>deriveFont</code> method.
- *
- * @param fontFormat Integer code indicating the format the font data is
- * in.Currently this can only be {@link TRUETYPE_FONT}.
- * @param is {@link InputStream} from which font data will be read. This
- * stream is not closed after font data is extracted.
- *
- * @return A new {@link Font} of the format indicated.
- *
- * @throws IllegalArgumentException if <code>fontType</code> is not
- * recognized.
- * @throws FontFormatException if data in InputStream is not of format
- * indicated.
- * @throws IOException if insufficient data is present on InputStream.
- *
- * @since 1.3
- */
- public static Font createFont (int fontFormat, InputStream is)
- throws FontFormatException, IOException
-{
- return tk().createFont (fontFormat, is);
-}
-
-/**
- * Maps characters to glyphs in a one-to-one relationship, returning a new
- * {@link GlyphVector} with a mapped glyph for each input character. This
- * sort of mapping is often sufficient for some scripts such as Roman, but
- * is inappropriate for scripts with special shaping or contextual layout
- * requirements such as Arabic, Indic, Hebrew or Thai.
- *
- * @param ctx The rendering context used for precise glyph placement.
- * @param str The string to convert to Glyphs.
- *
- * @return A new {@link GlyphVector} containing glyphs mapped from str,
- * through the font's cmap table.
- *
- * @see layoutGlyphVector()
- */
- public GlyphVector createGlyphVector (FontRenderContext ctx, String str)
-{
- return peer.createGlyphVector (this, ctx, new StringCharacterIterator (str));
-}
-
-/**
- * Maps characters to glyphs in a one-to-one relationship, returning a new
- * {@link GlyphVector} with a mapped glyph for each input character. This
- * sort of mapping is often sufficient for some scripts such as Roman, but
- * is inappropriate for scripts with special shaping or contextual layout
- * requirements such as Arabic, Indic, Hebrew or Thai.
- *
- * @param ctx The rendering context used for precise glyph placement.
- * @param i Iterator over the text to convert to glyphs.
- *
- * @return A new {@link GlyphVector} containing glyphs mapped from str,
- * through the font's cmap table.
- *
- * @see layoutGlyphVector()
- */
- public GlyphVector createGlyphVector (FontRenderContext ctx, CharacterIterator i)
-{
- return peer.createGlyphVector (this, ctx, i);
-}
-
-/**
- * Maps characters to glyphs in a one-to-one relationship, returning a new
- * {@link GlyphVector} with a mapped glyph for each input character. This
- * sort of mapping is often sufficient for some scripts such as Roman, but
- * is inappropriate for scripts with special shaping or contextual layout
- * requirements such as Arabic, Indic, Hebrew or Thai.
- *
- * @param ctx The rendering context used for precise glyph placement.
- * @param chars Array of characters to convert to glyphs.
- *
- * @return A new {@link GlyphVector} containing glyphs mapped from str,
- * through the font's cmap table.
- *
- * @see layoutGlyphVector()
- */
- public GlyphVector createGlyphVector (FontRenderContext ctx, char[] chars)
-{
- return peer.createGlyphVector
- (this, ctx, new StringCharacterIterator (new String (chars)));
-}
-
-/**
- * Extracts a sequence of glyphs from a font, returning a new {@link
- * GlyphVector} with a mapped glyph for each input glyph code.
- *
- * @param ctx The rendering context used for precise glyph placement.
- * @param glyphCodes Array of characters to convert to glyphs.
- *
- * @return A new {@link GlyphVector} containing glyphs mapped from str,
- * through the font's cmap table.
- *
- * @see layoutGlyphVector()
- *
- * @specnote This method is documented to perform character-to-glyph
- * conversions, in the Sun documentation, but its second parameter name is
- * "glyphCodes" and it is not clear to me why it would exist if its
- * purpose was to transport character codes inside integers. I assume it
- * is mis-documented in the Sun documentation.
- */
-
- public GlyphVector createGlyphVector (FontRenderContext ctx, int[] glyphCodes)
-{
- return peer.createGlyphVector (this, ctx, glyphCodes);
-}
-
-/**
- * Produces a new {@link Font} based on the current font, adjusted to a
- * new size and style.
- *
- * @param style The style of the newly created font.
- * @param size The size of the newly created font.
- *
- * @return A clone of the current font, with the specified size and style.
- *
- * @since 1.2
- */
- public Font deriveFont (int style, float size)
-{
- return peer.deriveFont (this, style, size);
-}
-
-/**
- * Produces a new {@link Font} based on the current font, adjusted to a
- * new size.
- *
- * @param size The size of the newly created font.
- *
- * @return A clone of the current font, with the specified size.
- *
- * @since 1.2
- */
- public Font deriveFont (float size)
-{
- return peer.deriveFont (this, size);
-}
-
-/**
- * Produces a new {@link Font} based on the current font, adjusted to a
- * new style.
- *
- * @param style The style of the newly created font.
- *
- * @return A clone of the current font, with the specified style.
- *
- * @since 1.2
- */
- public Font deriveFont (int style)
-{
- return peer.deriveFont (this, style);
-}
-
-/**
- * Produces a new {@link Font} based on the current font, adjusted to a
- * new style and subjected to a new affine transformation.
- *
- * @param style The style of the newly created font.
- * @param a The transformation to apply.
- *
- * @return A clone of the current font, with the specified style and
- * transform.
- *
- * @throws IllegalArgumentException If transformation is
- * <code>null</code>.
- *
- * @since 1.2
- */
- public Font deriveFont (int style, AffineTransform a)
-{
- if (a == null)
- throw new IllegalArgumentException ("Affine transformation is null");
-
- return peer.deriveFont (this, style, a);
-}
-
-/**
- * Produces a new {@link Font} based on the current font, subjected
- * to a new affine transformation.
- *
- * @param a The transformation to apply.
- *
- * @return A clone of the current font, with the specified transform.
- *
- * @throws IllegalArgumentException If transformation is
- * <code>null</code>.
- *
- * @since 1.2
- */
- public Font deriveFont (AffineTransform a)
-{
- if (a == null)
- throw new IllegalArgumentException ("Affine transformation is null");
-
- return peer.deriveFont (this, a);
-}
-
-/**
- * Produces a new {@link Font} based on the current font, adjusted to a
- * new set of attributes.
- *
- * @param attributes Attributes of the newly created font.
- *
- * @return A clone of the current font, with the specified attributes.
- *
- * @since 1.2
- */
- public Font deriveFont (Map attributes)
-{
- return peer.deriveFont (this, attributes);
-}
-
-/**
- * Returns a map of chracter attributes which this font currently has set.
- *
- * @return A map of chracter attributes which this font currently has set.
- *
- * @see getAvailableAttributes()
- * @see java.text.AttributedCharacterIterator.Attribute
- * @see java.awt.font.TextAttribute
- */
- public Map getAttributes ()
-{
- return peer.getAttributes (this);
-}
-
-/**
- * Returns an array of chracter attribute keys which this font understands.
- *
- * @return An array of chracter attribute keys which this font understands.
- *
- * @see getAttributes()
- * @see java.text.AttributedCharacterIterator.Attribute
- * @see java.awt.font.TextAttribute
- */
- public AttributedCharacterIterator.Attribute[] getAvailableAttributes()
-{
- return peer.getAvailableAttributes (this);
-}
-
-/**
- * Returns a baseline code (one of {@link ROMAN_BASELINE}, {@link
- * CENTER_BASELINE} or {@link HANGING_BASELINE}) indicating which baseline
- * this font will measure baseline offsets for, when presenting glyph
- * metrics for a given character.
- *
- * Baseline offsets describe the position of a glyph relative to an
- * invisible line drawn under, through the center of, or over a line of
- * rendered text, respectively. Different scripts use different baseline
- * modes, so clients should not assume all baseline offsets in a glyph
- * vector are from a common baseline.
- *
- * @param c The character code to select a baseline mode for.
- *
- * @return The baseline mode which would be used in a glyph associated
- * with the provided character.
- *
- * @since 1.2
- *
- * @see LineMetrics.getBaselineOffsets()
- */
- public byte getBaselineFor (char c)
-{
- return peer.getBaselineFor (this, c);
-}
-
-/**
- * Returns the family name of this font. A family name describes a
- * typographic style (such as Helvetica or Palatino). It is more specific
- * than a logical font name (such as Sans Serif) but less specific than a
- * font face name (such as Helvetica Bold).
- *
- * @param lc The locale in which to describe the name of the font family.
- *
- * @return A string containing the font family name, localized for the
- * provided locale.
- *
- * @since 1.2
- *
- * @see getName()
- * @see getFontName()
- * @see GraphicsEnvironment.getAvailableFontFamilyNames()
- * @see Locale
- */
- public String getFamily (Locale lc)
-{
- return peer.getFamily (this, lc);
-}
-
-/**
- * Returns a font appropriate for the given attribute set.
- *
- * @param attributes The attributes required for the new font.
- *
- * @return A new Font with the given attributes.
- *
- * @since 1.2
- *
- * @see TextAttribure
- */
- public static Font getFont (Map attributes)
-{
- return getFontFromToolkit (null, attributes);
-}
-
-/**
- * Returns the font face name of the font. A font face name describes a
- * specific variant of a font family (such as Helvetica Bold). It is more
- * specific than both a font family name (such as Helvetica) and a logical
- * font name (such as Sans Serif).
- *
- * @return The font face name of the font.
- *
- * @since 1.2
- *
- * @see getName()
- * @see getFamily()
- */
- public String getFontName ()
-{
- return peer.getFontName (this);
-}
-
-/**
- * Returns the font face name of the font. A font face name describes a
- * specific variant of a font family (such as Helvetica Bold). It is more
- * specific than both a font family name (such as Helvetica).
- *
- * @param lc The locale in which to describe the name of the font face.
- *
- * @return A string containing the font face name, localized for the
- * provided locale.
- *
- * @since 1.2
- *
- * @see getName()
- * @see getFamily()
- */
- public String getFontName (Locale lc)
-{
- return peer.getFontName (this, lc);
-}
-
-/**
- * Returns the italic angle of this font, a measurement of its slant when
- * style is {@link ITALIC}. The precise meaning is the inverse slope of a
- * caret line which "best measures" the font's italic posture.
- *
- * @return The italic angle.
- *
- * @see TextAttribute.POSTURE
- */
- public float getItalicAngle ()
-{
- return peer.getItalicAngle (this);
-}
-
-/**
- * Returns a {@link LineMetrics} object constructed with the specified
- * text and {@link FontRenderContext}.
- *
- * @param text The string to calculate metrics from.
- * @param begin Index of first character in <code>text</code> to measure.
- * @param limit Index of last character in <code>text</code> to measure.
- * @param rc Context for calculating precise glyph placement and hints.
- *
- * @return A new {@link LineMetrics} object.
- *
- * @throws IndexOutOfBoundsException if the range [begin, limit] is
- * invalid in <code>text</code>.
- */
- public LineMetrics getLineMetrics(String text, int begin,
- int limit, FontRenderContext rc)
-{
- return peer.getLineMetrics (this, new StringCharacterIterator (text),
- begin, limit, rc);
-}
-
-/**
- * Returns a {@link LineMetrics} object constructed with the specified
- * text and {@link FontRenderContext}.
- *
- * @param chars The string to calculate metrics from.
- * @param begin Index of first character in <code>text</code> to measure.
- * @param limit Index of last character in <code>text</code> to measure.
- * @param rc Context for calculating precise glyph placement and hints.
- *
- * @return A new {@link LineMetrics} object.
- *
- * @throws IndexOutOfBoundsException if the range [begin, limit] is
- * invalid in <code>chars</code>.
- */
- public LineMetrics getLineMetrics(char[] chars, int begin,
- int limit, FontRenderContext rc)
-{
- return peer.getLineMetrics (this, new StringCharacterIterator (new String(chars)),
- begin, limit, rc);
-}
-
-/**
- * Returns a {@link LineMetrics} object constructed with the specified
- * text and {@link FontRenderContext}.
- *
- * @param ci The string to calculate metrics from.
- * @param begin Index of first character in <code>text</code> to measure.
- * @param limit Index of last character in <code>text</code> to measure.
- * @param rc Context for calculating precise glyph placement and hints.
- *
- * @return A new {@link LineMetrics} object.
- *
- * @throws IndexOutOfBoundsException if the range [begin, limit] is
- * invalid in <code>ci</code>.
- */
- public LineMetrics getLineMetrics (CharacterIterator ci, int begin,
- int limit, FontRenderContext rc)
-{
- return peer.getLineMetrics (this, ci, begin, limit, rc);
-}
-
-/**
- * Returns the maximal bounding box of all the bounding boxes in this
- * font, when the font's bounding boxes are evaluated in a given {@link
- * FontRenderContext}
- *
- * @param rc Context in which to evaluate bounding boxes.
- *
- * @return The maximal bounding box.
- */
- public Rectangle2D getMaxCharBounds (FontRenderContext rc)
-{
- return peer.getMaxCharBounds (this, rc);
-}
-
-/**
- * Returns the glyph code this font uses to represent missing glyphs. This
- * code will be present in glyph vectors when the font was unable to
- * locate a glyph to represent a particular character code.
- *
- * @return The missing glyph code.
- *
- * @since 1.2
- */
- public int getMissingGlyphCode ()
-{
- return peer.getMissingGlyphCode (this);
-}
-
-/**
- * Returns the overall number of glyphs in this font. This number is one
- * more than the greatest glyph code used in any glyph vectors this font
- * produces. In other words, glyph codes are taken from the range
- * <code>[ 0, getNumGlyphs() - 1 ]</code>.
- *
- * @return The number of glyphs in this font.
- *
- * @since 1.2
- */
- public int getNumGlyphs ()
-{
- return peer.getMissingGlyphCode (this);
-}
-
-/**
- * Returns the PostScript Name of this font.
- *
- * @return The PostScript Name of this font.
- *
- * @since 1.2
- *
- * @see getName()
- * @see getFamily()
- * @see getFontName()
- */
- public String getPSName ()
-{
- return peer.getPostScriptName (this);
-}
-
-/**
- * Returns the logical bounds of the specified string when rendered with this
- * font in the specified {@link FontRenderContext}. This box will include the
- * glyph origin, ascent, advance, height, and leading, but may not include all
- * diacritics or accents. To get the complete visual bounding box of all the
- * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
- * {@link TextLayout}.
- *
- * @param str The string to measure.
- * @param frc The context in which to make the precise glyph measurements.
- *
- * @return A bounding box covering the logical bounds of the specified text.
- *
- * @see createGlyphVector()
- */
- public Rectangle2D getStringBounds (String str, FontRenderContext frc)
-{
- return getStringBounds (str, 0, str.length () - 1, frc);
-}
-
-/**
- * Returns the logical bounds of the specified string when rendered with this
- * font in the specified {@link FontRenderContext}. This box will include the
- * glyph origin, ascent, advance, height, and leading, but may not include all
- * diacritics or accents. To get the complete visual bounding box of all the
- * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
- * {@link TextLayout}.
- *
- * @param str The string to measure.
- * @param begin Index of the first character in <code>str</code> to measure.
- * @param limit Index of the last character in <code>str</code> to measure.
- * @param frc The context in which to make the precise glyph measurements.
- *
- * @return A bounding box covering the logical bounds of the specified text.
- *
- * @throws IndexOutOfBoundsException if the range [begin, limit] is
- * invalid in <code>str</code>.
- *
- * @since 1.2
- *
- * @see createGlyphVector()
- */
- public Rectangle2D getStringBounds (String str, int begin,
- int limit, FontRenderContext frc)
-{
- return peer.getStringBounds (this, new StringCharacterIterator(str), begin, limit, frc);
-}
-
-/**
- * Returns the logical bounds of the specified string when rendered with this
- * font in the specified {@link FontRenderContext}. This box will include the
- * glyph origin, ascent, advance, height, and leading, but may not include all
- * diacritics or accents. To get the complete visual bounding box of all the
- * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
- * {@link TextLayout}.
- *
- * @param ci The text to measure.
- * @param begin Index of the first character in <code>ci</code> to measure.
- * @param limit Index of the last character in <code>ci</code> to measure.
- * @param frc The context in which to make the precise glyph measurements.
- *
- * @return A bounding box covering the logical bounds of the specified text.
- *
- * @throws IndexOutOfBoundsException if the range [begin, limit] is
- * invalid in <code>ci</code>.
- *
- * @since 1.2
- *
- * @see createGlyphVector()
- */
- public Rectangle2D getStringBounds (CharacterIterator ci, int begin,
- int limit, FontRenderContext frc)
-{
- return peer.getStringBounds (this, ci, begin, limit, frc);
-}
-
-/**
- * Returns the logical bounds of the specified string when rendered with this
- * font in the specified {@link FontRenderContext}. This box will include the
- * glyph origin, ascent, advance, height, and leading, but may not include all
- * diacritics or accents. To get the complete visual bounding box of all the
- * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
- * {@link TextLayout}.
- *
- * @param chars The text to measure.
- * @param begin Index of the first character in <code>ci</code> to measure.
- * @param limit Index of the last character in <code>ci</code> to measure.
- * @param frc The context in which to make the precise glyph measurements.
- *
- * @return A bounding box covering the logical bounds of the specified text.
- *
- * @throws IndexOutOfBoundsException if the range [begin, limit] is
- * invalid in <code>chars</code>.
- *
- * @since 1.2
- *
- * @see createGlyphVector()
- */
- public Rectangle2D getStringBounds (char[] chars, int begin,
- int limit, FontRenderContext frc)
-{
- return peer.getStringBounds (this, new StringCharacterIterator (new String (chars)),
- begin, limit, frc);
-}
-
-/**
- * Returns a copy of the affine transformation this font is currently
- * subject to, if any.
- *
- * @return The current transformation.
- */
- public AffineTransform getTransform ()
-{
- return peer.getTransform (this);
-}
-
-/**
- * Indicates whether this font's line metrics are uniform. A font may be
- * composed of several "subfonts", each covering a different code range,
- * and each with their own line metrics. A font with no subfonts, or
- * subfonts with identical line metrics, is said to have "uniform" line
- * metrics.
- *
- * @return Whether this font has uniform line metrics.
- *
- * @see LineMetrics
- * @see getLineMetrics()
- */
- public boolean hasUniformLineMetrics ()
-{
- return peer.hasUniformLineMetrics (this);
-}
-
-/**
- * Indicates whether this font is subject to a non-identity affine
- * transformation.
- *
- * @return <code>true</code> iff the font has a non-identity affine
- * transformation applied to it.
- */
- public boolean isTransformed ()
-{
- return peer.isTransformed (this);
-}
-
-/**
- * Produces a glyph vector representing a full layout fo the specified
- * text in this font. Full layouts may include complex shaping and
- * reordering operations, for scripts such as Arabic or Hindi.
- *
- * Bidirectional (bidi) layout is not performed in this method; text
- * should have its bidi direction specified with one of the flags {@link
- * LAYOUT_LEFT_TO_RIGHT} or {@link LAYOUT_RIGHT_TO_LEFT}.
- *
- * Some types of layout (notably Arabic glyph shaping) may examine context
- * characters beyond the bounds of the indicated range, in order to select
- * an appropriate shape. The flags {@link LAYOUT_NO_START_CONTEXT} and
- * {@link LAYOUT_NO_LIMIT_CONTEXT} can be provided to prevent these extra
- * context areas from being examined, for instance if they contain invalid
- * characters.
- *
- * @param frc Context in which to perform the layout.
- * @param chars Text to perform layout on.
- * @param start Index of first character to perform layout on.
- * @param limit Index of last character to perform layout on.
- * @param flags Combination of flags controlling layout.
- *
- * @return A new {@link GlyphVector} representing the specified text.
- *
- * @throws IndexOutOfBoundsException if the range [begin, limit] is
- * invalid in <code>chars</code>.
- */
- public GlyphVector layoutGlyphVector (FontRenderContext frc,
- char[] chars, int start,
- int limit, int flags)
-{
- return peer.layoutGlyphVector (this, frc, chars, start, limit, flags);
-}
-
-
-/**
- * Returns a native peer object for this font.
- *
- * @return A native peer object for this font.
- *
- * @deprecated
- */
- public FontPeer getPeer ()
-{
- return peer;
-}
-
-
-/**
- * Returns a hash value for this font.
- *
- * @return A hash for this font.
- */
- public int hashCode()
-{
- return this.toString().hashCode();
-}
-
-
-/**
- * Tests whether or not the specified object is equal to this font. This
- * will be true if and only if:
- * <P>
- * <ul>
- * <li>The object is not <code>null</code>.
- * <li>The object is an instance of <code>Font</code>.
- * <li>The object has the same names, style, size, and transform as this object.
- * </ul>
- *
- * @return <code>true</code> if the specified object is equal to this
- * object, <code>false</code> otherwise.
- */
-public boolean
-equals(Object obj)
-{
- if (obj == null)
- return(false);
-
- if (!(obj instanceof Font))
- return(false);
-
- Font f = (Font)obj;
-
- return (f.getName ().equals (this.getName ()) &&
- f.getFamily ().equals (this.getFamily ()) &&
- f.getFontName ().equals (this.getFontName ()) &&
- f.getTransform ().equals (this.getTransform ()) &&
- f.getSize() == this.getSize() &&
- f.getStyle() == this.getStyle());
-}
-
-/*************************************************************************/
-
-/**
- * Returns a string representation of this font.
- *
- * @return A string representation of this font.
- */
-public String
-toString()
-{
- String styleString = "";
-
- switch (getStyle ())
- {
- case 0:
- styleString = "plain";
- break;
- case 1:
- styleString = "bold";
- break;
- case 2:
- styleString = "italic";
- break;
- default:
- styleString = "unknown";
- }
-
- return getClass ().getName ()
- + "[family=" + getFamily ()
- + ",name=" + getFontName ()
- + ",style=" + styleString
- + ",size=" + getSize () + "]";
-}
-
-
- /**
- * Determines the line metrics for a run of text.
- *
- * @param str the text run to be measured.
- *
- * @param frc the font rendering parameters that are used for the
- * measurement. The exact placement and size of text slightly
- * depends on device-specific characteristics, for instance
- * the device resolution or anti-aliasing. For this reason,
- * the returned measurement will only be accurate if the
- * passed <code>FontRenderContext</code> correctly reflects
- * the relevant parameters. Hence, <code>frc</code> should be
- * obtained from the same <code>Graphics2D</code> that will
- * be used for drawing, and any rendering hints should be set
- * to the desired values before obtaining <code>frc</code>.
- *
- * @see java.awt.Graphics2D#getFontRenderContext()
- */
- public LineMetrics getLineMetrics(String str, FontRenderContext frc)
- {
- return getLineMetrics (str, 0, str.length () - 1, frc);
- }
-
-} // class Font
-
diff --git a/libjava/java/awt/FontFormatException.java b/libjava/java/awt/FontFormatException.java
deleted file mode 100644
index 6ec8757fb5b..00000000000
--- a/libjava/java/awt/FontFormatException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* FontFormatException.java -- the specified font is bad
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * Thrown when a specified font is bad.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Font
- * @since 1.3
- * @status updated to 1.4
- */
-public class FontFormatException extends Exception
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = -4481290147811361272L;
-
- /**
- * Create a new instance with the specified detailed error message.
- *
- * @param message the detailed error message
- */
- public FontFormatException(String message)
- {
- super(message);
- }
-} // class FontFormatException
diff --git a/libjava/java/awt/FontMetrics.java b/libjava/java/awt/FontMetrics.java
deleted file mode 100644
index e702a625766..00000000000
--- a/libjava/java/awt/FontMetrics.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/* FontMetrics.java -- Information about about a fonts display characteristics
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.font.FontRenderContext;
-import java.awt.font.LineMetrics;
-import java.awt.geom.Rectangle2D;
-import java.text.CharacterIterator;
-
-// FIXME: I leave many methods basically unimplemented. This
-// should be reviewed.
-
-/**
- * This class returns information about the display characteristics of
- * a font. It is abstract, and concrete subclasses should implement at
- * least the following methods:
- *
- * <ul>
- * <li>getAscent()</li>
- * <li>getDescent()</li>
- * <li>getLeading()</li>
- * <li>getMaxAdvance()</li>
- * <li>charWidth(char)</li>
- * <li>charsWidth(char[], int, int)</li>
- * </ul>
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public abstract class FontMetrics implements java.io.Serializable
-{
- // Serialization constant.
- private static final long serialVersionUID = 1681126225205050147L;
-
- /**
- * This is the font for which metrics will be returned.
- */
- protected Font font;
-
- /**
- * Initializes a new instance of <code>FontMetrics</code> for the
- * specified font.
- *
- * @param font The font to return metric information for.
- */
- protected FontMetrics(Font font)
- {
- this.font = font;
- }
-
- /**
- * Returns the font that this object is creating metric information fo.
- *
- * @return The font for this object.
- */
- public Font getFont()
- {
- return font;
- }
-
- /**
- * Returns the leading, or spacing between lines, for this font.
- *
- * @return The font leading.
- */
- public int getLeading()
- {
- return 0;
- }
-
- /**
- * Returns the ascent of the font, which is the distance from the base
- * to the top of the majority of characters in the set. Some characters
- * can exceed this value however.
- *
- * @return The font ascent.
- */
- public int getAscent()
- {
- return 1;
- }
-
- /**
- * Returns the descent of the font, which is the distance from the base
- * to the bottom of the majority of characters in the set. Some characters
- * can exceed this value however.
- *
- * @return The font descent.
- */
- public int getDescent()
- {
- return 1;
- }
-
- /**
- * Returns the height of a line in this font. This will be the sum
- * of the leading, the ascent, and the descent.
- *
- * @return The height of the font.
- */
- public int getHeight()
- {
- return getAscent() + getDescent() + getLeading();
- }
-
- /**
- * Returns the maximum ascent value. This is the maximum distance any
- * character in the font rised above the baseline.
- *
- * @return The maximum ascent for this font.
- */
- public int getMaxAscent()
- {
- return getAscent();
- }
-
- /**
- * Returns the maximum descent value. This is the maximum distance any
- * character in the font extends below the baseline.
- *
- * @return The maximum descent for this font.
- */
- public int getMaxDescent()
- {
- return getMaxDecent();
- }
-
- /**
- * Returns the maximum descent value. This is the maximum distance any
- * character in the font extends below the baseline.
- *
- * @return The maximum descent for this font.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getMaxDescent()</code>.
- */
- public int getMaxDecent()
- {
- return getDescent();
- }
-
- /**
- * Returns the width of the widest character in the font.
- *
- * @return The width of the widest character in the font.
- */
- public int getMaxAdvance()
- {
- return -1;
- }
-
- /**
- * Returns the width of the specified character.
- *
- * @param ch The character to return the width of.
- *
- * @return The width of the specified character.
- */
- public int charWidth(int ch)
- {
- return charWidth((char) ch);
- }
-
- /**
- * Returns the width of the specified character.
- *
- * @param ch The character to return the width of.
- *
- * @return The width of the specified character.
- */
- public int charWidth(char ch)
- {
- return 1;
- }
-
- /**
- * Returns the total width of the specified string
- *
- * @param str The string to return the width of.
- *
- * @return The width of the string.
- */
- public int stringWidth(String str)
- {
- char[] buf = new char[str.length()];
- str.getChars(0, str.length(), buf, 0);
-
- return charsWidth(buf, 0, buf.length);
- }
-
- /**
- * Returns the total width of the specified character array.
- *
- * @param buf The character array containing the data.
- * @param offset The offset into the array to start calculating from.
- * @param len The total number of bytes to process.
- *
- * @return The width of the requested characters.
- */
- public int charsWidth(char[] buf, int offset, int len)
- {
- int total_width = 0;
- for (int i = offset; i < len; i++)
- total_width += charWidth(buf[i]);
- return total_width;
- }
-
- /**
- * Returns the total width of the specified byte array.
- *
- * @param buf The byte array containing the data.
- * @param offset The offset into the array to start calculating from.
- * @param len The total number of bytes to process.
- *
- * @return The width of the requested characters.
- */
- public int bytesWidth(byte[] buf, int offset, int len)
- {
- int total_width = 0;
- for (int i = offset; i < len; i++)
- total_width = charWidth((char) buf[i]);
-
- return total_width;
- }
-
- /**
- * Returns the widths of the first 256 characters in the font.
- *
- * @return The widths of the first 256 characters in the font.
- */
- public int[] getWidths()
- {
- int[] result = new int[256];
- for (char i = 0; i < 256; i++)
- result[i] = charWidth(i);
- return result;
- }
-
- /**
- * Returns a string representation of this object.
- *
- * @return A string representation of this object.
- */
- public String toString()
- {
- return (this.getClass() + "[font=" + font + ",ascent=" + getAscent()
- + ",descent=" + getDescent() + ",height=" + getHeight() + "]");
- }
-
- // Generic FontRenderContext used when getLineMetrics is called with a
- // plain Graphics object.
- private static final FontRenderContext gRC = new FontRenderContext(null,
- false,
- false);
-
- /**
- * Returns a {@link LineMetrics} object constructed with the
- * specified text and the {@link FontRenderContext} of the Graphics
- * object when it is an instance of Graphics2D or a generic
- * FontRenderContext with a null transform, not anti-aliased and not
- * using fractional metrics.
- *
- * @param text The string to calculate metrics from.
- * @param g The Graphics object that will be used.
- *
- * @return A new {@link LineMetrics} object.
- */
- public LineMetrics getLineMetrics(String text, Graphics g)
- {
- return getLineMetrics(text, 0, text.length(), g);
- }
-
- /**
- * Returns a {@link LineMetrics} object constructed with the
- * specified text and the {@link FontRenderContext} of the Graphics
- * object when it is an instance of Graphics2D or a generic
- * FontRenderContext with a null transform, not anti-aliased and not
- * using fractional metrics.
- *
- * @param text The string to calculate metrics from.
- * @param begin Index of first character in <code>text</code> to measure.
- * @param limit Index of last character in <code>text</code> to measure.
- * @param g The Graphics object that will be used.
- *
- * @return A new {@link LineMetrics} object.
- *
- * @throws IndexOutOfBoundsException if the range [begin, limit] is
- * invalid in <code>text</code>.
- */
- public LineMetrics getLineMetrics(String text, int begin, int limit,
- Graphics g)
- {
- FontRenderContext rc;
- if (g instanceof Graphics2D)
- rc = ((Graphics2D) g).getFontRenderContext();
- else
- rc = gRC;
- return font.getLineMetrics(text, begin, limit, rc);
- }
-
- /**
- * Returns a {@link LineMetrics} object constructed with the
- * specified text and the {@link FontRenderContext} of the Graphics
- * object when it is an instance of Graphics2D or a generic
- * FontRenderContext with a null transform, not anti-aliased and not
- * using fractional metrics.
- *
- * @param chars The string to calculate metrics from.
- * @param begin Index of first character in <code>text</code> to measure.
- * @param limit Index of last character in <code>text</code> to measure.
- * @param g The Graphics object that will be used.
- *
- * @return A new {@link LineMetrics} object.
- *
- * @throws IndexOutOfBoundsException if the range [begin, limit] is
- * invalid in <code>text</code>.
- */
- public LineMetrics getLineMetrics(char[] chars, int begin, int limit,
- Graphics g)
- {
- FontRenderContext rc;
- if (g instanceof Graphics2D)
- rc = ((Graphics2D) g).getFontRenderContext();
- else
- rc = gRC;
- return font.getLineMetrics(chars, begin, limit, rc);
- }
-
- /**
- * Returns a {@link LineMetrics} object constructed with the
- * specified text and the {@link FontRenderContext} of the Graphics
- * object when it is an instance of Graphics2D or a generic
- * FontRenderContext with a null transform, not anti-aliased and not
- * using fractional metrics.
- *
- * @param ci An iterator over the string to calculate metrics from.
- * @param begin Index of first character in <code>text</code> to measure.
- * @param limit Index of last character in <code>text</code> to measure.
- * @param g The Graphics object that will be used.
- *
- * @return A new {@link LineMetrics} object.
- *
- * @throws IndexOutOfBoundsException if the range [begin, limit] is
- * invalid in <code>text</code>.
- */
- public LineMetrics getLineMetrics(CharacterIterator ci, int begin,
- int limit, Graphics g)
- {
- FontRenderContext rc;
- if (g instanceof Graphics2D)
- rc = ((Graphics2D) g).getFontRenderContext();
- else
- rc = gRC;
- return font.getLineMetrics(ci, begin, limit, rc);
- }
-
- public Rectangle2D getStringBounds(String str, Graphics context)
- {
- return font.getStringBounds(str, getFontRenderContext(context));
- }
-
- public Rectangle2D getStringBounds(String str, int beginIndex, int limit,
- Graphics context)
- {
- return font.getStringBounds(str, beginIndex, limit,
- getFontRenderContext(context));
- }
-
- public Rectangle2D getStringBounds(char[] chars, int beginIndex, int limit,
- Graphics context)
- {
- return font.getStringBounds(chars, beginIndex, limit,
- getFontRenderContext(context));
- }
-
- public Rectangle2D getStringBounds(CharacterIterator ci, int beginIndex,
- int limit, Graphics context)
- {
- return font.getStringBounds(ci, beginIndex, limit,
- getFontRenderContext(context));
- }
-
- private FontRenderContext getFontRenderContext(Graphics context)
- {
- if (context instanceof Graphics2D)
- return ((Graphics2D) context).getFontRenderContext();
-
- return gRC;
- }
-}
diff --git a/libjava/java/awt/Frame.java b/libjava/java/awt/Frame.java
deleted file mode 100644
index 16c66136037..00000000000
--- a/libjava/java/awt/Frame.java
+++ /dev/null
@@ -1,649 +0,0 @@
-/* Frame.java -- AWT toplevel window
- Copyright (C) 1999, 2000, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.peer.FramePeer;
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Vector;
-
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleState;
-import javax.accessibility.AccessibleStateSet;
-
-/**
- * This class is a top-level window with a title bar and window
- * decorations.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Frame extends Window implements MenuContainer
-{
-/**
- * Constant for the default cursor.
- * @deprecated Replaced by <code>Cursor.DEFAULT_CURSOR</code> instead.
- */
-public static final int DEFAULT_CURSOR = Cursor.DEFAULT_CURSOR;
-
-/**
- * Constant for a cross-hair cursor.
- * @deprecated Use <code>Cursor.CROSSHAIR_CURSOR</code> instead.
- */
-public static final int CROSSHAIR_CURSOR = Cursor.CROSSHAIR_CURSOR;
-
-/**
- * Constant for a cursor over a text field.
- * @deprecated Use <code>Cursor.TEXT_CURSOR</code> instead.
- */
-public static final int TEXT_CURSOR = Cursor.TEXT_CURSOR;
-
-/**
- * Constant for a cursor to display while waiting for an action to complete.
- * @deprecated Use <code>Cursor.WAIT_CURSOR</code>.
- */
-public static final int WAIT_CURSOR = Cursor.WAIT_CURSOR;
-
-/**
- * Cursor used over SW corner of window decorations.
- * @deprecated Use <code>Cursor.SW_RESIZE_CURSOR</code> instead.
- */
-public static final int SW_RESIZE_CURSOR = Cursor.SW_RESIZE_CURSOR;
-
-/**
- * Cursor used over SE corner of window decorations.
- * @deprecated Use <code>Cursor.SE_RESIZE_CURSOR</code> instead.
- */
-public static final int SE_RESIZE_CURSOR = Cursor.SE_RESIZE_CURSOR;
-
-/**
- * Cursor used over NW corner of window decorations.
- * @deprecated Use <code>Cursor.NW_RESIZE_CURSOR</code> instead.
- */
-public static final int NW_RESIZE_CURSOR = Cursor.NW_RESIZE_CURSOR;
-
-/**
- * Cursor used over NE corner of window decorations.
- * @deprecated Use <code>Cursor.NE_RESIZE_CURSOR</code> instead.
- */
-public static final int NE_RESIZE_CURSOR = Cursor.NE_RESIZE_CURSOR;
-
-/**
- * Cursor used over N edge of window decorations.
- * @deprecated Use <code>Cursor.N_RESIZE_CURSOR</code> instead.
- */
-public static final int N_RESIZE_CURSOR = Cursor.N_RESIZE_CURSOR;
-
-/**
- * Cursor used over S edge of window decorations.
- * @deprecated Use <code>Cursor.S_RESIZE_CURSOR</code> instead.
- */
-public static final int S_RESIZE_CURSOR = Cursor.S_RESIZE_CURSOR;
-
-/**
- * Cursor used over E edge of window decorations.
- * @deprecated Use <code>Cursor.E_RESIZE_CURSOR</code> instead.
- */
-public static final int E_RESIZE_CURSOR = Cursor.E_RESIZE_CURSOR;
-
-/**
- * Cursor used over W edge of window decorations.
- * @deprecated Use <code>Cursor.W_RESIZE_CURSOR</code> instead.
- */
-public static final int W_RESIZE_CURSOR = Cursor.W_RESIZE_CURSOR;
-
-/**
- * Constant for a hand cursor.
- * @deprecated Use <code>Cursor.HAND_CURSOR</code> instead.
- */
-public static final int HAND_CURSOR = Cursor.HAND_CURSOR;
-
-/**
- * Constant for a cursor used during window move operations.
- * @deprecated Use <code>Cursor.MOVE_CURSOR</code> instead.
- */
-public static final int MOVE_CURSOR = Cursor.MOVE_CURSOR;
-
-public static final int ICONIFIED = 1;
-public static final int MAXIMIZED_BOTH = 6;
-public static final int MAXIMIZED_HORIZ = 2;
-public static final int MAXIMIZED_VERT = 4;
-public static final int NORMAL = 0;
-
-// Serialization version constant
-private static final long serialVersionUID = 2673458971256075116L;
-
-/**
- * @serial The version of the class data being serialized
- * // FIXME: what is this value?
- */
-private int frameSerializedDataVersion;
-
-/**
- * @serial Image used as the icon when this frame is minimized.
- */
-private Image icon;
-
-/**
- * @serial Constant used by the JDK Motif peer set. Not used in
- * this implementation.
- */
-private boolean mbManagement;
-
-/**
- * @serial The menu bar for this frame.
- */
-//private MenuBar menuBar = new MenuBar();
-private MenuBar menuBar;
-
-/**
- * @serial A list of other top-level windows owned by this window.
- */
-Vector ownedWindows = new Vector();
-
-/**
- * @serial Indicates whether or not this frame is resizable.
- */
-private boolean resizable = true;
-
-/**
- * @serial The state of this frame.
- * // FIXME: What are the values here?
- * This is package-private to avoid an accessor method.
- */
-int state;
-
-/**
- * @serial The title of the frame.
- */
-private String title = "";
-
- /**
- * Maximized bounds for this frame.
- */
- private Rectangle maximizedBounds;
-
- /**
- * This field indicates whether the frame is undecorated or not.
- */
- private boolean undecorated = false;
-
- /*
- * The number used to generate the name returned by getName.
- */
- private static transient long next_frame_number;
-
-/**
- * Initializes a new instance of <code>Frame</code> that is not visible
- * and has no title.
- */
-public
-Frame()
-{
- this("");
- noteFrame(this);
-}
-
-/**
- * Initializes a new instance of <code>Frame</code> that is not visible
- * and has the specified title.
- *
- * @param title The title of this frame.
- */
-public
-Frame(String title)
-{
- super();
- this.title = title;
- // Top-level frames are initially invisible.
- visible = false;
- noteFrame(this);
-}
-
-public
-Frame(GraphicsConfiguration gc)
-{
- super(gc);
- visible = false;
- noteFrame(this);
-}
-
-public
-Frame(String title, GraphicsConfiguration gc)
-{
- super(gc);
- setTitle(title);
- visible = false;
- noteFrame(this);
-}
-
-/**
- * Returns this frame's title string.
- *
- * @return This frame's title string.
- */
-public String
-getTitle()
-{
- return(title);
-}
-
-/*
- * Sets this frame's title to the specified value.
- *
- * @param title The new frame title.
- */
-public synchronized void
-setTitle(String title)
-{
- this.title = title;
- if (peer != null)
- ((FramePeer) peer).setTitle(title);
-}
-
-/**
- * Returns this frame's icon.
- *
- * @return This frame's icon, or <code>null</code> if this frame does not
- * have an icon.
- */
-public Image
-getIconImage()
-{
- return(icon);
-}
-
-/**
- * Sets this frame's icon to the specified value.
- *
- * @icon The new icon for this frame.
- */
-public synchronized void
-setIconImage(Image icon)
-{
- this.icon = icon;
- if (peer != null)
- ((FramePeer) peer).setIconImage(icon);
-}
-
-/**
- * Returns this frame's menu bar.
- *
- * @return This frame's menu bar, or <code>null</code> if this frame
- * does not have a menu bar.
- */
-public MenuBar
-getMenuBar()
-{
- return(menuBar);
-}
-
-/**
- * Sets this frame's menu bar.
- *
- * @param menuBar The new menu bar for this frame.
- */
-public synchronized void
-setMenuBar(MenuBar menuBar)
-{
- if (peer != null)
- {
- if (this.menuBar != null)
- this.menuBar.removeNotify();
- if (menuBar != null)
- menuBar.addNotify();
- invalidateTree ();
- ((FramePeer) peer).setMenuBar(menuBar);
- }
- this.menuBar = menuBar;
-}
-
-/**
- * Tests whether or not this frame is resizable. This will be
- * <code>true</code> by default.
- *
- * @return <code>true</code> if this frame is resizable, <code>false</code>
- * otherwise.
- */
-public boolean
-isResizable()
-{
- return(resizable);
-}
-
-/**
- * Sets the resizability of this frame to the specified value.
- *
- * @param resizable <code>true</code> to make the frame resizable,
- * <code>false</code> to make it non-resizable.
- */
-public synchronized void
-setResizable(boolean resizable)
-{
- this.resizable = resizable;
- if (peer != null)
- ((FramePeer) peer).setResizable(resizable);
-}
-
-/**
- * Returns the cursor type of the cursor for this window. This will
- * be one of the constants in this class.
- *
- * @return The cursor type for this frame.
- *
- * @deprecated Use <code>Component.getCursor()</code> instead.
- */
-public int
-getCursorType()
-{
- return(getCursor().getType());
-}
-
-/**
- * Sets the cursor for this window to the specified type. The specified
- * type should be one of the constants in this class.
- *
- * @param type The cursor type.
- *
- * @deprecated Use <code>Component.setCursor(Cursor)</code> instead.
- */
-public void
-setCursor(int type)
-{
- setCursor(new Cursor(type));
-}
-
-/**
- * Removes the specified component from this frame's menu.
- *
- * @param menu The menu component to remove.
- */
-public void
-remove(MenuComponent menu)
-{
- menuBar.remove(menu);
-}
-
-/**
- * Notifies this frame that it should create its native peer.
- */
-private static void fireDummyEvent()
-{
- EventQueue.invokeLater(new Runnable()
- {
- public void run()
- {
- // Do nothing here.
- }
- });
-}
-
-public void
-addNotify()
-{
- if (menuBar != null)
- menuBar.addNotify();
- if (peer == null)
- peer = getToolkit ().createFrame (this);
-
- // We now know there's a Frame (us) with a live peer, so we can start the
- // fundamental queue and dispatch thread, by inserting a dummy event.
- if (parent != null && parent.isDisplayable())
- fireDummyEvent();
-
- super.addNotify();
-}
-
-public void removeNotify()
-{
- if (menuBar != null)
- menuBar.removeNotify();
- super.removeNotify();
-
- // By now we've been disconnected from the peer, and the peer set to
- // null. This is formally the same as saying "we just became
- // un-displayable", so we wake up the event queue with a dummy event to
- // see if it's time to shut down.
- fireDummyEvent();
-}
-
- /**
- * Returns a debugging string describing this window.
- *
- * @return A debugging string describing this window.
- */
- protected String paramString ()
- {
- String title = getTitle ();
-
- String resizable = "";
- if (isResizable ())
- resizable = ",resizable";
-
- String state = "";
- switch (getState ())
- {
- case NORMAL:
- state = ",normal";
- break;
- case ICONIFIED:
- state = ",iconified";
- break;
- case MAXIMIZED_BOTH:
- state = ",maximized-both";
- break;
- case MAXIMIZED_HORIZ:
- state = ",maximized-horiz";
- break;
- case MAXIMIZED_VERT:
- state = ",maximized-vert";
- break;
- }
-
- return super.paramString () + ",title=" + title + resizable + state;
- }
-
-private static ArrayList weakFrames = new ArrayList();
-
-private static void noteFrame(Frame f)
-{
- weakFrames.add(new WeakReference(f));
-}
-
-public static Frame[] getFrames()
-{
- int n = 0;
- synchronized (weakFrames)
- {
- Iterator i = weakFrames.iterator();
- while (i.hasNext())
- {
- WeakReference wr = (WeakReference) i.next();
- if (wr.get() != null)
- ++n;
- }
- if (n == 0)
- return new Frame[0];
- else
- {
- Frame[] frames = new Frame[n];
- n = 0;
- i = weakFrames.iterator();
- while (i.hasNext())
- {
- WeakReference wr = (WeakReference) i.next();
- if (wr.get() != null)
- frames[n++] = (Frame) wr.get();
- }
- return frames;
- }
- }
-}
-
- public void setState (int state)
- {
- int current_state = getExtendedState ();
-
- if (state == NORMAL
- && (current_state & ICONIFIED) != 0)
- setExtendedState (current_state | ICONIFIED);
-
- if (state == ICONIFIED
- && (current_state & ~ICONIFIED) == 0)
- setExtendedState (current_state & ~ICONIFIED);
- }
-
- public int getState ()
- {
- /* FIXME: State might have changed in the peer... Must check. */
-
- return (state & ICONIFIED) != 0 ? ICONIFIED : NORMAL;
- }
-
- /**
- * @since 1.4
- */
- public void setExtendedState (int state)
- {
- this.state = state;
- }
-
- /**
- * @since 1.4
- */
- public int getExtendedState ()
- {
- return state;
- }
-
- /**
- * @since 1.4
- */
- public void setMaximizedBounds (Rectangle maximizedBounds)
- {
- this.maximizedBounds = maximizedBounds;
- }
-
- /**
- * Returns the maximized bounds of this frame.
- *
- * @return the maximized rectangle, may be null.
- *
- * @since 1.4
- */
- public Rectangle getMaximizedBounds ()
- {
- return maximizedBounds;
- }
-
- /**
- * Returns whether this frame is undecorated or not.
- *
- * @since 1.4
- */
- public boolean isUndecorated ()
- {
- return undecorated;
- }
-
- /**
- * Disables or enables decorations for this frame. This method can only be
- * called while the frame is not displayable.
- *
- * @exception IllegalComponentStateException If this frame is displayable.
- *
- * @since 1.4
- */
- public void setUndecorated (boolean undecorated)
- {
- if (!isDisplayable ())
- throw new IllegalComponentStateException ();
-
- this.undecorated = undecorated;
- }
-
- /**
- * Generate a unique name for this frame.
- *
- * @return A unique name for this frame.
- */
- String generateName ()
- {
- return "frame" + getUniqueLong ();
- }
-
- private static synchronized long getUniqueLong ()
- {
- return next_frame_number++;
- }
-
- protected class AccessibleAWTFrame extends AccessibleAWTWindow
- {
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.FRAME;
- }
-
- public AccessibleStateSet getAccessibleState()
- {
- AccessibleStateSet states = super.getAccessibleStateSet();
- if (isResizable())
- states.add(AccessibleState.RESIZABLE);
- if ((state & ICONIFIED) != 0)
- states.add(AccessibleState.ICONIFIED);
- return states;
- }
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>Frame</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTFrame();
- return accessibleContext;
- }
-
-}
diff --git a/libjava/java/awt/GradientPaint.java b/libjava/java/awt/GradientPaint.java
deleted file mode 100644
index f730f5ebbd1..00000000000
--- a/libjava/java/awt/GradientPaint.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/* GradientPaint.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.ColorModel;
-
-/**
- * STUB CLASS ONLY
- */
-public class GradientPaint implements Paint
-{
- private final float x1;
- private final float y1;
- private final Color c1;
- private final float x2;
- private final float y2;
- private final Color c2;
- private final boolean cyclic;
-
- public GradientPaint(float x1, float y1, Color c1,
- float x2, float y2, Color c2)
- {
- this(x1, y1, c1, x2, y2, c2, false);
- }
-
- public GradientPaint(Point2D p1, Color c1, Point2D p2, Color c2)
- {
- this((float) p1.getX(), (float) p1.getY(), c1,
- (float) p2.getX(), (float) p2.getY(), c2, false);
- }
-
- public GradientPaint(float x1, float y1, Color c1,
- float x2, float y2, Color c2, boolean cyclic)
- {
- if (c1 == null || c2 == null)
- throw new NullPointerException();
- this.x1 = x1;
- this.y1 = y1;
- this.c1 = c1;
- this.x2 = x2;
- this.y2 = y2;
- this.c2 = c2;
- this.cyclic = cyclic;
- }
-
- public GradientPaint(Point2D p1, Color c1, Point2D p2, Color c2,
- boolean cyclic)
- {
- this((float) p1.getX(), (float) p1.getY(), c1,
- (float) p2.getX(), (float) p2.getY(), c2, cyclic);
- }
-
- public Point2D getPoint1()
- {
- return new Point2D.Float(x1, y1);
- }
-
- public Color getColor1()
- {
- return c1;
- }
-
- public Point2D getPoint2()
- {
- return new Point2D.Float(x2, y2);
- }
-
- public Color getColor2()
- {
- return c2;
- }
-
- public boolean isCyclic()
- {
- return cyclic;
- }
-
- public PaintContext createContext(ColorModel cm, Rectangle deviceBounds,
- Rectangle2D userBounds,
- AffineTransform xform,
- RenderingHints hints)
- {
- throw new Error("not implemented");
- }
-
- public int getTransparency()
- {
- throw new Error("not implemented");
- }
-} // class GradientPaint
diff --git a/libjava/java/awt/Graphics.java b/libjava/java/awt/Graphics.java
deleted file mode 100644
index ff26190e5f0..00000000000
--- a/libjava/java/awt/Graphics.java
+++ /dev/null
@@ -1,767 +0,0 @@
-/* Graphics.java -- Abstract Java drawing class
- Copyright (C) 1999, 2000, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.image.ImageObserver;
-import java.text.AttributedCharacterIterator;
-
-/**
- * This is the abstract superclass of classes for drawing to graphics
- * devices such as the screen or printers.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public abstract class Graphics
-{
-
-/*
- * Instance Variables
- */
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Default constructor for subclasses.
- */
-protected
-Graphics()
-{
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns a copy of this <code>Graphics</code> object.
- *
- * @return A copy of this object.
- */
-public abstract Graphics
-create();
-
-/*************************************************************************/
-
-/**
- * Returns a copy of this <code>Graphics</code> object. The origin point
- * will be translated to the point (x, y) and the cliping rectangle set
- * to the intersection of the clipping rectangle in this object and the
- * rectangle specified by the parameters to this method.
- *
- * @param x The new X coordinate of the clipping region rect.
- * @param y The new Y coordinate of the clipping region rect.
- * @param width The width of the clipping region intersect rectangle.
- * @param height The height of the clipping region intersect rectangle.
- *
- * @return A copy of this object, modified as specified.
- */
-public Graphics
-create(int x, int y, int width, int height)
-{
- Graphics g = create();
-
- g.translate(x, y);
- // FIXME: I'm not sure if this will work. Are the old clip rect bounds
- // translated above?
- g.clipRect(0, 0, width, height);
-
- return(g);
-}
-
-/*************************************************************************/
-
-/**
- * Translates this context so that its new origin point is the point
- * (x, y).
- *
- * @param x The new X coordinate of the origin.
- * @param y The new Y coordinate of the origin.
- */
-public abstract void
-translate(int x, int y);
-
-/*************************************************************************/
-
-/**
- * Returns the current color for this object.
- *
- * @return The color for this object.
- */
-public abstract Color
-getColor();
-
-/*************************************************************************/
-
-/**
- * Sets the current color for this object.
- *
- * @param color The new color.
- */
-public abstract void
-setColor(Color color);
-
-/*************************************************************************/
-
-/**
- * Sets this context into "paint" mode, where the target pixels are
- * completely overwritten when drawn on.
- */
-public abstract void
-setPaintMode();
-
-/*************************************************************************/
-
-/**
- * Sets this context info "XOR" mode, where the targe pixles are
- * XOR-ed when drawn on.
- *
- * @param color The color to XOR against.
- */
-public abstract void
-setXORMode(Color color);
-
-/*************************************************************************/
-
-/**
- * Returns the current font for this graphics context.
- *
- * @return The current font.
- */
-public abstract Font
-getFont();
-
-/*************************************************************************/
-
-/**
- * Sets the font for this graphics context to the specified value.
- *
- * @param font The new font.
- */
-public abstract void
-setFont(Font font);
-
-/*************************************************************************/
-
-/**
- * Returns the font metrics for the current font.
- *
- * @return The font metrics for the current font.
- */
-public FontMetrics
-getFontMetrics()
-{
- return(getFontMetrics(getFont()));
-}
-
-/*************************************************************************/
-
-/**
- * Returns the font metrics for the specified font.
- *
- * @param font The font to return metrics for.
- *
- * @return The requested font metrics.
- */
-public abstract FontMetrics
-getFontMetrics(Font font);
-
-/*************************************************************************/
-
-/**
- * Returns the bounding rectangle of the clipping region for this
- * graphics context.
- *
- * @return The bounding rectangle for the clipping region.
- */
-public abstract Rectangle
-getClipBounds();
-
-/*************************************************************************/
-
-/**
- * Returns the bounding rectangle of the clipping region for this
- * graphics context.
- *
- * @return The bounding rectangle for the clipping region.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getClipBounds()</code>.
- */
-public Rectangle
-getClipRect()
-{
- return(getClipBounds());
-}
-
-/*************************************************************************/
-
-/**
- * Sets the clipping region to the intersection of the current clipping
- * region and the rectangle determined by the specified parameters.
- *
- * @param x The X coordinate of the upper left corner of the intersect rect.
- * @param y The Y coordinate of the upper left corner of the intersect rect.
- * @param width The width of the intersect rect.
- * @param height The height of the intersect rect.
- */
-public abstract void
-clipRect(int x, int y, int width, int height);
-
-/*************************************************************************/
-
-/**
- * Sets the clipping region to the rectangle determined by the specified
- * parameters.
- *
- * @param x The X coordinate of the upper left corner of the rect.
- * @param y The Y coordinate of the upper left corner of the rect.
- * @param width The width of the rect.
- * @param height The height of the rect.
- */
-public abstract void
-setClip(int x, int y, int width, int height);
-
-/*************************************************************************/
-
-/**
- * Returns the current clipping region as a <code>Shape</code> object.
- *
- * @return The clipping region as a <code>Shape</code>.
- */
-public abstract Shape
-getClip();
-
-/*************************************************************************/
-
-/**
- * Sets the clipping region to the specified <code>Shape</code>.
- *
- * @param clip The new clipping region.
- */
-public abstract void
-setClip(Shape clip);
-
-/*************************************************************************/
-
-/**
- * Copies the specified rectangle to the specified offset location.
- *
- * @param x The X coordinate of the upper left corner of the copy rect.
- * @param y The Y coordinate of the upper left corner of the copy rect.
- * @param width The width of the copy rect.
- * @param height The height of the copy rect.
- * @param dx The offset from the X value to start drawing.
- * @param dy The offset from the Y value to start drawing.
- */
-public abstract void
-copyArea(int x, int y, int width, int height, int dx, int dy);
-
-/*************************************************************************/
-
-/**
- * Draws a line between the two specified points.
- *
- * @param x1 The X coordinate of the first point.
- * @param y1 The Y coordinate of the first point.
- * @param x2 The X coordinate of the second point.
- * @param y2 The Y coordinate of the second point.
- */
-public abstract void
-drawLine(int x1, int y1, int x2, int y2);
-
-/*************************************************************************/
-
-/**
- * Fills the area bounded by the specified rectangle.
- *
- * @param x The X coordinate of the upper left corner of the fill rect.
- * @param y The Y coordinate of the upper left corner of the fill rect.
- * @param width The width of the fill rect.
- * @param height The height of the fill rect.
- */
-public abstract void
-fillRect(int x, int y, int width, int height);
-
-/*************************************************************************/
-
-/**
- * Draws the outline of the specified rectangle.
- *
- * @param x The X coordinate of the upper left corner of the draw rect.
- * @param y The Y coordinate of the upper left corner of the draw rect.
- * @param width The width of the draw rect.
- * @param height The height of the draw rect.
- */
-public void
-drawRect(int x, int y, int width, int height)
-{
- int x1 = x;
- int y1 = y;
- int x2 = x + width;
- int y2 = y + height;
- drawLine(x1, y1, x2, y1);
- drawLine(x2, y1, x2, y2);
- drawLine(x2, y2, x1, y2);
- drawLine(x1, y2, x1, y1);
-}
-
-/*************************************************************************/
-
-/**
- * Clears the specified rectangle.
- *
- * @param x The X coordinate of the upper left corner of the clear rect.
- * @param y The Y coordinate of the upper left corner of the clear rect.
- * @param width The width of the clear rect.
- * @param height The height of the clear rect.
- */
-public abstract void
-clearRect(int x, int y, int width, int height);
-
-/*************************************************************************/
-
-/**
- * Draws the outline of the specified rectangle with rounded cornders.
- *
- * @param x The X coordinate of the upper left corner of the draw rect.
- * @param y The Y coordinate of the upper left corner of the draw rect.
- * @param width The width of the draw rect.
- * @param height The height of the draw rect.
- * @param arcWidth The width of the corner arcs.
- * @param arcHeight The height of the corner arcs.
- */
-public abstract void
-drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight);
-
-/*************************************************************************/
-
-/**
- * Fills the specified rectangle with rounded cornders.
- *
- * @param x The X coordinate of the upper left corner of the fill rect.
- * @param y The Y coordinate of the upper left corner of the fill rect.
- * @param width The width of the fill rect.
- * @param height The height of the fill rect.
- * @param arcWidth The width of the corner arcs.
- * @param arcHeight The height of the corner arcs.
- */
-public abstract void
-fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight);
-
-/*************************************************************************/
-
-public void
-draw3DRect(int x, int y, int width, int height, boolean raised)
-{
- Color color = getColor();
- Color tl = color.brighter();
- Color br = color.darker();
-
- if (!raised)
- {
- Color tmp = tl;
- tl = br;
- br = tmp;
- }
-
- int x1 = x;
- int y1 = y;
- int x2 = x + width;
- int y2 = y + height;
-
- setColor(tl);
- drawLine(x1, y1, x2, y1);
- drawLine(x1, y2, x1, y1);
- setColor(br);
- drawLine(x2, y1, x2, y2);
- drawLine(x2, y2, x1, y2);
- setColor(color);
-}
-
-/**
- * Fills the specified rectangle with a 3D effect
- *
- * @param x The X coordinate of the upper left corner of the fill rect.
- * @param y The Y coordinate of the upper left corner of the fill rect.
- * @param width The width of the fill rect.
- * @param height The height of the fill rect.
- * @param raised <code>true</code> if the rectangle appears raised,
- * <code>false</code> if it should appear etched.
- */
-public void
-fill3DRect(int x, int y, int width, int height, boolean raised)
-{
- fillRect(x, y, width, height);
- draw3DRect(x, y, width-1, height-1, raised);
-}
-
-/*************************************************************************/
-
-/**
- * Draws an oval that just fits within the specified rectangle.
- *
- * @param x The X coordinate of the upper left corner of the rect.
- * @param y The Y coordinate of the upper left corner of the rect.
- * @param width The width of the rect.
- * @param height The height of the rect.
- */
-public abstract void
-drawOval(int x, int y, int width, int height);
-
-/*************************************************************************/
-
-/**
- * Fills an oval that just fits within the specified rectangle.
- *
- * @param x The X coordinate of the upper left corner of the rect.
- * @param y The Y coordinate of the upper left corner of the rect.
- * @param width The width of the rect.
- * @param height The height of the rect.
- */
-public abstract void
-fillOval(int x, int y, int width, int height);
-
-/*************************************************************************/
-
-/**
- * Draws an arc using the specified bounding rectangle and the specified
- * angle parameter. The arc is centered at the center of the rectangle.
- * The arc starts at the arcAngle position and extend for arcAngle
- * degrees. The degree origin is at the 3 o'clock position.
- *
- * @param x The X coordinate of the upper left corner of the rect.
- * @param y The Y coordinate of the upper left corner of the rect.
- * @param width The width of the rect.
- * @param height The height of the rect.
- * @param arcStart The beginning angle of the arc.
- * @param arcAngle The extent of the arc.
- */
-public abstract void
-drawArc(int x, int y, int width, int height, int arcStart, int arcAngle);
-
-/*************************************************************************/
-
-/**
- * Fills the arc define by the specified bounding rectangle and the specified
- * angle parameter. The arc is centered at the center of the rectangle.
- * The arc starts at the arcAngle position and extend for arcAngle
- * degrees. The degree origin is at the 3 o'clock position.
- *
- * @param x The X coordinate of the upper left corner of the rect.
- * @param y The Y coordinate of the upper left corner of the rect.
- * @param width The width of the rect.
- * @param height The height of the rect.
- * @param arcStart The beginning angle of the arc.
- * @param arcAngle The extent of the arc.
- */
-public abstract void
-fillArc(int x, int y, int width, int height, int arcStart, int arcAngle);
-
-/*************************************************************************/
-
-/**
- * Draws a series of interconnected lines determined by the arrays
- * of corresponding x and y coordinates.
- *
- * @param xPoints The X coordinate array.
- * @param yPoints The Y coordinate array.
- * @param npoints The number of points to draw.
- */
-public abstract void
-drawPolyline(int xPoints[], int yPoints[], int npoints);
-
-/*************************************************************************/
-
-/**
- * Draws a series of interconnected lines determined by the arrays
- * of corresponding x and y coordinates. The figure is closed if necessary
- * by connecting the first and last points.
- *
- * @param xPoints The X coordinate array.
- * @param yPoints The Y coordinate array.
- * @param npoints The number of points to draw.
- */
-public abstract void
-drawPolygon(int xPoints[], int yPoints[], int npoints);
-
-/*************************************************************************/
-
-/**
- * Draws the specified polygon.
- *
- * @param polygon The polygon to draw.
- */
-public void
-drawPolygon(Polygon polygon)
-{
- drawPolygon(polygon.xpoints, polygon.ypoints, polygon.npoints);
-}
-
-/*************************************************************************/
-
-/**
- * Fills the polygon determined by the arrays
- * of corresponding x and y coordinates.
- *
- * @param xPoints The X coordinate array.
- * @param yPoints The Y coordinate array.
- * @param npoints The number of points to draw.
- */
-public abstract void
-fillPolygon(int xPoints[], int yPoints[], int npoints);
-
-/*************************************************************************/
-
-/**
- * Fills the specified polygon
- *
- * @param polygon The polygon to fill.
- */
-public void
-fillPolygon(Polygon polygon)
-{
- fillPolygon(polygon.xpoints, polygon.ypoints, polygon.npoints);
-}
-
-/*************************************************************************/
-
-/**
- * Draws the specified string starting at the specified point.
- *
- * @param string The string to draw.
- * @param x The X coordinate of the point to draw at.
- * @param y The Y coordinate of the point to draw at.
- */
-public abstract void
-drawString(String string, int x, int y);
-
-public abstract void drawString (AttributedCharacterIterator ci, int x, int y);
-
-/*************************************************************************/
-
-/**
- * Draws the specified characters starting at the specified point.
- *
- * @param data The array of characters to draw.
- * @param offset The offset into the array to start drawing characters from.
- * @param length The number of characters to draw.
- * @param x The X coordinate of the point to draw at.
- * @param y The Y coordinate of the point to draw at.
- */
-public void
-drawChars(char data[], int offset, int length, int x, int y)
-{
- drawString(new String(data, offset, length), x, y);
-}
-
-public void
-drawBytes(byte[] data, int offset, int length, int x, int y)
-{
- String str = new String(data, offset, length);
- drawString(str, x, y);
-}
-
-/*************************************************************************/
-
-/**
- * Draws all of the image that is available and returns. If the image
- * is not completely loaded, <code>false</code> is returned and
- * the specified iamge observer is notified as more data becomes
- * available.
- *
- * @param image The image to draw.
- * @param x The X coordinate of the point to draw at.
- * @param y The Y coordinate of the point to draw at.
- * @param observer The image observer to notify as data becomes available.
- *
- * @return <code>true</code> if all the image data is available,
- * <code>false</code> otherwise.
- */
-public abstract boolean
-drawImage(Image image, int x, int y, ImageObserver observer);
-
-/*************************************************************************/
-
-/**
- * Draws all of the image that is available and returns. The image
- * is scaled to fit in the specified rectangle. If the image
- * is not completely loaded, <code>false</code> is returned and
- * the specified iamge observer is notified as more data becomes
- * available.
- *
- * @param image The image to draw.
- * @param x The X coordinate of the point to draw at.
- * @param y The Y coordinate of the point to draw at.
- * @param width The width of the rectangle to draw in.
- * @param height The height of the rectangle to draw in.
- * @param observer The image observer to notify as data becomes available.
- *
- * @return <code>true</code> if all the image data is available,
- * <code>false</code> otherwise.
- */
-public abstract boolean
-drawImage(Image image, int x, int y, int width, int height,
- ImageObserver observer);
-
-/*************************************************************************/
-
-/**
- * Draws all of the image that is available and returns. If the image
- * is not completely loaded, <code>false</code> is returned and
- * the specified iamge observer is notified as more data becomes
- * available.
- *
- * @param image The image to draw.
- * @param x The X coordinate of the point to draw at.
- * @param y The Y coordinate of the point to draw at.
- * @param bgcolor The background color to use for the image.
- * @param observer The image observer to notify as data becomes available.
- *
- * @return <code>true</code> if all the image data is available,
- * <code>false</code> otherwise.
- */
-public abstract boolean
-drawImage(Image image, int x, int y, Color bgcolor, ImageObserver observer);
-
-/*************************************************************************/
-
-/**
- * Draws all of the image that is available and returns. The image
- * is scaled to fit in the specified rectangle. If the image
- * is not completely loaded, <code>false</code> is returned and
- * the specified iamge observer is notified as more data becomes
- * available.
- *
- * @param image The image to draw.
- * @param x The X coordinate of the point to draw at.
- * @param y The Y coordinate of the point to draw at.
- * @param width The width of the rectangle to draw in.
- * @param height The height of the rectangle to draw in.
- * @param bgcolor The background color to use for the image.
- * @param observer The image observer to notify as data becomes available.
- *
- * @return <code>true</code> if all the image data is available,
- * <code>false</code> otherwise.
- */
-public abstract boolean
-drawImage(Image image, int x, int y, int width, int height, Color bgcolor,
- ImageObserver observer);
-
-/*************************************************************************/
-
-/**
- * FIXME: Write Javadocs for this when you understand it.
- */
-public abstract boolean
-drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1,
- int sx2, int sy2, ImageObserver observer);
-
-/*************************************************************************/
-
-/**
- * FIXME: Write Javadocs for this when you understand it.
- */
-public abstract boolean
-drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1,
- int sx2, int sy2, Color bgcolor, ImageObserver observer);
-
-/*************************************************************************/
-
-/**
- * Free any resources held by this graphics context immediately instead
- * of waiting for the object to be garbage collected and finalized.
- */
-public abstract void
-dispose();
-
-/*************************************************************************/
-
-/**
- * Frees the resources held by this graphics context when it is
- * garbage collected.
- */
-public void
-finalize()
-{
- dispose();
-}
-
-/*************************************************************************/
-
-/**
- * Returns a string representation of this object.
- *
- * @return A string representation of this object.
- */
-public String
-toString()
-{
- return getClass ().getName () + "[font=" + getFont () + ",color=" + getColor () + "]";
-}
-
-public boolean
-hitClip(int x, int y, int width, int height)
-{
- throw new UnsupportedOperationException("not implemented yet");
-}
-
-public Rectangle
-getClipBounds(Rectangle r)
-{
- Rectangle clipBounds = getClipBounds();
-
- if (r == null)
- return clipBounds;
-
- r.x = clipBounds.x;
- r.y = clipBounds.y;
- r.width = clipBounds.width;
- r.height = clipBounds.height;
- return r;
-}
-
-} // class Graphics
-
diff --git a/libjava/java/awt/Graphics2D.java b/libjava/java/awt/Graphics2D.java
deleted file mode 100644
index 3faa9dc0c66..00000000000
--- a/libjava/java/awt/Graphics2D.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.font.FontRenderContext;
-import java.awt.font.GlyphVector;
-import java.awt.geom.AffineTransform;
-import java.awt.image.BufferedImage;
-import java.awt.image.BufferedImageOp;
-import java.awt.image.ImageObserver;
-import java.awt.image.RenderedImage;
-import java.awt.image.renderable.RenderableImage;
-import java.text.AttributedCharacterIterator;
-import java.util.Map;
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public abstract class Graphics2D extends Graphics
-{
-
- protected Graphics2D()
- {
- }
-
- public void draw3DRect(int x, int y, int width, int height,
- boolean raised)
- {
- super.draw3DRect(x, y, width, height, raised);
- }
-
- public void fill3DRect(int x, int y, int width, int height,
- boolean raised)
- {
- super.fill3DRect(x, y, width, height, raised);
- }
-
- public abstract void draw(Shape shape);
-
- public abstract boolean drawImage(Image image, AffineTransform xform,
- ImageObserver obs);
-
- public abstract void drawImage(BufferedImage image,
- BufferedImageOp op,
- int x,
- int y);
-
- public abstract void drawRenderedImage(RenderedImage image,
- AffineTransform xform);
-
- public abstract void drawRenderableImage(RenderableImage image,
- AffineTransform xform);
-
- public abstract void drawString(String text, int x, int y);
-
- public abstract void drawString(String text, float x, float y);
-
- public abstract void drawString(AttributedCharacterIterator iterator,
- int x, int y);
-
- public abstract void drawString(AttributedCharacterIterator iterator,
- float x, float y);
-
- // public abstract void drawGlyphVector(GlyphVector g, float x, float y);
-
- public abstract void fill(Shape shape);
-
- public abstract boolean hit(Rectangle rect, Shape text,
- boolean onStroke);
-
- public abstract GraphicsConfiguration getDeviceConfiguration();
-
- public abstract void setComposite(Composite comp);
-
- public abstract void setPaint(Paint paint);
-
- public abstract void setStroke(Stroke stroke);
-
- public abstract void setRenderingHint(RenderingHints.Key hintKey,
- Object hintValue);
-
- public abstract Object getRenderingHint(RenderingHints.Key hintKey);
-
- public abstract void setRenderingHints(Map hints);
-
- public abstract void addRenderingHints(Map hints);
-
- public abstract RenderingHints getRenderingHints();
-
- public abstract void translate(int x, int y);
-
- public abstract void translate(double tx, double ty);
-
- public abstract void rotate(double theta);
-
- public abstract void rotate(double theta, double x, double y);
-
- public abstract void scale(double scaleX, double scaleY);
-
- public abstract void shear(double shearX, double shearY);
-
- public abstract void transform(AffineTransform Tx);
-
- public abstract void setTransform(AffineTransform Tx);
-
- public abstract AffineTransform getTransform();
-
- public abstract Paint getPaint();
-
- public abstract Composite getComposite();
-
- public abstract void setBackground(Color color);
-
- public abstract Color getBackground();
-
- public abstract Stroke getStroke();
-
- public abstract void clip(Shape s);
-
- public abstract FontRenderContext getFontRenderContext ();
-
- public abstract void drawGlyphVector (GlyphVector g, float x, float y);
-}
diff --git a/libjava/java/awt/GraphicsConfigTemplate.java b/libjava/java/awt/GraphicsConfigTemplate.java
deleted file mode 100644
index e46888378fe..00000000000
--- a/libjava/java/awt/GraphicsConfigTemplate.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/* GraphicsConfigTemplate.java -- a template for selecting configurations
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.io.Serializable;
-
-/**
- * This allows filtering an array of GraphicsConfigurations for the best
- * one based on various requirements. The resulting configuration has had
- * all non-default attributes set as required to meet or exceed the request.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see GraphicsConfiguration
- * @see GraphicsDevice
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class GraphicsConfigTemplate implements Serializable
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -8061369279557787079L;
-
- /** States that a feature is required to select a configuration. */
- public static final int REQUIRED = 1;
-
- /**
- * States that a feature is preferred, but not required, to select a
- * configuration. In the case of multiple valid configurations, the tie
- * breaks in favor of the one with the feature.
- */
- public static final int PREFERRED = 2;
-
- /**
- * States that a feature is not necessary in the configuration. In the case
- * of multiple valid configurations, the tie breaks in favor of the one
- * without the feature, to reduce overhead.
- */
- public static final int UNNECESSARY = 3;
-
- /**
- * The default constructor.
- */
- public GraphicsConfigTemplate()
- {
- }
-
- /**
- * Returns the "best" match among the array of possible configurations, given
- * the criteria of this template.
- *
- * @param array the array to choose from
- * @return the best match
- * @throws NullPointerException if array is null
- */
- public abstract GraphicsConfiguration getBestConfiguration
- (GraphicsConfiguration[] array);
-
- /**
- * Returns true if the given configuration supports all the features required
- * by this template.
- *
- * @param config the configuration to test
- * @return true if it is a match
- * @throws NullPointerException if config is null
- */
- public abstract boolean isGraphicsConfigSupported
- (GraphicsConfiguration config);
-} // class GraphicsConfigTemplate
diff --git a/libjava/java/awt/GraphicsConfiguration.java b/libjava/java/awt/GraphicsConfiguration.java
deleted file mode 100644
index 6dc27793d43..00000000000
--- a/libjava/java/awt/GraphicsConfiguration.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/* GraphicsConfiguration.java -- describes characteristics of graphics
- Copyright (C) 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.geom.AffineTransform;
-import java.awt.image.BufferedImage;
-import java.awt.image.ColorModel;
-import java.awt.image.VolatileImage;
-
-/**
- * This class describes the configuration of various graphics devices, such
- * as a monitor or printer. Different configurations may exist for the same
- * device, according to the different native modes supported.
- *
- * <p>Virtual devices are supported (for example, in a multiple screen
- * environment, a virtual device covers all screens simultaneously); the
- * configuration will have a non-zero relative coordinate system in such
- * a case.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Window
- * @see Frame
- * @see GraphicsEnvironment
- * @see GraphicsDevice
- * @since 1.0
- * @status updated to 1.4
- */
-public abstract class GraphicsConfiguration
-{
- /**
- * The default constructor.
- *
- * @see GraphicsDevice#getConfigurations()
- * @see GraphicsDevice#getDefaultConfiguration()
- * @see GraphicsDevice#getBestConfiguration(GraphicsConfigTemplate)
- * @see Graphics2D#getDeviceConfiguration()
- */
- protected GraphicsConfiguration ()
- {
- }
-
- /**
- * Gets the associated device that this configuration describes.
- *
- * @return the device
- */
- public abstract GraphicsDevice getDevice();
-
- /**
- * Returns a buffered image optimized to this device, so that blitting can
- * be supported in the buffered image.
- *
- * @param w the width of the buffer
- * @param h the height of the buffer
- * @return the buffered image, or null if none is supported
- */
- public abstract BufferedImage createCompatibleImage(int w, int h);
-
- /**
- * Returns a buffered volatile image optimized to this device, so that
- * blitting can be supported in the buffered image. Because the buffer is
- * volatile, it can be optimized by native graphics accelerators.
- *
- * @param w the width of the buffer
- * @param h the height of the buffer
- * @return the buffered image, or null if none is supported
- * @see Component#createVolatileImage(int, int)
- * @since 1.4
- */
- public abstract VolatileImage createCompatibleVolatileImage(int w, int h);
-
- /**
- * Returns a buffered volatile image optimized to this device, and with the
- * given capabilities, so that blitting can be supported in the buffered
- * image. Because the buffer is volatile, it can be optimized by native
- * graphics accelerators.
- *
- * @param w the width of the buffer
- * @param h the height of the buffer
- * @param caps the desired capabilities of the image buffer
- * @return the buffered image, or null if none is supported
- * @throws AWTException if the capabilities cannot be met
- * @since 1.4
- */
- public VolatileImage createCompatibleVolatileImage(int w, int h,
- ImageCapabilities caps)
- throws AWTException
- {
- throw new AWTException("not implemented");
- }
-
- /**
- * Returns a buffered image optimized to this device, and with the specified
- * transparency, so that blitting can be supported in the buffered image.
- *
- * @param w the width of the buffer
- * @param h the height of the buffer
- * @param transparency the transparency of the buffer
- * @return the buffered image, or null if none is supported
- * @see Transparency#OPAQUE
- * @see Transparency#BITMASK
- * @see Transparency#TRANSLUCENT
- */
- public abstract BufferedImage createCompatibleImage(int w, int h,
- int transparency);
-
- /**
- * Gets the color model of the corresponding device.
- *
- * @return the color model
- */
- public abstract ColorModel getColorModel();
-
- /**
- * Gets a color model for the corresponding device which supports the desired
- * transparency level.
- *
- * @param transparency the transparency of the model
- * @return the color model, with transparency
- * @see Transparency#OPAQUE
- * @see Transparency#BITMASK
- * @see Transparency#TRANSLUCENT
- */
- public abstract ColorModel getColorModel(int transparency);
-
- /**
- * Returns a transform that maps user coordinates to device coordinates. The
- * preferred mapping is about 72 user units to 1 inch (2.54 cm) of physical
- * space. This is often the identity transform. The device coordinates have
- * the origin at the upper left, with increasing x to the right, and
- * increasing y to the bottom.
- *
- * @return the transformation from user space to device space
- * @see #getNormalizingTransform()
- */
- public abstract AffineTransform getDefaultTransform();
-
- /**
- * Returns a transform that maps user coordinates to device coordinates. The
- * exact mapping is 72 user units to 1 inch (2.54 cm) of physical space.
- * This is often the identity transform. The device coordinates have the
- * origin at the upper left, with increasing x to the right, and increasing
- * y to the bottom. Note that this is more accurate (and thus, sometimes more
- * costly) than the default transform.
- *
- * @return the normalized transformation from user space to device space
- * @see #getDefaultTransform()
- */
- public abstract AffineTransform getNormalizingTransform();
-
- /**
- * Returns the bounds of the configuration, in device coordinates. If this
- * is a virtual device (for example, encompassing several screens), the
- * bounds may have a non-zero origin.
- *
- * @return the device bounds
- * @since 1.3
- */
- public abstract Rectangle getBounds();
-
- /**
- * Returns the buffering capabilities of this configuration.
- *
- * @return the buffer capabilities
- * @since 1.4
- */
- public BufferCapabilities getBufferCapabilities()
- {
- throw new Error("not implemented");
- }
-
- /**
- * Returns the imaging capabilities of this configuration.
- *
- * @return the image capabilities
- * @since 1.4
- */
- public ImageCapabilities getImageCapabilities()
- {
- throw new Error("not implemented");
- }
-} // class GraphicsConfiguration
diff --git a/libjava/java/awt/GraphicsDevice.java b/libjava/java/awt/GraphicsDevice.java
deleted file mode 100644
index 581d02f0d41..00000000000
--- a/libjava/java/awt/GraphicsDevice.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/* GraphicsDevice.java -- information about a graphics device
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This describes a graphics device available to the given environment. This
- * includes screen and printer devices, and the different configurations for
- * each device. Also, this allows you to create virtual devices which operate
- * over a multi-screen environment.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see GraphicsEnvironment
- * @see GraphicsConfiguration
- * @since 1.3
- * @status updated to 1.4
- */
-public abstract class GraphicsDevice
-{
- /** Device is a raster screen. */
- public static final int TYPE_RASTER_SCREEN = 0;
-
- /** Device is a printer. */
- public static final int TYPE_PRINTER = 1;
-
- /** Device is an image buffer not visible to the user. */
- public static final int TYPE_IMAGE_BUFFER = 2;
-
- /** The current full-screen window, or null if there is none. */
- private Window full_screen;
-
- /**
- * The bounds of the fullscreen window before it has been switched to full
- * screen.
- */
- private Rectangle fullScreenOldBounds;
-
- /** The current display mode, or null if unknown. */
- private DisplayMode mode;
-
- /**
- * The default constructor.
- *
- * @see GraphicsEnvironment#getScreenDevices()
- * @see GraphicsEnvironment#getDefaultScreenDevice()
- * @see GraphicsConfiguration#getDevice()
- */
- protected GraphicsDevice()
- {
- }
-
- /**
- * Returns the type of the device.
- *
- * @return the device type
- * @see #TYPE_RASTER_SCREEN
- * @see #TYPE_PRINTER
- * @see #TYPE_IMAGE_BUFFER
- */
- public abstract int getType();
-
- /**
- * Returns an identification string for the device. This can be
- * vendor-specific, and may be useful for debugging.
- *
- * @return the identification
- */
- public abstract String getIDstring();
-
- /**
- * Return all configurations valid for this device.
- *
- * @return an array of configurations
- */
- public abstract GraphicsConfiguration[] getConfigurations();
-
- /**
- * Return the default configuration for this device.
- *
- * @return the default configuration
- */
- public abstract GraphicsConfiguration getDefaultConfiguration();
-
- /**
- * Return the best configuration, according to the criteria in the given
- * template.
- *
- * @param template the template to adjust by
- * @return the best configuration
- * @throws NullPointerException if template is null
- */
- public GraphicsConfiguration getBestConfiguration
- (GraphicsConfigTemplate template)
- {
- return template.getBestConfiguration(getConfigurations());
- }
-
- /**
- * Returns true if the device supports full-screen exclusive mode. The
- * default implementation returns true; subclass it if this is not the case.
- *
- * @return true if full screen support is available
- * @since 1.4
- */
- public boolean isFullScreenSupported()
- {
- return true;
- }
-
- /**
- * Toggle the given window between full screen and normal mode. The previous
- * full-screen window, if different, is restored; if the given window is
- * null, no window will be full screen. If
- * <code>isFullScreenSupported()</code> returns true, full screen mode is
- * considered to be exclusive, which implies:<ul>
- * <li>Windows cannot overlap the full-screen window. All other application
- * windows will always appear beneath the full-screen window in the
- * Z-order.</li>
- * <li>Input method windows are disabled. It is advisable to call
- * <code>Component.enableInputMethods(false)</code> to make a component
- * a non-client of the input method framework.</li>
- * </ul><br>
- * If <code>isFullScreenSupported()</code> returns false, full-screen
- * exclusive mode is simulated by resizing the window to the size of the
- * screen and positioning it at (0,0). This is also what this method does.
- * If a device supports real fullscreen mode then it should override this
- * method as well as #isFullScreenSupported and #getFullScreenWindow.
- *
- * @param w the window to toggle
- * @see #isFullScreenSupported()
- * @see getFullScreenWindow()
- * @see setDisplayMode(DisplayMode)
- * @see Component#enableInputMethods(boolean)
- * @since 1.4
- */
- public synchronized void setFullScreenWindow(Window w)
- {
- // Restore the previous window to normal mode and release the reference.
- if (full_screen != null)
- {
- full_screen.setBounds(fullScreenOldBounds);
- }
-
- full_screen = null;
-
- // If w != null, make it full-screen.
- if (w != null)
- {
- fullScreenOldBounds = w.getBounds();
- full_screen = w;
- DisplayMode dMode = getDisplayMode();
- full_screen.setBounds(0, 0, dMode.getWidth(), dMode.getHeight());
- full_screen.requestFocus();
- full_screen.setLocationRelativeTo(null);
- }
- }
-
- /**
- * Returns the current full-screen window of the device, or null if no
- * window is full-screen.
- *
- * @return the full-screen window
- * @see #setFullScreenWindow(Window)
- * @since 1.4
- */
- public Window getFullScreenWindow()
- {
- return full_screen;
- }
-
- /**
- * Returns whether this device supports low-level display changes. This may
- * depend on whether full-screen exclusive mode is available.
- *
- * XXX The default implementation returns false for now.
- *
- * @return true if display changes are supported
- * @see #setDisplayMode(DisplayMode)
- * @since 1.4
- */
- public boolean isDisplayChangeSupported()
- {
- return false;
- }
-
- /**
- * Sets the display mode. This may be dependent on the availability of
- * full-screen exclusive mode.
- *
- * @param mode the new mode
- * @throws IllegalArgumentException if the new mode is not in getDisplayModes
- * @throws UnsupportedOperationException if ! isDisplayChangeSupported()
- * @see #getDisplayMode()
- * @see #getDisplayModes()
- * @see #isDisplayChangeSupported()
- * @since 1.4
- */
- public void setDisplayMode(DisplayMode mode)
- {
- DisplayMode[] array = getDisplayModes();
- if (! isDisplayChangeSupported())
- throw new UnsupportedOperationException();
- int i = array == null ? 0 : array.length;
- while (--i >= 0)
- if (array[i].equals(mode))
- break;
- if (i < 0)
- throw new IllegalArgumentException();
- this.mode = mode;
- }
-
- /**
- * Returns the current display mode of this device, or null if unknown.
- *
- * @return the current display mode
- * @see #setDisplayMode(DisplayMode)
- * @see #getDisplayModes()
- * @since 1.4
- */
- public DisplayMode getDisplayMode()
- {
- return mode;
- }
-
- /**
- * Return an array of all available display modes. This implementation
- * returns a 0-length array, so subclasses must override this.
- *
- * @return the array of available modes
- * @since 1.4
- */
- public DisplayMode[] getDisplayModes()
- {
- return new DisplayMode[0];
- }
-
- /**
- * Return the number of bytes available in accelerated memory on this
- * device. The device may support creation or caching on a first-come,
- * first-served basis, depending on the operating system and driver.
- * Memory may be a finite resource, and because of multi-threading, you
- * are not guaranteed that the result of this method ensures your image
- * will successfully be put in accelerated memory. A negative result means
- * the memory is unlimited. The default implementation assumes no special
- * memory is available, and returns 0.
- *
- * @return the size of accelerated memory available
- * @see VolatileImage#flush()
- * @see ImageCapabilities#isAccelerated()
- */
- public int getAvailableAcceleratedMemory()
- {
- return 0;
- }
-} // class GraphicsDevice
diff --git a/libjava/java/awt/GraphicsEnvironment.java b/libjava/java/awt/GraphicsEnvironment.java
deleted file mode 100644
index a82e7a357de..00000000000
--- a/libjava/java/awt/GraphicsEnvironment.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/* GraphicsEnvironment.java -- information about the graphics environment
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import gnu.java.awt.ClasspathToolkit;
-import gnu.classpath.SystemProperties;
-import java.awt.image.BufferedImage;
-import java.util.Locale;
-
-/**
- * This descibes the collection of GraphicsDevice and Font objects available
- * on a given platform. The resources might be local or remote, and specify
- * the valid configurations for displaying graphics.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see GraphicsDevice
- * @see GraphicsConfiguration
- * @since 1.4
- * @status updated to 1.4
- */
-public abstract class GraphicsEnvironment
-{
- private static GraphicsEnvironment localGraphicsEnvironment;
-
- /**
- * The environment must be obtained from a factory or query method, hence
- * this constructor is protected.
- */
- protected GraphicsEnvironment()
- {
- }
-
- /**
- * Returns the local graphics environment. If the java.awt.graphicsenv
- * system property is set, it instantiates the specified class,
- * otherwise it assume that the awt toolkit is a ClasspathToolkit
- * and delegates to it to create the instance.
- *
- * @return the local environment
- */
- public static GraphicsEnvironment getLocalGraphicsEnvironment()
- {
- if (localGraphicsEnvironment != null)
- return localGraphicsEnvironment;
-
- String graphicsenv = SystemProperties.getProperty("java.awt.graphicsenv",
- null);
- if (graphicsenv != null)
- {
- try
- {
- // We intentionally use the bootstrap class loader.
- localGraphicsEnvironment = (GraphicsEnvironment)
- Class.forName(graphicsenv).newInstance();
- return localGraphicsEnvironment;
- }
- catch (Exception x)
- {
- throw (InternalError)
- new InternalError("Unable to instantiate java.awt.graphicsenv")
- .initCause(x);
- }
- }
- else
- {
- ClasspathToolkit tk;
- tk = ((ClasspathToolkit) Toolkit.getDefaultToolkit());
- localGraphicsEnvironment = tk.getLocalGraphicsEnvironment();
- return localGraphicsEnvironment;
- }
- }
-
- /**
- * Check if the local environment is headless, meaning that it does not
- * support a display, keyboard, or mouse. Many methods in the Abstract
- * Windows Toolkit (java.awt) throw a {@link HeadlessException} if this
- * returns true.
- *
- * This method returns true if the java.awt.headless property is set
- * to "true".
- *
- * @return true if the environment is headless, meaning that graphics are
- * unsupported
- * @since 1.4
- */
- public static boolean isHeadless()
- {
- String headless = SystemProperties.getProperty("java.awt.headless", null);
- return "true".equalsIgnoreCase(headless);
- }
-
- /**
- * Check if the given environment is headless, meaning that it does not
- * support a display, keyboard, or mouse. Many methods in the Abstract
- * Windows Toolkit (java.awt) throw a {@link HeadlessException} if this
- * returns true. This default implementation returns isHeadless(), so
- * subclasses need only override it if they differ.
- *
- * @return true if the environment is headless, meaning that graphics are
- * unsupported
- * @since 1.4
- */
- public boolean isHeadlessInstance()
- {
- return isHeadless();
- }
-
- /**
- * Get an array of all the GraphicsDevice objects.
- *
- * @return the available graphics devices, may be 0 length
- * @throws HeadlessException if the environment is headless
- */
- public abstract GraphicsDevice[] getScreenDevices();
-
- /**
- * Get the default screen GraphicsDevice object.
- *
- * @return the default screen device
- * @throws HeadlessException if the environment is headless
- */
- public abstract GraphicsDevice getDefaultScreenDevice();
-
- /**
- * Return a Graphics2D object which will render into the specified image.
- *
- * @param image the image to render into
- * @return the object that renders into the image
- */
- public abstract Graphics2D createGraphics(BufferedImage image);
-
- /**
- * Returns an array of the one-point size fonts available in this
- * environment. From there, the user can select the font and derive the
- * correct one of proper size and attributes, using <code>deriveFont</code>.
- * Only one master version of each font appears in this array; if a font
- * can be derived from another, it must be created in that way.
- *
- * @return the array of available fonts
- * @see #getAvailableFontFamilyNames()
- * @see Font#deriveFont(int, float)
- * @since 1.2
- */
- public abstract Font[] getAllFonts();
-
- /**
- * Returns an array of the font family names available in this environment.
- * This allows flexibility in choosing the style of font, while still letting
- * the Font class decide its best match.
- *
- * @return the array of available font families
- * @see #getAllFonts()
- * @see Font#getFamily()
- * @since 1.2
- */
- public abstract String[] getAvailableFontFamilyNames();
-
- /**
- * Returns an array of the font family names available in this environment,
- * localized to the current Locale if l is non-null. This allows
- * flexibility in choosing the style of font, while still letting the Font
- * class decide its best match.
- *
- * @param l the locale to use
- * @return the array of available font families, localized
- * @see #getAllFonts()
- * @see Font#getFamily()
- * @since 1.2
- */
- public abstract String[] getAvailableFontFamilyNames(Locale l);
-
- /**
- * Returns the point where a window should be centered. You should probably
- * also check that the window fits within the screen bounds. The default
- * simply returns the center of the maximum window bounds; subclasses should
- * override this if native objects (like scrollbars) make that off-centered.
- *
- * @return the centering point
- * @throws HeadlessException if the environment is headless
- * @see #getMaximumWindowBounds()
- * @since 1.4
- */
- public Point getCenterPoint()
- {
- Rectangle r = getMaximumWindowBounds();
- return new Point(r.x + r.width / 2, r.y + r.height / 2);
- }
-
- /**
- * Returns the maximum bounds for a centered window object. The default
- * implementation simply returns the bounds of the default configuration
- * of the default screen; subclasses should override this to if native
- * objects (like scrollbars) reduce what is truly available. Also,
- * subclasses should override this if the window should be centered across
- * a multi-screen display.
- *
- * @return the maximum window bounds
- * @throws HeadlessException if the environment is headless
- * @see #getCenterPoint()
- * @see GraphicsConfiguration#getBounds()
- * @see Toolkit#getScreenInsets(GraphicsConfiguration)
- * @since 1.4
- */
- public Rectangle getMaximumWindowBounds()
- {
- return getDefaultScreenDevice().getDefaultConfiguration().getBounds();
- }
-} // class GraphicsEnvironment
diff --git a/libjava/java/awt/GridBagConstraints.java b/libjava/java/awt/GridBagConstraints.java
deleted file mode 100644
index 8d8b4fae534..00000000000
--- a/libjava/java/awt/GridBagConstraints.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/* GridBagConstraints.java -- Constraints for GridBag layout manager
- Copyright (C) 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.io.Serializable;
-
-/**
- * This specifies the constraints for a component managed by the
- * GridBagLayout layout manager.
- */
-public class GridBagConstraints implements Cloneable, Serializable
-{
- static final long serialVersionUID = -1000070633030801713L;
-
- /** Fill in both directions. */
- public static final int BOTH = 1;
- /** Don't fill. */
- public static final int NONE = 0;
- /** Fill horizontally. */
- public static final int HORIZONTAL = 2;
- /** Fill vertically. */
- public static final int VERTICAL = 3;
-
- /** Position in the center. */
- public static final int CENTER = 10;
- /** Position to the east. */
- public static final int EAST = 13;
- /** Position to the north. */
- public static final int NORTH = 11;
- /** Position to the northeast. */
- public static final int NORTHEAST = 12;
- /** Position to the northwest. */
- public static final int NORTHWEST = 18;
- /** Position to the south. */
- public static final int SOUTH = 15;
- /** Position to the southeast. */
- public static final int SOUTHEAST = 14;
- /** Position to the southwest. */
- public static final int SOUTHWEST = 16;
- /** Position to the west. */
- public static final int WEST = 17;
-
- /** Occupy all remaining cells except last cell. */
- public static final int RELATIVE = -1;
- /** Occupy all remaining cells. */
- public static final int REMAINDER = 0;
-
- /**
- * Position to where the first text line would end. Equals to NORTHEAST for
- * horizontal left-to-right orientations.
- */
- public static final int FIRST_LINE_END = 24;
-
- /**
- * Position to where the first text line would start. Equals to NORTHWEST for
- * horizontal left-to-right orientations.
- */
- public static final int FIRST_LINE_START = 23;
-
- /**
- * Position to where the last text line would end. Equals to SOUTHEAST for
- * horizontal left-to-right orientations.
- */
- public static final int LAST_LINE_END = 26;
-
- /**
- * Position to where the last text line would start. Equals to SOUTHWEST for
- * horizontal left-to-right orientations.
- */
- public static final int LAST_LINE_START = 25;
-
- /**
- * Position to where a text line would end. Equals to EAST for
- * left-to-right orientations.
- */
- public static final int LINE_END = 22;
-
- /**
- * Position to where a text line would start. Equals to WEST for
- * left-to-right orientations.
- */
- public static final int LINE_START = 21;
-
- /**
- * Position to where a page ends. Equals SOUTH for horizontal orientations.
- */
- public static final int PAGE_END = 20;
-
- /**
- * Position to where a page starts. Equals NORTH for horizontal orientations.
- */
- public static final int PAGE_START = 19;
-
- public int anchor;
- public int fill;
- public int gridheight;
- public int gridwidth;
- public int gridx;
- public int gridy;
- public Insets insets;
- public int ipadx;
- public int ipady;
- public double weightx;
- public double weighty;
-
- /** Create a copy of this object. */
- public Object clone ()
- {
- try
- {
- GridBagConstraints g = (GridBagConstraints) super.clone ();
- g.insets = (Insets) insets.clone ();
- return g;
- }
- catch (CloneNotSupportedException _)
- {
- // Can't happen.
- return null;
- }
- }
-
- /** Create a new GridBagConstraints object with the default
- * parameters. */
- public GridBagConstraints ()
- {
- this.anchor = CENTER;
- this.fill = NONE;
- this.gridx = RELATIVE;
- this.gridy = RELATIVE;
- this.gridwidth = 1;
- this.gridheight = 1;
- this.ipadx = 0;
- this.ipady = 0;
- this.insets = new Insets (0, 0, 0, 0);
- this.weightx = 0;
- this.weighty = 0;
- }
-
- /** Create a new GridBagConstraints object with the indicated
- * parameters. */
- public GridBagConstraints (int gridx, int gridy,
- int gridwidth, int gridheight,
- double weightx, double weighty,
- int anchor, int fill,
- Insets insets, int ipadx, int ipady)
- {
- this.anchor = anchor;
- this.fill = fill;
- this.gridx = gridx;
- this.gridy = gridy;
- this.gridwidth = gridwidth;
- this.gridheight = gridheight;
- this.ipadx = ipadx;
- this.ipady = ipady;
- this.insets = insets;
- this.weightx = weightx;
- this.weighty = weighty;
- }
-}
diff --git a/libjava/java/awt/GridBagLayout.java b/libjava/java/awt/GridBagLayout.java
deleted file mode 100644
index efa429dc327..00000000000
--- a/libjava/java/awt/GridBagLayout.java
+++ /dev/null
@@ -1,1067 +0,0 @@
-/* GridBagLayout - Layout manager for components according to GridBagConstraints
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- * @author Jeroen Frijters (jeroen@frijters.net)
- */
-public class GridBagLayout
- implements Serializable, LayoutManager2
-{
- private static final long serialVersionUID = 8838754796412211005L;
-
- protected static final int MINSIZE = 1;
- protected static final int PREFERREDSIZE = 2;
- protected static final int MAXGRIDSIZE = 512;
-
- // comptable remembers the original contraints given to us.
- // internalcomptable is used to keep track of modified constraint values
- // that we calculate, particularly when we are given RELATIVE and
- // REMAINDER constraints.
- // Constraints kept in comptable are never modified, and constraints
- // kept in internalcomptable can be modified internally only.
- protected Hashtable comptable;
- private Hashtable internalcomptable;
- protected GridBagLayoutInfo layoutInfo;
- protected GridBagConstraints defaultConstraints;
-
- public double[] columnWeights;
- public int[] columnWidths;
- public double[] rowWeights;
- public int[] rowHeights;
-
- public GridBagLayout ()
- {
- this.comptable = new Hashtable();
- this.internalcomptable = new Hashtable();
- this.defaultConstraints= new GridBagConstraints();
- }
-
- /**
- * Helper method to calc the sum of a range of elements in an int array.
- */
- private int sumIntArray (int[] array, int upto)
- {
- int result = 0;
-
- for (int i = 0; i < upto; i++)
- result += array [i];
-
- return result;
- }
-
- /**
- * Helper method to calc the sum of all elements in an int array.
- */
- private int sumIntArray (int[] array)
- {
- return sumIntArray(array, array.length);
- }
-
- /**
- * Helper method to calc the sum of all elements in an double array.
- */
- private double sumDoubleArray (double[] array)
- {
- double result = 0;
-
- for (int i = 0; i < array.length; i++)
- result += array [i];
-
- return result;
- }
-
- public void addLayoutComponent (String name, Component component)
- {
- // do nothing here.
- }
-
- public void removeLayoutComponent (Component component)
- {
- // do nothing here
- }
-
- public void addLayoutComponent (Component component, Object constraints)
- {
- if (constraints == null)
- return;
-
- if (!(constraints instanceof GridBagConstraints))
- throw new IllegalArgumentException();
-
- setConstraints (component, (GridBagConstraints) constraints);
- }
-
- public Dimension preferredLayoutSize (Container parent)
- {
- if (parent == null)
- return new Dimension (0, 0);
-
- GridBagLayoutInfo li = getLayoutInfo (parent, PREFERREDSIZE);
- return getMinSize (parent, li);
- }
-
- public Dimension minimumLayoutSize (Container parent)
- {
- if (parent == null)
- return new Dimension (0, 0);
-
- GridBagLayoutInfo li = getLayoutInfo (parent, MINSIZE);
- return getMinSize (parent, li);
- }
-
- public Dimension maximumLayoutSize (Container target)
- {
- return new Dimension (Integer.MAX_VALUE, Integer.MAX_VALUE);
- }
-
- public void layoutContainer (Container parent)
- {
- arrangeGrid (parent);
- }
-
- public float getLayoutAlignmentX (Container target)
- {
- return Component.CENTER_ALIGNMENT;
- }
-
- public float getLayoutAlignmentY (Container target)
- {
- return Component.CENTER_ALIGNMENT;
- }
-
- public void invalidateLayout (Container target)
- {
- this.layoutInfo = null;
- }
-
- public void setConstraints (Component component,
- GridBagConstraints constraints)
- {
- GridBagConstraints clone = (GridBagConstraints) constraints.clone();
-
- if (clone.gridx < 0)
- clone.gridx = GridBagConstraints.RELATIVE;
-
- if (clone.gridy < 0)
- clone.gridy = GridBagConstraints.RELATIVE;
-
- if (clone.gridwidth == 0)
- clone.gridwidth = GridBagConstraints.REMAINDER;
- else if (clone.gridwidth < 0
- && clone.gridwidth != GridBagConstraints.REMAINDER
- && clone.gridwidth != GridBagConstraints.RELATIVE)
- clone.gridwidth = 1;
-
- if (clone.gridheight == 0)
- clone.gridheight = GridBagConstraints.REMAINDER;
- else if (clone.gridheight < 0
- && clone.gridheight != GridBagConstraints.REMAINDER
- && clone.gridheight != GridBagConstraints.RELATIVE)
- clone.gridheight = 1;
-
- comptable.put (component, clone);
- }
-
- public GridBagConstraints getConstraints (Component component)
- {
- return (GridBagConstraints) (lookupConstraints (component).clone());
- }
-
- protected GridBagConstraints lookupConstraints (Component component)
- {
- GridBagConstraints result = (GridBagConstraints) comptable.get (component);
-
- if (result == null)
- {
- setConstraints (component, defaultConstraints);
- result = (GridBagConstraints) comptable.get (component);
- }
-
- return result;
- }
-
- private GridBagConstraints lookupInternalConstraints (Component component)
- {
- GridBagConstraints result =
- (GridBagConstraints) internalcomptable.get (component);
-
- if (result == null)
- {
- result = (GridBagConstraints) lookupConstraints(component).clone();
- internalcomptable.put (component, result);
- }
-
- return result;
- }
-
- /**
- * @since 1.1
- */
- public Point getLayoutOrigin ()
- {
- if (layoutInfo == null)
- return new Point (0, 0);
-
- return new Point (layoutInfo.pos_x, layoutInfo.pos_y);
- }
-
- /**
- * @since 1.1
- */
- public int[][] getLayoutDimensions ()
- {
- int[][] result = new int [2][];
- if (layoutInfo == null)
- {
- result[0] = new int[0];
- result[1] = new int[0];
-
- return result;
- }
-
- result [0] = new int [layoutInfo.cols];
- System.arraycopy (layoutInfo.colWidths, 0, result [0], 0, layoutInfo.cols);
- result [1] = new int [layoutInfo.rows];
- System.arraycopy (layoutInfo.rowHeights, 0, result [1], 0, layoutInfo.rows);
- return result;
- }
-
- public double[][] getLayoutWeights ()
- {
- double[][] result = new double [2][];
- if (layoutInfo == null)
- {
- result[0] = new double[0];
- result[1] = new double[0];
-
- return result;
- }
-
- result [0] = new double [layoutInfo.cols];
- System.arraycopy (layoutInfo.colWeights, 0, result [0], 0, layoutInfo.cols);
- result [1] = new double [layoutInfo.rows];
- System.arraycopy (layoutInfo.rowWeights, 0, result [1], 0, layoutInfo.rows);
- return result;
- }
-
- /**
- * @since 1.1
- */
- public Point location (int x, int y)
- {
- if (layoutInfo == null)
- return new Point (0, 0);
-
- int col;
- int row;
- int pixel_x = layoutInfo.pos_x;
- int pixel_y = layoutInfo.pos_y;
-
- for (col = 0; col < layoutInfo.cols; col++)
- {
- int w = layoutInfo.colWidths [col];
- if (x < pixel_x + w)
- break;
-
- pixel_x += w;
- }
-
- for (row = 0; row < layoutInfo.rows; row++)
- {
- int h = layoutInfo.rowHeights [row];
- if (y < pixel_y + h)
- break;
-
- pixel_y += h;
- }
-
- return new Point (col, row);
- }
-
- /**
- * Obsolete.
- */
- protected void AdjustForGravity (GridBagConstraints gbc, Rectangle rect)
- {
- // FIXME
- throw new Error ("Not implemented");
- }
-
- /**
- * Obsolete.
- */
- protected void ArrangeGrid (Container parent)
- {
- Component[] components = parent.getComponents();
-
- if (components.length == 0)
- return;
-
- GridBagLayoutInfo info = getLayoutInfo (parent, PREFERREDSIZE);
- if (info.cols == 0 && info.rows == 0)
- return;
- layoutInfo = info;
-
- // DEBUG
- //dumpLayoutInfo (layoutInfo);
-
- for(int i = 0; i < components.length; i++)
- {
- Component component = components [i];
-
- // If component is not visible we dont have to care about it.
- if (!component.isVisible())
- continue;
-
- GridBagConstraints constraints =
- lookupInternalConstraints(component);
-
- int cellx = sumIntArray(layoutInfo.colWidths, constraints.gridx);
- int celly = sumIntArray(layoutInfo.rowHeights, constraints.gridy);
- int cellw = sumIntArray(layoutInfo.colWidths,
- constraints.gridx + constraints.gridwidth) - cellx;
- int cellh = sumIntArray(layoutInfo.rowHeights,
- constraints.gridy + constraints.gridheight) - celly;
-
- Insets insets = constraints.insets;
- if (insets != null)
- {
- cellx += insets.left;
- celly += insets.top;
- cellw -= insets.left + insets.right;
- cellh -= insets.top + insets.bottom;
- }
-
- Dimension dim = component.getPreferredSize();
-
- // Note: Documentation says that padding is added on both sides, but
- // visual inspection shows that the Sun implementation only adds it
- // once, so we do the same.
- dim.width += constraints.ipadx;
- dim.height += constraints.ipady;
-
- switch(constraints.fill)
- {
- case GridBagConstraints.HORIZONTAL:
- dim.width = cellw;
- break;
- case GridBagConstraints.VERTICAL:
- dim.height = cellh;
- break;
- case GridBagConstraints.BOTH:
- dim.width = cellw;
- dim.height = cellh;
- break;
- }
-
- int x;
- int y;
-
- switch(constraints.anchor)
- {
- case GridBagConstraints.NORTH:
- x = cellx + (cellw - dim.width) / 2;
- y = celly;
- break;
- case GridBagConstraints.SOUTH:
- x = cellx + (cellw - dim.width) / 2;
- y = celly + cellh - dim.height;
- break;
- case GridBagConstraints.WEST:
- x = cellx;
- y = celly + (cellh - dim.height) / 2;
- break;
- case GridBagConstraints.EAST:
- x = cellx + cellw - dim.width;
- y = celly + (cellh - dim.height) / 2;
- break;
- case GridBagConstraints.NORTHEAST:
- x = cellx + cellw - dim.width;
- y = celly;
- break;
- case GridBagConstraints.NORTHWEST:
- x = cellx;
- y = celly;
- break;
- case GridBagConstraints.SOUTHEAST:
- x = cellx + cellw - dim.width;
- y = celly + cellh - dim.height;
- break;
- case GridBagConstraints.SOUTHWEST:
- x = cellx;
- y = celly + cellh - dim.height;
- break;
- default:
- x = cellx + (cellw - dim.width) / 2;
- y = celly + (cellh - dim.height) / 2;
- break;
- }
-
- component.setBounds(layoutInfo.pos_x + x, layoutInfo.pos_y + y, dim.width, dim.height);
- }
-
- // DEBUG
- //dumpLayoutInfo (layoutInfo);
- }
-
- /**
- * Obsolete.
- */
- protected GridBagLayoutInfo GetLayoutInfo (Container parent, int sizeflag)
- {
- if (sizeflag != MINSIZE && sizeflag != PREFERREDSIZE)
- throw new IllegalArgumentException();
-
- Dimension parentDim = parent.getSize ();
- Insets parentInsets = parent.getInsets ();
- parentDim.width -= parentInsets.left + parentInsets.right;
- parentDim.height -= parentInsets.top + parentInsets.bottom;
-
- int current_y = 0;
- int max_x = 0;
- int max_y = 0;
-
- // Guaranteed to contain the last component added to the given row
- // or column, whose gridwidth/height is not REMAINDER.
- HashMap lastInRow = new HashMap();
- HashMap lastInCol = new HashMap();
-
- Component[] components = parent.getComponents();
-
- // Components sorted by gridwidths/heights,
- // smallest to largest, with REMAINDER and RELATIVE at the end.
- // These are useful when determining sizes and weights.
- ArrayList sortedByWidth = new ArrayList(components.length);
- ArrayList sortedByHeight = new ArrayList(components.length);
-
- // STEP 1: first we figure out how many rows/columns
- for (int i = 0; i < components.length; i++)
- {
- Component component = components [i];
-
- // If component is not visible we dont have to care about it.
- if (!component.isVisible())
- continue;
-
- // When looking up the constraint for the first time, check the
- // original unmodified constraint. After the first time, always
- // refer to the internal modified constraint.
- GridBagConstraints originalConstraints = lookupConstraints (component);
- GridBagConstraints constraints = (GridBagConstraints) originalConstraints.clone();
- internalcomptable.put(component, constraints);
-
- // Cases:
- //
- // 1. gridy == RELATIVE, gridx == RELATIVE
- //
- // use y as the row number; check for the next
- // available slot at row y
- //
- // 2. only gridx == RELATIVE
- //
- // check for the next available slot at row gridy
- //
- // 3. only gridy == RELATIVE
- //
- // check for the next available slot at column gridx
- //
- // 4. neither gridx or gridy == RELATIVE
- //
- // nothing to check; just add it
-
-
- // cases 1 and 2
- if(constraints.gridx == GridBagConstraints.RELATIVE)
- {
- if (constraints.gridy == GridBagConstraints.RELATIVE)
- constraints.gridy = current_y;
-
- int x;
-
- // Check the component that occupies the right-most spot in this
- // row. We want to add this component after it.
- // If this row is empty, add to the 0 position.
- if (!lastInRow.containsKey(new Integer(constraints.gridy)))
- x = 0;
- else
- {
- Component lastComponent = (Component) lastInRow.get(new Integer(constraints.gridy));
- GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent);
- x = lastConstraints.gridx + Math.max(1, lastConstraints.gridwidth);
- }
-
- // Determine if this component will fit in the slot vertically.
- // If not, bump it over to where it does fit.
- for (int y = constraints.gridy + 1; y < constraints.gridy + Math.max(1, constraints.gridheight); y++)
- {
- if (lastInRow.containsKey(new Integer(y)))
- {
- Component lastComponent = (Component) lastInRow.get(new Integer(y));
- GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent);
- x = Math.max (x,
- lastConstraints.gridx + Math.max(1, lastConstraints.gridwidth));
- }
- }
-
- constraints.gridx = x;
- }
- // case 3
- else if(constraints.gridy == GridBagConstraints.RELATIVE)
- {
- int y;
- // Check the component that occupies the bottom-most spot in
- // this column. We want to add this component below it.
- // If this column is empty, add to the 0 position.
- if (!lastInCol.containsKey(new Integer(constraints.gridx)))
- y = 0;
- else
- {
- Component lastComponent = (Component)lastInCol.get(new Integer(constraints.gridx));
- GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent);
- y = lastConstraints.gridy + Math.max(1, lastConstraints.gridheight);
- }
-
- // Determine if this component will fit in the slot horizontally.
- // If not, bump it down to where it does fit.
- for (int x = constraints.gridx + 1; x < constraints.gridx + Math.max(1, constraints.gridwidth); x++)
- {
- if (lastInCol.containsKey(new Integer(x)))
- {
- Component lastComponent = (Component) lastInCol.get(new Integer(x));
- GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent);
- y = Math.max (y,
- lastConstraints.gridy + Math.max(1, lastConstraints.gridheight));
- }
- }
-
- constraints.gridy = y;
- }
- // case 4: do nothing
-
- max_x = Math.max(max_x,
- constraints.gridx + Math.max(1, constraints.gridwidth));
- max_y = Math.max(max_y,
- constraints.gridy + Math.max(1, constraints.gridheight));
-
- sortBySpan(component, constraints.gridwidth, sortedByWidth, true);
- sortBySpan(component, constraints.gridheight, sortedByHeight, false);
-
- // Update our reference points for RELATIVE gridx and gridy.
- if(constraints.gridwidth == GridBagConstraints.REMAINDER)
- {
- current_y = constraints.gridy + Math.max(1, constraints.gridheight);
- }
- else if (constraints.gridwidth != GridBagConstraints.REMAINDER)
- {
- for (int y = constraints.gridy; y < constraints.gridy + Math.max(1, constraints.gridheight); y++)
- {
- if(lastInRow.containsKey(new Integer(y)))
- {
- Component lastComponent = (Component) lastInRow.get(new Integer(y));
- GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent);
- if (constraints.gridx > lastConstraints.gridx)
- {
- lastInRow.put(new Integer(y), component);
- }
- }
- else
- {
- lastInRow.put(new Integer(y), component);
- }
- }
-
- for (int x = constraints.gridx; x < constraints.gridx + Math.max(1, constraints.gridwidth); x++)
- {
- if(lastInCol.containsKey(new Integer(x)))
- {
- Component lastComponent = (Component) lastInCol.get(new Integer(x));
- GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent);
- if (constraints.gridy > lastConstraints.gridy)
- {
- lastInCol.put(new Integer(x), component);
- }
- }
- else
- {
- lastInCol.put(new Integer(x), component);
- }
- }
- }
- } // end of STEP 1
-
- GridBagLayoutInfo info = new GridBagLayoutInfo(max_x, max_y);
-
- // Check if column widths and row heights are overridden.
-
- for (int x = 0; x < max_x; x++)
- {
- if(columnWidths != null && columnWidths.length > x)
- info.colWidths[x] = columnWidths[x];
- if(columnWeights != null && columnWeights.length > x)
- info.colWeights[x] = columnWeights[x];
- }
-
- for (int y = 0; y < max_y; y++)
- {
- if(rowHeights != null && rowHeights.length > y)
- info.rowHeights[y] = rowHeights[y];
- if(rowWeights != null && rowWeights.length > y)
- info.rowWeights[y] = rowWeights[y];
- }
-
- // STEP 2: Fix up any cells with width/height as REMAINDER/RELATIVE.
- for (int i = 0; i < components.length; i++)
- {
- Component component = components [i];
-
- // If component is not visible we dont have to care about it.
- if (!component.isVisible())
- continue;
-
- GridBagConstraints constraints = lookupInternalConstraints (component);
-
- if(constraints.gridwidth == GridBagConstraints.REMAINDER || constraints.gridwidth == GridBagConstraints.RELATIVE)
- {
- if(constraints.gridwidth == GridBagConstraints.REMAINDER)
- {
- for (int y = constraints.gridy; y < constraints.gridy + Math.max(1, constraints.gridheight); y++)
- {
- if (lastInRow.containsKey(new Integer(y)))
- {
- Component lastComponent = (Component) lastInRow.get(new Integer(y));
- GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent);
-
- if (lastConstraints.gridwidth == GridBagConstraints.RELATIVE)
- {
- constraints.gridx = max_x - 1;
- break;
- }
- else
- {
- constraints.gridx = Math.max (constraints.gridx,
- lastConstraints.gridx + Math.max (1, lastConstraints.gridwidth));
- }
- }
- }
- constraints.gridwidth = max_x - constraints.gridx;
- }
- else if (constraints.gridwidth == GridBagConstraints.RELATIVE)
- {
- constraints.gridwidth = max_x - constraints.gridx - 1;
- }
-
- // Re-sort
- sortedByWidth.remove(sortedByWidth.indexOf(component));
- sortBySpan(component, constraints.gridwidth, sortedByWidth, true);
- }
-
- if(constraints.gridheight == GridBagConstraints.REMAINDER || constraints.gridheight == GridBagConstraints.RELATIVE)
- {
- if(constraints.gridheight == GridBagConstraints.REMAINDER)
- {
- for (int x = constraints.gridx; x < constraints.gridx + Math.max(1, constraints.gridwidth); x++)
- {
- if (lastInCol.containsKey(new Integer(x)))
- {
- Component lastComponent = (Component) lastInRow.get(new Integer(x));
- GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent);
-
- if (lastConstraints.gridheight == GridBagConstraints.RELATIVE)
- {
- constraints.gridy = max_y - 1;
- break;
- }
- else
- {
- constraints.gridy = Math.max (constraints.gridy,
- lastConstraints.gridy + Math.max (1, lastConstraints.gridheight));
- }
- }
- }
- constraints.gridheight = max_y - constraints.gridy;
- }
- else if (constraints.gridheight == GridBagConstraints.RELATIVE)
- {
- constraints.gridheight = max_y - constraints.gridy - 1;
- }
-
- // Re-sort
- sortedByHeight.remove(sortedByHeight.indexOf(component));
- sortBySpan(component, constraints.gridheight, sortedByHeight, false);
- }
- } // end of STEP 2
-
- // STEP 3: Determine sizes and weights for columns.
- for (int i = 0; i < sortedByWidth.size(); i++)
- {
- Component component = (Component) sortedByWidth.get(i);
-
- // If component is not visible we dont have to care about it.
- if (!component.isVisible())
- continue;
-
- GridBagConstraints constraints = lookupInternalConstraints (component);
-
- int width = (sizeflag == PREFERREDSIZE) ?
- component.getPreferredSize().width :
- component.getMinimumSize().width;
-
- if(constraints.insets != null)
- width += constraints.insets.left + constraints.insets.right;
-
- width += constraints.ipadx;
-
- distributeSizeAndWeight(width,
- constraints.weightx,
- constraints.gridx,
- constraints.gridwidth,
- info.colWidths,
- info.colWeights);
- } // end of STEP 3
-
- // STEP 4: Determine sizes and weights for rows.
- for (int i = 0; i < sortedByHeight.size(); i++)
- {
- Component component = (Component) sortedByHeight.get(i);
-
- // If component is not visible we dont have to care about it.
- if (!component.isVisible())
- continue;
-
- GridBagConstraints constraints = lookupInternalConstraints (component);
-
- int height = (sizeflag == PREFERREDSIZE) ?
- component.getPreferredSize().height :
- component.getMinimumSize().height;
-
- if(constraints.insets != null)
- height += constraints.insets.top + constraints.insets.bottom;
-
- height += constraints.ipady;
-
- distributeSizeAndWeight(height,
- constraints.weighty,
- constraints.gridy,
- constraints.gridheight,
- info.rowHeights,
- info.rowWeights);
- } // end of STEP 4
-
- // Adjust cell sizes iff parent size not zero.
- if (parentDim.width > 0 && parentDim.height > 0)
- {
- calcCellSizes (info.colWidths, info.colWeights, parentDim.width);
- calcCellSizes (info.rowHeights, info.rowWeights, parentDim.height);
- }
-
- int totalWidth = sumIntArray(info.colWidths);
- int totalHeight = sumIntArray(info.rowHeights);
-
- // Make sure pos_x and pos_y are never negative.
- if (totalWidth >= parentDim.width)
- info.pos_x = parentInsets.left;
- else
- info.pos_x = parentInsets.left + (parentDim.width - totalWidth) / 2;
-
- if (totalHeight >= parentDim.height)
- info.pos_y = parentInsets.top;
- else
- info.pos_y = parentInsets.top + (parentDim.height - totalHeight) / 2;
-
- // DEBUG
- //dumpLayoutInfo (info);
-
- return info;
- }
-
- /**
- * Obsolete.
- */
- protected Dimension GetMinSize (Container parent, GridBagLayoutInfo info)
- {
- if (parent == null || info == null)
- return new Dimension (0, 0);
-
- Insets insets = parent.getInsets();
- int width = sumIntArray (info.colWidths) + insets.left + insets.right;
- int height = sumIntArray (info.rowHeights) + insets.top + insets.bottom;
- return new Dimension (width, height);
- }
-
- /**
- * @since 1.4
- */
- protected Dimension getMinSize (Container parent, GridBagLayoutInfo info)
- {
- return GetMinSize (parent, info);
- }
-
- /**
- * Helper method used by GetLayoutInfo to keep components sorted, either
- * by gridwidth or gridheight.
- *
- * @param component Component to add to the sorted list.
- * @param span Either the component's gridwidth or gridheight.
- * @param list <code>ArrayList</code> of components, sorted by
- * their span.
- * @param sortByWidth Flag indicating sorting index. If true, sort by
- * width. Otherwise, sort by height.
- * FIXME: Use a better sorting algorithm.
- */
- private void sortBySpan (Component component, int span, ArrayList list, boolean sortByWidth)
- {
- if (span == GridBagConstraints.REMAINDER
- || span == GridBagConstraints.RELATIVE)
- {
- // Put all RELATIVE and REMAINDER components at the end.
- list.add(component);
- }
- else
- {
- int i = 0;
- if (list.size() > 0)
- {
- GridBagConstraints gbc = lookupInternalConstraints((Component) list.get(i));
- int otherspan = sortByWidth ?
- gbc.gridwidth :
- gbc.gridheight;
- while (otherspan != GridBagConstraints.REMAINDER
- && otherspan != GridBagConstraints.RELATIVE
- && span >= otherspan)
- {
- i++;
- if (i < list.size())
- {
- gbc = lookupInternalConstraints((Component) list.get(i));
- otherspan = sortByWidth ?
- gbc.gridwidth :
- gbc.gridheight;
- }
- else
- break;
- }
- }
- list.add(i, component);
- }
- }
-
- /**
- * Helper method used by GetLayoutInfo to distribute a component's size
- * and weight.
- *
- * @param size Preferred size of component, with inset and padding
- * already added.
- * @param weight Weight of component.
- * @param start Starting position of component. Either
- * constraints.gridx or gridy.
- * @param span Span of component. either contraints.gridwidth or
- * gridheight.
- * @param sizes Sizes of rows or columns.
- * @param weights Weights of rows or columns.
- */
- private void distributeSizeAndWeight (int size, double weight,
- int start, int span,
- int[] sizes, double[] weights)
- {
- if (span == 1)
- {
- sizes[start] = Math.max(sizes[start], size);
- weights[start] = Math.max(weights[start], weight);
- }
- else
- {
- int numOccupied = span;
- int lastOccupied = -1;
-
- for(int i = start; i < start + span; i++)
- {
- if (sizes[i] == 0.0)
- numOccupied--;
- else
- {
- size -= sizes[i];
- lastOccupied = i;
- }
- }
-
- // A component needs to occupy at least one row.
- if(numOccupied == 0)
- sizes[start + span - 1] = size;
- else if (size > 0)
- sizes[lastOccupied] += size;
-
- calcCellWeights(weight, weights, start, span);
- }
- }
-
- /**
- * Helper method used by GetLayoutInfo to calculate weight distribution.
- * @param weight Weight of component.
- * @param weights Weights of rows/columns.
- * @param start Starting position of component in grid (gridx/gridy).
- * @param span Span of component (gridwidth/gridheight).
- */
- private void calcCellWeights (double weight, double[] weights, int start, int span)
- {
- double totalWeight = 0.0;
- for(int k = start; k < start + span; k++)
- totalWeight += weights[k];
-
- if(weight > totalWeight)
- {
- if (totalWeight == 0.0)
- {
- weights[start + span - 1] += weight;
- }
- else
- {
- double diff = weight - totalWeight ;
- double remaining = diff;
-
- for(int k = start; k < start + span; k++)
- {
- double extraWeight = diff * weights[k] / totalWeight;
- weights[k] += extraWeight;
- remaining -= extraWeight;
- }
-
- if (remaining > 0.0 && weights[start + span - 1] != 0.0)
- {
- weights[start + span - 1] += remaining;
- }
- }
- }
- }
-
- /**
- * Helper method used by GetLayoutInfo to distribute extra space
- * based on weight distribution.
- *
- * @param sizes Sizes of rows/columns.
- * @param weights Weights of rows/columns.
- * @param range Dimension of container.
- */
- private void calcCellSizes (int[] sizes, double[] weights, int range)
- {
- int totalSize = sumIntArray (sizes);
- double totalWeight = sumDoubleArray (weights);
-
- int diff = range - totalSize;
-
- if (diff == 0)
- return;
-
- for (int i = 0; i < sizes.length; i++)
- {
- int newsize = (int) (sizes[i] + (((double) diff) * weights [i] / totalWeight ));
-
- if (newsize > 0)
- sizes[i] = newsize;
- }
- }
-
- private void dumpLayoutInfo (GridBagLayoutInfo info)
- {
- System.out.println ("GridBagLayoutInfo:");
- System.out.println ("cols: " + info.cols + ", rows: " + info.rows);
- System.out.print ("colWidths: ");
- dumpArray(info.colWidths);
- System.out.print ("rowHeights: ");
- dumpArray(info.rowHeights);
- System.out.print ("colWeights: ");
- dumpArray(info.colWeights);
- System.out.print ("rowWeights: ");
- dumpArray(info.rowWeights);
- }
-
- private void dumpArray(int[] array)
- {
- String sep = "";
- for(int i = 0; i < array.length; i++)
- {
- System.out.print(sep);
- System.out.print(array[i]);
- sep = ", ";
- }
- System.out.println();
- }
-
- private void dumpArray(double[] array)
- {
- String sep = "";
- for(int i = 0; i < array.length; i++)
- {
- System.out.print(sep);
- System.out.print(array[i]);
- sep = ", ";
- }
- System.out.println();
- }
-
- /**
- * @since 1.4
- */
- protected void arrangeGrid (Container parent)
- {
- ArrangeGrid (parent);
- }
-
- /**
- * @since 1.4
- */
- protected GridBagLayoutInfo getLayoutInfo (Container parent, int sizeflag)
- {
- return GetLayoutInfo (parent, sizeflag);
- }
-
- /**
- * @since 1.4
- */
- protected void adjustForGravity (GridBagConstraints gbc, Rectangle rect)
- {
- AdjustForGravity (gbc, rect);
- }
-}
diff --git a/libjava/java/awt/GridBagLayoutInfo.java b/libjava/java/awt/GridBagLayoutInfo.java
deleted file mode 100644
index 43ba09d72c1..00000000000
--- a/libjava/java/awt/GridBagLayoutInfo.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* GridBagLayoutInfo -
- Copyright (C) 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.io.Serializable;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-class GridBagLayoutInfo implements Serializable
-{
- private static final long serialVersionUID = -4899416460737170217L;
-
- int pos_x;
- int pos_y;
- int cols;
- int rows;
- int colWidths[];
- int rowHeights[];
- double colWeights[];
- double rowWeights[];
-
- GridBagLayoutInfo (int cols, int rows)
- {
- this.pos_x = 0;
- this.pos_y = 0;
- this.cols = cols;
- this.rows = rows;
- this.colWidths = new int [cols];
- this.rowHeights = new int [rows];
- this.colWeights = new double [cols];
- this.rowWeights = new double [rows];
- }
-}
diff --git a/libjava/java/awt/GridLayout.java b/libjava/java/awt/GridLayout.java
deleted file mode 100644
index 80d96414249..00000000000
--- a/libjava/java/awt/GridLayout.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/* GridLayout.java -- Grid-based layout engine
- Copyright (C) 1999, 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.io.Serializable;
-
-/** This class implements a grid-based layout scheme. Components are
- * all given the same size and are laid out from left to right and top
- * to bottom. A GridLayout is configured with a number of rows and a
- * number of columns. If both are specified, then the number of
- * columns is ignored and is derived from the number of rows and the
- * total number of components. If either is zero then that dimension
- * is computed based on the actual size of the container. An
- * exception is thrown if an attempt is made to set both the number of
- * rows and the number of columns to 0. This class also supports
- * horizontal and vertical gaps; these are used as spacing between
- * cells.
- *
- * @author Tom Tromey (tromey@redhat.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class GridLayout implements LayoutManager, Serializable
-{
- static final long serialVersionUID = -7411804673224730901L;
-
- /** Add a new component to the layout. This particular implementation
- * does nothing.
- * @param name The name of the component to add.
- * @param comp The component to add.
- */
- public void addLayoutComponent (String name, Component comp)
- {
- // Nothing.
- }
-
- /** Return the number of columns in this layout. */
- public int getColumns ()
- {
- return cols;
- }
-
- /** Return the horizontal gap. */
- public int getHgap ()
- {
- return hgap;
- }
-
- /** Return the number of rows in this layout. */
- public int getRows ()
- {
- return rows;
- }
-
- /** Return the vertical gap. */
- public int getVgap ()
- {
- return vgap;
- }
-
- /** Create a new <code>GridLayout</code> with one row and any number
- * of columns. Both gaps are set to 0.
- */
- public GridLayout ()
- {
- this (1, 0, 0, 0);
- }
-
- /** Create a new <code>GridLayout</code> with the specified number
- * of rows and columns. Both gaps are set to 0. Note that the row
- * and column settings cannot both be zero. If both the row and
- * column values are non-zero, the rows value takes precedence.
- * @param rows Number of rows
- * @param cols Number of columns
- * @exception IllegalArgumentException If rows and columns are both
- * 0, or if either are negative
- */
- public GridLayout (int rows, int cols)
- {
- this (rows, cols, 0, 0);
- }
-
- /** Create a new GridLayout with the specified number of rows and
- * columns and the specified gaps.
- * Note that the row and column settings cannot both be
- * zero. If both the row and column values are non-zero, the rows value
- * takes precedence.
- * @param rows Number of rows
- * @param cols Number of columns
- * @param hgap The horizontal gap
- * @param vgap The vertical gap
- * @exception IllegalArgumentException If rows and columns are both
- * 0, if either are negative, or if either gap is negative
- */
- public GridLayout (int rows, int cols, int hgap, int vgap)
- {
- if (rows < 0)
- throw new IllegalArgumentException ("number of rows cannot be negative");
- if (cols < 0)
- throw new IllegalArgumentException ("number of columns cannot be negative");
- if (rows == 0 && cols == 0)
- throw new IllegalArgumentException ("both rows and columns cannot be 0");
- if (hgap < 0)
- throw new IllegalArgumentException ("horizontal gap must be nonnegative");
- if (vgap < 0)
- throw new IllegalArgumentException ("vertical gap must be nonnegative");
- this.rows = rows;
- this.cols = cols;
- this.hgap = hgap;
- this.vgap = vgap;
- }
-
- /** Lay out the container's components based on current settings.
- * The free space in the container is divided evenly into the specified
- * number of rows and columns in this object.
- * @param parent The container to lay out
- */
- public void layoutContainer (Container parent)
- {
- synchronized (parent.getTreeLock ())
- {
- int num = parent.ncomponents;
-
- // There's no point, and handling this would mean adding special
- // cases.
- if (num == 0)
- return;
-
- // This is more efficient than calling getComponents().
- Component[] comps = parent.component;
-
- int real_rows = rows;
- int real_cols = cols;
- if (real_rows == 0)
- real_rows = (num + real_cols - 1) / real_cols;
- else
- real_cols = (num + real_rows - 1) / real_rows;
-
- // We might have less than a single row. In this case we expand
- // to fill.
- if (num < real_cols)
- real_cols = num;
-
- Dimension d = parent.getSize ();
- Insets ins = parent.getInsets ();
-
- // Compute width and height of each cell in the grid.
- int tw = d.width - ins.left - ins.right;
- tw = (tw - (real_cols - 1) * hgap) / real_cols;
- int th = d.height - ins.top - ins.bottom;
- th = (th - (real_rows - 1) * vgap) / real_rows;
-
- // If the cells are too small, still try to do something.
- if (tw < 0)
- tw = 1;
- if (th < 0)
- th = 1;
-
- int x = ins.left;
- int y = ins.top;
- int i = 0;
- int recount = 0;
-
- while (i < num)
- {
- comps[i].setBounds (x, y, tw, th);
-
- ++i;
- ++recount;
- if (recount == real_cols)
- {
- recount = 0;
- y += vgap + th;
- x = ins.left;
- }
- else
- x += hgap + tw;
- }
- }
- }
-
- /** Get the minimum layout size of the container.
- * @param cont The parent container
- */
- public Dimension minimumLayoutSize (Container cont)
- {
- return getSize (cont, true);
- }
-
- /** Get the preferred layout size of the container.
- * @param cont The parent container
- */
- public Dimension preferredLayoutSize (Container cont)
- {
- return getSize (cont, false);
- }
-
- /** Remove the indicated component from this layout manager.
- * This particular implementation does nothing.
- * @param comp The component to remove
- */
- public void removeLayoutComponent (Component comp)
- {
- // Nothing.
- }
-
- /** Set the number of columns.
- * @param newCols
- * @exception IllegalArgumentException If the number of columns is
- * negative, or if the number of columns is zero and the number
- * of rows is already 0.
- */
- public void setColumns (int newCols)
- {
- if (newCols < 0)
- throw new IllegalArgumentException ("number of columns cannot be negative");
- if (newCols == 0 && rows == 0)
- throw new IllegalArgumentException ("number of rows is already 0");
- this.cols = newCols;
- }
-
- /** Set the horizontal gap
- * @param hgap The horizontal gap
- * @exception IllegalArgumentException If the hgap value is less than zero.
- */
- public void setHgap (int hgap)
- {
- if (hgap < 0)
- throw new IllegalArgumentException ("horizontal gap must be nonnegative");
- this.hgap = hgap;
- }
-
- /** Set the number of rows
- * @param newRows
- * @exception IllegalArgumentException If the number of rows is
- * negative, or if the number of rows is zero and the number
- * of columns is already 0.
- */
- public void setRows (int newRows)
- {
- if (newRows < 0)
- throw new IllegalArgumentException ("number of rows cannot be negative");
- if (newRows == 0 && cols == 0)
- throw new IllegalArgumentException ("number of columns is already 0");
- this.rows = newRows;
- }
-
- /** Set the vertical gap.
- * @param vgap The vertical gap
- * @exception IllegalArgumentException If the vgap value is less than zero.
- */
- public void setVgap (int vgap)
- {
- if (vgap < 0)
- throw new IllegalArgumentException ("vertical gap must be nonnegative");
- this.vgap = vgap;
- }
-
- /** Return String description of this object. */
- public String toString ()
- {
- return ("[" + getClass ().getName ()
- + ",hgap=" + hgap + ",vgap=" + vgap
- + ",rows=" + rows + ",cols=" + cols
- + "]");
- }
-
- // This method is used to compute the various sizes.
- private Dimension getSize (Container parent, boolean is_min)
- {
- synchronized (parent.getTreeLock ())
- {
- int w = 0, h = 0, num = parent.ncomponents;
- // This is more efficient than calling getComponents().
- Component[] comps = parent.component;
-
- for (int i = 0; i < num; ++i)
- {
- Dimension d;
-
- if (is_min)
- d = comps[i].getMinimumSize ();
- else
- d = comps[i].getPreferredSize ();
-
- w = Math.max (d.width, w);
- h = Math.max (d.height, h);
- }
-
- int real_rows = rows;
- int real_cols = cols;
- if (real_rows == 0)
- real_rows = (num + real_cols - 1) / real_cols;
- else
- real_cols = (num + real_rows - 1) / real_rows;
-
- Insets ins = parent.getInsets ();
- // We subtract out an extra gap here because the gaps are only
- // between cells.
- w = ins.left + ins.right + real_cols * (w + hgap) - hgap;
- h = ins.top + ins.bottom + real_rows * (h + vgap) - vgap;
- return new Dimension (w, h);
- }
- }
-
- /**
- * @serial The number of columns in the grid.
- */
- private int cols;
-
- /**
- * @serial The number of rows in the grid.
- */
- private int rows;
-
- /**
- * @serial The horizontal gap between columns
- */
- private int hgap;
-
- /**
- * @serial The vertical gap between rows
- */
- private int vgap;
-}
diff --git a/libjava/java/awt/HeadlessException.java b/libjava/java/awt/HeadlessException.java
deleted file mode 100644
index b180b1d86f7..00000000000
--- a/libjava/java/awt/HeadlessException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* HeadlessException.java -- operation not possible in headless environment
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This exception is thrown when code dependent on a keyboard, mouse, or
- * display is executed in a headless environment.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status updated to 1.4
- */
-public class HeadlessException extends UnsupportedOperationException
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = 167183644944358563L;
-
- /**
- * Create a new instance with no detailed error message.
- */
- public HeadlessException()
- {
- }
-
- /**
- * Create a new instance with the specified detailed error message.
- *
- * @param message the detailed error message
- */
- public HeadlessException(String message)
- {
- super(message);
- }
-} // class HeadlessException
diff --git a/libjava/java/awt/IllegalComponentStateException.java b/libjava/java/awt/IllegalComponentStateException.java
deleted file mode 100644
index 4a47f1da95d..00000000000
--- a/libjava/java/awt/IllegalComponentStateException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* IllegalComponentStateException.java -- bad component state
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This exception is thrown when the requested operation failed because
- * a component was not in the proper state.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class IllegalComponentStateException extends IllegalStateException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -1889339587208144238L;
-
- /**
- * Create a new instance with no detailed error message.
- */
- public IllegalComponentStateException()
- {
- }
-
- /**
- * Create a new instance with the specified detailed error message.
- *
- * @param message the detailed error message
- */
- public IllegalComponentStateException(String message)
- {
- super(message);
- }
-} // class IllegalComponentStateException
diff --git a/libjava/java/awt/Image.java b/libjava/java/awt/Image.java
deleted file mode 100644
index 32e30674cd7..00000000000
--- a/libjava/java/awt/Image.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/* Image.java -- superclass for images
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.image.FilteredImageSource;
-import java.awt.image.ImageObserver;
-import java.awt.image.ImageProducer;
-import java.awt.image.ReplicateScaleFilter;
-
-/**
- * This is the abstract superclass of all image objects in Java.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.0
- * @status updated to 1.4
- */
-public abstract class Image
-{
- /**
- * This variable is returned whenever a property that is not defined
- * is requested.
- */
- // For debug purposes, this might as well be a unique string.
- public static final Object UndefinedProperty
- = new String("undefined property");
-
- /**
- * Constant indicating that the default scaling algorithm should be used.
- *
- * @since 1.1
- */
- public static final int SCALE_DEFAULT = 1;
-
- /**
- * Constant indicating that a fast scaling algorithm should be used.
- *
- * @since 1.1
- */
- public static final int SCALE_FAST = 2;
-
- /**
- * Constant indicating that a smooth scaling algorithm should be used.
- *
- * @since 1.1
- */
- public static final int SCALE_SMOOTH = 4;
-
- /**
- * Constant indicating that the <code>ReplicateScaleFilter</code> class
- * algorithm should be used for scaling.
- *
- * @see ReplicateScaleFilter
- * @since 1.1
- */
- public static final int SCALE_REPLICATE = 8;
-
- /**
- * Constant indicating that the area averaging scaling algorithm should be
- * used.
- *
- * @see AreaAveragingScaleFilter
- * @since 1.1
- */
- public static final int SCALE_AREA_AVERAGING = 16;
-
- /**
- * A default constructor for subclasses.
- */
- public Image()
- {
- }
-
- /**
- * Returns the width of the image, or -1 if it is unknown. If the
- * image width is unknown, the observer object will be notified when
- * the value is known.
- *
- * @param observer the image observer for this object
- * @return the width in pixels
- * @see #getHeight(ImageObserver)
- */
- public abstract int getWidth(ImageObserver observer);
-
- /**
- * Returns the height of the image, or -1 if it is unknown. If the
- * image height is unknown, the observer object will be notified when
- * the value is known.
- *
- * @param observer the image observer for this object
- * @return the height in pixels
- * @see #getWidth(ImageObserver)
- */
- public abstract int getHeight(ImageObserver observer);
-
- /**
- * Returns the image producer object for this object. The producer is the
- * object which generates pixels for this image.
- *
- * @return the image producer for this object
- */
- public abstract ImageProducer getSource();
-
- /**
- * Returns a graphics context object for drawing an off-screen object.
- * This method is only valid for off-screen objects.
- *
- * @return a graphics context object for an off-screen object
- * @see Graphics#createImage(int, int)
- */
- public abstract Graphics getGraphics();
-
- /**
- * This method requests a named property for an object. The value of the
- * property is returned. The value <code>UndefinedProperty</code> is
- * returned if there is no property with the specified name. The value
- * <code>null</code> is returned if the properties for the object are
- * not yet known. In this case, the specified image observer is notified
- * when the properties are known.
- *
- * @param name the requested property name
- * @param observer the image observer for this object
- * @return the named property, if available
- * @see #UndefinedProperty
- */
- public abstract Object getProperty(String name, ImageObserver observer);
-
- /**
- * Scales the image to the requested dimension. A new Image with asynchronous
- * loading will be produced according to the hints of the algorithm
- * requested. If either the width or height is non-positive, it is adjusted
- * to preserve the original aspect ratio.
- *
- * @param width the width of the scaled image
- * @param height the height of the scaled image
- * @param flags a value indicating the algorithm to use
- * @return the scaled <code>Image</code> object
- * @see #SCALE_DEFAULT
- * @see #SCALE_FAST
- * @see #SCALE_SMOOTH
- * @see #SCALE_REPLICATE
- * @see #SCALE_AREA_AVERAGING
- * @since 1.1
- */
- public Image getScaledInstance(int width, int height, int flags)
- {
- switch (flags)
- {
- case SCALE_DEFAULT:
- case SCALE_FAST:
- case SCALE_REPLICATE:
- ImageProducer producer =
- new FilteredImageSource(this.getSource(),
- new ReplicateScaleFilter(width, height));
- return Toolkit.getDefaultToolkit().createImage(producer);
- case SCALE_SMOOTH:
- case SCALE_AREA_AVERAGING:
- default:
- throw new Error("not implemented");
- }
- }
-
- /**
- * Flushes (that is, destroys) any resources used for this image. This
- * includes the actual image data.
- */
- public abstract void flush();
-} // class Image
diff --git a/libjava/java/awt/ImageCapabilities.java b/libjava/java/awt/ImageCapabilities.java
deleted file mode 100644
index 2fe71d1e23b..00000000000
--- a/libjava/java/awt/ImageCapabilities.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ImageCapabilities.java -- the capabilities of an image buffer
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This class represents the capabilities of an image buffer. An
- * image buffer may be backed by accelerated graphics resources.
- * Those resources may or may not be volatile. This class is used to
- * describe these image buffer characteristics.
- */
-public class ImageCapabilities implements Cloneable
-{
- /**
- * Whether or not this the image buffer uses accelerated graphics
- * resources.
- */
- private final boolean accelerated;
-
- /**
- * Create a new image capability descriptor.
- *
- * @param accelerated true if the image buffer uses accelerated
- * graphics resources
- */
- public ImageCapabilities(boolean accelerated)
- {
- this.accelerated = accelerated;
- }
-
- /**
- * Returns whether or not the image buffer uses accelerated graphics
- * resources.
- *
- * @return true if the image buffer uses accelerated graphics
- * resources; false otherwise
- */
- public boolean isAccelerated()
- {
- return accelerated;
- }
-
- /**
- * Returns whether or not the image buffer's resources are volatile,
- * meaning that they can be reclaimed by the graphics system at any
- * time.
- *
- * @return true if the image buffer's resources are volatile; false
- * otherwise
- */
- public boolean isTrueVolatile()
- {
- return true;
- }
-
- /**
- * Clone this image capability descriptor.
- *
- * @return a clone of this image capability descriptor
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e);
- }
- }
-}
diff --git a/libjava/java/awt/Insets.java b/libjava/java/awt/Insets.java
deleted file mode 100644
index 7238a34e22a..00000000000
--- a/libjava/java/awt/Insets.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* Insets.java -- information about a container border
- Copyright (C) 1999, 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.io.Serializable;
-
-/**
- * This class represents the "margin" or space around a container.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @status
- */
-public class Insets implements Cloneable, Serializable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -2272572637695466749L;
-
- /**
- * The gap from the top.
- *
- * @serial the top inset
- */
- public int top;
-
- /**
- * The gap from the left.
- *
- * @serial the left inset
- */
- public int left;
-
- /**
- * The gap from the bottom.
- *
- * @serial the bottom inset
- */
- public int bottom;
-
- /**
- * The gap from the right.
- *
- * @serial the right inset
- */
- public int right;
-
- /**
- * Initializes a new instance of <code>Inset</code> with the specified
- * inset values.
- *
- * @param top the top inset
- * @param left the left inset
- * @param bottom the bottom inset
- * @param right the right inset
- */
- public Insets(int top, int left, int bottom, int right)
- {
- this.top = top;
- this.left = left;
- this.bottom = bottom;
- this.right = right;
- }
-
- /**
- * Tests whether this object is equal to the specified object. The other
- * object must be an instance of Insets with identical field values.
- *
- * @param obj the object to test against
- * @return true if the specified object is equal to this one
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof Insets))
- return false;
- Insets i = (Insets) obj;
- return top == i.top && bottom == i.bottom
- && left == i.left && right == i.right;
- }
-
- /**
- * Returns a hashcode for this instance. The formula is unspecified, but
- * appears to be <code>XXX what is it? </code>.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- // This can't be right...
- return top + bottom + left + right;
- }
-
- /**
- * Returns a string representation of this object, which will be non-null.
- * The format is unspecified, but appears to be <code>XXX what is it?</code>.
- *
- * @return a string representation of this object
- */
- public String toString()
- {
- return getClass().getName() + "(top=" + top + ",bottom=" + bottom +
- ",left=" + left + ",right=" + right + ')';
- }
-
- /**
- * Returns a copy of this object.
- *
- * @return a copy of this object
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-} // class Insets
diff --git a/libjava/java/awt/ItemSelectable.java b/libjava/java/awt/ItemSelectable.java
deleted file mode 100644
index f155f723efe..00000000000
--- a/libjava/java/awt/ItemSelectable.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* ItemSelectable.java -- items that can be selected
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ItemListener;
-
-/**
- * This interface is for objects that can have one or more items selected.
- * For example, radio buttons.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.0
- * @status updated to 1.4
- */
-public interface ItemSelectable
-{
- /**
- * Returns the list of objects that are selected in this component.
- *
- * @return the list of selected objects, or null
- */
- Object[] getSelectedObjects();
-
- /**
- * Adds an item listener to this object. It will receive selection events
- * for this object by the user (but not programatically). If listener is
- * null, it is ignored.
- *
- * @param listener the item listener to add
- */
- void addItemListener(ItemListener listener);
-
- /**
- * Removes an item listener from this object.
- *
- * @param listener the item listener to remove
- */
- void removeItemListener(ItemListener listener);
-} // interface ItemSelectable
diff --git a/libjava/java/awt/JobAttributes.java b/libjava/java/awt/JobAttributes.java
deleted file mode 100644
index 2acb3a01ed3..00000000000
--- a/libjava/java/awt/JobAttributes.java
+++ /dev/null
@@ -1,500 +0,0 @@
-/* JobAttributes.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * Needs documentation...
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- * @status updated to 1.4, lacks documentation
- */
-public final class JobAttributes implements Cloneable
-{
- public static final class DefaultSelectionType extends AttributeValue
- {
- private static final String[] NAMES = { "all", "range", "selection" };
- public static final DefaultSelectionType ALL
- = new DefaultSelectionType(0);
- public static final DefaultSelectionType RANGE
- = new DefaultSelectionType(1);
- public static final DefaultSelectionType SELECTION
- = new DefaultSelectionType(2);
- private DefaultSelectionType(int value)
- {
- super(value, NAMES);
- }
- } // class DefaultSelectionType
-
- public static final class DestinationType extends AttributeValue
- {
- private static final String[] NAMES = { "file", "printer" };
- public static final DestinationType FILE = new DestinationType(0);
- public static final DestinationType PRINTER = new DestinationType(1);
- private DestinationType(int value)
- {
- super(value, NAMES);
- }
- } // class DestinationType
-
- public static final class DialogType extends AttributeValue
- {
- private static final String[] NAMES = { "common", "native", "none" };
- public static final DialogType COMMON = new DialogType(0);
- public static final DialogType NATIVE = new DialogType(1);
- public static final DialogType NONE = new DialogType(2);
- private DialogType(int value)
- {
- super(value, NAMES);
- }
- } // class DialogType
-
- public static final class MultipleDocumentHandlingType
- extends AttributeValue
- {
- private static final String[] NAMES = {
- "separate-documents-collated-copies",
- "separate-documents-uncollated-copies"
- };
- public static final MultipleDocumentHandlingType
- SEPARATE_DOCUMENTS_COLLATED_COPIES
- = new MultipleDocumentHandlingType(0);
- public static final MultipleDocumentHandlingType
- SEPARATE_DOCUMENTS_UNCOLLATED_COPIES
- = new MultipleDocumentHandlingType(1);
- private MultipleDocumentHandlingType(int value)
- {
- super(value, NAMES);
- }
- } // class MultipleDocumentHandlingType
-
- public static final class SidesType extends AttributeValue
- {
- private static final String[] NAMES
- = { "one-sided", "two-sided-long-edge", "two-sided-short-edge" };
- public static final SidesType ONE_SIDED = new SidesType(0);
- public static final SidesType TWO_SIDED_LONG_EDGE = new SidesType(1);
- public static final SidesType TWO_SIDED_SHORT_EDGE = new SidesType(2);
- private SidesType(int value)
- {
- super(value, NAMES);
- }
- } // class SidesType
-
- private int copies;
- private DefaultSelectionType selection;
- private DestinationType destination;
- private DialogType dialog;
- private String filename;
- private int maxPage;
- private int minPage;
- private MultipleDocumentHandlingType multiple;
- private int[][] pageRanges; // null for default value
- private int fromPage; // 0 for default value
- private int toPage; // 0 for default value
- private String printer;
- private SidesType sides;
-
- public JobAttributes()
- {
- copies = 1;
- selection = DefaultSelectionType.ALL;
- destination = DestinationType.PRINTER;
- dialog = DialogType.NATIVE;
- maxPage = Integer.MAX_VALUE;
- minPage = 1;
- multiple
- = MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES;
- sides = SidesType.ONE_SIDED;
- }
-
- public JobAttributes(JobAttributes attr)
- {
- set(attr);
- }
-
- public JobAttributes(int copies, DefaultSelectionType selection,
- DestinationType destination, DialogType dialog,
- String filename, int max, int min,
- MultipleDocumentHandlingType multiple,
- int[][] pageRanges, String printer, SidesType sides)
- {
- if (copies <= 0 || selection == null || destination == null
- || dialog == null || max < min || min <= 0 || multiple == null
- || sides == null)
- throw new IllegalArgumentException();
- this.copies = copies;
- this.selection = selection;
- this.destination = destination;
- this.dialog = dialog;
- this.filename = filename;
- maxPage = max;
- minPage = min;
- this.multiple = multiple;
- setPageRanges(pageRanges);
- this.printer = printer;
- this.sides = sides;
- }
-
- public Object clone()
- {
- return new JobAttributes(this);
- }
-
- public void set(JobAttributes attr)
- {
- copies = attr.copies;
- selection = attr.selection;
- destination = attr.destination;
- dialog = attr.dialog;
- filename = attr.filename;
- maxPage = attr.maxPage;
- minPage = attr.minPage;
- multiple = attr.multiple;
- pageRanges = (int[][]) attr.pageRanges.clone();
- printer = attr.printer;
- sides = attr.sides;
- fromPage = attr.fromPage;
- toPage = attr.toPage;
- }
-
- public int getCopies()
- {
- return copies;
- }
-
- public void setCopies(int copies)
- {
- if (copies <= 0)
- throw new IllegalArgumentException();
- this.copies = copies;
- }
-
- public void setCopiesToDefault()
- {
- copies = 1;
- }
-
- public DefaultSelectionType getDefaultSelection()
- {
- return selection;
- }
-
- public void setDefaultSelection(DefaultSelectionType selection)
- {
- if (selection == null)
- throw new IllegalArgumentException();
- this.selection = selection;
- }
-
- public DestinationType getDestination()
- {
- return destination;
- }
-
- public void setDestination(DestinationType destination)
- {
- if (destination == null)
- throw new IllegalArgumentException();
- this.destination = destination;
- }
-
- public DialogType getDialog()
- {
- return dialog;
- }
-
- public void setDialog(DialogType dialog)
- {
- if (dialog == null)
- throw new IllegalArgumentException();
- this.dialog = dialog;
- }
-
- public String getFileName()
- {
- return filename;
- }
-
- public void setFileName(String filename)
- {
- this.filename = filename;
- }
-
- public int getFromPage()
- {
- return fromPage != 0 ? fromPage
- : pageRanges != null ? pageRanges[0][0]
- : toPage != 0 ? toPage : minPage;
- }
-
- public void setFromPage(int fromPage)
- {
- if (fromPage < minPage || (fromPage > toPage && toPage != 0)
- || fromPage > maxPage)
- throw new IllegalArgumentException();
- if (pageRanges == null)
- this.fromPage = fromPage;
- }
-
- public int getMaxPage()
- {
- return maxPage;
- }
-
- public void setMaxPage(int maxPage)
- {
- if (maxPage < minPage)
- throw new IllegalArgumentException();
- this.maxPage = maxPage;
- if (maxPage < fromPage)
- fromPage = maxPage;
- if (maxPage < toPage)
- toPage = maxPage;
- if (pageRanges != null)
- {
- int i = pageRanges.length - 1;
- while (i >= 0 && maxPage < pageRanges[i][1])
- i--;
- if (maxPage >= pageRanges[++i][0])
- pageRanges[i++][1] = maxPage;
- if (i == 0)
- pageRanges = null;
- else if (i < pageRanges.length)
- {
- int[][] tmp = new int[i][];
- System.arraycopy(pageRanges, 0, tmp, 0, i);
- pageRanges = tmp;
- }
- }
- }
-
- public int getMinPage()
- {
- return minPage;
- }
-
- public void setMinPage(int minPage)
- {
- if (minPage <= 0 || minPage > maxPage)
- throw new IllegalArgumentException();
- this.minPage = minPage;
- if (minPage > toPage)
- toPage = minPage;
- if (minPage > fromPage)
- fromPage = minPage;
- if (pageRanges != null)
- {
- int size = pageRanges.length;
- int i = 0;
- while (i < size && minPage > pageRanges[i][0])
- i++;
- if (minPage <= pageRanges[i - 1][1])
- pageRanges[--i][0] = minPage;
- if (i == size)
- pageRanges = null;
- else if (i > 0)
- {
- int[][] tmp = new int[size - i][];
- System.arraycopy(pageRanges, i, tmp, 0, size - i);
- pageRanges = tmp;
- }
- }
- }
-
- public MultipleDocumentHandlingType getMultipleDocumentHandling()
- {
- return multiple;
- }
-
- public void setMultipleDocumentHandling
- (MultipleDocumentHandlingType multiple)
- {
- if (multiple == null)
- throw new IllegalArgumentException();
- this.multiple = multiple;
- }
-
- public void setMultipleDocumentHandlingToDefault()
- {
- multiple
- = MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES;
- }
-
- public int[][] getPageRanges()
- {
- if (pageRanges == null)
- return new int[][] { { getFromPage(), getToPage() } };
- // Perform a deep clone, so user code cannot affect original arrays.
- int i = pageRanges.length;
- int[][] result = new int[i][];
- while (--i >= 0)
- result[i] = (int[]) pageRanges[i].clone();
- return result;
- }
-
- public void setPageRanges(int[][] pageRanges)
- {
- int size = pageRanges == null ? 0 : pageRanges.length;
- if (size == 0)
- throw new IllegalArgumentException();
- while (--size >= 0)
- {
- int[] range = pageRanges[size];
- if (range == null || range.length != 2
- || range[0] < minPage || range[1] < range[0] || range[1] > maxPage
- || (size != 0 && range[0] <= pageRanges[size - 1][1]))
- throw new IllegalArgumentException();
- }
- size = pageRanges.length;
- if (fromPage > 0 && pageRanges[0][0] > fromPage)
- fromPage = pageRanges[0][0];
- if (toPage > 0 && pageRanges[size - 1][1] < toPage)
- toPage = pageRanges[size - 1][1];
- this.pageRanges = new int[size][];
- while (--size >= 0)
- this.pageRanges[size] = (int[]) pageRanges[size].clone();
- }
-
- public String getPrinter()
- {
- return printer;
- }
-
- public void setPrinter(String printer)
- {
- this.printer = printer;
- }
-
- public SidesType getSides()
- {
- return sides;
- }
-
- public void setSides(SidesType sides)
- {
- if (sides == null)
- throw new IllegalArgumentException();
- this.sides = sides;
- }
-
- public void setSidesToDefault()
- {
- sides = SidesType.ONE_SIDED;
- }
-
- public int getToPage()
- {
- return toPage != 0 ? toPage
- : pageRanges != null ? pageRanges[pageRanges.length - 1][1]
- : fromPage != 0 ? fromPage : maxPage;
- }
-
- public void setToPage(int toPage)
- {
- if (toPage < minPage || (fromPage > toPage && fromPage != 0)
- || toPage > maxPage)
- throw new IllegalArgumentException();
- if (pageRanges == null)
- this.toPage = toPage;
- }
-
- public boolean equals(Object o)
- {
- if (this == o)
- return true;
- if (! (o instanceof JobAttributes))
- return false;
- JobAttributes ja = (JobAttributes) o;
- if (copies != ja.copies || selection != ja.selection
- || destination != ja.destination || dialog != ja.dialog
- || ! filename.equals(ja.filename) || maxPage != ja.maxPage
- || minPage != ja.minPage || multiple != ja.multiple
- || fromPage != ja.fromPage || toPage != ja.toPage
- || ! printer.equals(ja.printer) || sides != ja.sides
- || (pageRanges == null) != (ja.pageRanges == null))
- return false;
- if (pageRanges != ja.pageRanges)
- for (int i = pageRanges.length; --i >= 0; )
- if (pageRanges[i][0] != ja.pageRanges[i][0]
- || pageRanges[i][1] != ja.pageRanges[i][1])
- return false;
- return true;
- }
-
- public int hashCode()
- {
- int hash = (selection.value << 6) ^ (destination.value << 5)
- ^ (dialog.value << 3) ^ (multiple.value << 2) ^ sides.value
- ^ (filename == null ? 0 : filename.hashCode())
- ^ (printer == null ? 0 : printer.hashCode());
- // The effect of the above fields on the hashcode match the JDK. However,
- // I am unable to reverse engineer the effect of the fields listed below,
- // so I am using my own implementation. Note that this still satisfies
- // the general contract of hashcode, it just doesn't match the JDK.
- hash ^= (copies << 27) ^ (maxPage << 22) ^ (minPage << 17);
- if (pageRanges == null)
- hash ^= (getFromPage() << 13) ^ (getToPage() << 8);
- else
- for (int i = pageRanges.length; --i >= 0; )
- hash ^= (pageRanges[i][0] << 13) ^ (pageRanges[i][1] << 8);
- return hash;
- }
-
- public String toString()
- {
- StringBuffer s = new StringBuffer("copies=").append(copies)
- .append(",defaultSelection=").append(selection).append(",destination=")
- .append(destination).append(",dialog=").append(dialog)
- .append(",fileName=").append(filename).append(",fromPage=")
- .append(getFromPage()).append(",maxPage=").append(maxPage)
- .append(",minPage=").append(minPage)
- .append(",multiple-document-handling=").append(multiple)
- .append(",page-ranges=[");
- if (pageRanges == null)
- s.append(minPage).append(':').append(minPage).append(']');
- else
- for (int i = 0; i < pageRanges.length; i++)
- s.append(pageRanges[i][0]).append(':').append(pageRanges[i][1])
- .append(',');
- s.setLength(s.length() - 1);
- return s.append("],printer=").append(printer).append(",sides=")
- .append(sides).append(",toPage=").append(getToPage()).toString();
- }
-} // class JobAttributes
diff --git a/libjava/java/awt/KeyEventDispatcher.java b/libjava/java/awt/KeyEventDispatcher.java
deleted file mode 100644
index 30997278e1b..00000000000
--- a/libjava/java/awt/KeyEventDispatcher.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* KeyEventDispatcher.java -- dispatches key events
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.KeyEvent;
-
-/**
- * An instance of this interface coordinates with a KeyboardFocusManager to
- * target and dispatch all key events. This allows retargeting, consuming,
- * changing, or otherwise manipulating the key event before sending it on to
- * a target.
- *
- * <p>By default, the KeyboardFocusManager is the sink for all key events not
- * dispatched by other dispatchers. Therefore, it is unnecessary for the user
- * to register the focus manager as a dispatcher.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see KeyboardFocusManager#addKeyEventDispatcher(KeyEventDispatcher)
- * @see KeyboardFocusManager#removeKeyEventDispatcher(KeyEventDispatcher)
- * @since 1.4
- * @status updated to 1.4
- */
-public interface KeyEventDispatcher
-{
- /**
- * Called by the KeyboardFocusManager to request that a key event be
- * dispatched. The dispatcher is free to retarget the event, consume it,
- * dispatch it, or make other changes. This is usually done to allow
- * delivery of key events to objects other than the window in focus, such
- * as for navigating non-focusable components. If this dispatcher chooses
- * to dispatch the event itself, it should call <code>redispatchEvent</code>
- * to avoid infinite recursion.
- *
- * <p>If the return value is false, the KeyEvent is passed to the next
- * dispatcher in the chain, ending with the KeyboardFocusManager. If the
- * return value is true, the event has been consumed (although it might
- * have been ignored), and no further action will be taken on the event. Be
- * sure to check whether the event was consumed before dispatching it
- * further.
- *
- * @param e the key event
- * @return true if the event has been consumed
- * @see KeyboardFocusManager#redispatchEvent(Component, AWTEvent)
- */
- boolean dispatchKeyEvent(KeyEvent e);
-} // interface KeyEventDispatcher
diff --git a/libjava/java/awt/KeyEventPostProcessor.java b/libjava/java/awt/KeyEventPostProcessor.java
deleted file mode 100644
index 0b39dc25075..00000000000
--- a/libjava/java/awt/KeyEventPostProcessor.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* KeyEventPostProcessor.java -- performs actions after a key event dispatch
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.KeyEvent;
-
-/**
- * An instance of this interface coordinates with a KeyboardFocusManager to
- * target and dispatch all key events that are otherwise unconsumed. This
- * allows events which take place when nothing has focus to still operate,
- * such as menu keyboard shortcuts.
- *
- * <p>By default, the KeyboardFocusManager is the sink for all key events not
- * post-processed elsewhere. Therefore, it is unnecessary for the user
- * to register the focus manager as a dispatcher.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see KeyboardFocusManager#addKeyEventPostProcessor(KeyEventPostProcessor)
- * @see KeyboardFocusManager#removeKeyEventPostProcessor(KeyEventPostProcessor)
- * @since 1.4
- * @status updated to 1.4
- */
-public interface KeyEventPostProcessor
-{
- /**
- * Called by the KeyboardFocusManager to request that a key event be
- * post-processed. Typically, the event has already been dispatched and
- * handled, unless no object has focus. Thus, this allows global event
- * handling for things like menu shortcuts. If this post-processor chooses
- * to dispatch the event, it should call <code>redispatchEvent</code>
- * to avoid infinite recursion.
- *
- * <p>If the return value is false, the KeyEvent is passed to the next
- * dispatcher in the chain, ending with the KeyboardFocusManager. If the
- * return value is true, the event has been consumed (although it might
- * have been ignored), and no further action will be taken on the event. Be
- * sure to check whether the event was consumed before dispatching it
- * further.
- *
- * @param e the key event
- * @return true if the event has been consumed
- * @see KeyboardFocusManager#redispatchEvent(Component, AWTEvent)
- */
- boolean postProcessKeyEvent(KeyEvent e);
-} // interface KeyEventPostProcessor
diff --git a/libjava/java/awt/KeyboardFocusManager.java b/libjava/java/awt/KeyboardFocusManager.java
deleted file mode 100644
index ab355456646..00000000000
--- a/libjava/java/awt/KeyboardFocusManager.java
+++ /dev/null
@@ -1,1436 +0,0 @@
-/* KeyboardFocusManager.java -- manage component focusing via the keyboard
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.FocusEvent;
-import java.awt.event.KeyEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.beans.PropertyVetoException;
-import java.beans.VetoableChangeListener;
-import java.beans.VetoableChangeSupport;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * The <code>KeyboardFocusManager</code> handles the focusing of
- * windows for receiving keyboard events. The manager handles
- * the dispatch of all <code>FocusEvent</code>s and
- * <code>KeyEvent</code>s, along with <code>WindowEvent</code>s
- * relating to the focused window. Users can use the manager
- * to ascertain the current focus owner and fire events.
- * <br />
- * <br />
- * The focus owner is the <code>Component</code> that receives
- * key events. The focus owner is either the currently focused
- * window or a component within this window.
- * <br />
- * <br />
- * The underlying native windowing system may denote the active
- * window or its children with special decorations (e.g. a highlighted
- * title bar). The active window is always either a <code>Frame</code>
- * or <code>Dialog</code>, and is either the currently focused
- * window or its owner.
- * <br />
- * <br />
- * Applets may be partitioned into different applet contexts, according
- * to their code base. In this case, each context has its own
- * <code>KeyboardFocusManager</code>, as opposed to the global
- * manager maintained by applets which share the same context.
- * Each context is insulated from the others, and they don't interact.
- * The resulting behaviour, as with context division, depends on the browser
- * supporting the applets. Regardless, there can only ever be
- * one focused window, one active window and one focus owner
- * per <code>ClassLoader</code>.
- * <br />
- * <br />
- * To support this separation of focus managers, the manager instances
- * and the internal state information is grouped by the
- * <code>ThreadGroup</code> to which it pertains. With respect to
- * applets, each code base has its own <code>ThreadGroup</code>, so the
- * isolation of each context is enforced within the manager.
- * <br />
- * <br />
- * By default, the manager defines TAB and Ctrl+TAB as the
- * forward focus traversal keys and Shift+TAB and Ctrl+Shift+TAB
- * as the backward focus traversal keys. No up or down cycle
- * traversal keys are defined by default. Traversal takes effect
- * on the firing of a relevant <code>KEY_PRESSED</code> event.
- * However, all other key events related to the use of the
- * defined focus traversal key sequence are consumed and not
- * dispatched.
- * <br />
- * <br />
- * These default traversal keys come into effect on all windows
- * for which no alternative set of keys is defined. This also
- * applies recursively to any child components of such a window,
- * which define no traversal keys of their own.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @author Thomas Fitzsimmons (fitzsim@redhat.com)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.4
- */
-public abstract class KeyboardFocusManager
- implements KeyEventDispatcher, KeyEventPostProcessor
-{
- /** Identifies {@link AWTKeyStroke}s that move the focus forward in
- the focus cycle. */
- public static final int FORWARD_TRAVERSAL_KEYS = 0;
-
- /** Identifies {@link AWTKeyStroke}s that move the focus backward in
- the focus cycle. */
- public static final int BACKWARD_TRAVERSAL_KEYS = 1;
-
- /** Identifies {@link AWTKeyStroke}s that move the focus up to the
- parent focus cycle root. */
- public static final int UP_CYCLE_TRAVERSAL_KEYS = 2;
-
- /** Identifies {@link AWTKeyStroke}s that move the focus down to the
- child focus cycle root. */
- public static final int DOWN_CYCLE_TRAVERSAL_KEYS = 3;
-
- /** The set of {@link AWTKeyStroke}s that cause focus to be moved to
- the next focusable Component in the focus cycle. */
- private static final Set DEFAULT_FORWARD_KEYS;
-
- /** The set of {@link AWTKeyStroke}s that cause focus to be moved to
- the previous focusable Component in the focus cycle. */
- private static final Set DEFAULT_BACKWARD_KEYS;
-
- /** Populate the DEFAULT_FORWARD_KEYS and DEFAULT_BACKWARD_KEYS
- {@link java.util.Set}s. */
- static
- {
- Set s = new HashSet();
- s.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, 0));
- s.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB,
- KeyEvent.CTRL_DOWN_MASK));
- DEFAULT_FORWARD_KEYS = Collections.unmodifiableSet(s);
- s = new HashSet();
- s.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB,
- KeyEvent.SHIFT_DOWN_MASK));
- s.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB,
- KeyEvent.SHIFT_DOWN_MASK
- | KeyEvent.CTRL_DOWN_MASK));
- DEFAULT_BACKWARD_KEYS = Collections.unmodifiableSet(s);
- }
-
- /** The global object {@link java.util.Map}s. */
-
- /** For security reasons, {@link java.applet.Applet}s in different
- codebases must be insulated from one another. Since {@link
- KeyboardFocusManager}s have the ability to return {@link
- Component}s from a given {@link java.applet.Applet}, each
- codebase must have an independent {@link KeyboardFocusManager}.
- Since each codebase has its own {@link ThreadGroup} in which its
- {@link Applet}s run, it makes sense to partition {@link
- KeyboardFocusManager}s according to {@link
- java.lang.ThreadGroup}. Thus, currentKeyboardFocusManagers is a
- {@link java.util.Map} keyed on {@link java.lang.ThreadGroup}. */
- private static Map currentKeyboardFocusManagers = new HashMap ();
-
- /** {@link java.applet.Applet}s in one codebase must not be allowed
- to access {@link Component}s in {@link java.applet.Applet}s in
- other codebases. To enforce this restriction, we key the
- following {@link java.util.Map}s on {@link java.lang.ThreadGroup}s (which
- are per-codebase). For example, if {@link
- java.lang.ThreadGroup} A calls {@link #setGlobalFocusOwner},
- passing {@link Component} C, currentFocusOwners[A] is assigned
- C, and all other currentFocusOwners values are nullified. Then
- if {@link java.lang.ThreadGroup} A subsequently calls {@link
- #getGlobalFocusOwner}, it will return currentFocusOwners[A],
- that is, {@link Component} C. If another {@link
- java.lang.ThreadGroup} K calls {@link #getGlobalFocusOwner}, it
- will return currentFocusOwners[K], that is, null.
-
- Since this is a static field, we ensure that there is only one
- focused {@link Component} per class loader. */
- private static Map currentFocusOwners = new HashMap ();
-
- /** A {@link java.util.Map} keyed on {@link java.lang.ThreadGroup}s
- that stores the {@link Component} that owns the permanent
- keyboard focus. @see currentFocusOwners */
- private static Map currentPermanentFocusOwners = new HashMap ();
-
- /** A {@link java.util.Map} keyed on {@link java.lang.ThreadGroup}s
- that stores the focused {@link Window}. @see
- currentFocusOwners */
- private static Map currentFocusedWindows = new HashMap ();
-
- /** A {@link java.util.Map} keyed on {@link java.lang.ThreadGroup}s
- that stores the active {@link Window}. @see
- currentFocusOwners */
- private static Map currentActiveWindows = new HashMap ();
-
- /** A {@link java.util.Map} keyed on {@link java.lang.ThreadGroup}s
- that stores the focus cycle root {@link Container}. @see
- currentFocusOwners */
- private static Map currentFocusCycleRoots = new HashMap ();
-
- /** The default {@link FocusTraveralPolicy} that focus-managing
- {@link Container}s will use to define their initial focus
- traversal policy. */
- private FocusTraversalPolicy defaultPolicy;
-
- /** An array that stores the {@link #FORWARD_TRAVERSAL_KEYS}, {@link
- #BACKWARD_TRAVERSAL_KEYS}, {@link #UP_CYCLE_TRAVERSAL_KEYS} and
- {@link #DOWN_CYCLE_TRAVERSAL_KEYS} {@link AWTKeyStroke}s {@link
- java.util.Set}s. */
- private Set[] defaultFocusKeys = new Set[]
- {
- DEFAULT_FORWARD_KEYS, DEFAULT_BACKWARD_KEYS,
- Collections.EMPTY_SET, Collections.EMPTY_SET
- };
-
- /**
- * A utility class to support the handling of events relating to property changes.
- */
- private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport (this);
-
- /**
- * A utility class to support the handling of events relating to vetoable changes.
- */
- private final VetoableChangeSupport vetoableChangeSupport = new VetoableChangeSupport (this);
-
- /** A list of {@link KeyEventDispatcher}s that process {@link
- KeyEvent}s before they are processed the default keyboard focus
- manager. */
- private final ArrayList keyEventDispatchers = new ArrayList();
-
- /** A list of {@link KeyEventPostProcessor}s that process unconsumed
- {@link KeyEvent}s. */
- private final ArrayList keyEventPostProcessors = new ArrayList();
-
- /**
- * Construct a KeyboardFocusManager.
- */
- public KeyboardFocusManager ()
- {
- }
-
- /**
- * Retrieve the keyboard focus manager associated with the {@link
- * java.lang.ThreadGroup} to which the calling thread belongs.
- *
- * @return the keyboard focus manager associated with the current
- * thread group
- */
- public static KeyboardFocusManager getCurrentKeyboardFocusManager ()
- {
- ThreadGroup currentGroup = Thread.currentThread ().getThreadGroup ();
-
- if (currentKeyboardFocusManagers.get (currentGroup) == null)
- setCurrentKeyboardFocusManager (null);
-
- return (KeyboardFocusManager) currentKeyboardFocusManagers.get (currentGroup);
- }
-
- /**
- * Set the keyboard focus manager associated with the {@link
- * java.lang.ThreadGroup} to which the calling thread belongs.
- *
- * @param m the keyboard focus manager for the current thread group
- */
- public static void setCurrentKeyboardFocusManager (KeyboardFocusManager m)
- {
- SecurityManager sm = System.getSecurityManager ();
- if (sm != null)
- sm.checkPermission (new AWTPermission ("replaceKeyboardFocusManager"));
-
- ThreadGroup currentGroup = Thread.currentThread ().getThreadGroup ();
- KeyboardFocusManager manager;
-
- if (m == null)
- manager = new DefaultKeyboardFocusManager ();
- else
- manager = m;
-
- currentKeyboardFocusManagers.put (currentGroup, manager);
- }
-
- /**
- * Retrieve the {@link Component} that has the keyboard focus, or
- * null if the focus owner was not set by a thread in the current
- * {@link java.lang.ThreadGroup}.
- *
- * @return the keyboard focus owner or null
- */
- public Component getFocusOwner ()
- {
- Component owner = (Component) getObject (currentFocusOwners);
- if (owner == null)
- owner = (Component) getObject (currentPermanentFocusOwners);
- return owner;
- }
-
- /**
- * Retrieve the {@link Component} that has the keyboard focus,
- * regardless of whether or not it was set by a thread in the
- * current {@link java.lang.ThreadGroup}. If there is no temporary
- * focus owner in effect then this method will return the same value
- * as {@link #getGlobalPermanentFocusOwner}.
- *
- * @return the keyboard focus owner
- * @throws SecurityException if this is not the keyboard focus
- * manager associated with the current {@link java.lang.ThreadGroup}
- */
- protected Component getGlobalFocusOwner ()
- {
- // Check if there is a temporary focus owner.
- Component focusOwner = (Component) getGlobalObject (currentFocusOwners);
-
- return (focusOwner == null) ? getGlobalPermanentFocusOwner () : focusOwner;
- }
-
- /**
- * Set the {@link Component} that will be returned by {@link
- * #getFocusOwner} (when it is called from the current {@link
- * java.lang.ThreadGroup}) and {@link #getGlobalFocusOwner}. This
- * method does not actually transfer the keyboard focus.
- *
- * @param owner the Component to return from getFocusOwner and
- * getGlobalFocusOwner
- *
- * @see Component.requestFocus ()
- * @see Component.requestFocusInWindow ()
- */
- protected void setGlobalFocusOwner (Component owner)
- {
- if (owner == null || owner.focusable)
- setGlobalObject (currentFocusOwners, owner, "focusOwner");
- }
-
- /**
- * Clear the global focus owner and deliver a FOCUS_LOST event to
- * the previously-focused {@link Component}. Until another {@link
- * Component} becomes the keyboard focus owner, key events will be
- * discarded by top-level windows.
- */
- public void clearGlobalFocusOwner ()
- {
- synchronized (currentFocusOwners)
- {
- Component focusOwner = getGlobalFocusOwner ();
- Component permanentFocusOwner = getGlobalPermanentFocusOwner ();
-
- setGlobalFocusOwner (null);
- setGlobalPermanentFocusOwner (null);
-
- // Inform the old focus owner that it has lost permanent
- // focus.
- if (focusOwner != null)
- {
- // We can't cache the event queue, because of
- // bootstrapping issues. We need to set the default
- // KeyboardFocusManager in EventQueue before the event
- // queue is started.
- EventQueue q = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
- if (focusOwner != permanentFocusOwner)
- q.postEvent (new FocusEvent (focusOwner, FocusEvent.FOCUS_LOST, true));
- else
- q.postEvent (new FocusEvent (focusOwner, FocusEvent.FOCUS_LOST, false));
- }
-
- if (focusOwner != permanentFocusOwner)
- {
- EventQueue q = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
- q.postEvent (new FocusEvent (permanentFocusOwner, FocusEvent.FOCUS_LOST, false));
- }
- }
- }
-
- /**
- * Retrieve the {@link Component} that has the permanent keyboard
- * focus, or null if the focus owner was not set by a thread in the
- * current {@link java.lang.ThreadGroup}.
- *
- * @return the keyboard focus owner or null
- */
- public Component getPermanentFocusOwner ()
- {
- return (Component) getObject (currentPermanentFocusOwners);
- }
-
- /**
- * Retrieve the {@link Component} that has the permanent keyboard
- * focus, regardless of whether or not it was set by a thread in the
- * current {@link java.lang.ThreadGroup}.
- *
- * @return the keyboard focus owner
- * @throws SecurityException if this is not the keyboard focus
- * manager associated with the current {@link java.lang.ThreadGroup}
- */
- protected Component getGlobalPermanentFocusOwner ()
- {
- return (Component) getGlobalObject (currentPermanentFocusOwners);
- }
-
- /**
- * Set the {@link Component} that will be returned by {@link
- * #getPermanentFocusOwner} (when it is called from the current
- * {@link java.lang.ThreadGroup}) and {@link
- * #getGlobalPermanentFocusOwner}. This method does not actually
- * transfer the keyboard focus.
- *
- * @param focusOwner the Component to return from
- * getPermanentFocusOwner and getGlobalPermanentFocusOwner
- *
- * @see Component.requestFocus ()
- * @see Component.requestFocusInWindow ()
- */
- protected void setGlobalPermanentFocusOwner (Component focusOwner)
- {
- if (focusOwner == null || focusOwner.focusable)
- setGlobalObject (currentPermanentFocusOwners, focusOwner,
- "permanentFocusOwner");
- }
-
- /**
- * Retrieve the {@link Window} that is or contains the keyboard
- * focus owner, or null if the focused window was not set by a
- * thread in the current {@link java.lang.ThreadGroup}.
- *
- * @return the focused window or null
- */
- public Window getFocusedWindow ()
- {
- return (Window) getObject (currentFocusedWindows);
- }
-
- /**
- * Retrieve the {@link Window} that is or contains the focus owner,
- * regardless of whether or not the {@link Window} was set focused
- * by a thread in the current {@link java.lang.ThreadGroup}.
- *
- * @return the focused window
- * @throws SecurityException if this is not the keyboard focus
- * manager associated with the current {@link java.lang.ThreadGroup}
- */
- protected Window getGlobalFocusedWindow ()
- {
- return (Window) getGlobalObject (currentFocusedWindows);
- }
-
- /**
- * Set the {@link Window} that will be returned by {@link
- * #getFocusedWindow} (when it is called from the current {@link
- * java.lang.ThreadGroup}) and {@link #getGlobalFocusedWindow}.
- * This method does not actually cause <code>window</code> to become
- * the focused {@link Window}.
- *
- * @param window the Window to return from getFocusedWindow and
- * getGlobalFocusedWindow
- */
- protected void setGlobalFocusedWindow (Window window)
- {
- if (window == null || window.focusable)
- setGlobalObject (currentFocusedWindows, window, "focusedWindow");
- }
-
- /**
- * Retrieve the active {@link Window}, or null if the active window
- * was not set by a thread in the current {@link
- * java.lang.ThreadGroup}.
- *
- * @return the active window or null
- */
- public Window getActiveWindow()
- {
- return (Window) getObject (currentActiveWindows);
- }
-
- /**
- * Retrieve the active {@link Window}, regardless of whether or not
- * the {@link Window} was made active by a thread in the current
- * {@link java.lang.ThreadGroup}.
- *
- * @return the active window
- * @throws SecurityException if this is not the keyboard focus
- * manager associated with the current {@link java.lang.ThreadGroup}
- */
- protected Window getGlobalActiveWindow()
- {
- return (Window) getGlobalObject (currentActiveWindows);
- }
-
- /**
- * Set the {@link Window} that will be returned by {@link
- * #getActiveWindow} (when it is called from the current {@link
- * java.lang.ThreadGroup}) and {@link #getGlobalActiveWindow}. This
- * method does not actually cause <code>window</code> to be made
- * active.
- *
- * @param window the Window to return from getActiveWindow and
- * getGlobalActiveWindow
- */
- protected void setGlobalActiveWindow(Window window)
- {
- setGlobalObject (currentActiveWindows, window, "activeWindow");
- }
-
- /**
- * Retrieve the default {@link FocusTraversalPolicy}.
- * Focus-managing {@link Container}s use the returned object to
- * define their initial focus traversal policy.
- *
- * @return a non-null default FocusTraversalPolicy object
- */
- public FocusTraversalPolicy getDefaultFocusTraversalPolicy ()
- {
- if (defaultPolicy == null)
- defaultPolicy = new DefaultFocusTraversalPolicy ();
- return defaultPolicy;
- }
-
- /**
- * Set the {@link FocusTraversalPolicy} returned by {@link
- * #getDefaultFocusTraversalPolicy}. Focus-managing {@link
- * Container}s created after this call will use policy as their
- * initial focus traversal policy. Existing {@link Container}s'
- * focus traversal policies will not be affected by calls to this
- * method.
- *
- * @param policy the FocusTraversalPolicy that will be returned by
- * subsequent calls to getDefaultFocusTraversalPolicy
- * @throws IllegalArgumentException if policy is null
- */
- public void setDefaultFocusTraversalPolicy (FocusTraversalPolicy policy)
- {
- if (policy == null)
- throw new IllegalArgumentException ();
- firePropertyChange ("defaultFocusTraversalPolicy", defaultPolicy, policy);
- defaultPolicy = policy;
- }
-
- /**
- * Set the default {@link java.util.Set} of focus traversal keys for
- * one of the focus traversal directions.
- *
- * @param id focus traversal direction identifier
- * @param keystrokes set of AWTKeyStrokes
- *
- * @see #FORWARD_TRAVERSAL_KEYS
- * @see #BACKWARD_TRAVERSAL_KEYS
- * @see #UP_CYCLE_TRAVERSAL_KEYS
- * @see #DOWN_CYCLE_TRAVERSAL_KEYS
- */
- public void setDefaultFocusTraversalKeys (int id, Set keystrokes)
- {
- if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS &&
- id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS)
- throw new IllegalArgumentException ();
-
- if (keystrokes == null)
- throw new IllegalArgumentException ();
-
- Set sa;
- Set sb;
- Set sc;
- String type;
- switch (id)
- {
- case FORWARD_TRAVERSAL_KEYS:
- sa = defaultFocusKeys[BACKWARD_TRAVERSAL_KEYS];
- sb = defaultFocusKeys[UP_CYCLE_TRAVERSAL_KEYS];
- sc = defaultFocusKeys[DOWN_CYCLE_TRAVERSAL_KEYS];
- type = "forwardDefaultFocusTraversalKeys";
- break;
- case BACKWARD_TRAVERSAL_KEYS:
- sa = defaultFocusKeys[FORWARD_TRAVERSAL_KEYS];
- sb = defaultFocusKeys[UP_CYCLE_TRAVERSAL_KEYS];
- sc = defaultFocusKeys[DOWN_CYCLE_TRAVERSAL_KEYS];
- type = "backwardDefaultFocusTraversalKeys";
- break;
- case UP_CYCLE_TRAVERSAL_KEYS:
- sa = defaultFocusKeys[FORWARD_TRAVERSAL_KEYS];
- sb = defaultFocusKeys[BACKWARD_TRAVERSAL_KEYS];
- sc = defaultFocusKeys[DOWN_CYCLE_TRAVERSAL_KEYS];
- type = "upCycleDefaultFocusTraversalKeys";
- break;
- case DOWN_CYCLE_TRAVERSAL_KEYS:
- sa = defaultFocusKeys[FORWARD_TRAVERSAL_KEYS];
- sb = defaultFocusKeys[BACKWARD_TRAVERSAL_KEYS];
- sc = defaultFocusKeys[UP_CYCLE_TRAVERSAL_KEYS];
- type = "downCycleDefaultFocusTraversalKeys";
- break;
- default:
- throw new IllegalArgumentException ();
- }
- int i = keystrokes.size ();
- Iterator iter = keystrokes.iterator ();
- while (--i >= 0)
- {
- Object o = iter.next ();
- if (!(o instanceof AWTKeyStroke)
- || sa.contains (o) || sb.contains (o) || sc.contains (o)
- || ((AWTKeyStroke) o).keyCode == KeyEvent.VK_UNDEFINED)
- throw new IllegalArgumentException ();
- }
- keystrokes = Collections.unmodifiableSet (new HashSet (keystrokes));
- firePropertyChange (type, defaultFocusKeys[id], keystrokes);
- defaultFocusKeys[id] = keystrokes;
- }
-
- /**
- * Retrieve the default {@link java.util.Set} of focus traversal
- * keys for one of the focus traversal directions.
- *
- * @param id focus traversal direction identifier
- *
- * @return the default set of AWTKeyStrokes
- *
- * @see #FORWARD_TRAVERSAL_KEYS
- * @see #BACKWARD_TRAVERSAL_KEYS
- * @see #UP_CYCLE_TRAVERSAL_KEYS
- * @see #DOWN_CYCLE_TRAVERSAL_KEYS
- */
- public Set getDefaultFocusTraversalKeys (int id)
- {
- if (id < FORWARD_TRAVERSAL_KEYS || id > DOWN_CYCLE_TRAVERSAL_KEYS)
- throw new IllegalArgumentException ();
- return defaultFocusKeys[id];
- }
-
- /**
- * Retrieve the current focus cycle root, or null if the focus owner
- * was not set by a thread in the current {@link
- * java.lang.ThreadGroup}.
- *
- * @return the current focus cycle root or null
- */
- public Container getCurrentFocusCycleRoot ()
- {
- return (Container) getObject (currentFocusCycleRoots);
- }
-
- /**
- * Retrieve the current focus cycle root, regardless of whether or
- * not it was made set by a thread in the current {@link
- * java.lang.ThreadGroup}.
- *
- * @return the current focus cycle root
- * @throws SecurityException if this is not the keyboard focus
- * manager associated with the current {@link java.lang.ThreadGroup}
- */
- protected Container getGlobalCurrentFocusCycleRoot ()
- {
- return (Container) getGlobalObject (currentFocusCycleRoots);
- }
-
- /**
- * Set the {@link Container} that will be returned by {@link
- * #getCurrentFocusCycleRoot} (when it is called from the current
- * {@link java.lang.ThreadGroup}) and {@link
- * #getGlobalCurrentFocusCycleRoot}. This method does not actually
- * make <code>cycleRoot</code> the current focus cycle root.
- *
- * @param cycleRoot the focus cycle root to return from
- * getCurrentFocusCycleRoot and getGlobalCurrentFocusCycleRoot
- */
- public void setGlobalCurrentFocusCycleRoot (Container cycleRoot)
- {
- setGlobalObject (currentFocusCycleRoots, cycleRoot, "currentFocusCycleRoot");
- }
-
- /**
- * Registers the supplied property change listener for receiving
- * events caused by the following property changes:
- *
- * <ul>
- * <li>the current focus owner ("focusOwner")</li>
- * <li>the permanent focus owner ("permanentFocusOwner")</li>
- * <li>the focused window ("focusedWindow")</li>
- * <li>the active window ("activeWindow")</li>
- * <li>the default focus traversal policy ("defaultFocusTraversalPolicy")</li>
- * <li>the default set of forward traversal keys ("forwardDefaultFocusTraversalKeys")</li>
- * <li>the default set of backward traversal keys ("backwardDefaultFocusTraversalKeys")</li>
- * <li>the default set of up cycle traversal keys ("upCycleDefaultFocusTraversalKeys")</li>
- * <li>the default set of down cycle traversal keys ("downCycleDefaultFocusTraversalKeys")</li>
- * <li>the current focus cycle root ("currentFocusCycleRoot")</li>
- * </ul>
- *
- * If the supplied listener is null, nothing occurs.
- *
- * @param l the new listener to register.
- * @see KeyboardFocusManager#addPropertyChangeListener(String, java.beans.PropertyChangeListener)
- */
- public void addPropertyChangeListener(PropertyChangeListener l)
- {
- if (l != null)
- propertyChangeSupport.addPropertyChangeListener(l);
- }
-
- /**
- * Removes the supplied property change listener from the list
- * of registered listeners. If the supplied listener is null,
- * nothing occurs.
- *
- * @param l the listener to remove.
- */
- public void removePropertyChangeListener(PropertyChangeListener l)
- {
- if (l != null)
- propertyChangeSupport.removePropertyChangeListener(l);
- }
-
- /**
- * Returns the currently registered property change listeners
- * in array form. The returned array is empty if no listeners are
- * currently registered.
- *
- * @return an array of registered property change listeners.
- */
- public PropertyChangeListener[] getPropertyChangeListeners()
- {
- return propertyChangeSupport.getPropertyChangeListeners();
- }
-
- /**
- * Registers a property change listener for receiving events relating
- * to a change to a specified property. The supplied property name can be
- * either user-defined or one from the following list of properties
- * relevant to this class:
- *
- * <ul>
- * <li>the current focus owner ("focusOwner")</li>
- * <li>the permanent focus owner ("permanentFocusOwner")</li>
- * <li>the focused window ("focusedWindow")</li>
- * <li>the active window ("activeWindow")</li>
- * <li>the default focus traversal policy ("defaultFocusTraversalPolicy")</li>
- * <li>the default set of forward traversal keys ("forwardDefaultFocusTraversalKeys")</li>
- * <li>the default set of backward traversal keys ("backwardDefaultFocusTraversalKeys")</li>
- * <li>the default set of up cycle traversal keys ("upCycleDefaultFocusTraversalKeys")</li>
- * <li>the default set of down cycle traversal keys ("downCycleDefaultFocusTraversalKeys")</li>
- * <li>the current focus cycle root ("currentFocusCycleRoot")</li>
- * </ul>
- *
- * Nothing occurs if a null listener is supplied. null is regarded as a valid property name.
- *
- * @param name the name of the property to handle change events for.
- * @param l the listener to register for changes to the specified property.
- * @see KeyboardFocusManager#addPropertyChangeListener(java.beans.PropertyChangeListener)
- */
- public void addPropertyChangeListener(String name, PropertyChangeListener l)
- {
- if (l != null)
- propertyChangeSupport.addPropertyChangeListener(name, l);
- }
-
- /**
- * Removes the supplied property change listener registered for the
- * specified property from the list of registered listeners. If the
- * supplied listener is null, nothing occurs.
- *
- * @param name the name of the property the listener is
- * monitoring changes to.
- * @param l the listener to remove.
- */
- public void removePropertyChangeListener(String name,
- PropertyChangeListener l)
- {
- if (l != null)
- propertyChangeSupport.removePropertyChangeListener(name, l);
- }
-
- /**
- * Returns the currently registered property change listeners
- * in array form, which listen for changes to the supplied property.
- * The returned array is empty, if no listeners are currently registered
- * for events pertaining to the supplied property.
- *
- * @param name The property the returned listeners monitor for changes.
- * @return an array of registered property change listeners which
- * listen for changes to the supplied property.
- */
- public PropertyChangeListener[] getPropertyChangeListeners(String name)
- {
- return propertyChangeSupport.getPropertyChangeListeners(name);
- }
-
- /**
- * Fires a property change event as a response to a change to
- * to the specified property. The event is only fired if a
- * change has actually occurred (i.e. o and n are different).
- *
- * @param name The name of the property to which a change occurred.
- * @param o The old value of the property.
- * @param n The new value of the property.
- */
- protected void firePropertyChange(String name, Object o, Object n)
- {
- propertyChangeSupport.firePropertyChange(name, o, n);
- }
-
- /**
- * Registers a vetoable property change listener for receiving events
- * relating to the following properties:
- *
- * <ul>
- * <li>the current focus owner ("focusOwner")</li>
- * <li>the permanent focus owner ("permanentFocusOwner")</li>
- * <li>the focused window ("focusedWindow")</li>
- * <li>the active window ("activeWindow")</li>
- * </ul>
- *
- * Nothing occurs if a null listener is supplied.
- *
- * @param l the listener to register.
- * @see KeyboardFocusManager#addVetoableChangeListener(String, java.beans.VetoableChangeListener)
- */
- public void addVetoableChangeListener(VetoableChangeListener l)
- {
- if (l != null)
- vetoableChangeSupport.addVetoableChangeListener(l);
- }
-
- /**
- * Removes the supplied vetoable property change listener from
- * the list of registered listeners. If the supplied listener
- * is null, nothing occurs.
- *
- * @param l the listener to remove.
- */
- public void removeVetoableChangeListener(VetoableChangeListener l)
- {
- if (l != null)
- vetoableChangeSupport.removeVetoableChangeListener(l);
- }
-
- /**
- * Returns the currently registered vetoable property change listeners
- * in array form. The returned array is empty if no listeners are
- * currently registered.
- *
- * @return an array of registered vetoable property change listeners.
- * @since 1.4
- */
- public VetoableChangeListener[] getVetoableChangeListeners()
- {
- return vetoableChangeSupport.getVetoableChangeListeners();
- }
-
- /**
- * Registers a vetoable property change listener for receiving events relating
- * to a vetoable change to a specified property. The supplied property name can be
- * either user-defined or one from the following list of properties
- * relevant to this class:
- *
- * <ul>
- * <li>the current focus owner ("focusOwner")</li>
- * <li>the permanent focus owner ("permanentFocusOwner")</li>
- * <li>the focused window ("focusedWindow")</li>
- * <li>the active window ("activeWindow")</li>
- * </ul>
- *
- * Nothing occurs if a null listener is supplied. null is regarded as a valid property name.
- *
- * @param name the name of the property to handle change events for.
- * @param l the listener to register for changes to the specified property.
- * @see KeyboardFocusManager#addVetoableChangeListener(java.beans.VetoableChangeListener)
- */
- public void addVetoableChangeListener(String name, VetoableChangeListener l)
- {
- if (l != null)
- vetoableChangeSupport.addVetoableChangeListener(name, l);
- }
-
- /**
- * Removes the supplied vetoable property change listener registered
- * for the specified property from the list of registered listeners.
- * If the supplied listener is null, nothing occurs.
- *
- * @param name the name of the vetoable property the listener is
- * monitoring changes to.
- * @param l the listener to remove.
- */
- public void removeVetoableChangeListener(String name,
- VetoableChangeListener l)
- {
- if (l != null)
- vetoableChangeSupport.removeVetoableChangeListener(name, l);
- }
-
- /**
- * Returns the currently registered vetoable property change listeners
- * in array form, which listen for changes to the supplied property.
- * The returned array is empty, if no listeners are currently registered
- * for events pertaining to the supplied property.
- *
- * @param name The property the returned listeners monitor for changes.
- * @return an array of registered property change listeners which
- * listen for changes to the supplied property.
- * @since 1.4
- */
- public VetoableChangeListener[] getVetoableChangeListeners(String name)
- {
- return vetoableChangeSupport.getVetoableChangeListeners(name);
- }
-
- /**
- * Fires a property change event as a response to a vetoable change to
- * to the specified property. The event is only fired if a
- * change has actually occurred (i.e. o and n are different).
- * In the event that the property change is vetoed, the following
- * occurs:
- *
- * <ol>
- * <li>
- * This method throws a <code>PropertyVetoException</code> to
- * the proposed change.
- * </li>
- * <li>
- * A new event is fired to reverse the previous change.
- * </li>
- * <li>
- * This method again throws a <code>PropertyVetoException</code>
- * in response to the reversion.
- * </li>
- * </ol>
- *
- * @param name The name of the property to which a change occurred.
- * @param o The old value of the property.
- * @param n The new value of the property.
- * @throws PropertyVetoException if one of the listeners vetos
- * the change by throwing this exception.
- */
- protected void fireVetoableChange(String name, Object o, Object n)
- throws PropertyVetoException
- {
- vetoableChangeSupport.fireVetoableChange(name, o, n);
- }
-
- /**
- * Adds a key event dispatcher to the list of registered dispatchers.
- * When a key event is fired, each dispatcher's <code>dispatchKeyEvent</code>
- * method is called in the order that they were added, prior to the manager
- * dispatching the event itself. Notifications halt when one of the
- * dispatchers returns true.
- * <br />
- * <br />
- * The same dispatcher can exist multiple times within the list
- * of registered dispatchers, and there is no limit on the length
- * of this list. A null dispatcher is simply ignored.
- *
- * @param dispatcher The dispatcher to register.
- */
- public void addKeyEventDispatcher(KeyEventDispatcher dispatcher)
- {
- if (dispatcher != null)
- keyEventDispatchers.add(dispatcher);
- }
-
- /**
- * Removes the specified key event dispatcher from the list of
- * registered dispatchers. The manager always dispatches events,
- * regardless of its existence within the list. The manager
- * can be added and removed from the list, as with any other
- * dispatcher, but this does not affect its ability to dispatch
- * key events. Non-existent and null dispatchers are simply ignored
- * by this method.
- *
- * @param dispatcher The dispatcher to remove.
- */
- public void removeKeyEventDispatcher(KeyEventDispatcher dispatcher)
- {
- keyEventDispatchers.remove(dispatcher);
- }
-
- /**
- * Returns the currently registered key event dispatchers in <code>List</code>
- * form. At present, this only includes dispatchers explicitly registered
- * via the <code>addKeyEventDispatcher()</code> method, but this behaviour
- * is subject to change and should not be depended on. The manager itself
- * may be a member of the list, but only if explicitly registered. If no
- * dispatchers have been registered, the list will be empty.
- *
- * @return A list of explicitly registered key event dispatchers.
- * @see KeyboardFocusManager#addKeyEventDispatcher(java.awt.KeyEventDispatcher)
- */
- protected List getKeyEventDispatchers ()
- {
- return (List) keyEventDispatchers.clone ();
- }
-
- /**
- * Adds a key event post processor to the list of registered post processors.
- * Post processors work in the same way as key event dispatchers, except
- * that they are invoked after the manager has dispatched the key event,
- * and not prior to this. Each post processor's <code>postProcessKeyEvent</code>
- * method is called to see if any post processing needs to be performed. THe
- * processors are called in the order in which they were added to the list,
- * and notifications continue until one returns true. As with key event
- * dispatchers, the manager is implicitly called following this process,
- * regardless of whether or not it is present within the list.
- * <br />
- * <br />
- * The same post processor can exist multiple times within the list
- * of registered post processors, and there is no limit on the length
- * of this list. A null post processor is simply ignored.
- *
- * @param postProcessor the post processor to register.
- * @see KeyboardFocusManager#addKeyEventDispatcher(java.awt.KeyEventDispatcher)
- */
- public void addKeyEventPostProcessor (KeyEventPostProcessor postProcessor)
- {
- if (postProcessor != null)
- keyEventPostProcessors.add (postProcessor);
- }
-
- /**
- * Removes the specified key event post processor from the list of
- * registered post processors. The manager always post processes events,
- * regardless of its existence within the list. The manager
- * can be added and removed from the list, as with any other
- * post processor, but this does not affect its ability to post process
- * key events. Non-existent and null post processors are simply ignored
- * by this method.
- *
- * @param postProcessor the post processor to remove.
- */
- public void removeKeyEventPostProcessor (KeyEventPostProcessor postProcessor)
- {
- keyEventPostProcessors.remove (postProcessor);
- }
-
- /**
- * Returns the currently registered key event post processors in <code>List</code>
- * form. At present, this only includes post processors explicitly registered
- * via the <code>addKeyEventPostProcessor()</code> method, but this behaviour
- * is subject to change and should not be depended on. The manager itself
- * may be a member of the list, but only if explicitly registered. If no
- * post processors have been registered, the list will be empty.
- *
- * @return A list of explicitly registered key event post processors.
- * @see KeyboardFocusManager#addKeyEventPostProcessor(java.awt.KeyEventPostProcessor)
- */
- protected List getKeyEventPostProcessors ()
- {
- return (List) keyEventPostProcessors.clone ();
- }
-
- /**
- * The AWT event dispatcher uses this method to request that the manager
- * handle a particular event. If the manager fails or refuses to
- * dispatch the supplied event (this method returns false), the
- * AWT event dispatcher will try to dispatch the event itself.
- * <br />
- * <br />
- * The manager is expected to handle all <code>FocusEvent</code>s
- * and <code>KeyEvent</code>s, and <code>WindowEvent</code>s
- * relating to the focus. Dispatch is done with regard to the
- * the focus owner and the currently focused and active windows.
- * In handling the event, the source of the event may be overridden.
- * <br />
- * <br />
- * The actual dispatching is performed by calling
- * <code>redispatchEvent()</code>. This avoids the infinite recursion
- * of dispatch requests which may occur if this method is called on
- * the target component.
- *
- * @param e the event to dispatch.
- * @return true if the event was dispatched.
- * @see KeyboardFocusManager#redispatchEvent(java.awt.Component, java.awt.AWTEvent)
- * @see KeyEvent
- * @see FocusEvent
- * @see WindowEvent
- */
- public abstract boolean dispatchEvent (AWTEvent e);
-
- /**
- * Handles redispatching of an event so that recursion of
- * dispatch requests does not occur. Event dispatch methods
- * within this manager (<code>dispatchEvent()</code>) and
- * the key event dispatchers should use this method to handle
- * dispatching rather than the dispatch method of the target
- * component.
- * <br />
- * <br />
- * <strong>
- * This method is not intended for general consumption, and is
- * only for the use of the aforementioned classes.
- * </strong>
- *
- * @param target the target component to which the event is
- * dispatched.
- * @param e the event to dispatch.
- */
- public final void redispatchEvent (Component target, AWTEvent e)
- {
- synchronized (e)
- {
- e.setSource (target);
- target.dispatchEvent (e);
- }
- }
-
- /**
- * Attempts to dispatch key events for which no key event dispatcher
- * has so far succeeded. This method is usually called by
- * <code>dispatchEvent()</code> following the sending of the key
- * event to any registered key event dispatchers. If the key
- * event reaches this stage, none of the dispatchers returned
- * true. This is, of course, always the case if there are no
- * registered dispatchers.
- * <br />
- * <br />
- * If this method also fails to handle the key event, then
- * false is returned to the caller. In the case of
- * <code>dispatchEvent()</code>, the calling method may try
- * to handle the event itself or simply forward on the
- * false result to its caller. When the event is dispatched
- * by this method, a true result is propogated through the
- * calling methods.
- *
- * @param e the key event to dispatch.
- * @return true if the event was dispatched successfully.
- */
- public abstract boolean dispatchKeyEvent (KeyEvent e);
-
- /**
- * Handles the post processing of key events. By default,
- * this method will map unhandled key events to appropriate
- * <code>MenuShortcut</code>s. The event is consumed
- * in the process and the shortcut is activated. This
- * method is usually called by <code>dispatchKeyEvent</code>.
- *
- * @param e the key event to post process.
- * @return true by default, as the event was handled.
- */
- public abstract boolean postProcessKeyEvent (KeyEvent e);
-
- /**
- * Handles focus traversal operations for key events which
- * represent focus traversal keys in relation to the supplied
- * component. The supplied component is assumed to have the
- * focus, whether it does so or not, and the operation is
- * carried out as appropriate, with this in mind.
- *
- * @param focused the component on which to perform focus traversal,
- * on the assumption that this component has the focus.
- * @param e the possible focus traversal key event.
- */
- public abstract void processKeyEvent (Component focused, KeyEvent e);
-
- /**
- * Delays all key events following the specified timestamp until the
- * supplied component has focus. The AWT calls this method when it is
- * determined that a focus change may occur within the native windowing
- * system. Any key events which occur following the time specified by
- * after are delayed until a <code>FOCUS_GAINED</code> event is received
- * for the untilFocused component. The manager is responsible for ensuring
- * this takes place.
- *
- * @param after the timestamp beyond which all key events are delayed until
- * the supplied component gains focus.
- * @param untilFocused the component to wait on gaining focus.
- */
- protected abstract void enqueueKeyEvents (long after, Component untilFocused);
-
- /**
- * Removes the key event block specified by the supplied timestamp and component.
- * All delayed key events are released for normal dispatching following its
- * removal and subsequent key events that would have been blocked are now
- * immediately dispatched. If the specified timestamp is below 0, then
- * the request with the oldest timestamp is removed.
- *
- * @param after the timestamp of the key event block to be removed, or a
- * value smaller than 0 if the oldest is to be removed.
- * @param untilFocused the component of the key event block to be removed.
- */
- protected abstract void dequeueKeyEvents (long after, Component untilFocused);
-
- /**
- * Discards all key event blocks relating to focus requirements for
- * the supplied component, regardless of timestamp.
- *
- * @param comp the component of the key event block(s) to be removed.
- */
- protected abstract void discardKeyEvents (Component comp);
-
- /**
- * Moves the current focus to the next component following
- * comp, based on the current focus traversal policy. By
- * default, only visible, displayable, accepted components
- * can receive focus. <code>Canvas</code>es, <code>Panel</code>s,
- * <code>Label</code>s, <code>ScrollPane</code>s, <code>Scrollbar</code>s,
- * <code>Window</code>s and lightweight components are judged
- * to be unacceptable by default. See the
- * <code>DefaultFocusTraversalPolicy</code> for more details.
- *
- * @param comp the component prior to the one which will
- * become the focus, following execution of this method.
- * @see DefaultFocusTraversalPolicy
- */
- public abstract void focusNextComponent(Component comp);
-
- /**
- * Moves the current focus to the previous component, prior to
- * comp, based on the current focus traversal policy. By
- * default, only visible, displayable, accepted components
- * can receive focus. <code>Canvas</code>es, <code>Panel</code>s,
- * <code>Label</code>s, <code>ScrollPane</code>s, <code>Scrollbar</code>s,
- * <code>Window</code>s and lightweight components are judged
- * to be unacceptable by default. See the
- * <code>DefaultFocusTraversalPolicy</code> for more details.
- *
- * @param comp the component following the one which will
- * become the focus, following execution of this method.
- * @see DefaultFocusTraversalPolicy
- */
- public abstract void focusPreviousComponent(Component comp);
-
- /**
- * Moves the current focus upwards by one focus cycle.
- * Both the current focus owner and current focus cycle root
- * become the focus cycle root of the supplied component.
- * However, in the case of a <code>Window</code>, the default
- * focus component becomes the focus owner and the focus cycle
- * root is not changed.
- *
- * @param comp the component used as part of the focus traversal.
- */
- public abstract void upFocusCycle(Component comp);
-
- /**
- * Moves the current focus downwards by one focus cycle.
- * If the supplied container is a focus cycle root, then this
- * becomes the current focus cycle root and the focus goes
- * to the default component of the specified container.
- * Nothing happens for non-focus cycle root containers.
- *
- * @param cont the container used as part of the focus traversal.
- */
- public abstract void downFocusCycle(Container cont);
-
- /**
- * Moves the current focus to the next component, based on the
- * current focus traversal policy. By default, only visible,
- * displayable, accepted component can receive focus.
- * <code>Canvas</code>es, <code>Panel</code>s,
- * <code>Label</code>s, <code>ScrollPane</code>s, <code>Scrollbar</code>s,
- * <code>Window</code>s and lightweight components are judged
- * to be unacceptable by default. See the
- * <code>DefaultFocusTraversalPolicy</code> for more details.
- *
- * @see DefaultFocusTraversalPolicy
- */
- public final void focusNextComponent()
- {
- focusNextComponent (null);
- }
-
- /**
- * Moves the current focus to the previous component, based on the
- * current focus traversal policy. By default, only visible,
- * displayable, accepted component can receive focus.
- * <code>Canvas</code>es, <code>Panel</code>s,
- * <code>Label</code>s, <code>ScrollPane</code>s, <code>Scrollbar</code>s,
- * <code>Window</code>s and lightweight components are judged
- * to be unacceptable by default. See the
- * <code>DefaultFocusTraversalPolicy</code> for more details.
- *
- * @see DefaultFocusTraversalPolicy
- */
- public final void focusPreviousComponent()
- {
- focusPreviousComponent (null);
- }
-
- /**
- * Moves the current focus upwards by one focus cycle,
- * so that the new focus owner is the focus cycle root
- * of the current owner. The current focus cycle root then
- * becomes the focus cycle root of the new focus owner.
- * However, in the case of the focus cycle root of the
- * current focus owner being a <code>Window</code>, the default
- * component of this window becomes the focus owner and the
- * focus cycle root is not changed.
- */
- public final void upFocusCycle()
- {
- upFocusCycle (null);
- }
-
- /**
- * Moves the current focus downwards by one focus cycle,
- * iff the current focus cycle root is a <code>Container</code>.
- * Usually, the new focus owner is set to the default component
- * of the container and the current focus cycle root is set
- * to the current focus owner. Nothing occurs if the current
- * focus cycle root is not a container.
- */
- public final void downFocusCycle()
- {
- Component focusOwner = getGlobalFocusOwner ();
- if (focusOwner instanceof Container
- && ((Container) focusOwner).isFocusCycleRoot ())
- downFocusCycle ((Container) focusOwner);
- }
-
- /**
- * Retrieve an object from one of the global object {@link
- * java.util.Map}s, if the object was set by the a thread in the
- * current {@link java.lang.ThreadGroup}. Otherwise, return null.
- *
- * @param globalMap one of the global object Maps
- *
- * @return a global object set by the current ThreadGroup, or null
- *
- * @see getFocusOwner
- * @see getPermanentFocusOwner
- * @see getFocusedWindow
- * @see getActiveWindow
- * @see getCurrentFocusCycleRoot
- */
- private Object getObject (Map globalMap)
- {
- ThreadGroup currentGroup = Thread.currentThread ().getThreadGroup ();
- return globalMap.get (currentGroup);
- }
-
- /**
- * Retrieve an object from one of the global object {@link
- * java.util.Map}s, regardless of whether or not the object was set
- * by a thread in the current {@link java.lang.ThreadGroup}.
- *
- * @param globalMap one of the global object Maps
- *
- * @return a global object set by the current ThreadGroup, or null
- *
- * @throws SecurityException if this is not the keyboard focus
- * manager associated with the current {@link java.lang.ThreadGroup}
- *
- * @see getGlobalFocusOwner
- * @see getGlobalPermanentFocusOwner
- * @see getGlobalFocusedWindow
- * @see getGlobalActiveWindow
- * @see getGlobalCurrentFocusCycleRoot
- */
- private Object getGlobalObject (Map globalMap)
- {
- ThreadGroup currentGroup = Thread.currentThread ().getThreadGroup ();
- KeyboardFocusManager managerForCallingThread
- = (KeyboardFocusManager) currentKeyboardFocusManagers.get (currentGroup);
-
- if (this != managerForCallingThread)
- throw new SecurityException ("Attempted to retrieve an object from a "
- + "keyboard focus manager that isn't "
- + "associated with the current thread group.");
-
- synchronized (globalMap)
- {
- Collection globalObjects = globalMap.values ();
- Iterator i = globalObjects.iterator ();
- Component globalObject;
-
- while (i.hasNext ())
- {
- globalObject = (Component) i.next ();
- if (globalObject != null)
- return globalObject;
- }
- }
-
- // No Object was found.
- return null;
- }
-
- /**
- * Set an object in one of the global object {@link java.util.Map}s,
- * that will be returned by subsequent calls to getGlobalObject on
- * the same {@link java.util.Map}.
- *
- * @param globalMap one of the global object Maps
- * @param newObject the object to set
- * @param property the property that will change
- *
- * @see setGlobalFocusOwner
- * @see setGlobalPermanentFocusOwner
- * @see setGlobalFocusedWindow
- * @see setGlobalActiveWindow
- * @see setGlobalCurrentFocusCycleRoot
- */
- private void setGlobalObject (Map globalMap,
- Object newObject,
- String property)
- {
- synchronized (globalMap)
- {
- // Save old object.
- Object oldObject = getGlobalObject (globalMap);
-
- // Nullify old object.
- Collection threadGroups = globalMap.keySet ();
- Iterator i = threadGroups.iterator ();
- while (i.hasNext ())
- {
- ThreadGroup oldThreadGroup = (ThreadGroup) i.next ();
- if (globalMap.get (oldThreadGroup) != null)
- {
- globalMap.put (oldThreadGroup, null);
- // There should only be one object set at a time, so
- // we can short circuit.
- break;
- }
- }
-
- ThreadGroup currentGroup = Thread.currentThread ().getThreadGroup ();
- firePropertyChange (property, oldObject, newObject);
- try
- {
- fireVetoableChange (property, oldObject, newObject);
- // Set new object.
- globalMap.put (currentGroup, newObject);
- }
- catch (PropertyVetoException e)
- {
- }
- }
- }
-}
diff --git a/libjava/java/awt/Label.java b/libjava/java/awt/Label.java
deleted file mode 100644
index 8867fa12e35..00000000000
--- a/libjava/java/awt/Label.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/* Label.java -- Java label widget
- Copyright (C) 1999, 2000, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.peer.LabelPeer;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * This component is used for displaying simple text strings that cannot
- * be edited by the user.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- */
-public class Label extends Component implements Accessible
-{
-
-/*
- * Static Variables
- */
-
-/**
- * Alignment constant aligning the text to the left of its window.
- */
-public static final int LEFT = 0;
-
-/**
- * Alignment constant aligning the text in the center of its window.
- */
-public static final int CENTER = 1;
-
-/**
- * Alignment constant aligning the text to the right of its window.
- */
-public static final int RIGHT = 2;
-
-// Serialization version constant:
-private static final long serialVersionUID = 3094126758329070636L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial Indicates the alignment of the text within this label's window.
- * This is one of the constants in this class. The default value is
- * <code>LEFT</code>.
- */
-private int alignment;
-
-/**
- * @serial The text displayed in the label
- */
-private String text;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>Label</code> with no text.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-Label()
-{
- this("", LEFT);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Label</code> with the specified
- * text that is aligned to the left.
- *
- * @param text The text of the label.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-Label(String text)
-{
- this(text, LEFT);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Label</code> with the specified
- * text and alignment.
- *
- * @param text The text of the label.
- * @param alignment The desired alignment for the text in this label,
- * which must be one of <code>LEFT</code>, <code>CENTER</code>, or
- * <code>RIGHT</code>.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-Label(String text, int alignment)
-{
- setAlignment (alignment);
- setText (text);
-
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * Returns the constant indicating the alignment of the text in this
- * label. The value returned will be one of the alignment constants
- * from this class.
- *
- * @return The alignment of the text in the label.
- */
-public int
-getAlignment()
-{
- return(alignment);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the text alignment of this label to the specified value.
- *
- * @param alignment The desired alignment for the text in this label,
- * which must be one of <code>LEFT</code>, <code>CENTER</code>, or
- * <code>RIGHT</code>.
- */
-public synchronized void
-setAlignment(int alignment)
-{
- if (alignment != CENTER && alignment != LEFT && alignment != RIGHT)
- throw new IllegalArgumentException ("invalid alignment: " + alignment);
- this.alignment = alignment;
- if (peer != null)
- {
- LabelPeer lp = (LabelPeer) peer;
- lp.setAlignment (alignment);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns the text displayed in this label.
- *
- * @return The text for this label.
- */
-public String
-getText()
-{
- return(text);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the text in this label to the specified value.
- *
- * @param text The new text for this label.
- */
-public synchronized void
-setText(String text)
-{
- this.text = text;
-
- if (peer != null)
- {
- LabelPeer lp = (LabelPeer) peer;
- lp.setText (text);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Notifies this label that it has been added to a container, causing
- * the peer to be created. This method is called internally by the AWT
- * system.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createLabel (this);
- super.addNotify ();
-}
-
-/*************************************************************************/
-
-/**
- * Returns a parameter string useful for debugging.
- *
- * @return A debugging string.
- */
-protected String
-paramString()
-{
- return ("text=" + getText() + ",alignment=" +
- getAlignment() + "," + super.paramString());
-}
-
-/**
- * This class provides accessibility support for the label.
- */
-protected class AccessibleAWTLabel
- extends AccessibleAWTComponent
-{
- /**
- * For compatability with Sun's JDK 1.4.2 rev. 5
- */
- private static final long serialVersionUID = -3568967560160480438L;
-
- /**
- * Constructor for the accessible label.
- */
- public AccessibleAWTLabel()
- {
- }
-
- /**
- * Returns the accessible name for the label. This is
- * the text used in the label.
- *
- * @return a <code>String</code> containing the accessible
- * name for this label.
- */
- public String getAccessibleName()
- {
- return getText();
- }
-
- /**
- * Returns the accessible role for the label.
- *
- * @return an instance of <code>AccessibleRole</code>, describing
- * the role of the label.
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.LABEL;
- }
-
-}
-
-/**
- * Gets the AccessibleContext associated with this <code>Label</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
-public AccessibleContext getAccessibleContext()
-{
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTLabel();
- return accessibleContext;
-}
-
-} // class Label
-
diff --git a/libjava/java/awt/LayoutManager.java b/libjava/java/awt/LayoutManager.java
deleted file mode 100644
index 62ff8087e76..00000000000
--- a/libjava/java/awt/LayoutManager.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* LayoutManager.java -- lay out elements in a Container
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This interface is for laying out containers in a particular sequence.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Container
- * @since 1.0
- * @status updated to 1.4
- */
-public interface LayoutManager
-{
- /**
- * Adds the specified component to the layout group.
- *
- * @param name the name of the component to add
- * @param component the component to add
- */
- void addLayoutComponent(String name, Component component);
-
- /**
- * Removes the specified component from the layout group.
- *
- * @param component the component to remove
- */
- void removeLayoutComponent(Component component);
-
- /**
- * Calculates the preferred size for this container, taking into account
- * the components it contains.
- *
- * @param parent the parent container to lay out
- * @return the preferred dimensions of this container
- * @see #minimumLayoutSize(Container)
- */
- Dimension preferredLayoutSize(Container parent);
-
- /**
- * Calculates the minimum size for this container, taking into account
- * the components it contains.
- *
- * @param parent the parent container to lay out
- * @return the minimum dimensions of this container
- * @see #preferredLayoutSize(Container)
- */
- Dimension minimumLayoutSize(Container parent);
-
- /**
- * Lays out the components in the given container.
- *
- * @param parent the container to lay out
- */
- void layoutContainer(Container parent);
-} // interface LayoutManager
diff --git a/libjava/java/awt/LayoutManager2.java b/libjava/java/awt/LayoutManager2.java
deleted file mode 100644
index 45fc5430f29..00000000000
--- a/libjava/java/awt/LayoutManager2.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* LayoutManager2.java -- enhanced layout manager
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * Layout manager for laying out containers based on contraints. The
- * constraints control how the layout will proceed.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see LayoutManager
- * @see Container
- * @since 1.0
- * @status updated to 1.4
- */
-public interface LayoutManager2 extends LayoutManager
-{
- /**
- * Adds the specified component to the layout, with the specified
- * constraints object.
- *
- * @param component the component to add
- * @param constraints the constraints to satisfy
- */
- void addLayoutComponent(Component component, Object constraints);
-
- /**
- * Determines the maximum size of the specified target container.
- *
- * @param target the container to lay out
- * @return the maximum size of the container
- * @see Component#getMaximumSize()
- */
- Dimension maximumLayoutSize(Container target);
-
- /**
- * Returns the preferred X axis alignment for the specified target
- * container. This value will range from 0 to 1 where 0 is alignment
- * closest to the origin, 0.5 is centered, and 1 is aligned furthest
- * from the origin.
- *
- * @param target the target container
- * @return the x-axis alignment preference
- */
- float getLayoutAlignmentX(Container target);
-
- /**
- * Returns the preferred Y axis alignment for the specified target
- * container. This value will range from 0 to 1 where 0 is alignment
- * closest to the origin, 0.5 is centered, and 1 is aligned furthest
- * from the origin.
- *
- * @param target the target container
- * @return the y-axis alignment preference
- */
- float getLayoutAlignmentY(Container target);
-
- /**
- * Forces the layout manager to purge any cached information about the
- * layout of the target container. This will force it to be recalculated.
- *
- * @param target the target container
- */
- void invalidateLayout(Container target);
-} // interface LayoutManager2
diff --git a/libjava/java/awt/List.java b/libjava/java/awt/List.java
deleted file mode 100644
index 5fcc79bfcef..00000000000
--- a/libjava/java/awt/List.java
+++ /dev/null
@@ -1,1263 +0,0 @@
-/* List.java -- A listbox widget
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.peer.ListPeer;
-import java.util.EventListener;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleSelection;
-import javax.accessibility.AccessibleState;
-import javax.accessibility.AccessibleStateSet;
-
-/**
- * Class that implements a listbox widget
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class List extends Component
- implements ItemSelectable, Accessible
-{
-
-/*
- * Static Variables
- */
-
-// Serialization constant
-private static final long serialVersionUID = -3304312411574666869L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-// FIXME: Need read/writeObject
-
-/**
- * @serial The items in the list.
- */
-private Vector items = new Vector();
-
-/**
- * @serial Indicates whether or not multiple items can be selected
- * simultaneously.
- */
-private boolean multipleMode;
-
-/**
- * @serial The number of rows in the list. This is set on creation
- * only and cannot be modified.
- */
-private int rows;
-
-/**
- * @serial An array of the item indices that are selected.
- */
-private int[] selected;
-
-/**
- * @serial An index value used by <code>makeVisible()</code> and
- * <code>getVisibleIndex</code>.
- */
-private int visibleIndex;
-
-// The list of ItemListeners for this object.
-private ItemListener item_listeners;
-
-// The list of ActionListeners for this object.
-private ActionListener action_listeners;
-
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>List</code> with no visible lines
- * and multi-select disabled.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-List()
-{
- this(4, false);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>List</code> with the specified
- * number of visible lines and multi-select disabled.
- *
- * @param rows The number of visible rows in the list.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-List(int rows)
-{
- this(rows, false);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>List</code> with the specified
- * number of lines and the specified multi-select setting.
- *
- * @param rows The number of visible rows in the list.
- * @param multipleMode <code>true</code> if multiple lines can be selected
- * simultaneously, <code>false</code> otherwise.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-List(int rows, boolean multipleMode)
-{
- this.rows = rows;
- this.multipleMode = multipleMode;
-
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * Returns the number of items in this list.
- *
- * @return The number of items in this list.
- */
-public int
-getItemCount()
-{
- return countItems ();
-}
-
-/*************************************************************************/
-
-/**
- * Returns the number of items in this list.
- *
- * @return The number of items in this list.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getItemCount()</code>
- */
-public int
-countItems()
-{
- return items.size ();
-}
-
-/*************************************************************************/
-
-/**
- * Returns the complete list of items.
- *
- * @return The complete list of items in the list.
- */
-public synchronized String[]
-getItems()
-{
- String[] l_items = new String[getItemCount()];
-
- items.copyInto(l_items);
- return(l_items);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the item at the specified index.
- *
- * @param index The index of the item to retrieve.
- *
- * @exception IndexOutOfBoundsException If the index value is not valid.
- */
-public String
-getItem(int index)
-{
- return((String)items.elementAt(index));
-}
-
-/*************************************************************************/
-
-/**
- * Returns the number of visible rows in the list.
- *
- * @return The number of visible rows in the list.
- */
-public int
-getRows()
-{
- return(rows);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not multi-select mode is enabled.
- *
- * @return <code>true</code> if multi-select mode is enabled,
- * <code>false</code> otherwise.
- */
-public boolean
-isMultipleMode()
-{
- return allowsMultipleSelections ();
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not multi-select mode is enabled.
- *
- * @return <code>true</code> if multi-select mode is enabled,
- * <code>false</code> otherwise.
- *
- * @deprecated This method is deprecated in favor of
- * <code>isMultipleMode()</code>.
- */
-public boolean
-allowsMultipleSelections()
-{
- return multipleMode;
-}
-
-/*************************************************************************/
-
-/**
- * This method enables or disables multiple selection mode for this
- * list.
- *
- * @param multipleMode <code>true</code> to enable multiple mode,
- * <code>false</code> otherwise.
- */
-public void
-setMultipleMode(boolean multipleMode)
-{
- setMultipleSelections (multipleMode);
-}
-
-/*************************************************************************/
-
-/**
- * This method enables or disables multiple selection mode for this
- * list.
- *
- * @param multipleMode <code>true</code> to enable multiple mode,
- * <code>false</code> otherwise.
- *
- * @deprecated
- */
-public void
-setMultipleSelections(boolean multipleMode)
-{
- this.multipleMode = multipleMode;
-
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- peer.setMultipleMode (multipleMode);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of this component.
- *
- * @return The minimum size of this component.
- */
-public Dimension
-getMinimumSize()
-{
- return getMinimumSize (getRows ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of this component.
- *
- * @return The minimum size of this component.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getMinimumSize</code>.
- */
-public Dimension
-minimumSize()
-{
- return minimumSize (getRows ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of this component assuming it had the specified
- * number of rows.
- *
- * @param rows The number of rows to size for.
- *
- * @return The minimum size of this component.
- */
-public Dimension
-getMinimumSize(int rows)
-{
- return minimumSize (rows);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of this component assuming it had the specified
- * number of rows.
- *
- * @param rows The number of rows to size for.
- *
- * @return The minimum size of this component.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getMinimumSize(int)</code>>
- */
-public Dimension
-minimumSize(int rows)
-{
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- return peer.minimumSize (rows);
- else
- return new Dimension (0, 0);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of this component.
- *
- * @return The preferred size of this component.
- */
-public Dimension
-getPreferredSize()
-{
- return getPreferredSize (getRows ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of this component.
- *
- * @return The preferred size of this component.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getPreferredSize</code>.
- */
-public Dimension
-preferredSize()
-{
- return preferredSize (getRows ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of this component assuming it had the specified
- * number of rows.
- *
- * @param rows The number of rows to size for.
- *
- * @return The preferred size of this component.
- */
-public Dimension
-getPreferredSize(int rows)
-{
- return preferredSize (rows);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of this component assuming it had the specified
- * number of rows.
- *
- * @param rows The number of rows to size for.
- *
- * @return The preferred size of this component.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getPreferredSize(int)</code>>
- */
-public Dimension
-preferredSize(int rows)
-{
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- return peer.preferredSize (rows);
- else
- return new Dimension (0, 0);
-}
-
-/*************************************************************************/
-
-/**
- * This method adds the specified item to the end of the list.
- *
- * @param item The item to add to the list.
- */
-public void
-add(String item)
-{
- add (item, -1);
-}
-
-/*************************************************************************/
-
-/**
- * This method adds the specified item to the end of the list.
- *
- * @param item The item to add to the list.
- *
- * @deprecated Use add() instead.
- */
-public void
-addItem(String item)
-{
- addItem (item, -1);
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified item to the specified location in the list.
- * If the desired index is -1 or greater than the number of rows
- * in the list, then the item is added to the end.
- *
- * @param item The item to add to the list.
- * @param index The location in the list to add the item, or -1 to add
- * to the end.
- */
-public void
-add(String item, int index)
-{
- addItem (item, index);
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified item to the specified location in the list.
- * If the desired index is -1 or greater than the number of rows
- * in the list, then the item is added to the end.
- *
- * @param item The item to add to the list.
- * @param index The location in the list to add the item, or -1 to add
- * to the end.
- *
- * @deprecated Use add() instead.
- */
-public void
-addItem(String item, int index)
-{
- if ((index == -1) || (index >= items.size ()))
- items.addElement (item);
- else
- items.insertElementAt (item, index);
-
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- peer.add (item, index);
-}
-
-/*************************************************************************/
-
-/**
- * Deletes the item at the specified index.
- *
- * @param index The index of the item to delete.
- *
- * @exception IllegalArgumentException If the index is not valid
- *
- * @deprecated
- */
-public void
-delItem(int index) throws IllegalArgumentException
-{
- items.removeElementAt (index);
-
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- peer.delItems (index, index);
-}
-
-/*************************************************************************/
-
-/**
- * Deletes the item at the specified index.
- *
- * @param index The index of the item to delete.
- *
- * @exception IllegalArgumentException If the index is not valid
- */
-public void
-remove(int index) throws IllegalArgumentException
-{
- delItem (index);
-}
-
-/*************************************************************************/
-
-/**
- * Deletes all items in the specified index range.
- *
- * @param start The beginning index of the range to delete.
- * @param end The ending index of the range to delete.
- *
- * @exception IllegalArgumentException If the indexes are not valid
- *
- * @deprecated This method is deprecated for some unknown reason.
- */
-public synchronized void
-delItems(int start, int end) throws IllegalArgumentException
-{
- if ((start < 0) || (start >= items.size()))
- throw new IllegalArgumentException("Bad list start index value: " + start);
-
- if ((start < 0) || (start >= items.size()))
- throw new IllegalArgumentException("Bad list start index value: " + start);
-
- if (start > end)
- throw new IllegalArgumentException("Start is greater than end!");
-
- // We must run the loop in reverse direction.
- for (int i = end; i >= start; --i)
- items.removeElementAt (i);
- if (peer != null)
- {
- ListPeer l = (ListPeer) peer;
- l.delItems (start, end);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Deletes the first occurrence of the specified item from the list.
- *
- * @param item The item to delete.
- *
- * @exception IllegalArgumentException If the specified item does not exist.
- */
-public synchronized void
-remove(String item) throws IllegalArgumentException
-{
- int index = items.indexOf(item);
- if (index == -1)
- throw new IllegalArgumentException("List element to delete not found");
-
- remove(index);
-}
-
-/*************************************************************************/
-
-/**
- * Deletes all of the items from the list.
- */
-public synchronized void
-removeAll()
-{
- clear ();
-}
-
-/*************************************************************************/
-
-/**
- * Deletes all of the items from the list.
- *
- * @deprecated This method is deprecated in favor of <code>removeAll()</code>.
- */
-public void
-clear()
-{
- items.clear();
-
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- peer.removeAll ();
-}
-
-/*************************************************************************/
-
-/**
- * Replaces the item at the specified index with the specified item.
- *
- * @param item The new item value.
- * @param index The index of the item to replace.
- *
- * @exception IllegalArgumentException If the index is not valid.
- */
-public synchronized void
-replaceItem(String item, int index) throws IllegalArgumentException
-{
- if ((index < 0) || (index >= items.size()))
- throw new IllegalArgumentException("Bad list index: " + index);
-
- items.insertElementAt(item, index + 1);
- items.removeElementAt (index);
-
- if (peer != null)
- {
- ListPeer l = (ListPeer) peer;
-
- /* We add first and then remove so that the selected
- item remains the same */
- l.add (item, index + 1);
- l.delItems (index, index);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns the index of the currently selected item. -1 will be returned
- * if there are no selected rows or if there are multiple selected rows.
- *
- * @return The index of the selected row.
- */
-public synchronized int
-getSelectedIndex()
-{
- if (peer != null)
- {
- ListPeer l = (ListPeer) peer;
- selected = l.getSelectedIndexes ();
- }
-
- if (selected == null || selected.length != 1)
- return -1;
- return selected[0];
-}
-
-/*************************************************************************/
-
-/**
- * Returns an array containing the indexes of the rows that are
- * currently selected.
- *
- * @return A list of indexes of selected rows.
- */
-public synchronized int[]
-getSelectedIndexes()
-{
- if (peer != null)
- {
- ListPeer l = (ListPeer) peer;
- selected = l.getSelectedIndexes ();
- }
- return selected;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the item that is currently selected, or <code>null</code> if there
- * is no item selected. FIXME: What happens if multiple items selected?
- *
- * @return The selected item, or <code>null</code> if there is no
- * selected item.
- */
-public synchronized String
-getSelectedItem()
-{
- int index = getSelectedIndex();
- if (index == -1)
- return(null);
-
- return((String)items.elementAt(index));
-}
-
-/*************************************************************************/
-
-/**
- * Returns the list of items that are currently selected in this list.
- *
- * @return The list of currently selected items.
- */
-public synchronized String[]
-getSelectedItems()
-{
- int[] indexes = getSelectedIndexes();
- if (indexes == null)
- return(new String[0]);
-
- String[] retvals = new String[indexes.length];
- if (retvals.length > 0)
- for (int i = 0 ; i < retvals.length; i++)
- retvals[i] = (String)items.elementAt(indexes[i]);
-
- return(retvals);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the list of items that are currently selected in this list as
- * an array of type <code>Object[]</code> instead of <code>String[]</code>.
- *
- * @return The list of currently selected items.
- */
-public synchronized Object[]
-getSelectedObjects()
-{
- int[] indexes = getSelectedIndexes();
- if (indexes == null)
- return(new Object[0]);
-
- Object[] retvals = new Object[indexes.length];
- if (retvals.length > 0)
- for (int i = 0 ; i < retvals.length; i++)
- retvals[i] = items.elementAt(indexes[i]);
-
- return(retvals);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not the specified index is selected.
- *
- * @param index The index to test.
- *
- * @return <code>true</code> if the index is selected, <code>false</code>
- * otherwise.
- */
-public boolean
-isIndexSelected(int index)
-{
- return isSelected (index);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not the specified index is selected.
- *
- * @param index The index to test.
- *
- * @return <code>true</code> if the index is selected, <code>false</code>
- * otherwise.
- *
- * @deprecated This method is deprecated in favor of
- * <code>isIndexSelected(int)</code>.
- */
-public boolean
-isSelected(int index)
-{
- int[] indexes = getSelectedIndexes ();
-
- for (int i = 0; i < indexes.length; i++)
- if (indexes[i] == index)
- return true;
-
- return false;
-}
-
-/*************************************************************************/
-
-/**
- * This method ensures that the item at the specified index is visible.
- *
- * @exception IllegalArgumentException If the specified index is out of
- * range.
- */
-public synchronized void
-makeVisible(int index) throws IllegalArgumentException
-{
- if ((index < 0) || (index >= items.size()))
- throw new IllegalArgumentException("Bad list index: " + index);
-
- visibleIndex = index;
- if (peer != null)
- {
- ListPeer l = (ListPeer) peer;
- l.makeVisible (index);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns the index of the last item that was made visible via the
- * <code>makeVisible()</code> method.
- *
- * @return The index of the last item made visible via the
- * <code>makeVisible()</code> method.
- */
-public int
-getVisibleIndex()
-{
- return(visibleIndex);
-}
-
-/*************************************************************************/
-
-/**
- * Makes the item at the specified index selected.
- *
- * @param index The index of the item to select.
- */
-public synchronized void
-select(int index)
-{
- ListPeer lp = (ListPeer)getPeer();
- if (lp != null)
- lp.select(index);
-}
-
-/*************************************************************************/
-
-/**
- * Makes the item at the specified index not selected.
- *
- * @param index The index of the item to unselect.
- */
-public synchronized void
-deselect(int index)
-{
- ListPeer lp = (ListPeer)getPeer();
- if (lp != null)
- lp.deselect(index);
-}
-
-/*************************************************************************/
-
-/**
- * Notifies this object to create its native peer.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createList (this);
- super.addNotify ();
-}
-
-/*************************************************************************/
-
-/**
- * Notifies this object to destroy its native peer.
- */
-public void
-removeNotify()
-{
- super.removeNotify();
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified <code>ActionListener</code> to the list of
- * registered listeners for this object.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.add(action_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified <code>ActionListener</code> from the list of
- * registers listeners for this object.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.remove(action_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified <code>ItemListener</code> to the list of
- * registered listeners for this object.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addItemListener(ItemListener listener)
-{
- item_listeners = AWTEventMulticaster.add(item_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified <code>ItemListener</code> from the list of
- * registers listeners for this object.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeItemListener(ItemListener listener)
-{
- item_listeners = AWTEventMulticaster.remove(item_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Processes the specified event for this object. If the event is an
- * instance of <code>ActionEvent</code> then the
- * <code>processActionEvent()</code> method is called. Similarly, if the
- * even is an instance of <code>ItemEvent</code> then the
- * <code>processItemEvent()</code> method is called. Otherwise the
- * superclass method is called to process this event.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof ActionEvent)
- processActionEvent((ActionEvent)event);
- else if (event instanceof ItemEvent)
- processItemEvent((ItemEvent)event);
- else
- super.processEvent(event);
-}
-
-/*************************************************************************/
-
-/**
- * This method processes the specified event by dispatching it to any
- * registered listeners. Note that this method will only get called if
- * action events are enabled. This will happen automatically if any
- * listeners are added, or it can be done "manually" by calling
- * the <code>enableEvents()</code> method.
- *
- * @param event The event to process.
- */
-protected void
-processActionEvent(ActionEvent event)
-{
- if (action_listeners != null)
- action_listeners.actionPerformed(event);
-}
-
-/*************************************************************************/
-
-/**
- * This method processes the specified event by dispatching it to any
- * registered listeners. Note that this method will only get called if
- * item events are enabled. This will happen automatically if any
- * listeners are added, or it can be done "manually" by calling
- * the <code>enableEvents()</code> method.
- *
- * @param event The event to process.
- */
-protected void
-processItemEvent(ItemEvent event)
-{
- if (item_listeners != null)
- item_listeners.itemStateChanged(event);
-}
-
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= ItemEvent.ITEM_LAST
- && e.id >= ItemEvent.ITEM_FIRST
- && (item_listeners != null
- || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
- processEvent(e);
- else if (e.id <= ActionEvent.ACTION_LAST
- && e.id >= ActionEvent.ACTION_FIRST
- && (action_listeners != null
- || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this object.
- *
- * @return A debugging string for this object.
- */
-protected String
-paramString()
-{
- return "multiple=" + multipleMode + ",rows=" + rows + super.paramString();
-}
-
- /**
- * Returns an array of all the objects currently registered as FooListeners
- * upon this <code>List</code>. 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)
- {
- if (listenerType == ActionListener.class)
- return AWTEventMulticaster.getListeners (action_listeners, listenerType);
-
- if (listenerType == ItemListener.class)
- return AWTEventMulticaster.getListeners (item_listeners, listenerType);
-
- return super.getListeners (listenerType);
- }
-
- /**
- * Returns all action listeners registered to this object.
- */
- public ActionListener[] getActionListeners ()
- {
- return (ActionListener[]) getListeners (ActionListener.class);
- }
-
- /**
- * Returns all action listeners registered to this object.
- */
- public ItemListener[] getItemListeners ()
- {
- return (ItemListener[]) getListeners (ItemListener.class);
- }
-
- // Accessibility internal class
- protected class AccessibleAWTList extends AccessibleAWTComponent
- implements AccessibleSelection, ItemListener, ActionListener
- {
- protected class AccessibleAWTListChild extends AccessibleAWTComponent
- implements Accessible
- {
- private int index;
- private List parent;
-
- public AccessibleAWTListChild(List parent, int indexInParent)
- {
- this.parent = parent;
- index = indexInParent;
- if (parent == null)
- index = -1;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.Accessible#getAccessibleContext()
- */
- public AccessibleContext getAccessibleContext()
- {
- return this;
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.LIST_ITEM;
- }
-
- public AccessibleStateSet getAccessibleStateSet()
- {
- AccessibleStateSet states = super.getAccessibleStateSet();
- if (parent.isIndexSelected(index))
- states.add(AccessibleState.SELECTED);
- return states;
- }
-
- public int getAccessibleIndexInParent()
- {
- return index;
- }
-
- }
-
- public AccessibleAWTList()
- {
- addItemListener(this);
- addActionListener(this);
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.LIST;
- }
-
- public AccessibleStateSet getAccessibleStateSet()
- {
- AccessibleStateSet states = super.getAccessibleStateSet();
- states.add(AccessibleState.SELECTABLE);
- if (isMultipleMode())
- states.add(AccessibleState.MULTISELECTABLE);
- return states;
- }
-
- public int getAccessibleChildrenCount()
- {
- return getItemCount();
- }
-
- public Accessible getAccessibleChild(int i)
- {
- if (i >= getItemCount())
- return null;
- return new AccessibleAWTListChild(List.this, i);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleSelection#getAccessibleSelectionCount()
- */
- public int getAccessibleSelectionCount()
- {
- return getSelectedIndexes().length;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleSelection#getAccessibleSelection()
- */
- public AccessibleSelection getAccessibleSelection()
- {
- return this;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleSelection#getAccessibleSelection(int)
- */
- public Accessible getAccessibleSelection(int i)
- {
- int[] items = getSelectedIndexes();
- if (i >= items.length)
- return null;
- return new AccessibleAWTListChild(List.this, items[i]);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleSelection#isAccessibleChildSelected(int)
- */
- public boolean isAccessibleChildSelected(int i)
- {
- return isIndexSelected(i);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleSelection#addAccessibleSelection(int)
- */
- public void addAccessibleSelection(int i)
- {
- select(i);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleSelection#removeAccessibleSelection(int)
- */
- public void removeAccessibleSelection(int i)
- {
- deselect(i);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleSelection#clearAccessibleSelection()
- */
- public void clearAccessibleSelection()
- {
- for (int i = 0; i < getItemCount(); i++)
- deselect(i);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleSelection#selectAllAccessibleSelection()
- */
- public void selectAllAccessibleSelection()
- {
- if (isMultipleMode())
- for (int i = 0; i < getItemCount(); i++)
- select(i);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- */
- public void itemStateChanged(ItemEvent event)
- {
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- public void actionPerformed(ActionEvent event)
- {
- }
-
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>List</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTList();
- return accessibleContext;
- }
-} // class List
diff --git a/libjava/java/awt/MediaTracker.java b/libjava/java/awt/MediaTracker.java
deleted file mode 100644
index 45ed7b48b42..00000000000
--- a/libjava/java/awt/MediaTracker.java
+++ /dev/null
@@ -1,663 +0,0 @@
-/* MediaTracker.java -- Class used for keeping track of images
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.image.ImageObserver;
-import java.util.ArrayList;
-
-/**
- * This class is used for keeping track of the status of various media
- * objects.
- *
- * Media objects are tracked by assigning them an ID. It is possible
- * to assign the same ID to mutliple objects, effectivly grouping them
- * together. In this case the status flags ({@link #statusID}) and error flag
- * (@link #isErrorID} and {@link #getErrorId}) are ORed together. This
- * means that you cannot say exactly which media object has which status,
- * at most you can say that there <em>are</em> certain media objects with
- * some certain status.
- *
- * At the moment only images are supported by this class.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Bryce McKinlay
- */
-public class MediaTracker implements java.io.Serializable
-{
- /** Indicates that the media is still loading. */
- public static final int LOADING = 1 << 0;
-
- /** Indicates that the loading operation has been aborted. */
- public static final int ABORTED = 1 << 1;
-
- /** Indicates that an error has occured during loading of the media. */
- public static final int ERRORED = 1 << 2;
-
- /** Indicates that the media has been successfully and completely loaded. */
- public static final int COMPLETE = 1 << 3;
-
- /** The component on which the media is eventually been drawn. */
- Component target;
-
- /** The head of the linked list of tracked media objects. */
- MediaEntry head;
-
- /** Our serialVersionUID for serialization. */
- static final long serialVersionUID = -483174189758638095L;
-
- /**
- * This represents a media object that is tracked by a MediaTracker.
- * It also implements a simple linked list.
- */
- // FIXME: The serialized form documentation says MediaEntry is a
- // serializable field, but the serialized form of MediaEntry itself
- // doesn't appear to be documented.
- class MediaEntry implements ImageObserver
- {
- /** The ID of the media object. */
- int id;
-
- /** The media object. (only images are supported ATM). */
- Image image;
-
- /** The link to the next entry in the list. */
- MediaEntry next;
-
- /** The tracking status. */
- int status;
-
- /** The width of the image. */
- int width;
-
- /** The height of the image. */
- int height;
-
- /**
- * Receives notification from an {@link java.awt.image.ImageProducer}
- * that more data of the image is available.
- *
- * @param img the image that is updated
- * @param flags flags from the ImageProducer that indicate the status
- * of the loading process
- * @param x the X coordinate of the upper left corner of the image
- * @param y the Y coordinate of the upper left corner of the image
- * @param width the width of the image
- * @param height the height of the image
- *
- * @return <code>true</code> if more data is needed, <code>false</code>
- * otherwise
- *
- * @see {@link java.awt.image.ImageObserver}
- */
- public boolean imageUpdate(Image img, int flags, int x, int y,
- int width, int height)
- {
- if ((flags & ABORT) != 0)
- status = ABORTED;
- else if ((flags & ERROR) != 0)
- status = ERRORED;
- else if ((flags & ALLBITS) != 0)
- status = COMPLETE;
- else
- status = 0;
-
- synchronized (MediaTracker.this)
- {
- MediaTracker.this.notifyAll();
- }
-
- // If status is not COMPLETE then we need more updates.
- return ((status & (COMPLETE | ERRORED | ABORTED)) == 0);
- }
- }
-
- /**
- * Constructs a new MediaTracker for the component <code>c</code>. The
- * component should be the component that uses the media (i.e. draws it).
- *
- * @param c the Component that wants to use the media
- */
- public MediaTracker(Component c)
- {
- target = c;
- }
-
- /**
- * Adds an image to the tracker with the specified <code>ID</code>.
- *
- * @param image the image to be added
- * @param id the ID of the tracker list to which the image is added
- */
- public void addImage(Image image, int id)
- {
- MediaEntry e = new MediaEntry();
- e.id = id;
- e.image = image;
- synchronized(this)
- {
- e.next = head;
- head = e;
- }
- }
-
- /**
- * Adds an image to the tracker with the specified <code>ID</code>.
- * The image is expected to be rendered with the specified width and
- * height.
- *
- * @param image the image to be added
- * @param id the ID of the tracker list to which the image is added
- * @param width the width of the image
- * @param height the height of the image
- */
- public void addImage(Image image, int id, int width, int height)
- {
- MediaEntry e = new MediaEntry();
- e.id = id;
- e.image = image;
- e.width = width;
- e.height = height;
- synchronized(this)
- {
- e.next = head;
- head = e;
- }
- }
-
- /**
- * Checks if all media objects have finished loading, i.e. are
- * {@link #COMPLETE}, {@link #ABORTED} or {@link #ERRORED}.
- *
- * If the media objects are not already loading, a call to this
- * method does <em>not</em> start loading. This is equivalent to
- * a call to <code>checkAll(false)</code>.
- *
- * @return if all media objects have finished loading either by beeing
- * complete, have been aborted or errored.
- */
- public boolean checkAll()
- {
- return checkAll(false);
- }
-
- /**
- * Checks if all media objects have finished loading, i.e. are
- * {@link #COMPLETE}, {@link #ABORTED} or {@link #ERRORED}.
- *
- * If the media objects are not already loading, and <code>load</code>
- * is <code>true</code> then a call to this
- * method starts loading the media objects.
- *
- * @param load if <code>true</code> this method starts loading objects
- * that are not already loading
- *
- * @return if all media objects have finished loading either by beeing
- * complete, have been aborted or errored.
- */
- public boolean checkAll(boolean load)
- {
- MediaEntry e = head;
- boolean result = true;
-
- while (e != null)
- {
- if ((e.status & (COMPLETE | ERRORED | ABORTED)) == 0)
- {
- if (load && ((e.status & LOADING) == 0))
- {
- e.status = LOADING;
- result = false;
- boolean complete = target.prepareImage(e.image, e);
- if (complete)
- {
- e.status = COMPLETE;
- result = true;
- }
- }
- else
- result = false;
- }
- e = e.next;
- }
- return result;
- }
-
- /**
- * Checks if any of the registered media objects has encountered an error
- * during loading.
- *
- * @return <code>true</code> if at least one media object has encountered
- * an error during loading, <code>false</code> otherwise
- *
- */
- public boolean isErrorAny()
- {
- MediaEntry e = head;
- while (e != null)
- {
- if ((e.status & ERRORED) != 0)
- return true;
- e = e.next;
- }
- return false;
- }
-
- /**
- * Returns all media objects that have encountered errors during loading.
- *
- * @return an array of all media objects that have encountered errors
- * or <code>null</code> if there were no errors at all
- */
- public Object[] getErrorsAny()
- {
- MediaEntry e = head;
- ArrayList result = null;
- while (e != null)
- {
- if ((e.status & ERRORED) != 0)
- {
- if (result == null)
- result = new ArrayList();
- result.add(e.image);
- }
- e = e.next;
- }
- if (result == null)
- return null;
- else
- return result.toArray();
- }
-
- /**
- * Waits for all media objects to finish loading, either by completing
- * successfully or by aborting or encountering an error.
- *
- * @throws InterruptedException if another thread interrupted the
- * current thread while waiting
- */
- public void waitForAll() throws InterruptedException
- {
- synchronized (this)
- {
- while (checkAll(true) == false)
- wait();
- }
- }
-
- /**
- * Waits for all media objects to finish loading, either by completing
- * successfully or by aborting or encountering an error.
- *
- * This method waits at most <code>ms</code> milliseconds. If the
- * media objects have not completed loading within this timeframe, this
- * method returns <code>false</code>, otherwise <code>true</code>.
- *
- * @param ms timeframe in milliseconds to wait for the media objects to
- * finish
- *
- * @return <code>true</code> if all media objects have successfully loaded
- * within the timeframe, <code>false</code> otherwise
- *
- * @throws InterruptedException if another thread interrupted the
- * current thread while waiting
- */
- public boolean waitForAll(long ms) throws InterruptedException
- {
- long start = System.currentTimeMillis();
- boolean result = checkAll(true);
- synchronized (this)
- {
- while (result == false)
- {
- wait(ms);
- result = checkAll(true);
- if ((System.currentTimeMillis() - start) > ms)
- break;
- }
- }
-
- return result;
- }
-
- /**
- * Returns the status flags of all registered media objects ORed together.
- * If <code>load</code> is <code>true</code> then media objects that
- * are not already loading will be started to load.
- *
- * @param load if set to <code>true</code> then media objects that are
- * not already loading are started
- *
- * @return the status flags of all tracked media objects ORed together
- */
- public int statusAll(boolean load)
- {
- int result = 0;
- MediaEntry e = head;
- while (e != null)
- {
- if (load && e.status == 0)
- {
- boolean complete = target.prepareImage(e.image, e);
- if (complete)
- e.status = COMPLETE;
- else
- e.status = LOADING;
- }
- result |= e.status;
- e = e.next;
- }
- return result;
- }
-
- /**
- * Checks if the media objects with <code>ID</code> have completed loading.
- *
- * @param id the ID of the media objects to check
- *
- * @return <code>true</code> if all media objects with <code>ID</code>
- * have successfully finished
- */
- public boolean checkID(int id)
- {
- return checkID(id, false);
- }
-
- /**
- * Checks if the media objects with <code>ID</code> have completed loading.
- * If <code>load</code> is <code>true</code> then media objects that
- * are not already loading will be started to load.
- *
- * @param id the ID of the media objects to check
- * @param load if set to <code>true</code> then media objects that are
- * not already loading are started
- *
- * @return <code>true</code> if all media objects with <code>ID</code>
- * have successfully finished
- */
- public boolean checkID(int id, boolean load)
- {
- MediaEntry e = head;
- boolean result = true;
-
- while (e != null)
- {
- if (e.id == id && ((e.status & (COMPLETE | ABORTED | ERRORED)) == 0))
- {
- if (load && ((e.status & LOADING) == 0))
- {
- e.status = LOADING;
- result = false;
- boolean complete = target.prepareImage(e.image, e);
- if (complete)
- {
- e.status = COMPLETE;
- result = true;
- }
- }
- else
- result = false;
- }
- e = e.next;
- }
- return result;
- }
-
- /**
- * Returns <code>true</code> if any of the media objects with <code>ID</code>
- * have encountered errors during loading, false otherwise.
- *
- * @param id the ID of the media objects to check
- *
- * @return <code>true</code> if any of the media objects with <code>ID</code>
- * have encountered errors during loading, false otherwise
- */
- public boolean isErrorID(int id)
- {
- MediaEntry e = head;
- while (e != null)
- {
- if (e.id == id && ((e.status & ERRORED) != 0))
- return true;
- e = e.next;
- }
- return false;
- }
-
- /**
- * Returns all media objects with the specified ID that have encountered
- * an error.
- *
- * @param id the ID of the media objects to check
- *
- * @return an array of all media objects with the specified ID that
- * have encountered an error
- */
- public Object[] getErrorsID(int id)
- {
- MediaEntry e = head;
- ArrayList result = null;
- while (e != null)
- {
- if (e.id == id && ((e.status & ERRORED) != 0))
- {
- if (result == null)
- result = new ArrayList();
- result.add(e.image);
- }
- e = e.next;
- }
- if (result == null)
- return null;
- else
- return result.toArray();
- }
-
- /**
- * Waits for all media objects with the specified ID to finish loading,
- * either by completing successfully or by aborting or encountering an error.
- *
- * @param id the ID of the media objects to wait for
- *
- * @throws InterruptedException if another thread interrupted the
- * current thread while waiting
- */
- public void waitForID(int id) throws InterruptedException
- {
- MediaEntry e = head;
- synchronized (this)
- {
- while (checkID (id, true) == false)
- wait();
- }
- }
-
- /**
- * Waits for all media objects with the specified ID to finish loading,
- * either by completing successfully or by aborting or encountering an error.
- *
- * This method waits at most <code>ms</code> milliseconds. If the
- * media objects have not completed loading within this timeframe, this
- * method returns <code>false</code>, otherwise <code>true</code>.
- *
- * @param id the ID of the media objects to wait for
- * @param ms timeframe in milliseconds to wait for the media objects to
- * finish
- *
- * @return <code>true</code> if all media objects have successfully loaded
- * within the timeframe, <code>false</code> otherwise
- *
- * @throws InterruptedException if another thread interrupted the
- * current thread while waiting
- */
- public boolean waitForID(int id, long ms) throws InterruptedException
- {
- MediaEntry e = head;
- long start = System.currentTimeMillis();
- boolean result = checkID(id, true);
-
- synchronized (this)
- {
- while (result == false)
- {
- wait(ms);
- result = checkID(id, true);
- if ((System.currentTimeMillis() - start) > ms)
- break;
- }
- }
-
- return result;
- }
-
- /**
- * Returns the status flags of the media objects with the specified ID
- * ORed together.
- *
- * If <code>load</code> is <code>true</code> then media objects that
- * are not already loading will be started to load.
- *
- * @param load if set to <code>true</code> then media objects that are
- * not already loading are started
- *
- * @return the status flags of all tracked media objects ORed together
- */
- public int statusID(int id, boolean load)
- {
- int result = 0;
- MediaEntry e = head;
- while (e != null)
- {
- if (e.id == id)
- {
- if (load && e.status == 0)
- {
- boolean complete = target.prepareImage(e.image, e);
- if (complete)
- e.status = COMPLETE;
- else
- e.status = LOADING;
- }
- result |= e.status;
- }
- e = e.next;
- }
- return result;
- }
-
- /**
- * Removes an image from this MediaTracker.
- *
- * @param image the image to be removed
- */
- public void removeImage(Image image)
- {
- synchronized (this)
- {
- MediaEntry e = head;
- MediaEntry prev = null;
- while (e != null)
- {
- if (e.image == image)
- {
- if (prev == null)
- head = e.next;
- else
- prev.next = e.next;
- }
- prev = e;
- e = e.next;
- }
- }
- }
-
- /**
- * Removes an image with the specified ID from this MediaTracker.
- *
- * @param image the image to be removed
- */
- public void removeImage(Image image, int id)
- {
- synchronized (this)
- {
- MediaEntry e = head;
- MediaEntry prev = null;
- while (e != null)
- {
- if (e.id == id && e.image == image)
- {
- if (prev == null)
- head = e.next;
- else
- prev.next = e.next;
- }
- else
- prev = e;
- e = e.next;
- }
- }
- }
-
- /**
- * Removes an image with the specified ID and scale from this MediaTracker.
- *
- * @param image the image to be removed
- */
- public void removeImage(Image image, int id, int width, int height)
- {
- synchronized (this)
- {
- MediaEntry e = head;
- MediaEntry prev = null;
- while (e != null)
- {
- if (e.id == id && e.image == image
- && e.width == width && e.height == height)
- {
- if (prev == null)
- head = e.next;
- else
- prev.next = e.next;
- }
- else
- prev = e;
- e = e.next;
- }
- }
- }
-}
diff --git a/libjava/java/awt/Menu.java b/libjava/java/awt/Menu.java
deleted file mode 100644
index 56ceccfc542..00000000000
--- a/libjava/java/awt/Menu.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/* Menu.java -- A Java AWT Menu
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.peer.MenuPeer;
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * This class represents a pull down or tear off menu in Java's AWT.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Menu extends MenuItem implements MenuContainer, Serializable
-{
-
-/*
- * Static Variables
- */
-
-// Serialization Constant
-private static final long serialVersionUID = -8809584163345499784L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The actual items in the menu
- */
-private Vector items = new Vector();
-
-/**
- * @serial Flag indicating whether or not this menu is a tear off
- */
-private boolean tearOff;
-
-/**
- * @serial Indicates whether or not this is a help menu.
- */
-private boolean isHelpMenu;
-
- /*
- * @serial Unused in this implementation, but present in Sun's
- * serialization spec. Value obtained via reflection.
- */
- private int menuSerializedDataVersion = 1;
-
-static final transient String separatorLabel = "-";
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>Menu</code> with no label and that
- * is not a tearoff;
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-Menu()
-{
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Menu</code> that is not a tearoff and
- * that has the specified label.
- *
- * @param label The menu label.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-Menu(String label)
-{
- this(label, false);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Menu</code> with the specified
- * label and tearoff status.
- *
- * @param label The label for this menu
- * @param isTearOff <code>true</code> if this menu is a tear off menu,
- * <code>false</code> otherwise.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-Menu(String label, boolean isTearOff)
-{
- super(label);
-
- tearOff = isTearOff;
-
- if (label.equals("Help"))
- isHelpMenu = true;
-
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Tests whether or not this menu is a tearoff.
- *
- * @return <code>true</code> if this menu is a tearoff, <code>false</code>
- * otherwise.
- */
-public boolean
-isTearOff()
-{
- return(tearOff);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the number of items in this menu.
- *
- * @return The number of items in this menu.
- */
-public int
-getItemCount()
-{
- return countItems ();
-}
-
-/**
- * Returns the number of items in this menu.
- *
- * @return The number of items in this menu.
- *
- * @deprecated As of JDK 1.1, replaced by getItemCount().
- */
-public int countItems ()
-{
- return items.size ();
-}
-
-/*************************************************************************/
-
-/**
- * Returns the item at the specified index.
- *
- * @return The item at the specified index.
- *
- * @exception ArrayIndexOutOfBoundsException If the index value is not valid.
- */
-public MenuItem
-getItem(int index)
-{
- return((MenuItem)items.elementAt(index));
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified item to this menu. If it was previously part of
- * another menu, it is first removed from that menu.
- *
- * @param item The new item to add.
- *
- * @return The item that was added.
- */
-public MenuItem
-add(MenuItem item)
-{
- items.addElement(item);
- if (item.parent != null)
- {
- item.parent.remove(item);
- }
- item.parent = this;
-
- if (peer != null)
- {
- MenuPeer mp = (MenuPeer) peer;
- mp.addItem(item);
- }
-
- return item;
-}
-
-/*************************************************************************/
-
-/**
- * Add an item with the specified label to this menu.
- *
- * @param label The label of the menu item to add.
- */
-public void
-add(String label)
-{
- add(new MenuItem(label));
-}
-
-/*************************************************************************/
-
-/**
- * Inserts the specified menu item into this menu at the specified index.
- *
- * @param item The menu item to add.
- * @param index The index of the menu item.
- *
- * @exception IllegalArgumentException If the index is less than zero.
- * @exception ArrayIndexOutOfBoundsException If the index is otherwise invalid.
- */
-public void
-insert(MenuItem item, int index)
-{
- if (index < 0)
- throw new IllegalArgumentException("Index is less than zero");
-
- MenuPeer peer = (MenuPeer) getPeer();
- if (peer == null)
- return;
-
- int count = getItemCount ();
-
- if (index >= count)
- peer.addItem (item);
- else
- {
- for (int i = count - 1; i >= index; i--)
- peer.delItem (i);
-
- peer.addItem (item);
-
- for (int i = index; i < count; i++)
- peer.addItem ((MenuItem) items.elementAt (i));
- }
-
- items.insertElementAt(item, index);
-}
-
-/*************************************************************************/
-
-/**
- * Inserts an item with the specified label into this menu at the specified index.
- *
- * @param label The label of the item to add.
- * @param index The index of the menu item.
- *
- * @exception IllegalArgumentException If the index is less than zero.
- * @exception ArrayIndexOutOfBoundsException If the index is otherwise invalid.
- */
-public void
-insert(String label, int index)
-{
- insert(new MenuItem(label), index);
-}
-
-/*************************************************************************/
-
-/**
- * Adds a separator bar at the current menu location.
- */
-public void
-addSeparator()
-{
- add(new MenuItem(separatorLabel));
-}
-
-/*************************************************************************/
-
-/**
- * Inserts a separator bar at the specified index value.
- *
- * @param index The index at which to insert a separator bar.
- *
- * @exception IllegalArgumentException If the index is less than zero.
- * @exception ArrayIndexOutOfBoundsException If the index is otherwise invalid.
- */
-public void
-insertSeparator(int index)
-{
- insert(new MenuItem(separatorLabel), index);
-}
-
-/*************************************************************************/
-
-/**
- * Deletes the item at the specified index from this menu.
- *
- * @param index The index of the item to remove.
- *
- * @exception ArrayIndexOutOfBoundsException If the index is otherwise invalid.
- */
-public synchronized void
-remove(int index)
-{
- items.removeElementAt(index);
-
- MenuPeer mp = (MenuPeer)getPeer();
- if (mp != null)
- mp.delItem(index);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specifed item from the menu. If the specified component
- * does not exist, this method does nothing.
- *
- * @param item The component to remove.
- */
-public void
-remove(MenuComponent item)
-{
- int index = items.indexOf(item);
- if (index == -1)
- return;
-
- remove(index);
-}
-
-/*************************************************************************/
-
-/**
- * Removes all the elements from this menu.
- */
-public synchronized void
-removeAll()
-{
- int count = getItemCount();
- for(int i = 0; i < count; i++)
- {
- // We must always remove item 0.
- remove(0);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Creates the native peer for this object.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit().createMenu(this);
- Enumeration e = items.elements();
- while (e.hasMoreElements())
- {
- MenuItem mi = (MenuItem)e.nextElement();
- mi.addNotify();
- }
- super.addNotify ();
-}
-
-/*************************************************************************/
-
-/**
- * Destroys the native peer for this object.
- */
-public void
-removeNotify()
-{
- Enumeration e = items.elements();
- while (e.hasMoreElements())
- {
- MenuItem mi = (MenuItem) e.nextElement();
- mi.removeNotify();
- }
- super.removeNotify();
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this menu.
- *
- * @return A debugging string for this menu.
- */
-public String
-paramString()
-{
- return (",tearOff=" + tearOff + ",isHelpMenu=" + isHelpMenu
- + super.paramString());
-}
-
- /**
- * Basic Accessibility class for Menu. Details get provided in derived
- * classes.
- */
- protected class AccessibleAWTMenu extends AccessibleAWTMenuItem
- {
- protected AccessibleAWTMenu()
- {
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.MENU;
- }
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>Menu</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTMenu();
- return accessibleContext;
- }
-
-} // class Menu
diff --git a/libjava/java/awt/MenuBar.java b/libjava/java/awt/MenuBar.java
deleted file mode 100644
index 4089fe189e0..00000000000
--- a/libjava/java/awt/MenuBar.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/* MenuBar.java -- An AWT menu bar class
- Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.peer.MenuBarPeer;
-import java.awt.peer.MenuComponentPeer;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * This class implements a menu bar in the AWT system.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@redhat.com)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- */
-public class MenuBar extends MenuComponent
- implements MenuContainer, Serializable, Accessible
-{
-
-/*
- * Static Variables
- */
-
-// Serialization Constant
-private static final long serialVersionUID = -4930327919388951260L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The menu used for providing help information
- */
-private Menu helpMenu;
-
-/**
- * @serial The menus contained in this menu bar.
- */
-private Vector menus = new Vector();
-
- /**
- * The accessible context for this component.
- *
- * @see #getAccessibleContext()
- * @serial ignored.
- */
- private transient AccessibleContext accessibleContext;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>MenuBar</code>.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-MenuBar()
-{
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the help menu for this menu bar. This may be <code>null</code>.
- *
- * @return The help menu for this menu bar.
- */
-public Menu
-getHelpMenu()
-{
- return(helpMenu);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the help menu for this menu bar.
- *
- * @param menu The new help menu for this menu bar.
- */
-public synchronized void
-setHelpMenu(Menu menu)
-{
- if (helpMenu != null)
- {
- helpMenu.removeNotify ();
- helpMenu.parent = null;
- }
- helpMenu = menu;
-
- if (menu.parent != null)
- menu.parent.remove (menu);
- menu.parent = this;
-
- MenuBarPeer peer = (MenuBarPeer) getPeer ();
- if (peer != null)
- {
- menu.addNotify();
- peer.addHelpMenu (menu);
- }
-}
-
-/*************************************************************************/
-
-/** Add a menu to this MenuBar. If the menu has already has a
- * parent, it is first removed from its old parent before being
- * added.
- *
- * @param menu The menu to add.
- *
- * @return The menu that was added.
- */
-public synchronized Menu
-add(Menu menu)
-{
- if (menu.parent != null)
- menu.parent.remove (menu);
-
- menu.parent = this;
- menus.addElement(menu);
-
- if (peer != null)
- {
- menu.addNotify();
- }
-
- return(menu);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the menu at the specified index.
- *
- * @param index The index of the menu to remove from the menu bar.
- */
-public synchronized void
-remove(int index)
-{
- Menu m = (Menu) menus.get (index);
- menus.remove (index);
- m.removeNotify ();
- m.parent = null;
-
- if (peer != null)
- {
- MenuBarPeer mp = (MenuBarPeer) peer;
- mp.delMenu (index);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified menu from the menu bar.
- *
- * @param menu The menu to remove from the menu bar.
- */
-public void
-remove(MenuComponent menu)
-{
- int index = menus.indexOf(menu);
- if (index == -1)
- return;
-
- remove(index);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the number of elements in this menu bar.
- *
- * @return The number of elements in the menu bar.
- */
-public int
-getMenuCount()
-{
- return countMenus ();
-}
-
-/*************************************************************************/
-
-/**
- * Returns the number of elements in this menu bar.
- *
- * @return The number of elements in the menu bar.
- *
- * @deprecated This method is deprecated in favor of <code>getMenuCount()</code>.
- */
-public int
-countMenus()
-{
- return menus.size () + (getHelpMenu () == null ? 0 : 1);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the menu at the specified index.
- *
- * @param index the index of the menu
- *
- * @return The requested menu.
- *
- * @exception ArrayIndexOutOfBoundsException If the index is not valid.
- */
-public Menu
-getMenu(int index)
-{
- return((Menu)menus.elementAt(index));
-}
-
-/*************************************************************************/
-
-/**
- * Creates this object's native peer.
- */
-public void
-addNotify()
-{
- if (getPeer() == null)
- setPeer((MenuComponentPeer)getToolkit().createMenuBar(this));
- Enumeration e = menus.elements();
- while (e.hasMoreElements())
- {
- Menu mi = (Menu)e.nextElement();
- mi.addNotify();
- }
- if (helpMenu != null)
- {
- helpMenu.addNotify();
- ((MenuBarPeer) peer).addHelpMenu(helpMenu);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Destroys this object's native peer.
- */
-public void
-removeNotify()
-{
- Enumeration e = menus.elements();
- while (e.hasMoreElements())
- {
- Menu mi = (Menu) e.nextElement();
- mi.removeNotify();
- }
- super.removeNotify();
-}
-
-/*************************************************************************/
-
-/**
- * Returns a list of all shortcuts for the menus in this menu bar.
- *
- * @return A list of all shortcuts for the menus in this menu bar.
- */
-public synchronized Enumeration
-shortcuts()
-{
- Vector shortcuts = new Vector();
- Enumeration e = menus.elements();
-
- while (e.hasMoreElements())
- {
- Menu menu = (Menu)e.nextElement();
- if (menu.getShortcut() != null)
- shortcuts.addElement(menu.getShortcut());
- }
-
- return(shortcuts.elements());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the menu item for the specified shortcut, or <code>null</code>
- * if no such item exists.
- *
- * @param shortcut The shortcut to return the menu item for.
- *
- * @return The menu item for the specified shortcut.
- */
-public MenuItem
-getShortcutMenuItem(MenuShortcut shortcut)
-{
- Enumeration e = menus.elements();
-
- while (e.hasMoreElements())
- {
- Menu menu = (Menu)e.nextElement();
- MenuShortcut s = menu.getShortcut();
- if ((s != null) && (s.equals(shortcut)))
- return(menu);
- }
-
- return(null);
-}
-
-/*************************************************************************/
-
-/**
- * Deletes the specified menu shortcut.
- *
- * @param shortcut The shortcut to delete.
- */
-public void
-deleteShortcut(MenuShortcut shortcut)
-{
- MenuItem it;
- // This is a slow implementation, but it probably doesn't matter.
- while ((it = getShortcutMenuItem (shortcut)) != null)
- it.deleteShortcut ();
-}
-
-/**
- * Gets the AccessibleContext associated with this <code>MenuBar</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
-public AccessibleContext getAccessibleContext()
-{
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTMenuBar();
- return accessibleContext;
-}
-
-/**
- * This class provides accessibility support for AWT menu bars.
- *
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- */
-protected class AccessibleAWTMenuBar
- extends AccessibleAWTMenuComponent
-{
-
- /**
- * Compatible with JDK 1.4.2 revision 5
- */
- private static final long serialVersionUID = -8577604491830083815L;
-
- /**
- * This is the default constructor, which simply calls the default
- * constructor of the superclass.
- */
- protected AccessibleAWTMenuBar()
- {
- super();
- }
-
- /**
- * Returns the accessible role relating to the menu bar.
- *
- * @return <code>AccessibleRole.MENU_BAR</code>.
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.MENU_BAR;
- }
-
-} // class AccessibleAWTMenuBar
-
-} // class MenuBar
diff --git a/libjava/java/awt/MenuComponent.java b/libjava/java/awt/MenuComponent.java
deleted file mode 100644
index ec6980e10ca..00000000000
--- a/libjava/java/awt/MenuComponent.java
+++ /dev/null
@@ -1,1324 +0,0 @@
-/* MenuComponent.java -- Superclass of all AWT menu components
- Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.peer.MenuComponentPeer;
-import java.io.Serializable;
-import java.util.Locale;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleComponent;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleSelection;
-import javax.accessibility.AccessibleStateSet;
-
-/**
- * This is the superclass of all menu AWT widgets.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- */
-public abstract class MenuComponent implements Serializable
-{
-
-/*
- * Static Variables
- */
-
-// Serialization Constant
-private static final long serialVersionUID = -4536902356223894379L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * The font for this component.
- *
- * @see #getFont()
- * @see #setFont(java.awt.Font)
- * @serial the component's font.
- */
- private Font font;
-
- /**
- * The name of the component.
- *
- * @see #getName()
- * @see #setName(String)
- * @serial the component's name.
- */
- private String name;
-
- /**
- * The parent of this component.
- *
- * @see #getParent()
- * @see #setParent(java.awt.MenuContainer)
- * @serial ignored.
- */
- transient MenuContainer parent;
-
- /**
- * The native peer for this component.
- *
- * @see #getPeer()
- * @see #setPeer(java.awt.peer.MenuComponentPeer)
- * @serial ignored.
- */
- transient MenuComponentPeer peer;
-
- /**
- * The synchronization locking object for this component.
- *
- * @serial ignored.
- */
- private transient Object tree_lock = this;
-
- /**
- * The toolkit for this object.
- *
- * @see #getToolkit()
- * @serial ignored.
- */
- private static transient Toolkit toolkit = Toolkit.getDefaultToolkit();
-
- /**
- * The accessible context for this component.
- *
- * @see #getAccessibleContext()
- * @serial the accessibility information for this component.
- */
- AccessibleContext accessibleContext;
-
- /**
- * Was the name of the component set? This value defaults
- * to false and becomes true after a call to <code>setName()</code>.
- * Please note that this does not guarantee that name will then
- * be non-null, as this may be the value passed to <code>setName()</code>.
- *
- * @see #setName(String)
- * @serial true if the name value has been explicitly set by calling
- * <code>setName()</code>.
- */
- private boolean nameExplicitlySet;
-
- /**
- * Does this component handle new events? Events will be handled
- * by this component if this is true. Otherwise, they will be forwarded
- * up the component hierarchy. This implementation does not use this
- * variable; it is merely provided for serialization compatability.
- *
- * @see #dispatchEvent(AWTEvent)
- * @serial true if events are to be processed locally. Unused.
- */
- private boolean newEventsOnly;
-
- /**
- * The focus listener chain handler which deals with focus events for
- * the accessible context of this component.
- *
- * @see AccessibleAWTMenuComponent#addFocusListener(java.awt.event.FocusListener)
- * @serial ignored.
- * This is package-private to avoid an accessor method.
- */
- transient FocusListener focusListener;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Default constructor for subclasses.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-MenuComponent()
-{
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the font in use for this component.
- *
- * @return The font for this component.
- */
-public Font
-getFont()
-{
- if (font != null)
- return font;
-
- if (parent != null)
- return parent.getFont ();
-
- return null;
-}
-
-/*************************************************************************/
-
-/**
- * Sets the font for this component to the specified font.
- *
- * @param font The new font for this component.
- */
-public void
-setFont(Font font)
-{
- this.font = font;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the name of this component.
- *
- * @return The name of this component.
- */
-public String
-getName()
-{
- return(name);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the name of this component to the specified name.
- *
- * @param name The new name of this component.
- */
-public void
-setName(String name)
-{
- this.name = name;
- nameExplicitlySet = true;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the parent of this component.
- *
- * @return The parent of this component.
- */
-public MenuContainer
-getParent()
-{
- return(parent);
-}
-
-/*************************************************************************/
-
-// Sets the parent of this component.
-final void
-setParent(MenuContainer parent)
-{
- this.parent = parent;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the native windowing system peer for this component.
- *
- * @return The peer for this component.
- *
- * @deprecated
- */
-public MenuComponentPeer
-getPeer()
-{
- return(peer);
-}
-
-/*************************************************************************/
-
-// Sets the peer for this component.
-final void
-setPeer(MenuComponentPeer peer)
-{
- this.peer = peer;
-}
-
-/*************************************************************************/
-
-/**
- * Destroys this component's native peer
- */
-public void
-removeNotify()
-{
- if (peer != null)
- peer.dispose();
- peer = null;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the toolkit in use for this component.
- *
- * @return The toolkit for this component.
- */
-final Toolkit
-getToolkit()
-{
- return(toolkit);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the object used for synchronization locks on this component
- * when performing tree and layout functions.
- *
- * @return The synchronization lock for this component.
- */
-protected final Object
-getTreeLock()
-{
- return(tree_lock);
-}
-
-/*************************************************************************/
-
-// The sync lock object for this component.
-final void
-setTreeLock(Object tree_lock)
-{
- this.tree_lock = tree_lock;
-}
-
-/*************************************************************************/
-
-/**
- * AWT 1.0 event dispatcher.
- *
- * @deprecated Deprecated in favor of <code>dispatchEvent()</code>.
- * @return true if the event was dispatched, false otherwise.
- */
-public boolean
-postEvent(Event event)
-{
- // This is overridden by subclasses that support events.
- return false;
-}
-/*************************************************************************/
-
-/**
- * Sends this event to this component or a subcomponent for processing.
- *
- * @param event The event to dispatch
- */
-public final void dispatchEvent(AWTEvent event)
-{
- // See comment in Component.dispatchEvent().
- dispatchEventImpl(event);
-}
-
-
-/**
- * Implementation of dispatchEvent. Allows trusted package classes
- * to dispatch additional events first. This implementation first
- * translates <code>event</code> to an AWT 1.0 event and sends the
- * result to {@link #postEvent}. The event is then
- * passed on to {@link #processEvent} for local processing.
- *
- * @param event the event to dispatch.
- */
-void dispatchEventImpl(AWTEvent event)
-{
- Event oldStyleEvent;
-
- // This is overridden by subclasses that support events.
- /* Convert AWT 1.1 event to AWT 1.0 event */
- oldStyleEvent = Component.translateEvent(event);
- if (oldStyleEvent != null)
- {
- postEvent(oldStyleEvent);
- }
- /* Do local processing */
- processEvent(event);
-}
-
-/*************************************************************************/
-
-/**
- * Processes the specified event. In this class, this method simply
- * calls one of the more specific event handlers.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- /*
- Pass a focus event to the focus listener for
- the accessibility context.
- */
- if (event instanceof FocusEvent)
- {
- if (focusListener != null)
- {
- switch (event.id)
- {
- case FocusEvent.FOCUS_GAINED:
- focusListener.focusGained((FocusEvent) event);
- break;
- case FocusEvent.FOCUS_LOST:
- focusListener.focusLost((FocusEvent) event);
- break;
- }
- }
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns a string representation of this component.
- *
- * @return A string representation of this component
- */
-public String
-toString()
-{
- return this.getClass().getName() + "[" + paramString() + "]";
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this component
- */
-protected String
-paramString()
-{
- return "name=" + getName();
-}
-
-/**
- * Gets the AccessibleContext associated with this <code>MenuComponent</code>.
- * As an abstract class, we return null. Concrete subclasses should return
- * their implementation of the accessibility context.
- *
- * @return null.
- */
-
-public AccessibleContext getAccessibleContext()
-{
- return null;
-}
-
-/**
- * This class provides a base for the accessibility support of menu
- * components.
- *
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- */
-protected abstract class AccessibleAWTMenuComponent
- extends AccessibleContext
- implements Serializable, AccessibleComponent, AccessibleSelection
-{
-
- /**
- * Compatible with JDK 1.4.2 revision 5
- */
- private static final long serialVersionUID = -4269533416223798698L;
-
- /**
- * This is the default constructor. It should be called by
- * concrete subclasses to ensure necessary groundwork is completed.
- */
- protected AccessibleAWTMenuComponent()
- {
- }
-
- /**
- * Replaces or supplements the component's selection with the
- * <code>Accessible</code> child at the supplied index. If
- * the component supports multiple selection, the child is
- * added to the current selection. Otherwise, the current
- * selection becomes the specified child. If the child is
- * already selected, nothing happens.
- * <br />
- * <br />
- * As the existence of children can not be determined from
- * this abstract class, the implementation of this method
- * is left to subclasses.
- *
- * @param index the index of the specified child within a
- * zero-based list of the component's children.
- */
- public void addAccessibleSelection(int index)
- {
- /* Subclasses with children should implement this */
- }
-
- /**
- * Registers the specified focus listener to receive
- * focus events from this component.
- *
- * @param listener the new focus listener.
- */
- public void addFocusListener(FocusListener listener)
- {
- /*
- * Chain the new focus listener to the existing chain
- * of focus listeners. Each new focus listener is
- * coupled via multicasting to the existing chain.
- */
- focusListener = AWTEventMulticaster.add(focusListener, listener);
- }
-
- /**
- * Clears the component's current selection. Following
- * the calling of this method, no children of the component
- * will be selected.
- * <br />
- * <br />
- * As the existence of children can not be determined from
- * this abstract class, the implementation of this method
- * is left to subclasses.
- */
- public void clearAccessibleSelection()
- {
- }
-
- /**
- * Returns true if the specified point lies within the
- * component. The supplied co-ordinates are assumed to
- * be relative to the co-ordinate system of the component
- * itself. Thus, the point (0,0) is the upper left corner
- * of this component.
- * <br />
- * <br />
- * Please note that this method depends on a correctly implemented
- * version of the <code>getBounds()</code> method. Subclasses
- * must provide the bounding rectangle via <code>getBounds()</code>
- * in order for this method to work.
- *
- * @param point the point to check against this component.
- * @return true if the point is within this component.
- * @see #getBounds()
- */
- public boolean contains(Point point)
- {
- /*
- We can simply return the result of a
- test for containment in the bounding rectangle
- */
- return getBounds().contains(point);
- }
-
- /**
- * Returns the <code>Accessible</code> child of this component present
- * at the specified point. The supplied co-ordinates are
- * assumed to be relative to the co-ordinate system of this
- * component (the parent of any returned accessible). Thus,
- * the point (0,0) is the upper left corner of this menu
- * component.
- * <br />
- * <br />
- * As the existence of children can not be determined from
- * this abstract class, the implementation of this method
- * is left to subclasses.
- *
- * @param point the point at which the returned accessible
- * is located.
- * @return null.
- */
- public Accessible getAccessibleAt(Point point)
- {
- return null;
- }
-
- /**
- * Returns the <code>Accessible</code> child at the supplied
- * index within the list of children of this component.
- * <br />
- * <br />
- * As the existence of children can not be determined from
- * this abstract class, the implementation of this method
- * is left to subclasses.
- *
- * @param index the index of the <code>Accessible</code> child
- * to retrieve.
- * @return null.
- */
- public Accessible getAccessibleChild(int index)
- {
- return null;
- }
-
- /**
- * Returns the number of children of this component which
- * implement the <code>Accessible</code> interface. If
- * all children of this component are accessible, then
- * the returned value will be the same as the number of
- * children.
- * <br />
- * <br />
- *
- * @return 0.
- */
- public int getAccessibleChildrenCount()
- {
- return 0;
- }
-
- /**
- * Retrieves the <code>AccessibleComponent</code> associated
- * with this accessible context and its component. As the
- * context itself implements <code>AccessibleComponent</code>,
- * this is the return value.
- *
- * @return the context itself.
- */
- public AccessibleComponent getAccessibleComponent()
- {
- return this;
- }
-
- /**
- * Returns the accessible name for this menu component. This
- * is the name given to the component, which may be null if
- * not set using <code>setName()</code>.
- * <br />
- * <br />
- * The name is not the most appropriate description of this
- * object. Subclasses should preferably provide a more
- * accurate description. For example, a File menu could
- * have the description `Lists commands related to the
- * file system'.
- *
- * @return a description of the component. Currently,
- * this is just the contents of the name property.
- * @see MenuComponent#setName(String)
- */
- public String getAccessibleDescription()
- {
- return MenuComponent.this.getName();
- }
-
- /**
- * Retrieves the index of this component within its parent.
- * If no parent exists, -1 is returned.
- *
- * @return -1 as the parent, a <code>MenuContainer</code>
- * is not <code>Accessible</code>.
- */
- public int getAccessibleIndexInParent()
- {
- return -1;
- }
-
- /**
- * Returns the accessible name of this component. This
- * is the name given to the component, which may be null if
- * not set using <code>setName()</code>.
- * <br />
- * <br />
- * The name property is not the most suitable string to return
- * for this method. The string should be localized, and
- * relevant to the operation of the component. For example,
- * it could be the text of a menu item. However, this can
- * not be used at this level of abstraction, so it is the
- * responsibility of subclasses to provide a more appropriate
- * name.
- *
- * @return a localized name for this component. Currently, this
- * is just the contents of the name property.
- * @see MenuComponent#setName(String)
- */
- public String getAccessibleName()
- {
- return MenuComponent.this.getName();
- }
-
- /**
- * Returns the <code>Accessible</code> parent of this component.
- * As the parent of a <code>MenuComponent</code> is a
- * <code>MenuContainer</code>, which doesn't implement
- * <code>Accessible</code>, this method returns null.
- *
- * @return null.
- */
- public Accessible getAccessibleParent()
- {
- return null;
- }
-
- /**
- * Returns the accessible role of this component.
- * <br />
- * <br />
- * The abstract implementation of this method returns
- * <code>AccessibleRole.AWT_COMPONENT</code>,
- * as the abstract component has no specific role. This
- * method should be overridden by concrete subclasses, so
- * as to return an appropriate role for the component.
- *
- * @return <code>AccessibleRole.AWT_COMPONENT</code>.
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.AWT_COMPONENT;
- }
-
- /**
- * Retrieves the <code>AccessibleSelection</code> associated
- * with this accessible context and its component. As the
- * context itself implements <code>AccessibleSelection</code>,
- * this is the return value.
- *
- * @return the context itself.
- */
- public AccessibleSelection getAccessibleSelection()
- {
- return this;
- }
-
- /**
- * Retrieves the <code>Accessible</code> selected child
- * at the specified index. If there are no selected children
- * or the index is outside the range of selected children,
- * null is returned. Please note that the index refers
- * to the index of the child in the list of <strong>selected
- * children</strong>, and not the index of the child in
- * the list of all <code>Accessible</code> children.
- * <br />
- * <br />
- * As the existence of children can not be determined from
- * this abstract class, the implementation of this method
- * is left to subclasses.
- *
- * @param index the index of the selected <code>Accessible</code>
- * child.
- */
- public Accessible getAccessibleSelection(int index)
- {
- return null;
- }
-
- /**
- * Returns a count of the number of <code>Accessible</code>
- * children of this component which are currently selected.
- * If there are no children currently selected, 0 is returned.
- * <br />
- * <br />
- * As the existence of children can not be determined from
- * this abstract class, the implementation of this method
- * is left to subclasses.
- *
- * @return 0.
- */
- public int getAccessibleSelectionCount()
- {
- return 0;
- }
-
- /**
- * Retrieves the current state of this component
- * in an accessible form. For example, a given component
- * may be visible, selected, disabled, etc.
- * <br />
- * <br />
- * As this class tells us virtually nothing about the component,
- * except for its name and font, no state information can be
- * provided. This implementation thus returns an empty
- * state set, and it is left to concrete subclasses to provide
- * a more acceptable and relevant state set. Changes to these
- * properties also need to be handled using
- * <code>PropertyChangeListener</code>s.
- *
- * @return an empty <code>AccessibleStateSet</code>.
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- return new AccessibleStateSet();
- }
-
- /**
- * Returns the background color of the component, or null
- * if this property is unsupported.
- * <br />
- * <br />
- * This abstract class knows nothing about how the component
- * is drawn on screen, so this method simply returns the
- * default system background color used for rendering menus.
- * Concrete subclasses which handle the drawing of an onscreen
- * menu component should override this method and provide
- * the appropriate information.
- *
- * @return the default system background color for menus.
- * @see #setBackground(java.awt.Color)
- */
- public Color getBackground()
- {
- return SystemColor.menu;
- }
-
- /**
- * Returns a <code>Rectangle</code> which represents the
- * bounds of this component. The returned rectangle has the
- * height and width of the component's bounds, and is positioned
- * at a location relative to this component's parent, the
- * <code>MenuContainer</code>. null is returned if bounds
- * are not supported by the component.
- * <br />
- * <br />
- * This abstract class knows nothing about how the component
- * is drawn on screen, so this method simply returns null.
- * Concrete subclasses which handle the drawing of an onscreen
- * menu component should override this method and provide
- * the appropriate information.
- *
- * @return null.
- * @see #setBounds(java.awt.Rectangle)
- */
- public Rectangle getBounds()
- {
- return null;
- }
-
- /**
- * Returns the <code>Cursor</code> displayed when the pointer
- * is positioned over this component. Alternatively, null
- * is returned if the component doesn't support the cursor
- * property.
- * <br />
- * <br />
- * This abstract class knows nothing about how the component
- * is drawn on screen, so this method simply returns the default
- * system cursor. Concrete subclasses which handle the drawing
- * of an onscreen menu component may override this method and provide
- * the appropriate information.
- *
- * @return the default system cursor.
- * @see #setCursor(java.awt.Cursor)
- */
- public Cursor getCursor()
- {
- return Cursor.getDefaultCursor();
- }
-
- /**
- * Returns the <code>Font</code> used for text created by this component.
- *
- * @return the current font.
- * @see #setFont(java.awt.Font)
- */
- public Font getFont()
- {
- return MenuComponent.this.getFont();
- }
-
- /**
- * Retrieves information on the rendering and metrics of the supplied
- * font. If font metrics are not supported by this component, null
- * is returned.
- * <br />
- * <br />
- * The abstract implementation of this method simply uses the toolkit
- * to obtain the <code>FontMetrics</code>. Concrete subclasses may
- * find it more efficient to invoke their peer class directly, if one
- * is available.
- *
- * @param font the font about which to retrieve rendering and metric
- * information.
- * @return the metrics of the given font, as provided by the system
- * toolkit.
- * @throws NullPointerException if the supplied font was null.
- */
- public FontMetrics getFontMetrics(Font font)
- {
- return MenuComponent.this.getToolkit().getFontMetrics(font);
- }
-
- /**
- * Returns the foreground color of the component, or null
- * if this property is unsupported.
- * <br />
- * <br />
- * This abstract class knows nothing about how the component
- * is drawn on screen, so this method simply returns the
- * default system text color used for rendering menus.
- * Concrete subclasses which handle the drawing of an onscreen
- * menu component should override this method and provide
- * the appropriate information.
- *
- * @return the default system text color for menus.
- * @see #setForeground(java.awt.Color)
- */
- public Color getForeground()
- {
- return SystemColor.menuText;
- }
-
- /**
- * Returns the locale currently in use by this component.
- * <br />
- * <br />
- * This abstract class has no property relating to the
- * locale used by the component, so this method simply
- * returns the default locale for the current instance
- * of the Java Virtual Machine (JVM). Concrete subclasses
- * which maintain such a property should override this method
- * and provide the locale information more accurately.
- *
- * @return the default locale for this JVM instance.
- */
- public Locale getLocale()
- {
- return Locale.getDefault();
- }
-
- /**
- * Returns the location of the component, with co-ordinates
- * relative to the parent component and using the co-ordinate
- * space of the screen. Thus, the point (0,0) is the upper
- * left corner of the parent component.
- * <br />
- * <br />
- * Please note that this method depends on a correctly implemented
- * version of the <code>getBounds()</code> method. Subclasses
- * must provide the bounding rectangle via <code>getBounds()</code>
- * in order for this method to work.
- *
- * @return the location of the component, relative to its parent.
- * @see #setLocation(java.awt.Point)
- */
- public Point getLocation()
- {
- /* Simply return the location of the bounding rectangle */
- return getBounds().getLocation();
- }
-
- /**
- * Returns the location of the component, with co-ordinates
- * relative to the screen. Thus, the point (0,0) is the upper
- * left corner of the screen. null is returned if the component
- * is either not on screen or if this property is unsupported.
- * <br />
- * <br />
- * This abstract class knows nothing about how the component
- * is drawn on screen, so this method simply returns null.
- * Concrete subclasses which handle the drawing of an onscreen
- * menu component should override this method and provide
- * the appropriate information.
- *
- * @return the location of the component, relative to the screen.
- */
- public Point getLocationOnScreen()
- {
- return null;
- }
-
- /**
- * Returns the size of the component.
- * <br />
- * <br />
- * Please note that this method depends on a correctly implemented
- * version of the <code>getBounds()</code> method. Subclasses
- * must provide the bounding rectangle via <code>getBounds()</code>
- * in order for this method to work.
- *
- * @return the size of the component.
- * @see #setSize(java.awt.Dimension)
- */
- public Dimension getSize()
- {
- /* Simply return the size of the bounding rectangle */
- return getBounds().getSize();
- }
-
- /**
- * Returns true if the accessible child specified by the supplied index
- * is currently selected.
- * <br />
- * <br />
- * As the existence of children can not be determined from
- * this abstract class, the implementation of this method
- * is left to subclasses.
- *
- * @param index the index of the accessible child to check for selection.
- * @return false.
- */
- public boolean isAccessibleChildSelected(int index)
- {
- return false;
- }
-
- /**
- * Returns true if this component is currently enabled.
- * <br />
- * <br />
- * As this abstract component has no properties related to
- * its enabled or disabled state, the implementation of this
- * method is left to subclasses.
- *
- * @return false.
- * @see #setEnabled(boolean)
- */
- public boolean isEnabled()
- {
- return false;
- }
-
- /**
- * Returns true if this component is included in the traversal
- * of the current focus from one component to the other.
- * <br />
- * <br />
- * As this abstract component has no properties related to
- * its ability to accept the focus, the implementation of this
- * method is left to subclasses.
- *
- * @return false.
- */
- public boolean isFocusTraversable()
- {
- return false;
- }
-
- /**
- * Returns true if the component is being shown on screen.
- * A component is determined to be shown if it is visible,
- * and each parent component is also visible. Please note
- * that, even when a component is showing, it may still be
- * obscured by other components in front. This method only
- * determines if the component is being drawn on the screen.
- * <br />
- * <br />
- * As this abstract component and its parent have no properties
- * relating to visibility, the implementation of this method is
- * left to subclasses.
- *
- * @return false.
- * @see #isVisible()
- */
- public boolean isShowing()
- {
- return false;
- }
-
- /**
- * Returns true if the component is visible. A component may
- * be visible but not drawn on the screen if one of its parent
- * components is not visible. To determine if the component is
- * actually drawn on screen, <code>isShowing()</code> should be
- * used.
- * <br />
- * <br />
- * As this abstract component has no properties relating to its
- * visibility, the implementation of this method is left to subclasses.
- *
- * @return false.
- * @see #isShowing()
- * @see #setVisible(boolean)
- */
- public boolean isVisible()
- {
- return false;
- }
-
- /**
- * Removes the accessible child specified by the supplied index from
- * the list of currently selected children. If the child specified
- * is not selected, nothing happens.
- * <br />
- * <br />
- * As the existence of children can not be determined from
- * this abstract class, the implementation of this method
- * is left to subclasses.
- *
- * @param index the index of the <code>Accessible</code> child.
- */
- public void removeAccessibleSelection(int index)
- {
- /* Subclasses with children should implement this */
- }
-
- /**
- * Removes the specified focus listener from the list of registered
- * focus listeners for this component.
- *
- * @param listener the listener to remove.
- */
- public void removeFocusListener(FocusListener listener)
- {
- /* Remove the focus listener from the chain */
- focusListener = AWTEventMulticaster.remove(focusListener, listener);
- }
-
- /**
- * Requests that this component gains focus. This depends on the
- * component being focus traversable.
- * <br />
- * <br />
- * As this abstract component has no properties relating to its
- * focus traversability, or access to a peer with request focusing
- * abilities, the implementation of this method is left to subclasses.
- */
- public void requestFocus()
- {
- /* Ignored */
- }
-
- /**
- * Selects all <code>Accessible</code> children of this component which
- * it is possible to select. The component needs to support multiple
- * selections.
- * <br />
- * <br />
- * This abstract component provides a simplistic implementation of this
- * method, which ignores the ability of the component to support multiple
- * selections and simply uses <code>addAccessibleSelection</code> to
- * add each <code>Accessible</code> child to the selection. The last
- * <code>Accessible</code> component is thus selected for components
- * which don't support multiple selections. Concrete implementations should
- * override this with a more appopriate and efficient implementation, which
- * properly takes into account the ability of the component to support multiple
- * selections.
- */
- public void selectAllAccessibleSelection()
- {
- /* Simply call addAccessibleSelection() on all accessible children */
- for (int a = 0; a < getAccessibleChildrenCount(); ++a)
- {
- addAccessibleSelection(a);
- }
- }
-
- /**
- * Sets the background color of the component to that specified.
- * Unspecified behaviour occurs when null is given as the new
- * background color.
- * <br />
- * <br />
- * This abstract class knows nothing about how the component
- * is drawn on screen, so this method simply ignores the supplied
- * color and continues to use the default system color.
- * Concrete subclasses which handle the drawing of an onscreen
- * menu component should override this method and provide
- * the appropriate information.
- *
- * @param color the new color to use for the background.
- * @see getBackground()
- */
- public void setBackground(Color color)
- {
- /* Ignored */
- }
-
- /**
- * Sets the height and width of the component, and its position
- * relative to this component's parent, to the values specified
- * by the supplied rectangle. Unspecified behaviour occurs when
- * null is given as the new bounds.
- * <br />
- * <br />
- * This abstract class knows nothing about how the component
- * is drawn on screen, so this method simply ignores the new
- * rectangle and continues to return null from <code>getBounds()</code>.
- * Concrete subclasses which handle the drawing of an onscreen
- * menu component should override this method and provide
- * the appropriate information.
- *
- * @param rectangle a rectangle which specifies the new bounds of
- * the component.
- * @see #getBounds()
- */
- public void setBounds(Rectangle rectangle)
- {
- /* Ignored */
- }
-
- /**
- * Sets the <code>Cursor</code> used when the pointer is positioned over the
- * component. Unspecified behaviour occurs when null is given as the new
- * cursor.
- * <br />
- * <br />
- * This abstract class knows nothing about how the component
- * is drawn on screen, so this method simply ignores the new cursor
- * and continues to return the default system cursor. Concrete
- * subclasses which handle the drawing of an onscreen menu component
- * may override this method and provide the appropriate information.
- *
- * @param cursor the new cursor to use.
- * @see #getCursor()
- */
- public void setCursor(Cursor cursor)
- {
- /* Ignored */
- }
-
- /**
- * Sets the enabled/disabled state of this component.
- * <br />
- * <br />
- * As this abstract component has no properties related to
- * its enabled or disabled state, the implementation of this
- * method is left to subclasses.
- *
- * @param enabled true if the component should be enabled,
- * false otherwise.
- * @see #getEnabled()
- */
- public void setEnabled(boolean enabled)
- {
- /* Ignored */
- }
-
- /**
- * Sets the <code>Font</code> used for text created by this component.
- * Unspecified behaviour occurs when null is given as the new
- * font.
- *
- * @param font the new font to use for text.
- * @see #getFont()
- */
- public void setFont(Font font)
- {
- /* Call the method of the enclosing component */
- MenuComponent.this.setFont(font);
- }
-
- /**
- * Sets the foreground color of the component to that specified.
- * Unspecified behaviour occurs when null is given as the new
- * background color.
- * <br />
- * <br />
- * This abstract class knows nothing about how the component
- * is drawn on screen, so this method simply ignores the supplied
- * color and continues to return the default system text color used
- * for rendering menus.
- * Concrete subclasses which handle the drawing of an onscreen
- * menu component should override this method and provide
- * the appropriate information.
- *
- * @param color the new foreground color.
- * @see #getForeground()
- */
- public void setForeground(Color color)
- {
- /* Ignored */
- }
-
- /**
- * Sets the location of the component, with co-ordinates
- * relative to the parent component and using the co-ordinate
- * space of the screen. Thus, the point (0,0) is the upper
- * left corner of the parent component.
- * <br />
- * <br />
- * Please note that this method depends on a correctly implemented
- * version of the <code>getBounds()</code> method. Subclasses
- * must provide the bounding rectangle via <code>getBounds()</code>
- * in order for this method to work.
- *
- * @param point the location of the component, relative to its parent.
- * @see #getLocation()
- */
- public void setLocation(Point point)
- {
- getBounds().setLocation(point);
- }
-
- /**
- * Sets the size of the component.
- * <br />
- * <br />
- * Please note that this method depends on a correctly implemented
- * version of the <code>getBounds()</code> method. Subclasses
- * must provide the bounding rectangle via <code>getBounds()</code>
- * in order for this method to work.
- *
- * @param size the new size of the component.
- * @see #getSize()
- */
- public void setSize(Dimension size)
- {
- getBounds().setSize(size);
- }
-
- /**
- * Sets the visibility state of the component. A component may
- * be visible but not drawn on the screen if one of its parent
- * components is not visible. To determine if the component is
- * actually drawn on screen, <code>isShowing()</code> should be
- * used.
- * <br />
- * <br />
- * As this abstract component has no properties relating to its
- * visibility, the implementation of this method is left to subclasses.
- *
- * @param visibility the new visibility of the component -- true if
- * the component is visible, false if not.
- * @see #isShowing()
- * @see #isVisible()
- */
- public void setVisible(boolean visibility)
- {
- /* Ignored */
- }
-
-} /* class AccessibleAWTMenuComponent */
-
-
-} // class MenuComponent
diff --git a/libjava/java/awt/MenuContainer.java b/libjava/java/awt/MenuContainer.java
deleted file mode 100644
index c76ec96c20b..00000000000
--- a/libjava/java/awt/MenuContainer.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* MenuContainer.java -- container for menu items
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This interface is a container for menu components.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.0
- * @status updated to 1.4
- */
-public interface MenuContainer
-{
- /**
- * Returns the font in use by this container.
- *
- * @return the menu font
- */
- Font getFont();
-
- /**
- * Removes the specified menu component from the menu.
- *
- * @param component the menu component to remove
- */
- void remove(MenuComponent component);
-
- /**
- * Posts an event to the listeners.
- *
- * @param event the event to dispatch
- * @deprecated use {@link MenuComponent#dispatchEvent(AWTEvent)} instead
- */
- boolean postEvent(Event event);
-} // interface MenuContainer
diff --git a/libjava/java/awt/MenuItem.java b/libjava/java/awt/MenuItem.java
deleted file mode 100644
index cea2475cda2..00000000000
--- a/libjava/java/awt/MenuItem.java
+++ /dev/null
@@ -1,603 +0,0 @@
-/* MenuItem.java -- An item in a menu
- Copyright (C) 1999, 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.peer.MenuItemPeer;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.util.EventListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleAction;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleValue;
-
-/**
- * This class represents an item in a menu.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class MenuItem extends MenuComponent
- implements Serializable, Accessible
-{
-
-/*
- * Static Variables
- */
-
-// Serialization Constant
-private static final long serialVersionUID = -21757335363267194L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The name of the action command generated by this item.
- * This is package-private to avoid an accessor method.
- */
-String actionCommand;
-
-/**
- * @serial Indicates whether or not this menu item is enabled.
- * This is package-private to avoid an accessor method.
- */
-boolean enabled = true;
-
-/**
- * @serial The mask of events that are enabled for this menu item.
- */
-long eventMask;
-
-/**
- * @serial This menu item's label
- * This is package-private to avoid an accessor method.
- */
-String label;
-
-/**
- * @serial The shortcut for this menu item, if any
- */
-private MenuShortcut shortcut;
-
-// The list of action listeners for this menu item.
-private transient ActionListener action_listeners;
-
- protected class AccessibleAWTMenuItem
- extends MenuComponent.AccessibleAWTMenuComponent
- implements AccessibleAction, AccessibleValue
- {
- /** Constructor */
- public AccessibleAWTMenuItem()
- {
- super();
- }
-
-
-
- public String getAccessibleName()
- {
- return label;
- }
-
- public AccessibleAction getAccessibleAction()
- {
- return this;
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.MENU_ITEM;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleAction#getAccessibleActionCount()
- */
- public int getAccessibleActionCount()
- {
- return 1;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleAction#getAccessibleActionDescription(int)
- */
- public String getAccessibleActionDescription(int i)
- {
- if (i == 0)
- return label;
- else
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleAction#doAccessibleAction(int)
- */
- public boolean doAccessibleAction(int i)
- {
- if (i != 0)
- return false;
- processActionEvent(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, actionCommand));
- return true;
- }
-
- public AccessibleValue getAccessibleValue()
- {
- return this;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
- */
- public Number getCurrentAccessibleValue()
- {
- return (enabled) ? new Integer(1) : new Integer(0);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#setCurrentAccessibleValue(java.lang.Number)
- */
- public boolean setCurrentAccessibleValue(Number number)
- {
- if (number.intValue() == 0)
- {
- setEnabled(false);
- return false;
- }
-
- setEnabled(true);
- return true;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
- */
- public Number getMinimumAccessibleValue()
- {
- return new Integer(0);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
- */
- public Number getMaximumAccessibleValue()
- {
- return new Integer(0);
- }
-
- }
-
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>MenuItem</code> with no label
- * and no shortcut.
- */
-public
-MenuItem()
-{
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>MenuItem</code> with the specified
- * label and no shortcut.
- *
- * @param label The label for this menu item.
- */
-public
-MenuItem(String label)
-{
- this.label = label;
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>MenuItem</code> with the specified
- * label and shortcut.
- *
- * @param label The label for this menu item.
- * @param shortcut The shortcut for this menu item.
- */
-public
-MenuItem(String label, MenuShortcut shortcut)
-{
- this.label = label;
- this.shortcut = shortcut;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the label for this menu item, which may be <code>null</code>.
- *
- * @return The label for this menu item.
- */
-public String
-getLabel()
-{
- return(label);
-}
-
-/*************************************************************************/
-
-/**
- * This method sets the label for this menu to the specified value.
- *
- * @param label The new label for this menu item.
- */
-public synchronized void
-setLabel(String label)
-{
- this.label = label;
- if (peer != null)
- {
- MenuItemPeer mp = (MenuItemPeer) peer;
- mp.setLabel (label);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this menu item is enabled.
- *
- * @return <code>true</code> if this menu item is enabled, <code>false</code>
- * otherwise.
- */
-public boolean
-isEnabled()
-{
- return(enabled);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the enabled status of this menu item.
- *
- * @param enabled <code>true</code> to enable this menu item,
- * <code>false</code> otherwise.
- */
-public synchronized void
-setEnabled(boolean enabled)
-{
- enable (enabled);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the enabled status of this menu item.
- *
- * @param enabled <code>true</code> to enable this menu item,
- * <code>false</code> otherwise.
- *
- * @deprecated This method is deprecated in favor of <code>setEnabled()</code>.
- */
-public void
-enable(boolean enabled)
-{
- if (enabled)
- enable ();
- else
- disable ();
-}
-
-/*************************************************************************/
-
-/**
- * Enables this menu item.
- *
- * @deprecated This method is deprecated in favor of <code>setEnabled()</code>.
- */
-public void
-enable()
-{
- if (enabled)
- return;
-
- this.enabled = true;
- if (peer != null)
- ((MenuItemPeer) peer).setEnabled (true);
-}
-
-/*************************************************************************/
-
-/**
- * Disables this menu item.
- *
- * @deprecated This method is deprecated in favor of <code>setEnabled()</code>.
- */
-public void
-disable()
-{
- if (!enabled)
- return;
-
- this.enabled = false;
- if (peer != null)
- ((MenuItemPeer) peer).setEnabled (false);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the shortcut for this menu item, which may be <code>null</code>.
- *
- * @return The shortcut for this menu item.
- */
-public MenuShortcut
-getShortcut()
-{
- return(shortcut);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the shortcut for this menu item to the specified value. This
- * must be done before the native peer is created.
- *
- * @param shortcut The new shortcut for this menu item.
- */
-public void
-setShortcut(MenuShortcut shortcut)
-{
- this.shortcut = shortcut;
-}
-
-/*************************************************************************/
-
-/**
- * Deletes the shortcut for this menu item if one exists. This must be
- * done before the native peer is created.
- */
-public void
-deleteShortcut()
-{
- shortcut = null;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the name of the action command in the action events
- * generated by this menu item.
- *
- * @return The action command name
- */
-public String
-getActionCommand()
-{
- if (actionCommand == null)
- return label;
- else
- return actionCommand;
-}
-
-/*************************************************************************/
-
-/**
- * Sets the name of the action command in the action events generated by
- * this menu item.
- *
- * @param actionCommand The new action command name.
- */
-public void
-setActionCommand(String actionCommand)
-{
- this.actionCommand = actionCommand;
-}
-
-/*************************************************************************/
-
-/**
- * Enables the specified events. This is done automatically when a
- * listener is added and does not normally need to be done by
- * application code.
- *
- * @param events The events to enable, which should be the bit masks
- * from <code>AWTEvent</code>.
- */
-protected final void
-enableEvents(long events)
-{
- eventMask |= events;
- // TODO: see comment in Component.enableEvents().
-}
-
-/*************************************************************************/
-
-/**
- * Disables the specified events.
- *
- * @param events The events to enable, which should be the bit masks
- * from <code>AWTEvent</code>.
- */
-protected final void
-disableEvents(long events)
-{
- eventMask &= ~events;
-}
-
-/*************************************************************************/
-
-/**
- * Creates the native peer for this object.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createMenuItem (this);
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified listener to the list of registered action listeners
- * for this component.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.add(action_listeners, listener);
-
- enableEvents(AWTEvent.ACTION_EVENT_MASK);
-}
-
-public synchronized void
-removeActionListener(ActionListener l)
-{
- action_listeners = AWTEventMulticaster.remove(action_listeners, l);
-}
-
- public synchronized ActionListener[] getActionListeners()
- {
- return (ActionListener[])
- AWTEventMulticaster.getListeners(action_listeners,
- ActionListener.class);
- }
-
-/** Returns all registered EventListers of the given listenerType.
- * listenerType must be a subclass of EventListener, or a
- * ClassClassException is thrown.
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerType)
- {
- if (listenerType == ActionListener.class)
- return getActionListeners();
- return (EventListener[]) Array.newInstance(listenerType, 0);
- }
-
-/*************************************************************************/
-
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= ActionEvent.ACTION_LAST
- && e.id >= ActionEvent.ACTION_FIRST
- && (action_listeners != null
- || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
- processEvent(e);
-
- // Send the event to the parent menu if it has not yet been
- // consumed.
- if (!e.isConsumed ())
- ((Menu) getParent ()).processEvent (e);
-}
-
-/**
- * Processes the specified event by calling <code>processActionEvent()</code>
- * if it is an instance of <code>ActionEvent</code>.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof ActionEvent)
- processActionEvent((ActionEvent)event);
-}
-
-/*************************************************************************/
-
-/**
- * Processes the specified event by dispatching it to any registered listeners.
- *
- * @param event The event to process.
- */
-protected void
-processActionEvent(ActionEvent event)
-{
- if (action_listeners != null)
- {
- event.setSource(this);
- action_listeners.actionPerformed(event);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this object.
- *
- * @return A debugging string for this object.
- */
-public String
-paramString()
-{
- return ("label=" + label + ",enabled=" + enabled +
- ",actionCommand=" + actionCommand + "," + super.paramString());
-}
-
-/**
- * Gets the AccessibleContext associated with this <code>MenuItem</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
-public AccessibleContext getAccessibleContext()
-{
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTMenuItem();
- return accessibleContext;
-}
-
-} // class MenuItem
diff --git a/libjava/java/awt/MenuShortcut.java b/libjava/java/awt/MenuShortcut.java
deleted file mode 100644
index adfd1d3187a..00000000000
--- a/libjava/java/awt/MenuShortcut.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/* MenuShortcut.java -- A class for menu accelerators
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This class implements a keyboard accelerator for a menu item.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class MenuShortcut implements java.io.Serializable
-{
-
-/*
- * Static Variables
- */
-
-// Serialization Constant
-private static final long serialVersionUID = 143448358473180225L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The virtual keycode for the shortcut.
- */
-private int key;
-
-/**
- * @serial <code>true</code> if the shift key was used with this shortcut,
- * or <code>false</code> otherwise.
- */
-private boolean usesShift;
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>MenuShortcut</code> with the
- * specified virtual key value.
- *
- * @param key The virtual keycode for the shortcut.
- */
-public
-MenuShortcut(int key)
-{
- this(key, false);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>MenuShortcut</code> with the
- * specified virtual key value and shift setting.
- *
- * @param key The virtual keycode for the shortcut.
- * @param usesShift <code>true</code> if the shift key was pressed,
- * <code>false</code> otherwise.
- */
-public
-MenuShortcut(int key, boolean usesShift)
-{
- this.key = key;
- this.usesShift = usesShift;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the virtual keycode for this shortcut.
- *
- * @return The virtual keycode for this shortcut.
- */
-public int
-getKey()
-{
- return(key);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the shift setting for this shortcut.
- *
- * @return <code>true</code> if the shift key was pressed, <code>false</code>
- * otherwise.
- */
-public boolean
-usesShiftModifier()
-{
- return(usesShift);
-}
-
-/*************************************************************************/
-
-/**
- * Tests this object for equality against the specified object. The two
- * objects will be considered equal if and only if the specified object
- * is an instance of <code>MenuShortcut</code> and has the same key value
- * and shift setting as this object.
- *
- * @param obj The object to test for equality against.
- *
- * @return <code>true</code> if the two objects are equal, <code>false</code>
- * otherwise.
- */
-public boolean
-equals(MenuShortcut obj)
-{
- if (obj == null)
- return(false);
-
- if (obj.key != this.key)
- return(false);
-
- if (obj.usesShift != this.usesShift)
- return(false);
-
- return(true);
-}
-
-public boolean
-equals(Object obj)
-{
- if (obj instanceof MenuShortcut)
- {
- MenuShortcut ms = (MenuShortcut) obj;
- return (ms.key == key && ms.usesShift == usesShift);
- }
- return false;
-}
-
-/*************************************************************************/
-
-/**
- * Returns a string representation of this shortcut.
- *
- * @return A string representation of this shortcut.
- */
-public String
-toString()
-{
- return(getClass().getName() + "[" + paramString () + "]");
-}
-
-public int
-hashCode()
-{
- // Arbitrary.
- return key + (usesShift ? 23 : 57);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this object.
- *
- * @return A debugging string for this object.
- */
-protected String
-paramString()
-{
- return "key=" + key + ",usesShift=" + usesShift;
-}
-
-} // class MenuShortcut
diff --git a/libjava/java/awt/PageAttributes.java b/libjava/java/awt/PageAttributes.java
deleted file mode 100644
index 38fb696e339..00000000000
--- a/libjava/java/awt/PageAttributes.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/* PageAttributes.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.util.Locale;
-
-/**
- * Missing Documentation
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- * @status updated to 1.4, but missing documentation
- */
-public final class PageAttributes implements Cloneable
-{
- public static final class ColorType extends AttributeValue
- {
- private static final String[] NAMES = { "color", "monochrome" };
- public static final ColorType COLOR = new ColorType(0);
- public static final ColorType MONOCHROME = new ColorType(1);
- private ColorType(int value)
- {
- super(value, NAMES);
- }
- } // class ColorType
- public static final class MediaType extends AttributeValue
- {
- private static final String[] NAMES
- = { "iso-4a0", "iso-2a0", "iso-a0", "iso-a1", "iso-a2", "iso-a3",
- "iso-a4", "iso-a5", "iso-a6", "iso-a7", "iso-a8", "iso-a9",
- "iso-a10", "iso-b0", "iso-b1", "iso-b2", "iso-b3", "iso-b4",
- "iso-b5", "iso-b6", "iso-b7", "iso-b8", "iso-b9", "iso-b10",
- "jis-b0", "jis-b1", "jis-b2", "jis-b3", "jis-b4", "jis-b5",
- "jis-b6", "jis-b7", "jis-b8", "jis-b9", "jis-b10", "iso-c0",
- "iso-c1", "iso-c2", "iso-c3", "iso-c4", "iso-c5", "iso-c6",
- "iso-c7", "iso-c8", "iso-c9", "iso-c10", "iso-designated-long",
- "executive", "folio", "invoice", "ledger", "na-letter", "na-legal",
- "quarto", "a", "b", "c", "d", "e", "na-10x15-envelope",
- "na-10x14-envelope", "na-10x13-envelope", "na-9x12-envelope",
- "na-9x11-envelope", "na-7x9-envelope", "na-6x9-envelope",
- "na-number-9-envelope", "na-number-10-envelope",
- "na-number-11-envelope", "na-number-12-envelope",
- "na-number-14-envelope", "invite-envelope", "italy-envelope",
- "monarch-envelope", "personal-envelope" };
- public static final MediaType ISO_4A0 = new MediaType(0);
- public static final MediaType ISO_2A0 = new MediaType(1);
- public static final MediaType ISO_A0 = new MediaType(2);
- public static final MediaType ISO_A1 = new MediaType(3);
- public static final MediaType ISO_A2 = new MediaType(4);
- public static final MediaType ISO_A3 = new MediaType(5);
- public static final MediaType ISO_A4 = new MediaType(6);
- public static final MediaType ISO_A5 = new MediaType(7);
- public static final MediaType ISO_A6 = new MediaType(8);
- public static final MediaType ISO_A7 = new MediaType(9);
- public static final MediaType ISO_A8 = new MediaType(10);
- public static final MediaType ISO_A9 = new MediaType(11);
- public static final MediaType ISO_A10 = new MediaType(12);
- public static final MediaType ISO_B0 = new MediaType(13);
- public static final MediaType ISO_B1 = new MediaType(14);
- public static final MediaType ISO_B2 = new MediaType(15);
- public static final MediaType ISO_B3 = new MediaType(16);
- public static final MediaType ISO_B4 = new MediaType(17);
- public static final MediaType ISO_B5 = new MediaType(18);
- public static final MediaType ISO_B6 = new MediaType(19);
- public static final MediaType ISO_B7 = new MediaType(20);
- public static final MediaType ISO_B8 = new MediaType(21);
- public static final MediaType ISO_B9 = new MediaType(22);
- public static final MediaType ISO_B10 = new MediaType(23);
- public static final MediaType JIS_B0 = new MediaType(24);
- public static final MediaType JIS_B1 = new MediaType(25);
- public static final MediaType JIS_B2 = new MediaType(26);
- public static final MediaType JIS_B3 = new MediaType(27);
- public static final MediaType JIS_B4 = new MediaType(28);
- public static final MediaType JIS_B5 = new MediaType(29);
- public static final MediaType JIS_B6 = new MediaType(30);
- public static final MediaType JIS_B7 = new MediaType(31);
- public static final MediaType JIS_B8 = new MediaType(32);
- public static final MediaType JIS_B9 = new MediaType(33);
- public static final MediaType JIS_B10 = new MediaType(34);
- public static final MediaType ISO_C0 = new MediaType(35);
- public static final MediaType ISO_C1 = new MediaType(36);
- public static final MediaType ISO_C2 = new MediaType(37);
- public static final MediaType ISO_C3 = new MediaType(38);
- public static final MediaType ISO_C4 = new MediaType(39);
- public static final MediaType ISO_C5 = new MediaType(40);
- public static final MediaType ISO_C6 = new MediaType(41);
- public static final MediaType ISO_C7 = new MediaType(42);
- public static final MediaType ISO_C8 = new MediaType(43);
- public static final MediaType ISO_C9 = new MediaType(44);
- public static final MediaType ISO_C10 = new MediaType(45);
- public static final MediaType ISO_DESIGNATED_LONG = new MediaType(46);
- public static final MediaType EXECUTIVE = new MediaType(47);
- public static final MediaType FOLIO = new MediaType(48);
- public static final MediaType INVOICE = new MediaType(49);
- public static final MediaType LEDGER = new MediaType(50);
- public static final MediaType NA_LETTER = new MediaType(51);
- public static final MediaType NA_LEGAL = new MediaType(52);
- public static final MediaType QUARTO = new MediaType(53);
- public static final MediaType A = new MediaType(54);
- public static final MediaType B = new MediaType(55);
- public static final MediaType C = new MediaType(56);
- public static final MediaType D = new MediaType(57);
- public static final MediaType E = new MediaType(58);
- public static final MediaType NA_10X15_ENVELOPE = new MediaType(59);
- public static final MediaType NA_10X14_ENVELOPE = new MediaType(60);
- public static final MediaType NA_10X13_ENVELOPE = new MediaType(61);
- public static final MediaType NA_9X12_ENVELOPE = new MediaType(62);
- public static final MediaType NA_9X11_ENVELOPE = new MediaType(63);
- public static final MediaType NA_7X9_ENVELOPE = new MediaType(64);
- public static final MediaType NA_6X9_ENVELOPE = new MediaType(65);
- public static final MediaType NA_NUMBER_9_ENVELOPE = new MediaType(66);
- public static final MediaType NA_NUMBER_10_ENVELOPE = new MediaType(67);
- public static final MediaType NA_NUMBER_11_ENVELOPE = new MediaType(68);
- public static final MediaType NA_NUMBER_12_ENVELOPE = new MediaType(69);
- public static final MediaType NA_NUMBER_14_ENVELOPE = new MediaType(70);
- public static final MediaType INVITE_ENVELOPE = new MediaType(71);
- public static final MediaType ITALY_ENVELOPE = new MediaType(72);
- public static final MediaType MONARCH_ENVELOPE = new MediaType(73);
- public static final MediaType PERSONAL_ENVELOPE = new MediaType(74);
- public static final MediaType A0 = ISO_A0;
- public static final MediaType A1 = ISO_A1;
- public static final MediaType A2 = ISO_A2;
- public static final MediaType A3 = ISO_A3;
- public static final MediaType A4 = ISO_A4;
- public static final MediaType A5 = ISO_A5;
- public static final MediaType A6 = ISO_A6;
- public static final MediaType A7 = ISO_A7;
- public static final MediaType A8 = ISO_A8;
- public static final MediaType A9 = ISO_A9;
- public static final MediaType A10 = ISO_A10;
- public static final MediaType B0 = ISO_B0;
- public static final MediaType B1 = ISO_B1;
- public static final MediaType B2 = ISO_B2;
- public static final MediaType B3 = ISO_B3;
- public static final MediaType B4 = ISO_B4;
- public static final MediaType ISO_B4_ENVELOPE = ISO_B4;
- public static final MediaType B5 = ISO_B5;
- public static final MediaType ISO_B5_ENVELOPE = ISO_B4;
- public static final MediaType B6 = ISO_B6;
- public static final MediaType B7 = ISO_B7;
- public static final MediaType B8 = ISO_B8;
- public static final MediaType B9 = ISO_B9;
- public static final MediaType B10 = ISO_B10;
- public static final MediaType C0 = ISO_B0;
- public static final MediaType ISO_C0_ENVELOPE = ISO_C0;
- public static final MediaType C1 = ISO_C1;
- public static final MediaType ISO_C1_ENVELOPE = ISO_C1;
- public static final MediaType C2 = ISO_C2;
- public static final MediaType ISO_C2_ENVELOPE = ISO_C2;
- public static final MediaType C3 = ISO_C3;
- public static final MediaType ISO_C3_ENVELOPE = ISO_C3;
- public static final MediaType C4 = ISO_C4;
- public static final MediaType ISO_C4_ENVELOPE = ISO_C4;
- public static final MediaType C5 = ISO_C5;
- public static final MediaType ISO_C5_ENVELOPE = ISO_C5;
- public static final MediaType C6 = ISO_C6;
- public static final MediaType ISO_C6_ENVELOPE = ISO_C6;
- public static final MediaType C7 = ISO_C7;
- public static final MediaType ISO_C7_ENVELOPE = ISO_C7;
- public static final MediaType C8 = ISO_C8;
- public static final MediaType ISO_C8_ENVELOPE = ISO_C8;
- public static final MediaType C9 = ISO_C9;
- public static final MediaType ISO_C9_ENVELOPE = ISO_C9;
- public static final MediaType C10 = ISO_C10;
- public static final MediaType ISO_C10_ENVELOPE = ISO_C10;
- public static final MediaType ISO_DESIGNATED_LONG_ENVELOPE
- = ISO_DESIGNATED_LONG;
- public static final MediaType STATEMENT = INVOICE;
- public static final MediaType TABLOID = LEDGER;
- public static final MediaType LETTER = NA_LETTER;
- public static final MediaType NOTE = NA_LETTER;
- public static final MediaType LEGAL = NA_LEGAL;
- public static final MediaType ENV_10X15 = NA_10X15_ENVELOPE;
- public static final MediaType ENV_10X14 = NA_10X14_ENVELOPE;
- public static final MediaType ENV_10X13 = NA_10X13_ENVELOPE;
- public static final MediaType ENV_9X12 = NA_9X12_ENVELOPE;
- public static final MediaType ENV_9X11 = NA_9X11_ENVELOPE;
- public static final MediaType ENV_7X9 = NA_7X9_ENVELOPE;
- public static final MediaType ENV_6X9 = NA_6X9_ENVELOPE;
- public static final MediaType ENV_9 = NA_NUMBER_9_ENVELOPE;
- public static final MediaType ENV_10 = NA_NUMBER_10_ENVELOPE;
- public static final MediaType ENV_11 = NA_NUMBER_11_ENVELOPE;
- public static final MediaType ENV_12 = NA_NUMBER_12_ENVELOPE;
- public static final MediaType ENV_14 = NA_NUMBER_14_ENVELOPE;
- public static final MediaType ENV_INVITE = INVITE_ENVELOPE;
- public static final MediaType ENV_ITALY = ITALY_ENVELOPE;
- public static final MediaType ENV_MONARCH = MONARCH_ENVELOPE;
- public static final MediaType ENV_PERSONAL = PERSONAL_ENVELOPE;
- public static final MediaType INVITE = INVITE_ENVELOPE;
- public static final MediaType ITALY = ITALY_ENVELOPE;
- public static final MediaType MONARCH = MONARCH_ENVELOPE;
- public static final MediaType PERSONAL = PERSONAL_ENVELOPE;
- private MediaType(int value)
- {
- super(value, NAMES);
- }
- } // class MediaType
- public static final class OrientationRequestedType extends AttributeValue
- {
- private static final String[] NAMES = { "portrait", "landscape" };
- public static final OrientationRequestedType PORTRAIT
- = new OrientationRequestedType(0);
- public static final OrientationRequestedType LANDSCAPE
- = new OrientationRequestedType(1);
- private OrientationRequestedType(int value)
- {
- super(value, NAMES);
- }
- } // class OrientationRequestedType
- public static final class OriginType extends AttributeValue
- {
- private static final String[] NAMES = { "physical", "printable" };
- public static final OriginType PHYSICAL = new OriginType(0);
- public static final OriginType PRINTABLE = new OriginType(1);
- private OriginType(int value)
- {
- super(value, NAMES);
- }
- } // class OriginType
- public static final class PrintQualityType extends AttributeValue
- {
- private static final String[] NAMES = { "high", "normal", "draft" };
- public static final PrintQualityType HIGH = new PrintQualityType(0);
- public static final PrintQualityType NORMAL = new PrintQualityType(1);
- public static final PrintQualityType DRAFT = new PrintQualityType(2);
- private PrintQualityType(int value)
- {
- super(value, NAMES);
- }
- } // class PrintQualityType
-
-
- private ColorType color;
- private MediaType media;
- private OrientationRequestedType orientation;
- private OriginType origin;
- private PrintQualityType quality;
- private int resolutionX;
- private int resolutionY;
- private int resolutionScale;
- public PageAttributes()
- {
- color = ColorType.MONOCHROME;
- setMediaToDefault();
- orientation = OrientationRequestedType.PORTRAIT;
- origin = OriginType.PHYSICAL;
- quality = PrintQualityType.NORMAL;
- setPrinterResolutionToDefault();
- }
-
- public PageAttributes(PageAttributes attr)
- {
- set(attr);
- }
-
- public PageAttributes(ColorType color, MediaType media,
- OrientationRequestedType orientation,
- OriginType origin, PrintQualityType quality,
- int[] resolution)
- {
- if (color == null || media == null || orientation == null
- || origin == null || quality == null)
- throw new IllegalArgumentException();
- setPrinterResolution(resolution);
- this.color = color;
- this.media = media;
- this.orientation = orientation;
- this.origin = origin;
- this.quality = quality;
- }
-
- public Object clone()
- {
- return new PageAttributes(this);
- }
-
- public void set(PageAttributes attr)
- {
- color = attr.color;
- media = attr.media;
- orientation = attr.orientation;
- origin = attr.origin;
- quality = attr.quality;
- resolutionX = attr.resolutionX;
- resolutionY = attr.resolutionY;
- resolutionScale = attr.resolutionScale;
- }
-
- public ColorType getColor()
- {
- return color;
- }
-
- public void setColor(ColorType color)
- {
- if (color == null)
- throw new IllegalArgumentException();
- this.color = color;
- }
-
- public MediaType getMedia()
- {
- return media;
- }
-
- public void setMedia(MediaType media)
- {
- if (media == null)
- throw new IllegalArgumentException();
- this.media = media;
- }
-
- public void setMediaToDefault()
- {
- String country = Locale.getDefault().getCountry();
- media = ("US".equals(country) || "CA".equals(country)) ? MediaType.LETTER
- : MediaType.A4;
- }
-
- public OrientationRequestedType getOrientationRequested()
- {
- return orientation;
- }
-
- public void setOrientationRequested(OrientationRequestedType orientation)
- {
- if (orientation == null)
- throw new IllegalArgumentException();
- this.orientation = orientation;
- }
-
- public void setOrientationRequested(int orientation)
- {
- if (orientation == 3)
- this.orientation = OrientationRequestedType.PORTRAIT;
- else if (orientation == 4)
- this.orientation = OrientationRequestedType.LANDSCAPE;
- else
- throw new IllegalArgumentException();
- }
-
- public void setOrientationRequestedToDefault()
- {
- orientation = OrientationRequestedType.PORTRAIT;
- }
-
- public OriginType getOrigin()
- {
- return origin;
- }
-
- public void setOrigin(OriginType origin)
- {
- if (origin == null)
- throw new IllegalArgumentException();
- this.origin = origin;
- }
-
- public PrintQualityType getPrintQuality()
- {
- return quality;
- }
-
- public void setPrintQuality(PrintQualityType quality)
- {
- if (quality == null)
- throw new IllegalArgumentException();
- this.quality = quality;
- }
-
- public void setPrintQuality(int quality)
- {
- if (quality == 3)
- this.quality = PrintQualityType.DRAFT;
- else if (quality == 4)
- this.quality = PrintQualityType.NORMAL;
- else if (quality == 5)
- this.quality = PrintQualityType.HIGH;
- else
- throw new IllegalArgumentException();
- }
-
- public void setPrintQualityToDefault()
- {
- quality = PrintQualityType.NORMAL;
- }
-
- public int[] getPrinterResolution()
- {
- return new int[] { resolutionX, resolutionY, resolutionScale };
- }
-
- public void setPrinterResolution(int[] resolution)
- {
- if (resolution == null || resolution.length != 3 || resolution[0] <= 0
- || resolution[1] <= 0 || resolution[2] < 3 || resolution[2] > 4)
- throw new IllegalArgumentException();
- resolutionX = resolution[0];
- resolutionY = resolution[1];
- resolutionScale = resolution[2];
- }
-
- public void setPrinterResolution(int resolution)
- {
- if (resolution <= 0)
- throw new IllegalArgumentException();
- resolutionX = resolution;
- resolutionY = resolution;
- resolutionScale = 3;
- }
-
- public void setPrinterResolutionToDefault()
- {
- resolutionX = 72;
- resolutionY = 72;
- resolutionScale = 3;
- }
-
- public boolean equals(Object o)
- {
- if (this == o)
- return true;
- if (! (o instanceof PageAttributes))
- return false;
- PageAttributes pa = (PageAttributes) o;
- return color == pa.color && media == pa.media
- && orientation == pa.orientation && origin == pa.origin
- && quality == pa.quality && resolutionX == pa.resolutionX
- && resolutionY == pa.resolutionY
- && resolutionScale == pa.resolutionScale;
- }
- public int hashCode()
- {
- return (color.value << 31) ^ (media.value << 24)
- ^ (orientation.value << 23) ^ (origin.value << 22)
- ^ (quality.value << 20) ^ (resolutionScale << 19)
- ^ (resolutionY << 10) ^ resolutionX;
- }
- public String toString()
- {
- return "color=" + color + ",media=" + media + ",orientation-requested="
- + orientation + ",origin=" + origin + ",print-quality=" + quality
- + ",printer-resolution=[" + resolutionX + ',' + resolutionY + ','
- + resolutionScale + ']';
- }
-} // class PageAttributes
diff --git a/libjava/java/awt/Paint.java b/libjava/java/awt/Paint.java
deleted file mode 100644
index 0f099cc0b80..00000000000
--- a/libjava/java/awt/Paint.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Paint.java -- generate colors for Graphics2D operations
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.ColorModel;
-
-/**
- * Defines how color patterns are generated for Graphics2D operations. This
- * is used to perform the <code>draw</code> and <code>fill</code> methods
- * of the graphics object. Instances must be immutable, because the graphics
- * object does not clone them.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @see PaintContext
- * @see Color
- * @see GradientPaint
- * @see TexturePaint
- * @see Graphics2D#setPaint(Paint)
- * @since 1.1
- * @status updated to 1.4
- */
-public interface Paint extends Transparency
-{
- /**
- * Create the context necessary for performing the color pattern generation.
- * The color model is a hint, and may be null for Classpath implementations;
- * however some legacy code may throw a NullPointerException when passed a
- * null. Leaving the color model null provides the most efficiency and leeway
- * in the generation of the color pattern.
- *
- * @param cm the color model, used as a hint
- * @param deviceBounds the device space bounding box of the painted area
- * @param userBounds the user space bounding box of the painted area
- * @param xform the transformation from user space to device space
- * @param hints any hints for choosing between rendering alternatives
- * @return the context for performing the paint
- */
- PaintContext createContext(ColorModel cm, Rectangle deviceBounds,
- Rectangle2D userBounds, AffineTransform xform,
- RenderingHints hints);
-} // interface Paint
diff --git a/libjava/java/awt/PaintContext.java b/libjava/java/awt/PaintContext.java
deleted file mode 100644
index 3d5fdcdf0e4..00000000000
--- a/libjava/java/awt/PaintContext.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* PaintContext.java -- the environment for performing a paint operation
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.image.ColorModel;
-import java.awt.image.Raster;
-
-/**
- * @author Warren Levy (warrenl@cygnus.com)
- * @see Paint
- * @since 1.1
- * @status updated to 1.4
- */
-public interface PaintContext
-{
- /**
- * Release the resources allocated for the paint.
- */
- void dispose();
-
- /**
- * Return the color model of this context. It may be different from the
- * hint specified during createContext, as not all contexts can generate
- * color patterns in an arbitrary model.
- *
- * @return the context color model
- */
- ColorModel getColorModel();
-
- /**
- * Return a raster containing the colors for the graphics operation.
- *
- * @param x the x-coordinate, in device space
- * @param y the y-coordinate, in device space
- * @param w the width, in device space
- * @param h the height, in device space
- * @return a raster for the given area and color
- */
- Raster getRaster(int x, int y, int w, int h);
-} // interface PaintContext
diff --git a/libjava/java/awt/Panel.java b/libjava/java/awt/Panel.java
deleted file mode 100644
index cc17eef2285..00000000000
--- a/libjava/java/awt/Panel.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/* Panel.java -- Simple container object
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * A panel is a simple container class. It's default layout is the
- * <code>FlowLayout</code> manager.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see FlowLayout
- * @since 1.0
- * @status updated to 1.4
- */
-public class Panel extends Container implements Accessible
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -2728009084054400034L;
-
- /** The cached accessible context. */
- private transient AccessibleContext context;
-
- /** Flag set when the first system-requested paint event is
- dispatched. */
- private transient boolean initialSystemUpdateDone;
-
- /** Flag set when the first application-requested paint event is
- consumed. */
- private transient boolean initialUpdateConsumed;
-
- /*
- * The number used to generate the name returned by getName.
- */
- private static transient long next_panel_number;
-
- /**
- * Initializes a new instance of <code>Panel</code> that has a default
- * layout manager of <code>FlowLayout</code>.
- */
- public Panel()
- {
- this(new FlowLayout());
- }
-
- /**
- * Initializes a new instance of <code>Panel</code> with the specified
- * layout manager.
- *
- * @param layoutManager the layout manager for this object
- * @since 1.1
- */
- public Panel(LayoutManager layoutManager)
- {
- setLayout(layoutManager);
- }
-
- /**
- * Notifies this object to create its native peer.
- *
- * @see #isDisplayable()
- * @see #removeNotify()
- */
- public void addNotify()
- {
- if (peer == null)
- peer = getToolkit().createPanel(this);
- super.addNotify();
- }
-
- /**
- * Gets the AccessibleContext associated with this panel, creating one if
- * necessary. This always returns an instance of {@link AccessibleAWTPanel}.
- *
- * @return the accessibility context of this panel
- * @since 1.3
- */
- public AccessibleContext getAccessibleContext()
- {
- if (context == null)
- context = new AccessibleAWTPanel();
- return context;
- }
-
- /**
- * This class provides accessibility support for Panels, and is the
- * runtime type returned by {@link #getAccessibleContext()}.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- */
- protected class AccessibleAWTPanel extends AccessibleAWTContainer
- {
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = -6409552226660031050L;
-
- /**
- * The default constructor.
- */
- protected AccessibleAWTPanel()
- {
- }
-
- /**
- * Get the role of this accessible object, a panel.
- *
- * @return the role of the object
- * @see AccessibleRole#PANEL
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.PANEL;
- }
- }
-
- /**
- * Generate a unique name for this panel.
- *
- * @return A unique name for this panel.
- */
- String generateName ()
- {
- return "panel" + getUniqueLong ();
- }
-
- private static synchronized long getUniqueLong ()
- {
- return next_panel_number++;
- }
-}
diff --git a/libjava/java/awt/Point.java b/libjava/java/awt/Point.java
deleted file mode 100644
index 492749b8dc3..00000000000
--- a/libjava/java/awt/Point.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/* Point.java -- represents a point in 2-D space
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.geom.Point2D;
-import java.io.Serializable;
-
-/**
- * This class represents a point on the screen using cartesian coordinates.
- * Remember that in screen coordinates, increasing x values go from left to
- * right, and increasing y values go from top to bottom.
- *
- * <p>There are some public fields; if you mess with them in an inconsistent
- * manner, it is your own fault when you get invalid results. Also, this
- * class is not threadsafe.
- *
- * @author Per Bothner (bothner@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status updated to 1.4
- */
-public class Point extends Point2D implements Serializable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -5276940640259749850L;
-
- /**
- * The x coordinate.
- *
- * @see #getLocation()
- * @see #move(int, int)
- * @serial the X coordinate of the point
- */
- public int x;
-
- /**
- * The y coordinate.
- *
- * @see #getLocation()
- * @see #move(int, int)
- * @serial The Y coordinate of the point
- */
- public int y;
-
- /**
- * Initializes a new instance of <code>Point</code> representing the
- * coordiates (0,0).
- *
- * @since 1.1
- */
- public Point()
- {
- }
-
- /**
- * Initializes a new instance of <code>Point</code> with coordinates
- * identical to the coordinates of the specified points.
- *
- * @param p the point to copy the coordinates from
- * @throws NullPointerException if p is null
- */
- public Point(Point p)
- {
- x = p.x;
- y = p.y;
- }
-
- /**
- * Initializes a new instance of <code>Point</code> with the specified
- * coordinates.
- *
- * @param x the X coordinate
- * @param y the Y coordinate
- */
- public Point(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
-
- /**
- * Get the x coordinate.
- *
- * @return the value of x, as a double
- */
- public double getX()
- {
- return x;
- }
-
- /**
- * Get the y coordinate.
- *
- * @return the value of y, as a double
- */
- public double getY()
- {
- return y;
- }
-
- /**
- * Returns the location of this point. A pretty useless method, as this
- * is already a point.
- *
- * @return a copy of this point
- * @see #setLocation(Point)
- * @since 1.1
- */
- public Point getLocation()
- {
- return new Point(x, y);
- }
-
- /**
- * Sets this object's coordinates to match those of the specified point.
- *
- * @param p the point to copy the coordinates from
- * @throws NullPointerException if p is null
- * @since 1.1
- */
- public void setLocation(Point p)
- {
- x = p.x;
- y = p.y;
- }
-
- /**
- * Sets this object's coordinates to the specified values. This method
- * is identical to the <code>move()</code> method.
- *
- * @param x the new X coordinate
- * @param y the new Y coordinate
- */
- public void setLocation(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
-
- /**
- * Sets this object's coordinates to the specified values. This method
- * performs normal casting from double to int, so you may lose precision.
- *
- * @param x the new X coordinate
- * @param y the new Y coordinate
- */
- public void setLocation(double x, double y)
- {
- this.x = (int) x;
- this.y = (int) y;
- }
-
- /**
- * Sets this object's coordinates to the specified values. This method
- * is identical to the <code>setLocation(int, int)</code> method.
- *
- * @param x the new X coordinate
- * @param y the new Y coordinate
- */
- public void move(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
-
- /**
- * Changes the coordinates of this point such that the specified
- * <code>dx</code> parameter is added to the existing X coordinate and
- * <code>dy</code> is added to the existing Y coordinate.
- *
- * @param dx the amount to add to the X coordinate
- * @param dy the amount to add to the Y coordinate
- */
- public void translate(int dx, int dy)
- {
- x += dx;
- y += dy;
- }
-
- /**
- * Tests whether or not this object is equal to the specified object.
- * This will be true if and only if the specified object is an instance
- * of Point2D and has the same X and Y coordinates.
- *
- * @param obj the object to test against for equality
- * @return true if the specified object is equal
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof Point2D))
- return false;
- Point2D p = (Point2D) obj;
- return x == p.getX() && y == p.getY();
- }
-
- /**
- * Returns a string representation of this object. The format is:
- * <code>getClass().getName() + "[x=" + x + ",y=" + y + ']'</code>.
- *
- * @return a string representation of this object
- */
- public String toString()
- {
- return getClass().getName() + "[x=" + x + ",y=" + y + ']';
- }
-} // class Point
diff --git a/libjava/java/awt/Polygon.java b/libjava/java/awt/Polygon.java
deleted file mode 100644
index a72522cb089..00000000000
--- a/libjava/java/awt/Polygon.java
+++ /dev/null
@@ -1,613 +0,0 @@
-/* Polygon.java -- class representing a polygon
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Line2D;
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.io.Serializable;
-
-/**
- * This class represents a polygon, a closed, two-dimensional region in a
- * coordinate space. The region is bounded by an arbitrary number of line
- * segments, between (x,y) coordinate vertices. The polygon has even-odd
- * winding, meaning that a point is inside the shape if it crosses the
- * boundary an odd number of times on the way to infinity.
- *
- * <p>There are some public fields; if you mess with them in an inconsistent
- * manner, it is your own fault when you get NullPointerException,
- * ArrayIndexOutOfBoundsException, or invalid results. Also, this class is
- * not threadsafe.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status updated to 1.4
- */
-public class Polygon implements Shape, Serializable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -6460061437900069969L;
-
- /**
- * This total number of endpoints.
- *
- * @serial the number of endpoints, possibly less than the array sizes
- */
- public int npoints;
-
- /**
- * The array of X coordinates of endpoints. This should not be null.
- *
- * @see #addPoint(int, int)
- * @serial the x coordinates
- */
- public int[] xpoints;
-
- /**
- * The array of Y coordinates of endpoints. This should not be null.
- *
- * @see #addPoint(int, int)
- * @serial the y coordinates
- */
- public int[] ypoints;
-
- /**
- * The bounding box of this polygon. This is lazily created and cached, so
- * it must be invalidated after changing points.
- *
- * @see #getBounds()
- * @serial the bounding box, or null
- */
- protected Rectangle bounds;
-
- /** A big number, but not so big it can't survive a few float operations */
- private static final double BIG_VALUE = java.lang.Double.MAX_VALUE / 10.0;
-
- /**
- * Initializes an empty polygon.
- */
- public Polygon()
- {
- // Leave room for growth.
- xpoints = new int[4];
- ypoints = new int[4];
- }
-
- /**
- * Create a new polygon with the specified endpoints. The arrays are copied,
- * so that future modifications to the parameters do not affect the polygon.
- *
- * @param xpoints the array of X coordinates for this polygon
- * @param ypoints the array of Y coordinates for this polygon
- * @param npoints the total number of endpoints in this polygon
- * @throws NegativeArraySizeException if npoints is negative
- * @throws IndexOutOfBoundsException if npoints exceeds either array
- * @throws NullPointerException if xpoints or ypoints is null
- */
- public Polygon(int[] xpoints, int[] ypoints, int npoints)
- {
- this.xpoints = new int[npoints];
- this.ypoints = new int[npoints];
- System.arraycopy(xpoints, 0, this.xpoints, 0, npoints);
- System.arraycopy(ypoints, 0, this.ypoints, 0, npoints);
- this.npoints = npoints;
- }
-
- /**
- * Reset the polygon to be empty. The arrays are left alone, to avoid object
- * allocation, but the number of points is set to 0, and all cached data
- * is discarded. If you are discarding a huge number of points, it may be
- * more efficient to just create a new Polygon.
- *
- * @see #invalidate()
- * @since 1.4
- */
- public void reset()
- {
- npoints = 0;
- invalidate();
- }
-
- /**
- * Invalidate or flush all cached data. After direct manipulation of the
- * public member fields, this is necessary to avoid inconsistent results
- * in methods like <code>contains</code>.
- *
- * @see #getBounds()
- * @since 1.4
- */
- public void invalidate()
- {
- bounds = null;
- }
-
- /**
- * Translates the polygon by adding the specified values to all X and Y
- * coordinates. This updates the bounding box, if it has been calculated.
- *
- * @param dx the amount to add to all X coordinates
- * @param dy the amount to add to all Y coordinates
- * @since 1.1
- */
- public void translate(int dx, int dy)
- {
- int i = npoints;
- while (--i >= 0)
- {
- xpoints[i] += dx;
- ypoints[i] += dy;
- }
- if (bounds != null)
- {
- bounds.x += dx;
- bounds.y += dy;
- }
- }
-
- /**
- * Adds the specified endpoint to the polygon. This updates the bounding
- * box, if it has been created.
- *
- * @param x the X coordinate of the point to add
- * @param y the Y coordiante of the point to add
- */
- public void addPoint(int x, int y)
- {
- if (npoints + 1 > xpoints.length)
- {
- int[] newx = new int[npoints + 1];
- System.arraycopy(xpoints, 0, newx, 0, npoints);
- xpoints = newx;
- }
- if (npoints + 1 > ypoints.length)
- {
- int[] newy = new int[npoints + 1];
- System.arraycopy(ypoints, 0, newy, 0, npoints);
- ypoints = newy;
- }
- xpoints[npoints] = x;
- ypoints[npoints] = y;
- npoints++;
- if (bounds != null)
- {
- if (npoints == 1)
- {
- bounds.x = x;
- bounds.y = y;
- }
- else
- {
- if (x < bounds.x)
- {
- bounds.width += bounds.x - x;
- bounds.x = x;
- }
- else if (x > bounds.x + bounds.width)
- bounds.width = x - bounds.x;
- if (y < bounds.y)
- {
- bounds.height += bounds.y - y;
- bounds.y = y;
- }
- else if (y > bounds.y + bounds.height)
- bounds.height = y - bounds.y;
- }
- }
- }
-
- /**
- * Returns the bounding box of this polygon. This is the smallest
- * rectangle with sides parallel to the X axis that will contain this
- * polygon.
- *
- * @return the bounding box for this polygon
- * @see #getBounds2D()
- * @since 1.1
- */
- public Rectangle getBounds()
- {
- return getBoundingBox();
- }
-
- /**
- * Returns the bounding box of this polygon. This is the smallest
- * rectangle with sides parallel to the X axis that will contain this
- * polygon.
- *
- * @return the bounding box for this polygon
- * @see #getBounds2D()
- * @deprecated use {@link #getBounds()} instead
- */
- public Rectangle getBoundingBox()
- {
- if (bounds == null)
- {
- if (npoints == 0)
- return bounds = new Rectangle();
- int i = npoints - 1;
- int minx = xpoints[i];
- int maxx = minx;
- int miny = ypoints[i];
- int maxy = miny;
- while (--i >= 0)
- {
- int x = xpoints[i];
- int y = ypoints[i];
- if (x < minx)
- minx = x;
- else if (x > maxx)
- maxx = x;
- if (y < miny)
- miny = y;
- else if (y > maxy)
- maxy = y;
- }
- bounds = new Rectangle(minx, miny, maxx - minx, maxy - miny);
- }
- return bounds;
- }
-
- /**
- * Tests whether or not the specified point is inside this polygon.
- *
- * @param p the point to test
- * @return true if the point is inside this polygon
- * @throws NullPointerException if p is null
- * @see #contains(double, double)
- */
- public boolean contains(Point p)
- {
- return contains(p.getX(), p.getY());
- }
-
- /**
- * Tests whether or not the specified point is inside this polygon.
- *
- * @param x the X coordinate of the point to test
- * @param y the Y coordinate of the point to test
- * @return true if the point is inside this polygon
- * @see #contains(double, double)
- * @since 1.1
- */
- public boolean contains(int x, int y)
- {
- return contains((double) x, (double) y);
- }
-
- /**
- * Tests whether or not the specified point is inside this polygon.
- *
- * @param x the X coordinate of the point to test
- * @param y the Y coordinate of the point to test
- * @return true if the point is inside this polygon
- * @see #contains(double, double)
- * @deprecated use {@link #contains(int, int)} instead
- */
- public boolean inside(int x, int y)
- {
- return contains((double) x, (double) y);
- }
-
- /**
- * Returns a high-precision bounding box of this polygon. This is the
- * smallest rectangle with sides parallel to the X axis that will contain
- * this polygon.
- *
- * @return the bounding box for this polygon
- * @see #getBounds()
- * @since 1.2
- */
- public Rectangle2D getBounds2D()
- {
- // For polygons, the integer version is exact!
- return getBounds();
- }
-
- /**
- * Tests whether or not the specified point is inside this polygon.
- *
- * @param x the X coordinate of the point to test
- * @param y the Y coordinate of the point to test
- * @return true if the point is inside this polygon
- * @since 1.2
- */
- public boolean contains(double x, double y)
- {
- return ((evaluateCrossings(x, y, false, BIG_VALUE) & 1) != 0);
- }
-
- /**
- * Tests whether or not the specified point is inside this polygon.
- *
- * @param p the point to test
- * @return true if the point is inside this polygon
- * @throws NullPointerException if p is null
- * @see #contains(double, double)
- * @since 1.2
- */
- public boolean contains(Point2D p)
- {
- return contains(p.getX(), p.getY());
- }
-
- /**
- * Test if a high-precision rectangle intersects the shape. This is true
- * if any point in the rectangle is in the shape. This implementation is
- * precise.
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle, treated as point if negative
- * @param h the height of the rectangle, treated as point if negative
- * @return true if the rectangle intersects this shape
- * @since 1.2
- */
- public boolean intersects(double x, double y, double w, double h)
- {
- /* Does any edge intersect? */
- if (evaluateCrossings(x, y, false, w) != 0 /* top */
- || evaluateCrossings(x, y + h, false, w) != 0 /* bottom */
- || evaluateCrossings(x + w, y, true, h) != 0 /* right */
- || evaluateCrossings(x, y, true, h) != 0) /* left */
- return true;
-
- /* No intersections, is any point inside? */
- if ((evaluateCrossings(x, y, false, BIG_VALUE) & 1) != 0)
- return true;
-
- return false;
- }
-
- /**
- * Test if a high-precision rectangle intersects the shape. This is true
- * if any point in the rectangle is in the shape. This implementation is
- * precise.
- *
- * @param r the rectangle
- * @return true if the rectangle intersects this shape
- * @throws NullPointerException if r is null
- * @see #intersects(double, double, double, double)
- * @since 1.2
- */
- public boolean intersects(Rectangle2D r)
- {
- return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Test if a high-precision rectangle lies completely in the shape. This is
- * true if all points in the rectangle are in the shape. This implementation
- * is precise.
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle, treated as point if negative
- * @param h the height of the rectangle, treated as point if negative
- * @return true if the rectangle is contained in this shape
- * @since 1.2
- */
- public boolean contains(double x, double y, double w, double h)
- {
- if (! getBounds2D().intersects(x, y, w, h))
- return false;
-
- /* Does any edge intersect? */
- if (evaluateCrossings(x, y, false, w) != 0 /* top */
- || evaluateCrossings(x, y + h, false, w) != 0 /* bottom */
- || evaluateCrossings(x + w, y, true, h) != 0 /* right */
- || evaluateCrossings(x, y, true, h) != 0) /* left */
- return false;
-
- /* No intersections, is any point inside? */
- if ((evaluateCrossings(x, y, false, BIG_VALUE) & 1) != 0)
- return true;
-
- return false;
- }
-
- /**
- * Test if a high-precision rectangle lies completely in the shape. This is
- * true if all points in the rectangle are in the shape. This implementation
- * is precise.
- *
- * @param r the rectangle
- * @return true if the rectangle is contained in this shape
- * @throws NullPointerException if r is null
- * @see #contains(double, double, double, double)
- * @since 1.2
- */
- public boolean contains(Rectangle2D r)
- {
- return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Return an iterator along the shape boundary. If the optional transform
- * is provided, the iterator is transformed accordingly. Each call returns
- * a new object, independent from others in use. This class is not
- * threadsafe to begin with, so the path iterator is not either.
- *
- * @param transform an optional transform to apply to the iterator
- * @return a new iterator over the boundary
- * @since 1.2
- */
- public PathIterator getPathIterator(final AffineTransform transform)
- {
- return new PathIterator()
- {
- /** The current vertex of iteration. */
- private int vertex;
-
- public int getWindingRule()
- {
- return WIND_EVEN_ODD;
- }
-
- public boolean isDone()
- {
- return vertex > npoints;
- }
-
- public void next()
- {
- vertex++;
- }
-
- public int currentSegment(float[] coords)
- {
- if (vertex >= npoints)
- return SEG_CLOSE;
- coords[0] = xpoints[vertex];
- coords[1] = ypoints[vertex];
- if (transform != null)
- transform.transform(coords, 0, coords, 0, 1);
- return vertex == 0 ? SEG_MOVETO : SEG_LINETO;
- }
-
- public int currentSegment(double[] coords)
- {
- if (vertex >= npoints)
- return SEG_CLOSE;
- coords[0] = xpoints[vertex];
- coords[1] = ypoints[vertex];
- if (transform != null)
- transform.transform(coords, 0, coords, 0, 1);
- return vertex == 0 ? SEG_MOVETO : SEG_LINETO;
- }
- };
- }
-
- /**
- * Return an iterator along the flattened version of the shape boundary.
- * Since polygons are already flat, the flatness parameter is ignored, and
- * the resulting iterator only has SEG_MOVETO, SEG_LINETO and SEG_CLOSE
- * points. If the optional transform is provided, the iterator is
- * transformed accordingly. Each call returns a new object, independent
- * from others in use. This class is not threadsafe to begin with, so the
- * path iterator is not either.
- *
- * @param transform an optional transform to apply to the iterator
- * @param flatness the maximum distance for deviation from the real boundary
- * @return a new iterator over the boundary
- * @since 1.2
- */
- public PathIterator getPathIterator(AffineTransform transform,
- double flatness)
- {
- return getPathIterator(transform);
- }
-
- /**
- * Helper for contains, intersects, calculates the number of intersections
- * between the polygon and a line extending from the point (x, y) along
- * the positive X, or Y axis, within a given interval.
- *
- * @return the winding number.
- * @see #condensed
- * @see #contains(double, double)
- */
- private int evaluateCrossings(double x, double y, boolean useYaxis,
- double distance)
- {
- double x0;
- double x1;
- double y0;
- double y1;
- double epsilon = 0.0;
- int crossings = 0;
- int[] xp;
- int[] yp;
-
- if (useYaxis)
- {
- xp = ypoints;
- yp = xpoints;
- double swap;
- swap = y;
- y = x;
- x = swap;
- }
- else
- {
- xp = xpoints;
- yp = ypoints;
- }
-
- /* Get a value which is small but not insignificant relative the path. */
- epsilon = 1E-7;
-
- x0 = xp[0] - x;
- y0 = yp[0] - y;
- for (int i = 1; i < npoints; i++)
- {
- x1 = xp[i] - x;
- y1 = yp[i] - y;
-
- if (y0 == 0.0)
- y0 -= epsilon;
- if (y1 == 0.0)
- y1 -= epsilon;
- if (y0 * y1 < 0)
- if (Line2D.linesIntersect(x0, y0, x1, y1, epsilon, 0.0, distance, 0.0))
- ++crossings;
-
- x0 = xp[i] - x;
- y0 = yp[i] - y;
- }
-
- // end segment
- x1 = xp[0] - x;
- y1 = yp[0] - y;
- if (y0 == 0.0)
- y0 -= epsilon;
- if (y1 == 0.0)
- y1 -= epsilon;
- if (y0 * y1 < 0)
- if (Line2D.linesIntersect(x0, y0, x1, y1, epsilon, 0.0, distance, 0.0))
- ++crossings;
-
- return crossings;
- }
-} // class Polygon
-
diff --git a/libjava/java/awt/PopupMenu.java b/libjava/java/awt/PopupMenu.java
deleted file mode 100644
index 90d48d903b9..00000000000
--- a/libjava/java/awt/PopupMenu.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/* PopupMenu.java -- An AWT popup menu
- Copyright (C) 1999, 2000, 2001, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.peer.PopupMenuPeer;
-
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * This class implement an AWT popup menu widget
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class PopupMenu extends Menu
-{
-
-/*
- * Static Variables
- */
-
-// Serialization Constant
-private static final long serialVersionUID = -4620452533522760060L;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>PopupMenu</code>.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
-public
-PopupMenu()
-{
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>PopupMenu</code> with the specified
- * label.
- *
- * @param label The label for this popup menu.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
-public
-PopupMenu(String label)
-{
- super(label);
-
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Creates this object's native peer.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createPopupMenu (this);
- super.addNotify ();
-}
-
-/*************************************************************************/
-
-/**
- * Displays this popup menu at the specified coordinates relative to
- * the specified component.
- *
- * @param component The component to which the display coordinates are relative.
- * @param x The X coordinate of the menu.
- * @param y The Y coordinate of the menu.
- */
-public void
-show(Component component, int x, int y)
-{
- if (getPeer() == null)
- this.addNotify();
- PopupMenuPeer pmp = (PopupMenuPeer)getPeer();
- if (pmp != null)
- {
- /* XXX
- Event e = new Event (component, Event.ACTION_EVENT, component);
- e.x = x;
- e.y = y;*/
- pmp.show (component, x, y);
- }
-}
-
- protected class AccessibleAWTPopupMenu extends AccessibleAWTMenu
- {
- protected AccessibleAWTPopupMenu()
- {
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.POPUP_MENU;
- }
-
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>PopupMenu</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTPopupMenu();
- return accessibleContext;
- }
-
-} // class PopupMenu
-
diff --git a/libjava/java/awt/PrintGraphics.java b/libjava/java/awt/PrintGraphics.java
deleted file mode 100644
index e7f857797d3..00000000000
--- a/libjava/java/awt/PrintGraphics.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* PrintGraphics.java -- a print graphics context
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This interface allows the originating print job to be obtained.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.0
- * @status updated to 1.4
- */
-public interface PrintGraphics
-{
- /**
- * Returns the <code>PrintJob</code> that this object is being
- * managed by.
- *
- * @return the print job for this object
- */
- PrintJob getPrintJob();
-} // interface PrintGraphics
diff --git a/libjava/java/awt/PrintJob.java b/libjava/java/awt/PrintJob.java
deleted file mode 100644
index 09b85acceac..00000000000
--- a/libjava/java/awt/PrintJob.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* PrintJob.java -- A print job class
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This abstract class represents a print job.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Toolkit#getPrintJob(Frame, String, Properties)
- * @since 1.0
- * @status updated to 1.4
- */
-public abstract class PrintJob
-{
- /**
- * Create a new PrintJob.
- */
- public PrintJob()
- {
- }
-
- /**
- * Returns a graphics context suitable for rendering the next page. The
- * return must also implement {@link PrintGraphics}.
- *
- * @return a graphics context for printing the next page
- */
- public abstract Graphics getGraphics();
-
- /**
- * Returns the dimension of the page in pixels. The resolution will be
- * chosen to be similar to the on screen image.
- *
- * @return the page dimensions
- */
- public abstract Dimension getPageDimension();
-
- /**
- * Returns the resolution of the page in pixels per inch. Note that this is
- * not necessarily the printer's resolution.
- *
- * @return the resolution of the page in pixels per inch
- */
- public abstract int getPageResolution();
-
- /**
- * Tests whether or not the last page will be printed first.
- *
- * @return true if the last page prints first
- */
- public abstract boolean lastPageFirst();
-
- /**
- * Informs the print job that printing is complete or should be aborted.
- */
- public abstract void end();
-
- /**
- * This method explicitly ends the print job in the event the job
- * becomes un-referenced without the application having done so.
- */
- public void finalize()
- {
- end();
- }
-} // class PrintJob
diff --git a/libjava/java/awt/Rectangle.java b/libjava/java/awt/Rectangle.java
deleted file mode 100644
index 0f21d495cd8..00000000000
--- a/libjava/java/awt/Rectangle.java
+++ /dev/null
@@ -1,749 +0,0 @@
-/* Rectangle.java -- represents a graphics rectangle
- Copyright (C) 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.geom.Rectangle2D;
-import java.io.Serializable;
-
-/**
- * This class represents a rectangle and all the interesting things you
- * might want to do with it. Note that the coordinate system uses
- * the origin (0,0) as the top left of the screen, with the x and y
- * values increasing as they move to the right and down respectively.
- *
- * <p>It is valid for a rectangle to have negative width or height; but it
- * is considered to have no area or internal points. Therefore, the behavior
- * in methods like <code>contains</code> or <code>intersects</code> is
- * undefined unless the rectangle has positive width and height.
- *
- * <p>There are some public fields; if you mess with them in an inconsistent
- * manner, it is your own fault when you get NullPointerException,
- * ArrayIndexOutOfBoundsException, or invalid results. Also, this class is
- * not threadsafe.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status updated to 1.4
- */
-public class Rectangle extends Rectangle2D implements Shape, Serializable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -4345857070255674764L;
-
- /**
- * The X coordinate of the top-left corner of the rectangle.
- *
- * @see #setLocation(int, int)
- * @see #getLocation()
- * @serial the x coordinate
- */
- public int x;
-
- /**
- * The Y coordinate of the top-left corner of the rectangle.
- *
- * @see #setLocation(int, int)
- * @see #getLocation()
- * @serial the y coordinate
- */
- public int y;
-
- /**
- * The width of the rectangle.
- *
- * @see #setSize(int, int)
- * @see #getSize()
- * @serial
- */
- public int width;
-
- /**
- * The height of the rectangle.
- *
- * @see #setSize(int, int)
- * @see #getSize()
- * @serial
- */
- public int height;
-
- /**
- * Initializes a new instance of <code>Rectangle</code> with a top
- * left corner at (0,0) and a width and height of 0.
- */
- public Rectangle()
- {
- }
-
- /**
- * Initializes a new instance of <code>Rectangle</code> from the
- * coordinates of the specified rectangle.
- *
- * @param r the rectangle to copy from
- * @throws NullPointerException if r is null
- * @since 1.1
- */
- public Rectangle(Rectangle r)
- {
- x = r.x;
- y = r.y;
- width = r.width;
- height = r.height;
- }
-
- /**
- * Initializes a new instance of <code>Rectangle</code> from the specified
- * inputs.
- *
- * @param x the X coordinate of the top left corner
- * @param y the Y coordinate of the top left corner
- * @param width the width of the rectangle
- * @param height the height of the rectangle
- */
- public Rectangle(int x, int y, int width, int height)
- {
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- }
-
- /**
- * Initializes a new instance of <code>Rectangle</code> with the specified
- * width and height. The upper left corner of the rectangle will be at
- * the origin (0,0).
- *
- * @param width the width of the rectangle
- * @param height the height of the rectange
- */
- public Rectangle(int width, int height)
- {
- this.width = width;
- this.height = height;
- }
-
- /**
- * Initializes a new instance of <code>Rectangle</code> with a top-left
- * corner represented by the specified point and the width and height
- * represented by the specified dimension.
- *
- * @param p the upper left corner of the rectangle
- * @param d the width and height of the rectangle
- * @throws NullPointerException if p or d is null
- */
- public Rectangle(Point p, Dimension d)
- {
- x = p.x;
- y = p.y;
- width = d.width;
- height = d.height;
- }
-
- /**
- * Initializes a new instance of <code>Rectangle</code> with a top left
- * corner at the specified point and a width and height of zero.
- *
- * @param p the upper left corner of the rectangle
- */
- public Rectangle(Point p)
- {
- x = p.x;
- y = p.y;
- }
-
- /**
- * Initializes a new instance of <code>Rectangle</code> with an
- * upper left corner at the origin (0,0) and a width and height represented
- * by the specified dimension.
- *
- * @param d the width and height of the rectangle
- */
- public Rectangle(Dimension d)
- {
- width = d.width;
- height = d.height;
- }
-
- /**
- * Get the X coordinate of the upper-left corner.
- *
- * @return the value of x, as a double
- */
- public double getX()
- {
- return x;
- }
-
- /**
- * Get the Y coordinate of the upper-left corner.
- *
- * @return the value of y, as a double
- */
- public double getY()
- {
- return y;
- }
-
- /**
- * Get the width of the rectangle.
- *
- * @return the value of width, as a double
- */
- public double getWidth()
- {
- return width;
- }
-
- /**
- * Get the height of the rectangle.
- *
- * @return the value of height, as a double
- */
- public double getHeight()
- {
- return height;
- }
-
- /**
- * Returns the bounds of this rectangle. A pretty useless method, as this
- * is already a rectangle; it is included to mimic the
- * <code>getBounds</code> method in Component.
- *
- * @return a copy of this rectangle
- * @see #setBounds(Rectangle)
- * @since 1.1
- */
- public Rectangle getBounds()
- {
- return new Rectangle(this);
- }
-
- /**
- * Returns the high-precision bounds of this rectangle. A pretty useless
- * method, as this is already a rectangle.
- *
- * @return a copy of this rectangle
- * @see #setBounds(Rectangle)
- * @since 1.2
- */
- public Rectangle2D getBounds2D()
- {
- return new Rectangle(x, y, width, height);
- }
-
- /**
- * Updates this rectangle to match the dimensions of the specified
- * rectangle.
- *
- * @param r the rectangle to update from
- * @throws NullPointerException if r is null
- * @see #setBounds(int, int, int, int)
- * @since 1.1
- */
- public void setBounds(Rectangle r)
- {
- setBounds (r.x, r.y, r.width, r.height);
- }
-
- /**
- * Updates this rectangle to have the specified dimensions.
- *
- * @param x the new X coordinate of the upper left hand corner
- * @param y the new Y coordinate of the upper left hand corner
- * @param width the new width of this rectangle
- * @param height the new height of this rectangle
- * @since 1.1
- */
- public void setBounds(int x, int y, int width, int height)
- {
- reshape (x, y, width, height);
- }
-
- /**
- * Updates this rectangle to have the specified dimensions, as rounded to
- * integers.
- *
- * @param x the new X coordinate of the upper left hand corner
- * @param y the new Y coordinate of the upper left hand corner
- * @param width the new width of this rectangle
- * @param height the new height of this rectangle
- * @since 1.2
- */
- public void setRect(double x, double y, double width, double height)
- {
- this.x = (int) x;
- this.y = (int) y;
- this.width = (int) width;
- this.height = (int) height;
- }
-
- /**
- * Updates this rectangle to have the specified dimensions.
- *
- * @param x the new X coordinate of the upper left hand corner
- * @param y the new Y coordinate of the upper left hand corner
- * @param width the new width of this rectangle
- * @param height the new height of this rectangle
- * @deprecated use {@link #setBounds(int, int, int, int)} instead
- */
- public void reshape(int x, int y, int width, int height)
- {
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- }
-
- /**
- * Returns the location of this rectangle, which is the coordinates of
- * its upper left corner.
- *
- * @return the point where this rectangle is located
- * @see #setLocation(Point)
- * @since 1.1
- */
- public Point getLocation()
- {
- return new Point(x,y);
- }
-
- /**
- * Moves the location of this rectangle by setting its upper left
- * corner to the specified point.
- *
- * @param p the point to move the rectangle to
- * @throws NullPointerException if p is null
- * @see #getLocation()
- * @since 1.1
- */
- public void setLocation(Point p)
- {
- setLocation (p.x, p.y);
- }
-
- /**
- * Moves the location of this rectangle by setting its upper left
- * corner to the specified coordinates.
- *
- * @param x the new X coordinate for this rectangle
- * @param y the new Y coordinate for this rectangle
- * @since 1.1
- */
- public void setLocation(int x, int y)
- {
- move (x, y);
- }
-
- /**
- * Moves the location of this rectangle by setting its upper left
- * corner to the specified coordinates.
- *
- * @param x the new X coordinate for this rectangle
- * @param y the new Y coordinate for this rectangle
- * @deprecated use {@link #setLocation(int, int)} instead
- */
- public void move(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
-
- /**
- * Translate the location of this rectangle by the given amounts.
- *
- * @param dx the x distance to move by
- * @param dy the y distance to move by
- * @see #setLocation(int, int)
- */
- public void translate(int dx, int dy)
- {
- x += dx;
- y += dy;
- }
-
- /**
- * Returns the size of this rectangle.
- *
- * @return the size of this rectangle
- * @see #setSize(Dimension)
- * @since 1.1
- */
- public Dimension getSize()
- {
- return new Dimension(width, height);
- }
-
- /**
- * Sets the size of this rectangle based on the specified dimensions.
- *
- * @param d the new dimensions of the rectangle
- * @throws NullPointerException if d is null
- * @see #getSize()
- * @since 1.1
- */
- public void setSize(Dimension d)
- {
- setSize (d.width, d.height);
- }
-
- /**
- * Sets the size of this rectangle based on the specified dimensions.
- *
- * @param width the new width of the rectangle
- * @param height the new height of the rectangle
- * @since 1.1
- */
- public void setSize(int width, int height)
- {
- resize (width, height);
- }
-
- /**
- * Sets the size of this rectangle based on the specified dimensions.
- *
- * @param width the new width of the rectangle
- * @param height the new height of the rectangle
- * @deprecated use {@link #setSize(int, int)} instead
- */
- public void resize(int width, int height)
- {
- this.width = width;
- this.height = height;
- }
-
- /**
- * Tests whether or not the specified point is inside this rectangle.
- * According to the contract of Shape, a point on the border is in only if
- * it has an adjacent point inside the rectangle in either the increasing
- * x or y direction.
- *
- * @param p the point to test
- * @return true if the point is inside the rectangle
- * @throws NullPointerException if p is null
- * @see #contains(int, int)
- * @since 1.1
- */
- public boolean contains(Point p)
- {
- return contains (p.x, p.y);
- }
-
- /**
- * Tests whether or not the specified point is inside this rectangle.
- * According to the contract of Shape, a point on the border is in only if
- * it has an adjacent point inside the rectangle in either the increasing
- * x or y direction.
- *
- * @param x the X coordinate of the point to test
- * @param y the Y coordinate of the point to test
- * @return true if the point is inside the rectangle
- * @since 1.1
- */
- public boolean contains(int x, int y)
- {
- return inside (x, y);
- }
-
- /**
- * Checks whether all points in the given rectangle are contained in this
- * rectangle.
- *
- * @param r the rectangle to check
- * @return true if r is contained in this rectangle
- * @throws NullPointerException if r is null
- * @see #contains(int, int, int, int)
- * @since 1.1
- */
- public boolean contains(Rectangle r)
- {
- return contains (r.x, r.y, r.width, r.height);
- }
-
- /**
- * Checks whether all points in the given rectangle are contained in this
- * rectangle.
- *
- * @param x the x coordinate of the rectangle to check
- * @param y the y coordinate of the rectangle to check
- * @param w the width of the rectangle to check
- * @param h the height of the rectangle to check
- * @return true if the parameters are contained in this rectangle
- * @since 1.1
- */
- public boolean contains(int x, int y, int w, int h)
- {
- return width > 0 && height > 0 && w > 0 && h > 0
- && x >= this.x && x + w <= this.x + this.width
- && y >= this.y && y + h <= this.y + this.height;
- }
-
- /**
- * Tests whether or not the specified point is inside this rectangle.
- *
- * @param x the X coordinate of the point to test
- * @param y the Y coordinate of the point to test
- * @return true if the point is inside the rectangle
- * @deprecated use {@link #contains(int, int)} instead
- */
- public boolean inside(int x, int y)
- {
- return width > 0 && height > 0
- && x >= this.x && x < this.x + width
- && y >= this.y && y < this.y + height;
- }
-
- /**
- * Tests whether or not the specified rectangle intersects this rectangle.
- * This means the two rectangles share at least one internal point.
- *
- * @param r the rectangle to test against
- * @return true if the specified rectangle intersects this one
- * @throws NullPointerException if r is null
- * @since 1.2
- */
- public boolean intersects(Rectangle r)
- {
- return r.width > 0 && r.height > 0 && width > 0 && height > 0
- && r.x < x + width && r.x + r.width > x
- && r.y < y + height && r.y + r.height > y;
- }
-
- /**
- * Determines the rectangle which is formed by the intersection of this
- * rectangle with the specified rectangle. If the two do not intersect,
- * an empty rectangle will be returned (meaning the width and/or height
- * will be non-positive).
- *
- * @param r the rectange to calculate the intersection with
- * @return a new rectangle bounding the intersection
- * @throws NullPointerException if r is null
- */
- public Rectangle intersection(Rectangle r)
- {
- Rectangle res = new Rectangle();
- intersect(this, r, res);
- return res;
- }
-
- /**
- * Returns the smallest rectangle that contains both this rectangle
- * and the specified rectangle.
- *
- * @param r the rectangle to compute the union with
- * @return the smallest rectangle containing both rectangles
- * @throws NullPointerException if r is null
- */
- public Rectangle union(Rectangle r)
- {
- Rectangle res = new Rectangle();
- union(this, r, res);
- return res;
- }
-
- /**
- * Modifies this rectangle so that it represents the smallest rectangle
- * that contains both the existing rectangle and the specified point.
- * However, if the point falls on one of the two borders which are not
- * inside the rectangle, a subsequent call to <code>contains</code> may
- * return false.
- *
- * @param x the X coordinate of the point to add to this rectangle
- * @param y the Y coordinate of the point to add to this rectangle
- */
- public void add(int x, int y)
- {
- add((double) x, (double) y);
- }
-
- /**
- * Modifies this rectangle so that it represents the smallest rectangle
- * that contains both the existing rectangle and the specified point.
- * However, if the point falls on one of the two borders which are not
- * inside the rectangle, a subsequent call to <code>contains</code> may
- * return false.
- *
- * @param p the point to add to this rectangle
- * @throws NullPointerException if p is null
- */
- public void add(Point p)
- {
- add((double) p.x, (double) p.y);
- }
-
- /**
- * Modifies this rectangle so that it represents the smallest rectangle
- * that contains both the existing rectangle and the specified rectangle.
- *
- * @param r the rectangle to add to this rectangle
- * @throws NullPointerException if r is null
- * @see #union(Rectangle)
- */
- public void add(Rectangle r)
- {
- union(this, r, this);
- }
-
- /**
- * Expands the rectangle by the specified amount. The horizontal
- * and vertical expansion values are applied both to the X,Y coordinate
- * of this rectangle, and its width and height. Thus the width and
- * height will increase by 2h and 2v accordingly.
- *
- * @param h the horizontal expansion value
- * @param v the vertical expansion value
- */
- public void grow(int h, int v)
- {
- x -= h;
- y -= v;
- width += h + h;
- height += v + v;
- }
-
- /**
- * Tests whether or not this rectangle is empty. An empty rectangle
- * has a non-positive width or height.
- *
- * @return true if the rectangle is empty
- */
- public boolean isEmpty()
- {
- return width <= 0 || height <= 0;
- }
-
- /**
- * Determine where the point lies with respect to this rectangle. The
- * result will be the binary OR of the appropriate bit masks.
- *
- * @param x the x coordinate to check
- * @param y the y coordinate to check
- * @return the binary OR of the result
- * @see #OUT_LEFT
- * @see #OUT_TOP
- * @see #OUT_RIGHT
- * @see #OUT_BOTTOM
- * @since 1.2
- */
- public int outcode(double x, double y)
- {
- int result = 0;
- if (width <= 0)
- result |= OUT_LEFT | OUT_RIGHT;
- else if (x < this.x)
- result |= OUT_LEFT;
- else if (x > this.x + width)
- result |= OUT_RIGHT;
- if (height <= 0)
- result |= OUT_BOTTOM | OUT_TOP;
- else if (y < this.y) // Remember that +y heads top-to-bottom.
- result |= OUT_TOP;
- else if (y > this.y + height)
- result |= OUT_BOTTOM;
- return result;
- }
-
- /**
- * Determines the rectangle which is formed by the intersection of this
- * rectangle with the specified rectangle. If the two do not intersect,
- * an empty rectangle will be returned (meaning the width and/or height
- * will be non-positive).
- *
- * @param r the rectange to calculate the intersection with
- * @return a new rectangle bounding the intersection
- * @throws NullPointerException if r is null
- * @since 1.2
- */
- public Rectangle2D createIntersection(Rectangle2D r)
- {
- // Favor runtime type of other rectangle.
- Rectangle2D res = r.getBounds2D();
- intersect(this, r, res);
- return res;
- }
-
- /**
- * Returns the smallest rectangle that contains both this rectangle
- * and the specified rectangle.
- *
- * @param r the rectangle to compute the union with
- * @return the smallest rectangle containing both rectangles
- * @throws NullPointerException if r is null
- * @since 1.2
- */
- public Rectangle2D createUnion(Rectangle2D r)
- {
- // Favor runtime type of other rectangle.
- Rectangle2D res = r.getBounds2D();
- union(this, r, res);
- return res;
- }
-
- /**
- * Tests this rectangle for equality against the specified object. This
- * will be true if an only if the specified object is an instance of
- * Rectangle2D with the same coordinates and dimensions.
- *
- * @param obj the object to test against for equality
- * @return true if the specified object is equal to this one
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof Rectangle2D))
- return false;
- Rectangle2D r = (Rectangle2D) obj;
- return r.getX() == x && r.getY() == y
- && r.getWidth() == width && r.getHeight() == height;
- }
-
- /**
- * Returns a string representation of this rectangle. This is in the form
- * <code>getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width
- * + ",height=" + height + ']'</code>.
- *
- * @return a string representation of this rectangle
- */
- public String toString()
- {
- return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width
- + ",height=" + height + ']';
- }
-} // class Rectangle
diff --git a/libjava/java/awt/RenderingHints.java b/libjava/java/awt/RenderingHints.java
deleted file mode 100644
index 61e69f6b4bb..00000000000
--- a/libjava/java/awt/RenderingHints.java
+++ /dev/null
@@ -1,793 +0,0 @@
-/* RenderingHints.java --
- Copyright (C) 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A collection of (key, value) items that provide 'hints' for the
- * {@link java.awt.Graphics2D} rendering pipeline. Because these
- * items are hints only, they may be ignored by a particular
- * {@link java.awt.Graphics2D} implementation.
- *
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- * @author Eric Blake (ebb9@email.byu.edu)
- */
-public class RenderingHints implements Map, Cloneable
-{
- /**
- * The base class used to represent keys.
- */
- public abstract static class Key
- {
- private final int key;
-
- /**
- * Creates a new key.
- *
- * @param privateKey the private key.
- */
- protected Key(int privateKey)
- {
- key = privateKey;
- }
-
- /**
- * Returns <code>true</code> if the specified value is compatible with
- * this key, and <code>false</code> otherwise.
- *
- * @param value the value (<code>null</code> permitted).
- *
- * @return A boolean.
- */
- public abstract boolean isCompatibleValue(Object value);
-
- /**
- * Returns the private key for this instance.
- *
- * @return The private key.
- */
- protected final int intKey()
- {
- return key;
- }
-
- /**
- * Returns a hash code for the key.
- *
- * @return A hash code.
- */
- public final int hashCode()
- {
- return System.identityHashCode(this);
- }
-
- /**
- * Checks this key for equality with an arbitrary object.
- *
- * @param other the object (<code>null</code> permitted)
- *
- * @return A boolean.
- */
- public final boolean equals(Object other)
- {
- return this == other;
- }
- } // class Key
-
- private static final class KeyImpl extends Key
- {
- final String description;
- final Object v1;
- final Object v2;
- final Object v3;
-
- KeyImpl(int privateKey, String description,
- Object v1, Object v2, Object v3)
- {
- super(privateKey);
- this.description = description;
- this.v1 = v1;
- this.v2 = v2;
- this.v3 = v3;
- }
-
- /**
- * Returns <code>true</code> if the specified value is compatible with
- * this key, and <code>false</code> otherwise.
- *
- * @param value the value (<code>null</code> permitted).
- *
- * @return A boolean.
- */
- public boolean isCompatibleValue(Object value)
- {
- return value == v1 || value == v2 || value == v3;
- }
-
- /**
- * Returns a string representation of the key.
- *
- * @return A string.
- */
- public String toString()
- {
- return description;
- }
- } // class KeyImpl
-
- private HashMap hintMap = new HashMap();
-
- /**
- * A key for the 'antialiasing' hint. Permitted values are:
- * <p>
- * <table>
- * <tr>
- * <td>{@link #VALUE_ANTIALIAS_OFF}</td>
- * <td>Render without antialiasing (better speed).</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_ANTIALIAS_ON}</td>
- * <td>Render with antialiasing (better quality).</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_ANTIALIAS_DEFAULT}</td>
- * <td>Use the default value for antialiasing.</td>
- * </tr>
- * </table>
- */
- public static final Key KEY_ANTIALIASING;
-
- /**
- * This value is for use with the {@link #KEY_ANTIALIASING} key.
- */
- public static final Object VALUE_ANTIALIAS_ON
- = "Antialiased rendering mode";
-
- /**
- * This value is for use with the {@link #KEY_ANTIALIASING} key.
- */
- public static final Object VALUE_ANTIALIAS_OFF
- = "Nonantialiased rendering mode";
-
- /**
- * This value is for use with the {@link #KEY_ANTIALIASING} key.
- */
- public static final Object VALUE_ANTIALIAS_DEFAULT
- = "Default antialiasing rendering mode";
-
- /**
- * A key for the 'rendering' hint. Permitted values are:
- * <p>
- * <table>
- * <tr>
- * <td>{@link #VALUE_RENDER_SPEED}</td>
- * <td>Prefer speed over quality when rendering.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_RENDER_QUALITY}</td>
- * <td>Prefer quality over speed when rendering.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_RENDER_DEFAULT}</td>
- * <td>Use the default value for quality vs. speed when rendering.</td>
- * </tr>
- * </table>
- */
- public static final Key KEY_RENDERING;
-
- /**
- * This value is for use with the {@link #KEY_RENDERING} key.
- */
- public static final Object VALUE_RENDER_SPEED
- = "Fastest rendering methods";
-
- /**
- * This value is for use with the {@link #KEY_RENDERING} key.
- */
- public static final Object VALUE_RENDER_QUALITY
- = "Highest quality rendering methods";
-
- /**
- * This value is for use with the {@link #KEY_RENDERING} key.
- */
- public static final Object VALUE_RENDER_DEFAULT
- = "Default rendering methods";
-
- /**
- * A key for the 'dithering' hint. Permitted values are:
- * <p>
- * <table>
- * <tr>
- * <td>{@link #VALUE_DITHER_DISABLE}</td>
- * <td>Disable dithering.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_DITHER_ENABLE}</td>
- * <td>Enable dithering.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_DITHER_DEFAULT}</td>
- * <td>Use the default value for dithering.</td>
- * </tr>
- * </table>
- */
- public static final Key KEY_DITHERING;
-
- /**
- * This value is for use with the {@link #KEY_DITHERING} key.
- */
- public static final Object VALUE_DITHER_DISABLE
- = "Nondithered rendering mode";
-
- /**
- * This value is for use with the {@link #KEY_DITHERING} key.
- */
- public static final Object VALUE_DITHER_ENABLE
- = "Dithered rendering mode";
-
- /**
- * This value is for use with the {@link #KEY_DITHERING} key.
- */
- public static final Object VALUE_DITHER_DEFAULT
- = "Default dithering mode";
-
- /**
- * A key for the 'text antialiasing' hint. Permitted values are:
- * <p>
- * <table>
- * <tr>
- * <td>{@link #VALUE_TEXT_ANTIALIAS_ON}</td>
- * <td>Render text with antialiasing (better quality usually).</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_TEXT_ANTIALIAS_OFF}</td>
- * <td>Render test without antialiasing (better speed).</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_TEXT_ANTIALIAS_DEFAULT}</td>
- * <td>Use the default value for text antialiasing.</td>
- * </tr>
- * </table>
- */
- public static final Key KEY_TEXT_ANTIALIASING;
-
- /**
- * This value is for use with the {@link #KEY_TEXT_ANTIALIASING} key.
- */
- public static final Object VALUE_TEXT_ANTIALIAS_ON
- = "Antialiased text mode";
-
- /**
- * This value is for use with the {@link #KEY_TEXT_ANTIALIASING} key.
- */
- public static final Object VALUE_TEXT_ANTIALIAS_OFF
- = "Nonantialiased text mode";
-
- /**
- * This value is for use with the {@link #KEY_TEXT_ANTIALIASING} key.
- */
- public static final Object VALUE_TEXT_ANTIALIAS_DEFAULT
- = "Default antialiasing text mode";
-
- /**
- * A key for the 'fractional metrics' hint. Permitted values are:
- * <p>
- * <table>
- * <tr>
- * <td>{@link #VALUE_FRACTIONALMETRICS_OFF}</td>
- * <td>Render text with fractional metrics off.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_FRACTIONALMETRICS_ON}</td>
- * <td>Render text with fractional metrics on.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_FRACTIONALMETRICS_DEFAULT}</td>
- * <td>Use the default value for fractional metrics.</td>
- * </tr>
- * </table>
- */
- public static final Key KEY_FRACTIONALMETRICS;
-
- /**
- * This value is for use with the {@link #KEY_FRACTIONALMETRICS} key.
- */
- public static final Object VALUE_FRACTIONALMETRICS_OFF
- = "Integer text metrics mode";
-
- /**
- * This value is for use with the {@link #KEY_FRACTIONALMETRICS} key.
- */
- public static final Object VALUE_FRACTIONALMETRICS_ON
- = "Fractional text metrics mode";
-
- /**
- * This value is for use with the {@link #KEY_FRACTIONALMETRICS} key.
- */
- public static final Object VALUE_FRACTIONALMETRICS_DEFAULT
- = "Default fractional text metrics mode";
-
- /**
- * A key for the 'interpolation' hint. Permitted values are:
- * <p>
- * <table>
- * <tr>
- * <td>{@link #VALUE_INTERPOLATION_NEAREST_NEIGHBOR}</td>
- * <td>Use nearest neighbour interpolation.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_INTERPOLATION_BILINEAR}</td>
- * <td>Use bilinear interpolation.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_INTERPOLATION_BICUBIC}</td>
- * <td>Use bicubic interpolation.</td>
- * </tr>
- * </table>
- */
- public static final Key KEY_INTERPOLATION;
-
- /**
- * This value is for use with the {@link #KEY_INTERPOLATION} key.
- */
- public static final Object VALUE_INTERPOLATION_NEAREST_NEIGHBOR
- = "Nearest Neighbor image interpolation mode";
-
- /**
- * This value is for use with the {@link #KEY_INTERPOLATION} key.
- */
- public static final Object VALUE_INTERPOLATION_BILINEAR
- = "Bilinear image interpolation mode";
-
- /**
- * This value is for use with the {@link #KEY_INTERPOLATION} key.
- */
- public static final Object VALUE_INTERPOLATION_BICUBIC
- = "Bicubic image interpolation mode";
-
- /**
- * A key for the 'alpha interpolation' hint. Permitted values are:
- * <p>
- * <table>
- * <tr>
- * <td>{@link #VALUE_ALPHA_INTERPOLATION_SPEED}</td>
- * <td>Prefer speed over quality.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_ALPHA_INTERPOLATION_QUALITY}</td>
- * <td>Prefer quality over speed.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_ALPHA_INTERPOLATION_DEFAULT}</td>
- * <td>Use the default setting.</td>
- * </tr>
- * </table>
- */
- public static final Key KEY_ALPHA_INTERPOLATION;
-
- /**
- * This value is for use with the {@link #KEY_ALPHA_INTERPOLATION} key.
- */
- public static final Object VALUE_ALPHA_INTERPOLATION_SPEED
- = "Fastest alpha blending methods";
-
- /**
- * This value is for use with the {@link #KEY_ALPHA_INTERPOLATION} key.
- */
- public static final Object VALUE_ALPHA_INTERPOLATION_QUALITY
- = "Highest quality alpha blending methods";
-
- /**
- * This value is for use with the {@link #KEY_ALPHA_INTERPOLATION} key.
- */
- public static final Object VALUE_ALPHA_INTERPOLATION_DEFAULT
- = "Default alpha blending methods";
-
- /**
- * A key for the 'color rendering' hint. Permitted values are:
- * <p>
- * <table>
- * <tr>
- * <td>{@link #VALUE_COLOR_RENDER_SPEED}</td>
- * <td>Prefer speed over quality.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_COLOR_RENDER_QUALITY}</td>
- * <td>Prefer quality over speed.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_COLOR_RENDER_DEFAULT}</td>
- * <td>Use the default setting.</td>
- * </tr>
- * </table>
- */
- public static final Key KEY_COLOR_RENDERING;
-
- /**
- * This value is for use with the {@link #KEY_COLOR_RENDERING} key.
- */
- public static final Object VALUE_COLOR_RENDER_SPEED
- = "Fastest color rendering mode";
-
- /**
- * This value is for use with the {@link #KEY_COLOR_RENDERING} key.
- */
- public static final Object VALUE_COLOR_RENDER_QUALITY
- = "Highest quality color rendering mode";
-
- /**
- * This value is for use with the {@link #KEY_COLOR_RENDERING} key.
- */
- public static final Object VALUE_COLOR_RENDER_DEFAULT
- = "Default color rendering mode";
-
- /**
- * A key for the 'stroke control' hint. Permitted values are:
- * <p>
- * <table>
- * <tr>
- * <td>{@link #VALUE_STROKE_DEFAULT}</td>
- * <td>Use the default setting.</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_STROKE_NORMALIZE}</td>
- * <td>XXX</td>
- * </tr>
- * <tr>
- * <td>{@link #VALUE_STROKE_PURE}</td>
- * <td>XXX</td>
- * </tr>
- * </table>
- */
- public static final Key KEY_STROKE_CONTROL;
-
- /**
- * This value is for use with the {@link #KEY_STROKE_CONTROL} key.
- */
- public static final Object VALUE_STROKE_DEFAULT
- = "Default stroke normalization";
-
- /**
- * This value is for use with the {@link #KEY_STROKE_CONTROL} key.
- */
- public static final Object VALUE_STROKE_NORMALIZE
- = "Normalize strokes for consistent rendering";
-
- /**
- * This value is for use with the {@link #KEY_STROKE_CONTROL} key.
- */
- public static final Object VALUE_STROKE_PURE
- = "Pure stroke conversion for accurate paths";
-
- static
- {
- KEY_ANTIALIASING = new KeyImpl(1, "Global antialiasing enable key",
- VALUE_ANTIALIAS_ON,
- VALUE_ANTIALIAS_OFF,
- VALUE_ANTIALIAS_DEFAULT);
- KEY_RENDERING = new KeyImpl(2, "Global rendering quality key",
- VALUE_RENDER_SPEED,
- VALUE_RENDER_QUALITY,
- VALUE_RENDER_DEFAULT);
- KEY_DITHERING = new KeyImpl(3, "Dithering quality key",
- VALUE_DITHER_DISABLE,
- VALUE_DITHER_ENABLE,
- VALUE_DITHER_DEFAULT);
- KEY_TEXT_ANTIALIASING
- = new KeyImpl(4, "Text-specific antialiasing enable key",
- VALUE_TEXT_ANTIALIAS_ON,
- VALUE_TEXT_ANTIALIAS_OFF,
- VALUE_TEXT_ANTIALIAS_DEFAULT);
- KEY_FRACTIONALMETRICS = new KeyImpl(5, "Fractional metrics enable key",
- VALUE_FRACTIONALMETRICS_OFF,
- VALUE_FRACTIONALMETRICS_ON,
- VALUE_FRACTIONALMETRICS_DEFAULT);
- KEY_INTERPOLATION = new KeyImpl(6, "Image interpolation method key",
- VALUE_INTERPOLATION_NEAREST_NEIGHBOR,
- VALUE_INTERPOLATION_BILINEAR,
- VALUE_INTERPOLATION_BICUBIC);
- KEY_ALPHA_INTERPOLATION
- = new KeyImpl(7, "Alpha blending interpolation method key",
- VALUE_ALPHA_INTERPOLATION_SPEED,
- VALUE_ALPHA_INTERPOLATION_QUALITY,
- VALUE_ALPHA_INTERPOLATION_DEFAULT);
- KEY_COLOR_RENDERING = new KeyImpl(8, "Color rendering quality key",
- VALUE_COLOR_RENDER_SPEED,
- VALUE_COLOR_RENDER_QUALITY,
- VALUE_COLOR_RENDER_DEFAULT);
- KEY_STROKE_CONTROL = new KeyImpl(9, "Stroke normalization control key",
- VALUE_STROKE_DEFAULT,
- VALUE_STROKE_NORMALIZE,
- VALUE_STROKE_PURE);
- }
-
- /**
- * Creates a new collection of hints containing all the (key, value) pairs
- * in the specified map.
- *
- * @param init a map containing a collection of hints (<code>null</code>
- * permitted).
- */
- public RenderingHints(Map init)
- {
- if (init != null)
- putAll(init);
- }
-
- /**
- * Creates a new collection containing a single (key, value) pair.
- *
- * @param key the key.
- * @param value the value.
- */
- public RenderingHints(Key key, Object value)
- {
- put(key, value);
- }
-
- /**
- * Returns the number of hints in the collection.
- *
- * @return The number of hints.
- */
- public int size()
- {
- return hintMap.size();
- }
-
- /**
- * Returns <code>true</code> if there are no hints in the collection,
- * and <code>false</code> otherwise.
- *
- * @return A boolean.
- */
- public boolean isEmpty()
- {
- return hintMap.isEmpty();
- }
-
- /**
- * Returns <code>true</code> if the collection of hints contains the
- * specified key, and <code>false</code> otherwise.
- *
- * @param key the key.
- *
- * @return A boolean.
- */
- public boolean containsKey(Object key)
- {
- if (key == null)
- throw new NullPointerException();
- return hintMap.containsKey((Key) key);
- }
-
- /**
- * Returns <code>true</code> if the collection of hints contains the
- * specified value, and <code>false</code> otherwise.
- *
- * @param value the value.
- *
- * @return A boolean.
- */
- public boolean containsValue(Object value)
- {
- return hintMap.containsValue(value);
- }
-
- /**
- * Returns the value associated with the specified key.
- *
- * @param key the key.
- *
- * @return The value.
- */
- public Object get(Object key)
- {
- return hintMap.get((Key) key);
- }
-
- /**
- * Adds a (key, value) pair to the collection of hints (if the
- * collection already contains the specified key, then the
- * value is updated).
- *
- * @param key the key.
- * @param value the value.
- *
- * @return the previous value of the key or <code>null</code> if the key
- * didn't have a value yet.
- */
- public Object put(Object key, Object value)
- {
- if (key == null || value == null)
- throw new NullPointerException();
- if (! ((Key) key).isCompatibleValue(value))
- throw new IllegalArgumentException();
- return hintMap.put(key, value);
- }
-
- /**
- * Adds all the hints from a collection to this collection.
- *
- * @param hints the hint collection.
- */
- public void add(RenderingHints hints)
- {
- hintMap.putAll(hints);
- }
-
- /**
- * Clears all the hints from this collection.
- */
- public void clear()
- {
- hintMap.clear();
- }
-
- /**
- * Removes a hint from the collection.
- *
- * @param key the key.
- *
- * @return The value that was associated with the key, or <code>null</code> if
- * the key was not part of the collection
- *
- * @throws ClassCastException if the key is not a subclass of
- * {@link RenderingHints.Key}.
- */
- public Object remove(Object key)
- {
- // don't remove the (Key) cast, it is necessary to throw the exception
- // required by the spec
- return hintMap.remove((Key) key);
- }
-
- /**
- * Adds a collection of (key, value) pairs to the collection.
- *
- * @param m a map containing (key, value) items.
- *
- * @throws ClassCastException if the map contains a key that is not
- * a subclass of {@link RenderingHints.Key}.
- * @throws IllegalArgumentException if the map contains a value that is
- * not compatible with its key.
- */
- public void putAll(Map m)
- {
- // preprocess map to generate appropriate exceptions
- Iterator iterator = m.keySet().iterator();
- while (iterator.hasNext())
- {
- Key key = (Key) iterator.next();
- if (!key.isCompatibleValue(m.get(key)))
- throw new IllegalArgumentException();
- }
- // map is OK, update
- hintMap.putAll(m);
- }
-
- /**
- * Returns a set containing the keys from this collection.
- *
- * @return A set of keys.
- */
- public Set keySet()
- {
- return hintMap.keySet();
- }
-
- /**
- * Returns a collection of the values from this hint collection. The
- * collection is backed by the <code>RenderingHints</code> instance,
- * so updates to one will affect the other.
- *
- * @return A collection of values.
- */
- public Collection values()
- {
- return hintMap.values();
- }
-
- /**
- * Returns a set of entries from the collection.
- *
- * @return A set of entries.
- */
- public Set entrySet()
- {
- return Collections.unmodifiableSet(hintMap.entrySet());
- }
-
- /**
- * Checks this collection for equality with an arbitrary object.
- *
- * @param o the object (<code>null</code> permitted)
- *
- * @return A boolean.
- */
- public boolean equals(Object o)
- {
- return hintMap.equals(o);
- }
-
- /**
- * Returns a hash code for the collection of hints.
- *
- * @return A hash code.
- */
- public int hashCode()
- {
- return hintMap.hashCode();
- }
-
- /**
- * Creates a clone of this instance.
- *
- * @return A clone.
- */
- public Object clone()
- {
- try
- {
- RenderingHints copy = (RenderingHints) super.clone();
- copy.hintMap = (HashMap) hintMap.clone();
- return copy;
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-
- /**
- * Returns a string representation of this instance.
- *
- * @return A string.
- */
- public String toString()
- {
- return hintMap.toString();
- }
-} // class RenderingHints
diff --git a/libjava/java/awt/Robot.java b/libjava/java/awt/Robot.java
deleted file mode 100644
index 72daa9b94fb..00000000000
--- a/libjava/java/awt/Robot.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/* Robot.java -- a native input event generator
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import gnu.java.awt.ClasspathToolkit;
-
-import java.lang.reflect.InvocationTargetException;
-import java.awt.event.InputEvent;
-import java.awt.image.BufferedImage;
-import java.awt.peer.RobotPeer;
-
-/**
- * The Robot class is used to simulate user interaction with graphical
- * programs. It can generate native windowing system input events and
- * retrieve image data from the current screen. Robot is used to test
- * the AWT and Swing library implementations; it can also be used to
- * create self-running demo programs.
- *
- * Since Robot generates native windowing system events, rather than
- * simply inserting {@link AWTEvents} on the AWT event queue, its use
- * is not restricted to Java programs. It can be used to
- * programatically drive any graphical application.
- *
- * This implementation requires an X server that supports the XTest
- * extension.
- *
- * @author Thomas Fitzsimmons (fitzsim@redhat.com)
- *
- * @since 1.3
- */
-public class Robot
-{
- private boolean waitForIdle;
- private int autoDelay;
- private RobotPeer peer;
-
- /**
- * Construct a Robot object that operates on the default screen.
- *
- * @exception AWTException if GraphicsEnvironment.isHeadless()
- * returns true or if the X server does not support the XTest
- * extension
- * @exception SecurityException if createRobot permission is not
- * granted
- */
- public Robot () throws AWTException
- {
- if (GraphicsEnvironment.isHeadless ())
- throw new AWTException ("Robot: headless graphics environment");
-
- SecurityManager sm = System.getSecurityManager ();
- if (sm != null)
- sm.checkPermission (new AWTPermission ("createRobot"));
-
- ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit ();
-
- // createRobot will throw AWTException if XTest is not supported.
- peer = tk.createRobot (GraphicsEnvironment.getLocalGraphicsEnvironment ()
- .getDefaultScreenDevice ());
- }
-
- /**
- * Construct a Robot object that operates on the specified screen.
- *
- * @exception AWTException if GraphicsEnvironment.isHeadless()
- * returns true or if the X server does not support the XTest
- * extension
- * @exception IllegalArgumentException if screen is not a screen
- * GraphicsDevice
- * @exception SecurityException if createRobot permission is not
- * granted
- */
- public Robot (GraphicsDevice screen) throws AWTException
- {
- if (GraphicsEnvironment.isHeadless ())
- throw new AWTException ("Robot: headless graphics environment");
-
- if (screen.getType () != GraphicsDevice.TYPE_RASTER_SCREEN)
- throw new IllegalArgumentException ("Robot: graphics"
- + " device is not a screen");
-
- SecurityManager sm = System.getSecurityManager ();
- if (sm != null)
- sm.checkPermission (new AWTPermission ("createRobot"));
-
- ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit ();
-
- // createRobot will throw AWTException if XTest is not supported.
- peer = tk.createRobot (screen);
- }
-
- /**
- * Move the mouse pointer to absolute coordinates (x, y).
- *
- * @param x the destination x coordinate
- * @param y the destination y coordinate
- */
- public void mouseMove(int x, int y)
- {
- peer.mouseMove (x, y);
-
- if (waitForIdle)
- waitForIdle ();
-
- if (autoDelay > 0)
- delay (autoDelay);
- }
-
- /**
- * Press one or more mouse buttons.
- *
- * @param buttons the buttons to press; a bitmask of one or more of
- * these {@link InputEvent} fields:
- *
- * <ul>
- * <li>BUTTON1_MASK</li>
- * <li>BUTTON2_MASK</li>
- * <li>BUTTON3_MASK</li>
- * </ul>
- *
- * @exception IllegalArgumentException if the button mask is invalid
- */
- public void mousePress (int buttons)
- {
- if ((buttons & InputEvent.BUTTON1_MASK) == 0
- && (buttons & InputEvent.BUTTON2_MASK) == 0
- && (buttons & InputEvent.BUTTON3_MASK) == 0)
- throw new IllegalArgumentException ("Robot: mousePress:"
- + " invalid button mask");
-
- peer.mousePress (buttons);
-
- if (waitForIdle)
- waitForIdle ();
-
- if (autoDelay > 0)
- delay (autoDelay);
- }
-
- /**
- * Release one or more mouse buttons.
- *
- * @param buttons the buttons to release; a bitmask of one or more
- * of these {@link InputEvent} fields:
- *
- * <ul>
- * <li>BUTTON1_MASK</li>
- * <li>BUTTON2_MASK</li>
- * <li>BUTTON3_MASK</li>
- * </ul>
- *
- * @exception IllegalArgumentException if the button mask is invalid
- */
- public void mouseRelease(int buttons)
- {
- if ((buttons & InputEvent.BUTTON1_MASK) == 0
- && (buttons & InputEvent.BUTTON2_MASK) == 0
- && (buttons & InputEvent.BUTTON3_MASK) == 0)
- throw new IllegalArgumentException ("Robot: mouseRelease:"
- + " invalid button mask");
-
- peer.mouseRelease (buttons);
-
- if (waitForIdle)
- waitForIdle ();
-
- if (autoDelay > 0)
- delay (autoDelay);
- }
-
- /**
- * Rotate the mouse scroll wheel.
- *
- * @param wheelAmt number of steps to rotate mouse wheel. negative
- * to rotate wheel up (away from the user), positive to rotate wheel
- * down (toward the user).
- *
- * @since 1.4
- */
- public void mouseWheel (int wheelAmt)
- {
- peer.mouseWheel (wheelAmt);
-
- if (waitForIdle)
- waitForIdle ();
-
- if (autoDelay > 0)
- delay (autoDelay);
- }
-
- /**
- * Press a key.
- *
- * @param keycode key to press, a {@link KeyEvent} VK_ constant
- *
- * @exception IllegalArgumentException if keycode is not a valid key
- */
- public void keyPress (int keycode)
- {
- peer.keyPress (keycode);
-
- if (waitForIdle)
- waitForIdle ();
-
- if (autoDelay > 0)
- delay (autoDelay);
- }
-
- /**
- * Release a key.
- *
- * @param keycode key to release, a {@link KeyEvent} VK_ constant
- *
- * @exception IllegalArgumentException if keycode is not a valid key
- */
- public void keyRelease (int keycode)
- {
- peer.keyRelease (keycode);
-
- if (waitForIdle)
- waitForIdle ();
-
- if (autoDelay > 0)
- delay (autoDelay);
- }
-
- /**
- * Return the color of the pixel at the given screen coordinates.
- *
- * @param x the x coordinate of the pixel
- * @param y the y coordinate of the pixel
- *
- * @return the Color of the pixel at screen coodinates <code>(x, y)</code>
- */
- public Color getPixelColor (int x, int y)
- {
- return new Color (peer.getRGBPixel (x, y));
- }
-
- /**
- * Create an image containing pixels read from the screen. The
- * image does not include the mouse pointer.
- *
- * @param screenRect the rectangle of pixels to capture, in screen
- * coordinates
- *
- * @return a BufferedImage containing the requested pixels
- *
- * @exception IllegalArgumentException if requested width and height
- * are not both greater than zero
- * @exception SecurityException if readDisplayPixels permission is
- * not granted
- */
- public BufferedImage createScreenCapture (Rectangle screenRect)
- {
- if (screenRect.width <= 0)
- throw new IllegalArgumentException ("Robot: capture width is <= 0");
-
- if (screenRect.height <= 0)
- throw new IllegalArgumentException ("Robot: capture height is <= 0");
-
- SecurityManager sm = System.getSecurityManager ();
- if (sm != null)
- sm.checkPermission (new AWTPermission ("readDisplayPixels"));
-
- int[] pixels = peer.getRGBPixels (screenRect);
-
- BufferedImage bufferedImage =
- new BufferedImage (screenRect.width, screenRect.height,
- BufferedImage.TYPE_INT_ARGB);
-
- bufferedImage.setRGB (0, 0, screenRect.width, screenRect.height,
- pixels, 0, screenRect.width);
-
- return bufferedImage;
- }
-
- /**
- * Check if this Robot automatically calls {@link waitForIdle} after
- * generating an event.
- *
- * @return true if waitForIdle is automatically called
- */
- public boolean isAutoWaitForIdle ()
- {
- return waitForIdle;
- }
-
- /**
- * Set whether or not this Robot automatically calls {@link
- * waitForIdle} after generating an event.
- *
- * @param isOn true if waitForIdle should be called automatically
- */
- public void setAutoWaitForIdle (boolean isOn)
- {
- waitForIdle = isOn;
- }
-
- /**
- * Retrieve the length of time this Robot sleeps after generating an
- * event.
- *
- * @return the length of time in milliseconds
- */
- public int getAutoDelay ()
- {
- return autoDelay;
- }
-
- /**
- * Set the length of time this Robot sleeps after generating an
- * event.
- *
- * @param ms the length of time in milliseconds
- *
- * @exception IllegalArgumentException if ms is not between 0 and
- * 60,000 milliseconds inclusive
- */
- public void setAutoDelay (int ms)
- {
- if (ms <= 0 || ms >= 60000)
- throw new IllegalArgumentException ("Robot: delay length out-of-bounds");
-
- autoDelay = ms;
- }
-
- /**
- * Sleep for a specified length of time.
- *
- * @param ms the length of time in milliseconds
- *
- * @exception IllegalArgumentException if ms is not between 0 and
- * 60,000 milliseconds inclusive
- */
- public void delay (int ms)
- {
- if (ms < 0 || ms > 60000)
- throw new IllegalArgumentException ("Robot: delay length out-of-bounds");
-
- try
- {
- Thread.sleep (ms);
- }
- catch (InterruptedException e)
- {
- System.err.println ("Robot: delay interrupted");
- }
- }
-
- /**
- * Wait until all events currently on the event queue have been
- * dispatched.
- */
- public void waitForIdle ()
- {
- if (EventQueue.isDispatchThread ())
- throw new IllegalThreadStateException ("Robot: waitForIdle called from "
- + "the event dispatch thread");
-
- try
- {
- EventQueue.invokeAndWait (new Runnable () { public void run () { } });
- }
- catch (InterruptedException e)
- {
- System.err.println ("Robot: waitForIdle interrupted");
- }
- catch (InvocationTargetException e)
- {
- System.err.println ("Robot: waitForIdle cannot invoke target");
- }
- }
-
- /**
- * Return a string representation of this Robot.
- *
- * @return a string representation
- */
- public String toString ()
- {
- return getClass ().getName ()
- + "[ autoDelay = " + autoDelay + ", autoWaitForIdle = "
- + waitForIdle + " ]";
- }
-}
diff --git a/libjava/java/awt/ScrollPane.java b/libjava/java/awt/ScrollPane.java
deleted file mode 100644
index b3ecc59fcd5..00000000000
--- a/libjava/java/awt/ScrollPane.java
+++ /dev/null
@@ -1,615 +0,0 @@
-/* ScrollPane.java -- Scrolling window
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.MouseEvent;
-import java.awt.peer.ComponentPeer;
-import java.awt.peer.ScrollPanePeer;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * This widget provides a scrollable region that allows a single
- * subcomponent to be viewed through a smaller window.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class ScrollPane extends Container implements Accessible
-{
-
-/*
- * Static Variables
- */
-
-/**
- * Constant indicating that scrollbars are created as needed in this
- * windows.
- */
-public static final int SCROLLBARS_AS_NEEDED = 0;
-
-/**
- * Constant indicating that scrollbars are always displayed in this
- * window.
- */
-public static final int SCROLLBARS_ALWAYS = 1;
-
-/**
- * Constant indicating that scrollbars are never displayed in this window.
- */
-public static final int SCROLLBARS_NEVER = 2;
-
-// Serialization constant
-private static final long serialVersionUID = 7956609840827222915L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The horizontal scrollbar for this window. The methods
- * <code>setMinimum()</code>, <code>setMaximum</code>, and
- * <code>setVisibleAmount</code> must not be called on this scrollbar.
- */
-private ScrollPaneAdjustable hAdjustable;
-
-/**
- * @serial The vertical scrollbar for this window. The methods
- * <code>setMinimum()</code>, <code>setMaximum</code>, and
- * <code>setVisibleAmount</code> must not be called on this scrollbar.
- */
-private ScrollPaneAdjustable vAdjustable;
-
-/**
- * @serial Indicates when scrollbars are displayed in this window, will
- * be one of the constants from this class.
- */
-private int scrollbarDisplayPolicy;
-
-// Current scroll position
-private Point scrollPosition = new Point(0, 0);
-
-private boolean wheelScrollingEnabled;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>ScrollPane</code> with a default
- * scrollbar policy of <code>SCROLLBARS_AS_NEEDED</code>.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-ScrollPane()
-{
- this(SCROLLBARS_AS_NEEDED);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>ScrollPane</code> with the
- * specified scrollbar policy.
- *
- * @param scrollbarDisplayPolicy When to display scrollbars, which must
- * be one of the constants defined in this class.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-ScrollPane(int scrollbarDisplayPolicy)
-{
- if (GraphicsEnvironment.isHeadless ())
- throw new HeadlessException ();
-
- this.scrollbarDisplayPolicy = scrollbarDisplayPolicy;
-
- if (scrollbarDisplayPolicy != SCROLLBARS_ALWAYS
- && scrollbarDisplayPolicy != SCROLLBARS_AS_NEEDED
- && scrollbarDisplayPolicy != SCROLLBARS_NEVER)
- throw new IllegalArgumentException("Bad scrollbarDisplayPolicy: " +
- scrollbarDisplayPolicy);
-
- if (scrollbarDisplayPolicy != SCROLLBARS_NEVER)
- {
- hAdjustable = new ScrollPaneAdjustable (this, Scrollbar.HORIZONTAL);
- vAdjustable = new ScrollPaneAdjustable (this, Scrollbar.VERTICAL);
- }
-
- wheelScrollingEnabled = true;
-
- // Default size.
- setSize(100,100);
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * Returns the current scrollbar display policy.
- *
- * @return The current scrollbar display policy.
- */
-public int
-getScrollbarDisplayPolicy()
-{
- return(scrollbarDisplayPolicy);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the horizontal scrollbar for this object. If the scrollbar
- * display policy is set to <code>SCROLLBARS_NEVER</code> then this
- * will be <code>null</code>.
- *
- * @return The horizontal scrollbar for this window.
- */
-public Adjustable
-getHAdjustable()
-{
- return(hAdjustable);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the vertical scrollbar for this object. If the scrollbar
- * display policy is set to <code>SCROLLBARS_NEVER</code> then this
- * will be <code>null</code>.
- *
- * @return The horizontal scrollbar for this window.
- */
-public Adjustable
-getVAdjustable()
-{
- return(vAdjustable);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the current viewport size. The viewport is the region of
- * this object's window where the child is actually displayed.
- *
- * @return The viewport size.
- */
-public Dimension getViewportSize ()
-{
- Dimension viewsize = getSize ();
- Insets insets = getInsets ();
-
- viewsize.width -= (insets.left + insets.right);
- viewsize.height -= (insets.top + insets.bottom);
-
- Component[] list = getComponents();
- if ((list == null) || (list.length <= 0))
- return viewsize;
-
- Dimension dim = list[0].getPreferredSize();
-
- if (dim.width <= 0 && dim.height <= 0)
- return viewsize;
-
- int vScrollbarWidth = getVScrollbarWidth ();
- int hScrollbarHeight = getHScrollbarHeight ();
-
- if (scrollbarDisplayPolicy == SCROLLBARS_ALWAYS)
- {
- viewsize.width -= vScrollbarWidth;
- viewsize.height -= hScrollbarHeight;
- return viewsize;
- }
-
- if (scrollbarDisplayPolicy == SCROLLBARS_NEVER)
- return viewsize;
-
- // The scroll policy is SCROLLBARS_AS_NEEDED, so we need to see if
- // either scrollbar is needed.
-
- // Assume we don't need either scrollbar.
- boolean mayNeedVertical = false;
- boolean mayNeedHorizontal = false;
-
- boolean needVertical = false;
- boolean needHorizontal = false;
-
- // Check if we need vertical scrollbars. If we do, then we need to
- // subtract the width of the vertical scrollbar from the viewport's
- // width.
- if (dim.height > viewsize.height)
- needVertical = true;
- else if (dim.height > (viewsize.height - hScrollbarHeight))
- // This is tricky. In this case the child is tall enough that its
- // bottom edge would be covered by a horizontal scrollbar, if one
- // were present. This means that if there's a horizontal
- // scrollbar then we need a vertical scrollbar.
- mayNeedVertical = true;
-
- if (dim.width > viewsize.width)
- needHorizontal = true;
- else if (dim.width > (viewsize.width - vScrollbarWidth))
- mayNeedHorizontal = true;
-
- if (needVertical && mayNeedHorizontal)
- needHorizontal = true;
-
- if (needHorizontal && mayNeedVertical)
- needVertical = true;
-
- if (needHorizontal)
- viewsize.height -= hScrollbarHeight;
-
- if (needVertical)
- viewsize.width -= vScrollbarWidth;
-
- return viewsize;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the height of a horizontal scrollbar.
- *
- * @return The height of a horizontal scrollbar.
- */
-public int
-getHScrollbarHeight()
-{
- ScrollPanePeer spp = (ScrollPanePeer)getPeer();
- if (spp != null)
- return(spp.getHScrollbarHeight());
- else
- return(0); // FIXME: What to do here?
-}
-
-/*************************************************************************/
-
-/**
- * Returns the width of a vertical scrollbar.
- *
- * @return The width of a vertical scrollbar.
- */
-public int
-getVScrollbarWidth()
-{
- ScrollPanePeer spp = (ScrollPanePeer)getPeer();
- if (spp != null)
- return(spp.getVScrollbarWidth());
- else
- return(0); // FIXME: What to do here?
-}
-
-/*************************************************************************/
-
-/**
- * Returns the current scroll position of the viewport.
- *
- * @return The current scroll position of the viewport.
- */
-public Point
-getScrollPosition()
-{
- int x = 0;
- int y = 0;
-
- Adjustable v = getVAdjustable();
- Adjustable h = getHAdjustable();
-
- if (v != null)
- y = v.getValue();
- if (h != null)
- x = h.getValue();
-
- return(new Point(x, y));
-}
-
-/*************************************************************************/
-
-/**
- * Sets the scroll position to the specified value.
- *
- * @param scrollPosition The new scrollPosition.
- *
- * @exception IllegalArgumentException If the specified value is outside
- * the legal scrolling range.
- */
-public void
-setScrollPosition(Point scrollPosition) throws IllegalArgumentException
-{
- setScrollPosition(scrollPosition.x, scrollPosition.y);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the scroll position to the specified value.
- *
- * @param x The new X coordinate of the scroll position.
- * @param y The new Y coordinate of the scroll position.
- *
- * @exception IllegalArgumentException If the specified value is outside
- * the legal scrolling range.
- */
-public void
-setScrollPosition(int x, int y)
-{
- Adjustable h = getHAdjustable();
- Adjustable v = getVAdjustable();
-
- if (h != null)
- h.setValue(x);
- if (v != null)
- v.setValue(y);
-
- ScrollPanePeer spp = (ScrollPanePeer)getPeer();
- if (spp != null)
- spp.setScrollPosition(x, y);
-}
-
-/*************************************************************************/
-
-/**
- * Notifies this object that it should create its native peer.
- */
-public void
-addNotify()
-{
- if (!isDisplayable ())
- return;
-
- setPeer((ComponentPeer)getToolkit().createScrollPane(this));
- super.addNotify();
-
- Component[] list = getComponents();
- if (list != null && list.length > 0 && ! (list[0] instanceof Panel))
- {
- Panel panel = new Panel();
- panel.setLayout(new BorderLayout());
- panel.add(list[0], BorderLayout.CENTER);
- add(panel);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Notifies this object that it should destroy its native peers.
- */
-public void
-removeNotify()
-{
- super.removeNotify();
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified child component to this container. A
- * <code>ScrollPane</code> can have at most one child, so if a second
- * one is added, then first one is removed.
- *
- * @param component The component to add to this container.
- * @param constraints A list of layout constraints for this object.
- * @param index The index at which to add the child, which is ignored
- * in this implementation.
- */
- protected final void addImpl (Component component, Object constraints,
- int index)
-{
- Component[] list = getComponents();
- if ((list != null) && (list.length > 0))
- remove(list[0]);
-
- super.addImpl(component, constraints, -1);
-
- doLayout();
-}
-
-/*************************************************************************/
-
-/**
- * Lays out this component. This consists of resizing the sole child
- * component to its perferred size.
- */
-public void
-doLayout()
-{
- layout ();
-}
-
-/*************************************************************************/
-
-/**
- * Lays out this component. This consists of resizing the sole child
- * component to its perferred size.
- *
- * @deprecated This method is deprecated in favor of
- * <code>doLayout()</code>.
- */
-public void
-layout()
-{
- Component[] list = getComponents ();
- if ((list != null) && (list.length > 0))
- {
- Dimension dim = list[0].getPreferredSize ();
- Dimension vp = getViewportSize ();
-
- if (dim.width < vp.width)
- dim.width = vp.width;
-
- if (dim.height < vp.height)
- dim.height = vp.height;
-
- ScrollPanePeer peer = (ScrollPanePeer) getPeer ();
- if (peer != null)
- peer.childResized (dim.width, dim.height);
-
- list[0].setSize (dim);
-
- Point p = getScrollPosition ();
- if (p.x > dim.width)
- p.x = dim.width;
- if (p.y > dim.height)
- p.y = dim.height;
-
- setScrollPosition (p);
- }
-}
-
-/*************************************************************************/
-
-/**
- * This method overrides its superclass method to ensure no layout
- * manager is set for this container. <code>ScrollPane</code>'s do
- * not have layout managers.
- *
- * @param layoutManager Ignored
- */
-public final void
-setLayout(LayoutManager layoutManager)
-{
- return;
-}
-
-/*************************************************************************/
-
-/**
- * Prints all of the components in this container.
- *
- * @param graphics The desired graphics context for printing.
- */
-public void
-printComponents(Graphics graphics)
-{
- super.printComponents(graphics);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debug string for this object.
- *
- * @return A debug string for this object.
- */
-public String
-paramString()
-{
- Insets insets = getInsets();
- return getName() + ","
- + getX() + ","
- + getY() + ","
- + getWidth() + "x" + getHeight() + ","
- + "ScrollPosition=(" + scrollPosition.getX() + ","
- + scrollPosition.getY() + "),"
- + "Insets=(" + insets.top + ","
- + insets.left + ","
- + insets.bottom + ","
- + insets.right + "),"
- + "ScrollbarDisplayPolicy=" + getScrollbarDisplayPolicy() + ","
- + "wheelScrollingEnabled=" + isWheelScrollingEnabled();
-}
-
- /**
- * Tells whether or not an event is enabled.
- *
- * @since 1.4
- */
- protected boolean eventTypeEnabled (int type)
- {
- if (type == MouseEvent.MOUSE_WHEEL)
- return wheelScrollingEnabled;
-
- return super.eventTypeEnabled (type);
- }
-
- /**
- * Tells whether or not wheel scrolling is enabled.
- *
- * @since 1.4
- */
- public boolean isWheelScrollingEnabled ()
- {
- return wheelScrollingEnabled;
- }
-
- /**
- * Enables/disables wheel scrolling.
- *
- * @since 1.4
- */
- public void setWheelScrollingEnabled (boolean enable)
- {
- wheelScrollingEnabled = enable;
- }
-
- protected class AccessibleAWTScrollPane extends AccessibleAWTContainer
- {
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.SCROLL_PANE;
- }
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>ScrollPane</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTScrollPane();
- return accessibleContext;
- }
-} // class ScrollPane
-
diff --git a/libjava/java/awt/ScrollPaneAdjustable.java b/libjava/java/awt/ScrollPaneAdjustable.java
deleted file mode 100644
index cfca19b4423..00000000000
--- a/libjava/java/awt/ScrollPaneAdjustable.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/* ScrollPaneAdjustable.java -- Scrollbars for a ScrollPane
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.AdjustmentListener;
-import java.io.Serializable;
-
-/**
- * Need this class since the serialization spec for ScrollPane
- * uses it.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.4
- */
-public class ScrollPaneAdjustable
- implements Adjustable, Serializable
-{
- private static final long serialVersionUID = -3359745691033257079L;
-
- ScrollPane sp;
- int orientation;
- int value;
- int minimum;
- int maximum;
- int visibleAmount;
- int unitIncrement = 1;
- int blockIncrement = 1;
- AdjustmentListener adjustmentListener;
-
- private transient boolean valueIsAdjusting = false;
-
- ScrollPaneAdjustable (ScrollPane sp, int orientation)
- {
- this.sp = sp;
- this.orientation = orientation;
- }
-
- ScrollPaneAdjustable (ScrollPane sp, int orientation, int value, int minimum,
- int maximum, int visibleAmount, int unitIncrement,
- int blockIncrement)
- {
- this.sp = sp;
- this.orientation = orientation;
- this.value = value;
- this.minimum = minimum;
- this.maximum = maximum;
- this.visibleAmount = visibleAmount;
- this.unitIncrement = unitIncrement;
- this.blockIncrement = blockIncrement;
- }
-
- public void addAdjustmentListener (AdjustmentListener listener)
- {
- AWTEventMulticaster.add (adjustmentListener, listener);
- }
-
- public void removeAdjustmentListener (AdjustmentListener listener)
- {
- AWTEventMulticaster.remove (adjustmentListener, listener);
- }
-
- public AdjustmentListener[] getAdjustmentListeners ()
- {
- return (AdjustmentListener[]) AWTEventMulticaster.getListeners
- (adjustmentListener, AdjustmentListener.class);
- }
-
- public int getBlockIncrement ()
- {
- return blockIncrement;
- }
-
- public int getMaximum ()
- {
- return maximum;
- }
-
- public int getMinimum ()
- {
- return minimum;
- }
-
- public int getOrientation ()
- {
- return orientation;
- }
-
- public int getUnitIncrement ()
- {
- return unitIncrement;
- }
-
- public int getValue ()
- {
- return value;
- }
-
- public int getVisibleAmount ()
- {
- return visibleAmount;
- }
-
- public void setBlockIncrement (int blockIncrement)
- {
- this.blockIncrement = blockIncrement;
- }
-
- public void setMaximum (int maximum)
- {
- this.maximum = maximum;
- }
-
- public void setMinimum (int minimum)
- {
- this.minimum = minimum;
- }
-
- public void setUnitIncrement (int unitIncrement)
- {
- this.unitIncrement = unitIncrement;
- }
-
- public void setValue (int value)
- {
- this.value = value;
-
- if (value < minimum)
- minimum = value;
-
- if (value > maximum)
- maximum = value;
- }
-
- public void setVisibleAmount (int visibleAmount)
- {
- this.visibleAmount = visibleAmount;
- }
-
- public String paramString ()
- {
- throw new Error ("not implemented");
- }
-
- /**
- * Returns true if the value is in the process of changing.
- *
- * @since 1.4
- */
- public boolean getValueIsAdjusting ()
- {
- return valueIsAdjusting;
- }
-
- /**
- * Sets the value of valueIsAdjusting.
- *
- * @since 1.4
- */
- public void setValueIsAdjusting (boolean valueIsAdjusting)
- {
- this.valueIsAdjusting = valueIsAdjusting;
- }
-} // class ScrollPaneAdjustable
-
diff --git a/libjava/java/awt/Scrollbar.java b/libjava/java/awt/Scrollbar.java
deleted file mode 100644
index 6e506c78584..00000000000
--- a/libjava/java/awt/Scrollbar.java
+++ /dev/null
@@ -1,825 +0,0 @@
-/* Scrollbar.java -- AWT Scrollbar widget
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.AdjustmentEvent;
-import java.awt.event.AdjustmentListener;
-import java.awt.peer.ScrollbarPeer;
-import java.util.EventListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleState;
-import javax.accessibility.AccessibleStateSet;
-import javax.accessibility.AccessibleValue;
-
-/**
- * This class implements a scrollbar widget.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- */
-public class Scrollbar extends Component implements Accessible, Adjustable
-{
- // FIXME: Serialization readObject/writeObject
-
- /**
- * 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;
-
- /**
- * 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;
-
- /**
- * @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;
-
- /**
- * @serial The minimum value for this scrollbar
- */
- private int minimum;
-
- /**
- * @serial The orientation of this scrollbar, which will be either
- * the <code>HORIZONTAL</code> or <code>VERTICAL</code> 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;
-
- /**
- * true if the scrollbar is adjusting, false otherwise.
- */
- private transient boolean valueIsAdjusting = false;
-
- /**
- * The number used to generate the name returned by getName.
- */
- private static transient long next_scrollbar_number;
-
- /**
- * Initializes a new instance of <code>Scrollbar</code> 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 <code>Scrollbar</code> with the
- * specified orientation and default values for all other parameters.
- * The orientation must be either the constant <code>HORIZONTAL</code> or
- * <code>VERTICAL</code> 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 <code>Scrollbar</code> with the
- * specified parameters. The orientation must be either the constant
- * <code>HORIZONTAL</code> or <code>VERTICAL</code>. 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;
- }
-
- /**
- * 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 <code>HORIZONTAL</code> or
- * <code>VERTICAL</code> 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)
- {
- setValues(value, visibleAmount, minimum, maximum);
- }
-
- /**
- * Returns the minimum value for this scrollbar.
- *
- * @return The minimum value for this scrollbar.
- */
- public int getMinimum()
- {
- return minimum;
- }
-
- /**
- * 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 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
- * <code>getVisibleAmount()</code>.
- */
- 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);
- }
-
- /**
- * 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;
-
- 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);
- }
- }
-
- /**
- * 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();
- }
-
- /**
- * 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
- * <code>getUnitIncrement()</code>.
- */
- public int getLineIncrement()
- {
- return lineIncrement;
- }
-
- /**
- * 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);
- }
-
- /**
- * 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
- * <code>setUnitIncrement()</code>.
- */
- public void setLineIncrement(int lineIncrement)
- {
- if (lineIncrement < 0)
- throw new IllegalArgumentException("Unit increment less than zero.");
-
- 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();
- }
-
- /**
- * 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
- * <code>getBlockIncrement()</code>.
- */
- 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);
- }
-
- /**
- * 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
- * <code>setBlockIncrement()</code>.
- */
- 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);
- }
-
- /**
- * 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);
- }
-
- /**
- * 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
- * <code>processAdjustmentEvent()</code> if the event is an instance of
- * <code>AdjustmentEvent</code>, 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 <code>enableEvents()</code>.
- *
- * @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
- && e.id >= AdjustmentEvent.ADJUSTMENT_FIRST
- && (adjustment_listeners != null
- || (eventMask & AWTEvent.ADJUSTMENT_EVENT_MASK) != 0))
- 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 an array of all the objects currently registered as FooListeners
- * upon this <code>Scrollbar</code>. 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)
- {
- if (listenerType == AdjustmentListener.class)
- return AWTEventMulticaster.getListeners(adjustment_listeners,
- listenerType);
-
- return super.getListeners(listenerType);
- }
-
- /**
- * Returns an array of all registered adjustment listeners.
- */
- public AdjustmentListener[] getAdjustmentListeners()
- {
- return (AdjustmentListener[]) getListeners(AdjustmentListener.class);
- }
-
- /**
- * Returns true if the value is in the process of changing.
- *
- * @since 1.4
- */
- public boolean getValueIsAdjusting()
- {
- return valueIsAdjusting;
- }
-
- /**
- * Sets the value of valueIsAdjusting.
- *
- * @since 1.4
- */
- public void setValueIsAdjusting(boolean valueIsAdjusting)
- {
- this.valueIsAdjusting = valueIsAdjusting;
- }
-
- /**
- * Generate a unique name for this scroll bar.
- *
- * @return A unique name for this scroll bar.
- */
- String generateName()
- {
- return "scrollbar" + getUniqueLong();
- }
-
- private static synchronized long getUniqueLong()
- {
- return next_scrollbar_number++;
- }
-
- /**
- * This class provides accessibility support for the
- * scrollbar.
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- */
- protected class AccessibleAWTScrollBar extends AccessibleAWTComponent
- implements AccessibleValue
- {
- /**
- * Serialization constant to match JDK 1.5
- */
- private static final long serialVersionUID = -344337268523697807L;
-
- /**
- * Returns the role of this accessible object.
- *
- * @return the instance of <code>AccessibleRole</code>,
- * 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 <code>AccessibleState</code>s which
- * represent the current state of the accessible object.
- *
- * @see javax.accessibility.AccessibleState
- * @see javax.accessibility.AccessibleStateSet
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- AccessibleStateSet states = super.getAccessibleStateSet();
- if (getOrientation() == HORIZONTAL)
- states.add(AccessibleState.HORIZONTAL);
- else
- states.add(AccessibleState.VERTICAL);
- if (getValueIsAdjusting())
- states.add(AccessibleState.BUSY);
- return states;
- }
-
- /**
- * Returns an implementation of the <code>AccessibleValue</code>
- * interface for this accessible object. In this case, the
- * current instance is simply returned (with a more appropriate
- * type), as it also implements the accessible value as well as
- * the context.
- *
- * @return the accessible value associated with this context.
- *
- * @see javax.accessibility.AccessibleValue
- */
- public AccessibleValue getAccessibleValue()
- {
- return this;
- }
-
- /**
- * Returns the current value of this accessible object.
- * In this case, this is the same as the value for
- * the scrollbar, wrapped in an <code>Integer</code>
- * object.
- *
- * @return the numeric value of this scrollbar.
- *
- * @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
- */
- public Number getCurrentAccessibleValue()
- {
- return new Integer(getValue());
- }
-
- /**
- * Sets the current value of this accessible object
- * to that supplied. In this case, the value of the
- * scrollbar is set, and this method always returns
- * 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)
- {
- setValue(number.intValue());
- return true;
- }
-
- /**
- * Returns the minimum acceptable accessible value used
- * by this object. In this case, this is the same as
- * the minimum value of the scrollbar, wrapped in an
- * object.
- *
- * @return the minimum value of this scrollbar.
- *
- * @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
- */
- public Number getMinimumAccessibleValue()
- {
- return new Integer(getMinimum());
- }
-
- /**
- * Returns the maximum acceptable accessible value used
- * by this object. In this case, this is the same as
- * the maximum value of the scrollbar, wrapped in an
- * object.
- *
- * @return the maximum value of this scrollbar.
- *
- * @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
- */
- public Number getMaximumAccessibleValue()
- {
- return new Integer(getMaximum());
- }
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>Scrollbar</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTScrollBar();
-
- return accessibleContext;
- }
-}
diff --git a/libjava/java/awt/Shape.java b/libjava/java/awt/Shape.java
deleted file mode 100644
index bd8a4343528..00000000000
--- a/libjava/java/awt/Shape.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/* Shape.java -- the classic Object-Oriented shape interface
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.geom.AffineTransform;
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-
-/**
- * This interface represents an abstract shape. The shape is described by
- * a {@link PathIterator}, and has callbacks for determining bounding box,
- * where points and rectangles lie in relation to the shape, and tracing
- * the trajectory.
- *
- * <p>A point is inside if it is completely inside, or on the boundary and
- * adjacent points in the increasing x or y direction are completely inside.
- * Unclosed shapes are considered as implicitly closed when performing
- * <code>contains</code> or <code>intersects</code>.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see PathIterator
- * @see AffineTransform
- * @see java.awt.geom.FlatteningPathIterator
- * @see java.awt.geom.GeneralPath
- * @since 1.0
- * @status updated to 1.4
- */
-public interface Shape
-{
- /**
- * Returns a <code>Rectange</code> that bounds the shape. There is no
- * guarantee that this is the minimum bounding box, particularly if
- * the shape overflows the finite integer range of a bound. Generally,
- * <code>getBounds2D</code> returns a tighter bound.
- *
- * @return the shape's bounding box
- * @see #getBounds2D()
- */
- Rectangle getBounds();
-
- /**
- * Returns a high precision bounding box of the shape. There is no guarantee
- * that this is the minimum bounding box, but at least it never overflows.
- *
- * @return the shape's bounding box
- * @see #getBounds()
- * @since 1.2
- */
- Rectangle2D getBounds2D();
-
- /**
- * Test if the coordinates lie in the shape.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @return true if (x,y) lies inside the shape
- * @since 1.2
- */
- boolean contains(double x, double y);
-
- /**
- * Test if the point lie in the shape.
- *
- * @param p the high-precision point
- * @return true if p lies inside the shape
- * @throws NullPointerException if p is null
- * @since 1.2
- */
- boolean contains(Point2D p);
-
- /**
- * Test if a high-precision rectangle intersects the shape. This is true
- * if any point in the rectangle is in the shape, with the caveat that the
- * operation may include high probability estimates when the actual
- * calculation is prohibitively expensive. The {@link java.awt.geom.Area}
- * class can be used for more precise answers.
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle, undefined results if negative
- * @param h the height of the rectangle, undefined results if negative
- * @return true if the rectangle intersects this shape
- * @see java.awt.geom.Area
- * @since 1.2
- */
- boolean intersects(double x, double y, double w, double h);
-
- /**
- * Test if a high-precision rectangle intersects the shape. This is true
- * if any point in the rectangle is in the shape, with the caveat that the
- * operation may include high probability estimates when the actual
- * calculation is prohibitively expensive. The {@link java.awt.geom.Area}
- * class can be used for more precise answers.
- *
- * @param r the rectangle
- * @return true if the rectangle intersects this shape
- * @throws NullPointerException if r is null
- * @see #intersects(double, double, double, double)
- * @since 1.2
- */
- boolean intersects(Rectangle2D r);
-
- /**
- * Test if a high-precision rectangle lies completely in the shape. This is
- * true if all points in the rectangle are in the shape, with the caveat
- * that the operation may include high probability estimates when the actual
- * calculation is prohibitively expensive. The {@link java.awt.geom.Area}
- * class can be used for more precise answers.
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle, undefined results if negative
- * @param h the height of the rectangle, undefined results if negative
- * @return true if the rectangle is contained in this shape
- * @see java.awt.geom.Area
- * @since 1.2
- */
- boolean contains(double x, double y, double w, double h);
-
- /**
- * Test if a high-precision rectangle lies completely in the shape. This is
- * true if all points in the rectangle are in the shape, with the caveat
- * that the operation may include high probability estimates when the actual
- * calculation is prohibitively expensive. The {@link java.awt.geom.Area}
- * class can be used for more precise answers.
- *
- * @param r the rectangle
- * @return true if the rectangle is contained in this shape
- * @throws NullPointerException if r is null
- * @see #contains(double, double, double, double)
- * @since 1.2
- */
- boolean contains(Rectangle2D r);
-
- /**
- * Return an iterator along the shape boundary. If the optional transform
- * is provided, the iterator is transformed accordingly. Each call returns
- * a new object, independent from others in use. It is recommended, but
- * not required, that the Shape isolate iterations from future changes to
- * the boundary, and document this fact.
- *
- * @param transform an optional transform to apply to the iterator
- * @return a new iterator over the boundary
- * @since 1.2
- */
- PathIterator getPathIterator(AffineTransform transform);
-
- /**
- * Return an iterator along the flattened version of the shape boundary.
- * Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE points are returned in the
- * iterator. The flatness paramter controls how far points are allowed to
- * differ from the real curve; although a limit on accuracy may cause this
- * parameter to be enlarged if needed.
- *
- * <p>If the optional transform is provided, the iterator is transformed
- * accordingly. Each call returns a new object, independent from others in
- * use. It is recommended, but not required, that the Shape isolate
- * iterations from future changes to the boundary, and document this fact.
- *
- * @param transform an optional transform to apply to the iterator
- * @param flatness the maximum distance for deviation from the real boundary
- * @return a new iterator over the boundary
- * @since 1.2
- */
- PathIterator getPathIterator(AffineTransform transform, double flatness);
-} // interface Shape
diff --git a/libjava/java/awt/Stroke.java b/libjava/java/awt/Stroke.java
deleted file mode 100644
index 1a4c61cfb1f..00000000000
--- a/libjava/java/awt/Stroke.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Stroke.java -- a stroked outline of a shape
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * This interface allows a Graphics2D to grab the outline of a shape, as if
- * stroked by a marking pen of appropriate size and shape. The area inked
- * by the pen is the area of this stroke. Anything in the graphic which
- * traces an outline will use this stroke, such as <code>drawLine</code>.
- * Strokes must be immutable, because the graphics object does not clone
- * them.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see BasicStroke
- * @see Graphics2D#setStroke(Stroke)
- * @since 1.1
- * @status updated to 1.4
- */
-public interface Stroke
-{
- /**
- * Returns a shape which outlines the boundary of the given shape, in
- * effect converting the infinitely thin line into a new shape.
- *
- * @param s the shape to stroke
- * @return the stroked outline shape
- */
- Shape createStrokedShape(Shape s);
-} // interface Stroke
diff --git a/libjava/java/awt/SystemColor.java b/libjava/java/awt/SystemColor.java
deleted file mode 100644
index 2ead74a0dbd..00000000000
--- a/libjava/java/awt/SystemColor.java
+++ /dev/null
@@ -1,462 +0,0 @@
-/* SystemColor.java -- access dynamic system color values
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.ColorModel;
-import java.io.Serializable;
-
-/**
- * This class contains the various "system colors" in use by the native
- * windowing system. The <code>getRGB()</code> method is dynamic on systems
- * which support dynamic system color changes, and most methods in the
- * superclass are written to use this dynamic value when reporting colors.
- * However, the <code>equals()</code> method is not dynamic, and does not
- * track the actual color of instances in this class. This means that equals
- * may give surprising results; you are better off relying on getRGB.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status updated to 1.4
- */
-public final class SystemColor extends Color implements Serializable
-{
- // Implementation note: To be serial compatible with JDK, this class must
- // violate the semantic meaning of super.value to be one of the
- // NUM_COLORS constants instead of the actual RGB value. Hence there are
- // a lot of ugly workarounds in Color and in this class. I would have
- // designed it MUCH differently, making a separate id field in this class.
-
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 4503142729533789064L;
-
- /**
- * Array index of the desktop color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #desktop
- */
- public static final int DESKTOP = 0;
-
- /**
- * Array index of the active caption color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #activeCaption
- */
- public static final int ACTIVE_CAPTION = 1;
-
- /**
- * Array index of the active caption text color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #activeCaptionText
- */
- public static final int ACTIVE_CAPTION_TEXT = 2;
-
- /**
- * Array index of the active caption border color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #activeCaptionBorder
- */
- public static final int ACTIVE_CAPTION_BORDER = 3;
-
- /**
- * Array index of the inactive caption color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #inactiveCaption
- */
- public static final int INACTIVE_CAPTION = 4;
-
- /**
- * Array index of the inactive caption text color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #inactiveCaptionText
- */
- public static final int INACTIVE_CAPTION_TEXT = 5;
-
- /**
- * Array index of the inactive caption border color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #inactiveCaptionBorder
- */
- public static final int INACTIVE_CAPTION_BORDER = 6;
-
- /**
- * Array index of the window background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #window
- */
- public static final int WINDOW = 7;
-
- /**
- * Array index of the window border color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #windowBorder
- */
- public static final int WINDOW_BORDER = 8;
-
- /**
- * Array index of the window text color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #windowText
- */
- public static final int WINDOW_TEXT = 9;
-
- /**
- * Array index of the menu background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #menu
- */
- public static final int MENU = 10;
-
- /**
- * Array index of the menu text color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #menuText
- */
- public static final int MENU_TEXT = 11;
-
- /**
- * Array index of the text background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #text
- */
- public static final int TEXT = 12;
-
- /**
- * Array index of the text foreground color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #textText
- */
- public static final int TEXT_TEXT = 13;
-
- /**
- * Array index of the highlighted text background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #textHighlight
- */
- public static final int TEXT_HIGHLIGHT = 14;
-
- /**
- * Array index of the highlighted text foreground color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #textHighlightText
- */
- public static final int TEXT_HIGHLIGHT_TEXT = 15;
-
- /**
- * Array index of the inactive text foreground color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #textInactiveText
- */
- public static final int TEXT_INACTIVE_TEXT = 16;
-
- /**
- * Array index of the control background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #control
- */
- public static final int CONTROL = 17;
-
- /**
- * Array index of the control text color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #controlText
- */
- public static final int CONTROL_TEXT = 18;
-
- /**
- * Array index of the highlighted control background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #controlHighlight
- */
- public static final int CONTROL_HIGHLIGHT = 19;
-
- /**
- * Array index of the lightly highlighted control background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #controlLtHighlight
- */
- public static final int CONTROL_LT_HIGHLIGHT = 20;
-
- /**
- * Array index of the shadowed control background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #controlShadow
- */
- public static final int CONTROL_SHADOW = 21;
-
- /**
- * Array index of the darkly shadowed control background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #controlDkShadow
- */
- public static final int CONTROL_DK_SHADOW = 22;
-
- /**
- * Array index of the scrollbar background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #scrollbar
- */
- public static final int SCROLLBAR = 23;
-
- /**
- * Array index of the info background color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #info
- */
- public static final int INFO = 24;
-
- /**
- * Array index of the info text color. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- *
- * @see #infoText
- */
- public static final int INFO_TEXT = 25;
-
- /**
- * The number of system colors. Used by
- * {@link Toolkit#loadSystemColors(int[])}.
- */
- public static final int NUM_COLORS = 26;
-
- /**
- * The internal array used to dynamically update <code>getRGB()</code>.
- */
- private static final int[] colors = new int[NUM_COLORS];
-
- /** The desktop color. */
- public static final SystemColor desktop
- = new SystemColor(DESKTOP);
-
- /** The active caption background color. */
- public static final SystemColor activeCaption
- = new SystemColor(ACTIVE_CAPTION);
-
- /** The active caption text color. */
- public static final SystemColor activeCaptionText
- = new SystemColor(ACTIVE_CAPTION_TEXT);
-
- /** The active caption border color. */
- public static final SystemColor activeCaptionBorder
- = new SystemColor(ACTIVE_CAPTION_BORDER);
-
- /** The inactive caption background color. */
- public static final SystemColor inactiveCaption
- = new SystemColor(INACTIVE_CAPTION);
-
- /** The inactive caption text color. */
- public static final SystemColor inactiveCaptionText
- = new SystemColor(INACTIVE_CAPTION_TEXT);
-
- /** The inactive caption border color. */
- public static final SystemColor inactiveCaptionBorder
- = new SystemColor(INACTIVE_CAPTION_BORDER);
-
- /** The window background color. */
- public static final SystemColor window
- = new SystemColor(WINDOW);
-
- /** The window border color. */
- public static final SystemColor windowBorder
- = new SystemColor(WINDOW_BORDER);
-
- /** The window text color. */
- public static final SystemColor windowText
- = new SystemColor(WINDOW_TEXT);
-
- /** The menu background color. */
- public static final SystemColor menu
- = new SystemColor(MENU);
-
- /** The menu text color. */
- public static final SystemColor menuText
- = new SystemColor(MENU_TEXT);
-
- /** The text background color. */
- public static final SystemColor text
- = new SystemColor(TEXT);
-
- /** The text foreground color. */
- public static final SystemColor textText
- = new SystemColor(TEXT_TEXT);
-
- /** The highlighted text background color. */
- public static final SystemColor textHighlight
- = new SystemColor(TEXT_HIGHLIGHT);
-
- /** The highlighted text foreground color. */
- public static final SystemColor textHighlightText
- = new SystemColor(TEXT_HIGHLIGHT_TEXT);
-
- /** The inactive text color. */
- public static final SystemColor textInactiveText
- = new SystemColor(TEXT_INACTIVE_TEXT);
-
- /** The control background color. */
- public static final SystemColor control
- = new SystemColor(CONTROL);
-
- /** The control text color. */
- public static final SystemColor controlText
- = new SystemColor(CONTROL_TEXT);
-
- /** The control highlight color. */
- public static final SystemColor controlHighlight
- = new SystemColor(CONTROL_HIGHLIGHT);
-
- /** The control light highlight color. */
- public static final SystemColor controlLtHighlight
- = new SystemColor(CONTROL_LT_HIGHLIGHT);
-
- /** The control shadow color. */
- public static final SystemColor controlShadow
- = new SystemColor(CONTROL_SHADOW);
-
- /** The control dark shadow color. */
- public static final SystemColor controlDkShadow
- = new SystemColor(CONTROL_DK_SHADOW);
-
- /** The scrollbar color. */
- public static final SystemColor scrollbar
- = new SystemColor(SCROLLBAR);
-
- /** The info text background color. */
- public static final SystemColor info
- = new SystemColor(INFO);
-
- /** The info text foreground color. */
- public static final SystemColor infoText
- = new SystemColor(INFO_TEXT);
-
- /**
- * Construct a system color which is dynamically updated.
- *
- * @param id the color id
- */
- private SystemColor(int id)
- {
- // Note: See Color#Color(int, boolean) to explain why we use this
- // particular constructor.
- super(id, true);
- }
-
- /**
- * Returns the RGB value for this color, in the sRGB color space. The blue
- * value will be in bits 0-7, green in 8-15, red in 6-23, and the alpha
- * value (bits 24-31) is 0xff. This is dynamically updated, so it may not
- * match the results of <code>getRed()</code>, <code>getGreen()</code>, or
- * <code>getBlue()</code>.
- *
- * @return the current RGB value
- */
- public int getRGB()
- {
- Toolkit.getDefaultToolkit().loadSystemColors(colors);
- return colors[value] | ALPHA_MASK;
- }
-
- /**
- * Returns a paint context, used for filling areas of a raster scan with
- * the current value of this system color. Since the system colors may be
- * dynamically updated, the returned value may not always be the same; but
- * as the system color is solid, the context does not need any of the
- * passed parameters to do its job.
- *
- * @param cm the requested color model
- * @param deviceBounds the bounding box in device coordinates, ignored
- * @param userBounds the bounding box in user coordinates, ignored
- * @param xform the bounds transformation, ignored
- * @param hints any rendering hints, ignored
- * @return a context for painting this solid color
- */
- public PaintContext createContext(ColorModel cm, Rectangle deviceBounds,
- Rectangle2D userBounds,
- AffineTransform xform,
- RenderingHints hints)
- {
- Toolkit.getDefaultToolkit().loadSystemColors(colors);
- int color = colors[value] | ALPHA_MASK;
- if (context == null || color != context.color || !context.getColorModel().equals(cm))
- context = new ColorPaintContext(cm,color);
- return context;
- }
-
- /**
- * Returns a string describing this color. This is in the format
- * "java.awt.SystemColor[i=" + index + ']', where index is one of the
- * integer constants of this class. Unfortunately, this description
- * does not describe the current value of the color; for that you should
- * use <code>new Color(syscolor.getRGB()).toString()</code>.
- *
- * @return a string describing this color
- */
- public String toString()
- {
- return "java.awt.SystemColor[i=" + value + ']';
- }
-} // class SystemColor
diff --git a/libjava/java/awt/TextArea.java b/libjava/java/awt/TextArea.java
deleted file mode 100644
index d422d3306d2..00000000000
--- a/libjava/java/awt/TextArea.java
+++ /dev/null
@@ -1,629 +0,0 @@
-/* TextArea.java -- A multi-line text entry component
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.KeyEvent;
-import java.awt.peer.ComponentPeer;
-import java.awt.peer.TextAreaPeer;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleStateSet;
-
-
-/**
- * A TextArea is a text component capable of displaying multiple lines
- * of user-editable text. A TextArea handles its own scrolling and
- * can display vertical and horizontal scrollbars as navigation aids.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class TextArea extends TextComponent implements java.io.Serializable
-{
- /**
- * Display both horiztonal and vertical scroll bars.
- */
- public static final int SCROLLBARS_BOTH = 0;
-
- /**
- * Display vertical scroll bar only.
- */
- public static final int SCROLLBARS_VERTICAL_ONLY = 1;
-
- /**
- * Display horizatonal scroll bar only.
- */
- public static final int SCROLLBARS_HORIZONTAL_ONLY = 2;
-
- /**
- * Do not display scrollbars.
- */
- public static final int SCROLLBARS_NONE = 3;
-
- /**
- * Serialization constant.
- */
- private static final long serialVersionUID = 3692302836626095722L;
-
- /**
- * @serial The number of columns used in this text area's preferred
- * and minimum size calculations.
- */
- private int columns;
-
- /**
- * @serial The number of rows used in this text area's preferred and
- * minimum size calculations.
- */
- private int rows;
-
- /**
- * @serial The scrollbar display policy. One of SCROLLBARS_BOTH,
- * SCROLLBARS_VERTICAL_ONLY, SCROLLBARS_HORIZONTAL_ONLY,
- * SCROLLBARS_NONE.
- */
- private int scrollbarVisibility;
-
- /*
- * The number used to generate the name returned by getName.
- */
- private static transient long next_text_number;
-
- /**
- * Initialize a new instance of <code>TextArea</code> that is empty.
- * Conceptually the <code>TextArea</code> has 0 rows and 0 columns
- * but its initial bounds are defined by its peer or by the
- * container in which it is packed. Both horizontal and vertical
- * scrollbars will be displayed.
- *
- * @exception HeadlessException if GraphicsEnvironment.isHeadless () is true
- */
- public TextArea ()
- {
- this ("", 0, 0, SCROLLBARS_BOTH);
- }
-
- /**
- * Initialize a new instance of <code>TextArea</code> that contains
- * the specified text. Conceptually the <code>TextArea</code> has 0
- * rows and 0 columns but its initial bounds are defined by its peer
- * or by the container in which it is packed. Both horizontal and
- * veritcal scrollbars will be displayed.
- *
- * @param text The text to display in this text area.
- *
- * @exception HeadlessException if GraphicsEnvironment.isHeadless () is true
- */
- public TextArea (String text)
- {
- this (text, 0, 0, SCROLLBARS_BOTH);
- }
-
- /**
- * Initialize a new instance of <code>TextArea</code> that is empty
- * and can display the specified number of rows and columns of text,
- * without the need to scroll. Both horizontal and vertical
- * scrollbars will be displayed.
- *
- * @param rows The number of rows in this text area.
- * @param columns The number of columns in this text area.
- *
- * @exception HeadlessException if GraphicsEnvironment.isHeadless () is true
- */
- public TextArea (int rows, int columns)
- {
- this ("", rows, columns, SCROLLBARS_BOTH);
- }
-
- /**
- * Initialize a new instance of <code>TextArea</code> that can
- * display the specified number of rows and columns of text, without
- * the need to scroll. The TextArea initially contains the
- * specified text.
- *
- * @param text The text to display in this text area.
- * @param rows The number of rows in this text area.
- * @param columns The number of columns in this text area.
- *
- * @exception HeadlessException if GraphicsEnvironment.isHeadless () is true
- */
- public TextArea (String text, int rows, int columns)
- {
- this (text, rows, columns, SCROLLBARS_BOTH);
- }
-
- /**
- * Initialize a new instance of <code>TextArea</code> that initially
- * contains the specified text. The TextArea can display the
- * specified number of rows and columns of text, without the need to
- * scroll. This constructor allows specification of the scroll bar
- * display policy.
- *
- * @param text The text to display in this text area.
- * @param rows The number of rows in this text area.
- * @param columns The number of columns in this text area.
- * @param scrollbarVisibility The scroll bar display policy. One of
- * SCROLLBARS_BOTH, SCROLLBARS_VERTICAL_ONLY,
- * SCROLLBARS_HORIZONTAL_ONLY, SCROLLBARS_NONE.
- *
- * @exception HeadlessException if GraphicsEnvironment.isHeadless () is true
- */
- public TextArea (String text, int rows, int columns, int scrollbarVisibility)
- {
- super (text);
-
- if (GraphicsEnvironment.isHeadless ())
- throw new HeadlessException ();
-
- if (rows < 0 || columns < 0)
- throw new IllegalArgumentException ("Bad row or column value");
-
- if (scrollbarVisibility != SCROLLBARS_BOTH
- && scrollbarVisibility != SCROLLBARS_VERTICAL_ONLY
- && scrollbarVisibility != SCROLLBARS_HORIZONTAL_ONLY
- && scrollbarVisibility != SCROLLBARS_NONE)
- throw new IllegalArgumentException ("Bad scrollbar visibility value");
-
- this.rows = rows;
- this.columns = columns;
- this.scrollbarVisibility = scrollbarVisibility;
-
- // TextAreas need to receive tab key events so we override the
- // default forward and backward traversal key sets.
- Set s = new HashSet ();
- s.add (AWTKeyStroke.getAWTKeyStroke (KeyEvent.VK_TAB,
- KeyEvent.CTRL_DOWN_MASK));
- setFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, s);
- s = new HashSet ();
- s.add (AWTKeyStroke.getAWTKeyStroke (KeyEvent.VK_TAB,
- KeyEvent.SHIFT_DOWN_MASK
- | KeyEvent.CTRL_DOWN_MASK));
- setFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, s);
- }
-
- /**
- * Retrieve the number of columns that this text area would prefer
- * to display. This value may or may not correspond to the number
- * of columns that are actually displayed.
- *
- * @return The preferred number of columns.
- */
- public int getColumns ()
- {
- return columns;
- }
-
- /**
- * Set the preferred number of columns for this text area. This
- * method does not cause the number of columns displayed by the text
- * area to be updated, if the text area is currently visible.
- *
- * @param columns The preferred number of columns.
- *
- * @exception IllegalArgumentException If columns is less than zero.
- */
- public synchronized void setColumns (int columns)
- {
- if (columns < 0)
- throw new IllegalArgumentException ("Value is less than zero: "
- + columns);
-
- this.columns = columns;
- }
-
- /**
- * Retrieve the number of rows that this text area would prefer to
- * display. This value may or may not correspond to the number of
- * rows that are actually displayed.
- *
- * @return The preferred number of rows.
- */
- public int getRows ()
- {
- return rows;
- }
-
- /**
- * Set the preferred number of rows for this text area. This method
- * does not cause the number of columns displayed by the text area
- * to be updated, if the text area is currently visible.
- *
- * @param rows The preferred number of rows.
- *
- * @exception IllegalArgumentException If rows is less than zero.
- */
- public synchronized void setRows (int rows)
- {
- if (rows < 1)
- throw new IllegalArgumentException ("Value is less than one: " + rows);
-
- this.rows = rows;
- }
-
- /**
- * Retrieve the minimum size for this text area, considering the
- * text area's current row and column values. A text area's minimum
- * size depends on the number of rows and columns of text it would
- * prefer to display, and on the size of the font in which the text
- * would be displayed.
- *
- * @return The minimum size for this text field.
- */
- public Dimension getMinimumSize ()
- {
- return getMinimumSize (getRows (), getColumns ());
- }
-
- /**
- * Retrieve the minimum size that this text area would have if its
- * row and column values were equal to those specified. A text
- * area's minimum size depends on the number of rows and columns of
- * text it would prefer to display, and on the size of the font in
- * which the text would be displayed.
- *
- * @param rows The number of rows to use in the minimum size
- * calculation.
- * @param columns The number of columns to use in the minimum size
- * calculation.
- *
- * @return The minimum size for this text area.
- */
- public Dimension getMinimumSize (int rows, int columns)
- {
- return minimumSize (rows, columns);
- }
-
- /**
- * Retrieve the minimum size for this text area, considering the
- * text area's current row and column values. A text area's minimum
- * size depends on the number of rows and columns of text it would
- * prefer to display, and on the size of the font in which the text
- * would be displayed.
- *
- * @return The minimum size for this text area.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getMinimumSize ()</code>.
- */
- public Dimension minimumSize ()
- {
- return minimumSize (getRows (), getColumns ());
- }
-
- /**
- * Retrieve the minimum size that this text area would have if its
- * row and column values were equal to those specified. A text
- * area's minimum size depends on the number of rows and columns of
- * text it would prefer to display, and on the size of the font in
- * which the text would be displayed.
- *
- * @param rows The number of rows to use in the minimum size
- * calculation.
- * @param columns The number of columns to use in the minimum size
- * calculation.
- *
- * @return The minimum size for this text area.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getMinimumSize (int, int)</code>.
- */
- public Dimension minimumSize (int rows, int columns)
- {
- TextAreaPeer peer = (TextAreaPeer) getPeer ();
-
- // Sun returns Dimension (0,0) in this case.
- if (peer == null)
- return new Dimension (0, 0);
-
- return peer.getMinimumSize (rows, columns);
- }
-
- /**
- * Retrieve the preferred size for this text area, considering the
- * text area's current row and column values. A text area's preferred
- * size depends on the number of rows and columns of text it would
- * prefer to display, and on the size of the font in which the text
- * would be displayed.
- *
- * @return The preferred size for this text field.
- */
- public Dimension getPreferredSize ()
- {
- return getPreferredSize (getRows (), getColumns ());
- }
-
- /**
- * Retrieve the preferred size that this text area would have if its
- * row and column values were equal to those specified. A text
- * area's preferred size depends on the number of rows and columns
- * of text it would prefer to display, and on the size of the font
- * in which the text would be displayed.
- *
- * @param rows The number of rows to use in the preferred size
- * calculation.
- * @param columns The number of columns to use in the preferred size
- * calculation.
- *
- * @return The preferred size for this text area.
- */
- public Dimension getPreferredSize (int rows, int columns)
- {
- return preferredSize (rows, columns);
- }
-
- /**
- * Retrieve the preferred size for this text area, considering the
- * text area's current row and column values. A text area's preferred
- * size depends on the number of rows and columns of text it would
- * prefer to display, and on the size of the font in which the text
- * would be displayed.
- *
- * @return The preferred size for this text field.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getPreferredSize ()</code>.
- */
- public Dimension preferredSize ()
- {
- return preferredSize (getRows (), getColumns ());
- }
-
- /**
- * Retrieve the preferred size that this text area would have if its
- * row and column values were equal to those specified. A text
- * area's preferred size depends on the number of rows and columns
- * of text it would prefer to display, and on the size of the font
- * in which the text would be displayed.
- *
- * @param rows The number of rows to use in the preferred size
- * calculation.
- * @param columns The number of columns to use in the preferred size
- * calculation.
- *
- * @return The preferred size for this text area.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getPreferredSize (int, int)</code>.
- */
- public Dimension preferredSize (int rows, int columns)
- {
- TextAreaPeer peer = (TextAreaPeer) getPeer ();
-
- // Sun returns Dimension (0,0) in this case.
- if (peer == null)
- return new Dimension (0, 0);
-
- return peer.getPreferredSize (rows, columns);
- }
-
- /**
- * Retrieve the scroll bar display policy -- one of SCROLLBARS_BOTH,
- * SCROLLBARS_VERTICAL_ONLY, SCROLLBARS_HORIZONTAL_ONLY,
- * SCROLLBARS_NONE.
- *
- * @return The current scroll bar display policy.
- */
- public int getScrollbarVisibility ()
- {
- return scrollbarVisibility;
- }
-
- /**
- * Notify this object that it should create its native peer.
- */
- public void addNotify ()
- {
- if (getPeer () == null)
- setPeer ((ComponentPeer) getToolkit().createTextArea (this));
- }
-
- /**
- * Append the specified text to the end of the current text.
- *
- * @param str The text to append.
- */
- public void append (String str)
- {
- appendText (str);
- }
-
- /**
- * Append the specified text to the end of the current text.
- *
- * @param str The text to append.
- *
- * @deprecated This method is deprecated in favor of
- * <code>append ()</code>.
- */
- public void appendText (String str)
- {
- TextAreaPeer peer = (TextAreaPeer) getPeer ();
-
- if (peer != null)
- peer.insert (str, peer.getText().length ());
- }
-
- /**
- * Insert the specified text at the specified position. The first
- * character in the text area is at position zero.
- *
- * @param str The text to insert.
- * @param pos The position at which to insert text.
- */
- public void insert (String str, int pos)
- {
- insertText (str, pos);
- }
-
- /**
- * Insert the specified text at the specified position. The first
- * character in the text area is at position zero.
- *
- * @param str The text to insert.
- * @param pos The position at which to insert text.
- *
- * @deprecated This method is deprecated in favor of
- * <code>insert ()</code>.
- */
- public void insertText (String str, int pos)
- {
- TextAreaPeer peer = (TextAreaPeer) getPeer ();
-
- if (peer != null)
- peer.insert (str, pos);
- }
-
- /**
- * Replace a range of characters with the specified text. The
- * character at the start position will be replaced, unless start ==
- * end. The character at the end posistion will not be replaced.
- * The first character in the text area is at position zero. The
- * length of the replacement text may differ from the length of the
- * text that is replaced.
- *
- * @param str The new text for the range.
- * @param start The start position of the replacement range.
- * @param end The end position of the replacement range.
- */
- public void replaceRange (String str, int start, int end)
- {
- replaceText (str, start, end);
- }
-
- /**
- * Replace a range of characters with the specified text. The
- * character at the start position will be replaced, unless start ==
- * end. The character at the end posistion will not be replaced.
- * The first character in the text area is at position zero. The
- * length of the replacement text may differ from the length of the
- * text that is replaced.
- *
- * @param str The new text for the range.
- * @param start The start position of the replacement range.
- * @param end The end position of the replacement range.
- *
- * @deprecated This method is deprecated in favor of
- * <code>replaceRange ()</code>.
- */
- public void replaceText (String str, int start, int end)
- {
- TextAreaPeer peer = (TextAreaPeer) getPeer ();
-
- if (peer != null)
- peer.replaceRange (str, start, end);
- }
-
- /**
- * Retrieve a debugging string for this text area.
- *
- * @return A debugging string for this text area.
- */
- protected String paramString ()
- {
- String sbVisibility = "";
-
- switch (scrollbarVisibility)
- {
- case SCROLLBARS_BOTH:
- sbVisibility = "both";
- break;
- case SCROLLBARS_VERTICAL_ONLY:
- sbVisibility = "vertical-only";
- break;
- case SCROLLBARS_HORIZONTAL_ONLY:
- sbVisibility = "horizontal-only";
- break;
- case SCROLLBARS_NONE:
- sbVisibility = "none";
- break;
- }
-
- String editable = "";
- if (isEditable ())
- editable = "editable,";
-
- return getName () + "," + getX () + "," + getY () + "," + getWidth ()
- + "x" + getHeight () + "," + "text=" + getText () + "," + editable
- + "selection=" + getSelectionStart () + "-" + getSelectionEnd ()
- + ",rows=" + rows + ",columns=" + columns + ",scrollbarVisibility="
- + sbVisibility;
- }
-
- /**
- * Generate a unique name for this text area.
- *
- * @return A unique name for this text area.
- */
- String generateName ()
- {
- return "text" + getUniqueLong ();
- }
-
- private static synchronized long getUniqueLong ()
- {
- return next_text_number++;
- }
-
- protected class AccessibleAWTTextArea extends AccessibleAWTTextComponent
- {
- protected AccessibleAWTTextArea()
- {
- }
-
- public AccessibleStateSet getAccessibleStateSet()
- {
- return super.getAccessibleStateSet();
- }
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>TextArea</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTTextArea();
- return accessibleContext;
- }
-}
diff --git a/libjava/java/awt/TextComponent.java b/libjava/java/awt/TextComponent.java
deleted file mode 100644
index 9edbd88fe33..00000000000
--- a/libjava/java/awt/TextComponent.java
+++ /dev/null
@@ -1,739 +0,0 @@
-/* TextComponent.java -- Widgets for entering text
- Copyright (C) 1999, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.TextEvent;
-import java.awt.event.TextListener;
-import java.awt.peer.TextComponentPeer;
-import java.io.Serializable;
-import java.text.BreakIterator;
-import java.util.EventListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleState;
-import javax.accessibility.AccessibleStateSet;
-import javax.accessibility.AccessibleText;
-import javax.swing.text.AttributeSet;
-
-/**
- * This class provides common functionality for widgets than
- * contain text.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class TextComponent extends Component
- implements Serializable, Accessible
-{
-
-/*
- * Static Variables
- */
-
-// Constant for serialization
-private static final long serialVersionUID = -2214773872412987419L;
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial Indicates whether or not this component is editable.
- * This is package-private to avoid an accessor method.
- */
-boolean editable;
-
-/**
- * @serial The starting position of the selected text region.
- * This is package-private to avoid an accessor method.
- */
-int selectionStart;
-
-/**
- * @serial The ending position of the selected text region.
- * This is package-private to avoid an accessor method.
- */
-int selectionEnd;
-
-/**
- * @serial The text in the component
- * This is package-private to avoid an accessor method.
- */
-String text;
-
-/**
- * A list of listeners that will receive events from this object.
- */
-protected transient TextListener textListener;
-
- protected class AccessibleAWTTextComponent
- extends AccessibleAWTComponent
- implements AccessibleText, TextListener
- {
- // Constructor
- // Adds a listener for tracking caret changes
- public AccessibleAWTTextComponent()
- {
- TextComponent.this.addTextListener(this);
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.TEXT;
- }
-
- public AccessibleStateSet getAccessibleStateSet()
- {
- // TODO: Docs say PropertyChangeEvent will fire if this state changes.
- // That means that the event has to fire when editable changes.
- AccessibleStateSet ss = super.getAccessibleStateSet();
- if (editable)
- ss.add(AccessibleState.EDITABLE);
- return ss;
- }
-
- public AccessibleText getAccessibleText()
- {
- return this;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getIndexAtPoint(java.awt.Point)
- */
- public int getIndexAtPoint(Point point)
- {
- return TextComponent.this.getIndexAtPoint(point);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getCharacterBounds(int)
- */
- public Rectangle getCharacterBounds(int index)
- {
- return TextComponent.this.getCharacterBounds(index);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getCharCount()
- */
- public int getCharCount()
- {
- return text.length();
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getCaretPosition()
- */
- public int getCaretPosition()
- {
- return TextComponent.this.getCaretPosition();
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getAtIndex(int, int)
- */
- public String getAtIndex(int part, int index)
- {
- if (index < 0 || index >= text.length())
- return null;
- BreakIterator it = null;
- switch (part)
- {
- case CHARACTER:
- return text.substring(index, index + 1);
- case WORD:
- it = BreakIterator.getWordInstance();
- break;
- case SENTENCE:
- it = BreakIterator.getSentenceInstance();
- break;
- default:
- return null;
- }
- it.setText(text);
- int start = index;
- if (!it.isBoundary(index))
- start = it.preceding(index);
- int end = it.following(index);
- if (end == -1)
- return text.substring(index);
- else
- return text.substring(index, end);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getAfterIndex(int, int)
- */
- public String getAfterIndex(int part, int index) {
- if (index < 0 || index >= text.length())
- return null;
- BreakIterator it = null;
- switch (part)
- {
- case CHARACTER:
- return text.substring(index, index + 1);
- case WORD:
- it = BreakIterator.getWordInstance();
- break;
- case SENTENCE:
- it = BreakIterator.getSentenceInstance();
- break;
- default:
- return null;
- }
- it.setText(text);
- int start = index;
- if (!it.isBoundary(index))
- start = it.following(index);
- // Make sure there was a complete unit. I.e. if index is in the middle
- // of a word, return null if there is no word after the that one.
- if (start == -1)
- return null;
- int end = it.following(start);
- if (end == -1)
- return text.substring(index);
- else
- return text.substring(index, end);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getBeforeIndex(int, int)
- */
- public String getBeforeIndex(int part, int index)
- {
- if (index < 1 || index >= text.length())
- return null;
- BreakIterator it = null;
- switch (part)
- {
- case CHARACTER:
- return text.substring(index - 1, index);
- case WORD:
- it = BreakIterator.getWordInstance();
- break;
- case SENTENCE:
- it = BreakIterator.getSentenceInstance();
- break;
- default:
- return null;
- }
- it.setText(text);
- int end = index;
- if (!it.isBoundary(index))
- end = it.preceding(index);
- // Make sure there was a complete unit. I.e. if index is in the middle
- // of a word, return null if there is no word before that one.
- if (end == -1)
- return null;
- int start = it.preceding(end);
- if (start == -1)
- return text.substring(0, end);
- else
- return text.substring(start, end);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getCharacterAttribute(int)
- */
- public AttributeSet getCharacterAttribute(int index)
- {
- // FIXME: I suspect this really gets filled in by subclasses.
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getSelectionStart()
- */
- public int getSelectionStart() {
- // TODO Auto-generated method stub
- return selectionStart;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getSelectionEnd()
- */
- public int getSelectionEnd()
- {
- return selectionEnd;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleText#getSelectedText()
- */
- public String getSelectedText()
- {
- if (selectionEnd - selectionStart > 0)
- return text.substring(selectionStart, selectionEnd);
- else
- return null;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.TextListener#textValueChanged(java.awt.event.TextEvent)
- */
- public void textValueChanged(TextEvent event)
- {
- // TODO Auto-generated method stub
-
- }
-
- }
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-TextComponent(String text)
-{
- this.text = text;
- this.editable = true;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the text in this component
- *
- * @return The text in this component.
- */
-public synchronized String
-getText()
-{
- TextComponentPeer tcp = (TextComponentPeer)getPeer();
- if (tcp != null)
- text = tcp.getText();
-
- return(text);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the text in this component to the specified string.
- *
- * @param text The new text for this component.
- */
-public synchronized void
-setText(String text)
-{
- if (text == null)
- text = "";
-
- this.text = text;
-
- TextComponentPeer tcp = (TextComponentPeer)getPeer();
- if (tcp != null)
- tcp.setText(text);
- setCaretPosition(0);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a string that contains the text that is currently selected.
- *
- * @return The currently selected text region.
- */
-public synchronized String
-getSelectedText()
-{
- String alltext = getText();
- int start = getSelectionStart();
- int end = getSelectionEnd();
-
- return(alltext.substring(start, end));
-}
-
-/*************************************************************************/
-
-/**
- * Returns the starting position of the selected text region.
- * If the text is not selected then caret position is returned.
- *
- * @return The starting position of the selected text region.
- */
-public synchronized int
-getSelectionStart()
-{
- TextComponentPeer tcp = (TextComponentPeer)getPeer();
- if (tcp != null)
- selectionStart = tcp.getSelectionStart();
-
- return(selectionStart);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the starting position of the selected region to the
- * specified value. If the specified value is out of range, then it
- * will be silently changed to the nearest legal value.
- *
- * @param selectionStart The new start position for selected text.
- */
-public synchronized void
-setSelectionStart(int selectionStart)
-{
- select(selectionStart, getSelectionEnd());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the ending position of the selected text region.
- * If the text is not selected, then caret position is returned
- *
- * @return The ending position of the selected text region.
- */
-public synchronized int
-getSelectionEnd()
-{
- TextComponentPeer tcp = (TextComponentPeer)getPeer();
- if (tcp != null)
- selectionEnd = tcp.getSelectionEnd();
-
- return(selectionEnd);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the ending position of the selected region to the
- * specified value. If the specified value is out of range, then it
- * will be silently changed to the nearest legal value.
- *
- * @param selectionEnd The new start position for selected text.
- */
-public synchronized void
-setSelectionEnd(int selectionEnd)
-{
- select(getSelectionStart(), selectionEnd);
-}
-
-/*************************************************************************/
-
-/**
- * This method sets the selected text range to the text between the
- * specified start and end positions. Illegal values for these
- * positions are silently fixed.
- *
- * @param selectionStart The new start position for the selected text.
- * @param selectionEnd The new end position for the selected text.
- */
-public synchronized void
-select(int selectionStart, int selectionEnd)
-{
- if (selectionStart < 0)
- selectionStart = 0;
-
- if (selectionStart > getText().length())
- selectionStart = text.length();
-
- if (selectionEnd > text.length())
- selectionEnd = text.length();
-
- if (selectionStart > getSelectionEnd())
- selectionStart = selectionEnd;
-
- this.selectionStart = selectionStart;
- this.selectionEnd = selectionEnd;
-
- TextComponentPeer tcp = (TextComponentPeer)getPeer();
- if (tcp != null)
- tcp.select(selectionStart, selectionEnd);
-}
-
-/*************************************************************************/
-
-/**
- * Selects all of the text in the component.
- */
-public synchronized void
-selectAll()
-{
- select(0, getText().length());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the current caret position in the text.
- *
- * @return The caret position in the text.
- */
-public synchronized int
-getCaretPosition()
-{
- TextComponentPeer tcp = (TextComponentPeer)getPeer();
- if (tcp != null)
- return(tcp.getCaretPosition());
- else
- return(0);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the caret position to the specified value.
- *
- * @param caretPosition The new caret position.
- *
- * @exception IllegalArgumentException If the value supplied for position
- * is less than zero.
- *
- * @since 1.1
- */
-public synchronized void
-setCaretPosition(int caretPosition)
-{
- if (caretPosition < 0)
- throw new IllegalArgumentException ();
-
- TextComponentPeer tcp = (TextComponentPeer)getPeer();
- if (tcp != null)
- tcp.setCaretPosition(caretPosition);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this component's text can be edited.
- *
- * @return <code>true</code> if the text can be edited, <code>false</code>
- * otherwise.
- */
-public boolean
-isEditable()
-{
- return(editable);
-}
-
-/*************************************************************************/
-
-/**
- * Sets whether or not this component's text can be edited.
- *
- * @param editable <code>true</code> to enable editing of the text,
- * <code>false</code> to disable it.
- */
-public synchronized void
-setEditable(boolean editable)
-{
- this.editable = editable;
-
- TextComponentPeer tcp = (TextComponentPeer)getPeer();
- if (tcp != null)
- tcp.setEditable(editable);
-}
-
-/*************************************************************************/
-
-/**
- * Notifies the component that it should destroy its native peer.
- */
-public void
-removeNotify()
-{
- super.removeNotify();
-}
-
-/*************************************************************************/
-
-/**
- * Adds a new listener to the list of text listeners for this
- * component.
- *
- * @param listener The listener to be added.
- */
-public synchronized void
-addTextListener(TextListener listener)
-{
- textListener = AWTEventMulticaster.add(textListener, listener);
-
- enableEvents(AWTEvent.TEXT_EVENT_MASK);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified listener from the list of listeners
- * for this component.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeTextListener(TextListener listener)
-{
- textListener = AWTEventMulticaster.remove(textListener, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Processes the specified event for this component. Text events are
- * processed by calling the <code>processTextEvent()</code> method.
- * All other events are passed to the superclass method.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof TextEvent)
- processTextEvent((TextEvent)event);
- else
- super.processEvent(event);
-}
-
-/*************************************************************************/
-
-/**
- * Processes the specified text event by dispatching it to any listeners
- * that are registered. Note that this method will only be called
- * if text event's are enabled. This will be true if there are any
- * registered listeners, or if the event has been specifically
- * enabled using <code>enableEvents()</code>.
- *
- * @param event The text event to process.
- */
-protected void
-processTextEvent(TextEvent event)
-{
- if (textListener != null)
- textListener.textValueChanged(event);
-}
-
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= TextEvent.TEXT_LAST
- && e.id >= TextEvent.TEXT_FIRST
- && (textListener != null
- || (eventMask & AWTEvent.TEXT_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string.
- *
- * @return A debugging string.
- */
-protected String
-paramString()
-{
- return(getClass().getName() + "(text=" + getText() + ")");
-}
-
- /**
- * Returns an array of all the objects currently registered as FooListeners
- * upon this <code>TextComponent</code>. 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)
- {
- if (listenerType == TextListener.class)
- return AWTEventMulticaster.getListeners (textListener, listenerType);
-
- return super.getListeners (listenerType);
- }
-
- /**
- * Returns all text listeners registered to this object.
- */
- public TextListener[] getTextListeners ()
- {
- return (TextListener[]) getListeners (TextListener.class);
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>TextComponent</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTTextComponent();
- return accessibleContext;
- }
-
-
- /*******************************/
- // Provide AccessibleAWTTextComponent access to several peer functions that
- // aren't publicly exposed. This is package-private to avoid an accessor
- // method.
- synchronized int
- getIndexAtPoint(Point p)
- {
- TextComponentPeer tcp = (TextComponentPeer)getPeer();
- if (tcp != null)
- return tcp.getIndexAtPoint(p.x, p.y);
- return -1;
- }
-
- synchronized Rectangle
- getCharacterBounds(int i)
- {
- TextComponentPeer tcp = (TextComponentPeer)getPeer();
- if (tcp != null)
- return tcp.getCharacterBounds(i);
- return null;
- }
-
-
-
-
-} // class TextComponent
-
diff --git a/libjava/java/awt/TextField.java b/libjava/java/awt/TextField.java
deleted file mode 100644
index 4d62d024aad..00000000000
--- a/libjava/java/awt/TextField.java
+++ /dev/null
@@ -1,541 +0,0 @@
-/* TextField.java -- A one line text entry field
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.peer.ComponentPeer;
-import java.awt.peer.TextFieldPeer;
-import java.util.EventListener;
-
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleStateSet;
-
-/**
- * This class implements a single line text entry field widget
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class TextField extends TextComponent
-{
-
-/*
- * Static Variables
- */
-
-// Serialization constant
-private static final long serialVersionUID = -2966288784432217853L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The number of columns in the text entry field.
- */
-private int columns;
-
-/**
- * @serial The character that is echoed when doing protected input
- */
-private char echoChar;
-
-// List of registered ActionListener's for this object.
-private ActionListener action_listeners;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>TextField</code> that is empty
- * and has one column.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
- */
-public
-TextField()
-{
- this("", 1);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>TextField</code> containing
- * the specified text. The number of columns will be equal to the
- * length of the text string.
- *
- * @param text The text to display in the field.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
- */
-public
-TextField(String text)
-{
- this(text, text.length());
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>TextField</code> that is empty
- * and has the specified number of columns.
- *
- * @param columns The number of columns in the text field.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
- */
-public
-TextField(int columns)
-{
- this("", columns);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>TextField</code> with the
- * specified text and number of columns.
- *
- * @param text The text to display in the field.
- * @param columns The number of columns in the field.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
- */
-public
-TextField(String text, int columns)
-{
- super(text);
- this.columns = columns;
-
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the number of columns in the field.
- *
- * @return The number of columns in the field.
- */
-public int
-getColumns()
-{
- return(columns);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the number of columns in this field to the specified value.
- *
- * @param columns The new number of columns in the field.
- *
- * @exception IllegalArgumentException If columns is less than zero.
- */
-public synchronized void
-setColumns(int columns)
-{
- if (columns < 0)
- throw new IllegalArgumentException("Value is less than zero: " +
- columns);
-
- this.columns = columns;
- // FIXME: How to we communicate this to our peer?
-}
-
-/*************************************************************************/
-
-/**
- * Returns the character that is echoed to the screen when a text
- * field is protected (such as when a password is being entered).
- *
- * @return The echo character for this text field.
- */
-public char
-getEchoChar()
-{
- return(echoChar);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the character that is echoed when protected input such as
- * a password is displayed.
- *
- * @param echoChar The new echo character.
- */
-public void
-setEchoChar(char echoChar)
-{
- setEchoCharacter (echoChar);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the character that is echoed when protected input such as
- * a password is displayed.
- *
- * @param echoChar The new echo character.
- *
- * @deprecated This method is deprecated in favor of
- * <code>setEchoChar()</code>
- */
-public void
-setEchoCharacter(char echoChar)
-{
- this.echoChar = echoChar;
-
- TextFieldPeer peer = (TextFieldPeer) getPeer ();
- if (peer != null)
- peer.setEchoChar (echoChar);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this text field has an echo character set
- * so that characters the user type are not echoed to the screen.
- *
- * @return <code>true</code> if an echo character is set,
- * <code>false</code> otherwise.
- */
-public boolean
-echoCharIsSet()
-{
- if (echoChar == '\u0000')
- return(false);
- else
- return(true);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size for this text field.
- *
- * @return The minimum size for this text field.
- */
-public Dimension
-getMinimumSize()
-{
- return getMinimumSize (getColumns ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of a text field with the specified number
- * of columns.
- *
- * @param columns The number of columns to get the minimum size for.
- */
-public Dimension
-getMinimumSize(int columns)
-{
- return minimumSize (columns);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size for this text field.
- *
- * @return The minimum size for this text field.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getMinimumSize()</code>.
- */
-public Dimension
-minimumSize()
-{
- return minimumSize (getColumns ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of a text field with the specified number
- * of columns.
- *
- * @param columns The number of columns to get the minimum size for.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getMinimumSize(int)</code>.
- */
-public Dimension
-minimumSize(int columns)
-{
- TextFieldPeer peer = (TextFieldPeer) getPeer ();
- if (peer == null)
- return null; // FIXME: What do we do if there is no peer?
-
- return peer.getMinimumSize (columns);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size for this text field.
- *
- * @return The preferred size for this text field.
- */
-public Dimension
-getPreferredSize()
-{
- return getPreferredSize (getColumns ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of a text field with the specified number
- * of columns.
- *
- * @param columns The number of columns to get the preferred size for.
- */
-public Dimension
-getPreferredSize(int columns)
-{
- return preferredSize (columns);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size for this text field.
- *
- * @return The preferred size for this text field.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getPreferredSize()</code>.
- */
-public Dimension
-preferredSize()
-{
- return preferredSize (getColumns ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of a text field with the specified number
- * of columns.
- *
- * @param columns The number of columns to get the preferred size for.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getPreferredSize(int)</code>.
- */
-public Dimension
-preferredSize(int columns)
-{
- TextFieldPeer peer = (TextFieldPeer) getPeer ();
- if (peer == null)
- return new Dimension (0, 0);
-
- return peer.getPreferredSize (columns);
-}
-
-/*************************************************************************/
-
-/**
- * Notifies this object that it should create its native peer.
- */
-public void
-addNotify()
-{
- if (getPeer() != null)
- return;
-
- setPeer((ComponentPeer)getToolkit().createTextField(this));
-}
-
-/*************************************************************************/
-
-/**
- * Addes a new listener to the list of action listeners for this
- * object.
- *
- * @param listener The listener to add to the list.
- */
-public synchronized void
-addActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.add(action_listeners, listener);
-
- enableEvents(AWTEvent.ACTION_EVENT_MASK);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified listener from the list of action listeners
- * for this object.
- *
- * @param listener The listener to remove from the list.
- */
-public synchronized void
-removeActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.remove(action_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Processes the specified event. If the event is an instance of
- * <code>ActionEvent</code> then <code>processActionEvent()</code> is
- * called to process it, otherwise the event is sent to the
- * superclass.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof ActionEvent)
- processActionEvent((ActionEvent)event);
- else
- super.processEvent(event);
-}
-
-/*************************************************************************/
-
-/**
- * Processes an action event by calling any registered listeners.
- * Note to subclasses: This method is not called unless action events
- * are enabled on this object. This will be true if any listeners
- * are registered, or if action events were specifically enabled
- * using <code>enableEvents()</code>.
- *
- * @param event The event to process.
- */
-protected void
-processActionEvent(ActionEvent event)
-{
- if (action_listeners != null)
- action_listeners.actionPerformed(event);
-}
-
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= ActionEvent.ACTION_LAST
- && e.id >= ActionEvent.ACTION_FIRST
- && (action_listeners != null
- || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debug string for this object.
- *
- * @return A debug string for this object.
- */
-protected String
-paramString()
-{
- return(getClass().getName() + "(columns=" + getColumns() + ",echoChar=" +
- getEchoChar());
-}
-
- /**
- * Returns an array of all the objects currently registered as FooListeners
- * upon this <code>TextField</code>. FooListeners are registered using the
- * addFooListener method.
- *
- * @exception ClassCastException If listenerType doesn't specify a class or
- * interface that implements java.util.EventListener.
- *
- * @since 1.3
- */
- public EventListener[] getListeners (Class listenerType)
- {
- if (listenerType == ActionListener.class)
- return AWTEventMulticaster.getListeners (action_listeners, listenerType);
-
- return super.getListeners (listenerType);
- }
-
- /**
- * Return all ActionListeners register to this <code>TextField</code> object
- * as an array.
- *
- * @since 1.4
- */
- public ActionListener[] getActionListeners ()
- {
- return (ActionListener[]) getListeners (ActionListener.class);
- }
-
- protected class AccessibleAWTTextField extends AccessibleAWTTextComponent
- {
- protected AccessibleAWTTextField()
- {
- }
-
- public AccessibleStateSet getAccessibleStateSet()
- {
- return super.getAccessibleStateSet();
- }
- }
-
- public AccessibleContext getAccessibleContext()
- {
- return new AccessibleAWTTextField();
- }
-
-} // class TextField
diff --git a/libjava/java/awt/TexturePaint.java b/libjava/java/awt/TexturePaint.java
deleted file mode 100644
index a12e38463f1..00000000000
--- a/libjava/java/awt/TexturePaint.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* TexturePaint.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.BufferedImage;
-import java.awt.image.ColorModel;
-
-/** STUB CLASS ONLY */
-public class TexturePaint implements Paint
-{
- private final BufferedImage texture;
- private final Rectangle2D anchor;
- public TexturePaint(BufferedImage texture, Rectangle2D anchor)
- {
- this.texture = texture;
- this.anchor = anchor;
- }
- public BufferedImage getImage()
- {
- return texture;
- }
- public Rectangle2D getAnchorRect()
- {
- return anchor;
- }
- public PaintContext createContext(ColorModel cm, Rectangle deviceBounds,
- Rectangle2D userBounds,
- AffineTransform xform,
- RenderingHints hints)
- {
- throw new Error("not implemented");
- }
- public int getTransparency()
- {
- throw new Error("not implemented");
- }
-} // class TexturePaint
diff --git a/libjava/java/awt/Toolkit.java b/libjava/java/awt/Toolkit.java
deleted file mode 100644
index c7c6f9f0ecb..00000000000
--- a/libjava/java/awt/Toolkit.java
+++ /dev/null
@@ -1,995 +0,0 @@
-/* Toolkit.java -- AWT Toolkit superclass
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.datatransfer.Clipboard;
-import java.awt.dnd.DragGestureEvent;
-import java.awt.dnd.DragGestureListener;
-import java.awt.dnd.DragGestureRecognizer;
-import java.awt.dnd.DragSource;
-import java.awt.dnd.peer.DragSourceContextPeer;
-import java.awt.event.AWTEventListener;
-import java.awt.event.KeyEvent;
-import java.awt.im.InputMethodHighlight;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageObserver;
-import java.awt.image.ImageProducer;
-import java.awt.peer.ButtonPeer;
-import java.awt.peer.CanvasPeer;
-import java.awt.peer.CheckboxMenuItemPeer;
-import java.awt.peer.CheckboxPeer;
-import java.awt.peer.ChoicePeer;
-import java.awt.peer.DialogPeer;
-import java.awt.peer.FileDialogPeer;
-import java.awt.peer.FontPeer;
-import java.awt.peer.FramePeer;
-import java.awt.peer.LabelPeer;
-import java.awt.peer.LightweightPeer;
-import java.awt.peer.ListPeer;
-import java.awt.peer.MenuBarPeer;
-import java.awt.peer.MenuItemPeer;
-import java.awt.peer.MenuPeer;
-import java.awt.peer.PanelPeer;
-import java.awt.peer.PopupMenuPeer;
-import java.awt.peer.ScrollPanePeer;
-import java.awt.peer.ScrollbarPeer;
-import java.awt.peer.TextAreaPeer;
-import java.awt.peer.TextFieldPeer;
-import java.awt.peer.WindowPeer;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.net.URL;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * The AWT system uses a set of native peer objects to implement its
- * widgets. These peers are provided by a peer toolkit, that is accessed
- * via a subclass of this superclass. The system toolkit is retrieved
- * by the static methods <code>getDefaultToolkit</code>. This method
- * determines the system toolkit by examining the system property
- * <code>awt.toolkit</code>. That property is set to the name of the
- * <code>Toolkit</code> subclass for the specified peer set. If the
- * <code>awt.toolkit</code> property is not set, then the default
- * toolkit <code>gnu.java.awt.peer.gtk.GtkToolkit</code> is used. This
- * toolkit creates its peers using the GTK+ toolkit.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public abstract class Toolkit
-{
- /** The default toolkit name. */
- private static String default_toolkit_name
- = gnu.classpath.Configuration.default_awt_peer_toolkit;
-
- /**
- * The toolkit in use. Once we load it, we don't ever change it
- * if the awt.toolkit property is set.
- */
- private static Toolkit toolkit;
-
- /** The toolkit properties. */
- private static Properties props = new Properties();
-
- protected final Map desktopProperties = new Properties();
-
- protected final PropertyChangeSupport desktopPropsSupport
- = new PropertyChangeSupport(this);
-
- /**
- * Default constructor for subclasses.
- */
- public Toolkit()
- {
- }
-
- /**
- * Creates a peer object for the specified <code>Button</code>.
- *
- * @param target The <code>Button</code> to create the peer for.
- *
- * @return The peer for the specified <code>Button</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract ButtonPeer createButton(Button target);
-
- /**
- * Creates a peer object for the specified <code>TextField</code>.
- *
- * @param target The <code>TextField</code> to create the peer for.
- *
- * @return The peer for the specified <code>TextField</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract TextFieldPeer createTextField(TextField target);
-
- /**
- * Creates a peer object for the specified <code>Label</code>.
- *
- * @param target The <code>Label</code> to create the peer for.
- *
- * @return The peer for the specified <code>Label</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract LabelPeer createLabel(Label target);
-
- /**
- * Creates a peer object for the specified <code>List</code>.
- *
- * @param target The <code>List</code> to create the peer for.
- *
- * @return The peer for the specified <code>List</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract ListPeer createList(List target);
-
- /**
- * Creates a peer object for the specified <code>Checkbox</code>.
- *
- * @param target The <code>Checkbox</code> to create the peer for.
- *
- * @return The peer for the specified <code>Checkbox</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract CheckboxPeer createCheckbox(Checkbox target);
-
- /**
- * Creates a peer object for the specified <code>Scrollbar</code>.
- *
- * @param target The <code>Scrollbar</code> to create the peer for.
- *
- * @return The peer for the specified <code>Scrollbar</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract ScrollbarPeer createScrollbar(Scrollbar target);
-
- /**
- * Creates a peer object for the specified <code>ScrollPane</code>.
- *
- * @param target The <code>ScrollPane</code> to create the peer for.
- *
- * @return The peer for the specified <code>ScrollPane</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract ScrollPanePeer createScrollPane(ScrollPane target);
-
- /**
- * Creates a peer object for the specified <code>TextArea</code>.
- *
- * @param target The <code>TextArea</code> to create the peer for.
- *
- * @return The peer for the specified <code>TextArea</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract TextAreaPeer createTextArea(TextArea target);
-
- /**
- * Creates a peer object for the specified <code>Choice</code>.
- *
- * @param target The <code>Choice</code> to create the peer for.
- *
- * @return The peer for the specified <code>Choice</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract ChoicePeer createChoice(Choice target);
-
- /**
- * Creates a peer object for the specified <code>Frame</code>.
- *
- * @param target The <code>Frame</code> to create the peer for.
- *
- * @return The peer for the specified <code>Frame</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract FramePeer createFrame(Frame target);
-
- /**
- * Creates a peer object for the specified <code>Canvas</code>.
- *
- * @param target The <code>Canvas</code> to create the peer for.
- *
- * @return The peer for the specified <code>Canvas</code> object.
- */
- protected abstract CanvasPeer createCanvas(Canvas target);
-
- /**
- * Creates a peer object for the specified <code>Panel</code>.
- *
- * @param target The <code>Panel</code> to create the peer for.
- *
- * @return The peer for the specified <code>Panel</code> object.
- */
- protected abstract PanelPeer createPanel(Panel target);
-
- /**
- * Creates a peer object for the specified <code>Window</code>.
- *
- * @param target The <code>Window</code> to create the peer for.
- *
- * @return The peer for the specified <code>Window</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract WindowPeer createWindow(Window target);
-
- /**
- * Creates a peer object for the specified <code>Dialog</code>.
- *
- * @param target The dialog to create the peer for
- *
- * @return The peer for the specified font name.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract DialogPeer createDialog(Dialog target);
-
- /**
- * Creates a peer object for the specified <code>MenuBar</code>.
- *
- * @param target The <code>MenuBar</code> to create the peer for.
- *
- * @return The peer for the specified <code>MenuBar</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract MenuBarPeer createMenuBar(MenuBar target);
-
- /**
- * Creates a peer object for the specified <code>Menu</code>.
- *
- * @param target The <code>Menu</code> to create the peer for.
- *
- * @return The peer for the specified <code>Menu</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract MenuPeer createMenu(Menu target);
-
- /**
- * Creates a peer object for the specified <code>PopupMenu</code>.
- *
- * @param target The <code>PopupMenu</code> to create the peer for.
- *
- * @return The peer for the specified <code>PopupMenu</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract PopupMenuPeer createPopupMenu(PopupMenu target);
-
- /**
- * Creates a peer object for the specified <code>MenuItem</code>.
- *
- * @param target The <code>MenuItem</code> to create the peer for.
- *
- * @return The peer for the specified <code>MenuItem</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract MenuItemPeer createMenuItem(MenuItem target);
-
- /**
- * Creates a peer object for the specified <code>FileDialog</code>.
- *
- * @param target The <code>FileDialog</code> to create the peer for.
- *
- * @return The peer for the specified <code>FileDialog</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract FileDialogPeer createFileDialog(FileDialog target);
-
- /**
- * Creates a peer object for the specified <code>CheckboxMenuItem</code>.
- *
- * @param target The <code>CheckboxMenuItem</code> to create the peer for.
- *
- * @return The peer for the specified <code>CheckboxMenuItem</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected abstract CheckboxMenuItemPeer
- createCheckboxMenuItem(CheckboxMenuItem target);
-
- /**
- * Creates a peer object for the specified <code>Component</code>. The
- * peer returned by this method is not a native windowing system peer
- * with its own native window. Instead, this method allows the component
- * to draw on its parent window as a "lightweight" widget.
- *
- * @param target The <code>Component</code> to create the peer for.
- *
- * @return The peer for the specified <code>Component</code> object.
- */
- protected LightweightPeer createComponent(Component target)
- {
- return new gnu.java.awt.peer.GLightweightPeer (target);
- }
-
- /**
- * Creates a peer object for the specified font name.
- *
- * @param name The font to create the peer for.
- * @param style The font style to create the peer for.
- *
- * @return The peer for the specified font name.
- *
- * @deprecated
- */
- protected abstract FontPeer getFontPeer(String name, int style);
-
- /**
- * Copies the current system colors into the specified array. This is
- * the interface used by the <code>SystemColor</code> class. Although
- * this method fills in the array with some default colors a real Toolkit
- * should override this method and provide real system colors for the
- * native GUI platform.
- *
- * @param systemColors The array to copy the system colors into.
- * It must be at least 26 elements.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- *
- * @see java.awt.SystemColor
- */
- protected void loadSystemColors(int systemColors[])
- {
- systemColors[SystemColor.DESKTOP] = 0xFF005C5C;
- systemColors[SystemColor.ACTIVE_CAPTION] = 0xFF000080;
- systemColors[SystemColor.ACTIVE_CAPTION_TEXT] = 0xFFFFFFFF;
- systemColors[SystemColor.ACTIVE_CAPTION_BORDER] = 0xFFC0C0C0;
- systemColors[SystemColor.INACTIVE_CAPTION] = 0xFF808080;
- systemColors[SystemColor.INACTIVE_CAPTION_TEXT] = 0xFFC0C0C0;
- systemColors[SystemColor.INACTIVE_CAPTION_BORDER] = 0xFFC0C0C0;
- systemColors[SystemColor.WINDOW] = 0xFFFFFFFF;
- systemColors[SystemColor.WINDOW_BORDER] = 0xFF000000;
- systemColors[SystemColor.WINDOW_TEXT] = 0xFF000000;
- systemColors[SystemColor.MENU] = 0xFFC0C0C0;
- systemColors[SystemColor.MENU_TEXT] = 0xFF000000;
- systemColors[SystemColor.TEXT] = 0xFFC0C0C0;
- systemColors[SystemColor.TEXT_TEXT] = 0xFF000000;
- systemColors[SystemColor.TEXT_HIGHLIGHT] = 0xFF000090;
- systemColors[SystemColor.TEXT_HIGHLIGHT_TEXT] = 0xFFFFFFFF;
- systemColors[SystemColor.TEXT_INACTIVE_TEXT] = 0xFF808080;
- systemColors[SystemColor.CONTROL] = 0xFFC0C0C0;
- systemColors[SystemColor.CONTROL_TEXT] = 0xFF000000;
- systemColors[SystemColor.CONTROL_HIGHLIGHT] = 0xFFFFFFFF;
- systemColors[SystemColor.CONTROL_LT_HIGHLIGHT] = 0xFFE0E0E0;
- systemColors[SystemColor.CONTROL_SHADOW] = 0xFF808080;
- systemColors[SystemColor.CONTROL_DK_SHADOW] = 0xFF000000;
- systemColors[SystemColor.SCROLLBAR] = 0xFFE0E0E0;
- systemColors[SystemColor.INFO] = 0xFFE0E000;
- systemColors[SystemColor.INFO_TEXT] = 0xFF000000;
- }
-
- /**
- * @since 1.4
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public void setDynamicLayout(boolean dynamic)
- {
- }
-
- /**
- * @since 1.4
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- protected boolean isDynamicLayoutSet()
- {
- return false;
- }
-
- /**
- * @since 1.4
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public boolean isDynamicLayoutActive()
- {
- return false;
- }
-
- /**
- * Returns the dimensions of the screen in pixels.
- *
- * @return The dimensions of the screen in pixels.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public abstract Dimension getScreenSize();
-
- /**
- * Returns the screen resolution in dots per square inch.
- *
- * @return The screen resolution in dots per square inch.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public abstract int getScreenResolution();
-
- /**
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- *
- * @since 1.4
- */
- public Insets getScreenInsets(GraphicsConfiguration gc)
- {
- return null;
- }
-
- /**
- * Returns the color model of the screen.
- *
- * @return The color model of the screen.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public abstract ColorModel getColorModel();
-
- /**
- * Returns the names of the available fonts.
- *
- * @return The names of the available fonts.
- *
- * @deprecated
- */
- public abstract String[] getFontList();
-
- /**
- * Return the font metrics for the specified font
- *
- * @param name The name of the font to return metrics for.
- *
- * @return The requested font metrics.
- *
- * @deprecated
- */
- public abstract FontMetrics getFontMetrics(Font name);
-
- /**
- * Flushes any buffered data to the screen so that it is in sync with
- * what the AWT system has drawn to it.
- */
- public abstract void sync();
-
- /**
- * Returns an instance of the default toolkit. The default toolkit is
- * the subclass of <code>Toolkit</code> specified in the system property
- * <code>awt.toolkit</code>, or <code>gnu.java.awt.peer.gtk.GtkToolkit</code>
- * if the property is not set.
- *
- * @return An instance of the system default toolkit.
- *
- * @throws AWTError If the toolkit cannot be loaded.
- */
- public static Toolkit getDefaultToolkit()
- {
- if (toolkit != null)
- return toolkit;
- String toolkit_name = System.getProperty("awt.toolkit",
- default_toolkit_name);
- try
- {
- Class cls = Class.forName(toolkit_name);
- Object obj = cls.newInstance();
- if (!(obj instanceof Toolkit))
- throw new AWTError(toolkit_name + " is not a subclass of " +
- "java.awt.Toolkit");
- toolkit = (Toolkit) obj;
- return toolkit;
- }
- catch (ThreadDeath death)
- {
- throw death;
- }
- catch (Throwable t)
- {
- AWTError e = new AWTError("Cannot load AWT toolkit: " + toolkit_name);
- throw (AWTError) e.initCause(t);
- }
- }
-
- /**
- * Returns an image from the specified file, which must be in a
- * recognized format. Supported formats vary from toolkit to toolkit.
- *
- * @return name The name of the file to read the image from.
- */
- public abstract Image getImage(String name);
-
- /**
- * Returns an image from the specified URL, which must be in a
- * recognized format. Supported formats vary from toolkit to toolkit.
- *
- * @return url The URl to read the image from.
- */
- public abstract Image getImage(URL url);
-
- public abstract Image createImage(String filename);
-
- public abstract Image createImage(URL url);
-
- /**
- * Readies an image to be rendered on the screen. The width and height
- * values can be set to the default sizes for the image by passing -1
- * in those parameters.
- *
- * @param image The image to prepare for rendering.
- * @param width The width of the image.
- * @param height The height of the image.
- * @param observer The observer to receive events about the preparation
- * process.
- *
- * @return <code>true</code> if the image is already prepared for rendering,
- * <code>false</code> otherwise.
- */
- public abstract boolean prepareImage(Image image, int width, int height,
- ImageObserver observer);
-
- /**
- * Checks the status of specified image as it is being readied for
- * rendering.
- *
- * @param image The image to prepare for rendering.
- * @param width The width of the image.
- * @param height The height of the image.
- * @param observer The observer to receive events about the preparation
- * process.
- *
- * @return A union of the bitmasks from
- * <code>java.awt.image.ImageObserver</code> that indicates the current
- * state of the imaging readying process.
- */
- public abstract int checkImage(Image image, int width, int height,
- ImageObserver observer);
-
- /**
- * Creates an image using the specified <code>ImageProducer</code>
- *
- * @param producer The <code>ImageProducer</code> to create the image from.
- *
- * @return The created image.
- */
- public abstract Image createImage(ImageProducer producer);
-
- /**
- * Creates an image from the specified byte array. The array must be in
- * a recognized format. Supported formats vary from toolkit to toolkit.
- *
- * @param data The raw image data.
- *
- * @return The created image.
- */
- public Image createImage(byte[] data)
- {
- return createImage(data, 0, data.length);
- }
-
- /**
- * Creates an image from the specified portion of the byte array passed.
- * The array must be in a recognized format. Supported formats vary from
- * toolkit to toolkit.
- *
- * @param data The raw image data.
- * @param offset The offset into the data where the image data starts.
- * @param len The length of the image data.
- *
- * @return The created image.
- */
- public abstract Image createImage(byte[] data, int offset, int len);
-
- /**
- * Returns a instance of <code>PrintJob</code> for the specified
- * arguments.
- *
- * @param frame The window initiating the print job.
- * @param title The print job title.
- * @param props The print job properties.
- *
- * @return The requested print job, or <code>null</code> if the job
- * was cancelled.
- *
- * @exception NullPointerException If frame is null,
- * or GraphicsEnvironment.isHeadless() returns true.
- * @exception SecurityException If this thread is not allowed to initiate
- * a print job request.
- */
- public abstract PrintJob getPrintJob(Frame frame, String title,
- Properties props);
-
- /**
- * Returns a instance of <code>PrintJob</code> for the specified
- * arguments.
- *
- * @param frame The window initiating the print job.
- * @param title The print job title.
- * @param jobAttr A set of job attributes which will control the print job.
- * @param pageAttr A set of page attributes which will control the print job.
- *
- * @exception NullPointerException If frame is null, and either jobAttr is null
- * or jobAttr.getDialog() returns JobAttributes.DialogType.NATIVE.
- * @exception IllegalArgumentException If pageAttrspecifies differing cross
- * feed and feed resolutions, or when GraphicsEnvironment.isHeadless() returns
- * true.
- * @exception SecurityException If this thread is not allowed to initiate
- * a print job request.
- *
- * @since 1.3
- */
- public PrintJob getPrintJob(Frame frame, String title,
- JobAttributes jobAttr, PageAttributes pageAttr)
- {
- return null;
- }
-
- /**
- * Causes a "beep" tone to be generated.
- */
- public abstract void beep();
-
- /**
- * Returns the system clipboard.
- *
- * @return THe system clipboard.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public abstract Clipboard getSystemClipboard();
-
- /**
- * Gets the singleton instance of the system selection as a Clipboard object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- *
- * @since 1.4
- */
- public Clipboard getSystemSelection()
- {
- return null;
- }
-
- /**
- * Returns the accelerator key mask for menu shortcuts. The default is
- * <code>Event.CTRL_MASK</code>. A toolkit must override this method
- * to change the default.
- *
- * @return The key mask for the menu accelerator key.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public int getMenuShortcutKeyMask()
- {
- return Event.CTRL_MASK;
- }
-
- /**
- * Returns whether the given locking key on the keyboard is currently in its
- * "on" state.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- * @exception IllegalArgumentException If keyCode is not one of the valid keys.
- * @exception UnsupportedOperationException If the host system doesn't allow
- * getting the state of this key programmatically, or if the keyboard doesn't
- * have this key.
- */
- public boolean getLockingKeyState(int keyCode)
- {
- if (keyCode != KeyEvent.VK_CAPS_LOCK
- && keyCode != KeyEvent.VK_NUM_LOCK
- && keyCode != KeyEvent.VK_SCROLL_LOCK)
- throw new IllegalArgumentException();
-
- throw new UnsupportedOperationException();
- }
-
- /**
- * Sets the state of the given locking key on the keyboard.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- * @exception IllegalArgumentException If keyCode is not one of the valid keys.
- * @exception UnsupportedOperationException If the host system doesn't allow
- * getting the state of this key programmatically, or if the keyboard doesn't
- * have this key.
- */
- public void setLockingKeyState(int keyCode, boolean on)
- {
- if (keyCode != KeyEvent.VK_CAPS_LOCK
- && keyCode != KeyEvent.VK_NUM_LOCK
- && keyCode != KeyEvent.VK_SCROLL_LOCK)
- throw new IllegalArgumentException();
-
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns the native container object of the specified component. This
- * method is necessary because the parent component might be a lightweight
- * component.
- *
- * @param component The component to fetch the native container for.
- *
- * @return The native container object for this component.
- */
- protected static Container getNativeContainer(Component component)
- {
- component = component.getParent();
- while (true)
- {
- if (component == null)
- return null;
- if (! (component instanceof Container))
- {
- component = component.getParent();
- continue;
- }
- if (component.getPeer() instanceof LightweightPeer)
- {
- component = component.getParent();
- continue;
- }
- return (Container) component;
- }
- }
-
- /**
- * Creates a new custom cursor object.
- *
- * @exception IndexOutOfBoundsException If the hotSpot values are outside
- * the bounds of the cursor.
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)
- {
- // Presumably the only reason this isn't abstract is for backwards
- // compatibility? FIXME?
- return null;
- }
-
- /**
- * Returns the supported cursor dimension which is closest to the
- * desired sizes.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public Dimension getBestCursorSize(int preferredWidth, int preferredHeight)
- {
- return new Dimension (0,0);
- }
-
- /**
- * Returns the maximum number of colors the Toolkit supports in a custom
- * cursor palette.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public int getMaximumCursorColors()
- {
- return 0;
- }
-
- /**
- * Returns whether Toolkit supports this state for Frames.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- *
- * @since 1.4
- */
- public boolean isFrameStateSupported(int state)
- {
- return false;
- }
-
- /**
- * Returns the value of the property with the specified name, or the
- * default value if the property does not exist.
- *
- * @param key The name of the property to retrieve.
- * @param def The default value of the property.
- */
- public static String getProperty(String key, String def)
- {
- return props.getProperty(key, def);
- }
-
-
- /**
- * Returns the event queue that is suitable for the calling context.
- *
- * <p>Despite the word &#x201c;System&#x201d; in the name of this
- * method, a toolkit may provide different event queues for each
- * applet. There is no guarantee that the same queue is shared
- * system-wide.
- *
- * <p>The implementation first checks whether a
- * SecurityManager has been installed. If so, its {@link
- * java.lang.SecurityManager#checkAwtEventQueueAccess()} method gets
- * called. The security manager will throw a SecurityException if it
- * does not grant the permission to access the event queue.
- *
- * <p>Next, the call is delegated to {@link
- * #getSystemEventQueueImpl()}.
- *
- * @return The event queue for this applet (or application).
- *
- * @throws SecurityException if a security manager has been
- * installed, and it does not grant the permission to access the
- * event queue.
- */
- public final EventQueue getSystemEventQueue()
- {
- SecurityManager sm;
-
- sm = System.getSecurityManager();
- if (sm != null)
- sm.checkAwtEventQueueAccess();
-
- return getSystemEventQueueImpl();
- }
-
-
- /**
- * Returns the event queue that is suitable for the calling context.
- *
- * <p>Despite the word &#x201c;System&#x201d; in the name of this
- * method, a toolkit may provide different event queues for each
- * applet. There is no guarantee that the same queue is shared
- * system-wide.
- *
- * <p>No security checks are performed, which is why this method
- * may only be called by Toolkits.
- *
- * @see #getSystemEventQueue()
- */
- protected abstract EventQueue getSystemEventQueueImpl();
-
-
- /**
- * @since 1.3
- */
- public abstract DragSourceContextPeer
- createDragSourceContextPeer(DragGestureEvent e);
-
- /**
- * @since 1.3
- */
- public DragGestureRecognizer
- createDragGestureRecognizer(Class recognizer, DragSource ds,
- Component comp, int actions,
- DragGestureListener l)
- {
- return null;
- }
-
- public final Object getDesktopProperty(String propertyName)
- {
- return desktopProperties.get(propertyName);
- }
-
- protected final void setDesktopProperty(String name, Object newValue)
- {
- Object oldValue = getDesktopProperty(name);
- desktopProperties.put(name, newValue);
- desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
- }
-
- protected Object lazilyLoadDesktopProperty(String name)
- {
- // FIXME - what is this??
- return null;
- }
-
- protected void initializeDesktopProperties()
- {
- // Overridden by toolkit implementation?
- }
-
- public void addPropertyChangeListener(String name,
- PropertyChangeListener pcl)
- {
- desktopPropsSupport.addPropertyChangeListener(name, pcl);
- }
-
- public void removePropertyChangeListener(String name,
- PropertyChangeListener pcl)
- {
- desktopPropsSupport.removePropertyChangeListener(name, pcl);
- }
-
- /**
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners()
- {
- return desktopPropsSupport.getPropertyChangeListeners();
- }
-
- /**
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners(String name)
- {
- return desktopPropsSupport.getPropertyChangeListeners(name);
- }
-
- public void addAWTEventListener(AWTEventListener listener, long eventMask)
- {
- // SecurityManager s = System.getSecurityManager();
- // if (s != null)
- // s.checkPermission(AWTPermission("listenToAllAWTEvents"));
- // FIXME
- }
-
- public void removeAWTEventListener(AWTEventListener listener)
- {
- // FIXME
- }
-
- /**
- * @since 1.4
- */
- public AWTEventListener[] getAWTEventListeners()
- {
- return null;
- }
-
- /**
- * @since 1.4
- */
- public AWTEventListener[] getAWTEventListeners(long mask)
- {
- return null;
- }
-
- /**
- * @since 1.3
- */
- public abstract Map mapInputMethodHighlight(InputMethodHighlight highlight);
-} // class Toolkit
diff --git a/libjava/java/awt/Transparency.java b/libjava/java/awt/Transparency.java
deleted file mode 100644
index 88858717693..00000000000
--- a/libjava/java/awt/Transparency.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Transparency.java -- common transparency modes in graphics
- Copyright (C) 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-/**
- * A common transparency mode for layering graphics.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public interface Transparency
-{
- /** Image data which is completely opaque, for an alpha value of 1.0. */
- int OPAQUE = 1;
-
- /**
- * Image data which is either completely opaque or transparent, for an
- * exact integer alpha value.
- */
- int BITMASK = 2;
-
- /** Image data which is translucent, for a non-integer alpha value. */
- int TRANSLUCENT = 3;
-
- /**
- * Return the transparency type.
- *
- * @return One of {@link #OPAQUE}, {@link #BITMASK}, or {@link #TRANSLUCENT}.
- */
- int getTransparency();
-} // interface Transparency
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
deleted file mode 100644
index 87b6c5767c5..00000000000
--- a/libjava/java/awt/Window.java
+++ /dev/null
@@ -1,1132 +0,0 @@
-/* Window.java --
- Copyright (C) 1999, 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt;
-
-import java.awt.event.ComponentEvent;
-import java.awt.event.FocusEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowFocusListener;
-import java.awt.event.WindowListener;
-import java.awt.event.WindowStateListener;
-import java.awt.image.BufferStrategy;
-import java.awt.peer.WindowPeer;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-import java.util.EventListener;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleState;
-import javax.accessibility.AccessibleStateSet;
-
-/**
- * This class represents a top-level window with no decorations.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public class Window extends Container implements Accessible
-{
- private static final long serialVersionUID = 4497834738069338734L;
-
- // Serialized fields, from Sun's serialization spec.
- private String warningString = null;
- private int windowSerializedDataVersion = 0; // FIXME
- /** @since 1.2 */
- // private FocusManager focusMgr; // FIXME: what is this?
- /** @since 1.2 */
- private int state = 0;
- /** @since 1.4 */
- private boolean focusableWindowState = true;
-
- // A list of other top-level windows owned by this window.
- private transient Vector ownedWindows = new Vector();
-
- private transient WindowListener windowListener;
- private transient WindowFocusListener windowFocusListener;
- private transient WindowStateListener windowStateListener;
- private transient GraphicsConfiguration graphicsConfiguration;
-
- private transient boolean shown;
-
- // This is package-private to avoid an accessor method.
- transient Component windowFocusOwner;
-
- /*
- * The number used to generate the name returned by getName.
- */
- private static transient long next_window_number;
-
- protected class AccessibleAWTWindow extends AccessibleAWTContainer
- {
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.WINDOW;
- }
-
- public AccessibleStateSet getAccessibleStateSet()
- {
- AccessibleStateSet states = super.getAccessibleStateSet();
- if (isActive())
- states.add(AccessibleState.ACTIVE);
- return states;
- }
- }
-
- /**
- * This (package access) constructor is used by subclasses that want
- * to build windows that do not have parents. Eg. toplevel
- * application frames. Subclasses cannot call super(null), since
- * null is an illegal argument.
- */
- Window()
- {
- visible = false;
- // Windows are the only Containers that default to being focus
- // cycle roots.
- focusCycleRoot = true;
- setLayout(new BorderLayout());
-
- addWindowFocusListener (new WindowAdapter ()
- {
- public void windowGainedFocus (WindowEvent event)
- {
- if (windowFocusOwner != null)
- {
- // FIXME: move this section and the other similar
- // sections in Component into a separate method.
- EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
- synchronized (eq)
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
- Component currentFocusOwner = manager.getGlobalPermanentFocusOwner ();
- if (currentFocusOwner != null)
- {
- eq.postEvent (new FocusEvent (currentFocusOwner, FocusEvent.FOCUS_LOST,
- false, windowFocusOwner));
- eq.postEvent (new FocusEvent (windowFocusOwner, FocusEvent.FOCUS_GAINED,
- false, currentFocusOwner));
- }
- else
- eq.postEvent (new FocusEvent (windowFocusOwner, FocusEvent.FOCUS_GAINED, false));
- }
- }
- }
- });
- }
-
- Window(GraphicsConfiguration gc)
- {
- this();
- graphicsConfiguration = gc;
- }
-
- /**
- * Initializes a new instance of <code>Window</code> with the specified
- * parent. The window will initially be invisible.
- *
- * @param owner The owning <code>Frame</code> of this window.
- *
- * @exception IllegalArgumentException If the owner's GraphicsConfiguration
- * is not from a screen device, or if owner is null; this exception is always
- * thrown when GraphicsEnvironment.isHeadless returns true.
- */
- public Window(Frame owner)
- {
- this (owner, owner.getGraphicsConfiguration ());
- }
-
- /**
- * Initializes a new instance of <code>Window</code> with the specified
- * parent. The window will initially be invisible.
- *
- * @exception IllegalArgumentException If the owner's GraphicsConfiguration
- * is not from a screen device, or if owner is null; this exception is always
- * thrown when GraphicsEnvironment.isHeadless returns true.
- *
- * @since 1.2
- */
- public Window(Window owner)
- {
- this (owner, owner.getGraphicsConfiguration ());
- }
-
- /**
- * Initializes a new instance of <code>Window</code> with the specified
- * parent. The window will initially be invisible.
- *
- * @exception IllegalArgumentException If owner is null or if gc is not from a
- * screen device; this exception is always thrown when
- * GraphicsEnvironment.isHeadless returns true.
- *
- * @since 1.3
- */
- public Window(Window owner, GraphicsConfiguration gc)
- {
- this ();
-
- synchronized (getTreeLock())
- {
- if (owner == null)
- throw new IllegalArgumentException ("owner must not be null");
-
- parent = owner;
- owner.ownedWindows.add(new WeakReference(this));
- }
-
- // FIXME: make this text visible in the window.
- SecurityManager s = System.getSecurityManager();
- if (s != null && ! s.checkTopLevelWindow(this))
- warningString = System.getProperty("awt.appletWarning");
-
- if (gc != null
- && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN)
- throw new IllegalArgumentException ("gc must be from a screen device");
-
- if (gc == null)
- graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment()
- .getDefaultScreenDevice()
- .getDefaultConfiguration();
- else
- graphicsConfiguration = gc;
- }
-
- GraphicsConfiguration getGraphicsConfigurationImpl()
- {
- if (graphicsConfiguration != null)
- return graphicsConfiguration;
-
- return super.getGraphicsConfigurationImpl();
- }
-
- /**
- * Creates the native peer for this window.
- */
- public void addNotify()
- {
- if (peer == null)
- peer = getToolkit().createWindow(this);
- super.addNotify();
- }
-
- /**
- * Relays out this window's child components at their preferred size.
- *
- * @specnote pack() doesn't appear to be called internally by show(), so
- * we duplicate some of the functionality.
- */
- public void pack()
- {
- if (parent != null && !parent.isDisplayable())
- parent.addNotify();
- if (peer == null)
- addNotify();
-
- setSize(getPreferredSize());
-
- validate();
- }
-
- /**
- * Shows on-screen this window and any of its owned windows for whom
- * isVisible returns true.
- */
- public void show()
- {
- if (parent != null && !parent.isDisplayable())
- parent.addNotify();
- if (peer == null)
- addNotify();
-
- // Show visible owned windows.
- synchronized (getTreeLock())
- {
- Iterator e = ownedWindows.iterator();
- while(e.hasNext())
- {
- Window w = (Window)(((Reference) e.next()).get());
- if (w != null)
- {
- if (w.isVisible())
- w.getPeer().setVisible(true);
- }
- else
- // Remove null weak reference from ownedWindows.
- // Unfortunately this can't be done in the Window's
- // finalize method because there is no way to guarantee
- // synchronous access to ownedWindows there.
- e.remove();
- }
- }
- validate();
- super.show();
- toFront();
-
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
- manager.setGlobalFocusedWindow (this);
-
- if (!shown)
- {
- FocusTraversalPolicy policy = getFocusTraversalPolicy ();
- Component initialFocusOwner = null;
-
- if (policy != null)
- initialFocusOwner = policy.getInitialComponent (this);
-
- if (initialFocusOwner != null)
- initialFocusOwner.requestFocusInWindow ();
-
- shown = true;
- }
- }
-
- public void hide()
- {
- // Hide visible owned windows.
- synchronized (getTreeLock ())
- {
- Iterator e = ownedWindows.iterator();
- while(e.hasNext())
- {
- Window w = (Window)(((Reference) e.next()).get());
- if (w != null)
- {
- if (w.isVisible() && w.getPeer() != null)
- w.getPeer().setVisible(false);
- }
- else
- e.remove();
- }
- }
- super.hide();
- }
-
- public boolean isDisplayable()
- {
- if (super.isDisplayable())
- return true;
- return peer != null;
- }
-
- /**
- * Destroys any resources associated with this window. This includes
- * all components in the window and all owned top-level windows.
- */
- public void dispose()
- {
- hide();
-
- synchronized (getTreeLock ())
- {
- Iterator e = ownedWindows.iterator();
- while(e.hasNext())
- {
- Window w = (Window)(((Reference) e.next()).get());
- if (w != null)
- w.dispose();
- else
- // Remove null weak reference from ownedWindows.
- e.remove();
- }
-
- for (int i = 0; i < ncomponents; ++i)
- component[i].removeNotify();
- this.removeNotify();
-
- // Post a WINDOW_CLOSED event.
- WindowEvent we = new WindowEvent(this, WindowEvent.WINDOW_CLOSED);
- getToolkit().getSystemEventQueue().postEvent(we);
- }
- }
-
- /**
- * Sends this window to the back so that all other windows display in
- * front of it.
- */
- public void toBack()
- {
- if (peer != null)
- {
- WindowPeer wp = (WindowPeer) peer;
- wp.toBack();
- }
- }
-
- /**
- * Brings this window to the front so that it displays in front of
- * any other windows.
- */
- public void toFront()
- {
- if (peer != null)
- {
- WindowPeer wp = (WindowPeer) peer;
- wp.toFront();
- }
- }
-
- /**
- * Returns the toolkit used to create this window.
- *
- * @return The toolkit used to create this window.
- *
- * @specnote Unlike Component.getToolkit, this implementation always
- * returns the value of Toolkit.getDefaultToolkit().
- */
- public Toolkit getToolkit()
- {
- return Toolkit.getDefaultToolkit();
- }
-
- /**
- * Returns the warning string that will be displayed if this window is
- * popped up by an unsecure applet or application.
- *
- * @return The unsecure window warning message.
- */
- public final String getWarningString()
- {
- return warningString;
- }
-
- /**
- * Returns the locale that this window is configured for.
- *
- * @return The locale this window is configured for.
- */
- public Locale getLocale()
- {
- return locale == null ? Locale.getDefault() : locale;
- }
-
- /*
- /** @since 1.2
- public InputContext getInputContext()
- {
- // FIXME
- }
- */
-
- /**
- * Sets the cursor for this window to the specifiec cursor.
- *
- * @param cursor The new cursor for this window.
- */
- public void setCursor(Cursor cursor)
- {
- super.setCursor(cursor);
- }
-
- public Window getOwner()
- {
- return (Window) parent;
- }
-
- /** @since 1.2 */
- public Window[] getOwnedWindows()
- {
- Window [] trimmedList;
- synchronized (getTreeLock ())
- {
- // Windows with non-null weak references in ownedWindows.
- Window [] validList = new Window [ownedWindows.size()];
-
- Iterator e = ownedWindows.iterator();
- int numValid = 0;
- while (e.hasNext())
- {
- Window w = (Window)(((Reference) e.next()).get());
- if (w != null)
- validList[numValid++] = w;
- else
- // Remove null weak reference from ownedWindows.
- e.remove();
- }
-
- if (numValid != validList.length)
- {
- trimmedList = new Window [numValid];
- System.arraycopy (validList, 0, trimmedList, 0, numValid);
- }
- else
- trimmedList = validList;
- }
- return trimmedList;
- }
-
- /**
- * Adds the specified listener to the list of <code>WindowListeners</code>
- * that will receive events for this window.
- *
- * @param listener The <code>WindowListener</code> to add.
- */
- public synchronized void addWindowListener(WindowListener listener)
- {
- windowListener = AWTEventMulticaster.add(windowListener, listener);
- }
-
- /**
- * Removes the specified listener from the list of
- * <code>WindowListeners</code> that will receive events for this window.
- *
- * @param listener The <code>WindowListener</code> to remove.
- */
- public synchronized void removeWindowListener(WindowListener listener)
- {
- windowListener = AWTEventMulticaster.remove(windowListener, listener);
- }
-
- /**
- * Returns an array of all the window listeners registered on this window.
- *
- * @since 1.4
- */
- public synchronized WindowListener[] getWindowListeners()
- {
- return (WindowListener[])
- AWTEventMulticaster.getListeners(windowListener,
- WindowListener.class);
- }
-
- /**
- * Returns an array of all the window focus listeners registered on this
- * window.
- *
- * @since 1.4
- */
- public synchronized WindowFocusListener[] getWindowFocusListeners()
- {
- return (WindowFocusListener[])
- AWTEventMulticaster.getListeners(windowFocusListener,
- WindowFocusListener.class);
- }
-
- /**
- * Returns an array of all the window state listeners registered on this
- * window.
- *
- * @since 1.4
- */
- public synchronized WindowStateListener[] getWindowStateListeners()
- {
- return (WindowStateListener[])
- AWTEventMulticaster.getListeners(windowStateListener,
- WindowStateListener.class);
- }
-
- /**
- * Adds the specified listener to this window.
- */
- public void addWindowFocusListener (WindowFocusListener wfl)
- {
- windowFocusListener = AWTEventMulticaster.add (windowFocusListener, wfl);
- }
-
- /**
- * Adds the specified listener to this window.
- *
- * @since 1.4
- */
- public void addWindowStateListener (WindowStateListener wsl)
- {
- windowStateListener = AWTEventMulticaster.add (windowStateListener, wsl);
- }
-
- /**
- * Removes the specified listener from this window.
- */
- public void removeWindowFocusListener (WindowFocusListener wfl)
- {
- windowFocusListener = AWTEventMulticaster.remove (windowFocusListener, wfl);
- }
-
- /**
- * Removes the specified listener from this window.
- *
- * @since 1.4
- */
- public void removeWindowStateListener (WindowStateListener wsl)
- {
- windowStateListener = AWTEventMulticaster.remove (windowStateListener, wsl);
- }
-
- /**
- * Returns an array of all the objects currently registered as FooListeners
- * upon this Window. FooListeners are registered using the addFooListener
- * method.
- *
- * @exception ClassCastException If listenerType doesn't specify a class or
- * interface that implements java.util.EventListener.
- *
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerType)
- {
- if (listenerType == WindowListener.class)
- return getWindowListeners();
- return super.getListeners(listenerType);
- }
-
- void dispatchEventImpl(AWTEvent e)
- {
- // Make use of event id's in order to avoid multiple instanceof tests.
- if (e.id <= WindowEvent.WINDOW_LAST
- && e.id >= WindowEvent.WINDOW_FIRST
- && (windowListener != null
- || windowFocusListener != null
- || windowStateListener != null
- || (eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
- }
-
- /**
- * Processes the specified event for this window. If the event is an
- * instance of <code>WindowEvent</code>, then
- * <code>processWindowEvent()</code> is called to process the event,
- * otherwise the superclass version of this method is invoked.
- *
- * @param evt The event to process.
- */
- protected void processEvent(AWTEvent evt)
- {
- if (evt instanceof WindowEvent)
- processWindowEvent((WindowEvent) evt);
- else
- super.processEvent(evt);
- }
-
- /**
- * Dispatches this event to any listeners that are listening for
- * <code>WindowEvents</code> on this window. This method only gets
- * invoked if it is enabled via <code>enableEvents()</code> or if
- * a listener has been added.
- *
- * @param evt The event to process.
- */
- protected void processWindowEvent(WindowEvent evt)
- {
- int id = evt.getID();
-
- if (id == WindowEvent.WINDOW_GAINED_FOCUS
- || id == WindowEvent.WINDOW_LOST_FOCUS)
- processWindowFocusEvent (evt);
- else if (id == WindowEvent.WINDOW_STATE_CHANGED)
- processWindowStateEvent (evt);
- else
- {
- if (windowListener != null)
- {
- switch (evt.getID())
- {
- case WindowEvent.WINDOW_ACTIVATED:
- windowListener.windowActivated(evt);
- break;
-
- case WindowEvent.WINDOW_CLOSED:
- windowListener.windowClosed(evt);
- break;
-
- case WindowEvent.WINDOW_CLOSING:
- windowListener.windowClosing(evt);
- break;
-
- case WindowEvent.WINDOW_DEACTIVATED:
- windowListener.windowDeactivated(evt);
- break;
-
- case WindowEvent.WINDOW_DEICONIFIED:
- windowListener.windowDeiconified(evt);
- break;
-
- case WindowEvent.WINDOW_ICONIFIED:
- windowListener.windowIconified(evt);
- break;
-
- case WindowEvent.WINDOW_OPENED:
- windowListener.windowOpened(evt);
- break;
-
- default:
- break;
- }
- }
- }
- }
-
- /**
- * Identifies if this window is active. The active window is a Frame or
- * Dialog that has focus or owns the active window.
- *
- * @return true if active, else false.
- * @since 1.4
- */
- public boolean isActive()
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
- return manager.getActiveWindow() == this;
- }
-
- /**
- * Identifies if this window is focused. A window is focused if it is the
- * focus owner or it contains the focus owner.
- *
- * @return true if focused, else false.
- * @since 1.4
- */
- public boolean isFocused()
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
- return manager.getFocusedWindow() == this;
- }
-
- /**
- * Returns the child window that has focus if this window is active.
- * This method returns <code>null</code> if this window is not active
- * or no children have focus.
- *
- * @return The component that has focus, or <code>null</code> if no
- * component has focus.
- */
- public Component getFocusOwner ()
- {
- KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
-
- Window activeWindow = manager.getActiveWindow ();
-
- // The currently-focused Component belongs to the active Window.
- if (activeWindow == this)
- return manager.getFocusOwner ();
- else
- return windowFocusOwner;
- }
-
- /**
- * Set the focus owner for this window. This method is used to
- * remember which component was focused when this window lost
- * top-level focus, so that when it regains top-level focus the same
- * child component can be refocused.
- *
- * @param windowFocusOwner the component in this window that owns
- * the focus.
- */
- void setFocusOwner (Component windowFocusOwner)
- {
- this.windowFocusOwner = windowFocusOwner;
- }
-
- /**
- * Post a Java 1.0 event to the event queue.
- *
- * @param e The event to post.
- *
- * @deprecated
- */
- public boolean postEvent(Event e)
- {
- return handleEvent (e);
- }
-
- /**
- * Tests whether or not this window is visible on the screen.
- *
- * @return <code>true</code> if this window is visible, <code>false</code>
- * otherwise.
- */
- public boolean isShowing()
- {
- return super.isShowing();
- }
-
- public void setLocationRelativeTo (Component c)
- {
- if (c == null || !c.isShowing ())
- {
- int x = 0;
- int y = 0;
-
- GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment ();
- Point center = ge.getCenterPoint ();
- x = center.x - (width / 2);
- y = center.y - (height / 2);
- setLocation (x, y);
- }
- // FIXME: handle case where component is non-null.
- }
-
- /**
- * A BltBufferStrategy for windows.
- */
- private class WindowBltBufferStrategy extends BltBufferStrategy
- {
- /**
- * Creates a block transfer strategy for this window.
- *
- * @param numBuffers the number of buffers in this strategy
- * @param accelerated true if the buffer should be accelerated,
- * false otherwise
- */
- WindowBltBufferStrategy(int numBuffers, boolean accelerated)
- {
- super(numBuffers,
- new BufferCapabilities(new ImageCapabilities(accelerated),
- new ImageCapabilities(accelerated),
- BufferCapabilities.FlipContents.COPIED));
- }
- }
-
- /**
- * A FlipBufferStrategy for windows.
- */
- private class WindowFlipBufferStrategy extends FlipBufferStrategy
- {
- /**
- * Creates a flip buffer strategy for this window.
- *
- * @param numBuffers the number of buffers in this strategy
- *
- * @throws AWTException if the requested number of buffers is not
- * supported
- */
- WindowFlipBufferStrategy(int numBuffers)
- throws AWTException
- {
- super(numBuffers,
- new BufferCapabilities(new ImageCapabilities(true),
- new ImageCapabilities(true),
- BufferCapabilities.FlipContents.COPIED));
- }
- }
-
- /**
- * Creates a buffering strategy that manages how this window is
- * repainted. This method attempts to create the optimum strategy
- * based on the desired number of buffers. Hardware or software
- * acceleration may be used.
- *
- * createBufferStrategy attempts different levels of optimization,
- * but guarantees that some strategy with the requested number of
- * buffers will be created even if it is not optimal. First it
- * attempts to create a page flipping strategy, then an accelerated
- * blitting strategy, then an unaccelerated blitting strategy.
- *
- * Calling this method causes any existing buffer strategy to be
- * destroyed.
- *
- * @param numBuffers the number of buffers in this strategy
- *
- * @throws IllegalArgumentException if requested number of buffers
- * is less than one
- * @throws IllegalStateException if this window is not displayable
- *
- * @since 1.4
- */
- public void createBufferStrategy(int numBuffers)
- {
- if (numBuffers < 1)
- throw new IllegalArgumentException("Window.createBufferStrategy: number"
- + " of buffers is less than one");
-
- if (!isDisplayable())
- throw new IllegalStateException("Window.createBufferStrategy: window is"
- + " not displayable");
-
- // try a flipping strategy
- try
- {
- bufferStrategy = new WindowFlipBufferStrategy(numBuffers);
- return;
- }
- catch (AWTException e)
- {
- }
-
- // try an accelerated blitting strategy
- try
- {
- bufferStrategy = new WindowBltBufferStrategy(numBuffers, true);
- }
- catch (AWTException e)
- {
- }
-
- // fall back to an unaccelerated blitting strategy
- try
- {
- bufferStrategy = new WindowBltBufferStrategy(numBuffers, false);
- }
- catch (AWTException e)
- {
- }
- }
-
- /**
- * Creates a buffering strategy that manages how this window is
- * repainted. This method attempts to create a strategy based on
- * the specified capabilities and throws an exception if the
- * requested strategy is not supported.
- *
- * Calling this method causes any existing buffer strategy to be
- * destroyed.
- *
- * @param numBuffers the number of buffers in this strategy
- * @param caps the requested buffering capabilities
- *
- * @throws AWTException if the requested capabilities are not
- * supported
- * @throws IllegalArgumentException if requested number of buffers
- * is less than one or if caps is null
- *
- * @since 1.4
- */
- public void createBufferStrategy(int numBuffers,
- BufferCapabilities caps)
- {
- if (numBuffers < 1)
- throw new IllegalArgumentException("Window.createBufferStrategy: number"
- + " of buffers is less than one");
-
- if (caps == null)
- throw new IllegalArgumentException("Window.createBufferStrategy:"
- + " capabilities object is null");
-
- // a flipping strategy was requested
- if (caps.isPageFlipping())
- {
- try
- {
- bufferStrategy = new WindowFlipBufferStrategy(numBuffers);
- }
- catch (AWTException e)
- {
- }
- }
- else
- bufferStrategy = new WindowBltBufferStrategy(numBuffers, true);
- }
-
- /**
- * Returns the buffer strategy used by the window.
- *
- * @return the buffer strategy.
- * @since 1.4
- */
- public BufferStrategy getBufferStrategy()
- {
- return bufferStrategy;
- }
-
- /**
- * @since 1.2
- *
- * @deprecated
- */
- public void applyResourceBundle(ResourceBundle rb)
- {
- throw new Error ("Not implemented");
- }
-
- /**
- * @since 1.2
- *
- * @deprecated
- */
- public void applyResourceBundle(String rbName)
- {
- ResourceBundle rb = ResourceBundle.getBundle(rbName, Locale.getDefault(),
- ClassLoader.getSystemClassLoader());
- if (rb != null)
- applyResourceBundle(rb);
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>Window</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTWindow();
- return accessibleContext;
- }
-
- /**
- * Get graphics configuration. The implementation for Window will
- * not ask any parent containers, since Window is a toplevel
- * window and not actually embedded in the parent component.
- */
- public GraphicsConfiguration getGraphicsConfiguration()
- {
- if (graphicsConfiguration != null) return graphicsConfiguration;
- if (peer != null) return peer.getGraphicsConfiguration();
- return null;
- }
-
- protected void processWindowFocusEvent(WindowEvent event)
- {
- if (windowFocusListener != null)
- {
- switch (event.getID ())
- {
- case WindowEvent.WINDOW_GAINED_FOCUS:
- windowFocusListener.windowGainedFocus (event);
- break;
-
- case WindowEvent.WINDOW_LOST_FOCUS:
- windowFocusListener.windowLostFocus (event);
- break;
-
- default:
- break;
- }
- }
- }
-
- /**
- * @since 1.4
- */
- protected void processWindowStateEvent(WindowEvent event)
- {
- if (windowStateListener != null
- && event.getID () == WindowEvent.WINDOW_STATE_CHANGED)
- windowStateListener.windowStateChanged (event);
- }
-
- /**
- * Returns whether this <code>Window</code> can get the focus or not.
- *
- * @since 1.4
- */
- public final boolean isFocusableWindow ()
- {
- if (getFocusableWindowState () == false)
- return false;
-
- if (this instanceof Dialog
- || this instanceof Frame)
- return true;
-
- // FIXME: Implement more possible cases for returning true.
-
- return false;
- }
-
- /**
- * Returns the value of the focusableWindowState property.
- *
- * @since 1.4
- */
- public boolean getFocusableWindowState ()
- {
- return focusableWindowState;
- }
-
- /**
- * Sets the value of the focusableWindowState property.
- *
- * @since 1.4
- */
- public void setFocusableWindowState (boolean focusableWindowState)
- {
- this.focusableWindowState = focusableWindowState;
- }
-
- // setBoundsCallback is needed so that when a user moves a window,
- // the Window's location can be updated without calling the peer's
- // setBounds method. When a user moves a window the peer window's
- // location is updated automatically and the windowing system sends
- // a message back to the application informing it of its updated
- // dimensions. We must update the AWT Window class with these new
- // dimensions. But we don't want to call the peer's setBounds
- // method, because the peer's dimensions have already been updated.
- // (Under X, having this method prevents Configure event loops when
- // moving windows: Component.setBounds -> peer.setBounds ->
- // postConfigureEvent -> Component.setBounds -> ... In some cases
- // Configure event loops cause windows to jitter back and forth
- // continuously).
- void setBoundsCallback (int x, int y, int w, int h)
- {
- if (this.x == x && this.y == y && width == w && height == h)
- return;
- invalidate();
- boolean resized = width != w || height != h;
- boolean moved = this.x != x || this.y != y;
- this.x = x;
- this.y = y;
- width = w;
- height = h;
- if (resized && isShowing ())
- {
- ComponentEvent ce =
- new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED);
- getToolkit().getSystemEventQueue().postEvent(ce);
- }
- if (moved && isShowing ())
- {
- ComponentEvent ce =
- new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED);
- getToolkit().getSystemEventQueue().postEvent(ce);
- }
- }
-
- /**
- * Generate a unique name for this window.
- *
- * @return A unique name for this window.
- */
- String generateName()
- {
- return "win" + getUniqueLong();
- }
-
- private static synchronized long getUniqueLong()
- {
- return next_window_number++;
- }
-}
diff --git a/libjava/java/awt/color/CMMException.java b/libjava/java/awt/color/CMMException.java
deleted file mode 100644
index ab328ec8492..00000000000
--- a/libjava/java/awt/color/CMMException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* CMMException.java -- error in the native CMM
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.color;
-
-/**
- * Thrown when there is an error in the native CMM.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @status updated to 1.4
- */
-public class CMMException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 5775558044142994965L;
-
- /**
- * Create a new instance with a specified detailed error message.
- *
- * @param message the message
- */
- public CMMException(String message)
- {
- super(message);
- }
-} // class CMMException
diff --git a/libjava/java/awt/color/ColorSpace.java b/libjava/java/awt/color/ColorSpace.java
deleted file mode 100644
index 79369da710f..00000000000
--- a/libjava/java/awt/color/ColorSpace.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/* ColorSpace.java -- transforms between color spaces
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.color;
-
-import java.io.Serializable;
-
-/**
- * NEEDS DOCUMENTATION
- *
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- * @since 1.2
- */
-public abstract class ColorSpace implements Serializable
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -409452704308689724L;
-
- public static final int TYPE_XYZ = 0;
- public static final int TYPE_Lab = 1;
- public static final int TYPE_Luv = 2;
- public static final int TYPE_YCbCr = 3;
- public static final int TYPE_Yxy = 4;
- public static final int TYPE_RGB = 5;
- public static final int TYPE_GRAY = 6;
- public static final int TYPE_HSV = 7;
- public static final int TYPE_HLS = 8;
- public static final int TYPE_CMYK = 9;
- // mysterious gap in the enumeration sequenece
- public static final int TYPE_CMY = 11;
- public static final int TYPE_2CLR = 12;
- public static final int TYPE_3CLR = 13;
- public static final int TYPE_4CLR = 14;
- public static final int TYPE_5CLR = 15;
- public static final int TYPE_6CLR = 16;
- public static final int TYPE_7CLR = 17;
- public static final int TYPE_8CLR = 18;
- public static final int TYPE_9CLR = 19;
- public static final int TYPE_ACLR = 20;
- public static final int TYPE_BCLR = 21;
- public static final int TYPE_CCLR = 22;
- public static final int TYPE_DCLR = 23;
- public static final int TYPE_ECLR = 24;
- public static final int TYPE_FCLR = 25;
-
- public static final int CS_sRGB = 1000;
- public static final int CS_LINEAR_RGB = 1004;
- public static final int CS_CIEXYZ = 1001;
- public static final int CS_PYCC = 1002;
- public static final int CS_GRAY = 1003;
-
- private static final int CS_BASE = CS_sRGB;
- private static final int CS_END = CS_LINEAR_RGB + 1;
- private static final int CS_COUNT = CS_END - CS_BASE;
-
- // Instances are lazily instantiated
- private static final ColorSpace[] INSTANCES = new ColorSpace[CS_COUNT];
-
- /**
- * @serial
- */
- // Visible in subclass.
- final int type;
-
- /**
- * @serial
- */
- // Visible in subclass.
- final int numComponents;
-
- protected ColorSpace(int type, int numcomponents)
- {
- this.type = type;
- numComponents = numcomponents;
- }
-
- public static ColorSpace getInstance(int colorspace)
- {
- if ((colorspace >= CS_BASE) && (colorspace < CS_END))
- {
- int instanceIndex = colorspace - CS_BASE;
- if (INSTANCES[instanceIndex] == null)
- {
- ICC_Profile profile = new ICC_Profile(colorspace);
- INSTANCES[instanceIndex] = new ICC_ColorSpace(profile);
- }
- return INSTANCES[instanceIndex];
- }
- throw new IllegalArgumentException("unknown/unsupported colorspace");
- }
-
- public boolean isCS_sRGB()
- {
- return type == CS_sRGB;
- }
-
- /**
- * Transforms a color value assumed to be in this ColorSpace into a value in
- * the default CS_sRGB color space.
- *
- * @exception ArrayIndexOutOfBoundsException If array length is not at least
- * the number of components in this ColorSpace.
- */
- public abstract float[] toRGB(float[] colorvalue);
-
- public abstract float[] fromRGB(float[] rgbvalue);
-
- public abstract float[] toCIEXYZ(float[] colorvalue);
-
- public abstract float[] fromCIEXYZ(float[] colorvalue);
-
- public int getType()
- {
- return type;
- }
-
- public int getNumComponents()
- {
- return numComponents;
- }
-
- public String getName(int idx)
- {
- return "type " + type;
- }
-
- /**
- * @since 1.4
- */
- public float getMinValue(int idx)
- {
- if (idx < 0 || idx >= numComponents)
- throw new IllegalArgumentException();
- return 0;
- }
-
- /**
- * @since 1.4
- */
- public float getMaxValue(int idx)
- {
- if (idx < 0 || idx >= numComponents)
- throw new IllegalArgumentException();
- return 1;
- }
-} // class ColorSpace
diff --git a/libjava/java/awt/color/ICC_ColorSpace.java b/libjava/java/awt/color/ICC_ColorSpace.java
deleted file mode 100644
index b50048cf94b..00000000000
--- a/libjava/java/awt/color/ICC_ColorSpace.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/* ICC_ColorSpace.java -- the canonical color space implementation
- Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.color;
-
-import gnu.java.awt.color.CieXyzConverter;
-import gnu.java.awt.color.ClutProfileConverter;
-import gnu.java.awt.color.ColorSpaceConverter;
-import gnu.java.awt.color.GrayProfileConverter;
-import gnu.java.awt.color.GrayScaleConverter;
-import gnu.java.awt.color.LinearRGBConverter;
-import gnu.java.awt.color.PyccConverter;
-import gnu.java.awt.color.RgbProfileConverter;
-import gnu.java.awt.color.SrgbConverter;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-/**
- * ICC_ColorSpace - an implementation of ColorSpace
- *
- * While an ICC_Profile class abstracts the data in an ICC profile file
- * an ICC_ColorSpace performs the color space conversions defined by
- * an ICC_Profile instance.
- *
- * Typically, an ICC_Profile will either be created using getInstance,
- * either from the built-in colorspaces, or from an ICC profile file.
- * Then a ICC_Colorspace will be used to perform transforms from the
- * device colorspace to and from the profile color space.
- *
- * The PCS used by ColorSpace is CIE XYZ relative a D50 white point.
- * (Profiles using a CIE Lab PCS will have their input and output converted
- * to D50 CIE XYZ accordingly.
- *
- * Note that a valid profile may not contain transforms in both directions,
- * in which case the output may be undefined.
- * All built-in colorspaces have bidirectional transforms, but developers
- * using an ICC profile file may want to check the profile class using
- * the ICC_Profile.getProfileClass() method. Input class profiles are
- * guaranteed to have transforms to the PCS, output class profiles are
- * guaranteed to have transforms from the PCS to device space.
- *
- * @author Sven de Marothy
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- * @since 1.2
- */
-public class ICC_ColorSpace extends ColorSpace
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 3455889114070431483L;
-
- /**
- * @serial
- */
- private ICC_Profile thisProfile;
-
- /**
- * @serial
- */
- private float[] minVal;
-
- /**
- * @serial
- */
- private float[] maxVal;
-
- /**
- * @serial
- */
- private float[] diffMinMax;
-
- /**
- * @serial
- */
- private float[] invDiffMinMax;
-
- /**
- * @serial
- */
- private boolean needScaleInit;
-
- /**
- * Tells us if the PCS is CIE LAB (must be CIEXYZ otherwise)
- */
- private transient int type;
- private transient int nComponents;
- private transient ColorSpaceConverter converter;
-
- /**
- * Constructs a new ICC_ColorSpace from an ICC_Profile object.
- *
- * @exception IllegalArgumentException If profile is inappropriate for
- * representing a ColorSpace.
- */
- public ICC_ColorSpace(ICC_Profile profile)
- {
- super(profile.getColorSpaceType(), profile.getNumComponents());
-
- converter = getConverter(profile);
- thisProfile = profile;
- nComponents = profile.getNumComponents();
- type = profile.getColorSpaceType();
- makeArrays();
- }
-
- /**
- * Return the profile
- */
- public ICC_Profile getProfile()
- {
- return thisProfile;
- }
-
- /**
- * Transforms a color value assumed to be in this ColorSpace into a value in
- * the default CS_sRGB color space.
- *
- * @exception ArrayIndexOutOfBoundsException If array length is not at least
- * the number of components in this ColorSpace.
- */
- public float[] toRGB(float[] colorvalue)
- {
- return converter.toRGB(colorvalue);
- }
-
- /**
- * Transforms a color value assumed to be in the default CS_sRGB color space
- * into this ColorSpace.
- *
- * @exception ArrayIndexOutOfBoundsException If array length is not at
- * least 3.
- */
- public float[] fromRGB(float[] rgbvalue)
- {
- return converter.fromRGB(rgbvalue);
- }
-
- /**
- * Transforms a color value assumed to be in this ColorSpace into the
- * CS_CIEXYZ conversion color space.
- *
- * @exception ArrayIndexOutOfBoundsException If array length is not at
- * least the number of components in this ColorSpace.
- */
- public float[] toCIEXYZ(float[] colorvalue)
- {
- return converter.toCIEXYZ(colorvalue);
- }
-
- /**
- * Transforms a color value assumed to be in the CS_CIEXYZ conversion color
- * space into this ColorSpace.
- *
- * @exception ArrayIndexOutOfBoundsException If array length is not at
- * least 3.
- */
- public float[] fromCIEXYZ(float[] colorvalue)
- {
- return converter.fromCIEXYZ(colorvalue);
- }
-
- public boolean isCS_sRGB()
- {
- return converter instanceof SrgbConverter;
- }
-
- /**
- * Returns the minimum normalized color component value for the specified
- * component.
- *
- * @exception IllegalArgumentException If component is less than 0 or greater
- * than numComponents - 1.
- *
- * @since 1.4
- */
- public float getMinValue(int idx)
- {
- // FIXME: Not 100% certain of this.
- if (type == ColorSpace.TYPE_Lab && (idx == 1 || idx == 2))
- return -128f;
-
- if (idx < 0 || idx >= nComponents)
- throw new IllegalArgumentException();
- return 0;
- }
-
- /**
- * Returns the maximum normalized color component value for the specified
- * component.
- *
- * @exception IllegalArgumentException If component is less than 0 or greater
- * than numComponents - 1.
- *
- * @since 1.4
- */
- public float getMaxValue(int idx)
- {
- if (type == ColorSpace.TYPE_XYZ && idx >= 0 && idx <= 2)
- return 1 + 32767 / 32768f;
- else if (type == ColorSpace.TYPE_Lab)
- {
- if (idx == 0)
- return 100;
- if (idx == 1 || idx == 2)
- return 127;
- }
- if (idx < 0 || idx >= nComponents)
- throw new IllegalArgumentException();
- return 1;
- }
-
- /**
- * Returns a colorspace converter suitable for a given profile
- */
- private ColorSpaceConverter getConverter(ICC_Profile profile)
- {
- ColorSpaceConverter converter;
- switch (profile.isPredefined())
- {
- case CS_sRGB:
- converter = new SrgbConverter();
- break;
- case CS_CIEXYZ:
- converter = new CieXyzConverter();
- break;
- case CS_GRAY:
- converter = new GrayScaleConverter();
- break;
- case CS_LINEAR_RGB:
- converter = new LinearRGBConverter();
- break;
- case CS_PYCC:
- converter = new PyccConverter();
- break;
- default:
- if (profile instanceof ICC_ProfileRGB)
- converter = new RgbProfileConverter((ICC_ProfileRGB) profile);
- else if (profile instanceof ICC_ProfileGray)
- converter = new GrayProfileConverter((ICC_ProfileGray) profile);
- else
- converter = new ClutProfileConverter(profile);
- break;
- }
- return converter;
- }
-
- /**
- * Serialization compatibility requires these variable to be set,
- * although we don't use them. Perhaps we should?
- */
- private void makeArrays()
- {
- minVal = new float[nComponents];
- maxVal = new float[nComponents];
-
- invDiffMinMax = diffMinMax = null;
- for (int i = 0; i < nComponents; i++)
- {
- minVal[i] = getMinValue(i);
- maxVal[i] = getMaxValue(i);
- }
- needScaleInit = true;
- }
-
- /**
- * Deserializes the object
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- // set up objects
- converter = getConverter(thisProfile);
- nComponents = thisProfile.getNumComponents();
- type = thisProfile.getColorSpaceType();
- }
-} // class ICC_ColorSpace
diff --git a/libjava/java/awt/color/ICC_Profile.java b/libjava/java/awt/color/ICC_Profile.java
deleted file mode 100644
index 75f55a1dacb..00000000000
--- a/libjava/java/awt/color/ICC_Profile.java
+++ /dev/null
@@ -1,1244 +0,0 @@
-/* ICC_Profile.java -- color space profiling
- Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.color;
-
-import gnu.java.awt.color.ProfileHeader;
-import gnu.java.awt.color.TagEntry;
-
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamException;
-import java.io.OutputStream;
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-/**
- * ICC Profile - represents an ICC Color profile.
- * The ICC profile format is a standard file format which maps the transform
- * from a device color space to a standard Profile Color Space (PCS), which
- * can either be CIE L*a*b or CIE XYZ.
- * (With the exception of device link profiles which map from one device space
- * to another)
- *
- * ICC profiles calibrated to specific input/output devices are used when color
- * fidelity is of importance.
- *
- * An instance of ICC_Profile can be created using the getInstance() methods,
- * either using one of the predefined color spaces enumerated in ColorSpace,
- * or from an ICC profile file, or from an input stream.
- *
- * An ICC_ColorSpace object can then be created to transform color values
- * through the profile.
- *
- * The ICC_Profile class implements the version 2 format specified by
- * International Color Consortium Specification ICC.1:1998-09,
- * and its addendum ICC.1A:1999-04, April 1999
- * (available at www.color.org)
- *
- * @author Sven de Marothy
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- * @since 1.2
- */
-public class ICC_Profile implements Serializable
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -3938515861990936766L;
-
- /**
- * ICC Profile classes
- */
- public static final int CLASS_INPUT = 0;
- public static final int CLASS_DISPLAY = 1;
- public static final int CLASS_OUTPUT = 2;
- public static final int CLASS_DEVICELINK = 3;
- public static final int CLASS_COLORSPACECONVERSION = 4;
- public static final int CLASS_ABSTRACT = 5;
- public static final int CLASS_NAMEDCOLOR = 6;
-
- /**
- * ICC Profile class signatures
- */
- public static final int icSigInputClass = 0x73636e72; // 'scnr'
- public static final int icSigDisplayClass = 0x6d6e7472; // 'mntr'
- public static final int icSigOutputClass = 0x70727472; // 'prtr'
- public static final int icSigLinkClass = 0x6c696e6b; // 'link'
- public static final int icSigColorSpaceClass = 0x73706163; // 'spac'
- public static final int icSigAbstractClass = 0x61627374; // 'abst'
- public static final int icSigNamedColorClass = 0x6e6d636c; // 'nmcl'
-
- /**
- * Color space signatures
- */
- public static final int icSigXYZData = 0x58595A20; // 'XYZ '
- public static final int icSigLabData = 0x4C616220; // 'Lab '
- public static final int icSigLuvData = 0x4C757620; // 'Luv '
- public static final int icSigYCbCrData = 0x59436272; // 'YCbr'
- public static final int icSigYxyData = 0x59787920; // 'Yxy '
- public static final int icSigRgbData = 0x52474220; // 'RGB '
- public static final int icSigGrayData = 0x47524159; // 'GRAY'
- public static final int icSigHsvData = 0x48535620; // 'HSV '
- public static final int icSigHlsData = 0x484C5320; // 'HLS '
- public static final int icSigCmykData = 0x434D594B; // 'CMYK'
- public static final int icSigCmyData = 0x434D5920; // 'CMY '
- public static final int icSigSpace2CLR = 0x32434C52; // '2CLR'
- public static final int icSigSpace3CLR = 0x33434C52; // '3CLR'
- public static final int icSigSpace4CLR = 0x34434C52; // '4CLR'
- public static final int icSigSpace5CLR = 0x35434C52; // '5CLR'
- public static final int icSigSpace6CLR = 0x36434C52; // '6CLR'
- public static final int icSigSpace7CLR = 0x37434C52; // '7CLR'
- public static final int icSigSpace8CLR = 0x38434C52; // '8CLR'
- public static final int icSigSpace9CLR = 0x39434C52; // '9CLR'
- public static final int icSigSpaceACLR = 0x41434C52; // 'ACLR'
- public static final int icSigSpaceBCLR = 0x42434C52; // 'BCLR'
- public static final int icSigSpaceCCLR = 0x43434C52; // 'CCLR'
- public static final int icSigSpaceDCLR = 0x44434C52; // 'DCLR'
- public static final int icSigSpaceECLR = 0x45434C52; // 'ECLR'
- public static final int icSigSpaceFCLR = 0x46434C52; // 'FCLR'
-
- /**
- * Rendering intents
- */
- public static final int icPerceptual = 0;
- public static final int icRelativeColorimetric = 1;
- public static final int icSaturation = 2;
- public static final int icAbsoluteColorimetric = 3;
-
- /**
- * Tag signatures
- */
- public static final int icSigAToB0Tag = 0x41324230; // 'A2B0'
- public static final int icSigAToB1Tag = 0x41324231; // 'A2B1'
- public static final int icSigAToB2Tag = 0x41324232; // 'A2B2'
- public static final int icSigBlueColorantTag = 0x6258595A; // 'bXYZ'
- public static final int icSigBlueTRCTag = 0x62545243; // 'bTRC'
- public static final int icSigBToA0Tag = 0x42324130; // 'B2A0'
- public static final int icSigBToA1Tag = 0x42324131; // 'B2A1'
- public static final int icSigBToA2Tag = 0x42324132; // 'B2A2'
- public static final int icSigCalibrationDateTimeTag = 0x63616C74; // 'calt'
- public static final int icSigCharTargetTag = 0x74617267; // 'targ'
- public static final int icSigCopyrightTag = 0x63707274; // 'cprt'
- public static final int icSigCrdInfoTag = 0x63726469; // 'crdi'
- public static final int icSigDeviceMfgDescTag = 0x646D6E64; // 'dmnd'
- public static final int icSigDeviceModelDescTag = 0x646D6464; // 'dmdd'
- public static final int icSigDeviceSettingsTag = 0x64657673; // 'devs'
- public static final int icSigGamutTag = 0x67616D74; // 'gamt'
- public static final int icSigGrayTRCTag = 0x6b545243; // 'kTRC'
- public static final int icSigGreenColorantTag = 0x6758595A; // 'gXYZ'
- public static final int icSigGreenTRCTag = 0x67545243; // 'gTRC'
- public static final int icSigLuminanceTag = 0x6C756d69; // 'lumi'
- public static final int icSigMeasurementTag = 0x6D656173; // 'meas'
- public static final int icSigMediaBlackPointTag = 0x626B7074; // 'bkpt'
- public static final int icSigMediaWhitePointTag = 0x77747074; // 'wtpt'
- public static final int icSigNamedColor2Tag = 0x6E636C32; // 'ncl2'
- public static final int icSigOutputResponseTag = 0x72657370; // 'resp'
- public static final int icSigPreview0Tag = 0x70726530; // 'pre0'
- public static final int icSigPreview1Tag = 0x70726531; // 'pre1'
- public static final int icSigPreview2Tag = 0x70726532; // 'pre2'
- public static final int icSigProfileDescriptionTag = 0x64657363; // 'desc'
- public static final int icSigProfileSequenceDescTag = 0x70736571; // 'pseq'
- public static final int icSigPs2CRD0Tag = 0x70736430; // 'psd0'
- public static final int icSigPs2CRD1Tag = 0x70736431; // 'psd1'
- public static final int icSigPs2CRD2Tag = 0x70736432; // 'psd2'
- public static final int icSigPs2CRD3Tag = 0x70736433; // 'psd3'
- public static final int icSigPs2CSATag = 0x70733273; // 'ps2s'
- public static final int icSigPs2RenderingIntentTag = 0x70733269; // 'ps2i'
- public static final int icSigRedColorantTag = 0x7258595A; // 'rXYZ'
- public static final int icSigRedTRCTag = 0x72545243; // 'rTRC'
- public static final int icSigScreeningDescTag = 0x73637264; // 'scrd'
- public static final int icSigScreeningTag = 0x7363726E; // 'scrn'
- public static final int icSigTechnologyTag = 0x74656368; // 'tech'
- public static final int icSigUcrBgTag = 0x62666420; // 'bfd '
- public static final int icSigViewingCondDescTag = 0x76756564; // 'vued'
- public static final int icSigViewingConditionsTag = 0x76696577; // 'view'
- public static final int icSigChromaticityTag = 0x6368726D; // 'chrm'
-
- /**
- * Non-ICC tag 'head' for use in retrieving the header with getData()
- */
- public static final int icSigHead = 0x68656164;
-
- /**
- * Header offsets
- */
- public static final int icHdrSize = 0;
- public static final int icHdrCmmId = 4;
- public static final int icHdrVersion = 8;
- public static final int icHdrDeviceClass = 12;
- public static final int icHdrColorSpace = 16;
- public static final int icHdrPcs = 20;
- public static final int icHdrDate = 24;
- public static final int icHdrMagic = 36;
- public static final int icHdrPlatform = 40;
- public static final int icHdrFlags = 44;
- public static final int icHdrManufacturer = 48;
- public static final int icHdrModel = 52;
- public static final int icHdrAttributes = 56;
- public static final int icHdrRenderingIntent = 64;
- public static final int icHdrIlluminant = 68;
- public static final int icHdrCreator = 80;
-
- /**
- *
- */
- public static final int icTagType = 0;
- public static final int icTagReserved = 4;
- public static final int icCurveCount = 8;
- public static final int icCurveData = 12;
- public static final int icXYZNumberX = 8;
-
- /**
- * offset of the Tag table
- */
- private static final int tagTableOffset = 128;
-
- /**
- * @serial
- */
- private static final int iccProfileSerializedDataVersion = 1;
-
- /**
- * Constants related to generating profiles for
- * built-in colorspace profiles
- */
- /**
- * Copyright notice to stick into built-in-profile files.
- */
- private static final String copyrightNotice = "Generated by GNU Classpath.";
-
- /**
- * Resolution of the TRC to use for predefined profiles.
- * 1024 should suffice.
- */
- private static final int TRC_POINTS = 1024;
-
- /**
- * CIE 1931 D50 white point (in Lab coordinates)
- */
- private static final float[] D50 = { 0.96422f, 1.00f, 0.82521f };
-
- /**
- * Color space profile ID
- * Set to the predefined profile class (e.g. CS_sRGB) if a predefined
- * color space is used, set to -1 otherwise.
- * (or if the profile has been modified)
- */
- private transient int profileID;
-
- /**
- * The profile header data
- */
- private transient ProfileHeader header;
-
- /**
- * A hashtable containing the profile tags as TagEntry objects
- */
- private transient Hashtable tagTable;
-
- /**
- * Contructor for predefined colorspaces
- */
- ICC_Profile(int profileID)
- {
- header = null;
- tagTable = null;
- createProfile(profileID);
- }
-
- /**
- * Constructs an ICC_Profile from a header and a table of loaded tags.
- */
- ICC_Profile(ProfileHeader h, Hashtable tags) throws IllegalArgumentException
- {
- header = h;
- tagTable = tags;
- profileID = -1; // Not a predefined color space
- }
-
- /**
- * Constructs an ICC_Profile from a byte array of data.
- */
- ICC_Profile(byte[] data) throws IllegalArgumentException
- {
- // get header and verify it
- header = new ProfileHeader(data);
- header.verifyHeader(data.length);
- tagTable = createTagTable(data);
- profileID = -1; // Not a predefined color space
- }
-
- /**
- * Free up the used memory.
- */
- protected void finalize()
- {
- }
-
- /**
- * Returns an ICC_Profile instance from a byte array of profile data.
- *
- * An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
- * may be returned if appropriate.
- *
- * @throws IllegalArgumentException if the profile data is an invalid
- * v2 profile.
- *
- * @param data - the profile data
- * @return An ICC_Profile object
- */
- public static ICC_Profile getInstance(byte[] data)
- {
- ProfileHeader header = new ProfileHeader(data);
-
- // verify it as a correct ICC header, including size
- header.verifyHeader(data.length);
-
- Hashtable tags = createTagTable(data);
-
- if (isRGBProfile(header, tags))
- return new ICC_ProfileRGB(data);
- if (isGrayProfile(header, tags))
- return new ICC_ProfileGray(data);
-
- return new ICC_Profile(header, tags);
- }
-
- /**
- * Returns an predefined ICC_Profile instance.
- *
- * This will construct an ICC_Profile instance from one of the predefined
- * color spaces in the ColorSpace class. (e.g. CS_sRGB, CS_GRAY, etc)
- *
- * An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
- * may be returned if appropriate.
- *
- * @return An ICC_Profile object
- */
- public static ICC_Profile getInstance(int cspace)
- {
- if (cspace == ColorSpace.CS_sRGB || cspace == ColorSpace.CS_LINEAR_RGB)
- return new ICC_ProfileRGB(cspace);
- if (cspace == ColorSpace.CS_GRAY)
- return new ICC_ProfileGray(cspace);
- return new ICC_Profile(cspace);
- }
-
- /**
- * Returns an ICC_Profile instance from an ICC Profile file.
- *
- * An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
- * may be returned if appropriate.
- *
- * @throws IllegalArgumentException if the profile data is an invalid
- * v2 profile.
- * @throws IOException if the file could not be read.
- *
- * @param filename - the file name of the profile file.
- * @return An ICC_Profile object
- */
- public static ICC_Profile getInstance(String filename)
- throws IOException
- {
- return getInstance(new FileInputStream(filename));
- }
-
- /**
- * Returns an ICC_Profile instance from an InputStream.
- *
- * This method can be used for reading ICC profiles embedded in files
- * which support this. (JPEG and SVG for instance).
- *
- * The stream is treated in the following way: The profile header
- * (128 bytes) is read first, and the header is validated. If the profile
- * header is valid, it will then attempt to read the rest of the profile
- * from the stream. The stream is not closed after reading.
- *
- * An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
- * may be returned if appropriate.
- *
- * @throws IllegalArgumentException if the profile data is an invalid
- * v2 profile.
- * @throws IOException if the stream could not be read.
- *
- * @param in - the input stream to read the profile from.
- * @return An ICC_Profile object
- */
- public static ICC_Profile getInstance(InputStream in)
- throws IOException
- {
- // read the header
- byte[] headerData = new byte[ProfileHeader.HEADERSIZE];
- if (in.read(headerData) != ProfileHeader.HEADERSIZE)
- throw new IllegalArgumentException("Invalid profile header");
-
- ProfileHeader header = new ProfileHeader(headerData);
-
- // verify it as a correct ICC header, but do not verify the
- // size as we are reading from a stream.
- header.verifyHeader(-1);
-
- // get the size
- byte[] data = new byte[header.getSize()];
- System.arraycopy(headerData, 0, data, 0, ProfileHeader.HEADERSIZE);
-
- // read the rest
- if (in.read(data, ProfileHeader.HEADERSIZE,
- header.getSize() - ProfileHeader.HEADERSIZE) != header.getSize()
- - ProfileHeader.HEADERSIZE)
- throw new IOException("Incorrect profile size");
-
- return getInstance(data);
- }
-
- /**
- * Returns the major version number
- */
- public int getMajorVersion()
- {
- return header.getMajorVersion();
- }
-
- /**
- * Returns the minor version number.
- *
- * Only the least-significant byte contains data, in BCD form:
- * the least-significant nibble is the BCD bug fix revision,
- * the most-significant nibble is the BCD minor revision number.
- *
- * (E.g. For a v2.1.0 profile this will return <code>0x10</code>)
- */
- public int getMinorVersion()
- {
- return header.getMinorVersion();
- }
-
- /**
- * Returns the device class of this profile,
- *
- * (E.g. CLASS_INPUT for a scanner profile,
- * CLASS_OUTPUT for a printer)
- */
- public int getProfileClass()
- {
- return header.getProfileClass();
- }
-
- /**
- * Returns the color space of this profile, in terms
- * of the color space constants defined in ColorSpace.
- * (For example, it may be a ColorSpace.TYPE_RGB)
- */
- public int getColorSpaceType()
- {
- return header.getColorSpace();
- }
-
- /**
- * Returns the color space of this profile's Profile Connection Space (OCS)
- *
- * In terms of the color space constants defined in ColorSpace.
- * This may be TYPE_XYZ or TYPE_Lab
- */
- public int getPCSType()
- {
- return header.getProfileColorSpace();
- }
-
- /**
- * Writes the profile data to an ICC profile file.
- * @param filename - The name of the file to write
- * @throws IOException if the write failed.
- */
- public void write(String filename) throws IOException
- {
- FileOutputStream out = new FileOutputStream(filename);
- write(out);
- out.flush();
- out.close();
- }
-
- /**
- * Writes the profile data in ICC profile file-format to a stream.
- * This is useful for embedding ICC profiles in file formats which
- * support this (such as JPEG and SVG).
- *
- * The stream is not closed after writing.
- * @param out - The outputstream to which the profile data should be written
- * @throws IOException if the write failed.
- */
- public void write(OutputStream out) throws IOException
- {
- out.write(getData());
- }
-
- /**
- * Returns the data corresponding to this ICC_Profile as a byte array.
- *
- * @return The data in a byte array,
- * where the first element corresponds to first byte of the profile file.
- */
- public byte[] getData()
- {
- int size = getSize();
- byte[] data = new byte[size];
-
- // Header
- System.arraycopy(header.getData(size), 0, data, 0, ProfileHeader.HEADERSIZE);
- // # of tags
- byte[] tt = getTagTable();
- System.arraycopy(tt, 0, data, ProfileHeader.HEADERSIZE, tt.length);
-
- Enumeration e = tagTable.elements();
- while (e.hasMoreElements())
- {
- TagEntry tag = (TagEntry) e.nextElement();
- System.arraycopy(tag.getData(), 0,
- data, tag.getOffset(), tag.getSize());
- }
- return data;
- }
-
- /**
- * Returns the ICC profile tag data
- * The non ICC-tag icSigHead is also permitted to request the header data.
- *
- * @param tagSignature The ICC signature of the requested tag
- * @return A byte array containing the tag data
- */
- public byte[] getData(int tagSignature)
- {
- if (tagSignature == icSigHead)
- return header.getData(getSize());
-
- TagEntry t = (TagEntry) tagTable.get(TagEntry.tagHashKey(tagSignature));
- if (t == null)
- return null;
- return t.getData();
- }
-
- /**
- * Sets the ICC profile tag data.
- *
- * Note that an ICC profile can only contain one tag of each type, if
- * a tag already exists with the given signature, it is replaced.
- *
- * @param tagSignature - The signature of the tag to set
- * @param data - A byte array containing the tag data
- */
- public void setData(int tagSignature, byte[] data)
- {
- profileID = -1; // Not a predefined color space if modified.
-
- if (tagSignature == icSigHead)
- header = new ProfileHeader(data);
- else
- {
- TagEntry t = new TagEntry(tagSignature, data);
- tagTable.put(t.hashKey(), t);
- }
- }
-
- /**
- * Get the number of components in the profile's device color space.
- */
- public int getNumComponents()
- {
- int[] lookup =
- {
- ColorSpace.TYPE_RGB, 3, ColorSpace.TYPE_CMY, 3,
- ColorSpace.TYPE_CMYK, 4, ColorSpace.TYPE_GRAY, 1,
- ColorSpace.TYPE_YCbCr, 3, ColorSpace.TYPE_XYZ, 3,
- ColorSpace.TYPE_Lab, 3, ColorSpace.TYPE_HSV, 3,
- ColorSpace.TYPE_2CLR, 2, ColorSpace.TYPE_Luv, 3,
- ColorSpace.TYPE_Yxy, 3, ColorSpace.TYPE_HLS, 3,
- ColorSpace.TYPE_3CLR, 3, ColorSpace.TYPE_4CLR, 4,
- ColorSpace.TYPE_5CLR, 5, ColorSpace.TYPE_6CLR, 6,
- ColorSpace.TYPE_7CLR, 7, ColorSpace.TYPE_8CLR, 8,
- ColorSpace.TYPE_9CLR, 9, ColorSpace.TYPE_ACLR, 10,
- ColorSpace.TYPE_BCLR, 11, ColorSpace.TYPE_CCLR, 12,
- ColorSpace.TYPE_DCLR, 13, ColorSpace.TYPE_ECLR, 14,
- ColorSpace.TYPE_FCLR, 15
- };
- for (int i = 0; i < lookup.length; i += 2)
- if (header.getColorSpace() == lookup[i])
- return lookup[i + 1];
- return 3; // should never happen.
- }
-
- /**
- * After deserializing we must determine if the class we want
- * is really one of the more specialized ICC_ProfileRGB or
- * ICC_ProfileGray classes.
- */
- protected Object readResolve() throws ObjectStreamException
- {
- if (isRGBProfile(header, tagTable))
- return new ICC_ProfileRGB(getData());
- if (isGrayProfile(header, tagTable))
- return new ICC_ProfileGray(getData());
- return this;
- }
-
- /**
- * Deserializes an instance
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- String predef = (String) s.readObject();
- byte[] data = (byte[]) s.readObject();
-
- if (data != null)
- {
- header = new ProfileHeader(data);
- tagTable = createTagTable(data);
- profileID = -1; // Not a predefined color space
- }
-
- if (predef != null)
- {
- predef = predef.intern();
- if (predef.equals("CS_sRGB"))
- createProfile(ColorSpace.CS_sRGB);
- if (predef.equals("CS_LINEAR_RGB"))
- createProfile(ColorSpace.CS_LINEAR_RGB);
- if (predef.equals("CS_CIEXYZ"))
- createProfile(ColorSpace.CS_CIEXYZ);
- if (predef.equals("CS_GRAY"))
- createProfile(ColorSpace.CS_GRAY);
- if (predef.equals("CS_PYCC"))
- createProfile(ColorSpace.CS_PYCC);
- }
- }
-
- /**
- * Serializes an instance
- * The format is a String and a byte array,
- * The string is non-null if the instance is one of the built-in profiles.
- * Otherwise the byte array is non-null and represents the profile data.
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- s.defaultWriteObject();
- if (profileID == ColorSpace.CS_sRGB)
- s.writeObject("CS_sRGB");
- else if (profileID == ColorSpace.CS_LINEAR_RGB)
- s.writeObject("CS_LINEAR_RGB");
- else if (profileID == ColorSpace.CS_CIEXYZ)
- s.writeObject("CS_CIEXYZ");
- else if (profileID == ColorSpace.CS_GRAY)
- s.writeObject("CS_GRAY");
- else if (profileID == ColorSpace.CS_PYCC)
- s.writeObject("CS_PYCC");
- else
- {
- s.writeObject(null); // null string
- s.writeObject(getData()); // data
- return;
- }
- s.writeObject(null); // null data
- }
-
- /**
- * Sorts a ICC profile byte array into TagEntry objects stored in
- * a hash table.
- */
- private static Hashtable createTagTable(byte[] data)
- throws IllegalArgumentException
- {
- ByteBuffer buf = ByteBuffer.wrap(data);
- int nTags = buf.getInt(tagTableOffset);
-
- Hashtable tagTable = new Hashtable();
- for (int i = 0; i < nTags; i++)
- {
- TagEntry te = new TagEntry(buf.getInt(tagTableOffset
- + i * TagEntry.entrySize + 4),
- buf.getInt(tagTableOffset
- + i * TagEntry.entrySize + 8),
- buf.getInt(tagTableOffset
- + i * TagEntry.entrySize + 12),
- data);
-
- if (tagTable.put(te.hashKey(), te) != null)
- throw new IllegalArgumentException("Duplicate tag in profile:" + te);
- }
- return tagTable;
- }
-
- /**
- * Returns the total size of the padded, stored data
- * Note: Tags must be stored on 4-byte aligned offsets.
- */
- private int getSize()
- {
- int totalSize = ProfileHeader.HEADERSIZE; // size of header
-
- int tagTableSize = 4 + tagTable.size() * TagEntry.entrySize; // size of tag table
- if ((tagTableSize & 0x0003) != 0)
- tagTableSize += 4 - (tagTableSize & 0x0003); // pad
- totalSize += tagTableSize;
-
- Enumeration e = tagTable.elements();
- while (e.hasMoreElements())
- { // tag data
- int tagSize = ((TagEntry) e.nextElement()).getSize();
- if ((tagSize & 0x0003) != 0)
- tagSize += 4 - (tagSize & 0x0003); // pad
- totalSize += tagSize;
- }
- return totalSize;
- }
-
- /**
- * Generates the tag index table
- */
- private byte[] getTagTable()
- {
- int tagTableSize = 4 + tagTable.size() * TagEntry.entrySize;
- if ((tagTableSize & 0x0003) != 0)
- tagTableSize += 4 - (tagTableSize & 0x0003); // pad
-
- int offset = 4;
- int tagOffset = ProfileHeader.HEADERSIZE + tagTableSize;
- ByteBuffer buf = ByteBuffer.allocate(tagTableSize);
- buf.putInt(tagTable.size()); // number of tags
-
- Enumeration e = tagTable.elements();
- while (e.hasMoreElements())
- {
- TagEntry tag = (TagEntry) e.nextElement();
- buf.putInt(offset, tag.getSignature());
- buf.putInt(offset + 4, tagOffset);
- buf.putInt(offset + 8, tag.getSize());
- tag.setOffset(tagOffset);
- int tagSize = tag.getSize();
- if ((tagSize & 0x0003) != 0)
- tagSize += 4 - (tagSize & 0x0003); // pad
- tagOffset += tagSize;
- offset += 12;
- }
- return buf.array();
- }
-
- /**
- * Returns if the criteria for an ICC_ProfileRGB are met.
- * This means:
- * Color space is TYPE_RGB
- * (r,g,b)ColorantTags included
- * (r,g,b)TRCTags included
- * mediaWhitePointTag included
- */
- private static boolean isRGBProfile(ProfileHeader header, Hashtable tags)
- {
- if (header.getColorSpace() != ColorSpace.TYPE_RGB)
- return false;
- if (tags.get(TagEntry.tagHashKey(icSigRedColorantTag)) == null)
- return false;
- if (tags.get(TagEntry.tagHashKey(icSigGreenColorantTag)) == null)
- return false;
- if (tags.get(TagEntry.tagHashKey(icSigBlueColorantTag)) == null)
- return false;
- if (tags.get(TagEntry.tagHashKey(icSigRedTRCTag)) == null)
- return false;
- if (tags.get(TagEntry.tagHashKey(icSigGreenTRCTag)) == null)
- return false;
- if (tags.get(TagEntry.tagHashKey(icSigBlueTRCTag)) == null)
- return false;
- return (tags.get(TagEntry.tagHashKey(icSigMediaWhitePointTag)) != null);
- }
-
- /**
- * Returns if the criteria for an ICC_ProfileGray are met.
- * This means:
- * Colorspace is TYPE_GRAY
- * grayTRCTag included
- * mediaWhitePointTag included
- */
- private static boolean isGrayProfile(ProfileHeader header, Hashtable tags)
- {
- if (header.getColorSpace() != ColorSpace.TYPE_GRAY)
- return false;
- if (tags.get(TagEntry.tagHashKey(icSigGrayTRCTag)) == null)
- return false;
- return (tags.get(TagEntry.tagHashKey(icSigMediaWhitePointTag)) != null);
- }
-
- /**
- * Returns curve data for a 'curv'-type tag
- * If it's a gamma curve, a single entry will be returned with the
- * gamma value (including 1.0 for linear response)
- * Otherwise the TRC table is returned.
- *
- * (Package private - used by ICC_ProfileRGB and ICC_ProfileGray)
- */
- short[] getCurve(int signature)
- {
- byte[] data = getData(signature);
- short[] curve;
-
- // can't find tag?
- if (data == null)
- return null;
-
- // not an curve type tag?
- ByteBuffer buf = ByteBuffer.wrap(data);
- if (buf.getInt(0) != 0x63757276) // 'curv' type
- return null;
- int count = buf.getInt(8);
- if (count == 0)
- {
- curve = new short[1];
- curve[0] = 0x0100; // 1.00 in u8fixed8
- return curve;
- }
- if (count == 1)
- {
- curve = new short[1];
- curve[0] = buf.getShort(12); // other u8fixed8 gamma
- return curve;
- }
- curve = new short[count];
- for (int i = 0; i < count; i++)
- curve[i] = buf.getShort(12 + i * 2);
- return curve;
- }
-
- /**
- * Returns XYZ tristimulus values for an 'XYZ ' type tag
- * @return the XYZ values, or null if the tag was not an 'XYZ ' type tag.
- *
- * (Package private - used by ICC_ProfileXYZ and ICC_ProfileGray)
- */
- float[] getXYZData(int signature)
- {
- byte[] data = getData(signature);
-
- // can't find tag?
- if (data == null)
- return null;
-
- // not an XYZData type tag?
- ByteBuffer buf = ByteBuffer.wrap(data);
- if (buf.getInt(0) != icSigXYZData) // 'XYZ ' type
- return null;
-
- float[] point = new float[3];
-
- // get the X,Y,Z tristimulus values
- point[0] = ((float) buf.getInt(8)) / 65536f;
- point[1] = ((float) buf.getInt(12)) / 65536f;
- point[2] = ((float) buf.getInt(16)) / 65536f;
- return point;
- }
-
- /**
- * Returns the profile ID if it's a predefined profile
- * Or -1 for a profile loaded from an ICC profile
- *
- * (Package private - used by ICC_ColorSpace)
- */
- int isPredefined()
- {
- return profileID;
- }
-
- /**
- * Creates a tag of XYZ-value type.
- */
- private byte[] makeXYZData(float[] values)
- {
- ByteBuffer buf = ByteBuffer.allocate(20);
- buf.putInt(0, icSigXYZData); // 'XYZ '
- buf.putInt(4, 0);
- buf.putInt(8, (int) (values[0] * 65536.0));
- buf.putInt(12, (int) (values[1] * 65536.0));
- buf.putInt(16, (int) (values[2] * 65536.0));
- return buf.array();
- }
-
- /**
- * Creates a tag of text type
- */
- private byte[] makeTextTag(String text)
- {
- int length = text.length();
- ByteBuffer buf = ByteBuffer.allocate(8 + length + 1);
- byte[] data;
- try
- {
- data = text.getBytes("US-ASCII");
- }
- catch (UnsupportedEncodingException e)
- {
- data = new byte[length]; // shouldn't happen
- }
-
- buf.putInt(0, (int) 0x74657874); // 'text'
- buf.putInt(4, 0);
- for (int i = 0; i < length; i++)
- buf.put(8 + i, data[i]);
- buf.put(8 + length, (byte) 0); // null-terminate
- return buf.array();
- }
-
- /**
- * Creates a tag of textDescriptionType
- */
- private byte[] makeDescTag(String text)
- {
- int length = text.length();
- ByteBuffer buf = ByteBuffer.allocate(90 + length + 1);
- buf.putInt(0, (int) 0x64657363); // 'desc'
- buf.putInt(4, 0); // reserved
- buf.putInt(8, length + 1); // ASCII length, including null termination
- byte[] data;
-
- try
- {
- data = text.getBytes("US-ASCII");
- }
- catch (UnsupportedEncodingException e)
- {
- data = new byte[length]; // shouldn't happen
- }
-
- for (int i = 0; i < length; i++)
- buf.put(12 + i, data[i]);
- buf.put(12 + length, (byte) 0); // null-terminate
-
- for (int i = 0; i < 39; i++)
- buf.putShort(13 + length + (i * 2), (short) 0); // 78 bytes we can ignore
-
- return buf.array();
- }
-
- /**
- * Creates a tag of TRC type (linear curve)
- */
- private byte[] makeTRC()
- {
- ByteBuffer buf = ByteBuffer.allocate(12);
- buf.putInt(0, 0x63757276); // 'curv' type
- buf.putInt(4, 0); // reserved
- buf.putInt(8, 0);
- return buf.array();
- }
-
- /**
- * Creates a tag of TRC type (single gamma value)
- */
- private byte[] makeTRC(float gamma)
- {
- short gammaValue = (short) (gamma * 256f);
- ByteBuffer buf = ByteBuffer.allocate(14);
- buf.putInt(0, 0x63757276); // 'curv' type
- buf.putInt(4, 0); // reserved
- buf.putInt(8, 1);
- buf.putShort(12, gammaValue); // 1.00 in u8fixed8
- return buf.array();
- }
-
- /**
- * Creates a tag of TRC type (TRC curve points)
- */
- private byte[] makeTRC(float[] trc)
- {
- ByteBuffer buf = ByteBuffer.allocate(12 + 2 * trc.length);
- buf.putInt(0, 0x63757276); // 'curv' type
- buf.putInt(4, 0); // reserved
- buf.putInt(8, trc.length); // number of points
-
- // put the curve values
- for (int i = 0; i < trc.length; i++)
- buf.putShort(12 + i * 2, (short) (trc[i] * 65535f));
-
- return buf.array();
- }
-
- /**
- * Creates an identity color lookup table.
- */
- private byte[] makeIdentityClut()
- {
- final int nIn = 3;
- final int nOut = 3;
- final int nInEntries = 256;
- final int nOutEntries = 256;
- final int gridpoints = 16;
-
- // gridpoints**nIn
- final int clutSize = 2 * nOut * gridpoints * gridpoints * gridpoints;
- final int totalSize = clutSize + 2 * nInEntries * nIn
- + 2 * nOutEntries * nOut + 52;
-
- ByteBuffer buf = ByteBuffer.allocate(totalSize);
- buf.putInt(0, 0x6D667432); // 'mft2'
- buf.putInt(4, 0); // reserved
- buf.put(8, (byte) nIn); // number input channels
- buf.put(9, (byte) nOut); // number output channels
- buf.put(10, (byte) gridpoints); // number gridpoints
- buf.put(11, (byte) 0); // padding
-
- // identity matrix
- buf.putInt(12, 65536); // = 1 in s15.16 fixed point
- buf.putInt(16, 0);
- buf.putInt(20, 0);
- buf.putInt(24, 0);
- buf.putInt(28, 65536);
- buf.putInt(32, 0);
- buf.putInt(36, 0);
- buf.putInt(40, 0);
- buf.putInt(44, 65536);
-
- buf.putShort(48, (short) nInEntries); // input table entries
- buf.putShort(50, (short) nOutEntries); // output table entries
-
- // write the linear input channels, unsigned 16.16 fixed point,
- // from 0.0 to FF.FF
- for (int channel = 0; channel < 3; channel++)
- for (int i = 0; i < nInEntries; i++)
- {
- short n = (short) ((i << 8) | i); // assumes 256 entries
- buf.putShort(52 + (channel * nInEntries + i) * 2, n);
- }
- int clutOffset = 52 + nInEntries * nIn * 2;
-
- for (int x = 0; x < gridpoints; x++)
- for (int y = 0; y < gridpoints; y++)
- for (int z = 0; z < gridpoints; z++)
- {
- int offset = clutOffset + z * 2 * nOut + y * gridpoints * 2 * nOut
- + x * gridpoints * gridpoints * 2 * nOut;
- double xf = ((double) x) / ((double) gridpoints - 1.0);
- double yf = ((double) y) / ((double) gridpoints - 1.0);
- double zf = ((double) z) / ((double) gridpoints - 1.0);
- buf.putShort(offset, (short) (xf * 65535.0));
- buf.putShort(offset + 2, (short) (yf * 65535.0));
- buf.putShort(offset + 4, (short) (zf * 65535.0));
- }
-
- for (int channel = 0; channel < 3; channel++)
- for (int i = 0; i < nOutEntries; i++)
- {
- short n = (short) ((i << 8) | i); // assumes 256 entries
- buf.putShort(clutOffset + clutSize + (channel * nOutEntries + i) * 2,
- n);
- }
-
- return buf.array();
- }
-
- /**
- * Creates profile data corresponding to the built-in colorspaces.
- */
- private void createProfile(int colorSpace) throws IllegalArgumentException
- {
- this.profileID = colorSpace;
- header = new ProfileHeader();
- tagTable = new Hashtable();
-
- switch (colorSpace)
- {
- case ColorSpace.CS_sRGB:
- createRGBProfile();
- return;
- case ColorSpace.CS_LINEAR_RGB:
- createLinearRGBProfile();
- return;
- case ColorSpace.CS_CIEXYZ:
- createCIEProfile();
- return;
- case ColorSpace.CS_GRAY:
- createGrayProfile();
- return;
- case ColorSpace.CS_PYCC:
- createPyccProfile();
- return;
- default:
- throw new IllegalArgumentException("Not a predefined color space!");
- }
- }
-
- /**
- * Creates an ICC_Profile representing the sRGB color space
- */
- private void createRGBProfile()
- {
- header.setColorSpace( ColorSpace.TYPE_RGB );
- header.setProfileColorSpace( ColorSpace.TYPE_XYZ );
- ICC_ColorSpace cs = new ICC_ColorSpace(this);
-
- float[] r = { 1f, 0f, 0f };
- float[] g = { 0f, 1f, 0f };
- float[] b = { 0f, 0f, 1f };
- float[] black = { 0f, 0f, 0f };
-
- // CIE 1931 D50 white point (in Lab coordinates)
- float[] white = D50;
-
- // Get tristimulus values (matrix elements)
- r = cs.toCIEXYZ(r);
- g = cs.toCIEXYZ(g);
- b = cs.toCIEXYZ(b);
-
- // Generate the sRGB TRC curve, this is the linear->nonlinear
- // RGB transform.
- cs = new ICC_ColorSpace(getInstance(ICC_ColorSpace.CS_LINEAR_RGB));
- float[] points = new float[TRC_POINTS];
- float[] in = new float[3];
- for (int i = 0; i < TRC_POINTS; i++)
- {
- in[0] = in[1] = in[2] = ((float) i) / ((float) TRC_POINTS - 1);
- in = cs.fromRGB(in);
- // Note this value is the same for all components.
- points[i] = in[0];
- }
-
- setData(icSigRedColorantTag, makeXYZData(r));
- setData(icSigGreenColorantTag, makeXYZData(g));
- setData(icSigBlueColorantTag, makeXYZData(b));
- setData(icSigMediaWhitePointTag, makeXYZData(white));
- setData(icSigMediaBlackPointTag, makeXYZData(black));
- setData(icSigRedTRCTag, makeTRC(points));
- setData(icSigGreenTRCTag, makeTRC(points));
- setData(icSigBlueTRCTag, makeTRC(points));
- setData(icSigCopyrightTag, makeTextTag(copyrightNotice));
- setData(icSigProfileDescriptionTag, makeDescTag("Generic sRGB"));
- this.profileID = ColorSpace.CS_sRGB;
- }
-
- /**
- * Creates an linear sRGB profile
- */
- private void createLinearRGBProfile()
- {
- header.setColorSpace(ColorSpace.TYPE_RGB);
- header.setProfileColorSpace(ColorSpace.TYPE_XYZ);
- ICC_ColorSpace cs = new ICC_ColorSpace(this);
-
- float[] r = { 1f, 0f, 0f };
- float[] g = { 0f, 1f, 0f };
- float[] b = { 0f, 0f, 1f };
- float[] black = { 0f, 0f, 0f };
-
- float[] white = D50;
-
- // Get tristimulus values (matrix elements)
- r = cs.toCIEXYZ(r);
- g = cs.toCIEXYZ(g);
- b = cs.toCIEXYZ(b);
-
- setData(icSigRedColorantTag, makeXYZData(r));
- setData(icSigGreenColorantTag, makeXYZData(g));
- setData(icSigBlueColorantTag, makeXYZData(b));
-
- setData(icSigMediaWhitePointTag, makeXYZData(white));
- setData(icSigMediaBlackPointTag, makeXYZData(black));
-
- setData(icSigRedTRCTag, makeTRC());
- setData(icSigGreenTRCTag, makeTRC());
- setData(icSigBlueTRCTag, makeTRC());
- setData(icSigCopyrightTag, makeTextTag(copyrightNotice));
- setData(icSigProfileDescriptionTag, makeDescTag("Linear RGB"));
- this.profileID = ColorSpace.CS_LINEAR_RGB;
- }
-
- /**
- * Creates an CIE XYZ identity profile
- */
- private void createCIEProfile()
- {
- header.setColorSpace( ColorSpace.TYPE_XYZ );
- header.setProfileColorSpace( ColorSpace.TYPE_XYZ );
- header.setProfileClass( CLASS_COLORSPACECONVERSION );
- ICC_ColorSpace cs = new ICC_ColorSpace(this);
-
- float[] white = D50;
-
- setData(icSigMediaWhitePointTag, makeXYZData(white));
- setData(icSigAToB0Tag, makeIdentityClut());
- setData(icSigBToA0Tag, makeIdentityClut());
- setData(icSigCopyrightTag, makeTextTag(copyrightNotice));
- setData(icSigProfileDescriptionTag, makeDescTag("CIE XYZ identity profile"));
- this.profileID = ColorSpace.CS_CIEXYZ;
- }
-
- /**
- * Creates a linear gray ICC_Profile
- */
- private void createGrayProfile()
- {
- header.setColorSpace(ColorSpace.TYPE_GRAY);
- header.setProfileColorSpace(ColorSpace.TYPE_XYZ);
-
- // CIE 1931 D50 white point (in Lab coordinates)
- float[] white = D50;
-
- setData(icSigMediaWhitePointTag, makeXYZData(white));
- setData(icSigGrayTRCTag, makeTRC(1.0f));
- setData(icSigCopyrightTag, makeTextTag(copyrightNotice));
- setData(icSigProfileDescriptionTag, makeDescTag("Linear grayscale"));
- this.profileID = ColorSpace.CS_GRAY;
- }
-
- /**
- * XXX Implement me
- */
- private void createPyccProfile()
- {
- header.setColorSpace(ColorSpace.TYPE_3CLR);
- header.setProfileColorSpace(ColorSpace.TYPE_XYZ);
-
- // Create CLUTs here. :-)
-
- setData(icSigCopyrightTag, makeTextTag(copyrightNotice));
- setData(icSigProfileDescriptionTag, makeDescTag("Photo YCC"));
- this.profileID = ColorSpace.CS_PYCC;
- }
-} // class ICC_Profile
diff --git a/libjava/java/awt/color/ICC_ProfileGray.java b/libjava/java/awt/color/ICC_ProfileGray.java
deleted file mode 100644
index 3b5948dc8fc..00000000000
--- a/libjava/java/awt/color/ICC_ProfileGray.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* ICC_ProfileGray.java -- the ICC profile for a Gray colorspace
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.color;
-
-/**
- * ICC_ProfileGray - a special case of ICC_Profiles.
- *
- * The ICC_Profile.getInstance() method will return an instance of the
- * ICC_ProfileGray subclass when all the following conditions are met:
- * The device color space of the profile is TYPE_GRAY.
- * The profile contains a gray TRCTag.
- * The profile contains a mediaWhitePointTag.
- *
- * As per the ICC specification, the color space conversion can then
- * be done through the following method:
- * linearGray = grayTRC[deviceGray]
- *
- * Note that if the profile contains a CLUT for the color space conversion,
- * it should be used instead, and the TRC information ignored.
- *
- * @author Sven de Marothy
- * @since 1.2
- */
-public class ICC_ProfileGray extends ICC_Profile
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -1124721290732002649L;
- private transient float[] whitePoint;
-
- /**
- * Package-private constructor used by ICC_ColorSpace for creating an
- * ICC_ProfileGray from a predefined ColorSpace (CS_GRAY)
- */
- ICC_ProfileGray(int cspace)
- {
- super(cspace);
- whitePoint = getXYZData(icSigMediaWhitePointTag);
- }
-
- /**
- * Package-private constructor used by ICC_ColorSpace for creating an
- * ICC_ProfileGray from profile data.
- */
- ICC_ProfileGray(byte[] data)
- {
- super(data);
- whitePoint = getXYZData(icSigMediaWhitePointTag);
- }
-
-
- /**
- * Returns the media white point of the profile.
- */
- public float[] getMediaWhitePoint()
- {
- float[] wp = new float[3];
- wp[0] = whitePoint[0];
- wp[1] = whitePoint[1];
- wp[2] = whitePoint[2];
- return wp;
- }
-
- /**
- * Returns the TRC gamma value.
- * @throws ProfileDataException if the TRC is described by a lookup
- * table and not a gamma value.
- */
- public float getGamma()
- {
- short[] data = getCurve(icSigGrayTRCTag);
- if (data == null)
- throw new IllegalArgumentException("Couldn't read Gray TRC data.");
- if (data.length != 1)
- throw new ProfileDataException("TRC is a table, not a gamma value.");
-
- // convert the unsigned 7.8 fixed-point gamma to a float.
- double gamma = (double) (data[0] & (0xFFFF)) / 256.0;
- return (float) gamma;
- }
-
- /**
- * Returns the TRC lookup table.
- * @throws ProfileDataException if the TRC is described by a gamma value
- * and not a lookup table.
- */
- public short[] getTRC()
- {
- short[] data = getCurve(icSigGrayTRCTag);
- if (data == null)
- throw new IllegalArgumentException("Couldn't read Gray TRC data.");
- if (data.length <= 1)
- throw new ProfileDataException("Gamma value, not a TRC table.");
- return data;
- }
-} // class ICC_ProfileGray
diff --git a/libjava/java/awt/color/ICC_ProfileRGB.java b/libjava/java/awt/color/ICC_ProfileRGB.java
deleted file mode 100644
index 00393328bbd..00000000000
--- a/libjava/java/awt/color/ICC_ProfileRGB.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/* ICC_ProfileRGB.java -- the ICC profile for a RGB colorspace
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.color;
-
-/**
- * ICC_ProfileRGB - a special case of ICC_Profiles.
- *
- * The ICC_Profile.getInstance() method will return an instance of the
- * ICC_ProfileRGB subclass when all the following conditions are met:
- * The device color space of the profile is TYPE_RGB.
- * The profile contains red, green and blue ColorantTags.
- * The profile contains red, green and blue TRCTags.
- * The profile contains a mediaWhitePointTag included.
- *
- * As per the ICC specification, the color space conversion can then
- * be done through the following method:
- * linearR = redTRC[deviceR]
- * linearG = greenTRC[deviceG]
- * linearB = blueTRC[deviceB]
- * TRC curves are either a single gamma value, or a 1-dimensional lookup table.
- *
- * Followed by the matrix transform:
- * PCS = M*linear
- *
- * Where PCS is the vector of profile color space (must be XYZ) coordinates,
- * linear is the vector of linear RGB coordinates, and the matrix M is
- * constructed from the ColorantTags, where the columns are red, green and
- * blue respectively, and the rows are X, Y and Z.
- *
- * Note that if the profile contains a CLUT for the color space conversion,
- * it should be used instead, and the TRC information ignored.
- *
- * @author Sven de Marothy
- * @since 1.2
- */
-public class ICC_ProfileRGB extends ICC_Profile
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 8505067385152579334L;
-
- public static final int REDCOMPONENT = 0;
-
- public static final int GREENCOMPONENT = 1;
-
- public static final int BLUECOMPONENT = 2;
-
- private transient float[][] matrix;
-
- private transient float[] gamma;
-
- private transient float[] whitePoint;
-
-
- /**
- * Package-private constructor used by ICC_ColorSpace for creating an
- * ICC_ProfileRGB from a predefined ColorSpace (CS_LINEAR_RGB and CS_sRGB)
- */
- ICC_ProfileRGB(int cspace)
- {
- super(cspace);
- matrix = createMatrix();
- whitePoint = getXYZData(icSigMediaWhitePointTag);
- }
-
- /**
- * Package-private constructor used by ICC_ColorSpace for creating an
- * ICC_ProfileRGB from profile data.
- */
- ICC_ProfileRGB(byte[] data)
- {
- super(data);
- matrix = createMatrix();
- whitePoint = getXYZData(icSigMediaWhitePointTag);
- }
-
- /**
- * Returns the media white point of the profile.
- */
- public float[] getMediaWhitePoint()
- {
- float[] wp = new float[3];
- wp[0] = whitePoint[0];
- wp[1] = whitePoint[1];
- wp[2] = whitePoint[2];
- return wp;
- }
-
- /**
- * Returns the colorant matrix of the conversion.
- */
- public float[][] getMatrix()
- {
- float[][] mat = new float[3][3];
- for (int i = 0; i < 3; i++)
- for (int j = 0; j < 3; j++)
- mat[i][j] = matrix[i][j];
- return mat;
- }
-
- /**
- * Returns the gamma value of a component
- * @throws ProfileDataException if the TRC is described by a lookup
- * table and not a gamma value.
- */
- public float getGamma(int component)
- {
- short[] data;
- switch (component)
- {
- case REDCOMPONENT:
- data = getCurve(icSigRedTRCTag);
- break;
- case GREENCOMPONENT:
- data = getCurve(icSigGreenTRCTag);
- break;
- case BLUECOMPONENT:
- data = getCurve(icSigBlueTRCTag);
- break;
- default:
- throw new IllegalArgumentException("Not a valid component");
- }
- if (data == null)
- throw new IllegalArgumentException("Error reading TRC");
-
- if (data.length != 1)
- throw new ProfileDataException("Not a single-gamma TRC");
-
- // convert the unsigned 7.8 fixed-point gamma to a float.
- float gamma = (float) (((int) data[0] & 0xFF00) >> 8);
- double fraction = ((int) data[0] & 0x00FF) / 256.0;
- gamma += (float) fraction;
- return gamma;
- }
-
- /**
- * Returns the TRC lookup table for a component
- * @throws ProfileDataException if the TRC is described by a gamma
- * value and not a lookup table.
- */
- public short[] getTRC(int component)
- {
- short[] data;
- switch (component)
- {
- case REDCOMPONENT:
- data = getCurve(icSigRedTRCTag);
- break;
- case GREENCOMPONENT:
- data = getCurve(icSigGreenTRCTag);
- break;
- case BLUECOMPONENT:
- data = getCurve(icSigBlueTRCTag);
- break;
- default:
- throw new IllegalArgumentException("Not a valid component");
- }
- if (data == null)
- throw new IllegalArgumentException("Error reading TRC");
-
- if (data.length <= 1)
- throw new ProfileDataException("Gamma value, not a TRC table.");
-
- return data;
- }
-
- /**
- * Creates the colorspace conversion matrix from the RGB tristimulus
- * values.
- */
- private float[][] createMatrix() throws IllegalArgumentException
- {
- float[][] mat = new float[3][3];
- float[] r;
- float[] g;
- float[] b;
- r = getXYZData(icSigRedColorantTag);
- g = getXYZData(icSigGreenColorantTag);
- b = getXYZData(icSigBlueColorantTag);
- if (r == null || g == null || b == null)
- throw new IllegalArgumentException("Error reading colorant tags!");
- for (int i = 0; i < 3; i++)
- {
- mat[i][0] = r[i];
- mat[i][1] = g[i];
- mat[i][2] = b[i];
- }
- return mat;
- }
-} // class ICC_ProfileRGB
diff --git a/libjava/java/awt/color/ProfileDataException.java b/libjava/java/awt/color/ProfileDataException.java
deleted file mode 100644
index 1af23b1835c..00000000000
--- a/libjava/java/awt/color/ProfileDataException.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ProfileDataException.java -- error in processing an ICC_Profile
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.color;
-
-/**
- * Thrown when there is an error accessing or processing an
- * <code>ICC_Profile</code>.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @status updated to 1.4
- */
-public class ProfileDataException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 7286140888240322498L;
-
- /**
- * Create a new instance with a specified detailed error message.
- *
- * @param message the message
- */
- public ProfileDataException(String message)
- {
- super(message);
- }
-} // class ProfileDataException
diff --git a/libjava/java/awt/datatransfer/Clipboard.java b/libjava/java/awt/datatransfer/Clipboard.java
deleted file mode 100644
index 9953a724dba..00000000000
--- a/libjava/java/awt/datatransfer/Clipboard.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Clipboard.java -- Class for transferring data via cut and paste.
- Copyright (C) 1999, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.datatransfer;
-
-/**
- * This class allows data to be transferred using a cut and paste type
- * mechanism.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Clipboard
-{
- /**
- * The data being transferred.
- */
- protected Transferable contents;
-
- /**
- * The owner of this clipboard.
- */
- protected ClipboardOwner owner;
-
- // The clipboard name
- private String name;
-
- /**
- * Initializes a new instance of <code>Clipboard</code> with the
- * specified name.
- *
- * @param name The clipboard name.
- */
- public Clipboard(String name)
- {
- this.name = name;
- }
-
- /**
- * Returns the name of the clipboard.
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Returns the contents of the clipboard.
- *
- * @param requestor The object requesting the contents.
- *
- * @exception IllegalStateException If the clipboard is currently unavailable
- */
- public synchronized Transferable getContents(Object requestor)
- {
- return contents;
- }
-
- /**
- * Sets the content and owner of this clipboard.
- * If the given owner is different from the current owner
- * then lostOwnership is called on the current owner.
- * XXX - is this called with the old or new contents.
- *
- * @param contents The new clipboard contents.
- * @param owner The new clipboard owner
- *
- * @exception IllegalStateException If the clipboard is currently unavailable
- */
- public synchronized void setContents(Transferable contents, ClipboardOwner owner)
- {
- if (this.owner != owner)
- if (this.owner != null)
- this.owner.lostOwnership(this, contents);
-
- this.owner = owner;
- this.contents = contents;
- }
-}
-
diff --git a/libjava/java/awt/datatransfer/ClipboardOwner.java b/libjava/java/awt/datatransfer/ClipboardOwner.java
deleted file mode 100644
index df758254a55..00000000000
--- a/libjava/java/awt/datatransfer/ClipboardOwner.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ClipboardOwner.java -- Interface for clipboard providers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.datatransfer;
-
-/**
- * This interface is for classes that will own a clipboard object.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface ClipboardOwner
-{
- /**
- * This method is called to notify this object that it no longer
- * has ownership of the specified <code>Clipboard</code>.
- *
- * @param clipboard The clipboard for which ownership was lost.
- * @param contents The contents of the clipboard which are no longer owned.
- */
- void lostOwnership (Clipboard clipboard, Transferable contents);
-}
-
diff --git a/libjava/java/awt/datatransfer/DataFlavor.java b/libjava/java/awt/datatransfer/DataFlavor.java
deleted file mode 100644
index e5fbd240293..00000000000
--- a/libjava/java/awt/datatransfer/DataFlavor.java
+++ /dev/null
@@ -1,1034 +0,0 @@
-/* DataFlavor.java -- A type of data to transfer via the clipboard.
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.datatransfer;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-
-/**
- * This class represents a particular data format used for transferring
- * data via the clipboard.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class DataFlavor implements java.io.Externalizable, Cloneable
-{
- static final long serialVersionUID = 8367026044764648243L;
-
- // FIXME: Serialization: Need to write methods for.
-
-/**
- * This is the data flavor used for tranferring plain text. The MIME
- * type is "text/plain; charset=unicode". The representation class
- * is <code>java.io.InputStream</code>.
- *
- * @deprecated The charset unicode is platform specific and InputStream
- * deals with bytes not chars. Use <code>getRederForText()</code>.
- */
-public static final DataFlavor plainTextFlavor;
-
-/**
- * This is the data flavor used for transferring Java strings. The
- * MIME type is "application/x-java-serialized-object" and the
- * representation class is <code>java.lang.String</code>.
- */
-public static final DataFlavor stringFlavor;
-
-/**
- * This is a data flavor used for transferring lists of files. The
- * representation type is a <code>java.util.List</code>, with each element of
- * the list being a <code>java.io.File</code>.
- */
-public static final DataFlavor javaFileListFlavor;
-
-/**
- * This is an image flavor used for transferring images. The
- * representation type is a <code>java.awt.Image</code>.
- */
-public static final DataFlavor imageFlavor;
-
-/**
- * This is the MIME type used for transferring a serialized object.
- * The representation class is the type of object be deserialized.
- */
-public static final String javaSerializedObjectMimeType =
- "application/x-java-serialized-object";
-
-/**
- * This is the MIME type used to transfer a Java object reference within
- * the same JVM. The representation class is the class of the object
- * being transferred.
- */
-public static final String javaJVMLocalObjectMimeType =
- "application/x-java-jvm-local-objectref";
-
-/**
- * This is the MIME type used to transfer a link to a remote object.
- * The representation class is the type of object being linked to.
- */
-public static final String javaRemoteObjectMimeType =
- "application/x-java-remote-object";
-
-static
-{
- plainTextFlavor
- = new DataFlavor(java.io.InputStream.class,
- "text/plain; charset=unicode",
- "plain unicode text");
-
- stringFlavor
- = new DataFlavor(java.lang.String.class,
- "Java Unicode String");
-
- javaFileListFlavor
- = new DataFlavor(java.util.List.class,
- "Java File List");
-
- // javaFileListFlavor.mimeType = "application/x-java-file-list";
-
- imageFlavor
- = new DataFlavor(java.awt.Image.class,
- "Java Image");
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-// The MIME type for this flavor
-private final String mimeType;
-
-// The representation class for this flavor
-private final Class representationClass;
-
-// The human readable name of this flavor
-private String humanPresentableName;
-
-/*************************************************************************/
-
-/*
- * Static Methods
- */
-
-/**
- * This method attempts to load the named class. The following class
- * loaders are searched in order: the bootstrap class loader, the
- * system class loader, the context class loader (if it exists), and
- * the specified fallback class loader.
- *
- * @param className The name of the class to load.
- * @param classLoader The class loader to use if all others fail, which
- * may be <code>null</code>.
- *
- * @exception ClassNotFoundException If the class cannot be loaded.
- */
-protected static final Class
-tryToLoadClass(String className, ClassLoader classLoader)
- throws ClassNotFoundException
-{
- try
- {
- return(Class.forName(className));
- }
- catch(Exception e) { ; }
- // Commented out for Java 1.1
- /*
- try
- {
- return(className.getClass().getClassLoader().findClass(className));
- }
- catch(Exception e) { ; }
-
- try
- {
- return(ClassLoader.getSystemClassLoader().findClass(className));
- }
- catch(Exception e) { ; }
- */
-
- // FIXME: What is the context class loader?
- /*
- try
- {
- }
- catch(Exception e) { ; }
- */
-
- if (classLoader != null)
- return(classLoader.loadClass(className));
- else
- throw new ClassNotFoundException(className);
-}
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Empty public constructor needed for externalization.
- * Should not be used for normal instantiation.
- */
-public
-DataFlavor()
-{
- mimeType = null;
- representationClass = null;
- humanPresentableName = null;
-}
-
-/*************************************************************************/
-
-/**
- * Private constructor.
- */
-private
-DataFlavor(Class representationClass,
- String mimeType,
- String humanPresentableName)
-{
- this.representationClass = representationClass;
- this.mimeType = mimeType;
- if (humanPresentableName != null)
- this.humanPresentableName = humanPresentableName;
- else
- this.humanPresentableName = mimeType;
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>DataFlavor</code>. The class
- * and human readable name are specified, the MIME type will be
- * "application/x-java-serialized-object". If the human readable name
- * is not specified (<code>null</code>) then the human readable name
- * will be the same as the MIME type.
- *
- * @param representationClass The representation class for this object.
- * @param humanPresentableName The display name of the object.
- */
-public
-DataFlavor(Class representationClass, String humanPresentableName)
-{
- this(representationClass,
- "application/x-java-serialized-object"
- + "; class="
- + representationClass.getName(),
- humanPresentableName);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>DataFlavor</code> with the
- * specified MIME type and description. If the MIME type has a
- * "class=&lt;rep class&gt;" parameter then the representation class will
- * be the class name specified. Otherwise the class defaults to
- * <code>java.io.InputStream</code>. If the human readable name
- * is not specified (<code>null</code>) then the human readable name
- * will be the same as the MIME type.
- *
- * @param mimeType The MIME type for this flavor.
- * @param humanPresentableName The display name of this flavor.
- * @param classLoader The class loader for finding classes if the default
- * class loaders do not work.
- *
- * @exception IllegalArgumentException If the representation class
- * specified cannot be loaded.
- * @exception ClassNotFoundException If the class is not loaded.
- */
-public
-DataFlavor(String mimeType, String humanPresentableName,
- ClassLoader classLoader) throws ClassNotFoundException
-{
- this(getRepresentationClassFromMime(mimeType, classLoader),
- mimeType, humanPresentableName);
-}
-
-private static Class
-getRepresentationClassFromMime(String mimeString, ClassLoader classLoader)
-{
- String classname = getParameter("class", mimeString);
- if (classname != null)
- {
- try
- {
- return tryToLoadClass(classname, classLoader);
- }
- catch(Exception e)
- {
- throw new IllegalArgumentException("classname: " + e.getMessage());
- }
- }
- else
- {
- return java.io.InputStream.class;
- }
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>DataFlavor</code> with the
- * specified MIME type and description. If the MIME type has a
- * "class=&lt;rep class&gt;" parameter then the representation class will
- * be the class name specified. Otherwise the class defaults to
- * <code>java.io.InputStream</code>. If the human readable name
- * is not specified (<code>null</code>) then the human readable name
- * will be the same as the MIME type. This is the same as calling
- * <code>new DataFlavor(mimeType, humanPresentableName, null)</code>.
- *
- * @param mimeType The MIME type for this flavor.
- * @param humanPresentableName The display name of this flavor.
- *
- * @exception IllegalArgumentException If the representation class
- * specified cannot be loaded.
- */
-public
-DataFlavor(String mimeType, String humanPresentableName)
-{
- this (getRepresentationClassFromMime (mimeType, null), humanPresentableName);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>DataFlavor</code> with the specified
- * MIME type. This type can have a "class=" parameter to specify the
- * representation class, and then the class must exist or an exception will
- * be thrown. If there is no "class=" parameter then the representation class
- * will be <code>java.io.InputStream</code>. This is the same as calling
- * <code>new DataFlavor(mimeType, null)</code>.
- *
- * @param mimeType The MIME type for this flavor.
- *
- * @exception IllegalArgumentException If a class is not specified in
- * the MIME type.
- * @exception ClassNotFoundException If the class cannot be loaded.
- */
-public
-DataFlavor(String mimeType) throws ClassNotFoundException
-{
- this(mimeType, null);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the MIME type of this flavor.
- *
- * @return The MIME type for this flavor.
- */
-public String
-getMimeType()
-{
- return(mimeType);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the representation class for this flavor.
- *
- * @return The representation class for this flavor.
- */
-public Class
-getRepresentationClass()
-{
- return(representationClass);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the human presentable name for this flavor.
- *
- * @return The human presentable name for this flavor.
- */
-public String
-getHumanPresentableName()
-{
- return(humanPresentableName);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the primary MIME type for this flavor.
- *
- * @return The primary MIME type for this flavor.
- */
-public String
-getPrimaryType()
-{
- int idx = mimeType.indexOf("/");
- if (idx == -1)
- return(mimeType);
-
- return(mimeType.substring(0, idx));
-}
-
-/*************************************************************************/
-
-/**
- * Returns the MIME subtype for this flavor.
- *
- * @return The MIME subtype for this flavor.
- */
-public String
-getSubType()
-{
- int idx = mimeType.indexOf("/");
- if (idx == -1)
- return("");
-
- String subtype = mimeType.substring(idx + 1);
-
- idx = subtype.indexOf(" ");
- if (idx == -1)
- return(subtype);
- else
- return(subtype.substring(0, idx));
-}
-
-/*************************************************************************/
-
-/**
- * Returns the value of the named MIME type parameter, or <code>null</code>
- * if the parameter does not exist. Given the parameter name and the mime
- * string.
- *
- * @param paramName The name of the parameter.
- * @param mimeString The mime string from where the name should be found.
- *
- * @return The value of the parameter or null.
- */
-private static String
-getParameter(String paramName, String mimeString)
-{
- int idx = mimeString.indexOf(paramName + "=");
- if (idx == -1)
- return(null);
-
- String value = mimeString.substring(idx + paramName.length() + 1);
-
- idx = value.indexOf(" ");
- if (idx == -1)
- return(value);
- else
- return(value.substring(0, idx));
-}
-
-/*************************************************************************/
-
-/**
- * Returns the value of the named MIME type parameter, or <code>null</code>
- * if the parameter does not exist.
- *
- * @param paramName The name of the paramter.
- *
- * @return The value of the parameter.
- */
-public String
-getParameter(String paramName)
-{
- return getParameter(paramName, mimeType);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the human presentable name to the specified value.
- *
- * @param humanPresentableName The new display name.
- */
-public void
-setHumanPresentableName(String humanPresentableName)
-{
- this.humanPresentableName = humanPresentableName;
-}
-
-/*************************************************************************/
-
-/**
- * Tests the MIME type of this object for equality against the specified
- * MIME type.
- *
- * @param mimeType The MIME type to test against.
- *
- * @return <code>true</code> if the MIME type is equal to this object's
- * MIME type, <code>false</code> otherwise.
- *
- * @exception NullPointerException If mimeType is null.
- */
-public boolean
-isMimeTypeEqual(String mimeType)
-{
- // FIXME: Need to handle default attributes and parameters
-
- return(this.mimeType.equals(mimeType));
-}
-
-/*************************************************************************/
-
-/**
- * Tests the MIME type of this object for equality against the specified
- * data flavor's MIME type
- *
- * @param flavor The flavor to test against.
- *
- * @return <code>true</code> if the flavor's MIME type is equal to this
- * object's MIME type, <code>false</code> otherwise.
- */
-public final boolean
-isMimeTypeEqual(DataFlavor flavor)
-{
- return(isMimeTypeEqual(flavor.getMimeType()));
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this flavor represents a serialized object.
- *
- * @return <code>true</code> if this flavor represents a serialized
- * object, <code>false</code> otherwise.
- */
-public boolean
-isMimeTypeSerializedObject()
-{
- return(mimeType.startsWith(javaSerializedObjectMimeType));
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this flavor has a representation class of
- * <code>java.io.InputStream</code>.
- *
- * @return <code>true</code> if the representation class of this flavor
- * is <code>java.io.InputStream</code>, <code>false</code> otherwise.
- */
-public boolean
-isRepresentationClassInputStream()
-{
- return(representationClass.getName().equals("java.io.InputStream"));
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether the representation class for this flavor is
- * serializable.
- *
- * @return <code>true</code> if the representation class is serializable,
- * <code>false</code> otherwise.
- */
-public boolean
-isRepresentationClassSerializable()
-{
- Class[] interfaces = representationClass.getInterfaces();
-
- int i = 0;
- while (i < interfaces.length)
- {
- if (interfaces[i].getName().equals("java.io.Serializable"))
- return(true);
- ++i;
- }
-
- return(false);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether the representation class for his flavor is remote.
- *
- * @return <code>true</code> if the representation class is remote,
- * <code>false</code> otherwise.
- */
-public boolean
-isRepresentationClassRemote()
-{
- // FIXME: Implement
- throw new RuntimeException("Not implemented");
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this flavor represents a serialized object.
- *
- * @return <code>true</code> if this flavor represents a serialized
- * object, <code>false</code> otherwise.
- */
-public boolean
-isFlavorSerializedObjectType()
-{
- // FIXME: What is the diff between this and isMimeTypeSerializedObject?
- return(mimeType.startsWith(javaSerializedObjectMimeType));
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this flavor represents a remote object.
- *
- * @return <code>true</code> if this flavor represents a remote object,
- * <code>false</code> otherwise.
- */
-public boolean
-isFlavorRemoteObjectType()
-{
- return(mimeType.startsWith(javaRemoteObjectMimeType));
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not this flavor represents a list of files.
- *
- * @return <code>true</code> if this flavor represents a list of files,
- * <code>false</code> otherwise.
- */
-public boolean
-isFlavorJavaFileListType()
-{
- if (this.mimeType.equals(javaFileListFlavor.mimeType) &&
- this.representationClass.equals(javaFileListFlavor.representationClass))
- return(true);
-
- return(false);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a copy of this object.
- *
- * @return A copy of this object.
- *
- * @exception CloneNotSupportedException If the object's class does not support
- * the Cloneable interface. Subclasses that override the clone method can also
- * throw this exception to indicate that an instance cannot be cloned.
- */
-public Object clone () throws CloneNotSupportedException
-{
- try
- {
- return(super.clone());
- }
- catch(Exception e)
- {
- return(null);
- }
-}
-
-/*************************************************************************/
-
-/**
- * This method test the specified <code>DataFlavor</code> for equality
- * against this object. This will be true if the MIME type and
- * representation type are the equal.
- *
- * @param flavor The <code>DataFlavor</code> to test against.
- *
- * @return <code>true</code> if the flavor is equal to this object,
- * <code>false</code> otherwise.
- */
-public boolean
-equals(DataFlavor flavor)
-{
- if (flavor == null)
- return(false);
-
- if (!this.mimeType.toLowerCase().equals(flavor.mimeType.toLowerCase()))
- return(false);
-
- if (!this.representationClass.equals(flavor.representationClass))
- return(false);
-
- return(true);
-}
-
-/*************************************************************************/
-
-/**
- * This method test the specified <code>Object</code> for equality
- * against this object. This will be true if the following conditions
- * are met:
- * <p>
- * <ul>
- * <li>The object is not <code>null</code>.</li>
- * <li>The object is an instance of <code>DataFlavor</code>.</li>
- * <li>The object's MIME type and representation class are equal to
- * this object's.</li>
- * </ul>
- *
- * @param obj The <code>Object</code> to test against.
- *
- * @return <code>true</code> if the flavor is equal to this object,
- * <code>false</code> otherwise.
- */
-public boolean
-equals(Object obj)
-{
- if (!(obj instanceof DataFlavor))
- return(false);
-
- return(equals((DataFlavor)obj));
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not the specified string is equal to the MIME type
- * of this object.
- *
- * @param str The string to test against.
- *
- * @return <code>true</code> if the string is equal to this object's MIME
- * type, <code>false</code> otherwise.
- *
- * @deprecated Not compatible with <code>hashCode()</code>.
- * Use <code>isMimeTypeEqual()</code>
- */
-public boolean
-equals(String str)
-{
- return(isMimeTypeEqual(str));
-}
-
-/*************************************************************************/
-
-/**
- * Returns the hash code for this data flavor.
- * The hash code is based on the (lower case) mime type and the
- * representation class.
- */
-public int
-hashCode()
-{
- return(mimeType.toLowerCase().hashCode()^representationClass.hashCode());
-}
-
-/*************************************************************************/
-
-/**
- * Returns <code>true</code> when the given <code>DataFlavor</code>
- * matches this one.
- */
-public boolean
-match(DataFlavor dataFlavor)
-{
- // XXX - How is this different from equals?
- return(equals(dataFlavor));
-}
-
-/*************************************************************************/
-
-/**
- * This method exists for backward compatibility. It simply returns
- * the same name/value pair passed in.
- *
- * @param name The parameter name.
- * @param value The parameter value.
- *
- * @return The name/value pair.
- *
- * @deprecated
- */
-protected String
-normalizeMimeTypeParameter(String name, String value)
-{
- return(name + "=" + value);
-}
-
-/*************************************************************************/
-
-/**
- * This method exists for backward compatibility. It simply returns
- * the MIME type string unchanged.
- *
- * @param type The MIME type.
- *
- * @return The MIME type.
- *
- * @deprecated
- */
-protected String
-normalizeMimeType(String type)
-{
- return(type);
-}
-
-/*************************************************************************/
-
-/**
- * Serialize this class.
- *
- * @param stream The <code>ObjectOutput</code> stream to serialize to.
- *
- * @exception IOException If an error occurs.
- */
-public void
-writeExternal(ObjectOutput stream) throws IOException
-{
- // FIXME: Implement me
-}
-
-/*************************************************************************/
-
-/**
- * De-serialize this class.
- *
- * @param stream The <code>ObjectInput</code> stream to deserialize from.
- *
- * @exception IOException If an error ocurs.
- * @exception ClassNotFoundException If the class for an object being restored
- * cannot be found.
- */
-public void
-readExternal(ObjectInput stream) throws IOException, ClassNotFoundException
-{
- // FIXME: Implement me
-}
-
-/*************************************************************************/
-
-/**
- * Returns a string representation of this DataFlavor. Including the
- * representation class name, MIME type and human presentable name.
- */
-public String
-toString()
-{
- return("DataFlavor[representationClass="
- + representationClass.getName()
- + ",mimeType="
- + mimeType
- + "humanPresentableName="
- + humanPresentableName);
-}
-
-/*************************************************************************/
-
-/**
- * XXX - Currently returns <code>plainTextFlavor</code>.
- */
-public static final DataFlavor
-getTextPlainUnicodeFlavor()
-{
- return(plainTextFlavor);
-}
-
-/*************************************************************************/
-
-/**
- * XXX - Currently returns <code>java.io.InputStream</code>.
- *
- * @since 1.3
- */
-public final Class
-getDefaultRepresentationClass()
-{
- return(java.io.InputStream.class);
-}
-/*************************************************************************/
-
-/**
- * XXX - Currently returns <code>java.io.InputStream</code>.
- */
-public final String
-getDefaultRepresentationClassAsString()
-{
- return(getDefaultRepresentationClass().getName());
-}
-
-/*************************************************************************/
-
-/**
- * Selects the best supported text flavor on this implementation.
- * Returns <code>null</code> when none of the given flavors is liked.
- *
- * The <code>DataFlavor</code> returned the first data flavor in the
- * array that has either a representation class which is (a subclass of)
- * <code>Reader</code> or <code>String</code>, or has a representation
- * class which is (a subclass of) <code>InputStream</code> and has a
- * primary MIME type of "text" and has an supported encoding.
- */
-public static final DataFlavor
-selectBestTextFlavor(DataFlavor[] availableFlavors)
-{
- for(int i=0; i<availableFlavors.length; i++)
- {
- DataFlavor df = availableFlavors[i];
- Class c = df.representationClass;
-
- // A Reader or String is good.
- if ((Reader.class.isAssignableFrom(c))
- || (String.class.isAssignableFrom(c)))
- {
- return df;
- }
-
- // A InputStream is good if the mime primary type is "text"
- if ((InputStream.class.isAssignableFrom(c))
- && ("text".equals(df.getPrimaryType())))
- {
- String encoding = availableFlavors[i].getParameter("charset");
- if (encoding == null)
- encoding = "us-ascii";
- Reader r = null;
- try
- {
- // Try to construct a dummy reader with the found encoding
- r = new InputStreamReader
- (new ByteArrayInputStream(new byte[0]), encoding);
- }
- catch(UnsupportedEncodingException uee) { /* ignore */ }
- if (r != null)
- return df;
- }
- }
-
- // Nothing found
- return(null);
-}
-
-/*************************************************************************/
-
-/**
- * Creates a <code>Reader</code> for a given <code>Transferable</code>.
- *
- * If the representation class is a (subclass of) <code>Reader</code>
- * then an instance of the representation class is returned. If the
- * representatation class is a <code>String</code> then a
- * <code>StringReader</code> is returned. And if the representation class
- * is a (subclass of) <code>InputStream</code> and the primary MIME type
- * is "text" then a <code>InputStreamReader</code> for the correct charset
- * encoding is returned.
- *
- * @param transferable The <code>Transferable</code> for which a text
- * <code>Reader</code> is requested.
- *
- * @exception IllegalArgumentException If the representation class is not one
- * of the seven listed above or the Transferable has null data.
- * @exception NullPointerException If the Transferable is null.
- * @exception UnsupportedFlavorException when the transferable doesn't
- * support this <code>DataFlavor</code>. Or if the representable class
- * isn't a (subclass of) <code>Reader</code>, <code>String</code>,
- * <code>InputStream</code> and/or the primary MIME type isn't "text".
- * @exception IOException when any IOException occurs.
- * @exception UnsupportedEncodingException if the "charset" isn't supported
- * on this platform.
- */
-public Reader getReaderForText(Transferable transferable)
- throws UnsupportedFlavorException, IOException
-{
- if (!transferable.isDataFlavorSupported(this))
- throw new UnsupportedFlavorException(this);
-
- if (Reader.class.isAssignableFrom(representationClass))
- return((Reader)transferable.getTransferData(this));
-
- if (String.class.isAssignableFrom(representationClass))
- return(new StringReader((String)transferable.getTransferData(this)));
-
- if (InputStream.class.isAssignableFrom(representationClass)
- && "text".equals(getPrimaryType()))
- {
- InputStream in = (InputStream)transferable.getTransferData(this);
- String encoding = getParameter("charset");
- if (encoding == null)
- encoding = "us-ascii";
- return(new InputStreamReader(in, encoding));
- }
-
- throw new UnsupportedFlavorException(this);
-}
-
- /**
- * Returns whether the representation class for this DataFlavor is
- * @see java.nio.ByteBuffer or a subclass thereof.
- *
- * @since 1.4
- */
- public boolean isRepresentationClassByteBuffer ()
- {
- return ByteBuffer.class.isAssignableFrom (representationClass);
- }
-
- /**
- * Returns whether the representation class for this DataFlavor is
- * @see java.nio.CharBuffer or a subclass thereof.
- *
- * @since 1.4
- */
- public boolean isRepresentationClassCharBuffer ()
- {
- return CharBuffer.class.isAssignableFrom (representationClass);
- }
-
- /**
- * Returns whether the representation class for this DataFlavor is
- * @see java.io.Reader or a subclass thereof.
- *
- * @since 1.4
- */
- public boolean isRepresentationClassReader ()
- {
- return Reader.class.isAssignableFrom (representationClass);
- }
-
-} // class DataFlavor
-
diff --git a/libjava/java/awt/datatransfer/FlavorMap.java b/libjava/java/awt/datatransfer/FlavorMap.java
deleted file mode 100644
index 59718c4513c..00000000000
--- a/libjava/java/awt/datatransfer/FlavorMap.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* FlavorMap.java -- Maps between flavor names and MIME types.
- Copyright (C) 1999, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.datatransfer;
-
-import java.util.Map;
-
-/**
- * This interface maps between native platform type names and DataFlavors.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface FlavorMap
-{
- /**
- * Maps the specified <code>DataFlavor</code> objects to the native
- * data type name. The returned <code>Map</code> has keys that are
- * the data flavors and values that are strings. The returned map
- * may be modified. This can be useful for implementing nested mappings.
- *
- * @param flavors An array of data flavors to map
- * or null for all data flavors.
- *
- * @return A <code>Map</code> of native data types.
- */
- Map getNativesForFlavors (DataFlavor[] flavors);
-
- /**
- * Maps the specified native type names to <code>DataFlavor</code>'s.
- * The returned <code>Map</code> has keys that are strings and values
- * that are <code>DataFlavor</code>'s. The returned map may be
- * modified. This can be useful for implementing nested mappings.
- *
- * @param natives An array of native types to map
- * or null for all native types.
- *
- * @return A <code>Map</code> of data flavors.
- */
- Map getFlavorsForNatives (String[] natives);
-}
diff --git a/libjava/java/awt/datatransfer/FlavorTable.java b/libjava/java/awt/datatransfer/FlavorTable.java
deleted file mode 100644
index 11cdda06ca7..00000000000
--- a/libjava/java/awt/datatransfer/FlavorTable.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* FlavorTable.java -- A relaxed mapping between flavors
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.datatransfer;
-
-import java.util.List;
-
-/**
- * A FlavorMap which no longer requires a 1-to-1 mapping between flavors. Any
- * native can map to multiple flavors, and any flavor can map to multiple
- * natives; although the mappings are usually symmetric.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status updated to 1.4
- */
-public interface FlavorTable extends FlavorMap
-{
- /**
- * Returns a list of String natives corresponding to the given flavor. The
- * list should be sorted from best to worst. The list must be modifiable
- * without affecting this table.
- *
- * @param flavor the flavor to look up, or null to return all natives
- * @return the sorted list of natives
- */
- List getNativesForFlavor(DataFlavor flavor);
-
- /**
- * Returns a list of flavors corresponding to the given String native. The
- * list should be sorted from best to worst. The list must be modifiable
- * without affecting this table.
- *
- * @param name the native name to look up, or null to return all flavors
- * @return the sorted list of flavors
- */
- List getFlavorsForNative(String name);
-}
diff --git a/libjava/java/awt/datatransfer/MimeTypeParseException.java b/libjava/java/awt/datatransfer/MimeTypeParseException.java
deleted file mode 100644
index 6113ab760b8..00000000000
--- a/libjava/java/awt/datatransfer/MimeTypeParseException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* MimeTypeParseException.java -- thrown when MIME string couldn't be parsed
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.datatransfer;
-
-/**
- * MIME string couldn't be parsed correctly.
- *
- * @author Mark Wielaard (mark@klomp.org)
- * @status updated to 1.4
- */
-public class MimeTypeParseException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -5604407764691570741L;
-
- /**
- * Create a new instance without any message.
- */
- public MimeTypeParseException()
- {
- }
-
- /**
- * Create a new instance with a specified detailed error message.
- *
- * @param message the message
- */
- public MimeTypeParseException(String message)
- {
- super(message);
- }
-} // class MimeTypeParseException
diff --git a/libjava/java/awt/datatransfer/StringSelection.java b/libjava/java/awt/datatransfer/StringSelection.java
deleted file mode 100644
index b74f2fa6418..00000000000
--- a/libjava/java/awt/datatransfer/StringSelection.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* StringSelection.java -- Clipboard handler for text.
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.datatransfer;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-/**
- * This class transfers a string as plain text using the clipboard.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class StringSelection implements Transferable, ClipboardOwner
-{
-
-/*
- * Class Variables
- */
-
-// List of flavors we support
-// XXX: DataFlavor.plainTextFlavor is deprecated.
-static final DataFlavor[] supported_flavors
- = { DataFlavor.stringFlavor,
- DataFlavor.plainTextFlavor };
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-// This is the data to transfer
-private String data;
-
- /**
- * Transfer the specfied string as text.
- *
- * @param data the data for the string selection
- */
- public StringSelection(String data)
- {
- this.data = data;
- }
-
-/**
- * Returns a list of supported data flavors.
- *
- * @return A list of supported data flavors.
- */
-public DataFlavor[]
-getTransferDataFlavors()
-{
- return(supported_flavors);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not the specified data flavor is supported.
- *
- * @param flavor The data flavor to test.
- *
- * @return <code>true</code> if the data flavor is supported,
- * <code>false</code> otherwise.
- */
-public boolean
-isDataFlavorSupported(DataFlavor flavor)
-{
- for (int i = 0; i < supported_flavors.length; i++)
- if (supported_flavors[i].equals(flavor))
- return(true);
-
- return(false);
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the data in the requested format.
- *
- * @param flavor The desired data flavor.
- *
- * @return The transferred data.
- *
- * @exception UnsupportedFlavorException If the specified flavor is not
- * supported.
- * @exception IOException If any other error occurs.
- */
-public Object
-getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,
- IOException
-{
- if (!isDataFlavorSupported(flavor))
- throw new UnsupportedFlavorException(flavor);
-
- if (DataFlavor.plainTextFlavor == flavor)
- /* The behavior of this method for DataFlavor.plainTextFlavor and
- equivalent DataFlavors is inconsistent with the definition of
- DataFlavor.plainTextFlavor. We choose to do like Sun's implementation
- and return a Reader instead of an InputString. */
- /* return(new StringBufferInputStream(data)); */
- return(new StringReader(data));
- else // DataFlavor.stringFlavor
- return data;
-}
-
-/*************************************************************************/
-
-/**
- * Called when ownership of the clipboard object is lost.
- *
- * @param clipboard The affected clipboard.
- * @param contents The clipboard contents.
- */
-public void
-lostOwnership(Clipboard clipboard, Transferable contents)
-{
- // FIXME: What does this do?
-}
-
-} // class StringSelection
-
diff --git a/libjava/java/awt/datatransfer/SystemFlavorMap.java b/libjava/java/awt/datatransfer/SystemFlavorMap.java
deleted file mode 100644
index f6530f5117c..00000000000
--- a/libjava/java/awt/datatransfer/SystemFlavorMap.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/* SystemFlavorMap.java -- Maps between native flavor names and MIME types.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.datatransfer;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This class maps between native platform type names and DataFlavors.
- *
- * XXX - The current implementation does no mapping at all.
- *
- * @author Mark Wielaard (mark@klomp.org)
- *
- * @since 1.2
- */
-public final class SystemFlavorMap implements FlavorMap, FlavorTable
-{
- /**
- * The default (instance) flavor map.
- */
- private static FlavorMap defaultFlavorMap;
-
- /**
- * Private constructor.
- */
- private SystemFlavorMap ()
- {
- }
-
- /**
- * Maps the specified <code>DataFlavor</code> objects to the native
- * data type name. The returned <code>Map</code> has keys that are
- * the data flavors and values that are strings. The returned map
- * may be modified. This can be useful for implementing nested mappings.
- *
- * @param flavors An array of data flavors to map
- * or null for all data flavors.
- *
- * @return A <code>Map</code> of native data types to data flavors.
- */
- public Map getNativesForFlavors (DataFlavor[] flavors)
- {
- return new HashMap();
- }
-
- /**
- * Maps the specified native type names to <code>DataFlavor</code>'s.
- * The returned <code>Map</code> has keys that are strings and values
- * that are <code>DataFlavor</code>'s. The returned map may be
- * modified. This can be useful for implementing nested mappings.
- *
- * @param natives An array of native types to map
- * or null for all native types.
- *
- * @return A <code>Map</code> of data flavors to native type names.
- */
- public Map getFlavorsForNatives (String[] natives)
- {
- return new HashMap();
- }
-
- /**
- * Returns the default (instance) (System)FlavorMap.
- */
- public static FlavorMap getDefaultFlavorMap ()
- {
- if (defaultFlavorMap == null)
- defaultFlavorMap = new SystemFlavorMap ();
-
- return defaultFlavorMap;
- }
-
- /**
- * Returns the native type name for the given java mime type.
- */
- public static String encodeJavaMIMEType (String mime)
- {
- return null;
- }
-
- /**
- * Returns the native type name for the given data flavor.
- */
- public static String encodeDataFlavor (DataFlavor df)
- {
- return null;
- }
-
- /**
- * Returns true if the native type name can be represented as
- * a java mime type.
- */
- public static boolean isJavaMIMEType (String name)
- {
- return false;
- }
-
- /**
- * Returns the java mime type for the given the native type name.
- */
- public static String decodeJavaMIMEType (String name)
- {
- return null;
- }
-
- /**
- * Returns the data flavor given the native type name
- * or null when no such data flavor exists.
- */
- public static DataFlavor decodeDataFlavor (String name)
- throws ClassNotFoundException
- {
- String javaMIMEType = decodeJavaMIMEType (name);
-
- if (javaMIMEType != null)
- return new DataFlavor (javaMIMEType);
- else
- return null;
- }
-
- public List getFlavorsForNative (String nat)
- {
- throw new Error ("Not implemented");
- }
-
- public List getNativesForFlavor (DataFlavor flav)
- {
- throw new Error ("Not implemented");
- }
-
-} // class SystemFlavorMap
diff --git a/libjava/java/awt/datatransfer/Transferable.java b/libjava/java/awt/datatransfer/Transferable.java
deleted file mode 100644
index 80753923618..00000000000
--- a/libjava/java/awt/datatransfer/Transferable.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Transferable.java -- Data transfer source
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.datatransfer;
-
-import java.io.IOException;
-
-/**
- * This interface is implemented by classes that can transfer data.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public interface Transferable
-{
- /**
- * This method returns a list of available data flavors for the data being
- * transferred. The array returned will be sorted from most preferred
- * flavor at the beginning to least preferred at the end.
- *
- * @return adA list of data flavors for this data
- */
- DataFlavor[] getTransferDataFlavors();
-
- /**
- * Tests whether or not this data can be delivered in the specified data
- * flavor.
- *
- * @param flavor the data flavor to test
- * @return true if the data flavor is supported
- */
- boolean isDataFlavorSupported(DataFlavor flavor);
-
- /**
- * Returns the data in the specified <code>DataFlavor</code>.
- *
- * @param flavor the data flavor to return
- * @return the data in the appropriate flavor
- * @throws UnsupportedFlavorException if the flavor is not supported
- * @throws IOException if the data is not available
- * @see DataFlavor#getRepresentationClass
- */
- Object getTransferData(DataFlavor flavor)
- throws UnsupportedFlavorException, IOException;
-
-} // interface Transferable
-
diff --git a/libjava/java/awt/datatransfer/UnsupportedFlavorException.java b/libjava/java/awt/datatransfer/UnsupportedFlavorException.java
deleted file mode 100644
index 1c1da0348c3..00000000000
--- a/libjava/java/awt/datatransfer/UnsupportedFlavorException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* UnsupportedFlavorException.java -- ata flavor is not valid
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.datatransfer;
-
-/**
- * The data flavor requested is not supported for the transfer data.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Transferable#getTransferData(DataFlavor)
- * @status updated to 1.4
- */
-public class UnsupportedFlavorException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 5383814944251665601L;
-
- /**
- * Initializes a new instance of <code>UnsupportedDataFlavor</code>
- * for the specified data flavor.
- *
- * @param flavor the data flavor that is not supported
- */
- public UnsupportedFlavorException(DataFlavor flavor)
- {
- super(flavor == null ? null : flavor.getHumanPresentableName());
- }
-} // class UnsupportedFlavorException
diff --git a/libjava/java/awt/dnd/Autoscroll.java b/libjava/java/awt/dnd/Autoscroll.java
deleted file mode 100644
index ba4d4476cfc..00000000000
--- a/libjava/java/awt/dnd/Autoscroll.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Autoscroll.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Insets;
-import java.awt.Point;
-
-/**
- * During DnD operations it is possible that a user may wish to drop the
- * subject of the operation on a region of a scrollable GUI control that
- * is not currently visible to the user.
- *
- * @author Michael Koch (konqueror@gmx.de)
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Autoscroll
-{
- /**
- * This method returns the Insets describing the autoscrolling region or
- * border relative to the geometry of the implementing Component
- */
- Insets getAutoscrollInsets ();
-
- /**
- * Notify the Component to autoscroll
- *
- * @param location A Point indicating the location of the cursor that
- * triggered this operation
- */
- void autoscroll (Point location);
-
-} // interface Autoscroll
-
diff --git a/libjava/java/awt/dnd/DnDConstants.java b/libjava/java/awt/dnd/DnDConstants.java
deleted file mode 100644
index 85c9c0528e6..00000000000
--- a/libjava/java/awt/dnd/DnDConstants.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* DnDConstants.java -- constants for drag-and-drop operations
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-/**
- * This class contains various constants used in drag-and-drop operations.
- * Why it is not an interface is beyond me.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public final class DnDConstants
-{
- /** No action takes place. */
- public static final int ACTION_NONE = 0;
-
- /** The copy action. */
- public static final int ACTION_COPY = 1;
-
- /** The move action. */
- public static final int ACTION_MOVE = 2;
-
- /** Either a copy or a move. */
- public static final int ACTION_COPY_OR_MOVE = 3;
-
- /**
- * A link action. This does not copy or move, but creates a reference back
- * to the original. However, since platforms differ on how a reference should
- * behave, this action is not recommended for common use.
- */
- public static final int ACTION_LINK = 1073741824;
-
- /** A synonym for {@link #ACTION_LINK}. */
- public static final int ACTION_REFERENCE = ACTION_LINK;
-
- private DnDConstants()
- {
- // Do nothing here.
- }
-}
diff --git a/libjava/java/awt/dnd/DnDEventMulticaster.java b/libjava/java/awt/dnd/DnDEventMulticaster.java
deleted file mode 100644
index d9f5ec00f1d..00000000000
--- a/libjava/java/awt/dnd/DnDEventMulticaster.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* DnDEventMulticaster.java -- helper class for listener chains in java.awt.dnd
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.AWTEventMulticaster;
-import java.util.EventListener;
-
-class DnDEventMulticaster extends AWTEventMulticaster
-{
- protected DnDEventMulticaster (EventListener a, EventListener b)
- {
- super (a, b);
- }
-
- public static DragSourceListener add (DragSourceListener a,
- DragSourceListener b)
- {
- return (DragSourceListener) addInternal (a, b);
- }
-
- public static DragSourceMotionListener add (DragSourceMotionListener a,
- DragSourceMotionListener b)
- {
- return (DragSourceMotionListener) addInternal (a, b);
- }
-
- public static DragSourceListener remove (DragSourceListener a,
- DragSourceListener b)
- {
- return (DragSourceListener) removeInternal (a, b);
- }
-
- public static DragSourceMotionListener remove (DragSourceMotionListener a,
- DragSourceMotionListener b)
- {
- return (DragSourceMotionListener) removeInternal (a, b);
- }
-}
diff --git a/libjava/java/awt/dnd/DragGestureEvent.java b/libjava/java/awt/dnd/DragGestureEvent.java
deleted file mode 100644
index 9f2bc7c98b8..00000000000
--- a/libjava/java/awt/dnd/DragGestureEvent.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* DragGestureEvent.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.Image;
-import java.awt.Point;
-import java.awt.datatransfer.Transferable;
-import java.awt.event.InputEvent;
-import java.util.EventObject;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * STUBBED
- * @see DragGestureRecognizer
- * @see DragGestureListener
- * @see DragSource
- * @since 1.2
- */
-public class DragGestureEvent extends EventObject
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 9080172649166731306L;
-
- private DragSource dragSource;
- private Component component;
- private final Point origin;
- private final int action;
-
- public DragGestureEvent(DragGestureRecognizer dgr, int action, Point origin,
- List events)
- {
- super(dgr);
- if (origin == null || events == null)
- throw new IllegalArgumentException();
- this.origin = origin;
- this.action = action;
- }
-
- public DragGestureRecognizer getSourceAsDragGestureRecognizer()
- {
- return (DragGestureRecognizer) source;
- }
- public Component getComponent()
- {
- return null;
- }
- public DragSource getDragSource()
- {
- return null;
- }
- public Point getDragOrigin()
- {
- return origin;
- }
- public Iterator iterator()
- {
- return null;
- }
- public Object[] toArray()
- {
- return null;
- }
- public Object[] toArray(Object[] array)
- {
- return array;
- }
- public int getDragAction()
- {
- return 0;
- }
- public InputEvent getTriggerEvent()
- {
- return null;
- }
-
- /**
- * Starts the drag given the initial Cursor to display, the Transferable
- * object, and the DragSourceListener to use.
- *
- * @exception InvalidDnDOperationException If the Drag and Drop system is
- * unable to initiate a drag operation, or if the user attempts to start
- * a drag while an existing drag operation is still executing.
- */
- public void startDrag(Cursor dragCursor, Transferable trans)
- {
- startDrag(dragCursor, null, null, trans, null);
- }
-
- /**
- * Starts the drag given the initial Cursor to display, the Transferable
- * object, and the DragSourceListener to use.
- *
- * @exception InvalidDnDOperationException If the Drag and Drop system is
- * unable to initiate a drag operation, or if the user attempts to start
- * a drag while an existing drag operation is still executing.
- */
- public void startDrag(Cursor dragCursor, Transferable trans,
- DragSourceListener l)
- {
- startDrag(dragCursor, null, null, trans, l);
- }
-
- /**
- * Starts the drag given the initial Cursor to display, the Transferable
- * object, and the DragSourceListener to use.
- *
- * @exception InvalidDnDOperationException If the Drag and Drop system is
- * unable to initiate a drag operation, or if the user attempts to start
- * a drag while an existing drag operation is still executing.
- */
- public void startDrag(Cursor dragCursor, Image dragImage, Point imageOffset,
- Transferable trans, DragSourceListener l)
- {
- }
-} // class DragGestureEvent
diff --git a/libjava/java/awt/dnd/DragGestureListener.java b/libjava/java/awt/dnd/DragGestureListener.java
deleted file mode 100644
index e8befe80f19..00000000000
--- a/libjava/java/awt/dnd/DragGestureListener.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* DragGestureListener.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.util.EventListener;
-
-/**
- * This is a listener for starting a drag-and-drop gesture. Upon receiving
- * notification, the implementor then starts the drag operation.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see DragGestureRecognizer
- * @see DragGestureEvent
- * @see DragSource
- * @since 1.2
- * @status updated to 1.4
- */
-public interface DragGestureListener extends EventListener
-{
- /**
- * Called when the native platform notifies the virtual machine that a
- * drag-and-drop has been initiated.
- *
- * @param e the event
- */
- void dragGestureRecognized(DragGestureEvent e);
-} // interface DragGestureListener
diff --git a/libjava/java/awt/dnd/DragGestureRecognizer.java b/libjava/java/awt/dnd/DragGestureRecognizer.java
deleted file mode 100644
index 07b822e7a68..00000000000
--- a/libjava/java/awt/dnd/DragGestureRecognizer.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/* DragGestureRecognizer.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Component;
-import java.awt.Point;
-import java.awt.event.InputEvent;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.TooManyListenersException;
-
-/**
- * STUBBED
- * @since 1.2
- */
-public abstract class DragGestureRecognizer implements Serializable
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 8996673345831063337L;
-
- protected DragSource dragSource;
- protected Component component;
- protected transient DragGestureListener dragGestureListener;
- protected int sourceActions;
- protected ArrayList events = new ArrayList();
-
- protected DragGestureRecognizer(DragSource ds, Component c, int sa,
- DragGestureListener dgl)
- {
- if (ds == null)
- throw new IllegalArgumentException();
- dragSource = ds;
- component = c;
- sourceActions = sa;
- dragGestureListener = dgl;
- }
-
- protected DragGestureRecognizer(DragSource ds, Component c, int sa)
- {
- this(ds, c, sa, null);
- }
-
- protected DragGestureRecognizer(DragSource ds, Component c)
- {
- this(ds, c, 0, null);
- }
-
- protected DragGestureRecognizer(DragSource ds)
- {
- this(ds, null, 0, null);
- }
-
- protected abstract void registerListeners();
-
- protected abstract void unregisterListeners();
-
- public DragSource getDragSource()
- {
- return dragSource;
- }
-
- public Component getComponent()
- {
- return component;
- }
-
- public void setComponent(Component c)
- {
- component = c;
- }
-
- public int getSourceActions()
- {
- return sourceActions;
- }
-
- public void setSourceActions(int sa)
- {
- sourceActions = sa;
- }
-
- public InputEvent getTriggerEvent()
- {
- return events.size() > 0 ? (InputEvent) events.get(0) : null;
- }
-
- public void resetRecognizer()
- {
- throw new Error("not implemented");
- }
-
- /**
- * Register a new DragGestureListener.
- *
- * @exception TooManyListenersException If a DragGestureListener has already
- * been added.
- */
- public void addDragGestureListener(DragGestureListener dgl)
- throws TooManyListenersException
- {
- if (dragGestureListener != null)
- throw new TooManyListenersException();
- dragGestureListener = dgl;
- }
-
- public void removeDragGestureListener(DragGestureListener dgl)
- {
- if (dragGestureListener != dgl)
- throw new IllegalArgumentException();
- dragGestureListener = null;
- }
-
- protected void fireDragGestureRecognized(int dragAction, Point p)
- {
- throw new Error("not implemented");
- }
-
- protected void appendEvent(InputEvent e)
- {
- if (e == null)
- return;
- events.add(e);
- }
-
- private void readObject(ObjectInputStream s)
- throws ClassNotFoundException, IOException
- {
- s.defaultReadObject();
- dragGestureListener = (DragGestureListener) s.readObject();
- }
-
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- s.defaultWriteObject();
- s.writeObject(dragGestureListener instanceof Serializable
- ? dragGestureListener : null);
- }
-} // class DragGestureRecognizer
diff --git a/libjava/java/awt/dnd/DragSource.java b/libjava/java/awt/dnd/DragSource.java
deleted file mode 100644
index 13ffc961510..00000000000
--- a/libjava/java/awt/dnd/DragSource.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/* DragSource.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.GraphicsEnvironment;
-import java.awt.HeadlessException;
-import java.awt.Image;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.awt.datatransfer.FlavorMap;
-import java.awt.datatransfer.SystemFlavorMap;
-import java.awt.datatransfer.Transferable;
-import java.awt.dnd.peer.DragSourceContextPeer;
-import java.io.Serializable;
-import java.util.EventListener;
-
-/**
- * @since 1.2
- */
-public class DragSource implements Serializable
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 6236096958971414066L;
-
- public static final Cursor DefaultCopyDrop = null;
- public static final Cursor DefaultMoveDrop = null;
- public static final Cursor DefaultLinkDrop = null;
- public static final Cursor DefaultCopyNoDrop = null;
- public static final Cursor DefaultMoveNoDrop = null;
- public static final Cursor DefaultLinkNoDrop = null;
-
- private transient FlavorMap flavorMap = SystemFlavorMap.getDefaultFlavorMap ();
-
- private transient DragSourceListener dragSourceListener;
- private transient DragSourceMotionListener dragSourceMotionListener;
-
- /**
- * Initializes the drag source.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public DragSource()
- {
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
- }
-
- /**
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
- public static DragSource getDefaultDragSource()
- {
- return null;
- }
-
- public static boolean isDragImageSupported()
- {
- return false;
- }
-
- /**
- * Start a drag, given the DragGestureEvent that initiated the drag.
- *
- * @exception InvalidDnDOperationException If the Drag and Drop system is
- * unable to initiate a drag operation, or if the user attempts to start
- * a drag while an existing drag operation is still executing.
- */
- public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
- Image dragImage, Point imageOffset,
- Transferable trans, DragSourceListener dsl,
- FlavorMap map)
- {
- }
-
- /**
- * Start a drag, given the DragGestureEvent that initiated the drag.
- *
- * @exception InvalidDnDOperationException If the Drag and Drop system is
- * unable to initiate a drag operation, or if the user attempts to start
- * a drag while an existing drag operation is still executing.
- */
- public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
- Transferable trans, DragSourceListener dsl,
- FlavorMap map)
- {
- startDrag(trigger, dragCursor, null, null, trans, dsl, map);
- }
-
- /**
- * Start a drag, given the DragGestureEvent that initiated the drag.
- *
- * @exception InvalidDnDOperationException If the Drag and Drop system is
- * unable to initiate a drag operation, or if the user attempts to start
- * a drag while an existing drag operation is still executing.
- */
- public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
- Image dragImage, Point imageOffset,
- Transferable trans, DragSourceListener dsl)
- {
- startDrag(trigger, dragCursor, dragImage, imageOffset, trans, dsl, null);
- }
-
- /**
- * Start a drag, given the DragGestureEvent that initiated the drag.
- *
- * @exception InvalidDnDOperationException If the Drag and Drop system is
- * unable to initiate a drag operation, or if the user attempts to start
- * a drag while an existing drag operation is still executing.
- */
- public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
- Transferable trans, DragSourceListener dsl)
- {
- startDrag(trigger, dragCursor, null, null, trans, dsl, null);
- }
-
- /**
- * Creates the DragSourceContext to handle this drag.
- *
- * @exception IllegalArgumentException FIXME
- * @exception NullPointerException If dscp, dgl, dragImage or t is null.
- */
- protected DragSourceContext
- createDragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge,
- Cursor cursor, Image image, Point offset,
- Transferable t, DragSourceListener dsl)
- {
- return null;
- }
-
- public FlavorMap getFlavorMap()
- {
- return flavorMap;
- }
-
- public DragGestureRecognizer
- createDragGestureRecognizer(Class recognizer, Component c, int actions,
- DragGestureListener dgl)
- {
- return Toolkit.getDefaultToolkit ()
- .createDragGestureRecognizer (recognizer, this, c, actions,
- dgl);
- }
-
- public DragGestureRecognizer
- createDefaultDragGestureRecognizer(Component c, int actions,
- DragGestureListener dgl)
- {
- return createDragGestureRecognizer (MouseDragGestureRecognizer.class, c,
- actions, dgl);
- }
-
- /**
- * @since 1.4
- */
- public void addDragSourceListener(DragSourceListener l)
- {
- DnDEventMulticaster.add (dragSourceListener, l);
- }
-
- /**
- * @since 1.4
- */
- public void removeDragSourceListener(DragSourceListener l)
- {
- DnDEventMulticaster.remove (dragSourceListener, l);
- }
-
- /**
- * @since 1.4
- */
- public DragSourceListener[] getDragSourceListeners()
- {
- return (DragSourceListener[]) getListeners (DragSourceListener.class);
- }
-
- /**
- * @since 1.4
- */
- public void addDragSourceMotionListener(DragSourceMotionListener l)
- {
- DnDEventMulticaster.add (dragSourceMotionListener, l);
- }
-
- /**
- * @since 1.4
- */
- public void removeDragSourceMotionListener(DragSourceMotionListener l)
- {
- DnDEventMulticaster.remove (dragSourceMotionListener, l);
- }
-
- /**
- * @since 1.4
- */
- public DragSourceMotionListener[] getDragSourceMotionListeners ()
- {
- return (DragSourceMotionListener[]) getListeners
- (DragSourceMotionListener.class);
- }
-
- /**
- * @since 1.4
- */
- public EventListener[] getListeners (Class listenerType)
- {
- if (listenerType == DragSourceListener.class)
- return DnDEventMulticaster.getListeners (dragSourceListener,
- listenerType);
-
- if (listenerType == DragSourceMotionListener.class)
- return DnDEventMulticaster.getListeners (dragSourceMotionListener,
- listenerType);
-
- // Return an empty EventListener array.
- return new EventListener [0];
- }
-} // class DragSource
diff --git a/libjava/java/awt/dnd/DragSourceAdapter.java b/libjava/java/awt/dnd/DragSourceAdapter.java
deleted file mode 100644
index 90d9a698347..00000000000
--- a/libjava/java/awt/dnd/DragSourceAdapter.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* DragSourceAdapter.java -- drag-and-drop listener adapter
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-/**
- * This class implements <code>DragSourceListener</code> and
- * <code>DragSourceMotionListener</code>, and implements all methods
- * with empty bodies. This allows a listener interested in implementing only
- * a subset of these interfaces to extend this class and override only the
- * desired methods.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see DragSourceEvent
- * @see DragSourceListener
- * @see DragSourceMotionListener
- * @since 1.4
- * @status updated to 1.4
- */
-public abstract class DragSourceAdapter
- implements DragSourceListener, DragSourceMotionListener
-{
- /**
- * Default constructor.
- */
- public DragSourceAdapter()
- {
- }
-
- /**
- * Called when the cursor hotspot enters a drop site which will accept the
- * drag.
- *
- * @param e the event
- */
- public void dragEnter(DragSourceDragEvent e)
- {
- }
-
- /**
- * Called when the cursor hotspot moves inside of a drop site which will
- * accept the drag.
- *
- * @param e the event
- */
- public void dragOver(DragSourceDragEvent e)
- {
- }
-
- /**
- * Called whenever the mouse is moved during a drag-and-drop operation.
- *
- * @param e the event
- */
- public void dragMouseMoved(DragSourceDragEvent e)
- {
- }
-
- /**
- * Called when the user modifies the drop gesture. This is often the case
- * when additional mouse or key events are received during the drag.
- *
- * @param e the event
- */
- public void dropActionChanged(DragSourceDragEvent e)
- {
- }
-
- /**
- * Called when the cursor hotspot moves outside of a drop site which will
- * accept the drag. This could also happen if the drop site is no longer
- * active, or no longer accepts the drag.
- *
- * @param e the event
- */
- public void dragExit(DragSourceEvent e)
- {
- }
-
- /**
- * Called when the drag and drop operation is complete. After this event,
- * <code>getDropSuccess</code> of the event is valid, and
- * <code>getDropAction</code> holds the action requested by the drop site.
- * Furthermore, the <code>DragSourceContext</code> is invalidated.
- *
- * @param e the event
- */
- public void dragDropEnd(DragSourceDropEvent e)
- {
- }
-} // class DragSourceAdapter
diff --git a/libjava/java/awt/dnd/DragSourceContext.java b/libjava/java/awt/dnd/DragSourceContext.java
deleted file mode 100644
index 2cf0d6d0bc9..00000000000
--- a/libjava/java/awt/dnd/DragSourceContext.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/* DragSourceContext.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.Image;
-import java.awt.Point;
-import java.awt.datatransfer.Transferable;
-import java.awt.dnd.peer.DragSourceContextPeer;
-import java.io.Serializable;
-import java.util.TooManyListenersException;
-
-/**
- * @since 1.2
- */
-public class DragSourceContext
- implements DragSourceListener, DragSourceMotionListener, Serializable
-{
- /**
- * Compatible with JDK 1.2+
- */
- static final long serialVersionUID = -115407898692194719L;
-
- protected static final int DEFAULT = 0;
- protected static final int ENTER = 1;
- protected static final int OVER = 2;
- protected static final int CHANGED = 3;
-
- private DragSourceContextPeer peer;
- private Cursor cursor;
- private Transferable transferable;
- private DragGestureEvent trigger;
- private DragSourceListener dragSourceListener;
- private boolean useCustomCursor; // FIXME: currently unused but needed for serialization.
- private int sourceActions; // FIXME: currently unused but needed for serialization.
- private Image image;
- private Point offset;
-
- /**
- * Initializes a drag source context.
- *
- * @exception IllegalArgumentException If Component or DragSource of trigger
- * are null, the drag action for the trigger event is DnDConstants.ACTION_NONE
- * or if the source actions for the DragGestureRecognizer associated with the
- * trigger event are equal to DnDConstants.ACTION_NONE.
- * @exception NullPointerException If peer or trigger is null.
- */
- public DragSourceContext (DragSourceContextPeer peer,
- DragGestureEvent trigger, Cursor cursor,
- Image image, Point offset, Transferable trans,
- DragSourceListener dsl)
- {
- if (peer == null
- || trigger == null)
- throw new NullPointerException ();
-
- if (trigger.getComponent () == null
- || trigger.getDragSource () == null
- || trigger.getDragAction () == DnDConstants.ACTION_NONE
- || trigger.getSourceAsDragGestureRecognizer ()
- .getSourceActions () == DnDConstants.ACTION_NONE)
- throw new IllegalArgumentException ();
-
- this.peer = peer;
- this.trigger = trigger;
- this.cursor = cursor;
- this.image = image;
- this.offset = offset;
- this.transferable = trans;
- this.dragSourceListener = dsl;
-
- throw new Error ("not implemented");
- }
-
- public DragSource getDragSource()
- {
- return trigger.getDragSource ();
- }
-
- public Component getComponent()
- {
- return trigger.getComponent ();
- }
-
- public DragGestureEvent getTrigger()
- {
- return trigger;
- }
-
- public int getSourceActions()
- {
- return trigger.getSourceAsDragGestureRecognizer ().getSourceActions ();
- }
-
- public void setCursor (Cursor cursor)
- {
- this.cursor = cursor;
- // FIXME: Check if we need to do more here
- }
-
- public Cursor getCursor()
- {
- return cursor;
- }
-
- /**
- * Adds a <code>DragSourceListener</code>.
- *
- * @exception TooManyListenersException If a <code>DragSourceListener</code>
- * has already been added.
- */
- public void addDragSourceListener (DragSourceListener dsl)
- throws TooManyListenersException
- {
- if (dragSourceListener != null)
- throw new TooManyListenersException ();
-
- dragSourceListener = dsl;
- }
-
- public void removeDragSourceListener (DragSourceListener dsl)
- {
- if (dragSourceListener == dsl)
- dragSourceListener = null;
- }
-
- public void transferablesFlavorsChanged()
- {
- }
-
- public void dragEnter(DragSourceDragEvent e)
- {
- }
-
- public void dragOver(DragSourceDragEvent e)
- {
- }
-
- public void dragExit(DragSourceEvent e)
- {
- }
-
- public void dropActionChanged(DragSourceDragEvent e)
- {
- }
-
- public void dragDropEnd(DragSourceDropEvent e)
- {
- }
-
- public void dragMouseMoved(DragSourceDragEvent e)
- {
- }
-
- public Transferable getTransferable()
- {
- return transferable;
- }
-
- protected void updateCurrentCursor(int dropOp, int targetAct, int status)
- {
- }
-} // class DragSourceContext
diff --git a/libjava/java/awt/dnd/DragSourceDragEvent.java b/libjava/java/awt/dnd/DragSourceDragEvent.java
deleted file mode 100644
index 511700b616d..00000000000
--- a/libjava/java/awt/dnd/DragSourceDragEvent.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* DragSourceDragEvent.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import gnu.java.awt.EventModifier;
-
-/**
- * @author Michael Koch
- * @since 1.2
- */
-public class DragSourceDragEvent extends DragSourceEvent
-{
- /**
- * Compatible with JDK 1.2+
- */
- private static final long serialVersionUID = 481346297933902471L;
-
- private final int dropAction;
- private final int targetActions;
- private final int gestureModifiers;
-
- public DragSourceDragEvent(DragSourceContext context, int dropAction,
- int actions, int modifiers)
- {
- super(context);
- this.dropAction = dropAction;
- targetActions = actions;
- gestureModifiers = EventModifier.extend(modifiers);
- }
-
- public DragSourceDragEvent(DragSourceContext context, int dropAction,
- int actions, int modifiers, int x, int y)
- {
- super(context, x, y);
- this.dropAction = dropAction;
- targetActions = actions;
- gestureModifiers = EventModifier.extend(modifiers);
- }
-
- public int getTargetActions()
- {
- return targetActions;
- }
-
- public int getGestureModifiers()
- {
- return EventModifier.revert(gestureModifiers);
- }
-
- public int getGestureModifiersEx()
- {
- return gestureModifiers;
- }
-
- public int getUserAction()
- {
- return dropAction;
- }
-
- public int getDropAction()
- {
- return (dropAction
- & targetActions
- & ((DragSourceContext) source).getSourceActions());
- }
-} // class DragSourceDragEvent
diff --git a/libjava/java/awt/dnd/DragSourceDropEvent.java b/libjava/java/awt/dnd/DragSourceDropEvent.java
deleted file mode 100644
index 7621262d839..00000000000
--- a/libjava/java/awt/dnd/DragSourceDropEvent.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* DragSourceDragEvent.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- * @since 1.2
- *
- * Written using JDK 1.4.1 Online API
- * Status: JDK 1.4 complete
- */
-public class DragSourceDropEvent extends DragSourceEvent
-{
- /**
- * Compatible with JDK 1.2+
- */
- private static final long serialVersionUID = -5571321229470821891L;
-
- private final int dropAction;
- private final boolean dropSuccess;
-
- public DragSourceDropEvent (DragSourceContext context)
- {
- super (context);
- this.dropAction = 0;
- this.dropSuccess = false;
- }
-
- public DragSourceDropEvent (DragSourceContext context, int dropAction,
- boolean dropSuccess)
- {
- super (context);
- this.dropAction = dropAction;
- this.dropSuccess = dropSuccess;
- }
-
- public DragSourceDropEvent (DragSourceContext context, int dropAction,
- boolean dropSuccess, int x, int y)
- {
- super (context, x, y);
- this.dropAction = dropAction;
- this.dropSuccess = dropSuccess;
- }
-
- public int getDropAction()
- {
- return dropAction & ((DragSourceContext) source).getSourceActions();
- }
-
- public boolean getDropSuccess()
- {
- return dropSuccess;
- }
-} // class DragSourceDropEvent
diff --git a/libjava/java/awt/dnd/DragSourceEvent.java b/libjava/java/awt/dnd/DragSourceEvent.java
deleted file mode 100644
index c5cd42a4e2b..00000000000
--- a/libjava/java/awt/dnd/DragSourceEvent.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/* DragSourceEvent.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Point;
-import java.util.EventObject;
-
-/**
- * @since 1.2
- */
-public class DragSourceEvent extends EventObject
-{
- /**
- * Compatible with JDK 1.2+
- */
- private static final long serialVersionUID = -763287114604032641L;
-
- private final boolean locationSpecified;
- private final int x;
- private final int y;
-
- public DragSourceEvent(DragSourceContext context)
- {
- super(context);
- locationSpecified = false;
- x = 0;
- y = 0;
- }
-
- public DragSourceEvent(DragSourceContext context, int x, int y)
- {
- super(context);
- locationSpecified = true;
- this.x = x;
- this.y = y;
- }
-
- public DragSourceContext getDragSourceContext()
- {
- return (DragSourceContext) source;
- }
-
- public Point getLocation()
- {
- return locationSpecified ? new Point(x, y) : null;
- }
-
- public int getX()
- {
- return x;
- }
-
- public int getY()
- {
- return y;
- }
-} // class DragSourceEvent
diff --git a/libjava/java/awt/dnd/DragSourceListener.java b/libjava/java/awt/dnd/DragSourceListener.java
deleted file mode 100644
index aac6e94ebe7..00000000000
--- a/libjava/java/awt/dnd/DragSourceListener.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* DragSourceListener.java -- listen to events during the drag
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.util.EventListener;
-
-/**
- * This class allows an object to listen for drag and drop events. It can
- * be used to provide appropriate feedback for "drag over" actions. You can
- * also use a <code>DragSourceAdapter</code> to filter the events you are
- * interested in.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public interface DragSourceListener extends EventListener
-{
- /**
- * Called when the cursor hotspot enters a drop site which will accept the
- * drag.
- *
- * @param e the drag source drag event
- */
- void dragEnter(DragSourceDragEvent e);
-
- /**
- * Called when the cursor hotspot moves inside of a drop site which will
- * accept the drag.
- *
- * @param e the drag source drag event
- */
- void dragOver(DragSourceDragEvent e);
-
- /**
- * Called when the user modifies the drop gesture. This is often the case
- * when additional mouse or key events are received during the drag.
- *
- * @param e the drag source drag event
- */
- void dropActionChanged(DragSourceDragEvent e);
-
- /**
- * Called when the cursor hotspot moves outside of a drop site which will
- * accept the drag. This could also happen if the drop site is no longer
- * active, or no longer accepts the drag.
- *
- * @param e the drag source drag event
- */
- void dragExit(DragSourceEvent e);
-
- /**
- * Called when the drag and drop operation is complete. After this event,
- * <code>getDropSuccess</code> of the event is valid, and
- * <code>getDropAction</code> holds the action requested by the drop site.
- * Furthermore, the <code>DragSourceContext</code> is invalidated.
- *
- * @param e the drag source drag event
- */
- void dragDropEnd(DragSourceDropEvent e);
-} // interface DragSourceListener
diff --git a/libjava/java/awt/dnd/DragSourceMotionListener.java b/libjava/java/awt/dnd/DragSourceMotionListener.java
deleted file mode 100644
index 5d04c227100..00000000000
--- a/libjava/java/awt/dnd/DragSourceMotionListener.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* DragSourceMotionListener.java -- tracks motion in the drag source
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.util.EventListener;
-
-/**
- * This is a listener for mouse motion in the drag source before the drop
- * event occurs. You can also use a <code>DragSourceAdapter</code> to filter
- * the events you are interested in.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see DragSourceDragEvent
- * @see DragSource
- * @see DragSourceListener
- * @see DragSourceAdapter
- * @since 1.4
- * @status updated to 1.4
- */
-public interface DragSourceMotionListener extends EventListener
-{
- /**
- * Called whenever the mouse is moved during a drag-and-drop operation.
- *
- * @param e the event
- */
- void dragMouseMoved(DragSourceDragEvent e);
-} // interface DragSourceMotionListener
diff --git a/libjava/java/awt/dnd/DropTarget.java b/libjava/java/awt/dnd/DropTarget.java
deleted file mode 100644
index 9fd7ef896fb..00000000000
--- a/libjava/java/awt/dnd/DropTarget.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/* DropTarget.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Component;
-import java.awt.GraphicsEnvironment;
-import java.awt.HeadlessException;
-import java.awt.Point;
-import java.awt.datatransfer.FlavorMap;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.Serializable;
-import java.util.EventListener;
-import java.util.TooManyListenersException;
-
-/**
- * @author Michael Koch
- * @since 1.2
- */
-public class DropTarget
- implements DropTargetListener, EventListener, Serializable
-{
- /**
- * Compatible with JDK 1.2+
- */
- private static final long serialVersionUID = -6283860791671019047L;
-
- /** @specnote According to the online documentation, this is
- * protected, but in reality it is public. */
- public static class DropTargetAutoScroller
- implements ActionListener
- {
- private Component component;
- private Point point;
-
- protected DropTargetAutoScroller (Component c, Point p)
- {
- component = c;
- point = p;
- }
-
- protected void updateLocation (Point newLocn)
- {
- point = newLocn;
- }
-
- protected void stop ()
- {
- }
-
- public void actionPerformed (ActionEvent e)
- {
- }
- }
-
- private Component component;
- private FlavorMap flavorMap;
- private int actions;
- private DropTargetContext dropTargetContext;
- private DropTargetListener dropTargetListener;
- private boolean active = true;
-
- /**
- * Creates a <code>DropTarget</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
- public DropTarget ()
- {
- this (null, 0, null, true, null);
- }
-
- /**
- * Creates a <code>DropTarget</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
- public DropTarget (Component c, DropTargetListener dtl)
- {
- this (c, 0, dtl, true, null);
- }
-
- /**
- * Creates a <code>DropTarget</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
- public DropTarget (Component c, int i, DropTargetListener dtl)
- {
- this (c, i, dtl, true, null);
- }
-
- /**
- * Creates a <code>DropTarget</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
- public DropTarget (Component c, int i, DropTargetListener dtl, boolean b)
- {
- this (c, i, dtl, b, null);
- }
-
- /**
- * Creates a <code>DropTarget</code> object.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true.
- */
- public DropTarget (Component c, int i, DropTargetListener dtl, boolean b,
- FlavorMap fm)
- {
- if (GraphicsEnvironment.isHeadless ())
- throw new HeadlessException ();
-
- component = c;
- actions = i;
- dropTargetListener = dtl;
- flavorMap = fm;
-
- setActive (b);
- }
-
- /**
- * Sets the component associated with this drop target object.
- */
- public void setComponent (Component c)
- {
- component = c;
- }
-
- /**
- * Returns the component associated with this drop target object.
- */
- public Component getComponent ()
- {
- return component;
- }
-
- /**
- * Sets the default actions.
- */
- public void setDefaultActions (int ops)
- {
- actions = ops;
- }
-
- /**
- * Returns the default actions.
- */
- public int getDefaultActions ()
- {
- return actions;
- }
-
- public void setActive (boolean active)
- {
- this.active = active;
- }
-
- public boolean isActive()
- {
- return active;
- }
-
- /**
- * Adds a new <code>DropTargetListener</code>.
- *
- * @exception TooManyListenersException Sun's JDK does not, despite
- * documentation, throw this exception here when you install an additional
- * <code>DropTargetListener</code>. So to be compatible, we do the same
- * thing.
- */
- public void addDropTargetListener (DropTargetListener dtl)
- throws TooManyListenersException
- {
- dropTargetListener = dtl;
- }
-
- public void removeDropTargetListener(DropTargetListener dtl)
- {
- // FIXME: Do we need to do something with dtl ?
- dropTargetListener = null;
- }
-
- public void dragEnter(DropTargetDragEvent dtde)
- {
- }
-
- public void dragOver(DropTargetDragEvent dtde)
- {
- }
-
- public void dropActionChanged(DropTargetDragEvent dtde)
- {
- }
-
- public void dragExit(DropTargetEvent dte)
- {
- }
-
- public void drop(DropTargetDropEvent dtde)
- {
- }
-
- public FlavorMap getFlavorMap()
- {
- return flavorMap;
- }
-
- public void setFlavorMap(FlavorMap fm)
- {
- flavorMap = fm;
- }
-
- public void addNotify(java.awt.peer.ComponentPeer peer)
- {
- }
-
- public void removeNotify(java.awt.peer.ComponentPeer peer)
- {
- }
-
- public DropTargetContext getDropTargetContext()
- {
- if (dropTargetContext == null)
- dropTargetContext = createDropTargetContext ();
-
- return dropTargetContext;
- }
-
- protected DropTargetContext createDropTargetContext()
- {
- return new DropTargetContext (this);
- }
-
- protected DropTarget.DropTargetAutoScroller createDropTargetAutoScroller
- (Component c, Point p)
- {
- return new DropTarget.DropTargetAutoScroller (c, p);
- }
-
- protected void initializeAutoscrolling(Point p)
- {
- }
-
- protected void updateAutoscroll(Point dragCursorLocn)
- {
- }
-
- protected void clearAutoscroll()
- {
- }
-} // class DropTarget
diff --git a/libjava/java/awt/dnd/DropTargetAdapter.java b/libjava/java/awt/dnd/DropTargetAdapter.java
deleted file mode 100644
index 13c6b9f4b6d..00000000000
--- a/libjava/java/awt/dnd/DropTargetAdapter.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* DragSourceAdapter.java -- drag-and-drop listener adapter
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-/**
- * This class implements <code>DropTargetListener</code>, and implements all methods
- * with empty bodies. This allows a listener interested in implementing only
- * a subset of these interfaces to extend this class and override only the
- * desired methods.
- *
- * @author Michael Koch (konqueror@gmx.de)
- * @since 1.4
- * @status updated to 1.4
- */
-public abstract class DropTargetAdapter
- implements DropTargetListener
-{
- /**
- * Default constructor.
- */
- public DropTargetAdapter()
- {
- }
-
- /**
- * Called when the cursor hotspot enters a drop site which will accept the
- * drag.
- *
- * @param e the event
- */
- public void dragEnter (DropTargetDragEvent e)
- {
- }
-
- /**
- * Called when the cursor hotspot moves inside of a drop site which will
- * accept the drag.
- *
- * @param e the event
- */
- public void dragOver (DropTargetDragEvent e)
- {
- }
-
- /**
- * Called when the user modifies the drop gesture. This is often the case
- * when additional mouse or key events are received during the drag.
- *
- * @param e the event
- */
- public void dropActionChanged (DropTargetDragEvent e)
- {
- }
-
- /**
- * Called when the cursor hotspot moves outside of a drop site which will
- * accept the drag. This could also happen if the drop site is no longer
- * active, or no longer accepts the drag.
- *
- * @param e the event
- */
- public void dragExit(DropTargetEvent e)
- {
- }
-} // class DropTargetAdapter
diff --git a/libjava/java/awt/dnd/DropTargetContext.java b/libjava/java/awt/dnd/DropTargetContext.java
deleted file mode 100644
index d1fb66e6f35..00000000000
--- a/libjava/java/awt/dnd/DropTargetContext.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/* DropTargetContext.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Component;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- * @since 1.2
- */
-public class DropTargetContext implements Serializable
-{
- static final long serialVersionUID = -634158968993743371L;
-
- /** @specnote According to the online documentation, this is
- * protected, but in reality it is public. */
- public class TransferableProxy implements Transferable
- {
- protected boolean isLocal;
- protected Transferable transferable;
-
- TransferableProxy (Transferable t, boolean local)
- {
- this.transferable = t;
- this.isLocal = local;
- }
-
- public DataFlavor[] getTransferDataFlavors ()
- {
- return transferable.getTransferDataFlavors ();
- }
-
- public boolean isDataFlavorSupported (DataFlavor flavor)
- {
- return transferable.isDataFlavorSupported (flavor);
- }
-
- public Object getTransferData (DataFlavor flavor)
- throws UnsupportedFlavorException, IOException
- {
- return transferable.getTransferData (flavor);
- }
- }
-
- private DropTarget dropTarget;
- private int targetActions;
- private java.awt.dnd.peer.DropTargetContextPeer dtcp;
-
- // package private
- DropTargetContext (DropTarget dropTarget)
- {
- this.dropTarget = dropTarget;
- }
-
- public DropTarget getDropTarget ()
- {
- return dropTarget;
- }
-
- public Component getComponent ()
- {
- return dropTarget.getComponent ();
- }
-
- public void addNotify (java.awt.dnd.peer.DropTargetContextPeer dtcp)
- {
- this.dtcp = dtcp;
- }
-
- public void removeNotify ()
- {
- this.dtcp = null;
- }
-
- protected void setTargetActions (int actions)
- {
- targetActions = actions;
- }
-
- protected int getTargetActions()
- {
- return targetActions;
- }
-
- /**
- * Signals that the drop is completed.
- *
- * @exception InvalidDnDOperationException If a drop is not outstanding.
- */
- public void dropComplete (boolean success)
- {
- // FIXME: implement this
- }
-
- protected void acceptDrag (int dragOperation)
- {
- // FIXME: implement this
- }
-
- protected void rejectDrag ()
- {
- // FIXME: implement this
- }
-
- protected void acceptDrop (int dropOperation)
- {
- // FIXME: implement this
- }
-
- protected void rejectDrop ()
- {
- // FIXME: implement this
- }
-
- protected DataFlavor[] getCurrentDataFlavors ()
- {
- // FIXME: implement this
- return null;
- }
-
- protected List getCurrentDataFlavorsAsList ()
- {
- return Arrays.asList (getCurrentDataFlavors ());
- }
-
- protected boolean isDataFlavorSupported (DataFlavor flavor)
- {
- return getCurrentDataFlavorsAsList ().contains (flavor);
- }
-
- /**
- * Return the <code>Transferable</code> operandof this operation.
- *
- * @exception InvalidDnDOperationException If a drag is not outstanding.
- */
- protected Transferable getTransferable() throws InvalidDnDOperationException
- {
- // FIXME: implement this
- return null;
- }
-
- protected Transferable createTransferableProxy(Transferable t, boolean local)
- {
- return new TransferableProxy (t, local);
- }
-} // class DropTargetContext
diff --git a/libjava/java/awt/dnd/DropTargetDragEvent.java b/libjava/java/awt/dnd/DropTargetDragEvent.java
deleted file mode 100644
index 6cdc3a292be..00000000000
--- a/libjava/java/awt/dnd/DropTargetDragEvent.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* DropTargetDragEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Point;
-import java.awt.datatransfer.DataFlavor;
-import java.util.List;
-
-/**
- * @since 1.2
- */
-public class DropTargetDragEvent extends DropTargetEvent
-{
- /**
- * Compatible with 1.2+
- */
- private static final long serialVersionUID = -8422265619058953682L;
-
- private final int dropAction;
- private final int srcActions;
- private final Point location;
-
- /**
- * Initializes a <code>DropTargetDragEvent</code>.
- *
- * @exception IllegalArgumentException If dropAction is not one of DnDConstants,
- * srcActions is not a bitwise mask of DnDConstants, or dtc is null.
- * @exception NullPointerException If location is null.
- */
- public DropTargetDragEvent (DropTargetContext context, Point location,
- int dropAction, int srcActions)
- {
- super (context);
-
- if (location == null)
- throw new NullPointerException ();
-
- if (context == null)
- throw new IllegalArgumentException ();
-
- if (dropAction != DnDConstants.ACTION_NONE
- && dropAction != DnDConstants.ACTION_COPY
- && dropAction != DnDConstants.ACTION_MOVE
- && dropAction != DnDConstants.ACTION_COPY_OR_MOVE
- && dropAction != DnDConstants.ACTION_LINK
- && dropAction != DnDConstants.ACTION_REFERENCE)
- throw new IllegalArgumentException ();
-
- int srcActionsMask = DnDConstants.ACTION_NONE
- | DnDConstants.ACTION_COPY
- | DnDConstants.ACTION_MOVE
- | DnDConstants.ACTION_COPY_OR_MOVE
- | DnDConstants.ACTION_LINK
- | DnDConstants.ACTION_REFERENCE;
-
- if (~(srcActions ^ srcActionsMask) != 0)
- throw new IllegalArgumentException ();
-
- this.dropAction = dropAction;
- this.srcActions = srcActions;
- this.location = location;
- }
-
- public void acceptDrag (int dragOperation)
- {
- context.acceptDrag (dragOperation);
- }
-
- public DataFlavor[] getCurrentDataFlavors ()
- {
- return context.getCurrentDataFlavors ();
- }
-
- public List getCurrentDataFlavorsAsList ()
- {
- return context.getCurrentDataFlavorsAsList ();
- }
-
- public int getDropAction()
- {
- return 0;
- //return dropAction & ((DropTargetContext) source).getTargetActions();
- }
-
- public Point getLocation ()
- {
- return location;
- }
-
- public int getSourceActions ()
- {
- return srcActions;
- }
-
- public boolean isDataFlavorSupported (DataFlavor df)
- {
- return context.isDataFlavorSupported (df);
- }
-
- public void rejectDrag ()
- {
- context.rejectDrag ();
- }
-} // class DropTargetDragEvent
diff --git a/libjava/java/awt/dnd/DropTargetDropEvent.java b/libjava/java/awt/dnd/DropTargetDropEvent.java
deleted file mode 100644
index 0c0777f78d0..00000000000
--- a/libjava/java/awt/dnd/DropTargetDropEvent.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/* DropTargetDropEvent.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Point;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.util.List;
-
-/**
- * @since 1.2
- */
-public class DropTargetDropEvent extends DropTargetEvent
-{
- /**
- * Compatible with JDK 1.2+
- */
- private static final long serialVersionUID = -1721911170440459322L;
-
- private final int dropAction;
- private final int actions;
- private final Point location;
- private final boolean isLocalTx;
-
- /**
- * Initializes a <code>DropTargetDropEvent</code>. By default this constructor
- * assumes that the target is not int same JVM.
- *
- * @exception IllegalArgumentException If dropAction is not one of DnDConstants,
- * actions is not a bitwise mask of DnDConstants, or dtc is null.
- * @exception NullPointerException If location is null.
- */
- public DropTargetDropEvent (DropTargetContext dtc, Point location,
- int dropAction, int actions)
- {
- this (dtc, location, dropAction, actions, false);
- }
-
- /**
- * Initializes a <code>DropTargetDropEvent</code>.
- *
- * @exception IllegalArgumentException If dropAction is not one of DnDConstants,
- * actions is not a bitwise mask of DnDConstants, or dtc is null.
- * @exception NullPointerException If location is null.
- */
- public DropTargetDropEvent (DropTargetContext dtc, Point location,
- int dropAction, int actions, boolean isLocalTx)
- {
- super (dtc);
-
- if (location == null)
- throw new NullPointerException ();
-
- if (dtc == null)
- throw new IllegalArgumentException ();
-
- if (dropAction != DnDConstants.ACTION_NONE
- && dropAction != DnDConstants.ACTION_COPY
- && dropAction != DnDConstants.ACTION_MOVE
- && dropAction != DnDConstants.ACTION_COPY_OR_MOVE
- && dropAction != DnDConstants.ACTION_LINK
- && dropAction != DnDConstants.ACTION_REFERENCE)
- throw new IllegalArgumentException ();
-
- int actionsMask = DnDConstants.ACTION_NONE
- | DnDConstants.ACTION_COPY
- | DnDConstants.ACTION_MOVE
- | DnDConstants.ACTION_COPY_OR_MOVE
- | DnDConstants.ACTION_LINK
- | DnDConstants.ACTION_REFERENCE;
-
- if (~(actions ^ actionsMask) != 0)
- throw new IllegalArgumentException ();
-
- this.dropAction = dropAction;
- this.actions = actions;
- this.location = location;
- this.isLocalTx = isLocalTx;
- }
-
- public Point getLocation ()
- {
- return location;
- }
-
- public DataFlavor[] getCurrentDataFlavors ()
- {
- return context.getCurrentDataFlavors ();
- }
-
- public List getCurrentDataFlavorsAsList ()
- {
- return context.getCurrentDataFlavorsAsList ();
- }
-
- public boolean isDataFlavorSupported (DataFlavor flavor)
- {
- return context.isDataFlavorSupported (flavor);
- }
-
- public int getSourceActions ()
- {
- return actions;
- }
-
- public int getDropAction ()
- {
- return dropAction;
- }
-
- public Transferable getTransferable ()
- {
- return context.getTransferable ();
- }
-
- public void acceptDrop (int dropAction)
- {
- context.acceptDrop (dropAction);
- }
-
- public void rejectDrop ()
- {
- context.rejectDrop ();
- }
-
- public void dropComplete (boolean success)
- {
- // FIXME: implement this
- }
-
- public boolean isLocalTransfer()
- {
- return isLocalTx;
- }
-} // class DropTargetDropEvent
diff --git a/libjava/java/awt/dnd/DropTargetEvent.java b/libjava/java/awt/dnd/DropTargetEvent.java
deleted file mode 100644
index 56a4d481a16..00000000000
--- a/libjava/java/awt/dnd/DropTargetEvent.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* DropTarget.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.util.EventObject;
-
-public class DropTargetEvent extends EventObject
-{
- protected DropTargetContext context;
-
- public DropTargetEvent (DropTargetContext context)
- {
- super (context);
- this.context = context;
- }
-
- public DropTargetContext getDropTargetContext ()
- {
- return context;
- }
-}
diff --git a/libjava/java/awt/dnd/DropTargetListener.java b/libjava/java/awt/dnd/DropTargetListener.java
deleted file mode 100644
index ceb839bac27..00000000000
--- a/libjava/java/awt/dnd/DropTargetListener.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* DropTargetListener.java -- listen to events during the drop
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.util.EventListener;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- * @since 1.2
- * @status updated to 1.4
- */
-public interface DropTargetListener extends EventListener
-{
- /**
- * Called when the cursor hotspot enters a drop site which will accept the
- * drag.
- *
- * @param e the drag source drag event
- */
- void dragEnter (DropTargetDragEvent e);
-
- /**
- * Called when the cursor hotspot moves inside of a drop site which will
- * accept the drag.
- *
- * @param e the drag source drag event
- */
- void dragOver (DropTargetDragEvent e);
-
- /**
- * Called when the user modifies the drop gesture. This is often the case
- * when additional mouse or key events are received during the drag.
- *
- * @param e the drag source drag event
- */
- void dropActionChanged (DropTargetDragEvent e);
-
- /**
- * Called when the cursor hotspot moves outside of a drop site which will
- * accept the drag. This could also happen if the drop site is no longer
- * active, or no longer accepts the drag.
- *
- * @param e the drag source drag event
- */
- void dragExit (DropTargetEvent e);
-
- /**
- * Called when the drag operation has terminated with a drop.
- *
- * @param e the drag source drag event
- */
- void drop (DropTargetDropEvent e);
-} // interface DropTargetListener
diff --git a/libjava/java/awt/dnd/InvalidDnDOperationException.java b/libjava/java/awt/dnd/InvalidDnDOperationException.java
deleted file mode 100644
index 2fd9767e03d..00000000000
--- a/libjava/java/awt/dnd/InvalidDnDOperationException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* InvalidDnDOperationException.java -- thrown when drag-and-drop fails
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-/**
- * Thrown when a method in the java.awt.dnd package is unable to perform a
- * requested operation, usually because the underlying DnD system is in the
- * wrong state.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public class InvalidDnDOperationException extends IllegalStateException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -6062568741193956678L;
-
- /**
- * Create an exception without a message.
- */
- public InvalidDnDOperationException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public InvalidDnDOperationException(String s)
- {
- super(s);
- }
-} // class InvalidDnDOperationException
diff --git a/libjava/java/awt/dnd/MouseDragGestureRecognizer.java b/libjava/java/awt/dnd/MouseDragGestureRecognizer.java
deleted file mode 100644
index 9a2a7bc4c79..00000000000
--- a/libjava/java/awt/dnd/MouseDragGestureRecognizer.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/* MouseDragGestureRecognizer.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd;
-
-import java.awt.Component;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class MouseDragGestureRecognizer
- extends DragGestureRecognizer
- implements MouseListener, MouseMotionListener
-{
- /**
- * Creates a <code>MouseDragGestureRecognizer</code> object.
- */
- protected MouseDragGestureRecognizer (DragSource ds, Component c, int act,
- DragGestureListener dgl)
- {
- super (ds, c, act, dgl);
- }
-
- /**
- * Creates a <code>MouseDragGestureRecognizer</code> object.
- */
- protected MouseDragGestureRecognizer (DragSource ds, Component c, int act)
- {
- super (ds, c, act);
- }
-
- /**
- * Creates a <code>MouseDragGestureRecognizer</code> object.
- */
- protected MouseDragGestureRecognizer (DragSource ds, Component c)
- {
- super (ds, c);
- }
-
- /**
- * Creates a <code>MouseDragGestureRecognizer</code> object.
- */
- protected MouseDragGestureRecognizer (DragSource ds)
- {
- super (ds);
- }
-
- protected void registerListeners ()
- {
- component.addMouseListener (this);
- component.addMouseMotionListener (this);
- }
-
- protected void unregisterListeners ()
- {
- component.removeMouseListener (this);
- component.removeMouseMotionListener (this);
- }
-
- public void mouseClicked (MouseEvent e)
- {
- // Do nothing in here by default.
- }
-
- public void mousePressed (MouseEvent e)
- {
- // Do nothing in here by default.
- }
-
- public void mouseReleased (MouseEvent e)
- {
- // Do nothing in here by default.
- }
-
- public void mouseEntered (MouseEvent e)
- {
- // Do nothing in here by default.
- }
-
- public void mouseExited (MouseEvent e)
- {
- // Do nothing in here by default.
- }
-
- public void mouseDragged (MouseEvent e)
- {
- // Do nothing in here by default.
- }
-
- public void mouseMoved (MouseEvent e)
- {
- // Do nothing in here by default.
- }
-} // class MouseDragGestureRecognizer
diff --git a/libjava/java/awt/dnd/peer/DragSourceContextPeer.java b/libjava/java/awt/dnd/peer/DragSourceContextPeer.java
deleted file mode 100644
index 8c134b623a7..00000000000
--- a/libjava/java/awt/dnd/peer/DragSourceContextPeer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* DragSourceContextPeer.java -- interface for drag-and-drop peers
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd.peer;
-
-import java.awt.Cursor;
-import java.awt.Image;
-import java.awt.Point;
-import java.awt.dnd.DragSourceContext;
-import java.awt.dnd.InvalidDnDOperationException;
-
-/**
- * STUBBED
- */
-public interface DragSourceContextPeer
-{
- void startDrag(DragSourceContext context, Cursor c, Image i, Point p)
- throws InvalidDnDOperationException;
- Cursor getCursor();
- void setCursor(Cursor c) throws InvalidDnDOperationException;
- void transferablesFlavorsChanged();
-} // interface DragSourceContextPeer
diff --git a/libjava/java/awt/dnd/peer/DropTargetContextPeer.java b/libjava/java/awt/dnd/peer/DropTargetContextPeer.java
deleted file mode 100644
index 6eae29b3810..00000000000
--- a/libjava/java/awt/dnd/peer/DropTargetContextPeer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* DropTargetContextPeer.java -- interface for drag-and-drop peers
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd.peer;
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.dnd.DropTarget;
-import java.awt.dnd.InvalidDnDOperationException;
-
-
-/**
- * Used to control state of recipient protocol from the
- * <code>DropTargetListener</code>. Occurs when a <code>Component</code>
- * with an associated <code>DropTarget</code> and visible geometry is first
- * intersected by a logical cursor.
- *
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface DropTargetContextPeer
-{
- void setTargetActions(int actions);
- int getTargetActions();
- DropTarget getDropTarget();
- DataFlavor[] getTransferDataFlavors();
- Transferable getTransferable() throws InvalidDnDOperationException;
- boolean isTransferableJVMLocal();
- void acceptDrag(int dragAction);
- void rejectDrag();
- void acceptDrop(int dropAction);
- void rejectDrop();
- void dropComplete(boolean success);
-}
diff --git a/libjava/java/awt/dnd/peer/DropTargetPeer.java b/libjava/java/awt/dnd/peer/DropTargetPeer.java
deleted file mode 100644
index ec17cbe4be9..00000000000
--- a/libjava/java/awt/dnd/peer/DropTargetPeer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* DropTargetPeer.java -- interface for drag-and-drop peers
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.dnd.peer;
-
-import java.awt.dnd.DropTarget;
-
-/**
- */
-public interface DropTargetPeer
-{
- void addDropTarget (DropTarget target);
- void removeDropTarget (DropTarget target);
-} // interface DropTargetContextPeer
diff --git a/libjava/java/awt/event/AWTEventListener.java b/libjava/java/awt/event/AWTEventListener.java
deleted file mode 100644
index 8662b74006d..00000000000
--- a/libjava/java/awt/event/AWTEventListener.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* AWTEventListener.java -- listen for all events in the AWT system
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.AWTEvent;
-import java.util.EventListener;
-
-/**
- * This listener is for classes that need to listen to all events in the AWT
- * system. In general, this should not be used except for classes like
- * javax.accessibility or by event recorders.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see AWTEvent
- * @see Toolkit#addAWTEventListener(AWTEventListener, long)
- * @see Toolkit#removeAWTEventListener(AWTEventListener)
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AWTEventListener extends EventListener
-{
- /**
- * This method is called when any event in the AWT system is dispatched.
- *
- * @param event the AWTEvent that was dispatched
- */
- void eventDispatched(AWTEvent event);
-} // interface AWTEventListener
diff --git a/libjava/java/awt/event/AWTEventListenerProxy.java b/libjava/java/awt/event/AWTEventListenerProxy.java
deleted file mode 100644
index 9fccfc7ea2c..00000000000
--- a/libjava/java/awt/event/AWTEventListenerProxy.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/* AWTEventListenerProxy.java -- wrapper/filter for AWTEventListener
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.AWTEvent;
-import java.util.EventListenerProxy;
-
-/**
- * This class allows adding an AWTEventListener which only pays attention to
- * a specific event mask.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Toolkit
- * @see EventListenerProxy
- * @since 1.4
- * @status updated to 1.4
- */
-public class AWTEventListenerProxy extends EventListenerProxy
- implements AWTEventListener
-{
- /** The event mask. */
- private final long mask;
-
- /**
- * Construct an AWT Event Listener which only listens to events in the given
- * mask, passing the work on to the real listener.
- *
- * @param eventMask the mask of events to listen to
- * @param listener the wrapped listener
- */
- public AWTEventListenerProxy(long eventMask, AWTEventListener listener)
- {
- super(listener);
- mask = eventMask;
- }
-
- /**
- * Forwards events on to the delegate if they meet the event mask.
- *
- * @param event the property change event to filter
- * @throws NullPointerException if the delegate this was created with is null
- */
- public void eventDispatched(AWTEvent event)
- {
- int id = event == null ? 0 : event.getID();
- if (((mask & AWTEvent.ACTION_EVENT_MASK) != 0
- && event instanceof ActionEvent)
- || ((mask & AWTEvent.ADJUSTMENT_EVENT_MASK) != 0
- && event instanceof AdjustmentEvent)
- || ((mask & AWTEvent.COMPONENT_EVENT_MASK) != 0
- && event instanceof ComponentEvent
- && (id >= ComponentEvent.COMPONENT_FIRST
- && id <= ComponentEvent.COMPONENT_LAST))
- || ((mask & AWTEvent.CONTAINER_EVENT_MASK) != 0
- && event instanceof ContainerEvent)
- || ((mask & AWTEvent.FOCUS_EVENT_MASK) != 0
- && event instanceof FocusEvent)
- || ((mask & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) != 0
- && event instanceof HierarchyEvent
- && (id == HierarchyEvent.ANCESTOR_MOVED
- || id == HierarchyEvent.ANCESTOR_RESIZED))
- || ((mask & AWTEvent.HIERARCHY_EVENT_MASK) != 0
- && event instanceof HierarchyEvent
- && id == HierarchyEvent.HIERARCHY_CHANGED)
- || ((mask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0
- && event instanceof InputMethodEvent)
- || ((mask & AWTEvent.INVOCATION_EVENT_MASK) != 0
- && event instanceof InvocationEvent)
- || ((mask & AWTEvent.ITEM_EVENT_MASK) != 0
- && event instanceof ItemEvent)
- || ((mask & AWTEvent.KEY_EVENT_MASK) != 0
- && event instanceof KeyEvent)
- || ((mask & AWTEvent.MOUSE_EVENT_MASK) != 0
- && event instanceof MouseEvent
- && (id == MouseEvent.MOUSE_PRESSED
- || id == MouseEvent.MOUSE_RELEASED
- || id == MouseEvent.MOUSE_CLICKED
- || id == MouseEvent.MOUSE_ENTERED
- || id == MouseEvent.MOUSE_EXITED))
- || ((mask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0
- && event instanceof MouseEvent
- && (id == MouseEvent.MOUSE_MOVED
- || id == MouseEvent.MOUSE_DRAGGED))
- || ((mask & AWTEvent.MOUSE_WHEEL_EVENT_MASK) != 0
- && event instanceof MouseWheelEvent)
- || ((mask & AWTEvent.PAINT_EVENT_MASK) != 0
- && event instanceof PaintEvent)
- || ((mask & AWTEvent.TEXT_EVENT_MASK) != 0
- && event instanceof TextEvent)
- || ((mask & AWTEvent.WINDOW_EVENT_MASK) != 0
- && event instanceof WindowEvent
- && (id == WindowEvent.WINDOW_OPENED
- || id == WindowEvent.WINDOW_CLOSING
- || id == WindowEvent.WINDOW_CLOSED
- || id == WindowEvent.WINDOW_ICONIFIED
- || id == WindowEvent.WINDOW_DEICONIFIED
- || id == WindowEvent.WINDOW_ACTIVATED
- || id == WindowEvent.WINDOW_DEACTIVATED))
- || ((mask & AWTEvent.WINDOW_FOCUS_EVENT_MASK) != 0
- && event instanceof WindowEvent
- && (id == WindowEvent.WINDOW_GAINED_FOCUS
- || id == WindowEvent.WINDOW_LOST_FOCUS))
- || ((mask & AWTEvent.WINDOW_STATE_EVENT_MASK) != 0
- && event instanceof WindowEvent
- && id == WindowEvent.WINDOW_STATE_CHANGED))
- ((AWTEventListener) getListener()).eventDispatched(event);
- }
-
- /**
- * This returns the event mask associated with this listener.
- *
- * @return the event mask
- */
- public long getEventMask()
- {
- return mask;
- }
-} // class AWTEventListenerProxy
diff --git a/libjava/java/awt/event/ActionEvent.java b/libjava/java/awt/event/ActionEvent.java
deleted file mode 100644
index 4bce7d45ce0..00000000000
--- a/libjava/java/awt/event/ActionEvent.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/* ActionEvent.java -- an action has been triggered
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.AWTEvent;
-import java.awt.EventQueue;
-
-/**
- * This event is generated when an action on a component (such as a
- * button press) occurs.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ActionListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class ActionEvent extends AWTEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -7671078796273832149L;
-
- /** Bit mask indicating the shift key was pressed. */
- public static final int SHIFT_MASK = InputEvent.SHIFT_MASK;
-
- /** Bit mask indicating the control key was pressed. */
- public static final int CTRL_MASK = InputEvent.CTRL_MASK;
-
- /** Bit mask indicating the that meta key was pressed. */
- public static final int META_MASK = InputEvent.META_MASK;
-
- /** Bit mask indicating that the alt key was pressed. */
- public static final int ALT_MASK = InputEvent.ALT_MASK;
-
- /** The first id number in the range of action id's. */
- public static final int ACTION_FIRST = 1001;
-
- /** The last id number in the range of action id's. */
- public static final int ACTION_LAST = 1001;
-
- /** An event id indicating that an action has occurred. */
- public static final int ACTION_PERFORMED = 1001;
-
- /**
- * A nonlocalized string that gives more specific details of the event cause.
- *
- * @see #getActionCommand()
- * @serial the command for this event
- */
- private final String actionCommand;
-
- /**
- * The bitmask of the modifiers that were pressed during the action.
- *
- * @see #getModifiers()
- * @serial modifiers for this event
- */
- private final int modifiers;
-
- /**
- * The timestamp of this event; usually the same as the underlying input
- * event.
- *
- * @see #getWhen()
- * @serial the timestamp of the event
- * @since 1.4
- */
- private final long when;
-
- /**
- * Initializes a new instance of <code>ActionEvent</code> with the
- * specified source, id, and command. Note that an invalid id leads to
- * unspecified results.
- *
- * @param source the event source
- * @param id the event id
- * @param command the command string for this action
- * @throws IllegalArgumentException if source is null
- */
- public ActionEvent(Object source, int id, String command)
- {
- this(source, id, command, EventQueue.getMostRecentEventTime(), 0);
- }
-
- /**
- * Initializes a new instance of <code>ActionEvent</code> with the
- * specified source, id, command, and modifiers. Note that an invalid id
- * leads to unspecified results.
- *
- * @param source the event source
- * @param id the event id
- * @param command the command string for this action
- * @param modifiers the bitwise or of modifier keys down during the action
- * @throws IllegalArgumentException if source is null
- */
- public ActionEvent(Object source, int id, String command, int modifiers)
- {
- this(source, id, command, EventQueue.getMostRecentEventTime(), modifiers);
- }
-
- /**
- * Initializes a new instance of <code>ActionEvent</code> with the
- * specified source, id, command, and modifiers, and timestamp. Note that
- * an invalid id leads to unspecified results.
- *
- * @param source the event source
- * @param id the event id
- * @param command the command string for this action
- * @param when the timestamp of the event
- * @param modifiers the bitwise or of modifier keys down during the action
- * @throws IllegalArgumentException if source is null
- * @since 1.4
- */
- public ActionEvent(Object source, int id, String command, long when,
- int modifiers)
- {
- super(source, id);
- actionCommand = command;
- this.when = when;
- this.modifiers = modifiers;
- }
-
- /**
- * Returns the command string associated with this action.
- *
- * @return the command string associated with this action
- */
- public String getActionCommand()
- {
- return actionCommand;
- }
-
- /**
- * Gets the timestamp of when this action took place. Usually, this
- * corresponds to the timestamp of the underlying InputEvent.
- *
- * @return the timestamp of this action
- * @since 1.4
- */
- public long getWhen()
- {
- return when;
- }
-
- /**
- * Returns the keys held down during the action. This value will be a
- * combination of the bit mask constants defined in this class, or 0 if no
- * modifiers were pressed.
- *
- * @return the modifier bits
- */
- public int getModifiers()
- {
- return modifiers;
- }
-
- /**
- * Returns a string that identifies the action event. This is in the format
- * <code>"ACTION_PERFORMED,cmd=" + getActionCommand() + ",when=" + getWhen()
- * + ",modifiers=" + &lt;modifier string&gt;</code>, where the modifier
- * string is in the order "Meta", "Ctrl", "Alt", "Shift", "Alt Graph", and
- * "Button1", separated by '+', according to the bits set in getModifiers().
- *
- * @return a string identifying the event
- */
- public String paramString()
- {
- StringBuffer s = new StringBuffer(id == ACTION_PERFORMED
- ? "ACTION_PERFORMED,cmd="
- : "unknown type,cmd=");
- s.append(actionCommand).append(",when=").append(when).append(",modifiers");
- int len = s.length();
- s.setLength(len + 1);
- if ((modifiers & META_MASK) != 0)
- s.append("+Meta");
- if ((modifiers & CTRL_MASK) != 0)
- s.append("+Ctrl");
- if ((modifiers & ALT_MASK) != 0)
- s.append("+Alt");
- if ((modifiers & SHIFT_MASK) != 0)
- s.append("+Shift");
- if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0)
- s.append("+Alt Graph");
- if ((modifiers & InputEvent.BUTTON1_MASK) != 0)
- s.append("+Button1");
- s.setCharAt(len, '=');
- return s.toString();
- }
-} // class ActionEvent
diff --git a/libjava/java/awt/event/ActionListener.java b/libjava/java/awt/event/ActionListener.java
deleted file mode 100644
index 4c302cca310..00000000000
--- a/libjava/java/awt/event/ActionListener.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ActionListener.java -- listens for action events
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that listen for action events.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ActionEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface ActionListener extends EventListener
-{
- /**
- * This method is invoked when an action occurs.
- *
- * @param event the <code>ActionEvent</code> that occurred
- */
- void actionPerformed(ActionEvent event);
-}
diff --git a/libjava/java/awt/event/AdjustmentEvent.java b/libjava/java/awt/event/AdjustmentEvent.java
deleted file mode 100644
index 867c577d356..00000000000
--- a/libjava/java/awt/event/AdjustmentEvent.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/* AdjustmentEvent.java -- an adjustable value was changed
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.AWTEvent;
-import java.awt.Adjustable;
-
-/**
- * This class represents an event that is generated when an adjustable
- * value is changed.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Adjustable
- * @see AdjustmentListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class AdjustmentEvent extends AWTEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 5700290645205279921L;
-
- /** This is the first id in the range of ids used by adjustment events. */
- public static final int ADJUSTMENT_FIRST = 601;
-
- /** This is the last id in the range of ids used by adjustment events. */
- public static final int ADJUSTMENT_LAST = 601;
-
- /** This is the id indicating an adjustment value changed. */
- public static final int ADJUSTMENT_VALUE_CHANGED = 601;
-
- /** Adjustment type for unit increments. */
- public static final int UNIT_INCREMENT = 1;
-
- /** Adjustment type for unit decrements. */
- public static final int UNIT_DECREMENT = 2;
-
- /** Adjustment type for block decrements. */
- public static final int BLOCK_DECREMENT = 3;
-
- /** Adjustment type for block increments. */
- public static final int BLOCK_INCREMENT = 4;
-
- /** Adjustment type for tracking adjustments. */
- public static final int TRACK = 5;
-
- /**
- * The adjustable object that caused the event.
- *
- * @see #getAdjustable()
- * @serial the cause
- */
- private final Adjustable adjustable;
-
- /**
- * The type of adjustment, one of {@link #UNIT_INCREMENT},
- * {@link #UNIT_DECREMENT}, {@link #BLOCK_INCREMENT},
- * {@link #BLOCK_DECREMENT}, or {@link #TRACK}.
- *
- * @see #getAdjustmentType()
- * @serial the adjustment type
- */
- private final int adjustmentType;
-
- /**
- * The new value of the adjustable; it should be in the range of the
- * adjustable cause.
- *
- * @see #getValue()
- * @serial the adjustment value
- */
- private final int value;
-
- /**
- * True if this is in a series of multiple adjustment events.
- *
- * @see #getValueIsAdjusting()
- * @serial true if this is not the last adjustment
- * @since 1.4
- */
- private final boolean isAdjusting;
-
- /**
- * Initializes an instance of <code>AdjustmentEvent</code> with the
- * specified source, id, type, and value. Note that an invalid id leads to
- * unspecified results.
- *
- * @param source the source of the event
- * @param id the event id
- * @param type the event type, one of the constants of this class
- * @param value the value of the adjustment
- * @throws IllegalArgumentException if source is null
- */
- public AdjustmentEvent(Adjustable source, int id, int type, int value)
- {
- this(source, id, type, value, false);
- }
-
- /**
- * Initializes an instance of <code>AdjustmentEvent</code> with the
- * specified source, id, type, and value. Note that an invalid id leads to
- * unspecified results.
- *
- * @param source the source of the event
- * @param id the event id
- * @param type the event type, one of the constants of this class
- * @param value the value of the adjustment
- * @param isAdjusting if this event is in a chain of adjustments
- * @throws IllegalArgumentException if source is null
- * @since 1.4
- */
- public AdjustmentEvent(Adjustable source, int id, int type, int value,
- boolean isAdjusting)
- {
- super(source, id);
- this.adjustmentType = type;
- this.value = value;
- adjustable = source;
- this.isAdjusting = isAdjusting;
- }
-
- /**
- * This method returns the source of the event as an <code>Adjustable</code>.
- *
- * @return the <code>Adjustable</code> source of the event
- */
- public Adjustable getAdjustable()
- {
- return adjustable;
- }
-
- /**
- * Returns the new value of the adjustable object.
- *
- * @return the value of the event
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * Returns the type of the event, which will be one of
- * {@link #UNIT_INCREMENT}, {@link #UNIT_DECREMENT},
- * {@link #BLOCK_INCREMENT}, {@link #BLOCK_DECREMENT}, or {@link #TRACK}.
- *
- * @return the type of the event
- */
- public int getAdjustmentType()
- {
- return adjustmentType;
- }
-
- /**
- * Test if this event is part of a sequence of multiple adjustements.
- *
- * @return true if this is not the last adjustment
- * @since 1.4
- */
- public boolean getValueIsAdjusting()
- {
- return isAdjusting;
- }
-
- /**
- * Returns a string that describes the event. This is in the format
- * <code>"ADJUSTMENT_VALUE_CHANGED,adjType=" + &lt;type&gt; + ",value="
- * + getValue() + ",isAdjusting=" + getValueIsAdjusting()</code>, where
- * type is the name of the constant returned by getAdjustmentType().
- *
- * @return a string that describes the event
- */
- public String paramString()
- {
- return (id == ADJUSTMENT_VALUE_CHANGED
- ? "ADJUSTMENT_VALUE_CHANGED,adjType=" : "unknown type,adjType=")
- + (adjustmentType == UNIT_INCREMENT ? "UNIT_INCREMENT,value="
- : adjustmentType == UNIT_DECREMENT ? "UNIT_DECREMENT,value="
- : adjustmentType == BLOCK_INCREMENT ? "BLOCK_INCREMENT,value="
- : adjustmentType == BLOCK_DECREMENT ? "BLOCK_DECREMENT,value="
- : adjustmentType == TRACK ? "TRACK,value=" : "unknown type,value=")
- + value + ",isAdjusting=" + isAdjusting;
- }
-} // class AdjustmentEvent
diff --git a/libjava/java/awt/event/AdjustmentListener.java b/libjava/java/awt/event/AdjustmentListener.java
deleted file mode 100644
index 1eb2e3bcfa1..00000000000
--- a/libjava/java/awt/event/AdjustmentListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* AdjustmentListener.java -- listen for adjustment events
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * Interface for classes that listen for adjustment events.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public interface AdjustmentListener extends EventListener
-{
- /**
- * This method is called when an adjustable value changes.
- *
- * @param event the <code>AdjustmentEvent</code> that occurred
- */
- void adjustmentValueChanged(AdjustmentEvent event);
-} // interface AdjustmentListener
diff --git a/libjava/java/awt/event/ComponentAdapter.java b/libjava/java/awt/event/ComponentAdapter.java
deleted file mode 100644
index 6b4893f0fc2..00000000000
--- a/libjava/java/awt/event/ComponentAdapter.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ComponentAdapter.java -- convenience class for writing component listeners
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-/**
- * This class implements <code>ComponentListener</code> and implements
- * all methods with empty bodies. This allows a listener interested in
- * implementing only a subset of the <code>ComponentListener</code>
- * interface to extend this class and override only the desired methods.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ComponentEvent
- * @see ComponentListener
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class ComponentAdapter implements ComponentListener
-{
- /**
- * Do nothing default constructor for subclasses.
- */
- public ComponentAdapter()
- {
- }
-
- /**
- * Implements this method from the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void componentResized(ComponentEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void componentMoved(ComponentEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void componentShown(ComponentEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void componentHidden(ComponentEvent event)
- {
- }
-} // class ComponentAdapter
diff --git a/libjava/java/awt/event/ComponentEvent.java b/libjava/java/awt/event/ComponentEvent.java
deleted file mode 100644
index ba9c2a5b3f2..00000000000
--- a/libjava/java/awt/event/ComponentEvent.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* ComponentEvent.java -- notification of events for components
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.AWTEvent;
-import java.awt.Component;
-
-/**
- * This class is for events generated when a component is moved, resized,
- * hidden, or shown. These events normally do not need to be handled by the
- * application, since the AWT system automatically takes care of them. This
- * is also the superclass for other events on components, but
- * ComponentListeners ignore such subclasses.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ComponentAdapter
- * @see ComponentListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class ComponentEvent extends AWTEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 8101406823902992965L;
-
- /** This is the first id in the range of ids used by this class. */
- public static final int COMPONENT_FIRST = 100;
-
- /** This is the last id in the range of ids used by this class. */
- public static final int COMPONENT_LAST = 103;
-
- /** This id indicates that a component was moved. */
- public static final int COMPONENT_MOVED = 100;
-
- /** This id indicates that a component was resized. */
- public static final int COMPONENT_RESIZED = 101;
-
- /** This id indicates that a component was shown. */
- public static final int COMPONENT_SHOWN = 102;
-
- /** This id indicates that a component was hidden. */
- public static final int COMPONENT_HIDDEN = 103;
-
- /**
- * Initializes a new instance of <code>ComponentEvent</code> with the
- * specified source and id. Note that an invalid id leads to unspecified
- * results.
- *
- * @param source the source of the event
- * @param id the event id
- * @throws IllegalArgumentException if source is null
- */
- public ComponentEvent(Component source, int id)
- {
- super(source, id);
- }
-
- /**
- * This method returns the event source as a <code>Component</code>. If the
- * source has subsequently been modified to a non-Component, this returns
- * null.
- *
- * @return the event source as a <code>Component</code>, or null
- */
- public Component getComponent()
- {
- return source instanceof Component ? (Component) source : null;
- }
-
- /**
- * This method returns a string identifying this event. This is the field
- * name of the id type, and for COMPONENT_MOVED or COMPONENT_RESIZED, the
- * new bounding box of the component.
- *
- * @return a string identifying this event
- */
- public String paramString()
- {
- // Unlike Sun, we don't throw NullPointerException or ClassCastException
- // when source was illegally changed.
- switch (id)
- {
- case COMPONENT_MOVED:
- return "COMPONENT_MOVED "
- + (source instanceof Component
- ? ((Component) source).getBounds() : (Object) "");
- case COMPONENT_RESIZED:
- return "COMPONENT_RESIZED "
- + (source instanceof Component
- ? ((Component) source).getBounds() : (Object) "");
- case COMPONENT_SHOWN:
- return "COMPONENT_SHOWN";
- case COMPONENT_HIDDEN:
- return "COMPONENT_HIDDEN";
- default:
- return "unknown type";
- }
- }
-} // class ComponentEvent
diff --git a/libjava/java/awt/event/ComponentListener.java b/libjava/java/awt/event/ComponentListener.java
deleted file mode 100644
index b43faaed7ff..00000000000
--- a/libjava/java/awt/event/ComponentListener.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ComponentListener.java -- receive all events for a component
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that receive all events from a component.
- * Normally it is not necessary to process these events since the AWT
- * handles them internally, taking all appropriate actions. To watch a subset
- * of these events, use a ComponentAdapter.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ComponentAdapter
- * @see ComponentEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface ComponentListener extends EventListener
-{
- /**
- * This method is called when the component is resized.
- *
- * @param event the <code>ComponentEvent</code> indicating the resize
- */
- void componentResized(ComponentEvent event);
-
- /**
- * This method is called when the component is moved.
- *
- * @param event the <code>ComponentEvent</code> indicating the move
- */
- void componentMoved(ComponentEvent event);
-
- /**
- * This method is called when the component is made visible.
- *
- * @param event the <code>ComponentEvent</code> indicating the visibility
- */
- void componentShown(ComponentEvent event);
-
- /**
- * This method is called when the component is hidden.
- *
- * @param event the <code>ComponentEvent</code> indicating the visibility
- */
- void componentHidden(ComponentEvent event);
-} // interface ComponentListener
diff --git a/libjava/java/awt/event/ContainerAdapter.java b/libjava/java/awt/event/ContainerAdapter.java
deleted file mode 100644
index c847adfa211..00000000000
--- a/libjava/java/awt/event/ContainerAdapter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ContainerAdapter.java -- convenience class for writing container listeners
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-/**
- * This class implements <code>ContainerListener</code> and implements
- * all methods with empty bodies. This allows a listener interested in
- * implementing only a subset of the <code>ContainerListener</code>
- * interface to extend this class and override only the desired methods.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ContainerEvent
- * @see ContainerListener
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class ContainerAdapter implements ContainerListener
-{
- /**
- * Do nothing default constructor for subclasses.
- */
- public ContainerAdapter()
- {
- }
-
- /**
- * Implements this method from the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void componentAdded(ContainerEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void componentRemoved(ContainerEvent event)
- {
- }
-} // class ContainerAdapter
diff --git a/libjava/java/awt/event/ContainerEvent.java b/libjava/java/awt/event/ContainerEvent.java
deleted file mode 100644
index 3c401fe1a04..00000000000
--- a/libjava/java/awt/event/ContainerEvent.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/* ContainerEvent.java -- components added/removed from a container
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.Component;
-import java.awt.Container;
-
-/**
- * This event is generated when a component is added or removed from a
- * container. Applications do not ordinarily need to handle these events
- * since the AWT system handles them internally.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ContainerAdapter
- * @see ContainerListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class ContainerEvent extends ComponentEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -4114942250539772041L;
-
- /** This is the first id in the id range used by this class. */
- public static final int CONTAINER_FIRST = 300;
-
- /** This is the last id in the id range used by this class. */
- public static final int CONTAINER_LAST = 301;
-
- /** This id indicates a component was added to the container. */
- public static final int COMPONENT_ADDED = 300;
-
- /** This id indicates a component was removed from the container. */
- public static final int COMPONENT_REMOVED = 301;
-
- /**
- * The non-null child component that was added or removed.
- *
- * @serial the child component that changed
- */
- private final Component child;
-
- /**
- * Initializes a new instance of <code>ContainerEvent</code> with the
- * specified source and id. Additionally, the affected child component
- * is also passed as a parameter. Note that an invalid id leads to
- * unspecified results.
- *
- * @param source the source container of the event
- * @param id the event id
- * @param child the child component affected by this event
- * @throws IllegalArgumentException if source is null
- */
- public ContainerEvent(Component source, int id, Component child)
- {
- super(source, id);
- this.child = child;
- }
-
- /**
- * Returns the source of this event as a <code>Container</code>.
- *
- * @return the source of the event
- * @throws ClassCastException if the source is changed to a non-Container
- */
- public Container getContainer()
- {
- return (Container) source;
- }
-
- /**
- * This method returns the child object that was added or removed from
- * the container.
- *
- * @return the child object added or removed
- */
- public Component getChild()
- {
- return child;
- }
-
- /**
- * This method returns a string identifying this event. It is formatted as:
- * <code>(getID() == COMPONENT_ADDED ? "COMPONENT_ADDED"
- * : "COMPONENT_REMOVED") + ",child=" + getChild().getName()</code>.
- *
- * @return a string identifying this event
- */
- public String paramString()
- {
- // Unlike Sun, we don't throw NullPointerException if child is illegally
- // null.
- return (id == COMPONENT_ADDED ? "COMPONENT_ADDED,child="
- : id == COMPONENT_REMOVED ? "COMPONENT_REMOVED,child="
- : "unknown type,child=") + (child == null ? "" : child.getName());
- }
-} // class ContainerEvent
diff --git a/libjava/java/awt/event/ContainerListener.java b/libjava/java/awt/event/ContainerListener.java
deleted file mode 100644
index b37d4340839..00000000000
--- a/libjava/java/awt/event/ContainerListener.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ContainerListener.java -- listen for container events
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to listen for all events from
- * container objects. This is normally not necessary since the AWT system
- * listens for and processes these events. To watch a subset of these events,
- * use a ContainerAdapter.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ContainerAdapter
- * @see ContainerEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface ContainerListener extends EventListener
-{
- /**
- * This method is called when a component is added to the container.
- *
- * @param event the <code>ContainerEvent</code> indicating component addition
- */
- void componentAdded(ContainerEvent event);
-
- /**
- * This method is called when a component is removed from the container.
- *
- * @param event the <code>ContainerEvent</code> indicating component removal
- */
- void componentRemoved(ContainerEvent event);
-} // interface ContainerListener
diff --git a/libjava/java/awt/event/FocusAdapter.java b/libjava/java/awt/event/FocusAdapter.java
deleted file mode 100644
index fb0532a3a91..00000000000
--- a/libjava/java/awt/event/FocusAdapter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* FocusAdapter.java -- convenience class for writing focus listeners
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-/**
- * This class implements <code>FocusListener</code> and implements all
- * methods with empty bodies. This allows a listener interested in
- * implementing only a subset of the <code>FocusListener</code> interface to
- * extend this class and override only the desired methods.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see FocusEvent
- * @see FocusListener
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class FocusAdapter implements FocusListener
-{
- /**
- * Do nothing default constructor for subclasses.
- */
- public FocusAdapter()
- {
- }
-
- /**
- * Implements this method from the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void focusGained(FocusEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void focusLost(FocusEvent event)
- {
- }
-} // class FocusAdapter
diff --git a/libjava/java/awt/event/FocusEvent.java b/libjava/java/awt/event/FocusEvent.java
deleted file mode 100644
index a44284aea75..00000000000
--- a/libjava/java/awt/event/FocusEvent.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/* FocusEvent.java -- generated for a focus change
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.Component;
-
-/**
- * This class represents an event generated when a focus change occurs for a
- * component. There are both temporary changes, such as when focus is stolen
- * during a sroll then returned, and permanent changes, such as when the user
- * TABs through focusable components.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see FocusAdapter
- * @see FocusListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class FocusEvent extends ComponentEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 523753786457416396L;
-
- /** This is the first id in the range of ids used by this class. */
- public static final int FOCUS_FIRST = 1004;
-
- /** This is the last id in the range of ids used by this class. */
- public static final int FOCUS_LAST = 1005;
-
- /** This is the event id for a focus gained event. */
- public static final int FOCUS_GAINED = 1004;
-
- /** This is the event id for a focus lost event. */
- public static final int FOCUS_LOST = 1005;
-
- /**
- * Indicates whether or not the focus change is temporary.
- *
- * @see #isTemporary()
- * @serial true if the focus change is temporary
- */
- private final boolean temporary;
-
- /**
- * The other component which is giving up or stealing focus from this
- * component, if known.
- *
- * @see #getOppositeComponent()
- * @serial the component with the opposite focus event, or null
- * @since 1.4
- */
- private final Component opposite;
-
- /**
- * Initializes a new instance of <code>FocusEvent</code> with the
- * specified source, id, temporary status, and opposite counterpart. Note
- * that an invalid id leads to unspecified results.
- *
- * @param source the component that is gaining or losing focus
- * @param id the event id
- * @param temporary true if the focus change is temporary
- * @param opposite the component receiving the opposite focus event, or null
- * @throws IllegalArgumentException if source is null
- */
- public FocusEvent(Component source, int id, boolean temporary,
- Component opposite)
- {
- super(source, id);
- this.temporary = temporary;
- this.opposite = opposite;
- }
-
- /**
- * Initializes a new instance of <code>FocusEvent</code> with the
- * specified source, id, and temporary status. Note that an invalid id
- * leads to unspecified results.
- *
- * @param source the component that is gaining or losing focus
- * @param id the event id
- * @param temporary true if the focus change is temporary
- * @throws IllegalArgumentException if source is null
- */
- public FocusEvent(Component source, int id, boolean temporary)
- {
- this(source, id, temporary, null);
- }
-
- /**
- * Initializes a new instance of <code>FocusEvent</code> with the
- * specified source and id. Note that an invalid id leads to unspecified
- * results.
- *
- * @param source the component that is gaining or losing focus
- * @param id the event id
- * @throws IllegalArgumentException if source is null
- */
- public FocusEvent(Component source, int id)
- {
- this(source, id, false, null);
- }
-
- /**
- * This method tests whether or not the focus change is temporary or
- * permanent.
- *
- * @return true if the focus change is temporary
- */
- public boolean isTemporary()
- {
- return temporary;
- }
-
- /**
- * Returns the component which received the opposite focus event. If this
- * component gained focus, the opposite lost focus; likewise if this
- * component is giving up focus, the opposite is gaining it. If this
- * information is unknown, perhaps because the opposite is a native
- * application, this returns null.
- *
- * @return the component with the focus opposite, or null
- * @since 1.4
- */
- public Component getOppositeComponent()
- {
- return opposite;
- }
-
- /**
- * Returns a string identifying this event. This is formatted as:
- * <code>(getID() == FOCUS_GAINED ? "FOCUS_GAINED" : "FOCUS_LOST")
- * + (isTemporary() ? ",temporary," : ",permanent,") + "opposite="
- * + getOppositeComponent()</code>.
- *
- * @return a string identifying this event
- */
- public String paramString()
- {
- return (id == FOCUS_GAINED ? "FOCUS_GAINED"
- : id == FOCUS_LOST ? "FOCUS_LOST" : "unknown type")
- + (temporary ? ",temporary,opposite=" : ",permanent,opposite=")
- + opposite;
- }
-} // class FocusEvent
diff --git a/libjava/java/awt/event/FocusListener.java b/libjava/java/awt/event/FocusListener.java
deleted file mode 100644
index 1f7201825a7..00000000000
--- a/libjava/java/awt/event/FocusListener.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* FocusListener.java -- listen for focus changes
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to be notified of changes of
- * keyboard focus for a component. To watch a subset of these events, use a
- * FocusAdapter.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see FocusAdapter
- * @see FocusEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface FocusListener extends EventListener
-{
- /**
- * This method is called when a component gains the keyboard focus.
- *
- * @param event the <code>FocusEvent</code> indicating that focus was gained
- */
- void focusGained(FocusEvent event);
-
- /**
- * This method is invoked when a component loses the keyboard focus.
- *
- * @param event the <code>FocusEvent</code> indicating that focus was lost
- */
- void focusLost(FocusEvent event);
-} // interface FocusListener
diff --git a/libjava/java/awt/event/HierarchyBoundsAdapter.java b/libjava/java/awt/event/HierarchyBoundsAdapter.java
deleted file mode 100644
index 340cf01edf1..00000000000
--- a/libjava/java/awt/event/HierarchyBoundsAdapter.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* HierarchyBoundsAdapter.java -- convenience class for writing listeners
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-/**
- * This class implements <code>HierarchyBoundsListener</code> and implements
- * all methods with empty bodies. This allows a listener interested in
- * implementing only a subset of the <code>HierarchyBoundsListener</code>
- * interface to extend this class and override only the desired methods.
- *
- * @author Bryce McKinlay
- * @see HierarchyBoundsListener
- * @see HierarchyEvent
- * @since 1.3
- * @status updated to 1.4
- */
-public abstract class HierarchyBoundsAdapter implements HierarchyBoundsListener
-{
- /**
- * Do nothing default constructor for subclasses.
- */
- public HierarchyBoundsAdapter()
- {
- }
-
- /**
- * Implements this method from the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void ancestorMoved(HierarchyEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void ancestorResized(HierarchyEvent event)
- {
- }
-}
diff --git a/libjava/java/awt/event/HierarchyBoundsListener.java b/libjava/java/awt/event/HierarchyBoundsListener.java
deleted file mode 100644
index 689623744e3..00000000000
--- a/libjava/java/awt/event/HierarchyBoundsListener.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* HierarchyBoundsListener.java -- listens to bounds changes of parents
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This listens for changes in an ancestors size or location. Normally it is
- * not necessary to process these events since the AWT handles them
- * internally, taking all appropriate actions. To watch a subset of these
- * events, use a HierarchyBoundsAdapter.
- *
- * @author Bryce McKinlay
- * @see HierarchyBoundsAdapter
- * @see HierarchyEvent
- * @since 1.3
- * @status updated to 1.4
- */
-public interface HierarchyBoundsListener extends EventListener
-{
- /**
- * Called when an ancestor component of the source is moved.
- *
- * @param e the event describing the ancestor's motion
- */
- void ancestorMoved(HierarchyEvent e);
-
- /**
- * Called when an ancestor component is resized.
- *
- * @param e the event describing the ancestor's resizing
- */
- void ancestorResized(HierarchyEvent e);
-} // interface HierarchyBoundsListener
diff --git a/libjava/java/awt/event/HierarchyEvent.java b/libjava/java/awt/event/HierarchyEvent.java
deleted file mode 100644
index e10cefbefcb..00000000000
--- a/libjava/java/awt/event/HierarchyEvent.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/* HierarchyEvent.java -- generated for a change in hierarchy
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.AWTEvent;
-import java.awt.Component;
-import java.awt.Container;
-
-/**
- * This class represents an event generated for an ancestor component which
- * may affect this component. These events normally do not need to be handled
- * by the application, since the AWT system automatically takes care of them.
- *
- * <p>There are two types of hierarchy events. The first type is handled by
- * HierarchyListener, and includes addition or removal of an ancestor, or
- * an ancestor changing its on-screen status (visible and/or displayble). The
- * second type is handled by HierarchyBoundsListener, and includes resizing
- * or moving of an ancestor.
- *
- * @author Bryce McKinlay
- * @see HierarchyListener
- * @see HierarchyBoundsAdapter
- * @see HierarchyBoundsListener
- * @since 1.3
- * @status updated to 1.4
- */
-public class HierarchyEvent extends AWTEvent
-{
- /**
- * Compatible with JDK 1.3+.
- */
- private static final long serialVersionUID = -5337576970038043990L;
-
- /** This is the first id in the range of ids used by this class. */
- public static final int HIERARCHY_FIRST = 1400;
-
- /** This id indicates that the hierarchy tree changed. */
- public static final int HIERARCHY_CHANGED = 1400;
-
- /** This id indicates that an ancestor was moved. */
- public static final int ANCESTOR_MOVED = 1401;
-
- /** This id indicates that an ancestor was resized. */
- public static final int ANCESTOR_RESIZED = 1402;
-
- /** This is the last id in the range of ids used by this class. */
- public static final int HIERARCHY_LAST = 1402;
-
- /** This indicates that the HIERARCHY_CHANGED is a changed parent. */
- public static final int PARENT_CHANGED = 1;
-
- /**
- * This indicates that the HIERARCHY_CHANGED is caused by a change in
- * displayability.
- *
- * @see Component#isDisplayable()
- * @see Component#addNotify()
- * @see Component#removeNotify()
- */
- public static final int DISPLAYABILITY_CHANGED = 2;
-
- /**
- * This indicates that the HIERARCHY_CHANGED is a changed visibility.
- *
- * @see Component#isShowing()
- * @see Component#addNotify()
- * @see Component#removeNotify()
- * @see Component#show()
- * @see Component#hide()
- */
- public static final int SHOWING_CHANGED = 4;
-
- /**
- * The component at the top of the changed hierarchy.
- *
- * @serial the top component changed
- */
- private final Component changed;
-
- /**
- * The parent of this component, either before or after the change depending
- * on the type of change.
- *
- * @serial the parent component changed
- */
- private final Container changedParent;
-
- /**
- * The bitmask of HIERARCHY_CHANGED event types.
- *
- * @serial the change flags
- */
- private final long changeFlags;
-
- /**
- * Initializes a new instance of <code>HierarchyEvent</code> with the
- * specified parameters. Note that an invalid id leads to unspecified
- * results.
- *
- * @param source the component whose hierarchy changed
- * @param id the event id
- * @param changed the top component in the tree of changed hierarchy
- * @param changedParent the updated parent of this object
- * @throws IllegalArgumentException if source is null
- */
- public HierarchyEvent(Component source, int id, Component changed,
- Container changedParent)
- {
- this(source, id, changed, changedParent, 0);
- }
-
- /**
- * Initializes a new instance of <code>HierarchyEvent</code> with the
- * specified parameters. Note that an invalid id leads to unspecified
- * results.
- *
- * @param source the component whose hierarchy changed
- * @param id the event id
- * @param changed the top component in the tree of changed hierarchy
- * @param changedParent the updated parent of this object
- * @param changeFlags the bitmask of specific HIERARCHY_CHANGED events
- * @throws IllegalArgumentException if source is null
- */
- public HierarchyEvent(Component source, int id, Component changed,
- Container changedParent, long changeFlags)
- {
- super(source, id);
- this.changed = changed;
- this.changedParent = changedParent;
- this.changeFlags = changeFlags;
- }
-
- /**
- * This method returns the event source as a <code>Component</code>. If the
- * source has subsequently been modified to a non-Component, this returns
- * null.
- *
- * @return the event source as a <code>Component</code>, or null
- */
- public Component getComponent()
- {
- return source instanceof Component ? (Component) source : null;
- }
-
- /**
- * Returns the component at the top of the hierarchy which changed.
- *
- * @return the top changed component
- */
- public Component getChanged()
- {
- return changed;
- }
-
- /**
- * Returns the parent of the component listed in <code>getChanged()</code>.
- * If the cause of this event was <code>Container.add</code>, this is the
- * new parent; if the cause was <code>Container.remove</code>, this is the
- * old parent; otherwise it is the unchanged parent.
- *
- * @return the parent container of the changed component
- */
- public Container getChangedParent()
- {
- return changedParent;
- }
-
- /**
- * If this is a HIERARCHY_CHANGED event, this returns a bitmask of the
- * types of changes that took place.
- *
- * @return the bitwise or of hierarchy change types, or 0
- * @see #PARENT_CHANGED
- * @see #DISPLAYABILITY_CHANGED
- * @see #SHOWING_CHANGED
- */
- public long getChangeFlags()
- {
- return changeFlags;
- }
-
- /**
- * This method returns a string identifying this event. This is the field
- * name of the id type, followed by a parenthesized listing of the changed
- * component and its parent container. In addition, if the type is
- * HIERARCHY_CHANGED, the flags preceed the changed component, in the
- * order PARENT_CHANGED, DISPLAYABILITY_CHANGED, and SHOWING_CHANGED.
- *
- * @return a string identifying this event
- */
- public String paramString()
- {
- StringBuffer r = new StringBuffer();
- switch (id)
- {
- case HIERARCHY_CHANGED:
- r.append("HIERARCHY_CHANGED (");
- if ((changeFlags & PARENT_CHANGED) != 0)
- r.append("PARENT_CHANGED,");
- if ((changeFlags & DISPLAYABILITY_CHANGED) != 0)
- r.append("DISPLAYABILITY_CHANGED,");
- if ((changeFlags & SHOWING_CHANGED) != 0)
- r.append("SHOWING_CHANGED,");
- break;
- case ANCESTOR_MOVED:
- r.append("ANCESTOR_MOVED (");
- break;
- case ANCESTOR_RESIZED:
- r.append("ANCESTOR_RESIZED (");
- break;
- default:
- return "unknown type";
- }
- r.append(changed).append(',').append(changedParent).append(')');
- return r.toString();
- }
-} // class HierarchyEvent
diff --git a/libjava/java/awt/event/HierarchyListener.java b/libjava/java/awt/event/HierarchyListener.java
deleted file mode 100644
index f90414b866b..00000000000
--- a/libjava/java/awt/event/HierarchyListener.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* HierarchyListener.java -- listens to changes in the component hierarchy
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This listens for changes in the hierarchy tree of components. Normally it is
- * not necessary to process these events since the AWT handles them
- * internally, taking all appropriate actions.
- *
- * @author Bryce McKinlay
- * @see HierarchyEvent
- * @since 1.3
- * @status updated to 1.4
- */
-public interface HierarchyListener extends EventListener
-{
- /**
- * Called when the hierarchy of this component changes. Use
- * <code>getChangeFlags()</code> on the event to see what exactly changed.
- *
- * @param e the event describing the change
- */
- void hierarchyChanged(HierarchyEvent e);
-} // interface HierarchyListener
diff --git a/libjava/java/awt/event/InputEvent.java b/libjava/java/awt/event/InputEvent.java
deleted file mode 100644
index 8f9aed611f8..00000000000
--- a/libjava/java/awt/event/InputEvent.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/* InputEvent.java -- common superclass of component input events
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import gnu.java.awt.EventModifier;
-
-import java.awt.Component;
-
-/**
- * This is the common superclass for all component input classes. These are
- * passed to listeners before the component, so that listeners can consume
- * the event before it does its default behavior.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see KeyEvent
- * @see KeyAdapter
- * @see MouseEvent
- * @see MouseAdapter
- * @see MouseMotionAdapter
- * @see MouseWheelEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class InputEvent extends ComponentEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -2482525981698309786L;
-
- /**
- * This is the bit mask which indicates the shift key is down. It is
- * recommended that SHIFT_DOWN_MASK be used instead.
- *
- * @see #SHIFT_DOWN_MASK
- */
- public static final int SHIFT_MASK = 1;
-
- /**
- * This is the bit mask which indicates the control key is down. It is
- * recommended that CTRL_DOWN_MASK be used instead.
- *
- * @see #CTRL_DOWN_MASK
- */
- public static final int CTRL_MASK = 2;
-
- /**
- * This is the bit mask which indicates the meta key is down. It is
- * recommended that META_DOWN_MASK be used instead.
- *
- * @see #META_DOWN_MASK
- */
- public static final int META_MASK = 4;
-
- /**
- * This is the bit mask which indicates the alt key is down. It is
- * recommended that ALT_DOWN_MASK be used instead.
- *
- * @see #ALT_DOWN_MASK
- */
- public static final int ALT_MASK = 8;
-
- /**
- * This is the bit mask which indicates the alt-graph modifier is in effect.
- * It is recommended that ALT_GRAPH_DOWN_MASK be used instead.
- *
- * @see #ALT_GRAPH_DOWN_MASK
- */
- public static final int ALT_GRAPH_MASK = 0x20;
-
- /**
- * This bit mask indicates mouse button one is down. It is recommended that
- * BUTTON1_DOWN_MASK be used instead.
- *
- * @see #BUTTON1_DOWN_MASK
- */
- public static final int BUTTON1_MASK = 0x10;
-
- /**
- * This bit mask indicates mouse button two is down. It is recommended that
- * BUTTON2_DOWN_MASK be used instead.
- *
- * @see #BUTTON2_DOWN_MASK
- */
- public static final int BUTTON2_MASK = 8;
-
- /**
- * This bit mask indicates mouse button three is down. It is recommended
- * that BUTTON3_DOWN_MASK be used instead.
- *
- * @see #BUTTON3_DOWN_MASK
- */
- public static final int BUTTON3_MASK = 4;
-
- /**
- * The SHIFT key extended modifier.
- *
- * @since 1.4
- */
- public static final int SHIFT_DOWN_MASK = 0x0040;
-
- /**
- * The CTRL key extended modifier.
- *
- * @since 1.4
- */
- public static final int CTRL_DOWN_MASK = 0x0080;
-
- /**
- * The META key extended modifier.
- *
- * @since 1.4
- */
- public static final int META_DOWN_MASK = 0x0100;
-
- /**
- * The ALT key extended modifier.
- *
- * @since 1.4
- */
- public static final int ALT_DOWN_MASK = 0x0200;
-
- /**
- * The mouse button1 key extended modifier.
- *
- * @since 1.4
- */
- public static final int BUTTON1_DOWN_MASK = 0x0400;
-
- /**
- * The mouse button2 extended modifier.
- *
- * @since 1.4
- */
- public static final int BUTTON2_DOWN_MASK = 0x0800;
-
- /**
- * The mouse button3 extended modifier.
- *
- * @since 1.4
- */
- public static final int BUTTON3_DOWN_MASK = 0x1000;
-
- /**
- * The ALT_GRAPH key extended modifier.
- *
- * @since 1.4
- */
- public static final int ALT_GRAPH_DOWN_MASK = 0x2000;
-
- /** The mask to convert new to old, package visible for use in subclasses. */
- static final int CONVERT_MASK
- = EventModifier.NEW_MASK & ~(BUTTON2_DOWN_MASK | BUTTON3_DOWN_MASK);
-
- /**
- * The timestamp when this event occurred.
- *
- * @see #getWhen()
- * @serial the timestamp
- */
- private final long when;
-
- /**
- * The modifiers in effect for this event. Package visible for use by
- * subclasses. The old style (bitmask 0x3f) should not be mixed with the
- * new style (bitmasks 0xffffffc0).
- *
- * @see #getModifiers()
- * @see MouseEvent
- * @serial the modifier state, stored in the new style
- */
- int modifiers;
-
- /**
- * Initializes a new instance of <code>InputEvent</code> with the specified
- * source, id, timestamp, and modifiers. Note that an invalid id leads to
- * unspecified results.
- *
- * @param source the source of the event
- * @param id the event id
- * @param when the timestamp when the event occurred
- * @param modifiers the modifiers in effect for this event, old or new style
- * @throws IllegalArgumentException if source is null
- */
- InputEvent(Component source, int id, long when, int modifiers)
- {
- super(source, id);
- this.when = when;
- this.modifiers = EventModifier.extend(modifiers);
- }
-
- /**
- * This method tests whether or not the shift key was down during the event.
- *
- * @return true if the shift key is down
- */
- public boolean isShiftDown()
- {
- return (modifiers & SHIFT_DOWN_MASK) != 0;
- }
-
- /**
- * This method tests whether or not the control key was down during the
- * event.
- *
- * @return true if the control key is down
- */
- public boolean isControlDown()
- {
- return (modifiers & CTRL_DOWN_MASK) != 0;
- }
-
- /**
- * This method tests whether or not the meta key was down during the event.
- *
- * @return true if the meta key is down
- */
- public boolean isMetaDown()
- {
- return (modifiers & META_DOWN_MASK) != 0;
- }
-
- /**
- * This method tests whether or not the alt key was down during the event.
- *
- * @return true if the alt key is down
- */
- public boolean isAltDown()
- {
- return (modifiers & ALT_DOWN_MASK) != 0;
- }
-
- /**
- * This method tests whether or not the alt-graph modifier was in effect
- * during the event.
- *
- * @return true if the alt-graph modifier is down
- */
- public boolean isAltGraphDown()
- {
- return (modifiers & ALT_GRAPH_DOWN_MASK) != 0;
- }
-
- /**
- * This method returns the timestamp when this event occurred.
- *
- * @return the timestamp when this event occurred
- */
- public long getWhen()
- {
- return when;
- }
-
- /**
- * This method returns the old-style modifiers in effect for this event.
- * Note that this is ambiguous between button2 and alt, and between
- * button3 and meta. Also, code which generated these modifiers tends to
- * only list the modifier that just changed, even if others were down at
- * the time. Consider using getModifiersEx instead. This will be a union
- * of the bit masks defined in this class that are applicable to the event.
- *
- * @return the modifiers in effect for this event
- * @see #getModifiersEx()
- */
- public int getModifiers()
- {
- return EventModifier.revert(modifiers);
- }
-
- /**
- * Returns the extended modifiers (new-style) for this event. This represents
- * the state of all modal keys and mouse buttons at the time of the event,
- * and does not suffer from the problems mentioned in getModifiers.
- *
- * <p>For an example of checking multiple modifiers, this code will return
- * true only if SHIFT and BUTTON1 were pressed and CTRL was not:
- * <pre>
- * int onmask = InputEvent.SHIFT_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK;
- * int offmask = InputEvent.CTRL_DOWN_MASK;
- * return (event.getModifiersEx() & (onmask | offmask)) == onmask;
- * </pre>
- *
- * @return the bitwise or of all modifiers pressed during the event
- * @since 1.4
- */
- public int getModifiersEx()
- {
- return modifiers;
- }
-
- /**
- * Consumes this event. A consumed event is not processed further by the AWT
- * system.
- */
- public void consume()
- {
- consumed = true;
- }
-
- /**
- * This method tests whether or not this event has been consumed.
- *
- * @return true if this event has been consumed
- */
- public boolean isConsumed()
- {
- return consumed;
- }
-
- /**
- * Convert the extended modifier bitmask into a String, such as "Shift" or
- * "Ctrl+Button1".
- *
- * XXX Sun claims this can be localized via the awt.properties file - how
- * do we implement that?
- *
- * @param modifiers the modifiers
- * @return a string representation of the modifiers in this bitmask
- * @since 1.4
- */
- public static String getModifiersExText(int modifiers)
- {
- modifiers &= EventModifier.NEW_MASK;
- if (modifiers == 0)
- return "";
- StringBuffer s = new StringBuffer();
- if ((modifiers & META_DOWN_MASK) != 0)
- s.append("Meta+");
- if ((modifiers & CTRL_DOWN_MASK) != 0)
- s.append("Ctrl+");
- if ((modifiers & ALT_DOWN_MASK) != 0)
- s.append("Alt+");
- if ((modifiers & SHIFT_DOWN_MASK) != 0)
- s.append("Shift+");
- if ((modifiers & ALT_GRAPH_DOWN_MASK) != 0)
- s.append("Alt Graph+");
- if ((modifiers & BUTTON1_DOWN_MASK) != 0)
- s.append("Button1+");
- if ((modifiers & BUTTON2_DOWN_MASK) != 0)
- s.append("Button2+");
- if ((modifiers & BUTTON3_DOWN_MASK) != 0)
- s.append("Button3+");
- return s.substring(0, s.length() - 1);
- }
-} // class InputEvent
diff --git a/libjava/java/awt/event/InputMethodEvent.java b/libjava/java/awt/event/InputMethodEvent.java
deleted file mode 100644
index f6711a8fa5a..00000000000
--- a/libjava/java/awt/event/InputMethodEvent.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/* InputMethodEvent.java -- events from a text input method
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.AWTEvent;
-import java.awt.Component;
-import java.awt.EventQueue;
-import java.awt.font.TextHitInfo;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.text.AttributedCharacterIterator;
-
-/**
- * This class is for event generated by change in a text input method.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see InputMethodListener
- * @since 1.2
- * @status updated to 1.4
- */
-public class InputMethodEvent extends AWTEvent
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 4727190874778922661L;
-
- /** This is the first id in the range of event ids used by this class. */
- public static final int INPUT_METHOD_FIRST = 1100;
-
- /** This event id indicates that the text in the input method has changed. */
- public static final int INPUT_METHOD_TEXT_CHANGED = 1100;
-
- /** This event id indicates that the input method curor point has changed. */
- public static final int CARET_POSITION_CHANGED = 1101;
-
- /** This is the last id in the range of event ids used by this class. */
- public static final int INPUT_METHOD_LAST = 1101;
-
- /**
- * The timestamp when this event was created.
- *
- * @serial the timestamp
- * @since 1.4
- */
- private long when;
-
- /** The input method text. */
- private final transient AttributedCharacterIterator text;
-
- /** The number of committed characters in the text. */
- private final transient int committedCharacterCount;
-
- /** The caret. */
- private final transient TextHitInfo caret;
-
- /** The most important position to be visible. */
- private final transient TextHitInfo visiblePosition;
-
- /**
- * Initializes a new instance of <code>InputMethodEvent</code> with the
- * specified source, id, timestamp, text, char count, caret, and visible
- * position.
- *
- * @param source the source that generated the event
- * @param id the event id
- * @param when the timestamp of the event
- * @param text the input text
- * @param committedCharacterCount the number of committed characters
- * @param caret the caret position
- * @param visiblePosition the position most important to make visible
- * @throws IllegalArgumentException if source is null, id is invalid, id is
- * CARET_POSITION_CHANGED and text is non-null, or if
- * committedCharacterCount is out of range
- * @since 1.4
- */
- public InputMethodEvent(Component source, int id, long when,
- AttributedCharacterIterator text,
- int committedCharacterCount, TextHitInfo caret,
- TextHitInfo visiblePosition)
- {
- super(source, id);
- this.when = when;
- this.text = text;
- this.committedCharacterCount = committedCharacterCount;
- this.caret = caret;
- this.visiblePosition = visiblePosition;
- if (id < INPUT_METHOD_FIRST || id > INPUT_METHOD_LAST
- || (id == CARET_POSITION_CHANGED && text != null)
- || committedCharacterCount < 0
- || (committedCharacterCount
- > (text == null ? 0 : text.getEndIndex() - text.getBeginIndex())))
- throw new IllegalArgumentException();
- }
-
- /**
- * Initializes a new instance of <code>InputMethodEvent</code> with the
- * specified source, id, text, char count, caret, and visible position.
- *
- * @param source the source that generated the event
- * @param id the event id
- * @param text the input text
- * @param committedCharacterCount the number of committed characters
- * @param caret the caret position
- * @param visiblePosition the position most important to make visible
- * @throws IllegalArgumentException if source is null, id is invalid, id is
- * CARET_POSITION_CHANGED and text is non-null, or if
- * committedCharacterCount is out of range
- * @since 1.4
- */
- public InputMethodEvent(Component source, int id,
- AttributedCharacterIterator text,
- int committedCharacterCount, TextHitInfo caret,
- TextHitInfo visiblePosition)
- {
- this(source, id, EventQueue.getMostRecentEventTime(), text,
- committedCharacterCount, caret, visiblePosition);
- }
-
- /**
- * Initializes a new instance of <code>InputMethodEvent</code> with the
- * specified source, id, caret, and visible position, and with a null
- * text and char count.
- *
- * @param source the source that generated the event
- * @param id the event id
- * @param caret the caret position
- * @param visiblePosition the position most important to make visible
- * @throws IllegalArgumentException if source is null or id is invalid
- * @since 1.4
- */
- public InputMethodEvent(Component source, int id, TextHitInfo caret,
- TextHitInfo visiblePosition)
- {
- this(source, id, EventQueue.getMostRecentEventTime(), null, 0, caret,
- visiblePosition);
- }
-
- /**
- * This method returns the input method text. This can be <code>null</code>,
- * and will always be null for <code>CARET_POSITION_CHANGED</code> events.
- * Characters from 0 to <code>getCommittedCharacterCount()-1</code> have
- * been committed, the remaining characters are composed text.
- *
- * @return the input method text, or null
- */
- public AttributedCharacterIterator getText()
- {
- return text;
- }
-
- /**
- * Returns the number of committed characters in the input method text.
- *
- * @return the number of committed characters in the input method text
- */
- public int getCommittedCharacterCount()
- {
- return committedCharacterCount;
- }
-
- /**
- * Returns the caret position. The caret offset is relative to the composed
- * text of the most recent <code>INPUT_METHOD_TEXT_CHANGED</code> event.
- *
- * @return the caret position, or null
- */
- public TextHitInfo getCaret()
- {
- return caret;
- }
-
- /**
- * Returns the position that is most important to be visible, or null if
- * such a hint is not necessary. The caret offset is relative to the composed
- * text of the most recent <code>INPUT_METHOD_TEXT_CHANGED</code> event.
- *
- * @return the position that is most important to be visible
- */
- public TextHitInfo getVisiblePosition()
- {
- return visiblePosition;
- }
-
- /**
- * This method consumes the event. A consumed event is not processed
- * in the default manner by the component that generated it.
- */
- public void consume()
- {
- consumed = true;
- }
-
- /**
- * This method tests whether or not this event has been consumed.
- *
- * @return true if the event has been consumed
- */
- public boolean isConsumed()
- {
- return consumed;
- }
-
- /**
- * Return the timestamp of this event.
- *
- * @return the timestamp
- * @since 1.4
- */
- public long getWhen()
- {
- return when;
- }
-
- /**
- * This method returns a string identifying the event. This contains the
- * event ID, the committed and composed characters separated by '+', the
- * number of committed characters, the caret, and the visible position.
- *
- * @return a string identifying the event
- */
- public String paramString()
- {
- StringBuffer s
- = new StringBuffer(80 + (text == null ? 0
- : text.getEndIndex() - text.getBeginIndex()));
- s.append(id == INPUT_METHOD_TEXT_CHANGED ? "INPUT_METHOD_TEXT_CHANGED, "
- : "CARET_POSITION_CHANGED, ");
- if (text == null)
- s.append("no text, 0 characters committed, caret: ");
- else
- {
- s.append('"');
- int i = text.getBeginIndex();
- int j = committedCharacterCount;
- while (--j >= 0)
- s.append(text.setIndex(i++));
- s.append("\" + \"");
- j = text.getEndIndex() - i;
- while (--j >= 0)
- s.append(text.setIndex(i++));
- s.append("\", ").append(committedCharacterCount)
- .append(" characters committed, caret: ");
- }
- s.append(caret == null ? (Object) "no caret" : caret).append(", ")
- .append(visiblePosition == null ? (Object) "no visible position"
- : visiblePosition);
- return s.toString();
- }
-
- /**
- * Reads in the object from a serial stream, updating when to
- * {@link EventQueue#getMostRecentEventTime()} if necessary.
- *
- * @param s the stream to read from
- * @throws IOException if deserialization fails
- * @throws ClassNotFoundException if deserialization fails
- * @serialData default, except for updating when
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- if (when == 0)
- when = EventQueue.getMostRecentEventTime();
- }
-} // class InputMethodEvent
diff --git a/libjava/java/awt/event/InputMethodListener.java b/libjava/java/awt/event/InputMethodListener.java
deleted file mode 100644
index 8baf022983a..00000000000
--- a/libjava/java/awt/event/InputMethodListener.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* InputMethodListener.java -- listen for input method events
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to receive events from an input
- * method. For a text component to use input methods, it must also install
- * an InputMethodRequests handler.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see InputMethodEvent
- * @see InputMethodRequests
- * @since 1.2
- * @status updated to 1.4
- */
-public interface InputMethodListener extends EventListener
-{
- /**
- * This method is called when the text is changed.
- *
- * @param event the <code>InputMethodEvent</code> indicating the text change
- */
- void inputMethodTextChanged(InputMethodEvent event);
-
- /**
- * This method is called when the cursor position within the text is changed.
- *
- * @param event the <code>InputMethodEvent</code> indicating the change
- */
- void caretPositionChanged(InputMethodEvent event);
-} // interface InputMethodListener
diff --git a/libjava/java/awt/event/InvocationEvent.java b/libjava/java/awt/event/InvocationEvent.java
deleted file mode 100644
index 75feb62bd94..00000000000
--- a/libjava/java/awt/event/InvocationEvent.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/* InvocationEvent.java -- call a runnable when dispatched
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.AWTEvent;
-import java.awt.ActiveEvent;
-import java.awt.EventQueue;
-
-/**
- * This event executes {@link Runnable#run()} of a target object when it is
- * dispatched. This class is used by calls to <code>invokeLater</code> and
- * <code>invokeAndWait</code>, so client code can use this fact to avoid
- * writing special-casing AWTEventListener objects.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ActiveEvent
- * @see EventQueue#invokeLater(Runnable)
- * @see EventQueue#invokeAndWait(Runnable)
- * @see AWTEventListener
- * @since 1.2
- * @status updated to 1.4
- */
-public class InvocationEvent extends AWTEvent implements ActiveEvent
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 436056344909459450L;
-
- /** This is the first id in the range of event ids used by this class. */
- public static final int INVOCATION_FIRST = 1200;
-
- /** This is the default id for this event type. */
- public static final int INVOCATION_DEFAULT = 1200;
-
- /** This is the last id in the range of event ids used by this class. */
- public static final int INVOCATION_LAST = 1200;
-
- /**
- * This is the <code>Runnable</code> object to call when dispatched.
- *
- * @serial the runnable to execute
- */
- protected Runnable runnable;
-
- /**
- * This is the object to call <code>notifyAll()</code> on when
- * the call to <code>run()</code> returns, or <code>null</code> if no
- * object is to be notified.
- *
- * @serial the object to notify
- */
- protected Object notifier;
-
- /**
- * This variable is set to <code>true</code> if exceptions are caught
- * and stored in a variable during the call to <code>run()</code>, otherwise
- * exceptions are ignored and propagate up.
- *
- * @serial true to catch exceptions
- */
- protected boolean catchExceptions;
-
- /**
- * This is the caught exception thrown in the <code>run()</code> method. It
- * is null if exceptions are ignored, the run method hasn't completed, or
- * there were no exceptions.
- *
- * @serial the caught exception, if any
- */
- private Exception exception;
-
- /**
- * The timestamp when this event was created.
- *
- * @see #getWhen()
- * @serial the timestamp
- * @since 1.4
- */
- private final long when = EventQueue.getMostRecentEventTime();
-
- /**
- * Initializes a new instance of <code>InvocationEvent</code> with the
- * specified source and runnable.
- *
- * @param source the source of the event
- * @param runnable the <code>Runnable</code> object to invoke
- * @throws IllegalArgumentException if source is null
- */
- public InvocationEvent(Object source, Runnable runnable)
- {
- this(source, INVOCATION_DEFAULT, runnable, null, false);
- }
-
- /**
- * Initializes a new instance of <code>InvocationEvent</code> with the
- * specified source, runnable, and notifier. It will also catch exceptions
- * if specified. If notifier is non-null, this will call notifyAll() on
- * the object when the runnable is complete. If catchExceptions is true,
- * this traps any exception in the runnable, otherwise it lets the exception
- * propagate up the Event Dispatch thread.
- *
- * @param source the source of the event
- * @param runnable the <code>Runnable</code> object to invoke
- * @param notifier the object to notify, or null
- * @param catchExceptions true to catch exceptions from the runnable
- */
- public InvocationEvent(Object source, Runnable runnable, Object notifier,
- boolean catchExceptions)
- {
- this(source, INVOCATION_DEFAULT, runnable, notifier, catchExceptions);
- }
-
- /**
- * Initializes a new instance of <code>InvocationEvent</code> with the
- * specified source, runnable, and notifier. It will also catch exceptions
- * if specified. If notifier is non-null, this will call notifyAll() on
- * the object when the runnable is complete. If catchExceptions is true,
- * this traps any exception in the runnable, otherwise it lets the exception
- * propagate up the Event Dispatch thread. Note that an invalid id leads to
- * unspecified results.
- *
- * @param source the source of the event
- * @param id the event id
- * @param runnable the <code>Runnable</code> object to invoke
- * @param notifier the object to notify, or null
- * @param catchExceptions true to catch exceptions from the runnable
- */
- protected InvocationEvent(Object source, int id, Runnable runnable,
- Object notifier, boolean catchExceptions)
- {
- super(source, id);
- this.runnable = runnable;
- this.notifier = notifier;
- this.catchExceptions = catchExceptions;
- }
-
- /**
- * This method calls the <code>run()</code> method of the runnable, traps
- * exceptions if instructed to do so, and calls <code>notifyAll()</code>
- * on any notifier if all worked successfully.
- */
- public void dispatch()
- {
- if (catchExceptions)
- try
- {
- runnable.run();
- }
- catch (Exception e)
- {
- exception = e;
- }
- else
- runnable.run();
-
- Object o = notifier;
- if (o != null)
- synchronized(o)
- {
- o.notifyAll();
- }
- }
-
- /**
- * This method returns the exception that occurred during the execution of
- * the runnable, or <code>null</code> if not exception was thrown or
- * exceptions were not caught.
- *
- * @return the exception thrown by the runnable
- */
- public Exception getException()
- {
- return exception;
- }
-
- /**
- * Gets the timestamp of when this event was created.
- *
- * @return the timestamp of this event
- * @since 1.4
- */
- public long getWhen()
- {
- return when;
- }
-
- /**
- * This method returns a string identifying this event. This is formatted as:
- * <code>"INVOCATION_DEFAULT,runnable=" + runnable + ",notifier=" + notifier
- * + ",catchExceptions=" + catchExceptions + ",when=" + getWhen()</code>.
- *
- * @return a string identifying this event
- */
- public String paramString()
- {
- return (id == INVOCATION_DEFAULT ? "INVOCATION_DEFAULT,runnable="
- : "unknown type,runnable=") + runnable + ",notifier=" + notifier
- + ",catchExceptions=" + catchExceptions + ",when=" + when;
- }
-} // class InvocationEvent
diff --git a/libjava/java/awt/event/ItemEvent.java b/libjava/java/awt/event/ItemEvent.java
deleted file mode 100644
index 467815b1608..00000000000
--- a/libjava/java/awt/event/ItemEvent.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/* ItemEvent.java -- event for item state changes
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.AWTEvent;
-import java.awt.ItemSelectable;
-
-/**
- * This event is generated when a selection item changes state. This is an
- * abstraction that distills a large number of individual mouse or keyboard
- * events into a simpler "item selected" and "item deselected" events.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ItemSelectable
- * @see ItemListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class ItemEvent extends AWTEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -608708132447206933L;
-
- /** This is the first id in the event id range used by this class. */
- public static final int ITEM_FIRST = 701;
-
- /** This is the last id in the event id range used by this class. */
- public static final int ITEM_LAST = 701;
-
- /** This event id indicates a state change occurred. */
- public static final int ITEM_STATE_CHANGED = 701;
-
- /** This type indicates that the item was selected. */
- public static final int SELECTED = 1;
-
- /** This type indicates that the item was deselected. */
- public static final int DESELECTED = 2;
-
- /**
- * The item affected by this event.
- *
- * @serial the item of the selection
- */
- private final Object item;
-
- /**
- * The state change direction, one of {@link #SELECTED} or
- * {@link #DESELECTED}.
- *
- * @serial the selection state
- */
- private final int stateChange;
-
- /**
- * Initializes a new instance of <code>ItemEvent</code> with the specified
- * source, id, and state change constant. Note that an invalid id leads to
- * unspecified results.
- *
- * @param source the source of the event
- * @param id the event id
- * @param item the item affected by the state change
- * @param stateChange one of {@link #SELECTED} or {@link #DESELECTED}
- */
- public ItemEvent(ItemSelectable source, int id, Object item, int stateChange)
- {
- super(source, id);
- this.item = item;
- this.stateChange = stateChange;
- }
-
- /**
- * This method returns the event source as an <code>ItemSelectable</code>.
- *
- * @return the event source as an <code>ItemSelected</code>
- * @throws ClassCastException if source is changed to a non-ItemSelectable
- */
- public ItemSelectable getItemSelectable()
- {
- return (ItemSelectable) source;
- }
-
- /**
- * Returns the item affected by this state change.
- *
- * @return the item affected by this state change
- */
- public Object getItem()
- {
- return item;
- }
-
- /**
- * Returns the type of state change, either {@link #SELECTED} or
- * {@link #DESELECTED}.
- *
- * @return the type of state change
- */
- public int getStateChange()
- {
- return stateChange;
- }
-
- /**
- * Returns a string identifying this event. This is in the format:
- * <code>"ITEM_STATE_CHANGED,item=" + item + ",stateChange="
- * + (getStateChange() == DESELECTED ? "DESELECTED" : "SELECTED")</code>.
- *
- * @return a string identifying this event
- */
- public String paramString()
- {
- return (id == ITEM_STATE_CHANGED ? "ITEM_STATE_CHANGED,item="
- : "unknown type,item=") + item + ",stateChange="
- + (stateChange == SELECTED ? "SELECTED"
- : stateChange == DESELECTED ? "DESELECTED" : "unknown type");
- }
-} // class ItemEvent
diff --git a/libjava/java/awt/event/ItemListener.java b/libjava/java/awt/event/ItemListener.java
deleted file mode 100644
index 34fe7901b12..00000000000
--- a/libjava/java/awt/event/ItemListener.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ItemListener.java -- listen for item events
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to receive events when an
- * item's selection state changes.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ItemSelectable
- * @see ItemEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface ItemListener extends EventListener
-{
- /**
- * This method is called when an item's state is changed.
- *
- * @param event the <code>ItemEvent</code> indicating the change
- */
- void itemStateChanged(ItemEvent event);
-} // interface ItemListener
diff --git a/libjava/java/awt/event/KeyAdapter.java b/libjava/java/awt/event/KeyAdapter.java
deleted file mode 100644
index c01d61ff339..00000000000
--- a/libjava/java/awt/event/KeyAdapter.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* KeyAdapter.java -- convenience class for writing key listeners
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-/**
- * This class implements <code>KeyListener</code> and implements all methods
- * with empty bodies. This allows a listener interested in implementing only
- * a subset of the <code>KeyListener</code> interface to extend this class
- * and override only the desired methods.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see KeyEvent
- * @see KeyListener
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class KeyAdapter implements KeyListener
-{
- /**
- * Do nothing default constructor for subclasses.
- */
- public KeyAdapter()
- {
- }
-
- /**
- * Implements this method in the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void keyTyped(KeyEvent event)
- {
- }
-
- /**
- * Implements this method in the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void keyPressed(KeyEvent event)
- {
- }
-
- /**
- * Implements this method in the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void keyReleased(KeyEvent event)
- {
- }
-} // class KeyAdapter
diff --git a/libjava/java/awt/event/KeyEvent.java b/libjava/java/awt/event/KeyEvent.java
deleted file mode 100644
index a40a8e15c04..00000000000
--- a/libjava/java/awt/event/KeyEvent.java
+++ /dev/null
@@ -1,1740 +0,0 @@
-/* KeyEvent.java -- event for key presses
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import gnu.java.awt.EventModifier;
-
-import java.awt.Component;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-/**
- * This event is generated when a key is pressed or released. There are two
- * categories of key events:
- *
- * <p><em>"Key typed" events</em> are higher-level, and have already
- * compensated for modifiers and keyboard layout to generate a single Unicode
- * character. It may take several key press events to generate one key typed.
- * The <code>getKeyCode</code> method will return <code>VK_UNDEFINED</code>,
- * and <code>getKeyChar</code> will return a valid Unicode character or
- * <code>CHAR_UNDEFINED</code>.
- *
- * <p><em>"Key pressed" and "key released" events</em> are lower-level, and
- * are platform and keyboard dependent. They correspond to the actaul motion
- * on a keyboard, and return a virtual key code which labels the key that was
- * pressed. The <code>getKeyCode</code> method will return one of the
- * <code>VK_*</code> constants (except VK_UNDEFINED), and the
- * <code>getKeyChar</code> method is undefined.
- *
- * <p>Some keys do not generate key typed events, such as the F1 or HELP keys.
- * Not all keyboards can generate all virtual keys, and no attempt is made to
- * simulate the ones that can't be typed. Virtual keys correspond to the
- * keyboard layout, so for example, VK_Q in English is VK_A in French. Also,
- * there are some additional virtual keys to ease handling of actions, such
- * as VK_ALL_CANDIDATES in place of ALT+VK_CONVERT. Do not rely on the value
- * of the VK_* constants, except for VK_ENTER, VK_BACK_SPACE, and VK_TAB.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see KeyAdapter
- * @see KeyListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class KeyEvent extends InputEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -2352130953028126954L;
-
- /** This is the first id in the range of event ids used by this class. */
- public static final int KEY_FIRST = 400;
-
- /** This is the last id in the range of event ids used by this class. */
- public static final int KEY_LAST = 402;
-
- /**
- * This event id indicates a key was typed, which is a key press followed
- * by a key release to generate an actual Unicode character. It may take
- * several key presses to generate one key typed event, and some action
- * keys have no corresponding key typed.
- */
- public static final int KEY_TYPED = 400;
-
- /** This event id indicates a key was pressed. */
- public static final int KEY_PRESSED = 401;
-
- /** This event it indicates a key was released. */
- public static final int KEY_RELEASED = 402;
-
- /** The virtual key Enter, which will always map to '\n'. */
- public static final int VK_ENTER = '\n';
-
- /** The virtual key Backspace, which will always map to '\b'. */
- public static final int VK_BACK_SPACE = '\b';
-
- /** The virtual key Tab, which will always map to '\t'. */
- public static final int VK_TAB = '\t';
-
- /** The virtual key Cancel. */
- public static final int VK_CANCEL = 3;
-
- /** The virtual key VK_CLEAR. */
- public static final int VK_CLEAR = 12;
-
- /** The virtual key VK_SHIFT. */
- public static final int VK_SHIFT = 16;
-
- /** The virtual key VK_CONTROL. */
- public static final int VK_CONTROL = 17;
-
- /** The virtual key VK_ALT. */
- public static final int VK_ALT = 18;
-
- /** The virtual key VK_PAUSE. */
- public static final int VK_PAUSE = 19;
-
- /** The virtual key VK_CAPS_LOCK. */
- public static final int VK_CAPS_LOCK = 20;
-
- /** The virtual key VK_ESCAPE. */
- public static final int VK_ESCAPE = 27;
-
- /** The virtual key VK_SPACE. */
- public static final int VK_SPACE = ' ';
-
- /** The virtual key VK_PAGE_UP. */
- public static final int VK_PAGE_UP = 33;
-
- /** The virtual key VK_PAGE_DOWN. */
- public static final int VK_PAGE_DOWN = 34;
-
- /** The virtual key VK_END. */
- public static final int VK_END = 35;
-
- /** The virtual key VK_HOME. */
- public static final int VK_HOME = 36;
-
- /**
- * The virtual key for the non-numpad VK_LEFT.
- *
- * @see #VK_KP_LEFT
- */
- public static final int VK_LEFT = 37;
-
- /**
- * The virtual key for the non-numpad VK_UP.
- *
- * @see #VK_KP_UP
- */
- public static final int VK_UP = 38;
-
- /**
- * The virtual key for the non-numpad VK_RIGHT.
- *
- * @see #VK_KP_RIGHT
- */
- public static final int VK_RIGHT = 39;
-
- /**
- * The virtual key for the non-numpad VK_DOWN.
- *
- * @see #VK_KP_DOWN
- */
- public static final int VK_DOWN = 40;
-
- /** The virtual key VK_COMMA. */
- public static final int VK_COMMA = ',';
-
- /**
- * The virtual key VK_MINUS.
- *
- * @since 1.2
- */
- public static final int VK_MINUS = '-';
-
- /** The virtual key VK_PERIOD. */
- public static final int VK_PERIOD = '.';
-
- /** The virtual key VK_SLASH. */
- public static final int VK_SLASH = '/';
-
- /** The virtual key VK_0. */
- public static final int VK_0 = '0';
-
- /** The virtual key VK_1. */
- public static final int VK_1 = '1';
-
- /** The virtual key VK_2. */
- public static final int VK_2 = '2';
-
- /** The virtual key VK_3. */
- public static final int VK_3 = '3';
-
- /** The virtual key VK_4. */
- public static final int VK_4 = '4';
-
- /** The virtual key VK_5. */
- public static final int VK_5 = '5';
-
- /** The virtual key VK_6. */
- public static final int VK_6 = '6';
-
- /** The virtual key VK_7. */
- public static final int VK_7 = '7';
-
- /** The virtual key VK_8. */
- public static final int VK_8 = '8';
-
- /** The virtual key VK_9. */
- public static final int VK_9 = '9';
-
- /** The virtual key VK_SEMICOLON. */
- public static final int VK_SEMICOLON = ';';
-
- /** The virtual key VK_EQUALS. */
- public static final int VK_EQUALS = '=';
-
- /** The virtual key VK_A. */
- public static final int VK_A = 'A';
-
- /** The virtual key VK_B. */
- public static final int VK_B = 'B';
-
- /** The virtual key VK_C. */
- public static final int VK_C = 'C';
-
- /** The virtual key VK_D. */
- public static final int VK_D = 'D';
-
- /** The virtual key VK_E. */
- public static final int VK_E = 'E';
-
- /** The virtual key VK_F. */
- public static final int VK_F = 'F';
-
- /** The virtual key VK_G. */
- public static final int VK_G = 'G';
-
- /** The virtual key VK_H. */
- public static final int VK_H = 'H';
-
- /** The virtual key VK_I. */
- public static final int VK_I = 'I';
-
- /** The virtual key VK_J. */
- public static final int VK_J = 'J';
-
- /** The virtual key VK_K. */
- public static final int VK_K = 'K';
-
- /** The virtual key VK_L. */
- public static final int VK_L = 'L';
-
- /** The virtual key VK_M. */
- public static final int VK_M = 'M';
-
- /** The virtual key VK_N. */
- public static final int VK_N = 'N';
-
- /** The virtual key VK_O. */
- public static final int VK_O = 'O';
-
- /** The virtual key VK_P. */
- public static final int VK_P = 'P';
-
- /** The virtual key VK_Q. */
- public static final int VK_Q = 'Q';
-
- /** The virtual key VK_R. */
- public static final int VK_R = 'R';
-
- /** The virtual key VK_S. */
- public static final int VK_S = 'S';
-
- /** The virtual key VK_T. */
- public static final int VK_T = 'T';
-
- /** The virtual key VK_U. */
- public static final int VK_U = 'U';
-
- /** The virtual key VK_V. */
- public static final int VK_V = 'V';
-
- /** The virtual key VK_W. */
- public static final int VK_W = 'W';
-
- /** The virtual key VK_X. */
- public static final int VK_X = 'X';
-
- /** The virtual key VK_Y. */
- public static final int VK_Y = 'Y';
-
- /** The virtual key VK_Z. */
- public static final int VK_Z = 'Z';
-
- /** The virtual key VK_OPEN_BRACKET. */
- public static final int VK_OPEN_BRACKET = '[';
-
- /** The virtual key VK_BACK_SLASH. */
- public static final int VK_BACK_SLASH = '\\';
-
- /** The virtual key VK_CLOSE_BRACKET. */
- public static final int VK_CLOSE_BRACKET = ']';
-
- /** The virtual key VK_NUMPAD0. */
- public static final int VK_NUMPAD0 = 96;
-
- /** The virtual key VK_NUMPAD1. */
- public static final int VK_NUMPAD1 = 97;
-
- /** The virtual key VK_NUMPAD2. */
- public static final int VK_NUMPAD2 = 98;
-
- /** The virtual key VK_NUMPAD3. */
- public static final int VK_NUMPAD3 = 99;
-
- /** The virtual key VK_NUMPAD4. */
- public static final int VK_NUMPAD4 = 100;
-
- /** The virtual key VK_NUMPAD5. */
- public static final int VK_NUMPAD5 = 101;
-
- /** The virtual key VK_NUMPAD6. */
- public static final int VK_NUMPAD6 = 102;
-
- /** The virtual key VK_NUMPAD7. */
- public static final int VK_NUMPAD7 = 103;
-
- /** The virtual key VK_NUMPAD8. */
- public static final int VK_NUMPAD8 = 104;
-
- /** The virtual key VK_NUMPAD9. */
- public static final int VK_NUMPAD9 = 105;
-
- /** The virtual key VK_MULTIPLY. */
- public static final int VK_MULTIPLY = 106;
-
- /** The virtual key VK_ADD. */
- public static final int VK_ADD = 107;
-
- /**
- * The virtual key VK_SEPARATOR, handily mispelled for those who can't
- * figure it out.
- *
- * @deprecated use {@link #VK_SEPARATOR}
- */
- public static final int VK_SEPARATER = 108;
-
- /**
- * The virtual key VK_SEPARATOR.
- *
- * @since 1.4
- */
- public static final int VK_SEPARATOR = 108;
-
- /** The virtual key VK_SUBTRACT. */
- public static final int VK_SUBTRACT = 109;
-
- /** The virtual key VK_DECIMAL. */
- public static final int VK_DECIMAL = 110;
-
- /** The virtual key VK_DIVIDE. */
- public static final int VK_DIVIDE = 111;
-
- /** The virtual key VK_DELETE. */
- public static final int VK_DELETE = 127;
-
- /** The virtual key VK_NUM_LOCK. */
- public static final int VK_NUM_LOCK = 144;
-
- /** The virtual key VK_SCROLL_LOCK. */
- public static final int VK_SCROLL_LOCK = 145;
-
- /** The virtual key VK_F1. */
- public static final int VK_F1 = 112;
-
- /** The virtual key VK_F2. */
- public static final int VK_F2 = 113;
-
- /** The virtual key VK_F3. */
- public static final int VK_F3 = 114;
-
- /** The virtual key VK_F4. */
- public static final int VK_F4 = 115;
-
- /** The virtual key VK_F5. */
- public static final int VK_F5 = 116;
-
- /** The virtual key VK_F6. */
- public static final int VK_F6 = 117;
-
- /** The virtual key VK_F7. */
- public static final int VK_F7 = 118;
-
- /** The virtual key VK_F8. */
- public static final int VK_F8 = 119;
-
- /** The virtual key VK_F9. */
- public static final int VK_F9 = 120;
-
- /** The virtual key VK_F10. */
- public static final int VK_F10 = 121;
-
- /** The virtual key VK_F11. */
- public static final int VK_F11 = 122;
-
- /** The virtual key VK_F12. */
- public static final int VK_F12 = 123;
-
- /**
- * The virtual key VK_F13.
- *
- * @since 1.2
- */
- public static final int VK_F13 = 61440;
-
- /**
- * The virtual key VK_F14.
- *
- * @since 1.2
- */
- public static final int VK_F14 = 61441;
-
- /**
- * The virtual key VK_F15.
- *
- * @since 1.2
- */
- public static final int VK_F15 = 61442;
-
- /**
- * The virtual key VK_F16.
- *
- * @since 1.2
- */
- public static final int VK_F16 = 61443;
-
- /**
- * The virtual key VK_F17.
- *
- * @since 1.2
- */
- public static final int VK_F17 = 61444;
-
- /**
- * The virtual key VK_F18.
- *
- * @since 1.2
- */
- public static final int VK_F18 = 61445;
-
- /**
- * The virtual key VK_F19.
- *
- * @since 1.2
- */
- public static final int VK_F19 = 61446;
-
- /**
- * The virtual key VK_F20.
- *
- * @since 1.2
- */
- public static final int VK_F20 = 61447;
-
- /**
- * The virtual key VK_F21.
- *
- * @since 1.2
- */
- public static final int VK_F21 = 61448;
-
- /**
- * The virtual key VK_F22.
- *
- * @since 1.2
- */
- public static final int VK_F22 = 61449;
-
- /**
- * The virtual key VK_F23.
- *
- * @since 1.2
- */
- public static final int VK_F23 = 61450;
-
- /**
- * The virtual key VK_F24.
- *
- * @since 1.2
- */
- public static final int VK_F24 = 61451;
-
- /** The virtual key VK_PRINTSCREEN. */
- public static final int VK_PRINTSCREEN = 154;
-
- /** The virtual key VK_INSERT. */
- public static final int VK_INSERT = 155;
-
- /** The virtual key VK_HELP. */
- public static final int VK_HELP = 156;
-
- /** The virtual key VK_META. */
- public static final int VK_META = 157;
-
- /** The virtual key VK_BACK_QUOTE. */
- public static final int VK_BACK_QUOTE = 192;
-
- /** The virtual key VK_QUOTE. */
- public static final int VK_QUOTE = 222;
-
- /**
- * The virtual key for the numpad VK_KP_UP.
- *
- * @see #VK_UP
- * @since 1.2
- */
- public static final int VK_KP_UP = 224;
-
- /**
- * The virtual key for the numpad VK_KP_DOWN.
- *
- * @see #VK_DOWN
- * @since 1.2
- */
- public static final int VK_KP_DOWN = 225;
-
- /**
- * The virtual key for the numpad VK_KP_LEFT.
- *
- * @see #VK_LEFT
- * @since 1.2
- */
- public static final int VK_KP_LEFT = 226;
-
- /**
- * The virtual key for the numpad VK_KP_RIGHT.
- *
- * @see #VK_RIGHT
- * @since 1.2
- */
- public static final int VK_KP_RIGHT = 227;
-
- /**
- * The virtual key VK_DEAD_GRAVE.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_GRAVE = 128;
-
- /**
- * The virtual key VK_DEAD_ACUTE.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_ACUTE = 129;
-
- /**
- * The virtual key VK_DEAD_CIRCUMFLEX.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_CIRCUMFLEX = 130;
-
- /**
- * The virtual key VK_DEAD_TILDE.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_TILDE = 131;
-
- /**
- * The virtual key VK_DEAD_MACRON.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_MACRON = 132;
-
- /**
- * The virtual key VK_DEAD_BREVE.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_BREVE = 133;
-
- /**
- * The virtual key VK_DEAD_ABOVEDOT.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_ABOVEDOT = 134;
-
- /**
- * The virtual key VK_DEAD_DIAERESIS.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_DIAERESIS = 135;
-
- /**
- * The virtual key VK_DEAD_ABOVERING.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_ABOVERING = 136;
-
- /**
- * The virtual key VK_DEAD_DOUBLEACUTE.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_DOUBLEACUTE = 137;
-
- /**
- * The virtual key VK_DEAD_CARON.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_CARON = 138;
-
- /**
- * The virtual key VK_DEAD_CEDILLA.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_CEDILLA = 139;
-
- /**
- * The virtual key VK_DEAD_OGONEK.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_OGONEK = 140;
-
- /**
- * The virtual key VK_DEAD_IOTA.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_IOTA = 141;
-
- /**
- * The virtual key VK_DEAD_VOICED_SOUND.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_VOICED_SOUND = 142;
-
- /**
- * The virtual key VK_DEAD_SEMIVOICED_SOUND.
- *
- * @since 1.2
- */
- public static final int VK_DEAD_SEMIVOICED_SOUND = 143;
-
- /**
- * The virtual key VK_AMPERSAND.
- *
- * @since 1.2
- */
- public static final int VK_AMPERSAND = 150;
-
- /**
- * The virtual key VK_ASTERISK.
- *
- * @since 1.2
- */
- public static final int VK_ASTERISK = 151;
-
- /**
- * The virtual key VK_QUOTEDBL.
- *
- * @since 1.2
- */
- public static final int VK_QUOTEDBL = 152;
-
- /**
- * The virtual key VK_LESS.
- *
- * @since 1.2
- */
- public static final int VK_LESS = 153;
-
- /**
- * The virtual key VK_GREATER.
- *
- * @since 1.2
- */
- public static final int VK_GREATER = 160;
-
- /**
- * The virtual key VK_BRACELEFT.
- *
- * @since 1.2
- */
- public static final int VK_BRACELEFT = 161;
-
- /**
- * The virtual key VK_BRACERIGHT.
- *
- * @since 1.2
- */
- public static final int VK_BRACERIGHT = 162;
-
- /**
- * The virtual key VK_AT.
- *
- * @since 1.2
- */
- public static final int VK_AT = 512;
-
- /**
- * The virtual key VK_COLON.
- *
- * @since 1.2
- */
- public static final int VK_COLON = 513;
-
- /**
- * The virtual key VK_CIRCUMFLEX.
- *
- * @since 1.2
- */
- public static final int VK_CIRCUMFLEX = 514;
-
- /**
- * The virtual key VK_DOLLAR.
- *
- * @since 1.2
- */
- public static final int VK_DOLLAR = 515;
-
- /**
- * The virtual key VK_EURO_SIGN.
- *
- * @since 1.2
- */
- public static final int VK_EURO_SIGN = 516;
-
- /**
- * The virtual key VK_EXCLAMATION_MARK.
- *
- * @since 1.2
- */
- public static final int VK_EXCLAMATION_MARK = 517;
-
- /**
- * The virtual key VK_INVERTED_EXCLAMATION_MARK.
- *
- * @since 1.2
- */
- public static final int VK_INVERTED_EXCLAMATION_MARK = 518;
-
- /**
- * The virtual key VK_LEFT_PARENTHESIS.
- *
- * @since 1.2
- */
- public static final int VK_LEFT_PARENTHESIS = 519;
-
- /**
- * The virtual key VK_NUMBER_SIGN.
- *
- * @since 1.2
- */
- public static final int VK_NUMBER_SIGN = 520;
-
- /**
- * The virtual key VK_PLUS.
- *
- * @since 1.2
- */
- public static final int VK_PLUS = 521;
-
- /**
- * The virtual key VK_RIGHT_PARENTHESIS.
- *
- * @since 1.2
- */
- public static final int VK_RIGHT_PARENTHESIS = 522;
-
- /**
- * The virtual key VK_UNDERSCORE.
- *
- * @since 1.2
- */
- public static final int VK_UNDERSCORE = 523;
-
- /** The virtual key VK_FINAL. */
- public static final int VK_FINAL = 24;
-
- /** The virtual key VK_CONVERT. */
- public static final int VK_CONVERT = 28;
-
- /** The virtual key VK_NONCONVERT. */
- public static final int VK_NONCONVERT = 29;
-
- /** The virtual key VK_ACCEPT. */
- public static final int VK_ACCEPT = 30;
-
- /** The virtual key VK_MODECHANGE. */
- public static final int VK_MODECHANGE = 31;
-
- /** The virtual key VK_KANA. */
- public static final int VK_KANA = 21;
-
- /** The virtual key VK_KANJI. */
- public static final int VK_KANJI = 25;
-
- /**
- * The virtual key VK_ALPHANUMERIC.
- *
- * @since 1.2
- */
- public static final int VK_ALPHANUMERIC = 240;
-
- /**
- * The virtual key VK_KATAKANA.
- *
- * @since 1.2
- */
- public static final int VK_KATAKANA = 241;
-
- /**
- * The virtual key VK_HIRAGANA.
- *
- * @since 1.2
- */
- public static final int VK_HIRAGANA = 242;
-
- /**
- * The virtual key VK_FULL_WIDTH.
- *
- * @since 1.2
- */
- public static final int VK_FULL_WIDTH = 243;
-
- /**
- * The virtual key VK_HALF_WIDTH.
- *
- * @since 1.2
- */
- public static final int VK_HALF_WIDTH = 244;
-
- /**
- * The virtual key VK_ROMAN_CHARACTERS.
- *
- * @since 1.2
- */
- public static final int VK_ROMAN_CHARACTERS = 245;
-
- /**
- * The virtual key VK_ALL_CANDIDATES.
- *
- * @since 1.2
- */
- public static final int VK_ALL_CANDIDATES = 256;
-
- /**
- * The virtual key VK_PREVIOUS_CANDIDATE.
- *
- * @since 1.2
- */
- public static final int VK_PREVIOUS_CANDIDATE = 257;
-
- /**
- * The virtual key VK_CODE_INPUT.
- *
- * @since 1.2
- */
- public static final int VK_CODE_INPUT = 258;
-
- /**
- * The virtual key VK_JAPANESE_KATAKANA.
- *
- * @since 1.2
- */
- public static final int VK_JAPANESE_KATAKANA = 259;
-
- /**
- * The virtual key VK_JAPANESE_HIRAGANA.
- *
- * @since 1.2
- */
- public static final int VK_JAPANESE_HIRAGANA = 260;
-
- /**
- * The virtual key VK_JAPANESE_ROMAN.
- *
- * @since 1.2
- */
- public static final int VK_JAPANESE_ROMAN = 261;
-
- /**
- * The virtual key VK_KANA_LOCK.
- *
- * @since 1.3
- */
- public static final int VK_KANA_LOCK = 262;
-
- /**
- * The virtual key VK_INPUT_METHOD_ON_OFF.
- *
- * @since 1.3
- */
- public static final int VK_INPUT_METHOD_ON_OFF = 263;
-
- /**
- * The virtual key VK_CUT.
- *
- * @since 1.2
- */
- public static final int VK_CUT = 65489;
-
- /**
- * The virtual key VK_COPY.
- *
- * @since 1.2
- */
- public static final int VK_COPY = 65485;
-
- /**
- * The virtual key VK_PASTE.
- *
- * @since 1.2
- */
- public static final int VK_PASTE = 65487;
-
- /**
- * The virtual key VK_UNDO.
- *
- * @since 1.2
- */
- public static final int VK_UNDO = 65483;
-
- /**
- * The virtual key VK_AGAIN.
- *
- * @since 1.2
- */
- public static final int VK_AGAIN = 65481;
-
- /**
- * The virtual key VK_FIND.
- *
- * @since 1.2
- */
- public static final int VK_FIND = 65488;
-
- /**
- * The virtual key VK_PROPS.
- *
- * @since 1.2
- */
- public static final int VK_PROPS = 65482;
-
- /**
- * The virtual key VK_STOP.
- *
- * @since 1.2
- */
- public static final int VK_STOP = 65480;
-
- /**
- * The virtual key VK_COMPOSE.
- *
- * @since 1.2
- */
- public static final int VK_COMPOSE = 65312;
-
- /**
- * The virtual key VK_ALT_GRAPH.
- *
- * @since 1.2
- */
- public static final int VK_ALT_GRAPH = 65406;
-
- /**
- * The virtual key VK_UNDEFINED. This is used for key typed events, which
- * do not have a virtual key.
- */
- public static final int VK_UNDEFINED = 0;
-
- /**
- * The only char with no valid Unicode interpretation. This is used for
- * key pressed and key released events which do not have a valid keyChar.
- */
- public static final char CHAR_UNDEFINED = '\uffff';
-
- /**
- * Indicates unknown or irrelavent key location. This is also used for
- * key typed events, which do not need a location.
- *
- * @since 1.4
- */
- public static final int KEY_LOCATION_UNKNOWN = 0;
-
- /**
- * Indicates a standard key location, with no left/right variants and not
- * on the numeric pad.
- *
- * @since 1.4
- */
- public static final int KEY_LOCATION_STANDARD = 1;
-
- /**
- * Indicates the key is on the left side of the keyboard, such as the left
- * shift.
- *
- * @since 1.4
- */
- public static final int KEY_LOCATION_LEFT = 2;
-
- /**
- * Indicates the key is on the right side of the keyboard, such as the right
- * shift.
- *
- * @since 1.4
- */
- public static final int KEY_LOCATION_RIGHT = 3;
-
- /**
- * Indicates the key is on the numeric pad, such as the numpad 0.
- *
- * @since 1.4
- */
- public static final int KEY_LOCATION_NUMPAD = 4;
-
- /**
- * The code assigned to the physical keyboard location (as adjusted by the
- * keyboard layout). Use the symbolic VK_* names instead of numbers.
- *
- * @see #getKeyCode()
- * @serial the VK_ code for this key
- */
- private int keyCode;
-
- /**
- * The Unicode character produced by the key type event. This has no meaning
- * for key pressed and key released events.
- *
- * @see #getKeyChar()
- * @serial the Unicode value for this key
- */
- private char keyChar;
-
- /**
- * The keyboard location of the key. One of {@link #KEY_LOCATION_UNKNOWN},
- * {@link #KEY_LOCATION_STANDARD}, {@link #KEY_LOCATION_LEFT},
- * {@link #KEY_LOCATION_RIGHT}, or {@link #KEY_LOCATION_NUMPAD}.
- *
- * @see #getKeyLocation()
- * @serial the key location
- * @since 1.4
- */
- private final int keyLocation;
-
- /**
- * Stores the state of the native event dispatching system, to correctly
- * dispatch in Component#dispatchEventImpl when a proxy is active.
- *
- * XXX Does this matter in Classpath?
- *
- * @serial whether the proxy is active
- */
- private boolean isProxyActive;
-
-
- /**
- * Initializes a new instance of <code>KeyEvent</code> with the specified
- * information. Note that an invalid id leads to unspecified results.
- *
- * @param source the component that generated this event
- * @param id the event id
- * @param when the timestamp when the even occurred
- * @param modifiers the modifier keys during the event, in old or new style
- * @param keyCode the integer constant for the virtual key type
- * @param keyChar the Unicode value of the key
- * @param keyLocation the location of the key
- * @throws IllegalArgumentException if source is null, if keyLocation is
- * invalid, or if (id == KEY_TYPED && (keyCode != VK_UNDEFINED
- * || keyChar == CHAR_UNDEFINED))
- */
- public KeyEvent(Component source, int id, long when, int modifiers,
- int keyCode, char keyChar, int keyLocation)
- {
- super(source, id, when, modifiers);
- this.keyCode = keyCode;
- this.keyChar = keyChar;
- this.keyLocation = keyLocation;
- if ((id == KEY_TYPED && (keyCode != VK_UNDEFINED
- || keyChar == CHAR_UNDEFINED))
- || keyLocation < KEY_LOCATION_UNKNOWN
- || keyLocation > KEY_LOCATION_NUMPAD)
- throw new IllegalArgumentException();
- }
-
- /**
- * Initializes a new instance of <code>KeyEvent</code> with the specified
- * information. Note that an invalid id leads to unspecified results.
- *
- * @param source the component that generated this event
- * @param id the event id
- * @param when the timestamp when the even occurred
- * @param modifiers the modifier keys during the event, in old or new style
- * @param keyCode the integer constant for the virtual key type
- * @param keyChar the Unicode value of the key
- * @throws IllegalArgumentException if source is null, or if
- * (id == KEY_TYPED && (keyCode != VK_UNDEFINED
- * || keyChar == CHAR_UNDEFINED))
- */
- public KeyEvent(Component source, int id, long when, int modifiers,
- int keyCode, char keyChar)
- {
- this(source, id, when, modifiers, keyCode, keyChar, KEY_LOCATION_UNKNOWN);
- }
-
- /**
- * Initializes a new instance of <code>KeyEvent</code> with the specified
- * information. Note that an invalid id leads to unspecified results.
- *
- * @param source the component that generated this event
- * @param id the event id
- * @param when the timestamp when the even occurred
- * @param modifiers the modifier keys during the event, in old or new style
- * @param keyCode the integer constant for the virtual key type
- * @throws IllegalArgumentException if source is null, or if
- * id == KEY_TYPED but keyCode != VK_UNDEFINED
- *
- * @deprecated
- */
- public KeyEvent(Component source, int id, long when, int modifiers,
- int keyCode)
- {
- this(source, id, when, modifiers, keyCode, '\0', KEY_LOCATION_UNKNOWN);
- }
-
- /**
- * Returns the key code for the event key. This will be one of the
- * <code>VK_*</code> constants defined in this class. If the event type is
- * KEY_TYPED, the result will be VK_UNDEFINED.
- *
- * @return the key code for this event
- */
- public int getKeyCode()
- {
- return keyCode;
- }
-
- /**
- * Sets the key code for this event. This must be one of the
- * <code>VK_*</code> constants defined in this class.
- *
- * @param keyCode the new key code for this event
- */
- public void setKeyCode(int keyCode)
- {
- this.keyCode = keyCode;
- }
-
- /**
- * Returns the Unicode value for the event key. This will be
- * <code>CHAR_UNDEFINED</code> if there is no Unicode equivalent for
- * this key, usually when this is a KEY_PRESSED or KEY_RELEASED event.
- *
- * @return the Unicode character for this event
- */
- public char getKeyChar()
- {
- return keyChar;
- }
-
- /**
- * Sets the Unicode character for this event to the specified value.
- *
- * @param keyChar the new Unicode character for this event
- */
- public void setKeyChar(char keyChar)
- {
- this.keyChar = keyChar;
- }
-
- /**
- * Sets the modifier keys to the specified value. This should be a union
- * of the bit mask constants from <code>InputEvent</code>. The use of this
- * method is not recommended, particularly for KEY_TYPED events, which do
- * not check if the modifiers were changed.
- *
- * @param modifiers the new modifier value, in either old or new style
- * @see InputEvent
- *
- * @deprecated
- */
- public void setModifiers(int modifiers)
- {
- this.modifiers = EventModifier.extend(modifiers);
- }
-
- /**
- * Returns the keyboard location of the key that generated this event. This
- * provides a way to distinguish between keys like left and right shift
- * which share a common key code. The result will be one of
- * {@link #KEY_LOCATION_UNKNOWN}, {@link #KEY_LOCATION_STANDARD},
- * {@link #KEY_LOCATION_LEFT}, {@link #KEY_LOCATION_RIGHT}, or
- * {@link #KEY_LOCATION_NUMPAD}.
- *
- * @return the key location
- * @since 1.4
- */
- public int getKeyLocation()
- {
- return keyLocation;
- }
-
- /**
- * Returns the text name of key code, such as "HOME", "F1", or "A".
- *
- * XXX Sun claims this can be localized via the awt.properties file - how
- * do we implement that?
- *
- * @return the text name of the key code
- */
- public static String getKeyText(int keyCode)
- {
- switch (keyCode)
- {
- case VK_CANCEL:
- return "Cancel";
- case VK_BACK_SPACE:
- return "Backspace";
- case VK_TAB:
- return "Tab";
- case VK_ENTER:
- return "Enter";
- case VK_CLEAR:
- return "Clear";
- case VK_SHIFT:
- return "Shift";
- case VK_CONTROL:
- return "Ctrl";
- case VK_ALT:
- return "Alt";
- case VK_PAUSE:
- return "Pause";
- case VK_CAPS_LOCK:
- return "Caps Lock";
- case VK_KANA:
- return "Kana";
- case VK_FINAL:
- return "Final";
- case VK_KANJI:
- return "Kanji";
- case VK_ESCAPE:
- return "Escape";
- case VK_CONVERT:
- return "Convert";
- case VK_NONCONVERT:
- return "No Convert";
- case VK_ACCEPT:
- return "Accept";
- case VK_MODECHANGE:
- return "Mode Change";
- case VK_SPACE:
- return "Space";
- case VK_PAGE_UP:
- return "Page Up";
- case VK_PAGE_DOWN:
- return "Page Down";
- case VK_END:
- return "End";
- case VK_HOME:
- return "Home";
- case VK_LEFT:
- case VK_KP_LEFT:
- return "Left";
- case VK_UP:
- case VK_KP_UP:
- return "Up";
- case VK_RIGHT:
- case VK_KP_RIGHT:
- return "Right";
- case VK_DOWN:
- case VK_KP_DOWN:
- return "Down";
- case VK_MINUS:
- return "Minus";
- case VK_MULTIPLY:
- return "NumPad *";
- case VK_ADD:
- return "NumPad +";
- case VK_SEPARATOR:
- return "NumPad ,";
- case VK_SUBTRACT:
- return "NumPad -";
- case VK_DECIMAL:
- return "NumPad .";
- case VK_DIVIDE:
- return "NumPad /";
- case VK_DELETE:
- return "Delete";
- case VK_DEAD_GRAVE:
- return "Dead Grave";
- case VK_DEAD_ACUTE:
- return "Dead Acute";
- case VK_DEAD_CIRCUMFLEX:
- return "Dead Circumflex";
- case VK_DEAD_TILDE:
- return "Dead Tilde";
- case VK_DEAD_MACRON:
- return "Dead Macron";
- case VK_DEAD_BREVE:
- return "Dead Breve";
- case VK_DEAD_ABOVEDOT:
- return "Dead Above Dot";
- case VK_DEAD_DIAERESIS:
- return "Dead Diaeresis";
- case VK_DEAD_ABOVERING:
- return "Dead Above Ring";
- case VK_DEAD_DOUBLEACUTE:
- return "Dead Double Acute";
- case VK_DEAD_CARON:
- return "Dead Caron";
- case VK_DEAD_CEDILLA:
- return "Dead Cedilla";
- case VK_DEAD_OGONEK:
- return "Dead Ogonek";
- case VK_DEAD_IOTA:
- return "Dead Iota";
- case VK_DEAD_VOICED_SOUND:
- return "Dead Voiced Sound";
- case VK_DEAD_SEMIVOICED_SOUND:
- return "Dead Semivoiced Sound";
- case VK_NUM_LOCK:
- return "Num Lock";
- case VK_SCROLL_LOCK:
- return "Scroll Lock";
- case VK_AMPERSAND:
- return "Ampersand";
- case VK_ASTERISK:
- return "Asterisk";
- case VK_QUOTEDBL:
- return "Double Quote";
- case VK_LESS:
- return "Less";
- case VK_PRINTSCREEN:
- return "Print Screen";
- case VK_INSERT:
- return "Insert";
- case VK_HELP:
- return "Help";
- case VK_META:
- return "Meta";
- case VK_GREATER:
- return "Greater";
- case VK_BRACELEFT:
- return "Left Brace";
- case VK_BRACERIGHT:
- return "Right Brace";
- case VK_BACK_QUOTE:
- return "Back Quote";
- case VK_QUOTE:
- return "Quote";
- case VK_ALPHANUMERIC:
- return "Alphanumeric";
- case VK_KATAKANA:
- return "Katakana";
- case VK_HIRAGANA:
- return "Hiragana";
- case VK_FULL_WIDTH:
- return "Full-Width";
- case VK_HALF_WIDTH:
- return "Half-Width";
- case VK_ROMAN_CHARACTERS:
- return "Roman Characters";
- case VK_ALL_CANDIDATES:
- return "All Candidates";
- case VK_PREVIOUS_CANDIDATE:
- return "Previous Candidate";
- case VK_CODE_INPUT:
- return "Code Input";
- case VK_JAPANESE_KATAKANA:
- return "Japanese Katakana";
- case VK_JAPANESE_HIRAGANA:
- return "Japanese Hiragana";
- case VK_JAPANESE_ROMAN:
- return "Japanese Roman";
- case VK_KANA_LOCK:
- return "Kana Lock";
- case VK_INPUT_METHOD_ON_OFF:
- return "Input Method On/Off";
- case VK_AT:
- return "At";
- case VK_COLON:
- return "Colon";
- case VK_CIRCUMFLEX:
- return "Circumflex";
- case VK_DOLLAR:
- return "Dollar";
- case VK_EURO_SIGN:
- return "Euro";
- case VK_EXCLAMATION_MARK:
- return "Exclamation Mark";
- case VK_INVERTED_EXCLAMATION_MARK:
- return "Inverted Exclamation Mark";
- case VK_LEFT_PARENTHESIS:
- return "Left Parenthesis";
- case VK_NUMBER_SIGN:
- return "Number Sign";
- case VK_PLUS:
- return "Plus";
- case VK_RIGHT_PARENTHESIS:
- return "Right Parenthesis";
- case VK_UNDERSCORE:
- return "Underscore";
- case VK_COMPOSE:
- return "Compose";
- case VK_ALT_GRAPH:
- return "Alt Graph";
- case VK_STOP:
- return "Stop";
- case VK_AGAIN:
- return "Again";
- case VK_PROPS:
- return "Props";
- case VK_UNDO:
- return "Undo";
- case VK_COPY:
- return "Copy";
- case VK_PASTE:
- return "Paste";
- case VK_FIND:
- return "Find";
- case VK_CUT:
- return "Cut";
- case VK_COMMA:
- case VK_PERIOD:
- case VK_SLASH:
- case VK_0:
- case VK_1:
- case VK_2:
- case VK_3:
- case VK_4:
- case VK_5:
- case VK_6:
- case VK_7:
- case VK_8:
- case VK_9:
- case VK_SEMICOLON:
- case VK_EQUALS:
- case VK_A:
- case VK_B:
- case VK_C:
- case VK_D:
- case VK_E:
- case VK_F:
- case VK_G:
- case VK_H:
- case VK_I:
- case VK_J:
- case VK_K:
- case VK_L:
- case VK_M:
- case VK_N:
- case VK_O:
- case VK_P:
- case VK_Q:
- case VK_R:
- case VK_S:
- case VK_T:
- case VK_U:
- case VK_V:
- case VK_W:
- case VK_X:
- case VK_Y:
- case VK_Z:
- case VK_OPEN_BRACKET:
- case VK_BACK_SLASH:
- case VK_CLOSE_BRACKET:
- return "" + (char) keyCode;
- case VK_NUMPAD0:
- case VK_NUMPAD1:
- case VK_NUMPAD2:
- case VK_NUMPAD3:
- case VK_NUMPAD4:
- case VK_NUMPAD5:
- case VK_NUMPAD6:
- case VK_NUMPAD7:
- case VK_NUMPAD8:
- case VK_NUMPAD9:
- return "NumPad-" + (keyCode - VK_NUMPAD0);
- case VK_F1:
- case VK_F2:
- case VK_F3:
- case VK_F4:
- case VK_F5:
- case VK_F6:
- case VK_F7:
- case VK_F8:
- case VK_F9:
- case VK_F10:
- case VK_F11:
- case VK_F12:
- return "F" + (keyCode - (VK_F1 - 1));
- case VK_F13:
- case VK_F14:
- case VK_F15:
- case VK_F16:
- case VK_F17:
- case VK_F18:
- case VK_F19:
- case VK_F20:
- case VK_F21:
- case VK_F22:
- case VK_F23:
- case VK_F24:
- return "F" + (keyCode - (VK_F13 - 13));
- default:
- // This is funky on negative numbers, but that's Sun's fault.
- return "Unknown keyCode: 0x" + (keyCode < 0 ? "-" : "")
- + Integer.toHexString(Math.abs(keyCode));
- }
- }
-
- /**
- * Returns a string describing the modifiers, such as "Shift" or
- * "Ctrl+Button1".
- *
- * XXX Sun claims this can be localized via the awt.properties file - how
- * do we implement that?
- *
- * @param modifiers the old-style modifiers to convert to text
- * @return a string representation of the modifiers in this bitmask
- */
- public static String getKeyModifiersText(int modifiers)
- {
- return getModifiersExText(EventModifier.extend(modifiers
- & EventModifier.OLD_MASK));
- }
-
- /**
- * Tests whether or not this key is an action key. An action key typically
- * does not fire a KEY_TYPED event, and is not a modifier.
- *
- * @return true if this is an action key
- */
- public boolean isActionKey()
- {
- switch (keyCode)
- {
- case VK_PAUSE:
- case VK_CAPS_LOCK:
- case VK_KANA:
- case VK_FINAL:
- case VK_KANJI:
- case VK_CONVERT:
- case VK_NONCONVERT:
- case VK_ACCEPT:
- case VK_MODECHANGE:
- case VK_PAGE_UP:
- case VK_PAGE_DOWN:
- case VK_END:
- case VK_HOME:
- case VK_LEFT:
- case VK_UP:
- case VK_RIGHT:
- case VK_DOWN:
- case VK_F1:
- case VK_F2:
- case VK_F3:
- case VK_F4:
- case VK_F5:
- case VK_F6:
- case VK_F7:
- case VK_F8:
- case VK_F9:
- case VK_F10:
- case VK_F11:
- case VK_F12:
- case VK_NUM_LOCK:
- case VK_SCROLL_LOCK:
- case VK_PRINTSCREEN:
- case VK_INSERT:
- case VK_HELP:
- case VK_KP_UP:
- case VK_KP_DOWN:
- case VK_KP_LEFT:
- case VK_KP_RIGHT:
- case VK_ALPHANUMERIC:
- case VK_KATAKANA:
- case VK_HIRAGANA:
- case VK_FULL_WIDTH:
- case VK_HALF_WIDTH:
- case VK_ROMAN_CHARACTERS:
- case VK_ALL_CANDIDATES:
- case VK_PREVIOUS_CANDIDATE:
- case VK_CODE_INPUT:
- case VK_JAPANESE_KATAKANA:
- case VK_JAPANESE_HIRAGANA:
- case VK_JAPANESE_ROMAN:
- case VK_KANA_LOCK:
- case VK_INPUT_METHOD_ON_OFF:
- case VK_F13:
- case VK_F14:
- case VK_F15:
- case VK_F16:
- case VK_F17:
- case VK_F18:
- case VK_F19:
- case VK_F20:
- case VK_F21:
- case VK_F22:
- case VK_F23:
- case VK_F24:
- case VK_STOP:
- case VK_AGAIN:
- case VK_PROPS:
- case VK_UNDO:
- case VK_COPY:
- case VK_PASTE:
- case VK_FIND:
- case VK_CUT:
- return true;
- default:
- return false;
- }
- }
-
- /**
- * Returns a string identifying the event. This is formatted as the
- * field name of the id type, followed by the keyCode, then the
- * keyChar, modifiers (if any), extModifiers (if any), and
- * keyLocation.
- *
- * @return a string identifying the event
- */
- public String paramString()
- {
- StringBuffer s = new StringBuffer();
-
- switch (id)
- {
- case KEY_PRESSED:
- s.append("KEY_PRESSED");
- break;
- case KEY_RELEASED:
- s.append("KEY_RELEASED");
- break;
- case KEY_TYPED:
- s.append("KEY_TYPED");
- break;
- default:
- s.append("unknown type");
- }
-
- s.append(",keyCode=").append(keyCode);
-
- s.append(",keyText=").append(getKeyText(keyCode));
-
- s.append(",keyChar=");
- if (isActionKey()
- || keyCode == VK_SHIFT
- || keyCode == VK_CONTROL
- || keyCode == VK_ALT)
- s.append("Undefined keyChar");
- else
- {
- /* This output string must be selected by examining keyChar
- * rather than keyCode, because key code information is not
- * included in KEY_TYPED events.
- */
- if (keyChar == VK_BACK_SPACE
- || keyChar == VK_TAB
- || keyChar == VK_ENTER
- || keyChar == VK_ESCAPE
- || keyChar == VK_DELETE)
- s.append(getKeyText(keyChar));
- else
- s.append("'").append(keyChar).append("'");
- }
-
- if ((modifiers & CONVERT_MASK) != 0)
- s.append(",modifiers=").append(getModifiersExText(modifiers
- & CONVERT_MASK));
- if (modifiers != 0)
- s.append(",extModifiers=").append(getModifiersExText(modifiers));
-
- s.append(",keyLocation=KEY_LOCATION_");
- switch (keyLocation)
- {
- case KEY_LOCATION_UNKNOWN:
- s.append("UNKNOWN");
- break;
- case KEY_LOCATION_STANDARD:
- s.append("STANDARD");
- break;
- case KEY_LOCATION_LEFT:
- s.append("LEFT");
- break;
- case KEY_LOCATION_RIGHT:
- s.append("RIGHT");
- break;
- case KEY_LOCATION_NUMPAD:
- s.append("NUMPAD");
- }
-
- return s.toString();
- }
-
- /**
- * Reads in the object from a serial stream.
- *
- * @param s the stream to read from
- * @throws IOException if deserialization fails
- * @throws ClassNotFoundException if deserialization fails
- * @serialData default, except that the modifiers are converted to new style
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- modifiers = EventModifier.extend(modifiers);
- }
-} // class KeyEvent
diff --git a/libjava/java/awt/event/KeyListener.java b/libjava/java/awt/event/KeyListener.java
deleted file mode 100644
index 5c0a640f67e..00000000000
--- a/libjava/java/awt/event/KeyListener.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* KeyListener.java -- listen for keyboard presses
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to receive keyboard events. To
- * watch a subset of these events, use a KeyAdapter.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see KeyAdapter
- * @see KeyEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface KeyListener extends EventListener
-{
- /**
- * This method is called when a key is typed. A key is considered typed
- * when it and all modifiers have been pressed and released, mapping to
- * a single virtual key.
- *
- * @param event the <code>KeyEvent</code> indicating that a key was typed
- */
- void keyTyped(KeyEvent event);
-
- /**
- * This method is called when a key is pressed.
- *
- * @param event the <code>KeyEvent</code> indicating the key press
- */
- void keyPressed(KeyEvent event);
-
- /**
- * This method is called when a key is released.
- *
- * @param event the <code>KeyEvent</code> indicating the key release
- */
- void keyReleased(KeyEvent event);
-} // interface KeyListener
diff --git a/libjava/java/awt/event/MouseAdapter.java b/libjava/java/awt/event/MouseAdapter.java
deleted file mode 100644
index 9f40c285ac7..00000000000
--- a/libjava/java/awt/event/MouseAdapter.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/* MouseAdapter.java -- convenience class for writing mouse listeners
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-/**
- * This class implements <code>MouseListener</code> and implements all methods
- * with empty bodies. This allows a listener interested in implementing only
- * a subset of the <code>MouseListener</code> interface to extend this class
- * and override only the desired methods.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see MouseEvent
- * @see MouseListener
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class MouseAdapter implements MouseListener
-{
- /**
- * Do nothing default constructor for subclasses.
- */
- public MouseAdapter()
- {
- }
-
- /**
- * Implements this method in the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void mouseClicked(MouseEvent event)
- {
- }
-
- /**
- * Implements this method in the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void mousePressed(MouseEvent event)
- {
- }
-
- /**
- * Implements this method in the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void mouseReleased(MouseEvent event)
- {
- }
-
- /**
- * Implements this method in the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void mouseEntered(MouseEvent event)
- {
- }
-
- /**
- * Implements this method in the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void mouseExited(MouseEvent event)
- {
- }
-} // class MouseAdapter
diff --git a/libjava/java/awt/event/MouseEvent.java b/libjava/java/awt/event/MouseEvent.java
deleted file mode 100644
index 249c3d112e4..00000000000
--- a/libjava/java/awt/event/MouseEvent.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/* MouseEvent.java -- a mouse event
- Copyright (C) 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import gnu.java.awt.EventModifier;
-
-import java.awt.Component;
-import java.awt.Point;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-/**
- * This event is generated for a mouse event. There are three main categories
- * of mouse events: Regular events include pressing, releasing, and clicking
- * buttons, as well as moving over the boundary of the unobscured portion of
- * a component. Motion events include movement and dragging. Wheel events are
- * covered separately by the subclass MouseWheelEvent.
- *
- * <p>A mouse event is tied to the unobstructed visible component that the
- * mouse cursor was over at the time of the action. The button that was
- * most recently pressed is the only one that shows up in
- * <code>getModifiers</code>, and is returned by <code>getButton</code>,
- * while all buttons that are down show up in <code>getModifiersEx</code>.
- *
- * <p>Drag events may be cut short if native drag-and-drop operations steal
- * the event. Likewise, if a mouse drag exceeds the bounds of a window or
- * virtual device, some platforms may clip the path to fit in the bounds of
- * the component.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see MouseAdapter
- * @see MouseListener
- * @see MouseMotionAdapter
- * @see MouseMotionListener
- * @see MouseWheelListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class MouseEvent extends InputEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -991214153494842848L;
-
- /** This is the first id in the range of event ids used by this class. */
- public static final int MOUSE_FIRST = 500;
-
- /** This is the last id in the range of event ids used by this class. */
- public static final int MOUSE_LAST = 507;
-
- /** This event id indicates that the mouse was clicked. */
- public static final int MOUSE_CLICKED = 500;
-
- /** This event id indicates that the mouse was pressed. */
- public static final int MOUSE_PRESSED = 501;
-
- /** This event id indicates that the mouse was released. */
- public static final int MOUSE_RELEASED = 502;
-
- /** This event id indicates that the mouse was moved. */
- public static final int MOUSE_MOVED = 503;
-
- /** This event id indicates that the mouse entered a component. */
- public static final int MOUSE_ENTERED = 504;
-
- /** This event id indicates that the mouse exited a component. */
- public static final int MOUSE_EXITED = 505;
-
- /**
- * This indicates that no button changed state.
- *
- * @see #getButton()
- * @since 1.4
- */
- public static final int NOBUTTON = 0;
-
- /**
- * This indicates that button 1 changed state.
- *
- * @see #getButton()
- * @since 1.4
- */
- public static final int BUTTON1 = 1;
-
- /**
- * This indicates that button 2 changed state.
- *
- * @see #getButton()
- * @since 1.4
- */
- public static final int BUTTON2 = 2;
-
- /**
- * This indicates that button 3 changed state.
- *
- * @see #getButton()
- * @since 1.4
- */
- public static final int BUTTON3 = 3;
-
- /** This event id indicates that the mouse was dragged over a component. */
- public static final int MOUSE_DRAGGED = 506;
-
- /**
- * This event id indicates that the mouse wheel was rotated.
- *
- * @since 1.4
- */
- public static final int MOUSE_WHEEL = 507;
-
- /**
- * The X coordinate of the mouse cursor at the time of the event.
- *
- * @see #getX()
- * @serial the x coordinate
- */
- private int x;
-
- /**
- * The Y coordinate of the mouse cursor at the time of the event.
- *
- * @see #getY()
- * @serial the y coordinate
- */
- private int y;
-
- /**
- * The number of clicks that took place. For MOUSE_CLICKED, MOUSE_PRESSED,
- * and MOUSE_RELEASED, this will be at least 1; otherwise it is 0.
- *
- * see #getClickCount()
- * @serial the number of clicks
- */
- private final int clickCount;
-
- /**
- * Indicates which mouse button changed state. Can only be one of
- * {@link #NOBUTTON}, {@link #BUTTON1}, {@link #BUTTON2}, or
- * {@link #BUTTON3}.
- *
- * @see #getButton()
- * @since 1.4
- */
- private int button;
-
- /**
- * Whether or not this event should trigger a popup menu.
- *
- * @see PopupMenu
- * @see #isPopupTrigger()
- * @serial true if this is a popup trigger
- */
- private final boolean popupTrigger;
-
- /**
- * Initializes a new instance of <code>MouseEvent</code> with the specified
- * information. Note that an invalid id leads to unspecified results.
- *
- * @param source the source of the event
- * @param id the event id
- * @param when the timestamp of when the event occurred
- * @param modifiers the modifier keys during the event, in old or new style
- * @param x the X coordinate of the mouse point
- * @param y the Y coordinate of the mouse point
- * @param clickCount the number of mouse clicks for this event
- * @param popupTrigger true if this event triggers a popup menu
- * @param button the most recent mouse button to change state
- * @throws IllegalArgumentException if source is null or button is invalid
- * @since 1.4
- */
- public MouseEvent(Component source, int id, long when, int modifiers,
- int x, int y, int clickCount, boolean popupTrigger,
- int button)
- {
- super(source, id, when, modifiers);
- this.x = x;
- this.y = y;
- this.clickCount = clickCount;
- this.popupTrigger = popupTrigger;
- this.button = button;
- if (button < NOBUTTON || button > BUTTON3)
- throw new IllegalArgumentException();
- if ((modifiers & EventModifier.OLD_MASK) != 0)
- {
- if ((modifiers & BUTTON1_MASK) != 0)
- this.button = BUTTON1;
- else if ((modifiers & BUTTON2_MASK) != 0)
- this.button = BUTTON2;
- else if ((modifiers & BUTTON3_MASK) != 0)
- this.button = BUTTON3;
- }
- }
-
- /**
- * Initializes a new instance of <code>MouseEvent</code> with the specified
- * information. Note that an invalid id leads to unspecified results.
- *
- * @param source the source of the event
- * @param id the event id
- * @param when the timestamp of when the event occurred
- * @param modifiers the modifier keys during the event, in old or new style
- * @param x the X coordinate of the mouse point
- * @param y the Y coordinate of the mouse point
- * @param clickCount the number of mouse clicks for this event
- * @param popupTrigger true if this event triggers a popup menu
- * @throws IllegalArgumentException if source is null
- */
- public MouseEvent(Component source, int id, long when, int modifiers,
- int x, int y, int clickCount, boolean popupTrigger)
- {
- this(source, id, when, modifiers, x, y, clickCount, popupTrigger,
- NOBUTTON);
- }
-
- /**
- * This method returns the X coordinate of the mouse position. This is
- * relative to the source component.
- *
- * @return the x coordinate
- */
- public int getX()
- {
- return x;
- }
-
- /**
- * This method returns the Y coordinate of the mouse position. This is
- * relative to the source component.
- *
- * @return the y coordinate
- */
- public int getY()
- {
- return y;
- }
-
- /**
- * This method returns a <code>Point</code> for the x,y position of
- * the mouse pointer. This is relative to the source component.
- *
- * @return a <code>Point</code> for the event position
- */
- public Point getPoint()
- {
- return new Point(x, y);
- }
-
- /**
- * Translates the event coordinates by the specified x and y offsets.
- *
- * @param dx the value to add to the X coordinate of this event
- * @param dy the value to add to the Y coordiante of this event
- */
- public void translatePoint(int dx, int dy)
- {
- x += dx;
- y += dy;
- }
-
- /**
- * This method returns the number of mouse clicks associated with this
- * event.
- *
- * @return the number of mouse clicks for this event
- */
- public int getClickCount()
- {
- return clickCount;
- }
-
- /**
- * Returns which button, if any, was the most recent to change state. This
- * will be one of {@link #NOBUTTON}, {@link #BUTTON1}, {@link #BUTTON2}, or
- * {@link #BUTTON3}.
- *
- * @return the button that changed state
- * @since 1.4
- */
- public int getButton()
- {
- return button;
- }
-
- /**
- * This method tests whether or not the event is a popup menu trigger. This
- * should be checked in both MousePressed and MouseReleased to be
- * cross-platform compatible, as different systems have different popup
- * triggers.
- *
- * @return true if the event is a popup menu trigger
- */
- public boolean isPopupTrigger()
- {
- return popupTrigger;
- }
-
- /**
- * Returns a string describing the modifiers, such as "Shift" or
- * "Ctrl+Button1".
- *
- * XXX Sun claims this can be localized via the awt.properties file - how
- * do we implement that?
- *
- * @param modifiers the old-style modifiers to convert to text
- * @return a string representation of the modifiers in this bitmask
- */
- public static String getMouseModifiersText(int modifiers)
- {
- modifiers &= EventModifier.OLD_MASK;
- if ((modifiers & BUTTON2_MASK) != 0)
- modifiers |= BUTTON2_DOWN_MASK;
- if ((modifiers & BUTTON3_MASK) != 0)
- modifiers |= BUTTON3_DOWN_MASK;
- return getModifiersExText(EventModifier.extend(modifiers));
- }
-
- /**
- * Returns a string identifying this event. This is formatted as the field
- * name of the id type, followed by the (x,y) point, the most recent button
- * changed, modifiers (if any), extModifiers (if any), and clickCount.
- *
- * @return a string identifying this event
- */
- public String paramString()
- {
- StringBuffer s = new StringBuffer();
- switch (id)
- {
- case MOUSE_CLICKED:
- s.append("MOUSE_CLICKED,(");
- break;
- case MOUSE_PRESSED:
- s.append("MOUSE_PRESSED,(");
- break;
- case MOUSE_RELEASED:
- s.append("MOUSE_RELEASED,(");
- break;
- case MOUSE_MOVED:
- s.append("MOUSE_MOVED,(");
- break;
- case MOUSE_ENTERED:
- s.append("MOUSE_ENTERED,(");
- break;
- case MOUSE_EXITED:
- s.append("MOUSE_EXITED,(");
- break;
- case MOUSE_DRAGGED:
- s.append("MOUSE_DRAGGED,(");
- break;
- case MOUSE_WHEEL:
- s.append("MOUSE_WHEEL,(");
- break;
- default:
- s.append("unknown type,(");
- }
- s.append(x).append(',').append(y).append("),button=").append(button);
- if ((modifiers & EventModifier.NEW_MASK) != 0)
- {
- int mod = modifiers;
- if ((mod & (ALT_DOWN_MASK | BUTTON2_DOWN_MASK)) != 0)
- mod |= ALT_DOWN_MASK | BUTTON2_DOWN_MASK;
- if ((mod & (META_DOWN_MASK | BUTTON3_DOWN_MASK)) != 0)
- mod |= META_DOWN_MASK | BUTTON3_DOWN_MASK;
- s.append(",modifiers=").append(getModifiersExText(mod));
- }
- if (modifiers != 0)
- s.append(",extModifiers=").append(getModifiersExText(modifiers));
- return s.append(",clickCount=").append(clickCount).toString();
- }
-
- /**
- * Reads in the object from a serial stream.
- *
- * @param s the stream to read from
- * @throws IOException if deserialization fails
- * @throws ClassNotFoundException if deserialization fails
- * @serialData default, except that the modifiers are converted to new style
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- if ((modifiers & EventModifier.OLD_MASK) != 0)
- {
- if ((modifiers & BUTTON1_MASK) != 0)
- button = BUTTON1;
- else if ((modifiers & BUTTON2_MASK) != 0)
- button = BUTTON2;
- else if ((modifiers & BUTTON3_MASK) != 0)
- button = BUTTON3;
- modifiers = EventModifier.extend(modifiers);
- }
- }
-} // class MouseEvent
diff --git a/libjava/java/awt/event/MouseListener.java b/libjava/java/awt/event/MouseListener.java
deleted file mode 100644
index 4508019e108..00000000000
--- a/libjava/java/awt/event/MouseListener.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* MouseListener.java -- listen for mouse clicks and crossing component edges
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to receive mouse events other than
- * simple motion events. This includes clicks (but not mouse wheel events),
- * and crossing component boundaries without change in button status. To
- * track moves and drags, use MouseMotionListener, and to track wheel events,
- * use MouseWheelListener. To watch a subset of these events, use a
- * MouseAdapter.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see MouseAdapter
- * @see MouseEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface MouseListener extends EventListener
-{
- /**
- * This method is called when the mouse is clicked (pressed and released
- * in short succession) on a component.
- *
- * @param event the <code>MouseEvent</code> indicating the click
- */
- void mouseClicked(MouseEvent event);
-
- /**
- * This method is called when the mouse is pressed over a component.
- *
- * @param event the <code>MouseEvent</code> for the press
- */
- void mousePressed(MouseEvent event);
-
- /**
- * This method is called when the mouse is released over a component.
- *
- * @param event the <code>MouseEvent</code> for the release
- */
- void mouseReleased(MouseEvent event);
-
- /**
- * This method is called when the mouse enters a component.
- *
- * @param event the <code>MouseEvent</code> for the entry
- */
- void mouseEntered(MouseEvent event);
-
- /**
- * This method is called when the mouse exits a component.
- *
- * @param event the <code>MouseEvent</code> for the exit
- */
- void mouseExited(MouseEvent event);
-} // interface MouseListener
diff --git a/libjava/java/awt/event/MouseMotionAdapter.java b/libjava/java/awt/event/MouseMotionAdapter.java
deleted file mode 100644
index 8a295f66cc0..00000000000
--- a/libjava/java/awt/event/MouseMotionAdapter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* MouseMotionAdapter.java -- convenience class for mouse motion listeners
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-/**
- * This class implements <code>MouseMotionListener</code> and implements all
- * methods with empty bodies. This allows a listener interested in
- * implementing only a subset of the <code>MouseMotionListener</code>
- * interface to extend this class and override only the desired methods.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see MouseEvent
- * @see MouseMotionListener
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class MouseMotionAdapter implements MouseMotionListener
-{
- /**
- * Do nothing default constructor for subclasses.
- */
- public MouseMotionAdapter()
- {
- }
-
- /**
- * Implement this method in the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void mouseDragged(MouseEvent event)
- {
- }
-
- /**
- * Implement this method in the interface with an empty body.
- *
- * @param event the event, ignored in this implementation
- */
- public void mouseMoved(MouseEvent event)
- {
- }
-} // class MouseMotionAdapter
diff --git a/libjava/java/awt/event/MouseMotionListener.java b/libjava/java/awt/event/MouseMotionListener.java
deleted file mode 100644
index ba2c5698b11..00000000000
--- a/libjava/java/awt/event/MouseMotionListener.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* MouseMotionListener.java -- listen to mouse motion events
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to be notified of mouse movements.
- * This includes moves and drags, but not crossing component boundaries. To
- * track other mouse events, use MouseListener or MouseWheelListener. To
- * watch a subset of these events, use a MouseMotionAdapter.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see MouseMotionAdapter
- * @see MouseEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface MouseMotionListener extends EventListener
-{
- /**
- * This method is called when the mouse is moved over a component
- * while a button has been pressed.
- *
- * @param event the <code>MouseEvent</code> indicating the motion
- */
- void mouseDragged(MouseEvent event);
-
- /**
- * This method is called when the mouse is moved over a component
- * while no button is pressed.
- *
- * @param event the <code>MouseEvent</code> indicating the motion
- */
- void mouseMoved(MouseEvent event);
-} // interface MouseMotionListener
diff --git a/libjava/java/awt/event/MouseWheelEvent.java b/libjava/java/awt/event/MouseWheelEvent.java
deleted file mode 100644
index 04286088bd1..00000000000
--- a/libjava/java/awt/event/MouseWheelEvent.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/* MouseWheelEvent.java -- a mouse wheel event
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.Component;
-
-/**
- * This event is generated for a mouse wheel rotation. The wheel (the middle
- * mouse button on most modern mice) can be rotated towards or away from the
- * user, and is ofteh used for scrolling.
- *
- * <p>Because of the special use for scrolling components, MouseWheelEvents
- * often affect a different component than the one located at the point of
- * the event. If the component under the mouse cursor does not accept wheel
- * events, the event is passed to the first ancestor container which does. This
- * is often a ScrollPane, which knows how to scroll. If an AWT component is
- * built from a native widget that knows how to use mouse wheel events, that
- * component will consume the event.
- *
- * <p>The two most common scroll types are "units" (lines at a time) or
- * "blocks" (pages at a time). The initial setting is taken from the platform,
- * although the user can adjust the setting at any time.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see MouseWheelListener
- * @see ScrollPane
- * @see ScrollPane#setWheelScrollingEnabled(boolean)
- * @see JScrollPane
- * @see JScrollPane#setWheelScrollingEnabled(boolean)
- * @since 1.4
- * @status updated to 1.4
- */
-public class MouseWheelEvent extends MouseEvent
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = 6459879390515399677L;
-
- /**
- * Indicates scrolling by units (lines).
- *
- * @see #getScrollType()
- */
- public static final int WHEEL_UNIT_SCROLL = 0;
-
- /**
- * Indicates scrolling by blocks (pages).
- *
- * @see #getScrollType()
- */
- public static final int WHEEL_BLOCK_SCROLL = 1;
-
- /**
- * Indicates what scroll type should take place. This should be limited
- * to {@link #WHEEL_UNIT_SCROLL} and {@link #WHEEL_BLOCK_SCROLL}.
- *
- * @serial the scroll type
- */
- private final int scrollType;
-
- /**
- * Indicates the scroll amount. This is only meaningful if scrollType is
- * WHEEL_UNIT_SCROLL.
- *
- * @serial the number of lines to scroll
- */
- private final int scrollAmount;
-
- /**
- * Indicates how far the mouse wheel was rotated.
- *
- * @serial the rotation amount
- */
- private final int wheelRotation;
-
- /**
- * Initializes a new instance of <code>MouseWheelEvent</code> with the
- * specified information. Note that an invalid id leads to unspecified
- * results.
- *
- * @param source the source of the event
- * @param id the event id
- * @param when the timestamp of when the event occurred
- * @param modifiers any modifier bits for this event
- * @param x the X coordinate of the mouse point
- * @param y the Y coordinate of the mouse point
- * @param clickCount the number of mouse clicks for this event
- * @param popupTrigger true if this event triggers a popup menu
- * @param scrollType one of {@link #WHEEL_UNIT_SCROLL},
- * {@link #WHEEL_BLOCK_SCROLL}
- * @param scrollAmount the number of units to scroll, ignored for block type
- * @param wheelRotation the number of rotation "clicks"
- * @throws IllegalArgumentException if source is null
- * @see MouseEvent#MouseEvent(Component, int, long, int, int, int, int,
- * boolean)
- */
- public MouseWheelEvent(Component source, int id, long when, int modifiers,
- int x, int y, int clickCount, boolean popupTrigger,
- int scrollType, int scrollAmount, int wheelRotation)
- {
- super(source, id, when, modifiers, x, y, clickCount, popupTrigger);
- this.scrollType = scrollType;
- this.scrollAmount = scrollAmount;
- this.wheelRotation = wheelRotation;
- }
-
- /**
- * This method returns the scrolling pattern this event requests. Legal
- * values are WHEEL_UNIT_SCROLL and WHEEL_BLOCK_SCROLL.
- *
- * @return the scroll type
- * @see Adjustable#getUnitIncrement()
- * @see Adjustable#getBlockIncrement()
- * @see Scrollable#getScrollableUnitIncrement(Rectangle, int, int)
- * @see Scrollable#getScrollableBlockIncrement(Rectangle, int, int)
- */
- public int getScrollType()
- {
- return scrollType;
- }
-
- /**
- * Returns the number of units to scroll in response to this event. This
- * only makes sense when the scroll type is WHEEL_UNIT_SCROLL.
- *
- * @return the number of scroll units, if defined
- * @see #getScrollType()
- */
- public int getScrollAmount()
- {
- return scrollAmount;
- }
-
- /**
- * Gets the number of "clicks" the wheel was rotated. Negative values move
- * up (away) from the user, positive values move down (towards) the user.
- *
- * @return the number of rotation clicks
- */
- public int getWheelRotation()
- {
- return wheelRotation;
- }
-
- /**
- * This is a convenience method which aids in a common listener for scrolling
- * a scrollpane (although this is already built into ScrollPane and
- * JScrollPane). This method only makes sense when getScrollType() returns
- * WHEEL_UNIT_SCROLL.
- *
- * <p>This accounts for direction of scroll and amount of wheel movement, as
- * interpreted by the platform settings.
- *
- * @return the number of units to scroll
- * @see #getScrollType()
- * @see #getScrollAmount()
- * @see MouseWheelListener
- * @see Adjustable
- * @see Adjustable#getUnitIncrement()
- * @see Scrollable
- * @see Scrollable#getScrollableUnitIncrement(Rectangle, int, int)
- * @see ScrollPane
- * @see ScrollPane#setWheelScrollingEnabled(boolean)
- * @see JScrollPane
- * @see JScrollPane#setWheelScrollingEnabled(boolean)
- */
- public int getUnitsToScroll()
- {
- return wheelRotation * scrollAmount;
- }
-
- /**
- * Returns a string identifying this event. For mouse wheel events, this
- * is <code>super.paramString() + ",scrollType=WHEEL_" +
- * (getScrollType() == WHEEL_UNIT_SCROLL ? "UNIT" : "BLOCK")
- * + "_SCROLL,scrollAmount=" + getScrollAmount() + ",wheelRotation="
- * + getWheelRotation()</code>.
- *
- * @return a string identifying this event
- */
- public String paramString()
- {
- return super.paramString() + ",scrollType="
- + (scrollType == WHEEL_UNIT_SCROLL ? "WHEEL_UNIT_SCROLL"
- : scrollType == WHEEL_BLOCK_SCROLL ? "WHEEL_BLOCK_SCROLL"
- : "unknown scroll type")
- + ",scrollAmount=" + scrollAmount + ",wheelRotation=" + wheelRotation;
- }
-} // class MouseWheelEvent
diff --git a/libjava/java/awt/event/MouseWheelListener.java b/libjava/java/awt/event/MouseWheelListener.java
deleted file mode 100644
index 1125582e1df..00000000000
--- a/libjava/java/awt/event/MouseWheelListener.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* MouseWheelListener.java -- listen for mouse wheel events
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to receive mouse wheel events. For
- * other events, use MouseListener or MouseMotionListener.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see MouseWheelEvent
- * @since 1.4
- * @status updated to 1.4
- */
-public interface MouseWheelListener extends EventListener
-{
- /**
- * This method is called when the mouse wheel is rotated.
- *
- * @param event the <code>MouseWheelEvent</code> indicating the rotation
- */
- void mouseWheelMoved(MouseWheelEvent event);
-} // interface MouseWheelListener
diff --git a/libjava/java/awt/event/PaintEvent.java b/libjava/java/awt/event/PaintEvent.java
deleted file mode 100644
index bb89c3722b5..00000000000
--- a/libjava/java/awt/event/PaintEvent.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/* PaintEvent.java -- an area of the screen needs to be repainted
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.Component;
-import java.awt.Rectangle;
-
-/**
- * This event is generated when an area of the screen needs to be painted.
- * This event is not meant for users, but exists to allow proper serialization
- * behavior in the EventQueue with user-accessible events.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class PaintEvent extends ComponentEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 1267492026433337593L;
-
- /** This is the first id in the range of event ids used by this class. */
- public static final int PAINT_FIRST = 800;
-
- /** This is the last id in the range of event ids used by this class. */
- public static final int PAINT_LAST = 801;
-
- /** This id is for paint event types. */
- public static final int PAINT = 800;
-
- /** This id is for update event types. */
- public static final int UPDATE = 801;
-
- /**
- * This is the rectange to be painted or updated.
- *
- * @see #getUpdateRect()
- * @see #setUpdateRect(Rectangle)
- * @serial the non-null rectangle to be painted
- */
- private Rectangle updateRect;
-
- /**
- * Initializes a new instance of <code>PaintEvent</code> with the specified
- * source, id, and update region. Note that an invalid id leads to
- * unspecified results.
- *
- * @param source the event source
- * @param id the event id
- * @param updateRect the rectangle to repaint
- * @throws IllegalArgumentException if source is null
- */
- public PaintEvent(Component source, int id, Rectangle updateRect)
- {
- super(source, id);
- this.updateRect = updateRect;
- }
-
- /**
- * Returns the rectange to be updated for this event.
- *
- * @return the rectangle to update
- */
- public Rectangle getUpdateRect()
- {
- return updateRect;
- }
-
- /**
- * Sets the rectangle to be updated for this event.
- *
- * @param updateRect the new update rectangle for this event
- */
- public void setUpdateRect(Rectangle updateRect)
- {
- this.updateRect = updateRect;
- }
-
- /**
- * Returns a string identifying this event.
- *
- * @return a string identifying this event
- */
- public String paramString()
- {
- return (id == PAINT ? "PAINT,updateRect=" : id == UPDATE
- ? "UPDATE,updateRect=" : "unknown type,updateRect=") + updateRect;
- }
-} // class PaintEvent
diff --git a/libjava/java/awt/event/TextEvent.java b/libjava/java/awt/event/TextEvent.java
deleted file mode 100644
index 43f4bb0e95b..00000000000
--- a/libjava/java/awt/event/TextEvent.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* TextEvent.java -- event for text changes
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.AWTEvent;
-
-/**
- * This event is generated when a text box changes contents. This is an
- * abstraction that distills a large number of individual mouse or keyboard
- * events into a simpler "text changed" event.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see TextComponent
- * @see TextListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class TextEvent extends AWTEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 6269902291250941179L;
-
- /** This is the first id in the range of event ids used by this class. */
- public static final int TEXT_FIRST = 900;
-
- /** This is the last id in the range of event ids used by this class. */
- public static final int TEXT_LAST = 900;
-
- /** This event id indicates that the text of an object has changed. */
- public static final int TEXT_VALUE_CHANGED = 900;
-
- /**
- * Initializes a new instance of <code>TextEvent</code> with the specified
- * source and id. Note that an invalid id leads to unspecified results.
- *
- * @param source the (TextComponent) object that generated this event
- * @param id the event id
- * @throws IllegalArgumentException if source is null
- */
- public TextEvent(Object source, int id)
- {
- super(source, id);
- }
-
- /**
- * Returns a string identifying this event. This is "TEXT_VALUE_CHANGED".
- *
- * @return a string identifying this event
- */
- public String paramString()
- {
- return id == TEXT_VALUE_CHANGED ? "TEXT_VALUE_CHANGED" : "unknown type";
- }
-} // class TextEvent
diff --git a/libjava/java/awt/event/TextListener.java b/libjava/java/awt/event/TextListener.java
deleted file mode 100644
index bcdd7fa7a11..00000000000
--- a/libjava/java/awt/event/TextListener.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* TextListener.java -- listen for text changes
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to be notified when text changes
- * in a component.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see TextEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface TextListener extends EventListener
-{
- /**
- * This method is called when the text being monitored changes.
- *
- * @param event the <code>TextEvent</code> indicating the change
- */
- void textValueChanged(TextEvent event);
-} // interface TextListener
diff --git a/libjava/java/awt/event/WindowAdapter.java b/libjava/java/awt/event/WindowAdapter.java
deleted file mode 100644
index 708de588c05..00000000000
--- a/libjava/java/awt/event/WindowAdapter.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* WindowAdapter.java -- convenience class for writing window listeners
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-/**
- * This class implements <code>WindowListener</code>,
- * <code>WindowStateListener</code>, and <code>WindowFocusListener</code>, and
- * implements all methods with empty bodies. This allows a listener
- * interested in listening to only a subset of any <code>WindowEvent</code>
- * actions to extend this class and override only the desired methods.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see ComponentEvent
- * @see ComponentListener
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class WindowAdapter
- implements WindowListener, WindowStateListener, WindowFocusListener
-{
- /**
- * Do nothing default constructor for subclasses.
- */
- public WindowAdapter()
- {
- }
-
- /**
- * Implements this method from the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void windowOpened(WindowEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void windowClosing(WindowEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void windowClosed(WindowEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void windowIconified(WindowEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void windowDeiconified(WindowEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void windowActivated(WindowEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- */
- public void windowDeactivated(WindowEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- * @since 1.4
- */
- public void windowStateChanged(WindowEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- * @since 1.4
- */
- public void windowGainedFocus(WindowEvent event)
- {
- }
-
- /**
- * Implements this method from the interface with an empty method body.
- *
- * @param event the event, ignored in this implementation
- * @since 1.4
- */
- public void windowLostFocus(WindowEvent event)
- {
- }
-} // class WindowAdapter
diff --git a/libjava/java/awt/event/WindowEvent.java b/libjava/java/awt/event/WindowEvent.java
deleted file mode 100644
index 19229ca9dbc..00000000000
--- a/libjava/java/awt/event/WindowEvent.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/* WindowEvent.java -- window change event
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.awt.Window;
-
-/**
- * This event is generated when there is a change in a window. This includes
- * creation, closing, iconification, activation, and focus changes. There
- * are three listeners, for three types of events: WindowListeners deal with
- * the lifecycle of a window, WindowStateListeners deal with window state
- * like maximization, and WindowFocusListeners deal with focus switching to
- * or from a window.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see WindowAdapter
- * @see WindowListener
- * @see WindowFocusListener
- * @see WindowStateListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class WindowEvent extends ComponentEvent
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -1567959133147912127L;
-
- /** This is the first id in the range of event ids used by this class. */
- public static final int WINDOW_FIRST = 200;
-
- /** This is the id for a window that is opened. */
- public static final int WINDOW_OPENED = 200;
-
- /** This is the id for a window that is about to close. */
- public static final int WINDOW_CLOSING = 201;
-
- /** This is the id for a window that finished closing. */
- public static final int WINDOW_CLOSED = 202;
-
- /** This is the id for a window that is iconified. */
- public static final int WINDOW_ICONIFIED = 203;
-
- /** This is the id for a window that is de-iconified. */
- public static final int WINDOW_DEICONIFIED = 204;
-
- /** This is the id for a window that is activated. */
- public static final int WINDOW_ACTIVATED = 205;
-
- /** This is the id for a window that is de-activated. */
- public static final int WINDOW_DEACTIVATED = 206;
-
- /**
- * This is the id for a window becoming the focused window.
- *
- * @since 1.4
- */
- public static final int WINDOW_GAINED_FOCUS = 207;
-
- /**
- * This is the id for a window losing all focus.
- *
- * @since 1.4
- */
- public static final int WINDOW_LOST_FOCUS = 208;
-
- /**
- * This is the id for a window state change, such as maximization.
- *
- * @since 1.4
- */
- public static final int WINDOW_STATE_CHANGED = 209;
-
- /** This is the last id in the range of event ids used by this class. */
- public static final int WINDOW_LAST = 209;
-
- /**
- * The other Window involved in a focus or activation change. For
- * WINDOW_ACTIVATED and WINDOW_GAINED_FOCUS events, this is the window that
- * lost focus; for WINDOW_DEACTIVATED and WINDOW_LOST_FOCUS, this is the
- * window that stole focus; and for other events (or when native
- * implementation does not have the data available), this is null.
- *
- * @see #getOppositeWindow()
- * @serial the opposite window, or null
- * @since 1.4
- */
- private final Window opposite;
-
- /**
- * The former state of the window.
- *
- * @serial bitmask of the old window state
- * @since 1.4
- */
- private final int oldState;
-
- /**
- * The present state of the window.
- *
- * @serial bitmask of the new window state
- * @since 1.4
- */
- private final int newState;
-
- /**
- * Initializes a new instance of <code>WindowEvent</code> with the specified
- * parameters. Note that an invalid id leads to unspecified results.
- *
- * @param source the window that generated this event
- * @param id the event id
- * @param opposite the window that received the opposite event, or null
- * @param oldState the previous state of this window
- * @param newState the new state of this window
- * @throws IllegalArgumentException if source is null
- * @since 1.4
- */
- public WindowEvent(Window source, int id, Window opposite,
- int oldState, int newState)
- {
- super(source, id);
- this.opposite = opposite;
- this.oldState = oldState;
- this.newState = newState;
- }
-
- /**
- * Initializes a new instance of <code>WindowEvent</code> with the specified
- * parameters. Note that an invalid id leads to unspecified results.
- *
- * @param source the window that generated this event
- * @param id the event id
- * @param opposite the window that received the opposite event, or null
- * @throws IllegalArgumentException if source is null
- * @since 1.4
- */
- public WindowEvent(Window source, int id, Window opposite)
- {
- this(source, id, opposite, 0, 0);
- }
-
- /**
- * Initializes a new instance of <code>WindowEvent</code> with the specified
- * parameters. Note that an invalid id leads to unspecified results.
- *
- * @param source the window that generated this event
- * @param id the event id
- * @param oldState the previous state of this window
- * @param newState the new state of this window
- * @throws IllegalArgumentException if source is null
- * @since 1.4
- */
- public WindowEvent(Window source, int id, int oldState, int newState)
- {
- this(source, id, null, oldState, newState);
- }
-
- /**
- * Initializes a new instance of <code>WindowEvent</code> with the specified
- * parameters. Note that an invalid id leads to unspecified results.
- *
- * @param source the window that generated this event
- * @param id the event id
- * @throws IllegalArgumentException if source is null
- */
- public WindowEvent(Window source, int id)
- {
- this(source, id, null, 0, 0);
- }
-
- /**
- * Returns the event source as a <code>Window</code>. If the source has
- * subsequently been modified to a non-Window, this returns null.
- *
- * @return the event source as a <code>Window</code>
- */
- public Window getWindow()
- {
- return source instanceof Window ? (Window) source : null;
- }
-
- /**
- * Returns the opposite window if this window was involved in an activation
- * or focus change. For WINDOW_ACTIVATED and WINDOW_GAINED_FOCUS events,
- * this is the window that lost focus; for WINDOW_DEACTIVATED and
- * WINDOW_LOST_FOCUS, this is the window that stole focus; and for other
- * events (or when native implementation does not have the data available),
- * this is null.
- *
- * @return the opposite window, or null
- * @since 1.4
- */
- public Window getOppositeWindow()
- {
- return opposite;
- }
-
- /**
- * Returns the state of this window before the event. This is the bitwise
- * or of fields in Frame: NORMAL, ICONIFIED, MAXIMIZED_HORIZ, MAXIMIZED_VERT,
- * and MAXIMIZED_BOTH.
- *
- * @return the former state
- * @see Frame#getExtendedState()
- * @since 1.4
- */
- public int getOldState()
- {
- return oldState;
- }
-
- /**
- * Returns the state of this window after the event. This is the bitwise
- * or of fields in Frame: NORMAL, ICONIFIED, MAXIMIZED_HORIZ, MAXIMIZED_VERT,
- * and MAXIMIZED_BOTH.
- *
- * @return the updated state
- * @see Frame#getExtendedState()
- * @since 1.4
- */
- public int getNewState()
- {
- return newState;
- }
-
- /**
- * Returns a string that identifies this event. This is formatted as the
- * field name of the id, followed by the opposite window, old state, and
- * new state.
- *
- * @return a string that identifies this event
- */
- public String paramString()
- {
- StringBuffer s = new StringBuffer();
- switch (id)
- {
- case WINDOW_OPENED:
- s.append("WINDOW_OPENED,opposite=");
- break;
- case WINDOW_CLOSING:
- s.append("WINDOW_CLOSING,opposite=");
- break;
- case WINDOW_CLOSED:
- s.append("WINDOW_CLOSED,opposite=");
- break;
- case WINDOW_ICONIFIED:
- s.append("WINDOW_ICONIFIED,opposite=");
- break;
- case WINDOW_DEICONIFIED:
- s.append("WINDOW_DEICONIFIED,opposite=");
- break;
- case WINDOW_ACTIVATED:
- s.append("WINDOW_ACTIVATED,opposite=");
- break;
- case WINDOW_DEACTIVATED:
- s.append("WINDOW_DEACTIVATED,opposite=");
- break;
- case WINDOW_GAINED_FOCUS:
- s.append("WINDOW_GAINED_FOCUS,opposite=");
- break;
- case WINDOW_LOST_FOCUS:
- s.append("WINDOW_LOST_FOCUS,opposite=");
- break;
- case WINDOW_STATE_CHANGED:
- s.append("WINDOW_STATE_CHANGED,opposite=");
- break;
- default:
- s.append("unknown type,opposite=");
- }
- return s.append(opposite).append(",oldState=").append(oldState)
- .append(",newState=").append(newState).toString();
- }
-} // class WindowEvent
diff --git a/libjava/java/awt/event/WindowFocusListener.java b/libjava/java/awt/event/WindowFocusListener.java
deleted file mode 100644
index 738425353e3..00000000000
--- a/libjava/java/awt/event/WindowFocusListener.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* WindowFocusListener.java -- listens for window focus events
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to monitor events for window
- * focus changes. To watch a subset of these events, use a WindowAdapter.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see WindowAdapter
- * @see WindowEvent
- * @since 1.4
- * @status updated to 1.4
- */
-public interface WindowFocusListener extends EventListener
-{
- /**
- * This method is called when a window gains focus.
- *
- * @param event the <code>WindowEvent</code> indicating the focus change
- */
- void windowGainedFocus(WindowEvent event);
-
- /**
- * This method is called when a window loses focus.
- *
- * @param event the <code>WindowEvent</code> indicating the focus change
- */
- void windowLostFocus(WindowEvent event);
-} // interface WindowFocusListener
diff --git a/libjava/java/awt/event/WindowListener.java b/libjava/java/awt/event/WindowListener.java
deleted file mode 100644
index 3b0a1da23ef..00000000000
--- a/libjava/java/awt/event/WindowListener.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* WindowListener.java -- listens for window events
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to monitor events for window
- * changes. To watch a subset of these events, use a WindowAdapter.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see WindowAdapter
- * @see WindowEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface WindowListener extends EventListener
-{
- /**
- * This method is called when the window is made visible.
- *
- * @param event the <code>WindowEvent</code> indicating the change
- */
- void windowOpened(WindowEvent event);
-
- /**
- * This method is called when the user calls the system menu close
- * function, giving the program a chance to cancel the close.
- *
- * @param event the <code>WindowEvent</code> indicating the close attempt
- */
- void windowClosing(WindowEvent event);
-
- /**
- * This method is called when the window is closed.
- *
- * @param event the <code>WindowEvent</code> indicating the dispose
- */
- void windowClosed(WindowEvent event);
-
- /**
- * This method is called when the window is iconified.
- *
- * @param event the <code>WindowEvent</code> indicating the iconification
- * @see Frame#setIconImage(Image)
- */
- void windowIconified(WindowEvent event);
-
- /**
- * This method is called when the window is deiconified.
- *
- * @param event the <code>WindowEvent</code> indicating the deiconification
- */
- void windowDeiconified(WindowEvent event);
-
- /**
- * This method is called when a window is activated. Only Frames and Dialogs
- * can be active, and the active window always contains the component with
- * focus.
- *
- * @param event the <code>WindowEvent</code> indicating the activation
- */
- void windowActivated(WindowEvent event);
-
- /**
- * This method is called when the window is deactivated.
- *
- * @param event the <code>WindowEvent</code> indicating the deactivation
- */
- void windowDeactivated(WindowEvent event);
-} // interface WindowListener
diff --git a/libjava/java/awt/event/WindowStateListener.java b/libjava/java/awt/event/WindowStateListener.java
deleted file mode 100644
index 9bc6174fda1..00000000000
--- a/libjava/java/awt/event/WindowStateListener.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* WindowStateListener.java -- listens for window state changes
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.event;
-
-import java.util.EventListener;
-
-/**
- * This interface is for classes that wish to monitor events for window
- * state changes.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see WindowAdapter
- * @see WindowEvent
- * @since 1.4
- * @status updated to 1.4
- */
-public interface WindowStateListener extends EventListener
-{
- /**
- * This method is called when the window state is changed, because of
- * iconification or maximization.
- *
- * @param event the <code>WindowEvent</code> indicating the change
- */
- void windowStateChanged(WindowEvent event);
-} // interface WindowStateListener
diff --git a/libjava/java/awt/font/FontRenderContext.java b/libjava/java/awt/font/FontRenderContext.java
deleted file mode 100644
index 78564a647da..00000000000
--- a/libjava/java/awt/font/FontRenderContext.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* FontRenderContext.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.awt.geom.AffineTransform;
-
-/**
- * @author Michael Koch
- */
-public class FontRenderContext
-{
- private AffineTransform affineTransform;
- private boolean isAntiAliased;
- private boolean usesFractionalMetrics;
-
- /**
- * Construct a new <code>FontRenderContext</code>.
- */
- protected FontRenderContext()
- {
- // Do nothing here.
- }
-
- /**
- * Construct a new <code>FontRenderContext</code>.
- */
- public FontRenderContext (AffineTransform tx, boolean isAntiAliased,
- boolean usesFractionalMetrics)
- {
- if (tx != null
- && !tx.isIdentity ())
- {
- this.affineTransform = new AffineTransform (tx);
- }
-
- this.isAntiAliased = isAntiAliased;
- this.usesFractionalMetrics = usesFractionalMetrics;
- }
-
- public boolean equals (Object obj)
- {
- if (! (obj instanceof FontRenderContext))
- return false;
-
- return equals ((FontRenderContext) obj);
- }
-
- public boolean equals (FontRenderContext rhs)
- {
- return (affineTransform.equals (rhs.getTransform ())
- && isAntiAliased == rhs.isAntiAliased ()
- && usesFractionalMetrics == rhs.usesFractionalMetrics ());
- }
-
-
- /**
- * Retrieves the affine transform for scaling typographical points
- * to raster pixels.
- *
- * @return a clone of the transform object.
- */
- public AffineTransform getTransform ()
- {
- if (affineTransform == null)
- return new AffineTransform ();
- else
- return new AffineTransform (affineTransform);
- }
-
-
- /**
- * Returns the hash code of the font render context.
- */
- public int hashCode ()
- {
- // FIXME: check what SUN does here.
- return affineTransform == null ? 0 : affineTransform.hashCode ();
- }
-
- public boolean isAntiAliased ()
- {
- return isAntiAliased;
- }
-
- public boolean usesFractionalMetrics ()
- {
- return usesFractionalMetrics;
- }
-}
-
diff --git a/libjava/java/awt/font/GlyphJustificationInfo.java b/libjava/java/awt/font/GlyphJustificationInfo.java
deleted file mode 100644
index 5f45fd58498..00000000000
--- a/libjava/java/awt/font/GlyphJustificationInfo.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* GlyphJustificationInfo.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-/**
- * @author Michael Koch
- */
-public final class GlyphJustificationInfo
-{
- public static final int PRIORITY_KASHIDA = 0;
- public static final int PRIORITY_WHITESPACE = 1;
- public static final int PRIORITY_INTERCHAR = 2;
- public static final int PRIORITY_NONE = 3;
-
- public final float weight;
- public final int growPriority;
- public final boolean growAbsorb;
- public final float growLeftLimit;
- public final float growRightLimit;
- public final int shrinkPriority;
- public final boolean shrinkAbsorb;
- public final float shrinkLeftLimit;
- public final float shrinkRightLimit;
-
- public GlyphJustificationInfo (float weight, boolean growAbsorb,
- int growPriority, float growLeftLimit,
- float growRightLimit, boolean shrinkAbsorb,
- int shrinkPriority, float shrinkLeftLimit,
- float shrinkRightLimit)
- {
- this.weight = weight;
- this.growAbsorb = growAbsorb;
- this.growPriority = growPriority;
- this.growLeftLimit = growLeftLimit;
- this.growRightLimit = growRightLimit;
- this.shrinkAbsorb = shrinkAbsorb;
- this.shrinkPriority = shrinkPriority;
- this.shrinkLeftLimit = shrinkLeftLimit;
- this.shrinkRightLimit = shrinkRightLimit;
- }
-}
diff --git a/libjava/java/awt/font/GlyphMetrics.java b/libjava/java/awt/font/GlyphMetrics.java
deleted file mode 100644
index 28b2088cf8e..00000000000
--- a/libjava/java/awt/font/GlyphMetrics.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/* GlyphMetrics.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.awt.geom.Rectangle2D;
-
-/**
- * @author Michael Koch
- */
-public final class GlyphMetrics
-{
- public static final byte COMBINING = 2;
- public static final byte COMPONENT = 3;
- public static final byte LIGATURE = 1;
- public static final byte STANDARD = 0;
- public static final byte WHITESPACE = 4;
-
- private boolean horizontal;
- private float advanceX;
- private float advanceY;
- private Rectangle2D bounds;
- private byte glyphType;
-
- public GlyphMetrics (boolean horizontal, float advanceX, float advanceY,
- Rectangle2D bounds, byte glyphType)
- {
- this.horizontal = horizontal;
- this.advanceX = advanceX;
- this.advanceY = advanceY;
- this.bounds = bounds;
- this.glyphType = glyphType;
- }
-
- public GlyphMetrics (float advance, Rectangle2D bounds, byte glyphType)
- {
- this (true, advance, advance, bounds, glyphType);
- }
-
- public float getAdvance ()
- {
- return horizontal ? advanceX : advanceY;
- }
-
- public float getAdvanceX ()
- {
- return advanceX;
- }
-
- public float getAdvanceY ()
- {
- return advanceY;
- }
-
- public Rectangle2D getBounds2D ()
- {
- return bounds;
- }
-
- public float getLSB ()
- {
- throw new Error ("not implemented");
- }
-
- public float getRSB ()
- {
- throw new Error ("not implemented");
- }
-
- public int getType ()
- {
- return glyphType;
- }
-
- public boolean isCombining ()
- {
- return (glyphType == COMBINING);
- }
-
- public boolean isComponent ()
- {
- return (glyphType == COMPONENT);
- }
-
- public boolean isLigature()
- {
- return (glyphType == LIGATURE);
- }
-
- public boolean isStandard()
- {
- return (glyphType == STANDARD);
- }
-
- public boolean isWhitespace()
- {
- return (glyphType == WHITESPACE);
- }
-}
diff --git a/libjava/java/awt/font/GlyphVector.java b/libjava/java/awt/font/GlyphVector.java
deleted file mode 100644
index 57e2581edb4..00000000000
--- a/libjava/java/awt/font/GlyphVector.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/* GlyphVector.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.awt.Font;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-
-/**
- * @author Michael Koch
- */
-public abstract class GlyphVector implements Cloneable
-{
- public static final int FLAG_COMPLEX_GLYPHS = 8;
- public static final int FLAG_HAS_POSITION_ADJUSTMENTS = 2;
- public static final int FLAG_HAS_TRANSFORMS = 1;
- public static final int FLAG_MASK = 15;
- public static final int FLAG_RUN_RTL = 4;
-
- /**
- * Constructs a <code>GlyphVector</code> object.
- */
- public GlyphVector ()
- {
- }
-
- public abstract boolean equals (GlyphVector set);
-
- public abstract Font getFont ();
-
- public abstract FontRenderContext getFontRenderContext ();
-
- public int getGlyphCharIndex (int glyphIndex)
- {
- throw new Error ("not implemented");
- }
-
- public int[] getGlyphCharIndices (int beginGlyphIndex, int numEntries,
- int[] codeReturn)
- {
- throw new Error ("not implemented");
- }
-
- public abstract int getGlyphCode (int glyphIndex);
-
- public abstract int[] getGlyphCodes (int beginGlyphIndex, int numEntries,
- int[] codeReturn);
-
- public abstract GlyphJustificationInfo getGlyphJustificationInfo
- (int glyphIndex);
-
- public abstract Shape getGlyphLogicalBounds (int glyphIndex);
-
- public abstract GlyphMetrics getGlyphMetrics (int glyphIndex);
-
- public abstract Shape getGlyphOutline (int glyphIndex);
-
- public Shape getGlyphOutline (int glyphIndex, float x, float y)
- {
- throw new Error ("not implemented");
- }
-
- public Rectangle getGlyphPixelBounds (int index, FontRenderContext renderFRC,
- float x, float y)
- {
- throw new Error ("not implemented");
- }
-
- public abstract Point2D getGlyphPosition (int glyphIndex);
-
- public abstract float[] getGlyphPositions (int beginGlyphIndex,
- int numEntries,
- float[] positionReturn);
-
- public abstract AffineTransform getGlyphTransform (int glyphIndex);
-
- public abstract Shape getGlyphVisualBounds (int glyphIndex);
-
- public int getLayoutFlags ()
- {
- throw new Error ("not implemented");
- }
-
- public abstract Rectangle2D getLogicalBounds ();
-
- public abstract int getNumGlyphs ();
-
- public abstract Shape getOutline ();
-
- public abstract Shape getOutline (float x, float y);
-
- public Rectangle getPixelBounds (FontRenderContext renderFRC,
- float x, float y)
- {
- throw new Error ("not implemented");
- }
-
- public abstract Rectangle2D getVisualBounds ();
-
- public abstract void performDefaultLayout ();
-
- public abstract void setGlyphPosition (int glyphIndex, Point2D newPos);
-
- public abstract void setGlyphTransform (int glyphIndex,
- AffineTransform newTX);
-}
diff --git a/libjava/java/awt/font/GraphicAttribute.java b/libjava/java/awt/font/GraphicAttribute.java
deleted file mode 100644
index 79eae9955f5..00000000000
--- a/libjava/java/awt/font/GraphicAttribute.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* GraphicAttribute.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.awt.Graphics2D;
-import java.awt.geom.Rectangle2D;
-
-/**
- * @author Michael Koch
- */
-public abstract class GraphicAttribute
-{
- public static final int BOTTOM_ALIGNMENT = -2;
- public static final int CENTER_BASELINE = 1;
- public static final int HANGING_BASELINE = 2;
- public static final int ROMAN_BASELINE = 0;
- public static final int TOP_ALIGNMENT = -1;
-
- private int alignment;
-
- protected GraphicAttribute (int alignment)
- {
- this.alignment = alignment;
- }
-
- public abstract void draw (Graphics2D graphics, float x, float y);
-
- public abstract float getAdvance ();
-
- public final int getAlignment ()
- {
- return alignment;
- }
-
- public abstract float getAscent ();
-
- public Rectangle2D getBounds ()
- {
- throw new Error ("not implemented");
- }
-
- public abstract float getDescent ();
-
- public GlyphJustificationInfo getJustificationInfo ()
- {
- throw new Error ("not implemented");
- }
-}
diff --git a/libjava/java/awt/font/ImageGraphicAttribute.java b/libjava/java/awt/font/ImageGraphicAttribute.java
deleted file mode 100644
index 77413f95dfc..00000000000
--- a/libjava/java/awt/font/ImageGraphicAttribute.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* ImageGraphicAttribute.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.awt.Graphics2D;
-import java.awt.Image;
-import java.awt.geom.Rectangle2D;
-
-/**
- * @author Michael Koch
- */
-public final class ImageGraphicAttribute extends GraphicAttribute
-{
- private Image image;
-
- public ImageGraphicAttribute (Image image, int alignment)
- {
- super (alignment);
- this.image = image;
- }
-
- public ImageGraphicAttribute (Image image, int alignment, float originX,
- float originY)
- {
- super (alignment);
- this.image = image;
-
- throw new Error ("not implemented");
- }
-
- public void draw (Graphics2D graphics, float x, float y)
- {
- throw new Error ("not implemented");
- }
-
- public boolean equals (Object obj)
- {
- if (! (obj instanceof ImageGraphicAttribute))
- return false;
-
- return equals ((ImageGraphicAttribute) obj);
- }
-
- public boolean equals (ImageGraphicAttribute rhs)
- {
- throw new Error ("not implemented");
- }
-
- public float getAdvance ()
- {
- throw new Error ("not implemented");
- }
-
- public float getAscent ()
- {
- throw new Error ("not implemented");
- }
-
- public Rectangle2D getBounds ()
- {
- throw new Error ("not implemented");
- }
-
- public float getDescent ()
- {
- throw new Error ("not implemented");
- }
-
- public int hashCode ()
- {
- throw new Error ("not implemented");
- }
-}
diff --git a/libjava/java/awt/font/LineBreakMeasurer.java b/libjava/java/awt/font/LineBreakMeasurer.java
deleted file mode 100644
index 0a6a96922bd..00000000000
--- a/libjava/java/awt/font/LineBreakMeasurer.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* LineBreakMeasurer.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.text.AttributedCharacterIterator;
-import java.text.BreakIterator;
-
-public final class LineBreakMeasurer
-{
- private AttributedCharacterIterator ci;
- private FontRenderContext frc;
- private BreakIterator bi;
-
- /**
- * Constructs a <code>LineBreakMeasurer</code> object.
- */
- public LineBreakMeasurer (AttributedCharacterIterator text,
- FontRenderContext frc)
- {
- this (text, null, frc);
- }
-
- /**
- * Constructs a <code>LineBreakMeasurer</code> object.
- */
- public LineBreakMeasurer (AttributedCharacterIterator text,
- BreakIterator breakIter, FontRenderContext frc)
- {
- this.ci = text;
- this.bi = breakIter;
- this.frc = frc;
- }
-
- public void deleteChar (AttributedCharacterIterator newParagraph,
- int deletePos)
- {
- throw new Error ("not implemented");
- }
-
- public int getPosition ()
- {
- return ci.getIndex ();
- }
-
- public void insertChar (AttributedCharacterIterator newParagraph,
- int insertPos)
- {
- throw new Error ("not implemented");
- }
-
- public TextLayout nextLayout (float wrappingWidth)
- {
- throw new Error ("not implemented");
- }
-
- public TextLayout nextLayout (float wrappingWidth, int offsetLimit,
- boolean requireNextWord)
- {
- throw new Error ("not implemented");
- }
-
- public int nextOffset (float wrappingWidth)
- {
- throw new Error ("not implemented");
- }
-
- public int nextOffset (float wrappingWidth, int offsetLimit,
- boolean requireNextWord)
- {
- throw new Error ("not implemented");
- }
-
- public void setPosition (int newPosition)
- {
- ci.setIndex (newPosition);
- }
-}
diff --git a/libjava/java/awt/font/LineMetrics.java b/libjava/java/awt/font/LineMetrics.java
deleted file mode 100644
index 3c45ad19a6e..00000000000
--- a/libjava/java/awt/font/LineMetrics.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* LineMetrics.java -- Information about about a line display characteristics
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-/**
- * @author Michael Koch
- */
-public abstract class LineMetrics
-{
- public abstract float getAscent();
-
- public abstract int getBaselineIndex();
-
- public abstract float[] getBaselineOffsets();
-
- public abstract float getDescent();
-
- public abstract float getHeight();
-
- public abstract float getLeading();
-
- public abstract int getNumChars();
-
- public abstract float getStrikethroughOffset();
-
- public abstract float getStrikethroughThickness();
-
- public abstract float getUnderlineOffset();
-
- public abstract float getUnderlineThickness();
-}
diff --git a/libjava/java/awt/font/MultipleMaster.java b/libjava/java/awt/font/MultipleMaster.java
deleted file mode 100644
index 57417ea6010..00000000000
--- a/libjava/java/awt/font/MultipleMaster.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* MultipleMaster.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.awt.Font;
-
-/**
- * @author Michael Koch
- */
-public interface MultipleMaster
-{
- Font deriveMMFont (float[] axes);
-
- Font deriveMMFont (float[] glyphWidths, float avgStemWidth,
- float typicalCapHeight, float typicalXHeight,
- float italicAngle);
-
- float[] getDesignAxisDefaults();
-
- String[] getDesignAxisNames();
-
- float[] getDesignAxisRanges();
-
- int getNumDesignAxes();
-}
diff --git a/libjava/java/awt/font/NumericShaper.java b/libjava/java/awt/font/NumericShaper.java
deleted file mode 100644
index efbdcd49dc4..00000000000
--- a/libjava/java/awt/font/NumericShaper.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* NumericShaper.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.io.Serializable;
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public final class NumericShaper implements Serializable
-{
- private static final long serialVersionUID = -8022764705923730308L;
-
- public static final int ALL_RANGES = 524287;
- public static final int ARABIC = 2;
- public static final int BENGALI = 16;
- public static final int DEVANAGARI = 8;
- public static final int EASTERN_ARABIC = 4;
- public static final int ETHIOPIC = 65536;
- public static final int EUROPEAN = 1;
- public static final int GUJARATI = 64;
- public static final int GURMUKHI = 32;
- public static final int KANNADA = 1024;
- public static final int KHMER = 131072;
- public static final int LAO = 8192;
- public static final int MALAYALAM = 2048;
- public static final int MONGOLIAN = 262144;
- public static final int MYANMAR = 32768;
- public static final int ORIYA = 128;
- public static final int TAMIL = 256;
- public static final int TELUGU = 512;
- public static final int THAI = 4096;
- public static final int TIBETAN = 16384;
-
- private int ranges;
- private int context;
-
- private NumericShaper (int ranges, int context)
- {
- this.ranges = ranges;
- this.context = context;
- }
-
- public boolean equals (Object obj)
- {
- if (! (obj instanceof NumericShaper))
- return false;
-
- NumericShaper tmp = (NumericShaper) obj;
-
- return (ranges == tmp.ranges
- && context == tmp.context);
- }
-
- public static NumericShaper getContextualShaper (int ranges)
- {
- throw new Error ("not implemented");
- }
-
- public static NumericShaper getContextualShaper (int ranges,
- int defaultContext)
- {
- throw new Error ("not implemented");
- }
-
- public int getRanges ()
- {
- return ranges;
- }
-
- public static NumericShaper getShaper (int singleRange)
- {
- throw new Error ("not implemented");
- }
-
- public int hashCode ()
- {
- throw new Error ("not implemented");
- }
-
- public boolean isContextual ()
- {
- throw new Error ("not implemented");
- }
-
- public void shape (char[] text, int start, int count)
- {
- shape (text, start, count, context);
- }
-
- public void shape (char[] text, int start, int count, int context)
- {
- throw new Error ("not implemented");
- }
-
- public String toString ()
- {
- throw new Error ("not implemented");
- }
-}
diff --git a/libjava/java/awt/font/OpenType.java b/libjava/java/awt/font/OpenType.java
deleted file mode 100644
index ece3279cc7f..00000000000
--- a/libjava/java/awt/font/OpenType.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/* OpenType.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-/**
- * @author Michael Koch
- */
-public interface OpenType
-{
- int TAG_ACNT = 1633906292;
- int TAG_AVAR = 1635148146;
- int TAG_BASE = 1111577413;
- int TAG_BDAT = 1650745716;
- int TAG_BLOC = 1651273571;
- int TAG_BSLN = 1651731566;
- int TAG_CFF = 1128678944;
- int TAG_CMAP = 1668112752;
- int TAG_CVAR = 1668702578;
- int TAG_CVT = 1668707360;
- int TAG_DSIG = 1146308935;
- int TAG_EBDT = 1161970772;
- int TAG_EBLC = 1161972803;
- int TAG_EBSC = 1161974595;
- int TAG_FDSC = 1717859171;
- int TAG_FEAT = 1717920116;
- int TAG_FMTX = 1718449272;
- int TAG_FPGM = 1718642541;
- int TAG_FVAR = 1719034226;
- int TAG_GASP = 1734439792;
- int TAG_GDEF = 1195656518;
- int TAG_GLYF = 1735162214;
- int TAG_GPOS = 1196445523;
- int TAG_GSUB = 1196643650;
- int TAG_GVAR = 1735811442;
- int TAG_HDMX = 1751412088;
- int TAG_HEAD = 1751474532;
- int TAG_HHEA = 1751672161;
- int TAG_HMTX = 1752003704;
- int TAG_JSTF = 1246975046;
- int TAG_JUST = 1786082164;
- int TAG_KERN = 1801810542;
- int TAG_LCAR = 1818452338;
- int TAG_LOCA = 1819239265;
- int TAG_LTSH = 1280594760;
- int TAG_MAXP = 1835104368;
- int TAG_MMFX = 1296909912;
- int TAG_MMSD = 1296913220;
- int TAG_MORT = 1836020340;
- int TAG_NAME = 1851878757;
- int TAG_OPBD = 1836020340;
- int TAG_OS2 = 1330851634;
- int TAG_PCLT = 1346587732;
- int TAG_POST = 1886352244;
- int TAG_PREP = 1886545264;
- int TAG_PROP = 1886547824;
- int TAG_TRAK = 1953653099;
- int TAG_TYP1 = 1954115633;
- int TAG_VDMX = 1447316824;
- int TAG_VHEA = 1986553185;
- int TAG_VMTX = 1986884728;
-
- byte[] getFontTable (int sfntTag);
-
- byte[] getFontTable (int sfntTag, int offset, int count);
-
- byte[] getFontTable (String strSfntTag);
-
- byte[] getFontTable (String strSfntTag, int offset, int count);
-
- int getFontTableSize (int sfntTag);
-
- int getFontTableSize (String strSfntTag);
-
- int getVersion ();
-}
diff --git a/libjava/java/awt/font/ShapeGraphicAttribute.java b/libjava/java/awt/font/ShapeGraphicAttribute.java
deleted file mode 100644
index 6d64dece5d8..00000000000
--- a/libjava/java/awt/font/ShapeGraphicAttribute.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/* ShapeGraphicAttribute.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import java.awt.geom.Rectangle2D;
-
-public final class ShapeGraphicAttribute extends GraphicAttribute
-{
- public static final boolean FILL = false;
- public static final boolean STROKE = true;
-
- private Shape shape;
- private boolean stroke;
-
- public ShapeGraphicAttribute (Shape shape, int alignment, boolean stroke)
- {
- super (alignment);
- this.shape = shape;
- this.stroke = stroke;
- }
-
- public void draw (Graphics2D graphics, float x, float y)
- {
- throw new Error ("not implemented");
- }
-
- public boolean equals (Object obj)
- {
- if (! (obj instanceof ShapeGraphicAttribute))
- return false;
-
- return equals ((ShapeGraphicAttribute) obj);
- }
-
- public boolean equals (ShapeGraphicAttribute rhs)
- {
- return (shape.equals (rhs.shape)
- && getAlignment () == rhs.getAlignment ()
- && stroke == rhs.stroke);
- }
-
- public float getAdvance ()
- {
- throw new Error ("not implemented");
- }
-
- public float getAscent ()
- {
- throw new Error ("not implemented");
- }
-
- public Rectangle2D getBounds ()
- {
- return shape.getBounds2D ();
- }
-
- public float getDescent ()
- {
- throw new Error ("not implemented");
- }
-
- public int hashCode ()
- {
- // FIXME: Check what SUN does here
- return shape.hashCode ();
- }
-}
diff --git a/libjava/java/awt/font/TextAttribute.java b/libjava/java/awt/font/TextAttribute.java
deleted file mode 100644
index 6f5ed59f915..00000000000
--- a/libjava/java/awt/font/TextAttribute.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/* TextAttribute.java --
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.io.InvalidObjectException;
-import java.text.AttributedCharacterIterator;
-
-/**
- * Attributes (and associated values) that can be used to define an
- * {@link java.text.AttributedString}.
- */
-public final class TextAttribute extends AttributedCharacterIterator.Attribute
-{
- private static final long serialVersionUID = 7744112784117861702L;
-
- /** A key for the background paint attribute. */
- public static final TextAttribute BACKGROUND =
- new TextAttribute("background");
-
- /** A key for the BIDI_EMBEDDING attribute. */
- public static final TextAttribute BIDI_EMBEDDING =
- new TextAttribute("bidi_embedding");
-
- /** A key for the CHAR_REPLACEMENT attribute. */
- public static final TextAttribute CHAR_REPLACEMENT =
- new TextAttribute("char_replacement");
-
- /** A key for the FAMILY attribute. */
- public static final TextAttribute FAMILY = new TextAttribute("family");
-
- /** A key for the font attribute. */
- public static final TextAttribute FONT = new TextAttribute("font");
-
- /** A key for the foreground paint attribute. */
- public static final TextAttribute FOREGROUND =
- new TextAttribute("foreground");
-
- /** A key for the INPUT_METHOD_HIGHLIGHT attribute. */
- public static final TextAttribute INPUT_METHOD_HIGHLIGHT =
- new TextAttribute("input method highlight");
-
- /** A key for the INPUT_METHOD_UNDERLINE attribute. */
- public static final TextAttribute INPUT_METHOD_UNDERLINE =
- new TextAttribute("input method underline");
-
- /** A key for the text justification attribute. */
- public static final TextAttribute JUSTIFICATION =
- new TextAttribute("justification");
-
- /**
- * A value that can be used with the {@link #JUSTIFICATION} attribute to
- * indicate full justification of the text.
- */
- public static final Float JUSTIFICATION_FULL = new Float(1.0);
-
- /**
- * A value that can be used with the {@link #JUSTIFICATION} attribute to
- * indicate no justification of the text.
- */
- public static final Float JUSTIFICATION_NONE = new Float(0.0);
-
- /** A key for the NUMERIC_SHAPING attribute. */
- public static final TextAttribute NUMERIC_SHAPING =
- new TextAttribute("numeric_shaping");
-
- /** A key for the POSTURE attribute. */
- public static final TextAttribute POSTURE = new TextAttribute("posture");
-
- /** A value that can be used with the {@link #POSTURE} attribute. */
- public static final Float POSTURE_OBLIQUE = new Float(0.2);
-
- /** A value that can be used with the {@link #POSTURE} attribute. */
- public static final Float POSTURE_REGULAR = new Float(0.0);
-
- /** A key for the RUN_DIRECTION attribute. */
- public static final TextAttribute RUN_DIRECTION =
- new TextAttribute("run_direction");
-
- /** A value that can be used with the {@link #RUN_DIRECTION} attribute. */
- public static final Boolean RUN_DIRECTION_LTR = Boolean.FALSE;
-
- /** A value that can be used with the {@link #RUN_DIRECTION} attribute. */
- public static final Boolean RUN_DIRECTION_RTL = Boolean.TRUE;
-
- /** A key for the text size attribute. */
- public static final TextAttribute SIZE = new TextAttribute("size");
-
- /** A key for the STRIKETHROUGH attribute. */
- public static final TextAttribute STRIKETHROUGH =
- new TextAttribute("strikethrough");
-
- /** A value that can be used with the {@link #STRIKETHROUGH} attribute. */
- public static final Boolean STRIKETHROUGH_ON = Boolean.TRUE;
-
- /** A key for the SUPERSCRIPT attribute. */
- public static final TextAttribute SUPERSCRIPT =
- new TextAttribute("superscript");
-
- /** A value that can be used with the {@link #SUPERSCRIPT} attribute. */
- public static final Integer SUPERSCRIPT_SUB = new Integer(-1);
-
- /** A value that can be used with the {@link #SUPERSCRIPT} attribute. */
- public static final Integer SUPERSCRIPT_SUPER = new Integer(1);
-
- /** A key for the SWAP_COLORS attribute. */
- public static final TextAttribute SWAP_COLORS =
- new TextAttribute("swap_colors");
-
- /** A value that can be used with the {@link #SWAP_COLORS} attribute. */
- public static final Boolean SWAP_COLORS_ON = Boolean.TRUE;
-
- /** A key for the TRANFORM attribute. */
- public static final TextAttribute TRANSFORM = new TextAttribute("transform");
-
- /** A key for the UNDERLINE attribute. */
- public static final TextAttribute UNDERLINE = new TextAttribute("underline");
-
- /** A value that can be used with the {@link #UNDERLINE} attribute. */
- public static final Integer UNDERLINE_LOW_DASHED = new Integer(5);
-
- /** A value that can be used with the {@link #UNDERLINE} attribute. */
- public static final Integer UNDERLINE_LOW_DOTTED = new Integer(3);
-
- /** A value that can be used with the {@link #UNDERLINE} attribute. */
- public static final Integer UNDERLINE_LOW_GRAY = new Integer(4);
-
- /** A value that can be used with the {@link #UNDERLINE} attribute. */
- public static final Integer UNDERLINE_LOW_ONE_PIXEL = new Integer(1);
-
- /** A value that can be used with the {@link #UNDERLINE} attribute. */
- public static final Integer UNDERLINE_LOW_TWO_PIXEL = new Integer(2);
-
- /** A value that can be used with the {@link #UNDERLINE} attribute. */
- public static final Integer UNDERLINE_ON = new Integer(0);
-
- /** A key for the WEIGHT attribute. */
- public static final TextAttribute WEIGHT = new TextAttribute("weight");
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_BOLD = new Float(2.0);
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_DEMIBOLD = new Float(1.75);
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_DEMILIGHT = new Float(0.875);
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_EXTRA_LIGHT = new Float(0.5);
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_EXTRABOLD = new Float(2.5);
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_HEAVY = new Float(2.25);
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_LIGHT = new Float(0.75);
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_MEDIUM = new Float(1.5);
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_REGULAR = new Float(1.0);
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_SEMIBOLD = new Float(1.25);
-
- /** A value that can be used with the {@link #WEIGHT} attribute. */
- public static final Float WEIGHT_ULTRABOLD = new Float(2.75);
-
- /** A key for the WIDTH attribute. */
- public static final TextAttribute WIDTH = new TextAttribute("width");
-
- /** A value that can be used with the {@link #WIDTH} attribute. */
- public static final Float WIDTH_CONDENSED = new Float(0.75);
-
- /** A value that can be used with the {@link #WIDTH} attribute. */
- public static final Float WIDTH_EXTENDED = new Float(1.5);
-
- /** A value that can be used with the {@link #WIDTH} attribute. */
- public static final Float WIDTH_REGULAR = new Float(1.0);
-
- /** A value that can be used with the {@link #WIDTH} attribute. */
- public static final Float WIDTH_SEMI_CONDENSED = new Float(0.875);
-
- /** A value that can be used with the {@link #WIDTH} attribute. */
- public static final Float WIDTH_SEMI_EXTENDED = new Float(1.25);
-
- /**
- * Creates a new attribute.
- *
- * @param name the name.
- */
- protected TextAttribute(String name)
- {
- super(name);
- }
-
- /**
- * After deserialization, this method ensures that only one instance of
- * each attribute is used.
- *
- * @return The (single) attribute instance.
- *
- * @throws InvalidObjectException if the attribute is not recognised.
- */
- protected Object readResolve()
- throws InvalidObjectException
- {
- if (this.getName().equals("background"))
- return BACKGROUND;
-
- if (this.getName().equals("bidi_embedding"))
- return BIDI_EMBEDDING;
-
- if (this.getName().equals("char_replacement"))
- return CHAR_REPLACEMENT;
-
- if (this.getName().equals("family"))
- return FAMILY;
-
- if (this.getName().equals("font"))
- return FONT;
-
- if (this.getName().equals("foreground"))
- return FOREGROUND;
-
- if (this.getName().equals("input method highlight"))
- return INPUT_METHOD_HIGHLIGHT;
-
- if (this.getName().equals("input method underline"))
- return INPUT_METHOD_UNDERLINE;
-
- if (this.getName().equals("justification"))
- return JUSTIFICATION;
-
- if (this.getName().equals("numeric_shaping"))
- return NUMERIC_SHAPING;
-
- if (this.getName().equals("posture"))
- return POSTURE;
-
- if (this.getName().equals("run_direction"))
- return RUN_DIRECTION;
-
- if (this.getName().equals("size"))
- return SIZE;
-
- if (this.getName().equals("strikethrough"))
- return STRIKETHROUGH;
-
- if (this.getName().equals("superscript"))
- return SUPERSCRIPT;
-
- if (this.getName().equals("swap_colors"))
- return SWAP_COLORS;
-
- if (this.getName().equals("transform"))
- return TRANSFORM;
-
- if (this.getName().equals("underline"))
- return UNDERLINE;
-
- if (this.getName().equals("weight"))
- return WEIGHT;
-
- if (this.getName().equals("width"))
- return WIDTH;
-
- throw new InvalidObjectException("Can't resolve Attribute: " + getName());
- }
-}
diff --git a/libjava/java/awt/font/TextHitInfo.java b/libjava/java/awt/font/TextHitInfo.java
deleted file mode 100644
index 2b23e1963cd..00000000000
--- a/libjava/java/awt/font/TextHitInfo.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/* TextHitInfo.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-/**
- * @author John Leuner (jewel@debian.org)
- */
-public final class TextHitInfo
-{
- private int charIndex;
- private boolean leadingEdge;
-
- TextHitInfo (int charIndex, boolean leadingEdge)
- {
- this.charIndex = charIndex;
- this.leadingEdge = leadingEdge;
- }
-
- public int getCharIndex()
- {
- return charIndex;
- }
-
- public boolean isLeadingEdge()
- {
- return leadingEdge;
- }
-
- public int getInsertionIndex()
- {
- return (leadingEdge ? charIndex : charIndex + 1);
- }
-
- public int hashCode()
- {
- return charIndex;
- }
-
- public boolean equals(Object obj)
- {
- if(obj instanceof TextHitInfo)
- return this.equals((TextHitInfo) obj);
-
- return false;
- }
-
- public boolean equals(TextHitInfo hitInfo)
- {
- return (charIndex == hitInfo.getCharIndex ())
- && (leadingEdge == hitInfo.isLeadingEdge ());
- }
-
- public static TextHitInfo leading(int charIndex)
- {
- return new TextHitInfo (charIndex, true);
- }
-
- public static TextHitInfo trailing(int charIndex)
- {
- return new TextHitInfo (charIndex, false);
- }
-
- public static TextHitInfo beforeOffset(int offset)
- {
- return new TextHitInfo (offset, false);
- }
-
- public static TextHitInfo afterOffset(int offset)
- {
- return new TextHitInfo (offset, true);
- }
-
- public TextHitInfo getOtherHit()
- {
- return (leadingEdge ? trailing (charIndex - 1) : leading (charIndex + 1));
- }
-
- public TextHitInfo getOffsetHit(int offset)
- {
- return new TextHitInfo (charIndex + offset, leadingEdge);
- }
-
- public String toString()
- {
- return "TextHitInfo["
- + charIndex
- + (leadingEdge ? "L" : "T" )
- + "]";
- }
-}
diff --git a/libjava/java/awt/font/TextLayout.java b/libjava/java/awt/font/TextLayout.java
deleted file mode 100644
index bb641614a92..00000000000
--- a/libjava/java/awt/font/TextLayout.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/* TextLayout.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import gnu.java.awt.ClasspathToolkit;
-import gnu.java.awt.peer.ClasspathTextLayoutPeer;
-
-import java.awt.Font;
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import java.awt.Toolkit;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-import java.text.AttributedCharacterIterator;
-import java.text.AttributedString;
-import java.util.Map;
-
-/**
- * @author Michael Koch
- */
-public final class TextLayout implements Cloneable
-{
- public static final CaretPolicy DEFAULT_CARET_POLICY = new CaretPolicy ();
- ClasspathTextLayoutPeer peer;
-
- public static class CaretPolicy
- {
- public CaretPolicy ()
- {
- // Do nothing here.
- }
-
- public TextHitInfo getStrongCaret (TextHitInfo hit1, TextHitInfo hit2,
- TextLayout layout)
- {
- return layout.peer.getStrongCaret(hit1, hit2);
- }
- }
-
- public TextLayout (AttributedCharacterIterator text, FontRenderContext frc)
- {
- AttributedString as = new AttributedString (text);
- ClasspathToolkit tk = (ClasspathToolkit)(Toolkit.getDefaultToolkit ());
- peer = tk.getClasspathTextLayoutPeer(as, frc);
- }
-
- public TextLayout (String string, Font font, FontRenderContext frc)
- {
- AttributedString as = new AttributedString (string);
- as.addAttribute (TextAttribute.FONT, font);
- ClasspathToolkit tk = (ClasspathToolkit)(Toolkit.getDefaultToolkit ());
- peer = tk.getClasspathTextLayoutPeer(as, frc);
- }
-
- public TextLayout (String string, Map attributes, FontRenderContext frc)
- {
- AttributedString as = new AttributedString (string, attributes);
- ClasspathToolkit tk = (ClasspathToolkit)(Toolkit.getDefaultToolkit ());
- peer = tk.getClasspathTextLayoutPeer(as, frc);
- }
-
- protected Object clone ()
- {
- try
- {
- TextLayout tl = (TextLayout) super.clone ();
- tl.peer = (ClasspathTextLayoutPeer) this.peer.clone();
- return tl;
- }
- catch (CloneNotSupportedException e)
- {
- // This should never occur
- throw new InternalError ();
- }
- }
-
-
- public void draw (Graphics2D g2, float x, float y)
- {
- peer.draw(g2, x, y);
- }
-
- public boolean equals (Object obj)
- {
- if (! (obj instanceof TextLayout))
- return false;
-
- return equals ((TextLayout) obj);
- }
-
- public boolean equals (TextLayout tl)
- {
- return this.peer.equals(tl.peer);
- }
-
- public float getAdvance ()
- {
- return peer.getAdvance();
- }
-
- public float getAscent ()
- {
- return peer.getAscent();
- }
-
- public byte getBaseline ()
- {
- return peer.getBaseline();
- }
-
- public float[] getBaselineOffsets ()
- {
- return peer.getBaselineOffsets();
- }
-
- public Shape getBlackBoxBounds (int firstEndpoint, int secondEndpoint)
- {
- return peer.getBlackBoxBounds(firstEndpoint, secondEndpoint);
- }
-
- public Rectangle2D getBounds()
- {
- return peer.getBounds();
- }
-
- public float[] getCaretInfo (TextHitInfo hit)
- {
- return getCaretInfo(hit, getBounds());
- }
-
- public float[] getCaretInfo (TextHitInfo hit, Rectangle2D bounds)
- {
- return peer.getCaretInfo(hit, bounds);
- }
-
- public Shape getCaretShape (TextHitInfo hit)
- {
- return getCaretShape(hit, getBounds());
- }
-
- public Shape getCaretShape (TextHitInfo hit, Rectangle2D bounds)
- {
- return peer.getCaretShape(hit, bounds);
- }
-
- public Shape[] getCaretShapes (int offset)
- {
- return getCaretShapes(offset, getBounds());
- }
-
- public Shape[] getCaretShapes (int offset, Rectangle2D bounds)
- {
- return getCaretShapes(offset, getBounds(), DEFAULT_CARET_POLICY);
- }
-
- public Shape[] getCaretShapes (int offset, Rectangle2D bounds,
- TextLayout.CaretPolicy policy)
- {
- return peer.getCaretShapes(offset, bounds, policy);
- }
-
- public int getCharacterCount ()
- {
- return peer.getCharacterCount();
- }
-
- public byte getCharacterLevel (int index)
- {
- return peer.getCharacterLevel(index);
- }
-
- public float getDescent ()
- {
- return peer.getDescent();
- }
-
- public TextLayout getJustifiedLayout (float justificationWidth)
- {
- return peer.getJustifiedLayout(justificationWidth);
- }
-
- public float getLeading ()
- {
- return peer.getLeading();
- }
-
- public Shape getLogicalHighlightShape (int firstEndpoint, int secondEndpoint)
- {
- return getLogicalHighlightShape (firstEndpoint, secondEndpoint, getBounds());
- }
-
- public Shape getLogicalHighlightShape (int firstEndpoint, int secondEndpoint,
- Rectangle2D bounds)
- {
- return peer.getLogicalHighlightShape(firstEndpoint, secondEndpoint, bounds);
- }
-
- public int[] getLogicalRangesForVisualSelection (TextHitInfo firstEndpoint,
- TextHitInfo secondEndpoint)
- {
- return peer.getLogicalRangesForVisualSelection(firstEndpoint, secondEndpoint);
- }
-
- public TextHitInfo getNextLeftHit (int offset)
- {
- return getNextLeftHit(offset, DEFAULT_CARET_POLICY);
- }
-
- public TextHitInfo getNextLeftHit (int offset, TextLayout.CaretPolicy policy)
- {
- return peer.getNextLeftHit(offset, policy);
- }
-
- public TextHitInfo getNextLeftHit (TextHitInfo hit)
- {
- return getNextLeftHit(hit.getCharIndex());
- }
-
- public TextHitInfo getNextRightHit (int offset)
- {
- return getNextRightHit(offset, DEFAULT_CARET_POLICY);
- }
-
- public TextHitInfo getNextRightHit (int offset, TextLayout.CaretPolicy policy)
- {
- return peer.getNextRightHit(offset, policy);
- }
-
- public TextHitInfo getNextRightHit (TextHitInfo hit)
- {
- return getNextRightHit(hit.getCharIndex());
- }
-
- public Shape getOutline (AffineTransform tx)
- {
- return peer.getOutline(tx);
- }
-
- public float getVisibleAdvance ()
- {
- return peer.getVisibleAdvance();
- }
-
- public Shape getVisualHighlightShape (TextHitInfo firstEndpoint,
- TextHitInfo secondEndpoint)
- {
- return getVisualHighlightShape(firstEndpoint, secondEndpoint, getBounds());
- }
-
- public Shape getVisualHighlightShape (TextHitInfo firstEndpoint,
- TextHitInfo secondEndpoint,
- Rectangle2D bounds)
- {
- return peer.getVisualHighlightShape(firstEndpoint, secondEndpoint, bounds);
- }
-
- public TextHitInfo getVisualOtherHit (TextHitInfo hit)
- {
- return peer.getVisualOtherHit(hit);
- }
-
- protected void handleJustify (float justificationWidth)
- {
- peer.handleJustify(justificationWidth);
- }
-
- public int hashCode ()
- {
- return peer.hashCode();
- }
-
- public TextHitInfo hitTestChar (float x, float y)
- {
- return hitTestChar(x, y, getBounds());
- }
-
- public TextHitInfo hitTestChar (float x, float y, Rectangle2D bounds)
- {
- return peer.hitTestChar(x, y, bounds);
- }
-
- public boolean isLeftToRight ()
- {
- return peer.isLeftToRight();
- }
-
- public boolean isVertical ()
- {
- return peer.isVertical();
- }
-
- public String toString ()
- {
- return peer.toString();
- }
-}
diff --git a/libjava/java/awt/font/TextMeasurer.java b/libjava/java/awt/font/TextMeasurer.java
deleted file mode 100644
index 7fcdc87a83c..00000000000
--- a/libjava/java/awt/font/TextMeasurer.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* TextMeasurer.java
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.text.AttributedCharacterIterator;
-
-/**
- * @author Michael Koch
- * @since 1.3
- */
-public final class TextMeasurer implements Cloneable
-{
- private AttributedCharacterIterator ci;
- private FontRenderContext frc;
-
- public TextMeasurer (AttributedCharacterIterator text, FontRenderContext frc)
- {
- this.ci = text;
- this.frc = frc;
- }
-
- protected Object clone ()
- {
- try
- {
- return super.clone ();
- }
- catch (CloneNotSupportedException e)
- {
- // This may never occur
- throw new InternalError ();
- }
- }
-
- public void deleteChar (AttributedCharacterIterator newParagraph,
- int deletePos)
- {
- throw new Error ("not implemented");
- }
-
- public float getAdvanceBetween (int start, int limit)
- {
- throw new Error ("not implemented");
- }
-
- public TextLayout getLayout (int start, int limit)
- {
- throw new Error ("not implemented");
- }
-
- public int getLineBreakIndex (int start, float maxAdvance)
- {
- throw new Error ("not implemented");
- }
-
- public void insertChar (AttributedCharacterIterator newParagraph,
- int insertPos)
- {
- throw new Error ("not implemented");
- }
-}
diff --git a/libjava/java/awt/font/TransformAttribute.java b/libjava/java/awt/font/TransformAttribute.java
deleted file mode 100644
index 977cafa032e..00000000000
--- a/libjava/java/awt/font/TransformAttribute.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* TransformAttribute.java --
- Copyright (C) 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.font;
-
-import java.awt.geom.AffineTransform;
-import java.io.Serializable;
-
-/**
- * This class provides a mechanism for using an {@link AffineTransform} as
- * an <i>immutable</i> attribute (for example, in the
- * {@link java.text.AttributedString} class). Any transform passed to
- * this class is copied before being stored, and any transform handed out
- * by this class is a copy of the stored transform. In this way, it is
- * not possible to modify the stored transform.
- *
- * @author Michael Koch
- */
-public final class TransformAttribute implements Serializable
-{
- private static final long serialVersionUID = 3356247357827709530L;
-
- private AffineTransform affineTransform;
-
- /**
- * Creates a new attribute that contains a copy of the given transform.
- *
- * @param transform the transform (<code>null</code> not permitted).
- *
- * @throws IllegalArgumentException if <code>transform</code> is
- * <code>null</code>.
- */
- public TransformAttribute (AffineTransform transform)
- {
- if (transform == null)
- {
- throw new IllegalArgumentException("Null 'transform' not permitted.");
- }
- this.affineTransform = new AffineTransform (transform);
- }
-
- /**
- * Returns a copy of the transform contained by this attribute.
- *
- * @return A copy of the transform.
- */
- public AffineTransform getTransform ()
- {
- return (AffineTransform) affineTransform.clone();
- }
-
- /**
- * Returns <code>true</code> if the transform contained by this attribute is
- * an identity transform, and <code>false</code> otherwise.
- *
- * @return <code>true</code> if the transform contained by this attribute is
- * an identity transform, and <code>false</code> otherwise.
- *
- * @since 1.4
- */
- public boolean isIdentity ()
- {
- return (affineTransform == null ? false : affineTransform.isIdentity ());
- }
-}
diff --git a/libjava/java/awt/geom/AffineTransform.java b/libjava/java/awt/geom/AffineTransform.java
deleted file mode 100644
index 4d1a4d6d5d4..00000000000
--- a/libjava/java/awt/geom/AffineTransform.java
+++ /dev/null
@@ -1,1487 +0,0 @@
-/* AffineTransform.java -- transform coordinates between two 2-D spaces
- Copyright (C) 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.awt.Shape;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.Serializable;
-
-/**
- * This class represents an affine transformation between two coordinate
- * spaces in 2 dimensions. Such a transform preserves the "straightness"
- * and "parallelness" of lines. The transform is built from a sequence of
- * translations, scales, flips, rotations, and shears.
- *
- * <p>The transformation can be represented using matrix math on a 3x3 array.
- * Given (x,y), the transformation (x',y') can be found by:
- * <pre>
- * [ x'] [ m00 m01 m02 ] [ x ] [ m00*x + m01*y + m02 ]
- * [ y'] = [ m10 m11 m12 ] [ y ] = [ m10*x + m11*y + m12 ]
- * [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
- * </pre>
- * The bottom row of the matrix is constant, so a transform can be uniquely
- * represented (as in {@link #toString()}) by
- * "[[m00, m01, m02], [m10, m11, m12]]".
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status partially updated to 1.4, still has some problems
- */
-public class AffineTransform implements Cloneable, Serializable
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 1330973210523860834L;
-
- /**
- * The transformation is the identity (x' = x, y' = y). All other transforms
- * have either a combination of the appropriate transform flag bits for
- * their type, or the type GENERAL_TRANSFORM.
- *
- * @see #TYPE_TRANSLATION
- * @see #TYPE_UNIFORM_SCALE
- * @see #TYPE_GENERAL_SCALE
- * @see #TYPE_FLIP
- * @see #TYPE_QUADRANT_ROTATION
- * @see #TYPE_GENERAL_ROTATION
- * @see #TYPE_GENERAL_TRANSFORM
- * @see #getType()
- */
- public static final int TYPE_IDENTITY = 0;
-
- /**
- * The transformation includes a translation - shifting in the x or y
- * direction without changing length or angles.
- *
- * @see #TYPE_IDENTITY
- * @see #TYPE_UNIFORM_SCALE
- * @see #TYPE_GENERAL_SCALE
- * @see #TYPE_FLIP
- * @see #TYPE_QUADRANT_ROTATION
- * @see #TYPE_GENERAL_ROTATION
- * @see #TYPE_GENERAL_TRANSFORM
- * @see #getType()
- */
- public static final int TYPE_TRANSLATION = 1;
-
- /**
- * The transformation includes a uniform scale - length is scaled in both
- * the x and y directions by the same amount, without affecting angles.
- * This is mutually exclusive with TYPE_GENERAL_SCALE.
- *
- * @see #TYPE_IDENTITY
- * @see #TYPE_TRANSLATION
- * @see #TYPE_GENERAL_SCALE
- * @see #TYPE_FLIP
- * @see #TYPE_QUADRANT_ROTATION
- * @see #TYPE_GENERAL_ROTATION
- * @see #TYPE_GENERAL_TRANSFORM
- * @see #TYPE_MASK_SCALE
- * @see #getType()
- */
- public static final int TYPE_UNIFORM_SCALE = 2;
-
- /**
- * The transformation includes a general scale - length is scaled in either
- * or both the x and y directions, but by different amounts; without
- * affecting angles. This is mutually exclusive with TYPE_UNIFORM_SCALE.
- *
- * @see #TYPE_IDENTITY
- * @see #TYPE_TRANSLATION
- * @see #TYPE_UNIFORM_SCALE
- * @see #TYPE_FLIP
- * @see #TYPE_QUADRANT_ROTATION
- * @see #TYPE_GENERAL_ROTATION
- * @see #TYPE_GENERAL_TRANSFORM
- * @see #TYPE_MASK_SCALE
- * @see #getType()
- */
- public static final int TYPE_GENERAL_SCALE = 4;
-
- /**
- * This constant checks if either variety of scale transform is performed.
- *
- * @see #TYPE_UNIFORM_SCALE
- * @see #TYPE_GENERAL_SCALE
- */
- public static final int TYPE_MASK_SCALE = 6;
-
- /**
- * The transformation includes a flip about an axis, swapping between
- * right-handed and left-handed coordinate systems. In a right-handed
- * system, the positive x-axis rotates counter-clockwise to the positive
- * y-axis; in a left-handed system it rotates clockwise.
- *
- * @see #TYPE_IDENTITY
- * @see #TYPE_TRANSLATION
- * @see #TYPE_UNIFORM_SCALE
- * @see #TYPE_GENERAL_SCALE
- * @see #TYPE_QUADRANT_ROTATION
- * @see #TYPE_GENERAL_ROTATION
- * @see #TYPE_GENERAL_TRANSFORM
- * @see #getType()
- */
- public static final int TYPE_FLIP = 64;
-
- /**
- * The transformation includes a rotation of a multiple of 90 degrees (PI/2
- * radians). Angles are rotated, but length is preserved. This is mutually
- * exclusive with TYPE_GENERAL_ROTATION.
- *
- * @see #TYPE_IDENTITY
- * @see #TYPE_TRANSLATION
- * @see #TYPE_UNIFORM_SCALE
- * @see #TYPE_GENERAL_SCALE
- * @see #TYPE_FLIP
- * @see #TYPE_GENERAL_ROTATION
- * @see #TYPE_GENERAL_TRANSFORM
- * @see #TYPE_MASK_ROTATION
- * @see #getType()
- */
- public static final int TYPE_QUADRANT_ROTATION = 8;
-
- /**
- * The transformation includes a rotation by an arbitrary angle. Angles are
- * rotated, but length is preserved. This is mutually exclusive with
- * TYPE_QUADRANT_ROTATION.
- *
- * @see #TYPE_IDENTITY
- * @see #TYPE_TRANSLATION
- * @see #TYPE_UNIFORM_SCALE
- * @see #TYPE_GENERAL_SCALE
- * @see #TYPE_FLIP
- * @see #TYPE_QUADRANT_ROTATION
- * @see #TYPE_GENERAL_TRANSFORM
- * @see #TYPE_MASK_ROTATION
- * @see #getType()
- */
- public static final int TYPE_GENERAL_ROTATION = 16;
-
- /**
- * This constant checks if either variety of rotation is performed.
- *
- * @see #TYPE_QUADRANT_ROTATION
- * @see #TYPE_GENERAL_ROTATION
- */
- public static final int TYPE_MASK_ROTATION = 24;
-
- /**
- * The transformation is an arbitrary conversion of coordinates which
- * could not be decomposed into the other TYPEs.
- *
- * @see #TYPE_IDENTITY
- * @see #TYPE_TRANSLATION
- * @see #TYPE_UNIFORM_SCALE
- * @see #TYPE_GENERAL_SCALE
- * @see #TYPE_FLIP
- * @see #TYPE_QUADRANT_ROTATION
- * @see #TYPE_GENERAL_ROTATION
- * @see #getType()
- */
- public static final int TYPE_GENERAL_TRANSFORM = 32;
-
- /**
- * The X coordinate scaling element of the transform matrix.
- *
- * @serial matrix[0,0]
- */
- private double m00;
-
- /**
- * The Y coordinate shearing element of the transform matrix.
- *
- * @serial matrix[1,0]
- */
- private double m10;
-
- /**
- * The X coordinate shearing element of the transform matrix.
- *
- * @serial matrix[0,1]
- */
- private double m01;
-
- /**
- * The Y coordinate scaling element of the transform matrix.
- *
- * @serial matrix[1,1]
- */
- private double m11;
-
- /**
- * The X coordinate translation element of the transform matrix.
- *
- * @serial matrix[0,2]
- */
- private double m02;
-
- /**
- * The Y coordinate translation element of the transform matrix.
- *
- * @serial matrix[1,2]
- */
- private double m12;
-
- /** The type of this transform. */
- private transient int type;
-
- /**
- * Construct a new identity transform:
- * <pre>
- * [ 1 0 0 ]
- * [ 0 1 0 ]
- * [ 0 0 1 ]
- * </pre>
- */
- public AffineTransform()
- {
- m00 = m11 = 1;
- }
-
- /**
- * Create a new transform which copies the given one.
- *
- * @param tx the transform to copy
- * @throws NullPointerException if tx is null
- */
- public AffineTransform(AffineTransform tx)
- {
- setTransform(tx);
- }
-
- /**
- * Construct a transform with the given matrix entries:
- * <pre>
- * [ m00 m01 m02 ]
- * [ m10 m11 m12 ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param m00 the x scaling component
- * @param m10 the y shearing component
- * @param m01 the x shearing component
- * @param m11 the y scaling component
- * @param m02 the x translation component
- * @param m12 the y translation component
- */
- public AffineTransform(float m00, float m10,
- float m01, float m11,
- float m02, float m12)
- {
- this.m00 = m00;
- this.m10 = m10;
- this.m01 = m01;
- this.m11 = m11;
- this.m02 = m02;
- this.m12 = m12;
- updateType();
- }
-
- /**
- * Construct a transform from a sequence of float entries. The array must
- * have at least 4 entries, which has a translation factor of 0; or 6
- * entries, for specifying all parameters:
- * <pre>
- * [ f[0] f[2] (f[4]) ]
- * [ f[1] f[3] (f[5]) ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param f the matrix to copy from, with at least 4 (6) entries
- * @throws NullPointerException if f is null
- * @throws ArrayIndexOutOfBoundsException if f is too small
- */
- public AffineTransform(float[] f)
- {
- m00 = f[0];
- m10 = f[1];
- m01 = f[2];
- m11 = f[3];
- if (f.length >= 6)
- {
- m02 = f[4];
- m12 = f[5];
- }
- updateType();
- }
-
- /**
- * Construct a transform with the given matrix entries:
- * <pre>
- * [ m00 m01 m02 ]
- * [ m10 m11 m12 ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param m00 the x scaling component
- * @param m10 the y shearing component
- * @param m01 the x shearing component
- * @param m11 the y scaling component
- * @param m02 the x translation component
- * @param m12 the y translation component
- */
- public AffineTransform(double m00, double m10, double m01,
- double m11, double m02, double m12)
- {
- this.m00 = m00;
- this.m10 = m10;
- this.m01 = m01;
- this.m11 = m11;
- this.m02 = m02;
- this.m12 = m12;
- updateType();
- }
-
- /**
- * Construct a transform from a sequence of double entries. The array must
- * have at least 4 entries, which has a translation factor of 0; or 6
- * entries, for specifying all parameters:
- * <pre>
- * [ d[0] d[2] (d[4]) ]
- * [ d[1] d[3] (d[5]) ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param d the matrix to copy from, with at least 4 (6) entries
- * @throws NullPointerException if d is null
- * @throws ArrayIndexOutOfBoundsException if d is too small
- */
- public AffineTransform(double[] d)
- {
- m00 = d[0];
- m10 = d[1];
- m01 = d[2];
- m11 = d[3];
- if (d.length >= 6)
- {
- m02 = d[4];
- m12 = d[5];
- }
- updateType();
- }
-
- /**
- * Returns a translation transform:
- * <pre>
- * [ 1 0 tx ]
- * [ 0 1 ty ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param tx the x translation distance
- * @param ty the y translation distance
- * @return the translating transform
- */
- public static AffineTransform getTranslateInstance(double tx, double ty)
- {
- AffineTransform t = new AffineTransform();
- t.setToTranslation(tx, ty);
- return t;
- }
-
- /**
- * Returns a rotation transform. A positive angle (in radians) rotates
- * the positive x-axis to the positive y-axis:
- * <pre>
- * [ cos(theta) -sin(theta) 0 ]
- * [ sin(theta) cos(theta) 0 ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param theta the rotation angle
- * @return the rotating transform
- */
- public static AffineTransform getRotateInstance(double theta)
- {
- AffineTransform t = new AffineTransform();
- t.setToRotation(theta);
- return t;
- }
-
- /**
- * Returns a rotation transform about a point. A positive angle (in radians)
- * rotates the positive x-axis to the positive y-axis. This is the same
- * as calling:
- * <pre>
- * AffineTransform tx = new AffineTransform();
- * tx.setToTranslation(x, y);
- * tx.rotate(theta);
- * tx.translate(-x, -y);
- * </pre>
- *
- * <p>The resulting matrix is:
- * <pre>
- * [ cos(theta) -sin(theta) x-x*cos+y*sin ]
- * [ sin(theta) cos(theta) y-x*sin-y*cos ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param theta the rotation angle
- * @param x the x coordinate of the pivot point
- * @param y the y coordinate of the pivot point
- * @return the rotating transform
- */
- public static AffineTransform getRotateInstance(double theta,
- double x, double y)
- {
- AffineTransform t = new AffineTransform();
- t.setToTranslation(x, y);
- t.rotate(theta);
- t.translate(-x, -y);
- return t;
- }
-
- /**
- * Returns a scaling transform:
- * <pre>
- * [ sx 0 0 ]
- * [ 0 sy 0 ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param sx the x scaling factor
- * @param sy the y scaling factor
- * @return the scaling transform
- */
- public static AffineTransform getScaleInstance(double sx, double sy)
- {
- AffineTransform t = new AffineTransform();
- t.setToScale(sx, sy);
- return t;
- }
-
- /**
- * Returns a shearing transform (points are shifted in the x direction based
- * on a factor of their y coordinate, and in the y direction as a factor of
- * their x coordinate):
- * <pre>
- * [ 1 shx 0 ]
- * [ shy 1 0 ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param shx the x shearing factor
- * @param shy the y shearing factor
- * @return the shearing transform
- */
- public static AffineTransform getShearInstance(double shx, double shy)
- {
- AffineTransform t = new AffineTransform();
- t.setToShear(shx, shy);
- return t;
- }
-
- /**
- * Returns the type of this transform. The result is always valid, although
- * it may not be the simplest interpretation (in other words, there are
- * sequences of transforms which reduce to something simpler, which this
- * does not always detect). The result is either TYPE_GENERAL_TRANSFORM,
- * or a bit-wise combination of TYPE_TRANSLATION, the mutually exclusive
- * TYPE_*_ROTATIONs, and the mutually exclusive TYPE_*_SCALEs.
- *
- * @return The type.
- *
- * @see #TYPE_IDENTITY
- * @see #TYPE_TRANSLATION
- * @see #TYPE_UNIFORM_SCALE
- * @see #TYPE_GENERAL_SCALE
- * @see #TYPE_QUADRANT_ROTATION
- * @see #TYPE_GENERAL_ROTATION
- * @see #TYPE_GENERAL_TRANSFORM
- */
- public int getType()
- {
- return type;
- }
-
- /**
- * Return the determinant of this transform matrix. If the determinant is
- * non-zero, the transform is invertible; otherwise operations which require
- * an inverse throw a NoninvertibleTransformException. A result very near
- * zero, due to rounding errors, may indicate that inversion results do not
- * carry enough precision to be meaningful.
- *
- * <p>If this is a uniform scale transformation, the determinant also
- * represents the squared value of the scale. Otherwise, it carries little
- * additional meaning. The determinant is calculated as:
- * <pre>
- * | m00 m01 m02 |
- * | m10 m11 m12 | = m00 * m11 - m01 * m10
- * | 0 0 1 |
- * </pre>
- *
- * @return the determinant
- * @see #createInverse()
- */
- public double getDeterminant()
- {
- return m00 * m11 - m01 * m10;
- }
-
- /**
- * Return the matrix of values used in this transform. If the matrix has
- * fewer than 6 entries, only the scale and shear factors are returned;
- * otherwise the translation factors are copied as well. The resulting
- * values are:
- * <pre>
- * [ d[0] d[2] (d[4]) ]
- * [ d[1] d[3] (d[5]) ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param d the matrix to store the results into; with 4 (6) entries
- * @throws NullPointerException if d is null
- * @throws ArrayIndexOutOfBoundsException if d is too small
- */
- public void getMatrix(double[] d)
- {
- d[0] = m00;
- d[1] = m10;
- d[2] = m01;
- d[3] = m11;
- if (d.length >= 6)
- {
- d[4] = m02;
- d[5] = m12;
- }
- }
-
- /**
- * Returns the X coordinate scaling factor of the matrix.
- *
- * @return m00
- * @see #getMatrix(double[])
- */
- public double getScaleX()
- {
- return m00;
- }
-
- /**
- * Returns the Y coordinate scaling factor of the matrix.
- *
- * @return m11
- * @see #getMatrix(double[])
- */
- public double getScaleY()
- {
- return m11;
- }
-
- /**
- * Returns the X coordinate shearing factor of the matrix.
- *
- * @return m01
- * @see #getMatrix(double[])
- */
- public double getShearX()
- {
- return m01;
- }
-
- /**
- * Returns the Y coordinate shearing factor of the matrix.
- *
- * @return m10
- * @see #getMatrix(double[])
- */
- public double getShearY()
- {
- return m10;
- }
-
- /**
- * Returns the X coordinate translation factor of the matrix.
- *
- * @return m02
- * @see #getMatrix(double[])
- */
- public double getTranslateX()
- {
- return m02;
- }
-
- /**
- * Returns the Y coordinate translation factor of the matrix.
- *
- * @return m12
- * @see #getMatrix(double[])
- */
- public double getTranslateY()
- {
- return m12;
- }
-
- /**
- * Concatenate a translation onto this transform. This is equivalent, but
- * more efficient than
- * <code>concatenate(AffineTransform.getTranslateInstance(tx, ty))</code>.
- *
- * @param tx the x translation distance
- * @param ty the y translation distance
- * @see #getTranslateInstance(double, double)
- * @see #concatenate(AffineTransform)
- */
- public void translate(double tx, double ty)
- {
- m02 += tx * m00 + ty * m01;
- m12 += tx * m10 + ty * m11;
- updateType();
- }
-
- /**
- * Concatenate a rotation onto this transform. This is equivalent, but
- * more efficient than
- * <code>concatenate(AffineTransform.getRotateInstance(theta))</code>.
- *
- * @param theta the rotation angle
- * @see #getRotateInstance(double)
- * @see #concatenate(AffineTransform)
- */
- public void rotate(double theta)
- {
- double c = Math.cos(theta);
- double s = Math.sin(theta);
- double n00 = m00 * c + m01 * s;
- double n01 = m00 * -s + m01 * c;
- double n10 = m10 * c + m11 * s;
- double n11 = m10 * -s + m11 * c;
- m00 = n00;
- m01 = n01;
- m10 = n10;
- m11 = n11;
- updateType();
- }
-
- /**
- * Concatenate a rotation about a point onto this transform. This is
- * equivalent, but more efficient than
- * <code>concatenate(AffineTransform.getRotateInstance(theta, x, y))</code>.
- *
- * @param theta the rotation angle
- * @param x the x coordinate of the pivot point
- * @param y the y coordinate of the pivot point
- * @see #getRotateInstance(double, double, double)
- * @see #concatenate(AffineTransform)
- */
- public void rotate(double theta, double x, double y)
- {
- translate(x, y);
- rotate(theta);
- translate(-x, -y);
- }
-
- /**
- * Concatenate a scale onto this transform. This is equivalent, but more
- * efficient than
- * <code>concatenate(AffineTransform.getScaleInstance(sx, sy))</code>.
- *
- * @param sx the x scaling factor
- * @param sy the y scaling factor
- * @see #getScaleInstance(double, double)
- * @see #concatenate(AffineTransform)
- */
- public void scale(double sx, double sy)
- {
- m00 *= sx;
- m01 *= sy;
- m10 *= sx;
- m11 *= sy;
- updateType();
- }
-
- /**
- * Concatenate a shearing onto this transform. This is equivalent, but more
- * efficient than
- * <code>concatenate(AffineTransform.getShearInstance(sx, sy))</code>.
- *
- * @param shx the x shearing factor
- * @param shy the y shearing factor
- * @see #getShearInstance(double, double)
- * @see #concatenate(AffineTransform)
- */
- public void shear(double shx, double shy)
- {
- double n00 = m00 + (shy * m01);
- double n01 = m01 + (shx * m00);
- double n10 = m10 + (shy * m11);
- double n11 = m11 + (shx * m10);
- m00 = n00;
- m01 = n01;
- m10 = n10;
- m11 = n11;
- updateType();
- }
-
- /**
- * Reset this transform to the identity (no transformation):
- * <pre>
- * [ 1 0 0 ]
- * [ 0 1 0 ]
- * [ 0 0 1 ]
- * </pre>
- */
- public void setToIdentity()
- {
- m00 = m11 = 1;
- m01 = m02 = m10 = m12 = 0;
- type = TYPE_IDENTITY;
- }
-
- /**
- * Set this transform to a translation:
- * <pre>
- * [ 1 0 tx ]
- * [ 0 1 ty ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param tx the x translation distance
- * @param ty the y translation distance
- */
- public void setToTranslation(double tx, double ty)
- {
- m00 = m11 = 1;
- m01 = m10 = 0;
- m02 = tx;
- m12 = ty;
- type = (tx == 0 && ty == 0) ? TYPE_UNIFORM_SCALE : TYPE_TRANSLATION;
- }
-
- /**
- * Set this transform to a rotation. A positive angle (in radians) rotates
- * the positive x-axis to the positive y-axis:
- * <pre>
- * [ cos(theta) -sin(theta) 0 ]
- * [ sin(theta) cos(theta) 0 ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param theta the rotation angle
- */
- public void setToRotation(double theta)
- {
- double c = Math.cos(theta);
- double s = Math.sin(theta);
- m00 = c;
- m01 = -s;
- m02 = 0;
- m10 = s;
- m11 = c;
- m12 = 0;
- type = (c == 1 ? TYPE_IDENTITY
- : c == 0 || c == -1 ? TYPE_QUADRANT_ROTATION
- : TYPE_GENERAL_ROTATION);
- }
-
- /**
- * Set this transform to a rotation about a point. A positive angle (in
- * radians) rotates the positive x-axis to the positive y-axis. This is the
- * same as calling:
- * <pre>
- * tx.setToTranslation(x, y);
- * tx.rotate(theta);
- * tx.translate(-x, -y);
- * </pre>
- *
- * <p>The resulting matrix is:
- * <pre>
- * [ cos(theta) -sin(theta) x-x*cos+y*sin ]
- * [ sin(theta) cos(theta) y-x*sin-y*cos ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param theta the rotation angle
- * @param x the x coordinate of the pivot point
- * @param y the y coordinate of the pivot point
- */
- public void setToRotation(double theta, double x, double y)
- {
- double c = Math.cos(theta);
- double s = Math.sin(theta);
- m00 = c;
- m01 = -s;
- m02 = x - x * c + y * s;
- m10 = s;
- m11 = c;
- m12 = y - x * s - y * c;
- updateType();
- }
-
- /**
- * Set this transform to a scale:
- * <pre>
- * [ sx 0 0 ]
- * [ 0 sy 0 ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param sx the x scaling factor
- * @param sy the y scaling factor
- */
- public void setToScale(double sx, double sy)
- {
- m00 = sx;
- m01 = m02 = m10 = m12 = 0;
- m11 = sy;
- type = (sx != sy ? TYPE_GENERAL_SCALE
- : sx == 1 ? TYPE_IDENTITY : TYPE_UNIFORM_SCALE);
- }
-
- /**
- * Set this transform to a shear (points are shifted in the x direction based
- * on a factor of their y coordinate, and in the y direction as a factor of
- * their x coordinate):
- * <pre>
- * [ 1 shx 0 ]
- * [ shy 1 0 ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param shx the x shearing factor
- * @param shy the y shearing factor
- */
- public void setToShear(double shx, double shy)
- {
- m00 = m11 = 1;
- m01 = shx;
- m10 = shy;
- m02 = m12 = 0;
- updateType();
- }
-
- /**
- * Set this transform to a copy of the given one.
- *
- * @param tx the transform to copy
- * @throws NullPointerException if tx is null
- */
- public void setTransform(AffineTransform tx)
- {
- m00 = tx.m00;
- m01 = tx.m01;
- m02 = tx.m02;
- m10 = tx.m10;
- m11 = tx.m11;
- m12 = tx.m12;
- type = tx.type;
- }
-
- /**
- * Set this transform to the given values:
- * <pre>
- * [ m00 m01 m02 ]
- * [ m10 m11 m12 ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @param m00 the x scaling component
- * @param m10 the y shearing component
- * @param m01 the x shearing component
- * @param m11 the y scaling component
- * @param m02 the x translation component
- * @param m12 the y translation component
- */
- public void setTransform(double m00, double m10, double m01,
- double m11, double m02, double m12)
- {
- this.m00 = m00;
- this.m10 = m10;
- this.m01 = m01;
- this.m11 = m11;
- this.m02 = m02;
- this.m12 = m12;
- updateType();
- }
-
- /**
- * Set this transform to the result of performing the original version of
- * this followed by tx. This is commonly used when chaining transformations
- * from one space to another. In matrix form:
- * <pre>
- * [ this ] = [ this ] x [ tx ]
- * </pre>
- *
- * @param tx the transform to concatenate
- * @throws NullPointerException if tx is null
- * @see #preConcatenate(AffineTransform)
- */
- public void concatenate(AffineTransform tx)
- {
- double n00 = m00 * tx.m00 + m01 * tx.m10;
- double n01 = m00 * tx.m01 + m01 * tx.m11;
- double n02 = m00 * tx.m02 + m01 * tx.m12 + m02;
- double n10 = m10 * tx.m00 + m11 * tx.m10;
- double n11 = m10 * tx.m01 + m11 * tx.m11;
- double n12 = m10 * tx.m02 + m11 * tx.m12 + m12;
- m00 = n00;
- m01 = n01;
- m02 = n02;
- m10 = n10;
- m11 = n11;
- m12 = n12;
- updateType();
- }
-
- /**
- * Set this transform to the result of performing tx followed by the
- * original version of this. This is less common than normal concatenation,
- * but can still be used to chain transformations from one space to another.
- * In matrix form:
- * <pre>
- * [ this ] = [ tx ] x [ this ]
- * </pre>
- *
- * @param tx the transform to concatenate
- * @throws NullPointerException if tx is null
- * @see #concatenate(AffineTransform)
- */
- public void preConcatenate(AffineTransform tx)
- {
- double n00 = tx.m00 * m00 + tx.m01 * m10;
- double n01 = tx.m00 * m01 + tx.m01 * m11;
- double n02 = tx.m00 * m02 + tx.m01 * m12 + tx.m02;
- double n10 = tx.m10 * m00 + tx.m11 * m10;
- double n11 = tx.m10 * m01 + tx.m11 * m11;
- double n12 = tx.m10 * m02 + tx.m11 * m12 + tx.m12;
- m00 = n00;
- m01 = n01;
- m02 = n02;
- m10 = n10;
- m11 = n11;
- m12 = n12;
- updateType();
- }
-
- /**
- * Returns a transform, which if concatenated to this one, will result in
- * the identity transform. This is useful for undoing transformations, but
- * is only possible if the original transform has an inverse (ie. does not
- * map multiple points to the same line or point). A transform exists only
- * if getDeterminant() has a non-zero value.
- *
- * The inverse is calculated as:
- *
- * <pre>
- *
- * Let A be the matrix for which we want to find the inverse:
- *
- * A = [ m00 m01 m02 ]
- * [ m10 m11 m12 ]
- * [ 0 0 1 ]
- *
- *
- * 1
- * inverse (A) = --- x adjoint(A)
- * det
- *
- *
- *
- * = 1 [ m11 -m01 m01*m12-m02*m11 ]
- * --- x [ -m10 m00 -m00*m12+m10*m02 ]
- * det [ 0 0 m00*m11-m10*m01 ]
- *
- *
- *
- * = [ m11/det -m01/det m01*m12-m02*m11/det ]
- * [ -m10/det m00/det -m00*m12+m10*m02/det ]
- * [ 0 0 1 ]
- *
- *
- * </pre>
- *
- *
- *
- * @return a new inverse transform
- * @throws NoninvertibleTransformException if inversion is not possible
- * @see #getDeterminant()
- */
- public AffineTransform createInverse()
- throws NoninvertibleTransformException
- {
- double det = getDeterminant();
- if (det == 0)
- throw new NoninvertibleTransformException("can't invert transform");
-
- double im00 = m11 / det;
- double im10 = -m10 / det;
- double im01 = -m01 / det;
- double im11 = m00 / det;
- double im02 = (m01 * m12 - m02 * m11) / det;
- double im12 = (-m00 * m12 + m10 * m02) / det;
-
- return new AffineTransform (im00, im10, im01, im11, im02, im12);
- }
-
- /**
- * Perform this transformation on the given source point, and store the
- * result in the destination (creating it if necessary). It is safe for
- * src and dst to be the same.
- *
- * @param src the source point
- * @param dst the destination, or null
- * @return the transformation of src, in dst if it was non-null
- * @throws NullPointerException if src is null
- */
- public Point2D transform(Point2D src, Point2D dst)
- {
- if (dst == null)
- dst = new Point2D.Double();
- double x = src.getX();
- double y = src.getY();
- double nx = m00 * x + m01 * y + m02;
- double ny = m10 * x + m11 * y + m12;
- dst.setLocation(nx, ny);
- return dst;
- }
-
- /**
- * Perform this transformation on an array of points, storing the results
- * in another (possibly same) array. This will not create a destination
- * array, but will create points for the null entries of the destination.
- * The transformation is done sequentially. While having a single source
- * and destination point be the same is safe, you should be aware that
- * duplicate references to the same point in the source, and having the
- * source overlap the destination, may result in your source points changing
- * from a previous transform before it is their turn to be evaluated.
- *
- * @param src the array of source points
- * @param srcOff the starting offset into src
- * @param dst the array of destination points (may have null entries)
- * @param dstOff the starting offset into dst
- * @param num the number of points to transform
- * @throws NullPointerException if src or dst is null, or src has null
- * entries
- * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded
- * @throws ArrayStoreException if new points are incompatible with dst
- */
- public void transform(Point2D[] src, int srcOff,
- Point2D[] dst, int dstOff, int num)
- {
- while (--num >= 0)
- dst[dstOff] = transform(src[srcOff++], dst[dstOff++]);
- }
-
- /**
- * Perform this transformation on an array of points, in (x,y) pairs,
- * storing the results in another (possibly same) array. This will not
- * create a destination array. All sources are copied before the
- * transformation, so that no result will overwrite a point that has not yet
- * been evaluated.
- *
- * @param srcPts the array of source points
- * @param srcOff the starting offset into src
- * @param dstPts the array of destination points
- * @param dstOff the starting offset into dst
- * @param num the number of points to transform
- * @throws NullPointerException if src or dst is null
- * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded
- */
- public void transform(float[] srcPts, int srcOff,
- float[] dstPts, int dstOff, int num)
- {
- if (srcPts == dstPts && dstOff > srcOff
- && num > 1 && srcOff + 2 * num > dstOff)
- {
- float[] f = new float[2 * num];
- System.arraycopy(srcPts, srcOff, f, 0, 2 * num);
- srcPts = f;
- }
- while (--num >= 0)
- {
- float x = srcPts[srcOff++];
- float y = srcPts[srcOff++];
- dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02);
- dstPts[dstOff++] = (float) (m10 * x + m11 * y + m12);
- }
- }
-
- /**
- * Perform this transformation on an array of points, in (x,y) pairs,
- * storing the results in another (possibly same) array. This will not
- * create a destination array. All sources are copied before the
- * transformation, so that no result will overwrite a point that has not yet
- * been evaluated.
- *
- * @param srcPts the array of source points
- * @param srcOff the starting offset into src
- * @param dstPts the array of destination points
- * @param dstOff the starting offset into dst
- * @param num the number of points to transform
- * @throws NullPointerException if src or dst is null
- * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded
- */
- public void transform(double[] srcPts, int srcOff,
- double[] dstPts, int dstOff, int num)
- {
- if (srcPts == dstPts && dstOff > srcOff
- && num > 1 && srcOff + 2 * num > dstOff)
- {
- double[] d = new double[2 * num];
- System.arraycopy(srcPts, srcOff, d, 0, 2 * num);
- srcPts = d;
- }
- while (--num >= 0)
- {
- double x = srcPts[srcOff++];
- double y = srcPts[srcOff++];
- dstPts[dstOff++] = m00 * x + m01 * y + m02;
- dstPts[dstOff++] = m10 * x + m11 * y + m12;
- }
- }
-
- /**
- * Perform this transformation on an array of points, in (x,y) pairs,
- * storing the results in another array. This will not create a destination
- * array.
- *
- * @param srcPts the array of source points
- * @param srcOff the starting offset into src
- * @param dstPts the array of destination points
- * @param dstOff the starting offset into dst
- * @param num the number of points to transform
- * @throws NullPointerException if src or dst is null
- * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded
- */
- public void transform(float[] srcPts, int srcOff,
- double[] dstPts, int dstOff, int num)
- {
- while (--num >= 0)
- {
- float x = srcPts[srcOff++];
- float y = srcPts[srcOff++];
- dstPts[dstOff++] = m00 * x + m01 * y + m02;
- dstPts[dstOff++] = m10 * x + m11 * y + m12;
- }
- }
-
- /**
- * Perform this transformation on an array of points, in (x,y) pairs,
- * storing the results in another array. This will not create a destination
- * array.
- *
- * @param srcPts the array of source points
- * @param srcOff the starting offset into src
- * @param dstPts the array of destination points
- * @param dstOff the starting offset into dst
- * @param num the number of points to transform
- * @throws NullPointerException if src or dst is null
- * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded
- */
- public void transform(double[] srcPts, int srcOff,
- float[] dstPts, int dstOff, int num)
- {
- while (--num >= 0)
- {
- double x = srcPts[srcOff++];
- double y = srcPts[srcOff++];
- dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02);
- dstPts[dstOff++] = (float) (m10 * x + m11 * y + m12);
- }
- }
-
- /**
- * Perform the inverse of this transformation on the given source point,
- * and store the result in the destination (creating it if necessary). It
- * is safe for src and dst to be the same.
- *
- * @param src the source point
- * @param dst the destination, or null
- * @return the inverse transformation of src, in dst if it was non-null
- * @throws NullPointerException if src is null
- * @throws NoninvertibleTransformException if the inverse does not exist
- * @see #getDeterminant()
- */
- public Point2D inverseTransform(Point2D src, Point2D dst)
- throws NoninvertibleTransformException
- {
- return createInverse().transform(src, dst);
- }
-
- /**
- * Perform the inverse of this transformation on an array of points, in
- * (x,y) pairs, storing the results in another (possibly same) array. This
- * will not create a destination array. All sources are copied before the
- * transformation, so that no result will overwrite a point that has not yet
- * been evaluated.
- *
- * @param srcPts the array of source points
- * @param srcOff the starting offset into src
- * @param dstPts the array of destination points
- * @param dstOff the starting offset into dst
- * @param num the number of points to transform
- * @throws NullPointerException if src or dst is null
- * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded
- * @throws NoninvertibleTransformException if the inverse does not exist
- * @see #getDeterminant()
- */
- public void inverseTransform(double[] srcPts, int srcOff,
- double[] dstPts, int dstOff, int num)
- throws NoninvertibleTransformException
- {
- createInverse().transform(srcPts, srcOff, dstPts, dstOff, num);
- }
-
- /**
- * Perform this transformation, less any translation, on the given source
- * point, and store the result in the destination (creating it if
- * necessary). It is safe for src and dst to be the same. The reduced
- * transform is equivalent to:
- * <pre>
- * [ x' ] = [ m00 m01 ] [ x ] = [ m00 * x + m01 * y ]
- * [ y' ] [ m10 m11 ] [ y ] = [ m10 * x + m11 * y ]
- * </pre>
- *
- * @param src the source point
- * @param dst the destination, or null
- * @return the delta transformation of src, in dst if it was non-null
- * @throws NullPointerException if src is null
- */
- public Point2D deltaTransform(Point2D src, Point2D dst)
- {
- if (dst == null)
- dst = new Point2D.Double();
- double x = src.getX();
- double y = src.getY();
- double nx = m00 * x + m01 * y;
- double ny = m10 * x + m11 * y;
- dst.setLocation(nx, ny);
- return dst;
- }
-
- /**
- * Perform this transformation, less any translation, on an array of points,
- * in (x,y) pairs, storing the results in another (possibly same) array.
- * This will not create a destination array. All sources are copied before
- * the transformation, so that no result will overwrite a point that has
- * not yet been evaluated. The reduced transform is equivalent to:
- * <pre>
- * [ x' ] = [ m00 m01 ] [ x ] = [ m00 * x + m01 * y ]
- * [ y' ] [ m10 m11 ] [ y ] = [ m10 * x + m11 * y ]
- * </pre>
- *
- * @param srcPts the array of source points
- * @param srcOff the starting offset into src
- * @param dstPts the array of destination points
- * @param dstOff the starting offset into dst
- * @param num the number of points to transform
- * @throws NullPointerException if src or dst is null
- * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded
- */
- public void deltaTransform(double[] srcPts, int srcOff,
- double[] dstPts, int dstOff,
- int num)
- {
- if (srcPts == dstPts && dstOff > srcOff
- && num > 1 && srcOff + 2 * num > dstOff)
- {
- double[] d = new double[2 * num];
- System.arraycopy(srcPts, srcOff, d, 0, 2 * num);
- srcPts = d;
- }
- while (--num >= 0)
- {
- double x = srcPts[srcOff++];
- double y = srcPts[srcOff++];
- dstPts[dstOff++] = m00 * x + m01 * y;
- dstPts[dstOff++] = m10 * x + m11 * y;
- }
- }
-
- /**
- * Return a new Shape, based on the given one, where the path of the shape
- * has been transformed by this transform. Notice that this uses GeneralPath,
- * which only stores points in float precision.
- *
- * @param src the shape source to transform
- * @return the shape, transformed by this, <code>null</code> if src is
- * <code>null</code>.
- * @see GeneralPath#transform(AffineTransform)
- */
- public Shape createTransformedShape(Shape src)
- {
- if(src == null)
- return null;
- GeneralPath p = new GeneralPath(src);
- p.transform(this);
- return p;
- }
-
- /**
- * Returns a string representation of the transform, in the format:
- * <code>"AffineTransform[[" + m00 + ", " + m01 + ", " + m02 + "], ["
- * + m10 + ", " + m11 + ", " + m12 + "]]"</code>.
- *
- * @return the string representation
- */
- public String toString()
- {
- return "AffineTransform[[" + m00 + ", " + m01 + ", " + m02 + "], ["
- + m10 + ", " + m11 + ", " + m12 + "]]";
- }
-
- /**
- * Tests if this transformation is the identity:
- * <pre>
- * [ 1 0 0 ]
- * [ 0 1 0 ]
- * [ 0 0 1 ]
- * </pre>
- *
- * @return true if this is the identity transform
- */
- public boolean isIdentity()
- {
- // Rather than rely on type, check explicitly.
- return (m00 == 1 && m01 == 0 && m02 == 0
- && m10 == 0 && m11 == 1 && m12 == 0);
- }
-
- /**
- * Create a new transform of the same run-time type, with the same
- * transforming properties as this one.
- *
- * @return the clone
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-
- /**
- * Return the hashcode for this transformation. The formula is not
- * documented, but appears to be the same as:
- * <pre>
- * long l = Double.doubleToLongBits(getScaleX());
- * l = l * 31 + Double.doubleToLongBits(getShearY());
- * l = l * 31 + Double.doubleToLongBits(getShearX());
- * l = l * 31 + Double.doubleToLongBits(getScaleY());
- * l = l * 31 + Double.doubleToLongBits(getTranslateX());
- * l = l * 31 + Double.doubleToLongBits(getTranslateY());
- * return (int) ((l >> 32) ^ l);
- * </pre>
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- long l = Double.doubleToLongBits(m00);
- l = l * 31 + Double.doubleToLongBits(m10);
- l = l * 31 + Double.doubleToLongBits(m01);
- l = l * 31 + Double.doubleToLongBits(m11);
- l = l * 31 + Double.doubleToLongBits(m02);
- l = l * 31 + Double.doubleToLongBits(m12);
- return (int) ((l >> 32) ^ l);
- }
-
- /**
- * Compares two transforms for equality. This returns true if they have the
- * same matrix values.
- *
- * @param obj the transform to compare
- * @return true if it is equal
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof AffineTransform))
- return false;
- AffineTransform t = (AffineTransform) obj;
- return (m00 == t.m00 && m01 == t.m01 && m02 == t.m02
- && m10 == t.m10 && m11 == t.m11 && m12 == t.m12);
- }
-
- /**
- * Helper to decode the type from the matrix. This is not guaranteed
- * to find the optimal type, but at least it will be valid.
- */
- private void updateType()
- {
- double det = getDeterminant();
- if (det == 0)
- {
- type = TYPE_GENERAL_TRANSFORM;
- return;
- }
- // Scale (includes rotation by PI) or translation.
- if (m01 == 0 && m10 == 0)
- {
- if (m00 == m11)
- type = m00 == 1 ? TYPE_IDENTITY : TYPE_UNIFORM_SCALE;
- else
- type = TYPE_GENERAL_SCALE;
- if (m02 != 0 || m12 != 0)
- type |= TYPE_TRANSLATION;
- }
- // Rotation.
- else if (m00 == m11 && m01 == -m10)
- {
- type = m00 == 0 ? TYPE_QUADRANT_ROTATION : TYPE_GENERAL_ROTATION;
- if (det != 1)
- type |= TYPE_UNIFORM_SCALE;
- if (m02 != 0 || m12 != 0)
- type |= TYPE_TRANSLATION;
- }
- else
- type = TYPE_GENERAL_TRANSFORM;
- }
-
- /**
- * Reads a transform from an object stream.
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if there is a problem deserializing
- * @throws IOException if there is a problem deserializing
- */
- private void readObject(ObjectInputStream s)
- throws ClassNotFoundException, IOException
- {
- s.defaultReadObject();
- updateType();
- }
-} // class AffineTransform
diff --git a/libjava/java/awt/geom/Arc2D.java b/libjava/java/awt/geom/Arc2D.java
deleted file mode 100644
index eff34a08144..00000000000
--- a/libjava/java/awt/geom/Arc2D.java
+++ /dev/null
@@ -1,1399 +0,0 @@
-/* Arc2D.java -- represents an arc in 2-D space
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.util.NoSuchElementException;
-
-
-/**
- * This class represents all arcs (segments of an ellipse in 2-D space). The
- * arcs are defined by starting angle and extent (arc length) in degrees, as
- * opposed to radians (like the rest of Java), and can be open, chorded, or
- * wedge shaped. The angles are skewed according to the ellipse, so that 45
- * degrees always points to the upper right corner (positive x, negative y)
- * of the bounding rectangle. A positive extent draws a counterclockwise arc,
- * and while the angle can be any value, the path iterator only traverses the
- * first 360 degrees. Storage is up to the subclasses.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @author Sven de Marothy (sven@physto.se)
- * @since 1.2
- */
-public abstract class Arc2D extends RectangularShape
-{
- /**
- * An open arc, with no segment connecting the endpoints. This type of
- * arc still contains the same points as a chorded version.
- */
- public static final int OPEN = 0;
-
- /**
- * A closed arc with a single segment connecting the endpoints (a chord).
- */
- public static final int CHORD = 1;
-
- /**
- * A closed arc with two segments, one from each endpoint, meeting at the
- * center of the ellipse.
- */
- public static final int PIE = 2;
-
- /** The closure type of this arc. This is package-private to avoid an
- * accessor method. */
- int type;
-
- /**
- * Create a new arc, with the specified closure type.
- *
- * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}.
- * @throws IllegalArgumentException if type is invalid
- */
- protected Arc2D(int type)
- {
- if (type < OPEN || type > PIE)
- throw new IllegalArgumentException();
- this.type = type;
- }
-
- /**
- * Get the starting angle of the arc in degrees.
- *
- * @return the starting angle
- * @see #setAngleStart(double)
- */
- public abstract double getAngleStart();
-
- /**
- * Get the extent angle of the arc in degrees.
- *
- * @return the extent angle
- * @see #setAngleExtent(double)
- */
- public abstract double getAngleExtent();
-
- /**
- * Return the closure type of the arc.
- *
- * @return the closure type
- * @see #OPEN
- * @see #CHORD
- * @see #PIE
- * @see #setArcType(int)
- */
- public int getArcType()
- {
- return type;
- }
-
- /**
- * Returns the starting point of the arc.
- *
- * @return the start point
- */
- public Point2D getStartPoint()
- {
- double angle = Math.toRadians(getAngleStart());
- double rx = getWidth() / 2;
- double ry = getHeight() / 2;
- double x = getX() + rx + rx * Math.cos(angle);
- double y = getY() + ry - ry * Math.sin(angle);
- return new Point2D.Double(x, y);
- }
-
- /**
- * Returns the ending point of the arc.
- *
- * @return the end point
- */
- public Point2D getEndPoint()
- {
- double angle = Math.toRadians(getAngleStart() + getAngleExtent());
- double rx = getWidth() / 2;
- double ry = getHeight() / 2;
- double x = getX() + rx + rx * Math.cos(angle);
- double y = getY() + ry - ry * Math.sin(angle);
- return new Point2D.Double(x, y);
- }
-
- /**
- * Set the parameters of the arc. The angles are in degrees, and a positive
- * extent sweeps counterclockwise (from the positive x-axis to the negative
- * y-axis).
- *
- * @param x the new x coordinate of the upper left of the bounding box
- * @param y the new y coordinate of the upper left of the bounding box
- * @param w the new width of the bounding box
- * @param h the new height of the bounding box
- * @param start the start angle, in degrees
- * @param extent the arc extent, in degrees
- * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- */
- public abstract void setArc(double x, double y, double w, double h,
- double start, double extent, int type);
-
- /**
- * Set the parameters of the arc. The angles are in degrees, and a positive
- * extent sweeps counterclockwise (from the positive x-axis to the negative
- * y-axis).
- *
- * @param p the upper left point of the bounding box
- * @param d the dimensions of the bounding box
- * @param start the start angle, in degrees
- * @param extent the arc extent, in degrees
- * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- * @throws NullPointerException if p or d is null
- */
- public void setArc(Point2D p, Dimension2D d, double start, double extent,
- int type)
- {
- setArc(p.getX(), p.getY(), d.getWidth(), d.getHeight(), start, extent, type);
- }
-
- /**
- * Set the parameters of the arc. The angles are in degrees, and a positive
- * extent sweeps counterclockwise (from the positive x-axis to the negative
- * y-axis).
- *
- * @param r the new bounding box
- * @param start the start angle, in degrees
- * @param extent the arc extent, in degrees
- * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- * @throws NullPointerException if r is null
- */
- public void setArc(Rectangle2D r, double start, double extent, int type)
- {
- setArc(r.getX(), r.getY(), r.getWidth(), r.getHeight(), start, extent, type);
- }
-
- /**
- * Set the parameters of the arc from the given one.
- *
- * @param a the arc to copy
- * @throws NullPointerException if a is null
- */
- public void setArc(Arc2D a)
- {
- setArc(a.getX(), a.getY(), a.getWidth(), a.getHeight(), a.getAngleStart(),
- a.getAngleExtent(), a.getArcType());
- }
-
- /**
- * Set the parameters of the arc. The angles are in degrees, and a positive
- * extent sweeps counterclockwise (from the positive x-axis to the negative
- * y-axis). This controls the center point and radius, so the arc will be
- * circular.
- *
- * @param x the x coordinate of the center of the circle
- * @param y the y coordinate of the center of the circle
- * @param r the radius of the circle
- * @param start the start angle, in degrees
- * @param extent the arc extent, in degrees
- * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- */
- public void setArcByCenter(double x, double y, double r, double start,
- double extent, int type)
- {
- setArc(x - r, y - r, r + r, r + r, start, extent, type);
- }
-
- /**
- * Sets the parameters of the arc by finding the tangents of two lines, and
- * using the specified radius. The arc will be circular, will begin on the
- * tangent point of the line extending from p1 to p2, and will end on the
- * tangent point of the line extending from p2 to p3.
- *
- * XXX What happens if the points are colinear, or the radius negative?
- *
- * @param p1 the first point
- * @param p2 the tangent line intersection point
- * @param p3 the third point
- * @param r the radius of the arc
- * @throws NullPointerException if any point is null
- */
- public void setArcByTangent(Point2D p1, Point2D p2, Point2D p3, double r)
- {
- if ((p2.getX() - p1.getX()) * (p3.getY() - p1.getY())
- - (p3.getX() - p1.getX()) * (p2.getY() - p1.getY()) > 0)
- {
- Point2D p = p3;
- p3 = p1;
- p1 = p;
- }
-
- // normalized tangent vectors
- double dx1 = (p1.getX() - p2.getX()) / p1.distance(p2);
- double dy1 = (p1.getY() - p2.getY()) / p1.distance(p2);
- double dx2 = (p2.getX() - p3.getX()) / p3.distance(p2);
- double dy2 = (p2.getY() - p3.getY()) / p3.distance(p2);
- double theta1 = Math.atan2(dx1, dy1);
- double theta2 = Math.atan2(dx2, dy2);
-
- double dx = r * Math.cos(theta2) - r * Math.cos(theta1);
- double dy = -r * Math.sin(theta2) + r * Math.sin(theta1);
-
- if (theta1 < 0)
- theta1 += 2 * Math.PI;
- if (theta2 < 0)
- theta2 += 2 * Math.PI;
- if (theta2 < theta1)
- theta2 += 2 * Math.PI;
-
- // Vectors of the lines, not normalized, note we change
- // the direction of line 2.
- dx1 = p1.getX() - p2.getX();
- dy1 = p1.getY() - p2.getY();
- dx2 = p3.getX() - p2.getX();
- dy2 = p3.getY() - p2.getY();
-
- // Calculate the tangent point to the second line
- double t2 = -(dx1 * dy - dy1 * dx) / (dx2 * dy1 - dx1 * dy2);
- double x2 = t2 * (p3.getX() - p2.getX()) + p2.getX();
- double y2 = t2 * (p3.getY() - p2.getY()) + p2.getY();
-
- // calculate the center point
- double x = x2 - r * Math.cos(theta2);
- double y = y2 + r * Math.sin(theta2);
-
- setArc(x - r, y - r, 2 * r, 2 * r, Math.toDegrees(theta1),
- Math.toDegrees(theta2 - theta1), getArcType());
- }
-
- /**
- * Set the start, in degrees.
- *
- * @param start the new start angle
- * @see #getAngleStart()
- */
- public abstract void setAngleStart(double start);
-
- /**
- * Set the extent, in degrees.
- *
- * @param extent the new extent angle
- * @see #getAngleExtent()
- */
- public abstract void setAngleExtent(double extent);
-
- /**
- * Sets the starting angle to the angle of the given point relative to
- * the center of the arc. The extent remains constant; in other words,
- * this rotates the arc.
- *
- * @param p the new start point
- * @throws NullPointerException if p is null
- * @see #getStartPoint()
- * @see #getAngleStart()
- */
- public void setAngleStart(Point2D p)
- {
- // Normalize.
- double x = p.getX() - (getX() + getWidth() / 2);
- double y = p.getY() - (getY() + getHeight() / 2);
- setAngleStart(Math.toDegrees(Math.atan2(-y, x)));
- }
-
- /**
- * Sets the starting and extent angles to those of the given points
- * relative to the center of the arc. The arc will be non-empty, and will
- * extend counterclockwise.
- *
- * @param x1 the first x coordinate
- * @param y1 the first y coordinate
- * @param x2 the second x coordinate
- * @param y2 the second y coordinate
- * @see #setAngleStart(Point2D)
- */
- public void setAngles(double x1, double y1, double x2, double y2)
- {
- // Normalize the points.
- double mx = getX();
- double my = getY();
- double mw = getWidth();
- double mh = getHeight();
- x1 = x1 - (mx + mw / 2);
- y1 = y1 - (my + mh / 2);
- x2 = x2 - (mx + mw / 2);
- y2 = y2 - (my + mh / 2);
- double start = Math.toDegrees(Math.atan2(-y1, x1));
- double extent = Math.toDegrees(Math.atan2(-y2, x2)) - start;
- if (extent < 0)
- extent += 360;
- setAngleStart(start);
- setAngleExtent(extent);
- }
-
- /**
- * Sets the starting and extent angles to those of the given points
- * relative to the center of the arc. The arc will be non-empty, and will
- * extend counterclockwise.
- *
- * @param p1 the first point
- * @param p2 the second point
- * @throws NullPointerException if either point is null
- * @see #setAngleStart(Point2D)
- */
- public void setAngles(Point2D p1, Point2D p2)
- {
- setAngles(p1.getX(), p1.getY(), p2.getX(), p2.getY());
- }
-
- /**
- * Set the closure type of this arc.
- *
- * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- * @see #getArcType()
- */
- public void setArcType(int type)
- {
- if (type < OPEN || type > PIE)
- throw new IllegalArgumentException();
- this.type = type;
- }
-
- /**
- * Sets the location and bounds of the ellipse of which this arc is a part.
- *
- * @param x the new x coordinate
- * @param y the new y coordinate
- * @param w the new width
- * @param h the new height
- * @see #getFrame()
- */
- public void setFrame(double x, double y, double w, double h)
- {
- setArc(x, y, w, h, getAngleStart(), getAngleExtent(), type);
- }
-
- /**
- * Gets the bounds of the arc. This is much tighter than
- * <code>getBounds</code>, as it takes into consideration the start and
- * end angles, and the center point of a pie wedge, rather than just the
- * overall ellipse.
- *
- * @return the bounds of the arc
- * @see #getBounds()
- */
- public Rectangle2D getBounds2D()
- {
- double extent = getAngleExtent();
- if (Math.abs(extent) >= 360)
- return makeBounds(getX(), getY(), getWidth(), getHeight());
-
- // Find the minimal bounding box. This determined by its extrema,
- // which are the center, the endpoints of the arc, and any local
- // maximum contained by the arc.
- double rX = getWidth() / 2;
- double rY = getHeight() / 2;
- double centerX = getX() + rX;
- double centerY = getY() + rY;
-
- Point2D p1 = getStartPoint();
- Rectangle2D result = makeBounds(p1.getX(), p1.getY(), 0, 0);
- result.add(getEndPoint());
-
- if (type == PIE)
- result.add(centerX, centerY);
- if (containsAngle(0))
- result.add(centerX + rX, centerY);
- if (containsAngle(90))
- result.add(centerX, centerY - rY);
- if (containsAngle(180))
- result.add(centerX - rX, centerY);
- if (containsAngle(270))
- result.add(centerX, centerY + rY);
-
- return result;
- }
-
- /**
- * Construct a bounding box in a precision appropriate for the subclass.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- * @return the rectangle for use in getBounds2D
- */
- protected abstract Rectangle2D makeBounds(double x, double y, double w,
- double h);
-
- /**
- * Tests if the given angle, in degrees, is included in the arc.
- * All angles are normalized to be between 0 and 360 degrees.
- *
- * @param a the angle to test
- * @return true if it is contained
- */
- public boolean containsAngle(double a)
- {
- double start = getAngleStart();
- double extent = getAngleExtent();
- double end = start + extent;
-
- if (extent == 0)
- return false;
-
- if (extent >= 360 || extent <= -360)
- return true;
-
- if (extent < 0)
- {
- end = start;
- start += extent;
- }
-
- start %= 360;
- while (start < 0)
- start += 360;
-
- end %= 360;
- while (end < start)
- end += 360;
-
- a %= 360;
- while (a < start)
- a += 360;
-
- return a >= start && a < end; // starting angle included, ending angle not
- }
-
- /**
- * Determines if the arc contains the given point. If the bounding box
- * is empty, then this will return false.
- *
- * The area considered 'inside' an arc of type OPEN is the same as the
- * area inside an equivalent filled CHORD-type arc. The area considered
- * 'inside' a CHORD-type arc is the same as the filled area.
- *
- * @param x the x coordinate to test
- * @param y the y coordinate to test
- * @return true if the point is inside the arc
- */
- public boolean contains(double x, double y)
- {
- double w = getWidth();
- double h = getHeight();
- double extent = getAngleExtent();
- if (w <= 0 || h <= 0 || extent == 0)
- return false;
-
- double mx = getX() + w / 2;
- double my = getY() + h / 2;
- double dx = (x - mx) * 2 / w;
- double dy = (y - my) * 2 / h;
- if ((dx * dx + dy * dy) >= 1.0)
- return false;
-
- double angle = Math.toDegrees(Math.atan2(-dy, dx));
- if (getArcType() == PIE)
- return containsAngle(angle);
-
- double a1 = Math.toRadians(getAngleStart());
- double a2 = Math.toRadians(getAngleStart() + extent);
- double x1 = mx + getWidth() * Math.cos(a1) / 2;
- double y1 = my - getHeight() * Math.sin(a1) / 2;
- double x2 = mx + getWidth() * Math.cos(a2) / 2;
- double y2 = my - getHeight() * Math.sin(a2) / 2;
- double sgn = ((x2 - x1) * (my - y1) - (mx - x1) * (y2 - y1)) * ((x2 - x1) * (y
- - y1) - (x - x1) * (y2 - y1));
-
- if (Math.abs(extent) > 180)
- {
- if (containsAngle(angle))
- return true;
- return sgn > 0;
- }
- else
- {
- if (! containsAngle(angle))
- return false;
- return sgn < 0;
- }
- }
-
- /**
- * Tests if a given rectangle intersects the area of the arc.
- *
- * For a definition of the 'inside' area, see the contains() method.
- * @see #contains(double, double)
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @return true if the two shapes share common points
- */
- public boolean intersects(double x, double y, double w, double h)
- {
- double extent = getAngleExtent();
- if (extent == 0)
- return false;
-
- if (contains(x, y) || contains(x, y + h) || contains(x + w, y)
- || contains(x + w, y + h))
- return true;
-
- Rectangle2D rect = new Rectangle2D.Double(x, y, w, h);
-
- double a = getWidth() / 2.0;
- double b = getHeight() / 2.0;
-
- double mx = getX() + a;
- double my = getY() + b;
- double x1 = mx + a * Math.cos(Math.toRadians(getAngleStart()));
- double y1 = my - b * Math.sin(Math.toRadians(getAngleStart()));
- double x2 = mx + a * Math.cos(Math.toRadians(getAngleStart() + extent));
- double y2 = my - b * Math.sin(Math.toRadians(getAngleStart() + extent));
-
- if (getArcType() != CHORD)
- {
- // check intersections against the pie radii
- if (rect.intersectsLine(mx, my, x1, y1))
- return true;
- if (rect.intersectsLine(mx, my, x2, y2))
- return true;
- }
- else// check the chord
- if (rect.intersectsLine(x1, y1, x2, y2))
- return true;
-
- // Check the Arc segment against the four edges
- double dx;
-
- // Check the Arc segment against the four edges
- double dy;
- dy = y - my;
- dx = a * Math.sqrt(1 - ((dy * dy) / (b * b)));
- if (! java.lang.Double.isNaN(dx))
- {
- if (mx + dx >= x && mx + dx <= x + w
- && containsAngle(Math.toDegrees(Math.atan2(-dy, dx))))
- return true;
- if (mx - dx >= x && mx - dx <= x + w
- && containsAngle(Math.toDegrees(Math.atan2(-dy, -dx))))
- return true;
- }
- dy = (y + h) - my;
- dx = a * Math.sqrt(1 - ((dy * dy) / (b * b)));
- if (! java.lang.Double.isNaN(dx))
- {
- if (mx + dx >= x && mx + dx <= x + w
- && containsAngle(Math.toDegrees(Math.atan2(-dy, dx))))
- return true;
- if (mx - dx >= x && mx - dx <= x + w
- && containsAngle(Math.toDegrees(Math.atan2(-dy, -dx))))
- return true;
- }
- dx = x - mx;
- dy = b * Math.sqrt(1 - ((dx * dx) / (a * a)));
- if (! java.lang.Double.isNaN(dy))
- {
- if (my + dy >= y && my + dy <= y + h
- && containsAngle(Math.toDegrees(Math.atan2(-dy, dx))))
- return true;
- if (my - dy >= y && my - dy <= y + h
- && containsAngle(Math.toDegrees(Math.atan2(dy, dx))))
- return true;
- }
-
- dx = (x + w) - mx;
- dy = b * Math.sqrt(1 - ((dx * dx) / (a * a)));
- if (! java.lang.Double.isNaN(dy))
- {
- if (my + dy >= y && my + dy <= y + h
- && containsAngle(Math.toDegrees(Math.atan2(-dy, dx))))
- return true;
- if (my - dy >= y && my - dy <= y + h
- && containsAngle(Math.toDegrees(Math.atan2(dy, dx))))
- return true;
- }
-
- // Check whether the arc is contained within the box
- if (rect.contains(mx, my))
- return true;
-
- return false;
- }
-
- /**
- * Tests if a given rectangle is contained in the area of the arc.
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @return true if the arc contains the rectangle
- */
- public boolean contains(double x, double y, double w, double h)
- {
- double extent = getAngleExtent();
- if (extent == 0)
- return false;
-
- if (! (contains(x, y) && contains(x, y + h) && contains(x + w, y)
- && contains(x + w, y + h)))
- return false;
-
- Rectangle2D rect = new Rectangle2D.Double(x, y, w, h);
-
- double a = getWidth() / 2.0;
- double b = getHeight() / 2.0;
-
- double mx = getX() + a;
- double my = getY() + b;
- double x1 = mx + a * Math.cos(Math.toRadians(getAngleStart()));
- double y1 = my - b * Math.sin(Math.toRadians(getAngleStart()));
- double x2 = mx + a * Math.cos(Math.toRadians(getAngleStart() + extent));
- double y2 = my - b * Math.sin(Math.toRadians(getAngleStart() + extent));
- if (getArcType() != CHORD)
- {
- // check intersections against the pie radii
- if (rect.intersectsLine(mx, my, x1, y1))
- return false;
-
- if (rect.intersectsLine(mx, my, x2, y2))
- return false;
- }
- else if (rect.intersectsLine(x1, y1, x2, y2))
- return false;
- return true;
- }
-
- /**
- * Tests if a given rectangle is contained in the area of the arc.
- *
- * @param r the rectangle
- * @return true if the arc contains the rectangle
- */
- public boolean contains(Rectangle2D r)
- {
- return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Returns an iterator over this arc, with an optional transformation.
- * This iterator is threadsafe, so future modifications to the arc do not
- * affect the iteration.
- *
- * @param at the transformation, or null
- * @return a path iterator
- */
- public PathIterator getPathIterator(AffineTransform at)
- {
- return new ArcIterator(this, at);
- }
-
- /**
- * This class is used to iterate over an arc. Since ellipses are a subclass
- * of arcs, this is used by Ellipse2D as well.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- static final class ArcIterator implements PathIterator
- {
- /** The current iteration. */
- private int current;
-
- /** The last iteration. */
- private final int limit;
-
- /** The optional transformation. */
- private final AffineTransform xform;
-
- /** The x coordinate of the bounding box. */
- private final double x;
-
- /** The y coordinate of the bounding box. */
- private final double y;
-
- /** The width of the bounding box. */
- private final double w;
-
- /** The height of the bounding box. */
- private final double h;
-
- /** The start angle, in radians (not degrees). */
- private final double start;
-
- /** The extent angle, in radians (not degrees). */
- private final double extent;
-
- /** The arc closure type. */
- private final int type;
-
- /**
- * Construct a new iterator over an arc.
- *
- * @param a the arc
- * @param xform the transform
- */
- public ArcIterator(Arc2D a, AffineTransform xform)
- {
- this.xform = xform;
- x = a.getX();
- y = a.getY();
- w = a.getWidth();
- h = a.getHeight();
- double start = a.getAngleStart() * (Math.PI / 180);
- double extent = a.getAngleExtent() * (Math.PI / 180);
-
- if (extent < 0)
- {
- extent = -extent;
- start = 2 * Math.PI - extent + start;
- }
- this.start = start;
- this.extent = extent;
-
- type = a.type;
- if (w < 0 || h < 0)
- limit = -1;
- else if (extent == 0)
- limit = type;
- else if (extent <= Math.PI / 2.0)
- limit = type + 1;
- else if (extent <= Math.PI)
- limit = type + 2;
- else if (extent <= 3.0 * (Math.PI / 2.0))
- limit = type + 3;
- else
- limit = type + 4;
- }
-
- /**
- * Construct a new iterator over an ellipse.
- *
- * @param e the ellipse
- * @param xform the transform
- */
- public ArcIterator(Ellipse2D e, AffineTransform xform)
- {
- this.xform = xform;
- x = e.getX();
- y = e.getY();
- w = e.getWidth();
- h = e.getHeight();
- start = 0;
- extent = 2 * Math.PI;
- type = CHORD;
- limit = (w < 0 || h < 0) ? -1 : 5;
- }
-
- /**
- * Return the winding rule.
- *
- * @return {@link PathIterator#WIND_NON_ZERO}
- */
- public int getWindingRule()
- {
- return WIND_NON_ZERO;
- }
-
- /**
- * Test if the iteration is complete.
- *
- * @return true if more segments exist
- */
- public boolean isDone()
- {
- return current > limit;
- }
-
- /**
- * Advance the iterator.
- */
- public void next()
- {
- current++;
- }
-
- /**
- * Put the current segment into the array, and return the segment type.
- *
- * @param coords an array of 6 elements
- * @return the segment type
- * @throws NullPointerException if coords is null
- * @throws ArrayIndexOutOfBoundsException if coords is too small
- */
- public int currentSegment(float[] coords)
- {
- double[] double_coords = new double[6];
- int code = currentSegment(double_coords);
- for (int i = 0; i < 6; ++i)
- coords[i] = (float) double_coords[i];
- return code;
- }
-
- /**
- * Put the current segment into the array, and return the segment type.
- *
- * @param coords an array of 6 elements
- * @return the segment type
- * @throws NullPointerException if coords is null
- * @throws ArrayIndexOutOfBoundsException if coords is too small
- */
- public int currentSegment(double[] coords)
- {
- double rx = w / 2;
- double ry = h / 2;
- double xmid = x + rx;
- double ymid = y + ry;
-
- if (current > limit)
- throw new NoSuchElementException("arc iterator out of bounds");
-
- if (current == 0)
- {
- coords[0] = xmid + rx * Math.cos(start);
- coords[1] = ymid - ry * Math.sin(start);
- if (xform != null)
- xform.transform(coords, 0, coords, 0, 1);
- return SEG_MOVETO;
- }
-
- if (type != OPEN && current == limit)
- return SEG_CLOSE;
-
- if ((current == limit - 1) && (type == PIE))
- {
- coords[0] = xmid;
- coords[1] = ymid;
- if (xform != null)
- xform.transform(coords, 0, coords, 0, 1);
- return SEG_LINETO;
- }
-
- // note that this produces a cubic approximation of the arc segment,
- // not a true ellipsoid. there's no ellipsoid path segment code,
- // unfortunately. the cubic approximation looks about right, though.
- double kappa = (Math.sqrt(2.0) - 1.0) * (4.0 / 3.0);
- double quad = (Math.PI / 2.0);
-
- double curr_begin = start + (current - 1) * quad;
- double curr_extent = Math.min((start + extent) - curr_begin, quad);
- double portion_of_a_quadrant = curr_extent / quad;
-
- double x0 = xmid + rx * Math.cos(curr_begin);
- double y0 = ymid - ry * Math.sin(curr_begin);
-
- double x1 = xmid + rx * Math.cos(curr_begin + curr_extent);
- double y1 = ymid - ry * Math.sin(curr_begin + curr_extent);
-
- AffineTransform trans = new AffineTransform();
- double[] cvec = new double[2];
- double len = kappa * portion_of_a_quadrant;
- double angle = curr_begin;
-
- // in a hypothetical "first quadrant" setting, our first control
- // vector would be sticking up, from [1,0] to [1,kappa].
- //
- // let us recall however that in java2d, y coords are upside down
- // from what one would consider "normal" first quadrant rules, so we
- // will *subtract* the y value of this control vector from our first
- // point.
- cvec[0] = 0;
- cvec[1] = len;
- trans.scale(rx, ry);
- trans.rotate(angle);
- trans.transform(cvec, 0, cvec, 0, 1);
- coords[0] = x0 + cvec[0];
- coords[1] = y0 - cvec[1];
-
- // control vector #2 would, ideally, be sticking out and to the
- // right, in a first quadrant arc segment. again, subtraction of y.
- cvec[0] = 0;
- cvec[1] = -len;
- trans.rotate(curr_extent);
- trans.transform(cvec, 0, cvec, 0, 1);
- coords[2] = x1 + cvec[0];
- coords[3] = y1 - cvec[1];
-
- // end point
- coords[4] = x1;
- coords[5] = y1;
-
- if (xform != null)
- xform.transform(coords, 0, coords, 0, 3);
-
- return SEG_CUBICTO;
- }
- } // class ArcIterator
-
- /**
- * This class implements an arc in double precision.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- */
- public static class Double extends Arc2D
- {
- /** The x coordinate of the box bounding the ellipse of this arc. */
- public double x;
-
- /** The y coordinate of the box bounding the ellipse of this arc. */
- public double y;
-
- /** The width of the box bounding the ellipse of this arc. */
- public double width;
-
- /** The height of the box bounding the ellipse of this arc. */
- public double height;
-
- /** The start angle of this arc, in degrees. */
- public double start;
-
- /** The extent angle of this arc, in degrees. */
- public double extent;
-
- /**
- * Create a new, open arc at (0,0) with 0 extent.
- */
- public Double()
- {
- super(OPEN);
- }
-
- /**
- * Create a new arc of the given type at (0,0) with 0 extent.
- *
- * @param type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- */
- public Double(int type)
- {
- super(type);
- }
-
- /**
- * Create a new arc with the given dimensions.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- * @param start the start angle, in degrees
- * @param extent the extent, in degrees
- * @param type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- */
- public Double(double x, double y, double w, double h, double start,
- double extent, int type)
- {
- super(type);
- this.x = x;
- this.y = y;
- width = w;
- height = h;
- this.start = start;
- this.extent = extent;
- }
-
- /**
- * Create a new arc with the given dimensions.
- *
- * @param r the bounding box
- * @param start the start angle, in degrees
- * @param extent the extent, in degrees
- * @param type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- * @throws NullPointerException if r is null
- */
- public Double(Rectangle2D r, double start, double extent, int type)
- {
- super(type);
- x = r.getX();
- y = r.getY();
- width = r.getWidth();
- height = r.getHeight();
- this.start = start;
- this.extent = extent;
- }
-
- /**
- * Return the x coordinate of the bounding box.
- *
- * @return the value of x
- */
- public double getX()
- {
- return x;
- }
-
- /**
- * Return the y coordinate of the bounding box.
- *
- * @return the value of y
- */
- public double getY()
- {
- return y;
- }
-
- /**
- * Return the width of the bounding box.
- *
- * @return the value of width
- */
- public double getWidth()
- {
- return width;
- }
-
- /**
- * Return the height of the bounding box.
- *
- * @return the value of height
- */
- public double getHeight()
- {
- return height;
- }
-
- /**
- * Return the start angle of the arc, in degrees.
- *
- * @return the value of start
- */
- public double getAngleStart()
- {
- return start;
- }
-
- /**
- * Return the extent of the arc, in degrees.
- *
- * @return the value of extent
- */
- public double getAngleExtent()
- {
- return extent;
- }
-
- /**
- * Tests if the arc contains points.
- *
- * @return true if the arc has no interior
- */
- public boolean isEmpty()
- {
- return width <= 0 || height <= 0;
- }
-
- /**
- * Sets the arc to the given dimensions.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- * @param start the start angle, in degrees
- * @param extent the extent, in degrees
- * @param type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- */
- public void setArc(double x, double y, double w, double h, double start,
- double extent, int type)
- {
- this.x = x;
- this.y = y;
- width = w;
- height = h;
- this.start = start;
- this.extent = extent;
- setArcType(type);
- }
-
- /**
- * Sets the start angle of the arc.
- *
- * @param start the new start angle
- */
- public void setAngleStart(double start)
- {
- this.start = start;
- }
-
- /**
- * Sets the extent angle of the arc.
- *
- * @param extent the new extent angle
- */
- public void setAngleExtent(double extent)
- {
- this.extent = extent;
- }
-
- /**
- * Creates a tight bounding box given dimensions that more precise than
- * the bounding box of the ellipse.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- */
- protected Rectangle2D makeBounds(double x, double y, double w, double h)
- {
- return new Rectangle2D.Double(x, y, w, h);
- }
- } // class Double
-
- /**
- * This class implements an arc in float precision.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- */
- public static class Float extends Arc2D
- {
- /** The x coordinate of the box bounding the ellipse of this arc. */
- public float x;
-
- /** The y coordinate of the box bounding the ellipse of this arc. */
- public float y;
-
- /** The width of the box bounding the ellipse of this arc. */
- public float width;
-
- /** The height of the box bounding the ellipse of this arc. */
- public float height;
-
- /** The start angle of this arc, in degrees. */
- public float start;
-
- /** The extent angle of this arc, in degrees. */
- public float extent;
-
- /**
- * Create a new, open arc at (0,0) with 0 extent.
- */
- public Float()
- {
- super(OPEN);
- }
-
- /**
- * Create a new arc of the given type at (0,0) with 0 extent.
- *
- * @param type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- */
- public Float(int type)
- {
- super(type);
- }
-
- /**
- * Create a new arc with the given dimensions.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- * @param start the start angle, in degrees
- * @param extent the extent, in degrees
- * @param type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- */
- public Float(float x, float y, float w, float h, float start,
- float extent, int type)
- {
- super(type);
- this.x = x;
- this.y = y;
- width = w;
- height = h;
- this.start = start;
- this.extent = extent;
- }
-
- /**
- * Create a new arc with the given dimensions.
- *
- * @param r the bounding box
- * @param start the start angle, in degrees
- * @param extent the extent, in degrees
- * @param type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- * @throws NullPointerException if r is null
- */
- public Float(Rectangle2D r, float start, float extent, int type)
- {
- super(type);
- x = (float) r.getX();
- y = (float) r.getY();
- width = (float) r.getWidth();
- height = (float) r.getHeight();
- this.start = start;
- this.extent = (float) extent;
- }
-
- /**
- * Return the x coordinate of the bounding box.
- *
- * @return the value of x
- */
- public double getX()
- {
- return x;
- }
-
- /**
- * Return the y coordinate of the bounding box.
- *
- * @return the value of y
- */
- public double getY()
- {
- return y;
- }
-
- /**
- * Return the width of the bounding box.
- *
- * @return the value of width
- */
- public double getWidth()
- {
- return width;
- }
-
- /**
- * Return the height of the bounding box.
- *
- * @return the value of height
- */
- public double getHeight()
- {
- return height;
- }
-
- /**
- * Return the start angle of the arc, in degrees.
- *
- * @return the value of start
- */
- public double getAngleStart()
- {
- return start;
- }
-
- /**
- * Return the extent of the arc, in degrees.
- *
- * @return the value of extent
- */
- public double getAngleExtent()
- {
- return extent;
- }
-
- /**
- * Tests if the arc contains points.
- *
- * @return true if the arc has no interior
- */
- public boolean isEmpty()
- {
- return width <= 0 || height <= 0;
- }
-
- /**
- * Sets the arc to the given dimensions.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- * @param start the start angle, in degrees
- * @param extent the extent, in degrees
- * @param type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
- * @throws IllegalArgumentException if type is invalid
- */
- public void setArc(double x, double y, double w, double h, double start,
- double extent, int type)
- {
- this.x = (float) x;
- this.y = (float) y;
- width = (float) w;
- height = (float) h;
- this.start = (float) start;
- this.extent = (float) extent;
- setArcType(type);
- }
-
- /**
- * Sets the start angle of the arc.
- *
- * @param start the new start angle
- */
- public void setAngleStart(double start)
- {
- this.start = (float) start;
- }
-
- /**
- * Sets the extent angle of the arc.
- *
- * @param extent the new extent angle
- */
- public void setAngleExtent(double extent)
- {
- this.extent = (float) extent;
- }
-
- /**
- * Creates a tight bounding box given dimensions that more precise than
- * the bounding box of the ellipse.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- */
- protected Rectangle2D makeBounds(double x, double y, double w, double h)
- {
- return new Rectangle2D.Float((float) x, (float) y, (float) w, (float) h);
- }
- } // class Float
-} // class Arc2D
diff --git a/libjava/java/awt/geom/Area.java b/libjava/java/awt/geom/Area.java
deleted file mode 100644
index 7a0fac43a34..00000000000
--- a/libjava/java/awt/geom/Area.java
+++ /dev/null
@@ -1,3312 +0,0 @@
-/* Area.java -- represents a shape built by constructive area geometry
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.util.Vector;
-
-
-/**
- * The Area class represents any area for the purpose of
- * Constructive Area Geometry (CAG) manipulations. CAG manipulations
- * work as an area-wise form of boolean logic, where the basic operations are:
- * <P><li>Add (in boolean algebra: A <B>or</B> B)<BR>
- * <li>Subtract (in boolean algebra: A <B>and</B> (<B>not</B> B) )<BR>
- * <li>Intersect (in boolean algebra: A <B>and</B> B)<BR>
- * <li>Exclusive Or <BR>
- * <img src="doc-files/Area-1.png" width="342" height="302"
- * alt="Illustration of CAG operations" /><BR>
- * Above is an illustration of the CAG operations on two ring shapes.<P>
- *
- * The contains and intersects() methods are also more accurate than the
- * specification of #Shape requires.<P>
- *
- * Please note that constructing an Area can be slow
- * (Self-intersection resolving is proportional to the square of
- * the number of segments).<P>
- * @see #add(Area)
- * @see #subtract(Area)
- * @see #intersect(Area)
- * @see #exclusiveOr(Area)
- *
- * @author Sven de Marothy (sven@physto.se)
- *
- * @since 1.2
- * @status Works, but could be faster and more reliable.
- */
-public class Area implements Shape, Cloneable
-{
- /**
- * General numerical precision
- */
- private static final double EPSILON = 1E-11;
-
- /**
- * recursive subdivision epsilon - (see getRecursionDepth)
- */
- private static final double RS_EPSILON = 1E-13;
-
- /**
- * Snap distance - points within this distance are considered equal
- */
- private static final double PE_EPSILON = 1E-11;
-
- /**
- * Segment vectors containing solid areas and holes
- * This is package-private to avoid an accessor method.
- */
- Vector solids;
-
- /**
- * Segment vectors containing solid areas and holes
- * This is package-private to avoid an accessor method.
- */
- Vector holes;
-
- /**
- * Vector (temporary) storing curve-curve intersections
- */
- private Vector cc_intersections;
-
- /**
- * Winding rule WIND_NON_ZERO used, after construction,
- * this is irrelevant.
- */
- private int windingRule;
-
- /**
- * Constructs an empty Area
- */
- public Area()
- {
- solids = new Vector();
- holes = new Vector();
- }
-
- /**
- * Constructs an Area from any given Shape. <P>
- *
- * If the Shape is self-intersecting, the created Area will consist
- * of non-self-intersecting subpaths, and any inner paths which
- * are found redundant in accordance with the Shape's winding rule
- * will not be included.
- *
- * @param s the shape (<code>null</code> not permitted).
- *
- * @throws NullPointerException if <code>s</code> is <code>null</code>.
- */
- public Area(Shape s)
- {
- this();
-
- Vector p = makeSegment(s);
-
- // empty path
- if (p == null)
- return;
-
- // delete empty paths
- for (int i = 0; i < p.size(); i++)
- if (((Segment) p.elementAt(i)).getSignedArea() == 0.0)
- p.remove(i--);
-
- /*
- * Resolve self intersecting paths into non-intersecting
- * solids and holes.
- * Algorithm is as follows:
- * 1: Create nodes at all self intersections
- * 2: Put all segments into a list
- * 3: Grab a segment, follow it, change direction at each node,
- * removing segments from the list in the process
- * 4: Repeat (3) until no segments remain in the list
- * 5: Remove redundant paths and sort into solids and holes
- */
- Vector paths = new Vector();
- Segment v;
-
- for (int i = 0; i < p.size(); i++)
- {
- Segment path = (Segment) p.elementAt(i);
- createNodesSelf(path);
- }
-
- if (p.size() > 1)
- {
- for (int i = 0; i < p.size() - 1; i++)
- for (int j = i + 1; j < p.size(); j++)
- {
- Segment path1 = (Segment) p.elementAt(i);
- Segment path2 = (Segment) p.elementAt(j);
- createNodes(path1, path2);
- }
- }
-
- // we have intersecting points.
- Vector segments = new Vector();
-
- for (int i = 0; i < p.size(); i++)
- {
- Segment path = v = (Segment) p.elementAt(i);
- do
- {
- segments.add(v);
- v = v.next;
- }
- while (v != path);
- }
-
- paths = weilerAtherton(segments);
- deleteRedundantPaths(paths);
- }
-
- /**
- * Performs an add (union) operation on this area with another Area.<BR>
- * @param area - the area to be unioned with this one
- */
- public void add(Area area)
- {
- if (equals(area))
- return;
- if (area.isEmpty())
- return;
-
- Area B = (Area) area.clone();
-
- Vector pathA = new Vector();
- Vector pathB = new Vector();
- pathA.addAll(solids);
- pathA.addAll(holes);
- pathB.addAll(B.solids);
- pathB.addAll(B.holes);
-
- int nNodes = 0;
-
- for (int i = 0; i < pathA.size(); i++)
- {
- Segment a = (Segment) pathA.elementAt(i);
- for (int j = 0; j < pathB.size(); j++)
- {
- Segment b = (Segment) pathB.elementAt(j);
- nNodes += createNodes(a, b);
- }
- }
-
- Vector paths = new Vector();
- Segment v;
-
- // we have intersecting points.
- Vector segments = new Vector();
-
- // In a union operation, we keep all
- // segments of A oustide B and all B outside A
- for (int i = 0; i < pathA.size(); i++)
- {
- v = (Segment) pathA.elementAt(i);
- Segment path = v;
- do
- {
- if (v.isSegmentOutside(area))
- segments.add(v);
- v = v.next;
- }
- while (v != path);
- }
-
- for (int i = 0; i < pathB.size(); i++)
- {
- v = (Segment) pathB.elementAt(i);
- Segment path = v;
- do
- {
- if (v.isSegmentOutside(this))
- segments.add(v);
- v = v.next;
- }
- while (v != path);
- }
-
- paths = weilerAtherton(segments);
- deleteRedundantPaths(paths);
- }
-
- /**
- * Performs a subtraction operation on this Area.<BR>
- * @param area the area to be subtracted from this area.
- * @throws NullPointerException if <code>area</code> is <code>null</code>.
- */
- public void subtract(Area area)
- {
- if (isEmpty() || area.isEmpty())
- return;
-
- if (equals(area))
- {
- reset();
- return;
- }
-
- Vector pathA = new Vector();
- Area B = (Area) area.clone();
- pathA.addAll(solids);
- pathA.addAll(holes);
-
- // reverse the directions of B paths.
- setDirection(B.holes, true);
- setDirection(B.solids, false);
-
- Vector pathB = new Vector();
- pathB.addAll(B.solids);
- pathB.addAll(B.holes);
-
- int nNodes = 0;
-
- // create nodes
- for (int i = 0; i < pathA.size(); i++)
- {
- Segment a = (Segment) pathA.elementAt(i);
- for (int j = 0; j < pathB.size(); j++)
- {
- Segment b = (Segment) pathB.elementAt(j);
- nNodes += createNodes(a, b);
- }
- }
-
- Vector paths = new Vector();
-
- // we have intersecting points.
- Vector segments = new Vector();
-
- // In a subtraction operation, we keep all
- // segments of A oustide B and all B within A
- // We outsideness-test only one segment in each path
- // and the segments before and after any node
- for (int i = 0; i < pathA.size(); i++)
- {
- Segment v = (Segment) pathA.elementAt(i);
- Segment path = v;
- if (v.isSegmentOutside(area) && v.node == null)
- segments.add(v);
- boolean node = false;
- do
- {
- if ((v.node != null || node))
- {
- node = (v.node != null);
- if (v.isSegmentOutside(area))
- segments.add(v);
- }
- v = v.next;
- }
- while (v != path);
- }
-
- for (int i = 0; i < pathB.size(); i++)
- {
- Segment v = (Segment) pathB.elementAt(i);
- Segment path = v;
- if (! v.isSegmentOutside(this) && v.node == null)
- segments.add(v);
- v = v.next;
- boolean node = false;
- do
- {
- if ((v.node != null || node))
- {
- node = (v.node != null);
- if (! v.isSegmentOutside(this))
- segments.add(v);
- }
- v = v.next;
- }
- while (v != path);
- }
-
- paths = weilerAtherton(segments);
- deleteRedundantPaths(paths);
- }
-
- /**
- * Performs an intersection operation on this Area.<BR>
- * @param area - the area to be intersected with this area.
- * @throws NullPointerException if <code>area</code> is <code>null</code>.
- */
- public void intersect(Area area)
- {
- if (isEmpty() || area.isEmpty())
- {
- reset();
- return;
- }
- if (equals(area))
- return;
-
- Vector pathA = new Vector();
- Area B = (Area) area.clone();
- pathA.addAll(solids);
- pathA.addAll(holes);
-
- Vector pathB = new Vector();
- pathB.addAll(B.solids);
- pathB.addAll(B.holes);
-
- int nNodes = 0;
-
- // create nodes
- for (int i = 0; i < pathA.size(); i++)
- {
- Segment a = (Segment) pathA.elementAt(i);
- for (int j = 0; j < pathB.size(); j++)
- {
- Segment b = (Segment) pathB.elementAt(j);
- nNodes += createNodes(a, b);
- }
- }
-
- Vector paths = new Vector();
-
- // we have intersecting points.
- Vector segments = new Vector();
-
- // In an intersection operation, we keep all
- // segments of A within B and all B within A
- // (The rest must be redundant)
- // We outsideness-test only one segment in each path
- // and the segments before and after any node
- for (int i = 0; i < pathA.size(); i++)
- {
- Segment v = (Segment) pathA.elementAt(i);
- Segment path = v;
- if (! v.isSegmentOutside(area) && v.node == null)
- segments.add(v);
- boolean node = false;
- do
- {
- if ((v.node != null || node))
- {
- node = (v.node != null);
- if (! v.isSegmentOutside(area))
- segments.add(v);
- }
- v = v.next;
- }
- while (v != path);
- }
-
- for (int i = 0; i < pathB.size(); i++)
- {
- Segment v = (Segment) pathB.elementAt(i);
- Segment path = v;
- if (! v.isSegmentOutside(this) && v.node == null)
- segments.add(v);
- v = v.next;
- boolean node = false;
- do
- {
- if ((v.node != null || node))
- {
- node = (v.node != null);
- if (! v.isSegmentOutside(this))
- segments.add(v);
- }
- v = v.next;
- }
- while (v != path);
- }
-
- paths = weilerAtherton(segments);
- deleteRedundantPaths(paths);
- }
-
- /**
- * Performs an exclusive-or operation on this Area.<BR>
- * @param area - the area to be XORed with this area.
- * @throws NullPointerException if <code>area</code> is <code>null</code>.
- */
- public void exclusiveOr(Area area)
- {
- if (area.isEmpty())
- return;
-
- if (isEmpty())
- {
- Area B = (Area) area.clone();
- solids = B.solids;
- holes = B.holes;
- return;
- }
- if (equals(area))
- {
- reset();
- return;
- }
-
- Vector pathA = new Vector();
-
- Area B = (Area) area.clone();
- Vector pathB = new Vector();
- pathA.addAll(solids);
- pathA.addAll(holes);
-
- // reverse the directions of B paths.
- setDirection(B.holes, true);
- setDirection(B.solids, false);
- pathB.addAll(B.solids);
- pathB.addAll(B.holes);
-
- int nNodes = 0;
-
- for (int i = 0; i < pathA.size(); i++)
- {
- Segment a = (Segment) pathA.elementAt(i);
- for (int j = 0; j < pathB.size(); j++)
- {
- Segment b = (Segment) pathB.elementAt(j);
- nNodes += createNodes(a, b);
- }
- }
-
- Vector paths = new Vector();
- Segment v;
-
- // we have intersecting points.
- Vector segments = new Vector();
-
- // In an XOR operation, we operate on all segments
- for (int i = 0; i < pathA.size(); i++)
- {
- v = (Segment) pathA.elementAt(i);
- Segment path = v;
- do
- {
- segments.add(v);
- v = v.next;
- }
- while (v != path);
- }
-
- for (int i = 0; i < pathB.size(); i++)
- {
- v = (Segment) pathB.elementAt(i);
- Segment path = v;
- do
- {
- segments.add(v);
- v = v.next;
- }
- while (v != path);
- }
-
- paths = weilerAtherton(segments);
- deleteRedundantPaths(paths);
- }
-
- /**
- * Clears the Area object, creating an empty area.
- */
- public void reset()
- {
- solids = new Vector();
- holes = new Vector();
- }
-
- /**
- * Returns whether this area encloses any area.
- * @return true if the object encloses any area.
- */
- public boolean isEmpty()
- {
- if (solids.size() == 0)
- return true;
-
- double totalArea = 0;
- for (int i = 0; i < solids.size(); i++)
- totalArea += Math.abs(((Segment) solids.elementAt(i)).getSignedArea());
- for (int i = 0; i < holes.size(); i++)
- totalArea -= Math.abs(((Segment) holes.elementAt(i)).getSignedArea());
- if (totalArea <= EPSILON)
- return true;
-
- return false;
- }
-
- /**
- * Determines whether the Area consists entirely of line segments
- * @return true if the Area lines-only, false otherwise
- */
- public boolean isPolygonal()
- {
- for (int i = 0; i < holes.size(); i++)
- if (! ((Segment) holes.elementAt(i)).isPolygonal())
- return false;
- for (int i = 0; i < solids.size(); i++)
- if (! ((Segment) solids.elementAt(i)).isPolygonal())
- return false;
- return true;
- }
-
- /**
- * Determines if the Area is rectangular.<P>
- *
- * This is strictly qualified. An area is considered rectangular if:<BR>
- * <li>It consists of a single polygonal path.<BR>
- * <li>It is oriented parallel/perpendicular to the xy axis<BR>
- * <li>It must be exactly rectangular, i.e. small errors induced by
- * transformations may cause a false result, although the area is
- * visibly rectangular.<P>
- * @return true if the above criteria are met, false otherwise
- */
- public boolean isRectangular()
- {
- if (isEmpty())
- return true;
-
- if (holes.size() != 0 || solids.size() != 1)
- return false;
-
- Segment path = (Segment) solids.elementAt(0);
- if (! path.isPolygonal())
- return false;
-
- int nCorners = 0;
- Segment s = path;
- do
- {
- Segment s2 = s.next;
- double d1 = (s.P2.getX() - s.P1.getX())*(s2.P2.getX() - s2.P1.getX())/
- ((s.P1.distance(s.P2)) * (s2.P1.distance(s2.P2)));
- double d2 = (s.P2.getY() - s.P1.getY())*(s2.P2.getY() - s2.P1.getY())/
- ((s.P1.distance(s.P2)) * (s2.P1.distance(s2.P2)));
- double dotproduct = d1 + d2;
-
- // For some reason, only rectangles on the XY axis count.
- if (d1 != 0 && d2 != 0)
- return false;
-
- if (Math.abs(dotproduct) == 0) // 90 degree angle
- nCorners++;
- else if ((Math.abs(1.0 - dotproduct) > 0)) // 0 degree angle?
- return false; // if not, return false
-
- s = s.next;
- }
- while (s != path);
-
- return nCorners == 4;
- }
-
- /**
- * Returns whether the Area consists of more than one simple
- * (non self-intersecting) subpath.
- *
- * @return true if the Area consists of none or one simple subpath,
- * false otherwise.
- */
- public boolean isSingular()
- {
- return (holes.size() == 0 && solids.size() <= 1);
- }
-
- /**
- * Returns the bounding box of the Area.<P> Unlike the CubicCurve2D and
- * QuadraticCurve2D classes, this method will return the tightest possible
- * bounding box, evaluating the extreme points of each curved segment.<P>
- * @return the bounding box
- */
- public Rectangle2D getBounds2D()
- {
- if (solids.size() == 0)
- return new Rectangle2D.Double(0.0, 0.0, 0.0, 0.0);
-
- double xmin;
- double xmax;
- double ymin;
- double ymax;
- xmin = xmax = ((Segment) solids.elementAt(0)).P1.getX();
- ymin = ymax = ((Segment) solids.elementAt(0)).P1.getY();
-
- for (int path = 0; path < solids.size(); path++)
- {
- Rectangle2D r = ((Segment) solids.elementAt(path)).getPathBounds();
- xmin = Math.min(r.getMinX(), xmin);
- ymin = Math.min(r.getMinY(), ymin);
- xmax = Math.max(r.getMaxX(), xmax);
- ymax = Math.max(r.getMaxY(), ymax);
- }
-
- return (new Rectangle2D.Double(xmin, ymin, (xmax - xmin), (ymax - ymin)));
- }
-
- /**
- * Returns the bounds of this object in Rectangle format.
- * Please note that this may lead to loss of precision.
- *
- * @return The bounds.
- * @see #getBounds2D()
- */
- public Rectangle getBounds()
- {
- return getBounds2D().getBounds();
- }
-
- /**
- * Create a new area of the same run-time type with the same contents as
- * this one.
- *
- * @return the clone
- */
- public Object clone()
- {
- try
- {
- Area clone = new Area();
- for (int i = 0; i < solids.size(); i++)
- clone.solids.add(((Segment) solids.elementAt(i)).cloneSegmentList());
- for (int i = 0; i < holes.size(); i++)
- clone.holes.add(((Segment) holes.elementAt(i)).cloneSegmentList());
- return clone;
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-
- /**
- * Compares two Areas.
- *
- * @param area the area to compare against this area (<code>null</code>
- * permitted).
- * @return <code>true</code> if the areas are equal, and <code>false</code>
- * otherwise.
- */
- public boolean equals(Area area)
- {
- if (area == null)
- return false;
-
- if (! getBounds2D().equals(area.getBounds2D()))
- return false;
-
- if (solids.size() != area.solids.size()
- || holes.size() != area.holes.size())
- return false;
-
- Vector pathA = new Vector();
- pathA.addAll(solids);
- pathA.addAll(holes);
- Vector pathB = new Vector();
- pathB.addAll(area.solids);
- pathB.addAll(area.holes);
-
- int nPaths = pathA.size();
- boolean[][] match = new boolean[2][nPaths];
-
- for (int i = 0; i < nPaths; i++)
- {
- for (int j = 0; j < nPaths; j++)
- {
- Segment p1 = (Segment) pathA.elementAt(i);
- Segment p2 = (Segment) pathB.elementAt(j);
- if (! match[0][i] && ! match[1][j])
- if (p1.pathEquals(p2))
- match[0][i] = match[1][j] = true;
- }
- }
-
- boolean result = true;
- for (int i = 0; i < nPaths; i++)
- result = result && match[0][i] && match[1][i];
- return result;
- }
-
- /**
- * Transforms this area by the AffineTransform at.
- *
- * @param at the transform.
- */
- public void transform(AffineTransform at)
- {
- for (int i = 0; i < solids.size(); i++)
- ((Segment) solids.elementAt(i)).transformSegmentList(at);
- for (int i = 0; i < holes.size(); i++)
- ((Segment) holes.elementAt(i)).transformSegmentList(at);
-
- // Note that the orientation is not invariant under inversion
- if ((at.getType() & AffineTransform.TYPE_FLIP) != 0)
- {
- setDirection(holes, false);
- setDirection(solids, true);
- }
- }
-
- /**
- * Returns a new Area equal to this one, transformed
- * by the AffineTransform at.
- * @param at the transform.
- * @return the transformed area
- * @throws NullPointerException if <code>at</code> is <code>null</code>.
- */
- public Area createTransformedArea(AffineTransform at)
- {
- Area a = (Area) clone();
- a.transform(at);
- return a;
- }
-
- /**
- * Determines if the point (x,y) is contained within this Area.
- *
- * @param x the x-coordinate of the point.
- * @param y the y-coordinate of the point.
- * @return true if the point is contained, false otherwise.
- */
- public boolean contains(double x, double y)
- {
- int n = 0;
- for (int i = 0; i < solids.size(); i++)
- if (((Segment) solids.elementAt(i)).contains(x, y))
- n++;
-
- for (int i = 0; i < holes.size(); i++)
- if (((Segment) holes.elementAt(i)).contains(x, y))
- n--;
-
- return (n != 0);
- }
-
- /**
- * Determines if the Point2D p is contained within this Area.
- *
- * @param p the point.
- * @return <code>true</code> if the point is contained, <code>false</code>
- * otherwise.
- * @throws NullPointerException if <code>p</code> is <code>null</code>.
- */
- public boolean contains(Point2D p)
- {
- return contains(p.getX(), p.getY());
- }
-
- /**
- * Determines if the rectangle specified by (x,y) as the upper-left
- * and with width w and height h is completely contained within this Area,
- * returns false otherwise.<P>
- *
- * This method should always produce the correct results, unlike for other
- * classes in geom.
- *
- * @param x the x-coordinate of the rectangle.
- * @param y the y-coordinate of the rectangle.
- * @param w the width of the the rectangle.
- * @param h the height of the rectangle.
- * @return <code>true</code> if the rectangle is considered contained
- */
- public boolean contains(double x, double y, double w, double h)
- {
- LineSegment[] l = new LineSegment[4];
- l[0] = new LineSegment(x, y, x + w, y);
- l[1] = new LineSegment(x, y + h, x + w, y + h);
- l[2] = new LineSegment(x, y, x, y + h);
- l[3] = new LineSegment(x + w, y, x + w, y + h);
-
- // Since every segment in the area must a contour
- // between inside/outside segments, ANY intersection
- // will mean the rectangle is not entirely contained.
- for (int i = 0; i < 4; i++)
- {
- for (int path = 0; path < solids.size(); path++)
- {
- Segment v;
- Segment start;
- start = v = (Segment) solids.elementAt(path);
- do
- {
- if (l[i].hasIntersections(v))
- return false;
- v = v.next;
- }
- while (v != start);
- }
- for (int path = 0; path < holes.size(); path++)
- {
- Segment v;
- Segment start;
- start = v = (Segment) holes.elementAt(path);
- do
- {
- if (l[i].hasIntersections(v))
- return false;
- v = v.next;
- }
- while (v != start);
- }
- }
-
- // Is any point inside?
- if (! contains(x, y))
- return false;
-
- // Final hoop: Is the rectangle non-intersecting and inside,
- // but encloses a hole?
- Rectangle2D r = new Rectangle2D.Double(x, y, w, h);
- for (int path = 0; path < holes.size(); path++)
- if (! ((Segment) holes.elementAt(path)).isSegmentOutside(r))
- return false;
-
- return true;
- }
-
- /**
- * Determines if the Rectangle2D specified by r is completely contained
- * within this Area, returns false otherwise.<P>
- *
- * This method should always produce the correct results, unlike for other
- * classes in geom.
- *
- * @param r the rectangle.
- * @return <code>true</code> if the rectangle is considered contained
- *
- * @throws NullPointerException if <code>r</code> is <code>null</code>.
- */
- public boolean contains(Rectangle2D r)
- {
- return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Determines if the rectangle specified by (x,y) as the upper-left
- * and with width w and height h intersects any part of this Area.
- *
- * @param x the x-coordinate for the rectangle.
- * @param y the y-coordinate for the rectangle.
- * @param w the width of the rectangle.
- * @param h the height of the rectangle.
- * @return <code>true</code> if the rectangle intersects the area,
- * <code>false</code> otherwise.
- */
- public boolean intersects(double x, double y, double w, double h)
- {
- if (solids.size() == 0)
- return false;
-
- LineSegment[] l = new LineSegment[4];
- l[0] = new LineSegment(x, y, x + w, y);
- l[1] = new LineSegment(x, y + h, x + w, y + h);
- l[2] = new LineSegment(x, y, x, y + h);
- l[3] = new LineSegment(x + w, y, x + w, y + h);
-
- // Return true on any intersection
- for (int i = 0; i < 4; i++)
- {
- for (int path = 0; path < solids.size(); path++)
- {
- Segment v;
- Segment start;
- start = v = (Segment) solids.elementAt(path);
- do
- {
- if (l[i].hasIntersections(v))
- return true;
- v = v.next;
- }
- while (v != start);
- }
- for (int path = 0; path < holes.size(); path++)
- {
- Segment v;
- Segment start;
- start = v = (Segment) holes.elementAt(path);
- do
- {
- if (l[i].hasIntersections(v))
- return true;
- v = v.next;
- }
- while (v != start);
- }
- }
-
- // Non-intersecting, Is any point inside?
- if (contains(x + w * 0.5, y + h * 0.5))
- return true;
-
- // What if the rectangle encloses the whole shape?
- Point2D p = ((Segment) solids.elementAt(0)).getMidPoint();
- if ((new Rectangle2D.Double(x, y, w, h)).contains(p))
- return true;
- return false;
- }
-
- /**
- * Determines if the Rectangle2D specified by r intersects any
- * part of this Area.
- * @param r the rectangle to test intersection with (<code>null</code>
- * not permitted).
- * @return <code>true</code> if the rectangle intersects the area,
- * <code>false</code> otherwise.
- * @throws NullPointerException if <code>r</code> is <code>null</code>.
- */
- public boolean intersects(Rectangle2D r)
- {
- return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Returns a PathIterator object defining the contour of this Area,
- * transformed by at.
- *
- * @param at the transform.
- * @return A path iterator.
- */
- public PathIterator getPathIterator(AffineTransform at)
- {
- return (new AreaIterator(at));
- }
-
- /**
- * Returns a flattened PathIterator object defining the contour of this
- * Area, transformed by at and with a defined flatness.
- *
- * @param at the transform.
- * @param flatness the flatness.
- * @return A path iterator.
- */
- public PathIterator getPathIterator(AffineTransform at, double flatness)
- {
- return new FlatteningPathIterator(getPathIterator(at), flatness);
- }
-
- //---------------------------------------------------------------------
- // Non-public methods and classes
-
- /**
- * Private pathiterator object.
- */
- private class AreaIterator implements PathIterator
- {
- private Vector segments;
- private int index;
- private AffineTransform at;
-
- // Simple compound type for segments
- class IteratorSegment
- {
- int type;
- double[] coords;
-
- IteratorSegment()
- {
- coords = new double[6];
- }
- }
-
- /**
- * The contructor here does most of the work,
- * creates a vector of IteratorSegments, which can
- * readily be returned
- */
- public AreaIterator(AffineTransform at)
- {
- this.at = at;
- index = 0;
- segments = new Vector();
- Vector allpaths = new Vector();
- allpaths.addAll(solids);
- allpaths.addAll(holes);
-
- for (int i = 0; i < allpaths.size(); i++)
- {
- Segment v = (Segment) allpaths.elementAt(i);
- Segment start = v;
-
- IteratorSegment is = new IteratorSegment();
- is.type = SEG_MOVETO;
- is.coords[0] = start.P1.getX();
- is.coords[1] = start.P1.getY();
- segments.add(is);
-
- do
- {
- is = new IteratorSegment();
- is.type = v.pathIteratorFormat(is.coords);
- segments.add(is);
- v = v.next;
- }
- while (v != start);
-
- is = new IteratorSegment();
- is.type = SEG_CLOSE;
- segments.add(is);
- }
- }
-
- public int currentSegment(double[] coords)
- {
- IteratorSegment s = (IteratorSegment) segments.elementAt(index);
- if (at != null)
- at.transform(s.coords, 0, coords, 0, 3);
- else
- for (int i = 0; i < 6; i++)
- coords[i] = s.coords[i];
- return (s.type);
- }
-
- public int currentSegment(float[] coords)
- {
- IteratorSegment s = (IteratorSegment) segments.elementAt(index);
- double[] d = new double[6];
- if (at != null)
- {
- at.transform(s.coords, 0, d, 0, 3);
- for (int i = 0; i < 6; i++)
- coords[i] = (float) d[i];
- }
- else
- for (int i = 0; i < 6; i++)
- coords[i] = (float) s.coords[i];
- return (s.type);
- }
-
- // Note that the winding rule should not matter here,
- // EVEN_ODD is chosen because it renders faster.
- public int getWindingRule()
- {
- return (PathIterator.WIND_EVEN_ODD);
- }
-
- public boolean isDone()
- {
- return (index >= segments.size());
- }
-
- public void next()
- {
- index++;
- }
- }
-
- /**
- * Performs the fundamental task of the Weiler-Atherton algorithm,
- * traverse a list of segments, for each segment:
- * Follow it, removing segments from the list and switching paths
- * at each node. Do so until the starting segment is reached.
- *
- * Returns a Vector of the resulting paths.
- */
- private Vector weilerAtherton(Vector segments)
- {
- Vector paths = new Vector();
- while (segments.size() > 0)
- {
- // Iterate over the path
- Segment start = (Segment) segments.elementAt(0);
- Segment s = start;
- do
- {
- segments.remove(s);
- if (s.node != null)
- { // switch over
- s.next = s.node;
- s.node = null;
- }
- s = s.next; // continue
- }
- while (s != start);
-
- paths.add(start);
- }
- return paths;
- }
-
- /**
- * A small wrapper class to store intersection points
- */
- private class Intersection
- {
- Point2D p; // the 2D point of intersection
- double ta; // the parametric value on a
- double tb; // the parametric value on b
- Segment seg; // segment placeholder for node setting
-
- public Intersection(Point2D p, double ta, double tb)
- {
- this.p = p;
- this.ta = ta;
- this.tb = tb;
- }
- }
-
- /**
- * Returns the recursion depth necessary to approximate the
- * curve by line segments within the error RS_EPSILON.
- *
- * This is done with Wang's formula:
- * L0 = max{0<=i<=N-2}(|xi - 2xi+1 + xi+2|,|yi - 2yi+1 + yi+2|)
- * r0 = log4(sqrt(2)*N*(N-1)*L0/8e)
- * Where e is the maximum distance error (RS_EPSILON)
- */
- private int getRecursionDepth(CubicSegment curve)
- {
- double x0 = curve.P1.getX();
- double y0 = curve.P1.getY();
-
- double x1 = curve.cp1.getX();
- double y1 = curve.cp1.getY();
-
- double x2 = curve.cp2.getX();
- double y2 = curve.cp2.getY();
-
- double x3 = curve.P2.getX();
- double y3 = curve.P2.getY();
-
- double L0 = Math.max(Math.max(Math.abs(x0 - 2 * x1 + x2),
- Math.abs(x1 - 2 * x2 + x3)),
- Math.max(Math.abs(y0 - 2 * y1 + y2),
- Math.abs(y1 - 2 * y2 + y3)));
-
- double f = Math.sqrt(2) * 6.0 * L0 / (8.0 * RS_EPSILON);
-
- int r0 = (int) Math.ceil(Math.log(f) / Math.log(4.0));
- return (r0);
- }
-
- /**
- * Performs recursive subdivision:
- * @param c1 - curve 1
- * @param c2 - curve 2
- * @param depth1 - recursion depth of curve 1
- * @param depth2 - recursion depth of curve 2
- * @param t1 - global parametric value of the first curve's starting point
- * @param t2 - global parametric value of the second curve's starting point
- * @param w1 - global parametric length of curve 1
- * @param c1 - global parametric length of curve 2
- *
- * The final four parameters are for keeping track of the parametric
- * value of the curve. For a full curve t = 0, w = 1, w is halved with
- * each subdivision.
- */
- private void recursiveSubdivide(CubicCurve2D c1, CubicCurve2D c2,
- int depth1, int depth2, double t1,
- double t2, double w1, double w2)
- {
- boolean flat1 = depth1 <= 0;
- boolean flat2 = depth2 <= 0;
-
- if (flat1 && flat2)
- {
- double xlk = c1.getP2().getX() - c1.getP1().getX();
- double ylk = c1.getP2().getY() - c1.getP1().getY();
-
- double xnm = c2.getP2().getX() - c2.getP1().getX();
- double ynm = c2.getP2().getY() - c2.getP1().getY();
-
- double xmk = c2.getP1().getX() - c1.getP1().getX();
- double ymk = c2.getP1().getY() - c1.getP1().getY();
- double det = xnm * ylk - ynm * xlk;
-
- if (det + 1.0 == 1.0)
- return;
-
- double detinv = 1.0 / det;
- double s = (xnm * ymk - ynm * xmk) * detinv;
- double t = (xlk * ymk - ylk * xmk) * detinv;
- if ((s < 0.0) || (s > 1.0) || (t < 0.0) || (t > 1.0))
- return;
-
- double[] temp = new double[2];
- temp[0] = t1 + s * w1;
- temp[1] = t2 + t * w1;
- cc_intersections.add(temp);
- return;
- }
-
- CubicCurve2D.Double c11 = new CubicCurve2D.Double();
- CubicCurve2D.Double c12 = new CubicCurve2D.Double();
- CubicCurve2D.Double c21 = new CubicCurve2D.Double();
- CubicCurve2D.Double c22 = new CubicCurve2D.Double();
-
- if (! flat1 && ! flat2)
- {
- depth1--;
- depth2--;
- w1 = w1 * 0.5;
- w2 = w2 * 0.5;
- c1.subdivide(c11, c12);
- c2.subdivide(c21, c22);
- if (c11.getBounds2D().intersects(c21.getBounds2D()))
- recursiveSubdivide(c11, c21, depth1, depth2, t1, t2, w1, w2);
- if (c11.getBounds2D().intersects(c22.getBounds2D()))
- recursiveSubdivide(c11, c22, depth1, depth2, t1, t2 + w2, w1, w2);
- if (c12.getBounds2D().intersects(c21.getBounds2D()))
- recursiveSubdivide(c12, c21, depth1, depth2, t1 + w1, t2, w1, w2);
- if (c12.getBounds2D().intersects(c22.getBounds2D()))
- recursiveSubdivide(c12, c22, depth1, depth2, t1 + w1, t2 + w2, w1, w2);
- return;
- }
-
- if (! flat1)
- {
- depth1--;
- c1.subdivide(c11, c12);
- w1 = w1 * 0.5;
- if (c11.getBounds2D().intersects(c2.getBounds2D()))
- recursiveSubdivide(c11, c2, depth1, depth2, t1, t2, w1, w2);
- if (c12.getBounds2D().intersects(c2.getBounds2D()))
- recursiveSubdivide(c12, c2, depth1, depth2, t1 + w1, t2, w1, w2);
- return;
- }
-
- depth2--;
- c2.subdivide(c21, c22);
- w2 = w2 * 0.5;
- if (c1.getBounds2D().intersects(c21.getBounds2D()))
- recursiveSubdivide(c1, c21, depth1, depth2, t1, t2, w1, w2);
- if (c1.getBounds2D().intersects(c22.getBounds2D()))
- recursiveSubdivide(c1, c22, depth1, depth2, t1, t2 + w2, w1, w2);
- }
-
- /**
- * Returns a set of interesections between two Cubic segments
- * Or null if no intersections were found.
- *
- * The method used to find the intersection is recursive midpoint
- * subdivision. Outline description:
- *
- * 1) Check if the bounding boxes of the curves intersect,
- * 2) If so, divide the curves in the middle and test the bounding
- * boxes again,
- * 3) Repeat until a maximum recursion depth has been reached, where
- * the intersecting curves can be approximated by line segments.
- *
- * This is a reasonably accurate method, although the recursion depth
- * is typically around 20, the bounding-box tests allow for significant
- * pruning of the subdivision tree.
- *
- * This is package-private to avoid an accessor method.
- */
- Intersection[] cubicCubicIntersect(CubicSegment curve1, CubicSegment curve2)
- {
- Rectangle2D r1 = curve1.getBounds();
- Rectangle2D r2 = curve2.getBounds();
-
- if (! r1.intersects(r2))
- return null;
-
- cc_intersections = new Vector();
- recursiveSubdivide(curve1.getCubicCurve2D(), curve2.getCubicCurve2D(),
- getRecursionDepth(curve1), getRecursionDepth(curve2),
- 0.0, 0.0, 1.0, 1.0);
-
- if (cc_intersections.size() == 0)
- return null;
-
- Intersection[] results = new Intersection[cc_intersections.size()];
- for (int i = 0; i < cc_intersections.size(); i++)
- {
- double[] temp = (double[]) cc_intersections.elementAt(i);
- results[i] = new Intersection(curve1.evaluatePoint(temp[0]), temp[0],
- temp[1]);
- }
- cc_intersections = null;
- return (results);
- }
-
- /**
- * Returns the intersections between a line and a quadratic bezier
- * Or null if no intersections are found1
- * This is done through combining the line's equation with the
- * parametric form of the Bezier and solving the resulting quadratic.
- * This is package-private to avoid an accessor method.
- */
- Intersection[] lineQuadIntersect(LineSegment l, QuadSegment c)
- {
- double[] y = new double[3];
- double[] x = new double[3];
- double[] r = new double[3];
- int nRoots;
- double x0 = c.P1.getX();
- double y0 = c.P1.getY();
- double x1 = c.cp.getX();
- double y1 = c.cp.getY();
- double x2 = c.P2.getX();
- double y2 = c.P2.getY();
-
- double lx0 = l.P1.getX();
- double ly0 = l.P1.getY();
- double lx1 = l.P2.getX();
- double ly1 = l.P2.getY();
- double dx = lx1 - lx0;
- double dy = ly1 - ly0;
-
- // form r(t) = y(t) - x(t) for the bezier
- y[0] = y0;
- y[1] = 2 * (y1 - y0);
- y[2] = (y2 - 2 * y1 + y0);
-
- x[0] = x0;
- x[1] = 2 * (x1 - x0);
- x[2] = (x2 - 2 * x1 + x0);
-
- // a point, not a line
- if (dy == 0 && dx == 0)
- return null;
-
- // line on y axis
- if (dx == 0 || (dy / dx) > 1.0)
- {
- double k = dx / dy;
- x[0] -= lx0;
- y[0] -= ly0;
- y[0] *= k;
- y[1] *= k;
- y[2] *= k;
- }
- else
- {
- double k = dy / dx;
- x[0] -= lx0;
- y[0] -= ly0;
- x[0] *= k;
- x[1] *= k;
- x[2] *= k;
- }
-
- for (int i = 0; i < 3; i++)
- r[i] = y[i] - x[i];
-
- if ((nRoots = QuadCurve2D.solveQuadratic(r)) > 0)
- {
- Intersection[] temp = new Intersection[nRoots];
- int intersections = 0;
- for (int i = 0; i < nRoots; i++)
- {
- double t = r[i];
- if (t >= 0.0 && t <= 1.0)
- {
- Point2D p = c.evaluatePoint(t);
-
- // if the line is on an axis, snap the point to that axis.
- if (dx == 0)
- p.setLocation(lx0, p.getY());
- if (dy == 0)
- p.setLocation(p.getX(), ly0);
-
- if (p.getX() <= Math.max(lx0, lx1)
- && p.getX() >= Math.min(lx0, lx1)
- && p.getY() <= Math.max(ly0, ly1)
- && p.getY() >= Math.min(ly0, ly1))
- {
- double lineparameter = p.distance(l.P1) / l.P2.distance(l.P1);
- temp[i] = new Intersection(p, lineparameter, t);
- intersections++;
- }
- }
- else
- temp[i] = null;
- }
- if (intersections == 0)
- return null;
-
- Intersection[] rValues = new Intersection[intersections];
-
- for (int i = 0; i < nRoots; i++)
- if (temp[i] != null)
- rValues[--intersections] = temp[i];
- return (rValues);
- }
- return null;
- }
-
- /**
- * Returns the intersections between a line and a cubic segment
- * This is done through combining the line's equation with the
- * parametric form of the Bezier and solving the resulting quadratic.
- * This is package-private to avoid an accessor method.
- */
- Intersection[] lineCubicIntersect(LineSegment l, CubicSegment c)
- {
- double[] y = new double[4];
- double[] x = new double[4];
- double[] r = new double[4];
- int nRoots;
- double x0 = c.P1.getX();
- double y0 = c.P1.getY();
- double x1 = c.cp1.getX();
- double y1 = c.cp1.getY();
- double x2 = c.cp2.getX();
- double y2 = c.cp2.getY();
- double x3 = c.P2.getX();
- double y3 = c.P2.getY();
-
- double lx0 = l.P1.getX();
- double ly0 = l.P1.getY();
- double lx1 = l.P2.getX();
- double ly1 = l.P2.getY();
- double dx = lx1 - lx0;
- double dy = ly1 - ly0;
-
- // form r(t) = y(t) - x(t) for the bezier
- y[0] = y0;
- y[1] = 3 * (y1 - y0);
- y[2] = 3 * (y2 + y0 - 2 * y1);
- y[3] = y3 - 3 * y2 + 3 * y1 - y0;
-
- x[0] = x0;
- x[1] = 3 * (x1 - x0);
- x[2] = 3 * (x2 + x0 - 2 * x1);
- x[3] = x3 - 3 * x2 + 3 * x1 - x0;
-
- // a point, not a line
- if (dy == 0 && dx == 0)
- return null;
-
- // line on y axis
- if (dx == 0 || (dy / dx) > 1.0)
- {
- double k = dx / dy;
- x[0] -= lx0;
- y[0] -= ly0;
- y[0] *= k;
- y[1] *= k;
- y[2] *= k;
- y[3] *= k;
- }
- else
- {
- double k = dy / dx;
- x[0] -= lx0;
- y[0] -= ly0;
- x[0] *= k;
- x[1] *= k;
- x[2] *= k;
- x[3] *= k;
- }
- for (int i = 0; i < 4; i++)
- r[i] = y[i] - x[i];
-
- if ((nRoots = CubicCurve2D.solveCubic(r)) > 0)
- {
- Intersection[] temp = new Intersection[nRoots];
- int intersections = 0;
- for (int i = 0; i < nRoots; i++)
- {
- double t = r[i];
- if (t >= 0.0 && t <= 1.0)
- {
- // if the line is on an axis, snap the point to that axis.
- Point2D p = c.evaluatePoint(t);
- if (dx == 0)
- p.setLocation(lx0, p.getY());
- if (dy == 0)
- p.setLocation(p.getX(), ly0);
-
- if (p.getX() <= Math.max(lx0, lx1)
- && p.getX() >= Math.min(lx0, lx1)
- && p.getY() <= Math.max(ly0, ly1)
- && p.getY() >= Math.min(ly0, ly1))
- {
- double lineparameter = p.distance(l.P1) / l.P2.distance(l.P1);
- temp[i] = new Intersection(p, lineparameter, t);
- intersections++;
- }
- }
- else
- temp[i] = null;
- }
-
- if (intersections == 0)
- return null;
-
- Intersection[] rValues = new Intersection[intersections];
- for (int i = 0; i < nRoots; i++)
- if (temp[i] != null)
- rValues[--intersections] = temp[i];
- return (rValues);
- }
- return null;
- }
-
- /**
- * Returns the intersection between two lines, or null if there is no
- * intersection.
- * This is package-private to avoid an accessor method.
- */
- Intersection linesIntersect(LineSegment a, LineSegment b)
- {
- Point2D P1 = a.P1;
- Point2D P2 = a.P2;
- Point2D P3 = b.P1;
- Point2D P4 = b.P2;
-
- if (! Line2D.linesIntersect(P1.getX(), P1.getY(), P2.getX(), P2.getY(),
- P3.getX(), P3.getY(), P4.getX(), P4.getY()))
- return null;
-
- double x1 = P1.getX();
- double y1 = P1.getY();
- double rx = P2.getX() - x1;
- double ry = P2.getY() - y1;
-
- double x2 = P3.getX();
- double y2 = P3.getY();
- double sx = P4.getX() - x2;
- double sy = P4.getY() - y2;
-
- double determinant = sx * ry - sy * rx;
- double nom = (sx * (y2 - y1) + sy * (x1 - x2));
-
- // Parallel lines don't intersect. At least we pretend they don't.
- if (Math.abs(determinant) < EPSILON)
- return null;
-
- nom = nom / determinant;
-
- if (nom == 0.0)
- return null;
- if (nom == 1.0)
- return null;
-
- Point2D p = new Point2D.Double(x1 + nom * rx, y1 + nom * ry);
-
- return new Intersection(p, p.distance(P1) / P1.distance(P2),
- p.distance(P3) / P3.distance(P4));
- }
-
- /**
- * Determines if two points are equal, within an error margin
- * 'snap distance'
- * This is package-private to avoid an accessor method.
- */
- boolean pointEquals(Point2D a, Point2D b)
- {
- return (a.equals(b) || a.distance(b) < PE_EPSILON);
- }
-
- /**
- * Helper method
- * Turns a shape into a Vector of Segments
- */
- private Vector makeSegment(Shape s)
- {
- Vector paths = new Vector();
- PathIterator pi = s.getPathIterator(null);
- double[] coords = new double[6];
- Segment subpath = null;
- Segment current = null;
- double cx;
- double cy;
- double subpathx;
- double subpathy;
- cx = cy = subpathx = subpathy = 0.0;
-
- this.windingRule = pi.getWindingRule();
-
- while (! pi.isDone())
- {
- Segment v;
- switch (pi.currentSegment(coords))
- {
- case PathIterator.SEG_MOVETO:
- if (subpath != null)
- { // close existing open path
- current.next = new LineSegment(cx, cy, subpathx, subpathy);
- current = current.next;
- current.next = subpath;
- }
- subpath = null;
- subpathx = cx = coords[0];
- subpathy = cy = coords[1];
- break;
-
- // replace 'close' with a line-to.
- case PathIterator.SEG_CLOSE:
- if (subpath != null && (subpathx != cx || subpathy != cy))
- {
- current.next = new LineSegment(cx, cy, subpathx, subpathy);
- current = current.next;
- current.next = subpath;
- cx = subpathx;
- cy = subpathy;
- subpath = null;
- }
- else if (subpath != null)
- {
- current.next = subpath;
- subpath = null;
- }
- break;
- case PathIterator.SEG_LINETO:
- if (cx != coords[0] || cy != coords[1])
- {
- v = new LineSegment(cx, cy, coords[0], coords[1]);
- if (subpath == null)
- {
- subpath = current = v;
- paths.add(subpath);
- }
- else
- {
- current.next = v;
- current = current.next;
- }
- cx = coords[0];
- cy = coords[1];
- }
- break;
- case PathIterator.SEG_QUADTO:
- v = new QuadSegment(cx, cy, coords[0], coords[1], coords[2],
- coords[3]);
- if (subpath == null)
- {
- subpath = current = v;
- paths.add(subpath);
- }
- else
- {
- current.next = v;
- current = current.next;
- }
- cx = coords[2];
- cy = coords[3];
- break;
- case PathIterator.SEG_CUBICTO:
- v = new CubicSegment(cx, cy, coords[0], coords[1], coords[2],
- coords[3], coords[4], coords[5]);
- if (subpath == null)
- {
- subpath = current = v;
- paths.add(subpath);
- }
- else
- {
- current.next = v;
- current = current.next;
- }
-
- // check if the cubic is self-intersecting
- double[] lpts = ((CubicSegment) v).getLoop();
- if (lpts != null)
- {
- // if it is, break off the loop into its own path.
- v.subdivideInsert(lpts[0]);
- v.next.subdivideInsert((lpts[1] - lpts[0]) / (1.0 - lpts[0]));
-
- CubicSegment loop = (CubicSegment) v.next;
- v.next = loop.next;
- loop.next = loop;
-
- v.P2 = v.next.P1 = loop.P2 = loop.P1; // snap points
- paths.add(loop);
- current = v.next;
- }
-
- cx = coords[4];
- cy = coords[5];
- break;
- }
- pi.next();
- }
-
- if (subpath != null)
- { // close any open path
- if (subpathx != cx || subpathy != cy)
- {
- current.next = new LineSegment(cx, cy, subpathx, subpathy);
- current = current.next;
- current.next = subpath;
- }
- else
- current.next = subpath;
- }
-
- if (paths.size() == 0)
- return (null);
-
- return (paths);
- }
-
- /**
- * Find the intersections of two separate closed paths,
- * A and B, split the segments at the intersection points,
- * and create nodes pointing from one to the other
- */
- private int createNodes(Segment A, Segment B)
- {
- int nNodes = 0;
-
- Segment a = A;
- Segment b = B;
-
- do
- {
- do
- {
- nNodes += a.splitIntersections(b);
- b = b.next;
- }
- while (b != B);
-
- a = a.next; // move to the next segment
- }
- while (a != A); // until one wrap.
-
- return (nNodes);
- }
-
- /**
- * Find the intersections of a path with itself.
- * Splits the segments at the intersection points,
- * and create nodes pointing from one to the other.
- */
- private int createNodesSelf(Segment A)
- {
- int nNodes = 0;
- Segment a = A;
-
- if (A.next == A)
- return 0;
-
- do
- {
- Segment b = a.next;
- do
- {
- if (b != a) // necessary
- nNodes += a.splitIntersections(b);
- b = b.next;
- }
- while (b != A);
- a = a.next; // move to the next segment
- }
- while (a != A); // until one wrap.
-
- return (nNodes);
- }
-
- /**
- * Deletes paths which are redundant from a list, (i.e. solid areas within
- * solid areas) Clears any nodes. Sorts the remaining paths into solids
- * and holes, sets their orientation and sets the solids and holes lists.
- */
- private void deleteRedundantPaths(Vector paths)
- {
- int npaths = paths.size();
-
- int[][] contains = new int[npaths][npaths];
- int[][] windingNumbers = new int[npaths][2];
- int neg;
- Rectangle2D[] bb = new Rectangle2D[npaths]; // path bounding boxes
-
- neg = ((windingRule == PathIterator.WIND_NON_ZERO) ? -1 : 1);
-
- for (int i = 0; i < npaths; i++)
- bb[i] = ((Segment) paths.elementAt(i)).getPathBounds();
-
- // Find which path contains which, assign winding numbers
- for (int i = 0; i < npaths; i++)
- {
- Segment pathA = (Segment) paths.elementAt(i);
- pathA.nullNodes(); // remove any now-redundant nodes, in case.
- int windingA = pathA.hasClockwiseOrientation() ? 1 : neg;
-
- for (int j = 0; j < npaths; j++)
- if (i != j)
- {
- Segment pathB = (Segment) paths.elementAt(j);
-
- // A contains B
- if (bb[i].intersects(bb[j]))
- {
- Segment s = pathB.next;
- while (s.P1.getY() == s.P2.getY() && s != pathB)
- s = s.next;
- Point2D p = s.getMidPoint();
- if (pathA.contains(p.getX(), p.getY()))
- contains[i][j] = windingA;
- }
- else
- // A does not contain B
- contains[i][j] = 0;
- }
- else
- contains[i][j] = windingA; // i == j
- }
-
- for (int i = 0; i < npaths; i++)
- {
- windingNumbers[i][0] = 0;
- for (int j = 0; j < npaths; j++)
- windingNumbers[i][0] += contains[j][i];
- windingNumbers[i][1] = contains[i][i];
- }
-
- Vector solids = new Vector();
- Vector holes = new Vector();
-
- if (windingRule == PathIterator.WIND_NON_ZERO)
- {
- for (int i = 0; i < npaths; i++)
- {
- if (windingNumbers[i][0] == 0)
- holes.add(paths.elementAt(i));
- else if (windingNumbers[i][0] - windingNumbers[i][1] == 0
- && Math.abs(windingNumbers[i][0]) == 1)
- solids.add(paths.elementAt(i));
- }
- }
- else
- {
- windingRule = PathIterator.WIND_NON_ZERO;
- for (int i = 0; i < npaths; i++)
- {
- if ((windingNumbers[i][0] & 1) == 0)
- holes.add(paths.elementAt(i));
- else if ((windingNumbers[i][0] & 1) == 1)
- solids.add(paths.elementAt(i));
- }
- }
-
- setDirection(holes, false);
- setDirection(solids, true);
- this.holes = holes;
- this.solids = solids;
- }
-
- /**
- * Sets the winding direction of a Vector of paths
- * @param clockwise gives the direction,
- * true = clockwise, false = counter-clockwise
- */
- private void setDirection(Vector paths, boolean clockwise)
- {
- Segment v;
- for (int i = 0; i < paths.size(); i++)
- {
- v = (Segment) paths.elementAt(i);
- if (clockwise != v.hasClockwiseOrientation())
- v.reverseAll();
- }
- }
-
- /**
- * Class representing a linked-list of vertices forming a closed polygon,
- * convex or concave, without holes.
- */
- private abstract class Segment implements Cloneable
- {
- // segment type, PathIterator segment types are used.
- Point2D P1;
- Point2D P2;
- Segment next;
- Segment node;
-
- Segment()
- {
- P1 = P2 = null;
- node = next = null;
- }
-
- /**
- * Reverses the direction of a single segment
- */
- abstract void reverseCoords();
-
- /**
- * Returns the segment's midpoint
- */
- abstract Point2D getMidPoint();
-
- /**
- * Returns the bounding box of this segment
- */
- abstract Rectangle2D getBounds();
-
- /**
- * Transforms a single segment
- */
- abstract void transform(AffineTransform at);
-
- /**
- * Returns the PathIterator type of a segment
- */
- abstract int getType();
-
- /**
- */
- abstract int splitIntersections(Segment b);
-
- /**
- * Returns the PathIterator coords of a segment
- */
- abstract int pathIteratorFormat(double[] coords);
-
- /**
- * Returns the number of intersections on the positive X axis,
- * with the origin at (x,y), used for contains()-testing
- *
- * (Although that could be done by the line-intersect methods,
- * a dedicated method is better to guarantee consitent handling
- * of endpoint-special-cases)
- */
- abstract int rayCrossing(double x, double y);
-
- /**
- * Subdivides the segment at parametric value t, inserting
- * the new segment into the linked list after this,
- * such that this becomes [0,t] and this.next becomes [t,1]
- */
- abstract void subdivideInsert(double t);
-
- /**
- * Returns twice the area of a curve, relative the P1-P2 line
- * Used for area calculations.
- */
- abstract double curveArea();
-
- /**
- * Compare two segments.
- */
- abstract boolean equals(Segment b);
-
- /**
- * Determines if this path of segments contains the point (x,y)
- */
- boolean contains(double x, double y)
- {
- Segment v = this;
- int crossings = 0;
- do
- {
- int n = v.rayCrossing(x, y);
- crossings += n;
- v = v.next;
- }
- while (v != this);
- return ((crossings & 1) == 1);
- }
-
- /**
- * Nulls all nodes of the path. Clean up any 'hairs'.
- */
- void nullNodes()
- {
- Segment v = this;
- do
- {
- v.node = null;
- v = v.next;
- }
- while (v != this);
- }
-
- /**
- * Transforms each segment in the closed path
- */
- void transformSegmentList(AffineTransform at)
- {
- Segment v = this;
- do
- {
- v.transform(at);
- v = v.next;
- }
- while (v != this);
- }
-
- /**
- * Determines the winding direction of the path
- * By the sign of the area.
- */
- boolean hasClockwiseOrientation()
- {
- return (getSignedArea() > 0.0);
- }
-
- /**
- * Returns the bounds of this path
- */
- public Rectangle2D getPathBounds()
- {
- double xmin;
- double xmax;
- double ymin;
- double ymax;
- xmin = xmax = P1.getX();
- ymin = ymax = P1.getY();
-
- Segment v = this;
- do
- {
- Rectangle2D r = v.getBounds();
- xmin = Math.min(r.getMinX(), xmin);
- ymin = Math.min(r.getMinY(), ymin);
- xmax = Math.max(r.getMaxX(), xmax);
- ymax = Math.max(r.getMaxY(), ymax);
- v = v.next;
- }
- while (v != this);
-
- return (new Rectangle2D.Double(xmin, ymin, (xmax - xmin), (ymax - ymin)));
- }
-
- /**
- * Calculates twice the signed area of the path;
- */
- double getSignedArea()
- {
- Segment s;
- double area = 0.0;
-
- s = this;
- do
- {
- area += s.curveArea();
-
- area += s.P1.getX() * s.next.P1.getY()
- - s.P1.getY() * s.next.P1.getX();
- s = s.next;
- }
- while (s != this);
-
- return area;
- }
-
- /**
- * Reverses the orientation of the whole polygon
- */
- void reverseAll()
- {
- reverseCoords();
- Segment v = next;
- Segment former = this;
- while (v != this)
- {
- v.reverseCoords();
- Segment vnext = v.next;
- v.next = former;
- former = v;
- v = vnext;
- }
- next = former;
- }
-
- /**
- * Inserts a Segment after this one
- */
- void insert(Segment v)
- {
- Segment n = next;
- next = v;
- v.next = n;
- }
-
- /**
- * Returns if this segment path is polygonal
- */
- boolean isPolygonal()
- {
- Segment v = this;
- do
- {
- if (! (v instanceof LineSegment))
- return false;
- v = v.next;
- }
- while (v != this);
- return true;
- }
-
- /**
- * Clones this path
- */
- Segment cloneSegmentList() throws CloneNotSupportedException
- {
- Vector list = new Vector();
- Segment v = next;
-
- while (v != this)
- {
- list.add(v);
- v = v.next;
- }
-
- Segment clone = (Segment) this.clone();
- v = clone;
- for (int i = 0; i < list.size(); i++)
- {
- clone.next = (Segment) ((Segment) list.elementAt(i)).clone();
- clone = clone.next;
- }
- clone.next = v;
- return v;
- }
-
- /**
- * Creates a node between this segment and segment b
- * at the given intersection
- * @return the number of nodes created (0 or 1)
- */
- int createNode(Segment b, Intersection i)
- {
- Point2D p = i.p;
- if ((pointEquals(P1, p) || pointEquals(P2, p))
- && (pointEquals(b.P1, p) || pointEquals(b.P2, p)))
- return 0;
-
- subdivideInsert(i.ta);
- b.subdivideInsert(i.tb);
-
- // snap points
- b.P2 = b.next.P1 = P2 = next.P1 = i.p;
-
- node = b.next;
- b.node = next;
- return 1;
- }
-
- /**
- * Creates multiple nodes from a list of intersections,
- * This must be done in the order of ascending parameters,
- * and the parameters must be recalculated in accordance
- * with each split.
- * @return the number of nodes created
- */
- protected int createNodes(Segment b, Intersection[] x)
- {
- Vector v = new Vector();
- for (int i = 0; i < x.length; i++)
- {
- Point2D p = x[i].p;
- if (! ((pointEquals(P1, p) || pointEquals(P2, p))
- && (pointEquals(b.P1, p) || pointEquals(b.P2, p))))
- v.add(x[i]);
- }
-
- int nNodes = v.size();
- Intersection[] A = new Intersection[nNodes];
- Intersection[] B = new Intersection[nNodes];
- for (int i = 0; i < nNodes; i++)
- A[i] = B[i] = (Intersection) v.elementAt(i);
-
- // Create two lists sorted by the parameter
- // Bubble sort, OK I suppose, since the number of intersections
- // cannot be larger than 9 (cubic-cubic worst case) anyway
- for (int i = 0; i < nNodes - 1; i++)
- {
- for (int j = i + 1; j < nNodes; j++)
- {
- if (A[i].ta > A[j].ta)
- {
- Intersection swap = A[i];
- A[i] = A[j];
- A[j] = swap;
- }
- if (B[i].tb > B[j].tb)
- {
- Intersection swap = B[i];
- B[i] = B[j];
- B[j] = swap;
- }
- }
- }
- // subdivide a
- Segment s = this;
- for (int i = 0; i < nNodes; i++)
- {
- s.subdivideInsert(A[i].ta);
-
- // renormalize the parameters
- for (int j = i + 1; j < nNodes; j++)
- A[j].ta = (A[j].ta - A[i].ta) / (1.0 - A[i].ta);
-
- A[i].seg = s;
- s = s.next;
- }
-
- // subdivide b, set nodes
- s = b;
- for (int i = 0; i < nNodes; i++)
- {
- s.subdivideInsert(B[i].tb);
-
- for (int j = i + 1; j < nNodes; j++)
- B[j].tb = (B[j].tb - B[i].tb) / (1.0 - B[i].tb);
-
- // set nodes
- B[i].seg.node = s.next; // node a -> b
- s.node = B[i].seg.next; // node b -> a
-
- // snap points
- B[i].seg.P2 = B[i].seg.next.P1 = s.P2 = s.next.P1 = B[i].p;
- s = s.next;
- }
- return nNodes;
- }
-
- /**
- * Determines if two paths are equal.
- * Colinear line segments are ignored in the comparison.
- */
- boolean pathEquals(Segment B)
- {
- if (! getPathBounds().equals(B.getPathBounds()))
- return false;
-
- Segment startA = getTopLeft();
- Segment startB = B.getTopLeft();
- Segment a = startA;
- Segment b = startB;
- do
- {
- if (! a.equals(b))
- return false;
-
- if (a instanceof LineSegment)
- a = ((LineSegment) a).lastCoLinear();
- if (b instanceof LineSegment)
- b = ((LineSegment) b).lastCoLinear();
-
- a = a.next;
- b = b.next;
- }
- while (a != startA && b != startB);
- return true;
- }
-
- /**
- * Return the segment with the top-leftmost first point
- */
- Segment getTopLeft()
- {
- Segment v = this;
- Segment tl = this;
- do
- {
- if (v.P1.getY() < tl.P1.getY())
- tl = v;
- else if (v.P1.getY() == tl.P1.getY())
- {
- if (v.P1.getX() < tl.P1.getX())
- tl = v;
- }
- v = v.next;
- }
- while (v != this);
- return tl;
- }
-
- /**
- * Returns if the path has a segment outside a shape
- */
- boolean isSegmentOutside(Shape shape)
- {
- return ! shape.contains(getMidPoint());
- }
- } // class Segment
-
- private class LineSegment extends Segment
- {
- public LineSegment(double x1, double y1, double x2, double y2)
- {
- super();
- P1 = new Point2D.Double(x1, y1);
- P2 = new Point2D.Double(x2, y2);
- }
-
- public LineSegment(Point2D p1, Point2D p2)
- {
- super();
- P1 = (Point2D) p1.clone();
- P2 = (Point2D) p2.clone();
- }
-
- /**
- * Clones this segment
- */
- public Object clone()
- {
- return new LineSegment(P1, P2);
- }
-
- /**
- * Transforms the segment
- */
- void transform(AffineTransform at)
- {
- P1 = at.transform(P1, null);
- P2 = at.transform(P2, null);
- }
-
- /**
- * Swap start and end points
- */
- void reverseCoords()
- {
- Point2D p = P1;
- P1 = P2;
- P2 = p;
- }
-
- /**
- * Returns the segment's midpoint
- */
- Point2D getMidPoint()
- {
- return (new Point2D.Double(0.5 * (P1.getX() + P2.getX()),
- 0.5 * (P1.getY() + P2.getY())));
- }
-
- /**
- * Returns twice the area of a curve, relative the P1-P2 line
- * Obviously, a line does not enclose any area besides the line
- */
- double curveArea()
- {
- return 0;
- }
-
- /**
- * Returns the PathIterator type of a segment
- */
- int getType()
- {
- return (PathIterator.SEG_LINETO);
- }
-
- /**
- * Subdivides the segment at parametric value t, inserting
- * the new segment into the linked list after this,
- * such that this becomes [0,t] and this.next becomes [t,1]
- */
- void subdivideInsert(double t)
- {
- Point2D p = new Point2D.Double((P2.getX() - P1.getX()) * t + P1.getX(),
- (P2.getY() - P1.getY()) * t + P1.getY());
- insert(new LineSegment(p, P2));
- P2 = p;
- next.node = node;
- node = null;
- }
-
- /**
- * Determines if two line segments are strictly colinear
- */
- boolean isCoLinear(LineSegment b)
- {
- double x1 = P1.getX();
- double y1 = P1.getY();
- double x2 = P2.getX();
- double y2 = P2.getY();
- double x3 = b.P1.getX();
- double y3 = b.P1.getY();
- double x4 = b.P2.getX();
- double y4 = b.P2.getY();
-
- if ((y1 - y3) * (x4 - x3) - (x1 - x3) * (y4 - y3) != 0.0)
- return false;
-
- return ((x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3) == 0.0);
- }
-
- /**
- * Return the last segment colinear with this one.
- * Used in comparing paths.
- */
- Segment lastCoLinear()
- {
- Segment prev = this;
- Segment v = next;
-
- while (v instanceof LineSegment)
- {
- if (isCoLinear((LineSegment) v))
- {
- prev = v;
- v = v.next;
- }
- else
- return prev;
- }
- return prev;
- }
-
- /**
- * Compare two segments.
- * We must take into account that the lines may be broken into colinear
- * subsegments and ignore them.
- */
- boolean equals(Segment b)
- {
- if (! (b instanceof LineSegment))
- return false;
- Point2D p1 = P1;
- Point2D p3 = b.P1;
-
- if (! p1.equals(p3))
- return false;
-
- Point2D p2 = lastCoLinear().P2;
- Point2D p4 = ((LineSegment) b).lastCoLinear().P2;
- return (p2.equals(p4));
- }
-
- /**
- * Returns a line segment
- */
- int pathIteratorFormat(double[] coords)
- {
- coords[0] = P2.getX();
- coords[1] = P2.getY();
- return (PathIterator.SEG_LINETO);
- }
-
- /**
- * Returns if the line has intersections.
- */
- boolean hasIntersections(Segment b)
- {
- if (b instanceof LineSegment)
- return (linesIntersect(this, (LineSegment) b) != null);
-
- if (b instanceof QuadSegment)
- return (lineQuadIntersect(this, (QuadSegment) b) != null);
-
- if (b instanceof CubicSegment)
- return (lineCubicIntersect(this, (CubicSegment) b) != null);
-
- return false;
- }
-
- /**
- * Splits intersections into nodes,
- * This one handles line-line, line-quadratic, line-cubic
- */
- int splitIntersections(Segment b)
- {
- if (b instanceof LineSegment)
- {
- Intersection i = linesIntersect(this, (LineSegment) b);
-
- if (i == null)
- return 0;
-
- return createNode(b, i);
- }
-
- Intersection[] x = null;
-
- if (b instanceof QuadSegment)
- x = lineQuadIntersect(this, (QuadSegment) b);
-
- if (b instanceof CubicSegment)
- x = lineCubicIntersect(this, (CubicSegment) b);
-
- if (x == null)
- return 0;
-
- if (x.length == 1)
- return createNode(b, (Intersection) x[0]);
-
- return createNodes(b, x);
- }
-
- /**
- * Returns the bounding box of this segment
- */
- Rectangle2D getBounds()
- {
- return (new Rectangle2D.Double(Math.min(P1.getX(), P2.getX()),
- Math.min(P1.getY(), P2.getY()),
- Math.abs(P1.getX() - P2.getX()),
- Math.abs(P1.getY() - P2.getY())));
- }
-
- /**
- * Returns the number of intersections on the positive X axis,
- * with the origin at (x,y), used for contains()-testing
- */
- int rayCrossing(double x, double y)
- {
- double x0 = P1.getX() - x;
- double y0 = P1.getY() - y;
- double x1 = P2.getX() - x;
- double y1 = P2.getY() - y;
-
- if (y0 * y1 > 0)
- return 0;
-
- if (x0 < 0 && x1 < 0)
- return 0;
-
- if (y0 == 0.0)
- y0 -= EPSILON;
-
- if (y1 == 0.0)
- y1 -= EPSILON;
-
- if (Line2D.linesIntersect(x0, y0, x1, y1,
- EPSILON, 0.0, Double.MAX_VALUE, 0.0))
- return 1;
- return 0;
- }
- } // class LineSegment
-
- /**
- * Quadratic Bezier curve segment
- *
- * Note: Most peers don't support quadratics directly, so it might make
- * sense to represent them as cubics internally and just be done with it.
- * I think we should be peer-agnostic, however, and stay faithful to the
- * input geometry types as far as possible.
- */
- private class QuadSegment extends Segment
- {
- Point2D cp; // control point
-
- /**
- * Constructor, takes the coordinates of the start, control,
- * and end point, respectively.
- */
- QuadSegment(double x1, double y1, double cx, double cy, double x2,
- double y2)
- {
- super();
- P1 = new Point2D.Double(x1, y1);
- P2 = new Point2D.Double(x2, y2);
- cp = new Point2D.Double(cx, cy);
- }
-
- /**
- * Clones this segment
- */
- public Object clone()
- {
- return new QuadSegment(P1.getX(), P1.getY(), cp.getX(), cp.getY(),
- P2.getX(), P2.getY());
- }
-
- /**
- * Returns twice the area of a curve, relative the P1-P2 line
- *
- * The area formula can be derived by using Green's formula in the
- * plane on the parametric form of the bezier.
- */
- double curveArea()
- {
- double x0 = P1.getX();
- double y0 = P1.getY();
- double x1 = cp.getX();
- double y1 = cp.getY();
- double x2 = P2.getX();
- double y2 = P2.getY();
-
- double P = (y2 - 2 * y1 + y0);
- double Q = 2 * (y1 - y0);
-
- double A = (x2 - 2 * x1 + x0);
- double B = 2 * (x1 - x0);
-
- double area = (B * P - A * Q) / 3.0;
- return (area);
- }
-
- /**
- * Compare two segments.
- */
- boolean equals(Segment b)
- {
- if (! (b instanceof QuadSegment))
- return false;
-
- return (P1.equals(b.P1) && cp.equals(((QuadSegment) b).cp)
- && P2.equals(b.P2));
- }
-
- /**
- * Returns a Point2D corresponding to the parametric value t
- * of the curve
- */
- Point2D evaluatePoint(double t)
- {
- double x0 = P1.getX();
- double y0 = P1.getY();
- double x1 = cp.getX();
- double y1 = cp.getY();
- double x2 = P2.getX();
- double y2 = P2.getY();
-
- return new Point2D.Double(t * t * (x2 - 2 * x1 + x0) + 2 * t * (x1 - x0)
- + x0,
- t * t * (y2 - 2 * y1 + y0) + 2 * t * (y1 - y0)
- + y0);
- }
-
- /**
- * Returns the bounding box of this segment
- */
- Rectangle2D getBounds()
- {
- double x0 = P1.getX();
- double y0 = P1.getY();
- double x1 = cp.getX();
- double y1 = cp.getY();
- double x2 = P2.getX();
- double y2 = P2.getY();
- double r0;
- double r1;
-
- double xmax = Math.max(x0, x2);
- double ymax = Math.max(y0, y2);
- double xmin = Math.min(x0, x2);
- double ymin = Math.min(y0, y2);
-
- r0 = 2 * (y1 - y0);
- r1 = 2 * (y2 - 2 * y1 + y0);
- if (r1 != 0.0)
- {
- double t = -r0 / r1;
- if (t > 0.0 && t < 1.0)
- {
- double y = evaluatePoint(t).getY();
- ymax = Math.max(y, ymax);
- ymin = Math.min(y, ymin);
- }
- }
- r0 = 2 * (x1 - x0);
- r1 = 2 * (x2 - 2 * x1 + x0);
- if (r1 != 0.0)
- {
- double t = -r0 / r1;
- if (t > 0.0 && t < 1.0)
- {
- double x = evaluatePoint(t).getY();
- xmax = Math.max(x, xmax);
- xmin = Math.min(x, xmin);
- }
- }
-
- return (new Rectangle2D.Double(xmin, ymin, xmax - xmin, ymax - ymin));
- }
-
- /**
- * Returns a cubic segment corresponding to this curve
- */
- CubicSegment getCubicSegment()
- {
- double x1 = P1.getX() + 2.0 * (cp.getX() - P1.getX()) / 3.0;
- double y1 = P1.getY() + 2.0 * (cp.getY() - P1.getY()) / 3.0;
- double x2 = cp.getX() + (P2.getX() - cp.getX()) / 3.0;
- double y2 = cp.getY() + (P2.getY() - cp.getY()) / 3.0;
-
- return new CubicSegment(P1.getX(), P1.getY(), x1, y1, x2, y2, P2.getX(),
- P2.getY());
- }
-
- /**
- * Returns the segment's midpoint
- */
- Point2D getMidPoint()
- {
- return evaluatePoint(0.5);
- }
-
- /**
- * Returns the PathIterator type of a segment
- */
- int getType()
- {
- return (PathIterator.SEG_QUADTO);
- }
-
- /**
- * Returns the PathIterator coords of a segment
- */
- int pathIteratorFormat(double[] coords)
- {
- coords[0] = cp.getX();
- coords[1] = cp.getY();
- coords[2] = P2.getX();
- coords[3] = P2.getY();
- return (PathIterator.SEG_QUADTO);
- }
-
- /**
- * Returns the number of intersections on the positive X axis,
- * with the origin at (x,y), used for contains()-testing
- */
- int rayCrossing(double x, double y)
- {
- double x0 = P1.getX() - x;
- double y0 = P1.getY() - y;
- double x1 = cp.getX() - x;
- double y1 = cp.getY() - y;
- double x2 = P2.getX() - x;
- double y2 = P2.getY() - y;
- double[] r = new double[3];
- int nRoots;
- int nCrossings = 0;
-
- /* check if curve may intersect X+ axis. */
- if ((x0 > 0.0 || x1 > 0.0 || x2 > 0.0) && (y0 * y1 <= 0 || y1 * y2 <= 0))
- {
- if (y0 == 0.0)
- y0 -= EPSILON;
- if (y2 == 0.0)
- y2 -= EPSILON;
-
- r[0] = y0;
- r[1] = 2 * (y1 - y0);
- r[2] = (y2 - 2 * y1 + y0);
-
- nRoots = QuadCurve2D.solveQuadratic(r);
- for (int i = 0; i < nRoots; i++)
- if (r[i] > 0.0f && r[i] < 1.0f)
- {
- double t = r[i];
- if (t * t * (x2 - 2 * x1 + x0) + 2 * t * (x1 - x0) + x0 > 0.0)
- nCrossings++;
- }
- }
- return nCrossings;
- }
-
- /**
- * Swap start and end points
- */
- void reverseCoords()
- {
- Point2D temp = P1;
- P1 = P2;
- P2 = temp;
- }
-
- /**
- * Splits intersections into nodes,
- * This one handles quadratic-quadratic only,
- * Quadratic-line is passed on to the LineSegment class,
- * Quadratic-cubic is passed on to the CubicSegment class
- */
- int splitIntersections(Segment b)
- {
- if (b instanceof LineSegment)
- return (b.splitIntersections(this));
-
- if (b instanceof CubicSegment)
- return (b.splitIntersections(this));
-
- if (b instanceof QuadSegment)
- {
- // Use the cubic-cubic intersection routine for quads as well,
- // Since a quadratic can be exactly described as a cubic, this
- // should not be a problem;
- // The recursion depth will be the same in any case.
- Intersection[] x = cubicCubicIntersect(getCubicSegment(),
- ((QuadSegment) b)
- .getCubicSegment());
- if (x == null)
- return 0;
-
- if (x.length == 1)
- return createNode(b, (Intersection) x[0]);
-
- return createNodes(b, x);
- }
- return 0;
- }
-
- /**
- * Subdivides the segment at parametric value t, inserting
- * the new segment into the linked list after this,
- * such that this becomes [0,t] and this.next becomes [t,1]
- */
- void subdivideInsert(double t)
- {
- double x0 = P1.getX();
- double y0 = P1.getY();
- double x1 = cp.getX();
- double y1 = cp.getY();
- double x2 = P2.getX();
- double y2 = P2.getY();
-
- double p10x = x0 + t * (x1 - x0);
- double p10y = y0 + t * (y1 - y0);
- double p11x = x1 + t * (x2 - x1);
- double p11y = y1 + t * (y2 - y1);
- double p20x = p10x + t * (p11x - p10x);
- double p20y = p10y + t * (p11y - p10y);
-
- insert(new QuadSegment(p20x, p20y, p11x, p11y, x2, y2));
- P2 = next.P1;
- cp.setLocation(p10x, p10y);
-
- next.node = node;
- node = null;
- }
-
- /**
- * Transforms the segment
- */
- void transform(AffineTransform at)
- {
- P1 = at.transform(P1, null);
- P2 = at.transform(P2, null);
- cp = at.transform(cp, null);
- }
- } // class QuadSegment
-
- /**
- * Cubic Bezier curve segment
- */
- private class CubicSegment extends Segment
- {
- Point2D cp1; // control points
- Point2D cp2; // control points
-
- /**
- * Constructor - takes coordinates of the starting point,
- * first control point, second control point and end point,
- * respecively.
- */
- public CubicSegment(double x1, double y1, double c1x, double c1y,
- double c2x, double c2y, double x2, double y2)
- {
- super();
- P1 = new Point2D.Double(x1, y1);
- P2 = new Point2D.Double(x2, y2);
- cp1 = new Point2D.Double(c1x, c1y);
- cp2 = new Point2D.Double(c2x, c2y);
- }
-
- /**
- * Clones this segment
- */
- public Object clone()
- {
- return new CubicSegment(P1.getX(), P1.getY(), cp1.getX(), cp1.getY(),
- cp2.getX(), cp2.getY(), P2.getX(), P2.getY());
- }
-
- /**
- * Returns twice the area of a curve, relative the P1-P2 line
- *
- * The area formula can be derived by using Green's formula in the
- * plane on the parametric form of the bezier.
- */
- double curveArea()
- {
- double x0 = P1.getX();
- double y0 = P1.getY();
- double x1 = cp1.getX();
- double y1 = cp1.getY();
- double x2 = cp2.getX();
- double y2 = cp2.getY();
- double x3 = P2.getX();
- double y3 = P2.getY();
-
- double P = y3 - 3 * y2 + 3 * y1 - y0;
- double Q = 3 * (y2 + y0 - 2 * y1);
- double R = 3 * (y1 - y0);
-
- double A = x3 - 3 * x2 + 3 * x1 - x0;
- double B = 3 * (x2 + x0 - 2 * x1);
- double C = 3 * (x1 - x0);
-
- double area = (B * P - A * Q) / 5.0 + (C * P - A * R) / 2.0
- + (C * Q - B * R) / 3.0;
-
- return (area);
- }
-
- /**
- * Compare two segments.
- */
- boolean equals(Segment b)
- {
- if (! (b instanceof CubicSegment))
- return false;
-
- return (P1.equals(b.P1) && cp1.equals(((CubicSegment) b).cp1)
- && cp2.equals(((CubicSegment) b).cp2) && P2.equals(b.P2));
- }
-
- /**
- * Returns a Point2D corresponding to the parametric value t
- * of the curve
- */
- Point2D evaluatePoint(double t)
- {
- double x0 = P1.getX();
- double y0 = P1.getY();
- double x1 = cp1.getX();
- double y1 = cp1.getY();
- double x2 = cp2.getX();
- double y2 = cp2.getY();
- double x3 = P2.getX();
- double y3 = P2.getY();
-
- return new Point2D.Double(-(t * t * t) * (x0 - 3 * x1 + 3 * x2 - x3)
- + 3 * t * t * (x0 - 2 * x1 + x2)
- + 3 * t * (x1 - x0) + x0,
- -(t * t * t) * (y0 - 3 * y1 + 3 * y2 - y3)
- + 3 * t * t * (y0 - 2 * y1 + y2)
- + 3 * t * (y1 - y0) + y0);
- }
-
- /**
- * Returns the bounding box of this segment
- */
- Rectangle2D getBounds()
- {
- double x0 = P1.getX();
- double y0 = P1.getY();
- double x1 = cp1.getX();
- double y1 = cp1.getY();
- double x2 = cp2.getX();
- double y2 = cp2.getY();
- double x3 = P2.getX();
- double y3 = P2.getY();
- double[] r = new double[3];
-
- double xmax = Math.max(x0, x3);
- double ymax = Math.max(y0, y3);
- double xmin = Math.min(x0, x3);
- double ymin = Math.min(y0, y3);
-
- r[0] = 3 * (y1 - y0);
- r[1] = 6.0 * (y2 + y0 - 2 * y1);
- r[2] = 3.0 * (y3 - 3 * y2 + 3 * y1 - y0);
-
- int n = QuadCurve2D.solveQuadratic(r);
- for (int i = 0; i < n; i++)
- {
- double t = r[i];
- if (t > 0 && t < 1.0)
- {
- double y = evaluatePoint(t).getY();
- ymax = Math.max(y, ymax);
- ymin = Math.min(y, ymin);
- }
- }
-
- r[0] = 3 * (x1 - x0);
- r[1] = 6.0 * (x2 + x0 - 2 * x1);
- r[2] = 3.0 * (x3 - 3 * x2 + 3 * x1 - x0);
- n = QuadCurve2D.solveQuadratic(r);
- for (int i = 0; i < n; i++)
- {
- double t = r[i];
- if (t > 0 && t < 1.0)
- {
- double x = evaluatePoint(t).getX();
- xmax = Math.max(x, xmax);
- xmin = Math.min(x, xmin);
- }
- }
- return (new Rectangle2D.Double(xmin, ymin, (xmax - xmin), (ymax - ymin)));
- }
-
- /**
- * Returns a CubicCurve2D object corresponding to this segment.
- */
- CubicCurve2D getCubicCurve2D()
- {
- return new CubicCurve2D.Double(P1.getX(), P1.getY(), cp1.getX(),
- cp1.getY(), cp2.getX(), cp2.getY(),
- P2.getX(), P2.getY());
- }
-
- /**
- * Returns the parametric points of self-intersection if the cubic
- * is self-intersecting, null otherwise.
- */
- double[] getLoop()
- {
- double x0 = P1.getX();
- double y0 = P1.getY();
- double x1 = cp1.getX();
- double y1 = cp1.getY();
- double x2 = cp2.getX();
- double y2 = cp2.getY();
- double x3 = P2.getX();
- double y3 = P2.getY();
- double[] r = new double[4];
- double k;
- double R;
- double T;
- double A;
- double B;
- double[] results = new double[2];
-
- R = x3 - 3 * x2 + 3 * x1 - x0;
- T = y3 - 3 * y2 + 3 * y1 - y0;
-
- // A qudratic
- if (R == 0.0 && T == 0.0)
- return null;
-
- // true cubic
- if (R != 0.0 && T != 0.0)
- {
- A = 3 * (x2 + x0 - 2 * x1) / R;
- B = 3 * (x1 - x0) / R;
-
- double P = 3 * (y2 + y0 - 2 * y1) / T;
- double Q = 3 * (y1 - y0) / T;
-
- if (A == P || Q == B)
- return null;
-
- k = (Q - B) / (A - P);
- }
- else
- {
- if (R == 0.0)
- {
- // quadratic in x
- k = -(3 * (x1 - x0)) / (3 * (x2 + x0 - 2 * x1));
- A = 3 * (y2 + y0 - 2 * y1) / T;
- B = 3 * (y1 - y0) / T;
- }
- else
- {
- // quadratic in y
- k = -(3 * (y1 - y0)) / (3 * (y2 + y0 - 2 * y1));
- A = 3 * (x2 + x0 - 2 * x1) / R;
- B = 3 * (x1 - x0) / R;
- }
- }
-
- r[0] = -k * k * k - A * k * k - B * k;
- r[1] = 3 * k * k + 2 * k * A + 2 * B;
- r[2] = -3 * k;
- r[3] = 2;
-
- int n = CubicCurve2D.solveCubic(r);
- if (n != 3)
- return null;
-
- // sort r
- double t;
- for (int i = 0; i < 2; i++)
- for (int j = i + 1; j < 3; j++)
- if (r[j] < r[i])
- {
- t = r[i];
- r[i] = r[j];
- r[j] = t;
- }
-
- if (Math.abs(r[0] + r[2] - k) < 1E-13)
- if (r[0] >= 0.0 && r[0] <= 1.0 && r[2] >= 0.0 && r[2] <= 1.0)
- if (evaluatePoint(r[0]).distance(evaluatePoint(r[2])) < PE_EPSILON * 10)
- { // we snap the points anyway
- results[0] = r[0];
- results[1] = r[2];
- return (results);
- }
- return null;
- }
-
- /**
- * Returns the segment's midpoint
- */
- Point2D getMidPoint()
- {
- return evaluatePoint(0.5);
- }
-
- /**
- * Returns the PathIterator type of a segment
- */
- int getType()
- {
- return (PathIterator.SEG_CUBICTO);
- }
-
- /**
- * Returns the PathIterator coords of a segment
- */
- int pathIteratorFormat(double[] coords)
- {
- coords[0] = cp1.getX();
- coords[1] = cp1.getY();
- coords[2] = cp2.getX();
- coords[3] = cp2.getY();
- coords[4] = P2.getX();
- coords[5] = P2.getY();
- return (PathIterator.SEG_CUBICTO);
- }
-
- /**
- * Returns the number of intersections on the positive X axis,
- * with the origin at (x,y), used for contains()-testing
- */
- int rayCrossing(double x, double y)
- {
- double x0 = P1.getX() - x;
- double y0 = P1.getY() - y;
- double x1 = cp1.getX() - x;
- double y1 = cp1.getY() - y;
- double x2 = cp2.getX() - x;
- double y2 = cp2.getY() - y;
- double x3 = P2.getX() - x;
- double y3 = P2.getY() - y;
- double[] r = new double[4];
- int nRoots;
- int nCrossings = 0;
-
- /* check if curve may intersect X+ axis. */
- if ((x0 > 0.0 || x1 > 0.0 || x2 > 0.0 || x3 > 0.0)
- && (y0 * y1 <= 0 || y1 * y2 <= 0 || y2 * y3 <= 0))
- {
- if (y0 == 0.0)
- y0 -= EPSILON;
- if (y3 == 0.0)
- y3 -= EPSILON;
-
- r[0] = y0;
- r[1] = 3 * (y1 - y0);
- r[2] = 3 * (y2 + y0 - 2 * y1);
- r[3] = y3 - 3 * y2 + 3 * y1 - y0;
-
- if ((nRoots = CubicCurve2D.solveCubic(r)) > 0)
- for (int i = 0; i < nRoots; i++)
- {
- if (r[i] > 0.0 && r[i] < 1.0)
- {
- double t = r[i];
- if (-(t * t * t) * (x0 - 3 * x1 + 3 * x2 - x3)
- + 3 * t * t * (x0 - 2 * x1 + x2) + 3 * t * (x1 - x0)
- + x0 > 0.0)
- nCrossings++;
- }
- }
- }
- return nCrossings;
- }
-
- /**
- * Swap start and end points
- */
- void reverseCoords()
- {
- Point2D p = P1;
- P1 = P2;
- P2 = p;
- p = cp1; // swap control points
- cp1 = cp2;
- cp2 = p;
- }
-
- /**
- * Splits intersections into nodes,
- * This one handles cubic-cubic and cubic-quadratic intersections
- */
- int splitIntersections(Segment b)
- {
- if (b instanceof LineSegment)
- return (b.splitIntersections(this));
-
- Intersection[] x = null;
-
- if (b instanceof QuadSegment)
- x = cubicCubicIntersect(this, ((QuadSegment) b).getCubicSegment());
-
- if (b instanceof CubicSegment)
- x = cubicCubicIntersect(this, (CubicSegment) b);
-
- if (x == null)
- return 0;
-
- if (x.length == 1)
- return createNode(b, x[0]);
-
- return createNodes(b, x);
- }
-
- /**
- * Subdivides the segment at parametric value t, inserting
- * the new segment into the linked list after this,
- * such that this becomes [0,t] and this.next becomes [t,1]
- */
- void subdivideInsert(double t)
- {
- CubicSegment s = (CubicSegment) clone();
- double p1x = (s.cp1.getX() - s.P1.getX()) * t + s.P1.getX();
- double p1y = (s.cp1.getY() - s.P1.getY()) * t + s.P1.getY();
-
- double px = (s.cp2.getX() - s.cp1.getX()) * t + s.cp1.getX();
- double py = (s.cp2.getY() - s.cp1.getY()) * t + s.cp1.getY();
-
- s.cp2.setLocation((s.P2.getX() - s.cp2.getX()) * t + s.cp2.getX(),
- (s.P2.getY() - s.cp2.getY()) * t + s.cp2.getY());
-
- s.cp1.setLocation((s.cp2.getX() - px) * t + px,
- (s.cp2.getY() - py) * t + py);
-
- double p2x = (px - p1x) * t + p1x;
- double p2y = (py - p1y) * t + p1y;
-
- double p3x = (s.cp1.getX() - p2x) * t + p2x;
- double p3y = (s.cp1.getY() - p2y) * t + p2y;
- s.P1.setLocation(p3x, p3y);
-
- // insert new curve
- insert(s);
-
- // set this curve
- cp1.setLocation(p1x, p1y);
- cp2.setLocation(p2x, p2y);
- P2 = s.P1;
- next.node = node;
- node = null;
- }
-
- /**
- * Transforms the segment
- */
- void transform(AffineTransform at)
- {
- P1 = at.transform(P1, null);
- P2 = at.transform(P2, null);
- cp1 = at.transform(cp1, null);
- cp2 = at.transform(cp2, null);
- }
- } // class CubicSegment
-} // class Area
diff --git a/libjava/java/awt/geom/CubicCurve2D.java b/libjava/java/awt/geom/CubicCurve2D.java
deleted file mode 100644
index 50c381194bb..00000000000
--- a/libjava/java/awt/geom/CubicCurve2D.java
+++ /dev/null
@@ -1,1724 +0,0 @@
-/* CubicCurve2D.java -- represents a parameterized cubic curve in 2-D space
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.util.NoSuchElementException;
-
-
-/**
- * A two-dimensional curve that is parameterized with a cubic
- * function.
- *
- * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a CubicCurve2D" />
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @author Graydon Hoare (graydon@redhat.com)
- * @author Sascha Brawer (brawer@dandelis.ch)
- * @author Sven de Marothy (sven@physto.se)
- *
- * @since 1.2
- */
-public abstract class CubicCurve2D implements Shape, Cloneable
-{
- private static final double BIG_VALUE = java.lang.Double.MAX_VALUE / 10.0;
- private static final double EPSILON = 1E-10;
-
- /**
- * Constructs a new CubicCurve2D. Typical users will want to
- * construct instances of a subclass, such as {@link
- * CubicCurve2D.Float} or {@link CubicCurve2D.Double}.
- */
- protected CubicCurve2D()
- {
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public abstract double getX1();
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public abstract double getY1();
-
- /**
- * Returns the curve&#x2019;s start point.
- */
- public abstract Point2D getP1();
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s first
- * control point.
- */
- public abstract double getCtrlX1();
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s first
- * control point.
- */
- public abstract double getCtrlY1();
-
- /**
- * Returns the curve&#x2019;s first control point.
- */
- public abstract Point2D getCtrlP1();
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s second
- * control point.
- */
- public abstract double getCtrlX2();
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s second
- * control point.
- */
- public abstract double getCtrlY2();
-
- /**
- * Returns the curve&#x2019;s second control point.
- */
- public abstract Point2D getCtrlP2();
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public abstract double getX2();
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public abstract double getY2();
-
- /**
- * Returns the curve&#x2019;s end point.
- */
- public abstract Point2D getP2();
-
- /**
- * Changes the curve geometry, separately specifying each coordinate
- * value.
- *
- * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a CubicCurve2D" />
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new start
- * point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new start
- * point.
- *
- * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s new
- * first control point.
- *
- * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s new
- * first control point.
- *
- * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s new
- * second control point.
- *
- * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s new
- * second control point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new end
- * point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new end
- * point.
- */
- public abstract void setCurve(double x1, double y1, double cx1, double cy1,
- double cx2, double cy2, double x2, double y2);
-
- /**
- * Changes the curve geometry, specifying coordinate values in an
- * array.
- *
- * @param coords an array containing the new coordinate values. The
- * <i>x</i> coordinate of the new start point is located at
- * <code>coords[offset]</code>, its <i>y</i> coordinate at
- * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
- * new first control point is located at <code>coords[offset +
- * 2]</code>, its <i>y</i> coordinate at <code>coords[offset +
- * 3]</code>. The <i>x</i> coordinate of the new second control
- * point is located at <code>coords[offset + 4]</code>, its <i>y</i>
- * coordinate at <code>coords[offset + 5]</code>. The <i>x</i>
- * coordinate of the new end point is located at <code>coords[offset
- * + 6]</code>, its <i>y</i> coordinate at <code>coords[offset +
- * 7]</code>.
- *
- * @param offset the offset of the first coordinate value in
- * <code>coords</code>.
- */
- public void setCurve(double[] coords, int offset)
- {
- setCurve(coords[offset++], coords[offset++], coords[offset++],
- coords[offset++], coords[offset++], coords[offset++],
- coords[offset++], coords[offset++]);
- }
-
- /**
- * Changes the curve geometry, specifying coordinate values in
- * separate Point objects.
- *
- * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a CubicCurve2D" />
- *
- * <p>The curve does not keep any reference to the passed point
- * objects. Therefore, a later change to <code>p1</code>,
- * <code>c1</code>, <code>c2</code> or <code>p2</code> will not
- * affect the curve geometry.
- *
- * @param p1 the new start point.
- * @param c1 the new first control point.
- * @param c2 the new second control point.
- * @param p2 the new end point.
- */
- public void setCurve(Point2D p1, Point2D c1, Point2D c2, Point2D p2)
- {
- setCurve(p1.getX(), p1.getY(), c1.getX(), c1.getY(), c2.getX(), c2.getY(),
- p2.getX(), p2.getY());
- }
-
- /**
- * Changes the curve geometry, specifying coordinate values in an
- * array of Point objects.
- *
- * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a CubicCurve2D" />
- *
- * <p>The curve does not keep references to the passed point
- * objects. Therefore, a later change to the <code>pts</code> array
- * or any of its elements will not affect the curve geometry.
- *
- * @param pts an array containing the points. The new start point
- * is located at <code>pts[offset]</code>, the new first control
- * point at <code>pts[offset + 1]</code>, the new second control
- * point at <code>pts[offset + 2]</code>, and the new end point
- * at <code>pts[offset + 3]</code>.
- *
- * @param offset the offset of the start point in <code>pts</code>.
- */
- public void setCurve(Point2D[] pts, int offset)
- {
- setCurve(pts[offset].getX(), pts[offset++].getY(), pts[offset].getX(),
- pts[offset++].getY(), pts[offset].getX(), pts[offset++].getY(),
- pts[offset].getX(), pts[offset++].getY());
- }
-
- /**
- * Changes the curve geometry to that of another curve.
- *
- * @param c the curve whose coordinates will be copied.
- */
- public void setCurve(CubicCurve2D c)
- {
- setCurve(c.getX1(), c.getY1(), c.getCtrlX1(), c.getCtrlY1(),
- c.getCtrlX2(), c.getCtrlY2(), c.getX2(), c.getY2());
- }
-
- /**
- * Calculates the squared flatness of a cubic curve, directly
- * specifying each coordinate value. The flatness is the maximal
- * distance of a control point to the line between start and end
- * point.
- *
- * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. In comparison to C1,
- * control point C2 is father away from the gray line. Therefore,
- * the result will be the square of the distance between C2 and the
- * gray line, i.e. the squared length of the red line.
- *
- * @param x1 the <i>x</i> coordinate of the start point P1.
- * @param y1 the <i>y</i> coordinate of the start point P1.
- * @param cx1 the <i>x</i> coordinate of the first control point C1.
- * @param cy1 the <i>y</i> coordinate of the first control point C1.
- * @param cx2 the <i>x</i> coordinate of the second control point C2.
- * @param cy2 the <i>y</i> coordinate of the second control point C2.
- * @param x2 the <i>x</i> coordinate of the end point P2.
- * @param y2 the <i>y</i> coordinate of the end point P2.
- */
- public static double getFlatnessSq(double x1, double y1, double cx1,
- double cy1, double cx2, double cy2,
- double x2, double y2)
- {
- return Math.max(Line2D.ptSegDistSq(x1, y1, x2, y2, cx1, cy1),
- Line2D.ptSegDistSq(x1, y1, x2, y2, cx2, cy2));
- }
-
- /**
- * Calculates the flatness of a cubic curve, directly specifying
- * each coordinate value. The flatness is the maximal distance of a
- * control point to the line between start and end point.
- *
- * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. In comparison to C1,
- * control point C2 is father away from the gray line. Therefore,
- * the result will be the distance between C2 and the gray line,
- * i.e. the length of the red line.
- *
- * @param x1 the <i>x</i> coordinate of the start point P1.
- * @param y1 the <i>y</i> coordinate of the start point P1.
- * @param cx1 the <i>x</i> coordinate of the first control point C1.
- * @param cy1 the <i>y</i> coordinate of the first control point C1.
- * @param cx2 the <i>x</i> coordinate of the second control point C2.
- * @param cy2 the <i>y</i> coordinate of the second control point C2.
- * @param x2 the <i>x</i> coordinate of the end point P2.
- * @param y2 the <i>y</i> coordinate of the end point P2.
- */
- public static double getFlatness(double x1, double y1, double cx1,
- double cy1, double cx2, double cy2,
- double x2, double y2)
- {
- return Math.sqrt(getFlatnessSq(x1, y1, cx1, cy1, cx2, cy2, x2, y2));
- }
-
- /**
- * Calculates the squared flatness of a cubic curve, specifying the
- * coordinate values in an array. The flatness is the maximal
- * distance of a control point to the line between start and end
- * point.
- *
- * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. In comparison to C1,
- * control point C2 is father away from the gray line. Therefore,
- * the result will be the square of the distance between C2 and the
- * gray line, i.e. the squared length of the red line.
- *
- * @param coords an array containing the coordinate values. The
- * <i>x</i> coordinate of the start point P1 is located at
- * <code>coords[offset]</code>, its <i>y</i> coordinate at
- * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
- * first control point C1 is located at <code>coords[offset +
- * 2]</code>, its <i>y</i> coordinate at <code>coords[offset +
- * 3]</code>. The <i>x</i> coordinate of the second control point C2
- * is located at <code>coords[offset + 4]</code>, its <i>y</i>
- * coordinate at <code>coords[offset + 5]</code>. The <i>x</i>
- * coordinate of the end point P2 is located at <code>coords[offset
- * + 6]</code>, its <i>y</i> coordinate at <code>coords[offset +
- * 7]</code>.
- *
- * @param offset the offset of the first coordinate value in
- * <code>coords</code>.
- */
- public static double getFlatnessSq(double[] coords, int offset)
- {
- return getFlatnessSq(coords[offset++], coords[offset++], coords[offset++],
- coords[offset++], coords[offset++], coords[offset++],
- coords[offset++], coords[offset++]);
- }
-
- /**
- * Calculates the flatness of a cubic curve, specifying the
- * coordinate values in an array. The flatness is the maximal
- * distance of a control point to the line between start and end
- * point.
- *
- * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. In comparison to C1,
- * control point C2 is father away from the gray line. Therefore,
- * the result will be the distance between C2 and the gray line,
- * i.e. the length of the red line.
- *
- * @param coords an array containing the coordinate values. The
- * <i>x</i> coordinate of the start point P1 is located at
- * <code>coords[offset]</code>, its <i>y</i> coordinate at
- * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
- * first control point C1 is located at <code>coords[offset +
- * 2]</code>, its <i>y</i> coordinate at <code>coords[offset +
- * 3]</code>. The <i>x</i> coordinate of the second control point C2
- * is located at <code>coords[offset + 4]</code>, its <i>y</i>
- * coordinate at <code>coords[offset + 5]</code>. The <i>x</i>
- * coordinate of the end point P2 is located at <code>coords[offset
- * + 6]</code>, its <i>y</i> coordinate at <code>coords[offset +
- * 7]</code>.
- *
- * @param offset the offset of the first coordinate value in
- * <code>coords</code>.
- */
- public static double getFlatness(double[] coords, int offset)
- {
- return Math.sqrt(getFlatnessSq(coords[offset++], coords[offset++],
- coords[offset++], coords[offset++],
- coords[offset++], coords[offset++],
- coords[offset++], coords[offset++]));
- }
-
- /**
- * Calculates the squared flatness of this curve. The flatness is
- * the maximal distance of a control point to the line between start
- * and end point.
- *
- * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. In comparison to C1,
- * control point C2 is father away from the gray line. Therefore,
- * the result will be the square of the distance between C2 and the
- * gray line, i.e. the squared length of the red line.
- */
- public double getFlatnessSq()
- {
- return getFlatnessSq(getX1(), getY1(), getCtrlX1(), getCtrlY1(),
- getCtrlX2(), getCtrlY2(), getX2(), getY2());
- }
-
- /**
- * Calculates the flatness of this curve. The flatness is the
- * maximal distance of a control point to the line between start and
- * end point.
- *
- * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. In comparison to C1,
- * control point C2 is father away from the gray line. Therefore,
- * the result will be the distance between C2 and the gray line,
- * i.e. the length of the red line.
- */
- public double getFlatness()
- {
- return Math.sqrt(getFlatnessSq(getX1(), getY1(), getCtrlX1(), getCtrlY1(),
- getCtrlX2(), getCtrlY2(), getX2(), getY2()));
- }
-
- /**
- * Subdivides this curve into two halves.
- *
- * <p><img src="doc-files/CubicCurve2D-3.png" width="700"
- * height="180" alt="A drawing that illustrates the effects of
- * subdividing a CubicCurve2D" />
- *
- * @param left a curve whose geometry will be set to the left half
- * of this curve, or <code>null</code> if the caller is not
- * interested in the left half.
- *
- * @param right a curve whose geometry will be set to the right half
- * of this curve, or <code>null</code> if the caller is not
- * interested in the right half.
- */
- public void subdivide(CubicCurve2D left, CubicCurve2D right)
- {
- // Use empty slots at end to share single array.
- double[] d = new double[]
- {
- getX1(), getY1(), getCtrlX1(), getCtrlY1(), getCtrlX2(),
- getCtrlY2(), getX2(), getY2(), 0, 0, 0, 0, 0, 0
- };
- subdivide(d, 0, d, 0, d, 6);
- if (left != null)
- left.setCurve(d, 0);
- if (right != null)
- right.setCurve(d, 6);
- }
-
- /**
- * Subdivides a cubic curve into two halves.
- *
- * <p><img src="doc-files/CubicCurve2D-3.png" width="700"
- * height="180" alt="A drawing that illustrates the effects of
- * subdividing a CubicCurve2D" />
- *
- * @param src the curve to be subdivided.
- *
- * @param left a curve whose geometry will be set to the left half
- * of <code>src</code>, or <code>null</code> if the caller is not
- * interested in the left half.
- *
- * @param right a curve whose geometry will be set to the right half
- * of <code>src</code>, or <code>null</code> if the caller is not
- * interested in the right half.
- */
- public static void subdivide(CubicCurve2D src, CubicCurve2D left,
- CubicCurve2D right)
- {
- src.subdivide(left, right);
- }
-
- /**
- * Subdivides a cubic curve into two halves, passing all coordinates
- * in an array.
- *
- * <p><img src="doc-files/CubicCurve2D-3.png" width="700"
- * height="180" alt="A drawing that illustrates the effects of
- * subdividing a CubicCurve2D" />
- *
- * <p>The left end point and the right start point will always be
- * identical. Memory-concious programmers thus may want to pass the
- * same array for both <code>left</code> and <code>right</code>, and
- * set <code>rightOff</code> to <code>leftOff + 6</code>.
- *
- * @param src an array containing the coordinates of the curve to be
- * subdivided. The <i>x</i> coordinate of the start point P1 is
- * located at <code>src[srcOff]</code>, its <i>y</i> at
- * <code>src[srcOff + 1]</code>. The <i>x</i> coordinate of the
- * first control point C1 is located at <code>src[srcOff +
- * 2]</code>, its <i>y</i> at <code>src[srcOff + 3]</code>. The
- * <i>x</i> coordinate of the second control point C2 is located at
- * <code>src[srcOff + 4]</code>, its <i>y</i> at <code>src[srcOff +
- * 5]</code>. The <i>x</i> coordinate of the end point is located at
- * <code>src[srcOff + 6]</code>, its <i>y</i> at <code>src[srcOff +
- * 7]</code>.
- *
- * @param srcOff an offset into <code>src</code>, specifying
- * the index of the start point&#x2019;s <i>x</i> coordinate.
- *
- * @param left an array that will receive the coordinates of the
- * left half of <code>src</code>. It is acceptable to pass
- * <code>src</code>. A caller who is not interested in the left half
- * can pass <code>null</code>.
- *
- * @param leftOff an offset into <code>left</code>, specifying the
- * index where the start point&#x2019;s <i>x</i> coordinate will be
- * stored.
- *
- * @param right an array that will receive the coordinates of the
- * right half of <code>src</code>. It is acceptable to pass
- * <code>src</code> or <code>left</code>. A caller who is not
- * interested in the right half can pass <code>null</code>.
- *
- * @param rightOff an offset into <code>right</code>, specifying the
- * index where the start point&#x2019;s <i>x</i> coordinate will be
- * stored.
- */
- public static void subdivide(double[] src, int srcOff, double[] left,
- int leftOff, double[] right, int rightOff)
- {
- // To understand this code, please have a look at the image
- // "CubicCurve2D-3.png" in the sub-directory "doc-files".
- double src_C1_x;
- double src_C1_y;
- double src_C2_x;
- double src_C2_y;
- double left_P1_x;
- double left_P1_y;
- double left_C1_x;
- double left_C1_y;
- double left_C2_x;
- double left_C2_y;
- double right_C1_x;
- double right_C1_y;
- double right_C2_x;
- double right_C2_y;
- double right_P2_x;
- double right_P2_y;
- double Mid_x; // Mid = left.P2 = right.P1
- double Mid_y; // Mid = left.P2 = right.P1
-
- left_P1_x = src[srcOff];
- left_P1_y = src[srcOff + 1];
- src_C1_x = src[srcOff + 2];
- src_C1_y = src[srcOff + 3];
- src_C2_x = src[srcOff + 4];
- src_C2_y = src[srcOff + 5];
- right_P2_x = src[srcOff + 6];
- right_P2_y = src[srcOff + 7];
-
- left_C1_x = (left_P1_x + src_C1_x) / 2;
- left_C1_y = (left_P1_y + src_C1_y) / 2;
- right_C2_x = (right_P2_x + src_C2_x) / 2;
- right_C2_y = (right_P2_y + src_C2_y) / 2;
- Mid_x = (src_C1_x + src_C2_x) / 2;
- Mid_y = (src_C1_y + src_C2_y) / 2;
- left_C2_x = (left_C1_x + Mid_x) / 2;
- left_C2_y = (left_C1_y + Mid_y) / 2;
- right_C1_x = (Mid_x + right_C2_x) / 2;
- right_C1_y = (Mid_y + right_C2_y) / 2;
- Mid_x = (left_C2_x + right_C1_x) / 2;
- Mid_y = (left_C2_y + right_C1_y) / 2;
-
- if (left != null)
- {
- left[leftOff] = left_P1_x;
- left[leftOff + 1] = left_P1_y;
- left[leftOff + 2] = left_C1_x;
- left[leftOff + 3] = left_C1_y;
- left[leftOff + 4] = left_C2_x;
- left[leftOff + 5] = left_C2_y;
- left[leftOff + 6] = Mid_x;
- left[leftOff + 7] = Mid_y;
- }
-
- if (right != null)
- {
- right[rightOff] = Mid_x;
- right[rightOff + 1] = Mid_y;
- right[rightOff + 2] = right_C1_x;
- right[rightOff + 3] = right_C1_y;
- right[rightOff + 4] = right_C2_x;
- right[rightOff + 5] = right_C2_y;
- right[rightOff + 6] = right_P2_x;
- right[rightOff + 7] = right_P2_y;
- }
- }
-
- /**
- * Finds the non-complex roots of a cubic equation, placing the
- * results into the same array as the equation coefficients. The
- * following equation is being solved:
- *
- * <blockquote><code>eqn[3]</code> &#xb7; <i>x</i><sup>3</sup>
- * + <code>eqn[2]</code> &#xb7; <i>x</i><sup>2</sup>
- * + <code>eqn[1]</code> &#xb7; <i>x</i>
- * + <code>eqn[0]</code>
- * = 0
- * </blockquote>
- *
- * <p>For some background about solving cubic equations, see the
- * article <a
- * href="http://planetmath.org/encyclopedia/CubicFormula.html"
- * >&#x201c;Cubic Formula&#x201d;</a> in <a
- * href="http://planetmath.org/" >PlanetMath</a>. For an extensive
- * library of numerical algorithms written in the C programming
- * language, see the <a href= "http://www.gnu.org/software/gsl/">GNU
- * Scientific Library</a>, from which this implementation was
- * adapted.
- *
- * @param eqn an array with the coefficients of the equation. When
- * this procedure has returned, <code>eqn</code> will contain the
- * non-complex solutions of the equation, in no particular order.
- *
- * @return the number of non-complex solutions. A result of 0
- * indicates that the equation has no non-complex solutions. A
- * result of -1 indicates that the equation is constant (i.e.,
- * always or never zero).
- *
- * @see #solveCubic(double[], double[])
- * @see QuadCurve2D#solveQuadratic(double[],double[])
- *
- * @author Brian Gough (bjg@network-theory.com)
- * (original C implementation in the <a href=
- * "http://www.gnu.org/software/gsl/">GNU Scientific Library</a>)
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- * (adaptation to Java)
- */
- public static int solveCubic(double[] eqn)
- {
- return solveCubic(eqn, eqn);
- }
-
- /**
- * Finds the non-complex roots of a cubic equation. The following
- * equation is being solved:
- *
- * <blockquote><code>eqn[3]</code> &#xb7; <i>x</i><sup>3</sup>
- * + <code>eqn[2]</code> &#xb7; <i>x</i><sup>2</sup>
- * + <code>eqn[1]</code> &#xb7; <i>x</i>
- * + <code>eqn[0]</code>
- * = 0
- * </blockquote>
- *
- * <p>For some background about solving cubic equations, see the
- * article <a
- * href="http://planetmath.org/encyclopedia/CubicFormula.html"
- * >&#x201c;Cubic Formula&#x201d;</a> in <a
- * href="http://planetmath.org/" >PlanetMath</a>. For an extensive
- * library of numerical algorithms written in the C programming
- * language, see the <a href= "http://www.gnu.org/software/gsl/">GNU
- * Scientific Library</a>, from which this implementation was
- * adapted.
- *
- * @see QuadCurve2D#solveQuadratic(double[],double[])
- *
- * @param eqn an array with the coefficients of the equation.
- *
- * @param res an array into which the non-complex roots will be
- * stored. The results may be in an arbitrary order. It is safe to
- * pass the same array object reference for both <code>eqn</code>
- * and <code>res</code>.
- *
- * @return the number of non-complex solutions. A result of 0
- * indicates that the equation has no non-complex solutions. A
- * result of -1 indicates that the equation is constant (i.e.,
- * always or never zero).
- *
- * @author Brian Gough (bjg@network-theory.com)
- * (original C implementation in the <a href=
- * "http://www.gnu.org/software/gsl/">GNU Scientific Library</a>)
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- * (adaptation to Java)
- */
- public static int solveCubic(double[] eqn, double[] res)
- {
- // Adapted from poly/solve_cubic.c in the GNU Scientific Library
- // (GSL), revision 1.7 of 2003-07-26. For the original source, see
- // http://www.gnu.org/software/gsl/
- //
- // Brian Gough, the author of that code, has granted the
- // permission to use it in GNU Classpath under the GNU Classpath
- // license, and has assigned the copyright to the Free Software
- // Foundation.
- //
- // The Java implementation is very similar to the GSL code, but
- // not a strict one-to-one copy. For example, GSL would sort the
- // result.
-
- double a;
- double b;
- double c;
- double q;
- double r;
- double Q;
- double R;
- double c3;
- double Q3;
- double R2;
- double CR2;
- double CQ3;
-
- // If the cubic coefficient is zero, we have a quadratic equation.
- c3 = eqn[3];
- if (c3 == 0)
- return QuadCurve2D.solveQuadratic(eqn, res);
-
- // Divide the equation by the cubic coefficient.
- c = eqn[0] / c3;
- b = eqn[1] / c3;
- a = eqn[2] / c3;
-
- // We now need to solve x^3 + ax^2 + bx + c = 0.
- q = a * a - 3 * b;
- r = 2 * a * a * a - 9 * a * b + 27 * c;
-
- Q = q / 9;
- R = r / 54;
-
- Q3 = Q * Q * Q;
- R2 = R * R;
-
- CR2 = 729 * r * r;
- CQ3 = 2916 * q * q * q;
-
- if (R == 0 && Q == 0)
- {
- // The GNU Scientific Library would return three identical
- // solutions in this case.
- res[0] = -a / 3;
- return 1;
- }
-
- if (CR2 == CQ3)
- {
- /* this test is actually R2 == Q3, written in a form suitable
- for exact computation with integers */
- /* Due to finite precision some double roots may be missed, and
- considered to be a pair of complex roots z = x +/- epsilon i
- close to the real axis. */
- double sqrtQ = Math.sqrt(Q);
-
- if (R > 0)
- {
- res[0] = -2 * sqrtQ - a / 3;
- res[1] = sqrtQ - a / 3;
- }
- else
- {
- res[0] = -sqrtQ - a / 3;
- res[1] = 2 * sqrtQ - a / 3;
- }
- return 2;
- }
-
- if (CR2 < CQ3) /* equivalent to R2 < Q3 */
- {
- double sqrtQ = Math.sqrt(Q);
- double sqrtQ3 = sqrtQ * sqrtQ * sqrtQ;
- double theta = Math.acos(R / sqrtQ3);
- double norm = -2 * sqrtQ;
- res[0] = norm * Math.cos(theta / 3) - a / 3;
- res[1] = norm * Math.cos((theta + 2.0 * Math.PI) / 3) - a / 3;
- res[2] = norm * Math.cos((theta - 2.0 * Math.PI) / 3) - a / 3;
-
- // The GNU Scientific Library sorts the results. We don't.
- return 3;
- }
-
- double sgnR = (R >= 0 ? 1 : -1);
- double A = -sgnR * Math.pow(Math.abs(R) + Math.sqrt(R2 - Q3), 1.0 / 3.0);
- double B = Q / A;
- res[0] = A + B - a / 3;
- return 1;
- }
-
- /**
- * Determines whether a position lies inside the area bounded
- * by the curve and the straight line connecting its end points.
- *
- * <p><img src="doc-files/CubicCurve2D-5.png" width="350" height="180"
- * alt="A drawing of the area spanned by the curve" />
- *
- * <p>The above drawing illustrates in which area points are
- * considered &#x201c;inside&#x201d; a CubicCurve2D.
- */
- public boolean contains(double x, double y)
- {
- if (! getBounds2D().contains(x, y))
- return false;
-
- return ((getAxisIntersections(x, y, true, BIG_VALUE) & 1) != 0);
- }
-
- /**
- * Determines whether a point lies inside the area bounded
- * by the curve and the straight line connecting its end points.
- *
- * <p><img src="doc-files/CubicCurve2D-5.png" width="350" height="180"
- * alt="A drawing of the area spanned by the curve" />
- *
- * <p>The above drawing illustrates in which area points are
- * considered &#x201c;inside&#x201d; a CubicCurve2D.
- */
- public boolean contains(Point2D p)
- {
- return contains(p.getX(), p.getY());
- }
-
- /**
- * Determines whether any part of a rectangle is inside the area bounded
- * by the curve and the straight line connecting its end points.
- *
- * <p><img src="doc-files/CubicCurve2D-5.png" width="350" height="180"
- * alt="A drawing of the area spanned by the curve" />
- *
- * <p>The above drawing illustrates in which area points are
- * considered &#x201c;inside&#x201d; in a CubicCurve2D.
- * @see #contains(double, double)
- */
- public boolean intersects(double x, double y, double w, double h)
- {
- if (! getBounds2D().contains(x, y, w, h))
- return false;
-
- /* Does any edge intersect? */
- if (getAxisIntersections(x, y, true, w) != 0 /* top */
- || getAxisIntersections(x, y + h, true, w) != 0 /* bottom */
- || getAxisIntersections(x + w, y, false, h) != 0 /* right */
- || getAxisIntersections(x, y, false, h) != 0) /* left */
- return true;
-
- /* No intersections, is any point inside? */
- if ((getAxisIntersections(x, y, true, BIG_VALUE) & 1) != 0)
- return true;
-
- return false;
- }
-
- /**
- * Determines whether any part of a Rectangle2D is inside the area bounded
- * by the curve and the straight line connecting its end points.
- * @see #intersects(double, double, double, double)
- */
- public boolean intersects(Rectangle2D r)
- {
- return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Determine whether a rectangle is entirely inside the area that is bounded
- * by the curve and the straight line connecting its end points.
- *
- * <p><img src="doc-files/CubicCurve2D-5.png" width="350" height="180"
- * alt="A drawing of the area spanned by the curve" />
- *
- * <p>The above drawing illustrates in which area points are
- * considered &#x201c;inside&#x201d; a CubicCurve2D.
- * @see #contains(double, double)
- */
- public boolean contains(double x, double y, double w, double h)
- {
- if (! getBounds2D().intersects(x, y, w, h))
- return false;
-
- /* Does any edge intersect? */
- if (getAxisIntersections(x, y, true, w) != 0 /* top */
- || getAxisIntersections(x, y + h, true, w) != 0 /* bottom */
- || getAxisIntersections(x + w, y, false, h) != 0 /* right */
- || getAxisIntersections(x, y, false, h) != 0) /* left */
- return false;
-
- /* No intersections, is any point inside? */
- if ((getAxisIntersections(x, y, true, BIG_VALUE) & 1) != 0)
- return true;
-
- return false;
- }
-
- /**
- * Determine whether a Rectangle2D is entirely inside the area that is
- * bounded by the curve and the straight line connecting its end points.
- *
- * <p><img src="doc-files/CubicCurve2D-5.png" width="350" height="180"
- * alt="A drawing of the area spanned by the curve" />
- *
- * <p>The above drawing illustrates in which area points are
- * considered &#x201c;inside&#x201d; a CubicCurve2D.
- * @see #contains(double, double)
- */
- public boolean contains(Rectangle2D r)
- {
- return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Determines the smallest rectangle that encloses the
- * curve&#x2019;s start, end and control points.
- */
- public Rectangle getBounds()
- {
- return getBounds2D().getBounds();
- }
-
- public PathIterator getPathIterator(final AffineTransform at)
- {
- return new PathIterator()
- {
- /** Current coordinate. */
- private int current = 0;
-
- public int getWindingRule()
- {
- return WIND_NON_ZERO;
- }
-
- public boolean isDone()
- {
- return current >= 2;
- }
-
- public void next()
- {
- current++;
- }
-
- public int currentSegment(float[] coords)
- {
- int result;
- switch (current)
- {
- case 0:
- coords[0] = (float) getX1();
- coords[1] = (float) getY1();
- result = SEG_MOVETO;
- break;
- case 1:
- coords[0] = (float) getCtrlX1();
- coords[1] = (float) getCtrlY1();
- coords[2] = (float) getCtrlX2();
- coords[3] = (float) getCtrlY2();
- coords[4] = (float) getX2();
- coords[5] = (float) getY2();
- result = SEG_CUBICTO;
- break;
- default:
- throw new NoSuchElementException("cubic iterator out of bounds");
- }
- if (at != null)
- at.transform(coords, 0, coords, 0, 3);
- return result;
- }
-
- public int currentSegment(double[] coords)
- {
- int result;
- switch (current)
- {
- case 0:
- coords[0] = getX1();
- coords[1] = getY1();
- result = SEG_MOVETO;
- break;
- case 1:
- coords[0] = getCtrlX1();
- coords[1] = getCtrlY1();
- coords[2] = getCtrlX2();
- coords[3] = getCtrlY2();
- coords[4] = getX2();
- coords[5] = getY2();
- result = SEG_CUBICTO;
- break;
- default:
- throw new NoSuchElementException("cubic iterator out of bounds");
- }
- if (at != null)
- at.transform(coords, 0, coords, 0, 3);
- return result;
- }
- };
- }
-
- public PathIterator getPathIterator(AffineTransform at, double flatness)
- {
- return new FlatteningPathIterator(getPathIterator(at), flatness);
- }
-
- /**
- * Create a new curve with the same contents as this one.
- *
- * @return the clone.
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-
- /**
- * Helper method used by contains() and intersects() methods, that
- * returns the number of curve/line intersections on a given axis
- * extending from a certain point.
- *
- * @param x x coordinate of the origin point
- * @param y y coordinate of the origin point
- * @param useYaxis axis used, if true the positive Y axis is used,
- * false uses the positive X axis.
- *
- * This is an implementation of the line-crossings algorithm,
- * Detailed in an article on Eric Haines' page:
- * http://www.acm.org/tog/editors/erich/ptinpoly/
- *
- * A special-case not adressed in this code is self-intersections
- * of the curve, e.g. if the axis intersects the self-itersection,
- * the degenerate roots of the polynomial will erroneously count as
- * a single intersection of the curve, and not two.
- */
- private int getAxisIntersections(double x, double y, boolean useYaxis,
- double distance)
- {
- int nCrossings = 0;
- double a0;
- double a1;
- double a2;
- double a3;
- double b0;
- double b1;
- double b2;
- double b3;
- double[] r = new double[4];
- int nRoots;
-
- a0 = a3 = 0.0;
-
- if (useYaxis)
- {
- a0 = getY1() - y;
- a1 = getCtrlY1() - y;
- a2 = getCtrlY2() - y;
- a3 = getY2() - y;
- b0 = getX1() - x;
- b1 = getCtrlX1() - x;
- b2 = getCtrlX2() - x;
- b3 = getX2() - x;
- }
- else
- {
- a0 = getX1() - x;
- a1 = getCtrlX1() - x;
- a2 = getCtrlX2() - x;
- a3 = getX2() - x;
- b0 = getY1() - y;
- b1 = getCtrlY1() - y;
- b2 = getCtrlY2() - y;
- b3 = getY2() - y;
- }
-
- /* If the axis intersects a start/endpoint, shift it up by some small
- amount to guarantee the line is 'inside'
- If this is not done, bad behaviour may result for points on that axis.*/
- if (a0 == 0.0 || a3 == 0.0)
- {
- double small = getFlatness() * EPSILON;
- if (a0 == 0.0)
- a0 -= small;
- if (a3 == 0.0)
- a3 -= small;
- }
-
- if (useYaxis)
- {
- if (Line2D.linesIntersect(b0, a0, b3, a3, EPSILON, 0.0, distance, 0.0))
- nCrossings++;
- }
- else
- {
- if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, EPSILON, 0.0, distance))
- nCrossings++;
- }
-
- r[0] = a0;
- r[1] = 3 * (a1 - a0);
- r[2] = 3 * (a2 + a0 - 2 * a1);
- r[3] = a3 - 3 * a2 + 3 * a1 - a0;
-
- if ((nRoots = solveCubic(r)) != 0)
- for (int i = 0; i < nRoots; i++)
- {
- double t = r[i];
- if (t >= 0.0 && t <= 1.0)
- {
- double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3)
- + 3 * t * t * (b0 - 2 * b1 + b2)
- + 3 * t * (b1 - b0) + b0;
- if (crossing > 0.0 && crossing <= distance)
- nCrossings++;
- }
- }
-
- return (nCrossings);
- }
-
- /**
- * A two-dimensional curve that is parameterized with a cubic
- * function and stores coordinate values in double-precision
- * floating-point format.
- *
- * @see CubicCurve2D.Float
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class Double extends CubicCurve2D
- {
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s start point.
- */
- public double x1;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s start point.
- */
- public double y1;
-
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s first control point.
- */
- public double ctrlx1;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s first control point.
- */
- public double ctrly1;
-
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s second control point.
- */
- public double ctrlx2;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s second control point.
- */
- public double ctrly2;
-
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s end point.
- */
- public double x2;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s end point.
- */
- public double y2;
-
- /**
- * Constructs a new CubicCurve2D that stores its coordinate values
- * in double-precision floating-point format. All points are
- * initially at position (0, 0).
- */
- public Double()
- {
- }
-
- /**
- * Constructs a new CubicCurve2D that stores its coordinate values
- * in double-precision floating-point format, specifying the
- * initial position of each point.
- *
- * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a CubicCurve2D" />
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s start
- * point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s start
- * point.
- *
- * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s first
- * control point.
- *
- * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s first
- * control point.
- *
- * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s second
- * control point.
- *
- * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s second
- * control point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s end
- * point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public Double(double x1, double y1, double cx1, double cy1, double cx2,
- double cy2, double x2, double y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- ctrlx1 = cx1;
- ctrly1 = cy1;
- ctrlx2 = cx2;
- ctrly2 = cy2;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public double getX1()
- {
- return x1;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public double getY1()
- {
- return y1;
- }
-
- /**
- * Returns the curve&#x2019;s start point.
- */
- public Point2D getP1()
- {
- return new Point2D.Double(x1, y1);
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s first
- * control point.
- */
- public double getCtrlX1()
- {
- return ctrlx1;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s first
- * control point.
- */
- public double getCtrlY1()
- {
- return ctrly1;
- }
-
- /**
- * Returns the curve&#x2019;s first control point.
- */
- public Point2D getCtrlP1()
- {
- return new Point2D.Double(ctrlx1, ctrly1);
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s second
- * control point.
- */
- public double getCtrlX2()
- {
- return ctrlx2;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s second
- * control point.
- */
- public double getCtrlY2()
- {
- return ctrly2;
- }
-
- /**
- * Returns the curve&#x2019;s second control point.
- */
- public Point2D getCtrlP2()
- {
- return new Point2D.Double(ctrlx2, ctrly2);
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public double getX2()
- {
- return x2;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public double getY2()
- {
- return y2;
- }
-
- /**
- * Returns the curve&#x2019;s end point.
- */
- public Point2D getP2()
- {
- return new Point2D.Double(x2, y2);
- }
-
- /**
- * Changes the curve geometry, separately specifying each coordinate
- * value.
- *
- * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a CubicCurve2D" />
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new start
- * point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new start
- * point.
- *
- * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s new
- * first control point.
- *
- * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s new
- * first control point.
- *
- * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s new
- * second control point.
- *
- * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s new
- * second control point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new end
- * point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new end
- * point.
- */
- public void setCurve(double x1, double y1, double cx1, double cy1,
- double cx2, double cy2, double x2, double y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- ctrlx1 = cx1;
- ctrly1 = cy1;
- ctrlx2 = cx2;
- ctrly2 = cy2;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Determines the smallest rectangle that encloses the
- * curve&#x2019;s start, end and control points. As the
- * illustration below shows, the invisible control points may cause
- * the bounds to be much larger than the area that is actually
- * covered by the curve.
- *
- * <p><img src="doc-files/CubicCurve2D-2.png" width="350" height="180"
- * alt="An illustration of the bounds of a CubicCurve2D" />
- */
- public Rectangle2D getBounds2D()
- {
- double nx1 = Math.min(Math.min(x1, ctrlx1), Math.min(ctrlx2, x2));
- double ny1 = Math.min(Math.min(y1, ctrly1), Math.min(ctrly2, y2));
- double nx2 = Math.max(Math.max(x1, ctrlx1), Math.max(ctrlx2, x2));
- double ny2 = Math.max(Math.max(y1, ctrly1), Math.max(ctrly2, y2));
- return new Rectangle2D.Double(nx1, ny1, nx2 - nx1, ny2 - ny1);
- }
- }
-
- /**
- * A two-dimensional curve that is parameterized with a cubic
- * function and stores coordinate values in single-precision
- * floating-point format.
- *
- * @see CubicCurve2D.Float
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class Float extends CubicCurve2D
- {
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s start point.
- */
- public float x1;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s start point.
- */
- public float y1;
-
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s first control point.
- */
- public float ctrlx1;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s first control point.
- */
- public float ctrly1;
-
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s second control point.
- */
- public float ctrlx2;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s second control point.
- */
- public float ctrly2;
-
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s end point.
- */
- public float x2;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s end point.
- */
- public float y2;
-
- /**
- * Constructs a new CubicCurve2D that stores its coordinate values
- * in single-precision floating-point format. All points are
- * initially at position (0, 0).
- */
- public Float()
- {
- }
-
- /**
- * Constructs a new CubicCurve2D that stores its coordinate values
- * in single-precision floating-point format, specifying the
- * initial position of each point.
- *
- * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a CubicCurve2D" />
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s start
- * point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s start
- * point.
- *
- * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s first
- * control point.
- *
- * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s first
- * control point.
- *
- * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s second
- * control point.
- *
- * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s second
- * control point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s end
- * point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public Float(float x1, float y1, float cx1, float cy1, float cx2,
- float cy2, float x2, float y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- ctrlx1 = cx1;
- ctrly1 = cy1;
- ctrlx2 = cx2;
- ctrly2 = cy2;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public double getX1()
- {
- return x1;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public double getY1()
- {
- return y1;
- }
-
- /**
- * Returns the curve&#x2019;s start point.
- */
- public Point2D getP1()
- {
- return new Point2D.Float(x1, y1);
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s first
- * control point.
- */
- public double getCtrlX1()
- {
- return ctrlx1;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s first
- * control point.
- */
- public double getCtrlY1()
- {
- return ctrly1;
- }
-
- /**
- * Returns the curve&#x2019;s first control point.
- */
- public Point2D getCtrlP1()
- {
- return new Point2D.Float(ctrlx1, ctrly1);
- }
-
- /**
- * Returns the <i>s</i> coordinate of the curve&#x2019;s second
- * control point.
- */
- public double getCtrlX2()
- {
- return ctrlx2;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s second
- * control point.
- */
- public double getCtrlY2()
- {
- return ctrly2;
- }
-
- /**
- * Returns the curve&#x2019;s second control point.
- */
- public Point2D getCtrlP2()
- {
- return new Point2D.Float(ctrlx2, ctrly2);
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public double getX2()
- {
- return x2;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public double getY2()
- {
- return y2;
- }
-
- /**
- * Returns the curve&#x2019;s end point.
- */
- public Point2D getP2()
- {
- return new Point2D.Float(x2, y2);
- }
-
- /**
- * Changes the curve geometry, separately specifying each coordinate
- * value as a double-precision floating-point number.
- *
- * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a CubicCurve2D" />
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new start
- * point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new start
- * point.
- *
- * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s new
- * first control point.
- *
- * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s new
- * first control point.
- *
- * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s new
- * second control point.
- *
- * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s new
- * second control point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new end
- * point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new end
- * point.
- */
- public void setCurve(double x1, double y1, double cx1, double cy1,
- double cx2, double cy2, double x2, double y2)
- {
- this.x1 = (float) x1;
- this.y1 = (float) y1;
- ctrlx1 = (float) cx1;
- ctrly1 = (float) cy1;
- ctrlx2 = (float) cx2;
- ctrly2 = (float) cy2;
- this.x2 = (float) x2;
- this.y2 = (float) y2;
- }
-
- /**
- * Changes the curve geometry, separately specifying each coordinate
- * value as a single-precision floating-point number.
- *
- * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a CubicCurve2D" />
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new start
- * point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new start
- * point.
- *
- * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s new
- * first control point.
- *
- * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s new
- * first control point.
- *
- * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s new
- * second control point.
- *
- * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s new
- * second control point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new end
- * point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new end
- * point.
- */
- public void setCurve(float x1, float y1, float cx1, float cy1, float cx2,
- float cy2, float x2, float y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- ctrlx1 = cx1;
- ctrly1 = cy1;
- ctrlx2 = cx2;
- ctrly2 = cy2;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Determines the smallest rectangle that encloses the
- * curve&#x2019;s start, end and control points. As the
- * illustration below shows, the invisible control points may cause
- * the bounds to be much larger than the area that is actually
- * covered by the curve.
- *
- * <p><img src="doc-files/CubicCurve2D-2.png" width="350" height="180"
- * alt="An illustration of the bounds of a CubicCurve2D" />
- */
- public Rectangle2D getBounds2D()
- {
- float nx1 = (float) Math.min(Math.min(x1, ctrlx1), Math.min(ctrlx2, x2));
- float ny1 = (float) Math.min(Math.min(y1, ctrly1), Math.min(ctrly2, y2));
- float nx2 = (float) Math.max(Math.max(x1, ctrlx1), Math.max(ctrlx2, x2));
- float ny2 = (float) Math.max(Math.max(y1, ctrly1), Math.max(ctrly2, y2));
- return new Rectangle2D.Float(nx1, ny1, nx2 - nx1, ny2 - ny1);
- }
- }
-}
diff --git a/libjava/java/awt/geom/Dimension2D.java b/libjava/java/awt/geom/Dimension2D.java
deleted file mode 100644
index 6b5ce8830a9..00000000000
--- a/libjava/java/awt/geom/Dimension2D.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Dimension2D.java -- abstraction of a dimension
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-/**
- * This stores a dimension in 2-dimensional space - a width (along the x-axis)
- * and height (along the y-axis). The storage is left to subclasses.
- *
- * @author Per Bothner (bothner@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class Dimension2D implements Cloneable
-{
- /**
- * The default constructor.
- */
- protected Dimension2D()
- {
- }
-
- /**
- * Get the width of this dimension. A negative result, while legal, is
- * undefined in meaning.
- *
- * @return the width
- */
- public abstract double getWidth();
-
- /**
- * Get the height of this dimension. A negative result, while legal, is
- * undefined in meaning.
- *
- * @return the height
- */
- public abstract double getHeight();
-
- /**
- * Set the size of this dimension to the requested values. Loss of precision
- * may occur.
- *
- * @param w the new width
- * @param h the new height
- */
- public abstract void setSize(double w, double h);
-
- /**
- * Set the size of this dimension to the requested value. Loss of precision
- * may occur.
- *
- * @param d the dimension containing the new values
- *
- * @throws NullPointerException if d is null
- */
- public void setSize(Dimension2D d)
- {
- setSize(d.getWidth(), d.getHeight());
- }
-
- /**
- * Create a new dimension of the same run-time type with the same contents
- * as this one.
- *
- * @return the clone
- *
- * @exception OutOfMemoryError If there is not enough memory available.
- *
- * @since 1.2
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-} // class Dimension2D
diff --git a/libjava/java/awt/geom/Ellipse2D.java b/libjava/java/awt/geom/Ellipse2D.java
deleted file mode 100644
index e8830770f60..00000000000
--- a/libjava/java/awt/geom/Ellipse2D.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/* Ellipse2D.java -- represents an ellipse in 2-D space
- Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-
-/**
- * Ellipse2D is the shape of an ellipse.
- * <BR>
- * <img src="doc-files/Ellipse-1.png" width="347" height="221"
- * alt="A drawing of an ellipse" /><BR>
- * The ellipse is defined by it's bounding box (shown in red),
- * and is defined by the implicit curve:<BR>
- * <blockquote>(<i>x</i>/<i>a</i>)<sup>2</sup> +
- * (<i>y</i>/<i>b</i>)<sup>2</sup> = 1<BR><BR></blockquote>
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- *
- * @since 1.2
- */
-public abstract class Ellipse2D extends RectangularShape
-{
- /**
- * Ellipse2D is defined as abstract.
- * Implementing classes are Ellipse2D.Float and Ellipse2D.Double.
- */
- protected Ellipse2D()
- {
- }
-
- /**
- * Determines if a point is contained within the ellipse. <P>
- * @param x - x coordinate of the point.
- * @param y - y coordinate of the point.
- * @return true if the point is within the ellipse, false otherwise.
- */
- public boolean contains(double x, double y)
- {
- double rx = getWidth() / 2;
- double ry = getHeight() / 2;
- double tx = (x - (getX() + rx)) / rx;
- double ty = (y - (getY() + ry)) / ry;
- return tx * tx + ty * ty < 1.0;
- }
-
- /**
- * Determines if a rectangle is completely contained within the
- * ellipse. <P>
- * @param x - x coordinate of the upper-left corner of the rectangle
- * @param y - y coordinate of the upper-left corner of the rectangle
- * @param w - width of the rectangle
- * @param h - height of the rectangle
- * @return true if the rectangle is completely contained, false otherwise.
- */
- public boolean contains(double x, double y, double w, double h)
- {
- double x2 = x + w;
- double y2 = y + h;
- return (contains(x, y) && contains(x, y2) && contains(x2, y)
- && contains(x2, y2));
- }
-
- /**
- * Returns a PathIterator object corresponding to the ellipse.<P>
- *
- * Note: An ellipse cannot be represented exactly in PathIterator
- * segments, the outline is thefore approximated with cubic
- * Bezier segments.
- *
- * @param at an optional transform.
- * @return A path iterator.
- */
- public PathIterator getPathIterator(AffineTransform at)
- {
- // An ellipse is just a complete arc.
- return new Arc2D.ArcIterator(this, at);
- }
-
- /**
- * Determines if a rectangle intersects any part of the ellipse.<P>
- * @param x - x coordinate of the upper-left corner of the rectangle
- * @param y - y coordinate of the upper-left corner of the rectangle
- * @param w - width of the rectangle
- * @param h - height of the rectangle
- * @return true if the rectangle intersects the ellipse, false otherwise.
- */
- public boolean intersects(double x, double y, double w, double h)
- {
- Rectangle2D r = new Rectangle2D.Double(x, y, w, h);
- if (! r.intersects(getX(), getY(), getWidth(), getHeight()))
- return false;
-
- if (contains(x, y) || contains(x, y + h) || contains(x + w, y)
- || contains(x + w, y + h))
- return true;
-
- Line2D l1 = new Line2D.Double(getX(), getY() + (getHeight() / 2),
- getX() + getWidth(),
- getY() + (getHeight() / 2));
- Line2D l2 = new Line2D.Double(getX() + (getWidth() / 2), getY(),
- getX() + (getWidth() / 2),
- getY() + getHeight());
-
- if (l1.intersects(r) || l2.intersects(r))
- return true;
-
- return false;
- }
-
- /**
- * An {@link Ellipse2D} that stores its coordinates using <code>double</code>
- * primitives.
- */
- public static class Double extends Ellipse2D
- {
- /**
- * The height of the ellipse.
- */
- public double height;
-
- /**
- * The width of the ellipse.
- */
- public double width;
-
- /**
- * The upper-left x coordinate of the bounding-box
- */
- public double x;
-
- /**
- * The upper-left y coordinate of the bounding-box
- */
- public double y;
-
- /**
- * Creates a new Ellipse2D with an upper-left coordinate of (0,0)
- * and a zero size.
- */
- public Double()
- {
- }
-
- /**
- * Creates a new Ellipse2D within a given rectangle
- * using double-precision coordinates.<P>
- * @param x - x coordinate of the upper-left of the bounding rectangle
- * @param y - y coordinate of the upper-left of the bounding rectangle
- * @param w - width of the ellipse
- * @param h - height of the ellipse
- */
- public Double(double x, double y, double w, double h)
- {
- this.x = x;
- this.y = y;
- height = h;
- width = w;
- }
-
- /**
- * Returns the bounding-box of the ellipse.
- * @return The bounding box.
- */
- public Rectangle2D getBounds2D()
- {
- return new Rectangle2D.Double(x, y, width, height);
- }
-
- /**
- * Returns the height of the ellipse.
- * @return The height of the ellipse.
- */
- public double getHeight()
- {
- return height;
- }
-
- /**
- * Returns the width of the ellipse.
- * @return The width of the ellipse.
- */
- public double getWidth()
- {
- return width;
- }
-
- /**
- * Returns x coordinate of the upper-left corner of
- * the ellipse's bounding-box.
- * @return The x coordinate.
- */
- public double getX()
- {
- return x;
- }
-
- /**
- * Returns y coordinate of the upper-left corner of
- * the ellipse's bounding-box.
- * @return The y coordinate.
- */
- public double getY()
- {
- return y;
- }
-
- /**
- * Returns <code>true</code> if the ellipse encloses no area, and
- * <code>false</code> otherwise.
- *
- * @return A boolean.
- */
- public boolean isEmpty()
- {
- return height <= 0 || width <= 0;
- }
-
- /**
- * Sets the geometry of the ellipse's bounding box.<P>
- *
- * @param x - x coordinate of the upper-left of the bounding rectangle
- * @param y - y coordinate of the upper-left of the bounding rectangle
- * @param w - width of the ellipse
- * @param h - height of the ellipse
- */
- public void setFrame(double x, double y, double w, double h)
- {
- this.x = x;
- this.y = y;
- height = h;
- width = w;
- }
- } // class Double
-
- /**
- * An {@link Ellipse2D} that stores its coordinates using <code>float</code>
- * primitives.
- */
- public static class Float extends Ellipse2D
- {
- /**
- * The height of the ellipse.
- */
- public float height;
-
- /**
- * The width of the ellipse.
- */
- public float width;
-
- /**
- * The upper-left x coordinate of the bounding-box
- */
- public float x;
-
- /**
- * The upper-left y coordinate of the bounding-box
- */
- public float y;
-
- /**
- * Creates a new Ellipse2D with an upper-left coordinate of (0,0)
- * and a zero size.
- */
- public Float()
- {
- }
-
- /**
- * Creates a new Ellipse2D within a given rectangle
- * using floating-point precision.<P>
- * @param x - x coordinate of the upper-left of the bounding rectangle
- * @param y - y coordinate of the upper-left of the bounding rectangle
- * @param w - width of the ellipse
- * @param h - height of the ellipse
- *
- */
- public Float(float x, float y, float w, float h)
- {
- this.x = x;
- this.y = y;
- this.height = h;
- this.width = w;
- }
-
- /**
- * Returns the bounding-box of the ellipse.
- * @return The bounding box.
- */
- public Rectangle2D getBounds2D()
- {
- return new Rectangle2D.Float(x, y, width, height);
- }
-
- /**
- * Returns the height of the ellipse.
- * @return The height of the ellipse.
- */
- public double getHeight()
- {
- return height;
- }
-
- /**
- * Returns the width of the ellipse.
- * @return The width of the ellipse.
- */
- public double getWidth()
- {
- return width;
- }
-
- /**
- * Returns x coordinate of the upper-left corner of
- * the ellipse's bounding-box.
- * @return The x coordinate.
- */
- public double getX()
- {
- return x;
- }
-
- /**
- * Returns y coordinate of the upper-left corner of
- * the ellipse's bounding-box.
- * @return The y coordinate.
- */
- public double getY()
- {
- return y;
- }
-
- /**
- * Returns <code>true</code> if the ellipse encloses no area, and
- * <code>false</code> otherwise.
- *
- * @return A boolean.
- */
- public boolean isEmpty()
- {
- return height <= 0 || width <= 0;
- }
-
- /**
- * Sets the geometry of the ellipse's bounding box.<P>
- *
- * @param x - x coordinate of the upper-left of the bounding rectangle
- * @param y - y coordinate of the upper-left of the bounding rectangle
- * @param w - width of the ellipse
- * @param h - height of the ellipse
- */
- public void setFrame(float x, float y, float w, float h)
- {
- this.x = x;
- this.y = y;
- height = h;
- width = w;
- }
-
- /**
- * Sets the geometry of the ellipse's bounding box.
- *
- * Note: This leads to a loss of precision.<P>
- *
- * @param x - x coordinate of the upper-left of the bounding rectangle
- * @param y - y coordinate of the upper-left of the bounding rectangle
- * @param w - width of the ellipse
- * @param h - height of the ellipse
- */
- public void setFrame(double x, double y, double w, double h)
- {
- this.x = (float) x;
- this.y = (float) y;
- height = (float) h;
- width = (float) w;
- }
- } // class Float
-} // class Ellipse2D
diff --git a/libjava/java/awt/geom/FlatteningPathIterator.java b/libjava/java/awt/geom/FlatteningPathIterator.java
deleted file mode 100644
index b06e6cc47b8..00000000000
--- a/libjava/java/awt/geom/FlatteningPathIterator.java
+++ /dev/null
@@ -1,579 +0,0 @@
-/* FlatteningPathIterator.java -- Approximates curves by straight lines
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.util.NoSuchElementException;
-
-
-/**
- * A PathIterator for approximating curved path segments by sequences
- * of straight lines. Instances of this class will only return
- * segments of type {@link PathIterator#SEG_MOVETO}, {@link
- * PathIterator#SEG_LINETO}, and {@link PathIterator#SEG_CLOSE}.
- *
- * <p>The accuracy of the approximation is determined by two
- * parameters:
- *
- * <ul><li>The <i>flatness</i> is a threshold value for deciding when
- * a curved segment is consided flat enough for being approximated by
- * a single straight line. Flatness is defined as the maximal distance
- * of a curve control point to the straight line that connects the
- * curve start and end. A lower flatness threshold means a closer
- * approximation. See {@link QuadCurve2D#getFlatness()} and {@link
- * CubicCurve2D#getFlatness()} for drawings which illustrate the
- * meaning of flatness.</li>
- *
- * <li>The <i>recursion limit</i> imposes an upper bound for how often
- * a curved segment gets subdivided. A limit of <i>n</i> means that
- * for each individual quadratic and cubic B&#xe9;zier spline
- * segment, at most 2<sup><small><i>n</i></small></sup> {@link
- * PathIterator#SEG_LINETO} segments will be created.</li></ul>
- *
- * <p><b>Memory Efficiency:</b> The memory consumption grows linearly
- * with the recursion limit. Neither the <i>flatness</i> parameter nor
- * the number of segments in the flattened path will affect the memory
- * consumption.
- *
- * <p><b>Thread Safety:</b> Multiple threads can safely work on
- * separate instances of this class. However, multiple threads should
- * not concurrently access the same instance, as no synchronization is
- * performed.
- *
- * @see <a href="doc-files/FlatteningPathIterator-1.html"
- * >Implementation Note</a>
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- *
- * @since 1.2
- */
-public class FlatteningPathIterator
- implements PathIterator
-{
- /**
- * The PathIterator whose curved segments are being approximated.
- */
- private final PathIterator srcIter;
-
-
- /**
- * The square of the flatness threshold value, which determines when
- * a curve segment is considered flat enough that no further
- * subdivision is needed.
- *
- * <p>Calculating flatness actually produces the squared flatness
- * value. To avoid the relatively expensive calculation of a square
- * root for each curve segment, we perform all flatness comparisons
- * on squared values.
- *
- * @see QuadCurve2D#getFlatnessSq()
- * @see CubicCurve2D#getFlatnessSq()
- */
- private final double flatnessSq;
-
-
- /**
- * The maximal number of subdivions that are performed to
- * approximate a quadratic or cubic curve segment.
- */
- private final int recursionLimit;
-
-
- /**
- * A stack for holding the coordinates of subdivided segments.
- *
- * @see <a href="doc-files/FlatteningPathIterator-1.html"
- * >Implementation Note</a>
- */
- private double[] stack;
-
-
- /**
- * The current stack size.
- *
- * @see <a href="doc-files/FlatteningPathIterator-1.html"
- * >Implementation Note</a>
- */
- private int stackSize;
-
-
- /**
- * The number of recursions that were performed to arrive at
- * a segment on the stack.
- *
- * @see <a href="doc-files/FlatteningPathIterator-1.html"
- * >Implementation Note</a>
- */
- private int[] recLevel;
-
-
-
- private final double[] scratch = new double[6];
-
-
- /**
- * The segment type of the last segment that was returned by
- * the source iterator.
- */
- private int srcSegType;
-
-
- /**
- * The current <i>x</i> position of the source iterator.
- */
- private double srcPosX;
-
-
- /**
- * The current <i>y</i> position of the source iterator.
- */
- private double srcPosY;
-
-
- /**
- * A flag that indicates when this path iterator has finished its
- * iteration over path segments.
- */
- private boolean done;
-
-
- /**
- * Constructs a new PathIterator for approximating an input
- * PathIterator with straight lines. The approximation works by
- * recursive subdivisons, until the specified flatness threshold is
- * not exceeded.
- *
- * <p>There will not be more than 10 nested recursion steps, which
- * means that a single <code>SEG_QUADTO</code> or
- * <code>SEG_CUBICTO</code> segment is approximated by at most
- * 2<sup><small>10</small></sup> = 1024 straight lines.
- */
- public FlatteningPathIterator(PathIterator src, double flatness)
- {
- this(src, flatness, 10);
- }
-
-
- /**
- * Constructs a new PathIterator for approximating an input
- * PathIterator with straight lines. The approximation works by
- * recursive subdivisons, until the specified flatness threshold is
- * not exceeded. Additionally, the number of recursions is also
- * bound by the specified recursion limit.
- */
- public FlatteningPathIterator(PathIterator src, double flatness,
- int limit)
- {
- if (flatness < 0 || limit < 0)
- throw new IllegalArgumentException();
-
- srcIter = src;
- flatnessSq = flatness * flatness;
- recursionLimit = limit;
- fetchSegment();
- }
-
-
- /**
- * Returns the maximally acceptable flatness.
- *
- * @see QuadCurve2D#getFlatness()
- * @see CubicCurve2D#getFlatness()
- */
- public double getFlatness()
- {
- return Math.sqrt(flatnessSq);
- }
-
-
- /**
- * Returns the maximum number of recursive curve subdivisions.
- */
- public int getRecursionLimit()
- {
- return recursionLimit;
- }
-
-
- // Documentation will be copied from PathIterator.
- public int getWindingRule()
- {
- return srcIter.getWindingRule();
- }
-
-
- // Documentation will be copied from PathIterator.
- public boolean isDone()
- {
- return done;
- }
-
-
- // Documentation will be copied from PathIterator.
- public void next()
- {
- if (stackSize > 0)
- {
- --stackSize;
- if (stackSize > 0)
- {
- switch (srcSegType)
- {
- case PathIterator.SEG_QUADTO:
- subdivideQuadratic();
- return;
-
- case PathIterator.SEG_CUBICTO:
- subdivideCubic();
- return;
-
- default:
- throw new IllegalStateException();
- }
- }
- }
-
- srcIter.next();
- fetchSegment();
- }
-
-
- // Documentation will be copied from PathIterator.
- public int currentSegment(double[] coords)
- {
- if (done)
- throw new NoSuchElementException();
-
- switch (srcSegType)
- {
- case PathIterator.SEG_CLOSE:
- return srcSegType;
-
- case PathIterator.SEG_MOVETO:
- case PathIterator.SEG_LINETO:
- coords[0] = srcPosX;
- coords[1] = srcPosY;
- return srcSegType;
-
- case PathIterator.SEG_QUADTO:
- if (stackSize == 0)
- {
- coords[0] = srcPosX;
- coords[1] = srcPosY;
- }
- else
- {
- int sp = stack.length - 4 * stackSize;
- coords[0] = stack[sp + 2];
- coords[1] = stack[sp + 3];
- }
- return PathIterator.SEG_LINETO;
-
- case PathIterator.SEG_CUBICTO:
- if (stackSize == 0)
- {
- coords[0] = srcPosX;
- coords[1] = srcPosY;
- }
- else
- {
- int sp = stack.length - 6 * stackSize;
- coords[0] = stack[sp + 4];
- coords[1] = stack[sp + 5];
- }
- return PathIterator.SEG_LINETO;
- }
-
- throw new IllegalStateException();
- }
-
-
- // Documentation will be copied from PathIterator.
- public int currentSegment(float[] coords)
- {
- if (done)
- throw new NoSuchElementException();
-
- switch (srcSegType)
- {
- case PathIterator.SEG_CLOSE:
- return srcSegType;
-
- case PathIterator.SEG_MOVETO:
- case PathIterator.SEG_LINETO:
- coords[0] = (float) srcPosX;
- coords[1] = (float) srcPosY;
- return srcSegType;
-
- case PathIterator.SEG_QUADTO:
- if (stackSize == 0)
- {
- coords[0] = (float) srcPosX;
- coords[1] = (float) srcPosY;
- }
- else
- {
- int sp = stack.length - 4 * stackSize;
- coords[0] = (float) stack[sp + 2];
- coords[1] = (float) stack[sp + 3];
- }
- return PathIterator.SEG_LINETO;
-
- case PathIterator.SEG_CUBICTO:
- if (stackSize == 0)
- {
- coords[0] = (float) srcPosX;
- coords[1] = (float) srcPosY;
- }
- else
- {
- int sp = stack.length - 6 * stackSize;
- coords[0] = (float) stack[sp + 4];
- coords[1] = (float) stack[sp + 5];
- }
- return PathIterator.SEG_LINETO;
- }
-
- throw new IllegalStateException();
- }
-
-
- /**
- * Fetches the next segment from the source iterator.
- */
- private void fetchSegment()
- {
- int sp;
-
- if (srcIter.isDone())
- {
- done = true;
- return;
- }
-
- srcSegType = srcIter.currentSegment(scratch);
-
- switch (srcSegType)
- {
- case PathIterator.SEG_CLOSE:
- return;
-
- case PathIterator.SEG_MOVETO:
- case PathIterator.SEG_LINETO:
- srcPosX = scratch[0];
- srcPosY = scratch[1];
- return;
-
- case PathIterator.SEG_QUADTO:
- if (recursionLimit == 0)
- {
- srcPosX = scratch[2];
- srcPosY = scratch[3];
- stackSize = 0;
- return;
- }
- sp = 4 * recursionLimit;
- stackSize = 1;
- if (stack == null)
- {
- stack = new double[sp + /* 4 + 2 */ 6];
- recLevel = new int[recursionLimit + 1];
- }
- recLevel[0] = 0;
- stack[sp] = srcPosX; // P1.x
- stack[sp + 1] = srcPosY; // P1.y
- stack[sp + 2] = scratch[0]; // C.x
- stack[sp + 3] = scratch[1]; // C.y
- srcPosX = stack[sp + 4] = scratch[2]; // P2.x
- srcPosY = stack[sp + 5] = scratch[3]; // P2.y
- subdivideQuadratic();
- break;
-
- case PathIterator.SEG_CUBICTO:
- if (recursionLimit == 0)
- {
- srcPosX = scratch[4];
- srcPosY = scratch[5];
- stackSize = 0;
- return;
- }
- sp = 6 * recursionLimit;
- stackSize = 1;
- if ((stack == null) || (stack.length < sp + 8))
- {
- stack = new double[sp + /* 6 + 2 */ 8];
- recLevel = new int[recursionLimit + 1];
- }
- recLevel[0] = 0;
- stack[sp] = srcPosX; // P1.x
- stack[sp + 1] = srcPosY; // P1.y
- stack[sp + 2] = scratch[0]; // C1.x
- stack[sp + 3] = scratch[1]; // C1.y
- stack[sp + 4] = scratch[2]; // C2.x
- stack[sp + 5] = scratch[3]; // C2.y
- srcPosX = stack[sp + 6] = scratch[4]; // P2.x
- srcPosY = stack[sp + 7] = scratch[5]; // P2.y
- subdivideCubic();
- return;
- }
- }
-
-
- /**
- * Repeatedly subdivides the quadratic curve segment that is on top
- * of the stack. The iteration terminates when the recursion limit
- * has been reached, or when the resulting segment is flat enough.
- */
- private void subdivideQuadratic()
- {
- int sp;
- int level;
-
- sp = stack.length - 4 * stackSize - 2;
- level = recLevel[stackSize - 1];
- while ((level < recursionLimit)
- && (QuadCurve2D.getFlatnessSq(stack, sp) >= flatnessSq))
- {
- recLevel[stackSize] = recLevel[stackSize - 1] = ++level;
- QuadCurve2D.subdivide(stack, sp, stack, sp - 4, stack, sp);
- ++stackSize;
- sp -= 4;
- }
- }
-
-
- /**
- * Repeatedly subdivides the cubic curve segment that is on top
- * of the stack. The iteration terminates when the recursion limit
- * has been reached, or when the resulting segment is flat enough.
- */
- private void subdivideCubic()
- {
- int sp;
- int level;
-
- sp = stack.length - 6 * stackSize - 2;
- level = recLevel[stackSize - 1];
- while ((level < recursionLimit)
- && (CubicCurve2D.getFlatnessSq(stack, sp) >= flatnessSq))
- {
- recLevel[stackSize] = recLevel[stackSize - 1] = ++level;
-
- CubicCurve2D.subdivide(stack, sp, stack, sp - 6, stack, sp);
- ++stackSize;
- sp -= 6;
- }
- }
-
-
- /* These routines were useful for debugging. Since they would
- * just bloat the implementation, they are commented out.
- *
- *
-
- private static String segToString(int segType, double[] d, int offset)
- {
- String s;
-
- switch (segType)
- {
- case PathIterator.SEG_CLOSE:
- return "SEG_CLOSE";
-
- case PathIterator.SEG_MOVETO:
- return "SEG_MOVETO (" + d[offset] + ", " + d[offset + 1] + ")";
-
- case PathIterator.SEG_LINETO:
- return "SEG_LINETO (" + d[offset] + ", " + d[offset + 1] + ")";
-
- case PathIterator.SEG_QUADTO:
- return "SEG_QUADTO (" + d[offset] + ", " + d[offset + 1]
- + ") (" + d[offset + 2] + ", " + d[offset + 3] + ")";
-
- case PathIterator.SEG_CUBICTO:
- return "SEG_CUBICTO (" + d[offset] + ", " + d[offset + 1]
- + ") (" + d[offset + 2] + ", " + d[offset + 3]
- + ") (" + d[offset + 4] + ", " + d[offset + 5] + ")";
- }
-
- throw new IllegalStateException();
- }
-
-
- private void dumpQuadraticStack(String msg)
- {
- int sp = stack.length - 4 * stackSize - 2;
- int i = 0;
- System.err.print(" " + msg + ":");
- while (sp < stack.length)
- {
- System.err.print(" (" + stack[sp] + ", " + stack[sp+1] + ")");
- if (i < recLevel.length)
- System.out.print("/" + recLevel[i++]);
- if (sp + 3 < stack.length)
- System.err.print(" [" + stack[sp+2] + ", " + stack[sp+3] + "]");
- sp += 4;
- }
- System.err.println();
- }
-
-
- private void dumpCubicStack(String msg)
- {
- int sp = stack.length - 6 * stackSize - 2;
- int i = 0;
- System.err.print(" " + msg + ":");
- while (sp < stack.length)
- {
- System.err.print(" (" + stack[sp] + ", " + stack[sp+1] + ")");
- if (i < recLevel.length)
- System.out.print("/" + recLevel[i++]);
- if (sp + 3 < stack.length)
- {
- System.err.print(" [" + stack[sp+2] + ", " + stack[sp+3] + "]");
- System.err.print(" [" + stack[sp+4] + ", " + stack[sp+5] + "]");
- }
- sp += 6;
- }
- System.err.println();
- }
-
- *
- *
- */
-}
diff --git a/libjava/java/awt/geom/GeneralPath.java b/libjava/java/awt/geom/GeneralPath.java
deleted file mode 100644
index f54855874dc..00000000000
--- a/libjava/java/awt/geom/GeneralPath.java
+++ /dev/null
@@ -1,958 +0,0 @@
-/* GeneralPath.java -- represents a shape built from subpaths
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.awt.Rectangle;
-import java.awt.Shape;
-
-
-/**
- * A general geometric path, consisting of any number of subpaths
- * constructed out of straight lines and cubic or quadratic Bezier
- * curves.
- *
- * <p>The inside of the curve is defined for drawing purposes by a winding
- * rule. Either the WIND_EVEN_ODD or WIND_NON_ZERO winding rule can be chosen.
- *
- * <p><img src="doc-files/GeneralPath-1.png" width="300" height="210"
- * alt="A drawing of a GeneralPath" />
- * <p>The EVEN_ODD winding rule defines a point as inside a path if:
- * A ray from the point towards infinity in an arbitrary direction
- * intersects the path an odd number of times. Points <b>A</b> and
- * <b>C</b> in the image are considered to be outside the path.
- * (both intersect twice)
- * Point <b>B</b> intersects once, and is inside.
- *
- * <p>The NON_ZERO winding rule defines a point as inside a path if:
- * The path intersects the ray in an equal number of opposite directions.
- * Point <b>A</b> in the image is outside (one intersection in the
- * &#x2019;up&#x2019;
- * direction, one in the &#x2019;down&#x2019; direction) Point <b>B</b> in
- * the image is inside (one intersection &#x2019;down&#x2019;)
- * Point <b>C</b> in the image is outside (two intersections
- * &#x2019;down&#x2019;)
- *
- * @see Line2D
- * @see CubicCurve2D
- * @see QuadCurve2D
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- * @author Sven de Marothy (sven@physto.se)
- *
- * @since 1.2
- */
-public final class GeneralPath implements Shape, Cloneable
-{
- public static final int WIND_EVEN_ODD = PathIterator.WIND_EVEN_ODD;
- public static final int WIND_NON_ZERO = PathIterator.WIND_NON_ZERO;
-
- /** Initial size if not specified. */
- private static final int INIT_SIZE = 10;
-
- /** A big number, but not so big it can't survive a few float operations */
- private static final double BIG_VALUE = java.lang.Double.MAX_VALUE / 10.0;
-
- /** The winding rule.
- * This is package-private to avoid an accessor method.
- */
- int rule;
-
- /**
- * The path type in points. Note that xpoints[index] and ypoints[index] maps
- * to types[index]; the control points of quad and cubic paths map as
- * well but are ignored.
- * This is package-private to avoid an accessor method.
- */
- byte[] types;
-
- /**
- * The list of all points seen. Since you can only append floats, it makes
- * sense for these to be float[]. I have no idea why Sun didn't choose to
- * allow a general path of double precision points.
- * Note: Storing x and y coords seperately makes for a slower transforms,
- * But it speeds up and simplifies box-intersection checking a lot.
- * These are package-private to avoid accessor methods.
- */
- float[] xpoints;
- float[] ypoints;
-
- /** The index of the most recent moveto point, or null. */
- private int subpath = -1;
-
- /** The next available index into points.
- * This is package-private to avoid an accessor method.
- */
- int index;
-
- /**
- * Constructs a GeneralPath with the default (NON_ZERO)
- * winding rule and initial capacity (20).
- */
- public GeneralPath()
- {
- this(WIND_NON_ZERO, INIT_SIZE);
- }
-
- /**
- * Constructs a GeneralPath with a specific winding rule
- * and the default initial capacity (20).
- * @param rule the winding rule (WIND_NON_ZERO or WIND_EVEN_ODD)
- */
- public GeneralPath(int rule)
- {
- this(rule, INIT_SIZE);
- }
-
- /**
- * Constructs a GeneralPath with a specific winding rule
- * and the initial capacity. The initial capacity should be
- * the approximate number of path segments to be used.
- * @param rule the winding rule (WIND_NON_ZERO or WIND_EVEN_ODD)
- * @param capacity the inital capacity, in path segments
- */
- public GeneralPath(int rule, int capacity)
- {
- if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO)
- throw new IllegalArgumentException();
- this.rule = rule;
- if (capacity < INIT_SIZE)
- capacity = INIT_SIZE;
- types = new byte[capacity];
- xpoints = new float[capacity];
- ypoints = new float[capacity];
- }
-
- /**
- * Constructs a GeneralPath from an arbitrary shape object.
- * The Shapes PathIterator path and winding rule will be used.
- * @param s the shape
- */
- public GeneralPath(Shape s)
- {
- types = new byte[INIT_SIZE];
- xpoints = new float[INIT_SIZE];
- ypoints = new float[INIT_SIZE];
- PathIterator pi = s.getPathIterator(null);
- setWindingRule(pi.getWindingRule());
- append(pi, false);
- }
-
- /**
- * Adds a new point to a path.
- */
- public void moveTo(float x, float y)
- {
- subpath = index;
- ensureSize(index + 1);
- types[index] = PathIterator.SEG_MOVETO;
- xpoints[index] = x;
- ypoints[index++] = y;
- }
-
- /**
- * Appends a straight line to the current path.
- * @param x x coordinate of the line endpoint.
- * @param y y coordinate of the line endpoint.
- */
- public void lineTo(float x, float y)
- {
- ensureSize(index + 1);
- types[index] = PathIterator.SEG_LINETO;
- xpoints[index] = x;
- ypoints[index++] = y;
- }
-
- /**
- * Appends a quadratic Bezier curve to the current path.
- * @param x1 x coordinate of the control point
- * @param y1 y coordinate of the control point
- * @param x2 x coordinate of the curve endpoint.
- * @param y2 y coordinate of the curve endpoint.
- */
- public void quadTo(float x1, float y1, float x2, float y2)
- {
- ensureSize(index + 2);
- types[index] = PathIterator.SEG_QUADTO;
- xpoints[index] = x1;
- ypoints[index++] = y1;
- xpoints[index] = x2;
- ypoints[index++] = y2;
- }
-
- /**
- * Appends a cubic Bezier curve to the current path.
- * @param x1 x coordinate of the first control point
- * @param y1 y coordinate of the first control point
- * @param x2 x coordinate of the second control point
- * @param y2 y coordinate of the second control point
- * @param x3 x coordinate of the curve endpoint.
- * @param y3 y coordinate of the curve endpoint.
- */
- public void curveTo(float x1, float y1, float x2, float y2, float x3,
- float y3)
- {
- ensureSize(index + 3);
- types[index] = PathIterator.SEG_CUBICTO;
- xpoints[index] = x1;
- ypoints[index++] = y1;
- xpoints[index] = x2;
- ypoints[index++] = y2;
- xpoints[index] = x3;
- ypoints[index++] = y3;
- }
-
- /**
- * Closes the current subpath by drawing a line
- * back to the point of the last moveTo.
- */
- public void closePath()
- {
- ensureSize(index + 1);
- types[index] = PathIterator.SEG_CLOSE;
- xpoints[index] = xpoints[subpath];
- ypoints[index++] = ypoints[subpath];
- }
-
- /**
- * Appends the segments of a Shape to the path. If <code>connect</code> is
- * true, the new path segments are connected to the existing one with a line.
- * The winding rule of the Shape is ignored.
- */
- public void append(Shape s, boolean connect)
- {
- append(s.getPathIterator(null), connect);
- }
-
- /**
- * Appends the segments of a PathIterator to this GeneralPath.
- * Optionally, the initial {@link PathIterator#SEG_MOVETO} segment
- * of the appended path is changed into a {@link
- * PathIterator#SEG_LINETO} segment.
- *
- * @param iter the PathIterator specifying which segments shall be
- * appended.
- *
- * @param connect <code>true</code> for substituting the initial
- * {@link PathIterator#SEG_MOVETO} segment by a {@link
- * PathIterator#SEG_LINETO}, or <code>false</code> for not
- * performing any substitution. If this GeneralPath is currently
- * empty, <code>connect</code> is assumed to be <code>false</code>,
- * thus leaving the initial {@link PathIterator#SEG_MOVETO}
- * unchanged.
- */
- public void append(PathIterator iter, boolean connect)
- {
- // A bad implementation of this method had caused Classpath bug #6076.
- float[] f = new float[6];
- while (! iter.isDone())
- {
- switch (iter.currentSegment(f))
- {
- case PathIterator.SEG_MOVETO:
- if (! connect || (index == 0))
- {
- moveTo(f[0], f[1]);
- break;
- }
- if ((index >= 1) && (types[index - 1] == PathIterator.SEG_CLOSE)
- && (f[0] == xpoints[index - 1])
- && (f[1] == ypoints[index - 1]))
- break;
-
- // Fall through.
- case PathIterator.SEG_LINETO:
- lineTo(f[0], f[1]);
- break;
- case PathIterator.SEG_QUADTO:
- quadTo(f[0], f[1], f[2], f[3]);
- break;
- case PathIterator.SEG_CUBICTO:
- curveTo(f[0], f[1], f[2], f[3], f[4], f[5]);
- break;
- case PathIterator.SEG_CLOSE:
- closePath();
- break;
- }
-
- connect = false;
- iter.next();
- }
- }
-
- /**
- * Returns the path&#x2019;s current winding rule.
- */
- public int getWindingRule()
- {
- return rule;
- }
-
- /**
- * Sets the path&#x2019;s winding rule, which controls which areas are
- * considered &#x2019;inside&#x2019; or &#x2019;outside&#x2019; the path
- * on drawing. Valid rules are WIND_EVEN_ODD for an even-odd winding rule,
- * or WIND_NON_ZERO for a non-zero winding rule.
- */
- public void setWindingRule(int rule)
- {
- if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO)
- throw new IllegalArgumentException();
- this.rule = rule;
- }
-
- /**
- * Returns the current appending point of the path.
- */
- public Point2D getCurrentPoint()
- {
- if (subpath < 0)
- return null;
- return new Point2D.Float(xpoints[index - 1], ypoints[index - 1]);
- }
-
- /**
- * Resets the path. All points and segments are destroyed.
- */
- public void reset()
- {
- subpath = -1;
- index = 0;
- }
-
- /**
- * Applies a transform to the path.
- */
- public void transform(AffineTransform xform)
- {
- double nx;
- double ny;
- double[] m = new double[6];
- xform.getMatrix(m);
- for (int i = 0; i < index; i++)
- {
- nx = m[0] * xpoints[i] + m[2] * ypoints[i] + m[4];
- ny = m[1] * xpoints[i] + m[3] * ypoints[i] + m[5];
- xpoints[i] = (float) nx;
- ypoints[i] = (float) ny;
- }
- }
-
- /**
- * Creates a transformed version of the path.
- * @param xform the transform to apply
- * @return a new transformed GeneralPath
- */
- public Shape createTransformedShape(AffineTransform xform)
- {
- GeneralPath p = new GeneralPath(this);
- p.transform(xform);
- return p;
- }
-
- /**
- * Returns the path&#x2019;s bounding box.
- */
- public Rectangle getBounds()
- {
- return getBounds2D().getBounds();
- }
-
- /**
- * Returns the path&#x2019;s bounding box, in <code>float</code> precision
- */
- public Rectangle2D getBounds2D()
- {
- float x1;
- float y1;
- float x2;
- float y2;
-
- if (index > 0)
- {
- x1 = x2 = xpoints[0];
- y1 = y2 = ypoints[0];
- }
- else
- x1 = x2 = y1 = y2 = 0.0f;
-
- for (int i = 0; i < index; i++)
- {
- x1 = Math.min(xpoints[i], x1);
- y1 = Math.min(ypoints[i], y1);
- x2 = Math.max(xpoints[i], x2);
- y2 = Math.max(ypoints[i], y2);
- }
- return (new Rectangle2D.Float(x1, y1, x2 - x1, y2 - y1));
- }
-
- /**
- * Evaluates if a point is within the GeneralPath,
- * The NON_ZERO winding rule is used, regardless of the
- * set winding rule.
- * @param x x coordinate of the point to evaluate
- * @param y y coordinate of the point to evaluate
- * @return true if the point is within the path, false otherwise
- */
- public boolean contains(double x, double y)
- {
- return (getWindingNumber(x, y) != 0);
- }
-
- /**
- * Evaluates if a Point2D is within the GeneralPath,
- * The NON_ZERO winding rule is used, regardless of the
- * set winding rule.
- * @param p The Point2D to evaluate
- * @return true if the point is within the path, false otherwise
- */
- public boolean contains(Point2D p)
- {
- return contains(p.getX(), p.getY());
- }
-
- /**
- * Evaluates if a rectangle is completely contained within the path.
- * This method will return false in the cases when the box
- * intersects an inner segment of the path.
- * (i.e.: The method is accurate for the EVEN_ODD winding rule)
- */
- public boolean contains(double x, double y, double w, double h)
- {
- if (! getBounds2D().intersects(x, y, w, h))
- return false;
-
- /* Does any edge intersect? */
- if (getAxisIntersections(x, y, false, w) != 0 /* top */
- || getAxisIntersections(x, y + h, false, w) != 0 /* bottom */
- || getAxisIntersections(x + w, y, true, h) != 0 /* right */
- || getAxisIntersections(x, y, true, h) != 0) /* left */
- return false;
-
- /* No intersections, is any point inside? */
- if (getWindingNumber(x, y) != 0)
- return true;
-
- return false;
- }
-
- /**
- * Evaluates if a rectangle is completely contained within the path.
- * This method will return false in the cases when the box
- * intersects an inner segment of the path.
- * (i.e.: The method is accurate for the EVEN_ODD winding rule)
- * @param r the rectangle
- * @return <code>true</code> if the rectangle is completely contained
- * within the path, <code>false</code> otherwise
- */
- public boolean contains(Rectangle2D r)
- {
- return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Evaluates if a rectangle intersects the path.
- * @param x x coordinate of the rectangle
- * @param y y coordinate of the rectangle
- * @param w width of the rectangle
- * @param h height of the rectangle
- * @return <code>true</code> if the rectangle intersects the path,
- * <code>false</code> otherwise
- */
- public boolean intersects(double x, double y, double w, double h)
- {
- /* Does any edge intersect? */
- if (getAxisIntersections(x, y, false, w) != 0 /* top */
- || getAxisIntersections(x, y + h, false, w) != 0 /* bottom */
- || getAxisIntersections(x + w, y, true, h) != 0 /* right */
- || getAxisIntersections(x, y, true, h) != 0) /* left */
- return true;
-
- /* No intersections, is any point inside? */
- if (getWindingNumber(x, y) != 0)
- return true;
-
- return false;
- }
-
- /**
- * Evaluates if a Rectangle2D intersects the path.
- * @param r The rectangle
- * @return <code>true</code> if the rectangle intersects the path,
- * <code>false</code> otherwise
- */
- public boolean intersects(Rectangle2D r)
- {
- return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * A PathIterator that iterates over the segments of a GeneralPath.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- private static class GeneralPathIterator implements PathIterator
- {
- /**
- * The number of coordinate values for each segment type.
- */
- private static final int[] NUM_COORDS = {
- /* 0: SEG_MOVETO */ 1,
- /* 1: SEG_LINETO */ 1,
- /* 2: SEG_QUADTO */ 2,
- /* 3: SEG_CUBICTO */ 3,
- /* 4: SEG_CLOSE */ 0};
-
- /**
- * The GeneralPath whose segments are being iterated.
- * This is package-private to avoid an accessor method.
- */
- final GeneralPath path;
-
- /**
- * The affine transformation used to transform coordinates.
- */
- private final AffineTransform transform;
-
- /**
- * The current position of the iterator.
- */
- private int pos;
-
- /**
- * Constructs a new iterator for enumerating the segments of a
- * GeneralPath.
- *
- * @param at an affine transformation for projecting the returned
- * points, or <code>null</code> to return the original points
- * without any mapping.
- */
- GeneralPathIterator(GeneralPath path, AffineTransform transform)
- {
- this.path = path;
- this.transform = transform;
- }
-
- /**
- * Returns the current winding rule of the GeneralPath.
- */
- public int getWindingRule()
- {
- return path.rule;
- }
-
- /**
- * Determines whether the iterator has reached the last segment in
- * the path.
- */
- public boolean isDone()
- {
- return pos >= path.index;
- }
-
- /**
- * Advances the iterator position by one segment.
- */
- public void next()
- {
- int seg;
-
- /*
- * Increment pos by the number of coordinate pairs.
- */
- seg = path.types[pos];
- if (seg == SEG_CLOSE)
- pos++;
- else
- pos += NUM_COORDS[seg];
- }
-
- /**
- * Returns the current segment in float coordinates.
- */
- public int currentSegment(float[] coords)
- {
- int seg;
- int numCoords;
-
- seg = path.types[pos];
- numCoords = NUM_COORDS[seg];
- if (numCoords > 0)
- {
- for (int i = 0; i < numCoords; i++)
- {
- coords[i << 1] = path.xpoints[pos + i];
- coords[(i << 1) + 1] = path.ypoints[pos + i];
- }
-
- if (transform != null)
- transform.transform( /* src */
- coords, /* srcOffset */
- 0, /* dest */ coords, /* destOffset */
- 0, /* numPoints */ numCoords);
- }
- return seg;
- }
-
- /**
- * Returns the current segment in double coordinates.
- */
- public int currentSegment(double[] coords)
- {
- int seg;
- int numCoords;
-
- seg = path.types[pos];
- numCoords = NUM_COORDS[seg];
- if (numCoords > 0)
- {
- for (int i = 0; i < numCoords; i++)
- {
- coords[i << 1] = (double) path.xpoints[pos + i];
- coords[(i << 1) + 1] = (double) path.ypoints[pos + i];
- }
- if (transform != null)
- transform.transform( /* src */
- coords, /* srcOffset */
- 0, /* dest */ coords, /* destOffset */
- 0, /* numPoints */ numCoords);
- }
- return seg;
- }
- }
-
- /**
- * Creates a PathIterator for iterating along the segments of the path.
- *
- * @param at an affine transformation for projecting the returned
- * points, or <code>null</code> to let the created iterator return
- * the original points without any mapping.
- */
- public PathIterator getPathIterator(AffineTransform at)
- {
- return new GeneralPathIterator(this, at);
- }
-
- /**
- * Creates a new FlatteningPathIterator for the path
- */
- public PathIterator getPathIterator(AffineTransform at, double flatness)
- {
- return new FlatteningPathIterator(getPathIterator(at), flatness);
- }
-
- /**
- * Creates a new shape of the same run-time type with the same contents
- * as this one.
- *
- * @return the clone
- *
- * @exception OutOfMemoryError If there is not enough memory available.
- *
- * @since 1.2
- */
- public Object clone()
- {
- // This class is final; no need to use super.clone().
- return new GeneralPath(this);
- }
-
- /**
- * Helper method - ensure the size of the data arrays,
- * otherwise, reallocate new ones twice the size
- */
- private void ensureSize(int size)
- {
- if (subpath < 0)
- throw new IllegalPathStateException("need initial moveto");
- if (size <= xpoints.length)
- return;
- byte[] b = new byte[types.length << 1];
- System.arraycopy(types, 0, b, 0, index);
- types = b;
- float[] f = new float[xpoints.length << 1];
- System.arraycopy(xpoints, 0, f, 0, index);
- xpoints = f;
- f = new float[ypoints.length << 1];
- System.arraycopy(ypoints, 0, f, 0, index);
- ypoints = f;
- }
-
- /**
- * Helper method - Get the total number of intersections from (x,y) along
- * a given axis, within a given distance.
- */
- private int getAxisIntersections(double x, double y, boolean useYaxis,
- double distance)
- {
- return (evaluateCrossings(x, y, false, useYaxis, distance));
- }
-
- /**
- * Helper method - returns the winding number of a point.
- */
- private int getWindingNumber(double x, double y)
- {
- /* Evaluate the crossings from x,y to infinity on the y axis (arbitrary
- choice). Note that we don't actually use Double.INFINITY, since that's
- slower, and may cause problems. */
- return (evaluateCrossings(x, y, true, true, BIG_VALUE));
- }
-
- /**
- * Helper method - evaluates the number of intersections on an axis from
- * the point (x,y) to the point (x,y+distance) or (x+distance,y).
- * @param x x coordinate.
- * @param y y coordinate.
- * @param neg True if opposite-directed intersections should cancel,
- * false to sum all intersections.
- * @param useYaxis Use the Y axis, false uses the X axis.
- * @param distance Interval from (x,y) on the selected axis to find
- * intersections.
- */
- private int evaluateCrossings(double x, double y, boolean neg,
- boolean useYaxis, double distance)
- {
- float cx = 0.0f;
- float cy = 0.0f;
- float firstx = 0.0f;
- float firsty = 0.0f;
-
- int negative = (neg) ? -1 : 1;
- double x0;
- double x1;
- double x2;
- double x3;
- double y0;
- double y1;
- double y2;
- double y3;
- double[] r = new double[4];
- int nRoots;
- double epsilon = 0.0;
- int pos = 0;
- int windingNumber = 0;
- boolean pathStarted = false;
-
- if (index == 0)
- return (0);
- if (useYaxis)
- {
- float[] swap1;
- swap1 = ypoints;
- ypoints = xpoints;
- xpoints = swap1;
- double swap2;
- swap2 = y;
- y = x;
- x = swap2;
- }
-
- /* Get a value which is hopefully small but not insignificant relative
- the path. */
- epsilon = ypoints[0] * 1E-7;
-
- if(epsilon == 0)
- epsilon = 1E-7;
-
- pos = 0;
- while (pos < index)
- {
- switch (types[pos])
- {
- case PathIterator.SEG_MOVETO:
- if (pathStarted) // close old path
- {
- x0 = cx;
- y0 = cy;
- x1 = firstx;
- y1 = firsty;
-
- if (y0 == 0.0)
- y0 -= epsilon;
- if (y1 == 0.0)
- y1 -= epsilon;
- if (Line2D.linesIntersect(x0, y0, x1, y1,
- epsilon, 0.0, distance, 0.0))
- windingNumber += (y1 < y0) ? 1 : negative;
-
- cx = firstx;
- cy = firsty;
- }
- cx = firstx = xpoints[pos] - (float) x;
- cy = firsty = ypoints[pos++] - (float) y;
- pathStarted = true;
- break;
- case PathIterator.SEG_CLOSE:
- x0 = cx;
- y0 = cy;
- x1 = firstx;
- y1 = firsty;
-
- if (y0 == 0.0)
- y0 -= epsilon;
- if (y1 == 0.0)
- y1 -= epsilon;
- if (Line2D.linesIntersect(x0, y0, x1, y1,
- epsilon, 0.0, distance, 0.0))
- windingNumber += (y1 < y0) ? 1 : negative;
-
- cx = firstx;
- cy = firsty;
- pos++;
- pathStarted = false;
- break;
- case PathIterator.SEG_LINETO:
- x0 = cx;
- y0 = cy;
- x1 = xpoints[pos] - (float) x;
- y1 = ypoints[pos++] - (float) y;
-
- if (y0 == 0.0)
- y0 -= epsilon;
- if (y1 == 0.0)
- y1 -= epsilon;
- if (Line2D.linesIntersect(x0, y0, x1, y1,
- epsilon, 0.0, distance, 0.0))
- windingNumber += (y1 < y0) ? 1 : negative;
-
- cx = xpoints[pos - 1] - (float) x;
- cy = ypoints[pos - 1] - (float) y;
- break;
- case PathIterator.SEG_QUADTO:
- x0 = cx;
- y0 = cy;
- x1 = xpoints[pos] - x;
- y1 = ypoints[pos++] - y;
- x2 = xpoints[pos] - x;
- y2 = ypoints[pos++] - y;
-
- /* check if curve may intersect X+ axis. */
- if ((x0 > 0.0 || x1 > 0.0 || x2 > 0.0)
- && (y0 * y1 <= 0 || y1 * y2 <= 0))
- {
- if (y0 == 0.0)
- y0 -= epsilon;
- if (y2 == 0.0)
- y2 -= epsilon;
-
- r[0] = y0;
- r[1] = 2 * (y1 - y0);
- r[2] = (y2 - 2 * y1 + y0);
-
- /* degenerate roots (=tangent points) do not
- contribute to the winding number. */
- if ((nRoots = QuadCurve2D.solveQuadratic(r)) == 2)
- for (int i = 0; i < nRoots; i++)
- {
- float t = (float) r[i];
- if (t > 0.0f && t < 1.0f)
- {
- double crossing = t * t * (x2 - 2 * x1 + x0)
- + 2 * t * (x1 - x0) + x0;
- if (crossing >= 0.0 && crossing <= distance)
- windingNumber += (2 * t * (y2 - 2 * y1 + y0)
- + 2 * (y1 - y0) < 0) ? 1 : negative;
- }
- }
- }
-
- cx = xpoints[pos - 1] - (float) x;
- cy = ypoints[pos - 1] - (float) y;
- break;
- case PathIterator.SEG_CUBICTO:
- x0 = cx;
- y0 = cy;
- x1 = xpoints[pos] - x;
- y1 = ypoints[pos++] - y;
- x2 = xpoints[pos] - x;
- y2 = ypoints[pos++] - y;
- x3 = xpoints[pos] - x;
- y3 = ypoints[pos++] - y;
-
- /* check if curve may intersect X+ axis. */
- if ((x0 > 0.0 || x1 > 0.0 || x2 > 0.0 || x3 > 0.0)
- && (y0 * y1 <= 0 || y1 * y2 <= 0 || y2 * y3 <= 0))
- {
- if (y0 == 0.0)
- y0 -= epsilon;
- if (y3 == 0.0)
- y3 -= epsilon;
-
- r[0] = y0;
- r[1] = 3 * (y1 - y0);
- r[2] = 3 * (y2 + y0 - 2 * y1);
- r[3] = y3 - 3 * y2 + 3 * y1 - y0;
-
- if ((nRoots = CubicCurve2D.solveCubic(r)) != 0)
- for (int i = 0; i < nRoots; i++)
- {
- float t = (float) r[i];
- if (t > 0.0 && t < 1.0)
- {
- double crossing = -(t * t * t) * (x0 - 3 * x1
- + 3 * x2 - x3)
- + 3 * t * t * (x0 - 2 * x1 + x2)
- + 3 * t * (x1 - x0) + x0;
- if (crossing >= 0 && crossing <= distance)
- windingNumber += (3 * t * t * (y3 + 3 * y1
- - 3 * y2 - y0)
- + 6 * t * (y0 - 2 * y1 + y2)
- + 3 * (y1 - y0) < 0) ? 1 : negative;
- }
- }
- }
-
- cx = xpoints[pos - 1] - (float) x;
- cy = ypoints[pos - 1] - (float) y;
- break;
- }
- }
-
- // swap coordinates back
- if (useYaxis)
- {
- float[] swap;
- swap = ypoints;
- ypoints = xpoints;
- xpoints = swap;
- }
- return (windingNumber);
- }
-} // class GeneralPath
-
diff --git a/libjava/java/awt/geom/IllegalPathStateException.java b/libjava/java/awt/geom/IllegalPathStateException.java
deleted file mode 100644
index 4d190c74814..00000000000
--- a/libjava/java/awt/geom/IllegalPathStateException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* IllegalPathStateException.java -- an operation was in an illegal path state
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-/**
- * Thrown when an operation on a path is in an illegal state, such as appending
- * a segment to a <code>GeneralPath</code> without an initial moveto.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @see GeneralPath
- * @status updated to 1.4
- */
-public class IllegalPathStateException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -5158084205220481094L;
-
- /**
- * Create an exception with no message.
- */
- public IllegalPathStateException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param msg the message
- */
- public IllegalPathStateException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/awt/geom/Line2D.java b/libjava/java/awt/geom/Line2D.java
deleted file mode 100644
index e15e7cfe3f5..00000000000
--- a/libjava/java/awt/geom/Line2D.java
+++ /dev/null
@@ -1,1182 +0,0 @@
-/* Line2D.java -- represents a line in 2-D space, plus operations on a line
- Copyright (C) 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.util.NoSuchElementException;
-
-/**
- * Represents a directed line bewteen two points in (x,y) Cartesian space.
- * Remember, on-screen graphics have increasing x from left-to-right, and
- * increasing y from top-to-bottom. The storage is left to subclasses.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @author David Gilbert
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class Line2D implements Shape, Cloneable
-{
- /**
- * The default constructor.
- */
- protected Line2D()
- {
- }
-
- /**
- * Return the x coordinate of the first point.
- *
- * @return the starting x coordinate
- */
- public abstract double getX1();
-
- /**
- * Return the y coordinate of the first point.
- *
- * @return the starting y coordinate
- */
- public abstract double getY1();
-
- /**
- * Return the first point.
- *
- * @return the starting point
- */
- public abstract Point2D getP1();
-
- /**
- * Return the x coordinate of the second point.
- *
- * @return the ending x coordinate
- */
- public abstract double getX2();
-
- /**
- * Return the y coordinate of the second point.
- *
- * @return the ending y coordinate
- */
- public abstract double getY2();
-
- /**
- * Return the second point.
- *
- * @return the ending point
- */
- public abstract Point2D getP2();
-
- /**
- * Set the coordinates of the line to the given coordinates. Loss of
- * precision may occur due to rounding issues.
- *
- * @param x1 the first x coordinate
- * @param y1 the first y coordinate
- * @param x2 the second x coordinate
- * @param y2 the second y coordinate
- */
- public abstract void setLine(double x1, double y1, double x2, double y2);
-
- /**
- * Set the coordinates to the given points.
- *
- * @param p1 the first point
- * @param p2 the second point
- * @throws NullPointerException if either point is null
- */
- public void setLine(Point2D p1, Point2D p2)
- {
- setLine(p1.getX(), p1.getY(), p2.getX(), p2.getY());
- }
-
- /**
- * Set the coordinates to those of the given line.
- *
- * @param l the line to copy
- * @throws NullPointerException if l is null
- */
- public void setLine(Line2D l)
- {
- setLine(l.getX1(), l.getY1(), l.getX2(), l.getY2());
- }
-
- /**
- * Computes the relative rotation direction needed to pivot the line about
- * the first point in order to have the second point colinear with point p.
- * Because of floating point rounding, don't expect this to be a perfect
- * measure of colinearity. The answer is 1 if the line has a shorter rotation
- * in the direction of the positive X axis to the negative Y axis
- * (counter-clockwise in the default Java coordinate system), or -1 if the
- * shortest rotation is in the opposite direction (clockwise). If p
- * is already colinear, the return value is -1 if it lies beyond the first
- * point, 0 if it lies in the segment, or 1 if it lies beyond the second
- * point. If the first and second point are coincident, this returns 0.
- *
- * @param x1 the first x coordinate
- * @param y1 the first y coordinate
- * @param x2 the second x coordinate
- * @param y2 the second y coordinate
- * @param px the reference x coordinate
- * @param py the reference y coordinate
- * @return the relative rotation direction
- */
- public static int relativeCCW(double x1, double y1, double x2, double y2,
- double px, double py)
- {
- if ((x1 == x2 && y1 == y2)
- || (x1 == px && y1 == py))
- return 0; // Coincident points.
- // Translate to the origin.
- x2 -= x1;
- y2 -= y1;
- px -= x1;
- py -= y1;
- double slope2 = y2 / x2;
- double slopep = py / px;
- if (slope2 == slopep || (x2 == 0 && px == 0))
- return y2 > 0 // Colinear.
- ? (py < 0 ? -1 : py > y2 ? 1 : 0)
- : (py > 0 ? -1 : py < y2 ? 1 : 0);
- if (x2 >= 0 && slope2 >= 0)
- return px >= 0 // Quadrant 1.
- ? (slope2 > slopep ? 1 : -1)
- : (slope2 < slopep ? 1 : -1);
- if (y2 > 0)
- return px < 0 // Quadrant 2.
- ? (slope2 > slopep ? 1 : -1)
- : (slope2 < slopep ? 1 : -1);
- if (slope2 >= 0.0)
- return px >= 0 // Quadrant 3.
- ? (slope2 < slopep ? 1 : -1)
- : (slope2 > slopep ? 1 : -1);
- return px < 0 // Quadrant 4.
- ? (slope2 < slopep ? 1 : -1)
- : (slope2 > slopep ? 1 : -1);
- }
-
- /**
- * Computes the relative rotation direction needed to pivot this line about
- * the first point in order to have the second point colinear with point p.
- * Because of floating point rounding, don't expect this to be a perfect
- * measure of colinearity. The answer is 1 if the line has a shorter rotation
- * in the direction of the positive X axis to the negative Y axis
- * (counter-clockwise in the default Java coordinate system), or -1 if the
- * shortest rotation is in the opposite direction (clockwise). If p
- * is already colinear, the return value is -1 if it lies beyond the first
- * point, 0 if it lies in the segment, or 1 if it lies beyond the second
- * point. If the first and second point are coincident, this returns 0.
- *
- * @param px the reference x coordinate
- * @param py the reference y coordinate
- * @return the relative rotation direction
- * @see #relativeCCW(double, double, double, double, double, double)
- */
- public int relativeCCW(double px, double py)
- {
- return relativeCCW(getX1(), getY1(), getX2(), getY2(), px, py);
- }
-
- /**
- * Computes the relative rotation direction needed to pivot this line about
- * the first point in order to have the second point colinear with point p.
- * Because of floating point rounding, don't expect this to be a perfect
- * measure of colinearity. The answer is 1 if the line has a shorter rotation
- * in the direction of the positive X axis to the negative Y axis
- * (counter-clockwise in the default Java coordinate system), or -1 if the
- * shortest rotation is in the opposite direction (clockwise). If p
- * is already colinear, the return value is -1 if it lies beyond the first
- * point, 0 if it lies in the segment, or 1 if it lies beyond the second
- * point. If the first and second point are coincident, this returns 0.
- *
- * @param p the reference point
- * @return the relative rotation direction
- * @throws NullPointerException if p is null
- * @see #relativeCCW(double, double, double, double, double, double)
- */
- public int relativeCCW(Point2D p)
- {
- return relativeCCW(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY());
- }
-
- /**
- * Computes twice the (signed) area of the triangle defined by the three
- * points. This method is used for intersection testing.
- *
- * @param x1 the x-coordinate of the first point.
- * @param y1 the y-coordinate of the first point.
- * @param x2 the x-coordinate of the second point.
- * @param y2 the y-coordinate of the second point.
- * @param x3 the x-coordinate of the third point.
- * @param y3 the y-coordinate of the third point.
- *
- * @return Twice the area.
- */
- private static double area2(double x1, double y1,
- double x2, double y2,
- double x3, double y3)
- {
- return (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);
- }
-
- /**
- * Returns <code>true</code> if (x3, y3) lies between (x1, y1) and (x2, y2),
- * and false otherwise, This test assumes that the three points are
- * collinear, and is used for intersection testing.
- *
- * @param x1 the x-coordinate of the first point.
- * @param y1 the y-coordinate of the first point.
- * @param x2 the x-coordinate of the second point.
- * @param y2 the y-coordinate of the second point.
- * @param x3 the x-coordinate of the third point.
- * @param y3 the y-coordinate of the third point.
- *
- * @return A boolean.
- */
- private static boolean between(double x1, double y1,
- double x2, double y2,
- double x3, double y3)
- {
- if (x1 != x2) {
- return (x1 <= x3 && x3 <= x2) || (x1 >= x3 && x3 >= x2);
- }
- else {
- return (y1 <= y3 && y3 <= y2) || (y1 >= y3 && y3 >= y2);
- }
- }
-
- /**
- * Test if the line segment (x1,y1)-&gt;(x2,y2) intersects the line segment
- * (x3,y3)-&gt;(x4,y4).
- *
- * @param x1 the first x coordinate of the first segment
- * @param y1 the first y coordinate of the first segment
- * @param x2 the second x coordinate of the first segment
- * @param y2 the second y coordinate of the first segment
- * @param x3 the first x coordinate of the second segment
- * @param y3 the first y coordinate of the second segment
- * @param x4 the second x coordinate of the second segment
- * @param y4 the second y coordinate of the second segment
- * @return true if the segments intersect
- */
- public static boolean linesIntersect(double x1, double y1,
- double x2, double y2,
- double x3, double y3,
- double x4, double y4)
- {
- double a1, a2, a3, a4;
-
- // deal with special cases
- if ((a1 = area2(x1, y1, x2, y2, x3, y3)) == 0.0)
- {
- // check if p3 is between p1 and p2 OR
- // p4 is collinear also AND either between p1 and p2 OR at opposite ends
- if (between(x1, y1, x2, y2, x3, y3))
- {
- return true;
- }
- else
- {
- if (area2(x1, y1, x2, y2, x4, y4) == 0.0)
- {
- return between(x3, y3, x4, y4, x1, y1)
- || between (x3, y3, x4, y4, x2, y2);
- }
- else {
- return false;
- }
- }
- }
- else if ((a2 = area2(x1, y1, x2, y2, x4, y4)) == 0.0)
- {
- // check if p4 is between p1 and p2 (we already know p3 is not
- // collinear)
- return between(x1, y1, x2, y2, x4, y4);
- }
-
- if ((a3 = area2(x3, y3, x4, y4, x1, y1)) == 0.0) {
- // check if p1 is between p3 and p4 OR
- // p2 is collinear also AND either between p1 and p2 OR at opposite ends
- if (between(x3, y3, x4, y4, x1, y1)) {
- return true;
- }
- else {
- if (area2(x3, y3, x4, y4, x2, y2) == 0.0) {
- return between(x1, y1, x2, y2, x3, y3)
- || between (x1, y1, x2, y2, x4, y4);
- }
- else {
- return false;
- }
- }
- }
- else if ((a4 = area2(x3, y3, x4, y4, x2, y2)) == 0.0) {
- // check if p2 is between p3 and p4 (we already know p1 is not
- // collinear)
- return between(x3, y3, x4, y4, x2, y2);
- }
- else { // test for regular intersection
- return ((a1 > 0.0) ^ (a2 > 0.0)) && ((a3 > 0.0) ^ (a4 > 0.0));
- }
- }
-
- /**
- * Test if this line intersects the line given by (x1,y1)-&gt;(x2,y2).
- *
- * @param x1 the first x coordinate of the other segment
- * @param y1 the first y coordinate of the other segment
- * @param x2 the second x coordinate of the other segment
- * @param y2 the second y coordinate of the other segment
- * @return true if the segments intersect
- * @see #linesIntersect(double, double, double, double,
- * double, double, double, double)
- */
- public boolean intersectsLine(double x1, double y1, double x2, double y2)
- {
- return linesIntersect(getX1(), getY1(), getX2(), getY2(),
- x1, y1, x2, y2);
- }
-
- /**
- * Test if this line intersects the given line.
- *
- * @param l the other segment
- * @return true if the segments intersect
- * @throws NullPointerException if l is null
- * @see #linesIntersect(double, double, double, double,
- * double, double, double, double)
- */
- public boolean intersectsLine(Line2D l)
- {
- return linesIntersect(getX1(), getY1(), getX2(), getY2(),
- l.getX1(), l.getY1(), l.getX2(), l.getY2());
- }
-
- /**
- * Measures the square of the shortest distance from the reference point
- * to a point on the line segment. If the point is on the segment, the
- * result will be 0.
- *
- * @param x1 the first x coordinate of the segment
- * @param y1 the first y coordinate of the segment
- * @param x2 the second x coordinate of the segment
- * @param y2 the second y coordinate of the segment
- * @param px the x coordinate of the point
- * @param py the y coordinate of the point
- * @return the square of the distance from the point to the segment
- * @see #ptSegDist(double, double, double, double, double, double)
- * @see #ptLineDistSq(double, double, double, double, double, double)
- */
- public static double ptSegDistSq(double x1, double y1, double x2, double y2,
- double px, double py)
- {
- double pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
-
- double x, y;
- if (pd2 == 0)
- {
- // Points are coincident.
- x = x1;
- y = y2;
- }
- else
- {
- double u = ((px - x1) * (x2 - x1) + (py - y1) * (y2 - y1)) / pd2;
-
- if (u < 0)
- {
- // "Off the end"
- x = x1;
- y = y1;
- }
- else if (u > 1.0)
- {
- x = x2;
- y = y2;
- }
- else
- {
- x = x1 + u * (x2 - x1);
- y = y1 + u * (y2 - y1);
- }
- }
-
- return (x - px) * (x - px) + (y - py) * (y - py);
- }
-
- /**
- * Measures the shortest distance from the reference point to a point on
- * the line segment. If the point is on the segment, the result will be 0.
- *
- * @param x1 the first x coordinate of the segment
- * @param y1 the first y coordinate of the segment
- * @param x2 the second x coordinate of the segment
- * @param y2 the second y coordinate of the segment
- * @param px the x coordinate of the point
- * @param py the y coordinate of the point
- * @return the distance from the point to the segment
- * @see #ptSegDistSq(double, double, double, double, double, double)
- * @see #ptLineDist(double, double, double, double, double, double)
- */
- public static double ptSegDist(double x1, double y1, double x2, double y2,
- double px, double py)
- {
- return Math.sqrt(ptSegDistSq(x1, y1, x2, y2, px, py));
- }
-
- /**
- * Measures the square of the shortest distance from the reference point
- * to a point on this line segment. If the point is on the segment, the
- * result will be 0.
- *
- * @param px the x coordinate of the point
- * @param py the y coordinate of the point
- * @return the square of the distance from the point to the segment
- * @see #ptSegDistSq(double, double, double, double, double, double)
- */
- public double ptSegDistSq(double px, double py)
- {
- return ptSegDistSq(getX1(), getY1(), getX2(), getY2(), px, py);
- }
-
- /**
- * Measures the square of the shortest distance from the reference point
- * to a point on this line segment. If the point is on the segment, the
- * result will be 0.
- *
- * @param p the point
- * @return the square of the distance from the point to the segment
- * @throws NullPointerException if p is null
- * @see #ptSegDistSq(double, double, double, double, double, double)
- */
- public double ptSegDistSq(Point2D p)
- {
- return ptSegDistSq(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY());
- }
-
- /**
- * Measures the shortest distance from the reference point to a point on
- * this line segment. If the point is on the segment, the result will be 0.
- *
- * @param px the x coordinate of the point
- * @param py the y coordinate of the point
- * @return the distance from the point to the segment
- * @see #ptSegDist(double, double, double, double, double, double)
- */
- public double ptSegDist(double px, double py)
- {
- return ptSegDist(getX1(), getY1(), getX2(), getY2(), px, py);
- }
-
- /**
- * Measures the shortest distance from the reference point to a point on
- * this line segment. If the point is on the segment, the result will be 0.
- *
- * @param p the point
- * @return the distance from the point to the segment
- * @throws NullPointerException if p is null
- * @see #ptSegDist(double, double, double, double, double, double)
- */
- public double ptSegDist(Point2D p)
- {
- return ptSegDist(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY());
- }
-
- /**
- * Measures the square of the shortest distance from the reference point
- * to a point on the infinite line extended from the segment. If the point
- * is on the segment, the result will be 0. If the segment is length 0,
- * the distance is to the common endpoint.
- *
- * @param x1 the first x coordinate of the segment
- * @param y1 the first y coordinate of the segment
- * @param x2 the second x coordinate of the segment
- * @param y2 the second y coordinate of the segment
- * @param px the x coordinate of the point
- * @param py the y coordinate of the point
- * @return the square of the distance from the point to the extended line
- * @see #ptLineDist(double, double, double, double, double, double)
- * @see #ptSegDistSq(double, double, double, double, double, double)
- */
- public static double ptLineDistSq(double x1, double y1, double x2, double y2,
- double px, double py)
- {
- double pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
-
- double x, y;
- if (pd2 == 0)
- {
- // Points are coincident.
- x = x1;
- y = y2;
- }
- else
- {
- double u = ((px - x1) * (x2 - x1) + (py - y1) * (y2 - y1)) / pd2;
- x = x1 + u * (x2 - x1);
- y = y1 + u * (y2 - y1);
- }
-
- return (x - px) * (x - px) + (y - py) * (y - py);
- }
-
- /**
- * Measures the shortest distance from the reference point to a point on
- * the infinite line extended from the segment. If the point is on the
- * segment, the result will be 0. If the segment is length 0, the distance
- * is to the common endpoint.
- *
- * @param x1 the first x coordinate of the segment
- * @param y1 the first y coordinate of the segment
- * @param x2 the second x coordinate of the segment
- * @param y2 the second y coordinate of the segment
- * @param px the x coordinate of the point
- * @param py the y coordinate of the point
- * @return the distance from the point to the extended line
- * @see #ptLineDistSq(double, double, double, double, double, double)
- * @see #ptSegDist(double, double, double, double, double, double)
- */
- public static double ptLineDist(double x1, double y1,
- double x2, double y2,
- double px, double py)
- {
- return Math.sqrt(ptLineDistSq(x1, y1, x2, y2, px, py));
- }
-
- /**
- * Measures the square of the shortest distance from the reference point
- * to a point on the infinite line extended from this segment. If the point
- * is on the segment, the result will be 0. If the segment is length 0,
- * the distance is to the common endpoint.
- *
- * @param px the x coordinate of the point
- * @param py the y coordinate of the point
- * @return the square of the distance from the point to the extended line
- * @see #ptLineDistSq(double, double, double, double, double, double)
- */
- public double ptLineDistSq(double px, double py)
- {
- return ptLineDistSq(getX1(), getY1(), getX2(), getY2(), px, py);
- }
-
- /**
- * Measures the square of the shortest distance from the reference point
- * to a point on the infinite line extended from this segment. If the point
- * is on the segment, the result will be 0. If the segment is length 0,
- * the distance is to the common endpoint.
- *
- * @param p the point
- * @return the square of the distance from the point to the extended line
- * @throws NullPointerException if p is null
- * @see #ptLineDistSq(double, double, double, double, double, double)
- */
- public double ptLineDistSq(Point2D p)
- {
- return ptLineDistSq(getX1(), getY1(), getX2(), getY2(),
- p.getX(), p.getY());
- }
-
- /**
- * Measures the shortest distance from the reference point to a point on
- * the infinite line extended from this segment. If the point is on the
- * segment, the result will be 0. If the segment is length 0, the distance
- * is to the common endpoint.
- *
- * @param px the x coordinate of the point
- * @param py the y coordinate of the point
- * @return the distance from the point to the extended line
- * @see #ptLineDist(double, double, double, double, double, double)
- */
- public double ptLineDist(double px, double py)
- {
- return ptLineDist(getX1(), getY1(), getX2(), getY2(), px, py);
- }
-
- /**
- * Measures the shortest distance from the reference point to a point on
- * the infinite line extended from this segment. If the point is on the
- * segment, the result will be 0. If the segment is length 0, the distance
- * is to the common endpoint.
- *
- * @param p the point
- * @return the distance from the point to the extended line
- * @throws NullPointerException if p is null
- * @see #ptLineDist(double, double, double, double, double, double)
- */
- public double ptLineDist(Point2D p)
- {
- return ptLineDist(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY());
- }
-
- /**
- * Test if a point is contained inside the line. Since a line has no area,
- * this returns false.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @return false; the line does not contain points
- */
- public boolean contains(double x, double y)
- {
- return false;
- }
-
- /**
- * Test if a point is contained inside the line. Since a line has no area,
- * this returns false.
- *
- * @param p the point
- * @return false; the line does not contain points
- */
- public boolean contains(Point2D p)
- {
- return false;
- }
-
- /**
- * Tests if this line intersects the interior of the specified rectangle.
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @return true if the line intersects the rectangle
- */
- public boolean intersects(double x, double y, double w, double h)
- {
- if (w <= 0 || h <= 0)
- return false;
- double x1 = getX1();
- double y1 = getY1();
- double x2 = getX2();
- double y2 = getY2();
-
- if (x1 >= x && x1 <= x + w && y1 >= y && y1 <= y + h)
- return true;
- if (x2 >= x && x2 <= x + w && y2 >= y && y2 <= y + h)
- return true;
-
- double x3 = x + w;
- double y3 = y + h;
-
- return (linesIntersect(x1, y1, x2, y2, x, y, x, y3)
- || linesIntersect(x1, y1, x2, y2, x, y3, x3, y3)
- || linesIntersect(x1, y1, x2, y2, x3, y3, x3, y)
- || linesIntersect(x1, y1, x2, y2, x3, y, x, y));
- }
-
- /**
- * Tests if this line intersects the interior of the specified rectangle.
- *
- * @param r the rectangle
- * @return true if the line intersects the rectangle
- * @throws NullPointerException if r is null
- */
- public boolean intersects(Rectangle2D r)
- {
- return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Tests if the line contains a rectangle. Since lines have no area, this
- * always returns false.
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @return false; the line does not contain points
- */
- public boolean contains(double x, double y, double w, double h)
- {
- return false;
- }
-
- /**
- * Tests if the line contains a rectangle. Since lines have no area, this
- * always returns false.
- *
- * @param r the rectangle
- * @return false; the line does not contain points
- */
- public boolean contains(Rectangle2D r)
- {
- return false;
- }
-
- /**
- * Gets a bounding box (not necessarily minimal) for this line.
- *
- * @return the integer bounding box
- * @see #getBounds2D()
- */
- public Rectangle getBounds()
- {
- return getBounds2D().getBounds();
- }
-
- /**
- * Return a path iterator, possibly applying a transform on the result. This
- * iterator is not threadsafe.
- *
- * @param at the transform, or null
- * @return a new path iterator
- */
- public PathIterator getPathIterator(final AffineTransform at)
- {
- return new PathIterator()
- {
- /** Current coordinate. */
- private int current = 0;
-
- public int getWindingRule()
- {
- return WIND_NON_ZERO;
- }
-
- public boolean isDone()
- {
- return current >= 2;
- }
-
- public void next()
- {
- current++;
- }
-
- public int currentSegment(float[] coords)
- {
- int result;
- switch (current)
- {
- case 0:
- coords[0] = (float) getX1();
- coords[1] = (float) getY1();
- result = SEG_MOVETO;
- break;
- case 1:
- coords[0] = (float) getX2();
- coords[1] = (float) getY2();
- result = SEG_LINETO;
- break;
- default:
- throw new NoSuchElementException("line iterator out of bounds");
- }
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return result;
- }
-
- public int currentSegment(double[] coords)
- {
- int result;
- switch (current)
- {
- case 0:
- coords[0] = getX1();
- coords[1] = getY1();
- result = SEG_MOVETO;
- break;
- case 1:
- coords[0] = getX2();
- coords[1] = getY2();
- result = SEG_LINETO;
- break;
- default:
- throw new NoSuchElementException("line iterator out of bounds");
- }
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return result;
- }
- };
- }
-
- /**
- * Return a flat path iterator, possibly applying a transform on the result.
- * This iterator is not threadsafe.
- *
- * @param at the transform, or null
- * @param flatness ignored, since lines are already flat
- * @return a new path iterator
- * @see #getPathIterator(AffineTransform)
- */
- public PathIterator getPathIterator(AffineTransform at, double flatness)
- {
- return getPathIterator(at);
- }
-
- /**
- * Create a new line of the same run-time type with the same contents as
- * this one.
- *
- * @return the clone
- *
- * @exception OutOfMemoryError If there is not enough memory available.
- *
- * @since 1.2
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-
- /**
- * This class defines a point in <code>double</code> precision.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
- public static class Double extends Line2D
- {
- /** The x coordinate of the first point. */
- public double x1;
-
- /** The y coordinate of the first point. */
- public double y1;
-
- /** The x coordinate of the second point. */
- public double x2;
-
- /** The y coordinate of the second point. */
- public double y2;
-
- /**
- * Construct the line segment (0,0)-&gt;(0,0).
- */
- public Double()
- {
- }
-
- /**
- * Construct the line segment with the specified points.
- *
- * @param x1 the x coordinate of the first point
- * @param y1 the y coordinate of the first point
- * @param x2 the x coordinate of the second point
- * @param y2 the y coordinate of the second point
- */
- public Double(double x1, double y1, double x2, double y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Construct the line segment with the specified points.
- *
- * @param p1 the first point
- * @param p2 the second point
- * @throws NullPointerException if either point is null
- */
- public Double(Point2D p1, Point2D p2)
- {
- x1 = p1.getX();
- y1 = p1.getY();
- x2 = p2.getX();
- y2 = p2.getY();
- }
-
- /**
- * Return the x coordinate of the first point.
- *
- * @return the value of x1
- */
- public double getX1()
- {
- return x1;
- }
-
- /**
- * Return the y coordinate of the first point.
- *
- * @return the value of y1
- */
- public double getY1()
- {
- return y1;
- }
-
- /**
- * Return the first point.
- *
- * @return the point (x1,y1)
- */
- public Point2D getP1()
- {
- return new Point2D.Double(x1, y1);
- }
-
- /**
- * Return the x coordinate of the second point.
- *
- * @return the value of x2
- */
- public double getX2()
- {
- return x2;
- }
-
- /**
- * Return the y coordinate of the second point.
- *
- * @return the value of y2
- */
- public double getY2()
- {
- return y2;
- }
-
- /**
- * Return the second point.
- *
- * @return the point (x2,y2)
- */
- public Point2D getP2()
- {
- return new Point2D.Double(x2, y2);
- }
-
- /**
- * Set this line to the given points.
- *
- * @param x1 the new x coordinate of the first point
- * @param y1 the new y coordinate of the first point
- * @param x2 the new x coordinate of the second point
- * @param y2 the new y coordinate of the second point
- */
- public void setLine(double x1, double y1, double x2, double y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Return the exact bounds of this line segment.
- *
- * @return the bounding box
- */
- public Rectangle2D getBounds2D()
- {
- double x = Math.min(x1, x2);
- double y = Math.min(y1, y2);
- double w = Math.abs(x1 - x2);
- double h = Math.abs(y1 - y2);
- return new Rectangle2D.Double(x, y, w, h);
- }
- } // class Double
-
- /**
- * This class defines a point in <code>float</code> precision.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
- public static class Float extends Line2D
- {
- /** The x coordinate of the first point. */
- public float x1;
-
- /** The y coordinate of the first point. */
- public float y1;
-
- /** The x coordinate of the second point. */
- public float x2;
-
- /** The y coordinate of the second point. */
- public float y2;
-
- /**
- * Construct the line segment (0,0)-&gt;(0,0).
- */
- public Float()
- {
- }
-
- /**
- * Construct the line segment with the specified points.
- *
- * @param x1 the x coordinate of the first point
- * @param y1 the y coordinate of the first point
- * @param x2 the x coordinate of the second point
- * @param y2 the y coordinate of the second point
- */
- public Float(float x1, float y1, float x2, float y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Construct the line segment with the specified points.
- *
- * @param p1 the first point
- * @param p2 the second point
- * @throws NullPointerException if either point is null
- */
- public Float(Point2D p1, Point2D p2)
- {
- x1 = (float) p1.getX();
- y1 = (float) p1.getY();
- x2 = (float) p2.getX();
- y2 = (float) p2.getY();
- }
-
- /**
- * Return the x coordinate of the first point.
- *
- * @return the value of x1
- */
- public double getX1()
- {
- return x1;
- }
-
- /**
- * Return the y coordinate of the first point.
- *
- * @return the value of y1
- */
- public double getY1()
- {
- return y1;
- }
-
- /**
- * Return the first point.
- *
- * @return the point (x1,y1)
- */
- public Point2D getP1()
- {
- return new Point2D.Float(x1, y1);
- }
-
- /**
- * Return the x coordinate of the second point.
- *
- * @return the value of x2
- */
- public double getX2()
- {
- return x2;
- }
-
- /**
- * Return the y coordinate of the second point.
- *
- * @return the value of y2
- */
- public double getY2()
- {
- return y2;
- }
-
- /**
- * Return the second point.
- *
- * @return the point (x2,y2)
- */
- public Point2D getP2()
- {
- return new Point2D.Float(x2, y2);
- }
-
- /**
- * Set this line to the given points.
- *
- * @param x1 the new x coordinate of the first point
- * @param y1 the new y coordinate of the first point
- * @param x2 the new x coordinate of the second point
- * @param y2 the new y coordinate of the second point
- */
- public void setLine(double x1, double y1, double x2, double y2)
- {
- this.x1 = (float) x1;
- this.y1 = (float) y1;
- this.x2 = (float) x2;
- this.y2 = (float) y2;
- }
-
- /**
- * Set this line to the given points.
- *
- * @param x1 the new x coordinate of the first point
- * @param y1 the new y coordinate of the first point
- * @param x2 the new x coordinate of the second point
- * @param y2 the new y coordinate of the second point
- */
- public void setLine(float x1, float y1, float x2, float y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Return the exact bounds of this line segment.
- *
- * @return the bounding box
- */
- public Rectangle2D getBounds2D()
- {
- float x = Math.min(x1, x2);
- float y = Math.min(y1, y2);
- float w = Math.abs(x1 - x2);
- float h = Math.abs(y1 - y2);
- return new Rectangle2D.Float(x, y, w, h);
- }
- } // class Float
-} // class Line2D
diff --git a/libjava/java/awt/geom/NoninvertibleTransformException.java b/libjava/java/awt/geom/NoninvertibleTransformException.java
deleted file mode 100644
index 7995a52eb61..00000000000
--- a/libjava/java/awt/geom/NoninvertibleTransformException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* NoninvertibleTransformException.java -- a transform can't be inverted
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-/**
- * Thrown if an operation requires an inverse of an
- * <code>AffineTransform</code>, but the transform is in a non-invertible
- * state.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @see AffineTransform
- * @status updated to 1.4
- */
-public class NoninvertibleTransformException extends Exception
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 6137225240503990466L;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public NoninvertibleTransformException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/awt/geom/PathIterator.java b/libjava/java/awt/geom/PathIterator.java
deleted file mode 100644
index 2cd08b9b48b..00000000000
--- a/libjava/java/awt/geom/PathIterator.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* PathIterator.java -- describes a shape by iterating over its vertices
- Copyright (C) 2000, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-/**
- * This interface provides a directed path over the boundary of a shape. The
- * path can contain 1st through 3rd order Bezier curves (lines, and quadratic
- * and cubic splines). A shape can have multiple disjoint paths via the
- * MOVETO directive, and can close a circular path back to the previos
- * MOVETO via the CLOSE directive.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see java.awt.Shape
- * @see java.awt.Stroke
- * @see FlatteningPathIterator
- * @since 1.2
- * @status updated to 1.4
- */
-public interface PathIterator
-{
- /**
- * The even-odd winding mode: a point is internal to the shape if a ray
- * from the point to infinity (in any direction) crosses an odd number of
- * segments.
- */
- int WIND_EVEN_ODD = 0;
-
- /**
- * The non-zero winding mode: a point is internal to the shape if a ray
- * from the point to infinity (in any direction) crosses a different number
- * of segments headed clockwise than those headed counterclockwise.
- */
- int WIND_NON_ZERO = 1;
-
- /**
- * Starts a new subpath. There is no segment from the previous vertex.
- */
- int SEG_MOVETO = 0;
-
- /**
- * The current segment is a line.
- */
- int SEG_LINETO = 1;
-
- /**
- * The current segment is a quadratic parametric curve. It is interpolated
- * as t varies from 0 to 1 over the current point (CP), first control point
- * (P1), and final interpolated control point (P2):
- * <pre>
- * P(t) = B(2,0)*CP + B(2,1)*P1 + B(2,2)*P2
- * 0 &lt;= t &lt;= 1
- * B(n,m) = mth coefficient of nth degree Bernstein polynomial
- * = C(n,m) * t^(m) * (1 - t)^(n-m)
- * C(n,m) = Combinations of n things, taken m at a time
- * = n! / (m! * (n-m)!)
- * </pre>
- */
- int SEG_QUADTO = 2;
-
- /**
- * The current segment is a cubic parametric curve (more commonly known as
- * a Bezier curve). It is interpolated as t varies from 0 to 1 over the
- * current point (CP), first control point (P1), the second control point
- * (P2), and final interpolated control point (P3):
- * <pre>
- * P(t) = B(3,0)*CP + B(3,1)*P1 + B(3,2)*P2 + B(3,3)*P3
- * 0 &lt;= t &lt;= 1
- * B(n,m) = mth coefficient of nth degree Bernstein polynomial
- * = C(n,m) * t^(m) * (1 - t)^(n-m)
- * C(n,m) = Combinations of n things, taken m at a time
- * = n! / (m! * (n-m)!)
- * </pre>
- */
- int SEG_CUBICTO = 3;
-
- /**
- * The current segment closes a loop by an implicit line to the previous
- * SEG_MOVETO coordinate.
- */
- int SEG_CLOSE = 4;
-
- /**
- * Returns the winding rule to determine which points are inside this path.
- *
- * @return the winding rule
- * @see #WIND_EVEN_ODD
- * @see #WIND_NON_ZERO
- */
- int getWindingRule();
-
- /**
- * Tests if the iterator is exhausted. If this returns true, currentSegment
- * and next may throw a NoSuchElementException (although this is not
- * required).
- *
- * @return true if the iteration is complete
- */
- boolean isDone();
-
- /**
- * Advance to the next segment in the iteration. It is not specified what
- * this does if called when isDone() returns true.
- *
- * @throws java.util.NoSuchElementException optional when isDone() is true
- */
- void next();
-
- /**
- * Returns the coordinates of the next point(s), as well as the type of
- * line segment. The input array must be at least a float[6], to accomodate
- * up to three (x,y) point pairs (although if you know the iterator is
- * flat, you can probably get by with a float[2]). If the returned type is
- * SEG_MOVETO or SEG_LINETO, the first point in the array is modified; if
- * the returned type is SEG_QUADTO, the first two points are modified; if
- * the returned type is SEG_CUBICTO, all three points are modified; and if
- * the returned type is SEG_CLOSE, the array is untouched.
- *
- * @param coords the array to place the point coordinates in
- * @return the segment type
- * @throws NullPointerException if coords is null
- * @throws ArrayIndexOutOfBoundsException if coords is too small
- * @throws java.util.NoSuchElementException optional when isDone() is true
- * @see #SEG_MOVETO
- * @see #SEG_LINETO
- * @see #SEG_QUADTO
- * @see #SEG_CUBICTO
- * @see #SEG_CLOSE
- */
- int currentSegment(float[] coords);
-
- /**
- * Returns the coordinates of the next point(s), as well as the type of
- * line segment. The input array must be at least a double[6], to accomodate
- * up to three (x,y) point pairs (although if you know the iterator is
- * flat, you can probably get by with a double[2]). If the returned type is
- * SEG_MOVETO or SEG_LINETO, the first point in the array is modified; if
- * the returned type is SEG_QUADTO, the first two points are modified; if
- * the returned type is SEG_CUBICTO, all three points are modified; and if
- * the returned type is SEG_CLOSE, the array is untouched.
- *
- * @param coords the array to place the point coordinates in
- * @return the segment type
- * @throws NullPointerException if coords is null
- * @throws ArrayIndexOutOfBoundsException if coords is too small
- * @throws java.util.NoSuchElementException optional when isDone() is true
- * @see #SEG_MOVETO
- * @see #SEG_LINETO
- * @see #SEG_QUADTO
- * @see #SEG_CUBICTO
- * @see #SEG_CLOSE
- */
- int currentSegment(double[] coords);
-} // interface PathIterator
diff --git a/libjava/java/awt/geom/Point2D.java b/libjava/java/awt/geom/Point2D.java
deleted file mode 100644
index 9f22a5a67c9..00000000000
--- a/libjava/java/awt/geom/Point2D.java
+++ /dev/null
@@ -1,396 +0,0 @@
-/* Point2D.java -- generic point in 2-D space
- Copyright (C) 1999, 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-/**
- * This class implements a generic point in 2D Cartesian space. The storage
- * representation is left up to the subclass. Point includes two useful
- * nested classes, for float and double storage respectively.
- *
- * @author Per Bothner (bothner@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class Point2D implements Cloneable
-{
- /**
- * The default constructor.
- *
- * @see java.awt.Point
- * @see Point2D.Float
- * @see Point2D.Double
- */
- protected Point2D()
- {
- }
-
- /**
- * Get the X coordinate, in double precision.
- *
- * @return the x coordinate
- */
- public abstract double getX();
-
- /**
- * Get the Y coordinate, in double precision.
- *
- * @return the y coordinate
- */
- public abstract double getY();
-
- /**
- * Set the location of this point to the new coordinates. There may be a
- * loss of precision.
- *
- * @param x the new x coordinate
- * @param y the new y coordinate
- */
- public abstract void setLocation(double x, double y);
-
- /**
- * Set the location of this point to the new coordinates. There may be a
- * loss of precision.
- *
- * @param p the point to copy
- * @throws NullPointerException if p is null
- */
- public void setLocation(Point2D p)
- {
- setLocation(p.getX(), p.getY());
- }
-
- /**
- * Return the square of the distance between two points.
- *
- * @param x1 the x coordinate of point 1
- * @param y1 the y coordinate of point 1
- * @param x2 the x coordinate of point 2
- * @param y2 the y coordinate of point 2
- * @return (x2 - x1)^2 + (y2 - y1)^2
- */
- public static double distanceSq(double x1, double y1, double x2, double y2)
- {
- x2 -= x1;
- y2 -= y1;
- return x2 * x2 + y2 * y2;
- }
-
- /**
- * Return the distance between two points.
- *
- * @param x1 the x coordinate of point 1
- * @param y1 the y coordinate of point 1
- * @param x2 the x coordinate of point 2
- * @param y2 the y coordinate of point 2
- * @return the distance from (x1,y1) to (x2,y2)
- */
- public static double distance(double x1, double y1, double x2, double y2)
- {
- return Math.sqrt(distanceSq(x1, y1, x2, y2));
- }
-
- /**
- * Return the square of the distance from this point to the given one.
- *
- * @param x the x coordinate of the other point
- * @param y the y coordinate of the other point
- * @return the square of the distance
- */
- public double distanceSq(double x, double y)
- {
- return distanceSq(getX(), x, getY(), y);
- }
-
- /**
- * Return the square of the distance from this point to the given one.
- *
- * @param p the other point
- * @return the square of the distance
- * @throws NullPointerException if p is null
- */
- public double distanceSq(Point2D p)
- {
- return distanceSq(getX(), p.getX(), getY(), p.getY());
- }
-
- /**
- * Return the distance from this point to the given one.
- *
- * @param x the x coordinate of the other point
- * @param y the y coordinate of the other point
- * @return the distance
- */
- public double distance(double x, double y)
- {
- return distance(getX(), x, getY(), y);
- }
-
- /**
- * Return the distance from this point to the given one.
- *
- * @param p the other point
- * @return the distance
- * @throws NullPointerException if p is null
- */
- public double distance(Point2D p)
- {
- return distance(getX(), p.getX(), getY(), p.getY());
- }
-
- /**
- * Create a new point of the same run-time type with the same contents as
- * this one.
- *
- * @return the clone
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-
- /**
- * Return the hashcode for this point. The formula is not documented, but
- * appears to be the same as:
- * <pre>
- * long l = Double.doubleToLongBits(getY());
- * l = l * 31 ^ Double.doubleToLongBits(getX());
- * return (int) ((l >> 32) ^ l);
- * </pre>
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- // Talk about a fun time reverse engineering this one!
- long l = java.lang.Double.doubleToLongBits(getY());
- l = l * 31 ^ java.lang.Double.doubleToLongBits(getX());
- return (int) ((l >> 32) ^ l);
- }
-
- /**
- * Compares two points for equality. This returns true if they have the
- * same coordinates.
- *
- * @param o the point to compare
- * @return true if it is equal
- */
- public boolean equals(Object o)
- {
- if (! (o instanceof Point2D))
- return false;
- Point2D p = (Point2D) o;
- return getX() == p.getX() && getY() == p.getY();
- }
-
- /**
- * This class defines a point in <code>double</code> precision.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
- public static class Double extends Point2D
- {
- /** The X coordinate. */
- public double x;
-
- /** The Y coordinate. */
- public double y;
-
- /**
- * Create a new point at (0,0).
- */
- public Double()
- {
- }
-
- /**
- * Create a new point at (x,y).
- *
- * @param x the x coordinate
- * @param y the y coordinate
- */
- public Double(double x, double y)
- {
- this.x = x;
- this.y = y;
- }
-
- /**
- * Return the x coordinate.
- *
- * @return the x coordinate
- */
- public double getX()
- {
- return x;
- }
-
- /**
- * Return the y coordinate.
- *
- * @return the y coordinate
- */
- public double getY()
- {
- return y;
- }
-
- /**
- * Sets the location of this point.
- *
- * @param x the new x coordinate
- * @param y the new y coordinate
- */
- public void setLocation(double x, double y)
- {
- this.x = x;
- this.y = y;
- }
-
- /**
- * Returns a string representation of this object. The format is:
- * <code>"Point2D.Double[" + x + ", " + y + ']'</code>.
- *
- * @return a string representation of this object
- */
- public String toString()
- {
- return "Point2D.Double[" + x + ", " + y + ']';
- }
- } // class Double
-
- /**
- * This class defines a point in <code>float</code> precision.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
- public static class Float extends Point2D
- {
- /** The X coordinate. */
- public float x;
-
- /** The Y coordinate. */
- public float y;
-
- /**
- * Create a new point at (0,0).
- */
- public Float()
- {
- }
-
- /**
- * Create a new point at (x,y).
- *
- * @param x the x coordinate
- * @param y the y coordinate
- */
- public Float(float x, float y)
- {
- this.x = x;
- this.y = y;
- }
-
- /**
- * Return the x coordinate.
- *
- * @return the x coordinate
- */
- public double getX()
- {
- return x;
- }
-
- /**
- * Return the y coordinate.
- *
- * @return the y coordinate
- */
- public double getY()
- {
- return y;
- }
-
- /**
- * Sets the location of this point.
- *
- * @param x the new x coordinate
- * @param y the new y coordinate
- */
- public void setLocation(double x, double y)
- {
- this.x = (float) x;
- this.y = (float) y;
- }
-
- /**
- * Sets the location of this point.
- *
- * @param x the new x coordinate
- * @param y the new y coordinate
- */
- public void setLocation(float x, float y)
- {
- this.x = x;
- this.y = y;
- }
-
- /**
- * Returns a string representation of this object. The format is:
- * <code>"Point2D.Float[" + x + ", " + y + ']'</code>.
- *
- * @return a string representation of this object
- */
- public String toString()
- {
- return "Point2D.Float[" + x + ", " + y + ']';
- }
- } // class Float
-} // class Point2D
diff --git a/libjava/java/awt/geom/QuadCurve2D.java b/libjava/java/awt/geom/QuadCurve2D.java
deleted file mode 100644
index 41021dbc683..00000000000
--- a/libjava/java/awt/geom/QuadCurve2D.java
+++ /dev/null
@@ -1,1467 +0,0 @@
-/* QuadCurve2D.java -- represents a parameterized quadratic curve in 2-D space
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.util.NoSuchElementException;
-
-/**
- * A two-dimensional curve that is parameterized with a quadratic
- * function.
- *
- * <p><img src="doc-files/QuadCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a QuadCurve2D" />
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @author Graydon Hoare (graydon@redhat.com)
- * @author Sascha Brawer (brawer@dandelis.ch)
- * @author Sven de Marothy (sven@physto.se)
- *
- * @since 1.2
- */
-public abstract class QuadCurve2D implements Shape, Cloneable
-{
- private static final double BIG_VALUE = java.lang.Double.MAX_VALUE / 10.0;
- private static final double EPSILON = 1E-10;
-
- /**
- * Constructs a new QuadCurve2D. Typical users will want to
- * construct instances of a subclass, such as {@link
- * QuadCurve2D.Float} or {@link QuadCurve2D.Double}.
- */
- protected QuadCurve2D()
- {
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public abstract double getX1();
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public abstract double getY1();
-
- /**
- * Returns the curve&#x2019;s start point.
- */
- public abstract Point2D getP1();
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s control
- * point.
- */
- public abstract double getCtrlX();
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s control
- * point.
- */
- public abstract double getCtrlY();
-
- /**
- * Returns the curve&#x2019;s control point.
- */
- public abstract Point2D getCtrlPt();
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public abstract double getX2();
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public abstract double getY2();
-
- /**
- * Returns the curve&#x2019;s end point.
- */
- public abstract Point2D getP2();
-
- /**
- * Changes the curve geometry, separately specifying each coordinate
- * value.
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new start
- * point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new start
- * point.
- *
- * @param cx the <i>x</i> coordinate of the curve&#x2019;s new
- * control point.
- *
- * @param cy the <i>y</i> coordinate of the curve&#x2019;s new
- * control point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new end
- * point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new end
- * point.
- */
- public abstract void setCurve(double x1, double y1, double cx, double cy,
- double x2, double y2);
-
- /**
- * Changes the curve geometry, passing coordinate values in an
- * array.
- *
- * @param coords an array containing the new coordinate values. The
- * <i>x</i> coordinate of the new start point is located at
- * <code>coords[offset]</code>, its <i>y</i> coordinate at
- * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
- * new control point is located at <code>coords[offset + 2]</code>,
- * its <i>y</i> coordinate at <code>coords[offset + 3]</code>. The
- * <i>x</i> coordinate of the new end point is located at
- * <code>coords[offset + 4]</code>, its <i>y</i> coordinate at
- * <code>coords[offset + 5]</code>.
- *
- * @param offset the offset of the first coordinate value in
- * <code>coords</code>.
- */
- public void setCurve(double[] coords, int offset)
- {
- setCurve(coords[offset++], coords[offset++], coords[offset++],
- coords[offset++], coords[offset++], coords[offset++]);
- }
-
- /**
- * Changes the curve geometry, specifying coordinate values in
- * separate Point objects.
- *
- * <p><img src="doc-files/QuadCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a QuadCurve2D" />
- *
- * <p>The curve does not keep any reference to the passed point
- * objects. Therefore, a later change to <code>p1</code>,
- * <code>c</code> <code>p2</code> will not affect the curve
- * geometry.
- *
- * @param p1 the new start point.
- * @param c the new control point.
- * @param p2 the new end point.
- */
- public void setCurve(Point2D p1, Point2D c, Point2D p2)
- {
- setCurve(p1.getX(), p1.getY(), c.getX(), c.getY(), p2.getX(), p2.getY());
- }
-
- /**
- * Changes the curve geometry, specifying coordinate values in an
- * array of Point objects.
- *
- * <p><img src="doc-files/QuadCurve2D-1.png" width="350" height="180"
- * alt="A drawing of a QuadCurve2D" />
- *
- * <p>The curve does not keep references to the passed point
- * objects. Therefore, a later change to the <code>pts</code> array
- * or any of its elements will not affect the curve geometry.
- *
- * @param pts an array containing the points. The new start point
- * is located at <code>pts[offset]</code>, the new control
- * point at <code>pts[offset + 1]</code>, and the new end point
- * at <code>pts[offset + 2]</code>.
- *
- * @param offset the offset of the start point in <code>pts</code>.
- */
- public void setCurve(Point2D[] pts, int offset)
- {
- setCurve(pts[offset].getX(), pts[offset].getY(), pts[offset + 1].getX(),
- pts[offset + 1].getY(), pts[offset + 2].getX(),
- pts[offset + 2].getY());
- }
-
- /**
- * Changes the geometry of the curve to that of another curve.
- *
- * @param c the curve whose coordinates will be copied.
- */
- public void setCurve(QuadCurve2D c)
- {
- setCurve(c.getX1(), c.getY1(), c.getCtrlX(), c.getCtrlY(), c.getX2(),
- c.getY2());
- }
-
- /**
- * Calculates the squared flatness of a quadratic curve, directly
- * specifying each coordinate value. The flatness is the distance of
- * the control point to the line between start and end point.
- *
- * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. The result will be the
- * the square of the distance between C and the gray line, i.e.
- * the squared length of the red line.
- *
- * @param x1 the <i>x</i> coordinate of the start point P1.
- * @param y1 the <i>y</i> coordinate of the start point P1.
- * @param cx the <i>x</i> coordinate of the control point C.
- * @param cy the <i>y</i> coordinate of the control point C.
- * @param x2 the <i>x</i> coordinate of the end point P2.
- * @param y2 the <i>y</i> coordinate of the end point P2.
- */
- public static double getFlatnessSq(double x1, double y1, double cx,
- double cy, double x2, double y2)
- {
- return Line2D.ptSegDistSq(x1, y1, x2, y2, cx, cy);
- }
-
- /**
- * Calculates the flatness of a quadratic curve, directly specifying
- * each coordinate value. The flatness is the distance of the
- * control point to the line between start and end point.
- *
- * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. The result will be the
- * the distance between C and the gray line, i.e. the length of
- * the red line.
- *
- * @param x1 the <i>x</i> coordinate of the start point P1.
- * @param y1 the <i>y</i> coordinate of the start point P1.
- * @param cx the <i>x</i> coordinate of the control point C.
- * @param cy the <i>y</i> coordinate of the control point C.
- * @param x2 the <i>x</i> coordinate of the end point P2.
- * @param y2 the <i>y</i> coordinate of the end point P2.
- */
- public static double getFlatness(double x1, double y1, double cx, double cy,
- double x2, double y2)
- {
- return Line2D.ptSegDist(x1, y1, x2, y2, cx, cy);
- }
-
- /**
- * Calculates the squared flatness of a quadratic curve, specifying
- * the coordinate values in an array. The flatness is the distance
- * of the control point to the line between start and end point.
- *
- * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. The result will be the
- * the square of the distance between C and the gray line, i.e.
- * the squared length of the red line.
- *
- * @param coords an array containing the coordinate values. The
- * <i>x</i> coordinate of the start point P1 is located at
- * <code>coords[offset]</code>, its <i>y</i> coordinate at
- * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
- * control point C is located at <code>coords[offset + 2]</code>,
- * its <i>y</i> coordinate at <code>coords[offset + 3]</code>. The
- * <i>x</i> coordinate of the end point P2 is located at
- * <code>coords[offset + 4]</code>, its <i>y</i> coordinate at
- * <code>coords[offset + 5]</code>.
- *
- * @param offset the offset of the first coordinate value in
- * <code>coords</code>.
- */
- public static double getFlatnessSq(double[] coords, int offset)
- {
- return Line2D.ptSegDistSq(coords[offset], coords[offset + 1],
- coords[offset + 4], coords[offset + 5],
- coords[offset + 2], coords[offset + 3]);
- }
-
- /**
- * Calculates the flatness of a quadratic curve, specifying the
- * coordinate values in an array. The flatness is the distance of
- * the control point to the line between start and end point.
- *
- * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. The result will be the
- * the the distance between C and the gray line, i.e. the length of
- * the red line.
- *
- * @param coords an array containing the coordinate values. The
- * <i>x</i> coordinate of the start point P1 is located at
- * <code>coords[offset]</code>, its <i>y</i> coordinate at
- * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
- * control point C is located at <code>coords[offset + 2]</code>,
- * its <i>y</i> coordinate at <code>coords[offset + 3]</code>. The
- * <i>x</i> coordinate of the end point P2 is located at
- * <code>coords[offset + 4]</code>, its <i>y</i> coordinate at
- * <code>coords[offset + 5]</code>.
- *
- * @param offset the offset of the first coordinate value in
- * <code>coords</code>.
- */
- public static double getFlatness(double[] coords, int offset)
- {
- return Line2D.ptSegDist(coords[offset], coords[offset + 1],
- coords[offset + 4], coords[offset + 5],
- coords[offset + 2], coords[offset + 3]);
- }
-
- /**
- * Calculates the squared flatness of this curve. The flatness is
- * the distance of the control point to the line between start and
- * end point.
- *
- * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. The result will be the
- * the square of the distance between C and the gray line, i.e. the
- * squared length of the red line.
- */
- public double getFlatnessSq()
- {
- return Line2D.ptSegDistSq(getX1(), getY1(), getX2(), getY2(), getCtrlX(),
- getCtrlY());
- }
-
- /**
- * Calculates the flatness of this curve. The flatness is the
- * distance of the control point to the line between start and end
- * point.
- *
- * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
- * alt="A drawing that illustrates the flatness" />
- *
- * <p>In the above drawing, the straight line connecting start point
- * P1 and end point P2 is depicted in gray. The result will be the
- * the distance between C and the gray line, i.e. the length of the
- * red line.
- */
- public double getFlatness()
- {
- return Line2D.ptSegDist(getX1(), getY1(), getX2(), getY2(), getCtrlX(),
- getCtrlY());
- }
-
- /**
- * Subdivides this curve into two halves.
- *
- * <p><img src="doc-files/QuadCurve2D-3.png" width="700"
- * height="180" alt="A drawing that illustrates the effects of
- * subdividing a QuadCurve2D" />
- *
- * @param left a curve whose geometry will be set to the left half
- * of this curve, or <code>null</code> if the caller is not
- * interested in the left half.
- *
- * @param right a curve whose geometry will be set to the right half
- * of this curve, or <code>null</code> if the caller is not
- * interested in the right half.
- */
- public void subdivide(QuadCurve2D left, QuadCurve2D right)
- {
- // Use empty slots at end to share single array.
- double[] d = new double[]
- {
- getX1(), getY1(), getCtrlX(), getCtrlY(), getX2(), getY2(),
- 0, 0, 0, 0
- };
- subdivide(d, 0, d, 0, d, 4);
- if (left != null)
- left.setCurve(d, 0);
- if (right != null)
- right.setCurve(d, 4);
- }
-
- /**
- * Subdivides a quadratic curve into two halves.
- *
- * <p><img src="doc-files/QuadCurve2D-3.png" width="700"
- * height="180" alt="A drawing that illustrates the effects of
- * subdividing a QuadCurve2D" />
- *
- * @param src the curve to be subdivided.
- *
- * @param left a curve whose geometry will be set to the left half
- * of <code>src</code>, or <code>null</code> if the caller is not
- * interested in the left half.
- *
- * @param right a curve whose geometry will be set to the right half
- * of <code>src</code>, or <code>null</code> if the caller is not
- * interested in the right half.
- */
- public static void subdivide(QuadCurve2D src, QuadCurve2D left,
- QuadCurve2D right)
- {
- src.subdivide(left, right);
- }
-
- /**
- * Subdivides a quadratic curve into two halves, passing all
- * coordinates in an array.
- *
- * <p><img src="doc-files/QuadCurve2D-3.png" width="700"
- * height="180" alt="A drawing that illustrates the effects of
- * subdividing a QuadCurve2D" />
- *
- * <p>The left end point and the right start point will always be
- * identical. Memory-concious programmers thus may want to pass the
- * same array for both <code>left</code> and <code>right</code>, and
- * set <code>rightOff</code> to <code>leftOff + 4</code>.
- *
- * @param src an array containing the coordinates of the curve to be
- * subdivided. The <i>x</i> coordinate of the start point is
- * located at <code>src[srcOff]</code>, its <i>y</i> at
- * <code>src[srcOff + 1]</code>. The <i>x</i> coordinate of the
- * control point is located at <code>src[srcOff + 2]</code>, its
- * <i>y</i> at <code>src[srcOff + 3]</code>. The <i>x</i>
- * coordinate of the end point is located at <code>src[srcOff +
- * 4]</code>, its <i>y</i> at <code>src[srcOff + 5]</code>.
- *
- * @param srcOff an offset into <code>src</code>, specifying
- * the index of the start point&#x2019;s <i>x</i> coordinate.
- *
- * @param left an array that will receive the coordinates of the
- * left half of <code>src</code>. It is acceptable to pass
- * <code>src</code>. A caller who is not interested in the left half
- * can pass <code>null</code>.
- *
- * @param leftOff an offset into <code>left</code>, specifying the
- * index where the start point&#x2019;s <i>x</i> coordinate will be
- * stored.
- *
- * @param right an array that will receive the coordinates of the
- * right half of <code>src</code>. It is acceptable to pass
- * <code>src</code> or <code>left</code>. A caller who is not
- * interested in the right half can pass <code>null</code>.
- *
- * @param rightOff an offset into <code>right</code>, specifying the
- * index where the start point&#x2019;s <i>x</i> coordinate will be
- * stored.
- */
- public static void subdivide(double[] src, int srcOff, double[] left,
- int leftOff, double[] right, int rightOff)
- {
- double x1;
- double y1;
- double xc;
- double yc;
- double x2;
- double y2;
-
- x1 = src[srcOff];
- y1 = src[srcOff + 1];
- xc = src[srcOff + 2];
- yc = src[srcOff + 3];
- x2 = src[srcOff + 4];
- y2 = src[srcOff + 5];
-
- if (left != null)
- {
- left[leftOff] = x1;
- left[leftOff + 1] = y1;
- }
-
- if (right != null)
- {
- right[rightOff + 4] = x2;
- right[rightOff + 5] = y2;
- }
-
- x1 = (x1 + xc) / 2;
- x2 = (xc + x2) / 2;
- xc = (x1 + x2) / 2;
- y1 = (y1 + yc) / 2;
- y2 = (y2 + yc) / 2;
- yc = (y1 + y2) / 2;
-
- if (left != null)
- {
- left[leftOff + 2] = x1;
- left[leftOff + 3] = y1;
- left[leftOff + 4] = xc;
- left[leftOff + 5] = yc;
- }
-
- if (right != null)
- {
- right[rightOff] = xc;
- right[rightOff + 1] = yc;
- right[rightOff + 2] = x2;
- right[rightOff + 3] = y2;
- }
- }
-
- /**
- * Finds the non-complex roots of a quadratic equation, placing the
- * results into the same array as the equation coefficients. The
- * following equation is being solved:
- *
- * <blockquote><code>eqn[2]</code> &#xb7; <i>x</i><sup>2</sup>
- * + <code>eqn[1]</code> &#xb7; <i>x</i>
- * + <code>eqn[0]</code>
- * = 0
- * </blockquote>
- *
- * <p>For some background about solving quadratic equations, see the
- * article <a href=
- * "http://planetmath.org/encyclopedia/QuadraticFormula.html"
- * >&#x201c;Quadratic Formula&#x201d;</a> in <a href=
- * "http://planetmath.org/">PlanetMath</a>. For an extensive library
- * of numerical algorithms written in the C programming language,
- * see the <a href="http://www.gnu.org/software/gsl/">GNU Scientific
- * Library</a>.
- *
- * @see #solveQuadratic(double[], double[])
- * @see CubicCurve2D#solveCubic(double[], double[])
- *
- * @param eqn an array with the coefficients of the equation. When
- * this procedure has returned, <code>eqn</code> will contain the
- * non-complex solutions of the equation, in no particular order.
- *
- * @return the number of non-complex solutions. A result of 0
- * indicates that the equation has no non-complex solutions. A
- * result of -1 indicates that the equation is constant (i.e.,
- * always or never zero).
- *
- * @author Brian Gough (bjg@network-theory.com)
- * (original C implementation in the <a href=
- * "http://www.gnu.org/software/gsl/">GNU Scientific Library</a>)
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- * (adaptation to Java)
- */
- public static int solveQuadratic(double[] eqn)
- {
- return solveQuadratic(eqn, eqn);
- }
-
- /**
- * Finds the non-complex roots of a quadratic equation. The
- * following equation is being solved:
- *
- * <blockquote><code>eqn[2]</code> &#xb7; <i>x</i><sup>2</sup>
- * + <code>eqn[1]</code> &#xb7; <i>x</i>
- * + <code>eqn[0]</code>
- * = 0
- * </blockquote>
- *
- * <p>For some background about solving quadratic equations, see the
- * article <a href=
- * "http://planetmath.org/encyclopedia/QuadraticFormula.html"
- * >&#x201c;Quadratic Formula&#x201d;</a> in <a href=
- * "http://planetmath.org/">PlanetMath</a>. For an extensive library
- * of numerical algorithms written in the C programming language,
- * see the <a href="http://www.gnu.org/software/gsl/">GNU Scientific
- * Library</a>.
- *
- * @see CubicCurve2D#solveCubic(double[],double[])
- *
- * @param eqn an array with the coefficients of the equation.
- *
- * @param res an array into which the non-complex roots will be
- * stored. The results may be in an arbitrary order. It is safe to
- * pass the same array object reference for both <code>eqn</code>
- * and <code>res</code>.
- *
- * @return the number of non-complex solutions. A result of 0
- * indicates that the equation has no non-complex solutions. A
- * result of -1 indicates that the equation is constant (i.e.,
- * always or never zero).
- *
- * @author Brian Gough (bjg@network-theory.com)
- * (original C implementation in the <a href=
- * "http://www.gnu.org/software/gsl/">GNU Scientific Library</a>)
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- * (adaptation to Java)
- */
- public static int solveQuadratic(double[] eqn, double[] res)
- {
- // Taken from poly/solve_quadratic.c in the GNU Scientific Library
- // (GSL), cvs revision 1.7 of 2003-07-26. For the original source,
- // see http://www.gnu.org/software/gsl/
- //
- // Brian Gough, the author of that code, has granted the
- // permission to use it in GNU Classpath under the GNU Classpath
- // license, and has assigned the copyright to the Free Software
- // Foundation.
- //
- // The Java implementation is very similar to the GSL code, but
- // not a strict one-to-one copy. For example, GSL would sort the
- // result.
- double a;
- double b;
- double c;
- double disc;
-
- c = eqn[0];
- b = eqn[1];
- a = eqn[2];
-
- // Check for linear or constant functions. This is not done by the
- // GNU Scientific Library. Without this special check, we
- // wouldn't return -1 for constant functions, and 2 instead of 1
- // for linear functions.
- if (a == 0)
- {
- if (b == 0)
- return -1;
-
- res[0] = -c / b;
- return 1;
- }
-
- disc = b * b - 4 * a * c;
-
- if (disc < 0)
- return 0;
-
- if (disc == 0)
- {
- // The GNU Scientific Library returns two identical results here.
- // We just return one.
- res[0] = -0.5 * b / a;
- return 1;
- }
-
- // disc > 0
- if (b == 0)
- {
- double r;
-
- r = Math.abs(0.5 * Math.sqrt(disc) / a);
- res[0] = -r;
- res[1] = r;
- }
- else
- {
- double sgnb;
- double temp;
-
- sgnb = (b > 0 ? 1 : -1);
- temp = -0.5 * (b + sgnb * Math.sqrt(disc));
-
- // The GNU Scientific Library sorts the result here. We don't.
- res[0] = temp / a;
- res[1] = c / temp;
- }
- return 2;
- }
-
- /**
- * Determines whether a point is inside the area bounded
- * by the curve and the straight line connecting its end points.
- *
- * <p><img src="doc-files/QuadCurve2D-5.png" width="350" height="180"
- * alt="A drawing of the area spanned by the curve" />
- *
- * <p>The above drawing illustrates in which area points are
- * considered &#x201c;inside&#x201d; a QuadCurve2D.
- */
- public boolean contains(double x, double y)
- {
- if (! getBounds2D().contains(x, y))
- return false;
-
- return ((getAxisIntersections(x, y, true, BIG_VALUE) & 1) != 0);
- }
-
- /**
- * Determines whether a point is inside the area bounded
- * by the curve and the straight line connecting its end points.
- *
- * <p><img src="doc-files/QuadCurve2D-5.png" width="350" height="180"
- * alt="A drawing of the area spanned by the curve" />
- *
- * <p>The above drawing illustrates in which area points are
- * considered &#x201c;inside&#x201d; a QuadCurve2D.
- */
- public boolean contains(Point2D p)
- {
- return contains(p.getX(), p.getY());
- }
-
- /**
- * Determines whether any part of a rectangle is inside the area bounded
- * by the curve and the straight line connecting its end points.
- *
- * <p><img src="doc-files/QuadCurve2D-5.png" width="350" height="180"
- * alt="A drawing of the area spanned by the curve" />
- *
- * <p>The above drawing illustrates in which area points are
- * considered &#x201c;inside&#x201d; in a CubicCurve2D.
- */
- public boolean intersects(double x, double y, double w, double h)
- {
- if (! getBounds2D().contains(x, y, w, h))
- return false;
-
- /* Does any edge intersect? */
- if (getAxisIntersections(x, y, true, w) != 0 /* top */
- || getAxisIntersections(x, y + h, true, w) != 0 /* bottom */
- || getAxisIntersections(x + w, y, false, h) != 0 /* right */
- || getAxisIntersections(x, y, false, h) != 0) /* left */
- return true;
-
- /* No intersections, is any point inside? */
- if ((getAxisIntersections(x, y, true, BIG_VALUE) & 1) != 0)
- return true;
-
- return false;
- }
-
- /**
- * Determines whether any part of a Rectangle2D is inside the area bounded
- * by the curve and the straight line connecting its end points.
- * @see #intersects(double, double, double, double)
- */
- public boolean intersects(Rectangle2D r)
- {
- return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Determines whether a rectangle is entirely inside the area bounded
- * by the curve and the straight line connecting its end points.
- *
- * <p><img src="doc-files/QuadCurve2D-5.png" width="350" height="180"
- * alt="A drawing of the area spanned by the curve" />
- *
- * <p>The above drawing illustrates in which area points are
- * considered &#x201c;inside&#x201d; a QuadCurve2D.
- * @see #contains(double, double)
- */
- public boolean contains(double x, double y, double w, double h)
- {
- if (! getBounds2D().intersects(x, y, w, h))
- return false;
-
- /* Does any edge intersect? */
- if (getAxisIntersections(x, y, true, w) != 0 /* top */
- || getAxisIntersections(x, y + h, true, w) != 0 /* bottom */
- || getAxisIntersections(x + w, y, false, h) != 0 /* right */
- || getAxisIntersections(x, y, false, h) != 0) /* left */
- return false;
-
- /* No intersections, is any point inside? */
- if ((getAxisIntersections(x, y, true, BIG_VALUE) & 1) != 0)
- return true;
-
- return false;
- }
-
- /**
- * Determines whether a Rectangle2D is entirely inside the area that is
- * bounded by the curve and the straight line connecting its end points.
- * @see #contains(double, double, double, double)
- */
- public boolean contains(Rectangle2D r)
- {
- return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Determines the smallest rectangle that encloses the
- * curve&#x2019;s start, end and control point. As the illustration
- * below shows, the invisible control point may cause the bounds to
- * be much larger than the area that is actually covered by the
- * curve.
- *
- * <p><img src="doc-files/QuadCurve2D-2.png" width="350" height="180"
- * alt="An illustration of the bounds of a QuadCurve2D" />
- */
- public Rectangle getBounds()
- {
- return getBounds2D().getBounds();
- }
-
- public PathIterator getPathIterator(final AffineTransform at)
- {
- return new PathIterator()
- {
- /** Current coordinate. */
- private int current = 0;
-
- public int getWindingRule()
- {
- return WIND_NON_ZERO;
- }
-
- public boolean isDone()
- {
- return current >= 2;
- }
-
- public void next()
- {
- current++;
- }
-
- public int currentSegment(float[] coords)
- {
- int result;
- switch (current)
- {
- case 0:
- coords[0] = (float) getX1();
- coords[1] = (float) getY1();
- result = SEG_MOVETO;
- break;
- case 1:
- coords[0] = (float) getCtrlX();
- coords[1] = (float) getCtrlY();
- coords[2] = (float) getX2();
- coords[3] = (float) getY2();
- result = SEG_QUADTO;
- break;
- default:
- throw new NoSuchElementException("quad iterator out of bounds");
- }
- if (at != null)
- at.transform(coords, 0, coords, 0, 2);
- return result;
- }
-
- public int currentSegment(double[] coords)
- {
- int result;
- switch (current)
- {
- case 0:
- coords[0] = getX1();
- coords[1] = getY1();
- result = SEG_MOVETO;
- break;
- case 1:
- coords[0] = getCtrlX();
- coords[1] = getCtrlY();
- coords[2] = getX2();
- coords[3] = getY2();
- result = SEG_QUADTO;
- break;
- default:
- throw new NoSuchElementException("quad iterator out of bounds");
- }
- if (at != null)
- at.transform(coords, 0, coords, 0, 2);
- return result;
- }
- };
- }
-
- public PathIterator getPathIterator(AffineTransform at, double flatness)
- {
- return new FlatteningPathIterator(getPathIterator(at), flatness);
- }
-
- /**
- * Creates a new curve with the same contents as this one.
- *
- * @return the clone.
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-
- /**
- * Helper method used by contains() and intersects() methods
- * Return the number of curve/line intersections on a given axis
- * extending from a certain point. useYaxis is true for using the Y axis,
- * @param x x coordinate of the origin point
- * @param y y coordinate of the origin point
- * @param useYaxis axis to follow, if true the positive Y axis is used,
- * false uses the positive X axis.
- *
- * This is an implementation of the line-crossings algorithm,
- * Detailed in an article on Eric Haines' page:
- * http://www.acm.org/tog/editors/erich/ptinpoly/
- */
- private int getAxisIntersections(double x, double y, boolean useYaxis,
- double distance)
- {
- int nCrossings = 0;
- double a0;
- double a1;
- double a2;
- double b0;
- double b1;
- double b2;
- double[] r = new double[3];
- int nRoots;
-
- a0 = a2 = 0.0;
-
- if (useYaxis)
- {
- a0 = getY1() - y;
- a1 = getCtrlY() - y;
- a2 = getY2() - y;
- b0 = getX1() - x;
- b1 = getCtrlX() - x;
- b2 = getX2() - x;
- }
- else
- {
- a0 = getX1() - x;
- a1 = getCtrlX() - x;
- a2 = getX2() - x;
- b0 = getY1() - y;
- b1 = getCtrlY() - y;
- b2 = getY2() - y;
- }
-
- /* If the axis intersects a start/endpoint, shift it up by some small
- amount to guarantee the line is 'inside'
- If this is not done,bad behaviour may result for points on that axis. */
- if (a0 == 0.0 || a2 == 0.0)
- {
- double small = getFlatness() * EPSILON;
- if (a0 == 0.0)
- a0 -= small;
-
- if (a2 == 0.0)
- a2 -= small;
- }
-
- r[0] = a0;
- r[1] = 2 * (a1 - a0);
- r[2] = (a2 - 2 * a1 + a0);
-
- nRoots = solveQuadratic(r);
- for (int i = 0; i < nRoots; i++)
- {
- double t = r[i];
- if (t >= 0.0 && t <= 1.0)
- {
- double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0)
- + b0;
- /* single root is always doubly degenerate in quads */
- if (crossing > 0 && crossing < distance)
- nCrossings += (nRoots == 1) ? 2 : 1;
- }
- }
-
- if (useYaxis)
- {
- if (Line2D.linesIntersect(b0, a0, b2, a2, EPSILON, 0.0, distance, 0.0))
- nCrossings++;
- }
- else
- {
- if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, EPSILON, 0.0, distance))
- nCrossings++;
- }
-
- return (nCrossings);
- }
-
- /**
- * A two-dimensional curve that is parameterized with a quadratic
- * function and stores coordinate values in double-precision
- * floating-point format.
- *
- * @see QuadCurve2D.Float
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class Double extends QuadCurve2D
- {
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s start point.
- */
- public double x1;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s start point.
- */
- public double y1;
-
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s control point.
- */
- public double ctrlx;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s control point.
- */
- public double ctrly;
-
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s end point.
- */
- public double x2;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s end point.
- */
- public double y2;
-
- /**
- * Constructs a new QuadCurve2D that stores its coordinate values
- * in double-precision floating-point format. All points are
- * initially at position (0, 0).
- */
- public Double()
- {
- }
-
- /**
- * Constructs a new QuadCurve2D that stores its coordinate values
- * in double-precision floating-point format, specifying the
- * initial position of each point.
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s start
- * point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s start
- * point.
- *
- * @param cx the <i>x</i> coordinate of the curve&#x2019;s control
- * point.
- *
- * @param cy the <i>y</i> coordinate of the curve&#x2019;s control
- * point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s end
- * point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public Double(double x1, double y1, double cx, double cy, double x2,
- double y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- ctrlx = cx;
- ctrly = cy;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public double getX1()
- {
- return x1;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public double getY1()
- {
- return y1;
- }
-
- /**
- * Returns the curve&#x2019;s start point.
- */
- public Point2D getP1()
- {
- return new Point2D.Double(x1, y1);
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s control
- * point.
- */
- public double getCtrlX()
- {
- return ctrlx;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s control
- * point.
- */
- public double getCtrlY()
- {
- return ctrly;
- }
-
- /**
- * Returns the curve&#x2019;s control point.
- */
- public Point2D getCtrlPt()
- {
- return new Point2D.Double(ctrlx, ctrly);
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public double getX2()
- {
- return x2;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public double getY2()
- {
- return y2;
- }
-
- /**
- * Returns the curve&#x2019;s end point.
- */
- public Point2D getP2()
- {
- return new Point2D.Double(x2, y2);
- }
-
- /**
- * Changes the geometry of the curve.
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new
- * start point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new
- * start point.
- *
- * @param cx the <i>x</i> coordinate of the curve&#x2019;s new
- * control point.
- *
- * @param cy the <i>y</i> coordinate of the curve&#x2019;s new
- * control point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new
- * end point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new
- * end point.
- */
- public void setCurve(double x1, double y1, double cx, double cy,
- double x2, double y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- ctrlx = cx;
- ctrly = cy;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Determines the smallest rectangle that encloses the
- * curve&#x2019;s start, end and control point. As the
- * illustration below shows, the invisible control point may cause
- * the bounds to be much larger than the area that is actually
- * covered by the curve.
- *
- * <p><img src="doc-files/QuadCurve2D-2.png" width="350" height="180"
- * alt="An illustration of the bounds of a QuadCurve2D" />
- */
- public Rectangle2D getBounds2D()
- {
- double nx1 = Math.min(Math.min(x1, ctrlx), x2);
- double ny1 = Math.min(Math.min(y1, ctrly), y2);
- double nx2 = Math.max(Math.max(x1, ctrlx), x2);
- double ny2 = Math.max(Math.max(y1, ctrly), y2);
- return new Rectangle2D.Double(nx1, ny1, nx2 - nx1, ny2 - ny1);
- }
- }
-
- /**
- * A two-dimensional curve that is parameterized with a quadratic
- * function and stores coordinate values in single-precision
- * floating-point format.
- *
- * @see QuadCurve2D.Double
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class Float extends QuadCurve2D
- {
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s start point.
- */
- public float x1;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s start point.
- */
- public float y1;
-
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s control point.
- */
- public float ctrlx;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s control point.
- */
- public float ctrly;
-
- /**
- * The <i>x</i> coordinate of the curve&#x2019;s end point.
- */
- public float x2;
-
- /**
- * The <i>y</i> coordinate of the curve&#x2019;s end point.
- */
- public float y2;
-
- /**
- * Constructs a new QuadCurve2D that stores its coordinate values
- * in single-precision floating-point format. All points are
- * initially at position (0, 0).
- */
- public Float()
- {
- }
-
- /**
- * Constructs a new QuadCurve2D that stores its coordinate values
- * in single-precision floating-point format, specifying the
- * initial position of each point.
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s start
- * point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s start
- * point.
- *
- * @param cx the <i>x</i> coordinate of the curve&#x2019;s control
- * point.
- *
- * @param cy the <i>y</i> coordinate of the curve&#x2019;s control
- * point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s end
- * point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public Float(float x1, float y1, float cx, float cy, float x2, float y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- ctrlx = cx;
- ctrly = cy;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public double getX1()
- {
- return x1;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s start
- * point.
- */
- public double getY1()
- {
- return y1;
- }
-
- /**
- * Returns the curve&#x2019;s start point.
- */
- public Point2D getP1()
- {
- return new Point2D.Float(x1, y1);
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s control
- * point.
- */
- public double getCtrlX()
- {
- return ctrlx;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s control
- * point.
- */
- public double getCtrlY()
- {
- return ctrly;
- }
-
- /**
- * Returns the curve&#x2019;s control point.
- */
- public Point2D getCtrlPt()
- {
- return new Point2D.Float(ctrlx, ctrly);
- }
-
- /**
- * Returns the <i>x</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public double getX2()
- {
- return x2;
- }
-
- /**
- * Returns the <i>y</i> coordinate of the curve&#x2019;s end
- * point.
- */
- public double getY2()
- {
- return y2;
- }
-
- /**
- * Returns the curve&#x2019;s end point.
- */
- public Point2D getP2()
- {
- return new Point2D.Float(x2, y2);
- }
-
- /**
- * Changes the geometry of the curve, specifying coordinate values
- * as double-precision floating-point numbers.
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new
- * start point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new
- * start point.
- *
- * @param cx the <i>x</i> coordinate of the curve&#x2019;s new
- * control point.
- *
- * @param cy the <i>y</i> coordinate of the curve&#x2019;s new
- * control point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new
- * end point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new
- * end point.
- */
- public void setCurve(double x1, double y1, double cx, double cy,
- double x2, double y2)
- {
- this.x1 = (float) x1;
- this.y1 = (float) y1;
- ctrlx = (float) cx;
- ctrly = (float) cy;
- this.x2 = (float) x2;
- this.y2 = (float) y2;
- }
-
- /**
- * Changes the geometry of the curve, specifying coordinate values
- * as single-precision floating-point numbers.
- *
- * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new
- * start point.
- *
- * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new
- * start point.
- *
- * @param cx the <i>x</i> coordinate of the curve&#x2019;s new
- * control point.
- *
- * @param cy the <i>y</i> coordinate of the curve&#x2019;s new
- * control point.
- *
- * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new
- * end point.
- *
- * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new
- * end point.
- */
- public void setCurve(float x1, float y1, float cx, float cy, float x2,
- float y2)
- {
- this.x1 = x1;
- this.y1 = y1;
- ctrlx = cx;
- ctrly = cy;
- this.x2 = x2;
- this.y2 = y2;
- }
-
- /**
- * Determines the smallest rectangle that encloses the
- * curve&#x2019;s start, end and control point. As the
- * illustration below shows, the invisible control point may cause
- * the bounds to be much larger than the area that is actually
- * covered by the curve.
- *
- * <p><img src="doc-files/QuadCurve2D-2.png" width="350" height="180"
- * alt="An illustration of the bounds of a QuadCurve2D" />
- */
- public Rectangle2D getBounds2D()
- {
- float nx1 = (float) Math.min(Math.min(x1, ctrlx), x2);
- float ny1 = (float) Math.min(Math.min(y1, ctrly), y2);
- float nx2 = (float) Math.max(Math.max(x1, ctrlx), x2);
- float ny2 = (float) Math.max(Math.max(y1, ctrly), y2);
- return new Rectangle2D.Float(nx1, ny1, nx2 - nx1, ny2 - ny1);
- }
- }
-}
diff --git a/libjava/java/awt/geom/Rectangle2D.java b/libjava/java/awt/geom/Rectangle2D.java
deleted file mode 100644
index 6a255f95391..00000000000
--- a/libjava/java/awt/geom/Rectangle2D.java
+++ /dev/null
@@ -1,992 +0,0 @@
-/* Rectangle2D.java -- generic rectangles in 2-D space
- Copyright (C) 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.util.NoSuchElementException;
-
-/**
- * This class describes a rectangle by a point (x,y) and dimension (w x h).
- * The actual storage is left up to subclasses.
- *
- * <p>It is valid for a rectangle to have negative width or height; but it
- * is considered to have no area or internal points. Therefore, the behavior
- * in methods like <code>contains</code> or <code>intersects</code> is
- * undefined unless the rectangle has positive width and height.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class Rectangle2D extends RectangularShape
-{
- /**
- * The point lies left of the rectangle (p.x &lt; r.x).
- *
- * @see #outcode(double, double)
- */
- public static final int OUT_LEFT = 1;
-
- /**
- * The point lies above the rectangle (p.y &lt; r.y).
- *
- * @see #outcode(double, double)
- */
- public static final int OUT_TOP = 2;
-
- /**
- * The point lies right of the rectangle (p.x &gt; r.maxX).
- *
- * @see #outcode(double, double)
- */
- public static final int OUT_RIGHT = 4;
-
- /**
- * The point lies below of the rectangle (p.y &gt; r.maxY).
- *
- * @see #outcode(double, double)
- */
- public static final int OUT_BOTTOM = 8;
-
- /**
- * Default constructor.
- */
- protected Rectangle2D()
- {
- }
-
- /**
- * Set the bounding box of this rectangle.
- *
- * @param x the new X coordinate
- * @param y the new Y coordinate
- * @param w the new width
- * @param h the new height
- */
- public abstract void setRect(double x, double y, double w, double h);
-
- /**
- * Set the bounding box of this rectangle from the given one.
- *
- * @param r rectangle to copy
- * @throws NullPointerException if r is null
- */
- public void setRect(Rectangle2D r)
- {
- setRect(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Tests if the specified line intersects the interior of this rectangle.
- *
- * @param x1 the first x coordinate of line segment
- * @param y1 the first y coordinate of line segment
- * @param x2 the second x coordinate of line segment
- * @param y2 the second y coordinate of line segment
- * @return true if the line intersects the rectangle
- */
- public boolean intersectsLine(double x1, double y1, double x2, double y2)
- {
- double x = getX();
- double y = getY();
- double w = getWidth();
- double h = getHeight();
- if (w <= 0 || h <= 0)
- return false;
-
- if (x1 >= x && x1 <= x + w && y1 >= y && y1 <= y + h)
- return true;
- if (x2 >= x && x2 <= x + w && y2 >= y && y2 <= y + h)
- return true;
-
- double x3 = x + w;
- double y3 = y + h;
-
- return (Line2D.linesIntersect(x1, y1, x2, y2, x, y, x, y3)
- || Line2D.linesIntersect(x1, y1, x2, y2, x, y3, x3, y3)
- || Line2D.linesIntersect(x1, y1, x2, y2, x3, y3, x3, y)
- || Line2D.linesIntersect(x1, y1, x2, y2, x3, y, x, y));
- }
-
- /**
- * Tests if the specified line intersects the interior of this rectangle.
- *
- * @param l the line segment
- * @return true if the line intersects the rectangle
- * @throws NullPointerException if l is null
- */
- public boolean intersectsLine(Line2D l)
- {
- return intersectsLine(l.getX1(), l.getY1(), l.getX2(), l.getY2());
- }
-
- /**
- * Determine where the point lies with respect to this rectangle. The
- * result will be the binary OR of the appropriate bit masks.
- *
- * @param x the x coordinate to check
- * @param y the y coordinate to check
- * @return the binary OR of the result
- * @see #OUT_LEFT
- * @see #OUT_TOP
- * @see #OUT_RIGHT
- * @see #OUT_BOTTOM
- */
- public abstract int outcode(double x, double y);
-
- /**
- * Determine where the point lies with respect to this rectangle. The
- * result will be the binary OR of the appropriate bit masks.
- *
- * @param p the point to check
- * @return the binary OR of the result
- * @throws NullPointerException if p is null
- * @see #OUT_LEFT
- * @see #OUT_TOP
- * @see #OUT_RIGHT
- * @see #OUT_BOTTOM
- */
- public int outcode(Point2D p)
- {
- return outcode(p.getX(), p.getY());
- }
-
- /**
- * Set the bounding box of this rectangle.
- *
- * @param x the new X coordinate
- * @param y the new Y coordinate
- * @param w the new width
- * @param h the new height
- */
- public void setFrame(double x, double y, double w, double h)
- {
- setRect(x, y, w, h);
- }
-
- /**
- * Returns the bounds of this rectangle. A pretty useless method, as this
- * is already a rectangle.
- *
- * @return a copy of this rectangle
- */
- public Rectangle2D getBounds2D()
- {
- return (Rectangle2D) clone();
- }
-
- /**
- * Test if the given point is contained in the rectangle.
- *
- * @param x the x coordinate of the point
- * @param y the y coordinate of the point
- * @return true if (x,y) is in the rectangle
- */
- public boolean contains(double x, double y)
- {
- double mx = getX();
- double my = getY();
- double w = getWidth();
- double h = getHeight();
- return w > 0 && h > 0 && x >= mx && x < mx + w && y >= my && y < my + h;
- }
-
- /**
- * Tests if the given rectangle intersects this one. In other words, test if
- * the two rectangles share at least one internal point.
- *
- * @param x the x coordinate of the other rectangle
- * @param y the y coordinate of the other rectangle
- * @param w the width of the other rectangle
- * @param h the height of the other rectangle
- * @return true if the rectangles intersect
- */
- public boolean intersects(double x, double y, double w, double h)
- {
- double mx = getX();
- double my = getY();
- double mw = getWidth();
- double mh = getHeight();
- return w > 0 && h > 0 && mw > 0 && mh > 0
- && x < mx + mw && x + w > mx && y < my + mh && y + h > my;
- }
-
- /**
- * Tests if this rectangle contains the given one. In other words, test if
- * this rectangle contains all points in the given one.
- *
- * @param x the x coordinate of the other rectangle
- * @param y the y coordinate of the other rectangle
- * @param w the width of the other rectangle
- * @param h the height of the other rectangle
- * @return true if this rectangle contains the other
- */
- public boolean contains(double x, double y, double w, double h)
- {
- double mx = getX();
- double my = getY();
- double mw = getWidth();
- double mh = getHeight();
- return w > 0 && h > 0 && mw > 0 && mh > 0
- && x >= mx && x + w <= mx + mw && y >= my && y + h <= my + mh;
- }
-
- /**
- * Return a new rectangle which is the intersection of this and the given
- * one. The result will be empty if there is no intersection.
- *
- * @param r the rectangle to be intersected
- * @return the intersection
- * @throws NullPointerException if r is null
- */
- public abstract Rectangle2D createIntersection(Rectangle2D r);
-
- /**
- * Intersects a pair of rectangles, and places the result in the
- * destination; this can be used to avoid object creation. This method
- * even works when the destination is also a source, although you stand
- * to lose the original data.
- *
- * @param src1 the first source
- * @param src2 the second source
- * @param dest the destination for the intersection
- * @throws NullPointerException if any rectangle is null
- */
- public static void intersect(Rectangle2D src1, Rectangle2D src2,
- Rectangle2D dest)
- {
- double x = Math.max(src1.getX(), src2.getX());
- double y = Math.max(src1.getY(), src2.getY());
- double maxx = Math.min(src1.getMaxX(), src2.getMaxX());
- double maxy = Math.min(src1.getMaxY(), src2.getMaxY());
- dest.setRect(x, y, maxx - x, maxy - y);
- }
-
- /**
- * Return a new rectangle which is the union of this and the given one.
- *
- * @param r the rectangle to be merged
- * @return the union
- * @throws NullPointerException if r is null
- */
- public abstract Rectangle2D createUnion(Rectangle2D r);
-
- /**
- * Joins a pair of rectangles, and places the result in the destination;
- * this can be used to avoid object creation. This method even works when
- * the destination is also a source, although you stand to lose the
- * original data.
- *
- * @param src1 the first source
- * @param src2 the second source
- * @param dest the destination for the union
- * @throws NullPointerException if any rectangle is null
- */
- public static void union(Rectangle2D src1, Rectangle2D src2,
- Rectangle2D dest)
- {
- double x = Math.min(src1.getX(), src2.getX());
- double y = Math.min(src1.getY(), src2.getY());
- double maxx = Math.max(src1.getMaxX(), src2.getMaxX());
- double maxy = Math.max(src1.getMaxY(), src2.getMaxY());
- dest.setRect(x, y, maxx - x, maxy - y);
- }
-
- /**
- * Modifies this rectangle so that it represents the smallest rectangle
- * that contains both the existing rectangle and the specified point.
- * However, if the point falls on one of the two borders which are not
- * inside the rectangle, a subsequent call to <code>contains</code> may
- * return false.
- *
- * @param newx the X coordinate of the point to add to this rectangle
- * @param newy the Y coordinate of the point to add to this rectangle
- */
- public void add(double newx, double newy)
- {
- double minx = Math.min(getX(), newx);
- double maxx = Math.max(getMaxX(), newx);
- double miny = Math.min(getY(), newy);
- double maxy = Math.max(getMaxY(), newy);
- setRect(minx, miny, maxx - minx, maxy - miny);
- }
-
- /**
- * Modifies this rectangle so that it represents the smallest rectangle
- * that contains both the existing rectangle and the specified point.
- * However, if the point falls on one of the two borders which are not
- * inside the rectangle, a subsequent call to <code>contains</code> may
- * return false.
- *
- * @param p the point to add to this rectangle
- * @throws NullPointerException if p is null
- */
- public void add(Point2D p)
- {
- add(p.getX(), p.getY());
- }
-
- /**
- * Modifies this rectangle so that it represents the smallest rectangle
- * that contains both the existing rectangle and the specified rectangle.
- *
- * @param r the rectangle to add to this rectangle
- * @throws NullPointerException if r is null
- * @see #union(Rectangle2D, Rectangle2D, Rectangle2D)
- */
- public void add(Rectangle2D r)
- {
- union(this, r, this);
- }
-
- /**
- * Return an iterator along the shape boundary. If the optional transform
- * is provided, the iterator is transformed accordingly. Each call returns
- * a new object, independent from others in use. This iterator is thread
- * safe; modifications to the rectangle do not affect the results of this
- * path instance.
- *
- * @param at an optional transform to apply to the iterator
- * @return a new iterator over the boundary
- * @since 1.2
- */
- public PathIterator getPathIterator(final AffineTransform at)
- {
- final double minx = getX();
- final double miny = getY();
- final double maxx = minx + getWidth();
- final double maxy = miny + getHeight();
- return new PathIterator()
- {
- /** Current coordinate. */
- private int current = (maxx <= minx && maxy <= miny) ? 6 : 0;
-
- public int getWindingRule()
- {
- // A test program showed that Sun J2SE 1.3.1 and 1.4.1_01
- // return WIND_NON_ZERO paths. While this does not really
- // make any difference for rectangles (because they are not
- // self-intersecting), it seems appropriate to behave
- // identically.
-
- return WIND_NON_ZERO;
- }
-
- public boolean isDone()
- {
- return current > 5;
- }
-
- public void next()
- {
- current++;
- }
-
- public int currentSegment(float[] coords)
- {
- switch (current)
- {
- case 1:
- coords[0] = (float) maxx;
- coords[1] = (float) miny;
- break;
- case 2:
- coords[0] = (float) maxx;
- coords[1] = (float) maxy;
- break;
- case 3:
- coords[0] = (float) minx;
- coords[1] = (float) maxy;
- break;
- case 0:
- case 4:
- coords[0] = (float) minx;
- coords[1] = (float) miny;
- break;
- case 5:
- return SEG_CLOSE;
- default:
- throw new NoSuchElementException("rect iterator out of bounds");
- }
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return current == 0 ? SEG_MOVETO : SEG_LINETO;
- }
-
- public int currentSegment(double[] coords)
- {
- switch (current)
- {
- case 1:
- coords[0] = maxx;
- coords[1] = miny;
- break;
- case 2:
- coords[0] = maxx;
- coords[1] = maxy;
- break;
- case 3:
- coords[0] = minx;
- coords[1] = maxy;
- break;
- case 0:
- case 4:
- coords[0] = minx;
- coords[1] = miny;
- break;
- case 5:
- return SEG_CLOSE;
- default:
- throw new NoSuchElementException("rect iterator out of bounds");
- }
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return current == 0 ? SEG_MOVETO : SEG_LINETO;
- }
- };
- }
-
- /**
- * Return an iterator along the shape boundary. If the optional transform
- * is provided, the iterator is transformed accordingly. Each call returns
- * a new object, independent from others in use. This iterator is thread
- * safe; modifications to the rectangle do not affect the results of this
- * path instance. As the rectangle is already flat, the flatness parameter
- * is ignored.
- *
- * @param at an optional transform to apply to the iterator
- * @param flatness the maximum distance for deviation from the real boundary
- * @return a new iterator over the boundary
- * @since 1.2
- */
- public PathIterator getPathIterator(AffineTransform at, double flatness)
- {
- return getPathIterator(at);
- }
-
- /**
- * Return the hashcode for this rectangle. The formula is not documented, but
- * appears to be the same as:
- * <pre>
- * long l = Double.doubleToLongBits(getX())
- * + 37 * Double.doubleToLongBits(getY())
- * + 43 * Double.doubleToLongBits(getWidth())
- * + 47 * Double.doubleToLongBits(getHeight());
- * return (int) ((l &gt;&gt; 32) ^ l);
- * </pre>
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- // Talk about a fun time reverse engineering this one!
- long l = java.lang.Double.doubleToLongBits(getX())
- + 37 * java.lang.Double.doubleToLongBits(getY())
- + 43 * java.lang.Double.doubleToLongBits(getWidth())
- + 47 * java.lang.Double.doubleToLongBits(getHeight());
- return (int) ((l >> 32) ^ l);
- }
-
- /**
- * Tests this rectangle for equality against the specified object. This
- * will be true if an only if the specified object is an instance of
- * Rectangle2D with the same coordinates and dimensions.
- *
- * @param obj the object to test against for equality
- * @return true if the specified object is equal to this one
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof Rectangle2D))
- return false;
- Rectangle2D r = (Rectangle2D) obj;
- return r.getX() == getX() && r.getY() == getY()
- && r.getWidth() == getWidth() && r.getHeight() == getHeight();
- }
-
- /**
- * This class defines a rectangle in <code>double</code> precision.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
- public static class Double extends Rectangle2D
- {
- /** The x coordinate of the lower left corner. */
- public double x;
-
- /** The y coordinate of the lower left corner. */
- public double y;
-
- /** The width of the rectangle. */
- public double width;
-
- /** The height of the rectangle. */
- public double height;
-
- /**
- * Create a rectangle at (0,0) with width 0 and height 0.
- */
- public Double()
- {
- }
-
- /**
- * Create a rectangle with the given values.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- */
- public Double(double x, double y, double w, double h)
- {
- this.x = x;
- this.y = y;
- width = w;
- height = h;
- }
-
- /**
- * Return the X coordinate.
- *
- * @return the value of x
- */
- public double getX()
- {
- return x;
- }
-
- /**
- * Return the Y coordinate.
- *
- * @return the value of y
- */
- public double getY()
- {
- return y;
- }
-
- /**
- * Return the width.
- *
- * @return the value of width
- */
- public double getWidth()
- {
- return width;
- }
-
- /**
- * Return the height.
- *
- * @return the value of height
- */
- public double getHeight()
- {
- return height;
- }
-
- /**
- * Test if the rectangle is empty.
- *
- * @return true if width or height is not positive
- */
- public boolean isEmpty()
- {
- return width <= 0 || height <= 0;
- }
-
- /**
- * Set the contents of this rectangle to those specified.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- */
- public void setRect(double x, double y, double w, double h)
- {
- this.x = x;
- this.y = y;
- width = w;
- height = h;
- }
-
- /**
- * Set the contents of this rectangle to those specified.
- *
- * @param r the rectangle to copy
- * @throws NullPointerException if r is null
- */
- public void setRect(Rectangle2D r)
- {
- x = r.getX();
- y = r.getY();
- width = r.getWidth();
- height = r.getHeight();
- }
-
- /**
- * Determine where the point lies with respect to this rectangle. The
- * result will be the binary OR of the appropriate bit masks.
- *
- * @param x the x coordinate to check
- * @param y the y coordinate to check
- * @return the binary OR of the result
- * @see #OUT_LEFT
- * @see #OUT_TOP
- * @see #OUT_RIGHT
- * @see #OUT_BOTTOM
- * @since 1.2
- */
- public int outcode(double x, double y)
- {
- int result = 0;
- if (width <= 0)
- result |= OUT_LEFT | OUT_RIGHT;
- else if (x < this.x)
- result |= OUT_LEFT;
- else if (x > this.x + width)
- result |= OUT_RIGHT;
- if (height <= 0)
- result |= OUT_BOTTOM | OUT_TOP;
- else if (y < this.y) // Remember that +y heads top-to-bottom.
- result |= OUT_TOP;
- else if (y > this.y + height)
- result |= OUT_BOTTOM;
- return result;
- }
-
- /**
- * Returns the bounds of this rectangle. A pretty useless method, as this
- * is already a rectangle.
- *
- * @return a copy of this rectangle
- */
- public Rectangle2D getBounds2D()
- {
- return new Double(x, y, width, height);
- }
-
- /**
- * Return a new rectangle which is the intersection of this and the given
- * one. The result will be empty if there is no intersection.
- *
- * @param r the rectangle to be intersected
- * @return the intersection
- * @throws NullPointerException if r is null
- */
- public Rectangle2D createIntersection(Rectangle2D r)
- {
- Double res = new Double();
- intersect(this, r, res);
- return res;
- }
-
- /**
- * Return a new rectangle which is the union of this and the given one.
- *
- * @param r the rectangle to be merged
- * @return the union
- * @throws NullPointerException if r is null
- */
- public Rectangle2D createUnion(Rectangle2D r)
- {
- Double res = new Double();
- union(this, r, res);
- return res;
- }
-
- /**
- * Returns a string representation of this rectangle. This is in the form
- * <code>getClass().getName() + "[x=" + x + ",y=" + y + ",w=" + width
- * + ",h=" + height + ']'</code>.
- *
- * @return a string representation of this rectangle
- */
- public String toString()
- {
- return getClass().getName() + "[x=" + x + ",y=" + y + ",w=" + width
- + ",h=" + height + ']';
- }
- }
-
- /**
- * This class defines a rectangle in <code>float</code> precision.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
- public static class Float extends Rectangle2D
- {
- /** The x coordinate of the lower left corner. */
- public float x;
-
- /** The y coordinate of the lower left corner. */
- public float y;
-
- /** The width of the rectangle. */
- public float width;
-
- /** The height of the rectangle. */
- public float height;
-
- /**
- * Create a rectangle at (0,0) with width 0 and height 0.
- */
- public Float()
- {
- }
-
- /**
- * Create a rectangle with the given values.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- */
- public Float(float x, float y, float w, float h)
- {
- this.x = x;
- this.y = y;
- width = w;
- height = h;
- }
-
- /**
- * Create a rectangle with the given values.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- */
- Float(double x, double y, double w, double h)
- {
- this.x = (float) x;
- this.y = (float) y;
- width = (float) w;
- height = (float) h;
- }
-
- /**
- * Return the X coordinate.
- *
- * @return the value of x
- */
- public double getX()
- {
- return x;
- }
-
- /**
- * Return the Y coordinate.
- *
- * @return the value of y
- */
- public double getY()
- {
- return y;
- }
-
- /**
- * Return the width.
- *
- * @return the value of width
- */
- public double getWidth()
- {
- return width;
- }
-
- /**
- * Return the height.
- *
- * @return the value of height
- */
- public double getHeight()
- {
- return height;
- }
-
- /**
- * Test if the rectangle is empty.
- *
- * @return true if width or height is not positive
- */
- public boolean isEmpty()
- {
- return width <= 0 || height <= 0;
- }
-
- /**
- * Set the contents of this rectangle to those specified.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- */
- public void setRect(float x, float y, float w, float h)
- {
- this.x = x;
- this.y = y;
- width = w;
- height = h;
- }
-
- /**
- * Set the contents of this rectangle to those specified.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param w the width
- * @param h the height
- */
- public void setRect(double x, double y, double w, double h)
- {
- this.x = (float) x;
- this.y = (float) y;
- width = (float) w;
- height = (float) h;
- }
-
- /**
- * Set the contents of this rectangle to those specified.
- *
- * @param r the rectangle to copy
- * @throws NullPointerException if r is null
- */
- public void setRect(Rectangle2D r)
- {
- x = (float) r.getX();
- y = (float) r.getY();
- width = (float) r.getWidth();
- height = (float) r.getHeight();
- }
-
- /**
- * Determine where the point lies with respect to this rectangle. The
- * result will be the binary OR of the appropriate bit masks.
- *
- * @param x the x coordinate to check
- * @param y the y coordinate to check
- * @return the binary OR of the result
- * @see #OUT_LEFT
- * @see #OUT_TOP
- * @see #OUT_RIGHT
- * @see #OUT_BOTTOM
- * @since 1.2
- */
- public int outcode(double x, double y)
- {
- int result = 0;
- if (width <= 0)
- result |= OUT_LEFT | OUT_RIGHT;
- else if (x < this.x)
- result |= OUT_LEFT;
- else if (x > this.x + width)
- result |= OUT_RIGHT;
- if (height <= 0)
- result |= OUT_BOTTOM | OUT_TOP;
- else if (y < this.y) // Remember that +y heads top-to-bottom.
- result |= OUT_TOP;
- else if (y > this.y + height)
- result |= OUT_BOTTOM;
- return result;
- }
-
- /**
- * Returns the bounds of this rectangle. A pretty useless method, as this
- * is already a rectangle.
- *
- * @return a copy of this rectangle
- */
- public Rectangle2D getBounds2D()
- {
- return new Float(x, y, width, height);
- }
-
- /**
- * Return a new rectangle which is the intersection of this and the given
- * one. The result will be empty if there is no intersection.
- *
- * @param r the rectangle to be intersected
- * @return the intersection
- * @throws NullPointerException if r is null
- */
- public Rectangle2D createIntersection(Rectangle2D r)
- {
- Float res = new Float();
- intersect(this, r, res);
- return res;
- }
-
- /**
- * Return a new rectangle which is the union of this and the given one.
- *
- * @param r the rectangle to be merged
- * @return the union
- * @throws NullPointerException if r is null
- */
- public Rectangle2D createUnion(Rectangle2D r)
- {
- Float res = new Float();
- union(this, r, res);
- return res;
- }
-
- /**
- * Returns a string representation of this rectangle. This is in the form
- * <code>getClass().getName() + "[x=" + x + ",y=" + y + ",w=" + width
- * + ",h=" + height + ']'</code>.
- *
- * @return a string representation of this rectangle
- */
- public String toString()
- {
- return getClass().getName() + "[x=" + x + ",y=" + y + ",w=" + width
- + ",h=" + height + ']';
- }
- }
-}
diff --git a/libjava/java/awt/geom/RectangularShape.java b/libjava/java/awt/geom/RectangularShape.java
deleted file mode 100644
index 8f66dabf2e7..00000000000
--- a/libjava/java/awt/geom/RectangularShape.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/* RectangularShape.java -- a rectangular frame for several generic shapes
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.awt.Rectangle;
-import java.awt.Shape;
-
-/**
- * This class provides a generic framework, and several helper methods, for
- * subclasses which represent geometric objects inside a rectangular frame.
- * This does not specify any geometry except for the bounding box.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @see Arc2D
- * @see Ellipse2D
- * @see Rectangle2D
- * @see RoundRectangle2D
- * @status updated to 1.4
- */
-public abstract class RectangularShape implements Shape, Cloneable
-{
- /**
- * Default constructor.
- */
- protected RectangularShape()
- {
- }
-
- /**
- * Get the x coordinate of the upper-left corner of the framing rectangle.
- *
- * @return the x coordinate
- */
- public abstract double getX();
-
- /**
- * Get the y coordinate of the upper-left corner of the framing rectangle.
- *
- * @return the y coordinate
- */
- public abstract double getY();
-
- /**
- * Get the width of the framing rectangle.
- *
- * @return the width
- */
- public abstract double getWidth();
-
- /**
- * Get the height of the framing rectangle.
- *
- * @return the height
- */
- public abstract double getHeight();
-
- /**
- * Get the minimum x coordinate in the frame. This is misnamed, or else
- * Sun has a bug, because the implementation returns getX() even when
- * getWidth() is negative.
- *
- * @return the minimum x coordinate
- */
- public double getMinX()
- {
- return getX();
- }
-
- /**
- * Get the minimum y coordinate in the frame. This is misnamed, or else
- * Sun has a bug, because the implementation returns getY() even when
- * getHeight() is negative.
- *
- * @return the minimum y coordinate
- */
- public double getMinY()
- {
- return getY();
- }
-
- /**
- * Get the maximum x coordinate in the frame. This is misnamed, or else
- * Sun has a bug, because the implementation returns getX()+getWidth() even
- * when getWidth() is negative.
- *
- * @return the maximum x coordinate
- */
- public double getMaxX()
- {
- return getX() + getWidth();
- }
-
- /**
- * Get the maximum y coordinate in the frame. This is misnamed, or else
- * Sun has a bug, because the implementation returns getY()+getHeight() even
- * when getHeight() is negative.
- *
- * @return the maximum y coordinate
- */
- public double getMaxY()
- {
- return getY() + getHeight();
- }
-
- /**
- * Return the x coordinate of the center point of the framing rectangle.
- *
- * @return the central x coordinate
- */
- public double getCenterX()
- {
- return getX() + getWidth() / 2;
- }
-
- /**
- * Return the y coordinate of the center point of the framing rectangle.
- *
- * @return the central y coordinate
- */
- public double getCenterY()
- {
- return getY() + getHeight() / 2;
- }
-
- /**
- * Return the frame around this object. Note that this may be a looser
- * bounding box than getBounds2D.
- *
- * @return the frame, in double precision
- * @see #setFrame(double, double, double, double)
- */
- public Rectangle2D getFrame()
- {
- return new Rectangle2D.Double(getX(), getY(), getWidth(), getHeight());
- }
-
- /**
- * Test if the shape is empty, meaning that no points are inside it.
- *
- * @return true if the shape is empty
- */
- public abstract boolean isEmpty();
-
- /**
- * Set the framing rectangle of this shape to the given coordinate and size.
- *
- * @param x the new x coordinate
- * @param y the new y coordinate
- * @param w the new width
- * @param h the new height
- * @see #getFrame()
- */
- public abstract void setFrame(double x, double y, double w, double h);
-
- /**
- * Set the framing rectangle of this shape to the given coordinate and size.
- *
- * @param p the new point
- * @param d the new dimension
- * @throws NullPointerException if p or d is null
- * @see #getFrame()
- */
- public void setFrame(Point2D p, Dimension2D d)
- {
- setFrame(p.getX(), p.getY(), d.getWidth(), d.getHeight());
- }
-
- /**
- * Set the framing rectangle of this shape to the given rectangle.
- *
- * @param r the new framing rectangle
- * @throws NullPointerException if r is null
- * @see #getFrame()
- */
- public void setFrame(Rectangle2D r)
- {
- setFrame(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Set the framing rectangle of this shape using two points on a diagonal.
- * The area will be positive.
- *
- * @param x1 the first x coordinate
- * @param y1 the first y coordinate
- * @param x2 the second x coordinate
- * @param y2 the second y coordinate
- */
- public void setFrameFromDiagonal(double x1, double y1, double x2, double y2)
- {
- if (x1 > x2)
- {
- double t = x2;
- x2 = x1;
- x1 = t;
- }
- if (y1 > y2)
- {
- double t = y2;
- y2 = y1;
- y1 = t;
- }
- setFrame(x1, y1, x2 - x1, y2 - y1);
- }
-
- /**
- * Set the framing rectangle of this shape using two points on a diagonal.
- * The area will be positive.
- *
- * @param p1 the first point
- * @param p2 the second point
- * @throws NullPointerException if either point is null
- */
- public void setFrameFromDiagonal(Point2D p1, Point2D p2)
- {
- setFrameFromDiagonal(p1.getX(), p1.getY(), p2.getX(), p2.getY());
- }
-
- /**
- * Set the framing rectangle of this shape using the center of the frame,
- * and one of the four corners. The area will be positive.
- *
- * @param centerX the x coordinate at the center
- * @param centerY the y coordinate at the center
- * @param cornerX the x coordinate at a corner
- * @param cornerY the y coordinate at a corner
- */
- public void setFrameFromCenter(double centerX, double centerY,
- double cornerX, double cornerY)
- {
- double halfw = Math.abs(cornerX - centerX);
- double halfh = Math.abs(cornerY - centerY);
- setFrame(centerX - halfw, centerY - halfh, halfw + halfw, halfh + halfh);
- }
-
- /**
- * Set the framing rectangle of this shape using the center of the frame,
- * and one of the four corners. The area will be positive.
- *
- * @param center the center point
- * @param corner a corner point
- * @throws NullPointerException if either point is null
- */
- public void setFrameFromCenter(Point2D center, Point2D corner)
- {
- setFrameFromCenter(center.getX(), center.getY(),
- corner.getX(), corner.getY());
- }
-
- /**
- * Tests if a point is inside the boundary of the shape.
- *
- * @param p the point to test
- * @return true if the point is inside the shape
- * @throws NullPointerException if p is null
- * @see #contains(double, double)
- */
- public boolean contains(Point2D p)
- {
- return contains(p.getX(), p.getY());
- }
-
- /**
- * Tests if a rectangle and this shape share common internal points.
- *
- * @param r the rectangle to test
- * @return true if the rectangle intersects this shpae
- * @throws NullPointerException if r is null
- * @see #intersects(double, double, double, double)
- */
- public boolean intersects(Rectangle2D r)
- {
- return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Tests if the shape completely contains the given rectangle.
- *
- * @param r the rectangle to test
- * @return true if r is contained in this shape
- * @throws NullPointerException if r is null
- * @see #contains(double, double, double, double)
- */
- public boolean contains(Rectangle2D r)
- {
- return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- }
-
- /**
- * Returns a bounding box for this shape, in integer format. Notice that you
- * may get a tighter bound with getBounds2D. If the frame is empty, the
- * box is the default empty box at the origin.
- *
- * @return a bounding box
- */
- public Rectangle getBounds()
- {
- if (isEmpty())
- return new Rectangle();
- double x = getX();
- double y = getY();
- double maxx = Math.ceil(x + getWidth());
- double maxy = Math.ceil(y + getHeight());
- x = Math.floor(x);
- y = Math.floor(y);
- return new Rectangle((int) x, (int) y, (int) (maxx - x), (int) (maxy - y));
- }
-
- /**
- * Return an iterator along the shape boundary. If the optional transform
- * is provided, the iterator is transformed accordingly. The path is
- * flattened until all segments differ from the curve by at most the value
- * of the flatness parameter, within the limits of the default interpolation
- * recursion limit of 1024 segments between actual points. Each call
- * returns a new object, independent from others in use. The result is
- * threadsafe if and only if the iterator returned by
- * {@link #getPathIterator(AffineTransform)} is as well.
- *
- * @param at an optional transform to apply to the iterator
- * @param flatness the desired flatness
- * @return a new iterator over the boundary
- * @throws IllegalArgumentException if flatness is invalid
- * @since 1.2
- */
- public PathIterator getPathIterator(AffineTransform at, double flatness)
- {
- return new FlatteningPathIterator(getPathIterator(at), flatness);
- }
-
- /**
- * Create a new shape of the same run-time type with the same contents as
- * this one.
- *
- * @return the clone
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-} // class RectangularShape
diff --git a/libjava/java/awt/geom/RoundRectangle2D.java b/libjava/java/awt/geom/RoundRectangle2D.java
deleted file mode 100644
index ac0e6f8128a..00000000000
--- a/libjava/java/awt/geom/RoundRectangle2D.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/* RoundRectangle2D.java -- represents a rectangle with rounded corners
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.geom;
-
-import java.util.NoSuchElementException;
-
-
-/** This class implements a rectangle with rounded corners.
- * @author Tom Tromey (tromey@cygnus.com)
- * @date December 3, 2000
- */
-public abstract class RoundRectangle2D extends RectangularShape
-{
- /** Return the arc height of this round rectangle. */
- public abstract double getArcHeight();
-
- /** Return the arc width of this round rectangle. */
- public abstract double getArcWidth();
-
- /** Set the values of this round rectangle
- * @param x The x coordinate
- * @param y The y coordinate
- * @param w The width
- * @param h The height
- * @param arcWidth The arc width
- * @param arcHeight The arc height
- */
- public abstract void setRoundRect(double x, double y, double w, double h,
- double arcWidth, double arcHeight);
-
- /** Create a RoundRectangle2D. This is protected because this class
- * is abstract and cannot be instantiated.
- */
- protected RoundRectangle2D()
- {
- }
-
- /** Return true if this object contains the specified point.
- * @param x The x coordinate
- * @param y The y coordinate
- */
- public boolean contains(double x, double y)
- {
- double mx = getX();
- double mw = getWidth();
- if (x < mx || x >= mx + mw)
- return false;
- double my = getY();
- double mh = getHeight();
- if (y < my || y >= my + mh)
- return false;
-
- // Now check to see if the point is in range of an arc.
- double dy = Math.min(Math.abs(my - y), Math.abs(my + mh - y));
- double dx = Math.min(Math.abs(mx - x), Math.abs(mx + mw - x));
-
- // The arc dimensions are that of the corresponding ellipse
- // thus a 90 degree segment is half of that.
- double aw = getArcWidth() / 2.0;
- double ah = getArcHeight() / 2.0;
- if (dx > aw || dy > ah)
- return true;
-
- // At this point DX represents the distance from the nearest edge
- // of the rectangle. But we want to transform it to represent the
- // scaled distance from the center of the ellipse that forms the
- // arc. Hence this code:
- dy = (ah - dy) / ah;
- dx = (aw - dx) / aw;
-
- return dx * dx + dy * dy <= 1.0;
- }
-
- /** Return true if this object contains the specified rectangle
- * @param x The x coordinate
- * @param y The y coordinate
- * @param w The width
- * @param h The height
- */
- public boolean contains(double x, double y, double w, double h)
- {
- // We have to check all four points here (for ordinary rectangles
- // we can just check opposing corners).
- return (contains(x, y) && contains(x, y + h) && contains(x + w, y + h)
- && contains(x + w, y));
- }
-
- /** Return a new path iterator which iterates over this rectangle.
- * @param at An affine transform to apply to the object
- */
- public PathIterator getPathIterator(final AffineTransform at)
- {
- final double minx = getX();
- final double miny = getY();
- final double maxx = minx + getWidth();
- final double maxy = miny + getHeight();
- final double arcwidth = getArcWidth();
- final double archeight = getArcHeight();
- return new PathIterator()
- {
- /** We iterate counterclockwise around the rectangle, starting in the
- * upper right. This variable tracks our current point, which
- * can be on either side of a given corner. */
- private int current = 0;
-
- /** Child path iterator, used for corners. */
- private PathIterator corner;
-
- /** This is used when rendering the corners. We re-use the arc
- * for each corner. */
- private Arc2D arc = new Arc2D.Double();
-
- /** Temporary array used by getPoint. */
- private double[] temp = new double[2];
-
- public int getWindingRule()
- {
- return WIND_NON_ZERO;
- }
-
- public boolean isDone()
- {
- return current > 9;
- }
-
- private void getPoint(int val)
- {
- switch (val)
- {
- case 0:
- case 8:
- temp[0] = maxx;
- temp[1] = miny + archeight;
- break;
- case 7:
- temp[0] = maxx;
- temp[1] = maxy - archeight;
- break;
- case 6:
- temp[0] = maxx - arcwidth;
- temp[1] = maxy;
- break;
- case 5:
- temp[0] = minx + arcwidth;
- temp[1] = maxy;
- break;
- case 4:
- temp[0] = minx;
- temp[1] = maxy - archeight;
- break;
- case 3:
- temp[0] = minx;
- temp[1] = miny + archeight;
- break;
- case 2:
- temp[0] = minx + arcwidth;
- temp[1] = miny;
- break;
- case 1:
- temp[0] = maxx - arcwidth;
- temp[1] = miny;
- break;
- }
- }
-
- public void next()
- {
- if (current >= 8)
- ++current;
- else if (corner != null)
- {
- // We're iterating through the corner. Work on the child
- // iterator; if it finishes, reset and move to the next
- // point along the rectangle.
- corner.next();
- if (corner.isDone())
- {
- corner = null;
- ++current;
- }
- }
- else
- {
- // Make an arc between this point on the rectangle and
- // the next one, and then iterate over this arc.
- getPoint(current);
- double x1 = temp[0];
- double y1 = temp[1];
- getPoint(current + 1);
- Rectangle2D.Double r = new Rectangle2D.Double(Math.min(x1,
- temp[0]),
- Math.min(y1,
- temp[1]),
- Math.abs(x1
- - temp[0]),
- Math.abs(y1
- - temp[1]));
- arc.setArc(r, (current >> 1) * 90.0, 90.0, Arc2D.OPEN);
- corner = arc.getPathIterator(at);
- }
- }
-
- public int currentSegment(float[] coords)
- {
- if (corner != null)
- {
- int r = corner.currentSegment(coords);
- if (r == SEG_MOVETO)
- r = SEG_LINETO;
- return r;
- }
-
- if (current < 9)
- {
- getPoint(current);
- coords[0] = (float) temp[0];
- coords[1] = (float) temp[1];
- }
- else if (current == 9)
- return SEG_CLOSE;
- else
- throw new NoSuchElementException("rect iterator out of bounds");
-
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return current == 0 ? SEG_MOVETO : SEG_LINETO;
- }
-
- public int currentSegment(double[] coords)
- {
- if (corner != null)
- {
- int r = corner.currentSegment(coords);
- if (r == SEG_MOVETO)
- r = SEG_LINETO;
- return r;
- }
-
- if (current < 9)
- {
- getPoint(current);
- coords[0] = temp[0];
- coords[1] = temp[1];
- }
- else if (current == 9)
- return SEG_CLOSE;
- else
- throw new NoSuchElementException("rect iterator out of bounds");
-
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return current == 0 ? SEG_MOVETO : SEG_LINETO;
- }
- };
- }
-
- /** Return true if the given rectangle intersects this shape.
- * @param x The x coordinate
- * @param y The y coordinate
- * @param w The width
- * @param h The height
- */
- public boolean intersects(double x, double y, double w, double h)
- {
- // Check if any corner is within the rectangle
- return (contains(x, y) || contains(x, y + h) || contains(x + w, y + h)
- || contains(x + w, y));
- }
-
- /** Set the boundary of this round rectangle.
- * @param x The x coordinate
- * @param y The y coordinate
- * @param w The width
- * @param h The height
- */
- public void setFrame(double x, double y, double w, double h)
- {
- // This is a bit lame.
- setRoundRect(x, y, w, h, getArcWidth(), getArcHeight());
- }
-
- /** Set the values of this round rectangle to be the same as those
- * of the argument.
- * @param rr The round rectangle to copy
- */
- public void setRoundRect(RoundRectangle2D rr)
- {
- setRoundRect(rr.getX(), rr.getY(), rr.getWidth(), rr.getHeight(),
- rr.getArcWidth(), rr.getArcHeight());
- }
-
- /** A subclass of RoundRectangle which keeps its parameters as
- * doubles. */
- public static class Double extends RoundRectangle2D
- {
- /** The height of the corner arc. */
- public double archeight;
-
- /** The width of the corner arc. */
- public double arcwidth;
-
- /** The x coordinate of this object. */
- public double x;
-
- /** The y coordinate of this object. */
- public double y;
-
- /** The width of this object. */
- public double width;
-
- /** The height of this object. */
- public double height;
-
- /** Construct a new instance, with all parameters set to 0. */
- public Double()
- {
- }
-
- /** Construct a new instance with the given arguments.
- * @param x The x coordinate
- * @param y The y coordinate
- * @param w The width
- * @param h The height
- * @param arcWidth The arc width
- * @param arcHeight The arc height
- */
- public Double(double x, double y, double w, double h, double arcWidth,
- double arcHeight)
- {
- this.x = x;
- this.y = y;
- this.width = w;
- this.height = h;
- this.arcwidth = arcWidth;
- this.archeight = arcHeight;
- }
-
- public double getArcHeight()
- {
- return archeight;
- }
-
- public double getArcWidth()
- {
- return arcwidth;
- }
-
- public Rectangle2D getBounds2D()
- {
- return new Rectangle2D.Double(x, y, width, height);
- }
-
- public double getX()
- {
- return x;
- }
-
- public double getY()
- {
- return y;
- }
-
- public double getWidth()
- {
- return width;
- }
-
- public double getHeight()
- {
- return height;
- }
-
- public boolean isEmpty()
- {
- return width <= 0 || height <= 0;
- }
-
- public void setRoundRect(double x, double y, double w, double h,
- double arcWidth, double arcHeight)
- {
- this.x = x;
- this.y = y;
- this.width = w;
- this.height = h;
- this.arcwidth = arcWidth;
- this.archeight = arcHeight;
- }
- } // class Double
-
- /** A subclass of RoundRectangle which keeps its parameters as
- * floats. */
- public static class Float extends RoundRectangle2D
- {
- /** The height of the corner arc. */
- public float archeight;
-
- /** The width of the corner arc. */
- public float arcwidth;
-
- /** The x coordinate of this object. */
- public float x;
-
- /** The y coordinate of this object. */
- public float y;
-
- /** The width of this object. */
- public float width;
-
- /** The height of this object. */
- public float height;
-
- /** Construct a new instance, with all parameters set to 0. */
- public Float()
- {
- }
-
- /** Construct a new instance with the given arguments.
- * @param x The x coordinate
- * @param y The y coordinate
- * @param w The width
- * @param h The height
- * @param arcWidth The arc width
- * @param arcHeight The arc height
- */
- public Float(float x, float y, float w, float h, float arcWidth,
- float arcHeight)
- {
- this.x = x;
- this.y = y;
- this.width = w;
- this.height = h;
- this.arcwidth = arcWidth;
- this.archeight = arcHeight;
- }
-
- public double getArcHeight()
- {
- return archeight;
- }
-
- public double getArcWidth()
- {
- return arcwidth;
- }
-
- public Rectangle2D getBounds2D()
- {
- return new Rectangle2D.Float(x, y, width, height);
- }
-
- public double getX()
- {
- return x;
- }
-
- public double getY()
- {
- return y;
- }
-
- public double getWidth()
- {
- return width;
- }
-
- public double getHeight()
- {
- return height;
- }
-
- public boolean isEmpty()
- {
- return width <= 0 || height <= 0;
- }
-
- public void setRoundRect(float x, float y, float w, float h,
- float arcWidth, float arcHeight)
- {
- this.x = x;
- this.y = y;
- this.width = w;
- this.height = h;
- this.arcwidth = arcWidth;
- this.archeight = arcHeight;
- }
-
- public void setRoundRect(double x, double y, double w, double h,
- double arcWidth, double arcHeight)
- {
- this.x = (float) x;
- this.y = (float) y;
- this.width = (float) w;
- this.height = (float) h;
- this.arcwidth = (float) arcWidth;
- this.archeight = (float) arcHeight;
- }
- } // class Float
-} // class RoundRectangle2D
diff --git a/libjava/java/awt/im/InputContext.java b/libjava/java/awt/im/InputContext.java
deleted file mode 100644
index e289677fe9c..00000000000
--- a/libjava/java/awt/im/InputContext.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/* InputContext.java -- provides the context for text input
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.im;
-
-import gnu.java.util.EmptyEnumeration;
-
-import java.awt.AWTEvent;
-import java.awt.AWTException;
-import java.awt.Component;
-import java.awt.im.spi.InputMethod;
-import java.awt.im.spi.InputMethodDescriptor;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Locale;
-
-/**
- * Provides a context for controlling input methods and keyboard layouts.
- * This class provides the communication layer between the client component,
- * and the various locale-dependent text entry input methods that can be used
- * for the client. By default, there is one instance per Window, shared among
- * all components, but this limits text entry to one component at a time.
- * Thus, text components can create their own instance to allow text entry
- * in multiple components at a time.
- *
- * <p>By using the interfaces of {@link java.awt.im.spi}, you can install
- * extensions which allow additional input methods. Some of these may use
- * platform native input methods, or keyboard layouts provided by the platform.
- * Input methods are unavailable if none have been installed and the platform
- * has no underlying native input methods. Extensions are installed as jar
- * files, usually accessed in the default extension location or specified by
- * the -extdir VM flag. The jar must contain a file named
- * "META_INF/services/java.awt.im.spi.InputMethodDescriptor" which lists,
- * one entry per line in UTF-8 encoding, each class in the jar that implements
- * java.awt.im.spi.InputMethodDescriptor.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Component#getInputContext()
- * @see Component#enableInputMethods(boolean)
- * @since 1.2
- * @status updated to 1.4, but unverified
- */
-public class InputContext
-{
- /**
- * The list of installed input method descriptors.
- */
- private static final ArrayList descriptors = new ArrayList();
- static
- {
- Enumeration e;
- try
- {
- e = ClassLoader.getSystemResources
- ("META_INF/services/java.awt.im.spi.InputMethodDescriptor");
- }
- catch (IOException ex)
- {
- // XXX Should we do something else?
- e = EmptyEnumeration.getInstance();
- }
- while (e.hasMoreElements())
- {
- URL url = (URL) e.nextElement();
- BufferedReader in;
- String line;
- try
- {
- in = new BufferedReader
- (new InputStreamReader(url.openConnection().getInputStream(),
- "UTF-8"));
- line = in.readLine().trim();
- }
- catch (IOException ignored)
- {
- continue;
- }
- outer:
- while (line != null)
- {
- try
- {
- if (line.charAt(0) != '#')
- {
- Class c = Class.forName(line);
- descriptors.add((InputMethodDescriptor) c.newInstance());
- }
- line = in.readLine().trim();
- }
- catch (IOException ex)
- {
- continue outer;
- }
- catch (Exception ignored)
- {
- }
- }
- }
- }
-
- /** The current input method; null if no input methods are installed. */
- private InputMethod im;
-
- /** Map of locales to the most recently selected input method. */
- private final HashMap recent = new HashMap();
-
- /** The list of acceptable character subsets. */
- private Character.Subset[] subsets;
-
- /**
- * Construct an InputContext. This is protected, so clients must use
- * {@link #getInstance()} instead.
- */
- protected InputContext()
- {
- }
-
- /**
- * Returns a new InputContext.
- *
- * @return a new instance, initialized to the default locale if available
- */
- public static InputContext getInstance()
- {
- InputContext ic = new InputContext();
- ic.selectInputMethod(Locale.getDefault());
- return ic;
- }
-
- /**
- * Attempts to select an input method or keyboard layout which supports the
- * given locale. This returns true if a locale is available and was selected.
- * The following steps are taken in choosing an input method:<ul>
- * <li>If the currently selected input method or keyboard layout supports
- * the requested locale, it remains selected.</li>
- * <li>If there is no input method or keyboard layout available that
- * supports the requested locale, the current input method or keyboard
- * layout remains selected.</li>
- * <li>If the user has previously selected an input method or keyboard
- * layout for the requested locale from the user interface, then the most
- * recently selected such input method or keyboard layout is reselected.</li>
- * <li>Otherwise, an input method or keyboard layout that supports the
- * requested locale is selected in an implementation dependent way. This
- * implementation chooses the first input method which supports the requested
- * locale based on the InputMethodDescriptors loaded from the extensions
- * installed on the CLASSPATH.</li>
- * </ul>
- *
- * <p>Before switching away from an input method, any currently uncommitted
- * text is committed. Not all host operating systems provide API to
- * determine the locale of the currently selected native input method or
- * keyboard layout, and to select a native input method or keyboard layout
- * by locale. For host operating systems that don't provide such API,
- * selectInputMethod assumes that native input methods or keyboard layouts
- * provided by the host operating system support only the system's default
- * locale.
- *
- * <p>An example of where this may be called is in a multi-language document,
- * when moving the insertion point between sections of different locale, so
- * that the user may use the input method appropriate to that section of the
- * document.
- *
- * @param locale the desired new locale
- * @return true if the new locale is active
- * @throws NullPointerException if locale is null
- */
- public boolean selectInputMethod(Locale locale)
- {
- if (im != null && im.setLocale(locale))
- {
- recent.put(locale, im);
- return true;
- }
- InputMethod next = (InputMethod) recent.get(locale);
- outer:
- if (next != null)
- for (int i = 0, limit = descriptors.size(); i < limit; i++)
- {
- InputMethodDescriptor d = (InputMethodDescriptor) descriptors.get(i);
- Locale[] list;
- try
- {
- list = d.getAvailableLocales();
- }
- catch (AWTException ignored)
- {
- continue;
- }
- for (int j = list.length; --j >= 0; )
- if (locale.equals(list[j]))
- {
- try
- {
- next = d.createInputMethod();
- recent.put(locale, next);
- }
- catch (Exception ignored)
- {
- continue;
- }
- }
- }
- if (next == null)
- return false;
- // XXX I'm not sure if this does all the necessary steps in the switch.
- if (im != null)
- {
- try
- {
- next.setCompositionEnabled(im.isCompositionEnabled());
- }
- catch (UnsupportedOperationException ignored)
- {
- }
- im.endComposition();
- im.deactivate(false);
- im.hideWindows();
- }
- im = next;
- im.setLocale(locale);
- im.setCharacterSubsets(subsets);
- return true;
- }
-
- /**
- * Returns the current locale of the current input method or keyboard
- * layout. Returns null if the input context does not have a current input
- * method or keyboard layout or if the current input method's
- * {@link InputMethod#getLocale()} method returns null. Not all host
- * operating systems provide API to determine the locale of the currently
- * selected native input method or keyboard layout. For host operating
- * systems that don't provide such API, getLocale assumes that the current
- * locale of all native input methods or keyboard layouts provided by the
- * host operating system is the system's default locale.
- *
- * @return the locale of the current input method, or null
- * @since 1.3
- */
- public Locale getLocale()
- {
- return im == null ? null : im.getLocale();
- }
-
- /**
- * Sets the subsets of Unicode characters allowed to be input by the current
- * input method, as well as subsequent input methods. The value of null
- * implies all characters are legal. Applications should not rely on this
- * behavior, since native host input methods may not allow restrictions.
- * If no current input method is available, this has no immediate effect.
- *
- * @param subsets the set of Unicode subsets to accept, or null
- */
- public void setCharacterSubsets(Character.Subset[] subsets)
- {
- this.subsets = subsets;
- if (im != null)
- im.setCharacterSubsets(subsets);
- }
-
- /**
- * Changes the enabled status of the current input method. An input method
- * that is enabled for composition interprets incoming events for both
- * composition and control purposes, while a disabled input method only
- * interprets control commands (including commands to enable itself).
- *
- * @param enable whether to enable the input method
- * @throws UnsupportedOperationException if there is no current input method,
- * or the input method does not support enabling
- * @see #isCompositionEnabled()
- * @since 1.3
- */
- public void setCompositionEnabled(boolean enable)
- {
- if (im == null)
- throw new UnsupportedOperationException();
- im.setCompositionEnabled(enable);
- }
-
- /**
- * Find out if the current input method is enabled.
- *
- * @return true if the current input method is enabled
- * @throws UnsupportedOperationException if there is no current input method,
- * or the input method does not support enabling
- * @see #setCompositionEnabled(boolean)
- * @since 1.3
- */
- public boolean isCompositionEnabled()
- {
- if (im == null)
- throw new UnsupportedOperationException();
- return im.isCompositionEnabled();
- }
-
- /**
- * Starts a reconversion operation in the current input method. The input
- * method gets theh text to reconvert from the client component, using
- * {@link InputMethodRequests#getSelectedText(Attribute[])}. Then the
- * composed and committed text produced by the operation is sent back to
- * the client using a sequence of InputMethodRequests.
- *
- * @throws UnsupportedOperationException if there is no current input method,
- * or the input method does not support reconversion
- * @since 1.3
- */
- public void reconvert()
- {
- if (im == null)
- throw new UnsupportedOperationException();
- im.reconvert();
- }
-
- /**
- * Dispatches an event to the current input method. This is called
- * automatically by AWT. If no input method is available, then the event
- * will never be consumed.
- *
- * @param event the event to dispatch
- * @throws NullPointerException if event is null
- */
- public void dispatchEvent(AWTEvent event)
- {
- if (im != null)
- im.dispatchEvent(event);
- }
-
- /**
- * Notifies the input context that a client component has been removed from
- * its containment hierarchy, or that input method support has been disabled
- * for the component. This method is usually called from the client
- * component's {@link Component#removeNotify()} method. Potentially pending
- * input from input methods for this component is discarded. If no input
- * methods are available, then this method has no effect.
- *
- * @param client the client component
- * @throws NullPointerException if client is null
- */
- public void removeNotify(Component client)
- {
- // XXX What to do with client information?
- if (im != null)
- {
- im.deactivate(false);
- im.removeNotify();
- }
- }
-
- /**
- * Ends any input composition that may currently be going on in this
- * context. Depending on the platform and possibly user preferences, this
- * may commit or delete uncommitted text. Any changes to the text are
- * communicated to the active component using an input method event. If no
- * input methods are available, then this method has no effect. This may
- * be called for a variety of reasons, such as when the user moves the
- * insertion point in the client text outside the range of the composed text,
- * or when text is saved to file.
- */
- public void endComposition()
- {
- if (im != null)
- im.endComposition();
- }
-
- /**
- * Disposes of the input context and release the resources used by it.
- * Called automatically by AWT for the default input context of each
- * Window. If no input methods are available, then this method has no
- * effect.
- */
- public void dispose()
- {
- if (im != null)
- {
- im.deactivate(false);
- im.dispose();
- }
- }
-
- /**
- * Returns a control object from the current input method, or null. A
- * control object provides implementation-dependent methods that control
- * the behavior of the input method or obtain information from the input
- * method. Clients have to compare the result against known input method
- * control object types. If no input methods are available or the current
- * input method does not provide an input method control object, then null
- * is returned.
- *
- * @return the control object, or null
- */
- public Object getInputMethodControlObject()
- {
- return im == null ? null : im.getControlObject();
- }
-} // class InputContext
diff --git a/libjava/java/awt/im/InputMethodHighlight.java b/libjava/java/awt/im/InputMethodHighlight.java
deleted file mode 100644
index 0d664b19366..00000000000
--- a/libjava/java/awt/im/InputMethodHighlight.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/* InputMethodHighlight.java -- highlights the current text selection
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.im;
-
-import java.util.Map;
-
-/**
- * This describes the highlight attributes of text composed in an input method.
- * The description includes an abstract level (whether text has been converted
- * yet, and whether it is selected), and a concrete level (which style
- * attributes are used in rendering). If no concrete level is defined, the
- * renderer should use
- * {@link Toolkit#mapInputMethodHighlight(InputMethodHighlight)}. An example
- * of conversion state is kana -&gt; kanji.
- *
- * <p>Instances of this class are typically used in
- * AttributedCharacterIterators, and may be wrapped in Annotations to separate
- * text segments.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see AttributedCharacterIterators
- * @see Annotation
- * @since 1.2
- * @status updated to 1.4
- */
-public class InputMethodHighlight
-{
- /** Raw text state (before conversion). */
- public static final int RAW_TEXT = 0;
-
- /** Converted text state (after conversion). */
- public static final int CONVERTED_TEXT = 1;
-
- /** Default do-nothing highlighting for unselected raw text. */
- public static final InputMethodHighlight UNSELECTED_RAW_TEXT_HIGHLIGHT
- = new InputMethodHighlight(false, RAW_TEXT);
-
- /** Default do-nothing highlighting for selected raw text. */
- public static final InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT
- = new InputMethodHighlight(true, RAW_TEXT);
-
- /** Default do-nothing highlighting for unselected converted text. */
- public static final InputMethodHighlight UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
- = new InputMethodHighlight(false, CONVERTED_TEXT);
-
- /** Default do-nothing highlighting for selected converted text. */
- public static final InputMethodHighlight SELECTED_CONVERTED_TEXT_HIGHLIGHT
- = new InputMethodHighlight(true, CONVERTED_TEXT);
-
- /** Whether the highlighting applies to selected text. */
- private final boolean selected;
-
- /** The state of highlighted text. */
- private final int state;
-
- /** Any variation on the highlighting style. */
- private final int variation;
-
- /** The unmodifiable map of rendering styles. */
- private final Map style;
-
- /**
- * Create an input method highlight style, with variation 0 and null style
- * mapping.
- *
- * @param selected whether the text range is selected
- * @param state either {@link #RAW_TEXT} or {@link #CONVERTED_TEXT}
- * @throws IllegalArgumentException if state is invalid
- */
- public InputMethodHighlight(boolean selected, int state)
- {
- this(selected, state, 0, null);
- }
-
- /**
- * Create an input method highlight style, with null style mapping.
- *
- * @param selected whether the text range is selected
- * @param state either {@link #RAW_TEXT} or {@link #CONVERTED_TEXT}
- * @param variation the style variation
- * @throws IllegalArgumentException if state is invalid
- */
- public InputMethodHighlight(boolean selected, int state, int variation)
- {
- this(selected, state, variation, null);
- }
-
- /**
- * Create an input method highlight style.
- *
- * @param selected whether the text range is selected
- * @param state either {@link #RAW_TEXT} or {@link #CONVERTED_TEXT}
- * @param variation the style variation
- * @param style an unmodifiable map of rendering styles, or null
- * @throws IllegalArgumentException if state is invalid
- * @since 1.3
- */
- public InputMethodHighlight(boolean selected, int state, int variation,
- Map style)
- {
- if (state != RAW_TEXT && state != CONVERTED_TEXT)
- throw new IllegalArgumentException();
- this.selected = selected;
- this.state = state;
- this.variation = variation;
- this.style = style;
- }
-
- /**
- * Return whether the highlighting applies to selected text.
- *
- * @return the selection status
- */
- public boolean isSelected()
- {
- return selected;
- }
-
- /**
- * Return the conversion state of the highlighted text.
- *
- * @return one of {@link #RAW_TEXT} or {@link #CONVERTED_TEXT}
- */
- public int getState()
- {
- return state;
- }
-
- /**
- * Return the highlighting style variation.
- *
- * @return the variation
- */
- public int getVariation()
- {
- return variation;
- }
-
- /**
- * Return the rendering style attributes map, or null if it should be the
- * default mapping.
- *
- * @return the style map
- * @since 1.3
- */
- public Map getStyle()
- {
- return style;
- }
-} // class InputMethodHighlight
diff --git a/libjava/java/awt/im/InputMethodRequests.java b/libjava/java/awt/im/InputMethodRequests.java
deleted file mode 100644
index d50ec33c5c8..00000000000
--- a/libjava/java/awt/im/InputMethodRequests.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/* InputMethodRequests.java -- handles text insertion via input methods
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.im;
-
-import java.awt.Rectangle;
-import java.awt.font.TextHitInfo;
-import java.text.AttributedCharacterIterator;
-import java.text.AttributedCharacterIterator.Attribute;
-
-/**
- * This interface handles requests made by input methods on text editing
- * components. A component must specify a handler for input methods that
- * implements this interface, and which supports one of two user interfaces:
- * <ul><li><em>on-the-spot</em>: composed text is shown in place</li>
- * <li><em>below-the-spot</em>: composed text is in a separate window,
- * usually below the main text window, until it is committed into place at
- * the insertion point, overwriting any selected text</li></ul>
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Component#getInputMethodRequests()
- * @see InputMethodListener
- * @since 1.2
- * @status updated to 1.4
- */
-public interface InputMethodRequests
-{
- /**
- * Gets the location of a given offset of the text. This can be used to
- * position a composition window near the location of where the composed
- * text will be inserted.
- *
- * <p>If the component has composed text (from the most recent
- * InputMethodEvent), then offset 0 indicates the location of the first
- * character of this composed text. Otherwise, the offset is ignored, and
- * the location should be the beginning of the final line of selected
- * text (in horizontal left-to-right text, like English, this would be the
- * lower left corner of the selction; in vertical top-to-bottom text, like
- * Chinese, this would be the top right corner of the selection).
- *
- * <p>The location returned is a 0-thickness caret (either horizontal or
- * vertical, depending on text flow), mapped to absolute screen coordinates.
- *
- * @param offset offset within composed text, or null
- * @return the screen location of the caret at the offset
- */
- Rectangle getTextLocation(TextHitInfo offset);
-
- /**
- * Get the text offset for the given screen coordinate. The offset is
- * relative to the composed text, and the return is null if it is outside
- * the range of composed text. For example, this can be used to find
- * where a mouse click should pop up a text composition window.
- *
- * @param x the x screen coordinate
- * @param y the y screen coordinate
- * @return a text hit info describing the composed text offset
- */
- TextHitInfo getLocationOffset(int x, int y);
-
- /**
- * Gets the offset where the committed text exists in the text editing
- * component. This can be used to examine the text surrounding the insert
- * position.
- *
- * @return the offset of the insert position
- */
- int getInsertPositionOffset();
-
- /**
- * Gets an interator which provides access to the text and its attributes,
- * except for the uncommitted text. The input method may provide a list of
- * attributes it is interested in; and the iterator need not provide
- * information on the remaining attributes. If the attribute list is null,
- * the iterator must list all attributes.
- *
- * @param beginIndex the index of the first character in the iteration
- * @param endIndex the index of the last character in the iteration
- * @param attributes a list of attributes interested in, or null
- * @return an iterator over the region of text with its attributes
- */
- AttributedCharacterIterator getCommittedText(int beginIndex, int endIndex,
- Attribute[] attributes);
-
- /**
- * Gets the length of committed text.
- *
- * @return the number of committed characters
- */
- int getCommittedTextLength();
-
- /**
- * Gets the latest committed text, and removes it from the component's text
- * body. This allows an input method to provide an "Undo" command. In
- * general, this should only be supported immediately after a commit, and
- * not when other actions intervene; if not supported, simply return null.
- * The input method may provide a list of attributes it is interested in;
- * and the iterator need not provide information on the remaining attributes.
- * If the attribute list is null, the iterator must list all attributes.
- *
- * @param attributes a list of attributes interested in, or null
- * @return the latest committed text, or null
- */
- AttributedCharacterIterator cancelLatestCommittedText
- (Attribute[] attributes);
-
- /**
- * Gets the currently selected text. One use of this is to implement a
- * "Reconvert" feature in an input method, which modifies the selection
- * based on the text in the composition window. The input method may
- * provide a list of attributes it is interested in; and the iterator need
- * not provide information on the remaining attributes. If the attribute
- * list is null, the iterator must list all attributes.
- *
- * @param attributes a list of attributes interested in, or null
- * @return the current selection
- */
- AttributedCharacterIterator getSelectedText(Attribute[] attributes);
-} // interface InputMethodRequests
diff --git a/libjava/java/awt/im/InputSubset.java b/libjava/java/awt/im/InputSubset.java
deleted file mode 100644
index 5e7d58e7f42..00000000000
--- a/libjava/java/awt/im/InputSubset.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/* InputSubset.java -- subsets of Unicode important in text input
- Copyright (C) 2002, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.im;
-
-/**
- * Defines additional Unicode character blocks for use by input methods.
- * These constants encompass several Unicode blocks, or portions thereof, for
- * simplification over {@link Character.UnicodeBlock}.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public final class InputSubset extends Character.Subset
-{
- /**
- * Constant for all Latin characters, including the characters in the
- * BASIC_LATIN, LATIN_1_SUPPLEMENT, LATIN_EXTENDED_A, LATIN_EXTENDED_B
- * Unicode character blocks.
- */
- public static final InputSubset LATIN = new InputSubset("LATIN");
-
- /**
- * Constant for the digits included in the BASIC_LATIN Unicode character
- * block.
- */
- public static final InputSubset LATIN_DIGITS
- = new InputSubset("LATIN_DIGITS");
-
- /**
- * Constant for all Han characters used in writing Traditional Chinese,
- * including a subset of the CJK unified ideographs as well as Traditional
- * Chinese Han characters that may be defined as surrogate characters.
- */
- public static final InputSubset TRADITIONAL_HANZI
- = new InputSubset("TRADITIONAL_HANZI");
-
- /**
- * Constant for all Han characters used in writing Simplified Chinese,
- * including a subset of the CJK unified ideographs as well as Simplified
- * Chinese Han characters that may be defined as surrogate characters.
- */
- public static final InputSubset SIMPLIFIED_HANZI
- = new InputSubset("SIMPLIFIED_HANZI");
-
- /**
- * Constant for all Han characters used in writing Japanese, including a
- * subset of the CJK unified ideographs as well as Japanese Han characters
- * that may be defined as surrogate characters.
- */
- public static final InputSubset KANJI = new InputSubset("KANJI");
-
- /**
- * Constant for all Han characters used in writing Korean, including a
- * subset of the CJK unified ideographs as well as Korean Han characters
- * that may be defined as surrogate characters.
- */
- public static final InputSubset HANJA = new InputSubset("HANJA");
-
- /**
- * Constant for the halfwidth katakana subset of the Unicode halfwidth and
- * fullwidth forms character block.
- */
- public static final InputSubset HALFWIDTH_KATAKANA
- = new InputSubset("HALFWIDTH_KATAKANA");
-
- /**
- * Constant for the fullwidth ASCII variants subset of the Unicode
- * halfwidth and fullwidth forms character block.
- *
- * @since 1.3
- */
- public static final InputSubset FULLWIDTH_LATIN
- = new InputSubset("FULLWIDTH_LATIN");
-
- /**
- * Constant for the fullwidth digits included in the Unicode halfwidth and
- * fullwidth forms character block.
- *
- * @since 1.3
- */
- public static final InputSubset FULLWIDTH_DIGITS
- = new InputSubset("FULLWIDTH_DIGITS");
-
- /**
- * Construct a subset.
- *
- * @param name the subset name
- */
- private InputSubset(String name)
- {
- super(name);
- }
-} // class InputSubset
diff --git a/libjava/java/awt/im/spi/InputMethod.java b/libjava/java/awt/im/spi/InputMethod.java
deleted file mode 100644
index 840d193a8d8..00000000000
--- a/libjava/java/awt/im/spi/InputMethod.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/* InputMethod.java -- defines an interface for complex text input
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.im.spi;
-
-import java.awt.AWTEvent;
-import java.awt.Rectangle;
-import java.util.Locale;
-
-/**
- * This interface supports complex text input, often for situations where
- * the text is more complex than a keyboard will accomodate. For example,
- * this can be used for Chinese, Japanese, and Korean, where multiple
- * keystrokes are necessary to compose text. This could also support things
- * like phonetic English, or reordering Thai.
- *
- * <p>These contexts can be loaded by the input method framework, using
- * {@link InputContext#selectInputMethod(Locale)}.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- * @status updated to 1.4
- */
-public interface InputMethod
-{
- /**
- * Set the input method context, which ties the input method to a client
- * component. This is called once automatically when creating the input
- * method.
- *
- * @param context the context for this input method
- * @throws NullPointerException if context is null
- */
- void setInputMethodContext(InputMethodContext context);
-
- /**
- * Sets the input locale. If the input method supports that locale, it
- * changes its behavior to be consistent with the locale and returns true.
- * Otherwise, it returns false. This is called by
- * {@link InputContext#selectInputMethod(Locale)} when the user specifies
- * a locale, or when the previously selected input method had a locale.
- *
- * @param locale the locale to use for input
- * @return true if the change is successful
- * @throws NullPointerException if locale is null
- */
- boolean setLocale(Locale locale);
-
- /**
- * Returns the current input locale, or null if none is defined. This is
- * called by {@link InputContext#getLocale()}, or before switching input
- * methods.
- *
- * @return the current input locale, or null
- */
- Locale getLocale();
-
- /**
- * Sets the allowed Unicode subsets that this input method can use. Null
- * indicates that all characters are allowed. This is called after creation,
- * or when switching to this input method, by
- * {@link InputContext#setCharacterSubsets(Character.Subset[])}.
- *
- * @param subsets the accepted subsets for this input method, or null for all
- */
- void setCharacterSubsets(Character.Subset[] subsets);
-
- /**
- * Changes the enabled status of this input method. An enabled input method
- * accepts incoming events for composition and control purposes, while a
- * disabled input method ignores events (except for control purposes). This
- * is called by {@link InputContext#setCompositionEnabled(boolean)} or when
- * switching from an input method if the previous input method returned
- * without exception on {@link #isCompositionEnabled()}.
- *
- * @param enable whether to enable this input method
- * @throws UnsupportedOperationException if enabling/disabling is unsupported
- * @see #isCompositionEnabled()
- */
- void setCompositionEnabled(boolean enable);
-
- /**
- * Find out if this input method is enabled. This is called by
- * {@link InputContext#isCompositionEnabled()}, or when switching input
- * methods via {@link InputContext#selectInputMethod(Locale)}.
- *
- * @return true if this input method is enabled
- * @throws UnsupportedOperationException if enabling/disabling is unsupported
- * @see #setCompositionEnabled(boolean)
- */
- boolean isCompositionEnabled();
-
- /**
- * Starts a reconversion operation. The input method gets its text from the
- * client, using {@link InputMethodRequests#getSelectedText(Attribute[])}.
- * Then the composed and committed text produced by the operation is sent
- * back to the client using a sequence of InputMethodEvents. This is called
- * by {@link InputContext#reconvert()}.
- *
- * @throws UnsupportedOperationException if reconversion is unsupported
- */
- void reconvert();
-
- /**
- * Dispatch an event to the input method. If input method support is enabled,
- * certain events are dispatched to the input method before the client
- * component or event listeners. The input method must either consume the
- * event or pass it on to the component. Instances of InputEvent, including
- * KeyEvent and MouseEvent, are given to this input method. This method is
- * called by {@link InputContext#dispatchEvent(AWTEvent)}.
- *
- * @param event the event to dispatch
- * @throws NullPointerException if event is null
- */
- void dispatchEvent(AWTEvent event);
-
- /**
- * Notify this input method of changes in the client window. This is called
- * when notifications are enabled (see {@link
- * InputMethodContext#enableClientWindowNotification(InputMethod, boolean)},
- * if {@link #removeNotify(Component)} has not been called. The following
- * situations trigger a notification:<ul>
- * <li>The client window changes in location, size, visibility,
- * iconification, or is closed.</li>
- * <li>When enabling client notification (or on the first activation after
- * enabling if no client existed at the time).</li>
- * <li>When activating a new client after <code>removeNotify</code> was
- * called on a previous client.</li>
- * </ul>
- *
- * @param bounds the client window's current bounds, or null
- */
- void notifyClientWindowChange(Rectangle bounds);
-
- /**
- * Activate this input method for input processing. If the input method
- * provides its own windows, it should make them open and visible at this
- * time. This method is called when a client component receives a
- * FOCUS_GAINED event, or when switching to this input method from another
- * one. It is only called when the input method is inactive, assuming that
- * new instances begin in an inactive state.
- */
- void activate();
-
- /**
- * Deactivate this input method, either temporarily or permanently for the
- * given client. If the input method provides its own windows, it should
- * only close those related to the current composition (such as a lookup
- * choice panel), while leaving more persistant windows (like a control
- * panel) open to avoid screen flicker. Before control is given to another
- * input method, {@link #hideWindows()} will be called on this instance.
- * This method is called when a client component receives a
- * FOCUS_LOST event, when switching to another input method, or before
- * {@link #removeNotify()} when the client is removed.
- *
- * @param isTemporary true if the focus change is temporary
- */
- void deactivate(boolean isTemporary);
-
- /**
- * Close or hide all windows opened by this input method. This is called
- * before activating a different input method, and before calling
- * {@link #dispose()} on this instance. It is only called when the input
- * method is inactive.
- */
- void hideWindows();
-
- /**
- * Notify the input method that a client component has been removed from its
- * hierarchy, or that input method support has been disabled. This is
- * called by {@link InputContext#removeNotify()}, and only when the input
- * method is inactive.
- */
- void removeNotify();
-
- /**
- * End any input composition currently taking place. Depending on the
- * platform and user preferences, this may commit or delete uncommitted text,
- * using input method events. This may be called for a variety of reasons,
- * such as when the user moves the insertion point in the client text outside
- * the range of the composed text, or when text is saved to file. This is
- * called by {@link InputContext#endComposition()}, when switching to a
- * new input method, or by {@link InputContext#selectInputMethod(Locale)}.
- */
- void endComposition();
-
- /**
- * Disposes the input method and release any resources it is using. In
- * particular, the input method should dispose windows and close files. This
- * is called by {@link InputContext#dispose()}, when the input method is
- * inactive; and nothing will be called on this instance afterwards.
- */
- void dispose();
-
- /**
- * Returns a control object from this input method, or null. A control object
- * provides method to control the behavior of this input method, as well as
- * query information about it. The object is implementation dependent, so
- * clients must compare the result against known input method control
- * object types. This is called by
- * {@link InputContext#getInputMethodControlObject()}.
- *
- * @return the control object, or null
- */
- Object getControlObject();
-} // interface InputMethod
diff --git a/libjava/java/awt/im/spi/InputMethodContext.java b/libjava/java/awt/im/spi/InputMethodContext.java
deleted file mode 100644
index 43bee8d8617..00000000000
--- a/libjava/java/awt/im/spi/InputMethodContext.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/* InputMethodContext.java -- communication between an input method and client
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.im.spi;
-
-import java.awt.Window;
-import java.awt.font.TextHitInfo;
-import java.awt.im.InputMethodRequests;
-import java.text.AttributedCharacterIterator;
-
-import javax.swing.JFrame;
-
-/**
- * Provides methods for the communication context between an input method
- * and the client component. This should be passed to
- * {@link InputMethod#setInputMethodContext(InputMethodContext)}.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- * @status updated to 1.4
- */
-public interface InputMethodContext extends InputMethodRequests
-{
- /**
- * Create an input method event and dispatch it to the client.
- *
- * @param id the event type
- * @param text an iterator over the text to be committed
- * @param count the count of characters to be committed
- * @param caret the insertion point of the commit, or null
- * @param visiblePosition the best location to make visible, or null
- */
- void dispatchInputMethodEvent(int id, AttributedCharacterIterator text,
- int count, TextHitInfo caret,
- TextHitInfo visiblePosition);
-
- /**
- * Creates a top-level window for use by the input method. This window should
- * float above all document windows and dialogs, not receive focus, and have
- * lightweight decorations (such as no title, reduced drag regions). But
- * this behavior may be modified to meet the platform style. The title may
- * or may not be displayed, depending on the platform.
- *
- * <p>If attachToInputContext is true, the new window will share the input
- * context of the input method, so that events in the new window are
- * dispatched to the input method. Also, this supresses deactivate and
- * activate calls to the input method caused by setVisible.
- *
- * @param title the window title, if one is displayed; null becomes ""
- * @param attachToInputContext true for the window to share context with
- * the input method
- * @return the new window for use by the input method
- * @throws HeadlessException if GraphicsEnvironment.isHeadless is true
- */
- Window createInputMethodWindow(String title, boolean attachToInputContext);
-
- /**
- * Creates a top-level Swing JFrame for use by the input method. This frame
- * should float above all document windows and dialogs, not receive focus,
- * and have lightweight decorations (such as no title, reduced drag
- * regions). But this behavior may be modified to meet the platform style.
- * The title may or may not be displayed, depending on the platform.
- *
- * <p>If attachToInputContext is true, the new window will share the input
- * context of the input method, so that events in the new window are
- * dispatched to the input method. Also, this supresses deactivate and
- * activate calls to the input method caused by setVisible.
- *
- * @param title the window title, if one is displayed; null becomes ""
- * @param attachToInputContext true for the window to share context with
- * the input method
- * @return the new window for use by the input method
- * @throws HeadlessException if GraphicsEnvironment.isHeadless is true
- * @since 1.4
- */
- JFrame createInputMethodJFrame(String title, boolean attachToInputContext);
-
- /**
- * Sets whether notification of the client window's location and state should
- * be enabled for the input method. When enabled, the input method's
- * {@link #notifyClientWindowChange(Rectangle)} method is called.
- * Notification is automatically disabled when the input method is disposed.
- *
- * @param inputMethod the method to change status of
- * @param enable true to enable notification
- */
- void enableClientWindowNotification(InputMethod inputMethod, boolean enable);
-} // interface InputMethodContext
diff --git a/libjava/java/awt/im/spi/InputMethodDescriptor.java b/libjava/java/awt/im/spi/InputMethodDescriptor.java
deleted file mode 100644
index 093d7319217..00000000000
--- a/libjava/java/awt/im/spi/InputMethodDescriptor.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* InputMethodDescriptor.java -- enables loading and use of an input method
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.im.spi;
-
-import java.awt.AWTException;
-import java.awt.Image;
-import java.util.Locale;
-
-/**
- * This interface provides information about an InputMethod before it is
- * loaded.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- * @status updated to 1.4
- */
-public interface InputMethodDescriptor
-{
- /**
- * Returns the locales supported by the input method this describes. This
- * allows the selection of input methods by locale (by language only, or
- * also by country and variant), via
- * {@link InputContext#selectInputMethod(Locale)}. The returned list should
- * ignore pass-through locales, so it is usually a subset of locales for
- * which {@link InputMethod#setContext(Locale)} returns true. If
- * {@link #hasDynamicLocaleList()} returns true, this is called each time
- * information is needed, allowing dynamic addition or removal of supported
- * locales.
- *
- * @return the list of supported locales
- * @throws AWTException if the input method is not available
- */
- Locale[] getAvailableLocales() throws AWTException;
-
- /**
- * Test whether the input method this describes has a static or dynamic
- * locale list. For example, this would return true if the list of supported
- * locales depends on adapters currently loaded over a network.
- *
- * @return true if the locale list is dynamic
- */
- boolean hasDynamicLocaleList();
-
- /**
- * Returns a user visible name of the input locale, displayed in the
- * specified locale. The inputLocale parameter must be one obtained from
- * the list in {@link #getAvailableLocales()}, or null for a
- * locale-independent description of the input method. If a translation to
- * the desired display language is not available, another language may be
- * used.
- *
- * @param inputLocale the locale of the input method, or null
- * @param displayLanguage the language of the result
- * @return the name of the input method when using the given inputLocale
- */
- String getInputMethodDisplayName(Locale inputLocale,
- Locale displayLanguage);
-
- /**
- * Returns a 16x16 icon for the input locale. The inputLocale parameter
- * must be one obtained from the list in {@link #getAvailableLocales()}, or
- * null for a locale-independent icon for the input method.
- *
- * @param inputLocale the locale of the input method, or null
- * @return a 16x16 icon for the input method when using the given inputLocale
- */
- Image getInputMethodIcon(Locale inputLocale);
-
- /**
- * Creates a new instance of the input method.
- *
- * @return the newly created input method
- * @throws Exception if anything goes wrong
- */
- InputMethod createInputMethod() throws Exception;
-
-} // interface InputMethodDescriptor
-
diff --git a/libjava/java/awt/image/AffineTransformOp.java b/libjava/java/awt/image/AffineTransformOp.java
deleted file mode 100644
index f11066e4e3d..00000000000
--- a/libjava/java/awt/image/AffineTransformOp.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/* AffineTransformOp.java -- This class performs affine
- transformation between two images or rasters in 2 dimensions.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.NoninvertibleTransformException;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.util.Arrays;
-
-/**
- * This class performs affine transformation between two images or
- * rasters in 2 dimensions.
- *
- * @author Olga Rodimina (rodimina@redhat.com)
- */
-public class AffineTransformOp implements BufferedImageOp, RasterOp
-{
- public static final int TYPE_NEAREST_NEIGHBOR = 1;
-
- public static final int TYPE_BILINEAR = 2;
-
- /**
- * @since 1.5.0
- */
- public static final int TYPE_BICUBIC = 3;
-
- private AffineTransform transform;
- private RenderingHints hints;
-
- /**
- * Construct AffineTransformOp with the given xform and interpolationType.
- * Interpolation type can be TYPE_BILINEAR, TYPE_BICUBIC or
- * TYPE_NEAREST_NEIGHBOR.
- *
- * @param xform AffineTransform that will applied to the source image
- * @param interpolationType type of interpolation used
- */
- public AffineTransformOp (AffineTransform xform, int interpolationType)
- {
- this.transform = xform;
- if (xform.getDeterminant() == 0)
- throw new ImagingOpException(null);
-
- switch (interpolationType)
- {
- case TYPE_BILINEAR:
- hints = new RenderingHints (RenderingHints.KEY_INTERPOLATION,
- RenderingHints.VALUE_INTERPOLATION_BILINEAR);
- break;
- case TYPE_BICUBIC:
- hints = new RenderingHints (RenderingHints.KEY_INTERPOLATION,
- RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- break;
- default:
- hints = new RenderingHints (RenderingHints.KEY_INTERPOLATION,
- RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
- }
- }
-
- /**
- * Construct AffineTransformOp with the given xform and rendering hints.
- *
- * @param xform AffineTransform that will applied to the source image
- * @param hints rendering hints that will be used during transformation
- */
- public AffineTransformOp (AffineTransform xform, RenderingHints hints)
- {
- this.transform = xform;
- this.hints = hints;
- if (xform.getDeterminant() == 0)
- throw new ImagingOpException(null);
- }
-
- /**
- * Creates empty BufferedImage with the size equal to that of the
- * transformed image and correct number of bands. The newly created
- * image is created with the specified ColorModel.
- * If the ColorModel is equal to null, then image is created
- * with the ColorModel of the source image.
- *
- * @param src source image
- * @param destCM color model for the destination image
- * @return new compatible destination image
- */
- public BufferedImage createCompatibleDestImage (BufferedImage src,
- ColorModel destCM)
- {
-
- // if destCm is not specified, use color model of the source image
-
- if (destCM == null)
- destCM = src.getColorModel ();
-
- return new BufferedImage (destCM,
- createCompatibleDestRaster (src.getRaster ()),
- src.isAlphaPremultiplied (),
- null);
-
- }
-
- /**
- * Creates empty WritableRaster with the size equal to the transformed
- * source raster and correct number of bands
- *
- * @param src source raster
- * @throws RasterFormatException if resulting width or height of raster is 0
- * @return new compatible raster
- */
- public WritableRaster createCompatibleDestRaster (Raster src)
- {
- Rectangle rect = (Rectangle) getBounds2D (src);
-
- // throw RasterFormatException if resulting width or height of the
- // transformed raster is 0
-
- if (rect.getWidth () == 0 || rect.getHeight () == 0)
- throw new RasterFormatException("width or height is 0");
-
- return src.createCompatibleWritableRaster ((int) rect.getWidth (),
- (int) rect.getHeight ());
- }
-
- /**
- * Transforms source image using transform specified at the constructor.
- * The resulting transformed image is stored in the destination image.
- *
- * @param src source image
- * @param dst destination image
- * @return transformed source image
- */
- public final BufferedImage filter (BufferedImage src, BufferedImage dst)
- {
-
- if (dst == src)
- throw new IllegalArgumentException ("src image cannot be the same as the dst image");
-
- // If the destination image is null, then BufferedImage is
- // created with ColorModel of the source image
-
- if (dst == null)
- dst = createCompatibleDestImage(src, src.getColorModel ());
-
- // FIXME: Must check if color models of src and dst images are the same.
- // If it is not, then source image should be converted to color model
- // of the destination image
-
- Graphics2D gr = (Graphics2D) dst.createGraphics ();
- gr.setRenderingHints (hints);
- gr.drawImage (src, transform, null);
- return dst;
-
- }
-
- /**
- * Transforms source raster using transform specified at the constructor.
- * The resulting raster is stored in the destination raster.
- *
- * @param src source raster
- * @param dst destination raster
- * @return transformed raster
- */
- public final WritableRaster filter (Raster src, WritableRaster dst)
- {
- if (dst == src)
- throw new IllegalArgumentException("src image cannot be the same as"
- + " the dst image");
-
- if (dst == null)
- dst = createCompatibleDestRaster(src);
-
- if (src.getNumBands() != dst.getNumBands())
- throw new IllegalArgumentException("src and dst must have same number"
- + " of bands");
-
- double[] dpts = new double[dst.getWidth() * 2];
- double[] pts = new double[dst.getWidth() * 2];
- for (int x = 0; x < dst.getWidth(); x++)
- {
- dpts[2 * x] = x + dst.getMinX();
- dpts[2 * x + 1] = x;
- }
- Rectangle srcbounds = src.getBounds();
- if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
- {
- for (int y = dst.getMinY(); y < dst.getMinY() + dst.getHeight(); y++)
- {
- try {
- transform.inverseTransform(dpts, 0, pts, 0, dst.getWidth() * 2);
- } catch (NoninvertibleTransformException e) {
- // Can't happen since the constructor traps this
- e.printStackTrace();
- }
-
- for (int x = 0; x < dst.getWidth(); x++)
- {
- if (!srcbounds.contains(pts[2 * x], pts[2 * x + 1]))
- continue;
- dst.setDataElements(x + dst.getMinX(), y,
- src.getDataElements((int)pts[2 * x],
- (int)pts[2 * x + 1],
- null));
- }
- }
- }
- else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
- {
- double[] tmp = new double[4 * src.getNumBands()];
- for (int y = dst.getMinY(); y < dst.getMinY() + dst.getHeight(); y++)
- {
- try {
- transform.inverseTransform(dpts, 0, pts, 0, dst.getWidth() * 2);
- } catch (NoninvertibleTransformException e) {
- // Can't happen since the constructor traps this
- e.printStackTrace();
- }
-
- for (int x = 0; x < dst.getWidth(); x++)
- {
- if (!srcbounds.contains(pts[2 * x], pts[2 * x + 1]))
- continue;
- int xx = (int)pts[2 * x];
- int yy = (int)pts[2 * x + 1];
- double dx = (pts[2 * x] - xx);
- double dy = (pts[2 * x + 1] - yy);
-
- // TODO write this more intelligently
- if (xx == src.getMinX() + src.getWidth() - 1 ||
- yy == src.getMinY() + src.getHeight() - 1)
- {
- // bottom or right edge
- Arrays.fill(tmp, 0);
- src.getPixel(xx, yy, tmp);
- }
- else
- {
- // Normal case
- src.getPixels(xx, yy, 2, 2, tmp);
- for (int b = 0; b < src.getNumBands(); b++)
- tmp[b] = dx * dy * tmp[b]
- + (1 - dx) * dy * tmp[b + src.getNumBands()]
- + dx * (1 - dy) * tmp[b + 2 * src.getNumBands()]
- + (1 - dx) * (1 - dy) * tmp[b + 3 * src.getNumBands()];
- }
- dst.setPixel(x, y, tmp);
- }
- }
- }
- else
- {
- // Bicubic
- throw new UnsupportedOperationException("not implemented yet");
- }
-
- return dst;
- }
-
- /**
- * Transforms source image using transform specified at the constructor and
- * returns bounds of the transformed image.
- *
- * @param src image to be transformed
- * @return bounds of the transformed image.
- */
- public final Rectangle2D getBounds2D (BufferedImage src)
- {
- return getBounds2D (src.getRaster());
- }
-
- /**
- * Returns bounds of the transformed raster.
- *
- * @param src raster to be transformed
- * @return bounds of the transformed raster.
- */
- public final Rectangle2D getBounds2D (Raster src)
- {
- // determine new size for the transformed raster.
- // Need to calculate transformed coordinates of the lower right
- // corner of the raster. The upper left corner is always (0,0)
-
- double x2 = (double) src.getWidth () + src.getMinX ();
- double y2 = (double) src.getHeight () + src.getMinY ();
- Point2D p2 = getPoint2D (new Point2D.Double (x2,y2), null);
-
- Rectangle2D rect = new Rectangle (0, 0, (int) p2.getX (), (int) p2.getY ());
- return rect.getBounds ();
- }
-
- /**
- * Returns interpolation type used during transformations
- *
- * @return interpolation type
- */
- public final int getInterpolationType ()
- {
- if(hints.containsValue (RenderingHints.VALUE_INTERPOLATION_BILINEAR))
- return TYPE_BILINEAR;
- else
- return TYPE_NEAREST_NEIGHBOR;
- }
-
- /**
- * Returns location of the transformed source point. The resulting point
- * is stored in the dstPt if one is specified.
- *
- * @param srcPt point to be transformed
- * @param dstPt destination point
- * @return the location of the transformed source point.
- */
- public Point2D getPoint2D (Point2D srcPt, Point2D dstPt)
- {
- return transform.transform (srcPt, dstPt);
- }
-
- /**
- * Returns rendering hints that are used during transformation.
- *
- * @return rendering hints
- */
- public final RenderingHints getRenderingHints ()
- {
- return hints;
- }
-
- /**
- * Returns transform used in transformation between source and destination
- * image.
- *
- * @return transform
- */
- public final AffineTransform getTransform ()
- {
- return transform;
- }
-}
diff --git a/libjava/java/awt/image/AreaAveragingScaleFilter.java b/libjava/java/awt/image/AreaAveragingScaleFilter.java
deleted file mode 100644
index b9ca1b70758..00000000000
--- a/libjava/java/awt/image/AreaAveragingScaleFilter.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/* AreaAveragingScaleFilter.java -- Java class for filtering images
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * This filter should produce images which do not have image artifacts
- * like broken lines which were originally unbroken. The cost is of
- * course speed. Using bi-linear interpolation here against 4 pixel
- * points should give the desired results although Sun does not
- * specify what the exact algorithm should be.
- * <br>
- * Currently this filter does nothing and needs to be implemented.
- *
- * @author C. Brian Jones (cbj@gnu.org)
- */
-public class AreaAveragingScaleFilter extends ReplicateScaleFilter
-{
- /**
- * Construct an instance of <code>AreaAveragingScaleFilter</code> which
- * should be used in conjunction with a <code>FilteredImageSource</code>
- * object.
- *
- * @param width the width of the destination image
- * @param height the height of the destination image
- */
- public AreaAveragingScaleFilter(int width, int height) {
- super(width, height);
- }
-
- /**
- * The <code>ImageProducer</code> should call this method with a
- * bit mask of hints from any of <code>RANDOMPIXELORDER</code>,
- * <code>TOPDOWNLEFTRIGHT</code>, <code>COMPLETESCANLINES</code>,
- * <code>SINGLEPASS</code>, <code>SINGLEFRAME</code> from the
- * <code>ImageConsumer</code> interface.
- * <br>
- * FIXME - more than likely Sun's implementation desires
- * <code>TOPDOWNLEFTRIGHT</code> order and this method is overloaded here
- * in order to assure that mask is part of the hints added to
- * the consumer.
- *
- * @param flags a bit mask of hints
- * @see ImageConsumer
- */
- public void setHints(int flags)
- {
- consumer.setHints(flags);
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as a <code>byte</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels, int offset, int scansize)
- {
- consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as an <code>int</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels, int offset, int scansize)
- {
- consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
- }
-
-}
-
diff --git a/libjava/java/awt/image/BandCombineOp.java b/libjava/java/awt/image/BandCombineOp.java
deleted file mode 100644
index 79efb02e713..00000000000
--- a/libjava/java/awt/image/BandCombineOp.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Point;
-import java.awt.RenderingHints;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-
-/**
- * Filter Raster pixels by applying a matrix.
- *
- * BandCombineOp applies a matrix to each pixel to produce new pixel values.
- * The width of the matrix must be the same or one more than the number of
- * bands in the source Raster. If one more, the pixels in the source are
- * assumed to contain an implicit 1.0 at the end.
- *
- * The rows of the matrix are multiplied by the pixel to produce the values
- * for the destination. Therefore the destination Raster must contain the
- * same number of bands as the number of rows in the filter matrix.
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- */
-public class BandCombineOp implements RasterOp
-{
- private RenderingHints hints;
- private float[][] matrix;
-
- /**
- * Construct a BandCombineOp.
- *
- * @param matrix The matrix to filter pixels with.
- * @param hints Rendering hints to apply. Ignored.
- */
- public BandCombineOp(float[][] matrix, RenderingHints hints)
- {
- this.matrix = matrix;
- this.hints = hints;
- }
-
- /**
- * Filter Raster pixels through a matrix.
- *
- * Applies the Op matrix to source pixes to produce dest pixels. Each row
- * of the matrix is multiplied by the src pixel components to produce the
- * dest pixel. If matrix is one more than the number of bands in the src,
- * the last element is implicitly multiplied by 1, i.e. added to the sum
- * for that dest component.
- *
- * If dest is null, a suitable Raster is created. This implementation uses
- * createCompatibleDestRaster.
- *
- * @param src The source Raster.
- * @param dest The destination Raster, or null.
- * @returns The destination Raster or an allocated Raster.
- * @see java.awt.image.RasterOp#filter(java.awt.image.Raster,
- *java.awt.image.WritableRaster)
- */
- public WritableRaster filter(Raster src, WritableRaster dest) {
- if (dest == null)
- dest = createCompatibleDestRaster(src);
-
- // Filter the pixels
- float[] spix = new float[matrix[0].length];
- float[] dpix = new float[matrix.length];
- for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
- for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
- {
- // In case matrix rows have implicit translation
- spix[spix.length - 1] = 1.0f;
- src.getPixel(x, y, spix);
- for (int i = 0; i < matrix.length; i++)
- {
- dpix[i] = 0;
- for (int j = 0; j < matrix[0].length; j++)
- dpix[i] += spix[j] * matrix[i][j];
- }
- dest.setPixel(x, y, dpix);
- }
-
- return dest;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#getBounds2D(java.awt.image.Raster)
- */
- public Rectangle2D getBounds2D(Raster src)
- {
- return src.getBounds();
- }
-
- /**
- * Creates a new WritableRaster that can be used as the destination for this
- * Op. This implementation creates a Banded Raster with data type FLOAT.
- * @see
- *java.awt.image.RasterOp#createCompatibleDestRaster(java.awt.image.Raster)
- */
- public WritableRaster createCompatibleDestRaster(Raster src)
- {
- return Raster.createBandedRaster(DataBuffer.TYPE_FLOAT, src.getWidth(),
- src.getHeight(), matrix.length,
- new Point(src.getMinX(), src.getMinY()));
- }
-
- /** Return corresponding destination point for source point.
- *
- * LookupOp will return the value of src unchanged.
- * @param src The source point.
- * @param dst The destination point.
- * @see java.awt.image.RasterOp#getPoint2D(java.awt.geom.Point2D,
- *java.awt.geom.Point2D)
- */
- public Point2D getPoint2D(Point2D src, Point2D dst)
- {
- if (dst == null) return (Point2D)src.clone();
- dst.setLocation(src);
- return dst;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#getRenderingHints()
- */
- public RenderingHints getRenderingHints()
- {
- return hints;
- }
-
- /** Return the matrix for this Op. */
- public float[][] getMatrix()
- {
- return matrix;
- }
-
-}
diff --git a/libjava/java/awt/image/BandedSampleModel.java b/libjava/java/awt/image/BandedSampleModel.java
deleted file mode 100644
index cf7a0c546de..00000000000
--- a/libjava/java/awt/image/BandedSampleModel.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/* Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * MultiPixelPackedSampleModel provides a single band model that supports
- * multiple pixels in a single unit. Pixels have 2^n bits and 2^k pixels fit
- * per data element.
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- */
-public final class BandedSampleModel extends ComponentSampleModel
-{
- private int[] bitMasks;
- private int[] bitOffsets;
- private int[] sampleSize;
- private int dataBitOffset;
- private int elemBits;
- private int numberOfBits;
- private int numElems;
-
- public BandedSampleModel(int dataType, int w, int h, int numBands)
- {
- super(dataType, w, h, 1, w, new int[numBands]);
- }
-
- public BandedSampleModel(int dataType, int w, int h, int scanlineStride,
- int[] bankIndices, int[] bandOffsets)
- {
- super(dataType, w, h, 1, scanlineStride, bankIndices, bandOffsets);
- }
-
- public SampleModel createCompatibleSampleModel(int w, int h)
- {
- // NOTE: blackdown 1.4.1 sets all offsets to 0. Sun's 1.4.2 docs
- // disagree.
-
- // Compress offsets so minimum is 0, others w*scanlineStride
- int[] newoffsets = new int[bandOffsets.length];
- int[] order = new int[bandOffsets.length];
- for (int i=0; i < bandOffsets.length; i++)
- order[i] = i;
- // FIXME: This is N^2, but not a big issue, unless there's a lot of
- // bands...
- for (int i=0; i < bandOffsets.length; i++)
- for (int j=i+1; j < bandOffsets.length; i++)
- if (bankIndices[order[i]] > bankIndices[order[j]]
- || (bankIndices[order[i]] == bankIndices[order[j]]
- && bandOffsets[order[i]] > bandOffsets[order[j]]))
- {
- int t = order[i]; order[i] = order[j]; order[j] = t;
- }
- int bank = 0;
- int offset = 0;
- for (int i=0; i < bandOffsets.length; i++)
- {
- if (bankIndices[order[i]] != bank)
- {
- bank = bankIndices[order[i]];
- offset = 0;
- }
- newoffsets[order[i]] = offset;
- offset += w * scanlineStride;
- }
-
- return new BandedSampleModel(dataType, w, h, scanlineStride, bankIndices, newoffsets);
- }
-
-
- public SampleModel createSubsetSampleModel(int[] bands)
- {
- int[] newoff = new int[bands.length];
- int[] newbanks = new int[bands.length];
- for (int i=0; i < bands.length; i++)
- {
- int b = bands[i];
- newoff[i] = bandOffsets[b];
- newbanks[i] = bankIndices[b];
- }
-
- if (bands.length > bankIndices.length)
- throw new
- RasterFormatException("BandedSampleModel createSubsetSampleModel too"
- +" many bands");
-
- return new BandedSampleModel(dataType, width, height, scanlineStride,
- newbanks, newoff);
- }
-
- /**
- * Extract all samples of one pixel and return in an array of transfer type.
- *
- * Extracts the pixel at x, y from data and stores samples into the array
- * obj. If obj is null, a new array of getTransferType() is created.
- *
- * @param x The x-coordinate of the pixel rectangle to store in <code>obj</code>.
- * @param y The y-coordinate of the pixel rectangle to store in <code>obj</code>.
- * @param obj The primitive array to store the pixels into or null to force creation.
- * @param data The DataBuffer that is the source of the pixel data.
- * @return The primitive array containing the pixel data.
- * @see java.awt.image.SampleModel#getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)
- */
- public Object getDataElements(int x, int y, Object obj,
- DataBuffer data)
- {
- int pixel = getSample(x, y, 0, data);
- switch (getTransferType())
- {
- case DataBuffer.TYPE_BYTE:
- {
- byte[] b = (byte[])obj;
- if (b == null) b = new byte[numBands];
- for (int i=0; i < numBands; i++)
- b[i] = (byte)getSample(x, y, i, data);
- return b;
- }
- case DataBuffer.TYPE_SHORT:
- case DataBuffer.TYPE_USHORT:
- {
- short[] b = (short[])obj;
- if (b == null) b = new short[numBands];
- for (int i=0; i < numBands; i++)
- b[i] = (short)getSample(x, y, i, data);
- return b;
- }
- case DataBuffer.TYPE_INT:
- {
- int[] b = (int[])obj;
- if (b == null) b = new int[numBands];
- for (int i=0; i < numBands; i++)
- b[i] = getSample(x, y, i, data);
- return b;
- }
- case DataBuffer.TYPE_FLOAT:
- {
- float[] b = (float[])obj;
- if (b == null) b = new float[numBands];
- for (int i=0; i < numBands; i++)
- b[i] = getSampleFloat(x, y, i, data);
- return b;
- }
- case DataBuffer.TYPE_DOUBLE:
- {
- double[] b = (double[])obj;
- if (b == null) b = new double[numBands];
- for (int i=0; i < numBands; i++)
- b[i] = getSample(x, y, i, data);
- return b;
- }
-
- default:
- // Seems like the only sensible thing to do.
- throw new ClassCastException();
- }
- }
-
- public int[] getPixel(int x, int y, int[] iArray, DataBuffer data)
- {
- if (iArray == null) iArray = new int[numBands];
- for (int i=0; i < numBands; i++)
- iArray[i] = getSample(x, y, 0, data);
-
- return iArray;
- }
-
- /**
- * Copy pixels from a region into an array.
- *
- * Copies the samples of the pixels in the rectangle starting at x, y that
- * is w pixels wide and h scanlines high. When there is more than one band,
- * the samples stored in order before the next pixel. This ordering isn't
- * well specified in Sun's docs as of 1.4.2.
- *
- * If iArray is null, a new array is allocated, filled, and returned.
- *
- * @param x The x-coordinate of the pixel rectangle to store in
- * <code>iArray</code>.
- * @param y The y-coordinate of the pixel rectangle to store in
- * <code>iArray</code>.
- * @param w The width in pixels of the rectangle.
- * @param h The height in pixels of the rectangle.
- * @param iArray The int array to store the pixels into or null to force
- * creation.
- * @param data The DataBuffer that is the source of the pixel data.
- * @return The primitive array containing the pixel data.
- */
- public int[] getPixels(int x, int y, int w, int h, int[] iArray,
- DataBuffer data)
- {
- if (iArray == null) iArray = new int[w*h*numBands];
- int outOffset = 0;
- for (y=0; y<h; y++)
- {
- for (x=0; x<w;)
- {
- for (int b=0; b < numBands; b++)
- {
- int offset = bandOffsets[b] + y * scanlineStride + x;
- iArray[outOffset++] =
- data.getElem(bankIndices[b], offset);
- }
- }
- }
- return iArray;
- }
-
- public int getSample(int x, int y, int b, DataBuffer data)
- {
- int offset = bandOffsets[b] + y * scanlineStride + x;
- return data.getElem(bankIndices[b], offset);
- }
-
- public float getSampleFloat(int x, int y, int b, DataBuffer data)
- {
- int offset = bandOffsets[b] + y * scanlineStride + x;
- return data.getElemFloat(bankIndices[b], offset);
- }
-
- public double getSampleDouble(int x, int y, int b, DataBuffer data)
- {
- int offset = bandOffsets[b] + y * scanlineStride + x;
- return data.getElemDouble(bankIndices[b], offset);
- }
-
- /**
- * Copy one band's samples from a region into an array.
- *
- * Copies from one band the samples of the pixels in the rectangle starting
- * at x, y that is w pixels wide and h scanlines high.
- *
- * If iArray is null, a new array is allocated, filled, and returned.
- *
- * @param x The x-coordinate of the pixel rectangle to store in
- * <code>iArray</code>.
- * @param y The y-coordinate of the pixel rectangle to store in
- * <code>iArray</code>.
- * @param w The width in pixels of the rectangle.
- * @param h The height in pixels of the rectangle.
- * @param b The band to retrieve.
- * @param iArray The int array to store the pixels into or null to force
- * creation.
- * @param data The DataBuffer that is the source of the pixel data.
- * @return The primitive array containing the pixel data.
- */
- public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray,
- DataBuffer data)
- {
- if (iArray == null) iArray = new int[w*h];
- int outOffset = 0;
- for (y=0; y<h; y++)
- {
- for (x=0; x<w;)
- {
- int offset = bandOffsets[b] + y * scanlineStride + x;
- iArray[outOffset++] =
- data.getElem(bankIndices[b], offset);
- }
- }
- return iArray;
- }
-
-
- /**
- * Set the pixel at x, y to the value in the first element of the primitive
- * array obj.
- *
- * @param x The x-coordinate of the data elements in <code>obj</code>.
- * @param y The y-coordinate of the data elements in <code>obj</code>.
- * @param obj The primitive array containing the data elements to set.
- * @param data The DataBuffer to store the data elements into.
- * @see java.awt.image.SampleModel#setDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer)
- */
- public void setDataElements(int x, int y, Object obj, DataBuffer data)
- {
- int transferType = getTransferType();
- if (getTransferType() != data.getDataType())
- {
- throw new IllegalArgumentException("transfer type ("+
- getTransferType()+"), "+
- "does not match data "+
- "buffer type (" +
- data.getDataType() +
- ").");
- }
-
- int offset = y * scanlineStride + x;
-
- try
- {
- switch (transferType)
- {
- case DataBuffer.TYPE_BYTE:
- {
- DataBufferByte out = (DataBufferByte) data;
- byte[] in = (byte[]) obj;
- for (int i=0; i < numBands; i++)
- out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0];
- return;
- }
- case DataBuffer.TYPE_SHORT:
- {
- DataBufferShort out = (DataBufferShort) data;
- short[] in = (short[]) obj;
- for (int i=0; i < numBands; i++)
- out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0];
- return;
- }
- case DataBuffer.TYPE_USHORT:
- {
- DataBufferUShort out = (DataBufferUShort) data;
- short[] in = (short[]) obj;
- for (int i=0; i < numBands; i++)
- out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0];
- return;
- }
- case DataBuffer.TYPE_INT:
- {
- DataBufferInt out = (DataBufferInt) data;
- int[] in = (int[]) obj;
- for (int i=0; i < numBands; i++)
- out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0];
- return;
- }
- case DataBuffer.TYPE_FLOAT:
- {
- DataBufferFloat out = (DataBufferFloat) data;
- float[] in = (float[]) obj;
- for (int i=0; i < numBands; i++)
- out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0];
- return;
- }
- case DataBuffer.TYPE_DOUBLE:
- {
- DataBufferDouble out = (DataBufferDouble) data;
- double[] in = (double[]) obj;
- for (int i=0; i < numBands; i++)
- out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0];
- return;
- }
- default:
- throw new ClassCastException("Unsupported data type");
- }
- }
- catch (ArrayIndexOutOfBoundsException aioobe)
- {
- String msg = "While writing data elements" +
- ", x="+x+", y="+y+
- ", width="+width+", height="+height+
- ", scanlineStride="+scanlineStride+
- ", offset="+offset+
- ", data.getSize()="+data.getSize()+
- ", data.getOffset()="+data.getOffset()+
- ": " +
- aioobe;
- throw new ArrayIndexOutOfBoundsException(msg);
- }
- }
-
- public void setPixel(int x, int y, int[] iArray, DataBuffer data)
- {
- for (int b=0; b < numBands; b++)
- data.setElem(bankIndices[b], bandOffsets[b] + y * scanlineStride + x,
- iArray[b]);
- }
-
- public void setPixels(int x, int y, int w, int h, int[] iArray,
- DataBuffer data)
- {
- int inOffset = 0;
- for (int hh = 0; hh < h; hh++)
- {
- for (int ww = 0; ww < w; ww++)
- {
- int offset = y * scanlineStride + (x + ww);
- for (int b=0; b < numBands; b++)
- data.setElem(bankIndices[b], bandOffsets[b] + offset,
- iArray[inOffset++]);
- }
- y++;
- }
- }
-
- public void setSample(int x, int y, int b, int s, DataBuffer data)
- {
- data.setElem(bankIndices[b], bandOffsets[b] + y * scanlineStride + x, s);
- }
-
- public void setSample(int x, int y, int b, float s, DataBuffer data)
- {
- data.setElemFloat(bankIndices[b], bandOffsets[b] + y * scanlineStride + x, s);
- }
-
- public void setSample(int x, int y, int b, double s, DataBuffer data)
- {
- data.setElemDouble(bankIndices[b], bandOffsets[b] + y * scanlineStride + x, s);
- }
-
- public void setSamples(int x, int y, int w, int h, int b, int[] iArray,
- DataBuffer data)
- {
- int inOffset = 0;
-
- switch (getTransferType())
- {
- case DataBuffer.TYPE_BYTE:
- {
- DataBufferByte out = (DataBufferByte) data;
- byte[] bank = out.getData(bankIndices[b]);
- for (int hh = 0; hh < h; hh++)
- {
- for (int ww = 0; ww < w; ww++)
- {
- int offset = bandOffsets[b] + y * scanlineStride + (x + ww);
- bank[offset] = (byte)iArray[inOffset++];
- }
- y++;
- }
- return;
- }
- case DataBuffer.TYPE_SHORT:
- {
- DataBufferShort out = (DataBufferShort) data;
- short[] bank = out.getData(bankIndices[b]);
- for (int hh = 0; hh < h; hh++)
- {
- for (int ww = 0; ww < w; ww++)
- {
- int offset = bandOffsets[b] + y * scanlineStride + (x + ww);
- bank[offset] = (short)iArray[inOffset++];
- }
- y++;
- }
- return;
- }
- case DataBuffer.TYPE_USHORT:
- {
- DataBufferShort out = (DataBufferShort) data;
- short[] bank = out.getData(bankIndices[b]);
- for (int hh = 0; hh < h; hh++)
- {
- for (int ww = 0; ww < w; ww++)
- {
- int offset = bandOffsets[b] + y * scanlineStride + (x + ww);
- bank[offset] = (short)iArray[inOffset++];
- }
- y++;
- }
- return;
- }
- case DataBuffer.TYPE_INT:
- {
- DataBufferInt out = (DataBufferInt) data;
- int[] bank = out.getData(bankIndices[b]);
- for (int hh = 0; hh < h; hh++)
- {
- for (int ww = 0; ww < w; ww++)
- {
- int offset = bandOffsets[b] + y * scanlineStride + (x + ww);
- bank[offset] = iArray[inOffset++];
- }
- y++;
- }
- return;
- }
- case DataBuffer.TYPE_FLOAT:
- case DataBuffer.TYPE_DOUBLE:
- break;
- default:
- throw new ClassCastException("Unsupported data type");
- }
-
- // Default implementation probably slower for float and double
- for (int hh = 0; hh < h; hh++)
- {
- for (int ww = 0; ww < w; ww++)
- {
- int offset = bandOffsets[b] + y * scanlineStride + (x + ww);
- data.setElem(bankIndices[b], offset, iArray[inOffset++]);
- }
- y++;
- }
- }
-
- /**
- * Creates a String with some information about this SampleModel.
- * @return A String describing this SampleModel.
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- StringBuffer result = new StringBuffer();
- result.append(getClass().getName());
- result.append("[");
- result.append("scanlineStride=").append(scanlineStride);
- for(int i=0; i < bitMasks.length; i+=1)
- {
- result.append(", mask[").append(i).append("]=0x").append(Integer.toHexString(bitMasks[i]));
- }
-
- result.append("]");
- return result.toString();
- }
-}
diff --git a/libjava/java/awt/image/BufferStrategy.java b/libjava/java/awt/image/BufferStrategy.java
deleted file mode 100644
index e86aad60fe9..00000000000
--- a/libjava/java/awt/image/BufferStrategy.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/* BufferStrategy.java -- describes image buffering resources
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.BufferCapabilities;
-import java.awt.Graphics;
-
-/**
- * This class describes a strategy for managing image buffering
- * resources on a Canvas or Window. A given buffer strategy may make
- * use of hardware acceleration or take advantage of features of the
- * native graphics system. Examples of buffering strategies are
- * double or triple buffering using either flipping or blitting. For
- * the details of these algorithms see BufferCapabilities.
- *
- * To use a buffer strategy, you retrieve it from either the current
- * GraphicsConfiguration or from the Component on which you'd like to
- * draw. Then you can query the strategy's capabilities to make sure
- * they're suitable.
- *
- * If the strategy's capabilities are suitable, you can obtain a
- * graphics object and use it to draw with this strategy. Drawing
- * with a buffer strategy requires extra care, however. You'll need
- * to manually cause the next buffer to be shown on the output device.
- * And since buffer strategies are usually implemented with a
- * VolatileImage, you must frequently check that the contents of the
- * buffer are valid and that the buffer still exists.
- *
- * A buffer strategy is usually implemented using a VolatileImage.
- *
- * @see VolatileImage
- * @since 1.4
- */
-public abstract class BufferStrategy
-{
- /**
- * Creates a new buffer strategy.
- */
- public BufferStrategy()
- {
- }
-
- /**
- * Retrieves the capabilities of this buffer strategy.
- *
- * @return this buffer strategy's capabilities
- */
- public abstract BufferCapabilities getCapabilities();
-
- /**
- * Retrieves a graphics object that can be used to draw using this
- * buffer strategy. This method may not be synchronized so be
- * careful when calling it from multiple threads. You also must
- * manually dispose of this graphics object.
- *
- * @return a graphics object that can be used to draw using this
- * buffer strategy
- */
- public abstract Graphics getDrawGraphics();
-
- /**
- * Returns whether or not the buffer's resources have been reclaimed
- * by the native graphics system. If the buffer resources have been
- * lost then you'll need to obtain new resources before drawing
- * again. For details, see the documentation for VolatileImage.
- *
- * @return true if the contents were lost, false otherwise
- */
- public abstract boolean contentsLost();
-
- /**
- * Returns whether or not the buffer's resources were re-created and
- * cleared to the default background color. If the buffer's
- * resources have recently been re-created and initialized then the
- * buffer's image may need to be re-rendered. For details, see the
- * documentation for VolatileImage.
- *
- * @return true if the contents were restored, false otherwise
- */
- public abstract boolean contentsRestored();
-
- /**
- * Applies this buffer strategy. In other words, this method brings
- * the contents of the back or intermediate buffers to the front
- * buffer.
- */
- public abstract void show();
-}
diff --git a/libjava/java/awt/image/BufferedImage.java b/libjava/java/awt/image/BufferedImage.java
deleted file mode 100644
index 40da1b61910..00000000000
--- a/libjava/java/awt/image/BufferedImage.java
+++ /dev/null
@@ -1,693 +0,0 @@
-/* BufferedImage.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import gnu.java.awt.ComponentDataBlitOp;
-
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.GraphicsEnvironment;
-import java.awt.Image;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.Transparency;
-import java.awt.color.ColorSpace;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-/**
- * A buffered image always starts at coordinates (0, 0).
- *
- * The buffered image is not subdivided into multiple tiles. Instead,
- * the image consists of one large tile (0,0) with the width and
- * height of the image. This tile is always considered to be checked
- * out.
- *
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public class BufferedImage extends Image
- implements WritableRenderedImage
-{
- public static final int TYPE_CUSTOM = 0,
- TYPE_INT_RGB = 1,
- TYPE_INT_ARGB = 2,
- TYPE_INT_ARGB_PRE = 3,
- TYPE_INT_BGR = 4,
- TYPE_3BYTE_BGR = 5,
- TYPE_4BYTE_ABGR = 6,
- TYPE_4BYTE_ABGR_PRE = 7,
- TYPE_USHORT_565_RGB = 8,
- TYPE_USHORT_555_RGB = 9,
- TYPE_BYTE_GRAY = 10,
- TYPE_USHORT_GRAY = 11,
- TYPE_BYTE_BINARY = 12,
- TYPE_BYTE_INDEXED = 13;
-
- static final int[] bits3 = { 8, 8, 8 };
- static final int[] bits4 = { 8, 8, 8 };
- static final int[] bits1byte = { 8 };
- static final int[] bits1ushort = { 16 };
-
- static final int[] masks_int = { 0x00ff0000,
- 0x0000ff00,
- 0x000000ff,
- DataBuffer.TYPE_INT };
- static final int[] masks_565 = { 0xf800,
- 0x07e0,
- 0x001f,
- DataBuffer.TYPE_USHORT};
- static final int[] masks_555 = { 0x7c00,
- 0x03e0,
- 0x001f,
- DataBuffer.TYPE_USHORT};
-
- Vector observers;
-
- public BufferedImage(int w, int h, int type)
- {
- ColorModel cm = null;
-
- boolean alpha = false;
- boolean premultiplied = false;
- switch (type)
- {
- case TYPE_4BYTE_ABGR_PRE:
- case TYPE_INT_ARGB_PRE:
- premultiplied = true;
- // fall through
- case TYPE_INT_ARGB:
- case TYPE_4BYTE_ABGR:
- alpha = true;
- }
-
- ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
- switch (type)
- {
- case TYPE_INT_RGB:
- case TYPE_INT_ARGB:
- case TYPE_INT_ARGB_PRE:
- case TYPE_USHORT_565_RGB:
- case TYPE_USHORT_555_RGB:
- int[] masks = null;
- switch (type)
- {
- case TYPE_INT_RGB:
- case TYPE_INT_ARGB:
- case TYPE_INT_ARGB_PRE:
- masks = masks_int;
- break;
- case TYPE_USHORT_565_RGB:
- masks = masks_565;
- break;
- case TYPE_USHORT_555_RGB:
- masks = masks_555;
- break;
- }
-
- cm = new DirectColorModel(cs,
- 32, // 32 bits in an int
- masks[0], // r
- masks[1], // g
- masks[2], // b
- alpha ? 0xff000000 : 0,
- premultiplied,
- masks[3] // data type
- );
- break;
-
- case TYPE_INT_BGR:
- String msg =
- "FIXME: Programmer is confused. Why (and how) does a " +
- "TYPE_INT_BGR image use ComponentColorModel to store " +
- "8-bit values? Is data type TYPE_INT or TYPE_BYTE. What " +
- "is the difference between TYPE_INT_BGR and TYPE_3BYTE_BGR?";
- throw new UnsupportedOperationException(msg);
-
- case TYPE_3BYTE_BGR:
- case TYPE_4BYTE_ABGR:
- case TYPE_4BYTE_ABGR_PRE:
- case TYPE_BYTE_GRAY:
- case TYPE_USHORT_GRAY:
- int[] bits = null;
- int dataType = DataBuffer.TYPE_BYTE;
- switch (type) {
- case TYPE_3BYTE_BGR:
- bits = bits3;
- break;
- case TYPE_4BYTE_ABGR:
- case TYPE_4BYTE_ABGR_PRE:
- bits = bits4;
- break;
- case TYPE_BYTE_GRAY:
- bits = bits1byte;
- break;
- case TYPE_USHORT_GRAY:
- bits = bits1ushort;
- dataType = DataBuffer.TYPE_USHORT;
- break;
- }
- cm = new ComponentColorModel(cs, bits, alpha, premultiplied,
- alpha ?
- Transparency.TRANSLUCENT:
- Transparency.OPAQUE,
- dataType);
- break;
- case TYPE_BYTE_BINARY:
- byte[] vals = { 0, (byte) 0xff };
- cm = new IndexColorModel(8, 2, vals, vals, vals);
- break;
- case TYPE_BYTE_INDEXED:
- String msg2 = "type not implemented yet";
- throw new UnsupportedOperationException(msg2);
- // FIXME: build color-cube and create color model
- }
-
- init(cm,
- cm.createCompatibleWritableRaster(w, h),
- premultiplied,
- null, // no properties
- type
- );
- }
-
- public BufferedImage(int w, int h, int type,
- IndexColorModel indexcolormodel)
- {
- if ((type != TYPE_BYTE_BINARY) && (type != TYPE_BYTE_INDEXED))
- throw new IllegalArgumentException("type must be binary or indexed");
-
- init(indexcolormodel,
- indexcolormodel.createCompatibleWritableRaster(w, h),
- false, // not premultiplied (guess)
- null, // no properties
- type);
- }
-
- public BufferedImage(ColorModel colormodel,
- WritableRaster writableraster,
- boolean premultiplied,
- Hashtable properties)
- {
- init(colormodel, writableraster, premultiplied, properties,
- TYPE_CUSTOM);
- // TODO: perhaps try to identify type?
- }
-
- WritableRaster raster;
- ColorModel colorModel;
- Hashtable properties;
- boolean isPremultiplied;
- int type;
-
- private void init(ColorModel cm,
- WritableRaster writableraster,
- boolean premultiplied,
- Hashtable properties,
- int type)
- {
- raster = writableraster;
- colorModel = cm;
- this.properties = properties;
- isPremultiplied = premultiplied;
- this.type = type;
- }
-
- //public void addTileObserver(TileObserver tileobserver) {}
-
- public void coerceData(boolean premultiplied)
- {
- colorModel = colorModel.coerceData(raster, premultiplied);
- }
-
- public WritableRaster copyData(WritableRaster dest)
- {
- if (dest == null)
- dest = raster.createCompatibleWritableRaster(getMinX(), getMinY(),
- getWidth(),getHeight());
-
- int x = dest.getMinX();
- int y = dest.getMinY();
- int w = dest.getWidth();
- int h = dest.getHeight();
-
- // create a src child that has the right bounds...
- WritableRaster src =
- raster.createWritableChild(x, y, w, h, x, y,
- null // same bands
- );
- if (src.getSampleModel () instanceof ComponentSampleModel
- && dest.getSampleModel () instanceof ComponentSampleModel)
- // Refer to ComponentDataBlitOp for optimized data blitting:
- ComponentDataBlitOp.INSTANCE.filter(src, dest);
- else
- {
- // slower path
- int samples[] = src.getPixels (x, y, w, h, (int [])null);
- dest.setPixels (x, y, w, h, samples);
- }
- return dest;
- }
-
- public Graphics2D createGraphics()
- {
- GraphicsEnvironment env;
- env = GraphicsEnvironment.getLocalGraphicsEnvironment ();
- return env.createGraphics (this);
- }
-
- public void flush() {
- }
-
- public WritableRaster getAlphaRaster()
- {
- return colorModel.getAlphaRaster(raster);
- }
-
- public ColorModel getColorModel()
- {
- return colorModel;
- }
-
- public Raster getData()
- {
- return copyData(null);
- /* TODO: this might be optimized by returning the same
- raster (not writable) as long as image data doesn't change. */
- }
-
- public Raster getData(Rectangle rectangle)
- {
- WritableRaster dest =
- raster.createCompatibleWritableRaster(rectangle);
- return copyData(dest);
- }
-
- public Graphics getGraphics()
- {
- return createGraphics();
- }
-
- public int getHeight()
- {
- return raster.getHeight();
- }
-
- public int getHeight(ImageObserver imageobserver)
- {
- return getHeight();
- }
-
- public int getMinTileX()
- {
- return 0;
- }
-
- public int getMinTileY()
- {
- return 0;
- }
-
- public int getMinX()
- {
- return 0;
- }
-
- public int getMinY()
- {
- return 0;
- }
-
- public int getNumXTiles()
- {
- return 1;
- }
-
- public int getNumYTiles()
- {
- return 1;
- }
-
- public Object getProperty(String string)
- {
- if (properties == null)
- return null;
- return properties.get(string);
- }
-
- public Object getProperty(String string, ImageObserver imageobserver)
- {
- return getProperty(string);
- }
-
-
- public String[] getPropertyNames()
- {
- // FIXME: implement
- return null;
- }
-
- public int getRGB(int x, int y)
- {
- Object rgbElem = raster.getDataElements(x, y,
- null // create as needed
- );
- return colorModel.getRGB(rgbElem);
- }
-
- public int[] getRGB(int startX, int startY, int w, int h,
- int[] rgbArray,
- int offset, int scanlineStride)
- {
- if (rgbArray == null)
- {
- /*
- 000000000000000000
- 00000[#######----- [ = start
- -----########----- ] = end
- -----#######]00000
- 000000000000000000 */
- int size = (h-1)*scanlineStride + w;
- rgbArray = new int[size];
- }
-
- int endX = startX + w;
- int endY = startY + h;
-
- /* *TODO*:
- Opportunity for optimization by examining color models...
-
- Perhaps wrap the rgbArray up in a WritableRaster with packed
- sRGB color model and perform optimized rendering into the
- array. */
-
- Object rgbElem = null;
- for (int y=startY; y<endY; y++)
- {
- int xoffset = offset;
- for (int x=startX; x<endX; x++)
- {
- int rgb;
- rgbElem = raster.getDataElements(x, y, rgbElem);
- rgb = colorModel.getRGB(rgbElem);
- rgbArray[xoffset++] = rgb;
- }
- offset += scanlineStride;
- }
- return rgbArray;
- }
-
- public WritableRaster getRaster()
- {
- return raster;
- }
-
- public SampleModel getSampleModel()
- {
- return raster.getSampleModel();
- }
-
- public ImageProducer getSource()
- {
- return new ImageProducer() {
-
- HashSet consumers = new HashSet();
-
- public void addConsumer(ImageConsumer ic)
- {
- consumers.add(ic);
- }
-
- public boolean isConsumer(ImageConsumer ic)
- {
- return consumers.contains(ic);
- }
-
- public void removeConsumer(ImageConsumer ic)
- {
- consumers.remove(ic);
- }
-
- public void startProduction(ImageConsumer ic)
- {
- int x = 0;
- int y = 0;
- int width = getWidth();
- int height = getHeight();
- int stride = width;
- int offset = 0;
- int[] pixels = getRGB(x, y,
- width, height,
- (int[])null, offset, stride);
- ColorModel model = getColorModel();
-
- consumers.add(ic);
-
- Iterator i = consumers.iterator();
- while(i.hasNext())
- {
- ImageConsumer c = (ImageConsumer) i.next();
- c.setHints(ImageConsumer.SINGLEPASS);
- c.setDimensions(getWidth(), getHeight());
- c.setPixels(x, y, width, height, model, pixels, offset, stride);
- c.imageComplete(ImageConsumer.STATICIMAGEDONE);
- }
- }
-
- public void requestTopDownLeftRightResend(ImageConsumer ic)
- {
- startProduction(ic);
- }
-
- };
- }
-
- public Vector getSources()
- {
- return null;
- }
-
- public BufferedImage getSubimage(int x, int y, int w, int h)
- {
- WritableRaster subRaster =
- getRaster().createWritableChild(x, y, w, h, 0, 0, null);
-
- return new BufferedImage(getColorModel(),
- subRaster,
- isPremultiplied,
- properties);
- }
-
- public Raster getTile(int tileX, int tileY)
- {
- return getWritableTile(tileX, tileY);
- }
-
- public int getTileGridXOffset()
- {
- return 0; // according to javadocs
- }
-
- public int getTileGridYOffset()
- {
- return 0; // according to javadocs
- }
-
- public int getTileHeight()
- {
- return getHeight(); // image is one big tile
- }
-
- public int getTileWidth()
- {
- return getWidth(); // image is one big tile
- }
-
- public int getType()
- {
- return type;
- }
-
- public int getWidth()
- {
- return raster.getWidth();
- }
-
- public int getWidth(ImageObserver imageobserver)
- {
- return getWidth();
- }
-
- public WritableRaster getWritableTile(int tileX, int tileY)
- {
- isTileWritable(tileX, tileY); // for exception
- return raster;
- }
-
- private static final Point[] tileIndices = { new Point() };
-
- public Point[] getWritableTileIndices()
- {
- return tileIndices;
- }
-
- public boolean hasTileWriters()
- {
- return true;
- }
-
- public boolean isAlphaPremultiplied()
- {
- return isPremultiplied;
- }
-
- public boolean isTileWritable(int tileX, int tileY)
- {
- if ((tileX != 0) || (tileY != 0))
- throw new ArrayIndexOutOfBoundsException("only tile is (0,0)");
- return true;
- }
-
- public void releaseWritableTile(int tileX, int tileY)
- {
- isTileWritable(tileX, tileY); // for exception
- }
-
- //public void removeTileObserver(TileObserver tileobserver) {}
-
- public void setData(Raster src)
- {
- int x = src.getMinX();
- int y = src.getMinY();
- int w = src.getWidth();
- int h = src.getHeight();
-
- // create a dest child that has the right bounds...
- WritableRaster dest =
- raster.createWritableChild(x, y, w, h, x, y,
- null // same bands
- );
-
- if (src.getSampleModel () instanceof ComponentSampleModel
- && dest.getSampleModel () instanceof ComponentSampleModel)
-
- // Refer to ComponentDataBlitOp for optimized data blitting:
- ComponentDataBlitOp.INSTANCE.filter(src, dest);
- else
- {
- // slower path
- int samples[] = src.getPixels (x, y, w, h, (int [])null);
- dest.setPixels (x, y, w, h, samples);
- }
- }
-
- public void setRGB(int x, int y, int argb)
- {
- Object rgbElem = colorModel.getDataElements(argb, null);
- raster.setDataElements(x, y, rgbElem);
- }
-
- public void setRGB(int startX, int startY, int w, int h,
- int[] argbArray, int offset, int scanlineStride)
- {
- int endX = startX + w;
- int endY = startY + h;
-
- Object rgbElem = null;
- for (int y=startY; y<endY; y++)
- {
- int xoffset = offset;
- for (int x=startX; x<endX; x++)
- {
- int argb = argbArray[xoffset++];
- rgbElem = colorModel.getDataElements(argb, rgbElem);
- raster.setDataElements(x, y, rgbElem);
- }
- offset += scanlineStride;
- }
- }
-
- public String toString()
- {
- StringBuffer buf;
-
- buf = new StringBuffer(/* estimated length */ 120);
- buf.append("BufferedImage@");
- buf.append(Integer.toHexString(hashCode()));
- buf.append(": type=");
- buf.append(type);
- buf.append(' ');
- buf.append(colorModel);
- buf.append(' ');
- buf.append(raster);
-
- return buf.toString();
- }
-
-
- /**
- * Adds a tile observer. If the observer is already present, it receives
- * multiple notifications.
- *
- * @param to The TileObserver to add.
- */
- public void addTileObserver (TileObserver to)
- {
- if (observers == null)
- observers = new Vector ();
-
- observers.add (to);
- }
-
- /**
- * Removes a tile observer. If the observer was not registered,
- * nothing happens. If the observer was registered for multiple
- * notifications, it is now registered for one fewer notification.
- *
- * @param to The TileObserver to remove.
- */
- public void removeTileObserver (TileObserver to)
- {
- if (observers == null)
- return;
-
- observers.remove (to);
- }
-}
diff --git a/libjava/java/awt/image/BufferedImageFilter.java b/libjava/java/awt/image/BufferedImageFilter.java
deleted file mode 100644
index 50d627d66a3..00000000000
--- a/libjava/java/awt/image/BufferedImageFilter.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Point;
-
-/**
- * The BufferedImageFilter class wraps BufferedImageOp objects in a Filter.
- *
- * When pixels are pushed through the filter, we create a BufferedImage,
- * apply the BufferedImageOp, and pass the filtered pixels to the base class.
- *
- * @author jlquinn@optonline.net
- */
-public class BufferedImageFilter extends ImageFilter implements Cloneable
-{
- private BufferedImageOp op;
-
- /**
- *
- */
- public BufferedImageFilter(BufferedImageOp op)
- {
- super();
- if (op == null)
- throw new NullPointerException("BufferedImageFilter null"
- + " op in constructor");
- this.op = op;
- }
-
- /**
- * @return Returns the contained BufferedImageOp.
- */
- public BufferedImageOp getBufferedImageOp()
- {
- return op;
- }
-
- // FIXME: Definitely not sure this is the right thing. I'm not sure how to
- // create a compatible sample model that incorporates scansize != w. I
- // asume off is handled by the db itself.
- public void setPixels(int x, int y, int w, int h, ColorModel model,
- byte[] pixels, int off, int scansize)
- {
- // Create an input BufferedImage
- DataBufferByte db = new DataBufferByte(pixels, scansize * h + off, off);
- SampleModel sm = model.createCompatibleSampleModel(scansize, h);
- WritableRaster wr = new WritableRaster(sm, db, new Point(0, 0));
- BufferedImage in =
- new BufferedImage(model, wr, model.isAlphaPremultiplied(), null);
- BufferedImage out = op.createCompatibleDestImage(in, model);
- op.filter(in, out);
- DataBuffer dbout = out.getRaster().getDataBuffer();
- super.setPixels(0, 0, w, h, model, ((DataBufferByte)dbout).getData(), 0,
- scansize);
- }
-
- // FIXME: Definitely not sure this is the right thing. I'm not sure how
- // to create a compatible sample model that incorporates
- // scansize != w. I asume off is handled by the db itself.
- public void setPixels(int x, int y, int w, int h, ColorModel model,
- int[] pixels, int off, int scansize)
- {
- // Create an input BufferedImage
- DataBufferInt db = new DataBufferInt(pixels, scansize * h + off, off);
- SampleModel sm = model.createCompatibleSampleModel(scansize, h);
- WritableRaster wr = new WritableRaster(sm, db, new Point(0, 0));
- BufferedImage in =
- new BufferedImage(model, wr, model.isAlphaPremultiplied(), null);
- BufferedImage out = op.createCompatibleDestImage(in, model);
- op.filter(in, out);
- DataBuffer dbout = out.getRaster().getDataBuffer();
- super.setPixels(0, 0, w, h, model, ((DataBufferInt)dbout).getData(), 0,
- scansize);
- }
-}
diff --git a/libjava/java/awt/image/BufferedImageOp.java b/libjava/java/awt/image/BufferedImageOp.java
deleted file mode 100644
index 2ecbec056a0..00000000000
--- a/libjava/java/awt/image/BufferedImageOp.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* BufferedImageOp.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.RenderingHints;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-
-/**
- * NEEDS DOCUMENTATION
- */
-public interface BufferedImageOp
-{
- BufferedImage filter(BufferedImage src, BufferedImage dst);
- Rectangle2D getBounds2D(BufferedImage src);
- BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM);
- Point2D getPoint2D(Point2D src, Point2D dst);
- RenderingHints getRenderingHints();
-} // interface BufferedImageOp
diff --git a/libjava/java/awt/image/ByteLookupTable.java b/libjava/java/awt/image/ByteLookupTable.java
deleted file mode 100644
index df02d0a1bf7..00000000000
--- a/libjava/java/awt/image/ByteLookupTable.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/* ByteLookupTable.java -- Java class for a pixel translation table.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * ByteLookupTable represents translation arrays for pixel values. It wraps
- * one or more data arrays for each layer (or component) in an image, such as
- * Alpha, R, G, and B. When doing translation, the offset is subtracted from
- * the pixel values to allow a subset of an array to be used.
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- * @version 1.0
- */
-public class ByteLookupTable extends LookupTable
-{
- // Array of translation tables.
- private byte data[][];
-
- /**
- * Creates a new <code>ByteLookupTable</code> instance.
- *
- * Offset is subtracted from pixel values when looking up in the translation
- * tables. If data.length is one, the same table is applied to all pixel
- * components.
- *
- * @param offset Offset to be subtracted.
- * @param data Array of lookup tables.
- * @exception IllegalArgumentException if offset &lt; 0 or data.length &lt; 1.
- */
- public ByteLookupTable(int offset, byte[][] data)
- throws IllegalArgumentException
- {
- super(offset, data.length);
- this.data = data;
- }
-
- /**
- * Creates a new <code>ByteLookupTable</code> instance.
- *
- * Offset is subtracted from pixel values when looking up in the translation
- * table. The same table is applied to all pixel components.
- *
- * @param offset Offset to be subtracted.
- * @param data Lookup table for all components.
- * @exception IllegalArgumentException if offset &lt; 0.
- */
- public ByteLookupTable(int offset, byte[] data)
- throws IllegalArgumentException
- {
- super(offset, 1);
- this.data = new byte[][] {data};
- }
-
- /**
- * Return the lookup tables.
- *
- * @return the tables
- */
- public final byte[][] getTable()
- {
- return data;
- }
-
- /**
- * Return translated values for a pixel.
- *
- * For each value in the pixel src, use the value minus offset as an index
- * in the component array and copy the value there to the output for the
- * component. If dest is null, the output is a new array, otherwise the
- * translated values are written to dest. Dest can be the same array as
- * src.
- *
- * For example, if the pixel src is [2, 4, 3], and offset is 1, the output
- * is [comp1[1], comp2[3], comp3[2]], where comp1, comp2, and comp3 are the
- * translation arrays.
- *
- * @param src Component values of a pixel.
- * @param dst Destination array for values, or null.
- * @return Translated values for the pixel.
- */
- public int[] lookupPixel(int[] src, int[] dst)
- throws ArrayIndexOutOfBoundsException
- {
- if (dst == null)
- dst = new int[src.length];
-
- if (data.length == 1)
- for (int i=0; i < src.length; i++)
- dst[i] = data[0][src[i] - offset];
- else
- for (int i=0; i < src.length; i++)
- dst[i] = data[i][src[i] - offset];
-
- return dst;
- }
-
- /**
- * Return translated values for a pixel.
- *
- * For each value in the pixel src, use the value minus offset as an index
- * in the component array and copy the value there to the output for the
- * component. If dest is null, the output is a new array, otherwise the
- * translated values are written to dest. Dest can be the same array as
- * src.
- *
- * For example, if the pixel src is [2, 4, 3], and offset is 1, the output
- * is [comp1[1], comp2[3], comp3[2]], where comp1, comp2, and comp3 are the
- * translation arrays.
- *
- * @param src Component values of a pixel.
- * @param dst Destination array for values, or null.
- * @return Translated values for the pixel.
- */
- public byte[] lookupPixel(byte[] src, byte[] dst)
- throws ArrayIndexOutOfBoundsException
- {
- if (dst == null)
- dst = new byte[src.length];
-
- if (data.length == 1)
- for (int i=0; i < src.length; i++)
- dst[i] = data[0][((int)src[i]) - offset];
- else
- for (int i=0; i < src.length; i++)
- dst[i] = data[i][((int)src[i]) - offset];
-
- return dst;
-
- }
-}
diff --git a/libjava/java/awt/image/ColorConvertOp.java b/libjava/java/awt/image/ColorConvertOp.java
deleted file mode 100644
index 18609e0c4b0..00000000000
--- a/libjava/java/awt/image/ColorConvertOp.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/* ColorModel.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.color.ColorSpace;
-import java.awt.color.ICC_ColorSpace;
-import java.awt.color.ICC_Profile;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-
-/**
- * ColorConvertOp is a filter for converting an image from one colorspace to
- * another colorspace. The filter can convert the image through a sequence
- * of colorspaces or just from source to destination.
- *
- * Color conversion is done on the color components without alpha. Thus
- * if a BufferedImage has alpha premultiplied, this is divided out before
- * color conversion, and premultiplication applied if the destination
- * requires it.
- *
- * Color rendering and dithering hints may be applied if specified. This is
- * likely platform-dependent.
- *
- * @author jlquinn@optonline.net
- */
-public class ColorConvertOp implements BufferedImageOp, RasterOp
-{
- private ColorSpace srccs;
- private ColorSpace dstcs;
- private RenderingHints hints;
- private ICC_Profile[] profiles;
- private ColorSpace[] spaces;
- private boolean rasterValid;
-
-
- /**
- * Convert BufferedImage through a ColorSpace.
- *
- * This filter version is only valid for BufferedImages. The source image
- * is converted to cspace. If the destination is not null, it is then
- * converted to the destination colorspace. Normally this filter will only
- * be used with a null destination.
- *
- * @param cspace The target color space.
- * @param hints Rendering hints to use in conversion, or null.
- */
- public ColorConvertOp(ColorSpace cspace, RenderingHints hints)
- {
- if (cspace == null)
- throw new NullPointerException();
- spaces = new ColorSpace[]{cspace};
- this.hints = hints;
- rasterValid = false;
- }
-
- public ColorConvertOp(ColorSpace srcCspace, ColorSpace dstCspace,
- RenderingHints hints)
- {
- if (srcCspace == null || dstCspace == null)
- throw new NullPointerException();
- spaces = new ColorSpace[]{srcCspace, dstCspace};
- this.hints = hints;
- }
-
- /**
- * Convert from a source image destination image color space.
- *
- * This constructor builds a ColorConvertOp from an array of ICC_Profiles.
- * The source image will be converted through the sequence of color spaces
- * defined by the profiles. If the sequence of profiles doesn't give a
- * well-defined conversion, throws IllegalArgumentException.
- *
- * NOTE: Sun's docs don't clearly define what a well-defined conversion is
- * - or perhaps someone smarter can come along and sort it out.
- *
- * For BufferedImages, when the first and last profiles match the
- * requirements of the source and destination color space respectively, the
- * corresponding conversion is unnecessary. TODO: code this up. I don't
- * yet understand how you determine this.
- *
- * For Rasters, the first and last profiles must have the same number of
- * bands as the source and destination Rasters, respectively. If this is
- * not the case, or there fewer than 2 profiles, an IllegalArgumentException
- * will be thrown.
- *
- * @param profiles
- * @param hints
- */
- public ColorConvertOp(ICC_Profile[] profiles, RenderingHints hints)
- {
- if (profiles == null)
- throw new NullPointerException();
- this.hints = hints;
- this.profiles = profiles;
- // TODO: Determine if this is well-defined.
- // Create colorspace array with space for src and dest colorspace
- spaces = new ColorSpace[profiles.length];
- for (int i = 0; i < profiles.length; i++)
- spaces[i] = new ICC_ColorSpace(profiles[i]);
- }
-
- /** Convert from source image color space to destination image color space.
- *
- * Only valid for BufferedImage objects, this Op converts from the source
- * color space to the destination color space. The destination can't be
- * null for this operation.
- *
- * @param hints Rendering hints to use during conversion, or null.
- */
- public ColorConvertOp(RenderingHints hints)
- {
- this.hints = hints;
- srccs = null;
- dstcs = null;
- rasterValid = false;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#filter(java.awt.image.BufferedImage,
- java.awt.image.BufferedImage)
- */
- public final BufferedImage filter(BufferedImage src, BufferedImage dst)
- {
- // TODO: The plan is to create a scanline buffer for intermediate buffers.
- // For now we just suck it up and create intermediate buffers.
-
- if (dst == null && spaces.length == 0)
- throw new IllegalArgumentException();
-
- // Make sure input isn't premultiplied by alpha
- if (src.isAlphaPremultiplied())
- {
- BufferedImage tmp = createCompatibleDestImage(src, src.getColorModel());
- copyimage(src, tmp);
- tmp.coerceData(false);
- src = tmp;
- }
-
- ColorModel scm = src.getColorModel();
- for (int i = 0; i < spaces.length; i++)
- {
- ColorModel cm = scm.cloneColorModel(spaces[i]);
- BufferedImage tmp = createCompatibleDestImage(src, cm);
- copyimage(src, tmp);
- src = tmp;
- }
-
- // Intermediate conversions leave result in src
- if (dst == null)
- return src;
-
- // Apply final conversion
- copyimage(src, dst);
- return dst;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#createCompatibleDestImage(java.awt.image.BufferedImage, java.awt.image.ColorModel)
- */
- public BufferedImage createCompatibleDestImage(BufferedImage src,
- ColorModel dstCM)
- {
- // FIXME: set properties to those in src
- return new BufferedImage(dstCM,
- src.getRaster().createCompatibleWritableRaster(),
- src.isPremultiplied,
- null);
- }
-
- public final ICC_Profile[] getICC_Profiles()
- {
- return profiles;
- }
-
- /** Return the rendering hints for this op. */
- public final RenderingHints getRenderingHints()
- {
- return hints;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#filter(java.awt.image.Raster, java.awt.image.WritableRaster)
- */
- public final WritableRaster filter(Raster src, WritableRaster dest)
- {
- if (!rasterValid)
- throw new IllegalArgumentException();
-
- // Need to iterate through each color space - there must be at least 2
- for (int i = 1; i < spaces.length - 1; i++)
- {
- // FIXME: this is wrong. tmp needs to have the same number of bands as
- // spaces[i] has.
- WritableRaster tmp = createCompatibleDestRaster(src);
- copyraster(src, spaces[i - 1], tmp, spaces[i]);
- src = tmp;
- }
-
- // FIXME: this is wrong. dst needs to have the same number of bands as
- // spaces[i] has.
- if (dest == null)
- dest = createCompatibleDestRaster(src);
- copyraster(src, spaces[spaces.length - 2],
- dest, spaces[spaces.length - 1]);
-
- return dest;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#createCompatibleDestRaster(java.awt.image.Raster)
- */
- public WritableRaster createCompatibleDestRaster(Raster src)
- {
- return src.createCompatibleWritableRaster();
- }
-
- /** Return corresponding destination point for source point.
- *
- * LookupOp will return the value of src unchanged.
- * @param src The source point.
- * @param dst The destination point.
- * @see java.awt.image.RasterOp#getPoint2D(java.awt.geom.Point2D, java.awt.geom.Point2D)
- */
- public final Point2D getPoint2D(Point2D src, Point2D dst)
- {
- if (dst == null) return (Point2D)src.clone();
- dst.setLocation(src);
- return dst;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#getBounds2D(java.awt.image.BufferedImage)
- */
- public final Rectangle2D getBounds2D(BufferedImage src)
- {
- return src.getRaster().getBounds();
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#getBounds2D(java.awt.image.Raster)
- */
- public final Rectangle2D getBounds2D(Raster src)
- {
- return src.getBounds();
- }
-
- // According to Sven de Marothy, we need to copy the src into the dest
- // using Graphics2D, in order to use the rendering hints.
- private void copyimage(BufferedImage src, BufferedImage dst)
- {
- Graphics2D gg = dst.createGraphics();
- gg.setRenderingHints(hints);
- gg.drawImage(src, 0, 0, null);
- gg.dispose();
- }
-
- private void copyraster(Raster src, ColorSpace scs, WritableRaster dst,
- ColorSpace dcs)
- {
- float[] sbuf = new float[src.getNumBands()];
-
- if (hints.get(RenderingHints.KEY_COLOR_RENDERING) ==
- RenderingHints.VALUE_COLOR_RENDER_QUALITY)
- {
- // use cie for accuracy
- for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
- for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
- dst.setPixel(x, y,
- dcs.fromCIEXYZ(scs.toCIEXYZ(src.getPixel(x, y, sbuf))));
- }
- else
- {
- // use rgb - it's probably faster
- for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
- for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
- dst.setPixel(x, y,
- dcs.fromRGB(scs.toRGB(src.getPixel(x, y, sbuf))));
- }
- }
-
-}
diff --git a/libjava/java/awt/image/ColorModel.java b/libjava/java/awt/image/ColorModel.java
deleted file mode 100644
index 1ebcb98a76b..00000000000
--- a/libjava/java/awt/image/ColorModel.java
+++ /dev/null
@@ -1,758 +0,0 @@
-/* ColorModel.java --
- Copyright (C) 1999, 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import gnu.java.awt.Buffers;
-
-import java.awt.Point;
-import java.awt.Transparency;
-import java.awt.color.ColorSpace;
-import java.lang.reflect.Constructor;
-import java.util.Arrays;
-
-/**
- * A color model operates with colors in several formats:
- *
- * <ul>
- * <li>normalized: component samples are in range [0.0, 1.0].</li>
- *
- * <li>color model pixel value: all the color component samples for a
- * sigle pixel packed/encoded in a way natural for the color
- * model.</li>
- *
- * <li>color model pixel int value: only makes sense if the natural
- * encoding of a single pixel can fit in a single int value.</li>
- *
- * <li>array of transferType containing a single pixel: the pixel is
- * encoded in the natural way of the color model, taking up as many
- * array elements as needed.</li>
- *
- * <li>sRGB pixel int value: a pixel in sRGB color space, encoded in
- * default 0xAARRGGBB format, assumed not alpha premultiplied.</li>
- *
- * <li>single [0, 255] scaled int samples from default sRGB color
- * space. These are always assumed to be alpha non-premultiplied.</li>
- *
- * <li>arrays of unnormalized component samples of single pixel: these
- * samples are scaled and multiplied according to the color model, but
- * is otherwise not packed or encoded. Each element of the array is one
- * separate component sample. The color model only operate on the
- * components from one pixel at a time, but using offsets, allows
- * manipulation of arrays that contain the components of more than one
- * pixel.</li>
- *
- * </ul>
- *
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- * @author C. Brian Jones (cbj@gnu.org)
- */
-public abstract class ColorModel implements Transparency
-{
- protected int pixel_bits;
- protected int transferType;
-
- int[] bits;
- ColorSpace cspace;
- int transparency;
- boolean hasAlpha;
- boolean isAlphaPremultiplied;
-
- static int[] nArray(int value, int times)
- {
- int[] array = new int[times];
- java.util.Arrays.fill(array, value);
- return array;
- }
-
- static byte[] nArray(byte value, int times)
- {
- byte[] array = new byte[times];
- java.util.Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Constructs the default color model. The default color model
- * can be obtained by calling <code>getRGBdefault</code> of this
- * class.
- * @param bits the number of bits wide used for bit size of pixel values
- */
- public ColorModel(int bits)
- {
- this(bits * 4, // total bits, sRGB, four channels
- nArray(bits, 4), // bits for each channel
- ColorSpace.getInstance(ColorSpace.CS_sRGB), // sRGB
- true, // has alpha
- false, // not premultiplied
- TRANSLUCENT,
- Buffers.smallestAppropriateTransferType(bits * 4));
- }
-
- /**
- * Constructs a ColorModel that translates pixel values to
- * color/alpha components.
- *
- * @exception IllegalArgumentException If the length of the bit array is less
- * than the number of color or alpha components in this ColorModel, or if the
- * transparency is not a valid value, or if the sum of the number of bits in
- * bits is less than 1 or if any of the elements in bits is less than 0.
- */
- protected ColorModel(int pixel_bits, int[] bits, ColorSpace cspace,
- boolean hasAlpha, boolean isAlphaPremultiplied,
- int transparency, int transferType)
- {
- int bits_sum = 0;
- for (int i = 0; i < bits.length; i++)
- {
- if (bits [i] < 0)
- throw new IllegalArgumentException ();
-
- bits_sum |= bits [i];
- }
-
- if ((bits.length < cspace.getNumComponents())
- || (bits_sum < 1))
- throw new IllegalArgumentException ();
-
- this.pixel_bits = pixel_bits;
- this.bits = bits;
- this.cspace = cspace;
- this.hasAlpha = hasAlpha;
- this.isAlphaPremultiplied = isAlphaPremultiplied;
- this.transparency = transparency;
- this.transferType = transferType;
- }
-
- // This is a hook for ColorConvertOp to create a colormodel with
- // a new colorspace
- ColorModel cloneColorModel(ColorSpace cspace)
- {
- Class cls = this.getClass();
- ColorModel cm;
- try {
- // This constructor will exist.
- Constructor ctor =
- cls.getConstructor(new Class[]{int.class, int[].class,
- ColorSpace.class, boolean.class,
- boolean.class, int.class, int.class});
- cm = (ColorModel)ctor.
- newInstance(new Object[]{new Integer(pixel_bits),
- bits, cspace, Boolean.valueOf(hasAlpha),
- Boolean.valueOf(isAlphaPremultiplied),
- new Integer(transparency),
- new Integer(transferType)});
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException();
- }
- return cm;
- }
-
- public void finalize()
- {
- // Do nothing here.
- }
-
- /**
- * Returns the default color model which in Sun's case is an instance
- * of <code>DirectColorModel</code>.
- */
- public static ColorModel getRGBdefault()
- {
- return new DirectColorModel(32, 0xff0000, 0xff00, 0xff, 0xff000000);
- }
-
- public final boolean hasAlpha()
- {
- return hasAlpha;
- }
-
- public final boolean isAlphaPremultiplied()
- {
- return isAlphaPremultiplied;
- }
-
- /**
- * Get get number of bits wide used for the bit size of pixel values
- */
- public int getPixelSize()
- {
- return pixel_bits;
- }
-
- public int getComponentSize(int componentIdx)
- {
- return bits[componentIdx];
- }
-
- public int[] getComponentSize()
- {
- return bits;
- }
-
- public int getTransparency()
- {
- return transparency;
- }
-
- public int getNumComponents()
- {
- return getNumColorComponents() + (hasAlpha ? 1 : 0);
- }
-
- public int getNumColorComponents()
- {
- return cspace.getNumComponents();
- }
-
- /**
- * Converts pixel value to sRGB and extract red int sample scaled
- * to range [0, 255].
- *
- * @param pixel pixel value that will be interpreted according to
- * the color model, (assumed alpha premultiplied if color model says
- * so.)
- *
- * @return red sample scaled to range [0, 255], from default color
- * space sRGB, alpha non-premultiplied.
- */
- public abstract int getRed(int pixel);
-
- /**
- * Converts pixel value to sRGB and extract green int sample
- * scaled to range [0, 255].
- *
- * @see #getRed(int)
- */
- public abstract int getGreen(int pixel);
-
- /**
- * Converts pixel value to sRGB and extract blue int sample
- * scaled to range [0, 255].
- *
- * @see #getRed(int)
- */
- public abstract int getBlue(int pixel);
-
- /**
- * Extract alpha int sample from pixel value, scaled to [0, 255].
- *
- * @param pixel pixel value that will be interpreted according to
- * the color model.
- *
- * @return alpha sample, scaled to range [0, 255].
- */
- public abstract int getAlpha(int pixel);
-
- /**
- * Converts a pixel int value of the color space of the color
- * model to a sRGB pixel int value.
- *
- * This method is typically overriden in subclasses to provide a
- * more efficient implementation.
- *
- * @param pixel pixel value that will be interpreted according to
- * the color model.
- *
- * @return a pixel in sRGB color space, encoded in default
- * 0xAARRGGBB format. */
- public int getRGB(int pixel)
- {
- return
- ((getAlpha(pixel) & 0xff) << 24) |
- (( getRed(pixel) & 0xff) << 16) |
- ((getGreen(pixel) & 0xff) << 8) |
- (( getBlue(pixel) & 0xff) << 0);
- }
-
-
- /**
- * In this color model we know that the whole pixel value will
- * always be contained within the first element of the pixel
- * array.
- */
- final int getPixelFromArray(Object inData) {
- DataBuffer data =
- Buffers.createBufferFromData(transferType, inData, 1);
- Object da = Buffers.getData(data);
-
- return data.getElem(0);
- }
-
- /**
- * Converts pixel in the given array to sRGB and extract blue int
- * sample scaled to range [0-255].
- *
- * This method is typically overriden in subclasses to provide a
- * more efficient implementation.
- *
- * @param inData array of transferType containing a single pixel. The
- * pixel should be encoded in the natural way of the color model.
- */
- public int getRed(Object inData)
- {
- return getRed(getPixelFromArray(inData));
- }
-
- /**
- * @see #getRed(Object)
- */
- public int getGreen(Object inData)
- {
- return getGreen(getPixelFromArray(inData));
- }
-
- /**
- * @see #getRed(Object)
- */
- public int getBlue(Object inData) {
- return getBlue(getPixelFromArray(inData));
- }
-
- /**
- * @see #getRed(Object)
- */
- public int getAlpha(Object inData) {
- return getAlpha(getPixelFromArray(inData));
- }
-
- /**
- * Converts a pixel in the given array of the color space of the
- * color model to an sRGB pixel int value.
- *
- * <p>This method performs the inverse function of
- * <code>getDataElements(int rgb, Object pixel)</code>.
- * I.e. <code>(rgb == cm.getRGB(cm.getDataElements(rgb,
- * null)))</code>.
- *
- * @param inData array of transferType containing a single pixel. The
- * pixel should be encoded in the natural way of the color model.
- *
- * @return a pixel in sRGB color space, encoded in default
- * 0xAARRGGBB format.
- *
- * @see #getDataElements(int, Object)
- */
- public int getRGB(Object inData)
- {
- return
- ((getAlpha(inData) & 0xff) << 24) |
- (( getRed(inData) & 0xff) << 16) |
- ((getGreen(inData) & 0xff) << 8) |
- (( getBlue(inData) & 0xff) << 0);
- }
-
- /**
- * Converts an sRGB pixel int value to an array containing a
- * single pixel of the color space of the color model.
- *
- * <p>This method performs the inverse function of
- * <code>getRGB(Object inData)</code>.
- *
- * Outline of conversion process:
- *
- * <ol>
- *
- * <li>Convert rgb to normalized [0.0, 1.0] sRGB values.</li>
- *
- * <li>Convert to color space components using fromRGB in
- * ColorSpace.</li>
- *
- * <li>If color model has alpha and should be premultiplied,
- * multiply color space components with alpha value</li>
- *
- * <li>Scale the components to the correct number of bits.</li>
- *
- * <li>Arrange the components in the output array</li>
- *
- * </ol>
- *
- * @param rgb The color to be converted to dataElements. A pixel
- * in sRGB color space, encoded in default 0xAARRGGBB format,
- * assumed not alpha premultiplied.
- *
- * @param pixel to avoid needless creation of arrays, an array to
- * use to return the pixel can be given. If null, a suitable array
- * will be created.
- *
- * @return An array of transferType values representing the color,
- * in the color model format. The color model defines whether the
- *
- * @see #getRGB(Object)
- */
- public Object getDataElements(int rgb, Object pixel)
- {
- // subclasses has to implement this method.
- throw new UnsupportedOperationException();
- }
-
- /**
- * Fills an array with the unnormalized component samples from a
- * pixel value. I.e. decompose the pixel, but not perform any
- * color conversion.
- *
- * This method is typically overriden in subclasses to provide a
- * more efficient implementation.
- *
- * @param pixel pixel value encoded according to the color model.
- *
- * @return arrays of unnormalized component samples of single
- * pixel. The scale and multiplication state of the samples are
- * according to the color model. Each component sample is stored
- * as a separate element in the array.
- */
- public int[] getComponents(int pixel, int[] components, int offset)
- {
- // subclasses has to implement this method.
- throw new UnsupportedOperationException();
- }
-
- /**
- * Fills an array with the unnormalized component samples from an
- * array of transferType containing a single pixel. I.e. decompose
- * the pixel, but not perform any color conversion.
- *
- * This method is typically overriden in subclasses to provide a
- * more efficient implementation.
- *
- * @param array of transferType containing a single pixel. The
- * pixel should be encoded in the natural way of the color model.
- *
- * @return arrays of unnormalized component samples of single
- * pixel. The scale and multiplication state of the samples are
- * according to the color model. Each component sample is stored
- * as a separate element in the array.
- */
- public int[] getComponents(Object pixel, int[] components, int offset)
- {
- // subclasses has to implement this method.
- throw new UnsupportedOperationException();
- }
-
- /**
- * Convert normalized components to unnormalized components.
- */
- public int[] getUnnormalizedComponents(float[] normComponents,
- int normOffset,
- int[] components,
- int offset)
- {
- int numComponents = getNumComponents();
- if (components == null)
- {
- components = new int[offset + numComponents];
- }
-
- for (int i=0; i<numComponents; i++)
- {
- float in = normComponents[normOffset++];
- int out = (int) (in * ((1<<getComponentSize(i)) - 1));
- components[offset++] = out;
- }
- return components;
- }
-
- /**
- * Convert unnormalized components to normalized components.
- */
- public float[] getNormalizedComponents(int[] components,
- int offset,
- float[] normComponents,
- int normOffset)
- {
- int numComponents = getNumComponents();
- if (normComponents == null)
- {
- normComponents = new float[normOffset + numComponents];
- }
-
- for (int i=0; i<numComponents; i++)
- {
- float in = components[offset++];
- float out = in / ((1<<getComponentSize(i)) - 1);
- normComponents[normOffset++] = out;
- }
- return normComponents;
- }
-
- /**
- * Convert unnormalized components to normalized components.
- *
- * @since 1.4
- */
- public float[] getNormalizedComponents (Object pixel,
- float[] normComponents,
- int normOffset)
- {
- // subclasses has to implement this method.
- throw new UnsupportedOperationException();
- }
-
- /**
- * Converts the unnormalized component samples from an array to a
- * pixel value. I.e. composes the pixel from component samples, but
- * does not perform any color conversion or scaling of the samples.
- *
- * This method performs the inverse function of
- * <code>getComponents(int pixel, int[] components,
- * int offset)</code>. I.e.
- *
- * <code>(pixel == cm.getDataElement(cm.getComponents(pixel, null,
- * 0), 0))</code>.
- *
- * This method is overriden in subclasses since this abstract class throws
- * UnsupportedOperationException().
- *
- * @param components Array of unnormalized component samples of single
- * pixel. The scale and multiplication state of the samples are according
- * to the color model. Each component sample is stored as a separate element
- * in the array.
- * @param offset Position of the first value of the pixel in components.
- *
- * @return pixel value encoded according to the color model.
- */
- public int getDataElement(int[] components, int offset)
- {
- // subclasses have to implement this method.
- throw new UnsupportedOperationException();
- }
-
- /**
- * Converts the normalized component samples from an array to a pixel
- * value. I.e. composes the pixel from component samples, but does not
- * perform any color conversion or scaling of the samples.
- *
- * This method is typically overriden in subclasses to provide a
- * more efficient implementation. The method provided by this abstract
- * class converts the components to unnormalized form and returns
- * getDataElement(int[], int).
- *
- * @param components Array of normalized component samples of single pixel.
- * The scale and multiplication state of the samples are according to the
- * color model. Each component sample is stored as a separate element in the
- * array.
- * @param offset Position of the first value of the pixel in components.
- *
- * @return pixel value encoded according to the color model.
- * @since 1.4
- */
- public int getDataElement (float[] components, int offset)
- {
- return
- getDataElement(getUnnormalizedComponents(components, offset, null, 0),
- 0);
- }
-
- public Object getDataElements(int[] components, int offset, Object obj)
- {
- // subclasses have to implement this method.
- throw new UnsupportedOperationException();
- }
-
- /**
- * Converts the normalized component samples from an array to an array of
- * TransferType values. I.e. composes the pixel from component samples, but
- * does not perform any color conversion or scaling of the samples.
- *
- * If obj is null, a new array of TransferType is allocated and returned.
- * Otherwise the results are stored in obj and obj is returned. If obj is
- * not long enough, ArrayIndexOutOfBounds is thrown. If obj is not an array
- * of primitives, ClassCastException is thrown.
- *
- * This method is typically overriden in subclasses to provide a
- * more efficient implementation. The method provided by this abstract
- * class converts the components to unnormalized form and returns
- * getDataElement(int[], int, Object).
- *
- * @param components Array of normalized component samples of single pixel.
- * The scale and multiplication state of the samples are according to the
- * color model. Each component sample is stored as a separate element in the
- * array.
- * @param offset Position of the first value of the pixel in components.
- * @param obj Array of TransferType or null.
- *
- * @return pixel value encoded according to the color model.
- * @throws ArrayIndexOutOfBounds
- * @throws ClassCastException
- * @since 1.4
- */
- public Object getDataElements(float[] components, int offset, Object obj)
- {
- return
- getDataElements(getUnnormalizedComponents(components, offset, null, 0),
- 0, obj);
- }
-
- public boolean equals(Object obj)
- {
- if (!(obj instanceof ColorModel)) return false;
-
- ColorModel o = (ColorModel) obj;
- return
- (pixel_bits == o.pixel_bits) &&
- (transferType == o.transferType) &&
- (transparency == o.transparency) &&
- (hasAlpha == o.hasAlpha) &&
- (isAlphaPremultiplied == o.isAlphaPremultiplied) &&
- Arrays.equals(bits, o.bits) &&
- (cspace.equals(o.cspace));
- }
-
- public final ColorSpace getColorSpace()
- {
- return cspace;
- }
-
- // Typically overridden
- public ColorModel coerceData(WritableRaster raster,
- boolean isAlphaPremultiplied)
- {
- if (this.isAlphaPremultiplied == isAlphaPremultiplied)
- return this;
-
- int w = raster.getWidth();
- int h = raster.getHeight();
- int x = raster.getMinX();
- int y = raster.getMinY();
- int size = w*h;
- int numColors = getNumColorComponents();
- int numComponents = getNumComponents();
- int alphaScale = (1<<getComponentSize(numColors)) - 1;
- double[] pixels = raster.getPixels(x, y, w, h, (double[]) null);
-
- for (int i=0; i<size; i++)
- {
- double alpha = pixels[i*numComponents+numColors]*alphaScale;
- for (int c=0; c<numColors; c++)
- {
- int offset = i*numComponents+c;
- if (isAlphaPremultiplied)
- pixels[offset] = pixels[offset]/alpha;
- else
- pixels[offset] = pixels[offset]*alpha;
- }
- }
-
- raster.setPixels(0, 0, w, h, pixels);
-
- // FIXME: what can we return?
- return null;
- }
-
- /**
- * Checks if the given raster has a compatible data-layout (SampleModel).
- * @param raster The Raster to test.
- * @return true if raster is compatible.
- */
- public boolean isCompatibleRaster(Raster raster)
- {
- SampleModel sampleModel = raster.getSampleModel();
- return isCompatibleSampleModel(sampleModel);
- }
-
- // Typically overridden
- public WritableRaster createCompatibleWritableRaster(int w, int h)
- {
- return new WritableRaster(createCompatibleSampleModel(w, h),
- new Point(0, 0));
- }
-
- // Typically overridden
- public SampleModel createCompatibleSampleModel(int w, int h)
- {
- throw new UnsupportedOperationException();
- }
-
- // Typically overridden
- public boolean isCompatibleSampleModel(SampleModel sm)
- {
- return sm.getTransferType() == transferType;
- }
-
- public final int getTransferType ()
- {
- return transferType;
- }
-
- /**
- * Subclasses must override this method if it is possible for the
- * color model to have an alpha channel.
- *
- * @return null, as per JDK 1.3 doc. Subclasses will only return
- * null if no alpha raster exists.
- */
- public WritableRaster getAlphaRaster(WritableRaster raster)
- {
- return null;
-
- /* It is a mystery to me why we couldn't use the following code...
-
-
- if (!hasAlpha()) return null;
-
- SampleModel sm = raster.getSampleModel();
- int[] alphaBand = { sm.getNumBands() - 1 };
- SampleModel alphaModel = sm.createSubsetSampleModel(alphaBand);
- DataBuffer buffer = raster.getDataBuffer();
- Point origin = new Point(0, 0);
- return Raster.createWritableRaster(alphaModel, buffer, origin);
-
-
- ...here, and avoided overriding the method in subclasses,
- but the Sun docs state that this method always will return
- null, and that overriding is required. Oh, well.
- */
- }
-
- String stringParam()
- {
- return "pixel_bits=" + pixel_bits +
- ", cspace=" + cspace +
- ", transferType=" + transferType +
- ", transparency=" + transparency +
- ", hasAlpha=" + hasAlpha +
- ", isAlphaPremultiplied=" + isAlphaPremultiplied;
- }
-
- public String toString()
- {
- return getClass().getName() + "[" + stringParam() + "]";
- }
-}
diff --git a/libjava/java/awt/image/ComponentColorModel.java b/libjava/java/awt/image/ComponentColorModel.java
deleted file mode 100644
index f56688f9362..00000000000
--- a/libjava/java/awt/image/ComponentColorModel.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/* ComponentColorModel.java --
- Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import gnu.java.awt.Buffers;
-
-import java.awt.Point;
-import java.awt.color.ColorSpace;
-
-public class ComponentColorModel extends ColorModel
-{
- private static int sum(int[] values)
- {
- int sum = 0;
- for (int i=0; i<values.length; i++)
- sum += values[i];
- return sum;
- }
-
- public ComponentColorModel(ColorSpace colorSpace, int[] bits,
- boolean hasAlpha,
- boolean isAlphaPremultiplied,
- int transparency, int transferType)
- {
- super(sum(bits), bits, colorSpace, hasAlpha, isAlphaPremultiplied,
- transparency, transferType);
- }
-
- /**
- * Construct a new ComponentColorModel.
- *
- * This constructor makes all bits of each sample significant, so for a
- * transferType of DataBuffer.BYTE, the bits per sample is 8, etc. If
- * both hasAlpha and isAlphaPremultiplied are true, color samples are
- * assumed to be premultiplied by the alpha component. Transparency may be
- * one of OPAQUE, BITMASK, or TRANSLUCENT.
- *
- * @param colorSpace The colorspace for this color model.
- * @param hasAlpha True if there is an alpha component.
- * @param isAlphaPremultiplied True if colors are already multiplied by
- * alpha.
- * @param transparency The type of alpha values.
- * @param transferType Data type of pixel sample values.
- * @since 1.4
- */
- public ComponentColorModel(ColorSpace colorSpace,
- boolean hasAlpha,
- boolean isAlphaPremultiplied,
- int transparency, int transferType)
- {
- this(colorSpace, null, hasAlpha, isAlphaPremultiplied,
- transparency, transferType);
- }
-
- public int getRed(int pixel)
- {
- if (getNumComponents()>1) throw new IllegalArgumentException();
- return (int) getRGBFloat(pixel)[0];
- }
-
- public int getGreen(int pixel)
- {
- if (getNumComponents()>1) throw new IllegalArgumentException();
- return (int) getRGBFloat(pixel)[0];
- }
-
- public int getBlue(int pixel)
- {
- if (getNumComponents()>1) throw new IllegalArgumentException();
- return (int) getRGBFloat(pixel)[0];
- }
-
- public int getAlpha(int pixel)
- {
- if (getNumComponents()>1) throw new IllegalArgumentException();
- int shift = 8 - getComponentSize(getNumColorComponents());
- if (shift >= 0) return pixel << shift;
- return pixel >> (-shift);
- }
-
- public int getRGB(int pixel)
- {
- float[] rgb = getRGBFloat(pixel);
- int ret = getRGB(rgb);
- if (hasAlpha()) ret |= getAlpha(pixel) << 24;
- return ret;
- }
-
-
- /* Note, it's OK to pass a to large array to toRGB(). Extra
- elements are ignored. */
-
- private float[] getRGBFloat(int pixel)
- {
- float[] data = { pixel };
- return cspace.toRGB(data);
- }
-
- private float[] getRGBFloat(Object inData)
- {
- DataBuffer buffer =
- Buffers.createBufferFromData(transferType, inData,
- getNumComponents());
- int colors = getNumColorComponents();
- float[] data = new float[colors];
-
- // FIXME: unpremultiply data that is premultiplied
- for (int i=0; i<colors; i++)
- {
- float maxValue = (1<<getComponentSize(i))-1;
- data[i] = buffer.getElemFloat(i)/maxValue;
- }
- float[] rgb = cspace.toRGB(data);
- return rgb;
- }
-
- public int getRed(Object inData)
- {
- return (int) getRGBFloat(inData)[0]*255;
- }
-
- public int getGreen(Object inData)
- {
- return (int) getRGBFloat(inData)[1]*255;
- }
-
- public int getBlue(Object inData)
- {
- return (int) getRGBFloat(inData)[2]*255;
- }
-
- public int getAlpha(Object inData)
- {
- DataBuffer buffer =
- Buffers.createBufferFromData(transferType, inData,
- getNumComponents());
- int shift = 8 - getComponentSize(getNumColorComponents());
- int alpha = buffer.getElem(getNumColorComponents());
- if (shift >= 0) return alpha << shift;
- return alpha >> (-shift);
- }
-
- private int getRGB(float[] rgb)
- {
- /* NOTE: We could cast to byte instead of int here. This would
- avoid bits spilling over from one bit field to
- another. But, if we assume that floats are in the [0.0,
- 1.0] range, this will never happen anyway. */
-
- /* Remember to multiply BEFORE casting to int, otherwise, decimal
- point data will be lost. */
- int ret =
- (((int) (rgb[0]*255F)) << 16) |
- (((int) (rgb[1]*255F)) << 8) |
- (((int) (rgb[2]*255F)) << 0);
- return ret;
- }
-
- /**
- * @param inData pixel data of transferType, as returned by the
- * getDataElements method in SampleModel.
- */
- public int getRGB(Object inData)
- {
- float[] rgb = getRGBFloat(inData);
- int ret = getRGB(rgb);
- if (hasAlpha()) ret |= getAlpha(inData) << 24;
- return ret;
- }
-
- public Object getDataElements(int rgb, Object pixel)
- {
- // Convert rgb to [0.0, 1.0] sRGB values.
- float[] rgbFloats = {
- ((rgb >> 16)&0xff)/255.0F,
- ((rgb >> 8)&0xff)/255.0F,
- ((rgb >> 0)&0xff)/255.0F
- };
-
- // Convert from rgb to color space components.
- float[] data = cspace.fromRGB(rgbFloats);
- DataBuffer buffer = Buffers.createBuffer(transferType, pixel,
- getNumComponents());
- int numColors = getNumColorComponents();
-
- if (hasAlpha())
- {
- float alpha = ((rgb >> 24)&0xff)/255.0F;
-
- /* If color model has alpha and should be premultiplied, multiply
- color space components with alpha value. */
- if (isAlphaPremultiplied()) {
- for (int i=0; i<numColors; i++)
- data[i] *= alpha;
- }
- // Scale the alpha sample to the correct number of bits.
- alpha *= (1<<(bits[numColors]-1));
- // Arrange the alpha sample in the output array.
- buffer.setElemFloat(numColors, alpha);
- }
- for (int i=0; i<numColors; i++)
- {
- // Scale the color samples to the correct number of bits.
- float value = data[i]*(1<<(bits[i]-1));
- // Arrange the color samples in the output array.
- buffer.setElemFloat(i, value);
- }
- return Buffers.getData(buffer);
- }
-
- public int[] getComponents(int pixel, int[] components, int offset)
- {
- if (getNumComponents()>1) throw new IllegalArgumentException();
- if (components == null)
- components = new int[getNumComponents() + offset];
- components[offset] = pixel;
- return components;
- }
-
- public int[] getComponents(Object pixel, int[] components, int offset)
- {
- DataBuffer buffer = Buffers.createBuffer(transferType, pixel,
- getNumComponents());
- int numComponents = getNumComponents();
-
- if (components == null)
- components = new int[numComponents + offset];
-
- for (int i=0; i<numComponents; i++)
- components[offset++] = buffer.getElem(i);
-
- return components;
- }
-
- public int getDataElement(int[] components, int offset)
- {
- if (getNumComponents()>1) throw new IllegalArgumentException();
- return components[offset];
- }
-
- public Object getDataElements(int[] components, int offset, Object obj)
- {
- DataBuffer buffer = Buffers.createBuffer(transferType, obj,
- getNumComponents());
- int numComponents = getNumComponents();
-
- for (int i=0; i<numComponents; i++)
- buffer.setElem(i, components[offset++]);
-
- return Buffers.getData(buffer);
- }
-
- public ColorModel coerceData(WritableRaster raster,
- boolean isAlphaPremultiplied) {
- if (this.isAlphaPremultiplied == isAlphaPremultiplied)
- return this;
-
- /* TODO: provide better implementation based on the
- assumptions we can make due to the specific type of the
- color model. */
- super.coerceData(raster, isAlphaPremultiplied);
-
- return new ComponentColorModel(cspace, bits, hasAlpha(),
- isAlphaPremultiplied, // argument
- transparency, transferType);
- }
-
- public boolean isCompatibleRaster(Raster raster)
- {
- return super.isCompatibleRaster(raster);
- // FIXME: Should we test something more here? (Why override?)
- }
-
- public WritableRaster createCompatibleWritableRaster(int w, int h)
- {
- SampleModel sm = createCompatibleSampleModel(w, h);
- Point origin = new Point(0, 0);
- return Raster.createWritableRaster(sm, origin);
- }
-
-
- /**
- * Creates a <code>SampleModel</code> whose arrangement of pixel
- * data is compatible to this <code>ColorModel</code>.
- *
- * @param w the number of pixels in the horizontal direction.
- * @param h the number of pixels in the vertical direction.
- */
- public SampleModel createCompatibleSampleModel(int w, int h)
- {
- int pixelStride, scanlineStride;
- int[] bandOffsets;
-
- pixelStride = getNumComponents();
- scanlineStride = pixelStride * w;
-
- /* We might be able to re-use the same bandOffsets array among
- * multiple calls to this method. However, this optimization does
- * not seem worthwile because setting up descriptive data
- * structures (such as SampleModels) is neglectible in comparision
- * to shuffling around masses of pixel data.
- */
- bandOffsets = new int[pixelStride];
- for (int i = 0; i < pixelStride; i++)
- bandOffsets[i] = i;
-
- /* FIXME: Think about whether it would make sense to return the
- * possibly more efficient PixelInterleavedSampleModel for other
- * transferTypes as well. It seems unlikely that this would break
- * any user applications, so the Mauve tests on this method
- * might be too restrictive.
- */
- switch (transferType)
- {
- case DataBuffer.TYPE_BYTE:
- case DataBuffer.TYPE_USHORT:
- return new PixelInterleavedSampleModel(transferType, w, h,
- pixelStride,
- scanlineStride,
- bandOffsets);
-
- default:
- return new ComponentSampleModel(transferType, w, h,
- pixelStride,
- scanlineStride,
- bandOffsets);
- }
- }
-
-
- public boolean isCompatibleSampleModel(SampleModel sm)
- {
- return
- (sm instanceof ComponentSampleModel) &&
- super.isCompatibleSampleModel(sm);
- }
-
- public WritableRaster getAlphaRaster(WritableRaster raster)
- {
- if (!hasAlpha()) return null;
-
- SampleModel sm = raster.getSampleModel();
- int[] alphaBand = { sm.getNumBands() - 1 };
- SampleModel alphaModel = sm.createSubsetSampleModel(alphaBand);
- DataBuffer buffer = raster.getDataBuffer();
- Point origin = new Point(0, 0);
- return Raster.createWritableRaster(alphaModel, buffer, origin);
- }
-
- public boolean equals(Object obj)
- {
- if (!(obj instanceof ComponentColorModel)) return false;
- return super.equals(obj);
- }
-}
diff --git a/libjava/java/awt/image/ComponentSampleModel.java b/libjava/java/awt/image/ComponentSampleModel.java
deleted file mode 100644
index 953f63c1ea1..00000000000
--- a/libjava/java/awt/image/ComponentSampleModel.java
+++ /dev/null
@@ -1,544 +0,0 @@
-/* Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import gnu.java.awt.Buffers;
-
-/* FIXME: This class does not yet support data type TYPE_SHORT */
-
-/**
- * ComponentSampleModel supports a flexible organization of pixel samples in
- * memory, permitting pixel samples to be interleaved by band, by scanline,
- * and by pixel.
- *
- * A DataBuffer for this sample model has K banks of data. Pixels have N
- * samples, so there are N bands in the DataBuffer. Each band is completely
- * contained in one bank of data, but a bank may contain more than one band.
- * Each pixel sample is stored in a single data element.
- *
- * Within a bank, each band begins at an offset stored in bandOffsets. The
- * banks containing the band is given by bankIndices. Within the bank, there
- * are three dimensions - band, pixel, and scanline. The dimension ordering
- * is controlled by bandOffset, pixelStride, and scanlineStride, which means
- * that any combination of interleavings is supported.
- *
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public class ComponentSampleModel extends SampleModel
-{
- protected int[] bandOffsets;
- protected int[] bankIndices;
-
- // FIXME: Should we really shadow the numBands in the superclass?
- //protected int numBands;
-
- /** Used when creating data buffers. */
- protected int numBanks;
-
- protected int scanlineStride;
-
- protected int pixelStride;
-
- private boolean tightPixelPacking = false;
-
- public ComponentSampleModel(int dataType,
- int w, int h,
- int pixelStride,
- int scanlineStride,
- int[] bandOffsets)
- {
- this(dataType, w, h, pixelStride, scanlineStride,
- new int[bandOffsets.length], bandOffsets);
- }
-
- public ComponentSampleModel(int dataType,
- int w, int h,
- int pixelStride,
- int scanlineStride,
- int[] bankIndices,
- int[] bandOffsets)
- {
- super(dataType, w, h, bandOffsets.length);
- if ((pixelStride<0) || (scanlineStride<0) ||
- (bandOffsets.length<1) ||
- (bandOffsets.length != bankIndices.length))
- throw new IllegalArgumentException();
-
- this.bandOffsets = bandOffsets;
- this.bankIndices = bankIndices;
-
- this.numBanks = 0;
- for (int b=0; b<bankIndices.length; b++)
- this.numBanks = Math.max(this.numBanks, bankIndices[b]+1);
-
- this.scanlineStride = scanlineStride;
- this.pixelStride = pixelStride;
-
- // See if we can use some speedups
-
- /* FIXME: May these checks should be reserved for the
- PixelInterleavedSampleModel? */
-
- if (pixelStride == numBands)
- {
- tightPixelPacking = true;
- for (int b=0; b<numBands; b++) {
- if ((bandOffsets[b] != b) || (bankIndices[b] !=0))
- {
- tightPixelPacking = false;
- break;
- }
- }
- }
- }
-
- public SampleModel createCompatibleSampleModel(int w, int h)
- {
- return new ComponentSampleModel(dataType, w, h, pixelStride,
- scanlineStride, bankIndices,
- bandOffsets);
- }
-
- public SampleModel createSubsetSampleModel(int[] bands)
- {
- int numBands = bands.length;
-
- int[] bankIndices = new int[numBands];
- int[] bandOffsets = new int[numBands];
- for (int b=0; b<numBands; b++)
- {
- bankIndices[b] = this.bankIndices[bands[b]];
- bandOffsets[b] = this.bandOffsets[bands[b]];
- }
-
- return new ComponentSampleModel(dataType, width, height, pixelStride,
- scanlineStride, bankIndices,
- bandOffsets);
- }
-
- public DataBuffer createDataBuffer()
- {
- // Maybe this value should be precalculated in the constructor?
- int highestOffset = 0;
- for (int b=0; b<numBands; b++)
- {
- highestOffset = Math.max(highestOffset, bandOffsets[b]);
- }
- int size = pixelStride*(width-1) + scanlineStride*(height-1) +
- highestOffset + 1;
-
- return Buffers.createBuffer(getDataType(), size, numBanks);
- }
-
- public int getOffset(int x, int y)
- {
- return getOffset(x, y, 0);
- }
-
- public int getOffset(int x, int y, int b)
- {
- return bandOffsets[b] + pixelStride*x + scanlineStride*y;
- }
-
- public final int[] getSampleSize()
- {
- int size = DataBuffer.getDataTypeSize(getDataType());
- int[] sizes = new int[numBands];
-
- java.util.Arrays.fill(sizes, size);
- return sizes;
- }
-
- public final int getSampleSize(int band)
- {
- return DataBuffer.getDataTypeSize(getDataType());
- }
-
- public final int[] getBankIndices()
- {
- return bankIndices;
- }
-
- public final int[] getBandOffsets()
- {
- return bandOffsets;
- }
-
- public final int getScanlineStride()
- {
- return scanlineStride;
- }
-
- public final int getPixelStride()
- {
- return pixelStride;
- }
-
- public final int getNumDataElements()
- {
- return numBands;
- }
-
- public Object getDataElements(int x, int y, Object obj, DataBuffer data)
- {
- int xyOffset = pixelStride*x + scanlineStride*y;
-
- int[] totalBandDataOffsets = new int[numBands];
-
- /* Notice that band and bank offsets are different. Band offsets
- are managed by the sample model, and bank offsets are managed
- by the data buffer. Both must be accounted for. */
-
- /* FIXME: For single pixels, it is probably easier to simple
- call getElem instead of calculating the bank offset ourself.
-
- On the other hand, then we need to push the value through
- the int type returned by the getElem method. */
-
- int[] bankOffsets = data.getOffsets();
-
- for (int b=0; b<numBands; b++)
- {
- totalBandDataOffsets[b] =
- bandOffsets[b]+bankOffsets[bankIndices[b]] + xyOffset;
- }
-
- try
- {
- switch (getTransferType())
- {
- case DataBuffer.TYPE_BYTE:
- DataBufferByte inByte = (DataBufferByte) data;
- byte[] outByte = (byte[]) obj;
- if (outByte == null) outByte = new byte[numBands];
-
- for (int b=0; b<numBands; b++)
- {
- int dOffset = totalBandDataOffsets[b];
- outByte[b] = inByte.getData(bankIndices[b])[dOffset];
- }
- return outByte;
-
- case DataBuffer.TYPE_USHORT:
- DataBufferUShort inUShort = (DataBufferUShort) data;
- short[] outUShort = (short[]) obj;
- if (outUShort == null) outUShort = new short[numBands];
-
- for (int b=0; b<numBands; b++)
- {
- int dOffset = totalBandDataOffsets[b];
- outUShort[b] = inUShort.getData(bankIndices[b])[dOffset];
- }
- return outUShort;
-
- case DataBuffer.TYPE_SHORT:
- DataBufferShort inShort = (DataBufferShort) data;
- short[] outShort = (short[]) obj;
- if (outShort == null) outShort = new short[numBands];
-
- for (int b=0; b<numBands; b++)
- {
- int dOffset = totalBandDataOffsets[b];
- outShort[b] = inShort.getData(bankIndices[b])[dOffset];
- }
- return outShort;
-
- case DataBuffer.TYPE_INT:
- DataBufferInt inInt = (DataBufferInt) data;
- int[] outInt = (int[]) obj;
- if (outInt == null) outInt = new int[numBands];
-
- for (int b=0; b<numBands; b++)
- {
- int dOffset = totalBandDataOffsets[b];
- outInt[b] = inInt.getData(bankIndices[b])[dOffset];
- }
- return outInt;
-
- case DataBuffer.TYPE_FLOAT:
- DataBufferFloat inFloat = (DataBufferFloat) data;
- float[] outFloat = (float[]) obj;
- if (outFloat == null) outFloat = new float[numBands];
-
- for (int b=0; b<numBands; b++)
- {
- int dOffset = totalBandDataOffsets[b];
- outFloat[b] = inFloat.getData(bankIndices[b])[dOffset];
- }
- return outFloat;
-
- case DataBuffer.TYPE_DOUBLE:
- DataBufferDouble inDouble = (DataBufferDouble) data;
- double[] outDouble = (double[]) obj;
- if (outDouble == null) outDouble = new double[numBands];
-
- for (int b=0; b<numBands; b++)
- {
- int dOffset = totalBandDataOffsets[b];
- outDouble[b] = inDouble.getData(bankIndices[b])[dOffset];
- }
- return outDouble;
-
- default:
- throw new IllegalStateException("unknown transfer type " +
- getTransferType());
- }
- }
- catch (ArrayIndexOutOfBoundsException aioobe)
- {
- String msg = "While reading data elements, " +
- "x=" + x + ", y=" + y +", " + ", xyOffset=" + xyOffset +
- ", data.getSize()=" + data.getSize() + ": " + aioobe;
- throw new ArrayIndexOutOfBoundsException(msg);
- }
- }
-
- public Object getDataElements(int x, int y, int w, int h, Object obj,
- DataBuffer data)
- {
- if (!tightPixelPacking)
- {
- return super.getDataElements(x, y, w, h, obj, data);
- }
-
- // using get speedup
-
- // We can copy whole rows
- int rowSize = w*numBands;
- int dataSize = rowSize*h;
-
- DataBuffer transferBuffer =
- Buffers.createBuffer(getTransferType(), obj, dataSize);
- obj = Buffers.getData(transferBuffer);
-
- int inOffset =
- pixelStride*x +
- scanlineStride*y +
- data.getOffset(); // Assumes only one band is used
-
- /* We don't add band offsets since we assume that bands have
- offsets 0, 1, 2, ... */
-
- // See if we can copy everything in one go
- if (scanlineStride == rowSize)
- {
- // Collapse scan lines:
- rowSize *= h;
- // We ignore scanlineStride since it won't be of any use
- h = 1;
- }
-
- int outOffset = 0;
- Object inArray = Buffers.getData(data);
- for (int yd = 0; yd<h; yd++)
- {
- System.arraycopy(inArray, inOffset, obj, outOffset, rowSize);
- inOffset += scanlineStride;
- outOffset += rowSize;
- }
- return obj;
- }
-
- public void setDataElements(int x, int y, int w, int h,
- Object obj, DataBuffer data)
- {
- if (!tightPixelPacking)
- {
- super.setDataElements(x, y, w, h, obj, data);
- return;
- }
-
- // using set speedup, we can copy whole rows
- int rowSize = w*numBands;
- int dataSize = rowSize*h;
-
- DataBuffer transferBuffer =
- Buffers.createBufferFromData(getTransferType(), obj, dataSize);
-
- int[] bankOffsets = data.getOffsets();
-
- int outOffset =
- pixelStride*x +
- scanlineStride*y +
- bankOffsets[0]; // same assuptions as in get...
-
- // See if we can copy everything in one go
- if (scanlineStride == rowSize)
- {
- // Collapse scan lines:
- rowSize *= h;
- h = 1;
- }
-
- int inOffset = 0;
- Object outArray = Buffers.getData(data);
- for (int yd = 0; yd<h; yd++)
- {
- System.arraycopy(obj, inOffset, outArray, outOffset, rowSize);
- outOffset += scanlineStride;
- inOffset += rowSize;
- }
- }
-
- public int[] getPixel(int x, int y, int[] iArray, DataBuffer data)
- {
- int offset = pixelStride*x + scanlineStride*y;
- if (iArray == null) iArray = new int[numBands];
- for (int b=0; b<numBands; b++)
- {
- iArray[b] = data.getElem(bankIndices[b], offset+bandOffsets[b]);
- }
- return iArray;
- }
-
- public int[] getPixels(int x, int y, int w, int h, int[] iArray,
- DataBuffer data)
- {
- int offset = pixelStride*x + scanlineStride*y;
- if (iArray == null) iArray = new int[numBands*w*h];
- int outOffset = 0;
- for (y=0; y<h; y++)
- {
- int lineOffset = offset;
- for (x=0; x<w; x++)
- {
- for (int b=0; b<numBands; b++)
- {
- iArray[outOffset++] =
- data.getElem(bankIndices[b], lineOffset+bandOffsets[b]);
- }
- lineOffset += pixelStride;
- }
- offset += scanlineStride;
- }
- return iArray;
- }
-
- public int getSample(int x, int y, int b, DataBuffer data)
- {
- return data.getElem(bankIndices[b], getOffset(x, y, b));
- }
-
- public void setDataElements(int x, int y, Object obj, DataBuffer data)
- {
- int offset = pixelStride*x + scanlineStride*y;
- int[] totalBandDataOffsets = new int[numBands];
- int[] bankOffsets = data.getOffsets();
- for (int b=0; b<numBands; b++)
- totalBandDataOffsets[b] =
- bandOffsets[b]+bankOffsets[bankIndices[b]] + offset;
-
- switch (getTransferType())
- {
- case DataBuffer.TYPE_BYTE:
- {
- DataBufferByte out = (DataBufferByte) data;
- byte[] in = (byte[]) obj;
-
- for (int b=0; b<numBands; b++)
- out.getData(bankIndices[b])[totalBandDataOffsets[b]] = in[b];
-
- return;
- }
- case DataBuffer.TYPE_USHORT:
- {
- DataBufferUShort out = (DataBufferUShort) data;
- short[] in = (short[]) obj;
-
- for (int b=0; b<numBands; b++)
- out.getData(bankIndices[b])[totalBandDataOffsets[b]] = in[b];
-
- return;
- }
- case DataBuffer.TYPE_SHORT:
- {
- DataBufferShort out = (DataBufferShort) data;
- short[] in = (short[]) obj;
-
- for (int b=0; b<numBands; b++)
- out.getData(bankIndices[b])[totalBandDataOffsets[b]] = in[b];
-
- return;
- }
- case DataBuffer.TYPE_INT:
- {
- DataBufferInt out = (DataBufferInt) data;
- int[] in = (int[]) obj;
-
- for (int b=0; b<numBands; b++)
- out.getData(bankIndices[b])[totalBandDataOffsets[b]] = in[b];
-
- return;
- }
- case DataBuffer.TYPE_FLOAT:
- {
- DataBufferFloat out = (DataBufferFloat) data;
- float[] in = (float[]) obj;
-
- for (int b=0; b<numBands; b++)
- out.getData(bankIndices[b])[totalBandDataOffsets[b]] = in[b];
-
- return;
- }
- case DataBuffer.TYPE_DOUBLE:
- {
- DataBufferDouble out = (DataBufferDouble) data;
- double[] in = (double[]) obj;
-
- for (int b=0; b<numBands; b++)
- out.getData(bankIndices[b])[totalBandDataOffsets[b]] = in[b];
-
- return;
- }
- default:
- throw new UnsupportedOperationException("transfer type not " +
- "implemented");
- }
- }
-
- public void setPixel(int x, int y, int[] iArray, DataBuffer data)
- {
- int offset = pixelStride*x + scanlineStride*y;
- for (int b=0; b<numBands; b++)
- data.setElem(bankIndices[b], offset+bandOffsets[b], iArray[b]);
- }
-
- public void setSample(int x, int y, int b, int s, DataBuffer data)
- {
- data.setElem(bankIndices[b], getOffset(x, y, b), s);
- }
-}
diff --git a/libjava/java/awt/image/ConvolveOp.java b/libjava/java/awt/image/ConvolveOp.java
deleted file mode 100644
index f841c13557f..00000000000
--- a/libjava/java/awt/image/ConvolveOp.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/* ConvolveOp.java --
- Copyright (C) 2004 Free Software Foundation -- ConvolveOp
-
-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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.util.Arrays;
-
-/**
- * Convolution filter.
- *
- * ConvolveOp convolves the source image with a Kernel to generate a
- * destination image. This involves multiplying each pixel and its neighbors
- * with elements in the kernel to compute a new pixel.
- *
- * Each band in a Raster is convolved and copied to the destination Raster.
- *
- * For BufferedImages, convolution is applied to all components. If the
- * source is not premultiplied, the data will be premultiplied before
- * convolving. Premultiplication will be undone if the destination is not
- * premultiplied. Color conversion will be applied if needed.
- *
- * @author jlquinn@optonline.net
- */
-public class ConvolveOp implements BufferedImageOp, RasterOp
-{
- /** Edge pixels are set to 0. */
- public static final int EDGE_ZERO_FILL = 0;
-
- /** Edge pixels are copied from the source. */
- public static final int EDGE_NO_OP = 1;
-
- private Kernel kernel;
- private int edge;
- private RenderingHints hints;
-
- /**
- * Construct a ConvolveOp.
- *
- * The edge condition specifies that pixels outside the area that can be
- * filtered are either set to 0 or copied from the source image.
- *
- * @param kernel The kernel to convolve with.
- * @param edgeCondition Either EDGE_ZERO_FILL or EDGE_NO_OP.
- * @param hints Rendering hints for color conversion, or null.
- */
- public ConvolveOp(Kernel kernel,
- int edgeCondition,
- RenderingHints hints)
- {
- this.kernel = kernel;
- edge = edgeCondition;
- this.hints = hints;
- }
-
- /**
- * Construct a ConvolveOp.
- *
- * The edge condition defaults to EDGE_ZERO_FILL.
- *
- * @param kernel The kernel to convolve with.
- */
- public ConvolveOp(Kernel kernel)
- {
- this.kernel = kernel;
- edge = EDGE_ZERO_FILL;
- hints = null;
- }
-
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#filter(java.awt.image.BufferedImage,
- * java.awt.image.BufferedImage)
- */
- public BufferedImage filter(BufferedImage src, BufferedImage dst)
- {
- if (src == dst)
- throw new IllegalArgumentException();
-
- if (dst == null)
- dst = createCompatibleDestImage(src, src.getColorModel());
-
- // Make sure source image is premultiplied
- BufferedImage src1 = src;
- if (!src.isPremultiplied)
- {
- src1 = createCompatibleDestImage(src, src.getColorModel());
- src.copyData(src1.getRaster());
- src1.coerceData(true);
- }
-
- BufferedImage dst1 = dst;
- if (!src.getColorModel().equals(dst.getColorModel()))
- dst1 = createCompatibleDestImage(src, src.getColorModel());
-
- filter(src1.getRaster(), dst1.getRaster());
-
- if (dst1 != dst)
- {
- // Convert between color models.
- // TODO Check that premultiplied alpha is handled correctly here.
- Graphics2D gg = dst.createGraphics();
- gg.setRenderingHints(hints);
- gg.drawImage(dst1, 0, 0, null);
- gg.dispose();
- }
-
- return dst;
- }
-
- /* (non-Javadoc)
- * @see
- * java.awt.image.BufferedImageOp#createCompatibleDestImage(java.awt.image.BufferedImage,
- * java.awt.image.ColorModel)
- */
- public BufferedImage createCompatibleDestImage(BufferedImage src,
- ColorModel dstCM)
- {
- // FIXME: set properties to those in src
- return new BufferedImage(dstCM,
- src.getRaster().createCompatibleWritableRaster(),
- src.isPremultiplied, null);
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#getRenderingHints()
- */
- public RenderingHints getRenderingHints()
- {
- return hints;
- }
-
- /**
- * @return The edge condition.
- */
- public int getEdgeCondition()
- {
- return edge;
- }
-
- /**
- * @return The convolution kernel.
- */
- public Kernel getKernel()
- {
- return kernel;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#filter(java.awt.image.Raster,
- * java.awt.image.WritableRaster)
- */
- public WritableRaster filter(Raster src, WritableRaster dest) {
- if (src.numBands != dest.numBands)
- throw new ImagingOpException(null);
- if (src == dest)
- throw new IllegalArgumentException();
- if (src.getWidth() < kernel.getWidth() ||
- src.getHeight() < kernel.getHeight())
- throw new ImagingOpException(null);
-
- if (dest == null)
- dest = createCompatibleDestRaster(src);
-
- // Deal with bottom edge
- if (edge == EDGE_ZERO_FILL)
- {
- float[] zeros = new float[src.getNumBands() * src.getWidth()
- * (kernel.getYOrigin() - 1)];
- Arrays.fill(zeros, 0);
- dest.setPixels(src.getMinX(), src.getMinY(), src.getWidth(),
- kernel.getYOrigin() - 1, zeros);
- }
- else
- {
- float[] vals = new float[src.getNumBands() * src.getWidth()
- * (kernel.getYOrigin() - 1)];
- src.getPixels(src.getMinX(), src.getMinY(), src.getWidth(),
- kernel.getYOrigin() - 1, vals);
- dest.setPixels(src.getMinX(), src.getMinY(), src.getWidth(),
- kernel.getYOrigin() - 1, vals);
- }
-
- // Handle main section
- float[] kvals = kernel.getKernelData(null);
-
- float[] tmp = new float[kernel.getWidth() * kernel.getHeight()];
- for (int y = src.getMinY() + kernel.getYOrigin();
- y < src.getMinY() + src.getHeight() - kernel.getYOrigin() / 2; y++)
- {
- // Handle unfiltered edge pixels at start of line
- float[] t1 = new float[(kernel.getXOrigin() - 1) * src.getNumBands()];
- if (edge == EDGE_ZERO_FILL)
- Arrays.fill(t1, 0);
- else
- src.getPixels(src.getMinX(), y, kernel.getXOrigin() - 1, 1, t1);
- dest.setPixels(src.getMinX(), y, kernel.getXOrigin() - 1, 1, t1);
-
- for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
- {
- // FIXME: This needs a much more efficient implementation
- for (int b = 0; b < src.getNumBands(); b++)
- {
- float v = 0;
- src.getSamples(x, y, kernel.getWidth(), kernel.getHeight(), b, tmp);
- for (int i=0; i < tmp.length; i++)
- v += tmp[i] * kvals[i];
- dest.setSample(x, y, b, v);
- }
- }
-
- // Handle unfiltered edge pixels at end of line
- float[] t2 = new float[(kernel.getWidth() / 2) * src.getNumBands()];
- if (edge == EDGE_ZERO_FILL)
- Arrays.fill(t2, 0);
- else
- src.getPixels(src.getMinX() + src.getWidth()
- - (kernel.getWidth() / 2),
- y, kernel.getWidth() / 2, 1, t2);
- dest.setPixels(src.getMinX() + src.getWidth() - (kernel.getWidth() / 2),
- y, kernel.getWidth() / 2, 1, t2);
- }
- for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
- for (int x = src.getMinX(); x< src.getWidth() + src.getMinX(); x++)
- {
-
- }
- for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
- for (int x = src.getMinX(); x< src.getWidth() + src.getMinX(); x++)
- {
-
- }
-
- // Handle top edge
- if (edge == EDGE_ZERO_FILL)
- {
- float[] zeros = new float[src.getNumBands() * src.getWidth() *
- (kernel.getHeight() / 2)];
- Arrays.fill(zeros, 0);
- dest.setPixels(src.getMinX(),
- src.getHeight() + src.getMinY() - (kernel.getHeight() / 2),
- src.getWidth(), kernel.getHeight() / 2, zeros);
- }
- else
- {
- float[] vals = new float[src.getNumBands() * src.getWidth() *
- (kernel.getHeight() / 2)];
- src.getPixels(src.getMinX(),
- src.getHeight() + src.getMinY()
- - (kernel.getHeight() / 2),
- src.getWidth(), kernel.getHeight() / 2, vals);
- dest.setPixels(src.getMinX(),
- src.getHeight() + src.getMinY()
- - (kernel.getHeight() / 2),
- src.getWidth(), kernel.getHeight() / 2, vals);
- }
-
- return dest;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#createCompatibleDestRaster(java.awt.image.Raster)
- */
- public WritableRaster createCompatibleDestRaster(Raster src)
- {
- return src.createCompatibleWritableRaster();
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#getBounds2D(java.awt.image.BufferedImage)
- */
- public Rectangle2D getBounds2D(BufferedImage src)
- {
- return src.getRaster().getBounds();
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#getBounds2D(java.awt.image.Raster)
- */
- public Rectangle2D getBounds2D(Raster src)
- {
- return src.getBounds();
- }
-
- /** Return corresponding destination point for source point.
- *
- * ConvolveOp will return the value of src unchanged.
- * @param src The source point.
- * @param dst The destination point.
- * @see java.awt.image.RasterOp#getPoint2D(java.awt.geom.Point2D,
- * java.awt.geom.Point2D)
- */
- public Point2D getPoint2D(Point2D src, Point2D dst)
- {
- if (dst == null) return (Point2D)src.clone();
- dst.setLocation(src);
- return dst;
- }
-}
diff --git a/libjava/java/awt/image/CropImageFilter.java b/libjava/java/awt/image/CropImageFilter.java
deleted file mode 100644
index 490f43cd728..00000000000
--- a/libjava/java/awt/image/CropImageFilter.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/* CropImageFilter.java -- Java class for cropping image filter
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Rectangle;
-import java.util.Hashtable;
-
-/**
- * Currently this filter does almost nothing and needs to be implemented.
- *
- * @author C. Brian Jones (cbj@gnu.org)
- */
-public class CropImageFilter extends ImageFilter
-{
- int x;
- int y;
- int width;
- int height;
-
- /**
- * Construct a new <code>CropImageFilter</code> instance.
- *
- * @param x the x-coordinate location of the top-left of the cropped rectangle
- * @param y the y-coordinate location of the top-left of the cropped rectangle
- * @param width the width of the cropped rectangle
- * @param height the height of the cropped rectangle
- */
- public CropImageFilter(int x, int y, int width, int height) {
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- }
-
- /**
- * An <code>ImageProducer</code> indicates the size of the image
- * being produced using this method. This filter overrides this
- * method in order to set the dimentions to the size of the
- * cropped rectangle instead of the size of the image.
- *
- * @param width the width of the image
- * @param height the height of the image
- */
- public void setDimensions(int width, int height)
- {
- consumer.setDimensions(this.width, this.height);
- }
-
- /**
- * An <code>ImageProducer</code> can set a list of properties
- * associated with this image by using this method.
- * <br>
- * FIXME - What property is set for this class?
- *
- * @param props the list of properties associated with this image
- */
- public void setProperties(Hashtable props)
- {
- props.put("filters", "CropImageFilter");
- consumer.setProperties(props);
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as a <code>byte</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels, int offset, int scansize)
- {
- Rectangle filterBounds = new Rectangle(this.x, this.y,
- this.width, this.height);
- Rectangle pixelBounds = new Rectangle(x, y, w, h);
-
- if (filterBounds.intersects(pixelBounds))
- {
- Rectangle bounds = filterBounds.intersection(pixelBounds);
-
- byte[] cropped = new byte[bounds.width * bounds.height];
- for (int i = 0; i < bounds.height; i++)
- {
- int start = (bounds.y - pixelBounds.y + i) * scansize + offset;
-
- for (int j = 0; j < bounds.width; j++)
- cropped[i * bounds.width + j] = pixels[start + bounds.x + j];
- }
-
- consumer.setPixels(bounds.x, bounds.y,
- bounds.width, bounds.height,
- model, cropped, 0, bounds.width);
- }
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as an <code>int</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels, int offset, int scansize)
- {
- Rectangle filterBounds = new Rectangle(this.x, this.y,
- this.width, this.height);
- Rectangle pixelBounds = new Rectangle(x, y, w, h);
-
- if (filterBounds.intersects(pixelBounds))
- {
- Rectangle bounds = filterBounds.intersection(pixelBounds);
-
- int[] cropped = new int[bounds.width * bounds.height];
- for (int i = 0; i < bounds.height; i++)
- {
- int start = (bounds.y - pixelBounds.y + i) * scansize + offset;
-
- for (int j = 0; j < bounds.width; j++)
- cropped[i * bounds.width + j] = pixels[start + bounds.x + j];
- }
-
- consumer.setPixels(bounds.x, bounds.y,
- bounds.width, bounds.height,
- model, cropped, 0, bounds.width);
- }
- }
-
-}
-
diff --git a/libjava/java/awt/image/DataBuffer.java b/libjava/java/awt/image/DataBuffer.java
deleted file mode 100644
index 5bff6901e64..00000000000
--- a/libjava/java/awt/image/DataBuffer.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/* Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * Class that manages arrays of data elements. A data buffer consists
- * of one or more banks. A bank is a continuous region of data
- * elements.
- *
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public abstract class DataBuffer
-{
- /**
- * A constant representng a data type that uses <code>byte</code> primitives
- * as the storage unit.
- */
- public static final int TYPE_BYTE = 0;
-
- /**
- * A constant representng a data type that uses <code>short</code>
- * primitives as the storage unit.
- */
- public static final int TYPE_USHORT = 1;
-
- /**
- * A constant representng a data type that uses <code>short</code>
- * primitives as the storage unit.
- */
- public static final int TYPE_SHORT = 2;
-
- /**
- * A constant representng a data type that uses <code>int</code>
- * primitives as the storage unit.
- */
- public static final int TYPE_INT = 3;
-
- /**
- * A constant representng a data type that uses <code>float</code>
- * primitives as the storage unit.
- */
- public static final int TYPE_FLOAT = 4;
-
- /**
- * A constant representng a data type that uses <code>double</code>
- * primitives as the storage unit.
- */
- public static final int TYPE_DOUBLE = 5;
-
- /**
- * A constant representng an undefined data type.
- */
- public static final int TYPE_UNDEFINED = 32;
-
- /** The type of the data elements stored in the data buffer. */
- protected int dataType;
-
- /** The number of banks in this buffer. */
- protected int banks = 1;
-
- /** Offset into the default (0'th) bank). */
- protected int offset; // FIXME: Is offsets[0] always mirrored in offset?
-
- /** The size of the banks. */
- protected int size;
-
- /** Offset into each bank. */
- protected int[] offsets;
-
- /**
- * Creates a new <code>DataBuffer</code> with the specified data type and
- * size. The <code>dataType</code> should be one of the constants
- * {@link #TYPE_BYTE}, {@link #TYPE_SHORT}, {@link #TYPE_USHORT},
- * {@link #TYPE_INT}, {@link #TYPE_FLOAT} and {@link #TYPE_DOUBLE}.
- * <p>
- * The physical (array-based) storage is allocated by a subclass.
- *
- * @param dataType the data type.
- * @param size the number of elements in the buffer.
- */
- protected DataBuffer(int dataType, int size)
- {
- this.dataType = dataType;
- this.size = size;
- }
-
- /**
- * Creates a new <code>DataBuffer</code> with the specified data type,
- * size and number of banks. The <code>dataType</code> should be one of
- * the constants {@link #TYPE_BYTE}, {@link #TYPE_SHORT},
- * {@link #TYPE_USHORT}, {@link #TYPE_INT}, {@link #TYPE_FLOAT} and
- * {@link #TYPE_DOUBLE}.
- * <p>
- * The physical (array-based) storage is allocated by a subclass.
- *
- * @param dataType the data type.
- * @param size the number of elements in the buffer.
- * @param numBanks the number of data banks.
- */
- protected DataBuffer(int dataType, int size, int numBanks) {
- this(dataType, size);
- banks = numBanks;
- offsets = new int[numBanks];
- }
-
- /**
- * Creates a new <code>DataBuffer</code> with the specified data type,
- * size and number of banks. An offset (which applies to all banks) is
- * also specified. The <code>dataType</code> should be one of
- * the constants {@link #TYPE_BYTE}, {@link #TYPE_SHORT},
- * {@link #TYPE_USHORT}, {@link #TYPE_INT}, {@link #TYPE_FLOAT} and
- * {@link #TYPE_DOUBLE}.
- * <p>
- * The physical (array-based) storage is allocated by a subclass.
- *
- * @param dataType the data type.
- * @param size the number of elements in the buffer.
- * @param numBanks the number of data banks.
- * @param offset the offset to the first element for all banks.
- */
- protected DataBuffer(int dataType, int size, int numBanks, int offset) {
- this(dataType, size, numBanks);
-
- java.util.Arrays.fill(offsets, offset);
-
- this.offset = offset;
- }
-
- /**
- * Creates a new <code>DataBuffer</code> with the specified data type,
- * size and number of banks. An offset (which applies to all banks) is
- * also specified. The <code>dataType</code> should be one of
- * the constants {@link #TYPE_BYTE}, {@link #TYPE_SHORT},
- * {@link #TYPE_USHORT}, {@link #TYPE_INT}, {@link #TYPE_FLOAT} and
- * {@link #TYPE_DOUBLE}.
- * <p>
- * The physical (array-based) storage is allocated by a subclass.
- *
- * @param dataType the data type.
- * @param size the number of elements in the buffer.
- * @param numBanks the number of data banks.
- * @param offsets the offsets to the first element for all banks.
- *
- * @throws ArrayIndexOutOfBoundsException if
- * <code>numBanks != offsets.length</code>.
- */
- protected DataBuffer(int dataType, int size, int numBanks, int[] offsets) {
- this(dataType, size);
- if (numBanks != offsets.length)
- throw new ArrayIndexOutOfBoundsException();
-
- banks = numBanks;
- this.offsets = offsets;
-
- offset = offsets[0];
- }
-
- /**
- * Returns the size (number of bits) of the specified data type. Valid types
- * are defined by the constants {@link #TYPE_BYTE}, {@link #TYPE_SHORT},
- * {@link #TYPE_USHORT}, {@link #TYPE_INT}, {@link #TYPE_FLOAT} and
- * {@link #TYPE_DOUBLE}.
- *
- * @param dataType the data type.
- * @return The number of bits for the specified data type.
- * @throws IllegalArgumentException if <code>dataType < 0</code> or
- * <code>dataType > TYPE_DOUBLE</code>.
- */
- public static int getDataTypeSize(int dataType) {
- // Maybe this should be a lookup table instead.
- switch (dataType)
- {
- case TYPE_BYTE:
- return 8;
- case TYPE_USHORT:
- case TYPE_SHORT:
- return 16;
- case TYPE_INT:
- case TYPE_FLOAT:
- return 32;
- case TYPE_DOUBLE:
- return 64;
- default:
- throw new IllegalArgumentException();
- }
- }
-
- /**
- * Returns the type of the data elements in the data buffer. Valid types
- * are defined by the constants {@link #TYPE_BYTE}, {@link #TYPE_SHORT},
- * {@link #TYPE_USHORT}, {@link #TYPE_INT}, {@link #TYPE_FLOAT} and
- * {@link #TYPE_DOUBLE}.
- *
- * @return The type.
- */
- public int getDataType()
- {
- return dataType;
- }
-
- /**
- * Returns the size of the data buffer.
- *
- * @return The size.
- */
- public int getSize()
- {
- return size;
- }
-
- /**
- * Returns the element offset for the first data bank.
- *
- * @return The element offset.
- */
- public int getOffset()
- {
- return offset;
- }
-
- /**
- * Returns the offsets for all the data banks used by this
- * <code>DataBuffer</code>.
- *
- * @return The offsets.
- */
- public int[] getOffsets()
- {
- if (offsets == null)
- {
- // is this necessary?
- offsets = new int[1];
- offsets[0] = offset;
- }
- return offsets;
- }
-
- /**
- * Returns the number of data banks for this <code>DataBuffer</code>.
- * @return The number of data banks.
- */
- public int getNumBanks()
- {
- return banks;
- }
-
- /**
- * Returns an element from the first data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int i)
- {
- return getElem(0, i);
- }
-
- /**
- * Returns an element from a particular data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param bank the bank index.
- * @param i the element index.
- * @return The element.
- */
- public abstract int getElem(int bank, int i);
-
- /**
- * Sets an element in the first data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int i, int val)
- {
- setElem(0, i, val);
- }
-
- /**
- * Sets an element in a particular data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param bank the data bank index.
- * @param i the element index.
- * @param val the new element value.
- */
- public abstract void setElem(int bank, int i, int val);
-
- /**
- * Returns an element from the first data bank, converted to a
- * <code>float</code>. The offset (specified in the constructor) is added
- * to <code>i</code> before accessing the underlying data array.
- *
- * @param i the element index.
- * @return The element.
- */
- public float getElemFloat(int i)
- {
- return getElem(i);
- }
-
- /**
- * Returns an element from a particular data bank, converted to a
- * <code>float</code>. The offset (specified in the constructor) is
- * added to <code>i</code> before accessing the underlying data array.
- *
- * @param bank the bank index.
- * @param i the element index.
- * @return The element.
- */
- public float getElemFloat(int bank, int i)
- {
- return getElem(bank, i);
- }
-
- /**
- * Sets an element in the first data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElemFloat(int i, float val)
- {
- setElem(i, (int) val);
- }
-
- /**
- * Sets an element in a particular data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param bank the data bank index.
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElemFloat(int bank, int i, float val)
- {
- setElem(bank, i, (int) val);
- }
-
- /**
- * Returns an element from the first data bank, converted to a
- * <code>double</code>. The offset (specified in the constructor) is added
- * to <code>i</code> before accessing the underlying data array.
- *
- * @param i the element index.
- * @return The element.
- */
- public double getElemDouble(int i)
- {
- return getElem(i);
- }
-
- /**
- * Returns an element from a particular data bank, converted to a
- * <code>double</code>. The offset (specified in the constructor) is
- * added to <code>i</code> before accessing the underlying data array.
- *
- * @param bank the bank index.
- * @param i the element index.
- * @return The element.
- */
- public double getElemDouble(int bank, int i)
- {
- return getElem(bank, i);
- }
-
- /**
- * Sets an element in the first data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElemDouble(int i, double val)
- {
- setElem(i, (int) val);
- }
-
- /**
- * Sets an element in a particular data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param bank the data bank index.
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElemDouble(int bank, int i, double val)
- {
- setElem(bank, i, (int) val);
- }
-}
diff --git a/libjava/java/awt/image/DataBufferByte.java b/libjava/java/awt/image/DataBufferByte.java
deleted file mode 100644
index ceed50832ff..00000000000
--- a/libjava/java/awt/image/DataBufferByte.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/* Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/* This is one of several classes that are nearly identical. Maybe we
- should have a central template and generate all these files. This
- is one of the cases where templates or macros would have been
- useful to have in Java.
-
- This file has been created using search-replace. My only fear is
- that these classes will grow out-of-sync as of a result of changes
- that are not propagated to the other files. As always, mirroring
- code is a maintenance nightmare. */
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public final class DataBufferByte extends DataBuffer
-{
- private byte[] data;
- private byte[][] bankData;
-
- /**
- * Creates a new data buffer with a single data bank containing the
- * specified number of <code>byte</code> elements.
- *
- * @param size the number of elements in the data bank.
- */
- public DataBufferByte(int size)
- {
- super(TYPE_BYTE, size, 1, 0);
- bankData = new byte[1][];
- data = new byte[size];
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer with the specified number of data banks,
- * each containing the specified number of <code>byte</code> elements.
- *
- * @param size the number of elements in the data bank.
- * @param numBanks the number of data banks.
- */
- public DataBufferByte(int size, int numBanks)
- {
- super(TYPE_BYTE, size, numBanks);
- bankData = new byte[numBanks][size];
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank.
- * <p>
- * Note: there is no exception when <code>dataArray</code> is
- * <code>null</code>, but in that case an exception will be thrown
- * later if you attempt to access the data buffer.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- */
- public DataBufferByte(byte[] dataArray, int size)
- {
- super(TYPE_BYTE, size, 1, 0);
- bankData = new byte[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank, with
- * the specified offset to the first element.
- * <p>
- * Note: there is no exception when <code>dataArray</code> is
- * <code>null</code>, but in that case an exception will be thrown
- * later if you attempt to access the data buffer.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- * @param offset the offset to the first element in the array.
- */
- public DataBufferByte(byte[] dataArray, int size, int offset)
- {
- super(TYPE_BYTE, size, 1, offset);
- bankData = new byte[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferByte(byte[][] dataArray, int size)
- {
- super(TYPE_BYTE, size, dataArray.length);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks, with
- * the specified offsets to the first element in each bank.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- * @param offsets the offsets to the first element in each data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferByte(byte[][] dataArray, int size, int[] offsets)
- {
- super(TYPE_BYTE, size, dataArray.length, offsets);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Returns the first data bank.
- *
- * @return The first data bank.
- */
- public byte[] getData()
- {
- return data;
- }
-
- /**
- * Returns a data bank.
- *
- * @param bank the bank index.
- * @return A data bank.
- */
- public byte[] getData(int bank)
- {
- return bankData[bank];
- }
-
- /**
- * Returns the array underlying this <code>DataBuffer</code>.
- *
- * @return The data banks.
- */
- public byte[][] getBankData()
- {
- return bankData;
- }
-
- /**
- * Returns an element from the first data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int i)
- {
- return data[i+offset] & 0xff; // get unsigned byte as int
- }
-
- /**
- * Returns an element from a particular data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param bank the bank index.
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int bank, int i)
- {
- // get unsigned byte as int
- return bankData[bank][i+offsets[bank]] & 0xff;
- }
-
- /**
- * Sets an element in the first data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int i, int val)
- {
- data[i+offset] = (byte) val;
- }
-
- /**
- * Sets an element in a particular data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param bank the data bank index.
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int bank, int i, int val)
- {
- bankData[bank][i+offsets[bank]] = (byte) val;
- }
-}
diff --git a/libjava/java/awt/image/DataBufferDouble.java b/libjava/java/awt/image/DataBufferDouble.java
deleted file mode 100644
index eba4a7c3c68..00000000000
--- a/libjava/java/awt/image/DataBufferDouble.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/* Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/* This is one of several classes that are nearly identical. Maybe we
- should have a central template and generate all these files. This
- is one of the cases where templates or macros would have been
- useful to have in Java.
-
- This file has been created using search-replace. My only fear is
- that these classes will grow out-of-sync as of a result of changes
- that are not propagated to the other files. As always, mirroring
- code is a maintenance nightmare. */
-
-/**
- * @since 1.4
- *
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public final class DataBufferDouble
- extends DataBuffer
-{
- private double[] data;
- private double[][] bankData;
-
- /**
- * Creates a new data buffer with a single data bank containing the
- * specified number of <code>double</code> elements.
- *
- * @param size the number of elements in the data bank.
- */
- public DataBufferDouble(int size)
- {
- super(TYPE_DOUBLE, size, 1, 0);
- bankData = new double[1][];
- data = new double[size];
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer with the specified number of data banks,
- * each containing the specified number of <code>double</code> elements.
- *
- * @param size the number of elements in the data bank.
- * @param numBanks the number of data banks.
- */
- public DataBufferDouble(int size, int numBanks)
- {
- super(TYPE_DOUBLE, size, numBanks);
- bankData = new double[numBanks][size];
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank.
- * <p>
- * Note: there is no exception when <code>dataArray</code> is
- * <code>null</code>, but in that case an exception will be thrown
- * later if you attempt to access the data buffer.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- */
- public DataBufferDouble(double[] dataArray, int size)
- {
- super(TYPE_DOUBLE, size, 1, 0);
- bankData = new double[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank, with
- * the specified offset to the first element.
- * <p>
- * Note: there is no exception when <code>dataArray</code> is
- * <code>null</code>, but in that case an exception will be thrown
- * later if you attempt to access the data buffer.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- * @param offset the offset to the first element in the array.
- */
- public DataBufferDouble(double[] dataArray, int size, int offset)
- {
- super(TYPE_DOUBLE, size, 1, offset);
- bankData = new double[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferDouble(double[][] dataArray, int size)
- {
- super(TYPE_DOUBLE, size, dataArray.length);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks, with
- * the specified offsets to the first element in each bank.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- * @param offsets the offsets to the first element in each data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferDouble(double[][] dataArray, int size, int[] offsets)
- {
- super(TYPE_DOUBLE, size, dataArray.length, offsets);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Returns the first data bank.
- *
- * @return The first data bank.
- */
- public double[] getData()
- {
- return data;
- }
-
- /**
- * Returns a data bank.
- *
- * @param bank the bank index.
- * @return A data bank.
- */
- public double[] getData(int bank)
- {
- return bankData[bank];
- }
-
- /**
- * Returns the array underlying this <code>DataBuffer</code>.
- *
- * @return The data banks.
- */
- public double[][] getBankData()
- {
- return bankData;
- }
-
- /**
- * Returns an element from the first data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int i)
- {
- return (int) data[i+offset];
- }
-
- /**
- * Returns an element from a particular data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param bank the bank index.
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int bank, int i)
- {
- return (int) bankData[bank][i+offsets[bank]];
- }
-
- /**
- * Sets an element in the first data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int i, int val)
- {
- data[i+offset] = (double) val;
- }
-
- /**
- * Sets an element in a particular data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param bank the data bank index.
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int bank, int i, int val)
- {
- bankData[bank][i+offsets[bank]] = (double) val;
- }
-
- public float getElemFloat(int i)
- {
- return (float) data[i+offset];
- }
-
- public float getElemFloat(int bank, int i)
- {
- return (float) bankData[bank][i+offsets[bank]];
- }
-
- public void setElemFloat(int i, float val)
- {
- data[i+offset] = val;
- }
-
- public void setElemFloat(int bank, int i, float val)
- {
- bankData[bank][i+offsets[bank]] = val;
- }
-
- public double getElemDouble(int i)
- {
- return data[i + offset];
- }
-
- public double getElemDouble(int bank, int i)
- {
- return bankData[bank][i + offsets[bank]];
- }
-
- public void setElemDouble(int i, double val)
- {
- data[i + offset] = val;
- }
-
- public void setElemDouble(int bank, int i, double val)
- {
- bankData[bank][i + offsets[bank]] = val;
- }
-}
diff --git a/libjava/java/awt/image/DataBufferFloat.java b/libjava/java/awt/image/DataBufferFloat.java
deleted file mode 100644
index 1d4c55b5004..00000000000
--- a/libjava/java/awt/image/DataBufferFloat.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/* Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/* This is one of several classes that are nearly identical. Maybe we
- should have a central template and generate all these files. This
- is one of the cases where templates or macros would have been
- useful to have in Java.
-
- This file has been created using search-replace. My only fear is
- that these classes will grow out-of-sync as of a result of changes
- that are not propagated to the other files. As always, mirroring
- code is a maintenance nightmare. */
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public final class DataBufferFloat
- extends DataBuffer
-{
- private float[] data;
- private float[][] bankData;
-
- /**
- * Creates a new data buffer with a single data bank containing the
- * specified number of <code>float</code> elements.
- *
- * @param size the number of elements in the data bank.
- */
- public DataBufferFloat(int size)
- {
- super(TYPE_FLOAT, size, 1, 0);
- bankData = new float[1][];
- data = new float[size];
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer with the specified number of data banks,
- * each containing the specified number of <code>float</code> elements.
- *
- * @param size the number of elements in the data bank.
- * @param numBanks the number of data banks.
- */
- public DataBufferFloat(int size, int numBanks)
- {
- super(TYPE_FLOAT, size, numBanks);
- bankData = new float[numBanks][size];
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank.
- * <p>
- * Note: there is no exception when <code>dataArray</code> is
- * <code>null</code>, but in that case an exception will be thrown
- * later if you attempt to access the data buffer.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- */
- public DataBufferFloat(float[] dataArray, int size)
- {
- super(TYPE_FLOAT, size, 1, 0);
- bankData = new float[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank, with
- * the specified offset to the first element.
- * <p>
- * Note: there is no exception when <code>dataArray</code> is
- * <code>null</code>, but in that case an exception will be thrown
- * later if you attempt to access the data buffer.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- * @param offset the offset to the first element in the array.
- */
- public DataBufferFloat(float[] dataArray, int size, int offset)
- {
- super(TYPE_FLOAT, size, 1, offset);
- bankData = new float[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferFloat(float[][] dataArray, int size)
- {
- super(TYPE_FLOAT, size, dataArray.length);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks, with
- * the specified offsets to the first element in each bank.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- * @param offsets the offsets to the first element in each data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferFloat(float[][] dataArray, int size, int[] offsets)
- {
- super(TYPE_FLOAT, size, dataArray.length, offsets);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Returns the first data bank.
- *
- * @return The first data bank.
- */
- public float[] getData()
- {
- return data;
- }
-
- /**
- * Returns a data bank.
- *
- * @param bank the bank index.
- * @return A data bank.
- */
- public float[] getData(int bank)
- {
- return bankData[bank];
- }
-
- /**
- * Returns the array underlying this <code>DataBuffer</code>.
- *
- * @return The data banks.
- */
- public float[][] getBankData()
- {
- return bankData;
- }
-
- /**
- * Returns an element from the first data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int i)
- {
- return (int) data[i+offset];
- }
-
- /**
- * Returns an element from a particular data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param bank the bank index.
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int bank, int i)
- {
- return (int) bankData[bank][i+offsets[bank]];
- }
-
- /**
- * Sets an element in the first data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int i, int val)
- {
- data[i+offset] = (float) val;
- }
-
- /**
- * Sets an element in a particular data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param bank the data bank index.
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int bank, int i, int val)
- {
- bankData[bank][i+offsets[bank]] = (float) val;
- }
-
- public float getElemFloat(int i)
- {
- return data[i+offset];
- }
-
- public float getElemFloat(int bank, int i)
- {
- return bankData[bank][i+offsets[bank]];
- }
-
- public void setElemFloat(int i, float val)
- {
- data[i+offset] = val;
- }
-
- public void setElemFloat(int bank, int i, float val)
- {
- bankData[bank][i+offsets[bank]] = val;
- }
-
- public double getElemDouble(int i)
- {
- return getElemFloat(i);
- }
-
- public double getElemDouble(int bank, int i)
- {
- return getElemFloat(bank, i);
- }
-
- public void setElemDouble(int i, double val)
- {
- setElemFloat(i, (float) val);
- }
-
- public void setElemDouble(int bank, int i, double val)
- {
- setElemFloat(bank, i, (float) val);
- }
-}
diff --git a/libjava/java/awt/image/DataBufferInt.java b/libjava/java/awt/image/DataBufferInt.java
deleted file mode 100644
index d4636caf346..00000000000
--- a/libjava/java/awt/image/DataBufferInt.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/* Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/* This is one of several classes that are nearly identical. Maybe we
- should have a central template and generate all these files. This
- is one of the cases where templates or macros would have been
- useful to have in Java.
-
- This file has been created using search-replace. My only fear is
- that these classes will grow out-of-sync as of a result of changes
- that are not propagated to the other files. As always, mirroring
- code is a maintenance nightmare. */
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public final class DataBufferInt extends DataBuffer
-{
- private int[] data;
- private int[][] bankData;
-
- /**
- * Creates a new data buffer with a single data bank containing the
- * specified number of <code>int</code> elements.
- *
- * @param size the number of elements in the data bank.
- */
- public DataBufferInt(int size)
- {
- super(TYPE_INT, size, 1, 0);
- bankData = new int[1][];
- data = new int[size];
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer with the specified number of data banks,
- * each containing the specified number of <code>int</code> elements.
- *
- * @param size the number of elements in the data bank.
- * @param numBanks the number of data banks.
- */
- public DataBufferInt(int size, int numBanks)
- {
- super(TYPE_INT, size, numBanks);
- bankData = new int[numBanks][size];
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank.
- * <p>
- * Note: there is no exception when <code>dataArray</code> is
- * <code>null</code>, but in that case an exception will be thrown
- * later if you attempt to access the data buffer.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- */
- public DataBufferInt(int[] dataArray, int size)
- {
- super(TYPE_INT, size, 1, 0);
- bankData = new int[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank, with
- * the specified offset to the first element.
- * <p>
- * Note: there is no exception when <code>dataArray</code> is
- * <code>null</code>, but in that case an exception will be thrown
- * later if you attempt to access the data buffer.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- * @param offset the offset to the first element in the array.
- */
- public DataBufferInt(int[] dataArray, int size, int offset)
- {
- super(TYPE_INT, size, 1, offset);
- bankData = new int[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferInt(int[][] dataArray, int size)
- {
- super(TYPE_INT, size, dataArray.length);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks, with
- * the specified offsets to the first element in each bank.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- * @param offsets the offsets to the first element in each data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferInt(int[][] dataArray, int size, int[] offsets)
- {
- super(TYPE_INT, size, dataArray.length, offsets);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Returns the first data bank.
- *
- * @return The first data bank.
- */
- public int[] getData()
- {
- return data;
- }
-
- /**
- * Returns a data bank.
- *
- * @param bank the bank index.
- * @return A data bank.
- */
- public int[] getData(int bank)
- {
- return bankData[bank];
- }
-
- /**
- * Returns the array underlying this <code>DataBuffer</code>.
- *
- * @return The data banks.
- */
- public int[][] getBankData()
- {
- return bankData;
- }
-
- /**
- * Returns an element from the first data bank. The <code>offset</code> is
- * added to the specified index before accessing the underlying data array.
- *
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int i)
- {
- return data[i+offset];
- }
-
- /**
- * Returns an element from a particular data bank. The <code>offset</code>
- * is added to the specified index before accessing the underlying data
- * array.
- *
- * @param bank the bank index.
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int bank, int i)
- {
- // get unsigned int as int
- return bankData[bank][i+offsets[bank]];
- }
-
- /**
- * Sets an element in the first data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int i, int val)
- {
- data[i+offset] = val;
- }
-
- /**
- * Sets an element in a particular data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param bank the data bank index.
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int bank, int i, int val)
- {
- bankData[bank][i+offsets[bank]] = val;
- }
-}
diff --git a/libjava/java/awt/image/DataBufferShort.java b/libjava/java/awt/image/DataBufferShort.java
deleted file mode 100644
index 3135dbaa721..00000000000
--- a/libjava/java/awt/image/DataBufferShort.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/* DataBufferShort.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/* This is one of several classes that are nearly identical. Maybe we
- should have a central template and generate all these files. This
- is one of the cases where templates or macros would have been
- useful to have in Java.
-
- This file has been created using search-replace. My only fear is
- that these classes will grow out-of-sync as of a result of changes
- that are not propagated to the other files. As always, mirroring
- code is a maintenance nightmare. */
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public final class DataBufferShort extends DataBuffer
-{
- private short[] data;
- private short[][] bankData;
-
- /**
- * Creates a new data buffer with a single data bank containing the
- * specified number of <code>short</code> elements.
- *
- * @param size the number of elements in the data bank.
- */
- public DataBufferShort(int size)
- {
- super(TYPE_SHORT, size, 1, 0);
- bankData = new short[1][];
- data = new short[size];
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer with the specified number of data banks,
- * each containing the specified number of <code>short</code> elements.
- *
- * @param size the number of elements in the data bank.
- * @param numBanks the number of data banks.
- */
- public DataBufferShort(int size, int numBanks)
- {
- super(TYPE_SHORT, size, numBanks);
- bankData = new short[numBanks][size];
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank.
- * <p>
- * Note: there is no exception when <code>dataArray</code> is
- * <code>null</code>, but in that case an exception will be thrown
- * later if you attempt to access the data buffer.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- */
- public DataBufferShort(short[] dataArray, int size)
- {
- super(TYPE_SHORT, size, 1, 0);
- bankData = new short[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank, with
- * the specified offset to the first element.
- * <p>
- * Note: there is no exception when <code>dataArray</code> is
- * <code>null</code>, but in that case an exception will be thrown
- * later if you attempt to access the data buffer.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- * @param offset the offset to the first element in the array.
- */
- public DataBufferShort(short[] dataArray, int size, int offset)
- {
- super(TYPE_SHORT, size, 1, offset);
- bankData = new short[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferShort(short[][] dataArray, int size)
- {
- super(TYPE_SHORT, size, dataArray.length);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks, with
- * the specified offsets to the first element in each bank.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- * @param offsets the offsets to the first element in each data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferShort(short[][] dataArray, int size, int[] offsets)
- {
- super(TYPE_SHORT, size, dataArray.length, offsets);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Returns the first data bank.
- *
- * @return The first data bank.
- */
- public short[] getData()
- {
- return data;
- }
-
- /**
- * Returns a data bank.
- *
- * @param bank the bank index.
- * @return A data bank.
- */
- public short[] getData(int bank)
- {
- return bankData[bank];
- }
-
- /**
- * Returns the array underlying this <code>DataBuffer</code>.
- *
- * @return The data banks.
- */
- public short[][] getBankData()
- {
- return bankData;
- }
-
- /**
- * Returns an element from the first data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int i)
- {
- return data[i+offset];
- }
-
- /**
- * Returns an element from a particular data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param bank the bank index.
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int bank, int i)
- {
- return bankData[bank][i+offsets[bank]];
- }
-
- /**
- * Sets an element in the first data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int i, int val)
- {
- data[i+offset] = (short) val;
- }
-
- /**
- * Sets an element in a particular data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param bank the data bank index.
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int bank, int i, int val)
- {
- bankData[bank][i+offsets[bank]] = (short) val;
- }
-}
diff --git a/libjava/java/awt/image/DataBufferUShort.java b/libjava/java/awt/image/DataBufferUShort.java
deleted file mode 100644
index d42dadf86a7..00000000000
--- a/libjava/java/awt/image/DataBufferUShort.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/* DataBufferUShort.java --
- Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/* This is one of several classes that are nearly identical. Maybe we
- should have a central template and generate all these files. This
- is one of the cases where templates or macros would have been
- useful to have in Java.
-
- This file has been created using search-replace. My only fear is
- that these classes will grow out-of-sync as of a result of changes
- that are not propagated to the other files. As always, mirroring
- code is a maintenance nightmare. */
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public final class DataBufferUShort extends DataBuffer
-{
- private short[] data;
- private short[][] bankData;
-
- /**
- * Creates a new data buffer with a single data bank containing the
- * specified number of <code>short</code> elements.
- *
- * @param size the number of elements in the data bank.
- */
- public DataBufferUShort(int size)
- {
- super(TYPE_USHORT, size, 1, 0);
- bankData = new short[1][];
- data = new short[size];
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer with the specified number of data banks,
- * each containing the specified number of <code>short</code> elements.
- *
- * @param size the number of elements in the data bank.
- * @param numBanks the number of data banks.
- */
- public DataBufferUShort(int size, int numBanks)
- {
- super(TYPE_USHORT, size, numBanks);
- bankData = new short[numBanks][size];
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- *
- * @throws NullPointerException if dataArray is null
- */
- public DataBufferUShort(short[] dataArray, int size)
- {
- super(TYPE_USHORT, size, 1, 0);
- if (dataArray == null)
- throw new NullPointerException();
- bankData = new short[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data bank, with
- * the specified offset to the first element.
- *
- * @param dataArray the data bank.
- * @param size the number of elements in the data bank.
- * @param offset the offset to the first element in the array.
- *
- * @throws NullPointerException if dataArray is null
- */
- public DataBufferUShort(short[] dataArray, int size, int offset)
- {
- super(TYPE_USHORT, size, 1, offset);
- if (dataArray == null)
- throw new NullPointerException();
- bankData = new short[1][];
- data = dataArray;
- bankData[0] = data;
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferUShort(short[][] dataArray, int size)
- {
- super(TYPE_USHORT, size, dataArray.length);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Creates a new data buffer backed by the specified data banks, with
- * the specified offsets to the first element in each bank.
- *
- * @param dataArray the data banks.
- * @param size the number of elements in the data bank.
- * @param offsets the offsets to the first element in each data bank.
- *
- * @throws NullPointerException if <code>dataArray</code> is
- * <code>null</code>.
- */
- public DataBufferUShort(short[][] dataArray, int size, int[] offsets)
- {
- super(TYPE_USHORT, size, dataArray.length, offsets);
- bankData = dataArray;
- data = bankData[0];
- }
-
- /**
- * Returns the first data bank.
- *
- * @return The first data bank.
- */
- public short[] getData()
- {
- return data;
- }
-
- /**
- * Returns a data bank.
- *
- * @param bank the bank index.
- * @return A data bank.
- */
- public short[] getData(int bank)
- {
- return bankData[bank];
- }
-
- /**
- * Returns the array underlying this <code>DataBuffer</code>.
- *
- * @return The data banks.
- */
- public short[][] getBankData()
- {
- return bankData;
- }
-
- /**
- * Returns an element from the first data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int i)
- {
- return data[i+offset] & 0xffff; // get unsigned short as int
- }
-
- /**
- * Returns an element from a particular data bank. The offset (specified in
- * the constructor) is added to <code>i</code> before accessing the
- * underlying data array.
- *
- * @param bank the bank index.
- * @param i the element index.
- * @return The element.
- */
- public int getElem(int bank, int i)
- {
- // get unsigned short as int
- return bankData[bank][i+offsets[bank]] & 0xffff;
- }
-
- /**
- * Sets an element in the first data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int i, int val)
- {
- data[i+offset] = (short) val;
- }
-
- /**
- * Sets an element in a particular data bank. The offset (specified in the
- * constructor) is added to <code>i</code> before updating the underlying
- * data array.
- *
- * @param bank the data bank index.
- * @param i the element index.
- * @param val the new element value.
- */
- public void setElem(int bank, int i, int val)
- {
- bankData[bank][i+offsets[bank]] = (short) val;
- }
-}
diff --git a/libjava/java/awt/image/DirectColorModel.java b/libjava/java/awt/image/DirectColorModel.java
deleted file mode 100644
index cd391da77ec..00000000000
--- a/libjava/java/awt/image/DirectColorModel.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/* DirectColorModel.java --
- Copyright (C) 1999, 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import gnu.java.awt.Buffers;
-
-import java.awt.Point;
-import java.awt.Transparency;
-import java.awt.color.ColorSpace;
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- * @author C. Brian Jones (cbj@gnu.org)
- * @author Mark Benvenuto (mcb54@columbia.edu)
- */
-public class DirectColorModel extends PackedColorModel
-{
- /**
- * For the color model created with this constructor the pixels
- * will have fully opaque alpha components with a value of 255.
- * Each mask should describe a fully contiguous set of bits in the
- * most likely order of alpha, red, green, blue from the most significant
- * byte to the least significant byte.
- *
- * @param pixelBits the number of bits wide used for bit size of pixel values
- * @param rmask the bits describing the red component of a pixel
- * @param gmask the bits describing the green component of a pixel
- * @param bmask the bits describing the blue component of a pixel
- */
- public DirectColorModel(int pixelBits, int rmask, int gmask, int bmask)
- {
- this(ColorSpace.getInstance(ColorSpace.CS_sRGB), pixelBits,
- rmask, gmask, bmask, 0,
- false, // not alpha premultiplied
- Buffers.smallestAppropriateTransferType(pixelBits) // find type
- );
- }
-
- /**
- * For the color model created with this constructor the pixels
- * will have fully opaque alpha components with a value of 255.
- * Each mask should describe a fully contiguous set of bits in the
- * most likely order of red, green, blue from the most significant
- * byte to the least significant byte.
- *
- * @param pixelBits the number of bits wide used for bit size of pixel values
- * @param rmask the bits describing the red component of a pixel
- * @param gmask the bits describing the green component of a pixel
- * @param bmask the bits describing the blue component of a pixel
- * @param amask the bits describing the alpha component of a pixel
- */
- public DirectColorModel(int pixelBits,
- int rmask, int gmask, int bmask, int amask)
- {
- this(ColorSpace.getInstance(ColorSpace.CS_sRGB), pixelBits,
- rmask, gmask, bmask, amask,
- false, // not alpha premultiplied
- Buffers.smallestAppropriateTransferType(pixelBits) // find type
- );
- }
-
- public DirectColorModel(ColorSpace cspace, int pixelBits,
- int rmask, int gmask, int bmask, int amask,
- boolean isAlphaPremultiplied,
- int transferType)
- {
- super(cspace, pixelBits,
- rmask, gmask, bmask, amask, isAlphaPremultiplied,
- ((amask == 0) ? Transparency.OPAQUE : Transparency.TRANSLUCENT),
- transferType);
- }
-
- public final int getRedMask()
- {
- return getMask(0);
- }
-
- public final int getGreenMask()
- {
- return getMask(1);
- }
-
- public final int getBlueMask()
- {
- return getMask(2);
- }
-
- public final int getAlphaMask()
- {
- return hasAlpha() ? getMask(3) : 0;
- }
-
- /**
- * Get the red component of the given pixel.
- * <br>
- */
- public final int getRed(int pixel)
- {
- return extractAndNormalizeSample(pixel, 0);
- }
-
- /**
- * Get the green component of the given pixel.
- * <br>
- */
- public final int getGreen(int pixel)
- {
- return extractAndNormalizeSample(pixel, 1);
- }
-
- /**
- * Get the blue component of the given pixel.
- * <br>
- */
- public final int getBlue(int pixel)
- {
- return extractAndNormalizeSample(pixel, 2);
- }
-
- /**
- * Get the alpha component of the given pixel.
- * <br>
- */
- public final int getAlpha(int pixel)
- {
- if (!hasAlpha())
- return 0;
- return extractAndScaleSample(pixel, 3);
- }
-
- private int extractAndNormalizeSample(int pixel, int component)
- {
- int value = extractAndScaleSample(pixel, component);
- if (hasAlpha() && isAlphaPremultiplied())
- value = value*255/getAlpha(pixel);
- return value;
- }
-
- private int extractAndScaleSample(int pixel, int component)
- {
- int field = pixel & getMask(component);
- int to8BitShift =
- 8 - shifts[component] - getComponentSize(component);
- return (to8BitShift>0) ?
- (field << to8BitShift) :
- (field >>> (-to8BitShift));
- }
-
- /**
- * Get the RGB color value of the given pixel using the default
- * RGB color model.
- * <br>
- *
- * @param pixel a pixel value
- */
- public final int getRGB(int pixel)
- {
- /* FIXME: The Sun docs show that this method is overridden, but I
- don't see any way to improve on the superclass
- implementation. */
- return super.getRGB(pixel);
- }
-
- public int getRed(Object inData)
- {
- return getRed(getPixelFromArray(inData));
- }
-
- public int getGreen(Object inData)
- {
- return getGreen(getPixelFromArray(inData));
- }
-
- public int getBlue(Object inData)
- {
- return getBlue(getPixelFromArray(inData));
- }
-
- public int getAlpha(Object inData)
- {
- return getAlpha(getPixelFromArray(inData));
- }
-
- public int getRGB(Object inData)
- {
- return getRGB(getPixelFromArray(inData));
- }
-
- /**
- * Converts a normalized pixel int value in the sRGB color
- * space to an array containing a single pixel of the color space
- * of the color model.
- *
- * <p>This method performs the inverse function of
- * <code>getRGB(Object inData)</code>.
- *
- * @param rgb pixel as a normalized sRGB, 0xAARRGGBB value.
- *
- * @param pixel to avoid needless creation of arrays, an array to
- * use to return the pixel can be given. If null, a suitable array
- * will be created.
- *
- * @return array of transferType containing a single pixel. The
- * pixel should be encoded in the natural way of the color model.
- *
- * @see #getRGB(Object)
- */
- public Object getDataElements(int rgb, Object pixel)
- {
- // FIXME: handle alpha multiply
-
- int pixelValue = 0;
- int a = 0;
- if (hasAlpha()) {
- a = (rgb >>> 24) & 0xff;
- pixelValue = valueToField(a, 3, 8);
- }
-
- if (hasAlpha() && isAlphaPremultiplied())
- {
- int r, g, b;
- /* if r=0xff and a=0xff, then resulting
- value will be (r*a)>>>8 == 0xfe... This seems wrong.
- We should divide by 255 rather than shifting >>>8 after
- multiplying.
-
- Too bad, shifting is probably less expensive.
- r = ((rgb >>> 16) & 0xff)*a;
- g = ((rgb >>> 8) & 0xff)*a;
- b = ((rgb >>> 0) & 0xff)*a; */
- /* The r, g, b values we calculate are 16 bit. This allows
- us to avoid discarding the lower 8 bits obtained if
- multiplying with the alpha band. */
-
- // using 16 bit values
- r = ((rgb >>> 8) & 0xff00)*a/255;
- g = ((rgb >>> 0) & 0xff00)*a/255;
- b = ((rgb << 8) & 0xff00)*a/255;
- pixelValue |=
- valueToField(r, 0, 16) | // Red
- valueToField(g, 1, 16) | // Green
- valueToField(b, 2, 16); // Blue
- }
- else
- {
- int r, g, b;
- // using 8 bit values
- r = (rgb >>> 16) & 0xff;
- g = (rgb >>> 8) & 0xff;
- b = (rgb >>> 0) & 0xff;
-
- pixelValue |=
- valueToField(r, 0, 8) | // Red
- valueToField(g, 1, 8) | // Green
- valueToField(b, 2, 8); // Blue
- }
-
- /* In this color model, the whole pixel fits in the first element
- of the array. */
- DataBuffer buffer = Buffers.createBuffer(transferType, pixel, 1);
- buffer.setElem(0, pixelValue);
- return Buffers.getData(buffer);
- }
-
- /**
- * Converts a value to the correct field bits based on the
- * information derived from the field masks.
- *
- * @param highBit the position of the most significant bit in the
- * val parameter.
- */
- private int valueToField(int val, int component, int highBit)
- {
- int toFieldShift =
- getComponentSize(component) + shifts[component] - highBit;
- int ret = (toFieldShift>0) ?
- (val << toFieldShift) :
- (val >>> (-toFieldShift));
- return ret & getMask(component);
- }
-
- /**
- * Converts a 16 bit value to the correct field bits based on the
- * information derived from the field masks.
- */
- private int value16ToField(int val, int component)
- {
- int toFieldShift = getComponentSize(component) + shifts[component] - 16;
- return (toFieldShift>0) ?
- (val << toFieldShift) :
- (val >>> (-toFieldShift));
- }
-
- /**
- * Fills an array with the unnormalized component samples from a
- * pixel value. I.e. decompose the pixel, but not perform any
- * color conversion.
- */
- public final int[] getComponents(int pixel, int[] components, int offset)
- {
- int numComponents = getNumComponents();
- if (components == null) components = new int[offset + numComponents];
-
- for (int b=0; b<numComponents; b++)
- components[offset++] = (pixel&getMask(b)) >>> shifts[b];
-
- return components;
- }
-
- public final int[] getComponents(Object pixel, int[] components,
- int offset)
- {
- return getComponents(getPixelFromArray(pixel), components, offset);
- }
-
- public final WritableRaster createCompatibleWritableRaster(int w, int h)
- {
- SampleModel sm = createCompatibleSampleModel(w, h);
- Point origin = new Point(0, 0);
- return Raster.createWritableRaster(sm, origin);
- }
-
- public int getDataElement(int[] components, int offset)
- {
- int numComponents = getNumComponents();
- int pixelValue = 0;
-
- for (int c=0; c<numComponents; c++)
- pixelValue |= (components[offset++] << shifts[c]) & getMask(c);
-
- return pixelValue;
- }
-
- public Object getDataElements(int[] components, int offset, Object obj)
- {
- /* In this color model, the whole pixel fits in the first element
- of the array. */
- int pixelValue = getDataElement(components, offset);
-
- DataBuffer buffer = Buffers.createBuffer(transferType, obj, 1);
- buffer.setElem(0, pixelValue);
- return Buffers.getData(buffer);
- }
-
- public final ColorModel coerceData (WritableRaster raster,
- boolean isAlphaPremultiplied)
- {
- if (this.isAlphaPremultiplied == isAlphaPremultiplied)
- return this;
-
- /* TODO: provide better implementation based on the
- assumptions we can make due to the specific type of the
- color model. */
- super.coerceData(raster, isAlphaPremultiplied);
-
- return new ComponentColorModel(cspace, bits, hasAlpha(),
- isAlphaPremultiplied, // argument
- transparency, transferType);
- }
-
- public boolean isCompatibleRaster(Raster raster)
- {
- /* FIXME: the Sun docs say this method is overridden here,
- but I don't see any way to improve upon the implementation
- in ColorModel. */
- return super.isCompatibleRaster(raster);
- }
-
- String stringParam()
- {
- return super.stringParam() +
- ", redMask=" + Integer.toHexString(getRedMask()) +
- ", greenMask=" + Integer.toHexString(getGreenMask()) +
- ", blueMask=" + Integer.toHexString(getBlueMask()) +
- ", alphaMask=" + Integer.toHexString(getAlphaMask());
- }
-
- public String toString()
- {
- /* FIXME: Again, docs say override, but how do we improve upon the
- superclass implementation? */
- return super.toString();
- }
-}
diff --git a/libjava/java/awt/image/FilteredImageSource.java b/libjava/java/awt/image/FilteredImageSource.java
deleted file mode 100644
index 8893e86a625..00000000000
--- a/libjava/java/awt/image/FilteredImageSource.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/* FilteredImageSource.java -- Java class for providing image data
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.util.Hashtable;
-
-/**
- *
- * @see ImageConsumer
- * @author C. Brian Jones (cbj@gnu.org)
- */
-public class FilteredImageSource implements ImageProducer
-{
- ImageProducer ip;
- ImageFilter filter;
- Hashtable consumers = new Hashtable();
-
- /**
- * The given filter is applied to the given image producer
- * to create a new image producer.
- */
- public FilteredImageSource(ImageProducer ip, ImageFilter filter) {
- this.ip = ip;
- this.filter = filter;
- }
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code>.
- */
- public synchronized void addConsumer(ImageConsumer ic) {
- if (consumers.containsKey(ic))
- return;
-
- ImageFilter f = filter.getFilterInstance(ic);
- consumers.put(ic, f);
- ip.addConsumer(f);
- }
-
- /**
- * Used to determine if the given <code>ImageConsumer</code> is
- * already registered with this <code>ImageProducer</code>.
- */
- public synchronized boolean isConsumer(ImageConsumer ic) {
- ImageFilter f = (ImageFilter)consumers.get(ic);
- if (f != null)
- return ip.isConsumer(f);
- return false;
- }
-
- /**
- * Used to remove an <code>ImageConsumer</code> from the list of
- * registered consumers for this <code>ImageProducer</code>.
- */
- public synchronized void removeConsumer(ImageConsumer ic) {
- ImageFilter f = (ImageFilter)consumers.remove(ic);
- if (f != null)
- ip.removeConsumer(f);
- }
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code> and then immediately start
- * reconstruction of the image data to be delivered to all
- * registered consumers.
- */
- public void startProduction(ImageConsumer ic) {
- ImageFilter f;
- if (!(consumers.containsKey(ic))) {
- f = filter.getFilterInstance(ic);
- consumers.put(ic, f);
- ip.addConsumer(f);
- } else {
- f = (ImageFilter)consumers.get( ic );
- }
- ip.startProduction(f);
- }
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code> and then request that this producer
- * resend the image data in the order top-down, left-right.
- */
- public void requestTopDownLeftRightResend(ImageConsumer ic) {
- ImageFilter f = (ImageFilter)consumers.get(ic);
- ip.requestTopDownLeftRightResend(f);
- }
-}
-
diff --git a/libjava/java/awt/image/ImageConsumer.java b/libjava/java/awt/image/ImageConsumer.java
deleted file mode 100644
index e1834c3978f..00000000000
--- a/libjava/java/awt/image/ImageConsumer.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/* ImageConsumer.java -- Java interface for image consumption
- Copyright (C) 1999, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.util.Hashtable;
-
-/**
- * An object implementing the <code>ImageProducer</code> interface can
- * use objects implementing this interface to deliver the image data.
- *
- * @author C. Brian Jones (cbj@gnu.org)
- */
-public interface ImageConsumer
-{
- /**
- * The pixel order may be random. This should be
- * the default assumption of the <code>ImageConsumer</code>.
- *
- * @see #setHints
- */
- int RANDOMPIXELORDER = 1;
-
- /**
- * The pixel order is top-down, left-right.
- *
- * @see #setHints
- */
- int TOPDOWNLEFTRIGHT = 2;
-
- /**
- * The pixel order is in multiples of complete scanlines.
- *
- * @see #setHints
- */
- int COMPLETESCANLINES = 4;
-
- /**
- * The pixels will be delivered in a single pass. There is at
- * most one call to <code>setPixels</code> for any single pixel.
- *
- * @see #setHints
- * @see #setPixels
- */
- int SINGLEPASS = 8;
-
- /**
- * The pixels will be delivered with multiple calls to
- * <code>setPixels</code>. The image contains a single frame
- * which ends when <code>imageComplete</code> is called with the
- * <code>STATICIMAGEDONE</code> flag. If the image is constantly
- * changing such as with video then the end of each frame is
- * marked by a similar call to <code>imageComplete</code> with the
- * <code>SINGLEFRAMEDONE</code> flag.
- *
- * @see #setHints
- * @see #imageComplete
- */
- int SINGLEFRAME = 16;
-
- /**
- * Indicates an error occurred while producing an image.
- *
- * @see #imageComplete
- */
- int IMAGEERROR = 1;
-
- /**
- * A single frame is complete but more will follow.
- *
- * @see #imageComplete
- */
- int SINGLEFRAMEDONE = 2;
-
- /**
- * The image is complete and no more pixels or frames will follow.
- *
- * @see #imageComplete
- */
- int STATICIMAGEDONE = 3;
-
- /**
- * Production of the image has been aborted.
- *
- * @see #imageComplete
- */
- int IMAGEABORTED = 4;
-
- /**
- * An <code>ImageProducer</code> indicates the size of the image
- * being produced using this method.
- *
- * @param width the width of the image
- * @param height the height of the image
- */
- void setDimensions(int width, int height);
-
- /**
- * An <code>ImageProducer</code> can set a list of properties
- * associated with this image by using this method.
- *
- * @param props the list of properties associated with this image
- */
- void setProperties(Hashtable props);
-
- /**
- * This <code>ColorModel</code> should indicate the model used by
- * the majority of calls to <code>setPixels</code>. Each call to
- * <code>setPixels</code> could however indicate a different
- * <code>ColorModel</code>.
- *
- * @param model the color model to be used most often by setPixels
- * @see ColorModel
- */
- void setColorModel(ColorModel model);
-
- /**
- * The <code>ImageProducer</code> should call this method with a
- * bit mask of hints from any of <code>RANDOMPIXELORDER</code>,
- * <code>TOPDOWNLEFTRIGHT</code>, <code>COMPLETESCANLINES</code>,
- * <code>SINGLEPASS</code>, <code>SINGLEFRAME</code>.
- *
- * @param flags a bit mask of hints
- */
- void setHints(int flags);
-
- /**
- * Deliver a subset of an ImageProducer's pixels to this ImageConsumer.
- *
- * Each element of the pixels array represents one pixel. The
- * pixel data is formatted according to the color model model.
- * The x and y parameters are the coordinates of the block of
- * pixels being delivered to this ImageConsumer. They are
- * specified relative to the top left corner of the image being
- * produced. Likewise, w and h are the pixel block's dimensions.
- *
- * @param x x coordinate of pixel block
- * @param y y coordinate of pixel block
- * @param w width of pixel block
- * @param h height of pixel block
- * @param model color model used to interpret pixel data
- * @param pixels pixel block data
- * @param offset offset into pixels array
- * @param scansize width of one row in the pixel block
- */
- void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels, int offset, int scansize);
-
- /**
- * Deliver a subset of an ImageProducer's pixels to this ImageConsumer.
- *
- * Each element of the pixels array represents one pixel. The
- * pixel data is formatted according to the color model model.
- * The x and y parameters are the coordinates of the rectangular
- * region of pixels being delivered to this ImageConsumer,
- * specified relative to the top left corner of the image being
- * produced. Likewise, w and h are the pixel region's dimensions.
- *
- * @param x x coordinate of pixel block
- * @param y y coordinate of pixel block
- * @param w width of pixel block
- * @param h height of pixel block
- * @param model color model used to interpret pixel data
- * @param pixels pixel block data
- * @param offset offset into pixels array
- * @param scansize width of one row in the pixel block
- */
- void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels, int offset, int scansize);
-
- /**
- * The <code>ImageProducer</code> calls this method to indicate a
- * single frame or the entire image is complete. The method is
- * also used to indicate an error in loading or producing the
- * image.
- *
- * @param status the status of image production, represented by a
- * bitwise OR of ImageConsumer flags
- */
- void imageComplete(int status);
-}
diff --git a/libjava/java/awt/image/ImageFilter.java b/libjava/java/awt/image/ImageFilter.java
deleted file mode 100644
index 9940a2b1b91..00000000000
--- a/libjava/java/awt/image/ImageFilter.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/* ImageFilter.java -- Java class for filtering images
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.util.Hashtable;
-
-/**
- * The <code>ImageFilter</code> class is a base class which can be
- * extended to provide different types of filters for an image. By
- * default this class does nothing to an image passing through it.
- *
- * @author C. Brian Jones (cbj@gnu.org)
- */
-public class ImageFilter implements ImageConsumer, Cloneable
-{
- /**
- * The consumer this filter is filtering an image data stream for.
- * It is initialized in the method <code>getFilterInstance</code>.
- */
- protected ImageConsumer consumer = null;
-
- /**
- * The <code>ImageConsumer</code> can use this method to request
- * the pixels be delivered in top-down, left-right order.
- * <br>
- * The filter can respond in three different ways.
- * <ul>
- * <li>The default behavior is to forward the request to the
- * <code>ImageProducer</code>
- * using the method <code>requestTopDownLeftRightResend</code>
- * and using the filter as the consumer.</li>
- * <li>The filter has the pixels and can retransmit them in the
- * top-down, left-right order.</li>
- * <li>The filter can do nothing when this method is called.</li>
- * </ul>
- */
- public void resendTopDownLeftRight(ImageProducer ip)
- {
- ip.requestTopDownLeftRightResend(this);
- }
-
- /**
- * By default, returns a shallow copy of the object created by
- * <code>Object.clone()</code>
- *
- * @see java.lang.Object#clone ()
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- // This should never happen as this class implements the
- // Cloneable interface.
- throw new InternalError ();
- }
- }
-
- /**
- * This is the only method which can set the
- * <code>ImageConsumer</code> for this filter. By default a clone
- * of this filter with the appropriate consumer set is returned.
- *
- * @see #clone ()
- */
- public ImageFilter getFilterInstance(ImageConsumer ic)
- {
- if ( ic == null )
- throw new IllegalArgumentException("null argument for ImageFilter.getFilterInstance(ImageConsumer)");
-
- consumer = ic;
- ImageFilter f = (ImageFilter)clone();
- consumer = null;
- return f;
- }
-
- /**
- * An <code>ImageProducer</code> indicates the size of the image
- * being produced using this method. A filter can override this
- * method to intercept these calls from the producer in order to
- * change either the width or the height before in turn calling
- * the consumer's <code>setDimensions</code> method.
- *
- * @param width the width of the image
- * @param height the height of the image
- */
- public void setDimensions(int width, int height)
- {
- consumer.setDimensions(width, height);
- }
-
- /**
- * An <code>ImageProducer</code> can set a list of properties
- * associated with this image by using this method.
- *
- * @param props the list of properties associated with this image
- */
- public void setProperties(Hashtable props)
- {
- props.put("filters", "ImageFilter");
- consumer.setProperties(props);
- }
-
- /**
- * Override this method to process calls to this method from the
- * <code>ImageProducer</code>. By default the <code>setColorModel</code>
- * method of the consumer is called with the specified <code>model</code>.
- *
- * @param model the color model to be used most often by setPixels
- * @see ColorModel */
- public void setColorModel(ColorModel model)
- {
- consumer.setColorModel(model);
- }
-
- /**
- * The <code>ImageProducer</code> should call this method with a
- * bit mask of hints from any of <code>RANDOMPIXELORDER</code>,
- * <code>TOPDOWNLEFTRIGHT</code>, <code>COMPLETESCANLINES</code>,
- * <code>SINGLEPASS</code>, <code>SINGLEFRAME</code> from the
- * <code>ImageConsumer</code> interface.
- *
- * @param flags a bit mask of hints
- * @see ImageConsumer
- */
- public void setHints(int flags)
- {
- consumer.setHints(flags);
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as a <code>byte</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels, int offset, int scansize)
- {
- consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as an <code>int</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels, int offset, int scansize)
- {
- consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
- }
-
- /**
- * The <code>ImageProducer</code> calls this method to indicate a
- * single frame or the entire image is complete. The method is
- * also used to indicate an error in loading or producing the
- * image.
- */
- public void imageComplete(int status)
- {
- consumer.imageComplete(status);
- }
-}
-
diff --git a/libjava/java/awt/image/ImageObserver.java b/libjava/java/awt/image/ImageObserver.java
deleted file mode 100644
index 36dd013f4e9..00000000000
--- a/libjava/java/awt/image/ImageObserver.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/* ImageObserver.java -- Java interface for asynchronous updates to an image
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Image;
-
-/**
- * An object implementing the <code>ImageObserver</code> interface can
- * receive updates on image construction from an
- * <code>ImageProducer</code> asynchronously.
- *
- * @see ImageProducer
- * @author C. Brian Jones (cbj@gnu.org)
- */
-public interface ImageObserver
-{
- /**
- * The width of the image has been provided as the
- * <code>width</code> argument to <code>imageUpdate</code>.
- *
- * @see #imageUpdate
- */
- int WIDTH = 1;
-
- /**
- * The height of the image has been provided as the
- * <code>height</code> argument to <code>imageUpdate</code>.
- *
- * @see #imageUpdate
- */
- int HEIGHT = 2;
-
- /**
- * The properties of the image have been provided.
- *
- * @see #imageUpdate
- * @see java.awt.Image#getProperty (java.lang.String, java.awt.image.ImageObserver)
- */
- int PROPERTIES = 4;
-
- /**
- * More pixels are now available for drawing a scaled variation of
- * the image.
- *
- * @see #imageUpdate
- */
- int SOMEBITS = 8;
-
- /**
- * All the pixels needed to draw a complete frame of a multi-frame
- * image are available.
- *
- * @see #imageUpdate
- */
- int FRAMEBITS = 16;
-
- /**
- * An image with a single frame, a static image, is complete.
- *
- * @see #imageUpdate
- */
- int ALLBITS = 32;
-
- /**
- * An error was encountered while producing the image.
- *
- * @see #imageUpdate
- */
- int ERROR = 64;
-
- /**
- * Production of the image was aborted.
- *
- * @see #imageUpdate
- */
- int ABORT = 128;
-
- /**
- * This is a callback method for an asynchronous image producer to
- * provide updates on the production of the image as it happens.
- *
- * @param image the image the update refers to
- * @param flags a bit mask indicating what is provided with this update
- * @param x the x coordinate of the image
- * @param y the y coordinate of the image
- * @param width the width of the image
- * @param height the height of the image
- *
- * @see java.awt.Image
- */
- boolean imageUpdate(Image image, int flags, int x,
- int y, int width, int height);
-}
diff --git a/libjava/java/awt/image/ImageProducer.java b/libjava/java/awt/image/ImageProducer.java
deleted file mode 100644
index 49846685a3e..00000000000
--- a/libjava/java/awt/image/ImageProducer.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ImageProducer.java -- Java interface for image production
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * An object implementing the <code>ImageProducer</code> interface can
- * produce data for images. Each image has a corresponding
- * <code>ImageProducer</code> which is needed for things such as
- * resizing the image.
- *
- * @see ImageConsumer
- * @author C. Brian Jones (cbj@gnu.org)
- */
-public interface ImageProducer
-{
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code>.
- */
- void addConsumer(ImageConsumer ic);
-
- /**
- * Used to determine if the given <code>ImageConsumer</code> is
- * already registered with this <code>ImageProducer</code>.
- */
- boolean isConsumer(ImageConsumer ic);
-
- /**
- * Used to remove an <code>ImageConsumer</code> from the list of
- * registered consumers for this <code>ImageProducer</code>.
- */
- void removeConsumer(ImageConsumer ic);
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code> and then immediately start
- * reconstruction of the image data to be delivered to all
- * registered consumers.
- */
- void startProduction(ImageConsumer ic);
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code> and then request that this producer
- * resend the image data in the order top-down, left-right.
- */
- void requestTopDownLeftRightResend(ImageConsumer ic);
-}
-
diff --git a/libjava/java/awt/image/ImagingOpException.java b/libjava/java/awt/image/ImagingOpException.java
deleted file mode 100644
index ca40e9ed365..00000000000
--- a/libjava/java/awt/image/ImagingOpException.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* ImagingOpException.java -- indicates an imaging filter failure
- Copyright (C) 2002, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * This exception is thrown when <code>BufferedImageOp</code> or
- * <code>RasterOp</code> filters cannot process an image.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see BufferedImageOp
- * @see RasterOp
- * @status updated to 1.4
- */
-public class ImagingOpException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 8026288481846276658L;
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public ImagingOpException(String message)
- {
- super(message);
- }
-} // class ImagingOpException
diff --git a/libjava/java/awt/image/IndexColorModel.java b/libjava/java/awt/image/IndexColorModel.java
deleted file mode 100644
index 6783f733e0a..00000000000
--- a/libjava/java/awt/image/IndexColorModel.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/* IndexColorModel.java -- Java class for interpreting Pixel objects
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.color.ColorSpace;
-import java.math.BigInteger;
-
-/**
- * Color model similar to pseudo visual in X11.
- *
- * This color model maps linear pixel values to actual RGB and alpha colors.
- * Thus, pixel values are indexes into the color map. Each color component is
- * an 8-bit unsigned value.
- *
- * The IndexColorModel supports a map of valid pixels, allowing the
- * representation of holes in the the color map. The valid map is represented
- * as a BigInteger where each bit indicates the validity of the map entry with
- * the same index.
- *
- * Colors can have alpha components for transparency support. If alpha
- * component values aren't given, color values are opaque. The model also
- * supports a reserved pixel value to represent completely transparent colors,
- * no matter what the actual color component values are.
- *
- * IndexColorModel supports anywhere from 1 to 16 bit index values. The
- * allowed transfer types are DataBuffer.TYPE_BYTE and DataBuffer.TYPE_USHORT.
- *
- * @author C. Brian Jones (cbj@gnu.org)
- */
-public class IndexColorModel extends ColorModel
-{
- private int map_size;
- private boolean opaque;
- private int trans = -1;
- private int[] rgb;
- private BigInteger validBits = BigInteger.ZERO;
-
- /**
- * Each array much contain <code>size</code> elements. For each
- * array, the i-th color is described by reds[i], greens[i],
- * blues[i], alphas[i], unless alphas is not specified, then all the
- * colors are opaque except for the transparent color.
- *
- * @param bits the number of bits needed to represent <code>size</code> colors
- * @param size the number of colors in the color map
- * @param reds the red component of all colors
- * @param greens the green component of all colors
- * @param blues the blue component of all colors
- */
- public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
- byte[] blues)
- {
- this (bits, size, reds, greens, blues, (byte[]) null);
- }
-
- /**
- * Each array much contain <code>size</code> elements. For each
- * array, the i-th color is described by reds[i], greens[i],
- * blues[i], alphas[i], unless alphas is not specified, then all the
- * colors are opaque except for the transparent color.
- *
- * @param bits the number of bits needed to represent <code>size</code> colors
- * @param size the number of colors in the color map
- * @param reds the red component of all colors
- * @param greens the green component of all colors
- * @param blues the blue component of all colors
- * @param trans the index of the transparent color
- */
- public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
- byte[] blues, int trans)
- {
- this (bits, size, reds, greens, blues, (byte[]) null);
- this.trans = trans;
- }
-
- /**
- * Each array much contain <code>size</code> elements. For each
- * array, the i-th color is described by reds[i], greens[i],
- * blues[i], alphas[i], unless alphas is not specified, then all the
- * colors are opaque except for the transparent color.
- *
- * @param bits the number of bits needed to represent <code>size</code> colors
- * @param size the number of colors in the color map
- * @param reds the red component of all colors
- * @param greens the green component of all colors
- * @param blues the blue component of all colors
- * @param alphas the alpha component of all colors
- */
- public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
- byte[] blues, byte[] alphas)
- {
- // FIXME: This super() constructor should not be used since it can give
- // the wrong value for hasAlpha() which is final and cannot be overloaded
- super(bits);
- map_size = size;
- opaque = (alphas == null);
-
- rgb = new int[size];
- if (alphas == null)
- {
- for (int i = 0; i < size; i++)
- {
- rgb[i] = (0xff000000
- | ((reds[i] & 0xff) << 16)
- | ((greens[i] & 0xff) << 8)
- | (blues[i] & 0xff));
- }
- }
- else
- {
- for (int i = 0; i < size; i++)
- {
- rgb[i] = ((alphas[i] & 0xff) << 24
- | ((reds[i] & 0xff) << 16)
- | ((greens[i] & 0xff) << 8)
- | (blues[i] & 0xff));
- }
- }
-
- // Generate a bigint with 1's for every pixel
- validBits = validBits.setBit(size).subtract(BigInteger.ONE);
- }
-
- /**
- * Each array much contain <code>size</code> elements. For each
- * array, the i-th color is described by reds[i], greens[i],
- * blues[i], alphas[i], unless alphas is not specified, then all the
- * colors are opaque except for the transparent color.
- *
- * @param bits the number of bits needed to represent <code>size</code> colors
- * @param size the number of colors in the color map
- * @param cmap packed color components
- * @param start the offset of the first color component in <code>cmap</code>
- * @param hasAlpha <code>cmap</code> has alpha values
- * @throws IllegalArgumentException if bits < 1, bits > 16, or size < 1.
- */
- public IndexColorModel (int bits, int size, byte[] cmap, int start,
- boolean hasAlpha)
- {
- this (bits, size, cmap, start, hasAlpha, -1);
- }
-
- /**
- * Construct an IndexColorModel from an array of red, green, blue, and
- * optional alpha components. The component values are interleaved as RGB(A).
- *
- * @param bits the number of bits needed to represent <code>size</code> colors
- * @param size the number of colors in the color map
- * @param cmap interleaved color components
- * @param start the offset of the first color component in <code>cmap</code>
- * @param hasAlpha <code>cmap</code> has alpha values
- * @param trans the index of the transparent color
- * @throws IllegalArgumentException if bits < 1, bits > 16, or size < 1.
- */
- public IndexColorModel (int bits, int size, byte[] cmap, int start,
- boolean hasAlpha, int trans)
- {
- super (bits);
- if (bits > 16)
- throw new IllegalArgumentException("bits > 16");
- if (size < 1)
- throw new IllegalArgumentException("size < 1");
- map_size = size;
- opaque = !hasAlpha;
- this.trans = trans;
-
- rgb = new int[size];
- if (hasAlpha)
- {
- for (int i = 0; i < size; i++)
- rgb[i] =
- // alpha
- ((cmap[4 * i + 3 + start] & 0xff) << 24
- // red
- | ((cmap[4 * i + start] & 0xff) << 16)
- // green
- | ((cmap[4 * i + 1 + start] & 0xff) << 8)
- // blue
- | (cmap[4 * i + 2 + start] & 0xff));
- }
- else
- {
- for (int i = 0; i < size; i++)
- rgb[i] = (0xff000000
- // red
- | ((cmap[3 * i + start] & 0xff) << 16)
- // green
- | ((cmap[3 * i + 1 + start] & 0xff) << 8)
- // blue
- | (cmap[3 * i + 2 + start] & 0xff));
- }
-
- // Generate a bigint with 1's for every pixel
- validBits = validBits.setBit(size).subtract(BigInteger.ONE);
- }
-
- /**
- * Construct an IndexColorModel from an array of <code>size</code> packed
- * colors. Each int element contains 8-bit red, green, blue, and optional
- * alpha values packed in order. If hasAlpha is false, then all the colors
- * are opaque except for the transparent color.
- *
- * @param bits the number of bits needed to represent <code>size</code> colors
- * @param size the number of colors in the color map
- * @param cmap packed color components
- * @param start the offset of the first color component in <code>cmap</code>
- * @param hasAlpha <code>cmap</code> has alpha values
- * @param trans the index of the transparent color
- * @param transferType DataBuffer.TYPE_BYTE or DataBuffer.TYPE_USHORT
- * @throws IllegalArgumentException if bits < 1, bits > 16, or size < 1.
- * @throws IllegalArgumentException if transferType is something other than
- * TYPE_BYTE or TYPE_USHORT.
- */
- public IndexColorModel (int bits, int size, int[] cmap, int start,
- boolean hasAlpha, int trans, int transferType)
- {
- super(bits * 4, // total bits, sRGB, four channels
- nArray(bits, 4), // bits for each channel
- ColorSpace.getInstance(ColorSpace.CS_sRGB), // sRGB
- true, // has alpha
- false, // not premultiplied
- TRANSLUCENT, transferType);
- if (transferType != DataBuffer.TYPE_BYTE
- && transferType != DataBuffer.TYPE_USHORT)
- throw new IllegalArgumentException();
- if (bits > 16)
- throw new IllegalArgumentException("bits > 16");
- if (size < 1)
- throw new IllegalArgumentException("size < 1");
- map_size = size;
- opaque = !hasAlpha;
- this.trans = trans;
-
- rgb = new int[size];
- if (!hasAlpha)
- for (int i = 0; i < size; i++)
- rgb[i] = cmap[i + start] | 0xff000000;
- else
- System.arraycopy(cmap, start, rgb, 0, size);
-
- // Generate a bigint with 1's for every pixel
- validBits = validBits.setBit(size).subtract(BigInteger.ONE);
- }
-
- /**
- * Construct an IndexColorModel using a colormap with holes.
- *
- * The IndexColorModel is built from the array of ints defining the
- * colormap. Each element contains red, green, blue, and alpha
- * components. The ColorSpace is sRGB. The transparency value is
- * automatically determined.
- *
- * This constructor permits indicating which colormap entries are valid,
- * using the validBits argument. Each entry in cmap is valid if the
- * corresponding bit in validBits is set.
- *
- * @param bits the number of bits needed to represent <code>size</code> colors
- * @param size the number of colors in the color map
- * @param cmap packed color components
- * @param start the offset of the first color component in <code>cmap</code>
- * @param transferType DataBuffer.TYPE_BYTE or DataBuffer.TYPE_USHORT
- * @throws IllegalArgumentException if bits < 1, bits > 16, or size < 1.
- * @throws IllegalArgumentException if transferType is something other than
- * TYPE_BYTE or TYPE_USHORT.
- */
- public IndexColorModel (int bits, int size, int[] cmap, int start,
- int transferType, BigInteger validBits)
- {
- super(bits * 4, // total bits, sRGB, four channels
- nArray(bits, 4), // bits for each channel
- ColorSpace.getInstance(ColorSpace.CS_sRGB), // sRGB
- true, // has alpha
- false, // not premultiplied
- TRANSLUCENT, transferType);
- if (transferType != DataBuffer.TYPE_BYTE
- && transferType != DataBuffer.TYPE_USHORT)
- throw new IllegalArgumentException();
- if (bits > 16)
- throw new IllegalArgumentException("bits > 16");
- if (size < 1)
- throw new IllegalArgumentException("size < 1");
- map_size = size;
- opaque = false;
- this.trans = -1;
- this.validBits = validBits;
-
- rgb = new int[size];
- if (!hasAlpha)
- for (int i = 0; i < size; i++)
- rgb[i] = cmap[i + start] | 0xff000000;
- else
- System.arraycopy(cmap, start, rgb, 0, size);
- }
-
- public final int getMapSize ()
- {
- return map_size;
- }
-
- /**
- * Get the index of the transparent color in this color model
- */
- public final int getTransparentPixel ()
- {
- return trans;
- }
-
- /**
- * <br>
- */
- public final void getReds (byte[] r)
- {
- getComponents (r, 2);
- }
-
- /**
- * <br>
- */
- public final void getGreens (byte[] g)
- {
- getComponents (g, 1);
- }
-
- /**
- * <br>
- */
- public final void getBlues (byte[] b)
- {
- getComponents (b, 0);
- }
-
- /**
- * <br>
- */
- public final void getAlphas (byte[] a)
- {
- getComponents (a, 3);
- }
-
- private void getComponents (byte[] c, int ci)
- {
- int i, max = (map_size < c.length) ? map_size : c.length;
- for (i = 0; i < max; i++)
- c[i] = (byte) ((generateMask (ci) & rgb[i]) >> (ci * pixel_bits));
- }
-
- /**
- * Get the red component of the given pixel.
- */
- public final int getRed (int pixel)
- {
- if (pixel < map_size)
- return (int) ((generateMask (2) & rgb[pixel]) >> (2 * pixel_bits));
-
- return 0;
- }
-
- /**
- * Get the green component of the given pixel.
- */
- public final int getGreen (int pixel)
- {
- if (pixel < map_size)
- return (int) ((generateMask (1) & rgb[pixel]) >> (1 * pixel_bits));
-
- return 0;
- }
-
- /**
- * Get the blue component of the given pixel.
- */
- public final int getBlue (int pixel)
- {
- if (pixel < map_size)
- return (int) (generateMask (0) & rgb[pixel]);
-
- return 0;
- }
-
- /**
- * Get the alpha component of the given pixel.
- */
- public final int getAlpha (int pixel)
- {
- if (opaque || pixel >= map_size)
- return 255;
-
- return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits));
- }
-
- /**
- * Get the RGB color value of the given pixel using the default
- * RGB color model.
- *
- * @param pixel a pixel value
- */
- public final int getRGB (int pixel)
- {
- if (pixel >= 0 && pixel < map_size)
- return rgb[pixel];
-
- return 0;
- }
-
- /**
- * Get the RGB color values of all pixels in the map using the default
- * RGB color model.
- *
- * @param rgb The destination array.
- */
- public final void getRGBs (int[] rgb)
- {
- System.arraycopy(this.rgb, 0, rgb, 0, map_size);
- }
-
- //pixel_bits is number of bits to be in generated mask
- private int generateMask (int offset)
- {
- return (((2 << pixel_bits ) - 1) << (pixel_bits * offset));
- }
-
- /** Return true if pixel is valid, false otherwise. */
- public boolean isValid(int pixel)
- {
- return validBits.testBit(pixel);
- }
-
- /** Return true if all pixels are valid, false otherwise. */
- public boolean isValid()
- {
- // Generate a bigint with 1's for every pixel
- BigInteger allbits = new BigInteger("0");
- allbits.setBit(map_size);
- allbits.subtract(new BigInteger("1"));
- return allbits.equals(validBits);
- }
-
- /**
- * Returns a BigInteger where each bit represents an entry in the color
- * model. If the bit is on, the entry is valid.
- */
- public BigInteger getValidPixels()
- {
- return validBits;
- }
-
- /**
- * Construct a BufferedImage with rgb pixel values from a Raster.
- *
- * Constructs a new BufferedImage in which each pixel is an RGBA int from
- * a Raster with index-valued pixels. If this model has no alpha component
- * or transparent pixel, the type of the new BufferedImage is TYPE_INT_RGB.
- * Otherwise the type is TYPE_INT_ARGB. If forceARGB is true, the type is
- * forced to be TYPE_INT_ARGB no matter what.
- *
- * @param raster The source of pixel values.
- * @param forceARGB True if type must be TYPE_INT_ARGB.
- * @return New BufferedImage with RBGA int pixel values.
- */
- public BufferedImage convertToIntDiscrete(Raster raster, boolean forceARGB)
- {
- int type = forceARGB ? BufferedImage.TYPE_INT_ARGB
- : ((opaque && trans == -1) ? BufferedImage.TYPE_INT_RGB :
- BufferedImage.TYPE_INT_ARGB);
-
- // FIXME: assuming that raster has only 1 band since pixels are supposed
- // to be int indexes.
- // FIXME: it would likely be more efficient to fetch a complete array,
- // but it would take much more memory.
- // FIXME: I'm not sure if transparent pixels or alpha values need special
- // handling here.
- BufferedImage im = new BufferedImage(raster.width, raster.height, type);
- for (int x = raster.minX; x < raster.width + raster.minX; x++)
- for (int y = raster.minY; y < raster.height + raster.minY; y++)
- im.setRGB(x, y, rgb[raster.getSample(x, y, 0)]);
-
- return im;
- }
-}
-
diff --git a/libjava/java/awt/image/Kernel.java b/libjava/java/awt/image/Kernel.java
deleted file mode 100644
index f7c29c3cde9..00000000000
--- a/libjava/java/awt/image/Kernel.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Kernel.java -- Java class for an image processing kernel
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * Kernel represents an image processing kernel. It gets used to hold
- * convolution filters among other purposes. It stores an array of float
- * values representing a 2-dimensional array in row-major order.
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- * @version 1.0
- */
-public class Kernel implements Cloneable
-{
- private final int width;
- private final int height;
- private final float[] data;
-
- /**
- * Creates a new <code>Kernel</code> instance.
- *
- * @param width The 2D width of data.
- * @param height The 2D height of data.
- * @param data The source data array.
- * @exception IllegalArgumentException if width * height < data.length.
- */
- public Kernel(int width, int height, float[] data)
- throws IllegalArgumentException
- {
- this.width = width;
- this.height = height;
- if (data.length < width * height || width < 0 || height < 0)
- throw new IllegalArgumentException();
- this.data = new float[width * height];
- System.arraycopy(data, 0, this.data, 0, width * height);
- }
-
- /**
- * Return the X origin: (width - 1) / 2
- */
- public final int getXOrigin()
- {
- return (width - 1) / 2;
- }
-
- /**
- * Return the Y origin: (height - 1) / 2
- */
- public final int getYOrigin()
- {
- return (height - 1) / 2;
- }
-
- /**
- * @return The kernel width.
- */
- public final int getWidth()
- {
- return width;
- }
-
- /**
- * @return The kernel height.
- */
- public final int getHeight()
- {
- return height;
- }
-
- /**
- * Return the kernel data.
- *
- * If data is null, allocates a new array and returns it. Otherwise, the
- * kernel values are copied into data.
- *
- * @param data Array to copy values into, or null.
- * @return The array with copied values.
- * @exception IllegalArgumentException if data != null and too small.
- */
- public final float[] getKernelData(float[] data)
- throws IllegalArgumentException
- {
- if (data == null)
- return (float[])this.data.clone();
-
- if (data.length < this.data.length)
- throw new IllegalArgumentException();
-
- System.arraycopy(this.data, 0, data, 0, this.data.length);
- return data;
- }
-
- /**
- * @return a clone of this Kernel.
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
- }
-}
diff --git a/libjava/java/awt/image/LookupOp.java b/libjava/java/awt/image/LookupOp.java
deleted file mode 100644
index f131daabae3..00000000000
--- a/libjava/java/awt/image/LookupOp.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/* LookupOp.java -- Filter that converts each pixel using a lookup table.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-
-/**
- * LookupOp is a filter that converts each pixel using a lookup table.
- *
- * For filtering Rasters, the lookup table must have either one component
- * that is applied to all bands, or one component for every band in the
- * Rasters.
- *
- * For BufferedImages, the lookup table may apply to both color and alpha
- * components. If the lookup table contains one component, or if there are
- * the same number of components as color components in the source, the table
- * applies to all color components. Otherwise the table applies to all
- * components including alpha. Alpha premultiplication is ignored during the
- * lookup filtering.
- *
- * After filtering, if color conversion is necessary, the conversion happens,
- * taking alpha premultiplication into account.
- *
- * @author jlquinn
- */
-public class LookupOp implements BufferedImageOp, RasterOp
-{
- private LookupTable lut;
- private RenderingHints hints;
-
- /** Construct a new LookupOp.
- *
- * @param lookup LookupTable to use.
- * @param hints Rendering hints (can be null).
- */
- public LookupOp(LookupTable lookup, RenderingHints hints)
- {
- lut = lookup;
- this.hints = hints;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#filter(java.awt.image.BufferedImage, java.awt.image.BufferedImage)
- */
- public BufferedImage filter(BufferedImage src, BufferedImage dst)
- {
- if (src.getColorModel() instanceof IndexColorModel)
- throw new IllegalArgumentException("LookupOp.filter: IndexColorModel "
- + "not allowed");
- if (dst == null)
- dst = createCompatibleDestImage(src, src.getColorModel());
-
- // Set up for potential colormodel mismatch
- BufferedImage tgt;
- if (dst.getColorModel().equals(src.getColorModel()))
- tgt = dst;
- else
- tgt = createCompatibleDestImage(src, src.getColorModel());
-
- Raster sr = src.getRaster();
- WritableRaster dr = tgt.getRaster();
-
- if (src.getColorModel().hasAlpha() &&
- (lut.getNumComponents() == 1 ||
- lut.getNumComponents() == src.getColorModel().getNumColorComponents()))
- {
- // Need to ignore alpha for lookup
- int[] dbuf = new int[src.getColorModel().getNumComponents()];
- int tmpBands = src.getColorModel().getNumColorComponents();
- int[] tmp = new int[tmpBands];
-
- // Filter the pixels
- for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
- for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
- {
- // Filter only color components, but also copy alpha
- sr.getPixel(x, y, dbuf);
- System.arraycopy(dbuf, 0, tmp, 0, tmpBands);
- dr.setPixel(x, y, lut.lookupPixel(tmp, dbuf));
- }
- }
- else if (lut.getNumComponents() != 1
- &&
- lut.getNumComponents() != src.getColorModel().getNumComponents())
- throw new IllegalArgumentException("LookupOp.filter: "
- + "Incompatible lookup "
- + "table and source image");
-
- // No alpha to ignore
- int[] dbuf = new int[src.getColorModel().getNumComponents()];
-
- // Filter the pixels
- for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
- for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
- dr.setPixel(x, y, lut.lookupPixel(sr.getPixel(x, y, dbuf), dbuf));
-
- if (tgt != dst)
- {
- // Convert between color models.
- // TODO Check that premultiplied alpha is handled correctly here.
- Graphics2D gg = dst.createGraphics();
- gg.setRenderingHints(hints);
- gg.drawImage(tgt, 0, 0, null);
- gg.dispose();
- }
-
- return dst;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#getBounds2D(java.awt.image.BufferedImage)
- */
- public Rectangle2D getBounds2D(BufferedImage src)
- {
- return src.getRaster().getBounds();
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#createCompatibleDestImage(java.awt.image.BufferedImage, java.awt.image.ColorModel)
- */
- public BufferedImage createCompatibleDestImage(BufferedImage src,
- ColorModel dstCM)
- {
- // FIXME: set properties to those in src
- return new BufferedImage(dstCM,
- src.getRaster().createCompatibleWritableRaster(),
- src.isPremultiplied, null);
- }
-
- /** Return corresponding destination point for source point.
- *
- * LookupOp will return the value of src unchanged.
- * @param src The source point.
- * @param dst The destination point.
- * @see java.awt.image.RasterOp#getPoint2D(java.awt.geom.Point2D, java.awt.geom.Point2D)
- */
- public Point2D getPoint2D(Point2D src, Point2D dst)
- {
- if (dst == null)
- return (Point2D) src.clone();
-
- dst.setLocation(src);
- return dst;
- }
-
- /** Return the LookupTable for this op. */
- public LookupTable getTable()
- {
- return lut;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#getRenderingHints()
- */
- public RenderingHints getRenderingHints()
- {
- return hints;
- }
-
- /** Filter a raster through a lookup table.
- *
- * Applies the lookup table for this Rasterop to each pixel of src and
- * puts the results in dest. If dest is null, a new Raster is created and
- * returned.
- *
- * @param src The source raster.
- * @param dest The destination raster.
- * @return The WritableRaster with the filtered pixels.
- * @throws IllegalArgumentException if lookup table has more than one
- * component but not the same as src and dest.
- * @see java.awt.image.RasterOp#filter(java.awt.image.Raster, java.awt.image.WritableRaster)
- */
- public WritableRaster filter(Raster src, WritableRaster dest)
- {
- if (dest == null)
- // Allocate a raster if needed
- dest = createCompatibleDestRaster(src);
- else
- if (src.getNumBands() != dest.getNumBands())
- throw new IllegalArgumentException();
-
- if (lut.getNumComponents() != 1
- && lut.getNumComponents() != src.getNumBands())
- throw new IllegalArgumentException();
-
-
- // Allocate pixel storage.
- int[] tmp = new int[src.getNumBands()];
-
- // Filter the pixels
- for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
- for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
- dest.setPixel(x, y, lut.lookupPixel(src.getPixel(x, y, tmp), tmp));
- return dest;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#getBounds2D(java.awt.image.Raster)
- */
- public Rectangle2D getBounds2D(Raster src)
- {
- return src.getBounds();
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#createCompatibleDestRaster(java.awt.image.Raster)
- */
- public WritableRaster createCompatibleDestRaster(Raster src)
- {
- return src.createCompatibleWritableRaster();
- }
-
-}
diff --git a/libjava/java/awt/image/LookupTable.java b/libjava/java/awt/image/LookupTable.java
deleted file mode 100644
index f814b8e090b..00000000000
--- a/libjava/java/awt/image/LookupTable.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* LookupTable.java -- Java class for a pixel translation table.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * LookupTable represents translation arrays for pixel values. It wraps one
- * or more data arrays for each layer (or component) in an image, such as
- * Alpha, R, G, and B. When doing translation, the offset is subtracted from
- * the pixel values to allow a subset of an array to be used.
- *
- * @see ByteLookupTable
- * @see ShortLookupTable
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- * @version 1.0
- */
-public abstract class LookupTable
-{
- // Not protected since that's part of the public API.
- int offset;
- int numComponents;
-
- /**
- * Creates a new <code>LookupTable</code> instance.
- *
- * If numComponents is 1, the same translation table is used for all pixel
- * components.
- *
- * @param offset Offset to be subtracted.
- * @param numComponents Number of image components.
- * @exception IllegalArgumentException if offset < 0 or numComponents < 1.
- */
- protected LookupTable(int offset, int numComponents)
- throws IllegalArgumentException
- {
- if (offset < 0 || numComponents < 1)
- throw new IllegalArgumentException();
- this.offset = offset;
- this.numComponents = numComponents;
- }
-
- /** Return the number of components. */
- public int getNumComponents()
- {
- return numComponents;
- }
-
- /** Return the offset. */
- public int getOffset()
- {
- return offset;
- }
-
-
- /**
- * Return translated values for a pixel.
- *
- * For each value in the pixel src, use the value minus offset as an index
- * in the component array and copy the value there to the output for the
- * component. If dest is null, the output is a new array, otherwise the
- * translated values are written to dest. Dest can be the same array as
- * src.
- *
- * For example, if the pixel src is [2, 4, 3], and offset is 1, the output
- * is [comp1[1], comp2[3], comp3[2]], where comp1, comp2, and comp3 are the
- * translation arrays.
- *
- * @param src Component values of a pixel.
- * @param dest Destination array for values, or null.
- * @return Translated values for the pixel.
- */
- public abstract int[] lookupPixel(int[] src, int[] dest);
-}
diff --git a/libjava/java/awt/image/MemoryImageSource.java b/libjava/java/awt/image/MemoryImageSource.java
deleted file mode 100644
index c27e0bf7317..00000000000
--- a/libjava/java/awt/image/MemoryImageSource.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/* MemoryImageSource.java -- Java class for providing image data
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-public class MemoryImageSource implements ImageProducer
-{
- private boolean animated = false;
- private boolean fullbuffers = false;
- private int[] pixeli;
- private int width;
- private int height;
- private int offset;
- private int scansize;
- private byte[] pixelb;
- private ColorModel cm;
- private Hashtable props = new Hashtable();
- private Vector consumers = new Vector();
-
- /**
- * Construct an image producer that reads image data from a byte
- * array.
- *
- * @param w width of image
- * @param h height of image
- * @param cm the color model used to represent pixel values
- * @param pix a byte array of pixel values
- * @param off the offset into the array at which the first pixel is stored
- * @param scan the number of array elements that represents a single pixel row
- */
- public MemoryImageSource(int w, int h, ColorModel cm, byte[] pix, int off,
- int scan)
- {
- this(w, h, cm, pix, off, scan, null);
- }
-
- /**
- * Constructs an ImageProducer from memory
- */
- public MemoryImageSource(int w, int h, ColorModel cm, byte[] pix, int off,
- int scan, Hashtable props)
- {
- width = w;
- height = h;
- this.cm = cm;
- offset = off;
- scansize = scan;
- this.props = props;
- int max = ((scansize > width) ? scansize : width);
- pixelb = pix;
- }
-
- /**
- * Construct an image producer that reads image data from an
- * integer array.
- *
- * @param w width of image
- * @param h height of image
- * @param cm the color model used to represent pixel values
- * @param pix an integer array of pixel values
- * @param off the offset into the array at which the first pixel is stored
- * @param scan the number of array elements that represents a single pixel row
- */
- public MemoryImageSource(int w, int h, ColorModel cm, int[] pix, int off,
- int scan)
- {
- this(w, h, cm, pix, off, scan, null);
- }
-
- /**
- Constructs an ImageProducer from memory
- */
- public MemoryImageSource(int w, int h, ColorModel cm, int[] pix, int off,
- int scan, Hashtable props)
- {
- width = w;
- height = h;
- this.cm = cm;
- offset = off;
- scansize = scan;
- this.props = props;
- int max = ((scansize > width) ? scansize : width);
- pixeli = pix;
- }
-
- /**
- * Constructs an ImageProducer from memory using the default RGB ColorModel
- */
- public MemoryImageSource(int w, int h, int[] pix, int off, int scan,
- Hashtable props)
- {
- this(w, h, ColorModel.getRGBdefault(), pix, off, scan, props);
- }
-
- /**
- * Constructs an ImageProducer from memory using the default RGB ColorModel
- */
- public MemoryImageSource(int w, int h, int[] pix, int off, int scan)
- {
- this(w, h, ColorModel.getRGBdefault(), pix, off, scan, null);
- }
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code>.
- */
- public synchronized void addConsumer(ImageConsumer ic)
- {
- if (consumers.contains(ic))
- return;
-
- consumers.addElement(ic);
- }
-
- /**
- * Used to determine if the given <code>ImageConsumer</code> is
- * already registered with this <code>ImageProducer</code>.
- */
- public synchronized boolean isConsumer(ImageConsumer ic)
- {
- if (consumers.contains(ic))
- return true;
- return false;
- }
-
- /**
- * Used to remove an <code>ImageConsumer</code> from the list of
- * registered consumers for this <code>ImageProducer</code>.
- */
- public synchronized void removeConsumer(ImageConsumer ic)
- {
- consumers.removeElement(ic);
- }
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code> and then immediately start
- * reconstruction of the image data to be delivered to all
- * registered consumers.
- */
- public void startProduction(ImageConsumer ic)
- {
- if (! (consumers.contains(ic)))
- consumers.addElement(ic);
-
- Vector list = (Vector) consumers.clone();
- for (int i = 0; i < list.size(); i++)
- {
- ic = (ImageConsumer) list.elementAt(i);
- sendPicture(ic);
- if (animated)
- ic.imageComplete(ImageConsumer.SINGLEFRAME);
- else
- ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
- }
- }
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code> and then request that this producer
- * resend the image data in the order top-down, left-right.
- */
- public void requestTopDownLeftRightResend(ImageConsumer ic)
- {
- startProduction(ic);
- }
-
- /**
- * Changes a flag to indicate whether this MemoryImageSource supports
- * animations.
- *
- * @param animated A flag indicating whether this class supports animations
- */
- public synchronized void setAnimated(boolean animated)
- {
- this.animated = animated;
- }
-
- /**
- * A flag to indicate whether or not to send full buffer updates when
- * sending animation. If this flag is set then full buffers are sent
- * in the newPixels methods instead of just regions.
- *
- * @param fullbuffers - a flag indicating whether to send the full buffers
- */
- public synchronized void setFullBufferUpdates(boolean fullbuffers)
- {
- this.fullbuffers = fullbuffers;
- }
-
- /**
- * Send an animation frame to the image consumers.
- */
- public void newPixels()
- {
- if (animated == true)
- {
- ImageConsumer ic;
- Vector list = (Vector) consumers.clone();
- for (int i = 0; i < list.size(); i++)
- {
- ic = (ImageConsumer) list.elementAt(i);
- sendPicture(ic);
- ic.imageComplete(ImageConsumer.SINGLEFRAME);
- }
- }
- }
-
- private void sendPicture(ImageConsumer ic)
- {
- ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT);
- if (props != null)
- ic.setProperties(props);
- ic.setDimensions(width, height);
- ic.setColorModel(cm);
- if (pixeli != null)
- ic.setPixels(0, 0, width, height, cm, pixeli, offset, scansize);
- else
- ic.setPixels(0, 0, width, height, cm, pixelb, offset, scansize);
- }
-
- /**
- * Send an animation frame to the image consumers containing the specified
- * pixels unless setFullBufferUpdates is set.
- */
- public synchronized void newPixels(int x, int y, int w, int h)
- {
- if (animated == true)
- {
- if (fullbuffers)
- newPixels();
- else
- {
- ImageConsumer ic;
- Vector list = (Vector) consumers.clone();
- for (int i = 0; i < list.size(); i++)
- {
- ic = (ImageConsumer) list.elementAt(i);
- ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT);
- if (props != null)
- ic.setProperties(props);
- if (pixeli != null)
- {
- int[] pixelbuf = new int[w * h];
- for (int row = y; row < y + h; row++)
- System.arraycopy(pixeli, row * scansize + x + offset,
- pixelbuf, 0, w * h);
- ic.setPixels(x, y, w, h, cm, pixelbuf, 0, w);
- }
- else
- {
- byte[] pixelbuf = new byte[w * h];
- for (int row = y; row < y + h; row++)
- System.arraycopy(pixelb, row * scansize + x + offset,
- pixelbuf, 0, w * h);
-
- ic.setPixels(x, y, w, h, cm, pixelbuf, 0, w);
- }
- ic.imageComplete(ImageConsumer.SINGLEFRAME);
- }
- }
- }
- }
-
- /**
- * Send an animation frame to the image consumers containing the specified
- * pixels unless setFullBufferUpdates is set.
- *
- * If framenotify is set then a notification is sent when the frame
- * is sent otherwise no status is sent.
- */
- public synchronized void newPixels(int x, int y, int w, int h,
- boolean framenotify)
- {
- if (animated == true)
- {
- if (fullbuffers)
- newPixels();
- else
- {
- ImageConsumer ic;
- Vector list = (Vector) consumers.clone();
- for (int i = 0; i < list.size(); i++)
- {
- ic = (ImageConsumer) list.elementAt(i);
- ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT);
- if (props != null)
- ic.setProperties(props);
- if (pixeli != null)
- {
- int[] pixelbuf = new int[w * h];
- for (int row = y; row < y + h; row++)
- System.arraycopy(pixeli, row * scansize + x + offset,
- pixelbuf, 0, w * h);
- ic.setPixels(x, y, w, h, cm, pixelbuf, 0, w);
- }
- else
- {
- byte[] pixelbuf = new byte[w * h];
- for (int row = y; row < y + h; row++)
- System.arraycopy(pixelb, row * scansize + x + offset,
- pixelbuf, 0, w * h);
- ic.setPixels(x, y, w, h, cm, pixelbuf, 0, w);
- }
- if (framenotify == true)
- ic.imageComplete(ImageConsumer.SINGLEFRAME);
- }
- }
- }
- }
-
- public synchronized void newPixels(byte[] newpix, ColorModel newmodel,
- int offset, int scansize)
- {
- pixeli = null;
- pixelb = newpix;
- cm = newmodel;
- this.offset = offset;
- this.scansize = scansize;
- if (animated == true)
- newPixels();
- }
-
- public synchronized void newPixels(int[] newpix, ColorModel newmodel,
- int offset, int scansize)
- {
- pixelb = null;
- pixeli = newpix;
- cm = newmodel;
- this.offset = offset;
- this.scansize = scansize;
- if (animated == true)
- newPixels();
- }
-}
diff --git a/libjava/java/awt/image/MultiPixelPackedSampleModel.java b/libjava/java/awt/image/MultiPixelPackedSampleModel.java
deleted file mode 100644
index 18a6e555205..00000000000
--- a/libjava/java/awt/image/MultiPixelPackedSampleModel.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/* Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import gnu.java.awt.Buffers;
-
-/**
- * MultiPixelPackedSampleModel provides a single band model that supports
- * multiple pixels in a single unit. Pixels have 2^n bits and 2^k pixels fit
- * per data element.
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- */
-public class MultiPixelPackedSampleModel extends SampleModel
-{
- private int scanlineStride;
- private int[] bitMasks;
- private int[] bitOffsets;
- private int[] sampleSize;
- private int dataBitOffset;
- private int elemBits;
- private int numberOfBits;
- private int numElems;
-
- public MultiPixelPackedSampleModel(int dataType, int w, int h,
- int numberOfBits)
- {
- this(dataType, w, h, numberOfBits, 0, 0);
- }
-
- public MultiPixelPackedSampleModel(int dataType, int w, int h,
- int numberOfBits, int scanlineStride,
- int dataBitOffset)
- {
- super(dataType, w, h, 1);
-
- switch (dataType)
- {
- case DataBuffer.TYPE_BYTE:
- elemBits = 8;
- break;
- case DataBuffer.TYPE_USHORT:
- elemBits = 16;
- break;
- case DataBuffer.TYPE_INT:
- elemBits = 32;
- break;
- default:
- throw new IllegalArgumentException("MultiPixelPackedSampleModel"
- + " unsupported dataType");
- }
-
- this.dataBitOffset = dataBitOffset;
-
- this.numberOfBits = numberOfBits;
- if (numberOfBits > elemBits)
- throw new RasterFormatException("MultiPixelPackedSampleModel pixel size"
- + " larger than dataType");
- switch (numberOfBits)
- {
- case 1: case 2: case 4: case 8: case 16: case 32: break;
- default:
- throw new RasterFormatException("MultiPixelPackedSampleModel pixel"
- + " size not 2^n bits");
- }
- numElems = elemBits / numberOfBits;
-
- // Compute scan line large enough for w pixels.
- if (scanlineStride == 0)
- scanlineStride = ((dataBitOffset + w * numberOfBits) / elemBits);
- this.scanlineStride = scanlineStride;
-
-
- sampleSize = new int[1];
- sampleSize[0] = numberOfBits;
-
- bitMasks = new int[numElems];
- bitOffsets = new int[numElems];
- for (int i=0; i < numElems; i++)
- {
- bitOffsets[numElems - i- 1] = numberOfBits * i;
- bitMasks[numElems - i - 1] = ((1 << numberOfBits) - 1) <<
- bitOffsets[numElems - i - 1];
- }
- }
-
- public SampleModel createCompatibleSampleModel(int w, int h)
- {
- /* FIXME: We can avoid recalculation of bit offsets and sample
- sizes here by passing these from the current instance to a
- special private constructor. */
- return new MultiPixelPackedSampleModel(dataType, w, h, numberOfBits);
- }
-
-
- /**
- * Creates a DataBuffer for holding pixel data in the format and
- * layout described by this SampleModel. The returned buffer will
- * consist of one single bank.
- */
- public DataBuffer createDataBuffer()
- {
- int size;
-
- // FIXME: The comment refers to SinglePixelPackedSampleModel. See if the
- // same can be done for MultiPixelPackedSampleModel.
- // We can save (scanlineStride - width) pixels at the very end of
- // the buffer. The Sun reference implementation (J2SE 1.3.1 and
- // 1.4.1_01) seems to do this; tested with Mauve test code.
- size = scanlineStride * height;
-
- return Buffers.createBuffer(getDataType(), size);
- }
-
-
- public int getNumDataElements()
- {
- return 1;
- }
-
- public int[] getSampleSize()
- {
- return sampleSize;
- }
-
- public int getSampleSize(int band)
- {
- return sampleSize[0];
- }
-
- public int getOffset(int x, int y)
- {
- return scanlineStride * y + ((dataBitOffset + x*numberOfBits) / elemBits);
- }
-
- public int getBitOffset(int x)
- {
- return (dataBitOffset + x*numberOfBits) % elemBits;
- }
-
- public int getDataBitOffset()
- {
- return dataBitOffset;
- }
-
- public int getScanlineStride()
- {
- return scanlineStride;
- }
-
- public int getPixelBitStride()
- {
- return numberOfBits;
- }
-
-
- public SampleModel createSubsetSampleModel(int[] bands)
- {
- int numBands = bands.length;
- if (numBands != 1)
- throw new RasterFormatException("MultiPixelPackedSampleModel only"
- + " supports one band");
-
- return new MultiPixelPackedSampleModel(dataType, width, height,
- numberOfBits, scanlineStride,
- dataBitOffset);
- }
-
- /**
- * Extract one pixel and return in an array of transfer type.
- *
- * Extracts the pixel at x, y from data and stores into the 0th index of the
- * array obj, since there is only one band. If obj is null, a new array of
- * getTransferType() is created.
- *
- * @param x The x-coordinate of the pixel rectangle to store in <code>obj</code>.
- * @param y The y-coordinate of the pixel rectangle to store in <code>obj</code>.
- * @param obj The primitive array to store the pixels into or null to force creation.
- * @param data The DataBuffer that is the source of the pixel data.
- * @return The primitive array containing the pixel data.
- * @see java.awt.image.SampleModel#getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)
- */
- public Object getDataElements(int x, int y, Object obj,
- DataBuffer data)
- {
- int pixel = getSample(x, y, 0, data);
- switch (getTransferType())
- {
- case DataBuffer.TYPE_BYTE:
- if (obj == null) obj = new byte[1];
- ((byte[])obj)[0] = (byte)pixel;
- return obj;
- case DataBuffer.TYPE_USHORT:
- if (obj == null) obj = new short[1];
- ((short[])obj)[0] = (short)pixel;
- return obj;
- case DataBuffer.TYPE_INT:
- if (obj == null) obj = new int[1];
- ((int[])obj)[0] = pixel;
- return obj;
- default:
- // Seems like the only sensible thing to do.
- throw new ClassCastException();
- }
- }
-
- public int[] getPixel(int x, int y, int[] iArray, DataBuffer data)
- {
- if (iArray == null) iArray = new int[1];
- iArray[0] = getSample(x, y, 0, data);
-
- return iArray;
- }
-
- public int[] getPixels(int x, int y, int w, int h, int[] iArray,
- DataBuffer data)
- {
- int offset = getOffset(x, y);
- if (iArray == null) iArray = new int[w*h];
- int outOffset = 0;
- for (y=0; y<h; y++)
- {
- int lineOffset = offset;
- for (x=0; x<w;)
- {
- int samples = data.getElem(lineOffset++);
- for (int b=0; b<numElems && x<w; b++)
- {
- iArray[outOffset++] = (samples & bitMasks[b]) >>> bitOffsets[b];
- x++;
- }
- }
- offset += scanlineStride;
- }
- return iArray;
- }
-
- public int getSample(int x, int y, int b, DataBuffer data)
- {
- int pos =
- ((dataBitOffset + x * numberOfBits) % elemBits) / numberOfBits;
- int offset = getOffset(x, y);
- int samples = data.getElem(offset);
- return (samples & bitMasks[pos]) >>> bitOffsets[pos];
- }
-
- /**
- * Set the pixel at x, y to the value in the first element of the primitive
- * array obj.
- *
- * @param x The x-coordinate of the data elements in <code>obj</code>.
- * @param y The y-coordinate of the data elements in <code>obj</code>.
- * @param obj The primitive array containing the data elements to set.
- * @param data The DataBuffer to store the data elements into.
- * @see java.awt.image.SampleModel#setDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer)
- */
- public void setDataElements(int x, int y, Object obj, DataBuffer data)
- {
- int transferType = getTransferType();
- if (getTransferType() != data.getDataType())
- {
- throw new IllegalArgumentException("transfer type ("+
- getTransferType()+"), "+
- "does not match data "+
- "buffer type (" +
- data.getDataType() +
- ").");
- }
-
- int offset = getOffset(x, y);
-
- try
- {
- switch (transferType)
- {
- case DataBuffer.TYPE_BYTE:
- {
- DataBufferByte out = (DataBufferByte) data;
- byte[] in = (byte[]) obj;
- out.getData()[offset] = in[0];
- return;
- }
- case DataBuffer.TYPE_USHORT:
- {
- DataBufferUShort out = (DataBufferUShort) data;
- short[] in = (short[]) obj;
- out.getData()[offset] = in[0];
- return;
- }
- case DataBuffer.TYPE_INT:
- {
- DataBufferInt out = (DataBufferInt) data;
- int[] in = (int[]) obj;
- out.getData()[offset] = in[0];
- return;
- }
- default:
- throw new ClassCastException("Unsupported data type");
- }
- }
- catch (ArrayIndexOutOfBoundsException aioobe)
- {
- String msg = "While writing data elements" +
- ", x="+x+", y="+y+
- ", width="+width+", height="+height+
- ", scanlineStride="+scanlineStride+
- ", offset="+offset+
- ", data.getSize()="+data.getSize()+
- ", data.getOffset()="+data.getOffset()+
- ": " +
- aioobe;
- throw new ArrayIndexOutOfBoundsException(msg);
- }
- }
-
- public void setPixel(int x, int y, int[] iArray, DataBuffer data)
- {
- setSample(x, y, 0, iArray[0], data);
- }
-
- public void setSample(int x, int y, int b, int s, DataBuffer data)
- {
- int bitpos =
- ((dataBitOffset + x * numberOfBits) % elemBits) / numberOfBits;
- int offset = getOffset(x, y);
-
- s = s << bitOffsets[bitpos];
- s = s & bitMasks[bitpos];
-
- int sample = data.getElem(offset);
- sample |= s;
- data.setElem(offset, sample);
- }
-
- /**
- * Creates a String with some information about this SampleModel.
- * @return A String describing this SampleModel.
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- StringBuffer result = new StringBuffer();
- result.append(getClass().getName());
- result.append("[");
- result.append("scanlineStride=").append(scanlineStride);
- for(int i=0; i < bitMasks.length; i+=1)
- {
- result.append(", mask[").append(i).append("]=0x").append(Integer.toHexString(bitMasks[i]));
- }
-
- result.append("]");
- return result.toString();
- }
-}
diff --git a/libjava/java/awt/image/PackedColorModel.java b/libjava/java/awt/image/PackedColorModel.java
deleted file mode 100644
index 894e6e66fda..00000000000
--- a/libjava/java/awt/image/PackedColorModel.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/* Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import gnu.java.awt.BitMaskExtent;
-
-import java.awt.Point;
-import java.awt.color.ColorSpace;
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public abstract class PackedColorModel extends ColorModel
-{
- private int masks[];
-
- /* Package accessibility, the DirectColorModel needs this array */
- int shifts[];
-
- public PackedColorModel(ColorSpace cspace, int pixelBits,
- int[] colorMaskArray, int alphaMask,
- boolean isAlphaPremultiplied,
- int transparency,
- int transferType)
- {
- super(pixelBits, calcBitsPerComponent(colorMaskArray, alphaMask),
- cspace, (alphaMask != 0), isAlphaPremultiplied, transparency,
- transferType);
- initMasks(colorMaskArray, alphaMask);
- if ((pixelBits<1) || (pixelBits>32)) {
- throw new IllegalArgumentException("pixels per bits must be " +
- "in the range [1, 32]");
- }
- }
-
- private static int[] calcBitsPerComponent(int[] colorMaskArray,
- int alphaMask)
- {
- int numComponents = colorMaskArray.length;
- if (alphaMask != 0) numComponents++;
-
- int[] bitsPerComponent = new int[numComponents];
-
- BitMaskExtent extent = new BitMaskExtent();
- for (int b=0; b<colorMaskArray.length; b++)
- {
- extent.setMask(colorMaskArray[b]);
- bitsPerComponent[b] = extent.bitWidth;
- }
- if (alphaMask != 0)
- {
- extent.setMask(alphaMask);
- bitsPerComponent[numComponents-1] = extent.bitWidth;
- }
- return bitsPerComponent;
- }
-
- /** Initializes the masks.
- *
- * @return an array containing the number of bits per color
- * component.
- */
- private void initMasks(int[] colorMaskArray, int alphaMask)
- {
- int numComponents = colorMaskArray.length;
- if (alphaMask == 0)
- {
- masks = colorMaskArray;
- }
- else
- {
- masks = new int[numComponents+1];
- System.arraycopy(colorMaskArray, 0,
- masks, 0,
- numComponents);
- masks[numComponents++] = alphaMask;
- }
-
- shifts = new int[numComponents];
-
- // Bit field handling have been moved to a utility class
- BitMaskExtent extent = new BitMaskExtent();
- for (int b=0; b<numComponents; b++)
- {
- extent.setMask(masks[b]);
- shifts[b] = extent.leastSignificantBit;
- }
- }
-
- public PackedColorModel(ColorSpace cspace, int pixelBits,
- int rmask, int gmask, int bmask,
- int amask, boolean isAlphaPremultiplied,
- int transparency,
- int transferType)
- {
- this(cspace, pixelBits, makeColorMaskArray(rmask, gmask, bmask),
- amask, isAlphaPremultiplied, transparency, transferType);
- }
-
- /* TODO: If there is a alpha mask, it is inefficient to create a
- color mask array that will be discarded when the alpha mask is
- appended. We should probably create a private constructor that
- takes a complete array of masks (color+alpha) as an
- argument. */
-
- private static int[] makeColorMaskArray(int rmask, int gmask, int bmask)
- {
- int[] colorMaskArray = { rmask, gmask, bmask };
- return colorMaskArray;
- }
-
- public final int getMask(int index)
- {
- return masks[index];
- }
-
- public final int[] getMasks()
- {
- return masks;
- }
-
- public SampleModel createCompatibleSampleModel(int w, int h)
- {
- return new SinglePixelPackedSampleModel(transferType, w, h, masks);
- }
-
- public boolean isCompatibleSampleModel(SampleModel sm)
- {
- if (!super.isCompatibleSampleModel(sm)) return false;
- if (!(sm instanceof SinglePixelPackedSampleModel)) return false;
-
- SinglePixelPackedSampleModel sppsm =
- (SinglePixelPackedSampleModel) sm;
- return java.util.Arrays.equals(sppsm.getBitMasks(), masks);
- }
-
- public WritableRaster getAlphaRaster(WritableRaster raster) {
- if (!hasAlpha()) return null;
-
- SampleModel sm = raster.getSampleModel();
- int[] alphaBand = { sm.getNumBands() - 1 };
- SampleModel alphaModel = sm.createSubsetSampleModel(alphaBand);
- DataBuffer buffer = raster.getDataBuffer();
- Point origin = new Point(0, 0);
- return Raster.createWritableRaster(alphaModel, buffer, origin);
- }
-
- public boolean equals(Object obj)
- {
- if (!super.equals(obj)) return false;
- if (!(obj instanceof PackedColorModel)) return false;
-
- PackedColorModel other = (PackedColorModel) obj;
-
- return java.util.Arrays.equals(masks, other.masks);
- }
-}
diff --git a/libjava/java/awt/image/PixelGrabber.java b/libjava/java/awt/image/PixelGrabber.java
deleted file mode 100644
index 3e3ecf81e19..00000000000
--- a/libjava/java/awt/image/PixelGrabber.java
+++ /dev/null
@@ -1,624 +0,0 @@
-/* PixelGrabber.java -- retrieve a subset of an image's data
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Image;
-import java.util.Hashtable;
-
-/**
- * PixelGrabber is an ImageConsumer that extracts a rectangular region
- * of pixels from an Image.
- */
-public class PixelGrabber implements ImageConsumer
-{
- int x, y, offset;
- int width = -1;
- int height = -1;
- int scansize = -1;
- boolean forceRGB = true;
-
- ColorModel model = ColorModel.getRGBdefault();
- int hints;
- Hashtable props;
-
- int int_pixel_buffer[];
- boolean ints_delivered = false;
- byte byte_pixel_buffer[];
- boolean bytes_delivered = false;
-
- ImageProducer ip;
- int observerStatus;
- int consumerStatus;
-
- private Thread grabberThread;
- boolean grabbing = false;
-
- /**
- * Construct a PixelGrabber that will retrieve RGB data from a given
- * Image.
- *
- * The RGB data will be retrieved from a rectangular region
- * <code>(x, y, w, h)</code> within the image. The data will be
- * stored in the provided <code>pix</code> array, which must have
- * been initialized to a size of at least <code>w * h</code>. The
- * data for a pixel (m, n) in the grab rectangle will be stored at
- * <code>pix[(n - y) * scansize + (m - x) + off]</code>.
- *
- * @param img the Image from which to grab pixels
- * @param x the x coordinate, relative to <code>img</code>'s
- * top-left corner, of the grab rectangle's top-left pixel
- * @param y the y coordinate, relative to <code>img</code>'s
- * top-left corner, of the grab rectangle's top-left pixel
- * @param w the width of the grab rectangle, in pixels
- * @param h the height of the grab rectangle, in pixels
- * @param pix the array in which to store grabbed RGB pixel data
- * @param off the offset into the <code>pix</code> array at which to
- * start storing RGB data
- * @param scansize a set of <code>scansize</code> consecutive
- * elements in the <code>pix</code> array represents one row of
- * pixels in the grab rectangle
- */
- public PixelGrabber(Image img, int x, int y, int w, int h,
- int pix[], int off, int scansize)
- {
- this (img.getSource(), x, y, w, h, pix, off, scansize);
- }
-
- /**
- * Construct a PixelGrabber that will retrieve RGB data from a given
- * ImageProducer.
- *
- * The RGB data will be retrieved from a rectangular region
- * <code>(x, y, w, h)</code> within the image produced by
- * <code>ip</code>. The data will be stored in the provided
- * <code>pix</code> array, which must have been initialized to a
- * size of at least <code>w * h</code>. The data for a pixel (m, n)
- * in the grab rectangle will be stored at
- * <code>pix[(n - y) * scansize + (m - x) + off]</code>.
- *
- * @param ip the ImageProducer from which to grab pixels
- * @param x the x coordinate of the grab rectangle's top-left pixel,
- * specified relative to the top-left corner of the image produced
- * by <code>ip</code>
- * @param y the y coordinate of the grab rectangle's top-left pixel,
- * specified relative to the top-left corner of the image produced
- * by <code>ip</code>
- * @param w the width of the grab rectangle, in pixels
- * @param h the height of the grab rectangle, in pixels
- * @param pix the array in which to store grabbed RGB pixel data
- * @param off the offset into the <code>pix</code> array at which to
- * start storing RGB data
- * @param scansize a set of <code>scansize</code> consecutive
- * elements in the <code>pix</code> array represents one row of
- * pixels in the grab rectangle
- */
- public PixelGrabber(ImageProducer ip, int x, int y, int w, int h,
- int pix[], int off, int scansize)
- {
- this.ip = ip;
- this.x = x;
- this.y = y;
- this.width = w;
- this.height = h;
- this.offset = off;
- this.scansize = scansize;
-
- int_pixel_buffer = pix;
- // Initialize the byte array in case ip sends us byte-formatted
- // pixel data.
- byte_pixel_buffer = new byte[pix.length * 4];
- }
-
- /**
- * Construct a PixelGrabber that will retrieve data from a given
- * Image.
- *
- * The RGB data will be retrieved from a rectangular region
- * <code>(x, y, w, h)</code> within the image. The data will be
- * stored in an internal array which can be accessed by calling
- * <code>getPixels</code>. The data for a pixel (m, n) in the grab
- * rectangle will be stored in the returned array at index
- * <code>(n - y) * scansize + (m - x) + off</code>.
- * If forceRGB is false, then the returned data will be not be
- * converted to RGB from its format in <code>img</code>.
- *
- * If <code>w</code> is negative, the width of the grab region will
- * be from x to the right edge of the image. Likewise, if
- * <code>h</code> is negative, the height of the grab region will be
- * from y to the bottom edge of the image.
- *
- * @param img the Image from which to grab pixels
- * @param x the x coordinate, relative to <code>img</code>'s
- * top-left corner, of the grab rectangle's top-left pixel
- * @param y the y coordinate, relative to <code>img</code>'s
- * top-left corner, of the grab rectangle's top-left pixel
- * @param w the width of the grab rectangle, in pixels
- * @param h the height of the grab rectangle, in pixels
- * @param forceRGB true to force conversion of the rectangular
- * region's pixel data to RGB
- */
- public PixelGrabber(Image img,
- int x, int y,
- int w, int h,
- boolean forceRGB)
- {
- this.ip = img.getSource();
- this.x = x;
- this.y = y;
- width = w;
- height = h;
- // If width or height is negative, postpone pixel buffer
- // initialization until setDimensions is called back by ip.
- if (width >= 0 && height >= 0)
- {
- int_pixel_buffer = new int[width * height];
- byte_pixel_buffer = new byte[width * height];
- }
- this.forceRGB = forceRGB;
- }
-
- /**
- * Start grabbing pixels.
- *
- * Spawns an image production thread that calls back to this
- * PixelGrabber's ImageConsumer methods.
- */
- public synchronized void startGrabbing()
- {
- // Make sure we're not already grabbing.
- if (grabbing == false)
- {
- grabbing = true;
- grabberThread = new Thread ()
- {
- public void run ()
- {
- ip.startProduction (PixelGrabber.this);
- }
- };
- grabberThread.start ();
- }
- }
-
- /**
- * Abort pixel grabbing.
- */
- public synchronized void abortGrabbing()
- {
- if (grabbing)
- {
- // Interrupt the grabbing thread.
- Thread moribund = grabberThread;
- grabberThread = null;
- moribund.interrupt();
-
- imageComplete (ImageConsumer.IMAGEABORTED);
- }
- }
-
- /**
- * Have our Image or ImageProducer start sending us pixels via our
- * ImageConsumer methods and wait for all pixels in the grab
- * rectangle to be delivered.
- *
- * @return true if successful, false on abort or error
- *
- * @throws InterruptedException if interrupted by another thread.
- */
- public synchronized boolean grabPixels() throws InterruptedException
- {
- return grabPixels(0);
- }
-
- /**
- * grabPixels's behavior depends on the value of <code>ms</code>.
- *
- * If ms < 0, return true if all pixels from the source image have
- * been delivered, false otherwise. Do not wait.
- *
- * If ms >= 0 then we request that our Image or ImageProducer start
- * delivering pixels to us via our ImageConsumer methods.
- *
- * If ms > 0, wait at most <code>ms</code> milliseconds for
- * delivery of all pixels within the grab rectangle.
- *
- * If ms == 0, wait until all pixels have been delivered.
- *
- * @return true if all pixels from the source image have been
- * delivered, false otherwise
- *
- * @throws InterruptedException if this thread is interrupted while
- * we are waiting for pixels to be delivered
- */
- public synchronized boolean grabPixels(long ms) throws InterruptedException
- {
- if (ms < 0)
- return ((observerStatus & (ImageObserver.FRAMEBITS
- | ImageObserver.ALLBITS)) != 0);
-
- // Spawn a new ImageProducer thread to send us the image data via
- // our ImageConsumer methods.
- startGrabbing();
-
- if (ms > 0)
- {
- long stop_time = System.currentTimeMillis() + ms;
- long time_remaining;
- while (grabbing)
- {
- time_remaining = stop_time - System.currentTimeMillis();
- if (time_remaining <= 0)
- break;
- wait (time_remaining);
- }
- abortGrabbing ();
- }
- else
- wait ();
-
- // If consumerStatus is non-zero then the image is done loading or
- // an error has occurred.
- if (consumerStatus != 0)
- return setObserverStatus ();
-
- return ((observerStatus & (ImageObserver.FRAMEBITS
- | ImageObserver.ALLBITS)) != 0);
- }
-
- // Set observer status flags based on the current consumer status
- // flags. Return true if the consumer flags indicate that the
- // image was loaded successfully, or false otherwise.
- private synchronized boolean setObserverStatus ()
- {
- boolean retval = false;
-
- if ((consumerStatus & IMAGEERROR) != 0)
- observerStatus |= ImageObserver.ERROR;
-
- if ((consumerStatus & IMAGEABORTED) != 0)
- observerStatus |= ImageObserver.ABORT;
-
- if ((consumerStatus & STATICIMAGEDONE) != 0)
- {
- observerStatus |= ImageObserver.ALLBITS;
- retval = true;
- }
-
- if ((consumerStatus & SINGLEFRAMEDONE) != 0)
- {
- observerStatus |= ImageObserver.FRAMEBITS;
- retval = true;
- }
-
- return retval;
- }
-
- /**
- * @return the status of the pixel grabbing thread, represented by a
- * bitwise OR of ImageObserver flags
- */
- public synchronized int getStatus()
- {
- return observerStatus;
- }
-
- /**
- * @return the width of the grab rectangle in pixels, or a negative
- * number if the ImageProducer has not yet called our setDimensions
- * method
- */
- public synchronized int getWidth()
- {
- return width;
- }
-
- /**
- * @return the height of the grab rectangle in pixels, or a negative
- * number if the ImageProducer has not yet called our setDimensions
- * method
- */
- public synchronized int getHeight()
- {
- return height;
- }
-
- /**
- * @return a byte array of pixel data if ImageProducer delivered
- * pixel data using the byte[] variant of setPixels, or an int array
- * otherwise
- */
- public synchronized Object getPixels()
- {
- if (ints_delivered)
- return int_pixel_buffer;
- else if (bytes_delivered)
- return byte_pixel_buffer;
- else
- return null;
- }
-
- /**
- * @return the ColorModel currently being used for the majority of
- * pixel data conversions
- */
- public synchronized ColorModel getColorModel()
- {
- return model;
- }
-
- /**
- * Our <code>ImageProducer</code> calls this method to indicate the
- * size of the image being produced.
- *
- * setDimensions is an ImageConsumer method. None of PixelGrabber's
- * ImageConsumer methods should be called by code that instantiates
- * a PixelGrabber. They are only made public so they can be called
- * by the PixelGrabber's ImageProducer.
- *
- * @param width the width of the image
- * @param height the height of the image
- */
- public synchronized void setDimensions(int width, int height)
- {
- // Our width wasn't set when we were constructed. Set our width
- // so that the grab region includes all pixels from x to the right
- // edge of the source image.
- if (this.width < 0)
- this.width = width - x;
-
- // Our height wasn't set when we were constructed. Set our height
- // so that the grab region includes all pixels from y to the
- // bottom edge of the source image.
- if (this.height < 0)
- this.height = height - y;
-
- if (scansize < 0)
- scansize = this.width;
-
- if (int_pixel_buffer == null)
- int_pixel_buffer = new int[this.width * this.height];
-
- if (byte_pixel_buffer == null)
- byte_pixel_buffer = new byte[this.width * this.height];
- }
-
- /**
- * Our <code>ImageProducer</code> may call this method to send us a
- * list of its image's properties.
- *
- * setProperties is an ImageConsumer method. None of PixelGrabber's
- * ImageConsumer methods should be called by code that instantiates
- * a PixelGrabber. They are only made public so they can be called
- * by the PixelGrabber's ImageProducer.
- *
- * @param props a list of properties associated with the image being
- * produced
- */
- public synchronized void setProperties(Hashtable props)
- {
- this.props = props;
- }
-
- /**
- * Our ImageProducer will call <code>setColorModel</code> to
- * indicate the model used by the majority of calls to
- * <code>setPixels</code>. Each call to <code>setPixels</code>
- * could however indicate a different <code>ColorModel</code>.
- *
- * setColorModel is an ImageConsumer method. None of PixelGrabber's
- * ImageConsumer methods should be called by code that instantiates
- * a PixelGrabber. They are only made public so they can be called
- * by the PixelGrabber's ImageProducer.
- *
- * @param model the color model to be used most often by setPixels
- *
- * @see ColorModel
- */
- public synchronized void setColorModel(ColorModel model)
- {
- this.model = model;
- }
-
- /**
- * Our <code>ImageProducer</code> may call this method with a
- * bit mask of hints from any of <code>RANDOMPIXELORDER</code>,
- * <code>TOPDOWNLEFTRIGHT</code>, <code>COMPLETESCANLINES</code>,
- * <code>SINGLEPASS</code>, <code>SINGLEFRAME</code>.
- *
- * setHints is an ImageConsumer method. None of PixelGrabber's
- * ImageConsumer methods should be called by code that instantiates
- * a PixelGrabber. They are only made public so they can be called
- * by the PixelGrabber's ImageProducer.
- *
- * @param flags a bit mask of hints
- */
- public synchronized void setHints(int flags)
- {
- hints = flags;
- }
-
- /**
- * Our ImageProducer calls setPixels to deliver a subset of its
- * pixels.
- *
- * Each element of the pixels array represents one pixel. The
- * pixel data is formatted according to the color model model.
- * The x and y parameters are the coordinates of the rectangular
- * region of pixels being delivered to this ImageConsumer,
- * specified relative to the top left corner of the image being
- * produced. Likewise, w and h are the pixel region's dimensions.
- *
- * @param x x coordinate of pixel block
- * @param y y coordinate of pixel block
- * @param w width of pixel block
- * @param h height of pixel block
- * @param model color model used to interpret pixel data
- * @param pixels pixel block data
- * @param offset offset into pixels array
- * @param scansize width of one row in the pixel block
- */
- public synchronized void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels,
- int offset, int scansize)
- {
- ColorModel currentModel;
- if (model != null)
- currentModel = model;
- else
- currentModel = this.model;
-
- for(int yp = y; yp < (y + h); yp++)
- {
- for(int xp = x; xp < (x + w); xp++)
- {
- // Check if the coordinates (xp, yp) are within the
- // pixel block that we are grabbing.
- if(xp >= this.x
- && yp >= this.y
- && xp < (this.x + this.width)
- && yp < (this.y + this.height))
- {
- int i = (yp - this.y) * this.scansize + (xp - this.x) + this.offset;
- int p = (yp - y) * scansize + (xp - x) + offset;
- if (forceRGB)
- {
- ints_delivered = true;
-
- assert (i >= 0 && i < int_pixel_buffer.length);
- assert (p >= 0 && p < pixels.length);
- int_pixel_buffer[i] = currentModel.getRGB (pixels[p] & 0xFF);
- }
- else
- {
- bytes_delivered = true;
-
- assert (i >= 0 && i < byte_pixel_buffer.length);
- assert (p >= 0 && p < pixels.length);
- byte_pixel_buffer[i] = pixels[p];
- }
- }
- }
- }
- }
-
- /**
- * Our ImageProducer calls setPixels to deliver a subset of its
- * pixels.
- *
- * Each element of the pixels array represents one pixel. The
- * pixel data is formatted according to the color model model.
- * The x and y parameters are the coordinates of the rectangular
- * region of pixels being delivered to this ImageConsumer,
- * specified relative to the top left corner of the image being
- * produced. Likewise, w and h are the pixel region's dimensions.
- *
- * @param x x coordinate of pixel block
- * @param y y coordinate of pixel block
- * @param w width of pixel block
- * @param h height of pixel block
- * @param model color model used to interpret pixel data
- * @param pixels pixel block data
- * @param offset offset into pixels array
- * @param scansize width of one row in the pixel block
- */
- public synchronized void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels,
- int offset, int scansize)
- {
- ColorModel currentModel;
- if (model != null)
- currentModel = model;
- else
- currentModel = this.model;
-
- ints_delivered = true;
-
- for(int yp = y; yp < (y + h); yp++)
- {
- for(int xp = x; xp < (x + w); xp++)
- {
- // Check if the coordinates (xp, yp) are within the
- // pixel block that we are grabbing.
- if(xp >= this.x
- && yp >= this.y
- && xp < (this.x + this.width)
- && yp < (this.y + this.height))
- {
- int i = (yp - this.y) * this.scansize + (xp - this.x) + this.offset;
- int p = (yp - y) * scansize + (xp - x) + offset;
- assert (i >= 0 && i < int_pixel_buffer.length);
- assert (p >= 0 && p < pixels.length);
- if (forceRGB)
- int_pixel_buffer[i] = currentModel.getRGB (pixels[p]);
- else
- int_pixel_buffer[i] = pixels[p];
- }
- }
- }
- }
-
- /**
- * Our <code>ImageProducer</code> calls this method to inform us
- * that a single frame or the entire image is complete. The method
- * is also used to inform us of an error in loading or producing the
- * image.
- *
- * @param status the status of image production, represented by a
- * bitwise OR of ImageConsumer flags
- */
- public synchronized void imageComplete(int status)
- {
- consumerStatus = status;
- setObserverStatus ();
- grabbing = false;
- ip.removeConsumer (this);
-
- notifyAll ();
- }
-
- /**
- * @return the return value of getStatus
- *
- * @specnote The newer getStatus should be used in place of status.
- */
- public synchronized int status()
- {
- return getStatus();
- }
-}
diff --git a/libjava/java/awt/image/PixelInterleavedSampleModel.java b/libjava/java/awt/image/PixelInterleavedSampleModel.java
deleted file mode 100644
index 4c5c436edfc..00000000000
--- a/libjava/java/awt/image/PixelInterleavedSampleModel.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* PixelInterleavedSampleModel.java
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-
-/**
- * A <code>SampleModel</code> that uses exactly one element of the
- * raster&#x2019;s {@link DataBuffer} per pixel, holds all bands in a
- * single bank, and stores band data in pixel-interleaved manner.
- *
- * @since 1.2
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class PixelInterleavedSampleModel
- extends ComponentSampleModel
-{
- public PixelInterleavedSampleModel(int dataType, int width, int height,
- int pixelStride, int scanlineStride,
- int[] bandOffsets)
- {
- super(dataType, width, height, pixelStride, scanlineStride,
- bandOffsets);
- }
-
-
- /**
- * Creates a new <code>SampleModel</code> that is like this one, but
- * uses the specified width and height.
- *
- * @param width the number of pixels in the horizontal direction.
- *
- * @param height the number of pixels in the vertical direction.
- */
- public SampleModel createCompatibleSampleModel(int width, int height)
- {
- return new PixelInterleavedSampleModel(dataType, width, height,
- pixelStride, scanlineStride,
- bandOffsets);
- }
-
-
- /**
- * Creates a new <code>SampleModel</code> that is like this one, but
- * uses only a subset of its bands.
- *
- * @param bands an array whose elements indicate which bands shall
- * be part of the subset. For example, <code>[0, 2, 3]</code> would
- * create a SampleModel containing bands #0, #2 and #3.
- */
- public SampleModel createSubsetSampleModel(int[] bands)
- {
- int[] subOffsets;
-
- subOffsets = new int[bands.length];
- for (int i = 0; i < bands.length; i++)
- subOffsets[i] = bandOffsets[bands[i]];
-
- return new PixelInterleavedSampleModel(dataType, width, height,
- pixelStride, scanlineStride,
- subOffsets);
- }
-}
diff --git a/libjava/java/awt/image/RGBImageFilter.java b/libjava/java/awt/image/RGBImageFilter.java
deleted file mode 100644
index f55ebd1f99e..00000000000
--- a/libjava/java/awt/image/RGBImageFilter.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/* RGBImageFilter.java -- Java class for filtering Pixels by RGB values
- Copyright (C) 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * A filter designed to filter images in the default RGBColorModel regardless of
- * the ImageProducer's ColorModel.
- *
- * @author Mark Benvenuto (mcb54@columbia.edu)
- */
-public abstract class RGBImageFilter extends ImageFilter
-{
- protected ColorModel origmodel;
-
- protected ColorModel newmodel;
-
- /**
- Specifies whether to apply the filter to the index entries of the
- IndexColorModel. Subclasses should set this to true if the filter
- does not depend on the pixel's coordinate.
- */
- protected boolean canFilterIndexColorModel = false;
-
- /**
- Construct new RGBImageFilter.
- */
- public RGBImageFilter()
- {
- }
-
- /**
- * Sets the ColorModel used to filter with. If the specified ColorModel is IndexColorModel
- * and canFilterIndexColorModel is true, we subsitute the ColorModel for a filtered one
- * here and in setPixels whenever the original one appears. Otherwise overrides the default
- * ColorModel of ImageProducer and specifies the default RGBColorModel
- *
- * @param model the color model to be used most often by setPixels
- * @see ColorModel */
- public void setColorModel(ColorModel model)
- {
- origmodel = model;
- newmodel = model;
-
- if( ( model instanceof IndexColorModel) && canFilterIndexColorModel ) {
- newmodel = filterIndexColorModel( (IndexColorModel) model );
- consumer.setColorModel(newmodel);
- }
- else {
- consumer.setColorModel(ColorModel.getRGBdefault());
- }
- }
-
- /**
- Registers a new ColorModel to subsitute for the old ColorModel when
- setPixels encounters the a pixel with the old ColorModel. The pixel
- remains unchanged except for a new ColorModel.
-
- @param oldcm the old ColorModel
- @param newcm the new ColorModel
- */
- public void substituteColorModel(ColorModel oldcm,
- ColorModel newcm)
- {
- origmodel = oldcm;
- newmodel = newcm;
- }
-
- /**
- Filters an IndexColorModel through the filterRGB function. Uses
- coordinates of -1 to indicate its filtering an index and not a pixel.
-
- @param icm an IndexColorModel to filter
- */
- public IndexColorModel filterIndexColorModel(IndexColorModel icm)
- {
- int len = icm.getMapSize(), rgb;
- byte reds[] = new byte[len], greens[] = new byte[len], blues[] = new byte[len], alphas[] = new byte[len];
-
- icm.getAlphas( alphas );
- icm.getReds( reds );
- icm.getGreens( greens );
- icm.getBlues( blues );
-
- for( int i = 0; i < len; i++ )
- {
- rgb = filterRGB( -1, -1, makeColor ( alphas[i], reds[i], greens[i], blues[i] ) );
- alphas[i] = (byte)(( 0xff000000 & rgb ) >> 24);
- reds[i] = (byte)(( 0xff0000 & rgb ) >> 16);
- greens[i] = (byte)(( 0xff00 & rgb ) >> 8);
- blues[i] = (byte)(0xff & rgb);
- }
- return new IndexColorModel( icm.getPixelSize(), len, reds, greens, blues, alphas );
- }
-
- private int makeColor( byte a, byte r, byte g, byte b )
- {
- return ( 0xff000000 & (a << 24) | 0xff0000 & (r << 16) | 0xff00 & (g << 8) | 0xff & b );
- }
-
- /**
- This functions filters a set of RGB pixels through filterRGB.
-
- @param x the x coordinate of the rectangle
- @param y the y coordinate of the rectangle
- @param w the width of the rectangle
- @param h the height of the rectangle
- @param pixels the array of pixel values
- @param offset the index of the first pixels in the <code>pixels</code> array
- @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void filterRGBPixels(int x, int y, int w, int h, int[] pixels,
- int offset, int scansize)
- {
- for (int xp = x; xp < (x + w); xp++)
- for (int yp = y; yp < (y + h); yp++)
- {
- pixels[offset] = filterRGB(xp, yp, pixels[offset]);
- offset++;
- }
- }
-
-
- /**
- * If the ColorModel is the same ColorModel which as already converted
- * then it converts it the converted ColorModel. Otherwise it passes the
- * array of pixels through filterRGBpixels.
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels,
- int offset, int scansize)
- {
- if(model == origmodel && (model instanceof IndexColorModel) && canFilterIndexColorModel)
- {
- consumer.setPixels(x, y, w, h, newmodel, pixels, offset, scansize);
- }
- else
- {
- int intPixels[] =
- convertColorModelToDefault( x, y, w, h, model, pixels, offset, scansize );
- filterRGBPixels( x, y, w, h, intPixels, offset, scansize );
- consumer.setPixels(x, y, w, h, ColorModel.getRGBdefault(), intPixels, offset, scansize);
- }
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as an <code>int</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels,
- int offset, int scansize)
- {
- if(model == origmodel && (model instanceof IndexColorModel) && canFilterIndexColorModel)
- {
- consumer.setPixels(x, y, w, h, newmodel, pixels, offset, scansize);
- }
- else
- {
- //FIXME: Store the filtered pixels in a separate temporary buffer?
- convertColorModelToDefault( x, y, w, h, model, pixels, offset, scansize );
- filterRGBPixels( x, y, w, h, pixels, offset, scansize );
- consumer.setPixels(x, y, w, h, ColorModel.getRGBdefault(), pixels, offset, scansize);
- }
- }
-
- private int[] convertColorModelToDefault(int x, int y, int w, int h,
- ColorModel model, byte pixels[],
- int offset, int scansize)
- {
- int intPixels[] = new int[pixels.length];
- for (int i = 0; i < pixels.length; i++)
- intPixels[i] = makeColorbyDefaultCM(model, pixels[i]);
- return intPixels;
- }
-
- private void convertColorModelToDefault(int x, int y, int w, int h,
- ColorModel model, int pixels[],
- int offset, int scansize)
- {
- for (int i = 0; i < pixels.length; i++)
- pixels[i] = makeColorbyDefaultCM(model, pixels[i]);
- }
-
- private int makeColorbyDefaultCM(ColorModel model, byte rgb)
- {
- return makeColor( model.getAlpha( rgb ) * 4, model.getRed( rgb ) * 4, model.getGreen( rgb ) * 4, model.getBlue( rgb ) * 4 );
- }
-
- private int makeColorbyDefaultCM(ColorModel model, int rgb)
- {
- return makeColor( model.getAlpha( rgb ), model.getRed( rgb ), model.getGreen( rgb ), model.getBlue( rgb ) );
- }
-
- private int makeColor( int a, int r, int g, int b )
- {
- return (int)( 0xff000000 & (a << 24) | 0xff0000 & (r << 16) | 0xff00 & (g << 8) | 0xff & b );
- }
-
-
- /**
- Filters a single pixel from the default ColorModel.
-
- @param x x-coordinate
- @param y y-coordinate
- @param rgb color
- */
- public abstract int filterRGB(int x,
- int y,
- int rgb);
-}
diff --git a/libjava/java/awt/image/Raster.java b/libjava/java/awt/image/Raster.java
deleted file mode 100644
index 4af958a17c7..00000000000
--- a/libjava/java/awt/image/Raster.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/* Copyright (C) 2000, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Point;
-import java.awt.Rectangle;
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public class Raster
-{
- protected SampleModel sampleModel;
- protected DataBuffer dataBuffer;
- protected int minX;
- protected int minY;
- protected int width;
- protected int height;
- protected int sampleModelTranslateX;
- protected int sampleModelTranslateY;
- protected int numBands;
- protected int numDataElements;
- protected Raster parent;
-
- protected Raster(SampleModel sampleModel, Point origin)
- {
- this(sampleModel, sampleModel.createDataBuffer(), origin);
- }
-
- protected Raster(SampleModel sampleModel, DataBuffer dataBuffer,
- Point origin)
- {
- this(sampleModel, dataBuffer,
- new Rectangle(origin.x, origin.y,
- sampleModel.getWidth(), sampleModel.getHeight()),
- origin, null);
- }
-
- protected Raster(SampleModel sampleModel, DataBuffer dataBuffer,
- Rectangle aRegion,
- Point sampleModelTranslate, Raster parent)
- {
- this.sampleModel = sampleModel;
- this.dataBuffer = dataBuffer;
- this.minX = aRegion.x;
- this.minY = aRegion.y;
- this.width = aRegion.width;
- this.height = aRegion.height;
-
- // If sampleModelTranslate is null, use (0,0). Methods such as
- // Raster.createRaster are specified to allow for a null argument.
- if (sampleModelTranslate != null)
- {
- this.sampleModelTranslateX = sampleModelTranslate.x;
- this.sampleModelTranslateY = sampleModelTranslate.y;
- }
-
- this.numBands = sampleModel.getNumBands();
- this.numDataElements = sampleModel.getNumDataElements();
- this.parent = parent;
- }
-
- public static WritableRaster createInterleavedRaster(int dataType,
- int w, int h,
- int bands,
- Point location)
- {
- int[] bandOffsets = new int[bands];
- // TODO: Maybe not generate this every time.
- for (int b=0; b<bands; b++) bandOffsets[b] = b;
-
- int scanlineStride = bands*w;
- return createInterleavedRaster(dataType, w, h, scanlineStride, bands,
- bandOffsets, location);
- }
-
- public static WritableRaster createInterleavedRaster(int dataType,
- int w, int h,
- int scanlineStride,
- int pixelStride,
- int[] bandOffsets,
- Point location)
- {
- SampleModel sm = new ComponentSampleModel(dataType,
- w, h,
- pixelStride,
- scanlineStride,
- bandOffsets);
- return createWritableRaster(sm, location);
- }
-
- public static WritableRaster createBandedRaster(int dataType,
- int w, int h, int bands,
- Point location)
- {
- SampleModel sm = new BandedSampleModel(dataType, w, h, bands);
- return createWritableRaster(sm, location);
- }
-
- public static WritableRaster createBandedRaster(int dataType,
- int w, int h,
- int scanlineStride,
- int[] bankIndices,
- int[] bandOffsets,
- Point location)
- {
- SampleModel sm = new BandedSampleModel(dataType, w, h, scanlineStride,
- bankIndices, bandOffsets);
- return createWritableRaster(sm, location);
- }
-
- public static WritableRaster createPackedRaster(int dataType,
- int w, int h,
- int[] bandMasks,
- Point location)
- {
- SampleModel sm = new SinglePixelPackedSampleModel(dataType,
- w, h,
- bandMasks);
- return createWritableRaster(sm, location);
- }
-
- public static WritableRaster createPackedRaster(int dataType,
- int w, int h,
- int bands, int bitsPerBand,
- Point location)
- {
- if (bands <= 0 || (bands * bitsPerBand > getTypeBits(dataType)))
- throw new IllegalArgumentException();
-
- SampleModel sm;
-
- if (bands == 1)
- sm = new MultiPixelPackedSampleModel(dataType, w, h, bitsPerBand);
- else
- {
- int[] bandMasks = new int[bands];
- int mask = 0x1;
- for (int bits = bitsPerBand; --bits != 0;)
- mask = (mask << 1) | 0x1;
- for (int i = 0; i < bands; i++)
- {
- bandMasks[i] = mask;
- mask <<= bitsPerBand;
- }
-
- sm = new SinglePixelPackedSampleModel(dataType, w, h, bandMasks);
- }
- return createWritableRaster(sm, location);
- }
-
- public static WritableRaster
- createInterleavedRaster(DataBuffer dataBuffer, int w, int h,
- int scanlineStride, int pixelStride,
- int[] bandOffsets, Point location)
- {
- SampleModel sm = new ComponentSampleModel(dataBuffer.getDataType(),
- w, h,
- scanlineStride,
- pixelStride,
- bandOffsets);
- return createWritableRaster(sm, dataBuffer, location);
- }
-
- public static
- WritableRaster createBandedRaster(DataBuffer dataBuffer,
- int w, int h,
- int scanlineStride,
- int[] bankIndices,
- int[] bandOffsets,
- Point location)
- {
- SampleModel sm = new BandedSampleModel(dataBuffer.getDataType(),
- w, h, scanlineStride,
- bankIndices, bandOffsets);
- return createWritableRaster(sm, dataBuffer, location);
- }
-
- public static WritableRaster
- createPackedRaster(DataBuffer dataBuffer,
- int w, int h,
- int scanlineStride,
- int[] bandMasks,
- Point location)
- {
- SampleModel sm =
- new SinglePixelPackedSampleModel(dataBuffer.getDataType(),
- w, h,
- scanlineStride,
- bandMasks);
- return createWritableRaster(sm, dataBuffer, location);
- }
-
- public static WritableRaster
- createPackedRaster(DataBuffer dataBuffer,
- int w, int h,
- int bitsPerPixel,
- Point location)
- {
- SampleModel sm =
- new MultiPixelPackedSampleModel(dataBuffer.getDataType(),
- w, h,
- bitsPerPixel);
- return createWritableRaster(sm, dataBuffer, location);
- }
-
- public static Raster createRaster(SampleModel sm, DataBuffer db,
- Point location)
- {
- return new Raster(sm, db, location);
- }
-
- public static WritableRaster createWritableRaster(SampleModel sm,
- Point location)
- {
- return new WritableRaster(sm, location);
- }
-
- public static WritableRaster createWritableRaster(SampleModel sm,
- DataBuffer db,
- Point location)
- {
- return new WritableRaster(sm, db, location);
- }
-
- public Raster getParent()
- {
- return parent;
- }
-
- public final int getSampleModelTranslateX()
- {
- return sampleModelTranslateX;
- }
-
- public final int getSampleModelTranslateY()
- {
- return sampleModelTranslateY;
- }
-
- public WritableRaster createCompatibleWritableRaster()
- {
- return new WritableRaster(getSampleModel(), new Point(minX, minY));
- }
-
- public WritableRaster createCompatibleWritableRaster(int w, int h)
- {
- return createCompatibleWritableRaster(minX, minY, w, h);
- }
-
- public WritableRaster createCompatibleWritableRaster(Rectangle rect)
- {
- return createCompatibleWritableRaster(rect.x, rect.y,
- rect.width, rect.height);
- }
-
- public WritableRaster createCompatibleWritableRaster(int x, int y,
- int w, int h)
- {
- SampleModel sm = getSampleModel().createCompatibleSampleModel(w, h);
- return new WritableRaster(sm, sm.createDataBuffer(),
- new Point(x, y));
- }
-
- public Raster createTranslatedChild(int childMinX, int childMinY) {
- int tcx = sampleModelTranslateX - minX + childMinX;
- int tcy = sampleModelTranslateY - minY + childMinY;
-
- return new Raster(sampleModel, dataBuffer,
- new Rectangle(childMinX, childMinY,
- width, height),
- new Point(tcx, tcy),
- this);
- }
-
- public Raster createChild(int parentX, int parentY, int width,
- int height, int childMinX, int childMinY,
- int[] bandList)
- {
- /* FIXME: Throw RasterFormatException if child bounds extends
- beyond the bounds of this raster. */
-
- SampleModel sm = (bandList == null) ?
- sampleModel :
- sampleModel.createSubsetSampleModel(bandList);
-
- /*
- data origin
- /
- +-------------------------
- |\. __ parent trans
- | \`.
- | \ `. parent origin
- | \ `. /
- | /\ +-------- - -
- |trans\ /<\-- deltaTrans
- |child +-+-\---- - -
- | /|`| \__ parent [x, y]
- |child | |`. \
- |origin| : `.\
- | | / `\
- | : / +
- | child [x, y]
-
- parent_xy - parent_trans = child_xy - child_trans
-
- child_trans = parent_trans + child_xy - parent_xy
- */
-
- return new Raster(sm, dataBuffer,
- new Rectangle(childMinX, childMinY,
- width, height),
- new Point(sampleModelTranslateX+childMinX-parentX,
- sampleModelTranslateY+childMinY-parentY),
- this);
- }
-
- public Rectangle getBounds()
- {
- return new Rectangle(minX, minY, width, height);
- }
-
- public final int getMinX()
- {
- return minX;
- }
-
- public final int getMinY()
- {
- return minY;
- }
-
- public final int getWidth()
- {
- return width;
- }
-
- public final int getHeight()
- {
- return height;
- }
-
- public final int getNumBands()
- {
- return numBands;
- }
-
- public final int getNumDataElements()
- {
- return numDataElements;
- }
-
- public final int getTransferType()
- {
- return sampleModel.getTransferType();
- }
-
- public DataBuffer getDataBuffer()
- {
- return dataBuffer;
- }
-
- public SampleModel getSampleModel()
- {
- return sampleModel;
- }
-
- public Object getDataElements(int x, int y, Object outData)
- {
- return sampleModel.getDataElements(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- outData, dataBuffer);
- }
-
- public Object getDataElements(int x, int y, int w, int h,
- Object outData)
- {
- return sampleModel.getDataElements(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, outData, dataBuffer);
- }
-
- public int[] getPixel(int x, int y, int[] iArray)
- {
- return sampleModel.getPixel(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- iArray, dataBuffer);
- }
-
- public float[] getPixel(int x, int y, float[] fArray)
- {
- return sampleModel.getPixel(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- fArray, dataBuffer);
- }
-
- public double[] getPixel(int x, int y, double[] dArray)
- {
- return sampleModel.getPixel(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- dArray, dataBuffer);
- }
-
- public int[] getPixels(int x, int y, int w, int h, int[] iArray)
- {
- return sampleModel.getPixels(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, iArray, dataBuffer);
- }
-
- public float[] getPixels(int x, int y, int w, int h,
- float[] fArray)
- {
- return sampleModel.getPixels(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, fArray, dataBuffer);
- }
-
- public double[] getPixels(int x, int y, int w, int h,
- double[] dArray)
- {
- return sampleModel.getPixels(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, dArray, dataBuffer);
- }
-
- public int getSample(int x, int y, int b)
- {
- return sampleModel.getSample(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- b, dataBuffer);
- }
-
- public float getSampleFloat(int x, int y, int b)
- {
- return sampleModel.getSampleFloat(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- b, dataBuffer);
- }
-
- public double getSampleDouble(int x, int y, int b)
- {
- return sampleModel.getSampleDouble(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- b, dataBuffer);
- }
-
- public int[] getSamples(int x, int y, int w, int h, int b,
- int[] iArray)
- {
- return sampleModel.getSamples(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, b, iArray, dataBuffer);
- }
-
- public float[] getSamples(int x, int y, int w, int h, int b,
- float[] fArray)
- {
- return sampleModel.getSamples(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, b, fArray, dataBuffer);
- }
-
- public double[] getSamples(int x, int y, int w, int h, int b,
- double[] dArray)
- {
- return sampleModel.getSamples(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, b, dArray, dataBuffer);
- }
-
- /**
- * Create a String representing the stat of this Raster.
- * @return A String representing the stat of this Raster.
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- StringBuffer result = new StringBuffer();
-
- result.append(getClass().getName());
- result.append("[(");
- result.append(minX).append(",").append(minY).append("), ");
- result.append(width).append(" x ").append(height).append(",");
- result.append(sampleModel).append(",");
- result.append(dataBuffer);
- result.append("]");
-
- return result.toString();
- }
-
- // Map from datatype to bits
- private static int getTypeBits(int dataType)
- {
- switch (dataType)
- {
- case DataBuffer.TYPE_BYTE:
- return 8;
- case DataBuffer.TYPE_USHORT:
- case DataBuffer.TYPE_SHORT:
- return 16;
- case DataBuffer.TYPE_INT:
- case DataBuffer.TYPE_FLOAT:
- return 32;
- case DataBuffer.TYPE_DOUBLE:
- return 64;
- default:
- return 0;
- }
- }
-}
diff --git a/libjava/java/awt/image/RasterFormatException.java b/libjava/java/awt/image/RasterFormatException.java
deleted file mode 100644
index 582c2ae5ab2..00000000000
--- a/libjava/java/awt/image/RasterFormatException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* RasterFormatException.java -- indicates invalid layout in Raster
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * This exception is thrown when there is invalid layout information in
- * <code>Raster</code>
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Raster
- * @status updated to 1.4
- */
-public class RasterFormatException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 96598996116164315L;
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public RasterFormatException(String message)
- {
- super(message);
- }
-} // class RasterFormatException
diff --git a/libjava/java/awt/image/RasterOp.java b/libjava/java/awt/image/RasterOp.java
deleted file mode 100644
index e081ca3d2ad..00000000000
--- a/libjava/java/awt/image/RasterOp.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* RasterOp.java --
- Copyright (C) 2000, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.RenderingHints;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-
-public interface RasterOp
-{
- WritableRaster filter(Raster src, WritableRaster dest);
-
- Rectangle2D getBounds2D(Raster src);
-
- WritableRaster createCompatibleDestRaster(Raster src);
-
- Point2D getPoint2D(Point2D srcPoint, Point2D destPoint);
-
- RenderingHints getRenderingHints();
-}
-
diff --git a/libjava/java/awt/image/RenderedImage.java b/libjava/java/awt/image/RenderedImage.java
deleted file mode 100644
index b35f8602129..00000000000
--- a/libjava/java/awt/image/RenderedImage.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* RenderedImage.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Rectangle;
-import java.util.Vector;
-
-/**
- * NEEDS DOCUMENTATION
- */
-public interface RenderedImage
-{
- Vector getSources();
- Object getProperty(String name);
- String[] getPropertyNames();
- ColorModel getColorModel();
- SampleModel getSampleModel();
- int getWidth();
- int getHeight();
- int getMinX();
- int getMinY();
- int getNumXTiles();
- int getNumYTiles();
- int getMinTileX();
- int getMinTileY();
- int getTileWidth();
- int getTileHeight();
- int getTileGridXOffset();
- int getTileGridYOffset();
- Raster getTile(int x, int y);
- Raster getData();
- Raster getData(Rectangle r);
- WritableRaster copyData(WritableRaster raster);
-} // interface RenderedImage
diff --git a/libjava/java/awt/image/ReplicateScaleFilter.java b/libjava/java/awt/image/ReplicateScaleFilter.java
deleted file mode 100644
index 3841e49d538..00000000000
--- a/libjava/java/awt/image/ReplicateScaleFilter.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/* ReplicateScaleFilter.java -- Java class for filtering images
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.util.Hashtable;
-
-/**
- * This filter should be used for fast scaling of images where the result
- * does not need to ensure straight lines are still straight, etc. The
- * exact method is not defined by Sun but some sort of fast Box filter should
- * probably be correct.
- * <br>
- * Currently this filter does nothing and needs to be implemented.
- *
- * @author C. Brian Jones (cbj@gnu.org)
- */
-public class ReplicateScaleFilter extends ImageFilter
-{
- public ReplicateScaleFilter(int width, int height) {
- destHeight = height;
- destWidth = width;
- }
-
- /**
- * The height of the destination image.
- */
- protected int destHeight;
-
- /**
- * The width of the destination image.
- */
- protected int destWidth;
-
- /**
- * The height of the source image.
- */
- protected int srcHeight;
-
- /**
- * The width of the source image.
- */
- protected int srcWidth;
-
- /**
- *
- */
- protected int srcrows[];
-
- /**
- *
- */
- protected int srccols[];
-
- /**
- *
- */
- protected Object outpixbuf;
-
- /**
- * An <code>ImageProducer</code> indicates the size of the image
- * being produced using this method. A filter can override this
- * method to intercept these calls from the producer in order to
- * change either the width or the height before in turn calling
- * the consumer's <code>setDimensions</code> method.
- *
- * @param width the width of the image
- * @param height the height of the image
- */
- public void setDimensions(int width, int height)
- {
- srcWidth = width;
- srcHeight = height;
-
- /* If either destHeight or destWidth is < 0, the image should
- maintain its original aspect ratio. When both are < 0,
- just maintain the original width and height. */
- if (destWidth < 0 && destHeight < 0)
- {
- destWidth = width;
- destHeight = height;
- }
- else if (destWidth < 0)
- {
- destWidth = (int) (width * ((double) destHeight / srcHeight));
- }
- else if (destHeight < 0)
- {
- destHeight = (int) (height * ((double) destWidth / srcWidth));
- }
-
- consumer.setDimensions(destWidth, destHeight);
- }
-
- /**
- * An <code>ImageProducer</code> can set a list of properties
- * associated with this image by using this method.
- *
- * @param props the list of properties associated with this image
- */
- public void setProperties(Hashtable props)
- {
- props.put("filters", "ReplicateScaleFilter");
- consumer.setProperties(props);
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as a <code>byte</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels, int offset, int scansize)
- {
- double rx = ((double) srcWidth) / destWidth;
- double ry = ((double) srcHeight) / destHeight;
-
- int destScansize = (int) Math.round(scansize / rx);
-
- byte[] destPixels = replicatePixels(x, y, w, h,
- model, pixels, offset, scansize,
- rx, ry, destScansize);
-
- consumer.setPixels((int) Math.floor(x/rx), (int) Math.floor(y/ry),
- (int) Math.ceil(w/rx), (int) Math.ceil(h/ry),
- model, destPixels, 0, destScansize);
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as an <code>int</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels, int offset, int scansize)
- {
- double rx = ((double) srcWidth) / destWidth;
- double ry = ((double) srcHeight) / destHeight;
-
- int destScansize = (int) Math.round(scansize / rx);
-
- int[] destPixels = replicatePixels(x, y, w, h,
- model, pixels, offset, scansize,
- rx, ry, destScansize);
-
- consumer.setPixels((int) Math.floor(x/rx), (int) Math.floor(y/ry),
- (int) Math.ceil(w/rx), (int) Math.ceil(h/ry),
- model, destPixels, 0, destScansize);
- }
-
- private byte[] replicatePixels(int srcx, int srcy, int srcw, int srch,
- ColorModel model, byte[] srcPixels,
- int srcOffset, int srcScansize,
- double rx, double ry, int destScansize)
- {
- byte[] destPixels =
- new byte[(int) Math.ceil(srcw/rx) * (int) Math.ceil(srch/ry)];
-
- int a, b;
- for (int i = 0; i < destPixels.length; i++)
- {
- a = (int) ((int) ( ((double) i) / destScansize) * ry) * srcScansize;
- b = (int) ((i % destScansize) * rx);
- if ((a + b + srcOffset) < srcPixels.length)
- destPixels[i] = srcPixels[a + b + srcOffset];
- }
-
- return destPixels;
- }
-
- private int[] replicatePixels(int srcx, int srcy, int srcw, int srch,
- ColorModel model, int[] srcPixels,
- int srcOffset, int srcScansize,
- double rx, double ry, int destScansize)
- {
- int[] destPixels =
- new int[(int) Math.ceil(srcw/rx) * (int) Math.ceil(srch/ry)];
-
- int a, b;
- for (int i = 0; i < destPixels.length; i++)
- {
- a = (int) ((int) ( ((double) i) / destScansize) * ry) * srcScansize;
- b = (int) ((i % destScansize) * rx);
- if ((a + b + srcOffset) < srcPixels.length)
- destPixels[i] = srcPixels[a + b + srcOffset];
- }
-
- return destPixels;
- }
-}
-
diff --git a/libjava/java/awt/image/RescaleOp.java b/libjava/java/awt/image/RescaleOp.java
deleted file mode 100644
index 35b42f79ccd..00000000000
--- a/libjava/java/awt/image/RescaleOp.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/* Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.RenderingHints;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.util.Arrays;
-
-/**
- * @author Jerry Quinn (jlquinn@optonline.net)
- */
-public class RescaleOp implements BufferedImageOp, RasterOp
-{
- private float[] scale;
- private float[] offsets;
- private RenderingHints hints = null;
-
- public RescaleOp(float[] scaleFactors,
- float[] offsets,
- RenderingHints hints)
- {
- this.scale = scaleFactors;
- this.offsets = offsets;
- this.hints = hints;
- }
-
- public RescaleOp(float scaleFactor,
- float offset,
- RenderingHints hints)
- {
- scale = new float[]{ scaleFactor };
- offsets = new float[]{offset};
- this.hints = hints;
- }
-
- public final float[] getScaleFactors(float[] scaleFactors)
- {
- if (scaleFactors == null)
- scaleFactors = new float[scale.length];
- System.arraycopy(scale, 0, scaleFactors, 0, scale.length);
- return scaleFactors;
- }
-
- public final float[] getOffsets(float[] offsets)
- {
- if (offsets == null)
- offsets = new float[this.offsets.length];
- System.arraycopy(this.offsets, 0, offsets, 0, this.offsets.length);
- return offsets;
- }
-
- public final int getNumFactors()
- {
- return scale.length;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#getRenderingHints()
- */
- public RenderingHints getRenderingHints()
- {
- return hints;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#filter(java.awt.image.BufferedImage, java.awt.image.BufferedImage)
- */
- public final BufferedImage filter(BufferedImage src, BufferedImage dst)
- {
- // TODO Make sure premultiplied alpha is handled correctly.
- // TODO See that color conversion is handled.
- // TODO figure out how to use rendering hints.
- if (scale.length != offsets.length)
- throw new IllegalArgumentException();
-
- ColorModel scm = src.getColorModel();
- if (dst == null) dst = createCompatibleDestImage(src, null);
-
- WritableRaster wsrc = src.getRaster();
- WritableRaster wdst = dst.getRaster();
-
- // Share constant across colors except alpha
- if (scale.length == 1 || scale.length == scm.getNumColorComponents())
- {
- // Construct a raster that doesn't include an alpha band.
- int[] subbands = new int[scm.getNumColorComponents()];
- for (int i=0; i < subbands.length; i++) subbands[i] = i;
- wsrc =
- wsrc.createWritableChild(wsrc.minX, wsrc.minY, wsrc.width, wsrc.height,
- wsrc.minX, wsrc.minY, subbands);
- }
- // else all color bands
-
- filter(wsrc, wdst);
- return dst;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#filter(java.awt.image.Raster, java.awt.image.WritableRaster)
- */
- public final WritableRaster filter(Raster src, WritableRaster dest)
- {
- if (dest == null) dest = src.createCompatibleWritableRaster();
-
- // Required sanity checks
- if (src.numBands != dest.numBands || scale.length != offsets.length)
- throw new IllegalArgumentException();
- if (scale.length != 1 && scale.length != src.numBands)
- throw new IllegalArgumentException();
-
- // Create scaling arrays if needed
- float[] lscale = scale;
- float[] loff = offsets;
- if (scale.length == 1)
- {
- lscale = new float[src.numBands];
- Arrays.fill(lscale, scale[0]);
- loff = new float[src.numBands];
- Arrays.fill(loff, offsets[0]);
- }
-
- // TODO The efficiency here can be improved for various data storage
- // patterns, aka SampleModels.
- float[] pixel = new float[src.numBands];
- for (int y = src.minY; y < src.height + src.minY; y++)
- for (int x = src.minX; x < src.width + src.minX; x++)
- {
- src.getPixel(x, y, pixel);
- for (int b = 0; b < src.numBands; b++)
- pixel[b] = pixel[b] * lscale[b] + loff[b];
- dest.setPixel(x, y, pixel);
- }
- return dest;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#createCompatibleDestImage(java.awt.image.BufferedImage, java.awt.image.ColorModel)
- */
- public BufferedImage createCompatibleDestImage(BufferedImage src,
- ColorModel dstCM)
- {
- if (dstCM == null) dstCM = src.getColorModel();
- WritableRaster wr = src.getRaster().createCompatibleWritableRaster();
- BufferedImage image
- = new BufferedImage(dstCM, wr, src.isPremultiplied, null);
- return image;
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#createCompatibleDestRaster(java.awt.image.Raster)
- */
- public WritableRaster createCompatibleDestRaster(Raster src)
- {
- return src.createCompatibleWritableRaster();
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#getBounds2D(java.awt.image.BufferedImage)
- */
- public final Rectangle2D getBounds2D(BufferedImage src)
- {
- return src.getRaster().getBounds();
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#getBounds2D(java.awt.image.Raster)
- */
- public final Rectangle2D getBounds2D(Raster src)
- {
- return src.getBounds();
- }
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#getPoint2D(java.awt.geom.Point2D, java.awt.geom.Point2D)
- */
- public final Point2D getPoint2D(Point2D src, Point2D dst) {
- if (dst == null) dst = (Point2D) src.clone();
- else dst.setLocation(src);
- return dst;
- }
-
-}
diff --git a/libjava/java/awt/image/SampleModel.java b/libjava/java/awt/image/SampleModel.java
deleted file mode 100644
index 0c625291b64..00000000000
--- a/libjava/java/awt/image/SampleModel.java
+++ /dev/null
@@ -1,477 +0,0 @@
-/* Copyright (C) 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public abstract class SampleModel
-{
- /** Width of image described. */
- protected int width;
-
- /** Height of image described. */
- protected int height;
-
- /** Number of bands in the image described. */
- protected int numBands;
-
- /**
- * The DataBuffer type that is used to store the data of the image
- * described.
- */
- protected int dataType;
-
- public SampleModel(int dataType, int w, int h, int numBands)
- {
- if ((w <= 0) || (h <= 0))
- throw new IllegalArgumentException((w <= 0 ? " width<=0" : " width is ok")
- +(h <= 0 ? " height<=0" : " height is ok"));
-
- // FIXME: How can an int be greater than Integer.MAX_VALUE?
- // FIXME: How do we identify an unsupported data type?
-
- this.dataType = dataType;
- this.width = w;
- this.height = h;
- this.numBands = numBands;
- }
-
- public final int getWidth()
- {
- return width;
- }
-
- public final int getHeight()
- {
- return height;
- }
-
- public final int getNumBands()
- {
- return numBands;
- }
-
- public abstract int getNumDataElements();
-
- public final int getDataType()
- {
- return dataType;
- }
-
- public int getTransferType()
- {
- // FIXME: Is this a reasonable default implementation?
- return dataType;
- }
-
- public int[] getPixel(int x, int y, int[] iArray, DataBuffer data)
- {
- if (iArray == null) iArray = new int[numBands];
- for (int b=0; b<numBands; b++) iArray[b] = getSample(x, y, b, data);
- return iArray;
- }
-
- /**
- *
- * This method is provided as a faster alternative to getPixel(),
- * that can be used when there is no need to decode the pixel into
- * separate sample values.
- *
- * @param obj An array to return the pixel data in. If null, an
- * array of the right type and size will be created.
- *
- * @return A single pixel as an array object of a primitive type,
- * based on the transfer type. Eg. if transfer type is
- * DataBuffer.TYPE_USHORT, then a short[] object is returned.
- */
- public abstract Object getDataElements(int x, int y, Object obj,
- DataBuffer data);
-
-
- public Object getDataElements(int x, int y, int w, int h, Object obj,
- DataBuffer data)
- {
- int size = w*h;
- int numDataElements = getNumDataElements();
- int dataSize = numDataElements*size;
-
- if (obj == null)
- {
- switch (getTransferType())
- {
- case DataBuffer.TYPE_BYTE:
- obj = new byte[dataSize];
- break;
- case DataBuffer.TYPE_USHORT:
- obj = new short[dataSize];
- break;
- case DataBuffer.TYPE_INT:
- obj = new int[dataSize];
- break;
- default:
- // Seems like the only sensible thing to do.
- throw new ClassCastException();
- }
- }
- Object pixelData = null;
- int outOffset = 0;
- for (int yy = y; yy<(y+h); yy++)
- {
- for (int xx = x; xx<(x+w); xx++)
- {
- pixelData = getDataElements(xx, yy, pixelData, data);
- System.arraycopy(pixelData, 0, obj, outOffset,
- numDataElements);
- outOffset += numDataElements;
- }
- }
- return obj;
- }
-
- public abstract void setDataElements(int x, int y, Object obj,
- DataBuffer data);
-
- public void setDataElements(int x, int y, int w, int h,
- Object obj, DataBuffer data)
- {
- int size = w*h;
- int numDataElements = getNumDataElements();
- int dataSize = numDataElements*size;
-
- Object pixelData;
- switch (getTransferType())
- {
- case DataBuffer.TYPE_BYTE:
- pixelData = new byte[numDataElements];
- break;
- case DataBuffer.TYPE_USHORT:
- pixelData = new short[numDataElements];
- break;
- case DataBuffer.TYPE_INT:
- pixelData = new int[numDataElements];
- break;
- default:
- // Seems like the only sensible thing to do.
- throw new ClassCastException();
- }
- int inOffset = 0;
-
- for (int yy=y; yy<(y+h); yy++)
- {
- for (int xx=x; xx<(x+w); xx++)
- {
- System.arraycopy(obj, inOffset, pixelData, 0,
- numDataElements);
- setDataElements(xx, yy, pixelData, data);
- inOffset += numDataElements;
- }
- }
- }
-
- public float[] getPixel(int x, int y, float[] fArray, DataBuffer data)
- {
- if (fArray == null) fArray = new float[numBands];
-
- for (int b=0; b<numBands; b++)
- {
- fArray[b] = getSampleFloat(x, y, b, data);
- }
- return fArray;
- }
-
- public double[] getPixel(int x, int y, double[] dArray, DataBuffer data) {
- if (dArray == null) dArray = new double[numBands];
- for (int b=0; b<numBands; b++)
- {
- dArray[b] = getSampleDouble(x, y, b, data);
- }
- return dArray;
- }
-
- /* FIXME: Should it return a banded or pixel interleaved array of
- samples? (Assume interleaved.) */
- public int[] getPixels(int x, int y, int w, int h, int[] iArray,
- DataBuffer data)
- {
- int size = w*h;
- int outOffset = 0;
- int[] pixel = null;
- if (iArray == null) iArray = new int[w*h*numBands];
- for (int yy=y; yy<(y+h); yy++)
- {
- for (int xx=x; xx<(x+w); xx++)
- {
- getPixel(xx, yy, pixel, data);
- System.arraycopy(pixel, 0, iArray, outOffset, numBands);
- outOffset += numBands;
- }
- }
- return iArray;
- }
-
- /* FIXME: Should it return a banded or pixel interleaved array of
- samples? (Assume interleaved.) */
- public float[] getPixels(int x, int y, int w, int h, float[] fArray,
- DataBuffer data)
- {
- int size = w*h;
- int outOffset = 0;
- float[] pixel = null;
- if (fArray == null) fArray = new float[w*h*numBands];
- for (int yy=y; yy<(y+h); yy++)
- {
- for (int xx=x; xx<(x+w); xx++)
- {
- getPixel(xx, yy, pixel, data);
- System.arraycopy(pixel, 0, fArray, outOffset, numBands);
- outOffset += numBands;
- }
- }
- return fArray;
- }
-
- /* FIXME: Should it return a banded or pixel interleaved array of
- samples? (Assume interleaved.) */
- public double[] getPixels(int x, int y, int w, int h, double[] dArray,
- DataBuffer data)
- {
- int size = w*h;
- int outOffset = 0;
- double[] pixel = null;
- if (dArray == null) dArray = new double[w*h*numBands];
- for (int yy=y; yy<(y+h); yy++)
- {
- for (int xx=x; xx<(x+w); xx++)
- {
- getPixel(xx, yy, pixel, data);
- System.arraycopy(pixel, 0, dArray, outOffset, numBands);
- outOffset += numBands;
- }
- }
- return dArray;
- }
-
- public abstract int getSample(int x, int y, int b, DataBuffer data);
-
- public float getSampleFloat(int x, int y, int b, DataBuffer data)
- {
- return getSample(x, y, b, data);
- }
-
- public double getSampleDouble(int x, int y, int b, DataBuffer data)
- {
- return getSampleFloat(x, y, b, data);
- }
-
- public int[] getSamples(int x, int y, int w, int h, int b,
- int[] iArray, DataBuffer data)
- {
- int size = w*h;
- int outOffset = 0;
- if (iArray == null) iArray = new int[size];
- for (int yy=y; yy<(y+h); yy++)
- {
- for (int xx=x; xx<(x+w); xx++)
- {
- iArray[outOffset++] = getSample(xx, yy, b, data);
- }
- }
- return iArray;
- }
-
- public float[] getSamples(int x, int y, int w, int h, int b,
- float[] fArray, DataBuffer data)
- {
- int size = w*h;
- int outOffset = 0;
- if (fArray == null) fArray = new float[size];
- for (int yy=y; yy<(y+h); yy++)
- {
- for (int xx=x; xx<(x+w); xx++)
- {
- fArray[outOffset++] = getSampleFloat(xx, yy, b, data);
- }
- }
- return fArray;
- }
-
- public double[] getSamples(int x, int y, int w, int h, int b,
- double[] dArray, DataBuffer data)
- {
- int size = w*h;
- int outOffset = 0;
- if (dArray == null) dArray = new double[size];
- for (int yy=y; yy<(y+h); yy++)
- {
- for (int xx=x; xx<(x+w); xx++)
- {
- dArray[outOffset++] = getSampleDouble(xx, yy, b, data);
- }
- }
- return dArray;
- }
-
- public void setPixel(int x, int y, int[] iArray, DataBuffer data)
- {
- for (int b=0; b<numBands; b++) setSample(x, y, b, iArray[b], data);
- }
-
- public void setPixel(int x, int y, float[] fArray, DataBuffer data)
- {
- for (int b=0; b<numBands; b++) setSample(x, y, b, fArray[b], data);
- }
-
- public void setPixel(int x, int y, double[] dArray, DataBuffer data)
- {
- for (int b=0; b<numBands; b++) setSample(x, y, b, dArray[b], data);
- }
-
- public void setPixels(int x, int y, int w, int h, int[] iArray,
- DataBuffer data)
- {
- int inOffset = 0;
- int[] pixel = new int[numBands];
- for (int yy=y; yy<(y+h); yy++)
- {
- for (int xx=x; xx<(x+w); xx++)
- {
- System.arraycopy(iArray, inOffset, pixel, 0, numBands);
- setPixel(xx, yy, pixel, data);
- inOffset += numBands;
- }
- }
- }
-
- public void setPixels(int x, int y, int w, int h, float[] fArray,
- DataBuffer data)
- {
- int inOffset = 0;
- float[] pixel = new float[numBands];
- for (int yy=y; yy<(y+h); yy++)
- {
- for (int xx=x; xx<(x+w); xx++)
- {
- System.arraycopy(fArray, inOffset, pixel, 0, numBands);
- setPixel(xx, yy, pixel, data);
- inOffset += numBands;
- }
- }
- }
-
- public void setPixels(int x, int y, int w, int h, double[] dArray,
- DataBuffer data)
- {
- int inOffset = 0;
- double[] pixel = new double[numBands];
- for (int yy=y; yy<(y+h); yy++)
- {
- for (int xx=x; xx<(x+w); xx++)
- {
- System.arraycopy(dArray, inOffset, pixel, 0, numBands);
- setPixel(xx, yy, pixel, data);
- inOffset += numBands;
- }
- }
- }
-
- public abstract void setSample(int x, int y, int b, int s,
- DataBuffer data);
-
- public void setSample(int x, int y, int b, float s,
- DataBuffer data)
- {
- setSample(x, y, b, (int) s, data);
- }
-
- public void setSample(int x, int y, int b, double s,
- DataBuffer data)
- {
- setSample(x, y, b, (float) s, data);
- }
-
- public void setSamples(int x, int y, int w, int h, int b,
- int[] iArray, DataBuffer data)
- {
- int size = w*h;
- int inOffset = 0;
- for (int yy=y; yy<(y+h); yy++)
- for (int xx=x; xx<(x+w); xx++)
- setSample(xx, yy, b, iArray[inOffset++], data);
- }
-
- public void setSamples(int x, int y, int w, int h, int b,
- float[] fArray, DataBuffer data)
- {
- int size = w*h;
- int inOffset = 0;
- for (int yy=y; yy<(y+h); yy++)
- for (int xx=x; xx<(x+w); xx++)
- setSample(xx, yy, b, fArray[inOffset++], data);
-
- }
-
- public void setSamples(int x, int y, int w, int h, int b,
- double[] dArray, DataBuffer data) {
- int size = w*h;
- int inOffset = 0;
- for (int yy=y; yy<(y+h); yy++)
- for (int xx=x; xx<(x+w); xx++)
- setSample(xx, yy, b, dArray[inOffset++], data);
- }
-
- public abstract SampleModel createCompatibleSampleModel(int w, int h);
-
- /**
- * Return a SampleModel with a subset of the bands in this model.
- *
- * Selects bands.length bands from this sample model. The bands chosen
- * are specified in the indices of bands[]. This also permits permuting
- * the bands as well as taking a subset. Thus, giving an array with
- * 1, 2, 3, ..., numbands, will give an identical sample model.
- *
- * @param bands Array with band indices to include.
- * @return A new sample model
- */
- public abstract SampleModel createSubsetSampleModel(int[] bands);
-
- public abstract DataBuffer createDataBuffer();
-
- public abstract int[] getSampleSize();
-
- public abstract int getSampleSize(int band);
-}
diff --git a/libjava/java/awt/image/ShortLookupTable.java b/libjava/java/awt/image/ShortLookupTable.java
deleted file mode 100644
index 5915a7939a3..00000000000
--- a/libjava/java/awt/image/ShortLookupTable.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/* ShortLookupTable.java -- Java class for a pixel translation table.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * ShortLookupTable represents translation arrays for pixel values. It wraps
- * one or more data arrays for each layer (or component) in an image, such as
- * Alpha, R, G, and B. When doing translation, the offset is subtracted from
- * the pixel values to allow a subset of an array to be used.
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- * @version 1.0
- */
-public class ShortLookupTable extends LookupTable
-{
- // Array of translation tables.
- private short data[][];
-
- /**
- * Creates a new <code>ShortLookupTable</code> instance.
- *
- * Offset is subtracted from pixel values when looking up in the translation
- * tables. If data.length is one, the same table is applied to all pixel
- * components.
- *
- * @param offset Offset to be subtracted.
- * @param data Array of lookup tables.
- * @exception IllegalArgumentException if offset &lt; 0 or data.length &lt; 1.
- */
- public ShortLookupTable(int offset, short[][] data)
- throws IllegalArgumentException
- {
- super(offset, data.length);
- this.data = data;
- }
-
- /**
- * Creates a new <code>ShortLookupTable</code> instance.
- *
- * Offset is subtracted from pixel values when looking up in the translation
- * table. The same table is applied to all pixel components.
- *
- * @param offset Offset to be subtracted.
- * @param data Lookup table for all components.
- * @exception IllegalArgumentException if offset &lt; 0.
- */
- public ShortLookupTable(int offset, short[] data)
- throws IllegalArgumentException
- {
- super(offset, 1);
- this.data = new short[][] {data};
- }
-
- /** Return the lookup tables. */
- public final short[][] getTable()
- {
- return data;
- }
-
- /**
- * Return translated values for a pixel.
- *
- * For each value in the pixel src, use the value minus offset as an index
- * in the component array and copy the value there to the output for the
- * component. If dest is null, the output is a new array, otherwise the
- * translated values are written to dest. Dest can be the same array as
- * src.
- *
- * For example, if the pixel src is [2, 4, 3], and offset is 1, the output
- * is [comp1[1], comp2[3], comp3[2]], where comp1, comp2, and comp3 are the
- * translation arrays.
- *
- * @param src Component values of a pixel.
- * @param dst Destination array for values, or null.
- * @return Translated values for the pixel.
- */
- public int[] lookupPixel(int[] src, int[] dst)
- throws ArrayIndexOutOfBoundsException
- {
- if (dst == null)
- dst = new int[src.length];
-
- if (data.length == 1)
- for (int i=0; i < src.length; i++)
- dst[i] = data[0][src[i] - offset];
- else
- for (int i=0; i < src.length; i++)
- dst[i] = data[i][src[i] - offset];
-
- return dst;
- }
-
- /**
- * Return translated values for a pixel.
- *
- * For each value in the pixel src, use the value minus offset as an index
- * in the component array and copy the value there to the output for the
- * component. If dest is null, the output is a new array, otherwise the
- * translated values are written to dest. Dest can be the same array as
- * src.
- *
- * For example, if the pixel src is [2, 4, 3], and offset is 1, the output
- * is [comp1[1], comp2[3], comp3[2]], where comp1, comp2, and comp3 are the
- * translation arrays.
- *
- * @param src Component values of a pixel.
- * @param dst Destination array for values, or null.
- * @return Translated values for the pixel.
- */
- public short[] lookupPixel(short[] src, short[] dst)
- throws ArrayIndexOutOfBoundsException
- {
- if (dst == null)
- dst = new short[src.length];
-
- if (data.length == 1)
- for (int i=0; i < src.length; i++)
- dst[i] = data[0][((int)src[i]) - offset];
- else
- for (int i=0; i < src.length; i++)
- dst[i] = data[i][((int)src[i]) - offset];
-
- return dst;
-
- }
-}
diff --git a/libjava/java/awt/image/SinglePixelPackedSampleModel.java b/libjava/java/awt/image/SinglePixelPackedSampleModel.java
deleted file mode 100644
index 6ccce753bd3..00000000000
--- a/libjava/java/awt/image/SinglePixelPackedSampleModel.java
+++ /dev/null
@@ -1,449 +0,0 @@
-/* Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import gnu.java.awt.BitMaskExtent;
-import gnu.java.awt.Buffers;
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public class SinglePixelPackedSampleModel extends SampleModel
-{
- private int scanlineStride;
- private int[] bitMasks;
- private int[] bitOffsets;
- private int[] sampleSize;
-
- public SinglePixelPackedSampleModel(int dataType, int w, int h,
- int[] bitMasks)
- {
- this(dataType, w, h, w, bitMasks);
- }
-
- public SinglePixelPackedSampleModel(int dataType, int w, int h,
- int scanlineStride, int[] bitMasks)
- {
- super(dataType, w, h, bitMasks.length);
-
- switch (dataType)
- {
- case DataBuffer.TYPE_BYTE:
- case DataBuffer.TYPE_USHORT:
- case DataBuffer.TYPE_INT:
- break;
- default:
- throw new IllegalArgumentException("SinglePixelPackedSampleModel unsupported dataType");
- }
-
- this.scanlineStride = scanlineStride;
- this.bitMasks = bitMasks;
-
- bitOffsets = new int[numBands];
- sampleSize = new int[numBands];
-
- BitMaskExtent extent = new BitMaskExtent();
- for (int b=0; b<numBands; b++)
- {
- extent.setMask(bitMasks[b]);
- sampleSize[b] = extent.bitWidth;
- bitOffsets[b] = extent.leastSignificantBit;
- }
- }
-
- public int getNumDataElements()
- {
- return 1;
- }
-
- public SampleModel createCompatibleSampleModel(int w, int h)
- {
- /* FIXME: We can avoid recalculation of bit offsets and sample
- sizes here by passing these from the current instance to a
- special private constructor. */
- return new SinglePixelPackedSampleModel(dataType, w, h, bitMasks);
- }
-
-
- /**
- * Creates a DataBuffer for holding pixel data in the format and
- * layout described by this SampleModel. The returned buffer will
- * consist of one single bank.
- */
- public DataBuffer createDataBuffer()
- {
- int size;
-
- // We can save (scanlineStride - width) pixels at the very end of
- // the buffer. The Sun reference implementation (J2SE 1.3.1 and
- // 1.4.1_01) seems to do this; tested with Mauve test code.
- size = scanlineStride * (height - 1) + width;
-
- return Buffers.createBuffer(getDataType(), size);
- }
-
-
- public int[] getSampleSize()
- {
- return sampleSize;
- }
-
- public int getSampleSize(int band)
- {
- return sampleSize[band];
- }
-
- public int getOffset(int x, int y)
- {
- return scanlineStride*y + x;
- }
-
- public int[] getBitOffsets()
- {
- return bitOffsets;
- }
-
- public int[] getBitMasks()
- {
- return bitMasks;
- }
-
- public int getScanlineStride()
- {
- return scanlineStride;
- }
-
- public SampleModel createSubsetSampleModel(int[] bands)
- {
- // FIXME: Is this the right way to interpret bands?
-
- int numBands = bands.length;
-
- int[] bitMasks = new int[numBands];
-
- for (int b=0; b<numBands; b++)
- bitMasks[b] = this.bitMasks[bands[b]];
-
- return new SinglePixelPackedSampleModel(dataType, width, height,
- scanlineStride, bitMasks);
- }
-
- public Object getDataElements(int x, int y, Object obj,
- DataBuffer data)
- {
- int offset = scanlineStride*y + x + data.getOffset();
-
- return Buffers.getData(data, offset, obj,
- 0, // destination offset,
- 1 // length
- );
- }
-
- /**
- * This is a more efficient implementation of the default implementation in the super
- * class.
- * @param x The x-coordinate of the pixel rectangle to store in <code>obj</code>.
- * @param y The y-coordinate of the pixel rectangle to store in <code>obj</code>.
- * @param w The width of the pixel rectangle to store in <code>obj</code>.
- * @param h The height of the pixel rectangle to store in <code>obj</code>.
- * @param obj The primitive array to store the pixels into or null to force creation.
- * @param data The DataBuffer that is the source of the pixel data.
- * @return The primitive array containing the pixel data.
- * @see java.awt.image.SampleModel#getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer)
- */
- public Object getDataElements(int x, int y, int w, int h, Object obj,
- DataBuffer data)
- {
- int size = w*h;
- int dataSize = size;
- Object pixelData = null;
- switch (getTransferType())
- {
- case DataBuffer.TYPE_BYTE:
- pixelData = ((DataBufferByte) data).getData();
- if (obj == null) obj = new byte[dataSize];
- break;
- case DataBuffer.TYPE_USHORT:
- pixelData = ((DataBufferUShort) data).getData();
- if (obj == null) obj = new short[dataSize];
- break;
- case DataBuffer.TYPE_INT:
- pixelData = ((DataBufferInt) data).getData();
- if (obj == null) obj = new int[dataSize];
- break;
- default:
- // Seems like the only sensible thing to do.
- throw new ClassCastException();
- }
- if(x==0 && scanlineStride == w)
- {
- // The full width need to be copied therefore we can copy in one shot.
- System.arraycopy(pixelData, scanlineStride*y + data.getOffset(), obj, 0, size);
- }
- else
- {
- // Since we do not need the full width we need to copy line by line.
- int outOffset = 0;
- int dataOffset = scanlineStride*y + x + data.getOffset();
- for (int yy = y; yy<(y+h); yy++)
- {
- System.arraycopy(pixelData, dataOffset, obj, outOffset, w);
- dataOffset += scanlineStride;
- outOffset += w;
- }
- }
- return obj;
- }
-
-
- public int[] getPixel(int x, int y, int[] iArray, DataBuffer data)
- {
- int offset = scanlineStride*y + x;
- if (iArray == null) iArray = new int[numBands];
- int samples = data.getElem(offset);
-
- for (int b=0; b<numBands; b++)
- iArray[b] = (samples & bitMasks[b]) >>> bitOffsets[b];
-
- return iArray;
- }
-
- public int[] getPixels(int x, int y, int w, int h, int[] iArray,
- DataBuffer data)
- {
- int offset = scanlineStride*y + x;
- if (iArray == null) iArray = new int[numBands*w*h];
- int outOffset = 0;
- for (y=0; y<h; y++)
- {
- int lineOffset = offset;
- for (x=0; x<w; x++)
- {
- int samples = data.getElem(lineOffset++);
- for (int b=0; b<numBands; b++)
- iArray[outOffset++] = (samples & bitMasks[b]) >>> bitOffsets[b];
- }
- offset += scanlineStride;
- }
- return iArray;
- }
-
- public int getSample(int x, int y, int b, DataBuffer data)
- {
- int offset = scanlineStride*y + x;
- int samples = data.getElem(offset);
- return (samples & bitMasks[b]) >>> bitOffsets[b];
- }
-
- /**
- * This method implements a more efficient way to set data elements than the default
- * implementation of the super class. It sets the data elements line by line instead
- * of pixel by pixel.
- * @param x The x-coordinate of the data elements in <code>obj</code>.
- * @param y The y-coordinate of the data elements in <code>obj</code>.
- * @param w The width of the data elements in <code>obj</code>.
- * @param h The height of the data elements in <code>obj</code>.
- * @param obj The primitive array containing the data elements to set.
- * @param data The DataBuffer to store the data elements into.
- * @see java.awt.image.SampleModel#setDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer)
- */
- public void setDataElements(int x, int y, int w, int h,
- Object obj, DataBuffer data)
- {
-
- Object pixelData;
- switch (getTransferType())
- {
- case DataBuffer.TYPE_BYTE:
- pixelData = ((DataBufferByte) data).getData();
- break;
- case DataBuffer.TYPE_USHORT:
- pixelData = ((DataBufferUShort) data).getData();
- break;
- case DataBuffer.TYPE_INT:
- pixelData = ((DataBufferInt) data).getData();
- break;
- default:
- // Seems like the only sensible thing to do.
- throw new ClassCastException();
- }
-
- int inOffset = 0;
- int dataOffset = scanlineStride*y + x + data.getOffset();
- for (int yy=y; yy<(y+h); yy++)
- {
- System.arraycopy(obj,inOffset,pixelData,dataOffset,w);
- dataOffset += scanlineStride;
- inOffset += w;
- }
- }
-
-
- public void setDataElements(int x, int y, Object obj, DataBuffer data)
- {
- int offset = scanlineStride*y + x + data.getOffset();
-
- int transferType = getTransferType();
- if (getTransferType() != data.getDataType())
- {
- throw new IllegalArgumentException("transfer type ("+
- getTransferType()+"), "+
- "does not match data "+
- "buffer type (" +
- data.getDataType() +
- ").");
- }
-
- try
- {
- switch (transferType)
- {
- case DataBuffer.TYPE_BYTE:
- {
- DataBufferByte out = (DataBufferByte) data;
- byte[] in = (byte[]) obj;
- out.getData()[offset] = in[0];
- return;
- }
- case DataBuffer.TYPE_USHORT:
- {
- DataBufferUShort out = (DataBufferUShort) data;
- short[] in = (short[]) obj;
- out.getData()[offset] = in[0];
- return;
- }
- case DataBuffer.TYPE_INT:
- {
- DataBufferInt out = (DataBufferInt) data;
- int[] in = (int[]) obj;
- out.getData()[offset] = in[0];
- return;
- }
- // FIXME: Fill in the other possible types.
- default:
- throw new InternalError();
- }
- }
- catch (ArrayIndexOutOfBoundsException aioobe)
- {
- String msg = "While writing data elements" +
- ", x="+x+", y="+y+
- ", width="+width+", height="+height+
- ", scanlineStride="+scanlineStride+
- ", offset="+offset+
- ", data.getSize()="+data.getSize()+
- ", data.getOffset()="+data.getOffset()+
- ": " +
- aioobe;
- throw new ArrayIndexOutOfBoundsException(msg);
- }
- }
-
- public void setPixel(int x, int y, int[] iArray, DataBuffer data)
- {
- int offset = scanlineStride*y + x;
-
- int samples = 0;
- for (int b=0; b<numBands; b++)
- samples |= (iArray[b] << bitOffsets[b]) & bitMasks[b];
-
- data.setElem(offset, samples);
- }
-
- /**
- * This method implements a more efficient way to set pixels than the default
- * implementation of the super class. It copies the pixel components directly
- * from the input array instead of creating a intermediate buffer.
- * @param x The x-coordinate of the pixel rectangle in <code>obj</code>.
- * @param y The y-coordinate of the pixel rectangle in <code>obj</code>.
- * @param w The width of the pixel rectangle in <code>obj</code>.
- * @param h The height of the pixel rectangle in <code>obj</code>.
- * @param iArray The primitive array containing the pixels to set.
- * @param data The DataBuffer to store the pixels into.
- * @see java.awt.image.SampleModel#setPixels(int, int, int, int, int[], java.awt.image.DataBuffer)
- */
- public void setPixels(int x, int y, int w, int h, int[] iArray,
- DataBuffer data)
- {
- int inOffset = 0;
- int[] pixel = new int[numBands];
- for (int yy=y; yy<(y+h); yy++)
- {
- int offset = scanlineStride*yy + x;
- for (int xx=x; xx<(x+w); xx++)
- {
- int samples = 0;
- for (int b=0; b<numBands; b++)
- samples |= (iArray[inOffset+b] << bitOffsets[b]) & bitMasks[b];
- data.setElem(0, offset, samples);
- inOffset += numBands;
- offset += 1;
- }
- }
- }
-
-
- public void setSample(int x, int y, int b, int s, DataBuffer data)
- {
- int offset = scanlineStride*y + x;
- int samples = data.getElem(offset);
- int bitMask = bitMasks[b];
- samples &= ~bitMask;
- samples |= (s << bitOffsets[b]) & bitMask;
- data.setElem(offset, samples);
- }
-
- /**
- * Creates a String with some information about this SampleModel.
- * @return A String describing this SampleModel.
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- StringBuffer result = new StringBuffer();
- result.append(getClass().getName());
- result.append("[");
- result.append("scanlineStride=").append(scanlineStride);
- for(int i=0; i < bitMasks.length; i+=1)
- {
- result.append(", mask[").append(i).append("]=0x").append(Integer.toHexString(bitMasks[i]));
- }
-
- result.append("]");
- return result.toString();
- }
-}
diff --git a/libjava/java/awt/image/TileObserver.java b/libjava/java/awt/image/TileObserver.java
deleted file mode 100644
index 99aafbce81c..00000000000
--- a/libjava/java/awt/image/TileObserver.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* TileObserver.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-/**
- * NEEDS DOCUMENTATION
- */
-public interface TileObserver
-{
- void tileUpdate(WritableRenderedImage src, int x, int y, boolean writable);
-} // interface TileObserver
diff --git a/libjava/java/awt/image/VolatileImage.java b/libjava/java/awt/image/VolatileImage.java
deleted file mode 100644
index 308654162ae..00000000000
--- a/libjava/java/awt/image/VolatileImage.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/* VolatileImage.java -- a hardware-accelerated image buffer
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
-import java.awt.Image;
-import java.awt.Transparency;
-import java.awt.ImageCapabilities;
-
-/**
- * VolatileImage represents a hardware-accelerated graphics buffer.
- * The native graphics system may free or damage the resources
- * occupied by a VolatileImage at any time. As such, one must
- * frequently check the "validity" of the image buffer's resources.
- *
- * A volatile image's "validity" depends on multiple factors. Its
- * resources may have become unavailble in which case you must
- * reallocate them. If you move the image from one output device to
- * another, you may need to recreate the image's resources if the new
- * output device's capabilities don't match the old one's. Finally,
- * if the contents of the image's buffer have been damaged you must
- * re-render the image.
- *
- * VolatileImages should always be created using either
- * Component.createVolatileImage or
- * GraphicsConfiguration.createCompatibleVolatileImage.
- */
-public abstract class VolatileImage extends Image
- implements Transparency
-{
- /**
- * One of validate's possible return values. Indicates that the
- * image buffer matches its graphics configuration's capabilities
- * and that its resources are initialized and ready to be drawn
- * into. Also implies that any existing image rendered to the
- * buffer is intact and need not be re-rendered.
- */
- public static final int IMAGE_OK = 0;
-
- /**
- * One of validate's possible return values. Indicates that the
- * image buffer has been restored, meaning that it is valid and
- * ready-to-use but that its previous contents have been lost. This
- * return value implies that the image needs to be re-rendered.
- */
- public static final int IMAGE_RESTORED = 1;
-
- /**
- * One of validate's possible return values. Indicates that the
- * image buffer type is unsupported by the current graphics
- * configuration. The graphics configuration may have changed, for
- * example if the image moved from one output device to another.
- * This return value implies that the image buffer's resources
- * should be re-acquired.
- */
- public static final int IMAGE_INCOMPATIBLE = 2;
-
- /**
- * This image's transparency type. One of Transparency.BITMASK,
- * Transparency.OPAQUE or Transparency.TRANSLUCENT.
- *
- * @since 1.5
- */
- protected int transparency;
-
- /**
- * Default constructor. VolatileImages should not be created
- * directly. Rather, you should use Component.createVolatileImage
- * or GraphicsConfiguration.createCompatibleVolatileImage.
- */
- public VolatileImage()
- {
- }
-
- /**
- * Returns an image representing the current state of the volatile
- * image buffer. The returned image is static meaning that it is
- * not updated after being created. It is a snapshot of the
- * volatile image buffer at the time getSnapshot is called.
- *
- * This method, which reads pixels from the volatile image buffer,
- * may be less-performant than methods that write pixels since
- * VolatileImages are typically optimized for writing.
- *
- * @return a BufferedImage representing this VolatileImage
- */
- public abstract BufferedImage getSnapshot();
-
- /**
- * Returns the width of this image buffer.
- *
- * @return the width of this VolatileImage
- */
- public abstract int getWidth();
-
- /**
- * Returns the height of this image buffer.
- *
- * @return the height of this VolatileImage
- */
- public abstract int getHeight();
-
- /**
- * Calling this method is equivalent to calling
- * getSnapshot().getSource(). The ImageProducer produces pixels
- * from the BufferedImage snapshot and not from the VolatileImage
- * itself. Thus, changes to the VolatileImage that occur after this
- * ImageProducer has been retrieved will not be reflected in the
- * produced pixels.
- *
- * This method, which reads pixels from the volatile image buffer,
- * may be less-performant than methods that write pixels since
- * VolatileImages are typically optimized for writing.
- *
- * @return an ImageProducer for a static BufferedImage snapshot of
- * this image buffer
- */
- public ImageProducer getSource()
- {
- return getSnapshot().getSource();
- }
-
- /**
- * Releases the system resources taken by this image.
- */
- public void flush()
- {
- }
-
- /**
- * Returns a Graphics2D object that can be used to draw onto this
- * image. This method is present for backwards-compatibility. It
- * simply returns the result of createGraphics.
- *
- * @return a Graphics2D object that can be used to draw onto this
- * image
- */
- public Graphics getGraphics()
- {
- return createGraphics();
- }
-
- /**
- * Returns a Graphics2D object that can be used to draw onto this
- * image.
- *
- * @return a Graphics2D object that can be used to draw onto this
- * image
- */
- public abstract Graphics2D createGraphics();
-
- /**
- * Validates and restores this image. If the image buffer has
- * become unavailable for further use since the last call to
- * validate, validate will allocate a new image buffer. The image
- * is also "validated" against the GraphicsConfiguration parameter.
- *
- * "Validating" the image means checking that the capabilities it
- * requires of the output device are indeed supported by the given
- * output device. If the image's characteristics, which can be
- * highly output device-specific, are not supported by the graphics
- * configuration, then IMAGE_INCOMPATIBLE will be returned. This
- * can happen, for example, if this image was created on one output
- * device, then validated against a different output device with
- * different capabilities. Calling validate with a NULL gc argument
- * causes validate to skip the validation test.
- *
- * @param gc graphics configuration against which to validate or
- * NULL
- *
- * @return a code indicating the result of validation. One of:
- * <ul>
- * <li><code>IMAGE_OK</code> if the image did not need to be
- * validated and didn't need to be restored</li>
- * <li><code>IMAGE_RESTORED</code> if the image may need to be
- * re-rendered.</li>
- * <li><code>IMAGE_INCOMPATIBLE</code> if this image's
- * requirements are not fulfilled by the graphics configuration
- * parameter. This implies that you need to create a new
- * VolatileImage for the different GraphicsConfiguration or
- * Component. This return value implies nothing about whether the
- * image is valid or needs to be re-rendered.</li>
- * </ul>
- */
- public abstract int validate(GraphicsConfiguration gc);
-
- /**
- * Returns true if the contents of the image buffer have been
- * damaged or if the image buffer's resources have been reclaimed by
- * the graphics system. You should call this method after a series
- * of rendering operations to or from the image, to see if the image
- * buffer needs to be revalidated or the image re-rendered.
- *
- * @return true if the validate should be called, false otherwise
- */
- public abstract boolean contentsLost();
-
- /**
- * Returns the capabilities of this image buffer.
- *
- * @return the capabilities of this image buffer
- */
- public abstract ImageCapabilities getCapabilities();
-
- /**
- * Returns the transparency type of this image.
- *
- * @return Transparency.OPAQUE, Transparency.BITMASK or
- * Transparency.TRANSLUCENT
- */
- public int getTransparency()
- {
- return transparency;
- }
-}
diff --git a/libjava/java/awt/image/WritableRaster.java b/libjava/java/awt/image/WritableRaster.java
deleted file mode 100644
index 2e5462fd92e..00000000000
--- a/libjava/java/awt/image/WritableRaster.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/* Copyright (C) 2000, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Point;
-import java.awt.Rectangle;
-
-/**
- * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
- */
-public class WritableRaster extends Raster
-{
- protected WritableRaster(SampleModel sampleModel, Point origin)
- {
- this(sampleModel, sampleModel.createDataBuffer(), origin);
- }
-
- protected WritableRaster(SampleModel sampleModel,
- DataBuffer dataBuffer, Point origin)
- {
- this(sampleModel, dataBuffer,
- new Rectangle(origin != null ? origin.x : 0,
- origin != null ? origin.y : 0,
- sampleModel.getWidth(), sampleModel.getHeight()),
- origin,
- null);
- }
-
- protected WritableRaster(SampleModel sampleModel,
- DataBuffer dataBuffer,
- Rectangle aRegion,
- Point sampleModelTranslate,
- WritableRaster parent)
- {
- super(sampleModel, dataBuffer, aRegion, sampleModelTranslate,
- parent);
- }
-
- public WritableRaster getWritableParent()
- {
- return (WritableRaster) getParent();
- }
-
- public WritableRaster createWritableTranslatedChild(int childMinX,
- int childMinY)
- {
- // This mirrors the code from the super class
- int tcx = sampleModelTranslateX - minX + childMinX;
- int tcy = sampleModelTranslateY - minY + childMinY;
-
- return new WritableRaster(sampleModel, dataBuffer,
- new Rectangle(childMinX, childMinY,
- width, height),
- new Point(tcx, tcy),
- this);
- }
-
- public WritableRaster createWritableChild(int parentX,
- int parentY,
- int w, int h,
- int childMinX,
- int childMinY,
- int[] bandList)
- {
- // This mirrors the code from the super class
-
- // FIXME: Throw RasterFormatException if child bounds extends
- // beyond the bounds of this raster.
-
- SampleModel sm = (bandList == null) ?
- sampleModel :
- sampleModel.createSubsetSampleModel(bandList);
-
- return new
- WritableRaster(sm, dataBuffer,
- new Rectangle(childMinX, childMinY,
- w, h),
- new Point(sampleModelTranslateX+childMinX-parentX,
- sampleModelTranslateY+childMinY-parentY),
- this);
- }
-
- public void setDataElements(int x, int y, Object inData)
- {
- sampleModel.setDataElements(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- inData, dataBuffer);
- }
-
- public void setDataElements(int x, int y, Raster inRaster)
- {
- Object dataElements = getDataElements(0, 0,
- inRaster.getWidth(),
- inRaster.getHeight(),
- null);
- setDataElements(x, y, dataElements);
- }
-
- public void setDataElements(int x, int y, int w, int h,
- Object inData)
- {
- sampleModel.setDataElements(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, inData, dataBuffer);
- }
-
- public void setRect(Raster srcRaster)
- {
- setRect(0, 0, srcRaster);
- }
-
- public void setRect(int dx, int dy, Raster srcRaster)
- {
- Rectangle targetUnclipped = new Rectangle(srcRaster.getMinX()+dx,
- srcRaster.getMinY()+dy,
- srcRaster.getWidth(),
- srcRaster.getHeight());
-
- Rectangle target = getBounds().intersection(targetUnclipped);
-
- if (target.isEmpty()) return;
-
- int sx = target.x - dx;
- int sy = target.y - dy;
-
- // FIXME: Do tests on rasters and use get/set data instead.
-
- /* The JDK documentation seems to imply this implementation.
- (the trucation of higher bits), but an implementation using
- get/setDataElements would be more efficient. None of the
- implementations would do anything sensible when the sample
- models don't match.
-
- But this is probably not the place to consider such
- optimizations.*/
-
- int[] pixels = srcRaster.getPixels(sx, sy,
- target.width, target.height,
- (int[]) null);
-
- setPixels(target.x, target.y, target.width, target.height, pixels);
- }
-
- public void setPixel(int x, int y, int[] iArray)
- {
- sampleModel.setPixel(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- iArray, dataBuffer);
- }
-
- public void setPixel(int x, int y, float[] fArray)
- {
- sampleModel.setPixel(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- fArray, dataBuffer);
- }
-
- public void setPixel(int x, int y, double[] dArray)
- {
- sampleModel.setPixel(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- dArray, dataBuffer);
- }
-
- public void setPixels(int x, int y, int w, int h, int[] iArray)
- {
- sampleModel.setPixels(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, iArray, dataBuffer);
- }
-
- public void setPixels(int x, int y, int w, int h, float[] fArray)
- {
- sampleModel.setPixels(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, fArray, dataBuffer);
- }
-
- public void setPixels(int x, int y, int w, int h, double[] dArray)
- {
- sampleModel.setPixels(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, dArray, dataBuffer);
- }
-
- public void setSample(int x, int y, int b, int s)
- {
- sampleModel.setSample(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- b, s, dataBuffer);
- }
-
- public void setSample(int x, int y, int b, float s)
- {
- sampleModel.setSample(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- b, s, dataBuffer);
- }
-
- public void setSample(int x, int y, int b, double s)
- {
- sampleModel.setSample(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- b, s, dataBuffer);
- }
-
- public void setSamples(int x, int y, int w, int h, int b,
- int[] iArray)
- {
- sampleModel.setSamples(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, b, iArray, dataBuffer);
- }
-
- public void setSamples(int x, int y, int w, int h, int b,
- float[] fArray)
- {
- sampleModel.setSamples(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, b, fArray, dataBuffer);
- }
-
- public void setSamples(int x, int y, int w, int h, int b,
- double[] dArray)
- {
- sampleModel.setSamples(x-sampleModelTranslateX,
- y-sampleModelTranslateY,
- w, h, b, dArray, dataBuffer);
- }
-}
diff --git a/libjava/java/awt/image/WritableRenderedImage.java b/libjava/java/awt/image/WritableRenderedImage.java
deleted file mode 100644
index 4ed9f101371..00000000000
--- a/libjava/java/awt/image/WritableRenderedImage.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* WritableRenderedImage.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image;
-
-import java.awt.Point;
-
-/**
- * NEEDS DOCUMENTATION
- */
-public interface WritableRenderedImage extends RenderedImage
-{
- void addTileObserver(TileObserver to);
- void removeTileObserver(TileObserver to);
- WritableRaster getWritableTile(int x, int y);
- void releaseWritableTile(int x, int y);
- boolean isTileWritable(int x, int y);
- Point[] getWritableTileIndices();
- boolean hasTileWriters();
- void setData(Raster r);
-} // interface WritableRenderedImage
diff --git a/libjava/java/awt/image/renderable/ContextualRenderedImageFactory.java b/libjava/java/awt/image/renderable/ContextualRenderedImageFactory.java
deleted file mode 100644
index 729d857ac89..00000000000
--- a/libjava/java/awt/image/renderable/ContextualRenderedImageFactory.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* ContextualRenderedImageFactory.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image.renderable;
-
-import java.awt.geom.Rectangle2D;
-import java.awt.image.RenderedImage;
-
-/**
- * STUBBED
- */
-public interface ContextualRenderedImageFactory extends RenderedImageFactory
-{
- RenderContext mapRenderContext(int i, RenderContext context,
- ParameterBlock block, RenderableImage image);
- RenderedImage create(RenderContext context, ParameterBlock block);
- Rectangle2D getBounds2D(ParameterBlock block);
- Object getProperty(ParameterBlock block, String name);
- String[] getPropertyNames();
- boolean isDynamic();
-} // interface ContextualRenderedImageFactory
diff --git a/libjava/java/awt/image/renderable/ParameterBlock.java b/libjava/java/awt/image/renderable/ParameterBlock.java
deleted file mode 100644
index 879d3c4fb90..00000000000
--- a/libjava/java/awt/image/renderable/ParameterBlock.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/* ParameterBlock.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image.renderable;
-
-import java.awt.image.RenderedImage;
-import java.io.Serializable;
-import java.util.Vector;
-
-public class ParameterBlock implements Cloneable, Serializable
-{
- private static final long serialVersionUID = -7577115551785240750L;
- protected Vector sources;
- protected Vector parameters;
-
- public ParameterBlock()
- {
- this(new Vector(), new Vector());
- }
-
- public ParameterBlock(Vector sources)
- {
- this(sources, new Vector());
- }
-
- public ParameterBlock(Vector sources, Vector parameters)
- {
- this.sources = sources;
- this.parameters = parameters;
- }
-
- public Object shallowClone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // impossible
- }
- }
-
- public Object clone()
- {
- ParameterBlock pb = (ParameterBlock) shallowClone();
- if (sources != null)
- pb.sources = (Vector) sources.clone();
- if (parameters != null)
- pb.parameters = (Vector) parameters.clone();
- return pb;
- }
-
- public ParameterBlock addSource(Object source)
- {
- sources.add(source);
- return this;
- }
-
- public Object getSource(int index)
- {
- return sources.get(index);
- }
-
- public ParameterBlock setSource(Object source, int index)
- {
- sources.ensureCapacity(index);
- sources.set(index, source);
- return this;
- }
-
- public RenderedImage getRenderedSource(int index)
- {
- return (RenderedImage) sources.get(index);
- }
-
- public RenderableImage getRenderableSource(int index)
- {
- return (RenderableImage) sources.get(index);
- }
-
- public int getNumSources()
- {
- return sources.size();
- }
-
- public Vector getSources()
- {
- return sources;
- }
-
- public void setSources(Vector sources)
- {
- this.sources = sources;
- }
-
- public void removeSources()
- {
- if (sources != null)
- sources.clear();
- }
-
- public int getNumParameters()
- {
- return parameters.size();
- }
-
- public Vector getParameters()
- {
- return parameters;
- }
-
- public void setParameters(Vector parameters)
- {
- this.parameters = parameters;
- }
-
- public void removeParameters()
- {
- if (parameters != null)
- parameters.clear();
- }
-
- public ParameterBlock add(Object o)
- {
- parameters.add(o);
- return this;
- }
-
- public ParameterBlock add(byte b)
- {
- return add(new Byte(b));
- }
-
- public ParameterBlock add(char c)
- {
- return add(new Character(c));
- }
-
- public ParameterBlock add(short s)
- {
- return add(new Short(s));
- }
-
- public ParameterBlock add(int i)
- {
- return add(new Integer(i));
- }
-
- public ParameterBlock add(long l)
- {
- return add(new Long(l));
- }
-
- public ParameterBlock add(float f)
- {
- return add(new Float(f));
- }
-
- public ParameterBlock add(double d)
- {
- return add(new Double(d));
- }
-
- public ParameterBlock set(Object o, int index)
- {
- parameters.ensureCapacity(index);
- parameters.set(index, o);
- return this;
- }
-
- public ParameterBlock set(byte b, int index)
- {
- return set(new Byte(b), index);
- }
-
- public ParameterBlock set(char c, int index)
- {
- return set(new Character(c), index);
- }
-
- public ParameterBlock set(short s, int index)
- {
- return set(new Short(s), index);
- }
-
- public ParameterBlock set(int i, int index)
- {
- return set(new Integer(i), index);
- }
-
- public ParameterBlock set(long l, int index)
- {
- return set(new Long(l), index);
- }
-
- public ParameterBlock set(float f, int index)
- {
- return set(new Float(f), index);
- }
-
- public ParameterBlock set(double d, int index)
- {
- return set(new Double(d), index);
- }
-
- public Object getObjectParameter(int index)
- {
- return parameters.get(index);
- }
-
- public byte getByteParameter(int index)
- {
- return ((Byte) parameters.get(index)).byteValue();
- }
-
- public char getCharParameter(int index)
- {
- return ((Character) parameters.get(index)).charValue();
- }
-
- public short getShortParameter(int index)
- {
- return ((Short) parameters.get(index)).shortValue();
- }
-
- public int getIntParameter(int index)
- {
- return ((Integer) parameters.get(index)).intValue();
- }
-
- public long getLongParameter(int index)
- {
- return ((Long) parameters.get(index)).longValue();
- }
-
- public float getFloatParameter(int index)
- {
- return ((Float) parameters.get(index)).floatValue();
- }
-
- public double getDoubleParameter(int index)
- {
- return ((Double) parameters.get(index)).doubleValue();
- }
-
- public Class[] getParamClasses()
- {
- int i = parameters.size();
- Class[] result = new Class[i];
- while (--i >= 0)
- {
- Class c = parameters.get(i).getClass();
- if (c == Byte.class)
- result[i] = byte.class;
- else if (c == Character.class)
- result[i] = char.class;
- else if (c == Short.class)
- result[i] = short.class;
- else if (c == Integer.class)
- result[i] = int.class;
- else if (c == Long.class)
- result[i] = long.class;
- else if (c == Float.class)
- result[i] = float.class;
- else if (c == Double.class)
- result[i] = double.class;
- else
- result[i] = c;
- }
- return result;
- }
-} // class ParameterBlock
diff --git a/libjava/java/awt/image/renderable/RenderContext.java b/libjava/java/awt/image/renderable/RenderContext.java
deleted file mode 100644
index 67f0b8adb23..00000000000
--- a/libjava/java/awt/image/renderable/RenderContext.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/* RenderContext.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image.renderable;
-
-import java.awt.RenderingHints;
-import java.awt.Shape;
-import java.awt.geom.AffineTransform;
-
-public class RenderContext implements Cloneable
-{
- private AffineTransform xform;
- private Shape aoi;
- private RenderingHints hints;
-
- public RenderContext(AffineTransform xform, Shape aoi, RenderingHints hints)
- {
- this.xform = xform;
- this.aoi = aoi;
- this.hints = hints;
- }
-
- public RenderContext(AffineTransform xform)
- {
- this(xform, null, null);
- }
-
- public RenderContext(AffineTransform xform, RenderingHints hints)
- {
- this(xform, null, hints);
- }
-
- public RenderContext(AffineTransform xform, Shape aoi)
- {
- this(xform, aoi, null);
- }
-
- public RenderingHints getRenderingHints()
- {
- return hints;
- }
-
- public void setRenderingHints(RenderingHints hints)
- {
- this.hints = hints;
- }
-
- public void setTransform(AffineTransform xform)
- {
- this.xform = xform;
- }
-
- public void preConcatenateTransform(AffineTransform pre)
- {
- preConcetenateTransform (pre);
- }
-
- /** @deprecated */
- public void preConcetenateTransform(AffineTransform pre)
- {
- xform.preConcatenate (pre);
- }
-
- public void concatenateTransform(AffineTransform post)
- {
- concetenateTransform (post);
- }
-
- /** @deprecated */
- public void concetenateTransform(AffineTransform post)
- {
- xform.concatenate (post);
- }
-
- public AffineTransform getTransform()
- {
- return xform;
- }
-
- public void setAreaOfInterest(Shape aoi)
- {
- this.aoi = aoi;
- }
-
- public Shape getAreaOfInterest()
- {
- return aoi;
- }
-
- public Object clone()
- {
- try
- {
- RenderContext copy = (RenderContext) super.clone();
- if (xform != null)
- copy.xform = (AffineTransform) xform.clone();
- if (hints != null)
- copy.hints = (RenderingHints) hints.clone();
- return copy;
- }
- catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // impossible
- }
- }
-} // class RenderContext
diff --git a/libjava/java/awt/image/renderable/RenderableImage.java b/libjava/java/awt/image/renderable/RenderableImage.java
deleted file mode 100644
index 45d2eb7ebf0..00000000000
--- a/libjava/java/awt/image/renderable/RenderableImage.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* RenderableImage.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image.renderable;
-
-import java.awt.RenderingHints;
-import java.awt.image.RenderedImage;
-import java.util.Vector;
-
-public interface RenderableImage
-{
- String HINTS_OBSERVED = "HINTS_OBSERVED";
-
- Vector getSources();
- Object getProperty(String name);
- String[] getPropertyNames();
- boolean isDynamic();
- float getWidth();
- float getHeight();
- float getMinX();
- float getMinY();
- RenderedImage createScaledRendering(int w, int h, RenderingHints hints);
- RenderedImage createDefaultRendering();
- RenderedImage createRendering(RenderContext context);
-
-} // interface RenderableImage
-
diff --git a/libjava/java/awt/image/renderable/RenderableImageOp.java b/libjava/java/awt/image/renderable/RenderableImageOp.java
deleted file mode 100644
index 5385a82a317..00000000000
--- a/libjava/java/awt/image/renderable/RenderableImageOp.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/* RenderableImageOp.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image.renderable;
-
-import java.awt.RenderingHints;
-import java.awt.geom.AffineTransform;
-import java.awt.image.RenderedImage;
-import java.util.Vector;
-
-public class RenderableImageOp implements RenderableImage
-{
- private final ContextualRenderedImageFactory crif;
- private ParameterBlock block;
-
- public RenderableImageOp(ContextualRenderedImageFactory crif,
- ParameterBlock block)
- {
- this.crif = crif;
- this.block = (ParameterBlock) block.clone();
- }
-
- public Vector getSources()
- {
- if (block.sources == null)
- return null;
- int size = block.sources.size();
- Vector v = new Vector();
- for (int i = 0; i < size; i++)
- {
- Object o = block.sources.get(i);
- if (o instanceof RenderableImage)
- v.add(o);
- }
- return v;
- }
-
- public Object getProperty(String name)
- {
- return crif.getProperty(block, name);
- }
-
- public String[] getPropertyNames()
- {
- return crif.getPropertyNames();
- }
-
- public boolean isDynamic()
- {
- return crif.isDynamic();
- }
-
- public float getWidth()
- {
- return (float) crif.getBounds2D(block).getWidth();
- }
-
- public float getHeight()
- {
- return (float) crif.getBounds2D(block).getHeight();
- }
-
- public float getMinX()
- {
- return (float) crif.getBounds2D(block).getX();
- }
-
- public float getMinY()
- {
- return (float) crif.getBounds2D(block).getY();
- }
-
- public ParameterBlock setParameterBlock(ParameterBlock block)
- {
- ParameterBlock result = this.block;
- this.block = (ParameterBlock) block.clone();
- return result;
- }
-
- public ParameterBlock getParameterBlock()
- {
- return block;
- }
-
- public RenderedImage createScaledRendering(int w, int h,
- RenderingHints hints)
- {
- if (w == 0)
- if (h == 0)
- throw new IllegalArgumentException();
- else
- w = Math.round(h * getWidth() / getHeight());
- if (h == 0)
- h = Math.round(w * getHeight() / getWidth());
- AffineTransform xform = AffineTransform.getScaleInstance(w * getWidth(),
- h * getHeight());
- return createRendering(new RenderContext(xform, hints));
- }
-
- public RenderedImage createDefaultRendering()
- {
- return createRendering(new RenderContext(new AffineTransform()));
- }
-
- public RenderedImage createRendering(RenderContext context)
- {
- ParameterBlock copy = (ParameterBlock) block.clone();
- int i = block.sources.size();
- while (--i >= 0)
- {
- Object o = block.sources.get(i);
- if (o instanceof RenderableImage)
- {
- RenderableImage ri = (RenderableImage) o;
- RenderContext rc = crif.mapRenderContext(i, context, block, ri);
- copy.sources.set(i, ri.createRendering(rc));
- }
- }
- // Now copy.sources should be only RenderedImages.
- return crif.create(context, copy);
- }
-} // class RenderableImageOp
diff --git a/libjava/java/awt/image/renderable/RenderableImageProducer.java b/libjava/java/awt/image/renderable/RenderableImageProducer.java
deleted file mode 100644
index 78f3051ea99..00000000000
--- a/libjava/java/awt/image/renderable/RenderableImageProducer.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* RenderableImageProducer.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image.renderable;
-
-import java.awt.image.ImageConsumer;
-import java.awt.image.ImageProducer;
-
-public class RenderableImageProducer implements ImageProducer, Runnable
-{
- public RenderableImageProducer(RenderableImage image, RenderContext context)
- {
- throw new Error("not implemented");
- }
-
- public void setRenderContext(RenderContext context)
- {
- }
-
- public void addConsumer(ImageConsumer consumer)
- {
- }
-
- public boolean isConsumer(ImageConsumer consumer)
- {
- return false;
- }
-
- public void removeConsumer(ImageConsumer consumer)
- {
- }
-
- public void startProduction(ImageConsumer consumer)
- {
- }
-
- public void requestTopDownLeftRightResend(ImageConsumer consumer)
- {
- }
-
- public void run()
- {
- }
-} // class RenderableImageProducer
diff --git a/libjava/java/awt/image/renderable/RenderedImageFactory.java b/libjava/java/awt/image/renderable/RenderedImageFactory.java
deleted file mode 100644
index 6ff4cb03176..00000000000
--- a/libjava/java/awt/image/renderable/RenderedImageFactory.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* RenderedImageFactory.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.image.renderable;
-
-import java.awt.RenderingHints;
-import java.awt.image.RenderedImage;
-
-public interface RenderedImageFactory
-{
- RenderedImage create(ParameterBlock block, RenderingHints hints);
-} // interface RenderedImageFactory
diff --git a/libjava/java/awt/peer/ButtonPeer.java b/libjava/java/awt/peer/ButtonPeer.java
deleted file mode 100644
index a55fc2236db..00000000000
--- a/libjava/java/awt/peer/ButtonPeer.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ButtonPeer.java -- Peer interface for buttons
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface ButtonPeer extends ComponentPeer
-{
- void setLabel (String label);
-
-} // interface ButtonPeer
-
diff --git a/libjava/java/awt/peer/CanvasPeer.java b/libjava/java/awt/peer/CanvasPeer.java
deleted file mode 100644
index 4b33835a455..00000000000
--- a/libjava/java/awt/peer/CanvasPeer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* CanvasPeer.java -- Peer interface for a canvas
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface CanvasPeer extends ComponentPeer
-{
-
-} // interface CanvasPeer
-
diff --git a/libjava/java/awt/peer/CheckboxMenuItemPeer.java b/libjava/java/awt/peer/CheckboxMenuItemPeer.java
deleted file mode 100644
index 5213dc90693..00000000000
--- a/libjava/java/awt/peer/CheckboxMenuItemPeer.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/* CheckboxMenuItemPeer.java -- Peer interface for checkbox menu items
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface CheckboxMenuItemPeer extends MenuItemPeer
-{
- void setState (boolean state);
-
-} // interface CheckboxMenuItemPeer
-
diff --git a/libjava/java/awt/peer/CheckboxPeer.java b/libjava/java/awt/peer/CheckboxPeer.java
deleted file mode 100644
index 8b23b3f6f33..00000000000
--- a/libjava/java/awt/peer/CheckboxPeer.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* CheckboxPeer.java -- Interface for checkbox peer
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.CheckboxGroup;
-
-public interface CheckboxPeer extends ComponentPeer
-{
- void setCheckboxGroup (CheckboxGroup group);
-
- void setLabel (String label);
-
- void setState (boolean state);
-
-} // interface CheckboxPeer
-
diff --git a/libjava/java/awt/peer/ChoicePeer.java b/libjava/java/awt/peer/ChoicePeer.java
deleted file mode 100644
index 8ed11072e15..00000000000
--- a/libjava/java/awt/peer/ChoicePeer.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ChoicePeer.java -- Peer for choice box
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface ChoicePeer extends ComponentPeer
-{
- void add (String item, int index);
-
- void addItem (String item, int index);
-
- void remove (int index);
-
- void removeAll();
-
- void select (int index);
-
-} // interface ChoicePeer
-
diff --git a/libjava/java/awt/peer/ComponentPeer.java b/libjava/java/awt/peer/ComponentPeer.java
deleted file mode 100644
index 7ed8f6051db..00000000000
--- a/libjava/java/awt/peer/ComponentPeer.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/* ComponentPeer.java -- Toplevel component peer
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.AWTEvent;
-import java.awt.AWTException;
-import java.awt.BufferCapabilities;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.GraphicsConfiguration;
-import java.awt.Image;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.awt.event.PaintEvent;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageObserver;
-import java.awt.image.ImageProducer;
-import java.awt.image.VolatileImage;
-
-public interface ComponentPeer
-{
- int checkImage(Image img, int width, int height,
- ImageObserver ob);
- Image createImage(ImageProducer prod);
- Image createImage(int width, int height);
- void disable();
- void dispose();
- void enable();
- ColorModel getColorModel();
- FontMetrics getFontMetrics(Font f);
- Graphics getGraphics();
- Point getLocationOnScreen();
- Dimension getMinimumSize();
- Dimension getPreferredSize();
- Toolkit getToolkit();
- void handleEvent(AWTEvent e);
- void hide();
-
- /**
- * Part of the earlier 1.1 API, replaced by isFocusable().
- */
- boolean isFocusTraversable();
- boolean isFocusable();
- Dimension minimumSize();
- Dimension preferredSize();
- void paint(Graphics graphics);
- boolean prepareImage(Image img, int width, int height,
- ImageObserver ob);
- void print(Graphics graphics);
- void repaint(long tm, int x, int y, int width, int height);
-
- /**
- * Part of the earlier 1.1 API, apparently replaced by argument
- * form of the same method.
- */
- void requestFocus();
- boolean requestFocus (Component source, boolean bool1, boolean bool2, long x);
-
- void reshape(int x, int y, int width, int height);
- void setBackground(Color color);
- void setBounds(int x, int y, int width, int height);
-
- /**
- * Part of the earlier 1.1 API, apparently no longer needed.
- */
- void setCursor(Cursor cursor);
-
- void setEnabled(boolean enabled);
- void setFont(Font font);
- void setForeground(Color color);
- void setVisible(boolean visible);
- void show();
-
- /**
- * Get the graphics configuration of the component. The color model
- * of the component can be derived from the configuration.
- */
- GraphicsConfiguration getGraphicsConfiguration();
-
- /**
- * Part of an older API, no longer needed.
- */
- void setEventMask (long mask);
-
- // Methods below are introduced since 1.1
- boolean isObscured();
- boolean canDetermineObscurity();
- void coalescePaintEvent(PaintEvent e);
- void updateCursorImmediately();
- boolean handlesWheelScrolling();
-
- /**
- * A convenience method that creates a volatile image. The volatile
- * image is created on the screen device on which this component is
- * displayed, in the device's current graphics configuration.
- *
- * @param width width of the image
- * @param height height of the image
- *
- * @see VolatileImage
- *
- * @since 1.2
- */
- VolatileImage createVolatileImage(int width, int height);
-
- /**
- * Create a number of image buffers that implement a buffering
- * strategy according to the given capabilities.
- *
- * @param numBuffers the number of buffers
- * @param caps the buffering capabilities
- *
- * @throws AWTException if the specified buffering strategy is not
- * implemented
- *
- * @since 1.2
- */
- void createBuffers(int numBuffers, BufferCapabilities caps)
- throws AWTException;
-
- /**
- * Return the back buffer of this component.
- *
- * @return the back buffer of this component.
- *
- * @since 1.2
- */
- Image getBackBuffer();
-
- /**
- * Perform a page flip, leaving the contents of the back buffer in
- * the specified state.
- *
- * @param contents the state in which to leave the back buffer
- *
- * @since 1.2
- */
- void flip(BufferCapabilities.FlipContents contents);
-
- /**
- * Destroy the resources created by createBuffers.
- *
- * @since 1.2
- */
- void destroyBuffers();
-}
diff --git a/libjava/java/awt/peer/ContainerPeer.java b/libjava/java/awt/peer/ContainerPeer.java
deleted file mode 100644
index f1373a16472..00000000000
--- a/libjava/java/awt/peer/ContainerPeer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ContainerPeer.java -- Interface for container peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.Insets;
-
-public interface ContainerPeer extends ComponentPeer
-{
- Insets insets();
-
- Insets getInsets();
-
- void beginValidate();
-
- void endValidate();
-
- void beginLayout();
-
- void endLayout();
-
- boolean isPaintPending();
-
-} // interface ContainerPeer
-
diff --git a/libjava/java/awt/peer/DialogPeer.java b/libjava/java/awt/peer/DialogPeer.java
deleted file mode 100644
index e26d64ff96a..00000000000
--- a/libjava/java/awt/peer/DialogPeer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* DialogPeer.java -- Interface for dialog box peer
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface DialogPeer extends WindowPeer
-{
- void setResizable (boolean resizeable);
-
- void setTitle (String title);
-
-} // interface DialogPeer
-
diff --git a/libjava/java/awt/peer/FileDialogPeer.java b/libjava/java/awt/peer/FileDialogPeer.java
deleted file mode 100644
index 7db1798162a..00000000000
--- a/libjava/java/awt/peer/FileDialogPeer.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* FileDialogPeer.java -- Interface for file selection dialog box peer
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.io.FilenameFilter;
-
-public interface FileDialogPeer extends DialogPeer
-{
- void setFile (String file);
-
- void setDirectory (String dir);
-
- void setFilenameFilter (FilenameFilter ff);
-
-} // interface FileDialogPeer
-
diff --git a/libjava/java/awt/peer/FontPeer.java b/libjava/java/awt/peer/FontPeer.java
deleted file mode 100644
index f0ba6d830c8..00000000000
--- a/libjava/java/awt/peer/FontPeer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* FontPeer.java -- Interface for font peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface FontPeer
-{
-
-} // interface FontPeer
-
diff --git a/libjava/java/awt/peer/FramePeer.java b/libjava/java/awt/peer/FramePeer.java
deleted file mode 100644
index 13498ff2f67..00000000000
--- a/libjava/java/awt/peer/FramePeer.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* FramePeer.java -- Interface for frame peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.Image;
-import java.awt.MenuBar;
-import java.awt.Rectangle;
-
-public interface FramePeer extends WindowPeer
-{
- void setIconImage(Image image);
- void setMenuBar(MenuBar mb);
- void setResizable(boolean resizable);
- void setTitle(String title);
- int getState();
- void setState(int state);
- void setMaximizedBounds(Rectangle r);
-} // interface FramePeer
-
diff --git a/libjava/java/awt/peer/LabelPeer.java b/libjava/java/awt/peer/LabelPeer.java
deleted file mode 100644
index d0fca462fdc..00000000000
--- a/libjava/java/awt/peer/LabelPeer.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/* LabelPeer.java -- Interface for simple text lable peer
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface LabelPeer extends ComponentPeer
-{
- void setAlignment(int alignment);
- void setText(String text);
-} // interface LabelPeer
-
diff --git a/libjava/java/awt/peer/LightweightPeer.java b/libjava/java/awt/peer/LightweightPeer.java
deleted file mode 100644
index 93cad7a0318..00000000000
--- a/libjava/java/awt/peer/LightweightPeer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* LightweightPeer.java -- Interface for lightweight peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface LightweightPeer extends ComponentPeer
-{
-
-} // interface LightweightPeer
-
diff --git a/libjava/java/awt/peer/ListPeer.java b/libjava/java/awt/peer/ListPeer.java
deleted file mode 100644
index c0f765d1655..00000000000
--- a/libjava/java/awt/peer/ListPeer.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ListPeer.java -- Interface for list box peer
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.Dimension;
-
-public interface ListPeer extends ComponentPeer
-{
- void add(String item, int index);
- void addItem(String item, int index);
- void clear();
- void delItems(int start_index, int end_index);
- void deselect(int index);
- int[] getSelectedIndexes();
- void makeVisible(int index);
- Dimension minimumSize(int s);
- Dimension preferredSize(int s);
- void removeAll();
- void select(int index);
- void setMultipleMode(boolean multi);
- void setMultipleSelections(boolean multi);
- Dimension getPreferredSize(int s);
- Dimension getMinimumSize(int s);
-} // interface ListPeer
-
diff --git a/libjava/java/awt/peer/MenuBarPeer.java b/libjava/java/awt/peer/MenuBarPeer.java
deleted file mode 100644
index c5f7c581ff5..00000000000
--- a/libjava/java/awt/peer/MenuBarPeer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* MenuBarPeer.java -- Interface for menu bar peer
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.Menu;
-
-public interface MenuBarPeer extends MenuComponentPeer
-{
- void addHelpMenu(Menu menu);
- void delMenu(int index);
-} // interface MenuBarPeer
-
diff --git a/libjava/java/awt/peer/MenuComponentPeer.java b/libjava/java/awt/peer/MenuComponentPeer.java
deleted file mode 100644
index 1b10ca1f4c7..00000000000
--- a/libjava/java/awt/peer/MenuComponentPeer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* MenuComponentPeer.java --
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface MenuComponentPeer
-{
- void dispose();
-} // interface MenuComponentPeer
-
diff --git a/libjava/java/awt/peer/MenuItemPeer.java b/libjava/java/awt/peer/MenuItemPeer.java
deleted file mode 100644
index 3ba1027e501..00000000000
--- a/libjava/java/awt/peer/MenuItemPeer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* MenuItemPeer.java -- Interface for menu item peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface MenuItemPeer extends MenuComponentPeer
-{
- void disable();
- void enable();
- void setEnabled(boolean enabled);
- void setLabel(String text);
-} // interface MenuItemPeer
-
diff --git a/libjava/java/awt/peer/MenuPeer.java b/libjava/java/awt/peer/MenuPeer.java
deleted file mode 100644
index c51ea73bb6c..00000000000
--- a/libjava/java/awt/peer/MenuPeer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* MenuPeer.java -- Interface for menu peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.MenuItem;
-
-public interface MenuPeer extends MenuItemPeer
-{
- void addItem (MenuItem item);
- void delItem (int index);
-}
-
diff --git a/libjava/java/awt/peer/PanelPeer.java b/libjava/java/awt/peer/PanelPeer.java
deleted file mode 100644
index 192632e46b3..00000000000
--- a/libjava/java/awt/peer/PanelPeer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* PanelPeer.java -- Interface for panel peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface PanelPeer extends ContainerPeer
-{
-
-} // interface PanelPeer
-
diff --git a/libjava/java/awt/peer/PopupMenuPeer.java b/libjava/java/awt/peer/PopupMenuPeer.java
deleted file mode 100644
index 2e8f4bbedc5..00000000000
--- a/libjava/java/awt/peer/PopupMenuPeer.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* PopupMenuPeer.java -- Interface for popup menu peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.Component;
-import java.awt.Event;
-
-public interface PopupMenuPeer extends MenuPeer
-{
- /**
- * Part of the older API, replaced by event version instead.
- */
- void show (Component origin, int x, int y);
-
- void show (Event e);
-} // interface PopupMenuPeer
-
diff --git a/libjava/java/awt/peer/RobotPeer.java b/libjava/java/awt/peer/RobotPeer.java
deleted file mode 100644
index db81c809d72..00000000000
--- a/libjava/java/awt/peer/RobotPeer.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* RobotPeer.java -- Interface for programatically driving GUI
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.Rectangle;
-
-public interface RobotPeer
-{
- void mouseMove (int x, int y);
- void mousePress (int buttons);
- void mouseRelease (int buttons);
- void mouseWheel (int wheelAmt);
- void keyPress (int keycode);
- void keyRelease (int keycode);
- int getRGBPixel (int x, int y);
- int[] getRGBPixels (Rectangle screen);
-} // interface RobotPeer
-
diff --git a/libjava/java/awt/peer/ScrollPanePeer.java b/libjava/java/awt/peer/ScrollPanePeer.java
deleted file mode 100644
index de4331e04d1..00000000000
--- a/libjava/java/awt/peer/ScrollPanePeer.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScrollPanePeer.java -- Interface for scrollable panes
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.Adjustable;
-
-public interface ScrollPanePeer extends ContainerPeer
-{
- int getHScrollbarHeight();
- int getVScrollbarWidth();
- void setScrollPosition(int h, int v);
- void childResized(int width, int height);
- void setUnitIncrement(Adjustable item, int inc);
- void setValue(Adjustable item, int value);
-} // interface ScollPanePeer
-
diff --git a/libjava/java/awt/peer/ScrollbarPeer.java b/libjava/java/awt/peer/ScrollbarPeer.java
deleted file mode 100644
index fe4f24d649f..00000000000
--- a/libjava/java/awt/peer/ScrollbarPeer.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScrollbarPeer.java -- Interface for scrollbar peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface ScrollbarPeer extends ComponentPeer
-{
- void setLineIncrement(int inc);
- void setPageIncrement(int inc);
- void setValues(int value, int visible, int min, int max);
-} // interface ScrollbarPeer
-
diff --git a/libjava/java/awt/peer/TextAreaPeer.java b/libjava/java/awt/peer/TextAreaPeer.java
deleted file mode 100644
index 354e46d9cc6..00000000000
--- a/libjava/java/awt/peer/TextAreaPeer.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* TextAreaPeer.java -- Interface for text area peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.Dimension;
-
-public interface TextAreaPeer extends TextComponentPeer
-{
- void insert(String text, int pos);
- void insertText(String text, int pos);
- Dimension minimumSize(int rows, int cols);
- Dimension getMinimumSize(int rows, int cols);
- Dimension preferredSize(int rows, int cols);
- Dimension getPreferredSize(int rows, int cols);
- void replaceRange(String text, int start_pos, int end_pos);
- void replaceText(String text, int start_pos, int end_pos);
-} // interface TextAreaPeer
diff --git a/libjava/java/awt/peer/TextComponentPeer.java b/libjava/java/awt/peer/TextComponentPeer.java
deleted file mode 100644
index cacc7d8de4e..00000000000
--- a/libjava/java/awt/peer/TextComponentPeer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* TextComponentPeer.java -- Superclass interface for text components
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.Rectangle;
-
-public interface TextComponentPeer extends ComponentPeer
-{
- int getSelectionEnd();
- int getSelectionStart();
- String getText();
- void setText(String text);
- void select(int start_pos, int end_pos);
- void setEditable(boolean editable);
- int getCaretPosition();
- void setCaretPosition(int pos);
- int getIndexAtPoint(int x, int y);
- Rectangle getCharacterBounds(int pos);
- long filterEvents(long filter);
-} // interface TextComponentPeer
-
diff --git a/libjava/java/awt/peer/TextFieldPeer.java b/libjava/java/awt/peer/TextFieldPeer.java
deleted file mode 100644
index e68d6663fdc..00000000000
--- a/libjava/java/awt/peer/TextFieldPeer.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* TextFieldPeer.java -- Interface for text field peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-import java.awt.Dimension;
-
-public interface TextFieldPeer extends TextComponentPeer
-{
- Dimension minimumSize(int len);
- Dimension preferredSize(int len);
- Dimension getMinimumSize(int len);
- Dimension getPreferredSize(int len);
- void setEchoChar(char echo_char);
- void setEchoCharacter(char echo_char);
-} // interface TextFieldPeer
-
diff --git a/libjava/java/awt/peer/WindowPeer.java b/libjava/java/awt/peer/WindowPeer.java
deleted file mode 100644
index 8f136dd2d85..00000000000
--- a/libjava/java/awt/peer/WindowPeer.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/* WindowPeer.java -- Interface for window peers
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.peer;
-
-public interface WindowPeer extends ContainerPeer
-{
- void toBack();
- void toFront();
-} // interface WindowPeer
-
diff --git a/libjava/java/awt/print/Book.java b/libjava/java/awt/print/Book.java
deleted file mode 100644
index b084a1723f1..00000000000
--- a/libjava/java/awt/print/Book.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Book.java -- A mixed group of pages to print.
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.print;
-
-import java.util.Vector;
-
-/**
- * This class allows documents to be created with different paper types,
- * page formatters, and painters.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Book implements Pageable
-{
- /**
- * Painter objects for the book.
- */
- Vector printables = new Vector();
-
- /**
- * Page formats for the book.
- */
- Vector page_formats = new Vector();
-
- /**
- * Initializes a new instance of <code>Book</code> that is empty.
- */
- public Book()
- {
- }
-
- /**
- * Returns the number of pages in this book.
- *
- * @return The number of pages in this book.
- */
- public int getNumberOfPages()
- {
- return printables.size();
- }
-
- /**
- * This method returns the <code>PageFormat</code> object for the
- * specified page.
- *
- * @param page_number The number of the page to get information for, where
- * page numbers start at 0.
- *
- * @return The <code>PageFormat</code> object for the specified page.
- *
- * @exception IndexOutOfBoundsException If the page number is not valid.
- */
- public PageFormat getPageFormat(int page_number)
- {
- return (PageFormat) page_formats.elementAt(page_number);
- }
-
- /**
- * This method returns the <code>Printable</code> object for the
- * specified page.
- *
- * @param page_number The number of the page to get information for, where
- * page numbers start at 0.
- *
- * @return The <code>Printable</code> object for the specified page.
- *
- * @exception IndexOutOfBoundsException If the page number is not valid.
- */
- public Printable getPrintable(int page_number)
- {
- return (Printable) printables.elementAt(page_number);
- }
-
- /**
- * This method appends a page to the end of the book.
- *
- * @param printable The <code>Printable</code> for this page.
- * @param page_format The <code>PageFormat</code> for this page.
- *
- * @exception NullPointerException If either argument is <code>null</code>.
- */
- public void append(Printable printable, PageFormat page_format)
- {
- append(printable, page_format, 1);
- }
-
- /**
- * This method appends the specified number of pages to the end of the book.
- * Each one will be associated with the specified <code>Printable</code>
- * and <code>PageFormat</code>.
- *
- * @param printable The <code>Printable</code> for this page.
- * @param page_format The <code>PageFormat</code> for this page.
- * @param num_pages The number of pages to append.
- *
- * @exception NullPointerException If any argument is <code>null</code>.
- */
- public void append(Printable printable, PageFormat page_format, int num_pages)
- {
- for (int i = 0; i < num_pages; i++)
- {
- printables.addElement(printable);
- page_formats.addElement(page_format);
- }
- }
-
- /**
- * This method changes the <code>Printable</code> and <code>PageFormat</code>
- * for the specified page. The page must already exist or an exception
- * will be thrown.
- *
- * @param page_num The page number to alter.
- * @param printable The new <code>Printable</code> for the page.
- * @param page_format The new <code>PageFormat</code> for the page.
- *
- * @throws IndexOutOfBoundsException If the specified page does not exist.
- */
- public void setPage(int page_num, Printable printable, PageFormat page_format)
- {
- printables.setElementAt(printable, page_num);
- page_formats.setElementAt(page_format, page_num);
- }
-}
diff --git a/libjava/java/awt/print/PageFormat.java b/libjava/java/awt/print/PageFormat.java
deleted file mode 100644
index 6399552de44..00000000000
--- a/libjava/java/awt/print/PageFormat.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/* PageFormat.java -- Information about the page format
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.print;
-
-/**
- * This class contains information about the desired page format to
- * use for printing a particular set of pages.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class PageFormat implements Cloneable
-{
-
-/*
- * Static Variables
- */
-
-/**
- * A constant for a landscaped page orientation. Used by
- * <code>getOrientation</code> and <code>setOrientation</code>.
- */
-public static final int LANDSCAPE = 0;
-
-/**
- * A constant for a portrait page orientation. Used by
- * <code>getOrientation</code> and <code>setOrientation</code>.
- */
-public static final int PORTRAIT = 1;
-
-/**
- * A constant for a reversed landscaped page orientation. This is
- * the orientation used by Macintosh's for landscape. The origin is
- * in the upper right hand corner instead of the upper left. The
- * X and Y axes are reversed. Used by <code>getOrientation</code> and
- * <code>setOrientation</code>.
- */
-public static final int REVERSE_LANDSCAPE = 2;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-// The page orientation
-private int orientation;
-
-// The paper type
-private Paper paper;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * This method creates a default page layout, which will be in portrait
- * format.
- */
-public
-PageFormat()
-{
- this.paper = new Paper();
- this.orientation = PORTRAIT;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * This method returns the width of the page, in 1/72nd's of an inch. The
- * "width" measured depends on orientation.
- *
- * @return The width of the page.
- */
-public double
-getWidth()
-{
- return(paper.getWidth());
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the height of the page, in 1/72nd's of an inch.
- * The "height" measured depends on the orientation.
- *
- * @return The height of the page.
- */
-public double
-getHeight()
-{
- return(paper.getHeight());
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the X coordinate value of the upper leftmost
- * drawable area of the paper.
- *
- * @return The upper leftmost imageable X coordinate.
- */
-public double
-getImageableX()
-{
- return(paper.getImageableX());
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the Y coordinate value of the upper leftmost
- * drawable area of the paper.
- *
- * @return The upper leftmost imageable Y coordinate.
- */
-public double
-getImageableY()
-{
- return(paper.getImageableY());
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the imageable width of the paper, in 1/72nd's of
- * an inch.
- *
- * @return The imageable width of the paper.
- */
-public double
-getImageableWidth()
-{
- return(paper.getImageableWidth());
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the imageable height of the paper, in 1/72nd's of
- * an inch.
- *
- * @return The imageable height of the paper.
- */
-public double getImageableHeight()
-{
- return(paper.getImageableHeight());
-}
-
-/*************************************************************************/
-
-/**
- * Returns a copy of the <code>paper</code> object being used for this
- * page format.
- *
- * @return A copy of the <code>Paper</code> object for this format.
- */
-public Paper
-getPaper()
-{
- return((Paper)paper.clone());
-}
-
-/*************************************************************************/
-
-/**
- * Sets the <code>Paper</code> object to be used by this page format.
- *
- * @param paper The new <code>Paper</code> object for this page format.
- */
-public void
-setPaper(Paper paper)
-{
- this.paper = paper;
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the current page orientation. The value returned
- * will be one of the page orientation constants from this class.
- *
- * @return The current page orientation.
- */
-public int
-getOrientation()
-{
- return(orientation);
-}
-
-/*************************************************************************/
-
-/**
- * This method sets the page orientation for this format to the
- * specified value. It must be one of the page orientation constants
- * from this class or an exception will be thrown.
- *
- * @param orientation The new page orientation.
- *
- * @exception IllegalArgumentException If the specified page orientation
- * value is not one of the constants from this class.
- */
-public void
-setOrientation(int orientation) throws IllegalArgumentException
-{
- if ((orientation != PORTRAIT) &&
- (orientation != LANDSCAPE) &&
- (orientation != REVERSE_LANDSCAPE))
- throw new IllegalArgumentException("Bad page orientation value: " +
- orientation);
-
- this.orientation = orientation;
-}
-
-/*************************************************************************/
-
-/**
- * This method returns a matrix used for transforming user space
- * coordinates to page coordinates. The value returned will be six
- * doubles as described in <code>java.awt.geom.AffineTransform</code>.
- *
- * @return The transformation matrix for this page format.
- */
-public double[]
-getMatrix()
-{
- throw new RuntimeException("Not implemented since I don't know what to do");
-}
-
-/*************************************************************************/
-
-/**
- * This method returns a copy of this object.
- *
- * @return A copy of this object.
- */
-public Object
-clone()
-{
- try
- {
- return(super.clone());
- }
- catch(CloneNotSupportedException e)
- {
- return(null);
- }
-}
-
-} // class PageFormat
-
diff --git a/libjava/java/awt/print/Pageable.java b/libjava/java/awt/print/Pageable.java
deleted file mode 100644
index 12fa542a8c6..00000000000
--- a/libjava/java/awt/print/Pageable.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Pageable.java -- Pages to be printed
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.print;
-
-/**
- * This interface represents pages that are to be printed.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Pageable
-{
-
-/*
- * Static Variables
- */
-
-/**
- * This constant is returned when <code>getNumberOfPages()</code>
- * cannot determine the number of pages available for printing.
- */
-int UNKNOWN_NUMBER_OF_PAGES = -1;
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * This method returns the number of pages this object contains, or
- * <code>UNKNOWN_NUMBER_OF_PAGES</code> if it cannot determine the number
- * of pages to be printed.
- *
- * @return The number of pages to be printed, or
- * <code>UNKNOWN_NUMBER_OF_PAGES</code> if this is unknown.
- */
-int
-getNumberOfPages();
-
-/*************************************************************************/
-
-/**
- * This method returns the <code>PageFormat</code> instance for the
- * specified page. Page numbers start at zero. An exception is thrown if
- * the requested page does not exist.
- *
- * @param pageIndex The index of the page to return the
- * <code>PageFormat</code> for.
- *
- * @return The <code>PageFormat</code> for the requested page.
- *
- * @exception IndexOutOfBoundsException If the requested page number does
- * not exist.
- */
-PageFormat
-getPageFormat(int pageIndex) throws IndexOutOfBoundsException;
-
-/*************************************************************************/
-
-/**
- * This method returns the <code>Printable</code> instance for the
- * specified page. Page numbers start at zero. An exception is thrown if
- * the requested page does not exist.
- *
- * @param pageIndex The index of the page to return the
- * <code>Printable</code> for.
- *
- * @return The <code>Printable</code> for the requested page.
- *
- * @exception IndexOutOfBoundsException If the requested page number does
- * not exist.
- */
-Printable
-getPrintable(int pageIndex) throws IndexOutOfBoundsException;
-
-} // interface Pageable
-
diff --git a/libjava/java/awt/print/Paper.java b/libjava/java/awt/print/Paper.java
deleted file mode 100644
index 4579da3ea3c..00000000000
--- a/libjava/java/awt/print/Paper.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Paper.java -- Information about a paper type.
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.print;
-
-/**
- * This class describes a particular type of paper.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Paper implements Cloneable
-{
-
-/*
- * Instance Variables
- */
-
-// Height of the paper
-private double height;
-
-// Width of the paper
-private double width;
-
-// Upper left imageable X coordinate
-private double imageableX;
-
-// Upper left imageable Y coordinate
-private double imageableY;
-
-// Imageable width of the page
-private double imageableWidth;
-
-// Imageable height of the page
-private double imageableHeight;
-
-/*************************************************************************/
-
-/*
- * Constructor
- */
-
-/**
- * This method creates a letter sized paper with one inch margins
- */
-public
-Paper()
-{
- width = 8.5 * 72;
- height = 11 * 72;
- imageableX = 72;
- imageableY = 72;
- imageableWidth = width - (2 * 72);
- imageableHeight = height - (2 * 72);
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the height of the paper in 1/72nds of an inch.
- *
- * @return The height of the paper in 1/72nds of an inch.
- */
-public double
-getHeight()
-{
- return(height);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the width of the paper in 1/72nds of an inch.
- *
- * @return The width of the paper in 1/72nds of an inch.
- */
-public double
-getWidth()
-{
- return(width);
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the X coordinate of the upper left hand corner
- * of the imageable area of the paper.
- *
- * @return The X coordinate of the upper left hand corner of the imageable
- * area of the paper.
- */
-public double
-getImageableX()
-{
- return(imageableX);
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the Y coordinate of the upper left hand corner
- * of the imageable area of the paper.
- *
- * @return The Y coordinate of the upper left hand corner of the imageable
- * area of the paper.
- */
-public double
-getImageableY()
-{
- return(imageableY);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the width of the imageable area of the paper.
- *
- * @return The width of the imageable area of the paper.
- */
-public double
-getImageableWidth()
-{
- return(imageableWidth);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the height of the imageable area of the paper.
- *
- * @return The height of the imageable area of the paper.
- */
-public double
-getImageableHeight()
-{
- return(imageableHeight);
-}
-
-/*************************************************************************/
-
-/**
- * This method sets the size of the paper to the specified width and
- * height, which are specified in 1/72nds of an inch.
- *
- * @param width The width of the paper in 1/72nds of an inch.
- * @param height The height of the paper in 1/72nds of an inch.
- */
-public void
-setSize(double width, double height)
-{
- this.width = width;
- this.height = height;
-}
-
-/*************************************************************************/
-
-/**
- * This method sets the imageable area of the paper by specifying the
- * coordinates of the upper left hand corner of that area, and its
- * length and height. All values are in 1/72nds of an inch.
- *
- * @param imageableX The X coordinate of the upper left hand corner of
- * the imageable area, in 1/72nds of an inch.
- * @param imageableY The Y coordinate of the upper left hand corner of
- * the imageable area, in 1/72nds of an inch.
- * @param imageableWidth The width of the imageable area of the paper,
- * in 1/72nds of an inch.
- * @param imageableHeight The heigth of the imageable area of the paper,
- * in 1/72nds of an inch.
- */
-public void
-setImageableArea(double imageableX, double imageableY,
- double imageableWidth, double imageableHeight)
-{
- this.imageableX = imageableX;
- this.imageableY = imageableY;
- this.imageableWidth = imageableWidth;
- this.imageableHeight = imageableHeight;
-}
-
-/*************************************************************************/
-
-/**
- * This method creates a copy of this object.
- *
- * @return A copy of this object.
- */
-public Object
-clone()
-{
- try
- {
- return(super.clone());
- }
- catch(CloneNotSupportedException e)
- {
- return(null);
- }
-}
-
-} // class Paper
-
diff --git a/libjava/java/awt/print/Printable.java b/libjava/java/awt/print/Printable.java
deleted file mode 100644
index 775167e669d..00000000000
--- a/libjava/java/awt/print/Printable.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Printable.java -- Renders a page to the print device
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.print;
-
-import java.awt.Graphics;
-
-
-/**
- * This interface provides a mechanism for the actual printing of pages to the
- * printer. The object implementing this interface performs the page
- * rendering.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Printable
-{
- /**
- * This value is returned by the <code>print()</code> method to indicate
- * that the requested page exists and has been printed.
- */
- int PAGE_EXISTS = 0;
-
- /**
- * This value is returned by the <code>print()</code> method to indicate
- * that the requested page number does not exist.
- */
- int NO_SUCH_PAGE = 1;
-
- /**
- * This method prints the specified page to the specified graphics
- * context in the specified format. The pages are numbered starting
- * from zero.
- *
- * @param graphics The graphics context to render the pages on.
- * @param format The format in which to print the page.
- * @param page_number The page number to print, where numbers start at zero.
- *
- * @return <code>PAGE_EXISTS</code> if the requested page exists and was
- * successfully printed, <code>NO_SUCH_PAGE</code> otherwise.
- *
- * @exception PrinterException If an error occurs during printing.
- */
- int print(Graphics graphics, PageFormat format, int page_number)
- throws PrinterException;
-}
diff --git a/libjava/java/awt/print/PrinterAbortException.java b/libjava/java/awt/print/PrinterAbortException.java
deleted file mode 100644
index 4580630790d..00000000000
--- a/libjava/java/awt/print/PrinterAbortException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* PrinterAbortException.java -- Indicates the print job was aborted
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.print;
-
-/**
- * This exception is thrown when the print job is aborted, either by the
- * user or by the application.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class PrinterAbortException extends PrinterException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 4725169026278854136L;
-
- /**
- * Create a new instance with no detailed error message.
- */
- public PrinterAbortException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public PrinterAbortException(String message)
- {
- super(message);
- }
-} // class PrinterAbortException
diff --git a/libjava/java/awt/print/PrinterException.java b/libjava/java/awt/print/PrinterException.java
deleted file mode 100644
index c105f549de4..00000000000
--- a/libjava/java/awt/print/PrinterException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* PrinterException.java -- generic problem in the printing subsystem
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.print;
-
-/**
- * This is the generic toplevel exception for printing errors. Subclasses
- * provide more detailed descriptions of the problem.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class PrinterException extends Exception
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -3757589981158265819L;
-
- /**
- * Create a new instance with no detailed error message.
- */
- public PrinterException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public PrinterException(String message)
- {
- super(message);
- }
-} // class PrinterException
diff --git a/libjava/java/awt/print/PrinterGraphics.java b/libjava/java/awt/print/PrinterGraphics.java
deleted file mode 100644
index 5ca64190424..00000000000
--- a/libjava/java/awt/print/PrinterGraphics.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* PrinterGraphics.java -- Hook to return print job controller.
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.print;
-
-/**
- * This interface is implemented by the <code>Graphics</code> instance
- * that is used for rendering pages. It provides a hook to return the
- * object that is controlling the print job.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface PrinterGraphics
-{
-
-/**
- * This method returns the instance of <code>PrinterJob</code> that is
- * controlling this print job.
- *
- * @return The <code>PrinterJob</code> that is controlling this print job.
- */
-PrinterJob
-getPrinterJob();
-
-} // interface PrinterGraphics
-
diff --git a/libjava/java/awt/print/PrinterIOException.java b/libjava/java/awt/print/PrinterIOException.java
deleted file mode 100644
index c646acdec3a..00000000000
--- a/libjava/java/awt/print/PrinterIOException.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* PrinterIOException.java -- The print job encountered an I/O error
- Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.print;
-
-import java.io.IOException;
-
-/**
- * This exception is thrown when the print job encounters an I/O problem
- * of some kind.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @status updated to 1.4
- */
-public class PrinterIOException extends PrinterException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 5850870712125932846L;
-
- /**
- * The exception that caused this (duplicates Throwable).
- *
- * @serial the I/O exception that terminated the job
- */
- private final IOException mException;
-
- /**
- * Initializes a new instance with the given cause.
- *
- * @param mException the cause
- */
- public PrinterIOException(IOException mException)
- {
- super(mException == null ? null : mException.toString());
- initCause(mException);
- this.mException = mException;
- }
-
- /**
- * Gets the underlying <code>IOException</code> that caused this exception.
- * This legacy method has been replaced by {@link #getCause()}.
- *
- * @return the cause
- */
- public IOException getIOException()
- {
- return mException;
- }
-
- /**
- * Gets the cause.
- *
- * @return the cause
- */
- public Throwable getCause()
- {
- return mException;
- }
-} // class PrinterIOException
-
diff --git a/libjava/java/awt/print/PrinterJob.java b/libjava/java/awt/print/PrinterJob.java
deleted file mode 100644
index e61ab61bc77..00000000000
--- a/libjava/java/awt/print/PrinterJob.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/* PrinterJob.java -- This job is the printer control class
- Copyright (C) 1999, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.awt.print;
-
-import java.awt.HeadlessException;
-
-import javax.print.PrintService;
-import javax.print.attribute.PrintRequestAttributeSet;
-
-/**
- * This class controls printing.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public abstract class PrinterJob
-{
- // The print service associated with this job
- private PrintService printer = null;
-
- /**
- * Creates a new print job.
- *
- * @return A <code>PrinterJob</code> object for the newly created print job.
- */
- public static PrinterJob getPrinterJob()
- {
- // FIXME: Need to fix this to load a default implementation instance.
- return null;
- }
-
- /**
- * Initializes a new instance of <code>PrinterJob</code>.
- */
- public PrinterJob()
- {
- }
-
- /**
- * Returns the number of copies to be printed.
- *
- * @return The number of copies to be printed.
- */
- public abstract int getCopies();
-
- /**
- * Sets the number of copies to be printed.
- *
- * @param copies The number of copies to be printed.
- */
- public abstract void setCopies(int copies);
-
- /**
- * Returns the name of the print job.
- *
- * @return The name of the print job.
- */
- public abstract String getJobName();
-
- /**
- * Sets the name of the print job.
- *
- * @param job_name The name of the print job.
- */
- public abstract void setJobName(String job_name);
-
- /**
- * Returns the printing user name.
- *
- * @return The printing username.
- */
- public abstract String getUserName();
-
- /**
- * Cancels an in progress print job.
- */
- public abstract void cancel();
-
- /**
- * Tests whether or not this job has been cancelled.
- *
- * @return <code>true</code> if this job has been cancelled, <code>false</code>
- * otherwise.
- */
- public abstract boolean isCancelled();
-
- /**
- * Returns an instance of the default page which will have the default
- * paper and orientation.
- *
- * @return A default instance of <code>PageFormat</code>.
- */
- public PageFormat defaultPage()
- {
- return new PageFormat();
- }
-
- /**
- * Clones the specified <code>PageFormat</code> object then alters the
- * clone so that it represents the default page format.
- *
- * @param page_format The <code>PageFormat</code> to clone.
- *
- * @return A new default page format.
- */
- public abstract PageFormat defaultPage(PageFormat page_format);
-
- /**
- * Displays a dialog box to the user which allows the page format
- * attributes to be modified.
- *
- * @param page_format The <code>PageFormat</code> object to modify.
- *
- * @return The modified <code>PageFormat</code>.
- */
- public abstract PageFormat pageDialog(PageFormat page_format)
- throws HeadlessException;
-
- /**
- * @since 1.4
- */
- public PageFormat pageDialog(PrintRequestAttributeSet attributes)
- throws HeadlessException
- {
- // FIXME: Implement this for real.
- return pageDialog((PageFormat) null);
- }
-
- /**
- * Prints the pages.
- */
- public abstract void print () throws PrinterException;
-
- /**
- * Prints the page with given attributes.
- */
- public abstract void print (PrintRequestAttributeSet attributes)
- throws PrinterException;
-
- /**
- * Displays a dialog box to the user which allows the print job
- * attributes to be modified.
- *
- * @return <code>false</code> if the user cancels the dialog box,
- * <code>true</code> otherwise.
- */
- public abstract boolean printDialog()
- throws HeadlessException;
-
- /**
- * Displays a dialog box to the user which allows the print job
- * attributes to be modified.
- *
- * @return <code>false</code> if the user cancels the dialog box,
- * <code>true</code> otherwise.
- */
- public boolean printDialog(PrintRequestAttributeSet attributes)
- throws HeadlessException
- {
- // FIXME: Implement this for real.
- return printDialog();
- }
-
- /**
- * This sets the pages that are to be printed.
- *
- * @param pageable The pages to be printed, which may not be <code>null</code>.
- */
- public abstract void setPageable(Pageable pageable);
-
- /**
- * Sets this specified <code>Printable</code> as the one to use for
- * rendering the pages on the print device.
- *
- * @param printable The <code>Printable</code> for the print job.
- */
- public abstract void setPrintable(Printable printable);
-
- /**
- * Sets the <code>Printable</code> and the page format for the pages
- * to be printed.
- *
- * @param printable The <code>Printable</code> for the print job.
- * @param page_format The <code>PageFormat</code> for the print job.
- */
- public abstract void setPrintable(Printable printable, PageFormat page_format);
-
- /**
- * Makes any alterations to the specified <code>PageFormat</code>
- * necessary to make it work with the current printer. The alterations
- * are made to a clone of the input object, which is then returned.
- *
- * @param page_format The <code>PageFormat</code> to validate.
- *
- * @return The validated <code>PageFormat</code>.
- */
- public abstract PageFormat validatePage(PageFormat page_format);
-
- /**
- * Find and return 2D image print services.
- *
- * This is the same as calling PrintServiceLookup.lookupPrintServices()
- * with Pageable service-specified DocFlavor.
- * @return Array of PrintService objects, could be empty.
- * @since 1.4
- */
- public static PrintService[] lookupPrintServices()
- {
- return new PrintService[0];
- // FIXME:
- // Enable this when javax.print has this implemented.
-// return PrintServiceLookup.lookupPrintServices(
-// new DocFlavor("application/x-java-jvm-local-objectref",
-// "java.awt.print.Pageable"),
-// null);
- }
-
- /**
- * Find and return 2D image stream print services.
- *
- * This is the same as calling
- * StreamPrintServiceFactory.lookupStreamPrintServices()
- * with Pageable service-specified DocFlavor.
- * @param mimeType The output format mime type, or null for any type.
- * @return Array of stream print services, could be empty.
- * @since 1.4
- */
- // FIXME:
- // Enable when javax.print has StreamPrintServiceFactory
-// public static StreamPrintServiceFactory[] lookupStreamPrintServices(String mimeType)
-// {
-// return StreamPrintServiceFactory.lookupStreamServiceFactories(
-// new DocFlavor("application/x-java-jvm-local-objectref",
-// "java.awt.print.Pageable"),
-// mimeType);
-// }
-
- /**
- * Return the printer for this job. If print services aren't supported by
- * the subclass, returns null.
- *
- * @return The associated PrintService.
- * @since 1.4
- */
- public PrintService getPrintService()
- {
- return null;
- }
-
- /**
- * Change the printer for this print job to service. Subclasses that
- * support setting the print service override this method. Throws
- * PrinterException when the class doesn't support setting the printer,
- * the service doesn't support Pageable or Printable interfaces for 2D
- * print output.
- * @param service The new printer to use.
- * @throws PrinterException if service is not valid.
- */
- public void setPrintService(PrintService service)
- throws PrinterException
- {
- throw new PrinterException();
- }
-}
diff --git a/libjava/java/beans/AppletInitializer.java b/libjava/java/beans/AppletInitializer.java
deleted file mode 100644
index 69dc2cae50e..00000000000
--- a/libjava/java/beans/AppletInitializer.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* java.beans.AppletInitializer
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.applet.Applet;
-import java.beans.beancontext.BeanContext;
-
-
-/** This interface is a mechanism for the initialization of a Java
- * Bean that is also an Applet. It is used by
- * <code>Beans.instantiate()</code>.
- *
- * @author Tom Tromey (tromey@redhat.com)
- * @since 1.2
- */
-public interface AppletInitializer
-{
- /** Activate the applet. */
- void activate (Applet applet);
-
- /** This method will be called by <code>Beans.instantiate()</code>
- * to associated the new Applet with its AppletContext, AppletStub,
- * and Container.
- */
- void initialize (Applet applet, BeanContext context);
-}
diff --git a/libjava/java/beans/BeanDescriptor.java b/libjava/java/beans/BeanDescriptor.java
deleted file mode 100644
index 21227b2fee0..00000000000
--- a/libjava/java/beans/BeanDescriptor.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* java.beans.BeanDescriptor
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/**
- ** BeanDescriptor describes general information about a Bean, plus
- ** stores the Bean's Class and it's customizer's Class.<P>
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 31 May 1998
- **/
-
-public class BeanDescriptor extends FeatureDescriptor {
- Class beanClass;
- Class customizerClass;
-
- /** Create a new BeanDescriptor with the given beanClass and
- ** no customizer class.
- ** @param beanClass the class of the Bean.
- **/
- public BeanDescriptor(Class beanClass) {
- this(beanClass,null);
- }
-
- /** Create a new BeanDescriptor with the given bean class and
- ** customizer class.
- ** @param beanClass the class of the Bean.
- ** @param customizerClass the class of the Bean's Customizer.
- **/
- public BeanDescriptor(Class beanClass, Class customizerClass) {
- this.beanClass = beanClass;
- this.customizerClass = customizerClass;
-
- // Set the FeatureDescriptor programmatic name.
- String name = beanClass.getName();
- int lastInd = name.lastIndexOf('.');
- if (lastInd != -1)
- name = name.substring(lastInd + 1);
-
- setName(name);
- }
-
- /** Get the Bean's class. **/
- public Class getBeanClass() {
- return beanClass;
- }
-
- /** Get the Bean's customizer's class. **/
- public Class getCustomizerClass() {
- return customizerClass;
- }
-}
diff --git a/libjava/java/beans/BeanInfo.java b/libjava/java/beans/BeanInfo.java
deleted file mode 100644
index 525500a389c..00000000000
--- a/libjava/java/beans/BeanInfo.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/* java.beans.BeanInfo
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/**
- ** BeanInfo can be implemented in order to provide explicit information to the Introspector.
- **
- ** When you write a BeanInfo class, you implement this interface
- ** and provide explicit information by returning a non-null
- ** value from the appropriate method. If you wish the
- ** Introspector to determine certain information in the normal
- ** way, just return null (or in the case of int methods, return
- ** -1). There is a class called SimpleBeanInfo which returns
- ** null from all methods, which you may extend and only
- ** override the methods you wish to override.<P>
- **
- ** When you have written the class, give it the name
- ** <CODE>&lt;Bean Class Name&gt;BeanInfo</CODE> and place it in
- ** the same package as the Bean, or in the bean info search path
- ** (see Introspector for information on search paths).<P>
- **
- ** A simple note about the way the Introspector interacts with
- ** BeanInfo. Introspectors look at a Bean class and determine
- ** if there is a BeanInfo class with it. If there is not a
- ** BeanInfo class, it will behave as if the BeanInfo class
- ** provided was a SimpleBeanInfo class (i.e. it will determine
- ** all information automatically).<P>If there is a BeanInfo
- ** class, then any methods that do *not* return null are
- ** regarded as providing definitive information about the class
- ** and all of its superclasses for those information types.
- ** Even if a parent BeanInfo class explicitly returns that
- ** information, it will not be used.
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 28 Jul 1998
- **/
-
-public interface BeanInfo {
- /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/
- int ICON_COLOR_16x16 = 1;
- /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/
- int ICON_COLOR_32x32 = 2;
- /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/
- int ICON_MONO_16x16 = 3;
- /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/
- int ICON_MONO_32x32 = 4;
-
- /** Get the general description of this Bean type.
- ** @return the BeanDescriptor for the Bean, or null if
- ** the BeanDescriptor should be obtained by
- ** Introspection.
- **/
- BeanDescriptor getBeanDescriptor();
-
- /** Get the events this Bean type fires.
- ** @return the EventDescriptors representing events this
- ** Bean fires. Returns <CODE>null</CODE> if the
- ** events are to be acquired by Introspection.
- **/
- EventSetDescriptor[] getEventSetDescriptors();
-
- /** Get the "default" event, basically the one a RAD tool
- ** user is most likely to select.
- ** @return the index into the getEventSetDescriptors()
- ** that the user is most likely to use. Returns
- ** <CODE>-1</CODE> if there is no default event.
- **/
- int getDefaultEventIndex();
-
- /** Get the properties (get/set method pairs) this Bean
- ** type supports.
- ** @return the PropertyDescriptors representing the
- ** properties this Bean type supports.
- ** Returns <CODE>null</CODE> if the properties
- ** are to be obtained by Introspection.
- **/
- PropertyDescriptor[] getPropertyDescriptors();
-
- /** Get the "default" property, basically the one a RAD
- ** tool user is most likely to select.
- ** @return the index into the getPropertyDescriptors()
- ** that the user is most likely to use. Returns
- ** <CODE>-1</CODE> if there is no default event.
- **/
- int getDefaultPropertyIndex();
-
- /** Get the methods this Bean type supports.
- ** @return the MethodDescriptors representing the
- ** methods this Bean type supports. Returns
- ** <CODE>null</CODE> if the methods are to be
- ** obtained by Introspection.
- **/
- MethodDescriptor[] getMethodDescriptors();
-
- /** Get additional BeanInfos representing this Bean.
- ** In this version of JavaBeans, this method is used so
- ** that space and time can be saved by reading a BeanInfo
- ** for each class in the hierarchy (super, super(super),
- ** and so on).<P>
- **
- ** The order of precedence when two pieces of BeanInfo
- ** conflict (such as two PropertyDescriptors that have
- ** the same name), in order from highest precedence to
- ** lowest, is:
- ** <OL>
- ** <LI>This BeanInfo object.</LI>
- ** <LI><CODE>getAdditionalBeanInfo()[getAdditionalBeanInfo().length]</CODE></LI>
- ** <LI> ... </LI>
- ** <LI><CODE>getAdditionalBeanInfo()[1]</CODE></LI>
- ** <LI><CODE>getAdditionalBeanInfo()[0]</CODE></LI>
- ** </OL><P>
- **
- ** <STRONG>Spec Note:</STRONG> It is possible that
- ** returning <CODE>null</CODE> from this method could
- ** stop Introspection in its tracks, but it is unclear
- ** from the spec whether this is the case.
- **
- ** @return additional BeanInfos representing this Bean.
- ** <CODE>null</CODE> may be returned (see Spec
- ** Note, above).
- **/
- BeanInfo[] getAdditionalBeanInfo();
-
- /** Get a visual icon for this Bean.
- ** A Bean does not have to support icons, and if it does
- ** support icons, it does not have to support every single
- ** type. Sun recommends that if you only support one
- ** type, you support 16x16 color. Sun also notes that you
- ** should try to use a type (like GIF) that allows for
- ** transparent pixels, so that the background of the RAD
- ** tool can show through.<P>
- **
- ** <STRONG>Spec Note:</STRONG> If you do not support the
- ** type of icon that is being asked for, but you do
- ** support another type, it is unclear whether you should
- ** return the other type or not. I would presume not.
- **
- ** @param iconType the type of icon to get (see the
- ** ICON_* constants in this class).
- ** @return the icon, or null if that type of icon is
- ** unsupported by this Bean.
- **/
- java.awt.Image getIcon(int iconType);
-}
diff --git a/libjava/java/beans/Beans.java b/libjava/java/beans/Beans.java
deleted file mode 100644
index ffcb83fc1f3..00000000000
--- a/libjava/java/beans/Beans.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/* java.beans.Beans
- Copyright (C) 1998, 1999, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import gnu.java.beans.DummyAppletStub;
-import gnu.java.io.ClassLoaderObjectInputStream;
-
-import java.applet.Applet;
-import java.beans.beancontext.BeanContext;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.net.URL;
-
-/**
- * <code>Beans</code> provides some helper methods that allow the basic
- * operations of Bean-ness.
- *
- * @author John Keiser
- * @author Robert Schuster
- *
- * @since 1.1
- * @status updated to 1.4
- *
- */
-public class Beans
-{
- static boolean designTime = false;
- static boolean guiAvailable = true;
-
- /**
- * Once again, we have a java.beans class with only
- * static methods that can be instantiated. When
- * will the madness end? :)
- */
- public Beans()
- {
- // Does intentionally nothing here.
- }
-
- /** Creates a bean.
- * <p>This is a convenience method that calls <code>instantiate(cl, beanName, null, null)</code>.</p>
- *
- * @see instantiate(ClassLoader, String, BeanContext, AppletInitializer)
- * @param cl ClassLoader to be used or <code>null</code> for the system classloader.
- * @param beanName Name of a serialized bean or class name.
- * @return A newly created bean.
- * @throws IOException If access of an IO resource failed.
- * @throws ClassNotFoundException If the class name is not known or does not lead to a proper bean class.
- */
- public static Object instantiate(ClassLoader cl, String beanName)
- throws IOException, ClassNotFoundException
- {
- return instantiate(cl, beanName, null, null);
- }
-
- /** Creates a bean.
- *
- * <p>This is a convenience method that calls <code>instantiate(cl, beanName, beanContext, null)</code>.</p>
- *
- * @see instantiate(ClassLoader, String, BeanContext, AppletInitializer)
- * @param cl ClassLoader to be used or <code>null</code> for the system classloader.
- * @param beanName Name of a serialized bean or class name.
- * @param beanContext Context to which the newly created Bean should be added.
- * @return A newly created bean.
- * @throws IOException If access of an IO resource failed.
- * @throws ClassNotFoundException If the class name is not known or does not lead to a proper bean class.
- */
- public static Object instantiate(
- ClassLoader cl,
- String beanName,
- BeanContext beanContext)
- throws IOException, ClassNotFoundException
- {
- return instantiate(cl, beanName, beanContext, null);
- }
-
- /** Instantiates a bean according to Beans 1.0.
- *
- * <p>In Beans 1.0 the instantiation scheme is as follows:</p>
- * <p>The name should be dot-separated (e.g "place.for.beans.myBean") and indicate either a
- * serialized object or a class name. In the first case all dots in the name are replaced with
- * slashes ('/') and ".ser" is appended ("place.for.beans.myBean" becomes "place/for/beans/myBean.ser").
- * The bean is then loaded as an application or system resource depending on whether a
- * <code>ClassLoader</code> was provided.</p>
- *
- * <p>If no such resource exists or if it contains no bean the name is interpreted as a class name of
- * which an instance is then created.</p>
- *
- * <p>If a <code>BeanContext</code> instance is available the created bean is added to it.</p>
- *
- * <p>If the created Bean is an <code>Applet</code> or subclass and an <code>AppletInitializer</code>
- * instance is available the applet is initialized and afterwards activated using the initializer. Additionally
- * every instantiated <code>Applet</code> bean is initialized using the {@link Applet.init} method.
- * Furthermore every applet gets a default <code>AppletStub</code>. The <code>Applet</code>'s
- * document base is the location of the ".ser" file if it was deserialized or the location of its class
- * file if it was instantiated.</p>
- *
- * <p>A <code>ClassNotFoundException</code> is not only thrown when a class name was unknown
- * but even when the class has public no-argument constructor
- * (<code>IllegalAccessException</code> is wrapped) or an exception is thrown while
- * invoking such a constructor (causing exception is wrapped).</p>
- *
- * @param cl ClassLoader to be used or <code>null</code> for the system classloader.
- * @param beanName Name of a serialized bean or class name.
- * @param beanContext Context to which the newly created Bean should be added.
- * @param initializer The AppletInitializer which is used for initializing <code>Applet</code> beans.
- * @return A newly created bean.
- * @throws IOException If access of an IO resource failed.
- * @throws ClassNotFoundException If the class name is not known or does not lead to a proper bean class.
- */
- public static Object instantiate(
- ClassLoader cl,
- String beanName,
- BeanContext beanContext,
- AppletInitializer initializer)
- throws IOException, ClassNotFoundException
- {
- Object bean = null;
- URL beanLocation = null;
- URL classLocation = null;
-
- // Converts bean name into a resource name (eg. "a.b.c" -> "a/b/c").
- String resourceName = beanName.replace('.', '/');
-
- /* Tries to get an input stream of the Bean, reading it as a system resource
- * if no ClassLoader is present or as an application resource if a classloader
- * is given.
- */
- beanLocation =
- (cl == null)
- ? ClassLoader.getSystemResource(resourceName + ".ser")
- : cl.getResource(resourceName + ".ser");
-
- // Reads the serialized Bean from the returned URL.
- if (beanLocation != null)
- {
- // Deserializes the bean instance.
- ObjectInputStream ois =
- (cl == null)
- ? new ObjectInputStream(beanLocation.openStream())
- : new ClassLoaderObjectInputStream(
- beanLocation.openStream(),
- cl);
-
- bean = ois.readObject();
-
- /* Implementation note: The result of ObjectInputStream.readObject()
- * may have been null at this point (its a valid value to deserialize)
- * and we explicitly want to try instantiation in such a case
- * (this is important for compatibility).
- */
- }
-
- // Instantiates the Bean using reflective instantiation if it has not been created yet.
- if (bean == null)
- {
- // Makes sure that the deserialization was NOT done.
- beanLocation = null;
-
- Class beanClass;
- if (cl == null)
- {
- beanClass = Class.forName(beanName);
- classLocation =
- ClassLoader.getSystemResource(resourceName + ".class");
- }
- else
- {
- beanClass = cl.loadClass(beanName);
- classLocation = cl.getResource(resourceName + ".class");
- }
-
- // Instantiates and optionally registers the new bean.
- try
- {
- bean = beanClass.newInstance();
- }
- catch(Exception e) {
- /* Wraps all kinds of Exceptions in a ClassNotFoundException (this behavior
- * matches with official >= 1.5, this was different for <=1.4)
- */
- throw new ClassNotFoundException(null, e);
- }
- }
-
- /* Applet beans are treated in the following way:
- * - all AppletS get a default AppletStub
- * - all AppletS are initialized using the AppletInitializer instance (if it is available)
- * - as every other Bean Applets are added to a BeanContext if one is available
- * - each instantiated Applet is initialized using Applet.init() (this is not done for deserialized ones)
- * - finally AppletS get activated using the AppletInitializerS activate-Method
- *
- * The order of operations is important for compatibility.
- */
- Applet applet = null;
- if (bean instanceof Applet)
- {
- // Makes a second instanceof call unneccessary (instanceof is expensive).
- applet = (Applet) bean;
-
- /* The AppletStub's code and document base is set as follows:
- * The code base is always the URL from where the class data originated
- * (without the package name).
- * If the Applet was deserialized the document base is the location of
- * the serialized instance (usually the ".ser" file) otherwise its the URL
- * from where the class data originated (usually the absolute directory
- * location of the ".class" file).
- */
- applet.setStub(
- new DummyAppletStub(
- applet
- .getClass()
- .getProtectionDomain()
- .getCodeSource()
- .getLocation(),
- (beanLocation == null) ? classLocation : beanLocation));
-
- // Runs the Applet's initialization using an AppletInitializer.
- if (initializer != null)
- {
- initializer.initialize(applet, beanContext);
- }
- }
-
- // Adds the new bean to its BeanContext.
- if (beanContext != null)
- {
- beanContext.add(bean);
- }
-
- if (applet != null)
- {
-
- // Initializes an instantiated (not deserialized) Applet using its own method.
- if (beanLocation == null)
- {
- applet.init();
- }
-
- // Runs the Applet's activation using an AppletInitializer.
- if (initializer != null)
- {
- initializer.activate(applet);
- }
- }
-
- return bean;
- }
-
- /**
- * Returns the Bean as a different class type.
- * This should be used instead of casting to get a new
- * type view of a Bean, because in the future there may
- * be new types of Bean, even Beans spanning multiple
- * Objects.
- *
- * @param bean the Bean to cast.
- * @param newClass the Class to cast it to.
- *
- * @return the Bean as a new view, or if the operation
- * could not be performed, the Bean itself.
- */
- public static Object getInstanceOf(Object bean, Class newClass)
- {
- return bean;
- }
-
- /**
- * Determines whether the Bean can be cast to a different
- * class type.
- * This should be used instead of instanceof to determine
- * a Bean's castability, because in the future there may
- * be new types of Bean, even Beans spanning multiple
- * Objects.
- *
- * @param bean the Bean to cast.
- * @param newClass the Class to cast it to.
- *
- * @return whether the Bean can be cast to the class type
- * in question.
- */
- public static boolean isInstanceOf(Object bean, Class newBeanClass)
- {
- return newBeanClass.isInstance(bean);
- }
-
- /**
- * Returns whether the GUI is available to use.
- * <p>Defaults to true.</p>
- *
- * @return whether the GUI is available to use.
- */
- public static boolean isGuiAvailable()
- {
- return guiAvailable;
- }
-
- /**
- * Returns whether it is design time. Design time means
- * we are in a RAD tool.
- * <p>Defaults to false.</p>
- *
- * @return whether it is design time.
- */
- public static boolean isDesignTime()
- {
- return designTime;
- }
-
- /**
- * Sets whether the GUI is available to use.
- *
- * @param guiAvailable whether the GUI is available to use.
- */
- public static void setGuiAvailable(boolean guiAvailable)
- throws SecurityException
- {
- Beans.guiAvailable = guiAvailable;
- }
-
- /**
- * Sets whether it is design time. Design time means we
- * are in a RAD tool.
- *
- * @param designTime whether it is design time.
- */
- public static void setDesignTime(boolean designTime)
- throws SecurityException
- {
- Beans.designTime = designTime;
- }
-
-}
diff --git a/libjava/java/beans/Customizer.java b/libjava/java/beans/Customizer.java
deleted file mode 100644
index b36c89f8846..00000000000
--- a/libjava/java/beans/Customizer.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* java.beans.Customizer
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/**
- ** You may explicitly provide a Customizer for your Bean
- ** class, which allows you complete control of the editing
- ** of the Bean.<P>
- **
- ** A Customizer is meant to be embedded in an RAD tool,
- ** and thus must be a descendant of <CODE>java.awt.Component</CODE>.<P>
- **
- ** It must also have a constructor with no arguments. This
- ** is the constructor that will be called by the RAD tool to
- ** instantiate the Customizer.<P>
- **
- ** Over its lifetime, an instance of a Customizer will only
- ** customize one single Bean. A new instance of the
- ** Customizer will be instantiated to edit any other Beans.<P>
- **
- ** The Customizer is responsible for notifying its
- ** PropertyChangeListeners of any changes that are made,
- ** according to the rules of PropertyChangeListeners (i.e.
- ** notify the clients <EM>after</EM> the property has
- ** changed).
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 29 Jul 1998
- ** @see java.beans.BeanDescriptor.getCustomizerClass()
- **/
-
-public interface Customizer {
- /** Set the object to Customize. This will always be a
- ** Bean that had a BeanDescriptor indicating this
- ** Customizer.
- ** @param bean the Bean to customize.
- **/
- void setObject(Object bean);
-
- /** Add a PropertyChangeListener.
- ** @param l the PropertyChangeListener to add.
- **/
- void addPropertyChangeListener(PropertyChangeListener l);
-
- /** Remove a PropertyChangeListener.
- ** @param l the PropertyChangeListener to remove.
- **/
- void removePropertyChangeListener(PropertyChangeListener l);
-}
diff --git a/libjava/java/beans/DesignMode.java b/libjava/java/beans/DesignMode.java
deleted file mode 100644
index 39805d50c18..00000000000
--- a/libjava/java/beans/DesignMode.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/* java.beans.DesignMode
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/**
- * <code>BeanContextChild</code> implementors implement this to get information about whether they are in a design time or runtime environment.
- * The reason this is restricted to <code>BeanContextChild</code>ren is that
- * only things in the <code>BeanContext</code> hierarchy are given this
- * information in the first place.
- *
- * @author John Keiser
- * @since JDK1.2
- * @see java.beans.beancontext.BeanContextChild
- */
-
-public interface DesignMode {
- /**
- * Use this name when firing <code>PropertyChangeEvent</code>s from your Bean.
- * @fixme Check whether PROPERTYNAME is set to same value as Sun.
- */
- String PROPERTYNAME = "designTime";
-
- /**
- * The environment will call this method on your
- * <code>BeanContextChild</code> when it is registered in a parent
- * <code>BeanContext</code> or when behavior needs to switch from
- * design time to runtime behavior (or vice versa).
- * <P>
- *
- * <code>BeanContext</code>s are required to fire
- * <code>PropertyChangeEvent</code>s when properties change.
- * <code>designTime</code> is a property, and therefore when you
- * implement <code>setDesignTime()</code>, you need to fire a
- * <code>PropertyChangeEvent</code> with the old value, the new
- * value and using <code>PROPERTYNAME</code> as the property name.
- *
- * @param designTime the new value of design time,
- * <code>true</code> if it is design time,
- * <code>false</code> if it is runtime.
- *
- * @fixme I'm frankly not really sure whether it's the case that
- * the BeanContext can <em>change</em> the status of the Bean from
- * design time to runtime. But it appears that it may be so.
- *
- * @see java.util.PropertyChangeEvent
- * @see java.beans.beancontext.BeanContext
- * @see #PROPERTYNAME
- */
- void setDesignTime(boolean designTime);
-
- /**
- * This method should tell whether it is design time or runtime.
- * @return <code>true</code> if design time, <code>false</code> if
- * runtime.
- */
- boolean isDesignTime();
-}
diff --git a/libjava/java/beans/EventHandler.java b/libjava/java/beans/EventHandler.java
deleted file mode 100644
index 9c85893e0f3..00000000000
--- a/libjava/java/beans/EventHandler.java
+++ /dev/null
@@ -1,606 +0,0 @@
-/* java.beans.EventHandler
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-/**
- * <p>EventHandler forms a bridge between dynamically created listeners and
- * arbitrary properties and methods.</p>
- *
- * <p>You can use this class to easily create listener implementations for
- * some basic interactions between an event source and its target. Using
- * the three static methods named <code>create</code> you can create
- * these listener implementations.</p>
- *
- * <p>See the documentation of each method for usage examples.</p>
- *
- * @author Jerry Quinn (jlquinn@optonline.net)
- * @author Robert Schuster (thebohemian@gmx.net)
- * @since 1.4
- */
-public class EventHandler implements InvocationHandler
-{
- // The name of the method that will be implemented. If null, any method.
- private String listenerMethod;
-
- // The object to call action on.
- private Object target;
-
- // The name of the method or property setter in target.
- private String action;
-
- // The property to extract from an event passed to listenerMethod.
- private String property;
-
- // The target objects Class.
- private Class targetClass;
-
- // String class doesn't already have a capitalize routine.
- private String capitalize(String s)
- {
- return s.substring(0, 1).toUpperCase() + s.substring(1);
- }
-
- /**
- * Creates a new <code>EventHandler</code> instance.
- *
- * <p>Typical creation is done with the create method, not by knewing an
- * EventHandler.</p>
- *
- * <p>This constructs an EventHandler that will connect the method
- * listenerMethodName to target.action, extracting eventPropertyName from
- * the first argument of listenerMethodName. and sending it to action.</p>
- *
- * <p>Throws a <code>NullPointerException</code> if the <code>target</code>
- * argument is <code>null</code>.
- *
- * @param target Object that will perform the action.
- * @param action A property or method of the target.
- * @param eventPropertyName A readable property of the inbound event.
- * @param listenerMethodName The listener method name triggering the action.
- */
- public EventHandler(Object target, String action, String eventPropertyName,
- String listenerMethodName)
- {
- this.target = target;
-
- // Retrieving the class is done for two reasons:
- // 1) The class object is needed very frequently in the invoke() method.
- // 2) The constructor should throw a NullPointerException if target is null.
- targetClass = target.getClass();
-
- this.action = action; // Turn this into a method or do we wait till
- // runtime
- property = eventPropertyName;
- listenerMethod = listenerMethodName;
- }
-
- /**
- * Returns the event property name.
- */
- public String getEventPropertyName()
- {
- return property;
- }
-
- /**
- * Returns the listener's method name.
- */
- public String getListenerMethodName()
- {
- return listenerMethod;
- }
-
- /**
- * Returns the target object.
- */
- public Object getTarget()
- {
- return target;
- }
-
- /**
- * Returns the action method name.
- */
- public String getAction()
- {
- return action;
- }
-
- // Fetch a qualified property like a.b.c from object o. The properties can
- // be boolean isProp or object getProp properties.
- //
- // Returns a length 2 array with the first entry containing the value
- // extracted from the property, and the second entry contains the class of
- // the method return type.
- //
- // We play this game because if the method returns a native type, the return
- // value will be a wrapper. If we then take the type of the wrapper and use
- // it to locate the action method that takes the native type, it won't match.
- private Object[] getProperty(Object o, String prop)
- {
- // Isolate the first property name from a.b.c.
- int pos;
- String rest = null;
- if ((pos = prop.indexOf('.')) != -1)
- {
- rest = prop.substring(pos + 1);
- prop = prop.substring(0, pos);
- }
-
- // Find a method named getProp. It could be isProp instead.
- Method getter;
- try
- {
- // Look for boolean property getter isProperty
- getter = o.getClass().getMethod("is" + capitalize(prop),
- null);
- }
- catch (NoSuchMethodException nsme1)
- {
- try {
- // Look for regular property getter getProperty
- getter = o.getClass().getMethod("get" + capitalize(prop),
- null);
- } catch(NoSuchMethodException nsme2) {
- try {
- // Finally look for a method of the name prop
- getter = o.getClass().getMethod(prop, null);
- } catch(NoSuchMethodException nsme3) {
- // Ok, give up with an intelligent hint for the user.
- throw new RuntimeException("Method not called: Could not find a property or method '" + prop
- + "' in " + o.getClass() + " while following the property argument '" + property + "'.");
- }
- }
- }
- try {
- Object val = getter.invoke(o, null);
-
- if (rest != null)
- return getProperty(val, rest);
-
- return new Object[] {val, getter.getReturnType()};
- } catch(InvocationTargetException ite) {
- throw new RuntimeException("Method not called: Property or method '" + prop + "' has thrown an exception.", ite);
- } catch(IllegalAccessException iae) {
- // This cannot happen because we looked up method with Class.getMethod()
- // which returns public methods only.
- throw (InternalError) new InternalError("Non-public method was invoked.").initCause(iae);
- }
- }
-
- /**
- * Invokes the <code>EventHandler</code>.
- *
- * <p>This method is normally called by the listener's proxy implementation.</p>
- *
- * @param proxy The listener interface that is implemented using
- * the proxy mechanism.
- * @param method The method that was called on the proxy instance.
- * @param arguments The arguments which where given to the method.
- * @throws Throwable <code>NoSuchMethodException</code> is thrown when the EventHandler's
- * action method or property cannot be found.
- */
- public Object invoke(Object proxy, Method method, Object[] arguments)
- {
- try {
- // The method instance of the target object. We have to find out which
- // one we have to invoke.
- Method actionMethod = null;
-
- // Listener methods that weren't specified are ignored. If listenerMethod
- // is null, then all listener methods are processed.
- if (listenerMethod != null && !method.getName().equals(listenerMethod))
- return null;
-
- // If a property is defined we definitely need a valid object at
- // arguments[0] that can be used to retrieve a value to which the
- // property of the target gets set.
- if(property != null) {
- // Extracts the argument. We will let it fail with a NullPointerException
- // the caller used a listener method that has no arguments.
- Object event = arguments[0];
-
- // Obtains the property XXX propertyType keeps showing up null - why?
- // because the object inside getProperty changes, but the ref variable
- // can't change this way, dolt! need a better way to get both values out
- // - need method and object to do the invoke and get return type
- Object v[] = getProperty(event, property);
- Object[] args = new Object[] { v[0] };
-
- // Changes the class array that controls which method signature we are going
- // to look up in the target object.
- Class[] argTypes = new Class[] { initClass((Class) v[1]) };
-
- // Tries to find a setter method to which we can apply the
- while(argTypes[0] != null) {
- try
- {
- // Look for a property setter for action.
- actionMethod = targetClass.getMethod("set" + capitalize(action), argTypes);
-
- return actionMethod.invoke(target, args);
- }
- catch (NoSuchMethodException e)
- {
- // If action as property didn't work, try as method later.
- }
-
- argTypes[0] = nextClass(argTypes[0]);
- }
-
- // We could not find a suitable setter method. Now we try again interpreting
- // action as the method name itself.
- // Since we probably have changed the block local argTypes array
- // we need to rebuild it.
- argTypes = new Class[] { initClass((Class) v[1]) };
-
- // Tries to find a setter method to which we can apply the
- while(argTypes[0] != null) {
- try
- {
- actionMethod = targetClass.getMethod(action, argTypes);
-
- return actionMethod.invoke(target, args);
- }
- catch (NoSuchMethodException e)
- {
- }
-
- argTypes[0] = nextClass(argTypes[0]);
- }
-
- throw new RuntimeException("Method not called: Could not find a public method named '"
- + action + "' in target " + targetClass + " which takes a '"
- + v[1] + "' argument or a property of this type.");
- }
-
- // If property was null we will search for a no-argument method here.
- // Note: The ordering of method lookups is important because we want to prefer no-argument
- // calls like the JDK does. This means if we have actionMethod() and actionMethod(Event) we will
- // call the first *EVEN* if we have a valid argument for the second method. This is behavior compliant
- // to the JDK.
- // If actionMethod() is not available but there is a actionMethod(Event) we take this. That makes us
- // more specification compliant than the JDK itself because this one will fail in such a case.
- try
- {
- actionMethod = targetClass.getMethod(action, null);
- }
- catch(NoSuchMethodException nsme)
- {
- // Note: If we want to be really strict the specification says that a no-argument method should
- // accept an EventObject (or subclass I guess). However since the official implementation is broken
- // anyways, it's more flexible without the EventObject restriction and we are compatible on everything
- // else this can stay this way.
- if(arguments != null && arguments.length >= 1/* && arguments[0] instanceof EventObject*/) {
- Class[] targetArgTypes = new Class[] { initClass(arguments[0].getClass()) };
-
- while(targetArgTypes[0] != null) {
- try
- {
- // If no property exists we expect the first element of the arguments to be
- // an EventObject which is then applied to the target method.
-
- actionMethod = targetClass.getMethod(action, targetArgTypes);
-
- return actionMethod.invoke(target, new Object[] { arguments[0] });
- }
- catch(NoSuchMethodException nsme2)
- {
-
- }
-
- targetArgTypes[0] = nextClass(targetArgTypes[0]);
- }
-
- }
- }
-
- // If we do not have a Method instance at this point this means that all our tries
- // failed. The JDK throws an ArrayIndexOutOfBoundsException in this case.
- if(actionMethod == null)
- throw new ArrayIndexOutOfBoundsException(0);
-
- // Invoke target.action(property)
- return actionMethod.invoke(target, null);
- } catch(InvocationTargetException ite) {
- throw new RuntimeException(ite.getCause());
- } catch(IllegalAccessException iae) {
- // Cannot happen because we always use getMethod() which returns public
- // methods only. Otherwise there is something seriously broken in
- // GNU Classpath.
- throw (InternalError) new InternalError("Non-public method was invoked.").initCause(iae);
- }
- }
-
- /**
- * <p>Returns the primitive type for every wrapper class or the
- * class itself if it is no wrapper class.</p>
- *
- * <p>This is needed because to be able to find both kinds of methods:
- * One that takes a wrapper class as the first argument and one that
- * accepts a primitive instead.</p>
- */
- private Class initClass(Class klass) {
- if(klass == Boolean.class) {
- return Boolean.TYPE;
- } else if(klass == Byte.class) {
- return Byte.TYPE;
- } else if(klass == Short.class) {
- return Short.TYPE;
- } else if(klass == Integer.class) {
- return Integer.TYPE;
- } else if(klass == Long.class) {
- return Long.TYPE;
- } else if(klass == Float.class) {
- return Float.TYPE;
- } else if(klass == Double.class) {
- return Double.TYPE;
- } else {
- return klass;
- }
- }
-
- /**
- *
- *
- * @param klass
- * @return
- */
- private Class nextClass(Class klass) {
- if(klass == Boolean.TYPE) {
- return Boolean.class;
- } else if(klass == Byte.TYPE) {
- return Byte.class;
- } else if(klass == Short.TYPE) {
- return Short.class;
- } else if(klass == Integer.TYPE) {
- return Integer.class;
- } else if(klass == Long.TYPE) {
- return Long.class;
- } else if(klass == Float.TYPE) {
- return Float.class;
- } else if(klass == Double.TYPE) {
- return Double.class;
- } else {
- return klass.getSuperclass();
- }
- }
-
- /**
- * <p>Constructs an implementation of <code>listenerInterface</code>
- * to dispatch events.</p>
- *
- * <p>You can use such an implementation to simply call a public
- * no-argument method of an arbitrary target object or to forward
- * the first argument of the listener method to the target method.</p>
- *
- * <p>Call this method like:</p>
- * <code>
- * button.addActionListener((ActionListener)
- * EventHandler.create(ActionListener.class, target, "dispose"));
- * </code>
- *
- * <p>to achieve the following behavior:</p>
- * <code>
- * button.addActionListener(new ActionListener() {
- * public void actionPerformed(ActionEvent ae) {
- * target.dispose();
- * }
- * });
- * </code>
- *
- * <p>That means if you need a listener implementation that simply calls a
- * a no-argument method on a given instance for <strong>each</strong>
- * method of the listener interface.</p>
- *
- * <p>Note: The <code>action</code> is interpreted as a method name. If your target object
- * has no no-argument method of the given name the EventHandler tries to find
- * a method with the same name but which can accept the first argument of the
- * listener method. Usually this will be an event object but any other object
- * will be forwarded, too. Keep in mind that using a property name instead of a
- * real method here is wrong and will throw an <code>ArrayIndexOutOfBoundsException</code>
- * whenever one of the listener methods is called.<p/>
- *
- * <p>The <code>EventHandler</code> will automatically convert primitives
- * to their wrapper class and vice versa. Furthermore it will call
- * a target method if it accepts a superclass of the type of the
- * first argument of the listener method.</p>
- *
- * <p>In case that the method of the target object throws an exception
- * it will be wrapped in a <code>RuntimeException</code> and thrown out
- * of the listener method.</p>
- *
- * <p>In case that the method of the target object cannot be found an
- * <code>ArrayIndexOutOfBoundsException</code> will be thrown when the
- * listener method is invoked.</p>
- *
- * <p>A call to this method is equivalent to:
- * <code>create(listenerInterface, target, action, null, null)</code></p>
- *
- * @param listenerInterface Listener interface to implement.
- * @param target Object to invoke action on.
- * @param action Target property or method to invoke.
- * @return A constructed proxy object.
- */
- public static Object create(Class listenerInterface, Object target, String action)
- {
- return create(listenerInterface, target, action, null, null);
- }
-
- /**
- * <p>Constructs an implementation of <code>listenerInterface</code>
- * to dispatch events.</p>
- *
- * <p>Use this method if you want to create an implementation that retrieves
- * a property value from the <b>first</b> argument of the listener method
- * and applies it to the target's property or method. This first argument
- * of the listener is usually an event object but any other object is
- * valid, too.</p>
- *
- * <p>You can set the value of <code>eventPropertyName</code> to "prop"
- * to denote the retrieval of a property named "prop" from the event
- * object. In case that no such property exists the <code>EventHandler</code>
- * will try to find a method with that name.</p>
- *
- * <p>If you set <code>eventPropertyName</code> to a value like this "a.b.c"
- * <code>EventHandler</code> will recursively evaluate the properties "a", "b"
- * and "c". Again if no property can be found the <code>EventHandler</code>
- * tries a method name instead. This allows mixing the names, too: "a.toString"
- * will retrieve the property "a" from the event object and will then call
- * the method "toString" on it.</p>
- *
- * <p>An exception thrown in any of these methods will provoke a
- * <code>RuntimeException</code> to be thrown which contains an
- * <code>InvocationTargetException</code> containing the triggering exception.</p>
- *
- * <p>If you set <code>eventPropertyName</code> to a non-null value the
- * <code>action</code> parameter will be interpreted as a property name
- * or a method name of the target object.</p>
- *
- * <p>Any object retrieved from the event object and applied to the
- * target will converted from primitives to their wrapper class or
- * vice versa or applied to a method that accepts a superclass
- * of the object.</p>
- *
- * <p>Examples:</p>
- * <p>The following code:</p><code>
- * button.addActionListener(
- * new ActionListener() {
- * public void actionPerformed(ActionEvent ae) {
- * Object o = ae.getSource().getClass().getName();
- * textField.setText((String) o);
- * }
- * });
- * </code>
- *
- * <p>Can be expressed using the <code>EventHandler</code> like this:</p>
- * <p>
- * <code>button.addActionListener((ActionListener)
- * EventHandler.create(ActionListener.class, textField, "text", "source.class.name");
- * <code>
- * </p>
- *
- * <p>As said above you can specify the target as a method, too:</p>
- * <p>
- * <code>button.addActionListener((ActionListener)
- * EventHandler.create(ActionListener.class, textField, "setText", "source.class.name");
- * <code>
- * </p>
- *
- * <p>Furthermore you can use method names in the property:</p>
- * <p>
- * <code>button.addActionListener((ActionListener)
- * EventHandler.create(ActionListener.class, textField, "setText", "getSource.getClass.getName");
- * <code>
- * </p>
- *
- * <p>Finally you can mix names:</p>
- * <p>
- * <code>button.addActionListener((ActionListener)
- * EventHandler.create(ActionListener.class, textField, "setText", "source.getClass.name");
- * <code>
- * </p>
- *
- * <p>A call to this method is equivalent to:
- * <code>create(listenerInterface, target, action, null, null)</code>
- * </p>
- *
- * @param listenerInterface Listener interface to implement.
- * @param target Object to invoke action on.
- * @param action Target property or method to invoke.
- * @param eventPropertyName Name of property to extract from event.
- * @return A constructed proxy object.
- */
- public static Object create(Class listenerInterface, Object target,
- String action, String eventPropertyName)
- {
- return create(listenerInterface, target, action, eventPropertyName, null);
- }
-
- /**
- * <p>Constructs an implementation of <code>listenerInterface</code>
- * to dispatch events.</p>
- *
- * <p>Besides the functionality described for {@link create(Class, Object, String)}
- * and {@link create(Class, Object, String, String)} this method allows you
- * to filter the listener method that should have an effect. Look at these
- * method's documentation for more information about the <code>EventHandler</code>'s
- * usage.</p>
- *
- * <p>If you want to call <code>dispose</code> on a <code>JFrame</code> instance
- * when the <code>WindowListener.windowClosing()</code> method was invoked use
- * the following code:</p>
- * <p>
- * <code>
- * EventHandler.create(WindowListener.class, jframeInstance, "dispose", null, "windowClosing");
- * </code>
- * </p>
- *
- * <p>A <code>NullPointerException</code> is thrown if the <code>listenerInterface</code>
- * or <code>target</code> argument are <code>null</code>.
- *
- * @param listenerInterface Listener interface to implement.
- * @param target Object to invoke action on.
- * @param action Target method name to invoke.
- * @param eventPropertyName Name of property to extract from event.
- * @param listenerMethodName Listener method to implement.
- * @return A constructed proxy object.
- */
- public static Object create(Class listenerInterface, Object target,
- String action, String eventPropertyName,
- String listenerMethodName)
- {
- // Create EventHandler instance
- EventHandler eh = new EventHandler(target, action, eventPropertyName,
- listenerMethodName);
-
- // Create proxy object passing in the event handler
- Object proxy = Proxy.newProxyInstance(listenerInterface.getClassLoader(),
- new Class[] {listenerInterface},
- eh);
-
- return proxy;
- }
-
-}
diff --git a/libjava/java/beans/EventSetDescriptor.java b/libjava/java/beans/EventSetDescriptor.java
deleted file mode 100644
index 8624e643476..00000000000
--- a/libjava/java/beans/EventSetDescriptor.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/* java.beans.EventSetDescriptor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import gnu.java.lang.ClassHelper;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Vector;
-
-/**
- ** EventSetDescriptor describes the hookup between an event source
- ** class and an event listener class.
- **
- ** EventSets have several attributes: the listener class, the events
- ** that can be fired to the listener (methods in the listener class), and
- ** an add and remove listener method from the event firer's class.<P>
- **
- ** The methods have these constraints on them:<P>
- ** <UL>
- ** <LI>event firing methods: must have <CODE>void</CODE> return value. Any
- ** parameters and exceptions are allowed. May be public, protected or
- ** package-protected. (Don't ask me why that is, I'm just following the spec.
- ** The only place it is even mentioned is in the Java Beans white paper, and
- ** there it is only implied.)</LI>
- ** <LI>add listener method: must have <CODE>void</CODE> return value. Must
- ** take exactly one argument, of the listener class's type. May fire either
- ** zero exceptions, or one exception of type <CODE>java.util.TooManyListenersException</CODE>.
- ** Must be public.</LI>
- ** <LI>remove listener method: must have <CODE>void</CODE> return value.
- ** Must take exactly one argument, of the listener class's type. May not
- ** fire any exceptions. Must be public.</LI>
- ** </UL>
- **
- ** A final constraint is that event listener classes must extend from EventListener.<P>
- **
- ** There are also various design patterns associated with some of the methods
- ** of construction. Those are explained in more detail in the appropriate
- ** constructors.<P>
- **
- ** <STRONG>Documentation Convention:</STRONG> for proper
- ** Internalization of Beans inside an RAD tool, sometimes there
- ** are two names for a property or method: a programmatic, or
- ** locale-independent name, which can be used anywhere, and a
- ** localized, display name, for ease of use. In the
- ** documentation I will specify different String values as
- ** either <EM>programmatic</EM> or <EM>localized</EM> to
- ** make this distinction clear.
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 31 May 1998
- **/
-
-public class EventSetDescriptor extends FeatureDescriptor {
- private Method addListenerMethod;
- private Method removeListenerMethod;
- private Class listenerType;
- private MethodDescriptor[] listenerMethodDescriptors;
- private Method[] listenerMethods;
-
- private boolean unicast;
- private boolean inDefaultEventSet = true;
-
- /** Create a new EventSetDescriptor.
- ** This version of the constructor enforces the rules imposed on the methods
- ** described at the top of this class, as well as searching for:<P>
- ** <OL>
- ** <LI>The event-firing method must be non-private with signature
- ** <CODE>void &lt;listenerMethodName&gt;(&lt;eventSetName&gt;Event)</CODE>
- ** (where <CODE>&lt;eventSetName&gt;</CODE> has its first character capitalized
- ** by the constructor and the Event is a descendant of
- ** <CODE>java.util.EventObject</CODE>) in class <CODE>listenerType</CODE>
- ** (any exceptions may be thrown).
- ** <B>Implementation note:</B> Note that there could conceivably be multiple
- ** methods with this type of signature (example: java.util.MouseEvent vs.
- ** my.very.own.MouseEvent). In this implementation, all methods fitting the
- ** description will be put into the <CODE>EventSetDescriptor</CODE>, even
- ** though the spec says only one should be chosen (they probably weren't thinking as
- ** pathologically as I was). I don't like arbitrarily choosing things.
- ** If your class has only one such signature, as most do, you'll have no problems.</LI>
- ** <LI>The add and remove methods must be public and named
- ** <CODE>void add&lt;eventSetName&gt;Listener(&lt;listenerType&gt;)</CODE> and
- ** <CODE>void remove&lt;eventSetName&gt;Listener(&lt;listenerType&gt;)</CODE> in
- ** in class <CODE>eventSourceClass</CODE>, where
- ** <CODE>&lt;eventSetName&gt;</CODE> will have its first letter capitalized.
- ** Standard exception rules (see class description) apply.</LI>
- ** </OL>
- ** @param eventSourceClass the class containing the add/remove listener methods.
- ** @param eventSetName the programmatic name of the event set, generally starting
- ** with a lowercase letter (i.e. fooManChu instead of FooManChu). This will be used
- ** to generate the name of the event object as well as the names of the add and
- ** remove methods.
- ** @param listenerType the class containing the event firing method.
- ** @param listenerMethodName the name of the event firing method.
- ** @exception IntrospectionException if listenerType is not an EventListener,
- ** or if methods are not found or are invalid.
- **/
- public EventSetDescriptor(Class eventSourceClass,
- String eventSetName,
- Class listenerType,
- String listenerMethodName) throws IntrospectionException {
- setName(eventSetName);
- if(!java.util.EventListener.class.isAssignableFrom(listenerType)) {
- throw new IntrospectionException("Listener type is not an EventListener.");
- }
-
- String[] names = new String[1];
- names[0] = listenerMethodName;
-
- try {
- eventSetName = Character.toUpperCase(eventSetName.charAt(0)) + eventSetName.substring(1);
- } catch(StringIndexOutOfBoundsException e) {
- eventSetName = "";
- }
-
- findMethods(eventSourceClass,listenerType,names,"add"+eventSetName+"Listener","remove"+eventSetName+"Listener",eventSetName+"Event");
- this.listenerType = listenerType;
- checkAddListenerUnicast();
- if(this.removeListenerMethod.getExceptionTypes().length > 0) {
- throw new IntrospectionException("Listener remove method throws exceptions.");
- }
- }
-
- /** Create a new EventSetDescriptor.
- ** This form of the constructor allows you to specify the names of the methods and adds
- ** no new constraints on top of the rules already described at the top of the class.<P>
- **
- ** @param eventSourceClass the class containing the add and remove listener methods.
- ** @param eventSetName the programmatic name of the event set, generally starting
- ** with a lowercase letter (i.e. fooManChu instead of FooManChu).
- ** @param listenerType the class containing the event firing methods.
- ** @param listenerMethodNames the names of the even firing methods.
- ** @param addListenerMethodName the name of the add listener method.
- ** @param removeListenerMethodName the name of the remove listener method.
- ** @exception IntrospectionException if listenerType is not an EventListener
- ** or if methods are not found or are invalid.
- **/
- public EventSetDescriptor(Class eventSourceClass,
- String eventSetName,
- Class listenerType,
- String[] listenerMethodNames,
- String addListenerMethodName,
- String removeListenerMethodName) throws IntrospectionException {
- setName(eventSetName);
- if(!java.util.EventListener.class.isAssignableFrom(listenerType)) {
- throw new IntrospectionException("Listener type is not an EventListener.");
- }
-
- findMethods(eventSourceClass,listenerType,listenerMethodNames,addListenerMethodName,removeListenerMethodName,null);
- this.listenerType = listenerType;
- checkAddListenerUnicast();
- if(this.removeListenerMethod.getExceptionTypes().length > 0) {
- throw new IntrospectionException("Listener remove method throws exceptions.");
- }
- }
-
- /** Create a new EventSetDescriptor.
- ** This form of constructor allows you to explicitly say which methods do what, and
- ** no reflection is done by the EventSetDescriptor. The methods are, however,
- ** checked to ensure that they follow the rules set forth at the top of the class.
- ** @param eventSetName the programmatic name of the event set, generally starting
- ** with a lowercase letter (i.e. fooManChu instead of FooManChu).
- ** @param listenerType the class containing the listenerMethods.
- ** @param listenerMethods the event firing methods.
- ** @param addListenerMethod the add listener method.
- ** @param removeListenerMethod the remove listener method.
- ** @exception IntrospectionException if the listenerType is not an EventListener,
- ** or any of the methods are invalid.
- **/
- public EventSetDescriptor(String eventSetName,
- Class listenerType,
- Method[] listenerMethods,
- Method addListenerMethod,
- Method removeListenerMethod) throws IntrospectionException {
- setName(eventSetName);
- if(!java.util.EventListener.class.isAssignableFrom(listenerType)) {
- throw new IntrospectionException("Listener type is not an EventListener.");
- }
-
- this.listenerMethods = listenerMethods;
- this.addListenerMethod = addListenerMethod;
- this.removeListenerMethod = removeListenerMethod;
- this.listenerType = listenerType;
- checkMethods();
- checkAddListenerUnicast();
- if(this.removeListenerMethod.getExceptionTypes().length > 0) {
- throw new IntrospectionException("Listener remove method throws exceptions.");
- }
- }
-
- /** Create a new EventSetDescriptor.
- ** This form of constructor allows you to explicitly say which methods do what, and
- ** no reflection is done by the EventSetDescriptor. The methods are, however,
- ** checked to ensure that they follow the rules set forth at the top of the class.
- ** @param eventSetName the programmatic name of the event set, generally starting
- ** with a lowercase letter (i.e. fooManChu instead of FooManChu).
- ** @param listenerType the class containing the listenerMethods.
- ** @param listenerMethodDescriptors the event firing methods.
- ** @param addListenerMethod the add listener method.
- ** @param removeListenerMethod the remove listener method.
- ** @exception IntrospectionException if the listenerType is not an EventListener,
- ** or any of the methods are invalid.
- **/
- public EventSetDescriptor(String eventSetName,
- Class listenerType,
- MethodDescriptor[] listenerMethodDescriptors,
- Method addListenerMethod,
- Method removeListenerMethod) throws IntrospectionException {
- setName(eventSetName);
- if(!java.util.EventListener.class.isAssignableFrom(listenerType)) {
- throw new IntrospectionException("Listener type is not an EventListener.");
- }
-
- this.listenerMethodDescriptors = listenerMethodDescriptors;
- this.listenerMethods = new Method[listenerMethodDescriptors.length];
- for(int i=0;i<this.listenerMethodDescriptors.length;i++) {
- this.listenerMethods[i] = this.listenerMethodDescriptors[i].getMethod();
- }
-
- this.addListenerMethod = addListenerMethod;
- this.removeListenerMethod = removeListenerMethod;
- this.listenerType = listenerType;
- checkMethods();
- checkAddListenerUnicast();
- if(this.removeListenerMethod.getExceptionTypes().length > 0) {
- throw new IntrospectionException("Listener remove method throws exceptions.");
- }
- }
-
- /** Get the class that contains the event firing methods. **/
- public Class getListenerType() {
- return listenerType;
- }
-
- /** Get the event firing methods. **/
- public Method[] getListenerMethods() {
- return listenerMethods;
- }
-
- /** Get the event firing methods as MethodDescriptors. **/
- public MethodDescriptor[] getListenerMethodDescriptors() {
- if(listenerMethodDescriptors == null) {
- listenerMethodDescriptors = new MethodDescriptor[listenerMethods.length];
- for(int i=0;i<listenerMethods.length;i++) {
- listenerMethodDescriptors[i] = new MethodDescriptor(listenerMethods[i]);
- }
- }
- return listenerMethodDescriptors;
- }
-
- /** Get the add listener method. **/
- public Method getAddListenerMethod() {
- return addListenerMethod;
- }
-
- /** Get the remove listener method. **/
- public Method getRemoveListenerMethod() {
- return removeListenerMethod;
- }
-
- /** Set whether or not multiple listeners may be added.
- ** @param unicast whether or not multiple listeners may be added.
- **/
- public void setUnicast(boolean unicast) {
- this.unicast = unicast;
- }
-
- /** Get whether or not multiple listeners may be added. (Defaults to false.) **/
- public boolean isUnicast() {
- return unicast;
- }
-
- /** Set whether or not this is in the default event set.
- ** @param inDefaultEventSet whether this is in the default event set.
- **/
- public void setInDefaultEventSet(boolean inDefaultEventSet) {
- this.inDefaultEventSet = inDefaultEventSet;
- }
-
- /** Get whether or not this is in the default event set. (Defaults to true.)**/
- public boolean isInDefaultEventSet() {
- return inDefaultEventSet;
- }
-
- private void checkAddListenerUnicast() throws IntrospectionException {
- Class[] addListenerExceptions = this.addListenerMethod.getExceptionTypes();
- if(addListenerExceptions.length > 1) {
- throw new IntrospectionException("Listener add method throws too many exceptions.");
- } else if(addListenerExceptions.length == 1
- && !java.util.TooManyListenersException.class.isAssignableFrom(addListenerExceptions[0])) {
- throw new IntrospectionException("Listener add method throws too many exceptions.");
- }
- }
-
- private void checkMethods() throws IntrospectionException {
- if(!addListenerMethod.getDeclaringClass().isAssignableFrom(removeListenerMethod.getDeclaringClass())
- && !removeListenerMethod.getDeclaringClass().isAssignableFrom(addListenerMethod.getDeclaringClass())) {
- throw new IntrospectionException("add and remove listener methods do not come from the same class. This is bad.");
- }
- if(!addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)
- || addListenerMethod.getParameterTypes().length != 1
- || !listenerType.equals(addListenerMethod.getParameterTypes()[0])
- || !Modifier.isPublic(addListenerMethod.getModifiers())) {
- throw new IntrospectionException("Add Listener Method invalid.");
- }
- if(!removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)
- || removeListenerMethod.getParameterTypes().length != 1
- || !listenerType.equals(removeListenerMethod.getParameterTypes()[0])
- || removeListenerMethod.getExceptionTypes().length > 0
- || !Modifier.isPublic(removeListenerMethod.getModifiers())) {
- throw new IntrospectionException("Remove Listener Method invalid.");
- }
-
- for(int i=0;i<listenerMethods.length;i++) {
- if(!listenerMethods[i].getReturnType().equals(java.lang.Void.TYPE)
- || Modifier.isPrivate(listenerMethods[i].getModifiers())) {
- throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " non-void or private.");
- }
- if(!listenerMethods[i].getDeclaringClass().isAssignableFrom(listenerType)) {
- throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " not from class " + listenerType.getName());
- }
- }
- }
-
- private void findMethods(Class eventSourceClass,
- Class listenerType,
- String listenerMethodNames[],
- String addListenerMethodName,
- String removeListenerMethodName,
- String absurdEventClassCheckName) throws IntrospectionException {
-
- /* Find add listener method and remove listener method. */
- Class[] listenerArgList = new Class[1];
- listenerArgList[0] = listenerType;
- try {
- this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList);
- } catch(SecurityException E) {
- throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + ".");
- } catch(NoSuchMethodException E) {
- throw new IntrospectionException("Could not find method " + addListenerMethodName + ".");
- }
-
- if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) {
- throw new IntrospectionException("Add listener method does not exist, is not public, or is not void.");
- }
-
- try {
- this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList);
- } catch(SecurityException E) {
- throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + ".");
- } catch(NoSuchMethodException E) {
- throw new IntrospectionException("Could not find method " + removeListenerMethodName + ".");
- }
- if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) {
- throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void.");
- }
-
- /* Find the listener methods. */
- Method[] methods;
- try {
- methods = ClassHelper.getAllMethods(listenerType);
- } catch(SecurityException E) {
- throw new IntrospectionException("Security: You cannot access fields in this class.");
- }
-
- Vector chosenMethods = new Vector();
- boolean[] listenerMethodFound = new boolean[listenerMethodNames.length];
- for(int i=0;i<methods.length;i++) {
- if(Modifier.isPrivate(methods[i].getModifiers())) {
- continue;
- }
- Method currentMethod = methods[i];
- Class retval = currentMethod.getReturnType();
- if(retval.equals(java.lang.Void.TYPE)) {
- for(int j=0;j<listenerMethodNames.length;j++) {
- if(currentMethod.getName().equals(listenerMethodNames[j])
- && (absurdEventClassCheckName == null
- || (currentMethod.getParameterTypes().length == 1
- && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName)
- || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName)
- )
- )
- )
- ) {
- chosenMethods.addElement(currentMethod);
- listenerMethodFound[j] = true;
- }
- }
- }
- }
-
- /* Make sure we found all the methods we were looking for. */
- for(int i=0;i<listenerMethodFound.length;i++) {
- if(!listenerMethodFound[i]) {
- throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]);
- }
- }
-
- /* Now that we've chosen the listener methods we want, store them. */
- this.listenerMethods = new Method[chosenMethods.size()];
- for(int i=0;i<chosenMethods.size();i++) {
- this.listenerMethods[i] = (Method)chosenMethods.elementAt(i);
- }
- }
-}
diff --git a/libjava/java/beans/ExceptionListener.java b/libjava/java/beans/ExceptionListener.java
deleted file mode 100644
index 0eeb8a9561f..00000000000
--- a/libjava/java/beans/ExceptionListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ExceptionListener.java -- listen for recoverable internal exceptions
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/**
- * This interface allows a class to monitor internal exceptions, to try to
- * recover from them.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status updated to 1.4
- */
-public interface ExceptionListener
-{
- /**
- * Fired after an exception occurs.
- *
- * @param e the trapped exception
- */
- void exceptionThrown(Exception e);
-} // interface ExceptionListener
diff --git a/libjava/java/beans/Expression.java b/libjava/java/beans/Expression.java
deleted file mode 100644
index 20b04f1c190..00000000000
--- a/libjava/java/beans/Expression.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* java.beans.Expression
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/**
- * class Expression
- *
- * An Expression captures the execution of an object method that
- * returns a value. It stores an object, the method to call, and the
- * arguments to pass to the method.
- *
- * @since 1.4
- */
-public class Expression extends Statement
-{
- // This is a placeholder to indicate that value hasn't been set
- // yet;
- private static final Object unset = new Object();
-
- // The value to return. This is equal to unset until getValue is called.
- private Object value;
-
-
- /**
- * Constructor
- *
- * Constructs an Expression representing the invocation of
- * object.methodName(arg[0], arg[1], ...); However, it will never
- * be executed. Instead, value will always be returned.
- *
- * @param value The value to return.
- * @param target The object to invoke the method on.
- * @param methodName The object method to invoke.
- * @param arguments An array of arguments to pass to the method.
- */
- public Expression(Object value, Object target, String methodName,
- Object[] arguments)
- {
- super(target, methodName, arguments);
- this.value = value;
- }
-
- /**
- * Constructor
- *
- * Constructs an Expression representing the invocation of
- * object.methodName(arg[0], arg[1], ...);
- *
- * @param target The object to invoke the method on.
- * @param methodName The object method to invoke.
- * @param arguments An array of arguments to pass to the method.
- */
- public Expression(Object target, String methodName, Object[] arguments)
- {
- super(target, methodName, arguments);
- this.value = unset;
- }
-
- /**
- * Return the result of executing the method.
- *
- * If the cached value has not yet been set, the method is
- * executed in the same way as Statement.execute(), except that
- * the value is cached, and then returned. If the value has been
- * set, it is returned without executing the method again.
- *
- * @return the result of executing the method.
- * @exception Exception if an error occurs
- */
- public Object getValue() throws Exception
- {
- if (value == unset)
- value = doExecute();
- return value;
- }
-
- /**
- * Set the cached value to be returned by getValue()
- *
- * @param value the value to cache and return.
- */
- public void setValue(Object value)
- {
- this.value = value;
- }
-
- /**
- * Return a string representation of this expression.
- */
- public String toString()
- {
- String result = super.toString();
- if (value != unset)
- return value.getClass().getName() + " " + result;
- return result;
- }
-}
diff --git a/libjava/java/beans/FeatureDescriptor.java b/libjava/java/beans/FeatureDescriptor.java
deleted file mode 100644
index aeb40949099..00000000000
--- a/libjava/java/beans/FeatureDescriptor.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/* java.beans.FeatureDescriptor
- Copyright (C) 1998, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-/**
- * FeatureDescriptor is the common superclass for all JavaBeans Descriptor
- * classes. JavaBeans descriptors are abstract descriptors of properties,
- * events, methods, beans, etc.<P>
- *
- * <STRONG>Documentation Convention:</STRONG> for proper
- * Internalization of Beans inside an RAD tool, sometimes there
- * are two names for a property or method: a programmatic, or
- * locale-independent name, which can be used anywhere, and a
- * localized, display name, for ease of use. In the
- * documentation I will specify different String values as
- * either <EM>programmatic</EM> or <EM>localized</EM> to
- * make this distinction clear.
- *
- * @author John Keiser
- * @since 1.1
- */
-
-public class FeatureDescriptor
-{
- String name;
- String displayName;
- String shortDescription;
- boolean expert;
- boolean hidden;
- boolean preferred;
-
- Hashtable valueHash;
-
- /**
- * Instantiate this FeatureDescriptor with appropriate default values.
- */
- public FeatureDescriptor()
- {
- valueHash = new Hashtable();
- }
-
- /**
- * Get the programmatic name of this feature.
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Set the programmatic name of this feature.
- *
- * @param name the new name for this feature.
- */
- public void setName(String name)
- {
- this.name = name;
- }
-
- /**
- * Get the localized (display) name of this feature.
- *
- * @returns The localized display name of this feature or falls
- * back to the programmatic name.
- */
- public String getDisplayName()
- {
- return (displayName == null) ? name : displayName;
- }
-
- /**
- * Set the localized (display) name of this feature.
- *
- * @param displayName the new display name for this feature.
- */
- public void setDisplayName(String displayName)
- {
- this.displayName = displayName;
- }
-
- /**
- * Get the localized short description for this feature.
- *
- * @returns A short localized description of this feature or
- * what <code>getDisplayName</code> returns in case, that no short description
- * is available.
- */
- public String getShortDescription()
- {
- return (shortDescription == null) ? getDisplayName() : shortDescription;
- }
-
- /**
- * Set the localized short description for this feature.
- *
- * @param shortDescription the new short description for this feature.
- */
- public void setShortDescription(String shortDescription)
- {
- this.shortDescription = shortDescription;
- }
-
- /**
- * Indicates whether this feature is for expert use only.
- *
- * @return true if for use by experts only,
- * or false if anyone can use it.
- */
- public boolean isExpert()
- {
- return expert;
- }
-
- /**
- * Set whether this feature is for expert use only.
- *
- * @param expert true if for use by experts only,
- * or false if anyone can use it.
- */
- public void setExpert(boolean expert)
- {
- this.expert = expert;
- }
-
- /**
- * Indicates whether this feature is for use by tools only.
- * If it is for use by tools only, then it should not be displayed.
- *
- * @return true if tools only should use it,
- * or false if anyone can see it.
- */
- public boolean isHidden()
- {
- return hidden;
- }
-
- /**
- * Set whether this feature is for use by tools only.
- * If it is for use by tools only, then it should not be displayed.
- *
- * @param hidden true if tools only should use it,
- * or false if anyone can see it.
- */
- public void setHidden(boolean hidden)
- {
- this.hidden = hidden;
- }
-
- public boolean isPreferred ()
- {
- return preferred;
- }
-
- public void setPreferred (boolean preferred)
- {
- this.preferred = preferred;
- }
-
- /**
- * Get an arbitrary value set with setValue().
- *
- * @param name the programmatic name of the key.
- *
- * @return the value associated with this name,
- * or null if there is none.
- */
- public Object getValue(String name)
- {
- return valueHash.get(name);
- }
-
- /**
- * Set an arbitrary string-value pair with this feature.
- *
- * @param name the programmatic name of the key.
- * @param value the value to associate with the name.
- */
- public void setValue(String name, Object value)
- {
- valueHash.put(name, value);
- }
-
- /**
- * Get a list of the programmatic key names set with setValue().
- *
- * @return an Enumerator over all the programmatic key names associated
- * with this feature.
- */
- public Enumeration attributeNames()
- {
- return valueHash.keys();
- }
-}
diff --git a/libjava/java/beans/IndexedPropertyDescriptor.java b/libjava/java/beans/IndexedPropertyDescriptor.java
deleted file mode 100644
index efdc7b40238..00000000000
--- a/libjava/java/beans/IndexedPropertyDescriptor.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/* java.beans.IndexedPropertyDescriptor
- Copyright (C) 1998, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Method;
-
-/**
- ** IndexedPropertyDescriptor describes information about a JavaBean
- ** indexed property, by which we mean an array-like property that
- ** has been exposed via a pair of get and set methods and another
- ** pair that allows you to get to the property by an index.<P>
- **
- ** An example property would have four methods like this:<P>
- ** <CODE>FooBar[] getFoo()</CODE><BR>
- ** <CODE>void setFoo(FooBar[])</CODE><BR>
- ** <CODE>FooBar getFoo(int)</CODE><BR>
- ** <CODE>void setFoo(int,FooBar)</CODE><P>
- **
- ** The constraints put on get and set methods are:<P>
- ** <OL>
- ** <LI>There must be at least a get(int) or a set(int,...) method.
- ** Nothing else is required. <B>Spec note:</B>One nice restriction
- ** would be that if there is a get() there must be a get(int), same
- ** with set, but that is not in the spec and is fairly harmless.)</LI>
- ** <LI>A get array method must have signature
- ** <CODE>&lt;propertyType&gt;[] &lt;getMethodName&gt;()</CODE></LI>
- ** <LI>A set array method must have signature
- ** <CODE>void &lt;setMethodName&gt;(&lt;propertyType&gt;[])</CODE></LI>
- ** <LI>A get index method must have signature
- ** <CODE>&lt;propertyType&gt; &lt;getMethodName&gt;(int)</CODE></LI>
- ** <LI>A set index method must have signature
- ** <CODE>void &lt;setMethodName&gt;(int,&lt;propertyType&gt;)</CODE></LI>
- ** <LI>All these methods may throw any exception.</LI>
- ** <LI>All these methods must be public.</LI>
- ** </OL>
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 26 Jul 1998
- **/
-
-public class IndexedPropertyDescriptor extends PropertyDescriptor {
- private Class indexedPropertyType;
- private Method setIndex;
- private Method getIndex;
-
- /** Create a new IndexedPropertyDescriptor by introspection.
- ** This form of constructor creates the PropertyDescriptor by
- ** looking for getter methods named <CODE>get&lt;name&gt;()</CODE>
- ** and setter methods named
- ** <CODE>set&lt;name&gt;()</CODE> in class
- ** <CODE>&lt;beanClass&gt;</CODE>, where &lt;name&gt; has its
- ** first letter capitalized by the constructor.<P>
- **
- ** <B>Implementation note:</B> If there is a get(int) method,
- ** then the return type of that method is used to find the
- ** remaining methods. If there is no get method, then the
- ** set(int) method is searched for exhaustively and that type
- ** is used to find the others.<P>
- **
- ** <B>Spec note:</B>
- ** If there is no get(int) method and multiple set(int) methods with
- ** the same name and the correct parameters (different type of course),
- ** then an IntrospectionException is thrown. While Sun's spec
- ** does not state this, it can make Bean behavior different on
- ** different systems (since method order is not guaranteed) and as
- ** such, can be treated as a bug in the spec. I am not aware of
- ** whether Sun's implementation catches this.
- **
- ** @param name the programmatic name of the property, usually
- ** starting with a lowercase letter (e.g. fooManChu
- ** instead of FooManChu).
- ** @param beanClass the class the get and set methods live in.
- ** @exception IntrospectionException if the methods are not found or invalid.
- **/
- public IndexedPropertyDescriptor(String name, Class beanClass) throws IntrospectionException {
- super(name);
- String capitalized;
- try {
- capitalized = Character.toUpperCase(name.charAt(0)) + name.substring(1);
- } catch(StringIndexOutOfBoundsException e) {
- capitalized = "";
- }
- findMethods(beanClass, "get" + capitalized, "set" + capitalized, "get" + capitalized, "set" + capitalized);
- }
-
- /** Create a new IndexedPropertyDescriptor by introspection.
- ** This form of constructor allows you to specify the
- ** names of the get and set methods to search for.<P>
- **
- ** <B>Implementation note:</B> If there is a get(int) method,
- ** then the return type of that method is used to find the
- ** remaining methods. If there is no get method, then the
- ** set(int) method is searched for exhaustively and that type
- ** is used to find the others.<P>
- **
- ** <B>Spec note:</B>
- ** If there is no get(int) method and multiple set(int) methods with
- ** the same name and the correct parameters (different type of course),
- ** then an IntrospectionException is thrown. While Sun's spec
- ** does not state this, it can make Bean behavior different on
- ** different systems (since method order is not guaranteed) and as
- ** such, can be treated as a bug in the spec. I am not aware of
- ** whether Sun's implementation catches this.
- **
- ** @param name the programmatic name of the property, usually
- ** starting with a lowercase letter (e.g. fooManChu
- ** instead of FooManChu).
- ** @param beanClass the class the get and set methods live in.
- ** @param getMethodName the name of the get array method.
- ** @param setMethodName the name of the set array method.
- ** @param getIndexName the name of the get index method.
- ** @param setIndexName the name of the set index method.
- ** @exception IntrospectionException if the methods are not found or invalid.
- **/
- public IndexedPropertyDescriptor(String name, Class beanClass, String getMethodName, String setMethodName, String getIndexName, String setIndexName) throws IntrospectionException {
- super(name);
- findMethods(beanClass, getMethodName, setMethodName, getIndexName, setIndexName);
- }
-
- /** Create a new PropertyDescriptor using explicit Methods.
- ** Note that the methods will be checked for conformance to standard
- ** Property method rules, as described above at the top of this class.
- **
- ** @param name the programmatic name of the property, usually
- ** starting with a lowercase letter (e.g. fooManChu
- ** instead of FooManChu).
- ** @param getMethod the get array method.
- ** @param setMethod the set array method.
- ** @param getIndex the get index method.
- ** @param setIndex the set index method.
- ** @exception IntrospectionException if the methods are not found or invalid.
- **/
- public IndexedPropertyDescriptor(String name, Method getMethod, Method setMethod, Method getIndex, Method setIndex) throws IntrospectionException {
- super(name);
- if(getMethod != null && getMethod.getParameterTypes().length > 0) {
- throw new IntrospectionException("get method has parameters");
- }
- if(getMethod != null && setMethod.getParameterTypes().length != 1) {
- throw new IntrospectionException("set method does not have exactly one parameter");
- }
- if(getMethod != null && setMethod != null) {
- if(!getMethod.getReturnType().equals(setMethod.getParameterTypes()[0])) {
- throw new IntrospectionException("set and get methods do not share the same type");
- }
- if(!getMethod.getDeclaringClass().isAssignableFrom(setMethod.getDeclaringClass())
- && !setMethod.getDeclaringClass().isAssignableFrom(getMethod.getDeclaringClass())) {
- throw new IntrospectionException("set and get methods are not in the same class.");
- }
- }
-
- if(getIndex != null && (getIndex.getParameterTypes().length != 1
- || !(getIndex.getParameterTypes()[0]).equals(java.lang.Integer.TYPE))) {
- throw new IntrospectionException("get index method has wrong parameters");
- }
- if(setIndex != null && (setIndex.getParameterTypes().length != 2
- || !(setIndex.getParameterTypes()[0]).equals(java.lang.Integer.TYPE))) {
- throw new IntrospectionException("set index method has wrong parameters");
- }
- if(getIndex != null && setIndex != null) {
- if(!getIndex.getReturnType().equals(setIndex.getParameterTypes()[1])) {
- throw new IntrospectionException("set index methods do not share the same type");
- }
- if(!getIndex.getDeclaringClass().isAssignableFrom(setIndex.getDeclaringClass())
- && !setIndex.getDeclaringClass().isAssignableFrom(getIndex.getDeclaringClass())) {
- throw new IntrospectionException("get and set index methods are not in the same class.");
- }
- }
-
- if(getIndex != null && getMethod != null && !getIndex.getDeclaringClass().isAssignableFrom(getMethod.getDeclaringClass())
- && !getMethod.getDeclaringClass().isAssignableFrom(getIndex.getDeclaringClass())) {
- throw new IntrospectionException("methods are not in the same class.");
- }
-
- if(getIndex != null && getMethod != null && !Array.newInstance(getIndex.getReturnType(),0).getClass().equals(getMethod.getReturnType())) {
- throw new IntrospectionException("array methods do not match index methods.");
- }
-
- this.getMethod = getMethod;
- this.setMethod = setMethod;
- this.getIndex = getIndex;
- this.setIndex = setIndex;
- this.indexedPropertyType = getIndex != null ? getIndex.getReturnType() : setIndex.getParameterTypes()[1];
- this.propertyType = getMethod != null ? getMethod.getReturnType() : (setMethod != null ? setMethod.getParameterTypes()[0] : Array.newInstance(this.indexedPropertyType,0).getClass());
- }
-
- public Class getIndexedPropertyType() {
- return indexedPropertyType;
- }
-
- public Method getIndexedReadMethod() {
- return getIndex;
- }
-
- public Method getIndexedWriteMethod() {
- return setIndex;
- }
-
- private void findMethods(Class beanClass, String getMethodName, String setMethodName, String getIndexName, String setIndexName) throws IntrospectionException {
- try {
- if(getIndexName != null) {
- try {
- Class[] getArgs = new Class[1];
- getArgs[0] = java.lang.Integer.TYPE;
- getIndex = beanClass.getMethod(getIndexName,getArgs);
- indexedPropertyType = getIndex.getReturnType();
- } catch(NoSuchMethodException E) {
- }
- }
- if(getIndex != null) {
- if(setIndexName != null) {
- try {
- Class[] setArgs = new Class[2];
- setArgs[0] = java.lang.Integer.TYPE;
- setArgs[1] = indexedPropertyType;
- setIndex = beanClass.getMethod(setIndexName,setArgs);
- if(!setIndex.getReturnType().equals(java.lang.Void.TYPE)) {
- throw new IntrospectionException(setIndexName + " has non-void return type");
- }
- } catch(NoSuchMethodException E) {
- }
- }
- } else if(setIndexName != null) {
- Method[] m = beanClass.getMethods();
- for(int i=0;i<m.length;i++) {
- Method current = m[i];
- if(current.getName().equals(setIndexName)
- && current.getParameterTypes().length == 2
- && (current.getParameterTypes()[0]).equals(java.lang.Integer.TYPE)
- && current.getReturnType().equals(java.lang.Void.TYPE)) {
- if(setIndex != null) {
- throw new IntrospectionException("Multiple, different set methods found that fit the bill!");
- } else {
- setIndex = current;
- indexedPropertyType = current.getParameterTypes()[1];
- }
- }
- }
- if(setIndex == null) {
- throw new IntrospectionException("Cannot find get or set methods.");
- }
- } else {
- throw new IntrospectionException("Cannot find get or set methods.");
- }
-
- Class arrayType = Array.newInstance(indexedPropertyType,0).getClass();
-
- Class[] setArgs = new Class[1];
- setArgs[0] = arrayType;
- try {
- setMethod = beanClass.getMethod(setMethodName,setArgs);
- if(!setMethod.getReturnType().equals(java.lang.Void.TYPE)) {
- setMethod = null;
- }
- } catch(NoSuchMethodException E) {
- }
-
- Class[] getArgs = new Class[0];
- try {
- getMethod = beanClass.getMethod(getMethodName,getArgs);
- if(!getMethod.getReturnType().equals(arrayType)) {
- getMethod = null;
- }
- } catch(NoSuchMethodException E) {
- }
- } catch(SecurityException E) {
- throw new IntrospectionException("SecurityException while trying to find methods.");
- }
- }
-}
diff --git a/libjava/java/beans/IntrospectionException.java b/libjava/java/beans/IntrospectionException.java
deleted file mode 100644
index 7bb83dac5b3..00000000000
--- a/libjava/java/beans/IntrospectionException.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* IntrospectionException -- thrown when an exception occurs in introspection
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/**
- * IntrospectionException is thrown when the Introspector fails. Typical
- * causes are the inability to map a name to its Class, or specifying a
- * wrong type signature.
- *
- * @author John Keiser
- * @see Introspector
- * @since 1.1
- * @status updated to 1.4
- */
-public class IntrospectionException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -3728150539969542619L;
-
- /**
- * Instantiate this exception with the given message.
- *
- * @param msg the message for the exception
- */
- public IntrospectionException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/beans/Introspector.java b/libjava/java/beans/Introspector.java
deleted file mode 100644
index 02781b46e0d..00000000000
--- a/libjava/java/beans/Introspector.java
+++ /dev/null
@@ -1,608 +0,0 @@
-/* java.beans.Introspector
- Copyright (C) 1998, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import gnu.java.beans.BeanInfoEmbryo;
-import gnu.java.beans.ExplicitBeanInfo;
-import gnu.java.beans.IntrospectionIncubator;
-import gnu.java.lang.ClassHelper;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-/**
- * Introspector is the class that does the bulk of the
- * design-time work in Java Beans. Every class must have
- * a BeanInfo in order for an RAD tool to use it; but, as
- * promised, you don't have to write the BeanInfo class
- * yourself if you don't want to. All you have to do is
- * call getBeanInfo() in the Introspector and it will use
- * standard JavaBeans-defined method signatures to
- * determine the information about your class.<P>
- *
- * Don't worry about it too much, though: you can provide
- * JavaBeans with as much customized information as you
- * want, or as little as you want, using the BeanInfo
- * interface (see BeanInfo for details).<P>
- *
- * <STRONG>Order of Operations</STRONG><P>
- *
- * When you call getBeanInfo(class c), the Introspector
- * first searches for BeanInfo class to see if you
- * provided any explicit information. It searches for a
- * class named &lt;bean class name&gt;BeanInfo in different
- * packages, first searching the bean class's package
- * and then moving on to search the beanInfoSearchPath.<P>
- *
- * If it does not find a BeanInfo class, it acts as though
- * it had found a BeanInfo class returning null from all
- * methods (meaning it should discover everything through
- * Introspection). If it does, then it takes the
- * information it finds in the BeanInfo class to be
- * canonical (that is, the information speaks for its
- * class as well as all superclasses).<P>
- *
- * When it has introspected the class, calls
- * getBeanInfo(c.getSuperclass) and adds that information
- * to the information it has, not adding to any information
- * it already has that is canonical.<P>
- *
- * <STRONG>Introspection Design Patterns</STRONG><P>
- *
- * When the Introspector goes in to read the class, it
- * follows a well-defined order in order to not leave any
- * methods unaccounted for. Its job is to step over all
- * of the public methods in a class and determine whether
- * they are part of a property, an event, or a method (in
- * that order).
- *
- *
- * <STRONG>Properties:</STRONG><P>
- *
- * <OL>
- * <LI>If there is a <CODE>public boolean isXXX()</CODE>
- * method, then XXX is a read-only boolean property.
- * <CODE>boolean getXXX()</CODE> may be supplied in
- * addition to this method, although isXXX() is the
- * one that will be used in this case and getXXX()
- * will be ignored. If there is a
- * <CODE>public void setXXX(boolean)</CODE> method,
- * it is part of this group and makes it a read-write
- * property.</LI>
- * <LI>If there is a
- * <CODE>public &lt;type&gt; getXXX(int)</CODE>
- * method, then XXX is a read-only indexed property of
- * type &lt;type&gt;. If there is a
- * <CODE>public void setXXX(int,&lt;type&gt;)</CODE>
- * method, then it is a read-write indexed property of
- * type &lt;type&gt;. There may also be a
- * <CODE>public &lt;type&gt;[] getXXX()</CODE> and a
- * <CODE>public void setXXX(&lt;type&gt;)</CODE>
- * method as well.</LI>
- * <LI>If there is a
- * <CODE>public void setXXX(int,&lt;type&gt;)</CODE>
- * method, then it is a write-only indexed property of
- * type &lt;type&gt;. There may also be a
- * <CODE>public &lt;type&gt;[] getXXX()</CODE> and a
- * <CODE>public void setXXX(&lt;type&gt;)</CODE>
- * method as well.</LI>
- * <LI>If there is a
- * <CODE>public &lt;type&gt; getXXX()</CODE> method,
- * then XXX is a read-only property of type
- * &lt;type&gt;. If there is a
- * <CODE>public void setXXX(&lt;type&gt;)</CODE>
- * method, then it will be used for the property and
- * the property will be considered read-write.</LI>
- * <LI>If there is a
- * <CODE>public void setXXX(&lt;type&gt;)</CODE>
- * method, then as long as XXX is not already used as
- * the name of a property, XXX is assumed to be a
- * write-only property of type &lt;type&gt;.</LI>
- * <LI>In all of the above cases, if the setXXX() method
- * throws <CODE>PropertyVetoException</CODE>, then the
- * property in question is assumed to be constrained.
- * No properties are ever assumed to be bound
- * (<STRONG>Spec Note:</STRONG> this is not in the
- * spec, it just makes sense). See PropertyDescriptor
- * for a description of bound and constrained
- * properties.</LI>
- * </OL>
- *
- * <STRONG>Events:</STRONG><P>
- *
- * If there is a pair of methods,
- * <CODE>public void addXXX(&lt;type&gt;)</CODE> and
- * <CODE>public void removeXXX(&lt;type&gt;)</CODE>, where
- * &lt;type&gt; is a descendant of
- * <CODE>java.util.EventListener</CODE>, then the pair of
- * methods imply that this Bean will fire events to
- * listeners of type &lt;type&gt;.<P>
- *
- * If the addXXX() method throws
- * <CODE>java.util.TooManyListenersException</CODE>, then
- * the event set is assumed to be <EM>unicast</EM>. See
- * EventSetDescriptor for a discussion of unicast event
- * sets.<P>
- *
- * <STRONG>Spec Note:</STRONG> the spec seems to say that
- * the listener type's classname must be equal to the XXX
- * part of addXXX() and removeXXX(), but that is not the
- * case in Sun's implementation, so I am assuming it is
- * not the case in general.<P>
- *
- * <STRONG>Methods:</STRONG><P>
- *
- * Any public methods (including those which were used
- * for Properties or Events) are used as Methods.
- *
- * @author John Keiser
- * @since JDK1.1
- * @see java.beans.BeanInfo
- */
-public class Introspector {
-
- public static final int USE_ALL_BEANINFO = 1;
- public static final int IGNORE_IMMEDIATE_BEANINFO = 2;
- public static final int IGNORE_ALL_BEANINFO = 3;
-
- static String[] beanInfoSearchPath = {"gnu.java.beans.info"};
- static Hashtable beanInfoCache = new Hashtable();
-
- private Introspector() {}
-
- /**
- * Get the BeanInfo for class <CODE>beanClass</CODE>,
- * first by looking for explicit information, next by
- * using standard design patterns to determine
- * information about the class.
- *
- * @param beanClass the class to get BeanInfo about.
- * @return the BeanInfo object representing the class.
- */
- public static BeanInfo getBeanInfo(Class beanClass)
- throws IntrospectionException
- {
- BeanInfo cachedInfo;
- synchronized(beanClass)
- {
- cachedInfo = (BeanInfo)beanInfoCache.get(beanClass);
- if(cachedInfo != null)
- {
- return cachedInfo;
- }
- cachedInfo = getBeanInfo(beanClass,null);
- beanInfoCache.put(beanClass,cachedInfo);
- return cachedInfo;
- }
- }
-
- /**
- * Flush all of the Introspector's internal caches.
- *
- * @since 1.2
- */
- public static void flushCaches()
- {
- beanInfoCache.clear();
-
- // Clears all the intermediate ExplicitInfo instances which
- // have been created.
- // This makes sure we have to retrieve stuff like BeanDescriptors
- // again. (Remember that FeatureDescriptor can be modified by the user.)
- ExplicitInfo.flushCaches();
- }
-
- /**
- * Flush the Introspector's internal cached information for a given
- * class.
- *
- * @param clz the class to be flushed.
- * @throws NullPointerException if clz is null.
- * @since 1.2
- */
- public static void flushFromCaches(Class clz)
- {
- synchronized (clz)
- {
- beanInfoCache.remove(clz);
- }
- }
-
- /**
- * Get the BeanInfo for class <CODE>beanClass</CODE>,
- * first by looking for explicit information, next by
- * using standard design patterns to determine
- * information about the class. It crawls up the
- * inheritance tree until it hits <CODE>topClass</CODE>.
- *
- * @param beanClass the Bean class.
- * @param stopClass the class to stop at.
- * @return the BeanInfo object representing the class.
- */
- public static BeanInfo getBeanInfo(Class beanClass, Class stopClass)
- throws IntrospectionException
- {
- ExplicitInfo explicit = new ExplicitInfo(beanClass, stopClass);
-
- IntrospectionIncubator ii = new IntrospectionIncubator();
- ii.setPropertyStopClass(explicit.propertyStopClass);
- ii.setEventStopClass(explicit.eventStopClass);
- ii.setMethodStopClass(explicit.methodStopClass);
- ii.addMethods(beanClass.getMethods());
-
- BeanInfoEmbryo currentInfo = ii.getBeanInfoEmbryo();
- PropertyDescriptor[] p = explicit.explicitPropertyDescriptors;
- if(p!=null)
- {
- for(int i=0;i<p.length;i++)
- {
- if(!currentInfo.hasProperty(p[i]))
- {
- currentInfo.addProperty(p[i]);
- }
- }
- if(explicit.defaultProperty != -1)
- {
- currentInfo.setDefaultPropertyName(p[explicit.defaultProperty].getName());
- }
- }
- EventSetDescriptor[] e = explicit.explicitEventSetDescriptors;
- if(e!=null)
- {
- for(int i=0;i<e.length;i++)
- {
- if(!currentInfo.hasEvent(e[i]))
- {
- currentInfo.addEvent(e[i]);
- }
- }
- if(explicit.defaultEvent != -1)
- {
- currentInfo.setDefaultEventName(e[explicit.defaultEvent].getName());
- }
- }
- MethodDescriptor[] m = explicit.explicitMethodDescriptors;
- if(m!=null)
- {
- for(int i=0;i<m.length;i++)
- {
- if(!currentInfo.hasMethod(m[i]))
- {
- currentInfo.addMethod(m[i]);
- }
- }
- }
-
- // Sets the info's BeanDescriptor to the one we extracted from the
- // explicit BeanInfo instance(s) if they contained one. Otherwise we
- // create the BeanDescriptor from scratch.
- // Note: We do not create a copy the retrieved BeanDescriptor which will allow
- // the user to modify the instance while it is cached. However this is how
- // the RI does it.
- currentInfo.setBeanDescriptor(
- (explicit.explicitBeanDescriptor == null ?
- new BeanDescriptor(beanClass, null) :
- explicit.explicitBeanDescriptor));
-
- currentInfo.setAdditionalBeanInfo(explicit.explicitBeanInfo);
- currentInfo.setIcons(explicit.im);
-
- return currentInfo.getBeanInfo();
- }
-
- /**
- * Get the search path for BeanInfo classes.
- *
- * @return the BeanInfo search path.
- */
- public static String[] getBeanInfoSearchPath()
- {
- return beanInfoSearchPath;
- }
-
- /**
- * Set the search path for BeanInfo classes.
- * @param beanInfoSearchPath the new BeanInfo search
- * path.
- */
- public static void setBeanInfoSearchPath(String[] beanInfoSearchPath)
- {
- Introspector.beanInfoSearchPath = beanInfoSearchPath;
- }
-
- /**
- * A helper method to convert a name to standard Java
- * naming conventions: anything with two capitals as the
- * first two letters remains the same, otherwise the
- * first letter is decapitalized. URL = URL, I = i,
- * MyMethod = myMethod.
- *
- * @param name the name to decapitalize.
- * @return the decapitalized name.
- */
- public static String decapitalize(String name)
- {
- try
- {
- if(!Character.isUpperCase(name.charAt(0)))
- {
- return name;
- }
- else
- {
- try
- {
- if(Character.isUpperCase(name.charAt(1)))
- {
- return name;
- }
- else
- {
- char[] c = name.toCharArray();
- c[0] = Character.toLowerCase(c[0]);
- return new String(c);
- }
- }
- catch(StringIndexOutOfBoundsException E)
- {
- char[] c = new char[1];
- c[0] = Character.toLowerCase(name.charAt(0));
- return new String(c);
- }
- }
- }
- catch(StringIndexOutOfBoundsException E)
- {
- return name;
- }
- catch(NullPointerException E)
- {
- return null;
- }
- }
-
- static BeanInfo copyBeanInfo(BeanInfo b)
- {
- java.awt.Image[] icons = new java.awt.Image[4];
- for(int i=1;i<=4;i++)
- {
- icons[i-1] = b.getIcon(i);
- }
-
- return new ExplicitBeanInfo(b.getBeanDescriptor(),
- b.getAdditionalBeanInfo(),
- b.getPropertyDescriptors(),
- b.getDefaultPropertyIndex(),
- b.getEventSetDescriptors(),
- b.getDefaultEventIndex(),
- b.getMethodDescriptors(),
- icons);
- }
-}
-
-class ExplicitInfo
-{
- BeanDescriptor explicitBeanDescriptor;
- BeanInfo[] explicitBeanInfo;
-
- PropertyDescriptor[] explicitPropertyDescriptors;
- EventSetDescriptor[] explicitEventSetDescriptors;
- MethodDescriptor[] explicitMethodDescriptors;
-
- int defaultProperty;
- int defaultEvent;
-
- java.awt.Image[] im = new java.awt.Image[4];
-
- Class propertyStopClass;
- Class eventStopClass;
- Class methodStopClass;
-
- static Hashtable explicitBeanInfos = new Hashtable();
- static Vector emptyBeanInfos = new Vector();
-
- ExplicitInfo(Class beanClass, Class stopClass)
- {
- while(beanClass != null && !beanClass.equals(stopClass))
- {
-
- BeanInfo explicit = findExplicitBeanInfo(beanClass);
-
-
- if(explicit != null)
- {
-
- if(explicitBeanDescriptor == null)
- {
- explicitBeanDescriptor = explicit.getBeanDescriptor();
- }
-
- if(explicitBeanInfo == null)
- {
- explicitBeanInfo = explicit.getAdditionalBeanInfo();
- }
-
- if(explicitPropertyDescriptors == null)
- {
- if(explicit.getPropertyDescriptors() != null)
- {
- explicitPropertyDescriptors = explicit.getPropertyDescriptors();
- defaultProperty = explicit.getDefaultPropertyIndex();
- propertyStopClass = beanClass;
- }
- }
-
- if(explicitEventSetDescriptors == null)
- {
- if(explicit.getEventSetDescriptors() != null)
- {
- explicitEventSetDescriptors = explicit.getEventSetDescriptors();
- defaultEvent = explicit.getDefaultEventIndex();
- eventStopClass = beanClass;
- }
- }
-
- if(explicitMethodDescriptors == null)
- {
- if(explicit.getMethodDescriptors() != null)
- {
- explicitMethodDescriptors = explicit.getMethodDescriptors();
- methodStopClass = beanClass;
- }
- }
-
- if(im[0] == null && im[1] == null
- && im[2] == null && im[3] == null)
- {
- im[0] = explicit.getIcon(0);
- im[1] = explicit.getIcon(1);
- im[2] = explicit.getIcon(2);
- im[3] = explicit.getIcon(3);
- }
- }
- beanClass = beanClass.getSuperclass();
- }
-
- if(propertyStopClass == null)
- {
- propertyStopClass = stopClass;
- }
-
- if(eventStopClass == null)
- {
- eventStopClass = stopClass;
- }
-
- if(methodStopClass == null)
- {
- methodStopClass = stopClass;
- }
- }
-
- /** Throws away all cached data and makes sure we re-instantiate things
- * like BeanDescriptors again.
- */
- static void flushCaches() {
- explicitBeanInfos.clear();
- emptyBeanInfos.clear();
- }
-
- static BeanInfo findExplicitBeanInfo(Class beanClass)
- {
- BeanInfo retval = (BeanInfo)explicitBeanInfos.get(beanClass);
- if(retval != null)
- {
- return retval;
- }
- else if(emptyBeanInfos.indexOf(beanClass) != -1)
- {
- return null;
- }
- else
- {
- retval = reallyFindExplicitBeanInfo(beanClass);
- if(retval != null)
- {
- explicitBeanInfos.put(beanClass,retval);
- }
- else
- {
- emptyBeanInfos.addElement(beanClass);
- }
- return retval;
- }
- }
-
- static BeanInfo reallyFindExplicitBeanInfo(Class beanClass)
- {
- ClassLoader beanClassLoader = beanClass.getClassLoader();
- BeanInfo beanInfo;
-
- beanInfo = getBeanInfo(beanClassLoader, beanClass.getName() + "BeanInfo");
- if (beanInfo == null)
- {
- String newName;
- newName = ClassHelper.getTruncatedClassName(beanClass) + "BeanInfo";
-
- for(int i = 0; i < Introspector.beanInfoSearchPath.length; i++)
- {
- if (Introspector.beanInfoSearchPath[i].equals(""))
- beanInfo = getBeanInfo(beanClassLoader, newName);
- else
- beanInfo = getBeanInfo(beanClassLoader,
- Introspector.beanInfoSearchPath[i] + "."
- + newName);
-
- // Returns the beanInfo if it exists and the described class matches
- // the one we searched.
- if (beanInfo != null && beanInfo.getBeanDescriptor() != null &&
- beanInfo.getBeanDescriptor().getBeanClass() == beanClass)
-
- return beanInfo;
- }
- }
-
- return beanInfo;
- }
-
- /**
- * Returns an instance of the given class name when it can be loaded
- * through the given class loader, or null otherwise.
- */
- private static BeanInfo getBeanInfo(ClassLoader cl, String infoName)
- {
- try
- {
- return (BeanInfo) Class.forName(infoName, true, cl).newInstance();
- }
- catch (ClassNotFoundException cnfe)
- {
- return null;
- }
- catch (IllegalAccessException iae)
- {
- return null;
- }
- catch (InstantiationException ie)
- {
- return null;
- }
- }
-
-}
diff --git a/libjava/java/beans/MethodDescriptor.java b/libjava/java/beans/MethodDescriptor.java
deleted file mode 100644
index 123dba60cc9..00000000000
--- a/libjava/java/beans/MethodDescriptor.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* java.beans.MethodDescriptor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.lang.reflect.Method;
-
-/** MethodDescriptor describes information about a JavaBeans method.
- ** It's a fairly straightforward class (at least something in this
- ** package is straightforward!).
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 26 Jul 1998
- **/
-public class MethodDescriptor extends FeatureDescriptor {
- private Method m;
- private ParameterDescriptor[] parameterDescriptors;
-
- /** Create a new MethodDescriptor.
- ** This method sets the name to the name of the method (Method.getName()).
- ** @param m the method it will represent.
- **/
- public MethodDescriptor(Method m) {
- setName(m.getName());
- this.m = m;
- }
-
- /** Create a new MethodDescriptor.
- ** This method sets the name to the name of the method (Method.getName()).
- ** @param m the method it will represent.
- ** @param parameterDescriptors descriptions of the parameters (especially names).
- **/
- public MethodDescriptor(Method m, ParameterDescriptor[] parameterDescriptors) {
- setName(m.getName());
- this.m = m;
- this.parameterDescriptors = parameterDescriptors;
- }
-
- /** Get the parameter descriptors from this method.
- ** Since MethodDescriptor has no way of determining what
- ** the parameter names were, this defaults to null.
- **/
- public ParameterDescriptor[] getParameterDescriptors() {
- return parameterDescriptors;
- }
-
- /** Get the method this MethodDescriptor represents. **/
- public Method getMethod() {
- return m;
- }
-}
-
diff --git a/libjava/java/beans/ParameterDescriptor.java b/libjava/java/beans/ParameterDescriptor.java
deleted file mode 100644
index 8ea93a9bd8d..00000000000
--- a/libjava/java/beans/ParameterDescriptor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* java.beans.MethodDescriptor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/** ParameterDescriptor represents a single parameter to a method.
- ** As it turns out, FeatureDescriptor is sufficient to hold all
- ** the information. Use its constructor and methods to set
- ** the appropriate values.
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 26 Jul 1998
- **/
-public class ParameterDescriptor extends FeatureDescriptor {
-
-}
diff --git a/libjava/java/beans/PropertyChangeEvent.java b/libjava/java/beans/PropertyChangeEvent.java
deleted file mode 100644
index 3e3f948e32a..00000000000
--- a/libjava/java/beans/PropertyChangeEvent.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* PropertyChangeEvent.java -- describes a change in a property
- Copyright (C) 1998, 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.util.EventObject;
-
-/**
- * PropertyChangeEvents are fired in the PropertyChange and VetoableChange
- * event classes. They represent the old and new values as well as the
- * source Bean. If the old or new value is a primitive type, it must be
- * wrapped in the appropriate wrapper type (java.lang.Integer for int, etc.,
- * etc.).
- *
- * <p>If the old or new values are unknown (although why that would be I do
- * not know), they may be null. Also, if the set of properties itself has
- * changed, the name should be null, and the old and new values may also be
- * null. Right now Sun put in a propagationId, reserved for future use. Read
- * the comments on the constructor and on setPropagationId for more
- * information.
- *
- * @author John Keiser
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status udpated to 1.4
- */
-public class PropertyChangeEvent extends EventObject
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 7042693688939648123L;
-
- /**
- * The name of the property that changed, may be null. Package visible for
- * use by PropertyChangeSupport.
- *
- * @serial the changed property name
- */
- final String propertyName;
-
- /**
- * The new value of the property, may be null. Package visible for use by
- * PropertyChangeSupport.
- *
- * @serial the new property value
- */
- final Object newValue;
-
- /**
- * The old value of the property, may be null. Package visible for use by
- * PropertyChangeSupport.
- *
- * @serial the old property value
- */
- final Object oldValue;
-
- /**
- * The propagation ID, reserved for future use. May be null.
- *
- * @see #getPropagationId()
- * @serial the Propagation ID
- */
- private Object propagationId;
-
- /**
- * Create a new PropertyChangeEvent. Remember that if you received a
- * PropertyChangeEvent and are sending a new one, you should also set the
- * propagation ID from the old PropertyChangeEvent.
- *
- * @param source the Bean containing the property
- * @param propertyName the property's name
- * @param oldVal the old value of the property
- * @param newVal the new value of the property
- * @throws IllegalArgumentException if source is null
- */
- public PropertyChangeEvent(Object source, String propertyName,
- Object oldVal, Object newVal)
- {
- super(source);
- this.propertyName = propertyName;
- oldValue = oldVal;
- newValue = newVal;
- }
-
- /**
- * Get the property name. May be null if multiple properties changed.
- *
- * @return the property name
- */
- public String getPropertyName()
- {
- return propertyName;
- }
-
- /**
- * Get the property's new value. May be null if multiple properties changed.
- *
- * @return the property's new value
- */
- public Object getNewValue()
- {
- return newValue;
- }
-
- /**
- * Get the property's old value. May be null if multiple properties changed.
- *
- * @return the property's old value
- */
- public Object getOldValue()
- {
- return oldValue;
- }
-
- /**
- * Set the propagation ID. This is a way for the event to be passed from
- * hand to hand and retain a little extra state. Right now it is unused,
- * but it should be propagated anyway so that future versions of JavaBeans
- * can use it, for God knows what.
- *
- * @param propagationId the propagation ID
- * @see #getPropagationId()
- */
- public void setPropagationId(Object propagationId)
- {
- this.propagationId = propagationId;
- }
-
- /**
- * Get the propagation ID. Right now, it is not used for anything.
- *
- * @return the propagation ID
- * @see #setPropagationId(Object)
- */
- public Object getPropagationId()
- {
- return propagationId;
- }
-
- /**
- * Utility method to rollback a change.
- *
- * @param event the event to rollback
- * @return a new event with old and new swapped
- */
- PropertyChangeEvent rollback()
- {
- PropertyChangeEvent result
- = new PropertyChangeEvent(source, propertyName, newValue, oldValue);
- result.propagationId = propagationId;
- return result;
- }
-} // class PropertyChangeEvent
diff --git a/libjava/java/beans/PropertyChangeListener.java b/libjava/java/beans/PropertyChangeListener.java
deleted file mode 100644
index a97e6e1c2e9..00000000000
--- a/libjava/java/beans/PropertyChangeListener.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* PropertyChangeListener.java -- listen for changes in a bound property
- Copyright (C) 1998, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.util.EventListener;
-
-/**
- * PropertyChangeListener allows a class to monitor properties of a Bean for
- * changes. A propertyChange() event will only be fired <em>after</em> the
- * property has changed.
- *
- * @author John Keiser
- * @see PropertyChangeSupport
- * @since 1.1
- * @status updated to 1.4
- */
-public interface PropertyChangeListener extends EventListener
-{
- /**
- * Fired after a Bean's property has changed.
- *
- * @param e the change (containing the old and new values)
- */
- void propertyChange(PropertyChangeEvent e);
-} // interface PropertyChangeListener
diff --git a/libjava/java/beans/PropertyChangeListenerProxy.java b/libjava/java/beans/PropertyChangeListenerProxy.java
deleted file mode 100644
index 68a8153032b..00000000000
--- a/libjava/java/beans/PropertyChangeListenerProxy.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* PropertyChangeListenerProxy.java -- adds a name to a property listener
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.util.EventListenerProxy;
-
-/**
- * This class provides an extension to <code>PropertyChangeListener</code> -
- * associating a name with the listener. This can be used to filter the
- * changes that one is interested in.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status udpated to 1.4
- */
-public class PropertyChangeListenerProxy extends EventListenerProxy
- implements PropertyChangeListener
-{
- /**
- * The name of the property to listen for. Package visible for use by
- * PropertyChangeSupport.
- */
- final String propertyName;
-
- /**
- * Create a new proxy which filters property change events and only passes
- * changes to the named property on to the delegate. A null propertyName
- * or listener does not fail now, but may cause a NullPointerException down
- * the road.
- *
- * @param propertyName the property's name to filter on
- * @param listener the delegate listener
- */
- public PropertyChangeListenerProxy(String propertyName,
- PropertyChangeListener listener)
- {
- super(listener);
- this.propertyName = propertyName;
- }
-
- /**
- * Forwards the event on to the delegate if the property name matches.
- *
- * @param event the event to pass on, if it meets the filter
- * @throws NullPointerException if the delegate this was created with is null
- */
- public void propertyChange(PropertyChangeEvent event)
- {
- // Note: Sun does not filter, under the assumption that since
- // PropertyChangeSupport unwraps proxys, this method should never be
- // called by normal use of listeners.
- String name = event == null ? null : event.getPropertyName();
- if (name == null ? propertyName == null : name.equals(propertyName))
- ((PropertyChangeListener) getListener()).propertyChange(event);
- }
-
- /**
- * Gets the name of the property this proxy is filtering on.
- *
- * @return the property name
- */
- public String getPropertyName()
- {
- return propertyName;
- }
-} // class PropertyChangeListenerProxy
diff --git a/libjava/java/beans/PropertyChangeSupport.java b/libjava/java/beans/PropertyChangeSupport.java
deleted file mode 100644
index a0e64af4d29..00000000000
--- a/libjava/java/beans/PropertyChangeSupport.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/* PropertyChangeSupport.java -- support to manage property change listeners
- Copyright (C) 1998, 1999, 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map.Entry;
-import java.util.Vector;
-
-/**
- * PropertyChangeSupport makes it easy to fire property change events and
- * handle listeners. It allows chaining of listeners, as well as filtering
- * by property name. In addition, it will serialize only those listeners
- * which are serializable, ignoring the others without problem. This class
- * is thread-safe.
- *
- * @author John Keiser
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status updated to 1.4
- */
-public class PropertyChangeSupport implements Serializable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 6401253773779951803L;
-
- /**
- * Maps property names (String) to named listeners (PropertyChangeSupport).
- * If this is a child instance, this field will be null.
- *
- * @serial the map of property names to named listener managers
- * @since 1.2
- */
- private Hashtable children;
-
- /**
- * The non-null source object for any generated events.
- *
- * @serial the event source
- */
- private final Object source;
-
- /**
- * A field to compare serialization versions - this class uses version 2.
- *
- * @serial the serialization format
- */
- private static final int propertyChangeSupportSerializedDataVersion = 2;
-
- /**
- * The list of all registered property listeners. If this instance was
- * created by user code, this only holds the global listeners (ie. not tied
- * to a name), and may be null. If it was created by this class, as a
- * helper for named properties, then this vector will be non-null, and this
- * instance appears as a value in the <code>children</code> hashtable of
- * another instance, so that the listeners are tied to the key of that
- * hashtable entry.
- */
- private transient Vector listeners;
-
- /**
- * Create a PropertyChangeSupport to work with a specific source bean.
- *
- * @param source the source bean to use
- * @throws NullPointerException if source is null
- */
- public PropertyChangeSupport(Object source)
- {
- this.source = source;
- if (source == null)
- throw new NullPointerException();
- }
-
- /**
- * Adds a PropertyChangeListener to the list of global listeners. All
- * property change events will be sent to this listener. The listener add
- * is not unique: that is, <em>n</em> adds with the same listener will
- * result in <em>n</em> events being sent to that listener for every
- * property change. Adding a null listener may cause a NullPointerException
- * down the road. This method will unwrap a PropertyChangeListenerProxy,
- * registering the underlying delegate to the named property list.
- *
- * @param l the listener to add
- */
- public synchronized void addPropertyChangeListener(PropertyChangeListener l)
- {
- if (l instanceof PropertyChangeListenerProxy)
- {
- PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- addPropertyChangeListener(p.propertyName,
- (PropertyChangeListener) p.getListener());
- }
- else
- {
- if (listeners == null)
- listeners = new Vector();
- listeners.add(l);
- }
- }
-
- /**
- * Removes a PropertyChangeListener from the list of global listeners. If
- * any specific properties are being listened on, they must be deregistered
- * by themselves; this will only remove the general listener to all
- * properties. If <code>add()</code> has been called multiple times for a
- * particular listener, <code>remove()</code> will have to be called the
- * same number of times to deregister it. This method will unwrap a
- * PropertyChangeListenerProxy, removing the underlying delegate from the
- * named property list.
- *
- * @param l the listener to remove
- */
- public synchronized void
- removePropertyChangeListener(PropertyChangeListener l)
- {
- if (l instanceof PropertyChangeListenerProxy)
- {
- PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- removePropertyChangeListener(p.propertyName,
- (PropertyChangeListener) p.getListener());
- }
- else if (listeners != null)
- {
- listeners.remove(l);
- if (listeners.isEmpty())
- listeners = null;
- }
- }
-
- /**
- * Returns an array of all registered property change listeners. Those that
- * were registered under a name will be wrapped in a
- * <code>PropertyChangeListenerProxy</code>, so you must check whether the
- * listener is an instance of the proxy class in order to see what name the
- * real listener is registered under. If there are no registered listeners,
- * this returns an empty array.
- *
- * @return the array of registered listeners
- * @see PropertyChangeListenerProxy
- * @since 1.4
- */
- public synchronized PropertyChangeListener[] getPropertyChangeListeners()
- {
- ArrayList list = new ArrayList();
- if (listeners != null)
- list.addAll(listeners);
- if (children != null)
- {
- int i = children.size();
- Iterator iter = children.entrySet().iterator();
- while (--i >= 0)
- {
- Entry e = (Entry) iter.next();
- String name = (String) e.getKey();
- Vector v = ((PropertyChangeSupport) e.getValue()).listeners;
- int j = v.size();
- while (--j >= 0)
- list.add(new PropertyChangeListenerProxy
- (name, (PropertyChangeListener) v.get(j)));
- }
- }
- return (PropertyChangeListener[])
- list.toArray(new PropertyChangeListener[list.size()]);
- }
-
- /**
- * Adds a PropertyChangeListener listening on the specified property. Events
- * will be sent to the listener only if the property name matches. The
- * listener add is not unique; that is, <em>n</em> adds on a particular
- * property for a particular listener will result in <em>n</em> events
- * being sent to that listener when that property is changed. The effect is
- * cumulative, too; if you are registered to listen to receive events on
- * all property changes, and then you register on a particular property,
- * you will receive change events for that property twice. Adding a null
- * listener may cause a NullPointerException down the road. This method
- * will unwrap a PropertyChangeListenerProxy, registering the underlying
- * delegate to the named property list if the names match, and discarding
- * it otherwise.
- *
- * @param propertyName the name of the property to listen on
- * @param l the listener to add
- * @throws NullPointerException if propertyName is null
- */
- public synchronized void addPropertyChangeListener(String propertyName,
- PropertyChangeListener l)
- {
- while (l instanceof PropertyChangeListenerProxy)
- {
- PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- if (propertyName == null ? p.propertyName != null
- : ! propertyName.equals(p.propertyName))
- return;
- l = (PropertyChangeListener) p.getListener();
- }
- PropertyChangeSupport s = null;
- if (children == null)
- children = new Hashtable();
- else
- s = (PropertyChangeSupport) children.get(propertyName);
- if (s == null)
- {
- s = new PropertyChangeSupport(source);
- s.listeners = new Vector();
- children.put(propertyName, s);
- }
- s.listeners.add(l);
- }
-
- /**
- * Removes a PropertyChangeListener from listening to a specific property.
- * If <code>add()</code> has been called multiple times for a particular
- * listener on a property, <code>remove()</code> will have to be called the
- * same number of times to deregister it. This method will unwrap a
- * PropertyChangeListenerProxy, removing the underlying delegate from the
- * named property list if the names match.
- *
- * @param propertyName the property to stop listening on
- * @param l the listener to remove
- * @throws NullPointerException if propertyName is null
- */
- public synchronized void
- removePropertyChangeListener(String propertyName, PropertyChangeListener l)
- {
- if (children == null)
- return;
- PropertyChangeSupport s
- = (PropertyChangeSupport) children.get(propertyName);
- if (s == null)
- return;
- while (l instanceof PropertyChangeListenerProxy)
- {
- PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- if (propertyName == null ? p.propertyName != null
- : ! propertyName.equals(p.propertyName))
- return;
- l = (PropertyChangeListener) p.getListener();
- }
- s.listeners.remove(l);
- if (s.listeners.isEmpty())
- {
- children.remove(propertyName);
- if (children.isEmpty())
- children = null;
- }
- }
-
- /**
- * Returns an array of all property change listeners registered under the
- * given property name. If there are no registered listeners, this returns
- * an empty array.
- *
- * @return the array of registered listeners
- * @throws NullPointerException if propertyName is null
- * @since 1.4
- */
- public synchronized PropertyChangeListener[]
- getPropertyChangeListeners(String propertyName)
- {
- if (children == null)
- return new PropertyChangeListener[0];
- PropertyChangeSupport s
- = (PropertyChangeSupport) children.get(propertyName);
- if (s == null)
- return new PropertyChangeListener[0];
- return (PropertyChangeListener[])
- s.listeners.toArray(new PropertyChangeListener[s.listeners.size()]);
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are non-null
- * and equal.
- *
- * @param propertyName the name of the property that changed
- * @param oldVal the old value
- * @param newVal the new value
- */
- public void firePropertyChange(String propertyName,
- Object oldVal, Object newVal)
- {
- firePropertyChange(new PropertyChangeEvent(source, propertyName,
- oldVal, newVal));
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are equal.
- *
- * @param propertyName the name of the property that changed
- * @param oldVal the old value
- * @param newVal the new value
- */
- public void firePropertyChange(String propertyName, int oldVal, int newVal)
- {
- if (oldVal != newVal)
- firePropertyChange(new PropertyChangeEvent(source, propertyName,
- new Integer(oldVal),
- new Integer(newVal)));
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are equal.
- *
- * @param propertyName the name of the property that changed
- * @param oldVal the old value
- * @param newVal the new value
- */
- public void firePropertyChange(String propertyName,
- boolean oldVal, boolean newVal)
- {
- if (oldVal != newVal)
- firePropertyChange(new PropertyChangeEvent(source, propertyName,
- Boolean.valueOf(oldVal),
- Boolean.valueOf(newVal)));
- }
-
- /**
- * Fire a PropertyChangeEvent to all the global listeners, and to all the
- * listeners for the specified property name. This does nothing if old and
- * new values of the event are equal.
- *
- * @param event the event to fire
- * @throws NullPointerException if event is null
- */
- public void firePropertyChange(PropertyChangeEvent event)
- {
- if (event.oldValue != null && event.oldValue.equals(event.newValue))
- return;
- Vector v = listeners; // Be thread-safe.
- if (v != null)
- {
- int i = v.size();
- while (--i >= 0)
- ((PropertyChangeListener) v.get(i)).propertyChange(event);
- }
- Hashtable h = children; // Be thread-safe.
- if (h != null && event.propertyName != null)
- {
- PropertyChangeSupport s
- = (PropertyChangeSupport) h.get(event.propertyName);
- if (s != null)
- {
- v = s.listeners; // Be thread-safe.
- int i = v == null ? 0 : v.size();
- while (--i >= 0)
- ((PropertyChangeListener) v.get(i)).propertyChange(event);
- }
- }
- }
-
- /**
- * Tell whether the specified property is being listened on or not. This
- * will only return <code>true</code> if there are listeners on all
- * properties or if there is a listener specifically on this property.
- *
- * @param propertyName the property that may be listened on
- * @return whether the property is being listened on
- * @throws NullPointerException if propertyName is null
- */
- public synchronized boolean hasListeners(String propertyName)
- {
- return listeners != null || (children != null
- && children.get(propertyName) != null);
- }
-
- /**
- * Saves the state of the object to the stream.
- *
- * @param s the stream to write to
- * @throws IOException if anything goes wrong
- * @serialData this writes out a null-terminated list of serializable
- * global property change listeners (the listeners for a named
- * property are written out as the global listeners of the
- * children, when the children hashtable is saved)
- */
- private synchronized void writeObject(ObjectOutputStream s)
- throws IOException
- {
- s.defaultWriteObject();
- if (listeners != null)
- {
- int i = listeners.size();
- while (--i >= 0)
- if (listeners.get(i) instanceof Serializable)
- s.writeObject(listeners.get(i));
- }
- s.writeObject(null);
- }
-
- /**
- * Reads the object back from stream (deserialization).
- *
- * XXX Since serialization for 1.1 streams was not documented, this may
- * not work if propertyChangeSupportSerializedDataVersion is 1.
- *
- * @param s the stream to read from
- * @throws IOException if reading the stream fails
- * @throws ClassNotFoundException if deserialization fails
- * @serialData this reads in a null-terminated list of serializable
- * global property change listeners (the listeners for a named
- * property are written out as the global listeners of the
- * children, when the children hashtable is saved)
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- PropertyChangeListener l = (PropertyChangeListener) s.readObject();
- while (l != null)
- {
- addPropertyChangeListener(l);
- l = (PropertyChangeListener) s.readObject();
- }
- // Sun is not as careful with children as we are, and lets some proxys
- // in that can never receive events. So, we clean up anything that got
- // serialized, to make sure our invariants hold.
- if (children != null)
- {
- int i = children.size();
- Iterator iter = children.entrySet().iterator();
- while (--i >= 0)
- {
- Entry e = (Entry) iter.next();
- String name = (String) e.getKey();
- PropertyChangeSupport pcs = (PropertyChangeSupport) e.getValue();
- if (pcs.listeners == null)
- pcs.listeners = new Vector();
- if (pcs.children != null)
- pcs.listeners.addAll
- (Arrays.asList(pcs.getPropertyChangeListeners(name)));
- if (pcs.listeners.size() == 0)
- iter.remove();
- else
- pcs.children = null;
- }
- if (children.size() == 0)
- children = null;
- }
- }
-} // class PropertyChangeSupport
diff --git a/libjava/java/beans/PropertyDescriptor.java b/libjava/java/beans/PropertyDescriptor.java
deleted file mode 100644
index 416d468576f..00000000000
--- a/libjava/java/beans/PropertyDescriptor.java
+++ /dev/null
@@ -1,583 +0,0 @@
-/* java.beans.PropertyDescriptor
- Copyright (C) 1998, 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.lang.reflect.Method;
-
-/**
- ** PropertyDescriptor describes information about a JavaBean property,
- ** by which we mean a property that has been exposed via a pair of
- ** get and set methods. (There may be no get method, which means
- ** the property is write-only, or no set method, which means the
- ** the property is read-only.)<P>
- **
- ** The constraints put on get and set methods are:<P>
- ** <OL>
- ** <LI>A get method must have signature
- ** <CODE>&lt;propertyType&gt; &lt;getMethodName&gt;()</CODE></LI>
- ** <LI>A set method must have signature
- ** <CODE>void &lt;setMethodName&gt;(&lt;propertyType&gt;)</CODE></LI>
- ** <LI>Either method type may throw any exception.</LI>
- ** <LI>Both methods must be public.</LI>
- ** </OL>
- **
- ** @author John Keiser
- ** @author Robert Schuster (thebohemian@gmx.net)
- ** @since 1.1
- ** @status updated to 1.4
- **/
-
-public class PropertyDescriptor extends FeatureDescriptor
-{
- Class propertyType;
- Method getMethod;
- Method setMethod;
-
- Class propertyEditorClass;
- boolean bound;
- boolean constrained;
-
- PropertyDescriptor(String name)
- {
- setName(name);
- }
-
- /** Create a new PropertyDescriptor by introspection.
- ** This form of constructor creates the PropertyDescriptor by
- ** looking for a getter method named <CODE>get&lt;name&gt;()</CODE>
- ** (or, optionally, if the property is boolean,
- ** <CODE>is&lt;name&gt;()</CODE>) and
- ** <CODE>set&lt;name&gt;()</CODE> in class
- ** <CODE>&lt;beanClass&gt;</CODE>, where &lt;name&gt; has its
- ** first letter capitalized by the constructor.<P>
- **
- ** Note that using this constructor the given property must be read- <strong>and</strong>
- ** writeable. If the implementation does not both, a read and a write method, an
- ** <code>IntrospectionException</code> is thrown.
- **
- ** <B>Implementation note:</B> If there is both are both isXXX and
- ** getXXX methods, the former is used in preference to the latter.
- ** We do not check that an isXXX method returns a boolean. In both
- ** cases, this matches the behaviour of JDK 1.4<P>
- **
- ** @param name the programmatic name of the property, usually
- ** starting with a lowercase letter (e.g. fooManChu
- ** instead of FooManChu).
- ** @param beanClass the class the get and set methods live in.
- ** @exception IntrospectionException if the methods are not found
- ** or invalid.
- **/
- public PropertyDescriptor(String name, Class beanClass)
- throws IntrospectionException
- {
- setName(name);
- if (name.length() == 0)
- {
- throw new IntrospectionException("empty property name");
- }
- String caps = Character.toUpperCase(name.charAt(0)) + name.substring(1);
- findMethods(beanClass, "is" + caps, "get" + caps, "set" + caps);
-
- if (getMethod == null)
- {
- throw new IntrospectionException(
- "Cannot find a is" + caps + " or get" + caps + " method");
- }
-
- if (setMethod == null)
- {
- throw new IntrospectionException(
- "Cannot find a " + caps + " method");
- }
-
- // finally check the methods compatibility
- propertyType = checkMethods(getMethod, setMethod);
- }
-
- /** Create a new PropertyDescriptor by introspection.
- ** This form of constructor allows you to specify the
- ** names of the get and set methods to search for.<P>
- **
- ** <B>Implementation note:</B> If there is a get method (or
- ** boolean isXXX() method), then the return type of that method
- ** is used to find the set method. If there is no get method,
- ** then the set method is searched for exhaustively.<P>
- **
- ** <B>Spec note:</B>
- ** If there is no get method and multiple set methods with
- ** the same name and a single parameter (different type of course),
- ** then an IntrospectionException is thrown. While Sun's spec
- ** does not state this, it can make Bean behavior different on
- ** different systems (since method order is not guaranteed) and as
- ** such, can be treated as a bug in the spec. I am not aware of
- ** whether Sun's implementation catches this.
- **
- ** @param name the programmatic name of the property, usually
- ** starting with a lowercase letter (e.g. fooManChu
- ** instead of FooManChu).
- ** @param beanClass the class the get and set methods live in.
- ** @param getMethodName the name of the get method or <code>null</code> if the property is write-only.
- ** @param setMethodName the name of the set method or <code>null</code> if the property is read-only.
- ** @exception IntrospectionException if the methods are not found
- ** or invalid.
- **/
- public PropertyDescriptor(
- String name,
- Class beanClass,
- String getMethodName,
- String setMethodName)
- throws IntrospectionException
- {
- setName(name);
- findMethods(beanClass, getMethodName, null, setMethodName);
-
- if (getMethod == null && getMethodName != null)
- {
- throw new IntrospectionException(
- "Cannot find a getter method called " + getMethodName);
- }
-
- if (setMethod == null && setMethodName != null)
- {
- throw new IntrospectionException(
- "Cannot find a setter method called " + setMethodName);
- }
-
- propertyType = checkMethods(getMethod, setMethod);
- }
-
- /** Create a new PropertyDescriptor using explicit Methods.
- ** Note that the methods will be checked for conformance to standard
- ** Property method rules, as described above at the top of this class.
- **<br>
- ** It is possible to call this method with both <code>Method</code> arguments
- ** being <code>null</code>. In such a case the property type is <code>null</code>.
- **
- ** @param name the programmatic name of the property, usually
- ** starting with a lowercase letter (e.g. fooManChu
- ** instead of FooManChu).
- ** @param readMethod the read method or <code>null</code> if the property is write-only.
- ** @param writeMethod the write method or <code>null</code> if the property is read-only.
- ** @exception IntrospectionException if the methods are not found
- ** or invalid.
- **/
- public PropertyDescriptor(
- String name,
- Method readMethod,
- Method writeMethod)
- throws IntrospectionException
- {
- setName(name);
- getMethod = readMethod;
- setMethod = writeMethod;
- propertyType = checkMethods(getMethod, setMethod);
- }
-
- /** Get the property type.
- ** This is the type the get method returns and the set method
- ** takes in.
- **/
- public Class getPropertyType()
- {
- return propertyType;
- }
-
- /** Get the get method. Why they call it readMethod here and
- ** get everywhere else is beyond me.
- **/
- public Method getReadMethod()
- {
- return getMethod;
- }
-
- /** Sets the read method.<br/>
- * The read method is used to retrieve the value of a property. A legal
- * read method must have no arguments. Its return type must not be
- * <code>void</code>. If this methods succeeds the property type
- * is adjusted to the return type of the read method.<br/>
- * <br/>
- * It is legal to set the read and the write method to <code>null</code>
- * or provide method which have been declared in distinct classes.
- *
- * @param readMethod The new method to be used or <code>null</code>.
- * @throws IntrospectionException If the given method is invalid.
- * @since 1.2
- */
- public void setReadMethod(Method readMethod) throws IntrospectionException
- {
- propertyType = checkMethods(readMethod, setMethod);
-
- getMethod = readMethod;
- }
-
- /** Get the set method. Why they call it writeMethod here and
- ** set everywhere else is beyond me.
- **/
- public Method getWriteMethod()
- {
- return setMethod;
- }
-
- /** Sets the write method.<br/>
- * The write method is used to set the value of a property. A legal write method
- * must have a single argument which can be assigned to the property. If no
- * read method exists the property type changes to the argument type of the
- * write method.<br/>
- * <br/>
- * It is legal to set the read and the write method to <code>null</code>
- * or provide method which have been declared in distinct classes.
- *
- * @param writeMethod The new method to be used or <code>null</code>.
- * @throws IntrospectionException If the given method is invalid.
- * @since 1.2
- */
- public void setWriteMethod(Method writeMethod)
- throws IntrospectionException
- {
- propertyType = checkMethods(getMethod, writeMethod);
-
- setMethod = writeMethod;
- }
-
- /** Get whether the property is bound. Defaults to false. **/
- public boolean isBound()
- {
- return bound;
- }
-
- /** Set whether the property is bound.
- ** As long as the the bean implements addPropertyChangeListener() and
- ** removePropertyChangeListener(), setBound(true) may safely be called.<P>
- ** If these things are not true, then the behavior of the system
- ** will be undefined.<P>
- **
- ** When a property is bound, its set method is required to fire the
- ** <CODE>PropertyChangeListener.propertyChange())</CODE> event
- ** after the value has changed.
- ** @param bound whether the property is bound or not.
- **/
- public void setBound(boolean bound)
- {
- this.bound = bound;
- }
-
- /** Get whether the property is constrained. Defaults to false. **/
- public boolean isConstrained()
- {
- return constrained;
- }
-
- /** Set whether the property is constrained.
- ** If the set method throws <CODE>java.beans.PropertyVetoException</CODE>
- ** (or subclass thereof) and the bean implements addVetoableChangeListener()
- ** and removeVetoableChangeListener(), then setConstrained(true) may safely
- ** be called. Otherwise, the system behavior is undefined.
- ** <B>Spec note:</B> given those strict parameters, it would be nice if it
- ** got set automatically by detection, but oh well.<P>
- ** When a property is constrained, its set method is required to:<P>
- ** <OL>
- ** <LI>Fire the <CODE>VetoableChangeListener.vetoableChange()</CODE>
- ** event notifying others of the change and allowing them a chance to
- ** say it is a bad thing.</LI>
- ** <LI>If any of the listeners throws a PropertyVetoException, then
- ** it must fire another vetoableChange() event notifying the others
- ** of a reversion to the old value (though, of course, the change
- ** was never made). Then it rethrows the PropertyVetoException and
- ** exits.</LI>
- ** <LI>If all has gone well to this point, the value may be changed.</LI>
- ** </OL>
- ** @param constrained whether the property is constrained or not.
- **/
- public void setConstrained(boolean constrained)
- {
- this.constrained = constrained;
- }
-
- /** Get the PropertyEditor class. Defaults to null. **/
- public Class getPropertyEditorClass()
- {
- return propertyEditorClass;
- }
-
- /** Set the PropertyEditor class. If the class does not implement
- ** the PropertyEditor interface, you will likely get an exception
- ** late in the game.
- ** @param propertyEditorClass the PropertyEditor class for this
- ** class to use.
- **/
- public void setPropertyEditorClass(Class propertyEditorClass)
- {
- this.propertyEditorClass = propertyEditorClass;
- }
-
- private void findMethods(
- Class beanClass,
- String getMethodName1,
- String getMethodName2,
- String setMethodName)
- throws IntrospectionException
- {
- try
- {
- // Try the first get method name
- if (getMethodName1 != null)
- {
- try
- {
- getMethod =
- beanClass.getMethod(getMethodName1, new Class[0]);
- }
- catch (NoSuchMethodException e)
- {}
- }
-
- // Fall back to the second get method name
- if (getMethod == null && getMethodName2 != null)
- {
- try
- {
- getMethod =
- beanClass.getMethod(getMethodName2, new Class[0]);
- }
- catch (NoSuchMethodException e)
- {}
- }
-
- // Try the set method name
- if (setMethodName != null)
- {
- if (getMethod != null)
- {
- // If there is a get method, use its return type to help
- // select the corresponding set method.
- Class propertyType = getMethod.getReturnType();
- if (propertyType == Void.TYPE)
- {
- String msg =
- "The property's read method has return type 'void'";
- throw new IntrospectionException(msg);
- }
-
- Class[] setArgs = new Class[] { propertyType };
- try
- {
- setMethod = beanClass.getMethod(setMethodName, setArgs);
- }
- catch (NoSuchMethodException e)
- {}
- }
- else if (getMethodName1 == null && getMethodName2 == null)
- {
- // If this is a write-only property, choose the first set method
- // with the required name, one parameter and return type 'void'
- Method[] methods = beanClass.getMethods();
- for (int i = 0; i < methods.length; i++)
- {
- if (methods[i].getName().equals(setMethodName)
- && methods[i].getParameterTypes().length == 1
- && methods[i].getReturnType() == Void.TYPE)
- {
- setMethod = methods[i];
- break;
- }
- }
- }
- }
- }
- catch (SecurityException e)
- {
- // FIXME -- shouldn't we just allow SecurityException to propagate?
- String msg =
- "SecurityException thrown on attempt to access methods.";
- throw new IntrospectionException(msg);
- }
- }
-
- /** Checks whether the given <code>Method</code> instances are legal read and
- * write methods. The following requirements must be met:<br/>
- * <ul>
- * <li>the read method must not have an argument</li>
- * <li>the read method must have a non void return type</li>
- * <li>the read method may not exist</li>
- * <li>the write method must have a single argument</li>
- * <li>the property type and the read method's return type must be assignable from the
- * write method's argument type</li>
- * <li>the write method may not exist</li>
- * </ul>
- * While checking the methods a common new property type is calculated. If the method
- * succeeds this property type is returned.<br/>
- * <br/>
- * For compatibility this has to be noted:<br/>
- * The two methods are allowed to be defined in two distinct classes and may both be null.
- *
- * @param readMethod The new read method to check.
- * @param writeMethod The new write method to check.
- * @return The common property type of the two method.
- * @throws IntrospectionException If any of the above requirements are not met.
- */
- private Class checkMethods(Method readMethod, Method writeMethod)
- throws IntrospectionException
- {
- Class newPropertyType = propertyType;
-
- // a valid read method has zero arguments and a non-void return type.
- if (readMethod != null)
- {
- if (readMethod.getParameterTypes().length > 0)
- {
- throw new IntrospectionException("read method has unexpected parameters");
- }
-
- newPropertyType = readMethod.getReturnType();
-
- if (newPropertyType == Void.TYPE)
- {
- throw new IntrospectionException("read method return type is void");
- }
- }
-
- // a valid write method has one argument which can be assigned to the property
- if (writeMethod != null)
- {
- if (writeMethod.getParameterTypes().length != 1)
- {
- String msg = "write method does not have exactly one parameter";
- throw new IntrospectionException(msg);
- }
-
- if (readMethod == null)
- {
- // changes the property type if there is no read method
- newPropertyType = writeMethod.getParameterTypes()[0];
- }
- else
- {
- // checks whether the write method can be assigned to the return type of the read
- // method (if this is not the case, the methods are not compatible)
- // note: newPropertyType may be null if no methods or method names have been
- // delivered in the constructor.
- if (newPropertyType != null
- && !newPropertyType.isAssignableFrom(
- writeMethod.getParameterTypes()[0]))
- {
- // note: newPropertyType is the same as readMethod.getReturnType() at this point
- throw new IntrospectionException("read and write method are not compatible");
- }
-
- /* note: the check whether both method are defined in related classes makes sense but is not
- * done in the JDK.
- * I leave this code here in case someone at Sun decides to add that functionality in later versions (rschuster)
- if ((!readMethod
- .getDeclaringClass()
- .isAssignableFrom(writeMethod.getDeclaringClass()))
- && (!writeMethod
- .getDeclaringClass()
- .isAssignableFrom(readMethod.getDeclaringClass())))
- {
- String msg =
- "set and get methods are not in the same class.";
- throw new IntrospectionException(msg);
- }
- */
-
- }
- }
-
- return newPropertyType;
- }
-
- /** Compares this <code>PropertyDescriptor</code> against the
- * given object.
- * Two PropertyDescriptors are equals if
- * <ul>
- * <li>the read methods are equal</li>
- * <li>the write methods are equal</li>
- * <li>the property types are equals</li>
- * <li>the property editor classes are equal</li>
- * <li>the flags (constrained and bound) are equal</li>
- * </ul>
- * @return Whether both objects are equal according to the rules given above.
- * @since 1.4
- */
- public boolean equals(Object o)
- {
- if (o instanceof PropertyDescriptor)
- {
- PropertyDescriptor that = (PropertyDescriptor) o;
-
- // compares the property types and checks the case where both are null
- boolean samePropertyType =
- (propertyType == null)
- ? that.propertyType == null
- : propertyType.equals(that.propertyType);
-
- // compares the property editor classes and checks the case where both are null
- boolean samePropertyEditorClass =
- (propertyEditorClass == null)
- ? that.propertyEditorClass == null
- : propertyEditorClass.equals(that.propertyEditorClass);
-
- // compares the flags for equality
- boolean sameFlags =
- bound == that.bound && constrained == that.constrained;
-
- // compares the read methods and checks the case where both are null
- boolean sameReadMethod =
- (getMethod == null)
- ? that.getMethod == null
- : getMethod.equals(that.getMethod);
-
- boolean sameWriteMethod =
- (setMethod == null)
- ? that.setMethod == null
- : setMethod.equals(that.setMethod);
-
- return samePropertyType
- && sameFlags
- && sameReadMethod
- && sameWriteMethod
- && samePropertyEditorClass;
- }
- else
- {
- return false;
- }
-
- }
-
-}
diff --git a/libjava/java/beans/PropertyEditor.java b/libjava/java/beans/PropertyEditor.java
deleted file mode 100644
index d1c5103419f..00000000000
--- a/libjava/java/beans/PropertyEditor.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/* java.beans.PropertyEditor
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/**
- ** PropertyEditors are custom GUI editors for specific types of values.
- **
- ** A PropertyEditor can be used, for example, if you are editing a type of value
- ** that can be more easily represented graphically, such as a Point, or one that
- ** can be more easily represented by a list, such as a boolean (true/false).<P>
- **
- ** A PropertyEditor must be able to display its contents when asked to and
- ** be able to allow the user to change its underlying field value. However, it
- ** is not the PropertyEditor's responsibility to make the change to the
- ** underlying Object; in fact, the PropertyEditor does not even know about the
- ** Object it is actually editing--only about the property it is currently
- ** editing. When a change is made to the property, the PropertyEditor must
- ** simply fire a PropertyChangeEvent and allow the RAD tool to actually set
- ** the property in the underlying Bean.<P>
- **
- ** PropertyEditors should not change the Objects they are given by setValue().
- ** These Objects may or may not be the actual Objects which are properties of
- ** the Bean being edited. Instead, PropertyEditors should create a new Object
- ** and fire a PropertyChangeEvent with the old and new values.<P>
- **
- ** PropertyEditors also must support the ability to return a Java
- ** initialization string. See the getJavaInitializationString() method for
- ** details.<P>
- **
- ** There are several different ways a PropertyEditor may display and control
- ** editing of its value. When multiple types of input and display are
- ** given by a single PropertyEditor, the RAD tool may decide which of the call
- ** to support. Some RAD tools may even be text-only, so even if you support
- ** a graphical set and get, it may choose the text set and get whenever it can.
- ** <OL>
- ** <LI>Every PropertyEditor must support getValue() and setValue(). For
- ** setValue(), the component must only support it when the argument is
- ** the same type that the PropertyEditor supports.</LI>
- ** <LI>Every PropertyEditor must support getJavaInitializationString().</LI>
- ** <LI>You may support painting the value yourself if you wish. To do this,
- ** have isPaintable() return true and implement the paintValue() method.
- ** This method does not determine in any way how the value is edited;
- ** merely how it is displayed.</LI>
- ** <LI>Let the caller of the PropertyEditor give the user a text input. Do
- ** this by returning a non-null String from getAsText(). If you support
- ** text input, you *must* support setAsText().</LI>
- ** <LI>Give the caller a set of possible values, such as "true"/"false", that
- ** the user must select from. To do this, return the list of Strings
- ** from the getTags() method. The RAD tool may choose to implement the
- ** user input any way it wishes, and only guarantees that setAsText() will
- ** only be called with one of the Strings returned from getTags().</LI>
- ** <LI>You may support a whole custom editing control by supporting
- ** getCustomEditor(). To do this, return true from supportsCustomEditor()
- ** and return a Component that does the job. It is the component's job,
- ** or the PropertyEditor's job, to make sure that when the editor changes
- ** its value, the PropertyChangeEvent is thrown.</LI>
- ** </OL>
- **
- ** The PropertyEditor for a particular Bean can be found using the
- ** PropertyEditorManager class, which goes through a series of different
- ** checks to find the appropriate class.<P>
- **
- ** A PropertyChangeEvent should be thrown from the PropertyEditor whenever a
- ** bound property (a property PropertyDescriptor.isBound() set to true)
- ** changes. When this happens, the editor itself should *not* change the value
- ** itself, but rather allow the RAD tool to call setValue() or setAsText().
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 30 June 1998
- ** @see java.beans.PropertyEditorManager
- ** @see java.beans.PropertyEditorSupport
- **/
-
-public interface PropertyEditor {
- /** Called by the RAD tool to set the value of this property for the PropertyEditor.
- ** If the property type is native, it should be wrapped in the appropriate
- ** wrapper type.
- ** @param value the value to set this property to.
- **/
- void setValue(Object value);
-
- /** Accessor method to get the current value the PropertyEditor is working with.
- ** If the property type is native, it will be wrapped in the appropriate
- ** wrapper type.
- ** @return the current value of the PropertyEditor.
- **/
- Object getValue();
-
-
- /** Set the value of this property using a String.
- ** Whether or not this PropertyEditor is editing a String type, this converts
- ** the String into the type of the PropertyEditor.
- ** @param text the text to set it to.
- ** @exception IllegalArgumentException if the String is in the wrong format or setAsText() is not supported.
- **/
- void setAsText(String text) throws IllegalArgumentException;
-
- /** Get the value of this property in String format.
- ** Many times this can simply use Object.toString().<P>
- ** Return null if you do not support getAsText()/setAsText().
- ** <code>setAsText(getAsText())</code> should be valid; i.e. the stuff you spit out in
- ** getAsText() should be able to go into setAsText().
- ** @return the value of this property in String format.
- **/
- String getAsText();
-
- /** Get a list of possible Strings which this property type can have.
- ** The value of these will be used by the RAD tool to construct some sort
- ** of list box or to check text box input, and the resulting String passed
- ** to setAsText() should be one of these. Note, however, that like most things
- ** with this mammoth, unwieldy interface, this is not guaranteed. Thus, you
- ** must check the value in setAsText() anyway.
- ** @return the list of possible String values for this property type.
- **/
- String[] getTags();
-
-
- /** The RAD tool calls this to find out whether the PropertyEditor can paint itself.
- ** @return true if it can paint itself graphically, false if it cannot.
- **/
- boolean isPaintable();
-
- /** The RAD tool calls this to paint the actual value of the property.
- ** The Graphics context will have the same current font, color, etc. as the
- ** parent Container. You may safely change the font, color, etc. and not
- ** change them back.<P>
- ** This method should do a silent no-op if isPaintable() is false.
- ** @param g the Graphics context to paint on
- ** @param bounds the rectangle you have reserved to work in
- **/
- void paintValue(java.awt.Graphics g, java.awt.Rectangle bounds);
-
-
- /** The RAD tool calls this to find out whether the PropertyEditor supports a custom component to edit and display itself.
- ** @return true if getCustomEditor() will return a component, false if not.
- **/
- boolean supportsCustomEditor();
-
- /** The RAD tool calls this to grab the component that can edit this type.
- ** The component may be painted anywhere the RAD tool wants to paint it--
- ** even in its own window.<P>
- ** The component must hook up with the PropertyEditor and, whenever a
- ** change to the value is made, fire a PropertyChangeEvent to the source.<P>
- ** @return the custom editor for this property type.
- **/
- java.awt.Component getCustomEditor();
-
-
- /** Adds a property change listener to this PropertyEditor.
- ** @param listener the listener to add
- **/
- void addPropertyChangeListener(PropertyChangeListener listener);
-
- /** Removes a property change listener from this PropertyEditor.
- ** @param listener the listener to remove
- **/
- void removePropertyChangeListener(PropertyChangeListener listener);
-
- /** Get a Java language-specific String which could be used to create an Object
- ** of the specified type. Every PropertyEditor must support this.<P>
- ** The reason for this is that while most RAD tools will serialize the Beans
- ** and deserialize them at runtime, some RAD tools will generate code that
- ** creates the Beans. Examples of Java initialization strings would be:<P>
- ** <OL>
- ** <LI><CODE>2</CODE></LI>
- ** <LI><CODE>"I am a String"</CODE></LI>
- ** <LI><CODE>new MyObject(2, "String", new StringBuffer())</CODE></LI>
- ** </OL>
- ** @return the initialization string for this object in Java.
- **/
- String getJavaInitializationString();
-}
diff --git a/libjava/java/beans/PropertyEditorManager.java b/libjava/java/beans/PropertyEditorManager.java
deleted file mode 100644
index da2a5678c5c..00000000000
--- a/libjava/java/beans/PropertyEditorManager.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/* java.beans.PropertyEditorManager
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import gnu.java.beans.editors.ColorEditor;
-import gnu.java.beans.editors.FontEditor;
-import gnu.java.beans.editors.NativeBooleanEditor;
-import gnu.java.beans.editors.NativeByteEditor;
-import gnu.java.beans.editors.NativeDoubleEditor;
-import gnu.java.beans.editors.NativeFloatEditor;
-import gnu.java.beans.editors.NativeIntEditor;
-import gnu.java.beans.editors.NativeLongEditor;
-import gnu.java.beans.editors.NativeShortEditor;
-import gnu.java.beans.editors.StringEditor;
-import gnu.java.lang.ClassHelper;
-
-import java.awt.Color;
-import java.awt.Font;
-
-/**
- * PropertyEditorManager is used to find property editors
- * for various types (not necessarily Beans).<P>
- *
- * It first checks to see if the property editor is
- * already registered; if it is, that property editor is
- * used. Next it takes the type's classname and appends
- * "Editor" to it, and searches first in the class's
- * package and then in the property editor search path.
- *
- * <p>Default property editors are provided for:</p>
- *
- * <ol>
- * <li>boolean, byte, short, int, long, float, and double</li>
- * <li>java.lang.String</li>
- * <li>java.awt.Color</li>
- * <li>java.awt.Font</li>
- * </ol>
- *
- * <p><strong>Spec Suggestion:</strong> Perhaps an editor for
- * Filename or something like it should be provided. As well
- * as char.</p>
- *
- * @author John Keiser
- * @since 1.1
- * @version 1.1.0, 29 Jul 1998
- */
-
-public class PropertyEditorManager
-{
- static java.util.Hashtable editors = new java.util.Hashtable();
- static String[] editorSearchPath = { "gnu.java.beans.editors",
- "sun.beans.editors" };
-
- static
- {
- registerEditor(Boolean.TYPE, NativeBooleanEditor.class);
- registerEditor(Byte.TYPE, NativeByteEditor.class);
- registerEditor(Short.TYPE, NativeShortEditor.class);
- registerEditor(Integer.TYPE, NativeIntEditor.class);
- registerEditor(Long.TYPE, NativeLongEditor.class);
- registerEditor(Float.TYPE, NativeFloatEditor.class);
- registerEditor(Double.TYPE, NativeDoubleEditor.class);
- registerEditor(String.class, StringEditor.class);
- registerEditor(Color.class, ColorEditor.class);
- registerEditor(Font.class, FontEditor.class);
- }
-
- /**
- * Beats me why this class can be instantiated, but there
- * you have it.
- */
- public PropertyEditorManager()
- {
- // Do nothing here
- }
-
- /**
- * Register an editor for a class. Replaces old editor
- * if there was one registered before.
- *
- * @param editedClass the class that the property editor
- * will edit.
- * @param editorClass the PropertyEditor class.
- */
- public static void registerEditor(Class editedClass, Class editorClass)
- {
- editors.put(editedClass, editorClass);
- }
-
- /**
- * Returns a new instance of the property editor for the
- * specified class.
- *
- * @param editedClass the class that the property editor
- * will edit.
- * @return a PropertyEditor instance that can edit the
- * specified class.
- */
- public static PropertyEditor findEditor(Class editedClass)
- {
- try
- {
- Class found = (Class)editors.get(editedClass);
- if(found != null)
- {
- return (PropertyEditor)found.newInstance();
- }
-
- ClassLoader contextClassLoader
- = Thread.currentThread().getContextClassLoader();
-
- try
- {
- found = Class.forName(editedClass.getName()+"Editor", true,
- contextClassLoader);
- registerEditor(editedClass,found);
- return (PropertyEditor)found.newInstance();
- }
- catch(ClassNotFoundException E)
- {
- }
-
- String appendName
- = "."
- + ClassHelper.getTruncatedClassName(editedClass)
- + "Editor";
- synchronized(editorSearchPath)
- {
- for(int i=0;i<editorSearchPath.length;i++)
- {
- try
- {
- found = Class.forName(editorSearchPath[i] + appendName,
- true, contextClassLoader);
- registerEditor(editedClass,found);
- return (PropertyEditor)found.newInstance();
- }
- catch(ClassNotFoundException E)
- {
- }
- }
- }
- }
- catch(InstantiationException E)
- {
- }
- catch(IllegalAccessException E)
- {
- }
-
- return null;
- }
-
- /**
- * Get the editor search path.
- * As a minor departure from the spec, the default value
- * for the editor search path is "gnu.java.beans.editors",
- * "sun.beans.editors".
- *
- * @return the editor search path.
- */
- public static String[] getEditorSearchPath()
- {
- return editorSearchPath;
- }
-
- /**
- * Set the editor search path.
- *
- * @param editorSearchPath the new value for the editor search path.
- */
- public static void setEditorSearchPath(String[] editorSearchPath)
- {
- synchronized(editorSearchPath)
- {
- PropertyEditorManager.editorSearchPath = editorSearchPath;
- }
- }
-}
diff --git a/libjava/java/beans/PropertyEditorSupport.java b/libjava/java/beans/PropertyEditorSupport.java
deleted file mode 100644
index bb68e0e3145..00000000000
--- a/libjava/java/beans/PropertyEditorSupport.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/* java.beans.PropertyEditorSupport
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-
-/**
- * PropertyEditorSupport helps with PropertyEditors,
- * implementing base functionality that they usually must
- * have but which is a pain to implement. You may extend
- * from this class or use it as a standalone.<P>
- *
- * This class does not do any painting or actual editing.
- * For that, you must use or extend it. See the
- * PropertyEditor class for better descriptions of what
- * the various methods do.
- *
- * @author John Keiser
- * @author Robert Schuster
- * @since 1.1
- * @status updated to 1.5
- */
-public class PropertyEditorSupport implements PropertyEditor
-{
- Object eventSource;
- Object value;
- PropertyChangeSupport pSupport;
-
- /** Call this constructor when you are deriving from
- * PropertyEditorSupport.
- *
- * Using this constructor the event source is this PropertyEditorSupport
- * instance itself.
- *
- * @since 1.5
- * @specnote this was <code>protected</code> prior to 1.5
- */
- public PropertyEditorSupport()
- {
- eventSource = this;
- pSupport = new PropertyChangeSupport(this);
- }
-
- /** Call this constructor when you are using
- * PropertyEditorSupport as a helper object.
- *
- * This constructor throws a NullPointerException when <code>source</code> is <code>null</code>,
- * for compatibility reasons with J2SDK 1.5.0 .
- *
- * @param source The source to use when firing
- * property change events.
- * @since 1.5
- * @specnote this was <code>protected</code> prior to 1.5
- */
- public PropertyEditorSupport(Object source)
- {
- // note: constructor rejects source being null for the sake of compatibility
- // with official 1.5.0 implementation
- if (source == null)
- throw new NullPointerException("Event source must not be null.");
-
- eventSource = source;
- pSupport = new PropertyChangeSupport(eventSource);
- }
-
- /** Sets the current value of the property and a property change
- * event is fired to all registered PropertyChangeListener instances.
- *
- * @param newValue The new value for the property.
- */
- public void setValue(Object newValue)
- {
- value = newValue;
-
- // specification in java.beans.PropertyChangeEvent says
- // that without a property name (first argument) the
- // new and the old value should always be null
- pSupport.firePropertyChange(null, null, null);
- }
-
- /** Gets the current value of the property.
- *
- * @return the current value of the property.
- */
- public Object getValue()
- {
- return value;
- }
-
- /** Gets whether this object is paintable or not.
- *
- * @return <CODE>false</CODE>
- */
- public boolean isPaintable()
- {
- return false;
- }
-
- /** Paints this object. This class does nothing in
- * this method.
- */
- public void paintValue(java.awt.Graphics g, java.awt.Rectangle r)
- {
- }
-
- /** Gets the Java initialization String for the current
- * value of the Object. This class returns gibberish or
- * null (though the spec does not say which).<P>
- * <STRONG>Implementation Note:</STRONG> This class
- * returns the string "@$#^" to make sure the code will
- * be broken, so that you will know to override it when
- * you create your own property editor.
- *
- * @return the Java initialization string.
- */
- public String getJavaInitializationString()
- {
- return "@$#^";
- }
-
- /** Gets the value as text.
- * In this class, you cannot count on getAsText() doing
- * anything useful, although in this implementation I
- * do toString().
- *
- * @return the value as text.
- */
- public String getAsText()
- {
- return value != null ? value.toString() : "null";
- }
-
- /** Sets the value as text.
- * In this class, you cannot count on setAsText() doing
- * anything useful across implementations.
- * <STRONG>Implementation Note:</STRONG> In this
- * implementation it checks if the String is "null", and
- * if it is, sets the value to null, otherwise it throws
- * an IllegalArgumentException.
- *
- * @param s the text to convert to a new value.
- * @exception IllegalArgumentException if the text is
- * malformed.
- */
- public void setAsText(String s) throws IllegalArgumentException
- {
- if (s.equals("null"))
- setValue(null);
- else
- throw new IllegalArgumentException();
- }
-
- /** Returns a list of possible choices for the value.
- *
- * @return <CODE>null</CODE>
- */
- public String[] getTags()
- {
- return null;
- }
-
- /** Returns a custom component to edit the value.
- *
- * @return <CODE>null</CODE> in this class.
- */
- public java.awt.Component getCustomEditor()
- {
- return null;
- }
-
- /** Finds out whether this property editor supports a
- * custom component to edit its value.
- *
- * @return <CODE>false</CODE> in this class.
- */
- public boolean supportsCustomEditor()
- {
- return false;
- }
-
- /** Adds a property change listener to this property editor.
- *
- * @param l the listener to add.
- */
- public void addPropertyChangeListener(PropertyChangeListener l)
- {
- pSupport.addPropertyChangeListener(l);
- }
-
- /** Removes a property change listener from this property editor.
- *
- * @param l the listener to remove.
- */
- public void removePropertyChangeListener(PropertyChangeListener l)
- {
- pSupport.removePropertyChangeListener(l);
- }
-
- /** Notifies people that we've changed, although we don't
- * tell them just how.
- */
- public void firePropertyChange()
- {
- pSupport.firePropertyChange(null, null, null);
- }
-
- /** Returns the bean that is used as the source of events.
- *
- * @return The event source object
- * @since 1.5
- */
- public Object getSource()
- {
- return eventSource;
- }
-
- /** Sets the bean that is used as the source of events
- * when property changes occur.
- *
- * The event source bean is for informational purposes only
- * and should not be changed by the <code>PropertyEditor</code>.
- *
- * @param source
- * @since 1.5
- */
- public void setSource(Object source)
- {
- eventSource = source;
- }
-}
diff --git a/libjava/java/beans/PropertyVetoException.java b/libjava/java/beans/PropertyVetoException.java
deleted file mode 100644
index 1f0399b4bfb..00000000000
--- a/libjava/java/beans/PropertyVetoException.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* PropertyVetoException.java -- thrown to veto a proposed property change
- Copyright (C) 1998, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/**
- * PropertyVetoException is thrown when a VetoableChangeListener doesn't
- * like the proposed change.
- *
- * @author John Keiser
- * @see VetoableChangeListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class PropertyVetoException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 129596057694162164L;
-
- /**
- * The vetoed change.
- *
- * @serial the event that was vetoed
- */
- private final PropertyChangeEvent evt;
-
- /**
- * Instantiate this exception with the given message and property change.
- *
- * @param msg the reason for the veto
- * @param changeEvent the PropertyChangeEvent that was thrown
- */
- public PropertyVetoException(String msg, PropertyChangeEvent changeEvent)
- {
- super(msg);
- evt = changeEvent;
- }
-
- /**
- * Get the PropertyChange event that was vetoed.
- *
- * @return the vetoed change
- */
- public PropertyChangeEvent getPropertyChangeEvent()
- {
- return evt;
- }
-}
diff --git a/libjava/java/beans/SimpleBeanInfo.java b/libjava/java/beans/SimpleBeanInfo.java
deleted file mode 100644
index cfb96048498..00000000000
--- a/libjava/java/beans/SimpleBeanInfo.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/* java.beans.SimpleBeanInfo
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.awt.Image;
-import java.awt.Toolkit;
-
-/**
- ** SimpleBeanInfo is a class you may extend to more easily
- ** provide select information to the Introspector. It
- ** implements all of the methods in BeanInfo by returning
- ** null and forces the Introspector to behave exactly as
- ** if there were no BeanInfo class at all (Introspecting
- ** everything).<P>
- **
- ** Overriding one or two of these functions
- ** to give explicit information on only those things you
- ** wish to give explicit information is perfectly safe,
- ** and even desirable.<P>
- **
- ** See the BeanInfo class for information on what the
- ** various methods actually do.
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 29 Jul 1998
- ** @see java.beans.BeanInfo
- **/
-
-public class SimpleBeanInfo implements BeanInfo {
- /** Force Introspection of the general bean info.
- ** @return <CODE>null</CODE>.
- **/
- public BeanDescriptor getBeanDescriptor() {
- return null;
- }
-
- /** Force Introspection of the events this Bean type
- ** fires.
- ** @return <CODE>null</CODE>
- **/
- public EventSetDescriptor[] getEventSetDescriptors() {
- return null;
- }
-
- /** Say that there is no "default" event set.
- ** @return <CODE>-1</CODE>.
- **/
- public int getDefaultEventIndex() {
- return -1;
- }
-
- /** Force Introspection of the Bean properties.
- ** @return <CODE>null</CODE>.
- **/
- public PropertyDescriptor[] getPropertyDescriptors() {
- return null;
- }
-
- /** Say that there is no "default" property.
- ** @return <CODE>-1</CODE>.
- **/
- public int getDefaultPropertyIndex() {
- return -1;
- }
-
- /** Force Introspection of the Bean's methods.
- ** @return <CODE>null</CODE>.
- **/
- public MethodDescriptor[] getMethodDescriptors() {
- return null;
- }
-
- /** Tell the Introspector to go look for other BeanInfo
- ** itself.
- ** @return <CODE>null</CODE>.
- **/
- public BeanInfo[] getAdditionalBeanInfo() {
- return null;
- }
-
- /** Say that this Bean has no icons.
- ** @param iconType the type of icon
- ** @return <CODE>null</CODE>.
- **/
- public Image getIcon(int iconType) {
- return null;
- }
-
- /** Helper method to load an image using the Bean class
- ** getResource() method on the BeanInfo class (using
- ** getClass(), since you'll extend this class to get
- ** the BeanInfo). Basically it's assumed that the Bean
- ** and its BeanInfo are both loaded by the same
- ** ClassLoader, generally a reasonable assumption.
- ** @param location the URL relative
- ** @return the Image in question.
- **/
- public Image loadImage(String location) {
- return Toolkit.getDefaultToolkit().getImage(getClass().getResource(location));
- }
-}
-
diff --git a/libjava/java/beans/Statement.java b/libjava/java/beans/Statement.java
deleted file mode 100644
index 01f86dd286f..00000000000
--- a/libjava/java/beans/Statement.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/* java.beans.Statement
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-
-/**
- * class Statement
- *
- * A Statement captures the execution of an object method. It stores
- * the object, the method to call, and the arguments to the method and
- * provides the ability to execute the method on the object, using the
- * provided arguments.
- *
- * @since 1.4
- */
-public class Statement
-{
- private Object target;
- private String methodName;
- private Object[] arguments;
-
- // One or the other of these will get a value after execute is
- // called once, but not both.
- private transient Method method;
- private transient Constructor ctor;
-
- /**
- * Constructs a statement representing the invocation of
- * object.methodName(arg[0], arg[1], ...);
- *
- * @param target The object to invoke the method on.
- * @param methodName The object method to invoke.
- * @param arguments An array of arguments to pass to the method.
- */
- public Statement(Object target, String methodName, Object[] arguments)
- {
- this.target = target;
- this.methodName = methodName;
- this.arguments = arguments;
- }
-
- /**
- * Execute the statement.
- *
- * Finds the specified method in the target object and calls it with
- * the arguments given in the constructor.
- *
- * The most specific method according to the JLS(15.11) is used when
- * there are multiple methods with the same name.
- *
- * Execute performs some special handling for methods and
- * parameters:
- *
- * Static methods can be executed by providing the class as a
- * target.
- *
- * The method name new is reserved to call the constructor
- * new() will construct an object and return it. Not useful unless
- * an expression :-)
- *
- * If the target is an array, get and set as defined in
- * java.util.List are recognized as valid methods and mapped to the
- * methods of the same name in java.lang.reflect.Array.
- *
- * The native datatype wrappers Boolean, Byte, Character, Double,
- * Float, Integer, Long, and Short will map to methods that have
- * native datatypes as parameters, in the same way as Method.invoke.
- * However, these wrappers also select methods that actually take
- * the wrapper type as an argument.
- *
- * The Sun spec doesn't deal with overloading between int and
- * Integer carefully. If there are two methods, one that takes an
- * Integer and the other taking an int, the method chosen is not
- * specified, and can depend on the order in which the methods are
- * declared in the source file.
- *
- * @throws Exception if an exception occurs while locating or
- * invoking the method.
- */
- public void execute() throws Exception
- {
- doExecute();
- }
-
- private static Class wrappers[] =
- {
- Boolean.class, Byte.class, Character.class, Double.class, Float.class,
- Integer.class, Long.class, Short.class
- };
-
- private static Class natives[] =
- {
- Boolean.TYPE, Byte.TYPE, Character.TYPE, Double.TYPE, Float.TYPE,
- Integer.TYPE, Long.TYPE, Short.TYPE
- };
-
- // Given a wrapper class, return the native class for it. For
- // example, if c is Integer, Integer.TYPE is returned.
- private Class unwrap(Class c)
- {
- for (int i = 0; i < wrappers.length; i++)
- if (c == wrappers[i])
- return natives[i];
- return null;
- }
-
- // Return true if all args can be assigned to params, false
- // otherwise. Arrays are guaranteed to be the same length.
- private boolean compatible(Class[] params, Class[] args)
- {
- for (int i = 0; i < params.length; i++)
- {
- // Treat Integer like int if appropriate
- Class nativeType = unwrap(args[i]);
- if (nativeType != null && params[i].isPrimitive()
- && params[i].isAssignableFrom(nativeType))
- continue;
- if (params[i].isAssignableFrom(args[i]))
- continue;
-
- return false;
- }
- return true;
- }
-
- /**
- * Return true if the method arguments in first are more specific
- * than the method arguments in second, i.e. all args in first can
- * be assigned to those in second.
- *
- * A method is more specific if all parameters can also be fed to
- * the less specific method, because, e.g. the less specific method
- * accepts a base class of the equivalent argument for the more
- * specific one.
- *
- * @param first a <code>Class[]</code> value
- * @param second a <code>Class[]</code> value
- * @return a <code>boolean</code> value
- */
- private boolean moreSpecific(Class[] first, Class[] second)
- {
- for (int j=0; j < first.length; j++)
- {
- if (second[j].isAssignableFrom(first[j]))
- continue;
- return false;
- }
- return true;
- }
-
- final Object doExecute() throws Exception
- {
- Class klazz = (target instanceof Class)
- ? (Class) target : target.getClass();
- Object args[] = (arguments == null) ? new Object[0] : arguments;
- Class argTypes[] = new Class[args.length];
- for (int i = 0; i < args.length; i++)
- argTypes[i] = args[i].getClass();
-
- if (target.getClass().isArray())
- {
- // FIXME: invoke may have to be used. For now, cast to Number
- // and hope for the best. If caller didn't behave, we go boom
- // and throw the exception.
- if (methodName.equals("get") && argTypes.length == 1)
- return Array.get(target, ((Number)args[0]).intValue());
- if (methodName.equals("set") && argTypes.length == 2)
- {
- Object obj = Array.get(target, ((Number)args[0]).intValue());
- Array.set(target, ((Number)args[0]).intValue(), args[1]);
- return obj;
- }
- throw new NoSuchMethodException("No matching method for statement " + toString());
- }
-
- // If we already cached the method, just use it.
- if (method != null)
- return method.invoke(target, args);
- else if (ctor != null)
- return ctor.newInstance(args);
-
- // Find a matching method to call. JDK seems to go through all
- // this to find the method to call.
-
- // if method name or length don't match, skip
- // Need to go through each arg
- // If arg is wrapper - check if method arg is matchable builtin
- // or same type or super
- // - check that method arg is same or super
-
- if (methodName.equals("new") && target instanceof Class)
- {
- Constructor ctors[] = klazz.getConstructors();
- for (int i = 0; i < ctors.length; i++)
- {
- // Skip methods with wrong number of args.
- Class ptypes[] = ctors[i].getParameterTypes();
- System.out.println("ptypeslen = " + ptypes.length);
- System.out.println("ptypes = " + ptypes);
- System.out.println("ctor = " + ctors[i].getName());
- for (int j=0; j < ptypes.length; j++) {
- System.out.println("param = " + ptypes[i].getName());
-
- }
-
-
- if (ptypes.length != args.length)
- continue;
-
- // Check if method matches
- if (!compatible(ptypes, argTypes))
- continue;
-
- // Use method[i] if it is more specific.
- // FIXME: should this check both directions and throw if
- // neither is more specific?
- if (ctor == null)
- {
- ctor = ctors[i];
- continue;
- }
- Class mptypes[] = ctor.getParameterTypes();
- if (moreSpecific(ptypes, mptypes))
- ctor = ctors[i];
- }
- if (ctor == null)
- throw new InstantiationException("No matching constructor for statement " + toString());
- return ctor.newInstance(args);
- }
-
- Method methods[] = klazz.getMethods();
-
- for (int i = 0; i < methods.length; i++)
- {
- // Skip methods with wrong name or number of args.
- if (!methods[i].getName().equals(methodName))
- continue;
- Class ptypes[] = methods[i].getParameterTypes();
- if (ptypes.length != args.length)
- continue;
-
- // Check if method matches
- if (!compatible(ptypes, argTypes))
- continue;
-
- // Use method[i] if it is more specific.
- // FIXME: should this check both directions and throw if
- // neither is more specific?
- if (method == null)
- {
- method = methods[i];
- continue;
- }
- Class mptypes[] = method.getParameterTypes();
- if (moreSpecific(ptypes, mptypes))
- method = methods[i];
- }
- if (method == null)
- throw new NoSuchMethodException("No matching method for statement " + toString());
- return method.invoke(target, args);
- }
-
-
-
- /** Return the statement arguments. */
- public Object[] getArguments() { return arguments; }
-
- /** Return the statement method name. */
- public String getMethodName() { return methodName; }
-
- /** Return the statement object. */
- public Object getTarget() { return target; }
-
- /** Return a string representation. */
- public String toString()
- {
- String result = target.getClass().getName() + "." + methodName + "(";
- String sep = "";
- for (int i = 0; i < arguments.length; i++)
- {
- result = result + sep + arguments[i].getClass().getName();
- sep = ", ";
- }
- result = result + ")";
- return result;
- }
-}
diff --git a/libjava/java/beans/VetoableChangeListener.java b/libjava/java/beans/VetoableChangeListener.java
deleted file mode 100644
index 5107954b033..00000000000
--- a/libjava/java/beans/VetoableChangeListener.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* VetoableChangeListener.java -- listen for a change which can be vetoed
- Copyright (C) 1998, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.util.EventListener;
-
-/**
- * VetoableChangeListener allows a class to monitor proposed changes to
- * properties of a Bean and, if desired, prevent them from occurring. A
- * vetoableChange() event will be fired <em>after</em> the property change has
- * been requested, but before it is permanent. If any listener rejects the
- * change by throwing the PropertyChangeException, a new vetoableChange()
- * event will be fired to all listeners who received a vetoableChange() event
- * in the first place, informing them to revert back to the old value. Thus,
- * the listener that threw the exception the first time should be prepared
- * to rethrow it the second time. The value, of course, never actually changed.
- *
- * <p><strong>Note:</strong> This class may not be reliably used to determine
- * whether a property has actually changed. Use the PropertyChangeListener
- * interface for that instead.
- *
- * @author John Keiser
- * @see java.beans.PropertyChangeListener
- * @see java.beans.VetoableChangeSupport
- * @since 1.1
- * @status updated to 1.4
- */
-public interface VetoableChangeListener extends EventListener
-{
- /**
- * Fired before a Bean's property changes.
- *
- * @param e the change (containing the old and new values)
- * @throws PropertyVetoException if the change is vetoed by the listener
- */
- void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException;
-} // interface VetoableChangeListener
diff --git a/libjava/java/beans/VetoableChangeListenerProxy.java b/libjava/java/beans/VetoableChangeListenerProxy.java
deleted file mode 100644
index 56ca5a38c7f..00000000000
--- a/libjava/java/beans/VetoableChangeListenerProxy.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* VetoableChangeListenerProxy.java -- adds a name to a vetoable listener
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.util.EventListenerProxy;
-
-/**
- * This class provides an extension to <code>VetoableChangeListener</code> -
- * associating a name with the listener. This can be used to filter the
- * changes that one is interested in.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status udpated to 1.4
- */
-public class VetoableChangeListenerProxy extends EventListenerProxy
- implements VetoableChangeListener
-{
- /**
- * The name of the property to listen for. Package visible for use by
- * VetoableChangeSupport.
- */
- final String propertyName;
-
- /**
- * Create a new proxy which filters property change events and only passes
- * changes to the named property on to the delegate.
- *
- * @param propertyName the property's name to filter on
- * @param listener the delegate listener
- */
- public VetoableChangeListenerProxy(String propertyName,
- VetoableChangeListener listener)
- {
- super(listener);
- this.propertyName = propertyName;
- }
-
- /**
- * Forwards the event on to the delegate if the property name matches.
- *
- * @param event the event to pass on, if it meets the filter
- * @throws NullPointerException if the delegate this was created with is null
- * @throws PropertyVetoException if the change is vetoed by the listener
- */
- public void vetoableChange(PropertyChangeEvent event)
- throws PropertyVetoException
- {
- // Note: Sun does not filter, under the assumption that since
- // VetoableChangeSupport unwraps proxys, this method should never be
- // called by normal use of listeners.
- String name = event == null ? null : event.getPropertyName();
- if (name == null ? propertyName == null : name.equals(propertyName))
- ((VetoableChangeListener) getListener()).vetoableChange(event);
- }
-
- /**
- * Gets the name of the property this proxy is filtering on.
- *
- * @return the property name
- */
- public String getPropertyName()
- {
- return propertyName;
- }
-} // class VetoableChangeListenerProxy
diff --git a/libjava/java/beans/VetoableChangeSupport.java b/libjava/java/beans/VetoableChangeSupport.java
deleted file mode 100644
index dce8dffd341..00000000000
--- a/libjava/java/beans/VetoableChangeSupport.java
+++ /dev/null
@@ -1,530 +0,0 @@
-/* VetoableChangeSupport.java -- support to manage vetoable change listeners
- Copyright (C) 1998, 1999, 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map.Entry;
-import java.util.Vector;
-
-/**
- * VetoableChangeSupport makes it easy to fire vetoable change events and
- * handle listeners. It allows chaining of listeners, as well as filtering
- * by property name. In addition, it will serialize only those listeners
- * which are serializable, ignoring the others without problem. This class
- * is thread-safe.
- *
- * @author John Keiser
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status updated to 1.4
- */
-public class VetoableChangeSupport implements Serializable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -5090210921595982017L;
-
- /**
- * Maps property names (String) to named listeners (VetoableChangeSupport).
- * If this is a child instance, this field will be null.
- *
- * @serial the map of property names to named listener managers
- * @since 1.2
- */
- private Hashtable children;
-
- /**
- * The non-null source object for any generated events.
- *
- * @serial the event source
- */
- private final Object source;
-
- /**
- * A field to compare serialization versions - this class uses version 2.
- *
- * @serial the serialization format
- */
- private static final int vetoableChangeSupportSerializedDataVersion = 2;
-
- /**
- * The list of all registered vetoable listeners. If this instance was
- * created by user code, this only holds the global listeners (ie. not tied
- * to a name), and may be null. If it was created by this class, as a
- * helper for named properties, then this vector will be non-null, and this
- * instance appears as a value in the <code>children</code> hashtable of
- * another instance, so that the listeners are tied to the key of that
- * hashtable entry.
- */
- private transient Vector listeners;
-
- /**
- * Create a VetoableChangeSupport to work with a specific source bean.
- *
- * @param source the source bean to use
- * @throws NullPointerException if source is null
- */
- public VetoableChangeSupport(Object source)
- {
- this.source = source;
- if (source == null)
- throw new NullPointerException();
- }
-
- /**
- * Adds a VetoableChangeListener to the list of global listeners. All
- * vetoable change events will be sent to this listener. The listener add
- * is not unique: that is, <em>n</em> adds with the same listener will
- * result in <em>n</em> events being sent to that listener for every
- * vetoable change. Adding a null listener may cause a NullPointerException
- * down the road. This method will unwrap a VetoableChangeListenerProxy,
- * registering the underlying delegate to the named property list.
- *
- * @param l the listener to add
- */
- public synchronized void addVetoableChangeListener(VetoableChangeListener l)
- {
- if (l instanceof VetoableChangeListenerProxy)
- {
- VetoableChangeListenerProxy p = (VetoableChangeListenerProxy) l;
- addVetoableChangeListener(p.propertyName,
- (VetoableChangeListener) p.getListener());
- }
- else
- {
- if (listeners == null)
- listeners = new Vector();
- listeners.add(l);
- }
- }
-
- /**
- * Removes a VetoableChangeListener from the list of global listeners. If
- * any specific properties are being listened on, they must be deregistered
- * by themselves; this will only remove the general listener to all
- * properties. If <code>add()</code> has been called multiple times for a
- * particular listener, <code>remove()</code> will have to be called the
- * same number of times to deregister it. This method will unwrap a
- * VetoableChangeListenerProxy, removing the underlying delegate from the
- * named property list.
- *
- * @param l the listener to remove
- */
- public synchronized void
- removeVetoableChangeListener(VetoableChangeListener l)
- {
- if (l instanceof VetoableChangeListenerProxy)
- {
- VetoableChangeListenerProxy p = (VetoableChangeListenerProxy) l;
- removeVetoableChangeListener(p.propertyName,
- (VetoableChangeListener) p.getListener());
- }
- else if (listeners != null)
- {
- listeners.remove(l);
- if (listeners.isEmpty())
- listeners = null;
- }
- }
-
- /**
- * Returns an array of all registered vetoable change listeners. Those that
- * were registered under a name will be wrapped in a
- * <code>VetoableChangeListenerProxy</code>, so you must check whether the
- * listener is an instance of the proxy class in order to see what name the
- * real listener is registered under. If there are no registered listeners,
- * this returns an empty array.
- *
- * @return the array of registered listeners
- * @see VetoableChangeListenerProxy
- * @since 1.4
- */
- public synchronized VetoableChangeListener[] getVetoableChangeListeners()
- {
- ArrayList list = new ArrayList();
- if (listeners != null)
- list.addAll(listeners);
- if (children != null)
- {
- int i = children.size();
- Iterator iter = children.entrySet().iterator();
- while (--i >= 0)
- {
- Entry e = (Entry) iter.next();
- String name = (String) e.getKey();
- Vector v = ((VetoableChangeSupport) e.getValue()).listeners;
- int j = v.size();
- while (--j >= 0)
- list.add(new VetoableChangeListenerProxy
- (name, (VetoableChangeListener) v.get(j)));
- }
- }
- return (VetoableChangeListener[])
- list.toArray(new VetoableChangeListener[list.size()]);
- }
-
- /**
- * Adds a VetoableChangeListener listening on the specified property. Events
- * will be sent to the listener only if the property name matches. The
- * listener add is not unique; that is, <em>n</em> adds on a particular
- * property for a particular listener will result in <em>n</em> events
- * being sent to that listener when that property is changed. The effect is
- * cumulative, too; if you are registered to listen to receive events on
- * all vetoable changes, and then you register on a particular property,
- * you will receive change events for that property twice. Adding a null
- * listener may cause a NullPointerException down the road. This method
- * will unwrap a VetoableChangeListenerProxy, registering the underlying
- * delegate to the named property list if the names match, and discarding
- * it otherwise.
- *
- * @param propertyName the name of the property to listen on
- * @param l the listener to add
- * @throws NullPointerException if propertyName is null
- */
- public synchronized void addVetoableChangeListener(String propertyName,
- VetoableChangeListener l)
- {
- while (l instanceof VetoableChangeListenerProxy)
- {
- VetoableChangeListenerProxy p = (VetoableChangeListenerProxy) l;
- if (propertyName == null ? p.propertyName != null
- : ! propertyName.equals(p.propertyName))
- return;
- l = (VetoableChangeListener) p.getListener();
- }
- VetoableChangeSupport s = null;
- if (children == null)
- children = new Hashtable();
- else
- s = (VetoableChangeSupport) children.get(propertyName);
- if (s == null)
- {
- s = new VetoableChangeSupport(source);
- s.listeners = new Vector();
- children.put(propertyName, s);
- }
- s.listeners.add(l);
- }
-
- /**
- * Removes a VetoableChangeListener from listening to a specific property.
- * If <code>add()</code> has been called multiple times for a particular
- * listener on a property, <code>remove()</code> will have to be called the
- * same number of times to deregister it. This method will unwrap a
- * VetoableChangeListenerProxy, removing the underlying delegate from the
- * named property list if the names match.
- *
- * @param propertyName the property to stop listening on
- * @param l the listener to remove
- * @throws NullPointerException if propertyName is null
- */
- public synchronized void
- removeVetoableChangeListener(String propertyName, VetoableChangeListener l)
- {
- if (children == null)
- return;
- VetoableChangeSupport s
- = (VetoableChangeSupport) children.get(propertyName);
- if (s == null)
- return;
- while (l instanceof VetoableChangeListenerProxy)
- {
- VetoableChangeListenerProxy p = (VetoableChangeListenerProxy) l;
- if (propertyName == null ? p.propertyName != null
- : ! propertyName.equals(p.propertyName))
- return;
- l = (VetoableChangeListener) p.getListener();
- }
- s.listeners.remove(l);
- if (s.listeners.isEmpty())
- {
- children.remove(propertyName);
- if (children.isEmpty())
- children = null;
- }
- }
-
- /**
- * Returns an array of all vetoable change listeners registered under the
- * given property name. If there are no registered listeners, this returns
- * an empty array.
- *
- * @return the array of registered listeners
- * @throws NullPointerException if propertyName is null
- * @since 1.4
- */
- public synchronized VetoableChangeListener[]
- getVetoableChangeListeners(String propertyName)
- {
- if (children == null)
- return new VetoableChangeListener[0];
- VetoableChangeSupport s
- = (VetoableChangeSupport) children.get(propertyName);
- if (s == null)
- return new VetoableChangeListener[0];
- return (VetoableChangeListener[])
- s.listeners.toArray(new VetoableChangeListener[s.listeners.size()]);
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are non-null
- * and equal. If the change is vetoed, a new event is fired to notify
- * listeners about the rollback before the exception is thrown.
- *
- * @param propertyName the name of the property that changed
- * @param oldVal the old value
- * @param newVal the new value
- * @throws PropertyVetoException if the change is vetoed by a listener
- */
- public void fireVetoableChange(String propertyName,
- Object oldVal, Object newVal)
- throws PropertyVetoException
- {
- fireVetoableChange(new PropertyChangeEvent(source, propertyName,
- oldVal, newVal));
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are equal.
- * If the change is vetoed, a new event is fired to notify listeners about
- * the rollback before the exception is thrown.
- *
- * @param propertyName the name of the property that changed
- * @param oldVal the old value
- * @param newVal the new value
- * @throws PropertyVetoException if the change is vetoed by a listener
- */
- public void fireVetoableChange(String propertyName, int oldVal, int newVal)
- throws PropertyVetoException
- {
- if (oldVal != newVal)
- fireVetoableChange(new PropertyChangeEvent(source, propertyName,
- new Integer(oldVal),
- new Integer(newVal)));
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are equal.
- * If the change is vetoed, a new event is fired to notify listeners about
- * the rollback before the exception is thrown.
- *
- * @param propertyName the name of the property that changed
- * @param oldVal the old value
- * @param newVal the new value
- * @throws PropertyVetoException if the change is vetoed by a listener
- */
- public void fireVetoableChange(String propertyName,
- boolean oldVal, boolean newVal)
- throws PropertyVetoException
- {
- if (oldVal != newVal)
- fireVetoableChange(new PropertyChangeEvent(source, propertyName,
- Boolean.valueOf(oldVal),
- Boolean.valueOf(newVal)));
- }
-
- /**
- * Fire a PropertyChangeEvent to all the global listeners, and to all the
- * listeners for the specified property name. This does nothing if old and
- * new values of the event are equal. If the change is vetoed, a new event
- * is fired to notify listeners about the rollback before the exception is
- * thrown.
- *
- * @param event the event to fire
- * @throws NullPointerException if event is null
- * @throws PropertyVetoException if the change is vetoed by a listener
- */
- public void fireVetoableChange(PropertyChangeEvent event)
- throws PropertyVetoException
- {
- if (event.oldValue != null && event.oldValue.equals(event.newValue))
- return;
- Vector v = listeners; // Be thread-safe.
- if (v != null)
- {
- int i = v.size();
- try
- {
- while (--i >= 0)
- ((VetoableChangeListener) v.get(i)).vetoableChange(event);
- }
- catch (PropertyVetoException e)
- {
- event = event.rollback();
- int limit = i;
- i = v.size();
- while (--i >= limit)
- ((VetoableChangeListener) v.get(i)).vetoableChange(event);
- throw e;
- }
- }
- Hashtable h = children; // Be thread-safe.
- if (h != null && event.propertyName != null)
- {
- VetoableChangeSupport s
- = (VetoableChangeSupport) h.get(event.propertyName);
- if (s != null)
- {
- Vector v1 = s.listeners; // Be thread-safe.
- int i = v1 == null ? 0 : v1.size();
- try
- {
- while (--i >= 0)
- ((VetoableChangeListener) v1.get(i)).vetoableChange(event);
- }
- catch (PropertyVetoException e)
- {
- event = event.rollback();
- int limit = i;
- i = v.size();
- while (--i >= 0)
- ((VetoableChangeListener) v.get(i)).vetoableChange(event);
- i = v1.size();
- while (--i >= limit)
- ((VetoableChangeListener) v1.get(i)).vetoableChange(event);
- throw e;
- }
- }
- }
- }
-
- /**
- * Tell whether the specified property is being listened on or not. This
- * will only return <code>true</code> if there are listeners on all
- * properties or if there is a listener specifically on this property.
- *
- * @param propertyName the property that may be listened on
- * @return whether the property is being listened on
- * @throws NullPointerException if propertyName is null
- */
- public synchronized boolean hasListeners(String propertyName)
- {
- return listeners != null || (children != null
- && children.get(propertyName) != null);
- }
-
- /**
- * Saves the state of the object to the stream.
- *
- * @param s the stream to write to
- * @throws IOException if anything goes wrong
- * @serialData this writes out a null-terminated list of serializable
- * global vetoable change listeners (the listeners for a named
- * property are written out as the global listeners of the
- * children, when the children hashtable is saved)
- */
- private synchronized void writeObject(ObjectOutputStream s)
- throws IOException
- {
- s.defaultWriteObject();
- if (listeners != null)
- {
- int i = listeners.size();
- while (--i >= 0)
- if (listeners.get(i) instanceof Serializable)
- s.writeObject(listeners.get(i));
- }
- s.writeObject(null);
- }
-
- /**
- * Reads the object back from stream (deserialization).
- *
- * XXX Since serialization for 1.1 streams was not documented, this may
- * not work if vetoableChangeSupportSerializedDataVersion is 1.
- *
- * @param s the stream to read from
- * @throws IOException if reading the stream fails
- * @throws ClassNotFoundException if deserialization fails
- * @serialData this reads in a null-terminated list of serializable
- * global vetoable change listeners (the listeners for a named
- * property are written out as the global listeners of the
- * children, when the children hashtable is saved)
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- VetoableChangeListener l = (VetoableChangeListener) s.readObject();
- while (l != null)
- {
- addVetoableChangeListener(l);
- l = (VetoableChangeListener) s.readObject();
- }
- // Sun is not as careful with children as we are, and lets some proxys
- // in that can never receive events. So, we clean up anything that got
- // serialized, to make sure our invariants hold.
- if (children != null)
- {
- int i = children.size();
- Iterator iter = children.entrySet().iterator();
- while (--i >= 0)
- {
- Entry e = (Entry) iter.next();
- String name = (String) e.getKey();
- VetoableChangeSupport vcs = (VetoableChangeSupport) e.getValue();
- if (vcs.listeners == null)
- vcs.listeners = new Vector();
- if (vcs.children != null)
- vcs.listeners.addAll
- (Arrays.asList(vcs.getVetoableChangeListeners(name)));
- if (vcs.listeners.size() == 0)
- iter.remove();
- else
- vcs.children = null;
- }
- if (children.size() == 0)
- children = null;
- }
- }
-} // class VetoableChangeSupport
diff --git a/libjava/java/beans/Visibility.java b/libjava/java/beans/Visibility.java
deleted file mode 100644
index 428f3a2073b..00000000000
--- a/libjava/java/beans/Visibility.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* java.beans.Visibility
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-/**
- * Visibility is an interface a Bean may implement so that the environment
- * can tell the Bean whether there is a GUI or not, and so that the Bean
- * can tell the environment whether it needs one or can run without one.
- * <P>
- *
- * Sun decided not to use standard Introspection patterns so that these
- * methods did not get included when the Introspector made its sweep on
- * the class.
- *
- * @author John Keiser
- * @since JDK1.1
- * @version 1.1.0, 29 Jul 1998
- */
-
-public interface Visibility {
- /**
- * Tells whether the Bean can run without a GUI or not.
- * @return false if Bean can run without a GUI, else true.
- */
- boolean needsGui();
-
- /**
- * Tells whether Bean is trying not to use the GUI.
- * If needsGui() is true, this method should always return false.
- * @return true if definitely not using GUI, otherwise false.
- */
- boolean avoidingGui();
-
- /**
- * Tells the Bean not to use GUI methods.
- * If needsGUI() is false, then after this method is called,
- * avoidingGui() should return true.
- */
- void dontUseGui();
-
- /**
- * Tells the Bean it may use the GUI.
- * The Bean is not required to use the GUI in this case, it is
- * merely being <EM>permitted</EM> to use it. If needsGui() is
- * false, avoidingGui() may return true or false after this method
- * is called.
- */
- void okToUseGui();
-}
diff --git a/libjava/java/beans/XMLDecoder.java b/libjava/java/beans/XMLDecoder.java
deleted file mode 100644
index 238fd6bed91..00000000000
--- a/libjava/java/beans/XMLDecoder.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/* java.beans.XMLDecoder --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans;
-
-import gnu.java.beans.decoder.DefaultExceptionListener;
-import gnu.java.beans.decoder.PersistenceParser;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * The XMLDecoder reads XML data that is structured according to
- * <a href="http://java.sun.com/products/jfc/tsc/articles/persistence3/javabeans.dtd">this</a> DTD
- * and creates objects according to the content. Usually such data is generated using the
- * {@link XMLEncoder} class.
- * <p>
- * An example XML document might look like this:
- * <code>
- * &lt;java&gt;
- * &lt;string&gt;Hello World&lt;/string&gt;
- * &lt;int&gt;200&lt;/int&gt;
- * &lt;/java&gt;
- * </code>
- * <p>To read the <code>String</code> and the <code>Integer</code> instance the following can be used (assume
- * the XML data can be obtained from the InputStream):</p>
- * <code>
- * XMLDecoder decoder = new XMLDecoder(inputStreamContainingXMLData);
- * String message = (String) decoder.readObject();
- * Integer number = (Integer) decoder.readObject();
- * </code>
- * <p>Besides this basic functionality the <code>XMLDecoder</code> has some more features that might come
- * handy in certain situations:</p>
- * <p>An owner object can be set using the <code>setOwner</code> method which can then be accessed when
- * decoding. This feature is only useful if the XML data is aware of the owner object. Such data may
- * look like this (assume that the owner object is a JFrame instance):</p>
- * <code>
- * &lt;java&gt;
- * &lt;void method="getOwner"&gt;
- * &lt;void method="setVisible"&gt;
- * &lt;boolean&gt;true&lt;boolean&gt;
- * &lt;/void&gt;
- * &lt;/void&gt;
- * &lt;/java&gt;
- * </code>
- * This accesses the <code>JFrame</code> and makes it visible using the <code>setVisible</code> method.
- * <p>Please note that changing the owner <b>after</b> the having read the first object has no effect,
- * because all object have been decoded then.</p>
- * <p>If the <code>XMLDecoder</code> is created with no {@link ExceptionListener} instance a default one
- * is used that prints an error message to <code>System.err</code> whenever a recoverable exception
- * is thrown. Recovarable exceptions occur when the XML data cannot be interpreted correctly (e.g
- * unknown classes or methods, invocation on null, ...). In general be very careful when the
- * <code>XMLDecoder</code> provoked such exceptions because the resulting object(s) may be in an
- * undesirable state.</p>
- * <p>Note that changing the ExceptionListener instance after <code>readObject</code> has been called
- * once has no effect because the decoding is completed then.</p>
- * <p>At last one can provide a specific <code>ClassLoader</code> which is then used when <code>Class</code>
- * objects are accessed. See {@link java.lang.Class#forName(String, boolean, ClassLoader)} for details
- * on this.</p>
- * <p>Note: If the <code>InputStream</code> instance given to any of the constructors is <code>null</code>
- * the resulting <code>XMLDecoder</code> will be silently (without any exception) useless. Each call
- * to <code>readObject</code> will return <code>null</code> and never throws an
- * <code>ArrayIndexOutOfBoundsException</code>.</p>
- *
- * @author Robert Schuster
- * @since 1.4
- * @status updated to 1.5
- */
-public class XMLDecoder
-{
- private Object owner;
-
- private ExceptionListener exceptionListener;
-
- private InputStream inputStream;
-
- private boolean isStreamClosed;
-
- private ClassLoader classLoader;
-
- private Iterator iterator;
-
- /** Creates a XMLDecoder instance that parses the XML data of the given input stream.
- * Using this constructor no special ClassLoader, a default ExceptionListener
- * and no owner object is used.
- *
- * @param in InputStream to read XML data from.
- */
- public XMLDecoder(InputStream in)
- {
- this(in, null);
- }
-
- /** Creates a XMLDecoder instance that parses the XML data of the given input stream.
- * Using this constructor no special ClassLoader and a default ExceptionListener
- * is used.
- *
- * @param in InputStream to read XML data from.
- * @param owner Owner object which can be accessed and modified while parsing.
- */
- public XMLDecoder(InputStream in, Object owner)
- {
- this(in, owner, null);
- }
-
- /** Creates a XMLDecoder instance that parses the XML data of the given input stream.
- * If the ExceptionListener argument is null a default implementation is used.
- *
- * @param in InputStream to read XML data from.
- * @param owner Owner object which can be accessed and modified while parsing.
- * @param exceptionListener ExceptionListener instance to which exception notifications are send.
- */
- public XMLDecoder(
- InputStream in,
- Object owner,
- ExceptionListener exceptionListener)
- {
- this(
- in,
- owner,
- exceptionListener,
- Thread.currentThread().getContextClassLoader());
- }
-
- /** Creates a XMLDecoder instance that parses the XML data of the given input stream.
- * If the ExceptionListener argument is null a default implementation is used.
- *
- * @param in InputStream to read XML data from.
- * @param owner Owner object which can be accessed and modified while parsing.
- * @param exceptionListener ExceptionListener instance to which exception notifications are send.
- * @param cl ClassLoader instance that is used for calls to <code>Class.forName(String, boolean, ClassLoader)</code>
- * @since 1.5
- */
- public XMLDecoder(
- InputStream in,
- Object owner,
- ExceptionListener listener,
- ClassLoader cl)
- {
- // initially here was a check for the validity of the InputStream argument but some
- // great engineers decided that this API should silently discard this and behave rather
- // odd: readObject will always return null ...
- inputStream = in;
-
- setExceptionListener(listener);
-
- // validity of this object is checked in Class.forName() and therefore may be null
- classLoader = cl;
-
- this.owner = owner;
- }
-
- /** Closes the stream associated with this decoder. This should be done after having read all
- * decoded objects.
- * <p>See the description of the {@link #readObject()} for the effect caused by <code>close</code>.</p>
- */
- public void close()
- {
- if (isStreamClosed)
- {
- return;
- }
-
- try
- {
- inputStream.close();
- isStreamClosed = true;
- }
- catch (IOException e)
- {
- // bad style forced by original API design ...
- }
- }
-
- /** Returns the ExceptionListener instance associated with this decoder.
- * <p>See the description of {@link XMLDecoder} class for more information on the ExceptionListener.</p>
- *
- * @return Current ExceptionListener of the decoder.
- */
- public ExceptionListener getExceptionListener()
- {
- return exceptionListener;
- }
-
- /** Returns the owner object of the decoder. This method is usually called
- * from within the parsed XML data.
- * <p>See the description of {@link XMLDecoder} class for more information on the owner object.</p>
- *
- * @return The owner object of this decoder.
- */
- public Object getOwner()
- {
- return owner;
- }
-
- /** Returns the next available decoded object.
- * <p>Note that the actual decoding takes place when the method is called for the first time.</p>
- * <p>If the <code>close</code> method was already called a <code>NoSuchElementException</code>
- * is thrown.</p>
- * <p>If the InputStream instance used in the constructors was <code>null</code> this method
- * will always return <code>null</code> itself.</p>
- *
- * @return The next object in a sequence decoded from XML data.
- * @throws ArrayIndexOutOfBoundsException When no more objects are available.
- */
- public Object readObject() throws ArrayIndexOutOfBoundsException
- {
- // note: the RI does it this way ...
- if(inputStream == null) {
- return null;
- }
-
- // note: the original API documentation says nothing on what to do
- // when the stream was closed before readObject is called but it actually
- // throws a NoSuchElementException - this behaviour is imitated here
- if (isStreamClosed)
- {
- throw new NoSuchElementException("Cannot read any objects - XMLDecoder was already closed.");
- }
-
- // creates the PersistenceParser (doing the parsing and decoding) and returns its
- // Iterator on first invocation
- if (iterator == null)
- {
- iterator =
- new PersistenceParser(
- inputStream,
- exceptionListener,
- classLoader,
- this)
- .iterator();
- }
-
- // note: done according to the official documentation
- if (!iterator.hasNext())
- {
- throw new ArrayIndexOutOfBoundsException("No more objects available from this XMLDecoder.");
- }
-
- // returns just the next object if there was no problem
- return iterator.next();
- }
-
- /** Sets the ExceptionListener instance to which notifications of exceptions are send
- * while parsing the XML data.
- * <p>See the description of {@link XMLDecoder} class for more information on the ExceptionListener.</p>
- *
- * @param listener
- */
- public void setExceptionListener(ExceptionListener listener)
- {
- // uses a default implementation when null
- if (listener == null)
- {
- listener = new DefaultExceptionListener();
- }
- exceptionListener = listener;
- }
-
- /** Sets the owner object which can be accessed from the parsed XML data.
- * <p>See the description of {@link XMLDecoder} class for more information on the owner object.</p>
- *
- * @param newOwner
- */
- public void setOwner(Object newOwner)
- {
- owner = newOwner;
- }
-
-}
diff --git a/libjava/java/beans/beancontext/BeanContext.java b/libjava/java/beans/beancontext/BeanContext.java
deleted file mode 100644
index 3d1be7fc8e9..00000000000
--- a/libjava/java/beans/beancontext/BeanContext.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/* java.beans.beancontext.BeanContext
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.beans.DesignMode;
-import java.beans.Visibility;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collection;
-
-/**
- * Acts as a container for sub-beans and as a sub-bean,
- * so that an entire hierarchy of beans can be made up of
- * <code>BeanContext</code>s.
- * <P>
- *
- * Since I can't sprinkle the <code>Collections</code> interface
- * documentation with special information for <code>BeanContext</code>
- * implementors, I'll have to document special requirements for
- * implementors of those functions here.
- * <P>
- *
- * <code><strong>add()</strong></code> or <code>addAll()</code>:
- * <br>
- * <OL>
- * <LI>
- * May add any <code>Object</code> into the hierarchy as well as a
- * <code>BeanContextChild</code>, <code>BeanContext</code> or
- * <code>BeanContextProxy</code> object.
- * This way, any Bean can be in the hierarchy.
- * </LI>
- * <LI>
- * Must synchronize on <code>BeanContext.globalHierarchyLock</code>.
- * </LI>
- * <LI>
- * Don't add the <code>Object</code> if it's already there (only once
- * per <code>BeanContext</code>).
- * </LI>
- * <LI>
- * If it is a <code>BeanContextChild</code> implementor, call
- * <code>setBeanContext()</code> on it. If it's a
- * <code>BeanContextProxy</code> implementor, call
- * <code>getBeanContextProxy().setBeanContext()</code> on it.
- * If <code>setBeanContext()</code> vetoes the change, back out
- * all changes so far and throw <code>IllegalStateException</code>.
- * </LI>
- * <LI>
- * If it (or its proxy) implements <code>Visibility</code>, call
- * <code>dontUseGui()</code> or <code>okToUseGui()</code> on it,
- * depending on whether you (the <code>BeanContext</code>) feel like
- * allowing it to use the GUI or not.
- * </LI>
- * <LI>
- * If it implements <code>BeanContextChild</code> or
- * <code>BeanContextProxy</code>, register yourself (the
- * <code>BeanContext</code>) as both a
- * <code>PropertyChangeListener</code> and
- * <code>VetoableChangeListener</code> on the "beanContext"
- * property (it may also add itself on any other properties it wishes
- * to).
- * </LI>
- * <LI>
- * If it is a listener or event source that you (the
- * <code>BeanContext</code>) are interested in, you may register
- * yourself to it or register it to you.
- * </LI>
- * <LI>
- * Fire a <code>java.beans.beancontext.BeanContextMembershipEvent</code>
- * before exiting. <code>addAll()</code> should wait until everything
- * is done changing before firing the event (or events) so that if a
- * failure occurs, the backing-out process can proceed without any
- * events being fired at all.
- * </LI>
- * </OL>
- * <P>
- *
- * <code><strong>remove()</strong></code> or <code>removeAll()</code>:
- * <br>
- * <OL>
- * <LI>
- * Must synchronize on <code>BeanContext.globalHierarchyLock</code>.
- * </LI>
- * <LI>
- * If the specified <code>Object</code> is not a child of this
- * <code>BeanContext</code>, just exit without performing any actions.
- * </LI>
- * <LI>
- * Remove the <code>Object</code> from your collection of children.
- * </LI>
- * <LI>
- * If it is a <code>BeanContextChild</code> implementor, call
- * <code>setBeanContext(null)</code> on it. If it's a
- * <code>BeanContextProxy</code> implementor, call
- * <code>getBeanContextProxy().setBeanContext(null)</code> on it.
- * If <code>setBeanContext()</code> vetoes the change, back out
- * all changes so far and throw <code>IllegalStateException</code>.
- * </LI>
- * <LI>
- * If you registered the <code>Object</code> to listen to you or
- * registered yourself as a listener on the <code>Object</code> during
- * <code>add()</code> or <code>addAll()</code>, undo the registration
- * bycalling the appropriate <code>removeListener()</code> method.
- * </LI>
- * <LI>
- * Fire a <code>java.beans.beancontext.BeanContextMembershipEvent</code>
- * before exiting. <code>removeAll()</code> should wait until
- * everything is done changing before firing the event (or events) so
- * that if a failure occurs, the backing-out process can proceed
- * without any events being fired at all.
- * </LI>
- * </OL>
- * <P>
- *
- * <code>addAll()</code>, <code>removeAll()</code>,
- * <code>retainAll()</code> and <code>clear()</code> do not need to be
- * implemented, but may be if so desired.
- * <P>
- *
- * Similarly, <code>Visibility</code> and <code>DesignMode</code> methods
- * should propagate changed values to children that implement interfaces
- * of the same name.
- * <P>
- *
- * A hierarchy of beans is mainly useful so that different sets of beans
- * can be established, each with their own set of resources.
- *
- * @author John Keiser
- * @since JDK1.2
- */
-
-public interface BeanContext
- extends Collection, BeanContextChild, Visibility, DesignMode {
-
- /**
- * The global lock on changing any BeanContext hierarchy.
- * It kinda sucks that there is only one lock, since there can be
- * multiple hierarchies. Oh well, I didn't design, I just code.
- * <P>
- *
- * Methods that must (or do) synchronize on the global lock:
- * <BR>
- * <UL>
- * <LI>
- * Implementors of <CODE>BeanContext.add()</CODE> and <code>addAll()</code>
- * </LI>
- * </UL>
- * @fixme fill in the rest of the methods which use the global lock.
- */
- Object globalHierarchyLock = new Object();
-
- /**
- * Instantiate a Bean using this Bean's <code>ClassLoader</code>
- * and this <code>BeanContext</code> as the parent.
- * <P>
- *
- * This method exists mainly so that <code>BeanContext</code>
- * implementations can perform extra actions on Beans that are
- * created within them.
- *
- * @param beanName the name of the bean to instantiate
- * @return the created Bean
- *
- * @see java.beans.Beans#instantiate(java.lang.ClassLoader,java.lang.String)
- * @see java.beans.Beans#instantiate(java.lang.ClassLoader,java.lang.String,java.lang.BeanContext)
- * @exception IOException if there is an I/O problem during
- * instantiation.
- * @exception ClassNotFoundException if a serialized Bean's class
- * is not found.
- */
- Object instantiateChild(String beanName)
- throws IOException,
- ClassNotFoundException;
-
- /**
- * Get a resource. The <code>BeanContext</code> will typically
- * call <code>ClassLoader.getResource()</code>, but may do it any
- * way it wants to. This allows a <code>BeanContext</code> to
- * have its own set of resources separate from the rest of the
- * system.
- * <P>
- *
- * Beans should call this method on their parent rather than the
- * associated <code>ClassLoader</code> method.
- * <P>
- *
- * I am assuming, but am not entirely sure, that if a
- * <code>BeanContext</code> cannot find a resource, its
- * responsibility is to call the <code>getResource</code> method
- * of its parent <code>BeanContext</code>.
- *
- * @return a URL to the requested resource.
- * @param resourceName the name of the resource requested.
- * @param requestor a reference to the child requesting the resource.
- * @see java.lang.ClassLoader#getResource(java.lang.String)
- */
- URL getResource(String resourceName, BeanContextChild requestor);
-
- /**
- * Get a resource as a stream. The <code>BeanContext</code> will
- * typically call <code>ClassLoader.getResourceAsStream()</code>,
- * but may do it any way it wants to. This allows a
- * <code>BeanContext</code>'s children to have their own set of
- * resources separate from the rest of the system.
- * <P>
- *
- * Beans should call this method on their parent rather than the
- * associated <code>ClassLoader</code> method.
- * <P>
- *
- * I am assuming, but am not entirely sure, that if a
- * <code>BeanContext</code> cannot find a resource, its
- * responsibility is to call the <code>getResourceAsStream</code>
- * method of its parent <code>BeanContext</code>.
- *
- * @return the requested resource as a stream.
- * @param resourceName the name of the resource requested.
- * @param requestor a reference to the child requesting the resource.
- * @see java.lang.ClassLoader#getResourceAsStream(java.lang.String)
- */
- InputStream getResourceAsStream(String resourceName, BeanContextChild requestor);
-
- /**
- * Add a listener on changes to the membership of this
- * <code>BeanContext</code> object.
- * @param listener the listener to add.
- */
- void addBeanContextMembershipListener(BeanContextMembershipListener listener);
-
- /**
- * Remove a listener on changes to the membership of this
- * <code>BeanContext</code> object.
- * @param listener the listener to remove.
- */
- void removeBeanContextMembershipListener(BeanContextMembershipListener listener);
-}
diff --git a/libjava/java/beans/beancontext/BeanContextChild.java b/libjava/java/beans/beancontext/BeanContextChild.java
deleted file mode 100644
index d1115efac85..00000000000
--- a/libjava/java/beans/beancontext/BeanContextChild.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/* java.beans.beancontext.BeanContextChild
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
-import java.beans.VetoableChangeListener;
-
-/**
- * Beans implement this to get information about the execution environment and
- * its services and to be placed in the hierarchy.
- * <P>
- *
- * The difference between a <code>BeanContext</code> and a
- * <code>BeanContextChild</code>, mainly, is that a
- * <code>BeanContext</code> may be a parent.
- * <P>
- *
- * <code>BeanContextChild</code> instances will be serialized at some
- * point in their life, but you need to make sure your bean context does
- * not contain a serializable reference (directly or indirectly) to the
- * parent <code>BeanContext</code>, to any of the other
- * <code>BeanContext</code>s in the tree, or to any resources obtained
- * via the <code>BeanContextServices</code> interface. One way to do this
- * is to mark any fields that contain such references as
- * <code>transient</code>. Another way is to use a custom serializer.
- * <P>
- *
- * If you do not do this, when the <code>BeanContext</code> is serialized,
- * all the other <code>BeanContext</code>s and other unnecessary things
- * will be serialized along with it.
- * <P>
- *
- * Before dying, a <code>BeanContextChild</code> should call
- * <code>getBeanContext().remove(this)</code> to detach from the
- * hierarchy and exit cleanly.
- *
- * @author John Keiser
- * @since JDK1.2
- * @see java.beans.beancontext.BeanContext
- */
-
-public interface BeanContextChild {
- /**
- * Set the parent <code>BeanContext</code>.
- * <P>
- *
- * This method is called from <code>BeanContext.add()</code> and
- * should not be called directly.
- * <P>
- *
- * When this Object is being added to a new BeanContext or moved
- * from an old one, a non-null value will be passed in.
- * <P>
- *
- * When this Object is being removed from the current
- * <code>BeanContext</code>, <code>setBeanContext()</code> will
- * receive the parameter <code>null</code>.
- * <P>
- *
- * When being removed from the current <code>BeanContext</code>,
- * it is the <code>BeanContextChild</code>'s responsibility to
- * release all services it has obtained.
- * <P>
- *
- * This change should generate <code>PropertyChangeEvent</code>
- * and <code>VetoableChangeEvent</code>s with the property name
- * "beanContext". If the change is vetoed, it must re-throw the
- * exception and not change anything. In this way, the parent
- * <code>BeanContextChild</code>, who has registered himself with
- * you, will have a chance to remove this child from its
- * collection.
- * <P>
- *
- * If the Bean does not wish to change the parent or be removed
- * from one, it may throw the <code>PropertyVetoException</code>.
- * If you veto a <code>setBeanContext(null)</code> call, then you
- * should try your hardest to remedy whatever problem is keeping
- * you from being removed from the <code>BeanContext</code> so
- * that you can <em>not</em> veto it the next time.
- * Otherwise, nasty pathological recursion stuff could occur in
- * certain situations.
- * <P>
- *
- * If you do veto the change, you must first back out any changes
- * you made prior to the veto. Best not to make any such changes
- * prior to the veto in the first place.
- * <P>
- *
- * This method is called from <code>BeanContext.add()</code> and
- * should not be called directly.
- *
- * @param parent the new parent for the <code>BeanContextChild</code>,
- * or <code>null</code> to signify removal from a tree.
- * @exception PropertyVetoException if the
- * <code>BeanContextChild</code> implementor does not
- * wish to have its parent changed.
- */
- void setBeanContext(BeanContext parent)
- throws PropertyVetoException;
-
- /**
- * Get the parent <code>BeanContext</code>.
- * @return the parent <code>BeanContext</code>.
- */
- BeanContext getBeanContext();
-
- /**
- * Add a listener that will be notified when a specific property changes.
- * @param prop the name of the property to listen on
- * @param listener the listener to listen on the property.
- */
- void addPropertyChangeListener(String prop, PropertyChangeListener listener);
-
- /**
- * Remove a listener to a certain property.
- * @param prop the name of the property being listened on
- * @param listener the listener listening on the property.
- */
- void removePropertyChangeListener(String prop, PropertyChangeListener listener);
-
- /**
- * Add a listener that will be notified when a specific property
- * change is requested (a PropertyVetoException may be thrown) as
- * well as after the change is successfully made.
- *
- * @param prop the name of the property to listen on
- * @param listener the listener to listen on the property.
- */
- void addVetoableChangeListener(String prop, VetoableChangeListener listener);
-
- /**
- * Remove a listener to a certain property.
- * @param prop the name of the property being listened on
- * @param listener the listener listening on the property.
- */
- void removeVetoableChangeListener(String prop, VetoableChangeListener listener);
-}
diff --git a/libjava/java/beans/beancontext/BeanContextChildComponentProxy.java b/libjava/java/beans/beancontext/BeanContextChildComponentProxy.java
deleted file mode 100644
index a8d6e34045e..00000000000
--- a/libjava/java/beans/beancontext/BeanContextChildComponentProxy.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* java.beans.beancontext.BeanContextChildComponentProxy
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.awt.Component;
-
-/**
- * Interface for <code>BeanContextChild</code>s which wish to associate an
- * AWT component with them. The proxy is provided because the
- * <code>addPropertyChangeListener()</code> method would conflict with
- * <code>Component</code> if you tried to extend.
- *
- * @author John Keiser
- * @since JDK1.2
- */
-
-public interface BeanContextChildComponentProxy {
- /**
- * Get the <code>Component</code> associated with this <code>BeanContextChild</code>.
- * @return the <code>Component</code> associated with this
- * <code>BeanContextChild</code>.
- */
- Component getComponent();
-}
diff --git a/libjava/java/beans/beancontext/BeanContextChildSupport.java b/libjava/java/beans/beancontext/BeanContextChildSupport.java
deleted file mode 100644
index 4444ad71377..00000000000
--- a/libjava/java/beans/beancontext/BeanContextChildSupport.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/* java.beans.beancontext.BeanContextChildSupport
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.beans.PropertyVetoException;
-import java.beans.VetoableChangeListener;
-import java.beans.VetoableChangeSupport;
-import java.io.Serializable;
-
-/**
- * Support for creating a <code>BeanContextChild</code>.
- * This class contains the most common implementations of the methods in
- * the <code>BeanContextChild</code>
- *
- * @specnote This class is not very well specified. I had to "fill in the
- * blanks" in most places with what I thought was reasonable
- * behavior. If there are problems, let me know.
- *
- * @author John Keiser
- * @since 1.2
- * @see java.beans.beancontext.BeanContextChild
- */
-public class BeanContextChildSupport
- implements BeanContextChild, BeanContextServicesListener, Serializable
-{
- static final long serialVersionUID = 6328947014421475877L;
-
- /**
- * The peer on which to perform <code>set</code> actions.
- * This is here so that this class can be used as a peer.
- * <P>
- *
- * When extending this class, this variable will be set to
- * <code>this</code>.
- */
- public BeanContextChild beanContextChildPeer;
-
- /**
- * The parent <code>BeanContext</code>.
- */
- protected transient BeanContext beanContext;
-
- /**
- * If <code>setBeanContext()</code> was vetoed once before, this
- * is set to <code>true</code> so that the next time, vetoes will
- * be ignored.
- */
- protected transient boolean rejectedSetBCOnce;
-
- /**
- * Listeners are registered here and events are fired through here.
- */
- protected PropertyChangeSupport pcSupport;
-
- /**
- * Listeners are registered here and events are fired through here.
- */
- protected VetoableChangeSupport vcSupport;
-
- /**
- * Create a new <code>BeanContextChildSupport</code> with itself as the peer.
- * This is meant to be used when you subclass
- * <code>BeanContextChildSupport</code> to create your child.
- */
- public BeanContextChildSupport()
- {
- this (null);
- }
-
- /**
- * Create a new <code>BeanContextChildSupport</code> with the specified peer.
- * @param peer the peer to use, or <code>null</code> to specify
- * <code>this</code>.
- */
- public BeanContextChildSupport (BeanContextChild peer)
- {
- if (peer == null)
- {
- peer = this;
- }
-
- beanContextChildPeer = peer;
- pcSupport = new PropertyChangeSupport (peer);
- vcSupport = new VetoableChangeSupport (peer);
- }
-
- /**
- * Set the parent <code>BeanContext</code>.
- * <P>
- *
- * When this Object is being added to a new BeanContext or moved
- * from an old one, a non-null value will be passed in.
- * <P>
- *
- * When this Object is being removed from the current
- * <code>BeanContext</code>, <code>setBeanContext()</code> will
- * receive the parameter <code>null</code>.
- * <P>
- *
- * Order of events:
- * <OL>
- * <LI>
- * If the new <code>BeanContext</code> is the same as the old
- * one, nothing happens.
- * </LI>
- * <LI>
- * If the change has not been rejected or vetoed before, call
- * <code>validatePendingSetBeanContext()</code>. If this call
- * returns <code>false</code>, the change is rejected and a
- * <code>PropertyVetoException</code> is thrown.
- * </LI>
- * <LI>
- * If the change has not been rejected or vetoed before,
- * <code>VetoableChangeEvent</code>s are fired with the name
- * <code>"beanContext"</code>, using the
- * <code>fireVetoableChange()</code> method. If a veto
- * occurs, reversion events are fired using the same method,
- * the change is rejected, and the veto is rethrown.
- * </LI>
- * <LI>
- * <code>releaseBeanContextResources()</code> is called.
- * </LI>
- * <LI>
- * The change is made.
- * </LI>
- * <LI>
- * <code>PropertyChangeEvent</code>s are fired using the
- * <code>firePropertyChange()</code> method.
- * </LI>
- * <LI>
- * <code>initializeBeanContextResources()</code> is called.
- * </LI>
- * </OL>
- * <P>
- *
- * @param newBeanContext the new parent for the
- * <code>BeanContextChild</code>, or <code>null</code> to
- * signify removal from a tree.
- * @exception PropertyVetoException if the
- * <code>BeanContextChild</code> implementor does not
- * wish to have its parent changed.
- */
- public void setBeanContext(BeanContext newBeanContext)
- throws PropertyVetoException
- {
- synchronized (beanContextChildPeer)
- {
- if (newBeanContext == beanContext)
- return;
-
- if (!rejectedSetBCOnce)
- {
- if (!validatePendingSetBeanContext (newBeanContext))
- {
- rejectedSetBCOnce = true;
- throw new PropertyVetoException ("validatePendingSetBeanContext() rejected change",
- new PropertyChangeEvent(beanContextChildPeer, "beanContext", beanContext, newBeanContext));
- }
-
- try
- {
- fireVetoableChange ("beanContext", beanContext, newBeanContext);
- }
- catch (PropertyVetoException e)
- {
- rejectedSetBCOnce = true;
- throw e;
- }
- }
-
- releaseBeanContextResources ();
-
- beanContext = newBeanContext;
- rejectedSetBCOnce = false;
-
- firePropertyChange ("beanContext", beanContext, newBeanContext);
-
- initializeBeanContextResources ();
- }
- }
-
- /**
- * Get the parent <code>BeanContext</code>.
- * @return the parent <code>BeanContext</code>.
- */
- public BeanContext getBeanContext()
- {
- return beanContext;
- }
-
- /**
- * Get the peer (or <code>this</code> if there is no peer).
- * @return the peer, or <code>this</code> if there is no peer.
- */
- public BeanContextChild getBeanContextChildPeer() {
- return beanContextChildPeer;
- }
-
- /**
- * Determine whether there is a peer.
- * This is true iff <code>getBeanContextChildPeer() == this</code>.
- * @return whether there is a peer.
- */
- public boolean isDelegated() {
- return beanContextChildPeer == this;
- }
-
- /**
- * Add a listener that will be notified when a specific property changes.
- * @param propertyName the name of the property to listen on.
- * @param listener the listener to listen on the property.
- */
- public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- pcSupport.addPropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Remove a listener to a certain property.
- *
- * @param propertyName the name of the property being listened on.
- * @param listener the listener listening on the property.
- */
- public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- pcSupport.removePropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Add a listener that will be notified when a specific property
- * change is requested (a PropertyVetoException may be thrown) as
- * well as after the change is successfully made.
- *
- * @param propertyName the name of the property to listen on.
- * @param listener the listener to listen on the property.
- */
- public void addVetoableChangeListener(String propertyName, VetoableChangeListener listener) {
- vcSupport.addVetoableChangeListener(propertyName, listener);
- }
-
- /**
- * Remove a listener to a certain property.
- *
- * @param propertyName the name of the property being listened on
- * @param listener the listener listening on the property.
- */
- public void removeVetoableChangeListener(String propertyName, VetoableChangeListener listener) {
- vcSupport.removeVetoableChangeListener(propertyName, listener);
- }
-
- /**
- * Fire a property change.
- *
- * @param propertyName the name of the property that changed
- * @param oldVal the old value of the property
- * @param newVal the new value of the property
- */
- public void firePropertyChange(String propertyName, Object oldVal, Object newVal) {
- pcSupport.firePropertyChange(propertyName, oldVal, newVal);
- }
-
- /**
- * Fire a vetoable property change.
- *
- * @param propertyName the name of the property that changed
- * @param oldVal the old value of the property
- * @param newVal the new value of the property
- * @exception PropertyVetoException if the change is vetoed.
- */
- public void fireVetoableChange(String propertyName, Object oldVal, Object newVal)
- throws PropertyVetoException {
- vcSupport.fireVetoableChange(propertyName, oldVal, newVal);
- }
-
- /**
- * Called by <code>BeanContextServices.revokeService()</code> to indicate that a service has been revoked.
- * If you have a reference to such a service, it should be
- * discarded and may no longer function properly.
- * <code>getService()</code> will no longer work on the specified
- * service class after this event has been fired.
- * <P>
- *
- * <EM>This method is meant to be overriden.</EM>
- * <code>BeanContextChildSupport</code>'s implementation does
- * nothing.
- *
- * @param event the service revoked event.
- * @see java.beans.beancontext.BeanContextServices#revokeService(java.lang.Class,java.beans.beancontext.BeanContextServiceProvider,boolean)
- */
- public void serviceRevoked(BeanContextServiceRevokedEvent event) {
- }
-
- /**
- * Called by <code>BeanContextServices</code> whenever a service is made available.
- * <P>
- *
- * <EM>This method is meant to be overriden.</EM>
- * <code>BeanContextChildSupport</code>'s implementation does
- * nothing.
- *
- * @param event the service revoked event, with useful information
- * about the new service.
- */
- public void serviceAvailable(BeanContextServiceAvailableEvent event) {
- }
-
- /**
- * Called by <code>setBeanContext()</code> to determine whether the set should be rejected.
- * <P>
- *
- * <EM>This method is meant to be overriden.</EM>
- * <code>BeanContextChildSupport</code>'s implementation simply
- * returns <code>true</code>.
- *
- * @param newBeanContext the new parent.
- * @return whether to allow the parent to be changed to the new
- * value.
- */
- public boolean validatePendingSetBeanContext(BeanContext newBeanContext) {
- return true;
- }
-
- /**
- * Called by <code>setBeanContext()</code> to release resources of a what will soon no longer be the parent.
- * <P>
- *
- * <EM>This method is meant to be overriden.</EM>
- * <code>BeanContextChildSupport</code>'s implementation does
- * nothing.
- */
- protected void releaseBeanContextResources() {
- }
-
- /**
- * Called by <code>setBeanContext()</code> to grab resources when the parent has been set.
- * <P>
- *
- * <EM>This method is meant to be overriden.</EM>
- * <code>BeanContextChildSupport</code>'s implementation does
- * nothing.
- */
- protected void initializeBeanContextResources() {
- }
-}
diff --git a/libjava/java/beans/beancontext/BeanContextContainerProxy.java b/libjava/java/beans/beancontext/BeanContextContainerProxy.java
deleted file mode 100644
index 3df91038bfe..00000000000
--- a/libjava/java/beans/beancontext/BeanContextContainerProxy.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* java.beans.beancontext.BeanContextContainerProxy
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.awt.Container;
-
-/**
- * Interface for <code>BeanContext</code>s which wish to associate an
- * AWT container with them. The proxy is provided because the
- * <code>addPropertyChangeListener()</code> and <code>add()</code> methods
- * would conflict with <code>Component</code> and <code>Container</code>
- * if you tried to extend.
- *
- * @specnote It is unclear whether anything besides <code>BeanContext</code>s
- * are allowed to implement this interface.
- * @author John Keiser
- * @since JDK1.2
- */
-
-public interface BeanContextContainerProxy {
- /**
- * Get the <code>Container</code> associated with this <code>BeanContext</code>.
- * @return the <code>Container</code> associated with this
- * <code>BeanContext</code>.
- */
- Container getContainer();
-}
diff --git a/libjava/java/beans/beancontext/BeanContextEvent.java b/libjava/java/beans/beancontext/BeanContextEvent.java
deleted file mode 100644
index f326541b034..00000000000
--- a/libjava/java/beans/beancontext/BeanContextEvent.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/* java.beans.beancontext.BeanContextEvent
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.util.EventObject;
-
-/**
- * Generic superclass for events fired by <code>BeanContext</code>s.
- *
- * @author John Keiser
- * @since 1.2
- */
-
-public abstract class BeanContextEvent extends EventObject
-{
- private static final long serialVersionUID = 7267998073569045052L;
-
- /**
- * The <code>BeanContext</code> that most recently passed this
- * event on.
- */
- protected BeanContext propagatedFrom;
-
- /**
- * Create a new event, from the specified <code>BeanContext</code>.
- * <code>propagatedFrom</code> will be initialized to
- * <code>null</code>.
- *
- * @param source the source of the event.
- */
- protected BeanContextEvent(BeanContext source)
- {
- super(source);
- }
-
- /**
- * Get the <code>BeanContext</code> that originated this event.
- * @return the originator of this event.
- */
- public BeanContext getBeanContext()
- {
- return (BeanContext)getSource();
- }
-
- /**
- * Get the most recent propagator of this event.
- * If this value is <code>null</code>, you have received the event
- * straight from the source.
- *
- * @return the most recent propagator of this event.
- */
- public BeanContext getPropagatedFrom()
- {
- return propagatedFrom;
- }
-
- /**
- * Tell whether this event has been propagated.
- * @return <code>true</code> iff <code>getPropagatedFrom() != null</code>.
- */
- public boolean isPropagated()
- {
- return propagatedFrom != null;
- }
-
- /**
- * Set the most recent propagator of this event.
- * @param propagator the most recent propagator of this event.
- */
- public void setPropagatedFrom(BeanContext propagator)
- {
- propagatedFrom = propagator;
- }
-}
diff --git a/libjava/java/beans/beancontext/BeanContextMembershipEvent.java b/libjava/java/beans/beancontext/BeanContextMembershipEvent.java
deleted file mode 100644
index 31765426622..00000000000
--- a/libjava/java/beans/beancontext/BeanContextMembershipEvent.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* java.beans.beancontext.BeanContextMembershipEvent
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * Event fired when children are added to or removed from a <code>BeanContext</code>.
- * Whether they were added or removed depends entirely on which method
- * of the listener interface was called.
- *
- * @author John Keiser
- * @since 1.2
- * @see java.beans.beancontext.BeanContextMembershipListener
- */
-public class BeanContextMembershipEvent extends BeanContextEvent {
- /**
- * The children that were added or removed.
- */
- protected Collection children;
-
- /**
- * Create a new membership event.
- * @param context the event source.
- * @param children the children added to or removed from the source.
- */
- public BeanContextMembershipEvent(BeanContext context, Collection children) {
- super(context);
- this.children = children;
- }
-
- /**
- * Create a new membership event.
- * @param context the event source.
- * @param children the children added to or removed from the source.
- */
- public BeanContextMembershipEvent(BeanContext context, Object[] children) {
- super(context);
- this.children = Arrays.asList(children);
- }
-
- /**
- * The number of children removed or added.
- * @return the number of children removed or added.
- */
- public int size() {
- return children.size();
- }
-
- /**
- * An iterator that will step through all the children.
- * @return an iterator over all the children.
- */
- public Iterator iterator() {
- return children.iterator();
- }
-
- /**
- * An array of the children.
- * @return an array of the children.
- */
- public Object[] toArray() {
- return children.toArray();
- }
-
- /**
- * Tell whether the <code>Object</code> is one of the children added or removed.
- * @param child the child to check.
- * @return whether the <code>Object</code> is added or removed.
- */
- public boolean contains(Object child) {
- return children.contains(child);
- }
-}
diff --git a/libjava/java/beans/beancontext/BeanContextMembershipListener.java b/libjava/java/beans/beancontext/BeanContextMembershipListener.java
deleted file mode 100644
index d39c36c4b12..00000000000
--- a/libjava/java/beans/beancontext/BeanContextMembershipListener.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* java.beans.beancontext.BeanContextMembershipListener
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.util.EventListener;
-
-/**
- * This is the interface to which <code>BeanContextMembershipEvent</code>s are sent.
- * This happens when children are added to or removed from a
- * <code>BeanContext</code>.
- *
- * @author John Keiser
- * @since JDK1.2
- */
-
-public interface BeanContextMembershipListener extends EventListener {
- /**
- * When beans are added to a <code>BeanContext</code>,
- * this method is called to fire the event.
- *
- * @param event the event, including which children were added.
- * @see java.beans.beancontext.BeanContext#add(java.lang.Object)
- */
- void childrenAdded(BeanContextMembershipEvent event);
-
- /**
- * When beans are removed from a <code>BeanContext</code>,
- * this method is called to fire the event.
- *
- * @param event the event, including which children were removed.
- * @see java.beans.beancontext.BeanContext#remove(java.lang.Object)
- */
- void childrenRemoved(BeanContextMembershipEvent event);
-}
diff --git a/libjava/java/beans/beancontext/BeanContextProxy.java b/libjava/java/beans/beancontext/BeanContextProxy.java
deleted file mode 100644
index 49dd7a77f30..00000000000
--- a/libjava/java/beans/beancontext/BeanContextProxy.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* java.beans.beancontext.BeanContextProxy
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-/**
- * Beans that wish to have a <code>BeanContextChild</code> or <code>BeanContext</code> associated with them
- * but do not wish to implement those interfaces directly, can implement this interface.
- * <P>
- *
- * Don't shoot yourself in the foot: if you already implement
- * <code>BeanContextChild</code>, directly or indirectly, the whole
- * workings of this package will be unpredictable because it is
- * indeterminate as to whether the <code>BeanContextChild</code> is used
- * in preference to its proxy or vice versa.
- *
- * @author John Keiser
- * @since JDK1.2
- */
-
-public interface BeanContextProxy {
- /**
- * Return the <code>BeanContextChild</code> associated with this
- * <code>Object</code>.
- *
- * @return the <code>BeanContextChild</code> associated with this
- * <code>Object</code>.
- */
- BeanContextChild getBeanContextProxy();
-}
diff --git a/libjava/java/beans/beancontext/BeanContextServiceAvailableEvent.java b/libjava/java/beans/beancontext/BeanContextServiceAvailableEvent.java
deleted file mode 100644
index eea10f261b6..00000000000
--- a/libjava/java/beans/beancontext/BeanContextServiceAvailableEvent.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* java.beans.beancontext.BeanContextServiceAvailableEvent
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.util.Iterator;
-
-/**
- * Event fired when new services become available through a <code>BeanContextServices</code>.
- *
- * @author John Keiser
- * @since JDK1.2
- * @see java.beans.beancontext.BeanContextServicesListener
- */
-
-public class BeanContextServiceAvailableEvent extends BeanContextEvent {
- /**
- * The <code>Class</code> representing the service which is now
- * available.
- */
- protected Class serviceClass;
-
- /**
- * Create a new service available event.
- * @param services the <code>BeanContextServices</code> through
- * which the service is available. This is also the source
- * of the event.
- * @param serviceClass the service class that is now available.
- */
- public BeanContextServiceAvailableEvent(BeanContextServices services, Class serviceClass) {
- super(services);
- this.serviceClass = serviceClass;
- }
-
- /**
- * Get the current service selectors of the service class.
- * This is identical to <code>getSourceAsBeanContextServices().getCurrentServiceSelectors(getServiceClass())</code>
- * @return the current service selectors of the service class.
- */
- public Iterator getCurrentServiceSelectors() {
- return getSourceAsBeanContextServices().getCurrentServiceSelectors(serviceClass);
- }
-
- /**
- * Get the newly available service class.
- * @return the service class.
- */
- public Class getServiceClass() {
- return serviceClass;
- }
-
- /**
- * Get the <code>BeanContextServices</code> through which the new service is available.
- * @return the <code>BeanContextServices</code> through which the
- * new service is available.
- */
- public BeanContextServices getSourceAsBeanContextServices() {
- return (BeanContextServices)getSource();
- }
-}
diff --git a/libjava/java/beans/beancontext/BeanContextServiceProvider.java b/libjava/java/beans/beancontext/BeanContextServiceProvider.java
deleted file mode 100644
index c09b5815fd7..00000000000
--- a/libjava/java/beans/beancontext/BeanContextServiceProvider.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* java.beans.beancontext.BeanContextServiceProvider
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.util.Iterator;
-
-/**
- * An actual factory for services.
- * <P>
- *
- * It is the <code>BeanContextServiceProvider</code>'s responsibility to
- * register itself with whatever <code>BeanContextServices</code> object
- * it wishes to provide services through using the
- * <code>addService()</code> method.
- * <P>
- *
- * If for some reason it can no longer provide services for a particular
- * class, this class must invoke
- * <code>BeanContextServices.revokeService(serviceClass,this,true)</code>
- * for all the places it has registered the service.
- *
- * @author John Keiser
- * @since JDK1.2
- */
-
-public interface BeanContextServiceProvider {
- /**
- * Get a service.
- * Called from <code>BeanContextServices.getService()</code>.
- *
- * <p>If the requested service class is not available, or if this
- * <code>BeanContextServiceProvider</code> chooses not honor the
- * request for some reason, then this method will return
- * <code>null</code>.</p>
- *
- * This method may throw unchecked exceptions, so watch out.
- *
- * @param services the <code>BeanContextServices</code> that wants
- * to get the service. Only weak references to this will
- * be retained, and it will never be changed, only queried
- * in a read-only manner.
- * @param requestor the actual requestor of the service. Only
- * weak references to this will be retained, and it will
- * never be changed, only queried in a read-only manner.
- * @param serviceClass the <code>Class</code> of the service being
- * requested.
- * @param serviceSelector a parameter to customize the service
- * returned with.
- * @return an instance of <code>serviceClass</code> (such that
- * <code>instanceof</code> serviceClass is true), or
- * <code>null</code>.
- * @see java.beans.beancontext.BeanContextServices#getService(java.beans.beancontext.BeanContextChild,java.lang.Object,java.lang.Class,java.lang.Object,java.beans.beancontext.BeanContextServiceRevokedListener)
- */
- Object getService(BeanContextServices services, Object requestor, Class serviceClass, Object serviceSelector);
-
- /**
- * Release the service.
- * <P>
- *
- * Called by <code>BeanContextServices.releaseService()</code>.
- * <P>
- *
- * Most <code>BeanContextServiceProvider</code>s won't have to do
- * anything here.
- *
- * @param services the <code>BeanContextServices</code> that wants
- * to release the service. Only weak references to this will
- * be retained, and it will never be changed, only queried
- * in a read-only manner.
- * @param requestor the original requestor of the service.
- * @param service the service to relinquish
- * @see java.beans.beancontext.BeanContextServices#releaseService(java.beans.beancontext.BeanContextChild,java.lang.Object,java.lang.Object)
- */
- void releaseService(BeanContextServices services, Object requestor, Object service);
-
- /**
- * Get a list of valid service selectors for the specified service class.
- * This method is called from
- * <code>BeanContextServices.getCurrentServiceSelectors()</code>.
- * <P>
- *
- * If the specified service class does not have a finite number of
- * valid service selectors, it should return <code>null</code>.
- * If it takes a general <code>Integer</code> parameter, for
- * example, you may as well return <code>null</code> or the poor
- * soul who called this method will be iterating all day.
- * <P>
- *
- * If it has no valid service selectors, it should still return an empty
- * <code>Iterator</code>.
- *
- * @param services the <code>BeanContextServices</code> that wants
- * to get the service selectors. Only weak references to this will
- * be retained, and it will never be changed, only queried
- * in a read-only manner.
- * @param serviceClass the service class to get selectors for.
- * @return a list of valid service selectors for the service
- * class, or <code>null</code>.
- * @see java.beans.beancontext.BeanContextServices#getCurrentServiceSelectors(java.lang.Class)
- */
- Iterator getCurrentServiceSelectors(BeanContextServices services, Class serviceClass);
-}
diff --git a/libjava/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java b/libjava/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java
deleted file mode 100644
index 690b94e2cc7..00000000000
--- a/libjava/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* java.beans.beancontext.BeanContextServiceProviderBeanInfo
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.beans.BeanInfo;
-
-/**
- * <code>BeanContextServiceProvider</code>s implement this to provide information about all of the services they provide.
- * <P>
- *
- * This is apparently so that you can import a bunch of services into a
- * RAD tool and it will know about all of them and export them to the
- * user in a readable manner.
- *
- * @author John Keiser
- * @since JDK1.2
- */
-public interface BeanContextServiceProviderBeanInfo extends BeanInfo {
- /**
- * Get <code>BeanInfo</code>s for all of the service classes of this <code>BeanInfoServiceProvider</code>.
- * @return <code>BeanInfo</code>s for all provided service classes.
- */
- BeanInfo[] getServicesBeanInfo();
-}
diff --git a/libjava/java/beans/beancontext/BeanContextServiceRevokedEvent.java b/libjava/java/beans/beancontext/BeanContextServiceRevokedEvent.java
deleted file mode 100644
index dfa2b89b3ae..00000000000
--- a/libjava/java/beans/beancontext/BeanContextServiceRevokedEvent.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/* java.beans.beancontext.BeanContextServiceRevokedEvent
- Copyright (C) 1999, 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-/**
- * Event fired when services are revoked from a <code>BeanContextServices</code>.
- *
- * @author John Keiser
- * @since JDK1.2
- * @see java.beans.beancontext.BeanContextServiceRevokedListener
- */
-
-public class BeanContextServiceRevokedEvent extends BeanContextEvent {
- /**
- * The <code>Class</code> representing the service which is now
- * available.
- */
- protected Class serviceClass;
- private boolean invalidateRefs;
-
- /**
- * Create a new service revoked event.
- * @param services the <code>BeanContextServices</code> through
- * which the service was available. This is also the source
- * of the event.
- * @param serviceClass the service class that is now revoked.
- * @param revokeNow whether the revocation is immediate for all
- * classes or just a suggestion.
- */
- public BeanContextServiceRevokedEvent(BeanContextServices services, Class serviceClass, boolean revokeNow) {
- super(services);
- this.serviceClass = serviceClass;
- invalidateRefs = revokeNow;
- }
-
- /**
- * Get the revoked service class.
- * @return the service class.
- */
- public Class getServiceClass() {
- return serviceClass;
- }
-
- /**
- * Tell whether the revoked service class is the same as the specified class.
- * Identical to <code>getServiceClass().equals(c)</code>.
- * @param c the class to compare.
- * @return whether the clases are equal.
- */
- public boolean isServiceClass(Class c) {
- return serviceClass.equals(c);
- }
-
- /**
- * Get the <code>BeanContextServices</code> through which the service was available.
- * @return the <code>BeanContextServices</code> through which the
- * service was available.
- */
- public BeanContextServices getSourceAsBeanContextServices() {
- return (BeanContextServices)getSource();
- }
-
- /**
- * Tell whether current instances of the revoked service are usable or not.
- * This is determined by whether the service was revoked
- * immediately.
- *
- * @return whether current instances of the revoked service are
- * usable.
- */
- public boolean isCurrentServiceInvalidNow() {
- return invalidateRefs;
- }
-}
diff --git a/libjava/java/beans/beancontext/BeanContextServiceRevokedListener.java b/libjava/java/beans/beancontext/BeanContextServiceRevokedListener.java
deleted file mode 100644
index 101e6e191b0..00000000000
--- a/libjava/java/beans/beancontext/BeanContextServiceRevokedListener.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* java.beans.beancontext.BeanContextServiceRevokedListener
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.util.EventListener;
-
-/**
- * Listens for service revoke events.
- *
- * @author John Keiser
- * @since JDK1.2
- */
-
-public interface BeanContextServiceRevokedListener extends EventListener {
- /**
- * Called by <code>BeanContextServices.revokeService()</code> to indicate that a service has been revoked.
- * If you have a reference to such a service, it should be
- * discarded and may no longer function properly.
- * <code>getService()</code> will no longer work on the specified
- * service class after this event has been fired.
- *
- * @param event the service revoked event.
- * @see java.beans.beancontext.BeanContextServices#revokeService(java.lang.Class,java.beans.beancontext.BeanContextServiceProvider,boolean)
- */
- void serviceRevoked(BeanContextServiceRevokedEvent event);
-}
diff --git a/libjava/java/beans/beancontext/BeanContextServices.java b/libjava/java/beans/beancontext/BeanContextServices.java
deleted file mode 100644
index cb1950360af..00000000000
--- a/libjava/java/beans/beancontext/BeanContextServices.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/* java.beans.beancontext.BeanContextServices
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.util.Iterator;
-import java.util.TooManyListenersException;
-
-/**
- * Allows a <code>BeanContext</code> to provide services to its children.
- *
- * @specnote it is unclear whether a <code>BeanContextServices</code>
- * should delegate unhandled requests to parents. I assume so.
- * @author John Keiser
- * @since 1.2
- */
-
-public interface BeanContextServices
- extends BeanContext, BeanContextServicesListener
-{
- /**
- * Register a service to make it available to others.
- * This class may refuse to add the service based on whatever
- * information it can gather, including whether the service
- * provider is trusted.
- *
- * @param serviceClass the service class.
- * @param provider the factory that will actually provide the service.
- * @return whether the service was added or not.
- */
- boolean addService (Class serviceClass,
- BeanContextServiceProvider provider);
-
- /**
- * Make it so that no one else can use this service.
- * <P>
- *
- * If <code>revokeNow</code> is <code>false</code>, the only
- * effect of this method is to make all subsequent calls to
- * <code>getService()</code> on this service class fail.
- * <P>
- *
- * If it is <code>true</code>, a message is also sent out to all
- * listeners on the service and all references to it are released.
- *
- * @param serviceClass the service class to revoke.
- * @param provider the service provider providing the service class.
- * @param revokeNow whether to release all current references to
- * the service.
- */
- void revokeService (Class serviceClass,
- BeanContextServiceProvider provider,
- boolean revokeNow);
-
- /**
- * Release your copy of this service.
- * <P>
- *
- * If all copies of the service's class have been relinquished by
- * the requestor, the <code>BeanContextServiceRevokedListener</code>
- * previously registered by <code>getService()</code> will be
- * unregistered.
- *
- * @param requestorChild the original <code>BeanContextChild</code>
- * requesting the service.
- * @param requestor the original requestor of the service.
- * @param service the service to relinquish
- * @see #getService(java.beans.beancontext.BeanContextChild,java.lang.Object,java.lang.Class,java.lang.Object,java.beans.beancontext.BeanContextServiceRevokedListener)
- */
- void releaseService (BeanContextChild requestorChild, Object requestor,
- Object service);
-
- /**
- * Get a service from this <code>BeanContextServices</code>.
- * <P>
- *
- * The specified listener will be registered to receive a
- * revocation notice for the specified serviceClass. One
- * notification per service class per requestor object will be
- * sent.
- * <P>
- *
- * The listener will be unregistered when all services that were
- * obtained by that requestor for that service class are released.
- * <P>
- *
- * If the requested service class is not available, or if this
- * <code>BeanContextServices</code> object chooses not honor the
- * request because the service class has been revoked or for some
- * other reason, then this method will return <code>null</code>.
- * <P>
- *
- * This method may throw unchecked exceptions, so watch out.
- *
- * @specnote it is not specified what happens when two subsequent
- * calls are made to <code>getService()</code> with the
- * same requestor object and service class but different
- * listeners. Which listener is to be notified?
- *
- * @param requestorChild the <code>BeanContextChild</code>
- * associated with the requestor. Typically this will be
- * the same as the requestor itself, but since any
- * <code>Object</code>, even one outside the hierarchy, may
- * make a request, this parameter is necessary. Only weak
- * references to this will be retained, and it will never
- * be changed, only queried in a read-only manner.
- * @param requestor the actual requestor of the service. Only
- * weak references to this will be retained, and it will
- * never be changed, only queried in a read-only manner.
- * @param serviceClass the <code>Class</code> of the service being
- * requested.
- * @param serviceSelector a parameter to customize the service
- * returned with.
- * @param listener a listener that will be notified if the service
- * being requested is revoked.
- * @return an instance of <code>serviceClass</code> (such that
- * <code>instanceof</code> serviceClass is true), or
- * <code>null</code>.
- */
- Object getService (BeanContextChild requestorChild, Object requestor,
- Class serviceClass, Object serviceSelector,
- BeanContextServiceRevokedListener listener)
- throws TooManyListenersException;
-
- /**
- * Get a list of all service classes supported.
- * <P>
- *
- * This method must synchronize on
- * <code>BeanContext.globalHierarchyLock</code>.
- *
- * @return a list of all service classes supported.
- * @see java.beans.beancontext.BeanContext#globalHierarchyLock
- */
- Iterator getCurrentServiceClasses ();
-
- /**
- * Get a list of valid service selectors for the specified service class.
- * <P>
- *
- * If the specified service class does not have a finite number of
- * valid service selectors, it should return <code>null</code>.
- * If it takes a general <code>Integer</code> parameter, for
- * example, you may as well return <code>null</code> or the poor
- * soul who called this method will be iterating all day.
- * <P>
- *
- * If it has no valid service selectors, it should still return an empty
- * <code>Iterator</code>.
- *
- * @param serviceClass the service class to get selectors for.
- * @return a list of valid service selectors for the service
- * class, or <code>null</code>.
- */
- Iterator getCurrentServiceSelectors (Class serviceClass);
-
- /**
- * Tell whether the specified service class is available.
- * Iff getService() could return a non-null value for the
- * specified service, this method will return <code>true</code>.
- *
- * @param serviceClass the service class to check on.
- * @return whether the specified service class is available.
- */
- boolean hasService (Class serviceClass);
-
- /**
- * Add a listener on all adds and removes of services.
- * @param listener the listener to add.
- */
- void addBeanContextServicesListener (BeanContextServicesListener listener);
-
- /**
- * Remove a listener on all adds and removes of services.
- * @specnote it is not certain whether this should remove this
- * listener if it was specified in
- * <code>getService()</code>.
- * @param listener the listener to add.
- */
- void removeBeanContextServicesListener (BeanContextServicesListener listener);
-}
diff --git a/libjava/java/beans/beancontext/BeanContextServicesListener.java b/libjava/java/beans/beancontext/BeanContextServicesListener.java
deleted file mode 100644
index becc7cdb6e4..00000000000
--- a/libjava/java/beans/beancontext/BeanContextServicesListener.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* java.beans.beancontext.BeanContextServicesListener
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-/**
- * Listens for service add and revoke events.
- *
- * @author John Keiser
- * @since JDK1.2
- */
-
-public interface BeanContextServicesListener extends BeanContextServiceRevokedListener {
- /**
- * Called by <code>BeanContextServices</code> whenever a service is made available.
- *
- * @param event the service revoked event, with useful information
- * about the new service.
- */
- void serviceAvailable(BeanContextServiceAvailableEvent event);
-}
diff --git a/libjava/java/beans/beancontext/BeanContextServicesSupport.java b/libjava/java/beans/beancontext/BeanContextServicesSupport.java
deleted file mode 100644
index b7c4a49d8a9..00000000000
--- a/libjava/java/beans/beancontext/BeanContextServicesSupport.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/* BeanContextServicesSupport.java --
- Copyright (C) 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.TooManyListenersException;
-
-/**
- * @author Michael Koch
- * @since 1.2
- */
-public class BeanContextServicesSupport
- extends BeanContextSupport
- implements BeanContextServices
-{
- private static final long serialVersionUID = -8494482757288719206L;
-
- protected class BCSSChild
- extends BeanContextSupport.BCSChild
- {
- private static final long serialVersionUID = -6848044915271367103L;
- }
-
- protected class BCSSProxyServiceProvider
- implements BeanContextServiceProvider,
- BeanContextServiceRevokedListener
- {
- private static final long serialVersionUID = 7078212910685744490L;
-
- public Iterator getCurrentServiceSelectors (BeanContextServices bcs,
- Class serviceClass)
- {
- throw new Error ("Not implemented");
- }
-
- public Object getService (BeanContextServices bcs,
- Object requestor,
- Class serviceClass,
- Object serviceSelector)
- {
- throw new Error ("Not implemented");
- }
-
- public void releaseService (BeanContextServices bcs,
- Object requestor,
- Object service)
- {
- throw new Error ("Not implemented");
- }
-
- public void serviceRevoked (BeanContextServiceRevokedEvent bcsre)
- {
- throw new Error ("Not implemented");
- }
- }
-
- protected static class BCSSServiceProvider
- implements Serializable
- {
- private static final long serialVersionUID = 861278251667444782L;
-
- protected BeanContextServiceProvider serviceProvider;
-
- protected BeanContextServiceProvider getServiceProvider()
- {
- return serviceProvider;
- }
- }
-
- protected transient ArrayList bcsListeners;
-
- protected transient BCSSProxyServiceProvider proxy;
-
- protected transient int serializable;
-
- protected transient HashMap services;
-
- public BeanContextServicesSupport ()
- {
- super();
- }
-
- public BeanContextServicesSupport (BeanContextServices peer)
- {
- super(peer);
- }
-
- public BeanContextServicesSupport(BeanContextServices peer, Locale locale)
- {
- super(peer, locale);
- }
-
- public BeanContextServicesSupport(BeanContextServices peer, Locale locale,
- boolean dtime)
- {
- super(peer, locale, dtime);
- }
-
- public BeanContextServicesSupport(BeanContextServices peer, Locale locale,
- boolean dtime, boolean visible)
- {
- super(peer, locale, dtime, visible);
- }
-
- public void addBeanContextServicesListener
- (BeanContextServicesListener listener)
- {
- if (! bcsListeners.contains(listener))
- bcsListeners.add(listener);
- }
-
- public boolean addService (Class serviceClass, BeanContextServiceProvider bcsp)
- {
- throw new Error ("Not implemented");
- }
-
- protected boolean addService (Class serviceClass,
- BeanContextServiceProvider bcsp,
- boolean fireEvent)
- {
- throw new Error ("Not implemented");
- }
-
- protected void bcsPreDeserializationHook (ObjectInputStream ois)
- throws ClassNotFoundException, IOException
- {
- throw new Error ("Not implemented");
- }
-
- protected void bcsPreSerializationHook (ObjectOutputStream oos)
- throws IOException
- {
- throw new Error ("Not implemented");
- }
-
- protected void childJustRemovedHook (Object child,
- BeanContextSupport.BCSChild bcsc)
- {
- throw new Error ("Not implemented");
- }
-
- protected BeanContextSupport.BCSChild createBCSChild (Object targetChild,
- Object peer)
- {
- throw new Error ("Not implemented");
- }
-
- protected BeanContextServicesSupport.BCSSServiceProvider
- createBCSSServiceProvider (Class sc, BeanContextServiceProvider bcsp)
- {
- throw new Error ("Not implemented");
- }
-
- protected final void fireServiceAdded (BeanContextServiceAvailableEvent bcssae)
- {
- throw new Error ("Not implemented");
- }
-
- protected final void fireServiceAdded (Class serviceClass)
- {
- throw new Error ("Not implemented");
- }
-
- protected final void fireServiceRevoked(BeanContextServiceRevokedEvent event)
- {
- throw new Error ("Not implemented");
- }
-
- protected final void fireServiceRevoked (Class serviceClass,
- boolean revokeNow)
- {
- throw new Error ("Not implemented");
- }
-
- public BeanContextServices getBeanContextServicesPeer ()
- {
- throw new Error ("Not implemented");
- }
-
- protected static final BeanContextServicesListener
- getChildBeanContextServicesListener (Object child)
- {
- throw new Error ("Not implemented");
- }
-
- public Iterator getCurrentServiceClasses ()
- {
- throw new Error ("Not implemented");
- }
-
- public Iterator getCurrentServiceSelectors (Class serviceClass)
- {
- throw new Error ("Not implemented");
- }
-
- public Object getService (BeanContextChild child, Object requestor,
- Class serviceClass, Object serviceSelector,
- BeanContextServiceRevokedListener bcsrl)
- throws TooManyListenersException
- {
- throw new Error ("Not implemented");
- }
-
- public boolean hasService (Class serviceClass)
- {
- throw new Error ("Not implemented");
- }
-
- public void initialize ()
- {
- super.initialize();
-
- bcsListeners = new ArrayList();
- services = new HashMap();
- }
-
- protected void initializeBeanContextResources ()
- {
- throw new Error ("Not implemented");
- }
-
- protected void releaseBeanContextResources ()
- {
- throw new Error ("Not implemented");
- }
-
- public void releaseService (BeanContextChild child, Object requestor,
- Object service)
- {
- throw new Error ("Not implemented");
- }
-
- public void removeBeanContextServicesListener
- (BeanContextServicesListener listener)
- {
- int index = bcsListeners.indexOf(listener);
-
- if (index > -1)
- bcsListeners.remove(index);
- }
-
- public void revokeService (Class serviceClass, BeanContextServiceProvider bcsp,
- boolean revokeCurrentServicesNow)
- {
- throw new Error ("Not implemented");
- }
-
- public void serviceAvailable (BeanContextServiceAvailableEvent bcssae)
- {
- throw new Error ("Not implemented");
- }
-
- public void serviceRevoked (BeanContextServiceRevokedEvent bcssre)
- {
- throw new Error ("Not implemented");
- }
-}
diff --git a/libjava/java/beans/beancontext/BeanContextSupport.java b/libjava/java/beans/beancontext/BeanContextSupport.java
deleted file mode 100644
index 7e024e23a13..00000000000
--- a/libjava/java/beans/beancontext/BeanContextSupport.java
+++ /dev/null
@@ -1,460 +0,0 @@
-/* BeanContextSupport.java --
- Copyright (C) 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.beans.beancontext;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
-import java.beans.VetoableChangeListener;
-import java.beans.Visibility;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-
-/**
- * @author Michael Koch
- * @since 1.2
- */
-public class BeanContextSupport extends BeanContextChildSupport
- implements BeanContext, Serializable, PropertyChangeListener,
- VetoableChangeListener
-{
- private static final long serialVersionUID = -4879613978649577204L;
-
- private void readObject (ObjectInputStream s)
- throws ClassNotFoundException, IOException
- {
- throw new Error ("Not implemented");
- }
-
- private void writeObject (ObjectOutputStream s)
- throws ClassNotFoundException, IOException
- {
- throw new Error ("Not implemented");
- }
-
- protected class BCSChild implements Serializable
- {
- private static final long serialVersionUID = 3289144128843950629L;
- }
-
- protected static final class BCSIterator implements Iterator
- {
- public boolean hasNext ()
- {
- throw new Error ("Not implemented");
- }
-
- public Object next ()
- {
- throw new Error ("Not implemented");
- }
-
- public void remove ()
- {
- // This must be a noop remove operation.
- }
- }
-
- protected transient ArrayList bcmListeners;
-
- protected transient HashMap children;
-
- protected transient boolean designTime;
-
- protected transient Locale locale;
-
- protected transient boolean okToUseGui;
-
- /**
- * Construct a BeanContextSupport instance.
- */
- public BeanContextSupport ()
- {
- this (null, null, true, true);
- }
-
- /**
- * Construct a BeanContextSupport instance.
- */
- public BeanContextSupport (BeanContext peer)
- {
- this (peer, null, true, true);
- }
-
- /**
- * Construct a BeanContextSupport instance.
- */
- public BeanContextSupport (BeanContext peer, Locale lcle)
- {
- this (peer, lcle, true, true);
- }
-
- /**
- * Construct a BeanContextSupport instance.
- */
- public BeanContextSupport (BeanContext peer, Locale lcle, boolean dtime)
- {
- this (peer, lcle, dtime, true);
- }
-
- /**
- * Construct a BeanContextSupport instance.
- */
- public BeanContextSupport (BeanContext peer, Locale lcle, boolean dtime,
- boolean visible)
- {
- locale = lcle;
- designTime = dtime;
- okToUseGui = visible;
-
- initialize ();
- }
-
- public boolean add (Object targetChild)
- {
- if (targetChild == null)
- throw new IllegalArgumentException();
-
- if (children.containsKey(targetChild))
- return false;
-
- // FIXME: The second argument is surely wrong.
- children.put(targetChild, targetChild);
- return true;
- }
-
- public boolean addAll (Collection c)
- {
- throw new UnsupportedOperationException();
- }
-
- public void addBeanContextMembershipListener
- (BeanContextMembershipListener listener)
- {
- if (! bcmListeners.contains(listener))
- bcmListeners.add(listener);
- }
-
- public boolean avoidingGui ()
- {
- throw new Error ("Not implemented");
- }
-
- protected Iterator bcsChildren ()
- {
- throw new Error ("Not implemented");
- }
-
- protected void bcsPreDeserializationHook (ObjectInputStream ois)
- throws ClassNotFoundException, IOException
- {
- throw new Error ("Not implemented");
- }
-
- protected void bcsPreSerializationHook (ObjectOutputStream oos)
- throws IOException
- {
- throw new Error ("Not implemented");
- }
-
- protected void childDeserializedHook (Object child, BeanContextSupport.BCSChild bcsc)
- {
- throw new Error ("Not implemented");
- }
-
- protected void childJustAddedHook (Object child, BeanContextSupport.BCSChild bcsc)
- {
- throw new Error ("Not implemented");
- }
-
- protected void childJustRemovedHook (Object child, BeanContextSupport.BCSChild bcsc)
- {
- throw new Error ("Not implemented");
- }
-
- protected static final boolean classEquals (Class first, Class second)
- {
- throw new Error ("Not implemented");
- }
-
- public void clear ()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean contains (Object o)
- {
- throw new Error ("Not implemented");
- }
-
- public boolean containsAll (Collection c)
- {
- throw new Error ("Not implemented");
- }
-
- public boolean containsKey (Object o)
- {
- throw new Error ("Not implemented");
- }
-
- protected final Object[] copyChildren ()
- {
- throw new Error ("Not implemented");
- }
-
- protected BeanContextSupport.BCSChild createBCSChild (Object targetChild, Object peer)
- {
- throw new Error ("Not implemented");
- }
-
- protected final void deserialize (ObjectInputStream ois, Collection coll)
- throws ClassNotFoundException, IOException
- {
- throw new Error ("Not implemented");
- }
-
- public void dontUseGui ()
- {
- throw new Error ("Not implemented");
- }
-
- protected final void fireChildrenAdded (BeanContextMembershipEvent bcme)
- {
- throw new Error ("Not implemented");
- }
-
- protected final void fireChildrenRemoved (BeanContextMembershipEvent bcme)
- {
- throw new Error ("Not implemented");
- }
-
- public BeanContext getBeanContextPeer ()
- {
- throw new Error ("Not implemented");
- }
-
- protected static final BeanContextChild getChildBeanContextChild (Object child)
- {
- throw new Error ("Not implemented");
- }
-
- protected static final BeanContextMembershipListener getChildBeanContextMembershipListener (Object child)
- {
- throw new Error ("Not implemented");
- }
-
- protected static final PropertyChangeListener getChildPropertyChangeListener (Object child)
- {
- throw new Error ("Not implemented");
- }
-
- protected static final Serializable getChildSerializable (Object child)
- {
- throw new Error ("Not implemented");
- }
-
- protected static final VetoableChangeListener getChildVetoableChangeListener (Object child)
- {
- throw new Error ("Not implemented");
- }
-
- protected static final Visibility getChildVisibility (Object child)
- {
- throw new Error ("Not implemented");
- }
-
- public Locale getLocale ()
- {
- return locale;
- }
-
- public URL getResource (String name, BeanContextChild bcc)
- {
- throw new Error ("Not implemented");
- }
-
- public InputStream getResourceAsStream (String name, BeanContextChild bcc)
- {
- throw new Error ("Not implemented");
- }
-
- protected void initialize ()
- {
- bcmListeners = new ArrayList();
- children = new HashMap();
- }
-
- public Object instantiateChild (String beanName)
- throws IOException, ClassNotFoundException
- {
- throw new Error ("Not implemented");
- }
-
- public boolean isDesignTime ()
- {
- throw new Error ("Not implemented");
- }
-
- public boolean isEmpty ()
- {
- throw new Error ("Not implemented");
- }
-
- public boolean isSerializing ()
- {
- throw new Error ("Not implemented");
- }
-
- public Iterator iterator ()
- {
- return children.keySet().iterator();
- }
-
- public boolean needsGui ()
- {
- throw new Error ("Not implemented");
- }
-
- public void okToUseGui ()
- {
- throw new Error ("Not implemented");
- }
-
- public void propertyChange (PropertyChangeEvent pce)
- {
- throw new Error ("Not implemented");
- }
-
- public final void readChildren (ObjectInputStream ois)
- throws IOException, ClassNotFoundException
- {
- throw new Error ("Not implemented");
- }
-
- public boolean remove (Object targetChild)
- {
- return remove(targetChild, true);
- }
-
- protected boolean remove (Object targetChild, boolean callChildSetBC)
- {
- if (targetChild == null)
- throw new IllegalArgumentException();
-
- throw new Error ("Not implemented");
- }
-
- public boolean removeAll (Collection c)
- {
- throw new UnsupportedOperationException();
- }
-
- public void removeBeanContextMembershipListener (BeanContextMembershipListener bcml)
- {
- throw new Error ("Not implemented");
- }
-
- public boolean retainAll (Collection c)
- {
- throw new UnsupportedOperationException();
- }
-
- protected final void serialize (ObjectOutputStream oos, Collection coll)
- throws IOException
- {
- throw new Error ("Not implemented");
- }
-
- public void setDesignTime (boolean dtime)
- {
- throw new Error ("Not implemented");
- }
-
- public void setLocale (Locale newLocale)
- throws PropertyVetoException
- {
- throw new Error ("Not implemented");
- }
-
- public int size ()
- {
- throw new Error ("Not implemented");
- }
-
- public Object[] toArray ()
- {
- return children.keySet().toArray();
- }
-
- public Object[] toArray(Object[] array)
- {
- return children.keySet().toArray(array);
- }
-
- protected boolean validatePendingAdd (Object targetChild)
- {
- throw new Error ("Not implemented");
- }
-
- protected boolean validatePendingRemove (Object targetChild)
- {
- throw new Error ("Not implemented");
- }
-
- public void vetoableChange (PropertyChangeEvent pce)
- throws PropertyVetoException
- {
- throw new Error ("Not implemented");
- }
-
- public final void writeChildren (ObjectOutputStream oos)
- throws IOException
- {
- throw new Error ("Not implemented");
- }
-}
diff --git a/libjava/java/io/BufferedOutputStream.java b/libjava/java/io/BufferedOutputStream.java
deleted file mode 100644
index ce7ebc7e938..00000000000
--- a/libjava/java/io/BufferedOutputStream.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/* BufferedOutputStream.java -- Buffer output into large blocks before writing
- Copyright (C) 1998, 2000, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This class accumulates bytes written in a buffer instead of immediately
- * writing the data to the underlying output sink. The bytes are instead
- * as one large block when the buffer is filled, or when the stream is
- * closed or explicitly flushed. This mode operation can provide a more
- * efficient mechanism for writing versus doing numerous small unbuffered
- * writes.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class BufferedOutputStream extends FilterOutputStream
-{
- /**
- * This is the default buffer size
- */
- private static final int DEFAULT_BUFFER_SIZE = 512;
-
- /**
- * This is the internal byte array used for buffering output before
- * writing it.
- */
- protected byte[] buf;
-
- /**
- * This is the number of bytes that are currently in the buffer and
- * are waiting to be written to the underlying stream. It always points to
- * the index into the buffer where the next byte of data will be stored
- */
- protected int count;
-
- /**
- * This method initializes a new <code>BufferedOutputStream</code> instance
- * that will write to the specified subordinate <code>OutputStream</code>
- * and which will use a default buffer size of 512 bytes.
- *
- * @param out The underlying <code>OutputStream</code> to write data to
- */
- public BufferedOutputStream(OutputStream out)
- {
- this(out, DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * This method initializes a new <code>BufferedOutputStream</code> instance
- * that will write to the specified subordinate <code>OutputStream</code>
- * and which will use the specified buffer size
- *
- * @param out The underlying <code>OutputStream</code> to write data to
- * @param size The size of the internal buffer
- */
- public BufferedOutputStream(OutputStream out, int size)
- {
- super(out);
-
- buf = new byte[size];
- }
-
- /**
- * This method causes any currently buffered bytes to be immediately
- * written to the underlying output stream.
- *
- * @exception IOException If an error occurs
- */
- public synchronized void flush() throws IOException
- {
- if (count == 0)
- return;
-
- out.write(buf, 0, count);
- count = 0;
- out.flush();
- }
-
- /**
- * This method flushes any remaining buffered bytes then closes the
- * underlying output stream. Any further attempts to write to this stream
- * may throw an exception
- *
- public synchronized void close() throws IOException
- {
- flush();
- out.close();
- }
- */
-
- /**
- * This method runs when the object is garbage collected. It is
- * responsible for ensuring that all buffered bytes are written and
- * for closing the underlying stream.
- *
- * @exception IOException If an error occurs (ignored by the Java runtime)
- *
- protected void finalize() throws IOException
- {
- close();
- }
- */
-
- /**
- * This method writes a single byte of data. This will be written to the
- * buffer instead of the underlying data source. However, if the buffer
- * is filled as a result of this write request, it will be flushed to the
- * underlying output stream.
- *
- * @param b The byte of data to be written, passed as an int
- *
- * @exception IOException If an error occurs
- */
- public synchronized void write(int b) throws IOException
- {
- if (count == buf.length)
- flush();
-
- buf[count] = (byte)(b & 0xFF);
- ++count;
- }
-
- /**
- * This method writes <code>len</code> bytes from the byte array
- * <code>buf</code> starting at position <code>offset</code> in the buffer.
- * These bytes will be written to the internal buffer. However, if this
- * write operation fills the buffer, the buffer will be flushed to the
- * underlying output stream.
- *
- * @param buf The array of bytes to write.
- * @param offset The index into the byte array to start writing from.
- * @param len The number of bytes to write.
- *
- * @exception IOException If an error occurs
- */
- public synchronized void write(byte[] buf, int offset, int len)
- throws IOException
- {
- // Buffer can hold everything. Note that the case where LEN < 0
- // is automatically handled by the downstream write.
- if (len < (this.buf.length - count))
- {
- System.arraycopy(buf, offset, this.buf, count, len);
- count += len;
- }
- else
- {
- // The write was too big. So flush the buffer and write the new
- // bytes directly to the underlying stream, per the JDK 1.2
- // docs.
- flush();
- out.write (buf, offset, len);
- }
- }
-
-} // class BufferedOutputStream
-
diff --git a/libjava/java/io/BufferedReader.java b/libjava/java/io/BufferedReader.java
deleted file mode 100644
index 4849949c989..00000000000
--- a/libjava/java/io/BufferedReader.java
+++ /dev/null
@@ -1,581 +0,0 @@
-/* BufferedReader.java
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct.
- */
-
-/**
- * This subclass of <code>FilterReader</code> buffers input from an
- * underlying implementation to provide a possibly more efficient read
- * mechanism. It maintains the buffer and buffer state in instance
- * variables that are available to subclasses. The default buffer size
- * of 8192 chars can be overridden by the creator of the stream.
- * <p>
- * This class also implements mark/reset functionality. It is capable
- * of remembering any number of input chars, to the limits of
- * system memory or the size of <code>Integer.MAX_VALUE</code>
- *
- * @author Per Bothner (bothner@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class BufferedReader extends Reader
-{
- Reader in;
- char[] buffer;
- /* Index of current read position. Must be >= 0 and <= limit. */
- /* There is a special case where pos may be equal to limit+1; this
- * is used as an indicator that a readLine was done with a '\r' was
- * the very last char in the buffer. Since we don't want to read-ahead
- * and potentially block, we set pos this way to indicate the situation
- * and deal with it later. Doing it this way rather than having a
- * separate boolean field to indicate the condition has the advantage
- * that it is self-clearing on things like mark/reset.
- */
- int pos;
- /* Limit of valid data in buffer. Must be >= pos and <= buffer.length. */
- /* This can be < pos in the one special case described above. */
- int limit;
-
- /* The value -1 means there is no mark, or the mark has been invalidated.
- Otherwise, markPos is the index in the buffer of the marked position.
- Must be >= 0 and <= pos.
- Note we do not explicitly store the read-limit.
- The implicit read-limit is (buffer.length - markPos), which is
- guaranteed to be >= the read-limit requested in the call to mark. */
- int markPos = -1;
-
- // The JCL book specifies the default buffer size as 8K characters.
- // This is package-private because it is used by LineNumberReader.
- static final int DEFAULT_BUFFER_SIZE = 8192;
-
- /**
- * The line buffer for <code>readLine</code>.
- */
- private StringBuffer sbuf = null;
-
- /**
- * Create a new <code>BufferedReader</code> that will read from the
- * specified subordinate stream with a default buffer size of 8192 chars.
- *
- * @param in The subordinate stream to read from
- */
- public BufferedReader(Reader in)
- {
- this(in, DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * Create a new <code>BufferedReader</code> that will read from the
- * specified subordinate stream with a buffer size that is specified by the
- * caller.
- *
- * @param in The subordinate stream to read from
- * @param size The buffer size to use
- *
- * @exception IllegalArgumentException if size &lt;= 0
- */
- public BufferedReader(Reader in, int size)
- {
- super(in.lock);
- if (size <= 0)
- throw new IllegalArgumentException("Illegal buffer size: " + size);
- this.in = in;
- buffer = new char[size];
- }
-
- /**
- * This method closes the underlying stream and frees any associated
- * resources.
- *
- * @exception IOException If an error occurs
- */
- public void close() throws IOException
- {
- synchronized (lock)
- {
- if (in != null)
- in.close();
- in = null;
- buffer = null;
- }
- }
-
- /**
- * Returns <code>true</code> to indicate that this class supports mark/reset
- * functionality.
- *
- * @return <code>true</code>
- */
- public boolean markSupported()
- {
- return true;
- }
-
- /**
- * Mark a position in the input to which the stream can be
- * "reset" by calling the <code>reset()</code> method. The parameter
- * <code>readLimit</code> is the number of chars that can be read from the
- * stream after setting the mark before the mark becomes invalid. For
- * example, if <code>mark()</code> is called with a read limit of 10, then
- * when 11 chars of data are read from the stream before the
- * <code>reset()</code> method is called, then the mark is invalid and the
- * stream object instance is not required to remember the mark.
- * <p>
- * Note that the number of chars that can be remembered by this method
- * can be greater than the size of the internal read buffer. It is also
- * not dependent on the subordinate stream supporting mark/reset
- * functionality.
- *
- * @param readLimit The number of chars that can be read before the mark
- * becomes invalid
- *
- * @exception IOException If an error occurs
- * @exception IllegalArgumentException if readLimit is negative.
- */
- public void mark(int readLimit) throws IOException
- {
- if (readLimit < 0)
- throw new IllegalArgumentException("Read-ahead limit is negative");
-
- synchronized (lock)
- {
- checkStatus();
- // In this method we need to be aware of the special case where
- // pos + 1 == limit. This indicates that a '\r' was the last char
- // in the buffer during a readLine. We'll want to maintain that
- // condition after we shift things around and if a larger buffer is
- // needed to track readLimit, we'll have to make it one element
- // larger to ensure we don't invalidate the mark too early, if the
- // char following the '\r' is NOT a '\n'. This is ok because, per
- // the spec, we are not required to invalidate when passing readLimit.
- //
- // Note that if 'pos > limit', then doing 'limit -= pos' will cause
- // limit to be negative. This is the only way limit will be < 0.
-
- if (pos + readLimit > limit)
- {
- char[] old_buffer = buffer;
- int extraBuffSpace = 0;
- if (pos > limit)
- extraBuffSpace = 1;
- if (readLimit + extraBuffSpace > limit)
- buffer = new char[readLimit + extraBuffSpace];
- limit -= pos;
- if (limit >= 0)
- {
- System.arraycopy(old_buffer, pos, buffer, 0, limit);
- pos = 0;
- }
- }
-
- if (limit < 0)
- {
- // Maintain the relationship of 'pos > limit'.
- pos = 1;
- limit = markPos = 0;
- }
- else
- markPos = pos;
- // Now pos + readLimit <= buffer.length. thus if we need to read
- // beyond buffer.length, then we are allowed to invalidate markPos.
- }
- }
-
- /**
- * Reset the stream to the point where the <code>mark()</code> method
- * was called. Any chars that were read after the mark point was set will
- * be re-read during subsequent reads.
- * <p>
- * This method will throw an IOException if the number of chars read from
- * the stream since the call to <code>mark()</code> exceeds the mark limit
- * passed when establishing the mark.
- *
- * @exception IOException If an error occurs;
- */
- public void reset() throws IOException
- {
- synchronized (lock)
- {
- checkStatus();
- if (markPos < 0)
- throw new IOException("mark never set or invalidated");
-
- // Need to handle the extremely unlikely case where a readLine was
- // done with a '\r' as the last char in the buffer; which was then
- // immediately followed by a mark and a reset with NO intervening
- // read of any sort. In that case, setting pos to markPos would
- // lose that info and a subsequent read would thus not skip a '\n'
- // (if one exists). The value of limit in this rare case is zero.
- // We can assume that if limit is zero for other reasons, then
- // pos is already set to zero and doesn't need to be readjusted.
- if (limit > 0)
- pos = markPos;
- }
- }
-
- /**
- * This method determines whether or not a stream is ready to be read. If
- * this method returns <code>false</code> then this stream could (but is
- * not guaranteed to) block on the next read attempt.
- *
- * @return <code>true</code> if this stream is ready to be read,
- * <code>false</code> otherwise
- *
- * @exception IOException If an error occurs
- */
- public boolean ready() throws IOException
- {
- synchronized (lock)
- {
- checkStatus();
- return pos < limit || in.ready();
- }
- }
-
- /**
- * This method read chars from a stream and stores them into a caller
- * supplied buffer. It starts storing the data at index
- * <code>offset</code> into
- * the buffer and attempts to read <code>len</code> chars. This method can
- * return before reading the number of chars requested. The actual number
- * of chars read is returned as an int. A -1 is returned to indicate the
- * end of the stream.
- * <p>
- * This method will block until some data can be read.
- *
- * @param buf The array into which the chars read should be stored
- * @param offset The offset into the array to start storing chars
- * @param count The requested number of chars to read
- *
- * @return The actual number of chars read, or -1 if end of stream.
- *
- * @exception IOException If an error occurs.
- * @exception IndexOutOfBoundsException If offset and count are not
- * valid regarding buf.
- */
- public int read(char[] buf, int offset, int count) throws IOException
- {
- if (offset < 0 || offset + count > buf.length || count < 0)
- throw new IndexOutOfBoundsException();
-
- synchronized (lock)
- {
- checkStatus();
- // Once again, we need to handle the special case of a readLine
- // that has a '\r' at the end of the buffer. In this case, we'll
- // need to skip a '\n' if it is the next char to be read.
- // This special case is indicated by 'pos > limit'.
- boolean retAtEndOfBuffer = false;
-
- int avail = limit - pos;
- if (count > avail)
- {
- if (avail > 0)
- count = avail;
- else // pos >= limit
- {
- if (limit == buffer.length)
- markPos = -1; // read too far - invalidate the mark.
- if (pos > limit)
- {
- // Set a boolean and make pos == limit to simplify things.
- retAtEndOfBuffer = true;
- --pos;
- }
- if (markPos < 0)
- {
- // Optimization: can read directly into buf.
- if (count >= buffer.length && !retAtEndOfBuffer)
- return in.read(buf, offset, count);
- pos = limit = 0;
- }
- avail = in.read(buffer, limit, buffer.length - limit);
- if (retAtEndOfBuffer && avail > 0 && buffer[limit] == '\n')
- {
- --avail;
- limit++;
- }
- if (avail < count)
- {
- if (avail <= 0)
- return avail;
- count = avail;
- }
- limit += avail;
- }
- }
- System.arraycopy(buffer, pos, buf, offset, count);
- pos += count;
- return count;
- }
- }
-
- /* Read more data into the buffer. Update pos and limit appropriately.
- Assumes pos==limit initially. May invalidate the mark if read too much.
- Return number of chars read (never 0), or -1 on eof. */
- private int fill() throws IOException
- {
- checkStatus();
- // Handle the special case of a readLine that has a '\r' at the end of
- // the buffer. In this case, we'll need to skip a '\n' if it is the
- // next char to be read. This special case is indicated by 'pos > limit'.
- boolean retAtEndOfBuffer = false;
- if (pos > limit)
- {
- retAtEndOfBuffer = true;
- --pos;
- }
-
- if (markPos >= 0 && limit == buffer.length)
- markPos = -1;
- if (markPos < 0)
- pos = limit = 0;
- int count = in.read(buffer, limit, buffer.length - limit);
- if (count > 0)
- limit += count;
-
- if (retAtEndOfBuffer && buffer[pos] == '\n')
- {
- --count;
- // If the mark was set to the location of the \n, then we
- // must change it to fully pretend that the \n does not
- // exist.
- if (markPos == pos)
- ++markPos;
- ++pos;
- }
-
- return count;
- }
-
- public int read() throws IOException
- {
- synchronized (lock)
- {
- checkStatus();
- if (pos >= limit && fill () <= 0)
- return -1;
- return buffer[pos++];
- }
- }
-
- /* Return the end of the line starting at this.pos and ending at limit.
- * The index returns is *before* any line terminators, or limit
- * if no line terminators were found.
- */
- private int lineEnd(int limit)
- {
- int i = pos;
- for (; i < limit; i++)
- {
- char ch = buffer[i];
- if (ch == '\n' || ch == '\r')
- break;
- }
- return i;
- }
-
- /**
- * This method reads a single line of text from the input stream, returning
- * it as a <code>String</code>. A line is terminated by "\n", a "\r", or
- * an "\r\n" sequence. The system dependent line separator is not used.
- * The line termination characters are not returned in the resulting
- * <code>String</code>.
- *
- * @return The line of text read, or <code>null</code> if end of stream.
- *
- * @exception IOException If an error occurs
- */
- public String readLine() throws IOException
- {
- checkStatus();
- // Handle the special case where a previous readLine (with no intervening
- // reads/skips) had a '\r' at the end of the buffer.
- // In this case, we'll need to skip a '\n' if it's the next char to be read.
- // This special case is indicated by 'pos > limit'.
- if (pos > limit)
- {
- int ch = read();
- if (ch < 0)
- return null;
- if (ch != '\n')
- --pos;
- }
- int i = lineEnd(limit);
- if (i < limit)
- {
- String str = String.valueOf(buffer, pos, i - pos);
- pos = i + 1;
- // If the last char in the buffer is a '\r', we must remember
- // to check if the next char to be read after the buffer is refilled
- // is a '\n'. If so, skip it. To indicate this condition, we set pos
- // to be limit + 1, which normally is never possible.
- if (buffer[i] == '\r')
- if (pos == limit || buffer[pos] == '\n')
- pos++;
- return str;
- }
- if (sbuf == null)
- sbuf = new StringBuffer(200);
- else
- sbuf.setLength(0);
- sbuf.append(buffer, pos, i - pos);
- pos = i;
- // We only want to return null when no characters were read before
- // EOF. So we must keep track of this separately. Otherwise we
- // would treat an empty `sbuf' as an EOF condition, which is wrong
- // when there is just a newline.
- boolean eof = false;
- for (;;)
- {
- // readLine should block. So we must not return until a -1 is reached.
- if (pos >= limit)
- {
- // here count == 0 isn't sufficient to give a failure.
- int count = fill();
- if (count < 0)
- {
- eof = true;
- break;
- }
- continue;
- }
- int ch = buffer[pos++];
- if (ch == '\n' || ch == '\r')
- {
- // Check here if a '\r' was the last char in the buffer; if so,
- // mark it as in the comment above to indicate future reads
- // should skip a newline that is the next char read after
- // refilling the buffer.
- if (ch == '\r')
- if (pos == limit || buffer[pos] == '\n')
- pos++;
- break;
- }
- i = lineEnd(limit);
- sbuf.append(buffer, pos - 1, i - (pos - 1));
- pos = i;
- }
- return (sbuf.length() == 0 && eof) ? null : sbuf.toString();
- }
-
- /**
- * This method skips the specified number of chars in the stream. It
- * returns the actual number of chars skipped, which may be less than the
- * requested amount.
- * <p>
- * This method first discards chars in the buffer, then calls the
- * <code>skip</code> method on the underlying stream to skip the
- * remaining chars.
- *
- * @param count The requested number of chars to skip
- *
- * @return The actual number of chars skipped.
- *
- * @exception IOException If an error occurs.
- * @exception IllegalArgumentException If count is negative.
- */
- public long skip(long count) throws IOException
- {
- synchronized (lock)
- {
- checkStatus();
- if (count < 0)
- throw new IllegalArgumentException("skip value is negative");
- if (count == 0)
- return 0;
- // Yet again, we need to handle the special case of a readLine
- // that has a '\r' at the end of the buffer. In this case, we need
- // to ignore a '\n' if it is the next char to be read.
- // This special case is indicated by 'pos > limit' (i.e. avail < 0).
- // To simplify things, if we're dealing with the special case for
- // readLine, just read the next char (since the fill method will
- // skip the '\n' for us). By doing this, we'll have to back up pos.
- // That's easier than trying to keep track of whether we've skipped
- // one element or not.
- if (pos > limit)
- {
- if (read() < 0)
- return 0;
- else
- --pos;
- }
-
- int avail = limit - pos;
-
- if (count < avail)
- {
- pos += count;
- return count;
- }
-
- pos = limit;
- long todo = count - avail;
- if (todo > buffer.length)
- {
- markPos = -1;
- todo -= in.skip(todo);
- }
- else
- {
- while (todo > 0)
- {
- avail = fill();
- if (avail <= 0)
- break;
- if (avail > todo)
- avail = (int) todo;
- pos += avail;
- todo -= avail;
- }
- }
- return count - todo;
- }
- }
-
- private void checkStatus() throws IOException
- {
- if (in == null)
- throw new IOException("Stream closed");
- }
-}
diff --git a/libjava/java/io/BufferedWriter.java b/libjava/java/io/BufferedWriter.java
deleted file mode 100644
index 185a5344062..00000000000
--- a/libjava/java/io/BufferedWriter.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/* BufferedWriter.java -- Buffer output into large blocks before writing
- Copyright (C) 1998, 1999, 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * Status: Complete to version 1.1.
- */
-
-/**
- * This class accumulates chars written in a buffer instead of immediately
- * writing the data to the underlying output sink. The chars are instead
- * as one large block when the buffer is filled, or when the stream is
- * closed or explicitly flushed. This mode operation can provide a more
- * efficient mechanism for writing versus doing numerous small unbuffered
- * writes.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @date September 25, 1998
- */
-public class BufferedWriter extends Writer
-{
- /**
- * This is the default buffer size
- */
- private static final int DEFAULT_BUFFER_SIZE = 8192;
-
- /**
- * This is the underlying <code>Writer</code> to which this object
- * sends its output.
- */
- private Writer out;
-
- /**
- * This is the internal char array used for buffering output before
- * writing it.
- */
- char[] buffer;
-
- /**
- * This is the number of chars that are currently in the buffer and
- * are waiting to be written to the underlying stream. It always points to
- * the index into the buffer where the next char of data will be stored
- */
- int count;
-
- /**
- * This method initializes a new <code>BufferedWriter</code> instance
- * that will write to the specified subordinate <code>Writer</code>
- * and which will use a default buffer size of 8192 chars.
- *
- * @param out The underlying <code>Writer</code> to write data to
- */
- public BufferedWriter (Writer out)
- {
- this (out, DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * This method initializes a new <code>BufferedWriter</code> instance
- * that will write to the specified subordinate <code>Writer</code>
- * and which will use the specified buffer size
- *
- * @param out The underlying <code>Writer</code> to write data to
- * @param size The size of the internal buffer
- */
- public BufferedWriter (Writer out, int size)
- {
- super(out.lock);
- this.out = out;
- this.buffer = new char[size];
- this.count = 0;
- }
-
- /**
- * This method flushes any remaining buffered chars then closes the
- * underlying output stream. Any further attempts to write to this stream
- * may throw an exception
- *
- * @exception IOException If an error occurs.
- */
- public void close () throws IOException
- {
- synchronized (lock)
- {
- // It is safe to call localFlush even if the stream is already
- // closed.
- localFlush ();
- out.close();
- buffer = null;
- }
- }
-
- /**
- * This method causes any currently buffered chars to be immediately
- * written to the underlying output stream.
- *
- * @exception IOException If an error occurs
- */
- public void flush () throws IOException
- {
- synchronized (lock)
- {
- if (buffer == null)
- throw new IOException ("Stream closed");
- localFlush ();
- out.flush();
- }
- }
-
- /**
- * This method writes out a system depedent line separator sequence. The
- * actual value written is detemined from the <xmp>line.separator</xmp>
- * system property.
- *
- * @exception IOException If an error occurs
- */
- public void newLine () throws IOException
- {
- write (System.getProperty("line.separator"));
- }
-
- /**
- * This method writes a single char of data. This will be written to the
- * buffer instead of the underlying data source. However, if the buffer
- * is filled as a result of this write request, it will be flushed to the
- * underlying output stream.
- *
- * @param oneChar The char of data to be written, passed as an int
- *
- * @exception IOException If an error occurs
- */
- public void write (int oneChar) throws IOException
- {
- synchronized (lock)
- {
- if (buffer == null)
- throw new IOException ("Stream closed");
- buffer[count++] = (char) oneChar;
- if (count == buffer.length)
- localFlush ();
- }
- }
-
- /**
- * This method writes <code>len</code> chars from the char array
- * <code>buf</code> starting at position <code>offset</code> in the buffer.
- * These chars will be written to the internal buffer. However, if this
- * write operation fills the buffer, the buffer will be flushed to the
- * underlying output stream.
- *
- * @param buf The array of chars to write.
- * @param offset The index into the char array to start writing from.
- * @param len The number of chars to write.
- *
- * @exception IOException If an error occurs
- */
- public void write (char[] buf, int offset, int len) throws IOException
- {
- synchronized (lock)
- {
- if (buffer == null)
- throw new IOException ("Stream closed");
-
- // Bypass buffering if there is too much incoming data.
- if (count + len > buffer.length)
- {
- localFlush ();
- out.write(buf, offset, len);
- }
- else
- {
- System.arraycopy(buf, offset, buffer, count, len);
- count += len;
- if (count == buffer.length)
- localFlush ();
- }
- }
- }
-
- /**
- * This method writes <code>len</code> chars from the <code>String</code>
- * <code>str</code> starting at position <code>offset</code> in the string.
- * These chars will be written to the internal buffer. However, if this
- * write operation fills the buffer, the buffer will be flushed to the
- * underlying output stream.
- *
- * @param str The <code>String</code> to write.
- * @param offset The index into the string to start writing from.
- * @param len The number of chars to write.
- *
- * @exception IOException If an error occurs
- */
- public void write (String str, int offset, int len) throws IOException
- {
- synchronized (lock)
- {
- if (buffer == null)
- throw new IOException ("Stream closed");
-
- if (count + len > buffer.length)
- {
- localFlush ();
- out.write(str, offset, len);
- }
- else
- {
- str.getChars(offset, offset + len, buffer, count);
- count += len;
- if (count == buffer.length)
- localFlush ();
- }
- }
- }
-
- // This should only be called with the lock held.
- private void localFlush () throws IOException
- {
- if (count > 0)
- {
- out.write(buffer, 0, count);
- count = 0;
- }
- }
-}
diff --git a/libjava/java/io/ByteArrayInputStream.java b/libjava/java/io/ByteArrayInputStream.java
deleted file mode 100644
index 2bbde95b724..00000000000
--- a/libjava/java/io/ByteArrayInputStream.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/* ByteArrayInputStream.java -- Read an array as a stream
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This class permits an array of bytes to be read as an input stream.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class ByteArrayInputStream extends InputStream
-{
- /**
- * The array that contains the data supplied during read operations
- */
- protected byte[] buf;
-
- /**
- * The array index of the next byte to be read from the buffer
- * <code>buf</code>
- */
- protected int pos;
-
- /**
- * The currently marked position in the stream. This defaults to 0, so a
- * reset operation on the stream resets it to read from array index 0 in
- * the buffer - even if the stream was initially created with an offset
- * greater than 0
- */
- protected int mark;
-
- /**
- * This indicates the maximum number of bytes that can be read from this
- * stream. It is the array index of the position after the last valid
- * byte in the buffer <code>buf</code>
- */
- protected int count;
-
- /**
- * Create a new ByteArrayInputStream that will read bytes from the passed
- * in byte array. This stream will read from the beginning to the end
- * of the array. It is identical to calling an overloaded constructor
- * as <code>ByteArrayInputStream(buf, 0, buf.length)</code>.
- * <p>
- * Note that this array is not copied. If its contents are changed
- * while this stream is being read, those changes will be reflected in the
- * bytes supplied to the reader. Please use caution in changing the
- * contents of the buffer while this stream is open.
- *
- * @param buffer The byte array buffer this stream will read from.
- */
- public ByteArrayInputStream(byte[] buffer)
- {
- this(buffer, 0, buffer.length);
- }
-
- /**
- * Create a new ByteArrayInputStream that will read bytes from the
- * passed in byte array. This stream will read from position
- * <code>offset</code> in the array for a length of
- * <code>length</code> bytes past <code>offset</code>. If the
- * stream is reset to a position before <code>offset</code> then
- * more than <code>length</code> bytes can be read from the stream.
- * The <code>length</code> value should be viewed as the array index
- * one greater than the last position in the buffer to read.
- * <p>
- * Note that this array is not copied. If its contents are changed
- * while this stream is being read, those changes will be reflected in the
- * bytes supplied to the reader. Please use caution in changing the
- * contents of the buffer while this stream is open.
- *
- * @param buffer The byte array buffer this stream will read from.
- * @param offset The index into the buffer to start reading bytes from
- * @param length The number of bytes to read from the buffer
- */
- public ByteArrayInputStream(byte[] buffer, int offset, int length)
- {
- if (offset < 0 || length < 0 || offset > buffer.length)
- throw new IllegalArgumentException();
-
- buf = buffer;
-
- count = offset + length;
- if (count > buf.length)
- count = buf.length;
-
- pos = offset;
- mark = pos;
- }
-
- /**
- * This method returns the number of bytes available to be read from this
- * stream. The value returned will be equal to <code>count - pos</code>.
- *
- * @return The number of bytes that can be read from this stream
- * before blocking, which is all of them
- */
- public synchronized int available()
- {
- return count - pos;
- }
-
- /**
- * This method sets the mark position in this stream to the current
- * position. Note that the <code>readlimit</code> parameter in this
- * method does nothing as this stream is always capable of
- * remembering all the bytes int it.
- * <p>
- * Note that in this class the mark position is set by default to
- * position 0 in the stream. This is in constrast to some other
- * stream types where there is no default mark position.
- *
- * @param readLimit The number of bytes this stream must remember.
- * This parameter is ignored.
- */
- public synchronized void mark(int readLimit)
- {
- // readLimit is ignored per Java Class Lib. book, p.220.
- mark = pos;
- }
-
- /**
- * This method overrides the <code>markSupported</code> method in
- * <code>InputStream</code> in order to return <code>true</code> -
- * indicating that this stream class supports mark/reset
- * functionality.
- *
- * @return <code>true</code> to indicate that this class supports
- * mark/reset.
- */
- public boolean markSupported()
- {
- return true;
- }
-
- /**
- * This method reads one byte from the stream. The <code>pos</code>
- * counter is advanced to the next byte to be read. The byte read is
- * returned as an int in the range of 0-255. If the stream position
- * is already at the end of the buffer, no byte is read and a -1 is
- * returned in order to indicate the end of the stream.
- *
- * @return The byte read, or -1 if end of stream
- */
- public synchronized int read()
- {
- if (pos < count)
- return ((int) buf[pos++]) & 0xFF;
- return -1;
- }
-
- /**
- * This method reads bytes from the stream and stores them into a
- * caller supplied buffer. It starts storing the data at index
- * <code>offset</code> into the buffer and attempts to read
- * <code>len</code> bytes. This method can return before reading
- * the number of bytes requested if the end of the stream is
- * encountered first. The actual number of bytes read is returned.
- * If no bytes can be read because the stream is already at the end
- * of stream position, a -1 is returned.
- * <p>
- * This method does not block.
- *
- * @param buffer The array into which the bytes read should be stored.
- * @param offset The offset into the array to start storing bytes
- * @param length The requested number of bytes to read
- *
- * @return The actual number of bytes read, or -1 if end of stream.
- */
- public synchronized int read(byte[] buffer, int offset, int length)
- {
- if (pos >= count)
- return -1;
-
- int numBytes = Math.min(count - pos, length);
- System.arraycopy(buf, pos, buffer, offset, numBytes);
- pos += numBytes;
- return numBytes;
- }
-
- /**
- * This method sets the read position in the stream to the mark
- * point by setting the <code>pos</code> variable equal to the
- * <code>mark</code> variable. Since a mark can be set anywhere in
- * the array, the mark/reset methods int this class can be used to
- * provide random search capabilities for this type of stream.
- */
- public synchronized void reset()
- {
- pos = mark;
- }
-
- /**
- * This method attempts to skip the requested number of bytes in the
- * input stream. It does this by advancing the <code>pos</code>
- * value by the specified number of bytes. It this would exceed the
- * length of the buffer, then only enough bytes are skipped to
- * position the stream at the end of the buffer. The actual number
- * of bytes skipped is returned.
- *
- * @param num The requested number of bytes to skip
- *
- * @return The actual number of bytes skipped.
- */
- public synchronized long skip(long num)
- {
- // Even though the var numBytes is a long, in reality it can never
- // be larger than an int since the result of subtracting 2 positive
- // ints will always fit in an int. Since we have to return a long
- // anyway, numBytes might as well just be a long.
- long numBytes = Math.min((long) (count - pos), num < 0 ? 0L : num);
- pos += numBytes;
- return numBytes;
- }
-}
diff --git a/libjava/java/io/ByteArrayOutputStream.java b/libjava/java/io/ByteArrayOutputStream.java
deleted file mode 100644
index e996ebbc70f..00000000000
--- a/libjava/java/io/ByteArrayOutputStream.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/* BufferedReader.java
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * Status: Complete to version 1.1.
- */
-
-/**
- * This class allows data to be written to a byte array buffer and
- * and then retrieved by an application. The internal byte array
- * buffer is dynamically resized to hold all the data written. Please
- * be aware that writing large amounts to data to this stream will
- * cause large amounts of memory to be allocated.
- * <p>
- * The size of the internal buffer defaults to 32 and it is resized
- * by doubling the size of the buffer. This default size can be
- * overridden by using the
- * <code>gnu.java.io.ByteArrayOutputStream.initialBufferSize</code>
- * property.
- * <p>
- * There is a constructor that specified the initial buffer size and
- * that is the preferred way to set that value because it it portable
- * across all Java class library implementations.
- * <p>
- * Note that this class also has methods that convert the byte array
- * buffer to a <code>String</code> using either the system default or an
- * application specified character encoding. Thus it can handle
- * multibyte character encodings.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @date September 24, 1998
- */
-public class ByteArrayOutputStream extends OutputStream
-{
- /**
- * This method initializes a new <code>ByteArrayOutputStream</code>
- * with the default buffer size of 32 bytes. If a different initial
- * buffer size is desired, see the constructor
- * <code>ByteArrayOutputStream(int size)</code>. For applications
- * where the source code is not available, the default buffer size
- * can be set using the system property
- * <code>gnu.java.io.ByteArrayOutputStream.initialBufferSize</code>
- */
- public ByteArrayOutputStream ()
- {
- this (initial_buffer_size);
- }
-
- /**
- * This method initializes a new <code>ByteArrayOutputStream</code> with
- * a specified initial buffer size.
- *
- * @param size The initial buffer size in bytes
- */
- public ByteArrayOutputStream (int size)
- {
- buf = new byte[size];
- count = 0;
- }
-
- /**
- * This method discards all of the bytes that have been written to
- * the internal buffer so far by setting the <code>count</code>
- * variable to 0. The internal buffer remains at its currently
- * allocated size.
- */
- public synchronized void reset ()
- {
- count = 0;
- }
-
- /**
- * This method returns the number of bytes that have been written to
- * the buffer so far. This is the same as the value of the protected
- * <code>count</code> variable. If the <code>reset</code> method is
- * called, then this value is reset as well. Note that this method does
- * not return the length of the internal buffer, but only the number
- * of bytes that have been written to it.
- *
- * @return The number of bytes in the internal buffer
- *
- * @see #reset()
- */
- public int size ()
- {
- return count;
- }
-
- /**
- * This method returns a byte array containing the bytes that have been
- * written to this stream so far. This array is a copy of the valid
- * bytes in the internal buffer and its length is equal to the number of
- * valid bytes, not necessarily to the the length of the current
- * internal buffer. Note that since this method allocates a new array,
- * it should be used with caution when the internal buffer is very large.
- */
- public synchronized byte[] toByteArray ()
- {
- byte[] ret = new byte[count];
- System.arraycopy(buf, 0, ret, 0, count);
- return ret;
- }
-
- /**
- * Returns the bytes in the internal array as a <code>String</code>. The
- * bytes in the buffer are converted to characters using the system default
- * encoding. There is an overloaded <code>toString()</code> method that
- * allows an application specified character encoding to be used.
- *
- * @return A <code>String</code> containing the data written to this
- * stream so far
- */
- public String toString ()
- {
- return new String (buf, 0, count);
- }
-
- /**
- * Returns the bytes in the internal array as a <code>String</code>. The
- * bytes in the buffer are converted to characters using the specified
- * encoding.
- *
- * @param enc The name of the character encoding to use
- *
- * @return A <code>String</code> containing the data written to this
- * stream so far
- *
- * @exception UnsupportedEncodingException If the named encoding is
- * not available
- */
- public String toString (String enc) throws UnsupportedEncodingException
- {
- return new String (buf, 0, count, enc);
- }
-
- /**
- * This method returns the bytes in the internal array as a
- * <code>String</code>. It uses each byte in the array as the low
- * order eight bits of the Unicode character value and the passed in
- * parameter as the high eight bits.
- * <p>
- * This method does not convert bytes to characters in the proper way and
- * so is deprecated in favor of the other overloaded <code>toString</code>
- * methods which use a true character encoding.
- *
- * @param hibyte The high eight bits to use for each character in
- * the <code>String</code>
- *
- * @return A <code>String</code> containing the data written to this
- * stream so far
- *
- * @deprecated
- */
- public String toString (int hibyte)
- {
- return new String (buf, 0, count, hibyte);
- }
-
- // Resize buffer to accommodate new bytes.
- private void resize (int add)
- {
- if (count + add > buf.length)
- {
- int newlen = buf.length * 2;
- if (count + add > newlen)
- newlen = count + add;
- byte[] newbuf = new byte[newlen];
- System.arraycopy(buf, 0, newbuf, 0, count);
- buf = newbuf;
- }
- }
-
- /**
- * This method writes the writes the specified byte into the internal
- * buffer.
- *
- * @param oneByte The byte to be read passed as an int
- */
- public synchronized void write (int oneByte)
- {
- resize (1);
- buf[count++] = (byte) oneByte;
- }
-
- /**
- * This method writes <code>len</code> bytes from the passed in array
- * <code>buf</code> starting at index <code>offset</code> into the
- * internal buffer.
- *
- * @param buffer The byte array to write data from
- * @param offset The index into the buffer to start writing data from
- * @param add The number of bytes to write
- */
- public synchronized void write (byte[] buffer, int offset, int add)
- {
- // If ADD < 0 then arraycopy will throw the appropriate error for
- // us.
- if (add >= 0)
- resize (add);
- System.arraycopy(buffer, offset, buf, count, add);
- count += add;
- }
-
- /**
- * This method writes all the bytes that have been written to this stream
- * from the internal buffer to the specified <code>OutputStream</code>.
- *
- * @param out The <code>OutputStream</code> to write to
- *
- * @exception IOException If an error occurs
- */
- public synchronized void writeTo (OutputStream out) throws IOException
- {
- out.write(buf, 0, count);
- }
-
- /**
- * The internal buffer where the data written is stored
- */
- protected byte[] buf;
-
- /**
- * The number of bytes that have been written to the buffer
- */
- protected int count;
-
- /**
- * The default initial buffer size. Specified by the JCL.
- */
- private static final int DEFAULT_INITIAL_BUFFER_SIZE = 32;
-
- // The default buffer size which can be overridden by the user.
- private static final int initial_buffer_size;
-
- static
- {
- int r
- = Integer.getInteger ("gnu.java.io.ByteArrayOutputStream.initialBufferSize",
- DEFAULT_INITIAL_BUFFER_SIZE).intValue ();
- if (r <= 0)
- r = DEFAULT_INITIAL_BUFFER_SIZE;
- initial_buffer_size = r;
- }
-}
diff --git a/libjava/java/io/CharArrayReader.java b/libjava/java/io/CharArrayReader.java
deleted file mode 100644
index c14fa077592..00000000000
--- a/libjava/java/io/CharArrayReader.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/* CharArrayReader.java -- Read an array of characters as a stream
- Copyright (C) 1998, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This class permits an array of chars to be read as an input stream.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public class CharArrayReader extends Reader
-{
- /**
- * The array that contains the data supplied during read operations
- */
- protected char[] buf;
-
- /**
- * The array index of the next char to be read from the buffer
- * <code>buf</code>
- */
- protected int pos;
-
- /**
- * The currently marked position in the stream. This defaults to 0, so a
- * reset operation on the stream resets it to read from array index 0 in
- * the buffer - even if the stream was initially created with an offset
- * greater than 0
- */
- protected int markedPos;
-
- /**
- * This indicates the maximum number of chars that can be read from this
- * stream. It is the array index of the position after the last valid
- * char in the buffer <code>buf</code>
- */
- protected int count;
-
- /**
- * Create a new CharArrayReader that will read chars from the passed
- * in char array. This stream will read from the beginning to the end
- * of the array. It is identical to calling an overloaded constructor
- * as <code>CharArrayReader(buf, 0, buf.length)</code>.
- * <p>
- * Note that this array is not copied. If its contents are changed
- * while this stream is being read, those changes will be reflected in the
- * chars supplied to the reader. Please use caution in changing the
- * contents of the buffer while this stream is open.
- *
- * @param buffer The char array buffer this stream will read from.
- */
- public CharArrayReader(char[] buffer)
- {
- this(buffer, 0, buffer.length);
- }
-
- /**
- * Create a new CharArrayReader that will read chars from the passed
- * in char array. This stream will read from position
- * <code>offset</code> in the array for a length of
- * <code>length</code> chars past <code>offset</code>. If the
- * stream is reset to a position before <code>offset</code> then
- * more than <code>length</code> chars can be read from the stream.
- * The <code>length</code> value should be viewed as the array index
- * one greater than the last position in the buffer to read.
- * <p>
- * Note that this array is not copied. If its contents are changed
- * while this stream is being read, those changes will be reflected in the
- * chars supplied to the reader. Please use caution in changing the
- * contents of the buffer while this stream is open.
- *
- * @param buffer The char array buffer this stream will read from.
- * @param offset The index into the buffer to start reading chars from
- * @param length The number of chars to read from the buffer
- */
- public CharArrayReader(char[] buffer, int offset, int length)
- {
- super();
- if (offset < 0 || length < 0 || offset > buffer.length)
- throw new IllegalArgumentException();
-
- buf = buffer;
-
- count = offset + length;
- if (count > buf.length)
- count = buf.length;
-
- pos = offset;
- markedPos = pos;
- }
-
- /**
- * This method closes the stream.
- */
- public void close()
- {
- synchronized (lock)
- {
- buf = null;
- }
- }
-
- /**
- * This method sets the mark position in this stream to the current
- * position. Note that the <code>readlimit</code> parameter in this
- * method does nothing as this stream is always capable of
- * remembering all the chars int it.
- * <p>
- * Note that in this class the mark position is set by default to
- * position 0 in the stream. This is in constrast to some other
- * stream types where there is no default mark position.
- *
- * @param readAheadLimit The number of chars this stream must
- * remember. This parameter is ignored.
- *
- * @exception IOException If an error occurs
- */
- public void mark(int readAheadLimit) throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("Stream closed");
- // readAheadLimit is ignored per Java Class Lib. book, p. 318.
- markedPos = pos;
- }
- }
-
- /**
- * This method overrides the <code>markSupported</code> method in
- * <code>Reader</code> in order to return <code>true</code> -
- * indicating that this stream class supports mark/reset
- * functionality.
- *
- * @return <code>true</code> to indicate that this class supports
- * mark/reset.
- */
- public boolean markSupported()
- {
- return true;
- }
-
- /**
- * This method reads one char from the stream. The <code>pos</code>
- * counter is advanced to the next char to be read. The char read
- * is returned as an int in the range of 0-65535. If the stream
- * position is already at the end of the buffer, no char is read and
- * a -1 is returned in order to indicate the end of the stream.
- *
- * @return The char read, or -1 if end of stream
- */
- public int read() throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- if (pos < 0)
- throw new ArrayIndexOutOfBoundsException(pos);
-
- if (pos < count)
- return ((int) buf[pos++]) & 0xFFFF;
- return -1;
- }
- }
-
- /**
- * This method reads chars from the stream and stores them into a
- * caller supplied buffer. It starts storing the data at index
- * <code>offset</code> into the buffer and attempts to read
- * <code>len</code> chars. This method can return before reading
- * the number of chars requested if the end of the stream is
- * encountered first. The actual number of chars read is returned.
- * If no chars can be read because the stream is already at the end
- * of stream position, a -1 is returned.
- * <p>
- * This method does not block.
- *
- * @param b The array into which the chars read should be stored.
- * @param off The offset into the array to start storing chars
- * @param len The requested number of chars to read
- *
- * @return The actual number of chars read, or -1 if end of stream.
- */
- public int read(char[] b, int off, int len) throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- /* Don't need to check pos value, arraycopy will check it. */
- if (off < 0 || len < 0 || off + len > b.length)
- throw new IndexOutOfBoundsException();
-
- if (pos >= count)
- return -1;
-
- int numChars = Math.min(count - pos, len);
- System.arraycopy(buf, pos, b, off, numChars);
- pos += numChars;
- return numChars;
- }
- }
-
- /**
- * Return true if more characters are available to be read.
- *
- * @return <code>true</code> to indicate that this stream is ready
- * to be read.
- *
- * @specnote The JDK 1.3 API docs are wrong here. This method will
- * return false if there are no more characters available.
- */
- public boolean ready() throws IOException
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- return (pos < count);
- }
-
- /**
- * This method sets the read position in the stream to the mark
- * point by setting the <code>pos</code> variable equal to the
- * <code>mark</code> variable. Since a mark can be set anywhere in
- * the array, the mark/reset methods int this class can be used to
- * provide random search capabilities for this type of stream.
- */
- public void reset() throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- pos = markedPos;
- }
- }
-
- /**
- * This method attempts to skip the requested number of chars in the
- * input stream. It does this by advancing the <code>pos</code> value by the
- * specified number of chars. It this would exceed the length of the
- * buffer, then only enough chars are skipped to position the stream at
- * the end of the buffer. The actual number of chars skipped is returned.
- *
- * @param n The requested number of chars to skip
- *
- * @return The actual number of chars skipped.
- */
- public long skip(long n) throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- // Even though the var numChars is a long, in reality it can never
- // be larger than an int since the result of subtracting 2 positive
- // ints will always fit in an int. Since we have to return a long
- // anyway, numChars might as well just be a long.
- long numChars = Math.min((long) (count - pos), n < 0 ? 0L : n);
- pos += numChars;
- return numChars;
- }
- }
-}
diff --git a/libjava/java/io/CharArrayWriter.java b/libjava/java/io/CharArrayWriter.java
deleted file mode 100644
index f9b338fe0cc..00000000000
--- a/libjava/java/io/CharArrayWriter.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/* CharArrayWriter.java -- Write chars to a buffer
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This class allows data to be written to a char array buffer and
- * and then retrieved by an application. The internal char array
- * buffer is dynamically resized to hold all the data written. Please
- * be aware that writing large amounts to data to this stream will
- * cause large amounts of memory to be allocated.
- * <p>
- * The size of the internal buffer defaults to 32 and it is resized
- * in increments of 1024 chars. This behavior can be over-ridden by using the
- * following two properties:
- * <p>
- * <ul>
- * <li><xmp>gnu.java.io.CharArrayWriter.initialBufferSize</xmp></li>
- * <li><xmp>gnu.java.io.CharArrayWriter.bufferIncrementSize</xmp></li>
- * </ul>
- * <p>
- * There is a constructor that specified the initial buffer size and
- * that is the preferred way to set that value because it it portable
- * across all Java class library implementations.
- * <p>
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- */
-public class CharArrayWriter extends Writer
-{
- /**
- * The default initial buffer size
- */
- private static final int DEFAULT_INITIAL_BUFFER_SIZE = 32;
-
- /**
- * This method initializes a new <code>CharArrayWriter</code> with
- * the default buffer size of 32 chars. If a different initial
- * buffer size is desired, see the constructor
- * <code>CharArrayWriter(int size)</code>.
- */
- public CharArrayWriter ()
- {
- this (DEFAULT_INITIAL_BUFFER_SIZE);
- }
-
- /**
- * This method initializes a new <code>CharArrayWriter</code> with
- * a specified initial buffer size.
- *
- * @param size The initial buffer size in chars
- */
- public CharArrayWriter (int size)
- {
- super ();
- buf = new char[size];
- }
-
- /**
- * Closes the stream. This method is guaranteed not to free the contents
- * of the internal buffer, which can still be retrieved.
- */
- public void close ()
- {
- }
-
- /**
- * This method flushes all buffered chars to the stream.
- */
- public void flush ()
- {
- }
-
- /**
- * This method discards all of the chars that have been written to the
- * internal buffer so far by setting the <code>count</code> variable to
- * 0. The internal buffer remains at its currently allocated size.
- */
- public void reset ()
- {
- synchronized (lock)
- {
- count = 0;
- }
- }
-
- /**
- * This method returns the number of chars that have been written to
- * the buffer so far. This is the same as the value of the protected
- * <code>count</code> variable. If the <code>reset</code> method is
- * called, then this value is reset as well. Note that this method does
- * not return the length of the internal buffer, but only the number
- * of chars that have been written to it.
- *
- * @return The number of chars in the internal buffer
- *
- * @see #reset()
- */
- public int size ()
- {
- return count;
- }
-
- /**
- * This method returns a char array containing the chars that have been
- * written to this stream so far. This array is a copy of the valid
- * chars in the internal buffer and its length is equal to the number of
- * valid chars, not necessarily to the the length of the current
- * internal buffer. Note that since this method allocates a new array,
- * it should be used with caution when the internal buffer is very large.
- */
- public char[] toCharArray ()
- {
- synchronized (lock)
- {
- char[] nc = new char[count];
- System.arraycopy(buf, 0, nc, 0, count);
- return nc;
- }
- }
-
- /**
- * Returns the chars in the internal array as a <code>String</code>. The
- * chars in the buffer are converted to characters using the system default
- * encoding. There is an overloaded <code>toString()</code> method that
- * allows an application specified character encoding to be used.
- *
- * @return A <code>String</code> containing the data written to this
- * stream so far
- */
- public String toString ()
- {
- synchronized (lock)
- {
- return new String (buf, 0, count);
- }
- }
-
- /**
- * This method writes the writes the specified char into the internal
- * buffer.
- *
- * @param oneChar The char to be read passed as an int
- */
- public void write (int oneChar)
- {
- synchronized (lock)
- {
- resize (1);
- buf[count++] = (char) oneChar;
- }
- }
-
- /**
- * This method writes <code>len</code> chars from the passed in array
- * <code>buf</code> starting at index <code>offset</code> into that buffer
- *
- * @param buffer The char array to write data from
- * @param offset The index into the buffer to start writing data from
- * @param len The number of chars to write
- */
- public void write (char[] buffer, int offset, int len)
- {
- synchronized (lock)
- {
- if (len >= 0)
- resize (len);
- System.arraycopy(buffer, offset, buf, count, len);
- count += len;
- }
- }
-
- /**
- * This method writes <code>len</code> chars from the passed in
- * <code>String</code> <code>buf</code> starting at index
- * <code>offset</code> into the internal buffer.
- *
- * @param str The <code>String</code> to write data from
- * @param offset The index into the string to start writing data from
- * @param len The number of chars to write
- */
- public void write (String str, int offset, int len)
- {
- synchronized (lock)
- {
- if (len >= 0)
- resize (len);
- str.getChars(offset, offset + len, buf, count);
- count += len;
- }
- }
-
- /**
- * This method writes all the chars that have been written to this stream
- * from the internal buffer to the specified <code>Writer</code>.
- *
- * @param out The <code>Writer</code> to write to
- *
- * @exception IOException If an error occurs
- */
- public void writeTo (Writer out) throws IOException
- {
- synchronized (lock)
- {
- out.write(buf, 0, count);
- }
- }
-
- /**
- * This private method makes the buffer bigger when we run out of room
- * by allocating a larger buffer and copying the valid chars from the
- * old array into it. This is obviously slow and should be avoided by
- * application programmers by setting their initial buffer size big
- * enough to hold everything if possible.
- */
- private void resize (int len)
- {
- if (count + len >= buf.length)
- {
- int newlen = buf.length * 2;
- if (count + len > newlen)
- newlen = count + len;
- char[] newbuf = new char[newlen];
- System.arraycopy(buf, 0, newbuf, 0, count);
- buf = newbuf;
- }
- }
-
- /**
- * The internal buffer where the data written is stored
- */
- protected char[] buf;
-
- /**
- * The number of chars that have been written to the buffer
- */
- protected int count;
-}
diff --git a/libjava/java/io/CharConversionException.java b/libjava/java/io/CharConversionException.java
deleted file mode 100644
index a7a608429ef..00000000000
--- a/libjava/java/io/CharConversionException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* CharConversionException.java -- Character conversion exceptions
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown to indicate that a problem occurred with
- * an attempted character conversion.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class CharConversionException extends IOException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -8680016352018427031L;
-
- /**
- * Create an exception without a descriptive error message.
- */
- public CharConversionException()
- {
- }
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public CharConversionException(String message)
- {
- super(message);
- }
-} // class CharConversionException
diff --git a/libjava/java/io/DataInput.java b/libjava/java/io/DataInput.java
deleted file mode 100644
index 45cb0c13025..00000000000
--- a/libjava/java/io/DataInput.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/* DataInput.java -- Interface for reading data from a stream
- Copyright (C) 1998, 1999, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct. */
-
-/**
- * This interface is implemented by classes that can data from streams
- * into Java primitive types.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public interface DataInput
-{
-
- /**
- * This method reads a Java boolean value from an input stream. It does
- * so by reading a single byte of data. If that byte is zero, then the
- * value returned is <code>false</code>. If the byte is non-zero, then
- * the value returned is <code>true</code>.
- * <p>
- * This method can read a <code>boolean</code> written by an object
- * implementing the <code>writeBoolean()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>boolean</code> value read
- *
- * @exception EOFException If end of file is reached before
- * reading the boolean
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeBoolean
- */
- boolean readBoolean() throws EOFException, IOException;
-
- /**
- * This method reads a Java byte value from an input stream. The value
- * is in the range of -128 to 127.
- * <p>
- * This method can read a <code>byte</code> written by an object
- * implementing the
- * <code>writeByte()</code> method in the <code>DataOutput</code> interface.
- * <p>
- * @return The <code>byte</code> value read
- *
- * @exception EOFException If end of file is reached before reading the byte
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeByte
- */
- byte readByte() throws EOFException, IOException;
-
- /**
- * This method reads 8 unsigned bits into a Java <code>int</code> value from
- * the stream. The value returned is in the range of 0 to 255.
- * <p>
- * This method can read an unsigned byte written by an object
- * implementing the
- * <code>writeByte()</code> method in the <code>DataOutput</code>
- * interface.
- *
- * @return The unsigned bytes value read as a Java <code>int</code>.
- *
- * @exception EOFException If end of file is reached before reading the value
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeByte
- */
- int readUnsignedByte() throws EOFException, IOException;
-
- /**
- * This method reads a Java <code>char</code> value from an input stream.
- * It operates by reading two bytes from the stream and converting them to
- * a single 16-bit Java <code>char</code>. The two bytes are stored most
- * significant byte first (i.e., "big endian") regardless of the native
- * host byte ordering.
- * <p>
- * As an example, if <code>byte1</code> and <code>byte2</code> represent the
- * first and second byte read from the stream respectively, they will be
- * transformed to a <code>char</code> in the following manner:
- * <p>
- * <code>(char)((byte1 << 8) + byte2)</code>
- * <p>
- * This method can read a <code>char</code> written by an object implementing
- * the
- * <code>writeChar()</code> method in the <code>DataOutput</code> interface.
- *
- * @return The <code>char</code> value read
- *
- * @exception EOFException If end of file is reached before reading the char
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeChar
- */
- char readChar() throws EOFException, IOException;
-
- /**
- * This method reads a signed 16-bit value into a Java in from the stream.
- * It operates by reading two bytes from the stream and converting them to
- * a single 16-bit Java <code>short</code>. The two bytes are stored most
- * significant byte first (i.e., "big endian") regardless of the native
- * host byte ordering.
- * <p>
- * As an example, if <code>byte1</code> and <code>byte2</code> represent the
- * first and second byte read from the stream respectively, they will be
- * transformed to a <code>short</code> in the following manner:
- * <p>
- * <code>(short)(((byte1 & 0xFF) << 8) + (byte2 & 0xFF))</code>
- * <p>
- * The value returned is in the range of -32768 to 32767.
- * <p>
- * This method can read a <code>short</code> written by an object
- * implementing
- * the <code>writeShort()</code> method in the <code>DataOutput</code>
- * interface.
- *
- * @return The <code>short</code> value read
- *
- * @exception EOFException If end of file is reached before reading the value
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeShort
- */
- short readShort() throws EOFException, IOException;
-
- /**
- * This method reads 16 unsigned bits into a Java int value from the stream.
- * It operates by reading two bytes from the stream and converting them to
- * a single Java <code>int</code>. The two bytes are stored most
- * significant byte first (i.e., "big endian") regardless of the native
- * host byte ordering.
- * <p>
- * As an example, if <code>byte1</code> and <code>byte2</code> represent the
- * first and second byte read from the stream respectively, they will be
- * transformed to an <code>int</code> in the following manner:
- * <p>
- * <code>(int)(((byte1 0xFF) << 8) + (byte2 & 0xFF))</code>
- * <p>
- * The value returned is in the range of 0 to 65535.
- * <p>
- * This method can read an unsigned short written by an object implementing
- * the <code>writeShort()</code> method in the
- * <code>DataOutput</code>
- * interface.
- *
- * @return The unsigned short value read as a Java <code>int</code>.
- *
- * @exception EOFException If end of file is reached before reading
- * the value
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeShort
- */
- int readUnsignedShort() throws EOFException, IOException;
-
- /**
- * This method reads a Java <code>int</code> value from an input stream
- * It operates by reading four bytes from the stream and converting them to
- * a single Java <code>int</code>. The bytes are stored most
- * significant byte first (i.e., "big endian") regardless of the native
- * host byte ordering.
- * <p>
- * As an example, if <code>byte1</code> through <code>byte4</code> represent
- * the first four bytes read from the stream, they will be
- * transformed to an <code>int</code> in the following manner:
- * <p>
- * <code>(int)(((byte1 & 0xFF) << 24) + ((byte2 & 0xFF) << 16) +
- * ((byte3 & 0xFF)<< 8) + (byte4 & 0xFF)))</code>
- * <p>
- * The value returned is in the range of -2147483648 to 2147483647.
- * <p>
- * This method can read an <code>int</code> written by an object
- * implementing the <code>writeInt()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>int</code> value read
- *
- * @exception EOFException If end of file is reached before reading the int
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeInt
- */
- int readInt() throws EOFException, IOException;
-
- /**
- * This method reads a Java <code>long</code> value from an input stream
- * It operates by reading eight bytes from the stream and converting them to
- * a single Java <code>long</code>. The bytes are stored most
- * significant byte first (i.e., "big endian") regardless of the native
- * host byte ordering.
- * <p>
- * As an example, if <code>byte1</code> through <code>byte8</code> represent
- * the first eight bytes read from the stream, they will be
- * transformed to an <code>long</code> in the following manner:
- * <p>
- * <code>(long)(((byte1 & 0xFF) << 56) + ((byte2 & 0xFF) << 48) +
- * ((byte3 & 0xFF) << 40) + ((byte4 & 0xFF) << 32) +
- * ((byte5 & 0xFF) << 24) + ((byte6 & 0xFF) << 16) +
- * ((byte7 & 0xFF) << 8) + (byte8 & 0xFF)))
- * </code>
- * <p>
- * The value returned is in the range of -9223372036854775808 to
- * 9223372036854775807.
- * <p>
- * This method can read an <code>long</code> written by an object
- * implementing the <code>writeLong()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>long</code> value read
- *
- * @exception EOFException If end of file is reached before reading the long
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeLong
- */
- long readLong() throws EOFException, IOException;
-
- /**
- * This method reads a Java float value from an input stream. It operates
- * by first reading an <code>int</code> value from the stream by calling the
- * <code>readInt()</code> method in this interface, then converts that
- * <code>int</code> to a <code>float</code> using the
- * <code>intBitsToFloat</code> method in the class
- * <code>java.lang.Float</code>.
- * <p>
- * This method can read a <code>float</code> written by an object
- * implementing
- * the <code>writeFloat()</code> method in the <code>DataOutput</code>
- * interface.
- *
- * @return The <code>float</code> value read
- *
- * @exception EOFException If end of file is reached before reading the
- * float
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeFloat
- * @see java.lang.Float#intBitsToFloat
- */
- float readFloat() throws EOFException, IOException;
-
- /**
- * This method reads a Java double value from an input stream. It operates
- * by first reading a <code>long</code> value from the stream by calling the
- * <code>readLong()</code> method in this interface, then converts that
- * <code>long</code> to a <code>double</code> using the
- * <code>longBitsToDouble</code> method in the class
- * <code>java.lang.Double</code>.
- * <p>
- * This method can read a <code>double</code> written by an object
- * implementing the <code>writeDouble()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>double</code> value read
- *
- * @exception EOFException If end of file is reached before reading the
- * double
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeDouble
- * @see java.lang.Double#longBitsToDouble
- */
- double readDouble() throws EOFException, IOException;
-
- /**
- * This method reads the next line of text data from an input stream.
- * It operates by reading bytes and converting those bytes to
- * <code>char</code>
- * values by treating the byte read as the low eight bits of the
- * <code>char</code> and using 0 as the high eight bits. Because of this,
- * it does not support the full 16-bit Unicode character set.
- * <P>
- * The reading of bytes ends when either the end of file or a line terminator
- * is encountered. The bytes read are then returned as a
- * <code>String</code>.
- * A line terminator is a byte sequence consisting of either
- * <code>\r</code>, <code>\n</code> or <code>\r\n</code>. These termination
- * charaters are discarded and are not returned as part of the string.
- * A line is also terminated by an end of file condition.
- * <p>
- *
- * @return The line read as a <code>String</code>
- *
- * @exception IOException If an error occurs
- */
- String readLine() throws IOException;
-
- /**
- * This method reads a <code>String</code> from an input stream that is
- * encoded in a modified UTF-8 format. This format has a leading two byte
- * sequence that contains the remaining number of bytes to read.
- * This two byte
- * sequence is read using the <code>readUnsignedShort()</code> method of this
- * interface.
- *
- * After the number of remaining bytes have been determined, these bytes
- * are read an transformed into <code>char</code> values. These
- * <code>char</code> values are encoded in the stream using either a one,
- * two, or three byte format.
- * The particular format in use can be determined by examining the first
- * byte read.
- * <p>
- * If the first byte has a high order bit of 0, then
- * that character consists on only one byte. This character value consists
- * of seven bits that are at positions 0 through 6 of the byte. As an
- * example, if <code>byte1</code> is the byte read from the stream, it would
- * be converted to a <code>char</code> like so:
- * <p>
- * <code>(char)byte1</code>
- * <p>
- * If the first byte has 110 as its high order bits, then the
- * character consists of two bytes. The bits that make up the character
- * value are in positions 0 through 4 of the first byte and bit positions
- * 0 through 5 of the second byte. (The second byte should have
- * 10 as its high order bits). These values are in most significant
- * byte first (i.e., "big endian") order.
- * <p>
- * As an example, if <code>byte1</code> and <code>byte2</code> are the first
- * two bytes read respectively, and the high order bits of them match the
- * patterns which indicate a two byte character encoding, then they would be
- * converted to a Java <code>char</code> like so:
- * <p>
- * <code>(char)(((byte1 &amp; 0x1F) &lt;&lt; 6) + (byte2 &amp; 0x3F))</code>
- * <p>
- * If the first byte has a 1110 as its high order bits, then the
- * character consists of three bytes. The bits that make up the character
- * value are in positions 0 through 3 of the first byte and bit positions
- * 0 through 5 of the other two bytes. (The second and third bytes should
- * have 10 as their high order bits). These values are in most
- * significant byte first (i.e., "big endian") order.
- * <p>
- * As an example, if <code>byte1</code>, <code>byte2</code>, and
- * <code>byte3</code> are the three bytes read, and the high order bits of
- * them match the patterns which indicate a three byte character encoding,
- * then they would be converted to a Java <code>char</code> like so:
- *
- * <code>
- * (char)(((byte1 &amp; 0x0F) &lt;&lt; 12) + ((byte2 &amp; 0x3F) + (byte3 &amp; 0x3F))
- * </code>
- *
- * Note that all characters are encoded in the method that requires the
- * fewest number of bytes with the exception of the character with the
- * value of <code>\&lt;llll&gt;u0000</code> which is encoded as two bytes.
- * This is a modification of the UTF standard used to prevent C language
- * style <code>NUL</code> values from appearing in the byte stream.
- * <p>
- * This method can read data that was written by an object implementing the
- * <code>writeUTF()</code> method in <code>DataOutput</code>.
- *
- * @return The <code>String</code> read
- *
- * @exception EOFException If end of file is reached before reading the
- * String
- * @exception UTFDataFormatException If the data is not in UTF-8 format
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeUTF
- */
- String readUTF() throws EOFException, UTFDataFormatException, IOException;
-
- /**
- * This method reads raw bytes into the passed array until the array is
- * full. Note that this method blocks until the data is available and
- * throws an exception if there is not enough data left in the stream to
- * fill the buffer. Note also that zero length buffers are permitted.
- * In this case, the method will return immediately without reading any
- * bytes from the stream.
- *
- * @param buf The buffer into which to read the data
- *
- * @exception EOFException If end of file is reached before filling the
- * buffer
- * @exception IOException If any other error occurs
- */
- void readFully(byte[] buf) throws EOFException, IOException;
-
- /**
- * This method reads raw bytes into the passed array <code>buf</code>
- * starting
- * <code>offset</code> bytes into the buffer. The number of bytes read
- * will be
- * exactly <code>len</code>. Note that this method blocks until the data is
- * available and throws an exception if there is not enough data left in
- * the stream to read <code>len</code> bytes. Note also that zero length
- * buffers are permitted. In this case, the method will return immediately
- * without reading any bytes from the stream.
- *
- * @param buf The buffer into which to read the data
- * @param offset The offset into the buffer to start storing data
- * @param len The number of bytes to read into the buffer
- *
- * @exception EOFException If end of file is reached before filling the
- * buffer
- * @exception IOException If any other error occurs
- */
- void readFully(byte[] buf, int offset, int len)
- throws EOFException, IOException;
-
- /**
- * This method skips and discards the specified number of bytes in an
- * input stream. Note that this method may skip less than the requested
- * number of bytes. The actual number of bytes skipped is returned.
- * No bytes are skipped if a negative number is passed to this method.
- *
- * @param numBytes The number of bytes to skip
- *
- * @return The number of bytes actually skipped, which will always be
- * <code>numBytes</code>
- *
- * @exception EOFException If end of file is reached before all bytes can be
- * skipped
- * @exception IOException If any other error occurs
- */
- int skipBytes(int numBytes) throws EOFException, IOException;
-
-} // interface DataInput
diff --git a/libjava/java/io/DataInputStream.java b/libjava/java/io/DataInputStream.java
deleted file mode 100644
index da60a8e8c68..00000000000
--- a/libjava/java/io/DataInputStream.java
+++ /dev/null
@@ -1,739 +0,0 @@
-/* DataInputStream.java -- FilteredInputStream that implements DataInput
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct.
- */
-
-/**
- * This subclass of <code>FilteredInputStream</code> implements the
- * <code>DataInput</code> interface that provides method for reading primitive
- * Java data types from a stream.
- *
- * @see DataInput
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @date October 20, 1998.
- */
-public class DataInputStream extends FilterInputStream implements DataInput
-{
- // Byte buffer, used to make primitive read calls more efficient.
- byte[] buf = new byte [8];
-
- /**
- * This constructor initializes a new <code>DataInputStream</code>
- * to read from the specified subordinate stream.
- *
- * @param in The subordinate <code>InputStream</code> to read from
- */
- public DataInputStream (InputStream in)
- {
- super (in);
- }
-
- /**
- * This method reads bytes from the underlying stream into the specified
- * byte array buffer. It will attempt to fill the buffer completely, but
- * may return a short count if there is insufficient data remaining to be
- * read to fill the buffer.
- *
- * @param b The buffer into which bytes will be read.
- *
- * @return The actual number of bytes read, or -1 if end of stream reached
- * before reading any bytes.
- *
- * @exception IOException If an error occurs.
- */
- public final int read (byte[] b) throws IOException
- {
- return in.read (b, 0, b.length);
- }
-
- /**
- * This method reads bytes from the underlying stream into the specified
- * byte array buffer. It will attempt to read <code>len</code> bytes and
- * will start storing them at position <code>off</code> into the buffer.
- * This method can return a short count if there is insufficient data
- * remaining to be read to complete the desired read length.
- *
- * @param b The buffer into which bytes will be read.
- * @param off The offset into the buffer to start storing bytes.
- * @param len The requested number of bytes to read.
- *
- * @return The actual number of bytes read, or -1 if end of stream reached
- * before reading any bytes.
- *
- * @exception IOException If an error occurs.
- */
- public final int read (byte[] b, int off, int len) throws IOException
- {
- return in.read (b, off, len);
- }
-
- /**
- * This method reads a Java boolean value from an input stream. It does
- * so by reading a single byte of data. If that byte is zero, then the
- * value returned is <code>false</code>. If the byte is non-zero, then
- * the value returned is <code>true</code>.
- * <p>
- * This method can read a <code>boolean</code> written by an object
- * implementing the <code>writeBoolean()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>boolean</code> value read
- *
- * @exception EOFException If end of file is reached before reading
- * the boolean
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeBoolean
- */
- public final boolean readBoolean () throws IOException
- {
- return convertToBoolean (in.read ());
- }
-
- /**
- * This method reads a Java byte value from an input stream. The value
- * is in the range of -128 to 127.
- * <p>
- * This method can read a <code>byte</code> written by an object
- * implementing the <code>writeByte()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>byte</code> value read
- *
- * @exception EOFException If end of file is reached before reading the byte
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeByte
- */
- public final byte readByte () throws IOException
- {
- return convertToByte (in.read ());
- }
-
- /**
- * This method reads a Java <code>char</code> value from an input stream.
- * It operates by reading two bytes from the stream and converting them to
- * a single 16-bit Java <code>char</code>. The two bytes are stored most
- * significant byte first (i.e., "big endian") regardless of the native
- * host byte ordering.
- * <p>
- * As an example, if <code>byte1</code> and <code>byte2</code>
- * represent the first and second byte read from the stream
- * respectively, they will be transformed to a <code>char</code> in
- * the following manner:
- * <p>
- * <code>(char)(((byte1 &amp; 0xFF) &lt;&lt; 8) | (byte2 &amp; 0xFF)</code>
- * <p>
- * This method can read a <code>char</code> written by an object
- * implementing the <code>writeChar()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>char</code> value read
- *
- * @exception EOFException If end of file is reached before reading the char
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeChar
- */
- public final char readChar () throws IOException
- {
- readFully (buf, 0, 2);
- return convertToChar (buf);
- }
-
- /**
- * This method reads a Java double value from an input stream. It operates
- * by first reading a <code>long</code> value from the stream by calling the
- * <code>readLong()</code> method in this interface, then converts
- * that <code>long</code> to a <code>double</code> using the
- * <code>longBitsToDouble</code> method in the class
- * <code>java.lang.Double</code>
- * <p>
- * This method can read a <code>double</code> written by an object
- * implementing the <code>writeDouble()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>double</code> value read
- *
- * @exception EOFException If end of file is reached before reading
- * the double
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeDouble
- * @see java.lang.Double#longBitsToDouble
- */
- public final double readDouble () throws IOException
- {
- return Double.longBitsToDouble (readLong ());
- }
-
- /**
- * This method reads a Java float value from an input stream. It
- * operates by first reading an <code>int</code> value from the
- * stream by calling the <code>readInt()</code> method in this
- * interface, then converts that <code>int</code> to a
- * <code>float</code> using the <code>intBitsToFloat</code> method
- * in the class <code>java.lang.Float</code>
- * <p>
- * This method can read a <code>float</code> written by an object
- * implementing the <code>writeFloat()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>float</code> value read
- *
- * @exception EOFException If end of file is reached before reading the float
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeFloat
- * @see java.lang.Float#intBitsToFloat
- */
- public final float readFloat () throws IOException
- {
- return Float.intBitsToFloat (readInt ());
- }
-
- /**
- * This method reads raw bytes into the passed array until the array is
- * full. Note that this method blocks until the data is available and
- * throws an exception if there is not enough data left in the stream to
- * fill the buffer. Note also that zero length buffers are permitted.
- * In this case, the method will return immediately without reading any
- * bytes from the stream.
- *
- * @param b The buffer into which to read the data
- *
- * @exception EOFException If end of file is reached before filling the
- * buffer
- * @exception IOException If any other error occurs
- */
- public final void readFully (byte[] b) throws IOException
- {
- readFully (b, 0, b.length);
- }
-
- /**
- * This method reads raw bytes into the passed array <code>buf</code>
- * starting
- * <code>offset</code> bytes into the buffer. The number of bytes read
- * will be
- * exactly <code>len</code>. Note that this method blocks until the data is
- * available and throws an exception if there is not enough data left in
- * the stream to read <code>len</code> bytes. Note also that zero length
- * buffers are permitted. In this case, the method will return immediately
- * without reading any bytes from the stream.
- *
- * @param buf The buffer into which to read the data
- * @param offset The offset into the buffer to start storing data
- * @param len The number of bytes to read into the buffer
- *
- * @exception EOFException If end of file is reached before filling the
- * buffer
- * @exception IOException If any other error occurs
- */
- public final void readFully (byte[] buf, int offset, int len) throws IOException
- {
- if (len < 0)
- throw new IndexOutOfBoundsException("Negative length: " + len);
-
- while (len > 0)
- {
- // in.read will block until some data is available.
- int numread = in.read (buf, offset, len);
- if (numread < 0)
- throw new EOFException ();
- len -= numread;
- offset += numread;
- }
- }
-
- /**
- * This method reads a Java <code>int</code> value from an input stream
- * It operates by reading four bytes from the stream and converting them to
- * a single Java <code>int</code>. The bytes are stored most
- * significant byte first (i.e., "big endian") regardless of the native
- * host byte ordering.
- * <p>
- * As an example, if <code>byte1</code> through <code>byte4</code> represent
- * the first four bytes read from the stream, they will be
- * transformed to an <code>int</code> in the following manner:
- * <p>
- * <code>(int)(((byte1 &amp; 0xFF) &lt;&lt; 24) + ((byte2 &amp; 0xFF) &lt;&lt; 16) +
- * ((byte3 &amp; 0xFF)&lt;&lt; 8) + (byte4 &amp; 0xFF)))</code>
- * <p>
- * The value returned is in the range of -2147483648 to 2147483647.
- * <p>
- * This method can read an <code>int</code> written by an object
- * implementing the <code>writeInt()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>int</code> value read
- *
- * @exception EOFException If end of file is reached before reading the int
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeInt
- */
- public final int readInt () throws IOException
- {
- readFully (buf, 0, 4);
- return convertToInt (buf);
- }
-
- /**
- * This method reads the next line of text data from an input
- * stream. It operates by reading bytes and converting those bytes
- * to <code>char</code> values by treating the byte read as the low
- * eight bits of the <code>char</code> and using 0 as the high eight
- * bits. Because of this, it does not support the full 16-bit
- * Unicode character set.
- * <p>
- * The reading of bytes ends when either the end of file or a line
- * terminator is encountered. The bytes read are then returned as a
- * <code>String</code> A line terminator is a byte sequence
- * consisting of either <code>\r</code>, <code>\n</code> or
- * <code>\r\n</code>. These termination charaters are discarded and
- * are not returned as part of the string.
- * <p>
- * This method can read data that was written by an object implementing the
- * <code>writeLine()</code> method in <code>DataOutput</code>.
- *
- * @return The line read as a <code>String</code>
- *
- * @exception IOException If an error occurs
- *
- * @see DataOutput
- *
- * @deprecated
- */
- public final String readLine() throws IOException
- {
- StringBuffer strb = new StringBuffer();
-
- while (true)
- {
- int c = in.read();
- if (c == -1) // got an EOF
- return strb.length() > 0 ? strb.toString() : null;
- if (c == '\r')
- {
- int next_c = in.read();
- if (next_c != '\n' && next_c != -1)
- {
- if (! (in instanceof PushbackInputStream))
- in = new PushbackInputStream(in);
- ((PushbackInputStream) in).unread(next_c);
- }
- break;
- }
- if (c == '\n')
- break;
- strb.append((char) c);
- }
-
- return strb.length() > 0 ? strb.toString() : "";
- }
-
- /**
- * This method reads a Java <code>long</code> value from an input stream
- * It operates by reading eight bytes from the stream and converting them to
- * a single Java <code>long</code>. The bytes are stored most
- * significant byte first (i.e., "big endian") regardless of the native
- * host byte ordering.
- * <p>
- * As an example, if <code>byte1</code> through <code>byte8</code> represent
- * the first eight bytes read from the stream, they will be
- * transformed to an <code>long</code> in the following manner:
- * <p>
- * <code>(long)(((byte1 &amp; 0xFF) &lt;&lt; 56) + ((byte2 &amp; 0xFF) &lt;&lt; 48) +
- * ((byte3 &amp; 0xFF) &lt;&lt; 40) + ((byte4 &amp; 0xFF) &lt;&lt; 32) +
- * ((byte5 &amp; 0xFF) &lt;&lt; 24) + ((byte6 &amp; 0xFF) &lt;&lt; 16) +
- * ((byte7 &amp; 0xFF) &lt;&lt; 8) + (byte8 &amp; 0xFF)))
- * </code>
- * <p>
- * The value returned is in the range of -9223372036854775808 to
- * 9223372036854775807.
- * <p>
- * This method can read an <code>long</code> written by an object
- * implementing the <code>writeLong()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>long</code> value read
- *
- * @exception EOFException If end of file is reached before reading the long
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeLong
- */
- public final long readLong () throws IOException
- {
- readFully (buf, 0, 8);
- return convertToLong (buf);
- }
-
- /**
- * This method reads a signed 16-bit value into a Java in from the
- * stream. It operates by reading two bytes from the stream and
- * converting them to a single 16-bit Java <code>short</code>. The
- * two bytes are stored most significant byte first (i.e., "big
- * endian") regardless of the native host byte ordering.
- * <p>
- * As an example, if <code>byte1</code> and <code>byte2</code>
- * represent the first and second byte read from the stream
- * respectively, they will be transformed to a <code>short</code>. in
- * the following manner:
- * <p>
- * <code>(short)(((byte1 &amp; 0xFF) &lt;&lt; 8) | (byte2 &amp; 0xFF))</code>
- * <p>
- * The value returned is in the range of -32768 to 32767.
- * <p>
- * This method can read a <code>short</code> written by an object
- * implementing the <code>writeShort()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The <code>short</code> value read
- *
- * @exception EOFException If end of file is reached before reading the value
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeShort
- */
- public final short readShort () throws IOException
- {
- readFully (buf, 0, 2);
- return convertToShort (buf);
- }
-
- /**
- * This method reads 8 unsigned bits into a Java <code>int</code>
- * value from the stream. The value returned is in the range of 0 to
- * 255.
- * <p>
- * This method can read an unsigned byte written by an object
- * implementing the <code>writeUnsignedByte()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The unsigned bytes value read as a Java <code>int</code>.
- *
- * @exception EOFException If end of file is reached before reading the value
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeByte
- */
- public final int readUnsignedByte () throws IOException
- {
- return convertToUnsignedByte (in.read ());
- }
-
- /**
- * This method reads 16 unsigned bits into a Java int value from the stream.
- * It operates by reading two bytes from the stream and converting them to
- * a single Java <code>int</code> The two bytes are stored most
- * significant byte first (i.e., "big endian") regardless of the native
- * host byte ordering.
- * <p>
- * As an example, if <code>byte1</code> and <code>byte2</code>
- * represent the first and second byte read from the stream
- * respectively, they will be transformed to an <code>int</code> in
- * the following manner:
- * <p>
- * <code>(int)(((byte1 &amp; 0xFF) &lt;&lt; 8) + (byte2 &amp; 0xFF))</code>
- * <p>
- * The value returned is in the range of 0 to 65535.
- * <p>
- * This method can read an unsigned short written by an object
- * implementing the <code>writeUnsignedShort()</code> method in the
- * <code>DataOutput</code> interface.
- *
- * @return The unsigned short value read as a Java <code>int</code>
- *
- * @exception EOFException If end of file is reached before reading the value
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeShort
- */
- public final int readUnsignedShort () throws IOException
- {
- readFully (buf, 0, 2);
- return convertToUnsignedShort (buf);
- }
-
- /**
- * This method reads a <code>String</code> from an input stream that
- * is encoded in a modified UTF-8 format. This format has a leading
- * two byte sequence that contains the remaining number of bytes to
- * read. This two byte sequence is read using the
- * <code>readUnsignedShort()</code> method of this interface.
- * <p>
- * After the number of remaining bytes have been determined, these
- * bytes are read an transformed into <code>char</code> values.
- * These <code>char</code> values are encoded in the stream using
- * either a one, two, or three byte format. The particular format
- * in use can be determined by examining the first byte read.
- * <p>
- * If the first byte has a high order bit of 0, then that character
- * consists on only one byte. This character value consists of
- * seven bits that are at positions 0 through 6 of the byte. As an
- * example, if <code>byte1</code> is the byte read from the stream,
- * it would be converted to a <code>char</code> like so:
- * <p>
- * <code>(char)byte1</code>
- * <p>
- * If the first byte has 110 as its high order bits, then the
- * character consists of two bytes. The bits that make up the character
- * value are in positions 0 through 4 of the first byte and bit positions
- * 0 through 5 of the second byte. (The second byte should have
- * 10 as its high order bits). These values are in most significant
- * byte first (i.e., "big endian") order.
- * <p>
- * As an example, if <code>byte1</code> and <code>byte2</code> are
- * the first two bytes read respectively, and the high order bits of
- * them match the patterns which indicate a two byte character
- * encoding, then they would be converted to a Java
- * <code>char</code> like so:
- * <p>
- * <code>(char)(((byte1 & 0x1F) << 6) | (byte2 & 0x3F))</code>
- * <p>
- * If the first byte has a 1110 as its high order bits, then the
- * character consists of three bytes. The bits that make up the character
- * value are in positions 0 through 3 of the first byte and bit positions
- * 0 through 5 of the other two bytes. (The second and third bytes should
- * have 10 as their high order bits). These values are in most
- * significant byte first (i.e., "big endian") order.
- * <p>
- * As an example, if <code>byte1</code> <code>byte2</code> and
- * <code>byte3</code> are the three bytes read, and the high order
- * bits of them match the patterns which indicate a three byte
- * character encoding, then they would be converted to a Java
- * <code>char</code> like so:
- * <p>
- * <code>(char)(((byte1 & 0x0F) << 12) | ((byte2 & 0x3F) << 6) |
- * (byte3 & 0x3F))</code>
- * <p>
- * Note that all characters are encoded in the method that requires
- * the fewest number of bytes with the exception of the character
- * with the value of <code>&#92;u0000</code> which is encoded as two
- * bytes. This is a modification of the UTF standard used to
- * prevent C language style <code>NUL</code> values from appearing
- * in the byte stream.
- * <p>
- * This method can read data that was written by an object implementing the
- * <code>writeUTF()</code> method in <code>DataOutput</code>
- *
- * @return The <code>String</code> read
- *
- * @exception EOFException If end of file is reached before reading
- * the String
- * @exception UTFDataFormatException If the data is not in UTF-8 format
- * @exception IOException If any other error occurs
- *
- * @see DataOutput#writeUTF
- */
- public final String readUTF () throws IOException
- {
- return readUTF (this);
- }
-
- /**
- * This method reads a String encoded in UTF-8 format from the
- * specified <code>DataInput</code> source.
- *
- * @param in The <code>DataInput</code> source to read from
- *
- * @return The String read from the source
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readUTF
- */
- public static final String readUTF(DataInput in) throws IOException
- {
- final int UTFlen = in.readUnsignedShort ();
- byte[] buf = new byte [UTFlen];
-
- // This blocks until the entire string is available rather than
- // doing partial processing on the bytes that are available and then
- // blocking. An advantage of the latter is that Exceptions
- // could be thrown earlier. The former is a bit cleaner.
- in.readFully (buf, 0, UTFlen);
-
- return convertFromUTF (buf);
- }
-
- /**
- * This method attempts to skip and discard the specified number of bytes
- * in the input stream. It may actually skip fewer bytes than requested.
- * This method will not skip any bytes if passed a negative number of bytes
- * to skip.
- *
- * @param n The requested number of bytes to skip.
- *
- * @return The requested number of bytes to skip.
- *
- * @exception IOException If an error occurs.
- * @specnote The JDK docs claim that this returns the number of bytes
- * actually skipped. The JCL claims that this method can throw an
- * EOFException. Neither of these appear to be true in the JDK 1.3's
- * implementation. This tries to implement the actual JDK behaviour.
- */
- public final int skipBytes (int n) throws IOException
- {
- if (n <= 0)
- return 0;
- try
- {
- return (int) in.skip (n);
- }
- catch (EOFException x)
- {
- // do nothing.
- }
- return n;
- }
-
- static boolean convertToBoolean (int b) throws EOFException
- {
- if (b < 0)
- throw new EOFException ();
-
- return (b != 0);
- }
-
- static byte convertToByte (int i) throws EOFException
- {
- if (i < 0)
- throw new EOFException ();
-
- return (byte) i;
- }
-
- static int convertToUnsignedByte (int i) throws EOFException
- {
- if (i < 0)
- throw new EOFException ();
-
- return (i & 0xFF);
- }
-
- static char convertToChar (byte[] buf)
- {
- return (char) ((buf [0] << 8)
- | (buf [1] & 0xff));
- }
-
- static short convertToShort (byte[] buf)
- {
- return (short) ((buf [0] << 8)
- | (buf [1] & 0xff));
- }
-
- static int convertToUnsignedShort (byte[] buf)
- {
- return (((buf [0] & 0xff) << 8)
- | (buf [1] & 0xff));
- }
-
- static int convertToInt (byte[] buf)
- {
- return (((buf [0] & 0xff) << 24)
- | ((buf [1] & 0xff) << 16)
- | ((buf [2] & 0xff) << 8)
- | (buf [3] & 0xff));
- }
-
- static long convertToLong (byte[] buf)
- {
- return (((long)(buf [0] & 0xff) << 56) |
- ((long)(buf [1] & 0xff) << 48) |
- ((long)(buf [2] & 0xff) << 40) |
- ((long)(buf [3] & 0xff) << 32) |
- ((long)(buf [4] & 0xff) << 24) |
- ((long)(buf [5] & 0xff) << 16) |
- ((long)(buf [6] & 0xff) << 8) |
- ((long)(buf [7] & 0xff)));
- }
-
- // FIXME: This method should be re-thought. I suspect we have multiple
- // UTF-8 decoders floating around. We should use the standard charset
- // converters, maybe and adding a direct call into one of the new
- // NIO converters for a super-fast UTF8 decode.
- static String convertFromUTF (byte[] buf)
- throws EOFException, UTFDataFormatException
- {
- // Give StringBuffer an initial estimated size to avoid
- // enlarge buffer frequently
- StringBuffer strbuf = new StringBuffer (buf.length / 2 + 2);
-
- for (int i = 0; i < buf.length; )
- {
- if ((buf [i] & 0x80) == 0) // bit pattern 0xxxxxxx
- strbuf.append ((char) (buf [i++] & 0xFF));
- else if ((buf [i] & 0xE0) == 0xC0) // bit pattern 110xxxxx
- {
- if (i + 1 >= buf.length
- || (buf [i + 1] & 0xC0) != 0x80)
- throw new UTFDataFormatException ();
-
- strbuf.append((char) (((buf [i++] & 0x1F) << 6)
- | (buf [i++] & 0x3F)));
- }
- else if ((buf [i] & 0xF0) == 0xE0) // bit pattern 1110xxxx
- {
- if (i + 2 >= buf.length
- || (buf [i + 1] & 0xC0) != 0x80
- || (buf [i + 2] & 0xC0) != 0x80)
- throw new UTFDataFormatException ();
-
- strbuf.append ((char) (((buf [i++] & 0x0F) << 12)
- | ((buf [i++] & 0x3F) << 6)
- | (buf [i++] & 0x3F)));
- }
- else // must be ((buf [i] & 0xF0) == 0xF0 || (buf [i] & 0xC0) == 0x80)
- throw new UTFDataFormatException (); // bit patterns 1111xxxx or
- // 10xxxxxx
- }
-
- return strbuf.toString ();
- }
-}
diff --git a/libjava/java/io/DataOutput.java b/libjava/java/io/DataOutput.java
deleted file mode 100644
index 2eccc552b8e..00000000000
--- a/libjava/java/io/DataOutput.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/* DataOutput.java -- Interface for writing data from a stream
- Copyright (C) 1998, 1999, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * Status: Complete to version 1.1.
- */
-
-/**
- * This interface is implemented by classes that can wrte data to streams
- * from Java primitive types. This data can subsequently be read back
- * by classes implementing the <code>DataInput</code> interface.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- *
- * @see DataInput
- */
-public interface DataOutput
-{
- /**
- * This method writes a Java boolean value to an output stream. If
- * <code>value</code> is <code>true</code>, a byte with the value of
- * 1 will be written, otherwise a byte with the value of 0 will be
- * written.
- *
- * The value written can be read using the <code>readBoolean</code>
- * method in <code>DataInput</code>.
- *
- * @param value The boolean value to write
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readBoolean
- */
- void writeBoolean(boolean value) throws IOException;
-
- /**
- * This method writes a Java byte value to an output stream. The
- * byte to be written will be in the lowest 8 bits of the
- * <code>int</code> value passed.
- *
- * The value written can be read using the <code>readByte</code> or
- * <code>readUnsignedByte</code> methods in <code>DataInput</code>.
- *
- * @param value The int value to write
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readByte
- * @see DataInput#readUnsignedByte
- */
- void writeByte(int value) throws IOException;
-
- /**
- * This method writes a Java char value to an output stream. The
- * char to be written will be in the lowest 16 bits of the <code>int</code>
- * value passed. These bytes will be written "big endian". That is,
- * with the high byte written first in the following manner:
- * <p>
- * <code>byte0 = (byte)((value & 0xFF00) >> 8);<br>
- * byte1 = (byte)(value & 0x00FF);</code>
- * <p>
- *
- * The value written can be read using the <code>readChar</code>
- * method in <code>DataInput</code>.
- *
- * @param value The char value to write
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readChar
- */
- void writeChar(int value) throws IOException;
-
- /**
- * This method writes a Java short value to an output stream. The
- * char to be written will be in the lowest 16 bits of the <code>int</code>
- * value passed. These bytes will be written "big endian". That is,
- * with the high byte written first in the following manner:
- * <p>
- * <code>byte0 = (byte)((value & 0xFF00) >> 8);<br>
- * byte1 = (byte)(value & 0x00FF);</code>
- * <p>
- *
- * The value written can be read using the <code>readShort</code> and
- * <code>readUnsignedShort</code> methods in <code>DataInput</code>.
- *
- * @param value The int value to write as a 16-bit value
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readShort
- * @see DataInput#readUnsignedShort
- */
- void writeShort(int value) throws IOException;
-
- /**
- * This method writes a Java int value to an output stream. The 4 bytes
- * of the passed value will be written "big endian". That is, with
- * the high byte written first in the following manner:
- * <p>
- * <code>byte0 = (byte)((value & 0xFF000000) >> 24);<br>
- * byte1 = (byte)((value & 0x00FF0000) >> 16);<br>
- * byte2 = (byte)((value & 0x0000FF00) >> 8);<br>
- * byte3 = (byte)(value & 0x000000FF);</code>
- * <p>
- *
- * The value written can be read using the <code>readInt</code>
- * method in <code>DataInput</code>.
- *
- * @param value The int value to write
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readInt
- */
- void writeInt(int value) throws IOException;
-
- /**
- * This method writes a Java long value to an output stream. The 8 bytes
- * of the passed value will be written "big endian". That is, with
- * the high byte written first in the following manner:
- * <p>
- * <code>byte0 = (byte)((value & 0xFF00000000000000L) >> 56);<br>
- * byte1 = (byte)((value & 0x00FF000000000000L) >> 48);<br>
- * byte2 = (byte)((value & 0x0000FF0000000000L) >> 40);<br>
- * byte3 = (byte)((value & 0x000000FF00000000L) >> 32);<br>
- * byte4 = (byte)((value & 0x00000000FF000000L) >> 24);<br>
- * byte5 = (byte)((value & 0x0000000000FF0000L) >> 16);<br>
- * byte6 = (byte)((value & 0x000000000000FF00L) >> 8);<br>
- * byte7 = (byte)(value & 0x00000000000000FFL);</code>
- * <p>
- *
- * The value written can be read using the <code>readLong</code>
- * method in <code>DataInput</code>.
- *
- * @param value The long value to write
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readLong
- */
- void writeLong(long value) throws IOException;
-
- /**
- * This method writes a Java <code>float</code> value to the stream. This
- * value is written by first calling the method
- * <code>Float.floatToIntBits</code>
- * to retrieve an <code>int</code> representing the floating point number,
- * then writing this <code>int</code> value to the stream exactly the same
- * as the <code>writeInt()</code> method does.
- *
- * The value written can be read using the <code>readFloat</code>
- * method in <code>DataInput</code>.
- *
- * @param value The float value to write
- *
- * @exception IOException If an error occurs
- *
- * @see writeInt
- * @see DataInput#readFloat
- * @see Float#floatToIntBits
- */
- void writeFloat(float value) throws IOException;
-
- /**
- * This method writes a Java <code>double</code> value to the stream. This
- * value is written by first calling the method
- * <code>Double.doubleToLongBits</code>
- * to retrieve an <code>long</code> representing the floating point number,
- * then writing this <code>long</code> value to the stream exactly the same
- * as the <code>writeLong()</code> method does.
- *
- * The value written can be read using the <code>readDouble</code>
- * method in <code>DataInput</code>.
- *
- * @param value The double value to write
- *
- * @exception IOException If any other error occurs
- *
- * @see writeLong
- * @see DataInput#readDouble
- * @see Double#doubleToLongBits
- */
- void writeDouble(double value) throws IOException;
-
- /**
- * This method writes all the bytes in a <code>String</code> out to the
- * stream. One byte is written for each character in the
- * <code>String</code>.
- * The high eight bits of each character are discarded, thus this
- * method is inappropriate for completely representing Unicode characters.
- *
- * @param value The <code>String</code> to write
- *
- * @exception IOException If an error occurs
- */
- void writeBytes(String value) throws IOException;
-
- /**
- * This method writes all the characters of a <code>String</code> to an
- * output stream as an array of <code>char</code>'s. Each character
- * is written using the method specified in the <code>writeChar</code>
- * method.
- *
- * @param value The String to write
- *
- * @exception IOException If an error occurs
- *
- * @see writeChar
- */
- void writeChars(String value) throws IOException;
-
- /**
- * This method writes a Java <code>String</code> to the stream in a modified
- * UTF-8 format. First, two bytes are written to the stream indicating the
- * number of bytes to follow. This is written in the form of a Java
- * <code>short</code> value in the same manner used by the
- * <code>writeShort</code> method. Note that this is the number of
- * bytes in the
- * encoded <code>String</code> not the <code>String</code> length. Next
- * come the encoded characters. Each character in the <code>String</code>
- * is encoded as either one, two or three bytes. For characters in the
- * range of <code>\u0001</code> to <code>\u007F</code>, one byte is used.
- * The character
- * value goes into bits 0-7 and bit eight is 0. For characters in the range
- * of <code>\u0080</code> to <code>\u007FF</code>, two bytes are used. Bits
- * 6-10 of the character value are encoded bits 0-4 of the first byte, with
- * the high bytes having a value of "110". Bits 0-5 of the character value
- * are stored in bits 0-5 of the second byte, with the high bits set to
- * "10". This type of encoding is also done for the null character
- * <code>\u0000</code>. This eliminates any C style NUL character values
- * in the output. All remaining characters are stored as three bytes.
- * Bits 12-15 of the character value are stored in bits 0-3 of the first
- * byte. The high bits of the first bytes are set to "1110". Bits 6-11
- * of the character value are stored in bits 0-5 of the second byte. The
- * high bits of the second byte are set to "10". And bits 0-5 of the
- * character value are stored in bits 0-5 of byte three, with the high bits
- * of that byte set to "10".
- *
- * The value written can be read using the <code>readUTF</code>
- * method in <code>DataInput</code>.
- *
- * @param value The <code>String</code> to write
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readUTF
- */
- void writeUTF(String value) throws IOException;
-
- /**
- * This method writes an 8-bit value (passed into the method as a Java
- * <code>int</code>) to an output stream. The low 8 bits of the
- * passed value are written.
- *
- * @param value The <code>byte</code> to write to the output stream
- *
- * @exception IOException If an error occurs
- */
- void write(int value) throws IOException;
-
- /**
- * This method writes the raw byte array passed in to the output stream.
- *
- * @param buf The byte array to write
- *
- * @exception IOException If an error occurs
- */
- void write(byte[] buf) throws IOException;
-
- /**
- * This method writes raw bytes from the passed array <code>buf</code>
- * starting
- * <code>offset</code> bytes into the buffer. The number of bytes
- * written will be exactly <code>len</code>.
- *
- * @param buf The buffer from which to write the data
- * @param offset The offset into the buffer to start writing data from
- * @param len The number of bytes to write from the buffer to the output
- * stream
- *
- * @exception IOException If any other error occurs
- */
- void write(byte[] buf, int offset, int len) throws IOException;
-
-} // interface DataOutput
-
diff --git a/libjava/java/io/DataOutputStream.java b/libjava/java/io/DataOutputStream.java
deleted file mode 100644
index 39f7ed1ff24..00000000000
--- a/libjava/java/io/DataOutputStream.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/* DataOutputStream.java -- Writes primitive Java datatypes to streams
- Copyright (C) 1998, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * Status: Complete to version 1.1.
- */
-
-/**
- * This class provides a mechanism for writing primitive Java datatypes
- * to an <code>OutputStream</code> in a portable way. Data written to
- * a stream using this class can be read back in using the
- * <code>DataInputStream</code> class on any platform.
- *
- * @see DataInputStream
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- */
-public class DataOutputStream extends FilterOutputStream implements DataOutput
-{
- /**
- * This is the total number of bytes that have been written to the
- * stream by this object instance.
- */
- protected int written;
-
- /**
- * This method initializes an instance of <code>DataOutputStream</code> to
- * write its data to the specified underlying <code>OutputStream</code>
- *
- * @param out The subordinate <code>OutputStream</code> to which this
- * object will write
- */
- public DataOutputStream (OutputStream out)
- {
- super (out);
- written = 0;
- }
-
- /**
- * This method flushes any unwritten bytes to the underlying stream.
- *
- * @exception IOException If an error occurs.
- */
- public void flush () throws IOException
- {
- out.flush();
- }
-
- /**
- * This method returns the total number of bytes that have been written to
- * the underlying output stream so far. This is the value of the
- * <code>written</code> instance variable
- *
- * @return The number of bytes written to the stream.
- */
- public final int size ()
- {
- return written;
- }
-
- /**
- * This method writes the specified byte (passed as an <code>int</code>)
- * to the underlying output stream.
- *
- * @param value The <code>byte</code> to write, passed as an <code>int</code>.
- *
- * @exception IOException If an error occurs.
- */
- public synchronized void write (int value) throws IOException
- {
- out.write (value);
- ++written;
- }
-
- /**
- * This method writes <code>len</code> bytes from the specified byte array
- * <code>buf</code> starting at position <code>offset</code> into the
- * buffer to the underlying output stream.
- *
- * @param buf The byte array to write from.
- * @param offset The index into the byte array to start writing from.
- * @param len The number of bytes to write.
- *
- * @exception IOException If an error occurs.
- */
- public synchronized void write (byte[] buf, int offset, int len)
- throws IOException
- {
- out.write(buf, offset, len);
- written += len;
- }
-
- /**
- * This method writes a Java boolean value to an output stream. If
- * <code>value</code> is <code>true</code>, a byte with the value of
- * 1 will be written, otherwise a byte with the value of 0 will be
- * written.
- *
- * The value written can be read using the <code>readBoolean</code>
- * method in <code>DataInput</code>.
- *
- * @param value The <code>boolean</code> value to write to the stream
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readBoolean
- */
- public final void writeBoolean (boolean value) throws IOException
- {
- write (value ? 1 : 0);
- }
-
- /**
- * This method writes a Java byte value to an output stream. The
- * byte to be written will be in the lowest 8 bits of the
- * <code>int</code> value passed.
- *
- * The value written can be read using the <code>readByte</code> or
- * <code>readUnsignedByte</code> methods in <code>DataInput</code>.
- *
- * @param value The <code>byte</code> to write to the stream, passed as
- * the low eight bits of an <code>int</code>.
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readByte
- * @see DataInput#readUnsignedByte
- */
- public final void writeByte (int value) throws IOException
- {
- write (value & 0xff);
- }
-
- /**
- * This method writes a Java short value to an output stream. The
- * char to be written will be in the lowest 16 bits of the <code>int</code>
- * value passed. These bytes will be written "big endian". That is,
- * with the high byte written first in the following manner:
- * <p>
- * <code>byte0 = (byte)((value & 0xFF00) >> 8);<br>
- * byte1 = (byte)(value & 0x00FF);</code>
- * <p>
- *
- * The value written can be read using the <code>readShort</code> and
- * <code>readUnsignedShort</code> methods in <code>DataInput</code>.
- *
- * @param value The <code>short</code> value to write to the stream,
- * passed as an <code>int</code>.
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readShort
- * @see DataInput#readUnsignedShort
- */
- public final synchronized void writeShort (int value) throws IOException
- {
- write ((byte) (0xff & (value >> 8)));
- write ((byte) (0xff & value));
- }
-
- /**
- * This method writes a Java char value to an output stream. The
- * char to be written will be in the lowest 16 bits of the <code>int</code>
- * value passed. These bytes will be written "big endian". That is,
- * with the high byte written first in the following manner:
- * <p>
- * <code>byte0 = (byte)((value & 0xFF00) >> 8);<br>
- * byte1 = (byte)(value & 0x00FF);</code>
- * <p>
- *
- * The value written can be read using the <code>readChar</code>
- * method in <code>DataInput</code>.
- *
- * @param value The <code>char</code> value to write,
- * passed as an <code>int</code>.
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readChar
- */
- public final synchronized void writeChar (int value) throws IOException
- {
- write ((byte) (0xff & (value >> 8)));
- write ((byte) (0xff & value));
- }
-
- /**
- * This method writes a Java int value to an output stream. The 4 bytes
- * of the passed value will be written "big endian". That is, with
- * the high byte written first in the following manner:
- * <p>
- * <code>byte0 = (byte)((value & 0xFF000000) >> 24);<br>
- * byte1 = (byte)((value & 0x00FF0000) >> 16);<br>
- * byte2 = (byte)((value & 0x0000FF00) >> 8);<br>
- * byte3 = (byte)(value & 0x000000FF);</code>
- * <p>
- *
- * The value written can be read using the <code>readInt</code>
- * method in <code>DataInput</code>.
- *
- * @param value The <code>int</code> value to write to the stream
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readInt
- */
- public final synchronized void writeInt (int value) throws IOException
- {
- write ((byte) (0xff & (value >> 24)));
- write ((byte) (0xff & (value >> 16)));
- write ((byte) (0xff & (value >> 8)));
- write ((byte) (0xff & value));
- }
-
- /**
- * This method writes a Java long value to an output stream. The 8 bytes
- * of the passed value will be written "big endian". That is, with
- * the high byte written first in the following manner:
- * <p>
- * <code>byte0 = (byte)((value & 0xFF00000000000000L) >> 56);<br>
- * byte1 = (byte)((value & 0x00FF000000000000L) >> 48);<br>
- * byte2 = (byte)((value & 0x0000FF0000000000L) >> 40);<br>
- * byte3 = (byte)((value & 0x000000FF00000000L) >> 32);<br>
- * byte4 = (byte)((value & 0x00000000FF000000L) >> 24);<br>
- * byte5 = (byte)((value & 0x0000000000FF0000L) >> 16);<br>
- * byte6 = (byte)((value & 0x000000000000FF00L) >> 8);<br>
- * byte7 = (byte)(value & 0x00000000000000FFL);</code>
- * <p>
- *
- * The value written can be read using the <code>readLong</code>
- * method in <code>DataInput</code>.
- *
- * @param value The <code>long</code> value to write to the stream
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readLong
- */
- public final synchronized void writeLong (long value) throws IOException
- {
- write ((byte) (0xff & (value >> 56)));
- write ((byte) (0xff & (value>> 48)));
- write ((byte) (0xff & (value>> 40)));
- write ((byte) (0xff & (value>> 32)));
- write ((byte) (0xff & (value>> 24)));
- write ((byte) (0xff & (value>> 16)));
- write ((byte) (0xff & (value>> 8)));
- write ((byte) (0xff & value));
- }
-
- /**
- * This method writes a Java <code>float</code> value to the stream. This
- * value is written by first calling the method
- * <code>Float.floatToIntBits</code>
- * to retrieve an <code>int</code> representing the floating point number,
- * then writing this <code>int</code> value to the stream exactly the same
- * as the <code>writeInt()</code> method does.
- *
- * The value written can be read using the <code>readFloat</code>
- * method in <code>DataInput</code>.
- *
- * @param value The <code>float</code> value to write to the stream
- *
- * @exception IOException If an error occurs
- *
- * @see writeInt
- * @see DataInput#readFloat
- * @see Float#floatToIntBits
- */
- public final void writeFloat (float value) throws IOException
- {
- writeInt (Float.floatToIntBits (value));
- }
-
- /**
- * This method writes a Java <code>double</code> value to the stream. This
- * value is written by first calling the method
- * <code>Double.doubleToLongBits</code>
- * to retrieve an <code>long</code> representing the floating point number,
- * then writing this <code>long</code> value to the stream exactly the same
- * as the <code>writeLong()</code> method does.
- *
- * The value written can be read using the <code>readDouble</code>
- * method in <code>DataInput</code>.
- *
- * @param value The <code>double</code> value to write to the stream
- *
- * @exception IOException If an error occurs
- *
- * @see writeLong
- * @see DataInput#readDouble
- * @see Double#doubleToLongBits
- */
- public final void writeDouble (double value) throws IOException
- {
- writeLong (Double.doubleToLongBits (value));
- }
-
- /**
- * This method writes all the bytes in a <code>String</code> out to the
- * stream. One byte is written for each character in the
- * <code>String</code>.
- * The high eight bits of each character are discarded, thus this
- * method is inappropriate for completely representing Unicode characters.
- *
- * @param value The <code>String</code> to write to the stream
- *
- * @exception IOException If an error occurs
- */
- public final void writeBytes (String value) throws IOException
- {
- int len = value.length();
- for (int i = 0; i < len; ++i)
- writeByte (value.charAt(i));
- }
-
- /**
- * This method writes all the characters of a <code>String</code> to an
- * output stream as an array of <code>char</code>'s. Each character
- * is written using the method specified in the <code>writeChar</code>
- * method.
- *
- * @param value The <code>String</code> to write to the stream
- *
- * @exception IOException If an error occurs
- *
- * @see writeChar
- */
- public final void writeChars (String value) throws IOException
- {
- int len = value.length();
- for (int i = 0; i < len; ++i)
- writeChar (value.charAt(i));
- }
-
- /**
- * This method writes a Java <code>String</code> to the stream in a modified
- * UTF-8 format. First, two bytes are written to the stream indicating the
- * number of bytes to follow. Note that this is the number of bytes in the
- * encoded <code>String</code> not the <code>String</code> length. Next
- * come the encoded characters. Each character in the <code>String</code>
- * is encoded as either one, two or three bytes. For characters in the
- * range of <code>\u0001</code> to <\u007F>, one byte is used. The character
- * value goes into bits 0-7 and bit eight is 0. For characters in the range
- * of <code>\u0080</code> to <code>\u007FF</code>, two bytes are used. Bits
- * 6-10 of the character value are encoded bits 0-4 of the first byte, with
- * the high bytes having a value of "110". Bits 0-5 of the character value
- * are stored in bits 0-5 of the second byte, with the high bits set to
- * "10". This type of encoding is also done for the null character
- * <code>\u0000</code>. This eliminates any C style NUL character values
- * in the output. All remaining characters are stored as three bytes.
- * Bits 12-15 of the character value are stored in bits 0-3 of the first
- * byte. The high bits of the first bytes are set to "1110". Bits 6-11
- * of the character value are stored in bits 0-5 of the second byte. The
- * high bits of the second byte are set to "10". And bits 0-5 of the
- * character value are stored in bits 0-5 of byte three, with the high bits
- * of that byte set to "10".
- *
- * The value written can be read using the <code>readUTF</code>
- * method in <code>DataInput</code>.
- *
- * @param value The <code>String</code> to write to the output in UTF format
- *
- * @exception IOException If an error occurs
- *
- * @see DataInput#readUTF
- */
- public final synchronized void writeUTF(String value) throws IOException
- {
- int len = value.length();
- int sum = 0;
-
- for (int i = 0; i < len && sum <= 65535; ++i)
- {
- char c = value.charAt(i);
- if (c >= '\u0001' && c <= '\u007f')
- sum += 1;
- else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff'))
- sum += 2;
- else
- sum += 3;
- }
-
- if (sum > 65535)
- throw new UTFDataFormatException ();
-
- int pos = 0;
- byte[] buf = new byte[sum];
-
- for (int i = 0; i < len; ++i)
- {
- char c = value.charAt(i);
- if (c >= '\u0001' && c <= '\u007f')
- buf[pos++] = (byte) c;
- else if (c == '\u0000' || (c >= '\u0080' && c <= '\u07ff'))
- {
- buf[pos++] = (byte) (0xc0 | (0x1f & (c >> 6)));
- buf[pos++] = (byte) (0x80 | (0x3f & c));
- }
- else
- {
- // JSL says the first byte should be or'd with 0xc0, but
- // that is a typo. Unicode says 0xe0, and that is what is
- // consistent with DataInputStream.
- buf[pos++] = (byte) (0xe0 | (0x0f & (c >> 12)));
- buf[pos++] = (byte) (0x80 | (0x3f & (c >> 6)));
- buf[pos++] = (byte) (0x80 | (0x3f & c));
- }
- }
-
- writeShort (sum);
- write(buf, 0, sum);
- }
-
-} // class DataOutputStream
-
diff --git a/libjava/java/io/EOFException.java b/libjava/java/io/EOFException.java
deleted file mode 100644
index cfedb7d9eb0..00000000000
--- a/libjava/java/io/EOFException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* EOFException.java -- unexpected end of file exception
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when the end of the file or stream was
- * encountered unexpectedly. This is not the normal way that an EOF
- * condition is reported; such as a special value like -1 being returned.
- * However, certain types of streams expecting certain data in a certain
- * format might reach EOF before reading their expected data pattern and
- * thus throw this exception.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class EOFException extends IOException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 6433858223774886977L;
-
- /**
- * Create an exception without a descriptive error message.
- */
- public EOFException()
- {
- }
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public EOFException(String message)
- {
- super(message);
- }
-} // class EOFException
diff --git a/libjava/java/io/Externalizable.java b/libjava/java/io/Externalizable.java
deleted file mode 100644
index 113c19ff60f..00000000000
--- a/libjava/java/io/Externalizable.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Externalizable.java -- Interface for saving and restoring object data
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This interface provides a way that classes can completely control how
- * the data of their object instances are written and read to and from
- * streams. It has two methods which are used to write the data to a stream
- * and to read the data from a stream. The read method must read the data
- * in exactly the way it was written by the write method.
- * <p>
- * Note that classes which implement this interface must take into account
- * that all superclass data must also be written to the stream as well.
- * The class implementing this interface must figure out how to make that
- * happen.
- * <p>
- * This interface can be used to provide object persistence. When an
- * object is to be stored externally, the <code>writeExternal</code> method is
- * called to save state. When the object is restored, an instance is
- * created using the default no-argument constructor and the
- * <code>readExternal</code> method is used to restore the state.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Externalizable extends Serializable
-{
- /**
- * This method restores an object's state by reading in the instance data
- * for the object from the passed in stream. Note that this stream is not
- * a subclass of <code>InputStream</code>, but rather is a class that
- * implements
- * the <code>ObjectInput</code> interface. That interface provides a
- * mechanism for
- * reading in Java data types from a stream.
- * <p>
- * Note that this method must be compatible with <code>writeExternal</code>.
- * It must read back the exact same types that were written by that
- * method in the exact order they were written.
- * <p>
- * If this method needs to read back an object instance, then the class
- * for that object must be found and loaded. If that operation fails,
- * then this method throws a <code>ClassNotFoundException</code>
- *
- * @param in An <code>ObjectInput</code> instance for reading in the object
- * state
- *
- * @exception ClassNotFoundException If the class of an object being
- * restored cannot be found
- * @exception IOException If any other error occurs
- */
- void readExternal(ObjectInput in)
- throws ClassNotFoundException, IOException;
-
- /**
- * This method is responsible for writing the instance data of an object
- * to the passed in stream. Note that this stream is not a subclass of
- * <code>OutputStream</code>, but rather is a class that implements the
- * <code>ObjectOutput</code> interface. That interface provides a
- * number of methods
- * for writing Java data values to a stream.
- * <p>
- * Not that the implementation of this method must be coordinated with
- * the implementation of <code>readExternal</code>.
- *
- * @param out An <code>ObjectOutput</code> instance for writing the
- * object state
- *
- * @exception IOException If an error occurs
- */
- void writeExternal(ObjectOutput out) throws IOException;
-}
diff --git a/libjava/java/io/FileDescriptor.java b/libjava/java/io/FileDescriptor.java
deleted file mode 100644
index d300c9cb617..00000000000
--- a/libjava/java/io/FileDescriptor.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/* FileDescriptor.java -- Opaque file handle class
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-import gnu.java.nio.channels.FileChannelImpl;
-
-import java.nio.channels.ByteChannel;
-import java.nio.channels.FileChannel;
-
-/**
- * This class represents an opaque file handle as a Java class. It should
- * be used only to pass to other methods that expect an object of this
- * type. No system specific information can be obtained from this object.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @date September 24, 1998
- */
-public final class FileDescriptor
-{
- /**
- * A <code>FileDescriptor</code> representing the system standard input
- * stream. This will usually be accessed through the
- * <code>System.in</code>variable.
- */
- public static final FileDescriptor in
- = new FileDescriptor (FileChannelImpl.in);
-
- /**
- * A <code>FileDescriptor</code> representing the system standard output
- * stream. This will usually be accessed through the
- * <code>System.out</code>variable.
- */
- public static final FileDescriptor out
- = new FileDescriptor (FileChannelImpl.out);
-
- /**
- * A <code>FileDescriptor</code> representing the system standard error
- * stream. This will usually be accessed through the
- * <code>System.err</code>variable.
- */
- public static final FileDescriptor err
- = new FileDescriptor (FileChannelImpl.err);
-
- final ByteChannel channel;
-
- /**
- * This method is used to initialize an invalid FileDescriptor object.
- */
- public FileDescriptor()
- {
- channel = null;
- }
-
- /**
- * This method is used to initialize a FileDescriptor object.
- */
- FileDescriptor(ByteChannel channel)
- {
- this.channel = channel;
- }
-
-
- /**
- * This method forces all data that has not yet been physically written to
- * the underlying storage medium associated with this
- * <code>FileDescriptor</code>
- * to be written out. This method will not return until all data has
- * been fully written to the underlying device. If the device does not
- * support this functionality or if an error occurs, then an exception
- * will be thrown.
- */
- public void sync () throws SyncFailedException
- {
- if (channel instanceof FileChannel)
- {
- try
- {
- ((FileChannel) channel).force(true);
- }
- catch (IOException ex)
- {
- if (ex instanceof SyncFailedException)
- throw (SyncFailedException) ex;
- else
- throw new SyncFailedException(ex.toString());
- }
- }
- }
-
- /**
- * This methods tests whether or not this object represents a valid open
- * native file handle.
- *
- * @return <code>true</code> if this object represents a valid
- * native file handle, <code>false</code> otherwise
- */
- public boolean valid ()
- {
- return channel != null && channel.isOpen();
- }
-}
diff --git a/libjava/java/io/FileFilter.java b/libjava/java/io/FileFilter.java
deleted file mode 100644
index e57ac9fd060..00000000000
--- a/libjava/java/io/FileFilter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* FileFilter.java -- Filter a list of pathnames
- Copyright (C) 1998,2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This interface has one method which is used for filtering pathnames
- * returned in a pathname listing. It is currently used by the
- * <code>File.listFiles(FileFilter)</code> method.
- * <p>
- * The method in this interface determines if a particular pathname should
- * or should not be included in the pathname listing.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- *
- * @see File#listFiles(java.io.FileFilter)
- */
-public interface FileFilter
-{
- /**
- * This method determines whether or not a given pathname should be included
- * in a pathname listing.
- *
- * @param pathname The pathname to test
- *
- * @return <code>true</code> if the path should be included in the list,
- * <code>false</code> otherwise.
- */
- boolean accept(File pathname);
-}
diff --git a/libjava/java/io/FileNotFoundException.java b/libjava/java/io/FileNotFoundException.java
deleted file mode 100644
index 3c11e296072..00000000000
--- a/libjava/java/io/FileNotFoundException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* FileNotFoundException.java -- the requested file could not be found
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when an attempt is made to access a file that
- * does not exist, or is inaccessible for some other reason (such as writing
- * a read-only file).
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class FileNotFoundException extends IOException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -897856973823710492L;
-
- /**
- * Create an exception without a descriptive error message.
- */
- public FileNotFoundException()
- {
- }
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public FileNotFoundException(String message)
- {
- super(message);
- }
-} // class FileNotFoundException
diff --git a/libjava/java/io/FilePermission.java b/libjava/java/io/FilePermission.java
deleted file mode 100644
index 356787bfa72..00000000000
--- a/libjava/java/io/FilePermission.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/* FilePermission.java --
- Copyright (C) 1998, 2000, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-import java.security.Permission;
-
-public final class FilePermission extends Permission implements Serializable
-{
- private static final long serialVersionUID = 7930732926638008763L;
-
- private static final String CURRENT_DIRECTORY =
- System.getProperty("user.dir");
-
- private static final String ALL_FILES = "<<ALL FILES>>";
-
- private boolean readPerm = false;
- private boolean writePerm = false;
- private boolean executePerm = false;
- private boolean deletePerm = false;
- private final String actionsString;
-
- // Checks and caches the actions
- private void checkPerms() throws IllegalArgumentException
- {
- String action;
- int i = actionsString.indexOf(',');
- int startI = 0;
- while (i != -1)
- {
- action = actionsString.substring(startI, i).trim().toLowerCase();
- if (action.equals("read"))
- readPerm = true;
- else if (action.equals("write"))
- writePerm = true;
- else if (action.equals("execute"))
- executePerm = true;
- else if (action.equals("delete"))
- deletePerm = true;
- else
- throw new IllegalArgumentException("Unknown action: " + action);
-
- startI = i + 1;
- i = actionsString.indexOf(',', startI);
- }
-
- action = actionsString.substring(startI).trim().toLowerCase();
- if (action.equals("read"))
- readPerm = true;
- else if (action.equals("write"))
- writePerm = true;
- else if (action.equals("execute"))
- executePerm = true;
- else if (action.equals("delete"))
- deletePerm = true;
- else
- throw new IllegalArgumentException("Unknown action: " + action);
- }
-
- /**
- * Create a new FilePermission.
- *
- * @param pathExpression an expression specifying the paths this
- * permission represents.
- * @param actionsString a comma-separated list of the actions this
- * permission represents. The actions must be "read", "write",
- * "execute" and/or "delete".
- */
- public FilePermission(String pathExpression, String actionsString)
- {
- // FIXME: what to do when the file string is malformed?
- super(pathExpression);
- if (pathExpression == null)
- throw new NullPointerException("pathExpression");
- if (actionsString == null)
- throw new IllegalArgumentException("actionsString");
- this.actionsString = actionsString;
- checkPerms();
- }
-
- /**
- * Get the actions this FilePermission supports.
- * @return the String representing the actions this FilePermission supports.
- */
- public String getActions()
- {
- return actionsString;
- }
-
- /**
- * Get the hash code for this Object.<P>
- * FilePermission's hash code is calculated as the exclusive or of the
- * target
- * String's hash code and the action String's hash code.
- * @specnote Sun did not specify how to calculate the hash code;
- * I made this up.
- * @return the hash code for this Object.
- */
- public int hashCode()
- {
- return getName().hashCode() ^ actionsString.hashCode();
- }
-
- /**
- * Check two FilePermissions for semantic equality.
- * Two FilePermissions are exactly equivalent if they have identical path
- * expressions and have exactly the same access permissions.
- * @param o the Object to compare to.
- * @return whether the Objects are semantically equivalent.
- */
- public boolean equals(Object o)
- {
- if (! (o instanceof FilePermission))
- return false;
- FilePermission p = (FilePermission) o;
-
- String f1 = getName();
- String f2 = p.getName();
-
- // Compare names, taking into account if they refer to a directory
- // and one has a separator and the other does not.
- if (f1.length() > 0 && f1.charAt(f1.length() - 1) == File.separatorChar)
- {
- if (f2.length() > 0
- && f2.charAt(f2.length() - 1) == File.separatorChar)
- {
- if (! f2.equals(f1))
- return false;
- }
- else
- {
- if (! f2.equals(f1.substring(0, f1.length() - 1)))
- return false;
- }
- }
- else
- {
- if (f2.length() > 0
- && f2.charAt(f2.length() - 1) == File.separatorChar)
- {
- if (! f1.equals(f2.substring(0, f2.length() - 1)))
- return false;
- }
- else
- {
- if (! f1.equals(f2))
- return false;
- }
- }
- return (readPerm == p.readPerm
- && writePerm == p.writePerm
- && executePerm == p.executePerm
- && deletePerm == p.deletePerm);
- }
-
- /**
- * Check to see if this permission implies another.
- * Permission A implies permission B if these things are all true:
- * <OL>
- * <LI>A and B are both FilePermissions.</LI>
- * <LI>All possible files in B are included in A
- * (possibly more are in A).</LI>
- * <LI>All actions B supports, A also supports.</LI>
- * </OL>
- * @param p the Permission to compare against.
- * @return whether this Permission implies p
- */
- public boolean implies(Permission p)
- {
- if (! (p instanceof FilePermission))
- return false;
-
- String f1 = getName();
-
- if (f1.equals(ALL_FILES))
- return true;
-
- FilePermission fp = (FilePermission) p;
- String f2 = fp.getName();
-
- if (f1.charAt(0) != File.separatorChar)
- f1 = CURRENT_DIRECTORY + f1;
- if (f2.charAt(0) != File.separatorChar)
- f2 = CURRENT_DIRECTORY + f2;
-
- String sub1;
-
- switch (f1.charAt(f1.length() - 1))
- {
- case '*':
- sub1 = f1.substring(0, f1.length() - 1); // chop off "*"
- if (f2.length() <= sub1.length())
- {
- // If it's smaller, there is no way it could be part of
- // this directory. If it's the same (or length - 1), it
- // could be the same directory but specifies access to
- // the directory rather than the files in it.
- return false;
- }
- else if (f2.charAt(sub1.length() - 1) == File.separatorChar)
- {
- // Make sure the part before the "/" is the same.
- if (! f2.substring(0, sub1.length()).equals(sub1))
- return false;
- // Make sure there are no subdirectories specified
- // underneath this one.
- if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar)
- != -1)
- return false;
- }
- else
- {
- // Obviously not equal: f2 is either not a directory or
- // is not the same directory (its name continues further
- // than we want).
- return false;
- }
- break;
- case '-':
- // Chop off "/-".
- sub1 = f1.substring(0, f1.length() - 2);
- if (f2.length() < sub1.length())
- {
- // If it's smaller, there is no way it could be part of
- // this directory.
- return false;
- }
- else if (f2.length() > sub1.length()
- && f2.charAt(sub1.length()) != File.separatorChar)
- return false;
- else if (! f2.substring(0, sub1.length()).equals(sub1))
- return false;
- break;
-
- default:
- if (f2.charAt(f2.length() - 1) == File.separatorChar)
- {
- if (! f1.equals(f2.substring(0, f2.length() - 1)))
- return false;
- }
- else if (!f1.equals(f2))
- return false;
- break;
- }
-
- if (readPerm && ! fp.readPerm)
- return false;
- if (writePerm && ! fp.writePerm)
- return false;
- if (executePerm && ! fp.executePerm)
- return false;
- if (deletePerm && ! fp.deletePerm)
- return false;
-
- return true;
- }
-}
diff --git a/libjava/java/io/FileReader.java b/libjava/java/io/FileReader.java
deleted file mode 100644
index 4a1dd5ff4ce..00000000000
--- a/libjava/java/io/FileReader.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* FileReader.java -- Convenience class for reading characters from a file
- Copyright (C) 1998, 2000, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This class provides a convenient way to set up a <code>Reader</code>
- * to read from a file. It opens the specified file for reading and creates
- * the <code>InputStreamReader</code> to read from the
- * resulting <code>FileInputStream</code>. This class can only be used
- * to read from files using the default character encoding. Use
- * <code>InputStreamReader</code> directly to use a non-default encoding.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class FileReader extends InputStreamReader
-{
- /**
- * This method initializes a <code>FileReader</code> instance to read from
- * the specified <code>File</code> object.
- *
- * @param file The <code>File</code> object representing the file to read from
- *
- * @exception FileNotFoundException If the file is not found or some other
- * error occurs
- */
- public FileReader(File file) throws FileNotFoundException
- {
- super(new FileInputStream(file));
- }
-
- /**
- * This method initializes a <code>FileReader</code> instance to read from
- * this specified <code>FileDescriptor</code> object.
- *
- * @param fd The <code>FileDescriptor</code> to read from.
- */
- public FileReader(FileDescriptor fd)
- {
- super(new FileInputStream(fd));
- }
-
- /**
- * This method initializes a <code>FileReader</code> instance to read from
- * the specified named file.
- *
- * @param name The name of the file to read from
- *
- * @exception FileNotFoundException If the file is not found or some other
- * error occurs
- */
- public FileReader(String name) throws FileNotFoundException
- {
- super(new FileInputStream(name));
- }
-} // class FileReader
-
diff --git a/libjava/java/io/FileWriter.java b/libjava/java/io/FileWriter.java
deleted file mode 100644
index b34db83231e..00000000000
--- a/libjava/java/io/FileWriter.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* FileWriter.java -- Convenience class for writing to files.
- Copyright (C) 1998, 1999, 2001, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * Status: Complete to version 1.1.
- */
-
-/**
- * This is a convenience class for writing to files. It creates an
- * <code>FileOutputStream</code> and initializes an
- * <code>OutputStreamWriter</code> to write to it.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- */
-public class FileWriter extends OutputStreamWriter
-{
- /**
- * This method initializes a new <code>FileWriter</code> object to write
- * to the specified <code>File</code> object.
- *
- * @param file The <code>File</code> object to write to.
- *
- * @throws SecurityException If writing to this file is forbidden by the
- * <code>SecurityManager</code>.
- * @throws IOException If any other error occurs
- */
- public FileWriter(File file) throws SecurityException, IOException
- {
- super(new FileOutputStream(file));
- }
-
- /**
- * This method initializes a new <code>FileWriter</code> object to write
- * to the specified <code>File</code> object.
- *
- * @param file The <code>File</code> object to write to.
- * @param append <code>true</code> to start adding data at the end of the
- * file, <code>false</code> otherwise.
- *
- * @throws SecurityException If writing to this file is forbidden by the
- * <code>SecurityManager</code>.
- * @throws IOException If any other error occurs
- */
- public FileWriter(File file, boolean append) throws IOException
- {
- super(new FileOutputStream(file, append));
- }
-
- /**
- * This method initializes a new <code>FileWriter</code> object to write
- * to the specified <code>FileDescriptor</code> object.
- *
- * @param fd The <code>FileDescriptor</code> object to write to
- *
- * @throws SecurityException If writing to this file is forbidden by the
- * <code>SecurityManager</code>.
- */
- public FileWriter(FileDescriptor fd) throws SecurityException
- {
- super(new FileOutputStream(fd));
- }
-
- /**
- * This method intializes a new <code>FileWriter</code> object to
- * write to the
- * specified named file.
- *
- * @param name The name of the file to write to
- *
- * @throws SecurityException If writing to this file is forbidden by the
- * <code>SecurityManager</code>.
- * @throws IOException If any other error occurs
- */
- public FileWriter(String name) throws IOException
- {
- super(new FileOutputStream(name));
- }
-
- /**
- * This method intializes a new <code>FileWriter</code> object to
- * write to the
- * specified named file. This form of the constructor allows the caller
- * to determin whether data should be written starting at the beginning or
- * the end of the file.
- *
- * @param name The name of the file to write to
- * @param append <code>true</code> to start adding data at the end of the
- * file, <code>false</code> otherwise.
- *
- * @throws SecurityException If writing to this file is forbidden by the
- * <code>SecurityManager</code>.
- * @throws IOException If any other error occurs
- */
- public FileWriter(String name, boolean append) throws IOException
- {
- super(new FileOutputStream(name, append));
- }
-}
diff --git a/libjava/java/io/FilenameFilter.java b/libjava/java/io/FilenameFilter.java
deleted file mode 100644
index 57b4d3b182c..00000000000
--- a/libjava/java/io/FilenameFilter.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* FilenameFilter.java -- Filter a list of filenames
- Copyright (C) 1998, 1999, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * Status: Complete to 1.1.
- */
-
-/**
- * This interface has one method which is used for filtering filenames
- * returned in a directory listing. It is currently used by the
- * <code>File.list(FilenameFilter)</code> method and by the filename
- * dialog in AWT.
- * <p>
- * The method in this interface determines if a particular file should
- * or should not be included in the file listing.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- *
- * @see File#listFiles(java.io.FilenameFilter)
- * @see java.awt.FileDialog#setFilenameFilter(java.io.FilenameFilter)
- */
-public interface FilenameFilter
-{
- /**
- * This method determines whether or not a given file should be included
- * in a directory listing.
- *
- * @param dir The <code>File</code> instance for the directory being read
- * @param name The name of the file to test
- *
- * @return <code>true</code> if the file should be included in the list,
- * <code>false</code> otherwise.
- */
- boolean accept(File dir, String name);
-
-} // interface FilenameFilter
-
diff --git a/libjava/java/io/FilterInputStream.java b/libjava/java/io/FilterInputStream.java
deleted file mode 100644
index d3cb9e4f71f..00000000000
--- a/libjava/java/io/FilterInputStream.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/* FilterInputStream.java -- Base class for classes that filter input
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct.
- */
-
-/**
- * This is the common superclass of all standard classes that filter
- * input. It acts as a layer on top of an underlying <code>InputStream</code>
- * and simply redirects calls made to it to the subordinate InputStream
- * instead. Subclasses of this class perform additional filtering
- * functions in addition to simply redirecting the call.
- * <p>
- * This class is not abstract. However, since it only redirects calls
- * to a subordinate <code>InputStream</code> without adding any functionality
- * on top of it, this class should not be used directly. Instead, various
- * subclasses of this class should be used. This is enforced with a
- * protected constructor. Do not try to hack around it.
- * <p>
- * When creating a subclass of <code>FilterInputStream</code>, override the
- * appropriate methods to implement the desired filtering. However, note
- * that the <code>read(byte[])</code> method does not need to be overridden
- * as this class redirects calls to that method to
- * <code>read(byte[], int, int)</code> instead of to the subordinate
- * <code>InputStream read(byte[])</code> method.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public class FilterInputStream extends InputStream
-{
- /**
- * This is the subordinate <code>InputStream</code> to which method calls
- * are redirected
- */
- protected InputStream in;
-
- /**
- * Create a <code>FilterInputStream</code> with the specified subordinate
- * <code>InputStream</code>.
- *
- * @param in The subordinate <code>InputStream</code>
- */
- protected FilterInputStream(InputStream in)
- {
- this.in = in;
- }
-
- /**
- * Calls the <code>in.mark(int)</code> method.
- *
- * @param readlimit The parameter passed to <code>in.mark(int)</code>
- */
- public void mark(int readlimit)
- {
- in.mark(readlimit);
- }
-
- /**
- * Calls the <code>in.markSupported()</code> method.
- *
- * @return <code>true</code> if mark/reset is supported, <code>false</code>
- * otherwise
- */
- public boolean markSupported()
- {
- return in.markSupported();
- }
-
- /**
- * Calls the <code>in.reset()</code> method.
- *
- * @exception IOException If an error occurs
- */
- public void reset() throws IOException
- {
- in.reset();
- }
-
- /**
- * Calls the <code>in.available()</code> method.
- *
- * @return The value returned from <code>in.available()</code>
- *
- * @exception IOException If an error occurs
- */
- public int available() throws IOException
- {
- return in.available();
- }
-
- /**
- * Calls the <code>in.skip(long)</code> method
- *
- * @param numBytes The requested number of bytes to skip.
- *
- * @return The value returned from <code>in.skip(long)</code>
- *
- * @exception IOException If an error occurs
- */
- public long skip(long numBytes) throws IOException
- {
- return in.skip(numBytes);
- }
-
- /**
- * Calls the <code>in.read()</code> method
- *
- * @return The value returned from <code>in.read()</code>
- *
- * @exception IOException If an error occurs
- */
- public int read() throws IOException
- {
- return in.read();
- }
-
- /**
- * Calls the <code>read(byte[], int, int)</code> overloaded method.
- * Note that
- * this method does not redirect its call directly to a corresponding
- * method in <code>in</code>. This allows subclasses to override only the
- * three argument version of <code>read</code>.
- *
- * @param buf The buffer to read bytes into
- *
- * @return The value retured from <code>in.read(byte[], int, int)</code>
- *
- * @exception IOException If an error occurs
- */
- public int read(byte[] buf) throws IOException
- {
- return read(buf, 0, buf.length);
- }
-
- /**
- * Calls the <code>in.read(byte[], int, int)</code> method.
- *
- * @param buf The buffer to read bytes into
- * @param offset The index into the buffer to start storing bytes
- * @param len The maximum number of bytes to read.
- *
- * @return The value retured from <code>in.read(byte[], int, int)</code>
- *
- * @exception IOException If an error occurs
- */
- public int read(byte[] buf, int offset, int len) throws IOException
- {
- return in.read(buf, offset, len);
- }
-
- /**
- * This method closes the input stream by closing the input stream that
- * this object is filtering. Future attempts to access this stream may
- * throw an exception.
- *
- * @exception IOException If an error occurs
- */
- public void close() throws IOException
- {
- in.close();
- }
-}
diff --git a/libjava/java/io/FilterOutputStream.java b/libjava/java/io/FilterOutputStream.java
deleted file mode 100644
index 4c2dfc04a65..00000000000
--- a/libjava/java/io/FilterOutputStream.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/* FilterOutputStream.java -- Parent class for output streams that filter
- Copyright (C) 1998, 1999, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * Status: Complete to version 1.1.
- */
-
-/**
- * This class is the common superclass of output stream classes that
- * filter the output they write. These classes typically transform the
- * data in some way prior to writing it out to another underlying
- * <code>OutputStream</code>. This class simply overrides all the
- * methods in <code>OutputStream</code> to redirect them to the
- * underlying stream. Subclasses provide actual filtering.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- */
-public class FilterOutputStream extends OutputStream
-{
- /**
- * This is the subordinate <code>OutputStream</code> that this class
- * redirects its method calls to.
- */
- protected OutputStream out;
-
- /**
- * This method initializes an instance of <code>FilterOutputStream</code>
- * to write to the specified subordinate <code>OutputStream</code>.
- *
- * @param out The <code>OutputStream</code> to write to
- */
- public FilterOutputStream(OutputStream out)
- {
- this.out = out;
- }
-
- /**
- * This method closes the underlying <code>OutputStream</code>. Any
- * further attempts to write to this stream may throw an exception.
- *
- * @exception IOException If an error occurs
- */
- public void close() throws IOException
- {
- flush();
- out.close();
- }
-
- /**
- * This method attempt to flush all buffered output to be written to the
- * underlying output sink.
- *
- * @exception IOException If an error occurs
- */
- public void flush() throws IOException
- {
- out.flush();
- }
-
- /**
- * This method writes a single byte of output to the underlying
- * <code>OutputStream</code>.
- *
- * @param b The byte to write, passed as an int.
- *
- * @exception IOException If an error occurs
- */
- public void write(int b) throws IOException
- {
- out.write(b);
- }
-
- /**
- * This method writes all the bytes in the specified array to the underlying
- * <code>OutputStream</code>. It does this by calling the three parameter
- * version of this method - <code>write(byte[], int, int)</code> in this
- * class instead of writing to the underlying <code>OutputStream</code>
- * directly. This allows most subclasses to avoid overriding this method.
- *
- * @param buf The byte array to write bytes from
- *
- * @exception IOException If an error occurs
- */
- public void write(byte[] buf) throws IOException
- {
- // Don't do checking here, per Java Lang Spec.
- write(buf, 0, buf.length);
- }
-
- /**
- * This method calls the <code>write(int)</code> method <code>len</code>
- * times for all bytes from the array <code>buf</code> starting at index
- * <code>offset</code>. Subclasses should overwrite this method to get a
- * more efficient implementation.
- *
- * @param buf The byte array to write bytes from
- * @param offset The index into the array to start writing bytes from
- * @param len The number of bytes to write
- *
- * @exception IOException If an error occurs
- */
- public void write(byte[] buf, int offset, int len) throws IOException
- {
- // Don't do checking here, per Java Lang Spec.
- for (int i=0; i < len; i++)
- write(buf[offset + i]);
-
- }
-
-} // class FilterOutputStream
-
diff --git a/libjava/java/io/FilterReader.java b/libjava/java/io/FilterReader.java
deleted file mode 100644
index 2bd040a7f72..00000000000
--- a/libjava/java/io/FilterReader.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/* FilterReader.java -- Base class for char stream classes that filter input
- Copyright (C) 1998, 1999, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct.
- */
-
-/**
- * This is the common superclass of all standard classes that filter
- * input. It acts as a layer on top of an underlying <code>Reader</code>
- * and simply redirects calls made to it to the subordinate Reader
- * instead. Subclasses of this class perform additional filtering
- * functions in addition to simply redirecting the call.
- * <p>
- * When creating a subclass of <code>FilterReader</code>, override the
- * appropriate methods to implement the desired filtering. However, note
- * that the <code>read(char[])</code> method does not need to be overridden
- * as this class redirects calls to that method to
- * <code>read(yte[], int, int)</code> instead of to the subordinate
- * <code>Reader} read(yte[])</code> method.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public abstract class FilterReader extends Reader
-{
- /**
- * This is the subordinate <code>Reader</code> to which method calls
- * are redirected
- */
- protected Reader in;
-
- /**
- * Create a <code>FilterReader</code> with the specified subordinate
- * <code>Reader</code>.
- * The <code>lock</code> of the new <code>FilterReader</code> will be set
- * to <code>in.lock</code>.
- *
- * @param in The subordinate <code>Reader</code>
- */
- protected FilterReader(Reader in)
- {
- super(in.lock);
- this.in = in;
- }
-
- /**
- * Calls the <code>in.mark(int)</code> method.
- *
- * @param readlimit The parameter passed to <code>in.mark(int)</code>
- *
- * @exception IOException If an error occurs
- */
- public void mark(int readlimit) throws IOException
- {
- in.mark(readlimit);
- }
-
- /**
- * Calls the <code>in.markSupported()</code> method.
- *
- * @return <code>true</code> if mark/reset is supported,
- * <code>false</code> otherwise
- */
- public boolean markSupported()
- {
- return(in.markSupported());
- }
-
- /**
- * Calls the <code>in.reset()</code> method.
- *
- * @exception IOException If an error occurs
- */
- public void reset() throws IOException
- {
- in.reset();
- }
-
- /**
- * Calls the <code>in.read()</code> method.
- *
- * @return The value returned from <code>in.available()</code>
- *
- * @exception IOException If an error occurs
- */
- public boolean ready() throws IOException
- {
- return(in.ready());
- }
-
- /**
- * Calls the <code>in.skip(long)</code> method
- *
- * @param numBytes The requested number of chars to skip.
- *
- * @return The value returned from <code>in.skip(long)</code>
- *
- * @exception IOException If an error occurs
- */
- public long skip(long num_chars) throws IOException
- {
- return(in.skip(num_chars));
- }
-
- /**
- * Calls the <code>in.read()</code> method
- *
- * @return The value returned from <code>in.read()</code>
- *
- * @exception IOException If an error occurs
- */
- public int read() throws IOException
- {
- return(in.read());
- }
-
- /**
- * Calls the <code>in.read(char[], int, int)</code> method.
- *
- * @param buf The buffer to read chars into
- * @param offset The index into the buffer to start storing chars
- * @param len The maximum number of chars to read.
- *
- * @return The value retured from <code>in.read(char[], int, int)</code>
- *
- * @exception IOException If an error occurs
- */
- public int read(char[] buf, int offset, int len) throws IOException
- {
- return(in.read(buf, offset, len));
- }
-
- /**
- * This method closes the stream by calling the <code>close()</code> method
- * of the underlying stream.
- *
- * @exception IOException If an error occurs
- */
- public void close() throws IOException
- {
- in.close();
- }
-
-} // class FilterReader
-
diff --git a/libjava/java/io/FilterWriter.java b/libjava/java/io/FilterWriter.java
deleted file mode 100644
index 9b9ce33f9f6..00000000000
--- a/libjava/java/io/FilterWriter.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/* FilterWriter.java -- Parent class for output streams that filter
- Copyright (C) 1998, 1999, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * Status: Complete to version 1.1.
- */
-
-/**
- * This class is the common superclass of output character stream classes
- * that filter the output they write. These classes typically transform the
- * data in some way prior to writing it out to another underlying
- * <code>Writer</code>. This class simply overrides all the
- * methods in <code>Writer</code> to redirect them to the
- * underlying stream. Subclasses provide actual filtering.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- */
-public abstract class FilterWriter extends Writer
-{
- /**
- * This is the subordinate <code>Writer</code> that this class
- * redirects its method calls to.
- */
- protected Writer out;
-
- /**
- * This method initializes an instance of <code>FilterWriter</code>
- * to write to the specified subordinate <code>Writer</code>.
- * The given <code>Writer</code> will be used as <code>lock</code> for
- * the newly created <code>FilterWriter</code>.
- *
- * @param out The <code>Writer</code> to write to
- */
- protected FilterWriter(Writer out)
- {
- super(out.lock);
- this.out = out;
- }
-
- /**
- * This method closes the underlying <code>Writer</code>. Any
- * further attempts to write to this stream may throw an exception.
- *
- * @exception IOException If an error occurs
- */
- public void close() throws IOException
- {
- out.close();
- }
-
- /**
- * This method attempt to flush all buffered output to be written to the
- * underlying output sink.
- *
- * @exception IOException If an error occurs
- */
- public void flush() throws IOException
- {
- out.flush();
- }
-
- /**
- * This method writes a single char of output to the underlying
- * <code>Writer</code>.
- *
- * @param b The char to write, passed as an int.
- *
- * @exception IOException If an error occurs
- */
- public void write(int b) throws IOException
- {
- out.write(b);
- }
-
- /**
- * This method writes <code>len</code> chars from the array <code>buf</code>
- * starting at index <code>offset</code> to the underlying
- * <code>Writer</code>.
- *
- * @param buf The char array to write chars from
- * @param offset The index into the array to start writing chars from
- * @param len The number of chars to write
- *
- * @exception IOException If an error occurs
- */
- public void write(char[] buf, int offset, int len) throws IOException
- {
- out.write(buf, offset, len);
- }
-
- /**
- * This method writes <code>len</code> chars from the <code>String</code>
- * starting at position <code>offset</code>.
- *
- * @param str The <code>String</code> that is to be written
- * @param offset The character offset into the <code>String</code>
- * to start writing from
- * @param len The number of chars to write
- *
- * @exception IOException If an error occurs
- */
- public void write(String str, int offset, int len) throws IOException
- {
- out.write(str, offset, len);
- }
-
-} // class FilterWriter
-
diff --git a/libjava/java/io/IOException.java b/libjava/java/io/IOException.java
deleted file mode 100644
index cf3ad194633..00000000000
--- a/libjava/java/io/IOException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* IOException.java -- Generic input/output exception
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown to indicate an I/O problem of some sort
- * occurred. Since this is a fairly generic exception, often a subclass
- * of IOException will actually be thrown in order to provide a more
- * detailed indication of what happened.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class IOException extends Exception
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 7818375828146090155L;
-
- /**
- * Create an exception without a descriptive error message.
- */
- public IOException()
- {
- }
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public IOException(String message)
- {
- super(message);
- }
-} // class IOException
diff --git a/libjava/java/io/InputStream.java b/libjava/java/io/InputStream.java
deleted file mode 100644
index 86d1cd74914..00000000000
--- a/libjava/java/io/InputStream.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/* InputStream.java -- Base class for input
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This abstract class forms the base of the hierarchy of classes that read
- * input as a stream of bytes. It provides a common set of methods for
- * reading bytes from streams. Subclasses implement and extend these
- * methods to read bytes from a particular input source such as a file
- * or network connection.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public abstract class InputStream
-{
- /**
- * Default, no-arg, public constructor
- */
- public InputStream()
- {
- }
-
- /**
- * This method returns the number of bytes that can be read from this
- * stream before a read can block. A return of 0 indicates that blocking
- * might (or might not) occur on the very next read attempt.
- * <p>
- * This method always returns 0 in this class
- *
- * @return The number of bytes that can be read before blocking could occur
- *
- * @exception IOException If an error occurs
- */
- public int available() throws IOException
- {
- return 0;
- }
-
- /**
- * This method closes the stream. Any futher attempts to read from the
- * stream may generate an <code>IOException</code>
- * <p>
- * This method does nothing in this class, but subclasses may override
- * this method in order to provide additional functionality.
- *
- * @exception IOException If an error occurs, which can only happen
- * in a subclass
- */
- public void close() throws IOException
- {
- // Do nothing
- }
-
- /**
- * This method marks a position in the input to which the stream can
- * be "reset" by calling the <code>reset()</code> method. The
- * parameter @code{readlimit} is the number of bytes that can be read
- * from the stream after setting the mark before the mark becomes
- * invalid. For example, if <code>mark()</code> is called with a
- * read limit of 10, then when 11 bytes of data are read from the
- * stream before the <code>reset()</code> method is called, then the
- * mark is invalid and the stream object instance is not required to
- * remember the mark.
- * <p>
- * This method does nothing in this class, but subclasses may override it
- * to provide mark/reset functionality.
- *
- * @param readLimit The number of bytes that can be read before the
- * mark becomes invalid
- */
- public void mark(int readLimit)
- {
- // Do nothing
- }
-
- /**
- * This method returns a boolean that indicates whether the mark/reset
- * methods are supported in this class. Those methods can be used to
- * remember a specific point in the stream and reset the stream to that
- * point.
- * <p>
- * This method always returns <code>false</code> in this class, but
- * subclasses can override this method to return <code>true</code>
- * if they support mark/reset functionality.
- *
- * @return <code>true</code> if mark/reset functionality is
- * supported, <code>false</code> otherwise
- */
- public boolean markSupported()
- {
- return false;
- }
-
- /**
- * This method reads an unsigned byte from the input stream and returns it
- * as an int in the range of 0-255. This method also will return -1 if
- * the end of the stream has been reached.
- * <p>
- * This method will block until the byte can be read.
- *
- * @return The byte read or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
- public abstract int read() throws IOException;
-
- /**
- * This method reads bytes from a stream and stores them into a caller
- * supplied buffer. This method attempts to completely fill the buffer,
- * but can return before doing so. The actual number of bytes read is
- * returned as an int. A -1 is returned to indicate the end of the stream.
- * <p>
- * This method will block until some data can be read.
- * <p>
- * This method operates by calling an overloaded read method like so:
- * <code>read(b, 0, b.length)</code>
- *
- * @param b The buffer into which the bytes read will be stored.
- *
- * @return The number of bytes read or -1 if end of stream.
- *
- * @exception IOException If an error occurs.
- */
- public int read(byte[] b) throws IOException
- {
- return read(b, 0, b.length);
- }
-
- /**
- * This method read bytes from a stream and stores them into a
- * caller supplied buffer. It starts storing the data at index
- * <code>off</code> into the buffer and attempts to read
- * <code>len</code> bytes. This method can return before reading the
- * number of bytes requested. The actual number of bytes read is
- * returned as an int. A -1 is returned to indicate the end of the
- * stream.
- * <p>
- * This method will block until some data can be read.
- * <p>
- * This method operates by calling the single byte <code>read()</code> method
- * in a loop until the desired number of bytes are read. The read loop
- * stops short if the end of the stream is encountered or if an IOException
- * is encountered on any read operation except the first. If the first
- * attempt to read a bytes fails, the IOException is allowed to propagate
- * upward. And subsequent IOException is caught and treated identically
- * to an end of stream condition. Subclasses can (and should if possible)
- * override this method to provide a more efficient implementation.
- *
- * @param b The array into which the bytes read should be stored
- * @param off The offset into the array to start storing bytes
- * @param len The requested number of bytes to read
- *
- * @return The actual number of bytes read, or -1 if end of stream.
- *
- * @exception IOException If an error occurs.
- */
- public int read(byte[] b, int off, int len) throws IOException
- {
- if (off < 0 || len < 0 || off + len > b.length)
- throw new IndexOutOfBoundsException();
- if (b.length == 0)
- return 0;
-
- int i, ch;
-
- for (i = 0; i < len; ++i)
- try
- {
- if ((ch = read()) < 0)
- return i == 0 ? -1 : i; // EOF
- b[off + i] = (byte) ch;
- }
- catch (IOException ex)
- {
- // Only reading the first byte should cause an IOException.
- if (i == 0)
- throw ex;
- return i;
- }
-
- return i;
- }
-
- /**
- * This method resets a stream to the point where the
- * <code>mark()</code> method was called. Any bytes that were read
- * after the mark point was set will be re-read during subsequent
- * reads.
- * <p>
- * This method always throws an IOException in this class, but subclasses
- * can override this method if they provide mark/reset functionality.
- *
- * @exception IOException Always thrown for this class
- */
- public void reset() throws IOException
- {
- throw new IOException("mark/reset not supported");
- }
-
- /**
- * This method skips the specified number of bytes in the stream. It
- * returns the actual number of bytes skipped, which may be less than the
- * requested amount.
- * <p>
- * This method reads and discards bytes into a byte array until the
- * specified number of bytes were skipped or until either the end of stream
- * is reached or a read attempt returns a short count. Subclasses can
- * override this metho to provide a more efficient implementation where
- * one exists.
- *
- * @param n The requested number of bytes to skip
- *
- * @return The actual number of bytes skipped.
- *
- * @exception IOException If an error occurs
- */
- public long skip(long n) throws IOException
- {
- // Throw away n bytes by reading them into a temp byte[].
- // Limit the temp array to 2Kb so we don't grab too much memory.
- final int buflen = n > 2048 ? 2048 : (int) n;
- byte[] tmpbuf = new byte[buflen];
- final long origN = n;
-
- while (n > 0L)
- {
- int numread = read(tmpbuf, 0, n > buflen ? buflen : (int) n);
- if (numread <= 0)
- break;
- n -= numread;
- }
-
- return origN - n;
- }
-}
diff --git a/libjava/java/io/InterruptedIOException.java b/libjava/java/io/InterruptedIOException.java
deleted file mode 100644
index 96ec83649f8..00000000000
--- a/libjava/java/io/InterruptedIOException.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* InterruptedIOException.java -- an I/O operation was interrupted
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when a in process I/O operation is interrupted
- * for some reason. The field bytesTransferred will contain the number of
- * bytes that were read/written prior to the interruption.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @see Thread#interrupt()
- * @status updated to 1.4
- */
-public class InterruptedIOException extends IOException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 4020568460727500567L;
-
- /**
- * The number of bytes read/written prior to the interruption.
- *
- * @serial count of bytes successfully transferred
- */
- public int bytesTransferred;
-
- /**
- * Create an extends without a descriptive error message.
- */
- public InterruptedIOException()
- {
- }
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public InterruptedIOException(String message)
- {
- super(message);
- }
-
- /**
- * Create an exception with a descriptive error message and count of
- * bytes transferred.
- *
- * @param message the descriptive error message
- * @param bytesTransferred number of bytes tranferred before interruption
- */
- InterruptedIOException(String message, int bytesTransferred)
- {
- super(message);
- this.bytesTransferred = bytesTransferred;
- }
-} // class InterruptedIOException
diff --git a/libjava/java/io/InvalidClassException.java b/libjava/java/io/InvalidClassException.java
deleted file mode 100644
index c71b0c67fc7..00000000000
--- a/libjava/java/io/InvalidClassException.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/* InvalidClassException.java -- deserializing a class failed
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when there is some sort of problem with a
- * class during a serialization operation. This could be:<br><ul>
- * <li>the serial version of the class doesn't match</li>
- * <li>the class contains unknown datatypes</li>
- * <li>the class does not have an accessible no-arg constructor</li>
- * </ul>.
- *
- * <p>The field <code>classname</code> will contain the name of the
- * class that caused the problem if known. The getMessage() method
- * for this exception will always include the name of that class
- * if known.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class InvalidClassException extends ObjectStreamException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -4333316296251054416L;
-
- /**
- * The name of the class which encountered the error.
- *
- * @serial the classname causing the error
- */
- public String classname;
-
- /**
- * Create an exception with a descriptive error message, but a null
- * classname.
- *
- * @param message the descriptive error message
- */
- public InvalidClassException(String message)
- {
- super(message);
- }
-
- /**
- * Create an exception with a descriptive error message, and the name of
- * the class that caused the problem.
- *
- * @param classname the name of the faulty class
- * @param message the descriptive error message
- */
- public InvalidClassException(String classname, String message)
- {
- super(message);
- this.classname = classname;
- }
-
- /**
- * Returns the descriptive error message for this exception. It will
- * include the class name that caused the problem if known, in the format:
- * <code>[classname][; ][super.getMessage()]</code>.
- *
- * @return A descriptive error message, may be null
- */
- public String getMessage()
- {
- String msg = super.getMessage();
- if (msg == null)
- return classname;
- return (classname == null ? "" : classname + "; ") + msg;
- }
-}
-
diff --git a/libjava/java/io/InvalidObjectException.java b/libjava/java/io/InvalidObjectException.java
deleted file mode 100644
index deee876db27..00000000000
--- a/libjava/java/io/InvalidObjectException.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* InvalidObjectException.java -- deserialization failed verification
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when an object fails a validation test
- * during serialization.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class InvalidObjectException extends ObjectStreamException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 3233174318281839583L;
-
- /**
- * Create an exception with a descriptive error message String. This should
- * be the cause of the verification failure.
- *
- * @param message the descriptive error message
- */
- public InvalidObjectException(String message)
- {
- super(message);
- }
-} // class InvalidObjectException
diff --git a/libjava/java/io/LineNumberInputStream.java b/libjava/java/io/LineNumberInputStream.java
deleted file mode 100644
index 2552e467994..00000000000
--- a/libjava/java/io/LineNumberInputStream.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/* LineNumberInputStream.java -- An input stream which counts line numbers
- Copyright (C) 1998, 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This class functions like a standard <code>InputStream</code>
- * except that it counts line numbers, and canonicalizes newline
- * characters. As data is read, whenever the byte sequences "\r",
- * "\n", or "\r\n" are encountered, the running line count is
- * incremeted by one. Additionally, the whatever line termination
- * sequence was encountered will be converted to a "\n" byte. Note
- * that this class numbers lines from 0. When the first line
- * terminator is encountered, the line number is incremented to 1, and
- * so on.
- * <p>
- * This class counts only line termination characters. If the last line
- * read from the stream does not end in a line termination sequence, it
- * will not be counted as a line.
- * <p>
- * Note that since this class operates as a filter on an underlying
- * stream, it has the same mark/reset functionality as the underlying
- * stream. The <code>mark()</code> and <code>reset()</code> methods
- * in this class handle line numbers correctly. Calling
- * <code>reset()</code> resets the line number to the point at which
- * <code>mark()</code> was called if the subordinate stream supports
- * that functionality.
- * <p>
- * @deprecated This class is deprecated in favor if
- * <code>LineNumberReader</code> because it operates on ASCII bytes
- * instead of an encoded character stream. This class is for backward
- * compatibility only and should not be used in new applications.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public class LineNumberInputStream extends FilterInputStream
-{
- /** The current line number. */
- private int lineNumber = 0;
-
- /** The line number when the stream was marked. */
- private int markLineNumber = 0;
-
- /** Flag to indicate a '\r' was just read so that an immediately
- * subsequent '\n' can be ignored. */
- private boolean justReadReturnChar = false;
-
- /**
- * Create a new <code>LineNumberInputStream</code> that reads from the
- * specified subordinate <code>InputStream</code>
- *
- * @param in The subordinate <code>InputStream</code> to read from
- */
- public LineNumberInputStream(InputStream in)
- {
- super(in);
- }
-
- /**
- * This method returns the number of bytes that can be read from the
- * stream before the stream can block. This method is tricky
- * because the subordinate <code>InputStream</code> might return
- * only "\r\n" characters, which are replaced by a single "\n"
- * character by the <code>read()</code> method of this class. So
- * this method can only guarantee that <code>in.available() /
- * 2</code> bytes can actually be read before blocking. In
- * practice, considerably more bytes might be read before blocking
- * <p>
- * Note that the stream may not block if additional bytes beyond the count
- * returned by this method are read.
- *
- * @return The number of bytes that can be read before blocking could occur
- *
- * @exception IOException If an error occurs
- */
- public int available() throws IOException
- {
- // We can only guarantee half the characters that might be available
- // without blocking because "\r\n" is treated as a single character.
- return in.available() / 2;
- }
-
- /**
- * This method returns the current line number
- *
- * @return The current line number
- */
- public int getLineNumber()
- {
- return lineNumber;
- }
-
- /**
- * This method marks a position in the input to which the stream can
- * be "reset" byte calling the <code>reset()</code> method. The
- * parameter <code>readlimit</code> is the number of bytes that can
- * be read from the stream after setting the mark before the mark
- * becomes invalid. For example, if <code>mark()</code> is called
- * with a read limit of 10, then when 11 bytes of data are read from
- * the stream before the <code>reset()</code> method is called, then
- * the mark is invalid and the stream object instance is not
- * required to remember the mark.
- * <p>
- * In this class, this method will remember the current line number
- * as well as the current position in the stream. When the
- * <code>reset()</code> method is called, the line number will be
- * restored to the saved line number in addition to the stream
- * position.
- * <p>
- * This method only works if the subordinate stream supports mark/reset
- * functionality.
- *
- * @param readlimit The number of bytes that can be read before the
- * mark becomes invalid
- */
- public void mark(int readlimit)
- {
- in.mark(readlimit);
- markLineNumber = lineNumber;
- }
-
- /**
- * This method reads an unsigned byte from the input stream and returns it
- * as an int in the range of 0-255. This method will return -1 if the
- * end of the stream has been reached.
- * <p>
- * Note that if a line termination sequence is encountered (ie, "\r",
- * "\n", or "\r\n") then that line termination sequence is converted to
- * a single "\n" value which is returned from this method. This means
- * that it is possible this method reads two bytes from the subordinate
- * stream instead of just one.
- * <p>
- * Note that this method will block until a byte of data is available
- * to be read.
- *
- * @return The byte read or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
- public int read() throws IOException
- {
- // Treat "\r\n" as a single character. A '\r' may have been read by
- // a previous call to read so we keep an internal flag to avoid having
- // to read ahead.
-
- int ch = in.read();
-
- if (ch == '\n')
- if (justReadReturnChar)
- {
- ch = in.read();
- justReadReturnChar = false;
- }
- else
- lineNumber++;
- else if (ch == '\r')
- {
- ch = '\n';
- justReadReturnChar = true;
- lineNumber++;
- }
- else
- justReadReturnChar = false;
-
- return ch;
- }
-
- /**
- * This method reads bytes from a stream and stores them into a caller
- * supplied buffer. It starts storing data at index <code>offset</code> into
- * the buffer and attemps to read <code>len</code> bytes. This method can
- * return before reading the number of bytes requested. The actual number
- * of bytes read is returned as an int. A -1 is returned to indicated the
- * end of the stream.
- * <p>
- * This method will block until some data can be read.
- * <p>
- * Note that if a line termination sequence is encountered (ie, "\r",
- * "\n", or "\r\n") then that line termination sequence is converted to
- * a single "\n" value which is stored in the buffer. Only a single
- * byte is counted towards the number of bytes read in this case.
- *
- * @param buf The array into which the bytes read should be stored
- * @param offset The offset into the array to start storing bytes
- * @param len The requested number of bytes to read
- *
- * @return The actual number of bytes read, or -1 if end of stream
- *
- * @exception IOException If an error occurs.
- */
- public int read(byte[] b, int off, int len) throws IOException
- {
- if (off < 0 || len < 0 || off + len > b.length)
- throw new ArrayIndexOutOfBoundsException();
-
- // This case always succeeds.
- if (len == 0)
- return 0;
-
- // The simplest, though not necessarily the most time efficient thing
- // to do is simply call read(void) len times. Since this is a deprecated
- // class, that should be ok.
- final int origOff = off;
- while (len-- > 0)
- {
- int ch = read();
- if (ch < 0)
- break;
-
- b[off++] = (byte) ch;
- }
-
- // This is safe since we already know that some bytes were
- // actually requested.
- return off == origOff ? -1 : off - origOff;
- }
-
- /**
- * This method resets a stream to the point where the
- * <code>mark()</code> method was called. Any bytes that were read
- * after the mark point was set will be re-read during subsequent
- * reads.
- * <p>
- * In this class, this method will also restore the line number that was
- * current when the <code>mark()</code> method was called.
- * <p>
- * This method only works if the subordinate stream supports mark/reset
- * functionality.
- *
- * @exception IOException If an error occurs
- */
- public void reset() throws IOException
- {
- in.reset();
- lineNumber = markLineNumber;
- justReadReturnChar = false;
- }
-
- /**
- * This method sets the current line number to the specified value.
- *
- * @param lineNumber The new line number
- */
- public void setLineNumber(int lineNumber)
- {
- this.lineNumber = lineNumber;
- }
-
- /**
- * This method skips up to the requested number of bytes in the
- * input stream. The actual number of bytes skipped is returned. If the
- * desired number of bytes to skip is negative, no bytes are skipped.
- *
- * @param n requested number of bytes to skip.
- *
- * @return The actual number of bytes skipped.
- *
- * @exception IOException If an error occurs.
- */
- public long skip(long n) throws IOException
- {
- if (n <= 0)
- return 0L;
-
- final long origN = n;
-
- do
- {
- int ch = read();
- if (ch < 0)
- break;
- if (ch == '\n' || ch == '\r')
- lineNumber++;
- }
- while (--n > 0);
-
- return origN - n;
- }
-}
diff --git a/libjava/java/io/LineNumberReader.java b/libjava/java/io/LineNumberReader.java
deleted file mode 100644
index ea418a5e4d6..00000000000
--- a/libjava/java/io/LineNumberReader.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/* LineNumberReader.java -- A character input stream which counts line numbers
- Copyright (C) 1998, 1999, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This class functions like a standard <code>Reader</code> except that it
- * counts line numbers, and canonicalizes newline characters. As data
- * is read, whenever the char sequences "\r", "\n", or "\r\n" are encountered,
- * the running line count is incremeted by one. Additionally, the whatever
- * line termination sequence was encountered will be converted to a "\n"
- * char. Note that this class numbers lines from 0. When the first
- * line terminator is encountered, the line number is incremented to 1, and
- * so on. Also note that actual "\r" and "\n" characters are looked for.
- * The system dependent line separator sequence is ignored.
- * <p>
- * This class counts only line termination characters. If the last line
- * read from the stream does not end in a line termination sequence, it
- * will not be counted as a line.
- *
- * @author Per Bothner (bothner@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Guilhem Lavaux (guilhem@kaffe.org)
- * @date December 28, 2003.
- */
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct.
- *
- * This implementation has the feature that if '\r' is read, it
- * does not look for a '\n', but immediately returns '\n'.
- * On the next read(), if a '\n' is read, it is skipped.
- * This has the advantage that we do not read (and hang) unnecessarily.
- *
- * This implementation is also minimal in the number of fields it uses.
- */
-public class LineNumberReader extends BufferedReader
-{
- /** The current line number. */
- private int lineNumber;
- /** Whether we already found a new line in the former call. */
- private boolean matchedNewLine;
- /** The saved line number when calling mark() */
- private int savedLineNumber;
-
- /**
- * Create a new <code>LineNumberReader</code> that reads from the
- * specified subordinate <code>Reader</code>. A default 8K char sized
- * buffer will be used for reads.
- *
- * @param in The subordinate <code>Reader</code> to read from
- */
- public LineNumberReader(Reader in)
- {
- super(in, DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * This method initializes a new <code>LineNumberReader</code> to read
- * from the specified subordinate <code>Reader</code> using the specified
- * read buffer size.
- *
- * @param in The subordinate <code>Reader</code> to read from
- * @param size The buffer size to use for reading
- */
- public LineNumberReader(Reader in, int size)
- {
- super(in, size);
- }
-
- /**
- * This method returns the current line number
- *
- * @return The current line number
- */
- public int getLineNumber()
- {
- return lineNumber;
- }
-
- /**
- * This method sets the current line number to the specified value.
- *
- * @param line_number The new line number
- */
- public void setLineNumber(int lineNumber)
- {
- this.lineNumber = lineNumber;
- }
-
- /**
- * This method marks a position in the input to which the stream can be
- * "reset" char calling the <code>reset()</code> method. The parameter
- * <code>readlimit</code> is the number of chars that can be read from the
- * stream after setting the mark before the mark becomes invalid. For
- * example, if <code>mark()</code> is called with a read limit of 10,
- * then when
- * 11 chars of data are read from the stream before the <code>reset()</code>
- * method is called, then the mark is invalid and the stream object
- * instance is not required to remember the mark.
- * <p>
- * In this class, this method will remember the current line number as well
- * as the current position in the stream. When the <code>reset()</code>
- * method
- * is called, the line number will be restored to the saved line number in
- * addition to the stream position.
- *
- * @param readlimit The number of chars that can be read before the
- * mark becomes invalid
- *
- * @exception IOException If an error occurs
- */
- public void mark(int readLimit) throws IOException
- {
- if (readLimit < 0)
- throw new IllegalArgumentException("Read-ahead limit is negative");
-
- synchronized (lock)
- {
- // This is basically the same as BufferedReader.mark.
- // However, if the previous character was a '\r', we need to
- // save that 'r', in case the next character is a '\n'.
- if (pos + readLimit > limit)
- {
- int saveCR = matchedNewLine ? 1 : 0;
- char[] old_buffer = buffer;
- if (readLimit > limit)
- buffer = new char[saveCR + readLimit];
- int copy_start = pos - saveCR;
- savedLineNumber = lineNumber;
- limit -= copy_start;
- System.arraycopy(old_buffer, copy_start, buffer, 0, limit);
- pos = saveCR;
- }
- markPos = pos;
- }
- }
-
- /**
- * This method resets a stream to the point where the <code>mark()</code>
- * method
- * was called. Any chars that were read after the mark point was set will
- * be re-read during subsequent reads.
- * <p>
- * In this class, this method will also restore the line number that was
- * current when the <code>mark()</code> method was called.
- *
- * @exception IOException If an error occurs
- */
- public void reset() throws IOException
- {
- synchronized (lock)
- {
- if (markPos < 0)
- throw new IOException("mark never set or invalidated");
- lineNumber = savedLineNumber;
- pos = markPos;
- matchedNewLine = (markPos > 0 && buffer[markPos-1] == '\r');
- }
- }
-
- /**
- * This private method fills the input buffer whatever pos is.
- * Consequently pos should be checked before calling this method.
- *
- * @return the number of bytes actually read from the input stream or
- * -1 if end of stream.
- * @exception IOException If an error occurs.
- */
- private int fill() throws IOException
- {
- if (markPos >= 0 && limit == buffer.length)
- markPos = -1;
- if (markPos < 0)
- pos = limit = 0;
- int count = in.read(buffer, limit, buffer.length - limit);
- if (count <= 0)
- return -1;
- limit += count;
-
- return count;
- }
-
- /**
- * This method reads an unsigned char from the input stream and returns it
- * as an int in the range of 0-65535. This method will return -1 if the
- * end of the stream has been reached.
- * <p>
- * Note that if a line termination sequence is encountered (ie, "\r",
- * "\n", or "\r\n") then that line termination sequence is converted to
- * a single "\n" value which is returned from this method. This means
- * that it is possible this method reads two chars from the subordinate
- * stream instead of just one.
- * <p>
- * Note that this method will block until a char of data is available
- * to be read.
- *
- * @return The char read or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
- public int read() throws IOException
- {
- synchronized (lock)
- {
- skipRedundantLF();
- if (pos >= limit && fill() < 0)
- return -1;
- char ch = buffer[pos++];
-
- if ((matchedNewLine = (ch == '\r')) || ch == '\n')
- {
- lineNumber++;
- return '\n';
- }
- matchedNewLine = false;
- return (int) ch;
- }
- }
-
- /**
- * This method reads chars from a stream and stores them into a caller
- * supplied buffer. It starts storing data at index <code>offset</code> into
- * the buffer and attemps to read <code>len</code> chars. This method can
- * return before reading the number of chars requested. The actual number
- * of chars read is returned as an int. A -1 is returned to indicated the
- * end of the stream.
- * <p>
- * This method will block until some data can be read.
- * <p>
- * Note that if a line termination sequence is encountered (ie, "\r",
- * "\n", or "\r\n") then that line termination sequence is converted to
- * a single "\n" value which is stored in the buffer. Only a single
- * char is counted towards the number of chars read in this case.
- *
- * @param buf The array into which the chars read should be stored
- * @param offset The offset into the array to start storing chars
- * @param len The requested number of chars to read
- *
- * @return The actual number of chars read, or -1 if end of stream
- *
- * @exception IOException If an error occurs.
- * @exception NullPointerException If buf is null (in any case).
- * @exception IndexOutOfBoundsException If buffer parameters (offset and
- * count) lies outside of the buffer capacity.
- */
- public int read(char[] buf, int offset, int count) throws IOException
- {
- if (buf == null)
- throw new NullPointerException();
-
- if (offset + count > buf.length || offset < 0)
- throw new IndexOutOfBoundsException();
-
- if (count <= 0)
- {
- if (count < 0)
- throw new IndexOutOfBoundsException();
- return 0;
- }
-
- synchronized (lock)
- {
- if (pos >= limit && fill() < 0)
- return -1;
-
- int start_offset = offset;
- boolean matched = matchedNewLine;
-
- while (count-- > 0 && pos < limit)
- {
- char ch = buffer[pos++];
- if (ch == '\r')
- {
- lineNumber++;
- matched = true;
- }
- else if (ch == '\n' && !matched)
- lineNumber++;
- else
- matched = false;
-
- buf[offset++] = ch;
- }
-
- matchedNewLine = matched;
- return offset - start_offset;
- }
- }
-
- private void skipRedundantLF() throws IOException
- {
- if (pos > 0 && matchedNewLine)
- {
- if (pos < limit)
- { // fast case
- if (buffer[pos] == '\n')
- pos++;
- }
- else
- { // check whether the next buffer begins with '\n'.
- // in that case kill the '\n'.
- if (fill() <= 0)
- return;
- if (buffer[pos] == '\n')
- pos++;
- }
- matchedNewLine = true;
- }
- }
-
- /**
- * This method reads a line of text from the input stream and returns
- * it as a <code>String</code>. A line is considered to be terminated
- * by a "\r", "\n", or "\r\n" sequence, not by the system dependent line
- * separator.
- *
- * @return The line read as a <code>String</code> or <code>null</code>
- * if end of stream.
- *
- * @exception IOException If an error occurs
- */
- public String readLine() throws IOException
- {
- // BufferedReader.readLine already does this. Shouldn't need to keep
- // track of newlines (since the read method deals with this for us).
- // But if the buffer is large, we may not call the read method at all
- // and super.readLine can't increment lineNumber itself.
- // Though it may seem kludgy, the safest thing to do is to save off
- // lineNumber and increment it explicitly when we're done (iff we
- // ended with a '\n' or '\r' as opposed to EOF).
- //
- // Also, we need to undo the special casing done by BufferedReader.readLine
- // when a '\r' is the last char in the buffer. That situation is marked
- // by 'pos > limit'.
- int tmpLineNumber = lineNumber;
- skipRedundantLF();
- String str = super.readLine();
- if (pos > limit)
- --pos;
-
- // The only case where you mustn't increment the line number is you are
- // at the EOS.
- if (str != null)
- lineNumber = tmpLineNumber + 1;
-
- return str;
- }
-
- /**
- * This method skips over characters in the stream. This method will
- * skip the specified number of characters if possible, but is not required
- * to skip them all. The actual number of characters skipped is returned.
- * This method returns 0 if the specified number of chars is less than 1.
- *
- * @param count The specified number of chars to skip.
- *
- * @return The actual number of chars skipped.
- *
- * @exception IOException If an error occurs
- */
- public long skip (long count) throws IOException
- {
- if (count < 0)
- throw new IllegalArgumentException("skip() value is negative");
- if (count == 0)
- return 0;
-
- int skipped;
- char[] buf = new char[1];
-
- for (skipped = 0; skipped < count; skipped++)
- {
- int ch = read(buf, 0, 1);
-
- if (ch < 0)
- break;
- }
-
- return skipped;
- }
-}
-
diff --git a/libjava/java/io/NotActiveException.java b/libjava/java/io/NotActiveException.java
deleted file mode 100644
index 949ba8eca52..00000000000
--- a/libjava/java/io/NotActiveException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* NotActiveException.java -- thrown when serialization is not active
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when a problem occurs due to the fact that
- * serialization is not active.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class NotActiveException extends ObjectStreamException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -3893467273049808895L;
-
- /**
- * Create an exception without a descriptive error message.
- */
- public NotActiveException()
- {
- }
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public NotActiveException(String message)
- {
- super(message);
- }
-} // class NotActiveException
diff --git a/libjava/java/io/NotSerializableException.java b/libjava/java/io/NotSerializableException.java
deleted file mode 100644
index d49c939e31d..00000000000
--- a/libjava/java/io/NotSerializableException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* NotSerializableException.java -- a Serializable class that isn't
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when a class implements Serializable because
- * of a superclass, but should not be serialized. The descriptive message
- * will consist of the name of the class in question.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class NotSerializableException extends ObjectStreamException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 2906642554793891381L;
-
- /**
- * Create an exception without a descriptive error message.
- */
- public NotSerializableException()
- {
- }
-
- /**
- * Create an exception with a descriptive error message, which should
- * be the name of the class.
- *
- * @param message the descriptive error message
- */
- public NotSerializableException(String message)
- {
- super(message);
- }
-} // class NotSerializableException
diff --git a/libjava/java/io/ObjectInput.java b/libjava/java/io/ObjectInput.java
deleted file mode 100644
index 175b60f9dc0..00000000000
--- a/libjava/java/io/ObjectInput.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* ObjectInput.java -- Read object data from a stream
- Copyright (C) 1998,2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This interface extends the <code>DataInput</code> interface to provide a
- * facility to read objects as well as primitive types from a stream. It
- * also has methods that allow input to be done in a manner similar to
- * <code>InputStream</code>
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- *
- * @see DataInput
- */
-public interface ObjectInput extends DataInput
-{
- /**
- * This method returns the number of bytes that can be read without
- * blocking.
- *
- * @return The number of bytes available before blocking
- *
- * @exception IOException If an error occurs
- */
- int available() throws IOException;
-
- /**
- * This method reading a byte of data from a stream. It returns that byte
- * as an <code>int</code>. This method blocks if no data is available
- * to be read.
- *
- * @return The byte of data read
- *
- * @exception IOException If an error occurs
- */
- int read() throws IOException;
-
- /**
- * This method reads raw bytes and stores them them a byte array buffer.
- * Note that this method will block if no data is available. However,
- * it will not necessarily block until it fills the entire buffer. That is,
- * a "short count" is possible.
- *
- * @param buf The byte array to receive the data read
- *
- * @return The actual number of bytes read or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
- int read(byte[] buf) throws IOException;
-
- /**
- * This method reads raw bytes and stores them in a byte array buffer
- * <code>buf</code> starting at position <code>offset</code> into the
- * buffer. A
- * maximum of <code>len</code> bytes will be read. Note that this method
- * blocks if no data is available, but will not necessarily block until
- * it can read <code>len</code> bytes of data. That is, a "short count" is
- * possible.
- *
- * @param buf The byte array to receive the data read
- * @param offset The offset into <code>buf</code> to start storing data
- * @param len The maximum number of bytes to read
- *
- * @return The actual number of bytes read or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
- int read(byte[] buf, int offset, int len) throws IOException;
-
- /**
- * Reads an object instance and returns it. If the class for the object
- * being read cannot be found, then a <code>ClassNotFoundException</code>
- * will be thrown.
- *
- * @return The object instance that was read
- *
- * @exception ClassNotFoundException If a class for the object cannot be
- * found
- * @exception IOException If any other error occurs
- */
- Object readObject()
- throws ClassNotFoundException, IOException;
-
- /**
- * This method causes the specified number of bytes to be read and
- * discarded. It is possible that fewer than the requested number of bytes
- * will actually be skipped.
- *
- * @param numBytes The number of bytes to skip
- *
- * @return The actual number of bytes skipped
- *
- * @exception IOException If an error occurs
- */
- long skip(long numBytes) throws IOException;
-
- /**
- * This method closes the input source
- *
- * @exception IOException If an error occurs
- */
- void close() throws IOException;
-}
diff --git a/libjava/java/io/ObjectInputValidation.java b/libjava/java/io/ObjectInputValidation.java
deleted file mode 100644
index 4fdb8414f63..00000000000
--- a/libjava/java/io/ObjectInputValidation.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ObjectInputValidation.java -- Validate an object
- Copyright (C) 1998, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This class allows an object to validate that it is valid after
- * deserialization has run completely for it and all dependent objects.
- * This allows an object to determine if it is invalid even if all
- * state data was correctly deserialized from the stream. It can also
- * be used to perform re-initialization type activities on an object
- * after it has been completely deserialized.
- *
- * Since this method functions as a type of callback, it must be
- * registered through <code>ObjectInputStream.registerValidation</code>
- * in order to be invoked. This is typically done in the
- * <code>readObject</code> method.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- *
- * @see ObjectInputStream#registerValidation
- */
-public interface ObjectInputValidation
-{
- /**
- * This method is called to validate an object after serialization
- * is complete. If the object is invalid an exception is thrown.
- *
- * @exception InvalidObjectException If the object is invalid
- */
- void validateObject() throws InvalidObjectException;
-}
diff --git a/libjava/java/io/ObjectOutput.java b/libjava/java/io/ObjectOutput.java
deleted file mode 100644
index d35a09c3acb..00000000000
--- a/libjava/java/io/ObjectOutput.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/* ObjectOutput.java -- Interface for writing objects to a stream
- Copyright (C) 1998, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This interface extends <code>DataOutput</code> to provide the additional
- * facility of writing object instances to a stream. It also adds some
- * additional methods to make the interface more
- * <code>OutputStream</code> like.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- *
- * @see DataOutput
- */
-public interface ObjectOutput extends DataOutput
-{
- /**
- * This method writes the specified byte to the output stream.
- *
- * @param b The byte to write.
- *
- * @exception IOException If an error occurs.
- */
- void write(int b) throws IOException;
-
- /**
- * This method writes all the bytes in the specified byte array to the
- * output stream.
- *
- * @param buf The array of bytes to write.
- *
- * @exception IOException If an error occurs.
- */
- void write(byte[] buf) throws IOException;
-
- /**
- * This method writes <code>len</code> bytes from the specified array
- * starting at index <code>offset</code> into that array.
- *
- * @param buf The byte array to write from.
- * @param offset The index into the byte array to start writing from.
- * @param len The number of bytes to write.
- *
- * @exception IOException If an error occurs.
- */
- void write(byte[] buf, int offset, int len)
- throws IOException;
-
- /**
- * This method writes a object instance to a stream. The format of the
- * data written is determined by the actual implementation of this method
- *
- * @param obj The object to write
- *
- * @exception IOException If an error occurs
- */
- void writeObject(Object obj) throws IOException;
-
- /**
- * This method causes any buffered data to be flushed out to the underlying
- * stream
- *
- * @exception IOException If an error occurs
- */
- void flush() throws IOException;
-
- /**
- * This method closes the underlying stream.
- *
- * @exception IOException If an error occurs
- */
- void close() throws IOException;
-
-} // interface ObjectOutput
-
diff --git a/libjava/java/io/ObjectOutputStream.java b/libjava/java/io/ObjectOutputStream.java
deleted file mode 100644
index e7f1fc84b93..00000000000
--- a/libjava/java/io/ObjectOutputStream.java
+++ /dev/null
@@ -1,1570 +0,0 @@
-/* ObjectOutputStream.java -- Class used to write serialized objects
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-import gnu.classpath.Configuration;
-import gnu.java.io.ObjectIdentityWrapper;
-import gnu.java.lang.reflect.TypeSignature;
-import gnu.java.security.action.SetAccessibleAction;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.util.Hashtable;
-
-/**
- * An <code>ObjectOutputStream</code> can be used to write objects
- * as well as primitive data in a platform-independent manner to an
- * <code>OutputStream</code>.
- *
- * The data produced by an <code>ObjectOutputStream</code> can be read
- * and reconstituted by an <code>ObjectInputStream</code>.
- *
- * <code>writeObject (Object)</code> is used to write Objects, the
- * <code>write&lt;type&gt;</code> methods are used to write primitive
- * data (as in <code>DataOutputStream</code>). Strings can be written
- * as objects or as primitive data.
- *
- * Not all objects can be written out using an
- * <code>ObjectOutputStream</code>. Only those objects that are an
- * instance of <code>java.io.Serializable</code> can be written.
- *
- * Using default serialization, information about the class of an
- * object is written, all of the non-transient, non-static fields of
- * the object are written, if any of these fields are objects, they are
- * written out in the same manner.
- *
- * An object is only written out the first time it is encountered. If
- * the object is encountered later, a reference to it is written to
- * the underlying stream. Thus writing circular object graphs
- * does not present a problem, nor are relationships between objects
- * in a graph lost.
- *
- * Example usage:
- * <pre>
- * Hashtable map = new Hashtable ();
- * map.put ("one", new Integer (1));
- * map.put ("two", new Integer (2));
- *
- * ObjectOutputStream oos =
- * new ObjectOutputStream (new FileOutputStream ("numbers"));
- * oos.writeObject (map);
- * oos.close ();
- *
- * ObjectInputStream ois =
- * new ObjectInputStream (new FileInputStream ("numbers"));
- * Hashtable newmap = (Hashtable)ois.readObject ();
- *
- * System.out.println (newmap);
- * </pre>
- *
- * The default serialization can be overriden in two ways.
- *
- * By defining a method <code>private void
- * writeObject (ObjectOutputStream)</code>, a class can dictate exactly
- * how information about itself is written.
- * <code>defaultWriteObject ()</code> may be called from this method to
- * carry out default serialization. This method is not
- * responsible for dealing with fields of super-classes or subclasses.
- *
- * By implementing <code>java.io.Externalizable</code>. This gives
- * the class complete control over the way it is written to the
- * stream. If this approach is used the burden of writing superclass
- * and subclass data is transfered to the class implementing
- * <code>java.io.Externalizable</code>.
- *
- * @see java.io.DataOutputStream
- * @see java.io.Externalizable
- * @see java.io.ObjectInputStream
- * @see java.io.Serializable
- */
-public class ObjectOutputStream extends OutputStream
- implements ObjectOutput, ObjectStreamConstants
-{
- /**
- * Creates a new <code>ObjectOutputStream</code> that will do all of
- * its writing onto <code>out</code>. This method also initializes
- * the stream by writing the header information (stream magic number
- * and stream version).
- *
- * @exception IOException Writing stream header to underlying
- * stream cannot be completed.
- *
- * @see #writeStreamHeader()
- */
- public ObjectOutputStream (OutputStream out) throws IOException
- {
- realOutput = new DataOutputStream(out);
- blockData = new byte[ BUFFER_SIZE ];
- blockDataCount = 0;
- blockDataOutput = new DataOutputStream(this);
- setBlockDataMode(true);
- replacementEnabled = false;
- isSerializing = false;
- nextOID = baseWireHandle;
- OIDLookupTable = new Hashtable();
- protocolVersion = defaultProtocolVersion;
- useSubclassMethod = false;
- writeStreamHeader();
-
- if (Configuration.DEBUG)
- {
- String val = System.getProperty("gcj.dumpobjects");
- if (val != null && !val.equals(""))
- dump = true;
- }
- }
-
- /**
- * Writes a representation of <code>obj</code> to the underlying
- * output stream by writing out information about its class, then
- * writing out each of the objects non-transient, non-static
- * fields. If any of these fields are other objects,
- * they are written out in the same manner.
- *
- * This method can be overriden by a class by implementing
- * <code>private void writeObject (ObjectOutputStream)</code>.
- *
- * If an exception is thrown from this method, the stream is left in
- * an undefined state.
- *
- * @exception NotSerializableException An attempt was made to
- * serialize an <code>Object</code> that is not serializable.
- *
- * @exception InvalidClassException Somebody tried to serialize
- * an object which is wrongly formatted.
- *
- * @exception IOException Exception from underlying
- * <code>OutputStream</code>.
- */
- public final void writeObject(Object obj) throws IOException
- {
- if (useSubclassMethod)
- {
- if (dump)
- dumpElementln ("WRITE OVERRIDE: " + obj);
-
- writeObjectOverride(obj);
- return;
- }
-
- if (dump)
- dumpElementln ("WRITE: " + obj);
-
- depth += 2;
-
- boolean was_serializing = isSerializing;
- boolean old_mode = setBlockDataMode(false);
- try
- {
- isSerializing = true;
- boolean replaceDone = false;
- Object replacedObject = null;
-
- while (true)
- {
- if (obj == null)
- {
- realOutput.writeByte(TC_NULL);
- break;
- }
-
- Integer handle = findHandle(obj);
- if (handle != null)
- {
- realOutput.writeByte(TC_REFERENCE);
- realOutput.writeInt(handle.intValue());
- break;
- }
-
- if (obj instanceof Class)
- {
- Class cl = (Class)obj;
- ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject(cl);
- realOutput.writeByte(TC_CLASS);
- if (!osc.isProxyClass)
- {
- writeObject (osc);
- }
- else
- {
- realOutput.writeByte(TC_PROXYCLASSDESC);
- Class[] intfs = cl.getInterfaces();
- realOutput.writeInt(intfs.length);
- for (int i = 0; i < intfs.length; i++)
- realOutput.writeUTF(intfs[i].getName());
-
- boolean oldmode = setBlockDataMode(true);
- annotateProxyClass(cl);
- setBlockDataMode(oldmode);
- realOutput.writeByte(TC_ENDBLOCKDATA);
-
- writeObject(osc.getSuper());
- }
- assignNewHandle(obj);
- break;
- }
-
- if (obj instanceof ObjectStreamClass)
- {
- writeClassDescriptor((ObjectStreamClass) obj);
- break;
- }
-
- Class clazz = obj.getClass();
- ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject(clazz);
- if (osc == null)
- throw new NotSerializableException(clazz.getName());
-
- if ((replacementEnabled || obj instanceof Serializable)
- && ! replaceDone)
- {
- replacedObject = obj;
-
- if (obj instanceof Serializable)
- {
- try
- {
- Method m = osc.writeReplaceMethod;
- if (m != null)
- obj = m.invoke(obj, new Object[0]);
- }
- catch (IllegalAccessException ignore)
- {
- }
- catch (InvocationTargetException ignore)
- {
- }
- }
-
- if (replacementEnabled)
- obj = replaceObject(obj);
-
- replaceDone = true;
- continue;
- }
-
- if (obj instanceof String)
- {
- realOutput.writeByte(TC_STRING);
- assignNewHandle(obj);
- realOutput.writeUTF((String)obj);
- break;
- }
-
- if (clazz.isArray ())
- {
- realOutput.writeByte(TC_ARRAY);
- writeObject(osc);
- assignNewHandle(obj);
- writeArraySizeAndElements(obj, clazz.getComponentType());
- break;
- }
-
- realOutput.writeByte(TC_OBJECT);
- writeObject(osc);
-
- if (replaceDone)
- assignNewHandle(replacedObject);
- else
- assignNewHandle(obj);
-
- if (obj instanceof Externalizable)
- {
- if (protocolVersion == PROTOCOL_VERSION_2)
- setBlockDataMode(true);
-
- ((Externalizable)obj).writeExternal(this);
-
- if (protocolVersion == PROTOCOL_VERSION_2)
- {
- setBlockDataMode(false);
- realOutput.writeByte(TC_ENDBLOCKDATA);
- }
-
- break;
- }
-
- if (obj instanceof Serializable)
- {
- Object prevObject = this.currentObject;
- ObjectStreamClass prevObjectStreamClass = this.currentObjectStreamClass;
- currentObject = obj;
- ObjectStreamClass[] hierarchy =
- ObjectStreamClass.getObjectStreamClasses(clazz);
-
- for (int i = 0; i < hierarchy.length; i++)
- {
- currentObjectStreamClass = hierarchy[i];
-
- fieldsAlreadyWritten = false;
- if (currentObjectStreamClass.hasWriteMethod())
- {
- if (dump)
- dumpElementln ("WRITE METHOD CALLED FOR: " + obj);
- setBlockDataMode(true);
- callWriteMethod(obj, currentObjectStreamClass);
- setBlockDataMode(false);
- realOutput.writeByte(TC_ENDBLOCKDATA);
- if (dump)
- dumpElementln ("WRITE ENDBLOCKDATA FOR: " + obj);
- }
- else
- {
- if (dump)
- dumpElementln ("WRITE FIELDS CALLED FOR: " + obj);
- writeFields(obj, currentObjectStreamClass);
- }
- }
-
- this.currentObject = prevObject;
- this.currentObjectStreamClass = prevObjectStreamClass;
- currentPutField = null;
- break;
- }
-
- throw new NotSerializableException(clazz.getName ());
- } // end pseudo-loop
- }
- catch (ObjectStreamException ose)
- {
- // Rethrow these are fatal.
- throw ose;
- }
- catch (IOException e)
- {
- realOutput.writeByte(TC_EXCEPTION);
- reset(true);
-
- setBlockDataMode(false);
- try
- {
- if (Configuration.DEBUG)
- {
- e.printStackTrace(System.out);
- }
- writeObject(e);
- }
- catch (IOException ioe)
- {
- StreamCorruptedException ex =
- new StreamCorruptedException
- (ioe + " thrown while exception was being written to stream.");
- if (Configuration.DEBUG)
- {
- ex.printStackTrace(System.out);
- }
- throw ex;
- }
-
- reset (true);
-
- }
- finally
- {
- isSerializing = was_serializing;
- setBlockDataMode(old_mode);
- depth -= 2;
-
- if (dump)
- dumpElementln ("END: " + obj);
- }
- }
-
- protected void writeClassDescriptor(ObjectStreamClass osc) throws IOException
- {
- realOutput.writeByte(TC_CLASSDESC);
- realOutput.writeUTF(osc.getName());
- realOutput.writeLong(osc.getSerialVersionUID());
- assignNewHandle(osc);
-
- int flags = osc.getFlags();
-
- if (protocolVersion == PROTOCOL_VERSION_2
- && osc.isExternalizable())
- flags |= SC_BLOCK_DATA;
-
- realOutput.writeByte(flags);
-
- ObjectStreamField[] fields = osc.fields;
- realOutput.writeShort(fields.length);
-
- ObjectStreamField field;
- for (int i = 0; i < fields.length; i++)
- {
- field = fields[i];
- realOutput.writeByte(field.getTypeCode ());
- realOutput.writeUTF(field.getName ());
-
- if (! field.isPrimitive())
- writeObject(field.getTypeString());
- }
-
- boolean oldmode = setBlockDataMode(true);
- annotateClass(osc.forClass());
- setBlockDataMode(oldmode);
- realOutput.writeByte(TC_ENDBLOCKDATA);
-
- if (osc.isSerializable() || osc.isExternalizable())
- writeObject(osc.getSuper());
- else
- writeObject(null);
- }
-
- /**
- * Writes the current objects non-transient, non-static fields from
- * the current class to the underlying output stream.
- *
- * This method is intended to be called from within a object's
- * <code>private void writeObject (ObjectOutputStream)</code>
- * method.
- *
- * @exception NotActiveException This method was called from a
- * context other than from the current object's and current class's
- * <code>private void writeObject (ObjectOutputStream)</code>
- * method.
- *
- * @exception IOException Exception from underlying
- * <code>OutputStream</code>.
- */
- public void defaultWriteObject()
- throws IOException, NotActiveException
- {
- markFieldsWritten();
- writeFields(currentObject, currentObjectStreamClass);
- }
-
-
- private void markFieldsWritten() throws IOException
- {
- if (currentObject == null || currentObjectStreamClass == null)
- throw new NotActiveException
- ("defaultWriteObject called by non-active class and/or object");
-
- if (fieldsAlreadyWritten)
- throw new IOException
- ("Only one of writeFields and defaultWriteObject may be called, and it may only be called once");
-
- fieldsAlreadyWritten = true;
- }
-
- /**
- * Resets stream to state equivalent to the state just after it was
- * constructed.
- *
- * Causes all objects previously written to the stream to be
- * forgotten. A notification of this reset is also written to the
- * underlying stream.
- *
- * @exception IOException Exception from underlying
- * <code>OutputStream</code> or reset called while serialization is
- * in progress.
- */
- public void reset() throws IOException
- {
- reset(false);
- }
-
-
- private void reset(boolean internal) throws IOException
- {
- if (!internal)
- {
- if (isSerializing)
- throw new IOException("Reset called while serialization in progress");
-
- realOutput.writeByte(TC_RESET);
- }
-
- clearHandles();
- }
-
-
- /**
- * Informs this <code>ObjectOutputStream</code> to write data
- * according to the specified protocol. There are currently two
- * different protocols, specified by <code>PROTOCOL_VERSION_1</code>
- * and <code>PROTOCOL_VERSION_2</code>. This implementation writes
- * data using <code>PROTOCOL_VERSION_2</code> by default, as is done
- * by the JDK 1.2.
- *
- * A non-portable method, <code>setDefaultProtocolVersion (int
- * version)</code> is provided to change the default protocol
- * version.
- *
- * For an explination of the differences beween the two protocols
- * see XXX: the Java ObjectSerialization Specification.
- *
- * @exception IOException if <code>version</code> is not a valid
- * protocol
- *
- * @see #setDefaultProtocolVersion(int)
- */
- public void useProtocolVersion(int version) throws IOException
- {
- if (version != PROTOCOL_VERSION_1 && version != PROTOCOL_VERSION_2)
- throw new IOException("Invalid protocol version requested.");
-
- protocolVersion = version;
- }
-
-
- /**
- * <em>GNU $classpath specific</em>
- *
- * Changes the default stream protocol used by all
- * <code>ObjectOutputStream</code>s. There are currently two
- * different protocols, specified by <code>PROTOCOL_VERSION_1</code>
- * and <code>PROTOCOL_VERSION_2</code>. The default default is
- * <code>PROTOCOL_VERSION_1</code>.
- *
- * @exception IOException if <code>version</code> is not a valid
- * protocol
- *
- * @see #useProtocolVersion(int)
- */
- public static void setDefaultProtocolVersion(int version)
- throws IOException
- {
- if (version != PROTOCOL_VERSION_1 && version != PROTOCOL_VERSION_2)
- throw new IOException("Invalid protocol version requested.");
-
- defaultProtocolVersion = version;
- }
-
-
- /**
- * An empty hook that allows subclasses to write extra information
- * about classes to the stream. This method is called the first
- * time each class is seen, and after all of the standard
- * information about the class has been written.
- *
- * @exception IOException Exception from underlying
- * <code>OutputStream</code>.
- *
- * @see ObjectInputStream#resolveClass(java.io.ObjectStreamClass)
- */
- protected void annotateClass(Class cl) throws IOException
- {
- }
-
- protected void annotateProxyClass(Class cl) throws IOException
- {
- }
-
- /**
- * Allows subclasses to replace objects that are written to the
- * stream with other objects to be written in their place. This
- * method is called the first time each object is encountered
- * (modulo reseting of the stream).
- *
- * This method must be enabled before it will be called in the
- * serialization process.
- *
- * @exception IOException Exception from underlying
- * <code>OutputStream</code>.
- *
- * @see #enableReplaceObject(boolean)
- */
- protected Object replaceObject(Object obj) throws IOException
- {
- return obj;
- }
-
-
- /**
- * If <code>enable</code> is <code>true</code> and this object is
- * trusted, then <code>replaceObject (Object)</code> will be called
- * in subsequent calls to <code>writeObject (Object)</code>.
- * Otherwise, <code>replaceObject (Object)</code> will not be called.
- *
- * @exception SecurityException This class is not trusted.
- */
- protected boolean enableReplaceObject(boolean enable)
- throws SecurityException
- {
- if (enable)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new SerializablePermission("enableSubstitution"));
- }
-
- boolean old_val = replacementEnabled;
- replacementEnabled = enable;
- return old_val;
- }
-
-
- /**
- * Writes stream magic and stream version information to the
- * underlying stream.
- *
- * @exception IOException Exception from underlying
- * <code>OutputStream</code>.
- */
- protected void writeStreamHeader() throws IOException
- {
- realOutput.writeShort(STREAM_MAGIC);
- realOutput.writeShort(STREAM_VERSION);
- }
-
- /**
- * Protected constructor that allows subclasses to override
- * serialization. This constructor should be called by subclasses
- * that wish to override <code>writeObject (Object)</code>. This
- * method does a security check <i>NOTE: currently not
- * implemented</i>, then sets a flag that informs
- * <code>writeObject (Object)</code> to call the subclasses
- * <code>writeObjectOverride (Object)</code> method.
- *
- * @see #writeObjectOverride(Object)
- */
- protected ObjectOutputStream() throws IOException, SecurityException
- {
- SecurityManager sec_man = System.getSecurityManager ();
- if (sec_man != null)
- sec_man.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
- useSubclassMethod = true;
- }
-
-
- /**
- * This method allows subclasses to override the default
- * serialization mechanism provided by
- * <code>ObjectOutputStream</code>. To make this method be used for
- * writing objects, subclasses must invoke the 0-argument
- * constructor on this class from there constructor.
- *
- * @see #ObjectOutputStream()
- *
- * @exception NotActiveException Subclass has arranged for this
- * method to be called, but did not implement this method.
- */
- protected void writeObjectOverride(Object obj) throws NotActiveException,
- IOException
- {
- throw new NotActiveException
- ("Subclass of ObjectOutputStream must implement writeObjectOverride");
- }
-
-
- /**
- * @see DataOutputStream#write(int)
- */
- public void write (int data) throws IOException
- {
- if (writeDataAsBlocks)
- {
- if (blockDataCount == BUFFER_SIZE)
- drain();
-
- blockData[ blockDataCount++ ] = (byte)data;
- }
- else
- realOutput.write(data);
- }
-
-
- /**
- * @see DataOutputStream#write(byte[])
- */
- public void write(byte[] b) throws IOException
- {
- write(b, 0, b.length);
- }
-
-
- /**
- * @see DataOutputStream#write(byte[],int,int)
- */
- public void write(byte[] b, int off, int len) throws IOException
- {
- if (writeDataAsBlocks)
- {
- if (len < 0)
- throw new IndexOutOfBoundsException();
-
- if (blockDataCount + len < BUFFER_SIZE)
- {
- System.arraycopy(b, off, blockData, blockDataCount, len);
- blockDataCount += len;
- }
- else
- {
- drain();
- writeBlockDataHeader(len);
- realOutput.write(b, off, len);
- }
- }
- else
- realOutput.write(b, off, len);
- }
-
-
- /**
- * @see DataOutputStream#flush()
- */
- public void flush () throws IOException
- {
- drain();
- realOutput.flush();
- }
-
-
- /**
- * Causes the block-data buffer to be written to the underlying
- * stream, but does not flush underlying stream.
- *
- * @exception IOException Exception from underlying
- * <code>OutputStream</code>.
- */
- protected void drain() throws IOException
- {
- if (blockDataCount == 0)
- return;
-
- if (writeDataAsBlocks)
- writeBlockDataHeader(blockDataCount);
- realOutput.write(blockData, 0, blockDataCount);
- blockDataCount = 0;
- }
-
-
- /**
- * @see java.io.DataOutputStream#close ()
- */
- public void close() throws IOException
- {
- flush();
- realOutput.close();
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeBoolean (boolean)
- */
- public void writeBoolean(boolean data) throws IOException
- {
- blockDataOutput.writeBoolean(data);
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeByte (int)
- */
- public void writeByte(int data) throws IOException
- {
- blockDataOutput.writeByte(data);
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeShort (int)
- */
- public void writeShort (int data) throws IOException
- {
- blockDataOutput.writeShort(data);
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeChar (int)
- */
- public void writeChar(int data) throws IOException
- {
- blockDataOutput.writeChar(data);
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeInt (int)
- */
- public void writeInt(int data) throws IOException
- {
- blockDataOutput.writeInt(data);
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeLong (long)
- */
- public void writeLong(long data) throws IOException
- {
- blockDataOutput.writeLong(data);
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeFloat (float)
- */
- public void writeFloat(float data) throws IOException
- {
- blockDataOutput.writeFloat(data);
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeDouble (double)
- */
- public void writeDouble(double data) throws IOException
- {
- blockDataOutput.writeDouble(data);
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeBytes (java.lang.String)
- */
- public void writeBytes(String data) throws IOException
- {
- blockDataOutput.writeBytes(data);
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeChars (java.lang.String)
- */
- public void writeChars(String data) throws IOException
- {
- dataOutput.writeChars(data);
- }
-
-
- /**
- * @see java.io.DataOutputStream#writeUTF (java.lang.String)
- */
- public void writeUTF(String data) throws IOException
- {
- dataOutput.writeUTF(data);
- }
-
-
- /**
- * This class allows a class to specify exactly which fields should
- * be written, and what values should be written for these fields.
- *
- * XXX: finish up comments
- */
- public abstract static class PutField
- {
- public abstract void put (String name, boolean value);
- public abstract void put (String name, byte value);
- public abstract void put (String name, char value);
- public abstract void put (String name, double value);
- public abstract void put (String name, float value);
- public abstract void put (String name, int value);
- public abstract void put (String name, long value);
- public abstract void put (String name, short value);
- public abstract void put (String name, Object value);
-
- /**
- * @deprecated
- */
- public abstract void write (ObjectOutput out) throws IOException;
- }
-
- public PutField putFields() throws IOException
- {
- if (currentPutField != null)
- return currentPutField;
-
- currentPutField = new PutField()
- {
- private byte[] prim_field_data
- = new byte[currentObjectStreamClass.primFieldSize];
- private Object[] objs
- = new Object[currentObjectStreamClass.objectFieldCount];
-
- private ObjectStreamField getField (String name)
- {
- ObjectStreamField field
- = currentObjectStreamClass.getField(name);
-
- if (field == null)
- throw new IllegalArgumentException("no such serializable field " + name);
-
- return field;
- }
-
- public void put(String name, boolean value)
- {
- ObjectStreamField field = getField(name);
-
- checkType(field, 'Z');
- prim_field_data[field.getOffset ()] = (byte)(value ? 1 : 0);
- }
-
- public void put(String name, byte value)
- {
- ObjectStreamField field = getField(name);
-
- checkType(field, 'B');
- prim_field_data[field.getOffset()] = value;
- }
-
- public void put(String name, char value)
- {
- ObjectStreamField field = getField(name);
-
- checkType(field, 'C');
- int off = field.getOffset();
- prim_field_data[off++] = (byte)(value >>> 8);
- prim_field_data[off] = (byte)value;
- }
-
- public void put(String name, double value)
- {
- ObjectStreamField field = getField (name);
-
- checkType(field, 'D');
- int off = field.getOffset();
- long l_value = Double.doubleToLongBits (value);
- prim_field_data[off++] = (byte)(l_value >>> 52);
- prim_field_data[off++] = (byte)(l_value >>> 48);
- prim_field_data[off++] = (byte)(l_value >>> 40);
- prim_field_data[off++] = (byte)(l_value >>> 32);
- prim_field_data[off++] = (byte)(l_value >>> 24);
- prim_field_data[off++] = (byte)(l_value >>> 16);
- prim_field_data[off++] = (byte)(l_value >>> 8);
- prim_field_data[off] = (byte)l_value;
- }
-
- public void put(String name, float value)
- {
- ObjectStreamField field = getField(name);
-
- checkType(field, 'F');
- int off = field.getOffset();
- int i_value = Float.floatToIntBits(value);
- prim_field_data[off++] = (byte)(i_value >>> 24);
- prim_field_data[off++] = (byte)(i_value >>> 16);
- prim_field_data[off++] = (byte)(i_value >>> 8);
- prim_field_data[off] = (byte)i_value;
- }
-
- public void put(String name, int value)
- {
- ObjectStreamField field = getField(name);
- checkType(field, 'I');
- int off = field.getOffset();
- prim_field_data[off++] = (byte)(value >>> 24);
- prim_field_data[off++] = (byte)(value >>> 16);
- prim_field_data[off++] = (byte)(value >>> 8);
- prim_field_data[off] = (byte)value;
- }
-
- public void put(String name, long value)
- {
- ObjectStreamField field = getField(name);
- checkType(field, 'J');
- int off = field.getOffset();
- prim_field_data[off++] = (byte)(value >>> 52);
- prim_field_data[off++] = (byte)(value >>> 48);
- prim_field_data[off++] = (byte)(value >>> 40);
- prim_field_data[off++] = (byte)(value >>> 32);
- prim_field_data[off++] = (byte)(value >>> 24);
- prim_field_data[off++] = (byte)(value >>> 16);
- prim_field_data[off++] = (byte)(value >>> 8);
- prim_field_data[off] = (byte)value;
- }
-
- public void put(String name, short value)
- {
- ObjectStreamField field = getField(name);
- checkType(field, 'S');
- int off = field.getOffset();
- prim_field_data[off++] = (byte)(value >>> 8);
- prim_field_data[off] = (byte)value;
- }
-
- public void put(String name, Object value)
- {
- ObjectStreamField field = getField(name);
-
- if (value != null &&
- ! field.getType().isAssignableFrom(value.getClass ()))
- throw new IllegalArgumentException("Class " + value.getClass() +
- " cannot be cast to " + field.getType());
- objs[field.getOffset()] = value;
- }
-
- public void write(ObjectOutput out) throws IOException
- {
- // Apparently Block data is not used with PutField as per
- // empirical evidence against JDK 1.2. Also see Mauve test
- // java.io.ObjectInputOutput.Test.GetPutField.
- boolean oldmode = setBlockDataMode(false);
- out.write(prim_field_data);
- for (int i = 0; i < objs.length; ++ i)
- out.writeObject(objs[i]);
- setBlockDataMode(oldmode);
- }
-
- private void checkType(ObjectStreamField field, char type)
- throws IllegalArgumentException
- {
- if (TypeSignature.getEncodingOfClass(field.getType()).charAt(0)
- != type)
- throw new IllegalArgumentException();
- }
- };
- // end PutFieldImpl
-
- return currentPutField;
- }
-
-
- public void writeFields() throws IOException
- {
- if (currentPutField == null)
- throw new NotActiveException("writeFields can only be called after putFields has been called");
-
- markFieldsWritten();
- currentPutField.write(this);
- }
-
-
- // write out the block-data buffer, picking the correct header
- // depending on the size of the buffer
- private void writeBlockDataHeader(int size) throws IOException
- {
- if (size < 256)
- {
- realOutput.writeByte(TC_BLOCKDATA);
- realOutput.write(size);
- }
- else
- {
- realOutput.writeByte(TC_BLOCKDATALONG);
- realOutput.writeInt(size);
- }
- }
-
-
- // lookup the handle for OBJ, return null if OBJ doesn't have a
- // handle yet
- private Integer findHandle(Object obj)
- {
- return (Integer)OIDLookupTable.get(new ObjectIdentityWrapper(obj));
- }
-
-
- // assigns the next availible handle to OBJ
- private int assignNewHandle(Object obj)
- {
- OIDLookupTable.put(new ObjectIdentityWrapper(obj),
- new Integer(nextOID));
- return nextOID++;
- }
-
-
- // resets mapping from objects to handles
- private void clearHandles()
- {
- nextOID = baseWireHandle;
- OIDLookupTable.clear();
- }
-
-
- // write out array size followed by each element of the array
- private void writeArraySizeAndElements(Object array, Class clazz)
- throws IOException
- {
- int length = Array.getLength(array);
-
- if (clazz.isPrimitive())
- {
- if (clazz == Boolean.TYPE)
- {
- boolean[] cast_array = (boolean[])array;
- realOutput.writeInt (length);
- for (int i = 0; i < length; i++)
- realOutput.writeBoolean(cast_array[i]);
- return;
- }
- if (clazz == Byte.TYPE)
- {
- byte[] cast_array = (byte[])array;
- realOutput.writeInt(length);
- realOutput.write(cast_array, 0, length);
- return;
- }
- if (clazz == Character.TYPE)
- {
- char[] cast_array = (char[])array;
- realOutput.writeInt(length);
- for (int i = 0; i < length; i++)
- realOutput.writeChar(cast_array[i]);
- return;
- }
- if (clazz == Double.TYPE)
- {
- double[] cast_array = (double[])array;
- realOutput.writeInt(length);
- for (int i = 0; i < length; i++)
- realOutput.writeDouble(cast_array[i]);
- return;
- }
- if (clazz == Float.TYPE)
- {
- float[] cast_array = (float[])array;
- realOutput.writeInt(length);
- for (int i = 0; i < length; i++)
- realOutput.writeFloat(cast_array[i]);
- return;
- }
- if (clazz == Integer.TYPE)
- {
- int[] cast_array = (int[])array;
- realOutput.writeInt(length);
- for (int i = 0; i < length; i++)
- realOutput.writeInt(cast_array[i]);
- return;
- }
- if (clazz == Long.TYPE)
- {
- long[] cast_array = (long[])array;
- realOutput.writeInt (length);
- for (int i = 0; i < length; i++)
- realOutput.writeLong(cast_array[i]);
- return;
- }
- if (clazz == Short.TYPE)
- {
- short[] cast_array = (short[])array;
- realOutput.writeInt (length);
- for (int i = 0; i < length; i++)
- realOutput.writeShort(cast_array[i]);
- return;
- }
- }
- else
- {
- Object[] cast_array = (Object[])array;
- realOutput.writeInt(length);
- for (int i = 0; i < length; i++)
- writeObject(cast_array[i]);
- }
- }
-
-
- // writes out FIELDS of OBJECT for the specified ObjectStreamClass.
- // FIELDS are already in canonical order.
- private void writeFields(Object obj, ObjectStreamClass osc)
- throws IOException
- {
- ObjectStreamField[] fields = osc.fields;
- boolean oldmode = setBlockDataMode(false);
- String field_name;
- Class type;
-
- for (int i = 0; i < fields.length; i++)
- {
- field_name = fields[i].getName();
- type = fields[i].getType();
-
- if (dump)
- dumpElementln ("WRITE FIELD: " + field_name + " type=" + type);
-
- if (type == Boolean.TYPE)
- realOutput.writeBoolean(getBooleanField(obj, osc.forClass(), field_name));
- else if (type == Byte.TYPE)
- realOutput.writeByte(getByteField(obj, osc.forClass(), field_name));
- else if (type == Character.TYPE)
- realOutput.writeChar(getCharField(obj, osc.forClass(), field_name));
- else if (type == Double.TYPE)
- realOutput.writeDouble(getDoubleField(obj, osc.forClass(), field_name));
- else if (type == Float.TYPE)
- realOutput.writeFloat(getFloatField(obj, osc.forClass(), field_name));
- else if (type == Integer.TYPE)
- realOutput.writeInt(getIntField(obj, osc.forClass(), field_name));
- else if (type == Long.TYPE)
- realOutput.writeLong(getLongField(obj, osc.forClass(), field_name));
- else if (type == Short.TYPE)
- realOutput.writeShort(getShortField(obj, osc.forClass(), field_name));
- else
- writeObject(getObjectField(obj, osc.forClass(), field_name,
- fields[i].getTypeString ()));
- }
- setBlockDataMode(oldmode);
- }
-
-
- // Toggles writing primitive data to block-data buffer.
- // Package-private to avoid a trampoline constructor.
- boolean setBlockDataMode(boolean on) throws IOException
- {
- if (on == writeDataAsBlocks)
- return on;
-
- drain();
- boolean oldmode = writeDataAsBlocks;
- writeDataAsBlocks = on;
-
- if (on)
- dataOutput = blockDataOutput;
- else
- dataOutput = realOutput;
-
- return oldmode;
- }
-
-
- private void callWriteMethod(Object obj, ObjectStreamClass osc)
- throws IOException
- {
- currentPutField = null;
- try
- {
- Object args[] = {this};
- osc.writeObjectMethod.invoke(obj, args);
- }
- catch (InvocationTargetException x)
- {
- /* Rethrow if possible. */
- Throwable exception = x.getTargetException();
- if (exception instanceof RuntimeException)
- throw (RuntimeException) exception;
- if (exception instanceof IOException)
- throw (IOException) exception;
-
- IOException ioe
- = new IOException("Exception thrown from writeObject() on " +
- osc.forClass().getName() + ": " +
- exception.getClass().getName());
- ioe.initCause(exception);
- throw ioe;
- }
- catch (Exception x)
- {
- IOException ioe
- = new IOException("Failure invoking writeObject() on " +
- osc.forClass().getName() + ": " +
- x.getClass().getName());
- ioe.initCause(x);
- throw ioe;
- }
- }
-
- private boolean getBooleanField(Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField(klass, field_name);
- boolean b = f.getBoolean(obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private byte getByteField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- byte b = f.getByte (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private char getCharField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- char b = f.getChar (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private double getDoubleField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- double b = f.getDouble (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private float getFloatField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- float b = f.getFloat (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private int getIntField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- int b = f.getInt (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private long getLongField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- long b = f.getLong (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private short getShortField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- short b = f.getShort (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private Object getObjectField (Object obj, Class klass, String field_name,
- String type_code) throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- ObjectStreamField of = new ObjectStreamField(f.getName(), f.getType());
-
- if (of.getTypeString() == null ||
- !of.getTypeString().equals(type_code))
- throw new InvalidClassException
- ("invalid type code for " + field_name + " in class " + klass.getName());
-
- Object o = f.get (obj);
- // FIXME: We should check the type_code here
- return o;
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new IOException ();
- }
- }
-
- private Field getField (Class klass, String name)
- throws java.io.InvalidClassException
- {
- try
- {
- final Field f = klass.getDeclaredField(name);
- setAccessible.setMember(f);
- AccessController.doPrivileged(setAccessible);
- return f;
- }
- catch (java.lang.NoSuchFieldException e)
- {
- throw new InvalidClassException
- ("no field called " + name + " in class " + klass.getName());
- }
- }
-
- private void dumpElementln (String msg)
- {
- for (int i = 0; i < depth; i++)
- System.out.print (" ");
- System.out.print (Thread.currentThread() + ": ");
- System.out.println(msg);
- }
-
- // this value comes from 1.2 spec, but is used in 1.1 as well
- private static final int BUFFER_SIZE = 1024;
-
- private static int defaultProtocolVersion = PROTOCOL_VERSION_2;
-
- private DataOutputStream dataOutput;
- private boolean writeDataAsBlocks;
- private DataOutputStream realOutput;
- private DataOutputStream blockDataOutput;
- private byte[] blockData;
- private int blockDataCount;
- private Object currentObject;
- // Package-private to avoid a trampoline.
- ObjectStreamClass currentObjectStreamClass;
- private PutField currentPutField;
- private boolean fieldsAlreadyWritten;
- private boolean replacementEnabled;
- private boolean isSerializing;
- private int nextOID;
- private Hashtable OIDLookupTable;
- private int protocolVersion;
- private boolean useSubclassMethod;
- private SetAccessibleAction setAccessible = new SetAccessibleAction();
-
- // The nesting depth for debugging output
- private int depth = 0;
-
- // Set if we're generating debugging dumps
- private boolean dump = false;
-
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary("javaio");
- }
- }
-}
diff --git a/libjava/java/io/ObjectStreamConstants.java b/libjava/java/io/ObjectStreamConstants.java
deleted file mode 100644
index f1a4af724e7..00000000000
--- a/libjava/java/io/ObjectStreamConstants.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ObjectStreamConstants.java -- Interface containing constant values
- used in reading and writing serialized objects
- Copyright (C) 1998, 1999, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This interface contains constants that are used in object
- * serialization. This interface is used by <code>ObjectOutputStream</code>,
- * <code>ObjectInputStream</code>, and <code>ObjectStreamClass</code>.
- * The values for these constants are specified by the Java library
- * specification.
- */
-public interface ObjectStreamConstants
-{
- // FIXME: Javadoc comment these values.
- int PROTOCOL_VERSION_1 = 1;
- int PROTOCOL_VERSION_2 = 2;
-
- short STREAM_MAGIC = (short)0xaced;
- short STREAM_VERSION = 5;
-
- byte TC_NULL = (byte)112; //0x70
- byte TC_REFERENCE = (byte)113; //0x71
- byte TC_CLASSDESC = (byte)114; //0x72
- byte TC_OBJECT = (byte)115; //0x73
- byte TC_STRING = (byte)116; //0x74
- byte TC_ARRAY = (byte)117; //0x75
- byte TC_CLASS = (byte)118; //0x76
- byte TC_BLOCKDATA = (byte)119; //0x77
- byte TC_ENDBLOCKDATA = (byte)120; //0x78
- byte TC_RESET = (byte)121; //0x79
- byte TC_BLOCKDATALONG = (byte)122; //0x7A
- byte TC_EXCEPTION = (byte)123; //0x7B
- byte TC_LONGSTRING = (byte)124; //0x7C
- byte TC_PROXYCLASSDESC = (byte)125; //0x7D
-
- byte TC_BASE = TC_NULL;
- byte TC_MAX = TC_PROXYCLASSDESC;
-
- int baseWireHandle = 0x7e0000;
-
- byte SC_WRITE_METHOD = 0x01;
- byte SC_SERIALIZABLE = 0x02;
- byte SC_EXTERNALIZABLE = 0x04;
- byte SC_BLOCK_DATA = 0x08;
-
- SerializablePermission SUBSTITUTION_PERMISSION
- = new SerializablePermission("enableSubstitution");
-
- SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION
- = new SerializablePermission("enableSubclassImplementation");
-}
-
diff --git a/libjava/java/io/ObjectStreamException.java b/libjava/java/io/ObjectStreamException.java
deleted file mode 100644
index 61d4dd09e52..00000000000
--- a/libjava/java/io/ObjectStreamException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ObjectStreamException.java -- Superclass of all serialization exceptions
- Copyright (C) 1998, 2000, 2001, 2002, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when a problem occurs during serialization.
- * There are more specific subclasses that give more fine grained
- * indications of the precise failure.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class ObjectStreamException extends IOException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 7260898174833392607L;
-
- /**
- * Create an exception without a descriptive error message.
- */
- protected ObjectStreamException()
- {
- }
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- protected ObjectStreamException(String message)
- {
- super(message);
- }
-} // class ObjectStreamException
diff --git a/libjava/java/io/ObjectStreamField.java b/libjava/java/io/ObjectStreamField.java
deleted file mode 100644
index 611457b3cfb..00000000000
--- a/libjava/java/io/ObjectStreamField.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/* ObjectStreamField.java -- Class used to store name and class of fields
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-import gnu.java.lang.reflect.TypeSignature;
-
-import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * This class intends to describe the field of a class for the serialization
- * subsystem. Serializable fields in a serializable class can be explicitly
- * exported using an array of ObjectStreamFields.
- */
-public class ObjectStreamField implements Comparable
-{
- private String name;
- private Class type;
- private String typename;
- private int offset = -1; // XXX make sure this is correct
- private boolean unshared;
- private boolean persistent = false;
- private boolean toset = true;
- private Field field;
-
- ObjectStreamField (Field field)
- {
- this (field.getName(), field.getType());
- this.field = field;
- }
-
- /**
- * This constructor creates an ObjectStreamField instance
- * which represents a field named <code>name</code> and is
- * of the type <code>type</code>.
- *
- * @param name Name of the field to export.
- * @param type Type of the field in the concerned class.
- */
- public ObjectStreamField (String name, Class type)
- {
- this (name, type, false);
- }
-
- /**
- * This constructor creates an ObjectStreamField instance
- * which represents a field named <code>name</code> and is
- * of the type <code>type</code>.
- *
- * @param name Name of the field to export.
- * @param type Type of the field in the concerned class.
- * @param unshared true if field will be unshared, false otherwise.
- */
- public ObjectStreamField (String name, Class type, boolean unshared)
- {
- if (name == null)
- throw new NullPointerException();
-
- this.name = name;
- this.type = type;
- this.typename = TypeSignature.getEncodingOfClass(type);
- this.unshared = unshared;
- }
-
- /**
- * There are many cases you can not get java.lang.Class from typename
- * if your context class loader cannot load it, then use typename to
- * construct the field.
- *
- * @param name Name of the field to export.
- * @param typename The coded name of the type for this field.
- */
- ObjectStreamField (String name, String typename)
- {
- this.name = name;
- this.typename = typename;
- try
- {
- type = TypeSignature.getClassForEncoding(typename);
- }
- catch(ClassNotFoundException e)
- {
- }
- }
-
- /**
- * There are many cases you can not get java.lang.Class from typename
- * if your context class loader cann not load it, then use typename to
- * construct the field.
- *
- * @param name Name of the field to export.
- * @param typename The coded name of the type for this field.
- * @param loader The class loader to use to resolve class names.
- */
- ObjectStreamField (String name, String typename, ClassLoader loader)
- {
- this.name = name;
- this.typename = typename;
- try
- {
- type = TypeSignature.getClassForEncoding(typename, true, loader);
- }
- catch(ClassNotFoundException e)
- {
- }
- }
-
- /**
- * This method returns the name of the field represented by the
- * ObjectStreamField instance.
- *
- * @return A string containing the name of the field.
- */
- public String getName ()
- {
- return name;
- }
-
- /**
- * This method returns the class representing the type of the
- * field which is represented by this instance of ObjectStreamField.
- *
- * @return A class representing the type of the field.
- */
- public Class getType ()
- {
- return type;
- }
-
- /**
- * This method returns the char encoded type of the field which
- * is represented by this instance of ObjectStreamField.
- *
- * @return A char representing the type of the field.
- */
- public char getTypeCode ()
- {
- return typename.charAt (0);
- }
-
- /**
- * This method returns a more explicit type name than
- * {@link #getTypeCode()} in the case the type is a real
- * class (and not a primitive).
- *
- * @return The name of the type (class name) if it is not a
- * primitive, in the other case null is returned.
- */
- public String getTypeString ()
- {
- // use intern()
- if (isPrimitive())
- return null;
- return typename.intern();
- }
-
- /**
- * This method returns the current offset of the field in
- * the serialization stream relatively to the other fields.
- * The offset is expressed in bytes.
- *
- * @return The offset of the field in bytes.
- * @see #setOffset(int)
- */
- public int getOffset ()
- {
- return offset;
- }
-
- /**
- * This method sets the current offset of the field.
- *
- * @param off The offset of the field in bytes.
- * @see getOffset()
- */
- protected void setOffset (int off)
- {
- offset = off;
- }
-
- /**
- * This method returns whether the field represented by this object is
- * unshared or not.
- *
- * @return Tells if this field is unshared or not.
- */
- public boolean isUnshared ()
- {
- return unshared;
- }
-
- /**
- * This method returns true if the type of the field
- * represented by this instance is a primitive.
- *
- * @return true if the type is a primitive, false
- * in the other case.
- */
- public boolean isPrimitive ()
- {
- return typename.length() == 1;
- }
-
- /**
- * Compares this object to the given object.
- *
- * @param obj the object to compare to.
- *
- * @return -1, 0 or 1.
- */
- public int compareTo (Object obj)
- {
- ObjectStreamField f = (ObjectStreamField) obj;
- boolean this_is_primitive = isPrimitive ();
- boolean f_is_primitive = f.isPrimitive ();
-
- if (this_is_primitive && !f_is_primitive)
- return -1;
-
- if (!this_is_primitive && f_is_primitive)
- return 1;
-
- return getName ().compareTo (f.getName ());
- }
-
- /**
- * This method is specific to classpath's implementation and so has the default
- * access. It changes the state of this field to "persistent". It means that
- * the field should not be changed when the stream is read (if it is not
- * explicitly specified using serialPersistentFields).
- *
- * @param persistent True if the field is persistent, false in the
- * other cases.
- * @see #isPersistent()
- */
- void setPersistent(boolean persistent)
- {
- this.persistent = persistent;
- }
-
- /**
- * This method returns true if the field is marked as persistent.
- *
- * @return True if persistent, false in the other cases.
- * @see #setPersistent(boolean)
- */
- boolean isPersistent()
- {
- return persistent;
- }
-
- /**
- * This method is specific to classpath's implementation and so
- * has the default access. It changes the state of this field as
- * to be set by ObjectInputStream.
- *
- * @param toset True if this field should be set, false in the other
- * cases.
- * @see #isToSet()
- */
- void setToSet(boolean toset)
- {
- this.toset = toset;
- }
-
- /**
- * This method returns true if the field is marked as to be
- * set.
- *
- * @return True if it is to be set, false in the other cases.
- * @see #setToSet(boolean)
- */
- boolean isToSet()
- {
- return toset;
- }
-
- /**
- * This method searches for its field reference in the specified class
- * object. It requests privileges. If an error occurs the internal field
- * reference is not modified.
- *
- * @throws NoSuchFieldException if the field name does not exist in this class.
- * @throws SecurityException if there was an error requesting the privileges.
- */
- void lookupField(Class clazz) throws NoSuchFieldException, SecurityException
- {
- final Field f = clazz.getDeclaredField(name);
-
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- f.setAccessible(true);
- return null;
- }
- });
-
- this.field = f;
- }
-
- /**
- * This method check whether the field described by this
- * instance of ObjectStreamField is compatible with the
- * actual implementation of this field.
- *
- * @throws NullPointerException if this field does not exist
- * in the real class.
- * @throws InvalidClassException if the types are incompatible.
- */
- void checkFieldType() throws InvalidClassException
- {
- Class ftype = field.getType();
-
- if (!ftype.isAssignableFrom(type))
- throw new InvalidClassException
- ("invalid field type for " + name +
- " in class " + field.getDeclaringClass());
- }
-
- /**
- * Returns a string representing this object.
- *
- * @return the string.
- */
- public String toString ()
- {
- return "ObjectStreamField< " + type + " " + name + " >";
- }
-
- final void setBooleanField(Object obj, boolean val)
- {
- VMObjectStreamClass.setBooleanNative(field, obj, val);
- }
-
- final void setByteField(Object obj, byte val)
- {
- VMObjectStreamClass.setByteNative(field, obj, val);
- }
-
- final void setCharField(Object obj, char val)
- {
- VMObjectStreamClass.setCharNative(field, obj, val);
- }
-
- final void setShortField(Object obj, short val)
- {
- VMObjectStreamClass.setShortNative(field, obj, val);
- }
-
- final void setIntField(Object obj, int val)
- {
- VMObjectStreamClass.setIntNative(field, obj, val);
- }
-
- final void setLongField(Object obj, long val)
- {
- VMObjectStreamClass.setLongNative(field, obj, val);
- }
-
- final void setFloatField(Object obj, float val)
- {
- VMObjectStreamClass.setFloatNative(field, obj, val);
- }
-
- final void setDoubleField(Object obj, double val)
- {
- VMObjectStreamClass.setDoubleNative(field, obj, val);
- }
-
- final void setObjectField(Object obj, Object val)
- {
- VMObjectStreamClass.setObjectNative(field, obj, val);
- }
-}
diff --git a/libjava/java/io/OptionalDataException.java b/libjava/java/io/OptionalDataException.java
deleted file mode 100644
index 8d8b1bda0e3..00000000000
--- a/libjava/java/io/OptionalDataException.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/* OptionalDataException.java -- indicates unexpected data in serialized stream
- Copyright (C) 1998, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when unexpected data appears in the input
- * stream from which a serialized object is being read. There are two
- * cases:<br><ul>
- * <li>The next stream element is primitive data. <code>eof</code> will
- * be false, and <code>count</code> is the number of bytes of primitive
- * data available.</li>
- * <li>The data consumable by readObject or readExternal has been exhausted.
- * <code>eof</code> is true, and <code>count</code> is 0.</li>
- * </ul>
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class OptionalDataException extends ObjectStreamException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -8011121865681257820L;
-
- /**
- * Whether or not the end of the stream has been reached.
- *
- * @serial the end of the buffer was reached
- */
- public boolean eof;
-
- /**
- * The number of valid bytes that can be read.
- *
- * @serial the bytes of the buffer remaining
- */
- public int length;
-
- /**
- * Create a new OptionalDataException with an eof parameter indicating
- * whether or not the end of stream is reached and the number of valid
- * bytes that may be read.
- *
- * @param eof 'true' if end of stream reached, 'false' otherwise
- * @param count The number of valid bytes to be read
- */
- OptionalDataException(boolean eof, int count)
- {
- this.eof = eof;
- this.length = count;
- }
-} // class OptionalDataException
diff --git a/libjava/java/io/OutputStream.java b/libjava/java/io/OutputStream.java
deleted file mode 100644
index 8608daaa161..00000000000
--- a/libjava/java/io/OutputStream.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* OutputStream.java -- Base class for byte output streams
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This abstract class forms the base of the hierarchy of classes that
- * write output as a stream of bytes. It provides a common set of methods
- * for writing bytes to stream. Subclasses implement and/or extend these
- * methods to write bytes in a particular manner or to a particular
- * destination such as a file on disk or network connection.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- */
-public abstract class OutputStream
-{
- /**
- * This is the default no-argument constructor for this class. This method
- * does nothing in this class.
- */
- public OutputStream ()
- {
- }
-
- /**
- * This method writes a single byte to the output stream. The byte written
- * is the low eight bits of the <code>int</code> passed and a argument.
- * <p>
- * Subclasses must provide an implementation of this abstract method
- *
- * @param b The byte to be written to the output stream, passed as
- * the low eight bits of an <code>int</code>
- *
- * @exception IOException If an error occurs
- */
- public abstract void write (int b) throws IOException;
-
- /**
- * This method all the writes bytes from the passed array to the
- * output stream. This method is equivalent to <code>write(b, 0,
- * buf.length)</code> which is exactly how it is implemented in this
- * class.
- *
- * @param b The array of bytes to write
- *
- * @exception IOException If an error occurs
- */
- public void write (byte[] b) throws IOException, NullPointerException
- {
- write (b, 0, b.length);
- }
-
- /**
- * This method writes <code>len</code> bytes from the specified array
- * <code>b</code> starting at index <code>off</code> into the array.
- * <p>
- * This method in this class calls the single byte <code>write()</code>
- * method in a loop until all bytes have been written. Subclasses should
- * override this method if possible in order to provide a more efficent
- * implementation.
- *
- * @param b The array of bytes to write from
- * @param off The index into the array to start writing from
- * @param len The number of bytes to write
- *
- * @exception IOException If an error occurs
- */
- public void write (byte[] b, int off, int len)
- throws IOException, NullPointerException, IndexOutOfBoundsException
- {
- if (off < 0 || len < 0 || off + len > b.length)
- throw new ArrayIndexOutOfBoundsException ();
- for (int i = 0; i < len; ++i)
- write (b[off + i]);
- }
-
- /**
- * This method forces any data that may have been buffered to be written
- * to the underlying output device. Please note that the host environment
- * might perform its own buffering unbeknowst to Java. In that case, a
- * write made (for example, to a disk drive) might be cached in OS
- * buffers instead of actually being written to disk.
- * <p>
- * This method in this class does nothing.
- *
- * @exception IOException If an error occurs
- */
- public void flush () throws IOException
- {
- }
-
- /**
- * This method closes the stream. Any internal or native resources
- * associated with this stream are freed. Any subsequent attempt to
- * access the stream might throw an exception.
- * <p>
- * This method in this class does nothing.
- *
- * @exception IOException If an error occurs
- */
- public void close () throws IOException
- {
- }
-}
diff --git a/libjava/java/io/PipedInputStream.java b/libjava/java/io/PipedInputStream.java
deleted file mode 100644
index beb310b4f0c..00000000000
--- a/libjava/java/io/PipedInputStream.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/* PipedInputStream.java -- Read portion of piped streams.
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-// NOTE: This implementation is very similar to that of PipedReader. If you
-// fix a bug in here, chances are you should make a similar change to the
-// PipedReader code.
-
-/**
- * An input stream that reads its bytes from an output stream
- * to which it is connected.
- * <p>
- * Data is read and written to an internal buffer. It is highly recommended
- * that the <code>PipedInputStream</code> and connected
- * <code>PipedOutputStream</code>
- * be part of different threads. If they are not, the read and write
- * operations could deadlock their thread.
- *
- * @specnote The JDK implementation appears to have some undocumented
- * functionality where it keeps track of what thread is writing
- * to pipe and throws an IOException if that thread susequently
- * dies. This behaviour seems dubious and unreliable - we don't
- * implement it.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class PipedInputStream extends InputStream
-{
- /** PipedOutputStream to which this is connected. Null only if this
- * InputStream hasn't been connected yet. */
- PipedOutputStream source;
-
- /** Set to true if close() has been called on this InputStream. */
- boolean closed;
-
-
- /**
- * The size of the internal buffer used for input/output.
- */
- /* The "Constant Field Values" Javadoc of the Sun J2SE 1.4
- * specifies 1024.
- */
- protected static final int PIPE_SIZE = 1024;
-
-
- /**
- * This is the internal circular buffer used for storing bytes written
- * to the pipe and from which bytes are read by this stream
- */
- protected byte[] buffer = new byte[PIPE_SIZE];
-
- /**
- * The index into buffer where the next byte from the connected
- * <code>PipedOutputStream</code> will be written. If this variable is
- * equal to <code>out</code>, then the buffer is full. If set to < 0,
- * the buffer is empty.
- */
- protected int in = -1;
-
- /**
- * This index into the buffer where bytes will be read from.
- */
- protected int out = 0;
-
- /** Buffer used to implement single-argument read/receive */
- private byte[] read_buf = new byte[1];
-
- /**
- * Creates a new <code>PipedInputStream</code> that is not connected to a
- * <code>PipedOutputStream</code>. It must be connected before bytes can
- * be read from this stream.
- */
- public PipedInputStream()
- {
- }
-
- /**
- * This constructor creates a new <code>PipedInputStream</code> and connects
- * it to the passed in <code>PipedOutputStream</code>. The stream is then
- * ready for reading.
- *
- * @param source The <code>PipedOutputStream</code> to connect this
- * stream to
- *
- * @exception IOException If <code>source</code> is already connected.
- */
- public PipedInputStream(PipedOutputStream source) throws IOException
- {
- connect(source);
- }
-
- /**
- * This method connects this stream to the passed in
- * <code>PipedOutputStream</code>.
- * This stream is then ready for reading. If this stream is already
- * connected or has been previously closed, then an exception is thrown
- *
- * @param src The <code>PipedOutputStream</code> to connect this stream to
- *
- * @exception IOException If this PipedInputStream or <code>source</code>
- * has been connected already.
- */
- public void connect(PipedOutputStream source) throws IOException
- {
- // The JDK (1.3) does not appear to check for a previously closed
- // connection here.
-
- if (this.source != null || source.sink != null)
- throw new IOException ("Already connected");
-
- source.sink = this;
- this.source = source;
- }
-
- /**
- * This method receives a byte of input from the source PipedOutputStream.
- * If the internal circular buffer is full, this method blocks.
- *
- * @param val The byte to write to this stream
- *
- * @exception IOException if error occurs
- * @specnote Weird. This method must be some sort of accident.
- */
- protected synchronized void receive(int val) throws IOException
- {
- read_buf[0] = (byte) (val & 0xff);
- receive (read_buf, 0, 1);
- }
-
- /**
- * This method is used by the connected <code>PipedOutputStream</code> to
- * write bytes into the buffer.
- *
- * @param buf The array containing bytes to write to this stream
- * @param offset The offset into the array to start writing from
- * @param len The number of bytes to write.
- *
- * @exception IOException If an error occurs
- * @specnote This code should be in PipedOutputStream.write, but we
- * put it here in order to support that bizarre recieve(int)
- * method.
- */
- synchronized void receive(byte[] buf, int offset, int len)
- throws IOException
- {
- if (closed)
- throw new IOException ("Pipe closed");
-
- int bufpos = offset;
- int copylen;
-
- while (len > 0)
- {
- try
- {
- while (in == out)
- {
- // The pipe is full. Wake up any readers and wait for them.
- notifyAll();
- wait();
- // The pipe could have been closed while we were waiting.
- if (closed)
- throw new IOException ("Pipe closed");
- }
- }
- catch (InterruptedException ix)
- {
- throw new InterruptedIOException ();
- }
-
- if (in < 0) // The pipe is empty.
- in = 0;
-
- // Figure out how many bytes from buf can be copied without
- // overrunning out or going past the length of the buffer.
- if (in < out)
- copylen = Math.min (len, out - in);
- else
- copylen = Math.min (len, buffer.length - in);
-
- // Copy bytes until the pipe is filled, wrapping if necessary.
- System.arraycopy(buf, bufpos, buffer, in, copylen);
- len -= copylen;
- bufpos += copylen;
- in += copylen;
- if (in == buffer.length)
- in = 0;
- }
- // Notify readers that new data is in the pipe.
- notifyAll();
- }
-
- /**
- * This method reads one byte from the stream.
- * -1 is returned to indicated that no bytes can be read
- * because the end of the stream was reached. If the stream is already
- * closed, a -1 will again be returned to indicate the end of the stream.
- *
- * <p>This method will block if no byte is available to be read.</p>
- *
- * @return the value of the read byte value, or -1 of the end of the stream
- * was reached
- *
- * @throws IOException if an error occured
- */
- public int read() throws IOException
- {
- // Method operates by calling the multibyte overloaded read method
- // Note that read_buf is an internal instance variable. I allocate it
- // there to avoid constant reallocation overhead for applications that
- // call this method in a loop at the cost of some unneeded overhead
- // if this method is never called.
-
- int r = read(read_buf, 0, 1);
- return r != -1 ? (read_buf[0] & 0xff) : -1;
- }
-
- /**
- * This method reads bytes from the stream into a caller supplied buffer.
- * It starts storing bytes at position <code>offset</code> into the
- * buffer and
- * reads a maximum of <code>len</code> bytes. Note that this method
- * can actually
- * read fewer than <code>len</code> bytes. The actual number of bytes
- * read is
- * returned. A -1 is returned to indicated that no bytes can be read
- * because the end of the stream was reached - ie close() was called on the
- * connected PipedOutputStream.
- * <p>
- * This method will block if no bytes are available to be read.
- *
- * @param buf The buffer into which bytes will be stored
- * @param offset The index into the buffer at which to start writing.
- * @param len The maximum number of bytes to read.
- *
- * @exception IOException If <code>close()</code> was called on this Piped
- * InputStream.
- */
- public synchronized int read(byte[] buf, int offset, int len)
- throws IOException
- {
- if (source == null)
- throw new IOException ("Not connected");
- if (closed)
- throw new IOException ("Pipe closed");
-
- // If the buffer is empty, wait until there is something in the pipe
- // to read.
- try
- {
- while (in < 0)
- {
- if (source.closed)
- return -1;
- wait();
- }
- }
- catch (InterruptedException ix)
- {
- throw new InterruptedIOException();
- }
-
- int total = 0;
- int copylen;
-
- while (true)
- {
- // Figure out how many bytes from the pipe can be copied without
- // overrunning in or going past the length of buf.
- if (out < in)
- copylen = Math.min (len, in - out);
- else
- copylen = Math.min (len, buffer.length - out);
-
- System.arraycopy (buffer, out, buf, offset, copylen);
- offset += copylen;
- len -= copylen;
- out += copylen;
- total += copylen;
-
- if (out == buffer.length)
- out = 0;
-
- if (out == in)
- {
- // Pipe is now empty.
- in = -1;
- out = 0;
- }
-
- // If output buffer is filled or the pipe is empty, we're done.
- if (len == 0 || in == -1)
- {
- // Notify any waiting outputstream that there is now space
- // to write.
- notifyAll();
- return total;
- }
- }
- }
-
- /**
- * This method returns the number of bytes that can be read from this stream
- * before blocking could occur. This is the number of bytes that are
- * currently unread in the internal circular buffer. Note that once this
- * many additional bytes are read, the stream may block on a subsequent
- * read, but it not guaranteed to block.
- *
- * @return The number of bytes that can be read before blocking might occur
- *
- * @exception IOException If an error occurs
- */
- public synchronized int available() throws IOException
- {
- // The JDK 1.3 implementation does not appear to check for the closed or
- // unconnected stream conditions here.
-
- if (in < 0)
- return 0;
- else if (out < in)
- return in - out;
- else
- return (buffer.length - out) + in;
- }
-
- /**
- * This methods closes the stream so that no more data can be read
- * from it.
- *
- * @exception IOException If an error occurs
- */
- public synchronized void close() throws IOException
- {
- closed = true;
- // Wake any thread which may be in receive() waiting to write data.
- notifyAll();
- }
-}
-
diff --git a/libjava/java/io/PipedOutputStream.java b/libjava/java/io/PipedOutputStream.java
deleted file mode 100644
index 81881050d1b..00000000000
--- a/libjava/java/io/PipedOutputStream.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/* PipedOutputStream.java -- Write portion of piped streams.
- Copyright (C) 1998, 2000, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-// NOTE: This implementation is very similar to that of PipedWriter. If you
-// fix a bug in here, chances are you should make a similar change to the
-// PipedWriter code.
-
-/**
- * This class writes its bytes to a <code>PipedInputStream</code> to
- * which it is connected.
- * <p>
- * It is highly recommended that a <code>PipedOutputStream</code> and its
- * connected <code>PipedInputStream</code> be in different threads. If
- * they are in the same thread, read and write operations could deadlock
- * the thread.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class PipedOutputStream extends OutputStream
-{
- /** Target PipedInputStream to which this is connected. Null only if this
- * OutputStream hasn't been connected yet. */
- PipedInputStream sink;
-
- /** Set to true if close() has been called on this OutputStream. */
- boolean closed;
-
- /**
- * Create an unconnected PipedOutputStream. It must be connected
- * to a <code>PipedInputStream</code> using the <code>connect</code>
- * method prior to writing any data or an exception will be thrown.
- */
- public PipedOutputStream()
- {
- }
-
- /**
- * Create a new <code>PipedOutputStream</code> instance
- * to write to the specified <code>PipedInputStream</code>. This stream
- * is then ready for writing.
- *
- * @param sink The <code>PipedInputStream</code> to connect this stream to.
- *
- * @exception IOException If <code>sink</code> has already been connected
- * to a different PipedOutputStream.
- */
- public PipedOutputStream(PipedInputStream sink) throws IOException
- {
- sink.connect(this);
- }
-
- /**
- * Connects this object to the specified <code>PipedInputStream</code>
- * object. This stream will then be ready for writing.
- *
- * @param sink The <code>PipedInputStream</code> to connect this stream to
- *
- * @exception IOException If the stream has not been connected or has
- * been closed.
- */
- public void connect(PipedInputStream sink) throws IOException
- {
- if (this.sink != null || sink.source != null)
- throw new IOException ("Already connected");
- sink.connect(this);
- }
-
- /**
- * Write a single byte of date to the stream. Note that this method will
- * block if the <code>PipedInputStream</code> to which this object is
- * connected has a full buffer.
- *
- * @param b The byte of data to be written, passed as an <code>int</code>.
- *
- * @exception IOException If the stream has not been connected or has
- * been closed.
- */
- public void write(int b) throws IOException
- {
- if (sink == null)
- throw new IOException ("Not connected");
- if (closed)
- throw new IOException ("Pipe closed");
-
- sink.receive (b);
- }
-
- /**
- * This method writes <code>len</code> bytes of data from the byte array
- * <code>buf</code> starting at index <code>offset</code> in the array
- * to the stream. Note that this method will block if the
- * <code>PipedInputStream</code> to which this object is connected has
- * a buffer that cannot hold all of the bytes to be written.
- *
- * @param buffer The array containing bytes to write to the stream.
- * @param offset The index into the array to start writing bytes from.
- * @param len The number of bytes to write.
- *
- * @exception IOException If the stream has not been connected or has
- * been closed.
- */
- public void write(byte[] buffer, int offset, int len) throws IOException
- {
- if (sink == null)
- throw new IOException ("Not connected");
- if (closed)
- throw new IOException ("Pipe closed");
-
- sink.receive(buffer, offset, len);
- }
-
- /**
- * This method does nothing.
- *
- * @exception IOException If the stream is closed.
- * @specnote You'd think that this method would block until the sink
- * had read all available data. Thats not the case - this method
- * appears to be a no-op?
- */
- public void flush() throws IOException
- {
- }
-
- /**
- * This method closes this stream so that no more data can be written
- * to it. Any further attempts to write to this stream may throw an
- * exception
- *
- * @exception IOException If an error occurs
- */
- public void close() throws IOException
- {
- // A close call on an unconnected PipedOutputStream has no effect.
- if (sink != null)
- {
- closed = true;
- // Notify any waiting readers that the stream is now closed.
- synchronized (sink)
- {
- sink.notifyAll();
- }
- }
- }
-}
diff --git a/libjava/java/io/PipedReader.java b/libjava/java/io/PipedReader.java
deleted file mode 100644
index 90fc10f672d..00000000000
--- a/libjava/java/io/PipedReader.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/* PipedReader.java -- Read portion of piped character streams.
- Copyright (C) 1998, 1999, 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-// NOTE: This implementation is very similar to that of PipedInputStream.
-// If you fix a bug in here, chances are you should make a similar change to
-// the PipedInputStream code.
-
-/**
- * An input stream that reads characters from a piped writer to which it is
- * connected.
- * <p>
- * Data is read and written to an internal buffer. It is highly recommended
- * that the <code>PipedReader</code> and connected <code>PipedWriter</code>
- * be part of different threads. If they are not, there is a possibility
- * that the read and write operations could deadlock their thread.
- *
- * @specnote The JDK implementation appears to have some undocumented
- * functionality where it keeps track of what thread is writing
- * to pipe and throws an IOException if that thread susequently
- * dies. This behaviour seems dubious and unreliable - we don't
- * implement it.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class PipedReader extends Reader
-{
- /** PipedWriter to which this is connected. Null only if this
- * Reader hasn't been connected yet. */
- PipedWriter source;
-
- /** Set to true if close() has been called on this Reader. */
- boolean closed;
-
- /**
- * The size of the internal buffer used for input/output.
- */
- static final int PIPE_SIZE = 2048;
-
- /**
- * This is the internal circular buffer used for storing chars written
- * to the pipe and from which chars are read by this stream
- */
- char[] buffer = new char[PIPE_SIZE];
-
- /**
- * The index into buffer where the next char from the connected
- * <code>PipedWriter</code> will be written. If this variable is
- * equal to <code>out</code>, then the buffer is full. If set to < 0,
- * the buffer is empty.
- */
- int in = -1;
-
- /**
- * This index into the buffer where chars will be read from.
- */
- int out = 0;
-
- /** Buffer used to implement single-argument read/receive */
- char[] read_buf = new char[1];
-
- /**
- * Creates a new <code>PipedReader</code> that is not connected to a
- * <code>PipedWriter</code>. It must be connected before chars can
- * be read from this stream.
- */
- public PipedReader()
- {
- }
-
- /**
- * This constructor creates a new <code>PipedReader</code> and connects
- * it to the passed in <code>PipedWriter</code>. The stream is then
- * ready for reading.
- *
- * @param source The <code>PipedWriter</code> to connect this stream to
- *
- * @exception IOException If <code>source</code> is already connected.
- */
- public PipedReader(PipedWriter source) throws IOException
- {
- connect(source);
- }
-
- /**
- * This method connects this stream to the passed in
- * <code>PipedWriter</code>.
- * This stream is then ready for reading. If this stream is already
- * connected or has been previously closed, then an exception is thrown
- *
- * @param source The <code>PipedWriter</code> to connect this stream to
- *
- * @exception IOException If this PipedReader or <code>source</code>
- * has been connected already.
- */
- public void connect(PipedWriter source) throws IOException
- {
- // The JDK (1.3) does not appear to check for a previously closed
- // connection here.
-
- if (this.source != null || source.sink != null)
- throw new IOException ("Already connected");
-
- source.sink = this;
- this.source = source;
- }
-
- /**
- * This method is used by the connected <code>PipedWriter</code> to
- * write chars into the buffer.
- *
- * @param buf The array containing chars to write to this stream
- * @param offset The offset into the array to start writing from
- * @param len The number of chars to write.
- *
- * @exception IOException If an error occurs
- * @specnote This code should be in PipedWriter.write, but we
- * put it here in order to support that bizarre recieve(int)
- * method.
- */
- void receive(char[] buf, int offset, int len)
- throws IOException
- {
- synchronized (lock)
- {
- if (closed)
- throw new IOException ("Pipe closed");
-
- int bufpos = offset;
- int copylen;
-
- while (len > 0)
- {
- try
- {
- while (in == out)
- {
- // The pipe is full. Wake up any readers and wait for them.
- lock.notifyAll();
- lock.wait();
- // The pipe could have been closed while we were waiting.
- if (closed)
- throw new IOException ("Pipe closed");
- }
- }
- catch (InterruptedException ix)
- {
- throw new InterruptedIOException ();
- }
-
- if (in < 0) // The pipe is empty.
- in = 0;
-
- // Figure out how many chars from buf can be copied without
- // overrunning out or going past the length of the buffer.
- if (in < out)
- copylen = Math.min (len, out - in);
- else
- copylen = Math.min (len, buffer.length - in);
-
- // Copy chars until the pipe is filled, wrapping if necessary.
- System.arraycopy(buf, bufpos, buffer, in, copylen);
- len -= copylen;
- bufpos += copylen;
- in += copylen;
- if (in == buffer.length)
- in = 0;
- }
- // Notify readers that new data is in the pipe.
- lock.notifyAll();
- }
- }
-
- /**
- * This method reads chars from the stream into a caller supplied buffer.
- * It starts storing chars at position <code>offset</code> into the
- * buffer and
- * reads a maximum of <code>len</code> chars. Note that this method
- * can actually
- * read fewer than <code>len</code> chars. The actual number of chars
- * read is
- * returned. A -1 is returned to indicated that no chars can be read
- * because the end of the stream was reached. If the stream is already
- * closed, a -1 will again be returned to indicate the end of the stream.
- * <p>
- * This method will block if no char is available to be read.
- */
- public int read() throws IOException
- {
- // Method operates by calling the multichar overloaded read method
- // Note that read_buf is an internal instance variable. I allocate it
- // there to avoid constant reallocation overhead for applications that
- // call this method in a loop at the cost of some unneeded overhead
- // if this method is never called.
-
- int r = read(read_buf, 0, 1);
- return r != -1 ? read_buf[0] : -1;
- }
-
- /**
- * This method reads characters from the stream into a caller supplied
- * buffer. It starts storing chars at position <code>offset</code> into
- * the buffer and reads a maximum of <code>len</code> chars. Note that
- * this method can actually read fewer than <code>len</code> chars.
- * The actual number of chars read is
- * returned. A -1 is returned to indicated that no chars can be read
- * because the end of the stream was reached - ie close() was called on the
- * connected PipedWriter.
- * <p>
- * This method will block if no chars are available to be read.
- *
- * @param buf The buffer into which chars will be stored
- * @param offset The index into the buffer at which to start writing.
- * @param len The maximum number of chars to read.
- *
- * @exception IOException If <code>close()</code> was called on this Piped
- * Reader.
- */
- public int read(char[] buf, int offset, int len)
- throws IOException
- {
- synchronized (lock)
- {
- if (source == null)
- throw new IOException ("Not connected");
- if (closed)
- throw new IOException ("Pipe closed");
-
- // If the buffer is empty, wait until there is something in the pipe
- // to read.
- try
- {
- while (in < 0)
- {
- if (source.closed)
- return -1;
- lock.wait();
- }
- }
- catch (InterruptedException ix)
- {
- throw new InterruptedIOException();
- }
-
- int total = 0;
- int copylen;
-
- while (true)
- {
- // Figure out how many chars from the pipe can be copied without
- // overrunning in or going past the length of buf.
- if (out < in)
- copylen = Math.min (len, in - out);
- else
- copylen = Math.min (len, buffer.length - out);
-
- System.arraycopy (buffer, out, buf, offset, copylen);
- offset += copylen;
- len -= copylen;
- out += copylen;
- total += copylen;
-
- if (out == buffer.length)
- out = 0;
-
- if (out == in)
- {
- // Pipe is now empty.
- in = -1;
- out = 0;
- }
-
- // If output buffer is filled or the pipe is empty, we're done.
- if (len == 0 || in == -1)
- {
- // Notify any waiting Writer that there is now space
- // to write.
- lock.notifyAll();
- return total;
- }
- }
- }
- }
-
- public boolean ready() throws IOException
- {
- // The JDK 1.3 implementation does not appear to check for the closed or
- // unconnected stream conditions here. However, checking for a
- // closed stream is explicitly required by the JDK 1.2 and 1.3
- // documentation (for Reader.close()), so we do it.
-
- synchronized (lock)
- {
- if (closed)
- throw new IOException("Pipe closed");
-
- if (in < 0)
- return false;
-
- int count;
- if (out < in)
- count = in - out;
- else
- count = (buffer.length - out) - in;
-
- return (count > 0);
- }
- }
-
- /**
- * This methods closes the stream so that no more data can be read
- * from it.
- *
- * @exception IOException If an error occurs
- */
- public void close() throws IOException
- {
- synchronized (lock)
- {
- closed = true;
- // Wake any thread which may be in receive() waiting to write data.
- lock.notifyAll();
- }
- }
-}
-
diff --git a/libjava/java/io/PipedWriter.java b/libjava/java/io/PipedWriter.java
deleted file mode 100644
index 92786e5de7d..00000000000
--- a/libjava/java/io/PipedWriter.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/* PipedWriter.java -- Write portion of piped character streams.
- Copyright (C) 1998, 2000, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-// NOTE: This implementation is very similar to that of PipedOutputStream.
-// If you fix a bug in here, chances are you should make a similar change to
-// the PipedOutputStream code.
-
-/**
- * This class writes its chars to a <code>PipedReader</code> to
- * which it is connected.
- * <p>
- * It is highly recommended that a <code>PipedWriter</code> and its
- * connected <code>PipedReader</code> be in different threads. If
- * they are in the same thread, read and write operations could deadlock
- * the thread.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class PipedWriter extends Writer
-{
- /** Target PipedReader to which this is connected. Null only if this
- * Writer hasn't been connected yet. */
- PipedReader sink;
-
- /** Set to true if close() has been called on this Writer. */
- boolean closed;
-
- /** Buffer used to implement single-argument write */
- char[] read_buf = new char[1];
-
- /**
- * Create an unconnected PipedWriter. It must be connected
- * to a <code>PipedReader</code> using the <code>connect</code>
- * method prior to writing any data or an exception will be thrown.
- */
- public PipedWriter()
- {
- }
-
- /**
- * Create a new <code>PipedWriter</code> instance
- * to write to the specified <code>PipedReader</code>. This stream
- * is then ready for writing.
- *
- * @param sink The <code>PipedReader</code> to connect this stream to.
- *
- * @exception IOException If <code>sink</code> has already been connected
- * to a different PipedWriter.
- */
- public PipedWriter(PipedReader sink) throws IOException
- {
- sink.connect(this);
- }
-
- /**
- * Connects this object to the specified <code>PipedReader</code>
- * object. This stream will then be ready for writing.
- *
- * @param sink The <code>PipedReader</code> to connect this stream to
- *
- * @exception IOException If the stream has not been connected or has
- * been closed.
- */
- public void connect(PipedReader sink) throws IOException
- {
- if (this.sink != null || sink.source != null)
- throw new IOException ("Already connected");
- sink.connect(this);
- }
-
- /**
- * Write a single char of date to the stream. Note that this method will
- * block if the <code>PipedReader</code> to which this object is
- * connected has a full buffer.
- *
- * @param b The char of data to be written, passed as an <code>int</code>.
- *
- * @exception IOException If the stream has not been connected or has
- * been closed.
- */
- public void write(int b) throws IOException
- {
- read_buf[0] = (char) (b & 0xffff);
- sink.receive (read_buf, 0, 1);
- }
-
- /**
- * This method writes <code>len</code> chars of data from the char array
- * <code>buf</code> starting at index <code>offset</code> in the array
- * to the stream. Note that this method will block if the
- * <code>PipedReader</code> to which this object is connected has
- * a buffer that cannot hold all of the chars to be written.
- *
- * @param buffer The array containing chars to write to the stream.
- * @param offset The index into the array to start writing chars from.
- * @param len The number of chars to write.
- *
- * @exception IOException If the stream has not been connected or has
- * been closed.
- */
- public void write(char[] buffer, int offset, int len) throws IOException
- {
- if (sink == null)
- throw new IOException ("Not connected");
- if (closed)
- throw new IOException ("Pipe closed");
-
- sink.receive(buffer, offset, len);
- }
-
- /**
- * This method does nothing.
- *
- * @exception IOException If the stream is closed.
- * @specnote You'd think that this method would block until the sink
- * had read all available data. Thats not the case - this method
- * appears to be a no-op?
- */
- public void flush() throws IOException
- {
- if (closed)
- throw new IOException ("Pipe closed");
- }
-
- /**
- * This method closes this stream so that no more data can be written
- * to it. Any further attempts to write to this stream may throw an
- * exception
- *
- * @exception IOException If an error occurs
- */
- public void close() throws IOException
- {
- // A close call on an unconnected PipedWriter has no effect.
- if (sink != null)
- {
- closed = true;
- // Notify any waiting readers that the stream is now closed.
- synchronized (sink)
- {
- sink.notifyAll();
- }
- }
- }
-}
diff --git a/libjava/java/io/PrintWriter.java b/libjava/java/io/PrintWriter.java
deleted file mode 100644
index 5fd0b162f31..00000000000
--- a/libjava/java/io/PrintWriter.java
+++ /dev/null
@@ -1,571 +0,0 @@
-/* PrintWriter.java -- prints primitive values and objects to a stream as text
- Copyright (C) 1998, 1999, 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct.
- * However, should use native methods for conversion.
- */
-
-/**
- * This class prints Java primitive values and objects to a stream as
- * text. None of the methods in this class throw an exception. However,
- * errors can be detected by calling the <code>checkError()</code> method.
- * Additionally, this stream can be designated as "autoflush" when
- * created so that any writes are automatically flushed to the underlying
- * output sink whenever one of the <code>println</code> methods is
- * called. (Note that this differs from the <code>PrintStream</code>
- * class which also auto-flushes when it encounters a newline character
- * in the chars written).
- *
- * @author Per Bothner (bothner@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @date April 17, 1998.
- */
-public class PrintWriter extends Writer
-{
- /**
- * <code>true</code> if auto-flush is enabled, <code>false</code> otherwise
- */
- private boolean autoflush;
-
- /**
- * This boolean indicates whether or not an error has ever occurred
- * on this stream.
- */
- private boolean error;
-
- /**
- * This is the underlying <code>Writer</code> we are sending output
- * to
- */
- protected Writer out;
-
- /**
- * This method intializes a new <code>PrintWriter</code> object to write
- * to the specified output sink. The form of the constructor does not
- * enable auto-flush functionality.
- *
- * @param wr The <code>Writer</code> to write to.
- */
- public PrintWriter(Writer wr)
- {
- super(wr.lock);
- this.out = wr;
- }
-
- /**
- * This method intializes a new <code>PrintWriter</code> object to write
- * to the specified output sink. This constructor also allows "auto-flush"
- * functionality to be specified where the stream will be flushed after
- * every line is terminated or newline character is written.
- *
- * @param wr The <code>Writer</code> to write to.
- * @param autoflush <code>true</code> to flush the stream after every
- * line, <code>false</code> otherwise
- */
- public PrintWriter(Writer wr, boolean autoflush)
- {
- super(wr.lock);
- this.out = wr;
- this.autoflush = autoflush;
- }
-
- /**
- * This method initializes a new <code>PrintWriter</code> object to write
- * to the specified <code>OutputStream</code>. Characters will be converted
- * to chars using the system default encoding. Auto-flush functionality
- * will not be enabled.
- *
- * @param out The <code>OutputStream</code> to write to
- */
- public PrintWriter(OutputStream out)
- {
- super();
- this.out = new OutputStreamWriter(out);
- this.lock = this.out;
- }
-
- /**
- * This method initializes a new <code>PrintWriter</code> object to write
- * to the specified <code>OutputStream</code>. Characters will be converted
- * to chars using the system default encoding. This form of the
- * constructor allows auto-flush functionality to be enabled if desired
- *
- * @param out The <code>OutputStream</code> to write to
- * @param autoflush <code>true</code> to flush the stream after every
- * <code>println</code> call, <code>false</code> otherwise.
- */
- public PrintWriter(OutputStream out, boolean autoflush)
- {
- this(out);
- this.autoflush = autoflush;
- }
-
- /**
- * This method can be called by subclasses to indicate that an error
- * has occurred and should be reported by <code>checkError</code>.
- */
- protected void setError()
- {
- error = true;
- }
-
- /**
- * This method checks to see if an error has occurred on this stream. Note
- * that once an error has occurred, this method will continue to report
- * <code>true</code> forever for this stream. Before checking for an
- * error condition, this method flushes the stream.
- *
- * @return <code>true</code> if an error has occurred,
- * <code>false</code> otherwise
- */
- public boolean checkError()
- {
- flush();
- return error;
- }
-
- /**
- * This method flushes any buffered chars to the underlying stream and
- * then flushes that stream as well.
- */
- public void flush()
- {
- try
- {
- out.flush();
- }
- catch (IOException ex)
- {
- error = true;
- }
- }
-
- /**
- * This method closes this stream and all underlying streams.
- */
- public void close()
- {
- try
- {
- out.close();
- }
- catch (IOException ex)
- {
- error = true;
- }
- }
-
- /**
- * This method prints a <code>String</code> to the stream. The actual
- * value printed depends on the system default encoding.
- *
- * @param str The <code>String</code> to print.
- */
- public void print(String str)
- {
- write(str == null ? "null" : str);
- }
-
- /**
- * This method prints a char to the stream. The actual value printed is
- * determined by the character encoding in use.
- *
- * @param ch The <code>char</code> value to be printed
- */
- public void print(char ch)
- {
- write((int) ch);
- }
-
- /**
- * This method prints an array of characters to the stream. The actual
- * value printed depends on the system default encoding.
- *
- * @param charArray The array of characters to print.
- */
- public void print(char[] charArray)
- {
- write(charArray, 0, charArray.length);
- }
-
- /**
- * This methods prints a boolean value to the stream. <code>true</code>
- * values are printed as "true" and <code>false</code> values are printed
- * as "false".
- *
- * @param bool The <code>boolean</code> value to print
- */
- public void print(boolean bool)
- {
- // We purposely call write() and not print() here. This preserves
- // compatibility with JDK 1.2.
- write (bool ? "true" : "false");
- }
-
- /**
- * This method prints an integer to the stream. The value printed is
- * determined using the <code>String.valueOf()</code> method.
- *
- * @param inum The <code>int</code> value to be printed
- */
- public void print(int inum)
- {
- // We purposely call write() and not print() here. This preserves
- // compatibility with JDK 1.2.
- write(Integer.toString(inum));
- }
-
- /**
- * This method prints a long to the stream. The value printed is
- * determined using the <code>String.valueOf()</code> method.
- *
- * @param lnum The <code>long</code> value to be printed
- */
- public void print(long lnum)
- {
- // We purposely call write() and not print() here. This preserves
- // compatibility with JDK 1.2.
- write(Long.toString(lnum));
- }
-
- /**
- * This method prints a float to the stream. The value printed is
- * determined using the <code>String.valueOf()</code> method.
- *
- * @param fnum The <code>float</code> value to be printed
- */
- public void print(float fnum)
- {
- // We purposely call write() and not print() here. This preserves
- // compatibility with JDK 1.2.
- write(Float.toString(fnum));
- }
-
- /**
- * This method prints a double to the stream. The value printed is
- * determined using the <code>String.valueOf()</code> method.
- *
- * @param dnum The <code>double</code> value to be printed
- */
- public void print(double dnum)
- {
- // We purposely call write() and not print() here. This preserves
- // compatibility with JDK 1.2.
- write(Double.toString(dnum));
- }
-
- /**
- * This method prints an <code>Object</code> to the stream. The actual
- * value printed is determined by calling the <code>String.valueOf()</code>
- * method.
- *
- * @param obj The <code>Object</code> to print.
- */
- public void print(Object obj)
- {
- // We purposely call write() and not print() here. This preserves
- // compatibility with JDK 1.2.
- write(obj == null ? "null" : obj.toString());
- }
-
- /**
- * This is the system dependent line separator
- */
- private static final char[] line_separator
- = System.getProperty("line.separator").toCharArray();
-
- /**
- * This method prints a line separator sequence to the stream. The value
- * printed is determined by the system property <xmp>line.separator</xmp>
- * and is not necessarily the Unix '\n' newline character.
- */
- public void println()
- {
- synchronized (lock)
- {
- try
- {
- write(line_separator, 0, line_separator.length);
- if (autoflush)
- out.flush();
- }
- catch (IOException ex)
- {
- error = true;
- }
- }
- }
-
- /**
- * This methods prints a boolean value to the stream. <code>true</code>
- * values are printed as "true" and <code>false</code> values are printed
- * as "false".
- *
- * This method prints a line termination sequence after printing the value.
- *
- * @param bool The <code>boolean</code> value to print
- */
- public void println(boolean bool)
- {
- synchronized (lock)
- {
- print(bool);
- println();
- }
- }
-
- /**
- * This method prints an integer to the stream. The value printed is
- * determined using the <code>String.valueOf()</code> method.
- *
- * This method prints a line termination sequence after printing the value.
- *
- * @param inum The <code>int</code> value to be printed
- */
- public void println(int inum)
- {
- synchronized (lock)
- {
- print(inum);
- println();
- }
- }
-
- /**
- * This method prints a long to the stream. The value printed is
- * determined using the <code>String.valueOf()</code> method.
- *
- * This method prints a line termination sequence after printing the value.
- *
- * @param lnum The <code>long</code> value to be printed
- */
- public void println(long lnum)
- {
- synchronized (lock)
- {
- print(lnum);
- println();
- }
- }
-
- /**
- * This method prints a float to the stream. The value printed is
- * determined using the <code>String.valueOf()</code> method.
- *
- * This method prints a line termination sequence after printing the value.
- *
- * @param fnum The <code>float</code> value to be printed
- */
- public void println(float fnum)
- {
- synchronized (lock)
- {
- print(fnum);
- println();
- }
- }
-
- /**
- * This method prints a double to the stream. The value printed is
- * determined using the <code>String.valueOf()</code> method.
- *
- * This method prints a line termination sequence after printing the value.
- *
- * @param dnum The <code>double</code> value to be printed
- */
- public void println(double dnum)
- {
- synchronized (lock)
- {
- print(dnum);
- println();
- }
- }
-
- /**
- * This method prints an <code>Object</code> to the stream. The actual
- * value printed is determined by calling the <code>String.valueOf()</code>
- * method.
- *
- * This method prints a line termination sequence after printing the value.
- *
- * @param obj The <code>Object</code> to print.
- */
- public void println(Object obj)
- {
- synchronized (lock)
- {
- print(obj);
- println();
- }
- }
-
- /**
- * This method prints a <code>String</code> to the stream. The actual
- * value printed depends on the system default encoding.
- *
- * This method prints a line termination sequence after printing the value.
- *
- * @param str The <code>String</code> to print.
- */
- public void println(String str)
- {
- synchronized (lock)
- {
- print(str);
- println();
- }
- }
-
- /**
- * This method prints a char to the stream. The actual value printed is
- * determined by the character encoding in use.
- *
- * This method prints a line termination sequence after printing the value.
- *
- * @param ch The <code>char</code> value to be printed
- */
- public void println(char ch)
- {
- synchronized (lock)
- {
- print(ch);
- println();
- }
- }
-
- /**
- * This method prints an array of characters to the stream. The actual
- * value printed depends on the system default encoding.
- *
- * This method prints a line termination sequence after printing the value.
- *
- * @param charArray The array of characters to print.
- */
- public void println(char[] charArray)
- {
- synchronized (lock)
- {
- print(charArray);
- println();
- }
- }
-
- /**
- * This method writes a single char to the stream.
- *
- * @param ch The char to be written, passed as a int
- */
- public void write(int ch)
- {
- try
- {
- out.write(ch);
- }
- catch (IOException ex)
- {
- error = true;
- }
- }
-
- /**
- * This method writes <code>count</code> chars from the specified array
- * starting at index <code>offset</code> into the array.
- *
- * @param charArray The array of chars to write
- * @param offset The index into the array to start writing from
- * @param count The number of chars to write
- */
- public void write(char[] charArray, int offset, int count)
- {
- try
- {
- out.write(charArray, offset, count);
- }
- catch (IOException ex)
- {
- error = true;
- }
- }
-
- /**
- * This method writes <code>count</code> chars from the specified
- * <code>String</code> to the output starting at character position
- * <code>offset</code> into the <code>String</code>
- *
- * @param str The <code>String</code> to write chars from
- * @param offset The offset into the <code>String</code> to start writing from
- * @param count The number of chars to write.
- */
- public void write(String str, int offset, int count)
- {
- try
- {
- out.write(str, offset, count);
- }
- catch (IOException ex)
- {
- error = true;
- }
- }
-
- /**
- * This method write all the chars in the specified array to the output.
- *
- * @param charArray The array of characters to write
- */
- public void write(char[] charArray)
- {
- write(charArray, 0, charArray.length);
- }
-
- /**
- * This method writes the contents of the specified <code>String</code>
- * to the underlying stream.
- *
- * @param str The <code>String</code> to write
- */
- public void write(String str)
- {
- write(str, 0, str.length());
- }
-}
-
diff --git a/libjava/java/io/PushbackInputStream.java b/libjava/java/io/PushbackInputStream.java
deleted file mode 100644
index 71cf244274e..00000000000
--- a/libjava/java/io/PushbackInputStream.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/* PushbackInputStream.java -- An input stream that can unread bytes
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This subclass of <code>FilterInputStream</code> provides the ability to
- * unread data from a stream. It maintains an internal buffer of unread
- * data that is supplied to the next read operation. This is conceptually
- * similar to mark/reset functionality, except that in this case the
- * position to reset the stream to does not need to be known in advance.
- * <p>
- * The default pushback buffer size one byte, but this can be overridden
- * by the creator of the stream.
- * <p>
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public class PushbackInputStream extends FilterInputStream
-{
- /**
- * This is the default buffer size
- */
- private static final int DEFAULT_BUFFER_SIZE = 1;
-
- /**
- * This is the buffer that is used to store the pushed back data
- */
- protected byte[] buf;
-
- /**
- * This is the position in the buffer from which the next byte will be
- * read. Bytes are stored in reverse order in the buffer, starting from
- * <code>buf[buf.length - 1]</code> to <code>buf[0]</code>. Thus when
- * <code>pos</code> is 0 the buffer is full and <code>buf.length</code> when
- * it is empty
- */
- protected int pos;
-
- /**
- * This method initializes a <code>PushbackInputStream</code> to
- * read from the specified subordinate <code>InputStream</code>
- * with a default pushback buffer size of 1.
- *
- * @param in The subordinate stream to read from
- */
- public PushbackInputStream(InputStream in)
- {
- this(in, DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * This method initializes a <code>PushbackInputStream</code> to
- * read from the specified subordinate <code>InputStream</code> with
- * the specified buffer size
- *
- * @param in The subordinate <code>InputStream</code> to read from
- * @param size The pushback buffer size to use
- */
- public PushbackInputStream(InputStream in, int size)
- {
- super(in);
- if (size < 0)
- throw new IllegalArgumentException();
- buf = new byte[size];
- pos = buf.length;
- }
-
- /**
- * This method returns the number of bytes that can be read from this
- * stream before a read can block. A return of 0 indicates that blocking
- * might (or might not) occur on the very next read attempt.
- * <p>
- * This method will return the number of bytes available from the
- * pushback buffer plus the number of bytes available from the
- * underlying stream.
- *
- * @return The number of bytes that can be read before blocking could occur
- *
- * @exception IOException If an error occurs
- */
- public int available() throws IOException
- {
- return (buf.length - pos) + super.available();
- }
-
- /**
- * This method closes the stream and releases any associated resources.
- *
- * @exception IOException If an error occurs.
- */
- public synchronized void close() throws IOException
- {
- buf = null;
- super.close();
- }
-
- /**
- * This method returns <code>false</code> to indicate that it does
- * not support mark/reset functionality.
- *
- * @return This method returns <code>false</code> to indicate that
- * this class does not support mark/reset functionality
- */
- public boolean markSupported()
- {
- return false;
- }
-
- /**
- * This method always throws an IOException in this class because
- * mark/reset functionality is not supported.
- *
- * @exception IOException Always thrown for this class
- */
- public void reset() throws IOException
- {
- throw new IOException("Mark not supported in this class");
- }
-
- /**
- * This method reads an unsigned byte from the input stream and returns it
- * as an int in the range of 0-255. This method also will return -1 if
- * the end of the stream has been reached. The byte returned will be read
- * from the pushback buffer, unless the buffer is empty, in which case
- * the byte will be read from the underlying stream.
- * <p>
- * This method will block until the byte can be read.
- *
- * @return The byte read or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
- public synchronized int read() throws IOException
- {
- if (pos < buf.length)
- return ((int) buf[pos++]) & 0xFF;
-
- return super.read();
- }
-
- /**
- * This method read bytes from a stream and stores them into a
- * caller supplied buffer. It starts storing the data at index
- * <code>offset</code> into the buffer and attempts to read
- * <code>len</code> bytes. This method can return before reading the
- * number of bytes requested. The actual number of bytes read is
- * returned as an int. A -1 is returned to indicate the end of the
- * stream.
- * <p>
- * This method will block until some data can be read.
- * <p>
- * This method first reads bytes from the pushback buffer in order to
- * satisfy the read request. If the pushback buffer cannot provide all
- * of the bytes requested, the remaining bytes are read from the
- * underlying stream.
- *
- * @param b The array into which the bytes read should be stored
- * @param off The offset into the array to start storing bytes
- * @param len The requested number of bytes to read
- *
- * @return The actual number of bytes read, or -1 if end of stream.
- *
- * @exception IOException If an error occurs.
- */
- public synchronized int read(byte[] b, int off, int len) throws IOException
- {
- int numBytes = Math.min(buf.length - pos, len);
-
- if (numBytes > 0)
- {
- System.arraycopy (buf, pos, b, off, numBytes);
- pos += numBytes;
- len -= numBytes;
- off += numBytes;
- }
-
- if (len > 0)
- {
- len = super.read(b, off, len);
- if (len == -1) //EOF
- return numBytes > 0 ? numBytes : -1;
- numBytes += len;
- }
- return numBytes;
- }
-
- /**
- * This method pushes a single byte of data into the pushback buffer.
- * The byte pushed back is the one that will be returned as the first byte
- * of the next read.
- * <p>
- * If the pushback buffer is full, this method throws an exception.
- * <p>
- * The argument to this method is an <code>int</code>. Only the low
- * eight bits of this value are pushed back.
- *
- * @param b The byte to be pushed back, passed as an int
- *
- * @exception IOException If the pushback buffer is full.
- */
- public synchronized void unread(int b) throws IOException
- {
- if (pos <= 0)
- throw new IOException("Insufficient space in pushback buffer");
-
- buf[--pos] = (byte) b;
- }
-
- /**
- * This method pushes all of the bytes in the passed byte array into
- * the pushback bfer. These bytes are pushed in reverse order so that
- * the next byte read from the stream after this operation will be
- * <code>b[0]</code> followed by <code>b[1]</code>, etc.
- * <p>
- * If the pushback buffer cannot hold all of the requested bytes, an
- * exception is thrown.
- *
- * @param b The byte array to be pushed back
- *
- * @exception IOException If the pushback buffer is full
- */
- public synchronized void unread(byte[] b) throws IOException
- {
- unread(b, 0, b.length);
- }
-
- /**
- * This method pushed back bytes from the passed in array into the
- * pushback buffer. The bytes from <code>b[offset]</code> to
- * <code>b[offset + len]</code> are pushed in reverse order so that
- * the next byte read from the stream after this operation will be
- * <code>b[offset]</code> followed by <code>b[offset + 1]</code>,
- * etc.
- * <p>
- * If the pushback buffer cannot hold all of the requested bytes, an
- * exception is thrown.
- *
- * @param b The byte array to be pushed back
- * @param off The index into the array where the bytes to be push start
- * @param len The number of bytes to be pushed.
- *
- * @exception IOException If the pushback buffer is full
- */
- public synchronized void unread(byte[] b, int off, int len)
- throws IOException
- {
- if (pos < len)
- throw new IOException("Insufficient space in pushback buffer");
-
- // Note the order that these bytes are being added is the opposite
- // of what would be done if they were added to the buffer one at a time.
- // See the Java Class Libraries book p. 1390.
- System.arraycopy(b, off, buf, pos - len, len);
-
- // Don't put this into the arraycopy above, an exception might be thrown
- // and in that case we don't want to modify pos.
- pos -= len;
- }
-
- /**
- * This method skips the specified number of bytes in the stream. It
- * returns the actual number of bytes skipped, which may be less than the
- * requested amount.
- * <p>
- * This method first discards bytes from the buffer, then calls the
- * <code>skip</code> method on the underlying <code>InputStream</code> to
- * skip additional bytes if necessary.
- *
- * @param n The requested number of bytes to skip
- *
- * @return The actual number of bytes skipped.
- *
- * @exception IOException If an error occurs
- *
- * @since 1.2
- */
- public synchronized long skip(long n) throws IOException
- {
- final long origN = n;
-
- if (n > 0L)
- {
- int numread = (int) Math.min((long) (buf.length - pos), n);
- pos += numread;
- n -= numread;
- if (n > 0)
- n -= super.skip(n);
- }
-
- return origN - n;
- }
-}
diff --git a/libjava/java/io/PushbackReader.java b/libjava/java/io/PushbackReader.java
deleted file mode 100644
index 04bccc70fc5..00000000000
--- a/libjava/java/io/PushbackReader.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/* PushbackReader.java -- An character stream that can unread chars
- Copyright (C) 1998, 2000, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This subclass of <code>FilterReader</code> provides the ability to
- * unread data from a stream. It maintains an internal buffer of unread
- * data that is supplied to the next read operation. This is conceptually
- * similar to mark/reset functionality, except that in this case the
- * position to reset the stream to does not need to be known in advance.
- * <p>
- * The default pushback buffer size one char, but this can be overridden
- * by the creator of the stream.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public class PushbackReader extends FilterReader
-{
- /**
- * This is the default buffer size
- */
- private static final int DEFAULT_BUFFER_SIZE = 1;
-
- /**
- * This is the buffer that is used to store the pushed back data
- */
- private char[] buf;
-
- /**
- * This is the position in the buffer from which the next char will be
- * read. Bytes are stored in reverse order in the buffer, starting from
- * <code>buf[buf.length - 1]</code> to <code>buf[0]</code>. Thus when
- * <code>pos</code> is 0 the buffer is full and <code>buf.length</code> when
- * it is empty
- */
- private int pos;
-
- /**
- * This method initializes a <code>PushbackReader</code> to read from the
- * specified subordinate <code>Reader</code> with a default pushback buffer
- * size of 1.
- *
- * @param in The subordinate stream to read from
- */
- public PushbackReader(Reader in)
- {
- this(in, DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * This method initializes a <code>PushbackReader</code> to read from the
- * specified subordinate <code>Reader</code> with the specified buffer
- * size
- *
- * @param in The subordinate <code>Reader</code> to read from
- * @param bufsize The pushback buffer size to use
- */
- public PushbackReader(Reader in, int bufsize)
- {
- super(in);
-
- if (bufsize < 0)
- throw new IllegalArgumentException("buffer size must be positive");
-
- buf = new char[bufsize];
- pos = bufsize;
- }
-
- /**
- * This method closes the stream and frees any associated resources.
- *
- * @exception IOException If an error occurs.
- */
- public void close() throws IOException
- {
- synchronized (lock)
- {
- buf = null;
- super.close();
- }
- }
-
- /**
- * This method throws an exception when called since this class does
- * not support mark/reset.
- *
- * @param read_limit Not used.
- *
- * @exception IOException Always thrown to indicate mark/reset not supported.
- */
- public void mark(int read_limit) throws IOException
- {
- throw new IOException("mark not supported in this class");
- }
-
- /**
- * This method returns <code>false</code> to indicate that it does not support
- * mark/reset functionality.
- *
- * @return This method returns <code>false</code> to indicate that this
- * class does not support mark/reset functionality
- *
- */
- public boolean markSupported()
- {
- return(false);
- }
-
- /**
- * This method always throws an IOException in this class because
- * mark/reset functionality is not supported.
- *
- * @exception IOException Always thrown for this class
- */
- public void reset() throws IOException
- {
- throw new IOException("reset not supported in this class");
- }
-
- /**
- * This method determines whether or not this stream is ready to be read.
- * If it returns <code>false</code> to indicate that the stream is not
- * ready, any attempt to read from the stream could (but is not
- * guaranteed to) block.
- * <p>
- * This stream is ready to read if there are either chars waiting to be
- * read in the pushback buffer or if the underlying stream is ready to
- * be read.
- *
- * @return <code>true</code> if this stream is ready to be read,
- * <code>false</code> otherwise
- *
- * @exception IOException If an error occurs
- */
- public boolean ready() throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException ("stream closed");
-
- if (((buf.length - pos) > 0) || super.ready())
- return(true);
- else
- return(false);
- }
- }
-
- // Don't delete this method just because the spec says it shouldn't be there!
- // See the CVS log for details.
- /**
- * This method skips the specified number of chars in the stream. It
- * returns the actual number of chars skipped, which may be less than the
- * requested amount.
- * <p>
- * This method first discards chars from the buffer, then calls the
- * <code>skip</code> method on the underlying <code>Reader</code> to
- * skip additional chars if necessary.
- *
- * @param num_chars The requested number of chars to skip
- *
- * @return The actual number of chars skipped.
- *
- * @exception IOException If an error occurs
- */
- public long skip(long num_chars) throws IOException
- {
- synchronized (lock)
- {
- if (num_chars <= 0)
- return(0);
-
- if ((buf.length - pos) >= num_chars)
- {
- pos += num_chars;
- return(num_chars);
- }
-
- int chars_discarded = buf.length - pos;
- pos = buf.length;
-
- long chars_skipped = in.skip(num_chars - chars_discarded);
-
- return(chars_discarded + chars_skipped);
- }
- }
-
- /**
- * This method reads an unsigned char from the input stream and returns it
- * as an int in the range of 0-65535. This method also will return -1 if
- * the end of the stream has been reached. The char returned will be read
- * from the pushback buffer, unless the buffer is empty, in which case
- * the char will be read from the underlying stream.
- * <p>
- * This method will block until the char can be read.
- *
- * @return The char read or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
- public int read() throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("stream closed");
-
- if (pos == buf.length)
- return(super.read());
-
- ++pos;
- return((buf[pos - 1] & 0xFFFF));
- }
- }
-
- /**
- * This method read chars from a stream and stores them into a caller
- * supplied buffer. It starts storing the data at index <code>offset</code>
- * into
- * the buffer and attempts to read <code>len</code> chars. This method can
- * return before reading the number of chars requested. The actual number
- * of chars read is returned as an int. A -1 is returned to indicate the
- * end of the stream.
- * <p>
- * This method will block until some data can be read.
- * <p>
- * This method first reads chars from the pushback buffer in order to
- * satisfy the read request. If the pushback buffer cannot provide all
- * of the chars requested, the remaining chars are read from the
- * underlying stream.
- *
- * @param buffer The array into which the chars read should be stored
- * @param offset The offset into the array to start storing chars
- * @param length The requested number of chars to read
- *
- * @return The actual number of chars read, or -1 if end of stream.
- *
- * @exception IOException If an error occurs.
- */
- public synchronized int read(char[] buffer, int offset, int length)
- throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("stream closed");
-
- if (offset < 0 || length < 0 || offset + length > buffer.length)
- throw new ArrayIndexOutOfBoundsException();
-
- int numBytes = Math.min(buf.length - pos, length);
- if (numBytes > 0)
- {
- System.arraycopy (buf, pos, buffer, offset, numBytes);
- pos += numBytes;
- return numBytes;
- }
-
- return super.read(buffer, offset, length);
- }
- }
-
- /**
- * This method pushes a single char of data into the pushback buffer.
- * The char pushed back is the one that will be returned as the first char
- * of the next read.
- * <p>
- * If the pushback buffer is full, this method throws an exception.
- * <p>
- * The argument to this method is an <code>int</code>. Only the low eight
- * bits of this value are pushed back.
- *
- * @param b The char to be pushed back, passed as an int
- *
- * @exception IOException If the pushback buffer is full.
- */
- public void unread(int b) throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("stream closed");
- if (pos == 0)
- throw new IOException("Pushback buffer is full");
-
- --pos;
- buf[pos] = (char)(b & 0xFFFF);
- }
- }
-
- /**
- * This method pushes all of the chars in the passed char array into
- * the pushback buffer. These chars are pushed in reverse order so that
- * the next char read from the stream after this operation will be
- * <code>buf[0]</code> followed by <code>buf[1]</code>, etc.
- * <p>
- * If the pushback buffer cannot hold all of the requested chars, an
- * exception is thrown.
- *
- * @param buf The char array to be pushed back
- *
- * @exception IOException If the pushback buffer is full
- */
- public synchronized void unread(char[] buf) throws IOException
- {
- unread(buf, 0, buf.length);
- }
-
- /**
- * This method pushed back chars from the passed in array into the pushback
- * buffer. The chars from <code>buf[offset]</code> to
- * <code>buf[offset + len]</code>
- * are pushed in reverse order so that the next char read from the stream
- * after this operation will be <code>buf[offset]</code> followed by
- * <code>buf[offset + 1]</code>, etc.
- * <p>
- * If the pushback buffer cannot hold all of the requested chars, an
- * exception is thrown.
- *
- * @param buffer The char array to be pushed back
- * @param offset The index into the array where the chars to be push start
- * @param length The number of chars to be pushed.
- *
- * @exception IOException If the pushback buffer is full
- */
- public synchronized void unread(char[] buffer, int offset, int length)
- throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("stream closed");
- if (pos < length)
- throw new IOException("Pushback buffer is full");
-
- // Note the order that these chars are being added is the opposite
- // of what would be done if they were added to the buffer one at a time.
- // See the Java Class Libraries book p. 1397.
- System.arraycopy(buffer, offset, buf, pos - length, length);
-
- // Don't put this into the arraycopy above, an exception might be thrown
- // and in that case we don't want to modify pos.
- pos -= length;
- }
- }
-}
-
diff --git a/libjava/java/io/Reader.java b/libjava/java/io/Reader.java
deleted file mode 100644
index 7970d9a2434..00000000000
--- a/libjava/java/io/Reader.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/* Reader.java -- base class of classes that read input as a stream of chars
- Copyright (C) 1998, 1999, 2000, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct.
- */
-
-/**
- * This abstract class forms the base of the hierarchy of classes that read
- * input as a stream of characters. It provides a common set of methods for
- * reading characters from streams. Subclasses implement and extend these
- * methods to read characters from a particular input source such as a file
- * or network connection.
- *
- * @author Per Bothner (bothner@cygnus.com)
- * @date April 21, 1998.
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public abstract class Reader
-{
- /**
- * This is the <code>Object</code> used for synchronizing critical code
- * sections. Subclasses should use this variable instead of a
- * synchronized method or an explicit synchronization on <code>this</code>
- */
- protected Object lock;
-
- /**
- * Unitializes a <code>Reader</code> that will use the object
- * itself for synchronization of critical code sections.
- */
- protected Reader()
- {
- this.lock = this;
- }
-
- /**
- * Initializes a <code>Reader</code> that will use the specified
- * <code>Object</code> for synchronization of critical code sections.
- *
- * @param lock The <code>Object</code> to use for synchronization
- */
- protected Reader(Object lock)
- {
- this.lock = lock;
- }
-
- /**
- * Read chars from a stream and stores them into a caller
- * supplied buffer. It starts storing the data at index <code>offset</code>
- * into the buffer and attempts to read <code>len</code> chars. This method
- * can return before reading the number of chars requested. The actual
- * number of chars read is returned as an int. A -1 is returned to indicate
- * the end of the stream.
- * <p>
- * This method will block until some data can be read.
- * <p>
- * This method operates by calling the single char <code>read()</code> method
- * in a loop until the desired number of chars are read. The read loop
- * stops short if the end of the stream is encountered or if an IOException
- * is encountered on any read operation except the first. If the first
- * attempt to read a chars fails, the IOException is allowed to propagate
- * upward. And subsequent IOException is caught and treated identically
- * to an end of stream condition. Subclasses can (and should if possible)
- * override this method to provide a more efficient implementation.
- *
- * @param buf The array into which the chars read should be stored
- * @param offset The offset into the array to start storing chars
- * @param count The requested number of chars to read
- *
- * @return The actual number of chars read, or -1 if end of stream.
- *
- * @exception IOException If an error occurs.
- */
- public abstract int read(char buf[], int offset, int count)
- throws IOException;
-
- /**
- * Reads chars from a stream and stores them into a caller
- * supplied buffer. This method attempts to completely fill the buffer,
- * but can return before doing so. The actual number of chars read is
- * returned as an int. A -1 is returned to indicate the end of the stream.
- * <p>
- * This method will block until some data can be read.
- * <p>
- * This method operates by calling an overloaded read method like so:
- * <code>read(buf, 0, buf.length)</code>
- *
- * @param buf The buffer into which the chars read will be stored.
- *
- * @return The number of chars read or -1 if end of stream.
- *
- * @exception IOException If an error occurs.
- */
- public int read(char buf[]) throws IOException
- {
- return read(buf, 0, buf.length);
- }
-
- /**
- * Reads an char from the input stream and returns it
- * as an int in the range of 0-65535. This method also will return -1 if
- * the end of the stream has been reached.
- * <p>
- * This method will block until the char can be read.
- *
- * @return The char read or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
- public int read() throws IOException
- {
- char[] buf = new char[1];
- int count = read(buf, 0, 1);
- return count > 0 ? buf[0] : -1;
- }
-
- /**
- * Closes the stream. Any futher attempts to read from the
- * stream may generate an <code>IOException</code>.
- *
- * @exception IOException If an error occurs
- */
- public abstract void close() throws IOException;
-
- /**
- * Returns a boolean that indicates whether the mark/reset
- * methods are supported in this class. Those methods can be used to
- * remember a specific point in the stream and reset the stream to that
- * point.
- * <p>
- * This method always returns <code>false</code> in this class, but
- * subclasses can override this method to return <code>true</code> if they
- * support mark/reset functionality.
- *
- * @return <code>true</code> if mark/reset functionality is supported,
- * <code>false</code> otherwise
- *
- */
- public boolean markSupported()
- {
- return false;
- }
-
- /**
- * Marks a position in the input to which the stream can be
- * "reset" by calling the <code>reset()</code> method. The parameter
- * <code>readlimit</code> is the number of chars that can be read from the
- * stream after setting the mark before the mark becomes invalid. For
- * example, if <code>mark()</code> is called with a read limit of 10, then
- * when 11 chars of data are read from the stream before the
- * <code>reset()</code> method is called, then the mark is invalid and the
- * stream object instance is not required to remember the mark.
- *
- * @param readLimit The number of chars that can be read before the mark
- * becomes invalid
- *
- * @exception IOException If an error occurs such as mark not being
- * supported for this class
- */
- public void mark(int readLimit) throws IOException
- {
- throw new IOException("mark not supported");
- }
-
- /**
- * Resets a stream to the point where the <code>mark()</code>
- * method was called. Any chars that were read after the mark point was
- * set will be re-read during subsequent reads.
- * <p>
- * This method always throws an IOException in this class, but subclasses
- * can override this method if they provide mark/reset functionality.
- *
- * @exception IOException Always thrown for this class
- */
- public void reset() throws IOException
- {
- throw new IOException("reset not supported");
- }
-
- /**
- * Determines whether or not this stream is ready to be
- * read. If it returns <code>false</code> the stream may block if a
- * read is attempted, but it is not guaranteed to do so.
- * <p>
- * This method always returns <code>false</code> in this class
- *
- * @return <code>true</code> if the stream is ready to be read,
- * <code>false</code> otherwise.
- *
- * @exception IOException If an error occurs
- */
- public boolean ready() throws IOException
- {
- return false;
- }
-
- /**
- * Skips the specified number of chars in the stream. It
- * returns the actual number of chars skipped, which may be less than the
- * requested amount.
- * <p>
- * This method reads and discards chars into a 256 char array until the
- * specified number of chars were skipped or until either the end of stream
- * is reached or a read attempt returns a short count. Subclasses can
- * override this method to provide a more efficient implementation where
- * one exists.
- *
- * @param count The requested number of chars to skip
- *
- * @return The actual number of chars skipped.
- *
- * @exception IOException If an error occurs
- */
- public long skip(long count) throws IOException
- {
- if (count <= 0)
- return 0;
- int bsize = count > 1024 ? 1024 : (int) count;
- char[] buffer = new char[bsize];
- long todo = count;
- synchronized (lock)
- {
- while (todo > 0)
- {
- int skipped = read(buffer, 0, bsize > todo ? (int) todo : bsize);
- if (skipped <= 0)
- break;
- todo -= skipped;
- }
- }
- return count - todo;
- }
-}
diff --git a/libjava/java/io/SequenceInputStream.java b/libjava/java/io/SequenceInputStream.java
deleted file mode 100644
index 7fefe243263..00000000000
--- a/libjava/java/io/SequenceInputStream.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/* SequenceInputStream.java -- Reads multiple input streams in sequence
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-import java.util.Enumeration;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct.
- */
-
-/**
- * This class merges a sequence of multiple <code>InputStream</code>'s in
- * order to form a single logical stream that can be read by applications
- * that expect only one stream.
- * <p>
- * The streams passed to the constructor method are read in order until
- * they return -1 to indicate they are at end of stream. When a stream
- * reports end of stream, it is closed, then the next stream is read.
- * When the last stream is closed, the next attempt to read from this
- * stream will return a -1 to indicate it is at end of stream.
- * <p>
- * If this stream is closed prior to all subordinate streams being read
- * to completion, all subordinate streams are closed.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public class SequenceInputStream extends InputStream
-{
- /** The handle for the current input stream. */
- private InputStream in;
-
- /** Secondary input stream; not used if constructed w/ enumeration. */
- private InputStream in2;
-
- /** The enumeration handle; not used if constructed w/ 2 explicit input streams. */
- private Enumeration e;
-
- /**
- * This method creates a new <code>SequenceInputStream</code> that obtains
- * its list of subordinate <code>InputStream</code>s from the specified
- * <code>Enumeration</code>
- *
- * @param e An <code>Enumeration</code> that will return a list of
- * <code>InputStream</code>s to read in sequence
- */
- public SequenceInputStream(Enumeration e)
- {
- this.e = e;
- in = (InputStream) e.nextElement();
- in2 = null;
- }
-
- /**
- * This method creates a new <code>SequenceInputStream</code> that will read
- * the two specified subordinate <code>InputStream</code>s in sequence.
- *
- * @param s1 The first <code>InputStream</code> to read
- * @param s2 The second <code>InputStream</code> to read
- */
- public SequenceInputStream(InputStream s1, InputStream s2)
- {
- in = s1;
- in2 = s2;
- }
-
- /**
- * This method returns the number of bytes than can be read from the
- * currently being read subordinate stream before that stream could
- * block. Note that it is possible more bytes than this can actually
- * be read without the stream blocking. If a 0 is returned, then the
- * stream could block on the very next read.
- *
- * @return The number of bytes that can be read before blocking could occur
- *
- * @exception IOException If an error occurs
- */
- public int available() throws IOException
- {
- if (in == null)
- return 0;
-
- return in.available();
- }
-
- /**
- * Closes this stream. This will cause any remaining unclosed subordinate
- * <code>InputStream</code>'s to be closed as well. Subsequent attempts to
- * read from this stream may cause an exception.
- *
- * @exception IOException If an error occurs
- */
- public void close() throws IOException
- {
- while (in != null)
- {
- in.close();
- in = getNextStream ();
- }
- }
-
- /**
- * This method reads an unsigned byte from the input stream and returns it
- * as an int in the range of 0-255. This method also will return -1 if
- * the end of the stream has been reached. This will only happen when
- * all of the subordinate streams have been read.
- * <p>
- * This method will block until the byte can be read.
- *
- * @return The byte read, or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
- public int read() throws IOException
- {
- int ch = -1;
-
- while (in != null && (ch = in.read()) < 0)
- {
- in.close();
- in = getNextStream();
- }
-
- return ch;
- }
-
- /**
- * This method reads bytes from a stream and stores them into a caller
- * supplied buffer. It starts storing the data at index <code>offset</code>
- * into the buffer and attempts to read <code>len</code> bytes. This method
- * can return before reading the number of bytes requested. The actual number
- * of bytes read is returned as an int. A -1 is returend to indicate the
- * end of the stream. This will only happen when all of the subordinate
- * streams have been read.
- * <p>
- * This method will block until at least one byte can be read.
- *
- * @param b The array into which bytes read should be stored
- * @param off The offset into the array to start storing bytes
- * @param len The requested number of bytes to read
- *
- * @return The actual number of bytes read, or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
- public int read(byte[] b, int off, int len) throws IOException
- {
- int ch = -1;
-
- // The validity of the parameters will be checked by in.read so
- // don't bother doing it here.
- while (in != null && (ch = in.read(b, off, len)) < 0)
- {
- in.close();
- in = getNextStream();
- }
-
- return ch;
- }
-
- /**
- * This private method is used to get the next <code>InputStream</code> to
- * read from. Returns null when no more streams are available.
- */
- private InputStream getNextStream()
- {
- InputStream nextIn = null;
-
- if (e != null)
- {
- if (e.hasMoreElements())
- nextIn = (InputStream) e.nextElement();
- }
- else
- if (in2 != null)
- {
- nextIn = in2;
- in2 = null;
- }
-
- return nextIn;
- }
-}
diff --git a/libjava/java/io/Serializable.java b/libjava/java/io/Serializable.java
deleted file mode 100644
index a6d99f6d522..00000000000
--- a/libjava/java/io/Serializable.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Serializable.java -- Interface to indicate a class may be serialized
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * Status: Believed complete
- */
-
-/**
- * This interface has no methods. It simply serves to indicate that
- * the implementing class may be serialized.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public interface Serializable
-{
-} // interface Serializable
diff --git a/libjava/java/io/SerializablePermission.java b/libjava/java/io/SerializablePermission.java
deleted file mode 100644
index b5c07e4ec2c..00000000000
--- a/libjava/java/io/SerializablePermission.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* SerializablePermission.java -- Basic permissions related to serialization.
- Copyright (C) 1998, 2000, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-import java.security.BasicPermission;
-
-/**
- * This class models permissions related to serialization. As a subclass
- * of <code>BasicPermission</code>, this class has permissions that have
- * a name only. There is no associated action list.
- * <p>
- * There are currently two allowable permission names for this class:
- * <ul>
- * <li><code>enableSubclassImplementation</code> - Allows a subclass to
- * override the default serialization behavior of objects.</li>
- * <li><code>enableSubstitution</code> - Allows substitution of one object
- * for another during serialization or deserialization.</li>
- * </ul>
- *
- * @see java.security.BasicPermission
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public final class SerializablePermission extends BasicPermission
-{
- static final long serialVersionUID = 8537212141160296410L;
-
- /*
- * Class Variables
- */
-
- private static final String[] legal_names = { "enableSubclassImplementation",
- "enableSubstitution" };
- /*
- * Constructors
- */
-
- /**
- * This method initializes a new instance of
- * <code>SerializablePermission</code>
- * that has the specified name.
- *
- * @param name The name of the permission.
- *
- * @exception IllegalArgumentException If the name is not valid for
- * this class.
- */
- public SerializablePermission(String name)
- {
- this(name, null);
- }
-
- /**
- * This method initializes a new instance of
- * <code>SerializablePermission</code>
- * that has the specified name and action list. Note that the action list
- * is unused in this class.
- *
- * @param name The name of the permission.
- * @param actions The action list (unused).
- *
- * @exception IllegalArgumentException If the name is not valid for
- * this class.
- */
- public SerializablePermission(String name, String actions)
- {
- super(name, actions);
-
- for (int i = 0; i < legal_names.length; i++)
- if (legal_names[i].equals(name))
- return;
-
- throw new IllegalArgumentException("Bad permission name: " + name);
- }
-
-} // class SerializablePermission
-
diff --git a/libjava/java/io/StreamCorruptedException.java b/libjava/java/io/StreamCorruptedException.java
deleted file mode 100644
index d24d12150c5..00000000000
--- a/libjava/java/io/StreamCorruptedException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* StreamCorruptedException.java -- Error in stream during serialization
- Copyright (C) 1998, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when there is an error in the data that is
- * read from a stream during de-serialization.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class StreamCorruptedException extends ObjectStreamException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 8983558202217591746L;
-
- /**
- * Create an exception without a descriptive error message.
- */
- public StreamCorruptedException()
- {
- }
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public StreamCorruptedException(String message)
- {
- super(message);
- }
-} // class StreamCorruptedException
diff --git a/libjava/java/io/StreamTokenizer.java b/libjava/java/io/StreamTokenizer.java
deleted file mode 100644
index bd7773b1990..00000000000
--- a/libjava/java/io/StreamTokenizer.java
+++ /dev/null
@@ -1,708 +0,0 @@
-/* StreamTokenizer.java -- parses streams of characters into tokens
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This class parses streams of characters into tokens. There are a
- * million-zillion flags that can be set to control the parsing, as
- * described under the various method headings.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @date October 25, 1998.
- */
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct.
- */
-
-public class StreamTokenizer
-{
- /** A constant indicating that the end of the stream has been read. */
- public static final int TT_EOF = -1;
-
- /** A constant indicating that the end of the line has been read. */
- public static final int TT_EOL = '\n';
-
- /** A constant indicating that a number token has been read. */
- public static final int TT_NUMBER = -2;
-
- /** A constant indicating that a word token has been read. */
- public static final int TT_WORD = -3;
-
- /** A constant indicating that no tokens have been read yet. */
- private static final int TT_NONE = -4;
-
- /**
- * Contains the type of the token read resulting from a call to nextToken
- * The rules are as follows:
- * <ul>
- * <li>For a token consisting of a single ordinary character, this is the
- * value of that character.</li>
- * <li>For a quoted string, this is the value of the quote character</li>
- * <li>For a word, this is TT_WORD</li>
- * <li>For a number, this is TT_NUMBER</li>
- * <li>For the end of the line, this is TT_EOL</li>
- * <li>For the end of the stream, this is TT_EOF</li>
- * </ul>
- */
- public int ttype = TT_NONE;
-
- /** The String associated with word and string tokens. */
- public String sval;
-
- /** The numeric value associated with number tokens. */
- public double nval;
-
- /* Indicates whether end-of-line is recognized as a token. */
- private boolean eolSignificant = false;
-
- /* Indicates whether word tokens are automatically made lower case. */
- private boolean lowerCase = false;
-
- /* Indicates whether C++ style comments are recognized and skipped. */
- private boolean slashSlash = false;
-
- /* Indicates whether C style comments are recognized and skipped. */
- private boolean slashStar = false;
-
- /* Attribute tables of each byte from 0x00 to 0xFF. */
- private boolean[] whitespace = new boolean[256];
- private boolean[] alphabetic = new boolean[256];
- private boolean[] numeric = new boolean[256];
- private boolean[] quote = new boolean[256];
- private boolean[] comment = new boolean[256];
-
- /* The Reader associated with this class. */
- private PushbackReader in;
-
- /* Indicates if a token has been pushed back. */
- private boolean pushedBack = false;
-
- /* Contains the current line number of the reader. */
- private int lineNumber = 1;
-
- /**
- * This method reads bytes from an <code>InputStream</code> and tokenizes
- * them. For details on how this method operates by default, see
- * <code>StreamTokenizer(Reader)</code>.
- *
- * @param is The <code>InputStream</code> to read from
- *
- * @deprecated Since JDK 1.1.
- */
- public StreamTokenizer(InputStream is)
- {
- this(new InputStreamReader(is));
- }
-
- /**
- * This method initializes a new <code>StreamTokenizer</code> to read
- * characters from a <code>Reader</code> and parse them. The char values
- * have their hight bits masked so that the value is treated a character
- * in the range of 0x0000 to 0x00FF.
- * <p>
- * This constructor sets up the parsing table to parse the stream in the
- * following manner:
- * <ul>
- * <li>The values 'A' through 'Z', 'a' through 'z' and 0xA0 through 0xFF
- * are initialized as alphabetic</li>
- * <li>The values 0x00 through 0x20 are initialized as whitespace</li>
- * <li>The values '\'' and '"' are initialized as quote characters</li>
- * <li>'/' is a comment character</li>
- * <li>Numbers will be parsed</li>
- * <li>EOL is not treated as significant</li>
- * <li>C and C++ (//) comments are not recognized</li>
- * </ul>
- *
- * @param r The <code>Reader</code> to read chars from
- */
- public StreamTokenizer(Reader r)
- {
- in = new PushbackReader(r);
-
- whitespaceChars(0x00, 0x20);
- wordChars('A', 'Z');
- wordChars('a', 'z');
- wordChars(0xA0, 0xFF);
- commentChar('/');
- quoteChar('\'');
- quoteChar('"');
- parseNumbers();
- }
-
- /**
- * This method sets the comment attribute on the specified
- * character. Other attributes for the character are cleared.
- *
- * @param ch The character to set the comment attribute for, passed as an int
- */
- public void commentChar(int ch)
- {
- if (ch >= 0 && ch <= 255)
- {
- comment[ch] = true;
- whitespace[ch] = false;
- alphabetic[ch] = false;
- numeric[ch] = false;
- quote[ch] = false;
- }
- }
-
- /**
- * This method sets a flag that indicates whether or not the end of line
- * sequence terminates and is a token. The defaults to <code>false</code>
- *
- * @param flag <code>true</code> if EOF is significant, <code>false</code>
- * otherwise
- */
- public void eolIsSignificant(boolean flag)
- {
- eolSignificant = flag;
- }
-
- /**
- * This method returns the current line number. Note that if the
- * <code>pushBack()</code> method is called, it has no effect on the
- * line number returned by this method.
- *
- * @return The current line number
- */
- public int lineno()
- {
- return lineNumber;
- }
-
- /**
- * This method sets a flag that indicates whether or not alphabetic
- * tokens that are returned should be converted to lower case.
- *
- * @param flag <code>true</code> to convert to lower case,
- * <code>false</code> otherwise
- */
- public void lowerCaseMode(boolean flag)
- {
- lowerCase = flag;
- }
-
- private boolean isWhitespace(int ch)
- {
- return (ch >= 0 && ch <= 255 && whitespace[ch]);
- }
-
- private boolean isAlphabetic(int ch)
- {
- return ((ch > 255) || (ch >= 0 && alphabetic[ch]));
- }
-
- private boolean isNumeric(int ch)
- {
- return (ch >= 0 && ch <= 255 && numeric[ch]);
- }
-
- private boolean isQuote(int ch)
- {
- return (ch >= 0 && ch <= 255 && quote[ch]);
- }
-
- private boolean isComment(int ch)
- {
- return (ch >= 0 && ch <= 255 && comment[ch]);
- }
-
- /**
- * This method reads the next token from the stream. It sets the
- * <code>ttype</code> variable to the appropriate token type and
- * returns it. It also can set <code>sval</code> or <code>nval</code>
- * as described below. The parsing strategy is as follows:
- * <ul>
- * <li>Skip any whitespace characters.</li>
- * <li>If a numeric character is encountered, attempt to parse a numeric
- * value. Leading '-' characters indicate a numeric only if followed by
- * another non-'-' numeric. The value of the numeric token is terminated
- * by either the first non-numeric encountered, or the second occurrence of
- * '-' or '.'. The token type returned is TT_NUMBER and <code>nval</code>
- * is set to the value parsed.</li>
- * <li>If an alphabetic character is parsed, all subsequent characters
- * are read until the first non-alphabetic or non-numeric character is
- * encountered. The token type returned is TT_WORD and the value parsed
- * is stored in <code>sval</code>. If lower case mode is set, the token
- * stored in <code>sval</code> is converted to lower case. The end of line
- * sequence terminates a word only if EOL signficance has been turned on.
- * The start of a comment also terminates a word. Any character with a
- * non-alphabetic and non-numeric attribute (such as white space, a quote,
- * or a commet) are treated as non-alphabetic and terminate the word.</li>
- * <li>If a comment character is parsed, then all remaining characters on
- * the current line are skipped and another token is parsed. Any EOL or
- * EOF's encountered are not discarded, but rather terminate the comment.</li>
- * <li>If a quote character is parsed, then all characters up to the
- * second occurrence of the same quote character are parsed into a
- * <code>String</code>. This <code>String</code> is stored as
- * <code>sval</code>, but is not converted to lower case, even if lower case
- * mode is enabled. The token type returned is the value of the quote
- * character encountered. Any escape sequences
- * (\b (backspace), \t (HTAB), \n (linefeed), \f (form feed), \r
- * (carriage return), \" (double quote), \' (single quote), \\
- * (backslash), \XXX (octal esacpe)) are converted to the appropriate
- * char values. Invalid esacape sequences are left in untranslated.
- * Unicode characters like ('\ u0000') are not recognized. </li>
- * <li>If the C++ comment sequence "//" is encountered, and the parser
- * is configured to handle that sequence, then the remainder of the line
- * is skipped and another token is read exactly as if a character with
- * the comment attribute was encountered.</li>
- * <li>If the C comment sequence "/*" is encountered, and the parser
- * is configured to handle that sequence, then all characters up to and
- * including the comment terminator sequence are discarded and another
- * token is parsed.</li>
- * <li>If all cases above are not met, then the character is an ordinary
- * character that is parsed as a token by itself. The char encountered
- * is returned as the token type.</li>
- * </ul>
- *
- * @return The token type
- * @exception IOException If an I/O error occurs
- */
- public int nextToken() throws IOException
- {
- if (pushedBack)
- {
- pushedBack = false;
- if (ttype != TT_NONE)
- return ttype;
- }
-
- sval = null;
- int ch;
-
- // Skip whitespace. Deal with EOL along the way.
- while (isWhitespace(ch = in.read()))
- if (ch == '\n' || ch == '\r')
- {
- lineNumber++;
-
- // Throw away \n if in combination with \r.
- if (ch == '\r' && (ch = in.read()) != '\n')
- {
- if (ch != TT_EOF)
- in.unread(ch);
- }
- if (eolSignificant)
- return (ttype = TT_EOL);
- }
-
- if (ch == '/')
- if ((ch = in.read()) == '/' && slashSlash)
- {
- while ((ch = in.read()) != '\n' && ch != '\r' && ch != TT_EOF)
- ;
- if (ch != TT_EOF)
- in.unread(ch);
- return nextToken(); // Recursive, but not too deep in normal cases
- }
- else if (ch == '*' && slashStar)
- {
- while (true)
- {
- ch = in.read();
- if (ch == '*')
- {
- if ((ch = in.read()) == '/')
- break;
- else if (ch != TT_EOF)
- in.unread(ch);
- }
- else if (ch == '\n' || ch == '\r')
- {
- lineNumber++;
- if (ch == '\r' && (ch = in.read()) != '\n')
- {
- if (ch != TT_EOF)
- in.unread(ch);
- }
- }
- else if (ch == TT_EOF)
- {
- break;
- }
- }
- return nextToken(); // Recursive, but not too deep in normal cases
- }
- else
- {
- if (ch != TT_EOF)
- in.unread(ch);
- ch = '/';
- }
-
- if (ch == TT_EOF)
- ttype = TT_EOF;
- else if (isNumeric(ch))
- {
- boolean isNegative = false;
- if (ch == '-')
- {
- // Read ahead to see if this is an ordinary '-' rather than numeric.
- ch = in.read();
- if (isNumeric(ch) && ch != '-')
- {
- isNegative = true;
- }
- else
- {
- if (ch != TT_EOF)
- in.unread(ch);
- return (ttype = '-');
- }
- }
-
- StringBuffer tokbuf = new StringBuffer();
- tokbuf.append((char) ch);
-
- int decCount = 0;
- while (isNumeric(ch = in.read()) && ch != '-')
- if (ch == '.' && decCount++ > 0)
- break;
- else
- tokbuf.append((char) ch);
-
- if (ch != TT_EOF)
- in.unread(ch);
- ttype = TT_NUMBER;
- try
- {
- nval = Double.valueOf(tokbuf.toString()).doubleValue();
- }
- catch (NumberFormatException _)
- {
- nval = 0.0;
- }
- if (isNegative)
- nval = -nval;
- }
- else if (isAlphabetic(ch))
- {
- StringBuffer tokbuf = new StringBuffer();
- tokbuf.append((char) ch);
- while (isAlphabetic(ch = in.read()) || isNumeric(ch))
- tokbuf.append((char) ch);
- if (ch != TT_EOF)
- in.unread(ch);
- ttype = TT_WORD;
- sval = tokbuf.toString();
- if (lowerCase)
- sval = sval.toLowerCase();
- }
- else if (isComment(ch))
- {
- while ((ch = in.read()) != '\n' && ch != '\r' && ch != TT_EOF)
- ;
- if (ch != TT_EOF)
- in.unread(ch);
- return nextToken(); // Recursive, but not too deep in normal cases.
- }
- else if (isQuote(ch))
- {
- ttype = ch;
- StringBuffer tokbuf = new StringBuffer();
- while ((ch = in.read()) != ttype && ch != '\n' && ch != '\r' &&
- ch != TT_EOF)
- {
- if (ch == '\\')
- switch (ch = in.read())
- {
- case 'a': ch = 0x7;
- break;
- case 'b': ch = '\b';
- break;
- case 'f': ch = 0xC;
- break;
- case 'n': ch = '\n';
- break;
- case 'r': ch = '\r';
- break;
- case 't': ch = '\t';
- break;
- case 'v': ch = 0xB;
- break;
- case '\n': ch = '\n';
- break;
- case '\r': ch = '\r';
- break;
- case '\"':
- case '\'':
- case '\\':
- break;
- default:
- int ch1, nextch;
- if ((nextch = ch1 = ch) >= '0' && ch <= '7')
- {
- ch -= '0';
- if ((nextch = in.read()) >= '0' && nextch <= '7')
- {
- ch = ch * 8 + nextch - '0';
- if ((nextch = in.read()) >= '0' && nextch <= '7' &&
- ch1 >= '0' && ch1 <= '3')
- {
- ch = ch * 8 + nextch - '0';
- nextch = in.read();
- }
- }
- }
-
- if (nextch != TT_EOF)
- in.unread(nextch);
- }
-
- tokbuf.append((char) ch);
- }
-
- // Throw away matching quote char.
- if (ch != ttype && ch != TT_EOF)
- in.unread(ch);
-
- sval = tokbuf.toString();
- }
- else
- {
- ttype = ch;
- }
-
- return ttype;
- }
-
- private void resetChar(int ch)
- {
- whitespace[ch] = alphabetic[ch] = numeric[ch] = quote[ch] = comment[ch] =
- false;
- }
-
- /**
- * This method makes the specified character an ordinary character. This
- * means that none of the attributes (whitespace, alphabetic, numeric,
- * quote, or comment) will be set on this character. This character will
- * parse as its own token.
- *
- * @param ch The character to make ordinary, passed as an int
- */
- public void ordinaryChar(int ch)
- {
- if (ch >= 0 && ch <= 255)
- resetChar(ch);
- }
-
- /**
- * This method makes all the characters in the specified range, range
- * terminators included, ordinary. This means the none of the attributes
- * (whitespace, alphabetic, numeric, quote, or comment) will be set on
- * any of the characters in the range. This makes each character in this
- * range parse as its own token.
- *
- * @param low The low end of the range of values to set the whitespace
- * attribute for
- * @param hi The high end of the range of values to set the whitespace
- * attribute for
- */
- public void ordinaryChars(int low, int hi)
- {
- if (low < 0)
- low = 0;
- if (hi > 255)
- hi = 255;
- for (int i = low; i <= hi; i++)
- resetChar(i);
- }
-
- /**
- * This method sets the numeric attribute on the characters '0' - '9' and
- * the characters '.' and '-'.
- */
- public void parseNumbers()
- {
- for (int i = 0; i <= 9; i++)
- numeric['0' + i] = true;
-
- numeric['.'] = true;
- numeric['-'] = true;
- }
-
- /**
- * Puts the current token back into the StreamTokenizer so
- * <code>nextToken</code> will return the same value on the next call.
- * May cause the lineno method to return an incorrect value
- * if lineno is called before the next call to nextToken.
- */
- public void pushBack()
- {
- pushedBack = true;
- }
-
- /**
- * This method sets the quote attribute on the specified character.
- * Other attributes for the character are cleared.
- *
- * @param ch The character to set the quote attribute for, passed as an int.
- */
- public void quoteChar(int ch)
- {
- if (ch >= 0 && ch <= 255)
- {
- quote[ch] = true;
- comment[ch] = false;
- whitespace[ch] = false;
- alphabetic[ch] = false;
- numeric[ch] = false;
- }
- }
-
- /**
- * This method removes all attributes (whitespace, alphabetic, numeric,
- * quote, and comment) from all characters. It is equivalent to calling
- * <code>ordinaryChars(0x00, 0xFF)</code>.
- *
- * @see #ordinaryChars(int, int)
- */
- public void resetSyntax()
- {
- ordinaryChars(0x00, 0xFF);
- }
-
- /**
- * This method sets a flag that indicates whether or not "C++" language style
- * comments ("//" comments through EOL ) are handled by the parser.
- * If this is <code>true</code> commented out sequences are skipped and
- * ignored by the parser. This defaults to <code>false</code>.
- *
- * @param flag <code>true</code> to recognized and handle "C++" style
- * comments, <code>false</code> otherwise
- */
- public void slashSlashComments(boolean flag)
- {
- slashSlash = flag;
- }
-
- /**
- * This method sets a flag that indicates whether or not "C" language style
- * comments (with nesting not allowed) are handled by the parser.
- * If this is <code>true</code> commented out sequences are skipped and
- * ignored by the parser. This defaults to <code>false</code>.
- *
- * @param flag <code>true</code> to recognized and handle "C" style comments,
- * <code>false</code> otherwise
- */
- public void slashStarComments(boolean flag)
- {
- slashStar = flag;
- }
-
- /**
- * This method returns the current token value as a <code>String</code> in
- * the form "Token[x], line n", where 'n' is the current line numbers and
- * 'x' is determined as follows.
- * <p>
- * <ul>
- * <li>If no token has been read, then 'x' is "NOTHING" and 'n' is 0</li>
- * <li>If <code>ttype</code> is TT_EOF, then 'x' is "EOF"</li>
- * <li>If <code>ttype</code> is TT_EOL, then 'x' is "EOL"</li>
- * <li>If <code>ttype</code> is TT_WORD, then 'x' is <code>sval</code></li>
- * <li>If <code>ttype</code> is TT_NUMBER, then 'x' is "n=strnval" where
- * 'strnval' is <code>String.valueOf(nval)</code>.</li>
- * <li>If <code>ttype</code> is a quote character, then 'x' is
- * <code>sval</code></li>
- * <li>For all other cases, 'x' is <code>ttype</code></li>
- * </ul>
- */
- public String toString()
- {
- String tempstr;
- if (ttype == TT_EOF)
- tempstr = "EOF";
- else if (ttype == TT_EOL)
- tempstr = "EOL";
- else if (ttype == TT_WORD)
- tempstr = sval;
- else if (ttype == TT_NUMBER)
- tempstr = "n=" + nval;
- else if (ttype == TT_NONE)
- tempstr = "NOTHING";
- else // must be an ordinary char.
- tempstr = "\'" + (char) ttype + "\'";
-
- return "Token[" + tempstr + "], line " + lineno();
- }
-
- /**
- * This method sets the whitespace attribute for all characters in the
- * specified range, range terminators included.
- *
- * @param low The low end of the range of values to set the whitespace
- * attribute for
- * @param hi The high end of the range of values to set the whitespace
- * attribute for
- */
- public void whitespaceChars(int low, int hi)
- {
- if (low < 0)
- low = 0;
- if (hi > 255)
- hi = 255;
- for (int i = low; i <= hi; i++)
- {
- resetChar(i);
- whitespace[i] = true;
- }
- }
-
- /**
- * This method sets the alphabetic attribute for all characters in the
- * specified range, range terminators included.
- *
- * @param low The low end of the range of values to set the alphabetic
- * attribute for
- * @param hi The high end of the range of values to set the alphabetic
- * attribute for
- */
- public void wordChars(int low, int hi)
- {
- if (low < 0)
- low = 0;
- if (hi > 255)
- hi = 255;
- for (int i = low; i <= hi; i++)
- alphabetic[i] = true;
- }
-}
diff --git a/libjava/java/io/StringBufferInputStream.java b/libjava/java/io/StringBufferInputStream.java
deleted file mode 100644
index 090881985b8..00000000000
--- a/libjava/java/io/StringBufferInputStream.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/* StringBufferInputStream.java -- Read an String as a stream
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct. Deprecated in JDK 1.1.
- */
-
-/**
- * This class permits a <code>String</code> to be read as an input stream.
- * The low eight bits of each character in the <code>String</code> are the
- * bytes that are returned. The high eight bits of each character are
- * discarded.
- * <p>
- * The mark/reset functionality in this class behaves differently than
- * normal. The <code>mark()</code> method is always ignored and the
- * <code>reset()</code> method always resets in stream to start reading from
- * position 0 in the String. Note that since this method does not override
- * <code>markSupported()</code> in <code>InputStream</code>, calling that
- * method will return <code>false</code>.
- * <p>
- * Note that this class is deprecated because it does not properly handle
- * 16-bit Java characters. It is provided for backwards compatibility only
- * and should not be used for new development. The <code>StringReader</code>
- * class should be used instead.
- *
- * @deprecated
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public class StringBufferInputStream extends InputStream
-{
- /** The String which is the input to this stream. */
- protected String buffer;
-
- /** Position of the next byte in buffer to be read. */
- protected int pos = 0;
-
- /** The length of the String buffer. */
- protected int count;
-
- /**
- * Create a new <code>StringBufferInputStream</code> that will read bytes
- * from the passed in <code>String</code>. This stream will read from the
- * beginning to the end of the <code>String</code>.
- *
- * @param s The <code>String</code> this stream will read from.
- */
- public StringBufferInputStream(String s)
- {
- buffer = s;
- count = s.length();
- }
-
- /**
- * This method returns the number of bytes available to be read from this
- * stream. The value returned will be equal to <code>count - pos</code>.
- *
- * @return The number of bytes that can be read from this stream before
- * blocking, which is all of them
- */
- public int available()
- {
- return count - pos;
- }
-
- /**
- * This method reads one byte from the stream. The <code>pos</code> counter
- * is advanced to the next byte to be read. The byte read is returned as
- * an int in the range of 0-255. If the stream position is already at the
- * end of the buffer, no byte is read and a -1 is returned in order to
- * indicate the end of the stream.
- *
- * @return The byte read, or -1 if end of stream
- */
- public int read()
- {
- if (pos >= count)
- return -1; // EOF
-
- return ((int) buffer.charAt(pos++)) & 0xFF;
- }
-
-/**
- * This method reads bytes from the stream and stores them into a caller
- * supplied buffer. It starts storing the data at index <code>offset</code>
- * into the buffer and attempts to read <code>len</code> bytes. This method
- * can return before reading the number of bytes requested if the end of the
- * stream is encountered first. The actual number of bytes read is
- * returned. If no bytes can be read because the stream is already at
- * the end of stream position, a -1 is returned.
- * <p>
- * This method does not block.
- *
- * @param b The array into which the bytes read should be stored.
- * @param off The offset into the array to start storing bytes
- * @param len The requested number of bytes to read
- *
- * @return The actual number of bytes read, or -1 if end of stream.
- */
- public int read(byte[] b, int off, int len)
- {
- if (off < 0 || len < 0 || off + len > b.length)
- throw new ArrayIndexOutOfBoundsException();
-
- if (pos >= count)
- return -1; // EOF
-
- int numRead = Math.min(len, count - pos);
- if (numRead < 0)
- return 0;
-
- buffer.getBytes(pos, pos + numRead, b, off);
- pos += numRead;
- return numRead;
- }
-
- /**
- * This method sets the read position in the stream to the beginning
- * setting the <code>pos</code> variable equal to 0. Note that this differs
- * from the common implementation of the <code>reset()</code> method.
- */
- public void reset()
- {
- pos = 0;
- }
-
- /**
- * This method attempts to skip the requested number of bytes in the
- * input stream. It does this by advancing the <code>pos</code> value by the
- * specified number of bytes. It this would exceed the length of the
- * buffer, then only enough bytes are skipped to position the stream at
- * the end of the buffer. The actual number of bytes skipped is returned.
- *
- * @param n The requested number of bytes to skip
- *
- * @return The actual number of bytes skipped.
- */
- public long skip(long n)
- {
- if (n < 0)
- return 0L;
-
- long actualSkip = Math.min(n, count - pos);
- pos += actualSkip;
- return actualSkip;
- }
-}
diff --git a/libjava/java/io/StringReader.java b/libjava/java/io/StringReader.java
deleted file mode 100644
index 7e4e7d84f62..00000000000
--- a/libjava/java/io/StringReader.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/* StringReader.java -- permits a String to be read as a character input stream
- Copyright (C) 1998, 1999, 2000, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct
- */
-
-/**
- * This class permits a <code>String</code> to be read as a character
- * input stream.
- * <p>
- * The mark/reset functionality in this class behaves differently than
- * normal. If no mark has been set, then calling the <code>reset()</code>
- * method rewinds the read pointer to the beginning of the <code>String</code>.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @date October 19, 1998.
- */
-public class StringReader extends Reader
-{
- /* A String provided by the creator of the stream. */
- private String buf;
-
- /* Position of the next char in buf to be read. */
- private int pos;
-
- /* The currently marked position in the stream. */
- private int markedPos;
-
- /* The index in buf one greater than the last valid character. */
- private int count;
-
- /**
- * Create a new <code>StringReader</code> that will read chars from the
- * passed in <code>String</code>. This stream will read from the beginning
- * to the end of the <code>String</code>.
- *
- * @param buffer The <code>String</code> this stream will read from.
- */
- public StringReader(String buffer)
- {
- super();
- buf = buffer;
-
- count = buffer.length();
- markedPos = pos = 0;
- }
-
- public void close()
- {
- synchronized (lock)
- {
- buf = null;
- }
- }
-
- public void mark(int readAheadLimit) throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- // readAheadLimit is ignored per Java Class Lib. book, p. 1692.
- markedPos = pos;
- }
- }
-
- public boolean markSupported()
- {
- return true;
- }
-
- public int read() throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- if (pos < count)
- return ((int) buf.charAt(pos++)) & 0xFFFF;
- return -1;
- }
- }
-
- public int read(char[] b, int off, int len) throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- /* Don't need to check pos value, arraycopy will check it. */
- if (off < 0 || len < 0 || off + len > b.length)
- throw new ArrayIndexOutOfBoundsException();
-
- if (pos >= count)
- return -1;
-
- int lastChar = Math.min(count, pos + len);
- buf.getChars(pos, lastChar, b, off);
- int numChars = lastChar - pos;
- pos = lastChar;
- return numChars;
- }
- }
-
- /**
- * This method determines if the stream is ready to be read. This class
- * is always ready to read and so always returns <code>true</code>, unless
- * close() has previously been called in which case an IOException is
- * thrown.
- *
- * @return <code>true</code> to indicate that this object is ready to be read.
- * @exception IOException If the stream is closed.
- */
- public boolean ready() throws IOException
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- return true;
- }
-
- /**
- * Sets the read position in the stream to the previously
- * marked position or to 0 (i.e., the beginning of the stream) if the mark
- * has not already been set.
- */
- public void reset() throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- pos = markedPos;
- }
- }
-
- /**
- * This method attempts to skip the requested number of chars in the
- * input stream. It does this by advancing the <code>pos</code> value by
- * the specified number of chars. It this would exceed the length of the
- * buffer, then only enough chars are skipped to position the stream at
- * the end of the buffer. The actual number of chars skipped is returned.
- *
- * @param n The requested number of chars to skip
- *
- * @return The actual number of chars skipped.
- */
- public long skip(long n) throws IOException
- {
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("Stream closed");
-
- // Even though the var numChars is a long, in reality it can never
- // be larger than an int since the result of subtracting 2 positive
- // ints will always fit in an int. Since we have to return a long
- // anyway, numChars might as well just be a long.
- long numChars = Math.min((long) (count - pos), n < 0 ? 0L : n);
- pos += numChars;
- return numChars;
- }
- }
-}
-
diff --git a/libjava/java/io/StringWriter.java b/libjava/java/io/StringWriter.java
deleted file mode 100644
index a1e9aeb6bd2..00000000000
--- a/libjava/java/io/StringWriter.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/* StringWriter.java -- Writes bytes to a StringBuffer
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-// Wow is this a dumb class. CharArrayWriter can do all this and
-// more. I would redirect all calls to one in fact, but the javadocs say
-// use a StringBuffer so I will comply.
-
-/**
- * This class writes chars to an internal <code>StringBuffer</code> that
- * can then be used to retrieve a <code>String</code>.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- */
-public class StringWriter extends Writer
-{
- /**
- * This is the default size of the buffer if the user doesn't specify it.
- * @specnote The JCL Volume 1 says that 16 is the default size.
- */
- private static final int DEFAULT_BUFFER_SIZE = 16;
-
- /**
- * This method closes the stream. The contents of the internal buffer
- * can still be retrieved, but future writes are not guaranteed to work.
- *
- * @exception IOException If an error orrurs.
- */
- public void close () throws IOException
- {
- // JCL says this does nothing. This seems to violate the Writer
- // contract, in that other methods should still throw an
- // IOException after a close. Still, we just follow JCL.
- }
-
- /**
- * This method flushes any buffered characters to the underlying output.
- * It does nothing in this class.
- */
- public void flush ()
- {
- }
-
- /**
- * This method returns the <code>StringBuffer</code> object that this
- * object is writing to. Note that this is the actual internal buffer, so
- * any operations performed on it will affect this stream object.
- *
- * @return The <code>StringBuffer</code> object being written to
- */
- public StringBuffer getBuffer ()
- {
- return buffer;
- }
-
- /**
- * This method initializes a new <code>StringWriter</code> to write to a
- * <code>StringBuffer</code> initially sized to a default size of 16
- * chars.
- */
- public StringWriter ()
- {
- this (DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * This method initializes a new <code>StringWriter</code> to write to a
- * <code>StringBuffer</code> with the specified initial size.
- *
- * @param size The initial size to make the <code>StringBuffer</code>
- */
- public StringWriter (int size)
- {
- super ();
- buffer = new StringBuffer (size);
- lock = buffer;
- }
-
- /**
- * This method returns the contents of the internal <code>StringBuffer</code>
- * as a <code>String</code>.
- *
- * @return A <code>String</code> representing the chars written to
- * this stream.
- */
- public String toString ()
- {
- return buffer.toString();
- }
-
- /**
- * This method writes a single character to the output, storing it in
- * the internal buffer.
- *
- * @param oneChar The <code>char</code> to write, passed as an int.
- */
- public void write (int oneChar)
- {
- buffer.append((char) (oneChar & 0xFFFF));
- }
-
- /**
- * This method writes <code>len</code> chars from the specified
- * array starting at index <code>offset</code> in that array to this
- * stream by appending the chars to the end of the internal buffer.
- *
- * @param chars The array of chars to write
- * @param offset The index into the array to start writing from
- * @param len The number of chars to write
- */
- public void write (char[] chars, int offset, int len)
- {
- buffer.append(chars, offset, len);
- }
-
- /**
- * This method writes the characters in the specified <code>String</code>
- * to the stream by appending them to the end of the internal buffer.
- *
- * @param str The <code>String</code> to write to the stream.
- */
- public void write (String str)
- {
- buffer.append(str);
- }
-
- /**
- * This method writes out <code>len</code> characters of the specified
- * <code>String</code> to the stream starting at character position
- * <code>offset</code> into the stream. This is done by appending the
- * characters to the internal buffer.
- *
- * @param str The <code>String</code> to write characters from
- * @param offset The character position to start writing from
- * @param len The number of characters to write.
- */
- public void write (String str, int offset, int len)
- {
-// char[] tmpbuf = new char[len];
-// str.getChars(offset, offset+len, tmpbuf, 0);
-// buf.append(tmpbuf, 0, tmpbuf.length);
- // This implementation assumes that String.substring is more
- // efficient than using String.getChars and copying the data
- // twice. For libgcj, this is true. For Classpath, it is not.
- // FIXME.
- buffer.append(str.substring(offset, offset + len));
- }
-
- /**
- * This is the <code>StringBuffer</code> that we use to store bytes that
- * are written.
- */
- private StringBuffer buffer;
-}
diff --git a/libjava/java/io/SyncFailedException.java b/libjava/java/io/SyncFailedException.java
deleted file mode 100644
index c514c44f23f..00000000000
--- a/libjava/java/io/SyncFailedException.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* SyncFailedException.java -- a file sync failed
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * Thrown when a file synchronization fails.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @see FileDescriptor#sync()
- * @since 1.1
- * @status updated to 1.4
- */
-public class SyncFailedException extends IOException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -2353342684412443330L;
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public SyncFailedException(String message)
- {
- super(message);
- }
-} // class SyncFailedException
diff --git a/libjava/java/io/UTFDataFormatException.java b/libjava/java/io/UTFDataFormatException.java
deleted file mode 100644
index 6bb76aebdfe..00000000000
--- a/libjava/java/io/UTFDataFormatException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* UTFDataFormatException.java -- thrown on bad format in UTF data
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * When reading a UTF string from an input stream, this exception is thrown
- * to indicate that the data read is invalid.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @see DataInput
- * @see DataInputStream#readUTF(DataInput)
- * @status updated to 1.4
- */
-public class UTFDataFormatException extends IOException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 420743449228280612L;
-
- /**
- * Create a new UTFDataFormatException without a descriptive error message.
- */
- public UTFDataFormatException()
- {
- }
-
- /**
- * Create a new UTFDataFormatException with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public UTFDataFormatException(String message)
- {
- super(message);
- }
-} // class UTFDataFormatException
diff --git a/libjava/java/io/UnsupportedEncodingException.java b/libjava/java/io/UnsupportedEncodingException.java
deleted file mode 100644
index cf0ab64cb89..00000000000
--- a/libjava/java/io/UnsupportedEncodingException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* UnsupportedEncodingException.java -- the requested encoding isn't supported
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when the requested character encoding is
- * not supported.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner (bothner@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class UnsupportedEncodingException extends IOException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -4274276298326136670L;
-
- /**
- * Create an exception without a descriptive error message.
- */
- public UnsupportedEncodingException()
- {
- }
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message the descriptive error message
- */
- public UnsupportedEncodingException(String message)
- {
- super(message);
- }
-} // class UnsupportedEncodingException
diff --git a/libjava/java/io/WriteAbortedException.java b/libjava/java/io/WriteAbortedException.java
deleted file mode 100644
index f051dc975c8..00000000000
--- a/libjava/java/io/WriteAbortedException.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* WriteAbortedException.java -- wraps an exception thrown while writing
- Copyright (C) 1998, 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/**
- * This exception is thrown when another ObjectStreamException occurs during
- * a serialization read or write. The stream is reset, and deserialized
- * objects are discarded.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status updated to 1.4
- */
-public class WriteAbortedException extends ObjectStreamException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -3326426625597282442L;
-
- /**
- * The cause of this exception. This pre-dates the exception chaining
- * of Throwable; and although you can change this field, you are wiser
- * to leave it alone.
- *
- * @serial the exception cause
- */
- public Exception detail;
-
- /**
- * Create a new WriteAbortedException with a specified message and
- * cause.
- *
- * @param msg the message
- * @param detail the cause
- */
- public WriteAbortedException(String msg, Exception detail)
- {
- super(msg);
- initCause(detail);
- this.detail = detail;
- }
-
- /**
- * This method returns a message indicating what went wrong, in this
- * format:
- * <code>super.getMessage() + (detail == null ? "" : "; " + detail)</code>.
- *
- * @return the chained message
- */
- public String getMessage()
- {
- if (detail == this || detail == null)
- return super.getMessage();
- return super.getMessage() + "; " + detail;
- }
-
- /**
- * Returns the cause of this exception. Note that this may not be the
- * original cause, thanks to the <code>detail</code> field being public
- * and non-final (yuck). However, to avoid violating the contract of
- * Throwable.getCause(), this returns null if <code>detail == this</code>,
- * as no exception can be its own cause.
- *
- * @return the cause
- * @since 1.4
- */
- public Throwable getCause()
- {
- return detail == this ? null : detail;
- }
-} // class WriteAbortedException
diff --git a/libjava/java/io/Writer.java b/libjava/java/io/Writer.java
deleted file mode 100644
index f153e31cfed..00000000000
--- a/libjava/java/io/Writer.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/* Writer.java -- Base class for character output streams
- Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.io;
-
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct.
- */
-
-/**
- * This abstract class forms the base of the hierarchy of classes that
- * write output as a stream of chars. It provides a common set of methods
- * for writing chars to stream. Subclasses implement and/or extend these
- * methods to write chars in a particular manner or to a particular
- * destination such as a file on disk or network connection.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner (bothner@cygnus.com)
- */
-public abstract class Writer
-{
- /**
- * This is the object used to synchronize criticial code sections for
- * thread safety. Subclasses should use this field instead of using
- * synchronized methods or explicity synchronizations on <code>this</code>
- */
- protected Object lock;
-
- /**
- * This is the default no-argument constructor for this class. This method
- * will set up the class to synchronize criticial sections on itself.
- */
- protected Writer()
- {
- lock = this;
- }
-
- /**
- * This method initializes a <code>Writer</code> that will synchronize
- * on the specified <code>Object</code>.
- *
- * @param lock The <code>Object</code> to use for synchronizing critical
- * sections. Must not be null.
- */
- protected Writer(Object lock)
- {
- if (lock == null)
- throw new NullPointerException();
-
- this.lock = lock;
- }
-
- /**
- * This method forces any data that may have been buffered to be written
- * to the underlying output device. Please note that the host environment
- * might perform its own buffering unbeknowst to Java. In that case, a
- * write made (for example, to a disk drive) might be cached in OS
- * buffers instead of actually being written to disk.
- *
- * @exception IOException If an error occurs
- */
- public abstract void flush() throws IOException;
-
- /**
- * This method closes the stream. Any internal or native resources
- * associated
- * with this stream are freed. Any subsequent attempt to access the stream
- * might throw an exception.
- * <p>
- * This method in this class does nothing.
- *
- * @exception IOException If an error occurs
- */
- public abstract void close() throws IOException;
-
- /**
- * This method writes a single char to the output stream.
- *
- * @param b The char to be written to the output stream, passed as an int
- *
- * @exception IOException If an error occurs
- */
- public void write(int b) throws IOException
- {
- char[] buf = new char[1];
-
- buf[0] = (char)b;
- write(buf, 0, buf.length);
- }
-
- /**
- * This method all the writes char from the passed array to the output
- * stream. This method is equivalent to
- * <code>write(buf, 0, buf.length)</code> which
- * is exactly how it is implemented in this class.
- *
- * @param buf The array of char to write
- *
- * @exception IOException If an error occurs
- */
- public void write(char[] buf) throws IOException
- {
- write(buf, 0, buf.length);
- }
-
- /**
- * This method writes <code>len</code> char from the specified array
- * <code>buf</code> starting at index <code>offset</code> into the array.
- * <p>
- * Subclasses must provide an implementation of this abstract method.
- *
- * @param buf The array of char to write from
- * @param offset The index into the array to start writing from
- * @param len The number of char to write
- *
- * @exception IOException If an error occurs
- */
- public abstract void write(char[] buf, int offset, int len)
- throws IOException;
-
- /**
- * This method writes all the characters in a <code>String</code> to the
- * output.
- *
- * @param str The <code>String</code> whose chars are to be written.
- *
- * @exception IOException If an error occurs
- */
- public void write(String str) throws IOException
- {
- write(str, 0, str.length());
- }
-
- /**
- * This method writes <code>len</code> chars from the <code>String</code>
- * starting at position <code>offset</code>.
- *
- * @param str The <code>String</code> that is to be written
- * @param offset The character offset into the <code>String</code> to start
- * writing from
- * @param len The number of chars to write
- *
- * @exception IOException If an error occurs
- */
- public void write(String str, int offset, int len) throws IOException
- {
- // FIXME - for libgcj re-write using native code to not require
- // copied buffer.
- char[] buf = new char[len];
-
- str.getChars(offset, offset + len, buf, 0);
- write(buf, 0, len);
- }
-
-} // class Writer
-
diff --git a/libjava/java/lang/AbstractMethodError.java b/libjava/java/lang/AbstractMethodError.java
deleted file mode 100644
index b9eb622ee8e..00000000000
--- a/libjava/java/lang/AbstractMethodError.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* AbstractMethodError.java -- thrown if an abstract method is invoked
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * An <code>AbstractMethodError</code> is thrown when an application attempts
- * to access an abstract method. Compilers typically detect this error, but
- * it can be thrown at run time if the definition of a class has changed
- * since the application was last compiled. This can also occur when
- * reflecting on methods.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class AbstractMethodError extends IncompatibleClassChangeError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -1654391082989018462L;
-
- /**
- * Create an error without a message.
- */
- public AbstractMethodError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public AbstractMethodError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/ArithmeticException.java b/libjava/java/lang/ArithmeticException.java
deleted file mode 100644
index 5acea43533b..00000000000
--- a/libjava/java/lang/ArithmeticException.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* ArithmeticException.java -- exception thrown to indicate conditions
- like divide by zero.
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when a math error has occured, such as trying to divide an
- * integer by zero. For example:<br>
- * <pre>
- * int i = 0;
- * int j = 2 / i;
- * </pre>
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class ArithmeticException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 2256477558314496007L;
-
- /**
- * Create an exception without a message.
- */
- public ArithmeticException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public ArithmeticException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/ArrayIndexOutOfBoundsException.java b/libjava/java/lang/ArrayIndexOutOfBoundsException.java
deleted file mode 100644
index 371623bdaaa..00000000000
--- a/libjava/java/lang/ArrayIndexOutOfBoundsException.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ArrayIndexOutOfBoundsException.java -- exception thrown when accessing
- an illegal index.
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when attempting to access a position outside the valid range of
- * an array. For example:<br>
- * <pre>
- * int[] i = { 1 };
- * i[1] = 2;
- * </pre>
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -5116101128118950844L;
-
- /**
- * Create an exception without a message.
- */
- public ArrayIndexOutOfBoundsException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public ArrayIndexOutOfBoundsException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception indicating the illegal index.
- *
- * @param index the invalid index
- */
- public ArrayIndexOutOfBoundsException(int index)
- {
- super("Array index out of range: " + index);
- }
-}
diff --git a/libjava/java/lang/ArrayStoreException.java b/libjava/java/lang/ArrayStoreException.java
deleted file mode 100644
index 042e78c5515..00000000000
--- a/libjava/java/lang/ArrayStoreException.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* ArrayStoreException.java -- exception thrown to when trying to store an
- object into an array of a different type.
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when trying to store an object of the wrong runtime type in an
- * array. For example:<br>
- * <pre>
- * Object[] o = new Integer[1];
- * o[0] = "oops";
- * </pre>
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class ArrayStoreException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -4522193890499838241L;
-
- /**
- * Create an exception without a message.
- */
- public ArrayStoreException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public ArrayStoreException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/AssertionError.java b/libjava/java/lang/AssertionError.java
deleted file mode 100644
index 778eb583051..00000000000
--- a/libjava/java/lang/AssertionError.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/* AssertionError.java -- indication of a failed assertion
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * An assertion error normally occurs as a result of the <code>assert</code>
- * statement added in JDK 1.4, to indicate that an assertion failed. There
- * are enough constructors to ensure that
- * <code>new AssertionError(<em>expression</em>)</code> will work for all
- * expressions, regardless of type, as if the error message were given by
- * the string <code>"" + <em>expression</em></code>. This extends Error,
- * because you usually do not want to inadvertently trap an assertion failure.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status updated to 1.4
- */
-public class AssertionError extends Error
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = -5013299493970297370L;
-
- /**
- * Construct an AssertionError with no detail message.
- */
- public AssertionError()
- {
- }
-
- /**
- * Construct an AssertionError with the string conversion of the given
- * object as its error message. If the object is a Throwable, it is also
- * set as the cause of this error.
- *
- * @param msg the source of the error message
- * @see Throwable#getCause()
- */
- public AssertionError(Object msg)
- {
- super("" + msg);
- if (msg instanceof Throwable)
- initCause((Throwable) msg);
- }
-
- /**
- * Construct an AssertionError with the string conversion of the given
- * boolean as its error message.
- *
- * @param msg the source of the error message
- */
- public AssertionError(boolean msg)
- {
- super(msg ? "true" : "false");
- }
-
- /**
- * Construct an AssertionError with the string conversion of the given
- * char as its error message.
- *
- * @param msg the source of the error message
- */
- public AssertionError(char msg)
- {
- super(String.valueOf(msg));
- }
-
- /**
- * Construct an AssertionError with the string conversion of the given
- * int as its error message.
- *
- * @param msg the source of the error message
- */
- public AssertionError(int msg)
- {
- super(Integer.toString(msg, 10));
- }
-
- /**
- * Construct an AssertionError with the string conversion of the given
- * long as its error message.
- *
- * @param msg the source of the error message
- */
- public AssertionError(long msg)
- {
- super(Long.toString(msg));
- }
-
- /**
- * Construct an AssertionError with the string conversion of the given
- * float as its error message.
- *
- * @param msg the source of the error message
- */
- public AssertionError(float msg)
- {
- super(Float.toString(msg));
- }
-
- /**
- * Construct an AssertionError with the string conversion of the given
- * double as its error message.
- *
- * @param msg the source of the error message
- */
- public AssertionError(double msg)
- {
- super(Double.toString(msg));
- }
-}
diff --git a/libjava/java/lang/Boolean.java b/libjava/java/lang/Boolean.java
deleted file mode 100644
index b6910280e6b..00000000000
--- a/libjava/java/lang/Boolean.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/* Boolean.java -- object wrapper for boolean
- Copyright (C) 1998, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-import java.io.Serializable;
-
-/**
- * Instances of class <code>Boolean</code> represent primitive
- * <code>boolean</code> values.
- *
- * @author Paul Fisher
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status updated to 1.4
- */
-public final class Boolean implements Serializable
-{
- /**
- * Compatible with JDK 1.0.2+.
- */
- private static final long serialVersionUID = -3665804199014368530L;
-
- /**
- * This field is a <code>Boolean</code> object representing the
- * primitive value <code>true</code>. This instance is returned
- * by the static <code>valueOf()</code> methods if they return
- * a <code>Boolean</code> representing <code>true</code>.
- */
- public static final Boolean TRUE = new Boolean(true);
-
- /**
- * This field is a <code>Boolean</code> object representing the
- * primitive value <code>false</code>. This instance is returned
- * by the static <code>valueOf()</code> methods if they return
- * a <code>Boolean</code> representing <code>false</code>.
- */
- public static final Boolean FALSE = new Boolean(false);
-
- /**
- * The primitive type <code>boolean</code> is represented by this
- * <code>Class</code> object.
- *
- * @since 1.1
- */
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('Z');
-
- /**
- * The immutable value of this Boolean.
- * @serial the wrapped value
- */
- private final boolean value;
-
- /**
- * Create a <code>Boolean</code> object representing the value of the
- * argument <code>value</code>. In general the use of the static
- * method <code>valueof(boolean)</code> is more efficient since it will
- * not create a new object.
- *
- * @param value the primitive value of this <code>Boolean</code>
- * @see #valueOf(boolean)
- */
- public Boolean(boolean value)
- {
- this.value = value;
- }
-
- /**
- * Creates a <code>Boolean</code> object representing the primitive
- * <code>true</code> if and only if <code>s</code> matches
- * the string "true" ignoring case, otherwise the object will represent
- * the primitive <code>false</code>. In general the use of the static
- * method <code>valueof(String)</code> is more efficient since it will
- * not create a new object.
- *
- * @param s the <code>String</code> representation of <code>true</code>
- * or false
- */
- public Boolean(String s)
- {
- value = "true".equalsIgnoreCase(s);
- }
-
- /**
- * Return the primitive <code>boolean</code> value of this
- * <code>Boolean</code> object.
- *
- * @return true or false, depending on the value of this Boolean
- */
- public boolean booleanValue()
- {
- return value;
- }
-
- /**
- * Returns the Boolean <code>TRUE</code> if the given boolean is
- * <code>true</code>, otherwise it will return the Boolean
- * <code>FALSE</code>.
- *
- * @param b the boolean to wrap
- * @return the wrapper object
- * @see #TRUE
- * @see #FALSE
- * @since 1.4
- */
- public static Boolean valueOf(boolean b)
- {
- return b ? TRUE : FALSE;
- }
-
- /**
- * Returns the Boolean <code>TRUE</code> if and only if the given
- * String is equal, ignoring case, to the the String "true", otherwise
- * it will return the Boolean <code>FALSE</code>.
- *
- * @param s the string to convert
- * @return a wrapped boolean from the string
- */
- public static Boolean valueOf(String s)
- {
- return "true".equalsIgnoreCase(s) ? TRUE : FALSE;
- }
-
- /**
- * Returns "true" if the value of the give boolean is <code>true</code> and
- * returns "false" if the value of the given boolean is <code>false</code>.
- *
- * @param b the boolean to convert
- * @return the string representation of the boolean
- * @since 1.4
- */
- public static String toString(boolean b)
- {
- return b ? "true" : "false";
- }
-
- /**
- * Returns "true" if the value of this object is <code>true</code> and
- * returns "false" if the value of this object is <code>false</code>.
- *
- * @return the string representation of this
- */
- public String toString()
- {
- return value ? "true" : "false";
- }
-
- /**
- * Returns the integer <code>1231</code> if this object represents
- * the primitive <code>true</code> and the integer <code>1237</code>
- * otherwise.
- *
- * @return the hash code
- */
- public int hashCode()
- {
- return value ? 1231 : 1237;
- }
-
- /**
- * If the <code>obj</code> is an instance of <code>Boolean</code> and
- * has the same primitive value as this object then <code>true</code>
- * is returned. In all other cases, including if the <code>obj</code>
- * is <code>null</code>, <code>false</code> is returned.
- *
- * @param obj possibly an instance of any <code>Class</code>
- * @return true if <code>obj</code> equals this
- */
- public boolean equals(Object obj)
- {
- return obj instanceof Boolean && value == ((Boolean) obj).value;
- }
-
- /**
- * If the value of the system property <code>name</code> matches
- * "true" ignoring case then the function returns <code>true</code>.
- *
- * @param name the property name to look up
- * @return true if the property resulted in "true"
- * @throws SecurityException if accessing the system property is forbidden
- * @see System#getProperty(String)
- */
- public static boolean getBoolean(String name)
- {
- if (name == null || "".equals(name))
- return false;
- return "true".equalsIgnoreCase(System.getProperty(name));
- }
-}
diff --git a/libjava/java/lang/Byte.java b/libjava/java/lang/Byte.java
deleted file mode 100644
index 338e2167aa1..00000000000
--- a/libjava/java/lang/Byte.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/* Byte.java -- object wrapper for byte
- Copyright (C) 1998, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Instances of class <code>Byte</code> represent primitive <code>byte</code>
- * values.
- *
- * Additionally, this class provides various helper functions and variables
- * useful to bytes.
- *
- * @author Paul Fisher
- * @author John Keiser
- * @author Per Bothner
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status updated to 1.4
- */
-public final class Byte extends Number implements Comparable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -7183698231559129828L;
-
- /**
- * The minimum value a <code>byte</code> can represent is -128 (or
- * -2<sup>7</sup>).
- */
- public static final byte MIN_VALUE = -128;
-
- /**
- * The maximum value a <code>byte</code> can represent is 127 (or
- * 2<sup>7</sup> - 1).
- */
- public static final byte MAX_VALUE = 127;
-
- /**
- * The primitive type <code>byte</code> is represented by this
- * <code>Class</code> object.
- */
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('B');
-
- /**
- * The immutable value of this Byte.
- *
- * @serial the wrapped byte
- */
- private final byte value;
-
- /**
- * Create a <code>Byte</code> object representing the value of the
- * <code>byte</code> argument.
- *
- * @param value the value to use
- */
- public Byte(byte value)
- {
- this.value = value;
- }
-
- /**
- * Create a <code>Byte</code> object representing the value specified
- * by the <code>String</code> argument
- *
- * @param s the string to convert
- * @throws NumberFormatException if the String does not contain a byte
- * @see #valueOf(String)
- */
- public Byte(String s)
- {
- value = parseByte(s, 10);
- }
-
- /**
- * Converts the <code>byte</code> to a <code>String</code> and assumes
- * a radix of 10.
- *
- * @param b the <code>byte</code> to convert to <code>String</code>
- * @return the <code>String</code> representation of the argument
- */
- public static String toString(byte b)
- {
- return String.valueOf(b);
- }
-
- /**
- * Converts the specified <code>String</code> into a <code>byte</code>.
- * This function assumes a radix of 10.
- *
- * @param s the <code>String</code> to convert
- * @return the <code>byte</code> value of <code>s</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>byte</code>
- * @see #parseByte(String)
- */
- public static byte parseByte(String s)
- {
- return parseByte(s, 10);
- }
-
- /**
- * Converts the specified <code>String</code> into an <code>int</code>
- * using the specified radix (base). The string must not be <code>null</code>
- * or empty. It may begin with an optional '-', which will negate the answer,
- * provided that there are also valid digits. Each digit is parsed as if by
- * <code>Character.digit(d, radix)</code>, and must be in the range
- * <code>0</code> to <code>radix - 1</code>. Finally, the result must be
- * within <code>MIN_VALUE</code> to <code>MAX_VALUE</code>, inclusive.
- * Unlike Double.parseDouble, you may not have a leading '+'.
- *
- * @param s the <code>String</code> to convert
- * @param radix the radix (base) to use in the conversion
- * @return the <code>String</code> argument converted to <code>byte</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>byte</code>
- */
- public static byte parseByte(String s, int radix)
- {
- int i = Integer.parseInt(s, radix, false);
- if ((byte) i != i)
- throw new NumberFormatException();
- return (byte) i;
- }
-
- /**
- * Creates a new <code>Byte</code> object using the <code>String</code>
- * and specified radix (base).
- *
- * @param s the <code>String</code> to convert
- * @param radix the radix (base) to convert with
- * @return the new <code>Byte</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>byte</code>
- * @see #parseByte(String, int)
- */
- public static Byte valueOf(String s, int radix)
- {
- return new Byte(parseByte(s, radix));
- }
-
- /**
- * Creates a new <code>Byte</code> object using the <code>String</code>,
- * assuming a radix of 10.
- *
- * @param s the <code>String</code> to convert
- * @return the new <code>Byte</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>byte</code>
- * @see #Byte(String)
- * @see #parseByte(String)
- */
- public static Byte valueOf(String s)
- {
- return new Byte(parseByte(s, 10));
- }
-
- /**
- * Convert the specified <code>String</code> into a <code>Byte</code>.
- * The <code>String</code> may represent decimal, hexadecimal, or
- * octal numbers.
- *
- * <p>The extended BNF grammar is as follows:<br>
- * <pre>
- * <em>DecodableString</em>:
- * ( [ <code>-</code> ] <em>DecimalNumber</em> )
- * | ( [ <code>-</code> ] ( <code>0x</code> | <code>0X</code>
- * | <code>#</code> ) { <em>HexDigit</em> }+ )
- * | ( [ <code>-</code> ] <code>0</code> { <em>OctalDigit</em> } )
- * <em>DecimalNumber</em>:
- * <em>DecimalDigit except '0'</em> { <em>DecimalDigit</em> }
- * <em>DecimalDigit</em>:
- * <em>Character.digit(d, 10) has value 0 to 9</em>
- * <em>OctalDigit</em>:
- * <em>Character.digit(d, 8) has value 0 to 7</em>
- * <em>DecimalDigit</em>:
- * <em>Character.digit(d, 16) has value 0 to 15</em>
- * </pre>
- * Finally, the value must be in the range <code>MIN_VALUE</code> to
- * <code>MAX_VALUE</code>, or an exception is thrown.
- *
- * @param s the <code>String</code> to interpret
- * @return the value of the String as a <code>Byte</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>byte</code>
- * @throws NullPointerException if <code>s</code> is null
- * @see Integer#decode(String)
- */
- public static Byte decode(String s)
- {
- int i = Integer.parseInt(s, 10, true);
- if ((byte) i != i)
- throw new NumberFormatException();
- return new Byte((byte) i);
- }
-
- /**
- * Return the value of this <code>Byte</code>.
- *
- * @return the byte value
- */
- public byte byteValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Byte</code> as a <code>short</code>.
- *
- * @return the short value
- */
- public short shortValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Byte</code> as an <code>int</code>.
- *
- * @return the int value
- */
- public int intValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Byte</code> as a <code>long</code>.
- *
- * @return the long value
- */
- public long longValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Byte</code> as a <code>float</code>.
- *
- * @return the float value
- */
- public float floatValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Byte</code> as a <code>double</code>.
- *
- * @return the double value
- */
- public double doubleValue()
- {
- return value;
- }
-
- /**
- * Converts the <code>Byte</code> value to a <code>String</code> and
- * assumes a radix of 10.
- *
- * @return the <code>String</code> representation of this <code>Byte</code>
- * @see Integer#toString()
- */
- public String toString()
- {
- return String.valueOf(value);
- }
-
- /**
- * Return a hashcode representing this Object. <code>Byte</code>'s hash
- * code is simply its value.
- *
- * @return this Object's hash code
- */
- public int hashCode()
- {
- return value;
- }
-
- /**
- * Returns <code>true</code> if <code>obj</code> is an instance of
- * <code>Byte</code> and represents the same byte value.
- *
- * @param obj the object to compare
- * @return whether these Objects are semantically equal
- */
- public boolean equals(Object obj)
- {
- return obj instanceof Byte && value == ((Byte) obj).value;
- }
-
- /**
- * Compare two Bytes numerically by comparing their <code>byte</code> values.
- * The result is positive if the first is greater, negative if the second
- * is greater, and 0 if the two are equal.
- *
- * @param b the Byte to compare
- * @return the comparison
- * @since 1.2
- */
- public int compareTo(Byte b)
- {
- return value - b.value;
- }
-
- /**
- * Behaves like <code>compareTo(Byte)</code> unless the Object
- * is not a <code>Byte</code>.
- *
- * @param o the object to compare
- * @return the comparison
- * @throws ClassCastException if the argument is not a <code>Byte</code>
- * @see #compareTo(Byte)
- * @see Comparable
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compareTo((Byte) o);
- }
-}
diff --git a/libjava/java/lang/CharSequence.java b/libjava/java/lang/CharSequence.java
deleted file mode 100644
index 5c014e173a8..00000000000
--- a/libjava/java/lang/CharSequence.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* CharSequence.java -- Anything that has an indexed sequence of chars
- Copyright (C) 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * General functions on a sequence of chars. This interface is implemented
- * by <code>String</code>, <code>StringBuffer</code> and
- * <code>CharBuffer</code> to give a uniform way to get chars at a certain
- * index, the number of characters in the sequence and a subrange of the
- * chars. Indexes start at 0 and the last index is <code>length()-1</code>.
- *
- * <p>Even when classes implement this interface they are not always
- * exchangeble because they might implement their compare, equals or hash
- * function differently. This means that in general one should not use a
- * <code>CharSequence</code> as keys in collections since two sequences
- * with the same chars at the same indexes with the same length might not
- * have the same hash code, be equal or be comparable since the are
- * represented by different classes.
- *
- * @author Mark Wielaard (mark@klomp.org)
- * @since 1.4
- * @status updated to 1.4
- */
-public interface CharSequence
-{
- /**
- * Returns the character at the given index.
- *
- * @param i the index to retrieve from
- * @return the character at that location
- * @throws IndexOutOfBoundsException if i &lt; 0 || i &gt;= length() - 1
- */
- char charAt(int i);
-
- /**
- * Returns the length of the sequence. This is the number of 16-bit
- * characters in the sequence, which may differ from the length of the
- * underlying encoding.
- *
- * @return the sequence length
- */
- int length();
-
- /**
- * Returns a new <code>CharSequence</code> of the indicated range.
- *
- * @param begin the start index (inclusive)
- * @param end the end index (exclusive)
- * @return a subsequence of this
- * @throws IndexOutOfBoundsException if begin &gt; end || begin &lt; 0 ||
- * end &gt; length()
- */
- CharSequence subSequence(int begin, int end);
-
- /**
- * Returns the complete <code>CharSequence</code> as a <code>String</code>.
- * Classes that implement this interface should return a <code>String</code>
- * which contains only the characters in the sequence in the correct order.
- *
- * @return the character sequence as a String
- */
- String toString();
-}
diff --git a/libjava/java/lang/ClassCastException.java b/libjava/java/lang/ClassCastException.java
deleted file mode 100644
index c490f42aaa8..00000000000
--- a/libjava/java/lang/ClassCastException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* ClassCastException.java -- exception thrown on bad cast
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when an attempt is made to cast an object which is not of the
- * appropriate runtime type. For example:<br>
- * <pre>
- * Object o = new Vector();
- * String s = (String) o;
- * </pre>
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class ClassCastException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -9223365651070458532L;
-
- /**
- * Create an exception without a message.
- */
- public ClassCastException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public ClassCastException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/ClassCircularityError.java b/libjava/java/lang/ClassCircularityError.java
deleted file mode 100644
index ecdfb7aaf3a..00000000000
--- a/libjava/java/lang/ClassCircularityError.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* ClassCircularityError.java -- thrown when linking circular classes
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * A <code>ClassCircularityError</code> is thrown when a circular dependency
- * has been detected while initializing a class. This signals binary
- * incompatible versions of class files, as the compiler normally catches this.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class ClassCircularityError extends LinkageError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 1054362542914539689L;
-
- /**
- * Create an error without a message.
- */
- public ClassCircularityError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public ClassCircularityError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/ClassFormatError.java b/libjava/java/lang/ClassFormatError.java
deleted file mode 100644
index 7f90f5cd83e..00000000000
--- a/libjava/java/lang/ClassFormatError.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ClassFormatError.java -- thrown if a class file is invalid
- Copyright (C) 1998, 1999, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * A <code>ClassFormatError</code> is thrown when a Java Virtual Machine
- * unable to read a class file because the file is corrupted or cannot be
- * interpreted as a class file.
- *
- * @author Brian Jones
- * @status updated to 1.4
- */
-public class ClassFormatError extends LinkageError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -8420114879011949195L;
-
- /**
- * Create an error without a message.
- */
- public ClassFormatError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public ClassFormatError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/ClassNotFoundException.java b/libjava/java/lang/ClassNotFoundException.java
deleted file mode 100644
index 6b6ae949dd2..00000000000
--- a/libjava/java/lang/ClassNotFoundException.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/* ClassNotFoundException.java -- thrown when class definition cannot be found
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when a class is requested by reflection, but the class definition
- * cannot be found. This exception is often chained from another Throwable.
- *
- * @author Brian Jones
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Class#forName(String)
- * @see ClassLoader#findSystemClass(String)
- * @see ClassLoader#loadClass(String, boolean)
- * @status updated to 1.4
- */
-public class ClassNotFoundException extends Exception
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 9176873029745254542L;
-
- /**
- * The cause of this exception (duplicates the one stored in Throwable).
- *
- * @serial the exception cause
- * @since 1.2
- */
- private final Throwable ex;
-
- /**
- * Create an exception without a message. Note that this initializes the
- * cause to null.
- */
- public ClassNotFoundException()
- {
- this(null, null);
- }
-
- /**
- * Create an exception with a message. Note that this initializes the
- * cause to null.
- *
- * @param s the message
- */
- public ClassNotFoundException(String s)
- {
- this(s, null);
- }
-
- /**
- * Create an exception with a message and chain it to the exception
- * which occurred while loading the class.
- *
- * @param s the message
- * @param ex the chained exception
- * @since 1.2
- */
- public ClassNotFoundException(String s, Throwable ex)
- {
- super(s, ex);
- this.ex = ex;
- }
-
- /**
- * Returns the exception which occurred while loading the class,
- * otherwise returns null. This is a legacy method; the preferred choice
- * now is {@link Throwable#getCause()}.
- *
- * @return the cause of this exception
- * @since 1.2
- */
- public Throwable getException()
- {
- return ex;
- }
-
- /**
- * Returns the exception which occurred while loading the class,
- * otherwise returns null.
- *
- * @return the cause of this exception
- * @since 1.4
- */
- public Throwable getCause()
- {
- return ex;
- }
-}
diff --git a/libjava/java/lang/CloneNotSupportedException.java b/libjava/java/lang/CloneNotSupportedException.java
deleted file mode 100644
index 9d10cf389f9..00000000000
--- a/libjava/java/lang/CloneNotSupportedException.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* CloneNotSupportedException.java -- thrown when an object cannot be cloned
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown to indicate an object should not or could not be cloned. This
- * includes the case when {@link Object#clone()} is called on an object
- * which does not implement the {@link Cloneable} interface. For example:<br>
- * <pre>
- * void m() throws CloneNotSupportedException
- * {
- * clone();
- * }
- * </pre>
- *
- * <p>Notice that calling <code>clone()</code> on an array will never produce
- * this exception, as the VM will always succeed in copying the array, or
- * cause an OutOfMemoryError first. For example:<br>
- * <pre>
- * void m(int[] array)
- * {
- * int[] copy = (int[]) array.clone();
- * }
- * </pre>
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Cloneable
- * @see Object#clone()
- * @status updated to 1.4
- */
-public class CloneNotSupportedException extends Exception
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 5195511250079656443L;
-
- /**
- * Create an exception without a message.
- */
- public CloneNotSupportedException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the error message
- */
- public CloneNotSupportedException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/Cloneable.java b/libjava/java/lang/Cloneable.java
deleted file mode 100644
index 10f20ce3b6e..00000000000
--- a/libjava/java/lang/Cloneable.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Cloneable.java -- Interface for marking objects cloneable by Object.clone()
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * This interface should be implemented by classes wishing to
- * support of override <code>Object.clone()</code>. The default
- * behaviour of <code>clone()</code> performs a shallow copy, but
- * subclasses often change this to perform a deep copy. Therefore,
- * it is a good idea to document how deep your clone will go.
- * If <code>clone()</code> is called on an object which does not
- * implement this interface, a <code>CloneNotSupportedException</code>
- * will be thrown.
- *
- * <p>This interface is simply a tagging interface; it carries no
- * requirements on methods to implement. However, it is typical for
- * a Cloneable class to implement at least <code>equals</code>,
- * <code>hashCode</code>, and <code>clone</code>, sometimes
- * increasing the accessibility of clone to be public. The typical
- * implementation of <code>clone</code> invokes <code>super.clone()</code>
- * rather than a constructor, but this is not a requirement.
- *
- * <p>If an object that implement Cloneable should not be cloned,
- * simply override the <code>clone</code> method to throw a
- * <code>CloneNotSupportedException</code>.
- *
- * <p>All array types implement Cloneable, and have a public
- * <code>clone</code> method that will never fail with a
- * <code>CloneNotSupportedException</code>.
- *
- * @author Paul Fisher
- * @author Eric Blake (ebb9@email.byu.edu)
- * @author Warren Levy (warrenl@cygnus.com)
- * @see Object#clone()
- * @see CloneNotSupportedException
- * @since 1.0
- * @status updated to 1.4
- */
-public interface Cloneable
-{
- // Tagging interface only.
-}
diff --git a/libjava/java/lang/Comparable.java b/libjava/java/lang/Comparable.java
deleted file mode 100644
index a8afe1ec33e..00000000000
--- a/libjava/java/lang/Comparable.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Comparable.java -- Interface for comparaing objects to obtain an ordering
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Interface for objects that can be ordering among other objects. The
- * ordering can be <em>total</em>, such that two objects only compare equal
- * if they are also equal by the equals method, or <em>partial</em> such
- * that this is not necessarily true. For example, a case-sensitive
- * dictionary order comparison of Strings is total, but if it is
- * case-insensitive it is partial, because "abc" and "ABC" compare as
- * equal even though "abc".equals("ABC") returns false. However, if you use
- * a partial ordering, it is a good idea to document your class as
- * "inconsistent with equals", because the behavior of your class in a
- * SortedMap will be different than in a HashMap.
- *
- * <p>Lists, arrays, and sets of objects that implement this interface can
- * be sorted automatically, without the need for an explicit
- * {@link java.util.Comparator}. Note that <code>e1.compareTo(null)</code>
- * should throw an Exception; as should comparison between incompatible
- * classes.
- *
- * @author Geoff Berry
- * @author Warren Levy (warrenl@cygnus.com)
- * @see java.util.Comparator
- * @see java.util.Collections#sort(java.util.List)
- * @see java.util.Arrays#sort(Object[])
- * @see java.util.SortedSet
- * @see java.util.SortedMap
- * @see java.util.TreeSet
- * @see java.util.TreeMap
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Comparable
-{
- /**
- * Compares this object with another, and returns a numerical result based
- * on the comparison. If the result is negative, this object sorts less
- * than the other; if 0, the two are equal, and if positive, this object
- * sorts greater than the other. To translate this into boolean, simply
- * perform <code>o1.compareTo(o2) <em>&lt;op&gt;</em> 0</code>, where op
- * is one of &lt;, &lt;=, =, !=, &gt;, or &gt;=.
- *
- * <p>You must make sure that the comparison is mutual, ie.
- * <code>sgn(x.compareTo(y)) == -sgn(y.compareTo(x))</code> (where sgn() is
- * defined as -1, 0, or 1 based on the sign). This includes throwing an
- * exception in either direction if the two are not comparable; hence,
- * <code>compareTo(null)</code> should always throw an Exception.
- *
- * <p>You should also ensure transitivity, in two forms:
- * <code>x.compareTo(y) &gt; 0 && y.compareTo(z) &gt; 0</code> implies
- * <code>x.compareTo(z) &gt; 0</code>; and <code>x.compareTo(y) == 0</code>
- * implies <code>x.compareTo(z) == y.compareTo(z)</code>.
- *
- * @param o the object to be compared
- * @return an integer describing the comparison
- * @throws NullPointerException if o is null
- * @throws ClassCastException if o cannot be compared
- */
- int compareTo(Object o);
-}
diff --git a/libjava/java/lang/Compiler.java b/libjava/java/lang/Compiler.java
deleted file mode 100644
index 56fb951bbd9..00000000000
--- a/libjava/java/lang/Compiler.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Compiler.java -- placeholder for Java-to-native runtime compilers
- Copyright (C) 1998, 1999, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * The <code>Compiler</code> class is a placeholder for a JIT compiler
- * implementation, and does nothing unless there is such a compiler.
- *
- * <p>The system property <code>java.compiler</code> may contain the name
- * of a library to load with <code>System.loadLibrary</code> when the
- * virtual machine first starts. If so, and loading the library succeeds,
- * then a function by the name of <code>java_lang_Compiler_start()</code>
- * in that library is called.
- *
- * <p>Note that a VM might not have implemented any of this.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @see System#getProperty(String)
- * @see System#getProperty(String, String)
- * @see System#loadLibrary(String)
- * @since JDK 1.0
- * @status updated to 1.4
- */
-public final class Compiler
-{
- /**
- * Don't allow new `Compiler's to be made.
- */
- private Compiler()
- {
- }
-
- /**
- * Compile the class named by <code>oneClass</code>.
- *
- * @param oneClass the class to compile
- * @return <code>false</code> if no compiler is available or
- * compilation failed, <code>true</code> if compilation succeeded
- * @throws NullPointerException if oneClass is null
- */
- public static boolean compileClass(Class oneClass)
- {
- return VMCompiler.compileClass(oneClass);
- }
-
- /**
- * Compile the classes whose name matches <code>classNames</code>.
- *
- * @param classNames the name of classes to compile
- * @return <code>false</code> if no compiler is available or
- * compilation failed, <code>true</code> if compilation succeeded
- * @throws NullPointerException if classNames is null
- */
- public static boolean compileClasses(String classNames)
- {
- return VMCompiler.compileClasses(classNames);
- }
-
- /**
- * This method examines the argument and performs an operation
- * according to the compilers documentation. No specific operation
- * is required.
- *
- * @param arg a compiler-specific argument
- * @return a compiler-specific value, including null
- * @throws NullPointerException if the compiler doesn't like a null arg
- */
- public static Object command(Object arg)
- {
- return VMCompiler.command(arg);
- }
-
- /**
- * Calling <code>Compiler.enable()</code> will cause the compiler
- * to resume operation if it was previously disabled; provided that a
- * compiler even exists.
- */
- public static void enable()
- {
- VMCompiler.enable();
- }
-
- /**
- * Calling <code>Compiler.disable()</code> will cause the compiler
- * to be suspended; provided that a compiler even exists.
- */
- public static void disable()
- {
- VMCompiler.disable();
- }
-}
diff --git a/libjava/java/lang/Error.java b/libjava/java/lang/Error.java
deleted file mode 100644
index f66c7548b33..00000000000
--- a/libjava/java/lang/Error.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Error.java -- Indication of fatal abnormal conditions
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Applications should not try to catch errors since they indicate
- * abnormal conditions. An abnormal condition is something which should not
- * occur, or which should not be recovered from. This latter category
- * includes <code>ThreadDeath</code> and <code>AssertionError</code>.
- *
- * <p>A method is not required to declare any subclass of <code>Error</code> in
- * its <code>throws</code> clause which might be thrown but not caught while
- * executing the method.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status updated to 1.4
- */
-public class Error extends Throwable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 4980196508277280342L;
-
- /**
- * Create an error without a message. The cause remains uninitialized.
- *
- * @see #initCause(Throwable)
- */
- public Error()
- {
- }
-
- /**
- * Create an error with a message. The cause remains uninitialized.
- *
- * @param s the message string
- * @see #initCause(Throwable)
- */
- public Error(String s)
- {
- super(s);
- }
-
- /**
- * Create an error with a message and a cause.
- *
- * @param s the message string
- * @param cause the cause of this error
- * @since 1.4
- */
- public Error(String s, Throwable cause)
- {
- super(s, cause);
- }
-
- /**
- * Create an error with a given cause, and a message of
- * <code>cause == null ? null : cause.toString()</code>.
- *
- * @param cause the cause of this error
- * @since 1.4
- */
- public Error(Throwable cause)
- {
- super(cause);
- }
-}
diff --git a/libjava/java/lang/Exception.java b/libjava/java/lang/Exception.java
deleted file mode 100644
index 42f7c640dd3..00000000000
--- a/libjava/java/lang/Exception.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Exception.java -- generic exception thrown to indicate an exceptional
- condition has occurred.
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * The root class of all exceptions worth catching in a program. This
- * includes the special category of <code>RuntimeException</code>, which
- * does not need to be declared in a throws clause. Exceptions can be used
- * to represent almost any exceptional behavior, such as programming errors,
- * mouse movements, keyboard clicking, etc.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @status updated to 1.4
- */
-public class Exception extends Throwable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -3387516993124229948L;
-
- /**
- * Create an exception without a message. The cause remains uninitialized.
- *
- * @see #initCause(Throwable)
- */
- public Exception()
- {
- }
-
- /**
- * Create an exception with a message. The cause remains uninitialized.
- *
- * @param s the message
- * @see #initCause(Throwable)
- */
- public Exception(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message string
- * @param cause the cause of this error
- * @since 1.4
- */
- public Exception(String s, Throwable cause)
- {
- super(s, cause);
- }
-
- /**
- * Create an exception with a given cause, and a message of
- * <code>cause == null ? null : cause.toString()</code>.
- *
- * @param cause the cause of this exception
- * @since 1.4
- */
- public Exception(Throwable cause)
- {
- super(cause);
- }
-}
diff --git a/libjava/java/lang/ExceptionInInitializerError.java b/libjava/java/lang/ExceptionInInitializerError.java
deleted file mode 100644
index 1e580958054..00000000000
--- a/libjava/java/lang/ExceptionInInitializerError.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/* ExceptionInInitializerError.java -- thrown when class initialization fails
- with an uncaught exception
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * An <code>ExceptionInInitializerError</code> is thrown when an uncaught
- * exception has occurred in a static initializer or the initializer for a
- * static variable. In general, this wraps only RuntimeExceptions, since the
- * compiler does not allow a checked exception to be uncaught in an
- * initializer. This exception only occurs during reflection, when a class
- * is initialized as part of another action.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status updated to 1.4
- */
-public class ExceptionInInitializerError extends LinkageError
-{
- /**
- * Compatible with JDK 1.1+.
- */
- static final long serialVersionUID = 1521711792217232256L;
-
- /**
- * The cause of this exception (duplicates the one stored in Throwable).
- *
- * @serial the exception cause
- */
- private final Throwable exception;
-
- /**
- * Create an error without a message. The cause is initialized as null.
- */
- public ExceptionInInitializerError()
- {
- this((String) null);
- }
-
- /**
- * Create an error with a message. The cause is initialized as null.
- *
- * @param s the message
- */
- public ExceptionInInitializerError(String s)
- {
- super(s);
- exception = null;
- }
-
- /**
- * Creates an error an saves a reference to the <code>Throwable</code>
- * object. The message string is null.
- *
- * @param t the exception thrown
- */
- public ExceptionInInitializerError(Throwable t)
- {
- super(null);
- initCause(t);
- exception = t;
- }
-
- /**
- * Return the exception that caused this error to be created. This is a
- * legacy method; the preferred choice now is {@link Throwable#getCause()}.
- *
- * @return the cause, or null if unknown
- */
- public Throwable getException()
- {
- return exception;
- }
-
- /**
- * Return the exception that cause this error to be created.
- *
- * @return the cause, or null if unknown
- * @since 1.4
- */
- public Throwable getCause()
- {
- return exception;
- }
-}
diff --git a/libjava/java/lang/IllegalAccessError.java b/libjava/java/lang/IllegalAccessError.java
deleted file mode 100644
index e4821606a41..00000000000
--- a/libjava/java/lang/IllegalAccessError.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* IllegalAccessError.java -- thrown when linking to an inaccessible member
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * An <code>IllegalAccessError</code> is thrown when an attempt is made to
- * call a method, or access or modify a field that the application does not
- * have access to. Because this error is usually caught by a compiler,
- * the error only occurs at runtime when the definition of a class has
- * changed in a way that is incompatible with the previously compiled
- * application.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class IllegalAccessError extends IncompatibleClassChangeError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -8988904074992417891L;
-
- /**
- * Create an error without a message.
- */
- public IllegalAccessError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public IllegalAccessError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/IllegalAccessException.java b/libjava/java/lang/IllegalAccessException.java
deleted file mode 100644
index 3fe83b5c716..00000000000
--- a/libjava/java/lang/IllegalAccessException.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* IllegalAccessException.java -- thrown on attempt to reflect on
- inaccessible data
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown whenever a reflective method tries to do something that the
- * compiler would not allow. For example, using reflection to set a private
- * variable that belongs to a class in another package is bad.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @see Class#newInstance()
- * @see Field#set(Object, Object)
- * @see Field#setBoolean(Object, boolean)
- * @see Field#setByte(Object, byte)
- * @see Field#setShort(Object, short)
- * @see Field#setChar(Object, char)
- * @see Field#setInt(Object, int)
- * @see Field#setLong(Object, long)
- * @see Field#setFloat(Object, float)
- * @see Field#setDouble(Object, double)
- * @see Field#get(Object)
- * @see Field#getBoolean(Object)
- * @see Field#getByte(Object)
- * @see Field#getShort(Object)
- * @see Field#getChar(Object)
- * @see Field#getInt(Object)
- * @see Field#getLong(Object)
- * @see Field#getFloat(Object)
- * @see Field#getDouble(Object)
- * @see Method#invoke(Object, Object[])
- * @see Constructor#newInstance(Object[])
- * @status updated to 1.4
- */
-public class IllegalAccessException extends Exception
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 6616958222490762034L;
-
- /**
- * Create an exception without a message.
- */
- public IllegalAccessException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public IllegalAccessException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/IllegalArgumentException.java b/libjava/java/lang/IllegalArgumentException.java
deleted file mode 100644
index 7b822b91665..00000000000
--- a/libjava/java/lang/IllegalArgumentException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* IllegalArgumentException.java -- thrown when a method is passed an
- illegal or inappropriate argument
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when a method is passed an illegal or inappropriate argument. For
- * example:<br>
- * <pre>
- * wait(-1);
- * </pre>
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class IllegalArgumentException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -5365630128856068164L;
-
- /**
- * Create an exception without a message.
- */
- public IllegalArgumentException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public IllegalArgumentException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/IllegalMonitorStateException.java b/libjava/java/lang/IllegalMonitorStateException.java
deleted file mode 100644
index 13b3f952bb5..00000000000
--- a/libjava/java/lang/IllegalMonitorStateException.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* IllegalMonitorStateException.java -- thrown when trying to wait or
- notify a monitor that is not owned
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when a thread attempts to wait or notify on a monitor that it
- * does not own (ie. it has not synchronized on the object). For example:<br>
- * <pre>
- * void m() {
- * notify();
- * }
- * </pre>
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class IllegalMonitorStateException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 3713306369498869069L;
-
- /**
- * Create an exception without a message.
- */
- public IllegalMonitorStateException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public IllegalMonitorStateException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/IllegalStateException.java b/libjava/java/lang/IllegalStateException.java
deleted file mode 100644
index 5c2bbad37a2..00000000000
--- a/libjava/java/lang/IllegalStateException.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* IllegalStateException.java -- thrown when invoking a method at
- an illegal or inappropriate time
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when a method is invoked at an illegal or inappropriate time. For
- * example:<br>
- * <pre>
- * void m(Collecion c)
- * {
- * c.iterator().remove();
- * }
- * </pre>
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class IllegalStateException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -1848914673093119416L;
-
- /**
- * Create an exception without a message.
- */
- public IllegalStateException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public IllegalStateException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/IllegalThreadStateException.java b/libjava/java/lang/IllegalThreadStateException.java
deleted file mode 100644
index e14385a3e83..00000000000
--- a/libjava/java/lang/IllegalThreadStateException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* IllegalThreadStateException.java -- thrown when trying to manipulate a
- Thread when it is not in an appropriate state
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown When trying to manipulate a Thread which is in an inappropriate
- * state. Since the documentation suggests that this can happen with
- * <code>Thread.suspend</code> or <code>Thread.resume</code>, but these
- * two methods are deprecated, this exception is likely very rare.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class IllegalThreadStateException extends IllegalArgumentException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -7626246362397460174L;
-
- /**
- * Create an exception without a message.
- */
- public IllegalThreadStateException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public IllegalThreadStateException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/IncompatibleClassChangeError.java b/libjava/java/lang/IncompatibleClassChangeError.java
deleted file mode 100644
index 637410a9009..00000000000
--- a/libjava/java/lang/IncompatibleClassChangeError.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* IncompatibleClassChangeError.java -- thrown for binary incompatible classes
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * An <code>IncompatibleClassChangeError</code> is thrown when the definition
- * of a class used by the currently executing method has changed in an
- * incompatible way.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class IncompatibleClassChangeError extends LinkageError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -4914975503642802119L;
-
- /**
- * Create an error without a message.
- */
- public IncompatibleClassChangeError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public IncompatibleClassChangeError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/IndexOutOfBoundsException.java b/libjava/java/lang/IndexOutOfBoundsException.java
deleted file mode 100644
index c53c67e5574..00000000000
--- a/libjava/java/lang/IndexOutOfBoundsException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* IndexOutOfBoundsException.java -- thrown for an invalid index
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * This exception can be thrown to indicate an attempt to access an
- * index which is out of bounds on objects like String, Array, or Vector.
- * Usually any negative integer less than or equal to -1 and positive
- * integer greater than or equal to the size of the object is an index
- * which would be out of bounds.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class IndexOutOfBoundsException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 234122996006267687L;
-
- /**
- * Create an exception without a message.
- */
- public IndexOutOfBoundsException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public IndexOutOfBoundsException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/InstantiationError.java b/libjava/java/lang/InstantiationError.java
deleted file mode 100644
index dd12b513a22..00000000000
--- a/libjava/java/lang/InstantiationError.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* InstantiationError.java -- thrown when the linker cannot create an instance
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * An <code>InstantiationError</code> is thrown when an attempt is made to
- * create an instance of an abstract class or an interface. Because this
- * error is usually caught by a compiler, the error only occurs at runtime
- * when the definition of a class has changed in a way that is incompatible
- * with the previously compiled application.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class InstantiationError extends IncompatibleClassChangeError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -4885810657349421204L;
-
- /**
- * Create an error without a message.
- */
- public InstantiationError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public InstantiationError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/InstantiationException.java b/libjava/java/lang/InstantiationException.java
deleted file mode 100644
index 367b14bd278..00000000000
--- a/libjava/java/lang/InstantiationException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* InstantiationException.java -- thrown when reflection cannot create an
- instance
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when an attempt is made to use reflection to build a
- * non-instantiable class (an interface or abstract class).
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @see Class#newInstance()
- * @status updated to 1.4
- */
-public class InstantiationException extends Exception
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -8441929162975509110L;
-
- /**
- * Create an exception without a message.
- */
- public InstantiationException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public InstantiationException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/Integer.java b/libjava/java/lang/Integer.java
deleted file mode 100644
index 61d7ef0f7e2..00000000000
--- a/libjava/java/lang/Integer.java
+++ /dev/null
@@ -1,606 +0,0 @@
-/* Integer.java -- object wrapper for int
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Instances of class <code>Integer</code> represent primitive
- * <code>int</code> values.
- *
- * Additionally, this class provides various helper functions and variables
- * related to ints.
- *
- * @author Paul Fisher
- * @author John Keiser
- * @author Warren Levy
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status updated to 1.4
- */
-public final class Integer extends Number implements Comparable
-{
- /**
- * Compatible with JDK 1.0.2+.
- */
- private static final long serialVersionUID = 1360826667806852920L;
-
- /**
- * The minimum value an <code>int</code> can represent is -2147483648 (or
- * -2<sup>31</sup>).
- */
- public static final int MIN_VALUE = 0x80000000;
-
- /**
- * The maximum value an <code>int</code> can represent is 2147483647 (or
- * 2<sup>31</sup> - 1).
- */
- public static final int MAX_VALUE = 0x7fffffff;
-
- /**
- * The primitive type <code>int</code> is represented by this
- * <code>Class</code> object.
- * @since 1.1
- */
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('I');
-
- /**
- * The immutable value of this Integer.
- *
- * @serial the wrapped int
- */
- private final int value;
-
- /**
- * Create an <code>Integer</code> object representing the value of the
- * <code>int</code> argument.
- *
- * @param value the value to use
- */
- public Integer(int value)
- {
- this.value = value;
- }
-
- /**
- * Create an <code>Integer</code> object representing the value of the
- * argument after conversion to an <code>int</code>.
- *
- * @param s the string to convert
- * @throws NumberFormatException if the String does not contain an int
- * @see #valueOf(String)
- */
- public Integer(String s)
- {
- value = parseInt(s, 10, false);
- }
-
- /**
- * Converts the <code>int</code> to a <code>String</code> using
- * the specified radix (base). If the radix exceeds
- * <code>Character.MIN_RADIX</code> or <code>Character.MAX_RADIX</code>, 10
- * is used instead. If the result is negative, the leading character is
- * '-' ('\\u002D'). The remaining characters come from
- * <code>Character.forDigit(digit, radix)</code> ('0'-'9','a'-'z').
- *
- * @param num the <code>int</code> to convert to <code>String</code>
- * @param radix the radix (base) to use in the conversion
- * @return the <code>String</code> representation of the argument
- */
- public static String toString(int num, int radix)
- {
- if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)
- radix = 10;
-
- // For negative numbers, print out the absolute value w/ a leading '-'.
- // Use an array large enough for a binary number.
- char[] buffer = new char[33];
- int i = 33;
- boolean isNeg = false;
- if (num < 0)
- {
- isNeg = true;
- num = -num;
-
- // When the value is MIN_VALUE, it overflows when made positive
- if (num < 0)
- {
- buffer[--i] = digits[(int) (-(num + radix) % radix)];
- num = -(num / radix);
- }
- }
-
- do
- {
- buffer[--i] = digits[num % radix];
- num /= radix;
- }
- while (num > 0);
-
- if (isNeg)
- buffer[--i] = '-';
-
- // Package constructor avoids an array copy.
- return new String(buffer, i, 33 - i, true);
- }
-
- /**
- * Converts the <code>int</code> to a <code>String</code> assuming it is
- * unsigned in base 16.
- *
- * @param i the <code>int</code> to convert to <code>String</code>
- * @return the <code>String</code> representation of the argument
- */
- public static String toHexString(int i)
- {
- return toUnsignedString(i, 4);
- }
-
- /**
- * Converts the <code>int</code> to a <code>String</code> assuming it is
- * unsigned in base 8.
- *
- * @param i the <code>int</code> to convert to <code>String</code>
- * @return the <code>String</code> representation of the argument
- */
- public static String toOctalString(int i)
- {
- return toUnsignedString(i, 3);
- }
-
- /**
- * Converts the <code>int</code> to a <code>String</code> assuming it is
- * unsigned in base 2.
- *
- * @param i the <code>int</code> to convert to <code>String</code>
- * @return the <code>String</code> representation of the argument
- */
- public static String toBinaryString(int i)
- {
- return toUnsignedString(i, 1);
- }
-
- /**
- * Converts the <code>int</code> to a <code>String</code> and assumes
- * a radix of 10.
- *
- * @param i the <code>int</code> to convert to <code>String</code>
- * @return the <code>String</code> representation of the argument
- * @see #toString(int, int)
- */
- public static String toString(int i)
- {
- // This is tricky: in libgcj, String.valueOf(int) is a fast native
- // implementation. In Classpath it just calls back to
- // Integer.toString(int, int).
- return String.valueOf(i);
- }
-
- /**
- * Converts the specified <code>String</code> into an <code>int</code>
- * using the specified radix (base). The string must not be <code>null</code>
- * or empty. It may begin with an optional '-', which will negate the answer,
- * provided that there are also valid digits. Each digit is parsed as if by
- * <code>Character.digit(d, radix)</code>, and must be in the range
- * <code>0</code> to <code>radix - 1</code>. Finally, the result must be
- * within <code>MIN_VALUE</code> to <code>MAX_VALUE</code>, inclusive.
- * Unlike Double.parseDouble, you may not have a leading '+'.
- *
- * @param str the <code>String</code> to convert
- * @param radix the radix (base) to use in the conversion
- * @return the <code>String</code> argument converted to <code>int</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as an
- * <code>int</code>
- */
- public static int parseInt(String str, int radix)
- {
- return parseInt(str, radix, false);
- }
-
- /**
- * Converts the specified <code>String</code> into an <code>int</code>.
- * This function assumes a radix of 10.
- *
- * @param s the <code>String</code> to convert
- * @return the <code>int</code> value of <code>s</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as an
- * <code>int</code>
- * @see #parseInt(String, int)
- */
- public static int parseInt(String s)
- {
- return parseInt(s, 10, false);
- }
-
- /**
- * Creates a new <code>Integer</code> object using the <code>String</code>
- * and specified radix (base).
- *
- * @param s the <code>String</code> to convert
- * @param radix the radix (base) to convert with
- * @return the new <code>Integer</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as an
- * <code>int</code>
- * @see #parseInt(String, int)
- */
- public static Integer valueOf(String s, int radix)
- {
- return new Integer(parseInt(s, radix, false));
- }
-
- /**
- * Creates a new <code>Integer</code> object using the <code>String</code>,
- * assuming a radix of 10.
- *
- * @param s the <code>String</code> to convert
- * @return the new <code>Integer</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as an
- * <code>int</code>
- * @see #Integer(String)
- * @see #parseInt(String)
- */
- public static Integer valueOf(String s)
- {
- return new Integer(parseInt(s, 10, false));
- }
-
- /**
- * Return the value of this <code>Integer</code> as a <code>byte</code>.
- *
- * @return the byte value
- */
- public byte byteValue()
- {
- return (byte) value;
- }
-
- /**
- * Return the value of this <code>Integer</code> as a <code>short</code>.
- *
- * @return the short value
- */
- public short shortValue()
- {
- return (short) value;
- }
-
- /**
- * Return the value of this <code>Integer</code>.
- * @return the int value
- */
- public int intValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Integer</code> as a <code>long</code>.
- *
- * @return the long value
- */
- public long longValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Integer</code> as a <code>float</code>.
- *
- * @return the float value
- */
- public float floatValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Integer</code> as a <code>double</code>.
- *
- * @return the double value
- */
- public double doubleValue()
- {
- return value;
- }
-
- /**
- * Converts the <code>Integer</code> value to a <code>String</code> and
- * assumes a radix of 10.
- *
- * @return the <code>String</code> representation
- */
- public String toString()
- {
- return String.valueOf(value);
- }
-
- /**
- * Return a hashcode representing this Object. <code>Integer</code>'s hash
- * code is simply its value.
- *
- * @return this Object's hash code
- */
- public int hashCode()
- {
- return value;
- }
-
- /**
- * Returns <code>true</code> if <code>obj</code> is an instance of
- * <code>Integer</code> and represents the same int value.
- *
- * @param obj the object to compare
- * @return whether these Objects are semantically equal
- */
- public boolean equals(Object obj)
- {
- return obj instanceof Integer && value == ((Integer) obj).value;
- }
-
- /**
- * Get the specified system property as an <code>Integer</code>. The
- * <code>decode()</code> method will be used to interpret the value of
- * the property.
- *
- * @param nm the name of the system property
- * @return the system property as an <code>Integer</code>, or null if the
- * property is not found or cannot be decoded
- * @throws SecurityException if accessing the system property is forbidden
- * @see System#getProperty(String)
- * @see #decode(String)
- */
- public static Integer getInteger(String nm)
- {
- return getInteger(nm, null);
- }
-
- /**
- * Get the specified system property as an <code>Integer</code>, or use a
- * default <code>int</code> value if the property is not found or is not
- * decodable. The <code>decode()</code> method will be used to interpret
- * the value of the property.
- *
- * @param nm the name of the system property
- * @param val the default value
- * @return the value of the system property, or the default
- * @throws SecurityException if accessing the system property is forbidden
- * @see System#getProperty(String)
- * @see #decode(String)
- */
- public static Integer getInteger(String nm, int val)
- {
- Integer result = getInteger(nm, null);
- return result == null ? new Integer(val) : result;
- }
-
- /**
- * Get the specified system property as an <code>Integer</code>, or use a
- * default <code>Integer</code> value if the property is not found or is
- * not decodable. The <code>decode()</code> method will be used to
- * interpret the value of the property.
- *
- * @param nm the name of the system property
- * @param def the default value
- * @return the value of the system property, or the default
- * @throws SecurityException if accessing the system property is forbidden
- * @see System#getProperty(String)
- * @see #decode(String)
- */
- public static Integer getInteger(String nm, Integer def)
- {
- if (nm == null || "".equals(nm))
- return def;
- nm = System.getProperty(nm);
- if (nm == null)
- return def;
- try
- {
- return decode(nm);
- }
- catch (NumberFormatException e)
- {
- return def;
- }
- }
-
- /**
- * Convert the specified <code>String</code> into an <code>Integer</code>.
- * The <code>String</code> may represent decimal, hexadecimal, or
- * octal numbers.
- *
- * <p>The extended BNF grammar is as follows:<br>
- * <pre>
- * <em>DecodableString</em>:
- * ( [ <code>-</code> ] <em>DecimalNumber</em> )
- * | ( [ <code>-</code> ] ( <code>0x</code> | <code>0X</code>
- * | <code>#</code> ) <em>HexDigit</em> { <em>HexDigit</em> } )
- * | ( [ <code>-</code> ] <code>0</code> { <em>OctalDigit</em> } )
- * <em>DecimalNumber</em>:
- * <em>DecimalDigit except '0'</em> { <em>DecimalDigit</em> }
- * <em>DecimalDigit</em>:
- * <em>Character.digit(d, 10) has value 0 to 9</em>
- * <em>OctalDigit</em>:
- * <em>Character.digit(d, 8) has value 0 to 7</em>
- * <em>DecimalDigit</em>:
- * <em>Character.digit(d, 16) has value 0 to 15</em>
- * </pre>
- * Finally, the value must be in the range <code>MIN_VALUE</code> to
- * <code>MAX_VALUE</code>, or an exception is thrown.
- *
- * @param str the <code>String</code> to interpret
- * @return the value of the String as an <code>Integer</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>int</code>
- * @throws NullPointerException if <code>s</code> is null
- * @since 1.2
- */
- public static Integer decode(String str)
- {
- return new Integer(parseInt(str, 10, true));
- }
-
- /**
- * Compare two Integers numerically by comparing their <code>int</code>
- * values. The result is positive if the first is greater, negative if the
- * second is greater, and 0 if the two are equal.
- *
- * @param i the Integer to compare
- * @return the comparison
- * @since 1.2
- */
- public int compareTo(Integer i)
- {
- if (value == i.value)
- return 0;
- // Returns just -1 or 1 on inequality; doing math might overflow.
- return value > i.value ? 1 : -1;
- }
-
- /**
- * Behaves like <code>compareTo(Integer)</code> unless the Object
- * is not an <code>Integer</code>.
- *
- * @param o the object to compare
- * @return the comparison
- * @throws ClassCastException if the argument is not an <code>Integer</code>
- * @see #compareTo(Integer)
- * @see Comparable
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compareTo((Integer) o);
- }
-
- /**
- * Helper for converting unsigned numbers to String.
- *
- * @param num the number
- * @param exp log2(digit) (ie. 1, 3, or 4 for binary, oct, hex)
- */
- // Package visible for use by Long.
- static String toUnsignedString(int num, int exp)
- {
- // Use an array large enough for a binary number.
- int mask = (1 << exp) - 1;
- char[] buffer = new char[32];
- int i = 32;
- do
- {
- buffer[--i] = digits[num & mask];
- num >>>= exp;
- }
- while (num != 0);
-
- // Package constructor avoids an array copy.
- return new String(buffer, i, 32 - i, true);
- }
-
- /**
- * Helper for parsing ints, used by Integer, Short, and Byte.
- *
- * @param str the string to parse
- * @param radix the radix to use, must be 10 if decode is true
- * @param decode if called from decode
- * @return the parsed int value
- * @throws NumberFormatException if there is an error
- * @throws NullPointerException if decode is true and str if null
- * @see #parseInt(String, int)
- * @see #decode(String)
- * @see Byte#parseInt(String, int)
- * @see Short#parseInt(String, int)
- */
- static int parseInt(String str, int radix, boolean decode)
- {
- if (! decode && str == null)
- throw new NumberFormatException();
- int index = 0;
- int len = str.length();
- boolean isNeg = false;
- if (len == 0)
- throw new NumberFormatException();
- int ch = str.charAt(index);
- if (ch == '-')
- {
- if (len == 1)
- throw new NumberFormatException();
- isNeg = true;
- ch = str.charAt(++index);
- }
- if (decode)
- {
- if (ch == '0')
- {
- if (++index == len)
- return 0;
- if ((str.charAt(index) & ~('x' ^ 'X')) == 'X')
- {
- radix = 16;
- index++;
- }
- else
- radix = 8;
- }
- else if (ch == '#')
- {
- radix = 16;
- index++;
- }
- }
- if (index == len)
- throw new NumberFormatException();
-
- int max = MAX_VALUE / radix;
- // We can't directly write `max = (MAX_VALUE + 1) / radix'.
- // So instead we fake it.
- if (isNeg && MAX_VALUE % radix == radix - 1)
- ++max;
-
- int val = 0;
- while (index < len)
- {
- if (val < 0 || val > max)
- throw new NumberFormatException();
-
- ch = Character.digit(str.charAt(index++), radix);
- val = val * radix + ch;
- if (ch < 0 || (val < 0 && (! isNeg || val != MIN_VALUE)))
- throw new NumberFormatException();
- }
- return isNeg ? -val : val;
- }
-}
diff --git a/libjava/java/lang/InternalError.java b/libjava/java/lang/InternalError.java
deleted file mode 100644
index 3a95bbeaf57..00000000000
--- a/libjava/java/lang/InternalError.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* InternalError.java -- thrown when the VM encounters an internal error
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * An <code>InternalError</code> is thrown when a mystical error has
- * occurred in the Java Virtual Machine.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class InternalError extends VirtualMachineError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -9062593416125562365L;
-
- /**
- * Create an error without a message.
- */
- public InternalError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public InternalError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/InterruptedException.java b/libjava/java/lang/InterruptedException.java
deleted file mode 100644
index da2173c8b4e..00000000000
--- a/libjava/java/lang/InterruptedException.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* InterruptedException.java -- thrown when a thread is interrupted
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when a thread interrupts another thread which was previously
- * sleeping, waiting, or paused in some other way. See the
- * <code>interrupt</code> method of class <code>Thread</code>.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @see Object#wait()
- * @see Object#wait(long)
- * @see Object#wait(long, int)
- * @see Thread#sleep(long)
- * @see Thread#interrupt()
- * @see Thread#interrupted()
- * @status updated to 1.4
- */
-public class InterruptedException extends Exception
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 6700697376100628473L;
-
- /**
- * Create an exception without a message.
- */
- public InterruptedException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- *
- * @param s the message
- */
- public InterruptedException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/LinkageError.java b/libjava/java/lang/LinkageError.java
deleted file mode 100644
index 028702081ba..00000000000
--- a/libjava/java/lang/LinkageError.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* LinkageError.java -- thrown when classes valid at separate compile times
- cannot be linked to each other
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Subclasses of <code>LinkageError</code> are thrown to indicate that two
- * classes which were compatible at separate compilation times cannot be
- * linked to one another.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class LinkageError extends Error
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 3579600108157160122L;
-
- /**
- * Create an error without a message.
- */
- public LinkageError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public LinkageError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/Long.java b/libjava/java/lang/Long.java
deleted file mode 100644
index 703eab8a0f3..00000000000
--- a/libjava/java/lang/Long.java
+++ /dev/null
@@ -1,614 +0,0 @@
-/* Long.java -- object wrapper for long
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Instances of class <code>Long</code> represent primitive
- * <code>long</code> values.
- *
- * Additionally, this class provides various helper functions and variables
- * related to longs.
- *
- * @author Paul Fisher
- * @author John Keiser
- * @author Warren Levy
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status updated to 1.4
- */
-public final class Long extends Number implements Comparable
-{
- /**
- * Compatible with JDK 1.0.2+.
- */
- private static final long serialVersionUID = 4290774380558885855L;
-
- /**
- * The minimum value a <code>long</code> can represent is
- * -9223372036854775808L (or -2<sup>63</sup>).
- */
- public static final long MIN_VALUE = 0x8000000000000000L;
-
- /**
- * The maximum value a <code>long</code> can represent is
- * 9223372036854775807 (or 2<sup>63</sup> - 1).
- */
- public static final long MAX_VALUE = 0x7fffffffffffffffL;
-
- /**
- * The primitive type <code>long</code> is represented by this
- * <code>Class</code> object.
- * @since 1.1
- */
- public static final Class TYPE = VMClassLoader.getPrimitiveClass ('J');
-
- /**
- * The immutable value of this Long.
- *
- * @serial the wrapped long
- */
- private final long value;
-
- /**
- * Create a <code>Long</code> object representing the value of the
- * <code>long</code> argument.
- *
- * @param value the value to use
- */
- public Long(long value)
- {
- this.value = value;
- }
-
- /**
- * Create a <code>Long</code> object representing the value of the
- * argument after conversion to a <code>long</code>.
- *
- * @param s the string to convert
- * @throws NumberFormatException if the String does not contain a long
- * @see #valueOf(String)
- */
- public Long(String s)
- {
- value = parseLong(s, 10, false);
- }
-
- /**
- * Converts the <code>long</code> to a <code>String</code> using
- * the specified radix (base). If the radix exceeds
- * <code>Character.MIN_RADIX</code> or <code>Character.MAX_RADIX</code>, 10
- * is used instead. If the result is negative, the leading character is
- * '-' ('\\u002D'). The remaining characters come from
- * <code>Character.forDigit(digit, radix)</code> ('0'-'9','a'-'z').
- *
- * @param num the <code>long</code> to convert to <code>String</code>
- * @param radix the radix (base) to use in the conversion
- * @return the <code>String</code> representation of the argument
- */
- public static String toString(long num, int radix)
- {
- // Use the Integer toString for efficiency if possible.
- if ((int) num == num)
- return Integer.toString((int) num, radix);
-
- if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)
- radix = 10;
-
- // For negative numbers, print out the absolute value w/ a leading '-'.
- // Use an array large enough for a binary number.
- char[] buffer = new char[65];
- int i = 65;
- boolean isNeg = false;
- if (num < 0)
- {
- isNeg = true;
- num = -num;
-
- // When the value is MIN_VALUE, it overflows when made positive
- if (num < 0)
- {
- buffer[--i] = digits[(int) (-(num + radix) % radix)];
- num = -(num / radix);
- }
- }
-
- do
- {
- buffer[--i] = digits[(int) (num % radix)];
- num /= radix;
- }
- while (num > 0);
-
- if (isNeg)
- buffer[--i] = '-';
-
- // Package constructor avoids an array copy.
- return new String(buffer, i, 65 - i, true);
- }
-
- /**
- * Converts the <code>long</code> to a <code>String</code> assuming it is
- * unsigned in base 16.
- *
- * @param l the <code>long</code> to convert to <code>String</code>
- * @return the <code>String</code> representation of the argument
- */
- public static String toHexString(long l)
- {
- return toUnsignedString(l, 4);
- }
-
- /**
- * Converts the <code>long</code> to a <code>String</code> assuming it is
- * unsigned in base 8.
- *
- * @param l the <code>long</code> to convert to <code>String</code>
- * @return the <code>String</code> representation of the argument
- */
- public static String toOctalString(long l)
- {
- return toUnsignedString(l, 3);
- }
-
- /**
- * Converts the <code>long</code> to a <code>String</code> assuming it is
- * unsigned in base 2.
- *
- * @param l the <code>long</code> to convert to <code>String</code>
- * @return the <code>String</code> representation of the argument
- */
- public static String toBinaryString(long l)
- {
- return toUnsignedString(l, 1);
- }
-
- /**
- * Converts the <code>long</code> to a <code>String</code> and assumes
- * a radix of 10.
- *
- * @param num the <code>long</code> to convert to <code>String</code>
- * @return the <code>String</code> representation of the argument
- * @see #toString(long, int)
- */
- public static String toString(long num)
- {
- return toString(num, 10);
- }
-
- /**
- * Converts the specified <code>String</code> into an <code>int</code>
- * using the specified radix (base). The string must not be <code>null</code>
- * or empty. It may begin with an optional '-', which will negate the answer,
- * provided that there are also valid digits. Each digit is parsed as if by
- * <code>Character.digit(d, radix)</code>, and must be in the range
- * <code>0</code> to <code>radix - 1</code>. Finally, the result must be
- * within <code>MIN_VALUE</code> to <code>MAX_VALUE</code>, inclusive.
- * Unlike Double.parseDouble, you may not have a leading '+'; and 'l' or
- * 'L' as the last character is only valid in radices 22 or greater, where
- * it is a digit and not a type indicator.
- *
- * @param str the <code>String</code> to convert
- * @param radix the radix (base) to use in the conversion
- * @return the <code>String</code> argument converted to <code>long</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>long</code>
- */
- public static long parseLong(String str, int radix)
- {
- return parseLong(str, radix, false);
- }
-
- /**
- * Converts the specified <code>String</code> into a <code>long</code>.
- * This function assumes a radix of 10.
- *
- * @param s the <code>String</code> to convert
- * @return the <code>int</code> value of <code>s</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>long</code>
- * @see #parseLong(String, int)
- */
- public static long parseLong(String s)
- {
- return parseLong(s, 10, false);
- }
-
- /**
- * Creates a new <code>Long</code> object using the <code>String</code>
- * and specified radix (base).
- *
- * @param s the <code>String</code> to convert
- * @param radix the radix (base) to convert with
- * @return the new <code>Long</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>long</code>
- * @see #parseLong(String, int)
- */
- public static Long valueOf(String s, int radix)
- {
- return new Long(parseLong(s, radix, false));
- }
-
- /**
- * Creates a new <code>Long</code> object using the <code>String</code>,
- * assuming a radix of 10.
- *
- * @param s the <code>String</code> to convert
- * @return the new <code>Long</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>long</code>
- * @see #Long(String)
- * @see #parseLong(String)
- */
- public static Long valueOf(String s)
- {
- return new Long(parseLong(s, 10, false));
- }
-
- /**
- * Convert the specified <code>String</code> into a <code>Long</code>.
- * The <code>String</code> may represent decimal, hexadecimal, or
- * octal numbers.
- *
- * <p>The extended BNF grammar is as follows:<br>
- * <pre>
- * <em>DecodableString</em>:
- * ( [ <code>-</code> ] <em>DecimalNumber</em> )
- * | ( [ <code>-</code> ] ( <code>0x</code> | <code>0X</code>
- * | <code>#</code> ) <em>HexDigit</em> { <em>HexDigit</em> } )
- * | ( [ <code>-</code> ] <code>0</code> { <em>OctalDigit</em> } )
- * <em>DecimalNumber</em>:
- * <em>DecimalDigit except '0'</em> { <em>DecimalDigit</em> }
- * <em>DecimalDigit</em>:
- * <em>Character.digit(d, 10) has value 0 to 9</em>
- * <em>OctalDigit</em>:
- * <em>Character.digit(d, 8) has value 0 to 7</em>
- * <em>DecimalDigit</em>:
- * <em>Character.digit(d, 16) has value 0 to 15</em>
- * </pre>
- * Finally, the value must be in the range <code>MIN_VALUE</code> to
- * <code>MAX_VALUE</code>, or an exception is thrown. Note that you cannot
- * use a trailing 'l' or 'L', unlike in Java source code.
- *
- * @param str the <code>String</code> to interpret
- * @return the value of the String as a <code>Long</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>long</code>
- * @throws NullPointerException if <code>s</code> is null
- * @since 1.2
- */
- public static Long decode(String str)
- {
- return new Long(parseLong(str, 10, true));
- }
-
- /**
- * Return the value of this <code>Long</code> as a <code>byte</code>.
- *
- * @return the byte value
- */
- public byte byteValue()
- {
- return (byte) value;
- }
-
- /**
- * Return the value of this <code>Long</code> as a <code>short</code>.
- *
- * @return the short value
- */
- public short shortValue()
- {
- return (short) value;
- }
-
- /**
- * Return the value of this <code>Long</code> as an <code>int</code>.
- *
- * @return the int value
- */
- public int intValue()
- {
- return (int) value;
- }
-
- /**
- * Return the value of this <code>Long</code>.
- *
- * @return the long value
- */
- public long longValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Long</code> as a <code>float</code>.
- *
- * @return the float value
- */
- public float floatValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Long</code> as a <code>double</code>.
- *
- * @return the double value
- */
- public double doubleValue()
- {
- return value;
- }
-
- /**
- * Converts the <code>Long</code> value to a <code>String</code> and
- * assumes a radix of 10.
- *
- * @return the <code>String</code> representation
- */
- public String toString()
- {
- return toString(value, 10);
- }
-
- /**
- * Return a hashcode representing this Object. <code>Long</code>'s hash
- * code is calculated by <code>(int) (value ^ (value &gt;&gt; 32))</code>.
- *
- * @return this Object's hash code
- */
- public int hashCode()
- {
- return (int) (value ^ (value >>> 32));
- }
-
- /**
- * Returns <code>true</code> if <code>obj</code> is an instance of
- * <code>Long</code> and represents the same long value.
- *
- * @param obj the object to compare
- * @return whether these Objects are semantically equal
- */
- public boolean equals(Object obj)
- {
- return obj instanceof Long && value == ((Long) obj).value;
- }
-
- /**
- * Get the specified system property as a <code>Long</code>. The
- * <code>decode()</code> method will be used to interpret the value of
- * the property.
- *
- * @param nm the name of the system property
- * @return the system property as a <code>Long</code>, or null if the
- * property is not found or cannot be decoded
- * @throws SecurityException if accessing the system property is forbidden
- * @see System#getProperty(String)
- * @see #decode(String)
- */
- public static Long getLong(String nm)
- {
- return getLong(nm, null);
- }
-
- /**
- * Get the specified system property as a <code>Long</code>, or use a
- * default <code>long</code> value if the property is not found or is not
- * decodable. The <code>decode()</code> method will be used to interpret
- * the value of the property.
- *
- * @param nm the name of the system property
- * @param val the default value
- * @return the value of the system property, or the default
- * @throws SecurityException if accessing the system property is forbidden
- * @see System#getProperty(String)
- * @see #decode(String)
- */
- public static Long getLong(String nm, long val)
- {
- Long result = getLong(nm, null);
- return result == null ? new Long(val) : result;
- }
-
- /**
- * Get the specified system property as a <code>Long</code>, or use a
- * default <code>Long</code> value if the property is not found or is
- * not decodable. The <code>decode()</code> method will be used to
- * interpret the value of the property.
- *
- * @param nm the name of the system property
- * @param def the default value
- * @return the value of the system property, or the default
- * @throws SecurityException if accessing the system property is forbidden
- * @see System#getProperty(String)
- * @see #decode(String)
- */
- public static Long getLong(String nm, Long def)
- {
- if (nm == null || "".equals(nm))
- return def;
- nm = System.getProperty(nm);
- if (nm == null)
- return def;
- try
- {
- return decode(nm);
- }
- catch (NumberFormatException e)
- {
- return def;
- }
- }
-
- /**
- * Compare two Longs numerically by comparing their <code>long</code>
- * values. The result is positive if the first is greater, negative if the
- * second is greater, and 0 if the two are equal.
- *
- * @param l the Long to compare
- * @return the comparison
- * @since 1.2
- */
- public int compareTo(Long l)
- {
- if (value == l.value)
- return 0;
- // Returns just -1 or 1 on inequality; doing math might overflow the long.
- return value > l.value ? 1 : -1;
- }
-
- /**
- * Behaves like <code>compareTo(Long)</code> unless the Object
- * is not a <code>Long</code>.
- *
- * @param o the object to compare
- * @return the comparison
- * @throws ClassCastException if the argument is not a <code>Long</code>
- * @see #compareTo(Long)
- * @see Comparable
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compareTo((Long) o);
- }
-
- /**
- * Helper for converting unsigned numbers to String.
- *
- * @param num the number
- * @param exp log2(digit) (ie. 1, 3, or 4 for binary, oct, hex)
- */
- private static String toUnsignedString(long num, int exp)
- {
- // Use the Integer toUnsignedString for efficiency if possible.
- // If NUM<0 then this particular optimization doesn't work
- // properly.
- if (num >= 0 && (int) num == num)
- return Integer.toUnsignedString((int) num, exp);
-
- // Use an array large enough for a binary number.
- int mask = (1 << exp) - 1;
- char[] buffer = new char[64];
- int i = 64;
- do
- {
- buffer[--i] = digits[(int) num & mask];
- num >>>= exp;
- }
- while (num != 0);
-
- // Package constructor avoids an array copy.
- return new String(buffer, i, 64 - i, true);
- }
-
- /**
- * Helper for parsing longs.
- *
- * @param str the string to parse
- * @param radix the radix to use, must be 10 if decode is true
- * @param decode if called from decode
- * @return the parsed long value
- * @throws NumberFormatException if there is an error
- * @throws NullPointerException if decode is true and str is null
- * @see #parseLong(String, int)
- * @see #decode(String)
- */
- private static long parseLong(String str, int radix, boolean decode)
- {
- if (! decode && str == null)
- throw new NumberFormatException();
- int index = 0;
- int len = str.length();
- boolean isNeg = false;
- if (len == 0)
- throw new NumberFormatException();
- int ch = str.charAt(index);
- if (ch == '-')
- {
- if (len == 1)
- throw new NumberFormatException();
- isNeg = true;
- ch = str.charAt(++index);
- }
- if (decode)
- {
- if (ch == '0')
- {
- if (++index == len)
- return 0;
- if ((str.charAt(index) & ~('x' ^ 'X')) == 'X')
- {
- radix = 16;
- index++;
- }
- else
- radix = 8;
- }
- else if (ch == '#')
- {
- radix = 16;
- index++;
- }
- }
- if (index == len)
- throw new NumberFormatException();
-
- long max = MAX_VALUE / radix;
- // We can't directly write `max = (MAX_VALUE + 1) / radix'.
- // So instead we fake it.
- if (isNeg && MAX_VALUE % radix == radix - 1)
- ++max;
-
- long val = 0;
- while (index < len)
- {
- if (val < 0 || val > max)
- throw new NumberFormatException();
-
- ch = Character.digit(str.charAt(index++), radix);
- val = val * radix + ch;
- if (ch < 0 || (val < 0 && (! isNeg || val != MIN_VALUE)))
- throw new NumberFormatException();
- }
- return isNeg ? -val : val;
- }
-}
diff --git a/libjava/java/lang/Math.java b/libjava/java/lang/Math.java
deleted file mode 100644
index 08081e2523a..00000000000
--- a/libjava/java/lang/Math.java
+++ /dev/null
@@ -1,650 +0,0 @@
-/* java.lang.Math -- common mathematical functions, native allowed
- Copyright (C) 1998, 2001, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-import gnu.classpath.Configuration;
-
-import java.util.Random;
-
-/**
- * Helper class containing useful mathematical functions and constants.
- * <P>
- *
- * Note that angles are specified in radians. Conversion functions are
- * provided for your convenience.
- *
- * @author Paul Fisher
- * @author John Keiser
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- */
-public final class Math
-{
- /**
- * Math is non-instantiable
- */
- private Math()
- {
- }
-
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary("javalang");
- }
- }
-
- /**
- * A random number generator, initialized on first use.
- */
- private static Random rand;
-
- /**
- * The most accurate approximation to the mathematical constant <em>e</em>:
- * <code>2.718281828459045</code>. Used in natural log and exp.
- *
- * @see #log(double)
- * @see #exp(double)
- */
- public static final double E = 2.718281828459045;
-
- /**
- * The most accurate approximation to the mathematical constant <em>pi</em>:
- * <code>3.141592653589793</code>. This is the ratio of a circle's diameter
- * to its circumference.
- */
- public static final double PI = 3.141592653589793;
-
- /**
- * Take the absolute value of the argument.
- * (Absolute value means make it positive.)
- * <P>
- *
- * Note that the the largest negative value (Integer.MIN_VALUE) cannot
- * be made positive. In this case, because of the rules of negation in
- * a computer, MIN_VALUE is what will be returned.
- * This is a <em>negative</em> value. You have been warned.
- *
- * @param i the number to take the absolute value of
- * @return the absolute value
- * @see Integer#MIN_VALUE
- */
- public static int abs(int i)
- {
- return (i < 0) ? -i : i;
- }
-
- /**
- * Take the absolute value of the argument.
- * (Absolute value means make it positive.)
- * <P>
- *
- * Note that the the largest negative value (Long.MIN_VALUE) cannot
- * be made positive. In this case, because of the rules of negation in
- * a computer, MIN_VALUE is what will be returned.
- * This is a <em>negative</em> value. You have been warned.
- *
- * @param l the number to take the absolute value of
- * @return the absolute value
- * @see Long#MIN_VALUE
- */
- public static long abs(long l)
- {
- return (l < 0) ? -l : l;
- }
-
- /**
- * Take the absolute value of the argument.
- * (Absolute value means make it positive.)
- * <P>
- *
- * This is equivalent, but faster than, calling
- * <code>Float.intBitsToFloat(0x7fffffff & Float.floatToIntBits(a))</code>.
- *
- * @param f the number to take the absolute value of
- * @return the absolute value
- */
- public static float abs(float f)
- {
- return (f <= 0) ? 0 - f : f;
- }
-
- /**
- * Take the absolute value of the argument.
- * (Absolute value means make it positive.)
- *
- * This is equivalent, but faster than, calling
- * <code>Double.longBitsToDouble(Double.doubleToLongBits(a)
- * &lt;&lt; 1) &gt;&gt;&gt; 1);</code>.
- *
- * @param d the number to take the absolute value of
- * @return the absolute value
- */
- public static double abs(double d)
- {
- return (d <= 0) ? 0 - d : d;
- }
-
- /**
- * Return whichever argument is smaller.
- *
- * @param a the first number
- * @param b a second number
- * @return the smaller of the two numbers
- */
- public static int min(int a, int b)
- {
- return (a < b) ? a : b;
- }
-
- /**
- * Return whichever argument is smaller.
- *
- * @param a the first number
- * @param b a second number
- * @return the smaller of the two numbers
- */
- public static long min(long a, long b)
- {
- return (a < b) ? a : b;
- }
-
- /**
- * Return whichever argument is smaller. If either argument is NaN, the
- * result is NaN, and when comparing 0 and -0, -0 is always smaller.
- *
- * @param a the first number
- * @param b a second number
- * @return the smaller of the two numbers
- */
- public static float min(float a, float b)
- {
- // this check for NaN, from JLS 15.21.1, saves a method call
- if (a != a)
- return a;
- // no need to check if b is NaN; < will work correctly
- // recall that -0.0 == 0.0, but [+-]0.0 - [+-]0.0 behaves special
- if (a == 0 && b == 0)
- return -(-a - b);
- return (a < b) ? a : b;
- }
-
- /**
- * Return whichever argument is smaller. If either argument is NaN, the
- * result is NaN, and when comparing 0 and -0, -0 is always smaller.
- *
- * @param a the first number
- * @param b a second number
- * @return the smaller of the two numbers
- */
- public static double min(double a, double b)
- {
- // this check for NaN, from JLS 15.21.1, saves a method call
- if (a != a)
- return a;
- // no need to check if b is NaN; < will work correctly
- // recall that -0.0 == 0.0, but [+-]0.0 - [+-]0.0 behaves special
- if (a == 0 && b == 0)
- return -(-a - b);
- return (a < b) ? a : b;
- }
-
- /**
- * Return whichever argument is larger.
- *
- * @param a the first number
- * @param b a second number
- * @return the larger of the two numbers
- */
- public static int max(int a, int b)
- {
- return (a > b) ? a : b;
- }
-
- /**
- * Return whichever argument is larger.
- *
- * @param a the first number
- * @param b a second number
- * @return the larger of the two numbers
- */
- public static long max(long a, long b)
- {
- return (a > b) ? a : b;
- }
-
- /**
- * Return whichever argument is larger. If either argument is NaN, the
- * result is NaN, and when comparing 0 and -0, 0 is always larger.
- *
- * @param a the first number
- * @param b a second number
- * @return the larger of the two numbers
- */
- public static float max(float a, float b)
- {
- // this check for NaN, from JLS 15.21.1, saves a method call
- if (a != a)
- return a;
- // no need to check if b is NaN; > will work correctly
- // recall that -0.0 == 0.0, but [+-]0.0 - [+-]0.0 behaves special
- if (a == 0 && b == 0)
- return a - -b;
- return (a > b) ? a : b;
- }
-
- /**
- * Return whichever argument is larger. If either argument is NaN, the
- * result is NaN, and when comparing 0 and -0, 0 is always larger.
- *
- * @param a the first number
- * @param b a second number
- * @return the larger of the two numbers
- */
- public static double max(double a, double b)
- {
- // this check for NaN, from JLS 15.21.1, saves a method call
- if (a != a)
- return a;
- // no need to check if b is NaN; > will work correctly
- // recall that -0.0 == 0.0, but [+-]0.0 - [+-]0.0 behaves special
- if (a == 0 && b == 0)
- return a - -b;
- return (a > b) ? a : b;
- }
-
- /**
- * The trigonometric function <em>sin</em>. The sine of NaN or infinity is
- * NaN, and the sine of 0 retains its sign. This is accurate within 1 ulp,
- * and is semi-monotonic.
- *
- * @param a the angle (in radians)
- * @return sin(a)
- */
- public static native double sin(double a);
-
- /**
- * The trigonometric function <em>cos</em>. The cosine of NaN or infinity is
- * NaN. This is accurate within 1 ulp, and is semi-monotonic.
- *
- * @param a the angle (in radians)
- * @return cos(a)
- */
- public static native double cos(double a);
-
- /**
- * The trigonometric function <em>tan</em>. The tangent of NaN or infinity
- * is NaN, and the tangent of 0 retains its sign. This is accurate within 1
- * ulp, and is semi-monotonic.
- *
- * @param a the angle (in radians)
- * @return tan(a)
- */
- public static native double tan(double a);
-
- /**
- * The trigonometric function <em>arcsin</em>. The range of angles returned
- * is -pi/2 to pi/2 radians (-90 to 90 degrees). If the argument is NaN or
- * its absolute value is beyond 1, the result is NaN; and the arcsine of
- * 0 retains its sign. This is accurate within 1 ulp, and is semi-monotonic.
- *
- * @param a the sin to turn back into an angle
- * @return arcsin(a)
- */
- public static native double asin(double a);
-
- /**
- * The trigonometric function <em>arccos</em>. The range of angles returned
- * is 0 to pi radians (0 to 180 degrees). If the argument is NaN or
- * its absolute value is beyond 1, the result is NaN. This is accurate
- * within 1 ulp, and is semi-monotonic.
- *
- * @param a the cos to turn back into an angle
- * @return arccos(a)
- */
- public static native double acos(double a);
-
- /**
- * The trigonometric function <em>arcsin</em>. The range of angles returned
- * is -pi/2 to pi/2 radians (-90 to 90 degrees). If the argument is NaN, the
- * result is NaN; and the arctangent of 0 retains its sign. This is accurate
- * within 1 ulp, and is semi-monotonic.
- *
- * @param a the tan to turn back into an angle
- * @return arcsin(a)
- * @see #atan2(double, double)
- */
- public static native double atan(double a);
-
- /**
- * A special version of the trigonometric function <em>arctan</em>, for
- * converting rectangular coordinates <em>(x, y)</em> to polar
- * <em>(r, theta)</em>. This computes the arctangent of x/y in the range
- * of -pi to pi radians (-180 to 180 degrees). Special cases:<ul>
- * <li>If either argument is NaN, the result is NaN.</li>
- * <li>If the first argument is positive zero and the second argument is
- * positive, or the first argument is positive and finite and the second
- * argument is positive infinity, then the result is positive zero.</li>
- * <li>If the first argument is negative zero and the second argument is
- * positive, or the first argument is negative and finite and the second
- * argument is positive infinity, then the result is negative zero.</li>
- * <li>If the first argument is positive zero and the second argument is
- * negative, or the first argument is positive and finite and the second
- * argument is negative infinity, then the result is the double value
- * closest to pi.</li>
- * <li>If the first argument is negative zero and the second argument is
- * negative, or the first argument is negative and finite and the second
- * argument is negative infinity, then the result is the double value
- * closest to -pi.</li>
- * <li>If the first argument is positive and the second argument is
- * positive zero or negative zero, or the first argument is positive
- * infinity and the second argument is finite, then the result is the
- * double value closest to pi/2.</li>
- * <li>If the first argument is negative and the second argument is
- * positive zero or negative zero, or the first argument is negative
- * infinity and the second argument is finite, then the result is the
- * double value closest to -pi/2.</li>
- * <li>If both arguments are positive infinity, then the result is the
- * double value closest to pi/4.</li>
- * <li>If the first argument is positive infinity and the second argument
- * is negative infinity, then the result is the double value closest to
- * 3*pi/4.</li>
- * <li>If the first argument is negative infinity and the second argument
- * is positive infinity, then the result is the double value closest to
- * -pi/4.</li>
- * <li>If both arguments are negative infinity, then the result is the
- * double value closest to -3*pi/4.</li>
- *
- * </ul><p>This is accurate within 2 ulps, and is semi-monotonic. To get r,
- * use sqrt(x*x+y*y).
- *
- * @param y the y position
- * @param x the x position
- * @return <em>theta</em> in the conversion of (x, y) to (r, theta)
- * @see #atan(double)
- */
- public static native double atan2(double y, double x);
-
- /**
- * Take <em>e</em><sup>a</sup>. The opposite of <code>log()</code>. If the
- * argument is NaN, the result is NaN; if the argument is positive infinity,
- * the result is positive infinity; and if the argument is negative
- * infinity, the result is positive zero. This is accurate within 1 ulp,
- * and is semi-monotonic.
- *
- * @param a the number to raise to the power
- * @return the number raised to the power of <em>e</em>
- * @see #log(double)
- * @see #pow(double, double)
- */
- public static native double exp(double a);
-
- /**
- * Take ln(a) (the natural log). The opposite of <code>exp()</code>. If the
- * argument is NaN or negative, the result is NaN; if the argument is
- * positive infinity, the result is positive infinity; and if the argument
- * is either zero, the result is negative infinity. This is accurate within
- * 1 ulp, and is semi-monotonic.
- *
- * <p>Note that the way to get log<sub>b</sub>(a) is to do this:
- * <code>ln(a) / ln(b)</code>.
- *
- * @param a the number to take the natural log of
- * @return the natural log of <code>a</code>
- * @see #exp(double)
- */
- public static native double log(double a);
-
- /**
- * Take a square root. If the argument is NaN or negative, the result is
- * NaN; if the argument is positive infinity, the result is positive
- * infinity; and if the result is either zero, the result is the same.
- * This is accurate within the limits of doubles.
- *
- * <p>For other roots, use pow(a, 1 / rootNumber).
- *
- * @param a the numeric argument
- * @return the square root of the argument
- * @see #pow(double, double)
- */
- public static native double sqrt(double a);
-
- /**
- * Raise a number to a power. Special cases:<ul>
- * <li>If the second argument is positive or negative zero, then the result
- * is 1.0.</li>
- * <li>If the second argument is 1.0, then the result is the same as the
- * first argument.</li>
- * <li>If the second argument is NaN, then the result is NaN.</li>
- * <li>If the first argument is NaN and the second argument is nonzero,
- * then the result is NaN.</li>
- * <li>If the absolute value of the first argument is greater than 1 and
- * the second argument is positive infinity, or the absolute value of the
- * first argument is less than 1 and the second argument is negative
- * infinity, then the result is positive infinity.</li>
- * <li>If the absolute value of the first argument is greater than 1 and
- * the second argument is negative infinity, or the absolute value of the
- * first argument is less than 1 and the second argument is positive
- * infinity, then the result is positive zero.</li>
- * <li>If the absolute value of the first argument equals 1 and the second
- * argument is infinite, then the result is NaN.</li>
- * <li>If the first argument is positive zero and the second argument is
- * greater than zero, or the first argument is positive infinity and the
- * second argument is less than zero, then the result is positive zero.</li>
- * <li>If the first argument is positive zero and the second argument is
- * less than zero, or the first argument is positive infinity and the
- * second argument is greater than zero, then the result is positive
- * infinity.</li>
- * <li>If the first argument is negative zero and the second argument is
- * greater than zero but not a finite odd integer, or the first argument is
- * negative infinity and the second argument is less than zero but not a
- * finite odd integer, then the result is positive zero.</li>
- * <li>If the first argument is negative zero and the second argument is a
- * positive finite odd integer, or the first argument is negative infinity
- * and the second argument is a negative finite odd integer, then the result
- * is negative zero.</li>
- * <li>If the first argument is negative zero and the second argument is
- * less than zero but not a finite odd integer, or the first argument is
- * negative infinity and the second argument is greater than zero but not a
- * finite odd integer, then the result is positive infinity.</li>
- * <li>If the first argument is negative zero and the second argument is a
- * negative finite odd integer, or the first argument is negative infinity
- * and the second argument is a positive finite odd integer, then the result
- * is negative infinity.</li>
- * <li>If the first argument is less than zero and the second argument is a
- * finite even integer, then the result is equal to the result of raising
- * the absolute value of the first argument to the power of the second
- * argument.</li>
- * <li>If the first argument is less than zero and the second argument is a
- * finite odd integer, then the result is equal to the negative of the
- * result of raising the absolute value of the first argument to the power
- * of the second argument.</li>
- * <li>If the first argument is finite and less than zero and the second
- * argument is finite and not an integer, then the result is NaN.</li>
- * <li>If both arguments are integers, then the result is exactly equal to
- * the mathematical result of raising the first argument to the power of
- * the second argument if that result can in fact be represented exactly as
- * a double value.</li>
- *
- * </ul><p>(In the foregoing descriptions, a floating-point value is
- * considered to be an integer if and only if it is a fixed point of the
- * method {@link #ceil(double)} or, equivalently, a fixed point of the
- * method {@link #floor(double)}. A value is a fixed point of a one-argument
- * method if and only if the result of applying the method to the value is
- * equal to the value.) This is accurate within 1 ulp, and is semi-monotonic.
- *
- * @param a the number to raise
- * @param b the power to raise it to
- * @return a<sup>b</sup>
- */
- public static native double pow(double a, double b);
-
- /**
- * Get the IEEE 754 floating point remainder on two numbers. This is the
- * value of <code>x - y * <em>n</em></code>, where <em>n</em> is the closest
- * double to <code>x / y</code> (ties go to the even n); for a zero
- * remainder, the sign is that of <code>x</code>. If either argument is NaN,
- * the first argument is infinite, or the second argument is zero, the result
- * is NaN; if x is finite but y is infinite, the result is x. This is
- * accurate within the limits of doubles.
- *
- * @param x the dividend (the top half)
- * @param y the divisor (the bottom half)
- * @return the IEEE 754-defined floating point remainder of x/y
- * @see #rint(double)
- */
- public static native double IEEEremainder(double x, double y);
-
- /**
- * Take the nearest integer that is that is greater than or equal to the
- * argument. If the argument is NaN, infinite, or zero, the result is the
- * same; if the argument is between -1 and 0, the result is negative zero.
- * Note that <code>Math.ceil(x) == -Math.floor(-x)</code>.
- *
- * @param a the value to act upon
- * @return the nearest integer &gt;= <code>a</code>
- */
- public static native double ceil(double a);
-
- /**
- * Take the nearest integer that is that is less than or equal to the
- * argument. If the argument is NaN, infinite, or zero, the result is the
- * same. Note that <code>Math.ceil(x) == -Math.floor(-x)</code>.
- *
- * @param a the value to act upon
- * @return the nearest integer &lt;= <code>a</code>
- */
- public static native double floor(double a);
-
- /**
- * Take the nearest integer to the argument. If it is exactly between
- * two integers, the even integer is taken. If the argument is NaN,
- * infinite, or zero, the result is the same.
- *
- * @param a the value to act upon
- * @return the nearest integer to <code>a</code>
- */
- public static native double rint(double a);
-
- /**
- * Take the nearest integer to the argument. This is equivalent to
- * <code>(int) Math.floor(a + 0.5f)</code>. If the argument is NaN, the result
- * is 0; otherwise if the argument is outside the range of int, the result
- * will be Integer.MIN_VALUE or Integer.MAX_VALUE, as appropriate.
- *
- * @param a the argument to round
- * @return the nearest integer to the argument
- * @see Integer#MIN_VALUE
- * @see Integer#MAX_VALUE
- */
- public static int round(float a)
- {
- // this check for NaN, from JLS 15.21.1, saves a method call
- if (a != a)
- return 0;
- return (int) floor(a + 0.5f);
- }
-
- /**
- * Take the nearest long to the argument. This is equivalent to
- * <code>(long) Math.floor(a + 0.5)</code>. If the argument is NaN, the
- * result is 0; otherwise if the argument is outside the range of long, the
- * result will be Long.MIN_VALUE or Long.MAX_VALUE, as appropriate.
- *
- * @param a the argument to round
- * @return the nearest long to the argument
- * @see Long#MIN_VALUE
- * @see Long#MAX_VALUE
- */
- public static long round(double a)
- {
- // this check for NaN, from JLS 15.21.1, saves a method call
- if (a != a)
- return 0;
- return (long) floor(a + 0.5d);
- }
-
- /**
- * Get a random number. This behaves like Random.nextDouble(), seeded by
- * System.currentTimeMillis() when first called. In other words, the number
- * is from a pseudorandom sequence, and lies in the range [+0.0, 1.0).
- * This random sequence is only used by this method, and is threadsafe,
- * although you may want your own random number generator if it is shared
- * among threads.
- *
- * @return a random number
- * @see Random#nextDouble()
- * @see System#currentTimeMillis()
- */
- public static synchronized double random()
- {
- if (rand == null)
- rand = new Random();
- return rand.nextDouble();
- }
-
- /**
- * Convert from degrees to radians. The formula for this is
- * radians = degrees * (pi/180); however it is not always exact given the
- * limitations of floating point numbers.
- *
- * @param degrees an angle in degrees
- * @return the angle in radians
- * @since 1.2
- */
- public static double toRadians(double degrees)
- {
- return (degrees * PI) / 180;
- }
-
- /**
- * Convert from radians to degrees. The formula for this is
- * degrees = radians * (180/pi); however it is not always exact given the
- * limitations of floating point numbers.
- *
- * @param rads an angle in radians
- * @return the angle in degrees
- * @since 1.2
- */
- public static double toDegrees(double rads)
- {
- return (rads * 180) / PI;
- }
-}
diff --git a/libjava/java/lang/NegativeArraySizeException.java b/libjava/java/lang/NegativeArraySizeException.java
deleted file mode 100644
index fcfa52e475c..00000000000
--- a/libjava/java/lang/NegativeArraySizeException.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* NegativeArraySizeException.java -- thrown on attempt to create array
- with a negative size
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when an attempt is made to create an array with a negative
- * size. For example:<br>
- * <pre>
- * int i = -1;
- * int[] array = new int[i];
- * </pre>
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class NegativeArraySizeException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -8960118058596991861L;
-
- /**
- * Create an exception without a message.
- */
- public NegativeArraySizeException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public NegativeArraySizeException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/NoClassDefFoundError.java b/libjava/java/lang/NoClassDefFoundError.java
deleted file mode 100644
index 7e8e6caff80..00000000000
--- a/libjava/java/lang/NoClassDefFoundError.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* NoClassDefFoundError.java -- thrown when a ClassLoader cannot find a class
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * A <code>NoClassDefFoundError</code> is thrown when a classloader or the
- * Java Virtual Machine tries to load a class and no definition of the class
- * can be found. This could happen when using the <code>new</code> expression
- * or during a normal method call. The reason this would occur at runtime is
- * because the missing class definition existed when the currently executing
- * class was compiled, but now that definition cannot be found.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class NoClassDefFoundError extends LinkageError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 9095859863287012458L;
-
- /**
- * Create an error without a message.
- */
- public NoClassDefFoundError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public NoClassDefFoundError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/NoSuchFieldError.java b/libjava/java/lang/NoSuchFieldError.java
deleted file mode 100644
index af42e35dcf2..00000000000
--- a/libjava/java/lang/NoSuchFieldError.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* NoSuchFieldError.java -- thrown when the linker does not find a field
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * A <code>NoSuchFieldError</code> is thrown if an application attempts
- * to access a field of a class, and that class no longer has that field.
- * This is normally detected by the compiler, so it signals that you are
- * using binary incompatible class versions.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class NoSuchFieldError extends IncompatibleClassChangeError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -3456430195886129035L;
-
- /**
- * Create an error without a message.
- */
- public NoSuchFieldError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public NoSuchFieldError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/NoSuchFieldException.java b/libjava/java/lang/NoSuchFieldException.java
deleted file mode 100644
index 74d52d137c4..00000000000
--- a/libjava/java/lang/NoSuchFieldException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* NoSuchFieldException.java -- thrown when reflecting a non-existant field
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown to indicate the class does not have the specified field. This is
- * caused by a variety of reflection methods, when looking up a field by name.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class NoSuchFieldException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -6143714805279938260L;
-
- /**
- * Create an exception without a message.
- */
- public NoSuchFieldException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public NoSuchFieldException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/NoSuchMethodError.java b/libjava/java/lang/NoSuchMethodError.java
deleted file mode 100644
index 2bda776e8e9..00000000000
--- a/libjava/java/lang/NoSuchMethodError.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* NoSuchMethodError.java -- thrown when the linker does not find a method
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * A <code>NoSuchMethodError</code> is thrown if an application attempts
- * to access a method of a class, and that class no longer has that method.
- * This is normally detected by the compiler, so it signals that you are
- * using binary incompatible class versions.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class NoSuchMethodError extends IncompatibleClassChangeError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- static final long serialVersionUID = -3765521442372831335L;
-
- /**
- * Create an error without a message.
- */
- public NoSuchMethodError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public NoSuchMethodError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/NoSuchMethodException.java b/libjava/java/lang/NoSuchMethodException.java
deleted file mode 100644
index e423efb79f6..00000000000
--- a/libjava/java/lang/NoSuchMethodException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* NoSuchMethodException.java -- thrown when reflecting a non-existant method
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown to indicate the class does not have the specified method. This is
- * caused by a variety of reflection methods, when looking up a method by name.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class NoSuchMethodException extends Exception
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 5034388446362600923L;
-
- /**
- * Create an exception without a message.
- */
- public NoSuchMethodException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public NoSuchMethodException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/NullPointerException.java b/libjava/java/lang/NullPointerException.java
deleted file mode 100644
index 29a4ee086c5..00000000000
--- a/libjava/java/lang/NullPointerException.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* NullPointerException.java -- thrown when using null instead of an object
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when attempting to use <code>null</code> where an object
- * is required. The Virtual Machine automatically throws this exception
- * for the following:<br><ul>
- * <li>Calling an instance method on a null object</li>
- * <li>Accessing or modifying a field of a null object</li>
- * <li>Taking the array length of a null array</li>
- * <li>Accessing or modifying the slots of a null array</li>
- * <li>Throwing a null Throwable</li>
- * <li>Synchronizing on a null object</li>
- * </ul>
- * <p>Applications should also throw NullPointerExceptions whenever
- * <code>null</code> is an inappropriate parameter to a method.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class NullPointerException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 5162710183389028792L;
-
- /**
- * Create an exception without a message.
- */
- public NullPointerException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public NullPointerException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/Number.java b/libjava/java/lang/Number.java
deleted file mode 100644
index eb81f78c86e..00000000000
--- a/libjava/java/lang/Number.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Number.java =- abstract superclass of numeric objects
- Copyright (C) 1998, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-import java.io.Serializable;
-
-/**
- * Number is a generic superclass of all the numeric classes, including
- * the wrapper classes {@link Byte}, {@link Short}, {@link Integer},
- * {@link Long}, {@link Float}, and {@link Double}. Also worth mentioning
- * are the classes in {@link java.math}.
- *
- * It provides ways to convert numeric objects to any primitive.
- *
- * @author Paul Fisher
- * @author John Keiser
- * @author Warren Levy
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status updated to 1.4
- */
-public abstract class Number implements Serializable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -8742448824652078965L;
-
- /**
- * Table for calculating digits, used in Character, Long, and Integer.
- */
- static final char[] digits = {
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
- 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
- 'u', 'v', 'w', 'x', 'y', 'z',
- };
-
- /**
- * The basic constructor (often called implicitly).
- */
- public Number()
- {
- }
-
- /**
- * Return the value of this <code>Number</code> as an <code>int</code>.
- *
- * @return the int value
- */
- public abstract int intValue();
-
- /**
- * Return the value of this <code>Number</code> as a <code>long</code>.
- *
- * @return the long value
- */
- public abstract long longValue();
-
- /**
- * Return the value of this <code>Number</code> as a <code>float</code>.
- *
- * @return the float value
- */
- public abstract float floatValue();
-
- /**
- * Return the value of this <code>Number</code> as a <code>float</code>.
- *
- * @return the double value
- */
- public abstract double doubleValue();
-
- /**
- * Return the value of this <code>Number</code> as a <code>byte</code>.
- *
- * @return the byte value
- * @since 1.1
- */
- public byte byteValue()
- {
- return (byte) intValue();
- }
-
- /**
- * Return the value of this <code>Number</code> as a <code>short</code>.
- *
- * @return the short value
- * @since 1.1
- */
- public short shortValue()
- {
- return (short) intValue();
- }
-}
diff --git a/libjava/java/lang/NumberFormatException.java b/libjava/java/lang/NumberFormatException.java
deleted file mode 100644
index bf98156d13c..00000000000
--- a/libjava/java/lang/NumberFormatException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* NumberFormatException.java -- thrown when parsing a bad string as a number
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Can be thrown when attempting to convert a <code>String</code> to
- * one of the numeric types, but the operation fails because the string
- * has the wrong format.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class NumberFormatException extends IllegalArgumentException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -2848938806368998894L;
-
- /**
- * Create an exception without a message.
- */
- public NumberFormatException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public NumberFormatException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/OutOfMemoryError.java b/libjava/java/lang/OutOfMemoryError.java
deleted file mode 100644
index 66da563a0fb..00000000000
--- a/libjava/java/lang/OutOfMemoryError.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* OutOfMemoryError.java -- thrown when a memory allocation fails
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Thrown when the Java Virtual Machine is unable to allocate an object
- * because it is out of memory and no more memory could be made available
- * by the garbage collector.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class OutOfMemoryError extends VirtualMachineError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 8228564086184010517L;
-
- /**
- * Create an error without a message.
- */
- public OutOfMemoryError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public OutOfMemoryError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/Process.java b/libjava/java/lang/Process.java
deleted file mode 100644
index b6e18ca4df3..00000000000
--- a/libjava/java/lang/Process.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Process.java - Represent spawned system process
- Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * An instance of a subclass of <code>Process</code> is created by the
- * <code>Runtime.exec</code> methods. Methods in <code>Process</code>
- * provide a means to send input to a process, obtain the output from a
- * subprocess, destroy a subprocess, obtain the exit value from a
- * subprocess, and wait for a subprocess to complete.
- *
- * <p>This is dependent on the platform, and some processes (like native
- * windowing processes, 16-bit processes in Windows, or shell scripts) may
- * be limited in functionality. Because some platforms have limited buffers
- * between processes, you may need to provide input and read output to prevent
- * the process from blocking, or even deadlocking.
- *
- * <p>Even if all references to this object disapper, the process continues
- * to execute to completion. There are no guarantees that the
- * subprocess execute asynchronously or concurrently with the process which
- * owns this object.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @see Runtime#exec(String[], String[], File)
- * @since 1.0
- * @status updated to 1.4
- */
-public abstract class Process
-{
- /**
- * Empty constructor does nothing.
- */
- public Process()
- {
- }
-
- /**
- * Obtain the output stream that sends data to the subprocess. This is
- * the STDIN of the subprocess. When implementing, you should probably
- * use a buffered stream.
- *
- * @return the output stream that pipes to the process input
- */
- public abstract OutputStream getOutputStream();
-
- /**
- * Obtain the input stream that receives data from the subprocess. This is
- * the STDOUT of the subprocess. When implementing, you should probably
- * use a buffered stream.
- *
- * @return the input stream that pipes data from the process output
- */
- public abstract InputStream getInputStream();
-
- /**
- * Obtain the input stream that receives data from the subprocess. This is
- * the STDERR of the subprocess. When implementing, you should probably
- * use a buffered stream.
- *
- * @return the input stream that pipes data from the process error output
- */
- public abstract InputStream getErrorStream();
-
- /**
- * The thread calling <code>waitFor</code> will block until the subprocess
- * has terminated. If the process has already terminated then the method
- * immediately returns with the exit value of the subprocess.
- *
- * @return the subprocess exit value; 0 conventionally denotes success
- * @throws InterruptedException if another thread interrupts the blocked one
- */
- public abstract int waitFor() throws InterruptedException;
-
- /**
- * When a process terminates there is associated with that termination
- * an exit value for the process to indicate why it terminated. A return
- * of <code>0</code> denotes normal process termination by convention.
- *
- * @return the exit value of the subprocess
- * @throws IllegalThreadStateException if the subprocess has not terminated
- */
- public abstract int exitValue();
-
- /**
- * Kills the subprocess and all of its children forcibly.
- */
- public abstract void destroy();
-} // class Process
diff --git a/libjava/java/lang/Runnable.java b/libjava/java/lang/Runnable.java
deleted file mode 100644
index 32c52b94a05..00000000000
--- a/libjava/java/lang/Runnable.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Runnable -- interface for a method tied to an Object; often for Threads
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Runnable is an interface you implement to indicate that your class can be
- * executed as the main part of a Thread, among other places. When you want
- * an entry point to run a piece of code, implement this interface and
- * override run.
- *
- * @author Paul Fisher
- * @author Tom Tromey (tromey@cygnus.com)
- * @see Thread
- * @since 1.0
- * @status updated to 1.4
- */
-public interface Runnable
-{
- /**
- * This method will be called by whoever wishes to run your class
- * implementing Runnable. Note that there are no restrictions on what
- * you are allowed to do in the run method, except that you cannot
- * throw a checked exception.
- */
- void run();
-}
diff --git a/libjava/java/lang/RuntimeException.java b/libjava/java/lang/RuntimeException.java
deleted file mode 100644
index 72cf0872bc7..00000000000
--- a/libjava/java/lang/RuntimeException.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* RuntimeException.java -- root of all unchecked exceptions
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * All exceptions which are subclasses of <code>RuntimeException</code>
- * can be thrown at any time during the execution of a Java virtual machine.
- * Methods which throw these exceptions are not required to declare them
- * in their throws clause.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @status updated to 1.4
- */
-public class RuntimeException extends Exception
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -7034897190745766939L;
-
- /**
- * Create an exception without a message. The cause remains uninitialized.
- *
- * @see #initCause(Throwable)
- */
- public RuntimeException()
- {
- }
-
- /**
- * Create an exception with a message. The cause remains uninitialized.
- *
- * @param s the message string
- * @see #initCause(Throwable)
- */
- public RuntimeException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message string
- * @param cause the cause of this exception
- * @since 1.4
- */
- public RuntimeException(String s, Throwable cause)
- {
- super(s, cause);
- }
-
- /**
- * Create an exception with the given cause, and a message of
- * <code>cause == null ? null : cause.toString()</code>.
- *
- * @param cause the cause of this exception
- * @since 1.4
- */
- public RuntimeException(Throwable cause)
- {
- super(cause);
- }
-}
diff --git a/libjava/java/lang/RuntimePermission.java b/libjava/java/lang/RuntimePermission.java
deleted file mode 100644
index ca33307d12b..00000000000
--- a/libjava/java/lang/RuntimePermission.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/* RuntimePermission.java -- permission for a secure runtime action
- Copyright (C) 1998, 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-import java.security.BasicPermission;
-
-/**
- * A <code>RuntimePermission</code> contains a permission name, but no
- * actions list. This means you either have the permission or you don't.
- *
- * Permission names have the follow the hierarchial property naming
- * convention. In addition, an asterisk may appear at the end of a
- * name if following a period or by itself.
- *
- * <table border=1>
- * <tr><th>Valid names</th><th>Invalid names</th></tr>
- * <tr><td>"accessClassInPackage.*","*"</td>
- * <td>"**", "*x", "*.a"</td></tr>
- * </table>
- * <br>
- *
- * The following table provides a list of all the possible RuntimePermission
- * permission names with a description of what that permission allows.<br>
- * <table border=1>
- * <tr><th>Permission Name</th><th>Permission Allows</th><th>Risks</th</tr>
- * <tr>
- * <td><code>createClassLoader</code></td>
- * <td>creation of a class loader</td>
- * <td>a class loader can load rogue classes which bypass all security
- * permissions</td></tr>
- * <tr>
- * <td><code>getClassLoader</code></td>
- * <td>retrieval of the class loader for the calling class</td>
- * <td>rogue code could load classes not otherwise available</td></tr>
- * <tr>
- * <td><code>setContextClassLoader</code></td>
- * <td>allows the setting of the context class loader used by a thread</td>
- * <td>rogue code could change the context class loader needed by system
- * threads</td></tr>
- * <tr>
- * <td><code>setSecurityManager</code></td>
- * <td>allows the application to replace the security manager</td>
- * <td>the new manager may be less restrictive, so that rogue code can
- * bypass existing security checks</td></tr>
- * <tr>
- * <td><code>createSecurityManager</code></td>
- * <td>allows the application to create a new security manager</td>
- * <td>rogue code can use the new security manager to discover information
- * about the execution stack</td></tr>
- * <tr>
- * <td><code>exitVM</code></td>
- * <td>allows the application to halt the virtual machine</td>
- * <td>rogue code can mount a denial-of-service attack by killing the
- * virtual machine</td></tr>
- * <tr>
- * <td><code>shutdownHooks</code></td>
- * <td>allows registration and modification of shutdown hooks</td>
- * <td>rogue code can add a hook that interferes with clean
- * virtual machine shutdown</td></tr>
- * <tr>
- * <td><code>setFactory</code></td>
- * <td>allows the application to set the socket factory for socket,
- * server socket, stream handler, or RMI socket factory.</td>
- * <td>rogue code can create a rogue network object which mangles or
- * intercepts data</td></tr>
- * <tr>
- * <td><code>setIO</code></td>
- * <td>allows the application to set System.out, System.in, and
- * System.err</td>
- * <td>rogue code could sniff user input and intercept or mangle
- * output</td></tr>
- * <tr>
- * <td><code>modifyThread</code></td>
- * <td>allows the application to modify any thread in the virtual machine
- * using any of the methods <code>stop</code>, <code>resume</code>,
- * <code>suspend</code>, <code>setPriority</code>, and
- * <code>setName</code> of classs <code>Thread</code></td>
- * <td>rogue code could adversely modify system or user threads</td></tr>
- * <tr>
- * <td><code>stopThread</code></td>
- * <td>allows the application to <code>stop</code> any thread it has
- * access to in the system</td>
- * <td>rogue code can stop arbitrary threads</td></tr>
- * <tr>
- * <td><code>modifyThreadGroup</code></td>
- * <td>allows the application to modify thread groups using any of the
- * methods <code>destroy</code>, <code>resume</code>,
- * <code>setDaemon</code>, <code>setMaxPriority</code>,
- * <code>stop</code>, and <code>suspend</code> of the class
- * <code>ThreadGroup</code></td>
- * <td>rogue code can mount a denial-of-service attack by changing run
- * priorities</td></tr>
- * <tr>
- * <td><code>getProtectionDomain</code></td>
- * <td>retrieve a class's ProtectionDomain</td>
- * <td>rogue code can gain information about the security policy, to
- * prepare a better attack</td></tr>
- * <tr>
- * <td><code>readFileDescriptor</code></td>
- * <td>read a file descriptor</td>
- * <td>rogue code can read sensitive information</td></tr>
- * <tr>
- * <td><code>writeFileDescriptor</code></td>
- * <td>write a file descriptor</td>
- * <td>rogue code can write files, including viruses, and can modify the
- * virtual machine binary; if not just fill up the disk</td></tr>
- * <tr>
- * <td><code>loadLibrary.</code><em>library name</em></td>
- * <td>dynamic linking of the named library</td>
- * <td>native code can bypass many security checks of pure Java</td></tr>
- * <tr>
- * <td><code>accessClassInPackage.</code><em>package name</em></td>
- * <td>access to a package via a ClassLoader</td>
- * <td>rogue code can access classes not normally available</td></tr>
- * <tr>
- * <td><code>defineClassInPackage.</code><em>package name</em></td>
- * <td>define a class inside a given package</td>
- * <td>rogue code can install rogue classes, including in trusted packages
- * like java.security or java.lang</td></tr>
- * <tr>
- * <td><code>accessDeclaredMembers</code></td>
- * <td>access declared class members via reflection</td>
- * <td>rogue code can discover information, invoke methods, or modify fields
- * that are not otherwise available</td></tr>
- * <tr>
- * <td><code>queuePrintJob</code></td>
- * <td>initiate a print job</td>
- * <td>rogue code could make a hard copy of sensitive information, or
- * simply waste paper</td></tr>
- * </table>
- *
- * @author Brian Jones
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see BasicPermission
- * @see Permission
- * @see SecurityManager
- * @since 1.2
- * @status updated to 1.4
- */
-public final class RuntimePermission extends BasicPermission
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 7399184964622342223L;
-
- /**
- * Create a new permission with the specified name.
- *
- * @param permissionName the name of the granted permission
- * @throws NullPointerException if name is null
- * @throws IllegalArgumentException thrown if name is empty or invalid
- */
- public RuntimePermission(String permissionName)
- {
- super(permissionName);
- }
-
- /**
- * Create a new permission with the specified name. The actions argument
- * is ignored, as runtime permissions have no actions.
- *
- * @param permissionName the name of the granted permission
- * @param actions ignored
- * @throws NullPointerException if name is null
- * @throws IllegalArgumentException thrown if name is empty or invalid
- */
- public RuntimePermission(String permissionName, String actions)
- {
- super(permissionName);
- }
-}
diff --git a/libjava/java/lang/SecurityException.java b/libjava/java/lang/SecurityException.java
deleted file mode 100644
index a95d797054f..00000000000
--- a/libjava/java/lang/SecurityException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* SecurityException.java -- thrown to indicate a security violation
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * The security manager will throw this exception to indicate a security
- * violation. This can occur any time an operation is attempted which is
- * deemed unsafe by the current security policies.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @see SecurityManager
- * @status updated to 1.4
- */
-public class SecurityException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 6878364983674394167L;
-
- /**
- * Create an exception without a message.
- */
- public SecurityException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public SecurityException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/Short.java b/libjava/java/lang/Short.java
deleted file mode 100644
index fbeea915bd3..00000000000
--- a/libjava/java/lang/Short.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/* Short.java -- object wrapper for short
- Copyright (C) 1998, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * Instances of class <code>Short</code> represent primitive
- * <code>short</code> values.
- *
- * Additionally, this class provides various helper functions and variables
- * related to shorts.
- *
- * @author Paul Fisher
- * @author John Keiser
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status updated to 1.4
- */
-public final class Short extends Number implements Comparable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 7515723908773894738L;
-
- /**
- * The minimum value a <code>short</code> can represent is -32768 (or
- * -2<sup>15</sup>).
- */
- public static final short MIN_VALUE = -32768;
-
- /**
- * The minimum value a <code>short</code> can represent is 32767 (or
- * 2<sup>15</sup>).
- */
- public static final short MAX_VALUE = 32767;
-
- /**
- * The primitive type <code>short</code> is represented by this
- * <code>Class</code> object.
- */
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('S');
-
- /**
- * The immutable value of this Short.
- *
- * @serial the wrapped short
- */
- private final short value;
-
- /**
- * Create a <code>Short</code> object representing the value of the
- * <code>short</code> argument.
- *
- * @param value the value to use
- */
- public Short(short value)
- {
- this.value = value;
- }
-
- /**
- * Create a <code>Short</code> object representing the value of the
- * argument after conversion to a <code>short</code>.
- *
- * @param s the string to convert
- * @throws NumberFormatException if the String cannot be parsed
- */
- public Short(String s)
- {
- value = parseShort(s, 10);
- }
-
- /**
- * Converts the <code>short</code> to a <code>String</code> and assumes
- * a radix of 10.
- *
- * @param s the <code>short</code> to convert to <code>String</code>
- * @return the <code>String</code> representation of the argument
- */
- public static String toString(short s)
- {
- return String.valueOf(s);
- }
-
- /**
- * Converts the specified <code>String</code> into a <code>short</code>.
- * This function assumes a radix of 10.
- *
- * @param s the <code>String</code> to convert
- * @return the <code>short</code> value of <code>s</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>short</code>
- */
- public static short parseShort(String s)
- {
- return parseShort(s, 10);
- }
-
- /**
- * Converts the specified <code>String</code> into a <code>short</code>
- * using the specified radix (base). The string must not be <code>null</code>
- * or empty. It may begin with an optional '-', which will negate the answer,
- * provided that there are also valid digits. Each digit is parsed as if by
- * <code>Character.digit(d, radix)</code>, and must be in the range
- * <code>0</code> to <code>radix - 1</code>. Finally, the result must be
- * within <code>MIN_VALUE</code> to <code>MAX_VALUE</code>, inclusive.
- * Unlike Double.parseDouble, you may not have a leading '+'.
- *
- * @param s the <code>String</code> to convert
- * @param radix the radix (base) to use in the conversion
- * @return the <code>String</code> argument converted to <code>short</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>short</code>
- */
- public static short parseShort(String s, int radix)
- {
- int i = Integer.parseInt(s, radix, false);
- if ((short) i != i)
- throw new NumberFormatException();
- return (short) i;
- }
-
- /**
- * Creates a new <code>Short</code> object using the <code>String</code>
- * and specified radix (base).
- *
- * @param s the <code>String</code> to convert
- * @param radix the radix (base) to convert with
- * @return the new <code>Short</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>short</code>
- * @see #parseShort(String, int)
- */
- public static Short valueOf(String s, int radix)
- {
- return new Short(parseShort(s, radix));
- }
-
- /**
- * Creates a new <code>Short</code> object using the <code>String</code>,
- * assuming a radix of 10.
- *
- * @param s the <code>String</code> to convert
- * @return the new <code>Short</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>short</code>
- * @see #Short(String)
- * @see #parseShort(String)
- */
- public static Short valueOf(String s)
- {
- return new Short(parseShort(s, 10));
- }
-
- /**
- * Convert the specified <code>String</code> into a <code>Short</code>.
- * The <code>String</code> may represent decimal, hexadecimal, or
- * octal numbers.
- *
- * <p>The extended BNF grammar is as follows:<br>
- * <pre>
- * <em>DecodableString</em>:
- * ( [ <code>-</code> ] <em>DecimalNumber</em> )
- * | ( [ <code>-</code> ] ( <code>0x</code> | <code>0X</code>
- * | <code>#</code> ) <em>HexDigit</em> { <em>HexDigit</em> } )
- * | ( [ <code>-</code> ] <code>0</code> { <em>OctalDigit</em> } )
- * <em>DecimalNumber</em>:
- * <em>DecimalDigit except '0'</em> { <em>DecimalDigit</em> }
- * <em>DecimalDigit</em>:
- * <em>Character.digit(d, 10) has value 0 to 9</em>
- * <em>OctalDigit</em>:
- * <em>Character.digit(d, 8) has value 0 to 7</em>
- * <em>DecimalDigit</em>:
- * <em>Character.digit(d, 16) has value 0 to 15</em>
- * </pre>
- * Finally, the value must be in the range <code>MIN_VALUE</code> to
- * <code>MAX_VALUE</code>, or an exception is thrown.
- *
- * @param s the <code>String</code> to interpret
- * @return the value of the String as a <code>Short</code>
- * @throws NumberFormatException if <code>s</code> cannot be parsed as a
- * <code>short</code>
- * @throws NullPointerException if <code>s</code> is null
- * @see Integer#decode(String)
- */
- public static Short decode(String s)
- {
- int i = Integer.parseInt(s, 10, true);
- if ((short) i != i)
- throw new NumberFormatException();
- return new Short((short) i);
- }
-
- /**
- * Return the value of this <code>Short</code> as a <code>byte</code>.
- *
- * @return the byte value
- */
- public byte byteValue()
- {
- return (byte) value;
- }
-
- /**
- * Return the value of this <code>Short</code>.
- *
- * @return the short value
- */
- public short shortValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Short</code> as an <code>int</code>.
- *
- * @return the int value
- */
- public int intValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Short</code> as a <code>long</code>.
- *
- * @return the long value
- */
- public long longValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Short</code> as a <code>float</code>.
- *
- * @return the float value
- */
- public float floatValue()
- {
- return value;
- }
-
- /**
- * Return the value of this <code>Short</code> as a <code>double</code>.
- *
- * @return the double value
- */
- public double doubleValue()
- {
- return value;
- }
-
- /**
- * Converts the <code>Short</code> value to a <code>String</code> and
- * assumes a radix of 10.
- *
- * @return the <code>String</code> representation of this <code>Short</code>
- */
- public String toString()
- {
- return String.valueOf(value);
- }
-
- /**
- * Return a hashcode representing this Object. <code>Short</code>'s hash
- * code is simply its value.
- *
- * @return this Object's hash code
- */
- public int hashCode()
- {
- return value;
- }
-
- /**
- * Returns <code>true</code> if <code>obj</code> is an instance of
- * <code>Short</code> and represents the same short value.
- *
- * @param obj the object to compare
- * @return whether these Objects are semantically equal
- */
- public boolean equals(Object obj)
- {
- return obj instanceof Short && value == ((Short) obj).value;
- }
-
- /**
- * Compare two Shorts numerically by comparing their <code>short</code>
- * values. The result is positive if the first is greater, negative if the
- * second is greater, and 0 if the two are equal.
- *
- * @param s the Short to compare
- * @return the comparison
- * @since 1.2
- */
- public int compareTo(Short s)
- {
- return value - s.value;
- }
-
- /**
- * Behaves like <code>compareTo(Short)</code> unless the Object
- * is not a <code>Short</code>.
- *
- * @param o the object to compare
- * @return the comparison
- * @throws ClassCastException if the argument is not a <code>Short</code>
- * @see #compareTo(Short)
- * @see Comparable
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compareTo((Short)o);
- }
-}
diff --git a/libjava/java/lang/StackOverflowError.java b/libjava/java/lang/StackOverflowError.java
deleted file mode 100644
index 5188ddda159..00000000000
--- a/libjava/java/lang/StackOverflowError.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* StackOverflowError.java -- thrown when the stack depth is exceeded
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * A <code>StackOverflowError</code> is thrown when the execution stack
- * overflow occurs. This often occurs when a method enters infinit recursion.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class StackOverflowError extends VirtualMachineError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 8609175038441759607L;
-
- /**
- * Create an error without a message.
- */
- public StackOverflowError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public StackOverflowError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/StackTraceElement.java b/libjava/java/lang/StackTraceElement.java
deleted file mode 100644
index 6dd4d8532e8..00000000000
--- a/libjava/java/lang/StackTraceElement.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/* StackTraceElement.java -- One function call or call stack element
- Copyright (C) 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-import java.io.Serializable;
-
-/**
- * One function call or stack trace element. Gives information about
- * the execution point such as the source file name, the line number,
- * the fully qualified class name, the method name and whether this method
- * is native, if this information is known.
- *
- * @author Mark Wielaard (mark@klomp.org)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status updated to 1.4
- */
-public final class StackTraceElement implements Serializable
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = 6992337162326171013L;
-
- /**
- * The name of the file, null if unknown.
- *
- * @serial the source code filename, if known
- */
- private final String fileName;
-
- /**
- * The line number in the file, negative if unknown.
- *
- * @serial the source code line number, if known
- */
- private final int lineNumber;
-
- /**
- * The fully qualified class name, null if unknown.
- *
- * @serial the enclosing class, if known
- */
- private final String declaringClass;
-
- /**
- * The method name in the class, null if unknown.
- *
- * @serial the enclosing method, if known
- */
- private final String methodName;
-
- /** Whether the method is native. */
- private final transient boolean isNative;
-
- /**
- * A package local constructor for the StackTraceElement class, to be
- * called by the Virtual Machine as part of Throwable.fillInStackTrace.
- * There are no public constructors defined for this class. Creation
- * of new elements is implementation specific.
- *
- * @param fileName the name of the file, null if unknown
- * @param lineNumber the line in the file, negative if unknown
- * @param className the fully qualified name of the class, null if unknown
- * @param methodName the name of the method, null if unknown
- * @param isNative true if native, false otherwise
- */
- StackTraceElement(String fileName, int lineNumber, String className,
- String methodName, boolean isNative)
- {
- this.fileName = fileName;
- this.lineNumber = lineNumber;
- this.declaringClass = className;
- this.methodName = methodName;
- this.isNative = isNative;
- }
-
- /**
- * Returns the name of the file, or null if unknown. This is usually
- * obtained from the <code>SourceFile</code> attribute of the class file
- * format, if present.
- *
- * @return the file name
- */
- public String getFileName()
- {
- return fileName;
- }
-
- /**
- * Returns the line number in the file, or a negative number if unknown.
- * This is usually obtained from the <code>LineNumberTable</code> attribute
- * of the method in the class file format, if present.
- *
- * @return the line number
- */
- public int getLineNumber()
- {
- return lineNumber;
- }
-
- /**
- * Returns the fully qualified class name, or null if unknown.
- *
- * @return the class name
- */
- public String getClassName()
- {
- return declaringClass;
- }
-
- /**
- * Returns the method name in the class, or null if unknown. If the
- * execution point is in a constructor, the name is
- * <code>&lt;init&gt;</code>; if the execution point is in the class
- * initializer, the name is <code>&lt;clinit&gt;</code>.
- *
- * @return the method name
- */
- public String getMethodName()
- {
- return methodName;
- }
-
- /**
- * Returns true if the method is native, or false if it is not or unknown.
- *
- * @return whether the method is native
- */
- public boolean isNativeMethod()
- {
- return isNative;
- }
-
- /**
- * Returns a string representation of this stack trace element. The
- * returned String is implementation specific. This implementation
- * returns the following String: "[class][.][method]([file][:line])".
- * If the fully qualified class name or the method is unknown it is
- * omitted including the point seperator. If the source file name is
- * unknown it is replaced by "Unknown Source" if the method is not native
- * or by "Native Method" if the method is native. If the line number
- * is unknown it and the colon are omitted.
- *
- * @return a string representation of this execution point
- */
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
- if (declaringClass != null)
- {
- sb.append(declaringClass);
- if (methodName != null)
- sb.append('.');
- }
- if (methodName != null)
- sb.append(methodName);
- sb.append(" (");
- if (fileName != null)
- sb.append(fileName);
- else
- sb.append(isNative ? "Native Method" : "Unknown Source");
- if (lineNumber >= 0)
- sb.append(':').append(lineNumber);
- sb.append(')');
- return sb.toString();
- }
-
- /**
- * Returns true if the given object is also a StackTraceElement and all
- * attributes, except the native flag, are equal (either the same attribute
- * between the two elments are null, or both satisfy Object.equals).
- *
- * @param o the object to compare
- * @return true if the two are equal
- */
- public boolean equals(Object o)
- {
- if (! (o instanceof StackTraceElement))
- return false;
- StackTraceElement e = (StackTraceElement) o;
- return equals(fileName, e.fileName)
- && lineNumber == e.lineNumber
- && equals(declaringClass, e.declaringClass)
- && equals(methodName, e.methodName);
- }
-
- /**
- * Returns the hashCode of this StackTraceElement. This implementation
- * computes the hashcode by xor-ing the hashcode of all attributes except
- * the native flag.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return hashCode(fileName) ^ lineNumber ^ hashCode(declaringClass)
- ^ hashCode(methodName);
- }
-
- /**
- * Compare two objects according to Collection semantics.
- *
- * @param o1 the first object
- * @param o2 the second object
- * @return o1 == null ? o2 == null : o1.equals(o2)
- */
- private static boolean equals(Object o1, Object o2)
- {
- return o1 == null ? o2 == null : o1.equals(o2);
- }
-
- /**
- * Hash an object according to Collection semantics.
- *
- * @param o the object to hash
- * @return o1 == null ? 0 : o1.hashCode()
- */
- private static int hashCode(Object o)
- {
- return o == null ? 0 : o.hashCode();
- }
-}
diff --git a/libjava/java/lang/StrictMath.java b/libjava/java/lang/StrictMath.java
deleted file mode 100644
index 32bd3540d80..00000000000
--- a/libjava/java/lang/StrictMath.java
+++ /dev/null
@@ -1,1844 +0,0 @@
-/* java.lang.StrictMath -- common mathematical functions, strict Java
- Copyright (C) 1998, 2001, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-/*
- * Some of the algorithms in this class are in the public domain, as part
- * of fdlibm (freely-distributable math library), available at
- * http://www.netlib.org/fdlibm/, and carry the following copyright:
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunSoft, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-package java.lang;
-
-import gnu.classpath.Configuration;
-
-import java.util.Random;
-
-/**
- * Helper class containing useful mathematical functions and constants.
- * This class mirrors {@link Math}, but is 100% portable, because it uses
- * no native methods whatsoever. Also, these algorithms are all accurate
- * to less than 1 ulp, and execute in <code>strictfp</code> mode, while
- * Math is allowed to vary in its results for some functions. Unfortunately,
- * this usually means StrictMath has less efficiency and speed, as Math can
- * use native methods.
- *
- * <p>The source of the various algorithms used is the fdlibm library, at:<br>
- * <a href="http://www.netlib.org/fdlibm/">http://www.netlib.org/fdlibm/</a>
- *
- * Note that angles are specified in radians. Conversion functions are
- * provided for your convenience.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- */
-public final strictfp class StrictMath
-{
- /**
- * StrictMath is non-instantiable.
- */
- private StrictMath()
- {
- }
-
- /**
- * A random number generator, initialized on first use.
- *
- * @see #random()
- */
- private static Random rand;
-
- /**
- * The most accurate approximation to the mathematical constant <em>e</em>:
- * <code>2.718281828459045</code>. Used in natural log and exp.
- *
- * @see #log(double)
- * @see #exp(double)
- */
- public static final double E
- = 2.718281828459045; // Long bits 0x4005bf0z8b145769L.
-
- /**
- * The most accurate approximation to the mathematical constant <em>pi</em>:
- * <code>3.141592653589793</code>. This is the ratio of a circle's diameter
- * to its circumference.
- */
- public static final double PI
- = 3.141592653589793; // Long bits 0x400921fb54442d18L.
-
- /**
- * Take the absolute value of the argument. (Absolute value means make
- * it positive.)
- *
- * <p>Note that the the largest negative value (Integer.MIN_VALUE) cannot
- * be made positive. In this case, because of the rules of negation in
- * a computer, MIN_VALUE is what will be returned.
- * This is a <em>negative</em> value. You have been warned.
- *
- * @param i the number to take the absolute value of
- * @return the absolute value
- * @see Integer#MIN_VALUE
- */
- public static int abs(int i)
- {
- return (i < 0) ? -i : i;
- }
-
- /**
- * Take the absolute value of the argument. (Absolute value means make
- * it positive.)
- *
- * <p>Note that the the largest negative value (Long.MIN_VALUE) cannot
- * be made positive. In this case, because of the rules of negation in
- * a computer, MIN_VALUE is what will be returned.
- * This is a <em>negative</em> value. You have been warned.
- *
- * @param l the number to take the absolute value of
- * @return the absolute value
- * @see Long#MIN_VALUE
- */
- public static long abs(long l)
- {
- return (l < 0) ? -l : l;
- }
-
- /**
- * Take the absolute value of the argument. (Absolute value means make
- * it positive.)
- *
- * @param f the number to take the absolute value of
- * @return the absolute value
- */
- public static float abs(float f)
- {
- return (f <= 0) ? 0 - f : f;
- }
-
- /**
- * Take the absolute value of the argument. (Absolute value means make
- * it positive.)
- *
- * @param d the number to take the absolute value of
- * @return the absolute value
- */
- public static double abs(double d)
- {
- return (d <= 0) ? 0 - d : d;
- }
-
- /**
- * Return whichever argument is smaller.
- *
- * @param a the first number
- * @param b a second number
- * @return the smaller of the two numbers
- */
- public static int min(int a, int b)
- {
- return (a < b) ? a : b;
- }
-
- /**
- * Return whichever argument is smaller.
- *
- * @param a the first number
- * @param b a second number
- * @return the smaller of the two numbers
- */
- public static long min(long a, long b)
- {
- return (a < b) ? a : b;
- }
-
- /**
- * Return whichever argument is smaller. If either argument is NaN, the
- * result is NaN, and when comparing 0 and -0, -0 is always smaller.
- *
- * @param a the first number
- * @param b a second number
- * @return the smaller of the two numbers
- */
- public static float min(float a, float b)
- {
- // this check for NaN, from JLS 15.21.1, saves a method call
- if (a != a)
- return a;
- // no need to check if b is NaN; < will work correctly
- // recall that -0.0 == 0.0, but [+-]0.0 - [+-]0.0 behaves special
- if (a == 0 && b == 0)
- return -(-a - b);
- return (a < b) ? a : b;
- }
-
- /**
- * Return whichever argument is smaller. If either argument is NaN, the
- * result is NaN, and when comparing 0 and -0, -0 is always smaller.
- *
- * @param a the first number
- * @param b a second number
- * @return the smaller of the two numbers
- */
- public static double min(double a, double b)
- {
- // this check for NaN, from JLS 15.21.1, saves a method call
- if (a != a)
- return a;
- // no need to check if b is NaN; < will work correctly
- // recall that -0.0 == 0.0, but [+-]0.0 - [+-]0.0 behaves special
- if (a == 0 && b == 0)
- return -(-a - b);
- return (a < b) ? a : b;
- }
-
- /**
- * Return whichever argument is larger.
- *
- * @param a the first number
- * @param b a second number
- * @return the larger of the two numbers
- */
- public static int max(int a, int b)
- {
- return (a > b) ? a : b;
- }
-
- /**
- * Return whichever argument is larger.
- *
- * @param a the first number
- * @param b a second number
- * @return the larger of the two numbers
- */
- public static long max(long a, long b)
- {
- return (a > b) ? a : b;
- }
-
- /**
- * Return whichever argument is larger. If either argument is NaN, the
- * result is NaN, and when comparing 0 and -0, 0 is always larger.
- *
- * @param a the first number
- * @param b a second number
- * @return the larger of the two numbers
- */
- public static float max(float a, float b)
- {
- // this check for NaN, from JLS 15.21.1, saves a method call
- if (a != a)
- return a;
- // no need to check if b is NaN; > will work correctly
- // recall that -0.0 == 0.0, but [+-]0.0 - [+-]0.0 behaves special
- if (a == 0 && b == 0)
- return a - -b;
- return (a > b) ? a : b;
- }
-
- /**
- * Return whichever argument is larger. If either argument is NaN, the
- * result is NaN, and when comparing 0 and -0, 0 is always larger.
- *
- * @param a the first number
- * @param b a second number
- * @return the larger of the two numbers
- */
- public static double max(double a, double b)
- {
- // this check for NaN, from JLS 15.21.1, saves a method call
- if (a != a)
- return a;
- // no need to check if b is NaN; > will work correctly
- // recall that -0.0 == 0.0, but [+-]0.0 - [+-]0.0 behaves special
- if (a == 0 && b == 0)
- return a - -b;
- return (a > b) ? a : b;
- }
-
- /**
- * The trigonometric function <em>sin</em>. The sine of NaN or infinity is
- * NaN, and the sine of 0 retains its sign.
- *
- * @param a the angle (in radians)
- * @return sin(a)
- */
- public static double sin(double a)
- {
- if (a == Double.NEGATIVE_INFINITY || ! (a < Double.POSITIVE_INFINITY))
- return Double.NaN;
-
- if (abs(a) <= PI / 4)
- return sin(a, 0);
-
- // Argument reduction needed.
- double[] y = new double[2];
- int n = remPiOver2(a, y);
- switch (n & 3)
- {
- case 0:
- return sin(y[0], y[1]);
- case 1:
- return cos(y[0], y[1]);
- case 2:
- return -sin(y[0], y[1]);
- default:
- return -cos(y[0], y[1]);
- }
- }
-
- /**
- * The trigonometric function <em>cos</em>. The cosine of NaN or infinity is
- * NaN.
- *
- * @param a the angle (in radians).
- * @return cos(a).
- */
- public static double cos(double a)
- {
- if (a == Double.NEGATIVE_INFINITY || ! (a < Double.POSITIVE_INFINITY))
- return Double.NaN;
-
- if (abs(a) <= PI / 4)
- return cos(a, 0);
-
- // Argument reduction needed.
- double[] y = new double[2];
- int n = remPiOver2(a, y);
- switch (n & 3)
- {
- case 0:
- return cos(y[0], y[1]);
- case 1:
- return -sin(y[0], y[1]);
- case 2:
- return -cos(y[0], y[1]);
- default:
- return sin(y[0], y[1]);
- }
- }
-
- /**
- * The trigonometric function <em>tan</em>. The tangent of NaN or infinity
- * is NaN, and the tangent of 0 retains its sign.
- *
- * @param a the angle (in radians)
- * @return tan(a)
- */
- public static double tan(double a)
- {
- if (a == Double.NEGATIVE_INFINITY || ! (a < Double.POSITIVE_INFINITY))
- return Double.NaN;
-
- if (abs(a) <= PI / 4)
- return tan(a, 0, false);
-
- // Argument reduction needed.
- double[] y = new double[2];
- int n = remPiOver2(a, y);
- return tan(y[0], y[1], (n & 1) == 1);
- }
-
- /**
- * The trigonometric function <em>arcsin</em>. The range of angles returned
- * is -pi/2 to pi/2 radians (-90 to 90 degrees). If the argument is NaN or
- * its absolute value is beyond 1, the result is NaN; and the arcsine of
- * 0 retains its sign.
- *
- * @param x the sin to turn back into an angle
- * @return arcsin(x)
- */
- public static double asin(double x)
- {
- boolean negative = x < 0;
- if (negative)
- x = -x;
- if (! (x <= 1))
- return Double.NaN;
- if (x == 1)
- return negative ? -PI / 2 : PI / 2;
- if (x < 0.5)
- {
- if (x < 1 / TWO_27)
- return negative ? -x : x;
- double t = x * x;
- double p = t * (PS0 + t * (PS1 + t * (PS2 + t * (PS3 + t
- * (PS4 + t * PS5)))));
- double q = 1 + t * (QS1 + t * (QS2 + t * (QS3 + t * QS4)));
- return negative ? -x - x * (p / q) : x + x * (p / q);
- }
- double w = 1 - x; // 1>|x|>=0.5.
- double t = w * 0.5;
- double p = t * (PS0 + t * (PS1 + t * (PS2 + t * (PS3 + t
- * (PS4 + t * PS5)))));
- double q = 1 + t * (QS1 + t * (QS2 + t * (QS3 + t * QS4)));
- double s = sqrt(t);
- if (x >= 0.975)
- {
- w = p / q;
- t = PI / 2 - (2 * (s + s * w) - PI_L / 2);
- }
- else
- {
- w = (float) s;
- double c = (t - w * w) / (s + w);
- p = 2 * s * (p / q) - (PI_L / 2 - 2 * c);
- q = PI / 4 - 2 * w;
- t = PI / 4 - (p - q);
- }
- return negative ? -t : t;
- }
-
- /**
- * The trigonometric function <em>arccos</em>. The range of angles returned
- * is 0 to pi radians (0 to 180 degrees). If the argument is NaN or
- * its absolute value is beyond 1, the result is NaN.
- *
- * @param x the cos to turn back into an angle
- * @return arccos(x)
- */
- public static double acos(double x)
- {
- boolean negative = x < 0;
- if (negative)
- x = -x;
- if (! (x <= 1))
- return Double.NaN;
- if (x == 1)
- return negative ? PI : 0;
- if (x < 0.5)
- {
- if (x < 1 / TWO_57)
- return PI / 2;
- double z = x * x;
- double p = z * (PS0 + z * (PS1 + z * (PS2 + z * (PS3 + z
- * (PS4 + z * PS5)))));
- double q = 1 + z * (QS1 + z * (QS2 + z * (QS3 + z * QS4)));
- double r = x - (PI_L / 2 - x * (p / q));
- return negative ? PI / 2 + r : PI / 2 - r;
- }
- if (negative) // x<=-0.5.
- {
- double z = (1 + x) * 0.5;
- double p = z * (PS0 + z * (PS1 + z * (PS2 + z * (PS3 + z
- * (PS4 + z * PS5)))));
- double q = 1 + z * (QS1 + z * (QS2 + z * (QS3 + z * QS4)));
- double s = sqrt(z);
- double w = p / q * s - PI_L / 2;
- return PI - 2 * (s + w);
- }
- double z = (1 - x) * 0.5; // x>0.5.
- double s = sqrt(z);
- double df = (float) s;
- double c = (z - df * df) / (s + df);
- double p = z * (PS0 + z * (PS1 + z * (PS2 + z * (PS3 + z
- * (PS4 + z * PS5)))));
- double q = 1 + z * (QS1 + z * (QS2 + z * (QS3 + z * QS4)));
- double w = p / q * s + c;
- return 2 * (df + w);
- }
-
- /**
- * The trigonometric function <em>arcsin</em>. The range of angles returned
- * is -pi/2 to pi/2 radians (-90 to 90 degrees). If the argument is NaN, the
- * result is NaN; and the arctangent of 0 retains its sign.
- *
- * @param x the tan to turn back into an angle
- * @return arcsin(x)
- * @see #atan2(double, double)
- */
- public static double atan(double x)
- {
- double lo;
- double hi;
- boolean negative = x < 0;
- if (negative)
- x = -x;
- if (x >= TWO_66)
- return negative ? -PI / 2 : PI / 2;
- if (! (x >= 0.4375)) // |x|<7/16, or NaN.
- {
- if (! (x >= 1 / TWO_29)) // Small, or NaN.
- return negative ? -x : x;
- lo = hi = 0;
- }
- else if (x < 1.1875)
- {
- if (x < 0.6875) // 7/16<=|x|<11/16.
- {
- x = (2 * x - 1) / (2 + x);
- hi = ATAN_0_5H;
- lo = ATAN_0_5L;
- }
- else // 11/16<=|x|<19/16.
- {
- x = (x - 1) / (x + 1);
- hi = PI / 4;
- lo = PI_L / 4;
- }
- }
- else if (x < 2.4375) // 19/16<=|x|<39/16.
- {
- x = (x - 1.5) / (1 + 1.5 * x);
- hi = ATAN_1_5H;
- lo = ATAN_1_5L;
- }
- else // 39/16<=|x|<2**66.
- {
- x = -1 / x;
- hi = PI / 2;
- lo = PI_L / 2;
- }
-
- // Break sum from i=0 to 10 ATi*z**(i+1) into odd and even poly.
- double z = x * x;
- double w = z * z;
- double s1 = z * (AT0 + w * (AT2 + w * (AT4 + w * (AT6 + w
- * (AT8 + w * AT10)))));
- double s2 = w * (AT1 + w * (AT3 + w * (AT5 + w * (AT7 + w * AT9))));
- if (hi == 0)
- return negative ? x * (s1 + s2) - x : x - x * (s1 + s2);
- z = hi - ((x * (s1 + s2) - lo) - x);
- return negative ? -z : z;
- }
-
- /**
- * A special version of the trigonometric function <em>arctan</em>, for
- * converting rectangular coordinates <em>(x, y)</em> to polar
- * <em>(r, theta)</em>. This computes the arctangent of x/y in the range
- * of -pi to pi radians (-180 to 180 degrees). Special cases:<ul>
- * <li>If either argument is NaN, the result is NaN.</li>
- * <li>If the first argument is positive zero and the second argument is
- * positive, or the first argument is positive and finite and the second
- * argument is positive infinity, then the result is positive zero.</li>
- * <li>If the first argument is negative zero and the second argument is
- * positive, or the first argument is negative and finite and the second
- * argument is positive infinity, then the result is negative zero.</li>
- * <li>If the first argument is positive zero and the second argument is
- * negative, or the first argument is positive and finite and the second
- * argument is negative infinity, then the result is the double value
- * closest to pi.</li>
- * <li>If the first argument is negative zero and the second argument is
- * negative, or the first argument is negative and finite and the second
- * argument is negative infinity, then the result is the double value
- * closest to -pi.</li>
- * <li>If the first argument is positive and the second argument is
- * positive zero or negative zero, or the first argument is positive
- * infinity and the second argument is finite, then the result is the
- * double value closest to pi/2.</li>
- * <li>If the first argument is negative and the second argument is
- * positive zero or negative zero, or the first argument is negative
- * infinity and the second argument is finite, then the result is the
- * double value closest to -pi/2.</li>
- * <li>If both arguments are positive infinity, then the result is the
- * double value closest to pi/4.</li>
- * <li>If the first argument is positive infinity and the second argument
- * is negative infinity, then the result is the double value closest to
- * 3*pi/4.</li>
- * <li>If the first argument is negative infinity and the second argument
- * is positive infinity, then the result is the double value closest to
- * -pi/4.</li>
- * <li>If both arguments are negative infinity, then the result is the
- * double value closest to -3*pi/4.</li>
- *
- * </ul><p>This returns theta, the angle of the point. To get r, albeit
- * slightly inaccurately, use sqrt(x*x+y*y).
- *
- * @param y the y position
- * @param x the x position
- * @return <em>theta</em> in the conversion of (x, y) to (r, theta)
- * @see #atan(double)
- */
- public static double atan2(double y, double x)
- {
- if (x != x || y != y)
- return Double.NaN;
- if (x == 1)
- return atan(y);
- if (x == Double.POSITIVE_INFINITY)
- {
- if (y == Double.POSITIVE_INFINITY)
- return PI / 4;
- if (y == Double.NEGATIVE_INFINITY)
- return -PI / 4;
- return 0 * y;
- }
- if (x == Double.NEGATIVE_INFINITY)
- {
- if (y == Double.POSITIVE_INFINITY)
- return 3 * PI / 4;
- if (y == Double.NEGATIVE_INFINITY)
- return -3 * PI / 4;
- return (1 / (0 * y) == Double.POSITIVE_INFINITY) ? PI : -PI;
- }
- if (y == 0)
- {
- if (1 / (0 * x) == Double.POSITIVE_INFINITY)
- return y;
- return (1 / y == Double.POSITIVE_INFINITY) ? PI : -PI;
- }
- if (y == Double.POSITIVE_INFINITY || y == Double.NEGATIVE_INFINITY
- || x == 0)
- return y < 0 ? -PI / 2 : PI / 2;
-
- double z = abs(y / x); // Safe to do y/x.
- if (z > TWO_60)
- z = PI / 2 + 0.5 * PI_L;
- else if (x < 0 && z < 1 / TWO_60)
- z = 0;
- else
- z = atan(z);
- if (x > 0)
- return y > 0 ? z : -z;
- return y > 0 ? PI - (z - PI_L) : z - PI_L - PI;
- }
-
- /**
- * Take <em>e</em><sup>a</sup>. The opposite of <code>log()</code>. If the
- * argument is NaN, the result is NaN; if the argument is positive infinity,
- * the result is positive infinity; and if the argument is negative
- * infinity, the result is positive zero.
- *
- * @param x the number to raise to the power
- * @return the number raised to the power of <em>e</em>
- * @see #log(double)
- * @see #pow(double, double)
- */
- public static double exp(double x)
- {
- if (x != x)
- return x;
- if (x > EXP_LIMIT_H)
- return Double.POSITIVE_INFINITY;
- if (x < EXP_LIMIT_L)
- return 0;
-
- // Argument reduction.
- double hi;
- double lo;
- int k;
- double t = abs(x);
- if (t > 0.5 * LN2)
- {
- if (t < 1.5 * LN2)
- {
- hi = t - LN2_H;
- lo = LN2_L;
- k = 1;
- }
- else
- {
- k = (int) (INV_LN2 * t + 0.5);
- hi = t - k * LN2_H;
- lo = k * LN2_L;
- }
- if (x < 0)
- {
- hi = -hi;
- lo = -lo;
- k = -k;
- }
- x = hi - lo;
- }
- else if (t < 1 / TWO_28)
- return 1;
- else
- lo = hi = k = 0;
-
- // Now x is in primary range.
- t = x * x;
- double c = x - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));
- if (k == 0)
- return 1 - (x * c / (c - 2) - x);
- double y = 1 - (lo - x * c / (2 - c) - hi);
- return scale(y, k);
- }
-
- /**
- * Take ln(a) (the natural log). The opposite of <code>exp()</code>. If the
- * argument is NaN or negative, the result is NaN; if the argument is
- * positive infinity, the result is positive infinity; and if the argument
- * is either zero, the result is negative infinity.
- *
- * <p>Note that the way to get log<sub>b</sub>(a) is to do this:
- * <code>ln(a) / ln(b)</code>.
- *
- * @param x the number to take the natural log of
- * @return the natural log of <code>a</code>
- * @see #exp(double)
- */
- public static double log(double x)
- {
- if (x == 0)
- return Double.NEGATIVE_INFINITY;
- if (x < 0)
- return Double.NaN;
- if (! (x < Double.POSITIVE_INFINITY))
- return x;
-
- // Normalize x.
- long bits = Double.doubleToLongBits(x);
- int exp = (int) (bits >> 52);
- if (exp == 0) // Subnormal x.
- {
- x *= TWO_54;
- bits = Double.doubleToLongBits(x);
- exp = (int) (bits >> 52) - 54;
- }
- exp -= 1023; // Unbias exponent.
- bits = (bits & 0x000fffffffffffffL) | 0x3ff0000000000000L;
- x = Double.longBitsToDouble(bits);
- if (x >= SQRT_2)
- {
- x *= 0.5;
- exp++;
- }
- x--;
- if (abs(x) < 1 / TWO_20)
- {
- if (x == 0)
- return exp * LN2_H + exp * LN2_L;
- double r = x * x * (0.5 - 1 / 3.0 * x);
- if (exp == 0)
- return x - r;
- return exp * LN2_H - ((r - exp * LN2_L) - x);
- }
- double s = x / (2 + x);
- double z = s * s;
- double w = z * z;
- double t1 = w * (LG2 + w * (LG4 + w * LG6));
- double t2 = z * (LG1 + w * (LG3 + w * (LG5 + w * LG7)));
- double r = t2 + t1;
- if (bits >= 0x3ff6174a00000000L && bits < 0x3ff6b85200000000L)
- {
- double h = 0.5 * x * x; // Need more accuracy for x near sqrt(2).
- if (exp == 0)
- return x - (h - s * (h + r));
- return exp * LN2_H - ((h - (s * (h + r) + exp * LN2_L)) - x);
- }
- if (exp == 0)
- return x - s * (x - r);
- return exp * LN2_H - ((s * (x - r) - exp * LN2_L) - x);
- }
-
- /**
- * Take a square root. If the argument is NaN or negative, the result is
- * NaN; if the argument is positive infinity, the result is positive
- * infinity; and if the result is either zero, the result is the same.
- *
- * <p>For other roots, use pow(x, 1/rootNumber).
- *
- * @param x the numeric argument
- * @return the square root of the argument
- * @see #pow(double, double)
- */
- public static double sqrt(double x)
- {
- if (x < 0)
- return Double.NaN;
- if (x == 0 || ! (x < Double.POSITIVE_INFINITY))
- return x;
-
- // Normalize x.
- long bits = Double.doubleToLongBits(x);
- int exp = (int) (bits >> 52);
- if (exp == 0) // Subnormal x.
- {
- x *= TWO_54;
- bits = Double.doubleToLongBits(x);
- exp = (int) (bits >> 52) - 54;
- }
- exp -= 1023; // Unbias exponent.
- bits = (bits & 0x000fffffffffffffL) | 0x0010000000000000L;
- if ((exp & 1) == 1) // Odd exp, double x to make it even.
- bits <<= 1;
- exp >>= 1;
-
- // Generate sqrt(x) bit by bit.
- bits <<= 1;
- long q = 0;
- long s = 0;
- long r = 0x0020000000000000L; // Move r right to left.
- while (r != 0)
- {
- long t = s + r;
- if (t <= bits)
- {
- s = t + r;
- bits -= t;
- q += r;
- }
- bits <<= 1;
- r >>= 1;
- }
-
- // Use floating add to round correctly.
- if (bits != 0)
- q += q & 1;
- return Double.longBitsToDouble((q >> 1) + ((exp + 1022L) << 52));
- }
-
- /**
- * Raise a number to a power. Special cases:<ul>
- * <li>If the second argument is positive or negative zero, then the result
- * is 1.0.</li>
- * <li>If the second argument is 1.0, then the result is the same as the
- * first argument.</li>
- * <li>If the second argument is NaN, then the result is NaN.</li>
- * <li>If the first argument is NaN and the second argument is nonzero,
- * then the result is NaN.</li>
- * <li>If the absolute value of the first argument is greater than 1 and
- * the second argument is positive infinity, or the absolute value of the
- * first argument is less than 1 and the second argument is negative
- * infinity, then the result is positive infinity.</li>
- * <li>If the absolute value of the first argument is greater than 1 and
- * the second argument is negative infinity, or the absolute value of the
- * first argument is less than 1 and the second argument is positive
- * infinity, then the result is positive zero.</li>
- * <li>If the absolute value of the first argument equals 1 and the second
- * argument is infinite, then the result is NaN.</li>
- * <li>If the first argument is positive zero and the second argument is
- * greater than zero, or the first argument is positive infinity and the
- * second argument is less than zero, then the result is positive zero.</li>
- * <li>If the first argument is positive zero and the second argument is
- * less than zero, or the first argument is positive infinity and the
- * second argument is greater than zero, then the result is positive
- * infinity.</li>
- * <li>If the first argument is negative zero and the second argument is
- * greater than zero but not a finite odd integer, or the first argument is
- * negative infinity and the second argument is less than zero but not a
- * finite odd integer, then the result is positive zero.</li>
- * <li>If the first argument is negative zero and the second argument is a
- * positive finite odd integer, or the first argument is negative infinity
- * and the second argument is a negative finite odd integer, then the result
- * is negative zero.</li>
- * <li>If the first argument is negative zero and the second argument is
- * less than zero but not a finite odd integer, or the first argument is
- * negative infinity and the second argument is greater than zero but not a
- * finite odd integer, then the result is positive infinity.</li>
- * <li>If the first argument is negative zero and the second argument is a
- * negative finite odd integer, or the first argument is negative infinity
- * and the second argument is a positive finite odd integer, then the result
- * is negative infinity.</li>
- * <li>If the first argument is less than zero and the second argument is a
- * finite even integer, then the result is equal to the result of raising
- * the absolute value of the first argument to the power of the second
- * argument.</li>
- * <li>If the first argument is less than zero and the second argument is a
- * finite odd integer, then the result is equal to the negative of the
- * result of raising the absolute value of the first argument to the power
- * of the second argument.</li>
- * <li>If the first argument is finite and less than zero and the second
- * argument is finite and not an integer, then the result is NaN.</li>
- * <li>If both arguments are integers, then the result is exactly equal to
- * the mathematical result of raising the first argument to the power of
- * the second argument if that result can in fact be represented exactly as
- * a double value.</li>
- *
- * </ul><p>(In the foregoing descriptions, a floating-point value is
- * considered to be an integer if and only if it is a fixed point of the
- * method {@link #ceil(double)} or, equivalently, a fixed point of the
- * method {@link #floor(double)}. A value is a fixed point of a one-argument
- * method if and only if the result of applying the method to the value is
- * equal to the value.)
- *
- * @param x the number to raise
- * @param y the power to raise it to
- * @return x<sup>y</sup>
- */
- public static double pow(double x, double y)
- {
- // Special cases first.
- if (y == 0)
- return 1;
- if (y == 1)
- return x;
- if (y == -1)
- return 1 / x;
- if (x != x || y != y)
- return Double.NaN;
-
- // When x < 0, yisint tells if y is not an integer (0), even(1),
- // or odd (2).
- int yisint = 0;
- if (x < 0 && floor(y) == y)
- yisint = (y % 2 == 0) ? 2 : 1;
- double ax = abs(x);
- double ay = abs(y);
-
- // More special cases, of y.
- if (ay == Double.POSITIVE_INFINITY)
- {
- if (ax == 1)
- return Double.NaN;
- if (ax > 1)
- return y > 0 ? y : 0;
- return y < 0 ? -y : 0;
- }
- if (y == 2)
- return x * x;
- if (y == 0.5)
- return sqrt(x);
-
- // More special cases, of x.
- if (x == 0 || ax == Double.POSITIVE_INFINITY || ax == 1)
- {
- if (y < 0)
- ax = 1 / ax;
- if (x < 0)
- {
- if (x == -1 && yisint == 0)
- ax = Double.NaN;
- else if (yisint == 1)
- ax = -ax;
- }
- return ax;
- }
- if (x < 0 && yisint == 0)
- return Double.NaN;
-
- // Now we can start!
- double t;
- double t1;
- double t2;
- double u;
- double v;
- double w;
- if (ay > TWO_31)
- {
- if (ay > TWO_64) // Automatic over/underflow.
- return ((ax < 1) ? y < 0 : y > 0) ? Double.POSITIVE_INFINITY : 0;
- // Over/underflow if x is not close to one.
- if (ax < 0.9999995231628418)
- return y < 0 ? Double.POSITIVE_INFINITY : 0;
- if (ax >= 1.0000009536743164)
- return y > 0 ? Double.POSITIVE_INFINITY : 0;
- // Now |1-x| is <= 2**-20, sufficient to compute
- // log(x) by x-x^2/2+x^3/3-x^4/4.
- t = x - 1;
- w = t * t * (0.5 - t * (1 / 3.0 - t * 0.25));
- u = INV_LN2_H * t;
- v = t * INV_LN2_L - w * INV_LN2;
- t1 = (float) (u + v);
- t2 = v - (t1 - u);
- }
- else
- {
- long bits = Double.doubleToLongBits(ax);
- int exp = (int) (bits >> 52);
- if (exp == 0) // Subnormal x.
- {
- ax *= TWO_54;
- bits = Double.doubleToLongBits(ax);
- exp = (int) (bits >> 52) - 54;
- }
- exp -= 1023; // Unbias exponent.
- ax = Double.longBitsToDouble((bits & 0x000fffffffffffffL)
- | 0x3ff0000000000000L);
- boolean k;
- if (ax < SQRT_1_5) // |x|<sqrt(3/2).
- k = false;
- else if (ax < SQRT_3) // |x|<sqrt(3).
- k = true;
- else
- {
- k = false;
- ax *= 0.5;
- exp++;
- }
-
- // Compute s = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5).
- u = ax - (k ? 1.5 : 1);
- v = 1 / (ax + (k ? 1.5 : 1));
- double s = u * v;
- double s_h = (float) s;
- double t_h = (float) (ax + (k ? 1.5 : 1));
- double t_l = ax - (t_h - (k ? 1.5 : 1));
- double s_l = v * ((u - s_h * t_h) - s_h * t_l);
- // Compute log(ax).
- double s2 = s * s;
- double r = s_l * (s_h + s) + s2 * s2
- * (L1 + s2 * (L2 + s2 * (L3 + s2 * (L4 + s2 * (L5 + s2 * L6)))));
- s2 = s_h * s_h;
- t_h = (float) (3.0 + s2 + r);
- t_l = r - (t_h - 3.0 - s2);
- // u+v = s*(1+...).
- u = s_h * t_h;
- v = s_l * t_h + t_l * s;
- // 2/(3log2)*(s+...).
- double p_h = (float) (u + v);
- double p_l = v - (p_h - u);
- double z_h = CP_H * p_h;
- double z_l = CP_L * p_h + p_l * CP + (k ? DP_L : 0);
- // log2(ax) = (s+..)*2/(3*log2) = exp + dp_h + z_h + z_l.
- t = exp;
- t1 = (float) (z_h + z_l + (k ? DP_H : 0) + t);
- t2 = z_l - (t1 - t - (k ? DP_H : 0) - z_h);
- }
-
- // Split up y into y1+y2 and compute (y1+y2)*(t1+t2).
- boolean negative = x < 0 && yisint == 1;
- double y1 = (float) y;
- double p_l = (y - y1) * t1 + y * t2;
- double p_h = y1 * t1;
- double z = p_l + p_h;
- if (z >= 1024) // Detect overflow.
- {
- if (z > 1024 || p_l + OVT > z - p_h)
- return negative ? Double.NEGATIVE_INFINITY
- : Double.POSITIVE_INFINITY;
- }
- else if (z <= -1075) // Detect underflow.
- {
- if (z < -1075 || p_l <= z - p_h)
- return negative ? -0.0 : 0;
- }
-
- // Compute 2**(p_h+p_l).
- int n = round((float) z);
- p_h -= n;
- t = (float) (p_l + p_h);
- u = t * LN2_H;
- v = (p_l - (t - p_h)) * LN2 + t * LN2_L;
- z = u + v;
- w = v - (z - u);
- t = z * z;
- t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));
- double r = (z * t1) / (t1 - 2) - (w + z * w);
- z = scale(1 - (r - z), n);
- return negative ? -z : z;
- }
-
- /**
- * Get the IEEE 754 floating point remainder on two numbers. This is the
- * value of <code>x - y * <em>n</em></code>, where <em>n</em> is the closest
- * double to <code>x / y</code> (ties go to the even n); for a zero
- * remainder, the sign is that of <code>x</code>. If either argument is NaN,
- * the first argument is infinite, or the second argument is zero, the result
- * is NaN; if x is finite but y is infinite, the result is x.
- *
- * @param x the dividend (the top half)
- * @param y the divisor (the bottom half)
- * @return the IEEE 754-defined floating point remainder of x/y
- * @see #rint(double)
- */
- public static double IEEEremainder(double x, double y)
- {
- // Purge off exception values.
- if (x == Double.NEGATIVE_INFINITY || ! (x < Double.POSITIVE_INFINITY)
- || y == 0 || y != y)
- return Double.NaN;
-
- boolean negative = x < 0;
- x = abs(x);
- y = abs(y);
- if (x == y || x == 0)
- return 0 * x; // Get correct sign.
-
- // Achieve x < 2y, then take first shot at remainder.
- if (y < TWO_1023)
- x %= y + y;
-
- // Now adjust x to get correct precision.
- if (y < 4 / TWO_1023)
- {
- if (x + x > y)
- {
- x -= y;
- if (x + x >= y)
- x -= y;
- }
- }
- else
- {
- y *= 0.5;
- if (x > y)
- {
- x -= y;
- if (x >= y)
- x -= y;
- }
- }
- return negative ? -x : x;
- }
-
- /**
- * Take the nearest integer that is that is greater than or equal to the
- * argument. If the argument is NaN, infinite, or zero, the result is the
- * same; if the argument is between -1 and 0, the result is negative zero.
- * Note that <code>Math.ceil(x) == -Math.floor(-x)</code>.
- *
- * @param a the value to act upon
- * @return the nearest integer &gt;= <code>a</code>
- */
- public static double ceil(double a)
- {
- return -floor(-a);
- }
-
- /**
- * Take the nearest integer that is that is less than or equal to the
- * argument. If the argument is NaN, infinite, or zero, the result is the
- * same. Note that <code>Math.ceil(x) == -Math.floor(-x)</code>.
- *
- * @param a the value to act upon
- * @return the nearest integer &lt;= <code>a</code>
- */
- public static double floor(double a)
- {
- double x = abs(a);
- if (! (x < TWO_52) || (long) a == a)
- return a; // No fraction bits; includes NaN and infinity.
- if (x < 1)
- return a >= 0 ? 0 * a : -1; // Worry about signed zero.
- return a < 0 ? (long) a - 1.0 : (long) a; // Cast to long truncates.
- }
-
- /**
- * Take the nearest integer to the argument. If it is exactly between
- * two integers, the even integer is taken. If the argument is NaN,
- * infinite, or zero, the result is the same.
- *
- * @param a the value to act upon
- * @return the nearest integer to <code>a</code>
- */
- public static double rint(double a)
- {
- double x = abs(a);
- if (! (x < TWO_52))
- return a; // No fraction bits; includes NaN and infinity.
- if (x <= 0.5)
- return 0 * a; // Worry about signed zero.
- if (x % 2 <= 0.5)
- return (long) a; // Catch round down to even.
- return (long) (a + (a < 0 ? -0.5 : 0.5)); // Cast to long truncates.
- }
-
- /**
- * Take the nearest integer to the argument. This is equivalent to
- * <code>(int) Math.floor(f + 0.5f)</code>. If the argument is NaN, the
- * result is 0; otherwise if the argument is outside the range of int, the
- * result will be Integer.MIN_VALUE or Integer.MAX_VALUE, as appropriate.
- *
- * @param f the argument to round
- * @return the nearest integer to the argument
- * @see Integer#MIN_VALUE
- * @see Integer#MAX_VALUE
- */
- public static int round(float f)
- {
- return (int) floor(f + 0.5f);
- }
-
- /**
- * Take the nearest long to the argument. This is equivalent to
- * <code>(long) Math.floor(d + 0.5)</code>. If the argument is NaN, the
- * result is 0; otherwise if the argument is outside the range of long, the
- * result will be Long.MIN_VALUE or Long.MAX_VALUE, as appropriate.
- *
- * @param d the argument to round
- * @return the nearest long to the argument
- * @see Long#MIN_VALUE
- * @see Long#MAX_VALUE
- */
- public static long round(double d)
- {
- return (long) floor(d + 0.5);
- }
-
- /**
- * Get a random number. This behaves like Random.nextDouble(), seeded by
- * System.currentTimeMillis() when first called. In other words, the number
- * is from a pseudorandom sequence, and lies in the range [+0.0, 1.0).
- * This random sequence is only used by this method, and is threadsafe,
- * although you may want your own random number generator if it is shared
- * among threads.
- *
- * @return a random number
- * @see Random#nextDouble()
- * @see System#currentTimeMillis()
- */
- public static synchronized double random()
- {
- if (rand == null)
- rand = new Random();
- return rand.nextDouble();
- }
-
- /**
- * Convert from degrees to radians. The formula for this is
- * radians = degrees * (pi/180); however it is not always exact given the
- * limitations of floating point numbers.
- *
- * @param degrees an angle in degrees
- * @return the angle in radians
- */
- public static double toRadians(double degrees)
- {
- return (degrees * PI) / 180;
- }
-
- /**
- * Convert from radians to degrees. The formula for this is
- * degrees = radians * (180/pi); however it is not always exact given the
- * limitations of floating point numbers.
- *
- * @param rads an angle in radians
- * @return the angle in degrees
- */
- public static double toDegrees(double rads)
- {
- return (rads * 180) / PI;
- }
-
- /**
- * Constants for scaling and comparing doubles by powers of 2. The compiler
- * must automatically inline constructs like (1/TWO_54), so we don't list
- * negative powers of two here.
- */
- private static final double
- TWO_16 = 0x10000, // Long bits 0x40f0000000000000L.
- TWO_20 = 0x100000, // Long bits 0x4130000000000000L.
- TWO_24 = 0x1000000, // Long bits 0x4170000000000000L.
- TWO_27 = 0x8000000, // Long bits 0x41a0000000000000L.
- TWO_28 = 0x10000000, // Long bits 0x41b0000000000000L.
- TWO_29 = 0x20000000, // Long bits 0x41c0000000000000L.
- TWO_31 = 0x80000000L, // Long bits 0x41e0000000000000L.
- TWO_49 = 0x2000000000000L, // Long bits 0x4300000000000000L.
- TWO_52 = 0x10000000000000L, // Long bits 0x4330000000000000L.
- TWO_54 = 0x40000000000000L, // Long bits 0x4350000000000000L.
- TWO_57 = 0x200000000000000L, // Long bits 0x4380000000000000L.
- TWO_60 = 0x1000000000000000L, // Long bits 0x43b0000000000000L.
- TWO_64 = 1.8446744073709552e19, // Long bits 0x43f0000000000000L.
- TWO_66 = 7.378697629483821e19, // Long bits 0x4410000000000000L.
- TWO_1023 = 8.98846567431158e307; // Long bits 0x7fe0000000000000L.
-
- /**
- * Super precision for 2/pi in 24-bit chunks, for use in
- * {@link #remPiOver2()}.
- */
- private static final int TWO_OVER_PI[] = {
- 0xa2f983, 0x6e4e44, 0x1529fc, 0x2757d1, 0xf534dd, 0xc0db62,
- 0x95993c, 0x439041, 0xfe5163, 0xabdebb, 0xc561b7, 0x246e3a,
- 0x424dd2, 0xe00649, 0x2eea09, 0xd1921c, 0xfe1deb, 0x1cb129,
- 0xa73ee8, 0x8235f5, 0x2ebb44, 0x84e99c, 0x7026b4, 0x5f7e41,
- 0x3991d6, 0x398353, 0x39f49c, 0x845f8b, 0xbdf928, 0x3b1ff8,
- 0x97ffde, 0x05980f, 0xef2f11, 0x8b5a0a, 0x6d1f6d, 0x367ecf,
- 0x27cb09, 0xb74f46, 0x3f669e, 0x5fea2d, 0x7527ba, 0xc7ebe5,
- 0xf17b3d, 0x0739f7, 0x8a5292, 0xea6bfb, 0x5fb11f, 0x8d5d08,
- 0x560330, 0x46fc7b, 0x6babf0, 0xcfbc20, 0x9af436, 0x1da9e3,
- 0x91615e, 0xe61b08, 0x659985, 0x5f14a0, 0x68408d, 0xffd880,
- 0x4d7327, 0x310606, 0x1556ca, 0x73a8c9, 0x60e27b, 0xc08c6b,
- };
-
- /**
- * Super precision for pi/2 in 24-bit chunks, for use in
- * {@link #remPiOver2()}.
- */
- private static final double PI_OVER_TWO[] = {
- 1.570796251296997, // Long bits 0x3ff921fb40000000L.
- 7.549789415861596e-8, // Long bits 0x3e74442d00000000L.
- 5.390302529957765e-15, // Long bits 0x3cf8469880000000L.
- 3.282003415807913e-22, // Long bits 0x3b78cc5160000000L.
- 1.270655753080676e-29, // Long bits 0x39f01b8380000000L.
- 1.2293330898111133e-36, // Long bits 0x387a252040000000L.
- 2.7337005381646456e-44, // Long bits 0x36e3822280000000L.
- 2.1674168387780482e-51, // Long bits 0x3569f31d00000000L.
- };
-
- /**
- * More constants related to pi, used in {@link #remPiOver2()} and
- * elsewhere.
- */
- private static final double
- PI_L = 1.2246467991473532e-16, // Long bits 0x3ca1a62633145c07L.
- PIO2_1 = 1.5707963267341256, // Long bits 0x3ff921fb54400000L.
- PIO2_1L = 6.077100506506192e-11, // Long bits 0x3dd0b4611a626331L.
- PIO2_2 = 6.077100506303966e-11, // Long bits 0x3dd0b4611a600000L.
- PIO2_2L = 2.0222662487959506e-21, // Long bits 0x3ba3198a2e037073L.
- PIO2_3 = 2.0222662487111665e-21, // Long bits 0x3ba3198a2e000000L.
- PIO2_3L = 8.4784276603689e-32; // Long bits 0x397b839a252049c1L.
-
- /**
- * Natural log and square root constants, for calculation of
- * {@link #exp(double)}, {@link #log(double)} and
- * {@link #power(double, double)}. CP is 2/(3*ln(2)).
- */
- private static final double
- SQRT_1_5 = 1.224744871391589, // Long bits 0x3ff3988e1409212eL.
- SQRT_2 = 1.4142135623730951, // Long bits 0x3ff6a09e667f3bcdL.
- SQRT_3 = 1.7320508075688772, // Long bits 0x3ffbb67ae8584caaL.
- EXP_LIMIT_H = 709.782712893384, // Long bits 0x40862e42fefa39efL.
- EXP_LIMIT_L = -745.1332191019411, // Long bits 0xc0874910d52d3051L.
- CP = 0.9617966939259756, // Long bits 0x3feec709dc3a03fdL.
- CP_H = 0.9617967009544373, // Long bits 0x3feec709e0000000L.
- CP_L = -7.028461650952758e-9, // Long bits 0xbe3e2fe0145b01f5L.
- LN2 = 0.6931471805599453, // Long bits 0x3fe62e42fefa39efL.
- LN2_H = 0.6931471803691238, // Long bits 0x3fe62e42fee00000L.
- LN2_L = 1.9082149292705877e-10, // Long bits 0x3dea39ef35793c76L.
- INV_LN2 = 1.4426950408889634, // Long bits 0x3ff71547652b82feL.
- INV_LN2_H = 1.4426950216293335, // Long bits 0x3ff7154760000000L.
- INV_LN2_L = 1.9259629911266175e-8; // Long bits 0x3e54ae0bf85ddf44L.
-
- /**
- * Constants for computing {@link #log(double)}.
- */
- private static final double
- LG1 = 0.6666666666666735, // Long bits 0x3fe5555555555593L.
- LG2 = 0.3999999999940942, // Long bits 0x3fd999999997fa04L.
- LG3 = 0.2857142874366239, // Long bits 0x3fd2492494229359L.
- LG4 = 0.22222198432149784, // Long bits 0x3fcc71c51d8e78afL.
- LG5 = 0.1818357216161805, // Long bits 0x3fc7466496cb03deL.
- LG6 = 0.15313837699209373, // Long bits 0x3fc39a09d078c69fL.
- LG7 = 0.14798198605116586; // Long bits 0x3fc2f112df3e5244L.
-
- /**
- * Constants for computing {@link #pow(double, double)}. L and P are
- * coefficients for series; OVT is -(1024-log2(ovfl+.5ulp)); and DP is ???.
- * The P coefficients also calculate {@link #exp(double)}.
- */
- private static final double
- L1 = 0.5999999999999946, // Long bits 0x3fe3333333333303L.
- L2 = 0.4285714285785502, // Long bits 0x3fdb6db6db6fabffL.
- L3 = 0.33333332981837743, // Long bits 0x3fd55555518f264dL.
- L4 = 0.272728123808534, // Long bits 0x3fd17460a91d4101L.
- L5 = 0.23066074577556175, // Long bits 0x3fcd864a93c9db65L.
- L6 = 0.20697501780033842, // Long bits 0x3fca7e284a454eefL.
- P1 = 0.16666666666666602, // Long bits 0x3fc555555555553eL.
- P2 = -2.7777777777015593e-3, // Long bits 0xbf66c16c16bebd93L.
- P3 = 6.613756321437934e-5, // Long bits 0x3f11566aaf25de2cL.
- P4 = -1.6533902205465252e-6, // Long bits 0xbebbbd41c5d26bf1L.
- P5 = 4.1381367970572385e-8, // Long bits 0x3e66376972bea4d0L.
- DP_H = 0.5849624872207642, // Long bits 0x3fe2b80340000000L.
- DP_L = 1.350039202129749e-8, // Long bits 0x3e4cfdeb43cfd006L.
- OVT = 8.008566259537294e-17; // Long bits 0x3c971547652b82feL.
-
- /**
- * Coefficients for computing {@link #sin(double)}.
- */
- private static final double
- S1 = -0.16666666666666632, // Long bits 0xbfc5555555555549L.
- S2 = 8.33333333332249e-3, // Long bits 0x3f8111111110f8a6L.
- S3 = -1.984126982985795e-4, // Long bits 0xbf2a01a019c161d5L.
- S4 = 2.7557313707070068e-6, // Long bits 0x3ec71de357b1fe7dL.
- S5 = -2.5050760253406863e-8, // Long bits 0xbe5ae5e68a2b9cebL.
- S6 = 1.58969099521155e-10; // Long bits 0x3de5d93a5acfd57cL.
-
- /**
- * Coefficients for computing {@link #cos(double)}.
- */
- private static final double
- C1 = 0.0416666666666666, // Long bits 0x3fa555555555554cL.
- C2 = -1.388888888887411e-3, // Long bits 0xbf56c16c16c15177L.
- C3 = 2.480158728947673e-5, // Long bits 0x3efa01a019cb1590L.
- C4 = -2.7557314351390663e-7, // Long bits 0xbe927e4f809c52adL.
- C5 = 2.087572321298175e-9, // Long bits 0x3e21ee9ebdb4b1c4L.
- C6 = -1.1359647557788195e-11; // Long bits 0xbda8fae9be8838d4L.
-
- /**
- * Coefficients for computing {@link #tan(double)}.
- */
- private static final double
- T0 = 0.3333333333333341, // Long bits 0x3fd5555555555563L.
- T1 = 0.13333333333320124, // Long bits 0x3fc111111110fe7aL.
- T2 = 0.05396825397622605, // Long bits 0x3faba1ba1bb341feL.
- T3 = 0.021869488294859542, // Long bits 0x3f9664f48406d637L.
- T4 = 8.8632398235993e-3, // Long bits 0x3f8226e3e96e8493L.
- T5 = 3.5920791075913124e-3, // Long bits 0x3f6d6d22c9560328L.
- T6 = 1.4562094543252903e-3, // Long bits 0x3f57dbc8fee08315L.
- T7 = 5.880412408202641e-4, // Long bits 0x3f4344d8f2f26501L.
- T8 = 2.464631348184699e-4, // Long bits 0x3f3026f71a8d1068L.
- T9 = 7.817944429395571e-5, // Long bits 0x3f147e88a03792a6L.
- T10 = 7.140724913826082e-5, // Long bits 0x3f12b80f32f0a7e9L.
- T11 = -1.8558637485527546e-5, // Long bits 0xbef375cbdb605373L.
- T12 = 2.590730518636337e-5; // Long bits 0x3efb2a7074bf7ad4L.
-
- /**
- * Coefficients for computing {@link #asin(double)} and
- * {@link #acos(double)}.
- */
- private static final double
- PS0 = 0.16666666666666666, // Long bits 0x3fc5555555555555L.
- PS1 = -0.3255658186224009, // Long bits 0xbfd4d61203eb6f7dL.
- PS2 = 0.20121253213486293, // Long bits 0x3fc9c1550e884455L.
- PS3 = -0.04005553450067941, // Long bits 0xbfa48228b5688f3bL.
- PS4 = 7.915349942898145e-4, // Long bits 0x3f49efe07501b288L.
- PS5 = 3.479331075960212e-5, // Long bits 0x3f023de10dfdf709L.
- QS1 = -2.403394911734414, // Long bits 0xc0033a271c8a2d4bL.
- QS2 = 2.0209457602335057, // Long bits 0x40002ae59c598ac8L.
- QS3 = -0.6882839716054533, // Long bits 0xbfe6066c1b8d0159L.
- QS4 = 0.07703815055590194; // Long bits 0x3fb3b8c5b12e9282L.
-
- /**
- * Coefficients for computing {@link #atan(double)}.
- */
- private static final double
- ATAN_0_5H = 0.4636476090008061, // Long bits 0x3fddac670561bb4fL.
- ATAN_0_5L = 2.2698777452961687e-17, // Long bits 0x3c7a2b7f222f65e2L.
- ATAN_1_5H = 0.982793723247329, // Long bits 0x3fef730bd281f69bL.
- ATAN_1_5L = 1.3903311031230998e-17, // Long bits 0x3c7007887af0cbbdL.
- AT0 = 0.3333333333333293, // Long bits 0x3fd555555555550dL.
- AT1 = -0.19999999999876483, // Long bits 0xbfc999999998ebc4L.
- AT2 = 0.14285714272503466, // Long bits 0x3fc24924920083ffL.
- AT3 = -0.11111110405462356, // Long bits 0xbfbc71c6fe231671L.
- AT4 = 0.09090887133436507, // Long bits 0x3fb745cdc54c206eL.
- AT5 = -0.0769187620504483, // Long bits 0xbfb3b0f2af749a6dL.
- AT6 = 0.06661073137387531, // Long bits 0x3fb10d66a0d03d51L.
- AT7 = -0.058335701337905735, // Long bits 0xbfadde2d52defd9aL.
- AT8 = 0.049768779946159324, // Long bits 0x3fa97b4b24760debL.
- AT9 = -0.036531572744216916, // Long bits 0xbfa2b4442c6a6c2fL.
- AT10 = 0.016285820115365782; // Long bits 0x3f90ad3ae322da11L.
-
- /**
- * Helper function for reducing an angle to a multiple of pi/2 within
- * [-pi/4, pi/4].
- *
- * @param x the angle; not infinity or NaN, and outside pi/4
- * @param y an array of 2 doubles modified to hold the remander x % pi/2
- * @return the quadrant of the result, mod 4: 0: [-pi/4, pi/4],
- * 1: [pi/4, 3*pi/4], 2: [3*pi/4, 5*pi/4], 3: [-3*pi/4, -pi/4]
- */
- private static int remPiOver2(double x, double[] y)
- {
- boolean negative = x < 0;
- x = abs(x);
- double z;
- int n;
- if (Configuration.DEBUG && (x <= PI / 4 || x != x
- || x == Double.POSITIVE_INFINITY))
- throw new InternalError("Assertion failure");
- if (x < 3 * PI / 4) // If |x| is small.
- {
- z = x - PIO2_1;
- if ((float) x != (float) (PI / 2)) // 33+53 bit pi is good enough.
- {
- y[0] = z - PIO2_1L;
- y[1] = z - y[0] - PIO2_1L;
- }
- else // Near pi/2, use 33+33+53 bit pi.
- {
- z -= PIO2_2;
- y[0] = z - PIO2_2L;
- y[1] = z - y[0] - PIO2_2L;
- }
- n = 1;
- }
- else if (x <= TWO_20 * PI / 2) // Medium size.
- {
- n = (int) (2 / PI * x + 0.5);
- z = x - n * PIO2_1;
- double w = n * PIO2_1L; // First round good to 85 bits.
- y[0] = z - w;
- if (n >= 32 || (float) x == (float) (w))
- {
- if (x / y[0] >= TWO_16) // Second iteration, good to 118 bits.
- {
- double t = z;
- w = n * PIO2_2;
- z = t - w;
- w = n * PIO2_2L - (t - z - w);
- y[0] = z - w;
- if (x / y[0] >= TWO_49) // Third iteration, 151 bits accuracy.
- {
- t = z;
- w = n * PIO2_3;
- z = t - w;
- w = n * PIO2_3L - (t - z - w);
- y[0] = z - w;
- }
- }
- }
- y[1] = z - y[0] - w;
- }
- else
- {
- // All other (large) arguments.
- int e0 = (int) (Double.doubleToLongBits(x) >> 52) - 1046;
- z = scale(x, -e0); // e0 = ilogb(z) - 23.
- double[] tx = new double[3];
- for (int i = 0; i < 2; i++)
- {
- tx[i] = (int) z;
- z = (z - tx[i]) * TWO_24;
- }
- tx[2] = z;
- int nx = 2;
- while (tx[nx] == 0)
- nx--;
- n = remPiOver2(tx, y, e0, nx);
- }
- if (negative)
- {
- y[0] = -y[0];
- y[1] = -y[1];
- return -n;
- }
- return n;
- }
-
- /**
- * Helper function for reducing an angle to a multiple of pi/2 within
- * [-pi/4, pi/4].
- *
- * @param x the positive angle, broken into 24-bit chunks
- * @param y an array of 2 doubles modified to hold the remander x % pi/2
- * @param e0 the exponent of x[0]
- * @param nx the last index used in x
- * @return the quadrant of the result, mod 4: 0: [-pi/4, pi/4],
- * 1: [pi/4, 3*pi/4], 2: [3*pi/4, 5*pi/4], 3: [-3*pi/4, -pi/4]
- */
- private static int remPiOver2(double[] x, double[] y, int e0, int nx)
- {
- int i;
- int ih;
- int n;
- double fw;
- double z;
- int[] iq = new int[20];
- double[] f = new double[20];
- double[] q = new double[20];
- boolean recompute = false;
-
- // Initialize jk, jz, jv, q0; note that 3>q0.
- int jk = 4;
- int jz = jk;
- int jv = max((e0 - 3) / 24, 0);
- int q0 = e0 - 24 * (jv + 1);
-
- // Set up f[0] to f[nx+jk] where f[nx+jk] = TWO_OVER_PI[jv+jk].
- int j = jv - nx;
- int m = nx + jk;
- for (i = 0; i <= m; i++, j++)
- f[i] = (j < 0) ? 0 : TWO_OVER_PI[j];
-
- // Compute q[0],q[1],...q[jk].
- for (i = 0; i <= jk; i++)
- {
- for (j = 0, fw = 0; j <= nx; j++)
- fw += x[j] * f[nx + i - j];
- q[i] = fw;
- }
-
- do
- {
- // Distill q[] into iq[] reversingly.
- for (i = 0, j = jz, z = q[jz]; j > 0; i++, j--)
- {
- fw = (int) (1 / TWO_24 * z);
- iq[i] = (int) (z - TWO_24 * fw);
- z = q[j - 1] + fw;
- }
-
- // Compute n.
- z = scale(z, q0);
- z -= 8 * floor(z * 0.125); // Trim off integer >= 8.
- n = (int) z;
- z -= n;
- ih = 0;
- if (q0 > 0) // Need iq[jz-1] to determine n.
- {
- i = iq[jz - 1] >> (24 - q0);
- n += i;
- iq[jz - 1] -= i << (24 - q0);
- ih = iq[jz - 1] >> (23 - q0);
- }
- else if (q0 == 0)
- ih = iq[jz - 1] >> 23;
- else if (z >= 0.5)
- ih = 2;
-
- if (ih > 0) // If q > 0.5.
- {
- n += 1;
- int carry = 0;
- for (i = 0; i < jz; i++) // Compute 1-q.
- {
- j = iq[i];
- if (carry == 0)
- {
- if (j != 0)
- {
- carry = 1;
- iq[i] = 0x1000000 - j;
- }
- }
- else
- iq[i] = 0xffffff - j;
- }
- switch (q0)
- {
- case 1: // Rare case: chance is 1 in 12 for non-default.
- iq[jz - 1] &= 0x7fffff;
- break;
- case 2:
- iq[jz - 1] &= 0x3fffff;
- }
- if (ih == 2)
- {
- z = 1 - z;
- if (carry != 0)
- z -= scale(1, q0);
- }
- }
-
- // Check if recomputation is needed.
- if (z == 0)
- {
- j = 0;
- for (i = jz - 1; i >= jk; i--)
- j |= iq[i];
- if (j == 0) // Need recomputation.
- {
- int k;
- for (k = 1; iq[jk - k] == 0; k++); // k = no. of terms needed.
-
- for (i = jz + 1; i <= jz + k; i++) // Add q[jz+1] to q[jz+k].
- {
- f[nx + i] = TWO_OVER_PI[jv + i];
- for (j = 0, fw = 0; j <= nx; j++)
- fw += x[j] * f[nx + i - j];
- q[i] = fw;
- }
- jz += k;
- recompute = true;
- }
- }
- }
- while (recompute);
-
- // Chop off zero terms.
- if (z == 0)
- {
- jz--;
- q0 -= 24;
- while (iq[jz] == 0)
- {
- jz--;
- q0 -= 24;
- }
- }
- else // Break z into 24-bit if necessary.
- {
- z = scale(z, -q0);
- if (z >= TWO_24)
- {
- fw = (int) (1 / TWO_24 * z);
- iq[jz] = (int) (z - TWO_24 * fw);
- jz++;
- q0 += 24;
- iq[jz] = (int) fw;
- }
- else
- iq[jz] = (int) z;
- }
-
- // Convert integer "bit" chunk to floating-point value.
- fw = scale(1, q0);
- for (i = jz; i >= 0; i--)
- {
- q[i] = fw * iq[i];
- fw *= 1 / TWO_24;
- }
-
- // Compute PI_OVER_TWO[0,...,jk]*q[jz,...,0].
- double[] fq = new double[20];
- for (i = jz; i >= 0; i--)
- {
- fw = 0;
- for (int k = 0; k <= jk && k <= jz - i; k++)
- fw += PI_OVER_TWO[k] * q[i + k];
- fq[jz - i] = fw;
- }
-
- // Compress fq[] into y[].
- fw = 0;
- for (i = jz; i >= 0; i--)
- fw += fq[i];
- y[0] = (ih == 0) ? fw : -fw;
- fw = fq[0] - fw;
- for (i = 1; i <= jz; i++)
- fw += fq[i];
- y[1] = (ih == 0) ? fw : -fw;
- return n;
- }
-
- /**
- * Helper method for scaling a double by a power of 2.
- *
- * @param x the double
- * @param n the scale; |n| < 2048
- * @return x * 2**n
- */
- private static double scale(double x, int n)
- {
- if (Configuration.DEBUG && abs(n) >= 2048)
- throw new InternalError("Assertion failure");
- if (x == 0 || x == Double.NEGATIVE_INFINITY
- || ! (x < Double.POSITIVE_INFINITY) || n == 0)
- return x;
- long bits = Double.doubleToLongBits(x);
- int exp = (int) (bits >> 52) & 0x7ff;
- if (exp == 0) // Subnormal x.
- {
- x *= TWO_54;
- exp = ((int) (Double.doubleToLongBits(x) >> 52) & 0x7ff) - 54;
- }
- exp += n;
- if (exp > 0x7fe) // Overflow.
- return Double.POSITIVE_INFINITY * x;
- if (exp > 0) // Normal.
- return Double.longBitsToDouble((bits & 0x800fffffffffffffL)
- | ((long) exp << 52));
- if (exp <= -54)
- return 0 * x; // Underflow.
- exp += 54; // Subnormal result.
- x = Double.longBitsToDouble((bits & 0x800fffffffffffffL)
- | ((long) exp << 52));
- return x * (1 / TWO_54);
- }
-
- /**
- * Helper trig function; computes sin in range [-pi/4, pi/4].
- *
- * @param x angle within about pi/4
- * @param y tail of x, created by remPiOver2
- * @return sin(x+y)
- */
- private static double sin(double x, double y)
- {
- if (Configuration.DEBUG && abs(x + y) > 0.7854)
- throw new InternalError("Assertion failure");
- if (abs(x) < 1 / TWO_27)
- return x; // If |x| ~< 2**-27, already know answer.
-
- double z = x * x;
- double v = z * x;
- double r = S2 + z * (S3 + z * (S4 + z * (S5 + z * S6)));
- if (y == 0)
- return x + v * (S1 + z * r);
- return x - ((z * (0.5 * y - v * r) - y) - v * S1);
- }
-
- /**
- * Helper trig function; computes cos in range [-pi/4, pi/4].
- *
- * @param x angle within about pi/4
- * @param y tail of x, created by remPiOver2
- * @return cos(x+y)
- */
- private static double cos(double x, double y)
- {
- if (Configuration.DEBUG && abs(x + y) > 0.7854)
- throw new InternalError("Assertion failure");
- x = abs(x);
- if (x < 1 / TWO_27)
- return 1; // If |x| ~< 2**-27, already know answer.
-
- double z = x * x;
- double r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * C6)))));
-
- if (x < 0.3)
- return 1 - (0.5 * z - (z * r - x * y));
-
- double qx = (x > 0.78125) ? 0.28125 : (x * 0.25);
- return 1 - qx - ((0.5 * z - qx) - (z * r - x * y));
- }
-
- /**
- * Helper trig function; computes tan in range [-pi/4, pi/4].
- *
- * @param x angle within about pi/4
- * @param y tail of x, created by remPiOver2
- * @param invert true iff -1/tan should be returned instead
- * @return tan(x+y)
- */
- private static double tan(double x, double y, boolean invert)
- {
- // PI/2 is irrational, so no double is a perfect multiple of it.
- if (Configuration.DEBUG && (abs(x + y) > 0.7854 || (x == 0 && invert)))
- throw new InternalError("Assertion failure");
- boolean negative = x < 0;
- if (negative)
- {
- x = -x;
- y = -y;
- }
- if (x < 1 / TWO_28) // If |x| ~< 2**-28, already know answer.
- return (negative ? -1 : 1) * (invert ? -1 / x : x);
-
- double z;
- double w;
- boolean large = x >= 0.6744;
- if (large)
- {
- z = PI / 4 - x;
- w = PI_L / 4 - y;
- x = z + w;
- y = 0;
- }
- z = x * x;
- w = z * z;
- // Break x**5*(T1+x**2*T2+...) into
- // x**5(T1+x**4*T3+...+x**20*T11)
- // + x**5(x**2*(T2+x**4*T4+...+x**22*T12)).
- double r = T1 + w * (T3 + w * (T5 + w * (T7 + w * (T9 + w * T11))));
- double v = z * (T2 + w * (T4 + w * (T6 + w * (T8 + w * (T10 + w * T12)))));
- double s = z * x;
- r = y + z * (s * (r + v) + y);
- r += T0 * s;
- w = x + r;
- if (large)
- {
- v = invert ? -1 : 1;
- return (negative ? -1 : 1) * (v - 2 * (x - (w * w / (w + v) - r)));
- }
- if (! invert)
- return w;
-
- // Compute -1.0/(x+r) accurately.
- z = (float) w;
- v = r - (z - x);
- double a = -1 / w;
- double t = (float) a;
- return t + a * (1 + t * z + t * v);
- }
-}
diff --git a/libjava/java/lang/StringIndexOutOfBoundsException.java b/libjava/java/lang/StringIndexOutOfBoundsException.java
deleted file mode 100644
index ebc4a04a391..00000000000
--- a/libjava/java/lang/StringIndexOutOfBoundsException.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* StringIndexOutOfBoundsException.java -- thrown to indicate attempt to
- exceed string bounds
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * This exception can be thrown to indicate an attempt to access an index
- * which is out of bounds of a String. Any negative integer, and a positive
- * integer greater than or equal to the size of the string, is an index
- * which would be out of bounds.
- *
- * @author Brian Jones
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -6762910422159637258L;
-
- /**
- * Create an exception without a message.
- */
- public StringIndexOutOfBoundsException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public StringIndexOutOfBoundsException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception noting the illegal index.
- *
- * @param index the invalid index
- */
- public StringIndexOutOfBoundsException(int index)
- {
- super("String index out of range: " + index);
- }
-}
diff --git a/libjava/java/lang/ThreadDeath.java b/libjava/java/lang/ThreadDeath.java
deleted file mode 100644
index c7d88fb2a25..00000000000
--- a/libjava/java/lang/ThreadDeath.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ThreadDeath.java - special exception registering Thread death
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * ThreadDeath is thrown in a thread when someone calls <code>stop()</code>
- * on that thread. <b>Important:</b> Make sure you rethrow this exception
- * if you catch it. If you don't, the thread will not die.
- *
- * <p>This is an Error rather than an exception, so that normal code will
- * not catch it. It is intended for asynchronous cleanup when using the
- * deprecated Thread.stop() method.
- *
- * @author John Keiser
- * @author Tom Tromey (tromey@cygnus.com)
- * @see Thread#stop()
- * @status updated to 1.4
- */
-public class ThreadDeath extends Error
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -4417128565033088268L;
-
- /**
- * Create an error without a message.
- */
- public ThreadDeath()
- {
- }
-}
diff --git a/libjava/java/lang/ThreadGroup.java b/libjava/java/lang/ThreadGroup.java
deleted file mode 100644
index 6e4c27a7135..00000000000
--- a/libjava/java/lang/ThreadGroup.java
+++ /dev/null
@@ -1,749 +0,0 @@
-/* ThreadGroup -- a group of Threads
- Copyright (C) 1998, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-import java.util.Vector;
-
-/**
- * ThreadGroup allows you to group Threads together. There is a hierarchy
- * of ThreadGroups, and only the initial ThreadGroup has no parent. A Thread
- * may access information about its own ThreadGroup, but not its parents or
- * others outside the tree.
- *
- * @author John Keiser
- * @author Tom Tromey
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Thread
- * @since 1.0
- * @status updated to 1.4
- */
-public class ThreadGroup
-{
- /** The Initial, top-level ThreadGroup. */
- static ThreadGroup root = new ThreadGroup();
-
- /**
- * This flag is set if an uncaught exception occurs. The runtime should
- * check this and exit with an error status if it is set.
- */
- static boolean had_uncaught_exception;
-
- /** The parent thread group. */
- private final ThreadGroup parent;
-
- /** The group name, non-null. */
- final String name;
-
- /** The threads in the group. */
- private final Vector threads = new Vector();
-
- /** Child thread groups, or null when this group is destroyed. */
- private Vector groups = new Vector();
-
- /** If all threads in the group are daemons. */
- private boolean daemon_flag = false;
-
- /** The maximum group priority. */
- private int maxpri;
-
- /**
- * Hidden constructor to build the root node.
- */
- private ThreadGroup()
- {
- name = "main";
- parent = null;
- maxpri = Thread.MAX_PRIORITY;
- }
-
- /**
- * Create a new ThreadGroup using the given name and the current thread's
- * ThreadGroup as a parent. There may be a security check,
- * <code>checkAccess</code>.
- *
- * @param name the name to use for the ThreadGroup
- * @throws SecurityException if the current thread cannot create a group
- * @see #checkAccess()
- */
- public ThreadGroup(String name)
- {
- this(Thread.currentThread().group, name);
- }
-
- /**
- * Create a new ThreadGroup using the given name and parent group. The new
- * group inherits the maximum priority and daemon status of its parent
- * group. There may be a security check, <code>checkAccess</code>.
- *
- * @param name the name to use for the ThreadGroup
- * @param parent the ThreadGroup to use as a parent
- * @throws NullPointerException if parent is null
- * @throws SecurityException if the current thread cannot create a group
- * @throws IllegalThreadStateException if the parent is destroyed
- * @see #checkAccess()
- */
- public ThreadGroup(ThreadGroup parent, String name)
- {
- parent.checkAccess();
- this.parent = parent;
- this.name = name;
- maxpri = parent.maxpri;
- daemon_flag = parent.daemon_flag;
- synchronized (parent)
- {
- if (parent.groups == null)
- throw new IllegalThreadStateException();
- parent.groups.add(this);
- }
- }
-
- /**
- * Get the name of this ThreadGroup.
- *
- * @return the name of this ThreadGroup
- */
- public final String getName()
- {
- return name;
- }
-
- /**
- * Get the parent of this ThreadGroup. If the parent is not null, there
- * may be a security check, <code>checkAccess</code>.
- *
- * @return the parent of this ThreadGroup
- * @throws SecurityException if permission is denied
- */
- public final ThreadGroup getParent()
- {
- if (parent != null)
- parent.checkAccess();
- return parent;
- }
-
- /**
- * Get the maximum priority of Threads in this ThreadGroup. Threads created
- * after this call in this group may not exceed this priority.
- *
- * @return the maximum priority of Threads in this ThreadGroup
- */
- public final int getMaxPriority()
- {
- return maxpri;
- }
-
- /**
- * Tell whether this ThreadGroup is a daemon group. A daemon group will
- * be automatically destroyed when its last thread is stopped and
- * its last thread group is destroyed.
- *
- * @return whether this ThreadGroup is a daemon group
- */
- public final boolean isDaemon()
- {
- return daemon_flag;
- }
-
- /**
- * Tell whether this ThreadGroup has been destroyed or not.
- *
- * @return whether this ThreadGroup has been destroyed or not
- * @since 1.1
- */
- public synchronized boolean isDestroyed()
- {
- return groups == null;
- }
-
- /**
- * Set whether this ThreadGroup is a daemon group. A daemon group will be
- * destroyed when its last thread is stopped and its last thread group is
- * destroyed. There may be a security check, <code>checkAccess</code>.
- *
- * @param daemon whether this ThreadGroup should be a daemon group
- * @throws SecurityException if you cannot modify this ThreadGroup
- * @see #checkAccess()
- */
- public final void setDaemon(boolean daemon)
- {
- checkAccess();
- daemon_flag = daemon;
- }
-
- /**
- * Set the maximum priority for Threads in this ThreadGroup. setMaxPriority
- * can only be used to reduce the current maximum. If maxpri is greater
- * than the current Maximum of the parent group, the current value is not
- * changed. Otherwise, all groups which belong to this have their priority
- * adjusted as well. Calling this does not affect threads already in this
- * ThreadGroup. There may be a security check, <code>checkAccess</code>.
- *
- * @param maxpri the new maximum priority for this ThreadGroup
- * @throws SecurityException if you cannot modify this ThreadGroup
- * @see #getMaxPriority()
- * @see #checkAccess()
- */
- public final synchronized void setMaxPriority(int maxpri)
- {
- checkAccess();
- if (maxpri < Thread.MIN_PRIORITY || maxpri > Thread.MAX_PRIORITY)
- return;
- if (parent != null && maxpri > parent.maxpri)
- maxpri = parent.maxpri;
- this.maxpri = maxpri;
- if (groups == null)
- return;
- int i = groups.size();
- while (--i >= 0)
- ((ThreadGroup) groups.get(i)).setMaxPriority(maxpri);
- }
-
- /**
- * Check whether this ThreadGroup is an ancestor of the specified
- * ThreadGroup, or if they are the same.
- *
- * @param group the group to test on
- * @return whether this ThreadGroup is a parent of the specified group
- */
- public final boolean parentOf(ThreadGroup group)
- {
- while (group != null)
- {
- if (group == this)
- return true;
- group = group.parent;
- }
- return false;
- }
-
- /**
- * Find out if the current Thread can modify this ThreadGroup. This passes
- * the check on to <code>SecurityManager.checkAccess(this)</code>.
- *
- * @throws SecurityException if the current Thread cannot modify this
- * ThreadGroup
- * @see SecurityManager#checkAccess(ThreadGroup)
- */
- public final void checkAccess()
- {
- // Bypass System.getSecurityManager, for bootstrap efficiency.
- SecurityManager sm = SecurityManager.current;
- if (sm != null)
- sm.checkAccess(this);
- }
-
- /**
- * Return an estimate of the total number of active threads in this
- * ThreadGroup and all its descendants. This cannot return an exact number,
- * since the status of threads may change after they were counted; but it
- * should be pretty close. Based on a JDC bug,
- * <a href="http://developer.java.sun.com/developer/bugParade/bugs/4089701.html">
- * 4089701</a>, we take active to mean isAlive().
- *
- * @return count of active threads in this ThreadGroup and its descendants
- */
- public int activeCount()
- {
- int total = 0;
- if (groups == null)
- return total;
- int i = threads.size();
- while (--i >= 0)
- if (((Thread) threads.get(i)).isAlive())
- total++;
- i = groups.size();
- while (--i >= 0)
- total += ((ThreadGroup) groups.get(i)).activeCount();
- return total;
- }
-
- /**
- * Copy all of the active Threads from this ThreadGroup and its descendants
- * into the specified array. If the array is not big enough to hold all
- * the Threads, extra Threads will simply not be copied. There may be a
- * security check, <code>checkAccess</code>.
- *
- * @param array the array to put the threads into
- * @return the number of threads put into the array
- * @throws SecurityException if permission was denied
- * @throws NullPointerException if array is null
- * @throws ArrayStoreException if a thread does not fit in the array
- * @see #activeCount()
- * @see #checkAccess()
- * @see #enumerate(Thread[], boolean)
- */
- public int enumerate(Thread[] array)
- {
- return enumerate(array, 0, true);
- }
-
- /**
- * Copy all of the active Threads from this ThreadGroup and, if desired,
- * from its descendants, into the specified array. If the array is not big
- * enough to hold all the Threads, extra Threads will simply not be copied.
- * There may be a security check, <code>checkAccess</code>.
- *
- * @param array the array to put the threads into
- * @param recurse whether to recurse into descendent ThreadGroups
- * @return the number of threads put into the array
- * @throws SecurityException if permission was denied
- * @throws NullPointerException if array is null
- * @throws ArrayStoreException if a thread does not fit in the array
- * @see #activeCount()
- * @see #checkAccess()
- */
- public int enumerate(Thread[] array, boolean recurse)
- {
- return enumerate(array, 0, recurse);
- }
-
- /**
- * Get the number of active groups in this ThreadGroup. This group itself
- * is not included in the count. A sub-group is active if it has not been
- * destroyed. This cannot return an exact number, since the status of
- * threads may change after they were counted; but it should be pretty close.
- *
- * @return the number of active groups in this ThreadGroup
- */
- public int activeGroupCount()
- {
- if (groups == null)
- return 0;
- int total = groups.size();
- int i = total;
- while (--i >= 0)
- total += ((ThreadGroup) groups.get(i)).activeGroupCount();
- return total;
- }
-
- /**
- * Copy all active ThreadGroups that are descendants of this ThreadGroup
- * into the specified array. If the array is not large enough to hold all
- * active ThreadGroups, extra ThreadGroups simply will not be copied. There
- * may be a security check, <code>checkAccess</code>.
- *
- * @param array the array to put the ThreadGroups into
- * @return the number of ThreadGroups copied into the array
- * @throws SecurityException if permission was denied
- * @throws NullPointerException if array is null
- * @throws ArrayStoreException if a group does not fit in the array
- * @see #activeCount()
- * @see #checkAccess()
- * @see #enumerate(ThreadGroup[], boolean)
- */
- public int enumerate(ThreadGroup[] array)
- {
- return enumerate(array, 0, true);
- }
-
- /**
- * Copy all active ThreadGroups that are children of this ThreadGroup into
- * the specified array, and if desired, also all descendents. If the array
- * is not large enough to hold all active ThreadGroups, extra ThreadGroups
- * simply will not be copied. There may be a security check,
- * <code>checkAccess</code>.
- *
- * @param array the array to put the ThreadGroups into
- * @param recurse whether to recurse into descendent ThreadGroups
- * @return the number of ThreadGroups copied into the array
- * @throws SecurityException if permission was denied
- * @throws NullPointerException if array is null
- * @throws ArrayStoreException if a group does not fit in the array
- * @see #activeCount()
- * @see #checkAccess()
- */
- public int enumerate(ThreadGroup[] array, boolean recurse)
- {
- return enumerate(array, 0, recurse);
- }
-
- /**
- * Stop all Threads in this ThreadGroup and its descendants.
- *
- * <p>This is inherently unsafe, as it can interrupt synchronized blocks and
- * leave data in bad states. Hence, there is a security check:
- * <code>checkAccess()</code>, followed by further checks on each thread
- * being stopped.
- *
- * @throws SecurityException if permission is denied
- * @see #checkAccess()
- * @see Thread#stop(Throwable)
- * @deprecated unsafe operation, try not to use
- */
- public final synchronized void stop()
- {
- checkAccess();
- if (groups == null)
- return;
- int i = threads.size();
- while (--i >= 0)
- ((Thread) threads.get(i)).stop();
- i = groups.size();
- while (--i >= 0)
- ((ThreadGroup) groups.get(i)).stop();
- }
-
- /**
- * Interrupt all Threads in this ThreadGroup and its sub-groups. There may
- * be a security check, <code>checkAccess</code>.
- *
- * @throws SecurityException if permission is denied
- * @see #checkAccess()
- * @see Thread#interrupt()
- * @since 1.2
- */
- public final synchronized void interrupt()
- {
- checkAccess();
- if (groups == null)
- return;
- int i = threads.size();
- while (--i >= 0)
- ((Thread) threads.get(i)).interrupt();
- i = groups.size();
- while (--i >= 0)
- ((ThreadGroup) groups.get(i)).interrupt();
- }
-
- /**
- * Suspend all Threads in this ThreadGroup and its descendants.
- *
- * <p>This is inherently unsafe, as suspended threads still hold locks,
- * which can lead to deadlock. Hence, there is a security check:
- * <code>checkAccess()</code>, followed by further checks on each thread
- * being suspended.
- *
- * @throws SecurityException if permission is denied
- * @see #checkAccess()
- * @see Thread#suspend()
- * @deprecated unsafe operation, try not to use
- */
- public final synchronized void suspend()
- {
- checkAccess();
- if (groups == null)
- return;
- int i = threads.size();
- while (--i >= 0)
- ((Thread) threads.get(i)).suspend();
- i = groups.size();
- while (--i >= 0)
- ((ThreadGroup) groups.get(i)).suspend();
- }
-
- /**
- * Resume all suspended Threads in this ThreadGroup and its descendants.
- * To mirror suspend(), there is a security check:
- * <code>checkAccess()</code>, followed by further checks on each thread
- * being resumed.
- *
- * @throws SecurityException if permission is denied
- * @see #checkAccess()
- * @see Thread#suspend()
- * @deprecated pointless, since suspend is deprecated
- */
- public final synchronized void resume()
- {
- checkAccess();
- if (groups == null)
- return;
- int i = threads.size();
- while (--i >= 0)
- ((Thread) threads.get(i)).resume();
- i = groups.size();
- while (--i >= 0)
- ((ThreadGroup) groups.get(i)).resume();
- }
-
- /**
- * Destroy this ThreadGroup. The group must be empty, meaning that all
- * threads and sub-groups have completed execution. Daemon groups are
- * destroyed automatically. There may be a security check,
- * <code>checkAccess</code>.
- *
- * @throws IllegalThreadStateException if the ThreadGroup is not empty, or
- * was previously destroyed
- * @throws SecurityException if permission is denied
- * @see #checkAccess()
- */
- public final synchronized void destroy()
- {
- checkAccess();
- if (! threads.isEmpty() || groups == null)
- throw new IllegalThreadStateException();
- int i = groups.size();
- while (--i >= 0)
- ((ThreadGroup) groups.get(i)).destroy();
- groups = null;
- if (parent != null)
- parent.removeGroup(this);
- }
-
- /**
- * Print out information about this ThreadGroup to System.out. This is
- * meant for debugging purposes. <b>WARNING:</b> This method is not secure,
- * and can print the name of threads to standard out even when you cannot
- * otherwise get at such threads.
- */
- public void list()
- {
- list("");
- }
-
- /**
- * When a Thread in this ThreadGroup does not catch an exception, the
- * virtual machine calls this method. The default implementation simply
- * passes the call to the parent; then in top ThreadGroup, it will
- * ignore ThreadDeath and print the stack trace of any other throwable.
- * Override this method if you want to handle the exception in a different
- * manner.
- *
- * @param thread the thread that exited
- * @param t the uncaught throwable
- * @throws NullPointerException if t is null
- * @see ThreadDeath
- * @see System#err
- * @see Throwable#printStackTrace()
- */
- public void uncaughtException(Thread thread, Throwable t)
- {
- if (parent != null)
- parent.uncaughtException(thread, t);
- else if (! (t instanceof ThreadDeath))
- {
- if (t == null)
- throw new NullPointerException();
- had_uncaught_exception = true;
- try
- {
- if (thread != null)
- System.err.print("Exception in thread \"" + thread.name + "\" ");
- t.printStackTrace(System.err);
- }
- catch (Throwable x)
- {
- // This means that something is badly screwed up with the runtime,
- // or perhaps someone overloaded the Throwable.printStackTrace to
- // die. In any case, try to deal with it gracefully.
- try
- {
- System.err.println(t);
- System.err.println("*** Got " + x
- + " while trying to print stack trace.");
- }
- catch (Throwable x2)
- {
- // Here, someone may have overloaded t.toString() or
- // x.toString() to die. Give up all hope; we can't even chain
- // the exception, because the chain would likewise die.
- System.err.println("*** Catastrophic failure while handling "
- + "uncaught exception.");
- throw new InternalError();
- }
- }
- }
- }
-
- /**
- * Originally intended to tell the VM whether it may suspend Threads in
- * low memory situations, this method was never implemented by Sun, and
- * is hence a no-op.
- *
- * @param allow whether to allow low-memory thread suspension; ignored
- * @return false
- * @since 1.1
- * @deprecated pointless, since suspend is deprecated
- */
- public boolean allowThreadSuspension(boolean allow)
- {
- return false;
- }
-
- /**
- * Return a human-readable String representing this ThreadGroup. The format
- * of the string is:<br>
- * <code>getClass().getName() + "[name=" + getName() + ",maxpri="
- * + getMaxPriority() + ']'</code>.
- *
- * @return a human-readable String representing this ThreadGroup
- */
- public String toString()
- {
- return getClass().getName() + "[name=" + name + ",maxpri=" + maxpri + ']';
- }
-
- /**
- * Implements enumerate.
- *
- * @param list the array to put the threads into
- * @param next the next open slot in the array
- * @param recurse whether to recurse into descendent ThreadGroups
- * @return the number of threads put into the array
- * @throws SecurityException if permission was denied
- * @throws NullPointerException if list is null
- * @throws ArrayStoreException if a thread does not fit in the array
- * @see #enumerate(Thread[])
- * @see #enumerate(Thread[], boolean)
- */
- private int enumerate(Thread[] list, int next, boolean recurse)
- {
- checkAccess();
- if (groups == null)
- return next;
- int i = threads.size();
- while (--i >= 0 && next < list.length)
- {
- Thread t = (Thread) threads.get(i);
- if (t.isAlive())
- list[next++] = t;
- }
- if (recurse)
- {
- i = groups.size();
- while (--i >= 0 && next < list.length)
- {
- ThreadGroup g = (ThreadGroup) groups.get(i);
- next = g.enumerate(list, next, true);
- }
- }
- return next;
- }
-
- /**
- * Implements enumerate.
- *
- * @param list the array to put the groups into
- * @param next the next open slot in the array
- * @param recurse whether to recurse into descendent ThreadGroups
- * @return the number of groups put into the array
- * @throws SecurityException if permission was denied
- * @throws NullPointerException if list is null
- * @throws ArrayStoreException if a group does not fit in the array
- * @see #enumerate(ThreadGroup[])
- * @see #enumerate(ThreadGroup[], boolean)
- */
- private int enumerate(ThreadGroup[] list, int next, boolean recurse)
- {
- checkAccess();
- if (groups == null)
- return next;
- int i = groups.size();
- while (--i >= 0 && next < list.length)
- {
- ThreadGroup g = (ThreadGroup) groups.get(i);
- list[next++] = g;
- if (recurse && next != list.length)
- next = g.enumerate(list, next, true);
- }
- return next;
- }
-
- /**
- * Implements list.
- *
- * @param indentation the current level of indentation
- * @see #list()
- */
- private void list(String indentation)
- {
- if (groups == null)
- return;
- System.out.println(indentation + this);
- indentation += " ";
- int i = threads.size();
- while (--i >= 0)
- System.out.println(indentation + threads.get(i));
- i = groups.size();
- while (--i >= 0)
- ((ThreadGroup) groups.get(i)).list(indentation);
- }
-
- /**
- * Add a thread to the group. Called by Thread constructors.
- *
- * @param t the thread to add, non-null
- * @throws IllegalThreadStateException if the group is destroyed
- */
- final synchronized void addThread(Thread t)
- {
- if (groups == null)
- throw new IllegalThreadStateException("ThreadGroup is destroyed");
- threads.add(t);
- }
-
- /**
- * Called by the VM to remove a thread that has died.
- *
- * @param t the thread to remove, non-null
- * @XXX A ThreadListener to call this might be nice.
- */
- final synchronized void removeThread(Thread t)
- {
- if (groups == null)
- return;
- threads.remove(t);
- t.group = null;
- // Daemon groups are automatically destroyed when all their threads die.
- if (daemon_flag && groups.size() == 0 && threads.size() == 0)
- {
- // We inline destroy to avoid the access check.
- groups = null;
- if (parent != null)
- parent.removeGroup(this);
- }
- }
-
- /**
- * Called when a group is destroyed, to remove it from its parent.
- *
- * @param g the destroyed group, non-null
- */
- final synchronized void removeGroup(ThreadGroup g)
- {
- groups.remove(g);
- // Daemon groups are automatically destroyed when all their threads die.
- if (daemon_flag && groups.size() == 0 && threads.size() == 0)
- {
- // We inline destroy to avoid the access check.
- groups = null;
- if (parent != null)
- parent.removeGroup(this);
- }
- }
-} // class ThreadGroup
diff --git a/libjava/java/lang/Throwable.java b/libjava/java/lang/Throwable.java
deleted file mode 100644
index c47a14bf040..00000000000
--- a/libjava/java/lang/Throwable.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/* java.lang.Throwable -- Root class for all Exceptions and Errors
- Copyright (C) 1998, 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-import gnu.classpath.SystemProperties;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.Serializable;
-
-/**
- * Throwable is the superclass of all exceptions that can be raised.
- *
- * <p>There are two special cases: {@link Error} and {@link RuntimeException}:
- * these two classes (and their subclasses) are considered unchecked
- * exceptions, and are either frequent enough or catastrophic enough that you
- * do not need to declare them in <code>throws</code> clauses. Everything
- * else is a checked exception, and is ususally a subclass of
- * {@link Exception}; these exceptions have to be handled or declared.
- *
- * <p>Instances of this class are usually created with knowledge of the
- * execution context, so that you can get a stack trace of the problem spot
- * in the code. Also, since JDK 1.4, Throwables participate in "exception
- * chaining." This means that one exception can be caused by another, and
- * preserve the information of the original.
- *
- * <p>One reason this is useful is to wrap exceptions to conform to an
- * interface. For example, it would be bad design to require all levels
- * of a program interface to be aware of the low-level exceptions thrown
- * at one level of abstraction. Another example is wrapping a checked
- * exception in an unchecked one, to communicate that failure occured
- * while still obeying the method throws clause of a superclass.
- *
- * <p>A cause is assigned in one of two ways; but can only be assigned once
- * in the lifetime of the Throwable. There are new constructors added to
- * several classes in the exception hierarchy that directly initialize the
- * cause, or you can use the <code>initCause</code> method. This second
- * method is especially useful if the superclass has not been retrofitted
- * with new constructors:<br>
- * <pre>
- * try
- * {
- * lowLevelOp();
- * }
- * catch (LowLevelException lle)
- * {
- * throw (HighLevelException) new HighLevelException().initCause(lle);
- * }
- * </pre>
- * Notice the cast in the above example; without it, your method would need
- * a throws clase that declared Throwable, defeating the purpose of chainig
- * your exceptions.
- *
- * <p>By convention, exception classes have two constructors: one with no
- * arguments, and one that takes a String for a detail message. Further,
- * classes which are likely to be used in an exception chain also provide
- * a constructor that takes a Throwable, with or without a detail message
- * string.
- *
- * <p>Another 1.4 feature is the StackTrace, a means of reflection that
- * allows the program to inspect the context of the exception, and which is
- * serialized, so that remote procedure calls can correctly pass exceptions.
- *
- * @author Brian Jones
- * @author John Keiser
- * @author Mark Wielaard
- * @author Tom Tromey
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.0
- * @status updated to 1.4
- */
-public class Throwable implements Serializable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -3042686055658047285L;
-
- /**
- * The detail message.
- *
- * @serial specific details about the exception, may be null
- */
- private final String detailMessage;
-
- /**
- * The cause of the throwable, including null for an unknown or non-chained
- * cause. This may only be set once; so the field is set to
- * <code>this</code> until initialized.
- *
- * @serial the cause, or null if unknown, or this if not yet set
- * @since 1.4
- */
- private Throwable cause = this;
-
- /**
- * The stack trace, in a serialized form.
- *
- * @serial the elements of the stack trace; this is non-null, and has
- * no null entries
- * @since 1.4
- */
- private StackTraceElement[] stackTrace;
-
- /**
- * Instantiate this Throwable with an empty message. The cause remains
- * uninitialized. {@link #fillInStackTrace()} will be called to set
- * up the stack trace.
- */
- public Throwable()
- {
- this((String) null);
- }
-
- /**
- * Instantiate this Throwable with the given message. The cause remains
- * uninitialized. {@link #fillInStackTrace()} will be called to set
- * up the stack trace.
- *
- * @param message the message to associate with the Throwable
- */
- public Throwable(String message)
- {
- fillInStackTrace();
- detailMessage = message;
- }
-
- /**
- * Instantiate this Throwable with the given message and cause. Note that
- * the message is unrelated to the message of the cause.
- * {@link #fillInStackTrace()} will be called to set up the stack trace.
- *
- * @param message the message to associate with the Throwable
- * @param cause the cause, may be null
- * @since 1.4
- */
- public Throwable(String message, Throwable cause)
- {
- this(message);
- this.cause = cause;
- }
-
- /**
- * Instantiate this Throwable with the given cause. The message is then
- * built as <code>cause == null ? null : cause.toString()</code>.
- * {@link #fillInStackTrace()} will be called to set up the stack trace.
- *
- * @param cause the cause, may be null
- * @since 1.4
- */
- public Throwable(Throwable cause)
- {
- this(cause == null ? null : cause.toString(), cause);
- }
-
- /**
- * Get the message associated with this Throwable.
- *
- * @return the error message associated with this Throwable, may be null
- */
- public String getMessage()
- {
- return detailMessage;
- }
-
- /**
- * Get a localized version of this Throwable's error message.
- * This method must be overridden in a subclass of Throwable
- * to actually produce locale-specific methods. The Throwable
- * implementation just returns getMessage().
- *
- * @return a localized version of this error message
- * @see #getMessage()
- * @since 1.1
- */
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- /**
- * Returns the cause of this exception, or null if the cause is not known
- * or non-existant. This cause is initialized by the new constructors,
- * or by calling initCause.
- *
- * @return the cause of this Throwable
- * @since 1.4
- */
- public Throwable getCause()
- {
- return cause == this ? null : cause;
- }
-
- /**
- * Initialize the cause of this Throwable. This may only be called once
- * during the object lifetime, including implicitly by chaining
- * constructors.
- *
- * @param cause the cause of this Throwable, may be null
- * @return this
- * @throws IllegalArgumentException if cause is this (a Throwable can't be
- * its own cause!)
- * @throws IllegalStateException if the cause has already been set
- * @since 1.4
- */
- public Throwable initCause(Throwable cause)
- {
- if (cause == this)
- throw new IllegalArgumentException();
- if (this.cause != this)
- throw new IllegalStateException();
- this.cause = cause;
- return this;
- }
-
- /**
- * Get a human-readable representation of this Throwable. The detail message
- * is retrieved by getLocalizedMessage(). Then, with a null detail
- * message, this string is simply the object's class name; otherwise
- * the string is <code>getClass().getName() + ": " + message</code>.
- *
- * @return a human-readable String represting this Throwable
- */
- public String toString()
- {
- String msg = getLocalizedMessage();
- return getClass().getName() + (msg == null ? "" : ": " + msg);
- }
-
- /**
- * Print a stack trace to the standard error stream. This stream is the
- * current contents of <code>System.err</code>. The first line of output
- * is the result of {@link #toString()}, and the remaining lines represent
- * the data created by {@link #fillInStackTrace()}. While the format is
- * unspecified, this implementation uses the suggested format, demonstrated
- * by this example:<br>
- * <pre>
- * public class Junk
- * {
- * public static void main(String args[])
- * {
- * try
- * {
- * a();
- * }
- * catch(HighLevelException e)
- * {
- * e.printStackTrace();
- * }
- * }
- * static void a() throws HighLevelException
- * {
- * try
- * {
- * b();
- * }
- * catch(MidLevelException e)
- * {
- * throw new HighLevelException(e);
- * }
- * }
- * static void b() throws MidLevelException
- * {
- * c();
- * }
- * static void c() throws MidLevelException
- * {
- * try
- * {
- * d();
- * }
- * catch(LowLevelException e)
- * {
- * throw new MidLevelException(e);
- * }
- * }
- * static void d() throws LowLevelException
- * {
- * e();
- * }
- * static void e() throws LowLevelException
- * {
- * throw new LowLevelException();
- * }
- * }
- * class HighLevelException extends Exception
- * {
- * HighLevelException(Throwable cause) { super(cause); }
- * }
- * class MidLevelException extends Exception
- * {
- * MidLevelException(Throwable cause) { super(cause); }
- * }
- * class LowLevelException extends Exception
- * {
- * }
- * </pre>
- * <p>
- * <pre>
- * HighLevelException: MidLevelException: LowLevelException
- * at Junk.a(Junk.java:13)
- * at Junk.main(Junk.java:4)
- * Caused by: MidLevelException: LowLevelException
- * at Junk.c(Junk.java:23)
- * at Junk.b(Junk.java:17)
- * at Junk.a(Junk.java:11)
- * ... 1 more
- * Caused by: LowLevelException
- * at Junk.e(Junk.java:30)
- * at Junk.d(Junk.java:27)
- * at Junk.c(Junk.java:21)
- * ... 3 more
- * </pre>
- */
- public void printStackTrace()
- {
- printStackTrace(System.err);
- }
-
- /**
- * Print a stack trace to the specified PrintStream. See
- * {@link #printStackTrace()} for the sample format.
- *
- * @param s the PrintStream to write the trace to
- */
- public void printStackTrace(PrintStream s)
- {
- s.print(stackTraceString());
- }
-
- /**
- * Prints the exception, the detailed message and the stack trace
- * associated with this Throwable to the given <code>PrintWriter</code>.
- * The actual output written is implemention specific. Use the result of
- * <code>getStackTrace()</code> when more precise information is needed.
- *
- * <p>This implementation first prints a line with the result of this
- * object's <code>toString()</code> method.
- * <br>
- * Then for all elements given by <code>getStackTrace</code> it prints
- * a line containing three spaces, the string "at " and the result of calling
- * the <code>toString()</code> method on the <code>StackTraceElement</code>
- * object. If <code>getStackTrace()</code> returns an empty array it prints
- * a line containing three spaces and the string
- * "&lt;&lt;No stacktrace available&gt;&gt;".
- * <br>
- * Then if <code>getCause()</code> doesn't return null it adds a line
- * starting with "Caused by: " and the result of calling
- * <code>toString()</code> on the cause.
- * <br>
- * Then for every cause (of a cause, etc) the stacktrace is printed the
- * same as for the top level <code>Throwable</code> except that as soon
- * as all the remaining stack frames of the cause are the same as the
- * the last stack frames of the throwable that the cause is wrapped in
- * then a line starting with three spaces and the string "... X more" is
- * printed, where X is the number of remaining stackframes.
- *
- * @param pw the PrintWriter to write the trace to
- * @since 1.1
- */
- public void printStackTrace (PrintWriter pw)
- {
- pw.print(stackTraceString());
- }
-
- /*
- * We use inner class to avoid a static initializer in this basic class.
- */
- private static class StaticData
- {
- static final String nl = SystemProperties.getProperty("line.separator");
- }
-
- // Create whole stack trace in a stringbuffer so we don't have to print
- // it line by line. This prevents printing multiple stack traces from
- // different threads to get mixed up when written to the same PrintWriter.
- private String stackTraceString()
- {
- StringBuffer sb = new StringBuffer();
-
- // Main stacktrace
- StackTraceElement[] stack = getStackTrace();
- stackTraceStringBuffer(sb, this.toString(), stack, 0);
-
- // The cause(s)
- Throwable cause = getCause();
- while (cause != null)
- {
- // Cause start first line
- sb.append("Caused by: ");
-
- // Cause stacktrace
- StackTraceElement[] parentStack = stack;
- stack = cause.getStackTrace();
- if (parentStack == null || parentStack.length == 0)
- stackTraceStringBuffer(sb, cause.toString(), stack, 0);
- else
- {
- int equal = 0; // Count how many of the last stack frames are equal
- int frame = stack.length-1;
- int parentFrame = parentStack.length-1;
- while (frame > 0 && parentFrame > 0)
- {
- if (stack[frame].equals(parentStack[parentFrame]))
- {
- equal++;
- frame--;
- parentFrame--;
- }
- else
- break;
- }
- stackTraceStringBuffer(sb, cause.toString(), stack, equal);
- }
- cause = cause.getCause();
- }
-
- return sb.toString();
- }
-
- // Adds to the given StringBuffer a line containing the name and
- // all stacktrace elements minus the last equal ones.
- private static void stackTraceStringBuffer(StringBuffer sb, String name,
- StackTraceElement[] stack, int equal)
- {
- String nl = StaticData.nl;
- // (finish) first line
- sb.append(name);
- sb.append(nl);
-
- // The stacktrace
- if (stack == null || stack.length == 0)
- {
- sb.append(" <<No stacktrace available>>");
- sb.append(nl);
- }
- else
- {
- for (int i = 0; i < stack.length-equal; i++)
- {
- sb.append(" at ");
- sb.append(stack[i] == null ? "<<Unknown>>" : stack[i].toString());
- sb.append(nl);
- }
- if (equal > 0)
- {
- sb.append(" ...");
- sb.append(equal);
- sb.append(" more");
- sb.append(nl);
- }
- }
- }
-
- /**
- * Fill in the stack trace with the current execution stack.
- *
- * @return this same throwable
- * @see #printStackTrace()
- */
- public Throwable fillInStackTrace()
- {
- vmState = VMThrowable.fillInStackTrace(this);
- stackTrace = null; // Should be regenerated when used.
-
- return this;
- }
-
- /**
- * Provides access to the information printed in {@link #printStackTrace()}.
- * The array is non-null, with no null entries, although the virtual
- * machine is allowed to skip stack frames. If the array is not 0-length,
- * then slot 0 holds the information on the stack frame where the Throwable
- * was created (or at least where <code>fillInStackTrace()</code> was
- * called).
- *
- * @return an array of stack trace information, as available from the VM
- * @since 1.4
- */
- public StackTraceElement[] getStackTrace()
- {
- if (stackTrace == null)
- if (vmState == null)
- stackTrace = new StackTraceElement[0];
- else
- {
- stackTrace = vmState.getStackTrace(this);
- vmState = null; // No longer needed
- }
-
- return stackTrace;
- }
-
- /**
- * Change the stack trace manually. This method is designed for remote
- * procedure calls, which intend to alter the stack trace before or after
- * serialization according to the context of the remote call.
- * <p>
- * The contents of the given stacktrace is copied so changes to the
- * original array do not change the stack trace elements of this
- * throwable.
- *
- * @param stackTrace the new trace to use
- * @throws NullPointerException if stackTrace is null or has null elements
- * @since 1.4
- */
- public void setStackTrace(StackTraceElement[] stackTrace)
- {
- int i = stackTrace.length;
- StackTraceElement[] st = new StackTraceElement[i];
-
- while (--i >= 0)
- {
- st[i] = stackTrace[i];
- if (st[i] == null)
- throw new NullPointerException("Element " + i + " null");
- }
-
- this.stackTrace = st;
- }
-
- /**
- * VM state when fillInStackTrace was called.
- * Used by getStackTrace() to get an array of StackTraceElements.
- * Cleared when no longer needed.
- */
- private transient VMThrowable vmState;
-}
diff --git a/libjava/java/lang/UnknownError.java b/libjava/java/lang/UnknownError.java
deleted file mode 100644
index 7b317bd2aa2..00000000000
--- a/libjava/java/lang/UnknownError.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* UnknownError.java -- thrown when the VM cannot provide more information
- about a catastrophic error
- Copyright (C) 1998, 1999, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * An <code>UnknownError</code> is thrown when a serious but unknown
- * problem has occurred in the Java Virtual Machine.
- *
- * @author Brian Jones
- * @status updated to 1.4
- */
-public class UnknownError extends VirtualMachineError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 2524784860676771849L;
-
- /**
- * Create an error without a message.
- */
- public UnknownError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public UnknownError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/UnsatisfiedLinkError.java b/libjava/java/lang/UnsatisfiedLinkError.java
deleted file mode 100644
index 0d513d8e0ca..00000000000
--- a/libjava/java/lang/UnsatisfiedLinkError.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* UnsatisfiedLinkError.java -- thrown when a native method cannot be loaded
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * A <code>UnsatisfiedLinkError</code> is thrown if an appropriate
- * native language definition of a method declared <code>native</code>
- * cannot be found by the Java Virtual Machine.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @see Runtime
- * @status updated to 1.4
- */
-public class UnsatisfiedLinkError extends LinkageError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -4019343241616879428L;
-
- /**
- * Create an error without a message.
- */
- public UnsatisfiedLinkError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public UnsatisfiedLinkError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/UnsupportedClassVersionError.java b/libjava/java/lang/UnsupportedClassVersionError.java
deleted file mode 100644
index d6974b7694d..00000000000
--- a/libjava/java/lang/UnsupportedClassVersionError.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* UnsupportedClassVersionError.java -- thrown when a class file version
- exceeds the capability of the virtual machine
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * An <code>UnsupportedClassVersionError</code> is thrown when the
- * Java Virtual Machine determines it does not support the major and minor
- * version numbers in the class file it is attempting to read.
- *
- * @author Brian Jones
- * @since 1.2
- * @status updated to 1.4
- */
-public class UnsupportedClassVersionError extends ClassFormatError
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -7123279212883497373L;
-
- /**
- * Create an error without a message.
- */
- public UnsupportedClassVersionError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public UnsupportedClassVersionError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/UnsupportedOperationException.java b/libjava/java/lang/UnsupportedOperationException.java
deleted file mode 100644
index 0387d0ee29d..00000000000
--- a/libjava/java/lang/UnsupportedOperationException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* UnsupportedOperationException.java -- thrown when an operation is not
- supported
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * This exception is thrown by an object when an operation is
- * requested of it that it does not support.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.2
- * @status updated to 1.4
- */
-public class UnsupportedOperationException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -1242599979055084673L;
-
- /**
- * Create an exception without a message.
- */
- public UnsupportedOperationException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public UnsupportedOperationException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/VerifyError.java b/libjava/java/lang/VerifyError.java
deleted file mode 100644
index 350ceaa5e95..00000000000
--- a/libjava/java/lang/VerifyError.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* VerifyError.java -- thrown when a class fails verification
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * A <code>VerifyError</code> is thrown if there is a security problem or
- * internal inconsistency in a class file as detected by the "verifier."
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public class VerifyError extends LinkageError
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 7001962396098498785L;
-
- /**
- * Create an error without a message.
- */
- public VerifyError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public VerifyError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/VirtualMachineError.java b/libjava/java/lang/VirtualMachineError.java
deleted file mode 100644
index 3062c4fe800..00000000000
--- a/libjava/java/lang/VirtualMachineError.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* VirtualMachineError.java -- thrown when the Virtual Machine has a problem
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-/**
- * A <code>VirtualMachineError</code> or its subclasses are thrown to
- * indicate there is something wrong with the Java Virtual Machine or that
- * it does not have the resources needed for it to continue execution.
- *
- * @author Brian Jones
- * @author Tom Tromey (tromey@cygnus.com)
- * @status updated to 1.4
- */
-public abstract class VirtualMachineError extends Error
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 4161983926571568670L;
-
- /**
- * Create an error without a message.
- */
- public VirtualMachineError()
- {
- }
-
- /**
- * Create an error with a message.
- *
- * @param s the message
- */
- public VirtualMachineError(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/lang/Void.java b/libjava/java/lang/Void.java
deleted file mode 100644
index 15035426830..00000000000
--- a/libjava/java/lang/Void.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Void.class - defines void.class
- Copyright (C) 1998, 1999, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang;
-
-
-/**
- * Void is a placeholder class so that the variable <code>Void.TYPE</code>
- * (also available as <code>void.class</code>) can be supported for
- * reflection return types.
- *
- * <p>This class could be Serializable, but that is up to Sun.</p>
- *
- * @author Paul Fisher
- * @author John Keiser
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status updated to 1.4
- */
-public final class Void
-{
- /**
- * The return type <code>void</code> is represented by this
- * <code>Class</code> object.
- */
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('V');
-
- /**
- * Void is non-instantiable.
- */
- private Void()
- {
- }
-}
diff --git a/libjava/java/lang/dtoa.c b/libjava/java/lang/dtoa.c
deleted file mode 100644
index 6d5ad3b422e..00000000000
--- a/libjava/java/lang/dtoa.c
+++ /dev/null
@@ -1,906 +0,0 @@
-/****************************************************************
- *
- * The author of this software is David M. Gay.
- *
- * Copyright (c) 1991 by AT&T.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- *
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
- * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- ***************************************************************/
-
-/* Please send bug reports to
- David M. Gay
- AT&T Bell Laboratories, Room 2C-463
- 600 Mountain Avenue
- Murray Hill, NJ 07974-2070
- U.S.A.
- dmg@research.att.com or research!dmg
- */
-
-#include "mprec.h"
-#include <string.h>
-
-static int
-_DEFUN (quorem,
- (b, S),
- _Jv_Bigint * b _AND _Jv_Bigint * S)
-{
- int n;
- long borrow, y;
- unsigned long carry, q, ys;
- unsigned long *bx, *bxe, *sx, *sxe;
-#ifdef Pack_32
- long z;
- unsigned long si, zs;
-#endif
-
- n = S->_wds;
-#ifdef DEBUG
- /*debug*/ if (b->_wds > n)
- /*debug*/ Bug ("oversize b in quorem");
-#endif
- if (b->_wds < n)
- return 0;
- sx = S->_x;
- sxe = sx + --n;
- bx = b->_x;
- bxe = bx + n;
- q = *bxe / (*sxe + 1); /* ensure q <= true quotient */
-#ifdef DEBUG
- /*debug*/ if (q > 9)
- /*debug*/ Bug ("oversized quotient in quorem");
-#endif
- if (q)
- {
- borrow = 0;
- carry = 0;
- do
- {
-#ifdef Pack_32
- si = *sx++;
- ys = (si & 0xffff) * q + carry;
- zs = (si >> 16) * q + (ys >> 16);
- carry = zs >> 16;
- y = (*bx & 0xffff) - (ys & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend (borrow, y);
- z = (*bx >> 16) - (zs & 0xffff) + borrow;
- borrow = z >> 16;
- Sign_Extend (borrow, z);
- Storeinc (bx, z, y);
-#else
- ys = *sx++ * q + carry;
- carry = ys >> 16;
- y = *bx - (ys & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend (borrow, y);
- *bx++ = y & 0xffff;
-#endif
- }
- while (sx <= sxe);
- if (!*bxe)
- {
- bx = b->_x;
- while (--bxe > bx && !*bxe)
- --n;
- b->_wds = n;
- }
- }
- if (cmp (b, S) >= 0)
- {
- q++;
- borrow = 0;
- carry = 0;
- bx = b->_x;
- sx = S->_x;
- do
- {
-#ifdef Pack_32
- si = *sx++;
- ys = (si & 0xffff) + carry;
- zs = (si >> 16) + (ys >> 16);
- carry = zs >> 16;
- y = (*bx & 0xffff) - (ys & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend (borrow, y);
- z = (*bx >> 16) - (zs & 0xffff) + borrow;
- borrow = z >> 16;
- Sign_Extend (borrow, z);
- Storeinc (bx, z, y);
-#else
- ys = *sx++ + carry;
- carry = ys >> 16;
- y = *bx - (ys & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend (borrow, y);
- *bx++ = y & 0xffff;
-#endif
- }
- while (sx <= sxe);
- bx = b->_x;
- bxe = bx + n;
- if (!*bxe)
- {
- while (--bxe > bx && !*bxe)
- --n;
- b->_wds = n;
- }
- }
- return q;
-}
-
-#ifdef DEBUG
-#include <stdio.h>
-
-void
-print (_Jv_Bigint * b)
-{
- int i, wds;
- unsigned long *x, y;
- wds = b->_wds;
- x = b->_x+wds;
- i = 0;
- do
- {
- x--;
- fprintf (stderr, "%08x", *x);
- }
- while (++i < wds);
- fprintf (stderr, "\n");
-}
-#endif
-
-/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string.
- *
- * Inspired by "How to Print Floating-Point Numbers Accurately" by
- * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 92-101].
- *
- * Modifications:
- * 1. Rather than iterating, we use a simple numeric overestimate
- * to determine k = floor(log10(d)). We scale relevant
- * quantities using O(log2(k)) rather than O(k) multiplications.
- * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't
- * try to generate digits strictly left to right. Instead, we
- * compute with fewer bits and propagate the carry if necessary
- * when rounding the final digit up. This is often faster.
- * 3. Under the assumption that input will be rounded nearest,
- * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22.
- * That is, we allow equality in stopping tests when the
- * round-nearest rule will give the same floating-point value
- * as would satisfaction of the stopping test with strict
- * inequality.
- * 4. We remove common factors of powers of 2 from relevant
- * quantities.
- * 5. When converting floating-point integers less than 1e16,
- * we use floating-point arithmetic rather than resorting
- * to multiple-precision integers.
- * 6. When asked to produce fewer than 15 digits, we first try
- * to get by with floating-point arithmetic; we resort to
- * multiple-precision integer arithmetic only if we cannot
- * guarantee that the floating-point calculation has given
- * the correctly rounded result. For k requested digits and
- * "uniformly" distributed input, the probability is
- * something like 10^(k-15) that we must resort to the long
- * calculation.
- */
-
-
-char *
-_DEFUN (_dtoa_r,
- (ptr, _d, mode, ndigits, decpt, sign, rve, float_type),
- struct _Jv_reent *ptr _AND
- double _d _AND
- int mode _AND
- int ndigits _AND
- int *decpt _AND
- int *sign _AND
- char **rve _AND
- int float_type)
-{
- /*
- float_type == 0 for double precision, 1 for float.
-
- Arguments ndigits, decpt, sign are similar to those
- of ecvt and fcvt; trailing zeros are suppressed from
- the returned string. If not null, *rve is set to point
- to the end of the return value. If d is +-Infinity or NaN,
- then *decpt is set to 9999.
-
- mode:
- 0 ==> shortest string that yields d when read in
- and rounded to nearest.
- 1 ==> like 0, but with Steele & White stopping rule;
- e.g. with IEEE P754 arithmetic , mode 0 gives
- 1e23 whereas mode 1 gives 9.999999999999999e22.
- 2 ==> max(1,ndigits) significant digits. This gives a
- return value similar to that of ecvt, except
- that trailing zeros are suppressed.
- 3 ==> through ndigits past the decimal point. This
- gives a return value similar to that from fcvt,
- except that trailing zeros are suppressed, and
- ndigits can be negative.
- 4-9 should give the same return values as 2-3, i.e.,
- 4 <= mode <= 9 ==> same return as mode
- 2 + (mode & 1). These modes are mainly for
- debugging; often they run slower but sometimes
- faster than modes 2-3.
- 4,5,8,9 ==> left-to-right digit generation.
- 6-9 ==> don't try fast floating-point estimate
- (if applicable).
-
- > 16 ==> Floating-point arg is treated as single precision.
-
- Values of mode other than 0-9 are treated as mode 0.
-
- Sufficient space is allocated to the return value
- to hold the suppressed trailing zeros.
- */
-
- int bbits, b2, b5, be, dig, i, ieps, ilim0, j, j1, k, k0,
- k_check, leftright, m2, m5, s2, s5, try_quick;
- int ilim = 0, ilim1 = 0, spec_case = 0;
- union double_union d, d2, eps;
- long L;
-#ifndef Sudden_Underflow
- int denorm;
- unsigned long x;
-#endif
- _Jv_Bigint *b, *b1, *delta, *mlo = NULL, *mhi, *S;
- double ds;
- char *s, *s0;
-
- d.d = _d;
-
- if (ptr->_result)
- {
- ptr->_result->_k = ptr->_result_k;
- ptr->_result->_maxwds = 1 << ptr->_result_k;
- Bfree (ptr, ptr->_result);
- ptr->_result = 0;
- }
-
- if (word0 (d) & Sign_bit)
- {
- /* set sign for everything, including 0's and NaNs */
- *sign = 1;
- word0 (d) &= ~Sign_bit; /* clear sign bit */
- }
- else
- *sign = 0;
-
-#if defined(IEEE_Arith) + defined(VAX)
-#ifdef IEEE_Arith
- if ((word0 (d) & Exp_mask) == Exp_mask)
-#else
- if (word0 (d) == 0x8000)
-#endif
- {
- /* Infinity or NaN */
- *decpt = 9999;
- s =
-#ifdef IEEE_Arith
- !word1 (d) && !(word0 (d) & 0xfffff) ? "Infinity" :
-#endif
- "NaN";
- if (rve)
- *rve =
-#ifdef IEEE_Arith
- s[3] ? s + 8 :
-#endif
- s + 3;
- return s;
- }
-#endif
-#ifdef IBM
- d.d += 0; /* normalize */
-#endif
- if (!d.d)
- {
- *decpt = 1;
- s = "0";
- if (rve)
- *rve = s + 1;
- return s;
- }
-
- b = d2b (ptr, d.d, &be, &bbits);
-#ifdef Sudden_Underflow
- i = (int) (word0 (d) >> Exp_shift1 & (Exp_mask >> Exp_shift1));
-#else
- if ((i = (int) (word0 (d) >> Exp_shift1 & (Exp_mask >> Exp_shift1))))
- {
-#endif
- d2.d = d.d;
- word0 (d2) &= Frac_mask1;
- word0 (d2) |= Exp_11;
-#ifdef IBM
- if (j = 11 - hi0bits (word0 (d2) & Frac_mask))
- d2.d /= 1 << j;
-#endif
-
- /* log(x) ~=~ log(1.5) + (x-1.5)/1.5
- * log10(x) = log(x) / log(10)
- * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10))
- * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2)
- *
- * This suggests computing an approximation k to log10(d) by
- *
- * k = (i - Bias)*0.301029995663981
- * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 );
- *
- * We want k to be too large rather than too small.
- * The error in the first-order Taylor series approximation
- * is in our favor, so we just round up the constant enough
- * to compensate for any error in the multiplication of
- * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077,
- * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14,
- * adding 1e-13 to the constant term more than suffices.
- * Hence we adjust the constant term to 0.1760912590558.
- * (We could get a more accurate k by invoking log10,
- * but this is probably not worthwhile.)
- */
-
- i -= Bias;
-#ifdef IBM
- i <<= 2;
- i += j;
-#endif
-#ifndef Sudden_Underflow
- denorm = 0;
- }
- else
- {
- /* d is denormalized */
-
- i = bbits + be + (Bias + (P - 1) - 1);
- x = i > 32 ? word0 (d) << (64 - i) | word1 (d) >> (i - 32)
- : word1 (d) << (32 - i);
- d2.d = x;
- word0 (d2) -= 31 * Exp_msk1; /* adjust exponent */
- i -= (Bias + (P - 1) - 1) + 1;
- denorm = 1;
- }
-#endif
- ds = (d2.d - 1.5) * 0.289529654602168 + 0.1760912590558 + i * 0.301029995663981;
- k = (int) ds;
- if (ds < 0. && ds != k)
- k--; /* want k = floor(ds) */
- k_check = 1;
- if (k >= 0 && k <= Ten_pmax)
- {
- if (d.d < tens[k])
- k--;
- k_check = 0;
- }
- j = bbits - i - 1;
- if (j >= 0)
- {
- b2 = 0;
- s2 = j;
- }
- else
- {
- b2 = -j;
- s2 = 0;
- }
- if (k >= 0)
- {
- b5 = 0;
- s5 = k;
- s2 += k;
- }
- else
- {
- b2 -= k;
- b5 = -k;
- s5 = 0;
- }
- if (mode < 0 || mode > 9)
- mode = 0;
- try_quick = 1;
- if (mode > 5)
- {
- mode -= 4;
- try_quick = 0;
- }
- leftright = 1;
- switch (mode)
- {
- case 0:
- case 1:
- ilim = ilim1 = -1;
- i = 18;
- ndigits = 0;
- break;
- case 2:
- leftright = 0;
- /* no break */
- case 4:
- if (ndigits <= 0)
- ndigits = 1;
- ilim = ilim1 = i = ndigits;
- break;
- case 3:
- leftright = 0;
- /* no break */
- case 5:
- i = ndigits + k + 1;
- ilim = i;
- ilim1 = i - 1;
- if (i <= 0)
- i = 1;
- }
- j = sizeof (unsigned long);
- for (ptr->_result_k = 0; (int) (sizeof (_Jv_Bigint) - sizeof (unsigned long)) + j <= i;
- j <<= 1)
- ptr->_result_k++;
- ptr->_result = Balloc (ptr, ptr->_result_k);
- s = s0 = (char *) ptr->_result;
-
- if (ilim >= 0 && ilim <= Quick_max && try_quick)
- {
- /* Try to get by with floating-point arithmetic. */
-
- i = 0;
- d2.d = d.d;
- k0 = k;
- ilim0 = ilim;
- ieps = 2; /* conservative */
- if (k > 0)
- {
- ds = tens[k & 0xf];
- j = k >> 4;
- if (j & Bletch)
- {
- /* prevent overflows */
- j &= Bletch - 1;
- d.d /= bigtens[n_bigtens - 1];
- ieps++;
- }
- for (; j; j >>= 1, i++)
- if (j & 1)
- {
- ieps++;
- ds *= bigtens[i];
- }
- d.d /= ds;
- }
- else if ((j1 = -k))
- {
- d.d *= tens[j1 & 0xf];
- for (j = j1 >> 4; j; j >>= 1, i++)
- if (j & 1)
- {
- ieps++;
- d.d *= bigtens[i];
- }
- }
- if (k_check && d.d < 1. && ilim > 0)
- {
- if (ilim1 <= 0)
- goto fast_failed;
- ilim = ilim1;
- k--;
- d.d *= 10.;
- ieps++;
- }
- eps.d = ieps * d.d + 7.;
- word0 (eps) -= (P - 1) * Exp_msk1;
- if (ilim == 0)
- {
- S = mhi = 0;
- d.d -= 5.;
- if (d.d > eps.d)
- goto one_digit;
- if (d.d < -eps.d)
- goto no_digits;
- goto fast_failed;
- }
-#ifndef No_leftright
- if (leftright)
- {
- /* Use Steele & White method of only
- * generating digits needed.
- */
- eps.d = 0.5 / tens[ilim - 1] - eps.d;
- for (i = 0;;)
- {
- L = d.d;
- d.d -= L;
- *s++ = '0' + (int) L;
- if (d.d < eps.d)
- goto ret1;
- if (1. - d.d < eps.d)
- goto bump_up;
- if (++i >= ilim)
- break;
- eps.d *= 10.;
- d.d *= 10.;
- }
- }
- else
- {
-#endif
- /* Generate ilim digits, then fix them up. */
- eps.d *= tens[ilim - 1];
- for (i = 1;; i++, d.d *= 10.)
- {
- L = d.d;
- d.d -= L;
- *s++ = '0' + (int) L;
- if (i == ilim)
- {
- if (d.d > 0.5 + eps.d)
- goto bump_up;
- else if (d.d < 0.5 - eps.d)
- {
- while (*--s == '0');
- s++;
- goto ret1;
- }
- break;
- }
- }
-#ifndef No_leftright
- }
-#endif
- fast_failed:
- s = s0;
- d.d = d2.d;
- k = k0;
- ilim = ilim0;
- }
-
- /* Do we have a "small" integer? */
-
- if (be >= 0 && k <= Int_max)
- {
- /* Yes. */
- ds = tens[k];
- if (ndigits < 0 && ilim <= 0)
- {
- S = mhi = 0;
- if (ilim < 0 || d.d <= 5 * ds)
- goto no_digits;
- goto one_digit;
- }
- for (i = 1;; i++)
- {
- L = d.d / ds;
- d.d -= L * ds;
-#ifdef Check_FLT_ROUNDS
- /* If FLT_ROUNDS == 2, L will usually be high by 1 */
- if (d.d < 0)
- {
- L--;
- d.d += ds;
- }
-#endif
- *s++ = '0' + (int) L;
- if (i == ilim)
- {
- d.d += d.d;
- if (d.d > ds || (d.d == ds && L & 1))
- {
- bump_up:
- while (*--s == '9')
- if (s == s0)
- {
- k++;
- *s = '0';
- break;
- }
- ++*s++;
- }
- break;
- }
- if (!(d.d *= 10.))
- break;
- }
- goto ret1;
- }
-
- m2 = b2;
- m5 = b5;
- mhi = mlo = 0;
- if (leftright)
- {
- if (mode < 2)
- {
- i =
-#ifndef Sudden_Underflow
- denorm ? be + (Bias + (P - 1) - 1 + 1) :
-#endif
-#ifdef IBM
- 1 + 4 * P - 3 - bbits + ((bbits + be - 1) & 3);
-#else
- 1 + P - bbits;
-#endif
- }
- else
- {
- j = ilim - 1;
- if (m5 >= j)
- m5 -= j;
- else
- {
- s5 += j -= m5;
- b5 += j;
- m5 = 0;
- }
- if ((i = ilim) < 0)
- {
- m2 -= i;
- i = 0;
- }
- }
- b2 += i;
- s2 += i;
- mhi = i2b (ptr, 1);
- }
- if (m2 > 0 && s2 > 0)
- {
- i = m2 < s2 ? m2 : s2;
- b2 -= i;
- m2 -= i;
- s2 -= i;
- }
- if (b5 > 0)
- {
- if (leftright)
- {
- if (m5 > 0)
- {
- mhi = pow5mult (ptr, mhi, m5);
- b1 = mult (ptr, mhi, b);
- Bfree (ptr, b);
- b = b1;
- }
- if ((j = b5 - m5))
- b = pow5mult (ptr, b, j);
- }
- else
- b = pow5mult (ptr, b, b5);
- }
- S = i2b (ptr, 1);
- if (s5 > 0)
- S = pow5mult (ptr, S, s5);
-
- /* Check for special case that d is a normalized power of 2. */
-
- if (mode < 2)
- {
- if (!word1 (d) && !(word0 (d) & Bndry_mask)
-#ifndef Sudden_Underflow
- && word0(d) & Exp_mask
-#endif
- )
- {
- /* The special case */
- b2 += Log2P;
- s2 += Log2P;
- spec_case = 1;
- }
- else
- spec_case = 0;
- }
-
- /* Arrange for convenient computation of quotients:
- * shift left if necessary so divisor has 4 leading 0 bits.
- *
- * Perhaps we should just compute leading 28 bits of S once
- * and for all and pass them and a shift to quorem, so it
- * can do shifts and ors to compute the numerator for q.
- */
-
-#ifdef Pack_32
- if ((i = ((s5 ? 32 - hi0bits (S->_x[S->_wds - 1]) : 1) + s2) & 0x1f))
- i = 32 - i;
-#else
- if ((i = ((s5 ? 32 - hi0bits (S->_x[S->_wds - 1]) : 1) + s2) & 0xf))
- i = 16 - i;
-#endif
- if (i > 4)
- {
- i -= 4;
- b2 += i;
- m2 += i;
- s2 += i;
- }
- else if (i < 4)
- {
- i += 28;
- b2 += i;
- m2 += i;
- s2 += i;
- }
- if (b2 > 0)
- b = lshift (ptr, b, b2);
- if (s2 > 0)
- S = lshift (ptr, S, s2);
- if (k_check)
- {
- if (cmp (b, S) < 0)
- {
- k--;
- b = multadd (ptr, b, 10, 0); /* we botched the k estimate */
- if (leftright)
- mhi = multadd (ptr, mhi, 10, 0);
- ilim = ilim1;
- }
- }
- if (ilim <= 0 && mode > 2)
- {
- if (ilim < 0 || cmp (b, S = multadd (ptr, S, 5, 0)) <= 0)
- {
- /* no digits, fcvt style */
- no_digits:
- k = -1 - ndigits;
- goto ret;
- }
- one_digit:
- *s++ = '1';
- k++;
- goto ret;
- }
- if (leftright)
- {
- if (m2 > 0)
- mhi = lshift (ptr, mhi, m2);
-
- /* Single precision case, */
- if (float_type)
- mhi = lshift (ptr, mhi, 29);
-
- /* Compute mlo -- check for special case
- * that d is a normalized power of 2.
- */
-
- mlo = mhi;
- if (spec_case)
- {
- mhi = Balloc (ptr, mhi->_k);
- Bcopy (mhi, mlo);
- mhi = lshift (ptr, mhi, Log2P);
- }
-
- for (i = 1;; i++)
- {
- dig = quorem (b, S) + '0';
- /* Do we yet have the shortest decimal string
- * that will round to d?
- */
- j = cmp (b, mlo);
- delta = diff (ptr, S, mhi);
- j1 = delta->_sign ? 1 : cmp (b, delta);
- Bfree (ptr, delta);
-#ifndef ROUND_BIASED
- if (j1 == 0 && !mode && !(word1 (d) & 1))
- {
- if (dig == '9')
- goto round_9_up;
- if (j > 0)
- dig++;
- *s++ = dig;
- goto ret;
- }
-#endif
- if (j < 0 || (j == 0 && !mode
-#ifndef ROUND_BIASED
- && !(word1 (d) & 1)
-#endif
- ))
- {
- if (j1 > 0)
- {
- b = lshift (ptr, b, 1);
- j1 = cmp (b, S);
- if ((j1 > 0 || (j1 == 0 && dig & 1))
- && dig++ == '9')
- goto round_9_up;
- }
- *s++ = dig;
- goto ret;
- }
- if (j1 > 0)
- {
- if (dig == '9')
- { /* possible if i == 1 */
- round_9_up:
- *s++ = '9';
- goto roundoff;
- }
- *s++ = dig + 1;
- goto ret;
- }
- *s++ = dig;
- if (i == ilim)
- break;
- b = multadd (ptr, b, 10, 0);
- if (mlo == mhi)
- mlo = mhi = multadd (ptr, mhi, 10, 0);
- else
- {
- mlo = multadd (ptr, mlo, 10, 0);
- mhi = multadd (ptr, mhi, 10, 0);
- }
- }
- }
- else
- for (i = 1;; i++)
- {
- *s++ = dig = quorem (b, S) + '0';
- if (i >= ilim)
- break;
- b = multadd (ptr, b, 10, 0);
- }
-
- /* Round off last digit */
-
- b = lshift (ptr, b, 1);
- j = cmp (b, S);
- if (j > 0 || (j == 0 && dig & 1))
- {
- roundoff:
- while (*--s == '9')
- if (s == s0)
- {
- k++;
- *s++ = '1';
- goto ret;
- }
- ++*s++;
- }
- else
- {
- while (*--s == '0');
- s++;
- }
-ret:
- Bfree (ptr, S);
- if (mhi)
- {
- if (mlo && mlo != mhi)
- Bfree (ptr, mlo);
- Bfree (ptr, mhi);
- }
-ret1:
- Bfree (ptr, b);
- *s = 0;
- *decpt = k + 1;
- if (rve)
- *rve = s;
- return s0;
-}
-
-
-_VOID
-_DEFUN (_dtoa,
- (_d, mode, ndigits, decpt, sign, rve, buf, float_type),
- double _d _AND
- int mode _AND
- int ndigits _AND
- int *decpt _AND
- int *sign _AND
- char **rve _AND
- char *buf _AND
- int float_type)
-{
- struct _Jv_reent reent;
- char *p;
- memset (&reent, 0, sizeof reent);
-
- p = _dtoa_r (&reent, _d, mode, ndigits, decpt, sign, rve, float_type);
- strcpy (buf, p);
-
- return;
-}
diff --git a/libjava/java/lang/e_acos.c b/libjava/java/lang/e_acos.c
deleted file mode 100644
index ee6b168a1c5..00000000000
--- a/libjava/java/lang/e_acos.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-/* @(#)e_acos.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* __ieee754_acos(x)
- * Method :
- * acos(x) = pi/2 - asin(x)
- * acos(-x) = pi/2 + asin(x)
- * For |x|<=0.5
- * acos(x) = pi/2 - (x + x*x^2*R(x^2)) (see asin.c)
- * For x>0.5
- * acos(x) = pi/2 - (pi/2 - 2asin(sqrt((1-x)/2)))
- * = 2asin(sqrt((1-x)/2))
- * = 2s + 2s*z*R(z) ...z=(1-x)/2, s=sqrt(z)
- * = 2f + (2c + 2s*z*R(z))
- * where f=hi part of s, and c = (z-f*f)/(s+f) is the correction term
- * for f so that f+c ~ sqrt(z).
- * For x<-0.5
- * acos(x) = pi - 2asin(sqrt((1-|x|)/2))
- * = pi - 0.5*(s+s*z*R(z)), where z=(1-|x|)/2,s=sqrt(z)
- *
- * Special cases:
- * if x is NaN, return x itself;
- * if |x|>1, return NaN with invalid signal.
- *
- * Function needed: sqrt
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-one= 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
-pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */
-pio2_hi = 1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */
-pio2_lo = 6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */
-pS0 = 1.66666666666666657415e-01, /* 0x3FC55555, 0x55555555 */
-pS1 = -3.25565818622400915405e-01, /* 0xBFD4D612, 0x03EB6F7D */
-pS2 = 2.01212532134862925881e-01, /* 0x3FC9C155, 0x0E884455 */
-pS3 = -4.00555345006794114027e-02, /* 0xBFA48228, 0xB5688F3B */
-pS4 = 7.91534994289814532176e-04, /* 0x3F49EFE0, 0x7501B288 */
-pS5 = 3.47933107596021167570e-05, /* 0x3F023DE1, 0x0DFDF709 */
-qS1 = -2.40339491173441421878e+00, /* 0xC0033A27, 0x1C8A2D4B */
-qS2 = 2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */
-qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */
-qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
-
-#ifdef __STDC__
- double __ieee754_acos(double x)
-#else
- double __ieee754_acos(x)
- double x;
-#endif
-{
- double z,p,q,r,w,s,c,df;
- int32_t hx,ix;
- GET_HIGH_WORD(hx,x);
- ix = hx&0x7fffffff;
- if(ix>=0x3ff00000) { /* |x| >= 1 */
- uint32_t lx;
- GET_LOW_WORD(lx,x);
- if(((ix-0x3ff00000)|lx)==0) { /* |x|==1 */
- if(hx>0) return 0.0; /* acos(1) = 0 */
- else return pi+2.0*pio2_lo; /* acos(-1)= pi */
- }
- return (x-x)/(x-x); /* acos(|x|>1) is NaN */
- }
- if(ix<0x3fe00000) { /* |x| < 0.5 */
- if(ix<=0x3c600000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/
- z = x*x;
- p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
- q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
- r = p/q;
- return pio2_hi - (x - (pio2_lo-x*r));
- } else if (hx<0) { /* x < -0.5 */
- z = (one+x)*0.5;
- p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
- q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
- s = __ieee754_sqrt(z);
- r = p/q;
- w = r*s-pio2_lo;
- return pi - 2.0*(s+w);
- } else { /* x > 0.5 */
- z = (one-x)*0.5;
- s = __ieee754_sqrt(z);
- df = s;
- SET_LOW_WORD(df,0);
- c = (z-df*df)/(s+df);
- p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
- q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
- r = p/q;
- w = r*s+c;
- return 2.0*(df+w);
- }
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/e_asin.c b/libjava/java/lang/e_asin.c
deleted file mode 100644
index 90fc77ffc3b..00000000000
--- a/libjava/java/lang/e_asin.c
+++ /dev/null
@@ -1,120 +0,0 @@
-
-/* @(#)e_asin.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* __ieee754_asin(x)
- * Method :
- * Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ...
- * we approximate asin(x) on [0,0.5] by
- * asin(x) = x + x*x^2*R(x^2)
- * where
- * R(x^2) is a rational approximation of (asin(x)-x)/x^3
- * and its remez error is bounded by
- * |(asin(x)-x)/x^3 - R(x^2)| < 2^(-58.75)
- *
- * For x in [0.5,1]
- * asin(x) = pi/2-2*asin(sqrt((1-x)/2))
- * Let y = (1-x), z = y/2, s := sqrt(z), and pio2_hi+pio2_lo=pi/2;
- * then for x>0.98
- * asin(x) = pi/2 - 2*(s+s*z*R(z))
- * = pio2_hi - (2*(s+s*z*R(z)) - pio2_lo)
- * For x<=0.98, let pio4_hi = pio2_hi/2, then
- * f = hi part of s;
- * c = sqrt(z) - f = (z-f*f)/(s+f) ...f+c=sqrt(z)
- * and
- * asin(x) = pi/2 - 2*(s+s*z*R(z))
- * = pio4_hi+(pio4-2s)-(2s*z*R(z)-pio2_lo)
- * = pio4_hi+(pio4-2f)-(2s*z*R(z)-(pio2_lo+2c))
- *
- * Special cases:
- * if x is NaN, return x itself;
- * if |x|>1, return NaN with invalid signal.
- *
- */
-
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
-huge = 1.000e+300,
-pio2_hi = 1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */
-pio2_lo = 6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */
-pio4_hi = 7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */
- /* coefficient for R(x^2) */
-pS0 = 1.66666666666666657415e-01, /* 0x3FC55555, 0x55555555 */
-pS1 = -3.25565818622400915405e-01, /* 0xBFD4D612, 0x03EB6F7D */
-pS2 = 2.01212532134862925881e-01, /* 0x3FC9C155, 0x0E884455 */
-pS3 = -4.00555345006794114027e-02, /* 0xBFA48228, 0xB5688F3B */
-pS4 = 7.91534994289814532176e-04, /* 0x3F49EFE0, 0x7501B288 */
-pS5 = 3.47933107596021167570e-05, /* 0x3F023DE1, 0x0DFDF709 */
-qS1 = -2.40339491173441421878e+00, /* 0xC0033A27, 0x1C8A2D4B */
-qS2 = 2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */
-qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */
-qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
-
-#ifdef __STDC__
- double __ieee754_asin(double x)
-#else
- double __ieee754_asin(x)
- double x;
-#endif
-{
- double t = 0., w, p, q, c, r, s;
- int32_t hx,ix;
- GET_HIGH_WORD(hx,x);
- ix = hx&0x7fffffff;
- if(ix>= 0x3ff00000) { /* |x|>= 1 */
- uint32_t lx;
- GET_LOW_WORD(lx,x);
- if(((ix-0x3ff00000)|lx)==0)
- /* asin(1)=+-pi/2 with inexact */
- return x*pio2_hi+x*pio2_lo;
- return (x-x)/(x-x); /* asin(|x|>1) is NaN */
- } else if (ix<0x3fe00000) { /* |x|<0.5 */
- if(ix<0x3e400000) { /* if |x| < 2**-27 */
- if(huge+x>one) return x;/* return x with inexact if x!=0*/
- } else
- t = x*x;
- p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
- q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
- w = p/q;
- return x+x*w;
- }
- /* 1> |x|>= 0.5 */
- w = one-fabs(x);
- t = w*0.5;
- p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
- q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
- s = __ieee754_sqrt(t);
- if(ix>=0x3FEF3333) { /* if |x| > 0.975 */
- w = p/q;
- t = pio2_hi-(2.0*(s+s*w)-pio2_lo);
- } else {
- w = s;
- SET_LOW_WORD(w,0);
- c = (t-w*w)/(s+w);
- r = p/q;
- p = 2.0*s*r-(pio2_lo-2.0*c);
- q = pio4_hi-2.0*w;
- t = pio4_hi-(p-q);
- }
- if(hx>0) return t; else return -t;
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/e_atan2.c b/libjava/java/lang/e_atan2.c
deleted file mode 100644
index c75448db26c..00000000000
--- a/libjava/java/lang/e_atan2.c
+++ /dev/null
@@ -1,131 +0,0 @@
-
-/* @(#)e_atan2.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- *
- */
-
-/* __ieee754_atan2(y,x)
- * Method :
- * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x).
- * 2. Reduce x to positive by (if x and y are unexceptional):
- * ARG (x+iy) = arctan(y/x) ... if x > 0,
- * ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0,
- *
- * Special cases:
- *
- * ATAN2((anything), NaN ) is NaN;
- * ATAN2(NAN , (anything) ) is NaN;
- * ATAN2(+-0, +(anything but NaN)) is +-0 ;
- * ATAN2(+-0, -(anything but NaN)) is +-pi ;
- * ATAN2(+-(anything but 0 and NaN), 0) is +-pi/2;
- * ATAN2(+-(anything but INF and NaN), +INF) is +-0 ;
- * ATAN2(+-(anything but INF and NaN), -INF) is +-pi;
- * ATAN2(+-INF,+INF ) is +-pi/4 ;
- * ATAN2(+-INF,-INF ) is +-3pi/4;
- * ATAN2(+-INF, (anything but,0,NaN, and INF)) is +-pi/2;
- *
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-tiny = 1.0e-300,
-zero = 0.0,
-pi_o_4 = 7.8539816339744827900E-01, /* 0x3FE921FB, 0x54442D18 */
-pi_o_2 = 1.5707963267948965580E+00, /* 0x3FF921FB, 0x54442D18 */
-pi = 3.1415926535897931160E+00, /* 0x400921FB, 0x54442D18 */
-pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
-
-#ifdef __STDC__
- double __ieee754_atan2(double y, double x)
-#else
- double __ieee754_atan2(y,x)
- double y,x;
-#endif
-{
- double z;
- int32_t k,m,hx,hy,ix,iy;
- uint32_t lx,ly;
-
- EXTRACT_WORDS(hx,lx,x);
- ix = hx&0x7fffffff;
- EXTRACT_WORDS(hy,ly,y);
- iy = hy&0x7fffffff;
- if(((ix|((lx|-lx)>>31))>0x7ff00000)||
- ((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */
- return x+y;
- if(((hx-0x3ff00000)|lx)==0) return atan(y); /* x=1.0 */
- m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */
-
- /* when y = 0 */
- if((iy|ly)==0) {
- switch(m) {
- case 0:
- case 1: return y; /* atan(+-0,+anything)=+-0 */
- case 2: return pi+tiny;/* atan(+0,-anything) = pi */
- case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */
- }
- }
- /* when x = 0 */
- if((ix|lx)==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny;
-
- /* when x is INF */
- if(ix==0x7ff00000) {
- if(iy==0x7ff00000) {
- switch(m) {
- case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */
- case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */
- case 2: return 3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/
- case 3: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/
- }
- } else {
- switch(m) {
- case 0: return zero ; /* atan(+...,+INF) */
- case 1: return -zero ; /* atan(-...,+INF) */
- case 2: return pi+tiny ; /* atan(+...,-INF) */
- case 3: return -pi-tiny ; /* atan(-...,-INF) */
- }
- }
- }
- /* when y is INF */
- if(iy==0x7ff00000) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny;
-
- /* compute y/x */
- k = (iy-ix)>>20;
- if(k > 60) z=pi_o_2+0.5*pi_lo; /* |y/x| > 2**60 */
- else if(hx<0&&k<-60) z=0.0; /* |y|/x < -2**60 */
- else z=atan(fabs(y/x)); /* safe to do y/x */
- switch (m) {
- case 0: return z ; /* atan(+,+) */
- case 1: {
- uint32_t zh;
- GET_HIGH_WORD(zh,z);
- SET_HIGH_WORD(z,zh ^ 0x80000000);
- }
- return z ; /* atan(-,+) */
- case 2: return pi-(z-pi_lo);/* atan(+,-) */
- default: /* case 3 */
- return (z-pi_lo)-pi;/* atan(-,-) */
- }
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/e_exp.c b/libjava/java/lang/e_exp.c
deleted file mode 100644
index ad37f86b029..00000000000
--- a/libjava/java/lang/e_exp.c
+++ /dev/null
@@ -1,167 +0,0 @@
-
-/* @(#)e_exp.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* __ieee754_exp(x)
- * Returns the exponential of x.
- *
- * Method
- * 1. Argument reduction:
- * Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658.
- * Given x, find r and integer k such that
- *
- * x = k*ln2 + r, |r| <= 0.5*ln2.
- *
- * Here r will be represented as r = hi-lo for better
- * accuracy.
- *
- * 2. Approximation of exp(r) by a special rational function on
- * the interval [0,0.34658]:
- * Write
- * R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ...
- * We use a special Reme algorithm on [0,0.34658] to generate
- * a polynomial of degree 5 to approximate R. The maximum error
- * of this polynomial approximation is bounded by 2**-59. In
- * other words,
- * R(z) ~ 2.0 + P1*z + P2*z**2 + P3*z**3 + P4*z**4 + P5*z**5
- * (where z=r*r, and the values of P1 to P5 are listed below)
- * and
- * | 5 | -59
- * | 2.0+P1*z+...+P5*z - R(z) | <= 2
- * | |
- * The computation of exp(r) thus becomes
- * 2*r
- * exp(r) = 1 + -------
- * R - r
- * r*R1(r)
- * = 1 + r + ----------- (for better accuracy)
- * 2 - R1(r)
- * where
- * 2 4 10
- * R1(r) = r - (P1*r + P2*r + ... + P5*r ).
- *
- * 3. Scale back to obtain exp(x):
- * From step 1, we have
- * exp(x) = 2^k * exp(r)
- *
- * Special cases:
- * exp(INF) is INF, exp(NaN) is NaN;
- * exp(-INF) is 0, and
- * for finite argument, only exp(0)=1 is exact.
- *
- * Accuracy:
- * according to an error analysis, the error is always less than
- * 1 ulp (unit in the last place).
- *
- * Misc. info.
- * For IEEE double
- * if x > 7.09782712893383973096e+02 then exp(x) overflow
- * if x < -7.45133219101941108420e+02 then exp(x) underflow
- *
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-one = 1.0,
-halF[2] = {0.5,-0.5,},
-huge = 1.0e+300,
-twom1000= 9.33263618503218878990e-302, /* 2**-1000=0x01700000,0*/
-o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */
-u_threshold= -7.45133219101941108420e+02, /* 0xc0874910, 0xD52D3051 */
-ln2HI[2] ={ 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */
- -6.93147180369123816490e-01,},/* 0xbfe62e42, 0xfee00000 */
-ln2LO[2] ={ 1.90821492927058770002e-10, /* 0x3dea39ef, 0x35793c76 */
- -1.90821492927058770002e-10,},/* 0xbdea39ef, 0x35793c76 */
-invln2 = 1.44269504088896338700e+00, /* 0x3ff71547, 0x652b82fe */
-P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */
-P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */
-P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */
-P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
-P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
-
-
-#ifdef __STDC__
- double __ieee754_exp(double x) /* default IEEE double exp */
-#else
- double __ieee754_exp(x) /* default IEEE double exp */
- double x;
-#endif
-{
- double y,hi = 0., lo = 0.,c,t;
- int32_t k = 0, xsb;
- uint32_t hx;
-
- GET_HIGH_WORD(hx,x);
- xsb = (hx>>31)&1; /* sign bit of x */
- hx &= 0x7fffffff; /* high word of |x| */
-
- /* filter out non-finite argument */
- if(hx >= 0x40862E42) { /* if |x|>=709.78... */
- if(hx>=0x7ff00000) {
- uint32_t lx;
- GET_LOW_WORD(lx,x);
- if(((hx&0xfffff)|lx)!=0)
- return x+x; /* NaN */
- else return (xsb==0)? x:0.0; /* exp(+-inf)={inf,0} */
- }
- if(x > o_threshold) return huge*huge; /* overflow */
- if(x < u_threshold) return twom1000*twom1000; /* underflow */
- }
-
- /* argument reduction */
- if(hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */
- if(hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */
- hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb;
- } else {
- k = invln2*x+halF[xsb];
- t = k;
- hi = x - t*ln2HI[0]; /* t*ln2HI is exact here */
- lo = t*ln2LO[0];
- }
- x = hi - lo;
- }
- else if(hx < 0x3e300000) { /* when |x|<2**-28 */
- if(huge+x>one) return one+x;/* trigger inexact */
- }
- else k = 0;
-
- /* x is now in primary range */
- t = x*x;
- c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
- if(k==0) return one-((x*c)/(c-2.0)-x);
- else y = one-((lo-(x*c)/(2.0-c))-hi);
- if(k >= -1021) {
- uint32_t hy;
- GET_HIGH_WORD(hy,y);
- SET_HIGH_WORD(y,hy+(k<<20)); /* add k to y's exponent */
- return y;
- } else {
- uint32_t hy;
- GET_HIGH_WORD(hy,y);
- SET_HIGH_WORD(y,hy+((k+1000)<<20)); /* add k to y's exponent */
- return y*twom1000;
- }
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/e_fmod.c b/libjava/java/lang/e_fmod.c
deleted file mode 100644
index 1cf09907666..00000000000
--- a/libjava/java/lang/e_fmod.c
+++ /dev/null
@@ -1,140 +0,0 @@
-
-/* @(#)e_fmod.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
- * __ieee754_fmod(x,y)
- * Return x mod y in exact arithmetic
- * Method: shift and subtract
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double one = 1.0, Zero[] = {0.0, -0.0,};
-#else
-static double one = 1.0, Zero[] = {0.0, -0.0,};
-#endif
-
-#ifdef __STDC__
- double __ieee754_fmod(double x, double y)
-#else
- double __ieee754_fmod(x,y)
- double x,y ;
-#endif
-{
- int32_t n,hx,hy,hz,ix,iy,sx,i;
- uint32_t lx,ly,lz;
-
- EXTRACT_WORDS(hx,lx,x);
- EXTRACT_WORDS(hy,ly,y);
- sx = hx&0x80000000; /* sign of x */
- hx ^=sx; /* |x| */
- hy &= 0x7fffffff; /* |y| */
-
- /* purge off exception values */
- if((hy|ly)==0||(hx>=0x7ff00000)|| /* y=0,or x not finite */
- ((hy|((ly|-ly)>>31))>0x7ff00000)) /* or y is NaN */
- return (x*y)/(x*y);
- if(hx<=hy) {
- if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */
- if(lx==ly)
- return Zero[(uint32_t)sx>>31]; /* |x|=|y| return x*0*/
- }
-
- /* determine ix = ilogb(x) */
- if(hx<0x00100000) { /* subnormal x */
- if(hx==0) {
- for (ix = -1043, i=lx; i>0; i<<=1) ix -=1;
- } else {
- for (ix = -1022,i=(hx<<11); i>0; i<<=1) ix -=1;
- }
- } else ix = (hx>>20)-1023;
-
- /* determine iy = ilogb(y) */
- if(hy<0x00100000) { /* subnormal y */
- if(hy==0) {
- for (iy = -1043, i=ly; i>0; i<<=1) iy -=1;
- } else {
- for (iy = -1022,i=(hy<<11); i>0; i<<=1) iy -=1;
- }
- } else iy = (hy>>20)-1023;
-
- /* set up {hx,lx}, {hy,ly} and align y to x */
- if(ix >= -1022)
- hx = 0x00100000|(0x000fffff&hx);
- else { /* subnormal x, shift x to normal */
- n = -1022-ix;
- if(n<=31) {
- hx = (hx<<n)|(lx>>(32-n));
- lx <<= n;
- } else {
- hx = lx<<(n-32);
- lx = 0;
- }
- }
- if(iy >= -1022)
- hy = 0x00100000|(0x000fffff&hy);
- else { /* subnormal y, shift y to normal */
- n = -1022-iy;
- if(n<=31) {
- hy = (hy<<n)|(ly>>(32-n));
- ly <<= n;
- } else {
- hy = ly<<(n-32);
- ly = 0;
- }
- }
-
- /* fix point fmod */
- n = ix - iy;
- while(n--) {
- hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
- if(hz<0){hx = hx+hx+(lx>>31); lx = lx+lx;}
- else {
- if((hz|lz)==0) /* return sign(x)*0 */
- return Zero[(uint32_t)sx>>31];
- hx = hz+hz+(lz>>31); lx = lz+lz;
- }
- }
- hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
- if(hz>=0) {hx=hz;lx=lz;}
-
- /* convert back to floating value and restore the sign */
- if((hx|lx)==0) /* return sign(x)*0 */
- return Zero[(uint32_t)sx>>31];
- while(hx<0x00100000) { /* normalize x */
- hx = hx+hx+(lx>>31); lx = lx+lx;
- iy -= 1;
- }
- if(iy>= -1022) { /* normalize output */
- hx = ((hx-0x00100000)|((iy+1023)<<20));
- INSERT_WORDS(x,hx|sx,lx);
- } else { /* subnormal output */
- n = -1022 - iy;
- if(n<=20) {
- lx = (lx>>n)|((uint32_t)hx<<(32-n));
- hx >>= n;
- } else if (n<=31) {
- lx = (hx<<(32-n))|(lx>>n); hx = sx;
- } else {
- lx = hx>>(n-32); hx = sx;
- }
- INSERT_WORDS(x,hx|sx,lx);
- x *= one; /* create necessary signal */
- }
- return x; /* exact output */
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/e_log.c b/libjava/java/lang/e_log.c
deleted file mode 100644
index 093473e1048..00000000000
--- a/libjava/java/lang/e_log.c
+++ /dev/null
@@ -1,152 +0,0 @@
-
-/* @(#)e_log.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* __ieee754_log(x)
- * Return the logrithm of x
- *
- * Method :
- * 1. Argument Reduction: find k and f such that
- * x = 2^k * (1+f),
- * where sqrt(2)/2 < 1+f < sqrt(2) .
- *
- * 2. Approximation of log(1+f).
- * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
- * = 2s + 2/3 s**3 + 2/5 s**5 + .....,
- * = 2s + s*R
- * We use a special Reme algorithm on [0,0.1716] to generate
- * a polynomial of degree 14 to approximate R The maximum error
- * of this polynomial approximation is bounded by 2**-58.45. In
- * other words,
- * 2 4 6 8 10 12 14
- * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s
- * (the values of Lg1 to Lg7 are listed in the program)
- * and
- * | 2 14 | -58.45
- * | Lg1*s +...+Lg7*s - R(z) | <= 2
- * | |
- * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
- * In order to guarantee error in log below 1ulp, we compute log
- * by
- * log(1+f) = f - s*(f - R) (if f is not too large)
- * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy)
- *
- * 3. Finally, log(x) = k*ln2 + log(1+f).
- * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
- * Here ln2 is split into two floating point number:
- * ln2_hi + ln2_lo,
- * where n*ln2_hi is always exact for |n| < 2000.
- *
- * Special cases:
- * log(x) is NaN with signal if x < 0 (including -INF) ;
- * log(+INF) is +INF; log(0) is -INF with signal;
- * log(NaN) is that NaN with no signal.
- *
- * Accuracy:
- * according to an error analysis, the error is always less than
- * 1 ulp (unit in the last place).
- *
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
-ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */
-two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */
-Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */
-Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */
-Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */
-Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */
-Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */
-Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */
-Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
-
-#ifdef __STDC__
-static const double zero = 0.0;
-#else
-static double zero = 0.0;
-#endif
-
-#ifdef __STDC__
- double __ieee754_log(double x)
-#else
- double __ieee754_log(x)
- double x;
-#endif
-{
- double hfsq,f,s,z,R,w,t1,t2,dk;
- int32_t k,hx,i,j;
- uint32_t lx;
-
- EXTRACT_WORDS(hx,lx,x);
-
- k=0;
- if (hx < 0x00100000) { /* x < 2**-1022 */
- if (((hx&0x7fffffff)|lx)==0)
- return -two54/zero; /* log(+-0)=-inf */
- if (hx<0) return (x-x)/zero; /* log(-#) = NaN */
- k -= 54; x *= two54; /* subnormal number, scale up x */
- GET_HIGH_WORD(hx,x);
- }
- if (hx >= 0x7ff00000) return x+x;
- k += (hx>>20)-1023;
- hx &= 0x000fffff;
- i = (hx+0x95f64)&0x100000;
- SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */
- k += (i>>20);
- f = x-1.0;
- if((0x000fffff&(2+hx))<3) { /* |f| < 2**-20 */
- if(f==zero) {
- if(k==0)
- return zero;
- else {
- dk=(double)k;
- return dk*ln2_hi+dk*ln2_lo;
- }
- }
- R = f*f*(0.5-0.33333333333333333*f);
- if(k==0) return f-R; else {dk=(double)k;
- return dk*ln2_hi-((R-dk*ln2_lo)-f);}
- }
- s = f/(2.0+f);
- dk = (double)k;
- z = s*s;
- i = hx-0x6147a;
- w = z*z;
- j = 0x6b851-hx;
- t1= w*(Lg2+w*(Lg4+w*Lg6));
- t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7)));
- i |= j;
- R = t2+t1;
- if(i>0) {
- hfsq=0.5*f*f;
- if(k==0) return f-(hfsq-s*(hfsq+R)); else
- return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f);
- } else {
- if(k==0) return f-s*(f-R); else
- return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
- }
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/e_pow.c b/libjava/java/lang/e_pow.c
deleted file mode 100644
index b21c0e92b39..00000000000
--- a/libjava/java/lang/e_pow.c
+++ /dev/null
@@ -1,312 +0,0 @@
-
-/* @(#)e_pow.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* __ieee754_pow(x,y) return x**y
- *
- * n
- * Method: Let x = 2 * (1+f)
- * 1. Compute and return log2(x) in two pieces:
- * log2(x) = w1 + w2,
- * where w1 has 53-24 = 29 bit trailing zeros.
- * 2. Perform y*log2(x) = n+y' by simulating muti-precision
- * arithmetic, where |y'|<=0.5.
- * 3. Return x**y = 2**n*exp(y'*log2)
- *
- * Special cases:
- * 1. (anything) ** 0 is 1
- * 2. (anything) ** 1 is itself
- * 3. (anything) ** NAN is NAN
- * 4. NAN ** (anything except 0) is NAN
- * 5. +-(|x| > 1) ** +INF is +INF
- * 6. +-(|x| > 1) ** -INF is +0
- * 7. +-(|x| < 1) ** +INF is +0
- * 8. +-(|x| < 1) ** -INF is +INF
- * 9. +-1 ** +-INF is NAN
- * 10. +0 ** (+anything except 0, NAN) is +0
- * 11. -0 ** (+anything except 0, NAN, odd integer) is +0
- * 12. +0 ** (-anything except 0, NAN) is +INF
- * 13. -0 ** (-anything except 0, NAN, odd integer) is +INF
- * 14. -0 ** (odd integer) = -( +0 ** (odd integer) )
- * 15. +INF ** (+anything except 0,NAN) is +INF
- * 16. +INF ** (-anything except 0,NAN) is +0
- * 17. -INF ** (anything) = -0 ** (-anything)
- * 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer)
- * 19. (-anything except 0 and inf) ** (non-integer) is NAN
- *
- * Accuracy:
- * pow(x,y) returns x**y nearly rounded. In particular
- * pow(integer,integer)
- * always returns the correct integer provided it is
- * representable.
- *
- * Constants :
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-bp[] = {1.0, 1.5,},
-dp_h[] = { 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */
-dp_l[] = { 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */
-zero = 0.0,
-one = 1.0,
-two = 2.0,
-two53 = 9007199254740992.0, /* 0x43400000, 0x00000000 */
-huge = 1.0e300,
-tiny = 1.0e-300,
- /* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */
-L1 = 5.99999999999994648725e-01, /* 0x3FE33333, 0x33333303 */
-L2 = 4.28571428578550184252e-01, /* 0x3FDB6DB6, 0xDB6FABFF */
-L3 = 3.33333329818377432918e-01, /* 0x3FD55555, 0x518F264D */
-L4 = 2.72728123808534006489e-01, /* 0x3FD17460, 0xA91D4101 */
-L5 = 2.30660745775561754067e-01, /* 0x3FCD864A, 0x93C9DB65 */
-L6 = 2.06975017800338417784e-01, /* 0x3FCA7E28, 0x4A454EEF */
-P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */
-P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */
-P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */
-P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
-P5 = 4.13813679705723846039e-08, /* 0x3E663769, 0x72BEA4D0 */
-lg2 = 6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */
-lg2_h = 6.93147182464599609375e-01, /* 0x3FE62E43, 0x00000000 */
-lg2_l = -1.90465429995776804525e-09, /* 0xBE205C61, 0x0CA86C39 */
-ovt = 8.0085662595372944372e-0017, /* -(1024-log2(ovfl+.5ulp)) */
-cp = 9.61796693925975554329e-01, /* 0x3FEEC709, 0xDC3A03FD =2/(3ln2) */
-cp_h = 9.61796700954437255859e-01, /* 0x3FEEC709, 0xE0000000 =(float)cp */
-cp_l = -7.02846165095275826516e-09, /* 0xBE3E2FE0, 0x145B01F5 =tail of cp_h*/
-ivln2 = 1.44269504088896338700e+00, /* 0x3FF71547, 0x652B82FE =1/ln2 */
-ivln2_h = 1.44269502162933349609e+00, /* 0x3FF71547, 0x60000000 =24b 1/ln2*/
-ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/
-
-#ifdef __STDC__
- double __ieee754_pow(double x, double y)
-#else
- double __ieee754_pow(x,y)
- double x, y;
-#endif
-{
- double z,ax,z_h,z_l,p_h,p_l;
- double y1,t1,t2,r,s,t,u,v,w;
- int32_t i,j,k,yisint,n;
- int32_t hx,hy,ix,iy;
- uint32_t lx,ly;
-
- EXTRACT_WORDS(hx,lx,x);
- EXTRACT_WORDS(hy,ly,y);
- ix = hx&0x7fffffff; iy = hy&0x7fffffff;
-
- /* y==zero: x**0 = 1 */
- if((iy|ly)==0) return one;
-
- /* +-NaN return x+y */
- if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) ||
- iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0)))
- return x+y;
-
- /* determine if y is an odd int when x < 0
- * yisint = 0 ... y is not an integer
- * yisint = 1 ... y is an odd int
- * yisint = 2 ... y is an even int
- */
- yisint = 0;
- if(hx<0) {
- if(iy>=0x43400000) yisint = 2; /* even integer y */
- else if(iy>=0x3ff00000) {
- k = (iy>>20)-0x3ff; /* exponent */
- if(k>20) {
- j = ly>>(52-k);
- if((uint32_t)(j<<(52-k))==ly) yisint = 2-(j&1);
- } else if(ly==0) {
- j = iy>>(20-k);
- if((j<<(20-k))==iy) yisint = 2-(j&1);
- }
- }
- }
-
- /* special value of y */
- if(ly==0) {
- if (iy==0x7ff00000) { /* y is +-inf */
- if(((ix-0x3ff00000)|lx)==0)
- return y - y; /* inf**+-1 is NaN */
- else if (ix >= 0x3ff00000)/* (|x|>1)**+-inf = inf,0 */
- return (hy>=0)? y: zero;
- else /* (|x|<1)**-,+inf = inf,0 */
- return (hy<0)?-y: zero;
- }
- if(iy==0x3ff00000) { /* y is +-1 */
- if(hy<0) return one/x; else return x;
- }
- if(hy==0x40000000) return x*x; /* y is 2 */
- if(hy==0x3fe00000) { /* y is 0.5 */
- if(hx>=0) /* x >= +0 */
- return __ieee754_sqrt(x);
- }
- }
-
- ax = fabs(x);
- /* special value of x */
- if(lx==0) {
- if(ix==0x7ff00000||ix==0||ix==0x3ff00000){
- z = ax; /*x is +-0,+-inf,+-1*/
- if(hy<0) z = one/z; /* z = (1/|x|) */
- if(hx<0) {
- if(((ix-0x3ff00000)|yisint)==0) {
- z = (z-z)/(z-z); /* (-1)**non-int is NaN */
- } else if(yisint==1)
- z = -z; /* (x<0)**odd = -(|x|**odd) */
- }
- return z;
- }
- }
-
- /* (x<0)**(non-int) is NaN */
- /* GCJ LOCAL: This used to be
- if((((hx>>31)+1)|yisint)==0) return (x-x)/(x-x);
- but ANSI C says a right shift of a signed negative quantity is
- implementation defined. */
- if(((((uint32_t)hx>>31)-1)|yisint)==0) return (x-x)/(x-x);
-
- /* |y| is huge */
- if(iy>0x41e00000) { /* if |y| > 2**31 */
- if(iy>0x43f00000){ /* if |y| > 2**64, must o/uflow */
- if(ix<=0x3fefffff) return (hy<0)? huge*huge:tiny*tiny;
- if(ix>=0x3ff00000) return (hy>0)? huge*huge:tiny*tiny;
- }
- /* over/underflow if x is not close to one */
- if(ix<0x3fefffff) return (hy<0)? huge*huge:tiny*tiny;
- if(ix>0x3ff00000) return (hy>0)? huge*huge:tiny*tiny;
- /* now |1-x| is tiny <= 2**-20, suffice to compute
- log(x) by x-x^2/2+x^3/3-x^4/4 */
- t = x-1; /* t has 20 trailing zeros */
- w = (t*t)*(0.5-t*(0.3333333333333333333333-t*0.25));
- u = ivln2_h*t; /* ivln2_h has 21 sig. bits */
- v = t*ivln2_l-w*ivln2;
- t1 = u+v;
- SET_LOW_WORD(t1,0);
- t2 = v-(t1-u);
- } else {
- double s2,s_h,s_l,t_h,t_l;
- n = 0;
- /* take care subnormal number */
- if(ix<0x00100000)
- {ax *= two53; n -= 53; GET_HIGH_WORD(ix,ax); }
- n += ((ix)>>20)-0x3ff;
- j = ix&0x000fffff;
- /* determine interval */
- ix = j|0x3ff00000; /* normalize ix */
- if(j<=0x3988E) k=0; /* |x|<sqrt(3/2) */
- else if(j<0xBB67A) k=1; /* |x|<sqrt(3) */
- else {k=0;n+=1;ix -= 0x00100000;}
- SET_HIGH_WORD(ax,ix);
-
- /* compute s = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */
- u = ax-bp[k]; /* bp[0]=1.0, bp[1]=1.5 */
- v = one/(ax+bp[k]);
- s = u*v;
- s_h = s;
- SET_LOW_WORD(s_h,0);
- /* t_h=ax+bp[k] High */
- t_h = zero;
- SET_HIGH_WORD(t_h,((ix>>1)|0x20000000)+0x00080000+(k<<18));
- t_l = ax - (t_h-bp[k]);
- s_l = v*((u-s_h*t_h)-s_h*t_l);
- /* compute log(ax) */
- s2 = s*s;
- r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6)))));
- r += s_l*(s_h+s);
- s2 = s_h*s_h;
- t_h = 3.0+s2+r;
- SET_LOW_WORD(t_h,0);
- t_l = r-((t_h-3.0)-s2);
- /* u+v = s*(1+...) */
- u = s_h*t_h;
- v = s_l*t_h+t_l*s;
- /* 2/(3log2)*(s+...) */
- p_h = u+v;
- SET_LOW_WORD(p_h,0);
- p_l = v-(p_h-u);
- z_h = cp_h*p_h; /* cp_h+cp_l = 2/(3*log2) */
- z_l = cp_l*p_h+p_l*cp+dp_l[k];
- /* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */
- t = (double)n;
- t1 = (((z_h+z_l)+dp_h[k])+t);
- SET_LOW_WORD(t1,0);
- t2 = z_l-(((t1-t)-dp_h[k])-z_h);
- }
-
- s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
- if(((((uint32_t)hx>>31)-1)|(yisint-1))==0)
- s = -one;/* (-ve)**(odd int) */
-
- /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
- y1 = y;
- SET_LOW_WORD(y1,0);
- p_l = (y-y1)*t1+y*t2;
- p_h = y1*t1;
- z = p_l+p_h;
- EXTRACT_WORDS(j,i,z);
- if (j>=0x40900000) { /* z >= 1024 */
- if(((j-0x40900000)|i)!=0) /* if z > 1024 */
- return s*huge*huge; /* overflow */
- else {
- if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */
- }
- } else if((j&0x7fffffff)>=0x4090cc00 ) { /* z <= -1075 */
- if(((j-0xc090cc00)|i)!=0) /* z < -1075 */
- return s*tiny*tiny; /* underflow */
- else {
- if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */
- }
- }
- /*
- * compute 2**(p_h+p_l)
- */
- i = j&0x7fffffff;
- k = (i>>20)-0x3ff;
- n = 0;
- if(i>0x3fe00000) { /* if |z| > 0.5, set n = [z+0.5] */
- n = j+(0x00100000>>(k+1));
- k = ((n&0x7fffffff)>>20)-0x3ff; /* new k for n */
- t = zero;
- SET_HIGH_WORD(t,n&~(0x000fffff>>k));
- n = ((n&0x000fffff)|0x00100000)>>(20-k);
- if(j<0) n = -n;
- p_h -= t;
- }
- t = p_l+p_h;
- SET_LOW_WORD(t,0);
- u = t*lg2_h;
- v = (p_l-(t-p_h))*lg2+t*lg2_l;
- z = u+v;
- w = v-(z-u);
- t = z*z;
- t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
- r = (z*t1)/(t1-two)-(w+z*w);
- z = one-(r-z);
- GET_HIGH_WORD(j,z);
- j += (n<<20);
- if((j>>20)<=0) z = scalbn(z,(int)n); /* subnormal output */
- else SET_HIGH_WORD(z,j);
- return s*z;
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/e_rem_pio2.c b/libjava/java/lang/e_rem_pio2.c
deleted file mode 100644
index 543234c60c5..00000000000
--- a/libjava/java/lang/e_rem_pio2.c
+++ /dev/null
@@ -1,185 +0,0 @@
-
-/* @(#)e_rem_pio2.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- *
- */
-
-/* __ieee754_rem_pio2(x,y)
- *
- * return the remainder of x rem pi/2 in y[0]+y[1]
- * use __kernel_rem_pio2()
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-/*
- * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
- */
-#ifdef __STDC__
-static const int32_t two_over_pi[] = {
-#else
-static int32_t two_over_pi[] = {
-#endif
-0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62,
-0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A,
-0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129,
-0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41,
-0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8,
-0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF,
-0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5,
-0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08,
-0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3,
-0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880,
-0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B,
-};
-
-#ifdef __STDC__
-static const int32_t npio2_hw[] = {
-#else
-static int32_t npio2_hw[] = {
-#endif
-0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C,
-0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C,
-0x40346B9C, 0x4035FDBB, 0x40378FDB, 0x403921FB, 0x403AB41B, 0x403C463A,
-0x403DD85A, 0x403F6A7A, 0x40407E4C, 0x4041475C, 0x4042106C, 0x4042D97C,
-0x4043A28C, 0x40446B9C, 0x404534AC, 0x4045FDBB, 0x4046C6CB, 0x40478FDB,
-0x404858EB, 0x404921FB,
-};
-
-/*
- * invpio2: 53 bits of 2/pi
- * pio2_1: first 33 bit of pi/2
- * pio2_1t: pi/2 - pio2_1
- * pio2_2: second 33 bit of pi/2
- * pio2_2t: pi/2 - (pio2_1+pio2_2)
- * pio2_3: third 33 bit of pi/2
- * pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3)
- */
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-zero = 0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
-half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
-two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
-invpio2 = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */
-pio2_1 = 1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */
-pio2_1t = 6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */
-pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */
-pio2_2t = 2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */
-pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */
-pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
-
-#ifdef __STDC__
- int32_t __ieee754_rem_pio2(double x, double *y)
-#else
- int32_t __ieee754_rem_pio2(x,y)
- double x,y[];
-#endif
-{
- double z = 0., w, t, r, fn;
- double tx[3];
- int32_t i,j,n,ix,hx;
- int e0,nx;
- uint32_t low;
-
- GET_HIGH_WORD(hx,x); /* high word of x */
- ix = hx&0x7fffffff;
- if(ix<=0x3fe921fb) /* |x| ~<= pi/4 , no need for reduction */
- {y[0] = x; y[1] = 0; return 0;}
- if(ix<0x4002d97c) { /* |x| < 3pi/4, special case with n=+-1 */
- if(hx>0) {
- z = x - pio2_1;
- if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */
- y[0] = z - pio2_1t;
- y[1] = (z-y[0])-pio2_1t;
- } else { /* near pi/2, use 33+33+53 bit pi */
- z -= pio2_2;
- y[0] = z - pio2_2t;
- y[1] = (z-y[0])-pio2_2t;
- }
- return 1;
- } else { /* negative x */
- z = x + pio2_1;
- if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */
- y[0] = z + pio2_1t;
- y[1] = (z-y[0])+pio2_1t;
- } else { /* near pi/2, use 33+33+53 bit pi */
- z += pio2_2;
- y[0] = z + pio2_2t;
- y[1] = (z-y[0])+pio2_2t;
- }
- return -1;
- }
- }
- if(ix<=0x413921fb) { /* |x| ~<= 2^19*(pi/2), medium size */
- t = fabs(x);
- n = (int32_t) (t*invpio2+half);
- fn = (double)n;
- r = t-fn*pio2_1;
- w = fn*pio2_1t; /* 1st round good to 85 bit */
- if(n<32&&ix!=npio2_hw[n-1]) {
- y[0] = r-w; /* quick check no cancellation */
- } else {
- uint32_t high;
- j = ix>>20;
- y[0] = r-w;
- GET_HIGH_WORD(high,y[0]);
- i = j-((high>>20)&0x7ff);
- if(i>16) { /* 2nd iteration needed, good to 118 */
- t = r;
- w = fn*pio2_2;
- r = t-w;
- w = fn*pio2_2t-((t-r)-w);
- y[0] = r-w;
- GET_HIGH_WORD(high,y[0]);
- i = j-((high>>20)&0x7ff);
- if(i>49) { /* 3rd iteration need, 151 bits acc */
- t = r; /* will cover all possible cases */
- w = fn*pio2_3;
- r = t-w;
- w = fn*pio2_3t-((t-r)-w);
- y[0] = r-w;
- }
- }
- }
- y[1] = (r-y[0])-w;
- if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;}
- else return n;
- }
- /*
- * all other (large) arguments
- */
- if(ix>=0x7ff00000) { /* x is inf or NaN */
- y[0]=y[1]=x-x; return 0;
- }
- /* set z = scalbn(|x|,ilogb(x)-23) */
- GET_LOW_WORD(low,x);
- SET_LOW_WORD(z,low);
- e0 = (int)((ix>>20)-1046); /* e0 = ilogb(z)-23; */
- SET_HIGH_WORD(z, ix - ((int32_t)e0<<20));
- for(i=0;i<2;i++) {
- tx[i] = (double)((int32_t)(z));
- z = (z-tx[i])*two24;
- }
- tx[2] = z;
- nx = 3;
- while(tx[nx-1]==zero) nx--; /* skip zero term */
- n = __kernel_rem_pio2(tx,y,e0,nx,2,two_over_pi);
- if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;}
- return n;
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/e_remainder.c b/libjava/java/lang/e_remainder.c
deleted file mode 100644
index 4716d8d05fd..00000000000
--- a/libjava/java/lang/e_remainder.c
+++ /dev/null
@@ -1,80 +0,0 @@
-
-/* @(#)e_remainder.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* __ieee754_remainder(x,p)
- * Return :
- * returns x REM p = x - [x/p]*p as if in infinite
- * precise arithmetic, where [x/p] is the (infinite bit)
- * integer nearest x/p (in half way case choose the even one).
- * Method :
- * Based on fmod() return x-[x/p]chopped*p exactlp.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double zero = 0.0;
-#else
-static double zero = 0.0;
-#endif
-
-
-#ifdef __STDC__
- double __ieee754_remainder(double x, double p)
-#else
- double __ieee754_remainder(x,p)
- double x,p;
-#endif
-{
- int32_t hx,hp;
- uint32_t sx,lx,lp;
- double p_half;
-
- EXTRACT_WORDS(hx,lx,x);
- EXTRACT_WORDS(hp,lp,p);
- sx = hx&0x80000000;
- hp &= 0x7fffffff;
- hx &= 0x7fffffff;
-
- /* purge off exception values */
- if((hp|lp)==0) return (x*p)/(x*p); /* p = 0 */
- if((hx>=0x7ff00000)|| /* x not finite */
- ((hp>=0x7ff00000)&& /* p is NaN */
- (((hp-0x7ff00000)|lp)!=0)))
- return (x*p)/(x*p);
-
-
- if (hp<=0x7fdfffff) x = __ieee754_fmod(x,p+p); /* now x < 2p */
- if (((hx-hp)|(lx-lp))==0) return zero*x;
- x = fabs(x);
- p = fabs(p);
- if (hp<0x00200000) {
- if(x+x>p) {
- x-=p;
- if(x+x>=p) x -= p;
- }
- } else {
- p_half = 0.5*p;
- if(x>p_half) {
- x-=p;
- if(x>=p_half) x -= p;
- }
- }
- GET_HIGH_WORD(hx,x);
- SET_HIGH_WORD(x,hx^sx);
- return x;
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/e_scalb.c b/libjava/java/lang/e_scalb.c
deleted file mode 100644
index 0bb924b43ee..00000000000
--- a/libjava/java/lang/e_scalb.c
+++ /dev/null
@@ -1,55 +0,0 @@
-
-/* @(#)e_scalb.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
- * __ieee754_scalb(x, fn) is provide for
- * passing various standard test suite. One
- * should use scalbn() instead.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef _SCALB_INT
-#ifdef __STDC__
- double __ieee754_scalb(double x, int fn)
-#else
- double __ieee754_scalb(x,fn)
- double x; int fn;
-#endif
-#else
-#ifdef __STDC__
- double __ieee754_scalb(double x, double fn)
-#else
- double __ieee754_scalb(x,fn)
- double x, fn;
-#endif
-#endif
-{
-#ifdef _SCALB_INT
- return scalbn(x,fn);
-#else
- if (isnan(x)||isnan(fn)) return x*fn;
- if (!finite(fn)) {
- if(fn>0.0) return x*fn;
- else return x/(-fn);
- }
- if (rint(fn)!=fn) return (fn-fn)/(fn-fn);
- if ( fn > 65000.0) return scalbn(x, 65000);
- if (-fn > 65000.0) return scalbn(x,-65000);
- return scalbn(x,(int)fn);
-#endif
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/e_sqrt.c b/libjava/java/lang/e_sqrt.c
deleted file mode 100644
index 1d566a0847e..00000000000
--- a/libjava/java/lang/e_sqrt.c
+++ /dev/null
@@ -1,452 +0,0 @@
-
-/* @(#)e_sqrt.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* __ieee754_sqrt(x)
- * Return correctly rounded sqrt.
- * ------------------------------------------
- * | Use the hardware sqrt if you have one |
- * ------------------------------------------
- * Method:
- * Bit by bit method using integer arithmetic. (Slow, but portable)
- * 1. Normalization
- * Scale x to y in [1,4) with even powers of 2:
- * find an integer k such that 1 <= (y=x*2^(2k)) < 4, then
- * sqrt(x) = 2^k * sqrt(y)
- * 2. Bit by bit computation
- * Let q = sqrt(y) truncated to i bit after binary point (q = 1),
- * i 0
- * i+1 2
- * s = 2*q , and y = 2 * ( y - q ). (1)
- * i i i i
- *
- * To compute q from q , one checks whether
- * i+1 i
- *
- * -(i+1) 2
- * (q + 2 ) <= y. (2)
- * i
- * -(i+1)
- * If (2) is false, then q = q ; otherwise q = q + 2 .
- * i+1 i i+1 i
- *
- * With some algebric manipulation, it is not difficult to see
- * that (2) is equivalent to
- * -(i+1)
- * s + 2 <= y (3)
- * i i
- *
- * The advantage of (3) is that s and y can be computed by
- * i i
- * the following recurrence formula:
- * if (3) is false
- *
- * s = s , y = y ; (4)
- * i+1 i i+1 i
- *
- * otherwise,
- * -i -(i+1)
- * s = s + 2 , y = y - s - 2 (5)
- * i+1 i i+1 i i
- *
- * One may easily use induction to prove (4) and (5).
- * Note. Since the left hand side of (3) contain only i+2 bits,
- * it does not necessary to do a full (53-bit) comparison
- * in (3).
- * 3. Final rounding
- * After generating the 53 bits result, we compute one more bit.
- * Together with the remainder, we can decide whether the
- * result is exact, bigger than 1/2ulp, or less than 1/2ulp
- * (it will never equal to 1/2ulp).
- * The rounding mode can be detected by checking whether
- * huge + tiny is equal to huge, and whether huge - tiny is
- * equal to huge for some floating point number "huge" and "tiny".
- *
- * Special cases:
- * sqrt(+-0) = +-0 ... exact
- * sqrt(inf) = inf
- * sqrt(-ve) = NaN ... with invalid signal
- * sqrt(NaN) = NaN ... with invalid signal for signaling NaN
- *
- * Other methods : see the appended file at the end of the program below.
- *---------------
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double one = 1.0, tiny=1.0e-300;
-#else
-static double one = 1.0, tiny=1.0e-300;
-#endif
-
-#ifdef __STDC__
- double __ieee754_sqrt(double x)
-#else
- double __ieee754_sqrt(x)
- double x;
-#endif
-{
- double z;
- int32_t sign = (int)0x80000000;
- uint32_t r,t1,s1,ix1,q1;
- int32_t ix0,s0,q,m,t,i;
-
- EXTRACT_WORDS(ix0,ix1,x);
-
- /* take care of Inf and NaN */
- if((ix0&0x7ff00000)==0x7ff00000) {
- return x*x+x; /* sqrt(NaN)=NaN, sqrt(+inf)=+inf
- sqrt(-inf)=sNaN */
- }
- /* take care of zero */
- if(ix0<=0) {
- if(((ix0&(~sign))|ix1)==0) return x;/* sqrt(+-0) = +-0 */
- else if(ix0<0)
- return (x-x)/(x-x); /* sqrt(-ve) = sNaN */
- }
- /* normalize x */
- m = (ix0>>20);
- if(m==0) { /* subnormal x */
- while(ix0==0) {
- m -= 21;
- ix0 |= (ix1>>11); ix1 <<= 21;
- }
- for(i=0;(ix0&0x00100000)==0;i++) ix0<<=1;
- m -= i-1;
- ix0 |= (ix1>>(32-i));
- ix1 <<= i;
- }
- m -= 1023; /* unbias exponent */
- ix0 = (ix0&0x000fffff)|0x00100000;
- if(m&1){ /* odd m, double x to make it even */
- ix0 += ix0 + ((ix1&sign)>>31);
- ix1 += ix1;
- }
- m >>= 1; /* m = [m/2] */
-
- /* generate sqrt(x) bit by bit */
- ix0 += ix0 + ((ix1&sign)>>31);
- ix1 += ix1;
- q = q1 = s0 = s1 = 0; /* [q,q1] = sqrt(x) */
- r = 0x00200000; /* r = moving bit from right to left */
-
- while(r!=0) {
- t = s0+r;
- if(t<=ix0) {
- s0 = t+r;
- ix0 -= t;
- q += r;
- }
- ix0 += ix0 + ((ix1&sign)>>31);
- ix1 += ix1;
- r>>=1;
- }
-
- r = sign;
- while(r!=0) {
- t1 = s1+r;
- t = s0;
- if((t<ix0)||((t==ix0)&&(t1<=ix1))) {
- s1 = t1+r;
- if(((t1&sign)==(uint32_t)sign)&&(s1&sign)==0) s0 += 1;
- ix0 -= t;
- if (ix1 < t1) ix0 -= 1;
- ix1 -= t1;
- q1 += r;
- }
- ix0 += ix0 + ((ix1&sign)>>31);
- ix1 += ix1;
- r>>=1;
- }
-
- /* use floating add to find out rounding direction */
- if((ix0|ix1)!=0) {
- z = one-tiny; /* trigger inexact flag */
- if (z>=one) {
- z = one+tiny;
- if (q1==(uint32_t)0xffffffff) { q1=0; q += 1;}
- else if (z>one) {
- if (q1==(uint32_t)0xfffffffe) q+=1;
- q1+=2;
- } else
- q1 += (q1&1);
- }
- }
- ix0 = (q>>1)+0x3fe00000;
- ix1 = q1>>1;
- if ((q&1)==1) ix1 |= sign;
- ix0 += (m <<20);
- INSERT_WORDS(z,ix0,ix1);
- return z;
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
-
-/*
-Other methods (use floating-point arithmetic)
--------------
-(This is a copy of a drafted paper by Prof W. Kahan
-and K.C. Ng, written in May, 1986)
-
- Two algorithms are given here to implement sqrt(x)
- (IEEE double precision arithmetic) in software.
- Both supply sqrt(x) correctly rounded. The first algorithm (in
- Section A) uses newton iterations and involves four divisions.
- The second one uses reciproot iterations to avoid division, but
- requires more multiplications. Both algorithms need the ability
- to chop results of arithmetic operations instead of round them,
- and the INEXACT flag to indicate when an arithmetic operation
- is executed exactly with no roundoff error, all part of the
- standard (IEEE 754-1985). The ability to perform shift, add,
- subtract and logical AND operations upon 32-bit words is needed
- too, though not part of the standard.
-
-A. sqrt(x) by Newton Iteration
-
- (1) Initial approximation
-
- Let x0 and x1 be the leading and the trailing 32-bit words of
- a floating point number x (in IEEE double format) respectively
-
- 1 11 52 ...widths
- ------------------------------------------------------
- x: |s| e | f |
- ------------------------------------------------------
- msb lsb msb lsb ...order
-
-
- ------------------------ ------------------------
- x0: |s| e | f1 | x1: | f2 |
- ------------------------ ------------------------
-
- By performing shifts and subtracts on x0 and x1 (both regarded
- as integers), we obtain an 8-bit approximation of sqrt(x) as
- follows.
-
- k := (x0>>1) + 0x1ff80000;
- y0 := k - T1[31&(k>>15)]. ... y ~ sqrt(x) to 8 bits
- Here k is a 32-bit integer and T1[] is an integer array containing
- correction terms. Now magically the floating value of y (y's
- leading 32-bit word is y0, the value of its trailing word is 0)
- approximates sqrt(x) to almost 8-bit.
-
- Value of T1:
- static int T1[32]= {
- 0, 1024, 3062, 5746, 9193, 13348, 18162, 23592,
- 29598, 36145, 43202, 50740, 58733, 67158, 75992, 85215,
- 83599, 71378, 60428, 50647, 41945, 34246, 27478, 21581,
- 16499, 12183, 8588, 5674, 3403, 1742, 661, 130,};
-
- (2) Iterative refinement
-
- Apply Heron's rule three times to y, we have y approximates
- sqrt(x) to within 1 ulp (Unit in the Last Place):
-
- y := (y+x/y)/2 ... almost 17 sig. bits
- y := (y+x/y)/2 ... almost 35 sig. bits
- y := y-(y-x/y)/2 ... within 1 ulp
-
-
- Remark 1.
- Another way to improve y to within 1 ulp is:
-
- y := (y+x/y) ... almost 17 sig. bits to 2*sqrt(x)
- y := y - 0x00100006 ... almost 18 sig. bits to sqrt(x)
-
- 2
- (x-y )*y
- y := y + 2* ---------- ...within 1 ulp
- 2
- 3y + x
-
-
- This formula has one division fewer than the one above; however,
- it requires more multiplications and additions. Also x must be
- scaled in advance to avoid spurious overflow in evaluating the
- expression 3y*y+x. Hence it is not recommended uless division
- is slow. If division is very slow, then one should use the
- reciproot algorithm given in section B.
-
- (3) Final adjustment
-
- By twiddling y's last bit it is possible to force y to be
- correctly rounded according to the prevailing rounding mode
- as follows. Let r and i be copies of the rounding mode and
- inexact flag before entering the square root program. Also we
- use the expression y+-ulp for the next representable floating
- numbers (up and down) of y. Note that y+-ulp = either fixed
- point y+-1, or multiply y by nextafter(1,+-inf) in chopped
- mode.
-
- I := FALSE; ... reset INEXACT flag I
- R := RZ; ... set rounding mode to round-toward-zero
- z := x/y; ... chopped quotient, possibly inexact
- If(not I) then { ... if the quotient is exact
- if(z=y) {
- I := i; ... restore inexact flag
- R := r; ... restore rounded mode
- return sqrt(x):=y.
- } else {
- z := z - ulp; ... special rounding
- }
- }
- i := TRUE; ... sqrt(x) is inexact
- If (r=RN) then z=z+ulp ... rounded-to-nearest
- If (r=RP) then { ... round-toward-+inf
- y = y+ulp; z=z+ulp;
- }
- y := y+z; ... chopped sum
- y0:=y0-0x00100000; ... y := y/2 is correctly rounded.
- I := i; ... restore inexact flag
- R := r; ... restore rounded mode
- return sqrt(x):=y.
-
- (4) Special cases
-
- Square root of +inf, +-0, or NaN is itself;
- Square root of a negative number is NaN with invalid signal.
-
-
-B. sqrt(x) by Reciproot Iteration
-
- (1) Initial approximation
-
- Let x0 and x1 be the leading and the trailing 32-bit words of
- a floating point number x (in IEEE double format) respectively
- (see section A). By performing shifs and subtracts on x0 and y0,
- we obtain a 7.8-bit approximation of 1/sqrt(x) as follows.
-
- k := 0x5fe80000 - (x0>>1);
- y0:= k - T2[63&(k>>14)]. ... y ~ 1/sqrt(x) to 7.8 bits
-
- Here k is a 32-bit integer and T2[] is an integer array
- containing correction terms. Now magically the floating
- value of y (y's leading 32-bit word is y0, the value of
- its trailing word y1 is set to zero) approximates 1/sqrt(x)
- to almost 7.8-bit.
-
- Value of T2:
- static int T2[64]= {
- 0x1500, 0x2ef8, 0x4d67, 0x6b02, 0x87be, 0xa395, 0xbe7a, 0xd866,
- 0xf14a, 0x1091b,0x11fcd,0x13552,0x14999,0x15c98,0x16e34,0x17e5f,
- 0x18d03,0x19a01,0x1a545,0x1ae8a,0x1b5c4,0x1bb01,0x1bfde,0x1c28d,
- 0x1c2de,0x1c0db,0x1ba73,0x1b11c,0x1a4b5,0x1953d,0x18266,0x16be0,
- 0x1683e,0x179d8,0x18a4d,0x19992,0x1a789,0x1b445,0x1bf61,0x1c989,
- 0x1d16d,0x1d77b,0x1dddf,0x1e2ad,0x1e5bf,0x1e6e8,0x1e654,0x1e3cd,
- 0x1df2a,0x1d635,0x1cb16,0x1be2c,0x1ae4e,0x19bde,0x1868e,0x16e2e,
- 0x1527f,0x1334a,0x11051,0xe951, 0xbe01, 0x8e0d, 0x5924, 0x1edd,};
-
- (2) Iterative refinement
-
- Apply Reciproot iteration three times to y and multiply the
- result by x to get an approximation z that matches sqrt(x)
- to about 1 ulp. To be exact, we will have
- -1ulp < sqrt(x)-z<1.0625ulp.
-
- ... set rounding mode to Round-to-nearest
- y := y*(1.5-0.5*x*y*y) ... almost 15 sig. bits to 1/sqrt(x)
- y := y*((1.5-2^-30)+0.5*x*y*y)... about 29 sig. bits to 1/sqrt(x)
- ... special arrangement for better accuracy
- z := x*y ... 29 bits to sqrt(x), with z*y<1
- z := z + 0.5*z*(1-z*y) ... about 1 ulp to sqrt(x)
-
- Remark 2. The constant 1.5-2^-30 is chosen to bias the error so that
- (a) the term z*y in the final iteration is always less than 1;
- (b) the error in the final result is biased upward so that
- -1 ulp < sqrt(x) - z < 1.0625 ulp
- instead of |sqrt(x)-z|<1.03125ulp.
-
- (3) Final adjustment
-
- By twiddling y's last bit it is possible to force y to be
- correctly rounded according to the prevailing rounding mode
- as follows. Let r and i be copies of the rounding mode and
- inexact flag before entering the square root program. Also we
- use the expression y+-ulp for the next representable floating
- numbers (up and down) of y. Note that y+-ulp = either fixed
- point y+-1, or multiply y by nextafter(1,+-inf) in chopped
- mode.
-
- R := RZ; ... set rounding mode to round-toward-zero
- switch(r) {
- case RN: ... round-to-nearest
- if(x<= z*(z-ulp)...chopped) z = z - ulp; else
- if(x<= z*(z+ulp)...chopped) z = z; else z = z+ulp;
- break;
- case RZ:case RM: ... round-to-zero or round-to--inf
- R:=RP; ... reset rounding mod to round-to-+inf
- if(x<z*z ... rounded up) z = z - ulp; else
- if(x>=(z+ulp)*(z+ulp) ...rounded up) z = z+ulp;
- break;
- case RP: ... round-to-+inf
- if(x>(z+ulp)*(z+ulp)...chopped) z = z+2*ulp; else
- if(x>z*z ...chopped) z = z+ulp;
- break;
- }
-
- Remark 3. The above comparisons can be done in fixed point. For
- example, to compare x and w=z*z chopped, it suffices to compare
- x1 and w1 (the trailing parts of x and w), regarding them as
- two's complement integers.
-
- ...Is z an exact square root?
- To determine whether z is an exact square root of x, let z1 be the
- trailing part of z, and also let x0 and x1 be the leading and
- trailing parts of x.
-
- If ((z1&0x03ffffff)!=0) ... not exact if trailing 26 bits of z!=0
- I := 1; ... Raise Inexact flag: z is not exact
- else {
- j := 1 - [(x0>>20)&1] ... j = logb(x) mod 2
- k := z1 >> 26; ... get z's 25-th and 26-th
- fraction bits
- I := i or (k&j) or ((k&(j+j+1))!=(x1&3));
- }
- R:= r ... restore rounded mode
- return sqrt(x):=z.
-
- If multiplication is cheaper then the foregoing red tape, the
- Inexact flag can be evaluated by
-
- I := i;
- I := (z*z!=x) or I.
-
- Note that z*z can overwrite I; this value must be sensed if it is
- True.
-
- Remark 4. If z*z = x exactly, then bit 25 to bit 0 of z1 must be
- zero.
-
- --------------------
- z1: | f2 |
- --------------------
- bit 31 bit 0
-
- Further more, bit 27 and 26 of z1, bit 0 and 1 of x1, and the odd
- or even of logb(x) have the following relations:
-
- -------------------------------------------------
- bit 27,26 of z1 bit 1,0 of x1 logb(x)
- -------------------------------------------------
- 00 00 odd and even
- 01 01 even
- 10 10 odd
- 10 00 even
- 11 01 even
- -------------------------------------------------
-
- (4) Special cases (see (4) of Section A).
-
- */
diff --git a/libjava/java/lang/fdlibm.h b/libjava/java/lang/fdlibm.h
deleted file mode 100644
index fbfbb660bfd..00000000000
--- a/libjava/java/lang/fdlibm.h
+++ /dev/null
@@ -1,350 +0,0 @@
-
-/* @(#)fdlibm.h 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993, 2000 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* AIX needs _XOPEN_SOURCE */
-#ifdef _AIX
-#define _XOPEN_SOURCE
-#endif
-
-#include <config.h>
-#include <stdlib.h>
-
-/* GCJ LOCAL: Include files. */
-#include "ieeefp.h"
-
-#include "mprec.h"
-
-/* CYGNUS LOCAL: Default to XOPEN_MODE. */
-#define _XOPEN_MODE
-
-#ifdef __P
-#undef __P
-#endif
-
-#ifdef __STDC__
-#define __P(p) p
-#else
-#define __P(p) ()
-#endif
-
-#ifndef HUGE
-#define HUGE ((float)3.40282346638528860e+38)
-#endif
-
-/*
- * set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
- * (one may replace the following line by "#include <values.h>")
- */
-
-#define X_TLOSS 1.41484755040568800000e+16
-
-/* These typedefs are true for the targets running Java. */
-
-#define _IEEE_LIBM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * ANSI/POSIX
- */
-extern double acos __P((double));
-extern double asin __P((double));
-extern double atan __P((double));
-extern double atan2 __P((double, double));
-extern double cos __P((double));
-extern double sin __P((double));
-extern double tan __P((double));
-
-extern double cosh __P((double));
-extern double sinh __P((double));
-extern double tanh __P((double));
-
-extern double exp __P((double));
-extern double frexp __P((double, int *));
-extern double ldexp __P((double, int));
-extern double log __P((double));
-extern double log10 __P((double));
-extern double modf __P((double, double *));
-
-extern double pow __P((double, double));
-extern double sqrt __P((double));
-
-extern double ceil __P((double));
-extern double fabs __P((double));
-extern double floor __P((double));
-extern double fmod __P((double, double));
-
-extern double erf __P((double));
-extern double erfc __P((double));
-extern double gamma __P((double));
-extern double hypot __P((double, double));
-extern int isnan __P((double));
-extern int finite __P((double));
-extern double j0 __P((double));
-extern double j1 __P((double));
-extern double jn __P((int, double));
-extern double lgamma __P((double));
-extern double y0 __P((double));
-extern double y1 __P((double));
-extern double yn __P((int, double));
-
-extern double acosh __P((double));
-extern double asinh __P((double));
-extern double atanh __P((double));
-extern double cbrt __P((double));
-extern double logb __P((double));
-extern double nextafter __P((double, double));
-extern double remainder __P((double, double));
-
-/* Functions that are not documented, and are not in <math.h>. */
-
-extern double logb __P((double));
-#ifdef _SCALB_INT
-extern double scalb __P((double, int));
-#else
-extern double scalb __P((double, double));
-#endif
-extern double significand __P((double));
-
-/* ieee style elementary functions */
-extern double __ieee754_sqrt __P((double));
-extern double __ieee754_acos __P((double));
-extern double __ieee754_acosh __P((double));
-extern double __ieee754_log __P((double));
-extern double __ieee754_atanh __P((double));
-extern double __ieee754_asin __P((double));
-extern double __ieee754_atan2 __P((double,double));
-extern double __ieee754_exp __P((double));
-extern double __ieee754_cosh __P((double));
-extern double __ieee754_fmod __P((double,double));
-extern double __ieee754_pow __P((double,double));
-extern double __ieee754_lgamma_r __P((double,int *));
-extern double __ieee754_gamma_r __P((double,int *));
-extern double __ieee754_log10 __P((double));
-extern double __ieee754_sinh __P((double));
-extern double __ieee754_hypot __P((double,double));
-extern double __ieee754_j0 __P((double));
-extern double __ieee754_j1 __P((double));
-extern double __ieee754_y0 __P((double));
-extern double __ieee754_y1 __P((double));
-extern double __ieee754_jn __P((int,double));
-extern double __ieee754_yn __P((int,double));
-extern double __ieee754_remainder __P((double,double));
-extern int32_t __ieee754_rem_pio2 __P((double,double*));
-#ifdef _SCALB_INT
-extern double __ieee754_scalb __P((double,int));
-#else
-extern double __ieee754_scalb __P((double,double));
-#endif
-
-/* fdlibm kernel function */
-extern double __kernel_standard __P((double,double,int));
-extern double __kernel_sin __P((double,double,int));
-extern double __kernel_cos __P((double,double));
-extern double __kernel_tan __P((double,double,int));
-extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int32_t*));
-
-/* Undocumented float functions. */
-extern float logbf __P((float));
-#ifdef _SCALB_INT
-extern float scalbf __P((float, int));
-#else
-extern float scalbf __P((float, float));
-#endif
-extern float significandf __P((float));
-
-/*
- * Functions callable from C, intended to support IEEE arithmetic.
- */
-extern double copysign __P((double, double));
-extern int ilogb __P((double));
-extern double rint __P((double));
-extern float rintf __P((float));
-extern double scalbn __P((double, int));
-
-/* ieee style elementary float functions */
-extern float __ieee754_sqrtf __P((float));
-extern float __ieee754_acosf __P((float));
-extern float __ieee754_acoshf __P((float));
-extern float __ieee754_logf __P((float));
-extern float __ieee754_atanhf __P((float));
-extern float __ieee754_asinf __P((float));
-extern float __ieee754_atan2f __P((float,float));
-extern float __ieee754_expf __P((float));
-extern float __ieee754_coshf __P((float));
-extern float __ieee754_fmodf __P((float,float));
-extern float __ieee754_powf __P((float,float));
-extern float __ieee754_lgammaf_r __P((float,int *));
-extern float __ieee754_gammaf_r __P((float,int *));
-extern float __ieee754_log10f __P((float));
-extern float __ieee754_sinhf __P((float));
-extern float __ieee754_hypotf __P((float,float));
-extern float __ieee754_j0f __P((float));
-extern float __ieee754_j1f __P((float));
-extern float __ieee754_y0f __P((float));
-extern float __ieee754_y1f __P((float));
-extern float __ieee754_jnf __P((int,float));
-extern float __ieee754_ynf __P((int,float));
-extern float __ieee754_remainderf __P((float,float));
-extern int32_t __ieee754_rem_pio2f __P((float,float*));
-#ifdef _SCALB_INT
-extern float __ieee754_scalbf __P((float,int));
-#else
-extern float __ieee754_scalbf __P((float,float));
-#endif
-
-/* float versions of fdlibm kernel functions */
-extern float __kernel_sinf __P((float,float,int));
-extern float __kernel_cosf __P((float,float));
-extern float __kernel_tanf __P((float,float,int));
-extern int __kernel_rem_pio2f __P((float*,float*,int,int,int,const int32_t*));
-
-/* The original code used statements like
- n0 = ((*(int*)&one)>>29)^1; * index of high word *
- ix0 = *(n0+(int*)&x); * high word of x *
- ix1 = *((1-n0)+(int*)&x); * low word of x *
- to dig two 32 bit words out of the 64 bit IEEE floating point
- value. That is non-ANSI, and, moreover, the gcc instruction
- scheduler gets it wrong. We instead use the following macros.
- Unlike the original code, we determine the endianness at compile
- time, not at run time; I don't see much benefit to selecting
- endianness at run time. */
-
-#ifndef __IEEE_BIG_ENDIAN
-#ifndef __IEEE_LITTLE_ENDIAN
- #error Must define endianness
-#endif
-#endif
-
-/* A union which permits us to convert between a double and two 32 bit
- ints. */
-
-#ifdef __IEEE_BIG_ENDIAN
-
-typedef union
-{
- double value;
- struct
- {
- uint32_t msw;
- uint32_t lsw;
- } parts;
-} ieee_double_shape_type;
-
-#endif
-
-#ifdef __IEEE_LITTLE_ENDIAN
-
-typedef union
-{
- double value;
- struct
- {
- uint32_t lsw;
- uint32_t msw;
- } parts;
-} ieee_double_shape_type;
-
-#endif
-
-/* Get two 32 bit ints from a double. */
-
-#define EXTRACT_WORDS(ix0,ix1,d) \
-do { \
- ieee_double_shape_type ew_u; \
- ew_u.value = (d); \
- (ix0) = ew_u.parts.msw; \
- (ix1) = ew_u.parts.lsw; \
-} while (0)
-
-/* Get the more significant 32 bit int from a double. */
-
-#define GET_HIGH_WORD(i,d) \
-do { \
- ieee_double_shape_type gh_u; \
- gh_u.value = (d); \
- (i) = gh_u.parts.msw; \
-} while (0)
-
-/* Get the less significant 32 bit int from a double. */
-
-#define GET_LOW_WORD(i,d) \
-do { \
- ieee_double_shape_type gl_u; \
- gl_u.value = (d); \
- (i) = gl_u.parts.lsw; \
-} while (0)
-
-/* Set a double from two 32 bit ints. */
-
-#define INSERT_WORDS(d,ix0,ix1) \
-do { \
- ieee_double_shape_type iw_u; \
- iw_u.parts.msw = (ix0); \
- iw_u.parts.lsw = (ix1); \
- (d) = iw_u.value; \
-} while (0)
-
-/* Set the more significant 32 bits of a double from an int. */
-
-#define SET_HIGH_WORD(d,v) \
-do { \
- ieee_double_shape_type sh_u; \
- sh_u.value = (d); \
- sh_u.parts.msw = (v); \
- (d) = sh_u.value; \
-} while (0)
-
-/* Set the less significant 32 bits of a double from an int. */
-
-#define SET_LOW_WORD(d,v) \
-do { \
- ieee_double_shape_type sl_u; \
- sl_u.value = (d); \
- sl_u.parts.lsw = (v); \
- (d) = sl_u.value; \
-} while (0)
-
-/* A union which permits us to convert between a float and a 32 bit
- int. */
-
-typedef union
-{
- float value;
- uint32_t word;
-} ieee_float_shape_type;
-
-/* Get a 32 bit int from a float. */
-
-#define GET_FLOAT_WORD(i,d) \
-do { \
- ieee_float_shape_type gf_u; \
- gf_u.value = (d); \
- (i) = gf_u.word; \
-} while (0)
-
-/* Set a float from a 32 bit int. */
-
-#define SET_FLOAT_WORD(d,i) \
-do { \
- ieee_float_shape_type sf_u; \
- sf_u.word = (i); \
- (d) = sf_u.value; \
-} while (0)
-
-#ifdef __cplusplus
-}
-#endif
-
diff --git a/libjava/java/lang/ieeefp.h b/libjava/java/lang/ieeefp.h
deleted file mode 100644
index 3638d546eab..00000000000
--- a/libjava/java/lang/ieeefp.h
+++ /dev/null
@@ -1,163 +0,0 @@
-#ifndef __IEEE_BIG_ENDIAN
-#ifndef __IEEE_LITTLE_ENDIAN
-
-#ifdef __alpha__
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#if defined(__arm__) || defined(__thumb__)
-/* ARM traditionally used big-endian words; and within those words the
- byte ordering was big or little endian depending upon the target.
- Modern floating-point formats are naturally ordered; in this case
- __VFP_FP__ will be defined, even if soft-float. */
-#ifdef __VFP_FP__
-#ifdef __ARMEL__
-#define __IEEE_LITTLE_ENDIAN
-#else
-#define __IEEE_BIG_ENDIAN
-#endif
-#else
-#define __IEEE_BIG_ENDIAN
-#ifdef __ARMEL__
-#define __IEEE_BYTES_LITTLE_ENDIAN
-#endif
-#endif
-#endif
-
-#ifdef __hppa__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#if defined (__sparc) || defined (__sparc__)
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __m32r__
-#ifdef __LITTLE_ENDIAN__
-#define __IEEE_LITTLE_ENDIAN
-#else
-#define __IEEE_BIG_ENDIAN
-#endif
-#endif
-
-#if defined(__m68k__) || defined(__mc68000__)
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#if defined (__H8300__) || defined (__H8300H__)
-#define __IEEE_BIG_ENDIAN
-#define __SMALL_BITFIELDS
-#define _DOUBLE_IS_32BITS
-#endif
-
-#ifdef __H8500__
-#define __IEEE_BIG_ENDIAN
-#define __SMALL_BITFIELDS
-#define _DOUBLE_IS_32BITS
-#endif
-
-#ifdef __sh__
-#ifdef __LITTLE_ENDIAN__
-#define __IEEE_LITTLE_ENDIAN
-#else
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __SH3E__
-#define _DOUBLE_IS_32BITS
-#endif
-#endif
-
-#ifdef _AM29K
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __i386__
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#ifdef __x86_64__
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#ifdef __i960__
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#ifdef __MIPSEL__
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#ifdef __MIPSEB__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __pj__
-#ifdef __pjl__
-#define __IEEE_LITTLE_ENDIAN
-#else
-#define __IEEE_BIG_ENDIAN
-#endif
-#endif
-
-/* necv70 was __IEEE_LITTLE_ENDIAN. */
-
-#ifdef __W65__
-#define __IEEE_LITTLE_ENDIAN
-#define __SMALL_BITFIELDS
-#define _DOUBLE_IS_32BITS
-#endif
-
-#if defined(__Z8001__) || defined(__Z8002__)
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __m88k__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __v800
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#if defined (__PPC__) || defined (__ppc__) || defined (__ppc64__)
-#if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) \
- || defined (__APPLE__)
-#define __IEEE_BIG_ENDIAN
-#else
-#if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(__WIN32__) && __WIN32__)
-#define __IEEE_LITTLE_ENDIAN
-#endif
-#endif
-#endif
-
-#ifdef __fr30__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __mcore__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-
-#ifdef __ia64__
-#ifdef __BIG_ENDIAN__
-#define __IEEE_BIG_ENDIAN
-#else
-#define __IEEE_LITTLE_ENDIAN
-#endif
-#endif
-
-#ifdef __s390__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifndef __IEEE_BIG_ENDIAN
-#ifndef __IEEE_LITTLE_ENDIAN
-#error Endianess not declared!!
-#endif /* not __IEEE_LITTLE_ENDIAN */
-#endif /* not __IEEE_BIG_ENDIAN */
-
-#endif /* not __IEEE_LITTLE_ENDIAN */
-#endif /* not __IEEE_BIG_ENDIAN */
-
diff --git a/libjava/java/lang/k_cos.c b/libjava/java/lang/k_cos.c
deleted file mode 100644
index acf50a82e83..00000000000
--- a/libjava/java/lang/k_cos.c
+++ /dev/null
@@ -1,96 +0,0 @@
-
-/* @(#)k_cos.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
- * __kernel_cos( x, y )
- * kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164
- * Input x is assumed to be bounded by ~pi/4 in magnitude.
- * Input y is the tail of x.
- *
- * Algorithm
- * 1. Since cos(-x) = cos(x), we need only to consider positive x.
- * 2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0.
- * 3. cos(x) is approximated by a polynomial of degree 14 on
- * [0,pi/4]
- * 4 14
- * cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x
- * where the remez error is
- *
- * | 2 4 6 8 10 12 14 | -58
- * |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x +C6*x )| <= 2
- * | |
- *
- * 4 6 8 10 12 14
- * 4. let r = C1*x +C2*x +C3*x +C4*x +C5*x +C6*x , then
- * cos(x) = 1 - x*x/2 + r
- * since cos(x+y) ~ cos(x) - sin(x)*y
- * ~ cos(x) - x*y,
- * a correction term is necessary in cos(x) and hence
- * cos(x+y) = 1 - (x*x/2 - (r - x*y))
- * For better accuracy when x > 0.3, let qx = |x|/4 with
- * the last 32 bits mask off, and if x > 0.78125, let qx = 0.28125.
- * Then
- * cos(x+y) = (1-qx) - ((x*x/2-qx) - (r-x*y)).
- * Note that 1-qx and (x*x/2-qx) is EXACT here, and the
- * magnitude of the latter is at least a quarter of x*x/2,
- * thus, reducing the rounding error in the subtraction.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
-C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */
-C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */
-C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */
-C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */
-C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */
-C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */
-
-#ifdef __STDC__
- double __kernel_cos(double x, double y)
-#else
- double __kernel_cos(x, y)
- double x,y;
-#endif
-{
- double a,hz,z,r,qx;
- int32_t ix;
- GET_HIGH_WORD(ix,x);
- ix &= 0x7fffffff; /* ix = |x|'s high word*/
- if(ix<0x3e400000) { /* if x < 2**27 */
- if(((int)x)==0) return one; /* generate inexact */
- }
- z = x*x;
- r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6)))));
- if(ix < 0x3FD33333) /* if |x| < 0.3 */
- return one - (0.5*z - (z*r - x*y));
- else {
- if(ix > 0x3fe90000) { /* x > 0.78125 */
- qx = 0.28125;
- } else {
- INSERT_WORDS(qx,ix-0x00200000,0); /* x/4 */
- }
- hz = 0.5*z-qx;
- a = one-qx;
- return a - (hz - (z*r-x*y));
- }
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/k_rem_pio2.c b/libjava/java/lang/k_rem_pio2.c
deleted file mode 100644
index 2f4ca17256c..00000000000
--- a/libjava/java/lang/k_rem_pio2.c
+++ /dev/null
@@ -1,320 +0,0 @@
-
-/* @(#)k_rem_pio2.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
- * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2)
- * double x[],y[]; int e0,nx,prec; int ipio2[];
- *
- * __kernel_rem_pio2 return the last three digits of N with
- * y = x - N*pi/2
- * so that |y| < pi/2.
- *
- * The method is to compute the integer (mod 8) and fraction parts of
- * (2/pi)*x without doing the full multiplication. In general we
- * skip the part of the product that are known to be a huge integer (
- * more accurately, = 0 mod 8 ). Thus the number of operations are
- * independent of the exponent of the input.
- *
- * (2/pi) is represented by an array of 24-bit integers in ipio2[].
- *
- * Input parameters:
- * x[] The input value (must be positive) is broken into nx
- * pieces of 24-bit integers in double precision format.
- * x[i] will be the i-th 24 bit of x. The scaled exponent
- * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0
- * match x's up to 24 bits.
- *
- * Example of breaking a double positive z into x[0]+x[1]+x[2]:
- * e0 = ilogb(z)-23
- * z = scalbn(z,-e0)
- * for i = 0,1,2
- * x[i] = floor(z)
- * z = (z-x[i])*2**24
- *
- *
- * y[] ouput result in an array of double precision numbers.
- * The dimension of y[] is:
- * 24-bit precision 1
- * 53-bit precision 2
- * 64-bit precision 2
- * 113-bit precision 3
- * The actual value is the sum of them. Thus for 113-bit
- * precison, one may have to do something like:
- *
- * long double t,w,r_head, r_tail;
- * t = (long double)y[2] + (long double)y[1];
- * w = (long double)y[0];
- * r_head = t+w;
- * r_tail = w - (r_head - t);
- *
- * e0 The exponent of x[0]
- *
- * nx dimension of x[]
- *
- * prec an integer indicating the precision:
- * 0 24 bits (single)
- * 1 53 bits (double)
- * 2 64 bits (extended)
- * 3 113 bits (quad)
- *
- * ipio2[]
- * integer array, contains the (24*i)-th to (24*i+23)-th
- * bit of 2/pi after binary point. The corresponding
- * floating value is
- *
- * ipio2[i] * 2^(-24(i+1)).
- *
- * External function:
- * double scalbn(), floor();
- *
- *
- * Here is the description of some local variables:
- *
- * jk jk+1 is the initial number of terms of ipio2[] needed
- * in the computation. The recommended value is 2,3,4,
- * 6 for single, double, extended,and quad.
- *
- * jz local integer variable indicating the number of
- * terms of ipio2[] used.
- *
- * jx nx - 1
- *
- * jv index for pointing to the suitable ipio2[] for the
- * computation. In general, we want
- * ( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8
- * is an integer. Thus
- * e0-3-24*jv >= 0 or (e0-3)/24 >= jv
- * Hence jv = max(0,(e0-3)/24).
- *
- * jp jp+1 is the number of terms in PIo2[] needed, jp = jk.
- *
- * q[] double array with integral value, representing the
- * 24-bits chunk of the product of x and 2/pi.
- *
- * q0 the corresponding exponent of q[0]. Note that the
- * exponent for q[i] would be q0-24*i.
- *
- * PIo2[] double precision array, obtained by cutting pi/2
- * into 24 bits chunks.
- *
- * f[] ipio2[] in floating point
- *
- * iq[] integer array by breaking up q[] in 24-bits chunk.
- *
- * fq[] final product of x*(2/pi) in fq[0],..,fq[jk]
- *
- * ih integer. If >0 it indicates q[] is >= 0.5, hence
- * it also indicates the *sign* of the result.
- *
- */
-
-
-/*
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const int init_jk[] = {2,3,4,6}; /* initial value for jk */
-#else
-static int init_jk[] = {2,3,4,6};
-#endif
-
-#ifdef __STDC__
-static const double PIo2[] = {
-#else
-static double PIo2[] = {
-#endif
- 1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */
- 7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */
- 5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */
- 3.28200341580791294123e-22, /* 0x3B78CC51, 0x60000000 */
- 1.27065575308067607349e-29, /* 0x39F01B83, 0x80000000 */
- 1.22933308981111328932e-36, /* 0x387A2520, 0x40000000 */
- 2.73370053816464559624e-44, /* 0x36E38222, 0x80000000 */
- 2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */
-};
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-zero = 0.0,
-one = 1.0,
-two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
-twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */
-
-#ifdef __STDC__
- int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int32_t *ipio2)
-#else
- int __kernel_rem_pio2(x,y,e0,nx,prec,ipio2)
- double x[], y[]; int e0,nx,prec; int32_t ipio2[];
-#endif
-{
- int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih;
- double z,fw,f[20],fq[20],q[20];
-
- /* initialize jk*/
- jk = init_jk[prec];
- jp = jk;
-
- /* determine jx,jv,q0, note that 3>q0 */
- jx = nx-1;
- jv = (e0-3)/24; if(jv<0) jv=0;
- q0 = e0-24*(jv+1);
-
- /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */
- j = jv-jx; m = jx+jk;
- for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (double) ipio2[j];
-
- /* compute q[0],q[1],...q[jk] */
- for (i=0;i<=jk;i++) {
- for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
- }
-
- jz = jk;
-recompute:
- /* distill q[] into iq[] reversingly */
- for(i=0,j=jz,z=q[jz];j>0;i++,j--) {
- fw = (double)((int32_t)(twon24* z));
- iq[i] = (int32_t)(z-two24*fw);
- z = q[j-1]+fw;
- }
-
- /* compute n */
- z = scalbn(z,(int)q0); /* actual value of z */
- z -= 8.0*floor(z*0.125); /* trim off integer >= 8 */
- n = (int32_t) z;
- z -= (double)n;
- ih = 0;
- if(q0>0) { /* need iq[jz-1] to determine n */
- i = (iq[jz-1]>>(24-q0)); n += i;
- iq[jz-1] -= i<<(24-q0);
- ih = iq[jz-1]>>(23-q0);
- }
- else if(q0==0) ih = iq[jz-1]>>23;
- else if(z>=0.5) ih=2;
-
- if(ih>0) { /* q > 0.5 */
- n += 1; carry = 0;
- for(i=0;i<jz ;i++) { /* compute 1-q */
- j = iq[i];
- if(carry==0) {
- if(j!=0) {
- carry = 1; iq[i] = 0x1000000- j;
- }
- } else iq[i] = 0xffffff - j;
- }
- if(q0>0) { /* rare case: chance is 1 in 12 */
- switch(q0) {
- case 1:
- iq[jz-1] &= 0x7fffff; break;
- case 2:
- iq[jz-1] &= 0x3fffff; break;
- }
- }
- if(ih==2) {
- z = one - z;
- if(carry!=0) z -= scalbn(one,(int)q0);
- }
- }
-
- /* check if recomputation is needed */
- if(z==zero) {
- j = 0;
- for (i=jz-1;i>=jk;i--) j |= iq[i];
- if(j==0) { /* need recomputation */
- for(k=1;iq[jk-k]==0;k++); /* k = no. of terms needed */
-
- for(i=jz+1;i<=jz+k;i++) { /* add q[jz+1] to q[jz+k] */
- f[jx+i] = (double) ipio2[jv+i];
- for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
- q[i] = fw;
- }
- jz += k;
- goto recompute;
- }
- }
-
- /* chop off zero terms */
- if(z==0.0) {
- jz -= 1; q0 -= 24;
- while(iq[jz]==0) { jz--; q0-=24;}
- } else { /* break z into 24-bit if necessary */
- z = scalbn(z,-(int)q0);
- if(z>=two24) {
- fw = (double)((int32_t)(twon24*z));
- iq[jz] = (int32_t)(z-two24*fw);
- jz += 1; q0 += 24;
- iq[jz] = (int32_t) fw;
- } else iq[jz] = (int32_t) z ;
- }
-
- /* convert integer "bit" chunk to floating-point value */
- fw = scalbn(one,(int)q0);
- for(i=jz;i>=0;i--) {
- q[i] = fw*(double)iq[i]; fw*=twon24;
- }
-
- /* compute PIo2[0,...,jp]*q[jz,...,0] */
- for(i=jz;i>=0;i--) {
- for(fw=0.0,k=0;k<=jp&&k<=jz-i;k++) fw += PIo2[k]*q[i+k];
- fq[jz-i] = fw;
- }
-
- /* compress fq[] into y[] */
- switch(prec) {
- case 0:
- fw = 0.0;
- for (i=jz;i>=0;i--) fw += fq[i];
- y[0] = (ih==0)? fw: -fw;
- break;
- case 1:
- case 2:
- fw = 0.0;
- for (i=jz;i>=0;i--) fw += fq[i];
- y[0] = (ih==0)? fw: -fw;
- fw = fq[0]-fw;
- for (i=1;i<=jz;i++) fw += fq[i];
- y[1] = (ih==0)? fw: -fw;
- break;
- case 3: /* painful */
- for (i=jz;i>0;i--) {
- fw = fq[i-1]+fq[i];
- fq[i] += fq[i-1]-fw;
- fq[i-1] = fw;
- }
- for (i=jz;i>1;i--) {
- fw = fq[i-1]+fq[i];
- fq[i] += fq[i-1]-fw;
- fq[i-1] = fw;
- }
- for (fw=0.0,i=jz;i>=2;i--) fw += fq[i];
- if(ih==0) {
- y[0] = fq[0]; y[1] = fq[1]; y[2] = fw;
- } else {
- y[0] = -fq[0]; y[1] = -fq[1]; y[2] = -fw;
- }
- }
- return n&7;
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/k_sin.c b/libjava/java/lang/k_sin.c
deleted file mode 100644
index b4ad387c589..00000000000
--- a/libjava/java/lang/k_sin.c
+++ /dev/null
@@ -1,79 +0,0 @@
-
-/* @(#)k_sin.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* __kernel_sin( x, y, iy)
- * kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854
- * Input x is assumed to be bounded by ~pi/4 in magnitude.
- * Input y is the tail of x.
- * Input iy indicates whether y is 0. (if iy=0, y assume to be 0).
- *
- * Algorithm
- * 1. Since sin(-x) = -sin(x), we need only to consider positive x.
- * 2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0.
- * 3. sin(x) is approximated by a polynomial of degree 13 on
- * [0,pi/4]
- * 3 13
- * sin(x) ~ x + S1*x + ... + S6*x
- * where
- *
- * |sin(x) 2 4 6 8 10 12 | -58
- * |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x +S6*x )| <= 2
- * | x |
- *
- * 4. sin(x+y) = sin(x) + sin'(x')*y
- * ~ sin(x) + (1-x*x/2)*y
- * For better accuracy, let
- * 3 2 2 2 2
- * r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6))))
- * then 3 2
- * sin(x) = x + (S1*x + (x *(r-y/2)+y))
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
-S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */
-S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */
-S3 = -1.98412698298579493134e-04, /* 0xBF2A01A0, 0x19C161D5 */
-S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */
-S5 = -2.50507602534068634195e-08, /* 0xBE5AE5E6, 0x8A2B9CEB */
-S6 = 1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */
-
-#ifdef __STDC__
- double __kernel_sin(double x, double y, int iy)
-#else
- double __kernel_sin(x, y, iy)
- double x,y; int iy; /* iy=0 if y is zero */
-#endif
-{
- double z,r,v;
- int32_t ix;
- GET_HIGH_WORD(ix,x);
- ix &= 0x7fffffff; /* high word of x */
- if(ix<0x3e400000) /* |x| < 2**-27 */
- {if((int)x==0) return x;} /* generate inexact */
- z = x*x;
- v = z*x;
- r = S2+z*(S3+z*(S4+z*(S5+z*S6)));
- if(iy==0) return x+v*(S1+z*r);
- else return x-((z*(half*y-v*r)-y)-v*S1);
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/k_tan.c b/libjava/java/lang/k_tan.c
deleted file mode 100644
index a1067a70a0d..00000000000
--- a/libjava/java/lang/k_tan.c
+++ /dev/null
@@ -1,132 +0,0 @@
-
-/* @(#)k_tan.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* __kernel_tan( x, y, k )
- * kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854
- * Input x is assumed to be bounded by ~pi/4 in magnitude.
- * Input y is the tail of x.
- * Input k indicates whether tan (if k=1) or
- * -1/tan (if k= -1) is returned.
- *
- * Algorithm
- * 1. Since tan(-x) = -tan(x), we need only to consider positive x.
- * 2. if x < 2^-28 (hx<0x3e300000 0), return x with inexact if x!=0.
- * 3. tan(x) is approximated by a odd polynomial of degree 27 on
- * [0,0.67434]
- * 3 27
- * tan(x) ~ x + T1*x + ... + T13*x
- * where
- *
- * |tan(x) 2 4 26 | -59.2
- * |----- - (1+T1*x +T2*x +.... +T13*x )| <= 2
- * | x |
- *
- * Note: tan(x+y) = tan(x) + tan'(x)*y
- * ~ tan(x) + (1+x*x)*y
- * Therefore, for better accuracy in computing tan(x+y), let
- * 3 2 2 2 2
- * r = x *(T2+x *(T3+x *(...+x *(T12+x *T13))))
- * then
- * 3 2
- * tan(x+y) = x + (T1*x + (x *(r+y)+y))
- *
- * 4. For x in [0.67434,pi/4], let y = pi/4 - x, then
- * tan(x) = tan(pi/4-y) = (1-tan(y))/(1+tan(y))
- * = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y)))
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
-pio4 = 7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */
-pio4lo= 3.06161699786838301793e-17, /* 0x3C81A626, 0x33145C07 */
-T[] = {
- 3.33333333333334091986e-01, /* 0x3FD55555, 0x55555563 */
- 1.33333333333201242699e-01, /* 0x3FC11111, 0x1110FE7A */
- 5.39682539762260521377e-02, /* 0x3FABA1BA, 0x1BB341FE */
- 2.18694882948595424599e-02, /* 0x3F9664F4, 0x8406D637 */
- 8.86323982359930005737e-03, /* 0x3F8226E3, 0xE96E8493 */
- 3.59207910759131235356e-03, /* 0x3F6D6D22, 0xC9560328 */
- 1.45620945432529025516e-03, /* 0x3F57DBC8, 0xFEE08315 */
- 5.88041240820264096874e-04, /* 0x3F4344D8, 0xF2F26501 */
- 2.46463134818469906812e-04, /* 0x3F3026F7, 0x1A8D1068 */
- 7.81794442939557092300e-05, /* 0x3F147E88, 0xA03792A6 */
- 7.14072491382608190305e-05, /* 0x3F12B80F, 0x32F0A7E9 */
- -1.85586374855275456654e-05, /* 0xBEF375CB, 0xDB605373 */
- 2.59073051863633712884e-05, /* 0x3EFB2A70, 0x74BF7AD4 */
-};
-
-#ifdef __STDC__
- double __kernel_tan(double x, double y, int iy)
-#else
- double __kernel_tan(x, y, iy)
- double x,y; int iy;
-#endif
-{
- double z,r,v,w,s;
- int32_t ix,hx;
- GET_HIGH_WORD(hx,x);
- ix = hx&0x7fffffff; /* high word of |x| */
- if(ix<0x3e300000) /* x < 2**-28 */
- {if((int)x==0) { /* generate inexact */
- uint32_t low;
- GET_LOW_WORD(low,x);
- if(((ix|low)|(iy+1))==0) return one/fabs(x);
- else return (iy==1)? x: -one/x;
- }
- }
- if(ix>=0x3FE59428) { /* |x|>=0.6744 */
- if(hx<0) {x = -x; y = -y;}
- z = pio4-x;
- w = pio4lo-y;
- x = z+w; y = 0.0;
- }
- z = x*x;
- w = z*z;
- /* Break x^5*(T[1]+x^2*T[2]+...) into
- * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) +
- * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12]))
- */
- r = T[1]+w*(T[3]+w*(T[5]+w*(T[7]+w*(T[9]+w*T[11]))));
- v = z*(T[2]+w*(T[4]+w*(T[6]+w*(T[8]+w*(T[10]+w*T[12])))));
- s = z*x;
- r = y + z*(s*(r+v)+y);
- r += T[0]*s;
- w = x+r;
- if(ix>=0x3FE59428) {
- v = (double)iy;
- return (double)(1-((hx>>30)&2))*(v-2.0*(x-(w*w/(w+v)-r)));
- }
- if(iy==1) return w;
- else { /* if allow error up to 2 ulp,
- simply return -1.0/(x+r) here */
- /* compute -1.0/(x+r) accurately */
- double a,t;
- z = w;
- SET_LOW_WORD(z,0);
- v = r-(z - x); /* z+v = r+x */
- t = a = -1.0/w; /* a = -1.0/w */
- SET_LOW_WORD(t,0);
- s = 1.0+t*z;
- return t+a*(s+t*v);
- }
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/mprec.c b/libjava/java/lang/mprec.c
deleted file mode 100644
index 00679ed3918..00000000000
--- a/libjava/java/lang/mprec.c
+++ /dev/null
@@ -1,958 +0,0 @@
-/****************************************************************
- *
- * The author of this software is David M. Gay.
- *
- * Copyright (c) 1991 by AT&T.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- *
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
- * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- ***************************************************************/
-
-/* Please send bug reports to
- David M. Gay
- AT&T Bell Laboratories, Room 2C-463
- 600 Mountain Avenue
- Murray Hill, NJ 07974-2070
- U.S.A.
- dmg@research.att.com or research!dmg
- */
-
-/* strtod for IEEE-, VAX-, and IBM-arithmetic machines.
- *
- * This strtod returns a nearest machine number to the input decimal
- * string (or sets errno to ERANGE). With IEEE arithmetic, ties are
- * broken by the IEEE round-even rule. Otherwise ties are broken by
- * biased rounding (add half and chop).
- *
- * Inspired loosely by William D. Clinger's paper "How to Read Floating
- * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101].
- *
- * Modifications:
- *
- * 1. We only require IEEE, IBM, or VAX double-precision
- * arithmetic (not IEEE double-extended).
- * 2. We get by with floating-point arithmetic in a case that
- * Clinger missed -- when we're computing d * 10^n
- * for a small integer d and the integer n is not too
- * much larger than 22 (the maximum integer k for which
- * we can represent 10^k exactly), we may be able to
- * compute (d*10^k) * 10^(e-k) with just one roundoff.
- * 3. Rather than a bit-at-a-time adjustment of the binary
- * result in the hard case, we use floating-point
- * arithmetic to determine the adjustment to within
- * one bit; only in really hard cases do we need to
- * compute a second residual.
- * 4. Because of 3., we don't need a large table of powers of 10
- * for ten-to-e (just some small tables, e.g. of 10^k
- * for 0 <= k <= 22).
- */
-
-/*
- * #define IEEE_8087 for IEEE-arithmetic machines where the least
- * significant byte has the lowest address.
- * #define IEEE_MC68k for IEEE-arithmetic machines where the most
- * significant byte has the lowest address.
- * #define Sudden_Underflow for IEEE-format machines without gradual
- * underflow (i.e., that flush to zero on underflow).
- * #define IBM for IBM mainframe-style floating-point arithmetic.
- * #define VAX for VAX-style floating-point arithmetic.
- * #define Unsigned_Shifts if >> does treats its left operand as unsigned.
- * #define No_leftright to omit left-right logic in fast floating-point
- * computation of dtoa.
- * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3.
- * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines
- * that use extended-precision instructions to compute rounded
- * products and quotients) with IBM.
- * #define ROUND_BIASED for IEEE-format with biased rounding.
- * #define Inaccurate_Divide for IEEE-format with correctly rounded
- * products but inaccurate quotients, e.g., for Intel i860.
- * #define Just_16 to store 16 bits per 32-bit long when doing high-precision
- * integer arithmetic. Whether this speeds things up or slows things
- * down depends on the machine and the number being converted.
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <java-assert.h>
-#include "mprec.h"
-
-/* reent.c knows this value */
-#define _Kmax 15
-#include <stdio.h>
-
-_Jv_Bigint *
-_DEFUN (Balloc, (ptr, k), struct _Jv_reent *ptr _AND int k)
-{
- _Jv_Bigint *rv = NULL;
-
- int i = 0;
- int j = 1;
-
- JvAssert ((1 << k) < MAX_BIGNUM_WDS);
-
- while ((ptr->_allocation_map & j) && i < MAX_BIGNUMS)
- i++, j <<= 1;
-
- JvAssert (i < MAX_BIGNUMS);
-
- if (i >= MAX_BIGNUMS)
- return NULL;
-
- ptr->_allocation_map |= j;
- rv = &ptr->_freelist[i];
-
- rv->_k = k;
- rv->_maxwds = 32;
-
- return rv;
-}
-
-
-void
-_DEFUN (Bfree, (ptr, v), struct _Jv_reent *ptr _AND _Jv_Bigint * v)
-{
- long i;
-
- i = v - ptr->_freelist;
-
- JvAssert (i >= 0 && i < MAX_BIGNUMS);
-
- if (i >= 0 && i < MAX_BIGNUMS)
- ptr->_allocation_map &= ~ (1 << i);
-}
-
-
-_Jv_Bigint *
-_DEFUN (multadd, (ptr, b, m, a),
- struct _Jv_reent *ptr _AND
- _Jv_Bigint * b _AND
- int m _AND
- int a)
-{
- int i, wds;
- unsigned long *x, y;
-#ifdef Pack_32
- unsigned long xi, z;
-#endif
- _Jv_Bigint *b1;
-
- wds = b->_wds;
- x = b->_x;
- i = 0;
- do
- {
-#ifdef Pack_32
- xi = *x;
- y = (xi & 0xffff) * m + a;
- z = (xi >> 16) * m + (y >> 16);
- a = (int) (z >> 16);
- *x++ = (z << 16) + (y & 0xffff);
-#else
- y = *x * m + a;
- a = (int) (y >> 16);
- *x++ = y & 0xffff;
-#endif
- }
- while (++i < wds);
- if (a)
- {
- if (wds >= b->_maxwds)
- {
- b1 = Balloc (ptr, b->_k + 1);
- Bcopy (b1, b);
- Bfree (ptr, b);
- b = b1;
- }
- b->_x[wds++] = a;
- b->_wds = wds;
- }
- return b;
-}
-
-_Jv_Bigint *
-_DEFUN (s2b, (ptr, s, nd0, nd, y9),
- struct _Jv_reent * ptr _AND
- _CONST char *s _AND
- int nd0 _AND
- int nd _AND
- unsigned long y9)
-{
- _Jv_Bigint *b;
- int i, k;
- long x, y;
-
- x = (nd + 8) / 9;
- for (k = 0, y = 1; x > y; y <<= 1, k++);
-#ifdef Pack_32
- b = Balloc (ptr, k);
- b->_x[0] = y9;
- b->_wds = 1;
-#else
- b = Balloc (ptr, k + 1);
- b->_x[0] = y9 & 0xffff;
- b->_wds = (b->_x[1] = y9 >> 16) ? 2 : 1;
-#endif
-
- i = 9;
- if (9 < nd0)
- {
- s += 9;
- do
- b = multadd (ptr, b, 10, *s++ - '0');
- while (++i < nd0);
- s++;
- }
- else
- s += 10;
- for (; i < nd; i++)
- b = multadd (ptr, b, 10, *s++ - '0');
- return b;
-}
-
-int
-_DEFUN (hi0bits,
- (x), register unsigned long x)
-{
- register int k = 0;
-
- if (!(x & 0xffff0000))
- {
- k = 16;
- x <<= 16;
- }
- if (!(x & 0xff000000))
- {
- k += 8;
- x <<= 8;
- }
- if (!(x & 0xf0000000))
- {
- k += 4;
- x <<= 4;
- }
- if (!(x & 0xc0000000))
- {
- k += 2;
- x <<= 2;
- }
- if (!(x & 0x80000000))
- {
- k++;
- if (!(x & 0x40000000))
- return 32;
- }
- return k;
-}
-
-int
-_DEFUN (lo0bits, (y), unsigned long *y)
-{
- register int k;
- register unsigned long x = *y;
-
- if (x & 7)
- {
- if (x & 1)
- return 0;
- if (x & 2)
- {
- *y = x >> 1;
- return 1;
- }
- *y = x >> 2;
- return 2;
- }
- k = 0;
- if (!(x & 0xffff))
- {
- k = 16;
- x >>= 16;
- }
- if (!(x & 0xff))
- {
- k += 8;
- x >>= 8;
- }
- if (!(x & 0xf))
- {
- k += 4;
- x >>= 4;
- }
- if (!(x & 0x3))
- {
- k += 2;
- x >>= 2;
- }
- if (!(x & 1))
- {
- k++;
- x >>= 1;
- if (!(x & 1))
- return 32;
- }
- *y = x;
- return k;
-}
-
-_Jv_Bigint *
-_DEFUN (i2b, (ptr, i), struct _Jv_reent * ptr _AND int i)
-{
- _Jv_Bigint *b;
-
- b = Balloc (ptr, 1);
- b->_x[0] = i;
- b->_wds = 1;
- return b;
-}
-
-_Jv_Bigint *
-_DEFUN (mult, (ptr, a, b), struct _Jv_reent * ptr _AND _Jv_Bigint * a _AND _Jv_Bigint * b)
-{
- _Jv_Bigint *c;
- int k, wa, wb, wc;
- unsigned long carry, y, z;
- unsigned long *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
-#ifdef Pack_32
- unsigned long z2;
-#endif
-
- if (a->_wds < b->_wds)
- {
- c = a;
- a = b;
- b = c;
- }
- k = a->_k;
- wa = a->_wds;
- wb = b->_wds;
- wc = wa + wb;
- if (wc > a->_maxwds)
- k++;
- c = Balloc (ptr, k);
- for (x = c->_x, xa = x + wc; x < xa; x++)
- *x = 0;
- xa = a->_x;
- xae = xa + wa;
- xb = b->_x;
- xbe = xb + wb;
- xc0 = c->_x;
-#ifdef Pack_32
- for (; xb < xbe; xb++, xc0++)
- {
- if ((y = *xb & 0xffff))
- {
- x = xa;
- xc = xc0;
- carry = 0;
- do
- {
- z = (*x & 0xffff) * y + (*xc & 0xffff) + carry;
- carry = z >> 16;
- z2 = (*x++ >> 16) * y + (*xc >> 16) + carry;
- carry = z2 >> 16;
- Storeinc (xc, z2, z);
- }
- while (x < xae);
- *xc = carry;
- }
- if ((y = *xb >> 16))
- {
- x = xa;
- xc = xc0;
- carry = 0;
- z2 = *xc;
- do
- {
- z = (*x & 0xffff) * y + (*xc >> 16) + carry;
- carry = z >> 16;
- Storeinc (xc, z, z2);
- z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry;
- carry = z2 >> 16;
- }
- while (x < xae);
- *xc = z2;
- }
- }
-#else
- for (; xb < xbe; xc0++)
- {
- if ((y = *xb++))
- {
- x = xa;
- xc = xc0;
- carry = 0;
- do
- {
- z = *x++ * y + *xc + carry;
- carry = z >> 16;
- *xc++ = z & 0xffff;
- }
- while (x < xae);
- *xc = carry;
- }
- }
-#endif
- for (xc0 = c->_x, xc = xc0 + wc; wc > 0 && !*--xc; --wc);
- c->_wds = wc;
- return c;
-}
-
-_Jv_Bigint *
-_DEFUN (pow5mult,
- (ptr, b, k), struct _Jv_reent * ptr _AND _Jv_Bigint * b _AND int k)
-{
- _Jv_Bigint *b1, *p5, *p51;
- int i;
- static _CONST int p05[3] = {5, 25, 125};
-
- if ((i = k & 3))
- b = multadd (ptr, b, p05[i - 1], 0);
-
- if (!(k >>= 2))
- return b;
- if (!(p5 = ptr->_p5s))
- {
- /* first time */
- p5 = ptr->_p5s = i2b (ptr, 625);
- p5->_next = 0;
- }
- for (;;)
- {
- if (k & 1)
- {
- b1 = mult (ptr, b, p5);
- Bfree (ptr, b);
- b = b1;
- }
- if (!(k >>= 1))
- break;
- if (!(p51 = p5->_next))
- {
- p51 = p5->_next = mult (ptr, p5, p5);
- p51->_next = 0;
- }
- p5 = p51;
- }
- return b;
-}
-
-_Jv_Bigint *
-_DEFUN (lshift, (ptr, b, k), struct _Jv_reent * ptr _AND _Jv_Bigint * b _AND int k)
-{
- int i, k1, n, n1;
- _Jv_Bigint *b1;
- unsigned long *x, *x1, *xe, z;
-
-#ifdef Pack_32
- n = k >> 5;
-#else
- n = k >> 4;
-#endif
- k1 = b->_k;
- n1 = n + b->_wds + 1;
- for (i = b->_maxwds; n1 > i; i <<= 1)
- k1++;
- b1 = Balloc (ptr, k1);
- x1 = b1->_x;
- for (i = 0; i < n; i++)
- *x1++ = 0;
- x = b->_x;
- xe = x + b->_wds;
-#ifdef Pack_32
- if (k &= 0x1f)
- {
- k1 = 32 - k;
- z = 0;
- do
- {
- *x1++ = *x << k | z;
- z = *x++ >> k1;
- }
- while (x < xe);
- if ((*x1 = z))
- ++n1;
- }
-#else
- if (k &= 0xf)
- {
- k1 = 16 - k;
- z = 0;
- do
- {
- *x1++ = (*x << k & 0xffff) | z;
- z = *x++ >> k1;
- }
- while (x < xe);
- if ((*x1 = z))
- ++n1;
- }
-#endif
- else
- do
- *x1++ = *x++;
- while (x < xe);
- b1->_wds = n1 - 1;
- Bfree (ptr, b);
- return b1;
-}
-
-int
-_DEFUN (cmp, (a, b), _Jv_Bigint * a _AND _Jv_Bigint * b)
-{
- unsigned long *xa, *xa0, *xb, *xb0;
- int i, j;
-
- i = a->_wds;
- j = b->_wds;
-#ifdef DEBUG
- if (i > 1 && !a->_x[i - 1])
- Bug ("cmp called with a->_x[a->_wds-1] == 0");
- if (j > 1 && !b->_x[j - 1])
- Bug ("cmp called with b->_x[b->_wds-1] == 0");
-#endif
- if (i -= j)
- return i;
- xa0 = a->_x;
- xa = xa0 + j;
- xb0 = b->_x;
- xb = xb0 + j;
- for (;;)
- {
- if (*--xa != *--xb)
- return *xa < *xb ? -1 : 1;
- if (xa <= xa0)
- break;
- }
- return 0;
-}
-
-_Jv_Bigint *
-_DEFUN (diff, (ptr, a, b), struct _Jv_reent * ptr _AND
- _Jv_Bigint * a _AND _Jv_Bigint * b)
-{
- _Jv_Bigint *c;
- int i, wa, wb;
- long borrow, y; /* We need signed shifts here. */
- unsigned long *xa, *xae, *xb, *xbe, *xc;
-#ifdef Pack_32
- long z;
-#endif
-
- i = cmp (a, b);
- if (!i)
- {
- c = Balloc (ptr, 0);
- c->_wds = 1;
- c->_x[0] = 0;
- return c;
- }
- if (i < 0)
- {
- c = a;
- a = b;
- b = c;
- i = 1;
- }
- else
- i = 0;
- c = Balloc (ptr, a->_k);
- c->_sign = i;
- wa = a->_wds;
- xa = a->_x;
- xae = xa + wa;
- wb = b->_wds;
- xb = b->_x;
- xbe = xb + wb;
- xc = c->_x;
- borrow = 0;
-#ifdef Pack_32
- do
- {
- y = (*xa & 0xffff) - (*xb & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend (borrow, y);
- z = (*xa++ >> 16) - (*xb++ >> 16) + borrow;
- borrow = z >> 16;
- Sign_Extend (borrow, z);
- Storeinc (xc, z, y);
- }
- while (xb < xbe);
- while (xa < xae)
- {
- y = (*xa & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend (borrow, y);
- z = (*xa++ >> 16) + borrow;
- borrow = z >> 16;
- Sign_Extend (borrow, z);
- Storeinc (xc, z, y);
- }
-#else
- do
- {
- y = *xa++ - *xb++ + borrow;
- borrow = y >> 16;
- Sign_Extend (borrow, y);
- *xc++ = y & 0xffff;
- }
- while (xb < xbe);
- while (xa < xae)
- {
- y = *xa++ + borrow;
- borrow = y >> 16;
- Sign_Extend (borrow, y);
- *xc++ = y & 0xffff;
- }
-#endif
- while (!*--xc)
- wa--;
- c->_wds = wa;
- return c;
-}
-
-double
-_DEFUN (ulp, (_x), double _x)
-{
- union double_union x, a;
- register long L;
-
- x.d = _x;
-
- L = (word0 (x) & Exp_mask) - (P - 1) * Exp_msk1;
-#ifndef Sudden_Underflow
- if (L > 0)
- {
-#endif
-#ifdef IBM
- L |= Exp_msk1 >> 4;
-#endif
- word0 (a) = L;
-#ifndef _DOUBLE_IS_32BITS
- word1 (a) = 0;
-#endif
-
-#ifndef Sudden_Underflow
- }
- else
- {
- L = -L >> Exp_shift;
- if (L < Exp_shift)
- {
- word0 (a) = 0x80000 >> L;
-#ifndef _DOUBLE_IS_32BITS
- word1 (a) = 0;
-#endif
- }
- else
- {
- word0 (a) = 0;
- L -= Exp_shift;
-#ifndef _DOUBLE_IS_32BITS
- word1 (a) = L >= 31 ? 1 : 1 << (31 - L);
-#endif
- }
- }
-#endif
- return a.d;
-}
-
-double
-_DEFUN (b2d, (a, e),
- _Jv_Bigint * a _AND int *e)
-{
- unsigned long *xa, *xa0, w, y, z;
- int k;
- union double_union d;
-#ifdef VAX
- unsigned long d0, d1;
-#else
-#define d0 word0(d)
-#define d1 word1(d)
-#endif
-
- xa0 = a->_x;
- xa = xa0 + a->_wds;
- y = *--xa;
-#ifdef DEBUG
- if (!y)
- Bug ("zero y in b2d");
-#endif
- k = hi0bits (y);
- *e = 32 - k;
-#ifdef Pack_32
- if (k < Ebits)
- {
- d0 = Exp_1 | y >> (Ebits - k);
- w = xa > xa0 ? *--xa : 0;
-#ifndef _DOUBLE_IS_32BITS
- d1 = y << (32 - Ebits + k) | w >> (Ebits - k);
-#endif
- goto ret_d;
- }
- z = xa > xa0 ? *--xa : 0;
- if (k -= Ebits)
- {
- d0 = Exp_1 | y << k | z >> (32 - k);
- y = xa > xa0 ? *--xa : 0;
-#ifndef _DOUBLE_IS_32BITS
- d1 = z << k | y >> (32 - k);
-#endif
- }
- else
- {
- d0 = Exp_1 | y;
-#ifndef _DOUBLE_IS_32BITS
- d1 = z;
-#endif
- }
-#else
- if (k < Ebits + 16)
- {
- z = xa > xa0 ? *--xa : 0;
- d0 = Exp_1 | y << (k - Ebits) | z >> (Ebits + 16 - k);
- w = xa > xa0 ? *--xa : 0;
- y = xa > xa0 ? *--xa : 0;
- d1 = z << (k + 16 - Ebits) | w << (k - Ebits) | y >> (16 + Ebits - k);
- goto ret_d;
- }
- z = xa > xa0 ? *--xa : 0;
- w = xa > xa0 ? *--xa : 0;
- k -= Ebits + 16;
- d0 = Exp_1 | y << (k + 16) | z << k | w >> (16 - k);
- y = xa > xa0 ? *--xa : 0;
- d1 = w << (k + 16) | y << k;
-#endif
-ret_d:
-#ifdef VAX
- word0 (d) = d0 >> 16 | d0 << 16;
- word1 (d) = d1 >> 16 | d1 << 16;
-#else
-#undef d0
-#undef d1
-#endif
- return d.d;
-}
-
-_Jv_Bigint *
-_DEFUN (d2b,
- (ptr, _d, e, bits),
- struct _Jv_reent * ptr _AND
- double _d _AND
- int *e _AND
- int *bits)
-
-{
- union double_union d;
- _Jv_Bigint *b;
- int de, i, k;
- unsigned long *x, y, z;
-#ifdef VAX
- unsigned long d0, d1;
- d.d = _d;
- d0 = word0 (d) >> 16 | word0 (d) << 16;
- d1 = word1 (d) >> 16 | word1 (d) << 16;
-#else
-#define d0 word0(d)
-#define d1 word1(d)
- d.d = _d;
-#endif
-
-#ifdef Pack_32
- b = Balloc (ptr, 1);
-#else
- b = Balloc (ptr, 2);
-#endif
- x = b->_x;
-
- z = d0 & Frac_mask;
- d0 &= 0x7fffffff; /* clear sign bit, which we ignore */
-#ifdef Sudden_Underflow
- de = (int) (d0 >> Exp_shift);
-#ifndef IBM
- z |= Exp_msk11;
-#endif
-#else
- if ((de = (int) (d0 >> Exp_shift)))
- z |= Exp_msk1;
-#endif
-#ifdef Pack_32
-#ifndef _DOUBLE_IS_32BITS
- if ((y = d1))
- {
- if ((k = lo0bits (&y)))
- {
- x[0] = y | z << (32 - k);
- z >>= k;
- }
- else
- x[0] = y;
- i = b->_wds = (x[1] = z) ? 2 : 1;
- }
- else
-#endif
- {
-#ifdef DEBUG
- if (!z)
- Bug ("Zero passed to d2b");
-#endif
- k = lo0bits (&z);
- x[0] = z;
- i = b->_wds = 1;
-#ifndef _DOUBLE_IS_32BITS
- k += 32;
-#endif
- }
-#else
- if ((y = d1))
- {
- if ((k = lo0bits (&y)))
- if (k >= 16)
- {
- x[0] = y | (z << (32 - k) & 0xffff);
- x[1] = z >> (k - 16) & 0xffff;
- x[2] = z >> k;
- i = 2;
- }
- else
- {
- x[0] = y & 0xffff;
- x[1] = (y >> 16 | z << (16 - k)) & 0xffff;
- x[2] = z >> k & 0xffff;
- x[3] = z >> (k + 16);
- i = 3;
- }
- else
- {
- x[0] = y & 0xffff;
- x[1] = y >> 16;
- x[2] = z & 0xffff;
- x[3] = z >> 16;
- i = 3;
- }
- }
- else
- {
-#ifdef DEBUG
- if (!z)
- Bug ("Zero passed to d2b");
-#endif
- k = lo0bits (&z);
- if (k >= 16)
- {
- x[0] = z;
- i = 0;
- }
- else
- {
- x[0] = z & 0xffff;
- x[1] = z >> 16;
- i = 1;
- }
- k += 32;
- }
- while (!x[i])
- --i;
- b->_wds = i + 1;
-#endif
-#ifndef Sudden_Underflow
- if (de)
- {
-#endif
-#ifdef IBM
- *e = (de - Bias - (P - 1) << 2) + k;
- *bits = 4 * P + 8 - k - hi0bits (word0 (d) & Frac_mask);
-#else
- *e = de - Bias - (P - 1) + k;
- *bits = P - k;
-#endif
-#ifndef Sudden_Underflow
- }
- else
- {
- *e = de - Bias - (P - 1) + 1 + k;
-#ifdef Pack_32
- *bits = 32 * i - hi0bits (x[i - 1]);
-#else
- *bits = (i + 2) * 16 - hi0bits (x[i]);
-#endif
- }
-#endif
- return b;
-}
-#undef d0
-#undef d1
-
-double
-_DEFUN (ratio, (a, b), _Jv_Bigint * a _AND _Jv_Bigint * b)
-
-{
- union double_union da, db;
- int k, ka, kb;
-
- da.d = b2d (a, &ka);
- db.d = b2d (b, &kb);
-#ifdef Pack_32
- k = ka - kb + 32 * (a->_wds - b->_wds);
-#else
- k = ka - kb + 16 * (a->_wds - b->_wds);
-#endif
-#ifdef IBM
- if (k > 0)
- {
- word0 (da) += (k >> 2) * Exp_msk1;
- if (k &= 3)
- da.d *= 1 << k;
- }
- else
- {
- k = -k;
- word0 (db) += (k >> 2) * Exp_msk1;
- if (k &= 3)
- db.d *= 1 << k;
- }
-#else
- if (k > 0)
- word0 (da) += k * Exp_msk1;
- else
- {
- k = -k;
- word0 (db) += k * Exp_msk1;
- }
-#endif
- return da.d / db.d;
-}
-
-
-_CONST double
- tens[] =
-{
- 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
- 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
- 1e20, 1e21, 1e22, 1e23, 1e24
-
-};
-
-#if !defined(_DOUBLE_IS_32BITS) && !defined(__v800)
-_CONST double bigtens[] =
-{1e16, 1e32, 1e64, 1e128, 1e256};
-
-_CONST double tinytens[] =
-{1e-16, 1e-32, 1e-64, 1e-128, 1e-256};
-#else
-_CONST double bigtens[] =
-{1e16, 1e32};
-
-_CONST double tinytens[] =
-{1e-16, 1e-32};
-#endif
-
-
diff --git a/libjava/java/lang/mprec.h b/libjava/java/lang/mprec.h
deleted file mode 100644
index 26472a2278b..00000000000
--- a/libjava/java/lang/mprec.h
+++ /dev/null
@@ -1,397 +0,0 @@
-/****************************************************************
- *
- * The author of this software is David M. Gay.
- *
- * Copyright (c) 1991, 2000 by AT&T.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- *
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
- * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- ***************************************************************/
-
-/* Please send bug reports to
- David M. Gay
- AT&T Bell Laboratories, Room 2C-463
- 600 Mountain Avenue
- Murray Hill, NJ 07974-2070
- U.S.A.
- dmg@research.att.com or research!dmg
- */
-
-#include <config.h>
-#include "ieeefp.h"
-
-#if defined HAVE_STDINT_H
-#include <stdint.h>
-#elif defined HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#if defined HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#if defined HAVE_SYS_CONFIG_H
-#include <sys/config.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ISO C99 int type declarations */
-
-#if !defined HAVE_INT32_DEFINED && defined HAVE_BSD_INT32_DEFINED
-typedef u_int32_t uint32_t;
-#endif
-
-#if !defined HAVE_BSD_INT32_DEFINED && !defined HAVE_INT32_DEFINED
-/* FIXME this could have problems with systems that don't define SI to be 4 */
-typedef int int32_t __attribute__((mode(SI)));
-
-/* This is a blatant hack: on Solaris 2.5, pthread.h defines uint32_t
- in pthread.h, which we sometimes include. We protect our
- definition the same way Solaris 2.5 does, to avoid redefining it. */
-# ifndef _UINT32_T
-typedef unsigned int uint32_t __attribute__((mode(SI)));
-# endif
-#endif
-
- /* These typedefs are true for the targets running Java. */
-
-#ifdef __IEEE_LITTLE_ENDIAN
-#define IEEE_8087
-#endif
-
-#ifdef __IEEE_BIG_ENDIAN
-#define IEEE_MC68k
-#endif
-
-#ifdef __Z8000__
-#define Just_16
-#endif
-
-#ifdef DEBUG
-#include "stdio.h"
-#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
-#endif
-
-
-#ifdef Unsigned_Shifts
-#define Sign_Extend(a,b) if (b < 0) a |= (uint32_t)0xffff0000;
-#else
-#define Sign_Extend(a,b) /*no-op*/
-#endif
-
-#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1
-Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
-#endif
-
-/* If we are going to examine or modify specific bits in a double using
- the word0 and/or word1 macros, then we must wrap the double inside
- a union. This is necessary to avoid undefined behavior according to
- the ANSI C spec. */
-union double_union
-{
- double d;
- uint32_t i[2];
-};
-
-#ifdef IEEE_8087
-#define word0(x) (x.i[1])
-#define word1(x) (x.i[0])
-#else
-#define word0(x) (x.i[0])
-#define word1(x) (x.i[1])
-#endif
-
-/* The following definition of Storeinc is appropriate for MIPS processors.
- * An alternative that might be better on some machines is
- * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
- */
-#if defined(IEEE_8087) + defined(VAX)
-#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
-((unsigned short *)a)[0] = (unsigned short)c, a++)
-#else
-#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \
-((unsigned short *)a)[1] = (unsigned short)c, a++)
-#endif
-
-/* #define P DBL_MANT_DIG */
-/* Ten_pmax = floor(P*log(2)/log(5)) */
-/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */
-/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */
-/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */
-
-#if defined(IEEE_8087) + defined(IEEE_MC68k)
-#if defined (_DOUBLE_IS_32BITS)
-#define Exp_shift 23
-#define Exp_shift1 23
-#define Exp_msk1 ((uint32_t)0x00800000L)
-#define Exp_msk11 ((uint32_t)0x00800000L)
-#define Exp_mask ((uint32_t)0x7f800000L)
-#define P 24
-#define Bias 127
-#if 0
-#define IEEE_Arith /* it is, but the code doesn't handle IEEE singles yet */
-#endif
-#define Emin (-126)
-#define Exp_1 ((uint32_t)0x3f800000L)
-#define Exp_11 ((uint32_t)0x3f800000L)
-#define Ebits 8
-#define Frac_mask ((uint32_t)0x007fffffL)
-#define Frac_mask1 ((uint32_t)0x007fffffL)
-#define Ten_pmax 10
-#define Sign_bit ((uint32_t)0x80000000L)
-#define Ten_pmax 10
-#define Bletch 2
-#define Bndry_mask ((uint32_t)0x007fffffL)
-#define Bndry_mask1 ((uint32_t)0x007fffffL)
-#define LSB 1
-#define Sign_bit ((uint32_t)0x80000000L)
-#define Log2P 1
-#define Tiny0 0
-#define Tiny1 1
-#define Quick_max 5
-#define Int_max 6
-#define Infinite(x) (word0(x) == ((uint32_t)0x7f800000L))
-#undef word0
-#undef word1
-
-#define word0(x) (x.i[0])
-#define word1(x) 0
-#else
-
-#define Exp_shift 20
-#define Exp_shift1 20
-#define Exp_msk1 ((uint32_t)0x100000L)
-#define Exp_msk11 ((uint32_t)0x100000L)
-#define Exp_mask ((uint32_t)0x7ff00000L)
-#define P 53
-#define Bias 1023
-#define IEEE_Arith
-#define Emin (-1022)
-#define Exp_1 ((uint32_t)0x3ff00000L)
-#define Exp_11 ((uint32_t)0x3ff00000L)
-#define Ebits 11
-#define Frac_mask ((uint32_t)0xfffffL)
-#define Frac_mask1 ((uint32_t)0xfffffL)
-#define Ten_pmax 22
-#define Bletch 0x10
-#define Bndry_mask ((uint32_t)0xfffffL)
-#define Bndry_mask1 ((uint32_t)0xfffffL)
-#define LSB 1
-#define Sign_bit ((uint32_t)0x80000000L)
-#define Log2P 1
-#define Tiny0 0
-#define Tiny1 1
-#define Quick_max 14
-#define Int_max 14
-#define Infinite(x) (word0(x) == ((uint32_t)0x7ff00000L)) /* sufficient test for here */
-#endif
-
-#else
-#undef Sudden_Underflow
-#define Sudden_Underflow
-#ifdef IBM
-#define Exp_shift 24
-#define Exp_shift1 24
-#define Exp_msk1 ((uint32_t)0x1000000L)
-#define Exp_msk11 ((uint32_t)0x1000000L)
-#define Exp_mask ((uint32_t)0x7f000000L)
-#define P 14
-#define Bias 65
-#define Exp_1 ((uint32_t)0x41000000L)
-#define Exp_11 ((uint32_t)0x41000000L)
-#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */
-#define Frac_mask ((uint32_t)0xffffffL)
-#define Frac_mask1 ((uint32_t)0xffffffL)
-#define Bletch 4
-#define Ten_pmax 22
-#define Bndry_mask ((uint32_t)0xefffffL)
-#define Bndry_mask1 ((uint32_t)0xffffffL)
-#define LSB 1
-#define Sign_bit ((uint32_t)0x80000000L)
-#define Log2P 4
-#define Tiny0 ((uint32_t)0x100000L)
-#define Tiny1 0
-#define Quick_max 14
-#define Int_max 15
-#else /* VAX */
-#define Exp_shift 23
-#define Exp_shift1 7
-#define Exp_msk1 0x80
-#define Exp_msk11 ((uint32_t)0x800000L)
-#define Exp_mask ((uint32_t)0x7f80L)
-#define P 56
-#define Bias 129
-#define Exp_1 ((uint32_t)0x40800000L)
-#define Exp_11 ((uint32_t)0x4080L)
-#define Ebits 8
-#define Frac_mask ((uint32_t)0x7fffffL)
-#define Frac_mask1 ((uint32_t)0xffff007fL)
-#define Ten_pmax 24
-#define Bletch 2
-#define Bndry_mask ((uint32_t)0xffff007fL)
-#define Bndry_mask1 ((uint32_t)0xffff007fL)
-#define LSB ((uint32_t)0x10000L)
-#define Sign_bit ((uint32_t)0x8000L)
-#define Log2P 1
-#define Tiny0 0x80
-#define Tiny1 0
-#define Quick_max 15
-#define Int_max 15
-#endif
-#endif
-
-#ifndef IEEE_Arith
-#define ROUND_BIASED
-#endif
-
-#ifdef RND_PRODQUOT
-#define rounded_product(a,b) a = rnd_prod(a, b)
-#define rounded_quotient(a,b) a = rnd_quot(a, b)
-#ifdef KR_headers
-extern double rnd_prod(), rnd_quot();
-#else
-extern double rnd_prod(double, double), rnd_quot(double, double);
-#endif
-#else
-#define rounded_product(a,b) a *= b
-#define rounded_quotient(a,b) a /= b
-#endif
-
-#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1))
-#define Big1 ((uint32_t)0xffffffffL)
-
-#ifndef Just_16
-/* When Pack_32 is not defined, we store 16 bits per 32-bit long.
- * This makes some inner loops simpler and sometimes saves work
- * during multiplications, but it often seems to make things slightly
- * slower. Hence the default is now to store 32 bits per long.
- */
-
-#ifndef Pack_32
-#if SIZEOF_VOID_P != 8
-#define Pack_32
-#endif
-#endif
-#endif
-
-
-#define MAX_BIGNUMS 16
-#define MAX_BIGNUM_WDS 32
-
-struct _Jv_Bigint
-{
- struct _Jv_Bigint *_next;
- int _k, _maxwds, _sign, _wds;
- unsigned long _x[MAX_BIGNUM_WDS];
-};
-
-
-#define _PTR void *
-#define _AND ,
-#define _NOARGS void
-#define _CONST const
-#define _VOLATILE volatile
-#define _SIGNED signed
-#define _DOTS , ...
-#define _VOID void
-#define _EXFUN(name, proto) name proto
-#define _DEFUN(name, arglist, args) name(args)
-#define _DEFUN_VOID(name) name(_NOARGS)
-#define _CAST_VOID (void)
-
-
-struct _Jv_reent
-{
- /* local copy of errno */
- int _errno;
-
- /* used by mprec routines */
- struct _Jv_Bigint *_result;
- int _result_k;
- struct _Jv_Bigint *_p5s;
-
- struct _Jv_Bigint _freelist[MAX_BIGNUMS];
- int _allocation_map;
-
- int num;
-};
-
-
-typedef struct _Jv_Bigint _Jv_Bigint;
-
-#define Balloc _Jv_Balloc
-#define Bfree _Jv_Bfree
-#define multadd _Jv_multadd
-#define s2b _Jv_s2b
-#define lo0bits _Jv_lo0bits
-#define hi0bits _Jv_hi0bits
-#define i2b _Jv_i2b
-#define mult _Jv_mult
-#define pow5mult _Jv_pow5mult
-#define lshift _Jv_lshift
-#define cmp _Jv__mcmp
-#define diff _Jv__mdiff
-#define ulp _Jv_ulp
-#define b2d _Jv_b2d
-#define d2b _Jv_d2b
-#define ratio _Jv_ratio
-
-#define tens _Jv__mprec_tens
-#define bigtens _Jv__mprec_bigtens
-#define tinytens _Jv__mprec_tinytens
-
-#define _dtoa _Jv_dtoa
-#define _dtoa_r _Jv_dtoa_r
-#define _strtod_r _Jv_strtod_r
-
-extern double _EXFUN(_strtod_r, (struct _Jv_reent *ptr, const char *s00, char **se));
-extern char* _EXFUN(_dtoa_r, (struct _Jv_reent *ptr, double d,
- int mode, int ndigits, int *decpt, int *sign,
- char **rve, int float_type));
-void _EXFUN(_dtoa, (double d, int mode, int ndigits, int *decpt, int *sign,
- char **rve, char *buf, int float_type));
-
-double _EXFUN(ulp,(double x));
-double _EXFUN(b2d,(_Jv_Bigint *a , int *e));
-_Jv_Bigint * _EXFUN(Balloc,(struct _Jv_reent *p, int k));
-void _EXFUN(Bfree,(struct _Jv_reent *p, _Jv_Bigint *v));
-_Jv_Bigint * _EXFUN(multadd,(struct _Jv_reent *p, _Jv_Bigint *, int, int));
-_Jv_Bigint * _EXFUN(s2b,(struct _Jv_reent *, const char*, int, int, unsigned long));
-_Jv_Bigint * _EXFUN(i2b,(struct _Jv_reent *,int));
-_Jv_Bigint * _EXFUN(mult, (struct _Jv_reent *, _Jv_Bigint *, _Jv_Bigint *));
-_Jv_Bigint * _EXFUN(pow5mult, (struct _Jv_reent *, _Jv_Bigint *, int k));
-int _EXFUN(hi0bits,(unsigned long));
-int _EXFUN(lo0bits,(unsigned long *));
-_Jv_Bigint * _EXFUN(d2b,(struct _Jv_reent *p, double d, int *e, int *bits));
-_Jv_Bigint * _EXFUN(lshift,(struct _Jv_reent *p, _Jv_Bigint *b, int k));
-_Jv_Bigint * _EXFUN(diff,(struct _Jv_reent *p, _Jv_Bigint *a, _Jv_Bigint *b));
-int _EXFUN(cmp,(_Jv_Bigint *a, _Jv_Bigint *b));
-
-double _EXFUN(ratio,(_Jv_Bigint *a, _Jv_Bigint *b));
-#define Bcopy(x,y) memcpy((char *)&x->_sign, (char *)&y->_sign, y->_wds*sizeof(long) + 2*sizeof(int))
-
-#if defined(_DOUBLE_IS_32BITS) && defined(__v800)
-#define n_bigtens 2
-#else
-#define n_bigtens 5
-#endif
-
-extern _CONST double tinytens[];
-extern _CONST double bigtens[];
-extern _CONST double tens[];
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/libjava/java/lang/ref/PhantomReference.java b/libjava/java/lang/ref/PhantomReference.java
deleted file mode 100644
index 4d929c29c58..00000000000
--- a/libjava/java/lang/ref/PhantomReference.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* java.lang.ref.PhantomReference
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.ref;
-
-/**
- * A phantom reference is useful, to get notified, when an object got
- * finalized. You can't access that object though, since it is
- * finalized. This is the reason, why <code>get()</code> always
- * returns null.
- *
- * @author Jochen Hoenicke
- */
-public class PhantomReference
- extends Reference
-{
- /**
- * Creates a new phantom reference.
- * @param referent the object that should be watched.
- * @param q the queue that should be notified, if the referent was
- * finalized. This mustn't be <code>null</code>.
- * @exception NullPointerException if q is null.
- */
- public PhantomReference(Object referent, ReferenceQueue q)
- {
- super(referent, q);
- }
-
- /**
- * Returns the object, this reference refers to.
- * @return <code>null</code>, since the refered object may be
- * finalized and thus not accessible.
- */
- public Object get()
- {
- return null;
- }
-}
diff --git a/libjava/java/lang/ref/ReferenceQueue.java b/libjava/java/lang/ref/ReferenceQueue.java
deleted file mode 100644
index f4729f282be..00000000000
--- a/libjava/java/lang/ref/ReferenceQueue.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/* java.lang.ref.ReferenceQueue
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.ref;
-
-/**
- * This is the queue, where references can enqueue themselve on. Each
- * reference may be registered to a queue at initialization time and
- * will be appended to the queue, when the enqueue method is called.
- *
- * The enqueue method may be automatically called by the garbage
- * collector if it detects, that the object is only reachable through
- * the Reference objects.
- *
- * @author Jochen Hoenicke
- * @see Reference#enqueue()
- */
-public class ReferenceQueue
-{
- /**
- * This is a linked list of references. If this is null, the list is
- * empty. Otherwise this points to the first reference on the queue.
- * The first reference will point to the next reference via the
- * <code>nextOnQueue</code> field. The last reference will point to
- * itself (not to null, since <code>nextOnQueue</code> is used to
- * determine if a reference is enqueued).
- */
- private Reference first;
-
- /**
- * Creates a new empty reference queue.
- */
- public ReferenceQueue()
- {
- }
-
- /**
- * Checks if there is a reference on the queue, returning it
- * immediately. The reference will be dequeued.
- *
- * @return a reference on the queue, if there is one,
- * <code>null</code> otherwise.
- */
- public synchronized Reference poll()
- {
- return dequeue();
- }
-
- /**
- * This is called by reference to enqueue itself on this queue.
- * @param ref the reference that should be enqueued.
- */
- synchronized void enqueue(Reference ref)
- {
- /* last reference will point to itself */
- ref.nextOnQueue = first == null ? ref : first;
- first = ref;
- /* this wakes only one remove thread. */
- notify();
- }
-
- /**
- * Remove a reference from the queue, if there is one.
- * @return the first element of the queue, or null if there isn't any.
- */
- private Reference dequeue()
- {
- if (first == null)
- return null;
-
- Reference result = first;
- first = (first == first.nextOnQueue) ? null : first.nextOnQueue;
- result.nextOnQueue = null;
- return result;
- }
-
- /**
- * Removes a reference from the queue, blocking for <code>timeout</code>
- * until a reference is enqueued.
- * @param timeout the timeout period in milliseconds, <code>0</code> means
- * wait forever.
- * @return the reference removed from the queue, or
- * <code>null</code> if timeout period expired.
- * @exception InterruptedException if the wait was interrupted.
- */
- public synchronized Reference remove(long timeout)
- throws InterruptedException
- {
- if (first == null)
- {
- wait(timeout);
- }
-
- return dequeue();
- }
-
-
- /**
- * Removes a reference from the queue, blocking until a reference is
- * enqueued.
- *
- * @return the reference removed from the queue.
- * @exception InterruptedException if the wait was interrupted.
- */
- public Reference remove()
- throws InterruptedException
- {
- return remove(0L);
- }
-}
diff --git a/libjava/java/lang/ref/SoftReference.java b/libjava/java/lang/ref/SoftReference.java
deleted file mode 100644
index 97395eacdfa..00000000000
--- a/libjava/java/lang/ref/SoftReference.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* java.lang.ref.SoftReference
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.ref;
-
-/**
- * A soft reference will be cleared, if the object is only softly
- * reachable and the garbage collection needs more memory. The garbage
- * collection will use an intelligent strategy to determine which soft
- * references it should clear. This makes a soft reference ideal for
- * caches.<br>
- *
- * @author Jochen Hoenicke
- */
-public class SoftReference
- extends Reference
-{
- /**
- * Create a new soft reference, that is not registered to any queue.
- * @param referent the object we refer to.
- */
- public SoftReference(Object referent)
- {
- super(referent);
- }
-
- /**
- * Create a new soft reference.
- * @param referent the object we refer to.
- * @param q the reference queue to register on.
- * @exception NullPointerException if q is null.
- */
- public SoftReference(Object referent, ReferenceQueue q)
- {
- super(referent, q);
- }
-
- /**
- * Returns the object, this reference refers to.
- * @return the object, this reference refers to, or null if the
- * reference was cleared.
- */
- public Object get()
- {
- /* Why is this overloaded???
- * Maybe for a kind of LRU strategy. */
- return super.get();
- }
-}
diff --git a/libjava/java/lang/ref/WeakReference.java b/libjava/java/lang/ref/WeakReference.java
deleted file mode 100644
index 9f758ca1eab..00000000000
--- a/libjava/java/lang/ref/WeakReference.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* java.lang.ref.WeakReference
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.ref;
-
-/**
- * A weak reference will be cleared, if the object is only weakly
- * reachable. It is useful for lookup tables, where you aren't
- * interested in an entry, if the key isn't reachable anymore.
- * <code>WeakHashtable</code> is a complete implementation of such a
- * table. <br>
- *
- * It is also useful to make objects unique: You create a set of weak
- * references to those objects, and when you create a new object you
- * look in this set, if the object already exists and return it. If
- * an object is not referenced anymore, the reference will
- * automatically cleared, and you may remove it from the set. <br>
- *
- * @author Jochen Hoenicke
- * @see java.util.WeakHashtable
- */
-public class WeakReference
- extends Reference
-{
- /**
- * Create a new weak reference, that is not registered to any queue.
- * @param referent the object we refer to.
- */
- public WeakReference(Object referent)
- {
- super(referent);
- }
-
- /**
- * Create a new weak reference.
- * @param referent the object we refer to.
- * @param q the reference queue to register on.
- * @exception NullPointerException if q is null.
- */
- public WeakReference(Object referent, ReferenceQueue q)
- {
- super(referent, q);
- }
-}
diff --git a/libjava/java/lang/reflect/AccessibleObject.java b/libjava/java/lang/reflect/AccessibleObject.java
deleted file mode 100644
index 24418c971c7..00000000000
--- a/libjava/java/lang/reflect/AccessibleObject.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* java.lang.reflect.AccessibleObject
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.reflect;
-
-/**
- * This class is the superclass of various reflection classes, and
- * allows sufficiently trusted code to bypass normal restrictions to
- * do necessary things like invoke private methods outside of the
- * class during Serialization. If you don't have a good reason
- * to mess with this, don't try. Fortunately, there are adequate
- * security checks before you can set a reflection object as accessible.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Field
- * @see Constructor
- * @see Method
- * @see ReflectPermission
- * @since 1.2
- * @status updated to 1.4
- */
-public class AccessibleObject
-{
- /**
- * True if this object is marked accessible, which means the reflected
- * object bypasses normal security checks.
- */
- // default visibility for use by inherited classes
- boolean flag = false;
-
- /**
- * Only the three reflection classes that extend this can create an
- * accessible object. This is not serializable for security reasons.
- */
- protected AccessibleObject()
- {
- }
-
- /**
- * Return the accessibility status of this object.
- *
- * @return true if this object bypasses security checks
- */
- public boolean isAccessible()
- {
- return flag;
- }
-
- /**
- * Convenience method to set the flag on a number of objects with a single
- * security check. If a security manager exists, it is checked for
- * <code>ReflectPermission("suppressAccessChecks")</code>.<p>
- *
- * It is forbidden to set the accessibility flag to true on any constructor
- * for java.lang.Class. This will result in a SecurityException. If the
- * SecurityException is thrown for any of the passed AccessibleObjects,
- * the accessibility flag will be set on AccessibleObjects in the array prior
- * to the one which resulted in the exception.
- *
- * @param array the array of accessible objects
- * @param flag the desired state of accessibility, true to bypass security
- * @throws NullPointerException if array is null
- * @throws SecurityException if the request is denied
- * @see SecurityManager#checkPermission(java.security.Permission)
- * @see RuntimePermission
- */
- public static void setAccessible(AccessibleObject[] array, boolean flag)
- {
- checkPermission();
- for (int i = 0; i < array.length; i++)
- array[i].secureSetAccessible(flag);
- }
-
- /**
- * Sets the accessibility flag for this reflection object. If a security
- * manager exists, it is checked for
- * <code>ReflectPermission("suppressAccessChecks")</code>.<p>
- *
- * It is forbidden to set the accessibility flag to true on any constructor for
- * java.lang.Class. This will result in a SecurityException.
- *
- * @param flag the desired state of accessibility, true to bypass security
- * @throws NullPointerException if array is null
- * @throws SecurityException if the request is denied
- * @see SecurityManager#checkPermission(java.security.Permission)
- * @see RuntimePermission
- */
- public void setAccessible(boolean flag)
- {
- checkPermission();
- secureSetAccessible(flag);
- }
-
- /**
- * Performs the specified security check, for
- * <code>ReflectPermission("suppressAccessChecks")</code>.
- *
- * @throws SecurityException if permission is denied
- */
- private static void checkPermission()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new ReflectPermission("suppressAccessChecks"));
- }
-
- /**
- * Performs the actual accessibility change, this must always be invoked
- * after calling checkPermission.
- *
- * @param flag the desired status
- * @throws SecurityException if flag is true and this is a constructor
- * for <code>java.lang.Class</code>.
- */
- private void secureSetAccessible(boolean flag)
- {
- if (flag &&
- (this instanceof Constructor
- && ((Constructor) this).getDeclaringClass() == Class.class))
- throw new SecurityException("Cannot make object accessible: " + this);
- this.flag = flag;
- }
-}
diff --git a/libjava/java/lang/reflect/InvocationHandler.java b/libjava/java/lang/reflect/InvocationHandler.java
deleted file mode 100644
index 208e621eedc..00000000000
--- a/libjava/java/lang/reflect/InvocationHandler.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* java.lang.reflect.InvocationHandler - dynamically executes methods in
- proxy instances
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.reflect;
-
-/**
- * This interface defines an invocation handler. Suppose you are using
- * reflection, and found a method that requires that its parameter
- * be an object of a given interface. You want to call this method,
- * but have no idea what classes implement that interface. So, you can
- * create a {@link Proxy} instance, a convenient way to dynamically
- * generate a class that meets all the necessary properties of that
- * interface. But in order for the proxy instance to do any good, it
- * needs to know what to do when interface methods are invoked! So,
- * this interface is basically a cool wrapper that provides runtime
- * code generation needed by proxy instances.
- *
- * <p>While this interface was designed for use by Proxy, it will also
- * work on any object in general.</p>
- *
- * <p>Hints for implementing this class:</p>
- *
- * <ul>
- * <li>Don't forget that Object.equals, Object.hashCode, and
- * Object.toString will call this handler. In particular,
- * a naive call to proxy.equals, proxy.hashCode, or proxy.toString
- * will put you in an infinite loop. And remember that string
- * concatenation also invokes toString.</li>
- * <li>Obey the contract of the Method object you are handling, or
- * the proxy instance will be forced to throw a
- * {@link NullPointerException}, {@link ClassCastException},
- * or {@link UndeclaredThrowableException}.</li>
- * <li>Be prepared to wrap/unwrap primitives as necessary.</li>
- * <li>The Method object may be owned by a different interface than
- * what was actually used as the qualifying type of the method
- * invocation in the Java source code. This means that it might
- * not always be safe to throw an exception listed as belonging
- * to the method's throws clause.</li>
- * </ul>
- *
- * <p><small>For a fun time, create an InvocationHandler that handles the
- * methods of a proxy instance of the InvocationHandler interface!</small></p>
- *
- * @see Proxy
- * @see UndeclaredThrowableException
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- * @status updated to 1.4
- */
-public interface InvocationHandler
-{
- /**
- * When a method is invoked on a proxy instance, it is wrapped and
- * this method is called instead, so that you may decide at runtime
- * how the original method should behave.
- *
- * @param proxy the instance that the wrapped method should be
- * invoked on. When this method is called by a Proxy object,
- * `proxy' will be an instance of {@link Proxy}, and oddly enough,
- * <code>Proxy.getInvocationHandler(proxy)</code> will return
- * <code>this</code>!
- * @param method the reflected method to invoke on the proxy.
- * When this method is called by a Proxy object, 'method'
- * will be the reflection object owned by the declaring
- * class or interface, which may be a supertype of the
- * interfaces the proxy directly implements.
- * @param args the arguments passed to the original method, or
- * <code>null</code> if the method takes no arguments.
- * (But also be prepared to handle a 0-length array).
- * Arguments of primitive type, such as <code>boolean</code>
- * or <code>int</code>, are wrapped in the appropriate
- * class such as {@link Boolean} or {@link Integer}.
- * @return whatever is necessary to return from the wrapped method.
- * If the wrapped method is <code>void</code>, the proxy
- * instance will ignore it. If the wrapped method returns
- * a primitive, this must be the correct wrapper type whose value
- * is exactly assignable to the appropriate type (no widening
- * will be performed); a null object in this case causes a
- * {@link NullPointerException}. In all remaining cases, if
- * the returned object is not assignment compatible to the
- * declared type of the original method, the proxy instance
- * will generate a {@link ClassCastException}.
- * @throws Throwable this interface is listed as throwing anything,
- * but the implementation should only throw unchecked
- * exceptions and exceptions listed in the throws clause of
- * all methods being overridden by the proxy instance. If
- * something is thrown that is not compatible with the throws
- * clause of all overridden methods, the proxy instance will
- * wrap the exception in an UndeclaredThrowableException.
- * Note that an exception listed in the throws clause of the
- * `method' parameter might not be declared in additional
- * interfaces also implemented by the proxy object.
- *
- * @see Proxy
- * @see UndeclaredThrowableException
- */
- Object invoke(Object proxy, Method method, Object[] args)
- throws Throwable;
-
-}
diff --git a/libjava/java/lang/reflect/InvocationTargetException.java b/libjava/java/lang/reflect/InvocationTargetException.java
deleted file mode 100644
index af79d3a199d..00000000000
--- a/libjava/java/lang/reflect/InvocationTargetException.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/* InvocationTargetException.java -- Wrapper exception for reflection
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.reflect;
-
-/**
- * InvocationTargetException is sort of a way to "wrap" whatever exception
- * comes up when a method or constructor is called via Reflection. As of
- * JDK 1.4, it was retrofitted to match the exception chaining of all other
- * exceptions, but <code>getTargetException()</code> still works.
- *
- * @author John Keiser
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Method#invoke(Object,Object[])
- * @see Constructor#newInstance(Object[])
- * @since 1.1
- * @status updated to 1.4
- */
-public class InvocationTargetException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 4085088731926701167L;
-
- /**
- * The chained exception. This field is only around for serial compatibility.
- *
- * @serial the chained exception
- */
- private final Throwable target;
-
- /**
- * Construct an exception with null as the cause. The cause is initialized
- * to null.
- */
- protected InvocationTargetException()
- {
- this(null, null);
- }
-
- /**
- * Create an <code>InvocationTargetException</code> using another
- * exception.
- *
- * @param targetException the exception to wrap
- */
- public InvocationTargetException(Throwable targetException)
- {
- this(targetException, null);
- }
-
- /**
- * Create an <code>InvocationTargetException</code> using another
- * exception and an error message.
- *
- * @param targetException the exception to wrap
- * @param err an extra reason for the exception-throwing
- */
- public InvocationTargetException(Throwable targetException, String err)
- {
- super(err, targetException);
- target = targetException;
- }
-
- /**
- * Get the wrapped (targeted) exception.
- *
- * @return the targeted exception
- * @see #getCause()
- */
- public Throwable getTargetException()
- {
- return target;
- }
-
- /**
- * Returns the cause of this exception (which may be null).
- *
- * @return the cause
- * @since 1.4
- */
- public Throwable getCause()
- {
- return target;
- }
-}
diff --git a/libjava/java/lang/reflect/Member.java b/libjava/java/lang/reflect/Member.java
deleted file mode 100644
index 9983b275a94..00000000000
--- a/libjava/java/lang/reflect/Member.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* java.lang.reflect.Member - common query methods in reflection
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.reflect;
-
-/**
- * Member is an interface that represents any member of a class (field or
- * method) or a constructor. You can get information about the declaring
- * class, name or modifiers of the member with this interface.
- *
- * @author John Keiser
- * @author Per Bothner (bothner@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Class
- * @see Field
- * @see Method
- * @see Constructor
- * @since 1.1
- * @status updated to 1.4
- */
-public interface Member
-{
- /**
- * Represents all members, whether public, private, protected or
- * package-protected, but only which are declared in this class.
- * Used in SecurityManager.checkMemberAccess() to determine the
- * type of members to access.
- * @see SecurityManager#checkMemberAccess()
- */
- int DECLARED = 1;
-
- /**
- * Represents public members only, but includes all inherited members.
- * Used in SecurityManager.checkMemberAccess() to determine the type of
- * members to access.
- * @see SecurityManager#checkMemberAccess()
- */
- int PUBLIC = 0;
-
- /**
- * Gets the class that declared this member. This is not the class where
- * this method was called, or even the class where this Member object
- * came to life, but the class that declares the member this represents.
- *
- * @return the class that declared this member
- */
- Class getDeclaringClass();
-
- /**
- * Gets the simple name of this member. This will be a valid Java
- * identifier, with no qualification.
- *
- * @return the name of this member
- */
- String getName();
-
- /**
- * Gets the modifiers this member uses. Use the <code>Modifier</code>
- * class to interpret the values.
- *
- * @return an integer representing the modifiers to this Member
- * @see Modifier
- */
- int getModifiers();
-}
diff --git a/libjava/java/lang/reflect/Proxy.java b/libjava/java/lang/reflect/Proxy.java
deleted file mode 100644
index dc1ac87e4e1..00000000000
--- a/libjava/java/lang/reflect/Proxy.java
+++ /dev/null
@@ -1,1615 +0,0 @@
-/* Proxy.java -- build a proxy class that implements reflected interfaces
- Copyright (C) 2001, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.reflect;
-
-import gnu.classpath.Configuration;
-import gnu.java.lang.reflect.TypeSignature;
-
-import java.io.Serializable;
-import java.security.ProtectionDomain;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * This class allows you to dynamically create an instance of any (or
- * even multiple) interfaces by reflection, and decide at runtime
- * how that instance will behave by giving it an appropriate
- * {@link InvocationHandler}. Proxy classes serialize specially, so
- * that the proxy object can be reused between VMs, without requiring
- * a persistent copy of the generated class code.
- *
- * <h3>Creation</h3>
- * To create a proxy for some interface Foo:
- *
- * <pre>
- * InvocationHandler handler = new MyInvocationHandler(...);
- * Class proxyClass = Proxy.getProxyClass(
- * Foo.class.getClassLoader(), new Class[] { Foo.class });
- * Foo f = (Foo) proxyClass
- * .getConstructor(new Class[] { InvocationHandler.class })
- * .newInstance(new Object[] { handler });
- * </pre>
- * or more simply:
- * <pre>
- * Foo f = (Foo) Proxy.newProxyInstance(Foo.class.getClassLoader(),
- * new Class[] { Foo.class },
- * handler);
- * </pre>
- *
- * <h3>Dynamic Proxy Classes</h3>
- * A dynamic proxy class is created at runtime, and has the following
- * properties:
- * <ul>
- * <li>The class is <code>public</code> and <code>final</code>,
- * and is neither <code>abstract</code> nor an inner class.</li>
- * <li>The class has no canonical name (there is no formula you can use
- * to determine or generate its name), but begins with the
- * sequence "$Proxy". Abuse this knowledge at your own peril.
- * (For now, '$' in user identifiers is legal, but it may not
- * be that way forever. You weren't using '$' in your
- * identifiers, were you?)</li>
- * <li>The class extends Proxy, and explicitly implements all the
- * interfaces specified at creation, in order (this is important
- * for determining how method invocation is resolved). Note that
- * a proxy class implements {@link Serializable}, at least
- * implicitly, since Proxy does, but true serial behavior
- * depends on using a serializable invocation handler as well.</li>
- * <li>If at least one interface is non-public, the proxy class
- * will be in the same package. Otherwise, the package is
- * unspecified. This will work even if the package is sealed
- * from user-generated classes, because Proxy classes are
- * generated by a trusted source. Meanwhile, the proxy class
- * belongs to the classloader you designated.</li>
- * <li>Reflection works as expected: {@link Class#getInterfaces()} and
- * {@link Class#getMethods()} work as they do on normal classes.</li>
- * <li>The method {@link #isProxyClass()} will distinguish between
- * true proxy classes and user extensions of this class. It only
- * returns true for classes created by {@link #getProxyClass}.</li>
- * <li>The {@link ProtectionDomain} of a proxy class is the same as for
- * bootstrap classes, such as Object or Proxy, since it is created by
- * a trusted source. This protection domain will typically be granted
- * {@link java.security.AllPermission}. But this is not a security
- * risk, since there are adequate permissions on reflection, which is
- * the only way to create an instance of the proxy class.</li>
- * <li>The proxy class contains a single constructor, which takes as
- * its only argument an {@link InvocationHandler}. The method
- * {@link #newInstance} is shorthand to do the necessary
- * reflection.</li>
- * </ul>
- *
- * <h3>Proxy Instances</h3>
- * A proxy instance is an instance of a proxy class. It has the
- * following properties, many of which follow from the properties of a
- * proxy class listed above:
- * <ul>
- * <li>For a proxy class with Foo listed as one of its interfaces, the
- * expression <code>proxy instanceof Foo</code> will return true,
- * and the expression <code>(Foo) proxy</code> will succeed without
- * a {@link ClassCastException}.</li>
- * <li>Each proxy instance has an invocation handler, which can be
- * accessed by {@link #getInvocationHandler(Object)}. Any call
- * to an interface method, including {@link Object#hashcode()},
- * {@link Object#equals(Object)}, or {@link Object#toString()},
- * but excluding the public final methods of Object, will be
- * encoded and passed to the {@link InvocationHandler#invoke}
- * method of this handler.</li>
- * </ul>
- *
- * <h3>Inheritance Issues</h3>
- * A proxy class may inherit a method from more than one interface.
- * The order in which interfaces are listed matters, because it determines
- * which reflected {@link Method} object will be passed to the invocation
- * handler. This means that the dynamically generated class cannot
- * determine through which interface a method is being invoked.<p>
- *
- * In short, if a method is declared in Object (namely, hashCode,
- * equals, or toString), then Object will be used; otherwise, the
- * leftmost interface that inherits or declares a method will be used,
- * even if it has a more permissive throws clause than what the proxy
- * class is allowed. Thus, in the invocation handler, it is not always
- * safe to assume that every class listed in the throws clause of the
- * passed Method object can safely be thrown; fortunately, the Proxy
- * instance is robust enough to wrap all illegal checked exceptions in
- * {@link UndeclaredThrowableException}.
- *
- * @see InvocationHandler
- * @see UndeclaredThrowableException
- * @see Class
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.3
- * @status updated to 1.4, except for the use of ProtectionDomain
- */
-public class Proxy implements Serializable
-{
- /**
- * Compatible with JDK 1.3+.
- */
- private static final long serialVersionUID = -2222568056686623797L;
-
- /**
- * Map of ProxyType to proxy class.
- *
- * @XXX This prevents proxy classes from being garbage collected.
- * java.util.WeakHashSet is not appropriate, because that collects the
- * keys, but we are interested in collecting the elements.
- */
- private static final Map proxyClasses = new HashMap();
-
- /**
- * The invocation handler for this proxy instance. For Proxy, this
- * field is unused, but it appears here in order to be serialized in all
- * proxy classes.
- *
- * <em>NOTE</em>: This implementation is more secure for proxy classes
- * than what Sun specifies. Sun does not require h to be immutable, but
- * this means you could change h after the fact by reflection. However,
- * by making h immutable, we may break non-proxy classes which extend
- * Proxy.
- * @serial invocation handler associated with this proxy instance
- */
- protected InvocationHandler h;
-
- /**
- * Constructs a new Proxy from a subclass (usually a proxy class),
- * with the specified invocation handler.
- *
- * <em>NOTE</em>: This throws a NullPointerException if you attempt
- * to create a proxy instance with a null handler using reflection.
- * This behavior is not yet specified by Sun; see Sun Bug 4487672.
- *
- * @param handler the invocation handler, may be null if the subclass
- * is not a proxy class
- * @throws NullPointerException if handler is null and this is a proxy
- * instance
- */
- protected Proxy(InvocationHandler handler)
- {
- if (handler == null && isProxyClass(getClass()))
- throw new NullPointerException("invalid handler");
- h = handler;
- }
-
- /**
- * Returns the proxy {@link Class} for the given ClassLoader and array
- * of interfaces, dynamically generating it if necessary.
- *
- * <p>There are several restrictions on this method, the violation of
- * which will result in an IllegalArgumentException or
- * NullPointerException:</p>
- *
- * <ul>
- * <li>All objects in `interfaces' must represent distinct interfaces.
- * Classes, primitive types, null, and duplicates are forbidden.</li>
- * <li>The interfaces must be visible in the specified ClassLoader.
- * In other words, for each interface i:
- * <code>Class.forName(i.getName(), false, loader) == i</code>
- * must be true.</li>
- * <li>All non-public interfaces (if any) must reside in the same
- * package, or the proxy class would be non-instantiable. If
- * there are no non-public interfaces, the package of the proxy
- * class is unspecified.</li>
- * <li>All interfaces must be compatible - if two declare a method
- * with the same name and parameters, the return type must be
- * the same and the throws clause of the proxy class will be
- * the maximal subset of subclasses of the throws clauses for
- * each method that is overridden.</li>
- * <li>VM constraints limit the number of interfaces a proxy class
- * may directly implement (however, the indirect inheritance
- * of {@link Serializable} does not count against this limit).
- * Even though most VMs can theoretically have 65535
- * superinterfaces for a class, the actual limit is smaller
- * because a class's constant pool is limited to 65535 entries,
- * and not all entries can be interfaces.</li>
- * </ul>
- *
- * <p>Note that different orders of interfaces produce distinct classes.</p>
- *
- * @param loader the class loader to define the proxy class in; null
- * implies the bootstrap class loader
- * @param interfaces the array of interfaces the proxy class implements,
- * may be empty, but not null
- * @return the Class object of the proxy class
- * @throws IllegalArgumentException if the constraints above were
- * violated, except for problems with null
- * @throws NullPointerException if `interfaces' is null or contains
- * a null entry
- */
- // synchronized so that we aren't trying to build the same class
- // simultaneously in two threads
- public static synchronized Class getProxyClass(ClassLoader loader,
- Class[] interfaces)
- {
- interfaces = (Class[]) interfaces.clone();
- ProxyType pt = new ProxyType(loader, interfaces);
- Class clazz = (Class) proxyClasses.get(pt);
- if (clazz == null)
- {
- if (Configuration.HAVE_NATIVE_GET_PROXY_CLASS)
- clazz = getProxyClass0(loader, interfaces);
- else
- {
- ProxyData data = (Configuration.HAVE_NATIVE_GET_PROXY_DATA
- ? getProxyData0(loader, interfaces)
- : ProxyData.getProxyData(pt));
-
- clazz = (Configuration.HAVE_NATIVE_GENERATE_PROXY_CLASS
- ? generateProxyClass0(loader, data)
- : new ClassFactory(data).generate(loader));
- }
-
- Object check = proxyClasses.put(pt, clazz);
- // assert check == null && clazz != null;
- if (check != null || clazz == null)
- throw new InternalError(/*"Fatal flaw in getProxyClass"*/);
- }
- return clazz;
- }
-
- /**
- * Combines several methods into one. This is equivalent to:
- * <pre>
- * Proxy.getProxyClass(loader, interfaces)
- * .getConstructor(new Class[] {InvocationHandler.class})
- * .newInstance(new Object[] {handler});
- * </pre>
- * except that it will not fail with the normal problems caused
- * by reflection. It can still fail for the same reasons documented
- * in getProxyClass, or if handler is null.
- *
- * @param loader the class loader to define the proxy class in; null
- * implies the bootstrap class loader
- * @param interfaces the array of interfaces the proxy class implements,
- * may be empty, but not null
- * @param handler the invocation handler, may not be null
- * @return a proxy instance implementing the specified interfaces
- * @throws IllegalArgumentException if the constraints for getProxyClass
- * were violated, except for problems with null
- * @throws NullPointerException if `interfaces' is null or contains
- * a null entry, or if handler is null
- * @see #getProxyClass(ClassLoader, Class[])
- * @see Class#getConstructor(Class[])
- * @see Constructor#newInstance(Object[])
- */
- public static Object newProxyInstance(ClassLoader loader,
- Class[] interfaces,
- InvocationHandler handler)
- {
- try
- {
- // getProxyClass() and Proxy() throw the necessary exceptions
- return getProxyClass(loader, interfaces)
- .getConstructor(new Class[] {InvocationHandler.class})
- .newInstance(new Object[] {handler});
- }
- catch (RuntimeException e)
- {
- // Let IllegalArgumentException, NullPointerException escape.
- // assert e instanceof IllegalArgumentException
- // || e instanceof NullPointerException;
- throw e;
- }
- catch (InvocationTargetException e)
- {
- // Let wrapped NullPointerException escape.
- // assert e.getTargetException() instanceof NullPointerException
- throw (NullPointerException) e.getCause();
- }
- catch (Exception e)
- {
- // Covers InstantiationException, IllegalAccessException,
- // NoSuchMethodException, none of which should be generated
- // if the proxy class was generated correctly.
- // assert false;
- throw (Error) new InternalError("Unexpected: " + e).initCause(e);
- }
- }
-
- /**
- * Returns true if and only if the Class object is a dynamically created
- * proxy class (created by <code>getProxyClass</code> or by the
- * syntactic sugar of <code>newProxyInstance</code>).
- *
- * <p>This check is secure (in other words, it is not simply
- * <code>clazz.getSuperclass() == Proxy.class</code>), it will not
- * be spoofed by non-proxy classes that extend Proxy.
- *
- * @param clazz the class to check, must not be null
- * @return true if the class represents a proxy class
- * @throws NullPointerException if clazz is null
- */
- // This is synchronized on the off chance that another thread is
- // trying to add a class to the map at the same time we read it.
- public static synchronized boolean isProxyClass(Class clazz)
- {
- if (! Proxy.class.isAssignableFrom(clazz))
- return false;
- // This is a linear search, even though we could do an O(1) search
- // using new ProxyType(clazz.getClassLoader(), clazz.getInterfaces()).
- return proxyClasses.containsValue(clazz);
- }
-
- /**
- * Returns the invocation handler for the given proxy instance.<p>
- *
- * <em>NOTE</em>: We guarantee a non-null result if successful,
- * but Sun allows the creation of a proxy instance with a null
- * handler. See the comments for {@link #Proxy(InvocationHandler)}.
- *
- * @param proxy the proxy instance, must not be null
- * @return the invocation handler, guaranteed non-null.
- * @throws IllegalArgumentException if
- * <code>Proxy.isProxyClass(proxy.getClass())</code> returns false.
- * @throws NullPointerException if proxy is null
- */
- public static InvocationHandler getInvocationHandler(Object proxy)
- {
- if (! isProxyClass(proxy.getClass()))
- throw new IllegalArgumentException("not a proxy instance");
- return ((Proxy) proxy).h;
- }
-
- /**
- * Optional native method to replace (and speed up) the pure Java
- * implementation of getProxyClass. Only needed if
- * Configuration.HAVE_NATIVE_GET_PROXY_CLASS is true, this does the
- * work of both getProxyData0 and generateProxyClass0 with no
- * intermediate form in Java. The native code may safely assume that
- * this class must be created, and does not already exist.
- *
- * @param loader the class loader to define the proxy class in; null
- * implies the bootstrap class loader
- * @param interfaces the interfaces the class will extend
- * @return the generated proxy class
- * @throws IllegalArgumentException if the constraints for getProxyClass
- * were violated, except for problems with null
- * @throws NullPointerException if `interfaces' is null or contains
- * a null entry, or if handler is null
- * @see Configuration#HAVE_NATIVE_GET_PROXY_CLASS
- * @see #getProxyClass(ClassLoader, Class[])
- * @see #getProxyData0(ClassLoader, Class[])
- * @see #generateProxyClass0(ProxyData)
- */
- private static native Class getProxyClass0(ClassLoader loader,
- Class[] interfaces);
-
- /**
- * Optional native method to replace (and speed up) the pure Java
- * implementation of getProxyData. Only needed if
- * Configuration.HAVE_NATIVE_GET_PROXY_DATA is true. The native code
- * may safely assume that a new ProxyData object must be created which
- * does not duplicate any existing ones.
- *
- * @param loader the class loader to define the proxy class in; null
- * implies the bootstrap class loader
- * @param interfaces the interfaces the class will extend
- * @return all data that is required to make this proxy class
- * @throws IllegalArgumentException if the constraints for getProxyClass
- * were violated, except for problems with null
- * @throws NullPointerException if `interfaces' is null or contains
- * a null entry, or if handler is null
- * @see Configuration.HAVE_NATIVE_GET_PROXY_DATA
- * @see #getProxyClass(ClassLoader, Class[])
- * @see #getProxyClass0(ClassLoader, Class[])
- * @see ProxyType#getProxyData()
- */
- private static native ProxyData getProxyData0(ClassLoader loader,
- Class[] interfaces);
-
- /**
- * Optional native method to replace (and speed up) the pure Java
- * implementation of generateProxyClass. Only needed if
- * Configuration.HAVE_NATIVE_GENERATE_PROXY_CLASS is true. The native
- * code may safely assume that a new Class must be created, and that
- * the ProxyData object does not describe any existing class.
- *
- * @param loader the class loader to define the proxy class in; null
- * implies the bootstrap class loader
- * @param data the struct of information to convert to a Class. This
- * has already been verified for all problems except exceeding
- * VM limitations
- * @return the newly generated class
- * @throws IllegalArgumentException if VM limitations are exceeded
- * @see #getProxyClass(ClassLoader, Class[])
- * @see #getProxyClass0(ClassLoader, Class[])
- * @see ProxyData#generateProxyClass(ClassLoader)
- */
- private static native Class generateProxyClass0(ClassLoader loader,
- ProxyData data);
-
- /**
- * Helper class for mapping unique ClassLoader and interface combinations
- * to proxy classes.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class ProxyType
- {
- /**
- * Store the class loader (may be null)
- */
- final ClassLoader loader;
-
- /**
- * Store the interfaces (never null, all elements are interfaces)
- */
- final Class[] interfaces;
-
- /**
- * Construct the helper object.
- *
- * @param loader the class loader to define the proxy class in; null
- * implies the bootstrap class loader
- * @param interfaces an array of interfaces
- */
- ProxyType(ClassLoader loader, Class[] interfaces)
- {
- if (loader == null)
- loader = ClassLoader.getSystemClassLoader();
- this.loader = loader;
- this.interfaces = interfaces;
- }
-
- /**
- * Calculates the hash code.
- *
- * @return a combination of the classloader and interfaces hashcodes.
- */
- public int hashCode()
- {
- //loader is always not null
- int hash = loader.hashCode();
- for (int i = 0; i < interfaces.length; i++)
- hash = hash * 31 + interfaces[i].hashCode();
- return hash;
- }
-
- // A more comprehensive comparison of two arrays,
- // ignore array element order, and
- // ignore redundant elements
- private static boolean sameTypes(Class arr1[], Class arr2[]) {
- if (arr1.length == 1 && arr2.length == 1) {
- return arr1[0] == arr2[0];
- }
-
- // total occurrance of elements of arr1 in arr2
- int total_occ_of_arr1_in_arr2 = 0;
- each_type:
- for (int i = arr1.length; --i >= 0; )
- {
- Class t = arr1[i];
- for (int j = i; --j >= 0; )
- {
- if (t == arr1[j])
- { //found duplicate type
- continue each_type;
- }
- }
-
- // count c(a unique element of arr1)'s
- // occurrences in arr2
- int occ_in_arr2 = 0;
- for (int j = arr2.length; --j >= 0; )
- {
- if (t == arr2[j])
- {
- ++occ_in_arr2;
- }
- }
- if (occ_in_arr2 == 0)
- { // t does not occur in arr2
- return false;
- }
-
- total_occ_of_arr1_in_arr2 += occ_in_arr2;
- }
- // now, each element of arr2 must have been visited
- return total_occ_of_arr1_in_arr2 == arr2.length;
- }
-
- /**
- * Calculates equality.
- *
- * @param the object to compare to
- * @return true if it is a ProxyType with same data
- */
- public boolean equals(Object other)
- {
- ProxyType pt = (ProxyType) other;
- if (loader != pt.loader || interfaces.length != pt.interfaces.length)
- return false;
- return sameTypes(interfaces, pt.interfaces);
- }
- } // class ProxyType
-
- /**
- * Helper class which allows hashing of a method name and signature
- * without worrying about return type, declaring class, or throws clause,
- * and which reduces the maximally common throws clause between two methods
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class ProxySignature
- {
- /**
- * The core signatures which all Proxy instances handle.
- */
- static final HashMap coreMethods = new HashMap();
- static
- {
- try
- {
- ProxySignature sig
- = new ProxySignature(Object.class
- .getMethod("equals",
- new Class[] {Object.class}));
- coreMethods.put(sig, sig);
- sig = new ProxySignature(Object.class.getMethod("hashCode", null));
- coreMethods.put(sig, sig);
- sig = new ProxySignature(Object.class.getMethod("toString", null));
- coreMethods.put(sig, sig);
- }
- catch (Exception e)
- {
- // assert false;
- throw (Error) new InternalError("Unexpected: " + e).initCause(e);
- }
- }
-
- /**
- * The underlying Method object, never null
- */
- final Method method;
-
- /**
- * The set of compatible thrown exceptions, may be empty
- */
- final Set exceptions = new HashSet();
-
- /**
- * Construct a signature
- *
- * @param method the Method this signature is based on, never null
- */
- ProxySignature(Method method)
- {
- this.method = method;
- Class[] exc = method.getExceptionTypes();
- int i = exc.length;
- while (--i >= 0)
- {
- // discard unchecked exceptions
- if (Error.class.isAssignableFrom(exc[i])
- || RuntimeException.class.isAssignableFrom(exc[i]))
- continue;
- exceptions.add(exc[i]);
- }
- }
-
- /**
- * Given a method, make sure it's return type is identical
- * to this, and adjust this signature's throws clause appropriately
- *
- * @param other the signature to merge in
- * @throws IllegalArgumentException if the return types conflict
- */
- void checkCompatibility(ProxySignature other)
- {
- if (method.getReturnType() != other.method.getReturnType())
- throw new IllegalArgumentException("incompatible return types: "
- + method + ", " + other.method);
-
- // if you can think of a more efficient way than this O(n^2) search,
- // implement it!
- int size1 = exceptions.size();
- int size2 = other.exceptions.size();
- boolean[] valid1 = new boolean[size1];
- boolean[] valid2 = new boolean[size2];
- Iterator itr = exceptions.iterator();
- int pos = size1;
- while (--pos >= 0)
- {
- Class c1 = (Class) itr.next();
- Iterator itr2 = other.exceptions.iterator();
- int pos2 = size2;
- while (--pos2 >= 0)
- {
- Class c2 = (Class) itr2.next();
- if (c2.isAssignableFrom(c1))
- valid1[pos] = true;
- if (c1.isAssignableFrom(c2))
- valid2[pos2] = true;
- }
- }
- pos = size1;
- itr = exceptions.iterator();
- while (--pos >= 0)
- {
- itr.next();
- if (! valid1[pos])
- itr.remove();
- }
- pos = size2;
- itr = other.exceptions.iterator();
- while (--pos >= 0)
- {
- itr.next();
- if (! valid2[pos])
- itr.remove();
- }
- exceptions.addAll(other.exceptions);
- }
-
- /**
- * Calculates the hash code.
- *
- * @return a combination of name and parameter types
- */
- public int hashCode()
- {
- int hash = method.getName().hashCode();
- Class[] types = method.getParameterTypes();
- for (int i = 0; i < types.length; i++)
- hash = hash * 31 + types[i].hashCode();
- return hash;
- }
-
- /**
- * Calculates equality.
- *
- * @param the object to compare to
- * @return true if it is a ProxySignature with same data
- */
- public boolean equals(Object other)
- {
- ProxySignature ps = (ProxySignature) other;
- Class[] types1 = method.getParameterTypes();
- Class[] types2 = ps.method.getParameterTypes();
- if (! method.getName().equals(ps.method.getName())
- || types1.length != types2.length)
- return false;
- int i = types1.length;
- while (--i >= 0)
- if (types1[i] != types2[i])
- return false;
- return true;
- }
- } // class ProxySignature
-
- /**
- * A flat representation of all data needed to generate bytecode/instantiate
- * a proxy class. This is basically a struct.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class ProxyData
- {
- /**
- * The package this class is in <b>including the trailing dot</b>
- * or an empty string for the unnamed (aka default) package.
- */
- String pack;
-
- /**
- * The interfaces this class implements. Non-null, but possibly empty.
- */
- Class[] interfaces;
-
- /**
- * The Method objects this class must pass as the second argument to
- * invoke (also useful for determining what methods this class has).
- * Non-null, non-empty (includes at least Object.hashCode, Object.equals,
- * and Object.toString).
- */
- Method[] methods;
-
- /**
- * The exceptions that do not need to be wrapped in
- * UndeclaredThrowableException. exceptions[i] is the same as, or a
- * subset of subclasses, of methods[i].getExceptionTypes(), depending on
- * compatible throws clauses with multiple inheritance. It is unspecified
- * if these lists include or exclude subclasses of Error and
- * RuntimeException, but excluding them is harmless and generates a
- * smaller class.
- */
- Class[][] exceptions;
-
- /**
- * For unique id's
- */
- private static int count;
-
- /**
- * The id of this proxy class
- */
- final int id = count++;
-
- /**
- * Construct a ProxyData with uninitialized data members.
- */
- ProxyData()
- {
- }
-
- /**
- * Return the name of a package (including the trailing dot)
- * given the name of a class.
- * Returns an empty string if no package. We use this in preference to
- * using Class.getPackage() to avoid problems with ClassLoaders
- * that don't set the package.
- */
- private static String getPackage(Class k)
- {
- String name = k.getName();
- int idx = name.lastIndexOf('.');
- return name.substring(0, idx + 1);
- }
-
- /**
- * Verifies that the arguments are legal, and sets up remaining data
- * This should only be called when a class must be generated, as
- * it is expensive.
- *
- * @param pt the ProxyType to convert to ProxyData
- * @return the flattened, verified ProxyData structure for use in
- * class generation
- * @throws IllegalArgumentException if `interfaces' contains
- * non-interfaces or incompatible combinations, and verify is true
- * @throws NullPointerException if interfaces is null or contains null
- */
- static ProxyData getProxyData(ProxyType pt)
- {
- Map method_set = (Map) ProxySignature.coreMethods.clone();
- boolean in_package = false; // true if we encounter non-public interface
-
- ProxyData data = new ProxyData();
- data.interfaces = pt.interfaces;
-
- // if interfaces is too large, we croak later on when the constant
- // pool overflows
- int i = data.interfaces.length;
- while (--i >= 0)
- {
- Class inter = data.interfaces[i];
- if (! inter.isInterface())
- throw new IllegalArgumentException("not an interface: " + inter);
- try
- {
- if (Class.forName(inter.getName(), false, pt.loader) != inter)
- throw new IllegalArgumentException("not accessible in "
- + "classloader: " + inter);
- }
- catch (ClassNotFoundException e)
- {
- throw new IllegalArgumentException("not accessible in "
- + "classloader: " + inter);
- }
- if (! Modifier.isPublic(inter.getModifiers()))
- if (in_package)
- {
- String p = getPackage(inter);
- if (! data.pack.equals(p))
- throw new IllegalArgumentException("non-public interfaces "
- + "from different "
- + "packages");
- }
- else
- {
- in_package = true;
- data.pack = getPackage(inter);
- }
- for (int j = i-1; j >= 0; j--)
- if (data.interfaces[j] == inter)
- throw new IllegalArgumentException("duplicate interface: "
- + inter);
- Method[] methods = inter.getMethods();
- int j = methods.length;
- while (--j >= 0)
- {
- ProxySignature sig = new ProxySignature(methods[j]);
- ProxySignature old = (ProxySignature) method_set.put(sig, sig);
- if (old != null)
- sig.checkCompatibility(old);
- }
- }
-
- i = method_set.size();
- data.methods = new Method[i];
- data.exceptions = new Class[i][];
- Iterator itr = method_set.values().iterator();
- while (--i >= 0)
- {
- ProxySignature sig = (ProxySignature) itr.next();
- data.methods[i] = sig.method;
- data.exceptions[i] = (Class[]) sig.exceptions
- .toArray(new Class[sig.exceptions.size()]);
- }
- return data;
- }
- } // class ProxyData
-
- /**
- * Does all the work of building a class. By making this a nested class,
- * this code is not loaded in memory if the VM has a native
- * implementation instead.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class ClassFactory
- {
- /** Constants for assisting the compilation */
- private static final byte POOL = 0;
- private static final byte FIELD = 1;
- private static final byte METHOD = 2;
- private static final byte INTERFACE = 3;
- private static final String CTOR_SIG
- = "(Ljava/lang/reflect/InvocationHandler;)V";
- private static final String INVOKE_SIG = "(Ljava/lang/Object;"
- + "Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;";
-
- /** Bytecodes for insertion in the class definition byte[] */
- private static final char ACONST_NULL = 1;
- private static final char ICONST_0 = 3;
- private static final char BIPUSH = 16;
- private static final char SIPUSH = 17;
- private static final char ILOAD = 21;
- private static final char ILOAD_0 = 26;
- private static final char ALOAD_0 = 42;
- private static final char ALOAD_1 = 43;
- private static final char AALOAD = 50;
- private static final char AASTORE = 83;
- private static final char DUP = 89;
- private static final char DUP_X1 = 90;
- private static final char SWAP = 95;
- private static final char IRETURN = 172;
- private static final char LRETURN = 173;
- private static final char FRETURN = 174;
- private static final char DRETURN = 175;
- private static final char ARETURN = 176;
- private static final char RETURN = 177;
- private static final char GETSTATIC = 178;
- private static final char GETFIELD = 180;
- private static final char INVOKEVIRTUAL = 182;
- private static final char INVOKESPECIAL = 183;
- private static final char INVOKESTATIC = 184;
- private static final char INVOKEINTERFACE = 185;
- private static final char NEW = 187;
- private static final char ANEWARRAY = 189;
- private static final char ATHROW = 191;
- private static final char CHECKCAST = 192;
-
- // Implementation note: we use StringBuffers to hold the byte data, since
- // they automatically grow. However, we only use the low 8 bits of
- // every char in the array, so we are using twice the necessary memory
- // for the ease StringBuffer provides.
-
- /** The constant pool. */
- private final StringBuffer pool = new StringBuffer();
- /** The rest of the class data. */
- private final StringBuffer stream = new StringBuffer();
-
- /** Map of strings to byte sequences, to minimize size of pool. */
- private final Map poolEntries = new HashMap();
-
- /** The VM name of this proxy class. */
- private final String qualName;
-
- /**
- * The Method objects the proxy class refers to when calling the
- * invocation handler.
- */
- private final Method[] methods;
-
- /**
- * Initializes the buffers with the bytecode contents for a proxy class.
- *
- * @param data the remainder of the class data
- * @throws IllegalArgumentException if anything else goes wrong this
- * late in the game; as far as I can tell, this will only happen
- * if the constant pool overflows, which is possible even when
- * the user doesn't exceed the 65535 interface limit
- */
- ClassFactory(ProxyData data)
- {
- methods = data.methods;
-
- // magic = 0xcafebabe
- // minor_version = 0
- // major_version = 46
- // constant_pool_count: place-holder for now
- pool.append("\u00ca\u00fe\u00ba\u00be\0\0\0\56\0\0");
- // constant_pool[], filled in as we go
-
- // access_flags
- putU2(Modifier.SUPER | Modifier.FINAL | Modifier.PUBLIC);
- // this_class
- qualName = (data.pack + "$Proxy" + data.id);
- putU2(classInfo(TypeSignature.getEncodingOfClass(qualName, false)));
- // super_class
- putU2(classInfo("java/lang/reflect/Proxy"));
-
- // interfaces_count
- putU2(data.interfaces.length);
- // interfaces[]
- for (int i = 0; i < data.interfaces.length; i++)
- putU2(classInfo(data.interfaces[i]));
-
- // Recall that Proxy classes serialize specially, so we do not need
- // to worry about a <clinit> method for this field. Instead, we
- // just assign it by reflection after the class is successfully loaded.
- // fields_count - private static Method[] m;
- putU2(1);
- // fields[]
- // m.access_flags
- putU2(Modifier.PRIVATE | Modifier.STATIC);
- // m.name_index
- putU2(utf8Info("m"));
- // m.descriptor_index
- putU2(utf8Info("[Ljava/lang/reflect/Method;"));
- // m.attributes_count
- putU2(0);
- // m.attributes[]
-
- // methods_count - # handler methods, plus <init>
- putU2(methods.length + 1);
- // methods[]
- // <init>.access_flags
- putU2(Modifier.PUBLIC);
- // <init>.name_index
- putU2(utf8Info("<init>"));
- // <init>.descriptor_index
- putU2(utf8Info(CTOR_SIG));
- // <init>.attributes_count - only Code is needed
- putU2(1);
- // <init>.Code.attribute_name_index
- putU2(utf8Info("Code"));
- // <init>.Code.attribute_length = 18
- // <init>.Code.info:
- // $Proxynn(InvocationHandler h) { super(h); }
- // <init>.Code.max_stack = 2
- // <init>.Code.max_locals = 2
- // <init>.Code.code_length = 6
- // <init>.Code.code[]
- stream.append("\0\0\0\22\0\2\0\2\0\0\0\6" + ALOAD_0 + ALOAD_1
- + INVOKESPECIAL);
- putU2(refInfo(METHOD, "java/lang/reflect/Proxy", "<init>", CTOR_SIG));
- // <init>.Code.exception_table_length = 0
- // <init>.Code.exception_table[]
- // <init>.Code.attributes_count = 0
- // <init>.Code.attributes[]
- stream.append(RETURN + "\0\0\0\0");
-
- for (int i = methods.length - 1; i >= 0; i--)
- emitMethod(i, data.exceptions[i]);
-
- // attributes_count
- putU2(0);
- // attributes[] - empty; omit SourceFile attribute
- // XXX should we mark this with a Synthetic attribute?
- }
-
- /**
- * Produce the bytecode for a single method.
- *
- * @param i the index of the method we are building
- * @param e the exceptions possible for the method
- */
- private void emitMethod(int i, Class[] e)
- {
- // First, we precalculate the method length and other information.
-
- Method m = methods[i];
- Class[] paramtypes = m.getParameterTypes();
- int wrap_overhead = 0; // max words taken by wrapped primitive
- int param_count = 1; // 1 for this
- int code_length = 16; // aload_0, getfield, aload_0, getstatic, const,
- // aaload, const/aconst_null, invokeinterface
- if (i > 5)
- {
- if (i > Byte.MAX_VALUE)
- code_length += 2; // sipush
- else
- code_length++; // bipush
- }
- if (paramtypes.length > 0)
- {
- code_length += 3; // anewarray
- if (paramtypes.length > Byte.MAX_VALUE)
- code_length += 2; // sipush
- else if (paramtypes.length > 5)
- code_length++; // bipush
- for (int j = 0; j < paramtypes.length; j++)
- {
- code_length += 4; // dup, const, load, store
- Class type = paramtypes[j];
- if (j > 5)
- {
- if (j > Byte.MAX_VALUE)
- code_length += 2; // sipush
- else
- code_length++; // bipush
- }
- if (param_count >= 4)
- code_length++; // 2-byte load
- param_count++;
- if (type.isPrimitive())
- {
- code_length += 7; // new, dup, invokespecial
- if (type == long.class || type == double.class)
- {
- wrap_overhead = 3;
- param_count++;
- }
- else if (wrap_overhead < 2)
- wrap_overhead = 2;
- }
- }
- }
- int end_pc = code_length;
- Class ret_type = m.getReturnType();
- if (ret_type == void.class)
- code_length++; // return
- else if (ret_type.isPrimitive())
- code_length += 7; // cast, invokevirtual, return
- else
- code_length += 4; // cast, return
- int exception_count = 0;
- boolean throws_throwable = false;
- for (int j = 0; j < e.length; j++)
- if (e[j] == Throwable.class)
- {
- throws_throwable = true;
- break;
- }
- if (! throws_throwable)
- {
- exception_count = e.length + 3; // Throwable, Error, RuntimeException
- code_length += 9; // new, dup_x1, swap, invokespecial, athrow
- }
- int handler_pc = code_length - 1;
- StringBuffer signature = new StringBuffer("(");
- for (int j = 0; j < paramtypes.length; j++)
- signature.append(TypeSignature.getEncodingOfClass(paramtypes[j]));
- signature.append(")").append(TypeSignature.getEncodingOfClass(ret_type));
-
- // Now we have enough information to emit the method.
-
- // handler.access_flags
- putU2(Modifier.PUBLIC | Modifier.FINAL);
- // handler.name_index
- putU2(utf8Info(m.getName()));
- // handler.descriptor_index
- putU2(utf8Info(signature.toString()));
- // handler.attributes_count - Code is necessary, Exceptions possible
- putU2(e.length > 0 ? 2 : 1);
-
- // handler.Code.info:
- // type name(args) {
- // try {
- // return (type) h.invoke(this, methods[i], new Object[] {args});
- // } catch (<declared Exceptions> e) {
- // throw e;
- // } catch (Throwable t) {
- // throw new UndeclaredThrowableException(t);
- // }
- // }
- // Special cases:
- // if arg_n is primitive, wrap it
- // if method throws Throwable, try-catch is not needed
- // if method returns void, return statement not needed
- // if method returns primitive, unwrap it
- // save space by sharing code for all the declared handlers
-
- // handler.Code.attribute_name_index
- putU2(utf8Info("Code"));
- // handler.Code.attribute_length
- putU4(12 + code_length + 8 * exception_count);
- // handler.Code.max_stack
- putU2(param_count == 1 ? 4 : 7 + wrap_overhead);
- // handler.Code.max_locals
- putU2(param_count);
- // handler.Code.code_length
- putU4(code_length);
- // handler.Code.code[]
- putU1(ALOAD_0);
- putU1(GETFIELD);
- putU2(refInfo(FIELD, "java/lang/reflect/Proxy", "h",
- "Ljava/lang/reflect/InvocationHandler;"));
- putU1(ALOAD_0);
- putU1(GETSTATIC);
- putU2(refInfo(FIELD, TypeSignature.getEncodingOfClass(qualName, false),
- "m", "[Ljava/lang/reflect/Method;"));
- putConst(i);
- putU1(AALOAD);
- if (paramtypes.length > 0)
- {
- putConst(paramtypes.length);
- putU1(ANEWARRAY);
- putU2(classInfo("java/lang/Object"));
- param_count = 1;
- for (int j = 0; j < paramtypes.length; j++, param_count++)
- {
- putU1(DUP);
- putConst(j);
- if (paramtypes[j].isPrimitive())
- {
- putU1(NEW);
- putU2(classInfo(wrapper(paramtypes[j])));
- putU1(DUP);
- }
- putLoad(param_count, paramtypes[j]);
- if (paramtypes[j].isPrimitive())
- {
- putU1(INVOKESPECIAL);
- putU2(refInfo(METHOD, wrapper(paramtypes[j]), "<init>",
- '(' + (TypeSignature
- .getEncodingOfClass(paramtypes[j])
- + ")V")));
- if (paramtypes[j] == long.class
- || paramtypes[j] == double.class)
- param_count++;
- }
- putU1(AASTORE);
- }
- }
- else
- putU1(ACONST_NULL);
- putU1(INVOKEINTERFACE);
- putU2(refInfo(INTERFACE, "java/lang/reflect/InvocationHandler",
- "invoke", INVOKE_SIG));
- putU1(4); // InvocationHandler, this, Method, Object[]
- putU1(0);
- if (ret_type == void.class)
- putU1(RETURN);
- else if (ret_type.isPrimitive())
- {
- putU1(CHECKCAST);
- putU2(classInfo(wrapper(ret_type)));
- putU1(INVOKEVIRTUAL);
- putU2(refInfo(METHOD, wrapper(ret_type),
- ret_type.getName() + "Value",
- "()" + TypeSignature.getEncodingOfClass(ret_type)));
- if (ret_type == long.class)
- putU1(LRETURN);
- else if (ret_type == float.class)
- putU1(FRETURN);
- else if (ret_type == double.class)
- putU1(DRETURN);
- else
- putU1(IRETURN);
- }
- else
- {
- putU1(CHECKCAST);
- putU2(classInfo(ret_type));
- putU1(ARETURN);
- }
- if (! throws_throwable)
- {
- putU1(NEW);
- putU2(classInfo("java/lang/reflect/UndeclaredThrowableException"));
- putU1(DUP_X1);
- putU1(SWAP);
- putU1(INVOKESPECIAL);
- putU2(refInfo(METHOD,
- "java/lang/reflect/UndeclaredThrowableException",
- "<init>", "(Ljava/lang/Throwable;)V"));
- putU1(ATHROW);
- }
-
- // handler.Code.exception_table_length
- putU2(exception_count);
- // handler.Code.exception_table[]
- if (! throws_throwable)
- {
- // handler.Code.exception_table.start_pc
- putU2(0);
- // handler.Code.exception_table.end_pc
- putU2(end_pc);
- // handler.Code.exception_table.handler_pc
- putU2(handler_pc);
- // handler.Code.exception_table.catch_type
- putU2(classInfo("java/lang/Error"));
- // handler.Code.exception_table.start_pc
- putU2(0);
- // handler.Code.exception_table.end_pc
- putU2(end_pc);
- // handler.Code.exception_table.handler_pc
- putU2(handler_pc);
- // handler.Code.exception_table.catch_type
- putU2(classInfo("java/lang/RuntimeException"));
- for (int j = 0; j < e.length; j++)
- {
- // handler.Code.exception_table.start_pc
- putU2(0);
- // handler.Code.exception_table.end_pc
- putU2(end_pc);
- // handler.Code.exception_table.handler_pc
- putU2(handler_pc);
- // handler.Code.exception_table.catch_type
- putU2(classInfo(e[j]));
- }
- // handler.Code.exception_table.start_pc
- putU2(0);
- // handler.Code.exception_table.end_pc
- putU2(end_pc);
- // handler.Code.exception_table.handler_pc -
- // -8 for undeclared handler, which falls thru to normal one
- putU2(handler_pc - 8);
- // handler.Code.exception_table.catch_type
- putU2(0);
- }
- // handler.Code.attributes_count
- putU2(0);
- // handler.Code.attributes[]
-
- if (e.length > 0)
- {
- // handler.Exceptions.attribute_name_index
- putU2(utf8Info("Exceptions"));
- // handler.Exceptions.attribute_length
- putU4(2 * e.length + 2);
- // handler.Exceptions.number_of_exceptions
- putU2(e.length);
- // handler.Exceptions.exception_index_table[]
- for (int j = 0; j < e.length; j++)
- putU2(classInfo(e[j]));
- }
- }
-
- /**
- * Creates the Class object that corresponds to the bytecode buffers
- * built when this object was constructed.
- *
- * @param loader the class loader to define the proxy class in; null
- * implies the bootstrap class loader
- * @return the proxy class Class object
- */
- Class generate(ClassLoader loader)
- {
- byte[] bytecode = new byte[pool.length() + stream.length()];
- // More efficient to bypass calling charAt() repetitively.
- char[] c = pool.toString().toCharArray();
- int i = c.length;
- while (--i >= 0)
- bytecode[i] = (byte) c[i];
- c = stream.toString().toCharArray();
- i = c.length;
- int j = bytecode.length;
- while (i > 0)
- bytecode[--j] = (byte) c[--i];
-
- // Patch the constant pool size, which we left at 0 earlier.
- int count = poolEntries.size() + 1;
- bytecode[8] = (byte) (count >> 8);
- bytecode[9] = (byte) count;
-
- try
- {
- Class vmClassLoader = Class.forName("java.lang.VMClassLoader");
- Class[] types = {ClassLoader.class, String.class,
- byte[].class, int.class, int.class,
- ProtectionDomain.class };
- Method m = vmClassLoader.getDeclaredMethod("defineClass", types);
- // We can bypass the security check of setAccessible(true), since
- // we're in the same package.
- m.flag = true;
-
- Object[] args = {loader, qualName, bytecode, new Integer(0),
- new Integer(bytecode.length),
- Object.class.getProtectionDomain() };
- Class clazz = (Class) m.invoke(null, args);
-
- // Finally, initialize the m field of the proxy class, before
- // returning it.
- Field f = clazz.getDeclaredField("m");
- f.flag = true;
- // we can share the array, because it is not publicized
- f.set(null, methods);
-
- return clazz;
- }
- catch (Exception e)
- {
- // assert false;
- throw (Error) new InternalError("Unexpected: " + e).initCause(e);
- }
- }
-
- /**
- * Put a single byte on the stream.
- *
- * @param i the information to add (only lowest 8 bits are used)
- */
- private void putU1(int i)
- {
- stream.append((char) i);
- }
-
- /**
- * Put two bytes on the stream.
- *
- * @param i the information to add (only lowest 16 bits are used)
- */
- private void putU2(int i)
- {
- stream.append((char) (i >> 8)).append((char) i);
- }
-
- /**
- * Put four bytes on the stream.
- *
- * @param i the information to add (treated as unsigned)
- */
- private void putU4(int i)
- {
- stream.append((char) (i >> 24)).append((char) (i >> 16));
- stream.append((char) (i >> 8)).append((char) i);
- }
-
- /**
- * Put bytecode to load a constant integer on the stream. This only
- * needs to work for values less than Short.MAX_VALUE.
- *
- * @param i the int to add
- */
- private void putConst(int i)
- {
- if (i >= -1 && i <= 5)
- putU1(ICONST_0 + i);
- else if (i >= Byte.MIN_VALUE && i <= Byte.MAX_VALUE)
- {
- putU1(BIPUSH);
- putU1(i);
- }
- else
- {
- putU1(SIPUSH);
- putU2(i);
- }
- }
-
- /**
- * Put bytecode to load a given local variable on the stream.
- *
- * @param i the slot to load
- * @param type the base type of the load
- */
- private void putLoad(int i, Class type)
- {
- int offset = 0;
- if (type == long.class)
- offset = 1;
- else if (type == float.class)
- offset = 2;
- else if (type == double.class)
- offset = 3;
- else if (! type.isPrimitive())
- offset = 4;
- if (i < 4)
- putU1(ILOAD_0 + 4 * offset + i);
- else
- {
- putU1(ILOAD + offset);
- putU1(i);
- }
- }
-
- /**
- * Given a primitive type, return its wrapper class name.
- *
- * @param clazz the primitive type (but not void.class)
- * @return the internal form of the wrapper class name
- */
- private String wrapper(Class clazz)
- {
- if (clazz == boolean.class)
- return "java/lang/Boolean";
- if (clazz == byte.class)
- return "java/lang/Byte";
- if (clazz == short.class)
- return "java/lang/Short";
- if (clazz == char.class)
- return "java/lang/Character";
- if (clazz == int.class)
- return "java/lang/Integer";
- if (clazz == long.class)
- return "java/lang/Long";
- if (clazz == float.class)
- return "java/lang/Float";
- if (clazz == double.class)
- return "java/lang/Double";
- // assert false;
- return null;
- }
-
- /**
- * Returns the entry of this String in the Constant pool, adding it
- * if necessary.
- *
- * @param str the String to resolve
- * @return the index of the String in the constant pool
- */
- private char utf8Info(String str)
- {
- String utf8 = toUtf8(str);
- int len = utf8.length();
- return poolIndex("\1" + (char) (len >> 8) + (char) (len & 0xff) + utf8);
- }
-
- /**
- * Returns the entry of the appropriate class info structure in the
- * Constant pool, adding it if necessary.
- *
- * @param name the class name, in internal form
- * @return the index of the ClassInfo in the constant pool
- */
- private char classInfo(String name)
- {
- char index = utf8Info(name);
- char[] c = {7, (char) (index >> 8), (char) (index & 0xff)};
- return poolIndex(new String(c));
- }
-
- /**
- * Returns the entry of the appropriate class info structure in the
- * Constant pool, adding it if necessary.
- *
- * @param clazz the class type
- * @return the index of the ClassInfo in the constant pool
- */
- private char classInfo(Class clazz)
- {
- return classInfo(TypeSignature.getEncodingOfClass(clazz.getName(),
- false));
- }
-
- /**
- * Returns the entry of the appropriate fieldref, methodref, or
- * interfacemethodref info structure in the Constant pool, adding it
- * if necessary.
- *
- * @param structure FIELD, METHOD, or INTERFACE
- * @param clazz the class name, in internal form
- * @param name the simple reference name
- * @param type the type of the reference
- * @return the index of the appropriate Info structure in the constant pool
- */
- private char refInfo(byte structure, String clazz, String name,
- String type)
- {
- char cindex = classInfo(clazz);
- char ntindex = nameAndTypeInfo(name, type);
- // relies on FIELD == 1, METHOD == 2, INTERFACE == 3
- char[] c = {(char) (structure + 8),
- (char) (cindex >> 8), (char) (cindex & 0xff),
- (char) (ntindex >> 8), (char) (ntindex & 0xff)};
- return poolIndex(new String(c));
- }
-
- /**
- * Returns the entry of the appropriate nameAndTyperef info structure
- * in the Constant pool, adding it if necessary.
- *
- * @param name the simple name
- * @param type the reference type
- * @return the index of the NameAndTypeInfo structure in the constant pool
- */
- private char nameAndTypeInfo(String name, String type)
- {
- char nindex = utf8Info(name);
- char tindex = utf8Info(type);
- char[] c = {12, (char) (nindex >> 8), (char) (nindex & 0xff),
- (char) (tindex >> 8), (char) (tindex & 0xff)};
- return poolIndex(new String(c));
- }
-
- /**
- * Converts a regular string to a UTF8 string, where the upper byte
- * of every char is 0, and '\\u0000' is not in the string. This is
- * basically to use a String as a fancy byte[], and while it is less
- * efficient in memory use, it is easier for hashing.
- *
- * @param str the original, in straight unicode
- * @return a modified string, in UTF8 format in the low bytes
- */
- private String toUtf8(String str)
- {
- final char[] ca = str.toCharArray();
- final int len = ca.length;
-
- // Avoid object creation, if str is already fits UTF8.
- int i;
- for (i = 0; i < len; i++)
- if (ca[i] == 0 || ca[i] > '\u007f')
- break;
- if (i == len)
- return str;
-
- final StringBuffer sb = new StringBuffer(str);
- sb.setLength(i);
- for ( ; i < len; i++)
- {
- final char c = ca[i];
- if (c > 0 && c <= '\u007f')
- sb.append(c);
- else if (c <= '\u07ff') // includes '\0'
- {
- sb.append((char) (0xc0 | (c >> 6)));
- sb.append((char) (0x80 | (c & 0x6f)));
- }
- else
- {
- sb.append((char) (0xe0 | (c >> 12)));
- sb.append((char) (0x80 | ((c >> 6) & 0x6f)));
- sb.append((char) (0x80 | (c & 0x6f)));
- }
- }
- return sb.toString();
- }
-
- /**
- * Returns the location of a byte sequence (conveniently wrapped in
- * a String with all characters between \u0001 and \u00ff inclusive)
- * in the constant pool, adding it if necessary.
- *
- * @param sequence the byte sequence to look for
- * @return the index of the sequence
- * @throws IllegalArgumentException if this would make the constant
- * pool overflow
- */
- private char poolIndex(String sequence)
- {
- Integer i = (Integer) poolEntries.get(sequence);
- if (i == null)
- {
- // pool starts at index 1
- int size = poolEntries.size() + 1;
- if (size >= 65535)
- throw new IllegalArgumentException("exceeds VM limitations");
- i = new Integer(size);
- poolEntries.put(sequence, i);
- pool.append(sequence);
- }
- return (char) i.intValue();
- }
- } // class ClassFactory
-}
diff --git a/libjava/java/lang/reflect/ReflectPermission.java b/libjava/java/lang/reflect/ReflectPermission.java
deleted file mode 100644
index 56eccf8130c..00000000000
--- a/libjava/java/lang/reflect/ReflectPermission.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* ReflectPermission.java - named permission for reflaction
- Copyright (C) 2000, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.reflect;
-
-import java.security.BasicPermission;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- */
-
-/**
- * This class implements permissions for reflection. This is a named
- * permission, and the only defined name is suppressAccessChecks, which
- * allows suppression of normal Java objects when using reflection.
- *
- * <table>
- * <tr>
- * <th>Permission Target Name</th>
- * <th>What Permission Allows</th>
- * <th>Risk of Allowing Permission</th>
- * </tr>
- * <tr>
- * <td><code>suppressAccessChecks</code></td>
- * <td>Ability to access fields, invoke methods, and construct objects
- * via reflection, including non-public members in contexts where
- * such access is not legal at compile-time.</td>
- * <td>This is dangerous. It exposes possibly confidential information,
- * and malicious code could interfere with the internals of the Virtual
- * Machine by corrupting private data.</td>
- * </tr>
- * </table>
- *
- * @author Tom Tromey (tromey@redhat.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public final class ReflectPermission
- extends BasicPermission
-{
- /**
- * Compatible with JDK 1.2.
- */
- private static final long serialVersionUID = 7412737110241507485L;
-
- /**
- * Construct a ReflectPermission with the given name.
- *
- * @param name The permission name
- */
- public ReflectPermission(String name)
- {
- super(name);
- }
-
- /**
- * Construct a ReflectPermission with the given name.
- *
- * @param name The permission name
- * @param actions The actions; this is ignored and should be null
- */
- public ReflectPermission(String name, String actions)
- {
- super(name, actions);
- }
-}
diff --git a/libjava/java/lang/reflect/UndeclaredThrowableException.java b/libjava/java/lang/reflect/UndeclaredThrowableException.java
deleted file mode 100644
index 6d5a8008459..00000000000
--- a/libjava/java/lang/reflect/UndeclaredThrowableException.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* UndeclaredThrowableException.java -- wraps an undeclared checked exception
- thrown by a Proxy invocation handler
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.lang.reflect;
-
-/**
- * This exception class is thrown by a {@link Proxy} instance if
- * the {@link InvocationHandler#invoke(Object, Method, Object[]) invoke}
- * method of that instance's InvocationHandler attempts to throw an
- * exception that not declared by the throws clauses of all of the
- * interface methods that the proxy instance is implementing.
- *
- * <p>When thrown by Proxy, this class will always wrap a checked
- * exception, never {@link Error} or {@link RuntimeException},
- * which are unchecked.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Proxy
- * @see InvocationHandler
- * @since 1.3
- * @status updated to 1.4
- */
-public class UndeclaredThrowableException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.3+.
- */
- private static final long serialVersionUID = 330127114055056639L;
-
- /**
- * The immutable exception that this wraps. This field is redundant
- * with {@link Throwable#cause}, but is necessary for serial compatibility.
- *
- * @serial the chained exception
- */
- private final Throwable undeclaredThrowable;
-
- /**
- * Wraps the given checked exception into a RuntimeException, with no
- * detail message. {@link Throwable#initCause(Throwable)} will fail
- * on this instance.
- *
- * @param cause the undeclared throwable that caused this exception,
- * may be null
- */
- public UndeclaredThrowableException(Throwable cause)
- {
- this(cause, null);
- }
-
- /**
- * Wraps the given checked exception into a RuntimeException, with the
- * specified detail message. {@link Throwable#initCause(Throwable)} will
- * fail on this instance.
- *
- * @param cause the undeclared throwable that caused this exception,
- * may be null
- * @param message the message, may be null
- */
- public UndeclaredThrowableException(Throwable cause, String message)
- {
- super(message, cause);
- undeclaredThrowable = cause;
- }
-
- /**
- * Returns the cause of this exception. If this exception was created
- * by a {@link Proxy} instance, it will be a non-null checked
- * exception. This method pre-dates exception chaining, and is now
- * simply a longer way to call <code>getCause()</code>.
- *
- * @return the cause of this exception, may be null
- * @see #getCause()
- */
- public Throwable getUndeclaredThrowable()
- {
- return undeclaredThrowable;
- }
-
- /**
- * Returns the cause of this exception. If this exception was created
- * by a {@link Proxy} instance, it will be a non-null checked
- * exception.
- *
- * @return the cause of this exception, may be null
- * @since 1.4
- */
- public Throwable getCause()
- {
- return undeclaredThrowable;
- }
-}
diff --git a/libjava/java/lang/s_atan.c b/libjava/java/lang/s_atan.c
deleted file mode 100644
index 2ee74585423..00000000000
--- a/libjava/java/lang/s_atan.c
+++ /dev/null
@@ -1,181 +0,0 @@
-
-/* @(#)s_atan.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- *
- */
-
-/*
-FUNCTION
- <<atan>>, <<atanf>>---arc tangent
-
-INDEX
- atan
-INDEX
- atanf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double atan(double <[x]>);
- float atanf(float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double atan(<[x]>);
- double <[x]>;
-
- float atanf(<[x]>);
- float <[x]>;
-
-DESCRIPTION
-
-<<atan>> computes the inverse tangent (arc tangent) of the input value.
-
-<<atanf>> is identical to <<atan>>, save that it operates on <<floats>>.
-
-RETURNS
-@ifinfo
-<<atan>> returns a value in radians, in the range of -pi/2 to pi/2.
-@end ifinfo
-@tex
-<<atan>> returns a value in radians, in the range of $-\pi/2$ to $\pi/2$.
-@end tex
-
-PORTABILITY
-<<atan>> is ANSI C. <<atanf>> is an extension.
-
-*/
-
-/* atan(x)
- * Method
- * 1. Reduce x to positive by atan(x) = -atan(-x).
- * 2. According to the integer k=4t+0.25 chopped, t=x, the argument
- * is further reduced to one of the following intervals and the
- * arctangent of t is evaluated by the corresponding formula:
- *
- * [0,7/16] atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...)
- * [7/16,11/16] atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) )
- * [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) )
- * [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) )
- * [39/16,INF] atan(x) = atan(INF) + atan( -1/t )
- *
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double atanhi[] = {
-#else
-static double atanhi[] = {
-#endif
- 4.63647609000806093515e-01, /* atan(0.5)hi 0x3FDDAC67, 0x0561BB4F */
- 7.85398163397448278999e-01, /* atan(1.0)hi 0x3FE921FB, 0x54442D18 */
- 9.82793723247329054082e-01, /* atan(1.5)hi 0x3FEF730B, 0xD281F69B */
- 1.57079632679489655800e+00, /* atan(inf)hi 0x3FF921FB, 0x54442D18 */
-};
-
-#ifdef __STDC__
-static const double atanlo[] = {
-#else
-static double atanlo[] = {
-#endif
- 2.26987774529616870924e-17, /* atan(0.5)lo 0x3C7A2B7F, 0x222F65E2 */
- 3.06161699786838301793e-17, /* atan(1.0)lo 0x3C81A626, 0x33145C07 */
- 1.39033110312309984516e-17, /* atan(1.5)lo 0x3C700788, 0x7AF0CBBD */
- 6.12323399573676603587e-17, /* atan(inf)lo 0x3C91A626, 0x33145C07 */
-};
-
-#ifdef __STDC__
-static const double aT[] = {
-#else
-static double aT[] = {
-#endif
- 3.33333333333329318027e-01, /* 0x3FD55555, 0x5555550D */
- -1.99999999998764832476e-01, /* 0xBFC99999, 0x9998EBC4 */
- 1.42857142725034663711e-01, /* 0x3FC24924, 0x920083FF */
- -1.11111104054623557880e-01, /* 0xBFBC71C6, 0xFE231671 */
- 9.09088713343650656196e-02, /* 0x3FB745CD, 0xC54C206E */
- -7.69187620504482999495e-02, /* 0xBFB3B0F2, 0xAF749A6D */
- 6.66107313738753120669e-02, /* 0x3FB10D66, 0xA0D03D51 */
- -5.83357013379057348645e-02, /* 0xBFADDE2D, 0x52DEFD9A */
- 4.97687799461593236017e-02, /* 0x3FA97B4B, 0x24760DEB */
- -3.65315727442169155270e-02, /* 0xBFA2B444, 0x2C6A6C2F */
- 1.62858201153657823623e-02, /* 0x3F90AD3A, 0xE322DA11 */
-};
-
-#ifdef __STDC__
- static const double
-#else
- static double
-#endif
-one = 1.0,
-huge = 1.0e300;
-
-#ifdef __STDC__
- double atan(double x)
-#else
- double atan(x)
- double x;
-#endif
-{
- double w,s1,s2,z;
- int32_t ix,hx,id;
-
- GET_HIGH_WORD(hx,x);
- ix = hx&0x7fffffff;
- if(ix>=0x44100000) { /* if |x| >= 2^66 */
- uint32_t low;
- GET_LOW_WORD(low,x);
- if(ix>0x7ff00000||
- (ix==0x7ff00000&&(low!=0)))
- return x+x; /* NaN */
- if(hx>0) return atanhi[3]+atanlo[3];
- else return -atanhi[3]-atanlo[3];
- } if (ix < 0x3fdc0000) { /* |x| < 0.4375 */
- if (ix < 0x3e200000) { /* |x| < 2^-29 */
- if(huge+x>one) return x; /* raise inexact */
- }
- id = -1;
- } else {
- x = fabs(x);
- if (ix < 0x3ff30000) { /* |x| < 1.1875 */
- if (ix < 0x3fe60000) { /* 7/16 <=|x|<11/16 */
- id = 0; x = (2.0*x-one)/(2.0+x);
- } else { /* 11/16<=|x|< 19/16 */
- id = 1; x = (x-one)/(x+one);
- }
- } else {
- if (ix < 0x40038000) { /* |x| < 2.4375 */
- id = 2; x = (x-1.5)/(one+1.5*x);
- } else { /* 2.4375 <= |x| < 2^66 */
- id = 3; x = -1.0/x;
- }
- }}
- /* end of argument reduction */
- z = x*x;
- w = z*z;
- /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */
- s1 = z*(aT[0]+w*(aT[2]+w*(aT[4]+w*(aT[6]+w*(aT[8]+w*aT[10])))));
- s2 = w*(aT[1]+w*(aT[3]+w*(aT[5]+w*(aT[7]+w*aT[9]))));
- if (id<0) return x - x*(s1+s2);
- else {
- z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x);
- return (hx<0)? -z:z;
- }
-}
-
-#endif /* _DOUBLE_IS_32BITS */
diff --git a/libjava/java/lang/s_ceil.c b/libjava/java/lang/s_ceil.c
deleted file mode 100644
index 250373b40d1..00000000000
--- a/libjava/java/lang/s_ceil.c
+++ /dev/null
@@ -1,80 +0,0 @@
-
-/* @(#)s_ceil.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
- * ceil(x)
- * Return x rounded toward -inf to integral value
- * Method:
- * Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to ceil(x).
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double huge = 1.0e300;
-#else
-static double huge = 1.0e300;
-#endif
-
-#ifdef __STDC__
- double ceil(double x)
-#else
- double ceil(x)
- double x;
-#endif
-{
- int32_t i0,i1,j0;
- uint32_t i,j;
- EXTRACT_WORDS(i0,i1,x);
- j0 = ((i0>>20)&0x7ff)-0x3ff;
- if(j0<20) {
- if(j0<0) { /* raise inexact if x != 0 */
- if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
- if(i0<0) {i0=0x80000000;i1=0;}
- else if((i0|i1)!=0) { i0=0x3ff00000;i1=0;}
- }
- } else {
- i = (0x000fffff)>>j0;
- if(((i0&i)|i1)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0>0) i0 += (0x00100000)>>j0;
- i0 &= (~i); i1=0;
- }
- }
- } else if (j0>51) {
- if(j0==0x400) return x+x; /* inf or NaN */
- else return x; /* x is integral */
- } else {
- i = ((uint32_t)(0xffffffff))>>(j0-20);
- if((i1&i)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0>0) {
- if(j0==20) i0+=1;
- else {
- j = i1 + (1<<(52-j0));
- if(j<(uint32_t)i1) i0+=1; /* got a carry */
- i1 = j;
- }
- }
- i1 &= (~i);
- }
- }
- INSERT_WORDS(x,i0,i1);
- return x;
-}
-
-#endif /* _DOUBLE_IS_32BITS */
diff --git a/libjava/java/lang/s_copysign.c b/libjava/java/lang/s_copysign.c
deleted file mode 100644
index 4804df130dc..00000000000
--- a/libjava/java/lang/s_copysign.c
+++ /dev/null
@@ -1,82 +0,0 @@
-
-/* @(#)s_copysign.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
-<<copysign>>, <<copysignf>>---sign of <[y]>, magnitude of <[x]>
-
-INDEX
- copysign
-INDEX
- copysignf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double copysign (double <[x]>, double <[y]>);
- float copysignf (float <[x]>, float <[y]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double copysign (<[x]>, <[y]>)
- double <[x]>;
- double <[y]>;
-
- float copysignf (<[x]>, <[y]>)
- float <[x]>;
- float <[y]>;
-
-DESCRIPTION
-<<copysign>> constructs a number with the magnitude (absolute value)
-of its first argument, <[x]>, and the sign of its second argument,
-<[y]>.
-
-<<copysignf>> does the same thing; the two functions differ only in
-the type of their arguments and result.
-
-RETURNS
-<<copysign>> returns a <<double>> with the magnitude of
-<[x]> and the sign of <[y]>.
-<<copysignf>> returns a <<float>> with the magnitude of
-<[x]> and the sign of <[y]>.
-
-PORTABILITY
-<<copysign>> is not required by either ANSI C or the System V Interface
-Definition (Issue 2).
-
-*/
-
-/*
- * copysign(double x, double y)
- * copysign(x,y) returns a value with the magnitude of x and
- * with the sign bit of y.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double copysign(double x, double y)
-#else
- double copysign(x,y)
- double x,y;
-#endif
-{
- uint32_t hx,hy;
- GET_HIGH_WORD(hx,x);
- GET_HIGH_WORD(hy,y);
- SET_HIGH_WORD(x,(hx&0x7fffffff)|(hy&0x80000000));
- return x;
-}
-
-#endif /* _DOUBLE_IS_32BITS */
diff --git a/libjava/java/lang/s_cos.c b/libjava/java/lang/s_cos.c
deleted file mode 100644
index be1538d4c0b..00000000000
--- a/libjava/java/lang/s_cos.c
+++ /dev/null
@@ -1,82 +0,0 @@
-
-/* @(#)s_cos.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* cos(x)
- * Return cosine function of x.
- *
- * kernel function:
- * __kernel_sin ... sine function on [-pi/4,pi/4]
- * __kernel_cos ... cosine function on [-pi/4,pi/4]
- * __ieee754_rem_pio2 ... argument reduction routine
- *
- * Method.
- * Let S,C and T denote the sin, cos and tan respectively on
- * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2
- * in [-pi/4 , +pi/4], and let n = k mod 4.
- * We have
- *
- * n sin(x) cos(x) tan(x)
- * ----------------------------------------------------------
- * 0 S C T
- * 1 C -S -1/T
- * 2 -S -C T
- * 3 -C S -1/T
- * ----------------------------------------------------------
- *
- * Special cases:
- * Let trig be any of sin, cos, or tan.
- * trig(+-INF) is NaN, with signals;
- * trig(NaN) is that NaN;
- *
- * Accuracy:
- * TRIG(x) returns trig(x) nearly rounded
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double cos(double x)
-#else
- double cos(x)
- double x;
-#endif
-{
- double y[2],z=0.0;
- int32_t n,ix;
-
- /* High word of x. */
- GET_HIGH_WORD(ix,x);
-
- /* |x| ~< pi/4 */
- ix &= 0x7fffffff;
- if(ix <= 0x3fe921fb) return __kernel_cos(x,z);
-
- /* cos(Inf or NaN) is NaN */
- else if (ix>=0x7ff00000) return x-x;
-
- /* argument reduction needed */
- else {
- n = __ieee754_rem_pio2(x,y);
- switch(n&3) {
- case 0: return __kernel_cos(y[0],y[1]);
- case 1: return -__kernel_sin(y[0],y[1],1);
- case 2: return -__kernel_cos(y[0],y[1]);
- default:
- return __kernel_sin(y[0],y[1],1);
- }
- }
-}
-
-#endif /* _DOUBLE_IS_32BITS */
diff --git a/libjava/java/lang/s_fabs.c b/libjava/java/lang/s_fabs.c
deleted file mode 100644
index dfee33fecdb..00000000000
--- a/libjava/java/lang/s_fabs.c
+++ /dev/null
@@ -1,73 +0,0 @@
-
-/* @(#)s_fabs.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
- <<fabs>>, <<fabsf>>---absolute value (magnitude)
-INDEX
- fabs
-INDEX
- fabsf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double fabs(double <[x]>);
- float fabsf(float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double fabs(<[x]>)
- double <[x]>;
-
- float fabsf(<[x]>)
- float <[x]>;
-
-DESCRIPTION
-<<fabs>> and <<fabsf>> calculate
-@tex
-$|x|$,
-@end tex
-the absolute value (magnitude) of the argument <[x]>, by direct
-manipulation of the bit representation of <[x]>.
-
-RETURNS
-The calculated value is returned. No errors are detected.
-
-PORTABILITY
-<<fabs>> is ANSI.
-<<fabsf>> is an extension.
-
-*/
-
-/*
- * fabs(x) returns the absolute value of x.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double fabs(double x)
-#else
- double fabs(x)
- double x;
-#endif
-{
- uint32_t high;
- GET_HIGH_WORD(high,x);
- SET_HIGH_WORD(x,high&0x7fffffff);
- return x;
-}
-
-#endif /* _DOUBLE_IS_32BITS */
diff --git a/libjava/java/lang/s_floor.c b/libjava/java/lang/s_floor.c
deleted file mode 100644
index 77e39cb7de0..00000000000
--- a/libjava/java/lang/s_floor.c
+++ /dev/null
@@ -1,134 +0,0 @@
-
-/* @(#)s_floor.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
-<<floor>>, <<floorf>>, <<ceil>>, <<ceilf>>---floor and ceiling
-INDEX
- floor
-INDEX
- floorf
-INDEX
- ceil
-INDEX
- ceilf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double floor(double <[x]>);
- float floorf(float <[x]>);
- double ceil(double <[x]>);
- float ceilf(float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double floor(<[x]>)
- double <[x]>;
- float floorf(<[x]>)
- float <[x]>;
- double ceil(<[x]>)
- double <[x]>;
- float ceilf(<[x]>)
- float <[x]>;
-
-DESCRIPTION
-<<floor>> and <<floorf>> find
-@tex
-$\lfloor x \rfloor$,
-@end tex
-the nearest integer less than or equal to <[x]>.
-<<ceil>> and <<ceilf>> find
-@tex
-$\lceil x\rceil$,
-@end tex
-the nearest integer greater than or equal to <[x]>.
-
-RETURNS
-<<floor>> and <<ceil>> return the integer result as a double.
-<<floorf>> and <<ceilf>> return the integer result as a float.
-
-PORTABILITY
-<<floor>> and <<ceil>> are ANSI.
-<<floorf>> and <<ceilf>> are extensions.
-
-
-*/
-
-/*
- * floor(x)
- * Return x rounded toward -inf to integral value
- * Method:
- * Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floor(x).
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double huge = 1.0e300;
-#else
-static double huge = 1.0e300;
-#endif
-
-#ifdef __STDC__
- double floor(double x)
-#else
- double floor(x)
- double x;
-#endif
-{
- int32_t i0,i1,j0;
- uint32_t i,j;
- EXTRACT_WORDS(i0,i1,x);
- j0 = ((i0>>20)&0x7ff)-0x3ff;
- if(j0<20) {
- if(j0<0) { /* raise inexact if x != 0 */
- if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
- if(i0>=0) {i0=i1=0;}
- else if(((i0&0x7fffffff)|i1)!=0)
- { i0=0xbff00000;i1=0;}
- }
- } else {
- i = (0x000fffff)>>j0;
- if(((i0&i)|i1)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0<0) i0 += (0x00100000)>>j0;
- i0 &= (~i); i1=0;
- }
- }
- } else if (j0>51) {
- if(j0==0x400) return x+x; /* inf or NaN */
- else return x; /* x is integral */
- } else {
- i = ((uint32_t)(0xffffffff))>>(j0-20);
- if((i1&i)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0<0) {
- if(j0==20) i0+=1;
- else {
- j = i1+(1<<(52-j0));
- if(j<(uint32_t)i1) i0 +=1 ; /* got a carry */
- i1=j;
- }
- }
- i1 &= (~i);
- }
- }
- INSERT_WORDS(x,i0,i1);
- return x;
-}
-
-#endif /* _DOUBLE_IS_32BITS */
diff --git a/libjava/java/lang/s_rint.c b/libjava/java/lang/s_rint.c
deleted file mode 100644
index 5d3f8114e2b..00000000000
--- a/libjava/java/lang/s_rint.c
+++ /dev/null
@@ -1,87 +0,0 @@
-
-/* @(#)s_rint.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
- * rint(x)
- * Return x rounded to integral value according to the prevailing
- * rounding mode.
- * Method:
- * Using floating addition.
- * Exception:
- * Inexact flag raised if x not equal to rint(x).
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-TWO52[2]={
- 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
- -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
-};
-
-#ifdef __STDC__
- double rint(double x)
-#else
- double rint(x)
- double x;
-#endif
-{
- int32_t i0,j0,sx;
- uint32_t i,i1;
- double t;
- volatile double w;
- EXTRACT_WORDS(i0,i1,x);
- sx = (i0>>31)&1;
- j0 = ((i0>>20)&0x7ff)-0x3ff;
- if(j0<20) {
- if(j0<0) {
- if(((i0&0x7fffffff)|i1)==0) return x;
- i1 |= (i0&0x0fffff);
- i0 &= 0xfffe0000;
- i0 |= ((i1|-i1)>>12)&0x80000;
- SET_HIGH_WORD(x,i0);
- w = TWO52[sx]+x;
- t = w-TWO52[sx];
- GET_HIGH_WORD(i0,t);
- SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31));
- return t;
- } else {
- i = (0x000fffff)>>j0;
- if(((i0&i)|i1)==0) return x; /* x is integral */
- i>>=1;
- if(((i0&i)|i1)!=0) {
- if(j0==19) i1 = 0x40000000; else
- i0 = (i0&(~i))|((0x20000)>>j0);
- }
- }
- } else if (j0>51) {
- if(j0==0x400) return x+x; /* inf or NaN */
- else return x; /* x is integral */
- } else {
- i = ((uint32_t)(0xffffffff))>>(j0-20);
- if((i1&i)==0) return x; /* x is integral */
- i>>=1;
- if((i1&i)!=0) i1 = (i1&(~i))|((0x40000000)>>(j0-20));
- }
- INSERT_WORDS(x,i0,i1);
- w = TWO52[sx]+x;
- return w-TWO52[sx];
-}
-
-#endif /* _DOUBLE_IS_32BITS */
diff --git a/libjava/java/lang/s_scalbn.c b/libjava/java/lang/s_scalbn.c
deleted file mode 100644
index 36ee88981ba..00000000000
--- a/libjava/java/lang/s_scalbn.c
+++ /dev/null
@@ -1,104 +0,0 @@
-
-/* @(#)s_scalbn.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
-<<scalbn>>, <<scalbnf>>---scale by integer
-INDEX
- scalbn
-INDEX
- scalbnf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double scalbn(double <[x]>, int <[y]>);
- float scalbnf(float <[x]>, int <[y]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double scalbn(<[x]>,<[y]>)
- double <[x]>;
- int <[y]>;
- float scalbnf(<[x]>,<[y]>)
- float <[x]>;
- int <[y]>;
-
-DESCRIPTION
-<<scalbn>> and <<scalbnf>> scale <[x]> by <[n]>, returning <[x]> times
-2 to the power <[n]>. The result is computed by manipulating the
-exponent, rather than by actually performing an exponentiation or
-multiplication.
-
-RETURNS
-<[x]> times 2 to the power <[n]>.
-
-PORTABILITY
-Neither <<scalbn>> nor <<scalbnf>> is required by ANSI C or by the System V
-Interface Definition (Issue 2).
-
-*/
-
-/*
- * scalbn (double x, int n)
- * scalbn(x,n) returns x* 2**n computed by exponent
- * manipulation rather than by actually performing an
- * exponentiation or a multiplication.
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
-twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
-huge = 1.0e+300,
-tiny = 1.0e-300;
-
-#ifdef __STDC__
- double scalbn (double x, int n)
-#else
- double scalbn (x,n)
- double x; int n;
-#endif
-{
- int32_t k,hx,lx;
- EXTRACT_WORDS(hx,lx,x);
- k = (hx&0x7ff00000)>>20; /* extract exponent */
- if (k==0) { /* 0 or subnormal x */
- if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
- x *= two54;
- GET_HIGH_WORD(hx,x);
- k = ((hx&0x7ff00000)>>20) - 54;
- if (n< -50000) return tiny*x; /*underflow*/
- }
- if (k==0x7ff) return x+x; /* NaN or Inf */
- k = k+n;
- if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */
- if (k > 0) /* normal result */
- {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
- if (k <= -54) {
- if (n > 50000) /* in case integer overflow in n+k */
- return huge*copysign(huge,x); /*overflow*/
- else return tiny*copysign(tiny,x); /*underflow*/
- }
- k += 54; /* subnormal result */
- SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
- return x*twom54;
-}
-
-#endif /* _DOUBLE_IS_32BITS */
diff --git a/libjava/java/lang/s_sin.c b/libjava/java/lang/s_sin.c
deleted file mode 100644
index d315455549c..00000000000
--- a/libjava/java/lang/s_sin.c
+++ /dev/null
@@ -1,132 +0,0 @@
-
-/* @(#)s_sin.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
- <<sin>>, <<sinf>>, <<cos>>, <<cosf>>---sine or cosine
-INDEX
-sin
-INDEX
-sinf
-INDEX
-cos
-INDEX
-cosf
-ANSI_SYNOPSIS
- #include <math.h>
- double sin(double <[x]>);
- float sinf(float <[x]>);
- double cos(double <[x]>);
- float cosf(float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double sin(<[x]>)
- double <[x]>;
- float sinf(<[x]>)
- float <[x]>;
-
- double cos(<[x]>)
- double <[x]>;
- float cosf(<[x]>)
- float <[x]>;
-
-DESCRIPTION
- <<sin>> and <<cos>> compute (respectively) the sine and cosine
- of the argument <[x]>. Angles are specified in radians.
-
- <<sinf>> and <<cosf>> are identical, save that they take and
- return <<float>> values.
-
-
-RETURNS
- The sine or cosine of <[x]> is returned.
-
-PORTABILITY
- <<sin>> and <<cos>> are ANSI C.
- <<sinf>> and <<cosf>> are extensions.
-
-QUICKREF
- sin ansi pure
- sinf - pure
-*/
-
-/* sin(x)
- * Return sine function of x.
- *
- * kernel function:
- * __kernel_sin ... sine function on [-pi/4,pi/4]
- * __kernel_cos ... cose function on [-pi/4,pi/4]
- * __ieee754_rem_pio2 ... argument reduction routine
- *
- * Method.
- * Let S,C and T denote the sin, cos and tan respectively on
- * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2
- * in [-pi/4 , +pi/4], and let n = k mod 4.
- * We have
- *
- * n sin(x) cos(x) tan(x)
- * ----------------------------------------------------------
- * 0 S C T
- * 1 C -S -1/T
- * 2 -S -C T
- * 3 -C S -1/T
- * ----------------------------------------------------------
- *
- * Special cases:
- * Let trig be any of sin, cos, or tan.
- * trig(+-INF) is NaN, with signals;
- * trig(NaN) is that NaN;
- *
- * Accuracy:
- * TRIG(x) returns trig(x) nearly rounded
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double sin(double x)
-#else
- double sin(x)
- double x;
-#endif
-{
- double y[2],z=0.0;
- int32_t n,ix;
-
- /* High word of x. */
- GET_HIGH_WORD(ix,x);
-
- /* |x| ~< pi/4 */
- ix &= 0x7fffffff;
- if(ix <= 0x3fe921fb) return __kernel_sin(x,z,0);
-
- /* sin(Inf or NaN) is NaN */
- else if (ix>=0x7ff00000) return x-x;
-
- /* argument reduction needed */
- else {
- n = __ieee754_rem_pio2(x,y);
- switch(n&3) {
- case 0: return __kernel_sin(y[0],y[1],1);
- case 1: return __kernel_cos(y[0],y[1]);
- case 2: return -__kernel_sin(y[0],y[1],1);
- default:
- return -__kernel_cos(y[0],y[1]);
- }
- }
-}
-
-#endif /* _DOUBLE_IS_32BITS */
diff --git a/libjava/java/lang/s_tan.c b/libjava/java/lang/s_tan.c
deleted file mode 100644
index 20995fcbdee..00000000000
--- a/libjava/java/lang/s_tan.c
+++ /dev/null
@@ -1,114 +0,0 @@
-
-/* @(#)s_tan.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-
-/*
-
-FUNCTION
- <<tan>>, <<tanf>>---tangent
-
-INDEX
-tan
-INDEX
-tanf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double tan(double <[x]>);
- float tanf(float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double tan(<[x]>)
- double <[x]>;
-
- float tanf(<[x]>)
- float <[x]>;
-
-
-DESCRIPTION
-<<tan>> computes the tangent of the argument <[x]>.
-Angles are specified in radians.
-
-<<tanf>> is identical, save that it takes and returns <<float>> values.
-
-RETURNS
-The tangent of <[x]> is returned.
-
-PORTABILITY
-<<tan>> is ANSI. <<tanf>> is an extension.
-*/
-
-/* tan(x)
- * Return tangent function of x.
- *
- * kernel function:
- * __kernel_tan ... tangent function on [-pi/4,pi/4]
- * __ieee754_rem_pio2 ... argument reduction routine
- *
- * Method.
- * Let S,C and T denote the sin, cos and tan respectively on
- * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2
- * in [-pi/4 , +pi/4], and let n = k mod 4.
- * We have
- *
- * n sin(x) cos(x) tan(x)
- * ----------------------------------------------------------
- * 0 S C T
- * 1 C -S -1/T
- * 2 -S -C T
- * 3 -C S -1/T
- * ----------------------------------------------------------
- *
- * Special cases:
- * Let trig be any of sin, cos, or tan.
- * trig(+-INF) is NaN, with signals;
- * trig(NaN) is that NaN;
- *
- * Accuracy:
- * TRIG(x) returns trig(x) nearly rounded
- */
-
-#include "fdlibm.h"
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double tan(double x)
-#else
- double tan(x)
- double x;
-#endif
-{
- double y[2],z=0.0;
- int32_t n,ix;
-
- /* High word of x. */
- GET_HIGH_WORD(ix,x);
-
- /* |x| ~< pi/4 */
- ix &= 0x7fffffff;
- if(ix <= 0x3fe921fb) return __kernel_tan(x,z,1);
-
- /* tan(Inf or NaN) is NaN */
- else if (ix>=0x7ff00000) return x-x; /* NaN */
-
- /* argument reduction needed */
- else {
- n = __ieee754_rem_pio2(x,y);
- return __kernel_tan(y[0],y[1],1-((n&1)<<1)); /* 1 -- n even
- -1 -- n odd */
- }
-}
-
-#endif /* _DOUBLE_IS_32BITS */
diff --git a/libjava/java/lang/sf_fabs.c b/libjava/java/lang/sf_fabs.c
deleted file mode 100644
index 34f88afc4e6..00000000000
--- a/libjava/java/lang/sf_fabs.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* sf_fabs.c -- float version of s_fabs.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
-
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
- * fabsf(x) returns the absolute value of x.
- */
-
-#include "fdlibm.h"
-
-#ifdef __STDC__
- float fabsf(float x)
-#else
- float fabsf(x)
- float x;
-#endif
-{
- uint32_t ix;
- GET_FLOAT_WORD(ix,x);
- SET_FLOAT_WORD(x,ix&0x7fffffff);
- return x;
-}
-
-#ifdef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double fabs(double x)
-#else
- double fabs(x)
- double x;
-#endif
-{
- return (double) fabsf((float) x);
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/sf_rint.c b/libjava/java/lang/sf_rint.c
deleted file mode 100644
index f442072874e..00000000000
--- a/libjava/java/lang/sf_rint.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* sf_rint.c -- float version of s_rint.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
-
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#include "fdlibm.h"
-
-#ifdef __STDC__
-static const float
-#else
-static float
-#endif
-TWO23[2]={
- 8.3886080000e+06, /* 0x4b000000 */
- -8.3886080000e+06, /* 0xcb000000 */
-};
-
-#ifdef __STDC__
- float rintf(float x)
-#else
- float rintf(x)
- float x;
-#endif
-{
- int32_t i0,j0,sx;
- uint32_t i,i1;
- float w,t;
- GET_FLOAT_WORD(i0,x);
- sx = (i0>>31)&1;
- j0 = ((i0>>23)&0xff)-0x7f;
- if(j0<23) {
- if(j0<0) {
- if((i0&0x7fffffff)==0) return x;
- i1 = (i0&0x07fffff);
- i0 &= 0xfff00000;
- i0 |= ((i1|-i1)>>9)&0x400000;
- SET_FLOAT_WORD(x,i0);
- w = TWO23[sx]+x;
- t = w-TWO23[sx];
- GET_FLOAT_WORD(i0,t);
- SET_FLOAT_WORD(t,(i0&0x7fffffff)|(sx<<31));
- return t;
- } else {
- i = (0x007fffff)>>j0;
- if((i0&i)==0) return x; /* x is integral */
- i>>=1;
- if((i0&i)!=0) i0 = (i0&(~i))|((0x100000)>>j0);
- }
- } else {
- if(j0==0x80) return x+x; /* inf or NaN */
- else return x; /* x is integral */
- }
- SET_FLOAT_WORD(x,i0);
- w = TWO23[sx]+x;
- return w-TWO23[sx];
-}
-
-#ifdef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double rint(double x)
-#else
- double rint(x)
- double x;
-#endif
-{
- return (double) rintf((float) x);
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/strtod.c b/libjava/java/lang/strtod.c
deleted file mode 100644
index b3e09124721..00000000000
--- a/libjava/java/lang/strtod.c
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
-FUNCTION
- <<strtod>>, <<strtodf>>---string to double or float
-
-INDEX
- strtod
-INDEX
- _strtod_r
-INDEX
- strtodf
-
-ANSI_SYNOPSIS
- #include <stdlib.h>
- double strtod(const char *<[str]>, char **<[tail]>);
- float strtodf(const char *<[str]>, char **<[tail]>);
-
- double _strtod_r(void *<[reent]>,
- const char *<[str]>, char **<[tail]>);
-
-TRAD_SYNOPSIS
- #include <stdlib.h>
- double strtod(<[str]>,<[tail]>)
- char *<[str]>;
- char **<[tail]>;
-
- float strtodf(<[str]>,<[tail]>)
- char *<[str]>;
- char **<[tail]>;
-
- double _strtod_r(<[reent]>,<[str]>,<[tail]>)
- char *<[reent]>;
- char *<[str]>;
- char **<[tail]>;
-
-DESCRIPTION
- The function <<strtod>> parses the character string <[str]>,
- producing a substring which can be converted to a double
- value. The substring converted is the longest initial
- subsequence of <[str]>, beginning with the first
- non-whitespace character, that has the format:
- .[+|-]<[digits]>[.][<[digits]>][(e|E)[+|-]<[digits]>]
- The substring contains no characters if <[str]> is empty, consists
- entirely of whitespace, or if the first non-whitespace
- character is something other than <<+>>, <<->>, <<.>>, or a
- digit. If the substring is empty, no conversion is done, and
- the value of <[str]> is stored in <<*<[tail]>>>. Otherwise,
- the substring is converted, and a pointer to the final string
- (which will contain at least the terminating null character of
- <[str]>) is stored in <<*<[tail]>>>. If you want no
- assignment to <<*<[tail]>>>, pass a null pointer as <[tail]>.
- <<strtodf>> is identical to <<strtod>> except for its return type.
-
- This implementation returns the nearest machine number to the
- input decimal string. Ties are broken by using the IEEE
- round-even rule.
-
- The alternate function <<_strtod_r>> is a reentrant version.
- The extra argument <[reent]> is a pointer to a reentrancy structure.
-
-RETURNS
- <<strtod>> returns the converted substring value, if any. If
- no conversion could be performed, 0 is returned. If the
- correct value is out of the range of representable values,
- plus or minus <<HUGE_VAL>> is returned, and <<ERANGE>> is
- stored in errno. If the correct value would cause underflow, 0
- is returned and <<ERANGE>> is stored in errno.
-
-Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
-<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
-*/
-
-/****************************************************************
- *
- * The author of this software is David M. Gay.
- *
- * Copyright (c) 1991 by AT&T.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- *
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
- * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- ***************************************************************/
-
-/* Please send bug reports to
- David M. Gay
- AT&T Bell Laboratories, Room 2C-463
- 600 Mountain Avenue
- Murray Hill, NJ 07974-2070
- U.S.A.
- dmg@research.att.com or research!dmg
- */
-
-#include <string.h>
-#include <float.h>
-#include <errno.h>
-#include "mprec.h"
-
-double
-_DEFUN (_strtod_r, (ptr, s00, se),
- struct _Jv_reent *ptr _AND
- _CONST char *s00 _AND
- char **se)
-{
- int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, e1, esign, i, j,
- k, nd, nd0, nf, nz, nz0, sign;
- int digits = 0; /* Number of digits found in fraction part. */
- long e;
- _CONST char *s, *s0, *s1;
- double aadj, aadj1, adj;
- long L;
- unsigned long y, z;
- union double_union rv, rv0;
-
- _Jv_Bigint *bb = NULL, *bb1, *bd = NULL, *bd0, *bs = NULL, *delta = NULL;
- sign = nz0 = nz = 0;
- rv.d = 0.;
- for (s = s00;; s++)
- switch (*s)
- {
- case '-':
- sign = 1;
- /* no break */
- case '+':
- if (*++s)
- goto break2;
- /* no break */
- case 0:
- s = s00;
- goto ret;
- case '\t':
- case '\n':
- case '\v':
- case '\f':
- case '\r':
- case ' ':
- continue;
- default:
- goto break2;
- }
-break2:
- if (*s == '0')
- {
- digits++;
- nz0 = 1;
- while (*++s == '0')
- digits++;
- if (!*s)
- goto ret;
- }
- s0 = s;
- y = z = 0;
- for (nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++)
- {
- digits++;
- if (nd < 9)
- y = 10 * y + c - '0';
- else if (nd < 16)
- z = 10 * z + c - '0';
- }
- nd0 = nd;
- if (c == '.')
- {
- c = *++s;
- if (!nd)
- {
- for (; c == '0'; c = *++s)
- {
- digits++;
- nz++;
- }
- if (c > '0' && c <= '9')
- {
- digits++;
- s0 = s;
- nf += nz;
- nz = 0;
- goto have_dig;
- }
- goto dig_done;
- }
- for (; c >= '0' && c <= '9'; c = *++s)
- {
- digits++;
- have_dig:
- nz++;
- if (c -= '0')
- {
- nf += nz;
- for (i = 1; i < nz; i++)
- if (nd++ < 9)
- y *= 10;
- else if (nd <= DBL_DIG + 1)
- z *= 10;
- if (nd++ < 9)
- y = 10 * y + c;
- else if (nd <= DBL_DIG + 1)
- z = 10 * z + c;
- nz = 0;
- }
- }
- }
-dig_done:
- e = 0;
- if (c == 'e' || c == 'E')
- {
- if (!nd && !nz && !nz0)
- {
- s = s00;
- goto ret;
- }
- s00 = s;
- esign = 0;
- switch (c = *++s)
- {
- case '-':
- esign = 1;
- case '+':
- c = *++s;
- }
- if (c >= '0' && c <= '9')
- {
- while (c == '0')
- c = *++s;
- if (c > '0' && c <= '9')
- {
- e = c - '0';
- s1 = s;
- while ((c = *++s) >= '0' && c <= '9')
- e = 10 * e + c - '0';
- if (s - s1 > 8)
- /* Avoid confusion from exponents
- * so large that e might overflow.
- */
- e = 9999999L;
- if (esign)
- e = -e;
- }
- }
- else
- {
- /* No exponent after an 'E' : that's an error. */
- ptr->_errno = EINVAL;
- e = 0;
- s = s00;
- goto ret;
- }
- }
- if (!nd)
- {
- if (!nz && !nz0)
- s = s00;
- goto ret;
- }
- e1 = e -= nf;
-
- /* Now we have nd0 digits, starting at s0, followed by a
- * decimal point, followed by nd-nd0 digits. The number we're
- * after is the integer represented by those digits times
- * 10**e */
-
- if (!nd0)
- nd0 = nd;
- k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1;
- rv.d = y;
- if (k > 9)
- rv.d = tens[k - 9] * rv.d + z;
- bd0 = 0;
- if (nd <= DBL_DIG
-#ifndef RND_PRODQUOT
- && FLT_ROUNDS == 1
-#endif
- )
- {
- if (!e)
- goto ret;
- if (e > 0)
- {
- if (e <= Ten_pmax)
- {
-#ifdef VAX
- goto vax_ovfl_check;
-#else
- /* rv.d = */ rounded_product (rv.d, tens[e]);
- goto ret;
-#endif
- }
- i = DBL_DIG - nd;
- if (e <= Ten_pmax + i)
- {
- /* A fancier test would sometimes let us do
- * this for larger i values.
- */
- e -= i;
- rv.d *= tens[i];
-#ifdef VAX
- /* VAX exponent range is so narrow we must
- * worry about overflow here...
- */
- vax_ovfl_check:
- word0 (rv) -= P * Exp_msk1;
- /* rv.d = */ rounded_product (rv.d, tens[e]);
- if ((word0 (rv) & Exp_mask)
- > Exp_msk1 * (DBL_MAX_EXP + Bias - 1 - P))
- goto ovfl;
- word0 (rv) += P * Exp_msk1;
-#else
- /* rv.d = */ rounded_product (rv.d, tens[e]);
-#endif
- goto ret;
- }
- }
-#ifndef Inaccurate_Divide
- else if (e >= -Ten_pmax)
- {
- /* rv.d = */ rounded_quotient (rv.d, tens[-e]);
- goto ret;
- }
-#endif
- }
- e1 += nd - k;
-
- /* Get starting approximation = rv.d * 10**e1 */
-
- if (e1 > 0)
- {
- if ((i = e1 & 15))
- rv.d *= tens[i];
-
- if (e1 &= ~15)
- {
- if (e1 > DBL_MAX_10_EXP)
- {
- ovfl:
- ptr->_errno = ERANGE;
-
- /* Force result to IEEE infinity. */
- word0 (rv) = Exp_mask;
- word1 (rv) = 0;
-
- if (bd0)
- goto retfree;
- goto ret;
- }
- if (e1 >>= 4)
- {
- for (j = 0; e1 > 1; j++, e1 >>= 1)
- if (e1 & 1)
- rv.d *= bigtens[j];
- /* The last multiplication could overflow. */
- word0 (rv) -= P * Exp_msk1;
- rv.d *= bigtens[j];
- if ((z = word0 (rv) & Exp_mask)
- > Exp_msk1 * (DBL_MAX_EXP + Bias - P))
- goto ovfl;
- if (z > Exp_msk1 * (DBL_MAX_EXP + Bias - 1 - P))
- {
- /* set to largest number */
- /* (Can't trust DBL_MAX) */
- word0 (rv) = Big0;
-#ifndef _DOUBLE_IS_32BITS
- word1 (rv) = Big1;
-#endif
- }
- else
- word0 (rv) += P * Exp_msk1;
- }
-
- }
- }
- else if (e1 < 0)
- {
- e1 = -e1;
- if ((i = e1 & 15))
- rv.d /= tens[i];
- if (e1 &= ~15)
- {
- e1 >>= 4;
- if (e1 >= 1 << n_bigtens)
- goto undfl;
- for (j = 0; e1 > 1; j++, e1 >>= 1)
- if (e1 & 1)
- rv.d *= tinytens[j];
- /* The last multiplication could underflow. */
- rv0.d = rv.d;
- rv.d *= tinytens[j];
- if (!rv.d)
- {
- rv.d = 2. * rv0.d;
- rv.d *= tinytens[j];
- if (!rv.d)
- {
- undfl:
- rv.d = 0.;
- ptr->_errno = ERANGE;
- if (bd0)
- goto retfree;
- goto ret;
- }
-#ifndef _DOUBLE_IS_32BITS
- word0 (rv) = Tiny0;
- word1 (rv) = Tiny1;
-#else
- word0 (rv) = Tiny1;
-#endif
- /* The refinement below will clean
- * this approximation up.
- */
- }
- }
- }
-
- /* Now the hard part -- adjusting rv to the correct value.*/
-
- /* Put digits into bd: true value = bd * 10^e */
-
- bd0 = s2b (ptr, s0, nd0, nd, y);
-
- for (;;)
- {
- bd = Balloc (ptr, bd0->_k);
- Bcopy (bd, bd0);
- bb = d2b (ptr, rv.d, &bbe, &bbbits); /* rv.d = bb * 2^bbe */
- bs = i2b (ptr, 1);
-
- if (e >= 0)
- {
- bb2 = bb5 = 0;
- bd2 = bd5 = e;
- }
- else
- {
- bb2 = bb5 = -e;
- bd2 = bd5 = 0;
- }
- if (bbe >= 0)
- bb2 += bbe;
- else
- bd2 -= bbe;
- bs2 = bb2;
-#ifdef Sudden_Underflow
-#ifdef IBM
- j = 1 + 4 * P - 3 - bbbits + ((bbe + bbbits - 1) & 3);
-#else
- j = P + 1 - bbbits;
-#endif
-#else
- i = bbe + bbbits - 1; /* logb(rv.d) */
- if (i < Emin) /* denormal */
- j = bbe + (P - Emin);
- else
- j = P + 1 - bbbits;
-#endif
- bb2 += j;
- bd2 += j;
- i = bb2 < bd2 ? bb2 : bd2;
- if (i > bs2)
- i = bs2;
- if (i > 0)
- {
- bb2 -= i;
- bd2 -= i;
- bs2 -= i;
- }
- if (bb5 > 0)
- {
- bs = pow5mult (ptr, bs, bb5);
- bb1 = mult (ptr, bs, bb);
- Bfree (ptr, bb);
- bb = bb1;
- }
- if (bb2 > 0)
- bb = lshift (ptr, bb, bb2);
- if (bd5 > 0)
- bd = pow5mult (ptr, bd, bd5);
- if (bd2 > 0)
- bd = lshift (ptr, bd, bd2);
- if (bs2 > 0)
- bs = lshift (ptr, bs, bs2);
- delta = diff (ptr, bb, bd);
- dsign = delta->_sign;
- delta->_sign = 0;
- i = cmp (delta, bs);
- if (i < 0)
- {
- /* Error is less than half an ulp -- check for
- * special case of mantissa a power of two.
- */
- if (dsign || word1 (rv) || word0 (rv) & Bndry_mask)
- break;
- delta = lshift (ptr, delta, Log2P);
- if (cmp (delta, bs) > 0)
- goto drop_down;
- break;
- }
- if (i == 0)
- {
- /* exactly half-way between */
- if (dsign)
- {
- if ((word0 (rv) & Bndry_mask1) == Bndry_mask1
- && word1 (rv) == 0xffffffff)
- {
- /*boundary case -- increment exponent*/
- word0 (rv) = (word0 (rv) & Exp_mask)
- + Exp_msk1
-#ifdef IBM
- | Exp_msk1 >> 4
-#endif
- ;
-#ifndef _DOUBLE_IS_32BITS
- word1 (rv) = 0;
-#endif
- break;
- }
- }
- else if (!(word0 (rv) & Bndry_mask) && !word1 (rv))
- {
- drop_down:
- /* boundary case -- decrement exponent */
-#ifdef Sudden_Underflow
- L = word0 (rv) & Exp_mask;
-#ifdef IBM
- if (L < Exp_msk1)
-#else
- if (L <= Exp_msk1)
-#endif
- goto undfl;
- L -= Exp_msk1;
-#else
- L = (word0 (rv) & Exp_mask) - Exp_msk1;
-#endif
- word0 (rv) = L | Bndry_mask1;
-#ifndef _DOUBLE_IS_32BITS
- word1 (rv) = 0xffffffff;
-#endif
-#ifdef IBM
- goto cont;
-#else
- break;
-#endif
- }
-#ifndef ROUND_BIASED
- if (!(word1 (rv) & LSB))
- break;
-#endif
- if (dsign)
- rv.d += ulp (rv.d);
-#ifndef ROUND_BIASED
- else
- {
- rv.d -= ulp (rv.d);
-#ifndef Sudden_Underflow
- if (!rv.d)
- goto undfl;
-#endif
- }
-#endif
- break;
- }
- if ((aadj = ratio (delta, bs)) <= 2.)
- {
- if (dsign)
- aadj = aadj1 = 1.;
- else if (word1 (rv) || word0 (rv) & Bndry_mask)
- {
-#ifndef Sudden_Underflow
- if (word1 (rv) == Tiny1 && !word0 (rv))
- goto undfl;
-#endif
- aadj = 1.;
- aadj1 = -1.;
- }
- else
- {
- /* special case -- power of FLT_RADIX to be */
- /* rounded down... */
-
- if (aadj < 2. / FLT_RADIX)
- aadj = 1. / FLT_RADIX;
- else
- aadj *= 0.5;
- aadj1 = -aadj;
- }
- }
- else
- {
- aadj *= 0.5;
- aadj1 = dsign ? aadj : -aadj;
-#ifdef Check_FLT_ROUNDS
- switch (FLT_ROUNDS)
- {
- case 2: /* towards +infinity */
- aadj1 -= 0.5;
- break;
- case 0: /* towards 0 */
- case 3: /* towards -infinity */
- aadj1 += 0.5;
- }
-#else
- if (FLT_ROUNDS == 0)
- aadj1 += 0.5;
-#endif
- }
- y = word0 (rv) & Exp_mask;
-
- /* Check for overflow */
-
- if (y == Exp_msk1 * (DBL_MAX_EXP + Bias - 1))
- {
- rv0.d = rv.d;
- word0 (rv) -= P * Exp_msk1;
- adj = aadj1 * ulp (rv.d);
- rv.d += adj;
- if ((word0 (rv) & Exp_mask) >=
- Exp_msk1 * (DBL_MAX_EXP + Bias - P))
- {
- if (word0 (rv0) == Big0 && word1 (rv0) == Big1)
- goto ovfl;
-#ifdef _DOUBLE_IS_32BITS
- word0 (rv) = Big1;
-#else
- word0 (rv) = Big0;
- word1 (rv) = Big1;
-#endif
- goto cont;
- }
- else
- word0 (rv) += P * Exp_msk1;
- }
- else
- {
-#ifdef Sudden_Underflow
- if ((word0 (rv) & Exp_mask) <= P * Exp_msk1)
- {
- rv0.d = rv.d;
- word0 (rv) += P * Exp_msk1;
- adj = aadj1 * ulp (rv.d);
- rv.d += adj;
-#ifdef IBM
- if ((word0 (rv) & Exp_mask) < P * Exp_msk1)
-#else
- if ((word0 (rv) & Exp_mask) <= P * Exp_msk1)
-#endif
- {
- if (word0 (rv0) == Tiny0
- && word1 (rv0) == Tiny1)
- goto undfl;
- word0 (rv) = Tiny0;
- word1 (rv) = Tiny1;
- goto cont;
- }
- else
- word0 (rv) -= P * Exp_msk1;
- }
- else
- {
- adj = aadj1 * ulp (rv.d);
- rv.d += adj;
- }
-#else
- /* Compute adj so that the IEEE rounding rules will
- * correctly round rv.d + adj in some half-way cases.
- * If rv.d * ulp(rv.d) is denormalized (i.e.,
- * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid
- * trouble from bits lost to denormalization;
- * example: 1.2e-307 .
- */
- if (y <= (P - 1) * Exp_msk1 && aadj >= 1.)
- {
- aadj1 = (double) (int) (aadj + 0.5);
- if (!dsign)
- aadj1 = -aadj1;
- }
- adj = aadj1 * ulp (rv.d);
- rv.d += adj;
-#endif
- }
- z = word0 (rv) & Exp_mask;
- if (y == z)
- {
- /* Can we stop now? */
- L = aadj;
- aadj -= L;
- /* The tolerances below are conservative. */
- if (dsign || word1 (rv) || word0 (rv) & Bndry_mask)
- {
- if (aadj < .4999999 || aadj > .5000001)
- break;
- }
- else if (aadj < .4999999 / FLT_RADIX)
- break;
- }
- cont:
- Bfree (ptr, bb);
- Bfree (ptr, bd);
- Bfree (ptr, bs);
- Bfree (ptr, delta);
- }
-retfree:
- Bfree (ptr, bb);
- Bfree (ptr, bd);
- Bfree (ptr, bs);
- Bfree (ptr, bd0);
- Bfree (ptr, delta);
-ret:
- if (se)
- *se = (char *) s;
- if (digits == 0)
- ptr->_errno = EINVAL;
- return sign ? -rv.d : rv.d;
-}
-
diff --git a/libjava/java/lang/w_acos.c b/libjava/java/lang/w_acos.c
deleted file mode 100644
index c9ca99c4041..00000000000
--- a/libjava/java/lang/w_acos.c
+++ /dev/null
@@ -1,118 +0,0 @@
-
-/* @(#)w_acos.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
- <<acos>>, <<acosf>>---arc cosine
-
-INDEX
- acos
-INDEX
- acosf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double acos(double <[x]>);
- float acosf(float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double acos(<[x]>)
- double <[x]>;
-
- float acosf(<[x]>)
- float <[x]>;
-
-
-
-DESCRIPTION
-
- <<acos>> computes the inverse cosine (arc cosine) of the input value.
- Arguments to <<acos>> must be in the range @minus{}1 to 1.
-
- <<acosf>> is identical to <<acos>>, except that it performs
- its calculations on <<floats>>.
-
-RETURNS
- @ifinfo
- <<acos>> and <<acosf>> return values in radians, in the range of 0 to pi.
- @end ifinfo
- @tex
- <<acos>> and <<acosf>> return values in radians, in the range of <<0>> to $\pi$.
- @end tex
-
- If <[x]> is not between @minus{}1 and 1, the returned value is NaN
- (not a number) the global variable <<errno>> is set to <<EDOM>>, and a
- <<DOMAIN error>> message is sent as standard error output.
-
- You can modify error handling for these functions using <<matherr>>.
-
-
-QUICKREF ANSI SVID POSIX RENTRANT
- acos y,y,y,m
- acosf n,n,n,m
-
-MATHREF
- acos, [-1,1], acos(arg),,,
- acos, NAN, arg,DOMAIN,EDOM
-
-MATHREF
- acosf, [-1,1], acosf(arg),,,
- acosf, NAN, argf,DOMAIN,EDOM
-
-*/
-
-/*
- * wrap_acos(x)
- */
-
-#include "fdlibm.h"
-#include <errno.h>
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double acos(double x) /* wrapper acos */
-#else
- double acos(x) /* wrapper acos */
- double x;
-#endif
-{
-#ifdef _IEEE_LIBM
- return __ieee754_acos(x);
-#else
- double z;
- struct exception exc;
- z = __ieee754_acos(x);
- if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
- if(fabs(x)>1.0) {
- /* acos(|x|>1) */
- exc.type = DOMAIN;
- exc.name = "acos";
- exc.err = 0;
- exc.arg1 = exc.arg2 = x;
- exc.retval = 0.0;
- if (_LIB_VERSION == _POSIX_)
- errno = EDOM;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- } else
- return z;
-#endif
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/w_asin.c b/libjava/java/lang/w_asin.c
deleted file mode 100644
index f6cb271d392..00000000000
--- a/libjava/java/lang/w_asin.c
+++ /dev/null
@@ -1,121 +0,0 @@
-
-/* @(#)w_asin.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- *
- */
-
-/*
-FUNCTION
- <<asin>>, <<asinf>>---arc sine
-
-INDEX
- asin
-INDEX
- asinf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double asin(double <[x]>);
- float asinf(float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double asin(<[x]>)
- double <[x]>;
-
- float asinf(<[x]>)
- float <[x]>;
-
-
-DESCRIPTION
-
-<<asin>> computes the inverse sine (arc sine) of the argument <[x]>.
-Arguments to <<asin>> must be in the range @minus{}1 to 1.
-
-<<asinf>> is identical to <<asin>>, other than taking and
-returning floats.
-
-You can modify error handling for these routines using <<matherr>>.
-
-RETURNS
-@ifinfo
-<<asin>> returns values in radians, in the range of -pi/2 to pi/2.
-@end ifinfo
-@tex
-<<asin>> returns values in radians, in the range of $-\pi/2$ to $\pi/2$.
-@end tex
-
-If <[x]> is not in the range @minus{}1 to 1, <<asin>> and <<asinf>>
-return NaN (not a number), set the global variable <<errno>> to
-<<EDOM>>, and issue a <<DOMAIN error>> message.
-
-You can change this error treatment using <<matherr>>.
-
-QUICKREF ANSI SVID POSIX RENTRANT
- asin y,y,y,m
- asinf n,n,n,m
-
-MATHREF
- asin, -1<=arg<=1, asin(arg),,,
- asin, NAN, arg,EDOM, DOMAIN
-
-MATHREF
- asinf, -1<=arg<=1, asin(arg),,,
- asinf, NAN, arg,EDOM, DOMAIN
-
-
-*/
-
-/*
- * wrapper asin(x)
- */
-
-
-#include "fdlibm.h"
-#include <errno.h>
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double asin(double x) /* wrapper asin */
-#else
- double asin(x) /* wrapper asin */
- double x;
-#endif
-{
-#ifdef _IEEE_LIBM
- return __ieee754_asin(x);
-#else
- double z;
- struct exception exc;
- z = __ieee754_asin(x);
- if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
- if(fabs(x)>1.0) {
- /* asin(|x|>1) */
- exc.type = DOMAIN;
- exc.name = "asin";
- exc.err = 0;
- exc.arg1 = exc.arg2 = x;
- exc.retval = 0.0;
- if(_LIB_VERSION == _POSIX_)
- errno = EDOM;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- } else
- return z;
-#endif
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/w_atan2.c b/libjava/java/lang/w_atan2.c
deleted file mode 100644
index 91742c72b91..00000000000
--- a/libjava/java/lang/w_atan2.c
+++ /dev/null
@@ -1,117 +0,0 @@
-
-/* @(#)w_atan2.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- *
- */
-
-/*
-FUNCTION
- <<atan2>>, <<atan2f>>---arc tangent of y/x
-
-INDEX
- atan2
-INDEX
- atan2f
-
-ANSI_SYNOPSIS
- #include <math.h>
- double atan2(double <[y]>,double <[x]>);
- float atan2f(float <[y]>,float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double atan2(<[y]>,<[x]>);
- double <[y]>;
- double <[x]>;
-
- float atan2f(<[y]>,<[x]>);
- float <[y]>;
- float <[x]>;
-
-DESCRIPTION
-
-<<atan2>> computes the inverse tangent (arc tangent) of <[y]>/<[x]>.
-<<atan2>> produces the correct result even for angles near
-@ifinfo
-pi/2 or -pi/2
-@end ifinfo
-@tex
-$\pi/2$ or $-\pi/2$
-@end tex
-(that is, when <[x]> is near 0).
-
-<<atan2f>> is identical to <<atan2>>, save that it takes and returns
-<<float>>.
-
-RETURNS
-<<atan2>> and <<atan2f>> return a value in radians, in the range of
-@ifinfo
--pi to pi.
-@end ifinfo
-@tex
-$-\pi$ to $\pi$.
-@end tex
-
-If both <[x]> and <[y]> are 0.0, <<atan2>> causes a <<DOMAIN>> error.
-
-You can modify error handling for these functions using <<matherr>>.
-
-PORTABILITY
-<<atan2>> is ANSI C. <<atan2f>> is an extension.
-
-
-*/
-
-/*
- * wrapper atan2(y,x)
- */
-
-#include "fdlibm.h"
-#include <errno.h>
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double atan2(double y, double x) /* wrapper atan2 */
-#else
- double atan2(y,x) /* wrapper atan2 */
- double y,x;
-#endif
-{
-#ifdef _IEEE_LIBM
- return __ieee754_atan2(y,x);
-#else
- double z;
- struct exception exc;
- z = __ieee754_atan2(y,x);
- if(_LIB_VERSION == _IEEE_||isnan(x)||isnan(y)) return z;
- if(x==0.0&&y==0.0) {
- /* atan2(+-0,+-0) */
- exc.arg1 = y;
- exc.arg2 = x;
- exc.type = DOMAIN;
- exc.name = "atan2";
- exc.err = 0;
- exc.retval = 0.0;
- if(_LIB_VERSION == _POSIX_)
- errno = EDOM;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- } else
- return z;
-#endif
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/w_exp.c b/libjava/java/lang/w_exp.c
deleted file mode 100644
index 45e087b45f9..00000000000
--- a/libjava/java/lang/w_exp.c
+++ /dev/null
@@ -1,140 +0,0 @@
-
-/* @(#)w_exp.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
- <<exp>>, <<expf>>---exponential
-INDEX
- exp
-INDEX
- expf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double exp(double <[x]>);
- float expf(float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double exp(<[x]>);
- double <[x]>;
-
- float expf(<[x]>);
- float <[x]>;
-
-DESCRIPTION
- <<exp>> and <<expf>> calculate the exponential of <[x]>, that is,
- @ifinfo
- e raised to the power <[x]> (where e
- @end ifinfo
- @tex
- $e^x$ (where $e$
- @end tex
- is the base of the natural system of logarithms, approximately 2.71828).
-
- You can use the (non-ANSI) function <<matherr>> to specify
- error handling for these functions.
-
-RETURNS
- On success, <<exp>> and <<expf>> return the calculated value.
- If the result underflows, the returned value is <<0>>. If the
- result overflows, the returned value is <<HUGE_VAL>>. In
- either case, <<errno>> is set to <<ERANGE>>.
-
-PORTABILITY
- <<exp>> is ANSI C. <<expf>> is an extension.
-
-*/
-
-/*
- * wrapper exp(x)
- */
-
-#include "fdlibm.h"
-#include <errno.h>
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifndef _IEEE_LIBM
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */
-u_threshold= -7.45133219101941108420e+02; /* 0xc0874910, 0xD52D3051 */
-
-#endif
-
-#ifdef __STDC__
- double exp(double x) /* wrapper exp */
-#else
- double exp(x) /* wrapper exp */
- double x;
-#endif
-{
-#ifdef _IEEE_LIBM
- return __ieee754_exp(x);
-#else
- double z;
- struct exception exc;
- z = __ieee754_exp(x);
- if(_LIB_VERSION == _IEEE_) return z;
- if(finite(x)) {
- if(x>o_threshold) {
- /* exp(finite) overflow */
-#ifndef HUGE_VAL
-#define HUGE_VAL inf
- double inf = 0.0;
-
- SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
-#endif
- exc.type = OVERFLOW;
- exc.name = "exp";
- exc.err = 0;
- exc.arg1 = exc.arg2 = x;
- if (_LIB_VERSION == _SVID_)
- exc.retval = HUGE;
- else
- exc.retval = HUGE_VAL;
- if (_LIB_VERSION == _POSIX_)
- errno = ERANGE;
- else if (!matherr(&exc)) {
- errno = ERANGE;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- } else if(x<u_threshold) {
- /* exp(finite) underflow */
- exc.type = UNDERFLOW;
- exc.name = "exp";
- exc.err = 0;
- exc.arg1 = exc.arg2 = x;
- exc.retval = 0.0;
- if (_LIB_VERSION == _POSIX_)
- errno = ERANGE;
- else if (!matherr(&exc)) {
- errno = ERANGE;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- }
- }
- return z;
-#endif
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/w_fmod.c b/libjava/java/lang/w_fmod.c
deleted file mode 100644
index b6b36cb76ab..00000000000
--- a/libjava/java/lang/w_fmod.c
+++ /dev/null
@@ -1,107 +0,0 @@
-
-/* @(#)w_fmod.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
-<<fmod>>, <<fmodf>>---floating-point remainder (modulo)
-
-INDEX
-fmod
-INDEX
-fmodf
-
-ANSI_SYNOPSIS
-#include <math.h>
-double fmod(double <[x]>, double <[y]>)
-float fmodf(float <[x]>, float <[y]>)
-
-TRAD_SYNOPSIS
-#include <math.h>
-double fmod(<[x]>, <[y]>)
-double (<[x]>, <[y]>);
-
-float fmodf(<[x]>, <[y]>)
-float (<[x]>, <[y]>);
-
-DESCRIPTION
-The <<fmod>> and <<fmodf>> functions compute the floating-point
-remainder of <[x]>/<[y]> (<[x]> modulo <[y]>).
-
-RETURNS
-The <<fmod>> function returns the value
-@ifinfo
-<[x]>-<[i]>*<[y]>,
-@end ifinfo
-@tex
-$x-i\times y$,
-@end tex
-for the largest integer <[i]> such that, if <[y]> is nonzero, the
-result has the same sign as <[x]> and magnitude less than the
-magnitude of <[y]>.
-
-<<fmod(<[x]>,0)>> returns NaN, and sets <<errno>> to <<EDOM>>.
-
-You can modify error treatment for these functions using <<matherr>>.
-
-PORTABILITY
-<<fmod>> is ANSI C. <<fmodf>> is an extension.
-*/
-
-/*
- * wrapper fmod(x,y)
- */
-
-#include "fdlibm.h"
-#include <errno.h>
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double fmod(double x, double y) /* wrapper fmod */
-#else
- double fmod(x,y) /* wrapper fmod */
- double x,y;
-#endif
-{
-#ifdef _IEEE_LIBM
- return __ieee754_fmod(x,y);
-#else
- double z;
- struct exception exc;
- z = __ieee754_fmod(x,y);
- if(_LIB_VERSION == _IEEE_ ||isnan(y)||isnan(x)) return z;
- if(y==0.0) {
- /* fmod(x,0) */
- exc.type = DOMAIN;
- exc.name = "fmod";
- exc.arg1 = x;
- exc.arg2 = y;
- exc.err = 0;
- if (_LIB_VERSION == _SVID_)
- exc.retval = x;
- else
- exc.retval = 0.0/0.0;
- if (_LIB_VERSION == _POSIX_)
- errno = EDOM;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- } else
- return z;
-#endif
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/w_log.c b/libjava/java/lang/w_log.c
deleted file mode 100644
index dcc8b9762ec..00000000000
--- a/libjava/java/lang/w_log.c
+++ /dev/null
@@ -1,115 +0,0 @@
-
-/* @(#)w_log.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
- <<log>>, <<logf>>---natural logarithms
-
-INDEX
- log
-INDEX
- logf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double log(double <[x]>);
- float logf(float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double log(<[x]>);
- double <[x]>;
-
- float logf(<[x]>);
- float <[x]>;
-
-DESCRIPTION
-Return the natural logarithm of <[x]>, that is, its logarithm base e
-(where e is the base of the natural system of logarithms, 2.71828@dots{}).
-<<log>> and <<logf>> are identical save for the return and argument types.
-
-You can use the (non-ANSI) function <<matherr>> to specify error
-handling for these functions.
-
-RETURNS
-Normally, returns the calculated value. When <[x]> is zero, the
-returned value is <<-HUGE_VAL>> and <<errno>> is set to <<ERANGE>>.
-When <[x]> is negative, the returned value is <<-HUGE_VAL>> and
-<<errno>> is set to <<EDOM>>. You can control the error behavior via
-<<matherr>>.
-
-PORTABILITY
-<<log>> is ANSI, <<logf>> is an extension.
-*/
-
-/*
- * wrapper log(x)
- */
-
-#include "fdlibm.h"
-#include <errno.h>
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double log(double x) /* wrapper log */
-#else
- double log(x) /* wrapper log */
- double x;
-#endif
-{
-#ifdef _IEEE_LIBM
- return __ieee754_log(x);
-#else
- double z;
- struct exception exc;
- z = __ieee754_log(x);
- if(_LIB_VERSION == _IEEE_ || isnan(x) || x > 0.0) return z;
-#ifndef HUGE_VAL
-#define HUGE_VAL inf
- double inf = 0.0;
-
- SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
-#endif
- exc.name = "log";
- exc.err = 0;
- exc.arg1 = x;
- exc.arg2 = x;
- if (_LIB_VERSION == _SVID_)
- exc.retval = -HUGE;
- else
- exc.retval = -HUGE_VAL;
- if(x==0.0) {
- /* log(0) */
- exc.type = SING;
- if (_LIB_VERSION == _POSIX_)
- errno = ERANGE;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- } else {
- /* log(x<0) */
- exc.type = DOMAIN;
- if (_LIB_VERSION == _POSIX_)
- errno = EDOM;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
-#endif
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/lang/w_pow.c b/libjava/java/lang/w_pow.c
deleted file mode 100644
index 3df099a1714..00000000000
--- a/libjava/java/lang/w_pow.c
+++ /dev/null
@@ -1,231 +0,0 @@
-
-
-/* @(#)w_pow.c 5.2 93/10/01 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
- <<pow>>, <<powf>>---x to the power y
-INDEX
- pow
-INDEX
- powf
-
-
-ANSI_SYNOPSIS
- #include <math.h>
- double pow(double <[x]>, double <[y]>);
- float pow(float <[x]>, float <[y]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double pow(<[x]>, <[y]>);
- double <[x]>, <[y]>;
-
- float pow(<[x]>, <[y]>);
- float <[x]>, <[y]>;
-
-DESCRIPTION
- <<pow>> and <<powf>> calculate <[x]> raised to the exp1.0nt <[y]>.
- @tex
- (That is, $x^y$.)
- @end tex
-
-RETURNS
- On success, <<pow>> and <<powf>> return the value calculated.
-
- When the argument values would produce overflow, <<pow>>
- returns <<HUGE_VAL>> and set <<errno>> to <<ERANGE>>. If the
- argument <[x]> passed to <<pow>> or <<powf>> is a negative
- noninteger, and <[y]> is also not an integer, then <<errno>>
- is set to <<EDOM>>. If <[x]> and <[y]> are both 0, then
- <<pow>> and <<powf>> return <<1>>.
-
- You can modify error handling for these functions using <<matherr>>.
-
-PORTABILITY
- <<pow>> is ANSI C. <<powf>> is an extension. */
-
-/*
- * wrapper pow(x,y) return x**y
- */
-
-#include "fdlibm.h"
-#include <errno.h>
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double pow(double x, double y) /* wrapper pow */
-#else
- double pow(x,y) /* wrapper pow */
- double x,y;
-#endif
-{
-#ifdef _IEEE_LIBM
- return __ieee754_pow(x,y);
-#else
- double z;
-#ifndef HUGE_VAL
-#define HUGE_VAL inf
- double inf = 0.0;
-
- SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
-#endif
- struct exception exc;
- z=__ieee754_pow(x,y);
- if(_LIB_VERSION == _IEEE_|| isnan(y)) return z;
- if(isnan(x)) {
- if(y==0.0) {
- /* pow(NaN,0.0) */
- /* error only if _LIB_VERSION == _SVID_ & _XOPEN_ */
- exc.type = DOMAIN;
- exc.name = "pow";
- exc.err = 0;
- exc.arg1 = x;
- exc.arg2 = y;
- exc.retval = x;
- if (_LIB_VERSION == _IEEE_ ||
- _LIB_VERSION == _POSIX_) exc.retval = 1.0;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- } else
- return z;
- }
- if(x==0.0){
- if(y==0.0) {
- /* pow(0.0,0.0) */
- /* error only if _LIB_VERSION == _SVID_ */
- exc.type = DOMAIN;
- exc.name = "pow";
- exc.err = 0;
- exc.arg1 = x;
- exc.arg2 = y;
- exc.retval = 0.0;
- if (_LIB_VERSION != _SVID_) exc.retval = 1.0;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- }
- if(finite(y)&&y<0.0) {
- /* 0**neg */
- exc.type = DOMAIN;
- exc.name = "pow";
- exc.err = 0;
- exc.arg1 = x;
- exc.arg2 = y;
- if (_LIB_VERSION == _SVID_)
- exc.retval = 0.0;
- else
- exc.retval = -HUGE_VAL;
- if (_LIB_VERSION == _POSIX_)
- errno = EDOM;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- }
- return z;
- }
- if(!finite(z)) {
- if(finite(x)&&finite(y)) {
- if(isnan(z)) {
- /* neg**non-integral */
- exc.type = DOMAIN;
- exc.name = "pow";
- exc.err = 0;
- exc.arg1 = x;
- exc.arg2 = y;
- if (_LIB_VERSION == _SVID_)
- exc.retval = 0.0;
- else
- exc.retval = 0.0/0.0; /* X/Open allow NaN */
- if (_LIB_VERSION == _POSIX_)
- errno = EDOM;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- } else {
- /* pow(x,y) overflow */
- exc.type = OVERFLOW;
- exc.name = "pow";
- exc.err = 0;
- exc.arg1 = x;
- exc.arg2 = y;
- if (_LIB_VERSION == _SVID_) {
- exc.retval = HUGE;
- y *= 0.5;
- if(x<0.0&&rint(y)!=y) exc.retval = -HUGE;
- } else {
- exc.retval = HUGE_VAL;
- y *= 0.5;
- if(x<0.0&&rint(y)!=y) exc.retval = -HUGE_VAL;
- }
- if (_LIB_VERSION == _POSIX_)
- errno = ERANGE;
- else if (!matherr(&exc)) {
- errno = ERANGE;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- }
- }
- }
- if(z==0.0&&finite(x)&&finite(y)) {
- /* pow(x,y) underflow */
- exc.type = UNDERFLOW;
- exc.name = "pow";
- exc.err = 0;
- exc.arg1 = x;
- exc.arg2 = y;
- exc.retval = 0.0;
- if (_LIB_VERSION == _POSIX_)
- errno = ERANGE;
- else if (!matherr(&exc)) {
- errno = ERANGE;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- }
- return z;
-#endif
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libjava/java/lang/w_remainder.c b/libjava/java/lang/w_remainder.c
deleted file mode 100644
index a06be0e7b30..00000000000
--- a/libjava/java/lang/w_remainder.c
+++ /dev/null
@@ -1,119 +0,0 @@
-
-/* @(#)w_remainder.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
-<<rint>>, <<rintf>>, <<remainder>>, <<remainderf>>---round and remainder
-INDEX
- rint
-INDEX
- rintf
-INDEX
- remainder
-INDEX
- remainderf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double rint(double <[x]>);
- float rintf(float <[x]>);
- double remainder(double <[x]>, double <[y]>);
- float remainderf(float <[x]>, float <[y]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double rint(<[x]>)
- double <[x]>;
- float rintf(<[x]>)
- float <[x]>;
- double remainder(<[x]>,<[y]>)
- double <[x]>, <[y]>;
- float remainderf(<[x]>,<[y]>)
- float <[x]>, <[y]>;
-
-DESCRIPTION
-<<rint>> and <<rintf>> returns their argument rounded to the nearest
-integer. <<remainder>> and <<remainderf>> find the remainder of
-<[x]>/<[y]>; this value is in the range -<[y]>/2 .. +<[y]>/2.
-
-RETURNS
-<<rint>> and <<remainder>> return the integer result as a double.
-
-PORTABILITY
-<<rint>> and <<remainder>> are System V release 4. <<rintf>> and
-<<remainderf>> are extensions.
-
-*/
-
-/*
- * wrapper remainder(x,p)
- */
-
-#include "fdlibm.h"
-#include <errno.h>
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double remainder(double x, double y) /* wrapper remainder */
-#else
- double remainder(x,y) /* wrapper remainder */
- double x,y;
-#endif
-{
-#ifdef _IEEE_LIBM
- return __ieee754_remainder(x,y);
-#else
- double z;
- struct exception exc;
- z = __ieee754_remainder(x,y);
- if(_LIB_VERSION == _IEEE_ || isnan(y)) return z;
- if(y==0.0) {
- /* remainder(x,0) */
- exc.type = DOMAIN;
- exc.name = "remainder";
- exc.err = 0;
- exc.arg1 = x;
- exc.arg2 = y;
- exc.retval = 0.0/0.0;
- if (_LIB_VERSION == _POSIX_)
- errno = EDOM;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- } else
- return z;
-#endif
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libjava/java/lang/w_sqrt.c b/libjava/java/lang/w_sqrt.c
deleted file mode 100644
index 23a793ce74a..00000000000
--- a/libjava/java/lang/w_sqrt.c
+++ /dev/null
@@ -1,93 +0,0 @@
-
-/* @(#)w_sqrt.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
-FUNCTION
- <<sqrt>>, <<sqrtf>>---positive square root
-
-INDEX
- sqrt
-INDEX
- sqrtf
-
-ANSI_SYNOPSIS
- #include <math.h>
- double sqrt(double <[x]>);
- float sqrtf(float <[x]>);
-
-TRAD_SYNOPSIS
- #include <math.h>
- double sqrt(<[x]>);
- float sqrtf(<[x]>);
-
-DESCRIPTION
- <<sqrt>> computes the positive square root of the argument.
- You can modify error handling for this function with
- <<matherr>>.
-
-RETURNS
- On success, the square root is returned. If <[x]> is real and
- positive, then the result is positive. If <[x]> is real and
- negative, the global value <<errno>> is set to <<EDOM>> (domain error).
-
-
-PORTABILITY
- <<sqrt>> is ANSI C. <<sqrtf>> is an extension.
-*/
-
-/*
- * wrapper sqrt(x)
- */
-
-#include "fdlibm.h"
-#include <errno.h>
-
-#ifndef _DOUBLE_IS_32BITS
-
-#ifdef __STDC__
- double sqrt(double x) /* wrapper sqrt */
-#else
- double sqrt(x) /* wrapper sqrt */
- double x;
-#endif
-{
-#ifdef _IEEE_LIBM
- return __ieee754_sqrt(x);
-#else
- struct exception exc;
- double z;
- z = __ieee754_sqrt(x);
- if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
- if(x<0.0) {
- exc.type = DOMAIN;
- exc.name = "sqrt";
- exc.err = 0;
- exc.arg1 = exc.arg2 = x;
- if (_LIB_VERSION == _SVID_)
- exc.retval = 0.0;
- else
- exc.retval = 0.0/0.0;
- if (_LIB_VERSION == _POSIX_)
- errno = EDOM;
- else if (!matherr(&exc)) {
- errno = EDOM;
- }
- if (exc.err != 0)
- errno = exc.err;
- return exc.retval;
- } else
- return z;
-#endif
-}
-
-#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/libjava/java/math/BigDecimal.java b/libjava/java/math/BigDecimal.java
deleted file mode 100644
index d99be0f56ba..00000000000
--- a/libjava/java/math/BigDecimal.java
+++ /dev/null
@@ -1,517 +0,0 @@
-/* java.math.BigDecimal -- Arbitrary precision decimals.
- Copyright (C) 1999, 2000, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.math;
-
-public class BigDecimal extends Number implements Comparable
-{
- private BigInteger intVal;
- private int scale;
- private static final long serialVersionUID = 6108874887143696463L;
-
- private static final BigDecimal ZERO =
- new BigDecimal (BigInteger.valueOf (0), 0);
-
- private static final BigDecimal ONE =
- new BigDecimal (BigInteger.valueOf (1), 0);
-
- public static final int ROUND_UP = 0;
- public static final int ROUND_DOWN = 1;
- public static final int ROUND_CEILING = 2;
- public static final int ROUND_FLOOR = 3;
- public static final int ROUND_HALF_UP = 4;
- public static final int ROUND_HALF_DOWN = 5;
- public static final int ROUND_HALF_EVEN = 6;
- public static final int ROUND_UNNECESSARY = 7;
-
- public BigDecimal (BigInteger num)
- {
- this (num, 0);
- }
-
- public BigDecimal (BigInteger num, int scale) throws NumberFormatException
- {
- if (scale < 0)
- throw new NumberFormatException ("scale of " + scale + " is < 0");
- this.intVal = num;
- this.scale = scale;
- }
-
- public BigDecimal (double num) throws NumberFormatException
- {
- if (Double.isInfinite (num) || Double.isNaN (num))
- throw new NumberFormatException ("invalid argument: " + num);
- // Note we can't convert NUM to a String and then use the
- // String-based constructor. The BigDecimal documentation makes
- // it clear that the two constructors work differently.
-
- final int mantissaBits = 52;
- final int exponentBits = 11;
- final long mantMask = (1L << mantissaBits) - 1;
- final long expMask = (1L << exponentBits) - 1;
-
- long bits = Double.doubleToLongBits (num);
- long mantissa = bits & mantMask;
- long exponent = (bits >>> mantissaBits) & expMask;
- boolean denormal = exponent == 0;
- // Correct the exponent for the bias.
- exponent -= denormal ? 1022 : 1023;
- // Now correct the exponent to account for the bits to the right
- // of the decimal.
- exponent -= mantissaBits;
- // Ordinary numbers have an implied leading `1' bit.
- if (! denormal)
- mantissa |= (1L << mantissaBits);
-
- // Shave off factors of 10.
- while (exponent < 0 && (mantissa & 1) == 0)
- {
- ++exponent;
- mantissa >>= 1;
- }
-
- intVal = BigInteger.valueOf (bits < 0 ? - mantissa : mantissa);
- if (exponent < 0)
- {
- // We have MANTISSA * 2 ^ (EXPONENT).
- // Since (1/2)^N == 5^N * 10^-N we can easily convert this
- // into a power of 10.
- scale = (int) (- exponent);
- BigInteger mult = BigInteger.valueOf (5).pow (scale);
- intVal = intVal.multiply (mult);
- }
- else
- {
- intVal = intVal.shiftLeft ((int) exponent);
- scale = 0;
- }
- }
-
- public BigDecimal (String num) throws NumberFormatException
- {
- int len = num.length();
- int start = 0, point = 0;
- int dot = -1;
- boolean negative = false;
- if (num.charAt(0) == '+')
- {
- ++start;
- ++point;
- }
- else if (num.charAt(0) == '-')
- {
- ++start;
- ++point;
- negative = true;
- }
-
- while (point < len)
- {
- char c = num.charAt (point);
- if (c == '.')
- {
- if (dot >= 0)
- throw new NumberFormatException ("multiple `.'s in number");
- dot = point;
- }
- else if (c == 'e' || c == 'E')
- break;
- else if (Character.digit (c, 10) < 0)
- throw new NumberFormatException ("unrecognized character: " + c);
- ++point;
- }
-
- String val;
- if (dot >= 0)
- {
- val = num.substring (start, dot) + num.substring (dot + 1, point);
- scale = point - 1 - dot;
- }
- else
- {
- val = num.substring (start, point);
- scale = 0;
- }
- if (val.length () == 0)
- throw new NumberFormatException ("no digits seen");
-
- if (negative)
- val = "-" + val;
- intVal = new BigInteger (val);
-
- // Now parse exponent.
- if (point < len)
- {
- point++;
- if (num.charAt(point) == '+')
- point++;
-
- if (point >= len )
- throw new NumberFormatException ("no exponent following e or E");
-
- try
- {
- int exp = Integer.parseInt (num.substring (point));
- exp -= scale;
- if (signum () == 0)
- scale = 0;
- else if (exp > 0)
- {
- intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp));
- scale = 0;
- }
- else
- scale = - exp;
- }
- catch (NumberFormatException ex)
- {
- throw new NumberFormatException ("malformed exponent");
- }
- }
- }
-
- public static BigDecimal valueOf (long val)
- {
- return valueOf (val, 0);
- }
-
- public static BigDecimal valueOf (long val, int scale)
- throws NumberFormatException
- {
- if ((scale == 0) && ((int)val == val))
- switch ((int) val)
- {
- case 0:
- return ZERO;
- case 1:
- return ONE;
- }
-
- return new BigDecimal (BigInteger.valueOf (val), scale);
- }
-
- public BigDecimal add (BigDecimal val)
- {
- // For addition, need to line up decimals. Note that the movePointRight
- // method cannot be used for this as it might return a BigDecimal with
- // scale == 0 instead of the scale we need.
- BigInteger op1 = intVal;
- BigInteger op2 = val.intVal;
- if (scale < val.scale)
- op1 = op1.multiply (BigInteger.valueOf (10).pow (val.scale - scale));
- else if (scale > val.scale)
- op2 = op2.multiply (BigInteger.valueOf (10).pow (scale - val.scale));
-
- return new BigDecimal (op1.add (op2), Math.max (scale, val.scale));
- }
-
- public BigDecimal subtract (BigDecimal val)
- {
- return this.add(val.negate());
- }
-
- public BigDecimal multiply (BigDecimal val)
- {
- return new BigDecimal (intVal.multiply (val.intVal), scale + val.scale);
- }
-
- public BigDecimal divide (BigDecimal val, int roundingMode)
- throws ArithmeticException, IllegalArgumentException
- {
- return divide (val, scale, roundingMode);
- }
-
- public BigDecimal divide(BigDecimal val, int newScale, int roundingMode)
- throws ArithmeticException, IllegalArgumentException
- {
- if (roundingMode < 0 || roundingMode > 7)
- throw
- new IllegalArgumentException("illegal rounding mode: " + roundingMode);
-
- if (newScale < 0)
- throw new ArithmeticException ("scale is negative: " + newScale);
-
- if (intVal.signum () == 0) // handle special case of 0.0/0.0
- return newScale == 0 ? ZERO : new BigDecimal (ZERO.intVal, newScale);
-
- // Ensure that pow gets a non-negative value.
- BigInteger valIntVal = val.intVal;
- int power = newScale - (scale - val.scale);
- if (power < 0)
- {
- // Effectively increase the scale of val to avoid an
- // ArithmeticException for a negative power.
- valIntVal = valIntVal.multiply (BigInteger.valueOf (10).pow (-power));
- power = 0;
- }
-
- BigInteger dividend = intVal.multiply (BigInteger.valueOf (10).pow (power));
-
- BigInteger parts[] = dividend.divideAndRemainder (valIntVal);
-
- BigInteger unrounded = parts[0];
- if (parts[1].signum () == 0) // no remainder, no rounding necessary
- return new BigDecimal (unrounded, newScale);
-
- if (roundingMode == ROUND_UNNECESSARY)
- throw new ArithmeticException ("newScale is not large enough");
-
- int sign = intVal.signum () * valIntVal.signum ();
-
- if (roundingMode == ROUND_CEILING)
- roundingMode = (sign > 0) ? ROUND_UP : ROUND_DOWN;
- else if (roundingMode == ROUND_FLOOR)
- roundingMode = (sign < 0) ? ROUND_UP : ROUND_DOWN;
- else
- {
- // half is -1 if remainder*2 < positive intValue (*power), 0 if equal,
- // 1 if >. This implies that the remainder to round is less than,
- // equal to, or greater than half way to the next digit.
- BigInteger posRemainder
- = parts[1].signum () < 0 ? parts[1].negate() : parts[1];
- valIntVal = valIntVal.signum () < 0 ? valIntVal.negate () : valIntVal;
- int half = posRemainder.shiftLeft(1).compareTo(valIntVal);
-
- switch(roundingMode)
- {
- case ROUND_HALF_UP:
- roundingMode = (half < 0) ? ROUND_DOWN : ROUND_UP;
- break;
- case ROUND_HALF_DOWN:
- roundingMode = (half > 0) ? ROUND_UP : ROUND_DOWN;
- break;
- case ROUND_HALF_EVEN:
- if (half < 0)
- roundingMode = ROUND_DOWN;
- else if (half > 0)
- roundingMode = ROUND_UP;
- else if (unrounded.testBit(0)) // odd, then ROUND_HALF_UP
- roundingMode = ROUND_UP;
- else // even, ROUND_HALF_DOWN
- roundingMode = ROUND_DOWN;
- break;
- }
- }
-
- if (roundingMode == ROUND_UP)
- unrounded = unrounded.add (BigInteger.valueOf (sign > 0 ? 1 : -1));
-
- // roundingMode == ROUND_DOWN
- return new BigDecimal (unrounded, newScale);
- }
-
- public int compareTo (BigDecimal val)
- {
- if (scale == val.scale)
- return intVal.compareTo (val.intVal);
-
- BigInteger thisParts[] =
- intVal.divideAndRemainder (BigInteger.valueOf (10).pow (scale));
- BigInteger valParts[] =
- val.intVal.divideAndRemainder (BigInteger.valueOf (10).pow (val.scale));
-
- int compare;
- if ((compare = thisParts[0].compareTo (valParts[0])) != 0)
- return compare;
-
- // quotients are the same, so compare remainders
-
- // remove trailing zeros
- if (thisParts[1].equals (BigInteger.valueOf (0)) == false)
- while (thisParts[1].mod (BigInteger.valueOf (10)).equals
- (BigInteger.valueOf (0)))
- thisParts[1] = thisParts[1].divide (BigInteger.valueOf (10));
- // again...
- if (valParts[1].equals(BigInteger.valueOf (0)) == false)
- while (valParts[1].mod (BigInteger.valueOf (10)).equals
- (BigInteger.valueOf (0)))
- valParts[1] = valParts[1].divide (BigInteger.valueOf (10));
-
- // and compare them
- return thisParts[1].compareTo (valParts[1]);
- }
-
- public int compareTo (Object val)
- {
- return(compareTo((BigDecimal)val));
- }
-
- public boolean equals (Object o)
- {
- return (o instanceof BigDecimal
- && scale == ((BigDecimal) o).scale
- && compareTo ((BigDecimal) o) == 0);
- }
-
- public int hashCode()
- {
- return intValue() ^ scale;
- }
-
- public BigDecimal max (BigDecimal val)
- {
- switch (compareTo (val))
- {
- case 1:
- return this;
- default:
- return val;
- }
- }
-
- public BigDecimal min (BigDecimal val)
- {
- switch (compareTo (val))
- {
- case -1:
- return this;
- default:
- return val;
- }
- }
-
- public BigDecimal movePointLeft (int n)
- {
- return (n < 0) ? movePointRight (-n) : new BigDecimal (intVal, scale + n);
- }
-
- public BigDecimal movePointRight (int n)
- {
- if (n < 0)
- return movePointLeft (-n);
-
- if (scale >= n)
- return new BigDecimal (intVal, scale - n);
-
- return new BigDecimal (intVal.multiply
- (BigInteger.valueOf (10).pow (n - scale)), 0);
- }
-
- public int signum ()
- {
- return intVal.signum ();
- }
-
- public int scale ()
- {
- return scale;
- }
-
- public BigInteger unscaledValue()
- {
- return intVal;
- }
-
- public BigDecimal abs ()
- {
- return new BigDecimal (intVal.abs (), scale);
- }
-
- public BigDecimal negate ()
- {
- return new BigDecimal (intVal.negate (), scale);
- }
-
- public String toString ()
- {
- String bigStr = intVal.toString();
- if (scale == 0)
- return bigStr;
-
- boolean negative = (bigStr.charAt(0) == '-');
-
- int point = bigStr.length() - scale - (negative ? 1 : 0);
-
- StringBuffer sb = new StringBuffer(bigStr.length() + 2 +
- (point <= 0 ? (-point + 1) : 0));
- if (point <= 0)
- {
- if (negative)
- sb.append('-');
- sb.append('0').append('.');
- while (point < 0)
- {
- sb.append('0');
- point++;
- }
- sb.append(bigStr.substring(negative ? 1 : 0));
- }
- else
- {
- sb.append(bigStr);
- sb.insert(point + (negative ? 1 : 0), '.');
- }
- return sb.toString();
- }
-
- public BigInteger toBigInteger ()
- {
- return scale == 0 ? intVal :
- intVal.divide (BigInteger.valueOf (10).pow (scale));
- }
-
- public int intValue ()
- {
- return toBigInteger ().intValue ();
- }
-
- public long longValue ()
- {
- return toBigInteger().longValue();
- }
-
- public float floatValue()
- {
- return Float.valueOf(toString()).floatValue();
- }
-
- public double doubleValue()
- {
- return Double.valueOf(toString()).doubleValue();
- }
-
- public BigDecimal setScale (int scale) throws ArithmeticException
- {
- return setScale (scale, ROUND_UNNECESSARY);
- }
-
- public BigDecimal setScale (int scale, int roundingMode)
- throws ArithmeticException, IllegalArgumentException
- {
- return divide (ONE, scale, roundingMode);
- }
-}
diff --git a/libjava/java/math/BigInteger.java b/libjava/java/math/BigInteger.java
deleted file mode 100644
index 82f550d144c..00000000000
--- a/libjava/java/math/BigInteger.java
+++ /dev/null
@@ -1,2230 +0,0 @@
-/* java.math.BigInteger -- Arbitary precision integers
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.math;
-
-import gnu.java.math.MPN;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Random;
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998) and
- * "Applied Cryptography, Second Edition" by Bruce Schneier (Wiley, 1996).
- *
- * Based primarily on IntNum.java BitOps.java by Per Bothner (per@bothner.com)
- * (found in Kawa 1.6.62).
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @date December 20, 1999.
- * @status believed complete and correct.
- */
-public class BigInteger extends Number implements Comparable
-{
- /** All integers are stored in 2's-complement form.
- * If words == null, the ival is the value of this BigInteger.
- * Otherwise, the first ival elements of words make the value
- * of this BigInteger, stored in little-endian order, 2's-complement form. */
- private transient int ival;
- private transient int[] words;
-
- // Serialization fields.
- private int bitCount = -1;
- private int bitLength = -1;
- private int firstNonzeroByteNum = -2;
- private int lowestSetBit = -2;
- private byte[] magnitude;
- private int signum;
- private static final long serialVersionUID = -8287574255936472291L;
-
-
- /** We pre-allocate integers in the range minFixNum..maxFixNum. */
- private static final int minFixNum = -100;
- private static final int maxFixNum = 1024;
- private static final int numFixNum = maxFixNum-minFixNum+1;
- private static final BigInteger[] smallFixNums = new BigInteger[numFixNum];
-
- static {
- for (int i = numFixNum; --i >= 0; )
- smallFixNums[i] = new BigInteger(i + minFixNum);
- }
-
- // JDK1.2
- public static final BigInteger ZERO = smallFixNums[-minFixNum];
-
- // JDK1.2
- public static final BigInteger ONE = smallFixNums[1 - minFixNum];
-
- /* Rounding modes: */
- private static final int FLOOR = 1;
- private static final int CEILING = 2;
- private static final int TRUNCATE = 3;
- private static final int ROUND = 4;
-
- /** When checking the probability of primes, it is most efficient to
- * first check the factoring of small primes, so we'll use this array.
- */
- private static final int[] primes =
- { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,
- 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107,
- 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181,
- 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251 };
-
- /** HAC (Handbook of Applied Cryptography), Alfred Menezes & al. Table 4.4. */
- private static final int[] k =
- {100,150,200,250,300,350,400,500,600,800,1250, Integer.MAX_VALUE};
- private static final int[] t =
- { 27, 18, 15, 12, 9, 8, 7, 6, 5, 4, 3, 2};
-
- private BigInteger()
- {
- }
-
- /* Create a new (non-shared) BigInteger, and initialize to an int. */
- private BigInteger(int value)
- {
- ival = value;
- }
-
- public BigInteger(String val, int radix)
- {
- BigInteger result = valueOf(val, radix);
- this.ival = result.ival;
- this.words = result.words;
- }
-
- public BigInteger(String val)
- {
- this(val, 10);
- }
-
- /* Create a new (non-shared) BigInteger, and initialize from a byte array. */
- public BigInteger(byte[] val)
- {
- if (val == null || val.length < 1)
- throw new NumberFormatException();
-
- words = byteArrayToIntArray(val, val[0] < 0 ? -1 : 0);
- BigInteger result = make(words, words.length);
- this.ival = result.ival;
- this.words = result.words;
- }
-
- public BigInteger(int signum, byte[] magnitude)
- {
- if (magnitude == null || signum > 1 || signum < -1)
- throw new NumberFormatException();
-
- if (signum == 0)
- {
- int i;
- for (i = magnitude.length - 1; i >= 0 && magnitude[i] == 0; --i)
- ;
- if (i >= 0)
- throw new NumberFormatException();
- return;
- }
-
- // Magnitude is always positive, so don't ever pass a sign of -1.
- words = byteArrayToIntArray(magnitude, 0);
- BigInteger result = make(words, words.length);
- this.ival = result.ival;
- this.words = result.words;
-
- if (signum < 0)
- setNegative();
- }
-
- public BigInteger(int numBits, Random rnd)
- {
- if (numBits < 0)
- throw new IllegalArgumentException();
-
- init(numBits, rnd);
- }
-
- private void init(int numBits, Random rnd)
- {
- int highbits = numBits & 31;
- if (highbits > 0)
- highbits = rnd.nextInt() >>> (32 - highbits);
- int nwords = numBits / 32;
-
- while (highbits == 0 && nwords > 0)
- {
- highbits = rnd.nextInt();
- --nwords;
- }
- if (nwords == 0 && highbits >= 0)
- {
- ival = highbits;
- }
- else
- {
- ival = highbits < 0 ? nwords + 2 : nwords + 1;
- words = new int[ival];
- words[nwords] = highbits;
- while (--nwords >= 0)
- words[nwords] = rnd.nextInt();
- }
- }
-
- public BigInteger(int bitLength, int certainty, Random rnd)
- {
- this(bitLength, rnd);
-
- // Keep going until we find a probable prime.
- while (true)
- {
- if (isProbablePrime(certainty))
- return;
-
- init(bitLength, rnd);
- }
- }
-
- /**
- * Return a BigInteger that is bitLength bits long with a
- * probability < 2^-100 of being composite.
- *
- * @param bitLength length in bits of resulting number
- * @param rnd random number generator to use
- * @throws ArithmeticException if bitLength < 2
- * @since 1.4
- */
- public static BigInteger probablePrime(int bitLength, Random rnd)
- {
- if (bitLength < 2)
- throw new ArithmeticException();
-
- return new BigInteger(bitLength, 100, rnd);
- }
-
- /** Return a (possibly-shared) BigInteger with a given long value. */
- public static BigInteger valueOf(long val)
- {
- if (val >= minFixNum && val <= maxFixNum)
- return smallFixNums[(int) val - minFixNum];
- int i = (int) val;
- if ((long) i == val)
- return new BigInteger(i);
- BigInteger result = alloc(2);
- result.ival = 2;
- result.words[0] = i;
- result.words[1] = (int)(val >> 32);
- return result;
- }
-
- /** Make a canonicalized BigInteger from an array of words.
- * The array may be reused (without copying). */
- private static BigInteger make(int[] words, int len)
- {
- if (words == null)
- return valueOf(len);
- len = BigInteger.wordsNeeded(words, len);
- if (len <= 1)
- return len == 0 ? ZERO : valueOf(words[0]);
- BigInteger num = new BigInteger();
- num.words = words;
- num.ival = len;
- return num;
- }
-
- /** Convert a big-endian byte array to a little-endian array of words. */
- private static int[] byteArrayToIntArray(byte[] bytes, int sign)
- {
- // Determine number of words needed.
- int[] words = new int[bytes.length/4 + 1];
- int nwords = words.length;
-
- // Create a int out of modulo 4 high order bytes.
- int bptr = 0;
- int word = sign;
- for (int i = bytes.length % 4; i > 0; --i, bptr++)
- word = (word << 8) | (bytes[bptr] & 0xff);
- words[--nwords] = word;
-
- // Elements remaining in byte[] are a multiple of 4.
- while (nwords > 0)
- words[--nwords] = bytes[bptr++] << 24 |
- (bytes[bptr++] & 0xff) << 16 |
- (bytes[bptr++] & 0xff) << 8 |
- (bytes[bptr++] & 0xff);
- return words;
- }
-
- /** Allocate a new non-shared BigInteger.
- * @param nwords number of words to allocate
- */
- private static BigInteger alloc(int nwords)
- {
- BigInteger result = new BigInteger();
- if (nwords > 1)
- result.words = new int[nwords];
- return result;
- }
-
- /** Change words.length to nwords.
- * We allow words.length to be upto nwords+2 without reallocating.
- */
- private void realloc(int nwords)
- {
- if (nwords == 0)
- {
- if (words != null)
- {
- if (ival > 0)
- ival = words[0];
- words = null;
- }
- }
- else if (words == null
- || words.length < nwords
- || words.length > nwords + 2)
- {
- int[] new_words = new int [nwords];
- if (words == null)
- {
- new_words[0] = ival;
- ival = 1;
- }
- else
- {
- if (nwords < ival)
- ival = nwords;
- System.arraycopy(words, 0, new_words, 0, ival);
- }
- words = new_words;
- }
- }
-
- private boolean isNegative()
- {
- return (words == null ? ival : words[ival - 1]) < 0;
- }
-
- public int signum()
- {
- int top = words == null ? ival : words[ival-1];
- if (top == 0 && words == null)
- return 0;
- return top < 0 ? -1 : 1;
- }
-
- private static int compareTo(BigInteger x, BigInteger y)
- {
- if (x.words == null && y.words == null)
- return x.ival < y.ival ? -1 : x.ival > y.ival ? 1 : 0;
- boolean x_negative = x.isNegative();
- boolean y_negative = y.isNegative();
- if (x_negative != y_negative)
- return x_negative ? -1 : 1;
- int x_len = x.words == null ? 1 : x.ival;
- int y_len = y.words == null ? 1 : y.ival;
- if (x_len != y_len)
- return (x_len > y_len) != x_negative ? 1 : -1;
- return MPN.cmp(x.words, y.words, x_len);
- }
-
- // JDK1.2
- public int compareTo(Object obj)
- {
- if (obj instanceof BigInteger)
- return compareTo(this, (BigInteger) obj);
- throw new ClassCastException();
- }
-
- public int compareTo(BigInteger val)
- {
- return compareTo(this, val);
- }
-
- public BigInteger min(BigInteger val)
- {
- return compareTo(this, val) < 0 ? this : val;
- }
-
- public BigInteger max(BigInteger val)
- {
- return compareTo(this, val) > 0 ? this : val;
- }
-
- private boolean isZero()
- {
- return words == null && ival == 0;
- }
-
- private boolean isOne()
- {
- return words == null && ival == 1;
- }
-
- /** Calculate how many words are significant in words[0:len-1].
- * Returns the least value x such that x>0 && words[0:x-1]==words[0:len-1],
- * when words is viewed as a 2's complement integer.
- */
- private static int wordsNeeded(int[] words, int len)
- {
- int i = len;
- if (i > 0)
- {
- int word = words[--i];
- if (word == -1)
- {
- while (i > 0 && (word = words[i - 1]) < 0)
- {
- i--;
- if (word != -1) break;
- }
- }
- else
- {
- while (word == 0 && i > 0 && (word = words[i - 1]) >= 0) i--;
- }
- }
- return i + 1;
- }
-
- private BigInteger canonicalize()
- {
- if (words != null
- && (ival = BigInteger.wordsNeeded(words, ival)) <= 1)
- {
- if (ival == 1)
- ival = words[0];
- words = null;
- }
- if (words == null && ival >= minFixNum && ival <= maxFixNum)
- return smallFixNums[ival - minFixNum];
- return this;
- }
-
- /** Add two ints, yielding a BigInteger. */
- private static BigInteger add(int x, int y)
- {
- return valueOf((long) x + (long) y);
- }
-
- /** Add a BigInteger and an int, yielding a new BigInteger. */
- private static BigInteger add(BigInteger x, int y)
- {
- if (x.words == null)
- return BigInteger.add(x.ival, y);
- BigInteger result = new BigInteger(0);
- result.setAdd(x, y);
- return result.canonicalize();
- }
-
- /** Set this to the sum of x and y.
- * OK if x==this. */
- private void setAdd(BigInteger x, int y)
- {
- if (x.words == null)
- {
- set((long) x.ival + (long) y);
- return;
- }
- int len = x.ival;
- realloc(len + 1);
- long carry = y;
- for (int i = 0; i < len; i++)
- {
- carry += ((long) x.words[i] & 0xffffffffL);
- words[i] = (int) carry;
- carry >>= 32;
- }
- if (x.words[len - 1] < 0)
- carry--;
- words[len] = (int) carry;
- ival = wordsNeeded(words, len + 1);
- }
-
- /** Destructively add an int to this. */
- private void setAdd(int y)
- {
- setAdd(this, y);
- }
-
- /** Destructively set the value of this to a long. */
- private void set(long y)
- {
- int i = (int) y;
- if ((long) i == y)
- {
- ival = i;
- words = null;
- }
- else
- {
- realloc(2);
- words[0] = i;
- words[1] = (int) (y >> 32);
- ival = 2;
- }
- }
-
- /** Destructively set the value of this to the given words.
- * The words array is reused, not copied. */
- private void set(int[] words, int length)
- {
- this.ival = length;
- this.words = words;
- }
-
- /** Destructively set the value of this to that of y. */
- private void set(BigInteger y)
- {
- if (y.words == null)
- set(y.ival);
- else if (this != y)
- {
- realloc(y.ival);
- System.arraycopy(y.words, 0, words, 0, y.ival);
- ival = y.ival;
- }
- }
-
- /** Add two BigIntegers, yielding their sum as another BigInteger. */
- private static BigInteger add(BigInteger x, BigInteger y, int k)
- {
- if (x.words == null && y.words == null)
- return valueOf((long) k * (long) y.ival + (long) x.ival);
- if (k != 1)
- {
- if (k == -1)
- y = BigInteger.neg(y);
- else
- y = BigInteger.times(y, valueOf(k));
- }
- if (x.words == null)
- return BigInteger.add(y, x.ival);
- if (y.words == null)
- return BigInteger.add(x, y.ival);
- // Both are big
- if (y.ival > x.ival)
- { // Swap so x is longer then y.
- BigInteger tmp = x; x = y; y = tmp;
- }
- BigInteger result = alloc(x.ival + 1);
- int i = y.ival;
- long carry = MPN.add_n(result.words, x.words, y.words, i);
- long y_ext = y.words[i - 1] < 0 ? 0xffffffffL : 0;
- for (; i < x.ival; i++)
- {
- carry += ((long) x.words[i] & 0xffffffffL) + y_ext;;
- result.words[i] = (int) carry;
- carry >>>= 32;
- }
- if (x.words[i - 1] < 0)
- y_ext--;
- result.words[i] = (int) (carry + y_ext);
- result.ival = i+1;
- return result.canonicalize();
- }
-
- public BigInteger add(BigInteger val)
- {
- return add(this, val, 1);
- }
-
- public BigInteger subtract(BigInteger val)
- {
- return add(this, val, -1);
- }
-
- private static BigInteger times(BigInteger x, int y)
- {
- if (y == 0)
- return ZERO;
- if (y == 1)
- return x;
- int[] xwords = x.words;
- int xlen = x.ival;
- if (xwords == null)
- return valueOf((long) xlen * (long) y);
- boolean negative;
- BigInteger result = BigInteger.alloc(xlen + 1);
- if (xwords[xlen - 1] < 0)
- {
- negative = true;
- negate(result.words, xwords, xlen);
- xwords = result.words;
- }
- else
- negative = false;
- if (y < 0)
- {
- negative = !negative;
- y = -y;
- }
- result.words[xlen] = MPN.mul_1(result.words, xwords, xlen, y);
- result.ival = xlen + 1;
- if (negative)
- result.setNegative();
- return result.canonicalize();
- }
-
- private static BigInteger times(BigInteger x, BigInteger y)
- {
- if (y.words == null)
- return times(x, y.ival);
- if (x.words == null)
- return times(y, x.ival);
- boolean negative = false;
- int[] xwords;
- int[] ywords;
- int xlen = x.ival;
- int ylen = y.ival;
- if (x.isNegative())
- {
- negative = true;
- xwords = new int[xlen];
- negate(xwords, x.words, xlen);
- }
- else
- {
- negative = false;
- xwords = x.words;
- }
- if (y.isNegative())
- {
- negative = !negative;
- ywords = new int[ylen];
- negate(ywords, y.words, ylen);
- }
- else
- ywords = y.words;
- // Swap if x is shorter then y.
- if (xlen < ylen)
- {
- int[] twords = xwords; xwords = ywords; ywords = twords;
- int tlen = xlen; xlen = ylen; ylen = tlen;
- }
- BigInteger result = BigInteger.alloc(xlen+ylen);
- MPN.mul(result.words, xwords, xlen, ywords, ylen);
- result.ival = xlen+ylen;
- if (negative)
- result.setNegative();
- return result.canonicalize();
- }
-
- public BigInteger multiply(BigInteger y)
- {
- return times(this, y);
- }
-
- private static void divide(long x, long y,
- BigInteger quotient, BigInteger remainder,
- int rounding_mode)
- {
- boolean xNegative, yNegative;
- if (x < 0)
- {
- xNegative = true;
- if (x == Long.MIN_VALUE)
- {
- divide(valueOf(x), valueOf(y),
- quotient, remainder, rounding_mode);
- return;
- }
- x = -x;
- }
- else
- xNegative = false;
-
- if (y < 0)
- {
- yNegative = true;
- if (y == Long.MIN_VALUE)
- {
- if (rounding_mode == TRUNCATE)
- { // x != Long.Min_VALUE implies abs(x) < abs(y)
- if (quotient != null)
- quotient.set(0);
- if (remainder != null)
- remainder.set(x);
- }
- else
- divide(valueOf(x), valueOf(y),
- quotient, remainder, rounding_mode);
- return;
- }
- y = -y;
- }
- else
- yNegative = false;
-
- long q = x / y;
- long r = x % y;
- boolean qNegative = xNegative ^ yNegative;
-
- boolean add_one = false;
- if (r != 0)
- {
- switch (rounding_mode)
- {
- case TRUNCATE:
- break;
- case CEILING:
- case FLOOR:
- if (qNegative == (rounding_mode == FLOOR))
- add_one = true;
- break;
- case ROUND:
- add_one = r > ((y - (q & 1)) >> 1);
- break;
- }
- }
- if (quotient != null)
- {
- if (add_one)
- q++;
- if (qNegative)
- q = -q;
- quotient.set(q);
- }
- if (remainder != null)
- {
- // The remainder is by definition: X-Q*Y
- if (add_one)
- {
- // Subtract the remainder from Y.
- r = y - r;
- // In this case, abs(Q*Y) > abs(X).
- // So sign(remainder) = -sign(X).
- xNegative = ! xNegative;
- }
- else
- {
- // If !add_one, then: abs(Q*Y) <= abs(X).
- // So sign(remainder) = sign(X).
- }
- if (xNegative)
- r = -r;
- remainder.set(r);
- }
- }
-
- /** Divide two integers, yielding quotient and remainder.
- * @param x the numerator in the division
- * @param y the denominator in the division
- * @param quotient is set to the quotient of the result (iff quotient!=null)
- * @param remainder is set to the remainder of the result
- * (iff remainder!=null)
- * @param rounding_mode one of FLOOR, CEILING, TRUNCATE, or ROUND.
- */
- private static void divide(BigInteger x, BigInteger y,
- BigInteger quotient, BigInteger remainder,
- int rounding_mode)
- {
- if ((x.words == null || x.ival <= 2)
- && (y.words == null || y.ival <= 2))
- {
- long x_l = x.longValue();
- long y_l = y.longValue();
- if (x_l != Long.MIN_VALUE && y_l != Long.MIN_VALUE)
- {
- divide(x_l, y_l, quotient, remainder, rounding_mode);
- return;
- }
- }
-
- boolean xNegative = x.isNegative();
- boolean yNegative = y.isNegative();
- boolean qNegative = xNegative ^ yNegative;
-
- int ylen = y.words == null ? 1 : y.ival;
- int[] ywords = new int[ylen];
- y.getAbsolute(ywords);
- while (ylen > 1 && ywords[ylen - 1] == 0) ylen--;
-
- int xlen = x.words == null ? 1 : x.ival;
- int[] xwords = new int[xlen+2];
- x.getAbsolute(xwords);
- while (xlen > 1 && xwords[xlen-1] == 0) xlen--;
-
- int qlen, rlen;
-
- int cmpval = MPN.cmp(xwords, xlen, ywords, ylen);
- if (cmpval < 0) // abs(x) < abs(y)
- { // quotient = 0; remainder = num.
- int[] rwords = xwords; xwords = ywords; ywords = rwords;
- rlen = xlen; qlen = 1; xwords[0] = 0;
- }
- else if (cmpval == 0) // abs(x) == abs(y)
- {
- xwords[0] = 1; qlen = 1; // quotient = 1
- ywords[0] = 0; rlen = 1; // remainder = 0;
- }
- else if (ylen == 1)
- {
- qlen = xlen;
- // Need to leave room for a word of leading zeros if dividing by 1
- // and the dividend has the high bit set. It might be safe to
- // increment qlen in all cases, but it certainly is only necessary
- // in the following case.
- if (ywords[0] == 1 && xwords[xlen-1] < 0)
- qlen++;
- rlen = 1;
- ywords[0] = MPN.divmod_1(xwords, xwords, xlen, ywords[0]);
- }
- else // abs(x) > abs(y)
- {
- // Normalize the denominator, i.e. make its most significant bit set by
- // shifting it normalization_steps bits to the left. Also shift the
- // numerator the same number of steps (to keep the quotient the same!).
-
- int nshift = MPN.count_leading_zeros(ywords[ylen - 1]);
- if (nshift != 0)
- {
- // Shift up the denominator setting the most significant bit of
- // the most significant word.
- MPN.lshift(ywords, 0, ywords, ylen, nshift);
-
- // Shift up the numerator, possibly introducing a new most
- // significant word.
- int x_high = MPN.lshift(xwords, 0, xwords, xlen, nshift);
- xwords[xlen++] = x_high;
- }
-
- if (xlen == ylen)
- xwords[xlen++] = 0;
- MPN.divide(xwords, xlen, ywords, ylen);
- rlen = ylen;
- MPN.rshift0 (ywords, xwords, 0, rlen, nshift);
-
- qlen = xlen + 1 - ylen;
- if (quotient != null)
- {
- for (int i = 0; i < qlen; i++)
- xwords[i] = xwords[i+ylen];
- }
- }
-
- if (ywords[rlen-1] < 0)
- {
- ywords[rlen] = 0;
- rlen++;
- }
-
- // Now the quotient is in xwords, and the remainder is in ywords.
-
- boolean add_one = false;
- if (rlen > 1 || ywords[0] != 0)
- { // Non-zero remainder i.e. in-exact quotient.
- switch (rounding_mode)
- {
- case TRUNCATE:
- break;
- case CEILING:
- case FLOOR:
- if (qNegative == (rounding_mode == FLOOR))
- add_one = true;
- break;
- case ROUND:
- // int cmp = compareTo(remainder<<1, abs(y));
- BigInteger tmp = remainder == null ? new BigInteger() : remainder;
- tmp.set(ywords, rlen);
- tmp = shift(tmp, 1);
- if (yNegative)
- tmp.setNegative();
- int cmp = compareTo(tmp, y);
- // Now cmp == compareTo(sign(y)*(remainder<<1), y)
- if (yNegative)
- cmp = -cmp;
- add_one = (cmp == 1) || (cmp == 0 && (xwords[0]&1) != 0);
- }
- }
- if (quotient != null)
- {
- quotient.set(xwords, qlen);
- if (qNegative)
- {
- if (add_one) // -(quotient + 1) == ~(quotient)
- quotient.setInvert();
- else
- quotient.setNegative();
- }
- else if (add_one)
- quotient.setAdd(1);
- }
- if (remainder != null)
- {
- // The remainder is by definition: X-Q*Y
- remainder.set(ywords, rlen);
- if (add_one)
- {
- // Subtract the remainder from Y:
- // abs(R) = abs(Y) - abs(orig_rem) = -(abs(orig_rem) - abs(Y)).
- BigInteger tmp;
- if (y.words == null)
- {
- tmp = remainder;
- tmp.set(yNegative ? ywords[0] + y.ival : ywords[0] - y.ival);
- }
- else
- tmp = BigInteger.add(remainder, y, yNegative ? 1 : -1);
- // Now tmp <= 0.
- // In this case, abs(Q) = 1 + floor(abs(X)/abs(Y)).
- // Hence, abs(Q*Y) > abs(X).
- // So sign(remainder) = -sign(X).
- if (xNegative)
- remainder.setNegative(tmp);
- else
- remainder.set(tmp);
- }
- else
- {
- // If !add_one, then: abs(Q*Y) <= abs(X).
- // So sign(remainder) = sign(X).
- if (xNegative)
- remainder.setNegative();
- }
- }
- }
-
- public BigInteger divide(BigInteger val)
- {
- if (val.isZero())
- throw new ArithmeticException("divisor is zero");
-
- BigInteger quot = new BigInteger();
- divide(this, val, quot, null, TRUNCATE);
- return quot.canonicalize();
- }
-
- public BigInteger remainder(BigInteger val)
- {
- if (val.isZero())
- throw new ArithmeticException("divisor is zero");
-
- BigInteger rem = new BigInteger();
- divide(this, val, null, rem, TRUNCATE);
- return rem.canonicalize();
- }
-
- public BigInteger[] divideAndRemainder(BigInteger val)
- {
- if (val.isZero())
- throw new ArithmeticException("divisor is zero");
-
- BigInteger[] result = new BigInteger[2];
- result[0] = new BigInteger();
- result[1] = new BigInteger();
- divide(this, val, result[0], result[1], TRUNCATE);
- result[0].canonicalize();
- result[1].canonicalize();
- return result;
- }
-
- public BigInteger mod(BigInteger m)
- {
- if (m.isNegative() || m.isZero())
- throw new ArithmeticException("non-positive modulus");
-
- BigInteger rem = new BigInteger();
- divide(this, m, null, rem, FLOOR);
- return rem.canonicalize();
- }
-
- /** Calculate the integral power of a BigInteger.
- * @param exponent the exponent (must be non-negative)
- */
- public BigInteger pow(int exponent)
- {
- if (exponent <= 0)
- {
- if (exponent == 0)
- return ONE;
- throw new ArithmeticException("negative exponent");
- }
- if (isZero())
- return this;
- int plen = words == null ? 1 : ival; // Length of pow2.
- int blen = ((bitLength() * exponent) >> 5) + 2 * plen;
- boolean negative = isNegative() && (exponent & 1) != 0;
- int[] pow2 = new int [blen];
- int[] rwords = new int [blen];
- int[] work = new int [blen];
- getAbsolute(pow2); // pow2 = abs(this);
- int rlen = 1;
- rwords[0] = 1; // rwords = 1;
- for (;;) // for (i = 0; ; i++)
- {
- // pow2 == this**(2**i)
- // prod = this**(sum(j=0..i-1, (exponent>>j)&1))
- if ((exponent & 1) != 0)
- { // r *= pow2
- MPN.mul(work, pow2, plen, rwords, rlen);
- int[] temp = work; work = rwords; rwords = temp;
- rlen += plen;
- while (rwords[rlen - 1] == 0) rlen--;
- }
- exponent >>= 1;
- if (exponent == 0)
- break;
- // pow2 *= pow2;
- MPN.mul(work, pow2, plen, pow2, plen);
- int[] temp = work; work = pow2; pow2 = temp; // swap to avoid a copy
- plen *= 2;
- while (pow2[plen - 1] == 0) plen--;
- }
- if (rwords[rlen - 1] < 0)
- rlen++;
- if (negative)
- negate(rwords, rwords, rlen);
- return BigInteger.make(rwords, rlen);
- }
-
- private static int[] euclidInv(int a, int b, int prevDiv)
- {
- if (b == 0)
- throw new ArithmeticException("not invertible");
-
- if (b == 1)
- // Success: values are indeed invertible!
- // Bottom of the recursion reached; start unwinding.
- return new int[] { -prevDiv, 1 };
-
- int[] xy = euclidInv(b, a % b, a / b); // Recursion happens here.
- a = xy[0]; // use our local copy of 'a' as a work var
- xy[0] = a * -prevDiv + xy[1];
- xy[1] = a;
- return xy;
- }
-
- private static void euclidInv(BigInteger a, BigInteger b,
- BigInteger prevDiv, BigInteger[] xy)
- {
- if (b.isZero())
- throw new ArithmeticException("not invertible");
-
- if (b.isOne())
- {
- // Success: values are indeed invertible!
- // Bottom of the recursion reached; start unwinding.
- xy[0] = neg(prevDiv);
- xy[1] = ONE;
- return;
- }
-
- // Recursion happens in the following conditional!
-
- // If a just contains an int, then use integer math for the rest.
- if (a.words == null)
- {
- int[] xyInt = euclidInv(b.ival, a.ival % b.ival, a.ival / b.ival);
- xy[0] = new BigInteger(xyInt[0]);
- xy[1] = new BigInteger(xyInt[1]);
- }
- else
- {
- BigInteger rem = new BigInteger();
- BigInteger quot = new BigInteger();
- divide(a, b, quot, rem, FLOOR);
- // quot and rem may not be in canonical form. ensure
- rem.canonicalize();
- quot.canonicalize();
- euclidInv(b, rem, quot, xy);
- }
-
- BigInteger t = xy[0];
- xy[0] = add(xy[1], times(t, prevDiv), -1);
- xy[1] = t;
- }
-
- public BigInteger modInverse(BigInteger y)
- {
- if (y.isNegative() || y.isZero())
- throw new ArithmeticException("non-positive modulo");
-
- // Degenerate cases.
- if (y.isOne())
- return ZERO;
- if (isOne())
- return ONE;
-
- // Use Euclid's algorithm as in gcd() but do this recursively
- // rather than in a loop so we can use the intermediate results as we
- // unwind from the recursion.
- // Used http://www.math.nmsu.edu/~crypto/EuclideanAlgo.html as reference.
- BigInteger result = new BigInteger();
- boolean swapped = false;
-
- if (y.words == null)
- {
- // The result is guaranteed to be less than the modulus, y (which is
- // an int), so simplify this by working with the int result of this
- // modulo y. Also, if this is negative, make it positive via modulo
- // math. Note that BigInteger.mod() must be used even if this is
- // already an int as the % operator would provide a negative result if
- // this is negative, BigInteger.mod() never returns negative values.
- int xval = (words != null || isNegative()) ? mod(y).ival : ival;
- int yval = y.ival;
-
- // Swap values so x > y.
- if (yval > xval)
- {
- int tmp = xval; xval = yval; yval = tmp;
- swapped = true;
- }
- // Normally, the result is in the 2nd element of the array, but
- // if originally x < y, then x and y were swapped and the result
- // is in the 1st element of the array.
- result.ival =
- euclidInv(yval, xval % yval, xval / yval)[swapped ? 0 : 1];
-
- // Result can't be negative, so make it positive by adding the
- // original modulus, y.ival (not the possibly "swapped" yval).
- if (result.ival < 0)
- result.ival += y.ival;
- }
- else
- {
- // As above, force this to be a positive value via modulo math.
- BigInteger x = isNegative() ? this.mod(y) : this;
-
- // Swap values so x > y.
- if (x.compareTo(y) < 0)
- {
- result = x; x = y; y = result; // use 'result' as a work var
- swapped = true;
- }
- // As above (for ints), result will be in the 2nd element unless
- // the original x and y were swapped.
- BigInteger rem = new BigInteger();
- BigInteger quot = new BigInteger();
- divide(x, y, quot, rem, FLOOR);
- // quot and rem may not be in canonical form. ensure
- rem.canonicalize();
- quot.canonicalize();
- BigInteger[] xy = new BigInteger[2];
- euclidInv(y, rem, quot, xy);
- result = swapped ? xy[0] : xy[1];
-
- // Result can't be negative, so make it positive by adding the
- // original modulus, y (which is now x if they were swapped).
- if (result.isNegative())
- result = add(result, swapped ? x : y, 1);
- }
-
- return result;
- }
-
- public BigInteger modPow(BigInteger exponent, BigInteger m)
- {
- if (m.isNegative() || m.isZero())
- throw new ArithmeticException("non-positive modulo");
-
- if (exponent.isNegative())
- return modInverse(m);
- if (exponent.isOne())
- return mod(m);
-
- // To do this naively by first raising this to the power of exponent
- // and then performing modulo m would be extremely expensive, especially
- // for very large numbers. The solution is found in Number Theory
- // where a combination of partial powers and moduli can be done easily.
- //
- // We'll use the algorithm for Additive Chaining which can be found on
- // p. 244 of "Applied Cryptography, Second Edition" by Bruce Schneier.
- BigInteger s = ONE;
- BigInteger t = this;
- BigInteger u = exponent;
-
- while (!u.isZero())
- {
- if (u.and(ONE).isOne())
- s = times(s, t).mod(m);
- u = u.shiftRight(1);
- t = times(t, t).mod(m);
- }
-
- return s;
- }
-
- /** Calculate Greatest Common Divisor for non-negative ints. */
- private static int gcd(int a, int b)
- {
- // Euclid's algorithm, copied from libg++.
- int tmp;
- if (b > a)
- {
- tmp = a; a = b; b = tmp;
- }
- for(;;)
- {
- if (b == 0)
- return a;
- if (b == 1)
- return b;
- tmp = b;
- b = a % b;
- a = tmp;
- }
- }
-
- public BigInteger gcd(BigInteger y)
- {
- int xval = ival;
- int yval = y.ival;
- if (words == null)
- {
- if (xval == 0)
- return abs(y);
- if (y.words == null
- && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE)
- {
- if (xval < 0)
- xval = -xval;
- if (yval < 0)
- yval = -yval;
- return valueOf(gcd(xval, yval));
- }
- xval = 1;
- }
- if (y.words == null)
- {
- if (yval == 0)
- return abs(this);
- yval = 1;
- }
- int len = (xval > yval ? xval : yval) + 1;
- int[] xwords = new int[len];
- int[] ywords = new int[len];
- getAbsolute(xwords);
- y.getAbsolute(ywords);
- len = MPN.gcd(xwords, ywords, len);
- BigInteger result = new BigInteger(0);
- result.ival = len;
- result.words = xwords;
- return result.canonicalize();
- }
-
- /**
- * <p>Returns <code>true</code> if this BigInteger is probably prime,
- * <code>false</code> if it's definitely composite. If <code>certainty</code>
- * is <code><= 0</code>, <code>true</code> is returned.</p>
- *
- * @param certainty a measure of the uncertainty that the caller is willing
- * to tolerate: if the call returns <code>true</code> the probability that
- * this BigInteger is prime exceeds <code>(1 - 1/2<sup>certainty</sup>)</code>.
- * The execution time of this method is proportional to the value of this
- * parameter.
- * @return <code>true</code> if this BigInteger is probably prime,
- * <code>false</code> if it's definitely composite.
- */
- public boolean isProbablePrime(int certainty)
- {
- if (certainty < 1)
- return true;
-
- /** We'll use the Rabin-Miller algorithm for doing a probabilistic
- * primality test. It is fast, easy and has faster decreasing odds of a
- * composite passing than with other tests. This means that this
- * method will actually have a probability much greater than the
- * 1 - .5^certainty specified in the JCL (p. 117), but I don't think
- * anyone will complain about better performance with greater certainty.
- *
- * The Rabin-Miller algorithm can be found on pp. 259-261 of "Applied
- * Cryptography, Second Edition" by Bruce Schneier.
- */
-
- // First rule out small prime factors
- BigInteger rem = new BigInteger();
- int i;
- for (i = 0; i < primes.length; i++)
- {
- if (words == null && ival == primes[i])
- return true;
-
- divide(this, smallFixNums[primes[i] - minFixNum], null, rem, TRUNCATE);
- if (rem.canonicalize().isZero())
- return false;
- }
-
- // Now perform the Rabin-Miller test.
-
- // Set b to the number of times 2 evenly divides (this - 1).
- // I.e. 2^b is the largest power of 2 that divides (this - 1).
- BigInteger pMinus1 = add(this, -1);
- int b = pMinus1.getLowestSetBit();
-
- // Set m such that this = 1 + 2^b * m.
- BigInteger m = pMinus1.divide(valueOf(2L << b - 1));
-
- // The HAC (Handbook of Applied Cryptography), Alfred Menezes & al. Note
- // 4.49 (controlling the error probability) gives the number of trials
- // for an error probability of 1/2**80, given the number of bits in the
- // number to test. we shall use these numbers as is if/when 'certainty'
- // is less or equal to 80, and twice as much if it's greater.
- int bits = this.bitLength();
- for (i = 0; i < k.length; i++)
- if (bits <= k[i])
- break;
- int trials = t[i];
- if (certainty > 80)
- trials *= 2;
- BigInteger z;
- for (int t = 0; t < trials; t++)
- {
- // The HAC (Handbook of Applied Cryptography), Alfred Menezes & al.
- // Remark 4.28 states: "...A strategy that is sometimes employed
- // is to fix the bases a to be the first few primes instead of
- // choosing them at random.
- z = smallFixNums[primes[t] - minFixNum].modPow(m, this);
- if (z.isOne() || z.equals(pMinus1))
- continue; // Passes the test; may be prime.
-
- for (i = 0; i < b; )
- {
- if (z.isOne())
- return false;
- i++;
- if (z.equals(pMinus1))
- break; // Passes the test; may be prime.
-
- z = z.modPow(valueOf(2), this);
- }
-
- if (i == b && !z.equals(pMinus1))
- return false;
- }
- return true;
- }
-
- private void setInvert()
- {
- if (words == null)
- ival = ~ival;
- else
- {
- for (int i = ival; --i >= 0; )
- words[i] = ~words[i];
- }
- }
-
- private void setShiftLeft(BigInteger x, int count)
- {
- int[] xwords;
- int xlen;
- if (x.words == null)
- {
- if (count < 32)
- {
- set((long) x.ival << count);
- return;
- }
- xwords = new int[1];
- xwords[0] = x.ival;
- xlen = 1;
- }
- else
- {
- xwords = x.words;
- xlen = x.ival;
- }
- int word_count = count >> 5;
- count &= 31;
- int new_len = xlen + word_count;
- if (count == 0)
- {
- realloc(new_len);
- for (int i = xlen; --i >= 0; )
- words[i+word_count] = xwords[i];
- }
- else
- {
- new_len++;
- realloc(new_len);
- int shift_out = MPN.lshift(words, word_count, xwords, xlen, count);
- count = 32 - count;
- words[new_len-1] = (shift_out << count) >> count; // sign-extend.
- }
- ival = new_len;
- for (int i = word_count; --i >= 0; )
- words[i] = 0;
- }
-
- private void setShiftRight(BigInteger x, int count)
- {
- if (x.words == null)
- set(count < 32 ? x.ival >> count : x.ival < 0 ? -1 : 0);
- else if (count == 0)
- set(x);
- else
- {
- boolean neg = x.isNegative();
- int word_count = count >> 5;
- count &= 31;
- int d_len = x.ival - word_count;
- if (d_len <= 0)
- set(neg ? -1 : 0);
- else
- {
- if (words == null || words.length < d_len)
- realloc(d_len);
- MPN.rshift0 (words, x.words, word_count, d_len, count);
- ival = d_len;
- if (neg)
- words[d_len-1] |= -2 << (31 - count);
- }
- }
- }
-
- private void setShift(BigInteger x, int count)
- {
- if (count > 0)
- setShiftLeft(x, count);
- else
- setShiftRight(x, -count);
- }
-
- private static BigInteger shift(BigInteger x, int count)
- {
- if (x.words == null)
- {
- if (count <= 0)
- return valueOf(count > -32 ? x.ival >> (-count) : x.ival < 0 ? -1 : 0);
- if (count < 32)
- return valueOf((long) x.ival << count);
- }
- if (count == 0)
- return x;
- BigInteger result = new BigInteger(0);
- result.setShift(x, count);
- return result.canonicalize();
- }
-
- public BigInteger shiftLeft(int n)
- {
- return shift(this, n);
- }
-
- public BigInteger shiftRight(int n)
- {
- return shift(this, -n);
- }
-
- private void format(int radix, StringBuffer buffer)
- {
- if (words == null)
- buffer.append(Integer.toString(ival, radix));
- else if (ival <= 2)
- buffer.append(Long.toString(longValue(), radix));
- else
- {
- boolean neg = isNegative();
- int[] work;
- if (neg || radix != 16)
- {
- work = new int[ival];
- getAbsolute(work);
- }
- else
- work = words;
- int len = ival;
-
- if (radix == 16)
- {
- if (neg)
- buffer.append('-');
- int buf_start = buffer.length();
- for (int i = len; --i >= 0; )
- {
- int word = work[i];
- for (int j = 8; --j >= 0; )
- {
- int hex_digit = (word >> (4 * j)) & 0xF;
- // Suppress leading zeros:
- if (hex_digit > 0 || buffer.length() > buf_start)
- buffer.append(Character.forDigit(hex_digit, 16));
- }
- }
- }
- else
- {
- int i = buffer.length();
- for (;;)
- {
- int digit = MPN.divmod_1(work, work, len, radix);
- buffer.append(Character.forDigit(digit, radix));
- while (len > 0 && work[len-1] == 0) len--;
- if (len == 0)
- break;
- }
- if (neg)
- buffer.append('-');
- /* Reverse buffer. */
- int j = buffer.length() - 1;
- while (i < j)
- {
- char tmp = buffer.charAt(i);
- buffer.setCharAt(i, buffer.charAt(j));
- buffer.setCharAt(j, tmp);
- i++; j--;
- }
- }
- }
- }
-
- public String toString()
- {
- return toString(10);
- }
-
- public String toString(int radix)
- {
- if (words == null)
- return Integer.toString(ival, radix);
- if (ival <= 2)
- return Long.toString(longValue(), radix);
- int buf_size = ival * (MPN.chars_per_word(radix) + 1);
- StringBuffer buffer = new StringBuffer(buf_size);
- format(radix, buffer);
- return buffer.toString();
- }
-
- public int intValue()
- {
- if (words == null)
- return ival;
- return words[0];
- }
-
- public long longValue()
- {
- if (words == null)
- return ival;
- if (ival == 1)
- return words[0];
- return ((long)words[1] << 32) + ((long)words[0] & 0xffffffffL);
- }
-
- public int hashCode()
- {
- // FIXME: May not match hashcode of JDK.
- return words == null ? ival : (words[0] + words[ival - 1]);
- }
-
- /* Assumes x and y are both canonicalized. */
- private static boolean equals(BigInteger x, BigInteger y)
- {
- if (x.words == null && y.words == null)
- return x.ival == y.ival;
- if (x.words == null || y.words == null || x.ival != y.ival)
- return false;
- for (int i = x.ival; --i >= 0; )
- {
- if (x.words[i] != y.words[i])
- return false;
- }
- return true;
- }
-
- /* Assumes this and obj are both canonicalized. */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof BigInteger))
- return false;
- return equals(this, (BigInteger) obj);
- }
-
- private static BigInteger valueOf(String s, int radix)
- throws NumberFormatException
- {
- int len = s.length();
- // Testing (len < MPN.chars_per_word(radix)) would be more accurate,
- // but slightly more expensive, for little practical gain.
- if (len <= 15 && radix <= 16)
- return valueOf(Long.parseLong(s, radix));
-
- int byte_len = 0;
- byte[] bytes = new byte[len];
- boolean negative = false;
- for (int i = 0; i < len; i++)
- {
- char ch = s.charAt(i);
- if (ch == '-')
- negative = true;
- else if (ch == '_' || (byte_len == 0 && (ch == ' ' || ch == '\t')))
- continue;
- else
- {
- int digit = Character.digit(ch, radix);
- if (digit < 0)
- break;
- bytes[byte_len++] = (byte) digit;
- }
- }
- return valueOf(bytes, byte_len, negative, radix);
- }
-
- private static BigInteger valueOf(byte[] digits, int byte_len,
- boolean negative, int radix)
- {
- int chars_per_word = MPN.chars_per_word(radix);
- int[] words = new int[byte_len / chars_per_word + 1];
- int size = MPN.set_str(words, digits, byte_len, radix);
- if (size == 0)
- return ZERO;
- if (words[size-1] < 0)
- words[size++] = 0;
- if (negative)
- negate(words, words, size);
- return make(words, size);
- }
-
- public double doubleValue()
- {
- if (words == null)
- return (double) ival;
- if (ival <= 2)
- return (double) longValue();
- if (isNegative())
- return neg(this).roundToDouble(0, true, false);
- return roundToDouble(0, false, false);
- }
-
- public float floatValue()
- {
- return (float) doubleValue();
- }
-
- /** Return true if any of the lowest n bits are one.
- * (false if n is negative). */
- private boolean checkBits(int n)
- {
- if (n <= 0)
- return false;
- if (words == null)
- return n > 31 || ((ival & ((1 << n) - 1)) != 0);
- int i;
- for (i = 0; i < (n >> 5) ; i++)
- if (words[i] != 0)
- return true;
- return (n & 31) != 0 && (words[i] & ((1 << (n & 31)) - 1)) != 0;
- }
-
- /** Convert a semi-processed BigInteger to double.
- * Number must be non-negative. Multiplies by a power of two, applies sign,
- * and converts to double, with the usual java rounding.
- * @param exp power of two, positive or negative, by which to multiply
- * @param neg true if negative
- * @param remainder true if the BigInteger is the result of a truncating
- * division that had non-zero remainder. To ensure proper rounding in
- * this case, the BigInteger must have at least 54 bits. */
- private double roundToDouble(int exp, boolean neg, boolean remainder)
- {
- // Compute length.
- int il = bitLength();
-
- // Exponent when normalized to have decimal point directly after
- // leading one. This is stored excess 1023 in the exponent bit field.
- exp += il - 1;
-
- // Gross underflow. If exp == -1075, we let the rounding
- // computation determine whether it is minval or 0 (which are just
- // 0x0000 0000 0000 0001 and 0x0000 0000 0000 0000 as bit
- // patterns).
- if (exp < -1075)
- return neg ? -0.0 : 0.0;
-
- // gross overflow
- if (exp > 1023)
- return neg ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
-
- // number of bits in mantissa, including the leading one.
- // 53 unless it's denormalized
- int ml = (exp >= -1022 ? 53 : 53 + exp + 1022);
-
- // Get top ml + 1 bits. The extra one is for rounding.
- long m;
- int excess_bits = il - (ml + 1);
- if (excess_bits > 0)
- m = ((words == null) ? ival >> excess_bits
- : MPN.rshift_long(words, ival, excess_bits));
- else
- m = longValue() << (- excess_bits);
-
- // Special rounding for maxval. If the number exceeds maxval by
- // any amount, even if it's less than half a step, it overflows.
- if (exp == 1023 && ((m >> 1) == (1L << 53) - 1))
- {
- if (remainder || checkBits(il - ml))
- return neg ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
- else
- return neg ? - Double.MAX_VALUE : Double.MAX_VALUE;
- }
-
- // Normal round-to-even rule: round up if the bit dropped is a one, and
- // the bit above it or any of the bits below it is a one.
- if ((m & 1) == 1
- && ((m & 2) == 2 || remainder || checkBits(excess_bits)))
- {
- m += 2;
- // Check if we overflowed the mantissa
- if ((m & (1L << 54)) != 0)
- {
- exp++;
- // renormalize
- m >>= 1;
- }
- // Check if a denormalized mantissa was just rounded up to a
- // normalized one.
- else if (ml == 52 && (m & (1L << 53)) != 0)
- exp++;
- }
-
- // Discard the rounding bit
- m >>= 1;
-
- long bits_sign = neg ? (1L << 63) : 0;
- exp += 1023;
- long bits_exp = (exp <= 0) ? 0 : ((long)exp) << 52;
- long bits_mant = m & ~(1L << 52);
- return Double.longBitsToDouble(bits_sign | bits_exp | bits_mant);
- }
-
- /** Copy the abolute value of this into an array of words.
- * Assumes words.length >= (this.words == null ? 1 : this.ival).
- * Result is zero-extended, but need not be a valid 2's complement number.
- */
- private void getAbsolute(int[] words)
- {
- int len;
- if (this.words == null)
- {
- len = 1;
- words[0] = this.ival;
- }
- else
- {
- len = this.ival;
- for (int i = len; --i >= 0; )
- words[i] = this.words[i];
- }
- if (words[len - 1] < 0)
- negate(words, words, len);
- for (int i = words.length; --i > len; )
- words[i] = 0;
- }
-
- /** Set dest[0:len-1] to the negation of src[0:len-1].
- * Return true if overflow (i.e. if src is -2**(32*len-1)).
- * Ok for src==dest. */
- private static boolean negate(int[] dest, int[] src, int len)
- {
- long carry = 1;
- boolean negative = src[len-1] < 0;
- for (int i = 0; i < len; i++)
- {
- carry += ((long) (~src[i]) & 0xffffffffL);
- dest[i] = (int) carry;
- carry >>= 32;
- }
- return (negative && dest[len-1] < 0);
- }
-
- /** Destructively set this to the negative of x.
- * It is OK if x==this.*/
- private void setNegative(BigInteger x)
- {
- int len = x.ival;
- if (x.words == null)
- {
- if (len == Integer.MIN_VALUE)
- set(- (long) len);
- else
- set(-len);
- return;
- }
- realloc(len + 1);
- if (negate(words, x.words, len))
- words[len++] = 0;
- ival = len;
- }
-
- /** Destructively negate this. */
- private void setNegative()
- {
- setNegative(this);
- }
-
- private static BigInteger abs(BigInteger x)
- {
- return x.isNegative() ? neg(x) : x;
- }
-
- public BigInteger abs()
- {
- return abs(this);
- }
-
- private static BigInteger neg(BigInteger x)
- {
- if (x.words == null && x.ival != Integer.MIN_VALUE)
- return valueOf(- x.ival);
- BigInteger result = new BigInteger(0);
- result.setNegative(x);
- return result.canonicalize();
- }
-
- public BigInteger negate()
- {
- return neg(this);
- }
-
- /** Calculates ceiling(log2(this < 0 ? -this : this+1))
- * See Common Lisp: the Language, 2nd ed, p. 361.
- */
- public int bitLength()
- {
- if (words == null)
- return MPN.intLength(ival);
- return MPN.intLength(words, ival);
- }
-
- public byte[] toByteArray()
- {
- // Determine number of bytes needed. The method bitlength returns
- // the size without the sign bit, so add one bit for that and then
- // add 7 more to emulate the ceil function using integer math.
- byte[] bytes = new byte[(bitLength() + 1 + 7) / 8];
- int nbytes = bytes.length;
-
- int wptr = 0;
- int word;
-
- // Deal with words array until one word or less is left to process.
- // If BigInteger is an int, then it is in ival and nbytes will be <= 4.
- while (nbytes > 4)
- {
- word = words[wptr++];
- for (int i = 4; i > 0; --i, word >>= 8)
- bytes[--nbytes] = (byte) word;
- }
-
- // Deal with the last few bytes. If BigInteger is an int, use ival.
- word = (words == null) ? ival : words[wptr];
- for ( ; nbytes > 0; word >>= 8)
- bytes[--nbytes] = (byte) word;
-
- return bytes;
- }
-
- /** Return the boolean opcode (for bitOp) for swapped operands.
- * I.e. bitOp(swappedOp(op), x, y) == bitOp(op, y, x).
- */
- private static int swappedOp(int op)
- {
- return
- "\000\001\004\005\002\003\006\007\010\011\014\015\012\013\016\017"
- .charAt(op);
- }
-
- /** Do one the the 16 possible bit-wise operations of two BigIntegers. */
- private static BigInteger bitOp(int op, BigInteger x, BigInteger y)
- {
- switch (op)
- {
- case 0: return ZERO;
- case 1: return x.and(y);
- case 3: return x;
- case 5: return y;
- case 15: return valueOf(-1);
- }
- BigInteger result = new BigInteger();
- setBitOp(result, op, x, y);
- return result.canonicalize();
- }
-
- /** Do one the the 16 possible bit-wise operations of two BigIntegers. */
- private static void setBitOp(BigInteger result, int op,
- BigInteger x, BigInteger y)
- {
- if (y.words == null) ;
- else if (x.words == null || x.ival < y.ival)
- {
- BigInteger temp = x; x = y; y = temp;
- op = swappedOp(op);
- }
- int xi;
- int yi;
- int xlen, ylen;
- if (y.words == null)
- {
- yi = y.ival;
- ylen = 1;
- }
- else
- {
- yi = y.words[0];
- ylen = y.ival;
- }
- if (x.words == null)
- {
- xi = x.ival;
- xlen = 1;
- }
- else
- {
- xi = x.words[0];
- xlen = x.ival;
- }
- if (xlen > 1)
- result.realloc(xlen);
- int[] w = result.words;
- int i = 0;
- // Code for how to handle the remainder of x.
- // 0: Truncate to length of y.
- // 1: Copy rest of x.
- // 2: Invert rest of x.
- int finish = 0;
- int ni;
- switch (op)
- {
- case 0: // clr
- ni = 0;
- break;
- case 1: // and
- for (;;)
- {
- ni = xi & yi;
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- if (yi < 0) finish = 1;
- break;
- case 2: // andc2
- for (;;)
- {
- ni = xi & ~yi;
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- if (yi >= 0) finish = 1;
- break;
- case 3: // copy x
- ni = xi;
- finish = 1; // Copy rest
- break;
- case 4: // andc1
- for (;;)
- {
- ni = ~xi & yi;
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- if (yi < 0) finish = 2;
- break;
- case 5: // copy y
- for (;;)
- {
- ni = yi;
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- break;
- case 6: // xor
- for (;;)
- {
- ni = xi ^ yi;
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- finish = yi < 0 ? 2 : 1;
- break;
- case 7: // ior
- for (;;)
- {
- ni = xi | yi;
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- if (yi >= 0) finish = 1;
- break;
- case 8: // nor
- for (;;)
- {
- ni = ~(xi | yi);
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- if (yi >= 0) finish = 2;
- break;
- case 9: // eqv [exclusive nor]
- for (;;)
- {
- ni = ~(xi ^ yi);
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- finish = yi >= 0 ? 2 : 1;
- break;
- case 10: // c2
- for (;;)
- {
- ni = ~yi;
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- break;
- case 11: // orc2
- for (;;)
- {
- ni = xi | ~yi;
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- if (yi < 0) finish = 1;
- break;
- case 12: // c1
- ni = ~xi;
- finish = 2;
- break;
- case 13: // orc1
- for (;;)
- {
- ni = ~xi | yi;
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- if (yi >= 0) finish = 2;
- break;
- case 14: // nand
- for (;;)
- {
- ni = ~(xi & yi);
- if (i+1 >= ylen) break;
- w[i++] = ni; xi = x.words[i]; yi = y.words[i];
- }
- if (yi < 0) finish = 2;
- break;
- default:
- case 15: // set
- ni = -1;
- break;
- }
- // Here i==ylen-1; w[0]..w[i-1] have the correct result;
- // and ni contains the correct result for w[i+1].
- if (i+1 == xlen)
- finish = 0;
- switch (finish)
- {
- case 0:
- if (i == 0 && w == null)
- {
- result.ival = ni;
- return;
- }
- w[i++] = ni;
- break;
- case 1: w[i] = ni; while (++i < xlen) w[i] = x.words[i]; break;
- case 2: w[i] = ni; while (++i < xlen) w[i] = ~x.words[i]; break;
- }
- result.ival = i;
- }
-
- /** Return the logical (bit-wise) "and" of a BigInteger and an int. */
- private static BigInteger and(BigInteger x, int y)
- {
- if (x.words == null)
- return valueOf(x.ival & y);
- if (y >= 0)
- return valueOf(x.words[0] & y);
- int len = x.ival;
- int[] words = new int[len];
- words[0] = x.words[0] & y;
- while (--len > 0)
- words[len] = x.words[len];
- return make(words, x.ival);
- }
-
- /** Return the logical (bit-wise) "and" of two BigIntegers. */
- public BigInteger and(BigInteger y)
- {
- if (y.words == null)
- return and(this, y.ival);
- else if (words == null)
- return and(y, ival);
-
- BigInteger x = this;
- if (ival < y.ival)
- {
- BigInteger temp = this; x = y; y = temp;
- }
- int i;
- int len = y.isNegative() ? x.ival : y.ival;
- int[] words = new int[len];
- for (i = 0; i < y.ival; i++)
- words[i] = x.words[i] & y.words[i];
- for ( ; i < len; i++)
- words[i] = x.words[i];
- return make(words, len);
- }
-
- /** Return the logical (bit-wise) "(inclusive) or" of two BigIntegers. */
- public BigInteger or(BigInteger y)
- {
- return bitOp(7, this, y);
- }
-
- /** Return the logical (bit-wise) "exclusive or" of two BigIntegers. */
- public BigInteger xor(BigInteger y)
- {
- return bitOp(6, this, y);
- }
-
- /** Return the logical (bit-wise) negation of a BigInteger. */
- public BigInteger not()
- {
- return bitOp(12, this, ZERO);
- }
-
- public BigInteger andNot(BigInteger val)
- {
- return and(val.not());
- }
-
- public BigInteger clearBit(int n)
- {
- if (n < 0)
- throw new ArithmeticException();
-
- return and(ONE.shiftLeft(n).not());
- }
-
- public BigInteger setBit(int n)
- {
- if (n < 0)
- throw new ArithmeticException();
-
- return or(ONE.shiftLeft(n));
- }
-
- public boolean testBit(int n)
- {
- if (n < 0)
- throw new ArithmeticException();
-
- return !and(ONE.shiftLeft(n)).isZero();
- }
-
- public BigInteger flipBit(int n)
- {
- if (n < 0)
- throw new ArithmeticException();
-
- return xor(ONE.shiftLeft(n));
- }
-
- public int getLowestSetBit()
- {
- if (isZero())
- return -1;
-
- if (words == null)
- return MPN.findLowestBit(ival);
- else
- return MPN.findLowestBit(words);
- }
-
- // bit4count[I] is number of '1' bits in I.
- private static final byte[] bit4_count = { 0, 1, 1, 2, 1, 2, 2, 3,
- 1, 2, 2, 3, 2, 3, 3, 4};
-
- private static int bitCount(int i)
- {
- int count = 0;
- while (i != 0)
- {
- count += bit4_count[i & 15];
- i >>>= 4;
- }
- return count;
- }
-
- private static int bitCount(int[] x, int len)
- {
- int count = 0;
- while (--len >= 0)
- count += bitCount(x[len]);
- return count;
- }
-
- /** Count one bits in a BigInteger.
- * If argument is negative, count zero bits instead. */
- public int bitCount()
- {
- int i, x_len;
- int[] x_words = words;
- if (x_words == null)
- {
- x_len = 1;
- i = bitCount(ival);
- }
- else
- {
- x_len = ival;
- i = bitCount(x_words, x_len);
- }
- return isNegative() ? x_len * 32 - i : i;
- }
-
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- words = byteArrayToIntArray(magnitude, signum < 0 ? -1 : 0);
- BigInteger result = make(words, words.length);
- this.ival = result.ival;
- this.words = result.words;
- }
-
- private void writeObject(ObjectOutputStream s)
- throws IOException, ClassNotFoundException
- {
- signum = signum();
- magnitude = toByteArray();
- s.defaultWriteObject();
- }
-}
diff --git a/libjava/java/net/Authenticator.java b/libjava/java/net/Authenticator.java
deleted file mode 100644
index 229e140cc76..00000000000
--- a/libjava/java/net/Authenticator.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/* Authenticator.java -- Abstract class for obtaining authentication info
- Copyright (C) 1998, 2000, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * This abstract class provides a model for obtaining authentication
- * information (in the form of a username and password) required by
- * some network operations (such as hitting a password protected
- * web site).
- * <p>
- * To make use of this feature, a programmer must create a subclass
- * that knows how to obtain the necessary info. An example
- * would be a class that popped up a dialog box to prompt the user.
- * After creating an instance of that subclass, the static
- * <code>setDefault</code> method of this class is called to set up
- * that instance as the object to use on subsequent calls to obtain
- * authorization.
- *
- * @since 1.2
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status Believed to be JDK 1.4 complete
- */
-public abstract class Authenticator
-{
- /*
- * Class Variables
- */
-
- /**
- * This is the default Authenticator object to use for password requests
- */
- private static Authenticator defaultAuthenticator;
-
- /*
- * Instance Variables
- */
-
- /**
- * The hostname of the site requesting authentication
- */
- private String host;
-
- /**
- * InternetAddress of the site requesting authentication
- */
- private InetAddress addr;
-
- /**
- * The port number of the site requesting authentication
- */
- private int port;
-
- /**
- * The protocol name of the site requesting authentication
- */
- private String protocol;
-
- /**
- * The prompt to display to the user when requesting authentication info
- */
- private String prompt;
-
- /**
- * The authentication scheme in use
- */
- private String scheme;
-
- /*
- * Class Methods
- */
-
- /**
- * This method sets the default <code>Authenticator</code> object (an
- * instance of a subclass of <code>Authenticator</code>) to use when
- * prompting the user for
- * information. Note that this method checks to see if the caller is
- * allowed to set this value (the "setDefaultAuthenticator" permission)
- * and throws a <code>SecurityException</code> if it is not.
- *
- * @param defAuth The new default <code>Authenticator</code> object to use
- *
- * @exception SecurityException If the caller does not have permission
- * to perform this operation
- */
- public static void setDefault(Authenticator defAuth)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new NetPermission("setDefaultAuthenticator"));
-
- defaultAuthenticator = defAuth;
- }
-
- /**
- * This method is called whenever a username and password for a given
- * network operation is required. First, a security check is made to see
- * if the caller has the "requestPasswordAuthentication"
- * permission. If not, the method thows an exception. If there is no
- * default <code>Authenticator</code> object, the method then returns
- * <code>null</code>. Otherwise, the default authenticators's instance
- * variables are initialized and it's <code>getPasswordAuthentication</code>
- * method is called to get the actual authentication information to return.
- *
- * @param addr The address requesting authentication
- * @param port The port requesting authentication
- * @param protocol The protocol requesting authentication
- * @param prompt The prompt to display to the user when requesting
- * authentication info
- * @param scheme The authentication scheme in use
- *
- * @return A <code>PasswordAuthentication</code> object with the user's
- * authentication info.
- *
- * @exception SecurityException If the caller does not have permission to
- * perform this operation
- */
- public static PasswordAuthentication requestPasswordAuthentication(InetAddress addr,
- int port,
- String protocol,
- String prompt,
- String scheme)
- throws SecurityException
- {
- return requestPasswordAuthentication(null, addr, port, protocol, prompt,
- scheme);
- }
-
- /**
- * This method is called whenever a username and password for a given
- * network operation is required. First, a security check is made to see
- * if the caller has the "requestPasswordAuthentication"
- * permission. If not, the method thows an exception. If there is no
- * default <code>Authenticator</code> object, the method then returns
- * <code>null</code>. Otherwise, the default authenticators's instance
- * variables are initialized and it's <code>getPasswordAuthentication</code>
- * method is called to get the actual authentication information to return.
- * This method is the preferred one as it can be used with hostname
- * when addr is unknown.
- *
- * @param host The hostname requesting authentication
- * @param addr The address requesting authentication
- * @param port The port requesting authentication
- * @param protocol The protocol requesting authentication
- * @param prompt The prompt to display to the user when requesting
- * authentication info
- * @param scheme The authentication scheme in use
- *
- * @return A <code>PasswordAuthentication</code> object with the user's
- * authentication info.
- *
- * @exception SecurityException If the caller does not have permission to
- * perform this operation
- *
- * @since 1.4
- */
- public static PasswordAuthentication requestPasswordAuthentication(String host,
- InetAddress addr,
- int port,
- String protocol,
- String prompt,
- String scheme)
- throws SecurityException
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new NetPermission("requestPasswordAuthentication"));
-
- if (defaultAuthenticator == null)
- return null;
-
- defaultAuthenticator.host = host;
- defaultAuthenticator.addr = addr;
- defaultAuthenticator.port = port;
- defaultAuthenticator.protocol = protocol;
- defaultAuthenticator.prompt = prompt;
- defaultAuthenticator.scheme = scheme;
-
- return defaultAuthenticator.getPasswordAuthentication();
- }
-
- /*
- * Constructors
- */
-
- /**
- * Default, no-argument constructor for subclasses to call.
- */
- public Authenticator()
- {
- }
-
- /*
- * Instance Methods
- */
-
- /**
- * This method returns the address of the site that is requesting
- * authentication.
- *
- * @return The requesting site's address
- */
- protected final InetAddress getRequestingSite()
- {
- return addr;
- }
-
- /**
- * Returns the hostname of the host or proxy requesting authorization,
- * or <code>null</code> if not available.
- *
- * @return The name of the host requesting authentication, or
- * <code>null</code> if it is not available.
- *
- * @since 1.4
- */
- protected final String getRequestingHost()
- {
- return host;
- }
-
- /**
- * This method returns the port of the site that is requesting
- * authentication.
- *
- * @return The requesting port
- */
- protected final int getRequestingPort()
- {
- return port;
- }
-
- /**
- * This method returns the requesting protocol of the operation that is
- * requesting authentication
- *
- * @return The requesting protocol
- */
- protected final String getRequestingProtocol()
- {
- return protocol;
- }
-
- /**
- * Returns the prompt that should be used when requesting authentication
- * information from the user
- *
- * @return The user prompt
- */
- protected final String getRequestingPrompt()
- {
- return prompt;
- }
-
- /**
- * This method returns the authentication scheme in use
- *
- * @return The authentication scheme
- */
- protected final String getRequestingScheme()
- {
- return scheme;
- }
-
- /**
- * This method is called whenever a request for authentication is made. It
- * can call the other getXXX methods to determine the information relevant
- * to this request. Subclasses should override this method, which returns
- * <code>null</code> by default.
- *
- * @return The <code>PasswordAuthentication</code> information
- */
- protected PasswordAuthentication getPasswordAuthentication()
- {
- return null;
- }
-} // class Authenticator
diff --git a/libjava/java/net/BindException.java b/libjava/java/net/BindException.java
deleted file mode 100644
index cfb509a708e..00000000000
--- a/libjava/java/net/BindException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* BindException.java -- An exception occurred while binding to a socket
- Copyright (C) 1998, 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * This exception indicates that an error occurred while attempting to bind
- * socket to a particular port.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class BindException extends SocketException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -5945005768251722951L;
-
- /**
- * Create a new instance without a descriptive error message.
- */
- public BindException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message, such as the
- * text from strerror(3).
- *
- * @param message a message describing the error that occurred
- */
- public BindException(String message)
- {
- super(message);
- }
-} // class BindException
diff --git a/libjava/java/net/ConnectException.java b/libjava/java/net/ConnectException.java
deleted file mode 100644
index c115d2fe04e..00000000000
--- a/libjava/java/net/ConnectException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* ConnectException.java -- An exception occurred while connecting to a host
- Copyright (C) 1998, 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * This exception indicates that an error occurred while attempting to
- * connect to a remote host. Often this indicates that the remote host
- * refused the connection (ie, is not listening on the target socket).
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class ConnectException extends SocketException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 3831404271622369215L;
-
- /**
- * Create a new instance without a descriptive error message.
- */
- public ConnectException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message, such as the
- * text from strerror(3).
- *
- * @param message a message describing the error that occurred
- */
- public ConnectException(String message)
- {
- super(message);
- }
-} // class ConnectException
diff --git a/libjava/java/net/ContentHandler.java b/libjava/java/net/ContentHandler.java
deleted file mode 100644
index 7f63e740229..00000000000
--- a/libjava/java/net/ContentHandler.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* ContentHandler.java -- Abstract class for handling content from URL's
- Copyright (C) 1998, 1999, 2000, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.IOException;
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * This is an abstract class that is the superclass for classes that read
- * objects from URL's. Calling the <code>getContent()</code> method in the
- * <code>URL</code> class or the <code>URLConnection</code> class will cause
- * an instance of a subclass of <code>ContentHandler</code> to be created for
- * the MIME type of the object being downloaded from the URL. Thus, this
- * class is seldom needed by applications/applets directly, but only
- * indirectly through methods in other classes.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public abstract class ContentHandler
-{
- /*
- * Constructors
- */
-
- /**
- * Default, no-argument constructor.
- */
- public ContentHandler()
- {
- }
-
- /*
- * Instance Methods
- */
-
- /**
- * This method reads from the <code>InputStream</code> of the passed in URL
- * connection and uses the data downloaded to create an <code>Object</code>
- * represening the content. For example, if the URL is pointing to a GIF
- * file, this method might return an <code>Image</code> object. This method
- * must be implemented by subclasses.
- *
- * @param urlc A <code>URLConnection</code> object to read data from.
- *
- * @return An object representing the data read
- *
- * @exception IOException If an error occurs
- */
- public abstract Object getContent(URLConnection urlc)
- throws IOException;
-
- /**
- * This method reads from the <code>InputStream</code> of the passed in URL
- * connection and uses the data downloaded to create an <code>Object</code>
- * represening the content. For example, if the URL is pointing to a GIF
- * file, this method might return an <code>Image</code> object. This method
- * must be implemented by subclasses. This method uses the list of
- * supplied classes as candidate types. If the data read doesn't match
- * any of the supplied type, <code>null</code> is returned.
- *
- * @param urlc A <code>URLConnection</code> object to read data from.
- * @param classes An array of types of objects that are candidate types
- * for the data to be read.
- *
- * @return An object representing the data read, or <code>null</code>
- * if the data does not match any of the candidate types.
- *
- * @exception IOException If an error occurs
- *
- * @since 1.3
- */
- public Object getContent(URLConnection urlc, Class[] classes)
- throws IOException
- {
- Object obj = getContent(urlc);
-
- for (int i = 0; i < classes.length; i++)
- {
- if (classes[i].isInstance(obj))
- return obj;
- }
-
- return null;
- }
-} // class ContentHandler
diff --git a/libjava/java/net/ContentHandlerFactory.java b/libjava/java/net/ContentHandlerFactory.java
deleted file mode 100644
index 51a92cf1521..00000000000
--- a/libjava/java/net/ContentHandlerFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ContentHandlerFactory.java -- Interface for creating content handlers
- Copyright (C) 1998, 1999, 2000, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-/**
- * This interface maps MIME types to <code>ContentHandler</code> objects.
- * It consists of one method that, when passed a MIME type, returns a
- * handler for that type.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public interface ContentHandlerFactory
-{
- /**
- * This method is passed a MIME type as a string and is responsible for
- * returning the appropriate <code>ContentHandler</code> object.
- *
- * @param mimeType The MIME type to map to a <code>ContentHandler</code>
- *
- * @return The <code>ContentHandler</code> for the passed in MIME type
- */
- ContentHandler createContentHandler(String mimeType);
-} // interface ContentHandlerFactory
diff --git a/libjava/java/net/DatagramPacket.java b/libjava/java/net/DatagramPacket.java
deleted file mode 100644
index e642f889c32..00000000000
--- a/libjava/java/net/DatagramPacket.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/* DatagramPacket.java -- Class to model a packet to be sent via UDP
- Copyright (C) 1998, 1999, 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/*
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * This class models a packet of data that is to be sent across the network
- * using a connectionless protocol such as UDP. It contains the data
- * to be send, as well as the destination address and port. Note that
- * datagram packets can arrive in any order and are not guaranteed to be
- * delivered at all.
- * <p>
- * This class can also be used for receiving data from the network.
- * <p>
- * Note that for all method below where the buffer length passed by the
- * caller cannot exceed the actually length of the byte array passed as
- * the buffer, if this condition is not true, then the method silently
- * reduces the length value to maximum allowable value.
- *
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Aarom M. Renn (arenn@urbanophile.com) (Documentation comments)
- * @date April 28, 1999.
- */
-public final class DatagramPacket
-{
- /**
- * The data buffer to send
- */
- private byte[] buffer;
-
- /**
- * This is the offset into the buffer to start sending from or receiving to.
- */
- private int offset;
-
- /**
- * The length of the data buffer to send.
- */
- int length;
-
- /**
- * The maximal length of the buffer.
- */
- int maxlen;
-
- /**
- * The address to which the packet should be sent or from which it
- * was received.
- */
- private InetAddress address;
-
- /**
- * The port to which the packet should be sent or from which it was
- * was received.
- */
- private int port;
-
- /**
- * This method initializes a new instance of <code>DatagramPacket</code>
- * which has the specified buffer, offset, and length.
- *
- * @param buf The buffer for holding the incoming datagram.
- * @param offset The offset into the buffer to start writing.
- * @param length The maximum number of bytes to read.
- *
- * @since 1.2
- */
- public DatagramPacket(byte[] buf, int offset, int length)
- {
- setData(buf, offset, length);
- address = null;
- port = -1;
- }
-
- /**
- * Initializes a new instance of <code>DatagramPacket</code> for
- * receiving packets from the network.
- *
- * @param buf A buffer for storing the returned packet data
- * @param length The length of the buffer (must be &lt;= buf.length)
- */
- public DatagramPacket(byte[] buf, int length)
- {
- this(buf, 0, length);
- }
-
- /**
- * Initializes a new instance of <code>DatagramPacket</code> for
- * transmitting packets across the network.
- *
- * @param buf A buffer containing the data to send
- * @param offset The offset into the buffer to start writing from.
- * @param length The length of the buffer (must be &lt;= buf.length)
- * @param address The address to send to
- * @param port The port to send to
- *
- * @since 1.2
- */
- public DatagramPacket(byte[] buf, int offset, int length,
- InetAddress address, int port)
- {
- setData(buf, offset, length);
- setAddress(address);
- setPort(port);
- }
-
- /**
- * Initializes a new instance of <code>DatagramPacket</code> for
- * transmitting packets across the network.
- *
- * @param buf A buffer containing the data to send
- * @param length The length of the buffer (must be &lt;= buf.length)
- * @param address The address to send to
- * @param port The port to send to
- */
- public DatagramPacket(byte[] buf, int length, InetAddress address, int port)
- {
- this(buf, 0, length, address, port);
- }
-
- /**
- * Initializes a new instance of <code>DatagramPacket</code> for
- * transmitting packets across the network.
- *
- * @param buf A buffer containing the data to send
- * @param offset The offset into the buffer to start writing from.
- * @param length The length of the buffer (must be &lt;= buf.length)
- * @param address The socket address to send to
- *
- * @exception SocketException If an error occurs
- * @exception IllegalArgumentException If address type is not supported
- *
- * @since 1.4
- */
- public DatagramPacket(byte[] buf, int offset, int length,
- SocketAddress address) throws SocketException
- {
- if (! (address instanceof InetSocketAddress))
- throw new IllegalArgumentException("unsupported address type");
-
- InetSocketAddress tmp = (InetSocketAddress) address;
- setData(buf, offset, length);
- setAddress(tmp.getAddress());
- setPort(tmp.getPort());
- }
-
- /**
- * Initializes a new instance of <code>DatagramPacket</code> for
- * transmitting packets across the network.
- *
- * @param buf A buffer containing the data to send
- * @param length The length of the buffer (must be &lt;= buf.length)
- * @param address The socket address to send to
- *
- * @exception SocketException If an error occurs
- * @exception IllegalArgumentException If address type is not supported
- *
- * @since 1.4
- */
- public DatagramPacket(byte[] buf, int length, SocketAddress address)
- throws SocketException
- {
- this(buf, 0, length, address);
- }
-
- /**
- * Returns the address that this packet is being sent to or, if it was used
- * to receive a packet, the address that is was received from. If the
- * constructor that doesn not take an address was used to create this object
- * and no packet was actually read into this object, then this method
- * returns <code>null</code>.
- *
- * @return The address for this packet.
- */
- public synchronized InetAddress getAddress()
- {
- return address;
- }
-
- /**
- * Returns the port number this packet is being sent to or, if it was used
- * to receive a packet, the port that it was received from. If the
- * constructor that doesn not take an address was used to create this object
- * and no packet was actually read into this object, then this method
- * will return 0.
- *
- * @return The port number for this packet
- */
- public synchronized int getPort()
- {
- return port;
- }
-
- /**
- * Returns the data buffer for this packet
- *
- * @return This packet's data buffer
- */
- public synchronized byte[] getData()
- {
- return buffer;
- }
-
- /**
- * This method returns the current offset value into the data buffer
- * where data will be sent from.
- *
- * @return The buffer offset.
- *
- * @since 1.2
- */
- public synchronized int getOffset()
- {
- return offset;
- }
-
- /**
- * Returns the length of the data in the buffer
- *
- * @return The length of the data
- */
- public synchronized int getLength()
- {
- return length;
- }
-
- /**
- * This sets the address to which the data packet will be transmitted.
- *
- * @param address The destination address
- *
- * @since 1.1
- */
- public synchronized void setAddress(InetAddress address)
- {
- this.address = address;
- }
-
- /**
- * This sets the port to which the data packet will be transmitted.
- *
- * @param port The destination port
- *
- * @since 1.1
- */
- public synchronized void setPort(int port)
- {
- if (port < 0 || port > 65535)
- throw new IllegalArgumentException("Invalid port: " + port);
-
- this.port = port;
- }
-
- /**
- * Sets the address of the remote host this package will be sent
- *
- * @param address The socket address of the remove host
- *
- * @exception IllegalArgumentException If address type is not supported
- *
- * @since 1.4
- */
- public void setSocketAddress(SocketAddress address)
- throws IllegalArgumentException
- {
- if (address == null)
- throw new IllegalArgumentException("address may not be null");
-
- InetSocketAddress tmp = (InetSocketAddress) address;
- this.address = tmp.getAddress();
- this.port = tmp.getPort();
- }
-
- /**
- * Gets the socket address of the host this packet
- * will be sent to/is coming from
- *
- * @return The socket address of the remote host
- *
- * @since 1.4
- */
- public SocketAddress getSocketAddress()
- {
- return new InetSocketAddress(address, port);
- }
-
- /**
- * Sets the data buffer for this packet.
- *
- * @param buf The new buffer for this packet
- *
- * @exception NullPointerException If the argument is null
- *
- * @since 1.1
- */
- public void setData(byte[] buf)
- {
- setData(buf, 0, buf.length);
- }
-
- /**
- * This method sets the data buffer for the packet.
- *
- * @param buf The byte array containing the data for this packet.
- * @param offset The offset into the buffer to start reading data from.
- * @param length The number of bytes of data in the buffer.
- *
- * @exception NullPointerException If the argument is null
- *
- * @since 1.2
- */
- public synchronized void setData(byte[] buf, int offset, int length)
- {
- // This form of setData must be used if offset is to be changed.
- if (buf == null)
- throw new NullPointerException("Null buffer");
- if (offset < 0)
- throw new IllegalArgumentException("Invalid offset: " + offset);
-
- buffer = buf;
- this.offset = offset;
- setLength(length);
- }
-
- /**
- * Sets the length of the data in the buffer.
- *
- * @param length The new length. (Where len &lt;= buf.length)
- *
- * @exception IllegalArgumentException If the length is negative or
- * if the length is greater than the packet's data buffer length
- *
- * @since 1.1
- */
- public synchronized void setLength(int length)
- {
- if (length < 0)
- throw new IllegalArgumentException("Invalid length: " + length);
- if (offset + length > buffer.length)
- throw new IllegalArgumentException("Potential buffer overflow - offset: "
- + offset + " length: " + length);
-
- this.length = length;
- this.maxlen = length;
- }
-}
diff --git a/libjava/java/net/DatagramSocket.java b/libjava/java/net/DatagramSocket.java
deleted file mode 100644
index d675cb1df00..00000000000
--- a/libjava/java/net/DatagramSocket.java
+++ /dev/null
@@ -1,931 +0,0 @@
-/* DatagramSocket.java -- A class to model UDP sockets
- Copyright (C) 1998, 1999, 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import gnu.java.net.PlainDatagramSocketImpl;
-import gnu.java.nio.DatagramChannelImpl;
-
-import java.io.IOException;
-import java.nio.channels.DatagramChannel;
-import java.nio.channels.IllegalBlockingModeException;
-
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-/**
- * This class models a connectionless datagram socket that sends
- * individual packets of data across the network. In the TCP/IP world,
- * this means UDP. Datagram packets do not have guaranteed delivery,
- * or any guarantee about the order the data will be received on the
- * remote host.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @date May 3, 1999.
- */
-public class DatagramSocket
-{
- /**
- * This is the user DatagramSocketImplFactory for this class. If this
- * variable is null, a default factory is used.
- */
- private static DatagramSocketImplFactory factory;
-
- /**
- * This is the implementation object used by this socket.
- */
- private DatagramSocketImpl impl;
-
- /**
- * True if socket implementation was created.
- */
- private boolean implCreated;
-
- /**
- * This is the address we are "connected" to
- */
- private InetAddress remoteAddress;
-
- /**
- * This is the port we are "connected" to
- */
- private int remotePort = -1;
-
- /**
- * True if socket is bound.
- */
- private boolean bound;
-
- /**
- * Creates a <code>DatagramSocket</code> from a specified
- * <code>DatagramSocketImpl</code> instance
- *
- * @param impl The <code>DatagramSocketImpl</code> the socket will be
- * created from
- *
- * @since 1.4
- */
- protected DatagramSocket(DatagramSocketImpl impl)
- {
- if (impl == null)
- throw new NullPointerException("impl may not be null");
-
- this.impl = impl;
- this.remoteAddress = null;
- this.remotePort = -1;
- }
-
- /**
- * Initializes a new instance of <code>DatagramSocket</code> that binds to
- * a random port and every address on the local machine.
- *
- * @exception SocketException If an error occurs.
- * @exception SecurityException If a security manager exists and
- * its <code>checkListen</code> method doesn't allow the operation.
- */
- public DatagramSocket() throws SocketException
- {
- this(new InetSocketAddress(0));
- }
-
- /**
- * Initializes a new instance of <code>DatagramSocket</code> that binds to
- * the specified port and every address on the local machine.
- *
- * @param port The local port number to bind to.
- *
- * @exception SecurityException If a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
- * @exception SocketException If an error occurs.
- */
- public DatagramSocket(int port) throws SocketException
- {
- this(new InetSocketAddress(port));
- }
-
- /**
- * Initializes a new instance of <code>DatagramSocket</code> that binds to
- * the specified local port and address.
- *
- * @param port The local port number to bind to.
- * @param addr The local address to bind to.
- *
- * @exception SecurityException If a security manager exists and its
- * checkListen method doesn't allow the operation.
- * @exception SocketException If an error occurs.
- */
- public DatagramSocket(int port, InetAddress addr) throws SocketException
- {
- this(new InetSocketAddress(addr, port));
- }
-
- /**
- * Initializes a new instance of <code>DatagramSocket</code> that binds to
- * the specified local port and address.
- *
- * @param address The local address and port number to bind to.
- *
- * @exception SecurityException If a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
- * @exception SocketException If an error occurs.
- *
- * @since 1.4
- */
- public DatagramSocket(SocketAddress address) throws SocketException
- {
- String propVal = System.getProperty("impl.prefix");
- if (propVal == null || propVal.equals(""))
- impl = new PlainDatagramSocketImpl();
- else
- try
- {
- impl =
- (DatagramSocketImpl) Class.forName("java.net." + propVal
- + "DatagramSocketImpl")
- .newInstance();
- }
- catch (Exception e)
- {
- System.err.println("Could not instantiate class: java.net."
- + propVal + "DatagramSocketImpl");
- impl = new PlainDatagramSocketImpl();
- }
-
- if (address != null)
- bind(address);
- }
-
- // This needs to be accessible from java.net.MulticastSocket
- DatagramSocketImpl getImpl() throws SocketException
- {
- try
- {
- if (! implCreated)
- {
- impl.create();
- implCreated = true;
- }
-
- return impl;
- }
- catch (IOException e)
- {
- throw new SocketException(e.getMessage());
- }
- }
-
- /**
- * Closes this datagram socket.
- */
- public void close()
- {
- if (isClosed())
- return;
-
- try
- {
- getImpl().close();
- }
- catch (SocketException e)
- {
- // Ignore this case, just close the socket in finally clause.
- }
- finally
- {
- remoteAddress = null;
- remotePort = -1;
- impl = null;
- }
-
- try
- {
- if (getChannel() != null)
- getChannel().close();
- }
- catch (IOException e)
- {
- // Do nothing.
- }
- }
-
- /**
- * This method returns the remote address to which this socket is
- * connected. If this socket is not connected, then this method will
- * return <code>null</code>.
- *
- * @return The remote address.
- *
- * @since 1.2
- */
- public InetAddress getInetAddress()
- {
- return remoteAddress;
- }
-
- /**
- * This method returns the remote port to which this socket is
- * connected. If this socket is not connected, then this method will
- * return -1.
- *
- * @return The remote port.
- *
- * @since 1.2
- */
- public int getPort()
- {
- return remotePort;
- }
-
- /**
- * Returns the local address this datagram socket is bound to.
- *
- * @return The local address is the socket is bound or null
- *
- * @since 1.1
- */
- public InetAddress getLocalAddress()
- {
- if (! isBound())
- return null;
-
- InetAddress localAddr;
-
- try
- {
- localAddr =
- (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR);
-
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkConnect(localAddr.getHostName(), -1);
- }
- catch (SecurityException e)
- {
- localAddr = InetAddress.ANY_IF;
- }
- catch (SocketException e)
- {
- // This cannot happen as we are bound.
- return null;
- }
-
- return localAddr;
- }
-
- /**
- * Returns the local port this socket is bound to.
- *
- * @return The local port number.
- */
- public int getLocalPort()
- {
- if (isClosed())
- return -1;
-
- try
- {
- return getImpl().getLocalPort();
- }
- catch (SocketException e)
- {
- // This cannot happen as we are bound.
- return 0;
- }
- }
-
- /**
- * Returns the value of the socket's SO_TIMEOUT setting. If this method
- * returns 0 then SO_TIMEOUT is disabled.
- *
- * @return The current timeout in milliseconds.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.1
- */
- public synchronized int getSoTimeout() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_TIMEOUT);
-
- if (buf instanceof Integer)
- return ((Integer) buf).intValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * Sets the value of the socket's SO_TIMEOUT value. A value of 0 will
- * disable SO_TIMEOUT. Any other value is the number of milliseconds
- * a socket read/write will block before timing out.
- *
- * @param timeout The new SO_TIMEOUT value in milliseconds.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.1
- */
- public synchronized void setSoTimeout(int timeout) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (timeout < 0)
- throw new IllegalArgumentException("Invalid timeout: " + timeout);
-
- getImpl().setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout));
- }
-
- /**
- * This method returns the value of the system level socket option
- * SO_SNDBUF, which is used by the operating system to tune buffer
- * sizes for data transfers.
- *
- * @return The send buffer size.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.2
- */
- public int getSendBufferSize() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_SNDBUF);
-
- if (buf instanceof Integer)
- return ((Integer) buf).intValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * This method sets the value for the system level socket option
- * SO_SNDBUF to the specified value. Note that valid values for this
- * option are specific to a given operating system.
- *
- * @param size The new send buffer size.
- *
- * @exception SocketException If an error occurs.
- * @exception IllegalArgumentException If size is 0 or negative.
- *
- * @since 1.2
- */
- public void setSendBufferSize(int size) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (size < 0)
- throw new IllegalArgumentException("Buffer size is less than 0");
-
- getImpl().setOption(SocketOptions.SO_SNDBUF, new Integer(size));
- }
-
- /**
- * This method returns the value of the system level socket option
- * SO_RCVBUF, which is used by the operating system to tune buffer
- * sizes for data transfers.
- *
- * @return The receive buffer size.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.2
- */
- public int getReceiveBufferSize() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_RCVBUF);
-
- if (buf instanceof Integer)
- return ((Integer) buf).intValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * This method sets the value for the system level socket option
- * SO_RCVBUF to the specified value. Note that valid values for this
- * option are specific to a given operating system.
- *
- * @param size The new receive buffer size.
- *
- * @exception SocketException If an error occurs.
- * @exception IllegalArgumentException If size is 0 or negative.
- *
- * @since 1.2
- */
- public void setReceiveBufferSize(int size) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (size < 0)
- throw new IllegalArgumentException("Buffer size is less than 0");
-
- getImpl().setOption(SocketOptions.SO_RCVBUF, new Integer(size));
- }
-
- /**
- * This method connects this socket to the specified address and port.
- * When a datagram socket is connected, it will only send or receive
- * packets to and from the host to which it is connected. A multicast
- * socket that is connected may only send and not receive packets.
- *
- * @param address The address to connect this socket to.
- * @param port The port to connect this socket to.
- *
- * @exception SocketException If an error occurs.
- * @exception IllegalArgumentException If address or port are invalid.
- * @exception SecurityException If the caller is not allowed to send
- * datagrams to or receive from this address and port.
- *
- * @since 1.2
- */
- public void connect(InetAddress address, int port)
- {
- if (address == null)
- throw new IllegalArgumentException("Connect address may not be null");
-
- if ((port < 1) || (port > 65535))
- throw new IllegalArgumentException("Port number is illegal: " + port);
-
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkConnect(address.getHostName(), port);
-
- try
- {
- getImpl().connect(address, port);
- remoteAddress = address;
- remotePort = port;
- }
- catch (SocketException e)
- {
- // This means simply not connected or connect not implemented.
- }
- }
-
- /**
- * This method disconnects this socket from the address/port it was
- * connected to. If the socket was not connected in the first place,
- * this method does nothing.
- *
- * @since 1.2
- */
- public void disconnect()
- {
- if (! isConnected())
- return;
-
- try
- {
- getImpl().disconnect();
- }
- catch (SocketException e)
- {
- // This cannot happen as we are connected.
- }
- finally
- {
- remoteAddress = null;
- remotePort = -1;
- }
- }
-
- /**
- * Reads a datagram packet from the socket. Note that this method
- * will block until a packet is received from the network. On return,
- * the passed in <code>DatagramPacket</code> is populated with the data
- * received and all the other information about the packet.
- *
- * @param p A <code>DatagramPacket</code> for storing the data
- *
- * @exception IOException If an error occurs.
- * @exception SocketTimeoutException If setSoTimeout was previously called
- * and the timeout has expired.
- * @exception PortUnreachableException If the socket is connected to a
- * currently unreachable destination. Note, there is no guarantee that the
- * exception will be thrown.
- * @exception IllegalBlockingModeException If this socket has an associated
- * channel, and the channel is in non-blocking mode.
- * @exception SecurityException If a security manager exists and its
- * checkAccept method doesn't allow the receive.
- */
- public synchronized void receive(DatagramPacket p) throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (remoteAddress != null && remoteAddress.isMulticastAddress())
- throw new IOException
- ("Socket connected to a multicast address my not receive");
-
- if (getChannel() != null && ! getChannel().isBlocking()
- && ! ((DatagramChannelImpl) getChannel()).isInChannelOperation())
- throw new IllegalBlockingModeException();
-
- getImpl().receive(p);
-
- SecurityManager s = System.getSecurityManager();
- if (s != null && isConnected())
- s.checkAccept(p.getAddress().getHostName(), p.getPort());
- }
-
- /**
- * Sends the specified packet. The host and port to which the packet
- * are to be sent should be set inside the packet.
- *
- * @param p The datagram packet to send.
- *
- * @exception IOException If an error occurs.
- * @exception SecurityException If a security manager exists and its
- * checkMulticast or checkConnect method doesn't allow the send.
- * @exception PortUnreachableException If the socket is connected to a
- * currently unreachable destination. Note, there is no guarantee that the
- * exception will be thrown.
- * @exception IllegalBlockingModeException If this socket has an associated
- * channel, and the channel is in non-blocking mode.
- */
- public void send(DatagramPacket p) throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- // JDK1.2: Don't do security checks if socket is connected; see jdk1.2 api.
- SecurityManager s = System.getSecurityManager();
- if (s != null && ! isConnected())
- {
- InetAddress addr = p.getAddress();
- if (addr.isMulticastAddress())
- s.checkMulticast(addr);
- else
- s.checkConnect(addr.getHostAddress(), p.getPort());
- }
-
- if (isConnected())
- {
- if (p.getAddress() != null
- && (remoteAddress != p.getAddress() || remotePort != p.getPort()))
- throw new IllegalArgumentException
- ("DatagramPacket address does not match remote address");
- }
-
- // FIXME: if this is a subclass of MulticastSocket,
- // use getTimeToLive for TTL val.
- if (getChannel() != null && ! getChannel().isBlocking()
- && ! ((DatagramChannelImpl) getChannel()).isInChannelOperation())
- throw new IllegalBlockingModeException();
-
- getImpl().send(p);
- }
-
- /**
- * Binds the socket to the given socket address.
- *
- * @param address The socket address to bind to.
- *
- * @exception SocketException If an error occurs.
- * @exception SecurityException If a security manager exists and
- * its checkListen method doesn't allow the operation.
- * @exception IllegalArgumentException If address type is not supported.
- *
- * @since 1.4
- */
- public void bind(SocketAddress address) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (! (address instanceof InetSocketAddress))
- throw new IllegalArgumentException("unsupported address type");
-
- InetAddress addr = ((InetSocketAddress) address).getAddress();
- int port = ((InetSocketAddress) address).getPort();
-
- if (port < 0 || port > 65535)
- throw new IllegalArgumentException("Invalid port: " + port);
-
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkListen(port);
-
- if (addr == null)
- addr = InetAddress.ANY_IF;
-
- try
- {
- getImpl().bind(port, addr);
- bound = true;
- }
- catch (SocketException exception)
- {
- getImpl().close();
- throw exception;
- }
- catch (RuntimeException exception)
- {
- getImpl().close();
- throw exception;
- }
- catch (Error error)
- {
- getImpl().close();
- throw error;
- }
- }
-
- /**
- * Checks if the datagram socket is closed.
- *
- * @return True if socket is closed, false otherwise.
- *
- * @since 1.4
- */
- public boolean isClosed()
- {
- return impl == null;
- }
-
- /**
- * Returns the datagram channel assoziated with this datagram socket.
- *
- * @return The associated <code>DatagramChannel</code> object or null
- *
- * @since 1.4
- */
- public DatagramChannel getChannel()
- {
- return null;
- }
-
- /**
- * Connects the datagram socket to a specified socket address.
- *
- * @param address The socket address to connect to.
- *
- * @exception SocketException If an error occurs.
- * @exception IllegalArgumentException If address type is not supported.
- *
- * @since 1.4
- */
- public void connect(SocketAddress address) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (! (address instanceof InetSocketAddress))
- throw new IllegalArgumentException("unsupported address type");
-
- InetSocketAddress tmp = (InetSocketAddress) address;
- connect(tmp.getAddress(), tmp.getPort());
- }
-
- /**
- * Returns the binding state of the socket.
- *
- * @return True if socket bound, false otherwise.
- *
- * @since 1.4
- */
- public boolean isBound()
- {
- return bound;
- }
-
- /**
- * Returns the connection state of the socket.
- *
- * @return True if socket is connected, false otherwise.
- *
- * @since 1.4
- */
- public boolean isConnected()
- {
- return remoteAddress != null;
- }
-
- /**
- * Returns the SocketAddress of the host this socket is conneted to
- * or null if this socket is not connected.
- *
- * @return The socket address of the remote host if connected or null
- *
- * @since 1.4
- */
- public SocketAddress getRemoteSocketAddress()
- {
- if (! isConnected())
- return null;
-
- return new InetSocketAddress(remoteAddress, remotePort);
- }
-
- /**
- * Returns the local SocketAddress this socket is bound to.
- *
- * @return The local SocketAddress or null if the socket is not bound.
- *
- * @since 1.4
- */
- public SocketAddress getLocalSocketAddress()
- {
- if (! isBound())
- return null;
-
- return new InetSocketAddress(getLocalAddress(), getLocalPort());
- }
-
- /**
- * Enables/Disables SO_REUSEADDR.
- *
- * @param on Whether or not to have SO_REUSEADDR turned on.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.4
- */
- public void setReuseAddress(boolean on) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().setOption(SocketOptions.SO_REUSEADDR, Boolean.valueOf(on));
- }
-
- /**
- * Checks if SO_REUSEADDR is enabled.
- *
- * @return True if SO_REUSEADDR is set on the socket, false otherwise.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.4
- */
- public boolean getReuseAddress() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_REUSEADDR);
-
- if (buf instanceof Boolean)
- return ((Boolean) buf).booleanValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * Enables/Disables SO_BROADCAST
- *
- * @param enable True if SO_BROADCAST should be enabled, false otherwise.
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public void setBroadcast(boolean enable) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().setOption(SocketOptions.SO_BROADCAST, Boolean.valueOf(enable));
- }
-
- /**
- * Checks if SO_BROADCAST is enabled
- *
- * @return Whether SO_BROADCAST is set
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public boolean getBroadcast() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_BROADCAST);
-
- if (buf instanceof Boolean)
- return ((Boolean) buf).booleanValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * Sets the traffic class value
- *
- * @param tc The traffic class
- *
- * @exception SocketException If an error occurs
- * @exception IllegalArgumentException If tc value is illegal
- *
- * @see DatagramSocket#getTrafficClass()
- *
- * @since 1.4
- */
- public void setTrafficClass(int tc) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (tc < 0 || tc > 255)
- throw new IllegalArgumentException();
-
- getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc));
- }
-
- /**
- * Returns the current traffic class
- *
- * @return The current traffic class.
- *
- * @see DatagramSocket#setTrafficClass(int tc)
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public int getTrafficClass() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.IP_TOS);
-
- if (buf instanceof Integer)
- return ((Integer) buf).intValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * Sets the datagram socket implementation factory for the application
- *
- * @param fac The factory to set
- *
- * @exception IOException If an error occurs
- * @exception SocketException If the factory is already defined
- * @exception SecurityException If a security manager exists and its
- * checkSetFactory method doesn't allow the operation
- */
- public static void setDatagramSocketImplFactory(DatagramSocketImplFactory fac)
- throws IOException
- {
- if (factory != null)
- throw new SocketException("DatagramSocketImplFactory already defined");
-
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSetFactory();
-
- factory = fac;
- }
-}
diff --git a/libjava/java/net/DatagramSocketImpl.java b/libjava/java/net/DatagramSocketImpl.java
deleted file mode 100644
index cfcde92e5fc..00000000000
--- a/libjava/java/net/DatagramSocketImpl.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/* DatagramSocketImpl.java -- Abstract class for UDP socket implementations
- Copyright (C) 1998, 1999 2000, 2001,
- 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.FileDescriptor;
-import java.io.IOException;
-
-
-/**
- * This abstract class models a datagram socket implementation. An
- * actual implementation class would implement these methods, probably
- * via redirecting them to native code.
- * <p>
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * <p>
- * Status: Believed complete and correct.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- */
-public abstract class DatagramSocketImpl implements SocketOptions
-{
- /**
- * The local port to which this socket is bound
- */
- protected int localPort;
-
- /**
- * The FileDescriptor object for this object.
- */
- protected FileDescriptor fd;
-
- /**
- * Default, no-argument constructor for subclasses to call.
- */
- public DatagramSocketImpl()
- {
- }
-
- /**
- * This method binds the socket to the specified local port and address.
- *
- * @param lport The port number to bind to
- * @param laddr The address to bind to
- *
- * @exception SocketException If an error occurs
- */
- protected abstract void bind(int lport, InetAddress laddr)
- throws SocketException;
-
- /**
- * This methods closes the socket
- */
- protected abstract void close();
-
- /**
- * Creates a new datagram socket.
- *
- * @exception SocketException If an error occurs
- */
- protected abstract void create() throws SocketException;
-
- /**
- * Takes a peek at the next packet received in order to retrieve the
- * address of the sender
- *
- * @param i The <code>InetAddress</code> to fill in with the information
- * about the sender if the next packet
- *
- * @return The port number of the sender of the packet
- *
- * @exception IOException If an error occurs
- * @exception PortUnreachableException May be thrown if the socket is
- * connected to a currently unreachable destination. Note, there is no
- * guarantee that the exception will be thrown.
- */
- protected abstract int peek(InetAddress i) throws IOException;
-
- /**
- * Takes a peek at the next packet received. This packet is not consumed.
- * With the next peekData/receive operation this packet will be read again.
- *
- * @param p The <code>DatagramPacket</code> to fill in with the data sent.
- *
- * @return The port number of the sender of the packet.
- *
- * @exception IOException If an error occurs
- * @exception PortUnreachableException May be thrown if the socket is
- * connected to a currently unreachable destination. Note, there is no
- * guarantee that the exception will be thrown.
- *
- * @since 1.4
- */
- protected abstract int peekData(DatagramPacket p) throws IOException;
-
- /**
- * Transmits the specified packet of data to the network. The destination
- * host and port should be encoded in the packet.
- *
- * @param p The packet to send
- *
- * @exception IOException If an error occurs
- * @exception PortUnreachableException May be thrown if the socket is
- * connected to a currently unreachable destination. Note, there is no
- * guarantee that the exception will be thrown.
- */
- protected abstract void send(DatagramPacket p) throws IOException;
-
- /**
- * Receives a packet of data from the network Will block until a packet
- * arrives. The packet info in populated into the passed in
- * <code>DatagramPacket</code> object.
- *
- * @param p A place to store the incoming packet.
- *
- * @exception IOException If an error occurs
- * @exception PortUnreachableException May be thrown if the socket is
- * connected to a currently unreachable destination. Note, there is no
- * guarantee that the exception will be thrown.
- */
- protected abstract void receive(DatagramPacket p) throws IOException;
-
- /**
- * Connects the socket to a host specified by address and port.
- *
- * @param address The <code>InetAddress</code> of the host to connect to
- * @param port The port number of the host to connect to
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- protected void connect(InetAddress address, int port)
- throws SocketException
- {
- // This method has to be overwritten by real implementations
- }
-
- /**
- * Disconnects the socket.
- *
- * @since 1.4
- */
- protected void disconnect()
- {
- // This method has to be overwritten by real implementations
- }
-
- /**
- * Sets the Time to Live (TTL) setting on this socket to the specified
- * value. <b>Use <code>setTimeToLive(int)</code></b> instead.
- *
- * @param ttl The new Time to Live value
- *
- * @exception IOException If an error occurs
- * @deprecated
- */
- protected abstract void setTTL(byte ttl) throws IOException;
-
- /**
- * This method returns the current Time to Live (TTL) setting on this
- * socket. <b>Use <code>getTimeToLive()</code></b> instead.
- *
- * @return the current time-to-live
- *
- * @exception IOException If an error occurs
- *
- * @deprecated // FIXME: when ?
- */
- protected abstract byte getTTL() throws IOException;
-
- /**
- * Sets the Time to Live (TTL) setting on this socket to the specified
- * value.
- *
- * @param ttl The new Time to Live value
- *
- * @exception IOException If an error occurs
- */
- protected abstract void setTimeToLive(int ttl) throws IOException;
-
- /**
- * This method returns the current Time to Live (TTL) setting on this
- * socket.
- *
- * @return the current time-to-live
- *
- * @exception IOException If an error occurs
- */
- protected abstract int getTimeToLive() throws IOException;
-
- /**
- * Causes this socket to join the specified multicast group
- *
- * @param inetaddr The multicast address to join with
- *
- * @exception IOException If an error occurs
- */
- protected abstract void join(InetAddress inetaddr) throws IOException;
-
- /**
- * Causes the socket to leave the specified multicast group.
- *
- * @param inetaddr The multicast address to leave
- *
- * @exception IOException If an error occurs
- */
- protected abstract void leave(InetAddress inetaddr) throws IOException;
-
- /**
- * Causes this socket to join the specified multicast group on a specified
- * device
- *
- * @param mcastaddr The address to leave
- * @param netIf The specified network interface to join the group at
- *
- * @exception IOException If an error occurs
- *
- * @since 1.4
- */
- protected abstract void joinGroup(SocketAddress mcastaddr,
- NetworkInterface netIf)
- throws IOException;
-
- /**
- * Leaves a multicast group
- *
- * @param mcastaddr The address to join
- * @param netIf The specified network interface to leave the group at
- *
- * @exception IOException If an error occurs
- *
- * @since 1.4
- */
- protected abstract void leaveGroup(SocketAddress mcastaddr,
- NetworkInterface netIf)
- throws IOException;
-
- /**
- * Returns the FileDescriptor for this socket
- *
- * @return the file descriptor associated with this socket
- */
- protected FileDescriptor getFileDescriptor()
- {
- return fd;
- }
-
- /**
- * Returns the local port this socket is bound to
- *
- * @return the local port
- */
- protected int getLocalPort()
- {
- return localPort;
- }
-}
diff --git a/libjava/java/net/DatagramSocketImplFactory.java b/libjava/java/net/DatagramSocketImplFactory.java
deleted file mode 100644
index 014651aa899..00000000000
--- a/libjava/java/net/DatagramSocketImplFactory.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* DatagramSocketImplFactory.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/** Written using on-line Java Platform 1.4 API Specification.
- * Status: Believed complete and correct.
- */
-/**
- * This interface defines one method which returns a
- * <code>DatagramSocketImpl</code> object.
- * This should not be needed by ordinary applications.
- *
- * @author Michael Koch (konqueror@gmx.de)
- * @since 1.3
- */
-public interface DatagramSocketImplFactory
-{
- /**
- * This method returns an instance of the DatagramSocketImpl object
- *
- * @return A DatagramSocketImpl object
- */
- DatagramSocketImpl createDatagramSocketImpl();
-} // interface DatagramSocketImplFactory
diff --git a/libjava/java/net/FileNameMap.java b/libjava/java/net/FileNameMap.java
deleted file mode 100644
index 6f1d25a6a52..00000000000
--- a/libjava/java/net/FileNameMap.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* FileNameMap.java -- Maps filenames to MIME types
- Copyright (C) 1998, 1999, 2000, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-/**
- * This interface has one method which, when passed a filename, returns
- * the MIME type associated with that filename.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- */
-public interface FileNameMap
-{
- /**
- * This method is passed a filename and is responsible for determining
- * the appropriate MIME type for that file.
- *
- * @param filename The name of the file to generate a MIME type for.
- *
- * @return The MIME type for the filename passed in.
- */
- String getContentTypeFor(String filename);
-} // interface FileNameMap
diff --git a/libjava/java/net/HttpURLConnection.java b/libjava/java/net/HttpURLConnection.java
deleted file mode 100644
index 07eae48e77a..00000000000
--- a/libjava/java/net/HttpURLConnection.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/* HttpURLConnection.java -- Subclass of communications links using
- Hypertext Transfer Protocol.
- Copyright (C) 1998, 1999, 2000, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PushbackInputStream;
-import java.security.Permission;
-
-
-/*
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * This class provides a common abstract implementation for those
- * URL connection classes that will connect using the HTTP protocol.
- * In addition to the functionality provided by the URLConnection
- * class, it defines constants for HTTP return code values and
- * methods for setting the HTTP request method and determining whether
- * or not to follow redirects.
- *
- * @since 1.1
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public abstract class HttpURLConnection extends URLConnection
-{
- /* HTTP Success Response Codes */
-
- /**
- * Indicates that the client may continue with its request. This value
- * is specified as part of RFC 2068 but was not included in Sun's JDK, so
- * beware of using this value
- */
- static final int HTTP_CONTINUE = 100;
-
- /**
- * Indicates the request succeeded.
- */
- public static final int HTTP_OK = 200;
-
- /**
- * The requested resource has been created.
- */
- public static final int HTTP_CREATED = 201;
-
- /**
- * The request has been accepted for processing but has not completed.
- * There is no guarantee that the requested action will actually ever
- * be completed succesfully, but everything is ok so far.
- */
- public static final int HTTP_ACCEPTED = 202;
-
- /**
- * The meta-information returned in the header is not the actual data
- * from the original server, but may be from a local or other copy.
- * Normally this still indicates a successful completion.
- */
- public static final int HTTP_NOT_AUTHORITATIVE = 203;
-
- /**
- * The server performed the request, but there is no data to send
- * back. This indicates that the user's display should not be changed.
- */
- public static final int HTTP_NO_CONTENT = 204;
-
- /**
- * The server performed the request, but there is no data to sent back,
- * however, the user's display should be "reset" to clear out any form
- * fields entered.
- */
- public static final int HTTP_RESET = 205;
-
- /**
- * The server completed the partial GET request for the resource.
- */
- public static final int HTTP_PARTIAL = 206;
-
- /* HTTP Redirection Response Codes */
-
- /**
- * There is a list of choices available for the requested resource.
- */
- public static final int HTTP_MULT_CHOICE = 300;
-
- /**
- * The resource has been permanently moved to a new location.
- */
- public static final int HTTP_MOVED_PERM = 301;
-
- /**
- * The resource requested has been temporarily moved to a new location.
- */
- public static final int HTTP_MOVED_TEMP = 302;
-
- /**
- * The response to the request issued is available at another location.
- */
- public static final int HTTP_SEE_OTHER = 303;
-
- /**
- * The document has not been modified since the criteria specified in
- * a conditional GET.
- */
- public static final int HTTP_NOT_MODIFIED = 304;
-
- /**
- * The requested resource needs to be accessed through a proxy.
- */
- public static final int HTTP_USE_PROXY = 305;
-
- /* HTTP Client Error Response Codes */
-
- /**
- * The request was misformed or could not be understood.
- */
- public static final int HTTP_BAD_REQUEST = 400;
-
- /**
- * The request made requires user authorization. Try again with
- * a correct authentication header.
- */
- public static final int HTTP_UNAUTHORIZED = 401;
-
- /**
- * Code reserved for future use - I hope way in the future.
- */
- public static final int HTTP_PAYMENT_REQUIRED = 402;
-
- /**
- * There is no permission to access the requested resource.
- */
- public static final int HTTP_FORBIDDEN = 403;
-
- /**
- * The requested resource was not found.
- */
- public static final int HTTP_NOT_FOUND = 404;
-
- /**
- * The specified request method is not allowed for this resource.
- */
- public static final int HTTP_BAD_METHOD = 405;
-
- /**
- * Based on the input headers sent, the resource returned in response
- * to the request would not be acceptable to the client.
- */
- public static final int HTTP_NOT_ACCEPTABLE = 406;
-
- /**
- * The client must authenticate with a proxy prior to attempting this
- * request.
- */
- public static final int HTTP_PROXY_AUTH = 407;
-
- /**
- * The request timed out.
- */
- public static final int HTTP_CLIENT_TIMEOUT = 408;
-
- /**
- * There is a conflict between the current state of the resource and the
- * requested action.
- */
- public static final int HTTP_CONFLICT = 409;
-
- /**
- * The requested resource is no longer available. This ususally indicates
- * a permanent condition.
- */
- public static final int HTTP_GONE = 410;
-
- /**
- * A Content-Length header is required for this request, but was not
- * supplied.
- */
- public static final int HTTP_LENGTH_REQUIRED = 411;
-
- /**
- * A client specified pre-condition was not met on the server.
- */
- public static final int HTTP_PRECON_FAILED = 412;
-
- /**
- * The request sent was too large for the server to handle.
- */
- public static final int HTTP_ENTITY_TOO_LARGE = 413;
-
- /**
- * The name of the resource specified was too long.
- */
- public static final int HTTP_REQ_TOO_LONG = 414;
-
- /**
- * The request is in a format not supported by the requested resource.
- */
- public static final int HTTP_UNSUPPORTED_TYPE = 415;
-
- /* HTTP Server Error Response Codes */
-
- /**
- * This error code indicates that some sort of server error occurred.
- *
- * @deprecated
- */
- public static final int HTTP_SERVER_ERROR = 500;
-
- /**
- * The server encountered an unexpected error (such as a CGI script crash)
- * that prevents the request from being fulfilled.
- */
- public static final int HTTP_INTERNAL_ERROR = 500;
-
- /**
- * The server does not support the requested functionality.
- * @since 1.3
- */
- public static final int HTTP_NOT_IMPLEMENTED = 501;
-
- /**
- * The proxy encountered a bad response from the server it was proxy-ing for
- */
- public static final int HTTP_BAD_GATEWAY = 502;
-
- /**
- * The HTTP service is not availalble, such as because it is overloaded
- * and does not want additional requests.
- */
- public static final int HTTP_UNAVAILABLE = 503;
-
- /**
- * The proxy timed out getting a reply from the remote server it was
- * proxy-ing for.
- */
- public static final int HTTP_GATEWAY_TIMEOUT = 504;
-
- /**
- * This server does not support the protocol version requested.
- */
- public static final int HTTP_VERSION = 505;
-
- // Non-HTTP response static variables
-
- /**
- * Flag to indicate whether or not redirects should be automatically
- * followed by default.
- */
- private static boolean followRedirects = true;
-
- /**
- * This is a list of valid request methods, separated by "|" characters.
- */
- private static final String valid_methods =
- "|GET|POST|HEAD|OPTIONS|PUT|DELETE|TRACE|";
-
- // Instance Variables
-
- /**
- * The requested method in use for this connection. Default is GET.
- */
- protected String method = "GET";
-
- /**
- * The response code received from the server
- */
- protected int responseCode = -1;
-
- /**
- * The response message string received from the server.
- */
- protected String responseMessage;
-
- /**
- * If this instance should follow redirect requests.
- */
- protected boolean instanceFollowRedirects = followRedirects;
-
- /**
- * Whether we already got a valid response code for this connection.
- * Used by <code>getResponseCode()</code> and
- * <code>getResponseMessage()</code>.
- */
- private boolean gotResponseVals;
-
- /**
- * Create an HttpURLConnection for the specified URL
- *
- * @param url The URL to create this connection for.
- */
- protected HttpURLConnection(URL url)
- {
- super(url);
- }
-
- /**
- * Closes the connection to the server.
- */
- public abstract void disconnect();
-
- /**
- * Returns a boolean indicating whether or not this connection is going
- * through a proxy
- *
- * @return true if through a proxy, false otherwise
- */
- public abstract boolean usingProxy();
-
- /**
- * Sets whether HTTP redirects (requests with response code 3xx) should be
- * automatically followed by this class. True by default
- *
- * @param set true if redirects should be followed, false otherwis.
- *
- * @exception SecurityException If a security manager exists and its
- * checkSetFactory method doesn't allow the operation
- */
- public static void setFollowRedirects(boolean set)
- {
- // Throw an exception if an extant security mgr precludes
- // setting the factory.
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkSetFactory();
-
- followRedirects = set;
- }
-
- /**
- * Returns a boolean indicating whether or not HTTP redirects will
- * automatically be followed or not.
- *
- * @return true if redirects will be followed, false otherwise
- */
- public static boolean getFollowRedirects()
- {
- return followRedirects;
- }
-
- /**
- * Returns the value of this HttpURLConnection's instanceFollowRedirects
- * field
- *
- * @return true if following redirects is enabled, false otherwise
- */
- public boolean getInstanceFollowRedirects()
- {
- return instanceFollowRedirects;
- }
-
- /**
- * Sets the value of this HttpURLConnection's instanceFollowRedirects field
- *
- * @param follow true to enable following redirects, false otherwise
- */
- public void setInstanceFollowRedirects(boolean follow)
- {
- instanceFollowRedirects = follow;
- }
-
- /**
- * Set the method for the URL request, one of:
- * GET POST HEAD OPTIONS PUT DELETE TRACE are legal
- *
- * @param method the method to use
- *
- * @exception ProtocolException If the method cannot be reset or if the
- * requested method isn't valid for HTTP
- */
- public void setRequestMethod(String method) throws ProtocolException
- {
- if (connected)
- throw new ProtocolException("Already connected");
-
- method = method.toUpperCase();
- if (valid_methods.indexOf("|" + method + "|") != -1)
- this.method = method;
- else
- throw new ProtocolException("Invalid HTTP request method: " + method);
- }
-
- /**
- * The request method currently in use for this connection.
- *
- * @return The request method
- */
- public String getRequestMethod()
- {
- return method;
- }
-
- /**
- * Gets the status code from an HTTP response message, or -1 if
- * the response code could not be determined.
- * Note that all valid response codes have class variables
- * defined for them in this class.
- *
- * @return The response code
- *
- * @exception IOException If an error occurs
- */
- public int getResponseCode() throws IOException
- {
- if (! gotResponseVals)
- getResponseVals();
- return responseCode;
- }
-
- /**
- * Gets the HTTP response message, if any, returned along with the
- * response code from a server. Null if no response message was set
- * or an error occured while connecting.
- *
- * @return The response message
- *
- * @exception IOException If an error occurs
- */
- public String getResponseMessage() throws IOException
- {
- if (! gotResponseVals)
- getResponseVals();
- return responseMessage;
- }
-
- private void getResponseVals() throws IOException
- {
- // getHeaderField() will connect for us, but do it here first in
- // order to pick up IOExceptions.
- if (! connected)
- connect();
-
- gotResponseVals = true;
-
- // If responseCode not yet explicitly set by subclass
- if (responseCode == -1)
- {
- // Response is the first header received from the connection.
- String respField = getHeaderField(0);
-
- if (respField == null || ! respField.startsWith("HTTP/"))
- {
- // Set to default values on failure.
- responseCode = -1;
- responseMessage = null;
- return;
- }
-
- int firstSpc;
- int nextSpc;
- firstSpc = respField.indexOf(' ');
- nextSpc = respField.indexOf(' ', firstSpc + 1);
- responseMessage = respField.substring(nextSpc + 1);
- String codeStr = respField.substring(firstSpc + 1, nextSpc);
- try
- {
- responseCode = Integer.parseInt(codeStr);
- }
- catch (NumberFormatException e)
- {
- // Set to default values on failure.
- responseCode = -1;
- responseMessage = null;
- }
- }
- }
-
- /**
- * Returns a permission object representing the permission necessary to make
- * the connection represented by this object
- *
- * @return the permission necessary for this connection
- *
- * @exception IOException If an error occurs
- */
- public Permission getPermission() throws IOException
- {
- URL url = getURL();
- String host = url.getHost();
- int port = url.getPort();
- if (port == -1)
- port = 80;
-
- host = host + ":" + port;
-
- return new SocketPermission(host, "connect");
- }
-
- /**
- * This method allows the caller to retrieve any data that might have
- * been sent despite the fact that an error occurred. For example, the
- * HTML page sent along with a 404 File Not Found error. If the socket
- * is not connected, or if no error occurred or no data was returned,
- * this method returns <code>null</code>.
- *
- * @return An <code>InputStream</code> for reading error data.
- */
- public InputStream getErrorStream()
- {
- if (! connected)
- return null;
-
- int code;
- try
- {
- code = getResponseCode();
- }
- catch (IOException e)
- {
- code = -1;
- }
-
- if (code == -1)
- return null;
-
- if (((code / 100) != 4) || ((code / 100) != 5))
- return null;
-
- try
- {
- PushbackInputStream pbis = new PushbackInputStream(getInputStream());
-
- int i = pbis.read();
- if (i == -1)
- return null;
-
- pbis.unread(i);
- return pbis;
- }
- catch (IOException e)
- {
- return null;
- }
- }
-
- /**
- * Returns the value of the named field parsed as date
- *
- * @param key the key of the header field
- * @param value the default value if the header field is not present
- *
- * @return the value of the header field
- */
- public long getHeaderFieldDate(String key, long value)
- {
- // FIXME: implement this correctly
- // http://www.w3.org/Protocols/HTTP-NG/ng-notes.txt
- return super.getHeaderFieldDate(key, value);
- }
-}
diff --git a/libjava/java/net/Inet4Address.java b/libjava/java/net/Inet4Address.java
deleted file mode 100644
index 00c6501de0c..00000000000
--- a/libjava/java/net/Inet4Address.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/* Inet4Address.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.ObjectStreamException;
-
-/*
- * Written using on-line Java Platform 1.4 API Specification and
- * RFC 1884 (http://www.ietf.org/rfc/rfc1884.txt),
- * RFC 1918 (http://www.ietf.org/rfc/rfc1918.txt),
- * RFC 2365 (http://www.ietf.org/rfc/rfc2365.txt)
- *
- * @author Michael Koch
- * @status Believed complete and correct.
- */
-public final class Inet4Address extends InetAddress
-{
- /**
- * For compatability with Sun's JDK 1.4.2 rev. 5
- */
- static final long serialVersionUID = 3286316764910316507L;
-
- /**
- * needed for serialization
- */
- private Object writeReplace() throws ObjectStreamException
- {
- return new InetAddress(addr, hostName);
- }
-
- /**
- * Initializes this object's addr instance variable from the passed in
- * byte array. Note that this constructor is protected and is called
- * only by static methods in this class.
- *
- * @param addr The IP number of this address as an array of bytes
- * @param hostname The hostname of this IP address.
- */
- Inet4Address(byte[] addr, String host)
- {
- super(addr, host);
- }
-
- /**
- * Checks if the address is a multicast address
- *
- * @since 1.1
- */
- public boolean isMulticastAddress()
- {
- return super.isMulticastAddress();
- }
-
- /**
- * Checks if this address is a loopback address
- */
- public boolean isLoopbackAddress()
- {
- return super.isLoopbackAddress();
- }
-
- /**
- * Checks if this address is a wildcard address
- *
- * @since 1.4
- */
- public boolean isAnyLocalAddress()
- {
- return super.isAnyLocalAddress();
- }
-
- /**
- * Checks if this address is a link local address
- *
- * @since 1.4
- */
- public boolean isLinkLocalAddress()
- {
- return super.isLinkLocalAddress();
- }
-
- /**
- * Checks if this address is a site local address
- *
- * @since 1.4
- */
- public boolean isSiteLocalAddress()
- {
- return super.isSiteLocalAddress();
- }
-
- /**
- * Checks if this multicast address has global scope
- *
- * @since 1.4
- */
- public boolean isMCGlobal()
- {
- return super.isMCGlobal();
- }
-
- /**
- * Checks if this multicast address has node scope
- *
- * @since 1.4
- */
- public boolean isMCNodeLocal()
- {
- return isMCNodeLocal();
- }
-
- /**
- * Checks if this multicast address has link scope
- *
- * @since 1.4
- */
- public boolean isMCLinkLocal()
- {
- return super.isMCLinkLocal();
- }
-
- /**
- * Checks if this multicast address has site scope
- *
- * @since 1.4
- */
- public boolean isMCSiteLocal()
- {
- return super.isMCSiteLocal();
- }
-
- /**
- * Checks if this multicast address has organization scope
- *
- * @since 1.4
- */
- public boolean isMCOrgLocal()
- {
- return isMCOrgLocal();
- }
-
- /**
- * Returns the address of the current instance
- */
- public byte[] getAddress()
- {
- return (byte[]) addr.clone();
- }
-
- /**
- * Returns the address as string
- *
- * @since 1.0.2
- */
- public String getHostAddress()
- {
- return super.getHostAddress();
- }
-
- /**
- * Computes the hashcode of the instance
- */
- public int hashCode()
- {
- int hash = 0;
- int len = addr.length;
- int i = len > 4 ? len - 4 : 0;
-
- for (; i < len; i++)
- hash = (hash << 8) | (addr[i] & 0xFF);
-
- return hash;
- }
-
- /**
- * Compare the current Inet4Address instance with obj
- *
- * @param obj Object to compare with
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof InetAddress))
- return false;
-
- byte[] addr1 = addr;
- byte[] addr2 = ((InetAddress) obj).addr;
-
- if (addr1.length != addr2.length)
- return false;
-
- for (int i = addr1.length; --i >= 0;)
- if (addr1[i] != addr2[i])
- return false;
-
- return true;
- }
-}
diff --git a/libjava/java/net/Inet6Address.java b/libjava/java/net/Inet6Address.java
deleted file mode 100644
index 0d62fe919a0..00000000000
--- a/libjava/java/net/Inet6Address.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/* Inet6Address.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.util.Arrays;
-
-/*
- * Written using on-line Java Platform 1.4 API Specification and
- * RFC 1884 (http://www.ietf.org/rfc/rfc1884.txt)
- *
- * @author Michael Koch
- * @status Believed complete and correct.
- */
-public final class Inet6Address extends InetAddress
-{
- static final long serialVersionUID = 6880410070516793377L;
-
- /**
- * Needed for serialization
- */
- byte[] ipaddress;
-
- /**
- * Create an Inet6Address object
- *
- * @param addr The IP address
- * @param host The hostname
- */
- Inet6Address(byte[] addr, String host)
- {
- super(addr, host);
- // Super constructor clones the addr. Get a reference to the clone.
- this.ipaddress = this.addr;
- }
-
- /**
- * Utility routine to check if the InetAddress is an IP multicast address
- *
- * @since 1.1
- */
- public boolean isMulticastAddress()
- {
- return ipaddress[0] == 0xFF;
- }
-
- /**
- * Utility routine to check if the InetAddress in a wildcard address
- *
- * @since 1.4
- */
- public boolean isAnyLocalAddress()
- {
- byte[] anylocal = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
- return Arrays.equals(ipaddress, anylocal);
- }
-
- /**
- * Utility routine to check if the InetAddress is a loopback address
- *
- * @since 1.4
- */
- public boolean isLoopbackAddress()
- {
- byte[] loopback = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
-
- return Arrays.equals(ipaddress, loopback);
- }
-
- /**
- * Utility routine to check if the InetAddress is an link local address
- *
- * @since 1.4
- */
- public boolean isLinkLocalAddress()
- {
- return ipaddress[0] == 0xFA;
- }
-
- /**
- * Utility routine to check if the InetAddress is a site local address
- *
- * @since 1.4
- */
- public boolean isSiteLocalAddress()
- {
- return ipaddress[0] == 0xFB;
- }
-
- /**
- * Utility routine to check if the multicast address has global scope
- *
- * @since 1.4
- */
- public boolean isMCGlobal()
- {
- if (! isMulticastAddress())
- return false;
-
- return (ipaddress[1] & 0x0F) == 0xE;
- }
-
- /**
- * Utility routine to check if the multicast address has node scope
- *
- * @since 1.4
- */
- public boolean isMCNodeLocal()
- {
- if (! isMulticastAddress())
- return false;
-
- return (ipaddress[1] & 0x0F) == 0x1;
- }
-
- /**
- * Utility routine to check if the multicast address has link scope
- *
- * @since 1.4
- */
- public boolean isMCLinkLocal()
- {
- if (! isMulticastAddress())
- return false;
-
- return (ipaddress[1] & 0x0F) == 0x2;
- }
-
- /**
- * Utility routine to check if the multicast address has site scope
- *
- * @since 1.4
- */
- public boolean isMCSiteLocal()
- {
- if (! isMulticastAddress())
- return false;
-
- return (ipaddress[1] & 0x0F) == 0x5;
- }
-
- /**
- * Utility routine to check if the multicast address has organization scope
- *
- * @since 1.4
- */
- public boolean isMCOrgLocal()
- {
- if (! isMulticastAddress())
- return false;
-
- return (ipaddress[1] & 0x0F) == 0x8;
- }
-
- /**
- * Returns the raw IP address of this InetAddress object. The result is in
- * network byte order: the highest order byte of the address is i
- * n getAddress()[0]
- */
- public byte[] getAddress()
- {
- return (byte[]) ipaddress.clone();
- }
-
- /**
- * Returns the IP address string in textual presentation
- */
- public String getHostAddress()
- {
- StringBuffer sbuf = new StringBuffer(40);
-
- for (int i = 0; i < 16; i += 2)
- {
- int x = ((ipaddress[i] & 0xFF) << 8) | (ipaddress[i + 1] & 0xFF);
-
- if (i > 0)
- sbuf.append(':');
-
- sbuf.append(Integer.toHexString(x));
- }
-
- return sbuf.toString();
- }
-
- /**
- * Returns a hashcode for this IP address
- */
- public int hashCode()
- {
- return super.hashCode();
- }
-
- /**
- * Compares this object against the specified object
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof Inet6Address))
- return false;
-
- // this.ipaddress is never set in this class except to
- // the value of the super class' addr. The super classes
- // equals(Object) will do the compare.
- return super.equals(obj);
- }
-
- /**
- * Utility routine to check if the InetAddress is an
- * IPv4 compatible IPv6 address
- *
- * @since 1.4
- */
- public boolean isIPv4CompatibleAddress()
- {
- if (ipaddress[0] != 0x00 || ipaddress[1] != 0x00 || ipaddress[2] != 0x00
- || ipaddress[3] != 0x00 || ipaddress[4] != 0x00
- || ipaddress[5] != 0x00 || ipaddress[6] != 0x00
- || ipaddress[7] != 0x00 || ipaddress[8] != 0x00
- || ipaddress[9] != 0x00 || ipaddress[10] != 0x00
- || ipaddress[11] != 0x00)
- return false;
-
- return true;
- }
-}
diff --git a/libjava/java/net/InetSocketAddress.java b/libjava/java/net/InetSocketAddress.java
deleted file mode 100644
index 30d34e7e808..00000000000
--- a/libjava/java/net/InetSocketAddress.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/* InetSocketAddress.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * InetSocketAddress instances represent socket addresses
- * in the java.nio package. They encapsulate a InetAddress and
- * a port number.
- *
- * @since 1.4
- */
-public class InetSocketAddress extends SocketAddress
-{
- /**
- * Compatible with JDK 1.4+
- */
- private static final long serialVersionUID = 5076001401234631237L;
-
- /**
- * Name of host.
- */
- private String hostname;
-
- /**
- * Address of host.
- */
- private InetAddress addr;
-
- /**
- * Port of host.
- */
- private int port;
-
- /**
- * Constructs an InetSocketAddress instance.
- *
- * @param addr Address of the socket
- * @param port Port if the socket
- *
- * @exception IllegalArgumentException If the port number is illegel
- */
- public InetSocketAddress(InetAddress addr, int port)
- throws IllegalArgumentException
- {
- if (port < 0 || port > 65535)
- throw new IllegalArgumentException("Bad port number: " + port);
-
- if (addr == null)
- addr = InetAddress.ANY_IF;
-
- this.addr = addr;
- this.port = port;
- this.hostname = addr.getHostName();
- }
-
- /**
- * Constructs an InetSocketAddress instance.
- *
- * @param port Port if the socket
- *
- * @exception IllegalArgumentException If the port number is illegal
- */
- public InetSocketAddress(int port) throws IllegalArgumentException
- {
- this((InetAddress) null, port);
- }
-
- /**
- * Constructs an InetSocketAddress instance.
- *
- * @param hostname The hostname for the socket address
- * @param port The port for the socket address
- *
- * @exception IllegalArgumentException If the port number is illegal
- */
- public InetSocketAddress(String hostname, int port)
- throws IllegalArgumentException
- {
- if (hostname == null)
- throw new IllegalArgumentException("Null host name value");
-
- if (port < 0 || port > 65535)
- throw new IllegalArgumentException("Bad port number: " + port);
-
- this.port = port;
- this.hostname = hostname;
-
- try
- {
- this.addr = InetAddress.getByName(hostname);
- }
- catch (Exception e) // UnknownHostException, SecurityException
- {
- this.addr = null;
- }
- }
-
- /**
- * Test if obj is a <code>InetSocketAddress</code> and
- * has the same address and port
- *
- * @param obj The obj to compare this address with.
- *
- * @return True if obj is equal.
- */
- public final boolean equals(Object obj)
- {
- // InetSocketAddress objects are equal when addr and port are equal.
- // The hostname may differ.
- if (obj instanceof InetSocketAddress)
- {
- InetSocketAddress sa = (InetSocketAddress) obj;
-
- if (addr == null && sa.addr != null)
- return false;
- else if (addr == null && sa.addr == null)
- return hostname.equals(sa.hostname) && sa.port == port;
- else
- return addr.equals(sa.addr) && sa.port == port;
- }
-
- return false;
- }
-
- /**
- * Returns the <code>InetAddress</code> or
- * <code>null</code> if its unresolved
- *
- * @return The IP address of this address.
- */
- public final InetAddress getAddress()
- {
- return addr;
- }
-
- /**
- * Returns <code>hostname</code>
- *
- * @return The hostname of this address.
- */
- public final String getHostName()
- {
- return hostname;
- }
-
- /**
- * Returns the <code>port</code>
- *
- * @return The port of this address.
- */
- public final int getPort()
- {
- return port;
- }
-
- /**
- * Returns the hashcode of the <code>InetSocketAddress</code>
- *
- * @return The hashcode for this address.
- */
- public final int hashCode()
- {
- return port + addr.hashCode();
- }
-
- /**
- * Checks wether the address has been resolved or not
- *
- * @return True if address is unresolved.
- */
- public final boolean isUnresolved()
- {
- return addr == null;
- }
-
- /**
- * Returns the <code>InetSocketAddress</code> as string
- *
- * @return A string represenation of this address.
- */
- public String toString()
- {
- return (addr == null ? hostname : addr.getHostName()) + ":" + port;
- }
-}
diff --git a/libjava/java/net/MalformedURLException.java b/libjava/java/net/MalformedURLException.java
deleted file mode 100644
index 27e201886a0..00000000000
--- a/libjava/java/net/MalformedURLException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MalformedURLException.java -- A URL was not in a valid format
- Copyright (C) 1998, 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.IOException;
-
-
-/**
- * This exception indicates that a URL passed to an object was not in a
- * valid format.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class MalformedURLException extends IOException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -182787522200415866L;
-
- /**
- * Create a new instance without a descriptive error message.
- */
- public MalformedURLException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param message a message describing the error that occurred
- */
- public MalformedURLException(String message)
- {
- super(message);
- }
-} // class MalformedURLException
diff --git a/libjava/java/net/MulticastSocket.java b/libjava/java/net/MulticastSocket.java
deleted file mode 100644
index 03bdf1e77d9..00000000000
--- a/libjava/java/net/MulticastSocket.java
+++ /dev/null
@@ -1,486 +0,0 @@
-/* MulticastSocket.java -- Class for using multicast sockets
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.IOException;
-import java.util.Enumeration;
-
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-/**
- * This class models a multicast UDP socket. A multicast address is a
- * class D internet address (one whose most significant bits are 1110).
- * A multicast group consists of a multicast address and a well known
- * port number. All members of the group listening on that address and
- * port will receive all the broadcasts to the group.
- * <p>
- * Please note that applets are not allowed to use multicast sockets
- *
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com) (Documentation comments)
- * @since 1.1
- * @date May 18, 1999.
- */
-public class MulticastSocket extends DatagramSocket
-{
- /**
- * Create a MulticastSocket that this not bound to any address
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkListen method doesn't allow the operation
- */
- public MulticastSocket() throws IOException
- {
- this(new InetSocketAddress(0));
- }
-
- /**
- * Create a multicast socket bound to the specified port
- *
- * @param port The port to bind to
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkListen method doesn't allow the operation
- */
- public MulticastSocket(int port) throws IOException
- {
- this(new InetSocketAddress(port));
- }
-
- /**
- * Create a multicast socket bound to the specified SocketAddress.
- *
- * @param address The SocketAddress the multicast socket will be bound to
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkListen method doesn't allow the operation
- *
- * @since 1.4
- */
- public MulticastSocket(SocketAddress address) throws IOException
- {
- super((SocketAddress) null);
- setReuseAddress(true);
- if (address != null)
- bind(address);
- }
-
- /**
- * Returns the interface being used for multicast packets
- *
- * @return The multicast interface
- *
- * @exception SocketException If an error occurs
- */
- public InetAddress getInterface() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- return (InetAddress) getImpl().getOption(SocketOptions.IP_MULTICAST_IF);
- }
-
- /**
- * Returns the current value of the "Time to Live" option. This is the
- * number of hops a packet can make before it "expires". This method id
- * deprecated. Use <code>getTimeToLive</code> instead.
- *
- * @return The TTL value
- *
- * @exception IOException If an error occurs
- *
- * @deprecated 1.2 Replaced by getTimeToLive()
- *
- * @see MulticastSocket#getTimeToLive()
- */
- public byte getTTL() throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- // Use getTTL here rather than getTimeToLive in case we're using an impl
- // other than the default PlainDatagramSocketImpl and it doesn't have
- // getTimeToLive yet.
- return getImpl().getTTL();
- }
-
- /**
- * Returns the current value of the "Time to Live" option. This is the
- * number of hops a packet can make before it "expires".
- *
- * @return The TTL value
- *
- * @exception IOException If an error occurs
- *
- * @since 1.2
- */
- public int getTimeToLive() throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- return getImpl().getTimeToLive();
- }
-
- /**
- * Sets the interface to use for sending multicast packets.
- *
- * @param addr The new interface to use.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.4
- */
- public void setInterface(InetAddress addr) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().setOption(SocketOptions.IP_MULTICAST_IF, addr);
- }
-
- /**
- * Sets the local network interface used to send multicast messages
- *
- * @param netIf The local network interface used to send multicast messages
- *
- * @exception SocketException If an error occurs
- *
- * @see MulticastSocket#getNetworkInterface()
- *
- * @since 1.4
- */
- public void setNetworkInterface(NetworkInterface netIf)
- throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Enumeration e = netIf.getInetAddresses();
-
- if (! e.hasMoreElements())
- throw new SocketException("no network devices found");
-
- InetAddress address = (InetAddress) e.nextElement();
- getImpl().setOption(SocketOptions.IP_MULTICAST_IF, address);
- }
-
- /**
- * Gets the local network interface which is used to send multicast messages
- *
- * @return The local network interface to send multicast messages
- *
- * @exception SocketException If an error occurs
- *
- * @see MulticastSocket#setNetworkInterface(NetworkInterface netIf)
- *
- * @since 1.4
- */
- public NetworkInterface getNetworkInterface() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- InetAddress address =
- (InetAddress) getImpl().getOption(SocketOptions.IP_MULTICAST_IF);
- NetworkInterface netIf = NetworkInterface.getByInetAddress(address);
-
- return netIf;
- }
-
- /**
- * Disable/Enable local loopback of multicast packets. The option is used by
- * the platform's networking code as a hint for setting whether multicast
- * data will be looped back to the local socket.
- *
- * Because this option is a hint, applications that want to verify what
- * loopback mode is set to should call #getLoopbackMode
- *
- * @param disable True to disable loopback mode
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public void setLoopbackMode(boolean disable) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().setOption(SocketOptions.IP_MULTICAST_LOOP,
- Boolean.valueOf(disable));
- }
-
- /**
- * Checks if local loopback mode is enabled
- *
- * @return true if loopback mode is enabled, false otherwise
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public boolean getLoopbackMode() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.IP_MULTICAST_LOOP);
-
- if (buf instanceof Boolean)
- return ((Boolean) buf).booleanValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * Sets the "Time to Live" value for a socket. The value must be between
- * 1 and 255.
- *
- * @param ttl The new TTL value
- *
- * @exception IOException If an error occurs
- *
- * @deprecated 1.2 Replaced by <code>setTimeToLive</code>
- *
- * @see MulticastSocket#setTimeToLive(int ttl)
- */
- public void setTTL(byte ttl) throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- // Use setTTL here rather than setTimeToLive in case we're using an impl
- // other than the default PlainDatagramSocketImpl and it doesn't have
- // setTimeToLive yet.
- getImpl().setTTL(ttl);
- }
-
- /**
- * Sets the "Time to Live" value for a socket. The value must be between
- * 1 and 255.
- *
- * @param ttl The new TTL value
- *
- * @exception IOException If an error occurs
- *
- * @since 1.2
- */
- public void setTimeToLive(int ttl) throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (ttl <= 0 || ttl > 255)
- throw new IllegalArgumentException("Invalid ttl: " + ttl);
-
- getImpl().setTimeToLive(ttl);
- }
-
- /**
- * Joins the specified multicast group.
- *
- * @param mcastaddr The address of the group to join
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkMulticast method doesn't allow the operation
- */
- public void joinGroup(InetAddress mcastaddr) throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (! mcastaddr.isMulticastAddress())
- throw new IOException("Not a Multicast address");
-
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkMulticast(mcastaddr);
-
- getImpl().join(mcastaddr);
- }
-
- /**
- * Leaves the specified multicast group
- *
- * @param mcastaddr The address of the group to leave
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkMulticast method doesn't allow the operation
- */
- public void leaveGroup(InetAddress mcastaddr) throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (! mcastaddr.isMulticastAddress())
- throw new IOException("Not a Multicast address");
-
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkMulticast(mcastaddr);
-
- getImpl().leave(mcastaddr);
- }
-
- /**
- * Joins the specified mulitcast group on a specified interface.
- *
- * @param mcastaddr The multicast address to join
- * @param netIf The local network interface to receive the multicast
- * messages on or null to defer the interface set by #setInterface or
- * #setNetworkInterface
- *
- * @exception IOException If an error occurs
- * @exception IllegalArgumentException If address type is not supported
- * @exception SecurityException If a security manager exists and its
- * checkMulticast method doesn't allow the operation
- *
- * @see MulticastSocket#setInterface(InetAddress addr)
- * @see MulticastSocket#setNetworkInterface(NetworkInterface netIf)
- *
- * @since 1.4
- */
- public void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf)
- throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (! (mcastaddr instanceof InetSocketAddress))
- throw new IllegalArgumentException("SocketAddress type not supported");
-
- InetSocketAddress tmp = (InetSocketAddress) mcastaddr;
-
- if (! tmp.getAddress().isMulticastAddress())
- throw new IOException("Not a Multicast address");
-
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkMulticast(tmp.getAddress());
-
- getImpl().joinGroup(mcastaddr, netIf);
- }
-
- /**
- * Leaves the specified mulitcast group on a specified interface.
- *
- * @param mcastaddr The multicast address to leave
- * @param netIf The local networki interface or null to defer to the
- * interface set by setInterface or setNetworkInterface
- *
- * @exception IOException If an error occurs
- * @exception IllegalArgumentException If address type is not supported
- * @exception SecurityException If a security manager exists and its
- * checkMulticast method doesn't allow the operation
- *
- * @see MulticastSocket#setInterface(InetAddress addr)
- * @see MulticastSocket#setNetworkInterface(NetworkInterface netIf)
- *
- * @since 1.4
- */
- public void leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf)
- throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- InetSocketAddress tmp = (InetSocketAddress) mcastaddr;
-
- if (! tmp.getAddress().isMulticastAddress())
- throw new IOException("Not a Multicast address");
-
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkMulticast(tmp.getAddress());
-
- getImpl().leaveGroup(mcastaddr, netIf);
- }
-
- /**
- * Sends a packet of data to a multicast address with a TTL that is
- * different from the default TTL on this socket. The default TTL for
- * the socket is not changed.
- *
- * @param packet The packet of data to send
- * @param ttl The TTL for this packet
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkConnect or checkMulticast method doesn't allow the operation
- *
- * @deprecated
- */
- public synchronized void send(DatagramPacket packet, byte ttl)
- throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- {
- InetAddress addr = packet.getAddress();
- if (addr.isMulticastAddress())
- s.checkPermission(new SocketPermission(addr.getHostName()
- + packet.getPort(),
- "accept,connect"));
- else
- s.checkConnect(addr.getHostAddress(), packet.getPort());
- }
-
- int oldttl = getImpl().getTimeToLive();
- getImpl().setTimeToLive(((int) ttl) & 0xFF);
- getImpl().send(packet);
- getImpl().setTimeToLive(oldttl);
- }
-}
diff --git a/libjava/java/net/NetPermission.java b/libjava/java/net/NetPermission.java
deleted file mode 100644
index cabe54e065c..00000000000
--- a/libjava/java/net/NetPermission.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* NetPermission.java -- A class for basic miscellaneous network permission
- Copyright (C) 1998, 2000, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.security.BasicPermission;
-
-
-/**
- * This class is used to model miscellaneous network permissions. It is
- * a subclass of <code>BasicPermission</code>. This means that it models a
- * "boolean" permission. One that you either have or do not have. Thus
- * there is no permitted action list associated with this object.
- *
- * The following permission names are defined for this class:
- *
- * <ul>
- * <li>setDefaultAuthenticator - Grants the ability to install a facility
- * to collect username and password information when requested by a
- * web site or proxy server.</li>
- * <li>requestPasswordAuthentication - Grants the ability to ask the
- * authentication facility for the user's password.</li>
- * <li>specifyStreamHandler - Grants the permission to specify the
- * stream handler class used when loading from a URL.</li>
- * </ul>
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public final class NetPermission extends BasicPermission
-{
- static final long serialVersionUID = -8343910153355041693L;
-
- /**
- * Initializes a new instance of <code>NetPermission</code> with the
- * specified name.
- *
- * @param name The name of this permission.
- */
- public NetPermission(String name)
- {
- super(name);
- }
-
- /**
- * Initializes a new instance of <code>NetPermission</code> with the
- * specified name and perms. Note that the perms field is irrelevant and is
- * ignored. This constructor should never need to be used.
- *
- * @param name The name of this permission
- * @param perms The permitted actions of this permission (ignored)
- */
- public NetPermission(String name, String perms)
- {
- super(name);
- }
-}
diff --git a/libjava/java/net/NetworkInterface.java b/libjava/java/net/NetworkInterface.java
deleted file mode 100644
index eccd2dac9fb..00000000000
--- a/libjava/java/net/NetworkInterface.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/* NetworkInterface.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-/**
- * This class models a network interface on the host computer. A network
- * interface contains a name (typically associated with a specific
- * hardware adapter) and a list of addresses that are bound to it.
- * For example, an ethernet interface may be named "eth0" and have the
- * address 192.168.1.101 assigned to it.
- *
- * @author Michael Koch (konqueror@gmx.de)
- * @since 1.4
- */
-public final class NetworkInterface
-{
- private String name;
- private Vector inetAddresses;
-
- NetworkInterface(String name, InetAddress address)
- {
- this.name = name;
- this.inetAddresses = new Vector(1, 1);
- this.inetAddresses.add(address);
- }
-
- NetworkInterface(String name, InetAddress[] addresses)
- {
- this.name = name;
- this.inetAddresses = new Vector(addresses.length, 1);
-
- for (int i = 0; i < addresses.length; i++)
- this.inetAddresses.add(addresses[i]);
- }
-
- /**
- * Returns the name of the network interface
- *
- * @return The name of the interface.
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Returns all available addresses of the network interface
- *
- * If a @see SecurityManager is available all addresses are checked
- * with @see SecurityManager::checkConnect() if they are available.
- * Only <code>InetAddresses</code> are returned where the security manager
- * doesn't throw an exception.
- *
- * @return An enumeration of all addresses.
- */
- public Enumeration getInetAddresses()
- {
- SecurityManager s = System.getSecurityManager();
-
- if (s == null)
- return inetAddresses.elements();
-
- Vector tmpInetAddresses = new Vector(1, 1);
-
- for (Enumeration addresses = inetAddresses.elements();
- addresses.hasMoreElements();)
- {
- InetAddress addr = (InetAddress) addresses.nextElement();
- try
- {
- s.checkConnect(addr.getHostAddress(), 58000);
- tmpInetAddresses.add(addr);
- }
- catch (SecurityException e)
- {
- // Ignore.
- }
- }
-
- return tmpInetAddresses.elements();
- }
-
- /**
- * Returns the display name of the interface
- *
- * @return The display name of the interface
- */
- public String getDisplayName()
- {
- return name;
- }
-
- /**
- * Returns an network interface by name
- *
- * @param name The name of the interface to return
- *
- * @return a <code>NetworkInterface</code> object representing the interface,
- * or null if there is no interface with that name.
- *
- * @exception SocketException If an error occurs
- * @exception NullPointerException If the specified name is null
- */
- public static NetworkInterface getByName(String name)
- throws SocketException
- {
- Vector networkInterfaces = VMNetworkInterface.getInterfaces();
-
- for (Enumeration e = networkInterfaces.elements(); e.hasMoreElements();)
- {
- NetworkInterface tmp = (NetworkInterface) e.nextElement();
-
- if (name.equals(tmp.getName()))
- return tmp;
- }
-
- // No interface with the given name found.
- return null;
- }
-
- /**
- * Return a network interface by its address
- *
- * @param addr The address of the interface to return
- *
- * @return the interface, or <code>null</code> if none found
- *
- * @exception SocketException If an error occurs
- * @exception NullPointerException If the specified addess is null
- */
- public static NetworkInterface getByInetAddress(InetAddress addr)
- throws SocketException
- {
- Vector networkInterfaces = VMNetworkInterface.getInterfaces();
-
- for (Enumeration interfaces = networkInterfaces.elements();
- interfaces.hasMoreElements();)
- {
- NetworkInterface tmp = (NetworkInterface) interfaces.nextElement();
-
- for (Enumeration addresses = tmp.inetAddresses.elements();
- addresses.hasMoreElements();)
- {
- if (addr.equals((InetAddress) addresses.nextElement()))
- return tmp;
- }
- }
-
- throw new SocketException("no network interface is bound to such an IP address");
- }
-
- /**
- * Return an <code>Enumeration</code> of all available network interfaces
- *
- * @return all interfaces
- *
- * @exception SocketException If an error occurs
- */
- public static Enumeration getNetworkInterfaces() throws SocketException
- {
- Vector networkInterfaces = VMNetworkInterface.getInterfaces();
-
- if (networkInterfaces.isEmpty())
- return null;
-
- return networkInterfaces.elements();
- }
-
- /**
- * Checks if the current instance is equal to obj
- *
- * @param obj The object to compare with
- *
- * @return <code>true</code> if equal, <code>false</code> otherwise
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof NetworkInterface))
- return false;
-
- NetworkInterface tmp = (NetworkInterface) obj;
-
- return (name.equals(tmp.name) && inetAddresses.equals(tmp.inetAddresses));
- }
-
- /**
- * Returns the hashcode of the current instance
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- // FIXME: hash correctly
- return name.hashCode() + inetAddresses.hashCode();
- }
-
- /**
- * Returns a string representation of the interface
- *
- * @return the string
- */
- public String toString()
- {
- // FIXME: check if this is correct
- String result;
- String separator = System.getProperty("line.separator");
-
- result =
- "name: " + getDisplayName() + " (" + getName() + ") addresses:"
- + separator;
-
- for (Enumeration e = inetAddresses.elements(); e.hasMoreElements();)
- {
- InetAddress address = (InetAddress) e.nextElement();
- result += address.toString() + ";" + separator;
- }
-
- return result;
- }
-}
diff --git a/libjava/java/net/NoRouteToHostException.java b/libjava/java/net/NoRouteToHostException.java
deleted file mode 100644
index 48c3a8e604e..00000000000
--- a/libjava/java/net/NoRouteToHostException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* NoRouteToHostException.java -- Cannot connect to a host
- Copyright (C) 1998, 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * This exception indicates that there is no TCP/IP route to the requested
- * host. This is often due to a misconfigured routing table.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class NoRouteToHostException extends SocketException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -1897550894873493790L;
-
- /**
- * Create an instance without a descriptive error message.
- */
- public NoRouteToHostException()
- {
- }
-
- /**
- * Create an instance with a descriptive error message, such as the text
- * from strerror(3).
- *
- * @param message a message describing the error that occurred
- */
- public NoRouteToHostException(String message)
- {
- super(message);
- }
-} // class NoRouteToHostException
diff --git a/libjava/java/net/PasswordAuthentication.java b/libjava/java/net/PasswordAuthentication.java
deleted file mode 100644
index 1d4ec89611d..00000000000
--- a/libjava/java/net/PasswordAuthentication.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* PasswordAuthentication.java -- Container class for username/password pairs
- Copyright (C) 1998, 2000, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * This class serves a container for username/password pairs.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- *
- * @since 1.2
- */
-public final class PasswordAuthentication
-{
- /**
- * The username
- */
- private String username;
-
- /**
- * The password
- */
- private char[] password;
-
- /**
- * Creates a new <code>PasswordAuthentication</code> object from the
- * specified username and password.
- *
- * @param username The username for this object
- * @param password The password for this object
- */
- public PasswordAuthentication(String username, char[] password)
- {
- this.username = username;
- this.password = password;
- }
-
- /**
- * Returns the username associated with this object
- *
- * @return The username
- */
- public String getUserName()
- {
- return username;
- }
-
- /**
- * Returns the password associated with this object
- *
- * @return The password
- */
- public char[] getPassword()
- {
- return password;
- }
-}
diff --git a/libjava/java/net/PortUnreachableException.java b/libjava/java/net/PortUnreachableException.java
deleted file mode 100644
index 49a8c9ea103..00000000000
--- a/libjava/java/net/PortUnreachableException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* PortUnreachableException.java -- received an ICMP port unreachable datagram
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * This exception signals that an ICMP port unreachable datagram has been
- * received.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status updated to 1.4
- */
-public class PortUnreachableException extends SocketException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 8462541992376507323L;
-
- /**
- * Create a new instance without a descriptive error message.
- */
- public PortUnreachableException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param message a message describing the error that occurred
- */
- public PortUnreachableException(String message)
- {
- super(message);
- }
-} // class PortUnreachableException
diff --git a/libjava/java/net/ProtocolException.java b/libjava/java/net/ProtocolException.java
deleted file mode 100644
index 27718a9793d..00000000000
--- a/libjava/java/net/ProtocolException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* ProtocolException.java -- a low level protocol error occurred
- Copyright (C) 1998, 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.IOException;
-
-
-/**
- * This exception indicates that some sort of low level protocol
- * exception occurred. Look in the descriptive message (if any) for
- * details on what went wrong.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class ProtocolException extends IOException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -6098449442062388080L;
-
- /**
- * Create a new instance without a descriptive error message.
- */
- public ProtocolException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param message a message describing the error that occurred
- */
- public ProtocolException(String message)
- {
- super(message);
- }
-} // class ProtocolException
diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java
deleted file mode 100644
index 9432a6be1d8..00000000000
--- a/libjava/java/net/Socket.java
+++ /dev/null
@@ -1,1284 +0,0 @@
-/* Socket.java -- Client socket implementation
- Copyright (C) 1998, 1999, 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import gnu.java.net.PlainSocketImpl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.channels.IllegalBlockingModeException;
-import java.nio.channels.SocketChannel;
-
-
-/* Written using on-line Java Platform 1.2 API Specification.
- * Status: I believe all methods are implemented.
- */
-
-/**
- * This class models a client site socket. A socket is a TCP/IP endpoint
- * for network communications conceptually similar to a file handle.
- * <p>
- * This class does not actually do any work. Instead, it redirects all of
- * its calls to a socket implementation object which implements the
- * <code>SocketImpl</code> interface. The implementation class is
- * instantiated by factory class that implements the
- * <code>SocketImplFactory interface</code>. A default
- * factory is provided, however the factory may be set by a call to
- * the <code>setSocketImplFactory</code> method. Note that this may only be
- * done once per virtual machine. If a subsequent attempt is made to set the
- * factory, a <code>SocketException</code> will be thrown.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner (bothner@cygnus.com)
- */
-public class Socket
-{
- /**
- * This is the user SocketImplFactory for this class. If this variable is
- * null, a default factory is used.
- */
- static SocketImplFactory factory;
-
- /**
- * The implementation object to which calls are redirected
- */
- // package-private because ServerSocket.implAccept() needs to access it.
- SocketImpl impl;
-
- /**
- * True if socket implementation was created by calling their
- * create() method.
- */
- // package-private because ServerSocket.implAccept() needs to access it.
- boolean implCreated;
-
- /**
- * True if the socket is bound.
- */
- private boolean bound;
-
- /**
- * True if input is shutdown.
- */
- private boolean inputShutdown;
-
- /**
- * True if output is shutdown.
- */
- private boolean outputShutdown;
-
- /**
- * Initializes a new instance of <code>Socket</code> object without
- * connecting to a remote host. This useful for subclasses of socket that
- * might want this behavior.
- *
- * @specnote This constructor is public since JDK 1.4
- * @since 1.1
- */
- public Socket()
- {
- if (factory != null)
- impl = factory.createSocketImpl();
- else
- impl = new PlainSocketImpl();
- }
-
- /**
- * Initializes a new instance of <code>Socket</code> object without
- * connecting to a remote host. This is useful for subclasses of socket
- * that might want this behavior.
- * <p>
- * Additionally, this socket will be created using the supplied
- * implementation class instead the default class or one returned by a
- * factory. If this value is <code>null</code>, the default Socket
- * implementation is used.
- *
- * @param impl The <code>SocketImpl</code> to use for this
- * <code>Socket</code>
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.1
- */
- protected Socket(SocketImpl impl) throws SocketException
- {
- if (impl == null)
- this.impl = new PlainSocketImpl();
- else
- this.impl = impl;
- }
-
- /**
- * Initializes a new instance of <code>Socket</code> and connects to the
- * hostname and port specified as arguments.
- *
- * @param host The name of the host to connect to
- * @param port The port number to connect to
- *
- * @exception UnknownHostException If the hostname cannot be resolved to a
- * network address.
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkConnect method doesn't allow the operation
- */
- public Socket(String host, int port)
- throws UnknownHostException, IOException
- {
- this(InetAddress.getByName(host), port, null, 0, true);
- }
-
- /**
- * Initializes a new instance of <code>Socket</code> and connects to the
- * address and port number specified as arguments.
- *
- * @param address The address to connect to
- * @param port The port number to connect to
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkConnect method doesn't allow the operation
- */
- public Socket(InetAddress address, int port) throws IOException
- {
- this(address, port, null, 0, true);
- }
-
- /**
- * Initializes a new instance of <code>Socket</code> that connects to the
- * named host on the specified port and binds to the specified local address
- * and port.
- *
- * @param host The name of the remote host to connect to.
- * @param port The remote port to connect to.
- * @param localAddr The local address to bind to.
- * @param localPort The local port to bind to.
- *
- * @exception SecurityException If the <code>SecurityManager</code>
- * exists and does not allow a connection to the specified host/port or
- * binding to the specified local host/port.
- * @exception IOException If a connection error occurs.
- *
- * @since 1.1
- */
- public Socket(String host, int port, InetAddress localAddr, int localPort)
- throws IOException
- {
- this(InetAddress.getByName(host), port, localAddr, localPort, true);
- }
-
- /**
- * Initializes a new instance of <code>Socket</code> and connects to the
- * address and port number specified as arguments, plus binds to the
- * specified local address and port.
- *
- * @param address The remote address to connect to
- * @param port The remote port to connect to
- * @param localAddr The local address to connect to
- * @param localPort The local port to connect to
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkConnect method doesn't allow the operation
- *
- * @since 1.1
- */
- public Socket(InetAddress address, int port, InetAddress localAddr,
- int localPort) throws IOException
- {
- this(address, port, localAddr, localPort, true);
- }
-
- /**
- * Initializes a new instance of <code>Socket</code> and connects to the
- * hostname and port specified as arguments. If the stream argument is set
- * to <code>true</code>, then a stream socket is created. If it is
- * <code>false</code>, a datagram socket is created.
- *
- * @param host The name of the host to connect to
- * @param port The port to connect to
- * @param stream <code>true</code> for a stream socket, <code>false</code>
- * for a datagram socket
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkConnect method doesn't allow the operation
- *
- * @deprecated Use the <code>DatagramSocket</code> class to create
- * datagram oriented sockets.
- */
- public Socket(String host, int port, boolean stream)
- throws IOException
- {
- this(InetAddress.getByName(host), port, null, 0, stream);
- }
-
- /**
- * Initializes a new instance of <code>Socket</code> and connects to the
- * address and port number specified as arguments. If the stream param is
- * <code>true</code>, a stream socket will be created, otherwise a datagram
- * socket is created.
- *
- * @param host The address to connect to
- * @param port The port number to connect to
- * @param stream <code>true</code> to create a stream socket,
- * <code>false</code> to create a datagram socket.
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkConnect method doesn't allow the operation
- *
- * @deprecated Use the <code>DatagramSocket</code> class to create
- * datagram oriented sockets.
- */
- public Socket(InetAddress host, int port, boolean stream)
- throws IOException
- {
- this(host, port, null, 0, stream);
- }
-
- /**
- * This constructor is where the real work takes place. Connect to the
- * specified address and port. Use default local values if not specified,
- * otherwise use the local host and port passed in. Create as stream or
- * datagram based on "stream" argument.
- * <p>
- *
- * @param raddr The remote address to connect to
- * @param rport The remote port to connect to
- * @param laddr The local address to connect to
- * @param lport The local port to connect to
- * @param stream true for a stream socket, false for a datagram socket
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkConnect method doesn't allow the operation
- */
- private Socket(InetAddress raddr, int rport, InetAddress laddr, int lport,
- boolean stream) throws IOException
- {
- this();
-
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkConnect(raddr.getHostName(), rport);
-
- // bind socket
- SocketAddress bindaddr =
- laddr == null ? null : new InetSocketAddress(laddr, lport);
- bind(bindaddr);
-
- // connect socket
- connect(new InetSocketAddress(raddr, rport));
-
- // FIXME: JCL p. 1586 says if localPort is unspecified, bind to any port,
- // i.e. '0' and if localAddr is unspecified, use getLocalAddress() as
- // that default. JDK 1.2 doc infers not to do a bind.
- }
-
- private SocketImpl getImpl() throws SocketException
- {
- try
- {
- if (! implCreated)
- {
- impl.create(true);
- implCreated = true;
- }
- }
- catch (IOException e)
- {
- throw new SocketException(e.getMessage());
- }
-
- return impl;
- }
-
- /**
- * Binds the socket to the givent local address/port
- *
- * @param bindpoint The address/port to bind to
- *
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager exists and its
- * checkConnect method doesn't allow the operation
- * @exception IllegalArgumentException If the address type is not supported
- *
- * @since 1.4
- */
- public void bind(SocketAddress bindpoint) throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- // XXX: JDK 1.4.1 API documentation says that if bindpoint is null the
- // socket will be bound to an ephemeral port and a valid local address.
- if (bindpoint == null)
- bindpoint = new InetSocketAddress(InetAddress.ANY_IF, 0);
-
- if (! (bindpoint instanceof InetSocketAddress))
- throw new IllegalArgumentException();
-
- InetSocketAddress tmp = (InetSocketAddress) bindpoint;
-
- // bind to address/port
- try
- {
- getImpl().bind(tmp.getAddress(), tmp.getPort());
- bound = true;
- }
- catch (IOException exception)
- {
- close();
- throw exception;
- }
- catch (RuntimeException exception)
- {
- close();
- throw exception;
- }
- catch (Error error)
- {
- close();
- throw error;
- }
- }
-
- /**
- * Connects the socket with a remote address.
- *
- * @param endpoint The address to connect to
- *
- * @exception IOException If an error occurs
- * @exception IllegalArgumentException If the addess type is not supported
- * @exception IllegalBlockingModeException If this socket has an associated
- * channel, and the channel is in non-blocking mode
- *
- * @since 1.4
- */
- public void connect(SocketAddress endpoint) throws IOException
- {
- connect(endpoint, 0);
- }
-
- /**
- * Connects the socket with a remote address. A timeout of zero is
- * interpreted as an infinite timeout. The connection will then block
- * until established or an error occurs.
- *
- * @param endpoint The address to connect to
- * @param timeout The length of the timeout in milliseconds, or
- * 0 to indicate no timeout.
- *
- * @exception IOException If an error occurs
- * @exception IllegalArgumentException If the address type is not supported
- * @exception IllegalBlockingModeException If this socket has an associated
- * channel, and the channel is in non-blocking mode
- * @exception SocketTimeoutException If the timeout is reached
- *
- * @since 1.4
- */
- public void connect(SocketAddress endpoint, int timeout)
- throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (! (endpoint instanceof InetSocketAddress))
- throw new IllegalArgumentException("unsupported address type");
-
- // The Sun spec says that if we have an associated channel and
- // it is in non-blocking mode, we throw an IllegalBlockingModeException.
- // However, in our implementation if the channel itself initiated this
- // operation, then we must honor it regardless of its blocking mode.
- if (getChannel() != null && ! getChannel().isBlocking()
- && ! ((PlainSocketImpl) getImpl()).isInChannelOperation())
- throw new IllegalBlockingModeException();
-
- if (! isBound())
- bind(null);
-
- try
- {
- getImpl().connect(endpoint, timeout);
- }
- catch (IOException exception)
- {
- close();
- throw exception;
- }
- catch (RuntimeException exception)
- {
- close();
- throw exception;
- }
- catch (Error error)
- {
- close();
- throw error;
- }
- }
-
- /**
- * Returns the address of the remote end of the socket. If this socket
- * is not connected, then <code>null</code> is returned.
- *
- * @return The remote address this socket is connected to
- */
- public InetAddress getInetAddress()
- {
- if (! isConnected())
- return null;
-
- try
- {
- return getImpl().getInetAddress();
- }
- catch (SocketException e)
- {
- // This cannot happen as we are connected.
- }
-
- return null;
- }
-
- /**
- * Returns the local address to which this socket is bound. If this socket
- * is not connected, then a wildcard address, for which
- * @see isAnyLocalAddress() is <code>true</code>, is returned.
- *
- * @return The local address
- *
- * @since 1.1
- */
- public InetAddress getLocalAddress()
- {
- if (! isBound())
- return InetAddress.ANY_IF;
-
- InetAddress addr = null;
-
- try
- {
- addr = (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR);
- }
- catch (SocketException e)
- {
- // (hopefully) shouldn't happen
- // throw new java.lang.InternalError
- // ("Error in PlainSocketImpl.getOption");
- return null;
- }
-
- // FIXME: According to libgcj, checkConnect() is supposed to be called
- // before performing this operation. Problems: 1) We don't have the
- // addr until after we do it, so we do a post check. 2). The docs I
- // see don't require this in the Socket case, only DatagramSocket, but
- // we'll assume they mean both.
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkConnect(addr.getHostName(), getLocalPort());
-
- return addr;
- }
-
- /**
- * Returns the port number of the remote end of the socket connection. If
- * this socket is not connected, then 0 is returned.
- *
- * @return The remote port this socket is connected to
- */
- public int getPort()
- {
- if (! isConnected())
- return 0;
-
- try
- {
- return getImpl().getPort();
- }
- catch (SocketException e)
- {
- // This cannot happen as we are connected.
- }
-
- return 0;
- }
-
- /**
- * Returns the local port number to which this socket is bound. If this
- * socket is not connected, then -1 is returned.
- *
- * @return The local port
- */
- public int getLocalPort()
- {
- if (! isBound())
- return -1;
-
- try
- {
- if (getImpl() != null)
- return getImpl().getLocalPort();
- }
- catch (SocketException e)
- {
- // This cannot happen as we are bound.
- }
-
- return -1;
- }
-
- /**
- * Returns local socket address.
- *
- * @return the local socket address, null if not bound
- *
- * @since 1.4
- */
- public SocketAddress getLocalSocketAddress()
- {
- if (! isBound())
- return null;
-
- InetAddress addr = getLocalAddress();
-
- try
- {
- return new InetSocketAddress(addr, getImpl().getLocalPort());
- }
- catch (SocketException e)
- {
- // This cannot happen as we are bound.
- return null;
- }
- }
-
- /**
- * Returns the remote socket address.
- *
- * @return the remote socket address, null of not connected
- *
- * @since 1.4
- */
- public SocketAddress getRemoteSocketAddress()
- {
- if (! isConnected())
- return null;
-
- try
- {
- return new InetSocketAddress(getImpl().getInetAddress(),
- getImpl().getPort());
- }
- catch (SocketException e)
- {
- // This cannot happen as we are connected.
- return null;
- }
- }
-
- /**
- * Returns an InputStream for reading from this socket.
- *
- * @return The InputStream object
- *
- * @exception IOException If an error occurs or Socket is not connected
- */
- public InputStream getInputStream() throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (! isConnected())
- throw new IOException("not connected");
-
- return getImpl().getInputStream();
- }
-
- /**
- * Returns an OutputStream for writing to this socket.
- *
- * @return The OutputStream object
- *
- * @exception IOException If an error occurs or Socket is not connected
- */
- public OutputStream getOutputStream() throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (! isConnected())
- throw new IOException("not connected");
-
- return getImpl().getOutputStream();
- }
-
- /**
- * Sets the TCP_NODELAY option on the socket.
- *
- * @param on true to enable, false to disable
- *
- * @exception SocketException If an error occurs or Socket is not connected
- *
- * @since 1.1
- */
- public void setTcpNoDelay(boolean on) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().setOption(SocketOptions.TCP_NODELAY, Boolean.valueOf(on));
- }
-
- /**
- * Tests whether or not the TCP_NODELAY option is set on the socket.
- * Returns true if enabled, false if disabled. When on it disables the
- * Nagle algorithm which means that packets are always send immediatly and
- * never merged together to reduce network trafic.
- *
- * @return Whether or not TCP_NODELAY is set
- *
- * @exception SocketException If an error occurs or Socket not connected
- *
- * @since 1.1
- */
- public boolean getTcpNoDelay() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object on = getImpl().getOption(SocketOptions.TCP_NODELAY);
-
- if (on instanceof Boolean)
- return (((Boolean) on).booleanValue());
- else
- throw new SocketException("Internal Error");
- }
-
- /**
- * Sets the value of the SO_LINGER option on the socket. If the
- * SO_LINGER option is set on a socket and there is still data waiting to
- * be sent when the socket is closed, then the close operation will block
- * until either that data is delivered or until the timeout period
- * expires. The linger interval is specified in hundreths of a second
- * (platform specific?)
- *
- * @param on true to enable SO_LINGER, false to disable
- * @param linger The SO_LINGER timeout in hundreths of a second or -1 if
- * SO_LINGER not set.
- *
- * @exception SocketException If an error occurs or Socket not connected
- * @exception IllegalArgumentException If linger is negative
- *
- * @since 1.1
- */
- public void setSoLinger(boolean on, int linger) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (on)
- {
- if (linger < 0)
- throw new IllegalArgumentException("SO_LINGER must be >= 0");
-
- if (linger > 65535)
- linger = 65535;
-
- getImpl().setOption(SocketOptions.SO_LINGER, new Integer(linger));
- }
- else
- getImpl().setOption(SocketOptions.SO_LINGER, Boolean.valueOf(false));
- }
-
- /**
- * Returns the value of the SO_LINGER option on the socket. If the
- * SO_LINGER option is set on a socket and there is still data waiting to
- * be sent when the socket is closed, then the close operation will block
- * until either that data is delivered or until the timeout period
- * expires. This method either returns the timeouts (in hundredths of
- * of a second (platform specific?)) if SO_LINGER is set, or -1 if
- * SO_LINGER is not set.
- *
- * @return The SO_LINGER timeout in hundreths of a second or -1
- * if SO_LINGER not set
- *
- * @exception SocketException If an error occurs or Socket is not connected
- *
- * @since 1.1
- */
- public int getSoLinger() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object linger = getImpl().getOption(SocketOptions.SO_LINGER);
-
- if (linger instanceof Integer)
- return (((Integer) linger).intValue());
- else
- return -1;
- }
-
- /**
- * Sends urgent data through the socket
- *
- * @param data The data to send.
- * Only the lowest eight bits of data are sent
- *
- * @exception IOException If an error occurs
- *
- * @since 1.4
- */
- public void sendUrgentData(int data) throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().sendUrgentData(data);
- }
-
- /**
- * Enables/disables the SO_OOBINLINE option
- *
- * @param on True if SO_OOBLINE should be enabled
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public void setOOBInline(boolean on) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().setOption(SocketOptions.SO_OOBINLINE, Boolean.valueOf(on));
- }
-
- /**
- * Returns the current setting of the SO_OOBINLINE option for this socket
- *
- * @return True if SO_OOBINLINE is set, false otherwise.
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public boolean getOOBInline() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_OOBINLINE);
-
- if (buf instanceof Boolean)
- return (((Boolean) buf).booleanValue());
- else
- throw new SocketException("Internal Error: Unexpected type");
- }
-
- /**
- * Sets the value of the SO_TIMEOUT option on the socket. If this value
- * is set, and an read/write is performed that does not complete within
- * the timeout period, a short count is returned (or an EWOULDBLOCK signal
- * would be sent in Unix if no data had been read). A value of 0 for
- * this option implies that there is no timeout (ie, operations will
- * block forever). On systems that have separate read and write timeout
- * values, this method returns the read timeout. This
- * value is in milliseconds.
- *
- * @param timeout The length of the timeout in milliseconds, or
- * 0 to indicate no timeout.
- *
- * @exception SocketException If an error occurs or Socket not connected
- *
- * @since 1.1
- */
- public synchronized void setSoTimeout(int timeout) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (timeout < 0)
- throw new IllegalArgumentException("SO_TIMEOUT value must be >= 0");
-
- getImpl().setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout));
- }
-
- /**
- * Returns the value of the SO_TIMEOUT option on the socket. If this value
- * is set, and an read/write is performed that does not complete within
- * the timeout period, a short count is returned (or an EWOULDBLOCK signal
- * would be sent in Unix if no data had been read). A value of 0 for
- * this option implies that there is no timeout (ie, operations will
- * block forever). On systems that have separate read and write timeout
- * values, this method returns the read timeout. This
- * value is in thousandths of a second (implementation specific?).
- *
- * @return The length of the timeout in thousandth's of a second or 0
- * if not set
- *
- * @exception SocketException If an error occurs or Socket not connected
- *
- * @since 1.1
- */
- public synchronized int getSoTimeout() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object timeout = getImpl().getOption(SocketOptions.SO_TIMEOUT);
- if (timeout instanceof Integer)
- return (((Integer) timeout).intValue());
- else
- return 0;
- }
-
- /**
- * This method sets the value for the system level socket option
- * SO_SNDBUF to the specified value. Note that valid values for this
- * option are specific to a given operating system.
- *
- * @param size The new send buffer size.
- *
- * @exception SocketException If an error occurs or Socket not connected
- * @exception IllegalArgumentException If size is 0 or negative
- *
- * @since 1.2
- */
- public void setSendBufferSize(int size) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (size <= 0)
- throw new IllegalArgumentException("SO_SNDBUF value must be > 0");
-
- getImpl().setOption(SocketOptions.SO_SNDBUF, new Integer(size));
- }
-
- /**
- * This method returns the value of the system level socket option
- * SO_SNDBUF, which is used by the operating system to tune buffer
- * sizes for data transfers.
- *
- * @return The send buffer size.
- *
- * @exception SocketException If an error occurs or socket not connected
- *
- * @since 1.2
- */
- public int getSendBufferSize() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_SNDBUF);
-
- if (buf instanceof Integer)
- return (((Integer) buf).intValue());
- else
- throw new SocketException("Internal Error: Unexpected type");
- }
-
- /**
- * This method sets the value for the system level socket option
- * SO_RCVBUF to the specified value. Note that valid values for this
- * option are specific to a given operating system.
- *
- * @param size The new receive buffer size.
- *
- * @exception SocketException If an error occurs or Socket is not connected
- * @exception IllegalArgumentException If size is 0 or negative
- *
- * @since 1.2
- */
- public void setReceiveBufferSize(int size) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (size <= 0)
- throw new IllegalArgumentException("SO_RCVBUF value must be > 0");
-
- getImpl().setOption(SocketOptions.SO_RCVBUF, new Integer(size));
- }
-
- /**
- * This method returns the value of the system level socket option
- * SO_RCVBUF, which is used by the operating system to tune buffer
- * sizes for data transfers.
- *
- * @return The receive buffer size.
- *
- * @exception SocketException If an error occurs or Socket is not connected
- *
- * @since 1.2
- */
- public int getReceiveBufferSize() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_RCVBUF);
-
- if (buf instanceof Integer)
- return (((Integer) buf).intValue());
- else
- throw new SocketException("Internal Error: Unexpected type");
- }
-
- /**
- * This method sets the value for the socket level socket option
- * SO_KEEPALIVE.
- *
- * @param on True if SO_KEEPALIVE should be enabled
- *
- * @exception SocketException If an error occurs or Socket is not connected
- *
- * @since 1.3
- */
- public void setKeepAlive(boolean on) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().setOption(SocketOptions.SO_KEEPALIVE, Boolean.valueOf(on));
- }
-
- /**
- * This method returns the value of the socket level socket option
- * SO_KEEPALIVE.
- *
- * @return The setting
- *
- * @exception SocketException If an error occurs or Socket is not connected
- *
- * @since 1.3
- */
- public boolean getKeepAlive() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_KEEPALIVE);
-
- if (buf instanceof Boolean)
- return (((Boolean) buf).booleanValue());
- else
- throw new SocketException("Internal Error: Unexpected type");
- }
-
- /**
- * Closes the socket.
- *
- * @exception IOException If an error occurs
- */
- public synchronized void close() throws IOException
- {
- if (isClosed())
- return;
-
- getImpl().close();
- impl = null;
- bound = false;
-
- if (getChannel() != null)
- getChannel().close();
- }
-
- /**
- * Converts this <code>Socket</code> to a <code>String</code>.
- *
- * @return The <code>String</code> representation of this <code>Socket</code>
- */
- public String toString()
- {
- try
- {
- if (isConnected())
- return ("Socket[addr=" + getImpl().getInetAddress() + ",port="
- + getImpl().getPort() + ",localport="
- + getImpl().getLocalPort() + "]");
- }
- catch (SocketException e)
- {
- // This cannot happen as we are connected.
- }
-
- return "Socket[unconnected]";
- }
-
- /**
- * Sets the <code>SocketImplFactory</code>. This may be done only once per
- * virtual machine. Subsequent attempts will generate a
- * <code>SocketException</code>. Note that a <code>SecurityManager</code>
- * check is made prior to setting the factory. If
- * insufficient privileges exist to set the factory, then an
- * <code>IOException</code> will be thrown.
- *
- * @param fac the factory to set
- *
- * @exception SecurityException If the <code>SecurityManager</code> does
- * not allow this operation.
- * @exception SocketException If the SocketImplFactory is already defined
- * @exception IOException If any other error occurs
- */
- public static synchronized void setSocketImplFactory(SocketImplFactory fac)
- throws IOException
- {
- // See if already set
- if (factory != null)
- throw new SocketException("SocketImplFactory already defined");
-
- // Check permissions
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSetFactory();
-
- if (fac == null)
- throw new SocketException("SocketImplFactory cannot be null");
-
- factory = fac;
- }
-
- /**
- * Closes the input side of the socket stream.
- *
- * @exception IOException If an error occurs.
- *
- * @since 1.3
- */
- public void shutdownInput() throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().shutdownInput();
- inputShutdown = true;
- }
-
- /**
- * Closes the output side of the socket stream.
- *
- * @exception IOException If an error occurs.
- *
- * @since 1.3
- */
- public void shutdownOutput() throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().shutdownOutput();
- outputShutdown = true;
- }
-
- /**
- * Returns the socket channel associated with this socket.
- *
- * @return the associated socket channel,
- * null if no associated channel exists
- *
- * @since 1.4
- */
- public SocketChannel getChannel()
- {
- return null;
- }
-
- /**
- * Checks if the SO_REUSEADDR option is enabled
- *
- * @return True if SO_REUSEADDR is set, false otherwise.
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public boolean getReuseAddress() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object reuseaddr = getImpl().getOption(SocketOptions.SO_REUSEADDR);
-
- if (! (reuseaddr instanceof Boolean))
- throw new SocketException("Internal Error");
-
- return ((Boolean) reuseaddr).booleanValue();
- }
-
- /**
- * Enables/Disables the SO_REUSEADDR option
- *
- * @param reuseAddress true if SO_REUSEADDR should be enabled,
- * false otherwise
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public void setReuseAddress(boolean reuseAddress) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().setOption(SocketOptions.SO_REUSEADDR,
- Boolean.valueOf(reuseAddress));
- }
-
- /**
- * Returns the current traffic class
- *
- * @return The current traffic class.
- *
- * @exception SocketException If an error occurs
- *
- * @see Socket#setTrafficClass(int tc)
- *
- * @since 1.4
- */
- public int getTrafficClass() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object obj = getImpl().getOption(SocketOptions.IP_TOS);
-
- if (obj instanceof Integer)
- return ((Integer) obj).intValue();
- else
- throw new SocketException("Unexpected type");
- }
-
- /**
- * Sets the traffic class value
- *
- * @param tc The traffic class
- *
- * @exception SocketException If an error occurs
- * @exception IllegalArgumentException If tc value is illegal
- *
- * @see Socket#getTrafficClass()
- *
- * @since 1.4
- */
- public void setTrafficClass(int tc) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (tc < 0 || tc > 255)
- throw new IllegalArgumentException();
-
- getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc));
- }
-
- /**
- * Checks if the socket is connected
- *
- * @return True if socket is connected, false otherwise.
- *
- * @since 1.4
- */
- public boolean isConnected()
- {
- try
- {
- if (getImpl() == null)
- return false;
-
- return getImpl().getInetAddress() != null;
- }
- catch (SocketException e)
- {
- return false;
- }
- }
-
- /**
- * Checks if the socket is already bound.
- *
- * @return True if socket is bound, false otherwise.
- *
- * @since 1.4
- */
- public boolean isBound()
- {
- return bound;
- }
-
- /**
- * Checks if the socket is closed.
- *
- * @return True if socket is closed, false otherwise.
- *
- * @since 1.4
- */
- public boolean isClosed()
- {
- return impl == null;
- }
-
- /**
- * Checks if the socket's input stream is shutdown
- *
- * @return True if input is shut down.
- *
- * @since 1.4
- */
- public boolean isInputShutdown()
- {
- return inputShutdown;
- }
-
- /**
- * Checks if the socket's output stream is shutdown
- *
- * @return True if output is shut down.
- *
- * @since 1.4
- */
- public boolean isOutputShutdown()
- {
- return outputShutdown;
- }
-}
diff --git a/libjava/java/net/SocketAddress.java b/libjava/java/net/SocketAddress.java
deleted file mode 100644
index 48ab010097f..00000000000
--- a/libjava/java/net/SocketAddress.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* SocketAddress.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.Serializable;
-
-
-/**
- * Abstract base class for InetSocketAddress.
- * InetSocketAddress is to my knowledge the only derived
- * class. [Ronald]
- *
- * @since 1.4
- */
-public abstract class SocketAddress implements Serializable
-{
- /**
- * Compatible with JDK 1.4+
- */
- static final long serialVersionUID = 5215720748342549866L;
-
- /**
- * Initializes the socket address.
- */
- public SocketAddress()
- {
- }
-}
diff --git a/libjava/java/net/SocketException.java b/libjava/java/net/SocketException.java
deleted file mode 100644
index 37b2f6fba43..00000000000
--- a/libjava/java/net/SocketException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* SocketException.java -- An exception occurred while performing a socket op
- Copyright (C) 1998, 1999, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.IOException;
-
-
-/**
- * This exception indicates that a generic error occurred related to an
- * operation on a socket. Check the descriptive message (if any) for
- * details on the nature of this error
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner
- * @status updated to 1.4
- */
-public class SocketException extends IOException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -5935874303556886934L;
-
- /**
- * Create a new instance without a descriptive error message.
- */
- public SocketException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param message a message describing the error that occurred
- */
- public SocketException(String message)
- {
- super(message);
- }
-} // class SocketException
diff --git a/libjava/java/net/SocketImpl.java b/libjava/java/net/SocketImpl.java
deleted file mode 100644
index 77f470be332..00000000000
--- a/libjava/java/net/SocketImpl.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/* SocketImpl.java -- Abstract socket implementation class
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.FileDescriptor;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-
-/* Written using on-line Java Platform 1.2 API Specification.
- * Believed complete and correct.
- */
-
-/**
- * This abstract class serves as the parent class for socket implementations.
- * The implementation class serves an intermediary to native routines that
- * perform system specific socket operations.
- * <p>
- * A default implementation is provided by the system, but this can be
- * changed via installing a <code>SocketImplFactory</code> (through a call
- * to the static method <code>Socket.setSocketImplFactory</code>). A
- * subclass of <code>Socket</code> can also pass in a <code>SocketImpl</code>
- * to the <code>Socket(SocketImpl)</code> constructor to use an
- * implementation different from the system default without installing
- * a factory.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner (bothner@cygnus.com)
- */
-public abstract class SocketImpl implements SocketOptions
-{
- /**
- * The address of the remote end of the socket connection
- */
- protected InetAddress address;
-
- /**
- * A FileDescriptor object representing this socket connection.
- */
- protected FileDescriptor fd;
-
- /**
- * The port number the socket is bound to locally
- */
- protected int localport = -1;
-
- /**
- * The port number of the remote end of the socket connection
- */
- protected int port;
-
- /**
- * Default, no-argument constructor for use by subclasses.
- */
- public SocketImpl()
- {
- }
-
- /**
- * Creates a new socket that is not bound to any local address/port and
- * is not connected to any remote address/port. This will be created as
- * a stream socket if the stream parameter is true, or a datagram socket
- * if the stream parameter is false.
- *
- * @param stream true for a stream socket, false for a datagram socket
- *
- * @exception IOException If an error occurs
- */
- protected abstract void create(boolean stream) throws IOException;
-
- /**
- * Connects to the remote hostname and port specified as arguments.
- *
- * @param host The remote hostname to connect to
- * @param port The remote port to connect to
- *
- * @exception IOException If an error occurs
- */
- protected abstract void connect(String host, int port)
- throws IOException;
-
- /**
- * Connects to the remote address and port specified as arguments.
- *
- * @param host The remote address to connect to
- * @param port The remote port to connect to
- *
- * @exception IOException If an error occurs
- */
- protected abstract void connect(InetAddress host, int port)
- throws IOException;
-
- /**
- * Connects to the socket to the host specified in address. This
- * method blocks until successful connected or the timeout occurs.
- * A timeout of zero means no timout.
- *
- * @param address Data of remote host
- * @param timeout time to wait to stop connecting
- *
- * @exception IOException If an error occurs
- *
- * @since 1.4
- */
- protected abstract void connect(SocketAddress address, int timeout)
- throws IOException;
-
- /**
- * Binds to the specified port on the specified addr. Note that this addr
- * must represent a local IP address.
- * <p>
- * Note that it is unspecified how to bind to all interfaces on the localhost
- * (INADDR_ANY).
- *
- * @param host The address to bind to
- * @param port The port number to bind to
- *
- * @exception IOException If an error occurs
- */
- protected abstract void bind(InetAddress host, int port)
- throws IOException;
-
- /**
- * Starts listening for connections on a socket. The backlog parameter
- * is how many pending connections will queue up waiting to be serviced
- * before being accept'ed. If the queue of pending requests exceeds this
- * number, additional connections will be refused.
- *
- * @param backlog The length of the pending connection queue
- *
- * @exception IOException If an error occurs
- */
- protected abstract void listen(int backlog) throws IOException;
-
- /**
- * Accepts a connection on this socket.
- *
- * @param s The implementation object for the accepted connection.
- *
- * @exception IOException If an error occurs
- */
- protected abstract void accept(SocketImpl s) throws IOException;
-
- /**
- * Returns an <code>InputStream</code> object for reading from this socket.
- *
- * @return An <code>InputStream</code> for reading from this socket.
- *
- * @exception IOException If an error occurs
- */
- protected abstract InputStream getInputStream() throws IOException;
-
- /**
- * Returns an <code>OutputStream</code> object for writing to this socket
- *
- * @return An <code>OutputStream</code> for writing to this socket.
- *
- * @exception IOException If an error occurs.
- */
- protected abstract OutputStream getOutputStream() throws IOException;
-
- /**
- * Returns the number of bytes that the caller can read from this socket
- * without blocking.
- *
- * @return The number of readable bytes before blocking
- *
- * @exception IOException If an error occurs
- */
- protected abstract int available() throws IOException;
-
- /**
- * Closes the socket. This will normally cause any resources, such as the
- * InputStream, OutputStream and associated file descriptors to be freed.
- * <p>
- * Note that if the SO_LINGER option is set on this socket, then the
- * operation could block.
- *
- * @exception IOException If an error occurs
- */
- protected abstract void close() throws IOException;
-
- /**
- * Returns the FileDescriptor objects for this socket.
- *
- * @return A FileDescriptor for this socket.
- */
- protected FileDescriptor getFileDescriptor()
- {
- return fd;
- }
-
- /**
- * Returns the remote address this socket is connected to
- *
- * @return The remote address
- */
- protected InetAddress getInetAddress()
- {
- return address;
- }
-
- /**
- * Returns the remote port this socket is connected to
- *
- * @return The remote port
- */
- protected int getPort()
- {
- return port;
- }
-
- /**
- * Returns true or false when this socket supports sending urgent data
- * or not.
- *
- * @return true if the socket implementation supports sending urgent data,
- * false otherwise
- *
- * @since 1.4
- */
- protected boolean supportsUrgentData()
- {
- // This method has to be overwritten by socket classes that support
- // sending urgend data.
- return false;
- }
-
- /**
- * Sends one byte of urgent data to the socket.
- *
- * @param data The byte to send, the low eight bits of it
- *
- * @exception IOException If an error occurs
- *
- * @since 1.4
- */
- protected abstract void sendUrgentData(int data) throws IOException;
-
- /**
- * Returns the local port this socket is bound to
- *
- * @return The local port
- */
- protected int getLocalPort()
- {
- return localport;
- }
-
- /**
- * Returns a <code>String</code> representing the remote host and port of
- * this socket.
- *
- * @return A <code>String</code> for this socket.
- */
- public String toString()
- {
- return "[addr="
- + ((address == null) ? "0.0.0.0/0.0.0.0" : address.toString())
- + ",port=" + port + ",localport=" + localport + "]";
- }
-
- /**
- * Shut down the input side of this socket. Subsequent reads will
- * return end-of-file.
- *
- * @exception IOException if an error occurs
- */
- protected void shutdownInput() throws IOException
- {
- throw new IOException("Not implemented in this socket class");
- }
-
- /**
- * Shut down the output side of this socket. Subsequent writes will
- * fail with an IOException.
- *
- * @exception IOException if an error occurs
- */
- protected void shutdownOutput() throws IOException
- {
- throw new IOException("Not implemented in this socket class");
- }
-}
diff --git a/libjava/java/net/SocketImplFactory.java b/libjava/java/net/SocketImplFactory.java
deleted file mode 100644
index b7cb10ca65f..00000000000
--- a/libjava/java/net/SocketImplFactory.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* SocketImplFactory.java -- Interface to create a SocketImpl object
- Copyright (C) 1998, 1999, 2000, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/** Written using on-line Java Platform 1.2 API Specification.
- * Status: Believed complete and correct.
- */
-/**
- * This interface defines one method which returns a <code>SocketImpl</code>
- * object. This should not be needed by ordinary applications.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner (bothner@cygnus.com)
- */
-public interface SocketImplFactory
-{
- /**
- * This method returns an instance of the <code>SocketImpl</code> object
- *
- * @return A <code>SocketImpl</code> object
- */
- SocketImpl createSocketImpl();
-} // interface SocketImplFactory
diff --git a/libjava/java/net/SocketOptions.java b/libjava/java/net/SocketOptions.java
deleted file mode 100644
index 659bf750c3b..00000000000
--- a/libjava/java/net/SocketOptions.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/* SocketOptions.java -- Implements options for sockets (duh!)
- Copyright (C) 1998, 1999, 2000, 2001,
- 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * Written using on-line Java Platform 1.2 API Specification.
- * Status: Believed complete and correct.
- */
-/**
- * This interface is used by <code>SocketImpl</code> and
- * <code>DatagramSocketImpl</code> to implement options
- * on sockets.
- *
- * @since 1.2
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @status should be completely JDK 1.4 compatible
- */
-public interface SocketOptions
-{
- /**
- * Option id for the SO_KEEPALIVE value
- * @since 1.3
- */
- int SO_KEEPALIVE = 0x8;
-
- /**
- * Option id for the SO_LINGER value
- */
- int SO_LINGER = 0x80; // 128
-
- /**
- * Option id for the SO_TIMEOUT value
- */
- int SO_TIMEOUT = 0x1006; // 4102
-
- /**
- * Retrieve the local address to which the socket is bound.
- */
- int SO_BINDADDR = 0x0F; // 15
-
- /**
- * Option id for the send buffer size
- * @since 1.2
- */
- int SO_SNDBUF = 0x1001; // 4097
-
- /**
- * Option id for the receive buffer size
- * @since 1.2
- */
- int SO_RCVBUF = 0x1002; // 4098
-
- /**
- * Sets the SO_REUSEADDR parameter on a socket
- */
- int SO_REUSEADDR = 0x04; // 4
-
- /**
- * Sets SO_BROADCAST for a socket
- * @since 1.4
- */
- int SO_BROADCAST = 0x20; // 32
-
- /**
- * Sets SO_OOBINLINE for a socket
- * @since 1.4
- */
- int SO_OOBINLINE = 0x1003; // 4099
-
- /**
- * Option id for the TCP_NODELAY value
- */
- int TCP_NODELAY = 0x01; // 1
-
- /**
- * Options id for the IP_MULTICAST_IF value
- */
- int IP_MULTICAST_IF = 0x10; // 16
-
- /**
- * same as above
- * @since 1.4
- */
- int IP_MULTICAST_IF2 = 0x1F; // 31
-
- /**
- * This option enables or disables local loopback of multicast datagrams.
- * @since 1.4
- */
- int IP_MULTICAST_LOOP = 0x12; // 18
-
- /**
- * This option sets the type-of-service or traffic class field in the
- * IP header for a TCP or UDP socket.
- * @since 1.4
- */
- int IP_TOS = 0x03; // 3
-
- /**
- * Sets the specified option on a socket to the passed in object. For
- * options that take an integer argument, the passed in object is an
- * <code>Integer</code>. For options that are set to on or off, the
- * value passed will be a <code>Boolean</code>. The <code>optionId</code>
- * parameter is one of the defined constants in this interface.
- *
- * @param optionId The identifier of the option
- * @param val The value to set the option to
- *
- * @exception SocketException If an error occurs
- */
- void setOption(int optionId, Object val) throws SocketException;
-
- /**
- * Returns the current setting of the specified option. The
- * <code>Object</code> returned will be an <code>Integer</code> for options
- * that have integer values. For options that are set to on or off, a
- * <code>Boolean</code> will be returned. The <code>optionId</code>
- * parameter is one of the defined constants in this interface.
- *
- * @param optionId The option identifier
- *
- * @return The current value of the option
- *
- * @exception SocketException If an error occurs
- */
- Object getOption(int optionId) throws SocketException;
-} // interface SocketOptions
diff --git a/libjava/java/net/SocketPermission.java b/libjava/java/net/SocketPermission.java
deleted file mode 100644
index 8ccd01baec5..00000000000
--- a/libjava/java/net/SocketPermission.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/* SocketPermission.java -- Class modeling permissions for socket operations
- Copyright (C) 1998, 2000, 2001, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.Serializable;
-import java.security.Permission;
-import java.security.PermissionCollection;
-
-
-/**
- * This class models a specific set of permssions for connecting to a
- * host. There are two elements to this, the host/port combination and
- * the permission list.
- * <p>
- * The host/port combination is specified as followed
- * <p>
- * <pre>
- * hostname[:[-]port[-[port]]]
- * </pre>
- * <p>
- * The hostname portion can be either a hostname or IP address. If it is
- * a hostname, a wildcard is allowed in hostnames. This wildcard is a "*"
- * and matches one or more characters. Only one "*" may appear in the
- * host and it must be the leftmost character. For example,
- * "*.urbanophile.com" matches all hosts in the "urbanophile.com" domain.
- * <p>
- * The port portion can be either a single value, or a range of values
- * treated as inclusive. The first or the last port value in the range
- * can be omitted in which case either the minimum or maximum legal
- * value for a port (respectively) is used by default. Here are some
- * examples:
- * <p><ul>
- * <li>8080 - Represents port 8080 only</li>
- * <li>2000-3000 - Represents ports 2000 through 3000 inclusive</li>
- * <li>-4000 - Represents ports 0 through 4000 inclusive</li>
- * <li>1024- - Represents ports 1024 through 65535 inclusive</li>
- * </ul><p>
- * The permission list is a comma separated list of individual permissions.
- * These individual permissions are:
- * <p>
- * <pre>
- * accept
- * connect
- * listen
- * resolve
- * </pre>
- * <p>
- * The "listen" permission is only relevant if the host is localhost. If
- * any permission at all is specified, then resolve permission is implied to
- * exist.
- * <p>
- * Here are a variety of examples of how to create SocketPermission's
- * <p><pre>
- * SocketPermission("www.urbanophile.com", "connect");
- * Can connect to any port on www.urbanophile.com
- * SocketPermission("www.urbanophile.com:80", "connect,accept");
- * Can connect to or accept connections from www.urbanophile.com on port 80
- * SocketPermission("localhost:1024-", "listen,accept,connect");
- * Can connect to, accept from, an listen on any local port number 1024
- * and up.
- * SocketPermission("*.edu", "connect");
- * Can connect to any host in the edu domain
- * SocketPermission("197.197.20.1", "accept");
- * Can accept connections from 197.197.20.1
- * </pre><p>
- *
- * This class also supports IPv6 addresses. These should be specified
- * in either RFC 2732 format or in full uncompressed form.
- *
- * @since 1.2
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public final class SocketPermission extends Permission implements Serializable
-{
- static final long serialVersionUID = -7204263841984476862L;
-
-// FIXME: Needs serialization work, including readObject/writeObject methods.
-
- /**
- * A hostname/port combination as described above
- */
- private transient String hostport;
-
- /**
- * A comma separated list of actions for which we have permission
- */
- private String actions;
-
- /**
- * Initializes a new instance of <code>SocketPermission</code> with the
- * specified host/port combination and actions string.
- *
- * @param hostport The hostname/port number combination
- * @param actions The actions string
- */
- public SocketPermission(String hostport, String actions)
- {
- super(hostport);
-
- this.hostport = hostport;
- this.actions = actions;
- }
-
- /**
- * Tests this object for equality against another. This will be true if
- * and only if the passed object is an instance of
- * <code>SocketPermission</code> and both its hostname/port combination
- * and permissions string are identical.
- *
- * @param obj The object to test against for equality
- *
- * @return <code>true</code> if object is equal to this object,
- * <code>false</code> otherwise.
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof SocketPermission))
- return false;
-
- if (((SocketPermission) obj).hostport.equals(hostport))
- if (((SocketPermission) obj).actions.equals(actions))
- return true;
-
- return false;
- }
-
- /**
- * Returns a hash code value for this object. Overrides the
- * <code>Permission.hashCode()</code>.
- *
- * @return A hash code
- */
- public int hashCode()
- {
- int hash = 100;
- if (hostport != null)
- hash += hostport.hashCode();
- if (actions != null)
- hash += actions.hashCode();
- return hash;
- }
-
- /**
- * Returns the list of permission actions in this object in canonical
- * order. The canonical order is "connect,listen,accept,resolve"
- *
- * @return The permitted action string.
- */
- public String getActions()
- {
- boolean found = false;
- StringBuffer sb = new StringBuffer("");
-
- if (actions.indexOf("connect") != -1)
- {
- sb.append("connect");
- found = true;
- }
-
- if (actions.indexOf("listen") != -1)
- if (found)
- sb.append(",listen");
- else
- {
- sb.append("listen");
- found = true;
- }
-
- if (actions.indexOf("accept") != -1)
- if (found)
- sb.append(",accept");
- else
- {
- sb.append("accept");
- found = true;
- }
-
- if (found)
- sb.append(",resolve");
- else if (actions.indexOf("resolve") != -1)
- sb.append("resolve");
-
- return sb.toString();
- }
-
- /**
- * Returns a new <code>PermissionCollection</code> object that can hold
- * <code>SocketPermission</code>'s.
- *
- * @return A new <code>PermissionCollection</code>.
- */
- public PermissionCollection newPermissionCollection()
- {
- // FIXME: Implement
-
- return null;
- }
-
- /**
- * Returns true if the permission object passed it is implied by the
- * this permission. This will be true if:
- *
- * <ul>
- * <li>The argument is of type <code>SocketPermission</code></li>
- * <li>The actions list of the argument are in this object's actions</li>
- * <li>The port range of the argument is within this objects port range</li>
- * <li>The hostname is equal to or a subset of this objects hostname</li>
- * </ul>
- *
- * <p>The argument's hostname will be a subset of this object's hostname if:</p>
- *
- * <ul>
- * <li>The argument's hostname or IP address is equal to this object's.</li>
- * <li>The argument's canonical hostname is equal to this object's.</li>
- * <li>The argument's canonical name matches this domains hostname with
- * wildcards</li>
- * </ul>
- *
- * @param perm The <code>Permission</code> to check against
- *
- * @return <code>true</code> if the <code>Permission</code> is implied by
- * this object, <code>false</code> otherwise.
- */
- public boolean implies(Permission perm)
- {
- SocketPermission p;
-
- // First make sure we are the right object type
- if (perm instanceof SocketPermission)
- p = (SocketPermission) perm;
- else
- return false;
-
- // Next check the actions
- String ourlist = getActions();
- String theirlist = p.getActions();
-
- if (! ourlist.startsWith(theirlist))
- return false;
-
- // Now check ports
- int ourfirstport = 0;
-
- // Now check ports
- int ourlastport = 0;
-
- // Now check ports
- int theirfirstport = 0;
-
- // Now check ports
- int theirlastport = 0;
-
- // Get ours
- if (hostport.indexOf(":") == -1)
- {
- ourfirstport = 0;
- ourlastport = 65535;
- }
- else
- {
- // FIXME: Needs bulletproofing.
- // This will dump if hostport if all sorts of bad data was passed to
- // the constructor
- String range = hostport.substring(hostport.indexOf(":") + 1);
- if (range.startsWith("-"))
- ourfirstport = 0;
- else if (range.indexOf("-") == -1)
- ourfirstport = Integer.parseInt(range);
- else
- ourfirstport =
- Integer.parseInt(range.substring(0, range.indexOf("-")));
-
- if (range.endsWith("-"))
- ourlastport = 65535;
- else if (range.indexOf("-") == -1)
- ourlastport = Integer.parseInt(range);
- else
- ourlastport =
- Integer.parseInt(range.substring(range.indexOf("-") + 1,
- range.length()));
- }
-
- // Get theirs
- if (p.hostport.indexOf(":") == -1)
- {
- theirfirstport = 0;
- ourlastport = 65535;
- }
- else
- {
- // This will dump if hostport if all sorts of bad data was passed to
- // the constructor
- String range = p.hostport.substring(hostport.indexOf(":") + 1);
- if (range.startsWith("-"))
- theirfirstport = 0;
- else if (range.indexOf("-") == -1)
- theirfirstport = Integer.parseInt(range);
- else
- theirfirstport =
- Integer.parseInt(range.substring(0, range.indexOf("-")));
-
- if (range.endsWith("-"))
- theirlastport = 65535;
- else if (range.indexOf("-") == -1)
- theirlastport = Integer.parseInt(range);
- else
- theirlastport =
- Integer.parseInt(range.substring(range.indexOf("-") + 1,
- range.length()));
- }
-
- // Now check them
- if ((theirfirstport < ourfirstport) || (theirlastport > ourlastport))
- return false;
-
- // Finally we can check the hosts
- String ourhost;
-
- // Finally we can check the hosts
- String theirhost;
-
- // Get ours
- if (hostport.indexOf(":") == -1)
- ourhost = hostport;
- else
- ourhost = hostport.substring(0, hostport.indexOf(":"));
-
- // Get theirs
- if (p.hostport.indexOf(":") == -1)
- theirhost = p.hostport;
- else
- theirhost = p.hostport.substring(0, p.hostport.indexOf(":"));
-
- // Are they equal?
- if (ourhost.equals(theirhost))
- return true;
-
- // Try the canonical names
- String ourcanonical = null;
-
- // Try the canonical names
- String theircanonical = null;
- try
- {
- ourcanonical = InetAddress.getByName(ourhost).getHostName();
- theircanonical = InetAddress.getByName(theirhost).getHostName();
- }
- catch (UnknownHostException e)
- {
- // Who didn't resolve? Just assume current address is canonical enough
- // Is this ok to do?
- if (ourcanonical == null)
- ourcanonical = ourhost;
- if (theircanonical == null)
- theircanonical = theirhost;
- }
-
- if (ourcanonical.equals(theircanonical))
- return true;
-
- // Well, last chance. Try for a wildcard
- if (ourhost.indexOf("*.") != -1)
- {
- String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1));
- if (theircanonical.endsWith(wild_domain))
- return true;
- }
-
- // Didn't make it
- return false;
- }
-}
diff --git a/libjava/java/net/SocketTimeoutException.java b/libjava/java/net/SocketTimeoutException.java
deleted file mode 100644
index 21b0dcd86c2..00000000000
--- a/libjava/java/net/SocketTimeoutException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* SocketTimeoutException.java -- the socket timed out
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.InterruptedIOException;
-
-
-/**
- * This exception signals that a socket read or accept timed out.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status updated to 1.4
- */
-public class SocketTimeoutException extends InterruptedIOException
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = -8846654841826352300L;
-
- /**
- * Create a new instance without a descriptive error message.
- */
- public SocketTimeoutException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param message a message describing the error that occurred
- */
- public SocketTimeoutException(String message)
- {
- super(message);
- }
-} // class SocketTimeoutException
diff --git a/libjava/java/net/URI.java b/libjava/java/net/URI.java
deleted file mode 100644
index 75c2ec97336..00000000000
--- a/libjava/java/net/URI.java
+++ /dev/null
@@ -1,893 +0,0 @@
-/* URI.java -- An URI class
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * <p>
- * A URI instance represents that defined by
- * <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC2396</a>,
- * with some deviations.
- * </p>
- * <p>
- * At its highest level, a URI consists of:
- * </p>
- * <code>[<em>scheme</em><strong>:</strong>]<em>scheme-specific-part</em>
- * [<strong>#</strong><em>fragment</em>]</code>
- * </p>
- * <p>
- * where <strong>#</strong> and <strong>:</strong> are literal characters,
- * and those parts enclosed in square brackets are optional.
- * </p>
- * <p>
- * There are two main types of URI. An <em>opaque</em> URI is one
- * which just consists of the above three parts, and is not further
- * defined. An example of such a URI would be <em>mailto:</em> URI.
- * In contrast, <em>hierarchical</em> URIs give further definition
- * to the scheme-specific part, so as represent some part of a hierarchical
- * structure.
- * </p>
- * <p>
- * <code>[<strong>//</strong><em>authority</em>][<em>path</em>]
- * [<strong>?</strong><em>query</em>]</code>
- * </p>
- * <p>
- * with <strong>/</strong> and <strong>?</strong> being literal characters.
- * When server-based, the authority section is further subdivided into:
- * </p>
- * <p>
- * <code>[<em>user-info</em><strong>@</strong>]<em>host</em>
- * [<strong>:</strong><em>port</em>]</code>
- * </p>
- * <p>
- * with <strong>@</strong> and <strong>:</strong> as literal characters.
- * Authority sections that are not server-based are said to be registry-based.
- * </p>
- * <p>
- * Hierarchical URIs can be either relative or absolute. Absolute URIs
- * always start with a `<strong>/</strong>', while relative URIs don't
- * specify a scheme. Opaque URIs are always absolute.
- * </p>
- * <p>
- * Each part of the URI may have one of three states: undefined, empty
- * or containing some content. The former two of these are represented
- * by <code>null</code> and the empty string in Java, respectively.
- * The scheme-specific part may never be undefined. It also follows from
- * this that the path sub-part may also not be undefined, so as to ensure
- * the former.
- * </p>
- *
- * @author Ito Kazumitsu (ito.kazumitsu@hitachi-cable.co.jp)
- * @author Dalibor Topic (robilad@kaffe.org)
- * @author Michael Koch (konqueror@gmx.de)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.4
- */
-public final class URI
- implements Comparable, Serializable
-{
- static final long serialVersionUID = -6052424284110960213L;
-
- /**
- * Regular expression for parsing URIs.
- *
- * Taken from RFC 2396, Appendix B.
- * This expression doesn't parse IPv6 addresses.
- */
- private static final String URI_REGEXP =
- "^(([^:/?#]+):)?((//([^/?#]*))?([^?#]*)(\\?([^#]*))?)?(#(.*))?";
-
- private static final String AUTHORITY_REGEXP =
- "(([^?#]*)@)?([^?#:]*)(:([^?#]*))?";
-
- /**
- * Valid characters (taken from rfc2396)
- */
- private static final String RFC2396_DIGIT = "0123456789";
- private static final String RFC2396_LOWALPHA = "abcdefghijklmnopqrstuvwxyz";
- private static final String RFC2396_UPALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- private static final String RFC2396_ALPHA =
- RFC2396_LOWALPHA + RFC2396_UPALPHA;
- private static final String RFC2396_ALPHANUM = RFC2396_DIGIT + RFC2396_ALPHA;
- private static final String RFC2396_MARK = "-_.!~*'()";
- private static final String RFC2396_UNRESERVED =
- RFC2396_ALPHANUM + RFC2396_MARK;
- private static final String RFC2396_REG_NAME =
- RFC2396_UNRESERVED + "$,;:@&=+";
- private static final String RFC2396_PCHAR = RFC2396_UNRESERVED + ":@&=+$,";
- private static final String RFC2396_SEGMENT = RFC2396_PCHAR + ";";
- private static final String RFC2396_PATH_SEGMENTS = RFC2396_SEGMENT + "/";
-
- /**
- * Index of scheme component in parsed URI.
- */
- private static final int SCHEME_GROUP = 2;
-
- /**
- * Index of scheme-specific-part in parsed URI.
- */
- private static final int SCHEME_SPEC_PART_GROUP = 3;
-
- /**
- * Index of authority component in parsed URI.
- */
- private static final int AUTHORITY_GROUP = 5;
-
- /**
- * Index of path component in parsed URI.
- */
- private static final int PATH_GROUP = 6;
-
- /**
- * Index of query component in parsed URI.
- */
- private static final int QUERY_GROUP = 8;
-
- /**
- * Index of fragment component in parsed URI.
- */
- 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 = 5;
-
- private transient String scheme;
- private transient String rawSchemeSpecificPart;
- private transient String schemeSpecificPart;
- private transient String rawAuthority;
- private transient String authority;
- private transient String rawUserInfo;
- private transient String userInfo;
- private transient String rawHost;
- private transient String host;
- private transient int port = -1;
- private transient String rawPath;
- private transient String path;
- private transient String rawQuery;
- private transient String query;
- private transient String rawFragment;
- private transient String fragment;
- private String string;
-
- private void readObject(ObjectInputStream is)
- throws ClassNotFoundException, IOException
- {
- this.string = (String) is.readObject();
- try
- {
- parseURI(this.string);
- }
- catch (URISyntaxException x)
- {
- // Should not happen.
- throw new RuntimeException(x);
- }
- }
-
- private void writeObject(ObjectOutputStream os) throws IOException
- {
- if (string == null)
- string = toString();
- os.writeObject(string);
- }
-
- private static String getURIGroup(Matcher match, int group)
- {
- String matched = match.group(group);
- return matched.length() == 0 ? null : matched;
- }
-
- /**
- * Sets fields of this URI by parsing the given string.
- *
- * @param str The string to parse
- *
- * @exception URISyntaxException If the given string violates RFC 2396
- */
- private void parseURI(String str) throws URISyntaxException
- {
- Pattern pattern = Pattern.compile(URI_REGEXP);
- Matcher matcher = pattern.matcher(str);
-
- if (matcher.matches())
- {
- scheme = getURIGroup(matcher, SCHEME_GROUP);
- rawSchemeSpecificPart = matcher.group(SCHEME_SPEC_PART_GROUP);
- schemeSpecificPart = unquote(rawSchemeSpecificPart);
- if (!isOpaque())
- {
- rawAuthority = getURIGroup(matcher, AUTHORITY_GROUP);
- rawPath = matcher.group(PATH_GROUP);
- rawQuery = getURIGroup(matcher, QUERY_GROUP);
- }
- rawFragment = getURIGroup(matcher, FRAGMENT_GROUP);
- }
- else
- throw new URISyntaxException(str, "doesn't match URI regular expression");
-
- if (rawAuthority != null)
- {
- pattern = Pattern.compile(AUTHORITY_REGEXP);
- matcher = pattern.matcher(rawAuthority);
-
- if (matcher.matches())
- {
- rawUserInfo = getURIGroup(matcher, AUTHORITY_USERINFO_GROUP);
- rawHost = getURIGroup(matcher, AUTHORITY_HOST_GROUP);
-
- String portStr = getURIGroup(matcher, AUTHORITY_PORT_GROUP);
-
- if (portStr != null)
- try
- {
- port = Integer.parseInt(portStr);
- }
- catch (NumberFormatException e)
- {
- URISyntaxException use =
- new URISyntaxException
- (str, "doesn't match URI regular expression");
- use.initCause(e);
- throw use;
- }
- }
- else
- throw new URISyntaxException(str, "doesn't match URI regular expression");
- }
-
- // We must eagerly unquote the parts, because this is the only time
- // we may throw an exception.
- authority = unquote(rawAuthority);
- userInfo = unquote(rawUserInfo);
- host = unquote(rawHost);
- path = unquote(rawPath);
- query = unquote(rawQuery);
- fragment = unquote(rawFragment);
- }
-
- /**
- * Unquote "%" + hex quotes characters
- *
- * @param str The string to unquote or null.
- *
- * @return The unquoted string or null if str was null.
- *
- * @exception URISyntaxException If the given string contains invalid
- * escape sequences.
- */
- private static String unquote(String str) throws URISyntaxException
- {
- if (str == null)
- return null;
- byte[] buf = new byte[str.length()];
- int pos = 0;
- for (int i = 0; i < str.length(); i++)
- {
- char c = str.charAt(i);
- if (c > 127)
- throw new URISyntaxException(str, "Invalid character");
- if (c == '%')
- {
- if (i + 2 >= str.length())
- throw new URISyntaxException(str, "Invalid quoted character");
- int hi = Character.digit(str.charAt(++i), 16);
- int lo = Character.digit(str.charAt(++i), 16);
- if (lo < 0 || hi < 0)
- throw new URISyntaxException(str, "Invalid quoted character");
- buf[pos++] = (byte) (hi * 16 + lo);
- }
- else
- buf[pos++] = (byte) c;
- }
- try
- {
- return new String(buf, 0, pos, "utf-8");
- }
- catch (java.io.UnsupportedEncodingException x2)
- {
- throw (Error) new InternalError().initCause(x2);
- }
- }
-
- /**
- * Quote characters illegal in URIs in given string.
- *
- * Replace illegal characters by encoding their UTF-8
- * representation as "%" + hex code for each resulting
- * UTF-8 character.
- *
- * @param str The string to quote
- *
- * @return The quoted string.
- */
- private static String quote(String str)
- {
- // FIXME: unimplemented.
- return str;
- }
-
- /**
- * Quote characters illegal in URI authorities in given string.
- *
- * Replace illegal characters by encoding their UTF-8
- * representation as "%" + hex code for each resulting
- * UTF-8 character.
- *
- * @param str The string to quote
- *
- * @return The quoted string.
- */
- private static String quoteAuthority(String str)
- {
- // Technically, we should be using RFC2396_AUTHORITY, but
- // it contains no additional characters.
- return quote(str, RFC2396_REG_NAME);
- }
-
- /**
- * Quote characters in str that are not part of legalCharacters.
- *
- * Replace illegal characters by encoding their UTF-8
- * representation as "%" + hex code for each resulting
- * UTF-8 character.
- *
- * @param str The string to quote
- * @param legalCharacters The set of legal characters
- *
- * @return The quoted string.
- */
- private static String quote(String str, String legalCharacters)
- {
- StringBuffer sb = new StringBuffer(str.length());
- for (int i = 0; i < str.length(); i++)
- {
- char c = str.charAt(i);
- if (legalCharacters.indexOf(c) == -1)
- {
- String hex = "0123456789ABCDEF";
- if (c <= 127)
- sb.append('%').append(hex.charAt(c / 16)).append(hex.charAt(c % 16));
- else
- {
- try
- {
- // this is far from optimal, but it works
- byte[] utf8 = str.substring(i, i + 1).getBytes("utf-8");
- for (int j = 0; j < utf8.length; j++)
- sb.append('%').append(hex.charAt((utf8[j] & 0xff) / 16))
- .append(hex.charAt((utf8[j] & 0xff) % 16));
- }
- catch (java.io.UnsupportedEncodingException x)
- {
- throw (Error) new InternalError().initCause(x);
- }
- }
- }
- else
- sb.append(c);
- }
- return sb.toString();
- }
-
- /**
- * Quote characters illegal in URI hosts in given string.
- *
- * Replace illegal characters by encoding their UTF-8
- * representation as "%" + hex code for each resulting
- * UTF-8 character.
- *
- * @param str The string to quote
- *
- * @return The quoted string.
- */
- private static String quoteHost(String str)
- {
- // FIXME: unimplemented.
- return str;
- }
-
- /**
- * Quote characters illegal in URI paths in given string.
- *
- * Replace illegal characters by encoding their UTF-8
- * representation as "%" + hex code for each resulting
- * UTF-8 character.
- *
- * @param str The string to quote
- *
- * @return The quoted string.
- */
- private static String quotePath(String str)
- {
- // Technically, we should be using RFC2396_PATH, but
- // it contains no additional characters.
- return quote(str, RFC2396_PATH_SEGMENTS);
- }
-
- /**
- * Quote characters illegal in URI user infos in given string.
- *
- * Replace illegal characters by encoding their UTF-8
- * representation as "%" + hex code for each resulting
- * UTF-8 character.
- *
- * @param str The string to quote
- *
- * @return The quoted string.
- */
- private static String quoteUserInfo(String str)
- {
- // FIXME: unimplemented.
- return str;
- }
-
- /**
- * Creates an URI from the given string
- *
- * @param str The string to create the URI from
- *
- * @exception URISyntaxException If the given string violates RFC 2396
- * @exception NullPointerException If str is null
- */
- public URI(String str) throws URISyntaxException
- {
- this.string = str;
- parseURI(str);
- }
-
- /**
- * Create an URI from the given components
- *
- * @param scheme The scheme name
- * @param userInfo The username and authorization info
- * @param host The hostname
- * @param port The port number
- * @param path The path
- * @param query The query
- * @param fragment The fragment
- *
- * @exception URISyntaxException If the given string violates RFC 2396
- */
- public URI(String scheme, String userInfo, String host, int port,
- String path, String query, String fragment)
- throws URISyntaxException
- {
- this((scheme == null ? "" : scheme + ":")
- + (userInfo == null && host == null && port == -1 ? "" : "//")
- + (userInfo == null ? "" : quoteUserInfo(userInfo) + "@")
- + (host == null ? "" : quoteHost(host))
- + (port == -1 ? "" : ":" + String.valueOf(port))
- + (path == null ? "" : quotePath(path))
- + (query == null ? "" : "?" + quote(query))
- + (fragment == null ? "" : "#" + quote(fragment)));
-
- parseServerAuthority();
- }
-
- /**
- * Create an URI from the given components
- *
- * @param scheme The scheme name
- * @param authority The authority
- * @param path The apth
- * @param query The query
- * @param fragment The fragment
- *
- * @exception URISyntaxException If the given string violates RFC 2396
- */
- public URI(String scheme, String authority, String path, String query,
- String fragment) throws URISyntaxException
- {
- this((scheme == null ? "" : scheme + ":")
- + (authority == null ? "" : "//" + quoteAuthority(authority))
- + (path == null ? "" : quotePath(path))
- + (query == null ? "" : "?" + quote(query))
- + (fragment == null ? "" : "#" + quote(fragment)));
- }
-
- /**
- * Create an URI from the given components
- *
- * @param scheme The scheme name
- * @param host The hostname
- * @param path The path
- * @param fragment The fragment
- *
- * @exception URISyntaxException If the given string violates RFC 2396
- */
- public URI(String scheme, String host, String path, String fragment)
- throws URISyntaxException
- {
- this(scheme, null, host, -1, path, null, fragment);
- }
-
- /**
- * Create an URI from the given components
- *
- * @param scheme The scheme name
- * @param ssp The scheme specific part
- * @param fragment The fragment
- *
- * @exception URISyntaxException If the given string violates RFC 2396
- */
- public URI(String scheme, String ssp, String fragment)
- throws URISyntaxException
- {
- this((scheme == null ? "" : scheme + ":")
- + (ssp == null ? "" : quote(ssp))
- + (fragment == null ? "" : "#" + quote(fragment)));
- }
-
- /**
- * Create an URI from the given string
- *
- * @param str The string to create the URI from
- *
- * @exception IllegalArgumentException If the given string violates RFC 2396
- * @exception NullPointerException If str is null
- */
- public static URI create(String str)
- {
- try
- {
- return new URI(str);
- }
- catch (URISyntaxException e)
- {
- throw (IllegalArgumentException) new IllegalArgumentException()
- .initCause(e);
- }
- }
-
- /**
- * Attempts to parse this URI's authority component, if defined,
- * into user-information, host, and port components
- *
- * @exception URISyntaxException If the given string violates RFC 2396
- */
- public URI parseServerAuthority() throws URISyntaxException
- {
- return null;
- }
-
- /**
- * Returns a normalizes versions of the URI
- */
- public URI normalize()
- {
- return null;
- }
-
- /**
- * Resolves the given URI against this URI
- *
- * @param uri The URI to resolve against this URI
- *
- * @return The resulting URI, or null when it couldn't be resolved
- * for some reason.
- *
- * @exception NullPointerException If uri is null
- */
- public URI resolve(URI uri)
- {
- if (uri.isAbsolute())
- return uri;
- if (uri.isOpaque())
- return uri;
-
- String scheme = uri.getScheme();
- String schemeSpecificPart = uri.getSchemeSpecificPart();
- String authority = uri.getAuthority();
- String path = uri.getPath();
- String query = uri.getQuery();
- String fragment = uri.getFragment();
-
- try
- {
- if (fragment != null && path != null && path.equals("")
- && scheme == null && authority == null && query == null)
- return new URI(this.scheme, this.schemeSpecificPart, fragment);
-
- if (authority == null)
- {
- authority = this.authority;
- if (path == null)
- path = "";
- if (! (path.startsWith("/")))
- {
- StringBuffer basepath = new StringBuffer(this.path);
- int i = this.path.lastIndexOf('/');
-
- if (i >= 0)
- basepath.delete(i + 1, basepath.length());
-
- basepath.append(path);
- path = basepath.toString();
- // FIXME We must normalize the path here.
- // Normalization process omitted.
- }
- }
- return new URI(this.scheme, authority, path, query, fragment);
- }
- catch (URISyntaxException e)
- {
- return null;
- }
- }
-
- /**
- * Resolves the given URI string against this URI
- *
- * @param str The URI as string to resolve against this URI
- *
- * @return The resulting URI
- *
- * @exception IllegalArgumentException If the given URI string
- * violates RFC 2396
- * @exception NullPointerException If uri is null
- */
- public URI resolve(String str) throws IllegalArgumentException
- {
- return resolve(create(str));
- }
-
- /**
- * Relativizes the given URI against this URI
- *
- * @param uri The URI to relativize this URI
- *
- * @return The resulting URI
- *
- * @exception NullPointerException If uri is null
- */
- public URI relativize(URI uri)
- {
- return null;
- }
-
- /**
- * Creates an URL from an URI
- *
- * @exception MalformedURLException If a protocol handler for the URL could
- * not be found, or if some other error occurred while constructing the URL
- * @exception IllegalArgumentException If the URI is not absolute
- */
- public URL toURL() throws IllegalArgumentException, MalformedURLException
- {
- if (isAbsolute())
- return new URL(this.toString());
-
- throw new IllegalArgumentException("not absolute");
- }
-
- /**
- * Returns the scheme of the URI
- */
- public String getScheme()
- {
- return scheme;
- }
-
- /**
- * Tells whether this URI is absolute or not
- */
- public boolean isAbsolute()
- {
- return scheme != null;
- }
-
- /**
- * Tell whether this URI is opaque or not
- */
- public boolean isOpaque()
- {
- return ((scheme != null) && ! (schemeSpecificPart.startsWith("/")));
- }
-
- /**
- * Returns the raw scheme specific part of this URI.
- * The scheme-specific part is never undefined, though it may be empty
- */
- public String getRawSchemeSpecificPart()
- {
- return rawSchemeSpecificPart;
- }
-
- /**
- * Returns the decoded scheme specific part of this URI.
- */
- public String getSchemeSpecificPart()
- {
- return schemeSpecificPart;
- }
-
- /**
- * Returns the rae authority part of this URI
- */
- public String getRawAuthority()
- {
- return rawAuthority;
- }
-
- /**
- * Returns the decoded authority part of this URI
- */
- public String getAuthority()
- {
- return authority;
- }
-
- /**
- * Returns the raw user info part of this URI
- */
- public String getRawUserInfo()
- {
- return rawUserInfo;
- }
-
- /**
- * Returns the decoded user info part of this URI
- */
- public String getUserInfo()
- {
- return userInfo;
- }
-
- /**
- * Returns the hostname of the URI
- */
- public String getHost()
- {
- return host;
- }
-
- /**
- * Returns the port number of the URI
- */
- public int getPort()
- {
- return port;
- }
-
- /**
- * Returns the raw path part of this URI
- */
- public String getRawPath()
- {
- return rawPath;
- }
-
- /**
- * Returns the path of the URI
- */
- public String getPath()
- {
- return path;
- }
-
- /**
- * Returns the raw query part of this URI
- */
- public String getRawQuery()
- {
- return rawQuery;
- }
-
- /**
- * Returns the query of the URI
- */
- public String getQuery()
- {
- return query;
- }
-
- /**
- * Return the raw fragment part of this URI
- */
- public String getRawFragment()
- {
- return rawFragment;
- }
-
- /**
- * Returns the fragment of the URI
- */
- public String getFragment()
- {
- return fragment;
- }
-
- /**
- * Compares the URI with a given object
- *
- * @param obj The obj to compare the URI with
- */
- public boolean equals(Object obj)
- {
- return false;
- }
-
- /**
- * Computes the hascode of the URI
- */
- public int hashCode()
- {
- return 0;
- }
-
- /**
- * Compare the URI with another object that must be an URI too
- *
- * @param obj This object to compare this URI with
- *
- * @exception ClassCastException If given object ist not an URI
- */
- public int compareTo(Object obj) throws ClassCastException
- {
- return 0;
- }
-
- /**
- * Returns the URI as a String. If the URI was created using a constructor,
- * then this will be the same as the original input string.
- *
- * @return a string representation of the URI.
- */
- public String toString()
- {
- return (getScheme() == null ? "" : getScheme() + ":")
- + getRawSchemeSpecificPart()
- + (getRawFragment() == null ? "" : "#" + getRawFragment());
- }
-
- /**
- * Returns the URI as US-ASCII string
- */
- public String toASCIIString()
- {
- return "";
- }
-}
diff --git a/libjava/java/net/URISyntaxException.java b/libjava/java/net/URISyntaxException.java
deleted file mode 100644
index 27a70bdb717..00000000000
--- a/libjava/java/net/URISyntaxException.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/* URISyntaxException.java -- a string could not be parsed as a URI
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * This exception is thrown when a String cannot be parsed as a URI.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see URI
- * @since 1.4
- * @status updated to 1.4
- */
-public class URISyntaxException extends Exception
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = 2137979680897488891L;
-
- /**
- * The failed input.
- *
- * @serial the bad URI
- */
- private final String input;
-
- /**
- * The index of failure.
- *
- * @serial the location of the problem
- */
- private final int index;
-
- /**
- * Create an exception from the invalid string, with the index set to -1.
- *
- * @param input the bad URI
- * @param msg the descriptive error message
- * @throws NullPointerException if input or msg are null
- */
- public URISyntaxException(String input, String msg)
- {
- this(input, msg, -1);
- }
-
- /**
- * Create an exception from the invalid string, with the index of the
- * point of failure.
- *
- * @param input the bad URI
- * @param msg the descriptive error message
- * @param index the index of the parse error, or -1
- * @throws NullPointerException if input or msg are null
- * @throws IllegalArgumentException if index &lt; -1
- */
- public URISyntaxException(String input, String msg, int index)
- {
- // The toString() hack checks for null.
- super(msg.toString());
- this.input = input.toString();
- this.index = index;
- if (index < -1)
- throw new IllegalArgumentException();
- }
-
- /**
- * Returns the bad input string.
- *
- * @return the bad URI, guaranteed non-null
- */
- public String getInput()
- {
- return input;
- }
-
- /**
- * Returns the reason for the failure.
- *
- * @return the message, guaranteed non-null
- */
- public String getReason()
- {
- return super.getMessage();
- }
-
- /**
- * Returns the index of the failure, or -1.
- *
- * @return the index of failure
- */
- public int getIndex()
- {
- return index;
- }
-
- /**
- * Returns a message describing the parse error, as if by
- * <code>getReason() + (getIndex() &gt;= 0 ? " at index " + getIndex() : "")
- * + ": " + getInput()</code>.
- *
- * @return the message string
- */
- public String getMessage()
- {
- return (super.getMessage() + (index >= 0 ? " at index " + index : "")
- + ": " + input);
- }
-}
diff --git a/libjava/java/net/URLDecoder.java b/libjava/java/net/URLDecoder.java
deleted file mode 100644
index ca40c386a52..00000000000
--- a/libjava/java/net/URLDecoder.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/* URLDecoder.java -- Class to decode URL's from encoded form.
- Copyright (C) 1998, 1999, 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.UnsupportedEncodingException;
-
-
-/**
- * This utility class contains static methods that converts a
- * string encoded in the x-www-form-urlencoded format to the original
- * text. The x-www-form-urlencoded format replaces certain disallowed
- * characters with encoded equivalents. All upper case and lower case
- * letters in the US alphabet remain as is, the space character (' ')
- * is replaced with '+' sign, and all other characters are converted to a
- * "%XX" format where XX is the hexadecimal representation of that character
- * in a given character encoding (default is "UTF-8").
- * <p>
- * This method is very useful for decoding strings sent to CGI scripts
- *
- * Written using on-line Java Platform 1.2/1.4 API Specification.
- * Status: Believed complete and correct.
- *
- * @since 1.2
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com) (documentation comments)
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class URLDecoder
-{
- /**
- * Public contructor. Note that this class has only static methods.
- */
- public URLDecoder()
- {
- }
-
- /**
- * This method translates the passed in string from x-www-form-urlencoded
- * format using the default encoding "UTF-8" to decode the hex encoded
- * unsafe characters.
- *
- * @param s the String to convert
- *
- * @return the converted String
- *
- * @deprecated
- */
- public static String decode(String s)
- {
- try
- {
- return decode(s, "UTF-8");
- }
- catch (UnsupportedEncodingException uee)
- {
- // Should never happen since UTF-8 encoding should always be supported
- return s;
- }
- }
-
- /**
- * This method translates the passed in string from x-www-form-urlencoded
- * format using the given character encoding to decode the hex encoded
- * unsafe characters.
- *
- * This implementation will decode the string even if it contains
- * unsafe characters (characters that should have been encoded) or if the
- * two characters following a % do not represent a hex encoded byte.
- * In those cases the unsafe character or the % character will be added
- * verbatim to the decoded result.
- *
- * @param s the String to convert
- * @param encoding the character encoding to use the decode the hex encoded
- * unsafe characters
- *
- * @return the converted String
- *
- * @exception UnsupportedEncodingException If the named encoding is not
- * supported
- *
- * @since 1.4
- */
- public static String decode(String s, String encoding)
- throws UnsupportedEncodingException
- {
- // First convert all '+' characters to spaces.
- String str = s.replace('+', ' ');
-
- // Then go through the whole string looking for byte encoded characters
- int i;
- int start = 0;
- byte[] bytes = null;
- int length = str.length();
- StringBuffer result = new StringBuffer(length);
- while ((i = str.indexOf('%', start)) >= 0)
- {
- // Add all non-encoded characters to the result buffer
- result.append(str.substring(start, i));
- start = i;
-
- // Get all consecutive encoded bytes
- while ((i + 2 < length) && (str.charAt(i) == '%'))
- i += 3;
-
- // Decode all these bytes
- if ((bytes == null) || (bytes.length < ((i - start) / 3)))
- bytes = new byte[((i - start) / 3)];
-
- int index = 0;
- try
- {
- while (start < i)
- {
- String sub = str.substring(start + 1, start + 3);
- bytes[index] = (byte) Integer.parseInt(sub, 16);
- index++;
- start += 3;
- }
- }
- catch (NumberFormatException nfe)
- {
- // One of the hex encoded strings was bad
- }
-
- // Add the bytes as characters according to the given encoding
- result.append(new String(bytes, 0, index, encoding));
-
- // Make sure we skip to just after a % sign
- // There might not have been enough encoded characters after the %
- // or the hex chars were not actually hex chars (NumberFormatException)
- if (start < length && s.charAt(start) == '%')
- {
- result.append('%');
- start++;
- }
- }
-
- // Add any characters left
- if (start < str.length())
- result.append(str.substring(start));
-
- return result.toString();
- }
-} // class URLDecoder
diff --git a/libjava/java/net/URLEncoder.java b/libjava/java/net/URLEncoder.java
deleted file mode 100644
index dacc3848e37..00000000000
--- a/libjava/java/net/URLEncoder.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/* URLEncoder.java -- Class to convert strings to a properly encoded URL
- Copyright (C) 1998, 1999, 2001, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.UnsupportedEncodingException;
-
-
-/*
- * Written using on-line Java Platform 1.2/1.4 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * This utility class contains static methods that converts a
- * string into a fully encoded URL string in x-www-form-urlencoded
- * format. This format replaces certain disallowed characters with
- * encoded equivalents. All upper case and lower case letters in the
- * US alphabet remain as is, the space character (' ') is replaced with
- * '+' sign, and all other characters are converted to a "%XX" format
- * where XX is the hexadecimal representation of that character in a
- * certain encoding (by default, the platform encoding, though the
- * standard is "UTF-8").
- * <p>
- * This method is very useful for encoding strings to be sent to CGI scripts
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class URLEncoder
-{
- /**
- * This method translates the passed in string into x-www-form-urlencoded
- * format using the default encoding. The standard encoding is
- * "UTF-8", and the two-argument form of this method should be used
- * instead.
- *
- * @param s The String to convert
- *
- * @return The converted String
- *
- * @deprecated
- */
- public static String encode(String s)
- {
- try
- {
- // We default to 8859_1 for compatibility with the same
- // default elsewhere in the library.
- return encode(s, System.getProperty("file.encoding", "8859_1"));
- }
- catch (UnsupportedEncodingException uee)
- {
- // Should never happen since default should always be supported
- return s;
- }
- }
-
- /**
- * This method translates the passed in string into x-www-form-urlencoded
- * format using the character encoding to hex-encode the unsafe characters.
- *
- * @param s The String to convert
- * @param encoding The encoding to use for unsafe characters
- *
- * @return The converted String
- *
- * @exception UnsupportedEncodingException If the named encoding is not
- * supported
- *
- * @since 1.4
- */
- public static String encode(String s, String encoding)
- throws UnsupportedEncodingException
- {
- int length = s.length();
- int start = 0;
- int i = 0;
-
- StringBuffer result = new StringBuffer(length);
- while (true)
- {
- while (i < length && isSafe(s.charAt(i)))
- i++;
-
- // Safe character can just be added
- result.append(s.substring(start, i));
-
- // Are we done?
- if (i >= length)
- return result.toString();
- else if (s.charAt(i) == ' ')
- {
- result.append('+'); // Replace space char with plus symbol.
- i++;
- }
- else
- {
- // Get all unsafe characters
- start = i;
- char c;
- while (i < length && (c = s.charAt(i)) != ' ' && ! isSafe(c))
- i++;
-
- // Convert them to %XY encoded strings
- String unsafe = s.substring(start, i);
- byte[] bytes = unsafe.getBytes(encoding);
- for (int j = 0; j < bytes.length; j++)
- {
- result.append('%');
- int val = bytes[j];
- result.append(hex.charAt((val & 0xf0) >> 4));
- result.append(hex.charAt(val & 0x0f));
- }
- }
- start = i;
- }
- }
-
- /**
- * Private static method that returns true if the given char is either
- * a uppercase or lowercase letter from 'a' till 'z', or a digit froim
- * '0' till '9', or one of the characters '-', '_', '.' or '*'. Such
- * 'safe' character don't have to be url encoded.
- */
- private static boolean isSafe(char c)
- {
- return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
- || (c >= '0' && c <= '9') || c == '-' || c == '_' || c == '.'
- || c == '*');
- }
-
- /**
- * Private constructor that does nothing. Included to avoid a default
- * public constructor being created by the compiler.
- */
- private URLEncoder()
- {
- }
-
- /**
- * Used to convert to hex. We don't use Integer.toHexString, since
- * it converts to lower case (and the Sun docs pretty clearly
- * specify upper case here), and because it doesn't provide a
- * leading 0.
- */
- private static final String hex = "0123456789ABCDEF";
-}
diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java
deleted file mode 100644
index 57ce2dfa290..00000000000
--- a/libjava/java/net/URLStreamHandler.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/* URLStreamHandler.java -- Abstract superclass for all protocol handlers
- Copyright (C) 1998, 1999, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.File;
-import java.io.IOException;
-
-
-/*
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * This class is the superclass of all URL protocol handlers. The URL
- * class loads the appropriate protocol handler to establish a connection
- * to a (possibly) remote service (eg, "http", "ftp") and to do protocol
- * specific parsing of URL's. Refer to the URL class documentation for
- * details on how that class locates and loads protocol handlers.
- * <p>
- * A protocol handler implementation should override the openConnection()
- * method, and optionally override the parseURL() and toExternalForm()
- * methods if necessary. (The default implementations will parse/write all
- * URL's in the same form as http URL's). A protocol specific subclass
- * of URLConnection will most likely need to be created as well.
- * <p>
- * Note that the instance methods in this class are called as if they
- * were static methods. That is, a URL object to act on is passed with
- * every call rather than the caller assuming the URL is stored in an
- * instance variable of the "this" object.
- * <p>
- * The methods in this class are protected and accessible only to subclasses.
- * URLStreamConnection objects are intended for use by the URL class only,
- * not by other classes (unless those classes are implementing protocols).
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- *
- * @see URL
- */
-public abstract class URLStreamHandler
-{
- /**
- * Creates a URLStreamHander
- */
- public URLStreamHandler()
- {
- }
-
- /**
- * Returns a URLConnection for the passed in URL. Note that this should
- * not actually create the connection to the (possibly) remote host, but
- * rather simply return a URLConnection object. The connect() method of
- * URL connection is used to establish the actual connection, possibly
- * after the caller sets up various connection options.
- *
- * @param url The URL to get a connection object for
- *
- * @return A URLConnection object for the given URL
- *
- * @exception IOException If an error occurs
- */
- protected abstract URLConnection openConnection(URL url)
- throws IOException;
-
- /**
- * This method parses the string passed in as a URL and set's the
- * instance data fields in the URL object passed in to the various values
- * parsed out of the string. The start parameter is the position to start
- * scanning the string. This is usually the position after the ":" which
- * terminates the protocol name. The end parameter is the position to
- * stop scanning. This will be either the end of the String, or the
- * position of the "#" character, which separates the "file" portion of
- * the URL from the "anchor" portion.
- * <p>
- * This method assumes URL's are formatted like http protocol URL's, so
- * subclasses that implement protocols with URL's the follow a different
- * syntax should override this method. The lone exception is that if
- * the protocol name set in the URL is "file", this method will accept
- * an empty hostname (i.e., "file:///"), which is legal for that protocol
- *
- * @param url The URL object in which to store the results
- * @param spec The String-ized URL to parse
- * @param start The position in the string to start scanning from
- * @param end The position in the string to stop scanning
- */
- protected void parseURL(URL url, String spec, int start, int end)
- {
- String host = url.getHost();
- int port = url.getPort();
- String file = url.getFile();
- String ref = url.getRef();
- String userInfo = url.getUserInfo();
- String authority = url.getAuthority();
- String query = null;
-
- // On Windows we need to change \ to / for file URLs
- char separator = File.separatorChar;
- if (url.getProtocol().equals("file") && separator != '/')
- {
- file = file.replace(separator, '/');
- spec = spec.replace(separator, '/');
- }
-
- if (spec.regionMatches(start, "//", 0, 2))
- {
- String genuineHost;
- int hostEnd;
- int colon;
- int at_host;
-
- start += 2;
- int slash = spec.indexOf('/', start);
- if (slash >= 0)
- hostEnd = slash;
- else
- hostEnd = end;
-
- authority = host = spec.substring(start, hostEnd);
-
- // We first need a genuine host name (with userinfo).
- // So we check for '@': if it's present check the port in the
- // section after '@' in the other case check it in the full string.
- // P.S.: We don't care having '@' at the beginning of the string.
- if ((at_host = host.indexOf('@')) >= 0)
- {
- genuineHost = host.substring(at_host);
- userInfo = host.substring(0, at_host);
- }
- else
- genuineHost = host;
-
- // Look for optional port number. It is valid for the non-port
- // part of the host name to be null (e.g. a URL "http://:80").
- // TBD: JDK 1.2 in this case sets host to null rather than "";
- // this is undocumented and likely an unintended side effect in 1.2
- // so we'll be simple here and stick with "". Note that
- // "http://" or "http:///" produce a "" host in JDK 1.2.
- if ((colon = genuineHost.indexOf(':')) >= 0)
- {
- try
- {
- port = Integer.parseInt(genuineHost.substring(colon + 1));
- }
- catch (NumberFormatException e)
- {
- // Ignore invalid port values; port is already set to u's
- // port.
- }
-
- // Now we must cut the port number in the original string.
- if (at_host >= 0)
- host = host.substring(0, at_host + colon);
- else
- host = host.substring(0, colon);
- }
- file = null;
- start = hostEnd;
- }
- else if (host == null)
- host = "";
-
- if (file == null || file.length() == 0
- || (start < end && spec.charAt(start) == '/'))
- {
- // No file context available; just spec for file.
- // Or this is an absolute path name; ignore any file context.
- file = spec.substring(start, end);
- ref = null;
- }
- else if (start < end)
- {
- // Context is available, but only override it if there is a new file.
- int lastSlash = file.lastIndexOf('/');
- if (lastSlash < 0)
- file = spec.substring(start, end);
- else
- file = (file.substring(0, lastSlash)
- + '/' + spec.substring(start, end));
-
- // For URLs constructed relative to a context, we
- // need to canonicalise the file path.
- file = canonicalizeFilename(file);
-
- ref = null;
- }
-
- if (ref == null)
- {
- // Normally there should be no '#' in the file part,
- // but we are nice.
- int hash = file.indexOf('#');
- if (hash != -1)
- {
- ref = file.substring(hash + 1, file.length());
- file = file.substring(0, hash);
- }
- }
-
- // We care about the query tag only if there is no reference at all.
- if (ref == null)
- {
- int queryTag = file.indexOf('?');
- if (queryTag != -1)
- {
- query = file.substring(queryTag + 1);
- file = file.substring(0, queryTag);
- }
- }
-
- // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on
- // the file part. It seems like overhead, but supposedly there is some
- // benefit in windows based systems (it also lowercased the string).
- setURL(url, url.getProtocol(), host, port, authority, userInfo, file, query, ref);
- }
-
- /*
- * Canonicalize a filename.
- */
- private static String canonicalizeFilename(String file)
- {
- // XXX - GNU Classpath has an implementation that might be more appropriate
- // for Windows based systems (gnu.java.io.PlatformHelper.toCanonicalForm)
- int index;
-
- // Replace "/./" with "/". This probably isn't very efficient in
- // the general case, but it's probably not bad most of the time.
- while ((index = file.indexOf("/./")) >= 0)
- file = file.substring(0, index) + file.substring(index + 2);
-
- // Process "/../" correctly. This probably isn't very efficient in
- // the general case, but it's probably not bad most of the time.
- while ((index = file.indexOf("/../")) >= 0)
- {
- // Strip of the previous directory - if it exists.
- int previous = file.lastIndexOf('/', index - 1);
- if (previous >= 0)
- file = file.substring(0, previous) + file.substring(index + 3);
- else
- break;
- }
- return file;
- }
-
- /**
- * Compares two URLs, excluding the fragment component
- *
- * @param url1 The first url
- * @param url2 The second url to compare with the first
- *
- * @return True if both URLs point to the same file, false otherwise.
- *
- * @specnote Now protected
- */
- protected boolean sameFile(URL url1, URL url2)
- {
- if (url1 == url2)
- return true;
-
- // This comparison is very conservative. It assumes that any
- // field can be null.
- if (url1 == null || url2 == null)
- return false;
- int p1 = url1.getPort();
- if (p1 == -1)
- p1 = url1.ph.getDefaultPort();
- int p2 = url2.getPort();
- if (p2 == -1)
- p2 = url2.ph.getDefaultPort();
- if (p1 != p2)
- return false;
- String s1;
- String s2;
- s1 = url1.getProtocol();
- s2 = url2.getProtocol();
- if (s1 != s2 && (s1 == null || ! s1.equals(s2)))
- return false;
- s1 = url1.getHost();
- s2 = url2.getHost();
- if (s1 != s2 && (s1 == null || ! s1.equals(s2)))
- return false;
- s1 = canonicalizeFilename(url1.getFile());
- s2 = canonicalizeFilename(url2.getFile());
- if (s1 != s2 && (s1 == null || ! s1.equals(s2)))
- return false;
- return true;
- }
-
- /**
- * This methods sets the instance variables representing the various fields
- * of the URL to the values passed in.
- *
- * @param u The URL to modify
- * @param protocol The protocol to set
- * @param host The host name to et
- * @param port The port number to set
- * @param file The filename to set
- * @param ref The reference
- *
- * @exception SecurityException If the protocol handler of the URL is
- * different from this one
- *
- * @deprecated 1.2 Please use
- * #setURL(URL,String,String,int,String,String,String,String);
- */
- protected void setURL(URL u, String protocol, String host, int port,
- String file, String ref)
- {
- u.set(protocol, host, port, file, ref);
- }
-
- /**
- * Sets the fields of the URL argument to the indicated values
- *
- * @param u The URL to modify
- * @param protocol The protocol to set
- * @param host The host name to set
- * @param port The port number to set
- * @param authority The authority to set
- * @param userInfo The user information to set
- * @param path The path/filename to set
- * @param query The query part to set
- * @param ref The reference
- *
- * @exception SecurityException If the protocol handler of the URL is
- * different from this one
- */
- protected void setURL(URL u, String protocol, String host, int port,
- String authority, String userInfo, String path,
- String query, String ref)
- {
- u.set(protocol, host, port, authority, userInfo, path, query, ref);
- }
-
- /**
- * Provides the default equals calculation. May be overidden by handlers for
- * other protocols that have different requirements for equals(). This method
- * requires that none of its arguments is null. This is guaranteed by the
- * fact that it is only called by java.net.URL class.
- *
- * @param url1 An URL object
- * @param url2 An URL object
- *
- * @return True if both given URLs are equal, false otherwise.
- */
- protected boolean equals(URL url1, URL url2)
- {
- // This comparison is very conservative. It assumes that any
- // field can be null.
- return (url1.getPort() == url2.getPort()
- && ((url1.getProtocol() == null && url2.getProtocol() == null)
- || (url1.getProtocol() != null
- && url1.getProtocol().equals(url2.getProtocol())))
- && ((url1.getUserInfo() == null && url2.getUserInfo() == null)
- || (url1.getUserInfo() != null
- && url1.getUserInfo().equals(url2.getUserInfo())))
- && ((url1.getAuthority() == null && url2.getAuthority() == null)
- || (url1.getAuthority() != null
- && url1.getAuthority().equals(url2.getAuthority())))
- && ((url1.getHost() == null && url2.getHost() == null)
- || (url1.getHost() != null && url1.getHost().equals(url2.getHost())))
- && ((url1.getPath() == null && url2.getPath() == null)
- || (url1.getPath() != null && url1.getPath().equals(url2.getPath())))
- && ((url1.getQuery() == null && url2.getQuery() == null)
- || (url1.getQuery() != null
- && url1.getQuery().equals(url2.getQuery())))
- && ((url1.getRef() == null && url2.getRef() == null)
- || (url1.getRef() != null && url1.getRef().equals(url2.getRef()))));
- }
-
- /**
- * Compares the host components of two URLs.
- *
- * @param url1 The first URL.
- * @param url2 The second URL.
- *
- * @return True if both URLs contain the same host.
- *
- * @exception UnknownHostException If an unknown host is found
- */
- protected boolean hostsEqual(URL url1, URL url2)
- {
- InetAddress addr1 = getHostAddress(url1);
- InetAddress addr2 = getHostAddress(url2);
-
- if (addr1 != null && addr2 != null)
- return addr1.equals(addr2);
-
- String host1 = url1.getHost();
- String host2 = url2.getHost();
-
- if (host1 != null && host2 != null)
- return host1.equalsIgnoreCase(host2);
-
- return host1 == null && host2 == null;
- }
-
- /**
- * Get the IP address of our host. An empty host field or a DNS failure will
- * result in a null return.
- *
- * @param url The URL to return the host address for.
- *
- * @return The address of the hostname in url.
- */
- protected InetAddress getHostAddress(URL url)
- {
- String hostname = url.getHost();
-
- if (hostname.equals(""))
- return null;
-
- try
- {
- return InetAddress.getByName(hostname);
- }
- catch (UnknownHostException e)
- {
- return null;
- }
- }
-
- /**
- * Returns the default port for a URL parsed by this handler. This method is
- * meant to be overidden by handlers with default port numbers.
- *
- * @return The default port number.
- */
- protected int getDefaultPort()
- {
- return -1;
- }
-
- /**
- * Provides the default hash calculation. May be overidden by handlers for
- * other protocols that have different requirements for hashCode calculation.
- *
- * @param url The URL to calc the hashcode for.
- *
- * @return The hashcode for the given URL.
- */
- protected int hashCode(URL url)
- {
- return url.getProtocol().hashCode()
- + ((url.getHost() == null) ? 0 : url.getHost().hashCode())
- + url.getFile().hashCode() + url.getPort();
- }
-
- /**
- * This method converts a URL object into a String. This method creates
- * Strings in the mold of http URL's, so protocol handlers which use URL's
- * that have a different syntax should override this method
- *
- * @param url The URL object to convert
- *
- * @return A string representation of the url
- */
- protected String toExternalForm(URL url)
- {
- String protocol;
- String file;
- String ref;
- String authority;
-
- protocol = url.getProtocol();
- authority = url.getAuthority();
- if (authority == null)
- authority = "";
-
- file = url.getFile();
- ref = url.getRef();
-
- // Guess a reasonable size for the string buffer so we have to resize
- // at most once.
- int size = protocol.length() + authority.length() + file.length() + 24;
- StringBuffer sb = new StringBuffer(size);
-
- if (protocol != null && protocol.length() > 0)
- {
- sb.append(protocol);
- sb.append(":");
- }
-
- if (authority.length() != 0)
- {
- sb.append("//").append(authority);
- }
-
- sb.append(file);
-
- if (ref != null)
- sb.append('#').append(ref);
-
- return sb.toString();
- }
-}
diff --git a/libjava/java/net/URLStreamHandlerFactory.java b/libjava/java/net/URLStreamHandlerFactory.java
deleted file mode 100644
index c92c71fb2b3..00000000000
--- a/libjava/java/net/URLStreamHandlerFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* URLStreamHandlerFactory.java -- Maps protocols to URLStreamHandlers
- Copyright (C) 1998, 1999, 2000, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-/**
- * This interface contains one method which maps the protocol portion of
- * a URL (eg, "http" in "http://www.urbanophile.com/arenn/") to a
- * <code>URLStreamHandler</code> object.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- */
-public interface URLStreamHandlerFactory
-{
- /**
- * This method maps the protocol portion of a URL to a
- * <code>URLStreamHandler</code> object.
- *
- * @param protocol The protocol name to map ("http", "ftp", etc).
- *
- * @return The <code>URLStreamHandler</code> for the specified protocol
- */
- URLStreamHandler createURLStreamHandler(String protocol);
-} // interface URLStreamHandlerFactory
diff --git a/libjava/java/net/UnknownHostException.java b/libjava/java/net/UnknownHostException.java
deleted file mode 100644
index c5ba18330d3..00000000000
--- a/libjava/java/net/UnknownHostException.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* UnknownHostException.java -- The hostname is unknown
- Copyright (C) 1998, 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.IOException;
-
-
-/**
- * This exception indicates that an attempt was made to reference a hostname
- * or IP address that is not valid. This could possibly indicate that a
- * DNS problem has occurred, but most often means that the host was not
- * correctly specified.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner
- * @status updated to 1.4
- */
-public class UnknownHostException extends IOException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -4639126076052875403L;
-
- /**
- * Create a new instance without a descriptive error message.
- */
- public UnknownHostException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message, such as the
- * name of the host that could not be resolved.
- *
- * @param message a message describing the error that occurred
- */
- public UnknownHostException(String message)
- {
- super(message);
- }
-} // class UnknownHostException
diff --git a/libjava/java/net/UnknownServiceException.java b/libjava/java/net/UnknownServiceException.java
deleted file mode 100644
index 65cc8f59225..00000000000
--- a/libjava/java/net/UnknownServiceException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* UnknownServiceException.java -- A service error occurred
- Copyright (C) 1998, 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.net;
-
-import java.io.IOException;
-
-
-/**
- * Contrary to what you might think, this does not indicate that the
- * TCP/IP service name specified was invalid. Instead it indicates that
- * the MIME type returned from a URL could not be determined or that an
- * attempt was made to write to a read-only URL.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class UnknownServiceException extends IOException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -4169033248853639508L;
-
- /**
- * Create a new instance without a descriptive error message.
- */
- public UnknownServiceException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param message a message describing the error that occurred
- */
- public UnknownServiceException(String message)
- {
- super(message);
- }
-} // class UnknownServiceException
diff --git a/libjava/java/nio/BufferOverflowException.java b/libjava/java/nio/BufferOverflowException.java
deleted file mode 100644
index 588c03290a1..00000000000
--- a/libjava/java/nio/BufferOverflowException.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* BufferOverflowException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @since 1.4
- */
-public class BufferOverflowException extends RuntimeException
-{
- /**
- * Creates the exception
- */
- public BufferOverflowException ()
- {
- }
-}
diff --git a/libjava/java/nio/BufferUnderflowException.java b/libjava/java/nio/BufferUnderflowException.java
deleted file mode 100644
index 4b4161c647c..00000000000
--- a/libjava/java/nio/BufferUnderflowException.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* BufferUnderflowException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @since 1.4
- */
-public class BufferUnderflowException extends RuntimeException
-{
- /**
- * Creates the exception
- */
- public BufferUnderflowException ()
- {
- }
-}
diff --git a/libjava/java/nio/ByteBuffer.java b/libjava/java/nio/ByteBuffer.java
deleted file mode 100644
index 0ccf7663cfa..00000000000
--- a/libjava/java/nio/ByteBuffer.java
+++ /dev/null
@@ -1,651 +0,0 @@
-/* ByteBuffer.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @since 1.4
- */
-public abstract class ByteBuffer extends Buffer
- implements Comparable
-{
- ByteOrder endian = ByteOrder.BIG_ENDIAN;
-
- int array_offset;
- byte[] backing_buffer;
-
- ByteBuffer (int capacity, int limit, int position, int mark)
- {
- super (capacity, limit, position, mark);
- }
-
- /**
- * Allocates a new direct byte buffer.
- */
- public static ByteBuffer allocateDirect (int capacity)
- {
- return DirectByteBufferImpl.allocate (capacity);
- }
-
- /**
- * Allocates a new <code>ByteBuffer</code> object with a given capacity.
- */
- public static ByteBuffer allocate (int capacity)
- {
- return wrap(new byte[capacity], 0, capacity);
- }
-
- /**
- * Wraps a <code>byte</code> array into a <code>ByteBuffer</code>
- * object.
- *
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- */
- public static final ByteBuffer wrap (byte[] array, int offset, int length)
- {
- // FIXME: In GCJ and other implementations where arrays may not
- // move we might consider, at least when offset==0:
- // return new DirectByteBufferImpl(array,
- // address_of_data(array) + offset,
- // length, length, 0, false);
- // This may be more efficient, mainly because we can then use the
- // same logic for all ByteBuffers.
-
- return new ByteBufferImpl (array, 0, array.length, offset + length, offset, -1, false);
- }
-
- /**
- * Wraps a <code>byte</code> array into a <code>ByteBuffer</code>
- * object.
- */
- public static final ByteBuffer wrap (byte[] array)
- {
- return wrap (array, 0, array.length);
- }
-
- /**
- * This method transfers <code>byte</code>s from this buffer into the given
- * destination array. Before the transfer, it checks if there are fewer than
- * length <code>byte</code>s remaining in this buffer.
- *
- * @param dst The destination array
- * @param offset The offset within the array of the first <code>byte</code>
- * to be written; must be non-negative and no larger than dst.length.
- * @param length The maximum number of bytes to be written to the given array;
- * must be non-negative and no larger than dst.length - offset.
- *
- * @exception BufferUnderflowException If there are fewer than length
- * <code>byte</code>s remaining in this buffer.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold.
- */
- public ByteBuffer get (byte[] dst, int offset, int length)
- {
- checkArraySize(dst.length, offset, length);
- checkForUnderflow(length);
-
- for (int i = offset; i < offset + length; i++)
- {
- dst [i] = get ();
- }
-
- return this;
- }
-
- /**
- * This method transfers <code>byte</code>s from this buffer into the given
- * destination array.
- *
- * @param dst The byte array to write into.
- *
- * @exception BufferUnderflowException If there are fewer than dst.length
- * <code>byte</code>s remaining in this buffer.
- */
- public ByteBuffer get (byte[] dst)
- {
- return get (dst, 0, dst.length);
- }
-
- /**
- * Writes the content of the the <code>ByteBUFFER</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * <code>src.remaining()</code> space remaining in this buffer.
- *
- * @param src The source data.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>byte</code>s in the source buffer.
- * @exception IllegalArgumentException If the source buffer is this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public ByteBuffer put (ByteBuffer src)
- {
- if (src == this)
- throw new IllegalArgumentException ();
-
- checkForOverflow(src.remaining());
-
- if (src.remaining () > 0)
- {
- byte[] toPut = new byte [src.remaining ()];
- src.get (toPut);
- put (toPut);
- }
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>byte array</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * length space remaining in this buffer.
- *
- * @param src The array to copy into the buffer.
- * @param offset The offset within the array of the first byte to be read;
- * must be non-negative and no larger than src.length.
- * @param length The number of bytes to be read from the given array;
- * must be non-negative and no larger than src.length - offset.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>byte</code>s in the source array.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public ByteBuffer put (byte[] src, int offset, int length)
- {
- checkArraySize(src.length, offset, length);
- checkForOverflow(length);
-
- for (int i = offset; i < offset + length; i++)
- put (src [i]);
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>byte array</code> src
- * into the buffer.
- *
- * @param src The array to copy into the buffer.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>byte</code>s in the source array.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public final ByteBuffer put (byte[] src)
- {
- return put (src, 0, src.length);
- }
-
- /**
- * Tells whether ot not this buffer is backed by an accessible
- * <code>byte</code> array.
- */
- public final boolean hasArray ()
- {
- return (backing_buffer != null
- && !isReadOnly ());
- }
-
- /**
- * Returns the <code>byte</code> array that backs this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final byte[] array ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return backing_buffer;
- }
-
- /**
- * Returns the offset within this buffer's backing array of the first element.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final int arrayOffset ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return array_offset;
- }
-
- /**
- * Calculates a hash code for this buffer.
- *
- * This is done with <code>int</code> arithmetic,
- * where ** represents exponentiation, by this formula:<br>
- * <code>s[position()] + 31 + (s[position()+1] + 30)*31**1 + ... +
- * (s[limit()-1]+30)*31**(limit()-1)</code>.
- * Where s is the buffer data. Note that the hashcode is dependent
- * on buffer content, and therefore is not useful if the buffer
- * content may change.
- *
- * @return the hash code
- */
- public int hashCode ()
- {
- int hashCode = get(position()) + 31;
- int multiplier = 1;
- for (int i = position() + 1; i < limit(); ++i)
- {
- multiplier *= 31;
- hashCode += (get(i) + 30)*multiplier;
- }
- return hashCode;
- }
-
- /**
- * Checks if this buffer is equal to obj.
- */
- public boolean equals (Object obj)
- {
- if (obj instanceof ByteBuffer)
- {
- return compareTo (obj) == 0;
- }
-
- return false;
- }
-
- /**
- * Compares two <code>ByteBuffer</code> objects.
- *
- * @exception ClassCastException If obj is not an object derived from
- * <code>ByteBuffer</code>.
- */
- public int compareTo (Object obj)
- {
- ByteBuffer other = (ByteBuffer) obj;
-
- int num = Math.min(remaining(), other.remaining());
- int pos_this = position();
- int pos_other = other.position();
-
- for (int count = 0; count < num; count++)
- {
- byte a = get(pos_this++);
- byte b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
- }
-
- return remaining() - other.remaining();
- }
-
- /**
- * Returns the byte order of this buffer.
- */
- public final ByteOrder order ()
- {
- return endian;
- }
-
- /**
- * Modifies this buffer's byte order.
- */
- public final ByteBuffer order (ByteOrder endian)
- {
- this.endian = endian;
- return this;
- }
-
- /**
- * Reads the <code>byte</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>byte</code>s in this buffer.
- */
- public abstract byte get ();
-
- /**
- * Writes the <code>byte</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferOverflowException If there no remaining
- * <code>byte</code>s in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract ByteBuffer put (byte b);
-
- /**
- * Absolute get method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public abstract byte get (int index);
-
- /**
- * Absolute put method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract ByteBuffer put (int index, byte b);
-
- /**
- * Compacts this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract ByteBuffer compact ();
-
- void shiftDown (int dst_offset, int src_offset, int count)
- {
- for (int i = 0; i < count; i++)
- put(dst_offset + i, get(src_offset + i));
- }
-
- /**
- * Tells whether or not this buffer is direct.
- */
- public abstract boolean isDirect ();
-
- /**
- * Creates a new <code>ByteBuffer</code> whose content is a shared
- * subsequence of this buffer's content.
- */
- public abstract ByteBuffer slice ();
-
- /**
- * Creates a new <code>ByteBuffer</code> that shares this buffer's
- * content.
- */
- public abstract ByteBuffer duplicate ();
-
- /**
- * Creates a new read-only <code>ByteBuffer</code> that shares this
- * buffer's content.
- */
- public abstract ByteBuffer asReadOnlyBuffer ();
-
- /**
- * Creates a view of this byte buffer as a short buffer.
- */
- public abstract ShortBuffer asShortBuffer ();
-
- /**
- * Creates a view of this byte buffer as a char buffer.
- */
- public abstract CharBuffer asCharBuffer ();
-
- /**
- * Creates a view of this byte buffer as an integer buffer.
- */
- public abstract IntBuffer asIntBuffer ();
-
- /**
- * Creates a view of this byte buffer as a long buffer.
- */
- public abstract LongBuffer asLongBuffer ();
-
- /**
- * Creates a view of this byte buffer as a float buffer.
- */
- public abstract FloatBuffer asFloatBuffer ();
-
- /**
- * Creates a view of this byte buffer as a double buffer.
- */
- public abstract DoubleBuffer asDoubleBuffer ();
-
- /**
- * Relative get method for reading a character value.
- *
- * @exception BufferUnderflowException If there are fewer than two bytes
- * remaining in this buffer.
- */
- public abstract char getChar ();
-
- /**
- * Relative put method for writing a character value.
- *
- * @exception BufferOverflowException If this buffer's current position is
- * not smaller than its limit.
- */
- public abstract ByteBuffer putChar (char value);
-
- /**
- * Absolute get method for reading a character value.
- *
- * @exception IndexOutOfBoundsException If there are fewer than two bytes
- * remaining in this buffer
- */
- public abstract char getChar (int index);
-
- /**
- * Absolute put method for writing a character value.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit, minus one.
- */
- public abstract ByteBuffer putChar (int index, char value);
-
- /**
- * Relative get method for reading a short value.
- *
- * @exception BufferUnderflowException If index is negative or not smaller
- * than the buffer's limit, minus one.
- */
- public abstract short getShort ();
-
- /**
- * Relative put method for writing a short value.
- *
- * @exception BufferOverflowException If this buffer's current position is
- * not smaller than its limit.
- */
- public abstract ByteBuffer putShort (short value);
-
- /**
- * Absolute get method for reading a short value.
- *
- * @exception IndexOutOfBoundsException If there are fewer than two bytes
- * remaining in this buffer
- */
- public abstract short getShort (int index);
-
- /**
- * Absolute put method for writing a short value.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit, minus one.
- */
- public abstract ByteBuffer putShort (int index, short value);
-
- /**
- * Relative get method for reading an integer value.
- *
- * @exception BufferUnderflowException If there are fewer than four bytes
- * remaining in this buffer.
- */
- public abstract int getInt ();
-
- /**
- * Relative put method for writing an integer value.
- *
- * @exception BufferOverflowException If this buffer's current position is
- * not smaller than its limit.
- */
- public abstract ByteBuffer putInt (int value);
-
- /**
- * Absolute get method for reading an integer value.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit, minus three.
- */
- public abstract int getInt (int index);
-
- /**
- * Absolute put method for writing an integer value.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit, minus three.
- */
- public abstract ByteBuffer putInt (int index, int value);
-
- /**
- * Relative get method for reading a long value.
- *
- * @exception BufferUnderflowException If there are fewer than eight bytes
- * remaining in this buffer.
- */
- public abstract long getLong ();
-
- /**
- * Relative put method for writing a long value.
- *
- * @exception BufferOverflowException If this buffer's current position is
- * not smaller than its limit.
- */
- public abstract ByteBuffer putLong (long value);
-
- /**
- * Absolute get method for reading a long value.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit, minus seven.
- */
- public abstract long getLong (int index);
-
- /**
- * Absolute put method for writing a float value.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit, minus seven.
- */
- public abstract ByteBuffer putLong (int index, long value);
-
- /**
- * Relative get method for reading a float value.
- *
- * @exception BufferUnderflowException If there are fewer than four bytes
- * remaining in this buffer.
- */
- public abstract float getFloat ();
-
- /**
- * Relative put method for writing a float value.
- *
- * @exception BufferOverflowException If there are fewer than four bytes
- * remaining in this buffer.
- */
- public abstract ByteBuffer putFloat (float value);
-
- /**
- * Absolute get method for reading a float value.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit, minus three.
- */
- public abstract float getFloat (int index);
-
- /**
- * Relative put method for writing a float value.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit, minus three.
- */
- public abstract ByteBuffer putFloat (int index, float value);
-
- /**
- * Relative get method for reading a double value.
- *
- * @exception BufferUnderflowException If there are fewer than eight bytes
- * remaining in this buffer.
- */
- public abstract double getDouble ();
-
- /**
- * Relative put method for writing a double value.
- *
- * @exception BufferOverflowException If this buffer's current position is
- * not smaller than its limit.
- */
- public abstract ByteBuffer putDouble (double value);
-
- /**
- * Absolute get method for reading a double value.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit, minus seven.
- */
- public abstract double getDouble (int index);
-
- /**
- * Absolute put method for writing a double value.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit, minus seven.
- */
- public abstract ByteBuffer putDouble (int index, double value);
-
- /**
- * Returns a string summarizing the state of this buffer.
- */
- public String toString ()
- {
- return getClass ().getName () +
- "[pos=" + position () +
- " lim=" + limit () +
- " cap=" + capacity () + "]";
- }
-}
diff --git a/libjava/java/nio/ByteBufferHelper.java b/libjava/java/nio/ByteBufferHelper.java
deleted file mode 100644
index 6c46ca5d7ab..00000000000
--- a/libjava/java/nio/ByteBufferHelper.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/* ByteBufferImpl.java --
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-final class ByteBufferHelper
-{
- public static char getChar (ByteBuffer buffer, ByteOrder order)
- {
- return (char) getShort (buffer, order);
- }
-
- public static void putChar (ByteBuffer buffer, char value, ByteOrder order)
- {
- putShort (buffer, (short) value, order);
- }
-
- public static char getChar (ByteBuffer buffer, int index, ByteOrder order)
- {
- return (char) getShort (buffer, index, order);
- }
-
- public static void putChar (ByteBuffer buffer, int index,
- char value, ByteOrder order)
- {
- putShort (buffer, index, (short) value, order);
- }
-
- public static short getShort (ByteBuffer buffer, ByteOrder order)
- {
- buffer.checkForUnderflow(2);
-
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- return (short) ((buffer.get() & 0xff)
- + (buffer.get() << 8));
- }
-
- return (short) ((buffer.get() << 8)
- + (buffer.get() & 0xff));
- }
-
- public static void putShort (ByteBuffer buffer, short value, ByteOrder order)
- {
- buffer.checkForOverflow(2);
-
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- buffer.put ((byte) value);
- buffer.put ((byte) (value >> 8));
- }
- else
- {
- buffer.put ((byte) (value >> 8));
- buffer.put ((byte) value);
- }
- }
-
- public static short getShort (ByteBuffer buffer,
- int index, ByteOrder order)
- {
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- return (short) ((buffer.get (index) & 0xff)
- + (buffer.get (++index) << 8));
- }
-
- return (short) ((buffer.get (index) << 8)
- + (buffer.get (++index) & 0xff));
- }
-
- public static void putShort (ByteBuffer buffer, int index,
- short value, ByteOrder order)
- {
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- buffer.put (index, (byte) value);
- buffer.put (++index, (byte) (value >> 8));
- }
- else
- {
- buffer.put (index, (byte) (value >> 8));
- buffer.put (++index, (byte) value);
- }
- }
-
- public static int getInt (ByteBuffer buffer, ByteOrder order)
- {
- buffer.checkForUnderflow(4);
-
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- return ((buffer.get() & 0xff)
- + ((buffer.get() & 0xff) << 8)
- + ((buffer.get() & 0xff) << 16)
- + (buffer.get() << 24));
- }
-
- return (int) ((buffer.get() << 24)
- + ((buffer.get() & 0xff) << 16)
- + ((buffer.get() & 0xff) << 8)
- + (buffer.get() & 0xff));
- }
-
- public static void putInt (ByteBuffer buffer, int value, ByteOrder order)
- {
- buffer.checkForOverflow(4);
-
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- buffer.put ((byte) value);
- buffer.put ((byte) (value >> 8));
- buffer.put ((byte) (value >> 16));
- buffer.put ((byte) (value >> 24));
- }
- else
- {
- buffer.put ((byte) (value >> 24));
- buffer.put ((byte) (value >> 16));
- buffer.put ((byte) (value >> 8));
- buffer.put ((byte) value);
- }
- }
-
- public static int getInt (ByteBuffer buffer, int index, ByteOrder order)
- {
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- return ((buffer.get (index) & 0xff)
- + ((buffer.get (++index) & 0xff) << 8)
- + ((buffer.get (++index) & 0xff) << 16)
- + (buffer.get (++index) << 24));
- }
-
- return ((buffer.get (index) << 24)
- + ((buffer.get (++index) & 0xff) << 16)
- + ((buffer.get (++index) & 0xff) << 8)
- + (buffer.get (++index) & 0xff));
- }
-
- public static void putInt (ByteBuffer buffer, int index,
- int value, ByteOrder order)
- {
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- buffer.put (index, (byte) value);
- buffer.put (++index, (byte) (value >> 8));
- buffer.put (++index, (byte) (value >> 16));
- buffer.put (++index, (byte) (value >> 24));
- }
- else
- {
- buffer.put (index, (byte) (value >> 24));
- buffer.put (++index, (byte) (value >> 16));
- buffer.put (++index, (byte) (value >> 8));
- buffer.put (++index, (byte) value);
- }
- }
-
- public static long getLong (ByteBuffer buffer, ByteOrder order)
- {
- buffer.checkForUnderflow(8);
-
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- return ((buffer.get() & 0xff)
- + (((buffer.get() & 0xff)) << 8)
- + (((buffer.get() & 0xff)) << 16)
- + (((buffer.get() & 0xffL)) << 24)
- + (((buffer.get() & 0xffL)) << 32)
- + (((buffer.get() & 0xffL)) << 40)
- + (((buffer.get() & 0xffL)) << 48)
- + (((long) buffer.get()) << 56));
- }
-
- return ((((long) buffer.get()) << 56)
- + ((buffer.get() & 0xffL) << 48)
- + ((buffer.get() & 0xffL) << 40)
- + ((buffer.get() & 0xffL) << 32)
- + ((buffer.get() & 0xffL) << 24)
- + ((buffer.get() & 0xff) << 16)
- + ((buffer.get() & 0xff) << 8)
- + (buffer.get() & 0xff));
- }
-
- public static void putLong (ByteBuffer buffer, long value, ByteOrder order)
- {
- buffer.checkForOverflow(8);
-
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- buffer.put ((byte) value);
- buffer.put ((byte) (value >> 8));
- buffer.put ((byte) (value >> 16));
- buffer.put ((byte) (value >> 24));
- buffer.put ((byte) (value >> 32));
- buffer.put ((byte) (value >> 40));
- buffer.put ((byte) (value >> 48));
- buffer.put ((byte) (value >> 56));
- }
- else
- {
- buffer.put ((byte) (value >> 56));
- buffer.put ((byte) (value >> 48));
- buffer.put ((byte) (value >> 40));
- buffer.put ((byte) (value >> 32));
- buffer.put ((byte) (value >> 24));
- buffer.put ((byte) (value >> 16));
- buffer.put ((byte) (value >> 8));
- buffer.put ((byte) value);
- }
- }
-
- public static long getLong (ByteBuffer buffer, int index, ByteOrder order)
- {
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- return ((buffer.get (index) & 0xff)
- + ((buffer.get (++index) & 0xff) << 8)
- + ((buffer.get (++index) & 0xff) << 16)
- + ((buffer.get (++index) & 0xffL) << 24)
- + ((buffer.get (++index) & 0xffL) << 32)
- + ((buffer.get (++index) & 0xffL) << 40)
- + ((buffer.get (++index) & 0xffL) << 48)
- + (((long) buffer.get (++index)) << 56));
- }
-
- return ((((long) buffer.get (index)) << 56)
- + ((buffer.get (++index) & 0xffL) << 48)
- + ((buffer.get (++index) & 0xffL) << 40)
- + ((buffer.get (++index) & 0xffL) << 32)
- + ((buffer.get (++index) & 0xffL) << 24)
- + ((buffer.get (++index) & 0xff) << 16)
- + ((buffer.get (++index) & 0xff) << 8)
- + (buffer.get (++index) & 0xff));
- }
-
- public static void putLong (ByteBuffer buffer, int index,
- long value, ByteOrder order)
- {
- if (order == ByteOrder.LITTLE_ENDIAN)
- {
- buffer.put (index, (byte) value);
- buffer.put (++index, (byte) (value >> 8));
- buffer.put (++index, (byte) (value >> 16));
- buffer.put (++index, (byte) (value >> 24));
- buffer.put (++index, (byte) (value >> 32));
- buffer.put (++index, (byte) (value >> 40));
- buffer.put (++index, (byte) (value >> 48));
- buffer.put (++index, (byte) (value >> 56));
- }
- else
- {
- buffer.put (index, (byte) (value >> 56));
- buffer.put (++index, (byte) (value >> 48));
- buffer.put (++index, (byte) (value >> 40));
- buffer.put (++index, (byte) (value >> 32));
- buffer.put (++index, (byte) (value >> 24));
- buffer.put (++index, (byte) (value >> 16));
- buffer.put (++index, (byte) (value >> 8));
- buffer.put (++index, (byte) value);
- }
- }
-
- public static float getFloat (ByteBuffer buffer, ByteOrder order)
- {
- return Float.intBitsToFloat (getInt (buffer, order));
- }
-
- public static void putFloat (ByteBuffer buffer, float value, ByteOrder order)
- {
- putInt (buffer, Float.floatToRawIntBits (value), order);
- }
-
- public static float getFloat (ByteBuffer buffer, int index, ByteOrder order)
- {
- return Float.intBitsToFloat (getInt (buffer, index, order));
- }
-
- public static void putFloat (ByteBuffer buffer, int index,
- float value, ByteOrder order)
- {
- putInt (buffer, index, Float.floatToRawIntBits (value), order);
- }
-
- public static double getDouble (ByteBuffer buffer, ByteOrder order)
- {
- return Double.longBitsToDouble (getLong (buffer, order));
- }
-
- public static void putDouble (ByteBuffer buffer, double value, ByteOrder order)
- {
- putLong (buffer, Double.doubleToRawLongBits (value), order);
- }
-
- public static double getDouble (ByteBuffer buffer, int index, ByteOrder order)
- {
- return Double.longBitsToDouble (getLong (buffer, index, order));
- }
-
- public static void putDouble (ByteBuffer buffer, int index,
- double value, ByteOrder order)
- {
- putLong (buffer, index, Double.doubleToRawLongBits (value), order);
- }
-} // ByteBufferHelper
-
diff --git a/libjava/java/nio/ByteBufferImpl.java b/libjava/java/nio/ByteBufferImpl.java
deleted file mode 100644
index 48d7152000b..00000000000
--- a/libjava/java/nio/ByteBufferImpl.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/* ByteBufferImpl.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * This is a Heap memory implementation
- */
-final class ByteBufferImpl extends ByteBuffer
-{
- private boolean readOnly;
-
- ByteBufferImpl (byte[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
- {
- super (capacity, limit, position, mark);
- this.backing_buffer = buffer;
- this.array_offset = offset;
- this.readOnly = readOnly;
- }
-
- public CharBuffer asCharBuffer ()
- {
- return new CharViewBufferImpl (this, remaining() >> 1);
- }
-
- public ShortBuffer asShortBuffer ()
- {
- return new ShortViewBufferImpl (this, remaining() >> 1);
- }
-
- public IntBuffer asIntBuffer ()
- {
- return new IntViewBufferImpl (this, remaining() >> 2);
- }
-
- public LongBuffer asLongBuffer ()
- {
- return new LongViewBufferImpl (this, remaining() >> 3);
- }
-
- public FloatBuffer asFloatBuffer ()
- {
- return new FloatViewBufferImpl (this, remaining() >> 2);
- }
-
- public DoubleBuffer asDoubleBuffer ()
- {
- return new DoubleViewBufferImpl (this, remaining() >> 3);
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public ByteBuffer slice ()
- {
- return new ByteBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
- }
-
- public ByteBuffer duplicate ()
- {
- return new ByteBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
- }
-
- public ByteBuffer asReadOnlyBuffer ()
- {
- return new ByteBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
- }
-
- void shiftDown (int dst_offset, int src_offset, int count)
- {
- System.arraycopy(backing_buffer, array_offset + src_offset,
- backing_buffer, array_offset + dst_offset,
- count);
- }
-
- public ByteBuffer compact ()
- {
- checkIfReadOnly();
- mark = -1;
- int pos = position();
- if (pos > 0)
- {
- int count = remaining();
- shiftDown(0, pos, count);
- position(count);
- limit(capacity());
- }
- else
- {
- position(limit());
- limit(capacity());
- }
- return this;
- }
-
- public boolean isDirect ()
- {
- return false;
- }
-
- /**
- * Reads the <code>byte</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>bytes</code> in this buffer.
- */
- public byte get ()
- {
- if (pos >= limit)
- throw new BufferUnderflowException();
-
- return backing_buffer [(pos++) + array_offset];
- }
-
- /**
- * Bulk get
- */
- public ByteBuffer get (byte[] dst, int offset, int length)
- {
- checkArraySize(dst.length, offset, length);
- if ( (limit - pos) < length) // check for overflow
- throw new BufferUnderflowException();
-
- System.arraycopy(backing_buffer, pos + array_offset,
- dst, offset, length);
- pos += length;
-
- return this;
- }
-
- /**
- * Relative bulk put(), overloads the ByteBuffer impl.
- */
- public ByteBuffer put (byte[] src, int offset, int length)
- {
- if ( (limit - pos) < length) // check for overflow
- throw new BufferOverflowException();
- checkArraySize(src.length, offset, length);
-
- System.arraycopy(src, offset, backing_buffer, pos + array_offset, length);
- pos += length;
-
- return this;
- }
-
- /**
- * Relative put method. Writes <code>value</code> to the next position
- * in the buffer.
- *
- * @exception BufferOverflowException If there is no remaining
- * space in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public ByteBuffer put (byte value)
- {
- if (readOnly)
- throw new ReadOnlyBufferException();
- if (pos >= limit)
- throw new BufferOverflowException();
-
- backing_buffer [(pos++) + array_offset] = value;
- return this;
- }
-
- /**
- * Absolute get method. Reads the <code>byte</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public byte get (int index)
- {
- checkIndex(index);
-
- return backing_buffer [index + array_offset];
- }
-
- /**
- * Absolute put method. Writes <code>value</code> to position
- * <code>index</code> in the buffer.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public ByteBuffer put (int index, byte value)
- {
- checkIfReadOnly();
- checkIndex(index);
-
- backing_buffer [index + array_offset] = value;
- return this;
- }
-
- public char getChar ()
- {
- return ByteBufferHelper.getChar(this, order());
- }
-
- public ByteBuffer putChar (char value)
- {
- if (readOnly)
- throw new ReadOnlyBufferException ();
- if ( (limit-pos) < 2)
- throw new BufferOverflowException();
-
- if (endian == ByteOrder.LITTLE_ENDIAN)
- {
- backing_buffer [(pos++) + array_offset] = (byte)(value&0xFF);
- backing_buffer [(pos++) + array_offset] = (byte)(value>>8);
- }
- else
- {
- backing_buffer [(pos++) + array_offset] = (byte)(value>>8);
- backing_buffer [(pos++) + array_offset] = (byte)(value&0xFF);
- }
- return this;
- }
-
- public char getChar (int index)
- {
- return ByteBufferHelper.getChar(this, index, order());
- }
-
- public ByteBuffer putChar (int index, char value)
- {
- ByteBufferHelper.putChar(this, index, value, order());
- return this;
- }
-
- public short getShort ()
- {
- return ByteBufferHelper.getShort(this, order());
- }
-
- public ByteBuffer putShort (short value)
- {
- ByteBufferHelper.putShort(this, value, order());
- return this;
- }
-
- public short getShort (int index)
- {
- return ByteBufferHelper.getShort(this, index, order());
- }
-
- public ByteBuffer putShort (int index, short value)
- {
- ByteBufferHelper.putShort(this, index, value, order());
- return this;
- }
-
- public int getInt ()
- {
- return ByteBufferHelper.getInt(this, order());
- }
-
- public ByteBuffer putInt (int value)
- {
- ByteBufferHelper.putInt(this, value, order());
- return this;
- }
-
- public int getInt (int index)
- {
- return ByteBufferHelper.getInt(this, index, order());
- }
-
- public ByteBuffer putInt (int index, int value)
- {
- ByteBufferHelper.putInt(this, index, value, order());
- return this;
- }
-
- public long getLong ()
- {
- return ByteBufferHelper.getLong(this, order());
- }
-
- public ByteBuffer putLong (long value)
- {
- ByteBufferHelper.putLong (this, value, order());
- return this;
- }
-
- public long getLong (int index)
- {
- return ByteBufferHelper.getLong (this, index, order());
- }
-
- public ByteBuffer putLong (int index, long value)
- {
- ByteBufferHelper.putLong (this, index, value, order());
- return this;
- }
-
- public float getFloat ()
- {
- return ByteBufferHelper.getFloat (this, order());
- }
-
- public ByteBuffer putFloat (float value)
- {
- ByteBufferHelper.putFloat (this, value, order());
- return this;
- }
-
- public float getFloat (int index)
- {
- return ByteBufferHelper.getFloat (this, index, order());
- }
-
- public ByteBuffer putFloat (int index, float value)
- {
- ByteBufferHelper.putFloat (this, index, value, order());
- return this;
- }
-
- public double getDouble ()
- {
- return ByteBufferHelper.getDouble (this, order());
- }
-
- public ByteBuffer putDouble (double value)
- {
- ByteBufferHelper.putDouble (this, value, order());
- return this;
- }
-
- public double getDouble (int index)
- {
- return ByteBufferHelper.getDouble (this, index, order());
- }
-
- public ByteBuffer putDouble (int index, double value)
- {
- ByteBufferHelper.putDouble (this, index, value, order());
- return this;
- }
-}
diff --git a/libjava/java/nio/ByteOrder.java b/libjava/java/nio/ByteOrder.java
deleted file mode 100644
index 39a3ff893bd..00000000000
--- a/libjava/java/nio/ByteOrder.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* ByteOrder.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- * @since 1.4
- */
-public final class ByteOrder
-{
- /**
- * Constant indicating big endian byte order.
- */
- public static final ByteOrder BIG_ENDIAN = new ByteOrder();
-
- /**
- * Constant indicating little endian byte order.
- */
- public static final ByteOrder LITTLE_ENDIAN = new ByteOrder();
-
- /**
- * Returns the native byte order of the platform currently running.
- *
- * @return the native byte order
- */
- public static ByteOrder nativeOrder()
- {
- return (System.getProperty ("gnu.cpu.endian").equals("big")
- ? BIG_ENDIAN : LITTLE_ENDIAN);
- }
-
- /**
- * Returns a string representation of the byte order.
- *
- * @return the string
- */
- public String toString()
- {
- return this == BIG_ENDIAN ? "BIG_ENDIAN" : "LITTLE_ENDIAN";
- }
-
- // This class can only be instantiated here.
- private ByteOrder()
- {
- }
-}
diff --git a/libjava/java/nio/CharBuffer.java b/libjava/java/nio/CharBuffer.java
deleted file mode 100644
index 6551555e20b..00000000000
--- a/libjava/java/nio/CharBuffer.java
+++ /dev/null
@@ -1,508 +0,0 @@
-/* CharBuffer.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @since 1.4
- */
-public abstract class CharBuffer extends Buffer
- implements Comparable, CharSequence
-{
- int array_offset;
- char[] backing_buffer;
-
- CharBuffer (int capacity, int limit, int position, int mark)
- {
- super (capacity, limit, position, mark);
- array_offset = 0;
- }
-
- /**
- * Allocates a new <code>CharBuffer</code> object with a given capacity.
- */
- public static CharBuffer allocate (int capacity)
- {
- return new CharBufferImpl (capacity);
- }
-
- /**
- * Wraps a <code>char</code> array into a <code>CharBuffer</code>
- * object.
- *
- * @param array the array to wrap
- * @param offset the offset of the region in the array to wrap
- * @param length the length of the region in the array to wrap
- *
- * @return a new <code>CharBuffer</code> object
- *
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- */
- public static final CharBuffer wrap(char[] array, int offset, int length)
- {
- return new CharBufferImpl(array, 0, array.length, offset + length, offset, -1, false);
- }
-
- /**
- * Wraps a character sequence into a <code>CharBuffer</code> object.
- *
- * @param seq the sequence to wrap
- *
- * @return a new <code>CharBuffer</code> object
- */
- public static final CharBuffer wrap(CharSequence seq)
- {
- return wrap(seq, 0, seq.length());
- }
-
- /**
- * Wraps a character sequence into a <code>CharBuffer</code> object.
- *
- * @param seq the sequence to wrap
- * @param start the index of the first character to wrap
- * @param end the index of the first character not to wrap
- *
- * @return a new <code>CharBuffer</code> object
- *
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- */
- public static final CharBuffer wrap(CharSequence seq, int start, int end)
- {
- // FIXME: implement better handling of java.lang.String.
- // Probably share data with String via reflection.
-
- if ((start < 0)
- || (start > seq.length())
- || (end < start)
- || (end > (seq.length() - start)))
- throw new IndexOutOfBoundsException();
-
- int len = end - start;
- char[] buffer = new char[len];
-
- for (int i = 0; i < len; i++)
- buffer[i] = seq.charAt(i + start);
-
- return wrap(buffer, 0, len).asReadOnlyBuffer();
- }
-
- /**
- * Wraps a <code>char</code> array into a <code>CharBuffer</code>
- * object.
- *
- * @param array the array to wrap
- *
- * @return a new <code>CharBuffer</code> object
- */
- public static final CharBuffer wrap(char[] array)
- {
- return wrap(array, 0, array.length);
- }
-
- /**
- * This method transfers <code>char</code>s from this buffer into the given
- * destination array. Before the transfer, it checks if there are fewer than
- * length <code>char</code>s remaining in this buffer.
- *
- * @param dst The destination array
- * @param offset The offset within the array of the first <code>char</code>
- * to be written; must be non-negative and no larger than dst.length.
- * @param length The maximum number of bytes to be written to the given array;
- * must be non-negative and no larger than dst.length - offset.
- *
- * @exception BufferUnderflowException If there are fewer than length
- * <code>char</code>s remaining in this buffer.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold.
- */
- public CharBuffer get (char[] dst, int offset, int length)
- {
- checkArraySize(dst.length, offset, length);
- checkForUnderflow(length);
-
- for (int i = offset; i < offset + length; i++)
- {
- dst [i] = get ();
- }
-
- return this;
- }
-
- /**
- * This method transfers <code>char</code>s from this buffer into the given
- * destination array.
- *
- * @param dst The byte array to write into.
- *
- * @exception BufferUnderflowException If there are fewer than dst.length
- * <code>char</code>s remaining in this buffer.
- */
- public CharBuffer get (char[] dst)
- {
- return get (dst, 0, dst.length);
- }
-
- /**
- * Writes the content of the the <code>CharBUFFER</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * <code>src.remaining()</code> space remaining in this buffer.
- *
- * @param src The source data.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>char</code>s in the source buffer.
- * @exception IllegalArgumentException If the source buffer is this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public CharBuffer put (CharBuffer src)
- {
- if (src == this)
- throw new IllegalArgumentException ();
-
- checkForOverflow(src.remaining());
-
- if (src.remaining () > 0)
- {
- char[] toPut = new char [src.remaining ()];
- src.get (toPut);
- put (toPut);
- }
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>char array</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * length space remaining in this buffer.
- *
- * @param src The array to copy into the buffer.
- * @param offset The offset within the array of the first byte to be read;
- * must be non-negative and no larger than src.length.
- * @param length The number of bytes to be read from the given array;
- * must be non-negative and no larger than src.length - offset.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>char</code>s in the source array.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public CharBuffer put (char[] src, int offset, int length)
- {
- checkArraySize(src.length, offset, length);
- checkForOverflow(length);
-
- for (int i = offset; i < offset + length; i++)
- put (src [i]);
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>char array</code> src
- * into the buffer.
- *
- * @param src The array to copy into the buffer.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>char</code>s in the source array.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public final CharBuffer put (char[] src)
- {
- return put (src, 0, src.length);
- }
-
- /**
- * Tells whether ot not this buffer is backed by an accessible
- * <code>char</code> array.
- */
- public final boolean hasArray ()
- {
- return (backing_buffer != null
- && !isReadOnly ());
- }
-
- /**
- * Returns the <code>char</code> array that backs this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final char[] array ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return backing_buffer;
- }
-
- /**
- * Returns the offset within this buffer's backing array of the first element.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final int arrayOffset ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return array_offset;
- }
-
- /**
- * Calculates a hash code for this buffer.
- *
- * This is done with int arithmetic,
- * where ** represents exponentiation, by this formula:<br>
- * <code>s[position()] + 31 + (s[position()+1] + 30)*31**1 + ... +
- * (s[limit()-1]+30)*31**(limit()-1)</code>.
- * Where s is the buffer data. Note that the hashcode is dependent
- * on buffer content, and therefore is not useful if the buffer
- * content may change.
- */
- public int hashCode ()
- {
- int hashCode = get(position()) + 31;
- int multiplier = 1;
- for (int i = position() + 1; i < limit(); ++i)
- {
- multiplier *= 31;
- hashCode += (get(i) + 30)*multiplier;
- }
- return hashCode;
- }
-
- /**
- * Checks if this buffer is equal to obj.
- */
- public boolean equals (Object obj)
- {
- if (obj instanceof CharBuffer)
- {
- return compareTo (obj) == 0;
- }
-
- return false;
- }
-
- /**
- * Compares two <code>CharBuffer</code> objects.
- *
- * @exception ClassCastException If obj is not an object derived from
- * <code>CharBuffer</code>.
- */
- public int compareTo (Object obj)
- {
- CharBuffer other = (CharBuffer) obj;
-
- int num = Math.min(remaining(), other.remaining());
- int pos_this = position();
- int pos_other = other.position();
-
- for (int count = 0; count < num; count++)
- {
- char a = get(pos_this++);
- char b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
- }
-
- return remaining() - other.remaining();
- }
-
- /**
- * Returns the byte order of this buffer.
- */
- public abstract ByteOrder order ();
-
- /**
- * Reads the <code>char</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>char</code>s in this buffer.
- */
- public abstract char get ();
-
- /**
- * Writes the <code>char</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferOverflowException If there no remaining
- * <code>char</code>s in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract CharBuffer put (char b);
-
- /**
- * Absolute get method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public abstract char get (int index);
-
- /**
- * Absolute put method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract CharBuffer put (int index, char b);
-
- /**
- * Compacts this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract CharBuffer compact ();
-
- /**
- * Tells wether or not this buffer is direct.
- */
- public abstract boolean isDirect ();
-
- /**
- * Creates a new <code>CharBuffer</code> whose content is a shared
- * subsequence of this buffer's content.
- */
- public abstract CharBuffer slice ();
-
- /**
- * Creates a new <code>CharBuffer</code> that shares this buffer's
- * content.
- */
- public abstract CharBuffer duplicate ();
-
- /**
- * Creates a new read-only <code>CharBuffer</code> that shares this
- * buffer's content.
- */
- public abstract CharBuffer asReadOnlyBuffer ();
-
- /**
- * Returns the remaining content of the buffer as a string.
- */
- public String toString ()
- {
- if (hasArray ())
- return new String (array (), position (), length ());
-
- char[] buf = new char [length ()];
- int pos = position ();
- get (buf, 0, buf.length);
- position (pos);
- return new String (buf);
- }
-
- /**
- * Returns the length of the remaining chars in this buffer.
- */
- public final int length ()
- {
- return remaining ();
- }
-
- /**
- * Creates a new character buffer that represents the specified subsequence
- * of this buffer, relative to the current position.
- *
- * @exception IndexOutOfBoundsException If the preconditions on start and
- * end do not hold.
- */
- public abstract CharSequence subSequence (int start, int length);
-
- /**
- * Relative put method.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer.
- * @exception IndexOutOfBoundsException If the preconditions on the start
- * and end parameters do not hold.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public CharBuffer put (String str, int start, int length)
- {
- return put (str.toCharArray (), start, length);
- }
-
- /**
- * Relative put method.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public final CharBuffer put (String str)
- {
- return put (str.toCharArray (), 0, str.length ());
- }
-
- /**
- * Returns the character at <code>position() + index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative not smaller than
- * <code>remaining()</code>.
- */
- public final char charAt (int index)
- {
- if (index < 0
- || index >= remaining ())
- throw new IndexOutOfBoundsException ();
-
- return get (position () + index);
- }
-}
diff --git a/libjava/java/nio/CharBufferImpl.java b/libjava/java/nio/CharBufferImpl.java
deleted file mode 100644
index 33f8dab983f..00000000000
--- a/libjava/java/nio/CharBufferImpl.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/* CharBufferImpl.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * This is a Heap memory implementation
- */
-final class CharBufferImpl extends CharBuffer
-{
- private boolean readOnly;
-
- CharBufferImpl (int capacity)
- {
- this (new char [capacity], 0, capacity, capacity, 0, -1, false);
- }
-
- CharBufferImpl (char[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
- {
- super (capacity, limit, position, mark);
- this.backing_buffer = buffer;
- this.array_offset = offset;
- this.readOnly = readOnly;
- }
-
- public CharBufferImpl (CharBufferImpl copy)
- {
- super (copy.capacity (), copy.limit (), copy.position (), 0);
- backing_buffer = copy.backing_buffer;
- array_offset = copy.array_offset;
- readOnly = copy.isReadOnly ();
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public CharBuffer slice ()
- {
- return new CharBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
- }
-
- public CharBuffer duplicate ()
- {
- return new CharBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
- }
-
- public CharBuffer asReadOnlyBuffer ()
- {
- return new CharBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
- }
-
- public CharBuffer compact ()
- {
- checkIfReadOnly();
- mark = -1;
- int copied = 0;
-
- while (remaining () > 0)
- {
- put (copied, get ());
- copied++;
- }
-
- position (copied);
- limit(capacity());
- return this;
- }
-
- public boolean isDirect ()
- {
- return false;
- }
-
- public CharSequence subSequence (int start, int end)
- {
- if (start < 0
- || start > length ()
- || end < start
- || end > length ())
- throw new IndexOutOfBoundsException ();
-
- return new CharBufferImpl (backing_buffer, array_offset, capacity (), position () + end, position () + start, -1, isReadOnly ());
- }
-
- /**
- * Reads the <code>char</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>char</code>s in this buffer.
- */
- public char get ()
- {
- if (pos >= limit)
- throw new BufferUnderflowException();
-
- return backing_buffer [(pos++) + array_offset];
- }
-
- /**
- * Relative put method. Writes <code>value</code> to the next position
- * in the buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public CharBuffer put (char value)
- {
- if (readOnly)
- throw new ReadOnlyBufferException();
- if (pos >= limit)
- throw new BufferOverflowException();
-
- backing_buffer [(pos++) + array_offset] = value;
- return this;
- }
-
- /**
- * Absolute get method. Reads the <code>char</code> at position
- * <code>index</code>.
- *
- * @param index Position to read the <code>char</code> from.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public char get (int index)
- {
- checkIndex(index);
-
- return backing_buffer [index + array_offset];
- }
-
- /**
- * Bulk get, overloaded for speed.
- */
- public CharBuffer get (char[] dst, int offset, int length)
- {
- checkArraySize(dst.length, offset, length);
- checkForUnderflow(length);
-
- System.arraycopy(backing_buffer, pos + array_offset,
- dst, offset, length);
- pos += length;
- return this;
- }
-
- /**
- * Bulk put, overloaded for speed.
- */
- public CharBuffer put (char[] src, int offset, int length)
- {
- checkArraySize(src.length, offset, length);
- checkForOverflow(length);
-
- System.arraycopy(src, offset,
- backing_buffer, pos + array_offset, length);
- pos += length;
- return this;
- }
-
- /**
- * Absolute put method. Writes <code>value</code> to position
- * <code>index</code> in the buffer.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public CharBuffer put (int index, char value)
- {
- checkIndex(index);
- checkIfReadOnly();
-
- backing_buffer [index + array_offset] = value;
- return this;
- }
-
- public ByteOrder order ()
- {
- return ByteOrder.nativeOrder ();
- }
-}
diff --git a/libjava/java/nio/CharViewBufferImpl.java b/libjava/java/nio/CharViewBufferImpl.java
deleted file mode 100644
index 31983154461..00000000000
--- a/libjava/java/nio/CharViewBufferImpl.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/* CharViewBufferImpl.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-class CharViewBufferImpl extends CharBuffer
-{
- /** Position in bb (i.e. a byte offset) where this buffer starts. */
- private int offset;
- private ByteBuffer bb;
- private boolean readOnly;
- private ByteOrder endian;
-
- CharViewBufferImpl (ByteBuffer bb, int capacity)
- {
- super (capacity, capacity, 0, -1);
- this.bb = bb;
- this.offset = bb.position();
- this.readOnly = bb.isReadOnly();
- this.endian = bb.order();
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- public CharViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
- {
- super (capacity, limit, position, mark);
- this.bb = bb;
- this.offset = offset;
- this.readOnly = readOnly;
- this.endian = endian;
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- /**
- * Reads the <code>char</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>char</code>s in this buffer.
- */
- public char get ()
- {
- int p = position();
- char result = ByteBufferHelper.getChar(bb, (p << 1) + offset, endian);
- position(p + 1);
- return result;
- }
-
- /**
- * Absolute get method. Reads the <code>char</code> at position
- * <code>index</code>.
- *
- * @param index Position to read the <code>char</code> from.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public char get (int index)
- {
- return ByteBufferHelper.getChar(bb, (index << 1) + offset, endian);
- }
-
- public CharBuffer put (char value)
- {
- int p = position();
- ByteBufferHelper.putChar(bb, (p << 1) + offset, value, endian);
- position(p + 1);
- return this;
- }
-
- public CharBuffer put (int index, char value)
- {
- ByteBufferHelper.putChar(bb, (index << 1) + offset, value, endian);
- return this;
- }
-
- public CharBuffer compact ()
- {
- if (position () > 0)
- {
- int count = limit () - position ();
- bb.shiftDown(offset, offset + 2 * position(), 2 * count);
- position (count);
- limit (capacity ());
- }
- else
- {
- position(limit());
- limit(capacity());
- }
- return this;
- }
-
- public CharBuffer slice ()
- {
- // Create a sliced copy of this object that shares its content.
- return new CharViewBufferImpl (bb, (position () >> 1) + offset,
- remaining (), remaining (), 0, -1,
- isReadOnly (), endian);
- }
-
- CharBuffer duplicate (boolean readOnly)
- {
- int pos = position();
- reset();
- int mark = position();
- position(pos);
- return new CharViewBufferImpl (bb, offset, capacity(), limit(),
- pos, mark, readOnly, endian);
- }
-
- public CharBuffer duplicate ()
- {
- return duplicate(readOnly);
- }
-
- public CharBuffer asReadOnlyBuffer ()
- {
- return duplicate(true);
- }
-
- public CharSequence subSequence (int start, int end)
- {
- if (start < 0
- || end < start
- || end > length ())
- throw new IndexOutOfBoundsException ();
-
- return new CharViewBufferImpl (bb, array_offset, capacity (),
- position () + end, position () + start,
- -1, isReadOnly (), endian);
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public boolean isDirect ()
- {
- return bb.isDirect ();
- }
-
- public ByteOrder order ()
- {
- return endian;
- }
-}
diff --git a/libjava/java/nio/DoubleBuffer.java b/libjava/java/nio/DoubleBuffer.java
deleted file mode 100644
index 381bb716636..00000000000
--- a/libjava/java/nio/DoubleBuffer.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/* DoubleBuffer.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @since 1.4
- */
-public abstract class DoubleBuffer extends Buffer
- implements Comparable
-{
- int array_offset;
- double[] backing_buffer;
-
- DoubleBuffer (int capacity, int limit, int position, int mark)
- {
- super (capacity, limit, position, mark);
- array_offset = 0;
- }
-
- /**
- * Allocates a new <code>DoubleBuffer</code> object with a given capacity.
- */
- public static DoubleBuffer allocate (int capacity)
- {
- return new DoubleBufferImpl (capacity);
- }
-
- /**
- * Wraps a <code>double</code> array into a <code>DoubleBuffer</code>
- * object.
- *
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- */
- public static final DoubleBuffer wrap (double[] array, int offset, int length)
- {
- return new DoubleBufferImpl (array, 0, array.length, offset + length, offset, -1, false);
- }
-
- /**
- * Wraps a <code>double</code> array into a <code>DoubleBuffer</code>
- * object.
- */
- public static final DoubleBuffer wrap (double[] array)
- {
- return wrap (array, 0, array.length);
- }
-
- /**
- * This method transfers <code>double</code>s from this buffer into the given
- * destination array. Before the transfer, it checks if there are fewer than
- * length <code>double</code>s remaining in this buffer.
- *
- * @param dst The destination array
- * @param offset The offset within the array of the first <code>double</code>
- * to be written; must be non-negative and no larger than dst.length.
- * @param length The maximum number of bytes to be written to the given array;
- * must be non-negative and no larger than dst.length - offset.
- *
- * @exception BufferUnderflowException If there are fewer than length
- * <code>double</code>s remaining in this buffer.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold.
- */
- public DoubleBuffer get (double[] dst, int offset, int length)
- {
- checkArraySize(dst.length, offset, length);
- checkForUnderflow(length);
-
- for (int i = offset; i < offset + length; i++)
- {
- dst [i] = get ();
- }
-
- return this;
- }
-
- /**
- * This method transfers <code>double</code>s from this buffer into the given
- * destination array.
- *
- * @param dst The byte array to write into.
- *
- * @exception BufferUnderflowException If there are fewer than dst.length
- * <code>double</code>s remaining in this buffer.
- */
- public DoubleBuffer get (double[] dst)
- {
- return get (dst, 0, dst.length);
- }
-
- /**
- * Writes the content of the the <code>DoubleBUFFER</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * <code>src.remaining()</code> space remaining in this buffer.
- *
- * @param src The source data.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>double</code>s in the source buffer.
- * @exception IllegalArgumentException If the source buffer is this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public DoubleBuffer put (DoubleBuffer src)
- {
- if (src == this)
- throw new IllegalArgumentException ();
-
- checkForOverflow(src.remaining ());
-
- if (src.remaining () > 0)
- {
- double[] toPut = new double [src.remaining ()];
- src.get (toPut);
- put (toPut);
- }
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>double array</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * length space remaining in this buffer.
- *
- * @param src The array to copy into the buffer.
- * @param offset The offset within the array of the first byte to be read;
- * must be non-negative and no larger than src.length.
- * @param length The number of bytes to be read from the given array;
- * must be non-negative and no larger than src.length - offset.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>double</code>s in the source array.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public DoubleBuffer put (double[] src, int offset, int length)
- {
- checkArraySize(src.length, offset, length);
- checkForOverflow(length);
-
- for (int i = offset; i < offset + length; i++)
- put (src [i]);
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>double array</code> src
- * into the buffer.
- *
- * @param src The array to copy into the buffer.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>double</code>s in the source array.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public final DoubleBuffer put (double[] src)
- {
- return put (src, 0, src.length);
- }
-
- /**
- * Tells whether ot not this buffer is backed by an accessible
- * <code>double</code> array.
- */
- public final boolean hasArray ()
- {
- return (backing_buffer != null
- && !isReadOnly ());
- }
-
- /**
- * Returns the <code>double</code> array that backs this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final double[] array ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return backing_buffer;
- }
-
- /**
- * Returns the offset within this buffer's backing array of the first element.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final int arrayOffset ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return array_offset;
- }
-
- /**
- * Calculates a hash code for this buffer.
- *
- * This is done with <code>long</code> arithmetic,
- * where ** represents exponentiation, by this formula:<br>
- * <code>s[position()] + 31 + (s[position()+1] + 30)*31**1 + ... +
- * (s[limit()-1]+30)*31**(limit()-1)</code>.
- * Where s is the buffer data, in Double.doubleToLongBits() form
- * Note that the hashcode is dependent on buffer content,
- * and therefore is not useful if the buffer content may change.
- *
- * @return the hash code (casted to int)
- */
- public int hashCode ()
- {
- long hashCode = Double.doubleToLongBits(get(position())) + 31;
- long multiplier = 1;
- for (int i = position() + 1; i < limit(); ++i)
- {
- multiplier *= 31;
- hashCode += (Double.doubleToLongBits(get(i)) + 30)*multiplier;
- }
- return ((int)hashCode);
- }
-
- /**
- * Checks if this buffer is equal to obj.
- */
- public boolean equals (Object obj)
- {
- if (obj instanceof DoubleBuffer)
- {
- return compareTo (obj) == 0;
- }
-
- return false;
- }
-
- /**
- * Compares two <code>DoubleBuffer</code> objects.
- *
- * @exception ClassCastException If obj is not an object derived from
- * <code>DoubleBuffer</code>.
- */
- public int compareTo (Object obj)
- {
- DoubleBuffer other = (DoubleBuffer) obj;
-
- int num = Math.min(remaining(), other.remaining());
- int pos_this = position();
- int pos_other = other.position();
-
- for (int count = 0; count < num; count++)
- {
- double a = get(pos_this++);
- double b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
- }
-
- return remaining() - other.remaining();
- }
-
- /**
- * Returns the byte order of this buffer.
- */
- public abstract ByteOrder order ();
-
- /**
- * Reads the <code>double</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>double</code>s in this buffer.
- */
- public abstract double get ();
-
- /**
- * Writes the <code>double</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferOverflowException If there no remaining
- * <code>double</code>s in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract DoubleBuffer put (double b);
-
- /**
- * Absolute get method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public abstract double get (int index);
-
- /**
- * Absolute put method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract DoubleBuffer put (int index, double b);
-
- /**
- * Compacts this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract DoubleBuffer compact ();
-
- /**
- * Tells wether or not this buffer is direct.
- */
- public abstract boolean isDirect ();
-
- /**
- * Creates a new <code>DoubleBuffer</code> whose content is a shared
- * subsequence of this buffer's content.
- */
- public abstract DoubleBuffer slice ();
-
- /**
- * Creates a new <code>DoubleBuffer</code> that shares this buffer's
- * content.
- */
- public abstract DoubleBuffer duplicate ();
-
- /**
- * Creates a new read-only <code>DoubleBuffer</code> that shares this
- * buffer's content.
- */
- public abstract DoubleBuffer asReadOnlyBuffer ();
-}
diff --git a/libjava/java/nio/DoubleBufferImpl.java b/libjava/java/nio/DoubleBufferImpl.java
deleted file mode 100644
index 248ab45e7c2..00000000000
--- a/libjava/java/nio/DoubleBufferImpl.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/* DoubleBufferImpl.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * This is a Heap memory implementation
- */
-final class DoubleBufferImpl extends DoubleBuffer
-{
- private boolean readOnly;
-
- DoubleBufferImpl (int capacity)
- {
- this (new double [capacity], 0, capacity, capacity, 0, -1, false);
- }
-
- DoubleBufferImpl (double[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
- {
- super (capacity, limit, position, mark);
- this.backing_buffer = buffer;
- this.array_offset = offset;
- this.readOnly = readOnly;
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public DoubleBuffer slice ()
- {
- return new DoubleBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
- }
-
- public DoubleBuffer duplicate ()
- {
- return new DoubleBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
- }
-
- public DoubleBuffer asReadOnlyBuffer ()
- {
- return new DoubleBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
- }
-
- public DoubleBuffer compact ()
- {
- checkIfReadOnly();
- mark = -1;
- int copied = 0;
-
- while (remaining () > 0)
- {
- put (copied, get ());
- copied++;
- }
-
- position (copied);
- limit(capacity());
- return this;
- }
-
- public boolean isDirect ()
- {
- return false;
- }
-
- /**
- * Reads the <code>double</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>double</code>s in this buffer.
- */
- public double get ()
- {
- checkForUnderflow();
-
- double result = backing_buffer [position ()];
- position (position () + 1);
- return result;
- }
-
- /**
- * Relative put method. Writes <code>value</code> to the next position
- * in the buffer.
- *
- * @exception BufferOverflowException If there no remaining
- * space in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public DoubleBuffer put (double value)
- {
- checkIfReadOnly();
- checkForOverflow();
-
- backing_buffer [position ()] = value;
- position (position () + 1);
- return this;
- }
-
- /**
- * Absolute get method. Reads the <code>double</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public double get (int index)
- {
- checkIndex(index);
-
- return backing_buffer [index];
- }
-
- /**
- * Absolute put method. Writes <code>value</code> to position
- * <code>index</code> in the buffer.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public DoubleBuffer put (int index, double value)
- {
- checkIfReadOnly();
- checkIndex(index);
-
- backing_buffer [index] = value;
- return this;
- }
-
- public ByteOrder order ()
- {
- return ByteOrder.nativeOrder ();
- }
-}
diff --git a/libjava/java/nio/DoubleViewBufferImpl.java b/libjava/java/nio/DoubleViewBufferImpl.java
deleted file mode 100644
index e860f2f808d..00000000000
--- a/libjava/java/nio/DoubleViewBufferImpl.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/* DoubleViewBufferImpl.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-final class DoubleViewBufferImpl extends DoubleBuffer
-{
- /** Position in bb (i.e. a byte offset) where this buffer starts. */
- private int offset;
- private ByteBuffer bb;
- private boolean readOnly;
- private ByteOrder endian;
-
- DoubleViewBufferImpl (ByteBuffer bb, int capacity)
- {
- super (capacity, capacity, 0, -1);
- this.bb = bb;
- this.offset = bb.position();
- this.readOnly = bb.isReadOnly();
- this.endian = bb.order();
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- public DoubleViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
- {
- super (capacity, limit, position, mark);
- this.bb = bb;
- this.offset = offset;
- this.readOnly = readOnly;
- this.endian = endian;
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- /**
- * Reads the <code>double</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>double</code>s in this buffer.
- */
- public double get ()
- {
- int p = position();
- double result = ByteBufferHelper.getDouble(bb, (p << 3) + offset, endian);
- position(p + 1);
- return result;
- }
-
- /**
- * Absolute get method. Reads the <code>double</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public double get (int index)
- {
- return ByteBufferHelper.getDouble(bb, (index << 3) + offset, endian);
- }
-
- public DoubleBuffer put (double value)
- {
- int p = position();
- ByteBufferHelper.putDouble(bb, (p << 3) + offset, value, endian);
- position(p + 1);
- return this;
- }
-
- public DoubleBuffer put (int index, double value)
- {
- ByteBufferHelper.putDouble(bb, (index << 3) + offset, value, endian);
- return this;
- }
-
- public DoubleBuffer compact ()
- {
- if (position () > 0)
- {
- int count = limit () - position ();
- bb.shiftDown(offset, offset + 8 * position(), 8 * count);
- position (count);
- limit (capacity ());
- }
- else
- {
- position(limit());
- limit(capacity());
- }
- return this;
- }
-
- public DoubleBuffer slice ()
- {
- return new DoubleViewBufferImpl (bb, (position () >> 3) + offset,
- remaining(), remaining(), 0, -1,
- readOnly, endian);
- }
-
- DoubleBuffer duplicate (boolean readOnly)
- {
- int pos = position();
- reset();
- int mark = position();
- position(pos);
- return new DoubleViewBufferImpl (bb, offset, capacity(), limit(),
- pos, mark, readOnly, endian);
- }
-
- public DoubleBuffer duplicate ()
- {
- return duplicate(readOnly);
- }
-
- public DoubleBuffer asReadOnlyBuffer ()
- {
- return duplicate(true);
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public boolean isDirect ()
- {
- return bb.isDirect ();
- }
-
- public ByteOrder order ()
- {
- return endian;
- }
-}
diff --git a/libjava/java/nio/FloatBuffer.java b/libjava/java/nio/FloatBuffer.java
deleted file mode 100644
index 8042333cbac..00000000000
--- a/libjava/java/nio/FloatBuffer.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/* FloatBuffer.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @since 1.4
- */
-public abstract class FloatBuffer extends Buffer
- implements Comparable
-{
- int array_offset;
- float[] backing_buffer;
-
- FloatBuffer (int capacity, int limit, int position, int mark)
- {
- super (capacity, limit, position, mark);
- array_offset = 0;
- }
-
- /**
- * Allocates a new <code>FloatBuffer</code> object with a given capacity.
- */
- public static FloatBuffer allocate (int capacity)
- {
- return new FloatBufferImpl (capacity);
- }
-
- /**
- * Wraps a <code>float</code> array into a <code>FloatBuffer</code>
- * object.
- *
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- */
- public static final FloatBuffer wrap (float[] array, int offset, int length)
- {
- return new FloatBufferImpl (array, 0, array.length, offset + length, offset, -1, false);
- }
-
- /**
- * Wraps a <code>float</code> array into a <code>FloatBuffer</code>
- * object.
- */
- public static final FloatBuffer wrap (float[] array)
- {
- return wrap (array, 0, array.length);
- }
-
- /**
- * This method transfers <code>float</code>s from this buffer into the given
- * destination array. Before the transfer, it checks if there are fewer than
- * length <code>float</code>s remaining in this buffer.
- *
- * @param dst The destination array
- * @param offset The offset within the array of the first <code>float</code>
- * to be written; must be non-negative and no larger than dst.length.
- * @param length The maximum number of bytes to be written to the given array;
- * must be non-negative and no larger than dst.length - offset.
- *
- * @exception BufferUnderflowException If there are fewer than length
- * <code>float</code>s remaining in this buffer.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold.
- */
- public FloatBuffer get (float[] dst, int offset, int length)
- {
- checkArraySize(dst.length, offset, length);
- checkForUnderflow(length);
-
- for (int i = offset; i < offset + length; i++)
- {
- dst [i] = get ();
- }
-
- return this;
- }
-
- /**
- * This method transfers <code>float</code>s from this buffer into the given
- * destination array.
- *
- * @param dst The byte array to write into.
- *
- * @exception BufferUnderflowException If there are fewer than dst.length
- * <code>float</code>s remaining in this buffer.
- */
- public FloatBuffer get (float[] dst)
- {
- return get (dst, 0, dst.length);
- }
-
- /**
- * Writes the content of the the <code>FloatBUFFER</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * <code>src.remaining()</code> space remaining in this buffer.
- *
- * @param src The source data.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>float</code>s in the source buffer.
- * @exception IllegalArgumentException If the source buffer is this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public FloatBuffer put (FloatBuffer src)
- {
- if (src == this)
- throw new IllegalArgumentException ();
-
- checkForOverflow(src.remaining());
-
- if (src.remaining () > 0)
- {
- float[] toPut = new float [src.remaining ()];
- src.get (toPut);
- put (toPut);
- }
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>float array</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * length space remaining in this buffer.
- *
- * @param src The array to copy into the buffer.
- * @param offset The offset within the array of the first byte to be read;
- * must be non-negative and no larger than src.length.
- * @param length The number of bytes to be read from the given array;
- * must be non-negative and no larger than src.length - offset.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>float</code>s in the source array.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public FloatBuffer put (float[] src, int offset, int length)
- {
- checkArraySize(src.length, offset, length);
- checkForOverflow(length);
-
- for (int i = offset; i < offset + length; i++)
- put (src [i]);
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>float array</code> src
- * into the buffer.
- *
- * @param src The array to copy into the buffer.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>float</code>s in the source array.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public final FloatBuffer put (float[] src)
- {
- return put (src, 0, src.length);
- }
-
- /**
- * Tells whether ot not this buffer is backed by an accessible
- * <code>float</code> array.
- */
- public final boolean hasArray ()
- {
- return (backing_buffer != null
- && !isReadOnly ());
- }
-
- /**
- * Returns the <code>float</code> array that backs this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final float[] array ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return backing_buffer;
- }
-
- /**
- * Returns the offset within this buffer's backing array of the first element.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final int arrayOffset ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return array_offset;
- }
-
- /**
- * Calculates a hash code for this buffer.
- *
- * This is done with <code>int</code> arithmetic,
- * where ** represents exponentiation, by this formula:<br>
- * <code>s[position()] + 31 + (s[position()+1] + 30)*31**1 + ... +
- * (s[limit()-1]+30)*31**(limit()-1)</code>.
- * Where s is the buffer data, in Float.floatToIntBits() form
- * Note that the hashcode is dependent on buffer content,
- * and therefore is not useful if the buffer content may change.
- *
- * @return the hash code
- */
- public int hashCode ()
- {
- int hashCode = Float.floatToIntBits(get(position())) + 31;
- int multiplier = 1;
- for (int i = position() + 1; i < limit(); ++i)
- {
- multiplier *= 31;
- hashCode += (Float.floatToIntBits(get(i)) + 30)*multiplier;
- }
- return hashCode;
- }
-
- /**
- * Checks if this buffer is equal to obj.
- */
- public boolean equals (Object obj)
- {
- if (obj instanceof FloatBuffer)
- {
- return compareTo (obj) == 0;
- }
-
- return false;
- }
-
- /**
- * Compares two <code>FloatBuffer</code> objects.
- *
- * @exception ClassCastException If obj is not an object derived from
- * <code>FloatBuffer</code>.
- */
- public int compareTo (Object obj)
- {
- FloatBuffer other = (FloatBuffer) obj;
-
- int num = Math.min(remaining(), other.remaining());
- int pos_this = position();
- int pos_other = other.position();
-
- for (int count = 0; count < num; count++)
- {
- float a = get(pos_this++);
- float b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
- }
-
- return remaining() - other.remaining();
- }
-
- /**
- * Returns the byte order of this buffer.
- */
- public abstract ByteOrder order ();
-
- /**
- * Reads the <code>float</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>float</code>s in this buffer.
- */
- public abstract float get ();
-
- /**
- * Writes the <code>float</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferOverflowException If there no remaining
- * <code>float</code>s in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract FloatBuffer put (float b);
-
- /**
- * Absolute get method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public abstract float get (int index);
-
- /**
- * Absolute put method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract FloatBuffer put (int index, float b);
-
- /**
- * Compacts this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract FloatBuffer compact ();
-
- /**
- * Tells wether or not this buffer is direct.
- */
- public abstract boolean isDirect ();
-
- /**
- * Creates a new <code>FloatBuffer</code> whose content is a shared
- * subsequence of this buffer's content.
- */
- public abstract FloatBuffer slice ();
-
- /**
- * Creates a new <code>FloatBuffer</code> that shares this buffer's
- * content.
- */
- public abstract FloatBuffer duplicate ();
-
- /**
- * Creates a new read-only <code>FloatBuffer</code> that shares this
- * buffer's content.
- */
- public abstract FloatBuffer asReadOnlyBuffer ();
-}
diff --git a/libjava/java/nio/FloatBufferImpl.java b/libjava/java/nio/FloatBufferImpl.java
deleted file mode 100644
index b4868780c42..00000000000
--- a/libjava/java/nio/FloatBufferImpl.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/* FloatBufferImpl.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * This is a Heap memory implementation
- */
-final class FloatBufferImpl extends FloatBuffer
-{
- private boolean readOnly;
-
- FloatBufferImpl (int capacity)
- {
- this (new float [capacity], 0, capacity, capacity, 0, -1, false);
- }
-
- FloatBufferImpl (float[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
- {
- super (capacity, limit, position, mark);
- this.backing_buffer = buffer;
- this.array_offset = offset;
- this.readOnly = readOnly;
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public FloatBuffer slice ()
- {
- return new FloatBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
- }
-
- public FloatBuffer duplicate ()
- {
- return new FloatBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
- }
-
- public FloatBuffer asReadOnlyBuffer ()
- {
- return new FloatBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
- }
-
- public FloatBuffer compact ()
- {
- checkIfReadOnly();
- mark = -1;
- int copied = 0;
-
- while (remaining () > 0)
- {
- put (copied, get ());
- copied++;
- }
-
- position (copied);
- limit(capacity());
- return this;
- }
-
- public boolean isDirect ()
- {
- return false;
- }
-
- /**
- * Reads the <code>float</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>floats</code> in this buffer.
- */
- public float get ()
- {
- checkForUnderflow();
-
- float result = backing_buffer [position ()];
- position (position () + 1);
- return result;
- }
-
- /**
- * Relative put method. Writes <code>value</code> to the next position
- * in the buffer.
- *
- * @exception BufferOverflowException If there no remaining
- * space in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public FloatBuffer put (float value)
- {
- checkIfReadOnly();
- checkForOverflow();
-
- backing_buffer [position ()] = value;
- position (position () + 1);
- return this;
- }
-
- /**
- * Absolute get method. Reads the <code>float</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public float get (int index)
- {
- checkIndex(index);
-
- return backing_buffer [index];
- }
-
- /**
- * Absolute put method. Writes <code>value</code> to position
- * <code>index</code> in the buffer.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public FloatBuffer put (int index, float value)
- {
- checkIfReadOnly();
- checkIndex(index);
-
- backing_buffer [index] = value;
- return this;
- }
-
- public ByteOrder order ()
- {
- return ByteOrder.nativeOrder ();
- }
-}
diff --git a/libjava/java/nio/FloatViewBufferImpl.java b/libjava/java/nio/FloatViewBufferImpl.java
deleted file mode 100644
index 55770d52a29..00000000000
--- a/libjava/java/nio/FloatViewBufferImpl.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/* FloatViewBufferImpl.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-final class FloatViewBufferImpl extends FloatBuffer
-{
- /** Position in bb (i.e. a byte offset) where this buffer starts. */
- private int offset;
- private ByteBuffer bb;
- private boolean readOnly;
- private ByteOrder endian;
-
- FloatViewBufferImpl (ByteBuffer bb, int capacity)
- {
- super (capacity, capacity, 0, -1);
- this.bb = bb;
- this.offset = bb.position();
- this.readOnly = bb.isReadOnly();
- this.endian = bb.order();
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- public FloatViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
- {
- super (capacity, limit, position, mark);
- this.bb = bb;
- this.offset = offset;
- this.readOnly = readOnly;
- this.endian = endian;
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- /**
- * Reads the <code>float</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>floats</code> in this buffer.
- */
- public float get ()
- {
- int p = position();
- float result = ByteBufferHelper.getFloat(bb, (p << 2) + offset, endian);
- position(p + 1);
- return result;
- }
-
- /**
- * Absolute get method. Reads the <code>float</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public float get (int index)
- {
- return ByteBufferHelper.getFloat(bb, (index << 2) + offset, endian);
- }
-
- public FloatBuffer put (float value)
- {
- int p = position();
- ByteBufferHelper.putFloat(bb, (p << 2) + offset, value, endian);
- position(p + 1);
- return this;
- }
-
- public FloatBuffer put (int index, float value)
- {
- ByteBufferHelper.putFloat(bb, (index << 2) + offset, value, endian);
- return this;
- }
-
- public FloatBuffer compact ()
- {
- if (position () > 0)
- {
- int count = limit () - position ();
- bb.shiftDown(offset, offset + 4 * position(), 4 * count);
- position (count);
- limit (capacity ());
- }
- else
- {
- position(limit());
- limit(capacity());
- }
- return this;
- }
-
- public FloatBuffer slice ()
- {
- // Create a sliced copy of this object that shares its content.
- return new FloatViewBufferImpl (bb, (position () >> 2) + offset,
- remaining(), remaining(), 0, -1,
- readOnly, endian);
- }
-
- FloatBuffer duplicate (boolean readOnly)
- {
- int pos = position();
- reset();
- int mark = position();
- position(pos);
- return new FloatViewBufferImpl (bb, offset, capacity(), limit(),
- pos, mark, readOnly, endian);
- }
-
- public FloatBuffer duplicate ()
- {
- return duplicate(readOnly);
- }
-
- public FloatBuffer asReadOnlyBuffer ()
- {
- return duplicate(true);
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public boolean isDirect ()
- {
- return bb.isDirect ();
- }
-
- public ByteOrder order ()
- {
- return endian;
- }
-}
diff --git a/libjava/java/nio/IntBuffer.java b/libjava/java/nio/IntBuffer.java
deleted file mode 100644
index 1e1fe9c7565..00000000000
--- a/libjava/java/nio/IntBuffer.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/* IntBuffer.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @since 1.4
- */
-public abstract class IntBuffer extends Buffer
- implements Comparable
-{
- int array_offset;
- int[] backing_buffer;
-
- IntBuffer (int capacity, int limit, int position, int mark)
- {
- super (capacity, limit, position, mark);
- array_offset = 0;
- }
-
- /**
- * Allocates a new <code>IntBuffer</code> object with a given capacity.
- */
- public static IntBuffer allocate (int capacity)
- {
- return new IntBufferImpl (capacity);
- }
-
- /**
- * Wraps a <code>int</code> array into a <code>IntBuffer</code>
- * object.
- *
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- */
- public static final IntBuffer wrap (int[] array, int offset, int length)
- {
- return new IntBufferImpl (array, 0, array.length, offset + length, offset, -1, false);
- }
-
- /**
- * Wraps a <code>int</code> array into a <code>IntBuffer</code>
- * object.
- */
- public static final IntBuffer wrap (int[] array)
- {
- return wrap (array, 0, array.length);
- }
-
- /**
- * This method transfers <code>int</code>s from this buffer into the given
- * destination array. Before the transfer, it checks if there are fewer than
- * length <code>int</code>s remaining in this buffer.
- *
- * @param dst The destination array
- * @param offset The offset within the array of the first <code>int</code>
- * to be written; must be non-negative and no larger than dst.length.
- * @param length The maximum number of bytes to be written to the given array;
- * must be non-negative and no larger than dst.length - offset.
- *
- * @exception BufferUnderflowException If there are fewer than length
- * <code>int</code>s remaining in this buffer.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold.
- */
- public IntBuffer get (int[] dst, int offset, int length)
- {
- checkArraySize(dst.length, offset, length);
- checkForUnderflow(length);
-
- for (int i = offset; i < offset + length; i++)
- {
- dst [i] = get ();
- }
-
- return this;
- }
-
- /**
- * This method transfers <code>int</code>s from this buffer into the given
- * destination array.
- *
- * @param dst The byte array to write into.
- *
- * @exception BufferUnderflowException If there are fewer than dst.length
- * <code>int</code>s remaining in this buffer.
- */
- public IntBuffer get (int[] dst)
- {
- return get (dst, 0, dst.length);
- }
-
- /**
- * Writes the content of the the <code>IntBUFFER</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * <code>src.remaining()</code> space remaining in this buffer.
- *
- * @param src The source data.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>int</code>s in the source buffer.
- * @exception IllegalArgumentException If the source buffer is this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public IntBuffer put (IntBuffer src)
- {
- if (src == this)
- throw new IllegalArgumentException ();
-
- checkForOverflow(src.remaining ());
-
- if (src.remaining () > 0)
- {
- int[] toPut = new int [src.remaining ()];
- src.get (toPut);
- put (toPut);
- }
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>int array</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * length space remaining in this buffer.
- *
- * @param src The array to copy into the buffer.
- * @param offset The offset within the array of the first byte to be read;
- * must be non-negative and no larger than src.length.
- * @param length The number of bytes to be read from the given array;
- * must be non-negative and no larger than src.length - offset.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>int</code>s in the source array.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public IntBuffer put (int[] src, int offset, int length)
- {
- checkArraySize(src.length, offset, length);
- checkForOverflow(length);
-
- for (int i = offset; i < offset + length; i++)
- put (src [i]);
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>int array</code> src
- * into the buffer.
- *
- * @param src The array to copy into the buffer.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>int</code>s in the source array.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public final IntBuffer put (int[] src)
- {
- return put (src, 0, src.length);
- }
-
- /**
- * Tells whether ot not this buffer is backed by an accessible
- * <code>int</code> array.
- */
- public final boolean hasArray ()
- {
- return (backing_buffer != null
- && !isReadOnly ());
- }
-
- /**
- * Returns the <code>int</code> array that backs this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final int[] array ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return backing_buffer;
- }
-
- /**
- * Returns the offset within this buffer's backing array of the first element.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final int arrayOffset ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return array_offset;
- }
-
- /**
- * Calculates a hash code for this buffer.
- *
- * This is done with <code>int</code> arithmetic,
- * where ** represents exponentiation, by this formula:<br>
- * <code>s[position()] + 31 + (s[position()+1] + 30)*31**1 + ... +
- * (s[limit()-1]+30)*31**(limit()-1)</code>.
- * Where s is the buffer data. Note that the hashcode is dependent
- * on buffer content, and therefore is not useful if the buffer
- * content may change.
- *
- * @return the hash code
- */
- public int hashCode ()
- {
- int hashCode = get(position()) + 31;
- int multiplier = 1;
- for (int i = position() + 1; i < limit(); ++i)
- {
- multiplier *= 31;
- hashCode += (get(i) + 30)*multiplier;
- }
- return hashCode;
- }
-
- /**
- * Checks if this buffer is equal to obj.
- */
- public boolean equals (Object obj)
- {
- if (obj instanceof IntBuffer)
- {
- return compareTo (obj) == 0;
- }
-
- return false;
- }
-
- /**
- * Compares two <code>IntBuffer</code> objects.
- *
- * @exception ClassCastException If obj is not an object derived from
- * <code>IntBuffer</code>.
- */
- public int compareTo (Object obj)
- {
- IntBuffer other = (IntBuffer) obj;
-
- int num = Math.min(remaining(), other.remaining());
- int pos_this = position();
- int pos_other = other.position();
-
- for (int count = 0; count < num; count++)
- {
- int a = get(pos_this++);
- int b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
- }
-
- return remaining() - other.remaining();
- }
-
- /**
- * Returns the byte order of this buffer.
- */
- public abstract ByteOrder order ();
-
- /**
- * Reads the <code>int</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>int</code>s in this buffer.
- */
- public abstract int get ();
-
- /**
- * Writes the <code>int</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferOverflowException If there no remaining
- * <code>int</code>s in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract IntBuffer put (int b);
-
- /**
- * Absolute get method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public abstract int get (int index);
-
- /**
- * Absolute put method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract IntBuffer put (int index, int b);
-
- /**
- * Compacts this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract IntBuffer compact ();
-
- /**
- * Tells wether or not this buffer is direct.
- */
- public abstract boolean isDirect ();
-
- /**
- * Creates a new <code>IntBuffer</code> whose content is a shared
- * subsequence of this buffer's content.
- */
- public abstract IntBuffer slice ();
-
- /**
- * Creates a new <code>IntBuffer</code> that shares this buffer's
- * content.
- */
- public abstract IntBuffer duplicate ();
-
- /**
- * Creates a new read-only <code>IntBuffer</code> that shares this
- * buffer's content.
- */
- public abstract IntBuffer asReadOnlyBuffer ();
-}
diff --git a/libjava/java/nio/IntBufferImpl.java b/libjava/java/nio/IntBufferImpl.java
deleted file mode 100644
index 22657482b42..00000000000
--- a/libjava/java/nio/IntBufferImpl.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/* IntBufferImpl.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * This is a Heap memory implementation
- */
-final class IntBufferImpl extends IntBuffer
-{
- private boolean readOnly;
-
- IntBufferImpl (int capacity)
- {
- this (new int [capacity], 0, capacity, capacity, 0, -1, false);
- }
-
- IntBufferImpl (int[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
- {
- super (capacity, limit, position, mark);
- this.backing_buffer = buffer;
- this.array_offset = offset;
- this.readOnly = readOnly;
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public IntBuffer slice ()
- {
- return new IntBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
- }
-
- public IntBuffer duplicate ()
- {
- return new IntBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
- }
-
- public IntBuffer asReadOnlyBuffer ()
- {
- return new IntBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
- }
-
- public IntBuffer compact ()
- {
- checkIfReadOnly();
- mark = -1;
- int copied = 0;
-
- while (remaining () > 0)
- {
- put (copied, get ());
- copied++;
- }
-
- position (copied);
- limit(capacity());
- return this;
- }
-
- public boolean isDirect ()
- {
- return false;
- }
-
- /**
- * Reads the <code>int</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>ints</code> in this buffer.
- */
- public int get ()
- {
- checkForUnderflow();
-
- int result = backing_buffer [position ()];
- position (position () + 1);
- return result;
- }
-
- /**
- * Relative put method. Writes <code>value</code> to the next position
- * in the buffer.
- *
- * @exception BufferOverflowException If there no remaining
- * space in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public IntBuffer put (int value)
- {
- checkIfReadOnly();
- checkForOverflow();
-
- backing_buffer [position ()] = value;
- position (position () + 1);
- return this;
- }
-
- /**
- * Absolute get method. Reads the <code>int</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public int get (int index)
- {
- checkIndex(index);
-
- return backing_buffer [index];
- }
-
- /**
- * Absolute put method. Writes <code>value</code> to position
- * <code>index</code> in the buffer.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public IntBuffer put (int index, int value)
- {
- checkIfReadOnly();
- checkIndex(index);
-
- backing_buffer [index] = value;
- return this;
- }
-
- public ByteOrder order ()
- {
- return ByteOrder.nativeOrder ();
- }
-}
diff --git a/libjava/java/nio/IntViewBufferImpl.java b/libjava/java/nio/IntViewBufferImpl.java
deleted file mode 100644
index d0b0057c117..00000000000
--- a/libjava/java/nio/IntViewBufferImpl.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/* IntViewBufferImpl.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-final class IntViewBufferImpl extends IntBuffer
-{
- /** Position in bb (i.e. a byte offset) where this buffer starts. */
- private int offset;
- private ByteBuffer bb;
- private boolean readOnly;
- private ByteOrder endian;
-
- IntViewBufferImpl (ByteBuffer bb, int capacity)
- {
- super (capacity, capacity, 0, -1);
- this.bb = bb;
- this.offset = bb.position();
- this.readOnly = bb.isReadOnly();
- this.endian = bb.order();
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- public IntViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
- {
- super (capacity, limit, position, mark);
- this.bb = bb;
- this.offset = offset;
- this.readOnly = readOnly;
- this.endian = endian;
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- /**
- * Reads the <code>int</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>ints</code> in this buffer.
- */
- public int get ()
- {
- int p = position();
- int result = ByteBufferHelper.getInt(bb, (p << 2) + offset, endian);
- position(p + 1);
- return result;
- }
-
- /**
- * Absolute get method. Reads the <code>int</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public int get (int index)
- {
- return ByteBufferHelper.getInt(bb, (index << 2) + offset, endian);
- }
-
- public IntBuffer put (int value)
- {
- int p = position();
- ByteBufferHelper.putInt(bb, (p << 2) + offset, value, endian);
- position(p + 1);
- return this;
- }
-
- public IntBuffer put (int index, int value)
- {
- ByteBufferHelper.putInt(bb, (index << 2) + offset, value, endian);
- return this;
- }
-
- public IntBuffer compact ()
- {
- if (position () > 0)
- {
- int count = limit () - position ();
- bb.shiftDown(offset, offset + 4 * position(), 4 * count);
- position (count);
- limit (capacity ());
- }
- else
- {
- position(limit());
- limit(capacity());
- }
- return this;
- }
-
- public IntBuffer slice ()
- {
- // Create a sliced copy of this object that shares its content.
- return new IntViewBufferImpl (bb, (position () >> 2) + offset,
- remaining(), remaining(), 0, -1,
- readOnly, endian);
- }
-
- IntBuffer duplicate (boolean readOnly)
- {
- int pos = position();
- reset();
- int mark = position();
- position(pos);
- return new IntViewBufferImpl (bb, offset, capacity(), limit(),
- pos, mark, readOnly, endian);
- }
-
- public IntBuffer duplicate ()
- {
- return duplicate(readOnly);
- }
-
- public IntBuffer asReadOnlyBuffer ()
- {
- return duplicate(true);
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public boolean isDirect ()
- {
- return bb.isDirect ();
- }
-
- public ByteOrder order ()
- {
- return endian;
- }
-}
diff --git a/libjava/java/nio/InvalidMarkException.java b/libjava/java/nio/InvalidMarkException.java
deleted file mode 100644
index 937d417ab13..00000000000
--- a/libjava/java/nio/InvalidMarkException.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* InvalidMarkException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class InvalidMarkException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public InvalidMarkException ()
- {
- }
-}
diff --git a/libjava/java/nio/LongBuffer.java b/libjava/java/nio/LongBuffer.java
deleted file mode 100644
index b3d3557edcf..00000000000
--- a/libjava/java/nio/LongBuffer.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/* LongBuffer.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @since 1.4
- */
-public abstract class LongBuffer extends Buffer
- implements Comparable
-{
- int array_offset;
- long[] backing_buffer;
-
- LongBuffer (int capacity, int limit, int position, int mark)
- {
- super (capacity, limit, position, mark);
- array_offset = 0;
- }
-
- /**
- * Allocates a new <code>LongBuffer</code> object with a given capacity.
- */
- public static LongBuffer allocate (int capacity)
- {
- return new LongBufferImpl (capacity);
- }
-
- /**
- * Wraps a <code>long</code> array into a <code>LongBuffer</code>
- * object.
- *
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- */
- public static final LongBuffer wrap (long[] array, int offset, int length)
- {
- return new LongBufferImpl (array, 0, array.length, offset + length, offset, -1, false);
- }
-
- /**
- * Wraps a <code>long</code> array into a <code>LongBuffer</code>
- * object.
- */
- public static final LongBuffer wrap (long[] array)
- {
- return wrap (array, 0, array.length);
- }
-
- /**
- * This method transfers <code>long</code>s from this buffer into the given
- * destination array. Before the transfer, it checks if there are fewer than
- * length <code>long</code>s remaining in this buffer.
- *
- * @param dst The destination array
- * @param offset The offset within the array of the first <code>long</code>
- * to be written; must be non-negative and no larger than dst.length.
- * @param length The maximum number of bytes to be written to the given array;
- * must be non-negative and no larger than dst.length - offset.
- *
- * @exception BufferUnderflowException If there are fewer than length
- * <code>long</code>s remaining in this buffer.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold.
- */
- public LongBuffer get (long[] dst, int offset, int length)
- {
- checkArraySize(dst.length, offset, length);
- checkForUnderflow(length);
-
- for (int i = offset; i < offset + length; i++)
- {
- dst [i] = get ();
- }
-
- return this;
- }
-
- /**
- * This method transfers <code>long</code>s from this buffer into the given
- * destination array.
- *
- * @param dst The byte array to write into.
- *
- * @exception BufferUnderflowException If there are fewer than dst.length
- * <code>long</code>s remaining in this buffer.
- */
- public LongBuffer get (long[] dst)
- {
- return get (dst, 0, dst.length);
- }
-
- /**
- * Writes the content of the the <code>LongBUFFER</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * <code>src.remaining()</code> space remaining in this buffer.
- *
- * @param src The source data.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>long</code>s in the source buffer.
- * @exception IllegalArgumentException If the source buffer is this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public LongBuffer put (LongBuffer src)
- {
- if (src == this)
- throw new IllegalArgumentException ();
-
- checkForOverflow(src.remaining ());
-
- if (src.remaining () > 0)
- {
- long[] toPut = new long [src.remaining ()];
- src.get (toPut);
- put (toPut);
- }
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>long array</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * length space remaining in this buffer.
- *
- * @param src The array to copy into the buffer.
- * @param offset The offset within the array of the first byte to be read;
- * must be non-negative and no larger than src.length.
- * @param length The number of bytes to be read from the given array;
- * must be non-negative and no larger than src.length - offset.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>long</code>s in the source array.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public LongBuffer put (long[] src, int offset, int length)
- {
- checkArraySize(src.length, offset, length);
- checkForOverflow(length);
-
- for (int i = offset; i < offset + length; i++)
- put (src [i]);
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>long array</code> src
- * into the buffer.
- *
- * @param src The array to copy into the buffer.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>long</code>s in the source array.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public final LongBuffer put (long[] src)
- {
- return put (src, 0, src.length);
- }
-
- /**
- * Tells whether ot not this buffer is backed by an accessible
- * <code>long</code> array.
- */
- public final boolean hasArray ()
- {
- return (backing_buffer != null
- && !isReadOnly ());
- }
-
- /**
- * Returns the <code>long</code> array that backs this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final long[] array ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return backing_buffer;
- }
-
- /**
- * Returns the offset within this buffer's backing array of the first element.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final int arrayOffset ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return array_offset;
- }
-
- /**
- * Calculates a hash code for this buffer.
- *
- * This is done with <code>long</code> arithmetic,
- * where ** represents exponentiation, by this formula:<br>
- * <code>s[position()] + 31 + (s[position()+1] + 30)*31**1 + ... +
- * (s[limit()-1]+30)*31**(limit()-1)</code>.
- * Where s is the buffer data. Note that the hashcode is dependent
- * on buffer content, and therefore is not useful if the buffer
- * content may change.
- *
- * @return the hash code (casted to int)
- */
- public int hashCode ()
- {
- long hashCode = get(position()) + 31;
- long multiplier = 1;
- for (int i = position() + 1; i < limit(); ++i)
- {
- multiplier *= 31;
- hashCode += (get(i) + 30)*multiplier;
- }
- return ((int)hashCode);
- }
-
- /**
- * Checks if this buffer is equal to obj.
- */
- public boolean equals (Object obj)
- {
- if (obj instanceof LongBuffer)
- {
- return compareTo (obj) == 0;
- }
-
- return false;
- }
-
- /**
- * Compares two <code>LongBuffer</code> objects.
- *
- * @exception ClassCastException If obj is not an object derived from
- * <code>LongBuffer</code>.
- */
- public int compareTo (Object obj)
- {
- LongBuffer other = (LongBuffer) obj;
-
- int num = Math.min(remaining(), other.remaining());
- int pos_this = position();
- int pos_other = other.position();
-
- for (int count = 0; count < num; count++)
- {
- long a = get(pos_this++);
- long b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
- }
-
- return remaining() - other.remaining();
- }
-
- /**
- * Returns the byte order of this buffer.
- */
- public abstract ByteOrder order ();
-
- /**
- * Reads the <code>long</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>long</code>s in this buffer.
- */
- public abstract long get ();
-
- /**
- * Writes the <code>long</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferOverflowException If there no remaining
- * <code>long</code>s in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract LongBuffer put (long b);
-
- /**
- * Absolute get method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public abstract long get (int index);
-
- /**
- * Absolute put method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract LongBuffer put (int index, long b);
-
- /**
- * Compacts this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract LongBuffer compact ();
-
- /**
- * Tells wether or not this buffer is direct.
- */
- public abstract boolean isDirect ();
-
- /**
- * Creates a new <code>LongBuffer</code> whose content is a shared
- * subsequence of this buffer's content.
- */
- public abstract LongBuffer slice ();
-
- /**
- * Creates a new <code>LongBuffer</code> that shares this buffer's
- * content.
- */
- public abstract LongBuffer duplicate ();
-
- /**
- * Creates a new read-only <code>LongBuffer</code> that shares this
- * buffer's content.
- */
- public abstract LongBuffer asReadOnlyBuffer ();
-}
diff --git a/libjava/java/nio/LongBufferImpl.java b/libjava/java/nio/LongBufferImpl.java
deleted file mode 100644
index 8772f618c19..00000000000
--- a/libjava/java/nio/LongBufferImpl.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/* LongBufferImpl.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * This is a Heap memory implementation
- */
-final class LongBufferImpl extends LongBuffer
-{
- private boolean readOnly;
-
- LongBufferImpl (int capacity)
- {
- this (new long [capacity], 0, capacity, capacity, 0, -1, false);
- }
-
- LongBufferImpl (long[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
- {
- super (capacity, limit, position, mark);
- this.backing_buffer = buffer;
- this.array_offset = offset;
- this.readOnly = readOnly;
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public LongBuffer slice ()
- {
- return new LongBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
- }
-
- public LongBuffer duplicate ()
- {
- return new LongBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
- }
-
- public LongBuffer asReadOnlyBuffer ()
- {
- return new LongBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
- }
-
- public LongBuffer compact ()
- {
- checkIfReadOnly();
- mark = -1;
- int copied = 0;
-
- while (remaining () > 0)
- {
- put (copied, get ());
- copied++;
- }
-
- position (copied);
- limit(capacity());
- return this;
- }
-
- public boolean isDirect ()
- {
- return false;
- }
-
- /**
- * Reads the <code>long</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>longs</code> in this buffer.
- */
- public long get ()
- {
- checkForUnderflow();
-
- long result = backing_buffer [position ()];
- position (position () + 1);
- return result;
- }
-
- /**
- * Relative put method. Writes <code>value</code> to the next position
- * in the buffer.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public LongBuffer put (long value)
- {
- checkIfReadOnly();
- checkForOverflow();
-
- backing_buffer [position ()] = value;
- position (position () + 1);
- return this;
- }
-
- /**
- * Absolute get method. Reads the <code>long</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public long get (int index)
- {
- checkIndex(index);
-
- return backing_buffer [index];
- }
-
- /**
- * Absolute put method. Writes <code>value</code> to position
- * <code>index</code> in the buffer.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public LongBuffer put (int index, long value)
- {
- checkIfReadOnly();
- checkIndex(index);
-
- backing_buffer [index] = value;
- return this;
- }
-
- public ByteOrder order ()
- {
- return ByteOrder.nativeOrder ();
- }
-}
diff --git a/libjava/java/nio/LongViewBufferImpl.java b/libjava/java/nio/LongViewBufferImpl.java
deleted file mode 100644
index 9c3452ae809..00000000000
--- a/libjava/java/nio/LongViewBufferImpl.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/* LongViewBufferImpl.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-final class LongViewBufferImpl extends LongBuffer
-{
- /** Position in bb (i.e. a byte offset) where this buffer starts. */
- private int offset;
- private ByteBuffer bb;
- private boolean readOnly;
- private ByteOrder endian;
-
- LongViewBufferImpl (ByteBuffer bb, int capacity)
- {
- super (capacity, capacity, 0, -1);
- this.bb = bb;
- this.offset = bb.position();
- this.readOnly = bb.isReadOnly();
- this.endian = bb.order();
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- public LongViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
- {
- super (capacity, limit, position, mark);
- this.bb = bb;
- this.offset = offset;
- this.readOnly = readOnly;
- this.endian = endian;
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- /**
- * Reads the <code>long</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>longs</code> in this buffer.
- */
- public long get ()
- {
- int p = position();
- long result = ByteBufferHelper.getLong(bb, (p << 3) + offset, endian);
- position(p + 1);
- return result;
- }
-
- /**
- * Absolute get method. Reads the <code>long</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public long get (int index)
- {
- return ByteBufferHelper.getLong(bb, (index << 3) + offset, endian);
- }
-
- public LongBuffer put (long value)
- {
- int p = position();
- ByteBufferHelper.putLong(bb, (p << 3) + offset, value, endian);
- position(p + 1);
- return this;
- }
-
- public LongBuffer put (int index, long value)
- {
- ByteBufferHelper.putLong(bb, (index << 3) + offset, value, endian);
- return this;
- }
-
- public LongBuffer compact ()
- {
- if (position () > 0)
- {
- int count = limit () - position ();
- bb.shiftDown(offset, offset + 8 * position(), 8 * count);
- position (count);
- limit (capacity ());
- }
- else
- {
- position(limit());
- limit(capacity());
- }
- return this;
- }
-
- public LongBuffer slice ()
- {
- // Create a sliced copy of this object that shares its content.
- return new LongViewBufferImpl (bb, (position () >> 3) + offset,
- remaining(), remaining(), 0, -1,
- readOnly, endian);
- }
-
- LongBuffer duplicate (boolean readOnly)
- {
- int pos = position();
- reset();
- int mark = position();
- position(pos);
- return new LongViewBufferImpl (bb, offset, capacity(), limit(),
- pos, mark, readOnly, endian);
- }
-
- public LongBuffer duplicate ()
- {
- return duplicate(readOnly);
- }
-
- public LongBuffer asReadOnlyBuffer ()
- {
- return duplicate(true);
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public boolean isDirect ()
- {
- return bb.isDirect ();
- }
-
- public ByteOrder order ()
- {
- return endian;
- }
-}
diff --git a/libjava/java/nio/ReadOnlyBufferException.java b/libjava/java/nio/ReadOnlyBufferException.java
deleted file mode 100644
index d710e1b26a1..00000000000
--- a/libjava/java/nio/ReadOnlyBufferException.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ReadOnlyBufferException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class ReadOnlyBufferException extends UnsupportedOperationException
-{
- /**
- * Creates the exception
- */
- public ReadOnlyBufferException ()
- {
- }
-}
diff --git a/libjava/java/nio/ShortBuffer.java b/libjava/java/nio/ShortBuffer.java
deleted file mode 100644
index 958fe8cd6b6..00000000000
--- a/libjava/java/nio/ShortBuffer.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/* ShortBuffer.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * @since 1.4
- */
-public abstract class ShortBuffer extends Buffer
- implements Comparable
-{
- int array_offset;
- short[] backing_buffer;
-
- ShortBuffer (int capacity, int limit, int position, int mark)
- {
- super (capacity, limit, position, mark);
- array_offset = 0;
- }
-
- /**
- * Allocates a new <code>ShortBuffer</code> object with a given capacity.
- */
- public static ShortBuffer allocate (int capacity)
- {
- return new ShortBufferImpl (capacity);
- }
-
- /**
- * Wraps a <code>short</code> array into a <code>ShortBuffer</code>
- * object.
- *
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- */
- public static final ShortBuffer wrap (short[] array, int offset, int length)
- {
- return new ShortBufferImpl (array, 0, array.length, offset + length, offset, -1, false);
- }
-
- /**
- * Wraps a <code>short</code> array into a <code>ShortBuffer</code>
- * object.
- */
- public static final ShortBuffer wrap (short[] array)
- {
- return wrap (array, 0, array.length);
- }
-
- /**
- * This method transfers <code>short</code>s from this buffer into the given
- * destination array. Before the transfer, it checks if there are fewer than
- * length <code>short</code>s remaining in this buffer.
- *
- * @param dst The destination array
- * @param offset The offset within the array of the first <code>short</code>
- * to be written; must be non-negative and no larger than dst.length.
- * @param length The maximum number of bytes to be written to the given array;
- * must be non-negative and no larger than dst.length - offset.
- *
- * @exception BufferUnderflowException If there are fewer than length
- * <code>short</code>s remaining in this buffer.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold.
- */
- public ShortBuffer get (short[] dst, int offset, int length)
- {
- checkArraySize(dst.length, offset, length);
- checkForUnderflow(length);
-
- for (int i = offset; i < offset + length; i++)
- {
- dst [i] = get ();
- }
-
- return this;
- }
-
- /**
- * This method transfers <code>short</code>s from this buffer into the given
- * destination array.
- *
- * @param dst The byte array to write into.
- *
- * @exception BufferUnderflowException If there are fewer than dst.length
- * <code>short</code>s remaining in this buffer.
- */
- public ShortBuffer get (short[] dst)
- {
- return get (dst, 0, dst.length);
- }
-
- /**
- * Writes the content of the the <code>ShortBUFFER</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * <code>src.remaining()</code> space remaining in this buffer.
- *
- * @param src The source data.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>short</code>s in the source buffer.
- * @exception IllegalArgumentException If the source buffer is this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public ShortBuffer put (ShortBuffer src)
- {
- if (src == this)
- throw new IllegalArgumentException ();
-
- checkForOverflow(src.remaining ());
-
- if (src.remaining () > 0)
- {
- short[] toPut = new short [src.remaining ()];
- src.get (toPut);
- put (toPut);
- }
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>short array</code> src
- * into the buffer. Before the transfer, it checks if there is fewer than
- * length space remaining in this buffer.
- *
- * @param src The array to copy into the buffer.
- * @param offset The offset within the array of the first byte to be read;
- * must be non-negative and no larger than src.length.
- * @param length The number of bytes to be read from the given array;
- * must be non-negative and no larger than src.length - offset.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>short</code>s in the source array.
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public ShortBuffer put (short[] src, int offset, int length)
- {
- checkArraySize(src.length, offset, length);
- checkForOverflow(length);
-
- for (int i = offset; i < offset + length; i++)
- put (src [i]);
-
- return this;
- }
-
- /**
- * Writes the content of the the <code>short array</code> src
- * into the buffer.
- *
- * @param src The array to copy into the buffer.
- *
- * @exception BufferOverflowException If there is insufficient space in this
- * buffer for the remaining <code>short</code>s in the source array.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public final ShortBuffer put (short[] src)
- {
- return put (src, 0, src.length);
- }
-
- /**
- * Tells whether ot not this buffer is backed by an accessible
- * <code>short</code> array.
- */
- public final boolean hasArray ()
- {
- return (backing_buffer != null
- && !isReadOnly ());
- }
-
- /**
- * Returns the <code>short</code> array that backs this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final short[] array ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return backing_buffer;
- }
-
- /**
- * Returns the offset within this buffer's backing array of the first element.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- * @exception UnsupportedOperationException If this buffer is not backed
- * by an accessible array.
- */
- public final int arrayOffset ()
- {
- if (backing_buffer == null)
- throw new UnsupportedOperationException ();
-
- checkIfReadOnly();
-
- return array_offset;
- }
-
- /**
- * Calculates a hash code for this buffer.
- *
- * This is done with <code>int</code> arithmetic,
- * where ** represents exponentiation, by this formula:<br>
- * <code>s[position()] + 31 + (s[position()+1] + 30)*31**1 + ... +
- * (s[limit()-1]+30)*31**(limit()-1)</code>.
- * Where s is the buffer data. Note that the hashcode is dependent
- * on buffer content, and therefore is not useful if the buffer
- * content may change.
- *
- * @return the hash code
- */
- public int hashCode ()
- {
- int hashCode = get(position()) + 31;
- int multiplier = 1;
- for (int i = position() + 1; i < limit(); ++i)
- {
- multiplier *= 31;
- hashCode += (get(i) + 30)*multiplier;
- }
- return hashCode;
- }
-
- /**
- * Checks if this buffer is equal to obj.
- */
- public boolean equals (Object obj)
- {
- if (obj instanceof ShortBuffer)
- {
- return compareTo (obj) == 0;
- }
-
- return false;
- }
-
- /**
- * Compares two <code>ShortBuffer</code> objects.
- *
- * @exception ClassCastException If obj is not an object derived from
- * <code>ShortBuffer</code>.
- */
- public int compareTo (Object obj)
- {
- ShortBuffer other = (ShortBuffer) obj;
-
- int num = Math.min(remaining(), other.remaining());
- int pos_this = position();
- int pos_other = other.position();
-
- for (int count = 0; count < num; count++)
- {
- short a = get(pos_this++);
- short b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
- }
-
- return remaining() - other.remaining();
- }
-
- /**
- * Returns the byte order of this buffer.
- */
- public abstract ByteOrder order ();
-
- /**
- * Reads the <code>short</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>short</code>s in this buffer.
- */
- public abstract short get ();
-
- /**
- * Writes the <code>short</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferOverflowException If there no remaining
- * <code>short</code>s in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract ShortBuffer put (short b);
-
- /**
- * Absolute get method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public abstract short get (int index);
-
- /**
- * Absolute put method.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract ShortBuffer put (int index, short b);
-
- /**
- * Compacts this buffer.
- *
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public abstract ShortBuffer compact ();
-
- /**
- * Tells wether or not this buffer is direct.
- */
- public abstract boolean isDirect ();
-
- /**
- * Creates a new <code>ShortBuffer</code> whose content is a shared
- * subsequence of this buffer's content.
- */
- public abstract ShortBuffer slice ();
-
- /**
- * Creates a new <code>ShortBuffer</code> that shares this buffer's
- * content.
- */
- public abstract ShortBuffer duplicate ();
-
- /**
- * Creates a new read-only <code>ShortBuffer</code> that shares this
- * buffer's content.
- */
- public abstract ShortBuffer asReadOnlyBuffer ();
-}
diff --git a/libjava/java/nio/ShortBufferImpl.java b/libjava/java/nio/ShortBufferImpl.java
deleted file mode 100644
index ee5bff2f95b..00000000000
--- a/libjava/java/nio/ShortBufferImpl.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/* ShortBufferImpl.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-/**
- * This is a Heap memory implementation
- */
-final class ShortBufferImpl extends ShortBuffer
-{
- private boolean readOnly;
-
- ShortBufferImpl (int capacity)
- {
- this (new short [capacity], 0, capacity, capacity, 0, -1, false);
- }
-
- ShortBufferImpl (short[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
- {
- super (capacity, limit, position, mark);
- this.backing_buffer = buffer;
- this.array_offset = offset;
- this.readOnly = readOnly;
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public ShortBuffer slice ()
- {
- return new ShortBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
- }
-
- public ShortBuffer duplicate ()
- {
- return new ShortBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
- }
-
- public ShortBuffer asReadOnlyBuffer ()
- {
- return new ShortBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
- }
-
- public ShortBuffer compact ()
- {
- checkIfReadOnly();
- mark = -1;
- int copied = 0;
-
- while (remaining () > 0)
- {
- put (copied, get ());
- copied++;
- }
-
- position (copied);
- limit(capacity());
- return this;
- }
-
- public boolean isDirect ()
- {
- return false;
- }
-
- /**
- * Reads the <code>short</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>short</code>s in this buffer.
- */
- public short get ()
- {
- checkForUnderflow();
-
- short result = backing_buffer [position ()];
- position (position () + 1);
- return result;
- }
-
- /**
- * Relative put method. Writes <code>value</code> to the next position
- * in the buffer.
- *
- * @exception BufferOverflowException If there no remaining
- * space in this buffer.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public ShortBuffer put (short value)
- {
- checkIfReadOnly();
- checkForOverflow();
-
- backing_buffer [position ()] = value;
- position (position () + 1);
- return this;
- }
-
- /**
- * Absolute get method. Reads the <code>short</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public short get (int index)
- {
- checkIndex(index);
-
- return backing_buffer [index];
- }
-
- /**
- * Absolute put method. Writes <code>value</code> to position
- * <code>index</code> in the buffer.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- * @exception ReadOnlyBufferException If this buffer is read-only.
- */
- public ShortBuffer put (int index, short value)
- {
- checkIfReadOnly();
- checkIndex(index);
-
- backing_buffer [index] = value;
- return this;
- }
-
- public ByteOrder order ()
- {
- return ByteOrder.nativeOrder ();
- }
-}
diff --git a/libjava/java/nio/ShortViewBufferImpl.java b/libjava/java/nio/ShortViewBufferImpl.java
deleted file mode 100644
index cdd559522ff..00000000000
--- a/libjava/java/nio/ShortViewBufferImpl.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/* ShortViewBufferImpl.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio;
-
-final class ShortViewBufferImpl extends ShortBuffer
-{
- /** Position in bb (i.e. a byte offset) where this buffer starts. */
- private int offset;
- private ByteBuffer bb;
- private boolean readOnly;
- private ByteOrder endian;
-
- ShortViewBufferImpl (ByteBuffer bb, int capacity)
- {
- super (capacity, capacity, 0, -1);
- this.bb = bb;
- this.offset = bb.position();
- this.readOnly = bb.isReadOnly();
- this.endian = bb.order();
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- public ShortViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
- {
- super (capacity, limit, position, mark);
- this.bb = bb;
- this.offset = offset;
- this.readOnly = readOnly;
- this.endian = endian;
- if (bb.isDirect())
- this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
- }
-
- /**
- * Reads the <code>short</code> at this buffer's current position,
- * and then increments the position.
- *
- * @exception BufferUnderflowException If there are no remaining
- * <code>short</code>s in this buffer.
- */
- public short get ()
- {
- int p = position();
- short result = ByteBufferHelper.getShort(bb, (p << 1) + offset, endian);
- position(p + 1);
- return result;
- }
-
- /**
- * Absolute get method. Reads the <code>short</code> at position
- * <code>index</code>.
- *
- * @exception IndexOutOfBoundsException If index is negative or not smaller
- * than the buffer's limit.
- */
- public short get (int index)
- {
- return ByteBufferHelper.getShort(bb, (index << 1) + offset, endian);
- }
-
- public ShortBuffer put (short value)
- {
- int p = position();
- ByteBufferHelper.putShort(bb, (p << 1) + offset, value, endian);
- position(p + 1);
- return this;
- }
-
- public ShortBuffer put (int index, short value)
- {
- ByteBufferHelper.putShort(bb, (index << 1) + offset, value, endian);
- return this;
- }
-
- public ShortBuffer compact ()
- {
- if (position () > 0)
- {
- int count = limit () - position ();
- bb.shiftDown(offset, offset + 2 * position(), 2 * count);
- position (count);
- limit (capacity ());
- }
- else
- {
- position(limit());
- limit(capacity());
- }
- return this;
- }
-
- public ShortBuffer slice ()
- {
- // Create a sliced copy of this object that shares its content.
- return new ShortViewBufferImpl (bb, (position () >> 1) + offset,
- remaining(), remaining(), 0, -1,
- readOnly, endian);
- }
-
- ShortBuffer duplicate (boolean readOnly)
- {
- int pos = position();
- reset();
- int mark = position();
- position(pos);
- return new ShortViewBufferImpl (bb, offset, capacity(), limit(),
- pos, mark, readOnly, endian);
- }
-
- public ShortBuffer duplicate ()
- {
- return duplicate(readOnly);
- }
-
- public ShortBuffer asReadOnlyBuffer ()
- {
- return duplicate(true);
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public boolean isDirect ()
- {
- return bb.isDirect ();
- }
-
- public ByteOrder order ()
- {
- return endian;
- }
-}
diff --git a/libjava/java/nio/channels/AlreadyConnectedException.java b/libjava/java/nio/channels/AlreadyConnectedException.java
deleted file mode 100644
index 133547ef308..00000000000
--- a/libjava/java/nio/channels/AlreadyConnectedException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* AlreadyConnectedException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-public class AlreadyConnectedException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public AlreadyConnectedException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/AsynchronousCloseException.java b/libjava/java/nio/channels/AsynchronousCloseException.java
deleted file mode 100644
index f45fdd81ab4..00000000000
--- a/libjava/java/nio/channels/AsynchronousCloseException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* AsynchronousCloseException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class AsynchronousCloseException extends ClosedChannelException
-{
- /**
- * Creates the exception
- */
- public AsynchronousCloseException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/ByteChannel.java b/libjava/java/nio/channels/ByteChannel.java
deleted file mode 100644
index d7d7a451b4d..00000000000
--- a/libjava/java/nio/channels/ByteChannel.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ByteChannel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-public interface ByteChannel extends ReadableByteChannel,
- WritableByteChannel
-{
-}
diff --git a/libjava/java/nio/channels/CancelledKeyException.java b/libjava/java/nio/channels/CancelledKeyException.java
deleted file mode 100644
index 02108f6c7b3..00000000000
--- a/libjava/java/nio/channels/CancelledKeyException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* CancelledKeyException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class CancelledKeyException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public CancelledKeyException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/Channel.java b/libjava/java/nio/channels/Channel.java
deleted file mode 100644
index d488bd27dd0..00000000000
--- a/libjava/java/nio/channels/Channel.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Channel.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-
-public interface Channel
-{
- /**
- * Tells whether this channel is open or not
- *
- * @return <code>true</code>if channel is open,
- * <code>false</code> otherwise
- */
- boolean isOpen();
-
- /**
- * Closes this channel
- *
- * @exception IOException If an error occurs
- */
- void close() throws IOException;
-}
diff --git a/libjava/java/nio/channels/ClosedByInterruptException.java b/libjava/java/nio/channels/ClosedByInterruptException.java
deleted file mode 100644
index 17858f613c6..00000000000
--- a/libjava/java/nio/channels/ClosedByInterruptException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ClosedByInterruptException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class ClosedByInterruptException extends AsynchronousCloseException
-{
- /**
- * Creates the exception
- */
- public ClosedByInterruptException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/ClosedChannelException.java b/libjava/java/nio/channels/ClosedChannelException.java
deleted file mode 100644
index 0f8df9b26c4..00000000000
--- a/libjava/java/nio/channels/ClosedChannelException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ClosedChannelException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class ClosedChannelException extends IOException
-{
- /**
- * Creates the exception
- */
- public ClosedChannelException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/ClosedSelectorException.java b/libjava/java/nio/channels/ClosedSelectorException.java
deleted file mode 100644
index e1b7a8ce939..00000000000
--- a/libjava/java/nio/channels/ClosedSelectorException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ClosedSelectorException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class ClosedSelectorException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public ClosedSelectorException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/ConnectionPendingException.java b/libjava/java/nio/channels/ConnectionPendingException.java
deleted file mode 100644
index b0b71294f7e..00000000000
--- a/libjava/java/nio/channels/ConnectionPendingException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ConnectionPendingException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class ConnectionPendingException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public ConnectionPendingException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/DatagramChannel.java b/libjava/java/nio/channels/DatagramChannel.java
deleted file mode 100644
index d257ff33865..00000000000
--- a/libjava/java/nio/channels/DatagramChannel.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/* DatagramChannel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.net.DatagramSocket;
-import java.net.SocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.channels.spi.AbstractSelectableChannel;
-import java.nio.channels.spi.SelectorProvider;
-
-
-/**
- * @since 1.4
- */
-public abstract class DatagramChannel extends AbstractSelectableChannel
- implements ByteChannel, ScatteringByteChannel, GatheringByteChannel
-{
- /**
- * Initializes the channel.
- */
- protected DatagramChannel(SelectorProvider provider)
- {
- super(provider);
- }
-
- /**
- * Opens a datagram channel.
- *
- * @exception IOException If an error occurs
- */
- public static DatagramChannel open() throws IOException
- {
- return SelectorProvider.provider().openDatagramChannel();
- }
-
- /**
- * Reads data from this channel.
- */
- public final long read(ByteBuffer[] dsts) throws IOException
- {
- long b = 0;
-
- for (int i = 0; i < dsts.length; i++)
- b += read(dsts[i]);
-
- return b;
- }
-
- /**
- * Writes data to this channel.
- *
- * @exception IOException If an error occurs
- * @exception NotYetConnectedException The channel's socket is not connected.
- */
- public final long write(ByteBuffer[] srcs) throws IOException
- {
- long b = 0;
-
- for (int i = 0; i < srcs.length; i++)
- b += write(srcs[i]);
-
- return b;
- }
-
- /**
- * Connects this channel's socket.
- *
- * @exception AsynchronousCloseException If another thread closes this channel
- * while the connect operation is in progress.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the read operation is in progress, thereby closing the
- * channel and setting the current thread's interrupt status.
- * @exception ClosedChannelException If this channel is closed.
- * @exception IOException If an error occurs.
- * @exception SecurityException If a security manager has been installed and
- * it does not permit datagrams to be sent to the given address.
- */
- public abstract DatagramChannel connect(SocketAddress remote)
- throws IOException;
-
- /**
- * Disonnects this channel's socket.
- *
- * @exception IOException If an error occurs
- */
- public abstract DatagramChannel disconnect() throws IOException;
-
- /**
- * Tells whether or not this channel's socket is connected.
- *
- * @exception IOException If an error occurs.
- * @exception NotYetConnectedException The channel's socket is not connected.
- */
- public abstract boolean isConnected();
-
- /**
- * Reads data from this channel.
- */
- public abstract int read(ByteBuffer dst) throws IOException;
-
- /**
- * Reads data from this channel.
- *
- * @exception IOException If an error occurs.
- * @exception NotYetConnectedException The channel's socket is not connected.
- */
- public abstract long read(ByteBuffer[] dsts, int offset, int length)
- throws IOException;
-
- /**
- * Receives a datagram via this channel.
- *
- * @exception AsynchronousCloseException If another thread closes this channel
- * while the connect operation is in progress.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the read operation is in progress, thereby closing the
- * channel and setting the current thread's interrupt status.
- * @exception ClosedChannelException If this channel is closed.
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager has been installed and
- * it does not permit datagrams to be sent to the given address.
- */
- public abstract SocketAddress receive(ByteBuffer dst)
- throws IOException;
-
- /**
- * Sends a datagram via this channel.
- *
- * @exception AsynchronousCloseException If another thread closes this channel
- * while the connect operation is in progress.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the read operation is in progress, thereby closing the
- * channel and setting the current thread's interrupt status.
- * @exception ClosedChannelException If this channel is closed.
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager has been installed and
- * it does not permit datagrams to be sent to the given address.
- */
- public abstract int send(ByteBuffer src, SocketAddress target)
- throws IOException;
-
- /**
- * Retrieves the channel's socket.
- */
- public abstract DatagramSocket socket();
-
- /**
- * Writes data to this channel.
- *
- * @exception IOException If an error occurs.
- * @exception NotYetConnectedException The channel's socket is not connected.
- */
- public abstract int write(ByteBuffer src) throws IOException;
-
- /**
- * Writes data to this channel.
- *
- * @exception IOException If an error occurs.
- * @exception NotYetConnectedException The channel's socket is not connected.
- */
- public abstract long write(ByteBuffer[] srcs, int offset, int length)
- throws IOException;
-
- /**
- * Retrieves the valid operations for this channel.
- *
- * @exception IOException If an error occurs.
- * @exception NotYetConnectedException The channel's socket is not connected.
- */
- public final int validOps()
- {
- return SelectionKey.OP_READ | SelectionKey.OP_WRITE;
- }
-}
diff --git a/libjava/java/nio/channels/FileChannel.java b/libjava/java/nio/channels/FileChannel.java
deleted file mode 100644
index 944ec0b8f3e..00000000000
--- a/libjava/java/nio/channels/FileChannel.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/* FileChannel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.spi.AbstractInterruptibleChannel;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public abstract class FileChannel extends AbstractInterruptibleChannel
- implements ByteChannel, GatheringByteChannel, ScatteringByteChannel
-{
- public static class MapMode
- {
- int m;
- public static final MapMode READ_ONLY = new MapMode(0);
- public static final MapMode READ_WRITE = new MapMode(1);
- public static final MapMode PRIVATE = new MapMode(2);
-
- /**
- * Initializes the MapMode.
- */
- MapMode(int a)
- {
- m = a;
- }
-
- /**
- * Returns a string representation of the <code>MapMode</code> object.
- */
- public String toString()
- {
- if (this == READ_ONLY)
- return "READ_ONLY";
- else if (this == READ_WRITE)
- return "READ_WRITE";
-
- return "PRIVATE";
- }
- }
-
- /**
- * Initializes the channel.
- */
- protected FileChannel()
- {
- }
-
- /**
- * Maps the file into the memory.
- *
- * @exception IllegalArgumentException If the preconditions on the parameters
- * do not hold.
- * @exception IOException If an I/O error occurs.
- * @exception NonReadableChannelException If mode is READ_ONLY but this channel was
- * not opened for reading.
- * @exception NonWritableChannelException If mode is READ_WRITE or PRIVATE but this
- * channel was not opened for writing.
- */
- public abstract MappedByteBuffer map(MapMode mode, long position, long size)
- throws IOException;
-
- /**
- * Return the size of the file thus far
- *
- * @exception ClosedChannelException If this channel is closed.
- */
- public abstract long size() throws IOException;
-
- /**
- * Writes data to the channel.
- *
- * @exception IOException If an I/O error occurs.
- */
- public final long write(ByteBuffer[] srcs) throws IOException
- {
- long result = 0;
-
- for (int i = 0; i < srcs.length; i++)
- result += write(srcs[i]);
-
- return result;
- }
-
- /**
- * Writes data to the channel.
- *
- * @exception IOException If an I/O error occurs.
- */
- public abstract int write(ByteBuffer src) throws IOException;
-
- /**
- * Writes data to the channel.
- *
- * @exception AsynchronousCloseException If another thread closes this channel
- * while the transfer is in progress.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the transfer is in progress, thereby closing both
- * channels and setting the current thread's interrupt status.
- * @exception ClosedChannelException If this channel is closed.
- * @exception IllegalArgumentException If position is negative.
- * @exception IOException If an I/O error occurs.
- * @exception NonWritableChannelException If this channel was not opened for
- * writing.
- */
- public abstract int write(ByteBuffer srcs, long position)
- throws IOException;
-
- /**
- * Writes data to the channel.
- *
- * @exception IOException If an I/O error occurs.
- */
- public abstract long write(ByteBuffer[] srcs, int offset, int length)
- throws IOException;
-
- /**
- * Reads data from the channel.
- *
- * @exception IOException If an I/O error occurs.
- */
- public abstract long read(ByteBuffer[] dsts, int offset, int length)
- throws IOException;
-
- /**
- * Reads data from the channel.
- *
- * @exception IOException If an I/O error occurs.
- */
- public final long read(ByteBuffer[] dsts) throws IOException
- {
- long result = 0;
-
- for (int i = 0; i < dsts.length; i++)
- read(dsts[i]);
-
- return result;
- }
-
- /**
- * Reads data from the channel.
- *
- * @exception IOException If an I/O error occurs.
- */
- public abstract int read(ByteBuffer dst) throws IOException;
-
- /**
- * Reads data from the channel.
- *
- * @exception AsynchronousCloseException If another thread closes this channel
- * while the transfer is in progress.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the transfer is in progress, thereby closing both
- * channels and setting the current thread's interrupt status.
- * @exception ClosedChannelException If this channel is closed.
- * @exception IllegalArgumentException If position is negative.
- * @exception IOException If an I/O error occurs.
- * @exception NonReadableChannelException If this channel was not opened for
- * reading.
- */
- public abstract int read(ByteBuffer dst, long position)
- throws IOException;
-
- /**
- * Closes the channel.
- *
- * This is called from @see close.
- *
- * @exception IOException If an I/O error occurs.
- */
- protected abstract void implCloseChannel() throws IOException;
-
- /**
- * msync with the disk
- *
- * @exception ClosedChannelException If this channel is closed.
- * @exception IOException If an I/O error occurs.
- */
- public abstract void force(boolean metaData) throws IOException;
-
- /**
- * Creates a file lock for the whole assoziated file.
- *
- * @exception AsynchronousCloseException If another thread closes this channel
- * while the transfer is in progress.
- * @exception ClosedChannelException If this channel is closed.
- * @exception FileLockInterruptionException If the invoking thread is
- * interrupted while blocked in this method.
- * @exception IOException If an I/O error occurs.
- * @exception NonReadableChannelException If shared is true and this channel
- * was not opened for reading.
- * @exception NonWritableChannelException If shared is false and this channel
- * was not opened for writing.
- * @exception OverlappingFileLockException If a lock that overlaps the
- * requested region is already held by this Java virtual machine, or if
- * another thread is already blocked in this method and is attempting to lock
- * an overlapping region.
- */
- public final FileLock lock() throws IOException
- {
- return lock(0, Long.MAX_VALUE, false);
- }
-
- /**
- * Creates a file lock for a region of the assoziated file.
- *
- * @exception AsynchronousCloseException If another thread closes this channel
- * while the transfer is in progress.
- * @exception ClosedChannelException If this channel is closed.
- * @exception FileLockInterruptionException If the invoking thread is
- * interrupted while blocked in this method.
- * @exception IllegalArgumentException If the preconditions on the parameters
- * do not hold.
- * @exception IOException If an I/O error occurs.
- * @exception OverlappingFileLockException If a lock that overlaps the
- * requested region is already held by this Java virtual machine, or if
- * another thread is already blocked in this method and is attempting to lock
- * an overlapping region.
- * @exception NonReadableChannelException If shared is true and this channel
- * was not opened for reading.
- * @exception NonWritableChannelException If shared is false and this channel
- * was not opened for writing.
- */
- public abstract FileLock lock(long position, long size, boolean shared)
- throws IOException;
-
- /**
- * Tries to aqquire alock on the whole assoziated file.
- *
- * @exception ClosedChannelException If this channel is closed.
- * @exception IOException If an I/O error occurs.
- * @exception OverlappingFileLockException If a lock that overlaps the
- * requested region is already held by this Java virtual machine, or if
- * another thread is already blocked in this method and is attempting to lock
- * an overlapping region.
- */
- public final FileLock tryLock() throws IOException
- {
- return tryLock(0, Long.MAX_VALUE, false);
- }
-
- /**
- * Tries to aqquire a lock on a region of the assoziated file.
- *
- * @exception ClosedChannelException If this channel is closed.
- * @exception IllegalArgumentException If the preconditions on the parameters
- * do not hold.
- * @exception IOException If an I/O error occurs.
- * @exception OverlappingFileLockException If a lock that overlaps the
- * requested region is already held by this Java virtual machine, or if
- * another thread is already blocked in this method and is attempting to lock
- * an overlapping region.
- */
- public abstract FileLock tryLock(long position, long size, boolean shared)
- throws IOException;
-
- /**
- * Returns the current position on the file.
- *
- * @exception ClosedChannelException If this channel is closed.
- * @exception IOException If an I/O error occurs.
- */
- public abstract long position() throws IOException;
-
- /**
- * Sets the position of the channel on the assoziated file.
- *
- * @exception ClosedChannelException If this channel is closed.
- * @exception IllegalArgumentException If newPosition is negative.
- * @exception IOException If an I/O error occurs.
- */
- public abstract FileChannel position(long newPosition)
- throws IOException;
-
- /**
- * Transfers bytes from this channel's file to the given writable byte
- * channel.
- *
- * @exception AsynchronousCloseException If another thread closes this channel
- * while the transfer is in progress.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the transfer is in progress, thereby closing both
- * channels and setting the current thread's interrupt status.
- * @exception ClosedChannelException If this channel is closed.
- * @exception IllegalArgumentException If the preconditions on the parameters
- * do not hold.
- * @exception IOException If an I/O error occurs.
- * @exception NonReadableChannelException If this channel was not opened for
- * reading.
- * @exception NonWritableChannelException If the target channel was not
- * opened for writing.
- */
- public abstract long transferTo(long position, long count,
- WritableByteChannel target)
- throws IOException;
-
- /**
- * Transfers bytes from the given readable channel into this channel.
- *
- * @exception AsynchronousCloseException If another thread closes this channel
- * while the transfer is in progress.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the transfer is in progress, thereby closing both
- * channels and setting the current thread's interrupt status.
- * @exception ClosedChannelException If this channel is closed.
- * @exception IllegalArgumentException If the preconditions on the parameters
- * do not hold.
- * @exception IOException If an I/O error occurs.
- * @exception NonReadableChannelException If the source channel was not
- * opened for reading.
- * @exception NonWritableChannelException If this channel was not opened for
- * writing.
- */
- public abstract long transferFrom(ReadableByteChannel src, long position,
- long count) throws IOException;
-
- /**
- * Truncates the channel's file at <code>size</code>.
- *
- * @exception ClosedChannelException If this channel is closed.
- * @exception IllegalArgumentException If size is negative.
- * @exception IOException If an I/O error occurs.
- * @exception NonWritableChannelException If this channel was not opened for
- * writing.
- */
- public abstract FileChannel truncate(long size) throws IOException;
-}
diff --git a/libjava/java/nio/channels/FileLock.java b/libjava/java/nio/channels/FileLock.java
deleted file mode 100644
index 151c23f9f6b..00000000000
--- a/libjava/java/nio/channels/FileLock.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/* FileLock.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-
-
-/**
- * @since 1.4
- */
-public abstract class FileLock
-{
- FileChannel channel;
- long position;
- long size;
- boolean shared;
-
- /**
- * Initializes the file lock.
- *
- * @exception IllegalArgumentException If the preconditions on the parameters do not hold
- */
- protected FileLock(FileChannel channel, long position, long size,
- boolean shared)
- {
- if (position < 0 || size < 0)
- throw new IllegalArgumentException();
-
- this.channel = channel;
- this.position = position;
- this.size = size;
- this.shared = shared;
- }
-
- /**
- * Tells whether or not this lock is valid.
- */
- public abstract boolean isValid();
-
- /**
- * Releases this lock.
- *
- * @exception IOException If an error occurs
- * @exception ClosedChannelException If the locked channel is no longer open.
- */
- public abstract void release() throws IOException;
-
- /**
- * Returns the file channel upon whose file this lock is held.
- */
- public final FileChannel channel()
- {
- return channel;
- }
-
- /**
- * Tells whether this lock is shared.
- */
- public final boolean isShared()
- {
- return shared;
- }
-
- /**
- * Tells whether or not this lock overlaps the given lock range.
- */
- public final boolean overlaps(long position, long size)
- {
- if (position > this.position + this.size)
- return false;
-
- if (position + size < this.position)
- return false;
-
- return true;
- }
-
- /**
- * Returns the position within the file of the first byte of the
- * locked region.
- */
- public final long position()
- {
- return position;
- }
-
- /**
- * Returns the size of the locked region in bytes.
- */
- public final long size()
- {
- return size;
- }
-
- /**
- * Returns a string describing the range, type, and validity of this lock.
- */
- public final String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append("[");
- buf.append(position);
- buf.append(":");
- buf.append(size);
- if (shared)
- buf.append(" shared");
- else
- buf.append(" exclusive");
- if (isValid())
- buf.append(" valid]");
- else
- buf.append(" invalid]");
- return buf.toString();
- }
-}
diff --git a/libjava/java/nio/channels/FileLockInterruptionException.java b/libjava/java/nio/channels/FileLockInterruptionException.java
deleted file mode 100644
index 7d9e620464f..00000000000
--- a/libjava/java/nio/channels/FileLockInterruptionException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* FileLockInterruptionException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class FileLockInterruptionException extends IOException
-{
- /**
- * Creates the exception
- */
- public FileLockInterruptionException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/GatheringByteChannel.java b/libjava/java/nio/channels/GatheringByteChannel.java
deleted file mode 100644
index 822ea232a5c..00000000000
--- a/libjava/java/nio/channels/GatheringByteChannel.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* GatheringByteChannel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-
-public interface GatheringByteChannel extends WritableByteChannel
-{
- /**
- * Writes a sequence of bytes to this channel from a subsequence of
- * the given buffers
- *
- * @exception AsynchronousCloseException If another thread closes this
- * channel while the write operation is in progress
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the write operation is in progress, thereby closing
- * the channel and setting the current thread's interrupt status
- * @exception ClosedChannelException If this channel is closed
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- * @exception IOException If an error occurs
- * @exception NonWritableChannelException If this channel was not opened for
- * writing
- */
- long write(ByteBuffer[] srcs, int offset, int length)
- throws IOException;
-
- /**
- * Writes a sequence of bytes to this channel from the given buffers
- *
- * @exception AsynchronousCloseException If another thread closes this
- * channel while the write operation is in progress
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the write operation is in progress, thereby closing
- * the channel and setting the current thread's interrupt status
- * @exception ClosedChannelException If this channel is closed
- * @exception IOException If an error occurs
- * @exception NonWritableChannelException If this channel was not opened for
- * writing
- */
- long write(ByteBuffer[] srcs) throws IOException;
-}
diff --git a/libjava/java/nio/channels/IllegalBlockingModeException.java b/libjava/java/nio/channels/IllegalBlockingModeException.java
deleted file mode 100644
index 7352b54f7f1..00000000000
--- a/libjava/java/nio/channels/IllegalBlockingModeException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* IllegalBlockingModeException.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- * @since 1.4
- *
- * Written using JDK 1.4.1 Online API from Sun
- * Status: JDK 1.4 complete
- */
-public class IllegalBlockingModeException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public IllegalBlockingModeException()
- {
- super();
- }
-}
diff --git a/libjava/java/nio/channels/IllegalSelectorException.java b/libjava/java/nio/channels/IllegalSelectorException.java
deleted file mode 100644
index 049a8d594f4..00000000000
--- a/libjava/java/nio/channels/IllegalSelectorException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* IllegalSelectorException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class IllegalSelectorException extends IllegalArgumentException
-{
- /**
- * Creates the exception
- */
- public IllegalSelectorException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/InterruptibleChannel.java b/libjava/java/nio/channels/InterruptibleChannel.java
deleted file mode 100644
index 54122ceadbc..00000000000
--- a/libjava/java/nio/channels/InterruptibleChannel.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* InterruptibleChannel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-
-
-public interface InterruptibleChannel extends Channel
-{
- /**
- * Closes this channel
- *
- * @exception IOException If an error occurs
- */
- void close() throws IOException;
-}
diff --git a/libjava/java/nio/channels/NoConnectionPendingException.java b/libjava/java/nio/channels/NoConnectionPendingException.java
deleted file mode 100644
index afefebf9807..00000000000
--- a/libjava/java/nio/channels/NoConnectionPendingException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* NoConnectionPendingException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class NoConnectionPendingException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public NoConnectionPendingException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/NonReadableChannelException.java b/libjava/java/nio/channels/NonReadableChannelException.java
deleted file mode 100644
index e6852a73d3f..00000000000
--- a/libjava/java/nio/channels/NonReadableChannelException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* NonReadableChannelException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class NonReadableChannelException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public NonReadableChannelException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/NonWritableChannelException.java b/libjava/java/nio/channels/NonWritableChannelException.java
deleted file mode 100644
index 61d40bbc4d6..00000000000
--- a/libjava/java/nio/channels/NonWritableChannelException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* NonWritableChannelException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class NonWritableChannelException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public NonWritableChannelException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/NotYetBoundException.java b/libjava/java/nio/channels/NotYetBoundException.java
deleted file mode 100644
index 7d0c66388cd..00000000000
--- a/libjava/java/nio/channels/NotYetBoundException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* NotYetBoundException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class NotYetBoundException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public NotYetBoundException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/NotYetConnectedException.java b/libjava/java/nio/channels/NotYetConnectedException.java
deleted file mode 100644
index 463e05934a8..00000000000
--- a/libjava/java/nio/channels/NotYetConnectedException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* NotYetConnectedException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class NotYetConnectedException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public NotYetConnectedException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/OverlappingFileLockException.java b/libjava/java/nio/channels/OverlappingFileLockException.java
deleted file mode 100644
index ce0900c6a49..00000000000
--- a/libjava/java/nio/channels/OverlappingFileLockException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* OverlappingFileLockException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class OverlappingFileLockException extends IllegalStateException
-{
- /**
- * Creates the exception
- */
- public OverlappingFileLockException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/Pipe.java b/libjava/java/nio/channels/Pipe.java
deleted file mode 100644
index c7b04c88c8f..00000000000
--- a/libjava/java/nio/channels/Pipe.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Pipe.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.nio.channels.spi.AbstractSelectableChannel;
-import java.nio.channels.spi.SelectorProvider;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public abstract class Pipe
-{
- public abstract static class SinkChannel extends AbstractSelectableChannel
- implements WritableByteChannel, GatheringByteChannel
- {
- /**
- * Initializes the channel.
- */
- protected SinkChannel(SelectorProvider provider)
- {
- super(provider);
- }
-
- /**
- * Returns an operation set that is valid on this channel.
- *
- * The only valid operation on this channel is @see SelectionKey.OP_WRITE.
- */
- public final int validOps()
- {
- return SelectionKey.OP_WRITE;
- }
- }
-
- public abstract static class SourceChannel extends AbstractSelectableChannel
- implements ReadableByteChannel, ScatteringByteChannel
- {
- /**
- * Initializes the channel.
- */
- protected SourceChannel(SelectorProvider provider)
- {
- super(provider);
- }
-
- /**
- * Returns an operation set that is valid on this channel.
- *
- * The only valid operation on this channel is @see SelectionKey.OP_READ.
- */
- public final int validOps()
- {
- return SelectionKey.OP_READ;
- }
- }
-
- /**
- * Initializes the pipe.
- */
- protected Pipe()
- {
- }
-
- /**
- * Opens a pipe.
- *
- * @exception IOException If an error occurs
- */
- public static Pipe open() throws IOException
- {
- return SelectorProvider.provider().openPipe();
- }
-
- /**
- * Returns a pipe's sink channel.
- */
- public abstract Pipe.SinkChannel sink();
-
- /**
- * Returns a pipe's source channel
- */
- public abstract Pipe.SourceChannel source();
-}
diff --git a/libjava/java/nio/channels/ReadableByteChannel.java b/libjava/java/nio/channels/ReadableByteChannel.java
deleted file mode 100644
index 889662de054..00000000000
--- a/libjava/java/nio/channels/ReadableByteChannel.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ReadableByteChannel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-
-public interface ReadableByteChannel extends Channel
-{
- /**
- * Reads a sequence of bytes from this channel into the given buffer
- *
- * @param dst the buffer to put the read data into
- *
- * @return the numer of bytes read
- *
- * @exception AsynchronousCloseException If another thread closes this
- * channel while the read operation is in progress
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the read operation is in progress, thereby closing
- * the channel and setting the current thread's interrupt status
- * @exception ClosedChannelException If this channel is closed
- * @exception IOException If an error occurs
- * @exception NonReadableChannelException If this channel was not opened for
- * reading
- */
- int read(ByteBuffer dst) throws IOException;
-}
diff --git a/libjava/java/nio/channels/ScatteringByteChannel.java b/libjava/java/nio/channels/ScatteringByteChannel.java
deleted file mode 100644
index 5437ea15818..00000000000
--- a/libjava/java/nio/channels/ScatteringByteChannel.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ScatteringByteChannel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-
-public interface ScatteringByteChannel extends ReadableByteChannel
-{
- /**
- * Reads a sequence of bytes from this channel into a subsequence of the
- * given buffers
- *
- * @exception AsynchronousCloseException If another thread closes this
- * channel while the write operation is in progress
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the write operation is in progress, thereby closing
- * the channel and setting the current thread's interrupt status
- * @exception ClosedChannelException If this channel is closed
- * @exception IndexOutOfBoundsException If the preconditions on the offset
- * and length parameters do not hold
- * @exception IOException If an error occurs
- * @exception NonReadableChannelException If this channel was not opened for
- * reading
- */
- long read(ByteBuffer[] srcs, int offset, int length)
- throws IOException;
-
- /**
- * Reads a sequence of bytes from this channel into the given buffers
- *
- * @exception AsynchronousCloseException If another thread closes this
- * channel while the write operation is in progress
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the write operation is in progress, thereby closing
- * the channel and setting the current thread's interrupt status
- * @exception ClosedChannelException If this channel is closed
- * @exception IOException If an error occurs
- * @exception NonReadableChannelException If this channel was not opened for
- * reading
- */
- long read(ByteBuffer[] srcs) throws IOException;
-}
diff --git a/libjava/java/nio/channels/SelectableChannel.java b/libjava/java/nio/channels/SelectableChannel.java
deleted file mode 100644
index 70fa785ce54..00000000000
--- a/libjava/java/nio/channels/SelectableChannel.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* SelectableChannel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.nio.channels.spi.AbstractInterruptibleChannel;
-import java.nio.channels.spi.SelectorProvider;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public abstract class SelectableChannel extends AbstractInterruptibleChannel
-{
- /**
- * Initializes the channel.
- */
- protected SelectableChannel()
- {
- }
-
- /**
- * Returns the lock of this channel.
- */
- public abstract Object blockingLock();
-
- /**
- * Adjusts this channel's blocking mode.
- *
- * @exception ClosedChannelException If this channel is closed.
- * @exception IllegalBlockingModeException If block is true and this channel
- * is registered with one or more selectors.
- * @exception IOException If an error occurs.
- */
- public abstract SelectableChannel configureBlocking(boolean block)
- throws IOException;
-
- /**
- * Tells whether this channel is blocking or not.
- */
- public abstract boolean isBlocking();
-
- /**
- * Tells whether or not this channel is currently registered with
- * any selectors.
- */
- public abstract boolean isRegistered();
-
- /**
- * Retrieves the key representing the channel's registration with
- * the given selector.
- */
- public abstract SelectionKey keyFor(Selector sel);
-
- /**
- * Returns the provider that created this channel.
- */
- public abstract SelectorProvider provider();
-
- /**
- * Registers this channel with the given selector,
- * returning a selection key.
- *
- * @exception CancelledKeyException If this channel is currently registered
- * with the given selector but the corresponding key has already been cancelled
- * @exception ClosedChannelException If this channel is closed.
- * @exception IllegalArgumentException If a bit in ops does not correspond
- * to an operation that is supported by this channel, that is, if
- * set &amp; ~validOps() != 0.
- * @exception IllegalBlockingModeException If block is true and this channel
- * is registered with one or more selectors.
- * @exception IllegalSelectorException If this channel was not created by
- * the same provider as the given selector.
- */
- public final SelectionKey register(Selector sel, int ops)
- throws ClosedChannelException
- {
- return register(sel, ops, null);
- }
-
- /**
- * Registers this channel with the given selector,
- * returning a selection key.
- *
- * @exception CancelledKeyException If this channel is currently registered
- * with the given selector but the corresponding key has already been
- * cancelled.
- * @exception ClosedChannelException If this channel is closed.
- * @exception IllegalArgumentException If a bit in ops does not correspond
- * to an operation that is supported by this channel, that is, if
- * set &amp; ~validOps() != 0.
- * @exception IllegalBlockingModeException If block is true and this channel
- * is registered with one or more selectors.
- * @exception IllegalSelectorException If this channel was not created by
- * the same provider as the given selector.
- */
- public abstract SelectionKey register(Selector sel, int ops, Object att)
- throws ClosedChannelException;
-
- /**
- * Returns a set of valid operations on this channel.
- */
- public abstract int validOps();
-}
diff --git a/libjava/java/nio/channels/SelectionKey.java b/libjava/java/nio/channels/SelectionKey.java
deleted file mode 100644
index 5219b6bff84..00000000000
--- a/libjava/java/nio/channels/SelectionKey.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/* SelectionKey.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public abstract class SelectionKey
-{
- public static final int OP_ACCEPT = 16;
- public static final int OP_CONNECT = 8;
- public static final int OP_READ = 1;
- public static final int OP_WRITE = 4;
- Object attached;
-
- /**
- * Initializes the selection key.
- */
- protected SelectionKey()
- {
- }
-
- /**
- * Attaches obj to the key and returns the old attached object.
- */
- public final Object attach(Object obj)
- {
- Object old = attached;
- attached = obj;
- return old;
- }
-
- /**
- * Returns the object attached to the key.
- */
- public final Object attachment()
- {
- return attached;
- }
-
- /**
- * Tests if the channel attached to this key is ready to accept
- * a new socket connection.
- *
- * @exception CancelledKeyException If this key has been cancelled
- */
- public final boolean isAcceptable()
- {
- return (readyOps() & OP_ACCEPT) != 0;
- }
-
- /**
- * Tests whether this key's channel has either finished,
- * or failed to finish, its socket-connection operation.
- *
- * @exception CancelledKeyException If this key has been cancelled
- */
- public final boolean isConnectable()
- {
- return (readyOps() & OP_CONNECT) != 0;
- }
-
- /**
- * Tests if the channel attached to the key is readable.
- *
- * @exception CancelledKeyException If this key has been cancelled
- */
- public final boolean isReadable()
- {
- return (readyOps() & OP_READ) != 0;
- }
-
- /**
- * Tests if the channel attached to the key is writable.
- *
- * @exception CancelledKeyException If this key has been cancelled
- */
- public final boolean isWritable()
- {
- return (readyOps() & OP_WRITE) != 0;
- }
-
- /**
- * Requests that the registration of this key's channel with
- * its selector be cancelled.
- */
- public abstract void cancel();
-
- /**
- * return the channel attached to the key.
- */
- public abstract SelectableChannel channel();
-
- /**
- * Returns the key's interest set.
- *
- * @exception CancelledKeyException If this key has been cancelled
- */
- public abstract int interestOps();
-
- /**
- * Sets this key's interest set to the given value.
- *
- * @exception CancelledKeyException If this key has been cancelled
- * @exception IllegalArgumentException If a bit in the set does not
- * correspond to an operation that is supported by this key's channel,
- * that is, if set &amp; ~(channel().validOps()) != 0
- */
- public abstract SelectionKey interestOps(int ops);
-
- /**
- * Tells whether or not this key is valid.
- */
- public abstract boolean isValid();
-
- /**
- * Retrieves this key's ready-operation set.
- *
- * @exception CancelledKeyException If this key has been cancelled
- */
- public abstract int readyOps();
-
- /**
- * Returns the selector for which this key was created.
- */
- public abstract Selector selector();
-}
diff --git a/libjava/java/nio/channels/Selector.java b/libjava/java/nio/channels/Selector.java
deleted file mode 100644
index 2c883efd1a1..00000000000
--- a/libjava/java/nio/channels/Selector.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Selector.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.nio.channels.spi.SelectorProvider;
-import java.util.Set;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public abstract class Selector
-{
- /**
- * Initializes the selector.
- */
- protected Selector()
- {
- }
-
- /**
- * Opens a selector.
- *
- * @exception IOException If an error occurs
- */
- public static Selector open() throws IOException
- {
- return SelectorProvider.provider().openSelector();
- }
-
- /**
- * Closes the selector.
- *
- * @exception IOException If an error occurs
- */
- public abstract void close() throws IOException;
-
- /**
- * Tells whether the selector is open or not.
- */
- public abstract boolean isOpen();
-
- /**
- * Returns this selector's key set.
- *
- * @exception ClosedSelectorException If this selector is closed.
- */
- public abstract Set keys();
-
- /**
- * Returns the SelectorProvider that created the selector.
- */
- public abstract SelectorProvider provider();
-
- /**
- * Selects a set of keys whose corresponding channels are ready
- * for I/O operations.
- *
- * @exception ClosedSelectorException If this selector is closed.
- * @exception IOException If an error occurs
- */
- public abstract int select() throws IOException;
-
- /**
- * Selects a set of keys whose corresponding channels are ready
- * for I/O operations.
- *
- * @param timeout The timeout to use.
- *
- * @exception ClosedSelectorException If this selector is closed.
- * @exception IllegalArgumentException If the timeout value is negative.
- * @exception IOException If an error occurs
- */
- public abstract int select(long timeout) throws IOException;
-
- /**
- * Returns this selector's selected-key set.
- *
- * @exception ClosedSelectorException If this selector is closed.
- */
- public abstract Set selectedKeys();
-
- /**
- * Selects a set of keys whose corresponding channels are ready
- * for I/O operations.
- *
- * @exception ClosedSelectorException If this selector is closed.
- * @exception IOException If an error occurs
- */
- public abstract int selectNow() throws IOException;
-
- /**
- * Causes the first selection operation that has not yet returned to
- * return immediately.
- */
- public abstract Selector wakeup();
-}
diff --git a/libjava/java/nio/channels/ServerSocketChannel.java b/libjava/java/nio/channels/ServerSocketChannel.java
deleted file mode 100644
index 105d17f94ec..00000000000
--- a/libjava/java/nio/channels/ServerSocketChannel.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ServerSocketChannel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.nio.channels.spi.AbstractSelectableChannel;
-import java.nio.channels.spi.SelectorProvider;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public abstract class ServerSocketChannel extends AbstractSelectableChannel
-{
- /**
- * Initializes this channel.
- */
- protected ServerSocketChannel(SelectorProvider provider)
- {
- super(provider);
- }
-
- /**
- * Accepts a connection made to this channel's socket.
- *
- * @exception IOException If an error occurs
- * @exception AsynchronousCloseException If another thread closes this
- * channel while the accept operation is in progress.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the accept operation is in progress, thereby closing
- * the channel and setting the current thread's interrupt status.
- * @exception ClosedChannelException If the channel is closed.
- * @exception NotYetBoundException If the channel's socket is not yet bound.
- * @exception SecurityException If a security manager has been installed and
- * it does not permit access to the remote endpoint of the new connection.
- */
- public abstract SocketChannel accept() throws IOException;
-
- /**
- * Retrieves the channels socket.
- */
- public abstract ServerSocket socket();
-
- /**
- * Opens a server socket channel.
- *
- * @exception IOException If an error occurs
- */
- public static ServerSocketChannel open() throws IOException
- {
- return SelectorProvider.provider().openServerSocketChannel();
- }
-
- /**
- * Retrieves the valid operations for this channel.
- */
- public final int validOps()
- {
- return SelectionKey.OP_ACCEPT;
- }
-}
diff --git a/libjava/java/nio/channels/SocketChannel.java b/libjava/java/nio/channels/SocketChannel.java
deleted file mode 100644
index 50f21368c88..00000000000
--- a/libjava/java/nio/channels/SocketChannel.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/* SocketChannel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.channels.spi.AbstractSelectableChannel;
-import java.nio.channels.spi.SelectorProvider;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- * @since 1.4
- */
-public abstract class SocketChannel extends AbstractSelectableChannel
- implements ByteChannel, ScatteringByteChannel, GatheringByteChannel
-{
- /**
- * Initializes this socket channel.
- */
- protected SocketChannel(SelectorProvider provider)
- {
- super(provider);
- }
-
- /**
- * Opens a socket channel.
- *
- * @return the new <code>SocketChannel</code> object
- *
- * @exception IOException If an error occurs
- */
- public static SocketChannel open() throws IOException
- {
- return SelectorProvider.provider().openSocketChannel();
- }
-
- /**
- * Opens a channel and connects it to a remote address.
- *
- * @return the new <code>SocketChannel</code> object
- *
- * @exception AsynchronousCloseException If this channel is already connected.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the connect operation is in progress, thereby closing
- * the channel and setting the current thread's interrupt status.
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager has been installed and
- * it does not permit access to the given remote endpoint.
- * @exception UnresolvedAddressException If the given remote address is not
- * fully resolved.
- * @exception UnsupportedAddressTypeException If the type of the given remote
- * address is not supported.
- */
- public static SocketChannel open(SocketAddress remote)
- throws IOException
- {
- SocketChannel ch = open();
- ch.connect(remote);
- return ch;
- }
-
- /**
- * Reads data from the channel.
- *
- * @return the number of bytes read, zero is valid too, -1 if end of stream
- * is reached
- *
- * @exception IOException If an error occurs
- * @exception NotYetConnectedException If this channel is not yet connected.
- */
- public final long read(ByteBuffer[] dsts) throws IOException
- {
- long b = 0;
-
- for (int i = 0; i < dsts.length; i++)
- b += read(dsts[i]);
-
- return b;
- }
-
- /**
- * Writes data to the channel.
- *
- * @return the number of bytes written, zero is valid too
- *
- * @exception IOException If an error occurs
- * @exception NotYetConnectedException If this channel is not yet connected.
- */
- public final long write(ByteBuffer[] dsts) throws IOException
- {
- long b = 0;
-
- for (int i = 0; i < dsts.length; i++)
- b += write(dsts[i]);
-
- return b;
- }
-
- /**
- * Retrieves the valid operations for this channel.
- *
- * @return the valid operations
- */
- public final int validOps()
- {
- return SelectionKey.OP_CONNECT | SelectionKey.OP_READ
- | SelectionKey.OP_WRITE;
- }
-
- /**
- * Reads data from the channel.
- *
- * @return the number of bytes read, zero is valid too, -1 if end of stream
- * is reached
- *
- * @exception IOException If an error occurs
- * @exception NotYetConnectedException If this channel is not yet connected.
- */
- public abstract int read(ByteBuffer dst) throws IOException;
-
- /**
- * Connects the channel's socket to the remote address.
- *
- * @return <code>true</code> if the channel got successfully connected,
- * <code>false</code> if the channel is in non-blocking mode and connection
- * operation is still in progress.
- *
- * @exception AlreadyConnectedException If this channel is already connected.
- * @exception AsynchronousCloseException If this channel is already connected.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the connect operation is in progress, thereby closing
- * the channel and setting the current thread's interrupt status.
- * @exception ClosedChannelException If this channel is closed.
- * @exception ConnectionPendingException If a non-blocking connection
- * operation is already in progress on this channel.
- * @exception IOException If an error occurs
- * @exception SecurityException If a security manager has been installed and
- * it does not permit access to the given remote endpoint.
- * @exception UnresolvedAddressException If the given remote address is not
- * fully resolved.
- * @exception UnsupportedAddressTypeException If the type of the given remote
- * address is not supported.
- */
- public abstract boolean connect(SocketAddress remote)
- throws IOException;
-
- /**
- * Finishes the process of connecting a socket channel.
- *
- * @exception AsynchronousCloseException If this channel is already connected.
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the connect operation is in progress, thereby closing
- * the channel and setting the current thread's interrupt status.
- * @exception ClosedChannelException If this channel is closed.
- * @exception IOException If an error occurs
- * @exception NoConnectionPendingException If this channel is not connected
- * and a connection operation has not been initiated.
- */
- public abstract boolean finishConnect() throws IOException;
-
- /**
- * Tells whether or not the channel's socket is connected.
- */
- public abstract boolean isConnected();
-
- /**
- * Tells whether or not a connection operation is in progress on this channel.
- */
- public abstract boolean isConnectionPending();
-
- /**
- * Reads data from the channel.
- *
- * @return the number of bytes read, zero is valid too, -1 if end of stream
- * is reached
- *
- * @exception IOException If an error occurs
- * @exception NotYetConnectedException If this channel is not yet connected.
- */
- public abstract long read(ByteBuffer[] dsts, int offset, int length)
- throws IOException;
-
- /**
- * Retrieves the channel's socket.
- *
- * @return the socket
- */
- public abstract Socket socket();
-
- /**
- * Writes data to the channel.
- *
- * @return the number of bytes written, zero is valid too
- *
- * @exception IOException If an error occurs
- * @exception NotYetConnectedException If this channel is not yet connected.
- */
- public abstract int write(ByteBuffer src) throws IOException;
-
- /**
- * Writes data to the channel.
- *
- * @return the number of bytes written, zero is valid too
- *
- * @exception IOException If an error occurs
- * @exception NotYetConnectedException If this channel is not yet connected.
- */
- public abstract long write(ByteBuffer[] srcs, int offset, int length)
- throws IOException;
-}
diff --git a/libjava/java/nio/channels/UnresolvedAddressException.java b/libjava/java/nio/channels/UnresolvedAddressException.java
deleted file mode 100644
index 4db95a7ffdd..00000000000
--- a/libjava/java/nio/channels/UnresolvedAddressException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* UnresolvedAddressException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class UnresolvedAddressException extends IllegalArgumentException
-{
- /**
- * Creates the exception
- */
- public UnresolvedAddressException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/UnsupportedAddressTypeException.java b/libjava/java/nio/channels/UnsupportedAddressTypeException.java
deleted file mode 100644
index 7c16c813fb0..00000000000
--- a/libjava/java/nio/channels/UnsupportedAddressTypeException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* UnsupportedAddressTypeException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class UnsupportedAddressTypeException extends IllegalArgumentException
-{
- /**
- * Creates the exception
- */
- public UnsupportedAddressTypeException()
- {
- }
-}
diff --git a/libjava/java/nio/channels/WritableByteChannel.java b/libjava/java/nio/channels/WritableByteChannel.java
deleted file mode 100644
index 3845723bca0..00000000000
--- a/libjava/java/nio/channels/WritableByteChannel.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* WritableByteChannel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-
-public interface WritableByteChannel extends Channel
-{
- /**
- * Writes a sequence of bytes to this channel from the given buffer
- *
- * @exception AsynchronousCloseException If another thread closes this
- * channel while the write operation is in progress
- * @exception ClosedByInterruptException If another thread interrupts the
- * current thread while the write operation is in progress, thereby closing
- * the channel and setting the current thread's interrupt status
- * @exception ClosedChannelException If this channel is closed
- * @exception IOException If an error occurs
- * @exception NonWritableChannelException If this channel was not opened for
- * writing
- */
- int write(ByteBuffer src) throws IOException;
-}
diff --git a/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java b/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java
deleted file mode 100644
index 25e8785c08e..00000000000
--- a/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/* AbstractInterruptibleChannel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels.spi;
-
-import java.io.IOException;
-import java.nio.channels.AsynchronousCloseException;
-import java.nio.channels.Channel;
-import java.nio.channels.InterruptibleChannel;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public abstract class AbstractInterruptibleChannel
- implements Channel, InterruptibleChannel
-{
- private boolean closed;
-
- /**
- * Initializes the channel.
- */
- protected AbstractInterruptibleChannel()
- {
- }
-
- /**
- * Marks the beginning of an I/O operation that might block indefinitely.
- */
- protected final void begin()
- {
- }
-
- /**
- * Closes the channel.
- *
- * @exception IOException If an error occurs
- */
- public final void close() throws IOException
- {
- if (! closed)
- {
- closed = true;
- implCloseChannel();
- }
- }
-
- /**
- * Marks the end of an I/O operation that might block indefinitely.
- *
- * @param completed true if the task completed successfully,
- * false otherwise
- *
- * @exception IOException if an error occurs
- * @exception AsynchronousCloseException If the channel was asynchronously
- * closed.
- * @exception ClosedByInterruptException If the thread blocked in the
- * I/O operation was interrupted.
- */
- protected final void end(boolean completed)
- throws AsynchronousCloseException
- {
- // FIXME: check more here.
-
- if (closed) throw new AsynchronousCloseException();
- }
-
- /**
- * Closes the channel.
- *
- * @exception IOException If an error occurs
- */
- protected abstract void implCloseChannel() throws IOException;
-
- /**
- * Tells whether or not this channel is open.
- *
- * @return true if the channel is open, false otherwise
- */
- public final boolean isOpen()
- {
- return ! closed;
- }
-}
diff --git a/libjava/java/nio/channels/spi/AbstractSelectableChannel.java b/libjava/java/nio/channels/spi/AbstractSelectableChannel.java
deleted file mode 100644
index 42ceab7e2c1..00000000000
--- a/libjava/java/nio/channels/spi/AbstractSelectableChannel.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/* AbstractSelectableChannel.java
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels.spi;
-
-import java.io.IOException;
-import java.nio.channels.ClosedChannelException;
-import java.nio.channels.SelectableChannel;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.util.LinkedList;
-import java.util.ListIterator;
-
-public abstract class AbstractSelectableChannel extends SelectableChannel
-{
- private boolean blocking = true;
- private Object LOCK = new Object();
- private SelectorProvider provider;
- private LinkedList keys = new LinkedList();
-
- /**
- * Initializes the channel
- *
- * @param provider the provider that created this channel
- */
- protected AbstractSelectableChannel(SelectorProvider provider)
- {
- this.provider = provider;
- }
-
- /**
- * Retrieves the object upon which the configureBlocking and register
- * methods synchronize.
- *
- * @return the blocking lock
- */
- public final Object blockingLock()
- {
- return LOCK;
- }
-
- /**
- * Adjusts this channel's blocking mode.
- *
- * @param blocking true if blocking should be enabled, false otherwise
- *
- * @return this channel
- *
- * @exception IOException If an error occurs
- */
- public final SelectableChannel configureBlocking(boolean blocking)
- throws IOException
- {
- synchronized (blockingLock())
- {
- if (this.blocking != blocking)
- {
- implConfigureBlocking(blocking);
- this.blocking = blocking;
- }
- }
-
- return this;
- }
-
- /**
- * Closes this channel.
- *
- * @exception IOException If an error occurs
- */
- protected final void implCloseChannel() throws IOException
- {
- implCloseSelectableChannel();
- }
-
- /**
- * Closes this selectable channel.
- *
- * @exception IOException If an error occurs
- */
- protected abstract void implCloseSelectableChannel()
- throws IOException;
-
- /**
- * Adjusts this channel's blocking mode.
- *
- * @param blocking true if blocking should be enabled, false otherwise
- *
- * @exception IOException If an error occurs
- */
- protected abstract void implConfigureBlocking(boolean blocking)
- throws IOException;
-
- /**
- * Tells whether or not every I/O operation on this channel will block
- * until it completes.
- *
- * @return true of this channel is blocking, false otherwise
- */
- public final boolean isBlocking()
- {
- return blocking;
- }
-
- /**
- * Tells whether or not this channel is currently registered with
- * any selectors.
- *
- * @return true if this channel is registered, false otherwise
- */
- public final boolean isRegistered()
- {
- return ! keys.isEmpty();
- }
-
- /**
- * Retrieves the key representing the channel's registration with the
- * given selector.
- *
- * @param selector the selector to get a selection key for
- *
- * @return the selection key this channel is registered with
- */
- public final SelectionKey keyFor(Selector selector)
- {
- if (! isOpen())
- return null;
-
- try
- {
- synchronized (blockingLock())
- {
- return locate(selector);
- }
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * Returns the provider that created this channel.
- *
- * @return the selector provider that created this channel
- */
- public final SelectorProvider provider()
- {
- return provider;
- }
-
- private SelectionKey locate(Selector selector)
- {
- ListIterator it = keys.listIterator();
-
- while (it.hasNext())
- {
- SelectionKey key = (SelectionKey) it.next();
-
- if (key.selector() == selector)
- return key;
- }
-
- return null;
- }
-
- /**
- * Registers this channel with the given selector, returning a selection key.
- *
- * @param selin the seletor to use
- * @param ops the interested operations
- * @param att an attachment for the returned selection key
- *
- * @return the registered selection key
- *
- * @exception ClosedChannelException If the channel is already closed.
- */
- public final SelectionKey register(Selector selin, int ops, Object att)
- throws ClosedChannelException
- {
- if (! isOpen())
- throw new ClosedChannelException();
-
- if ((ops & ~validOps()) != 0)
- throw new IllegalArgumentException();
-
- SelectionKey key = null;
- AbstractSelector selector = (AbstractSelector) selin;
-
- synchronized (blockingLock())
- {
- key = locate(selector);
-
- if (key != null && key.isValid())
- {
- if (att != null)
- key.attach(att);
- }
- else
- {
- key = selector.register(this, ops, att);
-
- if (key != null)
- addSelectionKey(key);
- }
- }
-
- return key;
- }
-
- void addSelectionKey(SelectionKey key)
- {
- keys.add(key);
- }
-
- // This method gets called by AbstractSelector.deregister().
- void removeSelectionKey(SelectionKey key)
- {
- keys.remove(key);
- }
-}
diff --git a/libjava/java/nio/channels/spi/AbstractSelectionKey.java b/libjava/java/nio/channels/spi/AbstractSelectionKey.java
deleted file mode 100644
index 5ab8468bf2e..00000000000
--- a/libjava/java/nio/channels/spi/AbstractSelectionKey.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* AbstractSelectionKey.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels.spi;
-
-import java.nio.channels.SelectionKey;
-
-
-/**
- * @since 1.4
- */
-public abstract class AbstractSelectionKey extends SelectionKey
-{
- private boolean cancelled;
-
- /**
- * Initializes the key.
- */
- protected AbstractSelectionKey()
- {
- }
-
- /**
- * Cancels this key.
- */
- public final void cancel()
- {
- if (isValid())
- {
- ((AbstractSelector) selector()).cancelKey(this);
- cancelled = true;
- }
- }
-
- /**
- * Tells whether this key is valid or not.
- *
- * @return true if this key is valid, false otherwise
- */
- public final boolean isValid()
- {
- return ! cancelled;
- }
-}
diff --git a/libjava/java/nio/channels/spi/AbstractSelector.java b/libjava/java/nio/channels/spi/AbstractSelector.java
deleted file mode 100644
index 78380738a2c..00000000000
--- a/libjava/java/nio/channels/spi/AbstractSelector.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/* AbstractSelector.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels.spi;
-
-import java.io.IOException;
-import java.nio.channels.ClosedSelectorException;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.util.HashSet;
-import java.util.Set;
-
-
-public abstract class AbstractSelector extends Selector
-{
- private boolean closed;
- private SelectorProvider provider;
- private HashSet cancelledKeys;
-
- /**
- * Initializes the slector.
- *
- * @param provider the provider that created this selector
- */
- protected AbstractSelector(SelectorProvider provider)
- {
- this.provider = provider;
- this.cancelledKeys = new HashSet();
- }
-
- /**
- * Closes the channel.
- *
- * @exception IOException If an error occurs
- */
- public final synchronized void close() throws IOException
- {
- if (closed)
- return;
-
- implCloseSelector();
- closed = true;
- }
-
- /**
- * Tells whether this channel is open or not.
- *
- * @return true if channel is open, false otherwise.
- */
- public final boolean isOpen()
- {
- return ! closed;
- }
-
- /**
- * Marks the beginning of an I/O operation that might block indefinitely.
- */
- protected final void begin()
- {
- }
-
- /**
- * Marks the end of an I/O operation that might block indefinitely.
- */
- protected final void end()
- {
- }
-
- /**
- * Returns the provider for this selector object.
- *
- * @return the SelectorProvider object that created this seletor
- */
- public final SelectorProvider provider()
- {
- return provider;
- }
-
- /**
- * Returns the cancelled keys set.
- *
- * @return the cancelled keys set
- */
- protected final Set cancelledKeys()
- {
- if (! isOpen())
- throw new ClosedSelectorException();
-
- return cancelledKeys;
- }
-
- /**
- * Cancels a selection key.
- */
-
- // This method is only called by AbstractSelectionKey.cancel().
- final void cancelKey(AbstractSelectionKey key)
- {
- synchronized (cancelledKeys)
- {
- cancelledKeys.add(key);
- }
- }
-
- /**
- * Closes the channel.
- *
- * @exception IOException if an error occurs
- */
- protected abstract void implCloseSelector() throws IOException;
-
- /**
- * Registers a channel for the selection process.
- *
- * @param ch the channel register
- * @param ops the interested operations
- * @param att an attachement to the selection key
- *
- * @return the registered selection key
- */
- protected abstract SelectionKey register(AbstractSelectableChannel ch,
- int ops, Object att);
-
- /**
- * Deregisters the given selection key.
- *
- * @param key the key to deregister
- */
- protected final void deregister(AbstractSelectionKey key)
- {
- ((AbstractSelectableChannel) key.channel()).removeSelectionKey(key);
- }
-}
diff --git a/libjava/java/nio/channels/spi/SelectorProvider.java b/libjava/java/nio/channels/spi/SelectorProvider.java
deleted file mode 100644
index db4e65fe14e..00000000000
--- a/libjava/java/nio/channels/spi/SelectorProvider.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/* SelectorProvider.java
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.channels.spi;
-
-import gnu.java.nio.SelectorProviderImpl;
-
-import java.io.IOException;
-import java.nio.channels.DatagramChannel;
-import java.nio.channels.Pipe;
-import java.nio.channels.ServerSocketChannel;
-import java.nio.channels.SocketChannel;
-
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public abstract class SelectorProvider
-{
- private static SelectorProvider systemDefaultProvider;
-
- /**
- * Initializes the selector provider.
- *
- * @exception SecurityException If a security manager has been installed and
- * it denies @see RuntimePermission ("selectorProvider").
- */
- protected SelectorProvider()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new RuntimePermission("selectorProvider"));
- }
-
- /**
- * Opens a datagram channel.
- *
- * @return a new datagram channel object
- *
- * @exception IOException if an error occurs
- */
- public abstract DatagramChannel openDatagramChannel()
- throws IOException;
-
- /**
- * Opens a pipe.
- *
- * @return a new pipe object
- *
- * @exception IOException if an error occurs
- */
- public abstract Pipe openPipe() throws IOException;
-
- /**
- * Opens a selector.
- *
- * @return a new selector object
- *
- * @exception IOException if an error occurs
- */
- public abstract AbstractSelector openSelector() throws IOException;
-
- /**
- * Opens a server socket channel.
- *
- * @return a new server socket channel object
- *
- * @exception IOException if an error occurs
- */
- public abstract ServerSocketChannel openServerSocketChannel()
- throws IOException;
-
- /**
- * Opens a socket channel.
- *
- * @return a new socket channel object
- *
- * @exception IOException if an error occurs
- */
- public abstract SocketChannel openSocketChannel() throws IOException;
-
- /**
- * Returns the system-wide default selector provider for this invocation
- * of the Java virtual machine.
- *
- * @return the default seletor provider
- */
- public static synchronized SelectorProvider provider()
- {
- if (systemDefaultProvider == null)
- {
- String propertyValue =
- System.getProperty("java.nio.channels.spi.SelectorProvider");
-
- if (propertyValue == null || propertyValue.equals(""))
- systemDefaultProvider = new SelectorProviderImpl();
- else
- {
- try
- {
- systemDefaultProvider =
- (SelectorProvider) Class.forName(propertyValue)
- .newInstance();
- }
- catch (Exception e)
- {
- System.err.println("Could not instantiate class: "
- + propertyValue);
- systemDefaultProvider = new SelectorProviderImpl();
- }
- }
- }
-
- return systemDefaultProvider;
- }
-}
diff --git a/libjava/java/nio/charset/CharacterCodingException.java b/libjava/java/nio/charset/CharacterCodingException.java
deleted file mode 100644
index 6812ebb18a9..00000000000
--- a/libjava/java/nio/charset/CharacterCodingException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* CharacterCodingException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset;
-
-import java.io.IOException;
-
-/**
- * @since 1.4
- */
-public class CharacterCodingException extends IOException
-{
- /**
- * Creates the exception
- */
- public CharacterCodingException()
- {
- }
-}
diff --git a/libjava/java/nio/charset/CharsetDecoder.java b/libjava/java/nio/charset/CharsetDecoder.java
deleted file mode 100644
index 0203c8803a1..00000000000
--- a/libjava/java/nio/charset/CharsetDecoder.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/* CharsetDecoder.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-
-/**
- * @author Jesse Rosenstock
- * @since 1.4
- */
-public abstract class CharsetDecoder
-{
- private static final int STATE_RESET = 0;
- private static final int STATE_CODING = 1;
- private static final int STATE_END = 2;
- private static final int STATE_FLUSHED = 3;
-
- private static final String DEFAULT_REPLACEMENT = "\uFFFD";
-
- private final Charset charset;
- private final float averageCharsPerByte;
- private final float maxCharsPerByte;
- private String replacement;
-
- private int state = STATE_RESET;
-
- private CodingErrorAction malformedInputAction
- = CodingErrorAction.REPORT;
- private CodingErrorAction unmappableCharacterAction
- = CodingErrorAction.REPORT;
-
- private CharsetDecoder (Charset cs, float averageCharsPerByte,
- float maxCharsPerByte, String replacement)
- {
- if (averageCharsPerByte <= 0.0f)
- throw new IllegalArgumentException ("Non-positive averageCharsPerByte");
- if (maxCharsPerByte <= 0.0f)
- throw new IllegalArgumentException ("Non-positive maxCharsPerByte");
-
- this.charset = cs;
- this.averageCharsPerByte
- = averageCharsPerByte;
- this.maxCharsPerByte
- = maxCharsPerByte;
- this.replacement = replacement;
- implReplaceWith (replacement);
- }
-
- protected CharsetDecoder (Charset cs, float averageCharsPerByte,
- float maxCharsPerByte)
- {
- this (cs, averageCharsPerByte, maxCharsPerByte, DEFAULT_REPLACEMENT);
- }
-
- public final float averageCharsPerByte ()
- {
- return averageCharsPerByte;
- }
-
- public final Charset charset ()
- {
- return charset;
- }
-
- public final CharBuffer decode (ByteBuffer in)
- throws CharacterCodingException
- {
- // XXX: Sun's Javadoc seems to contradict itself saying an
- // IllegalStateException is thrown "if a decoding operation is already
- // in progress" and also that "it resets this Decoder".
- // Should we check to see that the state is reset, or should we
- // call reset()?
- if (state != STATE_RESET)
- throw new IllegalStateException ();
-
- // REVIEW: Using max instead of average may allocate a very large
- // buffer. Maybe we should do something more efficient?
- int remaining = in.remaining ();
- int n = (int) (remaining * maxCharsPerByte ());
- CharBuffer out = CharBuffer.allocate (n);
-
- if (remaining == 0)
- {
- state = STATE_FLUSHED;
- return out;
- }
-
- CoderResult cr = decode (in, out, true);
- if (cr.isError ())
- cr.throwException ();
-
- cr = flush (out);
- if (cr.isError ())
- cr.throwException ();
-
- reset();
- out.flip ();
- return out;
- }
-
- public final CoderResult decode (ByteBuffer in, CharBuffer out,
- boolean endOfInput)
- {
- int newState = endOfInput ? STATE_END : STATE_CODING;
- // XXX: Need to check for "previous step was an invocation [not] of
- // this method with a value of true for the endOfInput parameter but
- // a return value indicating an incomplete decoding operation"
- // XXX: We will not check the previous return value, just
- // that the previous call passed true for endOfInput
- if (state != STATE_RESET && state != STATE_CODING
- && !(endOfInput && state == STATE_END))
- throw new IllegalStateException ();
- state = newState;
-
- for (;;)
- {
- CoderResult cr;
- try
- {
- cr = decodeLoop (in, out);
- }
- catch (RuntimeException e)
- {
- throw new CoderMalfunctionError (e);
- }
-
- if (cr.isOverflow ())
- return cr;
-
- if (cr.isUnderflow ())
- {
- if (endOfInput && in.hasRemaining ())
- cr = CoderResult.malformedForLength (in.remaining ());
- else
- return cr;
- }
-
- CodingErrorAction action = cr.isMalformed ()
- ? malformedInputAction
- : unmappableCharacterAction;
-
- if (action == CodingErrorAction.REPORT)
- return cr;
-
- if (action == CodingErrorAction.REPLACE)
- {
- if (out.remaining () < replacement.length ())
- return CoderResult.OVERFLOW;
- out.put (replacement);
- }
-
- in.position (in.position () + cr.length ());
- }
- }
-
- protected abstract CoderResult decodeLoop (ByteBuffer in, CharBuffer out);
-
- public Charset detectedCharset ()
- {
- throw new UnsupportedOperationException ();
- }
-
- public final CoderResult flush (CharBuffer out)
- {
- // It seems weird that you can flush after reset, but Sun's javadoc
- // says an IllegalStateException is thrown "If the previous step of the
- // current decoding operation was an invocation neither of the reset
- // method nor ... of the three-argument decode method with a value of
- // true for the endOfInput parameter."
- // Further note that flush() only requires that there not be
- // an IllegalStateException if the previous step was a call to
- // decode with true as the last argument. It does not require
- // that the call succeeded. decode() does require that it succeeded.
- // XXX: test this to see if reality matches javadoc
- if (state != STATE_RESET && state != STATE_END)
- throw new IllegalStateException ();
-
- state = STATE_FLUSHED;
- return implFlush (out);
- }
-
- protected CoderResult implFlush (CharBuffer out)
- {
- return CoderResult.UNDERFLOW;
- }
-
- public final CharsetDecoder onMalformedInput (CodingErrorAction newAction)
- {
- if (newAction == null)
- throw new IllegalArgumentException ("Null action");
-
- malformedInputAction = newAction;
- implOnMalformedInput (newAction);
- return this;
- }
-
- protected void implOnMalformedInput (CodingErrorAction newAction)
- {
- // default implementation does nothing
- }
-
- protected void implOnUnmappableCharacter (CodingErrorAction newAction)
- {
- // default implementation does nothing
- }
-
- protected void implReplaceWith (String newReplacement)
- {
- // default implementation does nothing
- }
-
- protected void implReset ()
- {
- // default implementation does nothing
- }
-
- public boolean isAutoDetecting ()
- {
- return false;
- }
-
- public boolean isCharsetDetected ()
- {
- throw new UnsupportedOperationException ();
- }
-
- public CodingErrorAction malformedInputAction ()
- {
- return malformedInputAction;
- }
-
- public final float maxCharsPerByte ()
- {
- return maxCharsPerByte;
- }
-
- public final CharsetDecoder onUnmappableCharacter
- (CodingErrorAction newAction)
- {
- if (newAction == null)
- throw new IllegalArgumentException ("Null action");
-
- unmappableCharacterAction = newAction;
- implOnUnmappableCharacter (newAction);
- return this;
- }
-
- public final String replacement ()
- {
- return replacement;
- }
-
- public final CharsetDecoder replaceWith (String newReplacement)
- {
- if (newReplacement == null)
- throw new IllegalArgumentException ("Null replacement");
- if (newReplacement.length () == 0)
- throw new IllegalArgumentException ("Empty replacement");
- // XXX: what about maxCharsPerByte?
-
- this.replacement = newReplacement;
- implReplaceWith (newReplacement);
- return this;
- }
-
- public final CharsetDecoder reset ()
- {
- state = STATE_RESET;
- implReset ();
- return this;
- }
-
- public CodingErrorAction unmappableCharacterAction ()
- {
- return unmappableCharacterAction;
- }
-}
diff --git a/libjava/java/nio/charset/CharsetEncoder.java b/libjava/java/nio/charset/CharsetEncoder.java
deleted file mode 100644
index 0c6184f2989..00000000000
--- a/libjava/java/nio/charset/CharsetEncoder.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/* CharsetEncoder.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-
-/**
- * @author Jesse Rosenstock
- * @since 1.4
- */
-public abstract class CharsetEncoder
-{
- private static final int STATE_RESET = 0;
- private static final int STATE_CODING = 1;
- private static final int STATE_END = 2;
- private static final int STATE_FLUSHED = 3;
-
- private static final byte[] DEFAULT_REPLACEMENT = {(byte)'?'};
-
- private final Charset charset;
- private final float averageBytesPerChar;
- private final float maxBytesPerChar;
- private byte[] replacement;
-
- private int state = STATE_RESET;
-
- private CodingErrorAction malformedInputAction
- = CodingErrorAction.REPORT;
- private CodingErrorAction unmappableCharacterAction
- = CodingErrorAction.REPORT;
-
- protected CharsetEncoder (Charset cs, float averageBytesPerChar,
- float maxBytesPerChar)
- {
- this (cs, averageBytesPerChar, maxBytesPerChar, DEFAULT_REPLACEMENT);
- }
-
- protected CharsetEncoder (Charset cs, float averageBytesPerChar,
- float maxBytesPerChar, byte[] replacement)
- {
- if (averageBytesPerChar <= 0.0f)
- throw new IllegalArgumentException ("Non-positive averageBytesPerChar");
- if (maxBytesPerChar <= 0.0f)
- throw new IllegalArgumentException ("Non-positive maxBytesPerChar");
-
- this.charset = cs;
- this.averageBytesPerChar
- = averageBytesPerChar;
- this.maxBytesPerChar
- = maxBytesPerChar;
- this.replacement = replacement;
- implReplaceWith (replacement);
- }
-
- public final float averageBytesPerChar ()
- {
- return averageBytesPerChar;
- }
-
- public boolean canEncode (char c)
- {
- CharBuffer cb = CharBuffer.allocate (1).put (c);
- cb.flip ();
- return canEncode (cb);
- }
-
- public boolean canEncode (CharSequence cs)
- {
- CharBuffer cb;
- if (cs instanceof CharBuffer)
- cb = ((CharBuffer) cs).duplicate ();
- else
- cb = CharBuffer.wrap (cs);
- return canEncode (cb);
- }
-
- private boolean canEncode (CharBuffer cb)
- {
- // It is an error if a coding operation is "in progress"
- // I take that to mean the state is not reset or flushed.
- // XXX: check "in progress" everywhere
- if (state == STATE_FLUSHED)
- reset ();
- else if (state != STATE_RESET)
- throw new IllegalStateException ();
-
- CodingErrorAction oldMalformedInputAction = malformedInputAction;
- CodingErrorAction oldUnmappableCharacterAction
- = unmappableCharacterAction;
-
- try
- {
- if (oldMalformedInputAction != CodingErrorAction.REPORT)
- onMalformedInput (CodingErrorAction.REPORT);
- if (oldUnmappableCharacterAction != CodingErrorAction.REPORT)
- onUnmappableCharacter (CodingErrorAction.REPORT);
- }
- catch (Exception e)
- {
- return false;
- }
- finally
- {
- if (oldMalformedInputAction != CodingErrorAction.REPORT)
- onMalformedInput (oldMalformedInputAction);
- if (oldUnmappableCharacterAction != CodingErrorAction.REPORT)
- onUnmappableCharacter (oldUnmappableCharacterAction);
- }
-
- return true;
- }
-
- public final Charset charset ()
- {
- return charset;
- }
-
- public final ByteBuffer encode (CharBuffer in)
- throws CharacterCodingException
- {
- // XXX: Sun's Javadoc seems to contradict itself saying an
- // IllegalStateException is thrown "if a decoding operation is already
- // in progress" and also that "it resets this Encoder".
- // Should we check to see that the state is reset, or should we
- // call reset()?
- if (state != STATE_RESET)
- throw new IllegalStateException ();
-
- // REVIEW: Using max instead of average may allocate a very large
- // buffer. Maybe we should do something more efficient?
- int remaining = in.remaining ();
- int n = (int) (remaining * maxBytesPerChar ());
- ByteBuffer out = ByteBuffer.allocate (n);
-
- if (remaining == 0)
- {
- state = STATE_FLUSHED;
- return out;
- }
-
- CoderResult cr = encode (in, out, true);
- if (cr.isError ())
- cr.throwException ();
-
- cr = flush (out);
- if (cr.isError ())
- cr.throwException ();
-
- out.flip ();
- return out;
- }
-
- public final CoderResult encode (CharBuffer in, ByteBuffer out,
- boolean endOfInput)
- {
- int newState = endOfInput ? STATE_END : STATE_CODING;
- // XXX: Need to check for "previous step was an invocation [not] of
- // this method with a value of true for the endOfInput parameter but
- // a return value indicating an incomplete decoding operation"
- // XXX: We will not check the previous return value, just
- // that the previous call passed true for endOfInput
- if (state != STATE_RESET && state != STATE_CODING
- && !(endOfInput && state == STATE_END))
- throw new IllegalStateException ();
- state = newState;
-
- for (;;)
- {
- CoderResult cr;
- try
- {
- cr = encodeLoop (in, out);
- }
- catch (RuntimeException e)
- {
- throw new CoderMalfunctionError (e);
- }
-
- if (cr.isOverflow ())
- return cr;
-
- if (cr.isUnderflow ())
- {
- if (endOfInput && in.hasRemaining ())
- cr = CoderResult.malformedForLength (in.remaining ());
- else
- return cr;
- }
-
- CodingErrorAction action = cr.isMalformed ()
- ? malformedInputAction
- : unmappableCharacterAction;
-
- if (action == CodingErrorAction.REPORT)
- return cr;
-
- if (action == CodingErrorAction.REPLACE)
- {
- if (out.remaining () < replacement.length)
- return CoderResult.OVERFLOW;
- out.put (replacement);
- }
-
- in.position (in.position () + cr.length ());
- }
- }
-
- protected abstract CoderResult encodeLoop (CharBuffer in, ByteBuffer out);
-
- public final CoderResult flush (ByteBuffer out)
- {
- // It seems weird that you can flush after reset, but Sun's javadoc
- // says an IllegalStateException is thrown "If the previous step of the
- // current decoding operation was an invocation neither of the reset
- // method nor ... of the three-argument encode method with a value of
- // true for the endOfInput parameter."
- // Further note that flush() only requires that there not be
- // an IllegalStateException if the previous step was a call to
- // encode with true as the last argument. It does not require
- // that the call succeeded. encode() does require that it succeeded.
- // XXX: test this to see if reality matches javadoc
- if (state != STATE_RESET && state != STATE_END)
- throw new IllegalStateException ();
-
- state = STATE_FLUSHED;
- return implFlush (out);
- }
-
- protected CoderResult implFlush (ByteBuffer out)
- {
- return CoderResult.UNDERFLOW;
- }
-
- protected void implOnMalformedInput (CodingErrorAction newAction)
- {
- // default implementation does nothing
- }
-
- protected void implOnUnmappableCharacter (CodingErrorAction newAction)
- {
- // default implementation does nothing
- }
-
- protected void implReplaceWith (byte[] newReplacement)
- {
- // default implementation does nothing
- }
-
- protected void implReset ()
- {
- // default implementation does nothing
- }
-
- public boolean isLegalReplacement (byte[] replacement)
- {
- // TODO: cache the decoder
- // error actions will be REPORT after construction
- CharsetDecoder decoder = charset.newDecoder ();
- ByteBuffer bb = ByteBuffer.wrap (replacement);
- CharBuffer cb
- = CharBuffer.allocate ((int) (replacement.length
- * decoder.maxCharsPerByte ()));
- return !decoder.decode (bb, cb, true).isError ();
- }
-
- public CodingErrorAction malformedInputAction ()
- {
- return malformedInputAction;
- }
-
- public final float maxBytesPerChar ()
- {
- return maxBytesPerChar;
- }
-
- public final CharsetEncoder onMalformedInput (CodingErrorAction newAction)
- {
- if (newAction == null)
- throw new IllegalArgumentException ("Null action");
-
- malformedInputAction = newAction;
- implOnMalformedInput (newAction);
- return this;
- }
-
- public CodingErrorAction unmappableCharacterAction ()
- {
- return unmappableCharacterAction;
- }
-
- public final CharsetEncoder onUnmappableCharacter
- (CodingErrorAction newAction)
- {
- if (newAction == null)
- throw new IllegalArgumentException ("Null action");
-
- unmappableCharacterAction = newAction;
- implOnUnmappableCharacter (newAction);
- return this;
- }
-
- public final byte[] replacement ()
- {
- return replacement;
- }
-
- public final CharsetEncoder replaceWith (byte[] newReplacement)
- {
- if (newReplacement == null)
- throw new IllegalArgumentException ("Null replacement");
- if (newReplacement.length == 0)
- throw new IllegalArgumentException ("Empty replacement");
- // XXX: what about maxBytesPerChar?
-
- if (!isLegalReplacement (newReplacement))
- throw new IllegalArgumentException ("Illegal replacement");
-
- this.replacement = newReplacement;
- implReplaceWith (newReplacement);
- return this;
- }
-
- public final CharsetEncoder reset ()
- {
- state = STATE_RESET;
- implReset ();
- return this;
- }
-}
diff --git a/libjava/java/nio/charset/CoderMalfunctionError.java b/libjava/java/nio/charset/CoderMalfunctionError.java
deleted file mode 100644
index 08294cafb20..00000000000
--- a/libjava/java/nio/charset/CoderMalfunctionError.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* CoderMalfunctionError.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset;
-
-/**
- * @since 1.4
- */
-public class CoderMalfunctionError extends Error
-{
- /**
- * Creates the error
- */
- public CoderMalfunctionError(Exception cause)
- {
- super (cause);
- }
-}
diff --git a/libjava/java/nio/charset/CoderResult.java b/libjava/java/nio/charset/CoderResult.java
deleted file mode 100644
index 664215d9a68..00000000000
--- a/libjava/java/nio/charset/CoderResult.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* CoderResult.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset;
-
-import java.lang.ref.WeakReference;
-import java.nio.BufferOverflowException;
-import java.nio.BufferUnderflowException;
-import java.util.HashMap;
-
-/**
- * @author Jesse Rosenstock
- * @since 1.4
- */
-public class CoderResult
-{
- private static final int TYPE_MALFORMED = 0;
- private static final int TYPE_OVERFLOW = 1;
- private static final int TYPE_UNDERFLOW = 2;
- private static final int TYPE_UNMAPPABLE = 3;
-
- public static final CoderResult OVERFLOW
- = new CoderResult (TYPE_OVERFLOW, 0);
- public static final CoderResult UNDERFLOW
- = new CoderResult (TYPE_UNDERFLOW, 0);
-
- private static final String[] names
- = { "MALFORMED", "OVERFLOW", "UNDERFLOW", "UNMAPPABLE" };
-
- private static final Cache malformedCache
- = new Cache ()
- {
- protected CoderResult make (int length)
- {
- return new CoderResult (TYPE_MALFORMED, length);
- }
- };
-
- private static final Cache unmappableCache
- = new Cache ()
- {
- protected CoderResult make (int length)
- {
- return new CoderResult (TYPE_UNMAPPABLE, length);
- }
- };
-
- private final int type;
- private final int length;
-
- // Package-private to avoid a trampoline constructor.
- CoderResult (int type, int length)
- {
- this.type = type;
- this.length = length;
- }
-
- public boolean isError ()
- {
- return length > 0;
- }
-
- public boolean isMalformed ()
- {
- return type == TYPE_MALFORMED;
- }
-
- public boolean isOverflow ()
- {
- return type == TYPE_OVERFLOW;
- }
-
- public boolean isUnderflow ()
- {
- return type == TYPE_UNDERFLOW;
- }
-
- public boolean isUnmappable ()
- {
- return type == TYPE_UNMAPPABLE;
- }
-
- public int length ()
- {
- if (length <= 0)
- throw new UnsupportedOperationException ();
- else
- return length;
- }
-
- public static CoderResult malformedForLength (int length)
- {
- return malformedCache.get (length);
- }
-
- public void throwException ()
- throws CharacterCodingException
- {
- switch (type)
- {
- case TYPE_MALFORMED:
- throw new MalformedInputException (length);
- case TYPE_OVERFLOW:
- throw new BufferOverflowException ();
- case TYPE_UNDERFLOW:
- throw new BufferUnderflowException ();
- case TYPE_UNMAPPABLE:
- throw new UnmappableCharacterException (length);
- }
- }
-
- public String toString ()
- {
- String name = names[type];
- return (length > 0) ? name + '[' + length + ']' : name;
- }
-
- public static CoderResult unmappableForLength (int length)
- {
- return unmappableCache.get (length);
- }
-
- private abstract static class Cache
- {
- private final HashMap cache;
-
- // Package-private to avoid a trampoline constructor.
- Cache ()
- {
- cache = new HashMap ();
- }
-
- // Package-private to avoid a trampoline.
- synchronized CoderResult get (int length)
- {
- if (length <= 0)
- throw new IllegalArgumentException ("Non-positive length");
-
- Integer len = new Integer (length);
- CoderResult cr = null;
- Object o;
- if ((o = cache.get (len)) != null)
- cr = (CoderResult) ((WeakReference) o).get ();
- if (cr == null)
- {
- cr = make (length);
- cache.put (len, new WeakReference (cr));
- }
-
- return cr;
- }
-
- protected abstract CoderResult make (int length);
- }
-}
diff --git a/libjava/java/nio/charset/CodingErrorAction.java b/libjava/java/nio/charset/CodingErrorAction.java
deleted file mode 100644
index 592c15934ac..00000000000
--- a/libjava/java/nio/charset/CodingErrorAction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* CodingErrorAction.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset;
-
-public class CodingErrorAction
-{
- public static final CodingErrorAction IGNORE
- = new CodingErrorAction("ignore");
- public static final CodingErrorAction REPLACE
- = new CodingErrorAction("replace");
- public static final CodingErrorAction REPORT
- = new CodingErrorAction("report");
-
- private final String name;
-
- /**
- * Private constructor only used to create the constant CodingErrorActions.
- */
- private CodingErrorAction(String name)
- {
- this.name = name;
- }
-
- /**
- * Returns the name of the CodingErrorAction.
- */
- public String toString ()
- {
- return name;
- }
-}
diff --git a/libjava/java/nio/charset/IllegalCharsetNameException.java b/libjava/java/nio/charset/IllegalCharsetNameException.java
deleted file mode 100644
index 7baeac3234e..00000000000
--- a/libjava/java/nio/charset/IllegalCharsetNameException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* IllegalCharsetNameException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset;
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class IllegalCharsetNameException extends IllegalArgumentException
-{
- /**
- * Compatible with JDK 1.4+
- */
- private static final long serialVersionUID = 1457525358470002989L;
-
- private String charsetName;
-
- /**
- * Creates the exception
- *
- * @param charsetName name of the illegal charset
- */
- public IllegalCharsetNameException (String charsetName)
- {
- super ();
- this.charsetName = charsetName;
- }
-
- /**
- * Retrieves the illegal charset name
- *
- * @return the illegal charset name
- */
- public String getCharsetName ()
- {
- return charsetName;
- }
-}
diff --git a/libjava/java/nio/charset/MalformedInputException.java b/libjava/java/nio/charset/MalformedInputException.java
deleted file mode 100644
index 0beceb40cb3..00000000000
--- a/libjava/java/nio/charset/MalformedInputException.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* MalformedInputException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset;
-
-/**
- * @since 1.4
- */
-public class MalformedInputException extends CharacterCodingException
-{
- private int inputLength;
-
- /**
- * Creates the exception
- *
- * @param inputLength the position of malformed input in the input stream
- */
- public MalformedInputException (int inputLength)
- {
- super ();
- this.inputLength = inputLength;
- }
-
- /**
- * Retrieves the position of the malformed input in the input stream.
- *
- * @return the position
- */
- public int getInputLength ()
- {
- return inputLength;
- }
-
- /**
- * Returns the detail message string of this throwable
- *
- * @return the message
- */
- public String getMessage ()
- {
- return "Input length = " + inputLength;
- }
-}
diff --git a/libjava/java/nio/charset/UnmappableCharacterException.java b/libjava/java/nio/charset/UnmappableCharacterException.java
deleted file mode 100644
index 71906510849..00000000000
--- a/libjava/java/nio/charset/UnmappableCharacterException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* UnmappableCharacterException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset;
-
-/**
- * @since 1.4
- */
-public class UnmappableCharacterException extends CharacterCodingException
-{
- private int inputLength;
-
- /**
- * Creates the exception
- */
- public UnmappableCharacterException (int inputLength)
- {
- super ();
- this.inputLength = inputLength;
- }
-
- /**
- * Retrieves the illegal charset name
- */
- public int getInputLength ()
- {
- return inputLength;
- }
-
- /**
- * Returns the detail message string of this throwable
- */
- public String getMessage ()
- {
- return "Input length = " + inputLength;
- }
-}
diff --git a/libjava/java/nio/charset/UnsupportedCharsetException.java b/libjava/java/nio/charset/UnsupportedCharsetException.java
deleted file mode 100644
index 39536baa563..00000000000
--- a/libjava/java/nio/charset/UnsupportedCharsetException.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* UnsupportedCharsetException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset;
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class UnsupportedCharsetException extends IllegalArgumentException
-{
- /**
- * Compatible with JDK 1.4+
- */
- private static final long serialVersionUID = 1490765524727386367L;
-
- String charsetName;
-
- /**
- * Creates the exception
- */
- public UnsupportedCharsetException (String charsetName)
- {
- super ();
- this.charsetName = charsetName;
- }
-
- /**
- * Retrieves the illegal charset name
- */
- public String getCharsetName ()
- {
- return charsetName;
- }
-}
diff --git a/libjava/java/nio/charset/spi/CharsetProvider.java b/libjava/java/nio/charset/spi/CharsetProvider.java
deleted file mode 100644
index f0d40ab8591..00000000000
--- a/libjava/java/nio/charset/spi/CharsetProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/* CharsetProvider.java -- charset service provider interface
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.nio.charset.spi;
-
-import java.nio.charset.Charset;
-import java.util.Iterator;
-
-
-/**
- * This class allows an implementor to provide additional character sets. The
- * subclass must have a nullary constructor, and be attached to charset
- * implementation classes. These extensions are loaded via the context class
- * loader. To provide the charset extension, all files named
- * <code>META-INF/services/java.nio.charset.spi.CharsetProvider</code> are
- * read from the classpath. Each one should be a UTF-8 encoded list of
- * fully-qualified names of concrete subclasses of this class; whitespace is
- * ignored, and '#' starts comments. Duplicates are ignored. The
- * implementations must be accessible to the classloader that requests them.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Charset
- * @since 1.4
- * @status updated to 1.4
- */
-public abstract class CharsetProvider
-{
- /**
- * Initialize a new charset provider. This performs a security check on
- * RuntimePermission("charsetProvider").
- *
- * @throws SecurityException if building a new set is not allowed
- */
- protected CharsetProvider()
- {
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkPermission(new RuntimePermission("charsetProvider"));
- }
-
- /**
- * Returns an iterator over the charsets defined by this provider.
- *
- * @return the iterator
- * @see Charset#availableCharsets()
- */
- public abstract Iterator charsets();
-
- /**
- * Returns the named charset, by canonical name or alias.
- *
- * @param name the name of the character
- *
- * @return the charset, or null if not supported
- */
- public abstract Charset charsetForName(String name);
-} // class CharsetProvider
diff --git a/libjava/java/rmi/AccessException.java b/libjava/java/rmi/AccessException.java
deleted file mode 100644
index b470780046c..00000000000
--- a/libjava/java/rmi/AccessException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* AccessException.java -- thrown if the caller does not have access
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Thrown to indicate that the caller does not have permission to access
- * certain data, such as <code>bind</code> in an ActivationSystem.
- *
- * @author unknown
- * @see Naming
- * @see ActivationSystem
- * @since 1.1
- */
-public class AccessException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 6314925228044966088l;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public AccessException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public AccessException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/AlreadyBoundException.java b/libjava/java/rmi/AlreadyBoundException.java
deleted file mode 100644
index 091c0ee5862..00000000000
--- a/libjava/java/rmi/AlreadyBoundException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* AlreadyBoundException.java -- thrown if a binding is already bound
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Thrown on an attempt to bind an object in the registry that is already
- * bound.
- *
- * @author unknown
- * @see Naming#bind(String, Remote)
- * @see Registry#bind(String, Remote)
- * @since 1.1
- * @status updated to 1.4
- */
-public class AlreadyBoundException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 9218657361741657110L;
-
- /**
- * Create an exception with no message.
- */
- public AlreadyBoundException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public AlreadyBoundException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/rmi/ConnectException.java b/libjava/java/rmi/ConnectException.java
deleted file mode 100644
index dc3abd19741..00000000000
--- a/libjava/java/rmi/ConnectException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ConnectException.java -- thrown if a connection is refused
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Thrown if a connection is refused for a remote call.
- *
- * @author unknown
- * @since 1.1
- * @status updated to 1.4
- */
-public class ConnectException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 4863550261346652506L;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public ConnectException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public ConnectException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/ConnectIOException.java b/libjava/java/rmi/ConnectIOException.java
deleted file mode 100644
index dde753ad558..00000000000
--- a/libjava/java/rmi/ConnectIOException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ConnectIOException.java -- thrown if an IO exception occurs during connect
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Wraps an I/O Exception thrown while connecting for a remote call.
- *
- * @author unknown
- * @since 1.1
- * @status updated to 1.4
- */
-public class ConnectIOException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -8087809532704668744L;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public ConnectIOException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public ConnectIOException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/MarshalException.java b/libjava/java/rmi/MarshalException.java
deleted file mode 100644
index e5c10a4bf79..00000000000
--- a/libjava/java/rmi/MarshalException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* MarshalException.java -- wraps error while marshalling parameters
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Thrown if an exception occurs while marshalling data to send in a remote
- * call. The call may not be retransmitted, if the "at most once" semantics
- * are to be preserved.
- *
- * @author unknown
- * @since 1.1
- * @status updated to 1.4
- */
-public class MarshalException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 6223554758134037936L;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public MarshalException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public MarshalException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/MarshalledObject.java b/libjava/java/rmi/MarshalledObject.java
deleted file mode 100644
index 9ec0ace0e70..00000000000
--- a/libjava/java/rmi/MarshalledObject.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* MarshalledObject.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-import gnu.java.rmi.RMIMarshalledObjectInputStream;
-import gnu.java.rmi.RMIMarshalledObjectOutputStream;
-
-import java.io.ByteArrayOutputStream;
-import java.io.Serializable;
-
-/**
- * FIXME - doc missing
- */
-public final class MarshalledObject implements Serializable
-{
- //The following fields are from Java API Documentation "Serialized form"
- private static final long serialVersionUID = 8988374069173025854L;
- byte[] objBytes;
- byte[] locBytes;
- int hash;
-
- public MarshalledObject(Object obj) throws java.io.IOException
- {
- ByteArrayOutputStream objStream = new ByteArrayOutputStream();
- RMIMarshalledObjectOutputStream stream = new RMIMarshalledObjectOutputStream(objStream);
- stream.writeObject(obj);
- stream.flush();
- objBytes = objStream.toByteArray();
- locBytes = stream.getLocBytes();
-
- //The following algorithm of calculating hashCode is similar to String
- hash = 0;
- for (int i = 0; i < objBytes.length; i++)
- hash = hash * 31 + objBytes[i];
- if(locBytes != null)
- for (int i = 0; i < locBytes.length; i++)
- hash = hash * 31 + locBytes[i];
- }
-
- public boolean equals(Object obj)
- {
- if (! (obj instanceof MarshalledObject))
- return false;
-
- // hashCode even differs, don't do the time-consuming comparisons
- if (obj.hashCode() != hash)
- return false;
-
- MarshalledObject aobj = (MarshalledObject)obj;
- if (objBytes == null || aobj.objBytes == null)
- return objBytes == aobj.objBytes;
- if (objBytes.length != aobj.objBytes.length)
- return false;
- for (int i = 0; i < objBytes.length; i++)
- {
- if (objBytes[i] != aobj.objBytes[i])
- return false;
- }
- // Ignore comparison of locBytes(annotation)
- return true;
- }
-
-public Object get()
- throws java.io.IOException, java.lang.ClassNotFoundException
-{
- if(objBytes == null)
- return null;
- RMIMarshalledObjectInputStream stream =
- new RMIMarshalledObjectInputStream(objBytes, locBytes);
- return stream.readObject();
-}
-
- public int hashCode() {
- return hash;
- }
-
-}
diff --git a/libjava/java/rmi/Naming.java b/libjava/java/rmi/Naming.java
deleted file mode 100644
index d48df069d8d..00000000000
--- a/libjava/java/rmi/Naming.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/* Naming.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-
-/**
- * <p>
- * The <code>Naming</code> class handles interactions with RMI registries.
- * Each method takes a URL in <code>String</code> form, which points to
- * the RMI registry. The scheme of the URL is irrelevant. The relevant
- * part is:
- * </p>
- * <p>
- * <code>//host:port/name</code>
- * </p>
- * <p>
- * which tells the method how to locate and access the registry. The host
- * and port are both optional, and default to `localhost' and the standard
- * RMI registry port (1099) respectively. The name is simply a string
- * used to refer to a particular service hosted by the registry. The
- * registry does not attempt to interpret this further.
- * </p>
- * <p>
- * RMI services are registered using one of these names, and the same name
- * is later used by the client to lookup the service and access its methods.
- * Registries can be shared by multiple services, or a service can create
- * its own registry using <code>createRegistry()</code>.
- * </p>
- *
- * @author Original author unknown.
- * @author Ingo Proetel (proetel@aicas.com)
- * @author Guilhem Lavaux (guilhem@kaffe.org)
- * @author Jeroen Frijters (jeroen@frijters.net)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.1
- */
-public final class Naming {
-
- /**
- * This class isn't intended to be instantiated.
- */
- private Naming() {}
-
-/**
- * Looks for the remote object that is associated with the named service.
- * Name and location is given in form of a URL without a scheme:
- *
- * <pre>
- * //host:port/service-name
- * </pre>
- *
- * The port is optional.
- *
- * @param name the service name and location
- * @return Remote-object that implements the named service
- * @throws NotBoundException if no object implements the service
- * @throws MalformedURLException
- * @throws RemoteException
- */
-public static Remote lookup(String name) throws NotBoundException, MalformedURLException, RemoteException {
- URL u = parseURL(name);
- String serviceName = getName(u);
- return (getRegistry(u).lookup(serviceName));
-}
-
-/**
- * Try to bind the given object to the given service name.
- * @param name
- * @param obj
- * @throws AlreadyBoundException
- * @throws MalformedURLException
- * @throws RemoteException
- */
-public static void bind(String name, Remote obj) throws AlreadyBoundException, MalformedURLException, RemoteException {
- URL u = parseURL(name);
- String serviceName = getName(u);
- getRegistry(u).bind(serviceName, obj);
-}
-
-/**
- * Remove a binding for a given service name.
- * @param name
- * @throws RemoteException
- * @throws NotBoundException
- * @throws MalformedURLException
- */
-public static void unbind(String name) throws RemoteException, NotBoundException, MalformedURLException {
- URL u = parseURL(name);
- String serviceName = getName(u);
- getRegistry(u).unbind(serviceName);
-}
-
-/**
- * Forces the binding between the given Remote-object and the given service name, even
- * if there was already an object bound to this name.
- * @param name
- * @param obj
- * @throws RemoteException
- * @throws MalformedURLException
- */
-public static void rebind(String name, Remote obj) throws RemoteException, MalformedURLException {
- URL u = parseURL(name);
- String serviceName = getName(u);
- getRegistry(u).rebind(serviceName, obj);
-}
-
-/**
- * Lists all services at the named registry.
- * @param name url that specifies the registry
- * @return list of services at the name registry
- * @throws RemoteException
- * @throws MalformedURLException
- */
-public static String[] list(String name) throws RemoteException, MalformedURLException {
- return (getRegistry(parseURL(name)).list());
-}
-
-private static Registry getRegistry(URL u) throws RemoteException {
- if (u.getPort() == -1) {
- return (LocateRegistry.getRegistry(u.getHost()));
- }
- else {
- return (LocateRegistry.getRegistry(u.getHost(), u.getPort()));
- }
-}
-
- /**
- * Parses the supplied URL and converts it to use the HTTP
- * protocol. From an RMI perspective, the scheme is irrelevant
- * and we want to be able to create a URL for which a handler is
- * available.
- *
- * @param name the URL in String form.
- * @throws MalformedURLException if the URL is invalid.
- */
- private static URL parseURL(String name)
- throws MalformedURLException
- {
- try
- {
- URI uri = new URI(name);
- String host = uri.getHost();
- int port = uri.getPort();
- String query = uri.getQuery();
- String path = uri.getPath();
- return new URL("http",
- (host == null ? "localhost" : host),
- (port == -1 ? 1099 : port),
- uri.getPath() + (query == null ? "" : query));
- }
- catch (URISyntaxException e)
- {
- throw new MalformedURLException("The URL syntax was invalid: " +
- e.getMessage());
- }
- }
-
- /**
- * Checks that the URL contains a name, and removes any leading
- * slashes.
- *
- * @param url the URL to check.
- * @throws MalformedURLException if no name is specified.
- */
- private static String getName(URL url)
- throws MalformedURLException
- {
- String filename = url.getFile();
- if (filename.length() == 0)
- throw new MalformedURLException("No path specified: " + url);
- // If the filename begins with a slash we must cut it for
- // name resolution.
- if (filename.charAt(0) == '/')
- return filename.substring(1);
- return filename;
- }
-
-}
diff --git a/libjava/java/rmi/NoSuchObjectException.java b/libjava/java/rmi/NoSuchObjectException.java
deleted file mode 100644
index 69f7d6c52fb..00000000000
--- a/libjava/java/rmi/NoSuchObjectException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* NoSuchObjectException.java -- thrown if the remote object no longer exists
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Thrown on an attempt to invoke a call on an object that no longer exists
- * in the remote Virtual Machine. The call may be retransmitted and still
- * obey the semantics of "at most once".
- *
- * @author unknown
- * @see RemoteObject#toStub(Remote)
- * @see UnicastRemoteObject#unexportObject(Remote, boolean)
- * @see Activatable#unexportObject(Remote, boolean)
- * @since 1.1
- * @status updated to 1.4
- */
-public class NoSuchObjectException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 6619395951570472985L;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public NoSuchObjectException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/rmi/NotBoundException.java b/libjava/java/rmi/NotBoundException.java
deleted file mode 100644
index b8bc0a5320a..00000000000
--- a/libjava/java/rmi/NotBoundException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* NotBoundException.java -- attempt to use a registry name with no binding
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Thrown on an attempt to lookup or unbind a registry name that has no
- * associated binding.
- *
- * @author unknown
- * @see Naming#lookup(String)
- * @see Naming#unbind(String)
- * @see Registry#lookup(String)
- * @see Registry#unbind(String)
- * @since 1.1
- * @status updated to 1.4
- */
-public class NotBoundException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -1857741824849069317l;
-
- /**
- * Create an exception with no message.
- */
- public NotBoundException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public NotBoundException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/rmi/RMISecurityException.java b/libjava/java/rmi/RMISecurityException.java
deleted file mode 100644
index a44a67e2a02..00000000000
--- a/libjava/java/rmi/RMISecurityException.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* RMISecurityException.java -- deprecated version of SecurityException
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Never thrown, but originally intended to wrap a java.lang.SecurityException.
- *
- * @author unknown
- * @since 1.1
- * @deprecated use {@link SecurityException} instead
- * @status updated to 1.4
- */
-public class RMISecurityException extends SecurityException
-{
- /**
- * Compatible with JDK 1.1.
- */
- private static final long serialVersionUID = -8433406075740433514L;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- * @deprecated no longer needed
- */
- public RMISecurityException(String n)
- {
- super(n);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- * @deprecated no longer needed
- */
- public RMISecurityException(String n, String a)
- {
- super(n);
- }
-}
diff --git a/libjava/java/rmi/RMISecurityManager.java b/libjava/java/rmi/RMISecurityManager.java
deleted file mode 100644
index a8eb13e1a0a..00000000000
--- a/libjava/java/rmi/RMISecurityManager.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* RMISecurityManager.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * @since 1.1
- */
-public class RMISecurityManager extends SecurityManager
-{
- public RMISecurityManager()
- {
- }
-}
diff --git a/libjava/java/rmi/Remote.java b/libjava/java/rmi/Remote.java
deleted file mode 100644
index 93c8d0aa127..00000000000
--- a/libjava/java/rmi/Remote.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Remote.java
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-public interface Remote {
-}
diff --git a/libjava/java/rmi/RemoteException.java b/libjava/java/rmi/RemoteException.java
deleted file mode 100644
index cbbb26299c3..00000000000
--- a/libjava/java/rmi/RemoteException.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/* RemoteException.java -- common superclass for exceptions in java.rmi
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-import java.io.IOException;
-
-/**
- * The superclass of exceptions related to RMI (remote method invocation).
- * Classes that implement <code>java.rmi.Remote</code> should list this
- * exception in their throws clause.
- *
- * @author unknown
- * @since 1.1
- * @status updated to 1.4
- */
-public class RemoteException extends IOException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -5148567311918794206l;
-
- /**
- * The cause of this exception. This pre-dates the exception chaining
- * of Throwable; and although you can change this field, you are wiser
- * to leave it alone.
- *
- * @serial the exception cause
- */
- public Throwable detail;
-
- /**
- * Create an exception with no message, and cause initialized to null.
- */
- public RemoteException()
- {
- this(null, null);
- }
-
- /**
- * Create an exception with the given message, and cause initialized to null.
- *
- * @param s the message
- */
- public RemoteException(String s)
- {
- this(s, null);
- }
-
- /**
- * Create an exception with the given message and cause.
- *
- * @param s the message
- * @param ex the cause
- */
- public RemoteException(String s, Throwable e)
- {
- super(s);
- initCause(e);
- detail = e;
- }
-
- /**
- * This method returns a message indicating what went wrong, in this
- * format:
- * <code>super.getMessage() + (detail == null ? ""
- * : "; nested exception is:\n\t" + detail)</code>.
- *
- * @return the chained message
- */
- public String getMessage()
- {
- if (detail == this || detail == null)
- return super.getMessage();
- return super.getMessage() + "; nested exception is:\n\t" + detail;
- }
-
- /**
- * Returns the cause of this exception. Note that this may not be the
- * original cause, thanks to the <code>detail</code> field being public
- * and non-final (yuck). However, to avoid violating the contract of
- * Throwable.getCause(), this returns null if <code>detail == this</code>,
- * as no exception can be its own cause.
- *
- * @return the cause
- * @since 1.4
- */
- public Throwable getCause()
- {
- return detail == this ? null : detail;
- }
-}
diff --git a/libjava/java/rmi/ServerError.java b/libjava/java/rmi/ServerError.java
deleted file mode 100644
index b1a15b02e74..00000000000
--- a/libjava/java/rmi/ServerError.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ServerError.java -- wraps an error while creating the server
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Wraps any error thrown while processing the server of a remote call.
- *
- * @author unknown
- * @since 1.1
- * @status updated to 1.4
- */
-public class ServerError extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 8455284893909696482L;
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public ServerError(String s, Error e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/ServerException.java b/libjava/java/rmi/ServerException.java
deleted file mode 100644
index 5170aa7b0b5..00000000000
--- a/libjava/java/rmi/ServerException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ServerException.java -- wraps an exception while creating the server
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Wraps any exception thrown while processing the server of a remote call.
- *
- * @author unknown
- * @since 1.1
- * @status updated to 1.4
- */
-public class ServerException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -4775845313121906682l;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public ServerException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public ServerException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/ServerRuntimeException.java b/libjava/java/rmi/ServerRuntimeException.java
deleted file mode 100644
index 1f0813739a6..00000000000
--- a/libjava/java/rmi/ServerRuntimeException.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ServerRuntimeException.java -- wraps an exception while creating the server
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Wraps any runtime exception thrown while processing the server of a
- * remote call. Note, this exception is no longer used.
- *
- * @author unknown
- * @since 1.1
- * @deprecated no replacement
- * @status updated to 1.4
- */
-public class ServerRuntimeException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1.
- */
- private static final long serialVersionUID = 7054464920481467219L;
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- * @deprecated no longer needed
- */
- public ServerRuntimeException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/StubNotFoundException.java b/libjava/java/rmi/StubNotFoundException.java
deleted file mode 100644
index 2f9e0f5ff59..00000000000
--- a/libjava/java/rmi/StubNotFoundException.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* StubNotFoundException.java -- thrown if a valid stub is not found
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Thrown if a valid stub class is not found for an object when it is exported.
- *
- * @author unknown
- * @see UnicastRemoteObject
- * @see Activatable
- * @since 1.1
- * @status updated to 1.4
- */
-public class StubNotFoundException extends RemoteException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -7088199405468872373L;
-
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public StubNotFoundException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public StubNotFoundException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/UnexpectedException.java b/libjava/java/rmi/UnexpectedException.java
deleted file mode 100644
index e9e0d6a9d48..00000000000
--- a/libjava/java/rmi/UnexpectedException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* UnexpectedException.java -- an unexpected checked exception was received
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Thrown if an unexpected checked exception was received in a remote
- * procedure call.
- *
- * @author unknown
- * @since 1.1
- * @status updated to 1.4
- */
-public class UnexpectedException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 1800467484195073863L;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public UnexpectedException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public UnexpectedException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/UnknownHostException.java b/libjava/java/rmi/UnknownHostException.java
deleted file mode 100644
index e21b9944c6b..00000000000
--- a/libjava/java/rmi/UnknownHostException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* UnknownHostException.java -- wraps java.net.UnknownHostException in RMI
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Thrown if a java.net.UnknownHostException occurs during a remote
- * procedure call.
- *
- * @author unknown
- * @since 1.1
- * @status updated to 1.4
- */
-public class UnknownHostException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -8152710247442114228L;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public UnknownHostException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public UnknownHostException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/UnmarshalException.java b/libjava/java/rmi/UnmarshalException.java
deleted file mode 100644
index 6567062a523..00000000000
--- a/libjava/java/rmi/UnmarshalException.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* UnmarshalException.java -- wraps error while unmarshalling parameters
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi;
-
-/**
- * Thrown if an exception occurs while unmarshalling parameters or results
- * of a remote method call. This includes:<br><ul>
- * <li>if an exception occurs while unmarshalling the call header</li>
- * <li>if the protocol for the return value is invalid</li>
- * <li>if a java.io.IOException occurs unmarshalling parameters (on the
- * server side) or the return value (on the client side).</li>
- * <li>if a java.lang.ClassNotFoundException occurs during unmarshalling
- * parameters or return values</li>
- * <li>if no skeleton can be loaded on the server-side; note that skeletons
- * are required in the 1.1 stub protocol, but not in the 1.2 stub
- * protocol.</li>
- * <li>if the method hash is invalid (i.e., missing method).</li>
- * <li>if there is a failure to create a remote reference object for a remote
- * object's stub when it is unmarshalled.</li>
- * </ul>
- *
- * @author unknown
- * @since 1.1
- * @status updated to 1.4
- */
-public class UnmarshalException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 594380845140740218l;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public UnmarshalException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public UnmarshalException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/activation/Activatable.java b/libjava/java/rmi/activation/Activatable.java
deleted file mode 100644
index b4c38bf61a8..00000000000
--- a/libjava/java/rmi/activation/Activatable.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Activatable.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.rmi.MarshalledObject;
-import java.rmi.NoSuchObjectException;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RMIServerSocketFactory;
-import java.rmi.server.RemoteServer;
-
-public abstract class Activatable extends RemoteServer
-{
-static final long serialVersionUID = -3120617863591563455L;
-
-protected Activatable(String location, MarshalledObject data, boolean restart, int port) throws ActivationException, RemoteException {
- throw new Error("Not implemented");
-}
-
-protected Activatable(String location, MarshalledObject data, boolean restart, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws ActivationException, RemoteException {
- throw new Error("Not implemented");
-}
-
-protected Activatable(ActivationID id, int port) throws RemoteException {
- throw new Error("Not implemented");
-}
-
-protected Activatable(ActivationID id, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
- throw new Error("Not implemented");
-}
-
-protected ActivationID getID() {
- throw new Error("Not implemented");
-}
-
-public static Remote register(ActivationDesc desc) throws UnknownGroupException, ActivationException, RemoteException {
- throw new Error("Not implemented");
-}
-
-public static boolean inactive(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException {
- throw new Error("Not implemented");
-}
-
-public static void unregister(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException {
- throw new Error("Not implemented");
-}
-
-public static ActivationID exportObject(Remote obj, String location, MarshalledObject data, boolean restart, int port) throws ActivationException, RemoteException {
- throw new Error("Not implemented");
-}
-
-public static ActivationID exportObject(Remote obj, String location, MarshalledObject data, boolean restart, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws ActivationException, RemoteException {
- throw new Error("Not implemented");
-}
-
-public static Remote exportObject(Remote obj, ActivationID id, int port) throws RemoteException {
- throw new Error("Not implemented");
-}
-
-public static Remote exportObject(Remote obj, ActivationID id, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
- throw new Error("Not implemented");
-}
-
-public static boolean unexportObject(Remote obj, boolean force) throws NoSuchObjectException {
- throw new Error("Not implemented");
-}
-
-}
diff --git a/libjava/java/rmi/activation/ActivateFailedException.java b/libjava/java/rmi/activation/ActivateFailedException.java
deleted file mode 100644
index 1c2e10ee3e6..00000000000
--- a/libjava/java/rmi/activation/ActivateFailedException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* ActivateFailedException.java -- thrown when activation fails
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.rmi.RemoteException;
-
-/**
- * Thrown when activation fails on a remote call to an activatable object.
- *
- * @author unknown
- * @since 1.2
- * @status updated to 1.4
- */
-public class ActivateFailedException extends RemoteException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 4863550261346652506L;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public ActivateFailedException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param ex the cause
- */
- public ActivateFailedException(String s, Exception ex)
- {
- super(s, ex);
- }
-}
diff --git a/libjava/java/rmi/activation/ActivationDesc.java b/libjava/java/rmi/activation/ActivationDesc.java
deleted file mode 100644
index 65894f808d2..00000000000
--- a/libjava/java/rmi/activation/ActivationDesc.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* ActivationDecc.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.io.Serializable;
-import java.rmi.MarshalledObject;
-
-public final class ActivationDesc implements Serializable
-{
- static final long serialVersionUID = 7455834104417690957L;
-
-private ActivationGroupID groupid;
-private String classname;
-private String location;
-private MarshalledObject data;
-private boolean restart;
-
-public ActivationDesc(String className, String location, MarshalledObject data) throws ActivationException {
- this(ActivationGroup.currentGroupID(), className, location, data, false);
-}
-
-public ActivationDesc(String className, String location, MarshalledObject data, boolean restart) throws ActivationException {
- this(ActivationGroup.currentGroupID(), className, location, data, restart);
-}
-
-public ActivationDesc(ActivationGroupID groupID, String className, String location, MarshalledObject data) {
- this(groupID, className, location, data, false);
-}
-
-public ActivationDesc(ActivationGroupID groupID, String className, String location, MarshalledObject data, boolean restart) {
- this.groupid = groupID;
- this.classname = className;
- this.location = location;
- this.data = data;
- this.restart = restart;
-}
-
-public ActivationGroupID getGroupID() {
- return (groupid);
-}
-
-public String getClassName() {
- return (classname);
-}
-
-public String getLocation() {
- return (location);
-}
-
-public MarshalledObject getData() {
- return (data);
-}
-
-public boolean getRestartMode() {
- return (restart);
-}
-
-public boolean equals(Object obj) {
- if (!(obj instanceof ActivationDesc)) {
- return (false);
- }
- ActivationDesc that = (ActivationDesc)obj;
-
- if (this.groupid.equals(that.groupid) &&
- this.classname.equals(that.classname) &&
- this.location.equals(that.location) &&
- this.data.equals(that.data) &&
- this.restart == that.restart) {
- return (true);
- }
- return (false);
-}
-
-public int hashCode() {
- return (groupid.hashCode() ^ classname.hashCode() ^ location.hashCode() ^ data.hashCode());
-}
-
-}
diff --git a/libjava/java/rmi/activation/ActivationException.java b/libjava/java/rmi/activation/ActivationException.java
deleted file mode 100644
index 418f4385757..00000000000
--- a/libjava/java/rmi/activation/ActivationException.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ActivationException.java -- general Activation exception
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-/**
- * General exception class for <code>java.rmi.activation</code>.
- *
- * @author unknown
- * @since 1.2
- * @status updated to 1.4
- */
-public class ActivationException extends Exception
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -4320118837291406071L;
-
- /**
- * The cause of this exception. This pre-dates the exception chaining
- * of Throwable; and although you can change this field, you are wiser
- * to leave it alone.
- *
- * @serial the exception cause
- */
- public Throwable detail;
-
- /**
- * Create an exception with no message, and cause initialized to null.
- */
- public ActivationException()
- {
- this(null, null);
- }
-
- /**
- * Create an exception with the given message, and cause initialized to null.
- *
- * @param s the message
- */
- public ActivationException(String s)
- {
- this(s, null);
- }
-
- /**
- * Create an exception with the given message and cause.
- *
- * @param s the message
- * @param ex the cause
- */
- public ActivationException(String s, Throwable ex)
- {
- super(s, ex);
- detail = ex;
- }
-
- /**
- * This method returns a message indicating what went wrong, in this
- * format:
- * <code>super.getMessage() + (detail == null ? ""
- * : "; nested exception is:\n\t" + detail)</code>.
- *
- * @return the chained message
- */
- public String getMessage()
- {
- if (detail == this || detail == null)
- return super.getMessage();
- return super.getMessage() + "; nested exception is:\n\t" + detail;
- }
-
- /**
- * Returns the cause of this exception. Note that this may not be the
- * original cause, thanks to the <code>detail</code> field being public
- * and non-final (yuck). However, to avoid violating the contract of
- * Throwable.getCause(), this returns null if <code>detail == this</code>,
- * as no exception can be its own cause.
- *
- * @return the cause
- * @since 1.4
- */
- public Throwable getCause()
- {
- return detail == this ? null : detail;
- }
-}
diff --git a/libjava/java/rmi/activation/ActivationGroup.java b/libjava/java/rmi/activation/ActivationGroup.java
deleted file mode 100644
index e5774a1b961..00000000000
--- a/libjava/java/rmi/activation/ActivationGroup.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ActivationGroup.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.rmi.MarshalledObject;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-
-public abstract class ActivationGroup extends UnicastRemoteObject
- implements ActivationInstantiator
-{
-static final long serialVersionUID = -7696947875314805420L;
-
-protected ActivationGroup(ActivationGroupID groupID) throws RemoteException {
- throw new Error("Not implemented");
-}
-
-public boolean inactiveObject(ActivationID id) throws ActivationException, UnknownObjectException, RemoteException {
- throw new Error("Not implemented");
-}
-
-public abstract void activeObject(ActivationID id, Remote obj) throws ActivationException, UnknownObjectException, RemoteException;
-
-public static ActivationGroup createGroup(ActivationGroupID id, ActivationGroupDesc desc, long incarnation) throws ActivationException {
- throw new Error("Not implemented");
-}
-
-public static ActivationGroupID currentGroupID() {
- throw new Error("Not implemented");
-}
-
-public static void setSystem(ActivationSystem system) throws ActivationException {
- throw new Error("Not implemented");
-}
-
-public static ActivationSystem getSystem() throws ActivationException {
- throw new Error("Not implemented");
-}
-
-protected void activeObject(ActivationID id, MarshalledObject mobj) throws ActivationException, UnknownObjectException, RemoteException {
- throw new Error("Not implemented");
-}
-
-protected void inactiveGroup() throws UnknownGroupException, RemoteException {
- throw new Error("Not implemented");
-}
-
-}
diff --git a/libjava/java/rmi/activation/ActivationGroupDesc.java b/libjava/java/rmi/activation/ActivationGroupDesc.java
deleted file mode 100644
index 35b546e3294..00000000000
--- a/libjava/java/rmi/activation/ActivationGroupDesc.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/* ActivationGroupDesc.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.io.Serializable;
-import java.rmi.MarshalledObject;
-import java.util.Properties;
-
-public final class ActivationGroupDesc implements Serializable
-{
- static final long serialVersionUID = -4936225423168276595L;
-
-public static class CommandEnvironment
- implements Serializable {
-
-static final long serialVersionUID = 6165754737887770191L;
-
-private String cmdpath;
-private String[] argv;
-
-public CommandEnvironment(String cmdpath, String[] argv) {
- this.cmdpath = cmdpath;
- this.argv = argv;
-}
-
-public String getCommandPath() {
- return (cmdpath);
-}
-
-public String[] getCommandOptions() {
- return (argv);
-}
-
-public boolean equals(Object obj) {
- if (!(obj instanceof CommandEnvironment)) {
- return (false);
- }
- CommandEnvironment that = (CommandEnvironment)obj;
-
- if (!this.cmdpath.equals(that.cmdpath)) {
- return (false);
- }
-
- int len = this.argv.length;
- if (len != that.argv.length) {
- return (false);
- }
- for (int i = 0; i < len; i++) {
- if (!this.argv[i].equals(that.argv[i])) {
- return (false);
- }
- }
- return (true);
-}
-
-public int hashCode() {
- return (cmdpath.hashCode()); // Not a very good hash code.
-}
-
-}
-
-public ActivationGroupDesc(Properties overrides, ActivationGroupDesc.CommandEnvironment cmd) {
- throw new Error("Not implemented");
-}
-
-public ActivationGroupDesc(String className, String location, MarshalledObject data, Properties overrides, ActivationGroupDesc.CommandEnvironment cmd) {
- throw new Error("Not implemented");
-}
-
-public String getClassName() {
- throw new Error("Not implemented");
-}
-
-public String getLocation() {
- throw new Error("Not implemented");
-}
-
-public MarshalledObject getData() {
- throw new Error("Not implemented");
-}
-
-public Properties getPropertyOverrides() {
- throw new Error("Not implemented");
-}
-
-public ActivationGroupDesc.CommandEnvironment getCommandEnvironment() {
- throw new Error("Not implemented");
-}
-
-public boolean equals(Object obj) {
- throw new Error("Not implemented");
-}
-
-public int hashCode() {
- throw new Error("Not implemented");
-}
-
-}
diff --git a/libjava/java/rmi/activation/ActivationGroupID.java b/libjava/java/rmi/activation/ActivationGroupID.java
deleted file mode 100644
index 5e0b96442e8..00000000000
--- a/libjava/java/rmi/activation/ActivationGroupID.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ActivationGroupID.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.io.Serializable;
-
-public class ActivationGroupID implements Serializable
-{
- static final long serialVersionUID = -1648432278909740833L;
-
-private ActivationSystem system;
-
-public ActivationGroupID(ActivationSystem system) {
- this.system = system;
-}
-
-public ActivationSystem getSystem() {
- return (system);
-}
-
-public int hashCode() {
- return (system.hashCode());
-}
-
-public boolean equals(Object obj) {
- if (obj instanceof ActivationGroupID) {
- ActivationGroupID that = (ActivationGroupID)obj;
- if (this.system.equals(that.system)) {
- return (true);
- }
- }
- return (false);
-}
-
-}
diff --git a/libjava/java/rmi/activation/ActivationID.java b/libjava/java/rmi/activation/ActivationID.java
deleted file mode 100644
index 23ed853a478..00000000000
--- a/libjava/java/rmi/activation/ActivationID.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ActivationID.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.io.Serializable;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public class ActivationID implements Serializable
-{
- static final long serialVersionUID = -4608673054848209235L;
-
-private Activator activator;
-
-public ActivationID(Activator activator) {
- this.activator = activator;
-}
-
-public Remote activate(boolean force) throws ActivationException, UnknownObjectException, RemoteException {
- throw new Error("Not implemented");
-}
-
-public int hashCode() {
- return (activator.hashCode());
-}
-
-public boolean equals(Object obj) {
- if (obj instanceof ActivationID) {
- ActivationID that = (ActivationID)obj;
- if (this.activator.equals(that.activator)) {
- return (true);
- }
- }
- return (false);
-}
-
-}
diff --git a/libjava/java/rmi/activation/ActivationInstantiator.java b/libjava/java/rmi/activation/ActivationInstantiator.java
deleted file mode 100644
index 0aceb7a4ad6..00000000000
--- a/libjava/java/rmi/activation/ActivationInstantiator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ActivationInstantiator.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.rmi.MarshalledObject;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface ActivationInstantiator
- extends Remote
-{
- MarshalledObject newInstance (ActivationID id, ActivationDesc desc)
- throws ActivationException, RemoteException;
-}
diff --git a/libjava/java/rmi/activation/ActivationMonitor.java b/libjava/java/rmi/activation/ActivationMonitor.java
deleted file mode 100644
index 1e64257edd1..00000000000
--- a/libjava/java/rmi/activation/ActivationMonitor.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ActivationMonitor.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.rmi.MarshalledObject;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface ActivationMonitor extends Remote
-{
- void inactiveObject (ActivationID id)
- throws UnknownObjectException, RemoteException;
-
- void activeObject (ActivationID id, MarshalledObject obj)
- throws UnknownObjectException, RemoteException;
-
- void inactiveGroup (ActivationGroupID id, long incarnation)
- throws UnknownGroupException, RemoteException;
-}
diff --git a/libjava/java/rmi/activation/ActivationSystem.java b/libjava/java/rmi/activation/ActivationSystem.java
deleted file mode 100644
index 4b92d40cb44..00000000000
--- a/libjava/java/rmi/activation/ActivationSystem.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ActivationSystem.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface ActivationSystem extends Remote
-{
- int SYSTEM_PORT = 1098;
-
- ActivationID registerObject (ActivationDesc desc)
- throws ActivationException, UnknownGroupException, RemoteException;
-
- void unregisterObject (ActivationID id)
- throws ActivationException, UnknownObjectException, RemoteException;
-
- ActivationGroupID registerGroup (ActivationGroupDesc desc)
- throws ActivationException, RemoteException;
-
- ActivationMonitor activeGroup (ActivationGroupID id,
- ActivationInstantiator group, long incarnation)
- throws UnknownGroupException, ActivationException, RemoteException;
-
- void unregisterGroup (ActivationGroupID id)
- throws ActivationException, UnknownGroupException, RemoteException;
-
- void shutdown()
- throws RemoteException;
-
- ActivationDesc setActivationDesc (ActivationID id, ActivationDesc desc)
- throws ActivationException, UnknownObjectException, UnknownGroupException,
- RemoteException;
-
- ActivationGroupDesc setActivationGroupDesc (ActivationGroupID id,
- ActivationGroupDesc desc)
- throws ActivationException, UnknownGroupException, RemoteException;
-
- ActivationDesc getActivationDesc (ActivationID id) throws ActivationException, UnknownObjectException, RemoteException;
-
- ActivationGroupDesc getActivationGroupDesc (ActivationGroupID id) throws ActivationException, UnknownGroupException, RemoteException;
-}
diff --git a/libjava/java/rmi/activation/Activator.java b/libjava/java/rmi/activation/Activator.java
deleted file mode 100644
index 2fb5a581002..00000000000
--- a/libjava/java/rmi/activation/Activator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Activator.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-import java.rmi.MarshalledObject;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface Activator
- extends Remote
-{
- MarshalledObject activate (ActivationID id, boolean force)
- throws ActivationException, UnknownObjectException, RemoteException;
-}
diff --git a/libjava/java/rmi/activation/UnknownGroupException.java b/libjava/java/rmi/activation/UnknownGroupException.java
deleted file mode 100644
index 91890a9073d..00000000000
--- a/libjava/java/rmi/activation/UnknownGroupException.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* UnknownGroupException.java -- thrown on an invalid ActivationGroupID
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-/**
- * Thrown when an <code>ActivationGroupID</code> parameter is invalid or
- * unknown.
- *
- * @author unknown
- * @see Activatable
- * @see ActivationGroup
- * @see ActivationID
- * @see ActivationMonitor
- * @see ActivationSystem
- * @since 1.2
- * @status updated to 1.4
- */
-public class UnknownGroupException extends ActivationException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 7056094974750002460L;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public UnknownGroupException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/rmi/activation/UnknownObjectException.java b/libjava/java/rmi/activation/UnknownObjectException.java
deleted file mode 100644
index 8dbeb0e6050..00000000000
--- a/libjava/java/rmi/activation/UnknownObjectException.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* UnknownObjectException.java -- thrown on an invalid ActivationID
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.activation;
-
-/**
- * Thrown when an <code>ActivationID</code> parameter is invalid or unknown.
- *
- * @author unknown
- * @see Activatable
- * @see ActivationGroup
- * @see ActivationID
- * @see ActivationMonitor
- * @see ActivationSystem
- * @see Activator
- * @since 1.2
- * @status updated to 1.4
- */
-public class UnknownObjectException extends ActivationException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 3425547551622251430L;
-
- /**
- * Create an exception with an error message.
- *
- * @param s the message
- */
- public UnknownObjectException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/rmi/dgc/DGC.java b/libjava/java/rmi/dgc/DGC.java
deleted file mode 100644
index e78ec2a3aa7..00000000000
--- a/libjava/java/rmi/dgc/DGC.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* DGC.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.dgc;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.server.ObjID;
-
-public interface DGC extends Remote
-{
- Lease dirty (ObjID[] ids, long sequenceNum, Lease lease)
- throws RemoteException;
-
- void clean (ObjID[] ids, long sequenceNum, VMID vmid, boolean strong)
- throws RemoteException;
-}
diff --git a/libjava/java/rmi/dgc/Lease.java b/libjava/java/rmi/dgc/Lease.java
deleted file mode 100644
index d3d7f695216..00000000000
--- a/libjava/java/rmi/dgc/Lease.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Lease.java
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.dgc;
-
-import java.io.Serializable;
-
-public final class Lease
- implements Serializable {
-
-static final long serialVersionUID = -5713411624328831948L;
-
-private VMID vmid;
-private long value;
-
-public Lease(VMID id, long duration) {
- vmid = id;
- value = duration;
-}
-
-public VMID getVMID() {
- return (vmid);
-}
-
-public long getValue() {
- return (value);
-}
-
-public String toString() {
- return ("[" + vmid.toString() + ", " + Long.toString(value) + "]");
-}
-
-}
diff --git a/libjava/java/rmi/dgc/VMID.java b/libjava/java/rmi/dgc/VMID.java
deleted file mode 100644
index f960d9ccd79..00000000000
--- a/libjava/java/rmi/dgc/VMID.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* VMID.java
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.dgc;
-
-import java.io.Serializable;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.rmi.server.UID;
-
-public final class VMID implements Serializable
-{
- static final long serialVersionUID = -538642295484486218L;
-
- static final boolean areWeUnique;
-
- static byte[] localAddr;
-
- private byte[] addr;
-
- private UID uid;
-
- static
- {
- byte[] addr;
- boolean awu = true;
- try {
- addr = InetAddress.getLocalHost().getAddress();
- if (addr[0] == 127 && addr[1] == 0 && addr[2] == 0 && addr[3] == 1) {
- awu = false;
- }
- }
- catch (UnknownHostException _) {
- addr = new byte[]{ 127, 0, 0, 1 };
- awu = false;
- }
- localAddr = addr;
- areWeUnique = awu;
- }
-
- public VMID()
- {
- addr = localAddr;
- uid = new UID();
- }
-
- /**
- * @deprecated
- */
- public static boolean isUnique ()
- {
- return areWeUnique;
- }
-
- public int hashCode ()
- {
- return super.hashCode();
- }
-
- public boolean equals (Object obj)
- {
- if (!(obj instanceof VMID))
- {
- return false;
- }
-
- VMID other = (VMID) obj;
- if (addr.length != other.addr.length)
- {
- return false;
- }
-
- for (int i = addr.length - 1; i >= 0; i--)
- {
- if (addr[i] != other.addr[i])
- {
- return false;
- }
- }
-
- return uid.equals(other.uid);
- }
-
- public String toString ()
- {
- StringBuffer buf = new StringBuffer ("[VMID: ");
-
- for (int i = 0; i < addr.length; i++)
- {
- if (i > 0)
- {
- buf.append (".");
- }
-
- buf.append (Integer.toString (addr [i]));
- }
-
- buf.append (" ");
- buf.append (uid.toString ());
- buf.append ("]");
-
- return buf.toString();
- }
-}
diff --git a/libjava/java/rmi/registry/LocateRegistry.java b/libjava/java/rmi/registry/LocateRegistry.java
deleted file mode 100644
index 3547a7ad0f4..00000000000
--- a/libjava/java/rmi/registry/LocateRegistry.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* LocateRegistry.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.registry;
-
-import gnu.java.rmi.registry.RegistryImpl;
-import gnu.java.rmi.registry.RegistryImpl_Stub;
-import gnu.java.rmi.server.UnicastRef;
-
-import java.rmi.RemoteException;
-import java.rmi.server.ObjID;
-import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RMIServerSocketFactory;
-import java.rmi.server.RMISocketFactory;
-import java.rmi.server.RemoteRef;
-
-public final class LocateRegistry {
- /**
- * This class isn't intended to be instantiated.
- */
- private LocateRegistry() {}
-
-public static Registry getRegistry() throws RemoteException {
- return (getRegistry("localhost", Registry.REGISTRY_PORT));
-}
-
-public static Registry getRegistry(int port) throws RemoteException {
- return (getRegistry("localhost", port));
-}
-
-public static Registry getRegistry(String host) throws RemoteException {
- return (getRegistry(host, Registry.REGISTRY_PORT));
-}
-
-public static Registry getRegistry(String host, int port) throws RemoteException {
- return (getRegistry(host, port, RMISocketFactory.getSocketFactory()));
-}
-
-public static Registry getRegistry(String host, int port, RMIClientSocketFactory csf) throws RemoteException {
- RemoteRef ref = new UnicastRef(new ObjID(ObjID.REGISTRY_ID), host, port, csf);
- return (new RegistryImpl_Stub(ref));
-}
-
-public static Registry createRegistry(int port) throws RemoteException {
- return (createRegistry(port, RMISocketFactory.getSocketFactory(), RMISocketFactory.getSocketFactory()));
-}
-
-public static Registry createRegistry(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
- return (new RegistryImpl(port, csf, ssf));
-}
-
-}
diff --git a/libjava/java/rmi/registry/Registry.java b/libjava/java/rmi/registry/Registry.java
deleted file mode 100644
index 6cd2a04a685..00000000000
--- a/libjava/java/rmi/registry/Registry.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Registry.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.registry;
-
-import java.rmi.AccessException;
-import java.rmi.AlreadyBoundException;
-import java.rmi.NotBoundException;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface Registry extends Remote
-{
- int REGISTRY_PORT = 1099;
-
- Remote lookup(String name)
- throws RemoteException, NotBoundException, AccessException;
-
- void bind(String name, Remote obj)
- throws RemoteException, AlreadyBoundException, AccessException;
-
- void unbind(String name)
- throws RemoteException, NotBoundException, AccessException;
-
- void rebind(String name, Remote obj)
- throws RemoteException, AccessException;
-
- String[] list()
- throws RemoteException, AccessException;
-}
diff --git a/libjava/java/rmi/registry/RegistryHandler.java b/libjava/java/rmi/registry/RegistryHandler.java
deleted file mode 100644
index b9b45092305..00000000000
--- a/libjava/java/rmi/registry/RegistryHandler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* RegistryHandler.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.registry;
-
-import java.rmi.RemoteException;
-import java.rmi.UnknownHostException;
-
-/**
- * @deprecated
- */
-public interface RegistryHandler
-{
- /**
- * @deprecated
- */
- Registry registryStub (String host, int port)
- throws RemoteException, UnknownHostException;
-
- /**
- * @deprecated
- */
- Registry registryImpl (int port) throws RemoteException;
-}
diff --git a/libjava/java/rmi/server/ExportException.java b/libjava/java/rmi/server/ExportException.java
deleted file mode 100644
index b2d5bfca52e..00000000000
--- a/libjava/java/rmi/server/ExportException.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ExportException.java -- an export attempt failed
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.rmi.RemoteException;
-
-/**
- * Thrown if an attempt to export a remote object fails.
- *
- * @author unknown
- * @see UnicastRemoteObject
- * @see Activatable
- * @since 1.1
- * @status updated to 1.4
- */
-public class ExportException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -9155485338494060170L;
-
- /**
- * Create an exception with the specified message.
- *
- * @param s the message
- */
- public ExportException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with the specified message and cause.
- *
- * @param s the message
- * @param e the cause
- */
- public ExportException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/server/LoaderHandler.java b/libjava/java/rmi/server/LoaderHandler.java
deleted file mode 100644
index 189085710b4..00000000000
--- a/libjava/java/rmi/server/LoaderHandler.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* LoaderHandler.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/**
- * @deprecated
- */
-public interface LoaderHandler
-{
- String packagePrefix = "";
-
- /**
- * @deprecated
- */
- Class loadClass(String name)
- throws MalformedURLException, ClassNotFoundException;
-
- /**
- * @deprecated
- */
- Class loadClass(URL codebase, String name)
- throws MalformedURLException, ClassNotFoundException;
-
- /**
- * @deprecated
- */
- Object getSecurityContext(ClassLoader loader);
-}
diff --git a/libjava/java/rmi/server/LogStream.java b/libjava/java/rmi/server/LogStream.java
deleted file mode 100644
index a2dfbb47fcc..00000000000
--- a/libjava/java/rmi/server/LogStream.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/* LogStream.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.io.OutputStream;
-import java.io.PrintStream;
-
-/**
- * @deprecated
- */
-public class LogStream extends PrintStream
-{
- public static final int SILENT = 0;
- public static final int BRIEF = 10;
- public static final int VERBOSE = 20;
-
- private static PrintStream defStream;
-
- private LogStream (OutputStream s)
- {
- super (s);
- }
-
- /**
- * @deprecated
- */
- public static LogStream log (String name)
- {
- throw new Error ("Not implemented");
- }
-
- /**
- * @deprecated
- */
- public static PrintStream getDefaultStream ()
- {
- return defStream;
- }
-
- /**
- * @deprecated
- */
- public static void setDefaultStream (PrintStream s)
- {
- defStream = s;
- }
-
- /**
- * @deprecated
- */
- public OutputStream getOutputStream ()
- {
- return out;
- }
-
- /**
- * @deprecated
- */
- public void setOutputStream (OutputStream s)
- {
- out = s;
- }
-
- /**
- * @deprecated
- */
- public void write (int buffer)
- {
- super.write (buffer);
- }
-
- /**
- * @deprecated
- */
- public void write (byte[] buffer, int offset, int len)
- {
- super.write (buffer, offset, len);
- }
-
- /**
- * @deprecated
- */
- public String toString ()
- {
- throw new Error ("Not implemented");
- }
-
- /**
- * @deprecated
- */
- public static int parseLevel (String s)
- {
- if (s.equalsIgnoreCase ("silent"))
- {
- return SILENT;
- }
-
- if (s.equalsIgnoreCase ("brief"))
- {
- return BRIEF;
- }
-
- if (s.equalsIgnoreCase ("verbose"))
- {
- return VERBOSE;
- }
-
- return SILENT;
- }
-}
diff --git a/libjava/java/rmi/server/ObjID.java b/libjava/java/rmi/server/ObjID.java
deleted file mode 100644
index 07cbbde3a62..00000000000
--- a/libjava/java/rmi/server/ObjID.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* ObjID.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.Serializable;
-
-public final class ObjID implements Serializable
-{
-static final long serialVersionUID = -6386392263968365220L;
-
-private static long next = 0x8000000000000000L;
-private static final Object lock = ObjID.class;
-
-public static final int REGISTRY_ID = 0;
-public static final int ACTIVATOR_ID = 1;
-public static final int DGC_ID = 2;
-
-private long objNum;
-private UID space;
-
-public ObjID() {
- synchronized (lock) {
- objNum = next++;
- }
- space = new UID();
-}
-
-public ObjID(int num) {
- objNum = (long)num;
- space = new UID((short)0);
-}
-
-public void write(ObjectOutput out) throws IOException {
- DataOutput dout = (DataOutput)out;
- dout.writeLong(objNum);
- space.write(dout);
-}
-
-public static ObjID read(ObjectInput in) throws IOException {
- DataInput din = (DataInput)in;
- ObjID id = new ObjID();
- id.objNum = din.readLong();
- id.space = UID.read(din);
- return (id);
-}
-
-public int hashCode() {
- return ((int)objNum);
-}
-
-public boolean equals(Object obj) {
- if (obj instanceof ObjID && this.objNum == ((ObjID)obj).objNum) {
- return (true);
- }
- return (false);
-}
-
-public String toString() {
- return ("[objNum: " + objNum + ", " + space + "]");
-}
-
-}
diff --git a/libjava/java/rmi/server/Operation.java b/libjava/java/rmi/server/Operation.java
deleted file mode 100644
index 64faf66e2f8..00000000000
--- a/libjava/java/rmi/server/Operation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Operation.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-/**
- * @deprecated
- */
-public class Operation
-{
- private String operation;
-
- /**
- * @deprecated
- */
- public Operation (String op)
- {
- operation = op;
- }
-
- /**
- * @deprecated
- */
- public String getOperation ()
- {
- return operation;
- }
-
- /**
- * @deprecated
- */
- public String toString ()
- {
- return operation;
- }
-}
diff --git a/libjava/java/rmi/server/RMIClassLoader.java b/libjava/java/rmi/server/RMIClassLoader.java
deleted file mode 100644
index 1a2e2837dd8..00000000000
--- a/libjava/java/rmi/server/RMIClassLoader.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/* RMIClassLoader.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-
-/**
- * This class provides a set of public static utility methods for supporting
- * network-based class loading in RMI. These methods are called by RMI's
- * internal marshal streams to implement the dynamic class loading of types for
- * RMI parameters and return values.
- */
-public class RMIClassLoader
-{
- /**
- * This class isn't intended to be instantiated.
- */
- private RMIClassLoader() {}
-
- private static class MyClassLoader extends URLClassLoader
- {
- // Package-private to avoid a trampoline constructor.
- MyClassLoader (URL[] urls, ClassLoader parent, String annotation)
- {
- super (urls, parent);
- this.annotation = annotation;
- }
-
- private MyClassLoader (URL[] urls, ClassLoader parent)
- {
- super (urls, parent);
- this.annotation = urlToAnnotation (urls);
- }
-
- public static String urlToAnnotation (URL[] urls)
- {
- if (urls.length == 0)
- return null;
-
- StringBuffer annotation = new StringBuffer (64 * urls.length);
-
- for (int i = 0; i < urls.length; i++)
- {
- annotation.append (urls [i].toExternalForm());
- annotation.append (' ');
- }
-
- return annotation.toString();
- }
-
- public final String getClassAnnotation()
- {
- return annotation;
- }
-
- private final String annotation;
- }
-
- /**
- * This class is used to identify a cached classloader by its codebase and
- * the context classloader that is its parent.
- */
- private static class CacheKey
- {
- private String mCodeBase;
- private ClassLoader mContextClassLoader;
-
- public CacheKey (String theCodebase, ClassLoader theContextClassLoader)
- {
- mCodeBase = theCodebase;
- mContextClassLoader = theContextClassLoader;
- }
-
- /**
- * @return true if the codebase and the context classloader are equal
- */
- public boolean equals (Object theOther)
- {
- if (theOther instanceof CacheKey)
- {
- CacheKey key = (CacheKey) theOther;
-
- return (equals (this.mCodeBase,key.mCodeBase)
- && equals (this.mContextClassLoader, key.mContextClassLoader));
- }
- return false;
- }
-
- /**
- * Test if the two objects are equal or both null.
- * @param theOne
- * @param theOther
- * @return
- */
- private boolean equals (Object theOne, Object theOther)
- {
- return theOne != null ? theOne.equals (theOther) : theOther == null;
- }
-
- /**
- * @return hashCode
- */
- public int hashCode()
- {
- return ((mCodeBase != null ? mCodeBase.hashCode() : 0)
- ^(mContextClassLoader != null ? mContextClassLoader.hashCode() : -1));
- }
-
- public String toString()
- {
- return "[" + mCodeBase + "," + mContextClassLoader + "]";
- }
-
- }
-
- private static Map cacheLoaders; //map annotations to loaders
- private static Map cacheAnnotations; //map loaders to annotations
-
- //defaultAnnotation is got from system property
- // "java.rmi.server.defaultAnnotation"
- private static String defaultAnnotation;
-
- //URL object for defaultAnnotation
- private static URL defaultCodebase;
-
- //class loader for defaultAnnotation
- private static MyClassLoader defaultLoader;
-
- static
- {
- // 89 is a nice prime number for Hashtable initial capacity
- cacheLoaders = new Hashtable (89);
- cacheAnnotations = new Hashtable (89);
-
- defaultAnnotation = System.getProperty ("java.rmi.server.defaultAnnotation");
-
- try
- {
- if (defaultAnnotation != null)
- defaultCodebase = new URL (defaultAnnotation);
- }
- catch (Exception _)
- {
- defaultCodebase = null;
- }
-
- if (defaultCodebase != null)
- {
- defaultLoader = new MyClassLoader (new URL[] { defaultCodebase }, null,
- defaultAnnotation);
- cacheLoaders.put (new CacheKey (defaultAnnotation,
- Thread.currentThread().getContextClassLoader()),
- defaultLoader);
- }
- }
-
- /**
- * @deprecated
- */
- public static Class loadClass (String name)
- throws MalformedURLException, ClassNotFoundException
- {
- return loadClass ("", name);
- }
-
- public static Class loadClass (String codebases, String name)
- throws MalformedURLException, ClassNotFoundException
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- //try context class loader first
- try
- {
- return loader.loadClass (name);
- }
- catch (ClassNotFoundException e)
- {
- // class not found in the local classpath
- }
-
- if (codebases.length() == 0) //==""
- {
- loader = defaultLoader;
- }
- else
- {
- loader = getClassLoader(codebases);
- }
-
- if (loader == null)
- {
- //do not throw NullPointerException
- throw new ClassNotFoundException ("Could not find class (" + name +
- ") at codebase (" + codebases + ")");
- }
-
- return loader.loadClass (name);
- }
-
- /**
- * Gets a classloader for the given codebase and with the current
- * context classloader as parent.
- *
- * @param codebases
- *
- * @return a classloader for the given codebase
- *
- * @throws MalformedURLException if the codebase contains a malformed URL
- */
- public static ClassLoader getClassLoader (String codebases)
- throws MalformedURLException
- {
- ClassLoader loader;
- CacheKey loaderKey = new CacheKey
- (codebases, Thread.currentThread().getContextClassLoader());
- loader = (ClassLoader) cacheLoaders.get (loaderKey);
-
- if (loader == null)
- {
- //create an entry in cacheLoaders mapping a loader to codebases.
- // codebases are separated by " "
- StringTokenizer tok = new StringTokenizer (codebases, " ");
- ArrayList urls = new ArrayList();
-
- while (tok.hasMoreTokens())
- urls.add (new URL (tok.nextToken()));
-
- loader = new MyClassLoader ((URL[]) urls.toArray (new URL [urls.size()]),
- Thread.currentThread().getContextClassLoader(),
- codebases);
- cacheLoaders.put (loaderKey, loader);
- }
-
- return loader;
- }
-
- /**
- * Returns a string representation of the network location where a remote
- * endpoint can get the class-definition of the given class.
- *
- * @param cl
- *
- * @return a space seperated list of URLs where the class-definition
- * of cl may be found
- */
- public static String getClassAnnotation (Class cl)
- {
- ClassLoader loader = cl.getClassLoader();
-
- if (loader == null
- || loader == ClassLoader.getSystemClassLoader())
- {
- return System.getProperty ("java.rmi.server.codebase");
- }
-
- if (loader instanceof MyClassLoader)
- {
- return ((MyClassLoader) loader).getClassAnnotation();
- }
-
- String s = (String) cacheAnnotations.get (loader);
-
- if (s != null)
- return s;
-
- if (loader instanceof URLClassLoader)
- {
- URL[] urls = ((URLClassLoader) loader).getURLs();
-
- if (urls.length == 0)
- return null;
-
- StringBuffer annotation = new StringBuffer (64 * urls.length);
-
- for (int i = 0; i < urls.length; i++)
- {
- annotation.append (urls [i].toExternalForm());
- annotation.append (' ');
- }
-
- s = annotation.toString();
- cacheAnnotations.put (loader, s);
- return s;
- }
-
- return System.getProperty ("java.rmi.server.codebase");
- }
-
- /**
- * @deprecated
- */
- public static Object getSecurityContext (ClassLoader loader)
- {
- throw new Error ("Not implemented");
- }
-}
diff --git a/libjava/java/rmi/server/RMIClassLoaderSpi.java b/libjava/java/rmi/server/RMIClassLoaderSpi.java
deleted file mode 100644
index 372d81879f9..00000000000
--- a/libjava/java/rmi/server/RMIClassLoaderSpi.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* RMIClassLoaderSpi.java --
- Copyright (c) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.net.MalformedURLException;
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public abstract class RMIClassLoaderSpi
-{
- public RMIClassLoaderSpi()
- {
- }
-
- public abstract Class loadClass (String codeBase, String name,
- ClassLoader defaultLoader)
- throws MalformedURLException, ClassNotFoundException;
-
- public abstract Class loadProxyClass (String codeBase, String[] interfaces,
- ClassLoader defaultLoader)
- throws MalformedURLException, ClassNotFoundException;
-
- public abstract ClassLoader getClassLoader (String codebase)
- throws MalformedURLException;
-
- public abstract String getClassAnnotation (Class cl);
-}
diff --git a/libjava/java/rmi/server/RMIClientSocketFactory.java b/libjava/java/rmi/server/RMIClientSocketFactory.java
deleted file mode 100644
index a54d11175e0..00000000000
--- a/libjava/java/rmi/server/RMIClientSocketFactory.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* RMIClientSocketFactory.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.io.IOException;
-import java.net.Socket;
-
-public interface RMIClientSocketFactory
-{
- Socket createSocket (String host, int port) throws IOException;
-}
diff --git a/libjava/java/rmi/server/RMIFailureHandler.java b/libjava/java/rmi/server/RMIFailureHandler.java
deleted file mode 100644
index 3496cd6a073..00000000000
--- a/libjava/java/rmi/server/RMIFailureHandler.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/* RMIFailureHandler.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-public interface RMIFailureHandler
-{
- /**
- * @exception IOException If an error occurs
- */
- boolean failure (Exception ex);
-}
diff --git a/libjava/java/rmi/server/RMIServerSocketFactory.java b/libjava/java/rmi/server/RMIServerSocketFactory.java
deleted file mode 100644
index 88eaff32dbc..00000000000
--- a/libjava/java/rmi/server/RMIServerSocketFactory.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* RMIServerSocketFactory.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-
-public interface RMIServerSocketFactory
-{
- ServerSocket createServerSocket(int port) throws IOException;
-}
diff --git a/libjava/java/rmi/server/RMISocketFactory.java b/libjava/java/rmi/server/RMISocketFactory.java
deleted file mode 100644
index 953f1ef33ce..00000000000
--- a/libjava/java/rmi/server/RMISocketFactory.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/* RMISocketFactory.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import gnu.java.rmi.server.RMIDefaultSocketFactory;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.net.Socket;
-
-public abstract class RMISocketFactory
- implements RMIClientSocketFactory, RMIServerSocketFactory
-{
- private static RMISocketFactory defaultFactory;
- private static RMISocketFactory currentFactory;
- private static RMIFailureHandler currentHandler;
-
- static
- {
- defaultFactory = new RMIDefaultSocketFactory();
- currentFactory = defaultFactory;
- }
-
- public RMISocketFactory ()
- {
- }
-
- /**
- * @exception IOException If an error occurs
- */
- public abstract Socket createSocket (String host, int port)
- throws IOException;
-
- /**
- * @exception IOException If an error occurs
- */
- public abstract ServerSocket createServerSocket (int port)
- throws IOException;
-
- /**
- * @exception IOException If an error occurs
- * @exception SecurityException FIXME
- */
- public static void setSocketFactory (RMISocketFactory fac)
- throws IOException
- {
- currentFactory = fac;
- }
-
- public static RMISocketFactory getSocketFactory ()
- {
- return currentFactory;
- }
-
- public static RMISocketFactory getDefaultSocketFactory ()
- {
- return defaultFactory;
- }
-
- /**
- * @exception SecurityException FIXME
- */
- public static void setFailureHandler (RMIFailureHandler fh)
- {
- currentHandler = fh;
- }
-
- public static RMIFailureHandler getFailureHandler ()
- {
- return currentHandler;
- }
-}
diff --git a/libjava/java/rmi/server/RemoteCall.java b/libjava/java/rmi/server/RemoteCall.java
deleted file mode 100644
index 35f3bf1a655..00000000000
--- a/libjava/java/rmi/server/RemoteCall.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* RemoteCall.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.StreamCorruptedException;
-
-/**
- * @deprecated
- */
-public interface RemoteCall
-{
- /**
- * @deprecated
- */
- ObjectOutput getOutputStream () throws IOException;
-
- /**
- * @deprecated
- */
- void releaseOutputStream () throws IOException;
-
- /**
- * @deprecated
- */
- ObjectInput getInputStream () throws IOException;
-
- /**
- * @deprecated
- */
- void releaseInputStream () throws IOException;
-
- /**
- * @deprecated
- */
- ObjectOutput getResultStream (boolean success)
- throws IOException, StreamCorruptedException;
-
- /**
- * @deprecated
- */
- void executeCall () throws Exception;
-
- /**
- * @deprecated
- */
- void done () throws IOException;
-}
diff --git a/libjava/java/rmi/server/RemoteObject.java b/libjava/java/rmi/server/RemoteObject.java
deleted file mode 100644
index 0b3c229c9d9..00000000000
--- a/libjava/java/rmi/server/RemoteObject.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/* RemoteObject.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.rmi.NoSuchObjectException;
-import java.rmi.Remote;
-import java.rmi.UnmarshalException;
-import java.util.WeakHashMap;
-
-public abstract class RemoteObject
- implements Remote, Serializable {
-
-private static final long serialVersionUID = -3215090123894869218l;
-
-protected transient RemoteRef ref;
-
-private static final WeakHashMap stubs = new WeakHashMap();
-
-protected RemoteObject() {
- this(null);
-}
-
-protected RemoteObject(RemoteRef newref) {
- ref = newref;
-}
-
-public RemoteRef getRef() {
- return (ref);
-}
-
-synchronized static void addStub(Remote obj, Remote stub)
-{
- stubs.put(obj, stub);
-}
-
-synchronized static void deleteStub(Remote obj)
-{
- stubs.remove(obj);
-}
-
- public static Remote toStub(Remote obj) throws NoSuchObjectException
- {
- Remote stub = (Remote)stubs.get(obj);
-
- if (stub == null)
- throw new NoSuchObjectException(obj.getClass().getName());
-
- return stub;
- }
-
-public int hashCode() {
- if (ref == null) {
- return (0);
- }
- else {
- return (ref.hashCode());
- }
-}
-
-public boolean equals(Object obj) {
- // We only compare references.
- return (this == obj);
-}
-
- public String toString()
- {
- if (ref == null)
- return getClass ().toString ();
- return (ref.toString ());
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
- {
- String cname = in.readUTF();
- if (!cname.equals(""))
- {
- if (cname.equals ("UnicastRef2"))
- {
- // hack for interoperating with JDK
- cname = "UnicastRef";
- in.read (); //some unknown UnicastRef2 field
- }
-
- cname = RemoteRef.packagePrefix + '.' + cname;
- try
- {
- Class cls = Class.forName(cname);
- ref = (RemoteRef)cls.newInstance();
- }
- catch (InstantiationException e1)
- {
- throw new UnmarshalException("failed to create ref", e1);
- }
- catch (IllegalAccessException e2)
- {
- throw new UnmarshalException("failed to create ref", e2);
- }
- ref.readExternal(in);
- }
- else
- {
- ref = (RemoteRef)in.readObject();
- }
- }
-
-private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException {
- if (ref == null) {
- throw new UnmarshalException("no ref to serialize");
- }
- String cname = ref.getRefClass(out);
- if (cname != null && cname.length() > 0) {
- out.writeUTF(cname);
- ref.writeExternal(out);
- }
- else {
- out.writeUTF("");
- out.writeObject(ref);
- }
-}
-
-}
diff --git a/libjava/java/rmi/server/RemoteRef.java b/libjava/java/rmi/server/RemoteRef.java
deleted file mode 100644
index 7e34db39e89..00000000000
--- a/libjava/java/rmi/server/RemoteRef.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* RemoteRef.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.io.Externalizable;
-import java.io.ObjectOutput;
-import java.lang.reflect.Method;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface RemoteRef extends Externalizable
-{
- long serialVersionUID = 3632638527362204081L;
-
- String packagePrefix = "gnu.java.rmi.server";
-
- /**
- * @deprecated
- */
- void invoke (RemoteCall call) throws Exception;
-
- Object invoke (Remote obj, Method method, Object[] params, long opnum)
- throws Exception;
-
- /**
- * @deprecated
- */
- RemoteCall newCall (RemoteObject obj, Operation[] op, int opnum, long hash)
- throws RemoteException;
-
- /**
- * @deprecated
- */
- void done (RemoteCall call) throws RemoteException;
-
- boolean remoteEquals (RemoteRef ref);
-
- int remoteHashCode();
-
- String getRefClass (ObjectOutput out);
-
- String remoteToString();
-}
diff --git a/libjava/java/rmi/server/RemoteServer.java b/libjava/java/rmi/server/RemoteServer.java
deleted file mode 100644
index 9efb12a782d..00000000000
--- a/libjava/java/rmi/server/RemoteServer.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* RemoteServer.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import gnu.java.rmi.server.RMIIncomingThread;
-
-import java.io.OutputStream;
-import java.io.PrintStream;
-
-public abstract class RemoteServer extends RemoteObject
-{
-private static final long serialVersionUID = -4100238210092549637L;
-
-protected RemoteServer() {
- super();
-}
-
-protected RemoteServer(RemoteRef ref) {
- super(ref);
-}
-
-public static String getClientHost() throws ServerNotActiveException {
- Thread currThread = Thread.currentThread();
- if (currThread instanceof RMIIncomingThread) {
- RMIIncomingThread incomingThread = (RMIIncomingThread) currThread;
- return incomingThread.getClientHost();
- } else {
- throw new ServerNotActiveException(
- "Unknown client host - current thread not instance of 'RMIIncomingThread'");
- }
-}
-
-public static void setLog(OutputStream out) {
- throw new Error("Not implemented");
-}
-
-public static PrintStream getLog() {
- throw new Error("Not implemented");
-}
-
-}
diff --git a/libjava/java/rmi/server/RemoteStub.java b/libjava/java/rmi/server/RemoteStub.java
deleted file mode 100644
index 18c614b54a8..00000000000
--- a/libjava/java/rmi/server/RemoteStub.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* RemoteStub.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-public abstract class RemoteStub extends RemoteObject
-{
- static final long serialVersionUID = -1585587260594494182l;
-
- protected RemoteStub ()
- {
- super ();
- }
-
- protected RemoteStub (RemoteRef ref)
- {
- super (ref);
- }
-
- /**
- * @deprecated
- */
- protected static void setRef (RemoteStub stub, RemoteRef ref)
- {
- stub.ref = ref;
- }
-} // class RemoteSub
diff --git a/libjava/java/rmi/server/ServerCloneException.java b/libjava/java/rmi/server/ServerCloneException.java
deleted file mode 100644
index bda41b3ce91..00000000000
--- a/libjava/java/rmi/server/ServerCloneException.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* ServerCloneException.java -- a UnicastRemoteObject could not be cloned
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-/**
- * Thrown if a remote exception occurs during the cloning process of a
- * <code>UnicastRemoteObject</code>.
- *
- * @author unknown
- * @see UnicastRemoteObject#clone()
- * @since 1.1
- * @status updated to 1.4
- */
-public class ServerCloneException extends CloneNotSupportedException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 6617456357664815945L;
-
- /**
- * The cause of this exception. This pre-dates the exception chaining
- * of Throwable; and although you can change this field, you are wiser
- * to leave it alone.
- *
- * @serial the exception cause
- */
- public Exception detail;
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public ServerCloneException(String s)
- {
- this(s, null);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message
- * @param e the cause
- */
- public ServerCloneException(String s, Exception e)
- {
- super(s);
- initCause(e);
- detail = e;
- }
-
- /**
- * This method returns a message indicating what went wrong, in this
- * format:
- * <code>super.getMessage() + (detail == null ? ""
- * : "; nested exception is:\n\t" + detail)</code>.
- *
- * @return the chained message
- */
- public String getMessage()
- {
- if (detail == this || detail == null)
- return super.getMessage();
- return super.getMessage() + "; nested exception is:\n\t" + detail;
- }
-
- /**
- * Returns the cause of this exception. Note that this may not be the
- * original cause, thanks to the <code>detail</code> field being public
- * and non-final (yuck). However, to avoid violating the contract of
- * Throwable.getCause(), this returns null if <code>detail == this</code>,
- * as no exception can be its own cause.
- *
- * @return the cause
- * @since 1.4
- */
- public Throwable getCause()
- {
- return detail == this ? null : detail;
- }
-}
diff --git a/libjava/java/rmi/server/ServerNotActiveException.java b/libjava/java/rmi/server/ServerNotActiveException.java
deleted file mode 100644
index 0581b63bc82..00000000000
--- a/libjava/java/rmi/server/ServerNotActiveException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ServerNotActiveException.java -- the method is not servicing a remote call
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-/**
- * Thrown during <code>RemoteServer.getClientHost</code> if the host is
- * not servicing a remote method call.
- *
- * @author unknown
- * @see RemoteServer#getClientHost()
- * @since 1.1
- * @status updated to 1.4
- */
-public class ServerNotActiveException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 4687940720827538231L;
-
- /**
- * Create an exception with no message.
- */
- public ServerNotActiveException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param s the message
- */
- public ServerNotActiveException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/rmi/server/ServerRef.java b/libjava/java/rmi/server/ServerRef.java
deleted file mode 100644
index cf1013cf02b..00000000000
--- a/libjava/java/rmi/server/ServerRef.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ServerRef.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface ServerRef extends RemoteRef
-{
- long serialVersionUID = -4557750989390278438L;
-
- RemoteStub exportObject(Remote obj, Object data) throws RemoteException;
-
- String getClientHost() throws ServerNotActiveException;
-}
diff --git a/libjava/java/rmi/server/Skeleton.java b/libjava/java/rmi/server/Skeleton.java
deleted file mode 100644
index 82f5d3837f4..00000000000
--- a/libjava/java/rmi/server/Skeleton.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Skeleton.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.rmi.Remote;
-
-/**
- * @deprecated
- */
-public interface Skeleton
-{
- /**
- * @deprecated
- */
- void dispatch (Remote obj, RemoteCall theCall, int opnum, long hash)
- throws Exception;
-
- /**
- * @deprecated
- */
- Operation[] getOperations();
-}
diff --git a/libjava/java/rmi/server/SkeletonMismatchException.java b/libjava/java/rmi/server/SkeletonMismatchException.java
deleted file mode 100644
index 9c0206ab3bc..00000000000
--- a/libjava/java/rmi/server/SkeletonMismatchException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* SkeletonMismatchException.java -- thrown when stub class versions mismatch
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.rmi.RemoteException;
-
-/**
- * Thrown if a call is received that does not match a Skeleton. Note that
- * Skeletons are no longer required.
- *
- * @author unknown
- * @since 1.1
- * @deprecated no replacement. Skeletons are no longer required.
- * @status updated to 1.4
- */
-public class SkeletonMismatchException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1.
- */
- private static final long serialVersionUID = -7780460454818859281l;
-
- /**
- * Create an exception with the specified message.
- *
- * @param s the message
- * @deprecated no longer needed
- */
- public SkeletonMismatchException(String s)
- {
- super(s);
- }
-}
diff --git a/libjava/java/rmi/server/SkeletonNotFoundException.java b/libjava/java/rmi/server/SkeletonNotFoundException.java
deleted file mode 100644
index 596aae15417..00000000000
--- a/libjava/java/rmi/server/SkeletonNotFoundException.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* SkeletonNotFoundException.java -- thrown if a Skeleton is not found
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.rmi.RemoteException;
-
-/**
- * Thrown if a Skeleton corresponding to the remote object is not found.
- * Note that Skeletons are no longer required.
- *
- * @author unknown
- * @since 1.1
- * @deprecated no replacement. Skeletons are no longer required.
- * @status updated to 1.4
- */
-public class SkeletonNotFoundException extends RemoteException
-{
- /**
- * Compatible with JDK 1.1.
- */
- private static final long serialVersionUID = -7860299673822761231L;
-
- /**
- * Create an exception with the specified message.
- *
- * @param s the message
- */
- public SkeletonNotFoundException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with the specified message and cause.
- *
- * @param s the message
- * @param e the cause
- */
- public SkeletonNotFoundException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/server/SocketSecurityException.java b/libjava/java/rmi/server/SocketSecurityException.java
deleted file mode 100644
index aaf7698f4bc..00000000000
--- a/libjava/java/rmi/server/SocketSecurityException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* SocketSecurityException.java -- the socket could not be created
- Copyright (c) 1996, 1997, 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-/**
- * Thrown during remote object export if the code does not have permission
- * to create a <code>java.net.ServerSocket</code> on the specified port.
- *
- * @author unknown
- * @since 1.1
- * @status updated to 1.4
- */
-public class SocketSecurityException extends ExportException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -7622072999407781979L;
-
- /**
- * Create an exception with the specified message.
- *
- * @param s the message
- */
- public SocketSecurityException(String s)
- {
- super(s);
- }
-
- /**
- * Create an exception with the specified message and cause.
- *
- * @param s the message
- * @param e the cause
- */
- public SocketSecurityException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/java/rmi/server/UID.java b/libjava/java/rmi/server/UID.java
deleted file mode 100644
index 0f492bae77a..00000000000
--- a/libjava/java/rmi/server/UID.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/* UID.java --
- Copyright (c) 1996, 1997, 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-
-public final class UID implements Serializable
-{
-private static final long serialVersionUID = 1086053664494604050L;
-
-private static final Object lock = UID.class;
-private static long baseTime = System.currentTimeMillis();
-private static short nextCount = Short.MIN_VALUE;
-// This is sun's algorithm - don't ask me why ...
-private static final int uniqueNr = (new Object()).hashCode();
-
-private int unique;
-private long time;
-private short count;
-
-/**
- * This is sun's algorithm - don't ask me why ...
- */
-public UID() {
- synchronized (lock) {
- if (nextCount == Short.MAX_VALUE) {
- long newtime;
- for (;;) {
- newtime = System.currentTimeMillis();
- if (newtime - baseTime > 1000) {
- break;
- }
- try {
- Thread.sleep(1000);
- }
- catch (InterruptedException _) {
- }
- }
- baseTime = newtime;
- nextCount = Short.MIN_VALUE;
- }
- count = nextCount++;
- unique = uniqueNr;
- time = baseTime;
- }
-}
-
-public UID(short num) {
- unique = (int)num;
- time = 0;
- count = 0;
-}
-
-public int hashCode() {
- return (unique);
-}
-
-public boolean equals(Object obj) {
- if (obj instanceof UID) {
- UID uid = (UID)obj;
- if (this.unique == uid.unique &&
- this.time == uid.time &&
- this.count == uid.count) {
- return (true);
- }
- }
- return (false);
-}
-
-public String toString() {
- return ("[UID: " + unique + "," + time + "," + count + "]");
-}
-
-public void write(DataOutput out) throws IOException {
- out.writeInt(unique);
- out.writeLong(time);
- out.writeShort(count);
-}
-
-public static UID read(DataInput in) throws IOException {
- UID id = new UID();
- id.unique = in.readInt();
- id.time = in.readLong();
- id.count = in.readShort();
- return (id);
-}
-
-}
diff --git a/libjava/java/rmi/server/UnicastRemoteObject.java b/libjava/java/rmi/server/UnicastRemoteObject.java
deleted file mode 100644
index dbe25bda3fd..00000000000
--- a/libjava/java/rmi/server/UnicastRemoteObject.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* UnicastRemoteObject.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-import gnu.java.rmi.server.UnicastServerRef;
-
-import java.rmi.NoSuchObjectException;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public class UnicastRemoteObject extends RemoteServer
-{
-private static final long serialVersionUID = 4974527148936298033L;
-//The following serialized fields are from Java API Documentation "Serialized form"
-private int port = 0;
-private RMIClientSocketFactory csf = null;
-private RMIServerSocketFactory ssf = null;
-
-protected UnicastRemoteObject() throws RemoteException {
- this(0);
-}
-
-protected UnicastRemoteObject(int port) throws RemoteException {
- this(port, RMISocketFactory.getSocketFactory(), RMISocketFactory.getSocketFactory());
-}
-
-protected UnicastRemoteObject(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
- this.port = port;
- //Is RMIXXXSocketFactory serializable
- //this.csf = csf;
- //this.ssf = ssf;
- this.ref = new UnicastServerRef(new ObjID(), port, ssf);
- exportObject(this);
-}
-
-protected UnicastRemoteObject(RemoteRef ref) throws RemoteException {
- super((UnicastServerRef)ref);
- exportObject(this);
-}
-
-public Object clone() throws CloneNotSupportedException {
- throw new Error("Not implemented");
-}
-
-public static RemoteStub exportObject(Remote obj) throws RemoteException {
- UnicastServerRef sref = (UnicastServerRef)((RemoteObject)obj).getRef();
- return (sref.exportObject(obj));
-}
-
- public static Remote exportObject(Remote obj, int port) throws RemoteException
- {
- return exportObject(obj, port, null);
- }
-
- static Remote exportObject(Remote obj, int port, RMIServerSocketFactory ssf)
- throws RemoteException
- {
- UnicastServerRef sref = null;
- if (obj instanceof RemoteObject)
- sref = (UnicastServerRef)((RemoteObject)obj).getRef ();
- if(sref == null)
- {
- sref = new UnicastServerRef(new ObjID (), port, ssf);
- }
- Remote stub = sref.exportObject (obj);
- addStub(obj, stub);
- return stub;
- }
-
- /**
- * FIXME
- */
- public static Remote exportObject(Remote obj, int port, RMIClientSocketFactory csf,
- RMIServerSocketFactory ssf)
- throws RemoteException
- {
- return (exportObject(obj, port, ssf));
- }
-
- public static boolean unexportObject(Remote obj, boolean force)
- throws NoSuchObjectException
- {
- if (obj instanceof RemoteObject)
- {
- deleteStub(obj);
- UnicastServerRef sref = (UnicastServerRef)((RemoteObject)obj).getRef();
- return sref.unexportObject(obj, force);
- }
- else
- {
- //FIX ME
- ;
- }
- return true;
- }
-
-}
diff --git a/libjava/java/rmi/server/Unreferenced.java b/libjava/java/rmi/server/Unreferenced.java
deleted file mode 100644
index 982aa64458f..00000000000
--- a/libjava/java/rmi/server/Unreferenced.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Unreferenced.java --
- Copyright (c) 1996, 1997, 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.rmi.server;
-
-public interface Unreferenced
-{
- void unreferenced();
-}
diff --git a/libjava/java/security/AccessControlException.java b/libjava/java/security/AccessControlException.java
deleted file mode 100644
index 27aee7c869a..00000000000
--- a/libjava/java/security/AccessControlException.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* AccessControlException.java -- Permission is denied
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This exception is thrown when the <code>AccessController</code> denies
- * an attempt to perform an operation. This often keeps track of the
- * permission that was not granted.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see AccessController
- * @status updated to 1.4
- */
-public class AccessControlException extends SecurityException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 5138225684096988535L;
-
- /**
- * The <code>Permission</code> associated with this exception.
- *
- * @serial the permission
- */
- private final Permission perm;
-
- /**
- * Create a new instance with a descriptive error message, and a null
- * <code>Permission</code> object.
- *
- * @param msg the descriptive error message
- */
- public AccessControlException(String msg)
- {
- this(msg, null);
- }
-
- /**
- * Create a new instance with a descriptive error message and an associated
- * <code>Permission</code> object.
- *
- * @param msg the descriptive error message
- * @param perm the permission that caused this
- */
- public AccessControlException(String msg, Permission perm)
- {
- super(msg);
- this.perm = perm;
- }
-
- /**
- * This method returns the <code>Permission</code> object that caused
- * this exception to be thrown.
- *
- * @return the denied permission, or null
- */
- public Permission getPermission()
- {
- return perm;
- }
-}
diff --git a/libjava/java/security/AlgorithmParameterGenerator.java b/libjava/java/security/AlgorithmParameterGenerator.java
deleted file mode 100644
index 5dc9e3bb274..00000000000
--- a/libjava/java/security/AlgorithmParameterGenerator.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/* AlgorithmParameterGenerator.java --- Algorithm Parameter Generator
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import gnu.java.security.Engine;
-
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * <p>The <code>AlgorithmParameterGenerator</code> class is used to generate a
- * set of parameters to be used with a certain algorithm. Parameter generators
- * are constructed using the <code>getInstance()</code> factory methods (static
- * methods that return instances of a given class).</p>
- *
- * <p>The object that will generate the parameters can be initialized in two
- * different ways: in an algorithm-independent manner, or in an
- * algorithm-specific manner:</p>
- *
- * <ul>
- * <li>The algorithm-independent approach uses the fact that all parameter
- * generators share the concept of a <i>"size"</i> and a <i>source of
- * randomness</i>. The measure of <i>size</i> is universally shared by all
- * algorithm parameters, though it is interpreted differently for different
- * algorithms. For example, in the case of parameters for the <i>DSA</i>
- * algorithm, <i>"size"</i> corresponds to the size of the prime modulus (in
- * bits). When using this approach, algorithm-specific parameter generation
- * values - if any - default to some standard values, unless they can be
- * derived from the specified size.</li>
- * <li>The other approach initializes a parameter generator object using
- * algorithm-specific semantics, which are represented by a set of
- * algorithm-specific parameter generation values. To generate Diffie-Hellman
- * system parameters, for example, the parameter generation values usually
- * consist of the size of the prime modulus and the size of the random
- * exponent, both specified in number of bits.</li>
- * </ul>
- *
- * <p>In case the client does not explicitly initialize the
- * <code>AlgorithmParameterGenerator</code> (via a call to an <code>init()</code>
- * method), each provider must supply (and document) a default initialization.
- * For example, the <b>GNU</b> provider uses a default modulus prime size of
- * <code>1024</code> bits for the generation of <i>DSA</i> parameters.
- *
- * @author Mark Benvenuto
- * @since 1.2
- * @see AlgorithmParameters
- * @see AlgorithmParameterSpec
- */
-public class AlgorithmParameterGenerator
-{
- /** Service name for algorithm parameter generators. */
- private static final String ALGORITHM_PARAMETER_GENERATOR =
- "AlgorithmParameterGenerator";
-
- private AlgorithmParameterGeneratorSpi paramGenSpi;
- private Provider provider;
- private String algorithm;
-
- /**
- * Creates an <code>AlgorithmParameterGenerator</code> object.
- *
- * @param paramGenSpi the delegate.
- * @param provider the provider.
- * @param algorithm the algorithm.
- */
- protected AlgorithmParameterGenerator(AlgorithmParameterGeneratorSpi
- paramGenSpi, Provider provider,
- String algorithm)
- {
- this.paramGenSpi = paramGenSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- }
-
- /**
- * Returns the standard name of the algorithm this parameter generator is
- * associated with.
- *
- * @return the string name of the algorithm.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Generates an <code>AlgorithmParameterGenerator</code> object that
- * implements the specified digest algorithm. If the default provider package
- * provides an implementation of the requested digest algorithm, an instance
- * of <code>AlgorithmParameterGenerator</code> containing that implementation
- * is returned. If the algorithm is not available in the default package,
- * other packages are searched.
- *
- * @param algorithm the string name of the algorithm this parameter generator
- * is associated with.
- * @return the new <code>AlgorithmParameterGenerator</code> object.
- * @throws NoSuchAlgorithmException if the algorithm is not available in the
- * environment.
- */
- public static AlgorithmParameterGenerator getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] p = Security.getProviders();
- for (int i = 0; i < p.length; i++)
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignore.
- }
-
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Generates an <code>AlgorithmParameterGenerator</code> object for the
- * requested algorithm, as supplied from the specified provider, if such a
- * parameter generator is available from the provider.
- *
- * @param algorithm the string name of the algorithm.
- * @param provider the string name of the provider.
- * @return the new <code>AlgorithmParameterGenerator</code> object.
- * @throws NoSuchAlgorithmException if the <code>algorithm</code> is not
- * available from the <code>provider</code>.
- * @throws NoSuchProviderException if the <code>provider</code> is not
- * available in the environment.
- * @throws IllegalArgumentException if the <code>provider</code> name is
- * <code>null</code> or empty.
- * @see Provider
- */
- public static AlgorithmParameterGenerator getInstance(String algorithm,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
-
- return getInstance(algorithm, p);
- }
-
- /**
- * Generates an AlgorithmParameterGenerator object for the requested
- * algorithm, as supplied from the specified provider, if such a parameter
- * generator is available from the provider. Note: the <code>provider</code>
- * doesn't have to be registered.
- *
- * @param algorithm the string name of the algorithm.
- * @param provider the provider.
- * @return the new AlgorithmParameterGenerator object.
- * @throws NoSuchAlgorithmException if the algorithm is not available from
- * the provider.
- * @throws IllegalArgumentException if the provider is null.
- * @since 1.4
- * @see Provider
- */
- public static AlgorithmParameterGenerator getInstance(String algorithm,
- Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
- try
- {
- return new AlgorithmParameterGenerator(
- (AlgorithmParameterGeneratorSpi) Engine.getInstance(
- ALGORITHM_PARAMETER_GENERATOR, algorithm, provider),
- provider, algorithm);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- /**
- * Returns the provider of this algorithm parameter generator object.
- *
- * @return the provider of this algorithm parameter generator object.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Initializes this parameter generator for a certain <i>size</i>. To create
- * the parameters, the {@link SecureRandom} implementation of the
- * highest-priority installed provider is used as the source of randomness.
- * (If none of the installed providers supply an implementation of
- * {@link SecureRandom}, a system-provided source of randomness is used.)
- *
- * @param size the size (number of bits).
- */
- public final void init(int size)
- {
- init(size, new SecureRandom());
- }
-
- /**
- * Initializes this parameter generator for a certain size and source of
- * randomness.
- *
- * @param size the size (number of bits).
- * @param random the source of randomness.
- */
- public final void init(int size, SecureRandom random)
- {
- paramGenSpi.engineInit(size, random);
- }
-
- /**
- * Initializes this parameter generator with a set of algorithm-specific
- * parameter generation values. To generate the parameters, the {@link
- * SecureRandom} implementation of the highest-priority installed provider is
- * used as the source of randomness. (If none of the installed providers
- * supply an implementation of {@link SecureRandom}, a system-provided source
- * of randomness is used.)
- *
- * @param genParamSpec the set of algorithm-specific parameter generation
- * values.
- * @throws InvalidAlgorithmParameterException if the given parameter
- * generation values are inappropriate for this parameter generator.
- */
- public final void init(AlgorithmParameterSpec genParamSpec)
- throws InvalidAlgorithmParameterException
- {
- init(genParamSpec, new SecureRandom());
- }
-
- /**
- * Initializes this parameter generator with a set of algorithm-specific
- * parameter generation values.
- *
- * @param genParamSpec the set of algorithm-specific parameter generation
- * values.
- * @param random the source of randomness.
- * @throws InvalidAlgorithmParameterException if the given parameter
- * generation values are inappropriate for this parameter generator.
- */
- public final void init(AlgorithmParameterSpec genParamSpec,
- SecureRandom random)
- throws InvalidAlgorithmParameterException
- {
- paramGenSpi.engineInit(genParamSpec, random);
- }
-
- /**
- * Generates the parameters.
- *
- * @return the new {@link AlgorithmParameters} object.
- */
- public final AlgorithmParameters generateParameters()
- {
- return paramGenSpi.engineGenerateParameters();
- }
-}
diff --git a/libjava/java/security/AlgorithmParameterGeneratorSpi.java b/libjava/java/security/AlgorithmParameterGeneratorSpi.java
deleted file mode 100644
index 3143ea76b8b..00000000000
--- a/libjava/java/security/AlgorithmParameterGeneratorSpi.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* AlgorithmParameterGeneratorSpi.java --- Algorithm Parameter Generator SPI
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- AlgorithmParameterGeneratorSpi is the Service Provider
- Interface for the AlgorithmParameterGenerator class.
- This class is used to generate the algorithm parameters
- for a specific algorithm.
-
- @since JDK 1.2
- @author Mark Benvenuto
- */
-public abstract class AlgorithmParameterGeneratorSpi
-{
-
- /**
- Constructs a new AlgorithmParameterGeneratorSpi
- */
- public AlgorithmParameterGeneratorSpi()
- {
- }
-
- /**
- Initializes the parameter generator with the specified size
- and SecureRandom
-
- @param size the size( in number of bits)
- @param random the SecureRandom class to use for randomness
- */
- protected abstract void engineInit(int size, SecureRandom random);
-
- /**
- Initializes the parameter generator with the specified
- AlgorithmParameterSpec and SecureRandom classes.
-
- If genParamSpec is an invalid AlgorithmParameterSpec for this
- AlgorithmParameterGeneratorSpi then it throws
- InvalidAlgorithmParameterException
-
- @param genParamSpec the AlgorithmParameterSpec class to use
- @param random the SecureRandom class to use for randomness
-
- @throws InvalidAlgorithmParameterException genParamSpec is invalid
- */
- protected abstract void engineInit(AlgorithmParameterSpec genParamSpec,
- SecureRandom random) throws
- InvalidAlgorithmParameterException;
-
-
- /**
- Generate a new set of AlgorithmParameters.
-
- @returns a new set of algorithm parameters
- */
- protected abstract AlgorithmParameters engineGenerateParameters();
-
-}
diff --git a/libjava/java/security/AlgorithmParameters.java b/libjava/java/security/AlgorithmParameters.java
deleted file mode 100644
index 038fbb4bd64..00000000000
--- a/libjava/java/security/AlgorithmParameters.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/* AlgorithmParameters.java --- Algorithm Parameters Implementation Class
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import gnu.java.security.Engine;
-
-import java.io.IOException;
-import java.security.spec.AlgorithmParameterSpec;
-import java.security.spec.InvalidParameterSpecException;
-
-/**
- * <p>This class is used as an opaque representation of cryptographic
- * parameters.</p>
- *
- * <p>An <code>AlgorithmParameters</code> object for managing the parameters
- * for a particular algorithm can be obtained by calling one of the
- * <code>getInstance()</code> factory methods (static methods that return
- * instances of a given class).</p>
- *
- * <p>There are two ways to request such an implementation: by specifying
- * either just an algorithm name, or both an algorithm name and a package
- * provider.</p>
- *
- * <ul>
- * <li>If just an algorithm name is specified, the system will determine if
- * there is an AlgorithmParameters implementation for the algorithm requested
- * available in the environment, and if there is more than one, if there is
- * a preferred one.</li>
- * <li>If both an algorithm name and a package provider are specified, the
- * system will determine if there is an implementation in the package
- * requested, and throw an exception if there is not.</li>
- * </ul>
- *
- * <p>Once an <code>AlgorithmParameters</code> object is returned, it must be
- * initialized via a call to <code>init()</code>, using an appropriate
- * parameter specification or parameter encoding.</p>
- *
- * <p>A transparent parameter specification is obtained from an
- * <code>AlgorithmParameters</code> object via a call to
- * <code>getParameterSpec()</code>, and a byte encoding of the parameters is
- * obtained via a call to <code>getEncoded()</code>.</p>
- *
- * @author Mark Benvenuto
- * @since 1.2
- * @see AlgorithmParameterSpec
- * @see java.security.spec.DSAParameterSpec
- * @see KeyPairGenerator
- */
-public class AlgorithmParameters
-{
- /** Service name for algorithm parameters. */
- private static final String ALGORITHM_PARAMETERS = "AlgorithmParameters";
-
- private AlgorithmParametersSpi paramSpi;
- private Provider provider;
- private String algorithm;
-
- /**
- * Creates an <code>AlgorithmParameters</code> object.
- *
- * @param paramSpi the delegate.
- * @param provider the provider.
- * @param algorithm the algorithm.
- */
- protected AlgorithmParameters(AlgorithmParametersSpi paramSpi,
- Provider provider, String algorithm)
- {
- this.paramSpi = paramSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- }
-
- /**
- * Returns the name of the algorithm associated with this parameter object.
- *
- * @return the algorithm name.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * <p>Generates a parameter object for the specified algorithm.</p>
- *
- * <p>If the default provider package provides an implementation of the
- * requested algorithm, an instance of <code>AlgorithmParameters</code>
- * containing that implementation is returned. If the algorithm is not
- * available in the default package, other packages are searched.</p>
- *
- * <p>The returned parameter object must be initialized via a call to
- * <code>init()</code>, using an appropriate parameter specification or
- * parameter encoding.</p>
- *
- * @param algorithm the name of the algorithm requested.
- * @return the new parameter object.
- * @throws NoSuchAlgorithmException if the algorithm is not available in the
- * environment.
- */
- public static AlgorithmParameters getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] p = Security.getProviders();
-
- for (int i = 0; i < p.length; i++)
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignore this.
- }
-
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * <p>Generates a parameter object for the specified algorithm, as supplied
- * by the specified provider, if such an algorithm is available from the
- * provider.</p>
- *
- * <p>The returned parameter object must be initialized via a call to
- * <code>init()</code>, using an appropriate parameter specification or
- * parameter encoding.</p>
- *
- * @param algorithm the name of the algorithm requested.
- * @param provider the name of the provider.
- * @return the new parameter object.
- * @throws NoSuchAlgorithmException if the algorithm is not available in the
- * package supplied by the requested provider.
- * @throws NoSuchProviderException if the provider is not available in the
- * environment.
- * @throws IllegalArgumentException if the provider name is null or empty.
- * @see Provider
- */
- public static AlgorithmParameters getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
-
- return getInstance(algorithm, p);
- }
-
- /**
- * Generates an <code>AlgorithmParameterGenerator</code> object for the
- * requested algorithm, as supplied from the specified provider, if such a
- * parameter generator is available from the provider. Note: the
- * <code>provider</code> doesn't have to be registered.
- *
- * @param algorithm the string name of the algorithm.
- * @param provider the provider.
- * @return the new <code>AlgorithmParameterGenerator</code> object.
- * @throws NoSuchAlgorithmException if the <code>algorithm</code> is not
- * available from the <code>provider</code>.
- * @throws IllegalArgumentException if the <code>provider</code> is
- * <code>null</code>.
- * @since 1.4
- */
- public static AlgorithmParameters getInstance(String algorithm,
- Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
- try
- {
- return new AlgorithmParameters((AlgorithmParametersSpi)
- Engine.getInstance(ALGORITHM_PARAMETERS, algorithm, provider),
- provider, algorithm);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- /**
- * Returns the provider of this parameter object.
- *
- * @return the provider of this parameter object.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Initializes this parameter object using the parameters specified in
- * <code>paramSpec</code>.
- *
- * @param paramSpec the parameter specification.
- * @throws InvalidParameterSpecException if the given parameter specification
- * is inappropriate for the initialization of this parameter object, or if
- * this parameter object has already been initialized.
- */
- public final void init(AlgorithmParameterSpec paramSpec)
- throws InvalidParameterSpecException
- {
- paramSpi.engineInit(paramSpec);
- }
-
- /**
- * Imports the specified parameters and decodes them according to the primary
- * decoding format for parameters. The primary decoding format for parameters
- * is ASN.1, if an ASN.1 specification for this type of parameters exists.
- *
- * @param params the encoded parameters.
- * @throws IOException on decoding errors, or if this parameter object has
- * already been initialized.
- */
- public final void init(byte[]params) throws IOException
- {
- paramSpi.engineInit(params);
- }
-
- /**
- * Imports the parameters from params and decodes them according to the
- * specified decoding scheme. If <code>format</code> is <code>null</code>,
- * the primary decoding format for parameters is used. The primary decoding
- * format is ASN.1, if an ASN.1 specification for these parameters exists.
- *
- * @param params the encoded parameters.
- * @param format the name of the decoding scheme.
- * @throws IOException on decoding errors, or if this parameter object has
- * already been initialized.
- */
- public final void init(byte[]params, String format) throws IOException
- {
- paramSpi.engineInit(params, format);
- }
-
- /**
- * Returns a (transparent) specification of this parameter object.
- * <code>paramSpec</code> identifies the specification class in which the
- * parameters should be returned. It could, for example, be
- * <code>DSAParameterSpec.class</code>, to indicate that the parameters should
- * be returned in an instance of the {@link java.security.spec.DSAParameterSpec}
- * class.
- *
- * @param paramSpec the specification class in which the parameters should be
- * returned.
- * @return the parameter specification.
- * @throws InvalidParameterSpecException if the requested parameter
- * specification is inappropriate for this parameter object, or if this
- * parameter object has not been initialized.
- */
- public final AlgorithmParameterSpec getParameterSpec(Class paramSpec)
- throws InvalidParameterSpecException
- {
- return paramSpi.engineGetParameterSpec(paramSpec);
- }
-
- /**
- * Returns the parameters in their primary encoding format. The primary
- * encoding format for parameters is ASN.1, if an ASN.1 specification for
- * this type of parameters exists.
- *
- * @return the parameters encoded using their primary encoding format.
- * @throws IOException on encoding errors, or if this parameter object has not
- * been initialized.
- */
- public final byte[] getEncoded() throws IOException
- {
- return paramSpi.engineGetEncoded();
- }
-
- /**
- * Returns the parameters encoded in the specified scheme. If format is
- * <code>null</code>, the primary encoding format for parameters is used. The
- * primary encoding format is ASN.1, if an ASN.1 specification for these
- * parameters exists.
- *
- * @param format the name of the encoding format.
- * @return the parameters encoded using the specified encoding scheme.
- * @throws IOException on encoding errors, or if this parameter object has
- * not been initialized.
- */
- public final byte[] getEncoded(String format) throws IOException
- {
- return paramSpi.engineGetEncoded(format);
- }
-
- /**
- * Returns a formatted string describing the parameters.
- *
- * @return a formatted string describing the parameters, or <code>null</code>
- * if this parameter object has not been initialized.
- */
- public final String toString()
- {
- return paramSpi.engineToString();
- }
-}
diff --git a/libjava/java/security/AlgorithmParametersSpi.java b/libjava/java/security/AlgorithmParametersSpi.java
deleted file mode 100644
index a9faa154374..00000000000
--- a/libjava/java/security/AlgorithmParametersSpi.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* AlgorithmParametersSpi.java --- Algorithm Parameters SPI
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.IOException;
-import java.security.spec.AlgorithmParameterSpec;
-import java.security.spec.InvalidParameterSpecException;
-
-/**
- * AlgorithmParametersSpi is the Service Provider Interface
- * for the Algorithm Parameters class. This class is used
- * to manage the algorithm parameters.
- *
- * @since 1.2
- * @author Mark Benvenuto
- */
-public abstract class AlgorithmParametersSpi
-{
- /**
- * Creates a new instance of AlgorithmParametersSpi
- */
- public AlgorithmParametersSpi()
- {
- }
-
- /**
- * Initializes the engine with the specified
- * AlgorithmParameterSpec class.
- *
- * @param paramSpec A AlgorithmParameterSpec to initialize with
- *
- * @throws InvalidParameterSpecException For an inapporiate
- * ParameterSpec class
- */
- protected abstract void engineInit(AlgorithmParameterSpec paramSpec)
- throws InvalidParameterSpecException;
-
- /**
- * Initializes the engine with the specified
- * parameters stored in the byte array and decodes them
- * according to the ASN.1 specification. If the ASN.1
- * specification exists then it succeeds or else it throws
- * IOException.
- *
- * @param params Parameters to initialize with
- *
- * @throws IOException Decoding Error
- */
- protected abstract void engineInit(byte[]params) throws IOException;
-
- /**
- * Initializes the engine with the specified
- * parameters stored in the byte array and decodes them
- * according to the specified decoding specification.
- * If format is null, then it is decoded using the ASN.1
- * specification if it exists or else it throws
- * IOException.
- *
- * @param params Parameters to initialize with
- * @param format Name of decoding format to use
- *
- * @throws IOException Decoding Error
- */
- protected abstract void engineInit(byte[]params, String format)
- throws IOException;
-
-
- /**
- * Returns a specification of this AlgorithmParameters object.
- * paramSpec identifies the class to return the AlgortihmParameters
- * in.
- *
- * @param paramSpec Class to return AlgorithmParameters in
- *
- * @return the parameter specification
- *
- * @throws InvalidParameterSpecException if the paramSpec is an
- * invalid parameter class
- */
- protected abstract AlgorithmParameterSpec engineGetParameterSpec(Class
- paramSpec)
- throws InvalidParameterSpecException;
-
-
- /**
- * Returns the parameters in the default encoding format.
- * The primary encoding format is ASN.1 format if it exists
- * for the specified type.
- *
- * @return byte array representing the parameters
- */
- protected abstract byte[] engineGetEncoded() throws IOException;
-
-
- /**
- * Returns the parameters in the specified encoding format.
- * If <code>format</code> is <code>null</code> then the
- * primary encoding format is used, the ASN.1 format,
- * if it exists for the specified type.
- *
- * @return byte array representing the parameters
- */
- protected abstract byte[] engineGetEncoded(String format)
- throws IOException;
-
- /**
- * Returns a string describing the parameters in the
- * AlgorithmParametersSpi class.
- *
- * @return A string representing the format of the parameters.
- */
- protected abstract String engineToString();
-}
diff --git a/libjava/java/security/AllPermission.java b/libjava/java/security/AllPermission.java
deleted file mode 100644
index 6adcd8c9c96..00000000000
--- a/libjava/java/security/AllPermission.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/* AllPermission.java -- Permission to do anything
- Copyright (C) 1998, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import gnu.java.util.EmptyEnumeration;
-
-import java.util.Collections;
-import java.util.Enumeration;
-
-/**
- * This class is a permission that implies all other permissions. Granting
- * this permission effectively grants all others. Extreme caution should
- * be exercised in granting this permission.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see AccessController
- * @see Permissions
- * @see SecurityManager
- * @since 1.1
- * @status updated to 1.4
- */
-public final class AllPermission extends Permission
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -2916474571451318075L;
-
- /**
- * Create a new AllPermission object.
- */
- public AllPermission()
- {
- super("*");
- }
-
- /**
- * Create a new AllPermission object. The parameters are ignored, as all
- * permission implies ALL PERMISSION.
- *
- * @param name ignored
- * @param actions ignored
- */
- public AllPermission(String name, String actions)
- {
- super("*");
- }
-
- /**
- * This method always returns <code>true</code> to indicate that this
- * permission always implies that any other permission is also granted.
- *
- * @param perm ignored
- * @return true, the permission is implied
- */
- public boolean implies(Permission perm)
- {
- return true;
- }
-
- /**
- * Checks an object for equality. All AllPermissions are equal.
- *
- * @param obj the <code>Object</code> to test for equality
- */
- public boolean equals(Object obj)
- {
- return obj instanceof AllPermission;
- }
-
- /**
- * This method returns a hash code for this object. This returns 1.
- *
- * @return a hash value for this object
- */
- public int hashCode()
- {
- return 1;
- }
-
- /**
- * This method returns the list of actions associated with this object.
- * This will always be the empty string ("") for this class.
- *
- * @return the action list
- */
- public String getActions()
- {
- return "";
- }
-
- /**
- * Returns a PermissionCollection which can hold AllPermission.
- *
- * @return a permission collection
- */
- public PermissionCollection newPermissionCollection()
- {
- return new AllPermissionCollection();
- }
-
- /**
- * Implements AllPermission.newPermissionCollection, and obeys serialization
- * of JDK.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class AllPermissionCollection extends PermissionCollection
- {
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -4023755556366636806L;
-
- /**
- * Whether an AllPermission has been added to the collection.
- *
- * @serial if all permission is in the collection yet
- */
- private boolean all_allowed;
-
- /**
- * Add an AllPermission.
- *
- * @param perm the permission to add
- * @throws IllegalArgumentException if perm is not an AllPermission
- * @throws SecurityException if the collection is read-only
- */
- public void add(Permission perm)
- {
- if (isReadOnly())
- throw new SecurityException();
- if (! (perm instanceof AllPermission))
- throw new IllegalArgumentException();
- all_allowed = true;
- }
-
- /**
- * Returns true if this collection implies a permission.
- *
- * @param perm the permission to check
- * @return true if this collection contains an AllPermission
- */
- public boolean implies(Permission perm)
- {
- return all_allowed;
- }
-
- /**
- * Returns an enumeration of the elements in the collection.
- *
- * @return the elements in the collection
- */
- public Enumeration elements()
- {
- return all_allowed
- ? Collections.enumeration(Collections.singleton(new AllPermission()))
- : EmptyEnumeration.getInstance();
- }
- } // class AllPermissionCollection
-} // class AllPermission
diff --git a/libjava/java/security/BasicPermission.java b/libjava/java/security/BasicPermission.java
deleted file mode 100644
index 267a6e292ab..00000000000
--- a/libjava/java/security/BasicPermission.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/* BasicPermission.java -- implements a simple named permission
- Copyright (C) 1998, 1999, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-/**
- * This class implements a simple model for named permissions without an
- * associated action list. That is, either the named permission is granted
- * or it is not.
- *
- * <p>It also supports trailing wildcards to allow the easy granting of
- * permissions in a hierarchical fashion. (For example, the name "org.gnu.*"
- * might grant all permissions under the "org.gnu" permissions hierarchy).
- * The only valid wildcard character is a '*' which matches anything. It
- * must be the rightmost element in the permission name and must follow a
- * '.' or else the Permission name must consist of only a '*'. Any other
- * occurrence of a '*' is not valid.
- *
- * <p>This class ignores the action list. Subclasses can choose to implement
- * actions on top of this class if desired.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Permission
- * @see Permissions
- * @see PermissionCollection
- * @see RuntimePermission
- * @see SecurityPermission
- * @see PropertyPermission
- * @see AWTPermission
- * @see NetPermission
- * @see SecurityManager
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class BasicPermission extends java.security.Permission
- implements Serializable
- // FIXME extends with fully qualified classname as workaround for gcj 3.3.
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 6279438298436773498L;
-
- /**
- * Create a new instance with the specified permission name. If the
- * name is empty an exception is thrown.
- *
- * @param name the name of this permission
- * @throws NullPointerException if name is null
- * @throws IllegalArgumentException if name is invalid
- */
- public BasicPermission(String name)
- {
- super(name);
-
- // This routine used to check for illegal wildcards, but no such
- // requirement exists in the specification and Sun's runtime
- // doesn't appear to do it.
-
- if ("".equals(name))
- throw new IllegalArgumentException("Empty name");
- }
-
- /**
- * Create a new instance with the specified permission name. If the name
- * is empty, or contains an illegal wildcard character, an exception is
- * thrown. The actions parameter is ignored.
- *
- * @param name the name of this permission
- * @param actions ignored
- * @throws NullPointerException if name is null
- * @throws IllegalArgumentException if name is invalid
- */
- public BasicPermission(String name, String actions)
- {
- this(name);
- }
-
- /**
- * This method tests to see if the specified permission is implied by this
- * permission. This will be true if the following conditions are met:<ul>
- * <li>The specified object is an instance of the same class as this
- * object.</li>
- * <li>The name of the specified permission is implied by this permission's
- * name based on wildcard matching. For example, "a.*" implies "a.b".</li>
- * </ul>
- *
- * @param perm the <code>Permission</code> object to test against
- * @return true if the specified permission is implied
- */
- public boolean implies(Permission perm)
- {
- if (! getClass().isInstance(perm))
- return false;
-
- String otherName = perm.getName();
- String name = getName();
-
- if (name.equals(otherName))
- return true;
-
- int last = name.length() - 1;
- return name.charAt(last) == '*'
- && otherName.startsWith(name.substring(0, last));
- }
-
- /**
- * This method tests to see if this object is equal to the specified
- * <code>Object</code>. This will be true if and only if the specified
- * object meets the following conditions:<ul>
- * <li>It is an instance of the same class as this.</li>
- * <li>It has the same name as this permission.</li>
- * </ul>
- *
- * @param obj the <code>Object</code> to test for equality
- * @return true if obj is semantically equal to this
- */
- public boolean equals(Object obj)
- {
- return getClass().isInstance(obj)
- && getName().equals(((BasicPermission) obj).getName());
- }
-
- /**
- * This method returns a hash code for this permission object. The hash
- * code returned is the value returned by calling the <code>hashCode</code>
- * method on the <code>String</code> that is the name of this permission.
- *
- * @return a hash value for this object
- */
- public int hashCode()
- {
- return getName().hashCode();
- }
-
- /**
- * This method returns a list of the actions associated with this
- * permission. This method always returns the empty string ("") since
- * this class ignores actions.
- *
- * @return the action list
- */
- public String getActions()
- {
- return "";
- }
-
- /**
- * This method returns an instance of <code>PermissionCollection</code>
- * suitable for storing <code>BasicPermission</code> objects. The
- * collection returned can only store objects of the same type as this.
- * Subclasses which use actions must override this method; but a class with
- * no actions will work fine with this.
- *
- * @return a new empty <code>PermissionCollection</code> object
- */
- public PermissionCollection newPermissionCollection()
- {
- return new BasicPermissionCollection(getClass());
- }
-
- /**
- * Implements AllPermission.newPermissionCollection, and obeys serialization
- * of JDK.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class BasicPermissionCollection extends PermissionCollection
- {
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 739301742472979399L;
-
- /**
- * The permissions in the collection.
- *
- * @serial a hash mapping name to permissions, all of type permClass
- */
- private final Hashtable permissions = new Hashtable();
-
- /**
- * If "*" is in the collection.
- *
- * @serial true if a permission named "*" is in the collection
- */
- private boolean all_allowed;
-
- /**
- * The runtime class which all entries in the table must belong to.
- *
- * @serial the limiting subclass of this collection
- */
- private final Class permClass;
-
- /**
- * Construct a collection over the given runtime class.
- *
- * @param c the class
- */
- BasicPermissionCollection(Class c)
- {
- permClass = c;
- }
-
- /**
- * Add a Permission. It must be of the same type as the permission which
- * created this collection.
- *
- * @param perm the permission to add
- * @throws IllegalArgumentException if perm is not the correct type
- * @throws SecurityException if the collection is read-only
- */
- public void add(Permission perm)
- {
- if (isReadOnly())
- throw new SecurityException("readonly");
- if (! permClass.isInstance(perm))
- throw new IllegalArgumentException("Expecting instance of " + permClass);
- BasicPermission bp = (BasicPermission) perm;
- String name = bp.getName();
- if (name.equals("*"))
- all_allowed = true;
- permissions.put(name, bp);
- }
-
- /**
- * Returns true if this collection implies the given permission.
- *
- * @param permission the permission to check
- * @return true if it is implied by this
- */
- public boolean implies(Permission permission)
- {
- if (! permClass.isInstance(permission))
- return false;
- if (all_allowed)
- return true;
- BasicPermission toImply = (BasicPermission) permission;
- String name = toImply.getName();
- if (name.equals("*"))
- return false;
- int prefixLength = name.length();
- if (name.endsWith("*"))
- prefixLength -= 2;
-
- while (true)
- {
- if (permissions.get(name) != null)
- return true;
- prefixLength = name.lastIndexOf('.', prefixLength);
- if (prefixLength < 0)
- return false;
- name = name.substring(0, prefixLength + 1) + '*';
- }
- }
-
- /**
- * Enumerate over the collection.
- *
- * @return an enumeration of the collection contents
- */
- public Enumeration elements()
- {
- return permissions.elements();
- }
- } // class BasicPermissionCollection
-} // class BasicPermission
diff --git a/libjava/java/security/Certificate.java b/libjava/java/security/Certificate.java
deleted file mode 100644
index 5cdba6e101b..00000000000
--- a/libjava/java/security/Certificate.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Certificate.java -- deprecated interface for modeling digital certificates
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * This interface models a digital certificate which verifies the
- * authenticity of a party. This class simply allows certificate
- * information to be queried, it does not guarantee that the certificate
- * is valid.
- *
- * <p>This class is deprecated in favor of the new java.security.cert package.
- * It exists for backward compatibility only.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @deprecated use {@link java.security.cert} instead
- * @status updated to 1.4
- */
-public interface Certificate
-{
- /**
- * This method returns the <code>Principal</code> that is guaranteeing
- * this certificate.
- *
- * @return the <code>Principal</code> guaranteeing the certificate
- */
- Principal getGuarantor();
-
- /**
- * This method returns the <code>Principal</code> being guaranteed by
- * this certificate.
- *
- * @return the <code>Principal</code> guaranteed by this certificate
- */
- Principal getPrincipal();
-
- /**
- * This method returns the public key for the <code>Principal</code> that
- * is being guaranteed.
- *
- * @return the <code>PublicKey</code> of the Principal being guaranteed
- */
- PublicKey getPublicKey();
-
- /**
- * This method writes the certificate to an <code>OutputStream</code> in
- * a format that can be understood by the <code>decode</code> method.
- *
- * @param out the <code>OutputStream</code> to write to
- * @throws KeyException if there is a problem with the certificate
- * @throws IOException if an error occurs writing to the stream
- * @see #decode(InputStream)
- * @see #getFormat()
- */
- void encode(OutputStream out) throws KeyException, IOException;
-
- /**
- * This method reads an encoded certificate from an <code>InputStream</code>.
- *
- * @param in the <code>InputStream</code> to read from
- * @throws KeyException if there is a problem with the certificate data
- * @throws IOException if an error occurs reading from the stream
- * @see #encode(OutputStream)
- * @see #getFormat()
- */
- void decode(InputStream in) throws KeyException, IOException;
-
- /**
- * This method returns the encoding format of the certificate (e.g., "PGP",
- * "X.509"). This format is used by the <code>encode</code> and
- * <code>decode</code> methods.
- *
- * @return the encoding format being used
- */
- String getFormat();
-
- /**
- * This method returns a <code>String</code> representation of the contents
- * of this certificate.
- *
- * @param detail true to provided more detailed information
- * @return the string representation
- */
- String toString(boolean detail);
-} // interface Certificate
diff --git a/libjava/java/security/CodeSource.java b/libjava/java/security/CodeSource.java
deleted file mode 100644
index b516170281c..00000000000
--- a/libjava/java/security/CodeSource.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/* CodeSource.java -- Code location and certifcates
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.net.SocketPermission;
-import java.net.URL;
-// Note that this overrides Certificate in this package.
-import java.security.cert.Certificate;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-
-/**
- * This class represents a location from which code is loaded (as
- * represented by a URL), and the list of certificates that are used to
- * check the signatures of signed code loaded from this source.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- * @status updated to 1.4
- */
-public class CodeSource implements Serializable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 4977541819976013951L;
-
- /**
- * This is the URL that represents the code base from which code will
- * be loaded.
- *
- * @serial the code location
- */
- private final URL location;
-
- /** The set of certificates for this code base. */
- private transient HashSet certs;
-
- /**
- * This creates a new instance of <code>CodeSource</code> that loads code
- * from the specified URL location and which uses the specified certificates
- * for verifying signatures.
- *
- * @param location the location from which code will be loaded
- * @param certs the list of certificates
- */
- public CodeSource(URL location, Certificate[] certs)
- {
- this.location = location;
- if (certs != null)
- this.certs = new HashSet(Arrays.asList(certs));
- }
-
- /**
- * This method returns a hash value for this object.
- *
- * @return a hash value for this object
- */
- public int hashCode()
- {
- return (location == null ? 0 : location.hashCode())
- ^ (certs == null ? 0 : certs.hashCode());
- }
-
- /**
- * This method tests the specified <code>Object</code> for equality with
- * this object. This will be true if and only if the locations are equal
- * and the certificate sets are identical (ignoring order).
- *
- * @param obj the <code>Object</code> to test against
- * @return true if the specified object is equal to this one
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof CodeSource))
- return false;
- CodeSource cs = (CodeSource) obj;
- return (certs == null ? cs.certs == null : certs.equals(cs.certs))
- && (location == null ? cs.location == null
- : location.equals(cs.location));
- }
-
- /**
- * This method returns the URL specifying the location from which code
- * will be loaded under this <code>CodeSource</code>.
- *
- * @return the code location for this <code>CodeSource</code>
- */
- public final URL getLocation()
- {
- return location;
- }
-
- /**
- * This method returns the list of digital certificates that can be used
- * to verify the signatures of code loaded under this
- * <code>CodeSource</code>.
- *
- * @return the certifcate list for this <code>CodeSource</code>
- */
- public final Certificate[] getCertificates()
- {
- if (certs == null)
- return null;
- Certificate[] c = new Certificate[certs.size()];
- certs.toArray(c);
- return c;
- }
-
- /**
- * This method tests to see if a specified <code>CodeSource</code> is
- * implied by this object. Effectively, to meet this test, the specified
- * object must have all the certifcates this object has (but may have more),
- * and must have a location that is a subset of this object's. In order
- * for this object to imply the specified object, the following must be
- * true:
- *
- * <ol>
- * <li><em>codesource</em> must not be <code>null</code>.</li>
- * <li>If <em>codesource</em> has a certificate list, all of it's
- * certificates must be present in the certificate list of this
- * code source.</li>
- * <li>If this object does not have a <code>null</code> location, then
- * the following addtional tests must be passed.
- *
- * <ol>
- * <li><em>codesource</em> must not have a <code>null</code>
- * location.</li>
- * <li><em>codesource</em>'s location must be equal to this object's
- * location, or
- * <ul>
- * <li><em>codesource</em>'s location protocol, port, and ref (aka,
- * anchor) must equal this objects</li>
- * <li><em>codesource</em>'s location host must imply this object's
- * location host, as determined by contructing
- * <code>SocketPermission</code> objects from each with no
- * action list and using that classes's <code>implies</code>
- * method</li>
- * <li>If this object's location file ends with a '/', then the
- * specified object's location file must start with this
- * object's location file. Otherwise, the specified object's
- * location file must start with this object's location file
- * with the '/' character appended to it.</li>
- * </ul></li>
- * </ol></li>
- * </ol>
- *
- * <p>For example, each of these locations imply the location
- * "http://java.sun.com/classes/foo.jar":</p>
- *
- * <pre>
- * http:
- * http://*.sun.com/classes/*
- * http://java.sun.com/classes/-
- * http://java.sun.com/classes/foo.jar
- * </pre>
- *
- * <p>Note that the code source with null location and null certificates implies
- * all other code sources.</p>
- *
- * @param cs the <code>CodeSource</code> to test against this object
- * @return true if this specified <code>CodeSource</code> is implied
- */
- public boolean implies(CodeSource cs)
- {
- if (cs == null)
- return false;
- // First check the certificate list.
- if (certs != null && (cs.certs == null || ! certs.containsAll(cs.certs)))
- return false;
- // Next check the location.
- if (location == null)
- return true;
- if (cs.location == null
- || ! location.getProtocol().equals(cs.location.getProtocol())
- || (location.getPort() != -1
- && location.getPort() != cs.location.getPort())
- || (location.getRef() != null
- && ! location.getRef().equals(cs.location.getRef())))
- return false;
- if (location.getHost() != null)
- {
- String their_host = cs.location.getHost();
- if (their_host == null)
- return false;
- SocketPermission our_sockperm =
- new SocketPermission(location.getHost(), "accept");
- SocketPermission their_sockperm =
- new SocketPermission(their_host, "accept");
- if (! our_sockperm.implies(their_sockperm))
- return false;
- }
- String our_file = location.getFile();
- if (our_file != null)
- {
- if (! our_file.endsWith("/"))
- our_file += "/";
- String their_file = cs.location.getFile();
- if (their_file == null
- || ! their_file.startsWith(our_file))
- return false;
- }
- return true;
- }
-
- /**
- * This method returns a <code>String</code> that represents this object.
- * The result is in the format <code>"(" + getLocation()</code> followed
- * by a space separated list of certificates (or "&lt;no certificates&gt;"),
- * followed by <code>")"</code>.
- *
- * @return a <code>String</code> for this object
- */
- public String toString()
- {
- StringBuffer sb = new StringBuffer("(").append(location);
- if (certs == null || certs.isEmpty())
- sb.append(" <no certificates>");
- else
- {
- Iterator iter = certs.iterator();
- for (int i = certs.size(); --i >= 0; )
- sb.append(' ').append(iter.next());
- }
- return sb.append(")").toString();
- }
-
- /**
- * Reads this object from a serialization stream.
- *
- * @param s the input stream
- * @throws IOException if reading fails
- * @throws ClassNotFoundException if deserialization fails
- * @serialData this reads the location, then expects an int indicating the
- * number of certificates. Each certificate is a String type
- * followed by an int encoding length, then a byte[] encoding
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- int count = s.readInt();
- certs = new HashSet();
- while (--count >= 0)
- {
- String type = (String) s.readObject();
- int bytes = s.readInt();
- byte[] encoded = new byte[bytes];
- for (int i = 0; i < bytes; i++)
- encoded[i] = s.readByte();
- ByteArrayInputStream stream = new ByteArrayInputStream(encoded);
- try
- {
- CertificateFactory factory = CertificateFactory.getInstance(type);
- certs.add(factory.generateCertificate(stream));
- }
- catch (CertificateException e)
- {
- // XXX Should we ignore this certificate?
- }
- }
- }
-
- /**
- * Writes this object to a serialization stream.
- *
- * @param s the output stream
- * @throws IOException if writing fails
- * @serialData this writes the location, then writes an int indicating the
- * number of certificates. Each certificate is a String type
- * followed by an int encoding length, then a byte[] encoding
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- s.defaultWriteObject();
- if (certs == null)
- s.writeInt(0);
- else
- {
- int count = certs.size();
- s.writeInt(count);
- Iterator iter = certs.iterator();
- while (--count >= 0)
- {
- Certificate c = (Certificate) iter.next();
- s.writeObject(c.getType());
- byte[] encoded;
- try
- {
- encoded = c.getEncoded();
- }
- catch (CertificateEncodingException e)
- {
- // XXX Should we ignore this certificate?
- encoded = null;
- }
- if (encoded == null)
- s.writeInt(0);
- else
- {
- s.writeInt(encoded.length);
- for (int i = 0; i < encoded.length; i++)
- s.writeByte(encoded[i]);
- }
- }
- }
- }
-} // class CodeSource
diff --git a/libjava/java/security/DigestException.java b/libjava/java/security/DigestException.java
deleted file mode 100644
index 6393e0cc834..00000000000
--- a/libjava/java/security/DigestException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* DigestException.java -- A generic message digest exception
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This exception indicates that a generic message digest exception has
- * occurred.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class DigestException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 5821450303093652515L;
-
- /**
- * Create a new instance with no descriptive message.
- */
- public DigestException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param msg the descriptive message
- */
- public DigestException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/DigestInputStream.java b/libjava/java/security/DigestInputStream.java
deleted file mode 100644
index 0d4a9d05dc6..00000000000
--- a/libjava/java/security/DigestInputStream.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/* DigestInputStream.java --- An Input stream tied to a message digest
- Copyright (C) 1999, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * DigestInputStream is a class that ties an InputStream with a
- * MessageDigest. The Message Digest is used by the class to
- * update it self as bytes are read from the InputStream.
- *
- * The updating to the digest depends on the on flag which is set
- * to true by default to tell the class to update the data
- * in the message digest.
- *
- * @version 0.0
- * @author Mark Benvenuto (ivymccough@worldnet.att.net)
- */
-public class DigestInputStream extends FilterInputStream
-{
- /**
- * The message digest for the DigestInputStream
- */
- protected MessageDigest digest;
-
- //Manages the on flag
- private boolean state = true;
-
- /**
- * Constructs a new DigestInputStream.
- * It associates a MessageDigest with the stream to
- * compute the stream as data is written.
- *
- * @param stream An InputStream to associate this stream with
- * @param digest A MessageDigest to hash the stream with
- */
- public DigestInputStream(InputStream stream, MessageDigest digest)
- {
- super(stream);
- //this.in = stream;
- this.digest = digest;
- }
-
- /**
- * Returns the MessageDigest associated with this DigestInputStream
- *
- * @return The MessageDigest used to hash this stream
- */
- public MessageDigest getMessageDigest()
- {
- return digest;
- }
-
- /**
- * Sets the current MessageDigest to current parameter
- *
- * @param digest A MessageDigest to associate with this stream
- */
- public void setMessageDigest(MessageDigest digest)
- {
- this.digest = digest;
- }
-
- /**
- * Reads a byte from the input stream and updates the digest.
- * This method reads the underlying input stream and if the
- * on flag is true then updates the message digest.
- *
- * @return Returns a byte from the input stream, -1 is returned to indicate that
- * the end of stream was reached before this read call
- *
- * @throws IOException if an IO error occurs in the underlying input stream,
- * this error is thrown
- */
- public int read() throws IOException
- {
- int temp = in.read();
-
- if (state == true && temp != -1)
- digest.update((byte) temp);
-
- return temp;
- }
-
- /**
- * Reads bytes from the input stream and updates the digest.
- * This method reads the underlying input stream and if the
- * on flag is true then updates the message digest.
- *
- * @param b a byte array to store the data from the input stream
- * @param off an offset to start at in the array
- * @param len length of data to read
- * @return Returns count of bytes read, -1 is returned to indicate that
- * the end of stream was reached before this read call
- *
- * @throws IOException if an IO error occurs in the underlying input stream,
- * this error is thrown
- */
- public int read(byte[]b, int off, int len) throws IOException
- {
- int temp = in.read(b, off, len);
-
- if (state == true && temp != -1)
- digest.update(b, off, temp);
-
- return temp;
- }
-
- /**
- * Sets the flag specifing if this DigestInputStream updates the
- * digest in the write() methods. The default is on;
- *
- * @param on True means it digests stream, false means it does not
- */
- public void on(boolean on)
- {
- state = on;
- }
-
- /**
- * Converts the input stream and underlying message digest to a string.
- *
- * @return A string representing the input stream and message digest.
- */
- public String toString()
- {
- return "[Digest Input Stream] " + digest.toString();
- }
-}
diff --git a/libjava/java/security/DigestOutputStream.java b/libjava/java/security/DigestOutputStream.java
deleted file mode 100644
index 037b39e789c..00000000000
--- a/libjava/java/security/DigestOutputStream.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* DigestOutputStream.java --- An output stream tied to a message digest
- Copyright (C) 1999, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * DigestOutputStream is a class that ties an OutputStream with a
- * MessageDigest. The Message Digest is used by the class to update it
- * self as bytes are written to the OutputStream.
- *
- * The updating to the digest depends on the on flag which is set to
- * true by default that tells the class to update the data in the
- * message digest.
- *
- * @version 0.0
- * @author Mark Benvenuto (ivymccough@worldnet.att.net)
- */
-public class DigestOutputStream extends FilterOutputStream
-{
- /**
- * The message digest for the DigestOutputStream
- */
- protected MessageDigest digest;
-
- //Manages the on flag
- private boolean state = true;
-
- /**
- * Constructs a new DigestOutputStream. It associates a
- * MessageDigest with the stream to compute the stream as data is
- * written.
- *
- * @param stream An OutputStream to associate this stream with
- * @param digest A MessageDigest to hash the stream with
- */
- public DigestOutputStream(OutputStream stream, MessageDigest digest)
- {
- super(stream);
- this.digest = digest;
- }
-
- /**
- * Returns the MessageDigest associated with this DigestOutputStream
- *
- * @return The MessageDigest used to hash this stream
- */
- public MessageDigest getMessageDigest()
- {
- return digest;
- }
-
- /**
- * Sets the current MessageDigest to current parameter
- *
- * @param digest A MessageDigest to associate with this stream
- */
- public void setMessageDigest(MessageDigest digest)
- {
- this.digest = digest;
- }
-
-
- /**
- * Updates the hash if the on flag is true and then writes a byte to
- * the underlying output stream.
- *
- * @param b A byte to write to the output stream
- *
- * @exception IOException if the underlying output stream
- * cannot write the byte, this is thrown.
- */
- public void write(int b) throws IOException
- {
- if (state)
- digest.update((byte) b);
-
- out.write(b);
- }
-
- /**
- * Updates the hash if the on flag is true and then writes the bytes
- * to the underlying output stream.
- *
- * @param b Bytes to write to the output stream
- * @param off Offset to start to start at in array
- * @param len Length of data to write
- *
- * @exception IOException if the underlying output stream
- * cannot write the bytes, this is thrown.
- */
- public void write(byte[]b, int off, int len) throws IOException
- {
- if (state)
- digest.update(b, off, len);
-
- out.write(b, off, len);
- }
-
- /**
- * Sets the flag specifying if this DigestOutputStream updates the
- * digest in the write() methods. The default is on;
- *
- * @param on True means it digests stream, false means it does not
- */
- public void on(boolean on)
- {
- state = on;
- }
-
- /**
- * Converts the output stream and underlying message digest to a string.
- *
- * @return A string representing the output stream and message digest.
- */
- public String toString()
- {
- return "[Digest Output Stream] " + digest.toString();
- }
-}
diff --git a/libjava/java/security/DomainCombiner.java b/libjava/java/security/DomainCombiner.java
deleted file mode 100644
index 9ec680c63af..00000000000
--- a/libjava/java/security/DomainCombiner.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* DomainCombiner.java -- Combines ProtectionDomains
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * A public interface used to combine two ProtectionDomains in a new
- * ProtectionDomain and update the current Protection Domains
- * associated with the current AccessControlContext.
- *
- * It can add, subtract, or update ProtectionDomains or possibly
- * remove duplicates or any possible complex action but just not add
- * ones that do not already exist in either array.
- *
- * @author Mark Benvenuto
- * @see AccessControlContext
- * @see AccessController
- * @since 1.3
- * @status updated to 1.4
- */
-public interface DomainCombiner
-{
- /**
- * Combines the current ProtectionDomains of the Thread with new
- * ProtectionDomains.
- *
- * @param currentDomains - the ProtectionDomains for the current thread.
- * @param assignedDomains - ProtectionsDomains to add
- * @return a new array of all the ProtectionDomains
- */
- ProtectionDomain[] combine(ProtectionDomain[] currentDomains,
- ProtectionDomain[] assignedDomains);
-} // interface DomainCombiner
diff --git a/libjava/java/security/DummyKeyPairGenerator.java b/libjava/java/security/DummyKeyPairGenerator.java
deleted file mode 100644
index da8c362eb71..00000000000
--- a/libjava/java/security/DummyKeyPairGenerator.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* DummyKeyPairGenerator.java - Wrapper for KeyPairGeneratorSpi
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.security.spec.AlgorithmParameterSpec;
-
-final class DummyKeyPairGenerator extends KeyPairGenerator
-{
- private KeyPairGeneratorSpi kpgSpi = null;
-
- public DummyKeyPairGenerator(KeyPairGeneratorSpi kpgSpi, String algorithm)
- {
- super(algorithm);
- this.kpgSpi = kpgSpi;
- }
-
- public Object clone() throws CloneNotSupportedException
- {
- KeyPairGenerator result = new DummyKeyPairGenerator
- ((KeyPairGeneratorSpi) kpgSpi.clone(), this.getAlgorithm());
- result.provider = this.getProvider();
- return result;
- }
-
- public void initialize(int keysize, SecureRandom random)
- {
- kpgSpi.initialize(keysize, random);
- }
-
- public void initialize(AlgorithmParameterSpec params, SecureRandom random)
- throws InvalidAlgorithmParameterException
- {
- kpgSpi.initialize(params, random);
- }
-
- public KeyPair generateKeyPair()
- {
- return kpgSpi.generateKeyPair();
- }
-}
diff --git a/libjava/java/security/DummyMessageDigest.java b/libjava/java/security/DummyMessageDigest.java
deleted file mode 100644
index 6cecdcf6801..00000000000
--- a/libjava/java/security/DummyMessageDigest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* DummyMessageDigest.java - Wrapper for MessageDigestSpi
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-final class DummyMessageDigest extends MessageDigest
-{
- private MessageDigestSpi mdSpi = null;
-
- public DummyMessageDigest(MessageDigestSpi mdSpi, String algorithm)
- {
- super(algorithm);
- this.mdSpi = mdSpi;
- }
-
- public Object clone() throws CloneNotSupportedException
- {
- MessageDigest result = new DummyMessageDigest
- ((MessageDigestSpi) mdSpi.clone(), this.getAlgorithm());
- result.provider = this.getProvider();
- return result;
- }
-
- // java.security.MessageDigestSpi abstract methods implementation ---------
-
- public byte[] engineDigest()
- {
- return mdSpi.engineDigest();
- }
-
- public int engineDigest(byte[] buf, int offset, int len)
- throws DigestException
- {
- return mdSpi.engineDigest(buf, offset, len);
- }
-
- public int engineGetDigestLength()
- {
- return mdSpi.engineGetDigestLength();
- }
-
- public void engineReset()
- {
- mdSpi.engineReset();
- }
-
- public void engineUpdate(byte input)
- {
- mdSpi.engineUpdate(input);
- }
-
- public void engineUpdate(byte[] input, int offset, int len)
- {
- mdSpi.engineUpdate(input, offset, len);
- }
-}
diff --git a/libjava/java/security/DummySignature.java b/libjava/java/security/DummySignature.java
deleted file mode 100644
index b74885c9973..00000000000
--- a/libjava/java/security/DummySignature.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* DummySignature.java - Signature wrapper for SignatureSpi.
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-final class DummySignature extends Signature
-{
- private SignatureSpi sigSpi = null;
-
- public DummySignature(SignatureSpi sigSpi, String algorithm)
- {
- super(algorithm);
- this.sigSpi = sigSpi;
- }
-
- public Object clone() throws CloneNotSupportedException
- {
- Signature result = new DummySignature
- ((SignatureSpi) sigSpi.clone(), this.getAlgorithm());
- result.provider = this.getProvider();
- return result;
- }
-
- protected void engineInitVerify(PublicKey publicKey)
- throws InvalidKeyException
- {
- sigSpi.engineInitVerify(publicKey);
- }
-
- protected void engineInitSign(PrivateKey privateKey)
- throws InvalidKeyException
- {
- sigSpi.engineInitSign(privateKey);
- }
-
- protected void engineUpdate(byte b) throws SignatureException
- {
- sigSpi.engineUpdate(b);
- }
-
- protected void engineUpdate(byte[]b, int off, int len)
- throws SignatureException
- {
- sigSpi.engineUpdate(b, off, len);
- }
-
- protected byte[] engineSign() throws SignatureException
- {
- return sigSpi.engineSign();
- }
-
- protected boolean engineVerify(byte[]sigBytes) throws SignatureException
- {
- return sigSpi.engineVerify(sigBytes);
- }
-
- protected void engineSetParameter(String param, Object value)
- throws InvalidParameterException
- {
- sigSpi.engineSetParameter(param, value);
- }
-
- protected Object engineGetParameter(String param)
- throws InvalidParameterException
- {
- return sigSpi.engineGetParameter(param);
- }
-}
diff --git a/libjava/java/security/GeneralSecurityException.java b/libjava/java/security/GeneralSecurityException.java
deleted file mode 100644
index 72453ee8cbf..00000000000
--- a/libjava/java/security/GeneralSecurityException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* GeneralSecurityException.java -- Common superclass of security exceptions
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This class is the common superclass of all security exceptions. All
- * exceptions in java.security extend this class with the exception (no
- * pun intended) of <code>AccessControlException</code> and
- * <code>CertificateException</code> (which extend
- * <code>SecurityException</code>), <code>ProviderException</code>
- * (<code>RuntimeException</code>), and <code>InvalidParamterException</code>
- * (<code>IllegalArgumentException</code>).
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class GeneralSecurityException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 894798122053539237L;
-
- /**
- * Create a new instance with no descriptive error message.
- */
- public GeneralSecurityException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param msg the descriptive error message
- */
- public GeneralSecurityException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/Guard.java b/libjava/java/security/Guard.java
deleted file mode 100644
index 4f22360a424..00000000000
--- a/libjava/java/security/Guard.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Guard.java -- Check access to a guarded object
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This interface specifies a mechanism for querying whether or not
- * access is allowed to a guarded object.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see GuardedObject
- * @since 1.1
- * @status updated to 1.4
- */
-public interface Guard
-{
- /**
- * This method tests whether or not access is allowed to the specified
- * guarded object. Access is allowed if this method returns silently. If
- * access is denied, an exception is generated.
- *
- * @param obj the <code>Object</code> to test
- * @throws SecurityException if access to the object is denied
- */
- void checkGuard(Object obj);
-} // interface Guard
diff --git a/libjava/java/security/GuardedObject.java b/libjava/java/security/GuardedObject.java
deleted file mode 100644
index 5ca08835dc5..00000000000
--- a/libjava/java/security/GuardedObject.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* GuardedObject.java -- An object protected by a Guard
- Copyright (C) 1998, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-/**
- * This class is an object that is guarded by a <code>Guard</code> object.
- * The object that is being guarded is retrieved by a call to the only
- * method in this class - <code>getObject</code>. That method returns the
- * guarded <code>Object</code> after first checking with the
- * <code>Guard</code>. If the <code>Guard</code> disallows access, an
- * exception will be thrown.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public class GuardedObject implements Serializable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -5240450096227834308L;
-
- /**
- * This is the Guard that is protecting the object.
- *
- * @serial the guard
- */
- private final Guard guard;
-
- /**
- * This is the object that is being guarded.
- *
- * @serial the protected object
- */
- private final Object object;
-
- /**
- * This method initializes a new instance of <code>GuardedObject</code>
- * that protects the specified <code>Object</code> using the specified
- * <code>Guard</code>. A null guard means there are no restrictions on
- * accessing the object.
- *
- * @param object the <code>Object</code> to guard
- * @param guard the <code>Guard</code> that is protecting the object
- */
- public GuardedObject(Object object, Guard guard)
- {
- this.object = object;
- this.guard = guard;
- }
-
- /**
- * This method first call the <code>checkGuard</code> method on the
- * <code>Guard</code> object protecting the guarded object. If the
- * <code>Guard</code> disallows access, an exception is thrown, otherwise
- * the <code>Object</code> is returned.
- *
- * @return The object being guarded
- * @throws SecurityException if access is denied
- */
- public Object getObject()
- {
- if (guard != null)
- guard.checkGuard(object);
- return object;
- }
-
- /**
- * Ensures that serialization is legal, by checking the guard.
- *
- * @param s the stream to write to
- * @throws IOException if the underlying stream fails
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- if (guard != null)
- guard.checkGuard(object);
- s.defaultWriteObject();
- }
-} // class GuardedObject
diff --git a/libjava/java/security/Identity.java b/libjava/java/security/Identity.java
deleted file mode 100644
index 26b01a50a6b..00000000000
--- a/libjava/java/security/Identity.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/* Identity.java --- Identity Class
- Copyright (C) 1999, 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.Serializable;
-import java.util.Vector;
-
-/**
- * <p>This class represents identities: real-world objects such as people,
- * companies or organizations whose identities can be authenticated using their
- * public keys. Identities may also be more abstract (or concrete) constructs,
- * such as daemon threads or smart cards.</p>
- *
- * <p>All Identity objects have a <i>name</i> and a <i>public key</i>. Names
- * are immutable. <i>Identities</i> may also be <b>scoped</b>. That is, if an
- * <i>Identity</i> is specified to have a particular <i>scope</i>, then the
- * <i>name</i> and <i>public key</i> of the <i>Identity</i> are unique within
- * that <i>scope</i>.</p>
- *
- * <p>An <i>Identity</i> also has a <i>set of certificates</i> (all certifying
- * its own <i>public key</i>). The <i>Principal</i> names specified in these
- * certificates need not be the same, only the key.</p>
- *
- * <p>An <i>Identity</i> can be subclassed, to include postal and email
- * addresses, telephone numbers, images of faces and logos, and so on.</p>
- *
- * @author Mark Benvenuto
- * @see IdentityScope
- * @see Signer
- * @see Principal
- * @deprecated This class is no longer used. Its functionality has been replaced
- * by <code>java.security.KeyStore</code>, the <code>java.security.cert</code>
- * package, and <code>java.security.Principal</code>.
- */
-public abstract class Identity implements Principal, Serializable
-{
- private static final long serialVersionUID = 3609922007826600659L;
-
- private String name;
- private IdentityScope scope;
- private PublicKey publicKey;
- private String info;
- private Vector certificates;
-
- /** Constructor for serialization only. */
- protected Identity()
- {
- }
-
- /**
- * Constructs an identity with the specified name and scope.
- *
- * @param name the identity name.
- * @param scope the scope of the identity.
- * @throws KeyManagementException if there is already an identity with the
- * same name in the scope.
- */
- public Identity(String name, IdentityScope scope)
- throws KeyManagementException
- {
- this.name = name;
- this.scope = scope;
- }
-
- /**
- * Constructs an identity with the specified name and no scope.
- *
- * @param name the identity name.
- */
- public Identity(String name)
- {
- this.name = name;
- this.scope = null;
- }
-
- /**
- * Returns this identity's name.
- *
- * @return the name of this identity.
- */
- public final String getName()
- {
- return name;
- }
-
- /**
- * Returns this identity's scope.
- *
- * @return the scope of this identity.
- */
- public final IdentityScope getScope()
- {
- return scope;
- }
-
- /**
- * Returns this identity's public key.
- *
- * @return the public key for this identity.
- * @see #setPublicKey(java.security.PublicKey)
- */
- public PublicKey getPublicKey()
- {
- return publicKey;
- }
-
- /**
- * <p>Sets this identity's public key. The old key and all of this identity's
- * certificates are removed by this operation.</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with <code>"setIdentityPublicKey"</code> as its
- * argument to see if it's ok to set the public key.</p>
- *
- * @param key the public key for this identity.
- * @throws KeyManagementException if another identity in the identity's scope
- * has the same public key, or if another exception occurs.
- * @throws SecurityException if a security manager exists and its
- * <code>checkSecurityAccess()</code> method doesn't allow setting the public
- * key.
- * @see #getPublicKey()
- * @see SecurityManager#checkSecurityAccess(String)
- */
- public void setPublicKey(PublicKey key) throws KeyManagementException
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("setIdentityPublicKey");
-
- this.publicKey = key;
- }
-
- /**
- * <p>Specifies a general information string for this identity.</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with <code>"setIdentityInfo"</code> as its
- * argument to see if it's ok to specify the information string.</p>
- *
- * @param info the information string.
- * @throws SecurityException if a security manager exists and its
- * <code>checkSecurityAccess()</code> method doesn't allow setting the
- * information string.
- * @see #getInfo()
- * @see SecurityManager#checkSecurityAccess(String)
- */
- public void setInfo(String info)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("setIdentityInfo");
-
- this.info = info;
- }
-
- /**
- * Returns general information previously specified for this identity.
- *
- * @return general information about this identity.
- * @see #setInfo(String)
- */
- public String getInfo()
- {
- return info;
- }
-
- /**
- * <p>Adds a certificate for this identity. If the identity has a public key,
- * the public key in the certificate must be the same, and if the identity
- * does not have a public key, the identity's public key is set to be that
- * specified in the certificate.</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with <code>"addIdentityCertificate"</code> as its
- * argument to see if it's ok to add a certificate.</p>
- *
- * @param certificate the certificate to be added.
- * @throws KeyManagementException if the certificate is not valid, if the
- * public key in the certificate being added conflicts with this identity's
- * public key, or if another exception occurs.
- * @throws SecurityException if a security manager exists and its
- * <code>checkSecurityAccess()</code> method doesn't allow adding a
- * certificate.
- * @see SecurityManager#checkSecurityAccess(String)
- */
- public void addCertificate(Certificate certificate)
- throws KeyManagementException
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("addIdentityCertificate");
-
- // Check public key of this certificate against the first one in the vector
- if (certificates.size() > 0)
- {
- if (((Certificate) certificates.firstElement()).getPublicKey() != publicKey)
- throw new KeyManagementException("Public key does not match");
- }
- certificates.addElement(certificate);
- }
-
- /**
- * <p>Removes a certificate from this identity.</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with <code>"removeIdentityCertificate"</code> as
- * its argument to see if it's ok to remove a certificate.</p>
- *
- * @param certificate the certificate to be removed.
- * @throws KeyManagementException if the certificate is missing, or if
- * another exception occurs.
- * @throws SecurityException if a security manager exists and its
- * <code>checkSecurityAccess()</code> method doesn't allow removing a
- * certificate.
- * @see SecurityManager#checkSecurityAccess(String)
- */
- public void removeCertificate(Certificate certificate)
- throws KeyManagementException
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("removeIdentityCertificate");
-
- if (certificates.contains(certificate) == false)
- throw new KeyManagementException("Certificate not found");
-
- certificates.removeElement(certificate);
- }
-
- /**
- * Returns a copy of all the certificates for this identity.
- *
- * @return a copy of all the certificates for this identity.
- */
- public Certificate[] certificates()
- {
- Certificate[] certs = new Certificate[certificates.size()];
- int max = certificates.size();
- for (int i = 0; i < max; i++)
- certs[i] = (Certificate) certificates.elementAt(i);
-
- return certs;
- }
-
- /**
- * Tests for equality between the specified object and this identity. This
- * first tests to see if the entities actually refer to the same object, in
- * which case it returns <code>true</code>. Next, it checks to see if the
- * entities have the same <i>name</i> and the same <i>scope</i>. If they do,
- * the method returns <code>true</code>. Otherwise, it calls
- * <code>identityEquals()</code>, which subclasses should override.
- *
- * @param identity the object to test for equality with this identity.
- * @return <code>true</code> if the objects are considered equal, <code>false
- * </code>otherwise.
- * @see #identityEquals(Identity)
- */
- public final boolean equals(Object identity)
- {
- if (identity instanceof Identity)
- {
- if (identity == this)
- return true;
-
- if ((((Identity) identity).getName() == this.name) &&
- (((Identity) identity).getScope() == this.scope))
- return true;
-
- return identityEquals((Identity) identity);
- }
- return false;
- }
-
- /**
- * Tests for equality between the specified <code>identity</code> and this
- * <i>identity</i>. This method should be overriden by subclasses to test for
- * equality. The default behavior is to return <code>true</code> if the names
- * and public keys are equal.
- *
- * @param identity the identity to test for equality with this identity.
- * @return <code>true</code> if the identities are considered equal,
- * <code>false</code> otherwise.
- * @see #equals(Object)
- */
- protected boolean identityEquals(Identity identity)
- {
- return ((identity.getName() == this.name) &&
- (identity.getPublicKey() == this.publicKey));
- }
-
- /**
- * <p>Returns a short string describing this identity, telling its name and
- * its scope (if any).</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with <code>"printIdentity"</code> as its argument
- * to see if it's ok to return the string.</p>
- *
- * @return information about this identity, such as its name and the name of
- * its scope (if any).
- * @throws SecurityException if a security manager exists and its
- * <code>checkSecurityAccess()</code> method doesn't allow returning a string
- * describing this identity.
- * @see SecurityManager#checkSecurityAccess(String)
- */
- public String toString()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("printIdentity");
-
- /* TODO: Insert proper format here */
- return (name + ":@" + scope + " Public Key: " + publicKey);
- }
-
- /**
- * <p>Returns a string representation of this identity, with optionally more
- * details than that provided by the <code>toString()</code> method without
- * any arguments.</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with <code>"printIdentity"</code> as its argument
- * to see if it's ok to return the string.</p>
- *
- * @param detailed whether or not to provide detailed information.
- * @return information about this identity. If detailed is <code>true</code>,
- * then this method returns more information than that provided by the
- * <code>toString()</code> method without any arguments.
- * @throws SecurityException if a security manager exists and its
- * <code>checkSecurityAccess()</code> method doesn't allow returning a string
- * describing this identity.
- * @see #toString()
- * @see SecurityManager#checkSecurityAccess(String)
- */
- public String toString(boolean detailed)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("printIdentity");
-
- if (detailed)
- {
- /* TODO: Insert proper detailed format here */
- return (name + ":@" + scope + " Public Key: " + publicKey);
- }
- else
- {
- /* TODO: Insert proper format here */
- return (name + ":@" + scope + " Public Key: " + publicKey);
- }
- }
-
- /**
- * Returns a hashcode for this identity.
- *
- * @return a hashcode for this identity.
- */
- public int hashCode()
- {
- int ret = name.hashCode();
- if (publicKey != null)
- ret |= publicKey.hashCode();
- if (scope != null)
- ret |= scope.hashCode();
- if (info != null)
- ret |= info.hashCode();
- if (certificates != null)
- ret |= certificates.hashCode();
-
- return ret;
- }
-}
diff --git a/libjava/java/security/IdentityScope.java b/libjava/java/security/IdentityScope.java
deleted file mode 100644
index 34dd011e280..00000000000
--- a/libjava/java/security/IdentityScope.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/* IdentityScope.java --- IdentityScope Class
- Copyright (C) 1999, 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.util.Enumeration;
-
-/**
- * <p>This class represents a scope for identities. It is an Identity itself,
- * and therefore has a name and can have a scope. It can also optionally have a
- * public key and associated certificates.</p>
- *
- * <p>An <code>IdentityScope</code> can contain {@link Identity} objects of all
- * kinds, including {@link Signer}s. All types of <code>Identity</code> objects
- * can be retrieved, added, and removed using the same methods. Note that it is
- * possible, and in fact expected, that different types of identity scopes will
- * apply different policies for their various operations on the various types of
- * Identities.</p>
- *
- * <p>There is a one-to-one mapping between keys and identities, and there can
- * only be one copy of one key per scope. For example, suppose Acme Software,
- * Inc is a software publisher known to a user. Suppose it is an <i>Identity</i>,
- * that is, it has a public key, and a set of associated certificates. It is
- * named in the scope using the name "Acme Software". No other named <i>Identity
- * </i> in the scope has the same public key. Of course, none has the same name
- * as well.</p>
- *
- * @author Mark Benvenuto
- * @see Identity
- * @see Signer
- * @see Principal
- * @see Key
- * @deprecated This class is no longer used. Its functionality has been replaced
- * by <code>java.security.KeyStore</code>, the <code>java.security.cert</code>
- * package, and <code>java.security.Principal</code>.
- */
-public abstract class IdentityScope extends Identity
-{
- private static final long serialVersionUID = -2337346281189773310L;
- private static IdentityScope systemScope;
-
- /**
- * This constructor is used for serialization only and should not be used by
- * subclasses.
- */
- protected IdentityScope()
- {
- super();
- }
-
- /**
- * Constructs a new identity scope with the specified name.
- *
- * @param name the scope name.
- */
- public IdentityScope(String name)
- {
- super(name);
- }
-
- /**
- * Constructs a new identity scope with the specified name and scope.
- *
- * @param name the scope name.
- * @param scope the scope for the new identity scope.
- * @throws KeyManagementException if there is already an identity with the
- * same name in the scope.
- */
- public IdentityScope(String name, IdentityScope scope)
- throws KeyManagementException
- {
- super(name, scope);
- }
-
- /**
- * Returns the system's identity scope.
- *
- * @return the system's identity scope.
- * @see #setSystemScope(IdentityScope)
- */
- public static IdentityScope getSystemScope()
- {
- if (systemScope == null)
- {
- //Load it
- //systemScope;
- }
- return systemScope;
- }
-
- /**
- * Sets the system's identity scope.
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with <code>"setSystemScope"</code> as its argument
- * to see if it's ok to set the identity scope.</p>
- *
- * @param scope the scope to set.
- * @throws SecurityException if a security manager exists and its
- * <code>checkSecurityAccess()</code> method doesn't allow setting the
- * identity scope.
- * @see #getSystemScope()
- * @see SecurityManager#checkSecurityAccess(String)
- */
- protected static void setSystemScope(IdentityScope scope)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("setSystemScope");
-
- systemScope = scope;
- }
-
- /**
- * Returns the number of identities within this identity scope.
- *
- * @return the number of identities within this identity scope.
- */
- public abstract int size();
-
- /**
- * Returns the identity in this scope with the specified name (if any).
- *
- * @param name the name of the identity to be retrieved.
- * @return the identity named name, or <code>null</code> if there are no
- * identities named name in this scope.
- */
- public abstract Identity getIdentity(String name);
-
- /**
- * Retrieves the identity whose name is the same as that of the specified
- * principal. (Note: <code>Identity</code> implements <code>Principal</code>.)
- *
- * @param principal the principal corresponding to the identity to be
- * retrieved.
- * @return the identity whose name is the same as that of the principal, or
- * <code>null</code> if there are no identities of the same name in this scope.
- */
- public Identity getIdentity(Principal principal)
- {
- return getIdentity(principal.getName());
- }
-
- /**
- * Retrieves the identity with the specified public key.
- *
- * @param key the public key for the identity to be returned.
- * @return the identity with the given key, or <code>null</code> if there are
- * no identities in this scope with that key.
- */
- public abstract Identity getIdentity(PublicKey key);
-
- /**
- * Adds an identity to this identity scope.
- *
- * @param identity the identity to be added.
- * @throws KeyManagementException if the identity is not valid, a name
- * conflict occurs, another identity has the same public key as the identity
- * being added, or another exception occurs.
- */
- public abstract void addIdentity(Identity identity)
- throws KeyManagementException;
-
- /**
- * Removes an identity from this identity scope.
- *
- * @param identity the identity to be removed.
- * @throws KeyManagementException if the identity is missing, or another
- * exception occurs.
- */
- public abstract void removeIdentity(Identity identity)
- throws KeyManagementException;
-
- /**
- * Returns an enumeration of all identities in this identity scope.
- *
- * @return an enumeration of all identities in this identity scope.
- */
- public abstract Enumeration identities();
-
- /**
- * Returns a string representation of this identity scope, including its name,
- * its scope name, and the number of identities in this identity scope.
- *
- * @return a string representation of this identity scope.
- * @see SecurityManager#checkSecurityAccess(String)
- */
- public String toString()
- {
- return (super.getName() + " " + super.getScope().getName() + " " + size());
- }
-}
diff --git a/libjava/java/security/InvalidAlgorithmParameterException.java b/libjava/java/security/InvalidAlgorithmParameterException.java
deleted file mode 100644
index 9b726199521..00000000000
--- a/libjava/java/security/InvalidAlgorithmParameterException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* InvalidAlgorithmParameterException.java -- an invalid parameter to a
- security algorithm
- Copyright (C) 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * Thrown for an invalid security algorithm parameter.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @since 1.2
- * @status updated to 1.4
- */
-public class InvalidAlgorithmParameterException
- extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 2864672297499471472L;
-
- /**
- * Construct an exception with no message.
- */
- public InvalidAlgorithmParameterException()
- {
- super();
- }
-
- /**
- * Construct an exception with a message.
- *
- * @param msg the message
- */
- public InvalidAlgorithmParameterException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/InvalidKeyException.java b/libjava/java/security/InvalidKeyException.java
deleted file mode 100644
index cd5845a6181..00000000000
--- a/libjava/java/security/InvalidKeyException.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* InvalidKeyException -- thrown for an invalid key
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * Thrown for an invalid key.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class InvalidKeyException extends KeyException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 5698479920593359816L;
-
- /**
- * Construct an exception with no message.
- */
- public InvalidKeyException()
- {
- }
-
- /**
- * Construct an exception with a message.
- *
- * @param msg the message
- */
- public InvalidKeyException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/InvalidParameterException.java b/libjava/java/security/InvalidParameterException.java
deleted file mode 100644
index c5218a04917..00000000000
--- a/libjava/java/security/InvalidParameterException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* InvalidParameterException.java -- an invalid parameter in the JCA/JCE engine
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * Thrown when an invalid parameter is passed to a method of the JCA/JCE
- * engine classes.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
- */
-public class InvalidParameterException extends IllegalArgumentException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -857968536935667808L;
-
- /**
- * Construct an exception with no message.
- */
- public InvalidParameterException()
- {
- }
-
- /**
- * Construct an exception with a message.
- *
- * @param msg the message
- */
- public InvalidParameterException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/Key.java b/libjava/java/security/Key.java
deleted file mode 100644
index 23652b6e7c4..00000000000
--- a/libjava/java/security/Key.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Key.java -- A abstract representation of a digital key
- Copyright (C) 1998, 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.Serializable;
-
-/**
- * This interfaces models the base characteristics that all keys must
- * have. These are: a key algorithm, an encoded form, and a format used
- * to encode the key. Specific key types inherit from this interface.
- * Note that since this interface extends <code>Serializable</code>, all
- * keys may be serialized. Keys are generally obtained through key generators,
- * including {@link KeyFactory}.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see PublicKey
- * @see PrivateKey
- * @see KeyPair
- * @see KeyPairGenerator
- * @see KeyFactory
- * @see KeySpec
- * @see Identity
- * @see Signer
- * @since 1.1
- * @status updated to 1.4
- */
-public interface Key extends Serializable
-{
- /**
- * The version identifier used for serialization.
- */
- long serialVersionUID = 6603384152749567654L;
-
- /**
- * This method returns the name of the algorithm for this key. This is a
- * <code>String</code> such as "RSA".
- *
- * @return the name of the algorithm in use
- */
- String getAlgorithm();
-
- /**
- * This method returns the name of the encoding format for this key. This
- * is the name of the ASN.1 data format used for this key, such as
- * "X.509" or "PKCS#8". This method returns <code>null</code> if this key
- * does not have an encoding format.
- *
- * @return the name of the encoding format for this key, or null
- */
- String getFormat();
-
- /**
- * This method returns the encoded form of the key. If this key does not
- * support encoding, this method returns <code>null</code>.
- *
- * @return the encoded form of the key, or null
- */
- byte[] getEncoded();
-} // interface Key
diff --git a/libjava/java/security/KeyException.java b/libjava/java/security/KeyException.java
deleted file mode 100644
index feaf0249a95..00000000000
--- a/libjava/java/security/KeyException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* KeyException.java -- Thrown when there is a problem with a key
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This exception is thrown when there is a problem with a key.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Key
- * @status updated to 1.4
- */
-public class KeyException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -7483676942812432108L;
-
- /**
- * This method initializes a new instance of <code>KeyException</code>
- * with no descriptive message.
- */
- public KeyException()
- {
- }
-
- /**
- * This method initializes a new instance of <code>KeyException</code>
- * with a descriptive message.
- *
- * @param msg the descriptive message
- */
- public KeyException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/KeyFactory.java b/libjava/java/security/KeyFactory.java
deleted file mode 100644
index 64ce841fae8..00000000000
--- a/libjava/java/security/KeyFactory.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/* KeyFactory.java --- Key Factory Class
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import gnu.java.security.Engine;
-
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-
-/**
- * <p>Key factories are used to convert keys (opaque cryptographic keys of type
- * {@link Key}) into key specifications (transparent representations of the
- * underlying key material), and vice versa.</p>
- *
- * <p>Key factories are bi-directional. That is, they allow you to build an
- * opaque key object from a given key specification (key material), or to
- * retrieve the underlying key material of a key object in a suitable format.</p>
- *
- * <p>Multiple compatible key specifications may exist for the same key. For
- * example, a <i>DSA</i> public key may be specified using {@link
- * java.security.spec.DSAPublicKeySpec} or {@link
- * java.security.spec.X509EncodedKeySpec}. A key factory can be used to
- * translate between compatible key specifications.</p>
- *
- * <p>The following is an example of how to use a key factory in order to
- * instantiate a <i>DSA</i> public key from its encoding. Assume Alice has
- * received a digital signature from Bob. Bob also sent her his public key (in
- * encoded format) to verify his signature. Alice then performs the following
- * actions:
- *
- * <pre>
- * X509EncodedKeySpec bobPubKeySpec = new X509EncodedKeySpec(bobEncodedPubKey);
- * KeyFactory keyFactory = KeyFactory.getInstance("DSA");
- * PublicKey bobPubKey = keyFactory.generatePublic(bobPubKeySpec);
- * Signature sig = Signature.getInstance("DSA");
- * sig.initVerify(bobPubKey);
- * sig.update(data);
- * sig.verify(signature);
- * </pre>
- *
- * @since 1.2
- * @see Key
- * @see PublicKey
- * @see PrivateKey
- * @see KeySpec
- * @see java.security.spec.DSAPublicKeySpec
- * @see java.security.spec.X509EncodedKeySpec
- @author Mark Benvenuto
- */
-public class KeyFactory
-{
- /** The service name for key factories. */
- private static final String KEY_FACTORY = "KeyFactory";
-
- private KeyFactorySpi keyFacSpi;
- private Provider provider;
- private String algorithm;
-
- /**
- * Creates a <code>KeyFactory</code> object.
- *
- * @param keyFacSpi the delegate.
- * @param provider the provider.
- * @param algorithm the name of the algorithm to associate with this
- * <code>KeyFactory</code>.
- */
- protected KeyFactory(KeyFactorySpi keyFacSpi, Provider provider,
- String algorithm)
- {
- this.keyFacSpi = keyFacSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- }
-
- /**
- * Generates a <code>KeyFactory</code> object that implements the specified
- * algorithm. If the default provider package provides an implementation of
- * the requested algorithm, an instance of <code>KeyFactory</code> containing
- * that implementation is returned. If the algorithm is not available in the
- * default package, other packages are searched.
- *
- * @param algorithm the name of the requested key algorithm. See Appendix A
- * in the Java Cryptography Architecture API Specification &amp; Reference
- * for information about standard algorithm names.
- * @return a <code>KeyFactory</code> object for the specified algorithm.
- * @throws NoSuchAlgorithmException if the requested algorithm is not
- * available in the default provider package or any of the other provider
- * packages that were searched.
- */
- public static KeyFactory getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] p = Security.getProviders();
- for (int i = 0; i < p.length; i++)
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignore.
- }
-
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Generates a <code>KeyFactory</code> object for the specified algorithm
- * from the specified provider.
- *
- * @param algorithm the name of the requested key algorithm. See Appendix A
- * in the Java Cryptography Architecture API Specification &amp; Reference
- * for information about standard algorithm names.
- * @param provider the name of the provider.
- * @return a <code>KeyFactory</code> object for the specified algorithm.
- * @throws NoSuchAlgorithmException if the algorithm is not available from
- * the specified provider.
- * @throws NoSuchProviderException if the provider has not been configured.
- * @throws IllegalArgumentException if the provider name is null or empty.
- * @see Provider
- */
- public static KeyFactory getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
-
- return getInstance(algorithm, p);
- }
-
- /**
- * Generates a <code>KeyFactory</code> object for the specified algorithm from
- * the specified provider. Note: the <code>provider</code> doesn't have to be
- * registered.
- *
- * @param algorithm the name of the requested key algorithm. See Appendix A
- * in the Java Cryptography Architecture API Specification &amp; Reference for
- * information about standard algorithm names.
- * @param provider the provider.
- * @return a <code>KeyFactory</code> object for the specified algorithm.
- * @throws NoSuchAlgorithmException if the algorithm is not available from
- * the specified provider.
- * @throws IllegalArgumentException if the <code>provider</code> is
- * <code>null</code>.
- * @since 1.4
- * @see Provider
- */
- public static KeyFactory getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
- try
- {
- return new KeyFactory((KeyFactorySpi)
- Engine.getInstance(KEY_FACTORY, algorithm, provider),
- provider, algorithm);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- /**
- * Returns the provider of this key factory object.
- *
- * @return the provider of this key factory object.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Gets the name of the algorithm associated with this <code>KeyFactory</code>.
- *
- * @return the name of the algorithm associated with this
- * <code>KeyFactory</code>.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Generates a public key object from the provided key specification (key
- * material).
- *
- * @param keySpec the specification (key material) of the public key.
- * @return the public key.
- * @throws InvalidKeySpecException if the given key specification is
- * inappropriate for this key factory to produce a public key.
- */
- public final PublicKey generatePublic(KeySpec keySpec)
- throws InvalidKeySpecException
- {
- return keyFacSpi.engineGeneratePublic(keySpec);
- }
-
- /**
- * Generates a private key object from the provided key specification (key
- * material).
- *
- * @param keySpec the specification (key material) of the private key.
- * @return the private key.
- * @throws InvalidKeySpecException if the given key specification is
- * inappropriate for this key factory to produce a private key.
- */
- public final PrivateKey generatePrivate(KeySpec keySpec)
- throws InvalidKeySpecException
- {
- return keyFacSpi.engineGeneratePrivate(keySpec);
- }
-
- /**
- * Returns a specification (key material) of the given key object.
- * <code>keySpec</code> identifies the specification class in which the key
- * material should be returned. It could, for example, be
- * <code>DSAPublicKeySpec.class</code>, to indicate that the key material
- * should be returned in an instance of the {@link
- * java.security.spec.DSAPublicKeySpec} class.
- *
- * @param key the key.
- * @param keySpec the specification class in which the key material should be
- * returned.
- * @return the underlying key specification (key material) in an instance of
- * the requested specification class.
- * @throws InvalidKeySpecException if the requested key specification is
- * inappropriate for the given key, or the given key cannot be processed
- * (e.g., the given key has an unrecognized algorithm or format).
- */
- public final KeySpec getKeySpec(Key key, Class keySpec)
- throws InvalidKeySpecException
- {
- return keyFacSpi.engineGetKeySpec(key, keySpec);
- }
-
- /**
- * Translates a key object, whose provider may be unknown or potentially
- * untrusted, into a corresponding key object of this key factory.
- *
- * @param key the key whose provider is unknown or untrusted.
- * @return the translated key.
- * @throws InvalidKeyException if the given key cannot be processed by this
- * key factory.
- */
- public final Key translateKey(Key key) throws InvalidKeyException
- {
- return keyFacSpi.engineTranslateKey(key);
- }
-}
diff --git a/libjava/java/security/KeyFactorySpi.java b/libjava/java/security/KeyFactorySpi.java
deleted file mode 100644
index 1894fad08df..00000000000
--- a/libjava/java/security/KeyFactorySpi.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* KeyFactorySpi.java --- Key Factory Service Provider Interface
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-
-/**
- * KeyFactorySpi is the Service Provider Interface (SPI) for the
- * KeyFactory class. This is the interface for providers to
- * supply to implement a key factory for an algorithm.
- *
- * Key factories are used to convert keys (opaque cryptographic
- * keys of type Key) into key specifications (transparent
- * representations of the underlying key material).
- *
- * Key factories are bi-directional. They allow a key class
- * to be converted into a key specification (key material) and
- * back again.
- *
- * For example DSA public keys can be specified as
- * DSAPublicKeySpec or X509EncodedKeySpec. The key factory
- * translate these key specifications.
- *
- * @since JDK 1.2
- * @author Mark Benvenuto
- */
-public abstract class KeyFactorySpi
-{
- /**
- * Constucts a new KeyFactorySpi.
- */
- public KeyFactorySpi()
- {
- }
-
- /**
- * Generates a public key from the provided key specification.
- *
- * @param keySpec key specification
- *
- * @return the public key
- *
- * @throws InvalidKeySpecException invalid key specification for
- * this key factory to produce a public key
- */
- protected abstract PublicKey engineGeneratePublic(KeySpec keySpec)
- throws InvalidKeySpecException;
-
-
- /**
- * Generates a private key from the provided key specification.
- *
- * @param keySpec key specification
- *
- * @return the private key
- *
- * @throws InvalidKeySpecException invalid key specification for
- * this key factory to produce a private key
- */
- protected abstract PrivateKey engineGeneratePrivate(KeySpec keySpec)
- throws InvalidKeySpecException;
-
- /**
- * Returns a key specification for the given key. keySpec
- * identifies the specification class to return the key
- * material in.
- *
- * @param key the key
- * @param keySpec the specification class to return the
- * key material in.
- *
- * @return the key specification in an instance of the requested
- * specification class
- *
- * @throws InvalidKeySpecException the requested key specification
- * is inappropriate for this key or the key is
- * unrecognized.
- */
- protected abstract KeySpec engineGetKeySpec(Key key, Class keySpec)
- throws InvalidKeySpecException;
-
-
- /**
- * Translates the key from an unknown or untrusted provider
- * into a key for this key factory.
- *
- * @param the key from an unknown or untrusted provider
- *
- * @return the translated key
- *
- * @throws InvalidKeySpecException if the key cannot be
- * processed by this key factory
- */
- protected abstract Key engineTranslateKey(Key key)
- throws InvalidKeyException;
-}
diff --git a/libjava/java/security/KeyManagementException.java b/libjava/java/security/KeyManagementException.java
deleted file mode 100644
index 694b4c242b6..00000000000
--- a/libjava/java/security/KeyManagementException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* KeyManagementException.java -- an exception in key management
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This exception is thrown whenever a problem related to the management of
- * security keys is encountered.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Key
- * @status updated to 1.4
- */
-public class KeyManagementException extends KeyException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 947674216157062695L;
-
- /**
- * Create a new instance with no descriptive error message.
- */
- public KeyManagementException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param msg the descriptive error message
- */
- public KeyManagementException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/KeyPair.java b/libjava/java/security/KeyPair.java
deleted file mode 100644
index bf1a40a23ab..00000000000
--- a/libjava/java/security/KeyPair.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* KeyPair.java --- Key Pair Class
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-import java.io.Serializable;
-
-/**
- KeyPair serves as a simple container for public and private keys.
- If properly initialized, this class should be treated like the
- private key since it contains it and take approriate security
- measures.
-
- @author Mark Benvenuto
- */
-public final class KeyPair implements Serializable
-{
- private static final long serialVersionUID = -7565189502268009837L;
-
- private PublicKey publicKey;
- private PrivateKey privateKey;
-
- /**
- Initializes the KeyPair with a pubilc and private key.
-
- @param publicKey Public Key to store
- @param privateKey Private Key to store
- */
- public KeyPair(PublicKey publicKey, PrivateKey privateKey)
- {
- this.publicKey = publicKey;
- this.privateKey = privateKey;
- }
-
- /**
- Returns the public key stored in the KeyPair
-
- @return The public key
- */
- public PublicKey getPublic()
- {
- return publicKey;
- }
-
- /**
- Returns the private key stored in the KeyPair
-
- @return The private key
- */
- public PrivateKey getPrivate()
- {
- return privateKey;
- }
-}
diff --git a/libjava/java/security/KeyPairGenerator.java b/libjava/java/security/KeyPairGenerator.java
deleted file mode 100644
index e6f926e2bf0..00000000000
--- a/libjava/java/security/KeyPairGenerator.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/* KeyPairGenerator.java --- Key Pair Generator Class
- Copyright (C) 1999, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import gnu.java.security.Engine;
-
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * <p>The <code>KeyPairGenerator</code> class is used to generate pairs of
- * public and private keys. Key pair generators are constructed using the
- * <code>getInstance()</code> factory methods (static methods that return
- * instances of a given class).</p>
- *
- * <p>A Key pair generator for a particular algorithm creates a public/private
- * key pair that can be used with this algorithm. It also associates
- * algorithm-specific parameters with each of the generated keys.</p>
- *
- * <p>There are two ways to generate a key pair: in an algorithm-independent
- * manner, and in an algorithm-specific manner. The only difference between the
- * two is the initialization of the object:</p>
- *
- * <ul>
- * <li><b>Algorithm-Independent Initialization</b><br/>
- * All key pair generators share the concepts of a <i>keysize</i> and a
- * <i>source of randomness</i>. The <i>keysize</i> is interpreted differently
- * for different algorithms (e.g., in the case of the <i>DSA</i> algorithm,
- * the <i>keysize</i> corresponds to the length of the modulus). There is an
- * <code>initialize()</code> method in this <code>KeyPairGenerator</code>
- * class that takes these two universally shared types of arguments. There
- * is also one that takes just a <i>keysize</i> argument, and uses the
- * {@link SecureRandom} implementation of the highest-priority installed
- * provider as the <i>source of randomness</i>. (If none of the installed
- * providers supply an implementation of {@link SecureRandom}, a
- * system-provided source of randomness is used.)
- *
- * <p>Since no other parameters are specified when you call the above
- * algorithm-independent initialize methods, it is up to the provider what
- * to do about the algorithm-specific parameters (if any) to be associated
- * with each of the keys.</p>
- *
- * <p>If the algorithm is the <i>DSA</i> algorithm, and the <i>keysize</i>
- * (modulus size) is <code>512</code>, <code>768</code>, or <code>1024</code>,
- * then the <b>GNU</b> provider uses a set of precomputed values for the
- * <code>p</code>, <code>q</code>, and <code>g</code> parameters. If the
- * <i>modulus size</i> is not one of the above values, the <b>GNU</b>
- * provider creates a new set of parameters. Other providers might have
- * precomputed parameter sets for more than just the three modulus sizes
- * mentioned above. Still others might not have a list of precomputed
- * parameters at all and instead always create new parameter sets.</p></li>
- * <li><b>Algorithm-Specific Initialization</b><br/>
- * For situations where a set of algorithm-specific parameters already
- * exists (e.g., so-called <i>community parameters</i> in <i>DSA</i>), there
- * are two initialize methods that have an {@link AlgorithmParameterSpec}
- * argument. One also has a {@link SecureRandom} argument, while the the
- * other uses the {@link SecureRandom} implementation of the highest-priority
- * installed provider as the source of randomness. (If none of the installed
- * providers supply an implementation of {@link SecureRandom}, a
- * system-provided source of randomness is used.)</li>
- * </ul>
- *
- * <p>In case the client does not explicitly initialize the
- * <code>KeyPairGenerator</code> (via a call to an initialize method), each
- * provider must supply (and document) a default initialization. For example,
- * the <b>GNU</b> provider uses a default modulus size (keysize) of
- * <code>1024</code> bits.</p>
- *
- * <p>Note that this class is abstract and extends from {@link
- * KeyPairGeneratorSpi} for historical reasons. Application developers should
- * only take notice of the methods defined in this <code>KeyPairGenerator</code>
- * class; all the methods in the superclass are intended for cryptographic
- * service providers who wish to supply their own implementations of key pair
- * generators.</p>
- *
- * @see Signature
- * @see KeyPair
- * @see AlgorithmParameterSpec
- * @author Mark Benvenuto
- * @author Casey Marshall
- */
-public abstract class KeyPairGenerator extends KeyPairGeneratorSpi
-{
- /** The service name for key pair generators. */
- private static final String KEY_PAIR_GENERATOR = "KeyPairGenerator";
-
- Provider provider;
- private String algorithm;
-
- /**
- * Creates a <code>KeyPairGenerator</code> object for the specified
- * algorithm.
- *
- * @param algorithm the standard string name of the algorithm.
- * See Appendix A in the Java Cryptography Architecture API
- * Specification &amp; Reference for information about standard
- * algorithm names.
- */
- protected KeyPairGenerator(String algorithm)
- {
- this.algorithm = algorithm;
- this.provider = null;
- }
-
- /**
- * Returns the standard name of the algorithm for this key pair generator.
- * See Appendix A in the Java Cryptography Architecture API Specification
- * &amp; Reference for information about standard algorithm names.
- *
- * @return the standard string name of the algorithm.
- */
- public String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Generates a <code>KeyPairGenerator</code> object that implements the
- * specified digest algorithm. If the default provider package provides an
- * implementation of the requested digest algorithm, an instance of
- * <code>KeyPairGenerator</code> containing that implementation is returned.
- * If the algorithm is not available in the default package, other packages
- * are searched.
- *
- * @param algorithm the standard string name of the algorithm. See Appendix A
- * in the Java Cryptography Architecture API Specification &amp; Reference for
- * information about standard algorithm names.
- * @return the new <code>KeyPairGenerator</code> object.
- * @throws NoSuchAlgorithmException if the algorithm is not available in the
- * environment.
- */
- public static KeyPairGenerator getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] p = Security.getProviders();
- for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignored.
- }
- }
-
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Generates a <code>KeyPairGenerator</code> object implementing the
- * specified algorithm, as supplied from the specified provider, if
- * such an algorithm is available from the provider.
- *
- * @param algorithm the standard string name of the algorithm. See
- * Appendix A in the Java Cryptography Architecture API Specification
- * &amp; Reference for information about standard algorithm names.
- * @param provider the string name of the provider.
- * @return the new <code>KeyPairGenerator</code> object.
- * @throws NoSuchAlgorithmException if the algorithm is not available
- * from the provider.
- * @throws NoSuchProviderException if the provider is not available in the
- * environment.
- * @throws IllegalArgumentException if the provider name is <code>null</code>
- * or empty.
- * @see Provider
- */
- public static KeyPairGenerator getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
-
- return getInstance(algorithm, p);
- }
-
- /**
- * Generates a <code>KeyPairGenerator</code> object implementing the specified
- * algorithm, as supplied from the specified provider, if such an algorithm is
- * available from the provider. Note: the provider doesn't have to be
- * registered.
- *
- * @param algorithm the standard string name of the algorithm. See Appendix A
- * in the Java Cryptography Architecture API Specification &amp; Reference for
- * information about standard algorithm names.
- * @param provider the provider.
- * @return the new <code>KeyPairGenerator</code> object.
- * @throws NoSuchAlgorithmException if the <code>algorithm</code> is not
- * available from the <code>provider</code>.
- * @throws IllegalArgumentException if the <code>provider</code> is
- * <code>null</code>.
- * @since 1.4
- * @see Provider
- */
- public static KeyPairGenerator getInstance(String algorithm,
- Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
- Object o = null;
- try
- {
- o = Engine.getInstance(KEY_PAIR_GENERATOR, algorithm, provider);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- KeyPairGenerator result = null;
- if (o instanceof KeyPairGeneratorSpi)
- {
- result = new DummyKeyPairGenerator((KeyPairGeneratorSpi) o, algorithm);
- }
- else if (o instanceof KeyPairGenerator)
- {
- result = (KeyPairGenerator) o;
- result.algorithm = algorithm;
- }
- result.provider = provider;
- return result;
- }
-
- /**
- * Returns the provider of this key pair generator object.
- *
- * @return the provider of this key pair generator object.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Initializes the key pair generator for a certain keysize using a default
- * parameter set and the {@link SecureRandom} implementation of the
- * highest-priority installed provider as the source of randomness. (If none
- * of the installed providers supply an implementation of {@link SecureRandom},
- * a system-provided source of randomness is used.)
- *
- * @param keysize the keysize. This is an algorithm-specific metric, such as
- * modulus length, specified in number of bits.
- * @throws InvalidParameterException if the keysize is not supported by this
- * <code>KeyPairGenerator</code> object.
- */
- public void initialize(int keysize)
- {
- initialize(keysize, new SecureRandom());
- }
-
- /**
- * Initializes the key pair generator for a certain keysize with the given
- * source of randomness (and a default parameter set).
- *
- * @param keysize the keysize. This is an algorithm-specific metric, such as
- * modulus length, specified in number of bits.
- * @param random the source of randomness.
- * @throws InvalidParameterException if the <code>keysize</code> is not
- * supported by this <code>KeyPairGenerator</code> object.
- * @since 1.2
- */
- public void initialize(int keysize, SecureRandom random)
- {
- initialize(keysize, random);
- }
-
- /**
- * <p>Initializes the key pair generator using the specified parameter set and
- * the {@link SecureRandom} implementation of the highest-priority installed
- * provider as the source of randomness. (If none of the installed providers
- * supply an implementation of {@link SecureRandom}, a system-provided source
- * of randomness is used.)</p>
- *
- * <p>This concrete method has been added to this previously-defined abstract
- * class. This method calls the
- * {@link KeyPairGeneratorSpi#initialize(AlgorithmParameterSpec, SecureRandom)}
- * initialize method, passing it <code>params</code> and a source of
- * randomness (obtained from the highest-priority installed provider or
- * system-provided if none of the installed providers supply one). That
- * initialize method always throws an {@link UnsupportedOperationException}
- * if it is not overridden by the provider.</p>
- *
- * @param params the parameter set used to generate the keys.
- * @throws InvalidAlgorithmParameterException if the given parameters are
- * inappropriate for this key pair generator.
- * @since 1.2
- */
- public void initialize(AlgorithmParameterSpec params)
- throws InvalidAlgorithmParameterException
- {
- initialize(params, new SecureRandom());
- }
-
- /**
- * <p>Initializes the key pair generator with the given parameter set and
- * source of randomness.</p>
- *
- * <p>This concrete method has been added to this previously-defined abstract
- * class. This method calls the
- * {@link KeyPairGeneratorSpi#initialize(AlgorithmParameterSpec, SecureRandom)}
- * initialize method, passing it <code>params</code> and <code>random</code>.
- * That initialize method always throws an {@link UnsupportedOperationException}
- * if it is not overridden by the provider.</p>
- *
- * @param params the parameter set used to generate the keys.
- * @param random the source of randomness.
- * @throws InvalidAlgorithmParameterException if the given parameters are
- * inappropriate for this key pair generator.
- * @since 1.2
- */
- public void initialize(AlgorithmParameterSpec params, SecureRandom random)
- throws InvalidAlgorithmParameterException
- {
- super.initialize(params, random);
- }
-
- /**
- * <p>Generates a key pair.</p>
- *
- * <p>If this <code>KeyPairGenerator</code> has not been initialized
- * explicitly, provider-specific defaults will be used for the size and other
- * (algorithm-specific) values of the generated keys.</p>
- *
- * <p>This will generate a new key pair every time it is called.</p>
- *
- * <p>This method is functionally equivalent to {@link #generateKeyPair()}.</p>
- *
- * @return the generated key pair.
- * @since 1.2
- */
- public final KeyPair genKeyPair()
- {
- try
- {
- return getInstance("DSA", "GNU").generateKeyPair();
- }
- catch (Exception e)
- {
- System.err.println("genKeyPair failed: " + e);
- e.printStackTrace();
- return null;
- }
- }
-
- /**
- * <p>Generates a key pair.</p>
- *
- * <p>If this <code>KeyPairGenerator</code> has not been initialized
- * explicitly, provider-specific defaults will be used for the size and other
- * (algorithm-specific) values of the generated keys.</p>
- *
- * <p>This will generate a new key pair every time it is called.</p>
- *
- * <p>This method is functionally equivalent to {@link #genKeyPair()}.</p>
- *
- * @return the generated key pair.
- */
- public KeyPair generateKeyPair()
- {
- return genKeyPair();
- }
-}
diff --git a/libjava/java/security/KeyPairGeneratorSpi.java b/libjava/java/security/KeyPairGeneratorSpi.java
deleted file mode 100644
index 689fbec128e..00000000000
--- a/libjava/java/security/KeyPairGeneratorSpi.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* KeyPairGeneratorSpi.java --- Key Pair Generator SPI Class
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- KeyPairGeneratorSpi is the interface used to generate key pairs
- for security algorithms.
-
- @author Mark Benvenuto
- */
-public abstract class KeyPairGeneratorSpi
-{
- /**
- Constructs a new KeyPairGeneratorSpi
- */
- public KeyPairGeneratorSpi()
- {
- }
-
- /**
- Initialize the KeyPairGeneratorSpi with the specified
- key size and source of randomness
-
- @param keysize size of the key to generate
- @param random A SecureRandom source of randomness
- */
- public abstract void initialize(int keysize, SecureRandom random);
-
- /**
- Initialize the KeyPairGeneratorSpi with the specified
- AlgorithmParameterSpec and source of randomness
-
- This is a concrete method. It may be overridden by the provider
- and if the AlgorithmParameterSpec class is invalid
- throw InvalidAlgorithmParameterException. By default this
- method just throws UnsupportedOperationException.
-
- @param params A AlgorithmParameterSpec to intialize with
- @param random A SecureRandom source of randomness
-
- @throws InvalidAlgorithmParameterException
- */
- public void initialize(AlgorithmParameterSpec params, SecureRandom random)
- throws InvalidAlgorithmParameterException
- {
- throw new java.lang.UnsupportedOperationException();
- }
-
- /**
- Generates a KeyPair according the rules for the algorithm.
- Unless intialized, algorithm defaults will be used. It
- creates a unique key pair each time.
-
- @return a key pair
- */
- public abstract KeyPair generateKeyPair();
-
- /**
- * We override clone here to make it accessible for use by
- * DummyKeyPairGenerator.
- */
- protected Object clone() throws CloneNotSupportedException
- {
- return super.clone();
- }
-}
diff --git a/libjava/java/security/KeyStore.java b/libjava/java/security/KeyStore.java
deleted file mode 100644
index 696448728ff..00000000000
--- a/libjava/java/security/KeyStore.java
+++ /dev/null
@@ -1,507 +0,0 @@
-/* KeyStore.java --- Key Store Class
- Copyright (C) 1999, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import gnu.java.security.Engine;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.security.cert.CertificateException;
-import java.util.Date;
-import java.util.Enumeration;
-
-/**
- * Keystore represents an in-memory collection of keys and
- * certificates. There are two types of entries:
- *
- * <dl>
- * <dt>Key Entry</dt>
- *
- * <dd><p>This type of keystore entry store sensitive crytographic key
- * information in a protected format.Typically this is a secret
- * key or a private key with a certificate chain.</p></dd>
- *
- * <dt>Trusted Ceritificate Entry</dt>
- *
- * <dd><p>This type of keystore entry contains a single public key
- * certificate belonging to annother entity. It is called trusted
- * because the keystore owner trusts that the certificates
- * belongs to the subject (owner) of the certificate.</p></dd>
- * </dl>
- *
- * <p>Entries in a key store are referred to by their "alias": a simple
- * unique string.
- *
- * <p>The structure and persistentence of the key store is not
- * specified. Any method could be used to protect sensitive
- * (private or secret) keys. Smart cards or integrated
- * cryptographic engines could be used or the keystore could
- * be simply stored in a file.</p>
- *
- * @see java.security.cert.Certificate
- * @see Key
- */
-public class KeyStore
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** Service name for key stores. */
- private static final String KEY_STORE = "KeyStore";
-
- private KeyStoreSpi keyStoreSpi;
- private Provider provider;
- private String type;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- Creates an instance of KeyStore
-
- @param keyStoreSpi A KeyStore engine to use
- @param provider A provider to use
- @param type The type of KeyStore
- */
- protected KeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type)
- {
- this.keyStoreSpi = keyStoreSpi;
- this.provider = provider;
- this.type = type;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Gets an instance of the KeyStore class representing
- * the specified keystore. If the type is not
- * found then, it throws KeyStoreException.
- *
- * @param type the type of keystore to choose
- * @return a KeyStore repesenting the desired type
- * @throws KeyStoreException if the type of keystore is not implemented
- * by providers or the implementation cannot be instantiated.
- */
- public static KeyStore getInstance(String type) throws KeyStoreException
- {
- Provider[] p = Security.getProviders();
-
- for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(type, p[i]);
- }
- catch (KeyStoreException e)
- {
- // Ignore.
- }
- }
-
- throw new KeyStoreException(type);
- }
-
- /**
- * Gets an instance of the KeyStore class representing
- * the specified key store from the specified provider.
- * If the type is not found then, it throws KeyStoreException.
- * If the provider is not found, then it throws
- * NoSuchProviderException.
- *
- * @param type the type of keystore to choose
- * @param provider the provider name
- * @return a KeyStore repesenting the desired type
- * @throws KeyStoreException if the type of keystore is not
- * implemented by the given provider
- * @throws NoSuchProviderException if the provider is not found
- * @throws IllegalArgumentException if the provider string is
- * null or empty
- */
- public static KeyStore getInstance(String type, String provider)
- throws KeyStoreException, NoSuchProviderException
- {
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
-
- return getInstance(type, p);
- }
-
- /**
- * Gets an instance of the KeyStore class representing
- * the specified key store from the specified provider.
- * If the type is not found then, it throws KeyStoreException.
- * If the provider is not found, then it throws
- * NoSuchProviderException.
- *
- * @param type the type of keystore to choose
- * @param provider the keystore provider
- * @return a KeyStore repesenting the desired type
- * @throws KeyStoreException if the type of keystore is not
- * implemented by the given provider
- * @throws IllegalArgumentException if the provider object is null
- * @since 1.4
- */
- public static KeyStore getInstance(String type, Provider provider)
- throws KeyStoreException
- {
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
- try
- {
- return new KeyStore(
- (KeyStoreSpi) Engine.getInstance(KEY_STORE, type, provider),
- provider, type);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- throw new KeyStoreException(type);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new KeyStoreException(type);
- }
- catch (ClassCastException cce)
- {
- throw new KeyStoreException(type);
- }
- }
-
- /**
- * Returns the default KeyStore type. This method looks up the
- * type in &lt;JAVA_HOME&gt;/lib/security/java.security with the
- * property "keystore.type" or if that fails then "jks" .
- */
- public static final String getDefaultType()
- {
- // Security reads every property in java.security so it
- // will return this property if it exists.
- String tmp = Security.getProperty("keystore.type");
-
- if (tmp == null)
- tmp = "jks";
-
- return tmp;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- Gets the provider that the class is from.
-
- @return the provider of this class
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- Returns the type of the KeyStore supported
-
- @return A string with the type of KeyStore
- */
- public final String getType()
- {
- return type;
- }
-
- /**
- Returns the key associated with given alias using the
- supplied password.
-
- @param alias an alias for the key to get
- @param password password to access key with
-
- @return the requested key, or null otherwise
-
- @throws NoSuchAlgorithmException if there is no algorithm
- for recovering the key
- @throws UnrecoverableKeyException key cannot be reocovered
- (wrong password).
- */
- public final Key getKey(String alias, char[]password)
- throws KeyStoreException, NoSuchAlgorithmException,
- UnrecoverableKeyException
- {
- return keyStoreSpi.engineGetKey(alias, password);
- }
-
- /**
- Gets a Certificate chain for the specified alias.
-
- @param alias the alias name
-
- @return a chain of Certificates ( ordered from the user's
- certificate to the Certificate Authority's ) or
- null if the alias does not exist or there is no
- certificate chain for the alias ( the alias refers
- to a trusted certificate entry or there is no entry).
- */
- public final java.security.cert.
- Certificate[] getCertificateChain(String alias) throws KeyStoreException
- {
- return keyStoreSpi.engineGetCertificateChain(alias);
- }
-
- /**
- Gets a Certificate for the specified alias.
-
- If there is a trusted certificate entry then that is returned.
- it there is a key entry with a certificate chain then the
- first certificate is return or else null.
-
- @param alias the alias name
-
- @return a Certificate or null if the alias does not exist
- or there is no certificate for the alias
- */
- public final java.security.cert.Certificate getCertificate(String alias)
- throws KeyStoreException
- {
- return keyStoreSpi.engineGetCertificate(alias);
- }
-
- /**
- Gets entry creation date for the specified alias.
-
- @param alias the alias name
-
- @returns the entry creation date or null
- */
- public final Date getCreationDate(String alias) throws KeyStoreException
- {
- return keyStoreSpi.engineGetCreationDate(alias);
- }
-
- /**
- Assign the key to the alias in the keystore, protecting it
- with the given password. It will overwrite an existing
- entry and if the key is a PrivateKey, also add the
- certificate chain representing the corresponding public key.
-
- @param alias the alias name
- @param key the key to add
- @password the password to protect with
- @param chain the certificate chain for the corresponding
- public key
-
- @throws KeyStoreException if it fails
- */
- public final void setKeyEntry(String alias, Key key, char[]password,
- java.security.cert.
- Certificate[]chain) throws KeyStoreException
- {
- keyStoreSpi.engineSetKeyEntry(alias, key, password, chain);
- }
-
- /**
- Assign the key to the alias in the keystore. It will overwrite
- an existing entry and if the key is a PrivateKey, also
- add the certificate chain representing the corresponding
- public key.
-
- @param alias the alias name
- @param key the key to add
- @param chain the certificate chain for the corresponding
- public key
-
- @throws KeyStoreException if it fails
- */
- public final void setKeyEntry(String alias, byte[]key,
- java.security.cert.
- Certificate[]chain) throws KeyStoreException
- {
- keyStoreSpi.engineSetKeyEntry(alias, key, chain);
- }
-
- /**
- Assign the certificate to the alias in the keystore. It
- will overwrite an existing entry.
-
- @param alias the alias name
- @param cert the certificate to add
-
- @throws KeyStoreException if it fails
- */
- public final void setCertificateEntry(String alias,
- java.security.cert.
- Certificate cert) throws
- KeyStoreException
- {
- keyStoreSpi.engineSetCertificateEntry(alias, cert);
- }
-
- /**
- Deletes the entry for the specified entry.
-
- @param alias the alias name
-
- @throws KeyStoreException if it fails
- */
- public final void deleteEntry(String alias) throws KeyStoreException
- {
- keyStoreSpi.engineDeleteEntry(alias);
- }
-
- /**
- Generates a list of all the aliases in the keystore.
-
- @return an Enumeration of the aliases
- */
- public final Enumeration aliases() throws KeyStoreException
- {
- return keyStoreSpi.engineAliases();
- }
-
- /**
- Determines if the keystore contains the specified alias.
-
- @param alias the alias name
-
- @return true if it contains the alias, false otherwise
- */
- public final boolean containsAlias(String alias) throws KeyStoreException
- {
- return keyStoreSpi.engineContainsAlias(alias);
- }
-
- /**
- Returns the number of entries in the keystore.
-
- @returns the number of keystore entries.
- */
- public final int size() throws KeyStoreException
- {
- return keyStoreSpi.engineSize();
- }
-
- /**
- Determines if the keystore contains a key entry for
- the specified alias.
-
- @param alias the alias name
-
- @return true if it is a key entry, false otherwise
- */
- public final boolean isKeyEntry(String alias) throws KeyStoreException
- {
- return keyStoreSpi.engineIsKeyEntry(alias);
- }
-
-
- /**
- Determines if the keystore contains a certificate entry for
- the specified alias.
-
- @param alias the alias name
-
- @return true if it is a certificate entry, false otherwise
- */
- public final boolean isCertificateEntry(String alias)
- throws KeyStoreException
- {
- return keyStoreSpi.engineIsCertificateEntry(alias);
- }
-
- /**
- Determines if the keystore contains the specified certificate
- entry and returns the alias.
-
- It checks every entry and for a key entry checks only the
- first certificate in the chain.
-
- @param cert Certificate to look for
-
- @return alias of first matching certificate, null if it
- does not exist.
- */
- public final String getCertificateAlias(java.security.cert.Certificate cert)
- throws KeyStoreException
- {
- return keyStoreSpi.engineGetCertificateAlias(cert);
- }
-
- /**
- Stores the keystore in the specified output stream and it
- uses the specified key it keep it secure.
-
- @param stream the output stream to save the keystore to
- @param password the password to protect the keystore integrity with
-
- @throws IOException if an I/O error occurs.
- @throws NoSuchAlgorithmException the data integrity algorithm
- used cannot be found.
- @throws CertificateException if any certificates could not be
- stored in the output stream.
- */
- public final void store(OutputStream stream, char[]password)
- throws KeyStoreException, IOException, NoSuchAlgorithmException,
- CertificateException
- {
- keyStoreSpi.engineStore(stream, password);
- }
-
- /**
- Loads the keystore from the specified input stream and it
- uses the specified password to check for integrity if supplied.
-
- @param stream the input stream to load the keystore from
- @param password the password to check the keystore integrity with
-
- @throws IOException if an I/O error occurs.
- @throws NoSuchAlgorithmException the data integrity algorithm
- used cannot be found.
- @throws CertificateException if any certificates could not be
- stored in the output stream.
- */
- public final void load(InputStream stream, char[]password)
- throws IOException, NoSuchAlgorithmException, CertificateException
- {
- keyStoreSpi.engineLoad(stream, password);
- }
-
-}
diff --git a/libjava/java/security/KeyStoreException.java b/libjava/java/security/KeyStoreException.java
deleted file mode 100644
index 9a0a5354d2c..00000000000
--- a/libjava/java/security/KeyStoreException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* KeyStoreException.java -- Indicates a problem with the key store
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * Indicates a problem with the key store.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.2
- * @status updated to 1.4
- */
-public class KeyStoreException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -1119353179322377262L;
-
- /**
- * Create a new instance detailed error message.
- */
- public KeyStoreException()
- {
- }
-
- /**
- * Create a new instance with a detailed error message.
- *
- * @param msg the descriptive error message
- */
- public KeyStoreException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/KeyStoreSpi.java b/libjava/java/security/KeyStoreSpi.java
deleted file mode 100644
index a16008f9960..00000000000
--- a/libjava/java/security/KeyStoreSpi.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/* KeyStoreSpi.java --- Key Store Service Provider Interface
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.security.cert.CertificateException;
-import java.util.Date;
-import java.util.Enumeration;
-
-/**
- * KeyStoreSpi is the Service Provider Interface (SPI) for the
- * KeyStore class. This is the interface for providers to
- * supply to implement a keystore for a particular keystore
- * type.
- *
- * @since 1.2
- * @author Mark Benvenuto
- */
-public abstract class KeyStoreSpi
-{
- /**
- * Constructs a new KeyStoreSpi
- */
- public KeyStoreSpi()
- {
- }
-
- /**
- * Returns the key associated with given alias using the
- * supplied password.
- *
- * @param alias an alias for the key to get
- * @param password password to access key with
- *
- * @return the requested key, or null otherwise
- *
- * @throws NoSuchAlgorithmException if there is no algorithm
- * for recovering the key
- * @throws UnrecoverableKeyException key cannot be reocovered
- * (wrong password).
- */
- public abstract Key engineGetKey(String alias, char[]password)
- throws NoSuchAlgorithmException, UnrecoverableKeyException;
-
- /**
- * Gets a Certificate chain for the specified alias.
- *
- * @param alias the alias name
- *
- * @return a chain of Certificates ( ordered from the user's
- * certificate to the Certificate Authority's ) or
- * null if the alias does not exist or there is no
- * certificate chain for the alias ( the alias refers
- * to a trusted certificate entry or there is no entry).
- */
- public abstract java.security.cert.
- Certificate[] engineGetCertificateChain(String alias);
-
-
- /**
- * Gets a Certificate for the specified alias.
- *
- * If there is a trusted certificate entry then that is returned.
- * it there is a key entry with a certificate chain then the
- * first certificate is return or else null.
- *
- * @param alias the alias name
- *
- * @return a Certificate or null if the alias does not exist
- * or there is no certificate for the alias
- */
- public abstract java.security.cert.
- Certificate engineGetCertificate(String alias);
-
- /**
- * Gets entry creation date for the specified alias.
- *
- * @param alias the alias name
- *
- * @returns the entry creation date or null
- */
- public abstract Date engineGetCreationDate(String alias);
-
- /**
- * Assign the key to the alias in the keystore, protecting it
- * with the given password. It will overwrite an existing
- * entry and if the key is a PrivateKey, also add the
- * certificate chain representing the corresponding public key.
- *
- * @param alias the alias name
- * @param key the key to add
- * @password the password to protect with
- * @param chain the certificate chain for the corresponding
- * public key
- *
- * @throws KeyStoreException if it fails
- */
- public abstract void engineSetKeyEntry(String alias, Key key,
- char[]password,
- java.security.cert.
- Certificate[]chain) throws
- KeyStoreException;
-
- /**
- * Assign the key to the alias in the keystore. It will overwrite
- * an existing entry and if the key is a PrivateKey, also
- * add the certificate chain representing the corresponding
- * public key.
- *
- * @param alias the alias name
- * @param key the key to add
- * @param chain the certificate chain for the corresponding
- * public key
- *
- * @throws KeyStoreException if it fails
- */
- public abstract void engineSetKeyEntry(String alias, byte[]key,
- java.security.cert.
- Certificate[]chain) throws
- KeyStoreException;
-
-
- /**
- * Assign the certificate to the alias in the keystore. It
- * will overwrite an existing entry.
- *
- * @param alias the alias name
- * @param cert the certificate to add
- *
- * @throws KeyStoreException if it fails
- */
- public abstract void engineSetCertificateEntry(String alias,
- java.security.cert.
- Certificate cert) throws
- KeyStoreException;
-
- /**
- * Deletes the entry for the specified entry.
- *
- * @param alias the alias name
- *
- * @throws KeyStoreException if it fails
- */
- public abstract void engineDeleteEntry(String alias)
- throws KeyStoreException;
-
- /**
- * Generates a list of all the aliases in the keystore.
- *
- * @return an Enumeration of the aliases
- */
- public abstract Enumeration engineAliases();
-
- /**
- * Determines if the keystore contains the specified alias.
- *
- * @param alias the alias name
- *
- * @return true if it contains the alias, false otherwise
- */
- public abstract boolean engineContainsAlias(String alias);
-
- /**
- * Returns the number of entries in the keystore.
- *
- * @returns the number of keystore entries.
- */
- public abstract int engineSize();
-
- /**
- * Determines if the keystore contains a key entry for
- * the specified alias.
- *
- * @param alias the alias name
- *
- * @return true if it is a key entry, false otherwise
- */
- public abstract boolean engineIsKeyEntry(String alias);
-
- /**
- * Determines if the keystore contains a certificate entry for
- * the specified alias.
- *
- * @param alias the alias name
- *
- * @return true if it is a certificate entry, false otherwise
- */
- public abstract boolean engineIsCertificateEntry(String alias);
-
- /**
- * Determines if the keystore contains the specified certificate
- * entry and returns the alias.
- *
- * It checks every entry and for a key entry checks only the
- * first certificate in the chain.
- *
- * @param cert Certificate to look for
- *
- * @return alias of first matching certificate, null if it
- * does not exist.
- */
- public abstract String engineGetCertificateAlias(java.security.cert.
- Certificate cert);
-
- /**
- * Stores the keystore in the specified output stream and it
- * uses the specified key it keep it secure.
- *
- * @param stream the output stream to save the keystore to
- * @param password the password to protect the keystore integrity with
- *
- * @throws IOException if an I/O error occurs.
- * @throws NoSuchAlgorithmException the data integrity algorithm
- * used cannot be found.
- * @throws CertificateException if any certificates could not be
- * stored in the output stream.
- */
- public abstract void engineStore(OutputStream stream, char[]password)
- throws IOException, NoSuchAlgorithmException, CertificateException;
-
-
- /**
- * Loads the keystore from the specified input stream and it
- * uses the specified password to check for integrity if supplied.
- *
- * @param stream the input stream to load the keystore from
- * @param password the password to check the keystore integrity with
- *
- * @throws IOException if an I/O error occurs.
- * @throws NoSuchAlgorithmException the data integrity algorithm
- * used cannot be found.
- * @throws CertificateException if any certificates could not be
- * stored in the output stream.
- */
- public abstract void engineLoad(InputStream stream, char[]password)
- throws IOException, NoSuchAlgorithmException, CertificateException;
-}
diff --git a/libjava/java/security/MessageDigest.java b/libjava/java/security/MessageDigest.java
deleted file mode 100644
index 8684f2083b1..00000000000
--- a/libjava/java/security/MessageDigest.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/* MessageDigest.java --- The message digest interface.
- Copyright (C) 1999, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import gnu.java.security.Engine;
-
-/**
- * <p>This <code>MessageDigest</code> class provides applications the
- * functionality of a message digest algorithm, such as <i>MD5</i> or <i>SHA</i>.
- * Message digests are secure one-way hash functions that take arbitrary-sized
- * data and output a fixed-length hash value.</p>
- *
- * <p>A <code>MessageDigest</code> object starts out initialized. The data is
- * processed through it using the <code>update()</code> methods. At any point
- * <code>reset()</code> can be called to reset the digest. Once all the data to
- * be updated has been updated, one of the <code>digest()</code> methods should
- * be called to complete the hash computation.</p>
- *
- * <p>The <code>digest()</code> method can be called <b>once</b> for a given
- * number of updates. After <code>digest()</code> has been called, the
- * <code>MessageDigest</code> object is <b>reset</b> to its initialized state.
- * </p>
- *
- * <p>Implementations are free to implement the {@link Cloneable} interface.
- * Client applications can test cloneability by attempting cloning and catching
- * the {@link CloneNotSupportedException}:
- *
- * <pre>
- * MessageDigest md = MessageDigest.getInstance("SHA");
- * try
- * {
- * md.update(toChapter1);
- * MessageDigest tc1 = md.clone();
- * byte[] toChapter1Digest = tc1.digest();
- * md.update(toChapter2);
- * // ...
- * }
- * catch (CloneNotSupportedException x)
- * {
- * throw new DigestException("couldn't make digest of partial content");
- * }
- * </pre>
- *
- * <p>Note that if a given implementation is not cloneable, it is still possible
- * to compute intermediate digests by instantiating several instances, if the
- * number of digests is known in advance.</p>
- *
- * <p>Note that this class is abstract and extends from {@link MessageDigestSpi}
- * for historical reasons. Application developers should only take notice of the
- * methods defined in this <code>MessageDigest</code> class; all the methods in
- * the superclass are intended for cryptographic service providers who wish to
- * supply their own implementations of message digest algorithms.</p>
- *
- * @see MessageDigestSpi
- * @see Provider
- * @since JDK 1.1
- */
-public abstract class MessageDigest extends MessageDigestSpi
-{
- /** The service name for message digests. */
- private static final String MESSAGE_DIGEST = "MessageDigest";
-
- private String algorithm;
- Provider provider;
- private byte[] lastDigest;
-
- /**
- * Creates a message digest with the specified algorithm name.
- *
- * @param algorithm the standard name of the digest algorithm.
- * See Appendix A in the Java Cryptography Architecture API
- * Specification &amp; Reference for information about standard
- * algorithm names.
- */
- protected MessageDigest(String algorithm)
- {
- this.algorithm = algorithm;
- provider = null;
- }
-
- /**
- * Generates a <code>MessageDigest</code> object that implements the specified
- * digest algorithm. If the default provider package provides an
- * implementation of the requested digest algorithm, an instance of
- * <code>MessageDigest</code> containing that implementation is returned. If
- * the algorithm is not available in the default package, other packages are
- * searched.
- *
- * @param algorithm the name of the algorithm requested. See Appendix A in the
- * Java Cryptography Architecture API Specification &amp; Reference for
- * information about standard algorithm names.
- * @return a Message Digest object implementing the specified algorithm.
- * @throws NoSuchAlgorithmException if the algorithm is not available in the
- * caller's environment.
- */
- public static MessageDigest getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] p = Security.getProviders();
- for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException ignored)
- {
- // Ignore.
- }
- }
-
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Generates a <code>MessageDigest</code> object implementing the specified
- * algorithm, as supplied from the specified provider, if such an algorithm is
- * available from the provider.
- *
- * @param algorithm the name of the algorithm requested. See Appendix A in the
- * Java Cryptography Architecture API Specification &amp; Reference for
- * information about standard algorithm names.
- * @param provider the name of the provider.
- * @return a Message Digest object implementing the specified algorithm.
- * @throws NoSuchAlgorithmException if the algorithm is not available in the
- * package supplied by the requested provider.
- * @throws NoSuchProviderException if the provider is not available in the
- * environment.
- * @throws IllegalArgumentException if the provider name is null or empty.
- * @see Provider
- */
- public static MessageDigest getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
-
- return getInstance(algorithm, p);
- }
-
- /**
- * Generates a <code>MessageDigest</code> object implementing the specified
- * algorithm, as supplied from the specified provider, if such an algorithm
- * is available from the provider. Note: the provider doesn't have to be
- * registered.
- *
- * @param algorithm the name of the algorithm requested. See Appendix A in
- * the Java Cryptography Architecture API Specification &amp; Reference for
- * information about standard algorithm names.
- * @param provider the provider.
- * @return a Message Digest object implementing the specified algorithm.
- * @throws NoSuchAlgorithmException if the <code>algorithm</code> is not
- * available in the package supplied by the requested <code>provider</code>.
- * @throws IllegalArgumentException if the <code>provider</code> is
- * <code>null</code>.
- * @since 1.4
- * @see Provider
- */
- public static MessageDigest getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
- MessageDigest result = null;
- Object o = null;
- try
- {
- o = Engine.getInstance(MESSAGE_DIGEST, algorithm, provider);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- if (o instanceof MessageDigestSpi)
- {
- result = new DummyMessageDigest((MessageDigestSpi) o, algorithm);
- }
- else if (o instanceof MessageDigest)
- {
- result = (MessageDigest) o;
- result.algorithm = algorithm;
- }
- else
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- result.provider = provider;
- return result;
- }
-
- /**
- * Returns the provider of this message digest object.
- *
- * @return the provider of this message digest object.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Updates the digest using the specified byte.
- *
- * @param input the byte with which to update the digest.
- */
- public void update(byte input)
- {
- engineUpdate(input);
- }
-
- /**
- * Updates the digest using the specified array of bytes, starting at the
- * specified offset.
- *
- * @param input the array of bytes.
- * @param offset the offset to start from in the array of bytes.
- * @param len the number of bytes to use, starting at offset.
- */
- public void update(byte[] input, int offset, int len)
- {
- engineUpdate(input, offset, len);
- }
-
- /**
- * Updates the digest using the specified array of bytes.
- *
- * @param input the array of bytes.
- */
- public void update(byte[] input)
- {
- engineUpdate(input, 0, input.length);
- }
-
- /**
- * Completes the hash computation by performing final operations such as
- * padding. The digest is reset after this call is made.
- *
- * @return the array of bytes for the resulting hash value.
- */
- public byte[] digest()
- {
- return lastDigest = engineDigest();
- }
-
- /**
- * Completes the hash computation by performing final operations such as
- * padding. The digest is reset after this call is made.
- *
- * @param buf An output buffer for the computed digest.
- * @param offset The offset into the output buffer to begin storing the digest.
- * @param len The number of bytes within buf allotted for the digest.
- * @return The number of bytes placed into buf.
- * @throws DigestException if an error occurs.
- */
- public int digest(byte[] buf, int offset, int len) throws DigestException
- {
- return engineDigest(buf, offset, len);
- }
-
- /**
- * Performs a final update on the digest using the specified array of bytes,
- * then completes the digest computation. That is, this method first calls
- * <code>update(input)</code>, passing the input array to the <code>update()
- * </code> method, then calls <code>digest()</code>.
- *
- * @param input the input to be updated before the digest is completed.
- * @return the array of bytes for the resulting hash value.
- */
- public byte[] digest(byte[] input)
- {
- update(input);
- return digest();
- }
-
- /**
- * Returns a string representation of this message digest object.
- *
- * @return a string representation of the object.
- */
- public String toString()
- {
- return (getClass()).getName() + " Message Digest <" + digestToString() + ">";
- }
-
- /**
- * Compares two digests for equality. Does a simple byte compare.
- *
- * @param digesta one of the digests to compare.
- * @param digestb the other digest to compare.
- * @return <code>true</code> if the digests are equal, <code>false</code>
- * otherwise.
- */
- public static boolean isEqual(byte[] digesta, byte[] digestb)
- {
- if (digesta.length != digestb.length)
- return false;
-
- for (int i = digesta.length - 1; i >= 0; --i)
- if (digesta[i] != digestb[i])
- return false;
-
- return true;
- }
-
- /** Resets the digest for further use. */
- public void reset()
- {
- engineReset();
- }
-
- /**
- * Returns a string that identifies the algorithm, independent of
- * implementation details. The name should be a standard Java Security name
- * (such as <code>"SHA"</code>, <code>"MD5"</code>, and so on). See Appendix
- * A in the Java Cryptography Architecture API Specification &amp; Reference
- * for information about standard algorithm names.
- *
- * @return the name of the algorithm.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Returns the length of the digest in bytes, or <code>0</code> if this
- * operation is not supported by the provider and the implementation is not
- * cloneable.
- *
- * @return the digest length in bytes, or <code>0</code> if this operation is
- * not supported by the provider and the implementation is not cloneable.
- * @since 1.2
- */
- public final int getDigestLength()
- {
- return engineGetDigestLength();
- }
-
- /**
- * Returns a clone if the implementation is cloneable.
- *
- * @return a clone if the implementation is cloneable.
- * @throws CloneNotSupportedException if this is called on an implementation
- * that does not support {@link Cloneable}.
- */
- public Object clone() throws CloneNotSupportedException
- {
- return super.clone();
- }
-
- private String digestToString()
- {
- byte[] digest = lastDigest;
-
- if (digest == null)
- return "incomplete";
-
- StringBuffer buf = new StringBuffer();
- int len = digest.length;
- for (int i = 0; i < len; ++i)
- {
- byte b = digest[i];
- byte high = (byte) ((b & 0xff) >>> 4);
- byte low = (byte) (b & 0xf);
-
- buf.append(high > 9 ? ('a' - 10) + high : '0' + high);
- buf.append(low > 9 ? ('a' - 10) + low : '0' + low);
- }
-
- return buf.toString();
- }
-}
diff --git a/libjava/java/security/MessageDigestSpi.java b/libjava/java/security/MessageDigestSpi.java
deleted file mode 100644
index df3bd3ead02..00000000000
--- a/libjava/java/security/MessageDigestSpi.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/* MessageDigestSpi.java --- The message digest service provider interface.
- Copyright (C) 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- This is the Service Provider Interface (SPI) for MessageDigest
- class in java.security. It provides the back end functionality
- for the MessageDigest class so that it can compute message
- hashes. The default hashes are SHA-1 and MD5. A message hash
- takes data of arbitrary length and produces a unique number
- representing it.
-
- Cryptography service providers who want to implement their
- own message digest hashes need only to subclass this class.
-
- The implementation of a Cloneable interface is left to up to
- the programmer of a subclass.
-
- @version 0.0
-
- @author Mark Benvenuto (ivymccough@worldnet.att.net)
- */
-public abstract class MessageDigestSpi
-{
- /**
- Default constructor of the MessageDigestSpi class
- */
- public MessageDigestSpi()
- {
- }
-
- /**
- Returns the length of the digest. It may be overridden by the
- provider to return the length of the digest. Default is to
- return 0. It is concrete for backwards compatibility with JDK1.1
- message digest classes.
-
- @return Length of Digest in Bytes
-
- @since 1.2
- */
- protected int engineGetDigestLength()
- {
- return 0;
- }
-
- /**
- Updates the digest with the specified byte.
-
- @param input the byte to update digest with
- */
- protected abstract void engineUpdate(byte input);
-
-
- /**
- Updates the digest with the specified bytes starting with the
- offset and proceeding for the specified length.
-
- @param input the byte array to update digest with
- @param offset the offset of the byte to start with
- @param len the number of the bytes to update with
- */
- protected abstract void engineUpdate(byte[]input, int offset, int len);
-
- /**
- Computes the final digest of the stored bytes and returns
- them. It performs any necessary padding. The message digest
- should reset sensitive data after performing the digest.
-
- @return An array of bytes containing the digest
- */
- protected abstract byte[] engineDigest();
-
- /**
- Computes the final digest of the stored bytes and returns
- them. It performs any necessary padding. The message digest
- should reset sensitive data after performing the digest. This
- method is left concrete for backwards compatibility with JDK1.1
- message digest classes.
-
- @param buf An array of bytes to store the digest
- @param offset An offset to start storing the digest at
- @param len The length of the buffer
- @return Returns the length of the buffer
-
- @since 1.2
- */
- protected int engineDigest(byte[]buf, int offset, int len)
- throws DigestException
- {
- if (engineGetDigestLength() > len)
- throw new DigestException("Buffer is too small.");
-
- byte[] tmp = engineDigest();
- if (tmp.length > len)
- throw new DigestException("Buffer is too small");
-
- System.arraycopy(tmp, 0, buf, offset, tmp.length);
- return tmp.length;
- }
-
- /**
- Resets the digest engine. Reinitializes internal variables
- and clears sensitive data.
- */
- protected abstract void engineReset();
-
- /**
- Returns a clone of this class.
-
- If cloning is not supported, then by default the class throws a
- CloneNotSupportedException. The MessageDigestSpi provider
- implementation has to overload this class in order to be
- cloneable.
- */
- public Object clone() throws CloneNotSupportedException
- {
- return super.clone();
- }
-}
diff --git a/libjava/java/security/NoSuchAlgorithmException.java b/libjava/java/security/NoSuchAlgorithmException.java
deleted file mode 100644
index 412d14a16d7..00000000000
--- a/libjava/java/security/NoSuchAlgorithmException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* NoSuchAlgorithmException.java -- an algorithm was not available
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This exception is thrown when the requested security algorithm is
- * not available
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class NoSuchAlgorithmException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -7443947487218346562L;
-
- /**
- * Create a new instance with no descriptive error message.
- */
- public NoSuchAlgorithmException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param msg the descriptive error message
- */
- public NoSuchAlgorithmException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/NoSuchProviderException.java b/libjava/java/security/NoSuchProviderException.java
deleted file mode 100644
index bd26df5ef07..00000000000
--- a/libjava/java/security/NoSuchProviderException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* NoSuchProviderException.java -- thrown when a provider is not found
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This exception is thrown when the requested security provider is
- * not available.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class NoSuchProviderException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 8488111756688534474L;
-
- /**
- * Create a new instance with no descriptive error message.
- */
- public NoSuchProviderException()
- {
- }
-
- /**
- * Create a new instance with a descriptive error message.
- *
- * @param msg the descriptive error message
- */
- public NoSuchProviderException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/Permission.java b/libjava/java/security/Permission.java
deleted file mode 100644
index 48f4d52a18c..00000000000
--- a/libjava/java/security/Permission.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/* Permission.java -- The superclass for all permission objects
- Copyright (C) 1998, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.Serializable;
-
-/**
- * This class is the abstract superclass of all classes that implement
- * the concept of a permission. A permission consists of a permission name
- * and optionally a list of actions that relate to the permission. The
- * actual meaning of the name of the permission is defined only in the
- * context of a subclass. It may name a resource to which access permissions
- * are granted (for example, the name of a file) or it might represent
- * something else entirely. Similarly, the action list only has meaning
- * within the context of a subclass. Some permission names may have no
- * actions associated with them. That is, you either have the permission
- * or you don't.
- *
- * <p>The most important method in this class is <code>implies</code>. This
- * checks whether if one has this permission, then the specified
- * permission is also implied. As a conceptual example, consider the
- * permissions "Read All Files" and "Read File foo". The permission
- * "Read All Files" implies that the caller has permission to read the
- * file foo.
- *
- * <p><code>Permission</code>'s must be immutable - do not change their
- * state after creation.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Permissions
- * @see PermissionCollection
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class Permission implements Guard, Serializable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -5636570222231596674L;
-
- /**
- * This is the name assigned to this permission object.
- *
- * @serial the name of the permission
- */
- private String name;
-
- /**
- * Create an instance with the specified name.
- *
- * @param name the permission name
- */
- public Permission(String name)
- {
- this.name = name;
- }
-
- /**
- * This method implements the <code>Guard</code> interface for this class.
- * It calls the <code>checkPermission</code> method in
- * <code>SecurityManager</code> with this <code>Permission</code> as its
- * argument. This method returns silently if the security check succeeds
- * or throws an exception if it fails.
- *
- * @param obj the <code>Object</code> being guarded - ignored by this class
- * @throws SecurityException if the security check fails
- * @see GuardedObject
- * @see SecurityManager#checkPermission(Permission)
- */
- public void checkGuard(Object obj)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(this);
- }
-
- /**
- * This method tests whether this <code>Permission</code> implies that the
- * specified <code>Permission</code> is also granted.
- *
- * @param perm the <code>Permission</code> to test against
- * @return true if perm is implied by this
- */
- public abstract boolean implies(Permission perm);
-
- /**
- * Check to see if this object equals obj. Use <code>implies</code>, rather
- * than <code>equals</code>, when making access control decisions.
- *
- * @param obj the object to compare to
- */
- public abstract boolean equals(Object obj);
-
- /**
- * This method returns a hash code for this <code>Permission</code>. It
- * must satisfy the contract of <code>Object.hashCode</code>: it must be
- * the same for all objects that equals considers to be the same.
- *
- * @return a hash value
- */
- public abstract int hashCode();
-
- /**
- * Get the name of this <code>Permission</code>.
- *
- * @return the name
- */
- public final String getName()
- {
- return name;
- }
-
- /**
- * This method returns the list of actions for this <code>Permission</code>
- * as a <code>String</code>. The string should be in canonical order, for
- * example, both <code>new FilePermission(f, "write,read")</code> and
- * <code>new FilePermission(f, "read,write")</code> have the action list
- * "read,write".
- *
- * @return the action list for this <code>Permission</code>
- */
- public abstract String getActions();
-
- /**
- * This method returns an empty <code>PermissionCollection</code> object
- * that can store permissions of this type, or <code>null</code> if no
- * such collection is defined. Subclasses must override this to provide
- * an appropriate collection when one is needed to accurately calculate
- * <code>implies</code>.
- *
- * @return a new <code>PermissionCollection</code>
- */
- public PermissionCollection newPermissionCollection()
- {
- return null;
- }
-
- /**
- * This method returns a <code>String</code> representation of this
- * <code>Permission</code> object. This is in the format:
- * <code>'(' + getClass().getName() + ' ' + getName() + ' ' + getActions
- * + ')'</code>.
- *
- * @return this object as a <code>String</code>
- */
- public String toString()
- {
- return '(' + getClass().getName() + ' ' + getName() + ' '
- + getActions() + ')';
- }
-} // class Permission
diff --git a/libjava/java/security/PermissionCollection.java b/libjava/java/security/PermissionCollection.java
deleted file mode 100644
index 4e8ffe57948..00000000000
--- a/libjava/java/security/PermissionCollection.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/* PermissionCollection.java -- A collection of permission objects
- Copyright (C) 1998, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-
-/**
- * This class models a group of Java permissions. It has convenient
- * methods for determining whether or not a given permission is implied
- * by any of the permissions in this collection.
- *
- * <p>Some care must be taken in storing permissions. First, a collection of
- * the appropriate type must be created. This is done by calling the
- * <code>newPermissionCollection</code> method on an object of the
- * permission class you wish to add to the collection. If this method
- * returns <code>null</code>, any type of <code>PermissionCollection</code>
- * can be used to store permissions of that type. However, if a
- * <code>PermissionCollection</code> collection object is returned, that
- * type must be used.
- *
- * <p>A <code>PermissionCollection</code> returned by the
- * <code>newPermissionCollection</code> method in a subclass of
- * <code>Permission</code> is a homogeneous collection. It only will
- * hold permissions of one specified type - instances of the class that
- * created it. Not all <code>PermissionCollection</code> subclasses
- * have to hold permissions of only one type however. For example,
- * the <code>Permissions</code> class holds permissions of many types.
- *
- * <p>Since the <code>newPermissionCollection</code> in <code>Permission</code>
- * itself returns <code>null</code>, by default a permission can be stored
- * in any type of collection unless it overrides that method to create its
- * own collection type.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Permission
- * @see Permissions
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class PermissionCollection implements Serializable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -6727011328946861783L;
-
- /**
- * Indicates whether or not this collection is read only.
- *
- * @serial if the collection is read-only
- */
- private boolean readOnly;
-
- /**
- * Create a new collection.
- */
- public PermissionCollection()
- {
- }
-
- /**
- * This method adds a new <code>Permission</code> object to the collection.
- *
- * @param perm the <code>Permission</code> to add
- *
- * @throws SecurityException if the collection is marked read only
- * @throws IllegalArgumentException if perm is of the wrong type
- */
- public abstract void add(Permission perm);
-
- /**
- * This method tests whether the specified <code>Permission</code> object is
- * implied by this collection of <code>Permission</code> objects.
- *
- * @param perm the <code>Permission</code> object to test
- * @return true if the collection implies perm
- */
- public abstract boolean implies(Permission perm);
-
- /**
- * This method returns an <code>Enumeration</code> of all the objects in
- * this collection.
- *
- * @return an <code>Enumeration</code> of this collection's objects
- */
- public abstract Enumeration elements();
-
- /**
- * This method sets this <code>PermissionCollection</code> object to be
- * read only. No further permissions can be added to it after calling this
- * method.
- */
- public void setReadOnly()
- {
- readOnly = true;
- }
-
- /**
- * This method tests whether or not this <code>PermissionCollection</code>
- * object is read only.
- *
- * @return true if this collection is read only
- */
- public boolean isReadOnly()
- {
- return readOnly;
- }
-
- /**
- * This method returns a <code>String</code> representation of this
- * collection. It is formed by:
- * <pre>
- * super.toString()" (\n"
- * // enumerate all permissions, one per line
- * ")\n"
- * </pre>
- *
- * @return a <code>String</code> representing this object
- */
- public String toString()
- {
- StringBuffer sb = new StringBuffer(super.toString());
-
- sb.append(" (\n");
- Enumeration e = elements();
- while (e.hasMoreElements())
- sb.append(' ').append(e.nextElement()).append('\n');
- return sb.append(")\n").toString();
- }
-} // class PermissionCollection
diff --git a/libjava/java/security/Permissions.java b/libjava/java/security/Permissions.java
deleted file mode 100644
index e3fd06970ab..00000000000
--- a/libjava/java/security/Permissions.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/* Permissions.java -- a collection of permission collections
- Copyright (C) 1998, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.NoSuchElementException;
-
-/**
- * This class is a heterogeneous collection of permissions. It is
- * organized as a collection of <code>PermissionCollection</code>'s stored
- * in a hashtable. Each individual <code>PermissionCollection</code>
- * contains permissions of a single type. If a specific type of
- * <code>Permission</code> does not provide a collection type to use
- * via its <code>newPermissionCollection</code> method, then a default
- * collection type which stores its permissions in a hash table will be
- * used.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.1
- */
-public final class Permissions extends PermissionCollection
- implements Serializable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 4858622370623524688L;
-
- /**
- * Holds instances of <code>AllPermission</code>.
- *
- * @serial the permission collection for AllPermission
- */
- private PermissionCollection allPermission;
-
- // Package-private to avoid a trampoline.
- /**
- * This is the <code>Hashtable</code> that contains our collections.
- *
- * @serial maps Class to PermissionCollection
- */
- final Hashtable perms = new Hashtable();
-
- /**
- * This method initializes a new instance of <code>Permissions</code>.
- */
- public Permissions()
- {
- }
-
- /**
- * This method adds a new <code>Permission</code> to this collection. It
- * will be stored in a <code>PermissionCollection</code> of the appropriate
- * type, as determined by calling <code>newPermissionCollection</code> on
- * the specified permission (if an appropriate collection does not already
- * exist). If this object does not specify a particular type of collection,
- * a default collection, which stores in permissions in a hash table, will
- * be used.
- *
- * @param perm the <code>Permission</code> to add
- * @throws SecurityException if this collection is marked as read only
- */
- public void add(Permission perm)
- {
- if (isReadOnly())
- throw new SecurityException("PermissionCollection is read only");
- if (perm instanceof AllPermission)
- {
- if (allPermission == null)
- {
- allPermission = perm.newPermissionCollection();
- allPermission.add(perm);
- perms.put(perm.getClass(), allPermission);
- }
- }
- else
- {
- PermissionCollection pc
- = (PermissionCollection) perms.get(perm.getClass());
- if (pc == null)
- {
- pc = perm.newPermissionCollection();
- if (pc == null)
- pc = new PermissionsHash();
- perms.put(perm.getClass(), pc);
- }
- pc.add(perm);
- }
- }
-
- /**
- * This method tests whether or not the specified <code>Permission</code>
- * is implied by this <code>PermissionCollection</code>.
- *
- * @param perm the <code>Permission</code> to test
- * @return true if the specified permission is implied by this
- */
- public boolean implies(Permission perm)
- {
- if (allPermission != null)
- return true;
- PermissionCollection pc
- = (PermissionCollection) perms.get(perm.getClass());
- return pc == null ? false : pc.implies(perm);
- }
-
- /**
- * This method returns an <code>Enumeration</code> which contains a
- * list of all <code>Permission</code> objects contained in this
- * collection.
- *
- * @return an <code>Enumeration</code> of this collection's elements
- */
- public Enumeration elements()
- {
- return new Enumeration()
- {
- Enumeration main_enum = perms.elements();
- Enumeration sub_enum;
-
- public boolean hasMoreElements()
- {
- if (sub_enum == null)
- {
- if (main_enum == null)
- return false;
- if (! main_enum.hasMoreElements())
- {
- main_enum = null;
- return false;
- }
- PermissionCollection pc =
- (PermissionCollection) main_enum.nextElement();
- sub_enum = pc.elements();
- }
- if (! sub_enum.hasMoreElements())
- {
- sub_enum = null;
- return hasMoreElements();
- }
- return true;
- }
-
- public Object nextElement()
- {
- if (! hasMoreElements())
- throw new NoSuchElementException();
- return sub_enum.nextElement();
- }
- };
- }
-
- /**
- * Implements the permission collection for all permissions without one of
- * their own, and obeys serialization of JDK.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class PermissionsHash extends PermissionCollection
- {
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -8491988220802933440L;
-
- /**
- * Hashtable where we store permissions.
- *
- * @serial the stored permissions, both as key and value
- */
- private final Hashtable perms = new Hashtable();
-
- /**
- * Add a permission. We don't need to check for read-only, as this
- * collection is never exposed outside of Permissions, which has already
- * done that check.
- *
- * @param perm the permission to add
- */
- public void add(Permission perm)
- {
- perms.put(perm, perm);
- }
-
- /**
- * Returns true if perm is in the collection.
- *
- * @param perm the permission to check
- * @return true if it is implied
- */
- // FIXME: Should this method be synchronized?
- public boolean implies(Permission perm)
- {
- Enumeration elements = elements();
-
- while (elements.hasMoreElements())
- {
- Permission p = (Permission)elements.nextElement();
- if (p.implies(perm))
- return true;
- }
- return false;
- }
-
- /**
- * Return the elements.
- *
- * @return the elements
- */
- public Enumeration elements()
- {
- return perms.elements();
- }
- } // class PermissionsHash
-} // class Permissions
diff --git a/libjava/java/security/Policy.java b/libjava/java/security/Policy.java
deleted file mode 100644
index 03d9bbb4ed6..00000000000
--- a/libjava/java/security/Policy.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/* Policy.java --- Policy Manager Class
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * <p>This is an abstract class for representing the system security policy for
- * a Java application environment (specifying which permissions are available
- * for code from various sources). That is, the security policy is represented
- * by a <code>Policy</code> subclass providing an implementation of the abstract
- * methods in this <code>Policy</code> class.</p>
- *
- * <p>There is only one <code>Policy</code> object in effect at any given time.
- * </p>
- *
- * <p>The source location for the policy information utilized by the
- * <code>Policy</code> object is up to the <code>Policy</code> implementation.
- * The policy configuration may be stored, for example, as a flat ASCII file, as
- * a serialized binary file of the <code>Policy</code> class, or as a database.
- * </p>
- *
- * <p>The currently-installed <code>Policy</code> object can be obtained by
- * calling the <code>getPolicy()</code> method, and it can be changed by a call
- * to the <code>setPolicy()</code> method (by code with permission to reset the
- * <code>Policy</code>).</p>
- *
- * <p>The <code>refresh()</code> method causes the policy object to refresh /
- * reload its current configuration.</p>
- *
- * <p>This is implementation-dependent. For example, if the policy object stores
- * its policy in configuration files, calling <code>refresh()</code> will cause
- * it to re-read the configuration policy files. The refreshed policy may not
- * have an effect on classes in a particular {@link ProtectionDomain}. This is
- * dependent on the <code>Policy</code> provider's implementation of the
- * <code>implies()</code> method and the {@link PermissionCollection} caching
- * strategy.</p>
- *
- * <p>The default <code>Policy</code> implementation can be changed by setting
- * the value of the <code>"policy.provider"</code> security property (in the
- * Java security properties file) to the fully qualified name of the desired
- * <code>Policy</code> implementation class. The Java security properties file
- * is located in the file named <code>&lt;JAVA_HOME>/lib/security/java.security
- * </code>, where <code>&lt;JAVA_HOME></code> refers to the directory where the
- * SDK was installed.</p>
- *
- * <p><b>IMPLEMENTATION NOTE:</b> This implementation attempts to read the
- * System property named <code>policy.provider</code> to find the concrete
- * implementation of the <code>Policy</code>. If/when this fails, it falls back
- * to a default implementation, which <b>allows everything</b>.
- *
- * @author Mark Benvenuto
- * @see CodeSource
- * @see PermissionCollection
- * @see SecureClassLoader
- * @since 1.2
- */
-public abstract class Policy
-{
- private static Policy currentPolicy;
-
- /** Map of ProtectionDomains to PermissionCollections for this instance. */
- private Map pd2pc = null;
-
- /** Constructs a new <code>Policy</code> object. */
- public Policy()
- {
- }
-
- /**
- * Returns the installed <code>Policy</code> object. This value should not be
- * cached, as it may be changed by a call to <code>setPolicy()</code>. This
- * method first calls {@link SecurityManager#checkPermission(Permission)} with
- * a <code>SecurityPermission("getPolicy")</code> permission to ensure it's ok
- * to get the <code>Policy</code> object.
- *
- * @return the installed <code>Policy</code>.
- * @throws SecurityException if a security manager exists and its
- * <code>checkPermission()</code> method doesn't allow getting the
- * <code>Policy</code> object.
- * @see SecurityManager#checkPermission(Permission)
- * @see #setPolicy(Policy)
- */
- public static Policy getPolicy()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new SecurityPermission("getPolicy"));
-
- return getCurrentPolicy();
- }
-
- /**
- * Sets the system-wide <code>Policy</code> object. This method first calls
- * {@link SecurityManager#checkPermission(Permission)} with a
- * <code>SecurityPermission("setPolicy")</code> permission to ensure it's ok
- * to set the <code>Policy</code>.
- *
- * @param policy the new system <code>Policy</code> object.
- * @throws SecurityException if a security manager exists and its
- * <code>checkPermission()</code> method doesn't allow setting the
- * <code>Policy</code>.
- * @see SecurityManager#checkPermission(Permission)
- * @see #getPolicy()
- */
- public static void setPolicy(Policy policy)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new SecurityPermission("setPolicy"));
-
- setup(policy);
- currentPolicy = policy;
- }
-
- private static void setup(final Policy policy)
- {
- if (policy.pd2pc == null)
- policy.pd2pc = Collections.synchronizedMap(new LinkedHashMap());
-
- ProtectionDomain pd = policy.getClass().getProtectionDomain();
- if (pd.getCodeSource() != null)
- {
- PermissionCollection pc = null;
- if (currentPolicy != null)
- pc = currentPolicy.getPermissions(pd);
-
- if (pc == null) // assume it has all
- {
- pc = new Permissions();
- pc.add(new AllPermission());
- }
-
- policy.pd2pc.put(pd, pc); // add the mapping pd -> pc
- }
- }
-
- /**
- * Ensures/forces loading of the configured policy provider, while bypassing
- * the {@link SecurityManager} checks for <code>"getPolicy"</code> security
- * permission. Needed by {@link ProtectionDomain}.
- */
- static Policy getCurrentPolicy()
- {
- // FIXME: The class name of the Policy provider should really be sourced
- // from the "java.security" configuration file. For now, just hard-code
- // a stub implementation.
- if (currentPolicy == null)
- {
- String pp = System.getProperty ("policy.provider");
- if (pp != null)
- try
- {
- currentPolicy = (Policy) Class.forName(pp).newInstance();
- }
- catch (Exception e)
- {
- // Ignored.
- }
-
- if (currentPolicy == null)
- currentPolicy = new gnu.java.security.provider.DefaultPolicy();
- }
- return currentPolicy;
- }
-
- /**
- * Tests if <code>currentPolicy</code> is not <code>null</code>,
- * thus allowing clients to not force loading of any policy
- * provider; needed by {@link ProtectionDomain}.
- */
- static boolean isLoaded()
- {
- return currentPolicy != null;
- }
-
- /**
- * Evaluates the global policy and returns a {@link PermissionCollection}
- * object specifying the set of permissions allowed for code from the
- * specified code source.
- *
- * @param codesource the {@link CodeSource} associated with the caller. This
- * encapsulates the original location of the code (where the code came from)
- * and the public key(s) of its signer.
- * @return the set of permissions allowed for code from codesource according
- * to the policy. The returned set of permissions must be a new mutable
- * instance and it must support heterogeneous {@link Permission} types.
- */
- public abstract PermissionCollection getPermissions(CodeSource codesource);
-
- /**
- * Evaluates the global policy and returns a {@link PermissionCollection}
- * object specifying the set of permissions allowed given the characteristics
- * of the protection domain.
- *
- * @param domain the {@link ProtectionDomain} associated with the caller.
- * @return the set of permissions allowed for the domain according to the
- * policy. The returned set of permissions must be a new mutable instance and
- * it must support heterogeneous {@link Permission} types.
- * @since 1.4
- * @see ProtectionDomain
- * @see SecureClassLoader
- */
- public PermissionCollection getPermissions(ProtectionDomain domain)
- {
- if (domain == null)
- return new Permissions();
-
- if (pd2pc == null)
- setup(this);
-
- PermissionCollection result = (PermissionCollection) pd2pc.get(domain);
- if (result != null)
- {
- Permissions realResult = new Permissions();
- for (Enumeration e = result.elements(); e.hasMoreElements(); )
- realResult.add((Permission) e.nextElement());
-
- return realResult;
- }
-
- result = getPermissions(domain.getCodeSource());
- if (result == null)
- result = new Permissions();
-
- PermissionCollection pc = domain.getPermissions();
- if (pc != null)
- for (Enumeration e = pc.elements(); e.hasMoreElements(); )
- result.add((Permission) e.nextElement());
-
- return result;
- }
-
- /**
- * Evaluates the global policy for the permissions granted to the {@link
- * ProtectionDomain} and tests whether the <code>permission</code> is granted.
- *
- * @param domain the {@link ProtectionDomain} to test.
- * @param permission the {@link Permission} object to be tested for
- * implication.
- * @return <code>true</code> if <code>permission</code> is a proper subset of
- * a permission granted to this {@link ProtectionDomain}.
- * @since 1.4
- * @see ProtectionDomain
- */
- public boolean implies(ProtectionDomain domain, Permission permission)
- {
- if (pd2pc == null)
- setup(this);
-
- PermissionCollection pc = (PermissionCollection) pd2pc.get(domain);
- if (pc != null)
- return pc.implies(permission);
-
- boolean result = false;
- pc = getPermissions(domain);
- if (pc != null)
- {
- result = pc.implies(permission);
- pd2pc.put(domain, pc);
- }
-
- return result;
- }
-
- /**
- * Refreshes/reloads the policy configuration. The behavior of this method
- * depends on the implementation. For example, calling refresh on a file-based
- * policy will cause the file to be re-read.
- */
- public abstract void refresh();
-}
diff --git a/libjava/java/security/Principal.java b/libjava/java/security/Principal.java
deleted file mode 100644
index 6d9de6ccd8a..00000000000
--- a/libjava/java/security/Principal.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Principal.java -- A security entity
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This interface models an entity (such as a user or a certificate authority)
- * for the purposes of applying the Java security model.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see X509Certificate
- * @since 1.1
- * @status updated to 1.4
- */
-public interface Principal
-{
- /**
- * This method tests another <code>Principal</code> object for equality
- * with this one.
- *
- * @param obj the Object to test for equality
- * @return true if the specified <code>Principal</code> is equal
- */
- boolean equals(Object obj);
-
- /**
- * This method returns a <code>String</code> representation of this
- * <code>Principal</code>.
- *
- * @return this <code>Principal</code> represented as a <code>String</code>
- */
- String toString();
-
- /**
- * This method returns a hash code value for this <code>Principal</code>.
- * Remember the contract of hashCode - two objects which compare as
- * equals() must have the same hashCode().
- *
- * @return a hash value
- */
- int hashCode();
-
- /**
- * This method returns a <code>String</code> that names this
- * <code>Principal</code>.
- *
- * @return the name of this <code>Principal</code>
- */
- String getName();
-} // interface Principal
diff --git a/libjava/java/security/PrivateKey.java b/libjava/java/security/PrivateKey.java
deleted file mode 100644
index 70607c13442..00000000000
--- a/libjava/java/security/PrivateKey.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* PrivateKey.java -- tagging interface for all private keys
- Copyright (C) 1998, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This interface specified no methods. In simply provides a common
- * super-interface for all algorithm specific private key values.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Key
- * @see PublicKey
- * @see Certificate
- * @see Signature#initVerify(PublicKey)
- * @see DSAPrivateKey
- * @see RSAPrivateKey
- * @see RSAPrivateCrtKey
- * @since 1.1
- * @status updated to 1.4
- */
-public interface PrivateKey extends Key
-{
- /**
- * The version identifier used for serialization.
- */
- long serialVersionUID = 6034044314589513430L;
-} // interface PrivateKey
diff --git a/libjava/java/security/PrivilegedAction.java b/libjava/java/security/PrivilegedAction.java
deleted file mode 100644
index c3a41346f9c..00000000000
--- a/libjava/java/security/PrivilegedAction.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* PrivilegedAction.java -- Perform a privileged action
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This interface specifes a single <code>run</code> method that
- * executes a privileged operation. This method is called by
- * <code>AccessController.doPrivileged()</code> after that method
- * activiates the required privileges.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see AccessController
- * @see PrivilegedExceptionAction
- * @since 1.1
- * @status updated to 1.4
- */
-public interface PrivilegedAction
-{
- /**
- * This method performs an operation that requires higher privileges to
- * perform. It is called when a section of code invokes
- * <code>AccessController.doPrivileged()</code>.
- *
- * @return obj An implementation dependent return value
- * @see AccessController#doPrivileged(PrivilegedAction)
- * @see AccessController#doPrivileged(PrivilegedAction, AccessControlContext)
- */
- Object run();
-} // interface PrivilegedAction
diff --git a/libjava/java/security/PrivilegedActionException.java b/libjava/java/security/PrivilegedActionException.java
deleted file mode 100644
index 3f08c813065..00000000000
--- a/libjava/java/security/PrivilegedActionException.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* PrivilegedActionException.java -- wrap an exception in a privileged action
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This exception is thrown when an exception is thrown during a
- * privileged action being performed with the
- * <code>AccessController.doPrivileged()</code> method. It wraps the
- * actual exception thrown in the privileged code.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see PrivilegedExceptionAction
- * @see AccessController#doPrivileged(PrivilegedExceptionAction)
- * @see AccessController#doPrivileged(PrivilegedExceptionAction, AccessControlContext)
- * @status updated to 1.4
- */
-public class PrivilegedActionException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 4724086851538908602L;
-
- /**
- * This is the actual exception that occurred.
- *
- * @serial the wrapped exception
- */
- private Exception exception;
-
- /**
- * Create a new instance that wraps the specified <code>Exception</code>.
- *
- * @param e the <code>Exception</code> to wrap
- */
- public PrivilegedActionException(Exception e)
- {
- super(e);
- exception = e;
- }
-
- /**
- * Get the underlying <code>Exception</code> that caused this one. This
- * is a legacy method, the preferred way is {@link #getCause()}.
- *
- * @return the cause
- */
- public Exception getException()
- {
- return exception;
- }
-
- /**
- * Gets the cause of this exception.
- *
- * @return the cause
- * @since 1.4
- */
- public Throwable getCause()
- {
- return exception;
- }
-
- /**
- * Convert this to a String.
- *
- * @return the string representation
- */
- public String toString()
- {
- return super.toString();
- }
-}
diff --git a/libjava/java/security/PrivilegedExceptionAction.java b/libjava/java/security/PrivilegedExceptionAction.java
deleted file mode 100644
index d3d0478fd48..00000000000
--- a/libjava/java/security/PrivilegedExceptionAction.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* PrivilegedExceptionAction.java -- Perform a privileged operation
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This interface defines a method that is called by
- * <code>AccessController.doPrivileged()</code> in order to perform a
- * privileged operation with higher privileges enabled. This interface
- * differs from <code>PrivilegedAction</code> in that the <code>run</code>
- * method in this interface may throw a checked exception.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.1
- * @status updated to 1.4
- */
-public interface PrivilegedExceptionAction
-{
- /**
- * This method performs an operation that requires higher privileges to
- * successfully complete. It is called when a section of code invokes
- * <code>AccessController.doPrivileged()</code>.
- *
- * @return obj An implementation defined return value
- * @throws Exception An implementation specific exception
- * @see AccessController#doPrivileged(PrivilegedExceptionAction)
- * @see AccessController#doPrivileged(PrivilegedExceptionAction,
- * AccessControlContext)
- */
- Object run() throws Exception;
-} // interface PrivilegedExceptionAction
diff --git a/libjava/java/security/ProtectionDomain.java b/libjava/java/security/ProtectionDomain.java
deleted file mode 100644
index a5851b5adf4..00000000000
--- a/libjava/java/security/ProtectionDomain.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/* ProtectionDomain.java -- A security domain
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * <p>This <code>ProtectionDomain</code> class encapsulates the characteristics
- * of a domain, which encloses a set of classes whose instances are granted a
- * set of permissions when being executed on behalf of a given set of
- * <i>Principals</i>.
- *
- * <p>A static set of permissions can be bound to a <code>ProtectionDomain</code>
- * when it is constructed; such permissions are granted to the domain regardless
- * of the {@link Policy} in force. However, to support dynamic security
- * policies, a <code>ProtectionDomain</code> can also be constructed such that
- * it is dynamically mapped to a set of permissions by the current {@link
- * Policy} whenever a permission is checked.</p>
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @version 0.0
- */
-public class ProtectionDomain
-{
- /** This is the <code>CodeSource</code> for this protection domain. */
- private CodeSource code_source;
-
- /** This is the set of permissions granted to this domain. */
- private PermissionCollection perms;
-
- /** The {@link ClassLoader} associated with this domain. */
- private ClassLoader classloader;
-
- /** The array of Principals associated with this domain.. */
- private Principal[] principals;
-
- /** Post 1.4 the policy may be refreshed! use false for pre 1.4. */
- private boolean staticBinding;
-
- /**
- * Creates a new <code>ProtectionDomain</code> with the given {@link
- * CodeSource} and {@link Permissions}. If the permissions object is not
- * <code>null</code>, then <code>setReadOnly()</code> will be called on the
- * passed in {@link Permissions} object. The only permissions granted to this
- * domain are the ones specified; the current {@link Policy} will not be
- * consulted.
- *
- * @param codesource the codesource associated with this domain.
- * @param permissions the permissions granted to this domain
- */
- public ProtectionDomain(CodeSource codesource, PermissionCollection permissions)
- {
- this(codesource, permissions, null, null, true);
- }
-
- /**
- * <p>Creates a new ProtectionDomain qualified by the given CodeSource,
- * Permissions, ClassLoader and array of Principals. If the permissions
- * object is not null, then <code>setReadOnly()</code> will be called on the
- * passed in Permissions object. The permissions granted to this domain are
- * dynamic; they include both the static permissions passed to this
- * constructor, and any permissions granted to this domain by the current
- * Policy at the time a permission is checked.</p>
- *
- * <p>This constructor is typically used by {@link ClassLoader}s and {@link
- * DomainCombiner}s which delegate to <code>Policy</code> to actively
- * associate the permissions granted to this domain. This constructor affords
- * the Policy provider the opportunity to augment the supplied
- * PermissionCollection to reflect policy changes.</p>
- *
- * @param codesource the CodeSource associated with this domain.
- * @param permissions the permissions granted to this domain.
- * @param classloader the ClassLoader associated with this domain.
- * @param principals the array of Principals associated with this domain.
- * @since 1.4
- * @see Policy#refresh()
- * @see Policy#getPermissions(ProtectionDomain)
- */
- public ProtectionDomain(CodeSource codesource,
- PermissionCollection permissions,
- ClassLoader classloader, Principal[] principals)
- {
- this(codesource, permissions, classloader, principals, false);
- }
-
- private ProtectionDomain(CodeSource codesource,
- PermissionCollection permissions,
- ClassLoader classloader, Principal[] principals,
- boolean staticBinding)
- {
- super();
-
- code_source = codesource;
- if (permissions != null)
- {
- perms = permissions;
- perms.setReadOnly();
- }
-
- this.classloader = classloader;
- this.principals =
- (principals != null ? (Principal[]) principals.clone() : new Principal[0]);
- this.staticBinding = staticBinding;
- }
-
- /**
- * Returns the {@link CodeSource} of this domain.
- *
- * @return the {@link CodeSource} of this domain which may be <code>null</code>.
- * @since 1.2
- */
- public final CodeSource getCodeSource()
- {
- return code_source;
- }
-
- /**
- * Returns the {@link ClassLoader} of this domain.
- *
- * @return the {@link ClassLoader} of this domain which may be
- * <code>null</code>.
- * @since 1.4
- */
- public final ClassLoader getClassLoader()
- {
- return this.classloader;
- }
-
- /**
- * Returns an array of principals for this domain.
- *
- * @return returns a non-null array of principals for this domain. Changes to
- * this array will have no impact on the <code>ProtectionDomain</code>.
- * @since 1.4
- */
- public final Principal[] getPrincipals()
- {
- return (Principal[]) principals.clone();
- }
-
- /**
- * Returns the static permissions granted to this domain.
- *
- * @return the static set of permissions for this domain which may be
- * <code>null</code>.
- * @see Policy#refresh()
- * @see Policy#getPermissions(ProtectionDomain)
- */
- public final PermissionCollection getPermissions()
- {
- return perms;
- }
-
- /**
- * <p>Check and see if this <code>ProtectionDomain</code> implies the
- * permissions expressed in the <code>Permission</code> object.</p>
- *
- * <p>The set of permissions evaluated is a function of whether the
- * <code>ProtectionDomain</code> was constructed with a static set of
- * permissions or it was bound to a dynamically mapped set of permissions.</p>
- *
- * <p>If the <code>ProtectionDomain</code> was constructed to a statically
- * bound {@link PermissionCollection} then the permission will only be checked
- * against the {@link PermissionCollection} supplied at construction.</p>
- *
- * <p>However, if the <code>ProtectionDomain</code> was constructed with the
- * constructor variant which supports dynamically binding permissions, then
- * the permission will be checked against the combination of the
- * {@link PermissionCollection} supplied at construction and the current
- * {@link Policy} binding.
- *
- * @param permission the {@link Permission} object to check.
- * @return <code>true</code> if <code>permission</code> is implicit to this
- * <code>ProtectionDomain</code>.
- */
- public boolean implies(Permission permission)
- {
- if (staticBinding)
- return (perms == null ? false : perms.implies(permission));
- // Else dynamically bound. Do we have it?
- // NOTE: this will force loading of Policy.currentPolicy
- return Policy.getCurrentPolicy().implies(this, permission);
- }
-
- /**
- * Convert a <code>ProtectionDomain</code> to a String.
- *
- * @return a string representation of the object.
- */
- public String toString()
- {
- String linesep = System.getProperty("line.separator");
- StringBuffer sb = new StringBuffer("ProtectionDomain (").append(linesep);
-
- if (code_source == null)
- sb.append("CodeSource:null");
- else
- sb.append(code_source);
-
- sb.append(linesep);
- if (classloader == null)
- sb.append("ClassLoader:null");
- else
- sb.append(classloader);
-
- sb.append(linesep);
- sb.append("Principals:");
- if (principals != null && principals.length > 0)
- {
- sb.append("[");
- Principal pal;
- for (int i = 0; i < principals.length; i++)
- {
- pal = principals[i];
- sb.append("'").append(pal.getName())
- .append("' of type ").append(pal.getClass().getName());
- if (i < principals.length-1)
- sb.append(", ");
- }
- sb.append("]");
- }
- else
- sb.append("none");
-
- sb.append(linesep);
- if (!staticBinding) // include all but dont force loading Policy.currentPolicy
- if (Policy.isLoaded())
- sb.append(Policy.getCurrentPolicy().getPermissions(this));
- else // fallback on this one's permissions
- sb.append(perms);
- else
- sb.append(perms);
-
- return sb.append(linesep).append(")").append(linesep).toString();
- }
-}
diff --git a/libjava/java/security/Provider.java b/libjava/java/security/Provider.java
deleted file mode 100644
index 4ffaa55bcb1..00000000000
--- a/libjava/java/security/Provider.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/* Provider.java -- Security provider information
- Copyright (C) 1998, 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-/**
- * This class represents a Java security architecture service provider.
- * The services provided by a such a provider can range from security
- * algorithms to key generation.
- * <p>
- * Providers are installed by name and version number. There is one
- * standard provider supplied with the class library. This is the
- * "GNU" provider, which can also be accessed by the alias "SUN" for
- * compatibility with the JDK.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public abstract class Provider extends Properties implements Serializable
-{
- private static final long serialVersionUID = -4298000515446427739L;
-
- /**
- * This is a textual description of the provider
- */
- private String info;
-
- /**
- * This is the name of the provider
- */
- private String name;
-
- /**
- * This is the version number of the provider
- */
- private double version;
-
- /**
- * This method initializes a new instance of <code>Provider</code> to have
- * the specified name, version, and description information.
- *
- * @param name The name to assign to this <code>Provider</code>.
- * @param version The version number for this <code>Provider</code>.
- * @param info A textual description of this provider.
- */
- protected Provider(String name, double version, String info)
- {
- this.name = name;
- this.version = version;
- this.info = info;
- }
-
- /**
- * This method returns the name assigned to this <code>Provider</code>.
- *
- * @return The <code>Provider</code>'s name.
- */
- public String getName()
- {
- return (name);
- }
-
- /**
- * This method retunrs the version number of this <code>Provider</code>.
- *
- * @return The <code>Provider</code>'s version number.
- */
- public double getVersion()
- {
- return (version);
- }
-
- /**
- * This method returns a textual description of the <code>Provider</code>.
- *
- * @return A description of the <code>Provider</code>.
- */
- public String getInfo()
- {
- return (info);
- }
-
- /**
- * Sets the key property to have the specified value.
- * <p>
- * <bold>NOT IMPLEMENTED YET</bold>[
- * First, if there is a security manager, its <code>checkSecurityAccess</code>
- * method is called with the string "putProviderProperty."+name, where name is
- * the provider name, to see if it's ok to set this provider's property
- * values.
- * If the default implementation of <code>checkSecurityAccess</code> is used
- * (that is, that method is not overriden), then this results in a call to the
- * security manager's <code>checkPermission</code> method with a
- * <code>SecurityPermission("putProviderProperty."+name)</code>
- * permission.<br>]
- *
- * @param key The property key.
- * @param value The property value.
- *
- * @return The previous value of the specified property (<code>key</code>),
- * or <code>null</code> if it did not have one.
- * @throws SecurityException If a security manager exists and its
- * {@link java.lang.SecurityManager.checkSecurityAccess(java.lang.String)}
- * method denies access to set property values.
- * @since Classpath 0.4+cvs, JDK 1.2
- * @see java.lang.Object.equals(Object)
- * @see java.util.Hashtable.get(Object)
- */
- public Object put(Object key, Object value)
- {
- return super.put(toCanonicalKey(key), value);
- }
-
- // overrides same in java.util.Hashtable
- public Object get(Object key)
- {
- return super.get(toCanonicalKey(key));
- }
-
- /**
- * This method removes the specified key entry (and its associated value)
- * from the property mapping list.
- *
- * @param key The key to remove
- *
- * @return The previous value for this key, or <code>null</code> if no
- * previous value.
- */
- public Object remove(Object key)
- {
- return super.remove(toCanonicalKey(key));
- }
-
- /**
- * This method clears the entire property list such that it no longer
- * contains the properties used to look up the services provided by
- * the <code>Provider</code>.
- */
- public void clear()
- {
- super.clear();
- }
-
- /**
- * This method returns a <code>String</code> representation of this
- * object. This will include the <code>Provider</code> name and
- * version number.
- *
- * @return A <code>String</code> representation of this object.
- */
- public String toString()
- {
- return (getClass().getName() + ": name=" + getName() + " version=" +
- version);
- }
-
- private Object toCanonicalKey(Object key)
- {
- if (key.getClass().isAssignableFrom(String.class)) // is it ours?
- return ((String) key).toUpperCase(); // use default locale
- else
- return key;
- }
-}
diff --git a/libjava/java/security/ProviderException.java b/libjava/java/security/ProviderException.java
deleted file mode 100644
index 2dafcec3495..00000000000
--- a/libjava/java/security/ProviderException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ProviderException.java -- Generic security provider runtime exception
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This exception indicates that a runtime problem was encounterd with
- * a security provider.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class ProviderException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 5256023526693665674L;
-
- /**
- * Create an instance with no descriptive error message.
- */
- public ProviderException()
- {
- }
-
- /**
- * Create an instance with a descriptive error message.
- *
- * @param msg the descriptive error message
- */
- public ProviderException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/PublicKey.java b/libjava/java/security/PublicKey.java
deleted file mode 100644
index 9bf14584089..00000000000
--- a/libjava/java/security/PublicKey.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* PublicKey.java -- tagging interface for all public keys
- Copyright (C) 1998, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This interface specified no methods. In simply provides a common
- * super-interface for all algorithm specific public key values.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Key
- * @see PrivateKey
- * @see Certificate
- * @see Signature#initVerify(PublicKey)
- * @see DSAPublicKey
- * @see RSAPublicKey
- * @since 1.1
- * @status updated to 1.4
- */
-public interface PublicKey extends Key
-{
- /**
- * The version identifier used for serialization.
- */
- long serialVersionUID = 7187392471159151072L;
-} // interface PublicKey
diff --git a/libjava/java/security/SecureClassLoader.java b/libjava/java/security/SecureClassLoader.java
deleted file mode 100644
index 9d1fac79749..00000000000
--- a/libjava/java/security/SecureClassLoader.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* SecureClassLoader.java --- A Secure Class Loader
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * A Secure Class Loader for loading classes with additional
- * support for specifying code source and permissions when
- * they are retrieved by the system policy handler.
- *
- * @since 1.2
- *
- * @author Mark Benvenuto
- */
-public class SecureClassLoader extends ClassLoader
-{
- java.util.WeakHashMap protectionDomainCache = new java.util.WeakHashMap();
-
- protected SecureClassLoader(ClassLoader parent)
- {
- super(parent);
- SecurityManager sm = System.getSecurityManager();
- if(sm != null)
- sm.checkCreateClassLoader();
- }
-
- protected SecureClassLoader()
- {
- SecurityManager sm = System.getSecurityManager();
- if(sm != null)
- sm.checkCreateClassLoader();
- }
-
- /**
- * Creates a class using an array of bytes and a
- * CodeSource.
- *
- * @param name the name to give the class. null if unknown.
- * @param b the data representing the classfile, in classfile format.
- * @param off the offset into the data where the classfile starts.
- * @param len the length of the classfile data in the array.
- * @param cs the CodeSource for the class or null when unknown.
- *
- * @return the class that was defined and optional CodeSource.
- *
- * @exception ClassFormatError if the byte array is not in proper classfile format.
- */
- protected final Class defineClass(String name, byte[] b, int off, int len,
- CodeSource cs)
- {
- if (cs != null)
- {
- ProtectionDomain protectionDomain;
-
- synchronized (protectionDomainCache)
- {
- protectionDomain = (ProtectionDomain)protectionDomainCache.get(cs);
- }
-
- if (protectionDomain == null)
- {
- protectionDomain
- = new ProtectionDomain(cs, getPermissions(cs), this, null);
- synchronized (protectionDomainCache)
- {
- ProtectionDomain domain
- = (ProtectionDomain)protectionDomainCache.get(cs);
- if (domain == null)
- protectionDomainCache.put(cs, protectionDomain);
- else
- protectionDomain = domain;
- }
- }
- return super.defineClass(name, b, off, len, protectionDomain);
- }
- else
- return super.defineClass(name, b, off, len);
- }
-
- /**
- * Returns a PermissionCollection for the specified CodeSource.
- * The default implementation invokes
- * java.security.Policy.getPermissions.
- *
- * This method is called by defineClass that takes a CodeSource
- * arguement to build a proper ProtectionDomain for the class
- * being defined.
- */
- protected PermissionCollection getPermissions(CodeSource cs)
- {
- Policy policy = Policy.getCurrentPolicy();
- return policy.getPermissions(cs);
- }
-}
diff --git a/libjava/java/security/SecureRandom.java b/libjava/java/security/SecureRandom.java
deleted file mode 100644
index 3ee3a841d26..00000000000
--- a/libjava/java/security/SecureRandom.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/* SecureRandom.java --- Secure Random class implementation
- Copyright (C) 1999, 2001, 2002, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import gnu.java.security.Engine;
-
-import java.util.Enumeration;
-import java.util.Random;
-
-/**
- * An interface to a cryptographically secure pseudo-random number
- * generator (PRNG). Random (or at least unguessable) numbers are used
- * in all areas of security and cryptography, from the generation of
- * keys and initialization vectors to the generation of random padding
- * bytes.
- *
- * @author Mark Benvenuto (ivymccough@worldnet.att.net)
- * @author Casey Marshall
- */
-public class SecureRandom extends Random
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** Service name for PRNGs. */
- private static final String SECURE_RANDOM = "SecureRandom";
-
- private static final long serialVersionUID = 4940670005562187L;
-
- //Serialized Field
- long counter = 0; //Serialized
- Provider provider = null;
- byte[] randomBytes = null; //Always null
- int randomBytesUsed = 0;
- SecureRandomSpi secureRandomSpi = null;
- byte[] state = null;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- Default constructor for SecureRandom. It constructs a
- new SecureRandom by instantating the first SecureRandom
- algorithm in the default security provier.
-
- It is not seeded and should be seeded using setSeed or else
- on the first call to getnextBytes it will force a seed.
-
- It is maintained for backwards compatibility and programs
- should use {@link #getInstance(java.lang.String)}.
- */
- public SecureRandom()
- {
- Provider[] p = Security.getProviders();
-
- //Format of Key: SecureRandom.algname
- String key;
-
- String classname = null;
- int i;
- Enumeration e;
- for (i = 0; i < p.length; i++)
- {
- e = p[i].propertyNames();
- while (e.hasMoreElements())
- {
- key = (String) e.nextElement();
- if (key.startsWith("SECURERANDOM."))
- {
- if ((classname = p[i].getProperty(key)) != null)
- {
- try
- {
- secureRandomSpi = (SecureRandomSpi) Class.
- forName(classname).newInstance();
- provider = p[i];
- return;
- }
- catch (ThreadDeath death)
- {
- throw death;
- }
- catch (Throwable t)
- {
- // Ignore.
- }
- }
- }
- }
- }
-
- // Nothing found. Fall back to SHA1PRNG
- secureRandomSpi = new gnu.java.security.provider.SHA1PRNG();
- }
-
- /**
- A constructor for SecureRandom. It constructs a new
- SecureRandom by instantating the first SecureRandom algorithm
- in the default security provier.
-
- It is seeded with the passed function and is useful if the user
- has access to hardware random device (like a radiation detector).
-
- It is maintained for backwards compatibility and programs
- should use getInstance.
-
- @param seed Seed bytes for class
- */
- public SecureRandom(byte[] seed)
- {
- this();
- setSeed(seed);
- }
-
- /**
- A constructor for SecureRandom. It constructs a new
- SecureRandom using the specified SecureRandomSpi from
- the specified security provier.
-
- @param secureRandomSpi A SecureRandomSpi class
- @param provider A Provider class
- */
- protected SecureRandom(SecureRandomSpi secureRandomSpi, Provider provider)
- {
- this.secureRandomSpi = secureRandomSpi;
- this.provider = provider;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns an instance of a SecureRandom. It creates the class from
- * the first provider that implements it.
- *
- * @param algorithm The algorithm name.
- * @return A new SecureRandom implementing the given algorithm.
- * @throws NoSuchAlgorithmException If no installed provider implements
- * the given algorithm.
- */
- public static SecureRandom getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] p = Security.getProviders();
-
- for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignore.
- }
- }
-
- // None found.
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Returns an instance of a SecureRandom. It creates the class
- * for the specified algorithm from the named provider.
- *
- * @param algorithm The algorithm name.
- * @param provider The provider name.
- * @return A new SecureRandom implementing the chosen algorithm.
- * @throws NoSuchAlgorithmException If the named provider does not implement
- * the algorithm, or if the implementation cannot be
- * instantiated.
- * @throws NoSuchProviderException If no provider named
- * <code>provider</code> is currently installed.
- * @throws IllegalArgumentException If <code>provider</code> is null
- * or is empty.
- */
- public static SecureRandom getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
-
- return getInstance(algorithm, p);
- }
-
- /**
- * Returns an instance of a SecureRandom. It creates the class for
- * the specified algorithm from the given provider.
- *
- * @param algorithm The SecureRandom algorithm to create.
- * @param provider The provider to get the instance from.
- * @throws NoSuchAlgorithmException If the algorithm cannot be found, or
- * if the class cannot be instantiated.
- * @throws IllegalArgumentException If <code>provider</code> is null.
- */
- public static SecureRandom getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
- try
- {
- return new SecureRandom((SecureRandomSpi)
- Engine.getInstance(SECURE_RANDOM, algorithm, provider),
- provider);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- Returns the provider being used by the current SecureRandom class.
-
- @return The provider from which this SecureRandom was attained
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- Seeds the SecureRandom. The class is re-seeded for each call and
- each seed builds on the previous seed so as not to weaken security.
-
- @param seed seed bytes to seed with
- */
- public void setSeed(byte[] seed)
- {
- secureRandomSpi.engineSetSeed(seed);
- }
-
- /**
- Seeds the SecureRandom. The class is re-seeded for each call and
- each seed builds on the previous seed so as not to weaken security.
-
- @param seed 8 seed bytes to seed with
- */
- public void setSeed(long seed)
- {
- // This particular setSeed will be called by Random.Random(), via
- // our own constructor, before secureRandomSpi is initialized. In
- // this case we can't call a method on secureRandomSpi, and we
- // definitely don't want to throw a NullPointerException.
- // Therefore we test.
- if (secureRandomSpi != null)
- {
- byte[] tmp = { (byte) (0xff & (seed >> 56)),
- (byte) (0xff & (seed >> 48)),
- (byte) (0xff & (seed >> 40)),
- (byte) (0xff & (seed >> 32)),
- (byte) (0xff & (seed >> 24)),
- (byte) (0xff & (seed >> 16)),
- (byte) (0xff & (seed >> 8)),
- (byte) (0xff & seed)
- };
- secureRandomSpi.engineSetSeed(tmp);
- }
- }
-
- /**
- Generates a user specified number of bytes. This function
- is the basis for all the random functions.
-
- @param bytes array to store generated bytes in
- */
- public void nextBytes(byte[] bytes)
- {
- randomBytesUsed += bytes.length;
- counter++;
- secureRandomSpi.engineNextBytes(bytes);
- }
-
- /**
- Generates an integer containing the user specified
- number of random bits. It is right justified and padded
- with zeros.
-
- @param numBits number of random bits to get, 0 <= numBits <= 32;
-
- @return the random bits
- */
- protected final int next(int numBits)
- {
- if (numBits == 0)
- return 0;
-
- byte[] tmp = new byte[numBits / 8 + (1 * (numBits % 8))];
-
- secureRandomSpi.engineNextBytes(tmp);
- randomBytesUsed += tmp.length;
- counter++;
-
- int ret = 0;
-
- for (int i = 0; i < tmp.length; i++)
- ret |= (tmp[i] & 0xFF) << (8 * i);
-
- long mask = (1L << numBits) - 1;
- return (int) (ret & mask);
- }
-
- /**
- Returns the given number of seed bytes. This method is
- maintained only for backwards capability.
-
- @param numBytes number of seed bytes to get
-
- @return an array containing the seed bytes
- */
- public static byte[] getSeed(int numBytes)
- {
- byte[] tmp = new byte[numBytes];
-
- new Random().nextBytes(tmp);
- return tmp;
- //return secureRandomSpi.engineGenerateSeed( numBytes );
- }
-
- /**
- Returns the specified number of seed bytes.
-
- @param numBytes number of seed bytes to get
-
- @return an array containing the seed bytes
- */
- public byte[] generateSeed(int numBytes)
- {
- return secureRandomSpi.engineGenerateSeed(numBytes);
- }
-
-}
diff --git a/libjava/java/security/SecureRandomSpi.java b/libjava/java/security/SecureRandomSpi.java
deleted file mode 100644
index 7759097a456..00000000000
--- a/libjava/java/security/SecureRandomSpi.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* SecureRandomSpi.java --- Secure Random Service Provider Interface
- Copyright (C) 1999, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-import java.io.Serializable;
-
-/**
- SecureRandomSpi is the Service Provider Interface for SecureRandom
- providers. It provides an interface for providers to the
- SecureRandom engine to write their own pseudo-random number
- generator.
-
- @since JDK 1.2
-
- @author Mark Benvenuto (ivymccough@worldnet.att.net)
- */
-public abstract class SecureRandomSpi implements Serializable
-{
- private static final long serialVersionUID = -2991854161009191830L;
-
- /**
- Default Constructor for SecureRandomSpi
- */
- public SecureRandomSpi()
- {
- }
-
- /**
- Updates the seed for SecureRandomSpi but does not reset seed.
- It does to this so repeated called never decrease randomness.
- */
- protected abstract void engineSetSeed(byte[] seed);
-
- /**
- Gets a user specified number of bytes depending on the length
- of the array?
-
- @param bytes array to fill with random bytes
- */
- protected abstract void engineNextBytes(byte[] bytes);
-
- /**
- Gets a user specified number of bytes specified by the
- parameter.
-
- @param numBytes number of random bytes to generate
-
- @return an array full of random bytes
- */
- protected abstract byte[] engineGenerateSeed(int numBytes);
-}
diff --git a/libjava/java/security/Security.java b/libjava/java/security/Security.java
deleted file mode 100644
index 54b97923efd..00000000000
--- a/libjava/java/security/Security.java
+++ /dev/null
@@ -1,740 +0,0 @@
-/* Security.java --- Java base security class implementation
- Copyright (C) 1999, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import gnu.classpath.SystemProperties;
-
-import gnu.classpath.Configuration;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- * This class centralizes all security properties and common security methods.
- * One of its primary uses is to manage providers.
- *
- * @author Mark Benvenuto (ivymccough@worldnet.att.net)
- */
-public final class Security
-{
- private static final String ALG_ALIAS = "Alg.Alias.";
-
- private static Vector providers = new Vector();
- private static Properties secprops = new Properties();
-
- static
- {
- String base = SystemProperties.getProperty("gnu.classpath.home.url");
- String vendor = SystemProperties.getProperty("gnu.classpath.vm.shortname");
-
- // Try VM specific security file
- boolean loaded = loadProviders (base, vendor);
-
- // Append classpath standard provider if possible
- if (!loadProviders (base, "classpath")
- && !loaded
- && providers.size() == 0)
- {
- if (Configuration.DEBUG)
- {
- /* No providers found and both security files failed to
- * load properly. Give a warning in case of DEBUG is
- * enabled. Could be done with java.util.logging later.
- */
- System.err.println
- ("WARNING: could not properly read security provider files:");
- System.err.println
- (" " + base + "/security/" + vendor
- + ".security");
- System.err.println
- (" " + base + "/security/" + "classpath"
- + ".security");
- System.err.println
- (" Falling back to standard GNU security provider");
- }
- providers.addElement (new gnu.java.security.provider.Gnu());
- }
- }
- // This class can't be instantiated.
- private Security()
- {
- }
-
- /**
- * Tries to load the vender specific security providers from the given
- * base URL. Returns true if the resource could be read and completely
- * parsed successfully, false otherwise.
- */
- private static boolean loadProviders(String baseUrl, String vendor)
- {
- if (baseUrl == null || vendor == null)
- return false;
-
- boolean result = true;
- String secfilestr = baseUrl + "/security/" + vendor + ".security";
- try
- {
- InputStream fin = new URL(secfilestr).openStream();
- secprops.load(fin);
-
- int i = 1;
- String name;
- while ((name = secprops.getProperty("security.provider." + i)) != null)
- {
- Exception exception = null;
- try
- {
- providers.addElement(Class.forName(name).newInstance());
- }
- catch (ClassNotFoundException x)
- {
- exception = x;
- }
- catch (InstantiationException x)
- {
- exception = x;
- }
- catch (IllegalAccessException x)
- {
- exception = x;
- }
-
- if (exception != null)
- {
- System.err.println ("WARNING: Error loading security provider "
- + name + ": " + exception);
- result = false;
- }
- i++;
- }
- }
- catch (IOException ignored)
- {
- result = false;
- }
-
- return result;
- }
-
- /**
- * Gets a specified property for an algorithm. The algorithm name should be a
- * standard name. See Appendix A in the Java Cryptography Architecture API
- * Specification &amp; Reference for information about standard algorithm
- * names. One possible use is by specialized algorithm parsers, which may map
- * classes to algorithms which they understand (much like {@link Key} parsers
- * do).
- *
- * @param algName the algorithm name.
- * @param propName the name of the property to get.
- * @return the value of the specified property.
- * @deprecated This method used to return the value of a proprietary property
- * in the master file of the "SUN" Cryptographic Service Provider in order to
- * determine how to parse algorithm-specific parameters. Use the new
- * provider-based and algorithm-independent {@link AlgorithmParameters} and
- * {@link KeyFactory} engine classes (introduced in the Java 2 platform)
- * instead.
- */
- public static String getAlgorithmProperty(String algName, String propName)
- {
- if (algName == null || propName == null)
- return null;
-
- String property = String.valueOf(propName) + "." + String.valueOf(algName);
- Provider p;
- for (Iterator i = providers.iterator(); i.hasNext(); )
- {
- p = (Provider) i.next();
- for (Iterator j = p.keySet().iterator(); j.hasNext(); )
- {
- String key = (String) j.next();
- if (key.equalsIgnoreCase(property))
- return p.getProperty(key);
- }
- }
- return null;
- }
-
- /**
- * <p>Adds a new provider, at a specified position. The position is the
- * preference order in which providers are searched for requested algorithms.
- * Note that it is not guaranteed that this preference will be respected. The
- * position is 1-based, that is, <code>1</code> is most preferred, followed by
- * <code>2</code>, and so on.</p>
- *
- * <p>If the given provider is installed at the requested position, the
- * provider that used to be at that position, and all providers with a
- * position greater than position, are shifted up one position (towards the
- * end of the list of installed providers).</p>
- *
- * <p>A provider cannot be added if it is already installed.</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with the string <code>"insertProvider."+provider.
- * getName()</code> to see if it's ok to add a new provider. If the default
- * implementation of <code>checkSecurityAccess()</code> is used (i.e., that
- * method is not overriden), then this will result in a call to the security
- * manager's <code>checkPermission()</code> method with a
- * <code>SecurityPermission("insertProvider."+provider.getName())</code>
- * permission.</p>
- *
- * @param provider the provider to be added.
- * @param position the preference position that the caller would like for
- * this provider.
- * @return the actual preference position in which the provider was added, or
- * <code>-1</code> if the provider was not added because it is already
- * installed.
- * @throws SecurityException if a security manager exists and its
- * {@link SecurityManager#checkSecurityAccess(String)} method denies access
- * to add a new provider.
- * @see #getProvider(String)
- * @see #removeProvider(String)
- * @see SecurityPermission
- */
- public static int insertProviderAt(Provider provider, int position)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("insertProvider." + provider.getName());
-
- position--;
- int max = providers.size ();
- for (int i = 0; i < max; i++)
- {
- if (((Provider) providers.elementAt(i)).getName().equals(provider.getName()))
- return -1;
- }
-
- if (position < 0)
- position = 0;
- if (position > max)
- position = max;
-
- providers.insertElementAt(provider, position);
-
- return position + 1;
- }
-
- /**
- * <p>Adds a provider to the next position available.</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with the string <code>"insertProvider."+provider.
- * getName()</code> to see if it's ok to add a new provider. If the default
- * implementation of <code>checkSecurityAccess()</code> is used (i.e., that
- * method is not overriden), then this will result in a call to the security
- * manager's <code>checkPermission()</code> method with a
- * <code>SecurityPermission("insertProvider."+provider.getName())</code>
- * permission.</p>
- *
- * @param provider the provider to be added.
- * @return the preference position in which the provider was added, or
- * <code>-1</code> if the provider was not added because it is already
- * installed.
- * @throws SecurityException if a security manager exists and its
- * {@link SecurityManager#checkSecurityAccess(String)} method denies access
- * to add a new provider.
- * @see #getProvider(String)
- * @see #removeProvider(String)
- * @see SecurityPermission
- */
- public static int addProvider(Provider provider)
- {
- return insertProviderAt (provider, providers.size () + 1);
- }
-
- /**
- * <p>Removes the provider with the specified name.</p>
- *
- * <p>When the specified provider is removed, all providers located at a
- * position greater than where the specified provider was are shifted down
- * one position (towards the head of the list of installed providers).</p>
- *
- * <p>This method returns silently if the provider is not installed.</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with the string <code>"removeProvider."+name</code>
- * to see if it's ok to remove the provider. If the default implementation of
- * <code>checkSecurityAccess()</code> is used (i.e., that method is not
- * overriden), then this will result in a call to the security manager's
- * <code>checkPermission()</code> method with a <code>SecurityPermission(
- * "removeProvider."+name)</code> permission.</p>
- *
- * @param name the name of the provider to remove.
- * @throws SecurityException if a security manager exists and its
- * {@link SecurityManager#checkSecurityAccess(String)} method denies access
- * to remove the provider.
- * @see #getProvider(String)
- * @see #addProvider(Provider)
- */
- public static void removeProvider(String name)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("removeProvider." + name);
-
- int max = providers.size ();
- for (int i = 0; i < max; i++)
- {
- if (((Provider) providers.elementAt(i)).getName().equals(name))
- {
- providers.remove(i);
- break;
- }
- }
- }
-
- /**
- * Returns an array containing all the installed providers. The order of the
- * providers in the array is their preference order.
- *
- * @return an array of all the installed providers.
- */
- public static Provider[] getProviders()
- {
- Provider[] array = new Provider[providers.size ()];
- providers.copyInto (array);
- return array;
- }
-
- /**
- * Returns the provider installed with the specified name, if any. Returns
- * <code>null</code> if no provider with the specified name is installed.
- *
- * @param name the name of the provider to get.
- * @return the provider of the specified name.
- * @see #removeProvider(String)
- * @see #addProvider(Provider)
- */
- public static Provider getProvider(String name)
- {
- Provider p;
- int max = providers.size ();
- for (int i = 0; i < max; i++)
- {
- p = (Provider) providers.elementAt(i);
- if (p.getName().equals(name))
- return p;
- }
- return null;
- }
-
- /**
- * <p>Gets a security property value.</p>
- *
- * <p>First, if there is a security manager, its <code>checkPermission()</code>
- * method is called with a <code>SecurityPermission("getProperty."+key)</code>
- * permission to see if it's ok to retrieve the specified security property
- * value.</p>
- *
- * @param key the key of the property being retrieved.
- * @return the value of the security property corresponding to key.
- * @throws SecurityException if a security manager exists and its
- * {@link SecurityManager#checkPermission(Permission)} method denies access
- * to retrieve the specified security property value.
- * @see #setProperty(String, String)
- * @see SecurityPermission
- */
- public static String getProperty(String key)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("getProperty." + key);
-
- return secprops.getProperty(key);
- }
-
- /**
- * <p>Sets a security property value.</p>
- *
- * <p>First, if there is a security manager, its <code>checkPermission()</code>
- * method is called with a <code>SecurityPermission("setProperty."+key)</code>
- * permission to see if it's ok to set the specified security property value.
- * </p>
- *
- * @param key the name of the property to be set.
- * @param datnum the value of the property to be set.
- * @throws SecurityException if a security manager exists and its
- * {@link SecurityManager#checkPermission(Permission)} method denies access
- * to set the specified security property value.
- * @see #getProperty(String)
- * @see SecurityPermission
- */
- public static void setProperty(String key, String datnum)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("setProperty." + key);
-
- secprops.put(key, datnum);
- }
-
- /**
- * Returns a Set of Strings containing the names of all available algorithms
- * or types for the specified Java cryptographic service (e.g., Signature,
- * MessageDigest, Cipher, Mac, KeyStore). Returns an empty Set if there is no
- * provider that supports the specified service. For a complete list of Java
- * cryptographic services, please see the Java Cryptography Architecture API
- * Specification &amp; Reference. Note: the returned set is immutable.
- *
- * @param serviceName the name of the Java cryptographic service (e.g.,
- * Signature, MessageDigest, Cipher, Mac, KeyStore). Note: this parameter is
- * case-insensitive.
- * @return a Set of Strings containing the names of all available algorithms
- * or types for the specified Java cryptographic service or an empty set if
- * no provider supports the specified service.
- * @since 1.4
- */
- public static Set getAlgorithms(String serviceName)
- {
- HashSet result = new HashSet();
- if (serviceName == null || serviceName.length() == 0)
- return result;
-
- serviceName = serviceName.trim();
- if (serviceName.length() == 0)
- return result;
-
- serviceName = serviceName.toUpperCase()+".";
- Provider[] providers = getProviders();
- int ndx;
- for (int i = 0; i < providers.length; i++)
- for (Enumeration e = providers[i].propertyNames(); e.hasMoreElements(); )
- {
- String service = ((String) e.nextElement()).trim();
- if (service.toUpperCase().startsWith(serviceName))
- {
- service = service.substring(serviceName.length()).trim();
- ndx = service.indexOf(' '); // get rid of attributes
- if (ndx != -1)
- service = service.substring(0, ndx);
- result.add(service);
- }
- }
- return Collections.unmodifiableSet(result);
- }
-
- /**
- * <p>Returns an array containing all installed providers that satisfy the
- * specified selection criterion, or <code>null</code> if no such providers
- * have been installed. The returned providers are ordered according to their
- * preference order.</p>
- *
- * <p>A cryptographic service is always associated with a particular
- * algorithm or type. For example, a digital signature service is always
- * associated with a particular algorithm (e.g., <i>DSA</i>), and a
- * CertificateFactory service is always associated with a particular
- * certificate type (e.g., <i>X.509</i>).</p>
- *
- * <p>The selection criterion must be specified in one of the following two
- * formats:</p>
- *
- * <ul>
- * <li><p>&lt;crypto_service&gt;.&lt;algorithm_or_type&gt;</p>
- * <p>The cryptographic service name must not contain any dots.</p>
- * <p>A provider satisfies the specified selection criterion iff the
- * provider implements the specified algorithm or type for the specified
- * cryptographic service.</p>
- * <p>For example, "CertificateFactory.X.509" would be satisfied by any
- * provider that supplied a CertificateFactory implementation for X.509
- * certificates.</p></li>
- *
- * <li><p>&lt;crypto_service&gt;.&lt;algorithm_or_type&gt; &lt;attribute_name&gt;:&lt;attribute_value&gt;</p>
- * <p>The cryptographic service name must not contain any dots. There must
- * be one or more space charaters between the the &lt;algorithm_or_type&gt;
- * and the &lt;attribute_name&gt;.</p>
- * <p>A provider satisfies this selection criterion iff the provider
- * implements the specified algorithm or type for the specified
- * cryptographic service and its implementation meets the constraint
- * expressed by the specified attribute name/value pair.</p>
- * <p>For example, "Signature.SHA1withDSA KeySize:1024" would be satisfied
- * by any provider that implemented the SHA1withDSA signature algorithm
- * with a keysize of 1024 (or larger).</p></li>
- * </ul>
- *
- * <p>See Appendix A in the Java Cryptogaphy Architecture API Specification
- * &amp; Reference for information about standard cryptographic service names,
- * standard algorithm names and standard attribute names.</p>
- *
- * @param filter the criterion for selecting providers. The filter is case-
- * insensitive.
- * @return all the installed providers that satisfy the selection criterion,
- * or null if no such providers have been installed.
- * @throws InvalidParameterException if the filter is not in the required
- * format.
- * @see #getProviders(Map)
- */
- public static Provider[] getProviders(String filter)
- {
- if (providers == null || providers.isEmpty())
- return null;
-
- if (filter == null || filter.length() == 0)
- return getProviders();
-
- HashMap map = new HashMap(1);
- int i = filter.indexOf(':');
- if (i == -1) // <service>.<algorithm>
- map.put(filter, "");
- else // <service>.<algorithm> <attribute>:<value>
- map.put(filter.substring(0, i), filter.substring(i+1));
-
- return getProviders(map);
- }
-
- /**
- * <p>Returns an array containing all installed providers that satisfy the
- * specified selection criteria, or <code>null</code> if no such providers
- * have been installed. The returned providers are ordered according to their
- * preference order.</p>
- *
- * <p>The selection criteria are represented by a map. Each map entry
- * represents a selection criterion. A provider is selected iff it satisfies
- * all selection criteria. The key for any entry in such a map must be in one
- * of the following two formats:</p>
- *
- * <ul>
- * <li><p>&lt;crypto_service&gt;.&lt;algorithm_or_type&gt;</p>
- * <p>The cryptographic service name must not contain any dots.</p>
- * <p>The value associated with the key must be an empty string.</p>
- * <p>A provider satisfies this selection criterion iff the provider
- * implements the specified algorithm or type for the specified
- * cryptographic service.</p></li>
- *
- * <li><p>&lt;crypto_service&gt;.&lt;algorithm_or_type&gt; &lt;attribute_name&gt;</p>
- * <p>The cryptographic service name must not contain any dots. There must
- * be one or more space charaters between the &lt;algorithm_or_type&gt; and
- * the &lt;attribute_name&gt;.</p>
- * <p>The value associated with the key must be a non-empty string. A
- * provider satisfies this selection criterion iff the provider implements
- * the specified algorithm or type for the specified cryptographic service
- * and its implementation meets the constraint expressed by the specified
- * attribute name/value pair.</p></li>
- * </ul>
- *
- * <p>See Appendix A in the Java Cryptogaphy Architecture API Specification
- * &amp; Reference for information about standard cryptographic service names,
- * standard algorithm names and standard attribute names.</p>
- *
- * @param filter the criteria for selecting providers. The filter is case-
- * insensitive.
- * @return all the installed providers that satisfy the selection criteria,
- * or <code>null</code> if no such providers have been installed.
- * @throws InvalidParameterException if the filter is not in the required
- * format.
- * @see #getProviders(String)
- */
- public static Provider[] getProviders(Map filter)
- {
- if (providers == null || providers.isEmpty())
- return null;
-
- if (filter == null)
- return getProviders();
-
- Set querries = filter.keySet();
- if (querries == null || querries.isEmpty())
- return getProviders();
-
- LinkedHashSet result = new LinkedHashSet(providers); // assume all
- int dot, ws;
- String querry, service, algorithm, attribute, value;
- LinkedHashSet serviceProviders = new LinkedHashSet(); // preserve insertion order
- for (Iterator i = querries.iterator(); i.hasNext(); )
- {
- querry = (String) i.next();
- if (querry == null) // all providers
- continue;
-
- querry = querry.trim();
- if (querry.length() == 0) // all providers
- continue;
-
- dot = querry.indexOf('.');
- if (dot == -1) // syntax error
- throw new InvalidParameterException(
- "missing dot in '" + String.valueOf(querry)+"'");
-
- value = (String) filter.get(querry);
- // deconstruct querry into [service, algorithm, attribute]
- if (value == null || value.trim().length() == 0) // <service>.<algorithm>
- {
- value = null;
- attribute = null;
- service = querry.substring(0, dot).trim();
- algorithm = querry.substring(dot+1).trim();
- }
- else // <service>.<algorithm> <attribute>
- {
- ws = querry.indexOf(' ');
- if (ws == -1)
- throw new InvalidParameterException(
- "value (" + String.valueOf(value) +
- ") is not empty, but querry (" + String.valueOf(querry) +
- ") is missing at least one space character");
- value = value.trim();
- attribute = querry.substring(ws+1).trim();
- // was the dot in the attribute?
- if (attribute.indexOf('.') != -1)
- throw new InvalidParameterException(
- "attribute_name (" + String.valueOf(attribute) +
- ") in querry (" + String.valueOf(querry) + ") contains a dot");
-
- querry = querry.substring(0, ws).trim();
- service = querry.substring(0, dot).trim();
- algorithm = querry.substring(dot+1).trim();
- }
-
- // service and algorithm must not be empty
- if (service.length() == 0)
- throw new InvalidParameterException(
- "<crypto_service> in querry (" + String.valueOf(querry) +
- ") is empty");
-
- if (algorithm.length() == 0)
- throw new InvalidParameterException(
- "<algorithm_or_type> in querry (" + String.valueOf(querry) +
- ") is empty");
-
- selectProviders(service, algorithm, attribute, value, result, serviceProviders);
- result.retainAll(serviceProviders); // eval next retaining found providers
- if (result.isEmpty()) // no point continuing
- break;
- }
-
- if (result.isEmpty())
- return null;
-
- return (Provider[]) result.toArray(new Provider[0]);
- }
-
- private static void selectProviders(String svc, String algo, String attr,
- String val, LinkedHashSet providerSet,
- LinkedHashSet result)
- {
- result.clear(); // ensure we start with an empty result set
- for (Iterator i = providerSet.iterator(); i.hasNext(); )
- {
- Provider p = (Provider) i.next();
- if (provides(p, svc, algo, attr, val))
- result.add(p);
- }
- }
-
- private static boolean provides(Provider p, String svc, String algo,
- String attr, String val)
- {
- Iterator it;
- String serviceDotAlgorithm = null;
- String key = null;
- String realVal;
- boolean found = false;
- // if <svc>.<algo> <attr> is in the set then so is <svc>.<algo>
- // but it may be stored under an alias <algo>. resolve
- outer: for (int r = 0; r < 3; r++) // guard against circularity
- {
- serviceDotAlgorithm = (svc+"."+String.valueOf(algo)).trim();
- for (it = p.keySet().iterator(); it.hasNext(); )
- {
- key = (String) it.next();
- if (key.equalsIgnoreCase(serviceDotAlgorithm)) // eureka
- {
- found = true;
- break outer;
- }
- // it may be there but as an alias
- if (key.equalsIgnoreCase(ALG_ALIAS + serviceDotAlgorithm))
- {
- algo = p.getProperty(key);
- continue outer;
- }
- // else continue inner
- }
- }
-
- if (!found)
- return false;
-
- // found a candidate for the querry. do we have an attr to match?
- if (val == null) // <service>.<algorithm> querry
- return true;
-
- // <service>.<algorithm> <attribute>; find the key entry that match
- String realAttr;
- int limit = serviceDotAlgorithm.length() + 1;
- for (it = p.keySet().iterator(); it.hasNext(); )
- {
- key = (String) it.next();
- if (key.length() <= limit)
- continue;
-
- if (key.substring(0, limit).equalsIgnoreCase(serviceDotAlgorithm+" "))
- {
- realAttr = key.substring(limit).trim();
- if (! realAttr.equalsIgnoreCase(attr))
- continue;
-
- // eveything matches so far. do the value
- realVal = p.getProperty(key);
- if (realVal == null)
- return false;
-
- realVal = realVal.trim();
- // is it a string value?
- if (val.equalsIgnoreCase(realVal))
- return true;
-
- // assume value is a number. cehck for greater-than-or-equal
- return (new Integer(val).intValue() >= new Integer(realVal).intValue());
- }
- }
-
- return false;
- }
-}
diff --git a/libjava/java/security/SecurityPermission.java b/libjava/java/security/SecurityPermission.java
deleted file mode 100644
index 6aba18f346e..00000000000
--- a/libjava/java/security/SecurityPermission.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/* SecurityPermission.java -- Class for named security permissions
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This class provides a mechanism for specified named permissions
- * related to the Java security framework. These permissions have no
- * associated actions list. They are either granted or not granted.
- *
- * <p>The list of valid permission names is:<br>
- * <table border=1>
- * <tr><th>Permission Name</th><th>Permission Allows</th><th>Risks</th</tr>
- * <tr>
- * <td><code>createAccessControlContext</code></td>
- * <td>Allows creation of an AccessControlContext</td>
- * <td>The new control context can have a rogue DomainCombiner, leading
- * to a privacy leak</td></tr>
- * <tr>
- * <td><code>getDomainCombiner</code></td>
- * <td>Get a DomainCombiner from an AccessControlContext</td>
- * <td>Access to a DomainCombiner can lead to a privacy leak</td></tr>
- * <tr>
- * <td><code>getPolicy</code></td>
- * <td>Allows retrieval of the system security policy</td>
- * <td>Malicious code can use information from the policy to better plan
- * an attack</td></tr>
- * <tr>
- * <td><code>setPolicy</code></td>
- * <td>Allows the security policy to be changed</td>
- * <td>Malicious code can give itself any permission it wants</td></tr>
- * <tr>
- * <td><code>getProperty.</code><em>key</em></td>
- * <td>Retrieve the property specified by the key</td>
- * <td>Malicious code can use information from the property to better plan
- * an attack</td></tr>
- * <tr>
- * <td><code>setProperty.</code><em>key</em></td>
- * <td>Allows changing of the value of all properties implied by key</td>
- * <td>Malicious code can insert rogue classes to steal keys or recreate
- * the security policy with whatever permissions it desires</td></tr>
- * <tr>
- * <td><code>insertProvider.</code><em>key</em></td>
- * <td>Allows the named provider to be added</td>
- * <td>Malicious code can insert rogue providers that steal data</td></tr>
- * <tr>
- * <td><code>removeProvider.</code><em>key</em></td>
- * <td>Allows the named provider to be removed</td>
- * <td>A missing provider can cripple code that relies on it</td></tr>
- * <tr>
- * <td><code>setSystemScope</code></td>
- * <td>Allows the system identity scope to be set</td>
- * <td>Malicious code can add certificates not available in the original
- * identity scope, to gain more permissions</td></tr>
- * <tr>
- * <td><code>setIdentityPublicKey</code></td>
- * <td>Allows the public key of an Identity to be set</td>
- * <td>Malicious code can install its own key to gain permissions not
- * allowed by the original identity scope</td></tr>
- * <tr>
- * <td><code>SetIdentityInfo</code></td>
- * <td>Allows the description of an Identity to be set</td>
- * <td>Malicious code can spoof users into trusting a fake identity</td></tr>
- * <tr>
- * <td><code>addIdentityCertificate</code></td>
- * <td>Allows a certificate to be set for the public key of an identity</td>
- * <td>The public key can become trusted to a wider audience than originally
- * intended</td></tr>
- * <tr>
- * <td><code>removeIdentityCertificate</code></td>
- * <td>Allows removal of a certificate from an identity's public key</td>
- * <td>The public key can become less trusted than it should be</td></tr>
- * <tr>
- * <td><code>printIdentity</code></td>
- * <td>View the name of the identity and scope, and whether they are
- * trusted</td>
- * <td>The scope may include a filename, which provides an entry point for
- * further security breaches</td></tr>
- * <tr>
- * <td><code>clearProviderProperties.</code><em>key</em></td>
- * <td>Allows the properties of the named provider to be cleared</td>
- * <td>This can disable parts of the program which depend on finding the
- * provider</td></tr>
- * <tr>
- * <td><code>putProviderProperty.</code><em>key</em></td>
- * <td>Allows the properties of the named provider to be changed</td>
- * <td>Malicious code can replace the implementation of a provider</td></tr>
- * <tr>
- * <td><code>removeProviderProperty.</code><em>key</em></td>
- * <td>Allows the properties of the named provider to be deleted</td>
- * <td>This can disable parts of the program which depend on finding the
- * provider</td></tr>
- * <tr>
- * <td><code>getSignerPrivateKey</code></td>
- * <td>Allows the retrieval of the private key for a signer</td>
- * <td>Anyone that can access the private key can claim to be the
- * Signer</td></tr>
- * <tr>
- * <td><code>setSignerKeyPair</code></td>
- * <td>Allows the public and private key of a Signer to be changed</td>
- * <td>The replacement might be a weaker encryption, or the attacker
- * can use knowledge of the replaced key to decrypt an entire
- * communication session</td></tr>
- * </table>
- *
- * <p>There is some degree of security risk in granting any of these
- * permissions. Some of them can completely compromise system security.
- * Please exercise extreme caution in granting these permissions.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Permission
- * @see SecurityManager
- * @since 1.1
- * @status updated to 1.4
- */
-public final class SecurityPermission extends BasicPermission
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 5236109936224050470L;
-
- /**
- * Create a new instance with the specified name.
- *
- * @param name the name to assign to this permission
- */
- public SecurityPermission(String name)
- {
- super(name);
- }
-
- /**
- * Create a new instance with the specified name. As SecurityPermission
- * carries no actions, the second parameter is ignored.
- *
- * @param name the name to assign to this permission
- * @param actions ignored
- */
- public SecurityPermission(String name, String actions)
- {
- super(name);
- }
-} // class SecurityPermission
diff --git a/libjava/java/security/Signature.java b/libjava/java/security/Signature.java
deleted file mode 100644
index 852c959220f..00000000000
--- a/libjava/java/security/Signature.java
+++ /dev/null
@@ -1,636 +0,0 @@
-/* Signature.java --- Signature Class
- Copyright (C) 1999, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import gnu.java.security.Engine;
-
-import java.security.cert.Certificate;
-import java.security.cert.X509Certificate;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * <p>This <code>Signature</code> class is used to provide applications the
- * functionality of a digital signature algorithm. Digital signatures are used
- * for authentication and integrity assurance of digital data.</p>
- *
- * <p>The signature algorithm can be, among others, the NIST standard <i>DSS</i>,
- * using <i>DSA</i> and <i>SHA-1</i>. The <i>DSA</i> algorithm using the
- * <i>SHA-1</i> message digest algorithm can be specified as <code>SHA1withDSA
- * </code>. In the case of <i>RSA</i>, there are multiple choices for the
- * message digest algorithm, so the signing algorithm could be specified as, for
- * example, <code>MD2withRSA</code>, <code>MD5withRSA</code>, or
- * <code>SHA1withRSA</code>. The algorithm name must be specified, as there is
- * no default.</p>
- *
- * <p>Like other algorithm-based classes in Java Security, <code>Signature</code>
- * provides implementation-independent algorithms, whereby a caller (application
- * code) requests a particular signature algorithm and is handed back a properly
- * initialized <code>Signature</code> object. It is also possible, if desired,
- * to request a particular algorithm from a particular provider. See the
- * <code>getInstance()</code> methods.</p>
- *
- * <p>Thus, there are two ways to request a <code>Signature</code> algorithm
- * object: by specifying either just an algorithm name, or both an algorithm
- * name and a package provider.</p>
- *
- * <p>If just an algorithm name is specified, the system will determine if there
- * is an implementation of the algorithm requested available in the environment,
- * and if there is more than one, if there is a preferred one.</p>
- *
- * <p>If both an algorithm name and a package provider are specified, the system
- * will determine if there is an implementation of the algorithm in the package
- * requested, and throw an exception if there is not.</p>
- *
- * <p>A <code>Signature</code> object can be used to generate and verify digital
- * signatures.</p>
- *
- * <p>There are three phases to the use of a <code>Signature</code> object for
- * either signing data or verifying a signature:</p>
- *
- * <ol>
- * <li>Initialization, with either
- * <ul>
- * <li>a public key, which initializes the signature for verification
- * (see <code>initVerify()</code>), or</li>
- * <li>a private key (and optionally a Secure Random Number Generator),
- * which initializes the signature for signing (see
- * {@link #initSign(PrivateKey)} and {@link #initSign(PrivateKey, SecureRandom)}
- * ).</li>
- * </ul></li>
- * <li>Updating<br/>
- * Depending on the type of initialization, this will update the bytes to
- * be signed or verified. See the update methods.<br/></li>
- * <li>Signing or Verifying a signature on all updated bytes. See the
- * <code>sign()</code> methods and the <code>verify()</code> method.</li>
- * </ol>
- *
- * <p>Note that this class is abstract and extends from {@link SignatureSpi} for
- * historical reasons. Application developers should only take notice of the
- * methods defined in this <code>Signature</code> class; all the methods in the
- * superclass are intended for cryptographic service providers who wish to
- * supply their own implementations of digital signature algorithms.
- *
- * @author Mark Benvenuto (ivymccough@worldnet.att.net)
- */
-public abstract class Signature extends SignatureSpi
-{
- /** Service name for signatures. */
- private static final String SIGNATURE = "Signature";
-
- /**
- * Possible <code>state</code> value, signifying that this signature object
- * has not yet been initialized.
- */
- protected static final int UNINITIALIZED = 0;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Possible <code>state</code> value, signifying that this signature object
- * has been initialized for signing.
- */
- protected static final int SIGN = 2;
-
- /**
- * Possible <code>state</code> value, signifying that this signature object
- * has been initialized for verification.
- */
- protected static final int VERIFY = 3;
-
- /** Current state of this signature object. */
- protected int state = UNINITIALIZED;
-
- private String algorithm;
- Provider provider;
-
- /**
- * Creates a <code>Signature</code> object for the specified algorithm.
- *
- * @param algorithm the standard string name of the algorithm. See Appendix A
- * in the Java Cryptography Architecture API Specification &amp; Reference for
- * information about standard algorithm names.
- */
- protected Signature(String algorithm)
- {
- this.algorithm = algorithm;
- state = UNINITIALIZED;
- }
-
- /**
- * Generates a <code>Signature</code> object that implements the specified
- * digest algorithm. If the default provider package provides an
- * implementation of the requested digest algorithm, an instance of
- * <code>Signature</code> containing that implementation is returned. If the
- * algorithm is not available in the default package, other packages are
- * searched.
- *
- * @param algorithm the standard name of the algorithm requested. See Appendix
- * A in the Java Cryptography Architecture API Specification &amp; Reference
- * for information about standard algorithm names.
- * @return the new Signature object.
- * @throws NoSuchAlgorithmException if the algorithm is not available in the
- * environment.
- */
- public static Signature getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] p = Security.getProviders();
- for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignored.
- }
- }
-
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Generates a <code>Signature</code> object implementing the specified
- * algorithm, as supplied from the specified provider, if such an algorithm
- * is available from the provider.
- *
- * @param algorithm the name of the algorithm requested. See Appendix A in
- * the Java Cryptography Architecture API Specification &amp; Reference for
- * information about standard algorithm names.
- * @param provider the name of the provider.
- * @return the new <code>Signature</code> object.
- * @throws NoSuchAlgorithmException if the algorithm is not available in the
- * package supplied by the requested provider.
- * @throws NoSuchProviderException if the provider is not available in the
- * environment.
- * @throws IllegalArgumentException if the provider name is <code>null</code>
- * or empty.
- * @see Provider
- */
- public static Signature getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
-
- return getInstance(algorithm, p);
- }
-
- /**
- * Generates a <code>Signature</code> object implementing the specified
- * algorithm, as supplied from the specified provider, if such an algorithm
- * is available from the provider. Note: the provider doesn't have to be
- * registered.
- *
- * @param algorithm the name of the algorithm requested. See Appendix A in
- * the Java Cryptography Architecture API Specification &amp; Reference for
- * information about standard algorithm names.
- * @param provider the provider.
- * @return the new <code>Signature</code> object.
- * @throws NoSuchAlgorithmException if the <code>algorithm</code> is not
- * available in the package supplied by the requested <code>provider</code>.
- * @throws IllegalArgumentException if the <code>provider</code> is
- * <code>null</code>.
- * @since 1.4
- * @see Provider
- */
- public static Signature getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
- Signature result = null;
- Object o = null;
- try
- {
- o = Engine.getInstance(SIGNATURE, algorithm, provider);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- if (o instanceof SignatureSpi)
- {
- result = new DummySignature((SignatureSpi) o, algorithm);
- }
- else if (o instanceof Signature)
- {
- result = (Signature) o;
- result.algorithm = algorithm;
- }
- else
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- result.provider = provider;
- return result;
- }
-
- /**
- * Returns the provider of this signature object.
- *
- * @return the provider of this signature object.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Initializes this object for verification. If this method is called again
- * with a different argument, it negates the effect of this call.
- *
- * @param publicKey the public key of the identity whose signature is going
- * to be verified.
- * @throws InvalidKeyException if the key is invalid.
- */
- public final void initVerify(PublicKey publicKey) throws InvalidKeyException
- {
- state = VERIFY;
- engineInitVerify(publicKey);
- }
-
- /**
- * <p>Initializes this object for verification, using the public key from the
- * given certificate.</p>
- *
- * <p>If the certificate is of type <i>X.509</i> and has a <i>key usage</i>
- * extension field marked as <i>critical</i>, and the value of the <i>key
- * usage</i> extension field implies that the public key in the certificate
- * and its corresponding private key are not supposed to be used for digital
- * signatures, an {@link InvalidKeyException} is thrown.</p>
- *
- * @param certificate the certificate of the identity whose signature is
- * going to be verified.
- * @throws InvalidKeyException if the public key in the certificate is not
- * encoded properly or does not include required parameter information or
- * cannot be used for digital signature purposes.
- */
- public final void initVerify(Certificate certificate)
- throws InvalidKeyException
- {
- state = VERIFY;
- if (certificate.getType().equals("X509"))
- {
- X509Certificate cert = (X509Certificate) certificate;
- boolean[]array = cert.getKeyUsage();
- if (array != null && array[0] == false)
- throw new InvalidKeyException(
- "KeyUsage of this Certificate indicates it cannot be used for digital signing");
- }
- this.initVerify(certificate.getPublicKey());
- }
-
- /**
- * Initialize this object for signing. If this method is called again with a
- * different argument, it negates the effect of this call.
- *
- * @param privateKey the private key of the identity whose signature is going
- * to be generated.
- * @throws InvalidKeyException if the key is invalid.
- */
- public final void initSign(PrivateKey privateKey) throws InvalidKeyException
- {
- state = SIGN;
- engineInitSign(privateKey);
- }
-
- /**
- * Initialize this object for signing. If this method is called again with a
- * different argument, it negates the effect of this call.
- *
- * @param privateKey the private key of the identity whose signature is going
- * to be generated.
- * @param random the source of randomness for this signature.
- * @throws InvalidKeyException if the key is invalid.
- */
- public final void initSign(PrivateKey privateKey, SecureRandom random)
- throws InvalidKeyException
- {
- state = SIGN;
- engineInitSign(privateKey, random);
- }
-
- /**
- * <p>Returns the signature bytes of all the data updated. The format of the
- * signature depends on the underlying signature scheme.</p>
- *
- * <p>A call to this method resets this signature object to the state it was
- * in when previously initialized for signing via a call to
- * <code>initSign(PrivateKey)</code>. That is, the object is reset and
- * available to generate another signature from the same signer, if desired,
- * via new calls to <code>update()</code> and <code>sign()</code>.</p>
- *
- * @return the signature bytes of the signing operation's result.
- * @throws SignatureException if this signature object is not initialized
- * properly.
- */
- public final byte[] sign() throws SignatureException
- {
- if (state == SIGN)
- return engineSign();
- else
- throw new SignatureException();
- }
-
- /**
- * <p>Finishes the signature operation and stores the resulting signature
- * bytes in the provided buffer <code>outbuf</code>, starting at <code>offset
- * </code>. The format of the signature depends on the underlying signature
- * scheme.</p>
- *
- * <p>This signature object is reset to its initial state (the state it was
- * in after a call to one of the <code>initSign()</code> methods) and can be
- * reused to generate further signatures with the same private key.</p>
- *
- * @param outbuf buffer for the signature result.
- * @param offset offset into outbuf where the signature is stored.
- * @param len number of bytes within outbuf allotted for the signature.
- * @return the number of bytes placed into outbuf.
- * @throws SignatureException if an error occurs or len is less than the
- * actual signature length.
- * @since 1.2
- */
- public final int sign(byte[] outbuf, int offset, int len)
- throws SignatureException
- {
- if (state == SIGN)
- return engineSign(outbuf, offset, len);
- else
- throw new SignatureException();
- }
-
- /**
- * <p>Verifies the passed-in signature.</p>
- *
- * <p>A call to this method resets this signature object to the state it was
- * in when previously initialized for verification via a call to
- * <code>initVerify(PublicKey)</code>. That is, the object is reset and
- * available to verify another signature from the identity whose public key
- * was specified in the call to <code>initVerify()</code>.</p>
- *
- * @param signature the signature bytes to be verified.
- * @return <code>true</code> if the signature was verified, <code>false</code>
- * if not.
- * @throws SignatureException if this signature object is not initialized
- * properly, or the passed-in signature is improperly encoded or of the wrong
- * type, etc.
- */
- public final boolean verify(byte[]signature) throws SignatureException
- {
- if (state == VERIFY)
- return engineVerify(signature);
- else
- throw new SignatureException();
- }
-
- /**
- * <p>Verifies the passed-in <code>signature</code> in the specified array of
- * bytes, starting at the specified <code>offset</code>.</p>
- *
- * <p>A call to this method resets this signature object to the state it was
- * in when previously initialized for verification via a call to
- * <code>initVerify(PublicKey)</code>. That is, the object is reset and
- * available to verify another signature from the identity whose public key
- * was specified in the call to <code>initVerify()</code>.</p>
- *
- * @param signature the signature bytes to be verified.
- * @param offset the offset to start from in the array of bytes.
- * @param length the number of bytes to use, starting at offset.
- * @return <code>true</code> if the signature was verified, <code>false</code>
- * if not.
- * @throws SignatureException if this signature object is not initialized
- * properly, or the passed-in <code>signature</code> is improperly encoded or
- * of the wrong type, etc.
- * @throws IllegalArgumentException if the <code>signature</code> byte array
- * is <code>null</code>, or the <code>offset</code> or <code>length</code> is
- * less than <code>0</code>, or the sum of the <code>offset</code> and
- * <code>length</code> is greater than the length of the <code>signature</code>
- * byte array.
- */
- public final boolean verify(byte[] signature, int offset, int length)
- throws SignatureException
- {
- if (state != VERIFY)
- throw new SignatureException("illegal state");
-
- if (signature == null)
- throw new IllegalArgumentException("signature is null");
- if (offset < 0)
- throw new IllegalArgumentException("offset is less than 0");
- if (length < 0)
- throw new IllegalArgumentException("length is less than 0");
- if (offset + length < signature.length)
- throw new IllegalArgumentException("range is out of bounds");
-
- return engineVerify(signature, offset, length);
- }
-
- /**
- * Updates the data to be signed or verified by a byte.
- *
- * @param b the byte to use for the update.
- * @throws SignatureException if this signature object is not initialized
- * properly.
- */
- public final void update(byte b) throws SignatureException
- {
- if (state != UNINITIALIZED)
- engineUpdate(b);
- else
- throw new SignatureException();
- }
-
- /**
- * Updates the data to be signed or verified, using the specified array of
- * bytes.
- *
- * @param data the byte array to use for the update.
- * @throws SignatureException if this signature object is not initialized
- * properly.
- */
- public final void update(byte[]data) throws SignatureException
- {
- if (state != UNINITIALIZED)
- engineUpdate(data, 0, data.length);
- else
- throw new SignatureException();
- }
-
- /**
- * Updates the data to be signed or verified, using the specified array of
- * bytes, starting at the specified offset.
- *
- * @param data the array of bytes.
- * @param off the offset to start from in the array of bytes.
- * @param len the number of bytes to use, starting at offset.
- * @throws SignatureException if this signature object is not initialized
- * properly.
- */
- public final void update(byte[]data, int off, int len)
- throws SignatureException
- {
- if (state != UNINITIALIZED)
- engineUpdate(data, off, len);
- else
- throw new SignatureException();
- }
-
- /**
- * Returns the name of the algorithm for this signature object.
- *
- * @return the name of the algorithm for this signature object.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Returns a string representation of this signature object, providing
- * information that includes the state of the object and the name of the
- * algorithm used.
- *
- * @return a string representation of this signature object.
- */
- public String toString()
- {
- return (algorithm + " Signature");
- }
-
- /**
- * Sets the specified algorithm parameter to the specified value. This method
- * supplies a general-purpose mechanism through which it is possible to set
- * the various parameters of this object. A parameter may be any settable
- * parameter for the algorithm, such as a parameter size, or a source of
- * random bits for signature generation (if appropriate), or an indication of
- * whether or not to perform a specific but optional computation. A uniform
- * algorithm-specific naming scheme for each parameter is desirable but left
- * unspecified at this time.
- *
- * @param param the string identifier of the parameter.
- * @param value the parameter value.
- * @throws InvalidParameterException if param is an invalid parameter for this
- * signature algorithm engine, the parameter is already set and cannot be set
- * again, a security exception occurs, and so on.
- * @see #getParameter(String)
- * @deprecated Use setParameter(AlgorithmParameterSpec).
- */
- public final void setParameter(String param, Object value)
- throws InvalidParameterException
- {
- engineSetParameter(param, value);
- }
-
- /**
- * Initializes this signature engine with the specified parameter set.
- *
- * @param params the parameters.
- * @throws InvalidAlgorithmParameterException if the given parameters are
- * inappropriate for this signature engine.
- * @see #getParameters()
- */
- public final void setParameter(AlgorithmParameterSpec params)
- throws InvalidAlgorithmParameterException
- {
- engineSetParameter(params);
- }
-
- /**
- * <p>Returns the parameters used with this signature object.</p>
- *
- * <p>The returned parameters may be the same that were used to initialize
- * this signature, or may contain a combination of default and randomly
- * generated parameter values used by the underlying signature implementation
- * if this signature requires algorithm parameters but was not initialized
- * with any.
- *
- * @return the parameters used with this signature, or <code>null</code> if
- * this signature does not use any parameters.
- * @see #setParameter(AlgorithmParameterSpec)
- */
- public final AlgorithmParameters getParameters()
- {
- return engineGetParameters();
- }
-
- /**
- * Gets the value of the specified algorithm parameter. This method supplies
- * a general-purpose mechanism through which it is possible to get the various
- * parameters of this object. A parameter may be any settable parameter for
- * the algorithm, such as a parameter size, or a source of random bits for
- * signature generation (if appropriate), or an indication of whether or not
- * to perform a specific but optional computation. A uniform
- * algorithm-specific naming scheme for each parameter is desirable but left
- * unspecified at this time.
- *
- * @param param the string name of the parameter.
- * @return the object that represents the parameter value, or null if there
- * is none.
- * @throws InvalidParameterException if param is an invalid parameter for this
- * engine, or another exception occurs while trying to get this parameter.
- * @see #setParameter(String, Object)
- * @deprecated
- */
- public final Object getParameter(String param)
- throws InvalidParameterException
- {
- return engineGetParameter(param);
- }
-
- /**
- * Returns a clone if the implementation is cloneable.
- *
- * @return a clone if the implementation is cloneable.
- * @throws CloneNotSupportedException if this is called on an implementation
- * that does not support {@link Cloneable}.
- */
- public Object clone() throws CloneNotSupportedException
- {
- return super.clone();
- }
-}
diff --git a/libjava/java/security/SignatureException.java b/libjava/java/security/SignatureException.java
deleted file mode 100644
index e294c16c3f6..00000000000
--- a/libjava/java/security/SignatureException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* SignatureException.java -- Generic error in signature
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This exception is thrown when a problem is encountered with a
- * digital signature.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class SignatureException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 7509989324975124438L;
-
- /**
- * Create an instance with no descriptive error message.
- */
- public SignatureException()
- {
- }
-
- /**
- * Create an instance with a descriptive error message.
- *
- * @param msg the message
- */
- public SignatureException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/SignatureSpi.java b/libjava/java/security/SignatureSpi.java
deleted file mode 100644
index 471a73d17cd..00000000000
--- a/libjava/java/security/SignatureSpi.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/* SignatureSpi.java --- Signature Service Provider Interface
- Copyright (C) 1999, 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * <p>This class defines the <i>Service Provider Interface (SPI)</i> for the
- * {@link Signature} class, which is used to provide the functionality of a
- * digital signature algorithm. Digital signatures are used for authentication
- * and integrity assurance of digital data.</p>
- *
- * <p>All the abstract methods in this class must be implemented by each
- * cryptographic service provider who wishes to supply the implementation of a
- * particular signature algorithm.
- *
- * @author Mark Benvenuto (ivymccough@worldnet.att.net)
- * @since 1.2
- * @see Signature
- */
-public abstract class SignatureSpi
-{
- /** Application-specified source of randomness. */
- protected SecureRandom appRandom;
-
- public SignatureSpi()
- {
- appRandom = null;
- }
-
- /**
- * Initializes this signature object with the specified public key for
- * verification operations.
- *
- * @param publicKey the public key of the identity whose signature is going
- * to be verified.
- * @throws InvalidKeyException if the key is improperly encoded, parameters
- * are missing, and so on.
- */
- protected abstract void engineInitVerify(PublicKey publicKey)
- throws InvalidKeyException;
-
- /**
- * Initializes this signature object with the specified private key for
- * signing operations.
- *
- * @param privateKey the private key of the identity whose signature will be
- * generated.
- * @throws InvalidKeyException if the key is improperly encoded, parameters
- * are missing, and so on.
- */
- protected abstract void engineInitSign(PrivateKey privateKey)
- throws InvalidKeyException;
-
- /**
- * <p>Initializes this signature object with the specified private key and
- * source of randomness for signing operations.</p>
- *
- * <p>This concrete method has been added to this previously-defined abstract
- * class. (For backwards compatibility, it cannot be abstract.)</p>
- *
- * @param privateKey the private key of the identity whose signature will be
- * generated.
- * @param random the source of randomness.
- * @throws InvalidKeyException if the key is improperly encoded, parameters
- * are missing, and so on.
- * @since 1.2
- */
- protected void engineInitSign(PrivateKey privateKey, SecureRandom random)
- throws InvalidKeyException
- {
- appRandom = random;
- engineInitSign(privateKey);
- }
-
- /**
- * Updates the data to be signed or verified using the specified byte.
- *
- * @param b the byte to use for the update.
- * @throws SignatureException if the engine is not initialized properly.
- */
- protected abstract void engineUpdate(byte b) throws SignatureException;
-
- /**
- * Updates the data to be signed or verified, using the specified array of
- * bytes, starting at the specified offset.
- *
- * @param b the array of bytes.
- * @param off the offset to start from in the array of bytes.
- * @param len the number of bytes to use, starting at offset.
- * @throws SignatureException if the engine is not initialized properly.
- */
- protected abstract void engineUpdate(byte[] b, int off, int len)
- throws SignatureException;
-
- /**
- * Returns the signature bytes of all the data updated so far. The format of
- * the signature depends on the underlying signature scheme.
- *
- * @return the signature bytes of the signing operation's result.
- * @throws SignatureException if the engine is not initialized properly.
- */
- protected abstract byte[] engineSign() throws SignatureException;
-
- /**
- * <p>Finishes this signature operation and stores the resulting signature
- * bytes in the provided buffer <code>outbuf</code>, starting at <code>offset
- * </code>. The format of the signature depends on the underlying signature
- * scheme.</p>
- *
- * <p>The signature implementation is reset to its initial state (the state it
- * was in after a call to one of the <code>engineInitSign()</code> methods)
- * and can be reused to generate further signatures with the same private key.
- * This method should be abstract, but we leave it concrete for binary
- * compatibility. Knowledgeable providers should override this method.</p>
- *
- * @param outbuf buffer for the signature result.
- * @param offset offset into outbuf where the signature is stored.
- * @param len number of bytes within outbuf allotted for the signature. Both
- * this default implementation and the <b>GNU</b> provider do not return
- * partial digests. If the value of this parameter is less than the actual
- * signature length, this method will throw a {@link SignatureException}. This
- * parameter is ignored if its value is greater than or equal to the actual
- * signature length.
- * @return the number of bytes placed into <code>outbuf</code>.
- * @throws SignatureException if an error occurs or len is less than the
- * actual signature length.
- * @since 1.2
- */
- protected int engineSign(byte[] outbuf, int offset, int len)
- throws SignatureException
- {
- byte[] tmp = engineSign();
- if (tmp.length > len)
- throw new SignatureException("Invalid Length");
-
- System.arraycopy(outbuf, offset, tmp, 0, tmp.length);
- return tmp.length;
- }
-
- /**
- * Verifies the passed-in signature.
- *
- * @param sigBytes the signature bytes to be verified.
- * @return <code>true</code> if the signature was verified, <code>false</code>
- * if not.
- * @throws SignatureException if the engine is not initialized properly, or
- * the passed-in signature is improperly encoded or of the wrong type, etc.
- */
- protected abstract boolean engineVerify(byte[] sigBytes)
- throws SignatureException;
-
- /**
- * <p>Verifies the passed-in <code>signature</code> in the specified array of
- * bytes, starting at the specified <code>offset</code>.</p>
- *
- * <p>Note: Subclasses should overwrite the default implementation.</p>
- *
- * @param sigBytes the signature bytes to be verified.
- * @param offset the offset to start from in the array of bytes.
- * @param length the number of bytes to use, starting at offset.
- * @return <code>true</code> if the signature was verified, <code>false</code>
- * if not.
- * @throws SignatureException if the engine is not initialized properly, or
- * the passed-in <code>signature</code> is improperly encoded or of the wrong
- * type, etc.
- */
- protected boolean engineVerify(byte[] sigBytes, int offset, int length)
- throws SignatureException
- {
- byte[] tmp = new byte[length];
- System.arraycopy(sigBytes, offset, tmp, 0, length);
- return engineVerify(tmp);
- }
-
- /**
- * Sets the specified algorithm parameter to the specified value. This method
- * supplies a general-purpose mechanism through which it is possible to set
- * the various parameters of this object. A parameter may be any settable
- * parameter for the algorithm, such as a parameter size, or a source of
- * random bits for signature generation (if appropriate), or an indication of
- * whether or not to perform a specific but optional computation. A uniform
- * algorithm-specific naming scheme for each parameter is desirable but left
- * unspecified at this time.
- *
- * @param param the string identifier of the parameter.
- * @param value the parameter value.
- * @throws InvalidParameterException if <code>param</code> is an invalid
- * parameter for this signature algorithm engine, the parameter is already set
- * and cannot be set again, a security exception occurs, and so on.
- * @deprecated Replaced by engineSetParameter(AlgorithmParameterSpec).
- */
- protected abstract void engineSetParameter(String param, Object value)
- throws InvalidParameterException;
-
- /**
- * This method is overridden by providers to initialize this signature engine
- * with the specified parameter set.
- *
- * @param params the parameters.
- * @throws UnsupportedOperationException if this method is not overridden by
- * a provider.
- * @throws InvalidAlgorithmParameterException if this method is overridden by
- * a provider and the the given parameters are inappropriate for this
- * signature engine.
- */
- protected void engineSetParameter(AlgorithmParameterSpec params)
- throws InvalidAlgorithmParameterException
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * <p>This method is overridden by providers to return the parameters used
- * with this signature engine, or <code>null</code> if this signature engine
- * does not use any parameters.</p>
- *
- * <p>The returned parameters may be the same that were used to initialize
- * this signature engine, or may contain a combination of default and randomly
- * generated parameter values used by the underlying signature implementation
- * if this signature engine requires algorithm parameters but was not
- * initialized with any.</p>
- *
- * @return the parameters used with this signature engine, or <code>null</code>
- * if this signature engine does not use any parameters.
- * @throws UnsupportedOperationException if this method is not overridden by
- * a provider.
- */
- protected AlgorithmParameters engineGetParameters()
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Gets the value of the specified algorithm parameter. This method supplies
- * a general-purpose mechanism through which it is possible to get the various
- * parameters of this object. A parameter may be any settable parameter for
- * the algorithm, such as a parameter size, or a source of random bits for
- * signature generation (if appropriate), or an indication of whether or not
- * to perform a specific but optional computation. A uniform algorithm-specific
- * naming scheme for each parameter is desirable but left unspecified at this
- * time.
- *
- * @param param the string name of the parameter.
- * @return the object that represents the parameter value, or <code>null</code>
- * if there is none.
- * @throws InvalidParameterException if <code>param</code> is an invalid
- * parameter for this engine, or another exception occurs while trying to get
- * this parameter.
- * @deprecated
- */
- protected abstract Object engineGetParameter(String param)
- throws InvalidParameterException;
-
- /**
- * Returns a clone if the implementation is cloneable.
- *
- * @return a clone if the implementation is cloneable.
- * @throws CloneNotSupportedException if this is called on an implementation
- * that does not support {@link Cloneable}.
- * @see Cloneable
- */
- public Object clone() throws CloneNotSupportedException
- {
- return super.clone();
- }
-}
diff --git a/libjava/java/security/SignedObject.java b/libjava/java/security/SignedObject.java
deleted file mode 100644
index d565b2ea3b4..00000000000
--- a/libjava/java/security/SignedObject.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/* SignedObject.java --- Signed Object Class
- Copyright (C) 1999, 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-/**
- * <p><code>SignedObject</code> is a class for the purpose of creating authentic
- * runtime objects whose integrity cannot be compromised without being detected.
- * </p>
- *
- * <p>More specifically, a <code>SignedObject</code> contains another
- * {@link Serializable} object, the (to-be-)signed object and its signature.</p>
- *
- * <p>The signed object is a <i>"deep copy"</i> (in serialized form) of an
- * original object. Once the copy is made, further manipulation of the original
- * object has no side effect on the copy.</p>
- *
- * <p>The underlying signing algorithm is designated by the {@link Signature}
- * object passed to the constructor and the <code>verify()</code> method. A
- * typical usage for signing is the following:</p>
- *
- * <pre>
- * Signature signingEngine = Signature.getInstance(algorithm, provider);
- * SignedObject so = new SignedObject(myobject, signingKey, signingEngine);
- * </pre>
- *
- * <p>A typical usage for verification is the following (having received
- * <code>SignedObject</code> so):</p>
- *
- * <pre>
- * Signature verificationEngine = Signature.getInstance(algorithm, provider);
- * if (so.verify(publickey, verificationEngine))
- * try
- * {
- * Object myobj = so.getObject();
- * }
- * catch (ClassNotFoundException ignored) {};
- * </pre>
- *
- * <p>Several points are worth noting. First, there is no need to initialize the
- * signing or verification engine, as it will be re-initialized inside the
- * constructor and the <code>verify()</code> method. Secondly, for verification
- * to succeed, the specified public key must be the public key corresponding to
- * the private key used to generate the <code>SignedObject</code>.</p>
- *
- * <p>More importantly, for flexibility reasons, the <code>constructor</code>
- * and <code>verify()</code> method allow for customized signature engines,
- * which can implement signature algorithms that are not installed formally as
- * part of a crypto provider. However, it is crucial that the programmer writing
- * the verifier code be aware what {@link Signature} engine is being used, as
- * its own implementation of the <code>verify()</code> method is invoked to
- * verify a signature. In other words, a malicious {@link Signature} may choose
- * to always return <code>true</code> on verification in an attempt to bypass a
- * security check.</p>
- *
- * <p>The signature algorithm can be, among others, the NIST standard <i>DSS</i>,
- * using <i>DSA</i> and <i>SHA-1</i>. The algorithm is specified using the same
- * convention as that for signatures. The <i>DSA</i> algorithm using the
- * <i>SHA-1</i> message digest algorithm can be specified, for example, as
- * <code>"SHA/DSA"</code> or <code>"SHA-1/DSA"</code> (they are equivalent). In
- * the case of <i>RSA</i>, there are multiple choices for the message digest
- * algorithm, so the signing algorithm could be specified as, for example,
- * <code>"MD2/RSA"</code>, <code>"MD5/RSA"</code> or <code>"SHA-1/RSA"</code>.
- * The algorithm name must be specified, as there is no default.</p>
- *
- * <p>The name of the Cryptography Package Provider is designated also by the
- * {@link Signature} parameter to the <code>constructor</code> and the <code>
- * verify()</code> method. If the provider is not specified, the default
- * provider is used. Each installation can be configured to use a particular
- * provider as default.</p>
- *
- * <p>Potential applications of <code>SignedObject</code> include:</p>
- *
- * <ul>
- * <li>It can be used internally to any Java runtime as an unforgeable
- * authorization token -- one that can be passed around without the fear that
- * the token can be maliciously modified without being detected.</li>
- * <li>It can be used to sign and serialize data/object for storage outside the
- * Java runtime (e.g., storing critical access control data on disk).</li>
- * <li>Nested <i>SignedObjects</i> can be used to construct a logical sequence
- * of signatures, resembling a chain of authorization and delegation.</li>
- * </ul>
- *
- * @author Mark Benvenuto (ivymccough@worldnet.att.net)
- * @since 1.2
- * @see Signature
- */
-public final class SignedObject implements Serializable
-{
- private static final long serialVersionUID = 720502720485447167L;
-
- /** @serial */
- private byte[] content;
- /** @serial */
- private byte[] signature;
- /** @serial */
- private String thealgorithm;
-
- /**
- * Constructs a <code>SignedObject</code> from any {@link Serializable}
- * object. The given object is signed with the given signing key, using the
- * designated signature engine.
- *
- * @param object the object to be signed.
- * @param signingKey the private key for signing.
- * @param signingEngine the signature signing engine.
- * @throws IOException if an error occurs during serialization.
- * @throws InvalidKeyException if the key is invalid.
- * @throws SignatureException if signing fails.
- */
- public SignedObject(Serializable object, PrivateKey signingKey,
- Signature signingEngine)
- throws IOException, InvalidKeyException, SignatureException
- {
- thealgorithm = signingEngine.getAlgorithm();
-
- ByteArrayOutputStream ostream = new ByteArrayOutputStream();
- ObjectOutputStream p = new ObjectOutputStream(ostream);
- p.writeObject(object);
- p.flush();
- p.close();
-
- content = ostream.toByteArray();
-
- signingEngine.initSign(signingKey);
- signingEngine.update(content);
- signature = signingEngine.sign();
- }
-
- /**
- * Retrieves the encapsulated object. The encapsulated object is de-serialized
- * before it is returned.
- *
- * @return the encapsulated object.
- * @throws IOException if an error occurs during de-serialization.
- * @throws ClassNotFoundException if an error occurs during de-serialization.
- */
- public Object getObject() throws IOException, ClassNotFoundException
- {
- ByteArrayInputStream bais = new ByteArrayInputStream(content);
- ObjectInput oi = new ObjectInputStream(bais);
- Object obj = oi.readObject();
- oi.close();
- bais.close();
-
- return obj;
- }
-
- /**
- * Retrieves the signature on the signed object, in the form of a byte array.
- *
- * @return a copy of the signature.
- */
- public byte[] getSignature()
- {
- return (byte[]) signature.clone();
-
- }
-
- /**
- * Retrieves the name of the signature algorithm.
- *
- * @return the signature algorithm name.
- */
- public String getAlgorithm()
- {
- return thealgorithm;
- }
-
- /**
- * Verifies that the signature in this <code>SignedObject</code> is the valid
- * signature for the object stored inside, with the given verification key,
- * using the designated verification engine.
- *
- * @param verificationKey the public key for verification.
- * @param verificationEngine the signature verification engine.
- * @return <code>true</code> if the signature is valid, <code>false</code>
- * otherwise.
- * @throws SignatureException if signature verification failed.
- * @throws InvalidKeyException if the verification key is invalid.
- */
- public boolean verify(PublicKey verificationKey, Signature verificationEngine)
- throws InvalidKeyException, SignatureException
- {
- verificationEngine.initVerify(verificationKey);
- verificationEngine.update(content);
- return verificationEngine.verify(signature);
- }
-
- /** Called to restore the state of the SignedObject from a stream. */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- content = (byte[]) content.clone();
- signature = (byte[]) signature.clone();
- }
-}
diff --git a/libjava/java/security/Signer.java b/libjava/java/security/Signer.java
deleted file mode 100644
index ae1463db84c..00000000000
--- a/libjava/java/security/Signer.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Signer.java --- Signer Class
- Copyright (C) 1999, 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * <p>This class is used to represent an {@link Identity} that can also
- * digitally sign data.</p>
- *
- * <p>The management of a signer's private keys is an important and sensitive
- * issue that should be handled by subclasses as appropriate to their intended
- * use.</p>
- *
- * @author Mark Benvenuto (ivymccough@worldnet.att.net)
- * @deprecated This class is no longer used. Its functionality has been replaced
- * by <code>java.security.KeyStore</code>, the <code>java.security.cert</code>
- * package, and <code>java.security.Principal</code>.
- */
-public abstract class Signer extends Identity
-{
- private static final long serialVersionUID = -1763464102261361480L;
- private PrivateKey privateKey = null;
-
- /**
- * Creates a <code>Signer</code>. This constructor should only be used for
- * serialization.
- */
- protected Signer()
- {
- }
-
- /**
- * Creates a <code>Signer</code> with the specified identity name.
- *
- * @param name the identity name.
- */
- public Signer(String name)
- {
- super(name);
- }
-
- /**
- * Creates a <code>Signer</code> with the specified identity name and scope.
- *
- * @param name the identity name.
- * @param scope the scope of the identity.
- * @throws KeyManagementException if there is already an identity with the
- * same name in the scope.
- */
- public Signer(String name, IdentityScope scope) throws KeyManagementException
- {
- super(name, scope);
- }
-
- /**
- * <p>Returns this signer's private key.</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with <code>"getSignerPrivateKey"</code> as its
- * argument to see if it's ok to return the private key.</p>
- *
- * @return this signer's private key, or <code>null</code> if the private key
- * has not yet been set.
- * @throws SecurityException if a security manager exists and its
- * <code>checkSecurityAccess()</code> method doesn't allow returning the
- * private key.
- * @see SecurityManager#checkSecurityAccess(String)
- */
- public PrivateKey getPrivateKey()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("getSignerPrivateKey");
-
- return privateKey;
- }
-
- /**
- * <p>Sets the key pair (public key and private key) for this signer.</p>
- *
- * <p>First, if there is a security manager, its <code>checkSecurityAccess()
- * </code> method is called with <code>"setSignerKeyPair"</code> as its
- * argument to see if it's ok to set the key pair.</p>
- *
- * @param pair an initialized key pair.
- * @throws InvalidParameterException if the key pair is not properly
- * initialized.
- * @throws KeyException if the key pair cannot be set for any other reason.
- * @throws SecurityException if a security manager exists and its
- * <code>checkSecurityAccess()</code> method doesn't allow setting the key
- * pair.
- * @see SecurityManager#checkSecurityAccess(String)
- */
- public final void setKeyPair(KeyPair pair)
- throws InvalidParameterException, KeyException
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSecurityAccess("setSignerKeyPair");
-
- try
- {
- if (pair.getPublic() != null)
- setPublicKey(pair.getPublic());
- else
- throw new InvalidParameterException();
-
- }
- catch (KeyManagementException kme)
- {
- throw new KeyException();
- }
-
- if (pair.getPrivate() != null)
- privateKey = pair.getPrivate();
- else
- throw new InvalidParameterException();
- }
-
- /**
- * Returns a string of information about the signer.
- *
- * @return a string of information about the signer.
- * @see SecurityManager#checkSecurityAccess(String)
- */
- public String toString()
- {
- return (getName() + ": " + privateKey);
- }
-}
diff --git a/libjava/java/security/UnrecoverableKeyException.java b/libjava/java/security/UnrecoverableKeyException.java
deleted file mode 100644
index 6759c3c7b91..00000000000
--- a/libjava/java/security/UnrecoverableKeyException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* UnrecoverableKeyException.java -- Cannot recover a key from the key store
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-/**
- * This exception is thrown when a key cannot be recovered from the key
- * store.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.2
- * @status updated to 1.4
- */
-public class UnrecoverableKeyException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 7275063078190151277L;
-
- /**
- * Create an instance with no descriptive error message.
- */
- public UnrecoverableKeyException()
- {
- }
-
- /**
- * Create an instance with a descriptive error message.
- *
- * @param msg the descriptive error message
- */
- public UnrecoverableKeyException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/UnresolvedPermission.java b/libjava/java/security/UnresolvedPermission.java
deleted file mode 100644
index d3f671a9c06..00000000000
--- a/libjava/java/security/UnresolvedPermission.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/* UnresolvedPermission.java -- Placeholder for unresolved permissions
- Copyright (C) 1998, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security;
-
-// All uses of Certificate in this file refer to the one in the listed
-// package, not this one.
-import java.security.cert.Certificate;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-
-/**
- * This class is used to hold instances of all permissions that cannot
- * be resolved to available permission classes when the security
- * <code>Policy</code> object is instantiated. This may happen when the
- * necessary security class has not yet been downloaded from the network.
- *
- * <p>Instances of this class are re-resolved when
- * <code>AccessController</code> check is done. At that time, a scan is
- * made of all existing <code>UnresolvedPermission</code> objects and they
- * are converted to objects of the appropriate permission type if the class
- * for that type is then available.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Permission
- * @see Permissions
- * @see PermissionCollection
- * @see Policy
- * @since 1.1
- * @status updated to 1.4
- */
-public final class UnresolvedPermission extends Permission
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -4821973115467008846L;
-
- /**
- * The list of actions associated with this permission object.
- *
- * @serial the permission actions
- */
- private final String actions;
-
- /**
- * The list of <code>Certificates</code> associated with this object.
- */
- private final transient Certificate[] certs;
-
- /**
- * The name of the class this object should be resolved to.
- *
- * @serial the fully-qualified classname of the resolved type
- */
- // Package visible for use by UnresolvedPermissionCollection.
- final String type;
-
- /**
- * The name of the permission.
- *
- * @serial the permission name
- */
- private final String name;
-
- /**
- * Create a new instance with all the information necessary to resolve it
- * to an instance of the proper class at a future time.
- *
- * @param type the fully-qualified name of the class of this permission
- * @param name the name of this permission
- * @param actions the action list for this permission
- * @param certs the list of certificates that sign this permission
- */
- public UnresolvedPermission(String type, String name, String actions,
- Certificate[] certs)
- {
- super(name);
- this.name = name;
- this.type = type;
- this.actions = actions;
- this.certs = certs;
- }
-
- /**
- * This method returns <code>false</code> always to indicate that this
- * permission does not imply the specified permission. An
- * <code>UnresolvedPermission</code> never grants any permissions.
- *
- * @param perm the <code>Permission</code> object to test
- * @return false; until a permission is resolved, it implies nothing
- */
- public boolean implies(Permission perm)
- {
- return false;
- }
-
- /**
- * This method tests this permission for equality against the specified
- * <code>Object</code>. This will be true if and only if the following
- * conditions are met:<ul>
- * <li>The specified <code>Object</code> is an UnresolvedPermission</li>
- * <li>The specified permission has the same type (i.e., desired class name)
- * as this permission.</li>
- * <li>The specified permission has the same name as this one.</li>
- * <li>The specified permissoin has the same action list as this one.</li>
- * <li>The specified permission has the same certificate list as this
- * one.</li>
- * </ul>
- *
- * @param obj the <code>Object</code> to test for equality
- * @return true if the specified object is equal to this one
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof UnresolvedPermission))
- return (false);
- UnresolvedPermission up = (UnresolvedPermission) obj;
- return up.name.equals(name) && up.actions.equals(actions)
- && up.type.equals(type) && Arrays.equals(up.certs, certs);
- }
-
- /**
- * Returns a hash code value for this object. Following the lead of
- * Permission, this returns the hashcode of the permission name.
- *
- * @return A hash value
- */
- public int hashCode()
- {
- return name.hashCode();
- }
-
- /**
- * This method returns the list of actions associated with this
- * permission.
- *
- * @return the action list
- */
- public String getActions()
- {
- return actions;
- }
-
- /**
- * This method returns a <code>String</code> representation of this
- * class. The format is: '(unresolved "ClassName "name" "actions")'
- *
- * @return <code>String</code> representation of this object
- */
- public String toString()
- {
- return "(unresolved " + type + ' ' + name + ' ' + actions + ')';
- }
-
- /**
- * This class returns a <code>PermissionCollection</code> object that can
- * be used to store instances of <code>UnresolvedPermission</code>.
- *
- * @return a new <code>PermissionCollection</code>
- */
- public PermissionCollection newPermissionCollection()
- {
- return new UnresolvedPermissionCollection();
- }
-} // class UnresolvedPermission
-
-/**
- * Implements the permission collection for unresolved permissions, and
- * obeys serialization of JDK.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
-class UnresolvedPermissionCollection extends PermissionCollection
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -7176153071733132400L;
-
- // Package-private to avoid a trampoline.
- /**
- * Hashtable where we store permissions.
- *
- * @serial map of typename to a Vector of permissions (you'd think Sun
- * would document this better!)
- */
- final Hashtable permissions = new Hashtable();
-
- /**
- * Add a permission.
- *
- * @param perm the permission to add
- * @throws IllegalArgumentException if perm is not an UnresolvedPermission
- * @throws SecurityException if the collection is read-only
- */
- public void add(Permission perm)
- {
- if (isReadOnly())
- throw new SecurityException();
- if (! (perm instanceof UnresolvedPermission))
- throw new IllegalArgumentException();
- UnresolvedPermission up = (UnresolvedPermission) perm;
- Vector v = (Vector) permissions.get(up.type);
- if (v == null)
- {
- v = new Vector();
- permissions.put(up.type, v);
- }
- v.add(up);
- }
-
- /**
- * Returns true if perm is implied by the collection.
- *
- * @param perm the permission to check
- * @return false; unresolved permissions imply nothing
- */
- public boolean implies(Permission perm)
- {
- return false;
- }
-
- /**
- * Return the elements.
- *
- * @return the elements
- */
- public Enumeration elements()
- {
- return new Enumeration()
- {
- Enumeration main_enum = permissions.elements();
- Enumeration sub_enum;
-
- public boolean hasMoreElements()
- {
- if (sub_enum == null)
- {
- if (main_enum == null)
- return false;
- if (! main_enum.hasMoreElements())
- {
- main_enum = null;
- return false;
- }
- Vector v = (Vector) main_enum.nextElement();
- sub_enum = v.elements();
- }
- if (! sub_enum.hasMoreElements())
- {
- sub_enum = null;
- return hasMoreElements();
- }
- return true;
- }
-
- public Object nextElement()
- {
- if (! hasMoreElements())
- throw new NoSuchElementException();
- return sub_enum.nextElement();
- }
- };
- }
-} // class UnresolvedPermissionCollection
diff --git a/libjava/java/security/acl/Acl.java b/libjava/java/security/acl/Acl.java
deleted file mode 100644
index ff139afd6c0..00000000000
--- a/libjava/java/security/acl/Acl.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Acl.java -- An access control list
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.acl;
-
-import java.security.Principal;
-import java.util.Enumeration;
-
-/**
- * A Java access control list (ACL) is a group of individual ACL entries.
- * These entries consist of a <code>Principal</code> and a list of
- * permissions this <code>Principal</code> is either granted or denied.
- * A given <code>Principal</code> can have at most one positive ACL entry
- * (i.e., one that grants permissions) and one negative ACL entry (i.e., one
- * that denies permissions). If a given permission is both granted and
- * denied, the ACL treats it as if it were never granted or denied. If
- * both a <code>Principal</code> and a <code>Group</code> to which the
- * <code>Principal</code> belongs have an ACL entry, the permissions for
- * the individual <code>Principal</code> take precedence over the
- * permissions of the <code>Group</code> if there is a conflict.
- * <p>
- * Additionally, the ACL interface extends the <code>Owner</code> interface
- * and so an ACL has owners. Actions which modify the ACL are restricted
- * to owners.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Acl extends Owner
-{
-
- /**
- * This method returns the name of this ACL.
- *
- * @return The name of this ACL
- */
- String getName();
-
- /**
- * This method sets the name of the ACL
- *
- * @param caller The <code>Principal</code> requesting the action.
- * @param name The new name for this ACL.
- *
- * @exception NotOwnerException If the caller is not an owner of this ACL.
- */
- void setName(Principal caller, String name)
- throws NotOwnerException;
-
- /**
- * This method adds the specified entry to the ACL
- *
- * @param caller The <code>Principal</code> requesting the addition
- * @param entry The ACL entry to add
- *
- * @return <code>true</code> if the entry was added, <code>false</code>
- * if there is already an entry of the same type for the
- * <code>Principal</code>.
- *
- * @exception NotOwnerException If the caller is not an owner of this ACL.
- */
- boolean addEntry(Principal caller, AclEntry entry)
- throws NotOwnerException;
-
- /**
- * This method delets the specified entry from the ACL
- *
- * @param caller The <code>Principal</code> requesting the deletion.
- * @param entry The ACL entry to delete
- *
- * @return <code>true</code> if the entry was deleted, or <code>false</code>
- * if this entry was not part of the ACL to begin with
- *
- * @exception NotOwnerException If the caller is not an owner of this ACL.
- */
- boolean removeEntry(Principal caller, AclEntry entry)
- throws NotOwnerException;
-
- /**
- * This method returns a list of all the entries in the ACL as an
- * <code>Enumeration</code>.
- *
- * @return An enumeration of the ACL entries
- */
- Enumeration entries();
-
- /**
- * This method tests whether or not the specified <code>Principal</code>
- * has the specified <code>Permission</code>
- *
- * @param user The <code>Principal</code> to test
- * @param perm The <code>Permission</code> to test for
- *
- * @return <code>true</code> if the user has been granted the permission,
- * <code>false</code> otherwise
- */
- boolean checkPermission(Principal user, Permission perm);
-
- /**
- * This method returns a list of <code>Permission</code>'s that are granted
- * to a particular <code>Principal</code>. This includes any permissions
- * that are granted to <code>Group</code>'s to which the <code>Principal</code>
- * belongs unless they are overridden by a negative ACL. This permission
- * list is returned as an <code>Enumeration</code>.
- *
- * @param user The <code>Principal</code> to retrieve permissions for.
- *
- * @return A list of permissions for the <code>Principal</code>.
- */
- Enumeration getPermissions(Principal user);
-
- /**
- * This method returns the ACL as a <code>String</code>
- *
- * @return A <code>String</code> representation of this ACL
- */
- String toString();
-}
diff --git a/libjava/java/security/acl/AclEntry.java b/libjava/java/security/acl/AclEntry.java
deleted file mode 100644
index 7b1bcf54db9..00000000000
--- a/libjava/java/security/acl/AclEntry.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/* AclEntry.java -- An entry in an ACL list.
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.acl;
-
-import java.security.Principal;
-import java.util.Enumeration;
-
-/**
- * This interface models an entry in an access control list (ACL). Java
- * ACL's consist of a list of entries, where each consists of a
- * <code>Principal</code> and a list of <code>Permission</code>'s which
- * have been granted to that <code>Principal</code>. An ACL can also
- * be <em>negative</em>, which indicates that the list of
- * <code>Permission</code>'s is a list of permissions that are <em>not</em>
- * granted to the <code>Principal</code>. A <code>Principal</code> can
- * have at most one regular (or positive) ACL entry and one negative
- * ACL entry.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface AclEntry extends Cloneable
-{
- /**
- * This method returns the <code>Principal</code> associated with this
- * ACL entry.
- *
- * @return The <code>Principal</code> for this ACL entry
- */
- Principal getPrincipal();
-
- /**
- * This method sets ths <code>Principal</code> associated with this
- * ACL entry. This operation will only succeed if there is not already
- * a <code>Principal</code> assigned.
- *
- * @param user The <code>Principal</code> for this ACL entry
- *
- * @return <code>true</code> if the <code>Principal</code> was successfully set or <code>false</code> if this entry already has a <code>Principal</code>.
- */
- boolean setPrincipal(Principal user);
-
- /**
- * This method sets this ACL entry to be a <em>negative</em> entry, indicating
- * that it contains a list of permissions that are <em>not</em> granted
- * to the entry's <code>Principal</code>. Note that there is no way to
- * undo this operation.
- */
- void setNegativePermissions();
-
- /**
- * This method tests whether or not this ACL entry is a negative entry or not.
- *
- * @return <code>true</code> if this ACL entry is negative, <code>false</code> otherwise
- */
- boolean isNegative();
-
- /**
- * This method adds the specified permission to this ACL entry.
- *
- * @param perm The <code>Permission</code> to add
- *
- * @return <code>true</code> if the permission was added or <code>false</code> if it was already set for this entry
- */
- boolean addPermission(Permission permission);
-
- /**
- * This method deletes the specified permission to this ACL entry.
- *
- * @param perm The <code>Permission</code> to delete from this ACL entry.
- *
- * @return <code>true</code> if the permission was successfully deleted or <code>false</code> if the permission was not part of this ACL to begin with
- */
- boolean removePermission(Permission perm);
-
- /**
- * This method tests whether or not the specified permission is associated
- * with this ACL entry.
- *
- * @param perm The <code>Permission</code> to test
- *
- * @return <code>true</code> if this permission is associated with this entry or <code>false</code> otherwise
- */
- boolean checkPermission(Permission permission);
-
- /**
- * This method returns a list of all <code>Permission</code> objects
- * associated with this ACL entry as an <code>Enumeration</code>.
- *
- * @return A list of permissions for this ACL entry
- */
- Enumeration permissions();
-
- /**
- * This method returns this object as a <code>String</code>.
- *
- * @return A <code>String</code> representation of this object
- */
- String toString();
-
- /**
- * This method returns a clone of this ACL entry
- *
- * @return A clone of this ACL entry
- */
- Object clone();
-}
diff --git a/libjava/java/security/acl/AclNotFoundException.java b/libjava/java/security/acl/AclNotFoundException.java
deleted file mode 100644
index 9a16d9c50b0..00000000000
--- a/libjava/java/security/acl/AclNotFoundException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* AclNotFoundException.java -- thrown when an ACL is not found
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.acl;
-
-/**
- * This exception is thrown when a requested access control list (ACL) is
- * not found.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class AclNotFoundException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 5684295034092681791L;
-
- /**
- * Initializes a new instance of this class with no descriptive message
- */
- public AclNotFoundException()
- {
- }
-}
diff --git a/libjava/java/security/acl/Group.java b/libjava/java/security/acl/Group.java
deleted file mode 100644
index 3ffdf15a4ce..00000000000
--- a/libjava/java/security/acl/Group.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Group.java -- Represents a group of Principals
- Copyright (C) 1998, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.acl;
-
-import java.security.Principal;
-import java.util.Enumeration;
-
-/**
- * This interface represents a group of <code>Principals</code>. Note that
- * since this interface extends <code>Principal</code>, a <code>Group</code>
- * can be used where ever a <code>Principal</code> is requested. This
- * includes arguments to the methods in this interface.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Group extends Principal
-{
- /**
- * This method adds a new <code>Principal</code> to this group.
- *
- * @param user The new <code>Principal</code> to add
- *
- * @return <code>true</code> if the user was successfully added or <code>false</code> if the user is already a member
- */
- boolean addMember(Principal user);
-
- /**
- * This method deletes a member from the group.
- *
- * @param user The <code>Principal</code> to delete
- *
- * @return <code>true</code> if the user was successfully deleted or <code>false</code> if the user is not a member of the group
- */
- boolean removeMember(Principal user);
-
- /**
- * This method tests whether or not a given <code>Principal</code> is a
- * member of this group.
- *
- * @param user The <code>Principal</code> to test for membership
- *
- * @return <code>true</code> if the user is member, <code>false</code> otherwise
- */
- boolean isMember(Principal member);
-
- /**
- * This method returns a list of all members of the group as an
- * <code>Enumeration</code>.
- *
- * @return The list of all members of the group
- */
- Enumeration members();
-}
diff --git a/libjava/java/security/acl/LastOwnerException.java b/libjava/java/security/acl/LastOwnerException.java
deleted file mode 100644
index 95272445997..00000000000
--- a/libjava/java/security/acl/LastOwnerException.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* LastOwnerException.java -- User attempted to delete last ACL owner
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.acl;
-
-/**
- * This exception is thrown when an attempt is made to delete the last owner
- * of an access control list (ACL)
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @see Owner#deleteOwner(java.security.Principal, java.security.Principal)
- * @status updated to 1.4
- */
-public class LastOwnerException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -5141997548211140359L;
-
- /**
- * Initialize a new instance of <code>LastOwnerException</code> that does
- * not have a log message.
- */
- public LastOwnerException()
- {
- }
-}
diff --git a/libjava/java/security/acl/NotOwnerException.java b/libjava/java/security/acl/NotOwnerException.java
deleted file mode 100644
index bea94763e4b..00000000000
--- a/libjava/java/security/acl/NotOwnerException.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* NotOwnerException.java -- Attempt to modify an unowned ACL
- Copyright (C) 1998, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.acl;
-
-/**
- * This exception is thrown whenever an operation is attempted that requires
- * the caller to be the owner of the access control list (ACL) when the caller
- * is in fact not the owner of the ACL.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @status updated to 1.4
- */
-public class NotOwnerException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -5555597911163362399L;
-
- /**
- * Initializes a new instance of <code>NotOwnerException</code> that does
- * not have a descriptive message.
- */
- public NotOwnerException()
- {
- }
-}
diff --git a/libjava/java/security/acl/Owner.java b/libjava/java/security/acl/Owner.java
deleted file mode 100644
index df1605b2e4f..00000000000
--- a/libjava/java/security/acl/Owner.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Owner.java -- ACL owner
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.acl;
-
-import java.security.Principal;
-
-/**
- * This interface provides a mechanism for maintaining a list of owners
- * of an access control list (ACL). Since a <code>Principal</code> must
- * be an owner in order to modify the owner list, a mechanism must be
- * provided to specify the initial owner of the ACL. The proper way to do
- * this is for the implementing class to specify the initial owner in
- * the contructor for that class.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Owner
-{
- /**
- * This method adds an owner to the access control list (ACL). Only a
- * <code>Principal</code> who is already an owner can perform this operation.
- *
- * @param caller The <code>Principal</code> who is requesting that an owner be added
- * @param owner The <code>Principal</code> to add as a new owner
- *
- * @param <code>true</code> if the new owner was successfully added or <code>false</code> if the specified new owner is already an owner
- *
- * @exception NotOwnerException If the caller is not already an owner of this ACL
- */
- boolean addOwner(Principal caller, Principal owner)
- throws NotOwnerException;
-
- /**
- * This method delets an owner from the access control list (ACL). Only a
- * <code>Principal</code> who is an owner can perform this operation. An
- * owner can delete itself from the list. If there is only one
- * owner remaining on this list, any attempt to delete it will throw an
- * exception.
- *
- * @param caller The <code>Principal</code> who is requesting that an owner be deleted
- * @param owner The <code>Principal</code> to delete as an owner
- *
- * @param <code>true</code> if the new owner was successfully deleted or <code>false</code> if the specified owner is not currently an owner
- *
- * @exception NotOwnerException If the caller is not already an owner of this ACL
- * @exception LastOwnerException If completing the operation would delete the last ACL owner
- */
- boolean deleteOwner(Principal caller, Principal owner)
- throws NotOwnerException, LastOwnerException;
-
- /**
- * This method tests whether or not a given <code>Principal</code> is an
- * owner of this access control list (ACL).
- *
- * @return <code>true</code> if the <code>Principal</code> is an owner, <code>false</code> otherwise
- */
- boolean isOwner(Principal owner);
-}
diff --git a/libjava/java/security/acl/Permission.java b/libjava/java/security/acl/Permission.java
deleted file mode 100644
index e5ba2913890..00000000000
--- a/libjava/java/security/acl/Permission.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Permission.java -- Information about an ACL permission
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.acl;
-
-/**
- * This interface provides information about a permission that can be
- * granted. Note that this is <em>not</em> the same as the class
- * <code>java.security.Permission</code>.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Permission
-{
- /**
- * This method tests whether or not a specified <code>Permission</code>
- * (passed as an <code>Object</code>) is the same as this permission.
- *
- * @param perm The permission to check for equality
- *
- * @return <code>true</code> if the specified permission is the same as this one, <code>false</code> otherwise
- */
- boolean equals (Object perm);
-
- /**
- * This method returns this <code>Permission</code> as a <code>String</code>.
- *
- * @return A <code>String</code> representing this permission.
- */
- String toString();
-}
diff --git a/libjava/java/security/cert/CRL.java b/libjava/java/security/cert/CRL.java
deleted file mode 100644
index e763663f52c..00000000000
--- a/libjava/java/security/cert/CRL.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* CRL.java --- Certificate Revocation List
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- Certificate Revocation List class for managing CRLs that
- have different formats but the same general use. They
- all serve as lists of revoked certificates and can
- be queried for a given certificate.
-
- Specialized CRLs extend this class.
-
- @author Mark Benvenuto
-
- @since JDK 1.2
-*/
-public abstract class CRL
-{
-
- private String type;
-
- /**
- Creates a new CRL for the specified type. An example
- is "X.509".
-
- @param type the standard name for the CRL type.
- */
- protected CRL(String type)
- {
- this.type = type;
- }
-
- /**
- Returns the CRL type.
-
- @return a string representing the CRL type
- */
- public final String getType()
- {
- return type;
- }
-
- /**
- Returns a string representing the CRL.
-
- @return a string representing the CRL.
- */
- public abstract String toString();
-
- /**
- Determines whether or not the specified Certificate
- is revoked.
-
- @param cert A certificate to check if it is revoked
-
- @return true if the certificate is revoked,
- false otherwise.
- */
- public abstract boolean isRevoked(Certificate cert);
-
-
-}
diff --git a/libjava/java/security/cert/CRLException.java b/libjava/java/security/cert/CRLException.java
deleted file mode 100644
index f3addfe9594..00000000000
--- a/libjava/java/security/cert/CRLException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* CRLException.java -- Certificate Revocation List Exception
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.security.GeneralSecurityException;
-
-/**
- * Exception for a Certificate Revocation List.
- *
- * @author Mark Benvenuto
- * @since 1.2
- * @status updated to 1.4
-*/
-public class CRLException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -6694728944094197147L;
-
- /**
- * Constructs an CRLExceptionwithout a message string.
- */
- public CRLException()
- {
- }
-
- /**
- * Constructs an CRLException with a message string.
- *
- * @param msg a message to display with exception
- */
- public CRLException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/cert/CRLSelector.java b/libjava/java/security/cert/CRLSelector.java
deleted file mode 100644
index 1fa5a207dfc..00000000000
--- a/libjava/java/security/cert/CRLSelector.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* CRLSelector.java -- matches CRLs against criteria.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * A generic interface to classes that match certificate revocation
- * lists (CRLs) to some given criteria. Implementations of this
- * interface are useful for finding {@link CRL} objects in a {@link
- * CertStore}.
- *
- * @see CertStore
- * @see CertSelector
- * @see X509CRLSelector
- */
-public interface CRLSelector extends Cloneable
-{
-
- /**
- * Returns a clone of this instance.
- *
- * @return The clone.
- */
- Object clone();
-
- /**
- * Match a given certificate revocation list to this selector's
- * criteria, returning true if it matches, false otherwise.
- *
- * @param crl The certificate revocation list to test.
- * @return The boolean result of this test.
- */
- boolean match(CRL crl);
-}
diff --git a/libjava/java/security/cert/CertPath.java b/libjava/java/security/cert/CertPath.java
deleted file mode 100644
index e818763aab4..00000000000
--- a/libjava/java/security/cert/CertPath.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/* CertPath.java -- a sequence of certificates
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.io.ByteArrayInputStream;
-import java.io.NotSerializableException;
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * This class represents an immutable sequence, or path, of security
- * certificates. The path type must match the type of each certificate in the
- * path, or in other words, for all instances of cert in a certpath object,
- * <code>cert.getType().equals(certpath.getType())</code> will return true.
- *
- * <p>Since this class is immutable, it is thread-safe. During serialization,
- * the path is consolidated into a {@link CertPathRep}, which preserves the
- * data regardless of the underlying implementation of the path.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status updated to 1.4
- */
-public abstract class CertPath implements Serializable
-{
- /**
- * The serialized representation of a path.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- protected static class CertPathRep implements Serializable
- {
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = 3015633072427920915L;
-
- /**
- * The certificate type.
- *
- * @serial the type of the certificate path
- */
- private final String type;
-
- /**
- * The encoded form of the path.
- *
- * @serial the encoded form
- */
- private final byte[] data;
-
- /**
- * Create the new serial representation.
- *
- * @param type the path type
- * @param data the encoded path data
- */
- protected CertPathRep(String type, byte[] data)
- {
- this.type = type;
- this.data = data;
- }
-
- /**
- * Decode the data into an actual {@link CertPath} upon deserialization.
- *
- * @return the replacement object
- * @throws ObjectStreamException if replacement fails
- */
- protected Object readResolve() throws ObjectStreamException
- {
- try
- {
- return CertificateFactory.getInstance(type)
- .generateCertPath(new ByteArrayInputStream(data));
- }
- catch (CertificateException e)
- {
- throw (ObjectStreamException)
- new NotSerializableException("java.security.cert.CertPath: "
- + type).initCause(e);
- }
- }
- } // class CertPathRep
-
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = 6068470306649138683L;
-
- /**
- * The path type.
- *
- * @serial the type of all certificates in this path
- */
- private final String type;
-
- /**
- * Create a certificate path with the given type. Most code should use
- * {@link CertificateFactory} to create CertPaths.
- *
- * @param type the type of the path
- */
- protected CertPath(String type)
- {
- this.type = type;
- }
-
- /**
- * Get the (non-null) type of all certificates in the path.
- *
- * @return the path certificate type
- */
- public String getType()
- {
- return type;
- }
-
- /**
- * Get an immutable iterator over the path encodings (all String names),
- * starting with the default encoding. The iterator will throw an
- * <code>UnsupportedOperationException</code> if an attempt is made to
- * remove items from the list.
- *
- * @return the iterator of supported encodings in the path
- */
- public abstract Iterator getEncodings();
-
- /**
- * Compares this path to another for semantic equality. To be equal, both
- * must be instances of CertPath, with the same type, and identical
- * certificate lists. Overriding classes must not change this behavior.
- *
- * @param o the object to compare to
- * @return true if the two are equal
- */
- public boolean equals(Object o)
- {
- if (! (o instanceof CertPath))
- return false;
- CertPath cp = (CertPath) o;
- return type.equals(cp.type)
- && getCertificates().equals(cp.getCertificates());
- }
-
- /**
- * Returns the hashcode of this certificate path. This is defined as:<br>
- * <code>31 * getType().hashCode() + getCertificates().hashCode()</code>.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return 31 * type.hashCode() + getCertificates().hashCode();
- }
-
- public String toString()
- {
- List l = getCertificates();
- int size = l.size();
- int i = 0;
- StringBuffer result = new StringBuffer(type);
- result.append(" Cert Path: length = ").append(size).append(".\n[\n");
- while (--size >= 0)
- result.append(l.get(i++)).append('\n');
- return result.append("\n]").toString();
- }
-
- /**
- * Returns the encoded form of this path, via the default encoding.
- *
- * @return the encoded form
- * @throws CertificateEncodingException if encoding fails
- */
- public abstract byte[] getEncoded() throws CertificateEncodingException;
-
- /**
- * Returns the encoded form of this path, via the specified encoding.
- *
- * @param encoding the encoding to use
- * @return the encoded form
- * @throws CertificateEncodingException if encoding fails or does not exist
- */
- public abstract byte[] getEncoded(String encoding)
- throws CertificateEncodingException;
-
- /**
- * Returns the immutable, thread-safe list of certificates in this path.
- *
- * @return the list of certificates, non-null but possibly empty
- */
- public abstract List getCertificates();
-
- /**
- * Serializes the path in its encoded form, to ensure reserialization with
- * the appropriate factory object without worrying about list implementation.
- * The result will always be an instance of {@link CertPathRep}.
- *
- * @return the replacement object
- * @throws ObjectStreamException if the replacement creation fails
- */
- protected Object writeReplace() throws ObjectStreamException
- {
- try
- {
- return new CertPathRep(type, getEncoded());
- }
- catch (CertificateEncodingException e)
- {
- throw (ObjectStreamException)
- new NotSerializableException("java.security.cert.CertPath: "
- + type).initCause(e);
- }
- }
-} // class CertPath
diff --git a/libjava/java/security/cert/CertPathBuilder.java b/libjava/java/security/cert/CertPathBuilder.java
deleted file mode 100644
index f6965205f53..00000000000
--- a/libjava/java/security/cert/CertPathBuilder.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/* CertPathBuilder.java -- bulids CertPath objects from Certificates.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import gnu.java.security.Engine;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.Security;
-
-/**
- * This class builds certificate paths (also called certificate chains),
- * which can be used to establish trust for a particular certificate by
- * building a path from a trusted certificate (a trust anchor) to the
- * untrusted certificate.
- *
- * @see CertPath
- */
-public class CertPathBuilder
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** Service name for CertPathBuilder. */
- private static final String CERT_PATH_BUILDER = "CertPathBuilder";
-
- /** The underlying implementation. */
- private CertPathBuilderSpi cpbSpi;
-
- /** The provider of this implementation. */
- private Provider provider;
-
- /** The name of this implementation. */
- private String algorithm;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new CertPathBuilder.
- *
- * @param cpbSpi The underlying implementation.
- * @param provider The provider of the implementation.
- * @param algorithm This implementation's name.
- */
- protected CertPathBuilder(CertPathBuilderSpi cpbSpi, Provider provider,
- String algorithm)
- {
- this.cpbSpi = cpbSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get the default cert path builder type.
- *
- * <p>This value can be set at run-time by the security property
- * <code>"certpathbuilder.type"</code>. If this property is not set,
- * then the value returned is <code>"PKIX"</code>.
- *
- * @return The default CertPathBuilder algorithm.
- */
- public static final String getDefaultType()
- {
- String type = Security.getProperty("certpathbuilder.type");
- if (type == null)
- type = "PKIX";
- return type;
- }
-
- /**
- * Get an instance of a named CertPathBuilder, from the first provider
- * that implements it.
- *
- * @param algorithm The name of the CertPathBuilder to create.
- * @return The new instance.
- * @throws NoSuchAlgorithmException If no installed provider
- * implements the named algorithm.
- */
- public static CertPathBuilder getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] p = Security.getProviders();
-
- for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignored.
- }
- }
-
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Get an instance of a named CertPathBuilder from the named
- * provider.
- *
- * @param algorithm The name of the CertPathBuilder to create.
- * @param provider The name of the provider from which to get the
- * implementation.
- * @return The new instance.
- * @throws NoSuchAlgorithmException If no installed provider
- * implements the named algorithm.
- * @throws NoSuchProviderException If the named provider does not
- * exist.
- */
- public static CertPathBuilder getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
- return getInstance(algorithm, p);
- }
-
- /**
- * Get an instance of a named CertPathBuilder from the specified
- * provider.
- *
- * @param algorithm The name of the CertPathBuilder to create.
- * @param provider The provider from which to get the implementation.
- * @return The new instance.
- * @throws NoSuchAlgorithmException If no installed provider
- * implements the named algorithm.
- * @throws IllegalArgumentException If <i>provider</i> in
- * <tt>null</tt>.
- */
- public static CertPathBuilder getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("null provider");
- try
- {
- return new CertPathBuilder((CertPathBuilderSpi)
- Engine.getInstance(CERT_PATH_BUILDER, algorithm, provider),
- provider, algorithm);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return the name of this CertPathBuilder algorithm.
- *
- * @return The algorithm name.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Return the provider of this instance's implementation.
- *
- * @return The provider.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Builds a certificate path. The {@link CertPathParameters} parameter
- * passed to this method is implementation-specific, but in general
- * should contain some number of certificates and some number of
- * trusted certificates (or "trust anchors").
- *
- * @param params The parameters.
- * @retrun The certificate path result.
- * @throws CertPathBuilderException If the certificate path cannot be
- * built.
- * @throws InvalidAlgorithmParameterException If the implementation
- * rejects the specified parameters.
- */
- public final CertPathBuilderResult build(CertPathParameters params)
- throws CertPathBuilderException, InvalidAlgorithmParameterException
- {
- return cpbSpi.engineBuild(params);
- }
-}
diff --git a/libjava/java/security/cert/CertPathBuilderException.java b/libjava/java/security/cert/CertPathBuilderException.java
deleted file mode 100644
index 98515101025..00000000000
--- a/libjava/java/security/cert/CertPathBuilderException.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* CertPathBuilderException.java -- wraps an exception during certificate
- path building
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.security.GeneralSecurityException;
-
-/**
- * Indicates a problem while using a <code>CertPathBuilder</code>, wrapping
- * the lower exception. This class is not thread-safe.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see CertPathBuilder
- * @since 1.4
- * @status updated to 1.4
-*/
-public class CertPathBuilderException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = 5316471420178794402L;
-
- /**
- * Create an exception without a message. The cause may be initialized.
- */
- public CertPathBuilderException()
- {
- }
-
- /**
- * Create an exception with a message. The cause may be initialized.
- *
- * @param msg a message to display with exception
- */
- public CertPathBuilderException(String msg)
- {
- super(msg);
- }
-
- /**
- * Create an exception with a cause. The message will be
- * <code>cause == null ? null : cause.toString()</code>.
- *
- * @param cause the cause
- */
- public CertPathBuilderException(Throwable cause)
- {
- this(cause == null ? null : cause.toString(), cause);
- }
-
- /**
- * Create an exception with a cause and a message.
- *
- * @param msg the message
- * @param cause the cause
- */
- public CertPathBuilderException(String msg, Throwable cause)
- {
- super(msg);
- initCause(cause);
- }
-
- /**
- * Get the detail message.
- *
- * @return the detail message
- */
- public String getMessage()
- {
- return super.getMessage();
- }
-
- /**
- * Get the cause, null if unknown.
- *
- * @return the cause
- */
- public Throwable getCause()
- {
- return super.getCause();
- }
-
- /**
- * Convert this to a string, including its cause.
- *
- * @return the string conversion
- */
- public String toString()
- {
- return super.toString();
- }
-
- /**
- * Print the stack trace to <code>System.err</code>.
- */
- public void printStackTrace()
- {
- super.printStackTrace();
- }
-
- /**
- * Print the stack trace to a stream.
- *
- * @param stream the stream
- */
- public void printStackTrace(PrintStream stream)
- {
- super.printStackTrace(stream);
- }
-
- /**
- * Print the stack trace to a stream.
- *
- * @param stream the stream
- */
- public void printStackTrace(PrintWriter stream)
- {
- super.printStackTrace(stream);
- }
-}
diff --git a/libjava/java/security/cert/CertPathBuilderResult.java b/libjava/java/security/cert/CertPathBuilderResult.java
deleted file mode 100644
index 737ba9431b3..00000000000
--- a/libjava/java/security/cert/CertPathBuilderResult.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* CertPathBuilderResult -- results from building cert paths.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * A standard interface for the result of building a certificate path.
- * All implementations of this class must provide a way to get the
- * certificate path, but may also define additional methods for
- * returning other result data generated by the certificate path
- * builder.
- */
-public interface CertPathBuilderResult extends Cloneable {
-
- /**
- * Creates a copy of this builder result.
- *
- * @return The copy.
- */
- Object clone();
-
- /**
- * Get the certificate path that was built.
- *
- * @retrn The certificate path.
- */
- CertPath getCertPath();
-}
diff --git a/libjava/java/security/cert/CertPathBuilderSpi.java b/libjava/java/security/cert/CertPathBuilderSpi.java
deleted file mode 100644
index afc7fc07366..00000000000
--- a/libjava/java/security/cert/CertPathBuilderSpi.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* CertPathBuilderSpi -- CertPathBuilder service provider interface.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * The {@link CertPathBuilder} <i>Service Provider Interface</i>
- * (<b>SPI</b>).
- *
- * @see CertPathBuilder
- */
-public abstract class CertPathBuilderSpi {
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new CertPathBuilderSpi.
- */
- public CertPathBuilderSpi() {
- super();
- }
-
- // Abstract methods.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a certificate path from the specified parameters.
- *
- * @param params The parameters to use.
- * @return The certificate path result.
- * @throws CertPathBuilderException If the certificate path cannot be
- * built.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * implementation rejects the specified parameters.
- */
- public abstract CertPathBuilderResult engineBuild(CertPathParameters params)
- throws CertPathBuilderException,
- java.security.InvalidAlgorithmParameterException;
-}
diff --git a/libjava/java/security/cert/CertPathParameters.java b/libjava/java/security/cert/CertPathParameters.java
deleted file mode 100644
index 62a5cb6a69e..00000000000
--- a/libjava/java/security/cert/CertPathParameters.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* CertPathParameters.java -- parameters for CertPathBuilder.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * Parameters for generating and validating certificate paths. This
- * class does not define any methods (except a required cloneable
- * interface) and is provided only to provide type safety for
- * implementations. Concrete implementations implement this interface
- * in accord with thier own needs.
- *
- * @see CertPathBuilder
- * @see CertPathValidator
- */
-public interface CertPathParameters extends Cloneable {
-
- /**
- * Makes a copy of this CertPathParameters instance.
- *
- * @return The copy.
- */
- Object clone();
-}
diff --git a/libjava/java/security/cert/CertPathValidator.java b/libjava/java/security/cert/CertPathValidator.java
deleted file mode 100644
index 5fed19e9a78..00000000000
--- a/libjava/java/security/cert/CertPathValidator.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/* CertPathValidator -- validates certificate paths.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import gnu.java.security.Engine;
-
-import java.security.AccessController;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.PrivilegedAction;
-import java.security.Provider;
-import java.security.Security;
-
-/**
- * Generic interface to classes that validate certificate paths.
- *
- * <p>Using this class is similar to all the provider-based security
- * classes; the method of interest, {@link
- * #validate(java.security.cert.CertPath,java.security.cert.CertPathParameters)},
- * which takes provider-specific implementations of {@link
- * CertPathParameters}, and return provider-specific implementations of
- * {@link CertPathValidatorResult}.
- *
- * @since JDK 1.4
- * @see CertPath
- */
-public class CertPathValidator {
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** Service name for CertPathValidator. */
- private static final String CERT_PATH_VALIDATOR = "CertPathValidator";
-
- /** The underlying implementation. */
- private final CertPathValidatorSpi validatorSpi;
-
- /** The provider of this implementation. */
- private final Provider provider;
-
- /** The algorithm's name. */
- private final String algorithm;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new CertPathValidator.
- *
- * @param validatorSpi The underlying implementation.
- * @param provider The provider of the implementation.
- * @param algorithm The algorithm name.
- */
- protected CertPathValidator(CertPathValidatorSpi validatorSpi,
- Provider provider, String algorithm)
- {
- this.validatorSpi = validatorSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the default validator type.
- *
- * <p>This value may be set at run-time via the security property
- * "certpathvalidator.type", or the value "PKIX" if this property is
- * not set.
- *
- * @return The default validator type.
- */
- public static synchronized String getDefaultType() {
- String type = (String) AccessController.doPrivileged(
- new PrivilegedAction()
- {
- public Object run()
- {
- return Security.getProperty("certpathvalidator.type");
- }
- }
- );
- if (type == null)
- type = "PKIX";
- return type;
- }
-
- /**
- * Get an instance of the given validator from the first provider that
- * implements it.
- *
- * @param algorithm The name of the algorithm to get.
- * @return The new instance.
- * @throws NoSuchAlgorithmException If no installed provider
- * implements the requested algorithm.
- */
- public static CertPathValidator getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] p = Security.getProviders();
- for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignored.
- }
- }
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Get an instance of the given validator from the named provider.
- *
- * @param algorithm The name of the algorithm to get.
- * @param provider The name of the provider from which to get the
- * implementation.
- * @return The new instance.
- * @throws NoSuchAlgorithmException If the named provider does not
- * implement the algorithm.
- * @throws NoSuchProviderException If no provider named
- * <i>provider</i> is installed.
- */
- public static CertPathValidator getInstance(String algorithm,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
-
- return getInstance(algorithm, p);
- }
-
- /**
- * Get an instance of the given validator from the given provider.
- *
- * @param algorithm The name of the algorithm to get.
- * @param provider The provider from which to get the implementation.
- * @return The new instance.
- * @throws NoSuchAlgorithmException If the provider does not implement
- * the algorithm.
- * @throws IllegalArgumentException If <i>provider</i> is null.
- */
- public static CertPathValidator getInstance(String algorithm,
- Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("null provider");
-
- try
- {
- return new CertPathValidator((CertPathValidatorSpi)
- Engine.getInstance(CERT_PATH_VALIDATOR, algorithm, provider),
- provider, algorithm);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return the name of this validator.
- *
- * @return This validator's name.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Return the provider of this implementation.
- *
- * @return The provider.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Attempt to validate a certificate path.
- *
- * @param certPath The path to validate.
- * @param params The algorithm-specific parameters.
- * @return The result of this validation attempt.
- * @throws CertPathValidatorException If the certificate path cannot
- * be validated.
- * @throws InvalidAlgorithmParameterException If this implementation
- * rejects the specified parameters.
- */
- public final CertPathValidatorResult validate(CertPath certPath,
- CertPathParameters params)
- throws CertPathValidatorException, InvalidAlgorithmParameterException
- {
- return validatorSpi.engineValidate(certPath, params);
- }
-}
diff --git a/libjava/java/security/cert/CertPathValidatorException.java b/libjava/java/security/cert/CertPathValidatorException.java
deleted file mode 100644
index f3195be296f..00000000000
--- a/libjava/java/security/cert/CertPathValidatorException.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/* CertPathValidatorException.java -- wraps an exception during validation
- of a CertPath
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.security.GeneralSecurityException;
-
-/**
- * Indicates a problem while validating a certification path. In addition,
- * it can store the path an index in that path that caused the problem. This
- * class is not thread-safe.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see CertPathValidator
- * @since 1.4
- * @status updated to 1.4
-*/
-public class CertPathValidatorException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = -3083180014971893139L;
-
- /**
- * The index of the certificate path that failed, or -1.
- *
- * @serial the failed index
- */
- private final int index;
-
- /**
- * The <code>CertPath</code> that failed.
- *
- * @serial the object being validated at time of failure
- */
- private final CertPath certPath;
-
- /**
- * Create an exception without a message. The cause may be initialized. The
- * index is set to -1 and the failed CertPath object to null.
- */
- public CertPathValidatorException()
- {
- this((String) null);
- }
-
- /**
- * Create an exception with a message. The cause may be initialized. The
- * index is set to -1 and the failed CertPath object to null.
- *
- * @param msg a message to display with exception
- */
- public CertPathValidatorException(String msg)
- {
- super(msg);
- index = -1;
- certPath = null;
- }
-
- /**
- * Create an exception with a cause. The message will be
- * <code>cause == null ? null : cause.toString()</code>. The index is set
- * to -1 and the failed CertPath object to null.
- *
- * @param cause the cause
- */
- public CertPathValidatorException(Throwable cause)
- {
- this(cause == null ? null : cause.toString(), cause, null, -1);
- }
-
- /**
- * Create an exception with a cause and a message. The index is set to -1
- * and the failed CertPath object to null.
- *
- * @param msg the message
- * @param cause the cause
- */
- public CertPathValidatorException(String msg, Throwable cause)
- {
- this(msg, cause, null, -1);
- }
-
- /**
- * Create an exception with a cause, message, failed object, and index of
- * failure in that CertPath.
- *
- * @param msg the message
- * @param cause the cause
- * @param certPath the path that was being validated, or null
- * @param index the index of the path, or -1
- * @throws IndexOutOfBoundsException if index is &lt; -1 or
- * &gt; certPath.getCertificates().size()
- * @throws IllegalArgumentException if certPath is null but index != -1
- */
- public CertPathValidatorException(String msg, Throwable cause,
- CertPath certPath, int index)
- {
- super(msg);
- initCause(cause);
- if (index < -1 || (certPath != null
- && index >= certPath.getCertificates().size()))
- throw new IndexOutOfBoundsException();
- if ((certPath == null) != (index == -1))
- throw new IllegalArgumentException();
- this.certPath = certPath;
- this.index = index;
- }
-
- /**
- * Get the detail message.
- *
- * @return the detail message
- */
- public String getMessage()
- {
- return super.getMessage();
- }
-
- /**
- * Get the certificate path that had the failure, or null.
- *
- * @return the culprit path
- */
- public CertPath getCertPath()
- {
- return certPath;
- }
-
- /**
- * Get the index that failed, or -1.
- *
- * @return the colprit index
- */
- public int getIndex()
- {
- return index;
- }
-
- /**
- * Get the cause, null if unknown.
- *
- * @return the cause
- */
- public Throwable getCause()
- {
- return super.getCause();
- }
-
- /**
- * Convert this to a string, including its cause.
- *
- * @return the string conversion
- */
- public String toString()
- {
- return super.toString();
- }
-
- /**
- * Print the stack trace to <code>System.err</code>.
- */
- public void printStackTrace()
- {
- super.printStackTrace();
- }
-
- /**
- * Print the stack trace to a stream.
- *
- * @param stream the stream
- */
- public void printStackTrace(PrintStream stream)
- {
- super.printStackTrace(stream);
- }
-
- /**
- * Print the stack trace to a stream.
- *
- * @param stream the stream
- */
- public void printStackTrace(PrintWriter stream)
- {
- super.printStackTrace(stream);
- }
-}
diff --git a/libjava/java/security/cert/CertPathValidatorResult.java b/libjava/java/security/cert/CertPathValidatorResult.java
deleted file mode 100644
index 71aaf89bc18..00000000000
--- a/libjava/java/security/cert/CertPathValidatorResult.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* CertPathValidatorResult -- result of validating certificate paths
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * Interface to the result of calling {@link
- * CertPathValidator#validate(java.security.cert.CertPath,java.security.cert.CertPathParameters)}.
- *
- * <p>This interface defines no methods other than the required
- * {@link java.lang.Cloneable} interface, and is intended to group and
- * provide type safety for validator results. Providers that implement
- * a certificate path validator must also provide an implementation of
- * this interface, possibly defining additional methods.
- *
- * @since JDK 1.4
- * @see CertPathValidator
- */
-public interface CertPathValidatorResult extends Cloneable
-{
-
- /**
- * Returns a copy of this validator result.
- *
- * @return The copy.
- */
- Object clone();
-}
diff --git a/libjava/java/security/cert/CertPathValidatorSpi.java b/libjava/java/security/cert/CertPathValidatorSpi.java
deleted file mode 100644
index 8d18b49dac4..00000000000
--- a/libjava/java/security/cert/CertPathValidatorSpi.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* CertPathValidatorSpi -- cert path validator service provider interface
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * The <i>service provider interface</i> (<b>SPI</b>) for the {@link
- * CertPathValidator} class. Providers implementing certificate path
- * validators must subclass this class and implement its abstract
- * methods.
- */
-public abstract class CertPathValidatorSpi
-{
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Default constructor.
- */
- public CertPathValidatorSpi()
- {
- super();
- }
-
- // Abstract methods.
- // ------------------------------------------------------------------------
-
- /**
- * Attempt to validate a certificate path.
- *
- * @param certPath The path to validate.
- * @param params The algorithm-specific parameters.
- * @return The result of this validation attempt.
- * @throws CertPathValidatorException If the certificate path cannot
- * be validated.
- * @throws InvalidAlgorithmParameterException If this implementation
- * rejects the specified parameters.
- */
- public abstract CertPathValidatorResult
- engineValidate(CertPath certPath, CertPathParameters params)
- throws CertPathValidatorException,
- java.security.InvalidAlgorithmParameterException;
-}
diff --git a/libjava/java/security/cert/CertSelector.java b/libjava/java/security/cert/CertSelector.java
deleted file mode 100644
index aea614ad95e..00000000000
--- a/libjava/java/security/cert/CertSelector.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* CertSelector.java -- certificate selector interface.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-public interface CertSelector extends Cloneable
-{
-
- /**
- * Returns a copy of this CertSelector.
- *
- * @return The copy.
- */
- Object clone();
-
- /**
- * Match a certificate according to this selector's criteria.
- *
- * @param cert The certificate to match.
- * @return true if the certificate matches thin criteria.
- */
- boolean match(Certificate cert);
-}
diff --git a/libjava/java/security/cert/CertStore.java b/libjava/java/security/cert/CertStore.java
deleted file mode 100644
index 864da868f19..00000000000
--- a/libjava/java/security/cert/CertStore.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/* CertStore -- stores and retrieves certificates.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import gnu.java.security.Engine;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.PrivilegedAction;
-import java.security.Provider;
-import java.security.Security;
-import java.util.Collection;
-
-/**
- * A CertStore is a read-only repository for certificates and
- * certificate revocation lists.
- *
- * @since JDK 1.4
- */
-public class CertStore
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** Service name for CertStore. */
- private static final String CERT_STORE = "CertStore";
-
- /** The underlying implementation. */
- private CertStoreSpi storeSpi;
-
- /** This implementation's provider. */
- private Provider provider;
-
- /** The name of this key store type. */
- private String type;
-
- /** The parameters used to initialize this instance, if any. */
- private CertStoreParameters params;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new CertStore.
- *
- * @param storeSpi The underlying implementation.
- * @param provider The provider of this implementation.
- * @param type The type of CertStore this class represents.
- * @param params The parameters used to initialize this instance, if any.
- */
- protected CertStore(CertStoreSpi storeSpi, Provider provider, String type,
- CertStoreParameters params)
- {
- this.storeSpi = storeSpi;
- this.provider = provider;
- this.type = type;
- this.params = params;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the default certificate store type.
- *
- * <p>This value can be set at run-time via the security property
- * "certstore.type"; if not specified than the default type will be
- * "LDAP".
- *
- * @return The default CertStore type.
- */
- public static final synchronized String getDefaultType()
- {
- String type = null;
- type = (String) java.security.AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
- return Security.getProperty("certstore.type");
- }
- }
- );
- if (type == null)
- type = "LDAP";
- return type;
- }
-
- /**
- * Get an instance of the given certificate store from the first
- * installed provider.
- *
- * @param type The type of CertStore to create.
- * @param params The parameters to initialize this cert store with.
- * @return The new instance.
- * @throws InvalidAlgorithmParameterException If the instance rejects
- * the specified parameters.
- * @throws NoSuchAlgorithmException If no installed provider
- * implements the specified CertStore.
- * @throws IllegalArgumentException If <i>provider</i> is null.
- */
- public static CertStore getInstance(String type, CertStoreParameters params)
- throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
- {
- Provider[] p = Security.getProviders();
- for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(type, params, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignored.
- }
- }
-
- throw new NoSuchAlgorithmException(type);
- }
-
- /**
- * Get an instance of the given certificate store from the named
- * provider.
- *
- * @param type The type of CertStore to create.
- * @param params The parameters to initialize this cert store with.
- * @param provider The name of the provider from which to get the
- * implementation.
- * @return The new instance.
- * @throws InvalidAlgorithmParameterException If the instance rejects
- * the specified parameters.
- * @throws NoSuchAlgorithmException If the specified provider does not
- * implement the specified CertStore.
- * @throws NoSuchProviderException If no provider named
- * <i>provider</i> is installed.
- * @throws IllegalArgumentException If <i>provider</i> is null.
- */
- public static CertStore getInstance(String type, CertStoreParameters params,
- String provider)
- throws InvalidAlgorithmParameterException, NoSuchAlgorithmException,
- NoSuchProviderException
- {
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
- return getInstance(type, params, p);
- }
-
- /**
- * Get an instance of the given certificate store from the given
- * provider.
- *
- * @param type The type of CertStore to create.
- * @param params The parameters to initialize this cert store with.
- * @param provider The provider from which to get the implementation.
- * @return The new instance.
- * @throws InvalidAlgorithmParameterException If the instance rejects
- * the specified parameters.
- * @throws NoSuchAlgorithmException If the specified provider does not
- * implement the specified CertStore.
- * @throws IllegalArgumentException If <i>provider</i> is null.
- */
- public static CertStore getInstance(String type, CertStoreParameters params,
- Provider provider)
- throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("null provider");
-
- try
- {
- return new CertStore((CertStoreSpi) Engine.getInstance(CERT_STORE,
- type, provider, new Object[] { params }), provider, type, params);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(type);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- Throwable cause = ite.getCause();
- if (cause instanceof InvalidAlgorithmParameterException)
- throw (InvalidAlgorithmParameterException) cause;
- else
- throw new NoSuchAlgorithmException(type);
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return the type of certificate store this instance represents.
- *
- * @return The CertStore type.
- */
- public final String getType()
- {
- return type;
- }
-
- /**
- * Return the provider of this implementation.
- *
- * @return The provider.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Get the parameters this instance was created with, if any. The
- * parameters will be cloned before they are returned.
- *
- * @return The parameters, or null.
- */
- public final CertStoreParameters getCertStoreParameters()
- {
- return params != null ? (CertStoreParameters) params.clone() : null;
- }
-
- /**
- * Get a collection of certificates from this CertStore, optionally
- * filtered by the specified CertSelector. The Collection returned may
- * be empty, but will never be null.
- *
- * <p>Implementations may not allow a null argument, even if no
- * filtering is desired.
- *
- * @param selector The certificate selector.
- * @return The collection of certificates.
- * @throws CertStoreException If the certificates cannot be retrieved.
- */
- public final Collection getCertificates(CertSelector selector)
- throws CertStoreException
- {
- return storeSpi.engineGetCertificates(selector);
- }
-
- /**
- * Get a collection of certificate revocation lists from this CertStore,
- * optionally filtered by the specified CRLSelector. The Collection
- * returned may be empty, but will never be null.
- *
- * <p>Implementations may not allow a null argument, even if no
- * filtering is desired.
- *
- * @param selector The certificate selector.
- * @return The collection of certificate revocation lists.
- * @throws CertStoreException If the CRLs cannot be retrieved.
- */
- public final Collection getCRLs(CRLSelector selector)
- throws CertStoreException
- {
- return storeSpi.engineGetCRLs(selector);
- }
-}
diff --git a/libjava/java/security/cert/CertStoreException.java b/libjava/java/security/cert/CertStoreException.java
deleted file mode 100644
index a4d8b7a46e1..00000000000
--- a/libjava/java/security/cert/CertStoreException.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* CertStoreException.java -- wraps an exception during certificate storage
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.security.GeneralSecurityException;
-
-/**
- * Indicates a problem while retrieving certificates and CRLs from
- * <code>CertStore</code>, wrapping the lower exception. This class is not
- * thread-safe.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see CertStore
- * @since 1.4
- * @status updated to 1.4
-*/
-public class CertStoreException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.4+.
- */
- private static final long serialVersionUID = 2395296107471573245L;
-
- /**
- * Create an exception without a message. The cause may be initialized.
- */
- public CertStoreException()
- {
- }
-
- /**
- * Create an exception with a message. The cause may be initialized.
- *
- * @param msg a message to display with exception
- */
- public CertStoreException(String msg)
- {
- super(msg);
- }
-
- /**
- * Create an exception with a cause. The message will be
- * <code>cause == null ? null : cause.toString()</code>.
- *
- * @param cause the cause
- */
- public CertStoreException(Throwable cause)
- {
- this(cause == null ? null : cause.toString(), cause);
- }
-
- /**
- * Create an exception with a cause and a message.
- *
- * @param msg the message
- * @param cause the cause
- */
- public CertStoreException(String msg, Throwable cause)
- {
- super(msg);
- initCause(cause);
- }
-
- /**
- * Get the detail message.
- *
- * @return the detail message
- */
- public String getMessage()
- {
- return super.getMessage();
- }
-
- /**
- * Get the cause, null if unknown.
- *
- * @return the cause
- */
- public Throwable getCause()
- {
- return super.getCause();
- }
-
- /**
- * Convert this to a string, including its cause.
- *
- * @return the string conversion
- */
- public String toString()
- {
- return super.toString();
- }
-
- /**
- * Print the stack trace to <code>System.err</code>.
- */
- public void printStackTrace()
- {
- super.printStackTrace();
- }
-
- /**
- * Print the stack trace to a stream.
- *
- * @param stream the stream
- */
- public void printStackTrace(PrintStream stream)
- {
- super.printStackTrace(stream);
- }
-
- /**
- * Print the stack trace to a stream.
- *
- * @param stream the stream
- */
- public void printStackTrace(PrintWriter stream)
- {
- super.printStackTrace(stream);
- }
-}
diff --git a/libjava/java/security/cert/CertStoreParameters.java b/libjava/java/security/cert/CertStoreParameters.java
deleted file mode 100644
index aab22f01fda..00000000000
--- a/libjava/java/security/cert/CertStoreParameters.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* CertStoreParameters -- interface to CertStore parameters.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * Parameters used when creating instances of {@link CertStore}. This
- * class does not define any methods (except a required cloneable
- * interface) and is provided only to provide type safety for
- * implementations. Concrete implementations implement this interface
- * in accord with thier own needs.
- *
- * @see LDAPCertStoreParameters
- * @see CollectionCertStoreParameters
- */
-public interface CertStoreParameters extends Cloneable
-{
-
- /**
- * Create a copy of these parameters.
- *
- * @return The copy.
- */
- Object clone();
-}
diff --git a/libjava/java/security/cert/CertStoreSpi.java b/libjava/java/security/cert/CertStoreSpi.java
deleted file mode 100644
index eca0e866ca1..00000000000
--- a/libjava/java/security/cert/CertStoreSpi.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* CertStoreSpi -- certificate store service provider interface.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.util.Collection;
-
-/**
- * The <i>service provider interface</i> (<b>SPI</b>) for the {@link
- * CertStore} class.
- *
- * <p>Providers wishing to implement a CertStore must subclass this
- * class, implementing all the abstract methods. Providers may also
- * implement the {@link CertStoreParameters} interface, if they require
- * parameters.
- *
- * @since JDK 1.4
- * @see CertStore
- * @see CollectionCertStoreParameters
- * @see LDAPCertStoreParameters
- */
-public abstract class CertStoreSpi
-{
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new CertStoreSpi.
- *
- * @param params The parameters to initialize this instance with, or
- * null if no parameters are required.
- * @throws InvalidAlgorithmParameterException If the specified
- * parameters are inappropriate for this class.
- */
- public CertStoreSpi(CertStoreParameters params)
- throws java.security.InvalidAlgorithmParameterException
- {
- super();
- }
-
- // Abstract methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get the certificates from this store, filtering them through the
- * specified CertSelector.
- *
- * @param selector The CertSelector to filter certificates.
- * @return A (non-null) collection of certificates.
- * @throws CertStoreException If the certificates cannot be retrieved.
- */
- public abstract Collection engineGetCertificates(CertSelector selector)
- throws CertStoreException;
-
- /**
- * Get the certificate revocation list from this store, filtering them
- * through the specified CRLSelector.
- *
- * @param selector The CRLSelector to filter certificate revocation
- * lists.
- * @return A (non-null) collection of certificate revocation list.
- * @throws CertStoreException If the CRLs cannot be retrieved.
- */
- public abstract Collection engineGetCRLs(CRLSelector selector)
- throws CertStoreException;
-}
diff --git a/libjava/java/security/cert/Certificate.java b/libjava/java/security/cert/Certificate.java
deleted file mode 100644
index f8456f97ae5..00000000000
--- a/libjava/java/security/cert/Certificate.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/* Certificate.java --- Certificate class
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.io.ByteArrayInputStream;
-import java.io.InvalidObjectException;
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.PublicKey;
-import java.security.SignatureException;
-
-/**
- * The Certificate class is an abstract class used to manage
- * identity certificates. An identity certificate is a
- * combination of a principal and a public key which is
- * certified by another principal. This is the puprose of
- * Certificate Authorities (CA).
- *
- * <p>This class is used to manage different types of certificates
- * but have important common puposes. Different types of
- * certificates like X.509 and OpenPGP share general certificate
- * functions (like encoding and verifying) and information like
- * public keys.
- *
- * <p>X.509, OpenPGP, and SDSI can be implemented by subclassing this
- * class even though they differ in storage methods and information
- * stored.
- *
- * @see CertificateFactory
- * @see X509Certificate
- * @since JDK 1.2
- * @author Mark Benvenuto
- * @author Casey Marshall
- */
-public abstract class Certificate implements Serializable
-{
- private static final long serialVersionUID = -6751606818319535583L;
-
- private String type;
-
- /**
- Constructs a new certificate of the specified type. An example
- is "X.509".
-
- @param type a valid standard name for a certificate.
- */
- protected Certificate(String type)
- {
- this.type = type;
- }
-
- /**
- Returns the Certificate type.
-
- @return a string representing the Certificate type
- */
- public final String getType()
- {
- return type;
- }
-
- /**
- Compares this Certificate to other. It checks if the
- object if instanceOf Certificate and then checks if
- the encoded form matches.
-
- @param other An Object to test for equality
-
- @return true if equal, false otherwise
- */
- public boolean equals(Object other)
- {
- if( other instanceof Certificate ) {
- try {
- Certificate x = (Certificate) other;
- if( getEncoded().length != x.getEncoded().length )
- return false;
-
- byte[] b1 = getEncoded();
- byte[] b2 = x.getEncoded();
-
- for( int i = 0; i < b1.length; i++ )
- if( b1[i] != b2[i] )
- return false;
-
- } catch( CertificateEncodingException cee ) {
- return false;
- }
- return true;
- }
- return false;
- }
-
- /**
- Returns a hash code for this Certificate in its encoded
- form.
-
- @return A hash code of this class
- */
- public int hashCode()
- {
- return super.hashCode();
- }
-
- /**
- Gets the DER ASN.1 encoded format for this Certificate.
- It assumes each certificate has only one encoding format.
- Ex: X.509 is encoded as ASN.1 DER
-
- @return byte array containg encoded form
-
- @throws CertificateEncodingException if an error occurs
- */
- public abstract byte[] getEncoded() throws CertificateEncodingException;
-
- /**
- Verifies that this Certificate was properly signed with the
- PublicKey that corresponds to its private key.
-
- @param key PublicKey to verify with
-
- @throws CertificateException encoding error
- @throws NoSuchAlgorithmException unsupported algorithm
- @throws InvalidKeyException incorrect key
- @throws NoSuchProviderException no provider
- @throws SignatureException signature error
- */
- public abstract void verify(PublicKey key)
- throws CertificateException,
- NoSuchAlgorithmException,
- InvalidKeyException,
- NoSuchProviderException,
- SignatureException;
-
- /**
- Verifies that this Certificate was properly signed with the
- PublicKey that corresponds to its private key and uses
- the signature engine provided by the provider.
-
- @param key PublicKey to verify with
- @param sigProvider Provider to use for signature algorithm
-
- @throws CertificateException encoding error
- @throws NoSuchAlgorithmException unsupported algorithm
- @throws InvalidKeyException incorrect key
- @throws NoSuchProviderException incorrect provider
- @throws SignatureException signature error
- */
- public abstract void verify(PublicKey key,
- String sigProvider)
- throws CertificateException,
- NoSuchAlgorithmException,
- InvalidKeyException,
- NoSuchProviderException,
- SignatureException;
-
- /**
- Returns a string representing the Certificate.
-
- @return a string representing the Certificate.
- */
- public abstract String toString();
-
-
- /**
- Returns the public key stored in the Certificate.
-
- @return The public key
- */
- public abstract PublicKey getPublicKey();
-
- // Protected methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns a replacement for this certificate to be serialized. This
- * method returns the equivalent to the following for this class:
- *
- * <blockquote>
- * <pre>new CertificateRep(getType(), getEncoded());</pre>
- * </blockquote>
- *
- * <p>This thusly replaces the certificate with its name and its
- * encoded form, which can be deserialized later with the {@link
- * CertificateFactory} implementation for this certificate's type.
- *
- * @return The replacement object to be serialized.
- * @throws ObjectStreamException If the replacement could not be
- * created.
- */
- protected Object writeReplace() throws ObjectStreamException
- {
- try
- {
- return new CertificateRep(getType(), getEncoded());
- }
- catch (CertificateEncodingException cee)
- {
- throw new InvalidObjectException(cee.toString());
- }
- }
-
- // Inner class.
- // ------------------------------------------------------------------------
-
- /**
- Certificate.CertificateRep is an inner class used to provide an alternate
- storage mechanism for serialized Certificates.
- */
- protected static class CertificateRep implements java.io.Serializable
- {
-
- /** From JDK1.4. */
- private static final long serialVersionUID = -8563758940495660020L;
-
- /** The certificate type, e.g. "X.509". */
- private String type;
-
- /** The encoded certificate data. */
- private byte[] data;
-
- /**
- * Create an alternative representation of this certificate. The
- * <code>(type, data)</code> pair is typically the certificate's
- * type as returned by {@link Certificate#getType()} (i.e. the
- * canonical name of the certificate type) and the encoded form as
- * returned by {@link Certificate#getEncoded()}.
- *
- * <p>For example, X.509 certificates would create an instance of
- * this class with the parameters "X.509" and the ASN.1
- * representation of the certificate, encoded as DER bytes.
- *
- * @param type The certificate type.
- * @param data The encoded certificate data.
- */
- protected CertificateRep(String type, byte[] data)
- {
- this.type = type;
- this.data = data;
- }
-
- /**
- * Deserialize this certificate replacement into the appropriate
- * certificate object. That is, this method attempts to create a
- * {@link CertificateFactory} for this certificate's type, then
- * attempts to parse the encoded data with that factory, returning
- * the resulting certificate.
- *
- * @return The deserialized certificate.
- * @throws ObjectStreamException If there is no appropriate
- * certificate factory for the given type, or if the encoded form
- * cannot be parsed.
- */
- protected Object readResolve() throws ObjectStreamException
- {
- try
- {
- CertificateFactory fact = CertificateFactory.getInstance(type);
- return fact.generateCertificate(new ByteArrayInputStream(data));
- }
- catch (Exception e)
- {
- throw new InvalidObjectException(e.toString());
- }
- }
- }
-}
diff --git a/libjava/java/security/cert/CertificateEncodingException.java b/libjava/java/security/cert/CertificateEncodingException.java
deleted file mode 100644
index 0bb0c26d358..00000000000
--- a/libjava/java/security/cert/CertificateEncodingException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* CertificateEncodingException.java -- Certificate Encoding Exception
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * Exception for a Certificate Encoding.
- *
- * @author Mark Benvenuto
- * @since 1.2
- * @status updated to 1.4
- */
-public class CertificateEncodingException extends CertificateException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 6219492851589449162L;
-
- /**
- * Constructs an exception without a message string.
- */
- public CertificateEncodingException()
- {
- }
-
- /**
- * Constructs an exception with a message string.
- *
- * @param msg A message to display with exception
- */
- public CertificateEncodingException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/cert/CertificateException.java b/libjava/java/security/cert/CertificateException.java
deleted file mode 100644
index 3e075ddaf35..00000000000
--- a/libjava/java/security/cert/CertificateException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* CertificateException.java -- Certificate Exception
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.security.GeneralSecurityException;
-
-/**
- * Exception for a Certificate.
- *
- * @author Mark Benvenuto
- * @see Certificate
- * @since 1.2
- * @status updated to 1.4
- */
-public class CertificateException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 3192535253797119798L;
-
- /**
- * Constructs an exception without a message string.
- */
- public CertificateException()
- {
- }
-
- /**
- * Constructs an exception with a message string.
- *
- * @param msg a message to display with exception
- */
- public CertificateException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/cert/CertificateExpiredException.java b/libjava/java/security/cert/CertificateExpiredException.java
deleted file mode 100644
index 5b37142b5ec..00000000000
--- a/libjava/java/security/cert/CertificateExpiredException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* CertificateExpiredException.java --- Certificate Expired Exception
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * Exception for a Certificate Expiring.
- *
- * @author Mark Benvenuto
- * @since 1.2
- * @status updated to 1.4
- */
-public class CertificateExpiredException extends CertificateException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 9071001339691533771L;
-
- /**
- * Constructs an exception without a message string.
- */
- public CertificateExpiredException()
- {
- }
-
- /**
- * Constructs an exception with a message string.
- *
- * @param msg a message to display with exception
- */
- public CertificateExpiredException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/cert/CertificateFactory.java b/libjava/java/security/cert/CertificateFactory.java
deleted file mode 100644
index aedeff53573..00000000000
--- a/libjava/java/security/cert/CertificateFactory.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/* CertificateFactory.java -- Certificate Factory Class
- Copyright (C) 1999, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import gnu.java.security.Engine;
-
-import java.io.InputStream;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.Security;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * This class implements the CertificateFactory class interface used to
- * generate certificates, certificate revocation lists (CRLs), and certificate
- * paths objects from their encoded forms.
- *
- * @author Mark Benvenuto
- * @author Casey Marshall
- * @since JDK 1.2
- * @status Fully compatible with JDK 1.4.
- */
-public class CertificateFactory
-{
-
- /** The service name for certificate factories. */
- private static final String CERTIFICATE_FACTORY = "CertificateFactory";
-
- private CertificateFactorySpi certFacSpi;
- private Provider provider;
- private String type;
-
- /**
- * Creates an instance of CertificateFactory.
- *
- * @param certFacSpi The underlying CertificateFactory engine.
- * @param provider The provider of this implementation.
- * @param type The type of Certificate this factory creates.
- */
- protected CertificateFactory(CertificateFactorySpi certFacSpi,
- Provider provider, String type)
- {
- this.certFacSpi = certFacSpi;
- this.provider = provider;
- this.type = type;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Gets an instance of the CertificateFactory class representing
- * the specified certificate factory. If the type is not
- * found then, it throws CertificateException.
- *
- * @param type The type of certificate factory to create.
- * @return a CertificateFactory repesenting the desired type
- * @throws CertificateException If the type of certificate is not
- * implemented by any installed provider.
- */
- public static final CertificateFactory getInstance(String type)
- throws CertificateException
- {
- Provider[] p = Security.getProviders();
-
- for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(type, p[i]);
- }
- catch (CertificateException e)
- {
- // Ignored.
- }
- }
-
- throw new CertificateException(type);
- }
-
- /**
- * Gets an instance of the CertificateFactory class representing
- * the specified certificate factory from the specified provider.
- * If the type is not found then, it throws {@link CertificateException}.
- * If the provider is not found, then it throws
- * {@link java.security.NoSuchProviderException}.
- *
- * @param type The type of certificate factory to create.
- * @param provider The name of the provider from which to get the
- * implementation.
- * @return A CertificateFactory for the desired type.
- * @throws CertificateException If the type of certificate is not
- * implemented by the named provider.
- * @throws NoSuchProviderException If the named provider is not installed.
- */
- public static final CertificateFactory getInstance(String type,
- String provider)
- throws CertificateException, NoSuchProviderException
- {
- Provider p = Security.getProvider(provider);
- if( p == null)
- throw new NoSuchProviderException(provider);
-
- return getInstance(type, p);
- }
-
- /**
- * Get a certificate factory for the given certificate type from the
- * given provider.
- *
- * @param type The type of certificate factory to create.
- * @param provider The provider from which to get the implementation.
- * @return A CertificateFactory for the desired type.
- * @throws CertificateException If the type of certificate is not
- * implemented by the provider.
- * @throws IllegalArgumentException If the provider is null.
- */
- public static final CertificateFactory getInstance(String type,
- Provider provider)
- throws CertificateException
- {
- if (provider == null)
- throw new IllegalArgumentException("null provider");
-
- try
- {
- return new CertificateFactory((CertificateFactorySpi)
- Engine.getInstance(CERTIFICATE_FACTORY, type, provider),
- provider, type);
- }
- catch (ClassCastException cce)
- {
- throw new CertificateException(type);
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- throw new CertificateException(type);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- throw new CertificateException(nsae.getMessage());
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Gets the provider of this implementation.
- *
- * @return The provider of this implementation.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Returns the type of the certificate this factory creates.
- *
- * @return A string with the type of certificate
- */
- public final String getType()
- {
- return type;
- }
-
- /**
- * Generates a Certificate from the encoded data read
- * from an InputStream.
- *
- * <p>The input stream must contain only one certificate.
- *
- * <p>If there exists a specialized certificate class for the
- * certificate format handled by the certificate factory
- * then the return Ceritificate should be a typecast of it.
- * Ex: A X.509 CertificateFactory should return X509Certificate.
- *
- * <p>For X.509 certificates, the certificate in inStream must be
- * DER encoded and supplied in binary or printable (Base64)
- * encoding. If the certificate is in Base64 encoding, it must be
- * bounded by -----BEGINCERTIFICATE-----, and
- * -----END CERTIFICATE-----.
- *
- * @param inStream An input stream containing the certificate data.
- * @return A certificate initialized from the decoded InputStream data.
- * @throws CertificateException If an error occurs decoding the
- * certificate.
- */
- public final Certificate generateCertificate(InputStream inStream)
- throws CertificateException
- {
- return certFacSpi.engineGenerateCertificate(inStream);
- }
-
- /**
- * Returns a collection of certificates that were read from the
- * input stream. It may be empty, have only one, or have
- * multiple certificates.
- *
- * For a X.509 certificate factory, the stream may contain a
- * single DER encoded certificate or a PKCS#7 certificate
- * chain. This is a PKCS#7 <I>SignedData</I> object with the
- * most significant field being <I>certificates</I>. If no
- * CRLs are present, then an empty collection is returned.
- *
- * @param inStream An input stream containing the certificate data.
- * @return A collection of certificates initialized from the decoded
- * InputStream data.
- * @throws CertificateException If an error occurs decoding the
- * certificates.
- */
- public final Collection generateCertificates(InputStream inStream)
- throws CertificateException
- {
- return certFacSpi.engineGenerateCertificates(inStream);
- }
-
- /**
- * Generates a CRL based on the encoded data read
- * from the InputStream.
- *
- * <p>The input stream must contain only one CRL.
- *
- * <p>If there exists a specialized CRL class for the
- * CRL format handled by the certificate factory
- * then the return CRL should be a typecast of it.
- * Ex: A X.509 CertificateFactory should return X509CRL.
- *
- * @param inStream An input stream containing the CRL data.
- * @return A CRL initialized from the decoded InputStream data.
- * @throws CRLException If an error occurs decoding the CRL.
- */
- public final CRL generateCRL(InputStream inStream)
- throws CRLException
- {
- return certFacSpi.engineGenerateCRL(inStream);
- }
-
- /**
- * <p>Generates CRLs based on the encoded data read
- * from the InputStream.
- *
- * <p>For a X.509 certificate factory, the stream may contain a
- * single DER encoded CRL or a PKCS#7 CRL set. This is a
- * PKCS#7 <I>SignedData</I> object with the most significant
- * field being <I>crls</I>. If no CRLs are present, then an
- * empty collection is returned.
- *
- * @param inStream an input stream containing the CRLs.
- * @return a collection of CRLs initialized from the decoded
- * InputStream data.
- * @throws CRLException If an error occurs decoding the CRLs.
- */
- public final Collection generateCRLs(InputStream inStream)
- throws CRLException
- {
- return certFacSpi.engineGenerateCRLs( inStream );
- }
-
- /**
- * Generate a {@link CertPath} and initialize it with data parsed from
- * the input stream. The default encoding of this factory is used.
- *
- * @param inStream The InputStream containing the CertPath data.
- * @return A CertPath initialized from the input stream data.
- * @throws CertificateException If an error occurs decoding the
- * CertPath.
- */
- public final CertPath generateCertPath(InputStream inStream)
- throws CertificateException
- {
- return certFacSpi.engineGenerateCertPath(inStream);
- }
-
- /**
- * Generate a {@link CertPath} and initialize it with data parsed from
- * the input stream, using the specified encoding.
- *
- * @param inStream The InputStream containing the CertPath data.
- * @param encoding The encoding of the InputStream data.
- * @return A CertPath initialized from the input stream data.
- * @throws CertificateException If an error occurs decoding the
- * CertPath.
- */
- public final CertPath generateCertPath(InputStream inStream, String encoding)
- throws CertificateException
- {
- return certFacSpi.engineGenerateCertPath(inStream, encoding);
- }
-
- /**
- * Generate a {@link CertPath} and initialize it with the certificates
- * in the {@link java.util.List} argument.
- *
- * @param certificates The list of certificates with which to create
- * the CertPath.
- * @return A CertPath initialized from the certificates.
- * @throws CertificateException If an error occurs generating the
- * CertPath.
- */
- public final CertPath generateCertPath(List certificates)
- throws CertificateException
- {
- return certFacSpi.engineGenerateCertPath(certificates);
- }
-
- /**
- * Returns an Iterator of CertPath encodings supported by this
- * factory, with the default encoding first. The returned Iterator
- * cannot be modified.
- *
- * @return The Iterator of supported encodings.
- */
- public final Iterator getCertPathEncodings()
- {
- return certFacSpi.engineGetCertPathEncodings();
- }
-} // class CertificateFactory
diff --git a/libjava/java/security/cert/CertificateFactorySpi.java b/libjava/java/security/cert/CertificateFactorySpi.java
deleted file mode 100644
index beea9646a67..00000000000
--- a/libjava/java/security/cert/CertificateFactorySpi.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/* CertificateFactorySpi.java --- Certificate Factory Class
- Copyright (C) 1999,2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.io.InputStream;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- CertificateFactorySpi is the abstract class Service Provider
- Interface (SPI) for the CertificateFactory class. A provider
- must implement all the abstract methods if they wish to
- supply a certificate factory for a particular certificate
- type. Ex: X.509
-
- Certificate factories are used to generate certificates and
- certificate revocation lists (CRL) from their encoding.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
- */
-public abstract class CertificateFactorySpi
-{
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Constructs a new CertificateFactorySpi
- */
- public CertificateFactorySpi()
- {}
-
- // Abstract methods.
- // ------------------------------------------------------------------------
-
- /**
- Generates a Certificate based on the encoded data read
- from the InputStream.
-
- The input stream must contain only one certificate.
-
- If there exists a specialized certificate class for the
- certificate format handled by the certificate factory
- then the return Ceritificate should be a typecast of it.
- Ex: A X.509 CertificateFactory should return X509Certificate.
-
- For X.509 certificates, the certificate in inStream must be
- DER encoded and supplied in binary or printable (Base64)
- encoding. If the certificate is in Base64 encoding, it must be
- bounded by -----BEGIN CERTIFICATE-----, and
- -----END CERTIFICATE-----.
-
- @param inStream an input stream containing the certificate data
-
- @return a certificate initialized with InputStream data.
-
- @throws CertificateException Certificate parsing error
- */
- public abstract Certificate engineGenerateCertificate(InputStream inStream)
- throws CertificateException;
-
- /**
- Returns a collection of certificates that were read from the
- input stream. It may be empty, have only one, or have
- multiple certificates.
-
- For a X.509 certificate factory, the stream may contain a
- single DER encoded certificate or a PKCS#7 certificate
- chain. This is a PKCS#7 <I>SignedData</I> object with the
- most significant field being <I>certificates</I>. If no
- CRLs are present, then an empty collection is returned.
-
- @param inStream an input stream containing the certificates
-
- @return a collection of certificates initialized with
- the InputStream data.
-
- @throws CertificateException Certificate parsing error
- */
- public abstract Collection engineGenerateCertificates(InputStream inStream)
- throws CertificateException;
-
- /**
- Generates a CRL based on the encoded data read
- from the InputStream.
-
- The input stream must contain only one CRL.
-
- If there exists a specialized CRL class for the
- CRL format handled by the certificate factory
- then the return CRL should be a typecast of it.
- Ex: A X.509 CertificateFactory should return X509CRL.
-
- @param inStream an input stream containing the CRL data
-
- @return a CRL initialized with InputStream data.
-
- @throws CRLException CRL parsing error
- */
- public abstract CRL engineGenerateCRL(InputStream inStream)
- throws CRLException;
-
- /**
- Generates CRLs based on the encoded data read
- from the InputStream.
-
- For a X.509 certificate factory, the stream may contain a
- single DER encoded CRL or a PKCS#7 CRL set. This is a
- PKCS#7 <I>SignedData</I> object with the most significant
- field being <I>crls</I>. If no CRLs are present, then an
- empty collection is returned.
-
- @param inStream an input stream containing the CRLs
-
- @return a collection of CRLs initialized with
- the InputStream data.
-
- @throws CRLException CRL parsing error
- */
- public abstract Collection engineGenerateCRLs(InputStream inStream)
- throws CRLException;
-
- // 1.4 instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Generate a {@link CertPath} and initialize it with data parsed from
- * the input stream. The default encoding of this factory is used.
- *
- * @param inStream The InputStream containing the CertPath data.
- * @return A CertPath initialized from the input stream data.
- * @throws CertificateException If an error occurs decoding the
- * CertPath.
- */
- public CertPath engineGenerateCertPath(InputStream inStream)
- throws CertificateException
- {
- throw new UnsupportedOperationException("not implemented");
- }
-
- /**
- * Generate a {@link CertPath} and initialize it with data parsed from
- * the input stream, using the specified encoding.
- *
- * @param inStream The InputStream containing the CertPath data.
- * @param encoding The encoding of the InputStream data.
- * @return A CertPath initialized from the input stream data.
- * @throws CertificateException If an error occurs decoding the
- * CertPath.
- */
- public CertPath engineGenerateCertPath(InputStream inStream, String encoding)
- throws CertificateException
- {
- throw new UnsupportedOperationException("not implemented");
- }
-
- /**
- * Generate a {@link CertPath} and initialize it with the certificates
- * in the {@link java.util.List} argument.
- *
- * @param certificates The list of certificates with which to create
- * the CertPath.
- * @return A CertPath initialized from the certificates.
- * @throws CertificateException If an error occurs generating the
- * CertPath.
- */
- public CertPath engineGenerateCertPath(List certificates)
- throws CertificateException
- {
- throw new UnsupportedOperationException("not implemented");
- }
-
- /**
- * Returns an Iterator of CertPath encodings supported by this
- * factory, with the default encoding first. The returned Iterator
- * cannot be modified.
- *
- * @return The Iterator of supported encodings.
- */
- public Iterator engineGetCertPathEncodings()
- {
- throw new UnsupportedOperationException("not implemented");
- }
-}
-
diff --git a/libjava/java/security/cert/CertificateNotYetValidException.java b/libjava/java/security/cert/CertificateNotYetValidException.java
deleted file mode 100644
index dfb4b483785..00000000000
--- a/libjava/java/security/cert/CertificateNotYetValidException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* CertificateNotYetValidException.java -- Certificate Not Yet Valid Exception
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * Exception for a Certificate that is not yet valid.
- *
- * @author Mark Benvenuto
- * @since 1.2
- * @status updated to 1.4
-*/
-public class CertificateNotYetValidException extends CertificateException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 4355919900041064702L;
-
- /**
- * Constructs an exception without a message string.
- */
- public CertificateNotYetValidException()
- {
- }
-
- /**
- * Constructs an exception with a message string.
- *
- * @param msg A message to display with exception
- */
- public CertificateNotYetValidException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/cert/CertificateParsingException.java b/libjava/java/security/cert/CertificateParsingException.java
deleted file mode 100644
index 61faa44386e..00000000000
--- a/libjava/java/security/cert/CertificateParsingException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* CertificateParsingException.java -- Certificate Parsing Exception
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * Exception for parsing a DER-encoded Certificate.
- *
- * @author Mark Benvenuto
- * @since 1.2
- * @status updated to 1.4
-*/
-public class CertificateParsingException extends CertificateException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -7989222416793322029L;
-
- /**
- * Constructs an exception without a message string.
- */
- public CertificateParsingException()
- {
- }
-
- /**
- * Constructs an exception with a message string.
- *
- * @param msg a message to display with exception
- */
- public CertificateParsingException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/cert/CollectionCertStoreParameters.java b/libjava/java/security/cert/CollectionCertStoreParameters.java
deleted file mode 100644
index bac1e3b3e4f..00000000000
--- a/libjava/java/security/cert/CollectionCertStoreParameters.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* CollectionCertStoreParameters -- collection-based cert store parameters
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * An implementation of {@link CertStoreParameters} with a simple,
- * in-memory {@link Collection} of certificates and certificate
- * revocation list.
- *
- * <p>Note that this class is not thread-safe, and its underlying
- * collection may be changed at any time.
- *
- * @see CertStore
- */
-public class CollectionCertStoreParameters implements CertStoreParameters
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** The underlying collection. */
- private final Collection collection;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new CollectionCertStoreParameters with an empty,
- * immutable collection.
- */
- public CollectionCertStoreParameters()
- {
- this(Collections.EMPTY_LIST);
- }
-
- /**
- * Create a new CollectionCertStoreParameters with the specified
- * collection. The argument is not copied, and subsequent changes to
- * the collection will change this class's collection.
- *
- * @param collection The collection.
- * @throws NullPointerException If <i>collection</i> is null.
- */
- public CollectionCertStoreParameters(Collection collection)
- {
- if (collection == null)
- throw new NullPointerException();
- this.collection = collection;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- public Object clone()
- {
- return new CollectionCertStoreParameters(new ArrayList(collection));
- }
-
- /**
- * Return the underlying collection. The collection is not copied
- * before being returned, so callers may update the collection that is
- * returned.
- *
- * @return The collection.
- */
- public Collection getCollection()
- {
- return collection;
- }
-
- /**
- * Return a string representation of these parameters.
- *
- * @return The string representation of these parameters.
- */
- public String toString()
- {
- return "CollectionCertStoreParameters: [ collection: "
- + collection + " ]";
- }
-}
diff --git a/libjava/java/security/cert/LDAPCertStoreParameters.java b/libjava/java/security/cert/LDAPCertStoreParameters.java
deleted file mode 100644
index 4414e65a092..00000000000
--- a/libjava/java/security/cert/LDAPCertStoreParameters.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* LDAPCertStoreParameters.java -- LDAP CertStore parameters.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * Parameters for CertStores that are retrieved via the <i>lightweight
- * directory access protocol</i> (<b>LDAP</b>).
- *
- * @see CertStore
- */
-public class LDAPCertStoreParameters implements CertStoreParameters
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** The default LDAP port. */
- private static final int LDAP_PORT = 389;
-
- /** The server name. */
- private final String serverName;
-
- /** The LDAP port. */
- private final int port;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new LDAPCertStoreParameters object, with a servername of
- * "localhost" and a port of 389.
- */
- public LDAPCertStoreParameters()
- {
- this("localhost", LDAP_PORT);
- }
-
- /**
- * Create a new LDAPCertStoreParameters object, with a specified
- * server name and a port of 389.
- *
- * @param serverName The LDAP server name.
- * @throws NullPointerException If <i>serverName</i> is null.
- */
- public LDAPCertStoreParameters(String serverName)
- {
- this(serverName, LDAP_PORT);
- }
-
- /**
- * Create a new LDAPCertStoreParameters object, with a specified
- * server name and port.
- *
- * @param serverName The LDAP server name.
- * @param port The LDAP port.
- * @throws NullPointerException If <i>serverName</i> is null.
- */
- public LDAPCertStoreParameters(String serverName, int port)
- {
- if (serverName == null)
- throw new NullPointerException();
- this.serverName = serverName;
- this.port = port;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- public Object clone()
- {
- return new LDAPCertStoreParameters(serverName, port);
- }
-
- /**
- * Return the server name.
- *
- * @return The server name.
- */
- public String getServerName()
- {
- return serverName;
- }
-
- /**
- * Return the port.
- *
- * @return the port.
- */
- public int getPort()
- {
- return port;
- }
-
- /**
- * Return a string representation of these parameters.
- *
- * @return The string representation of these parameters.
- */
- public String toString()
- {
- return "LDAPCertStoreParameters: [ serverName: " + serverName
- + "; port: " + port + " ]";
- }
-}
diff --git a/libjava/java/security/cert/PKIXBuilderParameters.java b/libjava/java/security/cert/PKIXBuilderParameters.java
deleted file mode 100644
index 38b3df5e78a..00000000000
--- a/libjava/java/security/cert/PKIXBuilderParameters.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/* PKIXBuilderParameters.java -- parameters for PKIX cert path builders
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-
-import java.util.Set;
-
-/**
- * Parameters for building certificate paths using the PKIX algorithm.
- *
- * @see CertPathBuilder
- */
-public class PKIXBuilderParameters extends PKIXParameters
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The maximum path length. */
- private int maxPathLength;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new PKIXBuilderParameters object, populating the trusted
- * certificates set with all X.509 certificates found in the given key
- * store. All certificates found in the key store are assumed to be
- * trusted by this constructor.
- *
- * @param keystore The key store.
- * @param targetConstraints The target certificate constraints.
- * @throws KeyStoreException If the certificates cannot be retrieved
- * from the key store.
- * @throws InvalidAlgorithmParameterException If there are no
- * certificates in the key store.
- * @throws NullPointerException If <i>keystore</i> is null.
- */
- public PKIXBuilderParameters(KeyStore keystore,
- CertSelector targetConstraints)
- throws KeyStoreException, InvalidAlgorithmParameterException
- {
- super(keystore);
- setTargetCertConstraints(targetConstraints);
- maxPathLength = 5;
- }
-
- /**
- * Create a new PKIXBuilderParameters object, populating the trusted
- * certificates set with the elements of the given set, each of which
- * must be a {@link TrustAnchor}.
- *
- * @param trustAnchors The set of trust anchors.
- * @param targetConstraints The target certificate constraints.
- * @throws InvalidAlgorithmParameterException If there are no
- * certificates in the set.
- * @throws NullPointerException If <i>trustAnchors</i> is null.
- * @throws ClassCastException If every element in <i>trustAnchors</i>
- * is not a {@link TrustAnchor}.
- */
- public PKIXBuilderParameters(Set trustAnchors, CertSelector targetConstraints)
- throws InvalidAlgorithmParameterException
- {
- super(trustAnchors);
- setTargetCertConstraints(targetConstraints);
- maxPathLength = 5;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the maximum length of certificate paths to build.
- *
- * <p>If this value is 0 it is taken to mean that the certificate path
- * should contain only one certificate. A value of -1 means that the
- * certificate path length is unconstrained. The default value is 5.
- *
- * @return The maximum path length.
- */
- public int getMaxPathLength()
- {
- return maxPathLength;
- }
-
- /**
- * Sets the maximum length of certificate paths to build.
- *
- * @param maxPathLength The new path length.
- * @throws IllegalArgumentException If <i>maxPathLength</i> is less
- * than -1.
- */
- public void setMaxPathLength(int maxPathLength)
- {
- if (maxPathLength < -1)
- throw new IllegalArgumentException();
- this.maxPathLength = maxPathLength;
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(super.toString());
- buf.insert(buf.length() - 2, "; Max Path Length=" + maxPathLength);
- return buf.toString();
- }
-}
diff --git a/libjava/java/security/cert/PKIXCertPathBuilderResult.java b/libjava/java/security/cert/PKIXCertPathBuilderResult.java
deleted file mode 100644
index 5091dd41298..00000000000
--- a/libjava/java/security/cert/PKIXCertPathBuilderResult.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* PKIXCertPathBuilderResult.java -- PKIX cert path bulider result
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-/**
- * The result of calling the {@link
- * CertPathBuilder#build(java.security.cert.CertPathParameters)} method
- * of PKIX {@link CertPathBuilder}s.
- *
- * @see CertPathBuilder
- * @see CertPathBuilderResult
- */
-public class PKIXCertPathBuilderResult extends PKIXCertPathValidatorResult
- implements CertPathBuilderResult
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The certificate path. */
- private CertPath certPath;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new PKIXCertPathBuilderResult.
- *
- * @param certPath The certificate path.
- * @param trustAnchor The trust anchor.
- * @param policyTree The root node of the policy tree.
- * @param subjectPublicKey The public key.
- * @throws NullPointerException If <i>certPath</i>, <i>trustAnchor</i> or
- * <i>subjectPublicKey</i> is null.
- */
- public PKIXCertPathBuilderResult(CertPath certPath,
- TrustAnchor trustAnchor,
- PolicyNode policyTree,
- java.security.PublicKey subjectPublicKey)
- {
- super(trustAnchor, policyTree, subjectPublicKey);
- if (certPath == null)
- throw new NullPointerException();
- this.certPath = certPath;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the certificate path that was built.
- *
- * @return The certificate path that was built.
- */
- public CertPath getCertPath()
- {
- return certPath;
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(super.toString());
- buf.insert(buf.length() - 2, "; CertPath=" + certPath);
- return buf.toString();
- }
-}
diff --git a/libjava/java/security/cert/PKIXCertPathChecker.java b/libjava/java/security/cert/PKIXCertPathChecker.java
deleted file mode 100644
index 7a33576e1bb..00000000000
--- a/libjava/java/security/cert/PKIXCertPathChecker.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* PKIXCertPathChecker.java -- checks X.509 certificate paths.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.util.Collection;
-import java.util.Set;
-
-/**
- * A validator for X.509 certificates when approving certificate chains.
- *
- * <p>Concrete subclasses can be passed to the {@link
- * PKIXParameters#setCertPathCheckers(java.util.List)} and {@link
- * PKIXParameters#addCertPathChecker(java.security.cert.PKIXCertPathChecker}
- * methods, which are then used to set up PKIX certificate chain
- * builders or validators. These classes then call the {@link
- * #check(java.security.cert.Certificate,java.util.Collection)} method
- * of this class, performing whatever checks on the certificate,
- * throwing an exception if any check fails.
- *
- * <p>Subclasses of this must be able to perform their checks in the
- * backward direction -- from the most-trusted certificate to the target
- * -- and may optionally support forward checking -- from the target to
- * the most-trusted certificate.
- *
- * @see PKIXParameters
- */
-public abstract class PKIXCertPathChecker implements Cloneable
-{
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /** Default constructor. */
- protected PKIXCertPathChecker()
- {
- super();
- }
-
- // Cloneable interface.
- // ------------------------------------------------------------------------
-
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException cnse)
- {
- throw new InternalError(cnse.getMessage());
- }
- }
-
- // Abstract methods.
- // ------------------------------------------------------------------------
-
- /**
- * Initialize this PKIXCertPathChecker. If subclasses support forward
- * checking, a value of true can be passed to this method, and
- * certificates can be validated from the target certificate to the
- * most-trusted certifcate.
- *
- * @param forward The direction of this PKIXCertPathChecker.
- * @throws CertPathValidatorException If <i>forward</i> is true and
- * this class does not support forward checking.
- */
- public abstract void init(boolean forward) throws CertPathValidatorException;
-
- /**
- * Returns whether or not this class supports forward checking.
- *
- * @return Whether or not this class supports forward checking.
- */
- public abstract boolean isForwardCheckingSupported();
-
- /**
- * Returns an immutable set of X.509 extension object identifiers (OIDs)
- * supported by this PKIXCertPathChecker.
- *
- * @return An immutable set of Strings of the supported X.509 OIDs, or
- * null if no extensions are supported.
- */
- public abstract Set getSupportedExtensions();
-
- /**
- * Checks a certificate, removing any critical extensions that are
- * resolved in this check.
- *
- * @param cert The certificate to check.
- * @param unresolvedCritExts The (mutable) collection of as-of-yet
- * unresolved critical extensions, as OID strings.
- * @throws CertPathValidatorException If this certificate fails this
- * check.
- */
- public abstract void check(Certificate cert, Collection unresolvedCritExts)
- throws CertPathValidatorException;
-}
diff --git a/libjava/java/security/cert/PKIXCertPathValidatorResult.java b/libjava/java/security/cert/PKIXCertPathValidatorResult.java
deleted file mode 100644
index 5a1660c3bc9..00000000000
--- a/libjava/java/security/cert/PKIXCertPathValidatorResult.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/* PKIXCertPathValidatorResult.java -- PKIX cert path builder result
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.security.PublicKey;
-
-/**
- * Results returned by the {@link
- * CertPathValidator#validate(java.security.cert.CertPath,java.security.cert.CertPathParameters)}
- * method for PKIX {@link CertPathValidator}s.
- *
- * @see CertPathValidator
- */
-public class PKIXCertPathValidatorResult implements CertPathValidatorResult
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The trust anchor. */
- private final TrustAnchor trustAnchor;
-
- /** The root node of the policy tree. */
- private final PolicyNode policyTree;
-
- /** The subject's public key. */
- private final PublicKey subjectPublicKey;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new PKIXCertPathValidatorResult.
- *
- * @param trustAnchor The trust anchor.
- * @param policyTree The root node of the policy tree.
- * @param subjectPublicKey The public key.
- * @throws NullPointerException If either <i>trustAnchor</i> or
- * <i>subjectPublicKey</i> is null.
- */
- public PKIXCertPathValidatorResult(TrustAnchor trustAnchor,
- PolicyNode policyTree,
- PublicKey subjectPublicKey)
- {
- if (trustAnchor == null || subjectPublicKey == null)
- throw new NullPointerException();
- this.trustAnchor = trustAnchor;
- this.policyTree = policyTree;
- this.subjectPublicKey = subjectPublicKey;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the trust anchor.
- *
- * @return The trust anchor.
- */
- public TrustAnchor getTrustAnchor()
- {
- return trustAnchor;
- }
-
- /**
- * Returns the root node of the policy tree.
- *
- * @return The root node of the policy tree.
- */
- public PolicyNode getPolicyTree()
- {
- return policyTree;
- }
-
- /**
- * Returns the subject public key.
- *
- * @return The subject public key.
- */
- public PublicKey getPublicKey()
- {
- return subjectPublicKey;
- }
-
- /**
- * Returns a copy of this object.
- *
- * @return The copy.
- */
- public Object clone()
- {
- return new PKIXCertPathValidatorResult(trustAnchor, policyTree,
- subjectPublicKey);
- }
-
- /**
- * Returns a printable string representation of this result.
- *
- * @return A printable string representation of this result.
- */
- public String toString()
- {
- return "[ Trust Anchor=" + trustAnchor + "; Policy Tree="
- + policyTree + "; Subject Public Key=" + subjectPublicKey + " ]";
- }
-}
diff --git a/libjava/java/security/cert/PKIXParameters.java b/libjava/java/security/cert/PKIXParameters.java
deleted file mode 100644
index 4a987115a29..00000000000
--- a/libjava/java/security/cert/PKIXParameters.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/* PKIXParameters.java -- parameters for the PKIX cert path algorithm
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-
-import java.util.Collections;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Parameters for verifying certificate paths using the PKIX
- * (Public-Key Infrastructure (X.509)) algorithm.
- *
- * @see CertPathBulider
- */
-public class PKIXParameters implements CertPathParameters
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The trusted certificates. */
- private final Set trustAnchors;
-
- /** The set of initial policy identifiers. */
- private final Set initPolicies;
-
- /** The list of certificate stores. */
- private final List certStores;
-
- /** The list of path checkers. */
- private final List pathCheckers;
-
- /** The revocation enabled flag. */
- private boolean revocationEnabled;
-
- /** The explicit policy required flag. */
- private boolean exPolicyRequired;
-
- /** The policy mapping inhibited flag. */
- private boolean policyMappingInhibited;
-
- /** The any policy inhibited flag. */
- private boolean anyPolicyInhibited;
-
- /** The policy qualifiers rejected flag. */
- private boolean policyQualRejected;
-
- /** The target validation date. */
- private Date date;
-
- /** The signature algorithm provider. */
- private String sigProvider;
-
- /** The target constraints. */
- private CertSelector targetConstraints;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new PKIXParameters object, populating the trusted
- * certificates set with all certificates found in the given key
- * store. All certificates found in the key store are assumed to be
- * trusted by this constructor.
- *
- * @param keystore The key store.
- * @throws KeyStoreException If the certificates cannot be retrieved
- * from the key store.
- * @throws InvalidAlgorithmParameterException If there are no
- * certificates in the key store.
- * @throws NullPointerException If <i>keystore</i> is null.
- */
- public PKIXParameters(KeyStore keystore)
- throws KeyStoreException, InvalidAlgorithmParameterException
- {
- this();
- for (Enumeration e = keystore.aliases(); e.hasMoreElements(); )
- {
- String alias = (String) e.nextElement();
- if (!keystore.isCertificateEntry(alias))
- continue;
- Certificate cert = keystore.getCertificate(alias);
- if (cert instanceof X509Certificate)
- trustAnchors.add(new TrustAnchor((X509Certificate) cert, null));
- }
- if (trustAnchors.isEmpty())
- throw new InvalidAlgorithmParameterException("no certs in the key store");
- }
-
- /**
- * Create a new PKIXParameters object, populating the trusted
- * certificates set with the elements of the given set, each of which
- * must be a {@link TrustAnchor}.
- *
- * @param trustAnchors The set of trust anchors.
- * @throws InvalidAlgorithmParameterException If there are no
- * certificates in the set.
- * @throws NullPointerException If <i>trustAnchors</i> is null.
- * @throws ClassCastException If every element in <i>trustAnchors</i>
- * is not a {@link TrustAnchor}.
- */
- public PKIXParameters(Set trustAnchors)
- throws InvalidAlgorithmParameterException
- {
- this();
- setTrustAnchors(trustAnchors);
- }
-
- /**
- * Default constructor.
- */
- private PKIXParameters()
- {
- trustAnchors = new HashSet();
- initPolicies = new HashSet();
- certStores = new LinkedList();
- pathCheckers = new LinkedList();
- revocationEnabled = true;
- exPolicyRequired = false;
- policyMappingInhibited = false;
- anyPolicyInhibited = false;
- policyQualRejected = true;
- }
-
- /**
- * Copying constructor for cloning.
- *
- * @param that The instance being cloned.
- */
- private PKIXParameters(PKIXParameters that)
- {
- this();
- this.trustAnchors.addAll(that.trustAnchors);
- this.initPolicies.addAll(that.initPolicies);
- this.certStores.addAll(that.certStores);
- this.pathCheckers.addAll(that.pathCheckers);
- this.revocationEnabled = that.revocationEnabled;
- this.exPolicyRequired = that.exPolicyRequired;
- this.policyMappingInhibited = that.policyMappingInhibited;
- this.anyPolicyInhibited = that.anyPolicyInhibited;
- this.policyQualRejected = that.policyQualRejected;
- this.date = that.date;
- this.sigProvider = that.sigProvider;
- this.targetConstraints = that.targetConstraints != null
- ? (CertSelector) that.targetConstraints.clone() : null;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns an immutable set of trust anchors. The set returned will
- * never be null and will never be empty.
- *
- * @return A (never null, never empty) immutable set of trust anchors.
- */
- public Set getTrustAnchors()
- {
- return Collections.unmodifiableSet(trustAnchors);
- }
-
- /**
- * Sets the trust anchors of this class, replacing the current trust
- * anchors with those in the given set. The supplied set is copied to
- * prevent modification.
- *
- * @param trustAnchors The new set of trust anchors.
- * @throws InvalidAlgorithmParameterException If there are no
- * certificates in the set.
- * @throws NullPointerException If <i>trustAnchors</i> is null.
- * @throws ClassCastException If every element in <i>trustAnchors</i>
- * is not a {@link TrustAnchor}.
- */
- public void setTrustAnchors(Set trustAnchors)
- throws InvalidAlgorithmParameterException
- {
- if (trustAnchors.isEmpty())
- throw new InvalidAlgorithmParameterException("no trust anchors");
- this.trustAnchors.clear();
- for (Iterator i = trustAnchors.iterator(); i.hasNext(); )
- {
- this.trustAnchors.add((TrustAnchor) i.next());
- }
- }
-
- /**
- * Returns the set of initial policy identifiers (as OID strings). If
- * any policy is accepted, this method returns the empty set.
- *
- * @return An immutable set of initial policy OID strings, or the
- * empty set if any policy is acceptable.
- */
- public Set getInitialPolicies()
- {
- return Collections.unmodifiableSet(initPolicies);
- }
-
- /**
- * Sets the initial policy identifiers (as OID strings). If the
- * argument is null or the empty set, then any policy identifier will
- * be accepted.
- *
- * @param initPolicies The new set of policy strings, or null.
- * @throws ClassCastException If any element in <i>initPolicies</i> is
- * not a string.
- */
- public void setInitialPolicies(Set initPolicies)
- {
- this.initPolicies.clear();
- if (initPolicies == null)
- return;
- for (Iterator i = initPolicies.iterator(); i.hasNext(); )
- {
- this.initPolicies.add((String) i.next());
- }
- }
-
- /**
- * Add a {@link CertStore} to the list of cert stores.
- *
- * @param store The CertStore to add.
- */
- public void addCertStore(CertStore store)
- {
- if (store != null)
- certStores.add(store);
- }
-
- /**
- * Returns an immutable list of cert stores. This method never returns
- * null.
- *
- * @return The list of cert stores.
- */
- public List getCertStores()
- {
- return Collections.unmodifiableList(certStores);
- }
-
- /**
- * Set the cert stores. If the argument is null the list of cert
- * stores will be empty.
- *
- * @param certStores The cert stores.
- */
- public void setCertStores(List certStores)
- {
- this.certStores.clear();
- if (certStores == null)
- return;
- for (Iterator i = certStores.iterator(); i.hasNext(); )
- {
- this.certStores.add((CertStore) i.next());
- }
- }
-
- /**
- * Returns the value of the <i>revocation enabled</i> flag. The default
- * value for this flag is <code>true</code>.
- *
- * @return The <i>revocation enabled</i> flag.
- */
- public boolean isRevocationEnabled()
- {
- return revocationEnabled;
- }
-
- /**
- * Sets the value of the <i>revocation enabled</i> flag.
- *
- * @param value The new value.
- */
- public void setRevocationEnabled(boolean value)
- {
- revocationEnabled = value;
- }
-
- /**
- * Returns the value of the <i>explicit policy required</i> flag. The
- * default value of this flag is <code>false</code>.
- *
- * @return The <i>explicit policy required</i> flag.
- */
- public boolean isExplicitPolicyRequired()
- {
- return exPolicyRequired;
- }
-
- /**
- * Sets the value of the <i>explicit policy required</i> flag.
- *
- * @param value The new value.
- */
- public void setExplicitPolicyRequired(boolean value)
- {
- exPolicyRequired = value;
- }
-
- /**
- * Returns the value of the <i>policy mapping inhibited</i> flag. The
- * default value of this flag is <code>false</code>.
- *
- * @return The <i>policy mapping inhibited</i> flag.
- */
- public boolean isPolicyMappingInhibited()
- {
- return policyMappingInhibited;
- }
-
- /**
- * Sets the value of the <i>policy mapping inhibited</i> flag.
- *
- * @param value The new value.
- */
- public void setPolicyMappingInhibited(boolean value)
- {
- policyMappingInhibited = value;
- }
-
- /**
- * Returns the value of the <i>any policy inhibited</i> flag. The
- * default value of this flag is <code>false</code>.
- *
- * @return The <i>any policy inhibited</i> flag.
- */
- public boolean isAnyPolicyInhibited()
- {
- return anyPolicyInhibited;
- }
-
- /**
- * Sets the value of the <i>any policy inhibited</i> flag.
- *
- * @param value The new value.
- */
- public void setAnyPolicyInhibited(boolean value)
- {
- anyPolicyInhibited = value;
- }
-
- /**
- * Returns the value of the <i>policy qualifiers enabled</i> flag. The
- * default value of this flag is <code>true</code>.
- *
- * @return The <i>policy qualifiers enabled</i> flag.
- */
- public boolean getPolicyQualifiersRejected()
- {
- return policyQualRejected;
- }
-
- /**
- * Sets the value of the <i>policy qualifiers enabled</i> flag.
- *
- * @param value The new value.
- */
- public void setPolicyQualifiersRejected(boolean value)
- {
- policyQualRejected = value;
- }
-
- /**
- * Returns the date for which the certificate path should be
- * validated, or null if the current time should be used. The date
- * object is copied to prevent subsequent modification.
- *
- * @return The date, or null if not set.
- */
- public Date getDate()
- {
- return date != null ? (Date) date.clone() : null;
- }
-
- /**
- * Sets the date for which the certificate path should be validated,
- * or null if the current time should be used.
- *
- * @param date The new date, or null.
- */
- public void setDate(Date date)
- {
- if (date != null)
- this.date = (Date) date.clone();
- else
- this.date = null;
- }
-
- /**
- * Add a certificate path checker.
- *
- * @param checker The certificate path checker to add.
- */
- public void addCertPathChecker(PKIXCertPathChecker checker)
- {
- if (checker != null)
- pathCheckers.add(checker);
- }
-
- /**
- * Returns an immutable list of all certificate path checkers.
- *
- * @return An immutable list of all certificate path checkers.
- */
- public List getCertPathCheckers()
- {
- return Collections.unmodifiableList(pathCheckers);
- }
-
- /**
- * Sets the certificate path checkers. If the argument is null, the
- * list of checkers will merely be cleared.
- *
- * @param pathCheckers The new list of certificate path checkers.
- * @throws ClassCastException If any element of <i>pathCheckers</i> is
- * not a {@link PKIXCertPathChecker}.
- */
- public void setCertPathCheckers(List pathCheckers)
- {
- this.pathCheckers.clear();
- if (pathCheckers == null)
- return;
- for (Iterator i = pathCheckers.iterator(); i.hasNext(); )
- {
- this.pathCheckers.add((PKIXCertPathChecker) i.next());
- }
- }
-
- /**
- * Returns the signature algorithm provider, or null if not set.
- *
- * @return The signature algorithm provider, or null if not set.
- */
- public String getSigProvider()
- {
- return sigProvider;
- }
-
- /**
- * Sets the signature algorithm provider, or null if there is no
- * preferred provider.
- *
- * @param sigProvider The signature provider name.
- */
- public void setSigProvider(String sigProvider)
- {
- this.sigProvider = sigProvider;
- }
-
- /**
- * Returns the constraints placed on the target certificate, or null
- * if there are none. The target constraints are copied to prevent
- * subsequent modification.
- *
- * @return The target constraints, or null.
- */
- public CertSelector getTargetCertConstraints()
- {
- return targetConstraints != null
- ? (CertSelector) targetConstraints.clone() : null;
- }
-
- /**
- * Sets the constraints placed on the target certificate.
- *
- * @param targetConstraints The target constraints.
- */
- public void setTargetCertConstraints(CertSelector targetConstraints)
- {
- this.targetConstraints = targetConstraints != null
- ? (CertSelector) targetConstraints.clone() : null;
- }
-
- /**
- * Returns a copy of these parameters.
- *
- * @return The copy.
- */
- public Object clone()
- {
- return new PKIXParameters(this);
- }
-
- /**
- * Returns a printable representation of these parameters.
- *
- * @return A printable representation of these parameters.
- */
- public String toString() {
- return "[ Trust Anchors: " + trustAnchors + "; Initial Policy OIDs="
- + (initPolicies != null ? initPolicies.toString() : "any")
- + "; Validity Date=" + date + "; Signature Provider="
- + sigProvider + "; Default Revocation Enabled=" + revocationEnabled
- + "; Explicit Policy Required=" + exPolicyRequired
- + "; Policy Mapping Inhibited=" + policyMappingInhibited
- + "; Any Policy Inhibited=" + anyPolicyInhibited
- + "; Policy Qualifiers Rejected=" + policyQualRejected
- + "; Target Cert Contstraints=" + targetConstraints
- + "; Certification Path Checkers=" + pathCheckers
- + "; CertStores=" + certStores + " ]";
- }
-}
diff --git a/libjava/java/security/cert/PolicyNode.java b/libjava/java/security/cert/PolicyNode.java
deleted file mode 100644
index 58d411cd3ad..00000000000
--- a/libjava/java/security/cert/PolicyNode.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* PolicyNode.java -- a single node in a policy tree
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-public interface PolicyNode
-{
-
- /**
- * Get the iterator of the child nodes of this node. The returned
- * iterator is (naturally) unmodifiable.
- *
- * @return An iterator over the child nodes.
- */
- java.util.Iterator getChildren();
-
- /**
- * Get the depth of this node within the tree, starting at 0 for the
- * root node.
- *
- * @return The depth of this node.
- */
- int getDepth();
-
- /**
- * Returns a set of policies (string OIDs) that will satisfy this
- * node's policy. The root node should always return the singleton set
- * with the element "any-policy".
- *
- * @return The set of expected policies.
- */
- java.util.Set getExpectedPolicies();
-
- /**
- * Returns the parent node of this node, or null if this is the root
- * node.
- *
- * @return The parent node, or null.
- */
- PolicyNode getParent();
-
- /**
- * Returns a set of {@link PolicyQualifierInfo} objects that qualify
- * the valid policy of this node. The root node should always return
- * the empty set.
- *
- * @return The set of {@link PolicyQualifierInfo} objects.
- */
- java.util.Set getPolicyQualifiers();
-
- /**
- * Get the policy OID this node represents. The root node should return
- * the special value "any-policy".
- *
- * @return The policy of this node.
- */
- String getValidPolicy();
-
- /**
- * Return the criticality flag of this policy node. Nodes who return
- * true for this method should be considered critical. The root node
- * is never critical.
- *
- * @return The criticality flag.
- */
- boolean isCritical();
-}
diff --git a/libjava/java/security/cert/PolicyQualifierInfo.java b/libjava/java/security/cert/PolicyQualifierInfo.java
deleted file mode 100644
index 7dcf2315632..00000000000
--- a/libjava/java/security/cert/PolicyQualifierInfo.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/* PolicyQualifierInfo.java -- policy qualifier info object.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import gnu.java.io.ASN1ParsingException;
-import gnu.java.security.OID;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-
-/**
- * The PolicyQualifierInfo X.509 certificate extension.
- * PolicyQualifierInfo objects are represented by the ASN.1 structure:
- *
- * <pre>
- * PolicyQualifierInfo ::= SEQUENCE {
- * policyQualifierId PolicyQualifierId,
- * qualifier ANY DEFINED BY policyQualifierId
- * }
- *
- * PolicyQualifierId ::= OBJECT IDENTIFIER
- * </pre>
- *
- * @since JDK 1.4
- */
-public final class PolicyQualifierInfo
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The <code>policyQualifierId</code> field. */
- private OID oid;
-
- /** The DER encoded form of this object. */
- private byte[] encoded;
-
- /** The DER encoded form of the <code>qualifier</code> field. */
- private DERValue qualifier;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new PolicyQualifierInfo object from the DER encoded form
- * passed in the byte array. The argument is copied.
- *
- * <p>The ASN.1 form of PolicyQualifierInfo is:
-<pre>
-PolicyQualifierInfo ::= SEQUENCE {
- policyQualifierId PolicyQualifierId,
- qualifier ANY DEFINED BY policyQualifierId
-}
-
-PolicyQualifierId ::= OBJECT IDENTIFIER
-</pre>
- *
- * @param encoded The DER encoded form.
- * @throws IOException If the structure cannot be parsed from the
- * encoded bytes.
- */
- public PolicyQualifierInfo(byte[] encoded) throws IOException
- {
- if (encoded == null)
- throw new IOException("null bytes");
- this.encoded = (byte[]) encoded.clone();
- DERReader in = new DERReader(new ByteArrayInputStream(this.encoded));
- DERValue qualInfo = in.read();
- if (!qualInfo.isConstructed())
- throw new ASN1ParsingException("malformed PolicyQualifierInfo");
- DERValue val = in.read();
- if (!(val.getValue() instanceof OID))
- throw new ASN1ParsingException("value read not an OBJECT IDENTIFIER");
- oid = (OID) val.getValue();
- if (val.getEncodedLength() < val.getLength())
- qualifier = in.read();
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the <code>policyQualifierId</code> field of this structure,
- * as a dotted-decimal representation of the object identifier.
- *
- * @return This structure's OID field.
- */
- public String getPolicyQualifierId()
- {
- return oid.toString();
- }
-
- /**
- * Returns the DER encoded form of this object; the contents of the
- * returned byte array are equivalent to those that were passed to the
- * constructor. The byte array is cloned every time this method is
- * called.
- *
- * @return The encoded form.
- */
- public byte[] getEncoded()
- {
- return (byte[]) encoded.clone();
- }
-
- /**
- * Get the <code>qualifier</code> field of this object, as a DER
- * encoded byte array. The byte array returned is cloned every time
- * this method is called.
- *
- * @return The encoded qualifier.
- */
- public byte[] getPolicyQualifier()
- {
- if (qualifier == null)
- return new byte[0];
- return qualifier.getEncoded();
- }
-
- /**
- * Returns a printable string representation of this object.
- *
- * @return The string representation.
- */
- public String toString()
- {
- return "PolicyQualifierInfo { policyQualifierId ::= " + oid
- + ", qualifier ::= " + qualifier + " }";
- }
-}
diff --git a/libjava/java/security/cert/TrustAnchor.java b/libjava/java/security/cert/TrustAnchor.java
deleted file mode 100644
index 2110ed5181d..00000000000
--- a/libjava/java/security/cert/TrustAnchor.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/* TrustAnchor.java -- an ultimately-trusted certificate.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import gnu.java.security.x509.X500DistinguishedName;
-
-import java.security.PublicKey;
-
-/**
- * An ultimately-trusted certificate to serve as the root of a
- * certificate chain.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class TrustAnchor
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The certificate authority's distinguished name. */
- private final X500DistinguishedName caName;
-
- /** The certficate authority's public key. */
- private final PublicKey caKey;
-
- /** The certficate authority's certificate. */
- private final X509Certificate trustedCert;
-
- /** The encoded name constraints bytes. */
- private final byte[] nameConstraints;
-
- // Constnuctors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new trust anchor from a certificate and (optional) name
- * constraints.
- *
- * <p>If the <i>nameConstraints</i> argument in non-null, it will be
- * copied to prevent modification.
- *
- * @param trustedCert The trusted certificate.
- * @param nameConstraints The encoded nameConstraints.
- */
- public TrustAnchor(X509Certificate trustedCert, byte[] nameConstraints)
- {
- if (trustedCert == null)
- throw new NullPointerException();
- this.trustedCert = trustedCert;
- caName = null;
- caKey = null;
- if (nameConstraints != null)
- this.nameConstraints = (byte[]) nameConstraints.clone();
- else
- this.nameConstraints = null;
- }
-
- /**
- * Create a new trust anchor from a certificate authority's
- * distinguished name, public key, and (optional) name constraints.
- *
- * <p>If the <i>nameConstraints</i> argument in non-null, it will be
- * copied to prevent modification.
- *
- * @params caName The CA's distinguished name.
- * @params caKey The CA's public key.
- * @params nameConstraints The encoded nameConstraints.
- */
- public TrustAnchor(String caName, PublicKey caKey, byte[] nameConstraints)
- {
- if (caName == null || caKey == null)
- throw new NullPointerException();
- if (caName.length() == 0)
- throw new IllegalArgumentException();
- trustedCert = null;
- this.caName = new X500DistinguishedName(caName);
- this.caKey = caKey;
- if (nameConstraints != null)
- this.nameConstraints = (byte[]) nameConstraints.clone();
- else
- this.nameConstraints = null;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return the trusted certificate, or null if none was specified.
- *
- * @return The trusted certificate.
- */
- public final X509Certificate getTrustedCert()
- {
- return trustedCert;
- }
-
- /**
- * Return the certificate authority's distinguished name, or null if
- * none was specified.
- *
- * @return The CA's distinguished name.
- */
- public final String getCAName()
- {
- if (caName != null)
- return caName.toString();
- return null;
- }
-
- /**
- * Return the certificate authority's public key, or null if none was
- * specified.
- *
- * @return The CA's public key.
- */
- public final PublicKey getCAPublicKey()
- {
- return caKey;
- }
-
- /**
- * Return the encoded name constraints, or null if none was specified.
- *
- * <p>The name constraints byte array is copied when this method is
- * called to prevent modification.
- *
- * @return The encoded name constraints.
- */
- public final byte[] getNameConstraints()
- {
- if (nameConstraints == null)
- return null;
- return (byte[]) nameConstraints.clone();
- }
-
- /**
- * Return a printable representation of this trust anchor.
- *
- * @return The printable representation.
- */
- public String toString()
- {
- if (trustedCert == null)
- return "[ Trusted CA Public Key=" + caKey + ", Trusted CA Issuer Name="
- + caName.toString() + " ]";
- return "[ Trusted CA Certificate=" + trustedCert + " ]";
- }
-}
diff --git a/libjava/java/security/cert/X509CRL.java b/libjava/java/security/cert/X509CRL.java
deleted file mode 100644
index 5657b3eb3f5..00000000000
--- a/libjava/java/security/cert/X509CRL.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/* X509CRL.java --- X.509 Certificate Revocation List
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.math.BigInteger;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Principal;
-import java.security.PublicKey;
-import java.security.SignatureException;
-import java.util.Date;
-import java.util.Set;
-
-import javax.security.auth.x500.X500Principal;
-
-/**
- The X509CRL class is the abstract class used to manage
- X.509 Certificate Revocation Lists. The CRL is a list of
- time stamped entries which indicate which lists have been
- revoked. The list is signed by a Certificate Authority (CA)
- and made publically available in a repository.
-
- Each revoked certificate in the CRL is identified by its
- certificate serial number. When a piece of code uses a
- certificate, the certificates validity is checked by
- validating its signature and determing that it is not
- only a recently acquired CRL. The recently aquired CRL
- is depends on the local policy in affect. The CA issues
- a new CRL periodically and entries are removed as the
- certificate expiration date is reached
-
-
- A description of the X.509 v2 CRL follows below from rfc2459.
-
- "The X.509 v2 CRL syntax is as follows. For signature calculation,
- the data that is to be signed is ASN.1 DER encoded. ASN.1 DER
- encoding is a tag, length, value encoding system for each element.
-
- CertificateList ::= SEQUENCE {
- tbsCertList TBSCertList,
- signatureAlgorithm AlgorithmIdentifier,
- signatureValue BIT STRING }
-
- TBSCertList ::= SEQUENCE {
- version Version OPTIONAL,
- -- if present, shall be v2
- signature AlgorithmIdentifier,
- issuer Name,
- thisUpdate Time,
- nextUpdate Time OPTIONAL,
- revokedCertificates SEQUENCE OF SEQUENCE {
- userCertificate CertificateSerialNumber,
- revocationDate Time,
- crlEntryExtensions Extensions OPTIONAL
- -- if present, shall be v2
- } OPTIONAL,
- crlExtensions [0] EXPLICIT Extensions OPTIONAL
- -- if present, shall be v2
- }"
-
- @author Mark Benvenuto
-
- @since JDK 1.2
-*/
-public abstract class X509CRL extends CRL implements X509Extension
-{
-
- /**
- Constructs a new X509CRL.
- */
- protected X509CRL()
- {
- super("X.509");
- }
-
- /**
- Compares this X509CRL to other. It checks if the
- object if instanceOf X509CRL and then checks if
- the encoded form matches.
-
- @param other An Object to test for equality
-
- @return true if equal, false otherwise
- */
- public boolean equals(Object other)
- {
- if( other instanceof X509CRL ) {
- try {
- X509CRL x = (X509CRL) other;
- if( getEncoded().length != x.getEncoded().length )
- return false;
-
- byte[] b1 = getEncoded();
- byte[] b2 = x.getEncoded();
-
- for( int i = 0; i < b1.length; i++ )
- if( b1[i] != b2[i] )
- return false;
-
- } catch( CRLException crle ) {
- return false;
- }
- return true;
- }
- return false;
- }
-
- /**
- Returns a hash code for this X509CRL in its encoded
- form.
-
- @return A hash code of this class
- */
- public int hashCode()
- {
- return super.hashCode();
- }
-
- /**
- Gets the DER ASN.1 encoded format for this X.509 CRL.
-
- @return byte array containg encoded form
-
- @throws CRLException if an error occurs
- */
- public abstract byte[] getEncoded() throws CRLException;
-
- /**
- Verifies that this CRL was properly signed with the
- PublicKey that corresponds to its private key.
-
- @param key PublicKey to verify with
-
- @throws CRLException encoding error
- @throws NoSuchAlgorithmException unsupported algorithm
- @throws InvalidKeyException incorrect key
- @throws NoSuchProviderException no provider
- @throws SignatureException signature error
- */
- public abstract void verify(PublicKey key)
- throws CRLException,
- NoSuchAlgorithmException,
- InvalidKeyException,
- NoSuchProviderException,
- SignatureException;
-
- /**
- Verifies that this CRL was properly signed with the
- PublicKey that corresponds to its private key and uses
- the signature engine provided by the provider.
-
- @param key PublicKey to verify with
- @param sigProvider Provider to use for signature algorithm
-
- @throws CRLException encoding error
- @throws NoSuchAlgorithmException unsupported algorithm
- @throws InvalidKeyException incorrect key
- @throws NoSuchProviderException incorrect provider
- @throws SignatureException signature error
- */
- public abstract void verify(PublicKey key,
- String sigProvider)
- throws CRLException,
- NoSuchAlgorithmException,
- InvalidKeyException,
- NoSuchProviderException,
- SignatureException;
-
- /**
- Gets the version of this CRL.
-
- The ASN.1 encoding is:
-
- version Version OPTIONAL,
- -- if present, shall be v2
-
- Version ::= INTEGER { v1(0), v2(1), v3(2) }
-
- Consult rfc2459 for more information.
-
- @return the version number, Ex: 1 or 2
- */
- public abstract int getVersion();
-
- /**
- Returns the issuer (issuer distinguished name) of the CRL.
- The issuer is the entity who signed and issued the
- Certificate Revocation List.
-
- The ASN.1 DER encoding is:
-
- issuer Name,
-
- Name ::= CHOICE {
- RDNSequence }
-
- RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
-
- RelativeDistinguishedName ::=
- SET OF AttributeTypeAndValue
-
- AttributeTypeAndValue ::= SEQUENCE {
- type AttributeType,
- value AttributeValue }
-
- AttributeType ::= OBJECT IDENTIFIER
-
- AttributeValue ::= ANY DEFINED BY AttributeType
-
- DirectoryString ::= CHOICE {
- teletexString TeletexString (SIZE (1..MAX)),
- printableString PrintableString (SIZE (1..MAX)),
- universalString UniversalString (SIZE (1..MAX)),
- utf8String UTF8String (SIZE (1.. MAX)),
- bmpString BMPString (SIZE (1..MAX)) }
-
- Consult rfc2459 for more information.
-
- @return the issuer in the Principal class
- */
- public abstract Principal getIssuerDN();
-
- /**
- Returns the thisUpdate date of the CRL.
-
- The ASN.1 DER encoding is:
-
- thisUpdate Time,
-
- Time ::= CHOICE {
- utcTime UTCTime,
- generalTime GeneralizedTime }
-
- Consult rfc2459 for more information.
-
- @return the thisUpdate date
- */
- public abstract Date getThisUpdate();
-
- /*
- Gets the nextUpdate field
-
- The ASN.1 DER encoding is:
-
- nextUpdate Time OPTIONAL,
-
- Time ::= CHOICE {
- utcTime UTCTime,
- generalTime GeneralizedTime }
-
- Consult rfc2459 for more information.
-
- @return the nextUpdate date
- */
- public abstract Date getNextUpdate();
-
- /**
- Gets the requeste dX509Entry for the specified
- certificate serial number.
-
- @return a X509CRLEntry representing the X.509 CRL entry
- */
- public abstract X509CRLEntry getRevokedCertificate(BigInteger serialNumber);
-
- /**
- Returns a Set of revoked certificates.
-
- @return a set of revoked certificates.
- */
- public abstract Set getRevokedCertificates();
-
- /**
- Returns the DER ASN.1 encoded tbsCertList which is
- the basic information of the list and associated certificates
- in the encoded state. See top for more information.
-
- The ASN.1 DER encoding is:
-
- tbsCertList TBSCertList,
-
- Consult rfc2459 for more information.
-
- @return byte array representing tbsCertList
- */
- public abstract byte[] getTBSCertList() throws CRLException;
-
-
- /**
- Returns the signature for the CRL.
-
- The ASN.1 DER encoding is:
-
- signatureValue BIT STRING
-
- Consult rfc2459 for more information.
- */
- public abstract byte[] getSignature();
-
- /**
- Returns the signature algorithm used to sign the CRL.
- An examples is "SHA-1/DSA".
-
- The ASN.1 DER encoding is:
-
- signatureAlgorithm AlgorithmIdentifier,
-
- AlgorithmIdentifier ::= SEQUENCE {
- algorithm OBJECT IDENTIFIER,
- parameters ANY DEFINED BY algorithm OPTIONAL }
-
- Consult rfc2459 for more information.
-
- The algorithm name is determined from the OID.
-
- @return a string with the signature algorithm name
- */
- public abstract String getSigAlgName();
-
- /**
- Returns the OID for the signature algorithm used.
- Example "1.2.840.10040.4.3" is return for SHA-1 with DSA.\
-
- The ASN.1 DER encoding for the example is:
-
- id-dsa-with-sha1 ID ::= {
- iso(1) member-body(2) us(840) x9-57 (10040)
- x9cm(4) 3 }
-
- Consult rfc2459 for more information.
-
- @return a string containing the OID.
- */
- public abstract String getSigAlgOID();
-
- /**
- Returns the AlgorithmParameters in the encoded form
- for the signature algorithm used.
-
- If access to the parameters is need, create an
- instance of AlgorithmParameters.
-
- @return byte array containing algorithm parameters, null
- if no parameters are present in CRL
- */
- public abstract byte[] getSigAlgParams();
-
- // 1.4 instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the X.500 distinguished name of this CRL's issuer.
- *
- * @return The issuer's X.500 distinguished name.
- * @since JDK 1.4
- */
- public X500Principal getIssuerX500Principal()
- {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/libjava/java/security/cert/X509CRLEntry.java b/libjava/java/security/cert/X509CRLEntry.java
deleted file mode 100644
index 4c9cada4747..00000000000
--- a/libjava/java/security/cert/X509CRLEntry.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/* X509CRLEntry.java --- X.509 Certificate Revocation List Entry
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.math.BigInteger;
-import java.util.Date;
-
-/**
- Abstract class for entries in the CRL (Certificate Revocation
- List). The ASN.1 definition for <I>revokedCertificates</I> is
-
- revokedCertificates SEQUENCE OF SEQUENCE {
- userCertificate CertificateSerialNumber,
- revocationDate Time,
- crlEntryExtensions Extensions OPTIONAL
- -- if present, shall be v2
- } OPTIONAL,
-
- CertificateSerialNumber ::= INTEGER
-
- Time ::= CHOICE {
- utcTime UTCTime,
- generalTime GeneralizedTime }
-
- Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
-
- Extension ::= SEQUENCE {
- extnID OBJECT IDENTIFIER,
- critical BOOLEAN DEFAULT FALSE,
- extnValue OCTET STRING }
-
- For more information consult rfc2459.
-
- @author Mark Benvenuto
-
- @since JDK 1.2
-*/
-public abstract class X509CRLEntry implements X509Extension
-{
-
- /**
- Creates a new X509CRLEntry
- */
- public X509CRLEntry()
- {}
-
- /**
- Compares this X509CRLEntry to other. It checks if the
- object if instanceOf X509CRLEntry and then checks if
- the encoded form( the inner SEQUENCE) matches.
-
- @param other An Object to test for equality
-
- @return true if equal, false otherwise
- */
- public boolean equals(Object other)
- {
- if( other instanceof X509CRLEntry ) {
- try {
- X509CRLEntry xe = (X509CRLEntry) other;
- if( getEncoded().length != xe.getEncoded().length )
- return false;
-
- byte[] b1 = getEncoded();
- byte[] b2 = xe.getEncoded();
-
- for( int i = 0; i < b1.length; i++ )
- if( b1[i] != b2[i] )
- return false;
-
- } catch( CRLException crle ) {
- return false;
- }
- return true;
- }
- return false;
- }
-
- /**
- Returns a hash code for this X509CRLEntry in its encoded
- form.
-
- @return A hash code of this class
- */
- public int hashCode()
- {
- return super.hashCode();
- }
-
- /**
- Gets the DER ASN.1 encoded format for this CRL Entry,
- the inner SEQUENCE.
-
- @return byte array containg encoded form
-
- @throws CRLException if an error occurs
- */
- public abstract byte[] getEncoded() throws CRLException;
-
- /**
- Gets the serial number for <I>userCertificate</I> in
- this X509CRLEntry.
-
- @return the serial number for this X509CRLEntry.
- */
- public abstract BigInteger getSerialNumber();
-
-
- /**
- Gets the revocation date in <I>revocationDate</I> for
- this X509CRLEntry.
-
- @return the revocation date for this X509CRLEntry.
- */
- public abstract Date getRevocationDate();
-
-
- /**
- Checks if this X509CRLEntry has extensions.
-
- @return true if it has extensions, false otherwise
- */
- public abstract boolean hasExtensions();
-
-
- /**
- Returns a string that represents this X509CRLEntry.
-
- @return a string representing this X509CRLEntry.
- */
- public abstract String toString();
-
-}
diff --git a/libjava/java/security/cert/X509CRLSelector.java b/libjava/java/security/cert/X509CRLSelector.java
deleted file mode 100644
index 3c79fba9cb8..00000000000
--- a/libjava/java/security/cert/X509CRLSelector.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/* X509CRLSelector.java -- selects X.509 CRLs by criteria.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import gnu.classpath.SystemProperties;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.security.auth.x500.X500Principal;
-
-/**
- * A class for matching X.509 certificate revocation lists by criteria.
- *
- * <p>Use of this class requires extensive knowledge of the Internet
- * Engineering Task Force's Public Key Infrastructure (X.509). The primary
- * document describing this standard is <a
- * href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509
- * Public Key Infrastructure Certificate and Certificate Revocation List
- * (CRL) Profile</a>.
- *
- * <p>Note that this class is not thread-safe. If multiple threads will
- * use or modify this class then they need to synchronize on the object.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class X509CRLSelector implements CRLSelector, Cloneable
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private static final String CRL_NUMBER_ID = "2.5.29.20";
-
- private List issuerNames;
- private BigInteger maxCrlNumber;
- private BigInteger minCrlNumber;
- private Date date;
- private X509Certificate cert;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- /**
- * Creates a new CRL selector with no criteria enabled; i.e., every CRL
- * will be matched.
- */
- public X509CRLSelector()
- {
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- /**
- * Add an issuer name to the set of issuer names criteria, as the DER
- * encoded form.
- *
- * @param name The name to add, as DER bytes.
- * @throws IOException If the argument is not a valid DER-encoding.
- */
- public void addIssuerName(byte[] name) throws IOException
- {
- X500Principal p = null;
- try
- {
- p = new X500Principal(name);
- }
- catch (IllegalArgumentException iae)
- {
- IOException ioe = new IOException("malformed name");
- ioe.initCause(iae);
- throw ioe;
- }
- if (issuerNames == null)
- issuerNames = new LinkedList();
- issuerNames.add(p);
- }
-
- /**
- * Add an issuer name to the set of issuer names criteria, as a
- * String representation.
- *
- * @param name The name to add.
- * @throws IOException If the argument is not a valid name.
- */
- public void addIssuerName(String name) throws IOException
- {
- X500Principal p = null;
- try
- {
- p = new X500Principal(name);
- }
- catch (IllegalArgumentException iae)
- {
- IOException ioe = new IOException("malformed name: " + name);
- ioe.initCause(iae);
- throw ioe;
- }
- if (issuerNames == null)
- issuerNames = new LinkedList();
- issuerNames.add(p);
- }
-
- /**
- * Sets the issuer names criterion. Pass <code>null</code> to clear this
- * value. CRLs matched by this selector must have an issuer name in this
- * set.
- *
- * @param names The issuer names.
- * @throws IOException If any of the elements in the collection is not
- * a valid name.
- */
- public void setIssuerNames(Collection names) throws IOException
- {
- if (names == null)
- {
- issuerNames = null;
- return;
- }
- List l = new ArrayList(names.size());
- for (Iterator it = names.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o instanceof X500Principal)
- l.add(o);
- else if (o instanceof String)
- {
- try
- {
- l.add(new X500Principal((String) o));
- }
- catch (IllegalArgumentException iae)
- {
- IOException ioe = new IOException("malformed name: " + o);
- ioe.initCause(iae);
- throw ioe;
- }
- }
- else if (o instanceof byte[])
- {
- try
- {
- l.add(new X500Principal((byte[]) o));
- }
- catch (IllegalArgumentException iae)
- {
- IOException ioe = new IOException("malformed name");
- ioe.initCause(iae);
- throw ioe;
- }
- }
- else if (o instanceof InputStream)
- {
- try
- {
- l.add(new X500Principal((InputStream) o));
- }
- catch (IllegalArgumentException iae)
- {
- IOException ioe = new IOException("malformed name");
- ioe.initCause(iae);
- throw ioe;
- }
- }
- else
- throw new IOException("not a valid name: " +
- (o != null ? o.getClass().getName() : "null"));
-
- }
- issuerNames = l;
- }
-
- /**
- * Returns the set of issuer names that are matched by this selector,
- * or <code>null</code> if this criteria is not set. The returned
- * collection is not modifiable.
- *
- * @return The set of issuer names.
- */
- public Collection getIssuerNames()
- {
- if (issuerNames != null)
- return Collections.unmodifiableList(issuerNames);
- else
- return null;
- }
-
- /**
- * Returns the maximum value of the CRLNumber extension present in
- * CRLs matched by this selector, or <code>null</code> if this
- * criteria is not set.
- *
- * @return The maximum CRL number.
- */
- public BigInteger getMaxCRL()
- {
- return maxCrlNumber;
- }
-
- /**
- * Returns the minimum value of the CRLNumber extension present in
- * CRLs matched by this selector, or <code>null</code> if this
- * criteria is not set.
- *
- * @return The minimum CRL number.
- */
- public BigInteger getMinCRL()
- {
- return minCrlNumber;
- }
-
- /**
- * Sets the maximum value of the CRLNumber extension present in CRLs
- * matched by this selector. Specify <code>null</code> to clear this
- * criterion.
- *
- * @param maxCrlNumber The maximum CRL number.
- */
- public void setMaxCRLNumber(BigInteger maxCrlNumber)
- {
- this.maxCrlNumber = maxCrlNumber;
- }
-
- /**
- * Sets the minimum value of the CRLNumber extension present in CRLs
- * matched by this selector. Specify <code>null</code> to clear this
- * criterion.
- *
- * @param minCrlNumber The minimum CRL number.
- */
- public void setMinCRLNumber(BigInteger minCrlNumber)
- {
- this.minCrlNumber = minCrlNumber;
- }
-
- /**
- * Returns the date when this CRL must be valid; that is, the date
- * must be after the thisUpdate date, but before the nextUpdate date.
- * Returns <code>null</code> if this criterion is not set.
- *
- * @return The date.
- */
- public Date getDateAndTime()
- {
- return date != null ? (Date) date.clone() : null;
- }
-
- /**
- * Sets the date at which this CRL must be valid. Specify
- * <code>null</code> to clear this criterion.
- *
- * @param date The date.
- */
- public void setDateAndTime(Date date)
- {
- this.date = date != null ? (Date) date.clone() : null;
- }
-
- /**
- * Returns the certificate being checked, or <code>null</code> if this
- * value is not set.
- *
- * @return The certificate.
- */
- public X509Certificate getCertificateChecking()
- {
- return cert;
- }
-
- /**
- * Sets the certificate being checked. This is not a criterion, but
- * info used by certificate store implementations to aid in searching.
- *
- * @param cert The certificate.
- */
- public void setCertificateChecking(X509Certificate cert)
- {
- this.cert = cert;
- }
-
- /**
- * Returns a string representation of this selector. The string will
- * only describe the enabled criteria, so if none are enabled this will
- * return a string that contains little else besides the class name.
- *
- * @return The string.
- */
- public String toString()
- {
- StringBuffer str = new StringBuffer(X509CRLSelector.class.getName());
- String nl = SystemProperties.getProperty("line.separator");
- String eol = ";" + nl;
-
- str.append(" {").append(nl);
- if (issuerNames != null)
- str.append(" issuer names = ").append(issuerNames).append(eol);
- if (maxCrlNumber != null)
- str.append(" max CRL = ").append(maxCrlNumber).append(eol);
- if (minCrlNumber != null)
- str.append(" min CRL = ").append(minCrlNumber).append(eol);
- if (date != null)
- str.append(" date = ").append(date).append(eol);
- if (cert != null)
- str.append(" certificate = ").append(cert).append(eol);
- str.append("}").append(nl);
- return str.toString();
- }
-
- /**
- * Checks a CRL against the criteria of this selector, returning
- * <code>true</code> if the given CRL matches all the criteria.
- *
- * @param _crl The CRL being checked.
- * @return True if the CRL matches, false otherwise.
- */
- public boolean match(CRL _crl)
- {
- if (!(_crl instanceof X509CRL))
- return false;
- X509CRL crl = (X509CRL) _crl;
- if (issuerNames != null)
- {
- if (!issuerNames.contains(crl.getIssuerX500Principal()))
- return false;
- }
- BigInteger crlNumber = null;
- if (maxCrlNumber != null)
- {
- byte[] b = crl.getExtensionValue(CRL_NUMBER_ID);
- if (b == null)
- return false;
- try
- {
- DERValue val = DERReader.read(b);
- if (!(val.getValue() instanceof BigInteger))
- return false;
- crlNumber = (BigInteger) val.getValue();
- }
- catch (IOException ioe)
- {
- return false;
- }
- if (maxCrlNumber.compareTo(crlNumber) < 0)
- return false;
- }
- if (minCrlNumber != null)
- {
- if (crlNumber == null)
- {
- byte[] b = crl.getExtensionValue(CRL_NUMBER_ID);
- if (b == null)
- return false;
- try
- {
- DERValue val = DERReader.read(b);
- if (!(val.getValue() instanceof BigInteger))
- return false;
- crlNumber = (BigInteger) val.getValue();
- }
- catch (IOException ioe)
- {
- return false;
- }
- }
- if (minCrlNumber.compareTo(crlNumber) > 0)
- return false;
- }
- if (date != null)
- {
- if (date.compareTo(crl.getThisUpdate()) < 0 ||
- date.compareTo(crl.getNextUpdate()) > 0)
- return false;
- }
- return true;
- }
-
- /**
- * Returns a copy of this object.
- *
- * @return The copy.
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException shouldNotHappen)
- {
- throw new Error(shouldNotHappen);
- }
- }
-}
diff --git a/libjava/java/security/cert/X509CertSelector.java b/libjava/java/security/cert/X509CertSelector.java
deleted file mode 100644
index 4149a37643d..00000000000
--- a/libjava/java/security/cert/X509CertSelector.java
+++ /dev/null
@@ -1,1106 +0,0 @@
-/* X509CertSelector.java -- selects X.509 certificates by criteria.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import gnu.classpath.SystemProperties;
-import gnu.java.security.OID;
-
-import java.io.IOException;
-import java.math.BigInteger;
-import java.security.KeyFactory;
-import java.security.PublicKey;
-import java.security.spec.X509EncodedKeySpec;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import javax.security.auth.x500.X500Principal;
-
-/**
- * A concrete implementation of {@link CertSelector} for X.509 certificates,
- * which allows a number of criteria to be set when accepting certificates,
- * from validity dates, to issuer and subject distinguished names, to some
- * of the various X.509 extensions.
- *
- * <p>Use of this class requires extensive knowledge of the Internet
- * Engineering Task Force's Public Key Infrastructure (X.509). The primary
- * document describing this standard is <a
- * href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509
- * Public Key Infrastructure Certificate and Certificate Revocation List
- * (CRL) Profile</a>.
- *
- * <p>Note that this class is not thread-safe. If multiple threads will
- * use or modify this class then they need to synchronize on the object.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class X509CertSelector implements CertSelector, Cloneable
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- private static final String AUTH_KEY_ID = "2.5.29.35";
- private static final String SUBJECT_KEY_ID = "2.5.29.14";
- private static final String NAME_CONSTRAINTS_ID = "2.5.29.30";
-
- private int basicConstraints;
- private X509Certificate cert;
- private BigInteger serialNo;
- private X500Principal issuer;
- private X500Principal subject;
- private byte[] subjectKeyId;
- private byte[] authKeyId;
- private boolean[] keyUsage;
- private Date certValid;
- private OID sigId;
- private PublicKey subjectKey;
- private X509EncodedKeySpec subjectKeySpec;
- private Set keyPurposeSet;
- private List altNames;
- private boolean matchAllNames;
- private byte[] nameConstraints;
- private Set policy;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new X.509 certificate selector. The new selector will be
- * empty, and will accept any certificate (provided that it is an
- * {@link X509Certificate}).
- */
- public X509CertSelector()
- {
- basicConstraints = -1;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the certificate criterion, or <code>null</code> if this value
- * was not set.
- *
- * @return The certificate.
- */
- public X509Certificate getCertificate()
- {
- return cert;
- }
-
- /**
- * Sets the certificate criterion. If set, only certificates that are
- * equal to the certificate passed here will be accepted.
- *
- * @param cert The certificate.
- */
- public void setCertificate(X509Certificate cert)
- {
- this.cert = cert;
- }
-
- /**
- * Returns the serial number criterion, or <code>null</code> if this
- * value was not set.
- *
- * @return The serial number.
- */
- public BigInteger getSerialNumber()
- {
- return serialNo;
- }
-
- /**
- * Sets the serial number of the desired certificate. Only certificates that
- * contain this serial number are accepted.
- *
- * @param serialNo The serial number.
- */
- public void setSerialNumber(BigInteger serialNo)
- {
- this.serialNo = serialNo;
- }
-
- /**
- * Returns the issuer criterion as a string, or <code>null</code> if this
- * value was not set.
- *
- * @return The issuer.
- */
- public String getIssuerAsString()
- {
- if (issuer != null)
- return issuer.getName();
- else
- return null;
- }
-
- /**
- * Returns the issuer criterion as a sequence of DER bytes, or
- * <code>null</code> if this value was not set.
- *
- * @return The issuer.
- */
- public byte[] getIssuerAsBytes() throws IOException
- {
- if (issuer != null)
- return issuer.getEncoded();
- else
- return null;
- }
-
- /**
- * Sets the issuer, specified as a string representation of the issuer's
- * distinguished name. Only certificates issued by this issuer will
- * be accepted.
- *
- * @param name The string representation of the issuer's distinguished name.
- * @throws IOException If the given name is incorrectly formatted.
- */
- public void setIssuer(String name) throws IOException
- {
- if (name != null)
- {
- try
- {
- issuer = new X500Principal(name);
- }
- catch (IllegalArgumentException iae)
- {
- throw new IOException(iae.getMessage());
- }
- }
- else
- issuer = null;
- }
-
- /**
- * Sets the issuer, specified as the DER encoding of the issuer's
- * distinguished name. Only certificates issued by this issuer will
- * be accepted.
- *
- * @param name The DER encoding of the issuer's distinguished name.
- * @throws IOException If the given name is incorrectly formatted.
- */
- public void setIssuer(byte[] name) throws IOException
- {
- if (name != null)
- {
- try
- {
- issuer = new X500Principal(name);
- }
- catch (IllegalArgumentException iae)
- {
- throw new IOException(iae.getMessage());
- }
- }
- else
- issuer = null;
- }
-
- /**
- * Returns the subject criterion as a string, of <code>null</code> if
- * this value was not set.
- *
- * @return The subject.
- */
- public String getSubjectAsString()
- {
- if (subject != null)
- return subject.getName();
- else
- return null;
- }
-
- /**
- * Returns the subject criterion as a sequence of DER bytes, or
- * <code>null</code> if this value is not set.
- *
- * @return The subject.
- */
- public byte[] getSubjectAsBytes() throws IOException
- {
- if (subject != null)
- return subject.getEncoded();
- else
- return null;
- }
-
- /**
- * Sets the subject, specified as a string representation of the
- * subject's distinguished name. Only certificates with the given
- * subject will be accepted.
- *
- * @param name The string representation of the subject's distinguished name.
- * @throws IOException If the given name is incorrectly formatted.
- */
- public void setSubject(String name) throws IOException
- {
- if (name != null)
- {
- try
- {
- subject = new X500Principal(name);
- }
- catch (IllegalArgumentException iae)
- {
- throw new IOException(iae.getMessage());
- }
- }
- else
- subject = null;
- }
-
- /**
- * Sets the subject, specified as the DER encoding of the subject's
- * distinguished name. Only certificates with the given subject will
- * be accepted.
- *
- * @param name The DER encoding of the subject's distinguished name.
- * @throws IOException If the given name is incorrectly formatted.
- */
- public void setSubject(byte[] name) throws IOException
- {
- if (name != null)
- {
- try
- {
- subject = new X500Principal(name);
- }
- catch (IllegalArgumentException iae)
- {
- throw new IOException(iae.getMessage());
- }
- }
- else
- subject = null;
- }
-
- /**
- * Returns the subject key identifier criterion, or <code>null</code> if
- * this value was not set. Note that the byte array is cloned to prevent
- * modification.
- *
- * @return The subject key identifier.
- */
- public byte[] getSubjectKeyIdentifier()
- {
- if (subjectKeyId != null)
- return (byte[]) subjectKeyId.clone();
- else
- return null;
- }
-
- /**
- * Sets the subject key identifier criterion, or <code>null</code> to clear
- * this criterion. Note that the byte array is cloned to prevent modification.
- *
- * @param subjectKeyId The subject key identifier.
- */
- public void setSubjectKeyIdentifier(byte[] subjectKeyId)
- {
- this.subjectKeyId = subjectKeyId != null ? (byte[]) subjectKeyId.clone() :
- null;
- }
-
- /**
- * Returns the authority key identifier criterion, or <code>null</code> if
- * this value was not set. Note that the byte array is cloned to prevent
- * modification.
- *
- * @return The authority key identifier.
- */
- public byte[] getAuthorityKeyIdentifier()
- {
- if (authKeyId != null)
- return (byte[]) authKeyId.clone();
- else
- return null;
- }
-
- /**
- * Sets the authority key identifier criterion, or <code>null</code> to clear
- * this criterion. Note that the byte array is cloned to prevent modification.
- *
- * @param subjectKeyId The subject key identifier.
- */
- public void setAuthorityKeyIdentifier(byte[] authKeyId)
- {
- this.authKeyId = authKeyId != null ? (byte[]) authKeyId.clone() : null;
- }
-
- /**
- * Returns the date at which certificates must be valid, or <code>null</code>
- * if this criterion was not set.
- *
- * @return The target certificate valitity date.
- */
- public Date getCertificateValid()
- {
- if (certValid != null)
- return (Date) certValid.clone();
- else
- return null;
- }
-
- /**
- * Sets the date at which certificates must be valid. Specify
- * <code>null</code> to clear this criterion.
- *
- * @param certValid The certificate validity date.
- */
- public void setCertificateValid(Date certValid)
- {
- this.certValid = certValid != null ? (Date) certValid.clone() : null;
- }
-
- /**
- * This method, and its related X.509 certificate extension &mdash; the
- * private key usage period &mdash; is not supported under the Internet
- * PKI for X.509 certificates (PKIX), described in RFC 3280. As such, this
- * method is not supported either.
- *
- * <p>Do not use this method. It is not deprecated, as it is not deprecated
- * in the Java standard, but it is basically a no-operation and simply
- * returns <code>null</code>.
- *
- * @return Null.
- */
- public Date getPrivateKeyValid()
- {
- return null;
- }
-
- /**
- * This method, and its related X.509 certificate extension &mdash; the
- * private key usage period &mdash; is not supported under the Internet
- * PKI for X.509 certificates (PKIX), described in RFC 3280. As such, this
- * method is not supported either.
- *
- * <p>Do not use this method. It is not deprecated, as it is not deprecated
- * in the Java standard, but it is basically a no-operation.
- *
- * @param UNUSED Is silently ignored.
- */
- public void setPrivateKeyValid(Date UNUSED)
- {
- }
-
- /**
- * Returns the public key algorithm ID that matching certificates must have,
- * or <code>null</code> if this criterion was not set.
- *
- * @return The public key algorithm ID.
- */
- public String getSubjectPublicKeyAlgID()
- {
- return String.valueOf(sigId);
- }
-
- /**
- * Sets the public key algorithm ID that matching certificates must have.
- * Specify <code>null</code> to clear this criterion.
- *
- * @param sigId The public key ID.
- * @throws IOException If the specified ID is not a valid object identifier.
- */
- public void setSubjectPublicKeyAlgID(String sigId) throws IOException
- {
- if (sigId != null)
- {
- try
- {
- OID oid = new OID(sigId);
- int[] comp = oid.getIDs();
- if (!checkOid(comp))
- throw new IOException("malformed OID: " + sigId);
- this.sigId = oid;
- }
- catch (IllegalArgumentException iae)
- {
- IOException ioe = new IOException("malformed OID: " + sigId);
- ioe.initCause(iae);
- throw ioe;
- }
- }
- else
- this.sigId = null;
- }
-
- /**
- * Returns the subject public key criterion, or <code>null</code> if this
- * value is not set.
- *
- * @return The subject public key.
- */
- public PublicKey getSubjectPublicKey()
- {
- return subjectKey;
- }
-
- /**
- * Sets the subject public key criterion as an opaque representation.
- * Specify <code>null</code> to clear this criterion.
- *
- * @param key The public key.
- */
- public void setSubjectPublicKey(PublicKey key)
- {
- this.subjectKey = key;
- if (key == null)
- {
- subjectKeySpec = null;
- return;
- }
- try
- {
- KeyFactory enc = KeyFactory.getInstance("X.509");
- subjectKeySpec = (X509EncodedKeySpec)
- enc.getKeySpec(key, X509EncodedKeySpec.class);
- }
- catch (Exception x)
- {
- subjectKey = null;
- subjectKeySpec = null;
- }
- }
-
- /**
- * Sets the subject public key criterion as a DER-encoded key. Specify
- * <code>null</code> to clear this value.
- *
- * @param key The DER-encoded key bytes.
- * @throws IOException If the argument is not a valid DER-encoded key.
- */
- public void setSubjectPublicKey(byte[] key) throws IOException
- {
- if (key == null)
- {
- subjectKey = null;
- subjectKeySpec = null;
- return;
- }
- try
- {
- subjectKeySpec = new X509EncodedKeySpec(key);
- KeyFactory enc = KeyFactory.getInstance("X.509");
- subjectKey = enc.generatePublic(subjectKeySpec);
- }
- catch (Exception x)
- {
- subjectKey = null;
- subjectKeySpec = null;
- IOException ioe = new IOException(x.getMessage());
- ioe.initCause(x);
- throw ioe;
- }
- }
-
- /**
- * Returns the public key usage criterion, or <code>null</code> if this
- * value is not set. Note that the array is cloned to prevent modification.
- *
- * @return The public key usage.
- */
- public boolean[] getKeyUsage()
- {
- if (keyUsage != null)
- return (boolean[]) keyUsage.clone();
- else
- return null;
- }
-
- /**
- * Sets the public key usage criterion. Specify <code>null</code> to clear
- * this value.
- *
- * @param keyUsage The public key usage.
- */
- public void setKeyUsage(boolean[] keyUsage)
- {
- this.keyUsage = keyUsage != null ? (boolean[]) keyUsage.clone() : null;
- }
-
- /**
- * Returns the set of extended key purpose IDs, as an unmodifiable set
- * of OID strings. Returns <code>null</code> if this criterion is not
- * set.
- *
- * @return The set of key purpose OIDs (strings).
- */
- public Set getExtendedKeyUsage()
- {
- if (keyPurposeSet != null)
- return Collections.unmodifiableSet(keyPurposeSet);
- else
- return null;
- }
-
- /**
- * Sets the extended key usage criterion, as a set of OID strings. Specify
- * <code>null</code> to clear this value.
- *
- * @param keyPurposeSet The set of key purpose OIDs.
- * @throws IOException If any element of the set is not a valid OID string.
- */
- public void setExtendedKeyUsage(Set keyPurposeSet) throws IOException
- {
- if (keyPurposeSet == null)
- {
- this.keyPurposeSet = null;
- return;
- }
- Set s = new HashSet();
- for (Iterator it = keyPurposeSet.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (!(o instanceof String))
- throw new IOException("not a string: " + o);
- try
- {
- OID oid = new OID((String) o);
- int[] comp = oid.getIDs();
- if (!checkOid(comp))
- throw new IOException("malformed OID: " + o);
- }
- catch (IllegalArgumentException iae)
- {
- IOException ioe = new IOException("malformed OID: " + o);
- ioe.initCause(iae);
- throw ioe;
- }
- }
- this.keyPurposeSet = s;
- }
-
- /**
- * Returns whether or not all specified alternative names must match.
- * If false, a certificate is considered a match if <em>one</em> of the
- * specified alternative names matches.
- *
- * @return true if all names must match.
- */
- public boolean getMatchAllSubjectAltNames()
- {
- return matchAllNames;
- }
-
- /**
- * Sets whether or not all subject alternative names must be matched.
- * If false, then a certificate will be considered a match if one
- * alternative name matches.
- *
- * @param matchAllNames Whether or not all alternative names must be
- * matched.
- */
- public void setMatchAllSubjectAltNames(boolean matchAllNames)
- {
- this.matchAllNames = matchAllNames;
- }
-
- /**
- * Sets the subject alternative names critertion. Each element of the
- * argument must be a {@link java.util.List} that contains exactly two
- * elements: the first an {@link Integer}, representing the type of
- * name, and the second either a {@link String} or a byte array,
- * representing the name itself.
- *
- * @param altNames The alternative names.
- * @throws IOException If any element of the argument is invalid.
- */
- public void setSubjectAlternativeNames(Collection altNames)
- throws IOException
- {
- if (altNames == null)
- {
- this.altNames = null;
- return;
- }
- List l = new ArrayList(altNames.size());
- for (Iterator it = altNames.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (!(o instanceof List) || ((List) o).size() != 2 ||
- !(((List) o).get(0) instanceof Integer) ||
- !(((List) o).get(1) instanceof String) ||
- !(((List) o).get(1) instanceof byte[]))
- throw new IOException("illegal alternative name: " + o);
- Integer i = (Integer) ((List) o).get(0);
- if (i.intValue() < 0 || i.intValue() > 8)
- throw new IOException("illegal alternative name: " + o +
- ", bad id: " + i);
- l.add(new ArrayList((List) o));
- }
- this.altNames = l;
- }
-
- /**
- * Add a name to the subject alternative names criterion.
- *
- * @param id The type of name this is. Must be in the range [0,8].
- * @param name The name.
- * @throws IOException If the id is out of range, or if the name
- * is null.
- */
- public void addSubjectAlternativeName(int id, String name)
- throws IOException
- {
- if (id < 0 || id > 8 || name == null)
- throw new IOException("illegal alternative name");
- if (altNames == null)
- altNames = new LinkedList();
- ArrayList l = new ArrayList(2);
- l.add(new Integer(id));
- l.add(name);
- altNames.add(l);
- }
-
- /**
- * Add a name, as DER-encoded bytes, to the subject alternative names
- * criterion.
- *
- * @param id The type of name this is.
- */
- public void addSubjectAlternativeName(int id, byte[] name)
- throws IOException
- {
- if (id < 0 || id > 8 || name == null)
- throw new IOException("illegal alternative name");
- if (altNames == null)
- altNames = new LinkedList();
- ArrayList l = new ArrayList(2);
- l.add(new Integer(id));
- l.add(name);
- altNames.add(l);
- }
-
- /**
- * Returns the name constraints criterion, or <code>null</code> if this
- * value is not set. Note that the byte array is cloned to prevent
- * modification.
- *
- * @return The name constraints.
- */
- public byte[] getNameConstraints()
- {
- if (nameConstraints != null)
- return (byte[]) nameConstraints.clone();
- else
- return null;
- }
-
- /**
- * Sets the name constraints criterion; specify <code>null</code> to
- * clear this criterion. Note that if non-null, the argument will be
- * cloned to prevent modification.
- *
- * @param nameConstraints The new name constraints.
- * @throws IOException If the argument is not a valid DER-encoded
- * name constraints.
- */
- public void setNameConstraints(byte[] nameConstraints)
- throws IOException
- {
- // FIXME check if the argument is valid.
- this.nameConstraints = nameConstraints != null
- ? (byte[]) nameConstraints.clone() : null;
- }
-
- /**
- * Returns the basic constraints criterion, or -1 if this value is not set.
- *
- * @return The basic constraints.
- */
- public int getBasicConstraints()
- {
- return basicConstraints;
- }
-
- /**
- * Sets the basic constraints criterion. Specify -1 to clear this parameter.
- *
- * @param basicConstraints The new basic constraints value.
- */
- public void setBasicConstraints(int basicConstraints)
- {
- if (basicConstraints < -1)
- basicConstraints = -1;
- this.basicConstraints = basicConstraints;
- }
-
- // The last two criteria not yet implemented are certificate policies
- // and path-to-names. Both of these are somewhat advanced extensions
- // (you could probably count the applications that actually use them
- // on one hand), and they both have no support in the X509Certificate
- // class.
- //
- // Not having support in X509Certificate is not always a problem; for
- // example, we can compare DER-encoded values as byte arrays for some
- // extensions. We can't, however, compare them if they are specified
- // in a set (as policies are). We need to parse the actual value in the
- // certificate, and check it against the specified set.
-
- // FIXME
-// public void setPolicy(Set policy) throws IOException
-// {
-// if (policy != null)
-// {
-// for (Iterator it = policy.iterator(); it.hasNext(); )
-// try
-// {
-// OID oid = new OID((String) it.next());
-// int[] i = oid.getIDs();
-// if (!checkOid(i))
-// throw new IOException("invalid OID");
-// }
-// catch (Exception x)
-// {
-// throw new IOException("invalid OID");
-// }
-// }
-// this.policy = policy != null ? new HashSet(policy) : null;
-// }
-
- // FIXME
-// public void setPathToNames(Collection names) throws IOException
-// {
-// if (names == null)
-// {
-// this.names = null;
-// return;
-// }
-// for (Iterator it = names.iterator(); it.hasNext(); )
-// {
-// try
-// {
-// List l = (List) it.next();
-// if (l.get(1) instanceof String)
-// addPathToName(((Integer)l.get(0)).intValue(), (String)l.get(1));
-// else
-// addPathToName(((Integer)l.get(0)).intValue(), (byte[])l.get(1));
-// }
-// catch (Exception x)
-// {
-// this.names = null;
-// throw new IOException("invalid names");
-// }
-// }
-// }
-
- // FIXME
-// public void addPathToName(int id, String name) throws IOException
-// {
-// }
-
- // FIXME
-// public void addPathToName(int id, byte[] name) throws IOException
-// {
-// }
-
- // FIXME
-// public Collection getSubjectAlternativeNames()
-// {
-// return null;
-// }
-
- // FIXME
-// public Set getPolicy()
-// {
-// return null;
-// }
-
- // FIXME
-// public Collection getPathToNames()
-// {
-// return null;
-// }
-
- /**
- * Match a certificate. This method will check the given certificate
- * against all the enabled criteria of this selector, and will return
- * <code>true</code> if the given certificate matches.
- *
- * @param certificate The certificate to check.
- * @return true if the certificate matches all criteria.
- */
- public boolean match(Certificate certificate)
- {
- if (!(certificate instanceof X509Certificate))
- return false;
- X509Certificate cert = (X509Certificate) certificate;
- if (this.cert != null)
- {
- try
- {
- byte[] e1 = this.cert.getEncoded();
- byte[] e2 = cert.getEncoded();
- if (!Arrays.equals(e1, e2))
- return false;
- }
- catch (CertificateEncodingException cee)
- {
- return false;
- }
- }
- if (serialNo != null)
- {
- if (!serialNo.equals(cert.getSerialNumber()))
- return false;
- }
- if (certValid != null)
- {
- try
- {
- cert.checkValidity(certValid);
- }
- catch (CertificateException ce)
- {
- return false;
- }
- }
- if (issuer != null)
- {
- if (!issuer.equals(cert.getIssuerX500Principal()))
- return false;
- }
- if (subject != null)
- {
- if (!subject.equals(cert.getSubjectX500Principal()))
- return false;
- }
- if (sigId != null)
- {
- if (!sigId.equals(cert.getSigAlgOID()))
- return false;
- }
- if (subjectKeyId != null)
- {
- byte[] b = cert.getExtensionValue(SUBJECT_KEY_ID);
- if (!Arrays.equals(b, subjectKeyId))
- return false;
- }
- if (authKeyId != null)
- {
- byte[] b = cert.getExtensionValue(AUTH_KEY_ID);
- if (!Arrays.equals(b, authKeyId))
- return false;
- }
- if (keyUsage != null)
- {
- boolean[] b = cert.getKeyUsage();
- if (!Arrays.equals(b, keyUsage))
- return false;
- }
- if (basicConstraints >= 0)
- {
- if (cert.getBasicConstraints() != basicConstraints)
- return false;
- }
- if (keyPurposeSet != null)
- {
- List kp = null;
- try
- {
- kp = cert.getExtendedKeyUsage();
- }
- catch (CertificateParsingException cpe)
- {
- return false;
- }
- if (kp == null)
- return false;
- for (Iterator it = keyPurposeSet.iterator(); it.hasNext(); )
- {
- if (!kp.contains(it.next()))
- return false;
- }
- }
- if (altNames != null)
- {
- Collection an = null;
- try
- {
- an = cert.getSubjectAlternativeNames();
- }
- catch (CertificateParsingException cpe)
- {
- return false;
- }
- if (an == null)
- return false;
- int match = 0;
- for (Iterator it = altNames.iterator(); it.hasNext(); )
- {
- List l = (List) it.next();
- Integer id = (Integer) l.get(0);
- String s = null;
- byte[] b = null;
- if (l.get(1) instanceof String)
- s = (String) l.get(1);
- else if (l.get(1) instanceof byte[])
- b = (byte[]) l.get(1);
- else
- return false;
- for (Iterator it2 = an.iterator(); it2.hasNext(); )
- {
- Object o = it2.next();
- if (!(o instanceof List))
- continue;
- List l2 = (List) o;
- if (l2.size() != 2)
- continue;
- if (!id.equals(l2.get(0)))
- continue;
- if (s != null && (l2.get(1) instanceof String) &&
- s.equals(l2.get(1)))
- match++;
- else if (b != null && (l2.get(1) instanceof byte[]) &&
- Arrays.equals(b, (byte[]) l2.get(1)))
- match++;
- }
- if (match == 0 || (matchAllNames && match != altNames.size()))
- return false;
- }
- }
- if (nameConstraints != null)
- {
- byte[] nc = cert.getExtensionValue(NAME_CONSTRAINTS_ID);
- if (!Arrays.equals(nameConstraints, nc))
- return false;
- }
-
- // FIXME check policies.
- // FIXME check path-to-names.
-
- return true;
- }
-
- public String toString()
- {
- StringBuffer str = new StringBuffer(X509CertSelector.class.getName());
- String nl = SystemProperties.getProperty("line.separator");
- String eol = ";" + nl;
- str.append(" {").append(nl);
- if (cert != null)
- str.append(" certificate = ").append(cert).append(eol);
- if (basicConstraints >= 0)
- str.append(" basic constraints = ").append(basicConstraints).append(eol);
- if (serialNo != null)
- str.append(" serial number = ").append(serialNo).append(eol);
- if (certValid != null)
- str.append(" valid date = ").append(certValid).append(eol);
- if (issuer != null)
- str.append(" issuer = ").append(issuer).append(eol);
- if (subject != null)
- str.append(" subject = ").append(subject).append(eol);
- if (sigId != null)
- str.append(" signature OID = ").append(sigId).append(eol);
- if (subjectKey != null)
- str.append(" subject public key = ").append(subjectKey).append(eol);
- if (subjectKeyId != null)
- {
- str.append(" subject key ID = ");
- for (int i = 0; i < subjectKeyId.length; i++)
- {
- str.append(Character.forDigit((subjectKeyId[i] & 0xF0) >>> 8, 16));
- str.append(Character.forDigit((subjectKeyId[i] & 0x0F), 16));
- if (i < subjectKeyId.length - 1)
- str.append(':');
- }
- str.append(eol);
- }
- if (authKeyId != null)
- {
- str.append(" authority key ID = ");
- for (int i = 0; i < authKeyId.length; i++)
- {
- str.append(Character.forDigit((authKeyId[i] & 0xF0) >>> 8, 16));
- str.append(Character.forDigit((authKeyId[i] & 0x0F), 16));
- if (i < authKeyId.length - 1)
- str.append(':');
- }
- str.append(eol);
- }
- if (keyUsage != null)
- {
- str.append(" key usage = ");
- for (int i = 0; i < keyUsage.length; i++)
- str.append(keyUsage[i] ? '1' : '0');
- str.append(eol);
- }
- if (keyPurposeSet != null)
- str.append(" key purpose = ").append(keyPurposeSet).append(eol);
- if (altNames != null)
- str.append(" alternative names = ").append(altNames).append(eol);
- if (nameConstraints != null)
- str.append(" name constraints = <blob of data>").append(eol);
- str.append("}").append(nl);
- return str.toString();
- }
-
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException shouldNotHappen)
- {
- throw new Error(shouldNotHappen);
- }
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private static boolean checkOid(int[] oid)
- {
- return (oid != null && oid.length > 2 &&
- (oid[0] >= 0 && oid[0] <= 2) && (oid[1] >= 0 && oid[1] <= 39));
- }
-}
diff --git a/libjava/java/security/cert/X509Certificate.java b/libjava/java/security/cert/X509Certificate.java
deleted file mode 100644
index 0f13357fd1d..00000000000
--- a/libjava/java/security/cert/X509Certificate.java
+++ /dev/null
@@ -1,586 +0,0 @@
-/* X509Certificate.java --- X.509 Certificate class
- Copyright (C) 1999,2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-
-import java.math.BigInteger;
-import java.security.Principal;
-import java.util.Date;
-
-/**
- * X509Certificate is the abstract class for X.509 certificates.
- * This provides a stanard class interface for accessing all
- * the attributes of X.509 certificates.
- *
- * <p>In June 1996, the basic X.509 v3 format was finished by
- * ISO/IEC and ANSI X.9. The ASN.1 DER format is below:
- *
- * <blockquote><pre>
- * Certificate ::= SEQUENCE {
- * tbsCertificate TBSCertificate,
- * signatureAlgorithm AlgorithmIdentifier,
- * signatureValue BIT STRING }
- * </pre></blockquote>
- *
- * <p>These certificates are widely used in various Internet
- * protocols to support authentication. It is used in
- * Privacy Enhanced Mail (PEM), Transport Layer Security (TLS),
- * Secure Sockets Layer (SSL), code signing for trusted software
- * distribution, and Secure Electronic Transactions (SET).
- *
- * <p>The certificates are managed and vouched for by
- * <I>Certificate Authorities</I> (CAs). CAs are companies or
- * groups that create certificates by placing the data in the
- * X.509 certificate format and signing it with their private
- * key. CAs serve as trusted third parties by certifying that
- * the person or group specified in the certificate is who
- * they say they are.
- *
- * <p>The ASN.1 defintion for <I>tbsCertificate</I> is
- *
- * <blockquote><pre>
- * TBSCertificate ::= SEQUENCE {
- * version [0] EXPLICIT Version DEFAULT v1,
- * serialNumber CertificateSerialNumber,
- * signature AlgorithmIdentifier,
- * issuer Name,
- * validity Validity,
- * subject Name,
- * subjectPublicKeyInfo SubjectPublicKeyInfo,
- * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
- * -- If present, version shall be v2 or v3
- * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
- * -- If present, version shall be v2 or v3
- * extensions [3] EXPLICIT Extensions OPTIONAL
- * -- If present, version shall be v3
- * }
- *
- * Version ::= INTEGER { v1(0), v2(1), v3(2) }
- *
- * CertificateSerialNumber ::= INTEGER
- *
- * Validity ::= SEQUENCE {
- * notBefore Time,
- * notAfter Time }
- *
- * Time ::= CHOICE {
- * utcTime UTCTime,
- * generalTime GeneralizedTime }
- *
- * UniqueIdentifier ::= BIT STRING
- *
- * SubjectPublicKeyInfo ::= SEQUENCE {
- * algorithm AlgorithmIdentifier,
- * subjectPublicKey BIT STRING }
- *
- * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
- *
- * Extension ::= SEQUENCE {
- * extnID OBJECT IDENTIFIER,
- * critical BOOLEAN DEFAULT FALSE,
- * extnValue OCTET STRING }
- * </pre></blockquote>
- *
- * Certificates are created with the CertificateFactory.
- *
- * <p>References:
- *
- * <ol>
- * <li>Olivier Dubuisson, Philippe Fouquart (Translator) <i>ASN.1 -
- * Communication between heterogeneous systems</i>, (C) September 2000,
- * Morgan Kaufmann Publishers, ISBN 0-12-6333361-0. Available on-line at
- * <a
- * href="http://www.oss.com/asn1/dubuisson.html">http://www.oss.com/asn1/dubuisson.html</a></li>
- * <li>R. Housley et al, <i><a href="http://www.ietf.org/rfc/rfc3280.txt">RFC
- * 3280: Internet X.509 Public Key Infrastructure Certificate and CRL
- * Profile</a></i>.</li>
- * </ol>
- *
- * @since JDK 1.2
- * @author Mark Benvenuto
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public abstract class X509Certificate extends Certificate implements X509Extension
-{
- private static final long serialVersionUID = -2491127588187038216L;
-
- /**
- * Constructs a new certificate of the specified type.
- */
- protected X509Certificate()
- {
- super( "X.509" );
- }
-
- /**
- Checks the validity of the X.509 certificate. It is valid
- if the current date and time are within the period specified
- by the certificate.
-
- The ASN.1 DER encoding is:
-
- validity Validity,
-
- Validity ::= SEQUENCE {
- notBefore Time,
- notAfter Time }
-
- Time ::= CHOICE {
- utcTime UTCTime,
- generalTime GeneralizedTime }
-
- Consult rfc2459 for more information.
-
- @throws CertificateExpiredException if the certificate expired
- @throws CertificateNotYetValidException if the certificate is
- not yet valid
- */
- public abstract void checkValidity()
- throws CertificateExpiredException,
- CertificateNotYetValidException;
-
- /**
- Checks the validity of the X.509 certificate for the
- specified time and date. It is valid if the specified
- date and time are within the period specified by
- the certificate.
-
- @throws CertificateExpiredException if the certificate expired
- based on the date
- @throws CertificateNotYetValidException if the certificate is
- not yet valid based on the date
- */
- public abstract void checkValidity(Date date)
- throws CertificateExpiredException,
- CertificateNotYetValidException;
-
- /**
- Returns the version of this certificate.
-
- The ASN.1 DER encoding is:
-
- version [0] EXPLICIT Version DEFAULT v1,
-
- Version ::= INTEGER { v1(0), v2(1), v3(2) }
-
- Consult rfc2459 for more information.
-
- @return version number of certificate
- */
- public abstract int getVersion();
-
- /**
- Gets the serial number for serial Number in
- this Certifcate. It must be a unique number
- unique other serial numbers from the granting CA.
-
- The ASN.1 DER encoding is:
-
- serialNumber CertificateSerialNumber,
-
- CertificateSerialNumber ::= INTEGER
-
- Consult rfc2459 for more information.
-
- @return the serial number for this X509CRLEntry.
- */
- public abstract BigInteger getSerialNumber();
-
- /**
- Returns the issuer (issuer distinguished name) of the
- Certificate. The issuer is the entity who signed
- and issued the Certificate.
-
- The ASN.1 DER encoding is:
-
- issuer Name,
-
- Name ::= CHOICE {
- RDNSequence }
-
- RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
-
- RelativeDistinguishedName ::=
- SET OF AttributeTypeAndValue
-
- AttributeTypeAndValue ::= SEQUENCE {
- type AttributeType,
- value AttributeValue }
-
- AttributeType ::= OBJECT IDENTIFIER
-
- AttributeValue ::= ANY DEFINED BY AttributeType
-
- DirectoryString ::= CHOICE {
- teletexString TeletexString (SIZE (1..MAX)),
- printableString PrintableString (SIZE (1..MAX)),
- universalString UniversalString (SIZE (1..MAX)),
- utf8String UTF8String (SIZE (1.. MAX)),
- bmpString BMPString (SIZE (1..MAX)) }
-
- Consult rfc2459 for more information.
-
- @return the issuer in the Principal class
- */
- public abstract Principal getIssuerDN();
-
- /**
- Returns the subject (subject distinguished name) of the
- Certificate. The subject is the entity who the Certificate
- identifies.
-
- The ASN.1 DER encoding is:
-
- subject Name,
-
- Consult rfc2459 for more information.
-
- @return the issuer in the Principal class
- */
- public abstract Principal getSubjectDN();
-
- /**
- Returns the date that this certificate is not to be used
- before, <I>notBefore</I>.
-
- The ASN.1 DER encoding is:
-
- validity Validity,
-
- Validity ::= SEQUENCE {
- notBefore Time,
- notAfter Time }
-
- Time ::= CHOICE {
- utcTime UTCTime,
- generalTime GeneralizedTime }
-
- Consult rfc2459 for more information.
-
- @return the date <I>notBefore</I>
- */
- public abstract Date getNotBefore();
-
- /**
- Returns the date that this certificate is not to be used
- after, <I>notAfter</I>.
-
- @return the date <I>notAfter</I>
- */
- public abstract Date getNotAfter();
-
-
- /**
- Returns the <I>tbsCertificate</I> from the certificate.
-
- @return the DER encoded tbsCertificate
-
- @throws CertificateEncodingException if encoding error occurred
- */
- public abstract byte[] getTBSCertificate() throws CertificateEncodingException;
-
- /**
- Returns the signature in its raw DER encoded format.
-
- The ASN.1 DER encoding is:
-
- signatureValue BIT STRING
-
- Consult rfc2459 for more information.
-
- @return byte array representing signature
- */
- public abstract byte[] getSignature();
-
- /**
- Returns the signature algorithm used to sign the CRL.
- An examples is "SHA-1/DSA".
-
- The ASN.1 DER encoding is:
-
- signatureAlgorithm AlgorithmIdentifier,
-
- AlgorithmIdentifier ::= SEQUENCE {
- algorithm OBJECT IDENTIFIER,
- parameters ANY DEFINED BY algorithm OPTIONAL }
-
- Consult rfc2459 for more information.
-
- The algorithm name is determined from the OID.
-
- @return a string with the signature algorithm name
- */
- public abstract String getSigAlgName();
-
-
- /**
- Returns the OID for the signature algorithm used.
- Example "1.2.840.10040.4.3" is return for SHA-1 with DSA.\
-
- The ASN.1 DER encoding for the example is:
-
- id-dsa-with-sha1 ID ::= {
- iso(1) member-body(2) us(840) x9-57 (10040)
- x9cm(4) 3 }
-
- Consult rfc2459 for more information.
-
- @return a string containing the OID.
- */
- public abstract String getSigAlgOID();
-
-
- /**
- Returns the AlgorithmParameters in the encoded form
- for the signature algorithm used.
-
- If access to the parameters is need, create an
- instance of AlgorithmParameters.
-
- @return byte array containing algorithm parameters, null
- if no parameters are present in certificate
- */
- public abstract byte[] getSigAlgParams();
-
-
- /**
- Returns the issuer unique ID for this certificate.
-
- The ASN.1 DER encoding is:
-
- issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
- -- If present, version shall be v2 or v3
-
- UniqueIdentifier ::= BIT STRING
-
- Consult rfc2459 for more information.
-
- @return bit representation of <I>issuerUniqueID</I>
- */
- public abstract boolean[] getIssuerUniqueID();
-
- /**
- Returns the subject unique ID for this certificate.
-
- The ASN.1 DER encoding is:
-
- subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
- -- If present, version shall be v2 or v3
-
- UniqueIdentifier ::= BIT STRING
-
- Consult rfc2459 for more information.
-
- @return bit representation of <I>subjectUniqueID</I>
- */
- public abstract boolean[] getSubjectUniqueID();
-
- /**
- Returns a boolean array representing the <I>KeyUsage</I>
- extension for the certificate. The KeyUsage (OID = 2.5.29.15)
- defines the purpose of the key in the certificate.
-
- The ASN.1 DER encoding is:
-
- id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 }
-
- KeyUsage ::= BIT STRING {
- digitalSignature (0),
- nonRepudiation (1),
- keyEncipherment (2),
- dataEncipherment (3),
- keyAgreement (4),
- keyCertSign (5),
- cRLSign (6),
- encipherOnly (7),
- decipherOnly (8) }
-
- Consult rfc2459 for more information.
-
- @return bit representation of <I>KeyUsage</I>
- */
- public abstract boolean[] getKeyUsage();
-
- /**
- Returns the certificate constraints path length from the
- critical BasicConstraints extension, (OID = 2.5.29.19).
-
- The basic constraints extensions is used to determine if
- the subject of the certificate is a Certificate Authority (CA)
- and how deep the certification path may exist. The
- <I>pathLenConstraint</I> only takes affect if <I>cA</I>
- is set to true. "A value of zero indicates that only an
- end-entity certificate may follow in the path." (rfc2459)
-
- The ASN.1 DER encoding is:
-
- id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 }
-
- BasicConstraints ::= SEQUENCE {
- cA BOOLEAN DEFAULT FALSE,
- pathLenConstraint INTEGER (0..MAX) OPTIONAL }
-
- Consult rfc2459 for more information.
-
- @return the length of the path constraint if BasicConstraints
- is present and cA is TRUE. Otherwise returns -1.
- */
- public abstract int getBasicConstraints();
-
- // 1.4 instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the <code>ExtendedKeyUsage</code> extension of this
- * certificate, or null if there is no extension present. The returned
- * value is a {@link java.util.List} strings representing the object
- * identifiers of the extended key usages. This extension has the OID
- * 2.5.29.37.
- *
- * <p>The ASN.1 definition for this extension is:
- *
- * <blockquote><pre>
- * ExtendedKeyUsage ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
- *
- * KeyPurposeId ::= OBJECT IDENTIFIER
- * </pre></blockquote>
- *
- * @return The list of extension OIDs, or null if there are none
- * present in this certificate.
- * @throws CertificateParsingException If this extension cannot be
- * parsed from its encoded form.
- */
- public java.util.List getExtendedKeyUsage()
- throws CertificateParsingException
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns the alternative names for this certificate's subject (the
- * owner), or null if there are none.
- *
- * <p>This is an X.509 extension with OID 2.5.29.17 and is defined by
- * the ASN.1 construction:
- *
- * <blockquote><pre>
- * SubjectAltNames ::= GeneralNames
- *
- * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
- *
- * GeneralName ::= CHOICE {
- * otherName [0] OtherName,
- * rfc822Name [1] IA5String,
- * dNSName [2] IA5String,
- * x400Address [3] ORAddress,
- * directoryName [4] Name,
- * ediPartyName [5] EDIPartyName,
- * uniformResourceIdentifier [6] IA5String,
- * iPAddress [7] OCTET STRING,
- * registeredID [8] OBJECT IDENTIFIER
- * }
- * </pre></blockquote>
- *
- * <p>The returned collection contains one or more two-element Lists,
- * with the first object being an Integer representing the choice
- * above (with value 0 through 8) and the second being an (a) String
- * if the <code>GeneralName</code> is a rfc822Name, dNSName,
- * uniformResourceIdentifier, iPAddress, or registeredID, or (b) a
- * byte array of the DER encoded form for any others.
- *
- * @return The collection of alternative names, or null if there are
- * none.
- * @throws CertificateParsingException If the encoded extension cannot
- * be parsed.
- * @since JDK 1.4
- */
- public java.util.Collection getSubjectAlternativeNames()
- throws CertificateParsingException
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns the alternative names for this certificate's issuer, or
- * null if there are none.
- *
- * <p>This is an X.509 extension with OID 2.5.29.18, and is defined by
- * the ASN.1 construction:
- *
- * <blockquote><pre>
- * IssuerAltNames ::= GeneralNames
- * </pre></blockquote>
- *
- * <p>The <code>GeneralNames</code> construct and the form of the
- * returned collection are the same as with {@link
- * #getSubjectAlternativeNames()}.
- *
- * @return The collection of alternative names, or null if there are
- * none.
- * @throws CertificateParsingException If the encoded extension cannot
- * be parsed.
- * @since JDK 1.4
- */
- public java.util.Collection getIssuerAlternativeNames()
- throws CertificateParsingException
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns the X.500 distinguished name of this certificate's subject.
- *
- * @return The subject's X.500 distinguished name.
- * @since JDK 1.4
- */
- public javax.security.auth.x500.X500Principal getSubjectX500Principal()
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns the X.500 distinguished name of this certificate's issuer.
- *
- * @return The issuer's X.500 distinguished name.
- * @since JDK 1.4
- */
- public javax.security.auth.x500.X500Principal getIssuerX500Principal()
- {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/libjava/java/security/cert/X509Extension.java b/libjava/java/security/cert/X509Extension.java
deleted file mode 100644
index d2cb80a9f57..00000000000
--- a/libjava/java/security/cert/X509Extension.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* X509Extension.java --- X.509 Extension
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.cert;
-import java.util.Set;
-
-/**
- Public interface for the X.509 Extension.
-
- This is used for X.509 v3 Certificates and CRL v2 (Certificate
- Revocation Lists) for managing attributes assoicated with
- Certificates, for managing the hierarchy of certificates,
- and for managing the distribution of CRL. This extension
- format is used to define private extensions.
-
- Each extensions for a certificate or CRL must be marked
- either critical or non-critical. If the certificate/CRL
- system encounters a critical extension not recognized then
- it must reject the certificate. A non-critical extension
- may be just ignored if not recognized.
-
-
- The ASN.1 definition for this class is:
-
- Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
-
- Extension ::= SEQUENCE {
- extnId OBJECT IDENTIFIER,
- critical BOOLEAN DEFAULT FALSE,
- extnValue OCTET STRING
- -- contains a DER encoding of a value
- -- of the type registered for use with
- -- the extnId object identifier value
- }
-
- @author Mark Benvenuto
-
- @since JDK 1.2
-*/
-public interface X509Extension
-{
-
- /**
- Returns true if the certificate contains a critical extension
- that is not supported.
-
- @return true if has unsupported extension, false otherwise
- */
- boolean hasUnsupportedCriticalExtension();
-
- /**
- Returns a set of the CRITICAL extension OIDs from the
- certificate/CRL that the object implementing this interface
- manages.
-
- @return A Set containing the OIDs. If there are no CRITICAL
- extensions or extensions at all this returns null.
- */
- Set getCriticalExtensionOIDs();
-
- /**
- Returns a set of the NON-CRITICAL extension OIDs from the
- certificate/CRL that the object implementing this interface
- manages.
-
- @return A Set containing the OIDs. If there are no NON-CRITICAL
- extensions or extensions at all this returns null.
- */
- Set getNonCriticalExtensionOIDs();
-
- /**
- Returns the DER encoded OCTET string for the specified
- extension value identified by a OID. The OID is a string
- of number separated by periods. Ex: 12.23.45.67
- */
- byte[] getExtensionValue(String oid);
-
-}
diff --git a/libjava/java/security/interfaces/DSAKey.java b/libjava/java/security/interfaces/DSAKey.java
deleted file mode 100644
index c6e819eb0e5..00000000000
--- a/libjava/java/security/interfaces/DSAKey.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* DSAKey.java -- Interface for Digital Signature Algorithm key
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.interfaces;
-
-/**
- * This interface is implemented by a class to return the parameters
- * of a Digital Signature Algorithm (DSA) public or private key.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface DSAKey
-{
- /**
- * This method returns non-secret parameters of the DSA key
- *
- * @return The DSA parameters
- */
- DSAParams getParams();
-}
diff --git a/libjava/java/security/interfaces/DSAKeyPairGenerator.java b/libjava/java/security/interfaces/DSAKeyPairGenerator.java
deleted file mode 100644
index e657c54b4e6..00000000000
--- a/libjava/java/security/interfaces/DSAKeyPairGenerator.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* DSAKeyPairGenerator.java -- Initialize a DSA key generator
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.interfaces;
-
-import java.security.InvalidParameterException;
-import java.security.SecureRandom;
-
-/**
- * This interface contains methods for intializing a Digital Signature
- * Algorithm key generation engine. The initialize methods may be called
- * any number of times. If no explicity initialization call is made, then
- * the engine defaults to generating 1024-bit keys using pre-calculated
- * base, prime, and subprime values.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface DSAKeyPairGenerator
-{
- /**
- * Initializes the key generator with the specified DSA parameters and
- * random bit source
- *
- * @param params The DSA parameters to use
- * @param random The random bit source to use
- *
- * @exception InvalidParameterException If the parameters passed are not valid
- */
- void initialize (DSAParams params, SecureRandom random)
- throws InvalidParameterException;
-
- /**
- * Initializes the key generator to a give modulus. If the <code>genParams</code>
- * value is <code>true</code> then new base, prime, and subprime values
- * will be generated for the given modulus. If not, the pre-calculated
- * values will be used. If no pre-calculated values exist for the specified
- * modulus, an exception will be thrown. It is guaranteed that there will
- * always be pre-calculated values for all modulus values between 512 and
- * 1024 bits inclusives.
- *
- * @param modlen The modulus length
- * @param genParams <code>true</code> to generate new DSA parameters, <code>false</code> otherwise
- * @param random The random bit source to use
- *
- * @exception InvalidParameterException If a parameter is invalid
- */
- void initialize (int modlen, boolean genParams, SecureRandom random)
- throws InvalidParameterException;
-}
diff --git a/libjava/java/security/interfaces/DSAParams.java b/libjava/java/security/interfaces/DSAParams.java
deleted file mode 100644
index 42baeeb9570..00000000000
--- a/libjava/java/security/interfaces/DSAParams.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* DSAParams.java -- Digital Signature Algorithm parameter access
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.interfaces;
-
-import java.math.BigInteger;
-
-/**
- * This interface allows the Digital Signature Algorithm (DSA) parameters
- * to be queried.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface DSAParams
-{
- /**
- * Returns the base, or 'g' value
- *
- * @return The DSA base value
- */
- BigInteger getG();
-
- /**
- * Returns the prime, or 'p' value
- *
- * @return The DSA prime value
- */
- BigInteger getP();
-
- /**
- * Returns the subprime, or 'q' value
- *
- * @return The DSA subprime value
- */
- BigInteger getQ();
-}
diff --git a/libjava/java/security/interfaces/DSAPrivateKey.java b/libjava/java/security/interfaces/DSAPrivateKey.java
deleted file mode 100644
index d79b34b9043..00000000000
--- a/libjava/java/security/interfaces/DSAPrivateKey.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* DSAPublicKey.java -- A Digital Signature Algorithm private key
- Copyright (C) 1998, 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.interfaces;
-
-import java.math.BigInteger;
-import java.security.PrivateKey;
-
-/**
- * This interface models a Digital Signature Algorithm (DSA) private key
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface DSAPrivateKey extends DSAKey, PrivateKey
-{
- /**
- * The version identifier used for serialization.
- */
- long serialVersionUID = 7776497482533790279L;
-
- /**
- * This method returns the value of the DSA private key
- */
- BigInteger getX();
-}
diff --git a/libjava/java/security/interfaces/DSAPublicKey.java b/libjava/java/security/interfaces/DSAPublicKey.java
deleted file mode 100644
index d73e189f607..00000000000
--- a/libjava/java/security/interfaces/DSAPublicKey.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* DSAPublicKey.java -- A Digital Signature Algorithm public key
- Copyright (C) 1998, 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.interfaces;
-
-import java.math.BigInteger;
-import java.security.PublicKey;
-
-/**
- * This interface models a Digital Signature Algorithm (DSA) public key
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface DSAPublicKey extends DSAKey, PublicKey
-{
- /**
- * The version identifier used for serialization.
- */
- long serialVersionUID = 1234526332779022332L;
-
- /**
- * This method returns the value of the DSA public key
- */
- BigInteger getY();
-}
diff --git a/libjava/java/security/interfaces/RSAKey.java b/libjava/java/security/interfaces/RSAKey.java
deleted file mode 100644
index 485fa81e05a..00000000000
--- a/libjava/java/security/interfaces/RSAKey.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* RSAKey.java --- A generic RSA Key interface
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.interfaces;
-
-import java.math.BigInteger;
-
-/**
- A generic RSA Key interface for public and private keys
-
- @since JDK 1.3
-
- @author Mark Benvenuto
- */
-public interface RSAKey
-{
- /**
- Generates a modulus.
-
- @returns a modulus
- */
- BigInteger getModulus();
-}
diff --git a/libjava/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java b/libjava/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
deleted file mode 100644
index d80b962d012..00000000000
--- a/libjava/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/* RSAMultiPrimePrivateCrtKey.java --
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.interfaces;
-
-import java.math.BigInteger;
-import java.security.spec.RSAOtherPrimeInfo;
-
-/**
- * The interface to an RSA multi-prime private key, as defined in the PKCS#1
- * v2.1, using the <i>Chinese Remainder Theorem</i> (CRT) information values.
- *
- * @since 1.4
- * @see java.security.spec.RSAPrivateKeySpec
- * @see java.security.spec.RSAMultiPrimePrivateCrtKeySpec
- * @see RSAPrivateKey
- * @see RSAPrivateCrtKey
- */
-public interface RSAMultiPrimePrivateCrtKey extends RSAPrivateKey
-{
- // Constants
- // --------------------------------------------------------------------------
- long serialVersionUID = 618058533534628008L;
-
- // Methods
- // --------------------------------------------------------------------------
-
- /**
- * Returns the public exponent.
- *
- * @return the public exponent.
- */
- BigInteger getPublicExponent();
-
- /**
- * Returns the primeP.
- *
- * @return the primeP.
- */
- BigInteger getPrimeP();
-
- /**
- * Returns the primeQ.
- *
- * @return the primeQ.
- */
- BigInteger getPrimeQ();
-
- /**
- * Returns the primeExponentP.
- *
- * @return the primeExponentP.
- */
- BigInteger getPrimeExponentP();
-
- /**
- * Returns the primeExponentQ.
- *
- * @return the primeExponentQ.
- */
- BigInteger getPrimeExponentQ();
-
- /**
- * Returns the crtCoefficient.
- *
- * @return the crtCoefficient.
- */
- BigInteger getCrtCoefficient();
-
- /**
- * Returns the otherPrimeInfo or <code>null</code> if there are only two
- * prime factors (p and q).
- *
- * @return the otherPrimeInfo.
- */
- RSAOtherPrimeInfo[] getOtherPrimeInfo();
-}
diff --git a/libjava/java/security/interfaces/RSAPrivateCrtKey.java b/libjava/java/security/interfaces/RSAPrivateCrtKey.java
deleted file mode 100644
index 96a1496cf92..00000000000
--- a/libjava/java/security/interfaces/RSAPrivateCrtKey.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* RSAPrivateCrtKey.java -- An RSA private key in CRT format
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.interfaces;
-
-import java.math.BigInteger;
-
-/**
- * This interface provides access to information about an RSA private
- * key in Chinese Remainder Theorem (CRT) format.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface RSAPrivateCrtKey extends RSAPrivateKey
-{
- long serialVersionUID = -5682214253527700368L;
-
- /**
- * Returns the public exponent for this key
- *
- * @return The public exponent for this key
- */
- BigInteger getPublicExponent();
-
- /**
- * Returns the primeP value
- *
- * @return The primeP value
- */
- BigInteger getPrimeP();
-
- /**
- * Returns the primeQ value
- *
- * @return The primeQ value
- */
- BigInteger getPrimeQ();
-
- /**
- * Returns the primeExponentP
- *
- * @return The primeExponentP
- */
- BigInteger getPrimeExponentP();
-
- /**
- * Returns the primeExponentQ
- *
- * @return The primeExponentQ
- */
- BigInteger getPrimeExponentQ();
-
- /**
- * Returns the CRT coefficient
- *
- * @return The CRT coefficient
- */
- BigInteger getCrtCoefficient();
-}
diff --git a/libjava/java/security/interfaces/RSAPrivateKey.java b/libjava/java/security/interfaces/RSAPrivateKey.java
deleted file mode 100644
index 514987625a5..00000000000
--- a/libjava/java/security/interfaces/RSAPrivateKey.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* RSAPrivateKey.java -- An RSA private key
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.interfaces;
-
-import java.math.BigInteger;
-import java.security.PrivateKey;
-
-/**
- * This interface provides access to information about an RSA private key.
- *
- * @version 0.1
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface RSAPrivateKey extends PrivateKey, RSAKey
-{
- long serialVersionUID = 5187144804936595022L;
-
- /**
- * Returns the private exponent value for this key
- *
- * @return The private exponent value for this key
- */
- BigInteger getPrivateExponent();
-}
diff --git a/libjava/java/security/interfaces/RSAPublicKey.java b/libjava/java/security/interfaces/RSAPublicKey.java
deleted file mode 100644
index 5fb569d1dec..00000000000
--- a/libjava/java/security/interfaces/RSAPublicKey.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* RSAPublicKey.java -- An RSA public key
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.interfaces;
-
-import java.math.BigInteger;
-import java.security.PublicKey;
-
-/**
- * This interface provides access to information about an RSA public key.
- *
- * @version 0.1
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface RSAPublicKey extends PublicKey, RSAKey
-{
- long serialVersionUID = -8727434096241101194L;
-
- /**
- * Returns the public exponent value for this key
- *
- * @return The public exponent value for this key
- */
- BigInteger getPublicExponent();
-}
diff --git a/libjava/java/security/spec/AlgorithmParameterSpec.java b/libjava/java/security/spec/AlgorithmParameterSpec.java
deleted file mode 100644
index 25506f55cfe..00000000000
--- a/libjava/java/security/spec/AlgorithmParameterSpec.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* AlgorithmParameterSpec.java --- Algorithm Parameter Spec Interface
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-/**
- A transparent interface for Algorithm Parameter Specifications.
- It contains no member functions. It is used to group
- algorithm parameter classes.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
-*/
-public interface AlgorithmParameterSpec
-{
-}
diff --git a/libjava/java/security/spec/DSAParameterSpec.java b/libjava/java/security/spec/DSAParameterSpec.java
deleted file mode 100644
index 31270537c4c..00000000000
--- a/libjava/java/security/spec/DSAParameterSpec.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* DSAParameterSpec.java --- DSA Parameter Specificaton class
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-import java.math.BigInteger;
-import java.security.interfaces.DSAParams;
-
-/**
- * DSA Parameter class Specification. Used to maintain the DSA
- * Parameters.
- *
- * @since 1.2
- *
- * @author Mark Benvenuto
-*/
-public class DSAParameterSpec implements AlgorithmParameterSpec, DSAParams
-{
- private BigInteger p = null;
- private BigInteger q = null;
- private BigInteger g = null;
-
- /**
- * Constructs a new DSAParameterSpec with the specified p, q, and g.
- *
- * @param p the prime
- * @param q the sub-prime
- * @param g the base
- */
- public DSAParameterSpec(BigInteger p, BigInteger q, BigInteger g)
- {
- this.p = p;
- this.q = q;
- this.g = g;
- }
-
- /**
- * Returns p for the DSA algorithm.
- *
- * @return Returns the requested BigInteger
- */
- public BigInteger getP()
- {
- return this.p;
- }
-
- /**
- * Returns p for the DSA algorithm.
- *
- * @return Returns the requested BigInteger
- */
- public BigInteger getQ()
- {
- return this.q;
- }
-
- /**
- * Returns g for the DSA algorithm.
- *
- * @return Returns the requested BigInteger
- */
- public BigInteger getG()
- {
- return this.g;
- }
-}
diff --git a/libjava/java/security/spec/DSAPrivateKeySpec.java b/libjava/java/security/spec/DSAPrivateKeySpec.java
deleted file mode 100644
index 7415fa11a45..00000000000
--- a/libjava/java/security/spec/DSAPrivateKeySpec.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* DSAPrivateKeySpec.java --- DSA Private Key Specificaton class
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-import java.math.BigInteger;
-
-/**
- DSA Private Key class Specification. Used to maintain the DSA
- Private Keys.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
-*/
-public class DSAPrivateKeySpec implements KeySpec
-{
- private BigInteger x = null;
- private BigInteger p = null;
- private BigInteger q = null;
- private BigInteger g = null;
-
- /**
- Constructs a new DSAPrivateKeySpec with the specified x, p, q, and g.
-
- @param x the private key
- @param p the prime
- @param q the sub-prime
- @param g the base
- */
- public DSAPrivateKeySpec(BigInteger x, BigInteger p, BigInteger q, BigInteger g)
- {
- this.x = x;
- this.p = p;
- this.q = q;
- this.g = g;
- }
-
- /**
- Returns private key x for the DSA algorithm.
-
- @return Returns the requested BigInteger
- */
- public BigInteger getX()
- {
- return this.x;
- }
-
- /**
- Returns p for the DSA algorithm.
-
- @return Returns the requested BigInteger
- */
- public BigInteger getP()
- {
- return this.p;
- }
-
- /**
- Returns p for the DSA algorithm.
-
- @return Returns the requested BigInteger
- */
- public BigInteger getQ()
- {
- return this.q;
- }
-
- /**
- Returns g for the DSA algorithm.
-
- @return Returns the requested BigInteger
- */
- public BigInteger getG()
- {
- return this.g;
- }
-
-}
diff --git a/libjava/java/security/spec/DSAPublicKeySpec.java b/libjava/java/security/spec/DSAPublicKeySpec.java
deleted file mode 100644
index ac1310c1caa..00000000000
--- a/libjava/java/security/spec/DSAPublicKeySpec.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* DSAPublicKeySpec.java --- DSA Public Key Specificaton class
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-import java.math.BigInteger;
-
-/**
- DSA Public Key class Specification. Used to maintain the DSA
- Public Keys.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
-*/
-public class DSAPublicKeySpec implements KeySpec
-{
- private BigInteger y = null;
- private BigInteger p = null;
- private BigInteger q = null;
- private BigInteger g = null;
-
- /**
- Constructs a new DSAPublicKeySpec with the specified y, p, q, and g.
-
- @param y the public key
- @param p the prime
- @param q the sub-prime
- @param g the base
- */
- public DSAPublicKeySpec(BigInteger y, BigInteger p, BigInteger q, BigInteger g)
- {
- this.y = y;
- this.p = p;
- this.q = q;
- this.g = g;
- }
-
- /**
- Returns public key y for the DSA algorithm.
-
- @return Returns the requested BigInteger
- */
- public BigInteger getY()
- {
- return this.y;
- }
-
- /**
- Returns p for the DSA algorithm.
-
- @return Returns the requested BigInteger
- */
- public BigInteger getP()
- {
- return this.p;
- }
-
- /**
- Returns p for the DSA algorithm.
-
- @return Returns the requested BigInteger
- */
- public BigInteger getQ()
- {
- return this.q;
- }
-
- /**
- Returns g for the DSA algorithm.
-
- @return Returns the requested BigInteger
- */
- public BigInteger getG()
- {
- return this.g;
- }
-
-}
diff --git a/libjava/java/security/spec/EncodedKeySpec.java b/libjava/java/security/spec/EncodedKeySpec.java
deleted file mode 100644
index c5baf55fd7a..00000000000
--- a/libjava/java/security/spec/EncodedKeySpec.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* EncodedKeySpec.java --- Encoded Key Specificaton class
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-/**
- Encoded Key Specification class which is used to store
- byte encoded keys.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
-*/
-public abstract class EncodedKeySpec implements KeySpec
-{
-
- private byte[] encodedKey;
-
- /**
- Constructs a new EncodedKeySpec with the specified encoded key.
-
- @param encodedKey A key to store
- */
- public EncodedKeySpec(byte[] encodedKey)
- {
- this.encodedKey = encodedKey;
- }
-
- /**
- Gets the encoded key in byte format.
-
- @returns the encoded key
- */
- public byte[] getEncoded()
- {
- return this.encodedKey;
- }
-
- /**
- Returns the name of the key format used.
-
- This name is the format such as "PKCS#8" or "X.509" which
- if it matches a Key class name of the same type can be
- transformed using the apporiate KeyFactory.
-
- @return a string representing the name
- */
- public abstract String getFormat();
-
-}
diff --git a/libjava/java/security/spec/InvalidKeySpecException.java b/libjava/java/security/spec/InvalidKeySpecException.java
deleted file mode 100644
index c2ec6b03b5a..00000000000
--- a/libjava/java/security/spec/InvalidKeySpecException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* InvalidKeySpecException.java -- invalid KeySpec Exception
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-import java.security.GeneralSecurityException;
-
-/**
- * Exception for an invalid key specification.
- *
- * @author Mark Benvenuto
- * @see KeySpec
- * @since 1.2
- * @status updated to 1.4
- */
-public class InvalidKeySpecException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 3546139293998810778L;
-
- /**
- * Constructs an InvalidKeySpecException without a message string.
- */
- public InvalidKeySpecException()
- {
- }
-
- /**
- * Constructs an InvalidKeySpecException with a message string.
- *
- * @param msg a message to display with exception
- */
- public InvalidKeySpecException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/spec/InvalidParameterSpecException.java b/libjava/java/security/spec/InvalidParameterSpecException.java
deleted file mode 100644
index 481e11e306b..00000000000
--- a/libjava/java/security/spec/InvalidParameterSpecException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* InvalidParameterSpecException.java --- invalid ParameterSpec Exception
- Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-import java.security.GeneralSecurityException;
-
-/**
- * Exception for an invalid algorithm specification.
- *
- * @author Mark Benvenuto
- * @see AlogorithmParameters
- * @see AlogorithmParameterSpec
- * @see DSAParameterSpec
- * @since 1.2
- * @status updated to 1.4
-*/
-public class InvalidParameterSpecException extends GeneralSecurityException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = -970468769593399342L;
-
- /**
- * Constructs an InvalidParameterSpecException without a message string.
- */
- public InvalidParameterSpecException()
- {
- }
-
- /**
- * Constructs an InvalidParameterSpecException with a message string.
- *
- * @param msg a message to display with exception
- */
- public InvalidParameterSpecException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/security/spec/KeySpec.java b/libjava/java/security/spec/KeySpec.java
deleted file mode 100644
index 93f1a6db277..00000000000
--- a/libjava/java/security/spec/KeySpec.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* KeySpec.java --- Key Specification interface
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-/**
- A transparent interface for Key Specifications.
- It contains no member functions. It is used to group
- key classes.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
-*/
-public interface KeySpec
-{
-}
diff --git a/libjava/java/security/spec/PKCS8EncodedKeySpec.java b/libjava/java/security/spec/PKCS8EncodedKeySpec.java
deleted file mode 100644
index 4a4f1eccea7..00000000000
--- a/libjava/java/security/spec/PKCS8EncodedKeySpec.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* PKCS8EncodedKeySpec.java --- PKCS8 Encoded Key Specificaton class
- Copyright (C) 1999, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-/**
- PKCS8 Encoded Key Specification class which is used to store
- "PKCS#8" byte encoded keys.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
-*/
-public class PKCS8EncodedKeySpec extends EncodedKeySpec
-{
- /**
- Constructs a new PKCS8EncodedKeySpec with the specified encoded key.
-
- @param encodedKey A key to store, assumed to be "PKCS#8"
- */
- public PKCS8EncodedKeySpec(byte[] encodedKey)
- {
- super( encodedKey );
- }
-
- /**
- Gets the encoded key in byte format.
-
- @returns the encoded key
-*/
- public byte[] getEncoded()
- {
- return super.getEncoded();
- }
-
- /**
- Returns the name of the key format used which is "PKCS#8"
-
- @return a string representing the name
-*/
- public final String getFormat()
- {
- return "PKCS#8";
- }
-
-}
diff --git a/libjava/java/security/spec/PSSParameterSpec.java b/libjava/java/security/spec/PSSParameterSpec.java
deleted file mode 100644
index 7a14a24fbe4..00000000000
--- a/libjava/java/security/spec/PSSParameterSpec.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* PSSParameterSpec.java --
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-/**
- * This class specifies a parameter spec for RSA PSS encoding scheme, as
- * defined in the PKCS#1 v2.1.
- *
- * @since 1.4
- * @see AlgorithmParameterSpec
- * @see java.security.Signature
- */
-public class PSSParameterSpec implements AlgorithmParameterSpec
-{
- // Constants and fields
- // --------------------------------------------------------------------------
-
- private int saltLen;
-
- // Constructor(s)
- // --------------------------------------------------------------------------
-
- /**
- * Creates a new <code>PSSParameterSpec</code> given the salt length as
- * defined in PKCS#1.
- *
- * @param saltLen the length of salt in bits to be used in PKCS#1 PSS encoding.
- * @throws IllegalArgumentException if <code>saltLen</code> is less than
- * <code>0</code>.
- */
- public PSSParameterSpec(int saltLen)
- {
- super();
-
- if (saltLen < 0)
- throw new IllegalArgumentException();
- this.saltLen = saltLen;
- }
-
- // Class methods
- // --------------------------------------------------------------------------
-
- // Instance methods
- // --------------------------------------------------------------------------
-
- /**
- * Returns the salt length in bits.
- *
- * @return the salt length.
- */
- public int getSaltLength()
- {
- return this.saltLen;
- }
-}
diff --git a/libjava/java/security/spec/RSAKeyGenParameterSpec.java b/libjava/java/security/spec/RSAKeyGenParameterSpec.java
deleted file mode 100644
index 0df8dec783e..00000000000
--- a/libjava/java/security/spec/RSAKeyGenParameterSpec.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* RSAKeyGenParameterSpec.java --- RSA Key Generator Parameter Spec Class
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-import java.math.BigInteger;
-
-/**
- This class generates a set of RSA Key parameters used in the generation
- of RSA keys.
-
- @since JDK 1.3
-
- @author Mark Benvenuto
-*/
-public class RSAKeyGenParameterSpec implements AlgorithmParameterSpec
-{
- private int keysize;
- private BigInteger publicExponent;
-
- /**
- Public Exponent F0 = 3
- */
- public static final BigInteger F0 = new BigInteger("3");
-
- /**
- Public Exponent F4 = 3
- */
- public static final BigInteger F4 = new BigInteger("65537");
-
- /**
- Create a new RSAKeyGenParameterSpec to store the RSA key's keysize
- and public exponent
-
- @param keysize Modulus size of key in bits
- @param publicExponent - the exponent
- */
- public RSAKeyGenParameterSpec(int keysize, BigInteger publicExponent)
- {
- this.keysize = keysize;
- this.publicExponent = publicExponent;
- }
-
- /**
- Return the size of the key.
-
- @return the size of the key.
- */
- public int getKeysize()
- {
- return keysize;
- }
-
- /**
- Return the public exponent.
-
- @return the public exponent.
- */
- public BigInteger getPublicExponent()
- {
- return publicExponent;
- }
-}
diff --git a/libjava/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java b/libjava/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java
deleted file mode 100644
index 519a0291373..00000000000
--- a/libjava/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/* PSSParameterSpec.java --
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-import java.math.BigInteger;
-
-/**
- * This class specifies an RSA multi-prime private key, as defined in the
- * PKCS#1 v2.1, using the <i>Chinese Remainder Theorem</i> (CRT) information
- * values for efficiency.
- *
- * @since 1.4
- * @see java.security.Key
- * @see java.security.KeyFactory
- * @see KeySpec
- * @see PKCS8EncodedKeySpec
- * @see RSAPrivateKeySpec
- * @see RSAPublicKeySpec
- * @see RSAOtherPrimeInfo
- */
-public class RSAMultiPrimePrivateCrtKeySpec extends RSAPrivateKeySpec
-{
- // Constants and fields
- // --------------------------------------------------------------------------
-
- private BigInteger publicExponent;
- private BigInteger primeP;
- private BigInteger primeQ;
- private BigInteger primeExponentP;
- private BigInteger primeExponentQ;
- private BigInteger crtCoefficient;
- private RSAOtherPrimeInfo[] otherPrimeInfo;
-
- // Constructor(s)
- // --------------------------------------------------------------------------
-
- /**
- * <p>Creates a new <code>RSAMultiPrimePrivateCrtKeySpec</code> given the
- * modulus, publicExponent, privateExponent, primeP, primeQ, primeExponentP,
- * primeExponentQ, crtCoefficient, and otherPrimeInfo as defined in PKCS#1
- * v2.1.</p>
- *
- * <p>Note that <code>otherPrimeInfo</code> is cloned when constructing this
- * object.</p>
- *
- * @param modulus the modulus n.
- * @param publicExponent the public exponent e.
- * @param privateExponent the private exponent d.
- * @param primeP the prime factor p of n.
- * @param primeQ the prime factor q of n.
- * @param primeExponentP this is d mod (p-1).
- * @param primeExponentQ this is d mod (q-1).
- * @param crtCoefficient the Chinese Remainder Theorem coefficient q-1 mod p.
- * @param otherPrimeInfo triplets of the rest of primes, <code>null</code>
- * can be specified if there are only two prime factors (p and q).
- * @throws NullPointerException if any of the parameters, i.e. modulus,
- * publicExponent, privateExponent, primeP, primeQ, primeExponentP,
- * primeExponentQ, crtCoefficient, is <code>null</code>.
- * @throws IllegalArgumentException if an empty, i.e. 0-length,
- * otherPrimeInfo is specified.
- */
- public RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus,
- BigInteger publicExponent,
- BigInteger privateExponent,
- BigInteger primeP,
- BigInteger primeQ,
- BigInteger primeExponentP,
- BigInteger primeExponentQ,
- BigInteger crtCoefficient,
- RSAOtherPrimeInfo[] otherPrimeInfo)
- {
- super(modulus, privateExponent);
-
- if (modulus == null)
- throw new NullPointerException("modulus");
- if (publicExponent == null)
- throw new NullPointerException("publicExponent");
- if (privateExponent == null)
- throw new NullPointerException("privateExponent");
- if (primeP == null)
- throw new NullPointerException("primeP");
- if (primeQ == null)
- throw new NullPointerException("primeQ");
- if (primeExponentP == null)
- throw new NullPointerException("primeExponentP");
- if (primeExponentQ == null)
- throw new NullPointerException("primeExponentQ");
- if (crtCoefficient == null)
- throw new NullPointerException("crtCoefficient");
- if (otherPrimeInfo != null)
- if (otherPrimeInfo.length == 0)
- throw new IllegalArgumentException();
- else
- this.otherPrimeInfo = (RSAOtherPrimeInfo[]) otherPrimeInfo.clone();
-
- this.publicExponent = publicExponent;
- this.primeP = primeP;
- this.primeQ = primeQ;
- this.primeExponentP = primeExponentP;
- this.primeExponentQ = primeExponentQ;
- this.crtCoefficient = crtCoefficient;
- }
-
- // Class methods
- // --------------------------------------------------------------------------
-
- // Instance methods
- // --------------------------------------------------------------------------
-
- /**
- * Returns the public exponent.
- *
- * @return the public exponent.
- */
- public BigInteger getPublicExponent()
- {
- return this.publicExponent;
- }
-
- /**
- * Returns the primeP.
- *
- * @return the primeP.
- */
- public BigInteger getPrimeP()
- {
- return this.primeP;
- }
-
- /**
- * Returns the primeQ.
- *
- * @return the primeQ.
- */
- public BigInteger getPrimeQ()
- {
- return this.primeQ;
- }
-
- /**
- * Returns the primeExponentP.
- *
- * @return the primeExponentP.
- */
- public BigInteger getPrimeExponentP()
- {
- return this.primeExponentP;
- }
-
- /**
- * Returns the primeExponentQ.
- *
- * @return the primeExponentQ.
- */
- public BigInteger getPrimeExponentQ()
- {
- return this.primeExponentQ;
- }
-
- /**
- * Returns the crtCoefficient.
- *
- * @return the crtCoefficient.
- */
- public BigInteger getCrtCoefficient()
- {
- return this.crtCoefficient;
- }
-
- /**
- * Returns a copy of the otherPrimeInfo or <code>null</code> if there are
- * only two prime factors (p and q).
- *
- * @return the otherPrimeInfo.
- */
- public RSAOtherPrimeInfo[] getOtherPrimeInfo()
- {
- return this.otherPrimeInfo == null
- ? null
- : (RSAOtherPrimeInfo[]) this.otherPrimeInfo.clone();
- }
-}
diff --git a/libjava/java/security/spec/RSAOtherPrimeInfo.java b/libjava/java/security/spec/RSAOtherPrimeInfo.java
deleted file mode 100644
index 654bcb574d8..00000000000
--- a/libjava/java/security/spec/RSAOtherPrimeInfo.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* RSAOtherPrimeInfo.java --
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-import java.math.BigInteger;
-
-/**
- * This class represents the triplet (prime, exponent, and coefficient) inside
- * RSA's OtherPrimeInfo structure, as defined in the PKCS#1 v2.1. The ASN.1
- * syntax of RSA's OtherPrimeInfo is as follows:
- *
- * <pre>
- * OtherPrimeInfo ::= SEQUENCE {
- * prime INTEGER,
- * exponent INTEGER,
- * coefficient INTEGER
- * }
- * </pre>
- *
- * @since 1.4
- * @see RSAPrivateCrtKeySpec
- * @see java.security.interfaces.RSAMultiPrimePrivateCrtKey
- */
-public class RSAOtherPrimeInfo
-{
- // Constants and fields
- // --------------------------------------------------------------------------
-
- private BigInteger prime;
- private BigInteger primeExponent;
- private BigInteger crtCoefficient;
-
- // Constructor(s)
- // --------------------------------------------------------------------------
-
- /**
- * Creates a new <code>RSAOtherPrimeInfo</code> given the prime,
- * primeExponent, and crtCoefficient as defined in PKCS#1.
- *
- * @param prime the prime factor of n.
- * @param primeExponent the exponent.
- * @param crtCoefficient the Chinese Remainder Theorem coefficient.
- * @throws NullPointerException if any of the parameters, i.e. prime,
- * primeExponent, crtCoefficient, is <code>null</code>.
- */
- public RSAOtherPrimeInfo(BigInteger prime, BigInteger primeExponent,
- BigInteger crtCoefficient)
- {
- super();
-
- if (prime == null)
- throw new NullPointerException("prime");
- if (primeExponent == null)
- throw new NullPointerException("primeExponent");
- if (crtCoefficient == null)
- throw new NullPointerException("crtCoefficient");
-
- this.prime = prime;
- this.primeExponent = primeExponent;
- this.crtCoefficient = crtCoefficient;
- }
-
- // Class methods
- // --------------------------------------------------------------------------
-
- // Instance methods
- // --------------------------------------------------------------------------
-
- /**
- * Returns the prime.
- *
- * @return the prime.
- */
- public final BigInteger getPrime()
- {
- return this.prime;
- }
-
- /**
- * Returns the prime's exponent.
- *
- * @return the primeExponent.
- */
- public final BigInteger getExponent()
- {
- return this.primeExponent;
- }
-
- /**
- * Returns the prime's crtCoefficient.
- *
- * @return the crtCoefficient.
- */
- public final BigInteger getCrtCoefficient()
- {
- return this.crtCoefficient;
- }
-}
diff --git a/libjava/java/security/spec/RSAPrivateCrtKeySpec.java b/libjava/java/security/spec/RSAPrivateCrtKeySpec.java
deleted file mode 100644
index a904c305d65..00000000000
--- a/libjava/java/security/spec/RSAPrivateCrtKeySpec.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/* RSAPrivateCrtKeySpec.java --- RSA Private Certificate Key Specificaton class
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-import java.math.BigInteger;
-
-/**
- RSA Private Certificate Key class Specification. Used to
- maintain the RSA Private Certificate Keys with the
- <I>Chinese Remainder Theorem</I>(CRT) as specified by PKCS#1.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
-*/
-public class RSAPrivateCrtKeySpec extends RSAPrivateKeySpec
-{
- private BigInteger publicExponent;
- private BigInteger primeP;
- private BigInteger primeQ;
- private BigInteger primeExponentP;
- private BigInteger primeExponentQ;
- private BigInteger crtCoefficient;
-
- /**
- Constructs a new RSAPrivateKeySpec with the specified
- variables.
-
- @param modulus the RSA modulus
- @param publicExponent the public key exponent
- @param privateExponent the private key exponent
- @param primeP the prime P
- @param primeQ the prime Q
- @param primeExponentP the prime exponent P
- @param primeExponentQ the prime exponent P
- @param crtCoefficient the CRT coefficient
- */
- public RSAPrivateCrtKeySpec(BigInteger modulus,
- BigInteger publicExponent,
- BigInteger privateExponent,
- BigInteger primeP,
- BigInteger primeQ,
- BigInteger primeExponentP,
- BigInteger primeExponentQ,
- BigInteger crtCoefficient)
- {
- super( modulus, privateExponent);
- this.publicExponent = publicExponent;
- this.primeP = primeP;
- this.primeQ = primeQ;
- this.primeExponentP = primeExponentP;
- this.primeExponentQ = primeExponentQ;
- this.crtCoefficient = crtCoefficient;
- }
-
- /**
- Gets the RSA public exponent.
-
- @return the RSA public exponent
- */
- public BigInteger getPublicExponent()
- {
- return this.publicExponent;
- }
-
- /**
- Gets the RSA prime P.
-
- @return the RSA prime P
- */
- public BigInteger getPrimeP()
- {
- return this.primeP;
- }
-
- /**
- Gets the RSA prime Q.
-
- @return the RSA prime Q
- */
- public BigInteger getPrimeQ()
- {
- return this.primeQ;
- }
-
- /**
- Gets the RSA prime exponent P.
-
- @return the RSA prime exponent P
- */
- public BigInteger getPrimeExponentP()
- {
- return this.primeExponentP;
- }
-
- /**
- Gets the RSA prime exponent P.
-
- @return the RSA prime exponent Q
- */
- public BigInteger getPrimeExponentQ()
- {
- return this.primeExponentQ;
- }
-
- /**
- Gets the RSA CRT coefficient.
-
- @return the RSA CRT coefficient
- */
- public BigInteger getCrtCoefficient()
- {
- return this.crtCoefficient;
- }
-
-}
diff --git a/libjava/java/security/spec/RSAPrivateKeySpec.java b/libjava/java/security/spec/RSAPrivateKeySpec.java
deleted file mode 100644
index d29f261cfb3..00000000000
--- a/libjava/java/security/spec/RSAPrivateKeySpec.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* RSAPrivateKeySpec.java --- RSA Private Key Specificaton class
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-import java.math.BigInteger;
-
-/**
- RSA Private Key class Specification. Used to maintain the RSA
- Private Keys.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
-*/
-public class RSAPrivateKeySpec implements KeySpec
-{
- private BigInteger modulus;
- private BigInteger privateExponent;
-
- /**
- Constructs a new RSAPrivateKeySpec with the specified
- modulus and privateExponent.
-
- @param modulus the RSA modulus
- @param privateExponent the private key exponent
- */
- public RSAPrivateKeySpec(BigInteger modulus, BigInteger privateExponent)
- {
- this.modulus = modulus;
- this.privateExponent = privateExponent;
- }
-
- /**
- Gets the RSA modulus.
-
- @return the RSA modulus
- */
- public BigInteger getModulus()
- {
- return this.modulus;
- }
-
- /**
- Gets the RSA private exponent.
-
- @return the RSA private exponent
- */
- public BigInteger getPrivateExponent()
- {
- return this.privateExponent;
- }
-
-}
diff --git a/libjava/java/security/spec/RSAPublicKeySpec.java b/libjava/java/security/spec/RSAPublicKeySpec.java
deleted file mode 100644
index 21283aa643b..00000000000
--- a/libjava/java/security/spec/RSAPublicKeySpec.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* RSAPublicKeySpec.java --- RSA Public Key Specificaton class
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-import java.math.BigInteger;
-
-/**
- RSA Public Key class Specification. Used to maintain the RSA
- Public Keys.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
-*/
-public class RSAPublicKeySpec implements KeySpec
-{
- private BigInteger modulus;
- private BigInteger publicExponent;
-
- /**
- Constructs a new RSAPublicKeySpec with the specified
- modulus and publicExponent.
-
- @param modulus the RSA modulus
- @param publicExponent the public key exponent
- */
- public RSAPublicKeySpec(BigInteger modulus, BigInteger publicExponent)
- {
- this.modulus = modulus;
- this.publicExponent = publicExponent;
- }
-
- /**
- Gets the RSA modulus.
-
- @return the RSA modulus
- */
- public BigInteger getModulus()
- {
- return this.modulus;
- }
-
- /**
- Gets the RSA public exponent.
-
- @return the RSA public exponent
- */
- public BigInteger getPublicExponent()
- {
- return this.publicExponent;
- }
-
-}
diff --git a/libjava/java/security/spec/X509EncodedKeySpec.java b/libjava/java/security/spec/X509EncodedKeySpec.java
deleted file mode 100644
index de35960296d..00000000000
--- a/libjava/java/security/spec/X509EncodedKeySpec.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* X509EncodedKeySpec.java --- X.509 Encoded Key Specificaton class
- Copyright (C) 1999, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.security.spec;
-
-/**
- X.509 Encoded Key Specification class which is used to store
- "X.509" byte encoded keys.
-
- @since JDK 1.2
-
- @author Mark Benvenuto
-*/
-public class X509EncodedKeySpec extends EncodedKeySpec
-{
-
- /**
- Constructs a new X509EncodedKeySpec with the specified encoded key.
-
- @param encodedKey A key to store, assumed to be "X.509"
- */
- public X509EncodedKeySpec(byte[] encodedKey)
- {
- super( encodedKey );
- }
-
- /**
- Gets the encoded key in byte format.
-
- @returns the encoded key
- */
- public byte[] getEncoded()
- {
- return super.getEncoded();
- }
-
- /**
- Returns the name of the key format used which is "X.509"
-
- @return a string representing the name
- */
- public final String getFormat()
- {
- return "X.509";
- }
-
-}
diff --git a/libjava/java/sql/Array.java b/libjava/java/sql/Array.java
deleted file mode 100644
index 51628757885..00000000000
--- a/libjava/java/sql/Array.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/* Array.java -- Interface for accessing SQL array object
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.util.Map;
-
-/**
- * This interface provides methods for accessing SQL array types.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Array
-{
- /**
- * Returns the name of the SQL type of the elements in this
- * array. This name is database specific.
- *
- * @param The name of the SQL type of the elements in this array.
- * @exception SQLException If an error occurs.
- */
- String getBaseTypeName() throws SQLException;
-
- /**
- * Returns the JDBC type identifier of the elements in this
- * array. This will be one of the values defined in the
- * <code>Types</code> class.
- *
- * @return The JDBC type of the elements in this array.
- * @exception SQLException If an error occurs.
- * @see Types
- */
- int getBaseType() throws SQLException;
-
- /**
- * Returns the contents of this array. This object returned
- * will be an array of Java objects of the appropriate types.
- *
- * @return The contents of the array as an array of Java objects.
- * @exception SQLException If an error occurs.
- */
- Object getArray() throws SQLException;
-
- /**
- * Returns the contents of this array. The specified
- * <code>Map</code> will be used to override selected mappings
- * between SQL types and Java classes.
- *
- * @param map A mapping of SQL types to Java classes.
- * @return The contents of the array as an array of Java objects.
- * @exception SQLException If an error occurs.
- */
- Object getArray(Map map) throws SQLException;
-
- /**
- * Returns a portion of this array starting at <code>index</code>
- * into the array and continuing for <code>count</code>
- * elements. Fewer than the requested number of elements will be
- * returned if the array does not contain the requested number of elements.
- * The object returned will be an array of Java objects of
- * the appropriate types.
- *
- * @param offset The offset into this array to start returning elements from.
- * @param count The requested number of elements to return.
- * @return The requested portion of the array.
- * @exception SQLException If an error occurs.
- */
- Object getArray(long index, int count) throws SQLException;
-
- /**
- * This method returns a portion of this array starting at <code>index</code>
- * into the array and continuing for <code>count</code>
- * elements. Fewer than the requested number of elements will be
- * returned if the array does not contain the requested number of elements.
- * The object returned will be an array of Java objects. The specified
- * <code>Map</code> will be used for overriding selected SQL type to
- * Java class mappings.
- *
- * @param offset The offset into this array to start returning elements from.
- * @param count The requested number of elements to return.
- * @param map A mapping of SQL types to Java classes.
- * @return The requested portion of the array.
- * @exception SQLException If an error occurs.
- */
- Object getArray(long index, int count, Map map) throws SQLException;
-
- /**
- * Returns the elements in the array as a <code>ResultSet</code>.
- * Each row of the result set will have two columns. The first will be
- * the index into the array of that row's contents. The second will be
- * the actual value of that array element.
- *
- * @return The elements of this array as a <code>ResultSet</code>.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- ResultSet getResultSet() throws SQLException;
-
- /**
- * This method returns the elements in the array as a <code>ResultSet</code>.
- * Each row of the result set will have two columns. The first will be
- * the index into the array of that row's contents. The second will be
- * the actual value of that array element. The specified <code>Map</code>
- * will be used to override selected default mappings of SQL types to
- * Java classes.
- *
- * @param map A mapping of SQL types to Java classes.
- * @return The elements of this array as a <code>ResultSet</code>.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- ResultSet getResultSet(Map map) throws SQLException;
-
- /**
- * This method returns a portion of the array as a <code>ResultSet</code>.
- * The returned portion will start at <code>index</code> into the
- * array and up to <code>count</code> elements will be returned.
- * <p>
- * Each row of the result set will have two columns. The first will be
- * the index into the array of that row's contents. The second will be
- * the actual value of that array element.
- *
- * @param offset The index into the array to start returning elements from.
- * @param length The requested number of elements to return.
- * @return The requested elements of this array as a <code>ResultSet</code>.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- ResultSet getResultSet(long index, int count) throws SQLException;
-
- /**
- * This method returns a portion of the array as a <code>ResultSet</code>.
- * The returned portion will start at <code>index</code> into the
- * array and up to <code>count</code> elements will be returned.
- *
- * <p> Each row of the result set will have two columns. The first will be
- * the index into the array of that row's contents. The second will be
- * the actual value of that array element. The specified <code>Map</code>
- * will be used to override selected default mappings of SQL types to
- * Java classes.</p>
- *
- * @param offset The index into the array to start returning elements from.
- * @param length The requested number of elements to return.
- * @param map A mapping of SQL types to Java classes.
- * @return The requested elements of this array as a <code>ResultSet</code>.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- ResultSet getResultSet(long index, int count, Map map)
- throws SQLException;
-}
diff --git a/libjava/java/sql/BatchUpdateException.java b/libjava/java/sql/BatchUpdateException.java
deleted file mode 100644
index c2e186548db..00000000000
--- a/libjava/java/sql/BatchUpdateException.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/* BatchUpdateException.java -- Exception for batch oriented SQL errors
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * This class extends <code>SQLException</code> to count the successful
- * updates in each statement in a batch that was successfully updated prior
- * to the error.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class BatchUpdateException extends SQLException
-{
- static final long serialVersionUID = 5977529877145521757L;
-
- /**
- * This is the array of update counts for the commands which completed
- * successfully prior to the error.
- */
- private int[] updateCounts;
-
- /**
- * This method initializes a new instance of <code>BatchUpdateException</code>
- * with the specified descriptive error message, SQL state, and update count
- * information. The vendor specific error code will be initialized to 0.
- *
- * @param message The descriptive error message.
- * @param SQLState The SQL state information for this error.
- * @param vendorCode
- * @param updateCounts The update count information for this error.
- */
- public BatchUpdateException(String message, String SQLState, int vendorCode,
- int[] updateCounts)
- {
- super(message, SQLState, vendorCode);
- this.updateCounts = updateCounts;
- }
-
- /**
- * This method initializes a new instance of <code>BatchUpdateException</code>
- * with the specified descriptive error message, SQL state, and update count
- * information. The vendor specific error code will be initialized to 0.
- *
- * @param message The descriptive error message.
- * @param SQLState The SQL state information for this error.
- * @param updateCounts The update count information for this error.
- */
- public BatchUpdateException(String message, String SQLState,
- int[] updateCounts)
- {
- super(message, SQLState);
- this.updateCounts = updateCounts;
- }
-
- /**
- * This method initializes a new instance of <code>BatchUpdateException</code>
- * with the specified descriptive error message and update count information.
- * The SQL state will be initialized to <code>null</code> and the vendor
- * specific error code will be initialized to 0.
- *
- * @param message The descriptive error message.
- * @param updateCounts The update count information for this error.
- */
- public BatchUpdateException(String message, int[] updateCounts)
- {
- super(message);
- this.updateCounts = updateCounts;
- }
-
- /**
- * Initializes a new instance of <code>BatchUpdateException</code>
- * with the specified update count information and no descriptive error
- * message. This SQL state will be initialized to <code>null</code> and
- * the vendor specific error code will be initialized to 0.
- *
- * @param updateCounts The update count array.
- */
- public BatchUpdateException(int[] updateCounts)
- {
- this.updateCounts = updateCounts;
- }
-
- /**
- * Initializes a new instance of <code>BatchUpdateException</code>
- * with no descriptive error message. The SQL state and update count will
- * be initialized to <code>null</code> and the vendor specific error code will
- * initialized to 0.
- */
- public BatchUpdateException()
- {
- super();
- }
-
- /**
- * This method returns the update count information for this error. If
- * not <code>null</code> this is an array of <code>int</code>'s that are
- * the update accounts for each command that was successfully executed.
- * The array elements are in the order that the commands were executed.
- *
- * @return The update count information, which may be <code>null</code>.
- */
- public int[] getUpdateCounts()
- {
- return updateCounts;
- }
-}
diff --git a/libjava/java/sql/Blob.java b/libjava/java/sql/Blob.java
deleted file mode 100644
index 616839d01be..00000000000
--- a/libjava/java/sql/Blob.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Blob.java -- Access a SQL Binary Large OBject.
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * This interface specified methods for accessing a SQL BLOB (Binary
- * Large OBject) type.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.2
- */
-public interface Blob
-{
- /**
- * This method returns the number of bytes in the BLOB.
- *
- * @return The number of bytes in the BLOB.
- * @exception SQLException If an error occurs.
- */
- long length() throws SQLException;
-
- /**
- * This method returns up to the requested bytes of this BLOB as a
- * <code>byte</code> array.
- *
- * @param pos The index into the BLOB to start returning bytes from.
- * @param length The requested number of bytes to return.
- * @return The requested bytes from the BLOB.
- * @exception SQLException If an error occurs.
- */
- byte[] getBytes(long pos, int length) throws SQLException;
-
- /**
- * This method returns a stream that will read the bytes of the BLOB.
- *
- * @return A stream that will read the bytes of the BLOB.
- * @exception SQLException If an error occurs.
- */
- InputStream getBinaryStream() throws SQLException;
-
- /**
- * This method returns the index into the BLOB at which the first instance
- * of the specified bytes occur. The searching starts at the specified
- * index into the BLOB.
- *
- * @param pattern The byte pattern to search for.
- * @param offset The index into the BLOB to starting searching for the pattern.
- * @return The offset at which the pattern is first found, or -1 if the
- * pattern is not found.
- * @exception SQLException If an error occurs.
- */
- long position(byte[] pattern, long start) throws SQLException;
-
- /**
- * This method returns the index into the BLOB at which the first instance
- * of the specified pattern occurs. The searching starts at the specified
- * index into this BLOB. The bytes in the specified <code>Blob</code> are
- * used as the search pattern.
- *
- * @param pattern The <code>Blob</code> containing the byte pattern to
- * search for.
- * @param offset The index into the BLOB to starting searching for the pattern.
- * @return The offset at which the pattern is first found, or -1 if the
- * pattern is not found.
- * @exception SQLException If an error occurs.
- */
- long position(Blob pattern, long start) throws SQLException;
-
- /**
- * @exception SQLException If an error occurs.
- * @since 1.4
- */
- int setBytes(long pos, byte[] bytes) throws SQLException;
-
- /**
- * @exception SQLException If an error occurs.
- * @since 1.4
- */
- int setBytes(long pos, byte[] bytes, int offset, int len)
- throws SQLException;
-
- /**
- * @exception SQLException If an error occurs.
- * @since 1.4
- */
- OutputStream setBinaryStream(long pos) throws SQLException;
-
- /**
- * @exception SQLException If an error occurs.
- * @since 1.4
- */
- void truncate(long len) throws SQLException;
-}
diff --git a/libjava/java/sql/CallableStatement.java b/libjava/java/sql/CallableStatement.java
deleted file mode 100644
index 452294144a0..00000000000
--- a/libjava/java/sql/CallableStatement.java
+++ /dev/null
@@ -1,651 +0,0 @@
-/* CallableStatement.java -- A statement for calling stored procedures.
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.math.BigDecimal;
-import java.net.URL;
-import java.util.Calendar;
-import java.util.Map;
-
-/**
- * This interface provides a mechanism for calling stored procedures.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface CallableStatement extends PreparedStatement
-{
- /**
- * This method registers the specified parameter as an output parameter
- * of the specified SQL type.
- *
- * @param index The index of the parameter to register as output.
- * @param type The SQL type value from <code>Types</code>.
- * @exception SQLException If an error occurs.
- */
- void registerOutParameter(int parameterIndex, int sqlType)
- throws SQLException;
-
- /**
- * This method registers the specified parameter as an output parameter
- * of the specified SQL type and scale.
- *
- * @param index The index of the parameter to register as output.
- * @param type The SQL type value from <code>Types</code>.
- * @param scale The scale of the value that will be returned.
- * @exception SQLException If an error occurs.
- */
- void registerOutParameter(int parameterIndex, int sqlType, int scale)
- throws SQLException;
-
- /**
- * This method tests whether the value of the last parameter that was fetched
- * was actually a SQL NULL value.
- *
- * @return <code>true</code> if the last parameter fetched was a NULL,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean wasNull() throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>String</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>String</code>.
- * @exception SQLException If an error occurs.
- */
- String getString(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>boolean</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>boolean</code>.
- * @exception SQLException If an error occurs.
- */
- boolean getBoolean(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>byte</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>byte</code>.
- * @exception SQLException If an error occurs.
- */
- byte getByte(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>short</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>short</code>.
- * @exception SQLException If an error occurs.
- */
- short getShort(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>int</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>int</code>.
- * @exception SQLException If an error occurs.
- */
- int getInt(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>long</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>long</code>.
- * @exception SQLException If an error occurs.
- */
- long getLong(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>float</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>float</code>.
- * @exception SQLException If an error occurs.
- */
- float getFloat(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>double</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>double</code>.
- * @exception SQLException If an error occurs.
- */
- double getDouble(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>BigDecimal</code>.
- *
- * @param parameterIndex The index of the parameter to return.
- * @param scale The number of digits to the right of the decimal to return.
- * @return The parameter value as a <code>BigDecimal</code>.
- * @exception SQLException If an error occurs.
- * @deprecated Use getBigDecimal(int parameterIndex)
- * or getBigDecimal(String parameterName) instead.
- */
- BigDecimal getBigDecimal(int parameterIndex, int scale)
- throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * byte array.
- *
- * @param parameterIndex The index of the parameter to return.
- * @return The parameter value as a byte array
- * @exception SQLException If an error occurs.
- */
- byte[] getBytes(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>java.sql.Date</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>java.sql.Date</code>.
- * @exception SQLException If an error occurs.
- */
- Date getDate(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>java.sql.Time</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>java.sql.Time</code>.
- * @exception SQLException If an error occurs.
- */
- Time getTime(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>java.sql.Timestamp</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>java.sql.Timestamp</code>.
- * @exception SQLException If an error occurs.
- */
- Timestamp getTimestamp(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>Object</code>.
- *
- * @param parameterIndex The index of the parameter to return.
- * @return The parameter value as an <code>Object</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- Object getObject(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>BigDecimal</code>.
- *
- * @param parameterIndex The index of the parameter to return.
- * @return The parameter value as a <code>BigDecimal</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- BigDecimal getBigDecimal(int parameterIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>Object</code>.
- *
- * @param index The index of the parameter to return.
- * @param map The mapping to use for conversion from SQL to Java types.
- * @return The parameter value as an <code>Object</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- Object getObject(int index, Map map) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>Ref</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>Ref</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- Ref getRef(int index) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>Blob</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>Blob</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- Blob getBlob(int index) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>Clob</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>Clob</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- Clob getClob(int index) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>Array</code>.
- *
- * @param parameterIndex The index of the parameter to return.
- * @return The parameter value as a <code>Array</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- Array getArray(int index) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>java.sql.Date</code>.
- *
- * @param parameterIndex The index of the parameter to return.
- * @param cal The <code>Calendar</code> to use for timezone and locale.
- * @return The parameter value as a <code>java.sql.Date</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- Date getDate(int parameterIndex, Calendar cal) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>java.sql.Time</code>.
- *
- * @param parameterIndex The index of the parameter to return.
- * @param cal The <code>Calendar</code> to use for timezone and locale.
- * @return The parameter value as a <code>java.sql.Time</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- Time getTime(int parameterIndex, Calendar cal) throws SQLException;
-
- /**
- * This method returns the value of the specified parameter as a Java
- * <code>java.sql.Timestamp</code>.
- *
- * @param index The index of the parameter to return.
- * @return The parameter value as a <code>java.sql.Timestamp</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- Timestamp getTimestamp(int parameterIndex, Calendar cal)
- throws SQLException;
-
- /**
- * This method registers the specified parameter as an output parameter
- * of the specified SQL type.
- *
- * @param index The index of the parameter to register as output.
- * @param type The SQL type value from <code>Types</code>.
- * @param name The user defined data type name.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- void registerOutParameter(int paramIndex, int sqlType,
- String typeName)
- throws SQLException;
-
- /**
- * This method registers the specified parameter as an output parameter
- * of the specified SQL type.
- *
- * @param parameterName The name of the parameter to register as output.
- * @param sqlType The SQL type value from <code>Types</code>.
- * @exception SQLException If an error occurs.
- * @since 1.4
- */
- void registerOutParameter(String parameterName, int sqlType)
- throws SQLException;
-
- /**
- * This method registers the specified parameter as an output parameter
- * of the specified SQL type. This version of registerOutParameter is used
- * for NUMERIC or DECIMAL types.
- *
- * @param parameterName The name of the parameter to register as output.
- * @param sqlType The SQL type value from <code>Types</code>.
- * @param scale Number of digits to the right of the decimal point.
- * @exception SQLException If an error occurs.
- * @since 1.4
- */
- void registerOutParameter(String parameterName, int sqlType,
- int scale)
- throws SQLException;
-
-
- /**
- * This method registers the specified parameter as an output parameter
- * of the specified SQL type. This version of registerOutParameter is used
- * for user-named or REF types. If the type of the output parameter does
- * not have such a type, the typeName argument is ignored.
- *
- * @param parameterName The name of the parameter to register as output.
- * @param sqlType The SQL type value from <code>Types</code>.
- * @param typeName The SQL structured type name.
- * @exception SQLException If an error occurs.
- * @since 1.4
- */
- void registerOutParameter(String parameterName, int sqlType,
- String typeName)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- URL getURL(int parameterIndex) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setURL(String parameterName, URL val) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setNull(String parameterName, int sqlType) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setBoolean(String parameterName, boolean x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setByte(String parameterName, byte x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setShort(String parameterName, short x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setInt(String parameterName, int x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setLong(String parameterName, long x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setFloat(String parameterName, float x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setDouble(String parameterName, double x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setBigDecimal(String parameterName, BigDecimal x)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setString(String parameterName, String x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setBytes(String parameterName, byte[] x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setDate(String parameterName, Date x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setTime(String parameterName, Time x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setTimestamp(String parameterName, Timestamp x)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setAsciiStream(String parameterName, InputStream x, int length)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setBinaryStream(String parameterName, InputStream x, int length)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setObject(String parameterName, Object x, int targetSqlType,
- int scale)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setObject(String parameterName, Object x, int targetSqlType)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setObject(String parameterName, Object x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setCharacterStream(String parameterName, Reader reader,
- int length)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setDate(String parameterName, Date x, Calendar cal)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setTime(String parameterName, Time x, Calendar cal)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setTimestamp(String parameterName, Timestamp x, Calendar cal)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setNull(String parameterName, int sqlType, String typeName)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- String getString(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean getBoolean(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- byte getByte(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- short getShort(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- int getInt(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- long getLong(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- float getFloat(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- double getDouble(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- byte[] getBytes(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- Date getDate(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- Time getTime(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- Timestamp getTimestamp(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- Object getObject(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- BigDecimal getBigDecimal(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- Object getObject(String parameterName, Map map) throws SQLException;
-
- /**
- * @since 1.4
- */
- Ref getRef(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- Blob getBlob(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- Clob getClob(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- Array getArray(String parameterName) throws SQLException;
-
- /**
- * @since 1.4
- */
- Date getDate(String parameterName, Calendar cal) throws SQLException;
-
- /**
- * @since 1.4
- */
- Time getTime(String parameterName, Calendar cal) throws SQLException;
-
- /**
- * @since 1.4
- */
- Timestamp getTimestamp(String parameterName, Calendar cal)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- URL getURL(String parameterName) throws SQLException;
-}
diff --git a/libjava/java/sql/Clob.java b/libjava/java/sql/Clob.java
deleted file mode 100644
index 8789da5967a..00000000000
--- a/libjava/java/sql/Clob.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Clob.java -- Access Character Large OBjects
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Writer;
-
-/**
- * This interface contains methods for accessing a SQL CLOB (Character
- * Large OBject) type.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Clob
-{
- /**
- * This method returns the number of characters in the CLOB.
- *
- * @return The number of characters in the CLOB.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- long length() throws SQLException;
-
- /**
- * This method returns the specified portion of the CLOB as a
- * <code>String</code>.
- *
- * @param offset The index into the CLOB (index values start at 1) to
- * start returning characters from.
- * @param length The requested number of characters to return.
- * @return The requested CLOB section, as a <code>String</code>.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- String getSubString(long pos, int length) throws SQLException;
-
- /**
- * This method returns a character stream that reads the contents of the
- * CLOB.
- *
- * @return A character stream to read the CLOB's contents.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- Reader getCharacterStream() throws SQLException;
-
- /**
- * This method returns a byte stream that reads the contents of the
- * CLOB as a series of ASCII bytes.
- *
- * @return A stream to read the CLOB's contents.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- InputStream getAsciiStream() throws SQLException;
-
- /**
- * This method returns the index into the CLOB of the first occurrence of
- * the specified character pattern (supplied by the caller as a
- * <code>String</code>). The search begins at the specified index.
- *
- * @param searchstr The character pattern to search for, passed as a
- * <code>String</code>.
- * @param start. The index into the CLOB to start search (indexes start
- * at 1).
- * @return The index at which the pattern was found (indexes start at 1),
- * or -1 if the pattern was not found.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- long position(String searchstr, long start) throws SQLException;
-
- /**
- * This method returns the index into the CLOB of the first occurrence of
- * the specified character pattern (supplied by the caller as a
- * <code>Clob</code>). The search begins at the specified index.
- *
- * @param searchstr The character pattern to search for, passed as a
- * <code>Clob</code>.
- * @param start. The index into the CLOB to start search (indexes start
- * at 1).
- * @return The index at which the pattern was found (indexes start at 1),
- * or -1 if the pattern was not found.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- long position(Clob searchstr, long start) throws SQLException;
-
- /**
- * @since 1.4
- */
- int setString(long pos, String str) throws SQLException;
-
- /**
- * @since 1.4
- */
- int setString(long pos, String str, int offset, int len)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- OutputStream setAsciiStream(long pos) throws SQLException;
-
- /**
- * @since 1.4
- */
- Writer setCharacterStream(long pos) throws SQLException;
-
- /**
- * @since 1.4
- */
- void truncate(long len) throws SQLException;
-}
diff --git a/libjava/java/sql/Connection.java b/libjava/java/sql/Connection.java
deleted file mode 100644
index 48ec12dd09f..00000000000
--- a/libjava/java/sql/Connection.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/* Connection.java -- Manage a database connection.
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.util.Map;
-
-/**
- * This interface provides methods for managing a connection to a database.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Connection
-{
- /**
- * This transaction isolation level indicates that transactions are not
- * supported.
- */
- int TRANSACTION_NONE = 0;
-
- /**
- * This transaction isolation level indicates that one transaction can
- * read modifications by other transactions before the other transactions
- * have committed their changes. This could result in invalid reads.
- */
- int TRANSACTION_READ_UNCOMMITTED = 1;
-
- /**
- * This transaction isolation leve indicates that only committed data from
- * other transactions will be read. If a transaction reads a row, then
- * another transaction commits a change to that row, the first transaction
- * would retrieve the changed row on subsequent reads of the same row.
- */
- int TRANSACTION_READ_COMMITTED = 2;
-
- /**
- * This transaction isolation level indicates that only committed data from
- * other transactions will be read. It also ensures that data read from
- * a row will not be different on a subsequent read even if another
- * transaction commits a change.
- */
- int TRANSACTION_REPEATABLE_READ = 4;
-
- /**
- * This transaction isolation level indicates that only committed data from
- * other transactions will be read. It also ensures that data read from
- * a row will not be different on a subsequent read even if another
- * transaction commits a change. Additionally, rows modified by other
- * transactions will not affect the result set returned during subsequent
- * executions of the same WHERE clause in this transaction.
- */
- int TRANSACTION_SERIALIZABLE = 8;
-
- /**
- * This method creates a new SQL statement. The default result set type
- * and concurrency will be used.
- *
- * @return A new <code>Statement</code> object.
- * @exception SQLException If an error occurs.
- * @see Statement
- */
- Statement createStatement() throws SQLException;
-
- /**
- * This method creates a new <code>PreparedStatement</code> for the specified
- * SQL string. This method is designed for use with parameterized
- * statements. The default result set type and concurrency will be used.
- *
- * @param The SQL statement to use in creating this
- * <code>PreparedStatement</code>.
- * @return A new <code>PreparedStatement</code>.
- * @exception SQLException If an error occurs.
- * @see PreparedStatement
- */
- PreparedStatement prepareStatement(String sql) throws SQLException;
-
- /**
- * This method creates a new <code>CallableStatement</code> for the
- * specified SQL string. Thie method is designed to be used with
- * stored procedures. The default result set type and concurrency
- * will be used.
- *
- * @param The SQL statement to use in creating this
- * <code>CallableStatement</code>.
- * @return A new <code>CallableStatement</code>.
- * @exception SQLException If an error occurs.
- * @see CallableStatement
- */
- CallableStatement prepareCall(String sql) throws SQLException;
-
- /**
- * This method converts the specified generic SQL statement into the
- * native grammer of the database this object is connected to.
- *
- * @param The JDBC generic SQL statement.
- * @return The native SQL statement.
- * @exception SQLException If an error occurs.
- */
- String nativeSQL(String sql) throws SQLException;
-
- /**
- * This method turns auto commit mode on or off. In auto commit mode,
- * every SQL statement is committed its own transaction. Otherwise a
- * transaction must be explicitly committed or rolled back.
- *
- * @param autoCommit <code>true</code> to enable auto commit mode,
- * <code>false</code> to disable it.
- * @exception SQLException If an error occurs.
- * @see commit
- * @see rollback
- */
- void setAutoCommit(boolean autoCommit) throws SQLException;
-
- /**
- * This method tests whether or not auto commit mode is currently enabled.
- * In auto commit mode, every SQL statement is committed its own transaction.
- * Otherwise a transaction must be explicitly committed or rolled back.
- *
- * @return <code>true</code> if auto commit mode is enabled,
- * <code>false</code> otherwise.
- *
- * @exception SQLException If an error occurs.
- *
- * @see commit
- * @see rollback
- */
- boolean getAutoCommit() throws SQLException;
-
- /**
- * This method commits any SQL statements executed on this connection since
- * the last commit or rollback.
- *
- * @exception SQLException If an error occurs.
- */
- void commit() throws SQLException;
-
- /**
- * This method rolls back any SQL statements executed on this connection
- * since the last commit or rollback.
- *
- * @exception SQLException If an error occurs.
- */
- void rollback() throws SQLException;
-
- /**
- * This method immediately closes this database connection.
- *
- * @exception SQLException If an error occurs.
- */
- void close() throws SQLException;
-
- /**
- * This method tests whether or not this connection has been closed.
- *
- * @return <code>true</code> if the connection is closed, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isClosed() throws SQLException;
-
- /**
- * This method returns the meta data for this database connection.
- *
- * @return The meta data for this database.
- * @exception SQLException If an error occurs.
- * @see DatabaseMetaData
- */
- DatabaseMetaData getMetaData() throws SQLException;
-
- /**
- * This method turns read only mode on or off. It may not be called while
- * a transaction is in progress.
- *
- * @param readOnly <code>true</code> if this connection is read only,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- void setReadOnly(boolean readOnly) throws SQLException;
-
- /**
- * This method tests whether or not this connection is in read only mode.
- *
- * @return <code>true</code> if the connection is read only <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isReadOnly() throws SQLException;
-
- /**
- * This method sets the name of the catalog in use by this connection.
- * Note that this method does nothing if catalogs are not supported by
- * this database.
- *
- * @param catalog The name of the catalog to use for this connection.
- * @exception SQLException If an error occurs.
- */
- void setCatalog(String catalog) throws SQLException;
-
- /**
- * This method returns the name of the catalog in use by this connection,
- * if any.
- *
- * @return The name of the catalog, or <code>null</code> if one does not
- * exist or catalogs are not supported by this database.
- * @exception SQLException If an error occurs.
- */
- String getCatalog() throws SQLException;
-
- /**
- * This method sets the current transaction isolation mode. This must
- * be one of the constants defined in this interface.
- *
- * @param level The transaction isolation level.
- * @exception SQLException If an error occurs.
- */
- void setTransactionIsolation(int level) throws SQLException;
-
- /**
- * This method returns the current transaction isolation mode. This will
- * be one of the constants defined in this interface.
- *
- * @return The transaction isolation level.
- * @exception SQLException If an error occurs.
- */
- int getTransactionIsolation() throws SQLException;
-
- /**
- * This method returns the first warning that occurred on this connection,
- * if any. If there were any subsequence warnings, they will be chained
- * to the first one.
- *
- * @return The first <code>SQLWarning</code> that occurred, or
- * <code>null</code> if there have been no warnings.
- * @exception SQLException If an error occurs.
- */
- SQLWarning getWarnings() throws SQLException;
-
- /**
- * This method clears all warnings that have occurred on this connection.
- *
- * @exception SQLException If an error occurs.
- */
- void clearWarnings() throws SQLException;
-
- /**
- * This method creates a new SQL statement with the specified type and
- * concurrency. Valid values for these parameters are specified in the
- * <code>ResultSet</code> class.
- *
- * @param resultSetType The type of result set to use for this statement.
- * @param resultSetConcurrency. The type of concurrency to be used in
- * the result set for this statement.
- * @return A new <code>Statement</code> object.
- * @exception SQLException If an error occurs.
- * @see Statement
- * @see ResultSet
- */
- Statement createStatement(int resultSetType, int resultSetConcurrency)
- throws SQLException;
-
- /**
- * This method creates a new <code>PreparedStatement</code> for the specified
- * SQL string. This method is designed for use with parameterized
- * statements. The specified result set type and concurrency will be used.
- * Valid values for these parameters are specified in the
- * <code>ResultSet</code> class.
- *
- * @param The SQL statement to use in creating this
- * <code>PreparedStatement</code>.
- * @param resultSetType The type of result set to use for this statement.
- * @param resultSetConcurrency. The type of concurrency to be used in
- * the result set for this statement.
- * @return A new <code>PreparedStatement</code>.
- * @exception SQLException If an error occurs.
- * @see PreparedStatement
- * @see ResultSet
- */
- PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency) throws SQLException;
-
- /**
- * This method creates a new <code>CallableStatement</code> for the
- * specified SQL string. Thie method is designed to be used with
- * stored procedures. The specified result set type and concurrency
- * will be used. Valid values for these parameters are specified in the
- * <code>ResultSet</code> class.
- *
- * @param The SQL statement to use in creating this
- * <code>PreparedStatement</code>.
- * @param resultSetType The type of result set to use for this statement.
- * @param resultSetConcurrency. The type of concurrency to be used in
- * the result set for this statement.
- * @return A new <code>CallableStatement</code>.
- * @exception SQLException If an error occurs.
- * @see CallableStatement
- * @see ResultSet
- */
- CallableStatement prepareCall(String sql, int resultSetType, int
- resultSetConcurrency) throws SQLException;
-
- /**
- * This method returns the mapping of SQL types to Java classes
- * currently in use by this connection. This mapping will have no
- * entries unless they have been manually added.
- *
- * @return The SQL type to Java class mapping.
- * @exception SQLException If an error occurs.
- */
- Map getTypeMap() throws SQLException;
-
- /**
- * This method sets the mapping table for SQL types to Java classes.
- * Any entries in this map override the defaults.
- *
- * @param map The new SQL mapping table.
- * @exception SQLException If an error occurs.
- */
- void setTypeMap(Map map) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setHoldability(int holdability) throws SQLException;
-
- /**
- * @since 1.4
- */
- int getHoldability() throws SQLException;
-
- /**
- * @since 1.4
- */
- Savepoint setSavepoint() throws SQLException;
-
- /**
- * @since 1.4
- */
- Savepoint setSavepoint(String name) throws SQLException;
-
- /**
- * @since 1.4
- */
- void rollback(Savepoint savepoint) throws SQLException;
-
- /**
- * @since 1.4
- */
- void releaseSavepoint(Savepoint savepoint) throws SQLException;
-
- /**
- * @since 1.4
- */
- Statement createStatement(int resultSetType, int
- resultSetConcurrency, int resultSetHoldability) throws SQLException;
-
- /**
- * @since 1.4
- */
- PreparedStatement prepareStatement(String sql, int resultSetType, int
- resultSetConcurrency, int resultSetHoldability) throws SQLException;
-
- /**
- * @since 1.4
- */
- CallableStatement prepareCall(String sql, int resultSetType, int
- resultSetConcurrency, int resultSetHoldability) throws SQLException;
-
- /**
- * @since 1.4
- */
- PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- PreparedStatement prepareStatement(String sql, int[] columnIndexes)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- PreparedStatement prepareStatement(String sql, String[] columnNames)
- throws SQLException;
-}
diff --git a/libjava/java/sql/DataTruncation.java b/libjava/java/sql/DataTruncation.java
deleted file mode 100644
index ec522c0251c..00000000000
--- a/libjava/java/sql/DataTruncation.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/* DataTruncation.java -- Warning when data has been truncated.
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * This exception is thrown when a piece of data is unexpectedly
- * truncated in JDBC.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class DataTruncation extends SQLWarning
-{
- static final long serialVersionUID = 6464298989504059473L;
-
- /**
- * The original size of the data.
- */
- private int dataSize;
-
- /**
- * The index of the parameter or column whose value was truncated.
- */
- private int index;
-
- /**
- * Indicates whether or not a parameter value was truncated.
- */
- private boolean parameter;
-
- /**
- * Indicates whether or not a data column value was truncated.
- */
- private boolean read;
-
- /**
- * This is the size of the data after truncation.
- */
- private int transferSize;
-
- /**
- * This method initializes a new instance of <code>DataTruncation</code>
- * with the specified values. The descriptive error message for this
- * exception will be "Data truncation", the SQL state will be "01004"
- * and the vendor specific error code will be set to 0.
- *
- * @param index The index of the parameter or column that was truncated.
- * @param parameter <code>true</code> if a parameter was truncated,
- * <code>false</code> otherwise.
- * @param read <code>true</code> if a data column was truncated,
- * <code>false</code> otherwise.
- * @param dataSize The original size of the data.
- * @param transferSize The size of the data after truncation.
- */
- public DataTruncation(int index, boolean parameter, boolean read, int
- dataSize, int transferSize)
- {
- super("Data truncation", "01004");
-
- this.index = index;
- this.parameter = parameter;
- this.read = read;
- this.dataSize = dataSize;
- this.transferSize = transferSize;
- }
-
- /**
- * This method returns the index of the column or parameter that was
- * truncated.
- *
- * @return The index of the column or parameter that was truncated.
- */
- public int getIndex()
- {
- return index;
- }
-
- /**
- * This method determines whether or not it was a parameter that was
- * truncated.
- *
- * @return <code>true</code> if a parameter was truncated, <code>false</code>
- * otherwise.
- */
- public boolean getParameter()
- {
- return parameter;
- }
-
- /**
- * This method determines whether or not it was a column that was
- * truncated.
- *
- * @return <code>true</code> if a column was truncated, <code>false</code>
- * otherwise.
- */
- public boolean getRead()
- {
- return read;
- }
-
- /**
- * This method returns the original size of the parameter or column that
- * was truncated.
- *
- * @return The original size of the parameter or column that was truncated.
- */
- public int getDataSize()
- {
- return dataSize;
- }
-
- /**
- * This method returns the size of the parameter or column after it was
- * truncated.
- *
- * @return The size of the parameter or column after it was truncated.
- */
- public int getTransferSize()
- {
- return transferSize;
- }
-}
diff --git a/libjava/java/sql/DatabaseMetaData.java b/libjava/java/sql/DatabaseMetaData.java
deleted file mode 100644
index d34c4e2f927..00000000000
--- a/libjava/java/sql/DatabaseMetaData.java
+++ /dev/null
@@ -1,2214 +0,0 @@
-/* DatabaseMetaData.java -- Information about the database itself.
- Copyright (C) 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-public interface DatabaseMetaData
-{
- /**
- * It is unknown whether or not the procedure returns a result.
- */
- int procedureResultUnknown = 0;
-
- /**
- * The procedure does not return a result.
- */
- int procedureNoResult = 1;
-
- /**
- * The procedure returns a result.
- */
- int procedureReturnsResult = 2;
-
- /**
- * The column type is unknown.
- */
- int procedureColumnUnknown = 0;
-
- /**
- * The column type is input.
- */
- int procedureColumnIn = 1;
-
- /**
- * The column type is input/output.
- */
- int procedureColumnInOut = 2;
-
- /**
- * The column type is output
- */
- int procedureColumnOut = 4;
-
- /**
- * The column is used for return values.
- */
- int procedureColumnReturn = 5;
-
- /**
- * The column is used for storing results
- */
- int procedureColumnResult = 3;
-
- /**
- * NULL values are not allowed.
- */
- int procedureNoNulls = 0;
-
- /**
- * NULL values are allowed.
- */
- int procedureNullable = 1;
-
- /**
- * It is unknown whether or not NULL values are allowed.
- */
- int procedureNullableUnknown = 2;
-
- /**
- * The column does not allow NULL
- */
- int columnNoNulls = 0;
-
- /**
- * The column does allow NULL
- */
- int columnNullable = 1;
-
- /**
- * It is unknown whether or not the column allows NULL
- */
- int columnNullableUnknown = 2;
-
- /**
- * The best row's scope is only guaranteed to be valid so long as the
- * row is actually being used.
- */
- int bestRowTemporary = 0;
-
- /**
- * The best row identifier is valid to the end of the transaction.
- */
- int bestRowTransaction = 1;
-
- /**
- * The best row identifier is valid to the end of the session.
- */
- int bestRowSession = 2;
-
- /**
- * The best row may or may not be a pseudo-column.
- */
- int bestRowUnknown = 0;
-
- /**
- * The best row identifier is not a pseudo-column.
- */
- int bestRowNotPseudo = 1;
-
- /**
- * The best row identifier is a pseudo-column.
- */
- int bestRowPseudo = 2;
-
- /**
- * It is unknown whether or not the version column is a pseudo-column.
- */
- int versionColumnUnknown = 0;
-
- /**
- * The version column is not a pseudo-column
- */
- int versionColumnNotPseudo = 1;
-
- /**
- * The version column is a pseudo-column
- */
- int versionColumnPseudo = 2;
-
- /**
- * Foreign key changes are cascaded in updates or deletes.
- */
- int importedKeyCascade = 0;
-
- /**
- * Column may not be updated or deleted in use as a foreign key.
- */
- int importedKeyRestrict = 1;
-
- /**
- * When primary key is updated or deleted, the foreign key is set to NULL.
- */
- int importedKeySetNull = 2;
-
- /**
- * If the primary key is a foreign key, it cannot be udpated or deleted.
- */
- int importedKeyNoAction = 3;
-
- /**
- * If the primary key is updated or deleted, the foreign key is set to
- * a default value.
- */
- int importedKeySetDefault = 4;
-
- /**
- * Wish I knew what this meant.
- */
- int importedKeyInitiallyDeferred = 5;
-
- /**
- * Wish I knew what this meant.
- */
- int importedKeyInitiallyImmediate = 6;
-
- /**
- * Wish I knew what this meant.
- */
- int importedKeyNotDeferrable = 7;
-
- /**
- * A NULL value is not allowed for this data type.
- */
- int typeNoNulls = 0;
-
- /**
- * A NULL value is allowed for this data type.
- */
- int typeNullable = 1;
-
- /**
- * It is unknown whether or not NULL values are allowed for this data type.
- */
- int typeNullableUnknown = 2;
-
- /**
- * Where clauses are not supported for this type.
- */
- int typePredNone = 0;
-
- /**
- * Only "WHERE..LIKE" style WHERE clauses are allowed on this data type.
- */
- int typePredChar = 1;
-
- /**
- * All WHERE clauses except "WHERE..LIKE" style are allowed on this data type.
- */
- int typePredBasic = 2;
-
- /**
- * Any type of WHERE clause is allowed for this data type.
- */
- int typeSearchable = 3;
-
- /**
- * This column contains table statistics.
- */
- short tableIndexStatistic = 0;
-
- /**
- * This table index is clustered.
- */
- short tableIndexClustered = 1;
-
- /**
- * This table index is hashed.
- */
- short tableIndexHashed = 2;
-
- /**
- * This table index is of another type.
- */
- short tableIndexOther = 3;
-
- short attributeNoNulls = 0;
-
- short attributeNullable = 1;
-
- short attributeNullableUnknown = 2;
-
- int sqlStateXOpen = 1;
-
- int sqlStateSQL99 = 2;
-
- /**
- * This method tests whether or not all the procedures returned by
- * the <code>getProcedures</code> method can be called by this user.
- *
- * @return <code>true</code> if all the procedures can be called,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean allProceduresAreCallable() throws SQLException;
-
- /**
- * This method tests whether or not all the table returned by the
- * <code>getTables</code> method can be selected by this user.
- *
- * @return <code>true</code> if all the procedures can be called,
- * <code>false</code> otherwise.
- *
- * @exception SQLException If an error occurs.
- */
- boolean allTablesAreSelectable() throws SQLException;
-
- /**
- * This method returns the URL for this database.
- *
- * @return The URL string for this database, or <code>null</code> if it
- * is not known.
- * @exception SQLException If an error occurs.
- */
- String getURL() throws SQLException;
-
- /**
- * This method returns the database username for this connection.
- *
- * @return The database username.
- * @exception SQLException If an error occurs.
- */
- String getUserName() throws SQLException;
-
- /**
- * This method tests whether or not the database is in read only mode.
- *
- * @return <code>true</code> if the database is in read only mode,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isReadOnly() throws SQLException;
-
- /**
- * This method tests whether or not NULL's sort as high values.
- *
- * @return <code>true</code> if NULL's sort as high values, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean nullsAreSortedHigh() throws SQLException;
-
- /**
- * This method tests whether or not NULL's sort as low values.
- *
- * @return <code>true</code> if NULL's sort as low values, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean nullsAreSortedLow() throws SQLException;
-
- /**
- * This method tests whether or not NULL's sort as high values.
- *
- * @return <code>true</code> if NULL's sort as high values, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean nullsAreSortedAtStart() throws SQLException;
-
- /**
- * This method test whether or not NULL's are sorted to the end
- * of the list regardless of ascending or descending sort order.
- *
- * @return <code>true</code> if NULL's always sort to the end,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean nullsAreSortedAtEnd() throws SQLException;
-
- /**
- * This method returns the name of the database product.
- *
- * @return The database product.
- * @exception SQLException If an error occurs.
- */
- String getDatabaseProductName() throws SQLException;
-
- /**
- * This method returns the version of the database product.
- *
- * @return The version of the database product.
- * @exception SQLException If an error occurs.
- */
- String getDatabaseProductVersion() throws SQLException;
-
- /**
- * This method returns the name of the JDBC driver.
- *
- * @return The name of the JDBC driver.
- * @exception SQLException If an error occurs.
- */
- String getDriverName() throws SQLException;
-
- /**
- * This method returns the version of the JDBC driver.
- *
- * @return The version of the JDBC driver.
- * @exception SQLException If an error occurs.
- */
- String getDriverVersion() throws SQLException;
-
- /**
- * This method returns the major version number of the JDBC driver.
- *
- * @return The major version number of the JDBC driver.
- */
- int getDriverMajorVersion();
-
- /**
- * This method returns the minor version number of the JDBC driver.
- *
- * @return The minor version number of the JDBC driver.
- */
- int getDriverMinorVersion();
-
- /**
- * This method tests whether or not the database uses local files to
- * store tables.
- *
- * @return <code>true</code> if the database uses local files,
- * <code>false</code> otherwise.
- *
- * @exception SQLException If an error occurs.
- */
- boolean usesLocalFiles() throws SQLException;
-
- /**
- * This method tests whether or not the database uses a separate file for
- * each table.
- *
- * @return <code>true</code> if the database uses a separate file for each
- * table <code>false</code> otherwise.
- *
- * @exception SQLException If an error occurs.
- */
- boolean usesLocalFilePerTable() throws SQLException;
-
- /**
- * This method tests whether or not the database supports identifiers
- * with mixed case.
- *
- * @return <code>true</code> if the database supports mixed case identifiers,
- * <code>false</code> otherwise.
- *
- * @exception SQLException If an error occurs.
- */
- boolean supportsMixedCaseIdentifiers() throws SQLException;
-
- /**
- * This method tests whether or not the database treats mixed case
- * identifiers as all upper case.
- *
- * @return <code>true</code> if the database treats all identifiers as
- * upper case, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean storesUpperCaseIdentifiers() throws SQLException;
-
- /**
- * This method tests whether or not the database treats mixed case
- * identifiers as all lower case.
- *
- * @return <code>true</code> if the database treats all identifiers as
- * lower case, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean storesLowerCaseIdentifiers() throws SQLException;
-
- /**
- * This method tests whether or not the database stores mixed case
- * identifers even if it treats them as case insensitive.
- *
- * @return <code>true</code> if the database stores mixed case identifiers,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean storesMixedCaseIdentifiers() throws SQLException;
-
- /**
- * This method tests whether or not the database supports quoted identifiers
- * with mixed case.
- *
- * @return <code>true</code> if the database supports mixed case quoted
- * identifiers, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsMixedCaseQuotedIdentifiers() throws SQLException;
-
- /**
- * This method tests whether or not the database treats mixed case
- * quoted identifiers as all upper case.
- *
- * @return <code>true</code> if the database treats all quoted identifiers
- * as upper case, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean storesUpperCaseQuotedIdentifiers() throws SQLException;
-
- /**
- * This method tests whether or not the database treats mixed case
- * quoted identifiers as all lower case.
- *
- * @return <code>true</code> if the database treats all quoted identifiers
- * as lower case, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean storesLowerCaseQuotedIdentifiers() throws SQLException;
-
- /**
- * This method tests whether or not the database stores mixed case
- * quoted identifers even if it treats them as case insensitive.
- *
- * @return <code>true</code> if the database stores mixed case quoted
- * identifiers, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean storesMixedCaseQuotedIdentifiers() throws SQLException;
-
- /**
- * This metohd returns the quote string for SQL identifiers.
- *
- * @return The quote string for SQL identifers, or a space if quoting
- * is not supported.
- * @exception SQLException If an error occurs.
- */
- String getIdentifierQuoteString() throws SQLException;
-
- /**
- * This method returns a comma separated list of all the SQL keywords in
- * the database that are not in SQL92.
- *
- * @return The list of SQL keywords not in SQL92.
- * @exception SQLException If an error occurs.
- */
- String getSQLKeywords() throws SQLException;
-
- /**
- * This method returns a comma separated list of math functions.
- *
- * @return The list of math functions.
- * @exception SQLException If an error occurs.
- */
- String getNumericFunctions() throws SQLException;
-
- /**
- * This method returns a comma separated list of string functions.
- *
- * @return The list of string functions.
- * @exception SQLException If an error occurs.
- */
- String getStringFunctions() throws SQLException;
-
- /**
- * This method returns a comma separated list of of system functions.
- *
- * @return A comma separated list of system functions.
- * @exception SQLException If an error occurs.
- */
- String getSystemFunctions() throws SQLException;
-
- /**
- * This method returns comma separated list of time/date functions.
- *
- * @return The list of time/date functions.
- * @exception SQLException If an error occurs.
- */
- String getTimeDateFunctions() throws SQLException;
-
- /**
- * This method returns the string used to escape wildcards in search strings.
- *
- * @return The string used to escape wildcards in search strings.
- * @exception SQLException If an error occurs.
- */
- String getSearchStringEscape() throws SQLException;
-
- /**
- * This methods returns non-standard characters that can appear in
- * unquoted identifiers.
- *
- * @return Non-standard characters that can appear in unquoted identifiers.
- * @exception SQLException If an error occurs.
- */
- String getExtraNameCharacters() throws SQLException;
-
- /**
- * This method tests whether or not the database supports
- * "ALTER TABLE ADD COLUMN"
- *
- * @return <code>true</code> if column add supported, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsAlterTableWithAddColumn() throws SQLException;
-
- /**
- * This method tests whether or not the database supports
- * "ALTER TABLE DROP COLUMN"
- *
- * @return <code>true</code> if column drop supported, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsAlterTableWithDropColumn() throws SQLException;
-
- /**
- * This method tests whether or not column aliasing is supported.
- *
- * @return <code>true</code> if column aliasing is supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsColumnAliasing() throws SQLException;
-
- /**
- * This method tests whether the concatenation of a NULL and non-NULL
- * value results in a NULL. This will always be true in fully JDBC compliant
- * drivers.
- *
- * @return <code>true</code> if concatenating NULL and a non-NULL value
- * returns a NULL, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean nullPlusNonNullIsNull() throws SQLException;
-
- /**
- * Tests whether or not CONVERT is supported.
- *
- * @return <code>true</code> if CONVERT is supported, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsConvert() throws SQLException;
-
- /**
- * This method tests whether or not CONVERT can be performed between the
- * specified types. The types are contants from <code>Types</code>.
- *
- * @param fromType The SQL type to convert from.
- * @param toType The SQL type to convert to.
- * @return <code>true</code> if the conversion can be performed,
- * <code>false</code> otherwise.
- * @see Types
- */
- boolean supportsConvert(int fromType, int toType) throws
- SQLException;
-
- /**
- * This method tests whether or not table correlation names are
- * supported. This will be always be <code>true</code> in a fully JDBC
- * compliant driver.
- *
- * @return <code>true</code> if table correlation names are supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsTableCorrelationNames() throws SQLException;
-
- /**
- * This method tests whether correlation names must be different from the
- * name of the table.
- *
- * @return <code>true</code> if the correlation name must be different from
- * the table name, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsDifferentTableCorrelationNames() throws SQLException;
-
- /**
- * This method tests whether or not expressions are allowed in an
- * ORDER BY lists.
- *
- * @return <code>true</code> if expressions are allowed in ORDER BY
- * lists, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsExpressionsInOrderBy() throws SQLException;
-
- /**
- * This method tests whether or ORDER BY on a non-selected column is
- * allowed.
- *
- * @return <code>true</code> if a non-selected column can be used in an
- * ORDER BY, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsOrderByUnrelated() throws SQLException;
-
- /**
- * This method tests whether or not GROUP BY is supported.
- *
- * @return <code>true</code> if GROUP BY is supported, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsGroupBy() throws SQLException;
-
- /**
- * This method tests whether GROUP BY on a non-selected column is
- * allowed.
- *
- * @return <code>true</code> if a non-selected column can be used in a
- * GROUP BY, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsGroupByUnrelated() throws SQLException;
-
- /**
- * This method tests whether or not a GROUP BY can add columns not in the
- * select if it includes all the columns in the select.
- *
- * @return <code>true</code> if GROUP BY an add columns provided it includes
- * all columns in the select, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsGroupByBeyondSelect() throws SQLException;
-
- /**
- * This method tests whether or not the escape character is supported in
- * LIKE expressions. A fully JDBC compliant driver will always return
- * <code>true</code>.
- *
- * @return <code>true</code> if escapes are supported in LIKE expressions,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsLikeEscapeClause() throws SQLException;
-
- /**
- * This method tests whether multiple result sets for a single statement are
- * supported.
- *
- * @return <code>true</code> if multiple result sets are supported for a
- * single statement, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsMultipleResultSets() throws SQLException;
-
- /**
- * This method test whether or not multiple transactions may be open
- * at once, as long as they are on different connections.
- *
- * @return <code>true</code> if multiple transactions on different
- * connections are supported, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsMultipleTransactions() throws SQLException;
-
- /**
- * This method tests whether or not columns can be defined as NOT NULL. A
- * fully JDBC compliant driver always returns <code>true</code>.
- *
- * @return <code>true</code> if NOT NULL columns are supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsNonNullableColumns() throws SQLException;
-
- /**
- * This method tests whether or not the minimum grammer for ODBC is supported.
- * A fully JDBC compliant driver will always return <code>true</code>.
- *
- * @return <code>true</code> if the ODBC minimum grammar is supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsMinimumSQLGrammar() throws SQLException;
-
- /**
- * This method tests whether or not the core grammer for ODBC is supported.
- *
- * @return <code>true</code> if the ODBC core grammar is supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsCoreSQLGrammar() throws SQLException;
-
- /**
- * This method tests whether or not the extended grammer for ODBC is supported.
- *
- * @return <code>true</code> if the ODBC extended grammar is supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsExtendedSQLGrammar() throws SQLException;
-
- /**
- * This method tests whether or not the ANSI92 entry level SQL
- * grammar is supported. A fully JDBC compliant drivers must return
- * <code>true</code>.
- *
- * @return <code>true</code> if the ANSI92 entry level SQL grammar is
- * supported, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsANSI92EntryLevelSQL() throws SQLException;
-
- /**
- * This method tests whether or not the ANSI92 intermediate SQL
- * grammar is supported.
- *
- * @return <code>true</code> if the ANSI92 intermediate SQL grammar is
- * supported, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsANSI92IntermediateSQL() throws SQLException;
-
- /**
- * This method tests whether or not the ANSI92 full SQL
- * grammar is supported.
- *
- * @return <code>true</code> if the ANSI92 full SQL grammar is
- * supported, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsANSI92FullSQL() throws SQLException;
-
- /**
- * This method tests whether or not the SQL integrity enhancement
- * facility is supported.
- *
- * @return <code>true</code> if the integrity enhancement facility is
- * supported, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsIntegrityEnhancementFacility() throws SQLException;
-
- /**
- * This method tests whether or not the database supports outer joins.
- *
- * @return <code>true</code> if outer joins are supported, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsOuterJoins() throws SQLException;
-
- /**
- * This method tests whether or not the database supports full outer joins.
- *
- * @return <code>true</code> if full outer joins are supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsFullOuterJoins() throws SQLException;
-
- /**
- * This method tests whether or not the database supports limited outer joins.
- *
- * @return <code>true</code> if limited outer joins are supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsLimitedOuterJoins() throws SQLException;
-
- /**
- * This method returns the vendor's term for "schema".
- *
- * @return The vendor's term for schema.
- * @exception SQLException if an error occurs.
- */
- String getSchemaTerm() throws SQLException;
-
- /**
- * This method returns the vendor's term for "procedure".
- *
- * @return The vendor's term for procedure.
- * @exception SQLException if an error occurs.
- */
- String getProcedureTerm() throws SQLException;
-
- /**
- * This method returns the vendor's term for "catalog".
- *
- * @return The vendor's term for catalog.
- * @exception SQLException if an error occurs.
- */
- String getCatalogTerm() throws SQLException;
-
- /**
- * This method tests whether a catalog name appears at the beginning of
- * a fully qualified table name.
- *
- * @return <code>true</code> if the catalog name appears at the beginning,
- * <code>false</code> if it appears at the end.
- * @exception SQLException If an error occurs.
- */
- boolean isCatalogAtStart() throws SQLException;
-
- /**
- * This method returns the separator between the catalog name and the
- * table name.
- *
- * @return The separator between the catalog name and the table name.
- * @exception SQLException If an error occurs.
- */
- String getCatalogSeparator() throws SQLException;
-
- /**
- * This method tests whether a catalog name can appear in a data
- * manipulation statement.
- *
- * @return <code>true</code> if a catalog name can appear in a data
- * manipulation statement, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsSchemasInDataManipulation() throws SQLException;
-
- /**
- * This method tests whether a catalog name can appear in a procedure
- * call
- *
- * @return <code>true</code> if a catalog name can appear in a procedure
- * call, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsSchemasInProcedureCalls() throws SQLException;
-
- /**
- * This method tests whether a catalog name can appear in a table definition.
- *
- * @return <code>true</code> if a catalog name can appear in a table
- * definition, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsSchemasInTableDefinitions() throws SQLException;
-
- /**
- * This method tests whether a catalog name can appear in an index definition.
- *
- * @return <code>true</code> if a catalog name can appear in an index
- * definition, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsSchemasInIndexDefinitions() throws SQLException;
-
- /**
- * This method tests whether a catalog name can appear in privilege definitions.
- *
- * @return <code>true</code> if a catalog name can appear in privilege
- * definition, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsSchemasInPrivilegeDefinitions() throws SQLException;
-
- /**
- * This method tests whether a catalog name can appear in a data
- * manipulation statement.
- *
- * @return <code>true</code> if a catalog name can appear in a data
- * manipulation statement, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsCatalogsInDataManipulation() throws SQLException;
-
- /**
- * This method tests whether a catalog name can appear in a procedure
- * call
- *
- * @return <code>true</code> if a catalog name can appear in a procedure
- * call, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsCatalogsInProcedureCalls() throws SQLException;
-
- /**
- * This method tests whether a catalog name can appear in a table definition.
- *
- * @return <code>true</code> if a catalog name can appear in a table
- * definition, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsCatalogsInTableDefinitions() throws SQLException;
-
- /**
- * This method tests whether a catalog name can appear in an index definition.
- *
- * @return <code>true</code> if a catalog name can appear in an index
- * definition, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsCatalogsInIndexDefinitions() throws SQLException;
-
- /**
- * This method tests whether a catalog name can appear in privilege definitions.
- *
- * @return <code>true</code> if a catalog name can appear in privilege
- * definition, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException;
-
- /**
- * This method tests whether or not that database supports positioned
- * deletes.
- *
- * @return <code>true</code> if positioned deletes are supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsPositionedDelete() throws SQLException;
-
- /**
- * This method tests whether or not that database supports positioned
- * updates.
- *
- * @return <code>true</code> if positioned updates are supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsPositionedUpdate() throws SQLException;
-
- /**
- * This method tests whether or not SELECT FOR UPDATE is supported by the
- * database.
- *
- * @return <code>true</code> if SELECT FOR UPDATE is supported
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsSelectForUpdate() throws SQLException;
-
- /**
- * This method tests whether or not stored procedures are supported on
- * this database.
- *
- * @return <code>true</code> if stored procedures are supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsStoredProcedures() throws SQLException;
-
- /**
- * This method tests whether or not subqueries are allowed in comparisons.
- * A fully JDBC compliant driver will always return <code>true</code>.
- *
- * @return <code>true</code> if subqueries are allowed in comparisons,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsSubqueriesInComparisons() throws SQLException;
-
- /**
- * This method tests whether or not subqueries are allowed in exists
- * expressions. A fully JDBC compliant driver will always return
- * <code>true</code>.
- *
- * @return <code>true</code> if subqueries are allowed in exists
- * expressions, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsSubqueriesInExists() throws SQLException;
-
- /**
- * This method tests whether subqueries are allowed in IN statements.
- * A fully JDBC compliant driver will always return <code>true</code>.
- *
- * @return <code>true</code> if the driver supports subqueries in IN
- * statements, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsSubqueriesInIns() throws SQLException;
-
- /**
- * This method tests whether or not subqueries are allowed in quantified
- * expressions. A fully JDBC compliant driver will always return
- * <code>true</code>.
- *
- * @return <code>true</code> if subqueries are allowed in quantified
- * expressions, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsSubqueriesInQuantifieds() throws SQLException;
-
- /**
- * This method test whether or not correlated subqueries are allowed. A
- * fully JDBC compliant driver will always return <code>true</code>.
- *
- * @return <code>true</code> if correlated subqueries are allowed,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsCorrelatedSubqueries() throws SQLException;
-
- /**
- * This method tests whether or not the UNION statement is supported.
- *
- * @return <code>true</code> if UNION is supported, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsUnion() throws SQLException;
-
- /**
- * This method tests whether or not the UNION ALL statement is supported.
- *
- * @return <code>true</code> if UNION ALL is supported, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsUnionAll() throws SQLException;
-
- /**
- * This method tests whether or not the database supports cursors
- * remaining open across commits.
- *
- * @return <code>true</code> if cursors can remain open across commits,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsOpenCursorsAcrossCommit() throws SQLException;
-
- /**
- * This method tests whether or not the database supports cursors
- * remaining open across rollbacks.
- *
- * @return <code>true</code> if cursors can remain open across rollbacks,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsOpenCursorsAcrossRollback() throws SQLException;
-
- /**
- * This method tests whether or not the database supports statements
- * remaining open across commits.
- *
- * @return <code>true</code> if statements can remain open across commits,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsOpenStatementsAcrossCommit() throws SQLException;
-
- /**
- * This method tests whether or not the database supports statements
- * remaining open across rollbacks.
- *
- * @return <code>true</code> if statements can remain open across rollbacks,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsOpenStatementsAcrossRollback() throws SQLException;
-
- /**
- * This method returns the number of hex characters allowed in an inline
- * binary literal.
- *
- * @return The number of hex characters allowed in a binary literal, 0 meaning
- * either an unknown or unlimited number.
- * @exception SQLException If an error occurs.
- */
- int getMaxBinaryLiteralLength() throws SQLException;
-
- /**
- * This method returns the maximum length of a character literal.
- *
- * @return The maximum length of a character literal.
- * @exception SQLException If an error occurs.
- */
- int getMaxCharLiteralLength() throws SQLException;
-
- /**
- * This method returns the maximum length of a column name.
- *
- * @return The maximum length of a column name.
- * @exception SQLException If an error occurs.
- */
- int getMaxColumnNameLength() throws SQLException;
-
- /**
- * This method returns the maximum number of columns in a GROUP BY statement.
- *
- * @return The maximum number of columns in a GROUP BY statement.
- * @exception SQLException If an error occurs.
- */
- int getMaxColumnsInGroupBy() throws SQLException;
-
- /**
- * This method returns the maximum number of columns in an index.
- *
- * @return The maximum number of columns in an index.
- * @exception SQLException If an error occurs.
- */
- int getMaxColumnsInIndex() throws SQLException;
-
- /**
- * This method returns the maximum number of columns in an ORDER BY statement.
- *
- * @return The maximum number of columns in an ORDER BY statement.
- * @exception SQLException If an error occurs.
- */
- int getMaxColumnsInOrderBy() throws SQLException;
-
- /**
- * This method returns the maximum number of columns in a SELECT statement.
- *
- * @return The maximum number of columns in a SELECT statement.
- * @exception SQLException If an error occurs.
- */
- int getMaxColumnsInSelect() throws SQLException;
-
- /**
- * This method returns the maximum number of columns in a table.
- *
- * @return The maximum number of columns in a table.
- * @exception SQLException If an error occurs.
- */
- int getMaxColumnsInTable() throws SQLException;
-
- /**
- * This method returns the maximum number of connections this client
- * can have to the database.
- *
- * @return The maximum number of database connections.
- * @SQLException If an error occurs.
- */
- int getMaxConnections() throws SQLException;
-
- /**
- * This method returns the maximum length of a cursor name.
- *
- * @return The maximum length of a cursor name.
- * @exception SQLException If an error occurs.
- */
- int getMaxCursorNameLength() throws SQLException;
-
- /**
- * This method returns the maximum length of an index.
- *
- * @return The maximum length of an index.
- * @exception SQLException If an error occurs.
- */
- int getMaxIndexLength() throws SQLException;
-
- /**
- * This method returns the maximum length of a schema name.
- *
- * @return The maximum length of a schema name.
- * @exception SQLException If an error occurs.
- */
- int getMaxSchemaNameLength() throws SQLException;
-
- /**
- * This method returns the maximum length of a procedure name.
- *
- * @return The maximum length of a procedure name.
- * @exception SQLException If an error occurs.
- */
- int getMaxProcedureNameLength() throws SQLException;
-
- /**
- * This method returns the maximum length of a catalog name.
- *
- * @return The maximum length of a catalog name.
- * @exception SQLException If an error occurs.
- */
- int getMaxCatalogNameLength() throws SQLException;
-
- /**
- * This method returns the maximum size of a row in bytes.
- *
- * @return The maximum size of a row.
- * @exception SQLException If an error occurs.
- */
- int getMaxRowSize() throws SQLException;
-
- /**
- * This method tests whether or not the maximum row size includes BLOB's
- *
- * @return <code>true</code> if the maximum row size includes BLOB's,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean doesMaxRowSizeIncludeBlobs() throws SQLException;
-
- /**
- * This method includes the maximum length of a SQL statement.
- *
- * @return The maximum length of a SQL statement.
- * @exception SQLException If an error occurs.
- */
- int getMaxStatementLength() throws SQLException;
-
- /**
- * This method returns the maximum number of statements that can be
- * active at any time.
- *
- * @return The maximum number of statements that can be active at any time.
- * @exception SQLException If an error occurs.
- */
- int getMaxStatements() throws SQLException;
-
- /**
- * This method returns the maximum length of a table name.
- *
- * @return The maximum length of a table name.
- * @exception SQLException If an error occurs.
- */
- int getMaxTableNameLength() throws SQLException;
-
- /**
- * This method returns the maximum number of tables that may be referenced
- * in a SELECT statement.
- *
- * @return The maximum number of tables allowed in a SELECT statement.
- * @exception SQLException If an error occurs.
- */
- int getMaxTablesInSelect() throws SQLException;
-
- /**
- * This method returns the maximum length of a user name.
- *
- * @return The maximum length of a user name.
- * @exception SQLException If an error occurs.
- */
- int getMaxUserNameLength() throws SQLException;
-
- /**
- * This method returns the default transaction isolation level of the
- * database.
- *
- * @return The default transaction isolation level of the database.
- * @exception SQLException If an error occurs.
- * @see Connection
- */
- int getDefaultTransactionIsolation() throws SQLException;
-
- /**
- * This method tests whether or not the database supports transactions.
- *
- * @return <code>true</code> if the database supports transactions,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsTransactions() throws SQLException;
-
- /**
- * This method tests whether or not the database supports the specified
- * transaction isolation level.
- *
- * @param level The transaction isolation level.
- *
- * @return <code>true</code> if the specified transaction isolation level
- * is supported, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsTransactionIsolationLevel(int level) throws
- SQLException;
-
- /**
- * This method tests whether or not DDL and DML statements allowed within
- * the same transaction.
- *
- * @return <code>true</code> if DDL and DML statements are allowed in the
- * same transaction, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsDataDefinitionAndDataManipulationTransactions()
- throws SQLException;
-
- /**
- * This method tests whether or not only DML statement are allowed
- * inside a transaction.
- *
- * @return <code>true</code> if only DML statements are allowed in
- * transactions, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsDataManipulationTransactionsOnly() throws
- SQLException;
-
- /**
- * This method tests whether or not a DDL statement will cause the
- * current transaction to be automatically committed.
- *
- * @return <code>true</code> if DDL causes an immediate transaction commit,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean dataDefinitionCausesTransactionCommit() throws SQLException;
-
- /**
- * This method tests whether or not DDL statements are ignored in
- * transactions.
- *
- * @return <code>true</code> if DDL statements are ignored in transactions,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean dataDefinitionIgnoredInTransactions() throws SQLException;
-
- /**
- * This method returns a list of all the stored procedures matching the
- * specified pattern in the given schema and catalog. This is returned
- * a <code>ResultSet</code> with the following columns:
- * <p>
- * <ol>
- * <li>PROCEDURE_CAT - The catalog the procedure is in, which may be
- * <code>null</code>.</li>
- * <li>PROCEDURE_SCHEM - The schema the procedures is in, which may be
- * <code>null</code>.</li>
- * <li>PROCEDURE_NAME - The name of the procedure.</li>
- * <li>Unused</li>
- * <li>Unused</li>
- * <li>Unused</li>
- * <li>REMARKS - A description of the procedure</li>
- * <li>PROCEDURE_TYPE - Indicates the return type of the procedure, which
- * is one of the contstants defined in this class
- * (<code>procedureResultUnknown</code>, <code>procedureNoResult</code>, or
- * <code>procedureReturnsResult</code>).</li>
- * </ol>
- *
- * @param catalog The name of the catalog to return stored procedured from,
- * or "" to return procedures from all catalogs.
- * @param schemaPattern A schema pattern for the schemas to return stored
- * procedures from, or "" to return procedures from all schemas.
- * @param namePattern The pattern of procedures names to return.
- * @returns A <code>ResultSet</code> with all the requested procedures.
- * @exception SQLException If an error occurs.
- */
- ResultSet getProcedures(String catalog, String schemaPattern, String
- procedureNamePattern) throws SQLException;
-
- /**
- * This method returns a list of the parameter and result columns for
- * the requested stored procedures. This is returned in the form of a
- * <code>ResultSet</code> with the following columns:
- * <p>
- * <ol>
- * <li>PROCEDURE_CAT - The catalog the procedure is in, which may be
- * <code>null</code>.</li>
- * <li>PROCEDURE_SCHEM - The schema the procedures is in, which may be
- * <code>null</code>.</li>
- * <li>PROCEDURE_NAME - The name of the procedure.</li>
- * <li>COLUMN_NAME - The name of the column</li>
- * <li>COLUMN_TYPE - The type of the column, which will be one of the
- * contants defined in this class (<code>procedureColumnUnknown</code>,
- * <code>procedureColumnIn</code>, <code>procedureColumnInOut</code>,
- * <code>procedureColumnOut</code>, <code>procedureColumnReturn</code>,
- * or <code>procedureColumnResult</code>).</li>
- * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
- * defined in <code>Types</code>.</li>
- * <li>TYPE_NAME - The string name of the data type for this column.</li>
- * <li>PRECISION - The precision of the column.</li>
- * <li>LENGTH - The length of the column in bytes</li>
- * <li>SCALE - The scale of the column.</li>
- * <li>RADIX - The radix of the column.</li>
- * <li>NULLABLE - Whether or not the column is NULLABLE. This is one of
- * the constants defined in this class (<code>procedureNoNulls</code>,
- * <code>procedureNullable</code>, or <code>procedureNullableUnknown</code>)</li>
- * <li>REMARKS - A description of the column.</li>
- * </ol>
- *
- * @param catalog The name of the catalog to return stored procedured from,
- * or "" to return procedures from all catalogs.
- * @param schemaPattern A schema pattern for the schemas to return stored
- * procedures from, or "" to return procedures from all schemas.
- * @param namePattern The pattern of procedures names to return.
- * @param columnPattern The pattern of column names to return.
- * @returns A <code>ResultSet</code> with all the requested procedures.
- * @exception SQLException If an error occurs.
- */
- ResultSet getProcedureColumns(String catalog, String schemaPattern,
- String procedureNamePattern, String columnNamePattern) throws
- SQLException;
-
- /**
- * This method returns a list of the requested table as a
- * <code>ResultSet</code> with the following columns:
- *
- * <ol>
- * <li>TABLE_CAT - The catalog the table is in, which may be <code>null</code>.</li>
- * <li>TABLE_SCHEM - The schema the table is in, which may be <code>null</code>.</li>
- * <li>TABLE_NAME - The name of the table.</li>
- * <li>TABLE_TYPE - A string describing the table type. This will be one
- * of the values returned by the <code>getTableTypes()</code> method.</li>
- * <li>REMARKS - Comments about the table.</li>
- * </ol>
- *
- * @param catalog The name of the catalog to return tables from,
- * or "" to return tables from all catalogs.
- * @param schemaPattern A schema pattern for the schemas to return tables
- * from, or "" to return tables from all schemas.
- * @param namePattern The pattern of table names to return.
- * @param types The list of table types to include; null returns all types.
- * @returns A <code>ResultSet</code> with all the requested tables.
- * @exception SQLException If an error occurs.
- */
- ResultSet getTables(String catalog, String schemaPattern, String
- tableNamePattern, String[] types) throws SQLException;
-
- /**
- * This method returns the list of database schemas as a
- * <code>ResultSet</code>, with one column - TABLE_SCHEM - that is the
- * name of the schema.
- *
- * @return A <code>ResultSet</code> with all the requested schemas.
- * @exception SQLException If an error occurs.
- */
- ResultSet getSchemas() throws SQLException;
-
- /**
- * This method returns the list of database catalogs as a
- * <code>ResultSet</code> with one column - TABLE_CAT - that is the
- * name of the catalog.
- *
- * @return A <code>ResultSet</code> with all the requested catalogs.
- * @exception SQLException If an error occurs.
- */
- ResultSet getCatalogs() throws SQLException;
-
- /**
- * This method returns the list of database table types as a
- * <code>ResultSet</code> with one column - TABLE_TYPE - that is the
- * name of the table type.
- *
- * @return A <code>ResultSet</code> with all the requested table types.
- * @exception SQLException If an error occurs.
- */
- ResultSet getTableTypes() throws SQLException;
-
- /**
- * This method returns a list of the tables columns for
- * the requested tables. This is returned in the form of a
- * <code>ResultSet</code> with the following columns:
- * <p>
- * <ol>
- * <li>TABLE_CAT - The catalog the table is in, which may be
- * <code>null</code>.</li>
- * <li>TABLE_SCHEM - The schema the tables is in, which may be
- * <code>null</code>.</li>
- * <li>TABLE_NAME - The name of the table.</li>
- * <li>COLUMN_NAME - The name of the column</li>
- * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
- * defined in <code>Types</code>.</li>
- * <li>TYPE_NAME - The string name of the data type for this column.</li>
- * <li>COLUMN_SIZE - The size of the column.</li>
- * <li>Unused</li>
- * <li>NUM_PREC_RADIX - The radix of the column.</li>
- * <li>NULLABLE - Whether or not the column is NULLABLE. This is one of
- * the constants defined in this class (<code>tableNoNulls</code>,
- * <code>tableNullable</code>, or <code>tableNullableUnknown</code>)</li>
- * <li>REMARKS - A description of the column.</li>
- * <li>COLUMN_DEF - The default value for the column, may be <code>null</code>.</li>
- * <li>SQL_DATA_TYPE - Unused</li>
- * <li>SQL_DATETIME_SUB - Unused</li>
- * <li>CHAR_OCTET_LENGTH - For character columns, the maximum number of bytes
- * in the column.</li>
- * <li>ORDINAL_POSITION - The index of the column in the table.</li>
- * <li>IS_NULLABLE - "NO" means no, "YES" means maybe, and an empty string
- * means unknown.</li>
- * </ol>
- *
- * @param catalog The name of the catalog to return table from,
- * or "" to return tables from all catalogs.
- * @param schemaPattern A schema pattern for the schemas to return
- * tables from, or "" to return tables from all schemas.
- * @param namePattern The pattern of tables names to return.
- * @param columnPattern The pattern of column names to return.
- * @returns A <code>ResultSet</code> with all the requested tables.
- * @exception SQLException If an error occurs.
- */
- ResultSet getColumns(String catalog, String schemaPattern, String
- tableNamePattern, String columnNamePattern) throws SQLException;
-
- /**
- * This method returns the access rights that have been granted to the
- * requested columns. This information is returned as a <code>ResultSet</code>
- * with the following columns:
- *
- * <ol>
- * <li>TABLE_CAT - The catalog the table is in, which may be
- * <code>null</code>.</li>
- * <li>TABLE_SCHEM - The schema the tables is in, which may be
- * <code>null</code>.</li>
- * <li>TABLE_NAME - The name of the table.</li>
- * <li>COLUMN_NAME - The name of the column.</li>
- * <li>GRANTOR - The entity that granted the access.</li>
- * <li>GRANTEE - The entity granted the access.</li>
- * <li>PRIVILEGE - The name of the privilege granted.</li>
- * <li>IS_GRANTABLE - "YES" if the grantee can grant the privilege to
- * others, "NO" if not, and <code>null</code> if unknown.</li>
- * </ol>
- *
- * @param catalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or <code>null</code>
- * to return information from all catalogs.
- * @param schema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema.
- * @param table The table name to return information for.
- * @param columnPattern A pattern of column names to return information for.
- * @return A <code>ResultSet</code> with all the requested privileges.
- * @exception SQLException If an error occurs.
- */
- ResultSet getColumnPrivileges(String catalog, String schema, String
- table, String columnNamePattern) throws SQLException;
-
- /**
- * This method returns the access rights that have been granted to the
- * requested tables. This information is returned as a <code>ResultSet</code>
- * with the following columns:
- *
- * <ol>
- * <li>TABLE_CAT - The catalog the table is in, which may be
- * <code>null</code>.</li>
- * <li>TABLE_SCHEM - The schema the tables is in, which may be
- * <code>null</code>.</li>
- * <li>TABLE_NAME - The name of the table.</li>
- * <li>GRANTOR - The entity that granted the access.</li>
- * <li>GRANTEE - The entity granted the access.</li>
- * <li>PRIVILEGE - The name of the privilege granted.</li>
- * <li>IS_GRANTABLE - "YES" if the grantee can grant the privilege to
- * others, "NO" if not, and <code>null</code> if unknown.</li>
- * </ol>
- *
- * @param catalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or <code>null</code>
- * to return information from all catalogs.
- * @param schema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema.
- * @param tablePattern The table name pattern of tables to return
- * information for.
- * @return A <code>ResultSet</code> with all the requested privileges.
- * @exception SQLException If an error occurs.
- */
- ResultSet getTablePrivileges(String catalog, String schemaPattern,
- String tableNamePattern) throws SQLException;
-
- /**
- * This method returns the best set of columns for uniquely identifying
- * a row. It returns this information as a <code>ResultSet</code> with
- * the following columns:
- *
- * <ol>
- * <li>SCOPE - The scope of the results returned. This is one of the
- * constants defined in this class (<code>bestRowTemporary</code>,
- * <code>bestRowTransaction</code>, or <code>bestRowSession</code>).</li>
- * <li>COLUMN_NAME - The name of the column.</li>
- * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
- * defined in <code>Types</code>.</li>
- * <li>TYPE_NAME - The string name of the data type for this column.</li>
- * <li>COLUMN_SIZE - The precision of the columns</li>
- * <li>BUFFER_LENGTH - Unused</li>
- * <li>DECIMAL_DIGITS - The scale of the column.</li>
- * <li>PSEUDO_COLUMN - Whether or not the best row identifier is a
- * pseudo_column. This is one of the constants defined in this class
- * (<code>bestRowUnknown</code>, <code>bestRowNotPseudo</code>, or
- * <code>bestRowPseudo</code>).</li>
- * </ol>
- *
- * @param catalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or <code>null</code>
- * to return information from all catalogs.
- * @param schema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema.
- * @param table The table name to return information for.
- * @param columnPattern A pattern of column names to return information for.
- * @param scope One of the best row id scope constants from this class.
- * @param nullable <code>true</code> to include columns that are nullable,
- * <code>false</code> otherwise.
- * @return A <code>ResultSet</code> with the best row identifier.
- * @exception SQLException If an error occurs.
- */
- ResultSet getBestRowIdentifier(String catalog, String schema,
- String table, int scope, boolean nullable) throws SQLException;
-
- /**
- * This method returns the set of columns that are automatically updated
- * when the row is update. It returns this information as a
- * <code>ResultSet</code> with the following columns:
- *
- * <ol>
- * <li>SCOPE - Unused</li>
- * <li>COLUMN_NAME - The name of the column.</li>
- * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
- * defined in <code>Types</code>.</li>
- * <li>TYPE_NAME - The string name of the data type for this column.</li>
- * <li>COLUMN_SIZE - The precision of the columns</li>
- * <li>BUFFER_LENGTH - Unused</li>
- * <li>DECIMAL_DIGITS - The scale of the column.</li>
- * <li>PSEUDO_COLUMN - Whether or not the best row identifier is a
- * pseudo_column. This is one of the constants defined in this class
- * (<code>versionRowUnknown</code>, <code>versionRowNotPseudo</code>, or
- * <code>versionRowPseudo</code>).</li>
- * </ol>
- *
- * @param catalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or <code>null</code>
- * to return information from all catalogs.
- * @param schema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema.
- * @param table The table name to return information for.
- * @param columnPattern A pattern of column names to return information for.
- * @return A <code>ResultSet</code> with the version columns.
- * @exception SQLException If an error occurs.
- */
- ResultSet getVersionColumns(String catalog, String schema,
- String table) throws SQLException;
-
- /**
- * This method returns a list of a table's primary key columns. These
- * are returned as a <code>ResultSet</code> with the following columns.
- *
- * <ol>
- * <li>TABLE_CAT - The catalog of the table, which may be <code>null</code>.</li>
- * <li>TABLE_SCHEM - The schema of the table, which may be <code>null</code>.</li>
- * <li>TABLE_NAME - The name of the table.</li>
- * <li>COLUMN_NAME - The name of the column.</li>
- * <li>KEY_SEQ - The sequence number of the column within the primary key.</li>
- * <li>PK_NAME - The name of the primary key, which may be <code>null</code>.</li>
- * </ol>
- *
- * @param catalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or <code>null</code>
- * to return information from all catalogs.
- * @param schema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema.
- * @param table The table name to return information for.
- * @param columnPattern A pattern of column names to return information for.
- * @return A <code>ResultSet</code> with the primary key columns.
- * @exception SQLException If an error occurs.
- */
- ResultSet getPrimaryKeys(String catalog, String schema, String table)
- throws SQLException;
-
- /**
- * This method returns a list of the table's foreign keys. These are
- * returned as a <code>ResultSet</code> with the following columns:
- *
- * <ol>
- * <li>PKTABLE_CAT - The catalog of the table the key was imported from.</li>
- * <li>PKTABLE_SCHEM - The schema of the table the key was imported from.</li>
- * <li>PKTABLE_NAME - The name of the table the key was imported from.</li>
- * <li>PKCOLUMN_NAME - The name of the column that was imported.</li>
- * <li>FKTABLE_CAT - The foreign key catalog name.</li>
- * <li>FKTABLE_SCHEM - The foreign key schema name.</li>
- * <li>FKTABLE_NAME - The foreign key table name.</li>
- * <li>FKCOLUMN_NAME - The foreign key column name.</li>
- * <li>KEY_SEQ - The sequence number of the column within the foreign key.</li>
- * <li>UPDATE_RULE - How the foreign key behaves when the primary key is
- * updated. This is one of the constants defined in this class
- * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
- * <code>importedKeySetNull</code>, <code>importedKeySetDefault</code>, or
- * <code>importedKeyRestrict</code>).</li>
- * <li>DELETE_RULE - How the foreign key behaves when the primary key is
- * deleted. This is one of the constants defined in this class
- * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
- * <code>importedKeySetNull</code>, or <code>importedKeySetDefault</code>)</li>
- * <li>FK_NAME - The name of the foreign key.</li>
- * <li>PK_NAME - The name of the primary key.</li>
- * <li>DEFERRABILITY - The deferrability value. This is one of the
- * constants defined in this table (<code>importedKeyInitiallyDeferred</code>,
- * <code>importedKeyInitiallyImmediate</code>, or
- * <code>importedKeyNotDeferrable</code>).</li>
- * </ol>
- *
- * @param catalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or <code>null</code>
- * to return information from all catalogs.
- * @param schema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema.
- * @param table The table name to return information for.
- *
- * @return A <code>ResultSet</code> with the foreign key columns.
- *
- * @exception SQLException If an error occurs.
- */
- ResultSet getImportedKeys(String catalog, String schema,
- String table) throws SQLException;
-
- /**
- * This method returns a list of the table's which use this table's
- * primary key as a foreign key. The information is
- * returned as a <code>ResultSet</code> with the following columns:
- *
- * <ol>
- * <li>PKTABLE_CAT - The catalog of the table the key was imported from.</li>
- * <li>PKTABLE_SCHEM - The schema of the table the key was imported from.</li>
- * <li>PKTABLE_NAME - The name of the table the key was imported from.</li>
- * <li>PKCOLUMN_NAME - The name of the column that was imported.</li>
- * <li>FKTABLE_CAT - The foreign key catalog name.</li>
- * <li>FKTABLE_SCHEM - The foreign key schema name.</li>
- * <li>FKTABLE_NAME - The foreign key table name.</li>
- * <li>FKCOLUMN_NAME - The foreign key column name.</li>
- * <li>KEY_SEQ - The sequence number of the column within the foreign key.</li>
- * <li>UPDATE_RULE - How the foreign key behaves when the primary key is
- * updated. This is one of the constants defined in this class
- * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
- * <code>importedKeySetNull</code>, <code>importedKeySetDefault</code>, or
- * <code>importedKeyRestrict</code>).</li>
- * <li>DELETE_RULE - How the foreign key behaves when the primary key is
- * deleted. This is one of the constants defined in this class
- * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
- * <code>importedKeySetNull</code>, or <code>importedKeySetDefault</code>)</li>
- * <li>FK_NAME - The name of the foreign key.</li>
- * <li>PK_NAME - The name of the primary key.</li>
- * <li>DEFERRABILITY - The deferrability value. This is one of the
- * constants defined in this table (<code>importedKeyInitiallyDeferred</code>,
- * <code>importedKeyInitiallyImmediate</code>, or
- * <code>importedKeyNotDeferrable</code>).</li>
- * </ol>
- *
- * @param catalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or <code>null</code>
- * to return information from all catalogs.
- * @param schema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema.
- * @param table The table name to return information for.
- * @return A <code>ResultSet</code> with the requested information
- * @exception SQLException If an error occurs.
- */
- ResultSet getExportedKeys(String catalog, String schema,
- String table) throws SQLException;
-
- /**
- * This method returns a description of how one table imports another
- * table's primary key as a foreign key. The information is
- * returned as a <code>ResultSet</code> with the following columns:
- *
- * <ol>
- * <li>PKTABLE_CAT - The catalog of the table the key was imported from.</li>
- * <li>PKTABLE_SCHEM - The schema of the table the key was imported from.</li>
- * <li>PKTABLE_NAME - The name of the table the key was imported from.</li>
- * <li>PKCOLUMN_NAME - The name of the column that was imported.</li>
- * <li>FKTABLE_CAT - The foreign key catalog name.</li>
- * <li>FKTABLE_SCHEM - The foreign key schema name.</li>
- * <li>FKTABLE_NAME - The foreign key table name.</li>
- * <li>FKCOLUMN_NAME - The foreign key column name.</li>
- * <li>KEY_SEQ - The sequence number of the column within the foreign key.</li>
- * <li>UPDATE_RULE - How the foreign key behaves when the primary key is
- * updated. This is one of the constants defined in this class
- * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
- * <code>importedKeySetNull</code>, <code>importedKeySetDefault</code>, or
- * <code>importedKeyRestrict</code>).</li>
- * <li>DELETE_RULE - How the foreign key behaves when the primary key is
- * deleted. This is one of the constants defined in this class
- * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
- * <code>importedKeySetNull</code>, or <code>importedKeySetDefault</code>)</li>
- * <li>FK_NAME - The name of the foreign key.</li>
- * <li>PK_NAME - The name of the primary key.</li>
- * <li>DEFERRABILITY - The deferrability value. This is one of the
- * constants defined in this table (<code>importedKeyInitiallyDeferred</code>,
- * <code>importedKeyInitiallyImmediate</code>, or
- * <code>importedKeyNotDeferrable</code>).</li>
- * </ol>
- *
- * @param primCatalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or <code>null</code>
- * to return information from all catalogs, on the exporting side.
- * @param primSchema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema, on the exporting side.
- * @param primTable The table name to return information for, on the exporting
- * side.
- * @param forCatalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or <code>null</code>
- * to return information from all catalogs, on the importing side.
- * @param forSchema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema on the importing side.
- * @param forTable The table name to return information for on the importing
- * side.
- * @return A <code>ResultSet</code> with the requested information
- * @exception SQLException If an error occurs.
- */
- ResultSet getCrossReference(String primaryCatalog, String
- primarySchema, String primaryTable, String foreignCatalog, String
- foreignSchema, String foreignTable) throws SQLException;
-
- /**
- * This method returns a list of the SQL types supported by this
- * database. The information is returned as a <code>ResultSet</code>
- * with the following columns:
- *
- * <ol>
- * <li>TYPE_NAME - The name of the data type.</li>
- * <li>DATA_TYPE - A data type constant from <code>Types</code> for this
- * type.</li>
- * <li>PRECISION - The maximum precision of this type.</li>
- * <li>LITERAL_PREFIX - Prefix value used to quote a literal, which may be
- * <code>null</code>.</li>
- * <li>LITERAL_SUFFIX - Suffix value used to quote a literal, which may be
- * <code>null</code>.</li>
- * <li>CREATE_PARAMS - The parameters used to create the type, which may be
- * <code>null</code>.</li>
- * <li>NULLABLE - Whether or not this type supports NULL values. This will
- * be one of the constants defined in this interface
- * (<code>typeNoNulls</code>, <code>typeNullable</code>, or
- * <code>typeNullableUnknown</code>).</li>
- * <li>CASE_SENSITIVE - Whether or not the value is case sensitive.</li>
- * <li>SEARCHABLE - Whether or not "LIKE" expressions are supported in
- * WHERE clauses for this type. This will be one of the constants defined
- * in this interface (<code>typePredNone</code>, <code>typePredChar</code>,
- * <code>typePredBasic</code>, or <code>typeSearchable</code>).</li>
- * <li>UNSIGNED_ATTRIBUTE - Is the value of this type unsigned.</li>
- * <li>FIXED_PREC_SCALE - Whether or not this type can be used for money.</li>
- * <li>AUTO_INCREMENT - Whether or not this type supports auto-incrementing.</li>
- * <li>LOCAL_TYPE_NAME - A localized name for this data type.</li>
- * <li>MINIMUM_SCALE - The minimum scale supported by this type.</li>
- * <li>MAXIMUM_SCALE - The maximum scale supported by this type.</li>
- * <li>SQL_DATA_TYPE - Unused.</li>
- * <li>SQL_DATETIME_SUB - Unused.</li>
- * <li>NUM_PREC_RADIX - The radix of this data type.</li>
- * </ol>
- *
- * @return A <code>ResultSet</code> with the list of available data types.
- * @exception SQLException If an error occurs.
- */
- ResultSet getTypeInfo() throws SQLException;
-
- /**
- * This method returns information about a tables indices and statistics.
- * It is returned as a <code>ResultSet</code> with the following columns:
- *
- * <ol>
- * <li>TABLE_CAT - The catalog of the table, which may be <code>null</code>.</li>
- * <li>TABLE_SCHEM - The schema of the table, which may be <code>null</code>.</li>
- * <li>TABLE_NAME - The name of the table.</li>
- * <li>NON_UNIQUE - Are index values non-unique?</li>
- * <li>INDEX_QUALIFIER The index catalog, which may be <code>null</code></li>
- * <li>INDEX_NAME - The name of the index.</li>
- * <li>TYPE - The type of index, which will be one of the constants defined
- * in this interface (<code>tableIndexStatistic</code>,
- * <code>tableIndexClustered</code>, <code>tableIndexHashed</code>, or
- * <code>tableIndexOther</code>).</li>
- * <li>ORDINAL_POSITION - The sequence number of this column in the index.
- * This will be 0 when the index type is <code>tableIndexStatistic</code>.</li>
- * <li>COLUMN_NAME - The name of this column in the index.</li>
- * <li>ASC_OR_DESC - "A" for an ascending sort sequence, "D" for a
- * descending sort sequence or <code>null</code> if a sort sequence is not
- * supported.</li>
- * <li>CARDINALITY - The number of unique rows in the index, or the number
- * of rows in the table if the index type is <code>tableIndexStatistic</code>.</li>
- * <li>PAGES - The number of pages used for the index, or the number of pages
- * in the table if the index type is <code>tableIndexStatistic</code>.</li>
- * <li>FILTER_CONDITION - The filter condition for this index, which may be
- * <code>null</code>.</li>
- * </ol>
- *
- * @param catalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or
- * <code>null</code> to return information from all catalogs.
- * @param schema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema.
- * @param table The table name to return information for.
- * @param unique <code>true</code> to return only unique indexes,
- * <code>false</code> otherwise.
- * @param approx <code>true</code> if data values can be approximations,
- * <code>false</code> otherwise.
- * @return A <code>ResultSet</code> with the requested index information
- * @exception SQLException If an error occurs.
- */
- ResultSet getIndexInfo(String catalog, String schema, String table,
- boolean unique, boolean approximate) throws SQLException;
-
- /**
- * This method tests whether or not the datbase supports the specified
- * result type.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- *
- * @return <code>true</code> if the result set type is supported,
- * <code>false</code> otherwise.
- *
- * @exception SQLException If an error occurs.
- *
- * @see ResultSet
- */
- boolean supportsResultSetType(int type) throws SQLException;
-
- /**
- * This method tests whether the specified result set type and result set
- * concurrency type are supported by the database.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @param concur The desired concurrency type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @return <code>true</code> if the result set type is supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- boolean supportsResultSetConcurrency(int type, int concurrency)
- throws SQLException;
-
- /**
- * This method tests whether or not the specified result set type sees its
- * own updates.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @return <code>true</code> if the result set type sees its own updates,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- boolean ownUpdatesAreVisible(int type) throws SQLException;
-
- /**
- * This method tests whether or not the specified result set type sees its
- * own deletes.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @return <code>true</code> if the result set type sees its own deletes,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- boolean ownDeletesAreVisible(int type) throws SQLException;
-
- /**
- * This method tests whether or not the specified result set type sees its
- * own inserts.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @return <code>true</code> if the result set type sees its own inserts,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- boolean ownInsertsAreVisible(int type) throws SQLException;
-
- /**
- * This method tests whether or not the specified result set type sees
- * updates committed by others.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @return <code>true</code> if the result set type sees other updates,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- boolean othersUpdatesAreVisible(int type) throws SQLException;
-
- /**
- * This method tests whether or not the specified result set type sees
- * deletes committed by others.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @return <code>true</code> if the result set type sees other deletes,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- boolean othersDeletesAreVisible(int type) throws SQLException;
-
- /**
- * This method tests whether or not the specified result set type sees
- * inserts committed by others.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @return <code>true</code> if the result set type sees other inserts,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- boolean othersInsertsAreVisible(int type) throws SQLException;
-
- /**
- * This method tests whether or not the specified result set type can detect
- * a visible update by calling the <code>rowUpdated</code> method.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @return <code>true</code> if the result set type can detect visible updates
- * using <code>rowUpdated</code>, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- boolean updatesAreDetected(int type) throws SQLException;
-
- /**
- * This method tests whether or not the specified result set type can detect
- * a visible delete by calling the <code>rowUpdated</code> method.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @return <code>true</code> if the result set type can detect visible deletes
- * using <code>rowUpdated</code>, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- boolean deletesAreDetected(int type) throws SQLException;
-
- /**
- * This method tests whether or not the specified result set type can detect
- * a visible insert by calling the <code>rowUpdated</code> method.
- *
- * @param type The desired result type, which is one of the constants
- * defined in <code>ResultSet</code>.
- * @return <code>true</code> if the result set type can detect visible inserts
- * using <code>rowUpdated</code>, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- boolean insertsAreDetected(int type) throws SQLException;
-
- /**
- * This method tests whether or not the database supports batch updates.
- *
- * @return <code>true</code> if batch updates are supported,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean supportsBatchUpdates() throws SQLException;
-
- /**
- * This method returns the list of user defined data types in use. These
- * are returned as a <code>ResultSet</code> with the following columns:
- *
- * <ol>
- * <li>TYPE_CAT - The catalog name, which may be <code>null</code>.</li>
- * <li>TYPE_SCEHM - The schema name, which may be <code>null</code>.</li>
- * <li>TYPE_NAME - The user defined data type name.</li>
- * <li>CLASS_NAME - The Java class name this type maps to.</li>
- * <li>DATA_TYPE - A type identifier from <code>Types</code> for this type.
- * This will be one of <code>JAVA_OBJECT</code>, <code>STRUCT</code>, or
- * <code>DISTINCT</code>.</li>
- * <li>REMARKS - Comments about this data type.</li>
- * </ol>
- *
- * @param catalog The catalog to retrieve information from, or the empty string
- * to return entities not associated with a catalog, or <code>null</code>
- * to return information from all catalogs.
- * @param schema The schema to retrieve information from, or the empty string
- * to return entities not associated with a schema.
- * @param typePattern The type name pattern to match.
- * @param types The type identifier patterns (from <code>Types</code>) to
- * match.
- * @return A <code>ResultSet</code> with the requested type information
- * @exception SQLException If an error occurs.
- */
- ResultSet getUDTs(String catalog, String schemaPattern, String
- typeNamePattern, int[] types) throws SQLException;
-
- /**
- * This method returns the <code>Connection</code> object that was used
- * to generate the metadata in this object.
- *
- * @return The connection for this object.
- * @exception SQLException If an error occurs.
- */
- Connection getConnection() throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean supportsSavepoints() throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean supportsNamedParameters() throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean supportsMultipleOpenResults() throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean supportsGetGeneratedKeys() throws SQLException;
-
- /**
- * @since 1.4
- */
- ResultSet getSuperTypes(String catalog, String schemaPattern,
- String typeNamePattern) throws SQLException;
-
- /**
- * @since 1.4
- */
- ResultSet getSuperTables(String catalog, String schemaPattern,
- String tableNamePattern) throws SQLException;
-
- /**
- * @since 1.4
- */
- ResultSet getAttributes(String catalog, String schemaPattern, String
- typeNamePattern, String attributeNamePattern) throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean supportsResultSetHoldability(int holdability)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- int getResultSetHoldability() throws SQLException;
-
- /**
- * @since 1.4
- */
- int getDatabaseMajorVersion() throws SQLException;
-
- /**
- * @since 1.4
- */
- int getDatabaseMinorVersion() throws SQLException;
-
- /**
- * @since 1.4
- */
- int getJDBCMajorVersion() throws SQLException;
-
- /**
- * @since 1.4
- */
- int getJDBCMinorVersion() throws SQLException;
-
- /**
- * @since 1.4
- */
- int getSQLStateType() throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean locatorsUpdateCopy() throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean supportsStatementPooling() throws SQLException;
-}
diff --git a/libjava/java/sql/Date.java b/libjava/java/sql/Date.java
deleted file mode 100644
index 48a274f331e..00000000000
--- a/libjava/java/sql/Date.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/* Date.java -- Wrapper around java.util.Date
- Copyright (C) 1999, 2000, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-
-/**
- * This class is a wrapper around java.util.Date to allow the JDBC
- * driver to identify the value as a SQL Date.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Date extends java.util.Date
-{
- static final long serialVersionUID = 1511598038487230103L;
-
- /**
- * Used for parsing and formatting this date.
- */
- private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
- /**
- * This method initializes a new instance of this class with the
- * specified year, month, and day.
- *
- * @param year The year of this date minue 1900.
- * @param month The month of this date (0-11).
- * @param day The day of this date (1-31).
- *
- * @deprecated
- */
- public Date(int year, int month, int day)
- {
- super(year, month, day);
- }
-
- /**
- * This method initializes a new instance of this class with the
- * specified time value representing the number of seconds since
- * Jan 1, 1970 at 12:00 midnight GMT.
- *
- * @param time The time value to intialize this date to.
- */
- public Date(long date)
- {
- super(date);
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public int getHours() throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public int getMinutes() throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public int getSeconds() throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public void setHours(int newValue) throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public void setMinutes(int newValue) throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public void setSeconds(int newValue) throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method returns a new instance of this class by parsing a
- * date in JDBC format into a Java date.
- *
- * @param str The string to parse.
- * @return The resulting <code>java.sql.Date</code> value.
- *
- * @deprecated
- */
- public static Date valueOf (String str)
- {
- try
- {
- java.util.Date d = (java.util.Date) sdf.parseObject(str);
-
- if (d == null)
- throw new IllegalArgumentException(str);
- else
- return new Date(d.getTime());
- }
- catch (ParseException e)
- {
- throw new IllegalArgumentException(str);
- }
- }
-
- /**
- * This method returns this date in JDBC format.
- *
- * @return This date as a string.
- *
- * @deprecated
- */
- public String toString()
- {
- return sdf.format(this);
- }
-}
diff --git a/libjava/java/sql/Driver.java b/libjava/java/sql/Driver.java
deleted file mode 100644
index 10f83ef2f8b..00000000000
--- a/libjava/java/sql/Driver.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/* Driver.java -- A JDBC driver
- Copyright (C) 1999, 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.util.Properties;
-
-/**
- * This interface specifies a mechanism for accessing a JDBC database
- * driver. When the class implementing this method is loaded, it should
- * register an instance of itself with the <code>DriverManager</code> in
- * a static initializer.
- * <p>
- * Because the <code>DriverManager</code> might attempt to use several
- * drivers to find one that can connect to the requested database,
- * this driver should not cause large numbers of classes and code to
- * be loaded. If another driver is the one that ends up performing the
- * request, any loading done by this driver would be wasted.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Driver
-{
- /**
- * This method connects to the specified database using the connection
- * properties supplied. If the driver does not understand the database
- * URL, it should return <code>null</code> instead of throwing an
- * exception since the <code>DriverManager</code> will probe a driver
- * in this manner.
- *
- * @param url The URL string for this connection.
- * @param properties The list of database connection properties.
- * @return A <code>Connection</code> object for the newly established
- * connection, or <code>null</code> if the URL is not understood.
- * @exception SQLException If an error occurs.
- */
- Connection connect(String url, Properties info) throws SQLException;
-
- /**
- * This method tests whether or not the driver believes it can connect to
- * the specified database. The driver should only test whether it
- * understands and accepts the URL. It should not necessarily attempt to
- * probe the database for a connection.
- *
- * @param The database URL string.
- * @return <code>true</code> if the drivers can connect to the database,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean acceptsURL(String url) throws SQLException;
-
- /**
- * This method returns an array of possible properties that could be
- * used to connect to the specified database.
- *
- * @param url The URL string of the database to connect to.
- * @param properties The list of properties the caller is planning to use
- * to connect to the database.
- * @return A list of possible additional properties for a connection to this
- * database. This list may be empty.
- * @exception SQLException If an error occurs.
- */
- DriverPropertyInfo[] getPropertyInfo(String url, Properties properties)
- throws SQLException;
-
- /**
- * This method returns the major version number of the driver.
- *
- * @return The major version number of the driver.
- */
- int getMajorVersion();
-
- /**
- * This method returns the minor version number of the driver.
- *
- * @return The minor version number of the driver.
- */
- int getMinorVersion();
-
- /**
- * This method tests whether or not the driver is JDBC compliant. This
- * method should only return <code>true</code> if the driver has been
- * certified as JDBC compliant.
- *
- * @return <code>true</code> if the driver has been certified JDBC compliant,
- * <code>false</code> otherwise.
- */
- boolean jdbcCompliant();
-}
diff --git a/libjava/java/sql/DriverManager.java b/libjava/java/sql/DriverManager.java
deleted file mode 100644
index 9e252abcc60..00000000000
--- a/libjava/java/sql/DriverManager.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/* DriverManager.java -- Manage JDBC drivers
- Copyright (C) 1999, 2000, 2001, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-/**
- * This class manages the JDBC drivers in the system. It maintains a
- * registry of drivers and locates the appropriate driver to handle a
- * JDBC database URL.
- * <p>
- * On startup, <code>DriverManager</code> loads all the managers specified
- * by the system property <code>jdbc.drivers</code>. The value of this
- * property should be a colon separated list of fully qualified driver
- * class names. Additional drivers can be loaded at any time by
- * simply loading the driver class with <code>class.forName(String)</code>.
- * The driver should automatically register itself in a static
- * initializer.
- * <p>
- * The methods in this class are all <code>static</code>. This class
- * cannot be instantiated.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class DriverManager
-{
- /**
- * This is the log stream for JDBC drivers.
- */
- private static PrintStream log_stream;
-
- /**
- * This is the log writer for JDBC drivers.
- */
- private static PrintWriter log_writer;
-
- /**
- * This is the login timeout used by JDBC drivers.
- */
- private static int login_timeout;
-
- /**
- * This is the list of JDBC drivers that are loaded.
- */
- private static Vector drivers;
- // Hmm, seems like we might want to do a Hashtable and lookup by something,
- // but what would it be?
-
- // Load all drivers on startup
- static
- {
- drivers = new Vector();
-
- String driver_string = System.getProperty("jdbc.drivers");
- if (driver_string != null)
- {
- StringTokenizer st = new StringTokenizer(driver_string);
- while (st.hasMoreTokens())
- {
- String driver_classname = st.nextToken();
-
- try
- {
- Class.forName(driver_classname); // The driver registers itself
- }
- catch (Exception e)
- {
- // Ignore not founds
- }
- }
- }
-
- }
-
- /** Can't be instantiated. */
- private DriverManager()
- {
- }
-
- /**
- * This method returns the log writer being used by all JDBC drivers.
- * This method should be used in place of the deprecated
- * <code>getLogStream</code> method.
- *
- * @return The log writer in use by JDBC drivers.
- */
- public static PrintWriter getLogWriter()
- {
- return log_writer;
- }
-
- /**
- * This method sets the log writer being used by JDBC drivers. This is a
- * system-wide parameter that affects all drivers. Note that since there
- * is no way to retrieve a <code>PrintStream</code> from a
- * <code>PrintWriter</code>, this method cannot set the log stream in
- * use by JDBC. Thus any older drivers may not see this setting.
- *
- * @param out The new log writer for JDBC.
- */
- public static void setLogWriter(PrintWriter out)
- {
- DriverManager.log_writer = out;
- }
-
-/**
- * This method attempts to return a connection to the specified
- * JDBC URL string using the specified connection properties.
- *
- * @param url The JDBC URL string to connect to.
- * @param properties The connection properties.
- *
- * @return A <code>Connection</code> to that URL.
- *
- * @exception SQLException If an error occurs.
- */
- public static Connection getConnection(String url, Properties properties)
- throws SQLException
- {
- Driver d = getDriver(url);
- if (d == null)
- throw new SQLException("Driver not found for URL: " + url);
-
- return d.connect(url, properties);
- }
-
-
- /**
- * This method attempts to return a connection to the specified
- * JDBC URL string using the specified username and password.
- *
- * @param url The JDBC URL string to connect to.
- * @param user The username to connect with.
- * @param password The password to connect with.
- * @return A <code>Connection</code> to that URL.
- * @exception SQLException If an error occurs.
- */
- public static Connection getConnection(String url, String user,
- String password) throws SQLException
- {
- Properties p = new Properties();
-
- if (user != null)
- p.setProperty("user", user);
- if (password != null)
- p.setProperty("password", password);
-
- return getConnection(url, p);
- }
-
- /**
- * This method attempts to return a connection to the specified
- * JDBC URL string.
- *
- * @param url The JDBC URL string to connect to.
- *
- * @return A <code>Connection</code> to that URL.
- *
- * @exception SQLException If an error occurs.
- */
- public static Connection getConnection(String url) throws SQLException
- {
- return getConnection(url, new Properties());
- }
-
- /**
- * This method returns a driver that can connect to the specified
- * JDBC URL string. This will be selected from among drivers loaded
- * at initialization time and those drivers manually loaded by the
- * same class loader as the caller.
- *
- * @param url The JDBC URL string to find a driver for.
- *
- * @return A <code>Driver</code> that can connect to the specified
- * URL.
- *
- * @exception SQLException If an error occurs, or no suitable driver can be found.
- */
- public static Driver getDriver(String url) throws SQLException
- {
- // FIXME: Limit driver search to the appropriate subset of loaded drivers.
- Enumeration e = drivers.elements();
- while(e.hasMoreElements())
- {
- Driver d = (Driver)e.nextElement();
- if (d.acceptsURL(url))
- return d;
- }
-
- throw new SQLException("No driver found for " + url);
- }
-
- /**
- * This method registers a new driver with the manager. This is normally
- * called by the driver itself in a static initializer.
- *
- * @param driver The new <code>Driver</code> to add.
- *
- * @exception SQLException If an error occurs.
- */
- public static void registerDriver(Driver driver) throws SQLException
- {
- if (! drivers.contains(driver))
- drivers.addElement(driver);
- }
-
-/**
- * This method de-registers a driver from the manager.
- *
- * @param driver The <code>Driver</code> to unregister.
- *
- * @exception SQLException If an error occurs.
- */
- public static void deregisterDriver(Driver driver) throws SQLException
- {
- if (drivers.contains(driver))
- drivers.removeElement(driver);
- }
-
- /**
- * This method returns a list of all the currently registered JDBC drivers
- * that were loaded by the current <code>ClassLoader</code>.
- *
- * @return An <code>Enumeration</code> of all currently loaded JDBC drivers.
- */
- public static Enumeration getDrivers()
- {
- Vector v = new Vector();
- Enumeration e = drivers.elements();
-
- // Is this right?
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
-
- while(e.hasMoreElements())
- {
- Object obj = e.nextElement();
-
- ClassLoader loader = obj.getClass().getClassLoader();
-
- if (loader == null)
- loader = ClassLoader.getSystemClassLoader();
- if (! loader.equals(cl))
- continue;
-
- v.addElement(obj);
- }
-
- return v.elements();
- }
-
- /**
- * This method set the login timeout used by JDBC drivers. This is a
- * system-wide parameter that applies to all drivers.
- *
- * @param login_timeout The new login timeout value.
- */
- public static void setLoginTimeout(int seconds)
- {
- DriverManager.login_timeout = login_timeout;
- }
-
- /**
- * This method returns the login timeout in use by JDBC drivers systemwide.
- *
- * @return The login timeout.
- */
- public static int getLoginTimeout()
- {
- return login_timeout;
- }
-
- /**
- * This method sets the log stream in use by JDBC.
- *
- * @param log_stream The log stream in use by JDBC.
- *
- * @deprecated Use <code>setLogWriter</code> instead.
- */
- public static void setLogStream(PrintStream out)
- {
- DriverManager.log_stream = log_stream;
- }
-
- /**
- * This method returns the log stream in use by JDBC.
- *
- * @return The log stream in use by JDBC.
- *
- * @deprecated Use <code>getLogWriter()</code> instead.
- */
- public static PrintStream getLogStream()
- {
- return log_stream;
- }
-
- /**
- * This method prints the specified line to the log stream.
- *
- * @param str The string to write to the log stream.
- */
- public static void println(String message)
- {
- if (log_stream != null) // Watch for user not using logging
- log_stream.println(message);
- }
-}
diff --git a/libjava/java/sql/DriverPropertyInfo.java b/libjava/java/sql/DriverPropertyInfo.java
deleted file mode 100644
index 34e40fa0c3e..00000000000
--- a/libjava/java/sql/DriverPropertyInfo.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* DriverPropertyInfo.java -- Property information about drivers.
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * This class holds a driver property that can be used for querying or
- * setting driver configuration parameters.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class DriverPropertyInfo
-{
- /**
- * The name of the property.
- */
- public String name;
-
- /**
- * A description of the property, possibly <code>null</code>.
- */
- public String description;
-
- /**
- * A flag indicating whether or not a value for this property is required
- * in order to connect to the database.
- */
- public boolean required;
-
- /**
- * This is the value of the property.
- */
- public String value;
-
- /**
- * If values are restricted to certain choices, this is the list of valid
- * ones. Otherwise it is <code>null</code>.
- */
- public String[] choices;
-
- /**
- * This method initializes a new instance of <code>DriverPropertyInfo</code>
- * with the specified name and value. All other fields are defaulted.
- *
- * @param name The name of the property.
- * @param value The value to assign to the property.
- */
- public DriverPropertyInfo(String name, String value)
- {
- this.name = name;
- this.value = value;
- }
-}
diff --git a/libjava/java/sql/ParameterMetaData.java b/libjava/java/sql/ParameterMetaData.java
deleted file mode 100644
index b3a75fd2058..00000000000
--- a/libjava/java/sql/ParameterMetaData.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* ParameterMetaData.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * @since 1.4
- */
-public interface ParameterMetaData
-{
- int parameterNoNulls = 0;
-
- int parameterNullable = 1;
-
- int parameterNullableUnknown = 2;
-
- int parameterModeUnknown = 0;
-
- int parameterModeIn = 1;
-
- int parameterModeInOut = 2;
-
- int parameterModeOut = 4;
-
- /**
- * @since 1.4
- */
- int getParameterCount() throws SQLException;
-
- /**
- * @since 1.4
- */
- int isNullable(int param) throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean isSigned(int param) throws SQLException;
-
- /**
- * @since 1.4
- */
- int getPrecision(int param) throws SQLException;
-
- /**
- * @since 1.4
- */
- int getScale(int param) throws SQLException;
-
- /**
- * @since 1.4
- */
- int getParameterType(int param) throws SQLException;
-
- /**
- * @since 1.4
- */
- String getParameterTypeName(int param) throws SQLException;
-
- /**
- * @since 1.4
- */
- String getParameterClassName(int param) throws SQLException;
-
- /**
- * @since 1.4
- */
- int getParameterMode(int param) throws SQLException;
-}
diff --git a/libjava/java/sql/PreparedStatement.java b/libjava/java/sql/PreparedStatement.java
deleted file mode 100644
index 3aedbc59300..00000000000
--- a/libjava/java/sql/PreparedStatement.java
+++ /dev/null
@@ -1,438 +0,0 @@
-/* PreparedStatement.java -- Interface for pre-compiled statements.
- Copyright (C) 1999, 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.math.BigDecimal;
-import java.net.URL;
-import java.util.Calendar;
-
-/**
- * This interface provides a mechanism for executing pre-compiled
- * statements. This provides greater efficiency when calling the same
- * statement multiple times. Parameters are allowed in a statement,
- * providings for maximum reusability.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface PreparedStatement extends Statement
-{
- /**
- * This method executes a prepared SQL query and returns its ResultSet.
- *
- * @return The ResultSet of the SQL statement.
- * @exception SQLException If an error occurs.
- */
- ResultSet executeQuery() throws SQLException;
-
- /**
- * This method executes an SQL INSERT, UPDATE or DELETE statement. SQL
- * statements that return nothing such as SQL DDL statements can be executed.
- *
- * @return The result is either the row count for INSERT, UPDATE or DELETE
- * statements; or 0 for SQL statements that return nothing.
- * @exception SQLException If an error occurs.
- */
- int executeUpdate() throws SQLException;
-
- /**
- * This method populates the specified parameter with a SQL NULL value
- * for the specified type.
- *
- * @param index The index of the parameter to set.
- * @param type The SQL type identifier of the parameter from <code>Types</code>
- *
- * @exception SQLException If an error occurs.
- */
- void setNull(int parameterIndex, int sqlType) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>boolean</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setBoolean(int parameterIndex, boolean x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>byte</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setByte(int parameterIndex, byte x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>short</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setShort(int parameterIndex, short x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>int</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setInt(int parameterIndex, int x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>long</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setLong(int parameterIndex, long x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>float</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setFloat(int parameterIndex, float x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>double</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setDouble(int parameterIndex, double x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>java.math.BigDecimal</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setBigDecimal(int parameterIndex, BigDecimal x) throws
- SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>String</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setString(int parameterIndex, String x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>byte</code> array value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setBytes(int parameterIndex, byte[] x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>java.sql.Date</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setDate(int parameterIndex, Date x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>java.sql.Time</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setTime(int parameterIndex, Time x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>java.sql.Timestamp</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setTimestamp(int parameterIndex, Timestamp x)
- throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * ASCII <code>InputStream</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @param length The number of bytes in the stream.
- * @exception SQLException If an error occurs.
- */
- void setAsciiStream(int parameterIndex, InputStream x, int length)
- throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * Unicode UTF-8 <code>InputStream</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @param length The number of bytes in the stream.
- * @exception SQLException If an error occurs.
- * @deprecated
- */
- void setUnicodeStream(int parameterIndex, InputStream x, int length)
- throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * binary <code>InputStream</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @param length The number of bytes in the stream.
- * @exception SQLException If an error occurs.
- */
- void setBinaryStream(int parameterIndex, InputStream x, int length)
- throws SQLException;
-
- /**
- * This method clears all of the input parameter that have been
- * set on this statement.
- *
- * @exception SQLException If an error occurs.
- */
- void clearParameters() throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>Object</code> value. The specified SQL object type will be used.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @param type The SQL type to use for the parameter, from <code>Types</code>
- * @param scale The scale of the value, for numeric values only.
- * @exception SQLException If an error occurs.
- * @see Types
- */
- void setObject(int parameterIndex, Object x, int targetSqlType,
- int scale) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>Object</code> value. The specified SQL object type will be used.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @param type The SQL type to use for the parameter, from <code>Types</code>
- * @exception SQLException If an error occurs.
- * @see Types
- */
- void setObject(int parameterIndex, Object x, int targetSqlType)
- throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>Object</code> value. The default object type to SQL type mapping
- * will be used.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setObject(int parameterIndex, Object x) throws SQLException;
-
- /**
- * This method executes a prepared SQL query.
- * Some prepared statements return multiple results; the execute method
- * handles these complex statements as well as the simpler form of
- * statements handled by executeQuery and executeUpdate.
- *
- * @return The result of the SQL statement.
- * @exception SQLException If an error occurs.
- */
- boolean execute() throws SQLException;
-
- /**
- * This method adds a set of parameters to the batch for JDBC 2.0.
- * @exception SQLException If an error occurs.
- */
- void addBatch() throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * character <code>Reader</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @param length The number of bytes in the stream.
- * @exception SQLException If an error occurs.
- */
- void setCharacterStream(int parameterIndex, Reader reader,
- int length) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>Ref</code> value. The default object type to SQL type mapping
- * will be used.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setRef(int i, Ref x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>Blob</code> value. The default object type to SQL type mapping
- * will be used.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setBlob(int i, Blob x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>Clob</code> value. The default object type to SQL type mapping
- * will be used.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setClob(int i, Clob x) throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>Array</code> value. The default object type to SQL type mapping
- * will be used.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @exception SQLException If an error occurs.
- */
- void setArray(int i, Array x) throws SQLException;
-
- /**
- * This method returns meta data for the result set from this statement.
- *
- * @return Meta data for the result set from this statement.
- * @exception SQLException If an error occurs.
- */
- ResultSetMetaData getMetaData() throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>java.sql.Date</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @param calendar The <code>Calendar</code> to use for timezone and locale.
- * @exception SQLException If an error occurs.
- */
- void setDate(int parameterIndex, Date x, Calendar cal)
- throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>java.sql.Time</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @param calendar The <code>Calendar</code> to use for timezone and locale.
- * @exception SQLException If an error occurs.
- */
- void setTime(int parameterIndex, Time x, Calendar cal)
- throws SQLException;
-
- /**
- * This method sets the specified parameter from the given Java
- * <code>java.sql.Timestamp</code> value.
- *
- * @param index The index of the parameter value to set.
- * @param value The value of the parameter.
- * @param calendar The <code>Calendar</code> to use for timezone and locale.
- * @exception SQLException If an error occurs.
- */
- void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
- throws SQLException;
-
- /**
- * This method populates the specified parameter with a SQL NULL value
- * for the specified type.
- *
- * @param index The index of the parameter to set.
- * @param type The SQL type identifier of the parameter from <code>Types</code>
- * @param name The name of the data type, for user defined types.
- * @exception SQLException If an error occurs.
- */
- void setNull(int paramIndex, int sqlType, String typeName)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- void setURL(int parameterIndex, URL x) throws SQLException;
-
- /**
- * @since 1.4
- */
- ParameterMetaData getParameterMetaData() throws SQLException;
-}
diff --git a/libjava/java/sql/Ref.java b/libjava/java/sql/Ref.java
deleted file mode 100644
index 4ebd5e64898..00000000000
--- a/libjava/java/sql/Ref.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Ref.java -- Reference to a SQL structured type.
- Copyright (C) 1999, 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.util.Map;
-
-/**
- * This interface provides a mechanism for obtaining information about
- * a SQL structured type
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @since 1.2
- */
-public interface Ref
-{
- /**
- * This method returns the fully qualified name of the SQL structured
- * type of the referenced item.
- *
- * @return The fully qualified name of the SQL structured type.
- * @exception SQLException If an error occurs.
- * @since 1.2
- */
- String getBaseTypeName() throws SQLException;
-
- /**
- * @since 1.4
- */
- Object getObject(Map map) throws SQLException;
-
- /**
- * @since 1.4
- */
- Object getObject() throws SQLException;
-
- /**
- * @since 1.4
- */
- void setObject(Object value) throws SQLException;
-}
diff --git a/libjava/java/sql/ResultSet.java b/libjava/java/sql/ResultSet.java
deleted file mode 100644
index 97f2897d423..00000000000
--- a/libjava/java/sql/ResultSet.java
+++ /dev/null
@@ -1,1530 +0,0 @@
-/* ResultSet.java -- A SQL statement result set.
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.math.BigDecimal;
-import java.net.URL;
-import java.util.Calendar;
-import java.util.Map;
-
-/**
- * This interface provides access to the data set returned by a SQL
- * statement. An instance of this interface is returned by the various
- * execution methods in the <code>Statement</code>.
- *
- * <p> This class models a cursor, which can be stepped through one row at a
- * time. Methods are provided for accessing columns by column name or by
- * index.</p>
- *
- * <p> Note that a result set is invalidated if the statement that returned
- * it is closed.</p>
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface ResultSet
-{
- /**
- * The rows will be processed in order from first to last.
- */
- int FETCH_FORWARD = 1000;
-
- /**
- * The rows will be processed in order from last to first.
- */
- int FETCH_REVERSE = 1001;
-
- /**
- * The rows will be processed in an unknown order
- */
- int FETCH_UNKNOWN = 1002;
-
- /**
- * This type of result set may only step forward through the rows returned.
- */
- int TYPE_FORWARD_ONLY = 1003;
-
- /**
- * This type of result set is scrollable and is not sensitive to changes
- * made by other statements.
- */
- int TYPE_SCROLL_INSENSITIVE = 1004;
-
- /**
- * This type of result set is scrollable and is also sensitive to changes
- * made by other statements.
- */
- int TYPE_SCROLL_SENSITIVE = 1005;
-
- /**
- * The concurrency mode of for the result set may not be modified.
- */
- int CONCUR_READ_ONLY = 1007;
-
- /**
- * The concurrency mode of for the result set may be modified.
- */
- int CONCUR_UPDATABLE = 1008;
-
- int HOLD_CURSORS_OVER_COMMIT = 1;
-
- int CLOSE_CURSORS_AT_COMMIT = 2;
-
- /**
- * This method advances to the next row in the result set. Any streams
- * open on the current row are closed automatically.
- *
- * @return <code>true</code> if the next row exists, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean next() throws SQLException;
-
- /**
- * This method closes the result set and frees any associated resources.
- *
- * @exception SQLException If an error occurs.
- */
- void close() throws SQLException;
-
- /**
- * This method tests whether the value of the last column that was fetched
- * was actually a SQL NULL value.
- *
- * @return <code>true</code> if the last column fetched was a NULL,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean wasNull() throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>String</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>String</code>.
- * @exception SQLException If an error occurs.
- */
- String getString(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>boolean</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>boolean</code>.
- * @exception SQLException If an error occurs.
- */
- boolean getBoolean(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>byte</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>byte</code>.
- * @exception SQLException If an error occurs.
- */
- byte getByte(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>short</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>short</code>.
- * @exception SQLException If an error occurs.
- */
- short getShort(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>int</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>int</code>.
- * @exception SQLException If an error occurs.
- */
- int getInt(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>long</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>long</code>.
- * @exception SQLException If an error occurs.
- */
- long getLong(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>float</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>float</code>.
- * @exception SQLException If an error occurs.
- */
- float getFloat(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>double</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>double</code>.
- * @exception SQLException If an error occurs.
- */
- double getDouble(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>BigDecimal</code>.
- *
- * @param index The index of the column to return.
- * @param scale The number of digits to the right of the decimal to return.
- * @return The column value as a <code>BigDecimal</code>.
- * @exception SQLException If an error occurs.
- * @deprecated
- */
- BigDecimal getBigDecimal(int columnIndex, int scale)
- throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * byte array.
- *
- * @param index The index of the column to return.
- * @return The column value as a byte array
- * @exception SQLException If an error occurs.
- */
- byte[] getBytes(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>java.sql.Date</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>java.sql.Date</code>.
- * @exception SQLException If an error occurs.
- */
- Date getDate(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>java.sql.Time</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>java.sql.Time</code>.
- * @exception SQLException If an error occurs.
- */
- Time getTime(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>java.sql.Timestamp</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>java.sql.Timestamp</code>.
- * @exception SQLException If an error occurs.
- */
- Timestamp getTimestamp(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as an ASCII
- * stream. Note that all the data from this stream must be read before
- * fetching the value of any other column. Please also be aware that
- * calling <code>next()</code> or <code>close()</code> on this result set
- * will close this stream as well.
- *
- * @param index The index of the column to return.
- * @return The column value as an ASCII <code>InputStream</code>.
- * @exception SQLException If an error occurs.
- */
- InputStream getAsciiStream(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Unicode UTF-8
- * stream. Note that all the data from this stream must be read before
- * fetching the value of any other column. Please also be aware that
- * calling <code>next()</code> or <code>close()</code> on this result set
- * will close this stream as well.
- *
- * @param index The index of the column to return.
- * @return The column value as a Unicode UTF-8 <code>InputStream</code>.
- * @exception SQLException If an error occurs.
- * @deprecated Use getCharacterStream instead.
- */
- InputStream getUnicodeStream(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a raw byte
- * stream. Note that all the data from this stream must be read before
- * fetching the value of any other column. Please also be aware that
- * calling <code>next()</code> or <code>close()</code> on this result set
- * will close this stream as well.
- *
- * @param index The index of the column to return.
- * @return The column value as a raw byte <code>InputStream</code>.
- * @exception SQLException If an error occurs.
- */
- InputStream getBinaryStream(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>String</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>String</code>.
- * @exception SQLException If an error occurs.
- */
- String getString(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>boolean</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>boolean</code>.
- * @exception SQLException If an error occurs.
- */
- boolean getBoolean(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>byte</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>byte</code>.
- * @exception SQLException If an error occurs.
- */
- byte getByte(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>short</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>short</code>.
- * @exception SQLException If an error occurs.
- */
- short getShort(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>int</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>int</code>.
- * @exception SQLException If an error occurs.
- */
- int getInt(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>long</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>long</code>.
- * @exception SQLException If an error occurs.
- */
- long getLong(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>float</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>float</code>.
- * @exception SQLException If an error occurs.
- */
- float getFloat(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>double</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>double</code>.
- * @exception SQLException If an error occurs.
- */
- double getDouble(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>BigDecimal</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>BigDecimal</code>.
- * @exception SQLException If an error occurs.
- * @deprecated
- */
- BigDecimal getBigDecimal(String columnName, int scale)
- throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * byte array.
- *
- * @param column The name of the column to return.
- * @return The column value as a byte array
- * @exception SQLException If an error occurs.
- */
- byte[] getBytes(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>java.sql.Date</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>java.sql.Date</code>.
- * @exception SQLException If an error occurs.
- */
- Date getDate(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>java.sql.Time</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>java.sql.Time</code>.
- * @exception SQLException If an error occurs.
- */
- Time getTime(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>java.sql.Timestamp</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>java.sql.Timestamp</code>.
- * @exception SQLException If an error occurs.
- */
- Timestamp getTimestamp(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as an ASCII
- * stream. Note that all the data from this stream must be read before
- * fetching the value of any other column. Please also be aware that
- * calling <code>next()</code> or <code>close()</code> on this result set
- * will close this stream as well.
- *
- * @param column The name of the column to return.
- * @return The column value as an ASCII <code>InputStream</code>.
- * @exception SQLException If an error occurs.
- */
- InputStream getAsciiStream(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Unicode UTF-8
- * stream. Note that all the data from this stream must be read before
- * fetching the value of any other column. Please also be aware that
- * calling <code>next()</code> or <code>close()</code> on this result set
- * will close this stream as well.
- *
- * @param column The name of the column to return.
- * @return The column value as a Unicode UTF-8 <code>InputStream</code>.
- * @exception SQLException If an error occurs.
- * @deprecated Use getCharacterStream instead.
- */
- InputStream getUnicodeStream(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a raw byte
- * stream. Note that all the data from this stream must be read before
- * fetching the value of any other column. Please also be aware that
- * calling <code>next()</code> or <code>close()</code> on this result set
- * will close this stream as well.
- *
- * @param column The name of the column to return.
- * @return The column value as a raw byte <code>InputStream</code>.
- * @exception SQLException If an error occurs.
- */
- InputStream getBinaryStream(String columnName) throws SQLException;
-
- /**
- * This method returns the first SQL warning associated with this result
- * set. Any additional warnings will be chained to this one.
- *
- * @return The first SQLWarning for this result set, or <code>null</code> if
- * there are no warnings.
- * @exception SQLException If an error occurs.
- */
- SQLWarning getWarnings() throws SQLException;
-
- /**
- * This method clears all warnings associated with this result set.
- *
- * @exception SQLException If an error occurs.
- */
- void clearWarnings() throws SQLException;
-
- /**
- * This method returns the name of the database cursor used by this
- * result set.
- *
- * @return The name of the database cursor used by this result set.
- * @exception SQLException If an error occurs.
- */
- String getCursorName() throws SQLException;
-
- /**
- * This method returns data about the columns returned as part of the
- * result set as a <code>ResultSetMetaData</code> instance.
- *
- * @return The <code>ResultSetMetaData</code> instance for this result set.
- * @exception SQLException If an error occurs.
- */
- ResultSetMetaData getMetaData() throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>Object</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as an <code>Object</code>.
- * @exception SQLException If an error occurs.
- */
- Object getObject(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>Object</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as an <code>Object</code>.
- * @exception SQLException If an error occurs.
- */
- Object getObject(String columnName) throws SQLException;
-
- /**
- * This method returns the column index of the specified named column.
- *
- * @param column The name of the column.
- * @return The index of the column.
- * @exception SQLException If an error occurs.
- */
- int findColumn(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a character
- * stream. Note that all the data from this stream must be read before
- * fetching the value of any other column. Please also be aware that
- * calling <code>next()</code> or <code>close()</code> on this result set
- * will close this stream as well.
- *
- * @param index The index of the column to return.
- * @return The column value as an character <code>Reader</code>.
- * @exception SQLException If an error occurs.
- */
- Reader getCharacterStream(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a character
- * stream. Note that all the data from this stream must be read before
- * fetching the value of any other column. Please also be aware that
- * calling <code>next()</code> or <code>close()</code> on this result set
- * will close this stream as well.
- *
- * @param column The name of the column to return.
- * @return The column value as an character <code>Reader</code>.
- * @exception SQLException If an error occurs.
- */
- Reader getCharacterStream(String columnName) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>BigDecimal</code>.
- *
- * @param index The index of the column to return.
- * @return The column value as a <code>BigDecimal</code>.
- * @exception SQLException If an error occurs.
- */
- BigDecimal getBigDecimal(int columnIndex) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>BigDecimal</code>.
- *
- * @param column The name of the column to return.
- * @return The column value as a <code>BigDecimal</code>.
- * @exception SQLException If an error occurs.
- */
- BigDecimal getBigDecimal(String columnName) throws SQLException;
-
- /**
- * This method tests whether or not the cursor is before the first row
- * in the result set.
- *
- * @return <code>true</code> if the cursor is positioned before the first
- * row, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isBeforeFirst() throws SQLException;
-
- /**
- * This method tests whether or not the cursor is after the last row
- * in the result set.
- *
- * @return <code>true</code> if the cursor is positioned after the last
- * row, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isAfterLast() throws SQLException;
-
- /**
- * This method tests whether or not the cursor is positioned on the first
- * row in the result set.
- *
- * @return <code>true</code> if the cursor is positioned on the first
- * row, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isFirst() throws SQLException;
-
- /**
- * This method tests whether or not the cursor is on the last row
- * in the result set.
- *
- * @return <code>true</code> if the cursor is positioned on the last
- * row, <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isLast() throws SQLException;
-
- /**
- * This method repositions the cursor to before the first row in the
- * result set.
- *
- * @exception SQLException If an error occurs.
- */
- void beforeFirst() throws SQLException;
-
- /**
- * This method repositions the cursor to after the last row in the result
- * set.
- *
- * @exception SQLException If an error occurs.
- */
- void afterLast() throws SQLException;
-
- /**
- * This method repositions the cursor on the first row in the
- * result set.
- *
- * @return <code>true</code> if the cursor is on a valid row;
- * <code>false</code> if there are no rows in the result set.
- * @exception SQLException If an error occurs.
- */
- boolean first() throws SQLException;
-
- /**
- * This method repositions the cursor on the last row in the result
- * set.
- *
- * @return <code>true</code> if the cursor is on a valid row;
- * <code>false</code> if there are no rows in the result set.
- * @exception SQLException If an error occurs.
- */
- boolean last() throws SQLException;
-
- /**
- * This method returns the current row number in the cursor. Numbering
- * begins at index 1.
- *
- * @return The current row number, or 0 if there is not current row.
- * @exception SQLException If an error occurs.
- */
- int getRow() throws SQLException;
-
- /**
- * This method positions the result set to the specified absolute row.
- * Positive numbers are row offsets from the beginning of the result
- * set (numbering starts from row 1) and negative numbers are row offsets
- * from the end of the result set (numbering starts from -1).
- *
- * @param row The row to position the result set to.
- *
- * @return <code>true</code> if the current position was changed,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean absolute(int row) throws SQLException;
-
- /**
- * This method moves the result set position relative to the current row.
- * The offset can be positive or negative.
- *
- * @param row The relative row position to move to.
- * @return <code>true</code> if the current position was changed,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean relative(int rows) throws SQLException;
-
- /**
- * This method moves the current position to the previous row in the
- * result set.
- *
- * @return <code>true</code> if the previous row exists, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean previous() throws SQLException;
-
- /**
- * This method provides a hint to the driver about which direction the
- * result set will be processed in.
- *
- * @param direction The direction in which rows will be processed. (Values?)
- * @exception SQLException If an error occurs.
- */
- void setFetchDirection(int direction) throws SQLException;
-
- /**
- * This method returns the current fetch direction for this result set.
- *
- * @return The fetch direction for this result set.
- * @exception SQLException If an error occurs.
- */
- int getFetchDirection() throws SQLException;
-
- /**
- * This method provides a hint to the driver about how many rows at a
- * time it should fetch from the database.
- *
- * @param rows The number of rows the driver should fetch per call.
- * @exception SQLException If an error occurs.
- */
- void setFetchSize(int rows) throws SQLException;
-
- /**
- * This method returns the current number of rows that will be fetched
- * from the database at a time.
- *
- * @return The current fetch size for this result set.
- * @exception SQLException If an error occurs.
- */
- int getFetchSize() throws SQLException;
-
- /**
- * This method returns the result set type of this result set. This will
- * be one of the TYPE_* constants defined in this interface.
- *
- * @return The result set type.
- * @exception SQLException If an error occurs.
- */
- int getType() throws SQLException;
-
- /**
- * This method returns the concurrency type of this result set. This will
- * be one of the CONCUR_* constants defined in this interface.
- *
- * @return The result set concurrency type.
- * @exception SQLException If an error occurs.
- */
- int getConcurrency() throws SQLException;
-
- /**
- * This method tests whether or not the current row in the result set
- * has been updated. Updates must be visible in order of this method to
- * detect the update.
- *
- * @return <code>true</code> if the row has been updated, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean rowUpdated() throws SQLException;
-
- /**
- * This method tests whether or not the current row in the result set
- * has been inserted. Inserts must be visible in order of this method to
- * detect the insert.
- *
- * @return <code>true</code> if the row has been inserted, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean rowInserted() throws SQLException;
-
- /**
- * This method tests whether or not the current row in the result set
- * has been deleted. Deletes must be visible in order of this method to
- * detect the deletion.
- *
- * @return <code>true</code> if the row has been deleted, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean rowDeleted() throws SQLException;
-
- /**
- * This method updates the specified column to have a NULL value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @return index The index of the column to update.
- * @exception SQLException If an error occurs.
- */
- void updateNull(int columnIndex) throws SQLException;
-
- /**
- * This method updates the specified column to have a boolean value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateBoolean(int columnIndex, boolean x) throws SQLException;
-
- /**
- * This method updates the specified column to have a byte value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateByte(int columnIndex, byte x) throws SQLException;
-
- /**
- * This method updates the specified column to have a short value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateShort(int columnIndex, short x) throws SQLException;
-
- /**
- * This method updates the specified column to have an int value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateInt(int columnIndex, int x) throws SQLException;
-
- /**
- * This method updates the specified column to have a long value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateLong(int columnIndex, long x) throws SQLException;
-
- /**
- * This method updates the specified column to have a float value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateFloat(int columnIndex, float x) throws SQLException;
-
- /**
- * This method updates the specified column to have a double value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateDouble(int columnIndex, double x) throws SQLException;
-
- /**
- * This method updates the specified column to have a BigDecimal value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateBigDecimal(int columnIndex, BigDecimal x)
- throws SQLException;
-
- /**
- * This method updates the specified column to have a String value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateString(int columnIndex, String x) throws SQLException;
-
- /**
- * This method updates the specified column to have a byte array value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateBytes(int columnIndex, byte[] x) throws SQLException;
-
- /**
- * This method updates the specified column to have a java.sql.Date value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateDate(int columnIndex, Date x) throws SQLException;
-
- /**
- * This method updates the specified column to have a java.sql.Time value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateTime(int columnIndex, Time x) throws SQLException;
-
- /**
- * This method updates the specified column to have a java.sql.Timestamp value.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateTimestamp(int columnIndex, Timestamp x)
- throws SQLException;
-
- /**
- * This method updates the specified column from an ASCII text stream.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @param length The length of the stream.
- * @exception SQLException If an error occurs.
- */
- void updateAsciiStream(int columnIndex, InputStream x, int length)
- throws SQLException;
-
- /**
- * This method updates the specified column from a binary stream.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @param length The length of the stream.
- * @exception SQLException If an error occurs.
- */
- void updateBinaryStream(int columnIndex, InputStream x, int length)
- throws SQLException;
-
- /**
- * This method updates the specified column from a character stream.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @param length The length of the stream.
- * @exception SQLException If an error occurs.
- */
- void updateCharacterStream(int columnIndex, Reader x, int length)
- throws SQLException;
-
- /**
- * This method updates the specified column to have an Object value.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- *
- * @exception SQLException If an error occurs.
- */
- void updateObject(int columnIndex, Object x, int scale)
- throws SQLException;
-
- /**
- * This method updates the specified column to have an Object value.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param index The index of the column to update.
- * @param value The new value of the column.
- * @param scale The scale of the object in question, which is used only
- * for numeric type objects.
- * @exception SQLException If an error occurs.
- */
- void updateObject(int columnIndex, Object x) throws SQLException;
-
- /**
- * This method updates the specified column to have a NULL value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @return name The name of the column to update.
- * @exception SQLException If an error occurs.
- */
- void updateNull(String columnName) throws SQLException;
-
- /**
- * This method updates the specified column to have a boolean value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateBoolean(String columnName, boolean x) throws SQLException;
-
- /**
- * This method updates the specified column to have a byte value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateByte(String columnName, byte x) throws SQLException;
-
- /**
- * This method updates the specified column to have a short value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateShort(String columnName, short x) throws SQLException;
-
- /**
- * This method updates the specified column to have an int value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateInt(String columnName, int x) throws SQLException;
-
- /**
- * This method updates the specified column to have a long value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateLong(String columnName, long x) throws SQLException;
-
- /**
- * This method updates the specified column to have a float value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateFloat(String columnName, float x) throws SQLException;
-
- /**
- * This method updates the specified column to have a double value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateDouble(String columnName, double x) throws SQLException;
-
- /**
- * This method updates the specified column to have a BigDecimal value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateBigDecimal(String columnName, BigDecimal x)
- throws SQLException;
-
- /**
- * This method updates the specified column to have a String value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateString(String columnName, String x) throws SQLException;
-
- /**
- * This method updates the specified column to have a byte array value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateBytes(String columnName, byte[] x) throws SQLException;
-
- /**
- * This method updates the specified column to have a java.sql.Date value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateDate(String columnName, Date x) throws SQLException;
-
- /**
- * This method updates the specified column to have a java.sql.Time value. This
- * does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateTime(String columnName, Time x) throws SQLException;
-
- /**
- * This method updates the specified column to have a java.sql.Timestamp value.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateTimestamp(String columnName, Timestamp x)
- throws SQLException;
-
- /**
- * This method updates the specified column from an ASCII text stream.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @param length The length of the stream.
- * @exception SQLException If an error occurs.
- */
- void updateAsciiStream(String columnName, InputStream x, int length)
- throws SQLException;
-
- /**
- * This method updates the specified column from a binary stream.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @param length The length of the stream.
- * @exception SQLException If an error occurs.
- */
- void updateBinaryStream(String columnName, InputStream x, int length)
- throws SQLException;
-
- /**
- * This method updates the specified column from a character stream.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @param length The length of the stream.
- *
- * @exception SQLException If an error occurs.
- */
- void updateCharacterStream(String columnName, Reader reader,
- int length) throws SQLException;
-
- /**
- * This method updates the specified column to have an Object value.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @exception SQLException If an error occurs.
- */
- void updateObject(String columnName, Object x, int scale)
- throws SQLException;
-
- /**
- * This method updates the specified column to have an Object value.
- * This does not update the actual database. <code>updateRow</code> must be
- * called in order to do that.
- *
- * @param name The name of the column to update.
- * @param value The new value of the column.
- * @param scale The scale of the object in question, which is used only
- * for numeric type objects.
- * @exception SQLException If an error occurs.
- */
- void updateObject(String columnName, Object x) throws SQLException;
-
- /**
- * This method inserts the current row into the database. The result set
- * must be positioned on the insert row in order to call this method
- * successfully.
- *
- * @exception SQLException If an error occurs.
- */
- void insertRow() throws SQLException;
-
- /**
- * This method updates the current row in the database.
- *
- * @exception SQLException If an error occurs.
- */
- void updateRow() throws SQLException;
-
- /**
- * This method deletes the current row in the database.
- *
- * @exception SQLException If an error occurs.
- */
- void deleteRow() throws SQLException;
-
- /**
- * This method refreshes the contents of the current row from the database.
- *
- * @exception SQLException If an error occurs.
- */
- void refreshRow() throws SQLException;
-
- /**
- * This method cancels any changes that have been made to a row. If
- * the <code>rowUpdate</code> method has been called, then the changes
- * cannot be undone.
- *
- * @exception SQLException If an error occurs.
- */
- void cancelRowUpdates() throws SQLException;
-
- /**
- * This method positions the result set to the "insert row", which allows
- * a new row to be inserted into the database from the result set.
- *
- * @exception SQLException If an error occurs.
- */
- void moveToInsertRow() throws SQLException;
-
- /**
- * This method moves the result set position from the insert row back to
- * the current row that was selected prior to moving to the insert row.
- *
- * @exception SQLException If an error occurs.
- */
- void moveToCurrentRow() throws SQLException;
-
- /**
- * This method returns a the <code>Statement</code> that was used to
- * produce this result set.
- *
- * @return The <code>Statement</code> used to produce this result set.
- *
- * @exception SQLException If an error occurs.
- */
- Statement getStatement() throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>Object</code> using the specified SQL type to Java type map.
- *
- * @param index The index of the column to return.
- * @param map The SQL type to Java type map to use.
- * @return The value of the column as an <code>Object</code>.
- * @exception SQLException If an error occurs.
- */
- Object getObject(int i, Map map) throws SQLException;
-
- /**
- * This method returns a <code>Ref</code> for the specified column which
- * represents the structured type for the column.
- *
- * @param index The index of the column to return.
- * @return A <code>Ref</code> object for the column
- * @exception SQLException If an error occurs.
- */
- Ref getRef(int i) throws SQLException;
-
- /**
- * This method returns the specified column value as a BLOB.
- *
- * @param index The index of the column value to return.
- * @return The value of the column as a BLOB.
- * @exception SQLException If an error occurs.
- */
- Blob getBlob(int i) throws SQLException;
-
- /**
- * This method returns the specified column value as a CLOB.
- *
- * @param index The index of the column value to return.
- * @return The value of the column as a CLOB.
- * @exception SQLException If an error occurs.
- */
- Clob getClob(int i) throws SQLException;
-
- /**
- * This method returns the specified column value as an <code>Array</code>.
- *
- * @param index The index of the column value to return.
- * @return The value of the column as an <code>Array</code>.
- * @exception SQLException If an error occurs.
- */
- Array getArray(int i) throws SQLException;
-
- /**
- * This method returns the value of the specified column as a Java
- * <code>Object</code> using the specified SQL type to Java type map.
- *
- * @param name The name of the column to return.
- * @param map The SQL type to Java type map to use.
- * @return The value of the column as an <code>Object</code>.
- * @exception SQLException If an error occurs.
- */
- Object getObject(String colName, Map map) throws SQLException;
-
- /**
- * This method returns a <code>Ref</code> for the specified column which
- * represents the structured type for the column.
- *
- * @param index The index of the column to return.
- * @return A <code>Ref</code> object for the column
- * @exception SQLException If an error occurs.
- */
- Ref getRef(String colName) throws SQLException;
-
- /**
- * This method returns the specified column value as a BLOB.
- *
- * @param name The name of the column value to return.
- * @return The value of the column as a BLOB.
- * @exception SQLException If an error occurs.
- */
- Blob getBlob(String colName) throws SQLException;
-
- /**
- * This method returns the specified column value as a CLOB.
- *
- * @param name The name of the column value to return.
- * @return The value of the column as a CLOB.
- * @exception SQLException If an error occurs.
- */
- Clob getClob(String colName) throws SQLException;
-
- /**
- * This method returns the specified column value as an <code>Array</code>.
- *
- * @param name The name of the column value to return.
- * @return The value of the column as an <code>Array</code>.
- * @exception SQLException If an error occurs.
- */
- Array getArray(String colName) throws SQLException;
-
- /**
- * This method returns the specified column value as a
- * <code>java.sql.Date</code>. The specified <code>Calendar</code> is used
- * to generate a value for the date if the database does not support
- * timezones.
- *
- * @param index The index of the column value to return.
- * @param cal The <code>Calendar</code> to use for calculating timezones.
- * @return The value of the column as a <code>java.sql.Date</code>.
- * @exception SQLException If an error occurs.
- */
- Date getDate(int columnIndex, Calendar cal) throws SQLException;
-
- /**
- * This method returns the specified column value as a
- * <code>java.sql.Date</code>. The specified <code>Calendar</code> is used
- * to generate a value for the date if the database does not support
- * timezones.
- *
- * @param name The name of the column value to return.
- * @param cal The <code>Calendar</code> to use for calculating timezones.
- * @return The value of the column as a <code>java.sql.Date</code>.
- * @exception SQLException If an error occurs.
- */
- Date getDate(String columnName, Calendar cal) throws SQLException;
-
- /**
- * This method returns the specified column value as a
- * <code>java.sql.Time</code>. The specified <code>Calendar</code> is used
- * to generate a value for the time if the database does not support
- * timezones.
- *
- * @param index The index of the column value to return.
- * @param cal The <code>Calendar</code> to use for calculating timezones.
- * @return The value of the column as a <code>java.sql.Time</code>.
- * @exception SQLException If an error occurs.
- */
- Time getTime(int columnIndex, Calendar cal) throws SQLException;
-
- /**
- * This method returns the specified column value as a
- * <code>java.sql.Time</code>. The specified <code>Calendar</code> is used
- * to generate a value for the time if the database does not support
- * timezones.
- *
- * @param name The name of the column value to return.
- * @param cal The <code>Calendar</code> to use for calculating timezones.
- * @return The value of the column as a <code>java.sql.Time</code>.
- * @exception SQLException If an error occurs.
- */
- Time getTime(String columnName, Calendar cal) throws SQLException;
-
- /**
- * This method returns the specified column value as a
- * <code>java.sql.Timestamp</code>. The specified <code>Calendar</code> is used
- * to generate a value for the timestamp if the database does not support
- * timezones.
- *
- * @param index The index of the column value to return.
- * @param cal The <code>Calendar</code> to use for calculating timezones.
- * @return The value of the column as a <code>java.sql.Timestamp</code>.
- * @exception SQLException If an error occurs.
- */
- Timestamp getTimestamp(int columnIndex, Calendar cal)
- throws SQLException;
-
- /**
- * This method returns the specified column value as a
- * <code>java.sql.Timestamp</code>. The specified <code>Calendar</code> is used
- * to generate a value for the timestamp if the database does not support
- * timezones.
- *
- * @param name The name of the column value to return.
- * @param cal The <code>Calendar</code> to use for calculating timezones.
- *
- * @return The value of the column as a <code>java.sql.Timestamp</code>.
- *
- * @exception SQLException If an error occurs.
- */
- Timestamp getTimestamp(String columnName, Calendar cal)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- URL getURL(int columnIndex) throws SQLException;
-
- /**
- * @since 1.4
- */
- URL getURL(String columnName) throws SQLException;
-
- /**
- * @since 1.4
- */
- void updateRef(int columnIndex, Ref x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void updateRef(String columnName, Ref x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void updateBlob(int columnIndex, Blob x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void updateBlob(String columnName, Blob x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void updateClob(int columnIndex, Clob x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void updateClob(String columnName, Clob x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void updateArray(int columnIndex, Array x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void updateArray(String columnName, Array x) throws SQLException;
-}
diff --git a/libjava/java/sql/ResultSetMetaData.java b/libjava/java/sql/ResultSetMetaData.java
deleted file mode 100644
index 0086677ee60..00000000000
--- a/libjava/java/sql/ResultSetMetaData.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/* ResultSetMetaData.java -- Returns information about the ResultSet
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * This interface provides a mechanism for obtaining information about
- * the columns that are present in a <code>ResultSet</code>.
- * <p>
- * Note that in this class column indexes start at 1, not 0.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface ResultSetMetaData
-{
- /**
- * The column does not allow NULL's.
- */
- int columnNoNulls = 0;
-
- /**
- * The column allows NULL's.
- */
- int columnNullable = 1;
-
- /**
- * It is unknown whether or not the column allows NULL's.
- */
- int columnNullableUnknown = 2;
-
- /**
- * This method returns the number of columns in the result set.
- *
- * @return The number of columns in the result set.
- * @exception SQLException If an error occurs.
- */
- int getColumnCount() throws SQLException;
-
- /**
- * This method test whether or not the column is an auto-increment column.
- * Auto-increment columns are read-only.
- *
- * @param index The index of the column to test.
- * @return <code>true</code> if the column is auto-increment, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isAutoIncrement(int column) throws SQLException;
-
- /**
- * This method tests whether or not a column is case sensitive in its values.
- *
- * @param index The index of the column to test.
- * @return <code>true</code> if the column value is case sensitive,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isCaseSensitive(int column) throws SQLException;
-
- /**
- * This method tests whether not the specified column can be used in
- * a WHERE clause.
- *
- * @param index The index of the column to test.
- * @return <code>true</code> if the column may be used in a WHERE clause,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isSearchable(int column) throws SQLException;
-
- /**
- * This method tests whether or not the column stores a monetary value.
- *
- * @param index The index of the column to test.
- * @return <code>true</code> if the column contains a monetary value,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isCurrency(int column) throws SQLException;
-
- /**
- * This method returns a value indicating whether or not the specified
- * column may contain a NULL value.
- *
- * @param index The index of the column to test.
- * @return A constant indicating whether or not the column can contain NULL,
- * which will be one of <code>columnNoNulls</code>,
- * <code>columnNullable</code>, or <code>columnNullableUnknown</code>.
- * @exception SQLException If an error occurs.
- */
- int isNullable(int column) throws SQLException;
-
- /**
- * This method tests whether or not the value of the specified column
- * is signed or unsigned.
- *
- * @param index The index of the column to test.
- * @return <code>true</code> if the column value is signed, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isSigned(int column) throws SQLException;
-
- /**
- * This method returns the maximum number of characters that can be used
- * to display a value in this column.
- *
- * @param index The index of the column to check.
- * @return The maximum number of characters that can be used to display a
- * value for this column.
- * @exception SQLException If an error occurs.
- */
- int getColumnDisplaySize(int column) throws SQLException;
-
- /**
- * This method returns a string that should be used as a caption for this
- * column for user display purposes.
- *
- * @param index The index of the column to check.
- * @return A display string for the column.
- * @exception SQLException If an error occurs.
- */
- String getColumnLabel(int column) throws SQLException;
-
- /**
- * This method returns the name of the specified column.
- *
- * @param index The index of the column to return the name of.
- * @return The name of the column.
- * @exception SQLException If an error occurs.
- */
- String getColumnName(int column) throws SQLException;
-
- /**
- * This method returns the name of the schema that contains the specified
- * column.
- *
- * @param index The index of the column to check the schema name for.
- * @return The name of the schema that contains the column.
- * @exception SQLException If an error occurs.
- */
- String getSchemaName(int column) throws SQLException;
-
- /**
- * This method returns the precision of the specified column, which is the
- * number of decimal digits it contains.
- *
- * @param index The index of the column to check the precision on.
- * @return The precision of the specified column.
- * @exception SQLException If an error occurs.
- */
- int getPrecision(int column) throws SQLException;
-
- /**
- * This method returns the scale of the specified column, which is the
- * number of digits to the right of the decimal point.
- *
- * @param index The index column to check the scale of.
- * @return The scale of the column.
- * @exception SQLException If an error occurs.
- */
- int getScale(int column) throws SQLException;
-
- /**
- * This method returns the name of the table containing the specified
- * column.
- *
- * @param index The index of the column to check the table name for.
- * @return The name of the table containing the column.
- * @exception SQLException If an error occurs.
- */
- String getTableName(int column) throws SQLException;
-
- /**
- * This method returns the name of the catalog containing the specified
- * column.
- *
- * @param index The index of the column to check the catalog name for.
- * @return The name of the catalog containing the column.
- * @exception SQLException If an error occurs.
- */
- String getCatalogName(int column) throws SQLException;
-
- /**
- * This method returns the SQL type of the specified column. This will
- * be one of the constants from <code>Types</code>.
- *
- * @param index The index of the column to check the SQL type of.
- * @return The SQL type for this column.
- * @exception SQLException If an error occurs.
- * @see Types
- */
- int getColumnType(int column) throws SQLException;
-
- /**
- * This method returns the name of the SQL type for this column.
- *
- * @param index The index of the column to check the SQL type name for.
- * @return The name of the SQL type for this column.
- * @exception SQLException If an error occurs.
- */
- String getColumnTypeName(int column) throws SQLException;
-
- /**
- * This method tests whether or not the specified column is read only.
- *
- * @param index The index of the column to check.
- * @return <code>true</code> if the column is read only, <code>false</code>
- * otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isReadOnly(int column) throws SQLException;
-
- /**
- * This method tests whether or not the column may be writable. This
- * does not guarantee that a write will be successful.
- *
- * @param index The index of the column to check for writability.
- * @return <code>true</code> if the column may be writable,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isWritable(int column) throws SQLException;
-
- /**
- * This method tests whether or not the column is writable. This
- * does guarantee that a write will be successful.
- *
- * @param index The index of the column to check for writability.
- * @return <code>true</code> if the column is writable,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean isDefinitelyWritable(int column) throws SQLException;
-
- /**
- * This method returns the name of the Java class which will be used to
- * create objects representing the data in this column.
- *
- * @param index The index of the column to check.
- * @return The name of the Java class that will be used for values in
- * this column.
- * @exception SQLException If an error occurs.
- */
- String getColumnClassName(int column) throws SQLException;
-}
diff --git a/libjava/java/sql/SQLData.java b/libjava/java/sql/SQLData.java
deleted file mode 100644
index 2ba1fb18d05..00000000000
--- a/libjava/java/sql/SQLData.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* SQLData.java -- Custom mapping for a user defined datatype
- Copyright (C) 1999, 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * This interface is used for mapping SQL data to user defined datatypes.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface SQLData
-{
- /**
- * This method returns the user defined datatype name for this object.
- *
- * @return The user defined data type name for this object.
- * @exception SQLException If an error occurs.
- */
- String getSQLTypeName() throws SQLException;
-
- /**
- * This method populates the data in the object from the specified stream.
- *
- * @param stream The stream to read the data from.
- * @param name The data type name of the data on the stream.
- * @exception SQLException If an error occurs.
- */
- void readSQL(SQLInput stream, String typeName) throws SQLException;
-
- /**
- * This method writes the data in this object to the specified stream.
- *
- * @param stream The stream to write the data to.
- * @exception SQLException If an error occurs.
- */
- void writeSQL(SQLOutput stream) throws SQLException;
-}
diff --git a/libjava/java/sql/SQLException.java b/libjava/java/sql/SQLException.java
deleted file mode 100644
index 8c502f2df7c..00000000000
--- a/libjava/java/sql/SQLException.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/* SQLException.java -- General SQL exception
- Copyright (C) 1999, 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * This exception is thrown when a database error occurs.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class SQLException extends Exception
-{
- static final long serialVersionUID = 2135244094396331484L;
-
- /**
- * This is the next exception in the chain
- */
- private SQLException next;
-
- /**
- * This is the state of the SQL statement at the time of the error.
- */
- private String SQLState;
-
- /**
- * The vendor error code for this error
- */
- private int vendorCode;
-
- /**
- * This method initializes a nwe instance of <code>SQLException</code>
- * with the specified descriptive error message, SQL state string, and
- * vendor code.
- *
- * @param message A string describing the nature of the error.
- * @param SQLState A string containing the SQL state of the error.
- * @param vendorCode The vendor error code associated with this error.
- */
- public SQLException(String message, String SQLState, int vendorCode)
- {
- super(message);
- this.SQLState = SQLState;
- this.vendorCode = vendorCode;
- }
-
- /**
- * This method initializes a new instance of <code>SQLException</code>
- * with the specified descriptive error message and SQL state string.
- * The vendor error code of this instance will be 0.
- *
- * @param message A string describing the nature of the error.
- * @param SQLState A string containing the SQL state of the error.
- */
- public SQLException(String message, String SQLState)
- {
- this(message, SQLState, 0);
- }
-
- /**
- * This method initializes a new instance of <code>SQLException</code>
- * with the specified descriptive error message. The SQL state of this
- * instance will be <code>null</code> and the vendor error code will be 0.
- *
- * @param message A string describing the nature of the error.
- */
- public SQLException(String message)
- {
- this(message, null, 0);
- }
-
- /**
- * This method initializes a new instance of <code>SQLException</code>
- * that does not have a descriptive messages and SQL state, and which
- * has a vendor error code of 0.
- */
- public SQLException()
- {
- this(null, null, 0);
- }
-
- /**
- * This method returns the SQLState information associated with this
- * error. The value returned is a <code>String</code> which is formatted
- * using the XOPEN SQL state conventions.
- *
- * @return The SQL state, which may be <code>null</code>.
- */
- public String getSQLState()
- {
- return SQLState;
- }
-
- /**
- * This method returns the vendor specific error code associated with
- * this error.
- *
- * @return The vendor specific error code associated with this error.
- */
- public int getErrorCode()
- {
- return vendorCode;
- }
-
- /**
- * This method returns the exception that is chained to this object.
- *
- * @return The exception chained to this object, which may be
- * <code>null</code>.
- */
- public SQLException getNextException()
- {
- return next;
- }
-
- /**
- * This method adds a new exception to the end of the chain of exceptions
- * that are chained to this object.
- *
- * @param e The exception to add to the end of the chain.
- */
- public void setNextException(SQLException e)
- {
- if (e == null)
- return;
-
- SQLException list_entry = this;
- while (list_entry.getNextException() != null)
- list_entry = list_entry.getNextException();
-
- list_entry.next = e;
- }
-}
diff --git a/libjava/java/sql/SQLInput.java b/libjava/java/sql/SQLInput.java
deleted file mode 100644
index 730627d9a9e..00000000000
--- a/libjava/java/sql/SQLInput.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/* SQLInput.java -- Read SQL values from a stream
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.math.BigDecimal;
-import java.net.URL;
-
-/**
- * This interface provides methods for reading values from a stream
- * that is connected to a SQL structured or distinct type. It is used
- * for custom mapping of user defined data types.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface SQLInput
-{
- /**
- * This method reads the next item from the stream a Java
- * <code>String</code>.
- *
- * @return The value read from the stream as a <code>String</code>.
- * @exception SQLException If an error occurs.
- */
- String readString() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>boolean</code>.
- *
- * @return The value read from the stream as a <code>boolean</code>.
- * @exception SQLException If an error occurs.
- */
- boolean readBoolean() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>byte</code>.
- *
- * @return The value read from the stream as a <code>byte</code>.
- * @exception SQLException If an error occurs.
- */
- byte readByte() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>short</code>.
- *
- * @return The value read from the stream as a <code>short</code>.
- * @exception SQLException If an error occurs.
- */
- short readShort() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>int</code>.
- *
- * @return The value read from the stream as an <code>int</code>.
- * @exception SQLException If an error occurs.
- */
- int readInt() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>long</code>.
- *
- * @return The value read from the stream as a <code>long</code>.
- * @exception SQLException If an error occurs.
- */
- long readLong() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>float</code>.
- *
- * @return The value read from the stream as a <code>float</code>.
- * @exception SQLException If an error occurs.
- */
- float readFloat() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>double</code>.
- *
- * @return The value read from the stream as a <code>double</code>.
- * @exception SQLException If an error occurs.
- */
- double readDouble() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>BigDecimal</code>.
- *
- * @return The value read from the stream as a <code>BigDecimal</code>.
- * @exception SQLException If an error occurs.
- */
- BigDecimal readBigDecimal() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * byte array
- *
- * @return The value read from the stream as a byte array.
- * @exception SQLException If an error occurs.
- */
- byte[] readBytes() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>java.sql.Date</code>.
- *
- * @return The value read from the stream as a <code>java.sql.Date</code>.
- * @exception SQLException If an error occurs.
- */
- Date readDate() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>java.sql.Time</code>.
- *
- * @return The value read from the stream as a <code>java.sql.Time</code>.
- * @exception SQLException If an error occurs.
- */
- Time readTime() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>java.sql.Timestamp</code>.
- *
- * @return The value read from the stream as a <code>java.sql.Timestamp</code>.
- * @exception SQLException If an error occurs.
- */
- Timestamp readTimestamp() throws SQLException;
-
- /**
- * This method reads the next item from the stream a character
- * <code>Reader</code>.
- *
- * @return The value read from the stream as a <code>Reader</code>.
- * @exception SQLException If an error occurs.
- */
- Reader readCharacterStream() throws SQLException;
-
- /**
- * This method reads the next item from the stream a ASCII text
- * <code>InputStream</code>.
- *
- * @return The value read from the stream as an <code>InputStream</code>.
- * @exception SQLException If an error occurs.
- */
- InputStream readAsciiStream() throws SQLException;
-
- /**
- * This method reads the next item from the stream a binary
- * <code>InputStream</code>.
- *
- * @return The value read from the stream as an <code>InputStream</code>.
- * @exception SQLException If an error occurs.
- */
- InputStream readBinaryStream() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java
- * <code>Object</code>.
- *
- * @return The value read from the stream as an <code>Object</code>.
- * @exception SQLException If an error occurs.
- */
- Object readObject() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java SQL
- * <code>Ref</code>.
- *
- * @return The value read from the stream as an <code>Ref</code>.
- * @exception SQLException If an error occurs.
- */
- Ref readRef() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java SQL
- * <code>Blob</code>.
- *
- * @return The value read from the stream as a <code>Blob</code>.
- * @exception SQLException If an error occurs.
- */
- Blob readBlob() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java SQL
- * <code>Clob</code>.
- *
- * @return The value read from the stream as a <code>Clob</code>.
- * @exception SQLException If an error occurs.
- */
- Clob readClob() throws SQLException;
-
- /**
- * This method reads the next item from the stream a Java SQL
- * <code>Array</code>.
- *
- * @return The value read from the stream as an <code>Array</code>.
- * @exception SQLException If an error occurs.
- */
- Array readArray() throws SQLException;
-
- /**
- * This method tests whether or not the last value read was a SQL
- * NULL value.
- *
- * @return <code>true</code> if the last value read was a NULL,
- * <code>false</code> otherwise.
- * @exception SQLException If an error occurs.
- */
- boolean wasNull() throws SQLException;
-
- /**
- * @since 1.4
- */
- URL readURL() throws SQLException;
-}
-
diff --git a/libjava/java/sql/SQLOutput.java b/libjava/java/sql/SQLOutput.java
deleted file mode 100644
index 8e6c88f8cf6..00000000000
--- a/libjava/java/sql/SQLOutput.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/* SQLOutput.java -- Write SQL values to a stream
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.math.BigDecimal;
-import java.net.URL;
-
-/**
- * This interface provides methods for writing Java types to a SQL stream.
- * It is used for implemented custom type mappings for user defined data
- * types.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface SQLOutput
-{
- /**
- * This method writes the specified Java <code>String</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeString(String x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>boolean</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeBoolean(boolean x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>byte</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeByte(byte x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>short</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeShort(short x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>int</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeInt(int x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>long</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeLong(long x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>float</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeFloat(float x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>double</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeDouble(double x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>BigDecimal</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeBigDecimal(BigDecimal x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>byte</code> array
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeBytes(byte[] x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>java.sql.Date</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeDate(Date x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>java.sql.Time</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeTime(Time x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>java.sql.Timestamp</code>
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeTimestamp(Timestamp x) throws SQLException;
-
- /**
- * This method writes the specified Java character stream
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeCharacterStream(Reader x) throws SQLException;
-
- /**
- * This method writes the specified ASCII text stream
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeAsciiStream(InputStream x) throws SQLException;
-
- /**
- * This method writes the specified uninterpreted binary byte stream
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeBinaryStream(InputStream x) throws SQLException;
-
- /**
- * This method writes the specified Java <code>SQLData</code> object
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeObject(SQLData x) throws SQLException;
-
- /**
- * This method writes the specified Java SQL <code>Ref</code> object
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeRef(Ref x) throws SQLException;
-
- /**
- * This method writes the specified Java SQL <code>Blob</code> object
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeBlob(Blob x) throws SQLException;
-
- /**
- * This method writes the specified Java SQL <code>Clob</code> object
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeClob(Clob x) throws SQLException;
-
- /**
- * This method writes the specified Java SQL <code>Struct</code> object
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeStruct(Struct x) throws SQLException;
-
- /**
- * This method writes the specified Java SQL <code>Array</code> object
- * to the SQL stream.
- *
- * @param value The value to write to the stream.
- * @exception SQLException If an error occurs.
- */
- void writeArray(Array x) throws SQLException;
-
- /**
- * @since 1.4
- */
- void writeURL(URL x) throws SQLException;
-}
diff --git a/libjava/java/sql/SQLPermission.java b/libjava/java/sql/SQLPermission.java
deleted file mode 100644
index 101fa0161b4..00000000000
--- a/libjava/java/sql/SQLPermission.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* SQLPermission.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.security.BasicPermission;
-
-/**
- * @since 1.3
- */
-public final class SQLPermission extends BasicPermission
-{
- public SQLPermission(String name)
- {
- super(name);
- }
-
- public SQLPermission(String name, String actions)
- {
- super(name, actions);
- }
-}
diff --git a/libjava/java/sql/SQLWarning.java b/libjava/java/sql/SQLWarning.java
deleted file mode 100644
index 841d137e13a..00000000000
--- a/libjava/java/sql/SQLWarning.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/* SQLWarning.java -- Database access warnings.
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * This exception is thrown when a database warning occurs.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class SQLWarning extends SQLException
-{
- static final long serialVersionUID = 3917336774604784856L;
-
- /**
- * This method initializes a nwe instance of <code>SQLWarning</code>
- * with the specified descriptive error message, SQL state string, and
- * vendor code.
- *
- * @param message A string describing the nature of the error.
- * @param SQLState A string containing the SQL state of the error.
- * @param vendorCode The vendor error code associated with this error.
- */
- public SQLWarning(String reason, String SQLState, int vendorCode)
- {
- super(reason, SQLState, vendorCode);
- }
-
- /**
- * This method initializes a new instance of <code>SQLWarning</code>
- * with the specified descriptive error message and SQL state string.
- * The vendor error code of this instance will be 0.
- *
- * @param message A string describing the nature of the error.
- * @param SQLState A string containing the SQL state of the error.
- */
- public SQLWarning(String message, String SQLState)
- {
- super(message, SQLState);
- }
-
- /**
- * This method initializes a new instance of <code>SQLWarning</code>
- * with the specified descriptive error message. The SQL state of this
- * instance will be <code>null</code> and the vendor error code will be 0.
- *
- * @param message A string describing the nature of the error.
- */
- public SQLWarning(String message)
- {
- super(message);
- }
-
- /**
- * This method initializes a new instance of <code>SQLWarning</code>
- * that does not have a descriptive messages and SQL state, and which
- * has a vendor error code of 0.
- */
- public SQLWarning()
- {
- super();
- }
-
- /**
- * This method returns the exception that is chained to this object.
- *
- * @return The exception chained to this object, which may be
- * <code>null</code>.
- */
- public SQLWarning getNextWarning()
- {
- return (SQLWarning) super.getNextException();
- }
-
- /**
- * This method adds a new exception to the end of the chain of exceptions
- * that are chained to this object.
- *
- * @param w The exception to add to the end of the chain.
- */
- public void setNextWarning(SQLWarning w)
- {
- super.setNextException(w);
- }
-}
diff --git a/libjava/java/sql/Savepoint.java b/libjava/java/sql/Savepoint.java
deleted file mode 100644
index a4d89ae6e50..00000000000
--- a/libjava/java/sql/Savepoint.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* SavePoint.java -- Returns information about the ResultSet
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * @since 1.4
- */
-public interface Savepoint
-{
- /**
- * @since 1.4
- */
- int getSavepointId() throws SQLException;
-
- /**
- * @since 1.4
- */
- String getSavepointName() throws SQLException;
-}
diff --git a/libjava/java/sql/Statement.java b/libjava/java/sql/Statement.java
deleted file mode 100644
index 42e8e8e8816..00000000000
--- a/libjava/java/sql/Statement.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/* Statement.java -- Interface for executing SQL statements.
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * This interface provides a mechanism for executing SQL statements.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Statement
-{
- int CLOSE_CURRENT_RESULT = 1;
- int KEEP_CURRENT_RESULT = 2;
- int CLOSE_ALL_RESULTS = 3;
- int SUCCESS_NO_INFO = -2;
- int EXECUTE_FAILED = -3;
- int RETURN_GENERATED_KEYS = 1;
- int NO_GENERATED_KEYS = 2;
-
- /**
- * This method executes the specified SQL SELECT statement and returns a
- * (possibly empty) <code>ResultSet</code> with the results of the query.
- *
- * @param sql The SQL statement to execute.
- * @return The result set of the SQL statement.
- * @exception SQLException If an error occurs.
- */
- ResultSet executeQuery(String sql) throws SQLException;
-
- /**
- * This method executes the specified SQL INSERT, UPDATE, or DELETE statement
- * and returns the number of rows affected, which may be 0.
- *
- * @param sql The SQL statement to execute.
- * @return The number of rows affected by the SQL statement.
- * @exception SQLException If an error occurs.
- */
- int executeUpdate(String sql) throws SQLException;
-
- /**
- * This method closes the statement and frees any associated resources.
- *
- * @exception SQLException If an error occurs.
- */
- void close() throws SQLException;
-
- /**
- * This method returns the maximum length of any column value in bytes.
- *
- * @return The maximum length of any column value in bytes.
- * @exception SQLException If an error occurs.
- */
- int getMaxFieldSize() throws SQLException;
-
- /**
- * This method sets the limit for the maximum length of any column in bytes.
- *
- * @param maxsize The new maximum length of any column in bytes.
- * @exception SQLException If an error occurs.
- */
- void setMaxFieldSize(int max) throws SQLException;
-
- /**
- * This method returns the maximum possible number of rows in a result set.
- *
- * @return The maximum possible number of rows in a result set.
- * @exception SQLException If an error occurs.
- */
- int getMaxRows() throws SQLException;
-
- /**
- * This method sets the maximum number of rows that can be present in a
- * result set.
- *
- * @param maxrows The maximum possible number of rows in a result set.
- * @exception SQLException If an error occurs.
- */
- void setMaxRows(int max) throws SQLException;
-
- /**
- * This method sets the local escape processing mode on or off. The
- * default value is on.
- *
- * @param escape <code>true</code> to enable local escape processing,
- * <code>false</code> to disable it.
- * @exception SQLException If an error occurs.
- */
- void setEscapeProcessing(boolean enable) throws SQLException;
-
- /**
- * The method returns the number of seconds a statement may be in process
- * before timing out. A value of 0 means there is no timeout.
- *
- * @return The SQL statement timeout in seconds.
- * @exception SQLException If an error occurs.
- */
- int getQueryTimeout() throws SQLException;
-
- /**
- * This method sets the number of seconds a statement may be in process
- * before timing out. A value of 0 means there is no timeout.
- *
- * @param timeout The new SQL statement timeout value.
- * @exception SQLException If an error occurs.
- */
- void setQueryTimeout(int seconds) throws SQLException;
-
- /**
- * This method cancels an outstanding statement, if the database supports
- * that operation.
- *
- * @exception SQLException If an error occurs.
- */
- void cancel() throws SQLException;
-
- /**
- * This method returns the first SQL warning attached to this statement.
- * Subsequent warnings will be chained to this one.
- *
- * @return The first SQL warning for this statement.
- * @exception SQLException If an error occurs.
- */
- SQLWarning getWarnings() throws SQLException;
-
- /**
- * This method clears any SQL warnings that have been attached to this
- * statement.
- *
- * @exception SQLException If an error occurs.
- */
- void clearWarnings() throws SQLException;
-
- /**
- * This method sets the cursor name that will be used by the result set.
- *
- * @param name The cursor name to use for this statement.
- * @exception SQLException If an error occurs.
- */
- void setCursorName(String name) throws SQLException;
-
- /**
- * This method executes an arbitrary SQL statement of any time. The
- * methods <code>getResultSet</code>, <code>getMoreResults</code> and
- * <code>getUpdateCount</code> retrieve the results.
- *
- * @return <code>true</code> if a result set was returned, <code>false</code>
- * if an update count was returned.
- * @exception SQLException If an error occurs.
- */
- boolean execute(String sql) throws SQLException;
-
- /**
- * This method returns the result set of the SQL statement that was
- * executed. This should be called only once per result set returned.
- *
- * @return The result set of the query, or <code>null</code> if there was
- * no result set (for example, if the statement was an UPDATE).
- * @exception SQLException If an error occurs.
- * @see execute
- */
- ResultSet getResultSet() throws SQLException;
-
- /**
- * This method returns the update count of the SQL statement that was
- * executed. This should be called only once per executed SQL statement.
- *
- * @return The update count of the query, or -1 if there was no update
- * count (for example, if the statement was a SELECT).
- * @exception SQLException If an error occurs.
- * @see execute
- */
- int getUpdateCount() throws SQLException;
-
- /**
- * This method advances the result set pointer to the next result set,
- * which can then be retrieved using <code>getResultSet</code>
- *
- * @return <code>true</code> if there is another result set,
- * <code>false</code> otherwise (for example, the next result is an
- * update count).
- * @exception SQLException If an error occurs.
- * @see execute
- */
- boolean getMoreResults() throws SQLException;
-
- /**
- * This method informs the driver which direction the result set will
- * be accessed in.
- *
- * @param direction The direction the result set will be accessed in (?????)
- * @exception SQLException If an error occurs.
- */
- void setFetchDirection(int direction) throws SQLException;
-
- /**
- * This method returns the current direction that the driver thinks the
- * result set will be accessed int.
- *
- * @return The direction the result set will be accessed in (????)
- * @exception SQLException If an error occurs.
- */
- int getFetchDirection() throws SQLException;
-
- /**
- * This method informs the driver how many rows it should fetch from the
- * database at a time.
- *
- * @param numrows The number of rows the driver should fetch at a time
- * to populate the result set.
- * @exception SQLException If an error occurs.
- */
- void setFetchSize(int rows) throws SQLException;
-
- /**
- * This method returns the number of rows the driver believes should be
- * fetched from the database at a time.
- *
- * @return The number of rows that will be fetched from the database at a time.
- * @exception SQLException If an error occurs.
- */
- int getFetchSize() throws SQLException;
-
- /**
- * This method returns the concurrency type of the result set for this
- * statement. This will be one of the concurrency types defined in
- * <code>ResultSet</code>.
- *
- * @return The concurrency type of the result set for this statement.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- int getResultSetConcurrency() throws SQLException;
-
- /**
- * This method returns the result set type for this statement. This will
- * be one of the result set types defined in <code>ResultSet</code>.
- *
- * @return The result set type for this statement.
- * @exception SQLException If an error occurs.
- * @see ResultSet
- */
- int getResultSetType() throws SQLException;
-
- /**
- * This method adds a SQL statement to a SQL batch. A driver is not
- * required to implement this method.
- *
- * @param sql The sql statement to add to the batch.
- * @exception SQLException If an error occurs.
- */
- void addBatch(String sql) throws SQLException;
-
- /**
- * This method clears out any SQL statements that have been populated in
- * the current batch. A driver is not required to implement this method.
- *
- * @exception SQLException If an error occurs.
- */
- void clearBatch() throws SQLException;
-
- /**
- * This method executes the SQL batch and returns an array of update
- * counts - one for each SQL statement in the batch - ordered in the same
- * order the statements were added to the batch. A driver is not required
- * to implement this method.
- *
- * @return An array of update counts for this batch.
- * @exception SQLException If an error occurs.
- */
- int[] executeBatch() throws SQLException;
-
- /**
- * This method returns the <code>Connection</code> instance that was
- * used to create this object.
- *
- * @return The connection used to create this object.
- * @exception SQLException If an error occurs.
- */
- Connection getConnection() throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean getMoreResults(int current) throws SQLException;
-
- /**
- * @since 1.4
- */
- ResultSet getGeneratedKeys() throws SQLException;
-
- /**
- * @since 1.4
- */
- int executeUpdate(String sql, int autoGeneratedKeys)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- int executeUpdate(String sql, int[] columnIndexes)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- int executeUpdate(String sql, String[] columnNames)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean execute(String sql, int autoGeneratedKeys)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean execute(String sql, int[] columnIndexes) throws SQLException;
-
- /**
- * @since 1.4
- */
- boolean execute(String sql, String[] columnNames)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- int getResultSetHoldability() throws SQLException;
-}
diff --git a/libjava/java/sql/Struct.java b/libjava/java/sql/Struct.java
deleted file mode 100644
index 5cbc88e133a..00000000000
--- a/libjava/java/sql/Struct.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Struct.java -- Mapping for a SQL structured type.
- Copyright (C) 1999, 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.util.Map;
-
-/**
- * This interface implements the standard type mapping for a SQL
- * structured type.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface Struct
-{
- /**
- * This method returns the name of the SQL structured type for this
- * object.
- *
- * @return The SQL structured type name.
- * @exception SQLException If an error occurs.
- */
- String getSQLTypeName() throws SQLException;
-
- /**
- * This method returns the attributes of this SQL structured type.
- *
- * @return The attributes of this structure type.
- * @exception SQLException If an error occurs.
- */
- Object[] getAttributes() throws SQLException;
-
- /**
- * This method returns the attributes of this SQL structured type.
- * The specified map of type mappings overrides the default mappings.
- *
- * @param map The map of SQL type mappings.
- * @return The attributes of this structure type.
- * @exception SQLException If a error occurs.
- */
- Object[] getAttributes(Map map) throws SQLException;
-}
diff --git a/libjava/java/sql/Time.java b/libjava/java/sql/Time.java
deleted file mode 100644
index eb6ef2d651e..00000000000
--- a/libjava/java/sql/Time.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/* Time.java -- Wrapper around java.util.Date
- Copyright (C) 1999, 2000, 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-
-/**
- * This class is a wrapper around java.util.Date to allow the JDBC
- * driver to identify the value as a SQL Time.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Time extends java.util.Date
-{
- static final long serialVersionUID = 8397324403548013681L;
-
- /**
- * Used for parsing and formatting this date.
- */
- private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public int getDate() throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public int getDay() throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public int getMonth() throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public int getYear() throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public void setDate(int newValue) throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public void setMonth(int newValue) throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method always throws an IllegalArgumentException.
- *
- * @throws IllegalArgumentException when it's called.
- * @deprecated
- */
- public void setYear(int newValue) throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
-
- /**
- * This method returns a new instance of this class by parsing a
- * date in JDBC format into a Java date.
- *
- * @param str The string to parse.
- * @return The resulting <code>java.sql.Time</code> value.
- *
- * @deprecated
- */
- public static Time valueOf (String str)
- {
- try
- {
- java.util.Date d = (java.util.Date) sdf.parseObject(str);
-
- if (d == null)
- throw new IllegalArgumentException(str);
- else
- return new Time(d.getTime());
- }
- catch (ParseException e)
- {
- throw new IllegalArgumentException(str);
- }
- }
-
- /**
- * This method initializes a new instance of this class with the
- * specified year, month, and day.
- *
- * @param hour The hour for this Time (0-23)
- * @param minute The minute for this time (0-59)
- * @param second The second for this time (0-59)
- * @deprecated
- */
- public Time(int hour, int minute, int second)
- {
- super(System.currentTimeMillis());
-
- setHours(hour);
- setMinutes(minute);
- setSeconds(second);
- }
-
- /**
- * This method initializes a new instance of this class with the
- * specified time value representing the number of seconds since
- * Jan 1, 1970 at 12:00 midnight GMT.
- *
- * @param time The time value to intialize this <code>Time</code> to.
- */
- public Time(long date)
- {
- super(date);
- }
-
- /**
- * This method returns this date in JDBC format.
- *
- * @return This date as a string.
- *
- * @deprecated
- */
- public String toString ()
- {
- return sdf.format (this);
- }
-
-}
-
diff --git a/libjava/java/sql/Timestamp.java b/libjava/java/sql/Timestamp.java
deleted file mode 100644
index f3459b22f3e..00000000000
--- a/libjava/java/sql/Timestamp.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/* Time.java -- Wrapper around java.util.Date
- Copyright (C) 1999, 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-import java.text.DecimalFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-
-/**
- * This class is a wrapper around java.util.Date to allow the JDBC
- * driver to identify the value as a SQL Timestamp. Note that this
- * class also adds an additional field for nano-seconds, and so
- * is not completely identical to <code>java.util.Date</code> as
- * the <code>java.sql.Date</code> and <code>java.sql.Time</code>
- * classes are.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Timestamp extends java.util.Date
-{
- static final long serialVersionUID = 2745179027874758501L;
-
- /**
- * Used for parsing and formatting this date.
- */
- private static SimpleDateFormat dateFormat =
- new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- private static DecimalFormat decimalFormat = new DecimalFormat("000000000");
- private static StringBuffer sbuf = new StringBuffer(29);
-
- /**
- * The nanosecond value for this object
- */
- private int nanos;
-
- /**
- * This method returns a new instance of this class by parsing a
- * date in JDBC format into a Java date.
- *
- * @param str The string to parse.
- * @return The resulting <code>java.sql.Timestamp</code> value.
- */
- public static Timestamp valueOf(String str)
- {
- int nanos = 0;
- int dot = str.indexOf('.');
- if (dot != -1)
- {
- if (str.lastIndexOf('.') != dot)
- throw new IllegalArgumentException(str);
-
- int len = str.length() - dot - 1;
- if (len < 1 || len > 9)
- throw new IllegalArgumentException(str);
-
- nanos = Integer.parseInt(str.substring(dot + 1));
- for (int i = len; i < 9; i++)
- nanos *= 10;
-
- str = str.substring(0, dot);
-
- }
-
- try
- {
- java.util.Date d;
- synchronized (dateFormat)
- {
- d = (java.util.Date) dateFormat.parseObject(str);
- }
-
- if (d == null)
- throw new IllegalArgumentException(str);
-
- Timestamp ts = new Timestamp(d.getTime() + nanos / 1000000);
- ts.nanos = nanos;
- return ts;
- }
- catch (ParseException e)
- {
- throw new IllegalArgumentException(str);
- }
- }
-
- /**
- * This method initializes a new instance of this class with the
- * specified year, month, and day.
- *
- * @param year The year for this Timestamp (year - 1900)
- * @param month The month for this Timestamp (0-11)
- * @param day The day for this Timestamp (1-31)
- * @param hour The hour for this Timestamp (0-23)
- * @param minute The minute for this Timestamp (0-59)
- * @param second The second for this Timestamp (0-59)
- * @param nanos The nanosecond value for this Timestamp (0 to 999,999,9999)
- * @deprecated
- */
- public Timestamp(int year, int month, int day, int hour, int minute,
- int second, int nanos)
- {
- super(year, month, day, hour, minute, second);
- this.nanos = nanos;
- }
-
- /**
- * This method initializes a new instance of this class with the
- * specified time value representing the number of milliseconds since
- * Jan 1, 1970 at 12:00 midnight GMT.
- *
- * @param time The time value to intialize this <code>Time</code> to.
- */
- public Timestamp(long date)
- {
- super(date - (date % 1000));
- nanos = (int) (date % 1000) * 1000000;
- }
-
- /**
- * Return the value of this Timestamp as the number of milliseconds
- * since Jan 1, 1970 at 12:00 midnight GMT.
- */
- public long getTime()
- {
- return super.getTime() + (nanos / 1000000);
- }
-
- /**
- * This method returns this date in JDBC format.
- *
- * @return This date as a string.
- */
- public String toString()
- {
- synchronized (dateFormat)
- {
- sbuf.setLength(0);
- dateFormat.format(this, sbuf, null);
- sbuf.append('.');
- decimalFormat.format(nanos, sbuf, null);
- int end = sbuf.length() - 1;
- while (end > 20 && sbuf.charAt(end) == '0')
- end--;
- return sbuf.substring(0, end + 1);
- }
- }
-
- /**
- * This method returns the nanosecond value for this object.
- * @return The nanosecond value for this object.
- */
- public int getNanos()
- {
- return nanos;
- }
-
- /**
- * This method sets the nanosecond value for this object.
- *
- * @param nanos The nanosecond value for this object.
- */
- public void setNanos(int nanos)
- {
- this.nanos = nanos;
- }
-
- /**
- * This methods tests whether this object is earlier than the specified
- * object.
- *
- * @param ts The other <code>Timestamp</code> to test against.
- * @return <code>true</code> if this object is earlier than the other object,
- * <code>false</code> otherwise.
- */
- public boolean before(Timestamp ts)
- {
- long time1 = getTime();
- long time2 = ts.getTime();
- if (time1 < time2 || (time1 == time2 && getNanos() < ts.getNanos()))
- return true;
- return false;
- }
-
- /**
- * This methods tests whether this object is later than the specified
- * object.
- *
- * @param ts The other <code>Timestamp</code> to test against.
- *
- * @return <code>true</code> if this object is later than the other object,
- * <code>false</code> otherwise.
- */
- public boolean after(Timestamp ts)
- {
- long time1 = getTime();
- long time2 = ts.getTime();
- if (time1 > time2 || (time1 == time2 && getNanos() > ts.getNanos()))
- return true;
- return false;
- }
-
- /**
- * This method these the specified <code>Object</code> for equality
- * against this object. This will be true if an only if the specified
- * object is an instance of <code>Timestamp</code> and has the same
- * time value fields.
- *
- * @param obj The object to test against for equality.
- *
- * @return <code>true</code> if the specified object is equal to this
- * object, <code>false</code> otherwise.
- */
- public boolean equals(Object obj)
- {
- if (!(obj instanceof Timestamp))
- return false;
-
- return equals((Timestamp) obj);
- }
-
- /**
- * This method tests the specified timestamp for equality against this
- * object. This will be true if and only if the specified object is
- * not <code>null</code> and contains all the same time value fields
- * as this object.
- *
- * @param ts The <code>Timestamp</code> to test against for equality.
- *
- * @return <code>true</code> if the specified object is equal to this
- * object, <code>false</code> otherwise.
- */
- public boolean equals(Timestamp ts)
- {
- if (ts == null)
- return false;
-
- if (ts.getTime() != getTime())
- return false;
-
- if (ts.getNanos() != getNanos())
- return false;
-
- return true;
- }
-
- /**
- * Compare two Timestamp
- * @param when the other Timestamp.
- * @return 0, if the date represented
- * by obj is exactly the same as the time represented by this
- * object, a negative if this Timestamp is before the other Timestamp, and
- * a positive value otherwise.
- * @since 1.2
- */
- public int compareTo(Timestamp ts)
- {
- int s = super.compareTo((java.util.Date) ts);
- if (s != 0)
- return s;
- // If Date components were equal, then we check the nanoseconds.
- return nanos - ts.nanos;
- }
-
- /**
- * Compares this Timestamp to another. This behaves like
- * <code>compareTo(Timestamp)</code>, but it may throw a
- * <code>ClassCastException</code>
- * @param obj the other Timestamp.
- * @return 0, if the Timestamp represented
- * by obj is exactly the same as the time represented by this
- * object, a negative if this Timestamp is before the other Timestamp, and
- * a positive value otherwise.
- * @exception ClassCastException if obj is not of type Timestamp.
- * @since 1.2
- */
- public int compareTo(Object obj)
- {
- return compareTo((Timestamp) obj);
- }
-}
diff --git a/libjava/java/sql/Types.java b/libjava/java/sql/Types.java
deleted file mode 100644
index 7dd41411ada..00000000000
--- a/libjava/java/sql/Types.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Types.java -- SQL type constants
- Copyright (C) 1999, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.sql;
-
-/**
- * This class contains constants that are used to identify SQL data types.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Types
-{
- // These should be self explanatory. People need a SQL book, not
- // Javadoc comments for these.
- public static final int BIT = -7;
- public static final int TINYINT = -6;
- public static final int SMALLINT = 5;
- public static final int INTEGER = 4;
- public static final int BIGINT = -5;
- public static final int FLOAT = 6;
- public static final int REAL = 7;
- public static final int DOUBLE = 8;
- public static final int NUMERIC = 2;
- public static final int DECIMAL = 3;
- public static final int CHAR = 1;
- public static final int VARCHAR = 12;
- public static final int LONGVARCHAR = -1;
- public static final int DATE = 91;
- public static final int TIME = 92;
- public static final int TIMESTAMP = 93;
- public static final int BINARY = -2;
- public static final int VARBINARY = -3;
- public static final int LONGVARBINARY = -4;
- public static final int NULL = 0;
- public static final int OTHER = 1111;
- public static final int JAVA_OBJECT = 2000;
- public static final int DISTINCT = 2001;
- public static final int STRUCT = 2002;
- public static final int ARRAY = 2003;
- public static final int BLOB = 2004;
- public static final int CLOB = 2005;
- public static final int REF = 2006;
- public static final int DATALINK = 70;
- public static final int BOOLEAN = 16;
-
- // This class can't be instantiated.
- private Types()
- {
- }
-}
diff --git a/libjava/java/text/Annotation.java b/libjava/java/text/Annotation.java
deleted file mode 100644
index cecb44aaf0e..00000000000
--- a/libjava/java/text/Annotation.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Annotation.java -- Wrapper for a text attribute object
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-/**
- * This class is used as a wrapper for a text attribute object. Annotation
- * objects are associated with a specific range of text. Changing either
- * the text range or the underlying text invalidates the object.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Annotation
-{
-
-/*
- * Instance Variables
- */
-
-/**
- * This is the attribute object being wrappered
- */
-private Object attrib;
-
-/*************************************************************************/
-
-/**
- * Constructors
- */
-
-/**
- * This method initializes a new instance of <code>Annotation</code> to
- * wrapper the specified text attribute object.
- *
- * @param attrib The text attribute <code>Object</code> to wrapper.
- */
-public
-Annotation(Object attrib)
-{
- this.attrib = attrib;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * This method returns the text attribute object this <code>Annotation</code>
- * instance is wrappering.
- *
- * @return The text attribute object for this <code>Annotation</code>.
- */
-public Object
-getValue()
-{
- return(attrib);
-}
-
-/*************************************************************************/
-
-/**
- * This method returns a <code>String</code> representation of this
- * object.
- *
- * @return This object as a <code>String</code>.
- */
-public String
-toString()
-{
- return(getClass().getName() + "[value=" + attrib.toString() + "]");
-}
-
-} // class Annotation
-
diff --git a/libjava/java/text/AttributedCharacterIterator.java b/libjava/java/text/AttributedCharacterIterator.java
deleted file mode 100644
index e5686ba346d..00000000000
--- a/libjava/java/text/AttributedCharacterIterator.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/* AttributedCharacterIterator.java -- Iterate over attributes
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import java.io.InvalidObjectException;
-import java.io.Serializable;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * This interface extends the <code>CharacterIterator</code> interface
- * in order to support iteration over character attributes as well as
- * over the characters themselves.
- * <p>
- * In addition to attributes of specific characters, this interface
- * supports the concept of the "attribute run", which is an attribute
- * that is defined for a particular value across an entire range of
- * characters or which is undefined over a range of characters.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface AttributedCharacterIterator extends CharacterIterator
-{
- /**
- * This class defines attribute keys that are used as text attributes.
- */
- public static class Attribute implements Serializable
- {
- private static final long serialVersionUID = -9142742483513960612L;
-
- /**
- * This is the attribute for the language of the text. The value of
- * attributes of this key type are instances of <code>Locale</code>.
- */
- public static final Attribute LANGUAGE = new Attribute ("LANGUAGE");
-
- /**
- * This is the attribute for the reading form of text. This is used
- * for storing pronunciation along with the written text for languages
- * which need it. The value of attributes of this key type are
- * instances of <code>Annotation</code> which wrappers a <code>String</code>.
- */
- public static final Attribute READING = new Attribute ("READING");
-
- /**
- * This is the attribute for input method segments. The value of attributes
- * of this key type are instances of <code>Annotation</code> which wrapper
- * a <code>String</code>.
- */
- public static final Attribute INPUT_METHOD_SEGMENT =
- new Attribute ("INPUT_METHOD_SEGMENT");
-
- /**
- * This is the name of the attribute key
- * @serial
- */
- private String name;
-
- /**
- * This method initializes a new instance of this class with the specified
- * name.
- *
- * @param name The name of this attribute key.
- */
- protected Attribute (String name)
- {
- this.name = name;
- }
-
- /**
- * This method returns the name of this attribute.
- *
- * @return The attribute name
- */
- protected String getName()
- {
- return name;
- }
-
- /**
- * This method resolves an instance of <code>AttributedCharacterIterator.Attribute</code>
- * that is being deserialized to one of the three pre-defined attribute
- * constants. It does this by comparing the names of the attributes. The
- * constant that the deserialized object resolves to is returned.
- *
- * @return The resolved contant value
- *
- * @exception InvalidObjectException If the object being deserialized cannot be resolved.
- */
- protected Object readResolve() throws InvalidObjectException
- {
- if (this.equals (READING))
- return READING;
-
- if (this.equals (LANGUAGE))
- return LANGUAGE;
-
- if (this.equals (INPUT_METHOD_SEGMENT))
- return INPUT_METHOD_SEGMENT;
-
- throw new InvalidObjectException ("Can't resolve Attribute: " + getName());
- }
-
- /**
- * This method tests this object for equality against the specified object.
- * The two objects will be considered equal if and only if:
- * <ul>
- * <li>The specified object is not <code>null</code>.
- * <li>The specified object is an instance of <code>AttributedCharacterIterator.Attribute</code>.
- * <li>The specified object has the same attribute name as this object.
- * </ul>
- *
- * @param The <code>Object</code> to test for equality against this object.
- *
- * @return <code>true</code> if the specified object is equal to this one, <code>false</code> otherwise.
- */
- public final boolean equals (Object obj)
- {
- if (obj == this)
- return true;
- else
- return false;
- }
-
- /**
- * This method returns a hash value for this object.
- *
- * @return A hash value for this object.
- */
- public final int hashCode()
- {
- return super.hashCode();
- }
-
- /**
- * This method returns a <code>String</code> representation of this object.
- *
- * @return A <code>String</code> representation of this object.
- */
- public String toString()
- {
- return getClass().getName() + "(" + getName() + ")";
- }
-
- } // Inner class Attribute
-
- /**
- * This method returns a list of all keys that are defined for the
- * text range. This can be an empty list if no attributes are defined.
- *
- * @return A list of keys
- */
- Set getAllAttributeKeys();
-
- /**
- * This method returns a <code>Map</code> of the attributed defined for
- * the current character.
- *
- * @return A <code>Map</code> of the attributes for the current character.
- */
- Map getAttributes();
-
- /**
- * This method returns the value of the specified attribute for the
- * current character. If the attribute is not defined for the current
- * character, <code>null</code> is returned.
- *
- * @param attrib The attribute to retrieve the value of.
- *
- * @return The value of the specified attribute
- */
- Object getAttribute (AttributedCharacterIterator.Attribute attrib);
-
- /**
- * This method returns the index of the first character in the run that
- * contains all attributes defined for the current character.
- *
- * @return The start index of the run
- */
- int getRunStart();
-
- /**
- * This method returns the index of the first character in the run that
- * contains all attributes in the specified <code>Set</code> defined for
- * the current character.
- *
- * @param attribs The <code>Set</code> of attributes.
- *
- * @return The start index of the run.
- */
- int getRunStart (Set attribs);
-
- /**
- * This method returns the index of the first character in the run that
- * contains the specified attribute defined for the current character.
- *
- * @param attrib The attribute.
- *
- * @return The start index of the run.
- */
- int getRunStart (AttributedCharacterIterator.Attribute attrib);
-
- /**
- * This method returns the index of the character after the end of the run
- * that contains all attributed defined for the current character.
- *
- * @return The end index of the run.
- */
- int getRunLimit();
-
- /**
- * This method returns the index of the character after the end of the run
- * that contains all attributes in the specified <code>Set</code> defined
- * for the current character.
- *
- * @param attribs The <code>Set</code> of attributes.
- *
- * @return The end index of the run.
- */
- int getRunLimit (Set attribs);
-
- /**
- * This methods returns the index of the character after the end of the run
- * that contains the specified attribute defined for the current character.
- *
- * @param attrib The attribute.
- *
- * @return The end index of the run.
- */
- int getRunLimit (AttributedCharacterIterator.Attribute attrib);
-
-} // interface AttributedCharacterIterator
diff --git a/libjava/java/text/AttributedString.java b/libjava/java/text/AttributedString.java
deleted file mode 100644
index b9ced8f5ac2..00000000000
--- a/libjava/java/text/AttributedString.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/* AttributedString.java -- Models text with attributes
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * This class models a <code>String</code> with attributes over various
- * subranges of the string. It allows applications to access this
- * information via the <code>AttributedCharcterIterator</code> interface.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class AttributedString
-{
-
-/*************************************************************************/
-
-/*
- * Inner Classes
- */
-
-/**
- * This class contains the attributes and ranges of text over which
- * that attributes apply.
- */
-final class AttributeRange
-{
-
-/*
- * Instance Variables
- */
-
-/**
- * A Map of the attributes
- */
-Map attribs;
-
-/**
- * The beginning index of the attributes
- */
-int begin_index;
-
-/**
- * The ending index of the attributes
- */
-int end_index;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-AttributeRange(Map attribs, int begin_index, int end_index)
-{
- this.attribs = attribs;
- this.begin_index = begin_index;
- this.end_index = end_index;
-}
-
-} // Inner class AttributeRange
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * This object holds the string we are representing.
- */
-private StringCharacterIterator sci;
-
-/**
- * This is the attribute information
- */
-private AttributeRange[] attribs;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * This method initializes a new instance of <code>AttributedString</code>
- * that represents the specified <code>String</code> with no attributes.
- *
- * @param str The <code>String</code> to be attributed.
- */
-public
-AttributedString(String str)
-{
- sci = new StringCharacterIterator(str);
- attribs = new AttributeRange[0];
-}
-
-/*************************************************************************/
-
-/**
- * This method initializes a new instance of <code>AttributedString</code>
- * that represents that specified <code>String</code> with the specified
- * attributes over the entire length of the <code>String</code>.
- *
- * @param str The <code>String</code> to be attributed.
- * @param attributes The attribute list.
- */
-public
-AttributedString(String str, Map attributes)
-{
- this(str);
-
- attribs = new AttributeRange[1];
- attribs[0] = new AttributeRange(attributes, 0, str.length());
-}
-
-/*************************************************************************/
-
-/**
- * This method initializes a new instance of <code>AttributedString</code>
- * that will use the text and attribute information from the specified
- * <code>AttributedCharacterIterator</code>.
- *
- * @param aci The <code>AttributedCharacterIterator</code> containing the text and attribute information.
- */
-public
-AttributedString(AttributedCharacterIterator aci)
-{
- this(aci, aci.getBeginIndex(), aci.getEndIndex(), null);
-}
-
-/*************************************************************************/
-
-/**
- * This method initializes a new instance of <code>AttributedString</code>
- * that will use the text and attribute information from the specified
- * subrange of the specified <code>AttributedCharacterIterator</code>.
- *
- * @param aci The <code>AttributedCharacterIterator</code> containing the text and attribute information.
- * @param begin_index The beginning index of the text subrange.
- * @param end_index The ending index of the text subrange.
- */
-public
-AttributedString(AttributedCharacterIterator aci, int begin_index,
- int end_index)
-{
- this(aci, begin_index, end_index, null);
-}
-
-/*************************************************************************/
-
-/**
- * This method initializes a new instance of <code>AttributedString</code>
- * that will use the text and attribute information from the specified
- * subrange of the specified <code>AttributedCharacterIterator</code>.
- * Only attributes from the source iterator that are present in the
- * specified array of attributes will be included in the attribute list
- * for this object.
- *
- * @param aci The <code>AttributedCharacterIterator</code> containing the text and attribute information.
- * @param begin_index The beginning index of the text subrange.
- * @param end_index The ending index of the text subrange.
- * @param attributes A list of attributes to include from the iterator, or <code>null</code> to include all attributes.
- */
-public
-AttributedString(AttributedCharacterIterator aci, int begin_index,
- int end_index, AttributedCharacterIterator.Attribute[] attributes)
-{
- // Validate some arguments
- if ((begin_index < 0) || (end_index < begin_index))
- throw new IllegalArgumentException("Bad index values");
-
- StringBuffer sb = new StringBuffer("");
-
- // Get the valid attribute list
- Set all_attribs = aci.getAllAttributeKeys();
- if (attributes != null)
- all_attribs.retainAll(Arrays.asList(attributes));
-
- // Loop through and extract the attributes
- char c = aci.setIndex(begin_index);
-
- ArrayList accum = new ArrayList();
- do
- {
- sb.append(c);
-
- Iterator iter = all_attribs.iterator();
- while(iter.hasNext())
- {
- Object obj = iter.next();
-
- // What should we do if this is not true?
- if (!(obj instanceof AttributedCharacterIterator.Attribute))
- continue;
-
- AttributedCharacterIterator.Attribute attrib =
- (AttributedCharacterIterator.Attribute)obj;
-
- // Make sure the attribute is defined.
- int rl = aci.getRunLimit(attrib);
- if (rl == -1)
- continue;
- if (rl > end_index)
- rl = end_index;
- rl -= begin_index;
-
- // Check to see if we already processed this one
- int rs = aci.getRunStart(attrib);
- if ((rs < aci.getIndex()) && (aci.getIndex() != begin_index))
- continue;
-
- // If the attribute run starts before the beginning index, we
- // need to junk it if it is an Annotation.
- Object attrib_obj = aci.getAttribute(attrib);
- if (rs < begin_index)
- {
- if (attrib_obj instanceof Annotation)
- continue;
-
- rs = begin_index;
- }
- else
- {
- rs -= begin_index;
- }
-
- // Create a map object. Yes this will only contain one attribute
- Map new_map = new Hashtable();
- new_map.put(attrib, attrib_obj);
-
- // Add it to the attribute list.
- accum.add(new AttributeRange(new_map, rs, rl));
- }
-
- c = aci.next();
- }
- while(c != CharacterIterator.DONE);
-
- attribs = new AttributeRange[accum.size()];
- attribs = (AttributeRange[]) accum.toArray(attribs);
-
- sci = new StringCharacterIterator(sb.toString());
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * This method adds a new attribute that will cover the entire string.
- *
- * @param attrib The attribute to add.
- * @param value The value of the attribute.
- */
-public void
-addAttribute(AttributedCharacterIterator.Attribute attrib, Object value)
-{
- addAttribute(attrib, value, 0, sci.getEndIndex());
-}
-
-/*************************************************************************/
-
-/**
- * This method adds a new attribute that will cover the specified subrange
- * of the string.
- *
- * @param attrib The attribute to add.
- * @param value The value of the attribute, which may be null.
- * @param begin_index The beginning index of the subrange.
- * @param end_index The ending index of the subrange.
- *
- * @exception IllegalArgumentException If attribute is <code>null</code> or the subrange is not valid.
- */
-public void
-addAttribute(AttributedCharacterIterator.Attribute attrib, Object value,
- int begin_index, int end_index)
-{
- if (attrib == null)
- throw new IllegalArgumentException("null attribute");
-
- HashMap hm = new HashMap();
- hm.put(attrib, value);
-
- addAttributes(hm, begin_index, end_index);
-}
-
-/*************************************************************************/
-
-/**
- * This method adds all of the attributes in the specified list to the
- * specified subrange of the string.
- *
- * @param attributes The list of attributes.
- * @param begin_index The beginning index.
- * @param end_index The ending index
- *
- * @param IllegalArgumentException If the list is <code>null</code> or the subrange is not valid.
- */
-public void
-addAttributes(Map attributes, int begin_index, int end_index)
-{
- if (attributes == null)
- throw new IllegalArgumentException("null attribute");
-
- if ((begin_index < 0) || (end_index > sci.getEndIndex()) ||
- (end_index < begin_index))
- throw new IllegalArgumentException("bad range");
-
- AttributeRange[] new_list = new AttributeRange[attribs.length + 1];
- System.arraycopy(attribs, 0, new_list, 0, attribs.length);
- attribs = new_list;
- attribs[attribs.length - 1] = new AttributeRange(attributes, begin_index,
- end_index);
-}
-
-/*************************************************************************/
-
-/**
- * This method returns an <code>AttributedCharacterIterator</code> that
- * will iterate over the entire string.
- *
- * @return An <code>AttributedCharacterIterator</code> for the entire string.
- */
-public AttributedCharacterIterator
-getIterator()
-{
- return(new AttributedStringIterator(sci, attribs, 0, sci.getEndIndex(), null));
-}
-
-/*************************************************************************/
-
-/**
- * This method returns an <code>AttributedCharacterIterator</code> that
- * will iterate over the entire string. This iterator will return information
- * about the list of attributes in the specified array. Attributes not in
- * the array may or may not be returned by the iterator. If the specified
- * array is <code>null</code>, all attributes will be returned.
- *
- * @param attributes A list of attributes to include in the returned iterator.
- *
- * @return An <code>AttributedCharacterIterator</code> for this string.
- */
-public AttributedCharacterIterator
-getIterator(AttributedCharacterIterator.Attribute[] attributes)
-{
- return(getIterator(attributes, 0, sci.getEndIndex()));
-}
-
-/*************************************************************************/
-
-/**
- * This method returns an <code>AttributedCharacterIterator</code> that
- * will iterate over the specified subrange. This iterator will return information
- * about the list of attributes in the specified array. Attributes not in
- * the array may or may not be returned by the iterator. If the specified
- * array is <code>null</code>, all attributes will be returned.
- *
- * @param attributes A list of attributes to include in the returned iterator.
- * @param begin_index The beginning index of the subrange.
- * @param end_index The ending index of the subrange.
- *
- * @return An <code>AttributedCharacterIterator</code> for this string.
- */
-public AttributedCharacterIterator
-getIterator(AttributedCharacterIterator.Attribute[] attributes,
- int begin_index, int end_index)
-{
- if ((begin_index < 0) || (end_index > sci.getEndIndex()) ||
- (end_index < begin_index))
- throw new IllegalArgumentException("bad range");
-
- return(new AttributedStringIterator(sci, attribs, begin_index, end_index,
- attributes));
-}
-
-} // class AttributedString
-
diff --git a/libjava/java/text/AttributedStringIterator.java b/libjava/java/text/AttributedStringIterator.java
deleted file mode 100644
index 6a35598b497..00000000000
--- a/libjava/java/text/AttributedStringIterator.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/* AttributedStringIterator.java -- Class to iterate over AttributedString
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * This class implements the AttributedCharacterIterator interface. It
- * is used by AttributedString.getIterator().
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-class AttributedStringIterator implements AttributedCharacterIterator
-{
-
-/*************************************************************************/
-
-/**
- * Instance Variables
- */
-
-/**
- * The character iterator containing the text
- */
-private CharacterIterator ci;
-
-/**
- * The list of attributes and ranges
- */
-private AttributedString.AttributeRange[] attribs;
-
-/**
- * The list of attributes that the user is interested in. We may,
- * at our option, not return any other attributes.
- */
-private AttributedCharacterIterator.Attribute[] restricts;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-AttributedStringIterator(StringCharacterIterator sci,
- AttributedString.AttributeRange[] attribs,
- int begin_index, int end_index,
- AttributedCharacterIterator.Attribute[] restricts)
-{
- this.ci = new StringCharacterIterator(sci, begin_index, end_index);
- this.attribs = attribs;
- this.restricts = restricts;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-// First we have a bunch of stupid redirects. If StringCharacterIterator
-// weren't final, I just would have extended that for this class. Alas, no.
-
-public Object
-clone()
-{
- return(ci.clone());
-}
-
-public char
-current()
-{
- return(ci.current());
-}
-
-public char
-next()
-{
- return(ci.next());
-}
-
-public char
-previous()
-{
- return(ci.previous());
-}
-
-public char
-first()
-{
- return(ci.first());
-}
-
-public char
-last()
-{
- return(ci.last());
-}
-
-public int
-getIndex()
-{
- return(ci.getIndex());
-}
-
-public char
-setIndex(int index)
-{
- return(ci.setIndex(index));
-}
-
-public int
-getBeginIndex()
-{
- return(ci.getBeginIndex());
-}
-
-public int
-getEndIndex()
-{
- return(ci.getEndIndex());
-}
-
-/*
- * Here is where the AttributedCharacterIterator methods start.
- */
-
-/*************************************************************************/
-
-/**
- * Returns a list of all the attribute keys that are defined anywhere
- * on this string.
- */
-public Set
-getAllAttributeKeys()
-{
- HashSet s = new HashSet();
- if (attribs == null)
- return(s);
-
- for (int i = 0; i < attribs.length; i++)
- {
- if (attribs[i].begin_index > getEndIndex()
- || attribs[i].end_index <= getBeginIndex())
- continue;
-
- Set key_set = attribs[i].attribs.keySet();
- Iterator iter = key_set.iterator();
- while (iter.hasNext())
- {
- s.add(iter.next());
- }
- }
-
- return(s);
-}
-
-/*************************************************************************/
-
-/**
- * Various methods that determine how far the run extends for various
- * attribute combinations.
- */
-
-public int
-getRunLimit()
-{
- return(getRunLimit(getAttributes().keySet()));
-}
-
-public int
-getRunLimit(AttributedCharacterIterator.Attribute attrib)
-{
- HashSet s = new HashSet();
- s.add(attrib);
-
- return(getRunLimit(s));
-}
-
-public synchronized int
-getRunLimit(Set attribute_set)
-{
- boolean hit = false;
- int runLimit = ci.getEndIndex ();
- int pos = ci.getIndex ();
-
- for (int i = 0; i < attribs.length; ++i)
- {
- if (pos >= attribs[i].begin_index &&
- pos <= attribs[i].end_index)
- {
- Iterator iter = attribute_set.iterator();
- while(iter.hasNext())
- if (attribs[i].attribs.containsKey(iter.next()))
- {
- hit = true;
- runLimit = Math.min(runLimit, attribs[i].end_index);
- }
- }
- }
- if (hit)
- return runLimit;
- else
- return -1;
-}
-
-/*************************************************************************/
-
-/**
- * Various methods that determine where the run begins for various
- * attribute combinations.
- */
-
-public int
-getRunStart()
-{
- return(getRunStart(getAttributes().keySet()));
-}
-
-public int
-getRunStart(AttributedCharacterIterator.Attribute attrib)
-{
- HashSet s = new HashSet();
- s.add(attrib);
-
- return(getRunStart(s));
-}
-
-public int
-getRunStart(Set attribute_set)
-{
- boolean hit = false;
- int runBegin = 0;
- int pos = ci.getIndex ();
-
- for (int i = 0; i < attribs.length; ++i)
- {
- if (pos >= attribs[i].begin_index &&
- pos <= attribs[i].end_index)
- {
- Iterator iter = attribute_set.iterator();
- while(iter.hasNext())
- if (attribs[i].attribs.containsKey(iter.next()))
- {
- hit = true;
- runBegin = Math.max(runBegin, attribs[i].begin_index);
- }
- }
- }
- if (hit)
- return runBegin;
- else
- return -1;
-}
-
-/*************************************************************************/
-
-public Object
-getAttribute(AttributedCharacterIterator.Attribute attrib)
-{
- if (attribs == null)
- return(null);
-
- for (int i = 0; i < attribs.length; i++)
- {
- Set key_set = attribs[i].attribs.keySet();
- Iterator iter = key_set.iterator();
- while (iter.hasNext())
- {
- Object obj = iter.next();
-
- // Check for attribute match and range match
- if (obj.equals(attrib))
- if ((ci.getIndex() >= attribs[i].begin_index) &&
- (ci.getIndex() < attribs[i].end_index))
- return(attribs[i].attribs.get(obj));
- }
- }
-
- return(null);
-}
-
-/*************************************************************************/
-
-/**
- * Return a list of all the attributes and values defined for this
- * character
- */
-public Map
-getAttributes()
-{
- HashMap m = new HashMap();
- if (attribs == null)
- return(m);
-
- for (int i = 0; i < attribs.length; i++)
- {
- if ((ci.getIndex() >= attribs[i].begin_index) &&
- (ci.getIndex() < attribs[i].end_index))
- m.putAll(attribs[i].attribs);
- }
-
- return(m);
-}
-
-} // class AttributedStringIterator
-
diff --git a/libjava/java/text/BreakIterator.java b/libjava/java/text/BreakIterator.java
deleted file mode 100644
index d021dceba73..00000000000
--- a/libjava/java/text/BreakIterator.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/* BreakIterator.java -- Breaks text into elements
- Copyright (C) 1998, 1999, 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * This class iterates over text elements such as words, lines, sentences,
- * and characters. It can only iterate over one of these text elements at
- * a time. An instance of this class configured for the desired iteration
- * type is created by calling one of the static factory methods, not
- * by directly calling a constructor.
- *
- * The standard iterators created by the factory methods in this
- * class will be valid upon creation. That is, their methods will
- * not cause exceptions if called before you call setText().
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @date March 19, 1999
- */
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct to 1.1.
- */
-public abstract class BreakIterator implements Cloneable
-{
- /**
- * This value is returned by the <code>next()</code> and
- * <code>previous</code> in order to indicate that the end of the
- * text has been reached.
- */
- // The value was discovered by writing a test program.
- public static final int DONE = -1;
-
- /**
- * This method initializes a new instance of <code>BreakIterator</code>.
- * This protected constructor is available to subclasses as a default
- * no-arg superclass constructor.
- */
- protected BreakIterator ()
- {
- }
-
- /**
- * Create a clone of this object.
- */
- public Object clone ()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- return null;
- }
- }
-
- /**
- * This method returns the index of the current text element boundary.
- *
- * @return The current text boundary.
- */
- public abstract int current ();
-
- /**
- * This method returns the first text element boundary in the text being
- * iterated over.
- *
- * @return The first text boundary.
- */
- public abstract int first ();
-
- /**
- * This methdod returns the offset of the text element boundary following
- * the specified offset.
- *
- * @param offset The text index from which to find the next text boundary.
- *
- * @param The next text boundary following the specified index.
- */
- public abstract int following (int pos);
-
- /**
- * This method returns a list of locales for which instances of
- * <code>BreakIterator</code> are available.
- *
- * @return A list of available locales
- */
- public static synchronized Locale[] getAvailableLocales ()
- {
- Locale[] l = new Locale[1];
- l[0] = Locale.US;
- return l;
- }
-
- private static BreakIterator getInstance (String type, Locale loc)
- {
- String className;
- try
- {
- ResourceBundle res
- = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation",
- loc, ClassLoader.getSystemClassLoader());
- className = res.getString(type);
- }
- catch (MissingResourceException x)
- {
- return null;
- }
- try
- {
- Class k = Class.forName(className);
- return (BreakIterator) k.newInstance();
- }
- catch (ClassNotFoundException x1)
- {
- return null;
- }
- catch (InstantiationException x2)
- {
- return null;
- }
- catch (IllegalAccessException x3)
- {
- return null;
- }
- }
-
- /**
- * This method returns an instance of <code>BreakIterator</code> that will
- * iterate over characters as defined in the default locale.
- *
- * @return A <code>BreakIterator</code> instance for the default locale.
- */
- public static BreakIterator getCharacterInstance ()
- {
- return getCharacterInstance (Locale.getDefault());
- }
-
- /**
- * This method returns an instance of <code>BreakIterator</code> that will
- * iterate over characters as defined in the specified locale. If the
- * desired locale is not available, the default locale is used.
- *
- * @param locale The desired locale.
- *
- * @return A <code>BreakIterator</code> instance for the default locale.
- */
- public static BreakIterator getCharacterInstance (Locale loc)
- {
- BreakIterator r = getInstance ("CharacterIterator", loc);
- if (r == null)
- r = new gnu.java.text.CharacterBreakIterator ();
- return r;
- }
-
- /**
- * This method returns an instance of <code>BreakIterator</code> that will
- * iterate over line breaks as defined in the default locale.
- *
- * @return A <code>BreakIterator</code> instance for the default locale.
- */
- public static BreakIterator getLineInstance ()
- {
- return getLineInstance (Locale.getDefault());
- }
-
- /**
- * This method returns an instance of <code>BreakIterator</code> that will
- * iterate over line breaks as defined in the specified locale. If the
- * desired locale is not available, the default locale is used.
- *
- * @param locale The desired locale.
- *
- * @return A <code>BreakIterator</code> instance for the default locale.
- */
- public static BreakIterator getLineInstance (Locale loc)
- {
- BreakIterator r = getInstance ("LineIterator", loc);
- if (r == null)
- r = new gnu.java.text.LineBreakIterator ();
- return r;
- }
-
- /**
- * This method returns an instance of <code>BreakIterator</code> that will
- * iterate over sentences as defined in the default locale.
- *
- * @return A <code>BreakIterator</code> instance for the default locale.
- */
- public static BreakIterator getSentenceInstance ()
- {
- return getSentenceInstance (Locale.getDefault());
- }
-
- /**
- * This method returns an instance of <code>BreakIterator</code> that will
- * iterate over sentences as defined in the specified locale. If the
- * desired locale is not available, the default locale is used.
- *
- * @param locale The desired locale.
- *
- * @return A <code>BreakIterator</code> instance for the default locale.
- */
- public static BreakIterator getSentenceInstance (Locale loc)
- {
- BreakIterator r = getInstance ("SentenceIterator", loc);
- if (r == null)
- r = new gnu.java.text.SentenceBreakIterator ();
- return r;
- }
-
- /**
- * This method returns the text this object is iterating over as a
- * <code>CharacterIterator</code>.
- *
- * @param The text being iterated over.
- */
- public abstract CharacterIterator getText ();
-
- /**
- * This method returns an instance of <code>BreakIterator</code> that will
- * iterate over words as defined in the default locale.
- *
- * @return A <code>BreakIterator</code> instance for the default locale.
- */
- public static BreakIterator getWordInstance ()
- {
- return getWordInstance (Locale.getDefault());
- }
-
- /**
- * This method returns an instance of <code>BreakIterator</code> that will
- * iterate over words as defined in the specified locale. If the
- * desired locale is not available, the default locale is used.
- *
- * @param locale The desired locale.
- *
- * @return A <code>BreakIterator</code> instance for the default locale.
- */
- public static BreakIterator getWordInstance (Locale loc)
- {
- BreakIterator r = getInstance ("WordIterator", loc);
- if (r == null)
- r = new gnu.java.text.WordBreakIterator ();
- return r;
- }
-
- /**
- * This method tests whether or not the specified position is a text
- * element boundary.
- *
- * @param offset The text position to test.
- *
- * @return <code>true</code> if the position is a boundary,
- * <code>false</code> otherwise.
- */
- public boolean isBoundary (int pos)
- {
- if (pos == 0)
- return true;
- return following (pos - 1) == pos;
- }
-
- /**
- * This method returns the last text element boundary in the text being
- * iterated over.
- *
- * @return The last text boundary.
- */
- public abstract int last ();
-
- /**
- * This method returns the text element boundary following the current
- * text position.
- *
- * @return The next text boundary.
- */
- public abstract int next ();
-
- /**
- * This method returns the n'th text element boundary following the current
- * text position.
- *
- * @param n The number of text element boundaries to skip.
- *
- * @return The next text boundary.
- */
- public abstract int next (int n);
-
- /**
- * This methdod returns the offset of the text element boundary preceding
- * the specified offset.
- *
- * @param offset The text index from which to find the preceding
- * text boundary.
- *
- * @returns The next text boundary preceding the specified index.
- */
- public int preceding (int pos)
- {
- if (following (pos) == DONE)
- last ();
- while (previous () >= pos)
- ;
- return current ();
- }
-
- /**
- * This method returns the text element boundary preceding the current
- * text position.
- *
- * @return The previous text boundary.
- */
- public abstract int previous ();
-
- /**
- * This method sets the text string to iterate over.
- *
- * @param str The <code>String</code> to iterate over.
- */
- public void setText (String newText)
- {
- setText (new StringCharacterIterator (newText));
- }
-
- /**
- * This method sets the text to iterate over from the specified
- * <code>CharacterIterator</code>.
- *
- * @param ci The desired <code>CharacterIterator</code>.
- */
- public abstract void setText (CharacterIterator newText);
-}
diff --git a/libjava/java/text/CharacterIterator.java b/libjava/java/text/CharacterIterator.java
deleted file mode 100644
index 6b3f951d1fb..00000000000
--- a/libjava/java/text/CharacterIterator.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/* CharacterIterator.java -- Iterate over a character range
- Copyright (C) 1998, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-/**
- * This interface defines a mechanism for iterating over a range of
- * characters. For a given range of text, a beginning and ending index,
- * as well as a current index are defined. These values can be queried
- * by the methods in this interface. Additionally, various methods allow
- * the index to be set.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public interface CharacterIterator extends Cloneable
-{
- /**
- * This is a special constant value that is returned when the beginning or
- * end of the character range has been reached.
- */
- char DONE = '\uFFFF';
-
- /**
- * This method returns the character at the current index position
- *
- * @return The character at the current index position.
- */
- char current();
-
- /**
- * This method increments the current index and then returns the character
- * at the new index value. If the index is already at <code>getEndIndex() - 1</code>,
- * it will not be incremented.
- *
- * @return The character at the position of the incremented index value,
- * or <code>DONE</code> if the index has reached getEndIndex() - 1
- */
- char next();
-
- /**
- * This method decrements the current index and then returns the character
- * at the new index value. If the index value is already at the beginning
- * index, it will not be decremented.
- *
- * @return The character at the position of the decremented index value,
- * or <code>DONE</code> if index was already equal to the beginning index value.
- */
- char previous();
-
- /**
- * This method sets the index value to the beginning of the range and returns
- * the character there.
- *
- * @return The character at the beginning of the range, or <code>DONE</code> if the range is empty.
- */
- char first();
-
- /**
- * This method sets the index value to <code>getEndIndex() - 1</code> and
- * returns the character there. If the range is empty, then the index value
- * will be set equal to the beginning index.
- *
- * @return The character at the end of the range, or <code>DONE</code> if the range is empty.
- */
- char last();
-
- /**
- * This method returns the current value of the index.
- *
- * @return The current index value
- */
- int getIndex();
-
- /**
- * This method sets the value of the index to the specified value, then
- * returns the character at that position.
- *
- * @param index The new index value.
- *
- * @return The character at the new index value or <code>DONE</code> if the index value is equal to <code>getEndIndex</code>.
- */
- char setIndex (int index) throws IllegalArgumentException;
-
- /**
- * This method returns the character position of the first character in the
- * range.
- *
- * @return The index of the first character in the range.
- */
- int getBeginIndex();
-
- /**
- * This method returns the character position of the end of the text range.
- * This will actually be the index of the first character following the
- * end of the range. In the event the text range is empty, this will be
- * equal to the first character in the range.
- *
- * @return The index of the end of the range.
- */
- int getEndIndex();
-
- /**
- * This method creates a copy of this <code>CharacterIterator</code>.
- *
- * @return A copy of this <code>CharacterIterator</code>.
- */
- Object clone();
-
-} // interface CharacterIterator
diff --git a/libjava/java/text/ChoiceFormat.java b/libjava/java/text/ChoiceFormat.java
deleted file mode 100644
index 23c8a8c3af0..00000000000
--- a/libjava/java/text/ChoiceFormat.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/* ChoiceFormat.java -- Format over a range of numbers
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import java.util.Vector;
-
-/**
- * This class allows a format to be specified based on a range of numbers.
- * To use this class, first specify two lists of formats and range terminators.
- * These lists must be arrays of equal length. The format of index
- * <code>i</code> will be selected for value <code>X</code> if
- * <code>terminator[i] &lt;= X &lt; limit[i + 1]</code>. If the value X is not
- * included in any range, then either the first or last format will be
- * used depending on whether the value X falls outside the range.
- * <p>
- * This sounds complicated, but that is because I did a poor job of
- * explaining it. Consider the following example:
- * <p>
- *
-<pre>terminators = { 1, ChoiceFormat.nextDouble(1) }
-formats = { "file", "files" }</pre>
- *
- * <p>
- * In this case if the actual number tested is one or less, then the word
- * "file" is used as the format value. If the number tested is greater than
- * one, then "files" is used. This allows plurals to be handled
- * gracefully. Note the use of the method <code>nextDouble</code>. This
- * method selects the next highest double number than its argument. This
- * effectively makes any double greater than 1.0 cause the "files" string
- * to be selected. (Note that all terminator values are specified as
- * doubles.
- * <p>
- * Note that in order for this class to work properly, the range terminator
- * array must be sorted in ascending order and the format string array
- * must be the same length as the terminator array.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @date March 9, 1999
- */
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct to 1.1.
- */
-public class ChoiceFormat extends NumberFormat
-{
- /**
- * This method sets new range terminators and format strings for this
- * object based on the specified pattern. This pattern is of the form
- * "term#string|term#string...". For example "1#Sunday|2#Monday|#Tuesday".
- *
- * @param pattern The pattern of terminators and format strings.
- *
- * @exception IllegalArgumentException If the pattern is not valid
- */
- public void applyPattern (String newPattern)
- {
- // Note: we assume the same kind of quoting rules apply here.
- // This isn't explicitly documented. But for instance we accept
- // '#' as a literal hash in a format string.
- int index = 0, max = newPattern.length();
- Vector stringVec = new Vector ();
- Vector limitVec = new Vector ();
- StringBuffer buf = new StringBuffer ();
-
- while (true)
- {
- // Find end of double.
- int dstart = index;
- while (index < max)
- {
- char c = newPattern.charAt(index);
- if (c == '#' || c == '\u2064' || c == '<')
- break;
- ++index;
- }
-
- if (index == max)
- throw new IllegalArgumentException ("unexpected end of text");
- Double d = new Double (newPattern.substring(dstart, index));
-
- if (newPattern.charAt(index) == '<')
- d = new Double (nextDouble (d.doubleValue()));
-
- limitVec.addElement(d);
-
- // Scan text.
- ++index;
- buf.setLength(0);
- while (index < max)
- {
- char c = newPattern.charAt(index);
- if (c == '\'' && index < max + 1
- && newPattern.charAt(index + 1) == '\'')
- {
- buf.append(c);
- ++index;
- }
- else if (c == '\'' && index < max + 2)
- {
- buf.append(newPattern.charAt(index + 1));
- index += 2;
- }
- else if (c == '|')
- break;
- else
- buf.append(c);
- ++index;
- }
-
- stringVec.addElement(buf.toString());
- if (index == max)
- break;
- ++index;
- }
-
- choiceFormats = new String[stringVec.size()];
- stringVec.copyInto(choiceFormats);
-
- choiceLimits = new double[limitVec.size()];
- for (int i = 0; i < choiceLimits.length; ++i)
- {
- Double d = (Double) limitVec.elementAt(i);
- choiceLimits[i] = d.doubleValue();
- }
- }
-
- /**
- * This method initializes a new instance of <code>ChoiceFormat</code> that
- * generates its range terminator and format string arrays from the
- * specified pattern. This pattern is of the form
- * "term#string|term#string...". For example "1#Sunday|2#Monday|#Tuesday".
- * This is the same pattern type used by the <code>applyPattern</code>
- * method.
- *
- * @param pattern The pattern of terminators and format strings.
- *
- * @exception IllegalArgumentException If the pattern is not valid
- */
- public ChoiceFormat (String newPattern)
- {
- super ();
- applyPattern (newPattern);
- }
-
- /**
- * This method initializes a new instance of <code>ChoiceFormat</code> that
- * will use the specified range terminators and format strings.
- *
- * @param choiceLimits The array of range terminators
- * @param choiceFormats The array of format strings
- */
- public ChoiceFormat (double[] choiceLimits, String[] choiceFormats)
- {
- super ();
- setChoices (choiceLimits, choiceFormats);
- }
-
- /**
- * This method tests this object for equality with the specified
- * object. This will be true if and only if:
- * <ul>
- * <li>The specified object is not <code>null</code>.</li>
- * <li>The specified object is an instance of <code>ChoiceFormat</code>.</li>
- * <li>The termination ranges and format strings are identical to
- * this object's. </li>
- * </ul>
- *
- * @param obj The object to test for equality against.
- *
- * @return <code>true</code> if the specified object is equal to
- * this one, <code>false</code> otherwise.
- */
- public boolean equals (Object obj)
- {
- if (! (obj instanceof ChoiceFormat))
- return false;
- ChoiceFormat cf = (ChoiceFormat) obj;
- if (choiceLimits.length != cf.choiceLimits.length)
- return false;
- for (int i = choiceLimits.length - 1; i >= 0; --i)
- {
- if (choiceLimits[i] != cf.choiceLimits[i]
- || !choiceFormats[i].equals(cf.choiceFormats[i]))
- return false;
- }
- return true;
- }
-
- /**
- * This method appends the appropriate format string to the specified
- * <code>StringBuffer</code> based on the supplied <code>long</code>
- * argument.
- *
- * @param number The number used for determine (based on the range
- * terminators) which format string to append.
- * @param sb The <code>StringBuffer</code> to append the format string to.
- * @param status Unused.
- *
- * @return The <code>StringBuffer</code> with the format string appended.
- */
- public StringBuffer format (long num, StringBuffer appendBuf,
- FieldPosition pos)
- {
- return format ((double) num, appendBuf, pos);
- }
-
- /**
- * This method appends the appropriate format string to the specified
- * <code>StringBuffer</code> based on the supplied <code>double</code>
- * argument.
- *
- * @param number The number used for determine (based on the range
- * terminators) which format string to append.
- * @param sb The <code>StringBuffer</code> to append the format string to.
- * @param status Unused.
- *
- * @return The <code>StringBuffer</code> with the format string appended.
- */
- public StringBuffer format (double num, StringBuffer appendBuf,
- FieldPosition pos)
- {
- if (choiceLimits.length == 0)
- return appendBuf;
-
- int index = 0;
- if (! Double.isNaN(num) && num >= choiceLimits[0])
- {
- for (; index < choiceLimits.length - 1; ++index)
- {
- if (choiceLimits[index] <= num && num < choiceLimits[index + 1])
- break;
- }
- }
-
- return appendBuf.append(choiceFormats[index]);
- }
-
- /**
- * This method returns the list of format strings in use.
- *
- * @return The list of format objects.
- */
- public Object[] getFormats ()
- {
- return (Object[]) choiceFormats.clone();
- }
-
- /**
- * This method returns the list of range terminators in use.
- *
- * @return The list of range terminators.
- */
- public double[] getLimits ()
- {
- return (double[]) choiceLimits.clone();
- }
-
- /**
- * This method returns a hash value for this object
- *
- * @return A hash value for this object.
- */
- public int hashCode ()
- {
- int hash = 0;
- for (int i = 0; i < choiceLimits.length; ++i)
- {
- long v = Double.doubleToLongBits(choiceLimits[i]);
- hash ^= (v ^ (v >>> 32));
- hash ^= choiceFormats[i].hashCode();
- }
- return hash;
- }
-
- /**
- * This method returns the lowest possible double greater than the
- * specified double. If the specified double value is equal to
- * <code>Double.NaN</code> then that is the value returned.
- *
- * @param d The specified double
- *
- * @return The lowest double value greater than the specified double.
- */
- public static final double nextDouble (double d)
- {
- return nextDouble (d, true);
- }
-
- /**
- * This method returns a double that is either the next highest double
- * or next lowest double compared to the specified double depending on the
- * value of the passed boolean parameter. If the boolean parameter is
- * <code>true</code>, then the lowest possible double greater than the
- * specified double will be returned. Otherwise the highest possible
- * double less than the specified double will be returned.
- *
- * @param d The specified double
- * @param positive <code>true</code> to return the next highest
- * double, <code>false</code> otherwise.
- *
- * @return The next highest or lowest double value.
- */
- public static double nextDouble (double d, boolean next)
- {
- if (Double.isInfinite(d) || Double.isNaN(d))
- return d;
-
- long bits = Double.doubleToLongBits(d);
-
- long mantMask = (1L << mantissaBits) - 1;
- long mantissa = bits & mantMask;
-
- long expMask = (1L << exponentBits) - 1;
- long exponent = (bits >>> mantissaBits) & expMask;
-
- if (next ^ (bits < 0)) // Increment magnitude
- {
- if (mantissa == (1L << mantissaBits) - 1)
- {
- mantissa = 0L;
- exponent++;
-
- // Check for absolute overflow.
- if (exponent >= (1L << mantissaBits))
- return (bits > 0) ? Double.POSITIVE_INFINITY
- : Double.NEGATIVE_INFINITY;
- }
- else
- mantissa++;
- }
- else // Decrement magnitude
- {
- if (exponent == 0L && mantissa == 0L)
- {
- // The only case where there is a change of sign
- return next ? Double.MIN_VALUE : -Double.MIN_VALUE;
- }
- else
- {
- if (mantissa == 0L)
- {
- mantissa = (1L << mantissaBits) - 1;
- exponent--;
- }
- else
- mantissa--;
- }
- }
-
- long result = bits < 0 ? 1 : 0;
- result = (result << exponentBits) | exponent;
- result = (result << mantissaBits) | mantissa;
- return Double.longBitsToDouble(result);
- }
-
- /**
- * I'm not sure what this method is really supposed to do, as it is
- * not documented.
- */
- public Number parse (String sourceStr, ParsePosition pos)
- {
- int index = pos.getIndex();
- for (int i = 0; i < choiceLimits.length; ++i)
- {
- if (sourceStr.startsWith(choiceFormats[i], index))
- {
- pos.setIndex(index + choiceFormats[i].length());
- return new Double (choiceLimits[i]);
- }
- }
- pos.setErrorIndex(index);
- return new Double (Double.NaN);
- }
-
- /**
- * This method returns the highest possible double less than the
- * specified double. If the specified double value is equal to
- * <code>Double.NaN</code> then that is the value returned.
- *
- * @param d The specified double
- *
- * @return The highest double value less than the specified double.
- */
- public static final double previousDouble (double d)
- {
- return nextDouble (d, false);
- }
-
- /**
- * This method sets new range terminators and format strings for this
- * object.
- *
- * @param choiceLimits The new range terminators
- * @param choiceFormats The new choice formats
- */
- public void setChoices (double[] choiceLimits, String[] choiceFormats)
- {
- if (choiceLimits == null || choiceFormats == null)
- throw new NullPointerException ();
- if (choiceLimits.length != choiceFormats.length)
- throw new IllegalArgumentException ();
- this.choiceFormats = (String[]) choiceFormats.clone();
- this.choiceLimits = (double[]) choiceLimits.clone();
- }
-
- private void quoteString (StringBuffer dest, String text)
- {
- int max = text.length();
- for (int i = 0; i < max; ++i)
- {
- char c = text.charAt(i);
- if (c == '\'')
- {
- dest.append(c);
- dest.append(c);
- }
- else if (c == '#' || c == '|' || c == '\u2064' || c == '<')
- {
- dest.append('\'');
- dest.append(c);
- dest.append('\'');
- }
- else
- dest.append(c);
- }
- }
-
- /**
- * This method returns the range terminator list and format string list
- * as a <code>String</code> suitable for using with the
- * <code>applyPattern</code> method.
- *
- * @return A pattern string for this object
- */
- public String toPattern ()
- {
- StringBuffer result = new StringBuffer ();
- for (int i = 0; i < choiceLimits.length; ++i)
- {
- result.append(choiceLimits[i]);
- result.append('#');
- quoteString (result, choiceFormats[i]);
- }
- return result.toString();
- }
-
- /**
- * This is the list of format strings. Note that this variable is
- * specified by the serialization spec of this class.
- */
- private String[] choiceFormats;
-
- /**
- * This is the list of range terminator values. Note that this variable is
- * specified by the serialization spec of this class.
- */
- private double[] choiceLimits;
-
- // Number of mantissa bits in double.
- private static final int mantissaBits = 52;
- // Number of exponent bits in a double.
- private static final int exponentBits = 11;
-
- private static final long serialVersionUID = 1795184449645032964L;
-}
diff --git a/libjava/java/text/CollationElementIterator.java b/libjava/java/text/CollationElementIterator.java
deleted file mode 100644
index 60b148ef7c1..00000000000
--- a/libjava/java/text/CollationElementIterator.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/* CollationElementIterator.java -- Walks through collation elements
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import java.util.ArrayList;
-
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct to JDK 1.1.
- */
-
-/**
- * This class walks through the character collation elements of a
- * <code>String</code> as defined by the collation rules in an instance of
- * <code>RuleBasedCollator</code>. There is no public constructor for
- * this class. An instance is created by calling the
- * <code>getCollationElementIterator</code> method on
- * <code>RuleBasedCollator</code>.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Guilhem Lavaux (guilhem.lavaux@free.fr)
- */
-public final class CollationElementIterator
-{
- /**
- * This is a constant value that is returned to indicate that the end of
- * the string was encountered.
- */
- public static final int NULLORDER = -1;
-
- /**
- * This is the RuleBasedCollator this object was created from.
- */
- RuleBasedCollator collator;
-
- /**
- * This is the String that is being iterated over.
- */
- String text;
-
- /**
- * This is the index into the collation decomposition where we are currently scanning.
- */
- int index;
-
- /**
- * This is the index into the String where we are currently scanning.
- */
- int textIndex;
-
- /**
- * Array containing the collation decomposition of the
- * text given to the constructor.
- */
- private RuleBasedCollator.CollationElement[] text_decomposition;
-
- /**
- * Array containing the index of the specified block.
- */
- private int[] text_indexes;
-
- /**
- * This method initializes a new instance of <code>CollationElementIterator</code>
- * to iterate over the specified <code>String</code> using the rules in the
- * specified <code>RuleBasedCollator</code>.
- *
- * @param collator The <code>RuleBasedCollation</code> used for calculating collation values
- * @param text The <code>String</code> to iterate over.
- */
- CollationElementIterator(RuleBasedCollator collator, String text)
- {
- this.collator = collator;
-
- setText (text);
- }
-
- RuleBasedCollator.CollationElement nextBlock()
- {
- if (index >= text_decomposition.length)
- return null;
-
- RuleBasedCollator.CollationElement e = text_decomposition[index];
-
- textIndex = text_indexes[index+1];
-
- index++;
-
- return e;
- }
-
- RuleBasedCollator.CollationElement previousBlock()
- {
- if (index == 0)
- return null;
-
- index--;
- RuleBasedCollator.CollationElement e = text_decomposition[index];
-
- textIndex = text_indexes[index+1];
-
- return e;
- }
-
- /**
- * This method returns the collation ordering value of the next character sequence
- * in the string (it may be an extended character following collation rules).
- * This method will return <code>NULLORDER</code> if the
- * end of the string was reached.
- *
- * @return The collation ordering value.
- */
- public int next()
- {
- RuleBasedCollator.CollationElement e = nextBlock();
-
- if (e == null)
- return NULLORDER;
-
- return e.getValue();
- }
-
- /**
- * This method returns the collation ordering value of the previous character
- * in the string. This method will return <code>NULLORDER</code> if the
- * beginning of the string was reached.
- *
- * @return The collation ordering value.
- */
- public int previous()
- {
- RuleBasedCollator.CollationElement e = previousBlock();
-
- if (e == null)
- return NULLORDER;
-
- return e.getValue();
- }
-
- /**
- * This method returns the primary order value for the given collation
- * value.
- *
- * @param value The collation value returned from <code>next()</code> or <code>previous()</code>.
- *
- * @return The primary order value of the specified collation value. This is the high 16 bits.
- */
- public static int primaryOrder(int order)
- {
- // From the JDK 1.2 spec.
- return order >>> 16;
- }
-
- /**
- * This method resets the internal position pointer to read from the
- * beginning of the <code>String</code> again.
- */
- public void reset()
- {
- index = 0;
- textIndex = 0;
- }
-
- /**
- * This method returns the secondary order value for the given collation
- * value.
- *
- * @param value The collation value returned from <code>next()</code> or <code>previous()</code>.
- *
- * @return The secondary order value of the specified collation value. This is the bits 8-15.
- */
- public static short secondaryOrder(int order)
- {
- // From the JDK 1.2 spec.
- return (short) ((order >>> 8) & 255);
- }
-
- /**
- * This method returns the tertiary order value for the given collation
- * value.
- *
- * @param value The collation value returned from <code>next()</code> or <code>previous()</code>.
- *
- * @return The tertiary order value of the specified collation value. This is the low eight bits.
- */
- public static short tertiaryOrder(int order)
- {
- // From the JDK 1.2 spec.
- return (short) (order & 255);
- }
-
- /**
- * This method sets the <code>String</code> that it is iterating over
- * to the specified <code>String</code>.
- *
- * @param text The new <code>String</code> to iterate over.
- *
- * @since 1.2
- */
- public void setText(String text)
- {
- int idx = 0;
- int idx_idx = 0;
- int alreadyExpanded = 0;
- int idxToMove = 0;
-
- this.text = text;
- this.index = 0;
-
- String work_text = text.intern();
-
- ArrayList a_element = new ArrayList();
- ArrayList a_idx = new ArrayList();
-
- // Build element collection ordered as they come in "text".
- while (idx < work_text.length())
- {
- String key, key_old;
-
- Object object = null;
- int p = 1;
-
- // IMPROVE: use a TreeMap with a prefix-ordering rule.
- key_old = key = null;
- do
- {
- if (object != null)
- key_old = key;
- key = work_text.substring (idx, idx+p);
- object = collator.prefix_tree.get (key);
- if (object != null && idx < alreadyExpanded)
- {
- RuleBasedCollator.CollationElement prefix = (RuleBasedCollator.CollationElement)object;
- if (prefix.expansion != null &&
- prefix.expansion.startsWith(work_text.substring(0, idx)))
- {
- object = null;
- key = key_old;
- }
- }
- p++;
- }
- while (idx+p <= work_text.length());
-
- if (object == null)
- key = key_old;
-
- RuleBasedCollator.CollationElement prefix =
- (RuleBasedCollator.CollationElement) collator.prefix_tree.get (key);
-
- /*
- * First case: There is no such sequence in the database.
- * We will have to build one from the context.
- */
- if (prefix == null)
- {
- /*
- * We are dealing with sequences in an expansion. They
- * are treated as accented characters (tertiary order).
- */
- if (alreadyExpanded > 0)
- {
- RuleBasedCollator.CollationElement e =
- collator.getDefaultAccentedElement (work_text.charAt (idx));
-
- a_element.add (e);
- a_idx.add (new Integer(idx_idx));
- idx++;
- alreadyExpanded--;
- if (alreadyExpanded == 0)
- {
- /* There is not any characters left in the expansion set.
- * We can increase the pointer in the source string.
- */
- idx_idx += idxToMove;
- idxToMove = 0;
- }
- else
- idx_idx++;
- }
- else
- {
- /* This is a normal character. */
- RuleBasedCollator.CollationElement e =
- collator.getDefaultElement (work_text.charAt (idx));
- Integer i_ref = new Integer(idx_idx);
-
- /* Don't forget to mark it as a special sequence so the
- * string can be ordered.
- */
- a_element.add (RuleBasedCollator.SPECIAL_UNKNOWN_SEQ);
- a_idx.add (i_ref);
- a_element.add (e);
- a_idx.add (i_ref);
- idx_idx++;
- idx++;
- }
- continue;
- }
-
- /*
- * Second case: Here we have found a matching sequence.
- * Here we have an expansion string prepend it to the "work text" and
- * add the corresponding sorting element. We must also mark
- */
- if (prefix.expansion != null)
- {
- work_text = prefix.expansion
- + work_text.substring (idx+prefix.key.length());
- idx = 0;
- a_element.add (prefix);
- a_idx.add (new Integer(idx_idx));
- if (alreadyExpanded == 0)
- idxToMove = prefix.key.length();
- alreadyExpanded += prefix.expansion.length()-prefix.key.length();
- }
- else
- {
- /* Third case: the simplest. We have got the prefix and it
- * has not to be expanded.
- */
- a_element.add (prefix);
- a_idx.add (new Integer(idx_idx));
- idx += prefix.key.length();
- /* If the sequence is in an expansion, we must decrease the
- * counter.
- */
- if (alreadyExpanded > 0)
- {
- alreadyExpanded -= prefix.key.length();
- if (alreadyExpanded == 0)
- {
- idx_idx += idxToMove;
- idxToMove = 0;
- }
- }
- else
- idx_idx += prefix.key.length();
- }
- }
-
- text_decomposition = (RuleBasedCollator.CollationElement[])
- a_element.toArray(new RuleBasedCollator.CollationElement[a_element.size()]);
- text_indexes = new int[a_idx.size()+1];
- for (int i = 0; i < a_idx.size(); i++)
- {
- text_indexes[i] = ((Integer)a_idx.get(i)).intValue();
- }
- text_indexes[a_idx.size()] = text.length();
- }
-
- /**
- * This method sets the <code>String</code> that it is iterating over
- * to the <code>String</code> represented by the specified
- * <code>CharacterIterator</code>.
- *
- * @param source The <code>CharacterIterator</code> containing the new
- * <code>String</code> to iterate over.
- */
- public void setText(CharacterIterator source)
- {
- StringBuffer expand = new StringBuffer();
-
- // For now assume we read from the beginning of the string.
- for (char c = source.first();
- c != CharacterIterator.DONE;
- c = source.next())
- expand.append(c);
-
- setText(expand.toString());
- }
-
- /**
- * This method returns the current offset into the <code>String</code>
- * that is being iterated over.
- *
- * @return The iteration index position.
- *
- * @since 1.2
- */
- public int getOffset()
- {
- return textIndex;
- }
-
- /**
- * This method sets the iteration index position into the current
- * <code>String</code> to the specified value. This value must not
- * be negative and must not be greater than the last index position
- * in the <code>String</code>.
- *
- * @param offset The new iteration index position.
- *
- * @exception IllegalArgumentException If the new offset is not valid.
- */
- public void setOffset(int offset)
- {
- if (offset < 0)
- throw new IllegalArgumentException("Negative offset: " + offset);
-
- if (offset > (text.length() - 1))
- throw new IllegalArgumentException("Offset too large: " + offset);
-
- for (index = 0; index < text_decomposition.length; index++)
- {
- if (offset <= text_indexes[index])
- break;
- }
- /*
- * As text_indexes[0] == 0, we should not have to take care whether index is
- * greater than 0. It is always.
- */
- if (text_indexes[index] == offset)
- textIndex = offset;
- else
- textIndex = text_indexes[index-1];
- }
-
- /**
- * This method returns the maximum length of any expansion sequence that
- * ends with the specified collation order value. (Whatever that means).
- *
- * @param value The collation order value
- *
- * @param The maximum length of an expansion sequence.
- */
- public int getMaxExpansion(int value)
- {
- return 1;
- }
-}
diff --git a/libjava/java/text/CollationKey.java b/libjava/java/text/CollationKey.java
deleted file mode 100644
index f7e3a2476de..00000000000
--- a/libjava/java/text/CollationKey.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/* CollationKey.java -- Precomputed collation value
- Copyright (C) 1998, 1999, 2000, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct.
- */
-
-/**
- * This class represents a pre-computed series of bits representing a
- * <code>String</code> for under a particular <code>Collator</code>. This
- * value may be compared bitwise against another <code>CollationKey</code>
- * representing a different <code>String</code> under the same
- * <code>Collator</code> in a manner than is usually more efficient than
- * using the raw <code>Collator</code> compare methods. There is overhead
- * associated with calculating this value, so it is generally not
- * advisable to compute <code>CollationKey</code>'s unless multiple
- * comparisons against a <code>String</code> will be done. (For example,
- * in a sort routine).
- * <p>
- * This class cannot be instantiated directly. Instead, a
- * <code>CollationKey</code> is created by calling the
- * <code>getCollationKey</code> method on an instance of <code>Collator</code>.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @date March 25, 1999
- */
-public final class CollationKey implements Comparable
-{
- /**
- * This is the <code>Collator</code> this object was created from.
- */
- private Collator collator;
-
- /**
- * This is the <code>String</code> this object represents.
- */
- private String originalText;
-
- /**
- * This is the bit value for this key.
- */
- private byte[] key;
-
- CollationKey (Collator collator, String originalText, byte[] key)
- {
- this.collator = collator;
- this.originalText = originalText;
- this.key = key;
- }
-
- /**
- * This method compares the specified object to this one. An integer is
- * returned which indicates whether the specified object is less than,
- * greater than, or equal to this object.
- *
- * @param ck The <code>CollationKey</code> to compare against this one.
- *
- * @return A negative integer if this object is less than the specified object, 0 if it is equal or a positive integer if it is greater than the specified object.
- */
- public int compareTo (CollationKey ck)
- {
- int max = Math.min (key.length, ck.key.length);
-
- for (int i = 0; i < max; ++i)
- {
- if (key[i] != ck.key[i])
- return key[i] - ck.key[i];
- }
-
- return key.length - ck.key.length;
- }
-
- /**
- * This method compares the specified object to this one. The specified
- * object must be an instance of <code>CollationKey</code> or an exception
- * will be thrown. An integer is returned which indicates whether the
- * specified object is less than, greater than, or equal to this object.
- *
- * @param obj The <code>Object</code> to compare against this one.
- *
- * @return A negative integer if this object is less than the specified object, 0 if it is equal or a positive integer if it is greater than the specified object.
- */
- public int compareTo (Object obj)
- {
- return compareTo ((CollationKey) obj);
- }
-
- /**
- * This method tests the specified <code>Object</code> for equality with
- * this object. This will be true if and only if:
- * <p>
- * <ul>
- * <li>The specified object must not be <code>null</code></li>
- * <li>The specified object is an instance of <code>CollationKey</code>.</li>
- * <li>The specified object was created from the same <code>Collator</code>
- * as this object.</li>
- * <li>The specified object has the same source string and bit key as
- * this object.</li>
- * </ul>
- *
- * @param obj The <code>Object</code> to test for equality.
- *
- * @return <code>true</code> if the specified object is equal to this one, <code>false</code> otherwise.
- */
- public boolean equals (Object obj)
- {
- if (! (obj instanceof CollationKey))
- return false;
-
- CollationKey ck = (CollationKey) obj;
-
- if (ck.collator != collator)
- return false;
-
- if (!ck.getSourceString ().equals (getSourceString ()))
- return false;
-
- if (!ck.toByteArray ().equals (toByteArray ()))
- return false;
-
- return true;
- }
-
- /**
- * This method returns the <code>String</code> that this object was created
- * from.
- *
- * @return The source <code>String</code> for this object.
- */
- public String getSourceString()
- {
- return originalText;
- }
-
- /**
- * This method returns a hash value for this object. The hash value
- * returned will be the hash code of the bit key so that identical bit
- * keys will return the same value.
- *
- * @return A hash value for this object.
- */
- public int hashCode()
- {
- // We just follow BitSet instead of thinking up something new.
- long h = originalText.hashCode();
- for (int i = key.length - 1; i >= 0; --i)
- h ^= key[i] * (i + 1);
- return (int) ((h >> 32) ^ h);
- }
-
- /**
- * This method returns the collation bit sequence as a byte array.
- *
- * @param A byte array containing the collation bit sequence.
- */
- public byte[] toByteArray()
- {
- return key;
- }
-}
diff --git a/libjava/java/text/DecimalFormat.java b/libjava/java/text/DecimalFormat.java
deleted file mode 100644
index 4a2e1b4d002..00000000000
--- a/libjava/java/text/DecimalFormat.java
+++ /dev/null
@@ -1,1265 +0,0 @@
-/* DecimalFormat.java -- Formats and parses numbers
- Copyright (C) 1999, 2000, 2001, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import gnu.java.text.AttributedFormatBuffer;
-import gnu.java.text.FormatBuffer;
-import gnu.java.text.FormatCharacterIterator;
-import gnu.java.text.StringFormatBuffer;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.util.Currency;
-import java.util.HashMap;
-import java.util.Locale;
-
-/**
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @date March 4, 1999
- */
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct to 1.2.
- * Note however that the docs are very unclear about how format parsing
- * should work. No doubt there are problems here.
- */
-public class DecimalFormat extends NumberFormat
-{
- // This is a helper for applyPatternWithSymbols. It reads a prefix
- // or a suffix. It can cause some side-effects.
- private int scanFix (String pattern, int index, FormatBuffer buf,
- String patChars, DecimalFormatSymbols syms,
- boolean is_suffix)
- {
- int len = pattern.length();
- boolean quoteStarted = false;
- buf.clear();
-
- boolean multiplierSet = false;
- while (index < len)
- {
- char c = pattern.charAt(index);
-
- if (quoteStarted)
- {
- if (c == '\'')
- quoteStarted = false;
- else
- buf.append(c);
- index++;
- continue;
- }
-
- if (c == '\'' && index + 1 < len
- && pattern.charAt(index + 1) == '\'')
- {
- buf.append(c);
- index++;
- }
- else if (c == '\'')
- {
- quoteStarted = true;
- }
- else if (c == '\u00a4')
- {
- if (index + 1 < len && pattern.charAt(index + 1) == '\u00a4')
- {
- buf.append(syms.getInternationalCurrencySymbol(), NumberFormat.Field.CURRENCY);
- index++;
- }
- else
- buf.append(syms.getCurrencySymbol(), NumberFormat.Field.CURRENCY);
- }
- else if (c == syms.getPercent())
- {
- if (multiplierSet)
- throw new IllegalArgumentException ("multiplier already set " +
- "- index: " + index);
- multiplierSet = true;
- multiplier = 100;
- buf.append(c, NumberFormat.Field.PERCENT);
- }
- else if (c == syms.getPerMill())
- {
- if (multiplierSet)
- throw new IllegalArgumentException ("multiplier already set " +
- "- index: " + index);
- multiplierSet = true;
- multiplier = 1000;
- buf.append(c, NumberFormat.Field.PERMILLE);
- }
- else if (patChars.indexOf(c) != -1)
- {
- // This is a pattern character.
- break;
- }
- else
- buf.append(c);
- index++;
- }
-
- if (quoteStarted)
- throw new IllegalArgumentException ("pattern is lacking a closing quote");
-
- return index;
- }
-
- // A helper which reads a number format.
- private int scanFormat (String pattern, int index, String patChars,
- DecimalFormatSymbols syms, boolean is_positive)
- {
- int max = pattern.length();
-
- int countSinceGroup = 0;
- int zeroCount = 0;
- boolean saw_group = false;
-
- //
- // Scan integer part.
- //
- while (index < max)
- {
- char c = pattern.charAt(index);
-
- if (c == syms.getDigit())
- {
- if (zeroCount > 0)
- throw new IllegalArgumentException ("digit mark following " +
- "zero - index: " + index);
- ++countSinceGroup;
- }
- else if (c == syms.getZeroDigit())
- {
- ++zeroCount;
- ++countSinceGroup;
- }
- else if (c == syms.getGroupingSeparator())
- {
- countSinceGroup = 0;
- saw_group = true;
- }
- else
- break;
-
- ++index;
- }
-
- // We can only side-effect when parsing the positive format.
- if (is_positive)
- {
- groupingUsed = saw_group;
- groupingSize = (byte) countSinceGroup;
- minimumIntegerDigits = zeroCount;
- }
-
- // Early termination.
- if (index == max || pattern.charAt(index) == syms.getGroupingSeparator())
- {
- if (is_positive)
- decimalSeparatorAlwaysShown = false;
- return index;
- }
-
- if (pattern.charAt(index) == syms.getDecimalSeparator())
- {
- ++index;
-
- //
- // Scan fractional part.
- //
- int hashCount = 0;
- zeroCount = 0;
- while (index < max)
- {
- char c = pattern.charAt(index);
- if (c == syms.getZeroDigit())
- {
- if (hashCount > 0)
- throw new IllegalArgumentException ("zero mark " +
- "following digit - index: " + index);
- ++zeroCount;
- }
- else if (c == syms.getDigit())
- {
- ++hashCount;
- }
- else if (c != syms.getExponential()
- && c != syms.getPatternSeparator()
- && c != syms.getPercent()
- && c != syms.getPerMill()
- && patChars.indexOf(c) != -1)
- throw new IllegalArgumentException ("unexpected special " +
- "character - index: " + index);
- else
- break;
-
- ++index;
- }
-
- if (is_positive)
- {
- maximumFractionDigits = hashCount + zeroCount;
- minimumFractionDigits = zeroCount;
- }
-
- if (index == max)
- return index;
- }
-
- if (pattern.charAt(index) == syms.getExponential())
- {
- //
- // Scan exponential format.
- //
- zeroCount = 0;
- ++index;
- while (index < max)
- {
- char c = pattern.charAt(index);
- if (c == syms.getZeroDigit())
- ++zeroCount;
- else if (c == syms.getDigit())
- {
- if (zeroCount > 0)
- throw new
- IllegalArgumentException ("digit mark following zero " +
- "in exponent - index: " +
- index);
- }
- else if (patChars.indexOf(c) != -1)
- throw new IllegalArgumentException ("unexpected special " +
- "character - index: " +
- index);
- else
- break;
-
- ++index;
- }
-
- if (is_positive)
- {
- useExponentialNotation = true;
- minExponentDigits = (byte) zeroCount;
- }
-
- maximumIntegerDigits = groupingSize;
- groupingSize = 0;
- if (maximumIntegerDigits > minimumIntegerDigits && maximumIntegerDigits > 0)
- {
- minimumIntegerDigits = 1;
- exponentRound = maximumIntegerDigits;
- }
- else
- exponentRound = 1;
- }
-
- return index;
- }
-
- // This helper function creates a string consisting of all the
- // characters which can appear in a pattern and must be quoted.
- private String patternChars (DecimalFormatSymbols syms)
- {
- StringBuffer buf = new StringBuffer ();
- buf.append(syms.getDecimalSeparator());
- buf.append(syms.getDigit());
- buf.append(syms.getExponential());
- buf.append(syms.getGroupingSeparator());
- // Adding this one causes pattern application to fail.
- // Of course, omitting is causes toPattern to fail.
- // ... but we already have bugs there. FIXME.
- // buf.append(syms.getMinusSign());
- buf.append(syms.getPatternSeparator());
- buf.append(syms.getPercent());
- buf.append(syms.getPerMill());
- buf.append(syms.getZeroDigit());
- buf.append('\u00a4');
- return buf.toString();
- }
-
- private void applyPatternWithSymbols(String pattern, DecimalFormatSymbols syms)
- {
- // Initialize to the state the parser expects.
- negativePrefix = "";
- negativeSuffix = "";
- positivePrefix = "";
- positiveSuffix = "";
- decimalSeparatorAlwaysShown = false;
- groupingSize = 0;
- minExponentDigits = 0;
- multiplier = 1;
- useExponentialNotation = false;
- groupingUsed = false;
- maximumFractionDigits = 0;
- maximumIntegerDigits = MAXIMUM_INTEGER_DIGITS;
- minimumFractionDigits = 0;
- minimumIntegerDigits = 1;
-
- AttributedFormatBuffer buf = new AttributedFormatBuffer ();
- String patChars = patternChars (syms);
-
- int max = pattern.length();
- int index = scanFix (pattern, 0, buf, patChars, syms, false);
- buf.sync();
- positivePrefix = buf.getBuffer().toString();
- positivePrefixRanges = buf.getRanges();
- positivePrefixAttrs = buf.getAttributes();
-
- index = scanFormat (pattern, index, patChars, syms, true);
-
- index = scanFix (pattern, index, buf, patChars, syms, true);
- buf.sync();
- positiveSuffix = buf.getBuffer().toString();
- positiveSuffixRanges = buf.getRanges();
- positiveSuffixAttrs = buf.getAttributes();
-
- if (index == pattern.length())
- {
- // No negative info.
- negativePrefix = null;
- negativeSuffix = null;
- }
- else
- {
- if (pattern.charAt(index) != syms.getPatternSeparator())
- throw new IllegalArgumentException ("separator character " +
- "expected - index: " + index);
-
- index = scanFix (pattern, index + 1, buf, patChars, syms, false);
- buf.sync();
- negativePrefix = buf.getBuffer().toString();
- negativePrefixRanges = buf.getRanges();
- negativePrefixAttrs = buf.getAttributes();
-
- // We parse the negative format for errors but we don't let
- // it side-effect this object.
- index = scanFormat (pattern, index, patChars, syms, false);
-
- index = scanFix (pattern, index, buf, patChars, syms, true);
- buf.sync();
- negativeSuffix = buf.getBuffer().toString();
- negativeSuffixRanges = buf.getRanges();
- negativeSuffixAttrs = buf.getAttributes();
-
- if (index != pattern.length())
- throw new IllegalArgumentException ("end of pattern expected " +
- "- index: " + index);
- }
- }
-
- public void applyLocalizedPattern (String pattern)
- {
- // JCL p. 638 claims this throws a ParseException but p. 629
- // contradicts this. Empirical tests with patterns of "0,###.0"
- // and "#.#.#" corroborate the p. 629 statement that an
- // IllegalArgumentException is thrown.
- applyPatternWithSymbols (pattern, symbols);
- }
-
- public void applyPattern (String pattern)
- {
- // JCL p. 638 claims this throws a ParseException but p. 629
- // contradicts this. Empirical tests with patterns of "0,###.0"
- // and "#.#.#" corroborate the p. 629 statement that an
- // IllegalArgumentException is thrown.
- applyPatternWithSymbols (pattern, nonLocalizedSymbols);
- }
-
- public Object clone ()
- {
- DecimalFormat c = (DecimalFormat) super.clone ();
- c.symbols = (DecimalFormatSymbols) symbols.clone ();
- return c;
- }
-
- public DecimalFormat ()
- {
- this ("#,##0.###");
- }
-
- public DecimalFormat (String pattern)
- {
- this (pattern, new DecimalFormatSymbols ());
- }
-
- public DecimalFormat (String pattern, DecimalFormatSymbols symbols)
- {
- this.symbols = symbols;
- applyPattern (pattern);
- }
-
- private boolean equals(String s1, String s2)
- {
- if (s1 == null || s2 == null)
- return s1 == s2;
- return s1.equals(s2);
- }
-
- public boolean equals (Object obj)
- {
- if (! (obj instanceof DecimalFormat))
- return false;
- DecimalFormat dup = (DecimalFormat) obj;
- return (decimalSeparatorAlwaysShown == dup.decimalSeparatorAlwaysShown
- && groupingSize == dup.groupingSize
- && minExponentDigits == dup.minExponentDigits
- && multiplier == dup.multiplier
- && equals(negativePrefix, dup.negativePrefix)
- && equals(negativeSuffix, dup.negativeSuffix)
- && equals(positivePrefix, dup.positivePrefix)
- && equals(positiveSuffix, dup.positiveSuffix)
- && symbols.equals(dup.symbols)
- && useExponentialNotation == dup.useExponentialNotation);
- }
-
- private void formatInternal (double number, FormatBuffer dest,
- FieldPosition fieldPos)
- {
- // A very special case.
- if (Double.isNaN(number))
- {
- dest.append(symbols.getNaN());
- if (fieldPos != null &&
- (fieldPos.getField() == INTEGER_FIELD ||
- fieldPos.getFieldAttribute() == NumberFormat.Field.INTEGER))
- {
- int index = dest.length();
- fieldPos.setBeginIndex(index - symbols.getNaN().length());
- fieldPos.setEndIndex(index);
- }
- return;
- }
-
- boolean is_neg = number < 0;
- if (is_neg)
- {
- if (negativePrefix != null)
- dest.append(negativePrefix, negativePrefixRanges, negativePrefixAttrs);
- else
- {
- dest.append(symbols.getMinusSign(), NumberFormat.Field.SIGN);
- dest.append(positivePrefix, positivePrefixRanges, positivePrefixAttrs);
- }
- number = - number;
- }
- else
- dest.append(positivePrefix, positivePrefixRanges, positivePrefixAttrs);
-
- int integerBeginIndex = dest.length();
- int integerEndIndex = 0;
- int zeroStart = symbols.getZeroDigit() - '0';
-
- if (Double.isInfinite (number))
- {
- dest.append(symbols.getInfinity());
- integerEndIndex = dest.length();
- }
- else
- {
- number *= multiplier;
-
- // Compute exponent.
- long exponent = 0;
- double baseNumber;
- if (useExponentialNotation)
- {
- exponent = (long) Math.floor (Math.log(number) / Math.log(10));
- exponent = exponent - (exponent % exponentRound);
- if (minimumIntegerDigits > 0)
- exponent -= minimumIntegerDigits - 1;
- baseNumber = (number / Math.pow(10.0, exponent));
- }
- else
- baseNumber = number;
-
- // Round to the correct number of digits.
- baseNumber += 5 * Math.pow(10.0, - maximumFractionDigits - 1);
-
- int index = dest.length();
- //double intPart = Math.floor(baseNumber);
- String intPart = Long.toString((long)Math.floor(baseNumber));
- int count, groupPosition = intPart.length();
-
- dest.setDefaultAttribute(NumberFormat.Field.INTEGER);
-
- for (count = 0; count < minimumIntegerDigits-intPart.length(); count++)
- dest.append(symbols.getZeroDigit());
-
- for (count = 0;
- count < maximumIntegerDigits && count < intPart.length();
- count++)
- {
- int dig = intPart.charAt(count);
-
- // Append group separator if required.
- if (groupingUsed && count > 0 && groupingSize != 0 && groupPosition % groupingSize == 0)
- {
- dest.append(symbols.getGroupingSeparator(), NumberFormat.Field.GROUPING_SEPARATOR);
- dest.setDefaultAttribute(NumberFormat.Field.INTEGER);
- }
- dest.append((char) (zeroStart + dig));
-
- groupPosition--;
- }
- dest.setDefaultAttribute(null);
-
- integerEndIndex = dest.length();
-
- int decimal_index = integerEndIndex;
- int consecutive_zeros = 0;
- int total_digits = 0;
-
- int localMaximumFractionDigits = maximumFractionDigits;
-
- if (useExponentialNotation)
- localMaximumFractionDigits += minimumIntegerDigits - count;
-
- // Strip integer part from NUMBER.
- double fracPart = baseNumber - Math.floor(baseNumber);
-
- if ( ((fracPart != 0 || minimumFractionDigits > 0) && localMaximumFractionDigits > 0)
- || decimalSeparatorAlwaysShown)
- {
- dest.append (symbols.getDecimalSeparator(), NumberFormat.Field.DECIMAL_SEPARATOR);
- }
-
- int fraction_begin = dest.length();
- dest.setDefaultAttribute(NumberFormat.Field.FRACTION);
- for (count = 0;
- count < localMaximumFractionDigits
- && (fracPart != 0 || count < minimumFractionDigits);
- ++count)
- {
- ++total_digits;
- fracPart *= 10;
- long dig = (long) fracPart;
- if (dig == 0)
- ++consecutive_zeros;
- else
- consecutive_zeros = 0;
- dest.append((char) (symbols.getZeroDigit() + dig));
-
- // Strip integer part from FRACPART.
- fracPart = fracPart - Math.floor (fracPart);
- }
-
- // Strip extraneous trailing `0's. We can't always detect
- // these in the loop.
- int extra_zeros = Math.min (consecutive_zeros,
- total_digits - minimumFractionDigits);
- if (extra_zeros > 0)
- {
- dest.cutTail(extra_zeros);
- total_digits -= extra_zeros;
- if (total_digits == 0 && !decimalSeparatorAlwaysShown)
- dest.cutTail(1);
- }
-
- if (fieldPos != null && fieldPos.getField() == FRACTION_FIELD)
- {
- fieldPos.setBeginIndex(fraction_begin);
- fieldPos.setEndIndex(dest.length());
- }
-
- // Finally, print the exponent.
- if (useExponentialNotation)
- {
- dest.append(symbols.getExponential(), NumberFormat.Field.EXPONENT_SYMBOL);
- if (exponent < 0)
- {
- dest.append (symbols.getMinusSign (), NumberFormat.Field.EXPONENT_SIGN);
- exponent = - exponent;
- }
- index = dest.length();
- dest.setDefaultAttribute(NumberFormat.Field.EXPONENT);
- String exponentString = Long.toString ((long) exponent);
-
- for (count = 0; count < minExponentDigits-exponentString.length();
- count++)
- dest.append((char) symbols.getZeroDigit());
-
- for (count = 0;
- count < exponentString.length();
- ++count)
- {
- int dig = exponentString.charAt(count);
- dest.append((char) (zeroStart + dig));
- }
- }
- }
-
- if (fieldPos != null &&
- (fieldPos.getField() == INTEGER_FIELD ||
- fieldPos.getFieldAttribute() == NumberFormat.Field.INTEGER))
- {
- fieldPos.setBeginIndex(integerBeginIndex);
- fieldPos.setEndIndex(integerEndIndex);
- }
-
- if (is_neg && negativeSuffix != null)
- dest.append(negativeSuffix, negativeSuffixRanges, negativeSuffixAttrs);
- else
- dest.append(positiveSuffix, positiveSuffixRanges, positiveSuffixAttrs);
- }
-
- public StringBuffer format (double number, StringBuffer dest,
- FieldPosition fieldPos)
- {
- formatInternal (number, new StringFormatBuffer(dest), fieldPos);
- return dest;
- }
-
- public AttributedCharacterIterator formatToCharacterIterator (Object value)
- {
- AttributedFormatBuffer sbuf = new AttributedFormatBuffer();
-
- if (value instanceof Number)
- formatInternal(((Number) value).doubleValue(), sbuf, null);
- else
- throw new IllegalArgumentException
- ("Cannot format given Object as a Number");
-
- sbuf.sync();
- return new FormatCharacterIterator(sbuf.getBuffer().toString(),
- sbuf.getRanges(),
- sbuf.getAttributes());
- }
-
- public StringBuffer format (long number, StringBuffer dest,
- FieldPosition fieldPos)
- {
- // If using exponential notation, we just format as a double.
- if (useExponentialNotation)
- return format ((double) number, dest, fieldPos);
-
- boolean is_neg = number < 0;
- if (is_neg)
- {
- if (negativePrefix != null)
- dest.append(negativePrefix);
- else
- {
- dest.append(symbols.getMinusSign());
- dest.append(positivePrefix);
- }
- number = - number;
- }
- else
- dest.append(positivePrefix);
-
- int integerBeginIndex = dest.length();
- int index = dest.length();
- int count = 0;
- while (count < maximumIntegerDigits
- && (number > 0 || count < minimumIntegerDigits))
- {
- long dig = number % 10;
- number /= 10;
- // NUMBER and DIG will be less than 0 if the original number
- // was the most negative long.
- if (dig < 0)
- {
- dig = - dig;
- number = - number;
- }
-
- // Append group separator if required.
- if (groupingUsed && count > 0 && groupingSize != 0 && count % groupingSize == 0)
- dest.insert(index, symbols.getGroupingSeparator());
-
- dest.insert(index, (char) (symbols.getZeroDigit() + dig));
-
- ++count;
- }
-
- if (fieldPos != null && fieldPos.getField() == INTEGER_FIELD)
- {
- fieldPos.setBeginIndex(integerBeginIndex);
- fieldPos.setEndIndex(dest.length());
- }
-
- if (decimalSeparatorAlwaysShown || minimumFractionDigits > 0)
- {
- dest.append(symbols.getDecimalSeparator());
- if (fieldPos != null && fieldPos.getField() == FRACTION_FIELD)
- {
- fieldPos.setBeginIndex(dest.length());
- fieldPos.setEndIndex(dest.length() + minimumFractionDigits);
- }
- }
-
- for (count = 0; count < minimumFractionDigits; ++count)
- dest.append(symbols.getZeroDigit());
-
- dest.append((is_neg && negativeSuffix != null)
- ? negativeSuffix
- : positiveSuffix);
- return dest;
- }
-
- /**
- * Returns the currency corresponding to the currency symbol stored
- * in the instance of <code>DecimalFormatSymbols</code> used by this
- * <code>DecimalFormat</code>.
- *
- * @return A new instance of <code>Currency</code> if
- * the currency code matches a known one, null otherwise.
- */
- public Currency getCurrency()
- {
- return symbols.getCurrency();
- }
-
- public DecimalFormatSymbols getDecimalFormatSymbols ()
- {
- return symbols;
- }
-
- public int getGroupingSize ()
- {
- return groupingSize;
- }
-
- public int getMultiplier ()
- {
- return multiplier;
- }
-
- public String getNegativePrefix ()
- {
- return negativePrefix;
- }
-
- public String getNegativeSuffix ()
- {
- return negativeSuffix;
- }
-
- public String getPositivePrefix ()
- {
- return positivePrefix;
- }
-
- public String getPositiveSuffix ()
- {
- return positiveSuffix;
- }
-
- public int hashCode ()
- {
- int hash = (negativeSuffix.hashCode() ^ negativePrefix.hashCode()
- ^positivePrefix.hashCode() ^ positiveSuffix.hashCode());
- // FIXME.
- return hash;
- }
-
- public boolean isDecimalSeparatorAlwaysShown ()
- {
- return decimalSeparatorAlwaysShown;
- }
-
- public Number parse (String str, ParsePosition pos)
- {
- /*
- * Our strategy is simple: copy the text into separate buffers: one for the int part,
- * one for the fraction part and for the exponential part.
- * We translate or omit locale-specific information.
- * If exponential is sufficiently big we merge the fraction and int part and
- * remove the '.' and then we use Long to convert the number. In the other
- * case, we use Double to convert the full number.
- */
-
- boolean is_neg = false;
- int index = pos.getIndex();
- StringBuffer int_buf = new StringBuffer ();
-
- // We have to check both prefixes, because one might be empty. We
- // want to pick the longest prefix that matches.
- boolean got_pos = str.startsWith(positivePrefix, index);
- String np = (negativePrefix != null
- ? negativePrefix
- : positivePrefix + symbols.getMinusSign());
- boolean got_neg = str.startsWith(np, index);
-
- if (got_pos && got_neg)
- {
- // By checking this way, we preserve ambiguity in the case
- // where the negative format differs only in suffix. We
- // check this again later.
- if (np.length() > positivePrefix.length())
- {
- is_neg = true;
- index += np.length();
- }
- else
- index += positivePrefix.length();
- }
- else if (got_neg)
- {
- is_neg = true;
- index += np.length();
- }
- else if (got_pos)
- index += positivePrefix.length();
- else
- {
- pos.setErrorIndex (index);
- return null;
- }
-
- // FIXME: handle Inf and NaN.
-
- // FIXME: do we have to respect minimum digits?
- // What about multiplier?
-
- StringBuffer buf = int_buf;
- StringBuffer frac_buf = null;
- StringBuffer exp_buf = null;
- int start_index = index;
- int max = str.length();
- int exp_index = -1;
- int last = index + maximumIntegerDigits;
-
- if (maximumFractionDigits > 0)
- last += maximumFractionDigits + 1;
-
- if (useExponentialNotation)
- last += minExponentDigits + 1;
-
- if (last > 0 && max > last)
- max = last;
-
- char zero = symbols.getZeroDigit();
- int last_group = -1;
- boolean int_part = true;
- boolean exp_part = false;
- for (; index < max; ++index)
- {
- char c = str.charAt(index);
-
- // FIXME: what about grouping size?
- if (groupingUsed && c == symbols.getGroupingSeparator())
- {
- if (last_group != -1
- && groupingSize != 0
- && (index - last_group) % groupingSize != 0)
- {
- pos.setErrorIndex(index);
- return null;
- }
- last_group = index+1;
- }
- else if (c >= zero && c <= zero + 9)
- {
- buf.append((char) (c - zero + '0'));
- }
- else if (parseIntegerOnly)
- break;
- else if (c == symbols.getDecimalSeparator())
- {
- if (last_group != -1
- && groupingSize != 0
- && (index - last_group) % groupingSize != 0)
- {
- pos.setErrorIndex(index);
- return null;
- }
- buf = frac_buf = new StringBuffer();
- frac_buf.append('.');
- int_part = false;
- }
- else if (c == symbols.getExponential())
- {
- buf = exp_buf = new StringBuffer();
- int_part = false;
- exp_part = true;
- exp_index = index+1;
- }
- else if (exp_part
- && (c == '+' || c == '-' || c == symbols.getMinusSign()))
- {
- // For exponential notation.
- buf.append(c);
- }
- else
- break;
- }
-
- if (index == start_index)
- {
- // Didn't see any digits.
- pos.setErrorIndex(index);
- return null;
- }
-
- // Check the suffix. We must do this before converting the
- // buffer to a number to handle the case of a number which is
- // the most negative Long.
- boolean got_pos_suf = str.startsWith(positiveSuffix, index);
- String ns = (negativePrefix == null ? positiveSuffix : negativeSuffix);
- boolean got_neg_suf = str.startsWith(ns, index);
- if (is_neg)
- {
- if (! got_neg_suf)
- {
- pos.setErrorIndex(index);
- return null;
- }
- }
- else if (got_pos && got_neg && got_neg_suf)
- {
- is_neg = true;
- }
- else if (got_pos != got_pos_suf && got_neg != got_neg_suf)
- {
- pos.setErrorIndex(index);
- return null;
- }
-
- String suffix = is_neg ? ns : positiveSuffix;
- long multiplier = 1;
- boolean use_long;
-
- if (is_neg)
- int_buf.insert(0, '-');
-
- // Now handle the exponential part if there is one.
- if (exp_buf != null)
- {
- int exponent_value;
-
- try
- {
- exponent_value = Integer.parseInt(exp_buf.toString());
- }
- catch (NumberFormatException x1)
- {
- pos.setErrorIndex(exp_index);
- return null;
- }
-
- if (frac_buf == null)
- {
- // We only have to add some zeros to the int part.
- // Build a multiplier.
- for (int i = 0; i < exponent_value; i++)
- int_buf.append('0');
-
- use_long = true;
- }
- else
- {
- boolean long_sufficient;
-
- if (exponent_value < frac_buf.length()-1)
- {
- int lastNonNull = -1;
- /* We have to check the fraction buffer: it may only be full of '0'
- * or be sufficiently filled with it to convert the number into Long.
- */
- for (int i = 1; i < frac_buf.length(); i++)
- if (frac_buf.charAt(i) != '0')
- lastNonNull = i;
-
- long_sufficient = (lastNonNull < 0 || lastNonNull <= exponent_value);
- }
- else
- long_sufficient = true;
-
- if (long_sufficient)
- {
- for (int i = 1; i < frac_buf.length() && i < exponent_value; i++)
- int_buf.append(frac_buf.charAt(i));
- for (int i = frac_buf.length()-1; i < exponent_value; i++)
- int_buf.append('0');
- use_long = true;
- }
- else
- {
- /*
- * A long type is not sufficient, we build the full buffer to
- * be parsed by Double.
- */
- int_buf.append(frac_buf);
- int_buf.append('E');
- int_buf.append(exp_buf);
- use_long = false;
- }
- }
- }
- else
- {
- if (frac_buf != null)
- {
- /* Check whether the fraction buffer contains only '0' */
- int i;
- for (i = 1; i < frac_buf.length(); i++)
- if (frac_buf.charAt(i) != '0')
- break;
-
- if (i != frac_buf.length())
- {
- use_long = false;
- int_buf.append(frac_buf);
- }
- else
- use_long = true;
- }
- else
- use_long = true;
- }
-
- String t = int_buf.toString();
- Number result = null;
- if (use_long)
- {
- try
- {
- result = new Long (t);
- }
- catch (NumberFormatException x1)
- {
- }
- }
- else
- {
- try
- {
- result = new Double (t);
- }
- catch (NumberFormatException x2)
- {
- }
- }
- if (result == null)
- {
- pos.setErrorIndex(index);
- return null;
- }
-
- pos.setIndex(index + suffix.length());
-
- return result;
- }
-
- /**
- * Sets the <code>Currency</code> on the
- * <code>DecimalFormatSymbols</code> used, which also sets the
- * currency symbols on those symbols.
- */
- public void setCurrency(Currency currency)
- {
- symbols.setCurrency(currency);
- }
-
- public void setDecimalFormatSymbols (DecimalFormatSymbols newSymbols)
- {
- symbols = newSymbols;
- }
-
- public void setDecimalSeparatorAlwaysShown (boolean newValue)
- {
- decimalSeparatorAlwaysShown = newValue;
- }
-
- public void setGroupingSize (int groupSize)
- {
- groupingSize = (byte) groupSize;
- }
-
- public void setMaximumFractionDigits (int newValue)
- {
- super.setMaximumFractionDigits(Math.min(newValue, 340));
- }
-
- public void setMaximumIntegerDigits (int newValue)
- {
- super.setMaximumIntegerDigits(Math.min(newValue, 309));
- }
-
- public void setMinimumFractionDigits (int newValue)
- {
- super.setMinimumFractionDigits(Math.min(newValue, 340));
- }
-
- public void setMinimumIntegerDigits (int newValue)
- {
- super.setMinimumIntegerDigits(Math.min(newValue, 309));
- }
-
- public void setMultiplier (int newValue)
- {
- multiplier = newValue;
- }
-
- public void setNegativePrefix (String newValue)
- {
- negativePrefix = newValue;
- }
-
- public void setNegativeSuffix (String newValue)
- {
- negativeSuffix = newValue;
- }
-
- public void setPositivePrefix (String newValue)
- {
- positivePrefix = newValue;
- }
-
- public void setPositiveSuffix (String newValue)
- {
- positiveSuffix = newValue;
- }
-
- private void quoteFix(StringBuffer buf, String text, String patChars)
- {
- int len = text.length();
- for (int index = 0; index < len; ++index)
- {
- char c = text.charAt(index);
- if (patChars.indexOf(c) != -1)
- {
- buf.append('\'');
- buf.append(c);
- buf.append('\'');
- }
- else
- buf.append(c);
- }
- }
-
- private String computePattern(DecimalFormatSymbols syms)
- {
- StringBuffer mainPattern = new StringBuffer ();
- // We have to at least emit a zero for the minimum number of
- // digits. Past that we need hash marks up to the grouping
- // separator (and one beyond).
- int total_digits = Math.max(minimumIntegerDigits,
- groupingUsed ? groupingSize + 1: groupingSize);
- for (int i = 0; i < total_digits - minimumIntegerDigits; ++i)
- mainPattern.append(syms.getDigit());
- for (int i = total_digits - minimumIntegerDigits; i < total_digits; ++i)
- mainPattern.append(syms.getZeroDigit());
- // Inserting the gropuing operator afterwards is easier.
- if (groupingUsed)
- mainPattern.insert(mainPattern.length() - groupingSize,
- syms.getGroupingSeparator());
- // See if we need decimal info.
- if (minimumFractionDigits > 0 || maximumFractionDigits > 0
- || decimalSeparatorAlwaysShown)
- mainPattern.append(syms.getDecimalSeparator());
- for (int i = 0; i < minimumFractionDigits; ++i)
- mainPattern.append(syms.getZeroDigit());
- for (int i = minimumFractionDigits; i < maximumFractionDigits; ++i)
- mainPattern.append(syms.getDigit());
- if (useExponentialNotation)
- {
- mainPattern.append(syms.getExponential());
- for (int i = 0; i < minExponentDigits; ++i)
- mainPattern.append(syms.getZeroDigit());
- if (minExponentDigits == 0)
- mainPattern.append(syms.getDigit());
- }
-
- String main = mainPattern.toString();
- String patChars = patternChars (syms);
- mainPattern.setLength(0);
-
- quoteFix (mainPattern, positivePrefix, patChars);
- mainPattern.append(main);
- quoteFix (mainPattern, positiveSuffix, patChars);
-
- if (negativePrefix != null)
- {
- quoteFix (mainPattern, negativePrefix, patChars);
- mainPattern.append(main);
- quoteFix (mainPattern, negativeSuffix, patChars);
- }
-
- return mainPattern.toString();
- }
-
- public String toLocalizedPattern ()
- {
- return computePattern (symbols);
- }
-
- public String toPattern ()
- {
- return computePattern (nonLocalizedSymbols);
- }
-
- private static final int MAXIMUM_INTEGER_DIGITS = 309;
-
- // These names are fixed by the serialization spec.
- private boolean decimalSeparatorAlwaysShown;
- private byte groupingSize;
- private byte minExponentDigits;
- private int exponentRound;
- private int multiplier;
- private String negativePrefix;
- private String negativeSuffix;
- private String positivePrefix;
- private String positiveSuffix;
- private int[] negativePrefixRanges, positivePrefixRanges;
- private HashMap[] negativePrefixAttrs, positivePrefixAttrs;
- private int[] negativeSuffixRanges, positiveSuffixRanges;
- private HashMap[] negativeSuffixAttrs, positiveSuffixAttrs;
- private int serialVersionOnStream = 1;
- private DecimalFormatSymbols symbols;
- private boolean useExponentialNotation;
- private static final long serialVersionUID = 864413376551465018L;
-
- private void readObject(ObjectInputStream stream)
- throws IOException, ClassNotFoundException
- {
- stream.defaultReadObject();
- if (serialVersionOnStream < 1)
- {
- useExponentialNotation = false;
- serialVersionOnStream = 1;
- }
- }
-
- // The locale-independent pattern symbols happen to be the same as
- // the US symbols.
- private static final DecimalFormatSymbols nonLocalizedSymbols
- = new DecimalFormatSymbols (Locale.US);
-}
diff --git a/libjava/java/text/FieldPosition.java b/libjava/java/text/FieldPosition.java
deleted file mode 100644
index 427c07e8e11..00000000000
--- a/libjava/java/text/FieldPosition.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/* FieldPosition.java -- Keeps track of field positions while formatting
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-/**
- * This class is used by the java.text formatting classes to track
- * field positions. A field position is defined by an identifier value
- * and begin and end index positions. The formatting classes in java.text
- * typically define constant values for the field identifiers.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner (bothner@cygnus.com)
- */
-public class FieldPosition
-{
- /**
- * This is the field identifier value.
- */
- private int field_id;
-
- /**
- * This is the beginning index of the field.
- */
- private int begin;
-
- /**
- * This is the ending index of the field.
- */
- private int end;
-
- /**
- * This is the field attribute value.
- */
- private Format.Field field_attribute;
-
- /**
- * This method initializes a new instance of <code>FieldPosition</code>
- * to have the specified field attribute. The attribute will be used as
- * an id. It is formally equivalent to calling FieldPosition(field, -1).
- *
- * @param field The field format attribute.
- */
- public FieldPosition (Format.Field field)
- {
- this(field, -1);
- }
-
- /**
- * This method initializes a new instance of <code>FieldPosition</code>
- * to have the specified field attribute. The attribute will be used as
- * an id is non null. The integer field id is only used if the Format.Field
- * attribute is not used by the formatter.
- *
- * @param field The field format attribute.
- * @param field_id The field identifier value.
- */
- public FieldPosition (Format.Field field, int field_id)
- {
- this.field_attribute = field;
- this.field_id = field_id;
- }
-
- /**
- * This method initializes a new instance of <code>FieldPosition</code> to
- * have the specified field id.
- *
- * @param field_id The field identifier value.
- */
- public FieldPosition (int field_id)
- {
- this.field_id = field_id;
- }
-
- /**
- * This method returns the field identifier value for this object.
- *
- * @return The field identifier.
- */
- public int getField ()
- {
- return field_id;
- }
-
- public Format.Field getFieldAttribute ()
- {
- return field_attribute;
- }
-
- /**
- * This method returns the beginning index for this field.
- *
- * @return The beginning index.
- */
- public int getBeginIndex ()
- {
- return begin;
- }
-
- /**
- * This method sets the beginning index of this field to the specified value.
- *
- * @param begin The new beginning index.
- */
- public void setBeginIndex (int begin)
- {
- this.begin = begin;
- }
-
- /**
- * This method returns the ending index for the field.
- *
- * @return The ending index.
- */
- public int getEndIndex ()
- {
- return end;
- }
-
- /**
- * This method sets the ending index of this field to the specified value.
- *
- * @param end The new ending index.
- */
- public void setEndIndex (int end)
- {
- this.end = end;
- }
-
- /**
- * This method tests this object for equality against the specified object.
- * The objects will be considered equal if and only if:
- * <p>
- * <ul>
- * <li>The specified object is not <code>null</code>.
- * <li>The specified object has the same class as this object.
- * <li>The specified object has the same field identifier, field attribute
- * and beginning and ending index as this object.
- * </ul>
- *
- * @param obj The object to test for equality to this object.
- *
- * @return <code>true</code> if the specified object is equal to
- * this object, <code>false</code> otherwise.
- */
- public boolean equals (Object obj)
- {
- if (this == obj)
- return true;
-
- if (obj == null || obj.getClass() != this.getClass())
- return false;
-
- FieldPosition fp = (FieldPosition) obj;
- return (field_id == fp.field_id
- && (field_attribute == fp.field_attribute
- || (field_attribute != null
- && field_attribute.equals(fp.field_attribute)))
- && begin == fp.begin
- && end == fp.end);
- }
-
-
- /**
- * This method returns a hash value for this object
- *
- * @return A hash value for this object.
- */
- public int hashCode ()
- {
- int hash = 5;
-
- hash = 31 * hash + field_id;
- hash = 31 * hash + begin;
- hash = 31 * hash + end;
- hash = 31 * hash +
- (null == field_attribute ? 0 : field_attribute.hashCode());
-
- return hash;
- }
-
- /**
- * This method returns a <code>String</code> representation of this
- * object.
- *
- * @return A <code>String</code> representation of this object.
- */
- public String toString ()
- {
- return (getClass ().getName ()
- + "[field=" + getField ()
- + ",attribute=" + getFieldAttribute ()
- + ",beginIndex=" + getBeginIndex ()
- + ",endIndex=" + getEndIndex ()
- + "]");
- }
-}
diff --git a/libjava/java/text/Format.java b/libjava/java/text/Format.java
deleted file mode 100644
index 38fda34ff64..00000000000
--- a/libjava/java/text/Format.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/* Format.java -- Abstract superclass for formatting/parsing strings.
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import gnu.java.text.FormatCharacterIterator;
-
-import java.io.Serializable;
-
-/**
- * This class is the abstract superclass of classes that format and parse
- * data to/from <code>Strings</code>. It is guaranteed that any
- * <code>String</code> produced by a concrete subclass of <code>Format</code>
- * will be parseable by that same subclass.
- * <p>
- * In addition to implementing the abstract methods in this class, subclasses
- * should provide static factory methods of the form
- * <code>getInstance()</code> and <code>getInstance(Locale)</code> if the
- * subclass loads different formatting/parsing schemes based on locale.
- * These subclasses should also implement a static method called
- * <code>getAvailableLocales()</code> which returns an array of
- * available locales in the current runtime environment.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner (bothner@cygnus.com)
- */
-public abstract class Format implements Serializable, Cloneable
-{
- /**
- * For compatability with Sun's JDK 1.4.2 rev. 5
- */
- static final long serialVersionUID = -299282585814624189L;
-
- public static class Field extends AttributedCharacterIterator.Attribute
- {
- static final long serialVersionUID = 276966692217360283L;
-
- protected Field(String name)
- {
- super(name);
- }
- }
-
- /**
- * This method initializes a new instance of <code>Format</code>.
- * It performs no actions, but acts as a default constructor for
- * subclasses.
- */
- public Format ()
- {
- }
-
- /**
- * This method formats an <code>Object</code> into a <code>String</code>.
- *
- * @param obj The <code>Object</code> to format.
- *
- * @return The formatted <code>String</code>.
- *
- * @exception IllegalArgumentException If the <code>Object</code>
- * cannot be formatted.
- */
- public final String format(Object obj) throws IllegalArgumentException
- {
- StringBuffer sb = new StringBuffer ();
- format (obj, sb, new FieldPosition (0));
- return sb.toString ();
- }
-
- /**
- * This method formats an <code>Object</code> into a <code>String</code> and
- * appends the <code>String</code> to a <code>StringBuffer</code>.
- *
- * @param obj The <code>Object</code> to format.
- * @param sb The <code>StringBuffer</code> to append to.
- * @param pos The desired <code>FieldPosition</code>, which is also
- * updated by this call.
- *
- * @return The updated <code>StringBuffer</code>.
- *
- * @exception IllegalArgumentException If the <code>Object</code>
- * cannot be formatted.
- */
- public abstract StringBuffer format (Object obj, StringBuffer sb,
- FieldPosition pos)
- throws IllegalArgumentException;
-
- /**
- * This method parses a <code>String</code> and converts the parsed
- * contents into an <code>Object</code>.
- *
- * @param str The <code>String</code> to parse.
- *
- * @return The resulting <code>Object</code>.
- *
- * @exception ParseException If the <code>String</code> cannot be parsed.
- */
- public Object parseObject (String str) throws ParseException
- {
- ParsePosition pos = new ParsePosition(0);
- Object result = parseObject (str, pos);
- if (result == null)
- {
- int index = pos.getErrorIndex();
- if (index < 0)
- index = pos.getIndex();
- throw new ParseException("parseObject failed", index);
- }
- return result;
- }
-
- /**
- * This method parses a <code>String</code> and converts the parsed
- * contents into an <code>Object</code>.
- *
- * @param str The <code>String</code> to parse.
- * @param pos The starting parse index on input, the ending parse
- * index on output.
- *
- * @return The parsed <code>Object</code>, or <code>null</code> in
- * case of error.
- */
- public abstract Object parseObject (String str, ParsePosition pos);
-
- public AttributedCharacterIterator formatToCharacterIterator(Object obj)
- {
- return new FormatCharacterIterator(format(obj), null, null);
- }
-
- /**
- * Creates a copy of this object.
- *
- * @return The copied <code>Object</code>.
- */
- public Object clone ()
- {
- try
- {
- return super.clone ();
- }
- catch (CloneNotSupportedException e)
- {
- return null;
- }
- }
-}
diff --git a/libjava/java/text/MessageFormat.java b/libjava/java/text/MessageFormat.java
deleted file mode 100644
index f7a9f1687a6..00000000000
--- a/libjava/java/text/MessageFormat.java
+++ /dev/null
@@ -1,832 +0,0 @@
-/* MessageFormat.java - Localized message formatting.
- Copyright (C) 1999, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import gnu.java.text.FormatCharacterIterator;
-
-import java.io.InvalidObjectException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Vector;
-
-public class MessageFormat extends Format
-{
- /**
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Jorge Aliss (jaliss@hotmail.com)
- * @date March 3, 1999
- */
- /* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct to 1.2, except serialization.
- * and parsing.
- */
- private static final class MessageFormatElement
- {
- // Argument number.
- int argNumber;
- // Formatter to be used. This is the format set by setFormat.
- Format setFormat;
- // Formatter to be used based on the type.
- Format format;
-
- // Argument will be checked to make sure it is an instance of this
- // class.
- Class formatClass;
-
- // Formatter type.
- String type;
- // Formatter style.
- String style;
-
- // Text to follow this element.
- String trailer;
-
- // Recompute the locale-based formatter.
- void setLocale (Locale loc)
- {
- if (type == null)
- ;
- else if (type.equals("number"))
- {
- formatClass = java.lang.Number.class;
-
- if (style == null)
- format = NumberFormat.getInstance(loc);
- else if (style.equals("currency"))
- format = NumberFormat.getCurrencyInstance(loc);
- else if (style.equals("percent"))
- format = NumberFormat.getPercentInstance(loc);
- else if (style.equals("integer"))
- {
- NumberFormat nf = NumberFormat.getNumberInstance(loc);
- nf.setMaximumFractionDigits(0);
- nf.setGroupingUsed(false);
- format = nf;
- }
- else
- {
- format = NumberFormat.getNumberInstance(loc);
- DecimalFormat df = (DecimalFormat) format;
- df.applyPattern(style);
- }
- }
- else if (type.equals("time") || type.equals("date"))
- {
- formatClass = java.util.Date.class;
-
- int val = DateFormat.DEFAULT;
- boolean styleIsPattern = false;
- if (style == null)
- ;
- else if (style.equals("short"))
- val = DateFormat.SHORT;
- else if (style.equals("medium"))
- val = DateFormat.MEDIUM;
- else if (style.equals("long"))
- val = DateFormat.LONG;
- else if (style.equals("full"))
- val = DateFormat.FULL;
- else
- styleIsPattern = true;
-
- if (type.equals("time"))
- format = DateFormat.getTimeInstance(val, loc);
- else
- format = DateFormat.getDateInstance(val, loc);
-
- if (styleIsPattern)
- {
- SimpleDateFormat sdf = (SimpleDateFormat) format;
- sdf.applyPattern(style);
- }
- }
- else if (type.equals("choice"))
- {
- formatClass = java.lang.Number.class;
-
- if (style == null)
- throw new
- IllegalArgumentException ("style required for choice format");
- format = new ChoiceFormat (style);
- }
- }
- }
-
- private static final long serialVersionUID = 6479157306784022952L;
-
- public static class Field extends Format.Field
- {
- static final long serialVersionUID = 7899943957617360810L;
-
- /**
- * This is the attribute set for all characters produced
- * by MessageFormat during a formatting.
- */
- public static final MessageFormat.Field ARGUMENT = new MessageFormat.Field("argument");
-
- // For deserialization
- private Field()
- {
- super("");
- }
-
- protected Field(String s)
- {
- super(s);
- }
-
- /**
- * invoked to resolve the true static constant by
- * comparing the deserialized object to know name.
- *
- * @return object constant
- */
- protected Object readResolve() throws InvalidObjectException
- {
- if (getName().equals(ARGUMENT.getName()))
- return ARGUMENT;
-
- throw new InvalidObjectException("no such MessageFormat field called " + getName());
- }
-
- }
-
- // Helper that returns the text up to the next format opener. The
- // text is put into BUFFER. Returns index of character after end of
- // string. Throws IllegalArgumentException on error.
- private static int scanString(String pat, int index, StringBuffer buffer)
- {
- int max = pat.length();
- buffer.setLength(0);
- boolean quoted = false;
- for (; index < max; ++index)
- {
- char c = pat.charAt(index);
- if (quoted)
- {
- // In a quoted context, a single quote ends the quoting.
- if (c == '\'')
- quoted = false;
- else
- buffer.append(c);
- }
- // Check for '', which is a single quote.
- else if (c == '\'' && index + 1 < max && pat.charAt(index + 1) == '\'')
- {
- buffer.append(c);
- ++index;
- }
- else if (c == '\'')
- {
- // Start quoting.
- quoted = true;
- }
- else if (c == '{')
- break;
- else
- buffer.append(c);
- }
- // Note that we explicitly allow an unterminated quote. This is
- // done for compatibility.
- return index;
- }
-
- // This helper retrieves a single part of a format element. Returns
- // the index of the terminating character.
- private static int scanFormatElement(String pat, int index,
- StringBuffer buffer, char term)
- {
- int max = pat.length();
- buffer.setLength(0);
- int brace_depth = 1;
- boolean quoted = false;
-
- for (; index < max; ++index)
- {
- char c = pat.charAt(index);
- // First see if we should turn off quoting.
- if (quoted)
- {
- if (c == '\'')
- quoted = false;
- // In both cases we fall through to inserting the
- // character here.
- }
- // See if we have just a plain quote to insert.
- else if (c == '\'' && index + 1 < max
- && pat.charAt(index + 1) == '\'')
- {
- buffer.append(c);
- ++index;
- }
- // See if quoting should turn on.
- else if (c == '\'')
- quoted = true;
- else if (c == '{')
- ++brace_depth;
- else if (c == '}')
- {
- if (--brace_depth == 0)
- break;
- }
- // Check for TERM after braces, because TERM might be `}'.
- else if (c == term)
- break;
- // All characters, including opening and closing quotes, are
- // inserted here.
- buffer.append(c);
- }
- return index;
- }
-
- // This is used to parse a format element and whatever non-format
- // text might trail it.
- private static int scanFormat(String pat, int index, StringBuffer buffer,
- Vector elts, Locale locale)
- {
- MessageFormatElement mfe = new MessageFormatElement ();
- elts.addElement(mfe);
-
- int max = pat.length();
-
- // Skip the opening `{'.
- ++index;
-
- // Fetch the argument number.
- index = scanFormatElement (pat, index, buffer, ',');
- try
- {
- mfe.argNumber = Integer.parseInt(buffer.toString());
- }
- catch (NumberFormatException nfx)
- {
- IllegalArgumentException iae = new IllegalArgumentException(pat);
- iae.initCause(nfx);
- throw iae;
- }
-
- // Extract the element format.
- if (index < max && pat.charAt(index) == ',')
- {
- index = scanFormatElement (pat, index + 1, buffer, ',');
- mfe.type = buffer.toString();
-
- // Extract the style.
- if (index < max && pat.charAt(index) == ',')
- {
- index = scanFormatElement (pat, index + 1, buffer, '}');
- mfe.style = buffer.toString ();
- }
- }
-
- // Advance past the last terminator.
- if (index >= max || pat.charAt(index) != '}')
- throw new IllegalArgumentException("Missing '}' at end of message format");
- ++index;
-
- // Now fetch trailing string.
- index = scanString (pat, index, buffer);
- mfe.trailer = buffer.toString ();
-
- mfe.setLocale(locale);
-
- return index;
- }
-
- /**
- * Applies the specified pattern to this MessageFormat.
- *
- * @param aPattern The Pattern
- */
- public void applyPattern (String newPattern)
- {
- pattern = newPattern;
-
- StringBuffer tempBuffer = new StringBuffer ();
-
- int index = scanString (newPattern, 0, tempBuffer);
- leader = tempBuffer.toString();
-
- Vector elts = new Vector ();
- while (index < newPattern.length())
- index = scanFormat (newPattern, index, tempBuffer, elts, locale);
-
- elements = new MessageFormatElement[elts.size()];
- elts.copyInto(elements);
- }
-
- /**
- * Overrides Format.clone()
- */
- public Object clone ()
- {
- MessageFormat c = (MessageFormat) super.clone ();
- c.elements = (MessageFormatElement[]) elements.clone ();
- return c;
- }
-
- /**
- * Overrides Format.equals(Object obj)
- */
- public boolean equals (Object obj)
- {
- if (! (obj instanceof MessageFormat))
- return false;
- MessageFormat mf = (MessageFormat) obj;
- return (pattern.equals(mf.pattern)
- && locale.equals(mf.locale));
- }
-
- /**
- * A convinience method to format patterns.
- *
- * @param aPattern The pattern used when formatting.
- * @param arguments The array containing the objects to be formatted.
- */
- public AttributedCharacterIterator formatToCharacterIterator (Object arguments)
- {
- Object[] arguments_array = (Object[])arguments;
- FormatCharacterIterator iterator = new FormatCharacterIterator();
-
- formatInternal(arguments_array, new StringBuffer(), null, iterator);
-
- return iterator;
- }
-
- /**
- * A convinience method to format patterns.
- *
- * @param aPattern The pattern used when formatting.
- * @param arguments The array containing the objects to be formatted.
- */
- public static String format (String pattern, Object arguments[])
- {
- MessageFormat mf = new MessageFormat (pattern);
- StringBuffer sb = new StringBuffer ();
- FieldPosition fp = new FieldPosition (NumberFormat.INTEGER_FIELD);
- return mf.formatInternal(arguments, sb, fp, null).toString();
- }
-
- /**
- * Returns the pattern with the formatted objects.
- *
- * @param source The array containing the objects to be formatted.
- * @param result The StringBuffer where the text is appened.
- * @param fp A FieldPosition object (it is ignored).
- */
- public final StringBuffer format (Object arguments[], StringBuffer appendBuf,
- FieldPosition fp)
- {
- return formatInternal(arguments, appendBuf, fp, null);
- }
-
- private StringBuffer formatInternal (Object arguments[],
- StringBuffer appendBuf,
- FieldPosition fp,
- FormatCharacterIterator output_iterator)
- {
- appendBuf.append(leader);
- if (output_iterator != null)
- output_iterator.append(leader);
-
- for (int i = 0; i < elements.length; ++i)
- {
- Object thisArg = null;
- boolean unavailable = false;
- if (arguments == null || elements[i].argNumber >= arguments.length)
- unavailable = true;
- else
- thisArg = arguments[elements[i].argNumber];
-
- AttributedCharacterIterator iterator = null;
-
- Format formatter = null;
-
- if (fp != null && i == fp.getField() && fp.getFieldAttribute() == Field.ARGUMENT)
- fp.setBeginIndex(appendBuf.length());
-
- if (unavailable)
- appendBuf.append("{" + elements[i].argNumber + "}");
- else
- {
- if (elements[i].setFormat != null)
- formatter = elements[i].setFormat;
- else if (elements[i].format != null)
- {
- if (elements[i].formatClass != null
- && ! elements[i].formatClass.isInstance(thisArg))
- throw new IllegalArgumentException("Wrong format class");
-
- formatter = elements[i].format;
- }
- else if (thisArg instanceof Number)
- formatter = NumberFormat.getInstance(locale);
- else if (thisArg instanceof Date)
- formatter = DateFormat.getTimeInstance(DateFormat.DEFAULT, locale);
- else
- appendBuf.append(thisArg);
- }
-
- if (fp != null && fp.getField() == i && fp.getFieldAttribute() == Field.ARGUMENT)
- fp.setEndIndex(appendBuf.length());
-
- if (formatter != null)
- {
- // Special-case ChoiceFormat.
- if (formatter instanceof ChoiceFormat)
- {
- StringBuffer buf = new StringBuffer ();
- formatter.format(thisArg, buf, fp);
- MessageFormat mf = new MessageFormat ();
- mf.setLocale(locale);
- mf.applyPattern(buf.toString());
- mf.format(arguments, appendBuf, fp);
- }
- else
- {
- if (output_iterator != null)
- iterator = formatter.formatToCharacterIterator(thisArg);
- else
- formatter.format(thisArg, appendBuf, fp);
- }
-
- elements[i].format = formatter;
- }
-
- if (output_iterator != null)
- {
- HashMap hash_argument = new HashMap();
- int position = output_iterator.getEndIndex();
-
- hash_argument.put (MessageFormat.Field.ARGUMENT,
- new Integer(elements[i].argNumber));
-
-
- if (iterator != null)
- {
- output_iterator.append(iterator);
- output_iterator.addAttributes(hash_argument, position,
- output_iterator.getEndIndex());
- }
- else
- output_iterator.append(thisArg.toString(), hash_argument);
-
- output_iterator.append(elements[i].trailer);
- }
-
- appendBuf.append(elements[i].trailer);
- }
-
- return appendBuf;
- }
-
- /**
- * Returns the pattern with the formatted objects. The first argument
- * must be a array of Objects.
- * This is equivalent to format((Object[]) objectArray, appendBuf, fpos)
- *
- * @param objectArray The object array to be formatted.
- * @param appendBuf The StringBuffer where the text is appened.
- * @param fpos A FieldPosition object (it is ignored).
- */
- public final StringBuffer format (Object objectArray, StringBuffer appendBuf,
- FieldPosition fpos)
- {
- return format ((Object[])objectArray, appendBuf, fpos);
- }
-
- /**
- * Returns an array with the Formats for
- * the arguments.
- */
- public Format[] getFormats ()
- {
- Format[] f = new Format[elements.length];
- for (int i = elements.length - 1; i >= 0; --i)
- f[i] = elements[i].setFormat;
- return f;
- }
-
- /**
- * Returns the locale.
- */
- public Locale getLocale ()
- {
- return locale;
- }
-
- /**
- * Overrides Format.hashCode()
- */
- public int hashCode ()
- {
- // FIXME: not a very good hash.
- return pattern.hashCode() + locale.hashCode();
- }
-
- private MessageFormat ()
- {
- }
-
- /**
- * Creates a new MessageFormat object with
- * the specified pattern
- *
- * @param pattern The Pattern
- */
- public MessageFormat(String pattern)
- {
- this(pattern, Locale.getDefault());
- }
-
- /**
- * Creates a new MessageFormat object with
- * the specified pattern
- *
- * @param pattern The Pattern
- * @param locale The Locale to use
- *
- * @since 1.4
- */
- public MessageFormat(String pattern, Locale locale)
- {
- this.locale = locale;
- applyPattern (pattern);
- }
-
- /**
- * Parse a string <code>sourceStr</code> against the pattern specified
- * to the MessageFormat constructor.
- *
- * @param sourceStr the string to be parsed.
- * @param pos the current parse position (and eventually the error position).
- * @return the array of parsed objects sorted according to their argument number
- * in the pattern.
- */
- public Object[] parse (String sourceStr, ParsePosition pos)
- {
- // Check initial text.
- int index = pos.getIndex();
- if (! sourceStr.startsWith(leader, index))
- {
- pos.setErrorIndex(index);
- return null;
- }
- index += leader.length();
-
- Vector results = new Vector (elements.length, 1);
- // Now check each format.
- for (int i = 0; i < elements.length; ++i)
- {
- Format formatter = null;
- if (elements[i].setFormat != null)
- formatter = elements[i].setFormat;
- else if (elements[i].format != null)
- formatter = elements[i].format;
-
- Object value = null;
- if (formatter instanceof ChoiceFormat)
- {
- // We must special-case a ChoiceFormat because it might
- // have recursive formatting.
- ChoiceFormat cf = (ChoiceFormat) formatter;
- String[] formats = (String[]) cf.getFormats();
- double[] limits = (double[]) cf.getLimits();
- MessageFormat subfmt = new MessageFormat ();
- subfmt.setLocale(locale);
- ParsePosition subpos = new ParsePosition (index);
-
- int j;
- for (j = 0; value == null && j < limits.length; ++j)
- {
- subfmt.applyPattern(formats[j]);
- subpos.setIndex(index);
- value = subfmt.parse(sourceStr, subpos);
- }
- if (value != null)
- {
- index = subpos.getIndex();
- value = new Double (limits[j]);
- }
- }
- else if (formatter != null)
- {
- pos.setIndex(index);
- value = formatter.parseObject(sourceStr, pos);
- if (value != null)
- index = pos.getIndex();
- }
- else
- {
- // We have a String format. This can lose in a number
- // of ways, but we give it a shot.
- int next_index;
- if (elements[i].trailer.length() > 0)
- next_index = sourceStr.indexOf(elements[i].trailer, index);
- else
- next_index = sourceStr.length();
- if (next_index == -1)
- {
- pos.setErrorIndex(index);
- return null;
- }
- value = sourceStr.substring(index, next_index);
- index = next_index;
- }
-
- if (value == null
- || ! sourceStr.startsWith(elements[i].trailer, index))
- {
- pos.setErrorIndex(index);
- return null;
- }
-
- if (elements[i].argNumber >= results.size())
- results.setSize(elements[i].argNumber + 1);
- results.setElementAt(value, elements[i].argNumber);
-
- index += elements[i].trailer.length();
- }
-
- Object[] r = new Object[results.size()];
- results.copyInto(r);
- return r;
- }
-
- public Object[] parse (String sourceStr) throws ParseException
- {
- ParsePosition pp = new ParsePosition (0);
- Object[] r = parse (sourceStr, pp);
- if (r == null)
- throw new ParseException ("couldn't parse string", pp.getErrorIndex());
- return r;
- }
-
- public Object parseObject (String sourceStr, ParsePosition pos)
- {
- return parse (sourceStr, pos);
- }
-
- /**
- * Sets the format for the argument at an specified
- * index.
- *
- * @param index The index.
- * @format The Format object.
- */
- public void setFormat (int variableNum, Format newFormat)
- {
- elements[variableNum].setFormat = newFormat;
- }
-
- /**
- * Sets the formats for the arguments.
- *
- * @param formats An array of Format objects.
- */
- public void setFormats (Format[] newFormats)
- {
- if (newFormats.length < elements.length)
- throw new IllegalArgumentException("Not enough format objects");
-
- int len = Math.min(newFormats.length, elements.length);
- for (int i = 0; i < len; ++i)
- elements[i].setFormat = newFormats[i];
- }
-
- /**
- * Sets the locale.
- *
- * @param locale A Locale
- */
- public void setLocale (Locale loc)
- {
- locale = loc;
- if (elements != null)
- {
- for (int i = 0; i < elements.length; ++i)
- elements[i].setLocale(loc);
- }
- }
-
- /**
- * Returns the pattern.
- */
- public String toPattern ()
- {
- return pattern;
- }
-
- /**
- * Return the formatters used sorted by argument index. It uses the
- * internal table to fill in this array: if a format has been
- * set using <code>setFormat</code> or <code>setFormatByArgumentIndex</code>
- * then it returns it at the right index. If not it uses the detected
- * formatters during a <code>format</code> call. If nothing is known
- * about that argument index it just puts null at that position.
- * To get useful informations you may have to call <code>format</code>
- * at least once.
- *
- * @return an array of formatters sorted by argument index.
- */
- public Format[] getFormatsByArgumentIndex()
- {
- int argNumMax = 0;
- // First, find the greatest argument number.
- for (int i=0;i<elements.length;i++)
- if (elements[i].argNumber > argNumMax)
- argNumMax = elements[i].argNumber;
-
- Format[] formats = new Format[argNumMax];
- for (int i=0;i<elements.length;i++)
- {
- if (elements[i].setFormat != null)
- formats[elements[i].argNumber] = elements[i].setFormat;
- else if (elements[i].format != null)
- formats[elements[i].argNumber] = elements[i].format;
- }
- return formats;
- }
-
- /**
- * Set the format to used using the argument index number.
- *
- * @param argumentIndex the argument index.
- * @param newFormat the format to use for this argument.
- */
- public void setFormatByArgumentIndex(int argumentIndex,
- Format newFormat)
- {
- for (int i=0;i<elements.length;i++)
- {
- if (elements[i].argNumber == argumentIndex)
- elements[i].setFormat = newFormat;
- }
- }
-
- /**
- * Set the format for argument using a specified array of formatters
- * which is sorted according to the argument index. If the number of
- * elements in the array is fewer than the number of arguments only
- * the arguments specified by the array are touched.
- *
- * @param newFormats array containing the new formats to set.
- *
- * @throws NullPointerException if newFormats is null
- */
- public void setFormatsByArgumentIndex(Format[] newFormats)
- {
- for (int i=0;i<newFormats.length;i++)
- {
- // Nothing better than that can exist here.
- setFormatByArgumentIndex(i, newFormats[i]);
- }
- }
-
- // The pattern string.
- private String pattern;
- // The locale.
- private Locale locale;
- // Variables.
- private MessageFormatElement[] elements;
- // Leader text.
- private String leader;
-}
diff --git a/libjava/java/text/NumberFormat.java b/libjava/java/text/NumberFormat.java
deleted file mode 100644
index b58476f7256..00000000000
--- a/libjava/java/text/NumberFormat.java
+++ /dev/null
@@ -1,803 +0,0 @@
-/* NumberFormat.java -- Formats and parses numbers
- Copyright (C) 1998, 1999, 2000, 2001, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import java.io.IOException;
-import java.io.InvalidObjectException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Currency;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * This is the abstract superclass of all classes which format and
- * parse numeric values such as decimal numbers, integers, currency values,
- * and percentages. These classes perform their parsing and formatting
- * in a locale specific manner, accounting for such items as differing
- * currency symbols and thousands separators.
- * <p>
- * To create an instance of a concrete subclass of <code>NumberFormat</code>,
- * do not call a class constructor directly. Instead, use one of the
- * static factory methods in this class such as
- * <code>getCurrencyInstance</code>.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @date March 4, 1999
- */
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct to 1.2, except getAvailableLocales.
- */
-public abstract class NumberFormat extends Format implements Cloneable
-{
- /**
- * This is a constant used to create a <code>FieldPosition</code> object
- * that will return the integer portion of a formatted number.
- */
- public static final int INTEGER_FIELD = 0;
-
- /**
- * This is a constant used to create a <code>FieldPosition</code> object
- * that will return the fractional portion of a formatted number.
- */
- public static final int FRACTION_FIELD = 1;
-
- public static class Field extends Format.Field
- {
- static final long serialVersionUID = 7494728892700160890L;
-
- /**
- * Attribute set to all characters containing digits of the integer
- * part.
- */
- public static final NumberFormat.Field INTEGER
- = new Field("integer");
-
- /**
- * Attribute set to all characters containing digits of the fractional
- * part.
- */
- public static final NumberFormat.Field FRACTION
- = new Field("fraction");
-
- /**
- * Attribute set to all characters containing digits of the exponential
- * part.
- */
- public static final NumberFormat.Field EXPONENT
- = new Field("exponent");
-
- /**
- * Attribute set to all characters containing a decimal separator.
- */
- public static final NumberFormat.Field DECIMAL_SEPARATOR
- = new Field("decimal separator");
-
- /**
- * Attribute set to all characters containing a sign (plus or minus).
- */
- public static final NumberFormat.Field SIGN
- = new Field("sign");
-
- /**
- * Attribute set to all characters containing a grouping separator (e.g.
- * a comma, a white space,...).
- */
- public static final NumberFormat.Field GROUPING_SEPARATOR
- = new Field("grouping separator");
-
- /**
- * Attribute set to all characters containing an exponential symbol (e.g.
- * 'E')
- */
- public static final NumberFormat.Field EXPONENT_SYMBOL
- = new Field("exponent symbol");
-
- /**
- * Attribute set to all characters containing a percent symbol (e.g. '%')
- */
- public static final NumberFormat.Field PERCENT
- = new Field("percent");
-
- /**
- * Attribute set to all characters containing a permille symbol.
- */
- public static final NumberFormat.Field PERMILLE
- = new Field("permille");
-
- /**
- * Attribute set to all characters containing the currency unit.
- */
- public static final NumberFormat.Field CURRENCY
- = new Field("currency");
-
- /**
- * Attribute set to all characters containing the exponent sign.
- */
- public static final NumberFormat.Field EXPONENT_SIGN
- = new Field("exponent sign");
-
- /**
- * Private fields to register all fields contained in this descriptor.
- */
- private static final NumberFormat.Field[] allFields =
- {
- INTEGER, FRACTION, EXPONENT, DECIMAL_SEPARATOR, SIGN,
- GROUPING_SEPARATOR, EXPONENT_SYMBOL, PERCENT,
- PERMILLE, CURRENCY, EXPONENT_SIGN
- };
-
- /**
- * This constructor is only used by the deserializer. Without it,
- * it would fail to construct a valid object.
- */
- private Field()
- {
- super("");
- }
-
- /**
- * Create a Field instance with the specified field name.
- *
- * @param field_name Field name for the new Field instance.
- */
- protected Field(String field_name)
- {
- super (field_name);
- }
-
- /**
- * This function is used by the deserializer to know which object
- * to use when it encounters an encoded NumberFormat.Field in a
- * serialization stream. If the stream is valid it should return
- * one of the above field. In the other case we throw an exception.
- *
- * @return a valid official NumberFormat.Field instance.
- *
- * @throws InvalidObjectException if the field name is invalid.
- */
- protected Object readResolve() throws InvalidObjectException
- {
- String s = getName();
- for (int i = 0; i < allFields.length; i++)
- if (s.equals(allFields[i].getName()))
- return allFields[i];
-
- throw new InvalidObjectException("no such NumberFormat field called "
- + s);
- }
- }
-
- /**
- * This method is a specialization of the format method that performs
- * a simple formatting of the specified <code>long</code> number.
- *
- * @param number The <code>long</code> to format.
- *
- * @return The formatted number
- */
- public final String format (long number)
- {
- StringBuffer sbuf = new StringBuffer(50);
- format (number, sbuf, null);
- return sbuf.toString();
- }
-
- public final StringBuffer format (Object obj, StringBuffer sbuf,
- FieldPosition pos)
- {
- if (obj instanceof Number)
- return format(((Number) obj).doubleValue(), sbuf, pos);
- else
- throw new IllegalArgumentException
- ("Cannot format given Object as a Number");
- }
-
- /**
- * This method formats the specified <code>double</code> and appends it to
- * a <code>StringBuffer</code>.
- *
- * @param number The <code>double</code> to format.
- * @param sb The <code>StringBuffer</code> to append the formatted number to.
- * @param pos The desired <code>FieldPosition</code>.
- *
- * @return The <code>StringBuffer</code> with the appended number.
- */
- public abstract StringBuffer format (double number,
- StringBuffer sbuf, FieldPosition pos);
-
- /**
- * This method formats the specified <code>long</code> and appends it to
- * a <code>StringBuffer</code>.
- *
- * @param number The <code>long</code> to format.
- * @param sb The <code>StringBuffer</code> to append the formatted number to.
- * @param pos The desired <code>FieldPosition</code>.
- *
- * @return The <code>StringBuffer</code> with the appended number.
- */
- public abstract StringBuffer format (long number,
- StringBuffer sbuf, FieldPosition pos);
-
- /**
- * This method tests the specified object for equality against this object.
- * This will be <code>true</code> if the following conditions are met:
- * <p>
- * <ul>
- * <li>The specified object is not <code>null</code>.
- * <li>The specified object is an instance of <code>NumberFormat</code>.
- * </ul>
- * <p>
- * Since this method does not test much, it is highly advised that
- * concrete subclasses override this method.
- *
- * @param obj The <code>Object</code> to test against equality with
- * this object.
- *
- * @return <code>true</code> if the specified object is equal to
- * this object, <code>false</code> otherwise.
- */
- public boolean equals (Object obj)
- {
- if (! (obj instanceof NumberFormat))
- return false;
- NumberFormat nf = (NumberFormat) obj;
- return (groupingUsed == nf.groupingUsed
- && maximumFractionDigits == nf.maximumFractionDigits
- && maximumIntegerDigits == nf.maximumIntegerDigits
- && minimumFractionDigits == nf.minimumFractionDigits
- && minimumIntegerDigits == nf.minimumIntegerDigits
- && parseIntegerOnly == nf.parseIntegerOnly);
- }
-
- /**
- * This method returns a list of locales for which concrete instances
- * of <code>NumberFormat</code> subclasses may be created.
- *
- * @return The list of available locales.
- */
- public static Locale[] getAvailableLocales ()
- {
- Locale[] list = new Locale[1];
- list[0] = Locale.US;
- return list;
- }
-
- private static NumberFormat computeInstance(Locale loc, String resource,
- String def)
- {
- ResourceBundle res;
- try
- {
- res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation",
- loc, ClassLoader.getSystemClassLoader());
- }
- catch (MissingResourceException x)
- {
- res = null;
- }
- String fmt;
- try
- {
- fmt = res == null ? def : res.getString(resource);
- }
- catch (MissingResourceException x)
- {
- fmt = def;
- }
- DecimalFormatSymbols dfs = new DecimalFormatSymbols (loc);
- return new DecimalFormat (fmt, dfs);
- }
-
- /**
- * This method returns an instance of <code>NumberFormat</code> suitable
- * for formatting and parsing currency values in the default locale.
- *
- * @return An instance of <code>NumberFormat</code> for handling currencies.
- */
- public static final NumberFormat getCurrencyInstance ()
- {
- return getCurrencyInstance (Locale.getDefault());
- }
-
- /**
- * This method returns an instance of <code>NumberFormat</code> suitable
- * for formatting and parsing currency values in the specified locale.
- *
- * @return An instance of <code>NumberFormat</code> for handling currencies.
- */
- public static NumberFormat getCurrencyInstance (Locale loc)
- {
- return computeInstance (loc, "currencyFormat", "$#,##0.00;($#,##0.00)");
- }
-
- /**
- * This method returns a default instance for the default locale. This
- * will be a concrete subclass of <code>NumberFormat</code>, but the
- * actual class returned is dependent on the locale.
- *
- * @return An instance of the default <code>NumberFormat</code> class.
- */
- public static final NumberFormat getInstance ()
- {
- return getInstance (Locale.getDefault());
- }
-
- /**
- * This method returns a default instance for the specified locale. This
- * will be a concrete subclass of <code>NumberFormat</code>, but the
- * actual class returned is dependent on the locale.
- *
- * @param locale The desired locale.
- *
- * @return An instance of the default <code>NumberFormat</code> class.
- */
- public static NumberFormat getInstance (Locale loc)
- {
- // For now always return a number instance.
- return getNumberInstance (loc);
- }
-
- /**
- * This method returns the maximum number of digits allowed in the fraction
- * portion of a number.
- *
- * @return The maximum number of digits allowed in the fraction
- * portion of a number.
- */
- public int getMaximumFractionDigits ()
- {
- return maximumFractionDigits;
- }
-
- /**
- * This method returns the maximum number of digits allowed in the integer
- * portion of a number.
- *
- * @return The maximum number of digits allowed in the integer
- * portion of a number.
- */
- public int getMaximumIntegerDigits ()
- {
- return maximumIntegerDigits;
- }
-
- /**
- * This method returns the minimum number of digits allowed in the fraction
- * portion of a number.
- *
- * @return The minimum number of digits allowed in the fraction
- * portion of a number.
- */
- public int getMinimumFractionDigits ()
- {
- return minimumFractionDigits;
- }
-
- /**
- * This method returns the minimum number of digits allowed in the integer
- * portion of a number.
- *
- * @return The minimum number of digits allowed in the integer
- * portion of a number.
- */
- public int getMinimumIntegerDigits ()
- {
- return minimumIntegerDigits;
- }
-
- /**
- * This method returns a default instance for the specified locale. This
- * will be a concrete subclass of <code>NumberFormat</code>, but the
- * actual class returned is dependent on the locale.
- *
- * @param locale The desired locale.
- *
- * @return An instance of the default <code>NumberFormat</code> class.
- */
- public static final NumberFormat getNumberInstance ()
- {
- return getNumberInstance (Locale.getDefault());
- }
-
- /**
- * This method returns a general purpose number formatting and parsing
- * class for the default locale. This will be a concrete subclass of
- * <code>NumberFormat</code>, but the actual class returned is dependent
- * on the locale.
- *
- * @return An instance of a generic number formatter for the default locale.
- */
- public static NumberFormat getNumberInstance (Locale loc)
- {
- return computeInstance (loc, "numberFormat", "#,##0.###");
- }
-
- /**
- * This method returns an integer formatting and parsing class for the
- * default locale. This will be a concrete subclass of <code>NumberFormat</code>,
- * but the actual class returned is dependent on the locale.
- *
- * @return An instance of an integer number formatter for the default locale.
- * @since 1.4
- */
- public static final NumberFormat getIntegerInstance()
- {
- return getIntegerInstance (Locale.getDefault());
- }
-
- /**
- * This method returns an integer formatting and parsing class for the
- * default locale. This will be a concrete subclass of <code>NumberFormat</code>,
- * but the actual class returned is dependent on the locale.
- *
- * @param locale the desired locale.
- *
- * @return An instance of an integer number formatter for the desired locale.
- * @since 1.4
- */
- public static NumberFormat getIntegerInstance(Locale locale)
- {
- NumberFormat format = computeInstance (locale, "numberFormat", "#,##0");
- format.setParseIntegerOnly (true);
- return format;
- }
-
- /**
- * This method returns an instance of <code>NumberFormat</code> suitable
- * for formatting and parsing percentage values in the default locale.
- *
- * @return An instance of <code>NumberFormat</code> for handling percentages.
- */
- public static final NumberFormat getPercentInstance ()
- {
- return getPercentInstance (Locale.getDefault());
- }
-
- /**
- * This method returns an instance of <code>NumberFormat</code> suitable
- * for formatting and parsing percentage values in the specified locale.
- *
- * @param locale The desired locale.
- *
- * @return An instance of <code>NumberFormat</code> for handling percentages.
- */
- public static NumberFormat getPercentInstance (Locale loc)
- {
- return computeInstance (loc, "percentFormat", "#,##0%");
- }
-
- /**
- * This method returns a hash value for this object.
- *
- * @return The hash code.
- */
- public int hashCode ()
- {
- int hash = super.hashCode();
- hash ^= (maximumFractionDigits + maximumIntegerDigits
- + minimumFractionDigits + minimumIntegerDigits);
- if (groupingUsed)
- hash ^= 0xf0f0;
- if (parseIntegerOnly)
- hash ^= 0x0f0f;
- return hash;
- }
-
- /**
- * This method tests whether or not grouping is in use. Grouping is
- * a method of marking separations in numbers, such as thousand separators
- * in the US English locale. The grouping positions and symbols are all
- * locale specific. As an example, with grouping disabled, the number one
- * million would appear as "1000000". With grouping enabled, this number
- * might appear as "1,000,000". (Both of these assume the US English
- * locale).
- *
- * @return <code>true</code> if grouping is enabled,
- * <code>false</code> otherwise.
- */
- public boolean isGroupingUsed ()
- {
- return groupingUsed;
- }
-
- /**
- * This method tests whether or not only integer values should be parsed.
- * If this class is parsing only integers, parsing stops at the decimal
- * point.
- *
- * @return <code>true</code> if only integers are parsed,
- * <code>false</code> otherwise.
- */
- public boolean isParseIntegerOnly ()
- {
- return parseIntegerOnly;
- }
-
- /**
- * This is a default constructor for use by subclasses.
- */
- public NumberFormat ()
- {
- }
-
- /**
- * This method parses the specified string into a <code>Number</code>. This
- * will be a <code>Long</code> if possible, otherwise it will be a
- * <code>Double</code>. If no number can be parsed, no exception is
- * thrown. Instead, the parse position remains at its initial index.
- *
- * @param str The string to parse.
- * @param pp The desired <code>ParsePosition</code>.
- *
- * @return The parsed <code>Number</code>
- */
- public abstract Number parse (String sourceStr, ParsePosition pos);
-
- /**
- * This method parses the specified string into a <code>Number</code>. This
- * will be a <code>Long</code> if possible, otherwise it will be a
- * <code>Double</code>. If no number can be parsed, an exception will be
- * thrown.
- *
- * @param str The string to parse.
- *
- * @return The parsed <code>Number</code>
- *
- * @exception ParseException If no number can be parsed.
- */
- public Number parse (String sourceStr) throws ParseException
- {
- ParsePosition pp = new ParsePosition (0);
- Number r = parse (sourceStr, pp);
- if (r == null)
- {
- int index = pp.getErrorIndex();
- if (index < 0)
- index = pp.getIndex();
- throw new ParseException ("couldn't parse number", index);
- }
- return r;
- }
-
- /**
- * This method parses the specified string into an <code>Object</code>. This
- * will be a <code>Long</code> if possible, otherwise it will be a
- * <code>Double</code>. If no number can be parsed, no exception is
- * thrown. Instead, the parse position remains at its initial index.
- *
- * @param str The string to parse.
- * @param pp The desired <code>ParsePosition</code>.
- *
- * @return The parsed <code>Object</code>
- */
- public final Object parseObject (String sourceStr, ParsePosition pos)
- {
- return parse (sourceStr, pos);
- }
-
- /**
- * This method sets the grouping behavior of this formatter. Grouping is
- * a method of marking separations in numbers, such as thousand separators
- * in the US English locale. The grouping positions and symbols are all
- * locale specific. As an example, with grouping disabled, the number one
- * million would appear as "1000000". With grouping enabled, this number
- * might appear as "1,000,000". (Both of these assume the US English
- * locale).
- *
- * @param groupingUsed <code>true</code> to enable grouping,
- * <code>false</code> to disable it.
- */
- public void setGroupingUsed (boolean newValue)
- {
- groupingUsed = newValue;
- }
-
- /**
- * This method sets the maximum number of digits allowed in the fraction
- * portion of a number to the specified value. If this is less than the
- * current minimum allowed digits, the minimum allowed digits value will
- * be lowered to be equal to the new maximum allowed digits value.
- *
- * @param maximumFractionDigits The new maximum fraction digits value.
- */
- public void setMaximumFractionDigits (int newValue)
- {
- maximumFractionDigits = newValue;
- if (getMinimumFractionDigits () > maximumFractionDigits)
- setMinimumFractionDigits (maximumFractionDigits);
- }
-
- /**
- * This method sets the maximum number of digits allowed in the integer
- * portion of a number to the specified value. If this is less than the
- * current minimum allowed digits, the minimum allowed digits value will
- * be lowered to be equal to the new maximum allowed digits value.
- *
- * @param maximumIntegerDigits The new maximum integer digits value.
- */
- public void setMaximumIntegerDigits (int newValue)
- {
- maximumIntegerDigits = newValue;
- if (getMinimumIntegerDigits () > maximumIntegerDigits)
- setMinimumIntegerDigits (maximumIntegerDigits);
- }
-
- /**
- * This method sets the minimum number of digits allowed in the fraction
- * portion of a number to the specified value. If this is greater than the
- * current maximum allowed digits, the maximum allowed digits value will
- * be raised to be equal to the new minimum allowed digits value.
- *
- * @param minimumFractionDigits The new minimum fraction digits value.
- */
- public void setMinimumFractionDigits (int newValue)
- {
- minimumFractionDigits = newValue;
- if (getMaximumFractionDigits () < minimumFractionDigits)
- setMaximumFractionDigits (minimumFractionDigits);
- }
-
- /**
- * This method sets the minimum number of digits allowed in the integer
- * portion of a number to the specified value. If this is greater than the
- * current maximum allowed digits, the maximum allowed digits value will
- * be raised to be equal to the new minimum allowed digits value.
- *
- * @param minimumIntegerDigits The new minimum integer digits value.
- */
- public void setMinimumIntegerDigits (int newValue)
- {
- minimumIntegerDigits = newValue;
- if (getMaximumIntegerDigits () < minimumIntegerDigits)
- setMaximumIntegerDigits (minimumIntegerDigits);
- }
-
- /**
- * This method sets the parsing behavior of this object to parse only
- * integers or not.
- *
- * @param parseIntegerOnly <code>true</code> to parse only integers,
- * <code>false</code> otherwise.
- */
- public void setParseIntegerOnly (boolean value)
- {
- parseIntegerOnly = value;
- }
-
- /**
- * This method is a specialization of the format method that performs
- * a simple formatting of the specified <code>double</code> number.
- *
- * @param number The <code>double</code> to format.
- *
- * @return The formatted number
- */
- public final String format (double number)
- {
- StringBuffer sbuf = new StringBuffer(50);
- format (number, sbuf, null);
- return sbuf.toString();
- }
-
- // These field names are fixed by the serialization spec.
- boolean groupingUsed;
- int maximumFractionDigits;
- private byte maxFractionDigits;
- int maximumIntegerDigits;
- private byte maxIntegerDigits;
- int minimumFractionDigits;
- private byte minFractionDigits;
- int minimumIntegerDigits;
- private byte minIntegerDigits;
- boolean parseIntegerOnly;
- private int serialVersionOnStream;
- private static final long serialVersionUID = -2308460125733713944L;
-
- private void readObject(ObjectInputStream stream)
- throws IOException, ClassNotFoundException
- {
- stream.defaultReadObject();
- if (serialVersionOnStream < 1)
- {
- maximumFractionDigits = maxFractionDigits;
- maximumIntegerDigits = maxIntegerDigits;
- minimumFractionDigits = minFractionDigits;
- minimumIntegerDigits = minIntegerDigits;
- serialVersionOnStream = 1;
- }
- }
-
- private void writeObject(ObjectOutputStream stream) throws IOException
- {
- maxFractionDigits = maximumFractionDigits < Byte.MAX_VALUE ?
- (byte) maximumFractionDigits : Byte.MAX_VALUE;
- maxIntegerDigits = maximumIntegerDigits < Byte.MAX_VALUE ?
- (byte) maximumIntegerDigits : Byte.MAX_VALUE;
- minFractionDigits = minimumFractionDigits < Byte.MAX_VALUE ?
- (byte) minimumFractionDigits : Byte.MAX_VALUE;
- minIntegerDigits = minimumIntegerDigits < Byte.MAX_VALUE ?
- (byte) minimumIntegerDigits : Byte.MAX_VALUE;
- serialVersionOnStream = 1;
- stream.defaultWriteObject();
- }
-
- /**
- * Returns the currency used by this number format when formatting currency
- * values.
- *
- * The default implementation throws UnsupportedOperationException.
- *
- * @return The used currency object, or null.
- *
- * @throws UnsupportedOperationException If the number format class doesn't
- * implement currency formatting.
- *
- * @since 1.4
- */
- public Currency getCurrency()
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Sets the currency used by this number format when formatting currency
- * values.
- *
- * The default implementation throws UnsupportedOperationException.
- *
- * @param currency The new currency to be used by this number format.
- *
- * @throws NullPointerException If currenc is null.
- * @throws UnsupportedOperationException If the number format class doesn't
- * implement currency formatting.
- *
- * @since 1.4
- */
- public void setCurrency(Currency currency)
- {
- if (currency == null)
- throw new NullPointerException("currency may not be null");
-
- throw new UnsupportedOperationException();
- }
-}
diff --git a/libjava/java/text/ParseException.java b/libjava/java/text/ParseException.java
deleted file mode 100644
index 6d014effd2a..00000000000
--- a/libjava/java/text/ParseException.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* ParseException.java -- an error occurred while parsing
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-/**
- * This exception is thrown when an unexpected error occurs during parsing.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner (bothner@cygnus.com)
- * @see Format
- * @see FieldPosition
- * @status updated to 1.4
- */
-public class ParseException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 2703218443322787634L;
-
- /**
- * This is the position where the error was encountered.
- *
- * @serial the zero-based offset in the string where the error occurred
- */
- private final int errorOffset;
-
- /**
- * This method initializes a new instance of <code>ParseException</code>
- * with a detailed error message and a error position.
- *
- * @param msg the descriptive message describing the error
- * @param offset the position where the error was encountered
- */
- public ParseException(String s, int offset)
- {
- super(s);
- errorOffset = offset;
- }
-
- /**
- * This method returns the position where the error occurred.
- *
- * @return the position where the error occurred
- */
- public int getErrorOffset()
- {
- return errorOffset;
- }
-} // class ParseException
diff --git a/libjava/java/text/ParsePosition.java b/libjava/java/text/ParsePosition.java
deleted file mode 100644
index 782f5e0eda2..00000000000
--- a/libjava/java/text/ParsePosition.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/* ParsePosition.java -- Keep track of position while parsing.
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-/**
- * This class is used to keep track of the current position during parsing
- * operations.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner (bothner@cygnus.com)
- */
-public class ParsePosition
-{
- /**
- * This is the index of the current parse position.
- */
- private int index;
-
- /**
- * This is the index of the position where an error occurred during parsing.
- */
- private int error_index;
-
- /**
- * This method initializes a new instance of <code>ParsePosition</code> to
- * have the specified initial index value.
- *
- * @param index The initial parsing index.
- */
- public ParsePosition (int index)
- {
- this.index = index;
- error_index = -1;
- }
-
- /**
- * This method returns the current parsing index.
- *
- * @return The current parsing index
- */
- public int getIndex ()
- {
- return index;
- }
-
- /**
- * This method sets the current parsing index to the specified value.
- *
- * @param index The new parsing index.
- */
- public void setIndex (int index)
- {
- this.index = index;
- }
-
- /**
- * This method returns the error index value. This value defaults to -1
- * unless explicitly set to another value.
- *
- * @return The error index.
- */
- public int getErrorIndex ()
- {
- return error_index;
- }
-
- /**
- * This method sets the error index to the specified value.
- *
- * @param error_index The new error index
- */
- public void setErrorIndex (int error_index)
- {
- this.error_index = error_index;
- }
-
- /**
- * This method tests the specified object for equality with this
- * object. The two objects will be considered equal if and only if
- * all of the following conditions are met.
- * <p>
- * <ul>
- * <li>The specified object is not <code>null</code>.</li>
- * <li>The specified object is an instance of <code>ParsePosition</code>.</li>
- * <li>The specified object has the same index and error index as
- * this object.</li>
- * </ul>
- *
- * @param obj The <code>Object</code> to test for equality against
- * this object.
- *
- * @return <code>true</code> if the specified object is equal to
- * this object, <code>false</code> otherwise.
- */
- public boolean equals (Object obj)
- {
- if (! (obj instanceof ParsePosition))
- return false;
-
- ParsePosition other = (ParsePosition) obj;
- return index == other.index && error_index == other.error_index;
- }
-
- /**
- * This method returns a <code>String</code> representation of this
- * object.
- *
- * @return A <code>String</code> that represents this object.
- */
- public String toString ()
- {
- return (getClass ().getName () + "[index=" + getIndex ()
- + ",errorIndex=" + getErrorIndex () + "]");
- }
-}
diff --git a/libjava/java/text/RuleBasedCollator.java b/libjava/java/text/RuleBasedCollator.java
deleted file mode 100644
index ae84a41032d..00000000000
--- a/libjava/java/text/RuleBasedCollator.java
+++ /dev/null
@@ -1,1017 +0,0 @@
-/* RuleBasedCollator.java -- Concrete Collator Class
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct
- */
-
-/**
- * This class is a concrete subclass of <code>Collator</code> suitable
- * for string collation in a wide variety of languages. An instance of
- * this class is normally returned by the <code>getInstance</code> method
- * of <code>Collator</code> with rules predefined for the requested
- * locale. However, an instance of this class can be created manually
- * with any desired rules.
- * <p>
- * Rules take the form of a <code>String</code> with the following syntax
- * <ul>
- * <li> Modifier: '@'</li>
- * <li> Relation: '&lt;' | ';' | ',' | '=' : &lt;text&gt;</li>
- * <li> Reset: '&amp;' : &lt;text&gt;</li>
- * </ul>
- * The modifier character indicates that accents sort backward as is the
- * case with French. The modifier applies to all rules <b>after</b>
- * the modifier but before the next primary sequence. If placed at the end
- * of the sequence if applies to all unknown accented character.
- * The relational operators specify how the text
- * argument relates to the previous term. The relation characters have
- * the following meanings:
- * <ul>
- * <li>'&lt;' - The text argument is greater than the prior term at the primary
- * difference level.</li>
- * <li>';' - The text argument is greater than the prior term at the secondary
- * difference level.</li>
- * <li>',' - The text argument is greater than the prior term at the tertiary
- * difference level.</li>
- * <li>'=' - The text argument is equal to the prior term</li>
- * </ul>
- * <p>
- * As for the text argument itself, this is any sequence of Unicode
- * characters not in the following ranges: 0x0009-0x000D, 0x0020-0x002F,
- * 0x003A-0x0040, 0x005B-0x0060, and 0x007B-0x007E. If these characters are
- * desired, they must be enclosed in single quotes. If any whitespace is
- * encountered, it is ignored. (For example, "a b" is equal to "ab").
- * <p>
- * The reset operation inserts the following rule at the point where the
- * text argument to it exists in the previously declared rule string. This
- * makes it easy to add new rules to an existing string by simply including
- * them in a reset sequence at the end. Note that the text argument, or
- * at least the first character of it, must be present somewhere in the
- * previously declared rules in order to be inserted properly. If this
- * is not satisfied, a <code>ParseException</code> will be thrown.
- * <p>
- * This system of configuring <code>RuleBasedCollator</code> is needlessly
- * complex and the people at Taligent who developed it (along with the folks
- * at Sun who accepted it into the Java standard library) deserve a slow
- * and agonizing death.
- * <p>
- * Here are a couple of example of rule strings:
- * <p>
- * "&lt; a &lt; b &lt; c" - This string says that a is greater than b which is
- * greater than c, with all differences being primary differences.
- * <p>
- * "&lt; a,A &lt; b,B &lt; c,C" - This string says that 'A' is greater than 'a' with
- * a tertiary strength comparison. Both 'b' and 'B' are greater than 'a' and
- * 'A' during a primary strength comparison. But 'B' is greater than 'b'
- * under a tertiary strength comparison.
- * <p>
- * "&lt; a &lt; c &amp; a &lt; b " - This sequence is identical in function to the
- * "&lt; a &lt; b &lt; c" rule string above. The '&amp;' reset symbol indicates that
- * the rule "&lt; b" is to be inserted after the text argument "a" in the
- * previous rule string segment.
- * <p>
- * "&lt; a &lt; b &amp; y &lt; z" - This is an error. The character 'y' does not appear
- * anywhere in the previous rule string segment so the rule following the
- * reset rule cannot be inserted.
- * <p>
- * "&lt; a &amp; A @ &lt; e &amp; E &lt; f&amp; F" - This sequence is equivalent to the following
- * "&lt; a &amp; A &lt; E &amp; e &lt; f &amp; F".
- * <p>
- * For a description of the various comparison strength types, see the
- * documentation for the <code>Collator</code> class.
- * <p>
- * As an additional complication to this already overly complex rule scheme,
- * if any characters precede the first rule, these characters are considered
- * ignorable. They will be treated as if they did not exist during
- * comparisons. For example, "- &lt; a &lt; b ..." would make '-' an ignorable
- * character such that the strings "high-tech" and "hightech" would
- * be considered identical.
- * <p>
- * A <code>ParseException</code> will be thrown for any of the following
- * conditions:
- * <ul>
- * <li>Unquoted punctuation characters in a text argument.</li>
- * <li>A relational or reset operator not followed by a text argument</li>
- * <li>A reset operator where the text argument is not present in
- * the previous rule string section.</li>
- * </ul>
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Guilhem Lavaux (guilhem@kaffe.org)
- */
-public class RuleBasedCollator extends Collator
-{
- /**
- * This class describes what rank has a character (or a sequence of characters)
- * in the lexicographic order. Each element in a rule has a collation element.
- */
- static final class CollationElement
- {
- String key;
- int primary;
- short secondary;
- short tertiary;
- short equality;
- boolean ignore;
- String expansion;
-
- CollationElement(String key, int primary, short secondary, short tertiary,
- short equality, String expansion, boolean ignore)
- {
- this.key = key;
- this.primary = primary;
- this.secondary = secondary;
- this.tertiary = tertiary;
- this.equality = equality;
- this.ignore = ignore;
- this.expansion = expansion;
- }
-
- int getValue()
- {
- return (primary << 16) + (secondary << 8) + tertiary;
- }
- }
-
- /**
- * Basic collation instruction (internal format) to build the series of
- * collation elements. It contains an instruction which specifies the new
- * state of the generator. The sequence of instruction should not contain
- * RESET (it is used by
- * {@link #mergeRules(int,java.lang.String,java.util.ArrayList,java.util.ArrayList)})
- * as a temporary state while merging two sets of instructions.
- */
- static final class CollationSorter
- {
- static final int GREATERP = 0;
- static final int GREATERS = 1;
- static final int GREATERT = 2;
- static final int EQUAL = 3;
- static final int RESET = 4;
- static final int INVERSE_SECONDARY = 5;
-
- int comparisonType;
- String textElement;
- int hashText;
- int offset;
- boolean ignore;
-
- String expansionOrdering;
- }
-
- /**
- * This the the original rule string.
- */
- private String rules;
-
- /**
- * This is the table of collation element values
- */
- private Object[] ce_table;
-
- /**
- * Quick-prefix finder.
- */
- HashMap prefix_tree;
-
- /**
- * This is the value of the last sequence entered into
- * <code>ce_table</code>. It is used to compute the
- * ordering value of unspecified character.
- */
- private int last_primary_value;
-
- /**
- * This is the value of the last secondary sequence of the
- * primary 0, entered into
- * <code>ce_table</code>. It is used to compute the
- * ordering value of an unspecified accented character.
- */
- private int last_tertiary_value;
-
- /**
- * This variable is true if accents need to be sorted
- * in the other direction.
- */
- private boolean inverseAccentComparison;
-
- /**
- * This collation element is special to unknown sequence.
- * The JDK uses it to mark and sort the characters which has
- * no collation rules.
- */
- static final CollationElement SPECIAL_UNKNOWN_SEQ =
- new CollationElement("", (short) 32767, (short) 0, (short) 0,
- (short) 0, null, false);
-
- /**
- * This method initializes a new instance of <code>RuleBasedCollator</code>
- * with the specified collation rules. Note that an application normally
- * obtains an instance of <code>RuleBasedCollator</code> by calling the
- * <code>getInstance</code> method of <code>Collator</code>. That method
- * automatically loads the proper set of rules for the desired locale.
- *
- * @param rules The collation rule string.
- *
- * @exception ParseException If the rule string contains syntax errors.
- */
- public RuleBasedCollator(String rules) throws ParseException
- {
- if (rules.equals(""))
- throw new ParseException("empty rule set", 0);
-
- this.rules = rules;
-
- buildCollationVector(parseString(rules));
- buildPrefixAccess();
- }
-
- /**
- * This method returns the number of common characters at the beginning
- * of the string of the two parameters.
- *
- * @param prefix A string considered as a prefix to test against
- * the other string.
- * @param s A string to test the prefix against.
- * @return The number of common characters.
- */
- static int findPrefixLength(String prefix, String s)
- {
- int index;
- int len = prefix.length();
-
- for (index = 0; index < len && index < s.length(); ++index)
- {
- if (prefix.charAt(index) != s.charAt(index))
- return index;
- }
-
-
- return index;
- }
-
- /**
- * Here we are merging two sets of sorting instructions: 'patch' into 'main'. This methods
- * checks whether it is possible to find an anchor point for the rules to be merged and
- * then insert them at that precise point.
- *
- * @param offset Offset in the string containing rules of the beginning of the rules
- * being merged in.
- * @param starter Text of the rules being merged.
- * @param main Repository of all already parsed rules.
- * @param patch Rules to be merged into the repository.
- * @throws ParseException if it is impossible to find an anchor point for the new rules.
- */
- private void mergeRules(int offset, String starter, ArrayList main, ArrayList patch)
- throws ParseException
- {
- int insertion_point = -1;
- int max_length = 0;
-
- /* We must check that no rules conflict with another already present. If it
- * is the case delete the old rule.
- */
-
- /* For the moment good old O(N^2) algorithm.
- */
- for (int i = 0; i < patch.size(); i++)
- {
- int j = 0;
-
- while (j < main.size())
- {
- CollationSorter rule1 = (CollationSorter) patch.get(i);
- CollationSorter rule2 = (CollationSorter) main.get(j);
-
- if (rule1.textElement.equals(rule2.textElement))
- main.remove(j);
- else
- j++;
- }
- }
-
- // Find the insertion point... O(N)
- for (int i = 0; i < main.size(); i++)
- {
- CollationSorter sorter = (CollationSorter) main.get(i);
- int length = findPrefixLength(starter, sorter.textElement);
-
- if (length > max_length)
- {
- max_length = length;
- insertion_point = i+1;
- }
- }
-
- if (insertion_point < 0)
- throw new ParseException("no insertion point found for " + starter, offset);
-
- if (max_length < starter.length())
- {
- /*
- * We need to expand the first entry. It must be sorted
- * like if it was the reference key itself (like the spec
- * said. So the first entry is special: the element is
- * replaced by the specified text element for the sorting.
- * This text replace the old one for comparisons. However
- * to preserve the behaviour we replace the first key (corresponding
- * to the found prefix) by a new code rightly ordered in the
- * sequence. The rest of the subsequence must be appended
- * to the end of the sequence.
- */
- CollationSorter sorter = (CollationSorter) patch.get(0);
- CollationSorter expansionPrefix =
- (CollationSorter) main.get(insertion_point-1);
-
- sorter.expansionOrdering = starter.substring(max_length); // Skip the first good prefix element
-
- main.add(insertion_point, sorter);
-
- /*
- * This is a new set of rules. Append to the list.
- */
- patch.remove(0);
- insertion_point++;
- }
-
- // Now insert all elements of patch at the insertion point.
- for (int i = 0; i < patch.size(); i++)
- main.add(i+insertion_point, patch.get(i));
- }
-
- /**
- * This method parses a string and build a set of sorting instructions. The parsing
- * may only be partial on the case the rules are to be merged sometime later.
- *
- * @param stop_on_reset If this parameter is true then the parser stops when it
- * encounters a reset instruction. In the other case, it tries to parse the subrules
- * and merged it in the same repository.
- * @param v Output vector for the set of instructions.
- * @param base_offset Offset in the string to begin parsing.
- * @param rules Rules to be parsed.
- * @return -1 if the parser reached the end of the string, an integer representing the
- * offset in the string at which it stopped parsing.
- * @throws ParseException if something turned wrong during the parsing. To get details
- * decode the message.
- */
- private int subParseString(boolean stop_on_reset, ArrayList v,
- int base_offset, String rules)
- throws ParseException
- {
- boolean ignoreChars = (base_offset == 0);
- int operator = -1;
- StringBuffer sb = new StringBuffer();
- boolean doubleQuote = false;
- boolean eatingChars = false;
- boolean nextIsModifier = false;
- boolean isModifier = false;
- int i;
-
-main_parse_loop:
- for (i = 0; i < rules.length(); i++)
- {
- char c = rules.charAt(i);
- int type = -1;
-
- if (!eatingChars &&
- ((c >= 0x09 && c <= 0x0D) || (c == 0x20)))
- continue;
-
- isModifier = nextIsModifier;
- nextIsModifier = false;
-
- if (eatingChars && c != '\'')
- {
- doubleQuote = false;
- sb.append(c);
- continue;
- }
- if (doubleQuote && eatingChars)
- {
- sb.append(c);
- doubleQuote = false;
- continue;
- }
-
- switch (c)
- {
- case '!':
- throw new ParseException
- ("Modifier '!' is not yet supported by Classpath", i + base_offset);
- case '<':
- type = CollationSorter.GREATERP;
- break;
- case ';':
- type = CollationSorter.GREATERS;
- break;
- case ',':
- type = CollationSorter.GREATERT;
- break;
- case '=':
- type = CollationSorter.EQUAL;
- break;
- case '\'':
- eatingChars = !eatingChars;
- doubleQuote = true;
- break;
- case '@':
- if (ignoreChars)
- throw new ParseException
- ("comparison list has not yet been started. You may only use"
- + "(<,;=&)", i + base_offset);
- // Inverse the order of secondaries from now on.
- nextIsModifier = true;
- type = CollationSorter.INVERSE_SECONDARY;
- break;
- case '&':
- type = CollationSorter.RESET;
- if (stop_on_reset)
- break main_parse_loop;
- break;
- default:
- if (operator < 0)
- throw new ParseException
- ("operator missing at " + (i + base_offset), i + base_offset);
- if (! eatingChars
- && ((c >= 0x21 && c <= 0x2F)
- || (c >= 0x3A && c <= 0x40)
- || (c >= 0x5B && c <= 0x60)
- || (c >= 0x7B && c <= 0x7E)))
- throw new ParseException
- ("unquoted punctuation character '" + c + "'", i + base_offset);
-
- //type = ignoreChars ? CollationSorter.IGNORE : -1;
- sb.append(c);
- break;
- }
-
- if (type < 0)
- continue;
-
- if (operator < 0)
- {
- operator = type;
- continue;
- }
-
- if (sb.length() == 0 && !isModifier)
- throw new ParseException
- ("text element empty at " + (i+base_offset), i+base_offset);
-
- if (operator == CollationSorter.RESET)
- {
- /* Reposition in the sorting list at the position
- * indicated by the text element.
- */
- String subrules = rules.substring(i);
- ArrayList sorted_rules = new ArrayList();
- int idx;
-
- // Parse the subrules but do not iterate through all
- // sublist. This is the priviledge of the first call.
- idx = subParseString(true, sorted_rules, base_offset+i, subrules);
-
- // Merge new parsed rules into the list.
- mergeRules(base_offset+i, sb.toString(), v, sorted_rules);
- sb.setLength(0);
-
- // Reset state to none.
- operator = -1;
- type = -1;
- // We have found a new subrule at 'idx' but it has not been parsed.
- if (idx >= 0)
- {
- i += idx-1;
- continue main_parse_loop;
- }
- else
- // No more rules.
- break main_parse_loop;
- }
-
- CollationSorter sorter = new CollationSorter();
-
- if (operator == CollationSorter.GREATERP)
- ignoreChars = false;
-
- sorter.comparisonType = operator;
- sorter.textElement = sb.toString();
- sorter.hashText = sorter.textElement.hashCode();
- sorter.offset = base_offset+rules.length();
- sorter.ignore = ignoreChars;
- sb.setLength(0);
-
- v.add(sorter);
- operator = type;
- }
-
- if (operator >= 0)
- {
- CollationSorter sorter = new CollationSorter();
- int pos = rules.length() + base_offset;
-
- if ((sb.length() != 0 && nextIsModifier)
- || (sb.length() == 0 && !nextIsModifier && !eatingChars))
- throw new ParseException("text element empty at " + pos, pos);
-
- if (operator == CollationSorter.GREATERP)
- ignoreChars = false;
-
- sorter.comparisonType = operator;
- sorter.textElement = sb.toString();
- sorter.hashText = sorter.textElement.hashCode();
- sorter.offset = base_offset+pos;
- sorter.ignore = ignoreChars;
- v.add(sorter);
- }
-
- if (i == rules.length())
- return -1;
- else
- return i;
- }
-
- /**
- * This method creates a copy of this object.
- *
- * @return A copy of this object.
- */
- public Object clone()
- {
- return super.clone();
- }
-
- /**
- * This method completely parses a string 'rules' containing sorting rules.
- *
- * @param rules String containing the rules to be parsed.
- * @return A set of sorting instructions stored in a Vector.
- * @throws ParseException if something turned wrong during the parsing. To get details
- * decode the message.
- */
- private ArrayList parseString(String rules)
- throws ParseException
- {
- ArrayList v = new ArrayList();
-
- // result of the first subParseString is not absolute (may be -1 or a
- // positive integer). But we do not care.
- subParseString(false, v, 0, rules);
-
- return v;
- }
-
- /**
- * This method uses the sorting instructions built by {@link #parseString}
- * to build collation elements which can be directly used to sort strings.
- *
- * @param parsedElements Parsed instructions stored in a ArrayList.
- * @throws ParseException if the order of the instructions are not valid.
- */
- private void buildCollationVector(ArrayList parsedElements)
- throws ParseException
- {
- int primary_seq = 0;
- int last_tertiary_seq = 0;
- short secondary_seq = 0;
- short tertiary_seq = 0;
- short equality_seq = 0;
- boolean inverseComparisons = false;
- final boolean DECREASING = false;
- final boolean INCREASING = true;
- boolean secondaryType = INCREASING;
- ArrayList v = new ArrayList();
-
- // elts is completely sorted.
-element_loop:
- for (int i = 0; i < parsedElements.size(); i++)
- {
- CollationSorter elt = (CollationSorter) parsedElements.get(i);
- boolean ignoreChar = false;
-
- switch (elt.comparisonType)
- {
- case CollationSorter.GREATERP:
- primary_seq++;
- if (inverseComparisons)
- {
- secondary_seq = Short.MAX_VALUE;
- secondaryType = DECREASING;
- }
- else
- {
- secondary_seq = 0;
- secondaryType = INCREASING;
- }
- tertiary_seq = 0;
- equality_seq = 0;
- inverseComparisons = false;
- break;
- case CollationSorter.GREATERS:
- if (secondaryType == DECREASING)
- secondary_seq--;
- else
- secondary_seq++;
- tertiary_seq = 0;
- equality_seq = 0;
- break;
- case CollationSorter.INVERSE_SECONDARY:
- inverseComparisons = true;
- continue element_loop;
- case CollationSorter.GREATERT:
- tertiary_seq++;
- if (primary_seq == 0)
- last_tertiary_seq = tertiary_seq;
- equality_seq = 0;
- break;
- case CollationSorter.EQUAL:
- equality_seq++;
- break;
- case CollationSorter.RESET:
- throw new ParseException
- ("Invalid reached state 'RESET'. Internal error", elt.offset);
- default:
- throw new ParseException
- ("Invalid unknown state '" + elt.comparisonType + "'", elt.offset);
- }
-
- v.add(new CollationElement(elt.textElement, primary_seq,
- secondary_seq, tertiary_seq,
- equality_seq, elt.expansionOrdering, elt.ignore));
- }
-
- this.inverseAccentComparison = inverseComparisons;
-
- ce_table = v.toArray();
-
- last_primary_value = primary_seq+1;
- last_tertiary_value = last_tertiary_seq+1;
- }
-
- /**
- * Build a tree where all keys are the texts of collation elements and data is
- * the collation element itself. The tree is used when extracting all prefix
- * for a given text.
- */
- private void buildPrefixAccess()
- {
- prefix_tree = new HashMap();
-
- for (int i = 0; i < ce_table.length; i++)
- {
- CollationElement e = (CollationElement) ce_table[i];
-
- prefix_tree.put(e.key, e);
- }
- }
-
- /**
- * This method returns an integer which indicates whether the first
- * specified <code>String</code> is less than, greater than, or equal to
- * the second. The value depends not only on the collation rules in
- * effect, but also the strength and decomposition settings of this object.
- *
- * @param source The first <code>String</code> to compare.
- * @param target A second <code>String</code> to compare to the first.
- *
- * @return A negative integer if source &lt; target, a positive integer
- * if source &gt; target, or 0 if source == target.
- */
- public int compare(String source, String target)
- {
- CollationElementIterator cs, ct;
- CollationElement ord1block = null;
- CollationElement ord2block = null;
- boolean advance_block_1 = true;
- boolean advance_block_2 = true;
-
- cs = getCollationElementIterator(source);
- ct = getCollationElementIterator(target);
-
- for(;;)
- {
- int ord1;
- int ord2;
-
- /*
- * We have to check whether the characters are ignorable.
- * If it is the case then forget them.
- */
- if (advance_block_1)
- {
- ord1block = cs.nextBlock();
- if (ord1block != null && ord1block.ignore)
- continue;
- }
-
- if (advance_block_2)
- {
- ord2block = ct.nextBlock();
- if (ord2block != null && ord2block.ignore)
- {
- advance_block_1 = false;
- continue;
- }
- }
- else
- advance_block_2 = true;
-
- if (!advance_block_1)
- advance_block_1 = true;
-
- if (ord1block != null)
- ord1 = ord1block.getValue();
- else
- {
- if (ord2block == null)
- return 0;
- return -1;
- }
-
- if (ord2block == null)
- return 1;
-
- ord2 = ord2block.getValue();
-
- // We know chars are totally equal, so skip
- if (ord1 == ord2)
- {
- if (getStrength() == IDENTICAL)
- if (!ord1block.key.equals(ord2block.key))
- return ord1block.key.compareTo(ord2block.key);
- continue;
- }
-
- // Check for primary strength differences
- int prim1 = CollationElementIterator.primaryOrder(ord1);
- int prim2 = CollationElementIterator.primaryOrder(ord2);
-
- if (prim1 == 0 && getStrength() < TERTIARY)
- {
- advance_block_2 = false;
- continue;
- }
- else if (prim2 == 0 && getStrength() < TERTIARY)
- {
- advance_block_1 = false;
- continue;
- }
-
- if (prim1 < prim2)
- return -1;
- else if (prim1 > prim2)
- return 1;
- else if (getStrength() == PRIMARY)
- continue;
-
- // Check for secondary strength differences
- int sec1 = CollationElementIterator.secondaryOrder(ord1);
- int sec2 = CollationElementIterator.secondaryOrder(ord2);
-
- if (sec1 < sec2)
- return -1;
- else if (sec1 > sec2)
- return 1;
- else if (getStrength() == SECONDARY)
- continue;
-
- // Check for tertiary differences
- int tert1 = CollationElementIterator.tertiaryOrder(ord1);
- int tert2 = CollationElementIterator.tertiaryOrder(ord2);
-
- if (tert1 < tert2)
- return -1;
- else if (tert1 > tert2)
- return 1;
- else if (getStrength() == TERTIARY)
- continue;
-
- // Apparently JDK does this (at least for my test case).
- return ord1block.key.compareTo(ord2block.key);
- }
- }
-
- /**
- * This method tests this object for equality against the specified
- * object. This will be true if and only if the specified object is
- * another reference to this object.
- *
- * @param obj The <code>Object</code> to compare against this object.
- *
- * @return <code>true</code> if the specified object is equal to this object,
- * <code>false</code> otherwise.
- */
- public boolean equals(Object obj)
- {
- if (obj == this)
- return true;
- else
- return false;
- }
-
- /**
- * This method builds a default collation element without invoking
- * the database created from the rules passed to the constructor.
- *
- * @param c Character which needs a collation element.
- * @return A valid brand new CollationElement instance.
- */
- CollationElement getDefaultElement(char c)
- {
- int v;
-
- // Preliminary support for generic accent sorting inversion (I don't know if all
- // characters in the range should be sorted backward). This is the place
- // to fix this if needed.
- if (inverseAccentComparison && (c >= 0x02B9 && c <= 0x0361))
- v = 0x0361 - ((int) c - 0x02B9);
- else
- v = (short) c;
- return new CollationElement("" + c, last_primary_value + v,
- (short) 0, (short) 0, (short) 0, null, false);
- }
-
- /**
- * This method builds a default collation element for an accented character
- * without invoking the database created from the rules passed to the constructor.
- *
- * @param c Character which needs a collation element.
- * @return A valid brand new CollationElement instance.
- */
- CollationElement getDefaultAccentedElement(char c)
- {
- int v;
-
- // Preliminary support for generic accent sorting inversion (I don't know if all
- // characters in the range should be sorted backward). This is the place
- // to fix this if needed.
- if (inverseAccentComparison && (c >= 0x02B9 && c <= 0x0361))
- v = 0x0361 - ((int) c - 0x02B9);
- else
- v = (short) c;
- return new CollationElement("" + c, (short) 0,
- (short) 0, (short) (last_tertiary_value + v), (short) 0, null, false);
- }
-
- /**
- * This method returns an instance for <code>CollationElementIterator</code>
- * for the specified <code>String</code> under the collation rules for this
- * object.
- *
- * @param source The <code>String</code> to return the
- * <code>CollationElementIterator</code> instance for.
- *
- * @return A <code>CollationElementIterator</code> for the specified
- * <code>String</code>.
- */
- public CollationElementIterator getCollationElementIterator(String source)
- {
- return new CollationElementIterator(this, source);
- }
-
- /**
- * This method returns an instance of <code>CollationElementIterator</code>
- * for the <code>String</code> represented by the specified
- * <code>CharacterIterator</code>.
- *
- * @param source The <code>CharacterIterator</code> with the desired <code>String</code>.
- *
- * @return A <code>CollationElementIterator</code> for the specified <code>String</code>.
- */
- public CollationElementIterator getCollationElementIterator(CharacterIterator source)
- {
- StringBuffer expand = new StringBuffer("");
-
- // Right now we assume that we will read from the beginning of the string.
- for (char c = source.first();
- c != CharacterIterator.DONE;
- c = source.next())
- decomposeCharacter(c, expand);
-
- return getCollationElementIterator(expand.toString());
- }
-
- /**
- * This method returns an instance of <code>CollationKey</code> for the
- * specified <code>String</code>. The object returned will have a
- * more efficient mechanism for its comparison function that could
- * provide speed benefits if multiple comparisons are performed, such
- * as during a sort.
- *
- * @param source The <code>String</code> to create a <code>CollationKey</code> for.
- *
- * @return A <code>CollationKey</code> for the specified <code>String</code>.
- */
- public CollationKey getCollationKey(String source)
- {
- CollationElementIterator cei = getCollationElementIterator(source);
- ArrayList vect = new ArrayList();
-
- int ord = cei.next();
- cei.reset(); //set to start of string
-
- while (ord != CollationElementIterator.NULLORDER)
- {
- // If the primary order is null, it means this is an ignorable
- // character.
- if (CollationElementIterator.primaryOrder(ord) == 0)
- {
- ord = cei.next();
- continue;
- }
- switch (getStrength())
- {
- case PRIMARY:
- ord = CollationElementIterator.primaryOrder(ord);
- break;
-
- case SECONDARY:
- ord = CollationElementIterator.primaryOrder(ord) << 8;
- ord |= CollationElementIterator.secondaryOrder(ord);
-
- default:
- break;
- }
-
- vect.add(new Integer(ord));
- ord = cei.next(); //increment to next key
- }
-
- Object[] objarr = vect.toArray();
- byte[] key = new byte[objarr.length * 4];
-
- for (int i = 0; i < objarr.length; i++)
- {
- int j = ((Integer) objarr[i]).intValue();
- key [i * 4] = (byte) ((j & 0xFF000000) >> 24);
- key [i * 4 + 1] = (byte) ((j & 0x00FF0000) >> 16);
- key [i * 4 + 2] = (byte) ((j & 0x0000FF00) >> 8);
- key [i * 4 + 3] = (byte) (j & 0x000000FF);
- }
-
- return new CollationKey(this, source, key);
- }
-
- /**
- * This method returns a <code>String</code> containing the collation rules
- * for this object.
- *
- * @return The collation rules for this object.
- */
- public String getRules()
- {
- return rules;
- }
-
- /**
- * This method returns a hash value for this object.
- *
- * @return A hash value for this object.
- */
- public int hashCode()
- {
- return System.identityHashCode(this);
- }
-}
diff --git a/libjava/java/text/StringCharacterIterator.java b/libjava/java/text/StringCharacterIterator.java
deleted file mode 100644
index e3adc857e51..00000000000
--- a/libjava/java/text/StringCharacterIterator.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/* StringCharacterIterator.java -- Iterate over a character range in a string
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.text;
-
-/**
- * This class iterates over a range of characters in a <code>String</code>.
- * For a given range of text, a beginning and ending index,
- * as well as a current index are defined. These values can be queried
- * by the methods in this interface. Additionally, various methods allow
- * the index to be set.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey (tromey@cygnus.com)
- */
-public final class StringCharacterIterator implements CharacterIterator
-{
- /**
- * This is the string to iterate over
- */
- private String text;
-
- /**
- * This is the value of the start position of the text range.
- */
- private int begin;
-
- /**
- * This is the value of the ending position of the text range.
- */
- private int end;
-
- /**
- * This is the current value of the scan index.
- */
- private int index;
-
- /**
- * This method initializes a new instance of
- * <code>StringCharacterIterator</code> to iterate over the entire
- * text of the specified <code>String</code>. The initial index
- * value will be set to the first character in the string.
- *
- * @param text The <code>String</code> to iterate through.
- */
- public StringCharacterIterator (String text)
- {
- this (text, 0, text.length (), 0);
- }
-
- /*************************************************************************/
-
- /**
- * This method initializes a new instance of
- * <code>StringCharacterIterator</code> to iterate over the entire
- * text of the specified <code>String</code>. The initial index
- * value will be set to the specified value.
- *
- * @param text The <code>String</code> to iterate through.
- * @param index The initial index position.
- */
- public StringCharacterIterator (String text, int index)
- {
- this (text, 0, text.length (), index);
- }
-
- /*************************************************************************/
-
- /**
- * This method initializes a new instance of
- * <code>StringCharacterIterator</code> that iterates over the text
- * in a subrange of the specified <code>String</code>. The
- * beginning and end of the range are specified by the caller, as is
- * the initial index position.
- *
- * @param text The <code>String</code> to iterate through.
- * @param begin The beginning position in the character range.
- * @param end The ending position in the character range.
- * @param index The initial index position.
- *
- * @param IllegalArgumentException If any of the range values are
- * invalid.
- */
- public StringCharacterIterator (String text, int begin, int end, int index)
- {
- int len = text.length ();
-
- if ((begin < 0) || (begin > len))
- throw new IllegalArgumentException ("Bad begin position");
-
- if ((end < begin) || (end > len))
- throw new IllegalArgumentException ("Bad end position");
-
- if ((index < begin) || (index > end))
- throw new IllegalArgumentException ("Bad initial index position");
-
- this.text = text;
- this.begin = begin;
- this.end = end;
- this.index = index;
- }
-
- /**
- * This is a package level constructor that copies the text out of
- * an existing StringCharacterIterator and resets the beginning and
- * ending index.
- *
- * @param scci The StringCharacterIterator to copy the info from
- * @param begin The beginning index of the range we are interested in.
- * @param end The ending index of the range we are interested in.
- */
- StringCharacterIterator (StringCharacterIterator sci, int begin, int end)
- {
- this (sci.text, begin, end, begin);
- }
-
- /**
- * This method returns the character at the current index position
- *
- * @return The character at the current index position.
- */
- public char current ()
- {
- return (index < end) ? text.charAt (index) : DONE;
- }
-
- /*************************************************************************/
-
- /**
- * This method increments the current index and then returns the
- * character at the new index value. If the index is already at
- * <code>getEndIndex () - 1</code>, it will not be incremented.
- *
- * @return The character at the position of the incremented index
- * value, or <code>DONE</code> if the index has reached
- * getEndIndex () - 1.
- */
- public char next ()
- {
- if (index == end)
- return DONE;
-
- ++index;
- return current ();
- }
-
- /*************************************************************************/
-
- /**
- * This method decrements the current index and then returns the
- * character at the new index value. If the index value is already
- * at the beginning index, it will not be decremented.
- *
- * @return The character at the position of the decremented index
- * value, or <code>DONE</code> if index was already equal to the
- * beginning index value.
- */
- public char previous ()
- {
- if (index == begin)
- return DONE;
-
- --index;
- return current ();
- }
-
- /*************************************************************************/
-
- /**
- * This method sets the index value to the beginning of the range and returns
- * the character there.
- *
- * @return The character at the beginning of the range, or
- * <code>DONE</code> if the range is empty.
- */
- public char first ()
- {
- index = begin;
- return current ();
- }
-
- /*************************************************************************/
-
- /**
- * This method sets the index value to <code>getEndIndex () - 1</code> and
- * returns the character there. If the range is empty, then the index value
- * will be set equal to the beginning index.
- *
- * @return The character at the end of the range, or
- * <code>DONE</code> if the range is empty.
- */
- public char last ()
- {
- if (end == begin)
- return DONE;
-
- index = end - 1;
- return current ();
- }
-
- /*************************************************************************/
-
- /**
- * This method returns the current value of the index.
- *
- * @return The current index value
- */
- public int getIndex ()
- {
- return index;
- }
-
- /*************************************************************************/
-
- /**
- * This method sets the value of the index to the specified value, then
- * returns the character at that position.
- *
- * @param index The new index value.
- *
- * @return The character at the new index value or <code>DONE</code>
- * if the index value is equal to <code>getEndIndex</code>.
- *
- * @exception IllegalArgumentException If the specified index is not valid
- */
- public char setIndex (int index)
- {
- if ((index < begin) || (index > end))
- throw new IllegalArgumentException ("Bad index specified");
-
- this.index = index;
- return current ();
- }
-
- /*************************************************************************/
-
- /**
- * This method returns the character position of the first character in the
- * range.
- *
- * @return The index of the first character in the range.
- */
- public int getBeginIndex ()
- {
- return begin;
- }
-
- /*************************************************************************/
-
- /**
- * This method returns the character position of the end of the text range.
- * This will actually be the index of the first character following the
- * end of the range. In the event the text range is empty, this will be
- * equal to the first character in the range.
- *
- * @return The index of the end of the range.
- */
- public int getEndIndex ()
- {
- return end;
- }
-
- /*************************************************************************/
-
- /**
- * This method creates a copy of this <code>CharacterIterator</code>.
- *
- * @return A copy of this <code>CharacterIterator</code>.
- */
- public Object clone ()
- {
- return new StringCharacterIterator (text, begin, end, index);
- }
-
- /*************************************************************************/
-
- /**
- * This method tests this object for equality againt the specified
- * object. This will be true if and only if the specified object:
- * <p>
- * <ul>
- * <li>is not <code>null</code>.</li>
- * <li>is an instance of <code>StringCharacterIterator</code></li>
- * <li>has the same text as this object</li>
- * <li>has the same beginning, ending, and current index as this object.</li>
- * </ul>
- *
- * @param obj The object to test for equality against.
- *
- * @return <code>true</code> if the specified object is equal to this
- * object, <code>false</code> otherwise.
- */
- public boolean equals (Object obj)
- {
- if (! (obj instanceof StringCharacterIterator))
- return false;
-
- StringCharacterIterator sci = (StringCharacterIterator) obj;
-
- return (begin == sci.begin
- && end == sci.end
- && index == sci.index
- && text.equals (sci.text));
- }
-
- /*************************************************************************/
-
- /**
- * This method allows other classes in java.text to change the value
- * of the underlying text being iterated through.
- *
- * @param text The new <code>String</code> to iterate through.
- */
- public void setText (String text)
- {
- this.text = text;
- this.begin = 0;
- this.end = text.length ();
- this.index = 0;
- }
-}
diff --git a/libjava/java/util/AbstractCollection.java b/libjava/java/util/AbstractCollection.java
deleted file mode 100644
index 00ee23ebd43..00000000000
--- a/libjava/java/util/AbstractCollection.java
+++ /dev/null
@@ -1,470 +0,0 @@
-/* AbstractCollection.java -- Abstract implementation of most of Collection
- Copyright (C) 1998, 2000, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.lang.reflect.Array;
-
-/**
- * A basic implementation of most of the methods in the Collection interface to
- * make it easier to create a collection. To create an unmodifiable Collection,
- * just subclass AbstractCollection and provide implementations of the
- * iterator() and size() methods. The Iterator returned by iterator() need only
- * provide implementations of hasNext() and next() (that is, it may throw an
- * UnsupportedOperationException if remove() is called). To create a modifiable
- * Collection, you must in addition provide an implementation of the
- * add(Object) method and the Iterator returned by iterator() must provide an
- * implementation of remove(). Other methods should be overridden if the
- * backing data structure allows for a more efficient implementation. The
- * precise implementation used by AbstractCollection is documented, so that
- * subclasses can tell which methods could be implemented more efficiently.
- * <p>
- *
- * The programmer should provide a no-argument constructor, and one that
- * accepts another Collection, as recommended by the Collection interface.
- * Unfortunately, there is no way to enforce this in Java.
- *
- * @author Original author unknown
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see AbstractSet
- * @see AbstractList
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class AbstractCollection implements Collection
-{
- /**
- * The main constructor, for use by subclasses.
- */
- protected AbstractCollection()
- {
- }
-
- /**
- * Return an Iterator over this collection. The iterator must provide the
- * hasNext and next methods and should in addition provide remove if the
- * collection is modifiable.
- *
- * @return an iterator
- */
- public abstract Iterator iterator();
-
- /**
- * Return the number of elements in this collection. If there are more than
- * Integer.MAX_VALUE elements, return Integer.MAX_VALUE.
- *
- * @return the size
- */
- public abstract int size();
-
- /**
- * Add an object to the collection (optional operation). This implementation
- * always throws an UnsupportedOperationException - it should be
- * overridden if the collection is to be modifiable. If the collection
- * does not accept duplicates, simply return false. Collections may specify
- * limitations on what may be added.
- *
- * @param o the object to add
- * @return true if the add operation caused the Collection to change
- * @throws UnsupportedOperationException if the add operation is not
- * supported on this collection
- * @throws NullPointerException if the collection does not support null
- * @throws ClassCastException if the object is of the wrong type
- * @throws IllegalArgumentException if some aspect of the object prevents
- * it from being added
- */
- public boolean add(Object o)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Add all the elements of a given collection to this collection (optional
- * operation). This implementation obtains an Iterator over the given
- * collection and iterates over it, adding each element with the
- * add(Object) method (thus this method will fail with an
- * UnsupportedOperationException if the add method does). The behavior is
- * unspecified if the specified collection is modified during the iteration,
- * including the special case of trying addAll(this) on a non-empty
- * collection.
- *
- * @param c the collection to add the elements of to this collection
- * @return true if the add operation caused the Collection to change
- * @throws UnsupportedOperationException if the add operation is not
- * supported on this collection
- * @throws NullPointerException if the specified collection is null
- * @throws ClassCastException if the type of any element in c is
- * not a valid type for addition.
- * @throws IllegalArgumentException if some aspect of any element
- * in c prevents it being added.
- * @throws NullPointerException if any element in c is null and this
- * collection doesn't allow null values.
- * @see #add(Object)
- */
- public boolean addAll(Collection c)
- {
- Iterator itr = c.iterator();
- boolean modified = false;
- int pos = c.size();
- while (--pos >= 0)
- modified |= add(itr.next());
- return modified;
- }
-
- /**
- * Remove all elements from the collection (optional operation). This
- * implementation obtains an iterator over the collection and calls next
- * and remove on it repeatedly (thus this method will fail with an
- * UnsupportedOperationException if the Iterator's remove method does)
- * until there are no more elements to remove.
- * Many implementations will have a faster way of doing this.
- *
- * @throws UnsupportedOperationException if the Iterator returned by
- * iterator does not provide an implementation of remove
- * @see Iterator#remove()
- */
- public void clear()
- {
- Iterator itr = iterator();
- int pos = size();
- while (--pos >= 0)
- {
- itr.next();
- itr.remove();
- }
- }
-
- /**
- * Test whether this collection contains a given object. That is, if the
- * collection has an element e such that (o == null ? e == null :
- * o.equals(e)). This implementation obtains an iterator over the collection
- * and iterates over it, testing each element for equality with the given
- * object. If it is equal, true is returned. Otherwise false is returned when
- * the end of the collection is reached.
- *
- * @param o the object to remove from this collection
- * @return true if this collection contains an object equal to o
- */
- public boolean contains(Object o)
- {
- Iterator itr = iterator();
- int pos = size();
- while (--pos >= 0)
- if (equals(o, itr.next()))
- return true;
- return false;
- }
-
- /**
- * Tests whether this collection contains all the elements in a given
- * collection. This implementation iterates over the given collection,
- * testing whether each element is contained in this collection. If any one
- * is not, false is returned. Otherwise true is returned.
- *
- * @param c the collection to test against
- * @return true if this collection contains all the elements in the given
- * collection
- * @throws NullPointerException if the given collection is null
- * @see #contains(Object)
- */
- public boolean containsAll(Collection c)
- {
- Iterator itr = c.iterator();
- int pos = c.size();
- while (--pos >= 0)
- if (!contains(itr.next()))
- return false;
- return true;
- }
-
- /**
- * Test whether this collection is empty. This implementation returns
- * size() == 0.
- *
- * @return true if this collection is empty.
- * @see #size()
- */
- public boolean isEmpty()
- {
- return size() == 0;
- }
-
- /**
- * Remove a single instance of an object from this collection (optional
- * operation). That is, remove one element e such that
- * <code>(o == null ? e == null : o.equals(e))</code>, if such an element
- * exists. This implementation obtains an iterator over the collection
- * and iterates over it, testing each element for equality with the given
- * object. If it is equal, it is removed by the iterator's remove method
- * (thus this method will fail with an UnsupportedOperationException if
- * the Iterator's remove method does). After the first element has been
- * removed, true is returned; if the end of the collection is reached, false
- * is returned.
- *
- * @param o the object to remove from this collection
- * @return true if the remove operation caused the Collection to change, or
- * equivalently if the collection did contain o.
- * @throws UnsupportedOperationException if this collection's Iterator
- * does not support the remove method
- * @see Iterator#remove()
- */
- public boolean remove(Object o)
- {
- Iterator itr = iterator();
- int pos = size();
- while (--pos >= 0)
- if (equals(o, itr.next()))
- {
- itr.remove();
- return true;
- }
- return false;
- }
-
- /**
- * Remove from this collection all its elements that are contained in a given
- * collection (optional operation). This implementation iterates over this
- * collection, and for each element tests if it is contained in the given
- * collection. If so, it is removed by the Iterator's remove method (thus
- * this method will fail with an UnsupportedOperationException if the
- * Iterator's remove method does).
- *
- * @param c the collection to remove the elements of
- * @return true if the remove operation caused the Collection to change
- * @throws UnsupportedOperationException if this collection's Iterator
- * does not support the remove method
- * @throws NullPointerException if the collection, c, is null.
- * @see Iterator#remove()
- */
- public boolean removeAll(Collection c)
- {
- return removeAllInternal(c);
- }
-
- /**
- * Remove from this collection all its elements that are contained in a given
- * collection (optional operation). This implementation iterates over this
- * collection, and for each element tests if it is contained in the given
- * collection. If so, it is removed by the Iterator's remove method (thus
- * this method will fail with an UnsupportedOperationException if the
- * Iterator's remove method does). This method is necessary for ArrayList,
- * which cannot publicly override removeAll but can optimize this call.
- *
- * @param c the collection to remove the elements of
- * @return true if the remove operation caused the Collection to change
- * @throws UnsupportedOperationException if this collection's Iterator
- * does not support the remove method
- * @throws NullPointerException if the collection, c, is null.
- * @see Iterator#remove()
- */
- // Package visible for use throughout java.util.
- boolean removeAllInternal(Collection c)
- {
- Iterator itr = iterator();
- boolean modified = false;
- int pos = size();
- while (--pos >= 0)
- if (c.contains(itr.next()))
- {
- itr.remove();
- modified = true;
- }
- return modified;
- }
-
- /**
- * Remove from this collection all its elements that are not contained in a
- * given collection (optional operation). This implementation iterates over
- * this collection, and for each element tests if it is contained in the
- * given collection. If not, it is removed by the Iterator's remove method
- * (thus this method will fail with an UnsupportedOperationException if
- * the Iterator's remove method does).
- *
- * @param c the collection to retain the elements of
- * @return true if the remove operation caused the Collection to change
- * @throws UnsupportedOperationException if this collection's Iterator
- * does not support the remove method
- * @throws NullPointerException if the collection, c, is null.
- * @see Iterator#remove()
- */
- public boolean retainAll(Collection c)
- {
- return retainAllInternal(c);
- }
-
- /**
- * Remove from this collection all its elements that are not contained in a
- * given collection (optional operation). This implementation iterates over
- * this collection, and for each element tests if it is contained in the
- * given collection. If not, it is removed by the Iterator's remove method
- * (thus this method will fail with an UnsupportedOperationException if
- * the Iterator's remove method does). This method is necessary for
- * ArrayList, which cannot publicly override retainAll but can optimize
- * this call.
- *
- * @param c the collection to retain the elements of
- * @return true if the remove operation caused the Collection to change
- * @throws UnsupportedOperationException if this collection's Iterator
- * does not support the remove method
- * @throws NullPointerException if the collection, c, is null.
- * @see Iterator#remove()
- */
- // Package visible for use throughout java.util.
- boolean retainAllInternal(Collection c)
- {
- Iterator itr = iterator();
- boolean modified = false;
- int pos = size();
- while (--pos >= 0)
- if (!c.contains(itr.next()))
- {
- itr.remove();
- modified = true;
- }
- return modified;
- }
-
- /**
- * Return an array containing the elements of this collection. This
- * implementation creates an Object array of size size() and then iterates
- * over the collection, setting each element of the array from the value
- * returned by the iterator. The returned array is safe, and is not backed
- * by the collection.
- *
- * @return an array containing the elements of this collection
- */
- public Object[] toArray()
- {
- Iterator itr = iterator();
- int size = size();
- Object[] a = new Object[size];
- for (int pos = 0; pos < size; pos++)
- a[pos] = itr.next();
- return a;
- }
-
- /**
- * Copy the collection into a given array if it will fit, or into a
- * dynamically created array of the same run-time type as the given array if
- * not. If there is space remaining in the array, the first element after the
- * end of the collection is set to null (this is only useful if the
- * collection is known to contain no null elements, however). This
- * implementation first tests whether the given array is large enough to hold
- * all the elements of the collection. If not, the reflection API is used to
- * allocate a new array of the same run-time type. Next an iterator is
- * obtained over the collection and the elements are placed in the array as
- * they are returned by the iterator. Finally the first spare element, if
- * any, of the array is set to null, and the created array is returned.
- * The returned array is safe; it is not backed by the collection. Note that
- * null may not mark the last element, if the collection allows null
- * elements.
- *
- * @param a the array to copy into, or of the correct run-time type
- * @return the array that was produced
- * @throws NullPointerException if the given array is null
- * @throws ArrayStoreException if the type of the array precludes holding
- * one of the elements of the Collection
- */
- public Object[] toArray(Object[] a)
- {
- int size = size();
- if (a.length < size)
- a = (Object[]) Array.newInstance(a.getClass().getComponentType(),
- size);
- else if (a.length > size)
- a[size] = null;
-
- Iterator itr = iterator();
- for (int pos = 0; pos < size; pos++)
- a[pos] = itr.next();
-
- return a;
- }
-
- /**
- * Creates a String representation of the Collection. The string returned is
- * of the form "[a, b, ...]" where a and b etc are the results of calling
- * toString on the elements of the collection. This implementation obtains an
- * Iterator over the Collection and adds each element to a StringBuffer as it
- * is returned by the iterator.
- *
- * @return a String representation of the Collection
- */
- public String toString()
- {
- Iterator itr = iterator();
- StringBuffer r = new StringBuffer("[");
- for (int pos = size(); pos > 0; pos--)
- {
- r.append(itr.next());
- if (pos > 1)
- r.append(", ");
- }
- r.append("]");
- return r.toString();
- }
-
- /**
- * Compare two objects according to Collection semantics.
- *
- * @param o1 the first object
- * @param o2 the second object
- * @return o1 == null ? o2 == null : o1.equals(o2)
- */
- // Package visible for use throughout java.util.
- // It may be inlined since it is final.
- static final boolean equals(Object o1, Object o2)
- {
- return o1 == null ? o2 == null : o1.equals(o2);
- }
-
- /**
- * Hash an object according to Collection semantics.
- *
- * @param o the object to hash
- * @return o1 == null ? 0 : o1.hashCode()
- */
- // Package visible for use throughout java.util.
- // It may be inlined since it is final.
- static final int hashCode(Object o)
- {
- return o == null ? 0 : o.hashCode();
- }
-}
diff --git a/libjava/java/util/AbstractList.java b/libjava/java/util/AbstractList.java
deleted file mode 100644
index 8a9b6f10d7a..00000000000
--- a/libjava/java/util/AbstractList.java
+++ /dev/null
@@ -1,1225 +0,0 @@
-/* AbstractList.java -- Abstract implementation of most of List
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * A basic implementation of most of the methods in the List interface to make
- * it easier to create a List based on a random-access data structure. If
- * the list is sequential (such as a linked list), use AbstractSequentialList.
- * To create an unmodifiable list, it is only necessary to override the
- * size() and get(int) methods (this contrasts with all other abstract
- * collection classes which require an iterator to be provided). To make the
- * list modifiable, the set(int, Object) method should also be overridden, and
- * to make the list resizable, the add(int, Object) and remove(int) methods
- * should be overridden too. Other methods should be overridden if the
- * backing data structure allows for a more efficient implementation.
- * The precise implementation used by AbstractList is documented, so that
- * subclasses can tell which methods could be implemented more efficiently.
- * <p>
- *
- * As recommended by Collection and List, the subclass should provide at
- * least a no-argument and a Collection constructor. This class is not
- * synchronized.
- *
- * @author Original author unknown
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see List
- * @see AbstractSequentialList
- * @see AbstractCollection
- * @see ListIterator
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class AbstractList extends AbstractCollection implements List
-{
- /**
- * A count of the number of structural modifications that have been made to
- * the list (that is, insertions and removals). Structural modifications
- * are ones which change the list size or affect how iterations would
- * behave. This field is available for use by Iterator and ListIterator,
- * in order to throw a {@link ConcurrentModificationException} in response
- * to the next operation on the iterator. This <i>fail-fast</i> behavior
- * saves the user from many subtle bugs otherwise possible from concurrent
- * modification during iteration.
- * <p>
- *
- * To make lists fail-fast, increment this field by just 1 in the
- * <code>add(int, Object)</code> and <code>remove(int)</code> methods.
- * Otherwise, this field may be ignored.
- */
- protected transient int modCount;
-
- /**
- * The main constructor, for use by subclasses.
- */
- protected AbstractList()
- {
- }
-
- /**
- * Returns the elements at the specified position in the list.
- *
- * @param index the element to return
- * @return the element at that position
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public abstract Object get(int index);
-
- /**
- * Insert an element into the list at a given position (optional operation).
- * This shifts all existing elements from that position to the end one
- * index to the right. This version of add has no return, since it is
- * assumed to always succeed if there is no exception. This implementation
- * always throws UnsupportedOperationException, and must be overridden to
- * make a modifiable List. If you want fail-fast iterators, be sure to
- * increment modCount when overriding this.
- *
- * @param index the location to insert the item
- * @param o the object to insert
- * @throws UnsupportedOperationException if this list does not support the
- * add operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason
- * @see #modCount
- */
- public void add(int index, Object o)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Add an element to the end of the list (optional operation). If the list
- * imposes restraints on what can be inserted, such as no null elements,
- * this should be documented. This implementation calls
- * <code>add(size(), o);</code>, and will fail if that version does.
- *
- * @param o the object to add
- * @return true, as defined by Collection for a modified list
- * @throws UnsupportedOperationException if this list does not support the
- * add operation
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason
- * @see #add(int, Object)
- */
- public boolean add(Object o)
- {
- add(size(), o);
- return true;
- }
-
- /**
- * Insert the contents of a collection into the list at a given position
- * (optional operation). Shift all elements at that position to the right
- * by the number of elements inserted. This operation is undefined if
- * this list is modified during the operation (for example, if you try
- * to insert a list into itself). This implementation uses the iterator of
- * the collection, repeatedly calling add(int, Object); this will fail
- * if add does. This can often be made more efficient.
- *
- * @param index the location to insert the collection
- * @param c the collection to insert
- * @return true if the list was modified by this action, that is, if c is
- * non-empty
- * @throws UnsupportedOperationException if this list does not support the
- * addAll operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws ClassCastException if some element of c cannot be added to this
- * list due to its type
- * @throws IllegalArgumentException if some element of c cannot be added
- * to this list for some other reason
- * @throws NullPointerException if the specified collection is null
- * @see #add(int, Object)
- */
- public boolean addAll(int index, Collection c)
- {
- Iterator itr = c.iterator();
- int size = c.size();
- for (int pos = size; pos > 0; pos--)
- add(index++, itr.next());
- return size > 0;
- }
-
- /**
- * Clear the list, such that a subsequent call to isEmpty() would return
- * true (optional operation). This implementation calls
- * <code>removeRange(0, size())</code>, so it will fail unless remove
- * or removeRange is overridden.
- *
- * @throws UnsupportedOperationException if this list does not support the
- * clear operation
- * @see #remove(int)
- * @see #removeRange(int, int)
- */
- public void clear()
- {
- removeRange(0, size());
- }
-
- /**
- * Test whether this list is equal to another object. A List is defined to be
- * equal to an object if and only if that object is also a List, and the two
- * lists have the same sequence. Two lists l1 and l2 are equal if and only
- * if <code>l1.size() == l2.size()</code>, and for every integer n between 0
- * and <code>l1.size() - 1</code> inclusive, <code>l1.get(n) == null ?
- * l2.get(n) == null : l1.get(n).equals(l2.get(n))</code>.
- * <p>
- *
- * This implementation returns true if the object is this, or false if the
- * object is not a List. Otherwise, it iterates over both lists (with
- * iterator()), returning false if two elements compare false or one list
- * is shorter, and true if the iteration completes successfully.
- *
- * @param o the object to test for equality with this list
- * @return true if o is equal to this list
- * @see Object#equals(Object)
- * @see #hashCode()
- */
- public boolean equals(Object o)
- {
- if (o == this)
- return true;
- if (! (o instanceof List))
- return false;
- int size = size();
- if (size != ((List) o).size())
- return false;
-
- Iterator itr1 = iterator();
- Iterator itr2 = ((List) o).iterator();
-
- while (--size >= 0)
- if (! equals(itr1.next(), itr2.next()))
- return false;
- return true;
- }
-
- /**
- * Obtains a hash code for this list. In order to obey the general
- * contract of the hashCode method of class Object, this value is
- * calculated as follows:
- *
-<pre>hashCode = 1;
-Iterator i = list.iterator();
-while (i.hasNext())
-{
- Object obj = i.next();
- hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
-}</pre>
- *
- * This ensures that the general contract of Object.hashCode() is adhered to.
- *
- * @return the hash code of this list
- *
- * @see Object#hashCode()
- * @see #equals(Object)
- */
- public int hashCode()
- {
- int hashCode = 1;
- Iterator itr = iterator();
- int pos = size();
- while (--pos >= 0)
- hashCode = 31 * hashCode + hashCode(itr.next());
- return hashCode;
- }
-
- /**
- * Obtain the first index at which a given object is to be found in this
- * list. This implementation follows a listIterator() until a match is found,
- * or returns -1 if the list end is reached.
- *
- * @param o the object to search for
- * @return the least integer n such that <code>o == null ? get(n) == null :
- * o.equals(get(n))</code>, or -1 if there is no such index
- */
- public int indexOf(Object o)
- {
- ListIterator itr = listIterator();
- int size = size();
- for (int pos = 0; pos < size; pos++)
- if (equals(o, itr.next()))
- return pos;
- return -1;
- }
-
- /**
- * Obtain an Iterator over this list, whose sequence is the list order.
- * This implementation uses size(), get(int), and remove(int) of the
- * backing list, and does not support remove unless the list does. This
- * implementation is fail-fast if you correctly maintain modCount.
- * Also, this implementation is specified by Sun to be distinct from
- * listIterator, although you could easily implement it as
- * <code>return listIterator(0)</code>.
- *
- * @return an Iterator over the elements of this list, in order
- * @see #modCount
- */
- public Iterator iterator()
- {
- // Bah, Sun's implementation forbids using listIterator(0).
- return new Iterator()
- {
- private int pos = 0;
- private int size = size();
- private int last = -1;
- private int knownMod = modCount;
-
- // This will get inlined, since it is private.
- /**
- * Checks for modifications made to the list from
- * elsewhere while iteration is in progress.
- *
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- private void checkMod()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- }
-
- /**
- * Tests to see if there are any more objects to
- * return.
- *
- * @return True if the end of the list has not yet been
- * reached.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public boolean hasNext()
- {
- checkMod();
- return pos < size;
- }
-
- /**
- * Retrieves the next object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are
- * no more objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public Object next()
- {
- checkMod();
- if (pos == size)
- throw new NoSuchElementException();
- last = pos;
- return get(pos++);
- }
-
- /**
- * Removes the last object retrieved by <code>next()</code>
- * from the list, if the list supports object removal.
- *
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list does
- * not support removing elements.
- */
- public void remove()
- {
- checkMod();
- if (last < 0)
- throw new IllegalStateException();
- AbstractList.this.remove(last);
- pos--;
- size--;
- last = -1;
- knownMod = modCount;
- }
- };
- }
-
- /**
- * Obtain the last index at which a given object is to be found in this
- * list. This implementation grabs listIterator(size()), then searches
- * backwards for a match or returns -1.
- *
- * @return the greatest integer n such that <code>o == null ? get(n) == null
- * : o.equals(get(n))</code>, or -1 if there is no such index
- */
- public int lastIndexOf(Object o)
- {
- int pos = size();
- ListIterator itr = listIterator(pos);
- while (--pos >= 0)
- if (equals(o, itr.previous()))
- return pos;
- return -1;
- }
-
- /**
- * Obtain a ListIterator over this list, starting at the beginning. This
- * implementation returns listIterator(0).
- *
- * @return a ListIterator over the elements of this list, in order, starting
- * at the beginning
- */
- public ListIterator listIterator()
- {
- return listIterator(0);
- }
-
- /**
- * Obtain a ListIterator over this list, starting at a given position.
- * A first call to next() would return the same as get(index), and a
- * first call to previous() would return the same as get(index - 1).
- * <p>
- *
- * This implementation uses size(), get(int), set(int, Object),
- * add(int, Object), and remove(int) of the backing list, and does not
- * support remove, set, or add unless the list does. This implementation
- * is fail-fast if you correctly maintain modCount.
- *
- * @param index the position, between 0 and size() inclusive, to begin the
- * iteration from
- * @return a ListIterator over the elements of this list, in order, starting
- * at index
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @see #modCount
- */
- public ListIterator listIterator(final int index)
- {
- if (index < 0 || index > size())
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size());
-
- return new ListIterator()
- {
- private int knownMod = modCount;
- private int position = index;
- private int lastReturned = -1;
- private int size = size();
-
- // This will get inlined, since it is private.
- /**
- * Checks for modifications made to the list from
- * elsewhere while iteration is in progress.
- *
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- private void checkMod()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- }
-
- /**
- * Tests to see if there are any more objects to
- * return.
- *
- * @return True if the end of the list has not yet been
- * reached.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public boolean hasNext()
- {
- checkMod();
- return position < size;
- }
-
- /**
- * Tests to see if there are objects prior to the
- * current position in the list.
- *
- * @return True if objects exist prior to the current
- * position of the iterator.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public boolean hasPrevious()
- {
- checkMod();
- return position > 0;
- }
-
- /**
- * Retrieves the next object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are no
- * more objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public Object next()
- {
- checkMod();
- if (position == size)
- throw new NoSuchElementException();
- lastReturned = position;
- return get(position++);
- }
-
- /**
- * Retrieves the previous object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are no
- * previous objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public Object previous()
- {
- checkMod();
- if (position == 0)
- throw new NoSuchElementException();
- lastReturned = --position;
- return get(lastReturned);
- }
-
- /**
- * Returns the index of the next element in the
- * list, which will be retrieved by <code>next()</code>
- *
- * @return The index of the next element.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public int nextIndex()
- {
- checkMod();
- return position;
- }
-
- /**
- * Returns the index of the previous element in the
- * list, which will be retrieved by <code>previous()</code>
- *
- * @return The index of the previous element.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public int previousIndex()
- {
- checkMod();
- return position - 1;
- }
-
- /**
- * Removes the last object retrieved by <code>next()</code>
- * or <code>previous()</code> from the list, if the list
- * supports object removal.
- *
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list does
- * not support removing elements.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void remove()
- {
- checkMod();
- if (lastReturned < 0)
- throw new IllegalStateException();
- AbstractList.this.remove(lastReturned);
- size--;
- position = lastReturned;
- lastReturned = -1;
- knownMod = modCount;
- }
-
- /**
- * Replaces the last object retrieved by <code>next()</code>
- * or <code>previous</code> with o, if the list supports object
- * replacement and an add or remove operation has not already
- * been performed.
- *
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list doesn't support
- * the addition or removal of elements.
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws IllegalArgumentException if something else related to o
- * prevents its addition.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void set(Object o)
- {
- checkMod();
- if (lastReturned < 0)
- throw new IllegalStateException();
- AbstractList.this.set(lastReturned, o);
- }
-
- /**
- * Adds the supplied object before the element that would be returned
- * by a call to <code>next()</code>, if the list supports addition.
- *
- * @param o The object to add to the list.
- * @throws UnsupportedOperationException if the list doesn't support
- * the addition of new elements.
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws IllegalArgumentException if something else related to o
- * prevents its addition.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void add(Object o)
- {
- checkMod();
- AbstractList.this.add(position++, o);
- size++;
- lastReturned = -1;
- knownMod = modCount;
- }
- };
- }
-
- /**
- * Remove the element at a given position in this list (optional operation).
- * Shifts all remaining elements to the left to fill the gap. This
- * implementation always throws an UnsupportedOperationException.
- * If you want fail-fast iterators, be sure to increment modCount when
- * overriding this.
- *
- * @param index the position within the list of the object to remove
- * @return the object that was removed
- * @throws UnsupportedOperationException if this list does not support the
- * remove operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- * @see #modCount
- */
- public Object remove(int index)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Remove a subsection of the list. This is called by the clear and
- * removeRange methods of the class which implements subList, which are
- * difficult for subclasses to override directly. Therefore, this method
- * should be overridden instead by the more efficient implementation, if one
- * exists. Overriding this can reduce quadratic efforts to constant time
- * in some cases!
- * <p>
- *
- * This implementation first checks for illegal or out of range arguments. It
- * then obtains a ListIterator over the list using listIterator(fromIndex).
- * It then calls next() and remove() on this iterator repeatedly, toIndex -
- * fromIndex times.
- *
- * @param fromIndex the index, inclusive, to remove from.
- * @param toIndex the index, exclusive, to remove to.
- * @throws UnsupportedOperationException if the list does
- * not support removing elements.
- */
- protected void removeRange(int fromIndex, int toIndex)
- {
- ListIterator itr = listIterator(fromIndex);
- for (int index = fromIndex; index < toIndex; index++)
- {
- itr.next();
- itr.remove();
- }
- }
-
- /**
- * Replace an element of this list with another object (optional operation).
- * This implementation always throws an UnsupportedOperationException.
- *
- * @param index the position within this list of the element to be replaced
- * @param o the object to replace it with
- * @return the object that was replaced
- * @throws UnsupportedOperationException if this list does not support the
- * set operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason
- */
- public Object set(int index, Object o)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Obtain a List view of a subsection of this list, from fromIndex
- * (inclusive) to toIndex (exclusive). If the two indices are equal, the
- * sublist is empty. The returned list should be modifiable if and only
- * if this list is modifiable. Changes to the returned list should be
- * reflected in this list. If this list is structurally modified in
- * any way other than through the returned list, the result of any subsequent
- * operations on the returned list is undefined.
- * <p>
- *
- * This implementation returns a subclass of AbstractList. It stores, in
- * private fields, the offset and size of the sublist, and the expected
- * modCount of the backing list. If the backing list implements RandomAccess,
- * the sublist will also.
- * <p>
- *
- * The subclass's <code>set(int, Object)</code>, <code>get(int)</code>,
- * <code>add(int, Object)</code>, <code>remove(int)</code>,
- * <code>addAll(int, Collection)</code> and
- * <code>removeRange(int, int)</code> methods all delegate to the
- * corresponding methods on the backing abstract list, after
- * bounds-checking the index and adjusting for the offset. The
- * <code>addAll(Collection c)</code> method merely returns addAll(size, c).
- * The <code>listIterator(int)</code> method returns a "wrapper object"
- * over a list iterator on the backing list, which is created with the
- * corresponding method on the backing list. The <code>iterator()</code>
- * method merely returns listIterator(), and the <code>size()</code> method
- * merely returns the subclass's size field.
- * <p>
- *
- * All methods first check to see if the actual modCount of the backing
- * list is equal to its expected value, and throw a
- * ConcurrentModificationException if it is not.
- *
- * @param fromIndex the index that the returned list should start from
- * (inclusive)
- * @param toIndex the index that the returned list should go to (exclusive)
- * @return a List backed by a subsection of this list
- * @throws IndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; size()
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @see ConcurrentModificationException
- * @see RandomAccess
- */
- public List subList(int fromIndex, int toIndex)
- {
- // This follows the specification of AbstractList, but is inconsistent
- // with the one in List. Don't you love Sun's inconsistencies?
- if (fromIndex > toIndex)
- throw new IllegalArgumentException(fromIndex + " > " + toIndex);
- if (fromIndex < 0 || toIndex > size())
- throw new IndexOutOfBoundsException();
-
- if (this instanceof RandomAccess)
- return new RandomAccessSubList(this, fromIndex, toIndex);
- return new SubList(this, fromIndex, toIndex);
- }
-
- /**
- * This class follows the implementation requirements set forth in
- * {@link AbstractList#subList(int, int)}. It matches Sun's implementation
- * by using a non-public top-level class in the same package.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static class SubList extends AbstractList
- {
- // Package visible, for use by iterator.
- /** The original list. */
- final AbstractList backingList;
- /** The index of the first element of the sublist. */
- final int offset;
- /** The size of the sublist. */
- int size;
-
- /**
- * Construct the sublist.
- *
- * @param backing the list this comes from
- * @param fromIndex the lower bound, inclusive
- * @param toIndex the upper bound, exclusive
- */
- SubList(AbstractList backing, int fromIndex, int toIndex)
- {
- backingList = backing;
- modCount = backing.modCount;
- offset = fromIndex;
- size = toIndex - fromIndex;
- }
-
- /**
- * This method checks the two modCount fields to ensure that there has
- * not been a concurrent modification, returning if all is okay.
- *
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- */
- // This can be inlined. Package visible, for use by iterator.
- void checkMod()
- {
- if (modCount != backingList.modCount)
- throw new ConcurrentModificationException();
- }
-
- /**
- * This method checks that a value is between 0 and size (inclusive). If
- * it is not, an exception is thrown.
- *
- * @param index the value to check
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- // This will get inlined, since it is private.
- private void checkBoundsInclusive(int index)
- {
- if (index < 0 || index > size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size);
- }
-
- /**
- * This method checks that a value is between 0 (inclusive) and size
- * (exclusive). If it is not, an exception is thrown.
- *
- * @param index the value to check
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- // This will get inlined, since it is private.
- private void checkBoundsExclusive(int index)
- {
- if (index < 0 || index >= size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size);
- }
-
- /**
- * Specified by AbstractList.subList to return the private field size.
- *
- * @return the sublist size
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- */
- public int size()
- {
- checkMod();
- return size;
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- *
- * @param index the location to modify
- * @param o the new value
- * @return the old value
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws UnsupportedOperationException if the backing list does not
- * support the set operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- * @throws ClassCastException if o cannot be added to the backing list due
- * to its type
- * @throws IllegalArgumentException if o cannot be added to the backing list
- * for some other reason
- */
- public Object set(int index, Object o)
- {
- checkMod();
- checkBoundsExclusive(index);
- return backingList.set(index + offset, o);
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- *
- * @param index the location to get from
- * @return the object at that location
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object get(int index)
- {
- checkMod();
- checkBoundsExclusive(index);
- return backingList.get(index + offset);
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- *
- * @param index the index to insert at
- * @param o the object to add
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws UnsupportedOperationException if the backing list does not
- * support the add operation.
- * @throws ClassCastException if o cannot be added to the backing list due
- * to its type.
- * @throws IllegalArgumentException if o cannot be added to the backing
- * list for some other reason.
- */
- public void add(int index, Object o)
- {
- checkMod();
- checkBoundsInclusive(index);
- backingList.add(index + offset, o);
- size++;
- modCount = backingList.modCount;
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- *
- * @param index the index to remove
- * @return the removed object
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- * @throws UnsupportedOperationException if the backing list does not
- * support the remove operation
- */
- public Object remove(int index)
- {
- checkMod();
- checkBoundsExclusive(index);
- Object o = backingList.remove(index + offset);
- size--;
- modCount = backingList.modCount;
- return o;
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- * This does no bounds checking, as it assumes it will only be called
- * by trusted code like clear() which has already checked the bounds.
- *
- * @param fromIndex the lower bound, inclusive
- * @param toIndex the upper bound, exclusive
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws UnsupportedOperationException if the backing list does
- * not support removing elements.
- */
- protected void removeRange(int fromIndex, int toIndex)
- {
- checkMod();
-
- backingList.removeRange(offset + fromIndex, offset + toIndex);
- size -= toIndex - fromIndex;
- modCount = backingList.modCount;
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- *
- * @param index the location to insert at
- * @param c the collection to insert
- * @return true if this list was modified, in other words, c is non-empty
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws UnsupportedOperationException if this list does not support the
- * addAll operation
- * @throws ClassCastException if some element of c cannot be added to this
- * list due to its type
- * @throws IllegalArgumentException if some element of c cannot be added
- * to this list for some other reason
- * @throws NullPointerException if the specified collection is null
- */
- public boolean addAll(int index, Collection c)
- {
- checkMod();
- checkBoundsInclusive(index);
- int csize = c.size();
- boolean result = backingList.addAll(offset + index, c);
- size += csize;
- modCount = backingList.modCount;
- return result;
- }
-
- /**
- * Specified by AbstractList.subList to return addAll(size, c).
- *
- * @param c the collection to insert
- * @return true if this list was modified, in other words, c is non-empty
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws UnsupportedOperationException if this list does not support the
- * addAll operation
- * @throws ClassCastException if some element of c cannot be added to this
- * list due to its type
- * @throws IllegalArgumentException if some element of c cannot be added
- * to this list for some other reason
- * @throws NullPointerException if the specified collection is null
- */
- public boolean addAll(Collection c)
- {
- return addAll(size, c);
- }
-
- /**
- * Specified by AbstractList.subList to return listIterator().
- *
- * @return an iterator over the sublist
- */
- public Iterator iterator()
- {
- return listIterator();
- }
-
- /**
- * Specified by AbstractList.subList to return a wrapper around the
- * backing list's iterator.
- *
- * @param index the start location of the iterator
- * @return a list iterator over the sublist
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws IndexOutOfBoundsException if the value is out of range
- */
- public ListIterator listIterator(final int index)
- {
- checkMod();
- checkBoundsInclusive(index);
-
- return new ListIterator()
- {
- private final ListIterator i = backingList.listIterator(index + offset);
- private int position = index;
-
- /**
- * Tests to see if there are any more objects to
- * return.
- *
- * @return True if the end of the list has not yet been
- * reached.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public boolean hasNext()
- {
- checkMod();
- return position < size;
- }
-
- /**
- * Tests to see if there are objects prior to the
- * current position in the list.
- *
- * @return True if objects exist prior to the current
- * position of the iterator.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public boolean hasPrevious()
- {
- checkMod();
- return position > 0;
- }
-
- /**
- * Retrieves the next object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are no
- * more objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public Object next()
- {
- if (position == size)
- throw new NoSuchElementException();
- position++;
- return i.next();
- }
-
- /**
- * Retrieves the previous object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are no
- * previous objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public Object previous()
- {
- if (position == 0)
- throw new NoSuchElementException();
- position--;
- return i.previous();
- }
-
- /**
- * Returns the index of the next element in the
- * list, which will be retrieved by <code>next()</code>
- *
- * @return The index of the next element.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public int nextIndex()
- {
- return i.nextIndex() - offset;
- }
-
- /**
- * Returns the index of the previous element in the
- * list, which will be retrieved by <code>previous()</code>
- *
- * @return The index of the previous element.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public int previousIndex()
- {
- return i.previousIndex() - offset;
- }
-
- /**
- * Removes the last object retrieved by <code>next()</code>
- * from the list, if the list supports object removal.
- *
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list does
- * not support removing elements.
- */
- public void remove()
- {
- i.remove();
- size--;
- position = nextIndex();
- modCount = backingList.modCount;
- }
-
-
- /**
- * Replaces the last object retrieved by <code>next()</code>
- * or <code>previous</code> with o, if the list supports object
- * replacement and an add or remove operation has not already
- * been performed.
- *
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list doesn't support
- * the addition or removal of elements.
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws IllegalArgumentException if something else related to o
- * prevents its addition.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void set(Object o)
- {
- i.set(o);
- }
-
- /**
- * Adds the supplied object before the element that would be returned
- * by a call to <code>next()</code>, if the list supports addition.
- *
- * @param o The object to add to the list.
- * @throws UnsupportedOperationException if the list doesn't support
- * the addition of new elements.
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws IllegalArgumentException if something else related to o
- * prevents its addition.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void add(Object o)
- {
- i.add(o);
- size++;
- position++;
- modCount = backingList.modCount;
- }
-
- // Here is the reason why the various modCount fields are mostly
- // ignored in this wrapper listIterator.
- // If the backing listIterator is failfast, then the following holds:
- // Using any other method on this list will call a corresponding
- // method on the backing list *after* the backing listIterator
- // is created, which will in turn cause a ConcurrentModException
- // when this listIterator comes to use the backing one. So it is
- // implicitly failfast.
- // If the backing listIterator is NOT failfast, then the whole of
- // this list isn't failfast, because the modCount field of the
- // backing list is not valid. It would still be *possible* to
- // make the iterator failfast wrt modifications of the sublist
- // only, but somewhat pointless when the list can be changed under
- // us.
- // Either way, no explicit handling of modCount is needed.
- // However modCount = backingList.modCount must be executed in add
- // and remove, and size must also be updated in these two methods,
- // since they do not go through the corresponding methods of the subList.
- };
- }
- } // class SubList
-
- /**
- * This class is a RandomAccess version of SubList, as required by
- * {@link AbstractList#subList(int, int)}.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class RandomAccessSubList extends SubList
- implements RandomAccess
- {
- /**
- * Construct the sublist.
- *
- * @param backing the list this comes from
- * @param fromIndex the lower bound, inclusive
- * @param toIndex the upper bound, exclusive
- */
- RandomAccessSubList(AbstractList backing, int fromIndex, int toIndex)
- {
- super(backing, fromIndex, toIndex);
- }
- } // class RandomAccessSubList
-
-} // class AbstractList
diff --git a/libjava/java/util/AbstractMap.java b/libjava/java/util/AbstractMap.java
deleted file mode 100644
index 7cd6436a308..00000000000
--- a/libjava/java/util/AbstractMap.java
+++ /dev/null
@@ -1,749 +0,0 @@
-/* AbstractMap.java -- Abstract implementation of most of Map
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * An abstract implementation of Map to make it easier to create your own
- * implementations. In order to create an unmodifiable Map, subclass
- * AbstractMap and implement the <code>entrySet</code> (usually via an
- * AbstractSet). To make it modifiable, also implement <code>put</code>,
- * and have <code>entrySet().iterator()</code> support <code>remove</code>.
- * <p>
- *
- * It is recommended that classes which extend this support at least the
- * no-argument constructor, and a constructor which accepts another Map.
- * Further methods in this class may be overridden if you have a more
- * efficient implementation.
- *
- * @author Original author unknown
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Map
- * @see Collection
- * @see HashMap
- * @see LinkedHashMap
- * @see TreeMap
- * @see WeakHashMap
- * @see IdentityHashMap
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class AbstractMap implements Map
-{
- /** An "enum" of iterator types. */
- // Package visible for use by subclasses.
- static final int KEYS = 0,
- VALUES = 1,
- ENTRIES = 2;
-
- /**
- * The cache for {@link #keySet()}.
- */
- // Package visible for use by subclasses.
- Set keys;
-
- /**
- * The cache for {@link #values()}.
- */
- // Package visible for use by subclasses.
- Collection values;
-
- /**
- * The main constructor, for use by subclasses.
- */
- protected AbstractMap()
- {
- }
-
- /**
- * Returns a set view of the mappings in this Map. Each element in the
- * set must be an implementation of Map.Entry. The set is backed by
- * the map, so that changes in one show up in the other. Modifications
- * made while an iterator is in progress cause undefined behavior. If
- * the set supports removal, these methods must be valid:
- * <code>Iterator.remove</code>, <code>Set.remove</code>,
- * <code>removeAll</code>, <code>retainAll</code>, and <code>clear</code>.
- * Element addition is not supported via this set.
- *
- * @return the entry set
- * @see Map.Entry
- */
- public abstract Set entrySet();
-
- /**
- * Remove all entries from this Map (optional operation). This default
- * implementation calls entrySet().clear(). NOTE: If the entry set does
- * not permit clearing, then this will fail, too. Subclasses often
- * override this for efficiency. Your implementation of entrySet() should
- * not call <code>AbstractMap.clear</code> unless you want an infinite loop.
- *
- * @throws UnsupportedOperationException if <code>entrySet().clear()</code>
- * does not support clearing.
- * @see Set#clear()
- */
- public void clear()
- {
- entrySet().clear();
- }
-
- /**
- * Create a shallow copy of this Map, no keys or values are copied. The
- * default implementation simply calls <code>super.clone()</code>.
- *
- * @return the shallow clone
- * @throws CloneNotSupportedException if a subclass is not Cloneable
- * @see Cloneable
- * @see Object#clone()
- */
- protected Object clone() throws CloneNotSupportedException
- {
- AbstractMap copy = (AbstractMap) super.clone();
- // Clear out the caches; they are stale.
- copy.keys = null;
- copy.values = null;
- return copy;
- }
-
- /**
- * Returns true if this contains a mapping for the given key. This
- * implementation does a linear search, O(n), over the
- * <code>entrySet()</code>, returning <code>true</code> if a match
- * is found, <code>false</code> if the iteration ends. Many subclasses
- * can implement this more efficiently.
- *
- * @param key the key to search for
- * @return true if the map contains the key
- * @throws NullPointerException if key is <code>null</code> but the map
- * does not permit null keys
- * @see #containsValue(Object)
- */
- public boolean containsKey(Object key)
- {
- Iterator entries = entrySet().iterator();
- int pos = size();
- while (--pos >= 0)
- if (equals(key, ((Map.Entry) entries.next()).getKey()))
- return true;
- return false;
- }
-
- /**
- * Returns true if this contains at least one mapping with the given value.
- * This implementation does a linear search, O(n), over the
- * <code>entrySet()</code>, returning <code>true</code> if a match
- * is found, <code>false</code> if the iteration ends. A match is
- * defined as a value, v, where <code>(value == null ? v == null :
- * value.equals(v))</code>. Subclasses are unlikely to implement
- * this more efficiently.
- *
- * @param value the value to search for
- * @return true if the map contains the value
- * @see #containsKey(Object)
- */
- public boolean containsValue(Object value)
- {
- Iterator entries = entrySet().iterator();
- int pos = size();
- while (--pos >= 0)
- if (equals(value, ((Map.Entry) entries.next()).getValue()))
- return true;
- return false;
- }
-
- /**
- * Compares the specified object with this map for equality. Returns
- * <code>true</code> if the other object is a Map with the same mappings,
- * that is,<br>
- * <code>o instanceof Map && entrySet().equals(((Map) o).entrySet();</code>
- *
- * @param o the object to be compared
- * @return true if the object equals this map
- * @see Set#equals(Object)
- */
- public boolean equals(Object o)
- {
- return (o == this ||
- (o instanceof Map &&
- entrySet().equals(((Map) o).entrySet())));
- }
-
- /**
- * Returns the value mapped by the given key. Returns <code>null</code> if
- * there is no mapping. However, in Maps that accept null values, you
- * must rely on <code>containsKey</code> to determine if a mapping exists.
- * This iteration takes linear time, searching entrySet().iterator() of
- * the key. Many implementations override this method.
- *
- * @param key the key to look up
- * @return the value associated with the key, or null if key not in map
- * @throws NullPointerException if this map does not accept null keys
- * @see #containsKey(Object)
- */
- public Object get(Object key)
- {
- Iterator entries = entrySet().iterator();
- int pos = size();
- while (--pos >= 0)
- {
- Map.Entry entry = (Map.Entry) entries.next();
- if (equals(key, entry.getKey()))
- return entry.getValue();
- }
- return null;
- }
-
- /**
- * Returns the hash code for this map. As defined in Map, this is the sum
- * of all hashcodes for each Map.Entry object in entrySet, or basically
- * entrySet().hashCode().
- *
- * @return the hash code
- * @see Map.Entry#hashCode()
- * @see Set#hashCode()
- */
- public int hashCode()
- {
- return entrySet().hashCode();
- }
-
- /**
- * Returns true if the map contains no mappings. This is implemented by
- * <code>size() == 0</code>.
- *
- * @return true if the map is empty
- * @see #size()
- */
- public boolean isEmpty()
- {
- return size() == 0;
- }
-
- /**
- * Returns a set view of this map's keys. The set is backed by the map,
- * so changes in one show up in the other. Modifications while an iteration
- * is in progress produce undefined behavior. The set supports removal
- * if entrySet() does, but does not support element addition.
- * <p>
- *
- * This implementation creates an AbstractSet, where the iterator wraps
- * the entrySet iterator, size defers to the Map's size, and contains
- * defers to the Map's containsKey. The set is created on first use, and
- * returned on subsequent uses, although since no synchronization occurs,
- * there is a slight possibility of creating two sets.
- *
- * @return a Set view of the keys
- * @see Set#iterator()
- * @see #size()
- * @see #containsKey(Object)
- * @see #values()
- */
- public Set keySet()
- {
- if (keys == null)
- keys = new AbstractSet()
- {
- /**
- * Retrieves the number of keys in the backing map.
- *
- * @return The number of keys.
- */
- public int size()
- {
- return AbstractMap.this.size();
- }
-
- /**
- * Returns true if the backing map contains the
- * supplied key.
- *
- * @param key The key to search for.
- * @return True if the key was found, false otherwise.
- */
- public boolean contains(Object key)
- {
- return containsKey(key);
- }
-
- /**
- * Returns an iterator which iterates over the keys
- * in the backing map, using a wrapper around the
- * iterator returned by <code>entrySet()</code>.
- *
- * @return An iterator over the keys.
- */
- public Iterator iterator()
- {
- return new Iterator()
- {
- /**
- * The iterator returned by <code>entrySet()</code>.
- */
- private final Iterator map_iterator = entrySet().iterator();
-
- /**
- * Returns true if a call to <code>next()</code> will
- * return another key.
- *
- * @return True if the iterator has not yet reached
- * the last key.
- */
- public boolean hasNext()
- {
- return map_iterator.hasNext();
- }
-
- /**
- * Returns the key from the next entry retrieved
- * by the underlying <code>entrySet()</code> iterator.
- *
- * @return The next key.
- */
- public Object next()
- {
- return ((Map.Entry) map_iterator.next()).getKey();
- }
-
- /**
- * Removes the map entry which has a key equal
- * to that returned by the last call to
- * <code>next()</code>.
- *
- * @throws UnsupportedOperationException if the
- * map doesn't support removal.
- */
- public void remove()
- {
- map_iterator.remove();
- }
- };
- }
- };
- return keys;
- }
-
- /**
- * Associates the given key to the given value (optional operation). If the
- * map already contains the key, its value is replaced. This implementation
- * simply throws an UnsupportedOperationException. Be aware that in a map
- * that permits <code>null</code> values, a null return does not always
- * imply that the mapping was created.
- *
- * @param key the key to map
- * @param value the value to be mapped
- * @return the previous value of the key, or null if there was no mapping
- * @throws UnsupportedOperationException if the operation is not supported
- * @throws ClassCastException if the key or value is of the wrong type
- * @throws IllegalArgumentException if something about this key or value
- * prevents it from existing in this map
- * @throws NullPointerException if the map forbids null keys or values
- * @see #containsKey(Object)
- */
- public Object put(Object key, Object value)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Copies all entries of the given map to this one (optional operation). If
- * the map already contains a key, its value is replaced. This implementation
- * simply iterates over the map's entrySet(), calling <code>put</code>,
- * so it is not supported if puts are not.
- *
- * @param m the mapping to load into this map
- * @throws UnsupportedOperationException if the operation is not supported
- * by this map.
- * @throws ClassCastException if a key or value is of the wrong type for
- * adding to this map.
- * @throws IllegalArgumentException if something about a key or value
- * prevents it from existing in this map.
- * @throws NullPointerException if the map forbids null keys or values.
- * @throws NullPointerException if <code>m</code> is null.
- * @see #put(Object, Object)
- */
- public void putAll(Map m)
- {
- Iterator entries = m.entrySet().iterator();
- int pos = m.size();
- while (--pos >= 0)
- {
- Map.Entry entry = (Map.Entry) entries.next();
- put(entry.getKey(), entry.getValue());
- }
- }
-
- /**
- * Removes the mapping for this key if present (optional operation). This
- * implementation iterates over the entrySet searching for a matching
- * key, at which point it calls the iterator's <code>remove</code> method.
- * It returns the result of <code>getValue()</code> on the entry, if found,
- * or null if no entry is found. Note that maps which permit null values
- * may also return null if the key was removed. If the entrySet does not
- * support removal, this will also fail. This is O(n), so many
- * implementations override it for efficiency.
- *
- * @param key the key to remove
- * @return the value the key mapped to, or null if not present.
- * Null may also be returned if null values are allowed
- * in the map and the value of this mapping is null.
- * @throws UnsupportedOperationException if deletion is unsupported
- * @see Iterator#remove()
- */
- public Object remove(Object key)
- {
- Iterator entries = entrySet().iterator();
- int pos = size();
- while (--pos >= 0)
- {
- Map.Entry entry = (Map.Entry) entries.next();
- if (equals(key, entry.getKey()))
- {
- // Must get the value before we remove it from iterator.
- Object r = entry.getValue();
- entries.remove();
- return r;
- }
- }
- return null;
- }
-
- /**
- * Returns the number of key-value mappings in the map. If there are more
- * than Integer.MAX_VALUE mappings, return Integer.MAX_VALUE. This is
- * implemented as <code>entrySet().size()</code>.
- *
- * @return the number of mappings
- * @see Set#size()
- */
- public int size()
- {
- return entrySet().size();
- }
-
- /**
- * Returns a String representation of this map. This is a listing of the
- * map entries (which are specified in Map.Entry as being
- * <code>getKey() + "=" + getValue()</code>), separated by a comma and
- * space (", "), and surrounded by braces ('{' and '}'). This implementation
- * uses a StringBuffer and iterates over the entrySet to build the String.
- * Note that this can fail with an exception if underlying keys or
- * values complete abruptly in toString().
- *
- * @return a String representation
- * @see Map.Entry#toString()
- */
- public String toString()
- {
- Iterator entries = entrySet().iterator();
- StringBuffer r = new StringBuffer("{");
- for (int pos = size(); pos > 0; pos--)
- {
- Map.Entry entry = (Map.Entry) entries.next();
- r.append(entry.getKey());
- r.append('=');
- r.append(entry.getValue());
- if (pos > 1)
- r.append(", ");
- }
- r.append("}");
- return r.toString();
- }
-
- /**
- * Returns a collection or bag view of this map's values. The collection
- * is backed by the map, so changes in one show up in the other.
- * Modifications while an iteration is in progress produce undefined
- * behavior. The collection supports removal if entrySet() does, but
- * does not support element addition.
- * <p>
- *
- * This implementation creates an AbstractCollection, where the iterator
- * wraps the entrySet iterator, size defers to the Map's size, and contains
- * defers to the Map's containsValue. The collection is created on first
- * use, and returned on subsequent uses, although since no synchronization
- * occurs, there is a slight possibility of creating two collections.
- *
- * @return a Collection view of the values
- * @see Collection#iterator()
- * @see #size()
- * @see #containsValue(Object)
- * @see #keySet()
- */
- public Collection values()
- {
- if (values == null)
- values = new AbstractCollection()
- {
- /**
- * Returns the number of values stored in
- * the backing map.
- *
- * @return The number of values.
- */
- public int size()
- {
- return AbstractMap.this.size();
- }
-
- /**
- * Returns true if the backing map contains
- * the supplied value.
- *
- * @param value The value to search for.
- * @return True if the value was found, false otherwise.
- */
- public boolean contains(Object value)
- {
- return containsValue(value);
- }
-
- /**
- * Returns an iterator which iterates over the
- * values in the backing map, by using a wrapper
- * around the iterator returned by <code>entrySet()</code>.
- *
- * @return An iterator over the values.
- */
- public Iterator iterator()
- {
- return new Iterator()
- {
- /**
- * The iterator returned by <code>entrySet()</code>.
- */
- private final Iterator map_iterator = entrySet().iterator();
-
- /**
- * Returns true if a call to <code>next()</call> will
- * return another value.
- *
- * @return True if the iterator has not yet reached
- * the last value.
- */
- public boolean hasNext()
- {
- return map_iterator.hasNext();
- }
-
- /**
- * Returns the value from the next entry retrieved
- * by the underlying <code>entrySet()</code> iterator.
- *
- * @return The next value.
- */
- public Object next()
- {
- return ((Map.Entry) map_iterator.next()).getValue();
- }
-
- /**
- * Removes the map entry which has a key equal
- * to that returned by the last call to
- * <code>next()</code>.
- *
- * @throws UnsupportedOperationException if the
- * map doesn't support removal.
- */
- public void remove()
- {
- map_iterator.remove();
- }
- };
- }
- };
- return values;
- }
-
- /**
- * Compare two objects according to Collection semantics.
- *
- * @param o1 the first object
- * @param o2 the second object
- * @return o1 == null ? o2 == null : o1.equals(o2)
- */
- // Package visible for use throughout java.util.
- // It may be inlined since it is final.
- static final boolean equals(Object o1, Object o2)
- {
- return o1 == null ? o2 == null : o1.equals(o2);
- }
-
- /**
- * Hash an object according to Collection semantics.
- *
- * @param o the object to hash
- * @return o1 == null ? 0 : o1.hashCode()
- */
- // Package visible for use throughout java.util.
- // It may be inlined since it is final.
- static final int hashCode(Object o)
- {
- return o == null ? 0 : o.hashCode();
- }
-
- /**
- * A class which implements Map.Entry. It is shared by HashMap, TreeMap,
- * Hashtable, and Collections. It is not specified by the JDK, but makes
- * life much easier.
- *
- * @author Jon Zeppieri
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- // XXX - FIXME Use fully qualified implements as gcj 3.1 workaround.
- // Bug still exists in 3.4.1
- static class BasicMapEntry implements Map.Entry
- {
- /**
- * The key. Package visible for direct manipulation.
- */
- Object key;
-
- /**
- * The value. Package visible for direct manipulation.
- */
- Object value;
-
- /**
- * Basic constructor initializes the fields.
- * @param newKey the key
- * @param newValue the value
- */
- BasicMapEntry(Object newKey, Object newValue)
- {
- key = newKey;
- value = newValue;
- }
-
- /**
- * Compares the specified object with this entry. Returns true only if
- * the object is a mapping of identical key and value. In other words,
- * this must be:<br>
- * <pre>(o instanceof Map.Entry)
- * && (getKey() == null ? ((HashMap) o).getKey() == null
- * : getKey().equals(((HashMap) o).getKey()))
- * && (getValue() == null ? ((HashMap) o).getValue() == null
- * : getValue().equals(((HashMap) o).getValue()))</pre>
- *
- * @param o the object to compare
- * @return <code>true</code> if it is equal
- */
- public final boolean equals(Object o)
- {
- if (! (o instanceof Map.Entry))
- return false;
- // Optimize for our own entries.
- if (o instanceof BasicMapEntry)
- {
- BasicMapEntry e = (BasicMapEntry) o;
- return (AbstractMap.equals(key, e.key)
- && AbstractMap.equals(value, e.value));
- }
- Map.Entry e = (Map.Entry) o;
- return (AbstractMap.equals(key, e.getKey())
- && AbstractMap.equals(value, e.getValue()));
- }
-
- /**
- * Get the key corresponding to this entry.
- *
- * @return the key
- */
- public final Object getKey()
- {
- return key;
- }
-
- /**
- * Get the value corresponding to this entry. If you already called
- * Iterator.remove(), the behavior undefined, but in this case it works.
- *
- * @return the value
- */
- public final Object getValue()
- {
- return value;
- }
-
- /**
- * Returns the hash code of the entry. This is defined as the exclusive-or
- * of the hashcodes of the key and value (using 0 for null). In other
- * words, this must be:<br>
- * <pre>(getKey() == null ? 0 : getKey().hashCode())
- * ^ (getValue() == null ? 0 : getValue().hashCode())</pre>
- *
- * @return the hash code
- */
- public final int hashCode()
- {
- return (AbstractMap.hashCode(key) ^ AbstractMap.hashCode(value));
- }
-
- /**
- * Replaces the value with the specified object. This writes through
- * to the map, unless you have already called Iterator.remove(). It
- * may be overridden to restrict a null value.
- *
- * @param newVal the new value to store
- * @return the old value
- * @throws NullPointerException if the map forbids null values.
- * @throws UnsupportedOperationException if the map doesn't support
- * <code>put()</code>.
- * @throws ClassCastException if the value is of a type unsupported
- * by the map.
- * @throws IllegalArgumentException if something else about this
- * value prevents it being stored in the map.
- */
- public Object setValue(Object newVal)
- {
- Object r = value;
- value = newVal;
- return r;
- }
-
- /**
- * This provides a string representation of the entry. It is of the form
- * "key=value", where string concatenation is used on key and value.
- *
- * @return the string representation
- */
- public final String toString()
- {
- return key + "=" + value;
- }
- } // class BasicMapEntry
-}
diff --git a/libjava/java/util/AbstractSequentialList.java b/libjava/java/util/AbstractSequentialList.java
deleted file mode 100644
index 79583228d96..00000000000
--- a/libjava/java/util/AbstractSequentialList.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/* AbstractSequentialList.java -- List implementation for sequential access
- Copyright (C) 1998, 1999, 2000, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * Abstract superclass to make it easier to implement the List interface when
- * backed by a sequential-access store, such as a linked list. For random
- * access data, use AbstractList. This class implements the random access
- * methods (<code>get</code>, <code>set</code>, <code>add</code>, and
- * <code>remove</code>) atop the list iterator, opposite of AbstractList's
- * approach of implementing the iterator atop random access.
- * <p>
- *
- * To implement a list, you need an implementation for <code>size()</code>
- * and <code>listIterator</code>. With just <code>hasNext</code>,
- * <code>next</code>, <code>hasPrevious</code>, <code>previous</code>,
- * <code>nextIndex</code>, and <code>previousIndex</code>, you have an
- * unmodifiable list. For a modifiable one, add <code>set</code>, and for
- * a variable-size list, add <code>add</code> and <code>remove</code>.
- * <p>
- *
- * The programmer should provide a no-argument constructor, and one that
- * accepts another Collection, as recommended by the Collection interface.
- * Unfortunately, there is no way to enforce this in Java.
- *
- * @author Original author unknown
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see List
- * @see AbstractList
- * @see AbstractCollection
- * @see ListIterator
- * @see LinkedList
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class AbstractSequentialList extends AbstractList
-{
- /**
- * The main constructor, for use by subclasses.
- */
- protected AbstractSequentialList()
- {
- }
-
- /**
- * Returns a ListIterator over the list, starting from position index.
- * Subclasses must provide an implementation of this method.
- *
- * @param index the starting position of the list
- * @return the list iterator
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- public abstract ListIterator listIterator(int index);
-
- /**
- * Insert an element into the list at a given position (optional operation).
- * This shifts all existing elements from that position to the end one
- * index to the right. This version of add has no return, since it is
- * assumed to always succeed if there is no exception. This iteration
- * uses listIterator(index).add(o).
- *
- * @param index the location to insert the item
- * @param o the object to insert
- * @throws UnsupportedOperationException if this list does not support the
- * add operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason.
- * @throws NullPointerException if o is null and the list does not permit
- * the addition of null values.
- */
- public void add(int index, Object o)
- {
- listIterator(index).add(o);
- }
-
- /**
- * Insert the contents of a collection into the list at a given position
- * (optional operation). Shift all elements at that position to the right
- * by the number of elements inserted. This operation is undefined if
- * this list is modified during the operation (for example, if you try
- * to insert a list into itself).
- * <p>
- *
- * This implementation grabs listIterator(index), then proceeds to use add
- * for each element returned by c's iterator. Sun's online specs are wrong,
- * claiming that this also calls next(): listIterator.add() correctly
- * skips the added element.
- *
- * @param index the location to insert the collection
- * @param c the collection to insert
- * @return true if the list was modified by this action, that is, if c is
- * non-empty
- * @throws UnsupportedOperationException if this list does not support the
- * addAll operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws ClassCastException if some element of c cannot be added to this
- * list due to its type
- * @throws IllegalArgumentException if some element of c cannot be added
- * to this list for some other reason
- * @throws NullPointerException if the specified collection is null
- * @throws NullPointerException if an object, o, in c is null and the list
- * does not permit the addition of null values.
- * @see #add(int, Object)
- */
- public boolean addAll(int index, Collection c)
- {
- Iterator ci = c.iterator();
- int size = c.size();
- ListIterator i = listIterator(index);
- for (int pos = size; pos > 0; pos--)
- i.add(ci.next());
- return size > 0;
- }
-
- /**
- * Get the element at a given index in this list. This implementation
- * returns listIterator(index).next().
- *
- * @param index the index of the element to be returned
- * @return the element at index index in this list
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object get(int index)
- {
- // This is a legal listIterator position, but an illegal get.
- if (index == size())
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size());
- return listIterator(index).next();
- }
-
- /**
- * Obtain an Iterator over this list, whose sequence is the list order. This
- * implementation returns listIterator().
- *
- * @return an Iterator over the elements of this list, in order
- */
- public Iterator iterator()
- {
- return listIterator();
- }
-
- /**
- * Remove the element at a given position in this list (optional operation).
- * Shifts all remaining elements to the left to fill the gap. This
- * implementation uses listIterator(index) and ListIterator.remove().
- *
- * @param index the position within the list of the object to remove
- * @return the object that was removed
- * @throws UnsupportedOperationException if this list does not support the
- * remove operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object remove(int index)
- {
- // This is a legal listIterator position, but an illegal remove.
- if (index == size())
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size());
- ListIterator i = listIterator(index);
- Object removed = i.next();
- i.remove();
- return removed;
- }
-
- /**
- * Replace an element of this list with another object (optional operation).
- * This implementation uses listIterator(index) and ListIterator.set(o).
- *
- * @param index the position within this list of the element to be replaced
- * @param o the object to replace it with
- * @return the object that was replaced
- * @throws UnsupportedOperationException if this list does not support the
- * set operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason
- * @throws NullPointerException if o is null and the list does not allow
- * a value to be set to null.
- */
- public Object set(int index, Object o)
- {
- // This is a legal listIterator position, but an illegal set.
- if (index == size())
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size());
- ListIterator i = listIterator(index);
- Object old = i.next();
- i.set(o);
- return old;
- }
-}
diff --git a/libjava/java/util/AbstractSet.java b/libjava/java/util/AbstractSet.java
deleted file mode 100644
index f0d7cb19908..00000000000
--- a/libjava/java/util/AbstractSet.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/* AbstractSet.java -- Abstract implementation of most of Set
- Copyright (C) 1998, 2000, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * An abstract implementation of Set to make it easier to create your own
- * implementations. In order to create a Set, subclass AbstractSet and
- * implement the same methods that are required for AbstractCollection
- * (although these methods must of course meet the requirements that Set puts
- * on them - specifically, no element may be in the set more than once). This
- * class simply provides implementations of equals() and hashCode() to fulfil
- * the requirements placed on them by the Set interface.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see AbstractCollection
- * @see Set
- * @see HashSet
- * @see TreeSet
- * @see LinkedHashSet
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class AbstractSet extends AbstractCollection implements Set
-{
- /**
- * The main constructor, for use by subclasses.
- */
- protected AbstractSet()
- {
- }
-
- /**
- * Tests whether the given object is equal to this Set. This implementation
- * first checks whether this set <em>is</em> the given object, and returns
- * true if so. Otherwise, if o is a Set and is the same size as this one, it
- * returns the result of calling containsAll on the given Set. Otherwise, it
- * returns false.
- *
- * @param o the Object to be tested for equality with this Set
- * @return true if the given object is equal to this Set
- */
- public boolean equals(Object o)
- {
- return (o == this ||
- (o instanceof Set && ((Set) o).size() == size()
- && containsAll((Collection) o)));
- }
-
- /**
- * Returns a hash code for this Set. The hash code of a Set is the sum of the
- * hash codes of all its elements, except that the hash code of null is
- * defined to be zero. This implementation obtains an Iterator over the Set,
- * and sums the results.
- *
- * @return a hash code for this Set
- */
- public int hashCode()
- {
- Iterator itr = iterator();
- int hash = 0;
- int pos = size();
- while (--pos >= 0)
- hash += hashCode(itr.next());
- return hash;
- }
-
- /**
- * Removes from this set all elements in the given collection (optional
- * operation). This implementation uses <code>size()</code> to determine
- * the smaller collection. Then, if this set is smaller, it iterates
- * over the set, calling Iterator.remove if the collection contains
- * the element. If this set is larger, it iterates over the collection,
- * calling Set.remove for all elements in the collection. Note that
- * this operation will fail if a remove methods is not supported.
- *
- * @param c the collection of elements to remove
- * @return true if the set was modified as a result
- * @throws UnsupportedOperationException if remove is not supported
- * @throws NullPointerException if the collection is null
- * @see AbstractCollection#remove(Object)
- * @see Collection#contains(Object)
- * @see Iterator#remove()
- */
- public boolean removeAll(Collection c)
- {
- int oldsize = size();
- int count = c.size();
- Iterator i;
- if (oldsize < count)
- {
- for (i = iterator(), count = oldsize; count > 0; count--)
- if (c.contains(i.next()))
- i.remove();
- }
- else
- for (i = c.iterator(); count > 0; count--)
- remove(i.next());
- return oldsize != size();
- }
-
-}
diff --git a/libjava/java/util/ArrayList.java b/libjava/java/util/ArrayList.java
deleted file mode 100644
index 82bcca8c3e0..00000000000
--- a/libjava/java/util/ArrayList.java
+++ /dev/null
@@ -1,591 +0,0 @@
-/* ArrayList.java -- JDK1.2's answer to Vector; this is an array-backed
- implementation of the List interface
- Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-
-/**
- * An array-backed implementation of the List interface. This implements
- * all optional list operations, and permits null elements, so that it is
- * better than Vector, which it replaces. Random access is roughly constant
- * time, and iteration is roughly linear time, so it is nice and fast, with
- * less overhead than a LinkedList.
- * <p>
- *
- * Each list has a capacity, and as the array reaches that capacity it
- * is automatically transferred to a larger array. You also have access to
- * ensureCapacity and trimToSize to control the backing array's size, avoiding
- * reallocation or wasted memory.
- * <p>
- *
- * ArrayList is not synchronized, so if you need multi-threaded access,
- * consider using:<br>
- * <code>List l = Collections.synchronizedList(new ArrayList(...));</code>
- * <p>
- *
- * The iterators are <i>fail-fast</i>, meaning that any structural
- * modification, except for <code>remove()</code> called on the iterator
- * itself, cause the iterator to throw a
- * {@link ConcurrentModificationException} rather than exhibit
- * non-deterministic behavior.
- *
- * @author Jon A. Zeppieri
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see List
- * @see LinkedList
- * @see Vector
- * @see Collections#synchronizedList(List)
- * @see AbstractList
- * @status updated to 1.4
- */
-public class ArrayList extends AbstractList
- implements List, RandomAccess, Cloneable, Serializable
-{
- /**
- * Compatible with JDK 1.2
- */
- private static final long serialVersionUID = 8683452581122892189L;
-
- /**
- * The default capacity for new ArrayLists.
- */
- private static final int DEFAULT_CAPACITY = 16;
-
- /**
- * The number of elements in this list.
- * @serial the list size
- */
- private int size;
-
- /**
- * Where the data is stored.
- */
- private transient Object[] data;
-
- /**
- * Construct a new ArrayList with the supplied initial capacity.
- *
- * @param capacity initial capacity of this ArrayList
- * @throws IllegalArgumentException if capacity is negative
- */
- public ArrayList(int capacity)
- {
- // Must explicitly check, to get correct exception.
- if (capacity < 0)
- throw new IllegalArgumentException();
- data = new Object[capacity];
- }
-
- /**
- * Construct a new ArrayList with the default capacity (16).
- */
- public ArrayList()
- {
- this(DEFAULT_CAPACITY);
- }
-
- /**
- * Construct a new ArrayList, and initialize it with the elements
- * in the supplied Collection. The initial capacity is 110% of the
- * Collection's size.
- *
- * @param c the collection whose elements will initialize this list
- * @throws NullPointerException if c is null
- */
- public ArrayList(Collection c)
- {
- this((int) (c.size() * 1.1f));
- addAll(c);
- }
-
- /**
- * Trims the capacity of this List to be equal to its size;
- * a memory saver.
- */
- public void trimToSize()
- {
- // Not a structural change from the perspective of iterators on this list,
- // so don't update modCount.
- if (size != data.length)
- {
- Object[] newData = new Object[size];
- System.arraycopy(data, 0, newData, 0, size);
- data = newData;
- }
- }
-
- /**
- * Guarantees that this list will have at least enough capacity to
- * hold minCapacity elements. This implementation will grow the list to
- * max(current * 2, minCapacity) if (minCapacity &gt; current). The JCL says
- * explictly that "this method increases its capacity to minCap", while
- * the JDK 1.3 online docs specify that the list will grow to at least the
- * size specified.
- *
- * @param minCapacity the minimum guaranteed capacity
- */
- public void ensureCapacity(int minCapacity)
- {
- int current = data.length;
-
- if (minCapacity > current)
- {
- Object[] newData = new Object[Math.max(current * 2, minCapacity)];
- System.arraycopy(data, 0, newData, 0, size);
- data = newData;
- }
- }
-
- /**
- * Returns the number of elements in this list.
- *
- * @return the list size
- */
- public int size()
- {
- return size;
- }
-
- /**
- * Checks if the list is empty.
- *
- * @return true if there are no elements
- */
- public boolean isEmpty()
- {
- return size == 0;
- }
-
- /**
- * Returns true iff element is in this ArrayList.
- *
- * @param e the element whose inclusion in the List is being tested
- * @return true if the list contains e
- */
- public boolean contains(Object e)
- {
- return indexOf(e) != -1;
- }
-
- /**
- * Returns the lowest index at which element appears in this List, or
- * -1 if it does not appear.
- *
- * @param e the element whose inclusion in the List is being tested
- * @return the index where e was found
- */
- public int indexOf(Object e)
- {
- for (int i = 0; i < size; i++)
- if (equals(e, data[i]))
- return i;
- return -1;
- }
-
- /**
- * Returns the highest index at which element appears in this List, or
- * -1 if it does not appear.
- *
- * @param e the element whose inclusion in the List is being tested
- * @return the index where e was found
- */
- public int lastIndexOf(Object e)
- {
- for (int i = size - 1; i >= 0; i--)
- if (equals(e, data[i]))
- return i;
- return -1;
- }
-
- /**
- * Creates a shallow copy of this ArrayList (elements are not cloned).
- *
- * @return the cloned object
- */
- public Object clone()
- {
- ArrayList clone = null;
- try
- {
- clone = (ArrayList) super.clone();
- clone.data = (Object[]) data.clone();
- }
- catch (CloneNotSupportedException e)
- {
- // Impossible to get here.
- }
- return clone;
- }
-
- /**
- * Returns an Object array containing all of the elements in this ArrayList.
- * The array is independent of this list.
- *
- * @return an array representation of this list
- */
- public Object[] toArray()
- {
- Object[] array = new Object[size];
- System.arraycopy(data, 0, array, 0, size);
- return array;
- }
-
- /**
- * Returns an Array whose component type is the runtime component type of
- * the passed-in Array. The returned Array is populated with all of the
- * elements in this ArrayList. If the passed-in Array is not large enough
- * to store all of the elements in this List, a new Array will be created
- * and returned; if the passed-in Array is <i>larger</i> than the size
- * of this List, then size() index will be set to null.
- *
- * @param a the passed-in Array
- * @return an array representation of this list
- * @throws ArrayStoreException if the runtime type of a does not allow
- * an element in this list
- * @throws NullPointerException if a is null
- */
- public Object[] toArray(Object[] a)
- {
- if (a.length < size)
- a = (Object[]) Array.newInstance(a.getClass().getComponentType(),
- size);
- else if (a.length > size)
- a[size] = null;
- System.arraycopy(data, 0, a, 0, size);
- return a;
- }
-
- /**
- * Retrieves the element at the user-supplied index.
- *
- * @param index the index of the element we are fetching
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object get(int index)
- {
- checkBoundExclusive(index);
- return data[index];
- }
-
- /**
- * Sets the element at the specified index. The new element, e,
- * can be an object of any type or null.
- *
- * @param index the index at which the element is being set
- * @param e the element to be set
- * @return the element previously at the specified index
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= 0
- */
- public Object set(int index, Object e)
- {
- checkBoundExclusive(index);
- Object result = data[index];
- data[index] = e;
- return result;
- }
-
- /**
- * Appends the supplied element to the end of this list.
- * The element, e, can be an object of any type or null.
- *
- * @param e the element to be appended to this list
- * @return true, the add will always succeed
- */
- public boolean add(Object e)
- {
- modCount++;
- if (size == data.length)
- ensureCapacity(size + 1);
- data[size++] = e;
- return true;
- }
-
- /**
- * Adds the supplied element at the specified index, shifting all
- * elements currently at that index or higher one to the right.
- * The element, e, can be an object of any type or null.
- *
- * @param index the index at which the element is being added
- * @param e the item being added
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- public void add(int index, Object e)
- {
- checkBoundInclusive(index);
- modCount++;
- if (size == data.length)
- ensureCapacity(size + 1);
- if (index != size)
- System.arraycopy(data, index, data, index + 1, size - index);
- data[index] = e;
- size++;
- }
-
- /**
- * Removes the element at the user-supplied index.
- *
- * @param index the index of the element to be removed
- * @return the removed Object
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object remove(int index)
- {
- checkBoundExclusive(index);
- Object r = data[index];
- modCount++;
- if (index != --size)
- System.arraycopy(data, index + 1, data, index, size - index);
- // Aid for garbage collection by releasing this pointer.
- data[size] = null;
- return r;
- }
-
- /**
- * Removes all elements from this List
- */
- public void clear()
- {
- if (size > 0)
- {
- modCount++;
- // Allow for garbage collection.
- Arrays.fill(data, 0, size, null);
- size = 0;
- }
- }
-
- /**
- * Add each element in the supplied Collection to this List. It is undefined
- * what happens if you modify the list while this is taking place; for
- * example, if the collection contains this list. c can contain objects
- * of any type, as well as null values.
- *
- * @param c a Collection containing elements to be added to this List
- * @return true if the list was modified, in other words c is not empty
- * @throws NullPointerException if c is null
- */
- public boolean addAll(Collection c)
- {
- return addAll(size, c);
- }
-
- /**
- * Add all elements in the supplied collection, inserting them beginning
- * at the specified index. c can contain objects of any type, as well
- * as null values.
- *
- * @param index the index at which the elements will be inserted
- * @param c the Collection containing the elements to be inserted
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; 0
- * @throws NullPointerException if c is null
- */
- public boolean addAll(int index, Collection c)
- {
- checkBoundInclusive(index);
- Iterator itr = c.iterator();
- int csize = c.size();
-
- modCount++;
- if (csize + size > data.length)
- ensureCapacity(size + csize);
- int end = index + csize;
- if (size > 0 && index != size)
- System.arraycopy(data, index, data, end, size - index);
- size += csize;
- for ( ; index < end; index++)
- data[index] = itr.next();
- return csize > 0;
- }
-
- /**
- * Removes all elements in the half-open interval [fromIndex, toIndex).
- * Does nothing when toIndex is equal to fromIndex.
- *
- * @param fromIndex the first index which will be removed
- * @param toIndex one greater than the last index which will be removed
- * @throws IndexOutOfBoundsException if fromIndex &gt; toIndex
- */
- protected void removeRange(int fromIndex, int toIndex)
- {
- int change = toIndex - fromIndex;
- if (change > 0)
- {
- modCount++;
- System.arraycopy(data, toIndex, data, fromIndex, size - toIndex);
- size -= change;
- }
- else if (change < 0)
- throw new IndexOutOfBoundsException();
- }
-
- /**
- * Checks that the index is in the range of possible elements (inclusive).
- *
- * @param index the index to check
- * @throws IndexOutOfBoundsException if index &gt; size
- */
- private void checkBoundInclusive(int index)
- {
- // Implementation note: we do not check for negative ranges here, since
- // use of a negative index will cause an ArrayIndexOutOfBoundsException,
- // a subclass of the required exception, with no effort on our part.
- if (index > size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
- + size);
- }
-
- /**
- * Checks that the index is in the range of existing elements (exclusive).
- *
- * @param index the index to check
- * @throws IndexOutOfBoundsException if index &gt;= size
- */
- private void checkBoundExclusive(int index)
- {
- // Implementation note: we do not check for negative ranges here, since
- // use of a negative index will cause an ArrayIndexOutOfBoundsException,
- // a subclass of the required exception, with no effort on our part.
- if (index >= size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
- + size);
- }
-
- /**
- * Remove from this list all elements contained in the given collection.
- * This is not public, due to Sun's API, but this performs in linear
- * time while the default behavior of AbstractList would be quadratic.
- *
- * @param c the collection to filter out
- * @return true if this list changed
- * @throws NullPointerException if c is null
- */
- boolean removeAllInternal(Collection c)
- {
- int i;
- int j;
- for (i = 0; i < size; i++)
- if (c.contains(data[i]))
- break;
- if (i == size)
- return false;
-
- modCount++;
- for (j = i++; i < size; i++)
- if (! c.contains(data[i]))
- data[j++] = data[i];
- size -= i - j;
- return true;
- }
-
- /**
- * Retain in this vector only the elements contained in the given collection.
- * This is not public, due to Sun's API, but this performs in linear
- * time while the default behavior of AbstractList would be quadratic.
- *
- * @param c the collection to filter by
- * @return true if this vector changed
- * @throws NullPointerException if c is null
- * @since 1.2
- */
- boolean retainAllInternal(Collection c)
- {
- int i;
- int j;
- for (i = 0; i < size; i++)
- if (! c.contains(data[i]))
- break;
- if (i == size)
- return false;
-
- modCount++;
- for (j = i++; i < size; i++)
- if (c.contains(data[i]))
- data[j++] = data[i];
- size -= i - j;
- return true;
- }
-
- /**
- * Serializes this object to the given stream.
- *
- * @param out the stream to write to
- * @throws IOException if the underlying stream fails
- * @serialData the size field (int), the length of the backing array
- * (int), followed by its elements (Objects) in proper order.
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- // The 'size' field.
- s.defaultWriteObject();
- // We serialize unused list entries to preserve capacity.
- int len = data.length;
- s.writeInt(len);
- // it would be more efficient to just write "size" items,
- // this need readObject read "size" items too.
- for (int i = 0; i < size; i++)
- s.writeObject(data[i]);
- }
-
- /**
- * Deserializes this object from the given stream.
- *
- * @param in the stream to read from
- * @throws ClassNotFoundException if the underlying stream fails
- * @throws IOException if the underlying stream fails
- * @serialData the size field (int), the length of the backing array
- * (int), followed by its elements (Objects) in proper order.
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- // the `size' field.
- s.defaultReadObject();
- int capacity = s.readInt();
- data = new Object[capacity];
- for (int i = 0; i < size; i++)
- data[i] = s.readObject();
- }
-}
diff --git a/libjava/java/util/Arrays.java b/libjava/java/util/Arrays.java
deleted file mode 100644
index 15c1a5f33bf..00000000000
--- a/libjava/java/util/Arrays.java
+++ /dev/null
@@ -1,2510 +0,0 @@
-/* Arrays.java -- Utility class with methods to operate on arrays
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.Serializable;
-import java.lang.reflect.Array;
-
-/**
- * This class contains various static utility methods performing operations on
- * arrays, and a method to provide a List "view" of an array to facilitate
- * using arrays with Collection-based APIs. All methods throw a
- * {@link NullPointerException} if the parameter array is null.
- * <p>
- *
- * Implementations may use their own algorithms, but must obey the general
- * properties; for example, the sort must be stable and n*log(n) complexity.
- * Sun's implementation of sort, and therefore ours, is a tuned quicksort,
- * adapted from Jon L. Bentley and M. Douglas McIlroy's "Engineering a Sort
- * Function", Software-Practice and Experience, Vol. 23(11) P. 1249-1265
- * (November 1993). This algorithm offers n*log(n) performance on many data
- * sets that cause other quicksorts to degrade to quadratic performance.
- *
- * @author Original author unknown
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Comparable
- * @see Comparator
- * @since 1.2
- * @status updated to 1.4
- */
-public class Arrays
-{
- /**
- * This class is non-instantiable.
- */
- private Arrays()
- {
- }
-
-
-// binarySearch
- /**
- * Perform a binary search of a byte array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(byte[] a, byte key)
- {
- int low = 0;
- int hi = a.length - 1;
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >> 1;
- final byte d = a[mid];
- if (d == key)
- return mid;
- else if (d > key)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop.
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of a char array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(char[] a, char key)
- {
- int low = 0;
- int hi = a.length - 1;
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >> 1;
- final char d = a[mid];
- if (d == key)
- return mid;
- else if (d > key)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop.
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of a short array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(short[] a, short key)
- {
- int low = 0;
- int hi = a.length - 1;
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >> 1;
- final short d = a[mid];
- if (d == key)
- return mid;
- else if (d > key)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop.
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of an int array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(int[] a, int key)
- {
- int low = 0;
- int hi = a.length - 1;
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >> 1;
- final int d = a[mid];
- if (d == key)
- return mid;
- else if (d > key)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop.
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of a long array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(long[] a, long key)
- {
- int low = 0;
- int hi = a.length - 1;
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >> 1;
- final long d = a[mid];
- if (d == key)
- return mid;
- else if (d > key)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop.
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of a float array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(float[] a, float key)
- {
- // Must use Float.compare to take into account NaN, +-0.
- int low = 0;
- int hi = a.length - 1;
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >> 1;
- final int r = Float.compare(a[mid], key);
- if (r == 0)
- return mid;
- else if (r > 0)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of a double array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(double[] a, double key)
- {
- // Must use Double.compare to take into account NaN, +-0.
- int low = 0;
- int hi = a.length - 1;
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >> 1;
- final int r = Double.compare(a[mid], key);
- if (r == 0)
- return mid;
- else if (r > 0)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of an Object array for a key, using the natural
- * ordering of the elements. The array must be sorted (as by the sort()
- * method) - if it is not, the behaviour of this method is undefined, and may
- * be an infinite loop. Further, the key must be comparable with every item
- * in the array. If the array contains the key more than once, any one of
- * them may be found. Note: although the specification allows for an infinite
- * loop if the array is unsorted, it will not happen in this (JCL)
- * implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws ClassCastException if key could not be compared with one of the
- * elements of a
- * @throws NullPointerException if a null element in a is compared
- */
- public static int binarySearch(Object[] a, Object key)
- {
- return binarySearch(a, key, null);
- }
-
- /**
- * Perform a binary search of an Object array for a key, using a supplied
- * Comparator. The array must be sorted (as by the sort() method with the
- * same Comparator) - if it is not, the behaviour of this method is
- * undefined, and may be an infinite loop. Further, the key must be
- * comparable with every item in the array. If the array contains the key
- * more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this (JCL) implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @param c the comparator by which the array is sorted; or null to
- * use the elements' natural order
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws ClassCastException if key could not be compared with one of the
- * elements of a
- * @throws NullPointerException if a null element is compared with natural
- * ordering (only possible when c is null)
- */
- public static int binarySearch(Object[] a, Object key, Comparator c)
- {
- int low = 0;
- int hi = a.length - 1;
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >> 1;
- final int d = Collections.compare(key, a[mid], c);
- if (d == 0)
- return mid;
- else if (d < 0)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop
- low = ++mid;
- }
- return -mid - 1;
- }
-
-
-// equals
- /**
- * Compare two boolean arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(boolean[] a1, boolean[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- if (null == a1 || null == a2)
- return false;
-
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- return false;
- }
-
- /**
- * Compare two byte arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(byte[] a1, byte[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- if (null == a1 || null == a2)
- return false;
-
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- return false;
- }
-
- /**
- * Compare two char arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(char[] a1, char[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- if (null == a1 || null == a2)
- return false;
-
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- return false;
- }
-
- /**
- * Compare two short arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(short[] a1, short[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- if (null == a1 || null == a2)
- return false;
-
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- return false;
- }
-
- /**
- * Compare two int arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(int[] a1, int[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- if (null == a1 || null == a2)
- return false;
-
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- return false;
- }
-
- /**
- * Compare two long arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(long[] a1, long[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- if (null == a1 || null == a2)
- return false;
-
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- return false;
- }
-
- /**
- * Compare two float arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(float[] a1, float[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- if (null == a1 || null == a2)
- return false;
-
- // Must use Float.compare to take into account NaN, +-0.
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (Float.compare(a1[i], a2[i]) != 0)
- return false;
- return true;
- }
- return false;
- }
-
- /**
- * Compare two double arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(double[] a1, double[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- if (null == a1 || null == a2)
- return false;
-
- // Must use Double.compare to take into account NaN, +-0.
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (Double.compare(a1[i], a2[i]) != 0)
- return false;
- return true;
- }
- return false;
- }
-
- /**
- * Compare two Object arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a1 is of the same length
- * as a2, and for each 0 <= i < a.length, a1[i] == null ?
- * a2[i] == null : a1[i].equals(a2[i]).
- */
- public static boolean equals(Object[] a1, Object[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- if (null == a1 || null == a2)
- return false;
-
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (! AbstractCollection.equals(a1[i], a2[i]))
- return false;
- return true;
- }
- return false;
- }
-
-
-// fill
- /**
- * Fill an array with a boolean value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(boolean[] a, boolean val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a boolean value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void fill(boolean[] a, int fromIndex, int toIndex, boolean val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a byte value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(byte[] a, byte val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a byte value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void fill(byte[] a, int fromIndex, int toIndex, byte val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a char value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(char[] a, char val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a char value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void fill(char[] a, int fromIndex, int toIndex, char val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a short value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(short[] a, short val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a short value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void fill(short[] a, int fromIndex, int toIndex, short val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with an int value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(int[] a, int val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with an int value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void fill(int[] a, int fromIndex, int toIndex, int val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a long value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(long[] a, long val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a long value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void fill(long[] a, int fromIndex, int toIndex, long val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a float value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(float[] a, float val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a float value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void fill(float[] a, int fromIndex, int toIndex, float val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a double value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(double[] a, double val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a double value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void fill(double[] a, int fromIndex, int toIndex, double val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with an Object value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- * @throws ClassCastException if val is not an instance of the element
- * type of a.
- */
- public static void fill(Object[] a, Object val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with an Object value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws ClassCastException if val is not an instance of the element
- * type of a.
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void fill(Object[] a, int fromIndex, int toIndex, Object val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
-
-// sort
- // Thanks to Paul Fisher (rao@gnu.org) for finding this quicksort algorithm
- // as specified by Sun and porting it to Java. The algorithm is an optimised
- // quicksort, as described in Jon L. Bentley and M. Douglas McIlroy's
- // "Engineering a Sort Function", Software-Practice and Experience, Vol.
- // 23(11) P. 1249-1265 (November 1993). This algorithm gives n*log(n)
- // performance on many arrays that would take quadratic time with a standard
- // quicksort.
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the byte array to sort
- */
- public static void sort(byte[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the byte array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void sort(byte[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, byte[] d)
- {
- return (d[a] < d[b]
- ? (d[b] < d[c] ? b : d[a] < d[c] ? c : a)
- : (d[b] > d[c] ? b : d[a] > d[c] ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, byte[] a)
- {
- byte c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, byte[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Performs a recursive modified quicksort.
- *
- * @param array the array to sort
- * @param from the start index (inclusive)
- * @param count the number of elements to sort
- */
- private static void qsort(byte[] array, int from, int count)
- {
- // Use an insertion sort on small arrays.
- if (count <= 7)
- {
- for (int i = from + 1; i < from + count; i++)
- for (int j = i; j > from && array[j - 1] > array[j]; j--)
- swap(j, j - 1, array);
- return;
- }
-
- // Determine a good median element.
- int mid = count / 2;
- int lo = from;
- int hi = from + count - 1;
-
- if (count > 40)
- { // big arrays, pseudomedian of 9
- int s = count / 8;
- lo = med3(lo, lo + s, lo + 2 * s, array);
- mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - 2 * s, hi - s, hi, array);
- }
- mid = med3(lo, mid, hi, array);
-
- int a, b, c, d;
- int comp;
-
- // Pull the median element out of the fray, and use it as a pivot.
- swap(from, mid, array);
- a = b = from;
- c = d = from + count - 1;
-
- // Repeatedly move b and c to each other, swapping elements so
- // that all elements before index b are less than the pivot, and all
- // elements after index c are greater than the pivot. a and b track
- // the elements equal to the pivot.
- while (true)
- {
- while (b <= c && (comp = array[b] - array[from]) <= 0)
- {
- if (comp == 0)
- {
- swap(a, b, array);
- a++;
- }
- b++;
- }
- while (c >= b && (comp = array[c] - array[from]) >= 0)
- {
- if (comp == 0)
- {
- swap(c, d, array);
- d--;
- }
- c--;
- }
- if (b > c)
- break;
- swap(b, c, array);
- b++;
- c--;
- }
-
- // Swap pivot(s) back in place, the recurse on left and right sections.
- hi = from + count;
- int span;
- span = Math.min(a - from, b - a);
- vecswap(from, b - span, span, array);
-
- span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span, span, array);
-
- span = b - a;
- if (span > 1)
- qsort(array, from, span);
-
- span = d - c;
- if (span > 1)
- qsort(array, hi - span, span);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the char array to sort
- */
- public static void sort(char[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the char array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void sort(char[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, char[] d)
- {
- return (d[a] < d[b]
- ? (d[b] < d[c] ? b : d[a] < d[c] ? c : a)
- : (d[b] > d[c] ? b : d[a] > d[c] ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, char[] a)
- {
- char c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, char[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Performs a recursive modified quicksort.
- *
- * @param array the array to sort
- * @param from the start index (inclusive)
- * @param count the number of elements to sort
- */
- private static void qsort(char[] array, int from, int count)
- {
- // Use an insertion sort on small arrays.
- if (count <= 7)
- {
- for (int i = from + 1; i < from + count; i++)
- for (int j = i; j > from && array[j - 1] > array[j]; j--)
- swap(j, j - 1, array);
- return;
- }
-
- // Determine a good median element.
- int mid = count / 2;
- int lo = from;
- int hi = from + count - 1;
-
- if (count > 40)
- { // big arrays, pseudomedian of 9
- int s = count / 8;
- lo = med3(lo, lo + s, lo + 2 * s, array);
- mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - 2 * s, hi - s, hi, array);
- }
- mid = med3(lo, mid, hi, array);
-
- int a, b, c, d;
- int comp;
-
- // Pull the median element out of the fray, and use it as a pivot.
- swap(from, mid, array);
- a = b = from;
- c = d = from + count - 1;
-
- // Repeatedly move b and c to each other, swapping elements so
- // that all elements before index b are less than the pivot, and all
- // elements after index c are greater than the pivot. a and b track
- // the elements equal to the pivot.
- while (true)
- {
- while (b <= c && (comp = array[b] - array[from]) <= 0)
- {
- if (comp == 0)
- {
- swap(a, b, array);
- a++;
- }
- b++;
- }
- while (c >= b && (comp = array[c] - array[from]) >= 0)
- {
- if (comp == 0)
- {
- swap(c, d, array);
- d--;
- }
- c--;
- }
- if (b > c)
- break;
- swap(b, c, array);
- b++;
- c--;
- }
-
- // Swap pivot(s) back in place, the recurse on left and right sections.
- hi = from + count;
- int span;
- span = Math.min(a - from, b - a);
- vecswap(from, b - span, span, array);
-
- span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span, span, array);
-
- span = b - a;
- if (span > 1)
- qsort(array, from, span);
-
- span = d - c;
- if (span > 1)
- qsort(array, hi - span, span);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the short array to sort
- */
- public static void sort(short[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the short array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void sort(short[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, short[] d)
- {
- return (d[a] < d[b]
- ? (d[b] < d[c] ? b : d[a] < d[c] ? c : a)
- : (d[b] > d[c] ? b : d[a] > d[c] ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, short[] a)
- {
- short c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, short[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Performs a recursive modified quicksort.
- *
- * @param array the array to sort
- * @param from the start index (inclusive)
- * @param count the number of elements to sort
- */
- private static void qsort(short[] array, int from, int count)
- {
- // Use an insertion sort on small arrays.
- if (count <= 7)
- {
- for (int i = from + 1; i < from + count; i++)
- for (int j = i; j > from && array[j - 1] > array[j]; j--)
- swap(j, j - 1, array);
- return;
- }
-
- // Determine a good median element.
- int mid = count / 2;
- int lo = from;
- int hi = from + count - 1;
-
- if (count > 40)
- { // big arrays, pseudomedian of 9
- int s = count / 8;
- lo = med3(lo, lo + s, lo + 2 * s, array);
- mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - 2 * s, hi - s, hi, array);
- }
- mid = med3(lo, mid, hi, array);
-
- int a, b, c, d;
- int comp;
-
- // Pull the median element out of the fray, and use it as a pivot.
- swap(from, mid, array);
- a = b = from;
- c = d = from + count - 1;
-
- // Repeatedly move b and c to each other, swapping elements so
- // that all elements before index b are less than the pivot, and all
- // elements after index c are greater than the pivot. a and b track
- // the elements equal to the pivot.
- while (true)
- {
- while (b <= c && (comp = array[b] - array[from]) <= 0)
- {
- if (comp == 0)
- {
- swap(a, b, array);
- a++;
- }
- b++;
- }
- while (c >= b && (comp = array[c] - array[from]) >= 0)
- {
- if (comp == 0)
- {
- swap(c, d, array);
- d--;
- }
- c--;
- }
- if (b > c)
- break;
- swap(b, c, array);
- b++;
- c--;
- }
-
- // Swap pivot(s) back in place, the recurse on left and right sections.
- hi = from + count;
- int span;
- span = Math.min(a - from, b - a);
- vecswap(from, b - span, span, array);
-
- span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span, span, array);
-
- span = b - a;
- if (span > 1)
- qsort(array, from, span);
-
- span = d - c;
- if (span > 1)
- qsort(array, hi - span, span);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the int array to sort
- */
- public static void sort(int[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the int array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void sort(int[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, int[] d)
- {
- return (d[a] < d[b]
- ? (d[b] < d[c] ? b : d[a] < d[c] ? c : a)
- : (d[b] > d[c] ? b : d[a] > d[c] ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, int[] a)
- {
- int c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, int[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Compares two integers in natural order, since a - b is inadequate.
- *
- * @param a the first int
- * @param b the second int
- * @return &lt; 0, 0, or &gt; 0 accorting to the comparison
- */
- private static int compare(int a, int b)
- {
- return a < b ? -1 : a == b ? 0 : 1;
- }
-
- /**
- * Performs a recursive modified quicksort.
- *
- * @param array the array to sort
- * @param from the start index (inclusive)
- * @param count the number of elements to sort
- */
- private static void qsort(int[] array, int from, int count)
- {
- // Use an insertion sort on small arrays.
- if (count <= 7)
- {
- for (int i = from + 1; i < from + count; i++)
- for (int j = i; j > from && array[j - 1] > array[j]; j--)
- swap(j, j - 1, array);
- return;
- }
-
- // Determine a good median element.
- int mid = count / 2;
- int lo = from;
- int hi = from + count - 1;
-
- if (count > 40)
- { // big arrays, pseudomedian of 9
- int s = count / 8;
- lo = med3(lo, lo + s, lo + 2 * s, array);
- mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - 2 * s, hi - s, hi, array);
- }
- mid = med3(lo, mid, hi, array);
-
- int a, b, c, d;
- int comp;
-
- // Pull the median element out of the fray, and use it as a pivot.
- swap(from, mid, array);
- a = b = from;
- c = d = from + count - 1;
-
- // Repeatedly move b and c to each other, swapping elements so
- // that all elements before index b are less than the pivot, and all
- // elements after index c are greater than the pivot. a and b track
- // the elements equal to the pivot.
- while (true)
- {
- while (b <= c && (comp = compare(array[b], array[from])) <= 0)
- {
- if (comp == 0)
- {
- swap(a, b, array);
- a++;
- }
- b++;
- }
- while (c >= b && (comp = compare(array[c], array[from])) >= 0)
- {
- if (comp == 0)
- {
- swap(c, d, array);
- d--;
- }
- c--;
- }
- if (b > c)
- break;
- swap(b, c, array);
- b++;
- c--;
- }
-
- // Swap pivot(s) back in place, the recurse on left and right sections.
- hi = from + count;
- int span;
- span = Math.min(a - from, b - a);
- vecswap(from, b - span, span, array);
-
- span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span, span, array);
-
- span = b - a;
- if (span > 1)
- qsort(array, from, span);
-
- span = d - c;
- if (span > 1)
- qsort(array, hi - span, span);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the long array to sort
- */
- public static void sort(long[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the long array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void sort(long[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, long[] d)
- {
- return (d[a] < d[b]
- ? (d[b] < d[c] ? b : d[a] < d[c] ? c : a)
- : (d[b] > d[c] ? b : d[a] > d[c] ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, long[] a)
- {
- long c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, long[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Compares two longs in natural order, since a - b is inadequate.
- *
- * @param a the first long
- * @param b the second long
- * @return &lt; 0, 0, or &gt; 0 accorting to the comparison
- */
- private static int compare(long a, long b)
- {
- return a < b ? -1 : a == b ? 0 : 1;
- }
-
- /**
- * Performs a recursive modified quicksort.
- *
- * @param array the array to sort
- * @param from the start index (inclusive)
- * @param count the number of elements to sort
- */
- private static void qsort(long[] array, int from, int count)
- {
- // Use an insertion sort on small arrays.
- if (count <= 7)
- {
- for (int i = from + 1; i < from + count; i++)
- for (int j = i; j > from && array[j - 1] > array[j]; j--)
- swap(j, j - 1, array);
- return;
- }
-
- // Determine a good median element.
- int mid = count / 2;
- int lo = from;
- int hi = from + count - 1;
-
- if (count > 40)
- { // big arrays, pseudomedian of 9
- int s = count / 8;
- lo = med3(lo, lo + s, lo + 2 * s, array);
- mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - 2 * s, hi - s, hi, array);
- }
- mid = med3(lo, mid, hi, array);
-
- int a, b, c, d;
- int comp;
-
- // Pull the median element out of the fray, and use it as a pivot.
- swap(from, mid, array);
- a = b = from;
- c = d = from + count - 1;
-
- // Repeatedly move b and c to each other, swapping elements so
- // that all elements before index b are less than the pivot, and all
- // elements after index c are greater than the pivot. a and b track
- // the elements equal to the pivot.
- while (true)
- {
- while (b <= c && (comp = compare(array[b], array[from])) <= 0)
- {
- if (comp == 0)
- {
- swap(a, b, array);
- a++;
- }
- b++;
- }
- while (c >= b && (comp = compare(array[c], array[from])) >= 0)
- {
- if (comp == 0)
- {
- swap(c, d, array);
- d--;
- }
- c--;
- }
- if (b > c)
- break;
- swap(b, c, array);
- b++;
- c--;
- }
-
- // Swap pivot(s) back in place, the recurse on left and right sections.
- hi = from + count;
- int span;
- span = Math.min(a - from, b - a);
- vecswap(from, b - span, span, array);
-
- span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span, span, array);
-
- span = b - a;
- if (span > 1)
- qsort(array, from, span);
-
- span = d - c;
- if (span > 1)
- qsort(array, hi - span, span);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the float array to sort
- */
- public static void sort(float[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the float array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void sort(float[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, float[] d)
- {
- return (Float.compare(d[a], d[b]) < 0
- ? (Float.compare(d[b], d[c]) < 0 ? b
- : Float.compare(d[a], d[c]) < 0 ? c : a)
- : (Float.compare(d[b], d[c]) > 0 ? b
- : Float.compare(d[a], d[c]) > 0 ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, float[] a)
- {
- float c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, float[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Performs a recursive modified quicksort.
- *
- * @param array the array to sort
- * @param from the start index (inclusive)
- * @param count the number of elements to sort
- */
- private static void qsort(float[] array, int from, int count)
- {
- // Use an insertion sort on small arrays.
- if (count <= 7)
- {
- for (int i = from + 1; i < from + count; i++)
- for (int j = i;
- j > from && Float.compare(array[j - 1], array[j]) > 0;
- j--)
- {
- swap(j, j - 1, array);
- }
- return;
- }
-
- // Determine a good median element.
- int mid = count / 2;
- int lo = from;
- int hi = from + count - 1;
-
- if (count > 40)
- { // big arrays, pseudomedian of 9
- int s = count / 8;
- lo = med3(lo, lo + s, lo + 2 * s, array);
- mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - 2 * s, hi - s, hi, array);
- }
- mid = med3(lo, mid, hi, array);
-
- int a, b, c, d;
- int comp;
-
- // Pull the median element out of the fray, and use it as a pivot.
- swap(from, mid, array);
- a = b = from;
- c = d = from + count - 1;
-
- // Repeatedly move b and c to each other, swapping elements so
- // that all elements before index b are less than the pivot, and all
- // elements after index c are greater than the pivot. a and b track
- // the elements equal to the pivot.
- while (true)
- {
- while (b <= c && (comp = Float.compare(array[b], array[from])) <= 0)
- {
- if (comp == 0)
- {
- swap(a, b, array);
- a++;
- }
- b++;
- }
- while (c >= b && (comp = Float.compare(array[c], array[from])) >= 0)
- {
- if (comp == 0)
- {
- swap(c, d, array);
- d--;
- }
- c--;
- }
- if (b > c)
- break;
- swap(b, c, array);
- b++;
- c--;
- }
-
- // Swap pivot(s) back in place, the recurse on left and right sections.
- hi = from + count;
- int span;
- span = Math.min(a - from, b - a);
- vecswap(from, b - span, span, array);
-
- span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span, span, array);
-
- span = b - a;
- if (span > 1)
- qsort(array, from, span);
-
- span = d - c;
- if (span > 1)
- qsort(array, hi - span, span);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the double array to sort
- */
- public static void sort(double[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the double array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; a.length
- */
- public static void sort(double[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, double[] d)
- {
- return (Double.compare(d[a], d[b]) < 0
- ? (Double.compare(d[b], d[c]) < 0 ? b
- : Double.compare(d[a], d[c]) < 0 ? c : a)
- : (Double.compare(d[b], d[c]) > 0 ? b
- : Double.compare(d[a], d[c]) > 0 ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, double[] a)
- {
- double c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, double[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Performs a recursive modified quicksort.
- *
- * @param array the array to sort
- * @param from the start index (inclusive)
- * @param count the number of elements to sort
- */
- private static void qsort(double[] array, int from, int count)
- {
- // Use an insertion sort on small arrays.
- if (count <= 7)
- {
- for (int i = from + 1; i < from + count; i++)
- for (int j = i;
- j > from && Double.compare(array[j - 1], array[j]) > 0;
- j--)
- {
- swap(j, j - 1, array);
- }
- return;
- }
-
- // Determine a good median element.
- int mid = count / 2;
- int lo = from;
- int hi = from + count - 1;
-
- if (count > 40)
- { // big arrays, pseudomedian of 9
- int s = count / 8;
- lo = med3(lo, lo + s, lo + 2 * s, array);
- mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - 2 * s, hi - s, hi, array);
- }
- mid = med3(lo, mid, hi, array);
-
- int a, b, c, d;
- int comp;
-
- // Pull the median element out of the fray, and use it as a pivot.
- swap(from, mid, array);
- a = b = from;
- c = d = from + count - 1;
-
- // Repeatedly move b and c to each other, swapping elements so
- // that all elements before index b are less than the pivot, and all
- // elements after index c are greater than the pivot. a and b track
- // the elements equal to the pivot.
- while (true)
- {
- while (b <= c && (comp = Double.compare(array[b], array[from])) <= 0)
- {
- if (comp == 0)
- {
- swap(a, b, array);
- a++;
- }
- b++;
- }
- while (c >= b && (comp = Double.compare(array[c], array[from])) >= 0)
- {
- if (comp == 0)
- {
- swap(c, d, array);
- d--;
- }
- c--;
- }
- if (b > c)
- break;
- swap(b, c, array);
- b++;
- c--;
- }
-
- // Swap pivot(s) back in place, the recurse on left and right sections.
- hi = from + count;
- int span;
- span = Math.min(a - from, b - a);
- vecswap(from, b - span, span, array);
-
- span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span, span, array);
-
- span = b - a;
- if (span > 1)
- qsort(array, from, span);
-
- span = d - c;
- if (span > 1)
- qsort(array, hi - span, span);
- }
-
- /**
- * Sort an array of Objects according to their natural ordering. The sort is
- * guaranteed to be stable, that is, equal elements will not be reordered.
- * The sort algorithm is a mergesort with the merge omitted if the last
- * element of one half comes before the first element of the other half. This
- * algorithm gives guaranteed O(n*log(n)) time, at the expense of making a
- * copy of the array.
- *
- * @param a the array to be sorted
- * @throws ClassCastException if any two elements are not mutually
- * comparable
- * @throws NullPointerException if an element is null (since
- * null.compareTo cannot work)
- * @see Comparable
- */
- public static void sort(Object[] a)
- {
- sort(a, 0, a.length, null);
- }
-
- /**
- * Sort an array of Objects according to a Comparator. The sort is
- * guaranteed to be stable, that is, equal elements will not be reordered.
- * The sort algorithm is a mergesort with the merge omitted if the last
- * element of one half comes before the first element of the other half. This
- * algorithm gives guaranteed O(n*log(n)) time, at the expense of making a
- * copy of the array.
- *
- * @param a the array to be sorted
- * @param c a Comparator to use in sorting the array; or null to indicate
- * the elements' natural order
- * @throws ClassCastException if any two elements are not mutually
- * comparable by the Comparator provided
- * @throws NullPointerException if a null element is compared with natural
- * ordering (only possible when c is null)
- */
- public static void sort(Object[] a, Comparator c)
- {
- sort(a, 0, a.length, c);
- }
-
- /**
- * Sort an array of Objects according to their natural ordering. The sort is
- * guaranteed to be stable, that is, equal elements will not be reordered.
- * The sort algorithm is a mergesort with the merge omitted if the last
- * element of one half comes before the first element of the other half. This
- * algorithm gives guaranteed O(n*log(n)) time, at the expense of making a
- * copy of the array.
- *
- * @param a the array to be sorted
- * @param fromIndex the index of the first element to be sorted
- * @param toIndex the index of the last element to be sorted plus one
- * @throws ClassCastException if any two elements are not mutually
- * comparable
- * @throws NullPointerException if an element is null (since
- * null.compareTo cannot work)
- * @throws ArrayIndexOutOfBoundsException if fromIndex and toIndex
- * are not in range.
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- */
- public static void sort(Object[] a, int fromIndex, int toIndex)
- {
- sort(a, fromIndex, toIndex, null);
- }
-
- /**
- * Sort an array of Objects according to a Comparator. The sort is
- * guaranteed to be stable, that is, equal elements will not be reordered.
- * The sort algorithm is a mergesort with the merge omitted if the last
- * element of one half comes before the first element of the other half. This
- * algorithm gives guaranteed O(n*log(n)) time, at the expense of making a
- * copy of the array.
- *
- * @param a the array to be sorted
- * @param fromIndex the index of the first element to be sorted
- * @param toIndex the index of the last element to be sorted plus one
- * @param c a Comparator to use in sorting the array; or null to indicate
- * the elements' natural order
- * @throws ClassCastException if any two elements are not mutually
- * comparable by the Comparator provided
- * @throws ArrayIndexOutOfBoundsException if fromIndex and toIndex
- * are not in range.
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @throws NullPointerException if a null element is compared with natural
- * ordering (only possible when c is null)
- */
- public static void sort(Object[] a, int fromIndex, int toIndex, Comparator c)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException("fromIndex " + fromIndex
- + " > toIndex " + toIndex);
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
-
- // In general, the code attempts to be simple rather than fast, the
- // idea being that a good optimising JIT will be able to optimise it
- // better than I can, and if I try it will make it more confusing for
- // the JIT. First presort the array in chunks of length 6 with insertion
- // sort. A mergesort would give too much overhead for this length.
- for (int chunk = fromIndex; chunk < toIndex; chunk += 6)
- {
- int end = Math.min(chunk + 6, toIndex);
- for (int i = chunk + 1; i < end; i++)
- {
- if (Collections.compare(a[i - 1], a[i], c) > 0)
- {
- // not already sorted
- int j = i;
- Object elem = a[j];
- do
- {
- a[j] = a[j - 1];
- j--;
- }
- while (j > chunk
- && Collections.compare(a[j - 1], elem, c) > 0);
- a[j] = elem;
- }
- }
- }
-
- int len = toIndex - fromIndex;
- // If length is smaller or equal 6 we are done.
- if (len <= 6)
- return;
-
- Object[] src = a;
- Object[] dest = new Object[len];
- Object[] t = null; // t is used for swapping src and dest
-
- // The difference of the fromIndex of the src and dest array.
- int srcDestDiff = -fromIndex;
-
- // The merges are done in this loop
- for (int size = 6; size < len; size <<= 1)
- {
- for (int start = fromIndex; start < toIndex; start += size << 1)
- {
- // mid is the start of the second sublist;
- // end the start of the next sublist (or end of array).
- int mid = start + size;
- int end = Math.min(toIndex, mid + size);
-
- // The second list is empty or the elements are already in
- // order - no need to merge
- if (mid >= end
- || Collections.compare(src[mid - 1], src[mid], c) <= 0)
- {
- System.arraycopy(src, start,
- dest, start + srcDestDiff, end - start);
-
- // The two halves just need swapping - no need to merge
- }
- else if (Collections.compare(src[start], src[end - 1], c) > 0)
- {
- System.arraycopy(src, start,
- dest, end - size + srcDestDiff, size);
- System.arraycopy(src, mid,
- dest, start + srcDestDiff, end - mid);
-
- }
- else
- {
- // Declare a lot of variables to save repeating
- // calculations. Hopefully a decent JIT will put these
- // in registers and make this fast
- int p1 = start;
- int p2 = mid;
- int i = start + srcDestDiff;
-
- // The main merge loop; terminates as soon as either
- // half is ended
- while (p1 < mid && p2 < end)
- {
- dest[i++] =
- src[(Collections.compare(src[p1], src[p2], c) <= 0
- ? p1++ : p2++)];
- }
-
- // Finish up by copying the remainder of whichever half
- // wasn't finished.
- if (p1 < mid)
- System.arraycopy(src, p1, dest, i, mid - p1);
- else
- System.arraycopy(src, p2, dest, i, end - p2);
- }
- }
- // swap src and dest ready for the next merge
- t = src;
- src = dest;
- dest = t;
- fromIndex += srcDestDiff;
- toIndex += srcDestDiff;
- srcDestDiff = -srcDestDiff;
- }
-
- // make sure the result ends up back in the right place. Note
- // that src and dest may have been swapped above, so src
- // contains the sorted array.
- if (src != a)
- {
- // Note that fromIndex == 0.
- System.arraycopy(src, 0, a, srcDestDiff, toIndex);
- }
- }
-
- /**
- * Returns a list "view" of the specified array. This method is intended to
- * make it easy to use the Collections API with existing array-based APIs and
- * programs. Changes in the list or the array show up in both places. The
- * list does not support element addition or removal, but does permit
- * value modification. The returned list implements both Serializable and
- * RandomAccess.
- *
- * @param a the array to return a view of
- * @return a fixed-size list, changes to which "write through" to the array
- * @see Serializable
- * @see RandomAccess
- * @see Arrays.ArrayList
- */
- public static List asList(final Object[] a)
- {
- return new Arrays.ArrayList(a);
- }
-
- /**
- * Inner class used by {@link #asList(Object[])} to provide a list interface
- * to an array. The name, though it clashes with java.util.ArrayList, is
- * Sun's choice for Serialization purposes. Element addition and removal
- * is prohibited, but values can be modified.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @status updated to 1.4
- */
- private static final class ArrayList extends AbstractList
- implements Serializable, RandomAccess
- {
- // We override the necessary methods, plus others which will be much
- // more efficient with direct iteration rather than relying on iterator().
-
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -2764017481108945198L;
-
- /**
- * The array we are viewing.
- * @serial the array
- */
- private final Object[] a;
-
- /**
- * Construct a list view of the array.
- * @param a the array to view
- * @throws NullPointerException if a is null
- */
- ArrayList(Object[] a)
- {
- // We have to explicitly check.
- if (a == null)
- throw new NullPointerException();
- this.a = a;
- }
-
- /**
- * Returns the object at the specified index in
- * the array.
- *
- * @param index The index to retrieve an object from.
- * @return The object at the array index specified.
- */
- public Object get(int index)
- {
- return a[index];
- }
-
- /**
- * Returns the size of the array.
- *
- * @return The size.
- */
- public int size()
- {
- return a.length;
- }
-
- /**
- * Replaces the object at the specified index
- * with the supplied element.
- *
- * @param index The index at which to place the new object.
- * @param element The new object.
- * @return The object replaced by this operation.
- */
- public Object set(int index, Object element)
- {
- Object old = a[index];
- a[index] = element;
- return old;
- }
-
- /**
- * Returns true if the array contains the
- * supplied object.
- *
- * @param o The object to look for.
- * @return True if the object was found.
- */
- public boolean contains(Object o)
- {
- return lastIndexOf(o) >= 0;
- }
-
- /**
- * Returns the first index at which the
- * object, o, occurs in the array.
- *
- * @param o The object to search for.
- * @return The first relevant index.
- */
- public int indexOf(Object o)
- {
- int size = a.length;
- for (int i = 0; i < size; i++)
- if (ArrayList.equals(o, a[i]))
- return i;
- return -1;
- }
-
- /**
- * Returns the last index at which the
- * object, o, occurs in the array.
- *
- * @param o The object to search for.
- * @return The last relevant index.
- */
- public int lastIndexOf(Object o)
- {
- int i = a.length;
- while (--i >= 0)
- if (ArrayList.equals(o, a[i]))
- return i;
- return -1;
- }
-
- /**
- * Transforms the list into an array of
- * objects, by simplying cloning the array
- * wrapped by this list.
- *
- * @return A clone of the internal array.
- */
- public Object[] toArray()
- {
- return (Object[]) a.clone();
- }
-
- /**
- * Copies the objects from this list into
- * the supplied array. The supplied array
- * is shrunk or enlarged to the size of the
- * internal array, and filled with its objects.
- *
- * @param array The array to fill with the objects in this list.
- * @return The array containing the objects in this list,
- * which may or may not be == to array.
- */
- public Object[] toArray(Object[] array)
- {
- int size = a.length;
- if (array.length < size)
- array = (Object[])
- Array.newInstance(array.getClass().getComponentType(), size);
- else if (array.length > size)
- array[size] = null;
-
- System.arraycopy(a, 0, array, 0, size);
- return array;
- }
- }
-}
diff --git a/libjava/java/util/BitSet.java b/libjava/java/util/BitSet.java
deleted file mode 100644
index 891f185334c..00000000000
--- a/libjava/java/util/BitSet.java
+++ /dev/null
@@ -1,744 +0,0 @@
-/* BitSet.java -- A vector of bits.
- Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-import java.io.Serializable;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * hashCode algorithm taken from JDK 1.2 docs.
- */
-
-/**
- * This class can be thought of in two ways. You can see it as a
- * vector of bits or as a set of non-negative integers. The name
- * <code>BitSet</code> is a bit misleading.
- *
- * It is implemented by a bit vector, but its equally possible to see
- * it as set of non-negative integer; each integer in the set is
- * represented by a set bit at the corresponding index. The size of
- * this structure is determined by the highest integer in the set.
- *
- * You can union, intersect and build (symmetric) remainders, by
- * invoking the logical operations and, or, andNot, resp. xor.
- *
- * This implementation is NOT synchronized against concurrent access from
- * multiple threads. Specifically, if one thread is reading from a bitset
- * while another thread is simultaneously modifying it, the results are
- * undefined.
- *
- * @author Jochen Hoenicke
- * @author Tom Tromey (tromey@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @status updated to 1.4
- */
-public class BitSet implements Cloneable, Serializable
-{
- /**
- * Compatible with JDK 1.0.
- */
- private static final long serialVersionUID = 7997698588986878753L;
-
- /**
- * A common mask.
- */
- private static final int LONG_MASK = 0x3f;
-
- /**
- * The actual bits.
- * @serial the i'th bit is in bits[i/64] at position i%64 (where position
- * 0 is the least significant).
- */
- private long[] bits;
-
- /**
- * Create a new empty bit set. All bits are initially false.
- */
- public BitSet()
- {
- this(64);
- }
-
- /**
- * Create a new empty bit set, with a given size. This
- * constructor reserves enough space to represent the integers
- * from <code>0</code> to <code>nbits-1</code>.
- *
- * @param nbits the initial size of the bit set
- * @throws NegativeArraySizeException if nbits &lt; 0
- */
- public BitSet(int nbits)
- {
- if (nbits < 0)
- throw new NegativeArraySizeException();
-
- int length = nbits >>> 6;
- if ((nbits & LONG_MASK) != 0)
- ++length;
- bits = new long[length];
- }
-
- /**
- * Performs the logical AND operation on this bit set and the
- * given <code>set</code>. This means it builds the intersection
- * of the two sets. The result is stored into this bit set.
- *
- * @param set the second bit set
- * @throws NullPointerException if set is null
- */
- public void and(BitSet bs)
- {
- int max = Math.min(bits.length, bs.bits.length);
- int i;
- for (i = 0; i < max; ++i)
- bits[i] &= bs.bits[i];
- while (i < bits.length)
- bits[i++] = 0;
- }
-
- /**
- * Performs the logical AND operation on this bit set and the
- * complement of the given <code>set</code>. This means it
- * selects every element in the first set, that isn't in the
- * second set. The result is stored into this bit set and is
- * effectively the set difference of the two.
- *
- * @param set the second bit set
- * @throws NullPointerException if set is null
- * @since 1.2
- */
- public void andNot(BitSet bs)
- {
- int i = Math.min(bits.length, bs.bits.length);
- while (--i >= 0)
- bits[i] &= ~bs.bits[i];
- }
-
- /**
- * Returns the number of bits set to true.
- *
- * @return the number of true bits
- * @since 1.4
- */
- public int cardinality()
- {
- int card = 0;
- for (int i = bits.length - 1; i >= 0; i--)
- {
- long a = bits[i];
- // Take care of common cases.
- if (a == 0)
- continue;
- if (a == -1)
- {
- card += 64;
- continue;
- }
-
- // Successively collapse alternating bit groups into a sum.
- a = ((a >> 1) & 0x5555555555555555L) + (a & 0x5555555555555555L);
- a = ((a >> 2) & 0x3333333333333333L) + (a & 0x3333333333333333L);
- int b = (int) ((a >>> 32) + a);
- b = ((b >> 4) & 0x0f0f0f0f) + (b & 0x0f0f0f0f);
- b = ((b >> 8) & 0x00ff00ff) + (b & 0x00ff00ff);
- card += ((b >> 16) & 0x0000ffff) + (b & 0x0000ffff);
- }
- return card;
- }
-
- /**
- * Sets all bits in the set to false.
- *
- * @since 1.4
- */
- public void clear()
- {
- Arrays.fill(bits, 0);
- }
-
- /**
- * Removes the integer <code>bitIndex</code> from this set. That is
- * the corresponding bit is cleared. If the index is not in the set,
- * this method does nothing.
- *
- * @param bitIndex a non-negative integer
- * @throws IndexOutOfBoundsException if bitIndex &lt; 0
- */
- public void clear(int pos)
- {
- int offset = pos >> 6;
- ensure(offset);
- // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
- // so we'll just let that be our exception.
- bits[offset] &= ~(1L << pos);
- }
-
- /**
- * Sets the bits between from (inclusive) and to (exclusive) to false.
- *
- * @param from the start range (inclusive)
- * @param to the end range (exclusive)
- * @throws IndexOutOfBoundsException if from &lt; 0 || to &lt; 0 ||
- * from &gt; to
- * @since 1.4
- */
- public void clear(int from, int to)
- {
- if (from < 0 || from > to)
- throw new IndexOutOfBoundsException();
- if (from == to)
- return;
- int lo_offset = from >>> 6;
- int hi_offset = to >>> 6;
- ensure(hi_offset);
- if (lo_offset == hi_offset)
- {
- bits[hi_offset] &= ((1L << from) - 1) | (-1L << to);
- return;
- }
-
- bits[lo_offset] &= (1L << from) - 1;
- bits[hi_offset] &= -1L << to;
- for (int i = lo_offset + 1; i < hi_offset; i++)
- bits[i] = 0;
- }
-
- /**
- * Create a clone of this bit set, that is an instance of the same
- * class and contains the same elements. But it doesn't change when
- * this bit set changes.
- *
- * @return the clone of this object.
- */
- public Object clone()
- {
- try
- {
- BitSet bs = (BitSet) super.clone();
- bs.bits = (long[]) bits.clone();
- return bs;
- }
- catch (CloneNotSupportedException e)
- {
- // Impossible to get here.
- return null;
- }
- }
-
- /**
- * Returns true if the <code>obj</code> is a bit set that contains
- * exactly the same elements as this bit set, otherwise false.
- *
- * @param obj the object to compare to
- * @return true if obj equals this bit set
- */
- public boolean equals(Object obj)
- {
- if (!(obj instanceof BitSet))
- return false;
- BitSet bs = (BitSet) obj;
- int max = Math.min(bits.length, bs.bits.length);
- int i;
- for (i = 0; i < max; ++i)
- if (bits[i] != bs.bits[i])
- return false;
- // If one is larger, check to make sure all extra bits are 0.
- for (int j = i; j < bits.length; ++j)
- if (bits[j] != 0)
- return false;
- for (int j = i; j < bs.bits.length; ++j)
- if (bs.bits[j] != 0)
- return false;
- return true;
- }
-
- /**
- * Sets the bit at the index to the opposite value.
- *
- * @param index the index of the bit
- * @throws IndexOutOfBoundsException if index is negative
- * @since 1.4
- */
- public void flip(int index)
- {
- int offset = index >> 6;
- ensure(offset);
- // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
- // so we'll just let that be our exception.
- bits[offset] ^= 1L << index;
- }
-
- /**
- * Sets a range of bits to the opposite value.
- *
- * @param from the low index (inclusive)
- * @param to the high index (exclusive)
- * @throws IndexOutOfBoundsException if from &gt; to || from &lt; 0 ||
- * to &lt; 0
- * @since 1.4
- */
- public void flip(int from, int to)
- {
- if (from < 0 || from > to)
- throw new IndexOutOfBoundsException();
- if (from == to)
- return;
- int lo_offset = from >>> 6;
- int hi_offset = to >>> 6;
- ensure(hi_offset);
- if (lo_offset == hi_offset)
- {
- bits[hi_offset] ^= (-1L << from) & ((1L << to) - 1);
- return;
- }
-
- bits[lo_offset] ^= -1L << from;
- bits[hi_offset] ^= (1L << to) - 1;
- for (int i = lo_offset + 1; i < hi_offset; i++)
- bits[i] ^= -1;
- }
-
- /**
- * Returns true if the integer <code>bitIndex</code> is in this bit
- * set, otherwise false.
- *
- * @param pos a non-negative integer
- * @return the value of the bit at the specified index
- * @throws IndexOutOfBoundsException if the index is negative
- */
- public boolean get(int pos)
- {
- int offset = pos >> 6;
- if (offset >= bits.length)
- return false;
- // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
- // so we'll just let that be our exception.
- return (bits[offset] & (1L << pos)) != 0;
- }
-
- /**
- * Returns a new <code>BitSet</code> composed of a range of bits from
- * this one.
- *
- * @param from the low index (inclusive)
- * @param to the high index (exclusive)
- * @throws IndexOutOfBoundsException if from &gt; to || from &lt; 0 ||
- * to &lt; 0
- * @since 1.4
- */
- public BitSet get(int from, int to)
- {
- if (from < 0 || from > to)
- throw new IndexOutOfBoundsException();
- BitSet bs = new BitSet(to - from);
- int lo_offset = from >>> 6;
- if (lo_offset >= bits.length)
- return bs;
-
- int lo_bit = from & LONG_MASK;
- int hi_offset = to >>> 6;
- if (lo_bit == 0)
- {
- int len = Math.min(hi_offset - lo_offset + 1, bits.length - lo_offset);
- System.arraycopy(bits, lo_offset, bs.bits, 0, len);
- if (hi_offset < bits.length)
- bs.bits[hi_offset - lo_offset] &= (1L << to) - 1;
- return bs;
- }
-
- int len = Math.min(hi_offset, bits.length - 1);
- int reverse = 64 - lo_bit;
- int i;
- for (i = 0; lo_offset < len; lo_offset++, i++)
- bs.bits[i] = ((bits[lo_offset] >>> lo_bit)
- | (bits[lo_offset + 1] << reverse));
- if ((to & LONG_MASK) > lo_bit)
- bs.bits[i++] = bits[lo_offset] >>> lo_bit;
- if (hi_offset < bits.length)
- bs.bits[i - 1] &= (1L << (to - from)) - 1;
- return bs;
- }
-
- /**
- * Returns a hash code value for this bit set. The hash code of
- * two bit sets containing the same integers is identical. The algorithm
- * used to compute it is as follows:
- *
- * Suppose the bits in the BitSet were to be stored in an array of
- * long integers called <code>bits</code>, in such a manner that
- * bit <code>k</code> is set in the BitSet (for non-negative values
- * of <code>k</code>) if and only if
- *
- * <code>((k/64) &lt; bits.length)
- * && ((bits[k/64] & (1L &lt;&lt; (bit % 64))) != 0)
- * </code>
- *
- * Then the following definition of the hashCode method
- * would be a correct implementation of the actual algorithm:
- *
- *
-<pre>public int hashCode()
-{
- long h = 1234;
- for (int i = bits.length-1; i &gt;= 0; i--)
- {
- h ^= bits[i] * (i + 1);
- }
-
- return (int)((h >> 32) ^ h);
-}</pre>
- *
- * Note that the hash code values changes, if the set is changed.
- *
- * @return the hash code value for this bit set.
- */
- public int hashCode()
- {
- long h = 1234;
- for (int i = bits.length; i > 0; )
- h ^= i * bits[--i];
- return (int) ((h >> 32) ^ h);
- }
-
- /**
- * Returns true if the specified BitSet and this one share at least one
- * common true bit.
- *
- * @param set the set to check for intersection
- * @return true if the sets intersect
- * @throws NullPointerException if set is null
- * @since 1.4
- */
- public boolean intersects(BitSet set)
- {
- int i = Math.min(bits.length, set.bits.length);
- while (--i >= 0)
- if ((bits[i] & set.bits[i]) != 0)
- return true;
- return false;
- }
-
- /**
- * Returns true if this set contains no true bits.
- *
- * @return true if all bits are false
- * @since 1.4
- */
- public boolean isEmpty()
- {
- for (int i = bits.length - 1; i >= 0; i--)
- if (bits[i] != 0)
- return false;
- return true;
- }
-
- /**
- * Returns the logical number of bits actually used by this bit
- * set. It returns the index of the highest set bit plus one.
- * Note that this method doesn't return the number of set bits.
- *
- * @return the index of the highest set bit plus one.
- */
- public int length()
- {
- // Set i to highest index that contains a non-zero value.
- int i;
- for (i = bits.length - 1; i >= 0 && bits[i] == 0; --i)
- ;
-
- // if i < 0 all bits are cleared.
- if (i < 0)
- return 0;
-
- // Now determine the exact length.
- long b = bits[i];
- int len = (i + 1) * 64;
- // b >= 0 checks if the highest bit is zero.
- while (b >= 0)
- {
- --len;
- b <<= 1;
- }
-
- return len;
- }
-
- /**
- * Returns the index of the next false bit, from the specified bit
- * (inclusive).
- *
- * @param from the start location
- * @return the first false bit
- * @throws IndexOutOfBoundsException if from is negative
- * @since 1.4
- */
- public int nextClearBit(int from)
- {
- int offset = from >> 6;
- long mask = 1L << from;
- while (offset < bits.length)
- {
- // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
- // so we'll just let that be our exception.
- long h = bits[offset];
- do
- {
- if ((h & mask) == 0)
- return from;
- mask <<= 1;
- from++;
- }
- while (mask != 0);
- mask = 1;
- offset++;
- }
- return from;
- }
-
- /**
- * Returns the index of the next true bit, from the specified bit
- * (inclusive). If there is none, -1 is returned. You can iterate over
- * all true bits with this loop:<br>
- *
-<pre>for (int i = bs.nextSetBit(0); i &gt;= 0; i = bs.nextSetBit(i + 1))
-{
- // operate on i here
-}</pre>
- *
- * @param from the start location
- * @return the first true bit, or -1
- * @throws IndexOutOfBoundsException if from is negative
- * @since 1.4
- */
- public int nextSetBit(int from)
- {
- int offset = from >> 6;
- long mask = 1L << from;
- while (offset < bits.length)
- {
- // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
- // so we'll just let that be our exception.
- long h = bits[offset];
- do
- {
- if ((h & mask) != 0)
- return from;
- mask <<= 1;
- from++;
- }
- while (mask != 0);
- mask = 1;
- offset++;
- }
- return -1;
- }
-
- /**
- * Performs the logical OR operation on this bit set and the
- * given <code>set</code>. This means it builds the union
- * of the two sets. The result is stored into this bit set, which
- * grows as necessary.
- *
- * @param bs the second bit set
- * @throws NullPointerException if bs is null
- */
- public void or(BitSet bs)
- {
- ensure(bs.bits.length - 1);
- for (int i = bs.bits.length - 1; i >= 0; i--)
- bits[i] |= bs.bits[i];
- }
-
- /**
- * Add the integer <code>bitIndex</code> to this set. That is
- * the corresponding bit is set to true. If the index was already in
- * the set, this method does nothing. The size of this structure
- * is automatically increased as necessary.
- *
- * @param pos a non-negative integer.
- * @throws IndexOutOfBoundsException if pos is negative
- */
- public void set(int pos)
- {
- int offset = pos >> 6;
- ensure(offset);
- // ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
- // so we'll just let that be our exception.
- bits[offset] |= 1L << pos;
- }
-
- /**
- * Sets the bit at the given index to the specified value. The size of
- * this structure is automatically increased as necessary.
- *
- * @param index the position to set
- * @param value the value to set it to
- * @throws IndexOutOfBoundsException if index is negative
- * @since 1.4
- */
- public void set(int index, boolean value)
- {
- if (value)
- set(index);
- else
- clear(index);
- }
-
- /**
- * Sets the bits between from (inclusive) and to (exclusive) to true.
- *
- * @param from the start range (inclusive)
- * @param to the end range (exclusive)
- * @throws IndexOutOfBoundsException if from &lt; 0 || from &gt; to ||
- * to &lt; 0
- * @since 1.4
- */
- public void set(int from, int to)
- {
- if (from < 0 || from > to)
- throw new IndexOutOfBoundsException();
- if (from == to)
- return;
- int lo_offset = from >>> 6;
- int hi_offset = to >>> 6;
- ensure(hi_offset);
- if (lo_offset == hi_offset)
- {
- bits[hi_offset] |= (-1L << from) & ((1L << to) - 1);
- return;
- }
-
- bits[lo_offset] |= -1L << from;
- bits[hi_offset] |= (1L << to) - 1;
- for (int i = lo_offset + 1; i < hi_offset; i++)
- bits[i] = -1;
- }
-
- /**
- * Sets the bits between from (inclusive) and to (exclusive) to the
- * specified value.
- *
- * @param from the start range (inclusive)
- * @param to the end range (exclusive)
- * @param value the value to set it to
- * @throws IndexOutOfBoundsException if from &lt; 0 || from &gt; to ||
- * to &lt; 0
- * @since 1.4
- */
- public void set(int from, int to, boolean value)
- {
- if (value)
- set(from, to);
- else
- clear(from, to);
- }
-
- /**
- * Returns the number of bits actually used by this bit set. Note
- * that this method doesn't return the number of set bits, and that
- * future requests for larger bits will make this automatically grow.
- *
- * @return the number of bits currently used.
- */
- public int size()
- {
- return bits.length * 64;
- }
-
- /**
- * Returns the string representation of this bit set. This
- * consists of a comma separated list of the integers in this set
- * surrounded by curly braces. There is a space after each comma.
- * A sample string is thus "{1, 3, 53}".
- * @return the string representation.
- */
- public String toString()
- {
- StringBuffer r = new StringBuffer("{");
- boolean first = true;
- for (int i = 0; i < bits.length; ++i)
- {
- long bit = 1;
- long word = bits[i];
- if (word == 0)
- continue;
- for (int j = 0; j < 64; ++j)
- {
- if ((word & bit) != 0)
- {
- if (! first)
- r.append(", ");
- r.append(64 * i + j);
- first = false;
- }
- bit <<= 1;
- }
- }
- return r.append("}").toString();
- }
-
- /**
- * Performs the logical XOR operation on this bit set and the
- * given <code>set</code>. This means it builds the symmetric
- * remainder of the two sets (the elements that are in one set,
- * but not in the other). The result is stored into this bit set,
- * which grows as necessary.
- *
- * @param bs the second bit set
- * @throws NullPointerException if bs is null
- */
- public void xor(BitSet bs)
- {
- ensure(bs.bits.length - 1);
- for (int i = bs.bits.length - 1; i >= 0; i--)
- bits[i] ^= bs.bits[i];
- }
-
- /**
- * Make sure the vector is big enough.
- *
- * @param lastElt the size needed for the bits array
- */
- private void ensure(int lastElt)
- {
- if (lastElt >= bits.length)
- {
- long[] nd = new long[lastElt + 1];
- System.arraycopy(bits, 0, nd, 0, bits.length);
- bits = nd;
- }
- }
-}
diff --git a/libjava/java/util/Collection.java b/libjava/java/util/Collection.java
deleted file mode 100644
index 29e1b3786b4..00000000000
--- a/libjava/java/util/Collection.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/* Collection.java -- Interface that represents a collection of objects
- Copyright (C) 1998, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * Interface that represents a collection of objects. This interface is the
- * root of the collection hierarchy, and does not provide any guarantees about
- * the order of its elements or whether or not duplicate elements are
- * permitted.
- * <p>
- * All methods of this interface that are defined to modify the collection are
- * defined as <dfn>optional</dfn>. An optional operation may throw an
- * UnsupportedOperationException if the data backing this collection does not
- * support such a modification. This may mean that the data structure is
- * immutable, or that it is read-only but may change ("unmodifiable"), or
- * that it is modifiable but of fixed size (such as an array), or any number
- * of other combinations.
- * <p>
- * A class that wishes to implement this interface should consider subclassing
- * AbstractCollection, which provides basic implementations of most of the
- * methods of this interface. Classes that are prepared to make guarantees
- * about ordering or about absence of duplicate elements should consider
- * implementing List or Set respectively, both of which are subinterfaces of
- * Collection.
- * <p>
- * A general-purpose implementation of the Collection interface should in most
- * cases provide at least two constructors: One which takes no arguments and
- * creates an empty collection, and one which takes a Collection as an argument
- * and returns a collection containing the same elements (that is, creates a
- * copy of the argument using its own implementation).
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see List
- * @see Set
- * @see Map
- * @see SortedSet
- * @see SortedMap
- * @see HashSet
- * @see TreeSet
- * @see ArrayList
- * @see LinkedList
- * @see Vector
- * @see Collections
- * @see Arrays
- * @see AbstractCollection
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Collection
-{
- /**
- * Add an element to this collection.
- *
- * @param o the object to add.
- * @return true if the collection was modified as a result of this action.
- * @throws UnsupportedOperationException if this collection does not
- * support the add operation.
- * @throws ClassCastException if o cannot be added to this collection due
- * to its type.
- * @throws NullPointerException if o is null and this collection doesn't
- * support the addition of null values.
- * @throws IllegalArgumentException if o cannot be added to this
- * collection for some other reason.
- */
- boolean add(Object o);
-
- /**
- * Add the contents of a given collection to this collection.
- *
- * @param c the collection to add.
- * @return true if the collection was modified as a result of this action.
- * @throws UnsupportedOperationException if this collection does not
- * support the addAll operation.
- * @throws ClassCastException if some element of c cannot be added to this
- * collection due to its type.
- * @throws NullPointerException if some element of c is null and this
- * collection does not support the addition of null values.
- * @throws NullPointerException if c itself is null.
- * @throws IllegalArgumentException if some element of c cannot be added
- * to this collection for some other reason.
- */
- boolean addAll(Collection c);
-
- /**
- * Clear the collection, such that a subsequent call to isEmpty() would
- * return true.
- *
- * @throws UnsupportedOperationException if this collection does not
- * support the clear operation.
- */
- void clear();
-
- /**
- * Test whether this collection contains a given object as one of its
- * elements.
- *
- * @param o the element to look for.
- * @return true if this collection contains at least one element e such that
- * <code>o == null ? e == null : o.equals(e)</code>.
- * @throws ClassCastException if the type of o is not a valid type for this
- * collection.
- * @throws NullPointerException if o is null and this collection doesn't
- * support null values.
- */
- boolean contains(Object o);
-
- /**
- * Test whether this collection contains every element in a given collection.
- *
- * @param c the collection to test for.
- * @return true if for every element o in c, contains(o) would return true.
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this collection.
- * @throws NullPointerException if some element of c is null and this
- * collection does not support null values.
- * @throws NullPointerException if c itself is null.
- */
- boolean containsAll(Collection c);
-
- /**
- * Test whether this collection is equal to some object. The Collection
- * interface does not explicitly require any behaviour from this method, and
- * it may be left to the default implementation provided by Object. The Set
- * and List interfaces do, however, require specific behaviour from this
- * method.
- * <p>
- * If an implementation of Collection, which is not also an implementation of
- * Set or List, should choose to implement this method, it should take care
- * to obey the contract of the equals method of Object. In particular, care
- * should be taken to return false when o is a Set or a List, in order to
- * preserve the symmetry of the relation.
- *
- * @param o the object to compare to this collection.
- * @return true if the o is equal to this collection.
- */
- boolean equals(Object o);
-
- /**
- * Obtain a hash code for this collection. The Collection interface does not
- * explicitly require any behaviour from this method, and it may be left to
- * the default implementation provided by Object. The Set and List interfaces
- * do, however, require specific behaviour from this method.
- * <p>
- * If an implementation of Collection, which is not also an implementation of
- * Set or List, should choose to implement this method, it should take care
- * to obey the contract of the hashCode method of Object. Note that this
- * method renders it impossible to correctly implement both Set and List, as
- * the required implementations are mutually exclusive.
- *
- * @return a hash code for this collection.
- */
- int hashCode();
-
- /**
- * Test whether this collection is empty, that is, if size() == 0.
- *
- * @return true if this collection contains no elements.
- */
- boolean isEmpty();
-
- /**
- * Obtain an Iterator over this collection.
- *
- * @return an Iterator over the elements of this collection, in any order.
- */
- Iterator iterator();
-
- /**
- * Remove a single occurrence of an object from this collection. That is,
- * remove an element e, if one exists, such that <code>o == null ? e == null
- * : o.equals(e)</code>.
- *
- * @param o the object to remove.
- * @return true if the collection changed as a result of this call, that is,
- * if the collection contained at least one occurrence of o.
- * @throws UnsupportedOperationException if this collection does not
- * support the remove operation.
- * @throws ClassCastException if the type of o is not a valid type
- * for this collection.
- * @throws NullPointerException if o is null and the collection doesn't
- * support null values.
- */
- boolean remove(Object o);
-
- /**
- * Remove all elements of a given collection from this collection. That is,
- * remove every element e such that c.contains(e).
- *
- * @param c The collection of objects to be removed.
- * @return true if this collection was modified as a result of this call.
- * @throws UnsupportedOperationException if this collection does not
- * support the removeAll operation.
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this collection.
- * @throws NullPointerException if some element of c is null and this
- * collection does not support removing null values.
- * @throws NullPointerException if c itself is null.
- */
- boolean removeAll(Collection c);
-
- /**
- * Remove all elements of this collection that are not contained in a given
- * collection. That is, remove every element e such that !c.contains(e).
- *
- * @param c The collection of objects to be retained.
- * @return true if this collection was modified as a result of this call.
- * @throws UnsupportedOperationException if this collection does not
- * support the retainAll operation.
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this collection.
- * @throws NullPointerException if some element of c is null and this
- * collection does not support retaining null values.
- * @throws NullPointerException if c itself is null.
- */
- boolean retainAll(Collection c);
-
- /**
- * Get the number of elements in this collection.
- *
- * @return the number of elements in the collection.
- */
- int size();
-
- /**
- * Copy the current contents of this collection into an array.
- *
- * @return an array of type Object[] and length equal to the size of this
- * collection, containing the elements currently in this collection, in
- * any order.
- */
- Object[] toArray();
-
- /**
- * Copy the current contents of this collection into an array. If the array
- * passed as an argument has length less than the size of this collection, an
- * array of the same run-time type as a, and length equal to the size of this
- * collection, is allocated using Reflection. Otherwise, a itself is used.
- * The elements of this collection are copied into it, and if there is space
- * in the array, the following element is set to null. The resultant array is
- * returned.
- * Note: The fact that the following element is set to null is only useful
- * if it is known that this collection does not contain any null elements.
- *
- * @param a the array to copy this collection into.
- * @return an array containing the elements currently in this collection, in
- * any order.
- * @throws ArrayStoreException if the type of any element of the
- * collection is not a subtype of the element type of a.
- */
- Object[] toArray(Object[] a);
-}
diff --git a/libjava/java/util/Collections.java b/libjava/java/util/Collections.java
deleted file mode 100644
index 64eb8da3585..00000000000
--- a/libjava/java/util/Collections.java
+++ /dev/null
@@ -1,5493 +0,0 @@
-/* Collections.java -- Utility class with methods to operate on collections
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.Serializable;
-
-/**
- * Utility class consisting of static methods that operate on, or return
- * Collections. Contains methods to sort, search, reverse, fill and shuffle
- * Collections, methods to facilitate interoperability with legacy APIs that
- * are unaware of collections, a method to return a list which consists of
- * multiple copies of one element, and methods which "wrap" collections to give
- * them extra properties, such as thread-safety and unmodifiability.
- * <p>
- *
- * All methods which take a collection throw a {@link NullPointerException} if
- * that collection is null. Algorithms which can change a collection may, but
- * are not required, to throw the {@link UnsupportedOperationException} that
- * the underlying collection would throw during an attempt at modification.
- * For example,
- * <code>Collections.singleton("").addAll(Collections.EMPTY_SET)</code>
- * does not throw a exception, even though addAll is an unsupported operation
- * on a singleton; the reason for this is that addAll did not attempt to
- * modify the set.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see Set
- * @see List
- * @see Map
- * @see Arrays
- * @since 1.2
- * @status updated to 1.4
- */
-public class Collections
-{
- /**
- * Constant used to decide cutoff for when a non-RandomAccess list should
- * be treated as sequential-access. Basically, quadratic behavior is
- * acceptable for small lists when the overhead is so small in the first
- * place. I arbitrarily set it to 16, so it may need some tuning.
- */
- private static final int LARGE_LIST_SIZE = 16;
-
- /**
- * Determines if a list should be treated as a sequential-access one.
- * Rather than the old method of JDK 1.3 of assuming only instanceof
- * AbstractSequentialList should be sequential, this uses the new method
- * of JDK 1.4 of assuming anything that does NOT implement RandomAccess
- * and exceeds a large (unspecified) size should be sequential.
- *
- * @param l the list to check
- * @return <code>true</code> if it should be treated as sequential-access
- */
- private static boolean isSequential(List l)
- {
- return ! (l instanceof RandomAccess) && l.size() > LARGE_LIST_SIZE;
- }
-
- /**
- * This class is non-instantiable.
- */
- private Collections()
- {
- }
-
- /**
- * An immutable, serializable, empty Set.
- * @see Serializable
- */
- public static final Set EMPTY_SET = new EmptySet();
-
- /**
- * The implementation of {@link #EMPTY_SET}. This class name is required
- * for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class EmptySet extends AbstractSet
- implements Serializable
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 1582296315990362920L;
-
- /**
- * A private constructor adds overhead.
- */
- EmptySet()
- {
- }
-
- /**
- * The size: always 0!
- * @return 0.
- */
- public int size()
- {
- return 0;
- }
-
- /**
- * Returns an iterator that does not iterate.
- * @return A non-iterating iterator.
- */
- // This is really cheating! I think it's perfectly valid, though.
- public Iterator iterator()
- {
- return EMPTY_LIST.iterator();
- }
-
- // The remaining methods are optional, but provide a performance
- // advantage by not allocating unnecessary iterators in AbstractSet.
- /**
- * The empty set never contains anything.
- * @param o The object to search for.
- * @return <code>false</code>.
- */
- public boolean contains(Object o)
- {
- return false;
- }
-
- /**
- * This is true only if the given collection is also empty.
- * @param c The collection of objects which are to be compared
- * against the members of this set.
- * @return <code>true</code> if c is empty.
- */
- public boolean containsAll(Collection c)
- {
- return c.isEmpty();
- }
-
- /**
- * Equal only if the other set is empty.
- * @param o The object to compare with this set.
- * @return <code>true</code> if o is an empty instance of <code>Set</code>.
- */
- public boolean equals(Object o)
- {
- return o instanceof Set && ((Set) o).isEmpty();
- }
-
- /**
- * The hashcode is always 0.
- * @return 0.
- */
- public int hashCode()
- {
- return 0;
- }
-
- /**
- * Always succeeds with a <code>false</code> result.
- * @param o The object to remove.
- * @return <code>false</code>.
- */
- public boolean remove(Object o)
- {
- return false;
- }
-
- /**
- * Always succeeds with a <code>false</code> result.
- * @param c The collection of objects which should
- * all be removed from this set.
- * @return <code>false</code>.
- */
- public boolean removeAll(Collection c)
- {
- return false;
- }
-
- /**
- * Always succeeds with a <code>false</code> result.
- * @param c The collection of objects which should
- * all be retained within this set.
- * @return <code>false</code>.
- */
- public boolean retainAll(Collection c)
- {
- return false;
- }
-
- /**
- * The array is always empty.
- * @return A new array with a size of 0.
- */
- public Object[] toArray()
- {
- return new Object[0];
- }
-
- /**
- * We don't even need to use reflection!
- * @param a An existing array, which can be empty.
- * @return The original array with any existing
- * initial element set to null.
- */
- public Object[] toArray(Object[] a)
- {
- if (a.length > 0)
- a[0] = null;
- return a;
- }
-
- /**
- * The string never changes.
- *
- * @return the string "[]".
- */
- public String toString()
- {
- return "[]";
- }
- } // class EmptySet
-
- /**
- * An immutable, serializable, empty List, which implements RandomAccess.
- * @see Serializable
- * @see RandomAccess
- */
- public static final List EMPTY_LIST = new EmptyList();
-
- /**
- * The implementation of {@link #EMPTY_LIST}. This class name is required
- * for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class EmptyList extends AbstractList
- implements Serializable, RandomAccess
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 8842843931221139166L;
-
- /**
- * A private constructor adds overhead.
- */
- EmptyList()
- {
- }
-
- /**
- * The size is always 0.
- * @return 0.
- */
- public int size()
- {
- return 0;
- }
-
- /**
- * No matter the index, it is out of bounds. This
- * method never returns, throwing an exception instead.
- *
- * @param index The index of the element to retrieve.
- * @return the object at the specified index.
- * @throws IndexOutofBoundsException as any given index
- * is outside the bounds of an empty array.
- */
- public Object get(int index)
- {
- throw new IndexOutOfBoundsException();
- }
-
- // The remaining methods are optional, but provide a performance
- // advantage by not allocating unnecessary iterators in AbstractList.
- /**
- * Never contains anything.
- * @param o The object to search for.
- * @return <code>false</code>.
- */
- public boolean contains(Object o)
- {
- return false;
- }
-
- /**
- * This is true only if the given collection is also empty.
- * @param c The collection of objects, which should be compared
- * against the members of this list.
- * @return <code>true</code> if c is also empty.
- */
- public boolean containsAll(Collection c)
- {
- return c.isEmpty();
- }
-
- /**
- * Equal only if the other list is empty.
- * @param o The object to compare against this list.
- * @return <code>true</code> if o is also an empty instance of
- * <code>List</code>.
- */
- public boolean equals(Object o)
- {
- return o instanceof List && ((List) o).isEmpty();
- }
-
- /**
- * The hashcode is always 1.
- * @return 1.
- */
- public int hashCode()
- {
- return 1;
- }
-
- /**
- * Returns -1.
- * @param o The object to search for.
- * @return -1.
- */
- public int indexOf(Object o)
- {
- return -1;
- }
-
- /**
- * Returns -1.
- * @param o The object to search for.
- * @return -1.
- */
- public int lastIndexOf(Object o)
- {
- return -1;
- }
-
- /**
- * Always succeeds with <code>false</code> result.
- * @param o The object to remove.
- * @return -1.
- */
- public boolean remove(Object o)
- {
- return false;
- }
-
- /**
- * Always succeeds with <code>false</code> result.
- * @param c The collection of objects which should
- * all be removed from this list.
- * @return <code>false</code>.
- */
- public boolean removeAll(Collection c)
- {
- return false;
- }
-
- /**
- * Always succeeds with <code>false</code> result.
- * @param c The collection of objects which should
- * all be retained within this list.
- * @return <code>false</code>.
- */
- public boolean retainAll(Collection c)
- {
- return false;
- }
-
- /**
- * The array is always empty.
- * @return A new array with a size of 0.
- */
- public Object[] toArray()
- {
- return new Object[0];
- }
-
- /**
- * We don't even need to use reflection!
- * @param a An existing array, which can be empty.
- * @return The original array with any existing
- * initial element set to null.
- */
- public Object[] toArray(Object[] a)
- {
- if (a.length > 0)
- a[0] = null;
- return a;
- }
-
- /**
- * The string never changes.
- *
- * @return the string "[]".
- */
- public String toString()
- {
- return "[]";
- }
- } // class EmptyList
-
- /**
- * An immutable, serializable, empty Map.
- * @see Serializable
- */
- public static final Map EMPTY_MAP = new EmptyMap();
-
- /**
- * The implementation of {@link #EMPTY_MAP}. This class name is required
- * for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class EmptyMap extends AbstractMap
- implements Serializable
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 6428348081105594320L;
-
- /**
- * A private constructor adds overhead.
- */
- EmptyMap()
- {
- }
-
- /**
- * There are no entries.
- * @return The empty set.
- */
- public Set entrySet()
- {
- return EMPTY_SET;
- }
-
- // The remaining methods are optional, but provide a performance
- // advantage by not allocating unnecessary iterators in AbstractMap.
- /**
- * No entries!
- * @param key The key to search for.
- * @return <code>false</code>.
- */
- public boolean containsKey(Object key)
- {
- return false;
- }
-
- /**
- * No entries!
- * @param value The value to search for.
- * @return <code>false</code>.
- */
- public boolean containsValue(Object value)
- {
- return false;
- }
-
- /**
- * Equal to all empty maps.
- * @param o The object o to compare against this map.
- * @return <code>true</code> if o is also an empty instance of
- * <code>Map</code>.
- */
- public boolean equals(Object o)
- {
- return o instanceof Map && ((Map) o).isEmpty();
- }
-
- /**
- * No mappings, so this returns null.
- * @param o The key of the object to retrieve.
- * @return null.
- */
- public Object get(Object o)
- {
- return null;
- }
-
- /**
- * The hashcode is always 0.
- * @return 0.
- */
- public int hashCode()
- {
- return 0;
- }
-
- /**
- * No entries.
- * @return The empty set.
- */
- public Set keySet()
- {
- return EMPTY_SET;
- }
-
- /**
- * Remove always succeeds, with null result.
- * @param o The key of the mapping to remove.
- * @return null, as there is never a mapping for o.
- */
- public Object remove(Object o)
- {
- return null;
- }
-
- /**
- * Size is always 0.
- * @return 0.
- */
- public int size()
- {
- return 0;
- }
-
- /**
- * No entries. Technically, EMPTY_SET, while more specific than a general
- * Collection, will work. Besides, that's what the JDK uses!
- * @return The empty set.
- */
- public Collection values()
- {
- return EMPTY_SET;
- }
-
- /**
- * The string never changes.
- *
- * @return the string "[]".
- */
- public String toString()
- {
- return "[]";
- }
- } // class EmptyMap
-
-
- /**
- * Compare two objects with or without a Comparator. If c is null, uses the
- * natural ordering. Slightly slower than doing it inline if the JVM isn't
- * clever, but worth it for removing a duplicate of the search code.
- * Note: This code is also used in Arrays (for sort as well as search).
- */
- static final int compare(Object o1, Object o2, Comparator c)
- {
- return c == null ? ((Comparable) o1).compareTo(o2) : c.compare(o1, o2);
- }
-
- /**
- * Perform a binary search of a List for a key, using the natural ordering of
- * the elements. The list must be sorted (as by the sort() method) - if it is
- * not, the behavior of this method is undefined, and may be an infinite
- * loop. Further, the key must be comparable with every item in the list. If
- * the list contains the key more than once, any one of them may be found.
- * <p>
- *
- * This algorithm behaves in log(n) time for {@link RandomAccess} lists,
- * and uses a linear search with O(n) link traversals and log(n) comparisons
- * with {@link AbstractSequentialList} lists. Note: although the
- * specification allows for an infinite loop if the list is unsorted, it will
- * not happen in this (Classpath) implementation.
- *
- * @param l the list to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value
- * @throws ClassCastException if key could not be compared with one of the
- * elements of l
- * @throws NullPointerException if a null element has compareTo called
- * @see #sort(List)
- */
- public static int binarySearch(List l, Object key)
- {
- return binarySearch(l, key, null);
- }
-
- /**
- * Perform a binary search of a List for a key, using a supplied Comparator.
- * The list must be sorted (as by the sort() method with the same Comparator)
- * - if it is not, the behavior of this method is undefined, and may be an
- * infinite loop. Further, the key must be comparable with every item in the
- * list. If the list contains the key more than once, any one of them may be
- * found. If the comparator is null, the elements' natural ordering is used.
- * <p>
- *
- * This algorithm behaves in log(n) time for {@link RandomAccess} lists,
- * and uses a linear search with O(n) link traversals and log(n) comparisons
- * with {@link AbstractSequentialList} lists. Note: although the
- * specification allows for an infinite loop if the list is unsorted, it will
- * not happen in this (Classpath) implementation.
- *
- * @param l the list to search (must be sorted)
- * @param key the value to search for
- * @param c the comparator by which the list is sorted
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value
- * @throws ClassCastException if key could not be compared with one of the
- * elements of l
- * @throws NullPointerException if a null element is compared with natural
- * ordering (only possible when c is null)
- * @see #sort(List, Comparator)
- */
- public static int binarySearch(List l, Object key, Comparator c)
- {
- int pos = 0;
- int low = 0;
- int hi = l.size() - 1;
-
- // We use a linear search with log(n) comparisons using an iterator
- // if the list is sequential-access.
- if (isSequential(l))
- {
- ListIterator itr = l.listIterator();
- int i = 0;
- Object o = itr.next(); // Assumes list is not empty (see isSequential)
- boolean forward = true;
- while (low <= hi)
- {
- pos = (low + hi) >> 1;
- if (i < pos)
- {
- if (!forward)
- itr.next(); // Changing direction first.
- for ( ; i != pos; i++, o = itr.next());
- forward = true;
- }
- else
- {
- if (forward)
- itr.previous(); // Changing direction first.
- for ( ; i != pos; i--, o = itr.previous());
- forward = false;
- }
- final int d = compare(key, o, c);
- if (d == 0)
- return pos;
- else if (d < 0)
- hi = pos - 1;
- else
- // This gets the insertion point right on the last loop
- low = ++pos;
- }
- }
- else
- {
- while (low <= hi)
- {
- pos = (low + hi) >> 1;
- final int d = compare(key, l.get(pos), c);
- if (d == 0)
- return pos;
- else if (d < 0)
- hi = pos - 1;
- else
- // This gets the insertion point right on the last loop
- low = ++pos;
- }
- }
-
- // If we failed to find it, we do the same whichever search we did.
- return -pos - 1;
- }
-
- /**
- * Copy one list to another. If the destination list is longer than the
- * source list, the remaining elements are unaffected. This method runs in
- * linear time.
- *
- * @param dest the destination list
- * @param source the source list
- * @throws IndexOutOfBoundsException if the destination list is shorter
- * than the source list (the destination will be unmodified)
- * @throws UnsupportedOperationException if dest.listIterator() does not
- * support the set operation
- */
- public static void copy(List dest, List source)
- {
- int pos = source.size();
- if (dest.size() < pos)
- throw new IndexOutOfBoundsException("Source does not fit in dest");
-
- Iterator i1 = source.iterator();
- ListIterator i2 = dest.listIterator();
-
- while (--pos >= 0)
- {
- i2.next();
- i2.set(i1.next());
- }
- }
-
- /**
- * Returns an Enumeration over a collection. This allows interoperability
- * with legacy APIs that require an Enumeration as input.
- *
- * @param c the Collection to iterate over
- * @return an Enumeration backed by an Iterator over c
- */
- public static Enumeration enumeration(Collection c)
- {
- final Iterator i = c.iterator();
- return new Enumeration()
- {
- /**
- * Returns <code>true</code> if there are more elements to
- * be enumerated.
- *
- * @return The result of <code>hasNext()</code>
- * called on the underlying iterator.
- */
- public final boolean hasMoreElements()
- {
- return i.hasNext();
- }
-
- /**
- * Returns the next element to be enumerated.
- *
- * @return The result of <code>next()</code>
- * called on the underlying iterator.
- */
- public final Object nextElement()
- {
- return i.next();
- }
- };
- }
-
- /**
- * Replace every element of a list with a given value. This method runs in
- * linear time.
- *
- * @param l the list to fill.
- * @param val the object to vill the list with.
- * @throws UnsupportedOperationException if l.listIterator() does not
- * support the set operation.
- */
- public static void fill(List l, Object val)
- {
- ListIterator itr = l.listIterator();
- for (int i = l.size() - 1; i >= 0; --i)
- {
- itr.next();
- itr.set(val);
- }
- }
-
- /**
- * Returns the starting index where the specified sublist first occurs
- * in a larger list, or -1 if there is no matching position. If
- * <code>target.size() &gt; source.size()</code>, this returns -1,
- * otherwise this implementation uses brute force, checking for
- * <code>source.sublist(i, i + target.size()).equals(target)</code>
- * for all possible i.
- *
- * @param source the list to search
- * @param target the sublist to search for
- * @return the index where found, or -1
- * @since 1.4
- */
- public static int indexOfSubList(List source, List target)
- {
- int ssize = source.size();
- for (int i = 0, j = target.size(); j <= ssize; i++, j++)
- if (source.subList(i, j).equals(target))
- return i;
- return -1;
- }
-
- /**
- * Returns the starting index where the specified sublist last occurs
- * in a larger list, or -1 if there is no matching position. If
- * <code>target.size() &gt; source.size()</code>, this returns -1,
- * otherwise this implementation uses brute force, checking for
- * <code>source.sublist(i, i + target.size()).equals(target)</code>
- * for all possible i.
- *
- * @param source the list to search
- * @param target the sublist to search for
- * @return the index where found, or -1
- * @since 1.4
- */
- public static int lastIndexOfSubList(List source, List target)
- {
- int ssize = source.size();
- for (int i = ssize - target.size(), j = ssize; i >= 0; i--, j--)
- if (source.subList(i, j).equals(target))
- return i;
- return -1;
- }
-
- /**
- * Returns an ArrayList holding the elements visited by a given
- * Enumeration. This method exists for interoperability between legacy
- * APIs and the new Collection API.
- *
- * @param e the enumeration to put in a list
- * @return a list containing the enumeration elements
- * @see ArrayList
- * @since 1.4
- */
- public static ArrayList list(Enumeration e)
- {
- ArrayList l = new ArrayList();
- while (e.hasMoreElements())
- l.add(e.nextElement());
- return l;
- }
-
- /**
- * Find the maximum element in a Collection, according to the natural
- * ordering of the elements. This implementation iterates over the
- * Collection, so it works in linear time.
- *
- * @param c the Collection to find the maximum element of
- * @return the maximum element of c
- * @exception NoSuchElementException if c is empty
- * @exception ClassCastException if elements in c are not mutually comparable
- * @exception NullPointerException if null.compareTo is called
- */
- public static Object max(Collection c)
- {
- return max(c, null);
- }
-
- /**
- * Find the maximum element in a Collection, according to a specified
- * Comparator. This implementation iterates over the Collection, so it
- * works in linear time.
- *
- * @param c the Collection to find the maximum element of
- * @param order the Comparator to order the elements by, or null for natural
- * ordering
- * @return the maximum element of c
- * @throws NoSuchElementException if c is empty
- * @throws ClassCastException if elements in c are not mutually comparable
- * @throws NullPointerException if null is compared by natural ordering
- * (only possible when order is null)
- */
- public static Object max(Collection c, Comparator order)
- {
- Iterator itr = c.iterator();
- Object max = itr.next(); // throws NoSuchElementException
- int csize = c.size();
- for (int i = 1; i < csize; i++)
- {
- Object o = itr.next();
- if (compare(max, o, order) < 0)
- max = o;
- }
- return max;
- }
-
- /**
- * Find the minimum element in a Collection, according to the natural
- * ordering of the elements. This implementation iterates over the
- * Collection, so it works in linear time.
- *
- * @param c the Collection to find the minimum element of
- * @return the minimum element of c
- * @throws NoSuchElementException if c is empty
- * @throws ClassCastException if elements in c are not mutually comparable
- * @throws NullPointerException if null.compareTo is called
- */
- public static Object min(Collection c)
- {
- return min(c, null);
- }
-
- /**
- * Find the minimum element in a Collection, according to a specified
- * Comparator. This implementation iterates over the Collection, so it
- * works in linear time.
- *
- * @param c the Collection to find the minimum element of
- * @param order the Comparator to order the elements by, or null for natural
- * ordering
- * @return the minimum element of c
- * @throws NoSuchElementException if c is empty
- * @throws ClassCastException if elements in c are not mutually comparable
- * @throws NullPointerException if null is compared by natural ordering
- * (only possible when order is null)
- */
- public static Object min(Collection c, Comparator order)
- {
- Iterator itr = c.iterator();
- Object min = itr.next(); // throws NoSuchElementExcception
- int csize = c.size();
- for (int i = 1; i < csize; i++)
- {
- Object o = itr.next();
- if (compare(min, o, order) > 0)
- min = o;
- }
- return min;
- }
-
- /**
- * Creates an immutable list consisting of the same object repeated n times.
- * The returned object is tiny, consisting of only a single reference to the
- * object and a count of the number of elements. It is Serializable, and
- * implements RandomAccess. You can use it in tandem with List.addAll for
- * fast list construction.
- *
- * @param n the number of times to repeat the object
- * @param o the object to repeat
- * @return a List consisting of n copies of o
- * @throws IllegalArgumentException if n &lt; 0
- * @see List#addAll(Collection)
- * @see Serializable
- * @see RandomAccess
- */
- public static List nCopies(final int n, final Object o)
- {
- return new CopiesList(n, o);
- }
-
- /**
- * The implementation of {@link #nCopies(int, Object)}. This class name
- * is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class CopiesList extends AbstractList
- implements Serializable, RandomAccess
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 2739099268398711800L;
-
- /**
- * The count of elements in this list.
- * @serial the list size
- */
- private final int n;
-
- /**
- * The repeated list element.
- * @serial the list contents
- */
- private final Object element;
-
- /**
- * Constructs the list.
- *
- * @param n the count
- * @param o the object
- * @throws IllegalArgumentException if n &lt; 0
- */
- CopiesList(int n, Object o)
- {
- if (n < 0)
- throw new IllegalArgumentException();
- this.n = n;
- element = o;
- }
-
- /**
- * The size is fixed.
- * @return The size of the list.
- */
- public int size()
- {
- return n;
- }
-
- /**
- * The same element is returned.
- * @param index The index of the element to be returned (irrelevant
- * as the list contains only copies of <code>element</code>).
- * @return The element used by this list.
- */
- public Object get(int index)
- {
- if (index < 0 || index >= n)
- throw new IndexOutOfBoundsException();
- return element;
- }
-
- // The remaining methods are optional, but provide a performance
- // advantage by not allocating unnecessary iterators in AbstractList.
- /**
- * This list only contains one element.
- * @param o The object to search for.
- * @return <code>true</code> if o is the element used by this list.
- */
- public boolean contains(Object o)
- {
- return n > 0 && equals(o, element);
- }
-
- /**
- * The index is either 0 or -1.
- * @param o The object to find the index of.
- * @return 0 if <code>o == element</code>, -1 if not.
- */
- public int indexOf(Object o)
- {
- return (n > 0 && equals(o, element)) ? 0 : -1;
- }
-
- /**
- * The index is either n-1 or -1.
- * @param o The object to find the last index of.
- * @return The last index in the list if <code>o == element</code>,
- * -1 if not.
- */
- public int lastIndexOf(Object o)
- {
- return equals(o, element) ? n - 1 : -1;
- }
-
- /**
- * A subList is just another CopiesList.
- * @param from The starting bound of the sublist.
- * @param to The ending bound of the sublist.
- * @return A list of copies containing <code>from - to</code>
- * elements, all of which are equal to the element
- * used by this list.
- */
- public List subList(int from, int to)
- {
- if (from < 0 || to > n)
- throw new IndexOutOfBoundsException();
- return new CopiesList(to - from, element);
- }
-
- /**
- * The array is easy.
- * @return An array of size n filled with copies of
- * the element used by this list.
- */
- public Object[] toArray()
- {
- Object[] a = new Object[n];
- Arrays.fill(a, element);
- return a;
- }
-
- /**
- * The string is easy to generate.
- * @return A string representation of the list.
- */
- public String toString()
- {
- StringBuffer r = new StringBuffer("{");
- for (int i = n - 1; --i > 0; )
- r.append(element).append(", ");
- r.append(element).append("}");
- return r.toString();
- }
- } // class CopiesList
-
- /**
- * Replace all instances of one object with another in the specified list.
- * The list does not change size. An element e is replaced if
- * <code>oldval == null ? e == null : oldval.equals(e)</code>.
- *
- * @param list the list to iterate over
- * @param oldval the element to replace
- * @param newval the new value for the element
- * @return <code>true</code> if a replacement occurred.
- * @throws UnsupportedOperationException if the list iterator does not allow
- * for the set operation
- * @throws ClassCastException if newval is of a type which cannot be added
- * to the list
- * @throws IllegalArgumentException if some other aspect of newval stops
- * it being added to the list
- * @since 1.4
- */
- public static boolean replaceAll(List list, Object oldval, Object newval)
- {
- ListIterator itr = list.listIterator();
- boolean replace_occured = false;
- for (int i = list.size(); --i >= 0; )
- if (AbstractCollection.equals(oldval, itr.next()))
- {
- itr.set(newval);
- replace_occured = true;
- }
- return replace_occured;
- }
-
- /**
- * Reverse a given list. This method works in linear time.
- *
- * @param l the list to reverse
- * @throws UnsupportedOperationException if l.listIterator() does not
- * support the set operation
- */
- public static void reverse(List l)
- {
- ListIterator i1 = l.listIterator();
- int pos1 = 1;
- int pos2 = l.size();
- ListIterator i2 = l.listIterator(pos2);
- while (pos1 < pos2)
- {
- Object o = i1.next();
- i1.set(i2.previous());
- i2.set(o);
- ++pos1;
- --pos2;
- }
- }
-
- /**
- * Get a comparator that implements the reverse of natural ordering. In
- * other words, this sorts Comparable objects opposite of how their
- * compareTo method would sort. This makes it easy to sort into reverse
- * order, by simply passing Collections.reverseOrder() to the sort method.
- * The return value of this method is Serializable.
- *
- * @return a comparator that imposes reverse natural ordering
- * @see Comparable
- * @see Serializable
- */
- public static Comparator reverseOrder()
- {
- return rcInstance;
- }
-
- /**
- * The object for {@link #reverseOrder()}.
- */
- private static final ReverseComparator rcInstance = new ReverseComparator();
-
- /**
- * The implementation of {@link #reverseOrder()}. This class name
- * is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class ReverseComparator
- implements Comparator, Serializable
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 7207038068494060240L;
-
- /**
- * A private constructor adds overhead.
- */
- ReverseComparator()
- {
- }
-
- /**
- * Compare two objects in reverse natural order.
- *
- * @param a the first object
- * @param b the second object
- * @return &lt;, ==, or &gt; 0 according to b.compareTo(a)
- */
- public int compare(Object a, Object b)
- {
- return ((Comparable) b).compareTo(a);
- }
- }
-
- /**
- * Rotate the elements in a list by a specified distance. After calling this
- * method, the element now at index <code>i</code> was formerly at index
- * <code>(i - distance) mod list.size()</code>. The list size is unchanged.
- * <p>
- *
- * For example, suppose a list contains <code>[t, a, n, k, s]</code>. After
- * either <code>Collections.rotate(l, 4)</code> or
- * <code>Collections.rotate(l, -1)</code>, the new contents are
- * <code>[s, t, a, n, k]</code>. This can be applied to sublists to rotate
- * just a portion of the list. For example, to move element <code>a</code>
- * forward two positions in the original example, use
- * <code>Collections.rotate(l.subList(1, 3+1), -1)</code>, which will
- * result in <code>[t, n, k, a, s]</code>.
- * <p>
- *
- * If the list is small or implements {@link RandomAccess}, the
- * implementation exchanges the first element to its destination, then the
- * displaced element, and so on until a circuit has been completed. The
- * process is repeated if needed on the second element, and so forth, until
- * all elements have been swapped. For large non-random lists, the
- * implementation breaks the list into two sublists at index
- * <code>-distance mod size</code>, calls {@link #reverse(List)} on the
- * pieces, then reverses the overall list.
- *
- * @param list the list to rotate
- * @param distance the distance to rotate by; unrestricted in value
- * @throws UnsupportedOperationException if the list does not support set
- * @since 1.4
- */
- public static void rotate(List list, int distance)
- {
- int size = list.size();
- if (size == 0)
- return;
- distance %= size;
- if (distance == 0)
- return;
- if (distance < 0)
- distance += size;
-
- if (isSequential(list))
- {
- reverse(list);
- reverse(list.subList(0, distance));
- reverse(list.subList(distance, size));
- }
- else
- {
- // Determine the least common multiple of distance and size, as there
- // are (distance / LCM) loops to cycle through.
- int a = size;
- int lcm = distance;
- int b = a % lcm;
- while (b != 0)
- {
- a = lcm;
- lcm = b;
- b = a % lcm;
- }
-
- // Now, make the swaps. We must take the remainder every time through
- // the inner loop so that we don't overflow i to negative values.
- while (--lcm >= 0)
- {
- Object o = list.get(lcm);
- for (int i = lcm + distance; i != lcm; i = (i + distance) % size)
- o = list.set(i, o);
- list.set(lcm, o);
- }
- }
- }
-
- /**
- * Shuffle a list according to a default source of randomness. The algorithm
- * used iterates backwards over the list, swapping each element with an
- * element randomly selected from the elements in positions less than or
- * equal to it (using r.nextInt(int)).
- * <p>
- *
- * This algorithm would result in a perfectly fair shuffle (that is, each
- * element would have an equal chance of ending up in any position) if r were
- * a perfect source of randomness. In practice the results are merely very
- * close to perfect.
- * <p>
- *
- * This method operates in linear time. To do this on large lists which do
- * not implement {@link RandomAccess}, a temporary array is used to acheive
- * this speed, since it would be quadratic access otherwise.
- *
- * @param l the list to shuffle
- * @throws UnsupportedOperationException if l.listIterator() does not
- * support the set operation
- */
- public static void shuffle(List l)
- {
- if (defaultRandom == null)
- {
- synchronized (Collections.class)
- {
- if (defaultRandom == null)
- defaultRandom = new Random();
- }
- }
- shuffle(l, defaultRandom);
- }
-
- /**
- * Cache a single Random object for use by shuffle(List). This improves
- * performance as well as ensuring that sequential calls to shuffle() will
- * not result in the same shuffle order occurring: the resolution of
- * System.currentTimeMillis() is not sufficient to guarantee a unique seed.
- */
- private static Random defaultRandom = null;
-
- /**
- * Shuffle a list according to a given source of randomness. The algorithm
- * used iterates backwards over the list, swapping each element with an
- * element randomly selected from the elements in positions less than or
- * equal to it (using r.nextInt(int)).
- * <p>
- *
- * This algorithm would result in a perfectly fair shuffle (that is, each
- * element would have an equal chance of ending up in any position) if r were
- * a perfect source of randomness. In practise (eg if r = new Random()) the
- * results are merely very close to perfect.
- * <p>
- *
- * This method operates in linear time. To do this on large lists which do
- * not implement {@link RandomAccess}, a temporary array is used to acheive
- * this speed, since it would be quadratic access otherwise.
- *
- * @param l the list to shuffle
- * @param r the source of randomness to use for the shuffle
- * @throws UnsupportedOperationException if l.listIterator() does not
- * support the set operation
- */
- public static void shuffle(List l, Random r)
- {
- int lsize = l.size();
- ListIterator i = l.listIterator(lsize);
- boolean sequential = isSequential(l);
- Object[] a = null; // stores a copy of the list for the sequential case
-
- if (sequential)
- a = l.toArray();
-
- for (int pos = lsize - 1; pos > 0; --pos)
- {
- // Obtain a random position to swap with. pos + 1 is used so that the
- // range of the random number includes the current position.
- int swap = r.nextInt(pos + 1);
-
- // Swap the desired element.
- Object o;
- if (sequential)
- {
- o = a[swap];
- a[swap] = i.previous();
- }
- else
- o = l.set(swap, i.previous());
-
- i.set(o);
- }
- }
-
-
- /**
- * Obtain an immutable Set consisting of a single element. The return value
- * of this method is Serializable.
- *
- * @param o the single element
- * @return an immutable Set containing only o
- * @see Serializable
- */
- public static Set singleton(Object o)
- {
- return new SingletonSet(o);
- }
-
- /**
- * The implementation of {@link #singleton(Object)}. This class name
- * is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class SingletonSet extends AbstractSet
- implements Serializable
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 3193687207550431679L;
-
-
- /**
- * The single element; package visible for use in nested class.
- * @serial the singleton
- */
- final Object element;
-
- /**
- * Construct a singleton.
- * @param o the element
- */
- SingletonSet(Object o)
- {
- element = o;
- }
-
- /**
- * The size: always 1!
- * @return 1.
- */
- public int size()
- {
- return 1;
- }
-
- /**
- * Returns an iterator over the lone element.
- */
- public Iterator iterator()
- {
- return new Iterator()
- {
- /**
- * Flag to indicate whether or not the element has
- * been retrieved.
- */
- private boolean hasNext = true;
-
- /**
- * Returns <code>true</code> if elements still remain to be
- * iterated through.
- *
- * @return <code>true</code> if the element has not yet been returned.
- */
- public boolean hasNext()
- {
- return hasNext;
- }
-
- /**
- * Returns the element.
- *
- * @return The element used by this singleton.
- * @throws NoSuchElementException if the object
- * has already been retrieved.
- */
- public Object next()
- {
- if (hasNext)
- {
- hasNext = false;
- return element;
- }
- else
- throw new NoSuchElementException();
- }
-
- /**
- * Removes the element from the singleton.
- * As this set is immutable, this will always
- * throw an exception.
- *
- * @throws UnsupportedOperationException as the
- * singleton set doesn't support
- * <code>remove()</code>.
- */
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- };
- }
-
- // The remaining methods are optional, but provide a performance
- // advantage by not allocating unnecessary iterators in AbstractSet.
- /**
- * The set only contains one element.
- *
- * @param o The object to search for.
- * @return <code>true</code> if o == the element of the singleton.
- */
- public boolean contains(Object o)
- {
- return equals(o, element);
- }
-
- /**
- * This is true if the other collection only contains the element.
- *
- * @param c A collection to compare against this singleton.
- * @return <code>true</code> if c only contains either no elements or
- * elements equal to the element in this singleton.
- */
- public boolean containsAll(Collection c)
- {
- Iterator i = c.iterator();
- int pos = c.size();
- while (--pos >= 0)
- if (! equals(i.next(), element))
- return false;
- return true;
- }
-
- /**
- * The hash is just that of the element.
- *
- * @return The hashcode of the element.
- */
- public int hashCode()
- {
- return hashCode(element);
- }
-
- /**
- * Returning an array is simple.
- *
- * @return An array containing the element.
- */
- public Object[] toArray()
- {
- return new Object[] {element};
- }
-
- /**
- * Obvious string.
- *
- * @return The string surrounded by enclosing
- * square brackets.
- */
- public String toString()
- {
- return "[" + element + "]";
- }
- } // class SingletonSet
-
- /**
- * Obtain an immutable List consisting of a single element. The return value
- * of this method is Serializable, and implements RandomAccess.
- *
- * @param o the single element
- * @return an immutable List containing only o
- * @see Serializable
- * @see RandomAccess
- * @since 1.3
- */
- public static List singletonList(Object o)
- {
- return new SingletonList(o);
- }
-
- /**
- * The implementation of {@link #singletonList(Object)}. This class name
- * is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class SingletonList extends AbstractList
- implements Serializable, RandomAccess
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 3093736618740652951L;
-
- /**
- * The single element.
- * @serial the singleton
- */
- private final Object element;
-
- /**
- * Construct a singleton.
- * @param o the element
- */
- SingletonList(Object o)
- {
- element = o;
- }
-
- /**
- * The size: always 1!
- * @return 1.
- */
- public int size()
- {
- return 1;
- }
-
- /**
- * Only index 0 is valid.
- * @param index The index of the element
- * to retrieve.
- * @return The singleton's element if the
- * index is 0.
- * @throws IndexOutOfBoundsException if
- * index is not 0.
- */
- public Object get(int index)
- {
- if (index == 0)
- return element;
- throw new IndexOutOfBoundsException();
- }
-
- // The remaining methods are optional, but provide a performance
- // advantage by not allocating unnecessary iterators in AbstractList.
- /**
- * The set only contains one element.
- *
- * @param o The object to search for.
- * @return <code>true</code> if o == the singleton element.
- */
- public boolean contains(Object o)
- {
- return equals(o, element);
- }
-
- /**
- * This is true if the other collection only contains the element.
- *
- * @param c A collection to compare against this singleton.
- * @return <code>true</code> if c only contains either no elements or
- * elements equal to the element in this singleton.
- */
- public boolean containsAll(Collection c)
- {
- Iterator i = c.iterator();
- int pos = c.size();
- while (--pos >= 0)
- if (! equals(i.next(), element))
- return false;
- return true;
- }
-
- /**
- * Speed up the hashcode computation.
- *
- * @return The hashcode of the list, based
- * on the hashcode of the singleton element.
- */
- public int hashCode()
- {
- return 31 + hashCode(element);
- }
-
- /**
- * Either the list has it or not.
- *
- * @param o The object to find the first index of.
- * @return 0 if o is the singleton element, -1 if not.
- */
- public int indexOf(Object o)
- {
- return equals(o, element) ? 0 : -1;
- }
-
- /**
- * Either the list has it or not.
- *
- * @param o The object to find the last index of.
- * @return 0 if o is the singleton element, -1 if not.
- */
- public int lastIndexOf(Object o)
- {
- return equals(o, element) ? 0 : -1;
- }
-
- /**
- * Sublists are limited in scope.
- *
- * @param from The starting bound for the sublist.
- * @param to The ending bound for the sublist.
- * @return Either an empty list if both bounds are
- * 0 or 1, or this list if the bounds are 0 and 1.
- * @throws IllegalArgumentException if <code>from > to</code>
- * @throws IndexOutOfBoundsException if either bound is greater
- * than 1.
- */
- public List subList(int from, int to)
- {
- if (from == to && (to == 0 || to == 1))
- return EMPTY_LIST;
- if (from == 0 && to == 1)
- return this;
- if (from > to)
- throw new IllegalArgumentException();
- throw new IndexOutOfBoundsException();
- }
-
- /**
- * Returning an array is simple.
- *
- * @return An array containing the element.
- */
- public Object[] toArray()
- {
- return new Object[] {element};
- }
-
- /**
- * Obvious string.
- *
- * @return The string surrounded by enclosing
- * square brackets.
- */
- public String toString()
- {
- return "[" + element + "]";
- }
- } // class SingletonList
-
- /**
- * Obtain an immutable Map consisting of a single key-value pair.
- * The return value of this method is Serializable.
- *
- * @param key the single key
- * @param value the single value
- * @return an immutable Map containing only the single key-value pair
- * @see Serializable
- * @since 1.3
- */
- public static Map singletonMap(Object key, Object value)
- {
- return new SingletonMap(key, value);
- }
-
- /**
- * The implementation of {@link #singletonMap(Object)}. This class name
- * is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class SingletonMap extends AbstractMap
- implements Serializable
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -6979724477215052911L;
-
- /**
- * The single key.
- * @serial the singleton key
- */
- private final Object k;
-
- /**
- * The corresponding value.
- * @serial the singleton value
- */
- private final Object v;
-
- /**
- * Cache the entry set.
- */
- private transient Set entries;
-
- /**
- * Construct a singleton.
- * @param key the key
- * @param value the value
- */
- SingletonMap(Object key, Object value)
- {
- k = key;
- v = value;
- }
-
- /**
- * There is a single immutable entry.
- *
- * @return A singleton containing the map entry.
- */
- public Set entrySet()
- {
- if (entries == null)
- entries = singleton(new AbstractMap.BasicMapEntry(k, v)
- {
- /**
- * Sets the value of the map entry to the supplied value.
- * An exception is always thrown, as the map is immutable.
- *
- * @param o The new value.
- * @return The old value.
- * @throws UnsupportedOperationException as setting the value
- * is not supported.
- */
- public Object setValue(Object o)
- {
- throw new UnsupportedOperationException();
- }
- });
- return entries;
- }
-
- // The remaining methods are optional, but provide a performance
- // advantage by not allocating unnecessary iterators in AbstractMap.
- /**
- * Single entry.
- *
- * @param key The key to look for.
- * @return <code>true</code> if the key is the same as the one used by
- * this map.
- */
- public boolean containsKey(Object key)
- {
- return equals(key, k);
- }
-
- /**
- * Single entry.
- *
- * @param value The value to look for.
- * @return <code>true</code> if the value is the same as the one used by
- * this map.
- */
- public boolean containsValue(Object value)
- {
- return equals(value, v);
- }
-
- /**
- * Single entry.
- *
- * @param key The key of the value to be retrieved.
- * @return The singleton value if the key is the same as the
- * singleton key, null otherwise.
- */
- public Object get(Object key)
- {
- return equals(key, k) ? v : null;
- }
-
- /**
- * Calculate the hashcode directly.
- *
- * @return The hashcode computed from the singleton key
- * and the singleton value.
- */
- public int hashCode()
- {
- return hashCode(k) ^ hashCode(v);
- }
-
- /**
- * Return the keyset.
- *
- * @return A singleton containing the key.
- */
- public Set keySet()
- {
- if (keys == null)
- keys = singleton(k);
- return keys;
- }
-
- /**
- * The size: always 1!
- *
- * @return 1.
- */
- public int size()
- {
- return 1;
- }
-
- /**
- * Return the values. Technically, a singleton, while more specific than
- * a general Collection, will work. Besides, that's what the JDK uses!
- *
- * @return A singleton containing the value.
- */
- public Collection values()
- {
- if (values == null)
- values = singleton(v);
- return values;
- }
-
- /**
- * Obvious string.
- *
- * @return A string containing the string representations of the key
- * and its associated value.
- */
- public String toString()
- {
- return "{" + k + "=" + v + "}";
- }
- } // class SingletonMap
-
- /**
- * Sort a list according to the natural ordering of its elements. The list
- * must be modifiable, but can be of fixed size. The sort algorithm is
- * precisely that used by Arrays.sort(Object[]), which offers guaranteed
- * nlog(n) performance. This implementation dumps the list into an array,
- * sorts the array, and then iterates over the list setting each element from
- * the array.
- *
- * @param l the List to sort
- * @throws ClassCastException if some items are not mutually comparable
- * @throws UnsupportedOperationException if the List is not modifiable
- * @throws NullPointerException if some element is null
- * @see Arrays#sort(Object[])
- */
- public static void sort(List l)
- {
- sort(l, null);
- }
-
- /**
- * Sort a list according to a specified Comparator. The list must be
- * modifiable, but can be of fixed size. The sort algorithm is precisely that
- * used by Arrays.sort(Object[], Comparator), which offers guaranteed
- * nlog(n) performance. This implementation dumps the list into an array,
- * sorts the array, and then iterates over the list setting each element from
- * the array.
- *
- * @param l the List to sort
- * @param c the Comparator specifying the ordering for the elements, or
- * null for natural ordering
- * @throws ClassCastException if c will not compare some pair of items
- * @throws UnsupportedOperationException if the List is not modifiable
- * @throws NullPointerException if null is compared by natural ordering
- * (only possible when c is null)
- * @see Arrays#sort(Object[], Comparator)
- */
- public static void sort(List l, Comparator c)
- {
- Object[] a = l.toArray();
- Arrays.sort(a, c);
- ListIterator i = l.listIterator();
- for (int pos = 0, alen = a.length; pos < alen; pos++)
- {
- i.next();
- i.set(a[pos]);
- }
- }
-
- /**
- * Swaps the elements at the specified positions within the list. Equal
- * positions have no effect.
- *
- * @param l the list to work on
- * @param i the first index to swap
- * @param j the second index
- * @throws UnsupportedOperationException if list.set is not supported
- * @throws IndexOutOfBoundsException if either i or j is &lt; 0 or &gt;=
- * list.size()
- * @since 1.4
- */
- public static void swap(List l, int i, int j)
- {
- l.set(i, l.set(j, l.get(i)));
- }
-
-
- /**
- * Returns a synchronized (thread-safe) collection wrapper backed by the
- * given collection. Notice that element access through the iterators
- * is thread-safe, but if the collection can be structurally modified
- * (adding or removing elements) then you should synchronize around the
- * iteration to avoid non-deterministic behavior:<br>
- * <pre>
- * Collection c = Collections.synchronizedCollection(new Collection(...));
- * ...
- * synchronized (c)
- * {
- * Iterator i = c.iterator();
- * while (i.hasNext())
- * foo(i.next());
- * }
- * </pre><p>
- *
- * Since the collection might be a List or a Set, and those have incompatible
- * equals and hashCode requirements, this relies on Object's implementation
- * rather than passing those calls on to the wrapped collection. The returned
- * Collection implements Serializable, but can only be serialized if
- * the collection it wraps is likewise Serializable.
- *
- * @param c the collection to wrap
- * @return a synchronized view of the collection
- * @see Serializable
- */
- public static Collection synchronizedCollection(Collection c)
- {
- return new SynchronizedCollection(c);
- }
-
- /**
- * The implementation of {@link #synchronizedCollection(Collection)}. This
- * class name is required for compatibility with Sun's JDK serializability.
- * Package visible, so that collections such as the one for
- * Hashtable.values() can specify which object to synchronize on.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- static class SynchronizedCollection
- implements Collection, Serializable
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 3053995032091335093L;
-
- /**
- * The wrapped collection. Package visible for use by subclasses.
- * @serial the real collection
- */
- final Collection c;
-
- /**
- * The object to synchronize on. When an instance is created via public
- * methods, it will be this; but other uses like SynchronizedMap.values()
- * must specify another mutex. Package visible for use by subclasses.
- * @serial the lock
- */
- final Object mutex;
-
- /**
- * Wrap a given collection.
- * @param c the collection to wrap
- * @throws NullPointerException if c is null
- */
- SynchronizedCollection(Collection c)
- {
- this.c = c;
- mutex = this;
- if (c == null)
- throw new NullPointerException();
- }
-
- /**
- * Called only by trusted code to specify the mutex as well as the
- * collection.
- * @param sync the mutex
- * @param c the collection
- */
- SynchronizedCollection(Object sync, Collection c)
- {
- this.c = c;
- mutex = sync;
- }
-
- /**
- * Adds the object to the underlying collection, first
- * obtaining a lock on the mutex.
- *
- * @param o The object to add.
- * @return <code>true</code> if the collection was modified as a result
- * of this action.
- * @throws UnsupportedOperationException if this collection does not
- * support the add operation.
- * @throws ClassCastException if o cannot be added to this collection due
- * to its type.
- * @throws NullPointerException if o is null and this collection doesn't
- * support the addition of null values.
- * @throws IllegalArgumentException if o cannot be added to this
- * collection for some other reason.
- */
- public boolean add(Object o)
- {
- synchronized (mutex)
- {
- return c.add(o);
- }
- }
-
- /**
- * Adds the objects in col to the underlying collection, first
- * obtaining a lock on the mutex.
- *
- * @param col The collection to take the new objects from.
- * @return <code>true</code> if the collection was modified as a result
- * of this action.
- * @throws UnsupportedOperationException if this collection does not
- * support the addAll operation.
- * @throws ClassCastException if some element of col cannot be added to this
- * collection due to its type.
- * @throws NullPointerException if some element of col is null and this
- * collection does not support the addition of null values.
- * @throws NullPointerException if col itself is null.
- * @throws IllegalArgumentException if some element of col cannot be added
- * to this collection for some other reason.
- */
- public boolean addAll(Collection col)
- {
- synchronized (mutex)
- {
- return c.addAll(col);
- }
- }
-
- /**
- * Removes all objects from the underlying collection,
- * first obtaining a lock on the mutex.
- *
- * @throws UnsupportedOperationException if this collection does not
- * support the clear operation.
- */
- public void clear()
- {
- synchronized (mutex)
- {
- c.clear();
- }
- }
-
- /**
- * Checks for the existence of o within the underlying
- * collection, first obtaining a lock on the mutex.
- *
- * @param o the element to look for.
- * @return <code>true</code> if this collection contains at least one
- * element e such that <code>o == null ? e == null : o.equals(e)</code>.
- * @throws ClassCastException if the type of o is not a valid type for this
- * collection.
- * @throws NullPointerException if o is null and this collection doesn't
- * support null values.
- */
- public boolean contains(Object o)
- {
- synchronized (mutex)
- {
- return c.contains(o);
- }
- }
-
- /**
- * Checks for the existence of each object in cl
- * within the underlying collection, first obtaining
- * a lock on the mutex.
- *
- * @param cl the collection to test for.
- * @return <code>true</code> if for every element o in c, contains(o)
- * would return <code>true</code>.
- * @throws ClassCastException if the type of any element in cl is not a valid
- * type for this collection.
- * @throws NullPointerException if some element of cl is null and this
- * collection does not support null values.
- * @throws NullPointerException if cl itself is null.
- */
- public boolean containsAll(Collection c1)
- {
- synchronized (mutex)
- {
- return c.containsAll(c1);
- }
- }
-
- /**
- * Returns <code>true</code> if there are no objects in the underlying
- * collection. A lock on the mutex is obtained before the
- * check is performed.
- *
- * @return <code>true</code> if this collection contains no elements.
- */
- public boolean isEmpty()
- {
- synchronized (mutex)
- {
- return c.isEmpty();
- }
- }
-
- /**
- * Returns a synchronized iterator wrapper around the underlying
- * collection's iterator. A lock on the mutex is obtained before
- * retrieving the collection's iterator.
- *
- * @return An iterator over the elements in the underlying collection,
- * which returns each element in any order.
- */
- public Iterator iterator()
- {
- synchronized (mutex)
- {
- return new SynchronizedIterator(mutex, c.iterator());
- }
- }
-
- /**
- * Removes the specified object from the underlying collection,
- * first obtaining a lock on the mutex.
- *
- * @param o The object to remove.
- * @return <code>true</code> if the collection changed as a result of this call, that is,
- * if the collection contained at least one occurrence of o.
- * @throws UnsupportedOperationException if this collection does not
- * support the remove operation.
- * @throws ClassCastException if the type of o is not a valid type
- * for this collection.
- * @throws NullPointerException if o is null and the collection doesn't
- * support null values.
- */
- public boolean remove(Object o)
- {
- synchronized (mutex)
- {
- return c.remove(o);
- }
- }
-
- /**
- * Removes all elements, e, of the underlying
- * collection for which <code>col.contains(e)</code>
- * returns <code>true</code>. A lock on the mutex is obtained
- * before the operation proceeds.
- *
- * @param col The collection of objects to be removed.
- * @return <code>true</code> if this collection was modified as a result of this call.
- * @throws UnsupportedOperationException if this collection does not
- * support the removeAll operation.
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this collection.
- * @throws NullPointerException if some element of c is null and this
- * collection does not support removing null values.
- * @throws NullPointerException if c itself is null.
- */
- public boolean removeAll(Collection col)
- {
- synchronized (mutex)
- {
- return c.removeAll(col);
- }
- }
-
- /**
- * Retains all elements, e, of the underlying
- * collection for which <code>col.contains(e)</code>
- * returns <code>true</code>. That is, every element that doesn't
- * exist in col is removed. A lock on the mutex is obtained
- * before the operation proceeds.
- *
- * @param col The collection of objects to be removed.
- * @return <code>true</code> if this collection was modified as a result of this call.
- * @throws UnsupportedOperationException if this collection does not
- * support the removeAll operation.
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this collection.
- * @throws NullPointerException if some element of c is null and this
- * collection does not support removing null values.
- * @throws NullPointerException if c itself is null.
- */
- public boolean retainAll(Collection col)
- {
- synchronized (mutex)
- {
- return c.retainAll(col);
- }
- }
-
- /**
- * Retrieves the size of the underlying collection.
- * A lock on the mutex is obtained before the collection
- * is accessed.
- *
- * @return The size of the collection.
- */
- public int size()
- {
- synchronized (mutex)
- {
- return c.size();
- }
- }
-
- /**
- * Returns an array containing each object within the underlying
- * collection. A lock is obtained on the mutex before the collection
- * is accessed.
- *
- * @return An array of objects, matching the collection in size. The
- * elements occur in any order.
- */
- public Object[] toArray()
- {
- synchronized (mutex)
- {
- return c.toArray();
- }
- }
-
- /**
- * Copies the elements in the underlying collection to the supplied
- * array. If <code>a.length < size()</code>, a new array of the
- * same run-time type is created, with a size equal to that of
- * the collection. If <code>a.length > size()</code>, then the
- * elements from 0 to <code>size() - 1</code> contain the elements
- * from this collection. The following element is set to null
- * to indicate the end of the collection objects. However, this
- * only makes a difference if null is not a permitted value within
- * the collection.
- * Before the copying takes place, a lock is obtained on the mutex.
- *
- * @param a An array to copy elements to.
- * @return An array containing the elements of the underlying collection.
- * @throws ArrayStoreException if the type of any element of the
- * collection is not a subtype of the element type of a.
- */
- public Object[] toArray(Object[] a)
- {
- synchronized (mutex)
- {
- return c.toArray(a);
- }
- }
-
- /**
- * Returns a string representation of the underlying collection.
- * A lock is obtained on the mutex before the string is created.
- *
- * @return A string representation of the collection.
- */
- public String toString()
- {
- synchronized (mutex)
- {
- return c.toString();
- }
- }
- } // class SynchronizedCollection
-
- /**
- * The implementation of the various iterator methods in the
- * synchronized classes. These iterators must "sync" on the same object
- * as the collection they iterate over.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static class SynchronizedIterator implements Iterator
- {
- /**
- * The object to synchronize on. Package visible for use by subclass.
- */
- final Object mutex;
-
- /**
- * The wrapped iterator.
- */
- private final Iterator i;
-
- /**
- * Only trusted code creates a wrapper, with the specified sync.
- * @param sync the mutex
- * @param i the wrapped iterator
- */
- SynchronizedIterator(Object sync, Iterator i)
- {
- this.i = i;
- mutex = sync;
- }
-
- /**
- * Retrieves the next object in the underlying collection.
- * A lock is obtained on the mutex before the collection is accessed.
- *
- * @return The next object in the collection.
- * @throws NoSuchElementException if there are no more elements
- */
- public Object next()
- {
- synchronized (mutex)
- {
- return i.next();
- }
- }
-
- /**
- * Returns <code>true</code> if objects can still be retrieved from the iterator
- * using <code>next()</code>. A lock is obtained on the mutex before
- * the collection is accessed.
- *
- * @return <code>true</code> if at least one element is still to be returned by
- * <code>next()</code>.
- */
- public boolean hasNext()
- {
- synchronized (mutex)
- {
- return i.hasNext();
- }
- }
-
- /**
- * Removes the object that was last returned by <code>next()</code>
- * from the underlying collection. Only one call to this method is
- * allowed per call to the <code>next()</code> method, and it does
- * not affect the value that will be returned by <code>next()</code>.
- * Thus, if element n was retrieved from the collection by
- * <code>next()</code>, it is this element that gets removed.
- * Regardless of whether this takes place or not, element n+1 is
- * still returned on the subsequent <code>next()</code> call.
- *
- * @throws IllegalStateException if next has not yet been called or remove
- * has already been called since the last call to next.
- * @throws UnsupportedOperationException if this Iterator does not support
- * the remove operation.
- */
- public void remove()
- {
- synchronized (mutex)
- {
- i.remove();
- }
- }
- } // class SynchronizedIterator
-
- /**
- * Returns a synchronized (thread-safe) list wrapper backed by the
- * given list. Notice that element access through the iterators
- * is thread-safe, but if the list can be structurally modified
- * (adding or removing elements) then you should synchronize around the
- * iteration to avoid non-deterministic behavior:<br>
- * <pre>
- * List l = Collections.synchronizedList(new List(...));
- * ...
- * synchronized (l)
- * {
- * Iterator i = l.iterator();
- * while (i.hasNext())
- * foo(i.next());
- * }
- * </pre><p>
- *
- * The returned List implements Serializable, but can only be serialized if
- * the list it wraps is likewise Serializable. In addition, if the wrapped
- * list implements RandomAccess, this does too.
- *
- * @param l the list to wrap
- * @return a synchronized view of the list
- * @see Serializable
- * @see RandomAccess
- */
- public static List synchronizedList(List l)
- {
- if (l instanceof RandomAccess)
- return new SynchronizedRandomAccessList(l);
- return new SynchronizedList(l);
- }
-
- /**
- * The implementation of {@link #synchronizedList(List)} for sequential
- * lists. This class name is required for compatibility with Sun's JDK
- * serializability. Package visible, so that lists such as Vector.subList()
- * can specify which object to synchronize on.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- static class SynchronizedList extends SynchronizedCollection
- implements List
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -7754090372962971524L;
-
- /**
- * The wrapped list; stored both here and in the superclass to avoid
- * excessive casting. Package visible for use by subclass.
- * @serial the wrapped list
- */
- final List list;
-
- /**
- * Wrap a given list.
- * @param l the list to wrap
- * @throws NullPointerException if l is null
- */
- SynchronizedList(List l)
- {
- super(l);
- list = l;
- }
-
- /**
- * Called only by trusted code to specify the mutex as well as the list.
- * @param sync the mutex
- * @param l the list
- */
- SynchronizedList(Object sync, List l)
- {
- super(sync, l);
- list = l;
- }
-
- /**
- * Insert an element into the underlying list at a given position (optional
- * operation). This shifts all existing elements from that position to the
- * end one index to the right. This version of add has no return, since it is
- * assumed to always succeed if there is no exception. Before the
- * addition takes place, a lock is obtained on the mutex.
- *
- * @param index the location to insert the item
- * @param o the object to insert
- * @throws UnsupportedOperationException if this list does not support the
- * add operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason
- * @throws NullPointerException if o is null and this list doesn't support
- * the addition of null values.
- */
- public void add(int index, Object o)
- {
- synchronized (mutex)
- {
- list.add(index, o);
- }
- }
-
- /**
- * Add an element to the end of the underlying list (optional operation).
- * If the list imposes restraints on what can be inserted, such as no null
- * elements, this should be documented. A lock is obtained on the mutex before
- * any of the elements are added.
- *
- * @param o the object to add
- * @return <code>true</code>, as defined by Collection for a modified list
- * @throws UnsupportedOperationException if this list does not support the
- * add operation
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason
- * @throws NullPointerException if o is null and this list doesn't support
- * the addition of null values.
- */
- public boolean addAll(int index, Collection c)
- {
- synchronized (mutex)
- {
- return list.addAll(index, c);
- }
- }
-
- /**
- * Tests whether the underlying list is equal to the supplied object.
- * The object is deemed to be equal if it is also a <code>List</code>
- * of equal size and with the same elements (i.e. each element, e1,
- * in list, l1, and each element, e2, in l2, must return <code>true</code> for
- * <code>e1 == null ? e2 == null : e1.equals(e2)</code>. Before the
- * comparison is made, a lock is obtained on the mutex.
- *
- * @param o The object to test for equality with the underlying list.
- * @return <code>true</code> if o is equal to the underlying list under the above
- * definition.
- */
- public boolean equals(Object o)
- {
- synchronized (mutex)
- {
- return list.equals(o);
- }
- }
-
- /**
- * Retrieves the object at the specified index. A lock
- * is obtained on the mutex before the list is accessed.
- *
- * @param index the index of the element to be returned
- * @return the element at index index in this list
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object get(int index)
- {
- synchronized (mutex)
- {
- return list.get(index);
- }
- }
-
- /**
- * Obtains a hashcode for the underlying list, first obtaining
- * a lock on the mutex. The calculation of the hashcode is
- * detailed in the documentation for the <code>List</code>
- * interface.
- *
- * @return The hashcode of the underlying list.
- * @see List#hashCode()
- */
- public int hashCode()
- {
- synchronized (mutex)
- {
- return list.hashCode();
- }
- }
-
- /**
- * Obtain the first index at which a given object is to be found in the
- * underlying list. A lock is obtained on the mutex before the list is
- * accessed.
- *
- * @param o the object to search for
- * @return the least integer n such that <code>o == null ? get(n) == null :
- * o.equals(get(n))</code>, or -1 if there is no such index.
- * @throws ClassCastException if the type of o is not a valid
- * type for this list.
- * @throws NullPointerException if o is null and this
- * list does not support null values.
- */
-
- public int indexOf(Object o)
- {
- synchronized (mutex)
- {
- return list.indexOf(o);
- }
- }
-
- /**
- * Obtain the last index at which a given object is to be found in this
- * underlying list. A lock is obtained on the mutex before the list
- * is accessed.
- *
- * @return the greatest integer n such that <code>o == null ? get(n) == null
- * : o.equals(get(n))</code>, or -1 if there is no such index.
- * @throws ClassCastException if the type of o is not a valid
- * type for this list.
- * @throws NullPointerException if o is null and this
- * list does not support null values.
- */
- public int lastIndexOf(Object o)
- {
- synchronized (mutex)
- {
- return list.lastIndexOf(o);
- }
- }
-
- /**
- * Retrieves a synchronized wrapper around the underlying list's
- * list iterator. A lock is obtained on the mutex before the
- * list iterator is retrieved.
- *
- * @return A list iterator over the elements in the underlying list.
- * The list iterator allows additional list-specific operations
- * to be performed, in addition to those supplied by the
- * standard iterator.
- */
- public ListIterator listIterator()
- {
- synchronized (mutex)
- {
- return new SynchronizedListIterator(mutex, list.listIterator());
- }
- }
-
- /**
- * Retrieves a synchronized wrapper around the underlying list's
- * list iterator. A lock is obtained on the mutex before the
- * list iterator is retrieved. The iterator starts at the
- * index supplied, leading to the element at that index being
- * the first one returned by <code>next()</code>. Calling
- * <code>previous()</code> from this initial position returns
- * index - 1.
- *
- * @param index the position, between 0 and size() inclusive, to begin the
- * iteration from
- * @return A list iterator over the elements in the underlying list.
- * The list iterator allows additional list-specific operations
- * to be performed, in addition to those supplied by the
- * standard iterator.
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- public ListIterator listIterator(int index)
- {
- synchronized (mutex)
- {
- return new SynchronizedListIterator(mutex, list.listIterator(index));
- }
- }
-
- /**
- * Remove the element at a given position in the underlying list (optional
- * operation). All remaining elements are shifted to the left to fill the gap.
- * A lock on the mutex is obtained before the element is removed.
- *
- * @param index the position within the list of the object to remove
- * @return the object that was removed
- * @throws UnsupportedOperationException if this list does not support the
- * remove operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object remove(int index)
- {
- synchronized (mutex)
- {
- return list.remove(index);
- }
- }
-
- /**
- * Replace an element of the underlying list with another object (optional
- * operation). A lock is obtained on the mutex before the element is
- * replaced.
- *
- * @param index the position within this list of the element to be replaced
- * @param o the object to replace it with
- * @return the object that was replaced
- * @throws UnsupportedOperationException if this list does not support the
- * set operation.
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason
- * @throws NullPointerException if o is null and this
- * list does not support null values.
- */
- public Object set(int index, Object o)
- {
- synchronized (mutex)
- {
- return list.set(index, o);
- }
- }
-
- /**
- * Obtain a List view of a subsection of the underlying list, from fromIndex
- * (inclusive) to toIndex (exclusive). If the two indices are equal, the
- * sublist is empty. The returned list should be modifiable if and only
- * if this list is modifiable. Changes to the returned list should be
- * reflected in this list. If this list is structurally modified in
- * any way other than through the returned list, the result of any subsequent
- * operations on the returned list is undefined. A lock is obtained
- * on the mutex before the creation of the sublist. The returned list
- * is also synchronized, using the same mutex.
- *
- * @param fromIndex the index that the returned list should start from
- * (inclusive)
- * @param toIndex the index that the returned list should go to (exclusive)
- * @return a List backed by a subsection of this list
- * @throws IndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; size() || fromIndex &gt; toIndex
- */
- public List subList(int fromIndex, int toIndex)
- {
- synchronized (mutex)
- {
- return new SynchronizedList(mutex, list.subList(fromIndex, toIndex));
- }
- }
- } // class SynchronizedList
-
- /**
- * The implementation of {@link #synchronizedList(List)} for random-access
- * lists. This class name is required for compatibility with Sun's JDK
- * serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class SynchronizedRandomAccessList
- extends SynchronizedList implements RandomAccess
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 1530674583602358482L;
-
- /**
- * Wrap a given list.
- * @param l the list to wrap
- * @throws NullPointerException if l is null
- */
- SynchronizedRandomAccessList(List l)
- {
- super(l);
- }
-
- /**
- * Called only by trusted code to specify the mutex as well as the
- * collection.
- * @param sync the mutex
- * @param l the list
- */
- SynchronizedRandomAccessList(Object sync, List l)
- {
- super(sync, l);
- }
-
- /**
- * Obtain a List view of a subsection of the underlying list, from fromIndex
- * (inclusive) to toIndex (exclusive). If the two indices are equal, the
- * sublist is empty. The returned list should be modifiable if and only
- * if this list is modifiable. Changes to the returned list should be
- * reflected in this list. If this list is structurally modified in
- * any way other than through the returned list, the result of any subsequent
- * operations on the returned list is undefined. A lock is obtained
- * on the mutex before the creation of the sublist. The returned list
- * is also synchronized, using the same mutex. Random accessibility
- * is also extended to the new list.
- *
- * @param fromIndex the index that the returned list should start from
- * (inclusive)
- * @param toIndex the index that the returned list should go to (exclusive)
- * @return a List backed by a subsection of this list
- * @throws IndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; size() || fromIndex &gt; toIndex
- */
- public List subList(int fromIndex, int toIndex)
- {
- synchronized (mutex)
- {
- return new SynchronizedRandomAccessList(mutex,
- list.subList(fromIndex,
- toIndex));
- }
- }
- } // class SynchronizedRandomAccessList
-
- /**
- * The implementation of {@link SynchronizedList#listIterator()}. This
- * iterator must "sync" on the same object as the list it iterates over.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class SynchronizedListIterator
- extends SynchronizedIterator implements ListIterator
- {
- /**
- * The wrapped iterator, stored both here and in the superclass to
- * avoid excessive casting.
- */
- private final ListIterator li;
-
- /**
- * Only trusted code creates a wrapper, with the specified sync.
- * @param sync the mutex
- * @param li the wrapped iterator
- */
- SynchronizedListIterator(Object sync, ListIterator li)
- {
- super(sync, li);
- this.li = li;
- }
-
- /**
- * Insert an element into the underlying list at the current position of
- * the iterator (optional operation). The element is inserted in between
- * the element that would be returned by <code>previous()</code> and the
- * element that would be returned by <code>next()</code>. After the
- * insertion, a subsequent call to next is unaffected, but
- * a call to previous returns the item that was added. The values returned
- * by nextIndex() and previousIndex() are incremented. A lock is obtained
- * on the mutex before the addition takes place.
- *
- * @param o the object to insert into the list
- * @throws ClassCastException if the object is of a type which cannot be added
- * to this list.
- * @throws IllegalArgumentException if some other aspect of the object stops
- * it being added to this list.
- * @throws UnsupportedOperationException if this ListIterator does not
- * support the add operation.
- */
- public void add(Object o)
- {
- synchronized (mutex)
- {
- li.add(o);
- }
- }
-
- /**
- * Tests whether there are elements remaining in the underlying list
- * in the reverse direction. In other words, <code>previous()</code>
- * will not fail with a NoSuchElementException. A lock is obtained
- * on the mutex before the check takes place.
- *
- * @return <code>true</code> if the list continues in the reverse direction
- */
- public boolean hasPrevious()
- {
- synchronized (mutex)
- {
- return li.hasPrevious();
- }
- }
-
- /**
- * Find the index of the element that would be returned by a call to
- * <code>next()</code>. If hasNext() returns <code>false</code>, this
- * returns the list size. A lock is obtained on the mutex before the
- * query takes place.
- *
- * @return the index of the element that would be returned by next()
- */
- public int nextIndex()
- {
- synchronized (mutex)
- {
- return li.nextIndex();
- }
- }
-
- /**
- * Obtain the previous element from the underlying list. Repeated
- * calls to previous may be used to iterate backwards over the entire list,
- * or calls to next and previous may be used together to go forwards and
- * backwards. Alternating calls to next and previous will return the same
- * element. A lock is obtained on the mutex before the object is retrieved.
- *
- * @return the next element in the list in the reverse direction
- * @throws NoSuchElementException if there are no more elements
- */
- public Object previous()
- {
- synchronized (mutex)
- {
- return li.previous();
- }
- }
-
- /**
- * Find the index of the element that would be returned by a call to
- * previous. If hasPrevious() returns <code>false</code>, this returns -1.
- * A lock is obtained on the mutex before the query takes place.
- *
- * @return the index of the element that would be returned by previous()
- */
- public int previousIndex()
- {
- synchronized (mutex)
- {
- return li.previousIndex();
- }
- }
-
- /**
- * Replace the element last returned by a call to <code>next()</code> or
- * <code>previous()</code> with a given object (optional operation). This
- * method may only be called if neither <code>add()</code> nor
- * <code>remove()</code> have been called since the last call to
- * <code>next()</code> or <code>previous</code>. A lock is obtained
- * on the mutex before the list is modified.
- *
- * @param o the object to replace the element with
- * @throws ClassCastException the object is of a type which cannot be added
- * to this list
- * @throws IllegalArgumentException some other aspect of the object stops
- * it being added to this list
- * @throws IllegalStateException if neither next or previous have been
- * called, or if add or remove has been called since the last call
- * to next or previous
- * @throws UnsupportedOperationException if this ListIterator does not
- * support the set operation
- */
- public void set(Object o)
- {
- synchronized (mutex)
- {
- li.set(o);
- }
- }
- } // class SynchronizedListIterator
-
- /**
- * Returns a synchronized (thread-safe) map wrapper backed by the given
- * map. Notice that element access through the collection views and their
- * iterators are thread-safe, but if the map can be structurally modified
- * (adding or removing elements) then you should synchronize around the
- * iteration to avoid non-deterministic behavior:<br>
- * <pre>
- * Map m = Collections.synchronizedMap(new Map(...));
- * ...
- * Set s = m.keySet(); // safe outside a synchronized block
- * synchronized (m) // synch on m, not s
- * {
- * Iterator i = s.iterator();
- * while (i.hasNext())
- * foo(i.next());
- * }
- * </pre><p>
- *
- * The returned Map implements Serializable, but can only be serialized if
- * the map it wraps is likewise Serializable.
- *
- * @param m the map to wrap
- * @return a synchronized view of the map
- * @see Serializable
- */
- public static Map synchronizedMap(Map m)
- {
- return new SynchronizedMap(m);
- }
-
- /**
- * The implementation of {@link #synchronizedMap(Map)}. This
- * class name is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static class SynchronizedMap implements Map, Serializable
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 1978198479659022715L;
-
- /**
- * The wrapped map.
- * @serial the real map
- */
- private final Map m;
-
- /**
- * The object to synchronize on. When an instance is created via public
- * methods, it will be this; but other uses like
- * SynchronizedSortedMap.subMap() must specify another mutex. Package
- * visible for use by subclass.
- * @serial the lock
- */
- final Object mutex;
-
- /**
- * Cache the entry set.
- */
- private transient Set entries;
-
- /**
- * Cache the key set.
- */
- private transient Set keys;
-
- /**
- * Cache the value collection.
- */
- private transient Collection values;
-
- /**
- * Wrap a given map.
- * @param m the map to wrap
- * @throws NullPointerException if m is null
- */
- SynchronizedMap(Map m)
- {
- this.m = m;
- mutex = this;
- if (m == null)
- throw new NullPointerException();
- }
-
- /**
- * Called only by trusted code to specify the mutex as well as the map.
- * @param sync the mutex
- * @param m the map
- */
- SynchronizedMap(Object sync, Map m)
- {
- this.m = m;
- mutex = sync;
- }
-
- /**
- * Clears all the entries from the underlying map. A lock is obtained
- * on the mutex before the map is cleared.
- *
- * @throws UnsupportedOperationException if clear is not supported
- */
- public void clear()
- {
- synchronized (mutex)
- {
- m.clear();
- }
- }
-
- /**
- * Returns <code>true</code> if the underlying map contains a entry for the given key.
- * A lock is obtained on the mutex before the map is queried.
- *
- * @param key the key to search for.
- * @return <code>true</code> if the underlying map contains the key.
- * @throws ClassCastException if the key is of an inappropriate type.
- * @throws NullPointerException if key is <code>null</code> but the map
- * does not permit null keys.
- */
- public boolean containsKey(Object key)
- {
- synchronized (mutex)
- {
- return m.containsKey(key);
- }
- }
-
- /**
- * Returns <code>true</code> if the underlying map contains at least one entry with the
- * given value. In other words, returns <code>true</code> if a value v exists where
- * <code>(value == null ? v == null : value.equals(v))</code>. This usually
- * requires linear time. A lock is obtained on the mutex before the map
- * is queried.
- *
- * @param value the value to search for
- * @return <code>true</code> if the map contains the value
- * @throws ClassCastException if the type of the value is not a valid type
- * for this map.
- * @throws NullPointerException if the value is null and the map doesn't
- * support null values.
- */
- public boolean containsValue(Object value)
- {
- synchronized (mutex)
- {
- return m.containsValue(value);
- }
- }
-
- // This is one of the ickiest cases of nesting I've ever seen. It just
- // means "return a SynchronizedSet, except that the iterator() method
- // returns an SynchronizedIterator whose next() method returns a
- // synchronized wrapper around its normal return value".
- public Set entrySet()
- {
- // Define this here to spare some nesting.
- class SynchronizedMapEntry implements Map.Entry
- {
- final Map.Entry e;
- SynchronizedMapEntry(Object o)
- {
- e = (Map.Entry) o;
- }
-
- /**
- * Returns <code>true</code> if the object, o, implements <code>Map.Entry</code>
- * with the same key and value as the underlying entry. A lock is
- * obtained on the mutex before the comparison takes place.
- *
- * @param o The object to compare with this entry.
- * @return <code>true</code> if o is equivalent to the underlying map entry.
- */
- public boolean equals(Object o)
- {
- synchronized (mutex)
- {
- return e.equals(o);
- }
- }
-
- /**
- * Returns the key used in the underlying map entry. A lock is obtained
- * on the mutex before the key is retrieved.
- *
- * @return The key of the underlying map entry.
- */
- public Object getKey()
- {
- synchronized (mutex)
- {
- return e.getKey();
- }
- }
-
- /**
- * Returns the value used in the underlying map entry. A lock is obtained
- * on the mutex before the value is retrieved.
- *
- * @return The value of the underlying map entry.
- */
- public Object getValue()
- {
- synchronized (mutex)
- {
- return e.getValue();
- }
- }
-
- /**
- * Computes the hash code for the underlying map entry.
- * This computation is described in the documentation for the
- * <code>Map</code> interface. A lock is obtained on the mutex
- * before the underlying map is accessed.
- *
- * @return The hash code of the underlying map entry.
- * @see Map#hashCode()
- */
- public int hashCode()
- {
- synchronized (mutex)
- {
- return e.hashCode();
- }
- }
-
- /**
- * Replaces the value in the underlying map entry with the specified
- * object (optional operation). A lock is obtained on the mutex
- * before the map is altered. The map entry, in turn, will alter
- * the underlying map object. The operation is undefined if the
- * <code>remove()</code> method of the iterator has been called
- * beforehand.
- *
- * @param value the new value to store
- * @return the old value
- * @throws UnsupportedOperationException if the operation is not supported.
- * @throws ClassCastException if the value is of the wrong type.
- * @throws IllegalArgumentException if something about the value
- * prevents it from existing in this map.
- * @throws NullPointerException if the map forbids null values.
- */
- public Object setValue(Object value)
- {
- synchronized (mutex)
- {
- return e.setValue(value);
- }
- }
-
- /**
- * Returns a textual representation of the underlying map entry.
- * A lock is obtained on the mutex before the entry is accessed.
- *
- * @return The contents of the map entry in <code>String</code> form.
- */
- public String toString()
- {
- synchronized (mutex)
- {
- return e.toString();
- }
- }
- } // class SynchronizedMapEntry
-
- // Now the actual code.
- if (entries == null)
- synchronized (mutex)
- {
- entries = new SynchronizedSet(mutex, m.entrySet())
- {
- /**
- * Returns an iterator over the set. The iterator has no specific order,
- * unless further specified. A lock is obtained on the set's mutex
- * before the iterator is created. The created iterator is also
- * thread-safe.
- *
- * @return A synchronized set iterator.
- */
- public Iterator iterator()
- {
- synchronized (super.mutex)
- {
- return new SynchronizedIterator(super.mutex, c.iterator())
- {
- /**
- * Retrieves the next map entry from the iterator.
- * A lock is obtained on the iterator's mutex before
- * the entry is created. The new map entry is enclosed in
- * a thread-safe wrapper.
- *
- * @return A synchronized map entry.
- */
- public Object next()
- {
- synchronized (super.mutex)
- {
- return new SynchronizedMapEntry(super.next());
- }
- }
- };
- }
- }
- };
- }
- return entries;
- }
-
- /**
- * Returns <code>true</code> if the object, o, is also an instance
- * of <code>Map</code> and contains an equivalent
- * entry set to that of the underlying map. A lock
- * is obtained on the mutex before the objects are
- * compared.
- *
- * @param o The object to compare.
- * @return <code>true</code> if o and the underlying map are equivalent.
- */
- public boolean equals(Object o)
- {
- synchronized (mutex)
- {
- return m.equals(o);
- }
- }
-
- /**
- * Returns the value associated with the given key, or null
- * if no such mapping exists. An ambiguity exists with maps
- * that accept null values as a return value of null could
- * be due to a non-existent mapping or simply a null value
- * for that key. To resolve this, <code>containsKey</code>
- * should be used. A lock is obtained on the mutex before
- * the value is retrieved from the underlying map.
- *
- * @param key The key of the required mapping.
- * @return The value associated with the given key, or
- * null if no such mapping exists.
- * @throws ClassCastException if the key is an inappropriate type.
- * @throws NullPointerException if this map does not accept null keys.
- */
- public Object get(Object key)
- {
- synchronized (mutex)
- {
- return m.get(key);
- }
- }
-
- /**
- * Calculates the hash code of the underlying map as the
- * sum of the hash codes of all entries. A lock is obtained
- * on the mutex before the hash code is computed.
- *
- * @return The hash code of the underlying map.
- */
- public int hashCode()
- {
- synchronized (mutex)
- {
- return m.hashCode();
- }
- }
-
- /**
- * Returns <code>true</code> if the underlying map contains no entries.
- * A lock is obtained on the mutex before the map is examined.
- *
- * @return <code>true</code> if the map is empty.
- */
- public boolean isEmpty()
- {
- synchronized (mutex)
- {
- return m.isEmpty();
- }
- }
-
- /**
- * Returns a thread-safe set view of the keys in the underlying map. The
- * set is backed by the map, so that changes in one show up in the other.
- * Modifications made while an iterator is in progress cause undefined
- * behavior. If the set supports removal, these methods remove the
- * underlying mapping from the map: <code>Iterator.remove</code>,
- * <code>Set.remove</code>, <code>removeAll</code>, <code>retainAll</code>,
- * and <code>clear</code>. Element addition, via <code>add</code> or
- * <code>addAll</code>, is not supported via this set. A lock is obtained
- * on the mutex before the set is created.
- *
- * @return A synchronized set containing the keys of the underlying map.
- */
- public Set keySet()
- {
- if (keys == null)
- synchronized (mutex)
- {
- keys = new SynchronizedSet(mutex, m.keySet());
- }
- return keys;
- }
-
- /**
- * Associates the given key to the given value (optional operation). If the
- * underlying map already contains the key, its value is replaced. Be aware
- * that in a map that permits <code>null</code> values, a null return does not
- * always imply that the mapping was created. A lock is obtained on the mutex
- * before the modification is made.
- *
- * @param key the key to map.
- * @param value the value to be mapped.
- * @return the previous value of the key, or null if there was no mapping
- * @throws UnsupportedOperationException if the operation is not supported
- * @throws ClassCastException if the key or value is of the wrong type
- * @throws IllegalArgumentException if something about this key or value
- * prevents it from existing in this map
- * @throws NullPointerException if either the key or the value is null,
- * and the map forbids null keys or values
- * @see #containsKey(Object)
- */
- public Object put(Object key, Object value)
- {
- synchronized (mutex)
- {
- return m.put(key, value);
- }
- }
-
- /**
- * Copies all entries of the given map to the underlying one (optional
- * operation). If the map already contains a key, its value is replaced.
- * A lock is obtained on the mutex before the operation proceeds.
- *
- * @param m the mapping to load into this map
- * @throws UnsupportedOperationException if the operation is not supported
- * @throws ClassCastException if a key or value is of the wrong type
- * @throws IllegalArgumentException if something about a key or value
- * prevents it from existing in this map
- * @throws NullPointerException if the map forbids null keys or values, or
- * if <code>m</code> is null.
- * @see #put(Object, Object)
- */
- public void putAll(Map map)
- {
- synchronized (mutex)
- {
- m.putAll(map);
- }
- }
-
- /**
- * Removes the mapping for the key, o, if present (optional operation). If
- * the key is not present, this returns null. Note that maps which permit
- * null values may also return null if the key was removed. A prior
- * <code>containsKey()</code> check is required to avoid this ambiguity.
- * Before the mapping is removed, a lock is obtained on the mutex.
- *
- * @param key the key to remove
- * @return the value the key mapped to, or null if not present
- * @throws UnsupportedOperationException if deletion is unsupported
- * @throws NullPointerException if the key is null and this map doesn't
- * support null keys.
- * @throws ClassCastException if the type of the key is not a valid type
- * for this map.
- */
- public Object remove(Object o)
- {
- synchronized (mutex)
- {
- return m.remove(o);
- }
- }
-
- /**
- * Retrieves the size of the underlying map. A lock
- * is obtained on the mutex before access takes place.
- * Maps with a size greater than <code>Integer.MAX_VALUE</code>
- * return <code>Integer.MAX_VALUE</code> instead.
- *
- * @return The size of the underlying map.
- */
- public int size()
- {
- synchronized (mutex)
- {
- return m.size();
- }
- }
-
- /**
- * Returns a textual representation of the underlying
- * map. A lock is obtained on the mutex before the map
- * is accessed.
- *
- * @return The map in <code>String</code> form.
- */
- public String toString()
- {
- synchronized (mutex)
- {
- return m.toString();
- }
- }
-
- /**
- * Returns a synchronized collection view of the values in the underlying
- * map. The collection is backed by the map, so that changes in one show up in
- * the other. Modifications made while an iterator is in progress cause
- * undefined behavior. If the collection supports removal, these methods
- * remove the underlying mapping from the map: <code>Iterator.remove</code>,
- * <code>Collection.remove</code>, <code>removeAll</code>,
- * <code>retainAll</code>, and <code>clear</code>. Element addition, via
- * <code>add</code> or <code>addAll</code>, is not supported via this
- * collection. A lock is obtained on the mutex before the collection
- * is created.
- *
- * @return the collection of all values in the underlying map.
- */
- public Collection values()
- {
- if (values == null)
- synchronized (mutex)
- {
- values = new SynchronizedCollection(mutex, m.values());
- }
- return values;
- }
- } // class SynchronizedMap
-
- /**
- * Returns a synchronized (thread-safe) set wrapper backed by the given
- * set. Notice that element access through the iterator is thread-safe, but
- * if the set can be structurally modified (adding or removing elements)
- * then you should synchronize around the iteration to avoid
- * non-deterministic behavior:<br>
- * <pre>
- * Set s = Collections.synchronizedSet(new Set(...));
- * ...
- * synchronized (s)
- * {
- * Iterator i = s.iterator();
- * while (i.hasNext())
- * foo(i.next());
- * }
- * </pre><p>
- *
- * The returned Set implements Serializable, but can only be serialized if
- * the set it wraps is likewise Serializable.
- *
- * @param s the set to wrap
- * @return a synchronized view of the set
- * @see Serializable
- */
- public static Set synchronizedSet(Set s)
- {
- return new SynchronizedSet(s);
- }
-
- /**
- * The implementation of {@link #synchronizedSet(Set)}. This class
- * name is required for compatibility with Sun's JDK serializability.
- * Package visible, so that sets such as Hashtable.keySet()
- * can specify which object to synchronize on.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- static class SynchronizedSet extends SynchronizedCollection
- implements Set
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 487447009682186044L;
-
- /**
- * Wrap a given set.
- * @param s the set to wrap
- * @throws NullPointerException if s is null
- */
- SynchronizedSet(Set s)
- {
- super(s);
- }
-
- /**
- * Called only by trusted code to specify the mutex as well as the set.
- * @param sync the mutex
- * @param s the set
- */
- SynchronizedSet(Object sync, Set s)
- {
- super(sync, s);
- }
-
- /**
- * Returns <code>true</code> if the object, o, is a <code>Set</code>
- * of the same size as the underlying set, and contains
- * each element, e, which occurs in the underlying set.
- * A lock is obtained on the mutex before the comparison
- * takes place.
- *
- * @param o The object to compare against.
- * @return <code>true</code> if o is an equivalent set.
- */
- public boolean equals(Object o)
- {
- synchronized (mutex)
- {
- return c.equals(o);
- }
- }
-
- /**
- * Computes the hash code for the underlying set as the
- * sum of the hash code of all elements within the set.
- * A lock is obtained on the mutex before the computation
- * occurs.
- *
- * @return The hash code for the underlying set.
- */
- public int hashCode()
- {
- synchronized (mutex)
- {
- return c.hashCode();
- }
- }
- } // class SynchronizedSet
-
- /**
- * Returns a synchronized (thread-safe) sorted map wrapper backed by the
- * given map. Notice that element access through the collection views,
- * subviews, and their iterators are thread-safe, but if the map can be
- * structurally modified (adding or removing elements) then you should
- * synchronize around the iteration to avoid non-deterministic behavior:<br>
- * <pre>
- * SortedMap m = Collections.synchronizedSortedMap(new SortedMap(...));
- * ...
- * Set s = m.keySet(); // safe outside a synchronized block
- * SortedMap m2 = m.headMap(foo); // safe outside a synchronized block
- * Set s2 = m2.keySet(); // safe outside a synchronized block
- * synchronized (m) // synch on m, not m2, s or s2
- * {
- * Iterator i = s.iterator();
- * while (i.hasNext())
- * foo(i.next());
- * i = s2.iterator();
- * while (i.hasNext())
- * bar(i.next());
- * }
- * </pre><p>
- *
- * The returned SortedMap implements Serializable, but can only be
- * serialized if the map it wraps is likewise Serializable.
- *
- * @param m the sorted map to wrap
- * @return a synchronized view of the sorted map
- * @see Serializable
- */
- public static SortedMap synchronizedSortedMap(SortedMap m)
- {
- return new SynchronizedSortedMap(m);
- }
-
- /**
- * The implementation of {@link #synchronizedSortedMap(SortedMap)}. This
- * class name is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class SynchronizedSortedMap extends SynchronizedMap
- implements SortedMap
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -8798146769416483793L;
-
- /**
- * The wrapped map; stored both here and in the superclass to avoid
- * excessive casting.
- * @serial the wrapped map
- */
- private final SortedMap sm;
-
- /**
- * Wrap a given map.
- * @param sm the map to wrap
- * @throws NullPointerException if sm is null
- */
- SynchronizedSortedMap(SortedMap sm)
- {
- super(sm);
- this.sm = sm;
- }
-
- /**
- * Called only by trusted code to specify the mutex as well as the map.
- * @param sync the mutex
- * @param sm the map
- */
- SynchronizedSortedMap(Object sync, SortedMap sm)
- {
- super(sync, sm);
- this.sm = sm;
- }
-
- /**
- * Returns the comparator used in sorting the underlying map, or null if
- * it is the keys' natural ordering. A lock is obtained on the mutex
- * before the comparator is retrieved.
- *
- * @return the sorting comparator.
- */
- public Comparator comparator()
- {
- synchronized (mutex)
- {
- return sm.comparator();
- }
- }
-
- /**
- * Returns the first, lowest sorted, key from the underlying map.
- * A lock is obtained on the mutex before the map is accessed.
- *
- * @return the first key.
- * @throws NoSuchElementException if this map is empty.
- */
- public Object firstKey()
- {
- synchronized (mutex)
- {
- return sm.firstKey();
- }
- }
-
- /**
- * Returns a submap containing the keys from the first
- * key (as returned by <code>firstKey()</code>) to
- * the key before that specified. The submap supports all
- * operations supported by the underlying map and all actions
- * taking place on the submap are also reflected in the underlying
- * map. A lock is obtained on the mutex prior to submap creation.
- * This operation is equivalent to <code>subMap(firstKey(), toKey)</code>.
- * The submap retains the thread-safe status of this map.
- *
- * @param toKey the exclusive upper range of the submap.
- * @return a submap from <code>firstKey()</code> to the
- * the key preceding toKey.
- * @throws ClassCastException if toKey is not comparable to the underlying
- * map's contents.
- * @throws IllegalArgumentException if toKey is outside the map's range.
- * @throws NullPointerException if toKey is null. but the map does not allow
- * null keys.
- */
- public SortedMap headMap(Object toKey)
- {
- synchronized (mutex)
- {
- return new SynchronizedSortedMap(mutex, sm.headMap(toKey));
- }
- }
-
- /**
- * Returns the last, highest sorted, key from the underlying map.
- * A lock is obtained on the mutex before the map is accessed.
- *
- * @return the last key.
- * @throws NoSuchElementException if this map is empty.
- */
- public Object lastKey()
- {
- synchronized (mutex)
- {
- return sm.lastKey();
- }
- }
-
- /**
- * Returns a submap containing the keys from fromKey to
- * the key before toKey. The submap supports all
- * operations supported by the underlying map and all actions
- * taking place on the submap are also reflected in the underlying
- * map. A lock is obtained on the mutex prior to submap creation.
- * The submap retains the thread-safe status of this map.
- *
- * @param fromKey the inclusive lower range of the submap.
- * @param toKey the exclusive upper range of the submap.
- * @return a submap from fromKey to the key preceding toKey.
- * @throws ClassCastException if fromKey or toKey is not comparable
- * to the underlying map's contents.
- * @throws IllegalArgumentException if fromKey or toKey is outside the map's
- * range.
- * @throws NullPointerException if fromKey or toKey is null. but the map does
- * not allow null keys.
- */
- public SortedMap subMap(Object fromKey, Object toKey)
- {
- synchronized (mutex)
- {
- return new SynchronizedSortedMap(mutex, sm.subMap(fromKey, toKey));
- }
- }
-
- /**
- * Returns a submap containing all the keys from fromKey onwards.
- * The submap supports all operations supported by the underlying
- * map and all actions taking place on the submap are also reflected
- * in the underlying map. A lock is obtained on the mutex prior to
- * submap creation. The submap retains the thread-safe status of
- * this map.
- *
- * @param fromKey the inclusive lower range of the submap.
- * @return a submap from fromKey to <code>lastKey()</code>.
- * @throws ClassCastException if fromKey is not comparable to the underlying
- * map's contents.
- * @throws IllegalArgumentException if fromKey is outside the map's range.
- * @throws NullPointerException if fromKey is null. but the map does not allow
- * null keys.
- */
- public SortedMap tailMap(Object fromKey)
- {
- synchronized (mutex)
- {
- return new SynchronizedSortedMap(mutex, sm.tailMap(fromKey));
- }
- }
- } // class SynchronizedSortedMap
-
- /**
- * Returns a synchronized (thread-safe) sorted set wrapper backed by the
- * given set. Notice that element access through the iterator and through
- * subviews are thread-safe, but if the set can be structurally modified
- * (adding or removing elements) then you should synchronize around the
- * iteration to avoid non-deterministic behavior:<br>
- * <pre>
- * SortedSet s = Collections.synchronizedSortedSet(new SortedSet(...));
- * ...
- * SortedSet s2 = s.headSet(foo); // safe outside a synchronized block
- * synchronized (s) // synch on s, not s2
- * {
- * Iterator i = s2.iterator();
- * while (i.hasNext())
- * foo(i.next());
- * }
- * </pre><p>
- *
- * The returned SortedSet implements Serializable, but can only be
- * serialized if the set it wraps is likewise Serializable.
- *
- * @param s the sorted set to wrap
- * @return a synchronized view of the sorted set
- * @see Serializable
- */
- public static SortedSet synchronizedSortedSet(SortedSet s)
- {
- return new SynchronizedSortedSet(s);
- }
-
- /**
- * The implementation of {@link #synchronizedSortedSet(SortedSet)}. This
- * class name is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class SynchronizedSortedSet extends SynchronizedSet
- implements SortedSet
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 8695801310862127406L;
-
- /**
- * The wrapped set; stored both here and in the superclass to avoid
- * excessive casting.
- * @serial the wrapped set
- */
- private final SortedSet ss;
-
- /**
- * Wrap a given set.
- * @param ss the set to wrap
- * @throws NullPointerException if ss is null
- */
- SynchronizedSortedSet(SortedSet ss)
- {
- super(ss);
- this.ss = ss;
- }
-
- /**
- * Called only by trusted code to specify the mutex as well as the set.
- * @param sync the mutex
- * @param l the list
- */
- SynchronizedSortedSet(Object sync, SortedSet ss)
- {
- super(sync, ss);
- this.ss = ss;
- }
-
- /**
- * Returns the comparator used in sorting the underlying set, or null if
- * it is the elements' natural ordering. A lock is obtained on the mutex
- * before the comparator is retrieved.
- *
- * @return the sorting comparator.
- */
- public Comparator comparator()
- {
- synchronized (mutex)
- {
- return ss.comparator();
- }
- }
-
- /**
- * Returns the first, lowest sorted, element from the underlying set.
- * A lock is obtained on the mutex before the set is accessed.
- *
- * @return the first element.
- * @throws NoSuchElementException if this set is empty.
- */
- public Object first()
- {
- synchronized (mutex)
- {
- return ss.first();
- }
- }
-
- /**
- * Returns a subset containing the element from the first
- * element (as returned by <code>first()</code>) to
- * the element before that specified. The subset supports all
- * operations supported by the underlying set and all actions
- * taking place on the subset are also reflected in the underlying
- * set. A lock is obtained on the mutex prior to subset creation.
- * This operation is equivalent to <code>subSet(first(), toElement)</code>.
- * The subset retains the thread-safe status of this set.
- *
- * @param toElement the exclusive upper range of the subset.
- * @return a subset from <code>first()</code> to the
- * the element preceding toElement.
- * @throws ClassCastException if toElement is not comparable to the underlying
- * set's contents.
- * @throws IllegalArgumentException if toElement is outside the set's range.
- * @throws NullPointerException if toElement is null. but the set does not allow
- * null elements.
- */
- public SortedSet headSet(Object toElement)
- {
- synchronized (mutex)
- {
- return new SynchronizedSortedSet(mutex, ss.headSet(toElement));
- }
- }
-
- /**
- * Returns the last, highest sorted, element from the underlying set.
- * A lock is obtained on the mutex before the set is accessed.
- *
- * @return the last element.
- * @throws NoSuchElementException if this set is empty.
- */
- public Object last()
- {
- synchronized (mutex)
- {
- return ss.last();
- }
- }
-
- /**
- * Returns a subset containing the elements from fromElement to
- * the element before toElement. The subset supports all
- * operations supported by the underlying set and all actions
- * taking place on the subset are also reflected in the underlying
- * set. A lock is obtained on the mutex prior to subset creation.
- * The subset retains the thread-safe status of this set.
- *
- * @param fromElement the inclusive lower range of the subset.
- * @param toElement the exclusive upper range of the subset.
- * @return a subset from fromElement to the element preceding toElement.
- * @throws ClassCastException if fromElement or toElement is not comparable
- * to the underlying set's contents.
- * @throws IllegalArgumentException if fromElement or toElement is outside the set's
- * range.
- * @throws NullPointerException if fromElement or toElement is null. but the set does
- * not allow null elements.
- */
- public SortedSet subSet(Object fromElement, Object toElement)
- {
- synchronized (mutex)
- {
- return new SynchronizedSortedSet(mutex,
- ss.subSet(fromElement, toElement));
- }
- }
-
- /**
- * Returns a subset containing all the elements from fromElement onwards.
- * The subset supports all operations supported by the underlying
- * set and all actions taking place on the subset are also reflected
- * in the underlying set. A lock is obtained on the mutex prior to
- * subset creation. The subset retains the thread-safe status of
- * this set.
- *
- * @param fromElement the inclusive lower range of the subset.
- * @return a subset from fromElement to <code>last()</code>.
- * @throws ClassCastException if fromElement is not comparable to the underlying
- * set's contents.
- * @throws IllegalArgumentException if fromElement is outside the set's range.
- * @throws NullPointerException if fromElement is null. but the set does not allow
- * null elements.
- */
- public SortedSet tailSet(Object fromElement)
- {
- synchronized (mutex)
- {
- return new SynchronizedSortedSet(mutex, ss.tailSet(fromElement));
- }
- }
- } // class SynchronizedSortedSet
-
-
- /**
- * Returns an unmodifiable view of the given collection. This allows
- * "read-only" access, although changes in the backing collection show up
- * in this view. Attempts to modify the collection directly or via iterators
- * will fail with {@link UnsupportedOperationException}. Although this view
- * prevents changes to the structure of the collection and its elements, the values
- * referenced by the objects in the collection can still be modified.
- * <p>
- *
- * Since the collection might be a List or a Set, and those have incompatible
- * equals and hashCode requirements, this relies on Object's implementation
- * rather than passing those calls on to the wrapped collection. The returned
- * Collection implements Serializable, but can only be serialized if
- * the collection it wraps is likewise Serializable.
- *
- * @param c the collection to wrap
- * @return a read-only view of the collection
- * @see Serializable
- */
- public static Collection unmodifiableCollection(Collection c)
- {
- return new UnmodifiableCollection(c);
- }
-
- /**
- * The implementation of {@link #unmodifiableCollection(Collection)}. This
- * class name is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static class UnmodifiableCollection
- implements Collection, Serializable
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 1820017752578914078L;
-
- /**
- * The wrapped collection. Package visible for use by subclasses.
- * @serial the real collection
- */
- final Collection c;
-
- /**
- * Wrap a given collection.
- * @param c the collection to wrap
- * @throws NullPointerException if c is null
- */
- UnmodifiableCollection(Collection c)
- {
- this.c = c;
- if (c == null)
- throw new NullPointerException();
- }
-
- /**
- * Blocks the addition of elements to the underlying collection.
- * This method never returns, throwing an exception instead.
- *
- * @param o the object to add.
- * @return <code>true</code> if the collection was modified as a result of this action.
- * @throws UnsupportedOperationException as an unmodifiable collection does not
- * support the add operation.
- */
- public boolean add(Object o)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Blocks the addition of a collection of elements to the underlying
- * collection. This method never returns, throwing an exception instead.
- *
- * @param c the collection to add.
- * @return <code>true</code> if the collection was modified as a result of this action.
- * @throws UnsupportedOperationException as an unmodifiable collection does not
- * support the <code>addAll</code> operation.
- */
- public boolean addAll(Collection c)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Blocks the clearing of the underlying collection. This method never
- * returns, throwing an exception instead.
- *
- * @throws UnsupportedOperationException as an unmodifiable collection does
- * not support the <code>clear()</code> operation.
- */
- public void clear()
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Test whether the underlying collection contains a given object as one of its
- * elements.
- *
- * @param o the element to look for.
- * @return <code>true</code> if the underlying collection contains at least
- * one element e such that
- * <code>o == null ? e == null : o.equals(e)</code>.
- * @throws ClassCastException if the type of o is not a valid type for the
- * underlying collection.
- * @throws NullPointerException if o is null and the underlying collection
- * doesn't support null values.
- */
- public boolean contains(Object o)
- {
- return c.contains(o);
- }
-
- /**
- * Test whether the underlying collection contains every element in a given
- * collection.
- *
- * @param c the collection to test for.
- * @return <code>true</code> if for every element o in c, contains(o) would
- * return <code>true</code>.
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for the underlying collection.
- * @throws NullPointerException if some element of c is null and the underlying
- * collection does not support null values.
- * @throws NullPointerException if c itself is null.
- */
- public boolean containsAll(Collection c1)
- {
- return c.containsAll(c1);
- }
-
- /**
- * Tests whether the underlying collection is empty, that is,
- * if size() == 0.
- *
- * @return <code>true</code> if this collection contains no elements.
- */
- public boolean isEmpty()
- {
- return c.isEmpty();
- }
-
- /**
- * Obtain an Iterator over the underlying collection, which maintains
- * its unmodifiable nature.
- *
- * @return an UnmodifiableIterator over the elements of the underlying
- * collection, in any order.
- */
- public Iterator iterator()
- {
- return new UnmodifiableIterator(c.iterator());
- }
-
- /**
- * Blocks the removal of an object from the underlying collection.
- * This method never returns, throwing an exception instead.
- *
- * @param o The object to remove.
- * @return <code>true</code> if the object was removed (i.e. the underlying
- * collection returned 1 or more instances of o).
- * @throws UnsupportedOperationException as an unmodifiable collection
- * does not support the <code>remove()</code> operation.
- */
- public boolean remove(Object o)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Blocks the removal of a collection of objects from the underlying
- * collection. This method never returns, throwing an exception
- * instead.
- *
- * @param c The collection of objects to remove.
- * @return <code>true</code> if the collection was modified.
- * @throws UnsupportedOperationException as an unmodifiable collection
- * does not support the <code>removeAll()</code> operation.
- */
- public boolean removeAll(Collection c)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Blocks the removal of all elements from the underlying collection,
- * except those in the supplied collection. This method never returns,
- * throwing an exception instead.
- *
- * @param c The collection of objects to retain.
- * @return <code>true</code> if the collection was modified.
- * @throws UnsupportedOperationException as an unmodifiable collection
- * does not support the <code>retainAll()</code> operation.
- */
- public boolean retainAll(Collection c)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Retrieves the number of elements in the underlying collection.
- *
- * @return the number of elements in the collection.
- */
- public int size()
- {
- return c.size();
- }
-
- /**
- * Copy the current contents of the underlying collection into an array.
- *
- * @return an array of type Object[] with a length equal to the size of the
- * underlying collection and containing the elements currently in
- * the underlying collection, in any order.
- */
- public Object[] toArray()
- {
- return c.toArray();
- }
-
- /**
- * Copy the current contents of the underlying collection into an array. If
- * the array passed as an argument has length less than the size of the
- * underlying collection, an array of the same run-time type as a, with a length
- * equal to the size of the underlying collection, is allocated using reflection.
- * Otherwise, a itself is used. The elements of the underlying collection are
- * copied into it, and if there is space in the array, the following element is
- * set to null. The resultant array is returned.
- * Note: The fact that the following element is set to null is only useful
- * if it is known that this collection does not contain any null elements.
- *
- * @param a the array to copy this collection into.
- * @return an array containing the elements currently in the underlying
- * collection, in any order.
- * @throws ArrayStoreException if the type of any element of the
- * collection is not a subtype of the element type of a.
- */
- public Object[] toArray(Object[] a)
- {
- return c.toArray(a);
- }
-
- /**
- * A textual representation of the unmodifiable collection.
- *
- * @return The unmodifiable collection in the form of a <code>String</code>.
- */
- public String toString()
- {
- return c.toString();
- }
- } // class UnmodifiableCollection
-
- /**
- * The implementation of the various iterator methods in the
- * unmodifiable classes.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static class UnmodifiableIterator implements Iterator
- {
- /**
- * The wrapped iterator.
- */
- private final Iterator i;
-
- /**
- * Only trusted code creates a wrapper.
- * @param i the wrapped iterator
- */
- UnmodifiableIterator(Iterator i)
- {
- this.i = i;
- }
-
- /**
- * Obtains the next element in the underlying collection.
- *
- * @return the next element in the collection.
- * @throws NoSuchElementException if there are no more elements.
- */
- public Object next()
- {
- return i.next();
- }
- /**
- * Tests whether there are still elements to be retrieved from the
- * underlying collection by <code>next()</code>. When this method
- * returns <code>true</code>, an exception will not be thrown on calling
- * <code>next()</code>.
- *
- * @return <code>true</code> if there is at least one more element in the underlying
- * collection.
- */
- public boolean hasNext()
- {
- return i.hasNext();
- }
-
- /**
- * Blocks the removal of elements from the underlying collection by the
- * iterator.
- *
- * @throws UnsupportedOperationException as an unmodifiable collection
- * does not support the removal of elements by its iterator.
- */
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- } // class UnmodifiableIterator
-
- /**
- * Returns an unmodifiable view of the given list. This allows
- * "read-only" access, although changes in the backing list show up
- * in this view. Attempts to modify the list directly, via iterators, or
- * via sublists, will fail with {@link UnsupportedOperationException}.
- * Although this view prevents changes to the structure of the list and
- * its elements, the values referenced by the objects in the list can
- * still be modified.
- * <p>
- *
- * The returned List implements Serializable, but can only be serialized if
- * the list it wraps is likewise Serializable. In addition, if the wrapped
- * list implements RandomAccess, this does too.
- *
- * @param l the list to wrap
- * @return a read-only view of the list
- * @see Serializable
- * @see RandomAccess
- */
- public static List unmodifiableList(List l)
- {
- if (l instanceof RandomAccess)
- return new UnmodifiableRandomAccessList(l);
- return new UnmodifiableList(l);
- }
-
- /**
- * The implementation of {@link #unmodifiableList(List)} for sequential
- * lists. This class name is required for compatibility with Sun's JDK
- * serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static class UnmodifiableList extends UnmodifiableCollection
- implements List
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -283967356065247728L;
-
-
- /**
- * The wrapped list; stored both here and in the superclass to avoid
- * excessive casting. Package visible for use by subclass.
- * @serial the wrapped list
- */
- final List list;
-
- /**
- * Wrap a given list.
- * @param l the list to wrap
- * @throws NullPointerException if l is null
- */
- UnmodifiableList(List l)
- {
- super(l);
- list = l;
- }
-
- /**
- * Blocks the addition of an element to the underlying
- * list at a specific index. This method never returns,
- * throwing an exception instead.
- *
- * @param index The index at which to place the new element.
- * @param o the object to add.
- * @throws UnsupportedOperationException as an unmodifiable
- * list doesn't support the <code>add()</code> operation.
- */
- public void add(int index, Object o)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Blocks the addition of a collection of elements to the
- * underlying list at a specific index. This method never
- * returns, throwing an exception instead.
- *
- * @param index The index at which to place the new element.
- * @param c the collections of objects to add.
- * @throws UnsupportedOperationException as an unmodifiable
- * list doesn't support the <code>addAll()</code> operation.
- */
- public boolean addAll(int index, Collection c)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns <code>true</code> if the object, o, is an instance of
- * <code>List</code> with the same size and elements
- * as the underlying list.
- *
- * @param o The object to compare.
- * @return <code>true</code> if o is equivalent to the underlying list.
- */
- public boolean equals(Object o)
- {
- return list.equals(o);
- }
-
- /**
- * Retrieves the element at a given index in the underlying list.
- *
- * @param index the index of the element to be returned
- * @return the element at index index in this list
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object get(int index)
- {
- return list.get(index);
- }
-
- /**
- * Computes the hash code for the underlying list.
- * The exact computation is described in the documentation
- * of the <code>List</code> interface.
- *
- * @return The hash code of the underlying list.
- * @see List#hashCode()
- */
- public int hashCode()
- {
- return list.hashCode();
- }
-
- /**
- * Obtain the first index at which a given object is to be found in the
- * underlying list.
- *
- * @param o the object to search for
- * @return the least integer n such that <code>o == null ? get(n) == null :
- * o.equals(get(n))</code>, or -1 if there is no such index.
- * @throws ClassCastException if the type of o is not a valid
- * type for the underlying list.
- * @throws NullPointerException if o is null and the underlying
- * list does not support null values.
- */
- public int indexOf(Object o)
- {
- return list.indexOf(o);
- }
-
- /**
- * Obtain the last index at which a given object is to be found in the
- * underlying list.
- *
- * @return the greatest integer n such that <code>o == null ? get(n) == null
- * : o.equals(get(n))</code>, or -1 if there is no such index.
- * @throws ClassCastException if the type of o is not a valid
- * type for the underlying list.
- * @throws NullPointerException if o is null and the underlying
- * list does not support null values.
- */
- public int lastIndexOf(Object o)
- {
- return list.lastIndexOf(o);
- }
-
- /**
- * Obtains a list iterator over the underlying list, starting at the beginning
- * and maintaining the unmodifiable nature of this list.
- *
- * @return a <code>UnmodifiableListIterator</code> over the elements of the
- * underlying list, in order, starting at the beginning.
- */
- public ListIterator listIterator()
- {
- return new UnmodifiableListIterator(list.listIterator());
- }
-
- /**
- * Obtains a list iterator over the underlying list, starting at the specified
- * index and maintaining the unmodifiable nature of this list. An initial call
- * to <code>next()</code> will retrieve the element at the specified index,
- * and an initial call to <code>previous()</code> will retrieve the element
- * at index - 1.
- *
- *
- * @param index the position, between 0 and size() inclusive, to begin the
- * iteration from.
- * @return a <code>UnmodifiableListIterator</code> over the elements of the
- * underlying list, in order, starting at the specified index.
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- public ListIterator listIterator(int index)
- {
- return new UnmodifiableListIterator(list.listIterator(index));
- }
-
- /**
- * Blocks the removal of the element at the specified index.
- * This method never returns, throwing an exception instead.
- *
- * @param index The index of the element to remove.
- * @return the removed element.
- * @throws UnsupportedOperationException as an unmodifiable
- * list does not support the <code>remove()</code>
- * operation.
- */
- public Object remove(int index)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Blocks the replacement of the element at the specified index.
- * This method never returns, throwing an exception instead.
- *
- * @param index The index of the element to replace.
- * @param o The new object to place at the specified index.
- * @return the replaced element.
- * @throws UnsupportedOperationException as an unmodifiable
- * list does not support the <code>set()</code>
- * operation.
- */
- public Object set(int index, Object o)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Obtain a List view of a subsection of the underlying list, from
- * fromIndex (inclusive) to toIndex (exclusive). If the two indices
- * are equal, the sublist is empty. The returned list will be
- * unmodifiable, like this list. Changes to the elements of the
- * returned list will be reflected in the underlying list. No structural
- * modifications can take place in either list.
- *
- * @param fromIndex the index that the returned list should start from
- * (inclusive).
- * @param toIndex the index that the returned list should go to (exclusive).
- * @return a List backed by a subsection of the underlying list.
- * @throws IndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; size() || fromIndex &gt; toIndex.
- */
- public List subList(int fromIndex, int toIndex)
- {
- return unmodifiableList(list.subList(fromIndex, toIndex));
- }
- } // class UnmodifiableList
-
- /**
- * The implementation of {@link #unmodifiableList(List)} for random-access
- * lists. This class name is required for compatibility with Sun's JDK
- * serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class UnmodifiableRandomAccessList
- extends UnmodifiableList implements RandomAccess
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -2542308836966382001L;
-
- /**
- * Wrap a given list.
- * @param l the list to wrap
- * @throws NullPointerException if l is null
- */
- UnmodifiableRandomAccessList(List l)
- {
- super(l);
- }
- } // class UnmodifiableRandomAccessList
-
- /**
- * The implementation of {@link UnmodifiableList#listIterator()}.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class UnmodifiableListIterator
- extends UnmodifiableIterator implements ListIterator
- {
- /**
- * The wrapped iterator, stored both here and in the superclass to
- * avoid excessive casting.
- */
- private final ListIterator li;
-
- /**
- * Only trusted code creates a wrapper.
- * @param li the wrapped iterator
- */
- UnmodifiableListIterator(ListIterator li)
- {
- super(li);
- this.li = li;
- }
-
- /**
- * Blocks the addition of an object to the list underlying this iterator.
- * This method never returns, throwing an exception instead.
- *
- * @param o The object to add.
- * @throws UnsupportedOperationException as the iterator of an unmodifiable
- * list does not support the <code>add()</code> operation.
- */
- public void add(Object o)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Tests whether there are still elements to be retrieved from the
- * underlying collection by <code>previous()</code>. When this method
- * returns <code>true</code>, an exception will not be thrown on calling
- * <code>previous()</code>.
- *
- * @return <code>true</code> if there is at least one more element prior to the
- * current position in the underlying list.
- */
- public boolean hasPrevious()
- {
- return li.hasPrevious();
- }
-
- /**
- * Find the index of the element that would be returned by a call to next.
- * If <code>hasNext()</code> returns <code>false</code>, this returns the list size.
- *
- * @return the index of the element that would be returned by
- * <code>next()</code>.
- */
- public int nextIndex()
- {
- return li.nextIndex();
- }
-
- /**
- * Obtains the previous element in the underlying list.
- *
- * @return the previous element in the list.
- * @throws NoSuchElementException if there are no more prior elements.
- */
- public Object previous()
- {
- return li.previous();
- }
-
- /**
- * Find the index of the element that would be returned by a call to
- * previous. If <code>hasPrevious()</code> returns <code>false</code>,
- * this returns -1.
- *
- * @return the index of the element that would be returned by
- * <code>previous()</code>.
- */
- public int previousIndex()
- {
- return li.previousIndex();
- }
-
- /**
- * Blocks the replacement of an element in the list underlying this
- * iterator. This method never returns, throwing an exception instead.
- *
- * @param o The new object to replace the existing one.
- * @throws UnsupportedOperationException as the iterator of an unmodifiable
- * list does not support the <code>set()</code> operation.
- */
- public void set(Object o)
- {
- throw new UnsupportedOperationException();
- }
- } // class UnmodifiableListIterator
-
- /**
- * Returns an unmodifiable view of the given map. This allows "read-only"
- * access, although changes in the backing map show up in this view.
- * Attempts to modify the map directly, or via collection views or their
- * iterators will fail with {@link UnsupportedOperationException}.
- * Although this view prevents changes to the structure of the map and its
- * entries, the values referenced by the objects in the map can still be
- * modified.
- * <p>
- *
- * The returned Map implements Serializable, but can only be serialized if
- * the map it wraps is likewise Serializable.
- *
- * @param m the map to wrap
- * @return a read-only view of the map
- * @see Serializable
- */
- public static Map unmodifiableMap(Map m)
- {
- return new UnmodifiableMap(m);
- }
-
- /**
- * The implementation of {@link #unmodifiableMap(Map)}. This
- * class name is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static class UnmodifiableMap implements Map, Serializable
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -1034234728574286014L;
-
- /**
- * The wrapped map.
- * @serial the real map
- */
- private final Map m;
-
- /**
- * Cache the entry set.
- */
- private transient Set entries;
-
- /**
- * Cache the key set.
- */
- private transient Set keys;
-
- /**
- * Cache the value collection.
- */
- private transient Collection values;
-
- /**
- * Wrap a given map.
- * @param m the map to wrap
- * @throws NullPointerException if m is null
- */
- UnmodifiableMap(Map m)
- {
- this.m = m;
- if (m == null)
- throw new NullPointerException();
- }
-
- /**
- * Blocks the clearing of entries from the underlying map.
- * This method never returns, throwing an exception instead.
- *
- * @throws UnsupportedOperationException as an unmodifiable
- * map does not support the <code>clear()</code> operation.
- */
- public void clear()
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns <code>true</code> if the underlying map contains a mapping for
- * the given key.
- *
- * @param key the key to search for
- * @return <code>true</code> if the map contains the key
- * @throws ClassCastException if the key is of an inappropriate type
- * @throws NullPointerException if key is <code>null</code> but the map
- * does not permit null keys
- */
- public boolean containsKey(Object key)
- {
- return m.containsKey(key);
- }
-
- /**
- * Returns <code>true</code> if the underlying map contains at least one mapping with
- * the given value. In other words, it returns <code>true</code> if a value v exists where
- * <code>(value == null ? v == null : value.equals(v))</code>. This usually
- * requires linear time.
- *
- * @param value the value to search for
- * @return <code>true</code> if the map contains the value
- * @throws ClassCastException if the type of the value is not a valid type
- * for this map.
- * @throws NullPointerException if the value is null and the map doesn't
- * support null values.
- */
- public boolean containsValue(Object value)
- {
- return m.containsValue(value);
- }
-
- /**
- * Returns a unmodifiable set view of the entries in the underlying map.
- * Each element in the set is a unmodifiable variant of <code>Map.Entry</code>.
- * The set is backed by the map, so that changes in one show up in the other.
- * Modifications made while an iterator is in progress cause undefined
- * behavior. These modifications are again limited to the values of
- * the objects.
- *
- * @return the unmodifiable set view of all mapping entries.
- * @see Map.Entry
- */
- public Set entrySet()
- {
- if (entries == null)
- entries = new UnmodifiableEntrySet(m.entrySet());
- return entries;
- }
-
- /**
- * The implementation of {@link UnmodifiableMap#entrySet()}. This class
- * name is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class UnmodifiableEntrySet extends UnmodifiableSet
- implements Serializable
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 7854390611657943733L;
-
- /**
- * Wrap a given set.
- * @param s the set to wrap
- */
- UnmodifiableEntrySet(Set s)
- {
- super(s);
- }
-
- // The iterator must return unmodifiable map entries.
- public Iterator iterator()
- {
- return new UnmodifiableIterator(c.iterator())
- {
- /**
- * Obtains the next element from the underlying set of
- * map entries.
- *
- * @return the next element in the collection.
- * @throws NoSuchElementException if there are no more elements.
- */
- public Object next()
- {
- final Map.Entry e = (Map.Entry) super.next();
- return new Map.Entry()
- {
- /**
- * Returns <code>true</code> if the object, o, is also a map entry with an
- * identical key and value.
- *
- * @param o the object to compare.
- * @return <code>true</code> if o is an equivalent map entry.
- */
- public boolean equals(Object o)
- {
- return e.equals(o);
- }
-
- /**
- * Returns the key of this map entry.
- *
- * @return the key.
- */
- public Object getKey()
- {
- return e.getKey();
- }
-
- /**
- * Returns the value of this map entry.
- *
- * @return the value.
- */
- public Object getValue()
- {
- return e.getValue();
- }
-
- /**
- * Computes the hash code of this map entry.
- * The computation is described in the <code>Map</code>
- * interface documentation.
- *
- * @return the hash code of this entry.
- * @see Map#hashCode()
- */
- public int hashCode()
- {
- return e.hashCode();
- }
-
- /**
- * Blocks the alteration of the value of this map entry.
- * This method never returns, throwing an exception instead.
- *
- * @param value The new value.
- * @throws UnsupportedOperationException as an unmodifiable
- * map entry does not support the <code>setValue()</code>
- * operation.
- */
- public Object setValue(Object value)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns a textual representation of the map entry.
- *
- * @return The map entry as a <code>String</code>.
- */
- public String toString()
- {
- return e.toString();
- }
- };
- }
- };
- }
- } // class UnmodifiableEntrySet
-
- /**
- * Returns <code>true</code> if the object, o, is also an instance
- * of <code>Map</code> with an equal set of map entries.
- *
- * @param o The object to compare.
- * @return <code>true</code> if o is an equivalent map.
- */
- public boolean equals(Object o)
- {
- return m.equals(o);
- }
-
- /**
- * Returns the value associated with the supplied key or
- * null if no such mapping exists. An ambiguity can occur
- * if null values are accepted by the underlying map.
- * In this case, <code>containsKey()</code> can be used
- * to separate the two possible cases of a null result.
- *
- * @param key The key to look up.
- * @return the value associated with the key, or null if key not in map.
- * @throws ClassCastException if the key is an inappropriate type.
- * @throws NullPointerException if this map does not accept null keys.
- * @see #containsKey(Object)
- */
- public Object get(Object key)
- {
- return m.get(key);
- }
-
- /**
- * Blocks the addition of a new entry to the underlying map.
- * This method never returns, throwing an exception instead.
- *
- * @param key The new key.
- * @param value The new value.
- * @return the previous value of the key, or null if there was no mapping.
- * @throws UnsupportedOperationException as an unmodifiable
- * map does not support the <code>put()</code> operation.
- */
- public Object put(Object key, Object value)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Computes the hash code for the underlying map, as the sum
- * of the hash codes of all entries.
- *
- * @return The hash code of the underlying map.
- * @see Map.Entry#hashCode()
- */
- public int hashCode()
- {
- return m.hashCode();
- }
-
- /**
- * Returns <code>true</code> if the underlying map contains no entries.
- *
- * @return <code>true</code> if the map is empty.
- */
- public boolean isEmpty()
- {
- return m.isEmpty();
- }
-
- /**
- * Returns a unmodifiable set view of the keys in the underlying map.
- * The set is backed by the map, so that changes in one show up in the other.
- * Modifications made while an iterator is in progress cause undefined
- * behavior. These modifications are again limited to the values of
- * the keys.
- *
- * @return the set view of all keys.
- */
- public Set keySet()
- {
- if (keys == null)
- keys = new UnmodifiableSet(m.keySet());
- return keys;
- }
-
- /**
- * Blocks the addition of the entries in the supplied map.
- * This method never returns, throwing an exception instead.
- *
- * @param m The map, the entries of which should be added
- * to the underlying map.
- * @throws UnsupportedOperationException as an unmodifiable
- * map does not support the <code>putAll</code> operation.
- */
- public void putAll(Map m)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Blocks the removal of an entry from the map.
- * This method never returns, throwing an exception instead.
- *
- * @param o The key of the entry to remove.
- * @return The value the key was associated with, or null
- * if no such mapping existed. Null is also returned
- * if the removed entry had a null key.
- * @throws UnsupportedOperationException as an unmodifiable
- * map does not support the <code>remove</code> operation.
- */
- public Object remove(Object o)
- {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Returns the number of key-value mappings in the underlying map.
- * If there are more than Integer.MAX_VALUE mappings, Integer.MAX_VALUE
- * is returned.
- *
- * @return the number of mappings.
- */
- public int size()
- {
- return m.size();
- }
-
- /**
- * Returns a textual representation of the map.
- *
- * @return The map in the form of a <code>String</code>.
- */
- public String toString()
- {
- return m.toString();
- }
-
- /**
- * Returns a unmodifiable collection view of the values in the underlying map.
- * The collection is backed by the map, so that changes in one show up in the other.
- * Modifications made while an iterator is in progress cause undefined
- * behavior. These modifications are again limited to the values of
- * the keys.
- *
- * @return the collection view of all values.
- */
- public Collection values()
- {
- if (values == null)
- values = new UnmodifiableCollection(m.values());
- return values;
- }
- } // class UnmodifiableMap
-
- /**
- * Returns an unmodifiable view of the given set. This allows
- * "read-only" access, although changes in the backing set show up
- * in this view. Attempts to modify the set directly or via iterators
- * will fail with {@link UnsupportedOperationException}.
- * Although this view prevents changes to the structure of the set and its
- * entries, the values referenced by the objects in the set can still be
- * modified.
- * <p>
- *
- * The returned Set implements Serializable, but can only be serialized if
- * the set it wraps is likewise Serializable.
- *
- * @param s the set to wrap
- * @return a read-only view of the set
- * @see Serializable
- */
- public static Set unmodifiableSet(Set s)
- {
- return new UnmodifiableSet(s);
- }
-
- /**
- * The implementation of {@link #unmodifiableSet(Set)}. This class
- * name is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static class UnmodifiableSet extends UnmodifiableCollection
- implements Set
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -9215047833775013803L;
-
- /**
- * Wrap a given set.
- * @param s the set to wrap
- * @throws NullPointerException if s is null
- */
- UnmodifiableSet(Set s)
- {
- super(s);
- }
-
- /**
- * Returns <code>true</code> if the object, o, is also an instance of
- * <code>Set</code> of the same size and with the same entries.
- *
- * @return <code>true</code> if o is an equivalent set.
- */
- public boolean equals(Object o)
- {
- return c.equals(o);
- }
-
- /**
- * Computes the hash code of this set, as the sum of the
- * hash codes of all elements within the set.
- *
- * @return the hash code of the set.
- */
- public int hashCode()
- {
- return c.hashCode();
- }
- } // class UnmodifiableSet
-
- /**
- * Returns an unmodifiable view of the given sorted map. This allows
- * "read-only" access, although changes in the backing map show up in this
- * view. Attempts to modify the map directly, via subviews, via collection
- * views, or iterators, will fail with {@link UnsupportedOperationException}.
- * Although this view prevents changes to the structure of the map and its
- * entries, the values referenced by the objects in the map can still be
- * modified.
- * <p>
- *
- * The returned SortedMap implements Serializable, but can only be
- * serialized if the map it wraps is likewise Serializable.
- *
- * @param m the map to wrap
- * @return a read-only view of the map
- * @see Serializable
- */
- public static SortedMap unmodifiableSortedMap(SortedMap m)
- {
- return new UnmodifiableSortedMap(m);
- }
-
- /**
- * The implementation of {@link #unmodifiableSortedMap(SortedMap)}. This
- * class name is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static class UnmodifiableSortedMap extends UnmodifiableMap
- implements SortedMap
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -8806743815996713206L;
-
- /**
- * The wrapped map; stored both here and in the superclass to avoid
- * excessive casting.
- * @serial the wrapped map
- */
- private final SortedMap sm;
-
- /**
- * Wrap a given map.
- * @param sm the map to wrap
- * @throws NullPointerException if sm is null
- */
- UnmodifiableSortedMap(SortedMap sm)
- {
- super(sm);
- this.sm = sm;
- }
-
- /**
- * Returns the comparator used in sorting the underlying map,
- * or null if it is the keys' natural ordering.
- *
- * @return the sorting comparator.
- */
- public Comparator comparator()
- {
- return sm.comparator();
- }
-
- /**
- * Returns the first (lowest sorted) key in the map.
- *
- * @return the first key.
- * @throws NoSuchElementException if this map is empty.
- */
- public Object firstKey()
- {
- return sm.firstKey();
- }
-
- /**
- * Returns a unmodifiable view of the portion of the map strictly less
- * than toKey. The view is backed by the underlying map, so changes in
- * one show up in the other. The submap supports all optional operations
- * of the original. This operation is equivalent to
- * <code>subMap(firstKey(), toKey)</code>.
- * <p>
- *
- * The returned map throws an IllegalArgumentException any time a key is
- * used which is out of the range of toKey. Note that the endpoint, toKey,
- * is not included; if you want this value to be included, pass its successor
- * object in to toKey. For example, for Integers, you could request
- * <code>headMap(new Integer(limit.intValue() + 1))</code>.
- *
- * @param toKey the exclusive upper range of the submap.
- * @return the submap.
- * @throws ClassCastException if toKey is not comparable to the map contents.
- * @throws IllegalArgumentException if this is a subMap, and toKey is out
- * of range.
- * @throws NullPointerException if toKey is null but the map does not allow
- * null keys.
- */
- public SortedMap headMap(Object toKey)
- {
- return new UnmodifiableSortedMap(sm.headMap(toKey));
- }
-
- /**
- * Returns the last (highest sorted) key in the map.
- *
- * @return the last key.
- * @throws NoSuchElementException if this map is empty.
- */
- public Object lastKey()
- {
- return sm.lastKey();
- }
-
- /**
- * Returns a unmodifiable view of the portion of the map greater than or
- * equal to fromKey, and strictly less than toKey. The view is backed by
- * the underlying map, so changes in one show up in the other. The submap
- * supports all optional operations of the original.
- * <p>
- *
- * The returned map throws an IllegalArgumentException any time a key is
- * used which is out of the range of fromKey and toKey. Note that the
- * lower endpoint is included, but the upper is not; if you want to
- * change the inclusion or exclusion of an endpoint, pass its successor
- * object in instead. For example, for Integers, you could request
- * <code>subMap(new Integer(lowlimit.intValue() + 1),
- * new Integer(highlimit.intValue() + 1))</code> to reverse
- * the inclusiveness of both endpoints.
- *
- * @param fromKey the inclusive lower range of the submap.
- * @param toKey the exclusive upper range of the submap.
- * @return the submap.
- * @throws ClassCastException if fromKey or toKey is not comparable to
- * the map contents.
- * @throws IllegalArgumentException if this is a subMap, and fromKey or
- * toKey is out of range.
- * @throws NullPointerException if fromKey or toKey is null but the map
- * does not allow null keys.
- */
- public SortedMap subMap(Object fromKey, Object toKey)
- {
- return new UnmodifiableSortedMap(sm.subMap(fromKey, toKey));
- }
-
- /**
- * Returns a unmodifiable view of the portion of the map greater than or
- * equal to fromKey. The view is backed by the underlying map, so changes
- * in one show up in the other. The submap supports all optional operations
- * of the original.
- * <p>
- *
- * The returned map throws an IllegalArgumentException any time a key is
- * used which is out of the range of fromKey. Note that the endpoint, fromKey, is
- * included; if you do not want this value to be included, pass its successor object in
- * to fromKey. For example, for Integers, you could request
- * <code>tailMap(new Integer(limit.intValue() + 1))</code>.
- *
- * @param fromKey the inclusive lower range of the submap
- * @return the submap
- * @throws ClassCastException if fromKey is not comparable to the map
- * contents
- * @throws IllegalArgumentException if this is a subMap, and fromKey is out
- * of range
- * @throws NullPointerException if fromKey is null but the map does not allow
- * null keys
- */
- public SortedMap tailMap(Object fromKey)
- {
- return new UnmodifiableSortedMap(sm.tailMap(fromKey));
- }
- } // class UnmodifiableSortedMap
-
- /**
- * Returns an unmodifiable view of the given sorted set. This allows
- * "read-only" access, although changes in the backing set show up
- * in this view. Attempts to modify the set directly, via subsets, or via
- * iterators, will fail with {@link UnsupportedOperationException}.
- * Although this view prevents changes to the structure of the set and its
- * entries, the values referenced by the objects in the set can still be
- * modified.
- * <p>
- *
- * The returns SortedSet implements Serializable, but can only be
- * serialized if the set it wraps is likewise Serializable.
- *
- * @param s the set to wrap
- * @return a read-only view of the set
- * @see Serializable
- */
- public static SortedSet unmodifiableSortedSet(SortedSet s)
- {
- return new UnmodifiableSortedSet(s);
- }
-
- /**
- * The implementation of {@link #synchronizedSortedMap(SortedMap)}. This
- * class name is required for compatibility with Sun's JDK serializability.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static class UnmodifiableSortedSet extends UnmodifiableSet
- implements SortedSet
- {
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -4929149591599911165L;
-
- /**
- * The wrapped set; stored both here and in the superclass to avoid
- * excessive casting.
- * @serial the wrapped set
- */
- private SortedSet ss;
-
- /**
- * Wrap a given set.
- * @param ss the set to wrap
- * @throws NullPointerException if ss is null
- */
- UnmodifiableSortedSet(SortedSet ss)
- {
- super(ss);
- this.ss = ss;
- }
-
- /**
- * Returns the comparator used in sorting the underlying set,
- * or null if it is the elements' natural ordering.
- *
- * @return the sorting comparator
- */
- public Comparator comparator()
- {
- return ss.comparator();
- }
-
- /**
- * Returns the first (lowest sorted) element in the underlying
- * set.
- *
- * @return the first element.
- * @throws NoSuchElementException if the set is empty.
- */
- public Object first()
- {
- return ss.first();
- }
-
- /**
- * Returns a unmodifiable view of the portion of the set strictly
- * less than toElement. The view is backed by the underlying set,
- * so changes in one show up in the other. The subset supports
- * all optional operations of the original. This operation
- * is equivalent to <code>subSet(first(), toElement)</code>.
- * <p>
- *
- * The returned set throws an IllegalArgumentException any time an element is
- * used which is out of the range of toElement. Note that the endpoint, toElement,
- * is not included; if you want this value included, pass its successor object in to
- * toElement. For example, for Integers, you could request
- * <code>headSet(new Integer(limit.intValue() + 1))</code>.
- *
- * @param toElement the exclusive upper range of the subset
- * @return the subset.
- * @throws ClassCastException if toElement is not comparable to the set
- * contents.
- * @throws IllegalArgumentException if this is a subSet, and toElement is out
- * of range.
- * @throws NullPointerException if toElement is null but the set does not
- * allow null elements.
- */
- public SortedSet headSet(Object toElement)
- {
- return new UnmodifiableSortedSet(ss.headSet(toElement));
- }
-
- /**
- * Returns the last (highest sorted) element in the underlying
- * set.
- *
- * @return the last element.
- * @throws NoSuchElementException if the set is empty.
- */
- public Object last()
- {
- return ss.last();
- }
-
- /**
- * Returns a unmodifiable view of the portion of the set greater than or
- * equal to fromElement, and strictly less than toElement. The view is backed by
- * the underlying set, so changes in one show up in the other. The subset
- * supports all optional operations of the original.
- * <p>
- *
- * The returned set throws an IllegalArgumentException any time an element is
- * used which is out of the range of fromElement and toElement. Note that the
- * lower endpoint is included, but the upper is not; if you want to
- * change the inclusion or exclusion of an endpoint, pass its successor
- * object in instead. For example, for Integers, you can request
- * <code>subSet(new Integer(lowlimit.intValue() + 1),
- * new Integer(highlimit.intValue() + 1))</code> to reverse
- * the inclusiveness of both endpoints.
- *
- * @param fromElement the inclusive lower range of the subset.
- * @param toElement the exclusive upper range of the subset.
- * @return the subset.
- * @throws ClassCastException if fromElement or toElement is not comparable
- * to the set contents.
- * @throws IllegalArgumentException if this is a subSet, and fromElement or
- * toElement is out of range.
- * @throws NullPointerException if fromElement or toElement is null but the
- * set does not allow null elements.
- */
- public SortedSet subSet(Object fromElement, Object toElement)
- {
- return new UnmodifiableSortedSet(ss.subSet(fromElement, toElement));
- }
-
- /**
- * Returns a unmodifiable view of the portion of the set greater than or equal to
- * fromElement. The view is backed by the underlying set, so changes in one show up
- * in the other. The subset supports all optional operations of the original.
- * <p>
- *
- * The returned set throws an IllegalArgumentException any time an element is
- * used which is out of the range of fromElement. Note that the endpoint,
- * fromElement, is included; if you do not want this value to be included, pass its
- * successor object in to fromElement. For example, for Integers, you could request
- * <code>tailSet(new Integer(limit.intValue() + 1))</code>.
- *
- * @param fromElement the inclusive lower range of the subset
- * @return the subset.
- * @throws ClassCastException if fromElement is not comparable to the set
- * contents.
- * @throws IllegalArgumentException if this is a subSet, and fromElement is
- * out of range.
- * @throws NullPointerException if fromElement is null but the set does not
- * allow null elements.
- */
- public SortedSet tailSet(Object fromElement)
- {
- return new UnmodifiableSortedSet(ss.tailSet(fromElement));
- }
- } // class UnmodifiableSortedSet
-} // class Collections
diff --git a/libjava/java/util/Comparator.java b/libjava/java/util/Comparator.java
deleted file mode 100644
index 386bdc1d6a2..00000000000
--- a/libjava/java/util/Comparator.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Comparator.java -- Interface for objects that specify an ordering
- Copyright (C) 1998, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * Interface for objects that specify an ordering between objects. The ordering
- * should be <em>total</em>, such that any two objects of the correct type
- * can be compared, and the comparison is reflexive, anti-symmetric, and
- * transitive. It is also recommended that the comparator be <em>consistent
- * with equals</em>, although this is not a strict requirement. A relation
- * is consistent with equals if these two statements always have the same
- * results (if no exceptions occur):<br>
- * <code>compare((Object) e1, (Object) e2) == 0</code> and
- * <code>e1.equals((Object) e2)</code><br>
- * Comparators that violate consistency with equals may cause strange behavior
- * in sorted lists and sets. For example, a case-sensitive dictionary order
- * comparison of Strings is consistent with equals, but if it is
- * case-insensitive it is not, because "abc" and "ABC" compare as equal even
- * though "abc".equals("ABC") returns false.
- * <P>
- * In general, Comparators should be Serializable, because when they are passed
- * to Serializable data structures such as SortedMap or SortedSet, the entire
- * data structure will only serialize correctly if the comparator is
- * Serializable.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Comparable
- * @see TreeMap
- * @see TreeSet
- * @see SortedMap
- * @see SortedSet
- * @see Arrays#sort(Object[], Comparator)
- * @see java.io.Serializable
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Comparator
-{
- /**
- * Return an integer that is negative, zero or positive depending on whether
- * the first argument is less than, equal to or greater than the second
- * according to this ordering. This method should obey the following
- * contract:
- * <ul>
- * <li>if compare(a, b) &lt; 0 then compare(b, a) &gt; 0</li>
- * <li>if compare(a, b) throws an exception, so does compare(b, a)</li>
- * <li>if compare(a, b) &lt; 0 and compare(b, c) &lt; 0 then compare(a, c)
- * &lt; 0</li>
- * <li>if compare(a, b) == 0 then compare(a, c) and compare(b, c) must
- * have the same sign</li>
- * </ul>
- * To be consistent with equals, the following additional constraint is
- * in place:
- * <ul>
- * <li>if a.equals(b) or both a and b are null, then
- * compare(a, b) == 0.</li>
- * </ul><p>
- *
- * Although it is permissible for a comparator to provide an order
- * inconsistent with equals, that should be documented.
- *
- * @param o1 the first object
- * @param o2 the second object
- * @return the comparison
- * @throws ClassCastException if the elements are not of types that can be
- * compared by this ordering.
- */
- int compare(Object o1, Object o2);
-
- /**
- * Return true if the object is equal to this object. To be
- * considered equal, the argument object must satisfy the constraints
- * of <code>Object.equals()</code>, be a Comparator, and impose the
- * same ordering as this Comparator. The default implementation
- * inherited from Object is usually adequate.
- *
- * @param obj The object
- * @return true if it is a Comparator that imposes the same order
- * @see Object#equals(Object)
- */
- boolean equals(Object obj);
-}
diff --git a/libjava/java/util/ConcurrentModificationException.java b/libjava/java/util/ConcurrentModificationException.java
deleted file mode 100644
index 3d7ae108415..00000000000
--- a/libjava/java/util/ConcurrentModificationException.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ConcurrentModificationException.java -- Data structure concurrently modified
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- */
-
-/**
- * Exception that is thrown by the collections classes when it is detected that
- * a modification has been made to a data structure when this is not allowed,
- * such as when a collection is structurally modified while an Iterator is
- * operating over it. In cases where this can be detected, a
- * ConcurrentModificationException will be thrown. An Iterator that detects
- * this condition is referred to as fail-fast. Notice that this can occur
- * even in single-threaded designs, if you call methods out of order.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see Iterator
- * @see ListIterator
- * @see Vector
- * @see LinkedList
- * @see HashSet
- * @see Hashtable
- * @see TreeMap
- * @see AbstractList
- * @since 1.2
- * @status updated to 1.4
- */
-public class ConcurrentModificationException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.2.
- */
- private static final long serialVersionUID = -3666751008965953603L;
-
- /**
- * Constructs a ConcurrentModificationException with no detail message.
- */
- public ConcurrentModificationException()
- {
- }
-
- /**
- * Constructs a ConcurrentModificationException with a detail message.
- *
- * @param detail the detail message for the exception
- */
- public ConcurrentModificationException(String detail)
- {
- super(detail);
- }
-}
diff --git a/libjava/java/util/Dictionary.java b/libjava/java/util/Dictionary.java
deleted file mode 100644
index 0d44ab67de1..00000000000
--- a/libjava/java/util/Dictionary.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Dictionary.java -- an abstract (and essentially worthless)
- class which is Hashtable's superclass
- Copyright (C) 1998, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * A Dictionary maps keys to values; <i>how</i> it does that is
- * implementation-specific.
- *
- * This is an abstract class which has really gone by the wayside.
- * People at Javasoft are probably embarrassed by it. At this point,
- * it might as well be an interface rather than a class, but it remains
- * this poor, laughable skeleton for the sake of backwards compatibility.
- * At any rate, this was what came before the {@link Map} interface
- * in the Collections framework.
- *
- * @author Jon Zeppieri
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Map
- * @see Hashtable
- * @since 1.0
- * @status updated to 1.4
- */
-public abstract class Dictionary
-{
- // WARNING: Dictionary is a CORE class in the bootstrap cycle. See the
- // comments in vm/reference/java/lang/Runtime for implications of this fact.
-
- /**
- * Sole constructor (often called implicitly).
- */
- public Dictionary()
- {
- }
-
- /**
- * Returns an Enumeration of the values in this Dictionary.
- *
- * @return an Enumeration of the values
- * @see #keys()
- */
- public abstract Enumeration elements();
-
- /**
- * Returns the value associated with the supplied key, or null
- * if no such value exists. Since Dictionaries are not allowed null keys
- * or elements, a null result always means the key is not present.
- *
- * @param key the key to use to fetch the value
- * @return the mapped value
- * @throws NullPointerException if key is null
- * @see #put(Object, Object)
- */
- public abstract Object get(Object key);
-
- /**
- * Returns true when there are no elements in this Dictionary.
- *
- * @return <code>size() == 0</code>
- */
- public abstract boolean isEmpty();
-
- /**
- * Returns an Enumeration of the keys in this Dictionary
- *
- * @return an Enumeration of the keys
- * @see #elements()
- */
- public abstract Enumeration keys();
-
- /**
- * Inserts a new value into this Dictionary, located by the
- * supplied key. Dictionary does not support null keys or values, so
- * a null return can safely be interpreted as adding a new key.
- *
- * @param key the key which locates the value
- * @param value the value to put into the Dictionary
- * @return the previous value of the key, or null if there was none
- * @throws NullPointerException if key or value is null
- * @see #get(Object)
- */
- public abstract Object put(Object key, Object value);
-
- /**
- * Removes from the Dictionary the value located by the given key. A null
- * return safely means that the key was not mapped in the Dictionary.
- *
- * @param key the key used to locate the value to be removed
- * @return the value associated with the removed key
- * @throws NullPointerException if key is null
- */
- public abstract Object remove(Object key);
-
- /**
- * Returns the number of values currently in this Dictionary.
- *
- * @return the number of keys in the Dictionary
- */
- public abstract int size();
-} // class Dictionary
diff --git a/libjava/java/util/EmptyStackException.java b/libjava/java/util/EmptyStackException.java
deleted file mode 100644
index e8b4509ee5c..00000000000
--- a/libjava/java/util/EmptyStackException.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* EmptyStackException.java -- Attempt to pop from an empty stack
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- */
-
-/**
- * This exception is thrown by the Stack class when an attempt is made to pop
- * or otherwise access elements from an empty stack.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Stack
- * @since 1.0
- * @status updated to 1.4
- */
-public class EmptyStackException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0.
- */
- private static final long serialVersionUID = 5084686378493302095L;
-
- /**
- * Constructs an EmptyStackException with no detail message.
- */
- public EmptyStackException()
- {
- }
-}
diff --git a/libjava/java/util/Enumeration.java b/libjava/java/util/Enumeration.java
deleted file mode 100644
index 1365bbb2f0f..00000000000
--- a/libjava/java/util/Enumeration.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Enumeration.java -- Interface for enumerating lists of objects
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1.
- * Status: Believed complete and correct
- */
-
-/**
- * Interface for lists of objects that can be returned in sequence. Successive
- * objects are obtained by the nextElement method.
- * <p>
- * As of Java 1.2, the Iterator interface provides the same functionality, but
- * with shorter method names and a new optional method to remove items from the
- * list. If writing for 1.2, consider using Iterator instead. Enumerations over
- * the new collections classes, for use with legacy APIs that require them, can
- * be obtained by the enumeration method in class Collections.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Iterator
- * @see Hashtable
- * @see Vector
- * @since 1.0
- * @status updated to 1.4
- */
-public interface Enumeration
-{
- /**
- * Tests whether there are elements remaining in the enumeration.
- *
- * @return true if there is at least one more element in the enumeration,
- * that is, if the next call to nextElement will not throw a
- * NoSuchElementException.
- */
- boolean hasMoreElements();
-
- /**
- * Obtain the next element in the enumeration.
- *
- * @return the next element in the enumeration
- * @throws NoSuchElementException if there are no more elements
- */
- Object nextElement();
-}
diff --git a/libjava/java/util/EventListener.java b/libjava/java/util/EventListener.java
deleted file mode 100644
index c9a1795f900..00000000000
--- a/libjava/java/util/EventListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* EventListener.java -- tagging interface for all event listeners
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * Empty interface that is implemented by classes that need to receive
- * events. Subinterfaces define methods that can be called to fire an
- * event notification. Normally the name of these subinterfaces end in
- * <code>Listener</code> and all method described by the subinterface
- * take as argument an subclass of <code>EventObject</code>.
- *
- * @author Tom Tromey (tromey@cygnus.com)
- * @see EventObject
- * @status updated to 1.4
- */
-public interface EventListener
-{
-}
diff --git a/libjava/java/util/EventListenerProxy.java b/libjava/java/util/EventListenerProxy.java
deleted file mode 100644
index 245c5ffb458..00000000000
--- a/libjava/java/util/EventListenerProxy.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* EventListenerProxy.java -- abstract wrapper for event listeners
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * An abstract wrapper for event listeners. This allows subclasses to
- * attach additional parameters to an existing event listener to create
- * a new one. Subclasses are expected to add methods to set and retrieve
- * any attached properties.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.4
- * @status updated to 1.4
- */
-public abstract class EventListenerProxy implements EventListener
-{
- /** The listener that this proxy wraps. */
- private final EventListener listener;
-
- /**
- * Construct a proxy event listener, given an existing one to augment.
- *
- * @param listener the listener to wrap
- */
- public EventListenerProxy(EventListener listener)
- {
- this.listener = listener;
- }
-
- /**
- * Return the wrapped event listener.
- *
- * @return the listener associated with this proxy
- */
- public EventListener getListener()
- {
- return listener;
- }
-} // class EventListenerProxy
diff --git a/libjava/java/util/EventObject.java b/libjava/java/util/EventObject.java
deleted file mode 100644
index 7ced18aa4ba..00000000000
--- a/libjava/java/util/EventObject.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* EventObject.java -- represents an event on an object
- Copyright (C) 1999, 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.Serializable;
-
-/**
- * Represents Events fired by Objects.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see EventListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class EventObject implements Serializable
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 5516075349620653480L;
-
- /**
- * The source object; in other words, the object which this event takes
- * place on.
- */
- protected transient Object source;
-
- /**
- * Constructs an EventObject with the specified source.
- *
- * @param source the source of the event
- * @throws IllegalArgumentException if source is null (This is not
- * specified, but matches the behavior of the JDK)
- */
- public EventObject(Object source)
- {
- // This check for null is stupid, if you ask me, since source is
- // protected and non-final, so a subclass can set it to null later on.
- if (source == null)
- throw new IllegalArgumentException();
- this.source = source;
- }
-
- /**
- * Returns the source of the event.
- *
- * @return the event source
- */
- public Object getSource()
- {
- return source;
- }
-
- /**
- * Converts the event to a String. The format is not specified, but by
- * observation, the JDK uses:
- * <code>getClass().getName() + "[source=" + source + "]";</code>.
- *
- * @return String representation of the Event
- */
- public String toString()
- {
- return getClass().getName() + "[source=" + source + "]";
- }
-} // class EventObject
diff --git a/libjava/java/util/HashMap.java b/libjava/java/util/HashMap.java
deleted file mode 100644
index 5ca9cf6d500..00000000000
--- a/libjava/java/util/HashMap.java
+++ /dev/null
@@ -1,906 +0,0 @@
-/* HashMap.java -- a class providing a basic hashtable data structure,
- mapping Object --> Object
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-// NOTE: This implementation is very similar to that of Hashtable. If you fix
-// a bug in here, chances are you should make a similar change to the Hashtable
-// code.
-
-// NOTE: This implementation has some nasty coding style in order to
-// support LinkedHashMap, which extends this.
-
-/**
- * This class provides a hashtable-backed implementation of the
- * Map interface.
- * <p>
- *
- * It uses a hash-bucket approach; that is, hash collisions are handled
- * by linking the new node off of the pre-existing node (or list of
- * nodes). In this manner, techniques such as linear probing (which
- * can cause primary clustering) and rehashing (which does not fit very
- * well with Java's method of precomputing hash codes) are avoided.
- * <p>
- *
- * Under ideal circumstances (no collisions), HashMap offers O(1)
- * performance on most operations (<code>containsValue()</code> is,
- * of course, O(n)). In the worst case (all keys map to the same
- * hash code -- very unlikely), most operations are O(n).
- * <p>
- *
- * HashMap is part of the JDK1.2 Collections API. It differs from
- * Hashtable in that it accepts the null key and null values, and it
- * does not support "Enumeration views." Also, it is not synchronized;
- * if you plan to use it in multiple threads, consider using:<br>
- * <code>Map m = Collections.synchronizedMap(new HashMap(...));</code>
- * <p>
- *
- * The iterators are <i>fail-fast</i>, meaning that any structural
- * modification, except for <code>remove()</code> called on the iterator
- * itself, cause the iterator to throw a
- * <code>ConcurrentModificationException</code> rather than exhibit
- * non-deterministic behavior.
- *
- * @author Jon Zeppieri
- * @author Jochen Hoenicke
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Object#hashCode()
- * @see Collection
- * @see Map
- * @see TreeMap
- * @see LinkedHashMap
- * @see IdentityHashMap
- * @see Hashtable
- * @since 1.2
- * @status updated to 1.4
- */
-public class HashMap extends AbstractMap
- implements Map, Cloneable, Serializable
-{
- /**
- * Default number of buckets. This is the value the JDK 1.3 uses. Some
- * early documentation specified this value as 101. That is incorrect.
- * Package visible for use by HashSet.
- */
- static final int DEFAULT_CAPACITY = 11;
-
- /**
- * The default load factor; this is explicitly specified by the spec.
- * Package visible for use by HashSet.
- */
- static final float DEFAULT_LOAD_FACTOR = 0.75f;
-
- /**
- * Compatible with JDK 1.2.
- */
- private static final long serialVersionUID = 362498820763181265L;
-
- /**
- * The rounded product of the capacity and the load factor; when the number
- * of elements exceeds the threshold, the HashMap calls
- * <code>rehash()</code>.
- * @serial the threshold for rehashing
- */
- private int threshold;
-
- /**
- * Load factor of this HashMap: used in computing the threshold.
- * Package visible for use by HashSet.
- * @serial the load factor
- */
- final float loadFactor;
-
- /**
- * Array containing the actual key-value mappings.
- * Package visible for use by nested and subclasses.
- */
- transient HashEntry[] buckets;
-
- /**
- * Counts the number of modifications this HashMap has undergone, used
- * by Iterators to know when to throw ConcurrentModificationExceptions.
- * Package visible for use by nested and subclasses.
- */
- transient int modCount;
-
- /**
- * The size of this HashMap: denotes the number of key-value pairs.
- * Package visible for use by nested and subclasses.
- */
- transient int size;
-
- /**
- * The cache for {@link #entrySet()}.
- */
- private transient Set entries;
-
- /**
- * Class to represent an entry in the hash table. Holds a single key-value
- * pair. Package visible for use by subclass.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- static class HashEntry extends AbstractMap.BasicMapEntry
- {
- /**
- * The next entry in the linked list. Package visible for use by subclass.
- */
- HashEntry next;
-
- /**
- * Simple constructor.
- * @param key the key
- * @param value the value
- */
- HashEntry(Object key, Object value)
- {
- super(key, value);
- }
-
- /**
- * Called when this entry is accessed via {@link #put(Object, Object)}.
- * This version does nothing, but in LinkedHashMap, it must do some
- * bookkeeping for access-traversal mode.
- */
- void access()
- {
- }
-
- /**
- * Called when this entry is removed from the map. This version simply
- * returns the value, but in LinkedHashMap, it must also do bookkeeping.
- *
- * @return the value of this key as it is removed
- */
- Object cleanup()
- {
- return value;
- }
- }
-
- /**
- * Construct a new HashMap with the default capacity (11) and the default
- * load factor (0.75).
- */
- public HashMap()
- {
- this(DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR);
- }
-
- /**
- * Construct a new HashMap from the given Map, with initial capacity
- * the greater of the size of <code>m</code> or the default of 11.
- * <p>
- *
- * Every element in Map m will be put into this new HashMap.
- *
- * @param m a Map whose key / value pairs will be put into the new HashMap.
- * <b>NOTE: key / value pairs are not cloned in this constructor.</b>
- * @throws NullPointerException if m is null
- */
- public HashMap(Map m)
- {
- this(Math.max(m.size() * 2, DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);
- putAll(m);
- }
-
- /**
- * Construct a new HashMap with a specific inital capacity and
- * default load factor of 0.75.
- *
- * @param initialCapacity the initial capacity of this HashMap (&gt;=0)
- * @throws IllegalArgumentException if (initialCapacity &lt; 0)
- */
- public HashMap(int initialCapacity)
- {
- this(initialCapacity, DEFAULT_LOAD_FACTOR);
- }
-
- /**
- * Construct a new HashMap with a specific inital capacity and load factor.
- *
- * @param initialCapacity the initial capacity (&gt;=0)
- * @param loadFactor the load factor (&gt; 0, not NaN)
- * @throws IllegalArgumentException if (initialCapacity &lt; 0) ||
- * ! (loadFactor &gt; 0.0)
- */
- public HashMap(int initialCapacity, float loadFactor)
- {
- if (initialCapacity < 0)
- throw new IllegalArgumentException("Illegal Capacity: "
- + initialCapacity);
- if (! (loadFactor > 0)) // check for NaN too
- throw new IllegalArgumentException("Illegal Load: " + loadFactor);
-
- if (initialCapacity == 0)
- initialCapacity = 1;
- buckets = new HashEntry[initialCapacity];
- this.loadFactor = loadFactor;
- threshold = (int) (initialCapacity * loadFactor);
- }
-
- /**
- * Returns the number of kay-value mappings currently in this Map.
- *
- * @return the size
- */
- public int size()
- {
- return size;
- }
-
- /**
- * Returns true if there are no key-value mappings currently in this Map.
- *
- * @return <code>size() == 0</code>
- */
- public boolean isEmpty()
- {
- return size == 0;
- }
-
- /**
- * Return the value in this HashMap associated with the supplied key,
- * or <code>null</code> if the key maps to nothing. NOTE: Since the value
- * could also be null, you must use containsKey to see if this key
- * actually maps to something.
- *
- * @param key the key for which to fetch an associated value
- * @return what the key maps to, if present
- * @see #put(Object, Object)
- * @see #containsKey(Object)
- */
- public Object get(Object key)
- {
- int idx = hash(key);
- HashEntry e = buckets[idx];
- while (e != null)
- {
- if (equals(key, e.key))
- return e.value;
- e = e.next;
- }
- return null;
- }
-
- /**
- * Returns true if the supplied object <code>equals()</code> a key
- * in this HashMap.
- *
- * @param key the key to search for in this HashMap
- * @return true if the key is in the table
- * @see #containsValue(Object)
- */
- public boolean containsKey(Object key)
- {
- int idx = hash(key);
- HashEntry e = buckets[idx];
- while (e != null)
- {
- if (equals(key, e.key))
- return true;
- e = e.next;
- }
- return false;
- }
-
- /**
- * Puts the supplied value into the Map, mapped by the supplied key.
- * The value may be retrieved by any object which <code>equals()</code>
- * this key. NOTE: Since the prior value could also be null, you must
- * first use containsKey if you want to see if you are replacing the
- * key's mapping.
- *
- * @param key the key used to locate the value
- * @param value the value to be stored in the HashMap
- * @return the prior mapping of the key, or null if there was none
- * @see #get(Object)
- * @see Object#equals(Object)
- */
- public Object put(Object key, Object value)
- {
- int idx = hash(key);
- HashEntry e = buckets[idx];
-
- while (e != null)
- {
- if (equals(key, e.key))
- {
- e.access(); // Must call this for bookkeeping in LinkedHashMap.
- Object r = e.value;
- e.value = value;
- return r;
- }
- else
- e = e.next;
- }
-
- // At this point, we know we need to add a new entry.
- modCount++;
- if (++size > threshold)
- {
- rehash();
- // Need a new hash value to suit the bigger table.
- idx = hash(key);
- }
-
- // LinkedHashMap cannot override put(), hence this call.
- addEntry(key, value, idx, true);
- return null;
- }
-
- /**
- * Copies all elements of the given map into this hashtable. If this table
- * already has a mapping for a key, the new mapping replaces the current
- * one.
- *
- * @param m the map to be hashed into this
- */
- public void putAll(Map m)
- {
- Iterator itr = m.entrySet().iterator();
- while (itr.hasNext())
- {
- Map.Entry e = (Map.Entry) itr.next();
- // Optimize in case the Entry is one of our own.
- if (e instanceof AbstractMap.BasicMapEntry)
- {
- AbstractMap.BasicMapEntry entry = (AbstractMap.BasicMapEntry) e;
- put(entry.key, entry.value);
- }
- else
- put(e.getKey(), e.getValue());
- }
- }
-
- /**
- * Removes from the HashMap and returns the value which is mapped by the
- * supplied key. If the key maps to nothing, then the HashMap remains
- * unchanged, and <code>null</code> is returned. NOTE: Since the value
- * could also be null, you must use containsKey to see if you are
- * actually removing a mapping.
- *
- * @param key the key used to locate the value to remove
- * @return whatever the key mapped to, if present
- */
- public Object remove(Object key)
- {
- int idx = hash(key);
- HashEntry e = buckets[idx];
- HashEntry last = null;
-
- while (e != null)
- {
- if (equals(key, e.key))
- {
- modCount++;
- if (last == null)
- buckets[idx] = e.next;
- else
- last.next = e.next;
- size--;
- // Method call necessary for LinkedHashMap to work correctly.
- return e.cleanup();
- }
- last = e;
- e = e.next;
- }
- return null;
- }
-
- /**
- * Clears the Map so it has no keys. This is O(1).
- */
- public void clear()
- {
- if (size != 0)
- {
- modCount++;
- Arrays.fill(buckets, null);
- size = 0;
- }
- }
-
- /**
- * Returns true if this HashMap contains a value <code>o</code>, such that
- * <code>o.equals(value)</code>.
- *
- * @param value the value to search for in this HashMap
- * @return true if at least one key maps to the value
- * @see containsKey(Object)
- */
- public boolean containsValue(Object value)
- {
- for (int i = buckets.length - 1; i >= 0; i--)
- {
- HashEntry e = buckets[i];
- while (e != null)
- {
- if (equals(value, e.value))
- return true;
- e = e.next;
- }
- }
- return false;
- }
-
- /**
- * Returns a shallow clone of this HashMap. The Map itself is cloned,
- * but its contents are not. This is O(n).
- *
- * @return the clone
- */
- public Object clone()
- {
- HashMap copy = null;
- try
- {
- copy = (HashMap) super.clone();
- }
- catch (CloneNotSupportedException x)
- {
- // This is impossible.
- }
- copy.buckets = new HashEntry[buckets.length];
- copy.putAllInternal(this);
- // Clear the entry cache. AbstractMap.clone() does the others.
- copy.entries = null;
- return copy;
- }
-
- /**
- * Returns a "set view" of this HashMap's keys. The set is backed by the
- * HashMap, so changes in one show up in the other. The set supports
- * element removal, but not element addition.
- *
- * @return a set view of the keys
- * @see #values()
- * @see #entrySet()
- */
- public Set keySet()
- {
- if (keys == null)
- // Create an AbstractSet with custom implementations of those methods
- // that can be overridden easily and efficiently.
- keys = new AbstractSet()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- // Cannot create the iterator directly, because of LinkedHashMap.
- return HashMap.this.iterator(KEYS);
- }
-
- public void clear()
- {
- HashMap.this.clear();
- }
-
- public boolean contains(Object o)
- {
- return containsKey(o);
- }
-
- public boolean remove(Object o)
- {
- // Test against the size of the HashMap to determine if anything
- // really got removed. This is necessary because the return value
- // of HashMap.remove() is ambiguous in the null case.
- int oldsize = size;
- HashMap.this.remove(o);
- return oldsize != size;
- }
- };
- return keys;
- }
-
- /**
- * Returns a "collection view" (or "bag view") of this HashMap's values.
- * The collection is backed by the HashMap, so changes in one show up
- * in the other. The collection supports element removal, but not element
- * addition.
- *
- * @return a bag view of the values
- * @see #keySet()
- * @see #entrySet()
- */
- public Collection values()
- {
- if (values == null)
- // We don't bother overriding many of the optional methods, as doing so
- // wouldn't provide any significant performance advantage.
- values = new AbstractCollection()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- // Cannot create the iterator directly, because of LinkedHashMap.
- return HashMap.this.iterator(VALUES);
- }
-
- public void clear()
- {
- HashMap.this.clear();
- }
- };
- return values;
- }
-
- /**
- * Returns a "set view" of this HashMap's entries. The set is backed by
- * the HashMap, so changes in one show up in the other. The set supports
- * element removal, but not element addition.<p>
- *
- * Note that the iterators for all three views, from keySet(), entrySet(),
- * and values(), traverse the HashMap in the same sequence.
- *
- * @return a set view of the entries
- * @see #keySet()
- * @see #values()
- * @see Map.Entry
- */
- public Set entrySet()
- {
- if (entries == null)
- // Create an AbstractSet with custom implementations of those methods
- // that can be overridden easily and efficiently.
- entries = new AbstractSet()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- // Cannot create the iterator directly, because of LinkedHashMap.
- return HashMap.this.iterator(ENTRIES);
- }
-
- public void clear()
- {
- HashMap.this.clear();
- }
-
- public boolean contains(Object o)
- {
- return getEntry(o) != null;
- }
-
- public boolean remove(Object o)
- {
- HashEntry e = getEntry(o);
- if (e != null)
- {
- HashMap.this.remove(e.key);
- return true;
- }
- return false;
- }
- };
- return entries;
- }
-
- /**
- * Helper method for put, that creates and adds a new Entry. This is
- * overridden in LinkedHashMap for bookkeeping purposes.
- *
- * @param key the key of the new Entry
- * @param value the value
- * @param idx the index in buckets where the new Entry belongs
- * @param callRemove whether to call the removeEldestEntry method
- * @see #put(Object, Object)
- */
- void addEntry(Object key, Object value, int idx, boolean callRemove)
- {
- HashEntry e = new HashEntry(key, value);
- e.next = buckets[idx];
- buckets[idx] = e;
- }
-
- /**
- * Helper method for entrySet(), which matches both key and value
- * simultaneously.
- *
- * @param o the entry to match
- * @return the matching entry, if found, or null
- * @see #entrySet()
- */
- // Package visible, for use in nested classes.
- final HashEntry getEntry(Object o)
- {
- if (! (o instanceof Map.Entry))
- return null;
- Map.Entry me = (Map.Entry) o;
- Object key = me.getKey();
- int idx = hash(key);
- HashEntry e = buckets[idx];
- while (e != null)
- {
- if (equals(e.key, key))
- return equals(e.value, me.getValue()) ? e : null;
- e = e.next;
- }
- return null;
- }
-
- /**
- * Helper method that returns an index in the buckets array for `key'
- * based on its hashCode(). Package visible for use by subclasses.
- *
- * @param key the key
- * @return the bucket number
- */
- final int hash(Object key)
- {
- return key == null ? 0 : Math.abs(key.hashCode() % buckets.length);
- }
-
- /**
- * Generates a parameterized iterator. Must be overrideable, since
- * LinkedHashMap iterates in a different order.
- *
- * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
- * @return the appropriate iterator
- */
- Iterator iterator(int type)
- {
- return new HashIterator(type);
- }
-
- /**
- * A simplified, more efficient internal implementation of putAll(). clone()
- * should not call putAll or put, in order to be compatible with the JDK
- * implementation with respect to subclasses.
- *
- * @param m the map to initialize this from
- */
- void putAllInternal(Map m)
- {
- Iterator itr = m.entrySet().iterator();
- size = 0;
- while (itr.hasNext())
- {
- size++;
- Map.Entry e = (Map.Entry) itr.next();
- Object key = e.getKey();
- int idx = hash(key);
- addEntry(key, e.getValue(), idx, false);
- }
- }
-
- /**
- * Increases the size of the HashMap and rehashes all keys to new
- * array indices; this is called when the addition of a new value
- * would cause size() &gt; threshold. Note that the existing Entry
- * objects are reused in the new hash table.
- *
- * <p>This is not specified, but the new size is twice the current size
- * plus one; this number is not always prime, unfortunately.
- */
- private void rehash()
- {
- HashEntry[] oldBuckets = buckets;
-
- int newcapacity = (buckets.length * 2) + 1;
- threshold = (int) (newcapacity * loadFactor);
- buckets = new HashEntry[newcapacity];
-
- for (int i = oldBuckets.length - 1; i >= 0; i--)
- {
- HashEntry e = oldBuckets[i];
- while (e != null)
- {
- int idx = hash(e.key);
- HashEntry dest = buckets[idx];
- HashEntry next = e.next;
- e.next = buckets[idx];
- buckets[idx] = e;
- e = next;
- }
- }
- }
-
- /**
- * Serializes this object to the given stream.
- *
- * @param s the stream to write to
- * @throws IOException if the underlying stream fails
- * @serialData the <i>capacity</i>(int) that is the length of the
- * bucket array, the <i>size</i>(int) of the hash map
- * are emitted first. They are followed by size entries,
- * each consisting of a key (Object) and a value (Object).
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- // Write the threshold and loadFactor fields.
- s.defaultWriteObject();
-
- s.writeInt(buckets.length);
- s.writeInt(size);
- // Avoid creating a wasted Set by creating the iterator directly.
- Iterator it = iterator(ENTRIES);
- while (it.hasNext())
- {
- HashEntry entry = (HashEntry) it.next();
- s.writeObject(entry.key);
- s.writeObject(entry.value);
- }
- }
-
- /**
- * Deserializes this object from the given stream.
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if the underlying stream fails
- * @throws IOException if the underlying stream fails
- * @serialData the <i>capacity</i>(int) that is the length of the
- * bucket array, the <i>size</i>(int) of the hash map
- * are emitted first. They are followed by size entries,
- * each consisting of a key (Object) and a value (Object).
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- // Read the threshold and loadFactor fields.
- s.defaultReadObject();
-
- // Read and use capacity, followed by key/value pairs.
- buckets = new HashEntry[s.readInt()];
- int len = s.readInt();
- size = len;
- while (len-- > 0)
- {
- Object key = s.readObject();
- addEntry(key, s.readObject(), hash(key), false);
- }
- }
-
- /**
- * Iterate over HashMap's entries.
- * This implementation is parameterized to give a sequential view of
- * keys, values, or entries.
- *
- * @author Jon Zeppieri
- */
- private final class HashIterator implements Iterator
- {
- /**
- * The type of this Iterator: {@link #KEYS}, {@link #VALUES},
- * or {@link #ENTRIES}.
- */
- private final int type;
- /**
- * The number of modifications to the backing HashMap that we know about.
- */
- private int knownMod = modCount;
- /** The number of elements remaining to be returned by next(). */
- private int count = size;
- /** Current index in the physical hash table. */
- private int idx = buckets.length;
- /** The last Entry returned by a next() call. */
- private HashEntry last;
- /**
- * The next entry that should be returned by next(). It is set to something
- * if we're iterating through a bucket that contains multiple linked
- * entries. It is null if next() needs to find a new bucket.
- */
- private HashEntry next;
-
- /**
- * Construct a new HashIterator with the supplied type.
- * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
- */
- HashIterator(int type)
- {
- this.type = type;
- }
-
- /**
- * Returns true if the Iterator has more elements.
- * @return true if there are more elements
- * @throws ConcurrentModificationException if the HashMap was modified
- */
- public boolean hasNext()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- return count > 0;
- }
-
- /**
- * Returns the next element in the Iterator's sequential view.
- * @return the next element
- * @throws ConcurrentModificationException if the HashMap was modified
- * @throws NoSuchElementException if there is none
- */
- public Object next()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- if (count == 0)
- throw new NoSuchElementException();
- count--;
- HashEntry e = next;
-
- while (e == null)
- e = buckets[--idx];
-
- next = e.next;
- last = e;
- if (type == VALUES)
- return e.value;
- if (type == KEYS)
- return e.key;
- return e;
- }
-
- /**
- * Removes from the backing HashMap the last element which was fetched
- * with the <code>next()</code> method.
- * @throws ConcurrentModificationException if the HashMap was modified
- * @throws IllegalStateException if called when there is no last element
- */
- public void remove()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- if (last == null)
- throw new IllegalStateException();
-
- HashMap.this.remove(last.key);
- last = null;
- knownMod++;
- }
- }
-}
diff --git a/libjava/java/util/HashSet.java b/libjava/java/util/HashSet.java
deleted file mode 100644
index 681d5bb1b07..00000000000
--- a/libjava/java/util/HashSet.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/* HashSet.java -- a class providing a HashMap-backed Set
- Copyright (C) 1998, 1999, 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-/**
- * This class provides a HashMap-backed implementation of the Set interface.
- * <p>
- *
- * Most operations are O(1), assuming no hash collisions. In the worst
- * case (where all hashes collide), operations are O(n). Setting the
- * initial capacity too low will force many resizing operations, but
- * setting the initial capacity too high (or loadfactor too low) leads
- * to wasted memory and slower iteration.
- * <p>
- *
- * HashSet accepts the null key and null values. It is not synchronized,
- * so if you need multi-threaded access, consider using:<br>
- * <code>Set s = Collections.synchronizedSet(new HashSet(...));</code>
- * <p>
- *
- * The iterators are <i>fail-fast</i>, meaning that any structural
- * modification, except for <code>remove()</code> called on the iterator
- * itself, cause the iterator to throw a
- * {@link ConcurrentModificationException} rather than exhibit
- * non-deterministic behavior.
- *
- * @author Jon Zeppieri
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see Set
- * @see TreeSet
- * @see Collections#synchronizedSet(Set)
- * @see HashMap
- * @see LinkedHashSet
- * @since 1.2
- * @status updated to 1.4
- */
-public class HashSet extends AbstractSet
- implements Set, Cloneable, Serializable
-{
- /**
- * Compatible with JDK 1.2.
- */
- private static final long serialVersionUID = -5024744406713321676L;
-
- /**
- * The HashMap which backs this Set.
- */
- private transient HashMap map;
-
- /**
- * Construct a new, empty HashSet whose backing HashMap has the default
- * capacity (11) and loadFacor (0.75).
- */
- public HashSet()
- {
- this(HashMap.DEFAULT_CAPACITY, HashMap.DEFAULT_LOAD_FACTOR);
- }
-
- /**
- * Construct a new, empty HashSet whose backing HashMap has the supplied
- * capacity and the default load factor (0.75).
- *
- * @param initialCapacity the initial capacity of the backing HashMap
- * @throws IllegalArgumentException if the capacity is negative
- */
- public HashSet(int initialCapacity)
- {
- this(initialCapacity, HashMap.DEFAULT_LOAD_FACTOR);
- }
-
- /**
- * Construct a new, empty HashSet whose backing HashMap has the supplied
- * capacity and load factor.
- *
- * @param initialCapacity the initial capacity of the backing HashMap
- * @param loadFactor the load factor of the backing HashMap
- * @throws IllegalArgumentException if either argument is negative, or
- * if loadFactor is POSITIVE_INFINITY or NaN
- */
- public HashSet(int initialCapacity, float loadFactor)
- {
- map = init(initialCapacity, loadFactor);
- }
-
- /**
- * Construct a new HashSet with the same elements as are in the supplied
- * collection (eliminating any duplicates, of course). The backing storage
- * has twice the size of the collection, or the default size of 11,
- * whichever is greater; and the default load factor (0.75).
- *
- * @param c a collection of initial set elements
- * @throws NullPointerException if c is null
- */
- public HashSet(Collection c)
- {
- this(Math.max(2 * c.size(), HashMap.DEFAULT_CAPACITY));
- addAll(c);
- }
-
- /**
- * Adds the given Object to the set if it is not already in the Set.
- * This set permits a null element.
- *
- * @param o the Object to add to this Set
- * @return true if the set did not already contain o
- */
- public boolean add(Object o)
- {
- return map.put(o, "") == null;
- }
-
- /**
- * Empties this Set of all elements; this takes constant time.
- */
- public void clear()
- {
- map.clear();
- }
-
- /**
- * Returns a shallow copy of this Set. The Set itself is cloned; its
- * elements are not.
- *
- * @return a shallow clone of the set
- */
- public Object clone()
- {
- HashSet copy = null;
- try
- {
- copy = (HashSet) super.clone();
- }
- catch (CloneNotSupportedException x)
- {
- // Impossible to get here.
- }
- copy.map = (HashMap) map.clone();
- return copy;
- }
-
- /**
- * Returns true if the supplied element is in this Set.
- *
- * @param o the Object to look for
- * @return true if it is in the set
- */
- public boolean contains(Object o)
- {
- return map.containsKey(o);
- }
-
- /**
- * Returns true if this set has no elements in it.
- *
- * @return <code>size() == 0</code>.
- */
- public boolean isEmpty()
- {
- return map.size == 0;
- }
-
- /**
- * Returns an Iterator over the elements of this Set, which visits the
- * elements in no particular order. For this class, the Iterator allows
- * removal of elements. The iterator is fail-fast, and will throw a
- * ConcurrentModificationException if the set is modified externally.
- *
- * @return a set iterator
- * @see ConcurrentModificationException
- */
- public Iterator iterator()
- {
- // Avoid creating intermediate keySet() object by using non-public API.
- return map.iterator(HashMap.KEYS);
- }
-
- /**
- * Removes the supplied Object from this Set if it is in the Set.
- *
- * @param o the object to remove
- * @return true if an element was removed
- */
- public boolean remove(Object o)
- {
- return (map.remove(o) != null);
- }
-
- /**
- * Returns the number of elements in this Set (its cardinality).
- *
- * @return the size of the set
- */
- public int size()
- {
- return map.size;
- }
-
- /**
- * Helper method which initializes the backing Map. Overridden by
- * LinkedHashSet for correct semantics.
- *
- * @param capacity the initial capacity
- * @param load the initial load factor
- * @return the backing HashMap
- */
- HashMap init(int capacity, float load)
- {
- return new HashMap(capacity, load);
- }
-
- /**
- * Serializes this object to the given stream.
- *
- * @param s the stream to write to
- * @throws IOException if the underlying stream fails
- * @serialData the <i>capacity</i> (int) and <i>loadFactor</i> (float)
- * of the backing store, followed by the set size (int),
- * then a listing of its elements (Object) in no order
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- s.defaultWriteObject();
- // Avoid creating intermediate keySet() object by using non-public API.
- Iterator it = map.iterator(HashMap.KEYS);
- s.writeInt(map.buckets.length);
- s.writeFloat(map.loadFactor);
- s.writeInt(map.size);
- while (it.hasNext())
- s.writeObject(it.next());
- }
-
- /**
- * Deserializes this object from the given stream.
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if the underlying stream fails
- * @throws IOException if the underlying stream fails
- * @serialData the <i>capacity</i> (int) and <i>loadFactor</i> (float)
- * of the backing store, followed by the set size (int),
- * then a listing of its elements (Object) in no order
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
-
- map = init(s.readInt(), s.readFloat());
- for (int size = s.readInt(); size > 0; size--)
- map.put(s.readObject(), "");
- }
-}
diff --git a/libjava/java/util/Hashtable.java b/libjava/java/util/Hashtable.java
deleted file mode 100644
index 78d5fa10c69..00000000000
--- a/libjava/java/util/Hashtable.java
+++ /dev/null
@@ -1,1151 +0,0 @@
-/* Hashtable.java -- a class providing a basic hashtable data structure,
- mapping Object --> Object
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-// NOTE: This implementation is very similar to that of HashMap. If you fix
-// a bug in here, chances are you should make a similar change to the HashMap
-// code.
-
-/**
- * A class which implements a hashtable data structure.
- * <p>
- *
- * This implementation of Hashtable uses a hash-bucket approach. That is:
- * linear probing and rehashing is avoided; instead, each hashed value maps
- * to a simple linked-list which, in the best case, only has one node.
- * Assuming a large enough table, low enough load factor, and / or well
- * implemented hashCode() methods, Hashtable should provide O(1)
- * insertion, deletion, and searching of keys. Hashtable is O(n) in
- * the worst case for all of these (if all keys hash to the same bucket).
- * <p>
- *
- * This is a JDK-1.2 compliant implementation of Hashtable. As such, it
- * belongs, partially, to the Collections framework (in that it implements
- * Map). For backwards compatibility, it inherits from the obsolete and
- * utterly useless Dictionary class.
- * <p>
- *
- * Being a hybrid of old and new, Hashtable has methods which provide redundant
- * capability, but with subtle and even crucial differences.
- * For example, one can iterate over various aspects of a Hashtable with
- * either an Iterator (which is the JDK-1.2 way of doing things) or with an
- * Enumeration. The latter can end up in an undefined state if the Hashtable
- * changes while the Enumeration is open.
- * <p>
- *
- * Unlike HashMap, Hashtable does not accept `null' as a key value. Also,
- * all accesses are synchronized: in a single thread environment, this is
- * expensive, but in a multi-thread environment, this saves you the effort
- * of extra synchronization. However, the old-style enumerators are not
- * synchronized, because they can lead to unspecified behavior even if
- * they were synchronized. You have been warned.
- * <p>
- *
- * The iterators are <i>fail-fast</i>, meaning that any structural
- * modification, except for <code>remove()</code> called on the iterator
- * itself, cause the iterator to throw a
- * <code>ConcurrentModificationException</code> rather than exhibit
- * non-deterministic behavior.
- *
- * @author Jon Zeppieri
- * @author Warren Levy
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see HashMap
- * @see TreeMap
- * @see IdentityHashMap
- * @see LinkedHashMap
- * @since 1.0
- * @status updated to 1.4
- */
-public class Hashtable extends Dictionary
- implements Map, Cloneable, Serializable
-{
- // WARNING: Hashtable is a CORE class in the bootstrap cycle. See the
- // comments in vm/reference/java/lang/Runtime for implications of this fact.
-
- /** Default number of buckets. This is the value the JDK 1.3 uses. Some
- * early documentation specified this value as 101. That is incorrect.
- */
- private static final int DEFAULT_CAPACITY = 11;
-
- /** An "enum" of iterator types. */
- // Package visible for use by nested classes.
- static final int KEYS = 0,
- VALUES = 1,
- ENTRIES = 2;
-
- /**
- * The default load factor; this is explicitly specified by the spec.
- */
- private static final float DEFAULT_LOAD_FACTOR = 0.75f;
-
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 1421746759512286392L;
-
- /**
- * The rounded product of the capacity and the load factor; when the number
- * of elements exceeds the threshold, the Hashtable calls
- * <code>rehash()</code>.
- * @serial
- */
- private int threshold;
-
- /**
- * Load factor of this Hashtable: used in computing the threshold.
- * @serial
- */
- private final float loadFactor;
-
- /**
- * Array containing the actual key-value mappings.
- */
- // Package visible for use by nested classes.
- transient HashEntry[] buckets;
-
- /**
- * Counts the number of modifications this Hashtable has undergone, used
- * by Iterators to know when to throw ConcurrentModificationExceptions.
- */
- // Package visible for use by nested classes.
- transient int modCount;
-
- /**
- * The size of this Hashtable: denotes the number of key-value pairs.
- */
- // Package visible for use by nested classes.
- transient int size;
-
- /**
- * The cache for {@link #keySet()}.
- */
- private transient Set keys;
-
- /**
- * The cache for {@link #values()}.
- */
- private transient Collection values;
-
- /**
- * The cache for {@link #entrySet()}.
- */
- private transient Set entries;
-
- /**
- * Class to represent an entry in the hash table. Holds a single key-value
- * pair. A Hashtable Entry is identical to a HashMap Entry, except that
- * `null' is not allowed for keys and values.
- */
- private static final class HashEntry extends AbstractMap.BasicMapEntry
- {
- /** The next entry in the linked list. */
- HashEntry next;
-
- /**
- * Simple constructor.
- * @param key the key, already guaranteed non-null
- * @param value the value, already guaranteed non-null
- */
- HashEntry(Object key, Object value)
- {
- super(key, value);
- }
-
- /**
- * Resets the value.
- * @param newValue the new value
- * @return the prior value
- * @throws NullPointerException if <code>newVal</code> is null
- */
- public Object setValue(Object newVal)
- {
- if (newVal == null)
- throw new NullPointerException();
- return super.setValue(newVal);
- }
- }
-
- /**
- * Construct a new Hashtable with the default capacity (11) and the default
- * load factor (0.75).
- */
- public Hashtable()
- {
- this(DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR);
- }
-
- /**
- * Construct a new Hashtable from the given Map, with initial capacity
- * the greater of the size of <code>m</code> or the default of 11.
- * <p>
- *
- * Every element in Map m will be put into this new Hashtable.
- *
- * @param m a Map whose key / value pairs will be put into
- * the new Hashtable. <b>NOTE: key / value pairs
- * are not cloned in this constructor.</b>
- * @throws NullPointerException if m is null, or if m contains a mapping
- * to or from `null'.
- * @since 1.2
- */
- public Hashtable(Map m)
- {
- this(Math.max(m.size() * 2, DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);
- putAll(m);
- }
-
- /**
- * Construct a new Hashtable with a specific inital capacity and
- * default load factor of 0.75.
- *
- * @param initialCapacity the initial capacity of this Hashtable (&gt;= 0)
- * @throws IllegalArgumentException if (initialCapacity &lt; 0)
- */
- public Hashtable(int initialCapacity)
- {
- this(initialCapacity, DEFAULT_LOAD_FACTOR);
- }
-
- /**
- * Construct a new Hashtable with a specific initial capacity and
- * load factor.
- *
- * @param initialCapacity the initial capacity (&gt;= 0)
- * @param loadFactor the load factor (&gt; 0, not NaN)
- * @throws IllegalArgumentException if (initialCapacity &lt; 0) ||
- * ! (loadFactor &gt; 0.0)
- */
- public Hashtable(int initialCapacity, float loadFactor)
- {
- if (initialCapacity < 0)
- throw new IllegalArgumentException("Illegal Capacity: "
- + initialCapacity);
- if (! (loadFactor > 0)) // check for NaN too
- throw new IllegalArgumentException("Illegal Load: " + loadFactor);
-
- if (initialCapacity == 0)
- initialCapacity = 1;
- buckets = new HashEntry[initialCapacity];
- this.loadFactor = loadFactor;
- threshold = (int) (initialCapacity * loadFactor);
- }
-
- /**
- * Returns the number of key-value mappings currently in this hashtable.
- * @return the size
- */
- public synchronized int size()
- {
- return size;
- }
-
- /**
- * Returns true if there are no key-value mappings currently in this table.
- * @return <code>size() == 0</code>
- */
- public synchronized boolean isEmpty()
- {
- return size == 0;
- }
-
- /**
- * Return an enumeration of the keys of this table. There's no point
- * in synchronizing this, as you have already been warned that the
- * enumeration is not specified to be thread-safe.
- *
- * @return the keys
- * @see #elements()
- * @see #keySet()
- */
- public Enumeration keys()
- {
- return new Enumerator(KEYS);
- }
-
- /**
- * Return an enumeration of the values of this table. There's no point
- * in synchronizing this, as you have already been warned that the
- * enumeration is not specified to be thread-safe.
- *
- * @return the values
- * @see #keys()
- * @see #values()
- */
- public Enumeration elements()
- {
- return new Enumerator(VALUES);
- }
-
- /**
- * Returns true if this Hashtable contains a value <code>o</code>,
- * such that <code>o.equals(value)</code>. This is the same as
- * <code>containsValue()</code>, and is O(n).
- * <p>
- *
- * @param value the value to search for in this Hashtable
- * @return true if at least one key maps to the value
- * @throws NullPointerException if <code>value</code> is null
- * @see #containsValue(Object)
- * @see #containsKey(Object)
- */
- public synchronized boolean contains(Object value)
- {
- for (int i = buckets.length - 1; i >= 0; i--)
- {
- HashEntry e = buckets[i];
- while (e != null)
- {
- if (value.equals(e.value))
- return true;
- e = e.next;
- }
- }
-
- // Must throw on null argument even if the table is empty
- if (value == null)
- throw new NullPointerException();
-
- return false;
- }
-
- /**
- * Returns true if this Hashtable contains a value <code>o</code>, such that
- * <code>o.equals(value)</code>. This is the new API for the old
- * <code>contains()</code>.
- *
- * @param value the value to search for in this Hashtable
- * @return true if at least one key maps to the value
- * @see #contains(Object)
- * @see #containsKey(Object)
- * @throws NullPointerException if <code>value</code> is null
- * @since 1.2
- */
- public boolean containsValue(Object value)
- {
- // Delegate to older method to make sure code overriding it continues
- // to work.
- return contains(value);
- }
-
- /**
- * Returns true if the supplied object <code>equals()</code> a key
- * in this Hashtable.
- *
- * @param key the key to search for in this Hashtable
- * @return true if the key is in the table
- * @throws NullPointerException if key is null
- * @see #containsValue(Object)
- */
- public synchronized boolean containsKey(Object key)
- {
- int idx = hash(key);
- HashEntry e = buckets[idx];
- while (e != null)
- {
- if (key.equals(e.key))
- return true;
- e = e.next;
- }
- return false;
- }
-
- /**
- * Return the value in this Hashtable associated with the supplied key,
- * or <code>null</code> if the key maps to nothing.
- *
- * @param key the key for which to fetch an associated value
- * @return what the key maps to, if present
- * @throws NullPointerException if key is null
- * @see #put(Object, Object)
- * @see #containsKey(Object)
- */
- public synchronized Object get(Object key)
- {
- int idx = hash(key);
- HashEntry e = buckets[idx];
- while (e != null)
- {
- if (key.equals(e.key))
- return e.value;
- e = e.next;
- }
- return null;
- }
-
- /**
- * Puts the supplied value into the Map, mapped by the supplied key.
- * Neither parameter may be null. The value may be retrieved by any
- * object which <code>equals()</code> this key.
- *
- * @param key the key used to locate the value
- * @param value the value to be stored in the table
- * @return the prior mapping of the key, or null if there was none
- * @throws NullPointerException if key or value is null
- * @see #get(Object)
- * @see Object#equals(Object)
- */
- public synchronized Object put(Object key, Object value)
- {
- int idx = hash(key);
- HashEntry e = buckets[idx];
-
- // Check if value is null since it is not permitted.
- if (value == null)
- throw new NullPointerException();
-
- while (e != null)
- {
- if (key.equals(e.key))
- {
- // Bypass e.setValue, since we already know value is non-null.
- Object r = e.value;
- e.value = value;
- return r;
- }
- else
- {
- e = e.next;
- }
- }
-
- // At this point, we know we need to add a new entry.
- modCount++;
- if (++size > threshold)
- {
- rehash();
- // Need a new hash value to suit the bigger table.
- idx = hash(key);
- }
-
- e = new HashEntry(key, value);
-
- e.next = buckets[idx];
- buckets[idx] = e;
-
- return null;
- }
-
- /**
- * Removes from the table and returns the value which is mapped by the
- * supplied key. If the key maps to nothing, then the table remains
- * unchanged, and <code>null</code> is returned.
- *
- * @param key the key used to locate the value to remove
- * @return whatever the key mapped to, if present
- */
- public synchronized Object remove(Object key)
- {
- int idx = hash(key);
- HashEntry e = buckets[idx];
- HashEntry last = null;
-
- while (e != null)
- {
- if (key.equals(e.key))
- {
- modCount++;
- if (last == null)
- buckets[idx] = e.next;
- else
- last.next = e.next;
- size--;
- return e.value;
- }
- last = e;
- e = e.next;
- }
- return null;
- }
-
- /**
- * Copies all elements of the given map into this hashtable. However, no
- * mapping can contain null as key or value. If this table already has
- * a mapping for a key, the new mapping replaces the current one.
- *
- * @param m the map to be hashed into this
- * @throws NullPointerException if m is null, or contains null keys or values
- */
- public synchronized void putAll(Map m)
- {
- Iterator itr = m.entrySet().iterator();
-
- while (itr.hasNext())
- {
- Map.Entry e = (Map.Entry) itr.next();
- // Optimize in case the Entry is one of our own.
- if (e instanceof AbstractMap.BasicMapEntry)
- {
- AbstractMap.BasicMapEntry entry = (AbstractMap.BasicMapEntry) e;
- put(entry.key, entry.value);
- }
- else
- {
- put(e.getKey(), e.getValue());
- }
- }
- }
-
- /**
- * Clears the hashtable so it has no keys. This is O(1).
- */
- public synchronized void clear()
- {
- if (size > 0)
- {
- modCount++;
- Arrays.fill(buckets, null);
- size = 0;
- }
- }
-
- /**
- * Returns a shallow clone of this Hashtable. The Map itself is cloned,
- * but its contents are not. This is O(n).
- *
- * @return the clone
- */
- public synchronized Object clone()
- {
- Hashtable copy = null;
- try
- {
- copy = (Hashtable) super.clone();
- }
- catch (CloneNotSupportedException x)
- {
- // This is impossible.
- }
- copy.buckets = new HashEntry[buckets.length];
- copy.putAllInternal(this);
- // Clear the caches.
- copy.keys = null;
- copy.values = null;
- copy.entries = null;
- return copy;
- }
-
- /**
- * Converts this Hashtable to a String, surrounded by braces, and with
- * key/value pairs listed with an equals sign between, separated by a
- * comma and space. For example, <code>"{a=1, b=2}"</code>.<p>
- *
- * NOTE: if the <code>toString()</code> method of any key or value
- * throws an exception, this will fail for the same reason.
- *
- * @return the string representation
- */
- public synchronized String toString()
- {
- // Since we are already synchronized, and entrySet().iterator()
- // would repeatedly re-lock/release the monitor, we directly use the
- // unsynchronized HashIterator instead.
- Iterator entries = new HashIterator(ENTRIES);
- StringBuffer r = new StringBuffer("{");
- for (int pos = size; pos > 0; pos--)
- {
- r.append(entries.next());
- if (pos > 1)
- r.append(", ");
- }
- r.append("}");
- return r.toString();
- }
-
- /**
- * Returns a "set view" of this Hashtable's keys. The set is backed by
- * the hashtable, so changes in one show up in the other. The set supports
- * element removal, but not element addition. The set is properly
- * synchronized on the original hashtable. Sun has not documented the
- * proper interaction of null with this set, but has inconsistent behavior
- * in the JDK. Therefore, in this implementation, contains, remove,
- * containsAll, retainAll, removeAll, and equals just ignore a null key
- * rather than throwing a {@link NullPointerException}.
- *
- * @return a set view of the keys
- * @see #values()
- * @see #entrySet()
- * @since 1.2
- */
- public Set keySet()
- {
- if (keys == null)
- {
- // Create a synchronized AbstractSet with custom implementations of
- // those methods that can be overridden easily and efficiently.
- Set r = new AbstractSet()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- return new HashIterator(KEYS);
- }
-
- public void clear()
- {
- Hashtable.this.clear();
- }
-
- public boolean contains(Object o)
- {
- if (o == null)
- return false;
- return containsKey(o);
- }
-
- public boolean remove(Object o)
- {
- return Hashtable.this.remove(o) != null;
- }
- };
- // We must specify the correct object to synchronize upon, hence the
- // use of a non-public API
- keys = new Collections.SynchronizedSet(this, r);
- }
- return keys;
- }
-
- /**
- * Returns a "collection view" (or "bag view") of this Hashtable's values.
- * The collection is backed by the hashtable, so changes in one show up
- * in the other. The collection supports element removal, but not element
- * addition. The collection is properly synchronized on the original
- * hashtable. Sun has not documented the proper interaction of null with
- * this set, but has inconsistent behavior in the JDK. Therefore, in this
- * implementation, contains, remove, containsAll, retainAll, removeAll, and
- * equals just ignore a null value rather than throwing a
- * {@link NullPointerException}.
- *
- * @return a bag view of the values
- * @see #keySet()
- * @see #entrySet()
- * @since 1.2
- */
- public Collection values()
- {
- if (values == null)
- {
- // We don't bother overriding many of the optional methods, as doing so
- // wouldn't provide any significant performance advantage.
- Collection r = new AbstractCollection()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- return new HashIterator(VALUES);
- }
-
- public void clear()
- {
- Hashtable.this.clear();
- }
- };
- // We must specify the correct object to synchronize upon, hence the
- // use of a non-public API
- values = new Collections.SynchronizedCollection(this, r);
- }
- return values;
- }
-
- /**
- * Returns a "set view" of this Hashtable's entries. The set is backed by
- * the hashtable, so changes in one show up in the other. The set supports
- * element removal, but not element addition. The set is properly
- * synchronized on the original hashtable. Sun has not documented the
- * proper interaction of null with this set, but has inconsistent behavior
- * in the JDK. Therefore, in this implementation, contains, remove,
- * containsAll, retainAll, removeAll, and equals just ignore a null entry,
- * or an entry with a null key or value, rather than throwing a
- * {@link NullPointerException}. However, calling entry.setValue(null)
- * will fail.
- * <p>
- *
- * Note that the iterators for all three views, from keySet(), entrySet(),
- * and values(), traverse the hashtable in the same sequence.
- *
- * @return a set view of the entries
- * @see #keySet()
- * @see #values()
- * @see Map.Entry
- * @since 1.2
- */
- public Set entrySet()
- {
- if (entries == null)
- {
- // Create an AbstractSet with custom implementations of those methods
- // that can be overridden easily and efficiently.
- Set r = new AbstractSet()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- return new HashIterator(ENTRIES);
- }
-
- public void clear()
- {
- Hashtable.this.clear();
- }
-
- public boolean contains(Object o)
- {
- return getEntry(o) != null;
- }
-
- public boolean remove(Object o)
- {
- HashEntry e = getEntry(o);
- if (e != null)
- {
- Hashtable.this.remove(e.key);
- return true;
- }
- return false;
- }
- };
- // We must specify the correct object to synchronize upon, hence the
- // use of a non-public API
- entries = new Collections.SynchronizedSet(this, r);
- }
- return entries;
- }
-
- /**
- * Returns true if this Hashtable equals the supplied Object <code>o</code>.
- * As specified by Map, this is:
- * <code>
- * (o instanceof Map) && entrySet().equals(((Map) o).entrySet());
- * </code>
- *
- * @param o the object to compare to
- * @return true if o is an equal map
- * @since 1.2
- */
- public boolean equals(Object o)
- {
- // no need to synchronize, entrySet().equals() does that
- if (o == this)
- return true;
- if (!(o instanceof Map))
- return false;
-
- return entrySet().equals(((Map) o).entrySet());
- }
-
- /**
- * Returns the hashCode for this Hashtable. As specified by Map, this is
- * the sum of the hashCodes of all of its Map.Entry objects
- *
- * @return the sum of the hashcodes of the entries
- * @since 1.2
- */
- public synchronized int hashCode()
- {
- // Since we are already synchronized, and entrySet().iterator()
- // would repeatedly re-lock/release the monitor, we directly use the
- // unsynchronized HashIterator instead.
- Iterator itr = new HashIterator(ENTRIES);
- int hashcode = 0;
- for (int pos = size; pos > 0; pos--)
- hashcode += itr.next().hashCode();
-
- return hashcode;
- }
-
- /**
- * Helper method that returns an index in the buckets array for `key'
- * based on its hashCode().
- *
- * @param key the key
- * @return the bucket number
- * @throws NullPointerException if key is null
- */
- private int hash(Object key)
- {
- // Note: Inline Math.abs here, for less method overhead, and to avoid
- // a bootstrap dependency, since Math relies on native methods.
- int hash = key.hashCode() % buckets.length;
- return hash < 0 ? -hash : hash;
- }
-
- /**
- * Helper method for entrySet(), which matches both key and value
- * simultaneously. Ignores null, as mentioned in entrySet().
- *
- * @param o the entry to match
- * @return the matching entry, if found, or null
- * @see #entrySet()
- */
- // Package visible, for use in nested classes.
- HashEntry getEntry(Object o)
- {
- if (! (o instanceof Map.Entry))
- return null;
- Object key = ((Map.Entry) o).getKey();
- if (key == null)
- return null;
-
- int idx = hash(key);
- HashEntry e = buckets[idx];
- while (e != null)
- {
- if (o.equals(e))
- return e;
- e = e.next;
- }
- return null;
- }
-
- /**
- * A simplified, more efficient internal implementation of putAll(). clone()
- * should not call putAll or put, in order to be compatible with the JDK
- * implementation with respect to subclasses.
- *
- * @param m the map to initialize this from
- */
- void putAllInternal(Map m)
- {
- Iterator itr = m.entrySet().iterator();
- size = 0;
-
- while (itr.hasNext())
- {
- size++;
- Map.Entry e = (Map.Entry) itr.next();
- Object key = e.getKey();
- int idx = hash(key);
- HashEntry he = new HashEntry(key, e.getValue());
- he.next = buckets[idx];
- buckets[idx] = he;
- }
- }
-
- /**
- * Increases the size of the Hashtable and rehashes all keys to new array
- * indices; this is called when the addition of a new value would cause
- * size() &gt; threshold. Note that the existing Entry objects are reused in
- * the new hash table.
- * <p>
- *
- * This is not specified, but the new size is twice the current size plus
- * one; this number is not always prime, unfortunately. This implementation
- * is not synchronized, as it is only invoked from synchronized methods.
- */
- protected void rehash()
- {
- HashEntry[] oldBuckets = buckets;
-
- int newcapacity = (buckets.length * 2) + 1;
- threshold = (int) (newcapacity * loadFactor);
- buckets = new HashEntry[newcapacity];
-
- for (int i = oldBuckets.length - 1; i >= 0; i--)
- {
- HashEntry e = oldBuckets[i];
- while (e != null)
- {
- int idx = hash(e.key);
- HashEntry dest = buckets[idx];
-
- if (dest != null)
- {
- while (dest.next != null)
- dest = dest.next;
- dest.next = e;
- }
- else
- {
- buckets[idx] = e;
- }
-
- HashEntry next = e.next;
- e.next = null;
- e = next;
- }
- }
- }
-
- /**
- * Serializes this object to the given stream.
- *
- * @param s the stream to write to
- * @throws IOException if the underlying stream fails
- * @serialData the <i>capacity</i> (int) that is the length of the
- * bucket array, the <i>size</i> (int) of the hash map
- * are emitted first. They are followed by size entries,
- * each consisting of a key (Object) and a value (Object).
- */
- private synchronized void writeObject(ObjectOutputStream s)
- throws IOException
- {
- // Write the threshold and loadFactor fields.
- s.defaultWriteObject();
-
- s.writeInt(buckets.length);
- s.writeInt(size);
- // Since we are already synchronized, and entrySet().iterator()
- // would repeatedly re-lock/release the monitor, we directly use the
- // unsynchronized HashIterator instead.
- Iterator it = new HashIterator(ENTRIES);
- while (it.hasNext())
- {
- HashEntry entry = (HashEntry) it.next();
- s.writeObject(entry.key);
- s.writeObject(entry.value);
- }
- }
-
- /**
- * Deserializes this object from the given stream.
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if the underlying stream fails
- * @throws IOException if the underlying stream fails
- * @serialData the <i>capacity</i> (int) that is the length of the
- * bucket array, the <i>size</i> (int) of the hash map
- * are emitted first. They are followed by size entries,
- * each consisting of a key (Object) and a value (Object).
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- // Read the threshold and loadFactor fields.
- s.defaultReadObject();
-
- // Read and use capacity.
- buckets = new HashEntry[s.readInt()];
- int len = s.readInt();
-
- // Read and use key/value pairs.
- // TODO: should we be defensive programmers, and check for illegal nulls?
- while (--len >= 0)
- put(s.readObject(), s.readObject());
- }
-
- /**
- * A class which implements the Iterator interface and is used for
- * iterating over Hashtables.
- * This implementation is parameterized to give a sequential view of
- * keys, values, or entries; it also allows the removal of elements,
- * as per the Javasoft spec. Note that it is not synchronized; this is
- * a performance enhancer since it is never exposed externally and is
- * only used within synchronized blocks above.
- *
- * @author Jon Zeppieri
- */
- private final class HashIterator implements Iterator
- {
- /**
- * The type of this Iterator: {@link #KEYS}, {@link #VALUES},
- * or {@link #ENTRIES}.
- */
- final int type;
- /**
- * The number of modifications to the backing Hashtable that we know about.
- */
- int knownMod = modCount;
- /** The number of elements remaining to be returned by next(). */
- int count = size;
- /** Current index in the physical hash table. */
- int idx = buckets.length;
- /** The last Entry returned by a next() call. */
- HashEntry last;
- /**
- * The next entry that should be returned by next(). It is set to something
- * if we're iterating through a bucket that contains multiple linked
- * entries. It is null if next() needs to find a new bucket.
- */
- HashEntry next;
-
- /**
- * Construct a new HashIterator with the supplied type.
- * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
- */
- HashIterator(int type)
- {
- this.type = type;
- }
-
- /**
- * Returns true if the Iterator has more elements.
- * @return true if there are more elements
- * @throws ConcurrentModificationException if the hashtable was modified
- */
- public boolean hasNext()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- return count > 0;
- }
-
- /**
- * Returns the next element in the Iterator's sequential view.
- * @return the next element
- * @throws ConcurrentModificationException if the hashtable was modified
- * @throws NoSuchElementException if there is none
- */
- public Object next()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- if (count == 0)
- throw new NoSuchElementException();
- count--;
- HashEntry e = next;
-
- while (e == null)
- e = buckets[--idx];
-
- next = e.next;
- last = e;
- if (type == VALUES)
- return e.value;
- if (type == KEYS)
- return e.key;
- return e;
- }
-
- /**
- * Removes from the backing Hashtable the last element which was fetched
- * with the <code>next()</code> method.
- * @throws ConcurrentModificationException if the hashtable was modified
- * @throws IllegalStateException if called when there is no last element
- */
- public void remove()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- if (last == null)
- throw new IllegalStateException();
-
- Hashtable.this.remove(last.key);
- last = null;
- knownMod++;
- }
- } // class HashIterator
-
-
- /**
- * Enumeration view of this Hashtable, providing sequential access to its
- * elements; this implementation is parameterized to provide access either
- * to the keys or to the values in the Hashtable.
- *
- * <b>NOTE</b>: Enumeration is not safe if new elements are put in the table
- * as this could cause a rehash and we'd completely lose our place. Even
- * without a rehash, it is undetermined if a new element added would
- * appear in the enumeration. The spec says nothing about this, but
- * the "Java Class Libraries" book infers that modifications to the
- * hashtable during enumeration causes indeterminate results. Don't do it!
- *
- * @author Jon Zeppieri
- */
- private final class Enumerator implements Enumeration
- {
- /**
- * The type of this Iterator: {@link #KEYS} or {@link #VALUES}.
- */
- final int type;
- /** The number of elements remaining to be returned by next(). */
- int count = size;
- /** Current index in the physical hash table. */
- int idx = buckets.length;
- /**
- * Entry which will be returned by the next nextElement() call. It is
- * set if we are iterating through a bucket with multiple entries, or null
- * if we must look in the next bucket.
- */
- HashEntry next;
-
- /**
- * Construct the enumeration.
- * @param type either {@link #KEYS} or {@link #VALUES}.
- */
- Enumerator(int type)
- {
- this.type = type;
- }
-
- /**
- * Checks whether more elements remain in the enumeration.
- * @return true if nextElement() will not fail.
- */
- public boolean hasMoreElements()
- {
- return count > 0;
- }
-
- /**
- * Returns the next element.
- * @return the next element
- * @throws NoSuchElementException if there is none.
- */
- public Object nextElement()
- {
- if (count == 0)
- throw new NoSuchElementException("Hashtable Enumerator");
- count--;
- HashEntry e = next;
-
- while (e == null)
- e = buckets[--idx];
-
- next = e.next;
- return type == VALUES ? e.value : e.key;
- }
- } // class Enumerator
-} // class Hashtable
diff --git a/libjava/java/util/IdentityHashMap.java b/libjava/java/util/IdentityHashMap.java
deleted file mode 100644
index 6369fac691b..00000000000
--- a/libjava/java/util/IdentityHashMap.java
+++ /dev/null
@@ -1,935 +0,0 @@
-/* IdentityHashMap.java -- a class providing a hashtable data structure,
- mapping Object --> Object, which uses object identity for hashing.
- Copyright (C) 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-/**
- * This class provides a hashtable-backed implementation of the
- * Map interface, but uses object identity to do its hashing. In fact,
- * it uses object identity for comparing values, as well. It uses a
- * linear-probe hash table, which may have faster performance
- * than the chaining employed by HashMap.
- * <p>
- *
- * <em>WARNING: This is not a general purpose map. Because it uses
- * System.identityHashCode and ==, instead of hashCode and equals, for
- * comparison, it violated Map's general contract, and may cause
- * undefined behavior when compared to other maps which are not
- * IdentityHashMaps. This is designed only for the rare cases when
- * identity semantics are needed.</em> An example use is
- * topology-preserving graph transformations, such as deep cloning,
- * or as proxy object mapping such as in debugging.
- * <p>
- *
- * This map permits <code>null</code> keys and values, and does not
- * guarantee that elements will stay in the same order over time. The
- * basic operations (<code>get</code> and <code>put</code>) take
- * constant time, provided System.identityHashCode is decent. You can
- * tune the behavior by specifying the expected maximum size. As more
- * elements are added, the map may need to allocate a larger table,
- * which can be expensive.
- * <p>
- *
- * This implementation is unsynchronized. If you want multi-thread
- * access to be consistent, you must synchronize it, perhaps by using
- * <code>Collections.synchronizedMap(new IdentityHashMap(...));</code>.
- * The iterators are <i>fail-fast</i>, meaning that a structural modification
- * made to the map outside of an iterator's remove method cause the
- * iterator, and in the case of the entrySet, the Map.Entry, to
- * fail with a {@link ConcurrentModificationException}.
- *
- * @author Tom Tromey (tromey@redhat.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see System#identityHashCode(Object)
- * @see Collection
- * @see Map
- * @see HashMap
- * @see TreeMap
- * @see LinkedHashMap
- * @see WeakHashMap
- * @since 1.4
- * @status updated to 1.4
- */
-public class IdentityHashMap extends AbstractMap
- implements Map, Serializable, Cloneable
-{
- /** The default capacity. */
- private static final int DEFAULT_CAPACITY = 21;
-
- /**
- * This object is used to mark deleted items. Package visible for use by
- * nested classes.
- */
- static final Object tombstone = new Object();
-
- /**
- * This object is used to mark empty slots. We need this because
- * using null is ambiguous. Package visible for use by nested classes.
- */
- static final Object emptyslot = new Object();
-
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 8188218128353913216L;
-
- /**
- * The number of mappings in the table. Package visible for use by nested
- * classes.
- * @serial
- */
- int size;
-
- /**
- * The table itself. Package visible for use by nested classes.
- */
- transient Object[] table;
-
- /**
- * The number of structural modifications made so far. Package visible for
- * use by nested classes.
- */
- transient int modCount;
-
- /**
- * The cache for {@link #entrySet()}.
- */
- private transient Set entries;
-
- /**
- * The threshold for rehashing, which is 75% of (table.length / 2).
- */
- private transient int threshold;
-
- /**
- * Create a new IdentityHashMap with the default capacity (21 entries).
- */
- public IdentityHashMap()
- {
- this(DEFAULT_CAPACITY);
- }
-
- /**
- * Create a new IdentityHashMap with the indicated number of
- * entries. If the number of elements added to this hash map
- * exceeds this maximum, the map will grow itself; however, that
- * incurs a performance penalty.
- *
- * @param max initial size
- * @throws IllegalArgumentException if max is negative
- */
- public IdentityHashMap(int max)
- {
- if (max < 0)
- throw new IllegalArgumentException();
- // Need at least two slots, or hash() will break.
- if (max < 2)
- max = 2;
- table = new Object[max << 1];
- Arrays.fill(table, emptyslot);
- threshold = (max >> 2) * 3;
- }
-
- /**
- * Create a new IdentityHashMap whose contents are taken from the
- * given Map.
- *
- * @param m The map whose elements are to be put in this map
- * @throws NullPointerException if m is null
- */
- public IdentityHashMap(Map m)
- {
- this(Math.max(m.size() << 1, DEFAULT_CAPACITY));
- putAll(m);
- }
-
- /**
- * Remove all mappings from this map.
- */
- public void clear()
- {
- if (size != 0)
- {
- modCount++;
- Arrays.fill(table, emptyslot);
- size = 0;
- }
- }
-
- /**
- * Creates a shallow copy where keys and values are not cloned.
- */
- public Object clone()
- {
- try
- {
- IdentityHashMap copy = (IdentityHashMap) super.clone();
- copy.table = (Object[]) table.clone();
- copy.entries = null; // invalidate the cache
- return copy;
- }
- catch (CloneNotSupportedException e)
- {
- // Can't happen.
- return null;
- }
- }
-
- /**
- * Tests whether the specified key is in this map. Unlike normal Maps,
- * this test uses <code>entry == key</code> instead of
- * <code>entry == null ? key == null : entry.equals(key)</code>.
- *
- * @param key the key to look for
- * @return true if the key is contained in the map
- * @see #containsValue(Object)
- * @see #get(Object)
- */
- public boolean containsKey(Object key)
- {
- return key == table[hash(key)];
- }
-
- /**
- * Returns true if this HashMap contains the value. Unlike normal maps,
- * this test uses <code>entry == value</code> instead of
- * <code>entry == null ? value == null : entry.equals(value)</code>.
- *
- * @param value the value to search for in this HashMap
- * @return true if at least one key maps to the value
- * @see #containsKey(Object)
- */
- public boolean containsValue(Object value)
- {
- for (int i = table.length - 1; i > 0; i -= 2)
- if (table[i] == value)
- return true;
- return false;
- }
-
- /**
- * Returns a "set view" of this Map's entries. The set is backed by
- * the Map, so changes in one show up in the other. The set supports
- * element removal, but not element addition.
- * <p>
- *
- * <em>The semantics of this set, and of its contained entries, are
- * different from the contract of Set and Map.Entry in order to make
- * IdentityHashMap work. This means that while you can compare these
- * objects between IdentityHashMaps, comparing them with regular sets
- * or entries is likely to have undefined behavior.</em> The entries
- * in this set are reference-based, rather than the normal object
- * equality. Therefore, <code>e1.equals(e2)</code> returns
- * <code>e1.getKey() == e2.getKey() && e1.getValue() == e2.getValue()</code>,
- * and <code>e.hashCode()</code> returns
- * <code>System.identityHashCode(e.getKey()) ^
- * System.identityHashCode(e.getValue())</code>.
- * <p>
- *
- * Note that the iterators for all three views, from keySet(), entrySet(),
- * and values(), traverse the Map in the same sequence.
- *
- * @return a set view of the entries
- * @see #keySet()
- * @see #values()
- * @see Map.Entry
- */
- public Set entrySet()
- {
- if (entries == null)
- entries = new AbstractSet()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- return new IdentityIterator(ENTRIES);
- }
-
- public void clear()
- {
- IdentityHashMap.this.clear();
- }
-
- public boolean contains(Object o)
- {
- if (! (o instanceof Map.Entry))
- return false;
- Map.Entry m = (Map.Entry) o;
- return m.getValue() == table[hash(m.getKey()) + 1];
- }
-
- public int hashCode()
- {
- return IdentityHashMap.this.hashCode();
- }
-
- public boolean remove(Object o)
- {
- if (! (o instanceof Map.Entry))
- return false;
- Object key = ((Map.Entry) o).getKey();
- int h = hash(key);
- if (table[h] == key)
- {
- size--;
- modCount++;
- table[h] = tombstone;
- table[h + 1] = tombstone;
- return true;
- }
- return false;
- }
- };
- return entries;
- }
-
- /**
- * Compares two maps for equality. This returns true only if both maps
- * have the same reference-identity comparisons. While this returns
- * <code>this.entrySet().equals(m.entrySet())</code> as specified by Map,
- * this will not work with normal maps, since the entry set compares
- * with == instead of .equals.
- *
- * @param o the object to compare to
- * @return true if it is equal
- */
- public boolean equals(Object o)
- {
- // Why did Sun specify this one? The superclass does the right thing.
- return super.equals(o);
- }
-
- /**
- * Return the value in this Map associated with the supplied key, or
- * <code>null</code> if the key maps to nothing.
- *
- * <p>NOTE: Since the value could also be null, you must use
- * containsKey to see if this key actually maps to something.
- * Unlike normal maps, this tests for the key with <code>entry ==
- * key</code> instead of <code>entry == null ? key == null :
- * entry.equals(key)</code>.
- *
- * @param key the key for which to fetch an associated value
- * @return what the key maps to, if present
- * @see #put(Object, Object)
- * @see #containsKey(Object)
- */
- public Object get(Object key)
- {
- int h = hash(key);
- return table[h] == key ? table[h + 1] : null;
- }
-
- /**
- * Returns the hashcode of this map. This guarantees that two
- * IdentityHashMaps that compare with equals() will have the same hash code,
- * but may break with comparison to normal maps since it uses
- * System.identityHashCode() instead of hashCode().
- *
- * @return the hash code
- */
- public int hashCode()
- {
- int hash = 0;
- for (int i = table.length - 2; i >= 0; i -= 2)
- {
- Object key = table[i];
- if (key == emptyslot || key == tombstone)
- continue;
- hash += (System.identityHashCode(key)
- ^ System.identityHashCode(table[i + 1]));
- }
- return hash;
- }
-
- /**
- * Returns true if there are no key-value mappings currently in this Map
- * @return <code>size() == 0</code>
- */
- public boolean isEmpty()
- {
- return size == 0;
- }
-
- /**
- * Returns a "set view" of this Map's keys. The set is backed by the
- * Map, so changes in one show up in the other. The set supports
- * element removal, but not element addition.
- * <p>
- *
- * <em>The semantics of this set are different from the contract of Set
- * in order to make IdentityHashMap work. This means that while you can
- * compare these objects between IdentityHashMaps, comparing them with
- * regular sets is likely to have undefined behavior.</em> The hashCode
- * of the set is the sum of the identity hash codes, instead of the
- * regular hashCodes, and equality is determined by reference instead
- * of by the equals method.
- * <p>
- *
- * @return a set view of the keys
- * @see #values()
- * @see #entrySet()
- */
- public Set keySet()
- {
- if (keys == null)
- keys = new AbstractSet()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- return new IdentityIterator(KEYS);
- }
-
- public void clear()
- {
- IdentityHashMap.this.clear();
- }
-
- public boolean contains(Object o)
- {
- return containsKey(o);
- }
-
- public int hashCode()
- {
- int hash = 0;
- for (int i = table.length - 2; i >= 0; i -= 2)
- {
- Object key = table[i];
- if (key == emptyslot || key == tombstone)
- continue;
- hash += System.identityHashCode(key);
- }
- return hash;
-
- }
-
- public boolean remove(Object o)
- {
- int h = hash(o);
- if (table[h] == o)
- {
- size--;
- modCount++;
- table[h] = tombstone;
- table[h + 1] = tombstone;
- return true;
- }
- return false;
- }
- };
- return keys;
- }
-
- /**
- * Puts the supplied value into the Map, mapped by the supplied key.
- * The value may be retrieved by any object which <code>equals()</code>
- * this key. NOTE: Since the prior value could also be null, you must
- * first use containsKey if you want to see if you are replacing the
- * key's mapping. Unlike normal maps, this tests for the key
- * with <code>entry == key</code> instead of
- * <code>entry == null ? key == null : entry.equals(key)</code>.
- *
- * @param key the key used to locate the value
- * @param value the value to be stored in the HashMap
- * @return the prior mapping of the key, or null if there was none
- * @see #get(Object)
- */
- public Object put(Object key, Object value)
- {
- // Rehash if the load factor is too high.
- if (size > threshold)
- {
- Object[] old = table;
- // This isn't necessarily prime, but it is an odd number of key/value
- // slots, which has a higher probability of fewer collisions.
- table = new Object[(old.length * 2) + 2];
- Arrays.fill(table, emptyslot);
- size = 0;
- threshold = (table.length >>> 3) * 3;
-
- for (int i = old.length - 2; i >= 0; i -= 2)
- {
- Object oldkey = old[i];
- if (oldkey != tombstone && oldkey != emptyslot)
- // Just use put. This isn't very efficient, but it is ok.
- put(oldkey, old[i + 1]);
- }
- }
-
- int h = hash(key);
- if (table[h] == key)
- {
- Object r = table[h + 1];
- table[h + 1] = value;
- return r;
- }
-
- // At this point, we add a new mapping.
- modCount++;
- size++;
- table[h] = key;
- table[h + 1] = value;
- return null;
- }
-
- /**
- * Copies all of the mappings from the specified map to this. If a key
- * is already in this map, its value is replaced.
- *
- * @param m the map to copy
- * @throws NullPointerException if m is null
- */
- public void putAll(Map m)
- {
- // Why did Sun specify this one? The superclass does the right thing.
- super.putAll(m);
- }
-
- /**
- * Removes from the HashMap and returns the value which is mapped by
- * the supplied key. If the key maps to nothing, then the HashMap
- * remains unchanged, and <code>null</code> is returned.
- *
- * NOTE: Since the value could also be null, you must use
- * containsKey to see if you are actually removing a mapping.
- * Unlike normal maps, this tests for the key with <code>entry ==
- * key</code> instead of <code>entry == null ? key == null :
- * entry.equals(key)</code>.
- *
- * @param key the key used to locate the value to remove
- * @return whatever the key mapped to, if present
- */
- public Object remove(Object key)
- {
- int h = hash(key);
- if (table[h] == key)
- {
- modCount++;
- size--;
- Object r = table[h + 1];
- table[h] = tombstone;
- table[h + 1] = tombstone;
- return r;
- }
- return null;
- }
-
- /**
- * Returns the number of kay-value mappings currently in this Map
- * @return the size
- */
- public int size()
- {
- return size;
- }
-
- /**
- * Returns a "collection view" (or "bag view") of this Map's values.
- * The collection is backed by the Map, so changes in one show up
- * in the other. The collection supports element removal, but not element
- * addition.
- * <p>
- *
- * <em>The semantics of this set are different from the contract of
- * Collection in order to make IdentityHashMap work. This means that
- * while you can compare these objects between IdentityHashMaps, comparing
- * them with regular sets is likely to have undefined behavior.</em>
- * Likewise, contains and remove go by == instead of equals().
- * <p>
- *
- * @return a bag view of the values
- * @see #keySet()
- * @see #entrySet()
- */
- public Collection values()
- {
- if (values == null)
- values = new AbstractCollection()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- return new IdentityIterator(VALUES);
- }
-
- public void clear()
- {
- IdentityHashMap.this.clear();
- }
-
- public boolean remove(Object o)
- {
- for (int i = table.length - 1; i > 0; i -= 2)
- if (table[i] == o)
- {
- modCount++;
- table[i - 1] = tombstone;
- table[i] = tombstone;
- size--;
- return true;
- }
- return false;
- }
- };
- return values;
- }
-
- /**
- * Helper method which computes the hash code, then traverses the table
- * until it finds the key, or the spot where the key would go.
- *
- * @param key the key to check
- * @return the index where the key belongs
- * @see #IdentityHashMap(int)
- * @see #put(Object, Object)
- */
- // Package visible for use by nested classes.
- int hash(Object key)
- {
- // Implementation note: it is feasible for the table to have no
- // emptyslots, if it is full with entries and tombstones, so we must
- // remember where we started. If we encounter the key or an emptyslot,
- // we are done. If we encounter a tombstone, the key may still be in
- // the array. If we don't encounter the key, we use the first emptyslot
- // or tombstone we encountered as the location where the key would go.
- // By requiring at least 2 key/value slots, and rehashing at 75%
- // capacity, we guarantee that there will always be either an emptyslot
- // or a tombstone somewhere in the table.
- int h = Math.abs(System.identityHashCode(key) % (table.length >> 1)) << 1;
- int del = -1;
- int save = h;
-
- do
- {
- if (table[h] == key)
- return h;
- if (table[h] == emptyslot)
- break;
- if (table[h] == tombstone && del < 0)
- del = h;
- h -= 2;
- if (h < 0)
- h = table.length - 2;
- }
- while (h != save);
-
- return del < 0 ? h : del;
- }
-
- /**
- * This class allows parameterized iteration over IdentityHashMaps. Based
- * on its construction, it returns the key or value of a mapping, or
- * creates the appropriate Map.Entry object with the correct fail-fast
- * semantics and identity comparisons.
- *
- * @author Tom Tromey (tromey@redhat.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private class IdentityIterator implements Iterator
- {
- /**
- * The type of this Iterator: {@link #KEYS}, {@link #VALUES},
- * or {@link #ENTRIES}.
- */
- final int type;
- /** The number of modifications to the backing Map that we know about. */
- int knownMod = modCount;
- /** The number of elements remaining to be returned by next(). */
- int count = size;
- /** Location in the table. */
- int loc = table.length;
-
- /**
- * Construct a new Iterator with the supplied type.
- * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
- */
- IdentityIterator(int type)
- {
- this.type = type;
- }
-
- /**
- * Returns true if the Iterator has more elements.
- * @return true if there are more elements
- * @throws ConcurrentModificationException if the Map was modified
- */
- public boolean hasNext()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- return count > 0;
- }
-
- /**
- * Returns the next element in the Iterator's sequential view.
- * @return the next element
- * @throws ConcurrentModificationException if the Map was modified
- * @throws NoSuchElementException if there is none
- */
- public Object next()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- if (count == 0)
- throw new NoSuchElementException();
- count--;
-
- Object key;
- do
- {
- loc -= 2;
- key = table[loc];
- }
- while (key == emptyslot || key == tombstone);
-
- return type == KEYS ? key : (type == VALUES ? table[loc + 1]
- : new IdentityEntry(loc));
- }
-
- /**
- * Removes from the backing Map the last element which was fetched
- * with the <code>next()</code> method.
- *
- * @throws ConcurrentModificationException if the Map was modified
- * @throws IllegalStateException if called when there is no last element
- */
- public void remove()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- if (loc == table.length || table[loc] == tombstone)
- throw new IllegalStateException();
- modCount++;
- size--;
- table[loc] = tombstone;
- table[loc + 1] = tombstone;
- knownMod++;
- }
- } // class IdentityIterator
-
- /**
- * This class provides Map.Entry objects for IdentityHashMaps. The entry
- * is fail-fast, and will throw a ConcurrentModificationException if
- * the underlying map is modified, or if remove is called on the iterator
- * that generated this object. It is identity based, so it violates
- * the general contract of Map.Entry, and is probably unsuitable for
- * comparison to normal maps; but it works among other IdentityHashMaps.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private final class IdentityEntry implements Map.Entry
- {
- /** The location of this entry. */
- final int loc;
- /** The number of modifications to the backing Map that we know about. */
- final int knownMod = modCount;
-
- /**
- * Constructs the Entry.
- *
- * @param loc the location of this entry in table
- */
- IdentityEntry(int loc)
- {
- this.loc = loc;
- }
-
- /**
- * Compares the specified object with this entry, using identity
- * semantics. Note that this can lead to undefined results with
- * Entry objects created by normal maps.
- *
- * @param o the object to compare
- * @return true if it is equal
- * @throws ConcurrentModificationException if the entry was invalidated
- * by modifying the Map or calling Iterator.remove()
- */
- public boolean equals(Object o)
- {
- if (knownMod != modCount || table[loc] == tombstone)
- throw new ConcurrentModificationException();
- if (! (o instanceof Map.Entry))
- return false;
- Map.Entry e = (Map.Entry) o;
- return table[loc] == e.getKey() && table[loc + 1] == e.getValue();
- }
-
- /**
- * Returns the key of this entry.
- *
- * @return the key
- * @throws ConcurrentModificationException if the entry was invalidated
- * by modifying the Map or calling Iterator.remove()
- */
- public Object getKey()
- {
- if (knownMod != modCount || table[loc] == tombstone)
- throw new ConcurrentModificationException();
- return table[loc];
- }
-
- /**
- * Returns the value of this entry.
- *
- * @return the value
- * @throws ConcurrentModificationException if the entry was invalidated
- * by modifying the Map or calling Iterator.remove()
- */
- public Object getValue()
- {
- if (knownMod != modCount || table[loc] == tombstone)
- throw new ConcurrentModificationException();
- return table[loc + 1];
- }
-
- /**
- * Returns the hashcode of the entry, using identity semantics.
- * Note that this can lead to undefined results with Entry objects
- * created by normal maps.
- *
- * @return the hash code
- * @throws ConcurrentModificationException if the entry was invalidated
- * by modifying the Map or calling Iterator.remove()
- */
- public int hashCode()
- {
- if (knownMod != modCount || table[loc] == tombstone)
- throw new ConcurrentModificationException();
- return (System.identityHashCode(table[loc])
- ^ System.identityHashCode(table[loc + 1]));
- }
-
- /**
- * Replaces the value of this mapping, and returns the old value.
- *
- * @param value the new value
- * @return the old value
- * @throws ConcurrentModificationException if the entry was invalidated
- * by modifying the Map or calling Iterator.remove()
- */
- public Object setValue(Object value)
- {
- if (knownMod != modCount || table[loc] == tombstone)
- throw new ConcurrentModificationException();
- Object r = table[loc + 1];
- table[loc + 1] = value;
- return r;
- }
-
- /**
- * This provides a string representation of the entry. It is of the form
- * "key=value", where string concatenation is used on key and value.
- *
- * @return the string representation
- * @throws ConcurrentModificationException if the entry was invalidated
- * by modifying the Map or calling Iterator.remove()
- */
- public String toString()
- {
- if (knownMod != modCount || table[loc] == tombstone)
- throw new ConcurrentModificationException();
- return table[loc] + "=" + table[loc + 1];
- }
- } // class IdentityEntry
-
- /**
- * Reads the object from a serial stream.
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if the underlying stream fails
- * @throws IOException if the underlying stream fails
- * @serialData expects the size (int), followed by that many key (Object)
- * and value (Object) pairs, with the pairs in no particular
- * order
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
-
- int num = s.readInt();
- table = new Object[Math.max(num << 1, DEFAULT_CAPACITY) << 1];
- // Read key/value pairs.
- while (--num >= 0)
- put(s.readObject(), s.readObject());
- }
-
- /**
- * Writes the object to a serial stream.
- *
- * @param s the stream to write to
- * @throws IOException if the underlying stream fails
- * @serialData outputs the size (int), followed by that many key (Object)
- * and value (Object) pairs, with the pairs in no particular
- * order
- */
- private void writeObject(ObjectOutputStream s)
- throws IOException
- {
- s.defaultWriteObject();
- s.writeInt(size);
- for (int i = table.length - 2; i >= 0; i -= 2)
- {
- Object key = table[i];
- if (key != tombstone && key != emptyslot)
- {
- s.writeObject(key);
- s.writeObject(table[i + 1]);
- }
- }
- }
-}
diff --git a/libjava/java/util/Iterator.java b/libjava/java/util/Iterator.java
deleted file mode 100644
index 31ecff8a257..00000000000
--- a/libjava/java/util/Iterator.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Iterator.java -- Interface for iterating over collections
- Copyright (C) 1998, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * An object which iterates over a collection. An Iterator is used to return
- * the items once only, in sequence, by successive calls to the next method.
- * It is also possible to remove elements from the underlying collection by
- * using the optional remove method. Iterator is intended as a replacement
- * for the Enumeration interface of previous versions of Java, which did not
- * have the remove method and had less conveniently named methods.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see ListIterator
- * @see Enumeration
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Iterator
-{
- /**
- * Tests whether there are elements remaining in the collection. In other
- * words, calling <code>next()</code> will not throw an exception.
- *
- * @return true if there is at least one more element in the collection
- */
- boolean hasNext();
-
- /**
- * Obtain the next element in the collection.
- *
- * @return the next element in the collection
- * @throws NoSuchElementException if there are no more elements
- */
- Object next();
-
- /**
- * Remove from the underlying collection the last element returned by next
- * (optional operation). This method can be called only once after each
- * call to <code>next()</code>. It does not affect what will be returned
- * by subsequent calls to next.
- *
- * @throws IllegalStateException if next has not yet been called or remove
- * has already been called since the last call to next.
- * @throws UnsupportedOperationException if this Iterator does not support
- * the remove operation.
- */
- void remove();
-}
diff --git a/libjava/java/util/LinkedHashMap.java b/libjava/java/util/LinkedHashMap.java
deleted file mode 100644
index 8e895a9e0d8..00000000000
--- a/libjava/java/util/LinkedHashMap.java
+++ /dev/null
@@ -1,501 +0,0 @@
-/* LinkedHashMap.java -- a class providing hashtable data structure,
- mapping Object --> Object, with linked list traversal
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * This class provides a hashtable-backed implementation of the
- * Map interface, with predictable traversal order.
- * <p>
- *
- * It uses a hash-bucket approach; that is, hash collisions are handled
- * by linking the new node off of the pre-existing node (or list of
- * nodes). In this manner, techniques such as linear probing (which
- * can cause primary clustering) and rehashing (which does not fit very
- * well with Java's method of precomputing hash codes) are avoided. In
- * addition, this maintains a doubly-linked list which tracks either
- * insertion or access order.
- * <p>
- *
- * In insertion order, calling <code>put</code> adds the key to the end of
- * traversal, unless the key was already in the map; changing traversal order
- * requires removing and reinserting a key. On the other hand, in access
- * order, all calls to <code>put</code> and <code>get</code> cause the
- * accessed key to move to the end of the traversal list. Note that any
- * accesses to the map's contents via its collection views and iterators do
- * not affect the map's traversal order, since the collection views do not
- * call <code>put</code> or <code>get</code>.
- * <p>
- *
- * One of the nice features of tracking insertion order is that you can
- * copy a hashtable, and regardless of the implementation of the original,
- * produce the same results when iterating over the copy. This is possible
- * without needing the overhead of <code>TreeMap</code>.
- * <p>
- *
- * When using this {@link #LinkedHashMap(int, float, boolean) constructor},
- * you can build an access-order mapping. This can be used to implement LRU
- * caches, for example. By overriding {@link #removeEldestEntry(Map.Entry)},
- * you can also control the removal of the oldest entry, and thereby do
- * things like keep the map at a fixed size.
- * <p>
- *
- * Under ideal circumstances (no collisions), LinkedHashMap offers O(1)
- * performance on most operations (<code>containsValue()</code> is,
- * of course, O(n)). In the worst case (all keys map to the same
- * hash code -- very unlikely), most operations are O(n). Traversal is
- * faster than in HashMap (proportional to the map size, and not the space
- * allocated for the map), but other operations may be slower because of the
- * overhead of the maintaining the traversal order list.
- * <p>
- *
- * LinkedHashMap accepts the null key and null values. It is not
- * synchronized, so if you need multi-threaded access, consider using:<br>
- * <code>Map m = Collections.synchronizedMap(new LinkedHashMap(...));</code>
- * <p>
- *
- * The iterators are <i>fail-fast</i>, meaning that any structural
- * modification, except for <code>remove()</code> called on the iterator
- * itself, cause the iterator to throw a
- * {@link ConcurrentModificationException} rather than exhibit
- * non-deterministic behavior.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Object#hashCode()
- * @see Collection
- * @see Map
- * @see HashMap
- * @see TreeMap
- * @see Hashtable
- * @since 1.4
- * @status updated to 1.4
- */
-public class LinkedHashMap extends HashMap
-{
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 3801124242820219131L;
-
- /**
- * The oldest Entry to begin iteration at.
- */
- transient LinkedHashEntry root;
-
- /**
- * The iteration order of this linked hash map: <code>true</code> for
- * access-order, <code>false</code> for insertion-order.
- *
- * @serial true for access order traversal
- */
- final boolean accessOrder;
-
- /**
- * Class to represent an entry in the hash table. Holds a single key-value
- * pair and the doubly-linked insertion order list.
- */
- class LinkedHashEntry extends HashEntry
- {
- /**
- * The predecessor in the iteration list. If this entry is the root
- * (eldest), pred points to the newest entry.
- */
- LinkedHashEntry pred;
-
- /** The successor in the iteration list, null if this is the newest. */
- LinkedHashEntry succ;
-
- /**
- * Simple constructor.
- *
- * @param key the key
- * @param value the value
- */
- LinkedHashEntry(Object key, Object value)
- {
- super(key, value);
- if (root == null)
- {
- root = this;
- pred = this;
- }
- else
- {
- pred = root.pred;
- pred.succ = this;
- root.pred = this;
- }
- }
-
- /**
- * Called when this entry is accessed via put or get. This version does
- * the necessary bookkeeping to keep the doubly-linked list in order,
- * after moving this element to the newest position in access order.
- */
- void access()
- {
- if (accessOrder && succ != null)
- {
- modCount++;
- if (this == root)
- {
- root = succ;
- pred.succ = this;
- succ = null;
- }
- else
- {
- pred.succ = succ;
- succ.pred = pred;
- succ = null;
- pred = root.pred;
- pred.succ = this;
- root.pred = this;
- }
- }
- }
-
- /**
- * Called when this entry is removed from the map. This version does
- * the necessary bookkeeping to keep the doubly-linked list in order.
- *
- * @return the value of this key as it is removed
- */
- Object cleanup()
- {
- if (this == root)
- {
- root = succ;
- if (succ != null)
- succ.pred = pred;
- }
- else if (succ == null)
- {
- pred.succ = null;
- root.pred = pred;
- }
- else
- {
- pred.succ = succ;
- succ.pred = pred;
- }
- return value;
- }
- } // class LinkedHashEntry
-
- /**
- * Construct a new insertion-ordered LinkedHashMap with the default
- * capacity (11) and the default load factor (0.75).
- */
- public LinkedHashMap()
- {
- super();
- accessOrder = false;
- }
-
- /**
- * Construct a new insertion-ordered LinkedHashMap from the given Map,
- * with initial capacity the greater of the size of <code>m</code> or
- * the default of 11.
- * <p>
- *
- * Every element in Map m will be put into this new HashMap, in the
- * order of m's iterator.
- *
- * @param m a Map whose key / value pairs will be put into
- * the new HashMap. <b>NOTE: key / value pairs
- * are not cloned in this constructor.</b>
- * @throws NullPointerException if m is null
- */
- public LinkedHashMap(Map m)
- {
- super(m);
- accessOrder = false;
- }
-
- /**
- * Construct a new insertion-ordered LinkedHashMap with a specific
- * inital capacity and default load factor of 0.75.
- *
- * @param initialCapacity the initial capacity of this HashMap (&gt;= 0)
- * @throws IllegalArgumentException if (initialCapacity &lt; 0)
- */
- public LinkedHashMap(int initialCapacity)
- {
- super(initialCapacity);
- accessOrder = false;
- }
-
- /**
- * Construct a new insertion-orderd LinkedHashMap with a specific
- * inital capacity and load factor.
- *
- * @param initialCapacity the initial capacity (&gt;= 0)
- * @param loadFactor the load factor (&gt; 0, not NaN)
- * @throws IllegalArgumentException if (initialCapacity &lt; 0) ||
- * ! (loadFactor &gt; 0.0)
- */
- public LinkedHashMap(int initialCapacity, float loadFactor)
- {
- super(initialCapacity, loadFactor);
- accessOrder = false;
- }
-
- /**
- * Construct a new LinkedHashMap with a specific inital capacity, load
- * factor, and ordering mode.
- *
- * @param initialCapacity the initial capacity (&gt;=0)
- * @param loadFactor the load factor (&gt;0, not NaN)
- * @param accessOrder true for access-order, false for insertion-order
- * @throws IllegalArgumentException if (initialCapacity &lt; 0) ||
- * ! (loadFactor &gt; 0.0)
- */
- public LinkedHashMap(int initialCapacity, float loadFactor,
- boolean accessOrder)
- {
- super(initialCapacity, loadFactor);
- this.accessOrder = accessOrder;
- }
-
- /**
- * Clears the Map so it has no keys. This is O(1).
- */
- public void clear()
- {
- super.clear();
- root = null;
- }
-
- /**
- * Returns <code>true</code> if this HashMap contains a value
- * <code>o</code>, such that <code>o.equals(value)</code>.
- *
- * @param value the value to search for in this HashMap
- * @return <code>true</code> if at least one key maps to the value
- */
- public boolean containsValue(Object value)
- {
- LinkedHashEntry e = root;
- while (e != null)
- {
- if (equals(value, e.value))
- return true;
- e = e.succ;
- }
- return false;
- }
-
- /**
- * Return the value in this Map associated with the supplied key,
- * or <code>null</code> if the key maps to nothing. If this is an
- * access-ordered Map and the key is found, this performs structural
- * modification, moving the key to the newest end of the list. NOTE:
- * Since the value could also be null, you must use containsKey to
- * see if this key actually maps to something.
- *
- * @param key the key for which to fetch an associated value
- * @return what the key maps to, if present
- * @see #put(Object, Object)
- * @see #containsKey(Object)
- */
- public Object get(Object key)
- {
- int idx = hash(key);
- HashEntry e = buckets[idx];
- while (e != null)
- {
- if (equals(key, e.key))
- {
- e.access();
- return e.value;
- }
- e = e.next;
- }
- return null;
- }
-
- /**
- * Returns <code>true</code> if this map should remove the eldest entry.
- * This method is invoked by all calls to <code>put</code> and
- * <code>putAll</code> which place a new entry in the map, providing
- * the implementer an opportunity to remove the eldest entry any time
- * a new one is added. This can be used to save memory usage of the
- * hashtable, as well as emulating a cache, by deleting stale entries.
- * <p>
- *
- * For example, to keep the Map limited to 100 entries, override as follows:
- * <pre>
- * private static final int MAX_ENTRIES = 100;
- * protected boolean removeEldestEntry(Map.Entry eldest)
- * {
- * return size() &gt; MAX_ENTRIES;
- * }
- * </pre><p>
- *
- * Typically, this method does not modify the map, but just uses the
- * return value as an indication to <code>put</code> whether to proceed.
- * However, if you override it to modify the map, you must return false
- * (indicating that <code>put</code> should leave the modified map alone),
- * or you face unspecified behavior. Remember that in access-order mode,
- * even calling <code>get</code> is a structural modification, but using
- * the collections views (such as <code>keySet</code>) is not.
- * <p>
- *
- * This method is called after the eldest entry has been inserted, so
- * if <code>put</code> was called on a previously empty map, the eldest
- * entry is the one you just put in! The default implementation just
- * returns <code>false</code>, so that this map always behaves like
- * a normal one with unbounded growth.
- *
- * @param eldest the eldest element which would be removed if this
- * returns true. For an access-order map, this is the least
- * recently accessed; for an insertion-order map, this is the
- * earliest element inserted.
- * @return true if <code>eldest</code> should be removed
- */
- protected boolean removeEldestEntry(Map.Entry eldest)
- {
- return false;
- }
-
- /**
- * Helper method called by <code>put</code>, which creates and adds a
- * new Entry, followed by performing bookkeeping (like removeEldestEntry).
- *
- * @param key the key of the new Entry
- * @param value the value
- * @param idx the index in buckets where the new Entry belongs
- * @param callRemove whether to call the removeEldestEntry method
- * @see #put(Object, Object)
- * @see #removeEldestEntry(Map.Entry)
- * @see LinkedHashEntry#LinkedHashEntry(Object, Object)
- */
- void addEntry(Object key, Object value, int idx, boolean callRemove)
- {
- LinkedHashEntry e = new LinkedHashEntry(key, value);
- e.next = buckets[idx];
- buckets[idx] = e;
- if (callRemove && removeEldestEntry(root))
- remove(root.key);
- }
-
- /**
- * Helper method, called by clone() to reset the doubly-linked list.
- *
- * @param m the map to add entries from
- * @see #clone()
- */
- void putAllInternal(Map m)
- {
- root = null;
- super.putAllInternal(m);
- }
-
- /**
- * Generates a parameterized iterator. This allows traversal to follow
- * the doubly-linked list instead of the random bin order of HashMap.
- *
- * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
- * @return the appropriate iterator
- */
- Iterator iterator(final int type)
- {
- return new Iterator()
- {
- /** The current Entry. */
- LinkedHashEntry current = root;
-
- /** The previous Entry returned by next(). */
- LinkedHashEntry last;
-
- /** The number of known modifications to the backing Map. */
- int knownMod = modCount;
-
- /**
- * Returns true if the Iterator has more elements.
- *
- * @return true if there are more elements
- * @throws ConcurrentModificationException if the HashMap was modified
- */
- public boolean hasNext()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- return current != null;
- }
-
- /**
- * Returns the next element in the Iterator's sequential view.
- *
- * @return the next element
- * @throws ConcurrentModificationException if the HashMap was modified
- * @throws NoSuchElementException if there is none
- */
- public Object next()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- if (current == null)
- throw new NoSuchElementException();
- last = current;
- current = current.succ;
- return type == VALUES ? last.value : type == KEYS ? last.key : last;
- }
-
- /**
- * Removes from the backing HashMap the last element which was fetched
- * with the <code>next()</code> method.
- *
- * @throws ConcurrentModificationException if the HashMap was modified
- * @throws IllegalStateException if called when there is no last element
- */
- public void remove()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- if (last == null)
- throw new IllegalStateException();
- LinkedHashMap.this.remove(last.key);
- last = null;
- knownMod++;
- }
- };
- }
-} // class LinkedHashMap
diff --git a/libjava/java/util/LinkedHashSet.java b/libjava/java/util/LinkedHashSet.java
deleted file mode 100644
index 6c68195c3bd..00000000000
--- a/libjava/java/util/LinkedHashSet.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/* LinkedHashSet.java -- a set backed by a LinkedHashMap, for linked
- list traversal.
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.Serializable;
-
-/**
- * This class provides a hashtable-backed implementation of the
- * Set interface, with predictable traversal order.
- * <p>
- *
- * It uses a hash-bucket approach; that is, hash collisions are handled
- * by linking the new node off of the pre-existing node (or list of
- * nodes). In this manner, techniques such as linear probing (which
- * can cause primary clustering) and rehashing (which does not fit very
- * well with Java's method of precomputing hash codes) are avoided. In
- * addition, this maintains a doubly-linked list which tracks insertion
- * order. Note that the insertion order is not modified if an
- * <code>add</code> simply reinserts an element in the set.
- * <p>
- *
- * One of the nice features of tracking insertion order is that you can
- * copy a set, and regardless of the implementation of the original,
- * produce the same results when iterating over the copy. This is possible
- * without needing the overhead of <code>TreeSet</code>.
- * <p>
- *
- * Under ideal circumstances (no collisions), LinkedHashSet offers O(1)
- * performance on most operations. In the worst case (all elements map
- * to the same hash code -- very unlikely), most operations are O(n).
- * <p>
- *
- * LinkedHashSet accepts the null entry. It is not synchronized, so if
- * you need multi-threaded access, consider using:<br>
- * <code>Set s = Collections.synchronizedSet(new LinkedHashSet(...));</code>
- * <p>
- *
- * The iterators are <i>fail-fast</i>, meaning that any structural
- * modification, except for <code>remove()</code> called on the iterator
- * itself, cause the iterator to throw a
- * {@link ConcurrentModificationException} rather than exhibit
- * non-deterministic behavior.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Object#hashCode()
- * @see Collection
- * @see Set
- * @see HashSet
- * @see TreeSet
- * @see Collections#synchronizedSet(Set)
- * @since 1.4
- * @status updated to 1.4
- */
-public class LinkedHashSet extends HashSet
- implements Set, Cloneable, Serializable
-{
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = -2851667679971038690L;
-
- /**
- * Construct a new, empty HashSet whose backing HashMap has the default
- * capacity (11) and loadFacor (0.75).
- */
- public LinkedHashSet()
- {
- super();
- }
-
- /**
- * Construct a new, empty HashSet whose backing HashMap has the supplied
- * capacity and the default load factor (0.75).
- *
- * @param initialCapacity the initial capacity of the backing HashMap
- * @throws IllegalArgumentException if the capacity is negative
- */
- public LinkedHashSet(int initialCapacity)
- {
- super(initialCapacity);
- }
-
- /**
- * Construct a new, empty HashSet whose backing HashMap has the supplied
- * capacity and load factor.
- *
- * @param initialCapacity the initial capacity of the backing HashMap
- * @param loadFactor the load factor of the backing HashMap
- * @throws IllegalArgumentException if either argument is negative, or
- * if loadFactor is POSITIVE_INFINITY or NaN
- */
- public LinkedHashSet(int initialCapacity, float loadFactor)
- {
- super(initialCapacity, loadFactor);
- }
-
- /**
- * Construct a new HashSet with the same elements as are in the supplied
- * collection (eliminating any duplicates, of course). The backing storage
- * has twice the size of the collection, or the default size of 11,
- * whichever is greater; and the default load factor (0.75).
- *
- * @param c a collection of initial set elements
- * @throws NullPointerException if c is null
- */
- public LinkedHashSet(Collection c)
- {
- super(c);
- }
-
- /**
- * Helper method which initializes the backing Map.
- *
- * @param capacity the initial capacity
- * @param load the initial load factor
- * @return the backing HashMap
- */
- HashMap init(int capacity, float load)
- {
- return new LinkedHashMap(capacity, load);
- }
-
-}
diff --git a/libjava/java/util/LinkedList.java b/libjava/java/util/LinkedList.java
deleted file mode 100644
index f611050df1d..00000000000
--- a/libjava/java/util/LinkedList.java
+++ /dev/null
@@ -1,958 +0,0 @@
-/* LinkedList.java -- Linked list implementation of the List interface
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-
-/**
- * Linked list implementation of the List interface. In addition to the
- * methods of the List interface, this class provides access to the first
- * and last list elements in O(1) time for easy stack, queue, or double-ended
- * queue (deque) creation. The list is doubly-linked, with traversal to a
- * given index starting from the end closest to the element.<p>
- *
- * LinkedList is not synchronized, so if you need multi-threaded access,
- * consider using:<br>
- * <code>List l = Collections.synchronizedList(new LinkedList(...));</code>
- * <p>
- *
- * The iterators are <i>fail-fast</i>, meaning that any structural
- * modification, except for <code>remove()</code> called on the iterator
- * itself, cause the iterator to throw a
- * {@link ConcurrentModificationException} rather than exhibit
- * non-deterministic behavior.
- *
- * @author Original author unknown
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see List
- * @see ArrayList
- * @see Vector
- * @see Collections#synchronizedList(List)
- * @since 1.2
- * @status missing javadoc, but complete to 1.4
- */
-public class LinkedList extends AbstractSequentialList
- implements List, Cloneable, Serializable
-{
- /**
- * Compatible with JDK 1.2.
- */
- private static final long serialVersionUID = 876323262645176354L;
-
- /**
- * The first element in the list.
- */
- transient Entry first;
-
- /**
- * The last element in the list.
- */
- transient Entry last;
-
- /**
- * The current length of the list.
- */
- transient int size = 0;
-
- /**
- * Class to represent an entry in the list. Holds a single element.
- */
- private static final class Entry
- {
- /** The element in the list. */
- Object data;
-
- /** The next list entry, null if this is last. */
- Entry next;
-
- /** The previous list entry, null if this is first. */
- Entry previous;
-
- /**
- * Construct an entry.
- * @param data the list element
- */
- Entry(Object data)
- {
- this.data = data;
- }
- } // class Entry
-
- /**
- * Obtain the Entry at a given position in a list. This method of course
- * takes linear time, but it is intelligent enough to take the shorter of the
- * paths to get to the Entry required. This implies that the first or last
- * entry in the list is obtained in constant time, which is a very desirable
- * property.
- * For speed and flexibility, range checking is not done in this method:
- * Incorrect values will be returned if (n &lt; 0) or (n &gt;= size).
- *
- * @param n the number of the entry to get
- * @return the entry at position n
- */
- // Package visible for use in nested classes.
- Entry getEntry(int n)
- {
- Entry e;
- if (n < size / 2)
- {
- e = first;
- // n less than size/2, iterate from start
- while (n-- > 0)
- e = e.next;
- }
- else
- {
- e = last;
- // n greater than size/2, iterate from end
- while (++n < size)
- e = e.previous;
- }
- return e;
- }
-
- /**
- * Remove an entry from the list. This will adjust size and deal with
- * `first' and `last' appropriatly.
- *
- * @param e the entry to remove
- */
- // Package visible for use in nested classes.
- void removeEntry(Entry e)
- {
- modCount++;
- size--;
- if (size == 0)
- first = last = null;
- else
- {
- if (e == first)
- {
- first = e.next;
- e.next.previous = null;
- }
- else if (e == last)
- {
- last = e.previous;
- e.previous.next = null;
- }
- else
- {
- e.next.previous = e.previous;
- e.previous.next = e.next;
- }
- }
- }
-
- /**
- * Checks that the index is in the range of possible elements (inclusive).
- *
- * @param index the index to check
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size
- */
- private void checkBoundsInclusive(int index)
- {
- if (index < 0 || index > size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size);
- }
-
- /**
- * Checks that the index is in the range of existing elements (exclusive).
- *
- * @param index the index to check
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size
- */
- private void checkBoundsExclusive(int index)
- {
- if (index < 0 || index >= size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size);
- }
-
- /**
- * Create an empty linked list.
- */
- public LinkedList()
- {
- }
-
- /**
- * Create a linked list containing the elements, in order, of a given
- * collection.
- *
- * @param c the collection to populate this list from
- * @throws NullPointerException if c is null
- */
- public LinkedList(Collection c)
- {
- addAll(c);
- }
-
- /**
- * Returns the first element in the list.
- *
- * @return the first list element
- * @throws NoSuchElementException if the list is empty
- */
- public Object getFirst()
- {
- if (size == 0)
- throw new NoSuchElementException();
- return first.data;
- }
-
- /**
- * Returns the last element in the list.
- *
- * @return the last list element
- * @throws NoSuchElementException if the list is empty
- */
- public Object getLast()
- {
- if (size == 0)
- throw new NoSuchElementException();
- return last.data;
- }
-
- /**
- * Remove and return the first element in the list.
- *
- * @return the former first element in the list
- * @throws NoSuchElementException if the list is empty
- */
- public Object removeFirst()
- {
- if (size == 0)
- throw new NoSuchElementException();
- modCount++;
- size--;
- Object r = first.data;
-
- if (first.next != null)
- first.next.previous = null;
- else
- last = null;
-
- first = first.next;
-
- return r;
- }
-
- /**
- * Remove and return the last element in the list.
- *
- * @return the former last element in the list
- * @throws NoSuchElementException if the list is empty
- */
- public Object removeLast()
- {
- if (size == 0)
- throw new NoSuchElementException();
- modCount++;
- size--;
- Object r = last.data;
-
- if (last.previous != null)
- last.previous.next = null;
- else
- first = null;
-
- last = last.previous;
-
- return r;
- }
-
- /**
- * Insert an element at the first of the list.
- *
- * @param o the element to insert
- */
- public void addFirst(Object o)
- {
- Entry e = new Entry(o);
-
- modCount++;
- if (size == 0)
- first = last = e;
- else
- {
- e.next = first;
- first.previous = e;
- first = e;
- }
- size++;
- }
-
- /**
- * Insert an element at the last of the list.
- *
- * @param o the element to insert
- */
- public void addLast(Object o)
- {
- addLastEntry(new Entry(o));
- }
-
- /**
- * Inserts an element at the end of the list.
- *
- * @param e the entry to add
- */
- private void addLastEntry(Entry e)
- {
- modCount++;
- if (size == 0)
- first = last = e;
- else
- {
- e.previous = last;
- last.next = e;
- last = e;
- }
- size++;
- }
-
- /**
- * Returns true if the list contains the given object. Comparison is done by
- * <code>o == null ? e = null : o.equals(e)</code>.
- *
- * @param o the element to look for
- * @return true if it is found
- */
- public boolean contains(Object o)
- {
- Entry e = first;
- while (e != null)
- {
- if (equals(o, e.data))
- return true;
- e = e.next;
- }
- return false;
- }
-
- /**
- * Returns the size of the list.
- *
- * @return the list size
- */
- public int size()
- {
- return size;
- }
-
- /**
- * Adds an element to the end of the list.
- *
- * @param e the entry to add
- * @return true, as it always succeeds
- */
- public boolean add(Object o)
- {
- addLastEntry(new Entry(o));
- return true;
- }
-
- /**
- * Removes the entry at the lowest index in the list that matches the given
- * object, comparing by <code>o == null ? e = null : o.equals(e)</code>.
- *
- * @param o the object to remove
- * @return true if an instance of the object was removed
- */
- public boolean remove(Object o)
- {
- Entry e = first;
- while (e != null)
- {
- if (equals(o, e.data))
- {
- removeEntry(e);
- return true;
- }
- e = e.next;
- }
- return false;
- }
-
- /**
- * Append the elements of the collection in iteration order to the end of
- * this list. If this list is modified externally (for example, if this
- * list is the collection), behavior is unspecified.
- *
- * @param c the collection to append
- * @return true if the list was modified
- * @throws NullPointerException if c is null
- */
- public boolean addAll(Collection c)
- {
- return addAll(size, c);
- }
-
- /**
- * Insert the elements of the collection in iteration order at the given
- * index of this list. If this list is modified externally (for example,
- * if this list is the collection), behavior is unspecified.
- *
- * @param c the collection to append
- * @return true if the list was modified
- * @throws NullPointerException if c is null
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- public boolean addAll(int index, Collection c)
- {
- checkBoundsInclusive(index);
- int csize = c.size();
-
- if (csize == 0)
- return false;
-
- Iterator itr = c.iterator();
-
- // Get the entries just before and after index. If index is at the start
- // of the list, BEFORE is null. If index is at the end of the list, AFTER
- // is null. If the list is empty, both are null.
- Entry after = null;
- Entry before = null;
- if (index != size)
- {
- after = getEntry(index);
- before = after.previous;
- }
- else
- before = last;
-
- // Create the first new entry. We do not yet set the link from `before'
- // to the first entry, in order to deal with the case where (c == this).
- // [Actually, we don't have to handle this case to fufill the
- // contract for addAll(), but Sun's implementation appears to.]
- Entry e = new Entry(itr.next());
- e.previous = before;
- Entry prev = e;
- Entry firstNew = e;
-
- // Create and link all the remaining entries.
- for (int pos = 1; pos < csize; pos++)
- {
- e = new Entry(itr.next());
- e.previous = prev;
- prev.next = e;
- prev = e;
- }
-
- // Link the new chain of entries into the list.
- modCount++;
- size += csize;
- prev.next = after;
- if (after != null)
- after.previous = e;
- else
- last = e;
-
- if (before != null)
- before.next = firstNew;
- else
- first = firstNew;
- return true;
- }
-
- /**
- * Remove all elements from this list.
- */
- public void clear()
- {
- if (size > 0)
- {
- modCount++;
- first = null;
- last = null;
- size = 0;
- }
- }
-
- /**
- * Return the element at index.
- *
- * @param index the place to look
- * @return the element at index
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object get(int index)
- {
- checkBoundsExclusive(index);
- return getEntry(index).data;
- }
-
- /**
- * Replace the element at the given location in the list.
- *
- * @param index which index to change
- * @param o the new element
- * @return the prior element
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object set(int index, Object o)
- {
- checkBoundsExclusive(index);
- Entry e = getEntry(index);
- Object old = e.data;
- e.data = o;
- return old;
- }
-
- /**
- * Inserts an element in the given position in the list.
- *
- * @param index where to insert the element
- * @param o the element to insert
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- public void add(int index, Object o)
- {
- checkBoundsInclusive(index);
- Entry e = new Entry(o);
-
- if (index < size)
- {
- modCount++;
- Entry after = getEntry(index);
- e.next = after;
- e.previous = after.previous;
- if (after.previous == null)
- first = e;
- else
- after.previous.next = e;
- after.previous = e;
- size++;
- }
- else
- addLastEntry(e);
- }
-
- /**
- * Removes the element at the given position from the list.
- *
- * @param index the location of the element to remove
- * @return the removed element
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- public Object remove(int index)
- {
- checkBoundsExclusive(index);
- Entry e = getEntry(index);
- removeEntry(e);
- return e.data;
- }
-
- /**
- * Returns the first index where the element is located in the list, or -1.
- *
- * @param o the element to look for
- * @return its position, or -1 if not found
- */
- public int indexOf(Object o)
- {
- int index = 0;
- Entry e = first;
- while (e != null)
- {
- if (equals(o, e.data))
- return index;
- index++;
- e = e.next;
- }
- return -1;
- }
-
- /**
- * Returns the last index where the element is located in the list, or -1.
- *
- * @param o the element to look for
- * @return its position, or -1 if not found
- */
- public int lastIndexOf(Object o)
- {
- int index = size - 1;
- Entry e = last;
- while (e != null)
- {
- if (equals(o, e.data))
- return index;
- index--;
- e = e.previous;
- }
- return -1;
- }
-
- /**
- * Obtain a ListIterator over this list, starting at a given index. The
- * ListIterator returned by this method supports the add, remove and set
- * methods.
- *
- * @param index the index of the element to be returned by the first call to
- * next(), or size() to be initially positioned at the end of the list
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- public ListIterator listIterator(int index)
- {
- checkBoundsInclusive(index);
- return new LinkedListItr(index);
- }
-
- /**
- * Create a shallow copy of this LinkedList (the elements are not cloned).
- *
- * @return an object of the same class as this object, containing the
- * same elements in the same order
- */
- public Object clone()
- {
- LinkedList copy = null;
- try
- {
- copy = (LinkedList) super.clone();
- }
- catch (CloneNotSupportedException ex)
- {
- }
- copy.clear();
- copy.addAll(this);
- return copy;
- }
-
- /**
- * Returns an array which contains the elements of the list in order.
- *
- * @return an array containing the list elements
- */
- public Object[] toArray()
- {
- Object[] array = new Object[size];
- Entry e = first;
- for (int i = 0; i < size; i++)
- {
- array[i] = e.data;
- e = e.next;
- }
- return array;
- }
-
- /**
- * Returns an Array whose component type is the runtime component type of
- * the passed-in Array. The returned Array is populated with all of the
- * elements in this LinkedList. If the passed-in Array is not large enough
- * to store all of the elements in this List, a new Array will be created
- * and returned; if the passed-in Array is <i>larger</i> than the size
- * of this List, then size() index will be set to null.
- *
- * @param a the passed-in Array
- * @return an array representation of this list
- * @throws ArrayStoreException if the runtime type of a does not allow
- * an element in this list
- * @throws NullPointerException if a is null
- */
- public Object[] toArray(Object[] a)
- {
- if (a.length < size)
- a = (Object[]) Array.newInstance(a.getClass().getComponentType(), size);
- else if (a.length > size)
- a[size] = null;
- Entry e = first;
- for (int i = 0; i < size; i++)
- {
- a[i] = e.data;
- e = e.next;
- }
- return a;
- }
-
- /**
- * Serializes this object to the given stream.
- *
- * @param s the stream to write to
- * @throws IOException if the underlying stream fails
- * @serialData the size of the list (int), followed by all the elements
- * (Object) in proper order
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- s.defaultWriteObject();
- s.writeInt(size);
- Entry e = first;
- while (e != null)
- {
- s.writeObject(e.data);
- e = e.next;
- }
- }
-
- /**
- * Deserializes this object from the given stream.
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if the underlying stream fails
- * @throws IOException if the underlying stream fails
- * @serialData the size of the list (int), followed by all the elements
- * (Object) in proper order
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- int i = s.readInt();
- while (--i >= 0)
- addLastEntry(new Entry(s.readObject()));
- }
-
- /**
- * A ListIterator over the list. This class keeps track of its
- * position in the list and the two list entries it is between.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private final class LinkedListItr implements ListIterator
- {
- /** Number of modifications we know about. */
- private int knownMod = modCount;
-
- /** Entry that will be returned by next(). */
- private Entry next;
-
- /** Entry that will be returned by previous(). */
- private Entry previous;
-
- /** Entry that will be affected by remove() or set(). */
- private Entry lastReturned;
-
- /** Index of `next'. */
- private int position;
-
- /**
- * Initialize the iterator.
- *
- * @param index the initial index
- */
- LinkedListItr(int index)
- {
- if (index == size)
- {
- next = null;
- previous = last;
- }
- else
- {
- next = getEntry(index);
- previous = next.previous;
- }
- position = index;
- }
-
- /**
- * Checks for iterator consistency.
- *
- * @throws ConcurrentModificationException if the list was modified
- */
- private void checkMod()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- }
-
- /**
- * Returns the index of the next element.
- *
- * @return the next index
- * @throws ConcurrentModificationException if the list was modified
- */
- public int nextIndex()
- {
- checkMod();
- return position;
- }
-
- /**
- * Returns the index of the previous element.
- *
- * @return the previous index
- * @throws ConcurrentModificationException if the list was modified
- */
- public int previousIndex()
- {
- checkMod();
- return position - 1;
- }
-
- /**
- * Returns true if more elements exist via next.
- *
- * @return true if next will succeed
- * @throws ConcurrentModificationException if the list was modified
- */
- public boolean hasNext()
- {
- checkMod();
- return (next != null);
- }
-
- /**
- * Returns true if more elements exist via previous.
- *
- * @return true if previous will succeed
- * @throws ConcurrentModificationException if the list was modified
- */
- public boolean hasPrevious()
- {
- checkMod();
- return (previous != null);
- }
-
- /**
- * Returns the next element.
- *
- * @return the next element
- * @throws ConcurrentModificationException if the list was modified
- * @throws NoSuchElementException if there is no next
- */
- public Object next()
- {
- checkMod();
- if (next == null)
- throw new NoSuchElementException();
- position++;
- lastReturned = previous = next;
- next = lastReturned.next;
- return lastReturned.data;
- }
-
- /**
- * Returns the previous element.
- *
- * @return the previous element
- * @throws ConcurrentModificationException if the list was modified
- * @throws NoSuchElementException if there is no previous
- */
- public Object previous()
- {
- checkMod();
- if (previous == null)
- throw new NoSuchElementException();
- position--;
- lastReturned = next = previous;
- previous = lastReturned.previous;
- return lastReturned.data;
- }
-
- /**
- * Remove the most recently returned element from the list.
- *
- * @throws ConcurrentModificationException if the list was modified
- * @throws IllegalStateException if there was no last element
- */
- public void remove()
- {
- checkMod();
- if (lastReturned == null)
- throw new IllegalStateException();
-
- // Adjust the position to before the removed element, if the element
- // being removed is behind the cursor.
- if (lastReturned == previous)
- position--;
-
- next = lastReturned.next;
- previous = lastReturned.previous;
- removeEntry(lastReturned);
- knownMod++;
-
- lastReturned = null;
- }
-
- /**
- * Adds an element between the previous and next, and advance to the next.
- *
- * @param o the element to add
- * @throws ConcurrentModificationException if the list was modified
- */
- public void add(Object o)
- {
- checkMod();
- modCount++;
- knownMod++;
- size++;
- position++;
- Entry e = new Entry(o);
- e.previous = previous;
- e.next = next;
-
- if (previous != null)
- previous.next = e;
- else
- first = e;
-
- if (next != null)
- next.previous = e;
- else
- last = e;
-
- previous = e;
- lastReturned = null;
- }
-
- /**
- * Changes the contents of the element most recently returned.
- *
- * @param o the new element
- * @throws ConcurrentModificationException if the list was modified
- * @throws IllegalStateException if there was no last element
- */
- public void set(Object o)
- {
- checkMod();
- if (lastReturned == null)
- throw new IllegalStateException();
- lastReturned.data = o;
- }
- } // class LinkedListItr
-}
diff --git a/libjava/java/util/List.java b/libjava/java/util/List.java
deleted file mode 100644
index 445811292ac..00000000000
--- a/libjava/java/util/List.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/* List.java -- An ordered collection which allows indexed access
- Copyright (C) 1998, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * An ordered collection (also known as a list). This collection allows
- * access to elements by position, as well as control on where elements
- * are inserted. Unlike sets, duplicate elements are permitted by this
- * general contract (if a subclass forbids duplicates, this should be
- * documented).
- * <p>
- *
- * List places additional requirements on <code>iterator</code>,
- * <code>add</code>, <code>remove</code>, <code>equals</code>, and
- * <code>hashCode</code>, in addition to requiring more methods. List
- * indexing is 0-based (like arrays), although some implementations may
- * require time proportional to the index to obtain an arbitrary element.
- * The List interface is incompatible with Set; you cannot implement both
- * simultaneously.
- * <p>
- *
- * Lists also provide a <code>ListIterator</code> which allows bidirectional
- * traversal and other features atop regular iterators. Lists can be
- * searched for arbitrary elements, and allow easy insertion and removal
- * of multiple elements in one method call.
- * <p>
- *
- * Note: While lists may contain themselves as elements, this leads to
- * undefined (usually infinite recursive) behavior for some methods like
- * hashCode or equals.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see Set
- * @see ArrayList
- * @see LinkedList
- * @see Vector
- * @see Arrays#asList(Object[])
- * @see Collections#nCopies(int, Object)
- * @see Collections#EMPTY_LIST
- * @see AbstractList
- * @see AbstractSequentialList
- * @since 1.2
- * @status updated to 1.4
- */
-public interface List extends Collection
-{
- /**
- * Insert an element into the list at a given position (optional operation).
- * This shifts all existing elements from that position to the end one
- * index to the right. This version of add has no return, since it is
- * assumed to always succeed if there is no exception.
- *
- * @param index the location to insert the item
- * @param o the object to insert
- * @throws UnsupportedOperationException if this list does not support the
- * add operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason
- * @throws NullPointerException if o is null and this list doesn't support
- * the addition of null values.
- */
- void add(int index, Object o);
-
- /**
- * Add an element to the end of the list (optional operation). If the list
- * imposes restraints on what can be inserted, such as no null elements,
- * this should be documented.
- *
- * @param o the object to add
- * @return true, as defined by Collection for a modified list
- * @throws UnsupportedOperationException if this list does not support the
- * add operation
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason
- * @throws NullPointerException if o is null and this list doesn't support
- * the addition of null values.
- */
- boolean add(Object o);
-
- /**
- * Insert the contents of a collection into the list at a given position
- * (optional operation). Shift all elements at that position to the right
- * by the number of elements inserted. This operation is undefined if
- * this list is modified during the operation (for example, if you try
- * to insert a list into itself).
- *
- * @param index the location to insert the collection
- * @param c the collection to insert
- * @return true if the list was modified by this action, that is, if c is
- * non-empty
- * @throws UnsupportedOperationException if this list does not support the
- * addAll operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws ClassCastException if some element of c cannot be added to this
- * list due to its type
- * @throws IllegalArgumentException if some element of c cannot be added
- * to this list for some other reason
- * @throws NullPointerException if some element of c is null and this list
- * doesn't support the addition of null values.
- * @throws NullPointerException if the specified collection is null
- * @see #add(int, Object)
- */
- boolean addAll(int index, Collection c);
-
- /**
- * Add the contents of a collection to the end of the list (optional
- * operation). This operation is undefined if this list is modified
- * during the operation (for example, if you try to insert a list into
- * itself).
- *
- * @param c the collection to add
- * @return true if the list was modified by this action, that is, if c is
- * non-empty
- * @throws UnsupportedOperationException if this list does not support the
- * addAll operation
- * @throws ClassCastException if some element of c cannot be added to this
- * list due to its type
- * @throws IllegalArgumentException if some element of c cannot be added
- * to this list for some other reason
- * @throws NullPointerException if the specified collection is null
- * @throws NullPointerException if some element of c is null and this list
- * doesn't support the addition of null values.
- * @see #add(Object)
- */
- boolean addAll(Collection c);
-
- /**
- * Clear the list, such that a subsequent call to isEmpty() would return
- * true (optional operation).
- *
- * @throws UnsupportedOperationException if this list does not support the
- * clear operation
- */
- void clear();
-
- /**
- * Test whether this list contains a given object as one of its elements.
- * This is defined as the existence of an element e such that
- * <code>o == null ? e == null : o.equals(e)</code>.
- *
- * @param o the element to look for
- * @return true if this list contains the element
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws NullPointerException if o is null and the list doesn't
- * support null values.
- */
- boolean contains(Object o);
-
- /**
- * Test whether this list contains every element in a given collection.
- *
- * @param c the collection to test for
- * @return true if for every element o in c, contains(o) would return true
- * @throws NullPointerException if the collection is null
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this list.
- * @throws NullPointerException if some element of c is null and this
- * list does not support null values.
- * @see #contains(Object)
- */
- boolean containsAll(Collection c);
-
- /**
- * Test whether this list is equal to another object. A List is defined to be
- * equal to an object if and only if that object is also a List, and the two
- * lists have the same sequence. Two lists l1 and l2 are equal if and only
- * if <code>l1.size() == l2.size()</code>, and for every integer n between 0
- * and <code>l1.size() - 1</code> inclusive, <code>l1.get(n) == null ?
- * l2.get(n) == null : l1.get(n).equals(l2.get(n))</code>.
- *
- * @param o the object to test for equality with this list
- * @return true if o is equal to this list
- * @see Object#equals(Object)
- * @see #hashCode()
- */
- boolean equals(Object o);
-
- /**
- * Get the element at a given index in this list.
- *
- * @param index the index of the element to be returned
- * @return the element at index index in this list
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- Object get(int index);
-
- /**
- * Obtains a hash code for this list. In order to obey the general
- * contract of the hashCode method of class Object, this value is
- * calculated as follows:
- *
-<p><pre>hashCode = 1;
-Iterator i = list.iterator();
-while (i.hasNext())
-{
- Object obj = i.next();
- hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
-}</pre>
- *
- * <p>This ensures that the general contract of Object.hashCode()
- * is adhered to.
- *
- * @return the hash code of this list
- * @see Object#hashCode()
- * @see #equals(Object)
- */
- int hashCode();
-
- /**
- * Obtain the first index at which a given object is to be found in this
- * list.
- *
- * @param o the object to search for
- * @return the least integer n such that <code>o == null ? get(n) == null :
- * o.equals(get(n))</code>, or -1 if there is no such index.
- * @throws ClassCastException if the type of o is not a valid
- * type for this list.
- * @throws NullPointerException if o is null and this
- * list does not support null values.
- */
- int indexOf(Object o);
-
- /**
- * Test whether this list is empty, that is, if size() == 0.
- *
- * @return true if this list contains no elements
- */
- boolean isEmpty();
-
- /**
- * Obtain an Iterator over this list, whose sequence is the list order.
- *
- * @return an Iterator over the elements of this list, in order
- */
- Iterator iterator();
-
- /**
- * Obtain the last index at which a given object is to be found in this
- * list.
- *
- * @return the greatest integer n such that <code>o == null ? get(n) == null
- * : o.equals(get(n))</code>, or -1 if there is no such index.
- * @throws ClassCastException if the type of o is not a valid
- * type for this list.
- * @throws NullPointerException if o is null and this
- * list does not support null values.
- */
- int lastIndexOf(Object o);
-
- /**
- * Obtain a ListIterator over this list, starting at the beginning.
- *
- * @return a ListIterator over the elements of this list, in order, starting
- * at the beginning
- */
- ListIterator listIterator();
-
- /**
- * Obtain a ListIterator over this list, starting at a given position.
- * A first call to next() would return the same as get(index), and a
- * first call to previous() would return the same as get(index - 1).
- *
- * @param index the position, between 0 and size() inclusive, to begin the
- * iteration from
- * @return a ListIterator over the elements of this list, in order, starting
- * at index
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- ListIterator listIterator(int index);
-
- /**
- * Remove the element at a given position in this list (optional operation).
- * Shifts all remaining elements to the left to fill the gap.
- *
- * @param index the position within the list of the object to remove
- * @return the object that was removed
- * @throws UnsupportedOperationException if this list does not support the
- * remove operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- Object remove(int index);
-
- /**
- * Remove the first occurence of an object from this list (optional
- * operation). That is, remove the first element e such that
- * <code>o == null ? e == null : o.equals(e)</code>.
- *
- * @param o the object to remove
- * @return true if the list changed as a result of this call, that is, if
- * the list contained at least one occurrence of o
- * @throws UnsupportedOperationException if this list does not support the
- * remove operation
- * @throws ClassCastException if the type of o is not a valid
- * type for this list.
- * @throws NullPointerException if o is null and this
- * list does not support removing null values.
- */
- boolean remove(Object o);
-
- /**
- * Remove all elements of a given collection from this list (optional
- * operation). That is, remove every element e such that c.contains(e).
- *
- * @param c the collection to filter out
- * @return true if this list was modified as a result of this call
- * @throws UnsupportedOperationException if this list does not support the
- * removeAll operation
- * @throws NullPointerException if the collection is null
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this list.
- * @throws NullPointerException if some element of c is null and this
- * list does not support removing null values.
- * @see #remove(Object)
- * @see #contains(Object)
- */
- boolean removeAll(Collection c);
-
- /**
- * Remove all elements of this list that are not contained in a given
- * collection (optional operation). That is, remove every element e such
- * that !c.contains(e).
- *
- * @param c the collection to retain
- * @return true if this list was modified as a result of this call
- * @throws UnsupportedOperationException if this list does not support the
- * retainAll operation
- * @throws NullPointerException if the collection is null
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this list.
- * @throws NullPointerException if some element of c is null and this
- * list does not support retaining null values.
- * @see #remove(Object)
- * @see #contains(Object)
- */
- boolean retainAll(Collection c);
-
- /**
- * Replace an element of this list with another object (optional operation).
- *
- * @param index the position within this list of the element to be replaced
- * @param o the object to replace it with
- * @return the object that was replaced
- * @throws UnsupportedOperationException if this list does not support the
- * set operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- * @throws ClassCastException if o cannot be added to this list due to its
- * type
- * @throws IllegalArgumentException if o cannot be added to this list for
- * some other reason
- * @throws NullPointerException if o is null and this
- * list does not support null values.
- */
- Object set(int index, Object o);
-
- /**
- * Get the number of elements in this list. If the list contains more
- * than Integer.MAX_VALUE elements, return Integer.MAX_VALUE.
- *
- * @return the number of elements in the list
- */
- int size();
-
- /**
- * Obtain a List view of a subsection of this list, from fromIndex
- * (inclusive) to toIndex (exclusive). If the two indices are equal, the
- * sublist is empty. The returned list should be modifiable if and only
- * if this list is modifiable. Changes to the returned list should be
- * reflected in this list. If this list is structurally modified in
- * any way other than through the returned list, the result of any subsequent
- * operations on the returned list is undefined.
- *
- * @param fromIndex the index that the returned list should start from
- * (inclusive)
- * @param toIndex the index that the returned list should go to (exclusive)
- * @return a List backed by a subsection of this list
- * @throws IndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; size() || fromIndex &gt; toIndex
- */
- List subList(int fromIndex, int toIndex);
-
- /**
- * Copy the current contents of this list into an array.
- *
- * @return an array of type Object[] and length equal to the length of this
- * list, containing the elements currently in this list, in order
- */
- Object[] toArray();
-
- /**
- * Copy the current contents of this list into an array. If the array passed
- * as an argument has length less than that of this list, an array of the
- * same run-time type as a, and length equal to the length of this list, is
- * allocated using Reflection. Otherwise, a itself is used. The elements of
- * this list are copied into it, and if there is space in the array, the
- * following element is set to null. The resultant array is returned.
- * Note: The fact that the following element is set to null is only useful
- * if it is known that this list does not contain any null elements.
- *
- * @param a the array to copy this list into
- * @return an array containing the elements currently in this list, in
- * order
- * @throws ArrayStoreException if the type of any element of the
- * collection is not a subtype of the element type of a
- * @throws NullPointerException if the specified array is null
- */
- Object[] toArray(Object[] a);
-}
diff --git a/libjava/java/util/ListIterator.java b/libjava/java/util/ListIterator.java
deleted file mode 100644
index 5e17108c991..00000000000
--- a/libjava/java/util/ListIterator.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/* ListIterator.java -- Extended Iterator for iterating over ordered lists
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * An extended version of Iterator to support the extra features of Lists. The
- * elements may be accessed in forward or reverse order, elements may be
- * replaced as well as removed, and new elements may be inserted, during the
- * traversal of the list.
- * <p>
- *
- * A list with n elements provides n+1 iterator positions (the front, the end,
- * or between two elements). Note that <code>remove</code> and <code>set</code>
- * operate on the last element returned, whether it was by <code>next</code>
- * or <code>previous</code>.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see List
- * @see Iterator
- * @see Enumeration
- * @since 1.2
- * @status updated to 1.4
- */
-public interface ListIterator extends Iterator
-{
- /**
- * Tests whether there are elements remaining in the list in the forward
- * direction. In other words, next() will not fail with a
- * NoSuchElementException.
- *
- * @return true if the list continues in the forward direction
- */
- boolean hasNext();
-
- /**
- * Tests whether there are elements remaining in the list in the reverse
- * direction. In other words, previous() will not fail with a
- * NoSuchElementException.
- *
- * @return true if the list continues in the reverse direction
- */
- boolean hasPrevious();
-
- /**
- * Obtain the next element in the list in the forward direction. Repeated
- * calls to next may be used to iterate over the entire list, or calls to
- * next and previous may be used together to go forwards and backwards.
- * Alternating calls to next and previous will return the same element.
- *
- * @return the next element in the list in the forward direction
- * @throws NoSuchElementException if there are no more elements
- */
- Object next();
-
- /**
- * Obtain the next element in the list in the reverse direction. Repeated
- * calls to previous may be used to iterate backwards over the entire list,
- * or calls to next and previous may be used together to go forwards and
- * backwards. Alternating calls to next and previous will return the same
- * element.
- *
- * @return the next element in the list in the reverse direction
- * @throws NoSuchElementException if there are no more elements
- */
- Object previous();
-
- /**
- * Find the index of the element that would be returned by a call to next.
- * If hasNext() returns false, this returns the list size.
- *
- * @return the index of the element that would be returned by next()
- */
- int nextIndex();
-
- /**
- * Find the index of the element that would be returned by a call to
- * previous. If hasPrevious() returns false, this returns -1.
- *
- * @return the index of the element that would be returned by previous()
- */
- int previousIndex();
-
- /**
- * Insert an element into the list at the current position of the iterator
- * (optional operation). The element is inserted in between the element that
- * would be returned by previous and the element that would be returned by
- * next. After the insertion, a subsequent call to next is unaffected, but
- * a call to previous returns the item that was added. The values returned
- * by nextIndex() and previousIndex() are incremented.
- *
- * @param o the object to insert into the list
- * @throws ClassCastException if the object is of a type which cannot be added
- * to this list.
- * @throws IllegalArgumentException if some other aspect of the object stops
- * it being added to this list.
- * @throws UnsupportedOperationException if this ListIterator does not
- * support the add operation.
- */
- void add(Object o);
-
- /**
- * Remove from the list the element last returned by a call to next or
- * previous (optional operation). This method may only be called if neither
- * add nor remove have been called since the last call to next or previous.
- *
- * @throws IllegalStateException if neither next or previous have been
- * called, or if add or remove has been called since the last call
- * to next or previous
- * @throws UnsupportedOperationException if this ListIterator does not
- * support the remove operation
- */
- void remove();
-
- /**
- * Replace the element last returned by a call to next or previous with a
- * given object (optional operation). This method may only be called if
- * neither add nor remove have been called since the last call to next or
- * previous.
- *
- * @param o the object to replace the element with
- * @throws ClassCastException the object is of a type which cannot be added
- * to this list
- * @throws IllegalArgumentException some other aspect of the object stops
- * it being added to this list
- * @throws IllegalStateException if neither next or previous have been
- * called, or if add or remove has been called since the last call
- * to next or previous
- * @throws UnsupportedOperationException if this ListIterator does not
- * support the set operation
- */
- void set(Object o);
-}
diff --git a/libjava/java/util/ListResourceBundle.java b/libjava/java/util/ListResourceBundle.java
deleted file mode 100644
index 2bc51c3b013..00000000000
--- a/libjava/java/util/ListResourceBundle.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* ListResourceBundle -- a resource bundle build around a list
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * A <code>ListResouceBundle</code> provides an easy way, to create your own
- * resource bundle. It is an abstract class that you can subclass. You should
- * then overwrite the getContents method, that provides a key/value list.
- *
- * <p>The key/value list is a two dimensional list of Object. The first
- * dimension ranges over the resources. The second dimension ranges from
- * zero (key) to one (value). The keys must be of type String, and they are
- * case-sensitive. For example:
- *
-<br><pre>public class MyResources
- extends ListResourceBundle
-{
- public Object[][] getContents()
- {
- return contents;
- }
-
- static final Object[][] contents =
- {
- // LOCALIZED STRINGS
- {"s1", "The disk \"{1}\" contains {0}."}, // MessageFormat pattern
- {"s2", "1"}, // location of {0} in pattern
- {"s3", "My Disk"}, // sample disk name
- {"s4", "no files"}, // first ChoiceFormat choice
- {"s5", "one file"}, // second ChoiceFormat choice
- {"s6", "{0,number} files"} // third ChoiceFormat choice
- {"s7", "3 Mar 96"}, // sample date
- {"s8", new Dimension(1,5)} // real object, not just string
- // END OF LOCALIZED MATERIAL
- };
-}</pre>
- *
- * @author Jochen Hoenicke
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Locale
- * @see PropertyResourceBundle
- * @since 1.1
- * @status updated to 1.4
- */
-public abstract class ListResourceBundle extends ResourceBundle
-{
- /**
- * The constructor. It does nothing special.
- */
- public ListResourceBundle()
- {
- }
-
- /**
- * Gets a resource for a given key. This is called by <code>getObject</code>.
- *
- * @param key the key of the resource
- * @return the resource for the key, or null if it doesn't exist
- */
- public final Object handleGetObject(String key)
- {
- Object[][] contents = getContents();
- int i = contents.length;
- while (--i >= 0)
- if (key.equals(contents[i][0]))
- return contents[i][1];
- return null;
- }
-
- /**
- * This method should return all keys for which a resource exists.
- *
- * @return an enumeration of the keys
- */
- public Enumeration getKeys()
- {
- // We make a new Set that holds all the keys, then return an enumeration
- // for that. This prevents modifications from ruining the enumeration,
- // as well as ignoring duplicates.
- final Object[][] contents = getContents();
- Set s = new HashSet();
- int i = contents.length;
- while (--i >= 0)
- s.add(contents[i][0]);
- ResourceBundle bundle = parent;
- // Eliminate tail recursion.
- while (bundle != null)
- {
- Enumeration e = bundle.getKeys();
- while (e.hasMoreElements())
- s.add(e.nextElement());
- bundle = bundle.parent;
- }
- return Collections.enumeration(s);
- }
-
- /**
- * Gets the key/value list. You must override this method, and should not
- * provide duplicate keys or null entries.
- *
- * @return a two dimensional list of String key / Object resouce pairs
- */
- protected abstract Object[][] getContents();
-} // class ListResourceBundle
diff --git a/libjava/java/util/Map.java b/libjava/java/util/Map.java
deleted file mode 100644
index 256e98899f6..00000000000
--- a/libjava/java/util/Map.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/* Map.java: interface Map -- An object that maps keys to values
- interface Map.Entry -- an Entry in a Map
- Copyright (C) 1998, 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * An object that maps keys onto values. Keys cannot be duplicated. This
- * interface replaces the obsolete {@link Dictionary} abstract class.
- * <p>
- *
- * The map has three collection views, which are backed by the map
- * (modifications on one show up on the other): a set of keys, a collection
- * of values, and a set of key-value mappings. Some maps have a guaranteed
- * order, but not all do.
- * <p>
- *
- * Note: Be careful about using mutable keys. Behavior is unspecified if
- * a key's comparison behavior is changed after the fact. As a corollary
- * to this rule, don't use a Map as one of its own keys or values, as it makes
- * hashCode and equals have undefined behavior.
- * <p>
- *
- * All maps are recommended to provide a no argument constructor, which builds
- * an empty map, and one that accepts a Map parameter and copies the mappings
- * (usually by putAll), to create an equivalent map. Unfortunately, Java
- * cannot enforce these suggestions.
- * <p>
- *
- * The map may be unmodifiable, in which case unsupported operations will
- * throw an UnsupportedOperationException. Note that some operations may be
- * safe, such as putAll(m) where m is empty, even if the operation would
- * normally fail with a non-empty argument.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see HashMap
- * @see TreeMap
- * @see Hashtable
- * @see SortedMap
- * @see Collection
- * @see Set
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Map
-{
- /**
- * Remove all entries from this Map (optional operation).
- *
- * @throws UnsupportedOperationException if clear is not supported
- */
- void clear();
-
- /**
- * Returns true if this contains a mapping for the given key.
- *
- * @param key the key to search for
- * @return true if the map contains the key
- * @throws ClassCastException if the key is of an inappropriate type
- * @throws NullPointerException if key is <code>null</code> but the map
- * does not permit null keys
- */
- boolean containsKey(Object key);
-
- /**
- * Returns true if this contains at least one mapping with the given value.
- * In other words, returns true if a value v exists where
- * <code>(value == null ? v == null : value.equals(v))</code>. This usually
- * requires linear time.
- *
- * @param value the value to search for
- * @return true if the map contains the value
- * @throws ClassCastException if the type of the value is not a valid type
- * for this map.
- * @throws NullPointerException if the value is null and the map doesn't
- * support null values.
- */
- boolean containsValue(Object value);
-
- /**
- * Returns a set view of the mappings in this Map. Each element in the
- * set is a Map.Entry. The set is backed by the map, so that changes in
- * one show up in the other. Modifications made while an iterator is
- * in progress cause undefined behavior. If the set supports removal,
- * these methods remove the underlying mapping from the map:
- * <code>Iterator.remove</code>, <code>Set.remove</code>,
- * <code>removeAll</code>, <code>retainAll</code>, and <code>clear</code>.
- * Element addition, via <code>add</code> or <code>addAll</code>, is
- * not supported via this set.
- *
- * @return the set view of all mapping entries
- * @see Map.Entry
- */
- Set entrySet();
-
- /**
- * Compares the specified object with this map for equality. Returns
- * <code>true</code> if the other object is a Map with the same mappings,
- * that is,<br>
- * <code>o instanceof Map && entrySet().equals(((Map) o).entrySet();</code>
- * This allows comparison of maps, regardless of implementation.
- *
- * @param o the object to be compared
- * @return true if the object equals this map
- * @see Set#equals(Object)
- */
- boolean equals(Object o);
-
- /**
- * Returns the value mapped by the given key. Returns <code>null</code> if
- * there is no mapping. However, in Maps that accept null values, you
- * must rely on <code>containsKey</code> to determine if a mapping exists.
- *
- * @param key the key to look up
- * @return the value associated with the key, or null if key not in map
- * @throws ClassCastException if the key is an inappropriate type
- * @throws NullPointerException if this map does not accept null keys
- * @see #containsKey(Object)
- */
- Object get(Object key);
-
- /**
- * Associates the given key to the given value (optional operation). If the
- * map already contains the key, its value is replaced. Be aware that in
- * a map that permits <code>null</code> values, a null return does not
- * always imply that the mapping was created.
- *
- * @param key the key to map
- * @param value the value to be mapped
- * @return the previous value of the key, or null if there was no mapping
- * @throws UnsupportedOperationException if the operation is not supported
- * @throws ClassCastException if the key or value is of the wrong type
- * @throws IllegalArgumentException if something about this key or value
- * prevents it from existing in this map
- * @throws NullPointerException if either the key or the value is null,
- * and the map forbids null keys or values
- * @see #containsKey(Object)
- */
- Object put(Object key, Object value);
-
- /**
- * Returns the hash code for this map. This is the sum of all hashcodes
- * for each Map.Entry object in entrySet. This allows comparison of maps,
- * regardless of implementation, and satisfies the contract of
- * Object.hashCode.
- *
- * @return the hash code
- * @see Map.Entry#hashCode()
- */
- int hashCode();
-
- /**
- * Returns true if the map contains no mappings.
- *
- * @return true if the map is empty
- */
- boolean isEmpty();
-
- /**
- * Returns a set view of the keys in this Map. The set is backed by the
- * map, so that changes in one show up in the other. Modifications made
- * while an iterator is in progress cause undefined behavior. If the set
- * supports removal, these methods remove the underlying mapping from
- * the map: <code>Iterator.remove</code>, <code>Set.remove</code>,
- * <code>removeAll</code>, <code>retainAll</code>, and <code>clear</code>.
- * Element addition, via <code>add</code> or <code>addAll</code>, is
- * not supported via this set.
- *
- * @return the set view of all keys
- */
- Set keySet();
-
- /**
- * Copies all entries of the given map to this one (optional operation). If
- * the map already contains a key, its value is replaced.
- *
- * @param m the mapping to load into this map
- * @throws UnsupportedOperationException if the operation is not supported
- * @throws ClassCastException if a key or value is of the wrong type
- * @throws IllegalArgumentException if something about a key or value
- * prevents it from existing in this map
- * @throws NullPointerException if the map forbids null keys or values, or
- * if <code>m</code> is null.
- * @see #put(Object, Object)
- */
- void putAll(Map m);
-
- /**
- * Removes the mapping for this key if present (optional operation). If
- * the key is not present, this returns null. Note that maps which permit
- * null values may also return null if the key was removed.
- *
- * @param key the key to remove
- * @return the value the key mapped to, or null if not present.
- * @throws UnsupportedOperationException if deletion is unsupported
- * @throws NullPointerException if the key is null and this map doesn't
- * support null keys.
- * @throws ClassCastException if the type of the key is not a valid type
- * for this map.
- */
- Object remove(Object key);
-
- /**
- * Returns the number of key-value mappings in the map. If there are more
- * than Integer.MAX_VALUE mappings, return Integer.MAX_VALUE.
- *
- * @return the number of mappings
- */
- int size();
-
- /**
- * Returns a collection (or bag) view of the values in this Map. The
- * collection is backed by the map, so that changes in one show up in
- * the other. Modifications made while an iterator is in progress cause
- * undefined behavior. If the collection supports removal, these methods
- * remove the underlying mapping from the map: <code>Iterator.remove</code>,
- * <code>Collection.remove</code>, <code>removeAll</code>,
- * <code>retainAll</code>, and <code>clear</code>. Element addition, via
- * <code>add</code> or <code>addAll</code>, is not supported via this
- * collection.
- *
- * @return the collection view of all values
- */
- Collection values();
-
- /**
- * A map entry (key-value pair). The Map.entrySet() method returns a set
- * view of these objects; there is no other valid way to come across them.
- * These objects are only valid for the duration of an iteration; in other
- * words, if you mess with one after modifying the map, you are asking
- * for undefined behavior.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Map
- * @see Map#entrySet()
- * @since 1.2
- * @status updated to 1.4
- */
- interface Entry
- {
- /**
- * Get the key corresponding to this entry.
- *
- * @return the key
- */
- Object getKey();
-
- /**
- * Get the value corresponding to this entry. If you already called
- * Iterator.remove(), this is undefined.
- *
- * @return the value
- */
- Object getValue();
-
- /**
- * Replaces the value with the specified object (optional operation).
- * This writes through to the map, and is undefined if you already
- * called Iterator.remove().
- *
- * @param value the new value to store
- * @return the old value
- * @throws UnsupportedOperationException if the operation is not supported
- * @throws ClassCastException if the value is of the wrong type
- * @throws IllegalArgumentException if something about the value
- * prevents it from existing in this map
- * @throws NullPointerException if the map forbids null values
- */
- Object setValue(Object value);
-
-
- /**
- * Returns the hash code of the entry. This is defined as the
- * exclusive-or of the hashcodes of the key and value (using 0 for
- * <code>null</code>). In other words, this must be:
- *
-<p><pre>(getKey() == null ? 0 : getKey().hashCode())
-^ (getValue() == null ? 0 : getValue().hashCode())</pre>
- *
- * @return the hash code
- */
- int hashCode();
-
- /**
- * Compares the specified object with this entry. Returns true only if
- * the object is a mapping of identical key and value. In other words,
- * this must be:
- *
-<p><pre>(o instanceof Map.Entry)
-&& (getKey() == null ? ((HashMap) o).getKey() == null
- : getKey().equals(((HashMap) o).getKey()))
-&& (getValue() == null ? ((HashMap) o).getValue() == null
- : getValue().equals(((HashMap) o).getValue()))</pre>
- *
- * @param o the object to compare
- *
- * @return <code>true</code> if it is equal
- */
- boolean equals(Object o);
- }
-}
diff --git a/libjava/java/util/MissingResourceException.java b/libjava/java/util/MissingResourceException.java
deleted file mode 100644
index 26640de90df..00000000000
--- a/libjava/java/util/MissingResourceException.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/* MissingResourceException.java -- thrown for a missing resource
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * This exception is thrown when a resource is missing.
- *
- * @author Jochen Hoenicke
- * @author Warren Levy (warrenl@cygnus.com)
- * @see ResourceBundle
- * @since 1.1
- * @status updated to 1.4
- */
-public class MissingResourceException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -4876345176062000401L;
-
- /**
- * The name of the resource bundle requested by user.
- *
- * @serial the class name of the resource bundle
- */
- private final String className;
-
- /**
- * The key of the resource in the bundle requested by user.
- *
- * @serial the name of the resouce
- */
- private final String key;
-
- /**
- * Creates a new exception, with the specified parameters.
- *
- * @param s the detail message
- * @param className the name of the resource bundle
- * @param key the key of the missing resource
- */
- public MissingResourceException(String s, String className, String key)
- {
- super(s);
- this.className = className;
- this.key = key;
- }
-
- /**
- * Gets the name of the resource bundle, for which a resource is missing.
- *
- * @return the name of the resource bundle
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Gets the key of the resource that is missing bundle, this is an empty
- * string if the whole resource bundle is missing.
- *
- * @return the name of the resource bundle
- */
- public String getKey()
- {
- return key;
- }
-}
diff --git a/libjava/java/util/NoSuchElementException.java b/libjava/java/util/NoSuchElementException.java
deleted file mode 100644
index 5e1a2176d62..00000000000
--- a/libjava/java/util/NoSuchElementException.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* NoSuchElementException.java -- Attempt to access element that does not exist
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- */
-
-/**
- * Exception thrown when an attempt is made to access an element that does not
- * exist. This exception is thrown by the Enumeration, Iterator and
- * ListIterator classes if the nextElement, next or previous method goes
- * beyond the end of the list of elements that are being accessed. It is also
- * thrown by Vector and Stack when attempting to access the first or last
- * element of an empty collection.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Enumeration
- * @see Iterator
- * @see ListIterator
- * @see Enumeration#nextElement()
- * @see Iterator#next()
- * @see ListIterator#previous()
- * @since 1.0
- * @status updated to 1.4
- */
-public class NoSuchElementException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0.
- */
- private static final long serialVersionUID = 6769829250639411880L;
-
- /**
- * Constructs a NoSuchElementException with no detail message.
- */
- public NoSuchElementException()
- {
- }
-
- /**
- * Constructs a NoSuchElementException with a detail message.
- *
- * @param detail the detail message for the exception
- */
- public NoSuchElementException(String detail)
- {
- super(detail);
- }
-}
diff --git a/libjava/java/util/Observable.java b/libjava/java/util/Observable.java
deleted file mode 100644
index 4c2cddb5496..00000000000
--- a/libjava/java/util/Observable.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/* Observable.java -- an object to be observed
- Copyright (C) 1999, 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * This class represents an object which is observable. Other objects may
- * register their intent to be notified when this object changes; and when
- * this object does change, it will trigger the <code>update</code> method
- * of each observer.
- *
- * Note that the <code>notifyObservers()</code> method of this class is
- * unrelated to the <code>notify()</code> of Object.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Observer
- * @status updated to 1.4
- */
-public class Observable
-{
- /** Tracks whether this object has changed. */
- private boolean changed;
-
- /* List of the Observers registered as interested in this Observable. */
- private LinkedHashSet observers;
-
- /**
- * Constructs an Observable with zero Observers.
- */
- public Observable()
- {
- observers = new LinkedHashSet();
- }
-
- /**
- * Adds an Observer. If the observer was already added this method does
- * nothing.
- *
- * @param observer Observer to add
- * @throws NullPointerException if observer is null
- */
- public synchronized void addObserver(Observer observer)
- {
- observers.add(observer);
- }
-
- /**
- * Reset this Observable's state to unchanged. This is called automatically
- * by <code>notifyObservers</code> once all observers have been notified.
- *
- * @see #notifyObservers()
- */
- protected synchronized void clearChanged()
- {
- changed = false;
- }
-
- /**
- * Returns the number of observers for this object.
- *
- * @return number of Observers for this
- */
- public synchronized int countObservers()
- {
- return observers.size();
- }
-
- /**
- * Deletes an Observer of this Observable.
- *
- * @param victim Observer to delete
- */
- public synchronized void deleteObserver(Observer victim)
- {
- observers.remove(victim);
- }
-
- /**
- * Deletes all Observers of this Observable.
- */
- public synchronized void deleteObservers()
- {
- observers.clear();
- }
-
- /**
- * True if <code>setChanged</code> has been called more recently than
- * <code>clearChanged</code>.
- *
- * @return whether or not this Observable has changed
- */
- public synchronized boolean hasChanged()
- {
- return changed;
- }
-
- /**
- * If the Observable has actually changed then tell all Observers about it,
- * then reset state to unchanged.
- *
- * @see #notifyObservers(Object)
- * @see Observer#update(Observable, Object)
- */
- public void notifyObservers()
- {
- notifyObservers(null);
- }
-
- /**
- * If the Observable has actually changed then tell all Observers about it,
- * then reset state to unchanged. Note that though the order of
- * notification is unspecified in subclasses, in Observable it is in the
- * order of registration.
- *
- * @param obj argument to Observer's update method
- * @see Observer#update(Observable, Object)
- */
- public void notifyObservers(Object obj)
- {
- if (! hasChanged())
- return;
- // Create clone inside monitor, as that is relatively fast and still
- // important to keep threadsafe, but update observers outside of the
- // lock since update() can call arbitrary code.
- Set s;
- synchronized (this)
- {
- s = (Set) observers.clone();
- }
- int i = s.size();
- Iterator iter = s.iterator();
- while (--i >= 0)
- ((Observer) iter.next()).update(this, obj);
- clearChanged();
- }
-
- /**
- * Marks this Observable as having changed.
- */
- protected synchronized void setChanged()
- {
- changed = true;
- }
-}
diff --git a/libjava/java/util/Observer.java b/libjava/java/util/Observer.java
deleted file mode 100644
index c59a0ca6c68..00000000000
--- a/libjava/java/util/Observer.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Observer.java -- an object that will be informed of changes in an Observable
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * Interface that is implemented when a class wants to be informed of changes
- * in Observable objects.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @see Observable
- * @status updated to 1.4
- */
-public interface Observer
-{
- /**
- * This method is called whenever the observable object changes, and has
- * called <code>notifyObservers</code>. The Observable object can pass
- * arbitrary information in the second parameter.
- *
- * @param observable the Observable object that changed
- * @param arg arbitrary information, usually relating to the change
- */
- void update(Observable observable, Object arg);
-}
diff --git a/libjava/java/util/Properties.java b/libjava/java/util/Properties.java
deleted file mode 100644
index dd442fc396f..00000000000
--- a/libjava/java/util/Properties.java
+++ /dev/null
@@ -1,574 +0,0 @@
-/* Properties.java -- a set of persistent properties
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-/**
- * A set of persistent properties, which can be saved or loaded from a stream.
- * A property list may also contain defaults, searched if the main list
- * does not contain a property for a given key.
- *
- * An example of a properties file for the german language is given
- * here. This extends the example given in ListResourceBundle.
- * Create a file MyResource_de.properties with the following contents
- * and put it in the CLASSPATH. (The character
- * <code>\</code><code>u00e4</code> is the german umlaut)
- *
- *
-<pre>s1=3
-s2=MeineDisk
-s3=3. M\<code></code>u00e4rz 96
-s4=Die Diskette ''{1}'' enth\<code></code>u00e4lt {0} in {2}.
-s5=0
-s6=keine Dateien
-s7=1
-s8=eine Datei
-s9=2
-s10={0,number} Dateien
-s11=Das Formatieren schlug fehl mit folgender Exception: {0}
-s12=FEHLER
-s13=Ergebnis
-s14=Dialog
-s15=Auswahlkriterium
-s16=1,3</pre>
- *
- * <p>Although this is a sub class of a hash table, you should never
- * insert anything other than strings to this property, or several
- * methods, that need string keys and values, will fail. To ensure
- * this, you should use the <code>get/setProperty</code> method instead
- * of <code>get/put</code>.
- *
- * Properties are saved in ISO 8859-1 encoding, using Unicode escapes with
- * a single <code>u</code> for any character which cannot be represented.
- *
- * @author Jochen Hoenicke
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see PropertyResourceBundle
- * @status updated to 1.4
- */
-public class Properties extends Hashtable
-{
- // WARNING: Properties is a CORE class in the bootstrap cycle. See the
- // comments in vm/reference/java/lang/Runtime for implications of this fact.
-
- /**
- * The property list that contains default values for any keys not
- * in this property list.
- *
- * @serial the default properties
- */
- protected Properties defaults;
-
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 4112578634029874840L;
-
- /**
- * Creates a new empty property list with no default values.
- */
- public Properties()
- {
- }
-
- /**
- * Create a new empty property list with the specified default values.
- *
- * @param defaults a Properties object containing the default values
- */
- public Properties(Properties defaults)
- {
- this.defaults = defaults;
- }
-
- /**
- * Adds the given key/value pair to this properties. This calls
- * the hashtable method put.
- *
- * @param key the key for this property
- * @param value the value for this property
- * @return The old value for the given key
- * @see #getProperty(String)
- * @since 1.2
- */
- public Object setProperty(String key, String value)
- {
- return put(key, value);
- }
-
- /**
- * Reads a property list from an input stream. The stream should
- * have the following format: <br>
- *
- * An empty line or a line starting with <code>#</code> or
- * <code>!</code> is ignored. An backslash (<code>\</code>) at the
- * end of the line makes the line continueing on the next line
- * (but make sure there is no whitespace after the backslash).
- * Otherwise, each line describes a key/value pair. <br>
- *
- * The chars up to the first whitespace, = or : are the key. You
- * can include this caracters in the key, if you precede them with
- * a backslash (<code>\</code>). The key is followed by optional
- * whitespaces, optionally one <code>=</code> or <code>:</code>,
- * and optionally some more whitespaces. The rest of the line is
- * the resource belonging to the key. <br>
- *
- * Escape sequences <code>\t, \n, \r, \\, \", \', \!, \#, \ </code>(a
- * space), and unicode characters with the
- * <code>\\u</code><em>xxxx</em> notation are detected, and
- * converted to the corresponding single character. <br>
- *
- *
-<pre># This is a comment
-key = value
-k\:5 \ a string starting with space and ending with newline\n
-# This is a multiline specification; note that the value contains
-# no white space.
-weekdays: Sunday,Monday,Tuesday,Wednesday,\\
- Thursday,Friday,Saturday
-# The safest way to include a space at the end of a value:
-label = Name:\\u0020</pre>
- *
- * @param in the input stream
- * @throws IOException if an error occurred when reading the input
- * @throws NullPointerException if in is null
- */
- public void load(InputStream inStream) throws IOException
- {
- // The spec says that the file must be encoded using ISO-8859-1.
- BufferedReader reader =
- new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1"));
- String line;
-
- while ((line = reader.readLine()) != null)
- {
- char c = 0;
- int pos = 0;
- // Leading whitespaces must be deleted first.
- while (pos < line.length()
- && Character.isWhitespace(c = line.charAt(pos)))
- pos++;
-
- // If empty line or begins with a comment character, skip this line.
- if ((line.length() - pos) == 0
- || line.charAt(pos) == '#' || line.charAt(pos) == '!')
- continue;
-
- // The characters up to the next Whitespace, ':', or '='
- // describe the key. But look for escape sequences.
- StringBuffer key = new StringBuffer();
- while (pos < line.length()
- && ! Character.isWhitespace(c = line.charAt(pos++))
- && c != '=' && c != ':')
- {
- if (c == '\\')
- {
- if (pos == line.length())
- {
- // The line continues on the next line.
- line = reader.readLine();
- pos = 0;
- while (pos < line.length()
- && Character.isWhitespace(c = line.charAt(pos)))
- pos++;
- }
- else
- {
- c = line.charAt(pos++);
- switch (c)
- {
- case 'n':
- key.append('\n');
- break;
- case 't':
- key.append('\t');
- break;
- case 'r':
- key.append('\r');
- break;
- case 'u':
- if (pos + 4 <= line.length())
- {
- char uni = (char) Integer.parseInt
- (line.substring(pos, pos + 4), 16);
- key.append(uni);
- pos += 4;
- } // else throw exception?
- break;
- default:
- key.append(c);
- break;
- }
- }
- }
- else
- key.append(c);
- }
-
- boolean isDelim = (c == ':' || c == '=');
- while (pos < line.length()
- && Character.isWhitespace(c = line.charAt(pos)))
- pos++;
-
- if (! isDelim && (c == ':' || c == '='))
- {
- pos++;
- while (pos < line.length()
- && Character.isWhitespace(c = line.charAt(pos)))
- pos++;
- }
-
- StringBuffer element = new StringBuffer(line.length() - pos);
- while (pos < line.length())
- {
- c = line.charAt(pos++);
- if (c == '\\')
- {
- if (pos == line.length())
- {
- // The line continues on the next line.
- line = reader.readLine();
-
- // We might have seen a backslash at the end of
- // the file. The JDK ignores the backslash in
- // this case, so we follow for compatibility.
- if (line == null)
- break;
-
- pos = 0;
- while (pos < line.length()
- && Character.isWhitespace(c = line.charAt(pos)))
- pos++;
- element.ensureCapacity(line.length() - pos +
- element.length());
- }
- else
- {
- c = line.charAt(pos++);
- switch (c)
- {
- case 'n':
- element.append('\n');
- break;
- case 't':
- element.append('\t');
- break;
- case 'r':
- element.append('\r');
- break;
- case 'u':
- if (pos + 4 <= line.length())
- {
- char uni = (char) Integer.parseInt
- (line.substring(pos, pos + 4), 16);
- element.append(uni);
- pos += 4;
- } // else throw exception?
- break;
- default:
- element.append(c);
- break;
- }
- }
- }
- else
- element.append(c);
- }
- put(key.toString(), element.toString());
- }
- }
-
- /**
- * Calls <code>store(OutputStream out, String header)</code> and
- * ignores the IOException that may be thrown.
- *
- * @param out the stream to write to
- * @param header a description of the property list
- * @throws ClassCastException if this property contains any key or
- * value that are not strings
- * @deprecated use {@link #store(OutputStream, String)} instead
- */
- public void save(OutputStream out, String header)
- {
- try
- {
- store(out, header);
- }
- catch (IOException ex)
- {
- }
- }
-
- /**
- * Writes the key/value pairs to the given output stream, in a format
- * suitable for <code>load</code>.<br>
- *
- * If header is not null, this method writes a comment containing
- * the header as first line to the stream. The next line (or first
- * line if header is null) contains a comment with the current date.
- * Afterwards the key/value pairs are written to the stream in the
- * following format.<br>
- *
- * Each line has the form <code>key = value</code>. Newlines,
- * Returns and tabs are written as <code>\n,\t,\r</code> resp.
- * The characters <code>\, !, #, =</code> and <code>:</code> are
- * preceeded by a backslash. Spaces are preceded with a backslash,
- * if and only if they are at the beginning of the key. Characters
- * that are not in the ascii range 33 to 127 are written in the
- * <code>\</code><code>u</code>xxxx Form.<br>
- *
- * Following the listing, the output stream is flushed but left open.
- *
- * @param out the output stream
- * @param header the header written in the first line, may be null
- * @throws ClassCastException if this property contains any key or
- * value that isn't a string
- * @throws IOException if writing to the stream fails
- * @throws NullPointerException if out is null
- * @since 1.2
- */
- public void store(OutputStream out, String header) throws IOException
- {
- // The spec says that the file must be encoded using ISO-8859-1.
- PrintWriter writer
- = new PrintWriter(new OutputStreamWriter(out, "ISO-8859-1"));
- if (header != null)
- writer.println("#" + header);
- writer.println ("#" + Calendar.getInstance ().getTime ());
-
- Iterator iter = entrySet ().iterator ();
- int i = size ();
- StringBuffer s = new StringBuffer (); // Reuse the same buffer.
- while (--i >= 0)
- {
- Map.Entry entry = (Map.Entry) iter.next ();
- formatForOutput ((String) entry.getKey (), s, true);
- s.append ('=');
- formatForOutput ((String) entry.getValue (), s, false);
- writer.println (s);
- }
-
- writer.flush ();
- }
-
- /**
- * Gets the property with the specified key in this property list.
- * If the key is not found, the default property list is searched.
- * If the property is not found in the default, null is returned.
- *
- * @param key The key for this property
- * @return the value for the given key, or null if not found
- * @throws ClassCastException if this property contains any key or
- * value that isn't a string
- * @see #defaults
- * @see #setProperty(String, String)
- * @see #getProperty(String, String)
- */
- public String getProperty(String key)
- {
- return getProperty(key, null);
- }
-
- /**
- * Gets the property with the specified key in this property list. If
- * the key is not found, the default property list is searched. If the
- * property is not found in the default, the specified defaultValue is
- * returned.
- *
- * @param key The key for this property
- * @param defaultValue A default value
- * @return The value for the given key
- * @throws ClassCastException if this property contains any key or
- * value that isn't a string
- * @see #defaults
- * @see #setProperty(String, String)
- */
- public String getProperty(String key, String defaultValue)
- {
- Properties prop = this;
- // Eliminate tail recursion.
- do
- {
- String value = (String) prop.get(key);
- if (value != null)
- return value;
- prop = prop.defaults;
- }
- while (prop != null);
- return defaultValue;
- }
-
- /**
- * Returns an enumeration of all keys in this property list, including
- * the keys in the default property list.
- *
- * @return an Enumeration of all defined keys
- */
- public Enumeration propertyNames()
- {
- // We make a new Set that holds all the keys, then return an enumeration
- // for that. This prevents modifications from ruining the enumeration,
- // as well as ignoring duplicates.
- Properties prop = this;
- Set s = new HashSet();
- // Eliminate tail recursion.
- do
- {
- s.addAll(prop.keySet());
- prop = prop.defaults;
- }
- while (prop != null);
- return Collections.enumeration(s);
- }
-
- /**
- * Prints the key/value pairs to the given print stream. This is
- * mainly useful for debugging purposes.
- *
- * @param out the print stream, where the key/value pairs are written to
- * @throws ClassCastException if this property contains a key or a
- * value that isn't a string
- * @see #list(PrintWriter)
- */
- public void list(PrintStream out)
- {
- PrintWriter writer = new PrintWriter (out);
- list (writer);
- }
-
- /**
- * Prints the key/value pairs to the given print writer. This is
- * mainly useful for debugging purposes.
- *
- * @param out the print writer where the key/value pairs are written to
- * @throws ClassCastException if this property contains a key or a
- * value that isn't a string
- * @see #list(PrintStream)
- * @since 1.1
- */
- public void list(PrintWriter out)
- {
- out.println ("-- listing properties --");
-
- Iterator iter = entrySet ().iterator ();
- int i = size ();
- while (--i >= 0)
- {
- Map.Entry entry = (Map.Entry) iter.next ();
- out.print ((String) entry.getKey () + "=");
-
- // JDK 1.3/1.4 restrict the printed value, but not the key,
- // to 40 characters, including the truncating ellipsis.
- String s = (String ) entry.getValue ();
- if (s != null && s.length () > 40)
- out.println (s.substring (0, 37) + "...");
- else
- out.println (s);
- }
- out.flush ();
- }
-
- /**
- * Formats a key or value for output in a properties file.
- * See store for a description of the format.
- *
- * @param str the string to format
- * @param buffer the buffer to add it to
- * @param key true if all ' ' must be escaped for the key, false if only
- * leading spaces must be escaped for the value
- * @see #store(OutputStream, String)
- */
- private void formatForOutput(String str, StringBuffer buffer, boolean key)
- {
- if (key)
- {
- buffer.setLength(0);
- buffer.ensureCapacity(str.length());
- }
- else
- buffer.ensureCapacity(buffer.length() + str.length());
- boolean head = true;
- int size = str.length();
- for (int i = 0; i < size; i++)
- {
- char c = str.charAt(i);
- switch (c)
- {
- case '\n':
- buffer.append("\\n");
- break;
- case '\r':
- buffer.append("\\r");
- break;
- case '\t':
- buffer.append("\\t");
- break;
- case ' ':
- buffer.append(head ? "\\ " : " ");
- break;
- case '\\':
- case '!':
- case '#':
- case '=':
- case ':':
- buffer.append('\\').append(c);
- break;
- default:
- if (c < ' ' || c > '~')
- {
- String hex = Integer.toHexString(c);
- buffer.append("\\u0000".substring(0, 6 - hex.length()));
- buffer.append(hex);
- }
- else
- buffer.append(c);
- }
- if (c != ' ')
- head = key;
- }
- }
-} // class Properties
diff --git a/libjava/java/util/PropertyPermission.java b/libjava/java/util/PropertyPermission.java
deleted file mode 100644
index d1bdbd1d058..00000000000
--- a/libjava/java/util/PropertyPermission.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/* PropertyPermission.java -- permission to get and set System properties
- Copyright (C) 1999, 2000, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
-import java.security.BasicPermission;
-import java.security.Permission;
-import java.security.PermissionCollection;
-
-/**
- * This class represents the permission to access and modify a property.<br>
- *
- * The name is the name of the property, e.g. xxx. You can also
- * use an asterisk "*" as described in BasicPermission.<br>
- *
- * The action string is a comma-separated list of keywords. There are
- * two possible actions:
- * <dl>
- * <dt>read</dt>
- * <dd>Allows to read the property via <code>System.getProperty</code>.</dd>
- * <dt>write</dt>
- * <dd>Allows to write the property via <code>System.setProperty</code>.</dd>
- * </dl>
- *
- * The action string is case insensitive (it is converted to lower case).
- *
- * @see Permission
- * @see BasicPermission
- * @see SecurityManager
- * @author Jochen Hoenicke
- * @since 1.2
- * @status updated to 1.4
- */
-public final class PropertyPermission extends BasicPermission
-{
- /**
- * PropertyPermission uses a more efficient representation than the
- * serialized form; this documents the difference.
- *
- * @serialField action String the action string
- */
- private static final ObjectStreamField[] serialPersistentFields =
- {
- new ObjectStreamField("action", String.class)
- };
-
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 885438825399942851L;
-
- /** Permission to read. */
- private static final int READ = 1;
- /** Permission to write. */
- private static final int WRITE = 2;
-
- /** The set of actions permitted. */
- // Package visible for use by PropertyPermissionCollection.
- transient int actions;
-
- /**
- * The String forms of the actions permitted.
- */
- private static final String actionStrings[] =
- {
- "", "read", "write", "read,write"
- };
-
- /**
- * Constructs a PropertyPermission with the specified property. Possible
- * actions are read and write, comma-separated and case-insensitive.
- *
- * @param name the name of the property
- * @param actions the action string
- * @throws NullPointerException if name is null
- * @throws IllegalArgumentException if name string contains an
- * illegal wildcard or actions string contains an illegal action
- * (this includes a null actions string)
- */
- public PropertyPermission(String name, String actions)
- {
- super(name);
- if (actions == null)
- throw new IllegalArgumentException();
- setActions(actions);
- }
-
- /**
- * Parse the action string and convert actions from external to internal
- * form. This will set the internal actions field.
- *
- * @param str the action string
- * @throws IllegalArgumentException if actions string contains an
- * illegal action
- */
- private void setActions(String str)
- {
- // Initialising the class java.util.Locale ...
- // tries to initialise the Locale.defaultLocale static
- // which calls System.getProperty,
- // which calls SecurityManager.checkPropertiesAccess,
- // which creates a PropertyPermission with action "read,write",
- // which calls setActions("read,write").
- // If we now were to call toLowerCase on 'str',
- // this would call Locale.getDefault() which returns null
- // because Locale.defaultLocale hasn't been set yet
- // then toLowerCase will fail with a null pointer exception.
- //
- // The solution is to take a punt on 'str' being lower case, and
- // test accordingly. If that fails, we convert 'str' to lower case
- // and try the tests again.
- if ("read".equals(str))
- actions = READ;
- else if ("write".equals(str))
- actions = WRITE;
- else if ("read,write".equals(str) || "write,read".equals(str))
- actions = READ | WRITE;
- else
- {
- String lstr = str.toLowerCase();
- if ("read".equals(lstr))
- actions = READ;
- else if ("write".equals(lstr))
- actions = WRITE;
- else if ("read,write".equals(lstr) || "write,read".equals(lstr))
- actions = READ | WRITE;
- else
- throw new IllegalArgumentException("illegal action " + str);
- }
- }
-
- /**
- * Reads an object from the stream. This converts the external to the
- * internal representation.
- *
- * @param s the stream to read from
- * @throws IOException if the stream fails
- * @throws ClassNotFoundException if reserialization fails
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- ObjectInputStream.GetField fields = s.readFields();
- setActions((String) fields.get("actions", null));
- }
-
- /**
- * Writes an object to the stream. This converts the internal to the
- * external representation.
- *
- * @param s the stram to write to
- * @throws IOException if the stream fails
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- ObjectOutputStream.PutField fields = s.putFields();
- fields.put("actions", getActions());
- s.writeFields();
- }
-
- /**
- * Check if this permission implies p. This returns true iff all of
- * the following conditions are true:
- * <ul>
- * <li> p is a PropertyPermission </li>
- * <li> this.getName() implies p.getName(),
- * e.g. <code>java.*</code> implies <code>java.home</code> </li>
- * <li> this.getActions is a subset of p.getActions </li>
- * </ul>
- *
- * @param p the permission to check
- * @return true if this permission implies p
- */
- public boolean implies(Permission p)
- {
- // BasicPermission checks for name and type.
- if (super.implies(p))
- {
- // We have to check the actions.
- PropertyPermission pp = (PropertyPermission) p;
- return (pp.actions & ~actions) == 0;
- }
- return false;
- }
-
- /**
- * Check to see whether this object is the same as another
- * PropertyPermission object; this is true if it has the same name and
- * actions.
- *
- * @param obj the other object
- * @return true if the two are equivalent
- */
- public boolean equals(Object obj)
- {
- return super.equals(obj) && actions == ((PropertyPermission) obj).actions;
- }
-
- /**
- * Returns the hash code for this permission. It is equivalent to
- * <code>getName().hashCode()</code>.
- *
- * @return the hash code
- */
- public int hashCode()
- {
- return super.hashCode();
- }
-
- /**
- * Returns the action string. Note that this may differ from the string
- * given at the constructor: The actions are converted to lowercase and
- * may be reordered.
- *
- * @return one of "read", "write", or "read,write"
- */
- public String getActions()
- {
- return actionStrings[actions];
- }
-
- /**
- * Returns a permission collection suitable to take
- * PropertyPermission objects.
- *
- * @return a new empty PermissionCollection
- */
- public PermissionCollection newPermissionCollection()
- {
- return new PropertyPermissionCollection();
- }
-}
diff --git a/libjava/java/util/PropertyPermissionCollection.java b/libjava/java/util/PropertyPermissionCollection.java
deleted file mode 100644
index c95fa4e66bf..00000000000
--- a/libjava/java/util/PropertyPermissionCollection.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/* PropertyPermissionCollection.java -- a collection of PropertyPermissions
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.security.Permission;
-import java.security.PermissionCollection;
-
-/**
- * This class provides the implementation for
- * <code>PropertyPermission.newPermissionCollection()</code>. It only accepts
- * PropertyPermissions, and correctly implements <code>implies</code>. It
- * is synchronized, as specified in the superclass.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @status an undocumented class, but this matches Sun's serialization
- */
-class PropertyPermissionCollection extends PermissionCollection
-{
- /**
- * Compatible with JDK 1.4.
- */
- private static final long serialVersionUID = 7015263904581634791L;
-
- /**
- * The permissions.
- *
- * @serial the table of permissions in the collection
- */
- private final Hashtable permissions = new Hashtable();
-
- /**
- * A flag to detect if "*" is in the collection.
- *
- * @serial true if "*" is in the collection
- */
- private boolean all_allowed;
-
- /**
- * Adds a PropertyPermission to this collection.
- *
- * @param permission the permission to add
- * @throws IllegalArgumentException if permission is not a PropertyPermission
- * @throws SecurityException if collection is read-only
- */
- public void add(Permission permission)
- {
- if (isReadOnly())
- throw new SecurityException("readonly");
- if (! (permission instanceof PropertyPermission))
- throw new IllegalArgumentException();
- PropertyPermission pp = (PropertyPermission) permission;
- String name = pp.getName();
- if (name.equals("*"))
- all_allowed = true;
- PropertyPermission old = (PropertyPermission) permissions.get(name);
- if (old != null)
- {
- if ((pp.actions | old.actions) == old.actions)
- pp = old; // Old implies pp.
- else if ((pp.actions | old.actions) != pp.actions)
- // Here pp doesn't imply old; the only case left is both actions.
- pp = new PropertyPermission(name, "read,write");
- }
- permissions.put(name, pp);
- }
-
- /**
- * Returns true if this collection implies the given permission. This even
- * returns true for this case:
- *
- * <pre>
- * collection.add(new PropertyPermission("a.*", "read"));
- * collection.add(new PropertyPermission("a.b.*", "write"));
- * collection.implies(new PropertyPermission("a.b.c", "read,write"));
- * </pre>
- *
- * @param permission the permission to check
- * @return true if it is implied by this
- */
- public boolean implies(Permission permission)
- {
- if (! (permission instanceof PropertyPermission))
- return false;
- PropertyPermission toImply = (PropertyPermission) permission;
- int actions = toImply.actions;
-
- if (all_allowed)
- {
- int all_actions = ((PropertyPermission) permissions.get("*")).actions;
- actions &= ~all_actions;
- if (actions == 0)
- return true;
- }
-
- String name = toImply.getName();
- if (name.equals("*"))
- return false;
-
- int prefixLength = name.length();
- if (name.endsWith("*"))
- prefixLength -= 2;
-
- while (true)
- {
- PropertyPermission forName =
- (PropertyPermission) permissions.get(name);
- if (forName != null)
- {
- actions &= ~forName.actions;
- if (actions == 0)
- return true;
- }
-
- prefixLength = name.lastIndexOf('.', prefixLength - 1);
- if (prefixLength < 0)
- return false;
- name = name.substring(0, prefixLength + 1) + '*';
- }
- }
-
- /**
- * Enumerate over the collection.
- *
- * @return an enumeration of the collection contents
- */
- public Enumeration elements()
- {
- return permissions.elements();
- }
-}
diff --git a/libjava/java/util/PropertyResourceBundle.java b/libjava/java/util/PropertyResourceBundle.java
deleted file mode 100644
index 86318654719..00000000000
--- a/libjava/java/util/PropertyResourceBundle.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/* PropertyResourceBundle -- a resource bundle built from a Property file
- Copyright (C) 1998, 1999, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * This class is a concrete <code>ResourceBundle</code> that gets it
- * resources from a property file. This implies that the resources are
- * strings. For more information about resource bundles see the class
- * <code>ResourceBundle</code>.
- *
- * You should not use this class directly, or subclass it, but you get
- * an object of this class automatically when you call
- * <code>ResourceBundle.getBundle()</code> and there is a properties
- * file.
- *
- * If there is also a class for this resource and the same locale, the
- * class will be chosen. The properties file should have the name of the
- * resource bundle, appended with the locale (e.g. <code>_de</code> and the
- * extension <code>.properties</code>. The file should have the same format
- * as for <code>Properties.load()</code>
- *
- * An example of a properties file for the german language is given
- * here. This extends the example given in ListResourceBundle.
- * Create a file MyResource_de.properties with the following contents
- * and put it in the CLASSPATH. (The char <code>\u00e4</code> is the
- * german umlaut)
- *
- *
-<pre>
-s1=3
-s2=MeineDisk
-s3=3. M\u00e4rz 96
-s4=Die Diskette ''{1}'' enth\u00e4lt {0} in {2}.
-s5=0
-s6=keine Dateien
-s7=1
-s8=eine Datei
-s9=2
-s10={0,number} Dateien
-s11=Die Formatierung warf eine Exception: {0}
-s12=FEHLER
-s13=Ergebnis
-s14=Dialog
-s15=Auswahlkriterium
-s16=1,3
-</pre>
- *
- * @author Jochen Hoenicke
- * @see ResourceBundle
- * @see ListResourceBundle
- * @see Properties#load()
- * @since 1.1
- * @status updated to 1.4
- */
-public class PropertyResourceBundle extends ResourceBundle
-{
- /** The properties file this bundle is based on. */
- private Properties properties;
-
- /**
- * Creates a new property resource bundle.
- *
- * @param stream an input stream, where the resources are read from
- * @throws NullPointerException if stream is null
- * @throws IOException if reading the stream fails
- */
- public PropertyResourceBundle(InputStream stream) throws IOException
- {
- properties = new Properties();
- properties.load(stream);
- }
-
- /**
- * Called by <code>getObject</code> when a resource is needed. This
- * returns the resource given by the key.
- *
- * @param key the key of the resource
- * @return the resource for the key, or null if it doesn't exist
- */
- public Object handleGetObject(String key)
- {
- return properties.getProperty(key);
- }
-
- /**
- * This method should return all keys for which a resource exists.
- *
- * @return an enumeration of the keys
- */
- public Enumeration getKeys()
- {
- if (parent == null)
- return properties.propertyNames();
- // We make a new Set that holds all the keys, then return an enumeration
- // for that. This prevents modifications from ruining the enumeration,
- // as well as ignoring duplicates.
- Set s = new HashSet();
- Enumeration e = properties.propertyNames();
- while (e.hasMoreElements())
- s.add(e.nextElement());
- ResourceBundle bundle = parent;
- // Eliminate tail recursion.
- do
- {
- e = bundle.getKeys();
- while (e.hasMoreElements())
- s.add(e.nextElement());
- bundle = bundle.parent;
- }
- while (bundle != null);
- return Collections.enumeration(s);
- }
-} // class PropertyResourceBundle
diff --git a/libjava/java/util/Random.java b/libjava/java/util/Random.java
deleted file mode 100644
index bc005075140..00000000000
--- a/libjava/java/util/Random.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/* Random.java -- a pseudo-random number generator
- Copyright (C) 1998, 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.Serializable;
-
-/**
- * This class generates pseudorandom numbers. It uses the same
- * algorithm as the original JDK-class, so that your programs behave
- * exactly the same way, if started with the same seed.
- *
- * The algorithm is described in <em>The Art of Computer Programming,
- * Volume 2</em> by Donald Knuth in Section 3.2.1. It is a 48-bit seed,
- * linear congruential formula.
- *
- * If two instances of this class are created with the same seed and
- * the same calls to these classes are made, they behave exactly the
- * same way. This should be even true for foreign implementations
- * (like this), so every port must use the same algorithm as described
- * here.
- *
- * If you want to implement your own pseudorandom algorithm, you
- * should extend this class and overload the <code>next()</code> and
- * <code>setSeed(long)</code> method. In that case the above
- * paragraph doesn't apply to you.
- *
- * This class shouldn't be used for security sensitive purposes (like
- * generating passwords or encryption keys. See <code>SecureRandom</code>
- * in package <code>java.security</code> for this purpose.
- *
- * For simple random doubles between 0.0 and 1.0, you may consider using
- * Math.random instead.
- *
- * @see java.security.SecureRandom
- * @see Math#random()
- * @author Jochen Hoenicke
- * @author Eric Blake (ebb9@email.byu.edu)
- * @status updated to 1.4
- */
-public class Random implements Serializable
-{
- /**
- * True if the next nextGaussian is available. This is used by
- * nextGaussian, which generates two gaussian numbers by one call,
- * and returns the second on the second call.
- *
- * @serial whether nextNextGaussian is available
- * @see #nextGaussian()
- * @see #nextNextGaussian
- */
- private boolean haveNextNextGaussian;
-
- /**
- * The next nextGaussian, when available. This is used by nextGaussian,
- * which generates two gaussian numbers by one call, and returns the
- * second on the second call.
- *
- * @serial the second gaussian of a pair
- * @see #nextGaussian()
- * @see #haveNextNextGaussian
- */
- private double nextNextGaussian;
-
- /**
- * The seed. This is the number set by setSeed and which is used
- * in next.
- *
- * @serial the internal state of this generator
- * @see #next()
- */
- private long seed;
-
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 3905348978240129619L;
-
- /**
- * Creates a new pseudorandom number generator. The seed is initialized
- * to the current time, as if by
- * <code>setSeed(System.currentTimeMillis());</code>.
- *
- * @see System#currentTimeMillis()
- */
- public Random()
- {
- this(System.currentTimeMillis());
- }
-
- /**
- * Creates a new pseudorandom number generator, starting with the
- * specified seed, using <code>setSeed(seed);</code>.
- *
- * @param seed the initial seed
- */
- public Random(long seed)
- {
- setSeed(seed);
- }
-
- /**
- * Sets the seed for this pseudorandom number generator. As described
- * above, two instances of the same random class, starting with the
- * same seed, should produce the same results, if the same methods
- * are called. The implementation for java.util.Random is:
- *
-<pre>public synchronized void setSeed(long seed)
-{
- this.seed = (seed ^ 0x5DEECE66DL) & ((1L &lt;&lt; 48) - 1);
- haveNextNextGaussian = false;
-}</pre>
- *
- * @param seed the new seed
- */
- public synchronized void setSeed(long seed)
- {
- this.seed = (seed ^ 0x5DEECE66DL) & ((1L << 48) - 1);
- haveNextNextGaussian = false;
- }
-
- /**
- * Generates the next pseudorandom number. This returns
- * an int value whose <code>bits</code> low order bits are
- * independent chosen random bits (0 and 1 are equally likely).
- * The implementation for java.util.Random is:
- *
-<pre>protected synchronized int next(int bits)
-{
- seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L &lt;&lt; 48) - 1);
- return (int) (seed &gt;&gt;&gt; (48 - bits));
-}</pre>
- *
- * @param bits the number of random bits to generate, in the range 1..32
- * @return the next pseudorandom value
- * @since 1.1
- */
- protected synchronized int next(int bits)
- {
- seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
- return (int) (seed >>> (48 - bits));
- }
-
- /**
- * Fills an array of bytes with random numbers. All possible values
- * are (approximately) equally likely.
- * The JDK documentation gives no implementation, but it seems to be:
- *
-<pre>public void nextBytes(byte[] bytes)
-{
- for (int i = 0; i &lt; bytes.length; i += 4)
- {
- int random = next(32);
- for (int j = 0; i + j &lt; bytes.length && j &lt; 4; j++)
- {
- bytes[i+j] = (byte) (random & 0xff)
- random &gt;&gt;= 8;
- }
- }
-}</pre>
- *
- * @param bytes the byte array that should be filled
- * @throws NullPointerException if bytes is null
- * @since 1.1
- */
- public void nextBytes(byte[] bytes)
- {
- int random;
- // Do a little bit unrolling of the above algorithm.
- int max = bytes.length & ~0x3;
- for (int i = 0; i < max; i += 4)
- {
- random = next(32);
- bytes[i] = (byte) random;
- bytes[i + 1] = (byte) (random >> 8);
- bytes[i + 2] = (byte) (random >> 16);
- bytes[i + 3] = (byte) (random >> 24);
- }
- if (max < bytes.length)
- {
- random = next(32);
- for (int j = max; j < bytes.length; j++)
- {
- bytes[j] = (byte) random;
- random >>= 8;
- }
- }
- }
-
- /**
- * Generates the next pseudorandom number. This returns
- * an int value whose 32 bits are independent chosen random bits
- * (0 and 1 are equally likely). The implementation for
- * java.util.Random is:
- *
-<pre>public int nextInt()
-{
- return next(32);
-}</pre>
- *
- * @return the next pseudorandom value
- */
- public int nextInt()
- {
- return next(32);
- }
-
- /**
- * Generates the next pseudorandom number. This returns
- * a value between 0(inclusive) and <code>n</code>(exclusive), and
- * each value has the same likelihodd (1/<code>n</code>).
- * (0 and 1 are equally likely). The implementation for
- * java.util.Random is:
- *
-<pre>
-public int nextInt(int n)
-{
- if (n &lt;= 0)
- throw new IllegalArgumentException("n must be positive");
-
- if ((n & -n) == n) // i.e., n is a power of 2
- return (int)((n * (long) next(31)) &gt;&gt; 31);
-
- int bits, val;
- do
- {
- bits = next(31);
- val = bits % n;
- }
- while(bits - val + (n-1) &lt; 0);
-
- return val;
-}</pre>
- *
- * <p>This algorithm would return every value with exactly the same
- * probability, if the next()-method would be a perfect random number
- * generator.
- *
- * The loop at the bottom only accepts a value, if the random
- * number was between 0 and the highest number less then 1<<31,
- * which is divisible by n. The probability for this is high for small
- * n, and the worst case is 1/2 (for n=(1<<30)+1).
- *
- * The special treatment for n = power of 2, selects the high bits of
- * the random number (the loop at the bottom would select the low order
- * bits). This is done, because the low order bits of linear congruential
- * number generators (like the one used in this class) are known to be
- * ``less random'' than the high order bits.
- *
- * @param n the upper bound
- * @throws IllegalArgumentException if the given upper bound is negative
- * @return the next pseudorandom value
- * @since 1.2
- */
- public int nextInt(int n)
- {
- if (n <= 0)
- throw new IllegalArgumentException("n must be positive");
- if ((n & -n) == n) // i.e., n is a power of 2
- return (int) ((n * (long) next(31)) >> 31);
- int bits, val;
- do
- {
- bits = next(31);
- val = bits % n;
- }
- while (bits - val + (n - 1) < 0);
- return val;
- }
-
- /**
- * Generates the next pseudorandom long number. All bits of this
- * long are independently chosen and 0 and 1 have equal likelihood.
- * The implementation for java.util.Random is:
- *
-<pre>public long nextLong()
-{
- return ((long) next(32) &lt;&lt; 32) + next(32);
-}</pre>
- *
- * @return the next pseudorandom value
- */
- public long nextLong()
- {
- return ((long) next(32) << 32) + next(32);
- }
-
- /**
- * Generates the next pseudorandom boolean. True and false have
- * the same probability. The implementation is:
- *
-<pre>public boolean nextBoolean()
-{
- return next(1) != 0;
-}</pre>
- *
- * @return the next pseudorandom boolean
- * @since 1.2
- */
- public boolean nextBoolean()
- {
- return next(1) != 0;
- }
-
- /**
- * Generates the next pseudorandom float uniformly distributed
- * between 0.0f (inclusive) and 1.0f (exclusive). The
- * implementation is as follows.
- *
-<pre>public float nextFloat()
-{
- return next(24) / ((float)(1 &lt;&lt; 24));
-}</pre>
- *
- * @return the next pseudorandom float
- */
- public float nextFloat()
- {
- return next(24) / (float) (1 << 24);
- }
-
- /**
- * Generates the next pseudorandom double uniformly distributed
- * between 0.0 (inclusive) and 1.0 (exclusive). The
- * implementation is as follows.
- *
-<pre>public double nextDouble()
-{
- return (((long) next(26) &lt;&lt; 27) + next(27)) / (double)(1L &lt;&lt; 53);
-}</pre>
- *
- * @return the next pseudorandom double
- */
- public double nextDouble()
- {
- return (((long) next(26) << 27) + next(27)) / (double) (1L << 53);
- }
-
- /**
- * Generates the next pseudorandom, Gaussian (normally) distributed
- * double value, with mean 0.0 and standard deviation 1.0.
- * The algorithm is as follows.
- *
-<pre>public synchronized double nextGaussian()
-{
- if (haveNextNextGaussian)
- {
- haveNextNextGaussian = false;
- return nextNextGaussian;
- }
- else
- {
- double v1, v2, s;
- do
- {
- v1 = 2 * nextDouble() - 1; // between -1.0 and 1.0
- v2 = 2 * nextDouble() - 1; // between -1.0 and 1.0
- s = v1 * v1 + v2 * v2;
- }
- while (s >= 1);
-
- double norm = Math.sqrt(-2 * Math.log(s) / s);
- nextNextGaussian = v2 * norm;
- haveNextNextGaussian = true;
- return v1 * norm;
- }
-}</pre>
- *
- * <p>This is described in section 3.4.1 of <em>The Art of Computer
- * Programming, Volume 2</em> by Donald Knuth.
- *
- * @return the next pseudorandom Gaussian distributed double
- */
- public synchronized double nextGaussian()
- {
- if (haveNextNextGaussian)
- {
- haveNextNextGaussian = false;
- return nextNextGaussian;
- }
- double v1, v2, s;
- do
- {
- v1 = 2 * nextDouble() - 1; // Between -1.0 and 1.0.
- v2 = 2 * nextDouble() - 1; // Between -1.0 and 1.0.
- s = v1 * v1 + v2 * v2;
- }
- while (s >= 1);
- double norm = Math.sqrt(-2 * Math.log(s) / s);
- nextNextGaussian = v2 * norm;
- haveNextNextGaussian = true;
- return v1 * norm;
- }
-}
diff --git a/libjava/java/util/RandomAccess.java b/libjava/java/util/RandomAccess.java
deleted file mode 100644
index 054266a1c74..00000000000
--- a/libjava/java/util/RandomAccess.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* RandomAccess.java -- A tagging interface that lists can use to tailor
- operations to the correct algorithm
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * Marker interface used to inform <code>List</code> implementations that
- * they support fast (usually constant time) random access. This allows
- * generic list algorithms to tailor their behavior based on the list
- * type.
- * <p>
- *
- * For example, some sorts are n*log(n) on an array, but decay to quadratic
- * time on a linked list. As a rule of thumb, this interface should be
- * used is this loop:<br>
- * <code>for (int i = 0, n = list.size(); i &lt; n; i++) list.get(i);</code>
- * <br>runs faster than this loop:<br>
- * <code>for (Iterator i = list.iterator(); i.hasNext(); ) i.next();</code>
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see List
- * @since 1.4
- * @status updated to 1.4
- */
-public interface RandomAccess
-{
- // Tagging interface only.
-}
diff --git a/libjava/java/util/Set.java b/libjava/java/util/Set.java
deleted file mode 100644
index 839959e620c..00000000000
--- a/libjava/java/util/Set.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/* Set.java -- A collection that prohibits duplicates
- Copyright (C) 1998, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * A collection that contains no duplicates. In other words, for two set
- * elements e1 and e2, <code>e1.equals(e2)</code> returns false. There
- * are additional stipulations on <code>add</code>, <code>equals</code>
- * and <code>hashCode</code>, as well as the requirements that constructors
- * do not permit duplicate elements. The Set interface is incompatible with
- * List; you cannot implement both simultaneously.
- * <p>
- *
- * Note: Be careful about using mutable objects in sets. In particular,
- * if a mutable object changes to become equal to another set element, you
- * have violated the contract. As a special case of this, a Set is not
- * allowed to be an element of itself, without risking undefined behavior.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see List
- * @see SortedSet
- * @see HashSet
- * @see TreeSet
- * @see LinkedHashSet
- * @see AbstractSet
- * @see Collections#singleton(Object)
- * @see Collections#EMPTY_SET
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Set extends Collection
-{
- /**
- * Adds the specified element to the set if it is not already present
- * (optional operation). In particular, the comparison algorithm is
- * <code>o == null ? e == null : o.equals(e)</code>. Sets need not permit
- * all values, and may document what exceptions will be thrown if
- * a value is not permitted.
- *
- * @param o the object to add
- * @return true if the object was not previously in the set
- * @throws UnsupportedOperationException if this operation is not allowed
- * @throws ClassCastException if the class of o prevents it from being added
- * @throws IllegalArgumentException if some aspect of o prevents it from
- * being added
- * @throws NullPointerException if null is not permitted in this set
- */
- boolean add(Object o);
-
- /**
- * Adds all of the elements of the given collection to this set (optional
- * operation). If the argument is also a Set, this returns the mathematical
- * <i>union</i> of the two. The behavior is unspecified if the set is
- * modified while this is taking place.
- *
- * @param c the collection to add
- * @return true if the set changed as a result
- * @throws UnsupportedOperationException if this operation is not allowed
- * @throws ClassCastException if the class of an element prevents it from
- * being added
- * @throws IllegalArgumentException if something about an element prevents
- * it from being added
- * @throws NullPointerException if null is not permitted in this set, or
- * if the argument c is null
- * @see #add(Object)
- */
- boolean addAll(Collection c);
-
- /**
- * Removes all elements from this set (optional operation). This set will
- * be empty afterwords, unless an exception occurs.
- *
- * @throws UnsupportedOperationException if this operation is not allowed
- */
- void clear();
-
- /**
- * Returns true if the set contains the specified element. In other words,
- * this looks for <code>o == null ? e == null : o.equals(e)</code>.
- *
- * @param o the object to look for
- * @return true if it is found in the set
- * @throws ClassCastException if the type of o is not a valid type
- * for this set.
- * @throws NullPointerException if o is null and this set doesn't
- * support null values.
- */
- boolean contains(Object o);
-
- /**
- * Returns true if this set contains all elements in the specified
- * collection. If the argument is also a set, this is the <i>subset</i>
- * relationship.
- *
- * @param c the collection to check membership in
- * @return true if all elements in this set are in c
- * @throws NullPointerException if c is null
- * @throws ClassCastException if the type of any element in c is not
- * a valid type for this set.
- * @throws NullPointerException if some element of c is null and this
- * set doesn't support null values.
- * @see #contains(Object)
- */
- boolean containsAll(Collection c);
-
- /**
- * Compares the specified object to this for equality. For sets, the object
- * must be a set, the two must have the same size, and every element in
- * one must be in the other.
- *
- * @param o the object to compare to
- * @return true if it is an equal set
- */
- boolean equals(Object o);
-
- /**
- * Returns the hash code for this set. In order to satisfy the contract of
- * equals, this is the sum of the hashcode of all elements in the set.
- *
- * @return the sum of the hashcodes of all set elements
- * @see #equals(Object)
- */
- int hashCode();
-
- /**
- * Returns true if the set contains no elements.
- *
- * @return true if the set is empty
- */
- boolean isEmpty();
-
- /**
- * Returns an iterator over the set. The iterator has no specific order,
- * unless further specified.
- *
- * @return a set iterator
- */
- Iterator iterator();
-
- /**
- * Removes the specified element from this set (optional operation). If
- * an element e exists, <code>o == null ? e == null : o.equals(e)</code>,
- * it is removed from the set.
- *
- * @param o the object to remove
- * @return true if the set changed (an object was removed)
- * @throws UnsupportedOperationException if this operation is not allowed
- * @throws ClassCastException if the type of o is not a valid type
- * for this set.
- * @throws NullPointerException if o is null and this set doesn't allow
- * the removal of a null value.
- */
- boolean remove(Object o);
-
- /**
- * Removes from this set all elements contained in the specified collection
- * (optional operation). If the argument is a set, this returns the
- * <i>asymmetric set difference</i> of the two sets.
- *
- * @param c the collection to remove from this set
- * @return true if this set changed as a result
- * @throws UnsupportedOperationException if this operation is not allowed
- * @throws NullPointerException if c is null
- * @throws ClassCastException if the type of any element in c is not
- * a valid type for this set.
- * @throws NullPointerException if some element of c is null and this
- * set doesn't support removing null values.
- * @see #remove(Object)
- */
- boolean removeAll(Collection c);
-
- /**
- * Retains only the elements in this set that are also in the specified
- * collection (optional operation). If the argument is also a set, this
- * performs the <i>intersection</i> of the two sets.
- *
- * @param c the collection to keep
- * @return true if this set was modified
- * @throws UnsupportedOperationException if this operation is not allowed
- * @throws NullPointerException if c is null
- * @throws ClassCastException if the type of any element in c is not
- * a valid type for this set.
- * @throws NullPointerException if some element of c is null and this
- * set doesn't support retaining null values.
- * @see #remove(Object)
- */
- boolean retainAll(Collection c);
-
- /**
- * Returns the number of elements in the set. If there are more
- * than Integer.MAX_VALUE mappings, return Integer.MAX_VALUE. This is
- * the <i>cardinality</i> of the set.
- *
- * @return the number of elements
- */
- int size();
-
- /**
- * Returns an array containing the elements of this set. If the set
- * makes a guarantee about iteration order, the array has the same
- * order. The array is distinct from the set; modifying one does not
- * affect the other.
- *
- * @return an array of this set's elements
- * @see #toArray(Object[])
- */
- Object[] toArray();
-
- /**
- * Returns an array containing the elements of this set, of the same runtime
- * type of the argument. If the given set is large enough, it is reused,
- * and null is inserted in the first unused slot. Otherwise, reflection
- * is used to build a new array. If the set makes a guarantee about iteration
- * order, the array has the same order. The array is distinct from the set;
- * modifying one does not affect the other.
- *
- * @param a the array to determine the return type; if it is big enough
- * it is used and returned
- * @return an array holding the elements of the set
- * @throws ArrayStoreException if the runtime type of a is not a supertype
- * of all elements in the set
- * @throws NullPointerException if a is null
- * @see #toArray()
- */
- Object[] toArray(Object[] a);
-}
diff --git a/libjava/java/util/SortedMap.java b/libjava/java/util/SortedMap.java
deleted file mode 100644
index acfbd0d3639..00000000000
--- a/libjava/java/util/SortedMap.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/* SortedMap.java -- A map that makes guarantees about the order of its keys
- Copyright (C) 1998, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * A map which guarantees its key's iteration order. The entries in the
- * map are related by the <i>natural ordering</i> of the keys if they
- * are Comparable, or by the provided Comparator. Additional operations
- * take advantage of the sorted nature of the map.
- * <p>
- *
- * All keys entered in the map must be mutually comparable; in other words,
- * <code>k1.compareTo(k2)</code> or <code>comparator.compare(k1, k2)</code>
- * must not throw a ClassCastException. The ordering must be <i>consistent
- * with equals</i> (see {@link Comparator} for this definition), if the
- * map is to obey the general contract of the Map interface. If not,
- * the results are well-defined, but probably not what you wanted.
- * <p>
- *
- * It is recommended that all implementing classes provide four constructors:
- * 1) one that takes no arguments and builds an empty map sorted by natural
- * order of the keys; 2) one that takes a Comparator for the sorting order;
- * 3) one that takes a Map and sorts according to the natural order of its
- * keys; and 4) one that takes a SortedMap and sorts by the same comparator.
- * Unfortunately, the Java language does not provide a way to enforce this.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Map
- * @see TreeMap
- * @see SortedSet
- * @see Comparable
- * @see Comparator
- * @see Collection
- * @see ClassCastException
- * @since 1.2
- * @status updated to 1.4
- */
-public interface SortedMap extends Map
-{
- /**
- * Returns the comparator used in sorting this map, or null if it is
- * the keys' natural ordering.
- *
- * @return the sorting comparator
- */
- Comparator comparator();
-
- /**
- * Returns the first (lowest sorted) key in the map.
- *
- * @return the first key
- * @throws NoSuchElementException if this map is empty.
- */
- Object firstKey();
-
- /**
- * Returns a view of the portion of the map strictly less than toKey. The
- * view is backed by this map, so changes in one show up in the other.
- * The submap supports all optional operations of the original.
- * <p>
- *
- * The returned map throws an IllegalArgumentException any time a key is
- * used which is out of the range of toKey. Note that the endpoint, toKey,
- * is not included; if you want this value to be included, pass its successor
- * object in to toKey. For example, for Integers, you could request
- * <code>headMap(new Integer(limit.intValue() + 1))</code>.
- *
- * @param toKey the exclusive upper range of the submap
- * @return the submap
- * @throws ClassCastException if toKey is not comparable to the map contents
- * @throws IllegalArgumentException if this is a subMap, and toKey is out
- * of range
- * @throws NullPointerException if toKey is null but the map does not allow
- * null keys
- */
- SortedMap headMap(Object toKey);
-
- /**
- * Returns the last (highest sorted) key in the map.
- *
- * @return the last key
- * @throws NoSuchElementException if this map is empty.
- */
- Object lastKey();
-
- /**
- * Returns a view of the portion of the map greater than or equal to
- * fromKey, and strictly less than toKey. The view is backed by this map,
- * so changes in one show up in the other. The submap supports all
- * optional operations of the original.
- * <p>
- *
- * The returned map throws an IllegalArgumentException any time a key is
- * used which is out of the range of fromKey and toKey. Note that the
- * lower endpoint is included, but the upper is not; if you want to
- * change the inclusion or exclusion of an endpoint, pass its successor
- * object in instead. For example, for Integers, you could request
- * <code>subMap(new Integer(lowlimit.intValue() + 1),
- * new Integer(highlimit.intValue() + 1))</code> to reverse
- * the inclusiveness of both endpoints.
- *
- * @param fromKey the inclusive lower range of the submap
- * @param toKey the exclusive upper range of the submap
- * @return the submap
- * @throws ClassCastException if fromKey or toKey is not comparable to
- * the map contents
- * @throws IllegalArgumentException if this is a subMap, and fromKey or
- * toKey is out of range
- * @throws NullPointerException if fromKey or toKey is null but the map
- * does not allow null keys
- */
- SortedMap subMap(Object fromKey, Object toKey);
-
- /**
- * Returns a view of the portion of the map greater than or equal to
- * fromKey. The view is backed by this map, so changes in one show up
- * in the other. The submap supports all optional operations of the original.
- * <p>
- *
- * The returned map throws an IllegalArgumentException any time a key is
- * used which is out of the range of fromKey. Note that the endpoint, fromKey, is
- * included; if you do not want this value to be included, pass its successor object in
- * to fromKey. For example, for Integers, you could request
- * <code>tailMap(new Integer(limit.intValue() + 1))</code>.
- *
- * @param fromKey the inclusive lower range of the submap
- * @return the submap
- * @throws ClassCastException if fromKey is not comparable to the map
- * contents
- * @throws IllegalArgumentException if this is a subMap, and fromKey is out
- * of range
- * @throws NullPointerException if fromKey is null but the map does not allow
- * null keys
- */
- SortedMap tailMap(Object fromKey);
-}
diff --git a/libjava/java/util/SortedSet.java b/libjava/java/util/SortedSet.java
deleted file mode 100644
index 48a24a8e0f9..00000000000
--- a/libjava/java/util/SortedSet.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/* SortedSet.java -- A set that makes guarantees about the order of its
- elements
- Copyright (C) 1998, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * A set which guarantees its iteration order. The elements in the set
- * are related by the <i>natural ordering</i> if they are Comparable, or
- * by the provided Comparator. Additional operations take advantage of
- * the sorted nature of the set.
- * <p>
- *
- * All elements entered in the set must be mutually comparable; in other words,
- * <code>k1.compareTo(k2)</code> or <code>comparator.compare(k1, k2)</code>
- * must not throw a ClassCastException. The ordering must be <i>consistent
- * with equals</i> (see {@link Comparator} for this definition), if the
- * set is to obey the general contract of the Set interface. If not,
- * the results are well-defined, but probably not what you wanted.
- * <p>
- *
- * It is recommended that all implementing classes provide four constructors:
- * 1) one that takes no arguments and builds an empty set sorted by natural
- * order of the elements; 2) one that takes a Comparator for the sorting order;
- * 3) one that takes a Set and sorts according to the natural order of its
- * elements; and 4) one that takes a SortedSet and sorts by the same
- * comparator. Unfortunately, the Java language does not provide a way to
- * enforce this.
- *
- * @author Original author unknown
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Set
- * @see TreeSet
- * @see SortedMap
- * @see Collection
- * @see Comparable
- * @see Comparator
- * @see ClassCastException
- * @since 1.2
- * @status updated to 1.4
- */
-public interface SortedSet extends Set
-{
- /**
- * Returns the comparator used in sorting this set, or null if it is
- * the elements' natural ordering.
- *
- * @return the sorting comparator
- */
- Comparator comparator();
-
- /**
- * Returns the first (lowest sorted) element in the set.
- *
- * @return the first element
- * @throws NoSuchElementException if the set is empty.
- */
- Object first();
-
- /**
- * Returns a view of the portion of the set strictly less than toElement. The
- * view is backed by this set, so changes in one show up in the other.
- * The subset supports all optional operations of the original.
- * <p>
- *
- * The returned set throws an IllegalArgumentException any time an element is
- * used which is out of the range of toElement. Note that the endpoint, toElement,
- * is not included; if you want this value included, pass its successor object in to
- * toElement. For example, for Integers, you could request
- * <code>headSet(new Integer(limit.intValue() + 1))</code>.
- *
- * @param toElement the exclusive upper range of the subset
- * @return the subset
- * @throws ClassCastException if toElement is not comparable to the set
- * contents
- * @throws IllegalArgumentException if this is a subSet, and toElement is out
- * of range
- * @throws NullPointerException if toElement is null but the set does not
- * allow null elements
- */
- SortedSet headSet(Object toElement);
-
- /**
- * Returns the last (highest sorted) element in the set.
- *
- * @return the last element
- * @throws NoSuchElementException if the set is empty.
- */
- Object last();
-
- /**
- * Returns a view of the portion of the set greater than or equal to
- * fromElement, and strictly less than toElement. The view is backed by
- * this set, so changes in one show up in the other. The subset supports all
- * optional operations of the original.
- * <p>
- *
- * The returned set throws an IllegalArgumentException any time an element is
- * used which is out of the range of fromElement and toElement. Note that the
- * lower endpoint is included, but the upper is not; if you want to
- * change the inclusion or exclusion of an endpoint, pass its successor
- * object in instead. For example, for Integers, you can request
- * <code>subSet(new Integer(lowlimit.intValue() + 1),
- * new Integer(highlimit.intValue() + 1))</code> to reverse
- * the inclusiveness of both endpoints.
- *
- * @param fromElement the inclusive lower range of the subset
- * @param toElement the exclusive upper range of the subset
- * @return the subset
- * @throws ClassCastException if fromElement or toElement is not comparable
- * to the set contents
- * @throws IllegalArgumentException if this is a subSet, and fromElement or
- * toElement is out of range
- * @throws NullPointerException if fromElement or toElement is null but the
- * set does not allow null elements
- */
- SortedSet subSet(Object fromElement, Object toElement);
-
- /**
- * Returns a view of the portion of the set greater than or equal to
- * fromElement. The view is backed by this set, so changes in one show up
- * in the other. The subset supports all optional operations of the original.
- * <p>
- *
- * The returned set throws an IllegalArgumentException any time an element is
- * used which is out of the range of fromElement. Note that the endpoint,
- * fromElement, is included; if you do not want this value to be included, pass its
- * successor object in to fromElement. For example, for Integers, you could request
- * <code>tailSet(new Integer(limit.intValue() + 1))</code>.
- *
- * @param fromElement the inclusive lower range of the subset
- * @return the subset
- * @throws ClassCastException if fromElement is not comparable to the set
- * contents
- * @throws IllegalArgumentException if this is a subSet, and fromElement is
- * out of range
- * @throws NullPointerException if fromElement is null but the set does not
- * allow null elements
- */
- SortedSet tailSet(Object fromElement);
-}
diff --git a/libjava/java/util/Stack.java b/libjava/java/util/Stack.java
deleted file mode 100644
index 730ce177cd1..00000000000
--- a/libjava/java/util/Stack.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* Stack.java - Class that provides a Last In First Out (LIFO)
- datatype, known more commonly as a Stack
- Copyright (C) 1998, 1999, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct
-
-/**
- * Stack provides a Last In First Out (LIFO) data type, commonly known
- * as a Stack. Stack itself extends Vector and provides the additional
- * methods for stack manipulation (push, pop, peek). You can also seek for
- * the 1-based position of an element on the stack.
- *
- * @author Warren Levy (warrenl@cygnus.com)
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see List
- * @see AbstractList
- * @see LinkedList
- * @since 1.0
- * @status updated to 1.4
- */
-public class Stack extends Vector
-{
- // We could use Vector methods internally for the following methods,
- // but have used Vector fields directly for efficiency (i.e. this
- // often reduces out duplicate bounds checking).
-
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 1224463164541339165L;
-
- /**
- * This constructor creates a new Stack, initially empty
- */
- public Stack()
- {
- }
-
- /**
- * Pushes an Object onto the top of the stack. This method is effectively
- * the same as addElement(item).
- *
- * @param item the Object to push onto the stack
- * @return the Object pushed onto the stack
- * @see Vector#addElement(Object)
- */
- public Object push(Object item)
- {
- // When growing the Stack, use the Vector routines in case more
- // memory is needed.
- // Note: spec indicates that this method *always* returns obj passed in!
-
- addElement(item);
- return item;
- }
-
- /**
- * Pops an item from the stack and returns it. The item popped is
- * removed from the Stack.
- *
- * @return the Object popped from the stack
- * @throws EmptyStackException if the stack is empty
- */
- public synchronized Object pop()
- {
- if (elementCount == 0)
- throw new EmptyStackException();
-
- modCount++;
- Object obj = elementData[--elementCount];
-
- // Set topmost element to null to assist the gc in cleanup.
- elementData[elementCount] = null;
- return obj;
- }
-
- /**
- * Returns the top Object on the stack without removing it.
- *
- * @return the top Object on the stack
- * @throws EmptyStackException if the stack is empty
- */
- public synchronized Object peek()
- {
- if (elementCount == 0)
- throw new EmptyStackException();
-
- return elementData[elementCount - 1];
- }
-
- /**
- * Tests if the stack is empty.
- *
- * @return true if the stack contains no items, false otherwise
- */
- public synchronized boolean empty()
- {
- return elementCount == 0;
- }
-
- /**
- * Returns the position of an Object on the stack, with the top
- * most Object being at position 1, and each Object deeper in the
- * stack at depth + 1.
- *
- * @param o The object to search for
- * @return The 1 based depth of the Object, or -1 if the Object
- * is not on the stack
- */
- public synchronized int search(Object o)
- {
- int i = elementCount;
- while (--i >= 0)
- if (equals(o, elementData[i]))
- return elementCount - i;
- return -1;
- }
-}
diff --git a/libjava/java/util/StringTokenizer.java b/libjava/java/util/StringTokenizer.java
deleted file mode 100644
index dcc192c855a..00000000000
--- a/libjava/java/util/StringTokenizer.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/* StringTokenizer -- breaks a String into tokens
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * This class splits a string into tokens. The caller can set on which
- * delimiters the string should be split and if the delimiters should be
- * returned. This is much simpler than {@link java.io.StreamTokenizer}.
- *
- * <p>You may change the delimiter set on the fly by calling
- * nextToken(String). But the semantic is quite difficult; it even
- * depends on calling <code>hasMoreTokens()</code>. You should call
- * <code>hasMoreTokens()</code> before, otherwise the old delimiters
- * after the last token are candidates for being returned.
- *
- * <p>If you want to get the delimiters, you have to use the three argument
- * constructor. The delimiters are returned as token consisting of a
- * single character.
- *
- * @author Jochen Hoenicke
- * @author Warren Levy (warrenl@cygnus.com)
- * @see java.io.StreamTokenizer
- * @status updated to 1.4
- */
-public class StringTokenizer implements Enumeration
-{
- // WARNING: StringTokenizer is a CORE class in the bootstrap cycle. See the
- // comments in vm/reference/java/lang/Runtime for implications of this fact.
-
- /**
- * The position in the str, where we currently are.
- */
- private int pos;
-
- /**
- * The string that should be split into tokens.
- */
- private final String str;
-
- /**
- * The length of the string.
- */
- private final int len;
-
- /**
- * The string containing the delimiter characters.
- */
- private String delim;
-
- /**
- * Tells, if we should return the delimiters.
- */
- private final boolean retDelims;
-
- /**
- * Creates a new StringTokenizer for the string <code>str</code>,
- * that should split on the default delimiter set (space, tab,
- * newline, return and formfeed), and which doesn't return the
- * delimiters.
- *
- * @param str The string to split
- * @throws NullPointerException if str is null
- */
- public StringTokenizer(String str)
- {
- this(str, " \t\n\r\f", false);
- }
-
- /**
- * Create a new StringTokenizer, that splits the given string on
- * the given delimiter characters. It doesn't return the delimiter
- * characters.
- *
- * @param str the string to split
- * @param delim a string containing all delimiter characters
- * @throws NullPointerException if either argument is null
- */
- public StringTokenizer(String str, String delim)
- {
- this(str, delim, false);
- }
-
- /**
- * Create a new StringTokenizer, that splits the given string on
- * the given delimiter characters. If you set
- * <code>returnDelims</code> to <code>true</code>, the delimiter
- * characters are returned as tokens of their own. The delimiter
- * tokens always consist of a single character.
- *
- * @param str the string to split
- * @param delim a string containing all delimiter characters
- * @param returnDelims tells, if you want to get the delimiters
- * @throws NullPointerException if str or delim is null
- */
- public StringTokenizer(String str, String delim, boolean returnDelims)
- {
- len = str.length();
- this.str = str;
- // The toString() hack causes the NullPointerException.
- this.delim = delim.toString();
- this.retDelims = returnDelims;
- this.pos = 0;
- }
-
- /**
- * Tells if there are more tokens.
- *
- * @return true if the next call of nextToken() will succeed
- */
- public boolean hasMoreTokens()
- {
- if (! retDelims)
- {
- while (pos < len && delim.indexOf(str.charAt(pos)) >= 0)
- pos++;
- }
- return pos < len;
- }
-
- /**
- * Returns the nextToken, changing the delimiter set to the given
- * <code>delim</code>. The change of the delimiter set is
- * permanent, ie. the next call of nextToken(), uses the same
- * delimiter set.
- *
- * @param delim a string containing the new delimiter characters
- * @return the next token with respect to the new delimiter characters
- * @throws NoSuchElementException if there are no more tokens
- * @throws NullPointerException if delim is null
- */
- public String nextToken(String delim) throws NoSuchElementException
- {
- this.delim = delim;
- return nextToken();
- }
-
- /**
- * Returns the nextToken of the string.
- *
- * @return the next token with respect to the current delimiter characters
- * @throws NoSuchElementException if there are no more tokens
- */
- public String nextToken() throws NoSuchElementException
- {
- if (pos < len && delim.indexOf(str.charAt(pos)) >= 0)
- {
- if (retDelims)
- return str.substring(pos, ++pos);
- while (++pos < len && delim.indexOf(str.charAt(pos)) >= 0);
- }
- if (pos < len)
- {
- int start = pos;
- while (++pos < len && delim.indexOf(str.charAt(pos)) < 0);
-
- return str.substring(start, pos);
- }
- throw new NoSuchElementException();
- }
-
- /**
- * This does the same as hasMoreTokens. This is the
- * <code>Enumeration</code> interface method.
- *
- * @return true, if the next call of nextElement() will succeed
- * @see #hasMoreTokens()
- */
- public boolean hasMoreElements()
- {
- return hasMoreTokens();
- }
-
- /**
- * This does the same as nextTokens. This is the
- * <code>Enumeration</code> interface method.
- *
- * @return the next token with respect to the current delimiter characters
- * @throws NoSuchElementException if there are no more tokens
- * @see #nextToken()
- */
- public Object nextElement() throws NoSuchElementException
- {
- return nextToken();
- }
-
- /**
- * This counts the number of remaining tokens in the string, with
- * respect to the current delimiter set.
- *
- * @return the number of times <code>nextTokens()</code> will succeed
- * @see #nextToken()
- */
- public int countTokens()
- {
- int count = 0;
- int delimiterCount = 0;
- boolean tokenFound = false; // Set when a non-delimiter is found
- int tmpPos = pos;
-
- // Note for efficiency, we count up the delimiters rather than check
- // retDelims every time we encounter one. That way, we can
- // just do the conditional once at the end of the method
- while (tmpPos < len)
- {
- if (delim.indexOf(str.charAt(tmpPos++)) >= 0)
- {
- if (tokenFound)
- {
- // Got to the end of a token
- count++;
- tokenFound = false;
- }
- delimiterCount++; // Increment for this delimiter
- }
- else
- {
- tokenFound = true;
- // Get to the end of the token
- while (tmpPos < len
- && delim.indexOf(str.charAt(tmpPos)) < 0)
- ++tmpPos;
- }
- }
-
- // Make sure to count the last token
- if (tokenFound)
- count++;
-
- // if counting delmiters add them into the token count
- return retDelims ? count + delimiterCount : count;
- }
-} // class StringTokenizer
diff --git a/libjava/java/util/TimeZone.java b/libjava/java/util/TimeZone.java
deleted file mode 100644
index 6850043f2b4..00000000000
--- a/libjava/java/util/TimeZone.java
+++ /dev/null
@@ -1,1331 +0,0 @@
-/* java.util.TimeZone
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.text.DateFormatSymbols;
-
-/**
- * This class represents a time zone offset and handles daylight savings.
- *
- * You can get the default time zone with <code>getDefault</code>.
- * This represents the time zone where program is running.
- *
- * Another way to create a time zone is <code>getTimeZone</code>, where
- * you can give an identifier as parameter. For instance, the identifier
- * of the Central European Time zone is "CET".
- *
- * With the <code>getAvailableIDs</code> method, you can get all the
- * supported time zone identifiers.
- *
- * @see Calendar
- * @see SimpleTimeZone
- * @author Jochen Hoenicke
- */
-public abstract class TimeZone implements java.io.Serializable, Cloneable
-{
-
- /**
- * Constant used to indicate that a short timezone abbreviation should
- * be returned, such as "EST"
- */
- public static final int SHORT = 0;
-
- /**
- * Constant used to indicate that a long timezone name should be
- * returned, such as "Eastern Standard Time".
- */
- public static final int LONG = 1;
-
- /**
- * The time zone identifier, e.g. PST.
- */
- private String ID;
-
- /**
- * The default time zone, as returned by getDefault.
- */
- private static TimeZone defaultZone0;
-
- /**
- * Tries to get the default TimeZone for this system if not already
- * set. It will call <code>getDefaultTimeZone(String)</code> with
- * the result of <code>System.getProperty("user.timezone")</code>.
- * If that fails it calls <code>VMTimeZone.getDefaultTimeZoneId()</code>.
- * If that also fails GMT is returned.
- */
- private static synchronized TimeZone defaultZone()
- {
- /* Look up default timezone */
- if (defaultZone0 == null)
- {
- defaultZone0 = (TimeZone) AccessController.doPrivileged
- (new PrivilegedAction()
- {
- public Object run()
- {
- TimeZone zone = null;
-
- // Prefer System property user.timezone.
- String tzid = System.getProperty("user.timezone");
- if (tzid != null && !tzid.equals(""))
- zone = getDefaultTimeZone(tzid);
-
- // Try platfom specific way.
- if (zone == null)
- zone = VMTimeZone.getDefaultTimeZoneId();
-
- // Fall back on GMT.
- if (zone == null)
- zone = (TimeZone) timezones().get("GMT");
-
- return zone;
- }
- });
- }
-
- return defaultZone0;
- }
-
- private static final long serialVersionUID = 3581463369166924961L;
-
- /**
- * HashMap for timezones by ID.
- */
- private static HashMap timezones0;
- /* initialize this static field lazily to overhead if
- * it is not needed:
- */
- // Package-private to avoid a trampoline.
- static synchronized HashMap timezones()
- {
- if (timezones0 == null)
- {
- HashMap timezones = new HashMap();
- timezones0 = timezones;
-
- TimeZone tz;
- // Automatically generated by scripts/timezones.pl
- // XXX - Should we read this data from a file?
- tz = new SimpleTimeZone(-11000 * 3600, "MIT");
- timezones0.put("MIT", tz);
- timezones0.put("Pacific/Apia", tz);
- timezones0.put("Pacific/Midway", tz);
- timezones0.put("Pacific/Niue", tz);
- timezones0.put("Pacific/Pago_Pago", tz);
- tz = new SimpleTimeZone
- (-10000 * 3600, "America/Adak",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("America/Adak", tz);
- tz = new SimpleTimeZone(-10000 * 3600, "HST");
- timezones0.put("HST", tz);
- timezones0.put("Pacific/Fakaofo", tz);
- timezones0.put("Pacific/Honolulu", tz);
- timezones0.put("Pacific/Johnston", tz);
- timezones0.put("Pacific/Rarotonga", tz);
- timezones0.put("Pacific/Tahiti", tz);
- tz = new SimpleTimeZone(-9500 * 3600, "Pacific/Marquesas");
- timezones0.put("Pacific/Marquesas", tz);
- tz = new SimpleTimeZone
- (-9000 * 3600, "AST",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("AST", tz);
- timezones0.put("America/Anchorage", tz);
- timezones0.put("America/Juneau", tz);
- timezones0.put("America/Nome", tz);
- timezones0.put("America/Yakutat", tz);
- tz = new SimpleTimeZone(-9000 * 3600, "Pacific/Gambier");
- timezones0.put("Pacific/Gambier", tz);
- tz = new SimpleTimeZone
- (-8000 * 3600, "PST",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("PST", tz);
- timezones0.put("PST8PDT", tz);
- timezones0.put("America/Dawson", tz);
- timezones0.put("America/Los_Angeles", tz);
- timezones0.put("America/Tijuana", tz);
- timezones0.put("America/Vancouver", tz);
- timezones0.put("America/Whitehorse", tz);
- timezones0.put("US/Pacific-New", tz);
- tz = new SimpleTimeZone(-8000 * 3600, "Pacific/Pitcairn");
- timezones0.put("Pacific/Pitcairn", tz);
- tz = new SimpleTimeZone
- (-7000 * 3600, "MST",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("MST", tz);
- timezones0.put("MST7MDT", tz);
- timezones0.put("America/Boise", tz);
- timezones0.put("America/Chihuahua", tz);
- timezones0.put("America/Denver", tz);
- timezones0.put("America/Edmonton", tz);
- timezones0.put("America/Inuvik", tz);
- timezones0.put("America/Mazatlan", tz);
- timezones0.put("America/Shiprock", tz);
- timezones0.put("America/Yellowknife", tz);
- tz = new SimpleTimeZone(-7000 * 3600, "MST7");
- timezones0.put("MST7", tz);
- timezones0.put("PNT", tz);
- timezones0.put("America/Dawson_Creek", tz);
- timezones0.put("America/Hermosillo", tz);
- timezones0.put("America/Phoenix", tz);
- tz = new SimpleTimeZone
- (-6000 * 3600, "CST",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("CST", tz);
- timezones0.put("CST6CDT", tz);
- timezones0.put("America/Cambridge_Bay", tz);
- timezones0.put("America/Cancun", tz);
- timezones0.put("America/Chicago", tz);
- timezones0.put("America/Menominee", tz);
- timezones0.put("America/Merida", tz);
- timezones0.put("America/Mexico_City", tz);
- timezones0.put("America/Monterrey", tz);
- timezones0.put("America/Rainy_River", tz);
- timezones0.put("America/Winnipeg", tz);
- tz = new SimpleTimeZone(-6000 * 3600, "America/Belize");
- timezones0.put("America/Belize", tz);
- timezones0.put("America/Costa_Rica", tz);
- timezones0.put("America/El_Salvador", tz);
- timezones0.put("America/Guatemala", tz);
- timezones0.put("America/Managua", tz);
- timezones0.put("America/Regina", tz);
- timezones0.put("America/Swift_Current", tz);
- timezones0.put("America/Tegucigalpa", tz);
- timezones0.put("Pacific/Galapagos", tz);
- tz = new SimpleTimeZone
- (-6000 * 3600, "Pacific/Easter",
- Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
- Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * 3600);
- timezones0.put("Pacific/Easter", tz);
- tz = new SimpleTimeZone
- (-5000 * 3600, "America/Grand_Turk",
- Calendar.APRIL, 1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Grand_Turk", tz);
- timezones0.put("America/Havana", tz);
- tz = new SimpleTimeZone(-5000 * 3600, "EST5");
- timezones0.put("EST5", tz);
- timezones0.put("IET", tz);
- timezones0.put("America/Bogota", tz);
- timezones0.put("America/Cayman", tz);
- timezones0.put("America/Eirunepe", tz);
- timezones0.put("America/Guayaquil", tz);
- timezones0.put("America/Indiana/Indianapolis", tz);
- timezones0.put("America/Indiana/Knox", tz);
- timezones0.put("America/Indiana/Marengo", tz);
- timezones0.put("America/Indiana/Vevay", tz);
- timezones0.put("America/Indianapolis", tz);
- timezones0.put("America/Iqaluit", tz);
- timezones0.put("America/Jamaica", tz);
- timezones0.put("America/Lima", tz);
- timezones0.put("America/Panama", tz);
- timezones0.put("America/Pangnirtung", tz);
- timezones0.put("America/Port-au-Prince", tz);
- timezones0.put("America/Porto_Acre", tz);
- timezones0.put("America/Rankin_Inlet", tz);
- tz = new SimpleTimeZone
- (-5000 * 3600, "EST",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("EST", tz);
- timezones0.put("EST5EDT", tz);
- timezones0.put("America/Detroit", tz);
- timezones0.put("America/Kentucky/Louisville", tz);
- timezones0.put("America/Kentucky/Monticello", tz);
- timezones0.put("America/Louisville", tz);
- timezones0.put("America/Montreal", tz);
- timezones0.put("America/Nassau", tz);
- timezones0.put("America/New_York", tz);
- timezones0.put("America/Nipigon", tz);
- timezones0.put("America/Thunder_Bay", tz);
- tz = new SimpleTimeZone(-4000 * 3600, "PRT");
- timezones0.put("PRT", tz);
- timezones0.put("America/Anguilla", tz);
- timezones0.put("America/Antigua", tz);
- timezones0.put("America/Aruba", tz);
- timezones0.put("America/Barbados", tz);
- timezones0.put("America/Boa_Vista", tz);
- timezones0.put("America/Caracas", tz);
- timezones0.put("America/Curacao", tz);
- timezones0.put("America/Dominica", tz);
- timezones0.put("America/Grenada", tz);
- timezones0.put("America/Guadeloupe", tz);
- timezones0.put("America/Guyana", tz);
- timezones0.put("America/La_Paz", tz);
- timezones0.put("America/Manaus", tz);
- timezones0.put("America/Martinique", tz);
- timezones0.put("America/Montserrat", tz);
- timezones0.put("America/Port_of_Spain", tz);
- timezones0.put("America/Porto_Velho", tz);
- timezones0.put("America/Puerto_Rico", tz);
- timezones0.put("America/Santo_Domingo", tz);
- timezones0.put("America/St_Kitts", tz);
- timezones0.put("America/St_Lucia", tz);
- timezones0.put("America/St_Thomas", tz);
- timezones0.put("America/St_Vincent", tz);
- timezones0.put("America/Tortola", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Asuncion",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 0 * 3600,
- Calendar.FEBRUARY, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Asuncion", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Cuiaba",
- Calendar.OCTOBER, 2, Calendar.SUNDAY, 0 * 3600,
- Calendar.FEBRUARY, 3, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Cuiaba", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Goose_Bay",
- Calendar.APRIL, 1, Calendar.SUNDAY, 60000,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 60000);
- timezones0.put("America/Goose_Bay", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Glace_Bay",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("America/Glace_Bay", tz);
- timezones0.put("America/Halifax", tz);
- timezones0.put("America/Thule", tz);
- timezones0.put("Atlantic/Bermuda", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Santiago",
- Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
- Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Santiago", tz);
- timezones0.put("Antarctica/Palmer", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "Atlantic/Stanley",
- Calendar.SEPTEMBER, 2, Calendar.SUNDAY, 0 * 3600,
- Calendar.APRIL, 16, -Calendar.SUNDAY, 0 * 3600);
- timezones0.put("Atlantic/Stanley", tz);
- tz = new SimpleTimeZone
- (-3500 * 3600, "CNT",
- Calendar.APRIL, 1, Calendar.SUNDAY, 60000,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 60000);
- timezones0.put("CNT", tz);
- timezones0.put("America/St_Johns", tz);
- tz = new SimpleTimeZone
- (-3000 * 3600, "America/Araguaina",
- Calendar.OCTOBER, 2, Calendar.SUNDAY, 0 * 3600,
- Calendar.FEBRUARY, 3, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Araguaina", tz);
- timezones0.put("America/Sao_Paulo", tz);
- tz = new SimpleTimeZone(-3000 * 3600, "AGT");
- timezones0.put("AGT", tz);
- timezones0.put("America/Belem", tz);
- timezones0.put("America/Buenos_Aires", tz);
- timezones0.put("America/Catamarca", tz);
- timezones0.put("America/Cayenne", tz);
- timezones0.put("America/Cordoba", tz);
- timezones0.put("America/Fortaleza", tz);
- timezones0.put("America/Jujuy", tz);
- timezones0.put("America/Maceio", tz);
- timezones0.put("America/Mendoza", tz);
- timezones0.put("America/Montevideo", tz);
- timezones0.put("America/Paramaribo", tz);
- timezones0.put("America/Recife", tz);
- timezones0.put("America/Rosario", tz);
- tz = new SimpleTimeZone
- (-3000 * 3600, "America/Godthab",
- Calendar.MARCH, 30, -Calendar.SATURDAY, 22000 * 3600,
- Calendar.OCTOBER, 30, -Calendar.SATURDAY, 22000 * 3600);
- timezones0.put("America/Godthab", tz);
- tz = new SimpleTimeZone
- (-3000 * 3600, "America/Miquelon",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("America/Miquelon", tz);
- tz = new SimpleTimeZone(-2000 * 3600, "America/Noronha");
- timezones0.put("America/Noronha", tz);
- timezones0.put("Atlantic/South_Georgia", tz);
- tz = new SimpleTimeZone
- (-1000 * 3600, "America/Scoresbysund",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Scoresbysund", tz);
- timezones0.put("Atlantic/Azores", tz);
- tz = new SimpleTimeZone(-1000 * 3600, "Atlantic/Cape_Verde");
- timezones0.put("Atlantic/Cape_Verde", tz);
- timezones0.put("Atlantic/Jan_Mayen", tz);
- tz = new SimpleTimeZone(0 * 3600, "GMT");
- timezones0.put("GMT", tz);
- timezones0.put("UTC", tz);
- timezones0.put("Africa/Abidjan", tz);
- timezones0.put("Africa/Accra", tz);
- timezones0.put("Africa/Bamako", tz);
- timezones0.put("Africa/Banjul", tz);
- timezones0.put("Africa/Bissau", tz);
- timezones0.put("Africa/Casablanca", tz);
- timezones0.put("Africa/Conakry", tz);
- timezones0.put("Africa/Dakar", tz);
- timezones0.put("Africa/El_Aaiun", tz);
- timezones0.put("Africa/Freetown", tz);
- timezones0.put("Africa/Lome", tz);
- timezones0.put("Africa/Monrovia", tz);
- timezones0.put("Africa/Nouakchott", tz);
- timezones0.put("Africa/Ouagadougou", tz);
- timezones0.put("Africa/Sao_Tome", tz);
- timezones0.put("Africa/Timbuktu", tz);
- timezones0.put("Atlantic/Reykjavik", tz);
- timezones0.put("Atlantic/St_Helena", tz);
- timezones0.put("Europe/Belfast", tz);
- timezones0.put("Europe/Dublin", tz);
- timezones0.put("Europe/London", tz);
- tz = new SimpleTimeZone
- (0 * 3600, "WET",
- Calendar.MARCH, -1, Calendar.SUNDAY, 1000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
- timezones0.put("WET", tz);
- timezones0.put("Atlantic/Canary", tz);
- timezones0.put("Atlantic/Faeroe", tz);
- timezones0.put("Atlantic/Madeira", tz);
- timezones0.put("Europe/Lisbon", tz);
- tz = new SimpleTimeZone(1000 * 3600, "Africa/Algiers");
- timezones0.put("Africa/Algiers", tz);
- timezones0.put("Africa/Bangui", tz);
- timezones0.put("Africa/Brazzaville", tz);
- timezones0.put("Africa/Douala", tz);
- timezones0.put("Africa/Kinshasa", tz);
- timezones0.put("Africa/Lagos", tz);
- timezones0.put("Africa/Libreville", tz);
- timezones0.put("Africa/Luanda", tz);
- timezones0.put("Africa/Malabo", tz);
- timezones0.put("Africa/Ndjamena", tz);
- timezones0.put("Africa/Niamey", tz);
- timezones0.put("Africa/Porto-Novo", tz);
- timezones0.put("Africa/Tunis", tz);
- tz = new SimpleTimeZone
- (1000 * 3600, "Africa/Windhoek",
- Calendar.SEPTEMBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Africa/Windhoek", tz);
- tz = new SimpleTimeZone
- (1000 * 3600, "CET",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("CET", tz);
- timezones0.put("CEST", tz);
- timezones0.put("ECT", tz);
- timezones0.put("MET", tz);
- timezones0.put("Africa/Ceuta", tz);
- timezones0.put("Arctic/Longyearbyen", tz);
- timezones0.put("Europe/Amsterdam", tz);
- timezones0.put("Europe/Andorra", tz);
- timezones0.put("Europe/Belgrade", tz);
- timezones0.put("Europe/Berlin", tz);
- timezones0.put("Europe/Bratislava", tz);
- timezones0.put("Europe/Brussels", tz);
- timezones0.put("Europe/Budapest", tz);
- timezones0.put("Europe/Copenhagen", tz);
- timezones0.put("Europe/Gibraltar", tz);
- timezones0.put("Europe/Ljubljana", tz);
- timezones0.put("Europe/Luxembourg", tz);
- timezones0.put("Europe/Madrid", tz);
- timezones0.put("Europe/Malta", tz);
- timezones0.put("Europe/Monaco", tz);
- timezones0.put("Europe/Oslo", tz);
- timezones0.put("Europe/Paris", tz);
- timezones0.put("Europe/Prague", tz);
- timezones0.put("Europe/Rome", tz);
- timezones0.put("Europe/San_Marino", tz);
- timezones0.put("Europe/Sarajevo", tz);
- timezones0.put("Europe/Skopje", tz);
- timezones0.put("Europe/Stockholm", tz);
- timezones0.put("Europe/Tirane", tz);
- timezones0.put("Europe/Vaduz", tz);
- timezones0.put("Europe/Vatican", tz);
- timezones0.put("Europe/Vienna", tz);
- timezones0.put("Europe/Warsaw", tz);
- timezones0.put("Europe/Zagreb", tz);
- timezones0.put("Europe/Zurich", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "ART",
- Calendar.APRIL, -1, Calendar.FRIDAY, 0 * 3600,
- Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 23000 * 3600);
- timezones0.put("ART", tz);
- timezones0.put("Africa/Cairo", tz);
- tz = new SimpleTimeZone(2000 * 3600, "CAT");
- timezones0.put("CAT", tz);
- timezones0.put("Africa/Blantyre", tz);
- timezones0.put("Africa/Bujumbura", tz);
- timezones0.put("Africa/Gaborone", tz);
- timezones0.put("Africa/Harare", tz);
- timezones0.put("Africa/Johannesburg", tz);
- timezones0.put("Africa/Kigali", tz);
- timezones0.put("Africa/Lubumbashi", tz);
- timezones0.put("Africa/Lusaka", tz);
- timezones0.put("Africa/Maputo", tz);
- timezones0.put("Africa/Maseru", tz);
- timezones0.put("Africa/Mbabane", tz);
- timezones0.put("Africa/Tripoli", tz);
- timezones0.put("Europe/Riga", tz);
- timezones0.put("Europe/Tallinn", tz);
- timezones0.put("Europe/Vilnius", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Amman",
- Calendar.MARCH, -1, Calendar.THURSDAY, 0 * 3600,
- Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 0 * 3600);
- timezones0.put("Asia/Amman", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Beirut",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("Asia/Beirut", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Damascus",
- Calendar.APRIL, 1, 0, 0 * 3600,
- Calendar.OCTOBER, 1, 0, 0 * 3600);
- timezones0.put("Asia/Damascus", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Gaza",
- Calendar.APRIL, 3, Calendar.FRIDAY, 0 * 3600,
- Calendar.OCTOBER, 3, Calendar.FRIDAY, 0 * 3600);
- timezones0.put("Asia/Gaza", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Jerusalem",
- Calendar.APRIL, 1, 0, 1000 * 3600,
- Calendar.OCTOBER, 1, 0, 1000 * 3600);
- timezones0.put("Asia/Jerusalem", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "EET",
- Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("EET", tz);
- timezones0.put("Asia/Istanbul", tz);
- timezones0.put("Asia/Nicosia", tz);
- timezones0.put("Europe/Athens", tz);
- timezones0.put("Europe/Bucharest", tz);
- timezones0.put("Europe/Chisinau", tz);
- timezones0.put("Europe/Helsinki", tz);
- timezones0.put("Europe/Istanbul", tz);
- timezones0.put("Europe/Kiev", tz);
- timezones0.put("Europe/Nicosia", tz);
- timezones0.put("Europe/Simferopol", tz);
- timezones0.put("Europe/Sofia", tz);
- timezones0.put("Europe/Uzhgorod", tz);
- timezones0.put("Europe/Zaporozhye", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Europe/Kaliningrad",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Europe/Kaliningrad", tz);
- timezones0.put("Europe/Minsk", tz);
- tz = new SimpleTimeZone
- (3000 * 3600, "Asia/Baghdad",
- Calendar.APRIL, 1, 0, 3000 * 3600,
- Calendar.OCTOBER, 1, 0, 3000 * 3600);
- timezones0.put("Asia/Baghdad", tz);
- tz = new SimpleTimeZone
- (3000 * 3600, "Europe/Moscow",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Europe/Moscow", tz);
- timezones0.put("Europe/Tiraspol", tz);
- tz = new SimpleTimeZone(3000 * 3600, "EAT");
- timezones0.put("EAT", tz);
- timezones0.put("Africa/Addis_Ababa", tz);
- timezones0.put("Africa/Asmera", tz);
- timezones0.put("Africa/Dar_es_Salaam", tz);
- timezones0.put("Africa/Djibouti", tz);
- timezones0.put("Africa/Kampala", tz);
- timezones0.put("Africa/Khartoum", tz);
- timezones0.put("Africa/Mogadishu", tz);
- timezones0.put("Africa/Nairobi", tz);
- timezones0.put("Antarctica/Syowa", tz);
- timezones0.put("Asia/Aden", tz);
- timezones0.put("Asia/Bahrain", tz);
- timezones0.put("Asia/Kuwait", tz);
- timezones0.put("Asia/Qatar", tz);
- timezones0.put("Asia/Riyadh", tz);
- timezones0.put("Indian/Antananarivo", tz);
- timezones0.put("Indian/Comoro", tz);
- timezones0.put("Indian/Mayotte", tz);
- tz = new SimpleTimeZone(3500 * 3600, "Asia/Tehran");
- timezones0.put("Asia/Tehran", tz);
- tz = new SimpleTimeZone
- (4000 * 3600, "Asia/Baku",
- Calendar.MARCH, -1, Calendar.SUNDAY, 1000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
- timezones0.put("Asia/Baku", tz);
- tz = new SimpleTimeZone
- (4000 * 3600, "Asia/Aqtau",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("Asia/Aqtau", tz);
- timezones0.put("Asia/Tbilisi", tz);
- tz = new SimpleTimeZone
- (4000 * 3600, "Asia/Yerevan",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Asia/Yerevan", tz);
- timezones0.put("Europe/Samara", tz);
- tz = new SimpleTimeZone(4000 * 3600, "NET");
- timezones0.put("NET", tz);
- timezones0.put("Asia/Dubai", tz);
- timezones0.put("Asia/Muscat", tz);
- timezones0.put("Indian/Mahe", tz);
- timezones0.put("Indian/Mauritius", tz);
- timezones0.put("Indian/Reunion", tz);
- tz = new SimpleTimeZone(4500 * 3600, "Asia/Kabul");
- timezones0.put("Asia/Kabul", tz);
- tz = new SimpleTimeZone
- (5000 * 3600, "Asia/Aqtobe",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("Asia/Aqtobe", tz);
- tz = new SimpleTimeZone
- (5000 * 3600, "Asia/Bishkek",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2500 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2500 * 3600);
- timezones0.put("Asia/Bishkek", tz);
- tz = new SimpleTimeZone
- (5000 * 3600, "Asia/Yekaterinburg",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Asia/Yekaterinburg", tz);
- tz = new SimpleTimeZone(5000 * 3600, "PLT");
- timezones0.put("PLT", tz);
- timezones0.put("Asia/Ashgabat", tz);
- timezones0.put("Asia/Dushanbe", tz);
- timezones0.put("Asia/Karachi", tz);
- timezones0.put("Asia/Samarkand", tz);
- timezones0.put("Asia/Tashkent", tz);
- timezones0.put("Indian/Chagos", tz);
- timezones0.put("Indian/Kerguelen", tz);
- timezones0.put("Indian/Maldives", tz);
- tz = new SimpleTimeZone(5500 * 3600, "IST");
- timezones0.put("IST", tz);
- timezones0.put("Asia/Calcutta", tz);
- tz = new SimpleTimeZone(5750 * 3600, "Asia/Katmandu");
- timezones0.put("Asia/Katmandu", tz);
- tz = new SimpleTimeZone(6000 * 3600, "BST");
- timezones0.put("BST", tz);
- timezones0.put("Antarctica/Mawson", tz);
- timezones0.put("Asia/Colombo", tz);
- timezones0.put("Asia/Dhaka", tz);
- timezones0.put("Asia/Thimphu", tz);
- tz = new SimpleTimeZone
- (6000 * 3600, "Asia/Almaty",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("Asia/Almaty", tz);
- tz = new SimpleTimeZone
- (6000 * 3600, "Asia/Novosibirsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Asia/Novosibirsk", tz);
- timezones0.put("Asia/Omsk", tz);
- tz = new SimpleTimeZone(6500 * 3600, "Asia/Rangoon");
- timezones0.put("Asia/Rangoon", tz);
- timezones0.put("Indian/Cocos", tz);
- tz = new SimpleTimeZone(7000 * 3600, "VST");
- timezones0.put("VST", tz);
- timezones0.put("Antarctica/Davis", tz);
- timezones0.put("Asia/Bangkok", tz);
- timezones0.put("Asia/Hovd", tz);
- timezones0.put("Asia/Jakarta", tz);
- timezones0.put("Asia/Phnom_Penh", tz);
- timezones0.put("Asia/Saigon", tz);
- timezones0.put("Asia/Vientiane", tz);
- timezones0.put("Indian/Christmas", tz);
- tz = new SimpleTimeZone
- (7000 * 3600, "Asia/Krasnoyarsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Asia/Krasnoyarsk", tz);
- tz = new SimpleTimeZone(8000 * 3600, "CTT");
- timezones0.put("CTT", tz);
- timezones0.put("Antarctica/Casey", tz);
- timezones0.put("Asia/Brunei", tz);
- timezones0.put("Asia/Chungking", tz);
- timezones0.put("Asia/Harbin", tz);
- timezones0.put("Asia/Hong_Kong", tz);
- timezones0.put("Asia/Kashgar", tz);
- timezones0.put("Asia/Kuala_Lumpur", tz);
- timezones0.put("Asia/Kuching", tz);
- timezones0.put("Asia/Macao", tz);
- timezones0.put("Asia/Manila", tz);
- timezones0.put("Asia/Shanghai", tz);
- timezones0.put("Asia/Singapore", tz);
- timezones0.put("Asia/Taipei", tz);
- timezones0.put("Asia/Ujung_Pandang", tz);
- timezones0.put("Asia/Ulaanbaatar", tz);
- timezones0.put("Asia/Urumqi", tz);
- timezones0.put("Australia/Perth", tz);
- tz = new SimpleTimeZone
- (8000 * 3600, "Asia/Irkutsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Asia/Irkutsk", tz);
- tz = new SimpleTimeZone(9000 * 3600, "JST");
- timezones0.put("JST", tz);
- timezones0.put("Asia/Dili", tz);
- timezones0.put("Asia/Jayapura", tz);
- timezones0.put("Asia/Pyongyang", tz);
- timezones0.put("Asia/Seoul", tz);
- timezones0.put("Asia/Tokyo", tz);
- timezones0.put("Pacific/Palau", tz);
- tz = new SimpleTimeZone
- (9000 * 3600, "Asia/Yakutsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Asia/Yakutsk", tz);
- tz = new SimpleTimeZone
- (9500 * 3600, "Australia/Adelaide",
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Australia/Adelaide", tz);
- timezones0.put("Australia/Broken_Hill", tz);
- tz = new SimpleTimeZone(9500 * 3600, "ACT");
- timezones0.put("ACT", tz);
- timezones0.put("Australia/Darwin", tz);
- tz = new SimpleTimeZone(10000 * 3600, "Antarctica/DumontDUrville");
- timezones0.put("Antarctica/DumontDUrville", tz);
- timezones0.put("Australia/Brisbane", tz);
- timezones0.put("Australia/Lindeman", tz);
- timezones0.put("Pacific/Guam", tz);
- timezones0.put("Pacific/Port_Moresby", tz);
- timezones0.put("Pacific/Saipan", tz);
- timezones0.put("Pacific/Truk", tz);
- timezones0.put("Pacific/Yap", tz);
- tz = new SimpleTimeZone
- (10000 * 3600, "Asia/Vladivostok",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Asia/Vladivostok", tz);
- tz = new SimpleTimeZone
- (10000 * 3600, "Australia/Hobart",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Australia/Hobart", tz);
- tz = new SimpleTimeZone
- (10000 * 3600, "AET",
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("AET", tz);
- timezones0.put("Australia/Melbourne", tz);
- timezones0.put("Australia/Sydney", tz);
- tz = new SimpleTimeZone
- (10500 * 3600, "Australia/Lord_Howe",
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600, 500 * 3600);
- timezones0.put("Australia/Lord_Howe", tz);
- tz = new SimpleTimeZone
- (11000 * 3600, "Asia/Magadan",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Asia/Magadan", tz);
- tz = new SimpleTimeZone(11000 * 3600, "SST");
- timezones0.put("SST", tz);
- timezones0.put("Pacific/Efate", tz);
- timezones0.put("Pacific/Guadalcanal", tz);
- timezones0.put("Pacific/Kosrae", tz);
- timezones0.put("Pacific/Noumea", tz);
- timezones0.put("Pacific/Ponape", tz);
- tz = new SimpleTimeZone(11500 * 3600, "Pacific/Norfolk");
- timezones0.put("Pacific/Norfolk", tz);
- tz = new SimpleTimeZone
- (12000 * 3600, "NST",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, 3, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("NST", tz);
- timezones0.put("Antarctica/McMurdo", tz);
- timezones0.put("Antarctica/South_Pole", tz);
- timezones0.put("Pacific/Auckland", tz);
- tz = new SimpleTimeZone
- (12000 * 3600, "Asia/Anadyr",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Asia/Anadyr", tz);
- timezones0.put("Asia/Kamchatka", tz);
- tz = new SimpleTimeZone(12000 * 3600, "Pacific/Fiji");
- timezones0.put("Pacific/Fiji", tz);
- timezones0.put("Pacific/Funafuti", tz);
- timezones0.put("Pacific/Kwajalein", tz);
- timezones0.put("Pacific/Majuro", tz);
- timezones0.put("Pacific/Nauru", tz);
- timezones0.put("Pacific/Tarawa", tz);
- timezones0.put("Pacific/Wake", tz);
- timezones0.put("Pacific/Wallis", tz);
- tz = new SimpleTimeZone
- (12750 * 3600, "Pacific/Chatham",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 2750 * 3600,
- Calendar.MARCH, 3, Calendar.SUNDAY, 2750 * 3600);
- timezones0.put("Pacific/Chatham", tz);
- tz = new SimpleTimeZone(13000 * 3600, "Pacific/Enderbury");
- timezones0.put("Pacific/Enderbury", tz);
- timezones0.put("Pacific/Tongatapu", tz);
- tz = new SimpleTimeZone(14000 * 3600, "Pacific/Kiritimati");
- timezones0.put("Pacific/Kiritimati", tz);
- }
- return timezones0;
- }
-
- /**
- * Maps a time zone name (with optional GMT offset and daylight time
- * zone name) to one of the known time zones. This method called
- * with the result of <code>System.getProperty("user.timezone")</code>
- * or <code>getDefaultTimeZoneId()</code>. Note that giving one of
- * the standard tz data names from ftp://elsie.nci.nih.gov/pub/ is
- * preferred. The time zone name can be given as follows:
- * <code>(standard zone name)[(GMT offset)[(daylight time zone name)]]</code>
- * <p>
- * If only a (standard zone name) is given (no numbers in the
- * String) then it gets mapped directly to the TimeZone with that
- * name, if that fails null is returned.
- * <p>
- * A GMT offset is the offset to add to the local time to get GMT.
- * If a (GMT offset) is included (either in seconds or hours) then
- * an attempt is made to find a TimeZone name matching both the name
- * and the offset (that doesn't observe daylight time, if the
- * timezone observes daylight time then you must include a daylight
- * time zone name after the offset), if that fails then a TimeZone
- * with the given GMT offset is returned (whether or not the
- * TimeZone observes daylight time is ignored), if that also fails
- * the GMT TimeZone is returned.
- * <p>
- * If the String ends with (GMT offset)(daylight time zone name)
- * then an attempt is made to find a TimeZone with the given name and
- * GMT offset that also observes (the daylight time zone name is not
- * currently used in any other way), if that fails a TimeZone with
- * the given GMT offset that observes daylight time is returned, if
- * that also fails the GMT TimeZone is returned.
- * <p>
- * Examples: In Chicago, the time zone id could be "CST6CDT", but
- * the preferred name would be "America/Chicago". In Indianapolis
- * (which does not have Daylight Savings Time) the string could be
- * "EST5", but the preferred name would be "America/Indianapolis".
- * The standard time zone name for The Netherlands is "Europe/Amsterdam",
- * but can also be given as "CET-1CEST".
- */
- static TimeZone getDefaultTimeZone(String sysTimeZoneId)
- {
- // First find start of GMT offset info and any Daylight zone name.
- int startGMToffset = 0;
- int sysTimeZoneIdLength = sysTimeZoneId.length();
- for (int i = 0; i < sysTimeZoneIdLength && startGMToffset == 0; i++)
- {
- char c = sysTimeZoneId.charAt(i);
- if (Character.isDigit(c))
- startGMToffset = i;
- else if ((c == '+' || c == '-')
- && i + 1 < sysTimeZoneIdLength
- && Character.isDigit(sysTimeZoneId.charAt(i + 1)))
- startGMToffset = i;
- }
-
- String tzBasename;
- if (startGMToffset == 0)
- tzBasename = sysTimeZoneId;
- else
- tzBasename = sysTimeZoneId.substring (0, startGMToffset);
-
- int startDaylightZoneName = 0;
- for (int i = sysTimeZoneIdLength - 1;
- i >= 0 && !Character.isDigit(sysTimeZoneId.charAt(i)); --i)
- startDaylightZoneName = i;
-
- boolean useDaylightTime = startDaylightZoneName > 0;
-
- // Integer.parseInt() doesn't handle leading +.
- if (sysTimeZoneId.charAt(startGMToffset) == '+')
- startGMToffset++;
-
- int gmtOffset = 0;
- if (startGMToffset > 0)
- {
- gmtOffset = Integer.parseInt
- (startDaylightZoneName == 0
- ? sysTimeZoneId.substring(startGMToffset)
- : sysTimeZoneId.substring(startGMToffset,
- startDaylightZoneName));
-
- // Offset could be in hours or seconds. Convert to millis.
- // The offset is given as the time to add to local time to get GMT
- // we need the time to add to GMT to get localtime.
- if (Math.abs(gmtOffset) < 24)
- gmtOffset *= 60 * 60;
- gmtOffset *= -1000;
- }
-
- // Try to be optimistic and get the timezone that matches the base name.
- // If we only have the base name then just accept this timezone.
- // Otherwise check the gmtOffset and day light attributes.
- TimeZone tz = (TimeZone) timezones().get(tzBasename);
- if (tz != null
- && (tzBasename == sysTimeZoneId
- || (tz.getRawOffset() == gmtOffset
- && tz.useDaylightTime() == useDaylightTime)))
- return tz;
-
- // Maybe there is one with the daylight zone name?
- if (useDaylightTime)
- {
- String daylightZoneName;
- daylightZoneName = sysTimeZoneId.substring(startDaylightZoneName);
- if (!daylightZoneName.equals(tzBasename))
- {
- tz = (TimeZone) timezones().get(tzBasename);
- if (tz != null
- && tz.getRawOffset() == gmtOffset
- && tz.useDaylightTime())
- return tz;
- }
- }
-
- // If no match, see if a valid timezone has similar attributes as this
- // and then use it instead. We take the first one that looks OKish.
- if (startGMToffset > 0)
- {
- String[] ids = getAvailableIDs(gmtOffset);
- for (int i = 0; i < ids.length; i++)
- {
- tz = (TimeZone) timezones().get(ids[i]);
- if (tz.useDaylightTime() == useDaylightTime)
- return tz;
- }
- }
-
- return null;
- }
-
- /**
- * Gets the time zone offset, for current date, modified in case of
- * daylight savings. This is the offset to add to UTC to get the local
- * time.
- * @param era the era of the given date
- * @param year the year of the given date
- * @param month the month of the given date, 0 for January.
- * @param day the day of month
- * @param dayOfWeek the day of week
- * @param milliseconds the millis in the day (in local standard time)
- * @return the time zone offset in milliseconds.
- */
- public abstract int getOffset(int era, int year, int month,
- int day, int dayOfWeek, int milliseconds);
-
- /**
- * Get the time zone offset for the specified date, modified in case of
- * daylight savings. This is the offset to add to UTC to get the local
- * time.
- * @param date the date represented in millisecends
- * since January 1, 1970 00:00:00 GMT.
- * @since 1.4
- */
- public int getOffset(long date)
- {
- return (inDaylightTime(new Date(date))
- ? getRawOffset() + getDSTSavings()
- : getRawOffset());
- }
-
- /**
- * Gets the time zone offset, ignoring daylight savings. This is
- * the offset to add to UTC to get the local time.
- * @return the time zone offset in milliseconds.
- */
- public abstract int getRawOffset();
-
- /**
- * Sets the time zone offset, ignoring daylight savings. This is
- * the offset to add to UTC to get the local time.
- * @param offsetMillis the time zone offset to GMT.
- */
- public abstract void setRawOffset(int offsetMillis);
-
- /**
- * Gets the identifier of this time zone. For instance, PST for
- * Pacific Standard Time.
- * @returns the ID of this time zone.
- */
- public String getID()
- {
- return ID;
- }
-
- /**
- * Sets the identifier of this time zone. For instance, PST for
- * Pacific Standard Time.
- * @param id the new time zone ID.
- * @throws NullPointerException if <code>id</code> is <code>null</code>
- */
- public void setID(String id)
- {
- if (id == null)
- throw new NullPointerException();
-
- this.ID = id;
- }
-
- /**
- * This method returns a string name of the time zone suitable
- * for displaying to the user. The string returned will be the long
- * description of the timezone in the current locale. The name
- * displayed will assume daylight savings time is not in effect.
- *
- * @return The name of the time zone.
- */
- public final String getDisplayName()
- {
- return (getDisplayName(false, LONG, Locale.getDefault()));
- }
-
- /**
- * This method returns a string name of the time zone suitable
- * for displaying to the user. The string returned will be the long
- * description of the timezone in the specified locale. The name
- * displayed will assume daylight savings time is not in effect.
- *
- * @param locale The locale for this timezone name.
- *
- * @return The name of the time zone.
- */
- public final String getDisplayName(Locale locale)
- {
- return (getDisplayName(false, LONG, locale));
- }
-
- /**
- * This method returns a string name of the time zone suitable
- * for displaying to the user. The string returned will be of the
- * specified type in the current locale.
- *
- * @param dst Whether or not daylight savings time is in effect.
- * @param style <code>LONG</code> for a long name, <code>SHORT</code> for
- * a short abbreviation.
- *
- * @return The name of the time zone.
- */
- public final String getDisplayName(boolean dst, int style)
- {
- return (getDisplayName(dst, style, Locale.getDefault()));
- }
-
-
- /**
- * This method returns a string name of the time zone suitable
- * for displaying to the user. The string returned will be of the
- * specified type in the specified locale.
- *
- * @param dst Whether or not daylight savings time is in effect.
- * @param style <code>LONG</code> for a long name, <code>SHORT</code> for
- * a short abbreviation.
- * @param locale The locale for this timezone name.
- *
- * @return The name of the time zone.
- */
- public String getDisplayName(boolean dst, int style, Locale locale)
- {
- DateFormatSymbols dfs;
- try
- {
- dfs = new DateFormatSymbols(locale);
-
- // The format of the value returned is defined by us.
- String[][]zoneinfo = dfs.getZoneStrings();
- for (int i = 0; i < zoneinfo.length; i++)
- {
- if (zoneinfo[i][0].equals(getID()))
- {
- if (!dst)
- {
- if (style == SHORT)
- return (zoneinfo[i][2]);
- else
- return (zoneinfo[i][1]);
- }
- else
- {
- if (style == SHORT)
- return (zoneinfo[i][4]);
- else
- return (zoneinfo[i][3]);
- }
- }
- }
- }
- catch (MissingResourceException e)
- {
- }
-
- return getDefaultDisplayName(dst);
- }
-
- private String getDefaultDisplayName(boolean dst)
- {
- int offset = getRawOffset();
- if (dst && this instanceof SimpleTimeZone)
- {
- // ugly, but this is a design failure of the API:
- // getDisplayName takes a dst parameter even though
- // TimeZone knows nothing about daylight saving offsets.
- offset += ((SimpleTimeZone) this).getDSTSavings();
- }
-
- StringBuffer sb = new StringBuffer(9);
- sb.append("GMT");
-
- offset = offset / (1000 * 60);
- int hours = Math.abs(offset) / 60;
- int minutes = Math.abs(offset) % 60;
-
- if (minutes != 0 || hours != 0)
- {
- sb.append(offset >= 0 ? '+' : '-');
- sb.append((char) ('0' + hours / 10));
- sb.append((char) ('0' + hours % 10));
- sb.append(':');
- sb.append((char) ('0' + minutes / 10));
- sb.append((char) ('0' + minutes % 10));
- }
-
- return sb.toString();
- }
-
- /**
- * Returns true, if this time zone uses Daylight Savings Time.
- */
- public abstract boolean useDaylightTime();
-
- /**
- * Returns true, if the given date is in Daylight Savings Time in this
- * time zone.
- * @param date the given Date.
- */
- public abstract boolean inDaylightTime(Date date);
-
- /**
- * Gets the daylight savings offset. This is a positive offset in
- * milliseconds with respect to standard time. Typically this
- * is one hour, but for some time zones this may be half an our.
- * <p>The default implementation returns 3600000 milliseconds
- * (one hour) if the time zone uses daylight savings time
- * (as specified by {@link #useDaylightTime()}), otherwise
- * it returns 0.
- * @return the daylight savings offset in milliseconds.
- * @since 1.4
- */
- public int getDSTSavings ()
- {
- return useDaylightTime () ? 3600000 : 0;
- }
-
- /**
- * Gets the TimeZone for the given ID.
- * @param ID the time zone identifier.
- * @return The time zone for the identifier or GMT, if no such time
- * zone exists.
- */
- // FIXME: XXX: JCL indicates this and other methods are synchronized.
- public static TimeZone getTimeZone(String ID)
- {
- // First check timezones hash
- TimeZone tz = (TimeZone) timezones().get(ID);
- if (tz != null)
- {
- if (tz.getID().equals(ID))
- return tz;
-
- // We always return a timezone with the requested ID.
- // This is the same behaviour as with JDK1.2.
- tz = (TimeZone) tz.clone();
- tz.setID(ID);
- // We also save the alias, so that we return the same
- // object again if getTimeZone is called with the same
- // alias.
- timezones().put(ID, tz);
- return tz;
- }
-
- // See if the ID is really a GMT offset form.
- // Note that GMT is in the table so we know it is different.
- if (ID.startsWith("GMT"))
- {
- int pos = 3;
- int offset_direction = 1;
-
- if (ID.charAt(pos) == '-')
- {
- offset_direction = -1;
- pos++;
- }
- else if (ID.charAt(pos) == '+')
- {
- pos++;
- }
-
- try
- {
- int hour, minute;
-
- String offset_str = ID.substring(pos);
- int idx = offset_str.indexOf(":");
- if (idx != -1)
- {
- hour = Integer.parseInt(offset_str.substring(0, idx));
- minute = Integer.parseInt(offset_str.substring(idx + 1));
- }
- else
- {
- int offset_length = offset_str.length();
- if (offset_length <= 2)
- {
- // Only hour
- hour = Integer.parseInt(offset_str);
- minute = 0;
- }
- else
- {
- // hour and minute, not separated by colon
- hour = Integer.parseInt
- (offset_str.substring(0, offset_length - 2));
- minute = Integer.parseInt
- (offset_str.substring(offset_length - 2));
- }
- }
-
- return new SimpleTimeZone((hour * (60 * 60 * 1000) +
- minute * (60 * 1000))
- * offset_direction, ID);
- }
- catch (NumberFormatException e)
- {
- }
- }
-
- // Finally, return GMT per spec
- return getTimeZone("GMT");
- }
-
- /**
- * Gets the available IDs according to the given time zone
- * offset.
- * @param rawOffset the given time zone GMT offset.
- * @return An array of IDs, where the time zone has the specified GMT
- * offset. For example <code>{"Phoenix", "Denver"}</code>, since both have
- * GMT-07:00, but differ in daylight savings behaviour.
- */
- public static String[] getAvailableIDs(int rawOffset)
- {
- int count = 0;
- Iterator iter = timezones().entrySet().iterator();
- while (iter.hasNext())
- {
- // Don't iterate the values, since we want to count
- // doubled values (aliases)
- Map.Entry entry = (Map.Entry) iter.next();
- if (((TimeZone) entry.getValue()).getRawOffset() == rawOffset)
- count++;
- }
-
- String[] ids = new String[count];
- count = 0;
- iter = timezones().entrySet().iterator();
- while (iter.hasNext())
- {
- Map.Entry entry = (Map.Entry) iter.next();
- if (((TimeZone) entry.getValue()).getRawOffset() == rawOffset)
- ids[count++] = (String) entry.getKey();
- }
- return ids;
- }
-
- /**
- * Gets all available IDs.
- * @return An array of all supported IDs.
- */
- public static String[] getAvailableIDs()
- {
- return (String[])
- timezones().keySet().toArray(new String[timezones().size()]);
- }
-
- /**
- * Returns the time zone under which the host is running. This
- * can be changed with setDefault.
- *
- * @return A clone of the current default time zone for this host.
- * @see #setDefault
- */
- public static TimeZone getDefault()
- {
- return (TimeZone) defaultZone().clone();
- }
-
- public static void setDefault(TimeZone zone)
- {
- // Hmmmm. No Security checks?
- defaultZone0 = zone;
- }
-
- /**
- * Test if the other time zone uses the same rule and only
- * possibly differs in ID. This implementation for this particular
- * class will return true if the raw offsets are identical. Subclasses
- * should override this method if they use daylight savings.
- * @return true if this zone has the same raw offset
- */
- public boolean hasSameRules(TimeZone other)
- {
- return other.getRawOffset() == getRawOffset();
- }
-
- /**
- * Returns a clone of this object. I can't imagine, why this is
- * useful for a time zone.
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException ex)
- {
- return null;
- }
- }
-}
diff --git a/libjava/java/util/Timer.java b/libjava/java/util/Timer.java
deleted file mode 100644
index 715f06cf641..00000000000
--- a/libjava/java/util/Timer.java
+++ /dev/null
@@ -1,615 +0,0 @@
-/* Timer.java -- Timer that runs TimerTasks at a later time.
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * Timer that can run TimerTasks at a later time.
- * TimerTasks can be scheduled for one time execution at some time in the
- * future. They can be scheduled to be rescheduled at a time period after the
- * task was last executed. Or they can be scheduled to be executed repeatedly
- * at a fixed rate.
- * <p>
- * The normal scheduling will result in a more or less even delay in time
- * between successive executions, but the executions could drift in time if
- * the task (or other tasks) takes a long time to execute. Fixed delay
- * scheduling guarantees more or less that the task will be executed at a
- * specific time, but if there is ever a delay in execution then the period
- * between successive executions will be shorter. The first method of
- * repeated scheduling is preferred for repeated tasks in response to user
- * interaction, the second method of repeated scheduling is preferred for tasks
- * that act like alarms.
- * <p>
- * The Timer keeps a binary heap as a task priority queue which means that
- * scheduling and serving of a task in a queue of n tasks costs O(log n).
- *
- * @see TimerTask
- * @since 1.3
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class Timer
-{
- /**
- * Priority Task Queue.
- * TimerTasks are kept in a binary heap.
- * The scheduler calls sleep() on the queue when it has nothing to do or
- * has to wait. A sleeping scheduler can be notified by calling interrupt()
- * which is automatically called by the enqueue(), cancel() and
- * timerFinalized() methods.
- */
- private static final class TaskQueue
- {
- /** Default size of this queue */
- private static final int DEFAULT_SIZE = 32;
-
- /** Whether to return null when there is nothing in the queue */
- private boolean nullOnEmpty;
-
- /**
- * The heap containing all the scheduled TimerTasks
- * sorted by the TimerTask.scheduled field.
- * Null when the stop() method has been called.
- */
- private TimerTask heap[];
-
- /**
- * The actual number of elements in the heap
- * Can be less then heap.length.
- * Note that heap[0] is used as a sentinel.
- */
- private int elements;
-
- /**
- * Creates a TaskQueue of default size without any elements in it.
- */
- public TaskQueue()
- {
- heap = new TimerTask[DEFAULT_SIZE];
- elements = 0;
- nullOnEmpty = false;
- }
-
- /**
- * Adds a TimerTask at the end of the heap.
- * Grows the heap if necessary by doubling the heap in size.
- */
- private void add(TimerTask task)
- {
- elements++;
- if (elements == heap.length)
- {
- TimerTask new_heap[] = new TimerTask[heap.length * 2];
- System.arraycopy(heap, 0, new_heap, 0, heap.length);
- heap = new_heap;
- }
- heap[elements] = task;
- }
-
- /**
- * Removes the last element from the heap.
- * Shrinks the heap in half if
- * elements+DEFAULT_SIZE/2 <= heap.length/4.
- */
- private void remove()
- {
- // clear the entry first
- heap[elements] = null;
- elements--;
- if (elements + DEFAULT_SIZE / 2 <= (heap.length / 4))
- {
- TimerTask new_heap[] = new TimerTask[heap.length / 2];
- System.arraycopy(heap, 0, new_heap, 0, elements + 1);
- heap = new_heap;
- }
- }
-
- /**
- * Adds a task to the queue and puts it at the correct place
- * in the heap.
- */
- public synchronized void enqueue(TimerTask task)
- {
- // Check if it is legal to add another element
- if (heap == null)
- {
- throw new IllegalStateException
- ("cannot enqueue when stop() has been called on queue");
- }
-
- heap[0] = task; // sentinel
- add(task); // put the new task at the end
- // Now push the task up in the heap until it has reached its place
- int child = elements;
- int parent = child / 2;
- while (heap[parent].scheduled > task.scheduled)
- {
- heap[child] = heap[parent];
- child = parent;
- parent = child / 2;
- }
- // This is the correct place for the new task
- heap[child] = task;
- heap[0] = null; // clear sentinel
- // Maybe sched() is waiting for a new element
- this.notify();
- }
-
- /**
- * Returns the top element of the queue.
- * Can return null when no task is in the queue.
- */
- private TimerTask top()
- {
- if (elements == 0)
- {
- return null;
- }
- else
- {
- return heap[1];
- }
- }
-
- /**
- * Returns the top task in the Queue.
- * Removes the element from the heap and reorders the heap first.
- * Can return null when there is nothing in the queue.
- */
- public synchronized TimerTask serve()
- {
- // The task to return
- TimerTask task = null;
-
- while (task == null)
- {
- // Get the next task
- task = top();
-
- // return null when asked to stop
- // or if asked to return null when the queue is empty
- if ((heap == null) || (task == null && nullOnEmpty))
- {
- return null;
- }
-
- // Do we have a task?
- if (task != null)
- {
- // The time to wait until the task should be served
- long time = task.scheduled - System.currentTimeMillis();
- if (time > 0)
- {
- // This task should not yet be served
- // So wait until this task is ready
- // or something else happens to the queue
- task = null; // set to null to make sure we call top()
- try
- {
- this.wait(time);
- }
- catch (InterruptedException _)
- {
- }
- }
- }
- else
- {
- // wait until a task is added
- // or something else happens to the queue
- try
- {
- this.wait();
- }
- catch (InterruptedException _)
- {
- }
- }
- }
-
- // reconstruct the heap
- TimerTask lastTask = heap[elements];
- remove();
-
- // drop lastTask at the beginning and move it down the heap
- int parent = 1;
- int child = 2;
- heap[1] = lastTask;
- while (child <= elements)
- {
- if (child < elements)
- {
- if (heap[child].scheduled > heap[child + 1].scheduled)
- {
- child++;
- }
- }
-
- if (lastTask.scheduled <= heap[child].scheduled)
- break; // found the correct place (the parent) - done
-
- heap[parent] = heap[child];
- parent = child;
- child = parent * 2;
- }
-
- // this is the correct new place for the lastTask
- heap[parent] = lastTask;
-
- // return the task
- return task;
- }
-
- /**
- * When nullOnEmpty is true the serve() method will return null when
- * there are no tasks in the queue, otherwise it will wait until
- * a new element is added to the queue. It is used to indicate to
- * the scheduler that no new tasks will ever be added to the queue.
- */
- public synchronized void setNullOnEmpty(boolean nullOnEmpty)
- {
- this.nullOnEmpty = nullOnEmpty;
- this.notify();
- }
-
- /**
- * When this method is called the current and all future calls to
- * serve() will return null. It is used to indicate to the Scheduler
- * that it should stop executing since no more tasks will come.
- */
- public synchronized void stop()
- {
- this.heap = null;
- this.elements = 0;
- this.notify();
- }
-
- } // TaskQueue
-
- /**
- * The scheduler that executes all the tasks on a particular TaskQueue,
- * reschedules any repeating tasks and that waits when no task has to be
- * executed immediatly. Stops running when canceled or when the parent
- * Timer has been finalized and no more tasks have to be executed.
- */
- private static final class Scheduler implements Runnable
- {
- // The priority queue containing all the TimerTasks.
- private TaskQueue queue;
-
- /**
- * Creates a new Scheduler that will schedule the tasks on the
- * given TaskQueue.
- */
- public Scheduler(TaskQueue queue)
- {
- this.queue = queue;
- }
-
- public void run()
- {
- TimerTask task;
- while ((task = queue.serve()) != null)
- {
- // If this task has not been canceled
- if (task.scheduled >= 0)
- {
-
- // Mark execution time
- task.lastExecutionTime = task.scheduled;
-
- // Repeatable task?
- if (task.period < 0)
- {
- // Last time this task is executed
- task.scheduled = -1;
- }
-
- // Run the task
- try
- {
- task.run();
- }
- catch (ThreadDeath death)
- {
- // If an exception escapes, the Timer becomes invalid.
- queue.stop();
- throw death;
- }
- catch (Throwable t)
- {
- // If an exception escapes, the Timer becomes invalid.
- queue.stop();
- }
- }
-
- // Calculate next time and possibly re-enqueue.
- if (task.scheduled >= 0)
- {
- if (task.fixed)
- {
- task.scheduled += task.period;
- }
- else
- {
- task.scheduled = task.period + System.currentTimeMillis();
- }
-
- try
- {
- queue.enqueue(task);
- }
- catch (IllegalStateException ise)
- {
- // Ignore. Apparently the Timer queue has been stopped.
- }
- }
- }
- }
- } // Scheduler
-
- // Number of Timers created.
- // Used for creating nice Thread names.
- private static int nr;
-
- // The queue that all the tasks are put in.
- // Given to the scheduler
- private TaskQueue queue;
-
- // The Scheduler that does all the real work
- private Scheduler scheduler;
-
- // Used to run the scheduler.
- // Also used to checked if the Thread is still running by calling
- // thread.isAlive(). Sometimes a Thread is suddenly killed by the system
- // (if it belonged to an Applet).
- private Thread thread;
-
- // When cancelled we don't accept any more TimerTasks.
- private boolean canceled;
-
- /**
- * Creates a new Timer with a non daemon Thread as Scheduler, with normal
- * priority and a default name.
- */
- public Timer()
- {
- this(false);
- }
-
- /**
- * Creates a new Timer with a daemon Thread as scheduler if daemon is true,
- * with normal priority and a default name.
- */
- public Timer(boolean daemon)
- {
- this(daemon, Thread.NORM_PRIORITY);
- }
-
- /**
- * Creates a new Timer with a daemon Thread as scheduler if daemon is true,
- * with the priority given and a default name.
- */
- private Timer(boolean daemon, int priority)
- {
- this(daemon, priority, "Timer-" + (++nr));
- }
-
- /**
- * Creates a new Timer with a daemon Thread as scheduler if daemon is true,
- * with the priority and name given.E
- */
- private Timer(boolean daemon, int priority, String name)
- {
- canceled = false;
- queue = new TaskQueue();
- scheduler = new Scheduler(queue);
- thread = new Thread(scheduler, name);
- thread.setDaemon(daemon);
- thread.setPriority(priority);
- thread.start();
- }
-
- /**
- * Cancels the execution of the scheduler. If a task is executing it will
- * normally finish execution, but no other tasks will be executed and no
- * more tasks can be scheduled.
- */
- public void cancel()
- {
- canceled = true;
- queue.stop();
- }
-
- /**
- * Schedules the task at Time time, repeating every period
- * milliseconds if period is positive and at a fixed rate if fixed is true.
- *
- * @exception IllegalArgumentException if time is negative
- * @exception IllegalStateException if the task was already scheduled or
- * canceled or this Timer is canceled or the scheduler thread has died
- */
- private void schedule(TimerTask task, long time, long period, boolean fixed)
- {
- if (time < 0)
- throw new IllegalArgumentException("negative time");
-
- if (task.scheduled == 0 && task.lastExecutionTime == -1)
- {
- task.scheduled = time;
- task.period = period;
- task.fixed = fixed;
- }
- else
- {
- throw new IllegalStateException
- ("task was already scheduled or canceled");
- }
-
- if (!this.canceled && this.thread != null)
- {
- queue.enqueue(task);
- }
- else
- {
- throw new IllegalStateException
- ("timer was canceled or scheduler thread has died");
- }
- }
-
- private static void positiveDelay(long delay)
- {
- if (delay < 0)
- {
- throw new IllegalArgumentException("delay is negative");
- }
- }
-
- private static void positivePeriod(long period)
- {
- if (period < 0)
- {
- throw new IllegalArgumentException("period is negative");
- }
- }
-
- /**
- * Schedules the task at the specified data for one time execution.
- *
- * @exception IllegalArgumentException if date.getTime() is negative
- * @exception IllegalStateException if the task was already scheduled or
- * canceled or this Timer is canceled or the scheduler thread has died
- */
- public void schedule(TimerTask task, Date date)
- {
- long time = date.getTime();
- schedule(task, time, -1, false);
- }
-
- /**
- * Schedules the task at the specified date and reschedules the task every
- * period milliseconds after the last execution of the task finishes until
- * this timer or the task is canceled.
- *
- * @exception IllegalArgumentException if period or date.getTime() is
- * negative
- * @exception IllegalStateException if the task was already scheduled or
- * canceled or this Timer is canceled or the scheduler thread has died
- */
- public void schedule(TimerTask task, Date date, long period)
- {
- positivePeriod(period);
- long time = date.getTime();
- schedule(task, time, period, false);
- }
-
- /**
- * Schedules the task after the specified delay milliseconds for one time
- * execution.
- *
- * @exception IllegalArgumentException if delay or
- * System.currentTimeMillis + delay is negative
- * @exception IllegalStateException if the task was already scheduled or
- * canceled or this Timer is canceled or the scheduler thread has died
- */
- public void schedule(TimerTask task, long delay)
- {
- positiveDelay(delay);
- long time = System.currentTimeMillis() + delay;
- schedule(task, time, -1, false);
- }
-
- /**
- * Schedules the task after the delay milliseconds and reschedules the
- * task every period milliseconds after the last execution of the task
- * finishes until this timer or the task is canceled.
- *
- * @exception IllegalArgumentException if delay or period is negative
- * @exception IllegalStateException if the task was already scheduled or
- * canceled or this Timer is canceled or the scheduler thread has died
- */
- public void schedule(TimerTask task, long delay, long period)
- {
- positiveDelay(delay);
- positivePeriod(period);
- long time = System.currentTimeMillis() + delay;
- schedule(task, time, period, false);
- }
-
- /**
- * Schedules the task at the specified date and reschedules the task at a
- * fixed rate every period milliseconds until this timer or the task is
- * canceled.
- *
- * @exception IllegalArgumentException if period or date.getTime() is
- * negative
- * @exception IllegalStateException if the task was already scheduled or
- * canceled or this Timer is canceled or the scheduler thread has died
- */
- public void scheduleAtFixedRate(TimerTask task, Date date, long period)
- {
- positivePeriod(period);
- long time = date.getTime();
- schedule(task, time, period, true);
- }
-
- /**
- * Schedules the task after the delay milliseconds and reschedules the task
- * at a fixed rate every period milliseconds until this timer or the task
- * is canceled.
- *
- * @exception IllegalArgumentException if delay or
- * System.currentTimeMillis + delay is negative
- * @exception IllegalStateException if the task was already scheduled or
- * canceled or this Timer is canceled or the scheduler thread has died
- */
- public void scheduleAtFixedRate(TimerTask task, long delay, long period)
- {
- positiveDelay(delay);
- positivePeriod(period);
- long time = System.currentTimeMillis() + delay;
- schedule(task, time, period, true);
- }
-
- /**
- * Tells the scheduler that the Timer task died
- * so there will be no more new tasks scheduled.
- */
- protected void finalize() throws Throwable
- {
- queue.setNullOnEmpty(true);
- }
-}
diff --git a/libjava/java/util/TimerTask.java b/libjava/java/util/TimerTask.java
deleted file mode 100644
index b03118ad0fe..00000000000
--- a/libjava/java/util/TimerTask.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/* TimerTask.java -- Task that can be run at a later time if given to a Timer.
- Copyright (C) 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * Task that can be run at a later time if given to a Timer.
- * The TimerTask must implement a run method that will be called by the
- * Timer when the task is scheduled for execution. The task can check when
- * it should have been scheduled and cancel itself when no longer needed.
- * <p>
- * Example:
- * <pre>
- * Timer timer = new Timer();
- * TimerTask task = new TimerTask() {
- * public void run() {
- * if (this.scheduledExecutionTime() &lt; System.currentTimeMillis() + 500)
- * // Do something
- * else
- * // Complain: We are more then half a second late!
- * if (someStopCondition)
- * this.cancel(); // This was our last execution
- * };
- * timer.scheduleAtFixedRate(task, 1000, 1000); // schedule every second
- * </pre>
- * <p>
- * Note that a TimerTask object is a one shot object and can only given once
- * to a Timer. (The Timer will use the TimerTask object for bookkeeping,
- * in this implementation).
- * <p>
- * This class also implements <code>Runnable</code> to make it possible to
- * give a TimerTask directly as a target to a <code>Thread</code>.
- *
- * @see Timer
- * @since 1.3
- * @author Mark Wielaard (mark@klomp.org)
- */
-public abstract class TimerTask implements Runnable
-{
- /**
- * If positive the next time this task should be run.
- * If negative this TimerTask is canceled or executed for the last time.
- */
- long scheduled;
-
- /**
- * If positive the last time this task was run.
- * If negative this TimerTask has not yet been scheduled.
- */
- long lastExecutionTime;
-
- /**
- * If positive the number of milliseconds between runs of this task.
- * If -1 this task doesn't have to be run more then once.
- */
- long period;
-
- /**
- * If true the next time this task should be run is relative to
- * the last scheduled time, otherwise it can drift in time.
- */
- boolean fixed;
-
- /**
- * Creates a TimerTask and marks it as not yet scheduled.
- */
- protected TimerTask()
- {
- this.scheduled = 0;
- this.lastExecutionTime = -1;
- }
-
- /**
- * Marks the task as canceled and prevents any further execution.
- * Returns true if the task was scheduled for any execution in the future
- * and this cancel operation prevents that execution from happening.
- * <p>
- * A task that has been canceled can never be scheduled again.
- * <p>
- * In this implementation the TimerTask it is possible that the Timer does
- * keep a reference to the TimerTask until the first time the TimerTask
- * is actually scheduled. But the reference will disappear immediatly when
- * cancel is called from within the TimerTask run method.
- */
- public boolean cancel()
- {
- boolean prevented_execution = (this.scheduled >= 0);
- this.scheduled = -1;
- return prevented_execution;
- }
-
- /**
- * Method that is called when this task is scheduled for execution.
- */
- public abstract void run();
-
- /**
- * Returns the last time this task was scheduled or (when called by the
- * task from the run method) the time the current execution of the task
- * was scheduled. When the task has not yet run the return value is
- * undefined.
- * <p>
- * Can be used (when the task is scheduled at fixed rate) to see the
- * difference between the requested schedule time and the actual time
- * that can be found with <code>System.currentTimeMillis()</code>.
- */
- public long scheduledExecutionTime()
- {
- return lastExecutionTime;
- }
-}
diff --git a/libjava/java/util/TooManyListenersException.java b/libjava/java/util/TooManyListenersException.java
deleted file mode 100644
index 92ad772f2bb..00000000000
--- a/libjava/java/util/TooManyListenersException.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* TooManyListenersException.java -- thrown when a unicast event can't accept
- another Listener
- Copyright (C) 1998, 1999, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-/**
- * This exception is part of the java event model. It is thrown if an
- * event listener is added via the addXyzEventListener method, but the
- * object doesn't support any more listeners, e.g. it only supports a
- * single event listener.
- *
- * @author Jochen Hoenicke
- * @author Warren Levy (warrenl@cygnus.com)
- * @see EventListener
- * @see EventObject
- * @since 1.1
- * @status updated to 1.4
- */
-public class TooManyListenersException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 5074640544770687831L;
-
- /**
- * Constructs a TooManyListenersException with no detail message.
- */
- public TooManyListenersException()
- {
- }
-
- /**
- * Constructs a TooManyListenersException with a detail message.
- *
- * @param detail the detail message
- */
- public TooManyListenersException(String detail)
- {
- super(detail);
- }
-}
diff --git a/libjava/java/util/TreeMap.java b/libjava/java/util/TreeMap.java
deleted file mode 100644
index bddf97d9a33..00000000000
--- a/libjava/java/util/TreeMap.java
+++ /dev/null
@@ -1,1781 +0,0 @@
-/* TreeMap.java -- a class providing a basic Red-Black Tree data structure,
- mapping Object --> Object
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-/**
- * This class provides a red-black tree implementation of the SortedMap
- * interface. Elements in the Map will be sorted by either a user-provided
- * Comparator object, or by the natural ordering of the keys.
- *
- * The algorithms are adopted from Corman, Leiserson, and Rivest's
- * <i>Introduction to Algorithms.</i> TreeMap guarantees O(log n)
- * insertion and deletion of elements. That being said, there is a large
- * enough constant coefficient in front of that "log n" (overhead involved
- * in keeping the tree balanced), that TreeMap may not be the best choice
- * for small collections. If something is already sorted, you may want to
- * just use a LinkedHashMap to maintain the order while providing O(1) access.
- *
- * TreeMap is a part of the JDK1.2 Collections API. Null keys are allowed
- * only if a Comparator is used which can deal with them; natural ordering
- * cannot cope with null. Null values are always allowed. Note that the
- * ordering must be <i>consistent with equals</i> to correctly implement
- * the Map interface. If this condition is violated, the map is still
- * well-behaved, but you may have suprising results when comparing it to
- * other maps.<p>
- *
- * This implementation is not synchronized. If you need to share this between
- * multiple threads, do something like:<br>
- * <code>SortedMap m
- * = Collections.synchronizedSortedMap(new TreeMap(...));</code><p>
- *
- * The iterators are <i>fail-fast</i>, meaning that any structural
- * modification, except for <code>remove()</code> called on the iterator
- * itself, cause the iterator to throw a
- * <code>ConcurrentModificationException</code> rather than exhibit
- * non-deterministic behavior.
- *
- * @author Jon Zeppieri
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Map
- * @see HashMap
- * @see Hashtable
- * @see LinkedHashMap
- * @see Comparable
- * @see Comparator
- * @see Collection
- * @see Collections#synchronizedSortedMap(SortedMap)
- * @since 1.2
- * @status updated to 1.4
- */
-public class TreeMap extends AbstractMap
- implements SortedMap, Cloneable, Serializable
-{
- // Implementation note:
- // A red-black tree is a binary search tree with the additional properties
- // that all paths to a leaf node visit the same number of black nodes,
- // and no red node has red children. To avoid some null-pointer checks,
- // we use the special node nil which is always black, has no relatives,
- // and has key and value of null (but is not equal to a mapping of null).
-
- /**
- * Compatible with JDK 1.2.
- */
- private static final long serialVersionUID = 919286545866124006L;
-
- /**
- * Color status of a node. Package visible for use by nested classes.
- */
- static final int RED = -1,
- BLACK = 1;
-
- /**
- * Sentinal node, used to avoid null checks for corner cases and make the
- * delete rebalance code simpler. The rebalance code must never assign
- * the parent, left, or right of nil, but may safely reassign the color
- * to be black. This object must never be used as a key in a TreeMap, or
- * it will break bounds checking of a SubMap.
- */
- static final Node nil = new Node(null, null, BLACK);
- static
- {
- // Nil is self-referential, so we must initialize it after creation.
- nil.parent = nil;
- nil.left = nil;
- nil.right = nil;
- }
-
- /**
- * The root node of this TreeMap.
- */
- private transient Node root;
-
- /**
- * The size of this TreeMap. Package visible for use by nested classes.
- */
- transient int size;
-
- /**
- * The cache for {@link #entrySet()}.
- */
- private transient Set entries;
-
- /**
- * Counts the number of modifications this TreeMap has undergone, used
- * by Iterators to know when to throw ConcurrentModificationExceptions.
- * Package visible for use by nested classes.
- */
- transient int modCount;
-
- /**
- * This TreeMap's comparator, or null for natural ordering.
- * Package visible for use by nested classes.
- * @serial the comparator ordering this tree, or null
- */
- final Comparator comparator;
-
- /**
- * Class to represent an entry in the tree. Holds a single key-value pair,
- * plus pointers to parent and child nodes.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private static final class Node extends AbstractMap.BasicMapEntry
- {
- // All fields package visible for use by nested classes.
- /** The color of this node. */
- int color;
-
- /** The left child node. */
- Node left = nil;
- /** The right child node. */
- Node right = nil;
- /** The parent node. */
- Node parent = nil;
-
- /**
- * Simple constructor.
- * @param key the key
- * @param value the value
- */
- Node(Object key, Object value, int color)
- {
- super(key, value);
- this.color = color;
- }
- }
-
- /**
- * Instantiate a new TreeMap with no elements, using the keys' natural
- * ordering to sort. All entries in the map must have a key which implements
- * Comparable, and which are <i>mutually comparable</i>, otherwise map
- * operations may throw a {@link ClassCastException}. Attempts to use
- * a null key will throw a {@link NullPointerException}.
- *
- * @see Comparable
- */
- public TreeMap()
- {
- this((Comparator) null);
- }
-
- /**
- * Instantiate a new TreeMap with no elements, using the provided comparator
- * to sort. All entries in the map must have keys which are mutually
- * comparable by the Comparator, otherwise map operations may throw a
- * {@link ClassCastException}.
- *
- * @param comparator the sort order for the keys of this map, or null
- * for the natural order
- */
- public TreeMap(Comparator c)
- {
- comparator = c;
- fabricateTree(0);
- }
-
- /**
- * Instantiate a new TreeMap, initializing it with all of the elements in
- * the provided Map. The elements will be sorted using the natural
- * ordering of the keys. This algorithm runs in n*log(n) time. All entries
- * in the map must have keys which implement Comparable and are mutually
- * comparable, otherwise map operations may throw a
- * {@link ClassCastException}.
- *
- * @param map a Map, whose entries will be put into this TreeMap
- * @throws ClassCastException if the keys in the provided Map are not
- * comparable
- * @throws NullPointerException if map is null
- * @see Comparable
- */
- public TreeMap(Map map)
- {
- this((Comparator) null);
- putAll(map);
- }
-
- /**
- * Instantiate a new TreeMap, initializing it with all of the elements in
- * the provided SortedMap. The elements will be sorted using the same
- * comparator as in the provided SortedMap. This runs in linear time.
- *
- * @param sm a SortedMap, whose entries will be put into this TreeMap
- * @throws NullPointerException if sm is null
- */
- public TreeMap(SortedMap sm)
- {
- this(sm.comparator());
- int pos = sm.size();
- Iterator itr = sm.entrySet().iterator();
-
- fabricateTree(pos);
- Node node = firstNode();
-
- while (--pos >= 0)
- {
- Map.Entry me = (Map.Entry) itr.next();
- node.key = me.getKey();
- node.value = me.getValue();
- node = successor(node);
- }
- }
-
- /**
- * Clears the Map so it has no keys. This is O(1).
- */
- public void clear()
- {
- if (size > 0)
- {
- modCount++;
- root = nil;
- size = 0;
- }
- }
-
- /**
- * Returns a shallow clone of this TreeMap. The Map itself is cloned,
- * but its contents are not.
- *
- * @return the clone
- */
- public Object clone()
- {
- TreeMap copy = null;
- try
- {
- copy = (TreeMap) super.clone();
- }
- catch (CloneNotSupportedException x)
- {
- }
- copy.entries = null;
- copy.fabricateTree(size);
-
- Node node = firstNode();
- Node cnode = copy.firstNode();
-
- while (node != nil)
- {
- cnode.key = node.key;
- cnode.value = node.value;
- node = successor(node);
- cnode = copy.successor(cnode);
- }
- return copy;
- }
-
- /**
- * Return the comparator used to sort this map, or null if it is by
- * natural order.
- *
- * @return the map's comparator
- */
- public Comparator comparator()
- {
- return comparator;
- }
-
- /**
- * Returns true if the map contains a mapping for the given key.
- *
- * @param key the key to look for
- * @return true if the key has a mapping
- * @throws ClassCastException if key is not comparable to map elements
- * @throws NullPointerException if key is null and the comparator is not
- * tolerant of nulls
- */
- public boolean containsKey(Object key)
- {
- return getNode(key) != nil;
- }
-
- /**
- * Returns true if the map contains at least one mapping to the given value.
- * This requires linear time.
- *
- * @param value the value to look for
- * @return true if the value appears in a mapping
- */
- public boolean containsValue(Object value)
- {
- Node node = firstNode();
- while (node != nil)
- {
- if (equals(value, node.value))
- return true;
- node = successor(node);
- }
- return false;
- }
-
- /**
- * Returns a "set view" of this TreeMap's entries. The set is backed by
- * the TreeMap, so changes in one show up in the other. The set supports
- * element removal, but not element addition.<p>
- *
- * Note that the iterators for all three views, from keySet(), entrySet(),
- * and values(), traverse the TreeMap in sorted sequence.
- *
- * @return a set view of the entries
- * @see #keySet()
- * @see #values()
- * @see Map.Entry
- */
- public Set entrySet()
- {
- if (entries == null)
- // Create an AbstractSet with custom implementations of those methods
- // that can be overriden easily and efficiently.
- entries = new AbstractSet()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- return new TreeIterator(ENTRIES);
- }
-
- public void clear()
- {
- TreeMap.this.clear();
- }
-
- public boolean contains(Object o)
- {
- if (! (o instanceof Map.Entry))
- return false;
- Map.Entry me = (Map.Entry) o;
- Node n = getNode(me.getKey());
- return n != nil && AbstractSet.equals(me.getValue(), n.value);
- }
-
- public boolean remove(Object o)
- {
- if (! (o instanceof Map.Entry))
- return false;
- Map.Entry me = (Map.Entry) o;
- Node n = getNode(me.getKey());
- if (n != nil && AbstractSet.equals(me.getValue(), n.value))
- {
- removeNode(n);
- return true;
- }
- return false;
- }
- };
- return entries;
- }
-
- /**
- * Returns the first (lowest) key in the map.
- *
- * @return the first key
- * @throws NoSuchElementException if the map is empty
- */
- public Object firstKey()
- {
- if (root == nil)
- throw new NoSuchElementException();
- return firstNode().key;
- }
-
- /**
- * Return the value in this TreeMap associated with the supplied key,
- * or <code>null</code> if the key maps to nothing. NOTE: Since the value
- * could also be null, you must use containsKey to see if this key
- * actually maps to something.
- *
- * @param key the key for which to fetch an associated value
- * @return what the key maps to, if present
- * @throws ClassCastException if key is not comparable to elements in the map
- * @throws NullPointerException if key is null but the comparator does not
- * tolerate nulls
- * @see #put(Object, Object)
- * @see #containsKey(Object)
- */
- public Object get(Object key)
- {
- // Exploit fact that nil.value == null.
- return getNode(key).value;
- }
-
- /**
- * Returns a view of this Map including all entries with keys less than
- * <code>toKey</code>. The returned map is backed by the original, so changes
- * in one appear in the other. The submap will throw an
- * {@link IllegalArgumentException} for any attempt to access or add an
- * element beyond the specified cutoff. The returned map does not include
- * the endpoint; if you want inclusion, pass the successor element.
- *
- * @param toKey the (exclusive) cutoff point
- * @return a view of the map less than the cutoff
- * @throws ClassCastException if <code>toKey</code> is not compatible with
- * the comparator (or is not Comparable, for natural ordering)
- * @throws NullPointerException if toKey is null, but the comparator does not
- * tolerate null elements
- */
- public SortedMap headMap(Object toKey)
- {
- return new SubMap(nil, toKey);
- }
-
- /**
- * Returns a "set view" of this TreeMap's keys. The set is backed by the
- * TreeMap, so changes in one show up in the other. The set supports
- * element removal, but not element addition.
- *
- * @return a set view of the keys
- * @see #values()
- * @see #entrySet()
- */
- public Set keySet()
- {
- if (keys == null)
- // Create an AbstractSet with custom implementations of those methods
- // that can be overriden easily and efficiently.
- keys = new AbstractSet()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- return new TreeIterator(KEYS);
- }
-
- public void clear()
- {
- TreeMap.this.clear();
- }
-
- public boolean contains(Object o)
- {
- return containsKey(o);
- }
-
- public boolean remove(Object key)
- {
- Node n = getNode(key);
- if (n == nil)
- return false;
- removeNode(n);
- return true;
- }
- };
- return keys;
- }
-
- /**
- * Returns the last (highest) key in the map.
- *
- * @return the last key
- * @throws NoSuchElementException if the map is empty
- */
- public Object lastKey()
- {
- if (root == nil)
- throw new NoSuchElementException("empty");
- return lastNode().key;
- }
-
- /**
- * Puts the supplied value into the Map, mapped by the supplied key.
- * The value may be retrieved by any object which <code>equals()</code>
- * this key. NOTE: Since the prior value could also be null, you must
- * first use containsKey if you want to see if you are replacing the
- * key's mapping.
- *
- * @param key the key used to locate the value
- * @param value the value to be stored in the Map
- * @return the prior mapping of the key, or null if there was none
- * @throws ClassCastException if key is not comparable to current map keys
- * @throws NullPointerException if key is null, but the comparator does
- * not tolerate nulls
- * @see #get(Object)
- * @see Object#equals(Object)
- */
- public Object put(Object key, Object value)
- {
- Node current = root;
- Node parent = nil;
- int comparison = 0;
-
- // Find new node's parent.
- while (current != nil)
- {
- parent = current;
- comparison = compare(key, current.key);
- if (comparison > 0)
- current = current.right;
- else if (comparison < 0)
- current = current.left;
- else // Key already in tree.
- return current.setValue(value);
- }
-
- // Set up new node.
- Node n = new Node(key, value, RED);
- n.parent = parent;
-
- // Insert node in tree.
- modCount++;
- size++;
- if (parent == nil)
- {
- // Special case inserting into an empty tree.
- root = n;
- return null;
- }
- if (comparison > 0)
- parent.right = n;
- else
- parent.left = n;
-
- // Rebalance after insert.
- insertFixup(n);
- return null;
- }
-
- /**
- * Copies all elements of the given map into this TreeMap. If this map
- * already has a mapping for a key, the new mapping replaces the current
- * one.
- *
- * @param m the map to be added
- * @throws ClassCastException if a key in m is not comparable with keys
- * in the map
- * @throws NullPointerException if a key in m is null, and the comparator
- * does not tolerate nulls
- */
- public void putAll(Map m)
- {
- Iterator itr = m.entrySet().iterator();
- int pos = m.size();
- while (--pos >= 0)
- {
- Map.Entry e = (Map.Entry) itr.next();
- put(e.getKey(), e.getValue());
- }
- }
-
- /**
- * Removes from the TreeMap and returns the value which is mapped by the
- * supplied key. If the key maps to nothing, then the TreeMap remains
- * unchanged, and <code>null</code> is returned. NOTE: Since the value
- * could also be null, you must use containsKey to see if you are
- * actually removing a mapping.
- *
- * @param key the key used to locate the value to remove
- * @return whatever the key mapped to, if present
- * @throws ClassCastException if key is not comparable to current map keys
- * @throws NullPointerException if key is null, but the comparator does
- * not tolerate nulls
- */
- public Object remove(Object key)
- {
- Node n = getNode(key);
- if (n == nil)
- return null;
- // Note: removeNode can alter the contents of n, so save value now.
- Object result = n.value;
- removeNode(n);
- return result;
- }
-
- /**
- * Returns the number of key-value mappings currently in this Map.
- *
- * @return the size
- */
- public int size()
- {
- return size;
- }
-
- /**
- * Returns a view of this Map including all entries with keys greater or
- * equal to <code>fromKey</code> and less than <code>toKey</code> (a
- * half-open interval). The returned map is backed by the original, so
- * changes in one appear in the other. The submap will throw an
- * {@link IllegalArgumentException} for any attempt to access or add an
- * element beyond the specified cutoffs. The returned map includes the low
- * endpoint but not the high; if you want to reverse this behavior on
- * either end, pass in the successor element.
- *
- * @param fromKey the (inclusive) low cutoff point
- * @param toKey the (exclusive) high cutoff point
- * @return a view of the map between the cutoffs
- * @throws ClassCastException if either cutoff is not compatible with
- * the comparator (or is not Comparable, for natural ordering)
- * @throws NullPointerException if fromKey or toKey is null, but the
- * comparator does not tolerate null elements
- * @throws IllegalArgumentException if fromKey is greater than toKey
- */
- public SortedMap subMap(Object fromKey, Object toKey)
- {
- return new SubMap(fromKey, toKey);
- }
-
- /**
- * Returns a view of this Map including all entries with keys greater or
- * equal to <code>fromKey</code>. The returned map is backed by the
- * original, so changes in one appear in the other. The submap will throw an
- * {@link IllegalArgumentException} for any attempt to access or add an
- * element beyond the specified cutoff. The returned map includes the
- * endpoint; if you want to exclude it, pass in the successor element.
- *
- * @param fromKey the (inclusive) low cutoff point
- * @return a view of the map above the cutoff
- * @throws ClassCastException if <code>fromKey</code> is not compatible with
- * the comparator (or is not Comparable, for natural ordering)
- * @throws NullPointerException if fromKey is null, but the comparator
- * does not tolerate null elements
- */
- public SortedMap tailMap(Object fromKey)
- {
- return new SubMap(fromKey, nil);
- }
-
- /**
- * Returns a "collection view" (or "bag view") of this TreeMap's values.
- * The collection is backed by the TreeMap, so changes in one show up
- * in the other. The collection supports element removal, but not element
- * addition.
- *
- * @return a bag view of the values
- * @see #keySet()
- * @see #entrySet()
- */
- public Collection values()
- {
- if (values == null)
- // We don't bother overriding many of the optional methods, as doing so
- // wouldn't provide any significant performance advantage.
- values = new AbstractCollection()
- {
- public int size()
- {
- return size;
- }
-
- public Iterator iterator()
- {
- return new TreeIterator(VALUES);
- }
-
- public void clear()
- {
- TreeMap.this.clear();
- }
- };
- return values;
- }
-
- /**
- * Compares two elements by the set comparator, or by natural ordering.
- * Package visible for use by nested classes.
- *
- * @param o1 the first object
- * @param o2 the second object
- * @throws ClassCastException if o1 and o2 are not mutually comparable,
- * or are not Comparable with natural ordering
- * @throws NullPointerException if o1 or o2 is null with natural ordering
- */
- final int compare(Object o1, Object o2)
- {
- return (comparator == null
- ? ((Comparable) o1).compareTo(o2)
- : comparator.compare(o1, o2));
- }
-
- /**
- * Maintain red-black balance after deleting a node.
- *
- * @param node the child of the node just deleted, possibly nil
- * @param parent the parent of the node just deleted, never nil
- */
- private void deleteFixup(Node node, Node parent)
- {
- // if (parent == nil)
- // throw new InternalError();
- // If a black node has been removed, we need to rebalance to avoid
- // violating the "same number of black nodes on any path" rule. If
- // node is red, we can simply recolor it black and all is well.
- while (node != root && node.color == BLACK)
- {
- if (node == parent.left)
- {
- // Rebalance left side.
- Node sibling = parent.right;
- // if (sibling == nil)
- // throw new InternalError();
- if (sibling.color == RED)
- {
- // Case 1: Sibling is red.
- // Recolor sibling and parent, and rotate parent left.
- sibling.color = BLACK;
- parent.color = RED;
- rotateLeft(parent);
- sibling = parent.right;
- }
-
- if (sibling.left.color == BLACK && sibling.right.color == BLACK)
- {
- // Case 2: Sibling has no red children.
- // Recolor sibling, and move to parent.
- sibling.color = RED;
- node = parent;
- parent = parent.parent;
- }
- else
- {
- if (sibling.right.color == BLACK)
- {
- // Case 3: Sibling has red left child.
- // Recolor sibling and left child, rotate sibling right.
- sibling.left.color = BLACK;
- sibling.color = RED;
- rotateRight(sibling);
- sibling = parent.right;
- }
- // Case 4: Sibling has red right child. Recolor sibling,
- // right child, and parent, and rotate parent left.
- sibling.color = parent.color;
- parent.color = BLACK;
- sibling.right.color = BLACK;
- rotateLeft(parent);
- node = root; // Finished.
- }
- }
- else
- {
- // Symmetric "mirror" of left-side case.
- Node sibling = parent.left;
- // if (sibling == nil)
- // throw new InternalError();
- if (sibling.color == RED)
- {
- // Case 1: Sibling is red.
- // Recolor sibling and parent, and rotate parent right.
- sibling.color = BLACK;
- parent.color = RED;
- rotateRight(parent);
- sibling = parent.left;
- }
-
- if (sibling.right.color == BLACK && sibling.left.color == BLACK)
- {
- // Case 2: Sibling has no red children.
- // Recolor sibling, and move to parent.
- sibling.color = RED;
- node = parent;
- parent = parent.parent;
- }
- else
- {
- if (sibling.left.color == BLACK)
- {
- // Case 3: Sibling has red right child.
- // Recolor sibling and right child, rotate sibling left.
- sibling.right.color = BLACK;
- sibling.color = RED;
- rotateLeft(sibling);
- sibling = parent.left;
- }
- // Case 4: Sibling has red left child. Recolor sibling,
- // left child, and parent, and rotate parent right.
- sibling.color = parent.color;
- parent.color = BLACK;
- sibling.left.color = BLACK;
- rotateRight(parent);
- node = root; // Finished.
- }
- }
- }
- node.color = BLACK;
- }
-
- /**
- * Construct a perfectly balanced tree consisting of n "blank" nodes. This
- * permits a tree to be generated from pre-sorted input in linear time.
- *
- * @param count the number of blank nodes, non-negative
- */
- private void fabricateTree(final int count)
- {
- if (count == 0)
- {
- root = nil;
- size = 0;
- return;
- }
-
- // We color every row of nodes black, except for the overflow nodes.
- // I believe that this is the optimal arrangement. We construct the tree
- // in place by temporarily linking each node to the next node in the row,
- // then updating those links to the children when working on the next row.
-
- // Make the root node.
- root = new Node(null, null, BLACK);
- size = count;
- Node row = root;
- int rowsize;
-
- // Fill each row that is completely full of nodes.
- for (rowsize = 2; rowsize + rowsize <= count; rowsize <<= 1)
- {
- Node parent = row;
- Node last = null;
- for (int i = 0; i < rowsize; i += 2)
- {
- Node left = new Node(null, null, BLACK);
- Node right = new Node(null, null, BLACK);
- left.parent = parent;
- left.right = right;
- right.parent = parent;
- parent.left = left;
- Node next = parent.right;
- parent.right = right;
- parent = next;
- if (last != null)
- last.right = left;
- last = right;
- }
- row = row.left;
- }
-
- // Now do the partial final row in red.
- int overflow = count - rowsize;
- Node parent = row;
- int i;
- for (i = 0; i < overflow; i += 2)
- {
- Node left = new Node(null, null, RED);
- Node right = new Node(null, null, RED);
- left.parent = parent;
- right.parent = parent;
- parent.left = left;
- Node next = parent.right;
- parent.right = right;
- parent = next;
- }
- // Add a lone left node if necessary.
- if (i - overflow == 0)
- {
- Node left = new Node(null, null, RED);
- left.parent = parent;
- parent.left = left;
- parent = parent.right;
- left.parent.right = nil;
- }
- // Unlink the remaining nodes of the previous row.
- while (parent != nil)
- {
- Node next = parent.right;
- parent.right = nil;
- parent = next;
- }
- }
-
- /**
- * Returns the first sorted node in the map, or nil if empty. Package
- * visible for use by nested classes.
- *
- * @return the first node
- */
- final Node firstNode()
- {
- // Exploit fact that nil.left == nil.
- Node node = root;
- while (node.left != nil)
- node = node.left;
- return node;
- }
-
- /**
- * Return the TreeMap.Node associated with key, or the nil node if no such
- * node exists in the tree. Package visible for use by nested classes.
- *
- * @param key the key to search for
- * @return the node where the key is found, or nil
- */
- final Node getNode(Object key)
- {
- Node current = root;
- while (current != nil)
- {
- int comparison = compare(key, current.key);
- if (comparison > 0)
- current = current.right;
- else if (comparison < 0)
- current = current.left;
- else
- return current;
- }
- return current;
- }
-
- /**
- * Find the "highest" node which is &lt; key. If key is nil, return last
- * node. Package visible for use by nested classes.
- *
- * @param key the upper bound, exclusive
- * @return the previous node
- */
- final Node highestLessThan(Object key)
- {
- if (key == nil)
- return lastNode();
-
- Node last = nil;
- Node current = root;
- int comparison = 0;
-
- while (current != nil)
- {
- last = current;
- comparison = compare(key, current.key);
- if (comparison > 0)
- current = current.right;
- else if (comparison < 0)
- current = current.left;
- else // Exact match.
- return predecessor(last);
- }
- return comparison <= 0 ? predecessor(last) : last;
- }
-
- /**
- * Maintain red-black balance after inserting a new node.
- *
- * @param n the newly inserted node
- */
- private void insertFixup(Node n)
- {
- // Only need to rebalance when parent is a RED node, and while at least
- // 2 levels deep into the tree (ie: node has a grandparent). Remember
- // that nil.color == BLACK.
- while (n.parent.color == RED && n.parent.parent != nil)
- {
- if (n.parent == n.parent.parent.left)
- {
- Node uncle = n.parent.parent.right;
- // Uncle may be nil, in which case it is BLACK.
- if (uncle.color == RED)
- {
- // Case 1. Uncle is RED: Change colors of parent, uncle,
- // and grandparent, and move n to grandparent.
- n.parent.color = BLACK;
- uncle.color = BLACK;
- uncle.parent.color = RED;
- n = uncle.parent;
- }
- else
- {
- if (n == n.parent.right)
- {
- // Case 2. Uncle is BLACK and x is right child.
- // Move n to parent, and rotate n left.
- n = n.parent;
- rotateLeft(n);
- }
- // Case 3. Uncle is BLACK and x is left child.
- // Recolor parent, grandparent, and rotate grandparent right.
- n.parent.color = BLACK;
- n.parent.parent.color = RED;
- rotateRight(n.parent.parent);
- }
- }
- else
- {
- // Mirror image of above code.
- Node uncle = n.parent.parent.left;
- // Uncle may be nil, in which case it is BLACK.
- if (uncle.color == RED)
- {
- // Case 1. Uncle is RED: Change colors of parent, uncle,
- // and grandparent, and move n to grandparent.
- n.parent.color = BLACK;
- uncle.color = BLACK;
- uncle.parent.color = RED;
- n = uncle.parent;
- }
- else
- {
- if (n == n.parent.left)
- {
- // Case 2. Uncle is BLACK and x is left child.
- // Move n to parent, and rotate n right.
- n = n.parent;
- rotateRight(n);
- }
- // Case 3. Uncle is BLACK and x is right child.
- // Recolor parent, grandparent, and rotate grandparent left.
- n.parent.color = BLACK;
- n.parent.parent.color = RED;
- rotateLeft(n.parent.parent);
- }
- }
- }
- root.color = BLACK;
- }
-
- /**
- * Returns the last sorted node in the map, or nil if empty.
- *
- * @return the last node
- */
- private Node lastNode()
- {
- // Exploit fact that nil.right == nil.
- Node node = root;
- while (node.right != nil)
- node = node.right;
- return node;
- }
-
- /**
- * Find the "lowest" node which is &gt;= key. If key is nil, return either
- * nil or the first node, depending on the parameter first.
- * Package visible for use by nested classes.
- *
- * @param key the lower bound, inclusive
- * @param first true to return the first element instead of nil for nil key
- * @return the next node
- */
- final Node lowestGreaterThan(Object key, boolean first)
- {
- if (key == nil)
- return first ? firstNode() : nil;
-
- Node last = nil;
- Node current = root;
- int comparison = 0;
-
- while (current != nil)
- {
- last = current;
- comparison = compare(key, current.key);
- if (comparison > 0)
- current = current.right;
- else if (comparison < 0)
- current = current.left;
- else
- return current;
- }
- return comparison > 0 ? successor(last) : last;
- }
-
- /**
- * Return the node preceding the given one, or nil if there isn't one.
- *
- * @param node the current node, not nil
- * @return the prior node in sorted order
- */
- private Node predecessor(Node node)
- {
- if (node.left != nil)
- {
- node = node.left;
- while (node.right != nil)
- node = node.right;
- return node;
- }
-
- Node parent = node.parent;
- // Exploit fact that nil.left == nil and node is non-nil.
- while (node == parent.left)
- {
- node = parent;
- parent = node.parent;
- }
- return parent;
- }
-
- /**
- * Construct a tree from sorted keys in linear time. Package visible for
- * use by TreeSet.
- *
- * @param s the stream to read from
- * @param count the number of keys to read
- * @param readValue true to read values, false to insert "" as the value
- * @throws ClassNotFoundException if the underlying stream fails
- * @throws IOException if the underlying stream fails
- * @see #readObject(ObjectInputStream)
- * @see TreeSet#readObject(ObjectInputStream)
- */
- final void putFromObjStream(ObjectInputStream s, int count,
- boolean readValues)
- throws IOException, ClassNotFoundException
- {
- fabricateTree(count);
- Node node = firstNode();
-
- while (--count >= 0)
- {
- node.key = s.readObject();
- node.value = readValues ? s.readObject() : "";
- node = successor(node);
- }
- }
-
- /**
- * Construct a tree from sorted keys in linear time, with values of "".
- * Package visible for use by TreeSet.
- *
- * @param keys the iterator over the sorted keys
- * @param count the number of nodes to insert
- * @see TreeSet#TreeSet(SortedSet)
- */
- final void putKeysLinear(Iterator keys, int count)
- {
- fabricateTree(count);
- Node node = firstNode();
-
- while (--count >= 0)
- {
- node.key = keys.next();
- node.value = "";
- node = successor(node);
- }
- }
-
- /**
- * Deserializes this object from the given stream.
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if the underlying stream fails
- * @throws IOException if the underlying stream fails
- * @serialData the <i>size</i> (int), followed by key (Object) and value
- * (Object) pairs in sorted order
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- int size = s.readInt();
- putFromObjStream(s, size, true);
- }
-
- /**
- * Remove node from tree. This will increment modCount and decrement size.
- * Node must exist in the tree. Package visible for use by nested classes.
- *
- * @param node the node to remove
- */
- final void removeNode(Node node)
- {
- Node splice;
- Node child;
-
- modCount++;
- size--;
-
- // Find splice, the node at the position to actually remove from the tree.
- if (node.left == nil)
- {
- // Node to be deleted has 0 or 1 children.
- splice = node;
- child = node.right;
- }
- else if (node.right == nil)
- {
- // Node to be deleted has 1 child.
- splice = node;
- child = node.left;
- }
- else
- {
- // Node has 2 children. Splice is node's predecessor, and we swap
- // its contents into node.
- splice = node.left;
- while (splice.right != nil)
- splice = splice.right;
- child = splice.left;
- node.key = splice.key;
- node.value = splice.value;
- }
-
- // Unlink splice from the tree.
- Node parent = splice.parent;
- if (child != nil)
- child.parent = parent;
- if (parent == nil)
- {
- // Special case for 0 or 1 node remaining.
- root = child;
- return;
- }
- if (splice == parent.left)
- parent.left = child;
- else
- parent.right = child;
-
- if (splice.color == BLACK)
- deleteFixup(child, parent);
- }
-
- /**
- * Rotate node n to the left.
- *
- * @param node the node to rotate
- */
- private void rotateLeft(Node node)
- {
- Node child = node.right;
- // if (node == nil || child == nil)
- // throw new InternalError();
-
- // Establish node.right link.
- node.right = child.left;
- if (child.left != nil)
- child.left.parent = node;
-
- // Establish child->parent link.
- child.parent = node.parent;
- if (node.parent != nil)
- {
- if (node == node.parent.left)
- node.parent.left = child;
- else
- node.parent.right = child;
- }
- else
- root = child;
-
- // Link n and child.
- child.left = node;
- node.parent = child;
- }
-
- /**
- * Rotate node n to the right.
- *
- * @param node the node to rotate
- */
- private void rotateRight(Node node)
- {
- Node child = node.left;
- // if (node == nil || child == nil)
- // throw new InternalError();
-
- // Establish node.left link.
- node.left = child.right;
- if (child.right != nil)
- child.right.parent = node;
-
- // Establish child->parent link.
- child.parent = node.parent;
- if (node.parent != nil)
- {
- if (node == node.parent.right)
- node.parent.right = child;
- else
- node.parent.left = child;
- }
- else
- root = child;
-
- // Link n and child.
- child.right = node;
- node.parent = child;
- }
-
- /**
- * Return the node following the given one, or nil if there isn't one.
- * Package visible for use by nested classes.
- *
- * @param node the current node, not nil
- * @return the next node in sorted order
- */
- final Node successor(Node node)
- {
- if (node.right != nil)
- {
- node = node.right;
- while (node.left != nil)
- node = node.left;
- return node;
- }
-
- Node parent = node.parent;
- // Exploit fact that nil.right == nil and node is non-nil.
- while (node == parent.right)
- {
- node = parent;
- parent = parent.parent;
- }
- return parent;
- }
-
- /**
- * Serializes this object to the given stream.
- *
- * @param s the stream to write to
- * @throws IOException if the underlying stream fails
- * @serialData the <i>size</i> (int), followed by key (Object) and value
- * (Object) pairs in sorted order
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- s.defaultWriteObject();
-
- Node node = firstNode();
- s.writeInt(size);
- while (node != nil)
- {
- s.writeObject(node.key);
- s.writeObject(node.value);
- node = successor(node);
- }
- }
-
- /**
- * Iterate over TreeMap's entries. This implementation is parameterized
- * to give a sequential view of keys, values, or entries.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private final class TreeIterator implements Iterator
- {
- /**
- * The type of this Iterator: {@link #KEYS}, {@link #VALUES},
- * or {@link #ENTRIES}.
- */
- private final int type;
- /** The number of modifications to the backing Map that we know about. */
- private int knownMod = modCount;
- /** The last Entry returned by a next() call. */
- private Node last;
- /** The next entry that should be returned by next(). */
- private Node next;
- /**
- * The last node visible to this iterator. This is used when iterating
- * on a SubMap.
- */
- private final Node max;
-
- /**
- * Construct a new TreeIterator with the supplied type.
- * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
- */
- TreeIterator(int type)
- {
- // FIXME gcj cannot handle this. Bug java/4695
- // this(type, firstNode(), nil);
- this.type = type;
- this.next = firstNode();
- this.max = nil;
- }
-
- /**
- * Construct a new TreeIterator with the supplied type. Iteration will
- * be from "first" (inclusive) to "max" (exclusive).
- *
- * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
- * @param first where to start iteration, nil for empty iterator
- * @param max the cutoff for iteration, nil for all remaining nodes
- */
- TreeIterator(int type, Node first, Node max)
- {
- this.type = type;
- this.next = first;
- this.max = max;
- }
-
- /**
- * Returns true if the Iterator has more elements.
- * @return true if there are more elements
- * @throws ConcurrentModificationException if the TreeMap was modified
- */
- public boolean hasNext()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- return next != max;
- }
-
- /**
- * Returns the next element in the Iterator's sequential view.
- * @return the next element
- * @throws ConcurrentModificationException if the TreeMap was modified
- * @throws NoSuchElementException if there is none
- */
- public Object next()
- {
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- if (next == max)
- throw new NoSuchElementException();
- last = next;
- next = successor(last);
-
- if (type == VALUES)
- return last.value;
- else if (type == KEYS)
- return last.key;
- return last;
- }
-
- /**
- * Removes from the backing TreeMap the last element which was fetched
- * with the <code>next()</code> method.
- * @throws ConcurrentModificationException if the TreeMap was modified
- * @throws IllegalStateException if called when there is no last element
- */
- public void remove()
- {
- if (last == null)
- throw new IllegalStateException();
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
-
- removeNode(last);
- last = null;
- knownMod++;
- }
- } // class TreeIterator
-
- /**
- * Implementation of {@link #subMap(Object, Object)} and other map
- * ranges. This class provides a view of a portion of the original backing
- * map, and throws {@link IllegalArgumentException} for attempts to
- * access beyond that range.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- */
- private final class SubMap extends AbstractMap implements SortedMap
- {
- /**
- * The lower range of this view, inclusive, or nil for unbounded.
- * Package visible for use by nested classes.
- */
- final Object minKey;
-
- /**
- * The upper range of this view, exclusive, or nil for unbounded.
- * Package visible for use by nested classes.
- */
- final Object maxKey;
-
- /**
- * The cache for {@link #entrySet()}.
- */
- private Set entries;
-
- /**
- * Create a SubMap representing the elements between minKey (inclusive)
- * and maxKey (exclusive). If minKey is nil, SubMap has no lower bound
- * (headMap). If maxKey is nil, the SubMap has no upper bound (tailMap).
- *
- * @param minKey the lower bound
- * @param maxKey the upper bound
- * @throws IllegalArgumentException if minKey &gt; maxKey
- */
- SubMap(Object minKey, Object maxKey)
- {
- if (minKey != nil && maxKey != nil && compare(minKey, maxKey) > 0)
- throw new IllegalArgumentException("fromKey > toKey");
- this.minKey = minKey;
- this.maxKey = maxKey;
- }
-
- /**
- * Check if "key" is in within the range bounds for this SubMap. The
- * lower ("from") SubMap range is inclusive, and the upper ("to") bound
- * is exclusive. Package visible for use by nested classes.
- *
- * @param key the key to check
- * @return true if the key is in range
- */
- boolean keyInRange(Object key)
- {
- return ((minKey == nil || compare(key, minKey) >= 0)
- && (maxKey == nil || compare(key, maxKey) < 0));
- }
-
- public void clear()
- {
- Node next = lowestGreaterThan(minKey, true);
- Node max = lowestGreaterThan(maxKey, false);
- while (next != max)
- {
- Node current = next;
- next = successor(current);
- removeNode(current);
- }
- }
-
- public Comparator comparator()
- {
- return comparator;
- }
-
- public boolean containsKey(Object key)
- {
- return keyInRange(key) && TreeMap.this.containsKey(key);
- }
-
- public boolean containsValue(Object value)
- {
- Node node = lowestGreaterThan(minKey, true);
- Node max = lowestGreaterThan(maxKey, false);
- while (node != max)
- {
- if (equals(value, node.getValue()))
- return true;
- node = successor(node);
- }
- return false;
- }
-
- public Set entrySet()
- {
- if (entries == null)
- // Create an AbstractSet with custom implementations of those methods
- // that can be overriden easily and efficiently.
- entries = new AbstractSet()
- {
- public int size()
- {
- return SubMap.this.size();
- }
-
- public Iterator iterator()
- {
- Node first = lowestGreaterThan(minKey, true);
- Node max = lowestGreaterThan(maxKey, false);
- return new TreeIterator(ENTRIES, first, max);
- }
-
- public void clear()
- {
- SubMap.this.clear();
- }
-
- public boolean contains(Object o)
- {
- if (! (o instanceof Map.Entry))
- return false;
- Map.Entry me = (Map.Entry) o;
- Object key = me.getKey();
- if (! keyInRange(key))
- return false;
- Node n = getNode(key);
- return n != nil && AbstractSet.equals(me.getValue(), n.value);
- }
-
- public boolean remove(Object o)
- {
- if (! (o instanceof Map.Entry))
- return false;
- Map.Entry me = (Map.Entry) o;
- Object key = me.getKey();
- if (! keyInRange(key))
- return false;
- Node n = getNode(key);
- if (n != nil && AbstractSet.equals(me.getValue(), n.value))
- {
- removeNode(n);
- return true;
- }
- return false;
- }
- };
- return entries;
- }
-
- public Object firstKey()
- {
- Node node = lowestGreaterThan(minKey, true);
- if (node == nil || ! keyInRange(node.key))
- throw new NoSuchElementException();
- return node.key;
- }
-
- public Object get(Object key)
- {
- if (keyInRange(key))
- return TreeMap.this.get(key);
- return null;
- }
-
- public SortedMap headMap(Object toKey)
- {
- if (! keyInRange(toKey))
- throw new IllegalArgumentException("key outside range");
- return new SubMap(minKey, toKey);
- }
-
- public Set keySet()
- {
- if (this.keys == null)
- // Create an AbstractSet with custom implementations of those methods
- // that can be overriden easily and efficiently.
- this.keys = new AbstractSet()
- {
- public int size()
- {
- return SubMap.this.size();
- }
-
- public Iterator iterator()
- {
- Node first = lowestGreaterThan(minKey, true);
- Node max = lowestGreaterThan(maxKey, false);
- return new TreeIterator(KEYS, first, max);
- }
-
- public void clear()
- {
- SubMap.this.clear();
- }
-
- public boolean contains(Object o)
- {
- if (! keyInRange(o))
- return false;
- return getNode(o) != nil;
- }
-
- public boolean remove(Object o)
- {
- if (! keyInRange(o))
- return false;
- Node n = getNode(o);
- if (n != nil)
- {
- removeNode(n);
- return true;
- }
- return false;
- }
- };
- return this.keys;
- }
-
- public Object lastKey()
- {
- Node node = highestLessThan(maxKey);
- if (node == nil || ! keyInRange(node.key))
- throw new NoSuchElementException();
- return node.key;
- }
-
- public Object put(Object key, Object value)
- {
- if (! keyInRange(key))
- throw new IllegalArgumentException("Key outside range");
- return TreeMap.this.put(key, value);
- }
-
- public Object remove(Object key)
- {
- if (keyInRange(key))
- return TreeMap.this.remove(key);
- return null;
- }
-
- public int size()
- {
- Node node = lowestGreaterThan(minKey, true);
- Node max = lowestGreaterThan(maxKey, false);
- int count = 0;
- while (node != max)
- {
- count++;
- node = successor(node);
- }
- return count;
- }
-
- public SortedMap subMap(Object fromKey, Object toKey)
- {
- if (! keyInRange(fromKey) || ! keyInRange(toKey))
- throw new IllegalArgumentException("key outside range");
- return new SubMap(fromKey, toKey);
- }
-
- public SortedMap tailMap(Object fromKey)
- {
- if (! keyInRange(fromKey))
- throw new IllegalArgumentException("key outside range");
- return new SubMap(fromKey, maxKey);
- }
-
- public Collection values()
- {
- if (this.values == null)
- // Create an AbstractCollection with custom implementations of those
- // methods that can be overriden easily and efficiently.
- this.values = new AbstractCollection()
- {
- public int size()
- {
- return SubMap.this.size();
- }
-
- public Iterator iterator()
- {
- Node first = lowestGreaterThan(minKey, true);
- Node max = lowestGreaterThan(maxKey, false);
- return new TreeIterator(VALUES, first, max);
- }
-
- public void clear()
- {
- SubMap.this.clear();
- }
- };
- return this.values;
- }
- } // class SubMap
-} // class TreeMap
diff --git a/libjava/java/util/TreeSet.java b/libjava/java/util/TreeSet.java
deleted file mode 100644
index 34cb39acc07..00000000000
--- a/libjava/java/util/TreeSet.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/* TreeSet.java -- a class providing a TreeMap-backed SortedSet
- Copyright (C) 1999, 2000, 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-/**
- * This class provides a TreeMap-backed implementation of the SortedSet
- * interface. The elements will be sorted according to their <i>natural
- * order</i>, or according to the provided <code>Comparator</code>.<p>
- *
- * Most operations are O(log n), but there is so much overhead that this
- * makes small sets expensive. Note that the ordering must be <i>consistent
- * with equals</i> to correctly implement the Set interface. If this
- * condition is violated, the set is still well-behaved, but you may have
- * suprising results when comparing it to other sets.<p>
- *
- * This implementation is not synchronized. If you need to share this between
- * multiple threads, do something like:<br>
- * <code>SortedSet s
- * = Collections.synchronizedSortedSet(new TreeSet(...));</code><p>
- *
- * The iterators are <i>fail-fast</i>, meaning that any structural
- * modification, except for <code>remove()</code> called on the iterator
- * itself, cause the iterator to throw a
- * <code>ConcurrentModificationException</code> rather than exhibit
- * non-deterministic behavior.
- *
- * @author Jon Zeppieri
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see Set
- * @see HashSet
- * @see LinkedHashSet
- * @see Comparable
- * @see Comparator
- * @see Collections#synchronizedSortedSet(SortedSet)
- * @see TreeMap
- * @since 1.2
- * @status updated to 1.4
- */
-public class TreeSet extends AbstractSet
- implements SortedSet, Cloneable, Serializable
-{
- /**
- * Compatible with JDK 1.2.
- */
- private static final long serialVersionUID = -2479143000061671589L;
-
- /**
- * The SortedMap which backs this Set.
- */
- // Not final because of readObject. This will always be one of TreeMap or
- // TreeMap.SubMap, which both extend AbstractMap.
- private transient SortedMap map;
-
- /**
- * Construct a new TreeSet whose backing TreeMap using the "natural"
- * ordering of keys. Elements that are not mutually comparable will cause
- * ClassCastExceptions down the road.
- *
- * @see Comparable
- */
- public TreeSet()
- {
- map = new TreeMap();
- }
-
- /**
- * Construct a new TreeSet whose backing TreeMap uses the supplied
- * Comparator. Elements that are not mutually comparable will cause
- * ClassCastExceptions down the road.
- *
- * @param comparator the Comparator this Set will use
- */
- public TreeSet(Comparator comparator)
- {
- map = new TreeMap(comparator);
- }
-
- /**
- * Construct a new TreeSet whose backing TreeMap uses the "natural"
- * orering of the keys and which contains all of the elements in the
- * supplied Collection. This runs in n*log(n) time.
- *
- * @param collection the new Set will be initialized with all
- * of the elements in this Collection
- * @throws ClassCastException if the elements of the collection are not
- * comparable
- * @throws NullPointerException if the collection is null
- * @see Comparable
- */
- public TreeSet(Collection collection)
- {
- map = new TreeMap();
- addAll(collection);
- }
-
- /**
- * Construct a new TreeSet, using the same key ordering as the supplied
- * SortedSet and containing all of the elements in the supplied SortedSet.
- * This constructor runs in linear time.
- *
- * @param sortedSet the new TreeSet will use this SortedSet's comparator
- * and will initialize itself with all its elements
- * @throws NullPointerException if sortedSet is null
- */
- public TreeSet(SortedSet sortedSet)
- {
- map = new TreeMap(sortedSet.comparator());
- Iterator itr = sortedSet.iterator();
- ((TreeMap) map).putKeysLinear(itr, sortedSet.size());
- }
-
- /**
- * This private constructor is used to implement the subSet() calls around
- * a backing TreeMap.SubMap.
- *
- * @param backingMap the submap
- */
- private TreeSet(SortedMap backingMap)
- {
- map = backingMap;
- }
-
- /**
- * Adds the spplied Object to the Set if it is not already in the Set;
- * returns true if the element is added, false otherwise.
- *
- * @param obj the Object to be added to this Set
- * @throws ClassCastException if the element cannot be compared with objects
- * already in the set
- */
- public boolean add(Object obj)
- {
- return map.put(obj, "") == null;
- }
-
- /**
- * Adds all of the elements in the supplied Collection to this TreeSet.
- *
- * @param c The collection to add
- * @return true if the Set is altered, false otherwise
- * @throws NullPointerException if c is null
- * @throws ClassCastException if an element in c cannot be compared with
- * objects already in the set
- */
- public boolean addAll(Collection c)
- {
- boolean result = false;
- int pos = c.size();
- Iterator itr = c.iterator();
- while (--pos >= 0)
- result |= (map.put(itr.next(), "") == null);
- return result;
- }
-
- /**
- * Removes all elements in this Set.
- */
- public void clear()
- {
- map.clear();
- }
-
- /**
- * Returns a shallow copy of this Set. The elements are not cloned.
- *
- * @return the cloned set
- */
- public Object clone()
- {
- TreeSet copy = null;
- try
- {
- copy = (TreeSet) super.clone();
- // Map may be either TreeMap or TreeMap.SubMap, hence the ugly casts.
- copy.map = (SortedMap) ((AbstractMap) map).clone();
- }
- catch (CloneNotSupportedException x)
- {
- // Impossible result.
- }
- return copy;
- }
-
- /**
- * Returns this Set's comparator.
- *
- * @return the comparator, or null if the set uses natural ordering
- */
- public Comparator comparator()
- {
- return map.comparator();
- }
-
- /**
- * Returns true if this Set contains the supplied Object, false otherwise.
- *
- * @param obj the Object to check for
- * @return true if it is in the set
- * @throws ClassCastException if obj cannot be compared with objects
- * already in the set
- */
- public boolean contains(Object obj)
- {
- return map.containsKey(obj);
- }
-
- /**
- * Returns the first (by order) element in this Set.
- *
- * @return the first element
- * @throws NoSuchElementException if the set is empty
- */
- public Object first()
- {
- return map.firstKey();
- }
-
- /**
- * Returns a view of this Set including all elements less than
- * <code>to</code>. The returned set is backed by the original, so changes
- * in one appear in the other. The subset will throw an
- * {@link IllegalArgumentException} for any attempt to access or add an
- * element beyond the specified cutoff. The returned set does not include
- * the endpoint; if you want inclusion, pass the successor element.
- *
- * @param to the (exclusive) cutoff point
- * @return a view of the set less than the cutoff
- * @throws ClassCastException if <code>to</code> is not compatible with
- * the comparator (or is not Comparable, for natural ordering)
- * @throws NullPointerException if to is null, but the comparator does not
- * tolerate null elements
- */
- public SortedSet headSet(Object to)
- {
- return new TreeSet(map.headMap(to));
- }
-
- /**
- * Returns true if this Set has size 0, false otherwise.
- *
- * @return true if the set is empty
- */
- public boolean isEmpty()
- {
- return map.isEmpty();
- }
-
- /**
- * Returns in Iterator over the elements in this TreeSet, which traverses
- * in ascending order.
- *
- * @return an iterator
- */
- public Iterator iterator()
- {
- return map.keySet().iterator();
- }
-
- /**
- * Returns the last (by order) element in this Set.
- *
- * @return the last element
- * @throws NoSuchElementException if the set is empty
- */
- public Object last()
- {
- return map.lastKey();
- }
-
- /**
- * If the supplied Object is in this Set, it is removed, and true is
- * returned; otherwise, false is returned.
- *
- * @param obj the Object to remove from this Set
- * @return true if the set was modified
- * @throws ClassCastException if obj cannot be compared to set elements
- */
- public boolean remove(Object obj)
- {
- return map.remove(obj) != null;
- }
-
- /**
- * Returns the number of elements in this Set
- *
- * @return the set size
- */
- public int size()
- {
- return map.size();
- }
-
- /**
- * Returns a view of this Set including all elements greater or equal to
- * <code>from</code> and less than <code>to</code> (a half-open interval).
- * The returned set is backed by the original, so changes in one appear in
- * the other. The subset will throw an {@link IllegalArgumentException}
- * for any attempt to access or add an element beyond the specified cutoffs.
- * The returned set includes the low endpoint but not the high; if you want
- * to reverse this behavior on either end, pass in the successor element.
- *
- * @param from the (inclusive) low cutoff point
- * @param to the (exclusive) high cutoff point
- * @return a view of the set between the cutoffs
- * @throws ClassCastException if either cutoff is not compatible with
- * the comparator (or is not Comparable, for natural ordering)
- * @throws NullPointerException if from or to is null, but the comparator
- * does not tolerate null elements
- * @throws IllegalArgumentException if from is greater than to
- */
- public SortedSet subSet(Object from, Object to)
- {
- return new TreeSet(map.subMap(from, to));
- }
-
- /**
- * Returns a view of this Set including all elements greater or equal to
- * <code>from</code>. The returned set is backed by the original, so
- * changes in one appear in the other. The subset will throw an
- * {@link IllegalArgumentException} for any attempt to access or add an
- * element beyond the specified cutoff. The returned set includes the
- * endpoint; if you want to exclude it, pass in the successor element.
- *
- * @param from the (inclusive) low cutoff point
- * @return a view of the set above the cutoff
- * @throws ClassCastException if <code>from</code> is not compatible with
- * the comparator (or is not Comparable, for natural ordering)
- * @throws NullPointerException if from is null, but the comparator
- * does not tolerate null elements
- */
- public SortedSet tailSet(Object from)
- {
- return new TreeSet(map.tailMap(from));
- }
-
- /**
- * Serializes this object to the given stream.
- *
- * @param s the stream to write to
- * @throws IOException if the underlying stream fails
- * @serialData the <i>comparator</i> (Object), followed by the set size
- * (int), the the elements in sorted order (Object)
- */
- private void writeObject(ObjectOutputStream s) throws IOException
- {
- s.defaultWriteObject();
- Iterator itr = map.keySet().iterator();
- int pos = map.size();
- s.writeObject(map.comparator());
- s.writeInt(pos);
- while (--pos >= 0)
- s.writeObject(itr.next());
- }
-
- /**
- * Deserializes this object from the given stream.
- *
- * @param s the stream to read from
- * @throws ClassNotFoundException if the underlying stream fails
- * @throws IOException if the underlying stream fails
- * @serialData the <i>comparator</i> (Object), followed by the set size
- * (int), the the elements in sorted order (Object)
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- Comparator comparator = (Comparator) s.readObject();
- int size = s.readInt();
- map = new TreeMap(comparator);
- ((TreeMap) map).putFromObjStream(s, size, false);
- }
-}
diff --git a/libjava/java/util/Vector.java b/libjava/java/util/Vector.java
deleted file mode 100644
index e26d7aaa4dd..00000000000
--- a/libjava/java/util/Vector.java
+++ /dev/null
@@ -1,931 +0,0 @@
-/* Vector.java -- Class that provides growable arrays.
- Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-
-/**
- * The <code>Vector</code> classes implements growable arrays of Objects.
- * You can access elements in a Vector with an index, just as you
- * can in a built in array, but Vectors can grow and shrink to accommodate
- * more or fewer objects.<p>
- *
- * Vectors try to mantain efficiency in growing by having a
- * <code>capacityIncrement</code> that can be specified at instantiation.
- * When a Vector can no longer hold a new Object, it grows by the amount
- * in <code>capacityIncrement</code>. If this value is 0, the vector doubles in
- * size.<p>
- *
- * Vector implements the JDK 1.2 List interface, and is therefore a fully
- * compliant Collection object. The iterators are fail-fast - if external
- * code structurally modifies the vector, any operation on the iterator will
- * then throw a {@link ConcurrentModificationException}. The Vector class is
- * fully synchronized, but the iterators are not. So, when iterating over a
- * vector, be sure to synchronize on the vector itself. If you don't want the
- * expense of synchronization, use ArrayList instead. On the other hand, the
- * Enumeration of elements() is not thread-safe, nor is it fail-fast; so it
- * can lead to undefined behavior even in a single thread if you modify the
- * vector during iteration.<p>
- *
- * Note: Some methods, especially those specified by List, specify throwing
- * {@link IndexOutOfBoundsException}, but it is easier to implement by
- * throwing the subclass {@link ArrayIndexOutOfBoundsException}. Others
- * directly specify this subclass.
- *
- * @author Scott G. Miller
- * @author Bryce McKinlay
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Collection
- * @see List
- * @see ArrayList
- * @see LinkedList
- * @since 1.0
- * @status updated to 1.4
- */
-public class Vector extends AbstractList
- implements List, RandomAccess, Cloneable, Serializable
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = -2767605614048989439L;
-
- /**
- * The internal array used to hold members of a Vector. The elements are
- * in positions 0 through elementCount - 1, and all remaining slots are null.
- * @serial the elements
- */
- protected Object[] elementData;
-
- /**
- * The number of elements currently in the vector, also returned by
- * {@link #size}.
- * @serial the size
- */
- protected int elementCount;
-
- /**
- * The amount the Vector's internal array should be increased in size when
- * a new element is added that exceeds the current size of the array,
- * or when {@link #ensureCapacity} is called. If &lt;= 0, the vector just
- * doubles in size.
- * @serial the amount to grow the vector by
- */
- protected int capacityIncrement;
-
- /**
- * Constructs an empty vector with an initial size of 10, and
- * a capacity increment of 0
- */
- public Vector()
- {
- this(10, 0);
- }
-
- /**
- * Constructs a vector containing the contents of Collection, in the
- * order given by the collection.
- *
- * @param c collection of elements to add to the new vector
- * @throws NullPointerException if c is null
- * @since 1.2
- */
- public Vector(Collection c)
- {
- elementCount = c.size();
- elementData = c.toArray(new Object[elementCount]);
- }
-
- /**
- * Constructs a Vector with the initial capacity and capacity
- * increment specified.
- *
- * @param initialCapacity the initial size of the Vector's internal array
- * @param capacityIncrement the amount the internal array should be
- * increased by when necessary, 0 to double the size
- * @throws IllegalArgumentException if initialCapacity &lt; 0
- */
- public Vector(int initialCapacity, int capacityIncrement)
- {
- if (initialCapacity < 0)
- throw new IllegalArgumentException();
- elementData = new Object[initialCapacity];
- this.capacityIncrement = capacityIncrement;
- }
-
- /**
- * Constructs a Vector with the initial capacity specified, and a capacity
- * increment of 0 (double in size).
- *
- * @param initialCapacity the initial size of the Vector's internal array
- * @throws IllegalArgumentException if initialCapacity &lt; 0
- */
- public Vector(int initialCapacity)
- {
- this(initialCapacity, 0);
- }
-
- /**
- * Copies the contents of a provided array into the Vector. If the
- * array is too large to fit in the Vector, an IndexOutOfBoundsException
- * is thrown without modifying the array. Old elements in the Vector are
- * overwritten by the new elements.
- *
- * @param a target array for the copy
- * @throws IndexOutOfBoundsException the array is not large enough
- * @throws NullPointerException the array is null
- * @see #toArray(Object[])
- */
- public synchronized void copyInto(Object[] a)
- {
- System.arraycopy(elementData, 0, a, 0, elementCount);
- }
-
- /**
- * Trims the Vector down to size. If the internal data array is larger
- * than the number of Objects its holding, a new array is constructed
- * that precisely holds the elements. Otherwise this does nothing.
- */
- public synchronized void trimToSize()
- {
- // Don't bother checking for the case where size() == the capacity of the
- // vector since that is a much less likely case; it's more efficient to
- // not do the check and lose a bit of performance in that infrequent case
-
- Object[] newArray = new Object[elementCount];
- System.arraycopy(elementData, 0, newArray, 0, elementCount);
- elementData = newArray;
- }
-
- /**
- * Ensures that <code>minCapacity</code> elements can fit within this Vector.
- * If <code>elementData</code> is too small, it is expanded as follows:
- * If the <code>elementCount + capacityIncrement</code> is adequate, that
- * is the new size. If <code>capacityIncrement</code> is non-zero, the
- * candidate size is double the current. If that is not enough, the new
- * size is <code>minCapacity</code>.
- *
- * @param minCapacity the desired minimum capacity, negative values ignored
- */
- public synchronized void ensureCapacity(int minCapacity)
- {
- if (elementData.length >= minCapacity)
- return;
-
- int newCapacity;
- if (capacityIncrement <= 0)
- newCapacity = elementData.length * 2;
- else
- newCapacity = elementData.length + capacityIncrement;
-
- Object[] newArray = new Object[Math.max(newCapacity, minCapacity)];
-
- System.arraycopy(elementData, 0, newArray, 0, elementCount);
- elementData = newArray;
- }
-
- /**
- * Explicitly sets the size of the vector (but not necessarily the size of
- * the internal data array). If the new size is smaller than the old one,
- * old values that don't fit are lost. If the new size is larger than the
- * old one, the vector is padded with null entries.
- *
- * @param newSize The new size of the internal array
- * @throws ArrayIndexOutOfBoundsException if the new size is negative
- */
- public synchronized void setSize(int newSize)
- {
- // Don't bother checking for the case where size() == the capacity of the
- // vector since that is a much less likely case; it's more efficient to
- // not do the check and lose a bit of performance in that infrequent case
- modCount++;
- ensureCapacity(newSize);
- if (newSize < elementCount)
- Arrays.fill(elementData, newSize, elementCount, null);
- elementCount = newSize;
- }
-
- /**
- * Returns the size of the internal data array (not the amount of elements
- * contained in the Vector).
- *
- * @return capacity of the internal data array
- */
- public synchronized int capacity()
- {
- return elementData.length;
- }
-
- /**
- * Returns the number of elements stored in this Vector.
- *
- * @return the number of elements in this Vector
- */
- public synchronized int size()
- {
- return elementCount;
- }
-
- /**
- * Returns true if this Vector is empty, false otherwise
- *
- * @return true if the Vector is empty, false otherwise
- */
- public synchronized boolean isEmpty()
- {
- return elementCount == 0;
- }
-
- /**
- * Returns an Enumeration of the elements of this Vector. The enumeration
- * visits the elements in increasing index order, but is NOT thread-safe.
- *
- * @return an Enumeration
- * @see #iterator()
- */
- // No need to synchronize as the Enumeration is not thread-safe!
- public Enumeration elements()
- {
- return new Enumeration()
- {
- private int i = 0;
-
- public boolean hasMoreElements()
- {
- return i < elementCount;
- }
-
- public Object nextElement()
- {
- if (i >= elementCount)
- throw new NoSuchElementException();
- return elementData[i++];
- }
- };
- }
-
- /**
- * Returns true when <code>elem</code> is contained in this Vector.
- *
- * @param elem the element to check
- * @return true if the object is contained in this Vector, false otherwise
- */
- public boolean contains(Object elem)
- {
- return indexOf(elem, 0) >= 0;
- }
-
- /**
- * Returns the first occurrence of <code>elem</code> in the Vector, or -1 if
- * <code>elem</code> is not found.
- *
- * @param elem the object to search for
- * @return the index of the first occurrence, or -1 if not found
- */
- public int indexOf(Object elem)
- {
- return indexOf(elem, 0);
- }
-
- /**
- * Searches the vector starting at <code>index</code> for object
- * <code>elem</code> and returns the index of the first occurrence of this
- * Object. If the object is not found, or index is larger than the size
- * of the vector, -1 is returned.
- *
- * @param e the Object to search for
- * @param index start searching at this index
- * @return the index of the next occurrence, or -1 if it is not found
- * @throws IndexOutOfBoundsException if index &lt; 0
- */
- public synchronized int indexOf(Object e, int index)
- {
- for (int i = index; i < elementCount; i++)
- if (equals(e, elementData[i]))
- return i;
- return -1;
- }
-
- /**
- * Returns the last index of <code>elem</code> within this Vector, or -1
- * if the object is not within the Vector.
- *
- * @param elem the object to search for
- * @return the last index of the object, or -1 if not found
- */
- public int lastIndexOf(Object elem)
- {
- return lastIndexOf(elem, elementCount - 1);
- }
-
- /**
- * Returns the index of the first occurrence of <code>elem</code>, when
- * searching backwards from <code>index</code>. If the object does not
- * occur in this Vector, or index is less than 0, -1 is returned.
- *
- * @param e the object to search for
- * @param index the index to start searching in reverse from
- * @return the index of the Object if found, -1 otherwise
- * @throws IndexOutOfBoundsException if index &gt;= size()
- */
- public synchronized int lastIndexOf(Object e, int index)
- {
- checkBoundExclusive(index);
- for (int i = index; i >= 0; i--)
- if (equals(e, elementData[i]))
- return i;
- return -1;
- }
-
- /**
- * Returns the Object stored at <code>index</code>.
- *
- * @param index the index of the Object to retrieve
- * @return the object at <code>index</code>
- * @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt;= size()
- * @see #get(int)
- */
- public synchronized Object elementAt(int index)
- {
- checkBoundExclusive(index);
- return elementData[index];
- }
-
- /**
- * Returns the first element (index 0) in the Vector.
- *
- * @return the first Object in the Vector
- * @throws NoSuchElementException the Vector is empty
- */
- public synchronized Object firstElement()
- {
- if (elementCount == 0)
- throw new NoSuchElementException();
-
- return elementData[0];
- }
-
- /**
- * Returns the last element in the Vector.
- *
- * @return the last Object in the Vector
- * @throws NoSuchElementException the Vector is empty
- */
- public synchronized Object lastElement()
- {
- if (elementCount == 0)
- throw new NoSuchElementException();
-
- return elementData[elementCount - 1];
- }
-
- /**
- * Changes the element at <code>index</code> to be <code>obj</code>
- *
- * @param obj the object to store
- * @param index the position in the Vector to store the object
- * @throws ArrayIndexOutOfBoundsException the index is out of range
- * @see #set(int, Object)
- */
- public void setElementAt(Object obj, int index)
- {
- set(index, obj);
- }
-
- /**
- * Removes the element at <code>index</code>, and shifts all elements at
- * positions greater than index to their index - 1.
- *
- * @param index the index of the element to remove
- * @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt;= size();
- * @see #remove(int)
- */
- public void removeElementAt(int index)
- {
- remove(index);
- }
-
- /**
- * Inserts a new element into the Vector at <code>index</code>. Any elements
- * at or greater than index are shifted up one position.
- *
- * @param obj the object to insert
- * @param index the index at which the object is inserted
- * @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt; size()
- * @see #add(int, Object)
- */
- public synchronized void insertElementAt(Object obj, int index)
- {
- checkBoundInclusive(index);
- if (elementCount == elementData.length)
- ensureCapacity(elementCount + 1);
- modCount++;
- System.arraycopy(elementData, index, elementData, index + 1,
- elementCount - index);
- elementCount++;
- elementData[index] = obj;
- }
-
- /**
- * Adds an element to the Vector at the end of the Vector. The vector
- * is increased by ensureCapacity(size() + 1) if needed.
- *
- * @param obj the object to add to the Vector
- */
- public synchronized void addElement(Object obj)
- {
- if (elementCount == elementData.length)
- ensureCapacity(elementCount + 1);
- modCount++;
- elementData[elementCount++] = obj;
- }
-
- /**
- * Removes the first (the lowestindex) occurance of the given object from
- * the Vector. If such a remove was performed (the object was found), true
- * is returned. If there was no such object, false is returned.
- *
- * @param obj the object to remove from the Vector
- * @return true if the Object was in the Vector, false otherwise
- * @see #remove(Object)
- */
- public synchronized boolean removeElement(Object obj)
- {
- int idx = indexOf(obj, 0);
- if (idx >= 0)
- {
- remove(idx);
- return true;
- }
- return false;
- }
-
- /**
- * Removes all elements from the Vector. Note that this does not
- * resize the internal data array.
- *
- * @see #clear()
- */
- public synchronized void removeAllElements()
- {
- if (elementCount == 0)
- return;
-
- modCount++;
- Arrays.fill(elementData, 0, elementCount, null);
- elementCount = 0;
- }
-
- /**
- * Creates a new Vector with the same contents as this one. The clone is
- * shallow; elements are not cloned.
- *
- * @return the clone of this vector
- */
- public synchronized Object clone()
- {
- try
- {
- Vector clone = (Vector) super.clone();
- clone.elementData = (Object[]) elementData.clone();
- return clone;
- }
- catch (CloneNotSupportedException ex)
- {
- // Impossible to get here.
- throw new InternalError(ex.toString());
- }
- }
-
- /**
- * Returns an Object array with the contents of this Vector, in the order
- * they are stored within this Vector. Note that the Object array returned
- * is not the internal data array, and that it holds only the elements
- * within the Vector. This is similar to creating a new Object[] with the
- * size of this Vector, then calling Vector.copyInto(yourArray).
- *
- * @return an Object[] containing the contents of this Vector in order
- * @since 1.2
- */
- public synchronized Object[] toArray()
- {
- Object[] newArray = new Object[elementCount];
- copyInto(newArray);
- return newArray;
- }
-
- /**
- * Returns an array containing the contents of this Vector.
- * If the provided array is large enough, the contents are copied
- * into that array, and a null is placed in the position size().
- * In this manner, you can obtain the size of a Vector by the position
- * of the null element, if you know the vector does not itself contain
- * null entries. If the array is not large enough, reflection is used
- * to create a bigger one of the same runtime type.
- *
- * @param a an array to copy the Vector into if large enough
- * @return an array with the contents of this Vector in order
- * @throws ArrayStoreException the runtime type of the provided array
- * cannot hold the elements of the Vector
- * @throws NullPointerException if <code>a</code> is null
- * @since 1.2
- */
- public synchronized Object[] toArray(Object[] a)
- {
- if (a.length < elementCount)
- a = (Object[]) Array.newInstance(a.getClass().getComponentType(),
- elementCount);
- else if (a.length > elementCount)
- a[elementCount] = null;
- System.arraycopy(elementData, 0, a, 0, elementCount);
- return a;
- }
-
- /**
- * Returns the element at position <code>index</code>.
- *
- * @param index the position from which an element will be retrieved
- * @return the element at that position
- * @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt;= size()
- * @since 1.2
- */
- public Object get(int index)
- {
- return elementAt(index);
- }
-
- /**
- * Puts <code>element</code> into the Vector at position <code>index</code>
- * and returns the Object that previously occupied that position.
- *
- * @param index the index within the Vector to place the Object
- * @param element the Object to store in the Vector
- * @return the previous object at the specified index
- * @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt;= size()
- * @since 1.2
- */
- public synchronized Object set(int index, Object element)
- {
- checkBoundExclusive(index);
- Object temp = elementData[index];
- elementData[index] = element;
- return temp;
- }
-
- /**
- * Adds an object to the Vector.
- *
- * @param o the element to add to the Vector
- * @return true, as specified by List
- * @since 1.2
- */
- public boolean add(Object o)
- {
- addElement(o);
- return true;
- }
-
- /**
- * Removes the given Object from the Vector. If it exists, true
- * is returned, if not, false is returned.
- *
- * @param o the object to remove from the Vector
- * @return true if the Object existed in the Vector, false otherwise
- * @since 1.2
- */
- public boolean remove(Object o)
- {
- return removeElement(o);
- }
-
- /**
- * Adds an object at the specified index. Elements at or above
- * index are shifted up one position.
- *
- * @param index the index at which to add the element
- * @param element the element to add to the Vector
- * @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt; size()
- * @since 1.2
- */
- public void add(int index, Object element)
- {
- insertElementAt(element, index);
- }
-
- /**
- * Removes the element at the specified index, and returns it.
- *
- * @param index the position from which to remove the element
- * @return the object removed
- * @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt;= size()
- * @since 1.2
- */
- public synchronized Object remove(int index)
- {
- checkBoundExclusive(index);
- Object temp = elementData[index];
- modCount++;
- elementCount--;
- if (index < elementCount)
- System.arraycopy(elementData, index + 1, elementData, index,
- elementCount - index);
- elementData[elementCount] = null;
- return temp;
- }
-
- /**
- * Clears all elements in the Vector and sets its size to 0.
- */
- public void clear()
- {
- removeAllElements();
- }
-
- /**
- * Returns true if this Vector contains all the elements in c.
- *
- * @param c the collection to compare to
- * @return true if this vector contains all elements of c
- * @throws NullPointerException if c is null
- * @since 1.2
- */
- public synchronized boolean containsAll(Collection c)
- {
- // Here just for the sychronization.
- return super.containsAll(c);
- }
-
- /**
- * Appends all elements of the given collection to the end of this Vector.
- * Behavior is undefined if the collection is modified during this operation
- * (for example, if this == c).
- *
- * @param c the collection to append
- * @return true if this vector changed, in other words c was not empty
- * @throws NullPointerException if c is null
- * @since 1.2
- */
- public synchronized boolean addAll(Collection c)
- {
- return addAll(elementCount, c);
- }
-
- /**
- * Remove from this vector all elements contained in the given collection.
- *
- * @param c the collection to filter out
- * @return true if this vector changed
- * @throws NullPointerException if c is null
- * @since 1.2
- */
- public synchronized boolean removeAll(Collection c)
- {
- if (c == null)
- throw new NullPointerException();
-
- int i;
- int j;
- for (i = 0; i < elementCount; i++)
- if (c.contains(elementData[i]))
- break;
- if (i == elementCount)
- return false;
-
- modCount++;
- for (j = i++; i < elementCount; i++)
- if (! c.contains(elementData[i]))
- elementData[j++] = elementData[i];
- elementCount -= i - j;
- return true;
- }
-
- /**
- * Retain in this vector only the elements contained in the given collection.
- *
- * @param c the collection to filter by
- * @return true if this vector changed
- * @throws NullPointerException if c is null
- * @since 1.2
- */
- public synchronized boolean retainAll(Collection c)
- {
- if (c == null)
- throw new NullPointerException();
-
- int i;
- int j;
- for (i = 0; i < elementCount; i++)
- if (! c.contains(elementData[i]))
- break;
- if (i == elementCount)
- return false;
-
- modCount++;
- for (j = i++; i < elementCount; i++)
- if (c.contains(elementData[i]))
- elementData[j++] = elementData[i];
- elementCount -= i - j;
- return true;
- }
-
- /**
- * Inserts all elements of the given collection at the given index of
- * this Vector. Behavior is undefined if the collection is modified during
- * this operation (for example, if this == c).
- *
- * @param c the collection to append
- * @return true if this vector changed, in other words c was not empty
- * @throws NullPointerException if c is null
- * @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt; size()
- * @since 1.2
- */
- public synchronized boolean addAll(int index, Collection c)
- {
- checkBoundInclusive(index);
- Iterator itr = c.iterator();
- int csize = c.size();
-
- modCount++;
- ensureCapacity(elementCount + csize);
- int end = index + csize;
- if (elementCount > 0 && index != elementCount)
- System.arraycopy(elementData, index,
- elementData, end, elementCount - index);
- elementCount += csize;
- for ( ; index < end; index++)
- elementData[index] = itr.next();
- return (csize > 0);
- }
-
- /**
- * Compares this to the given object.
- *
- * @param o the object to compare to
- * @return true if the two are equal
- * @since 1.2
- */
- public synchronized boolean equals(Object o)
- {
- // Here just for the sychronization.
- return super.equals(o);
- }
-
- /**
- * Computes the hashcode of this object.
- *
- * @return the hashcode
- * @since 1.2
- */
- public synchronized int hashCode()
- {
- // Here just for the sychronization.
- return super.hashCode();
- }
-
- /**
- * Returns a string representation of this Vector in the form
- * "[element0, element1, ... elementN]".
- *
- * @return the String representation of this Vector
- */
- public synchronized String toString()
- {
- // Here just for the sychronization.
- return super.toString();
- }
-
- /**
- * Obtain a List view of a subsection of this list, from fromIndex
- * (inclusive) to toIndex (exclusive). If the two indices are equal, the
- * sublist is empty. The returned list is modifiable, and changes in one
- * reflect in the other. If this list is structurally modified in
- * any way other than through the returned list, the result of any subsequent
- * operations on the returned list is undefined.
- * <p>
- *
- * @param fromIndex the index that the returned list should start from
- * (inclusive)
- * @param toIndex the index that the returned list should go to (exclusive)
- * @return a List backed by a subsection of this vector
- * @throws IndexOutOfBoundsException if fromIndex &lt; 0
- * || toIndex &gt; size()
- * @throws IllegalArgumentException if fromIndex &gt; toIndex
- * @see ConcurrentModificationException
- * @since 1.2
- */
- public synchronized List subList(int fromIndex, int toIndex)
- {
- List sub = super.subList(fromIndex, toIndex);
- // We must specify the correct object to synchronize upon, hence the
- // use of a non-public API
- return new Collections.SynchronizedList(this, sub);
- }
-
- /**
- * Removes a range of elements from this list.
- * Does nothing when toIndex is equal to fromIndex.
- *
- * @param fromIndex the index to start deleting from (inclusive)
- * @param toIndex the index to delete up to (exclusive)
- * @throws IndexOutOfBoundsException if fromIndex &gt; toIndex
- */
- // This does not need to be synchronized, because it is only called through
- // clear() of a sublist, and clear() had already synchronized.
- protected void removeRange(int fromIndex, int toIndex)
- {
- int change = toIndex - fromIndex;
- if (change > 0)
- {
- modCount++;
- System.arraycopy(elementData, toIndex, elementData, fromIndex,
- elementCount - toIndex);
- int save = elementCount;
- elementCount -= change;
- Arrays.fill(elementData, elementCount, save, null);
- }
- else if (change < 0)
- throw new IndexOutOfBoundsException();
- }
-
- /**
- * Checks that the index is in the range of possible elements (inclusive).
- *
- * @param index the index to check
- * @throws ArrayIndexOutOfBoundsException if index &gt; size
- */
- private void checkBoundInclusive(int index)
- {
- // Implementation note: we do not check for negative ranges here, since
- // use of a negative index will cause an ArrayIndexOutOfBoundsException
- // with no effort on our part.
- if (index > elementCount)
- throw new ArrayIndexOutOfBoundsException(index + " > " + elementCount);
- }
-
- /**
- * Checks that the index is in the range of existing elements (exclusive).
- *
- * @param index the index to check
- * @throws ArrayIndexOutOfBoundsException if index &gt;= size
- */
- private void checkBoundExclusive(int index)
- {
- // Implementation note: we do not check for negative ranges here, since
- // use of a negative index will cause an ArrayIndexOutOfBoundsException
- // with no effort on our part.
- if (index >= elementCount)
- throw new ArrayIndexOutOfBoundsException(index + " >= " + elementCount);
- }
-
- /**
- * Serializes this object to the given stream.
- *
- * @param s the stream to write to
- * @throws IOException if the underlying stream fails
- * @serialData just calls default write function
- */
- private synchronized void writeObject(ObjectOutputStream s)
- throws IOException
- {
- s.defaultWriteObject();
- }
-
-}
diff --git a/libjava/java/util/WeakHashMap.java b/libjava/java/util/WeakHashMap.java
deleted file mode 100644
index 7593f7e330e..00000000000
--- a/libjava/java/util/WeakHashMap.java
+++ /dev/null
@@ -1,881 +0,0 @@
-/* WeakHashMap -- a hashtable that keeps only weak references
- to its keys, allowing the virtual machine to reclaim them
- Copyright (C) 1999, 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util;
-
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.WeakReference;
-
-/**
- * A weak hash map has only weak references to the key. This means that it
- * allows the key to be garbage collected if it is not used otherwise. If
- * this happens, the entry will eventually disappear from the map,
- * asynchronously.
- *
- * <p>A weak hash map makes most sense when the keys doesn't override the
- * <code>equals</code> method: If there is no other reference to the
- * key nobody can ever look up the key in this table and so the entry
- * can be removed. This table also works when the <code>equals</code>
- * method is overloaded, such as String keys, but you should be prepared
- * to deal with some entries disappearing spontaneously.
- *
- * <p>Other strange behaviors to be aware of: The size of this map may
- * spontaneously shrink (even if you use a synchronized map and synchronize
- * it); it behaves as if another thread removes entries from this table
- * without synchronization. The entry set returned by <code>entrySet</code>
- * has similar phenomenons: The size may spontaneously shrink, or an
- * entry, that was in the set before, suddenly disappears.
- *
- * <p>A weak hash map is not meant for caches; use a normal map, with
- * soft references as values instead, or try {@link LinkedHashMap}.
- *
- * <p>The weak hash map supports null values and null keys. The null key
- * is never deleted from the map (except explictly of course). The
- * performance of the methods are similar to that of a hash map.
- *
- * <p>The value objects are strongly referenced by this table. So if a
- * value object maintains a strong reference to the key (either direct
- * or indirect) the key will never be removed from this map. According
- * to Sun, this problem may be fixed in a future release. It is not
- * possible to do it with the jdk 1.2 reference model, though.
- *
- * @author Jochen Hoenicke
- * @author Eric Blake (ebb9@email.byu.edu)
- *
- * @see HashMap
- * @see WeakReference
- * @see LinkedHashMap
- * @since 1.2
- * @status updated to 1.4
- */
-public class WeakHashMap extends AbstractMap implements Map
-{
- // WARNING: WeakHashMap is a CORE class in the bootstrap cycle. See the
- // comments in vm/reference/java/lang/Runtime for implications of this fact.
-
- /**
- * The default capacity for an instance of HashMap.
- * Sun's documentation mildly suggests that this (11) is the correct
- * value.
- */
- private static final int DEFAULT_CAPACITY = 11;
-
- /**
- * The default load factor of a HashMap.
- */
- private static final float DEFAULT_LOAD_FACTOR = 0.75F;
-
- /**
- * This is used instead of the key value <i>null</i>. It is needed
- * to distinguish between an null key and a removed key.
- */
- // Package visible for use by nested classes.
- static final Object NULL_KEY = new Object()
- {
- /**
- * Sets the hashCode to 0, since that's what null would map to.
- * @return the hash code 0
- */
- public int hashCode()
- {
- return 0;
- }
-
- /**
- * Compares this key to the given object. Normally, an object should
- * NEVER compare equal to null, but since we don't publicize NULL_VALUE,
- * it saves bytecode to do so here.
- * @return true iff o is this or null
- */
- public boolean equals(Object o)
- {
- return null == o || this == o;
- }
- };
-
- /**
- * The reference queue where our buckets (which are WeakReferences) are
- * registered to.
- */
- private final ReferenceQueue queue;
-
- /**
- * The number of entries in this hash map.
- */
- // Package visible for use by nested classes.
- int size;
-
- /**
- * The load factor of this WeakHashMap. This is the maximum ratio of
- * size versus number of buckets. If size grows the number of buckets
- * must grow, too.
- */
- private float loadFactor;
-
- /**
- * The rounded product of the capacity (i.e. number of buckets) and
- * the load factor. When the number of elements exceeds the
- * threshold, the HashMap calls <code>rehash()</code>.
- */
- private int threshold;
-
- /**
- * The number of structural modifications. This is used by
- * iterators, to see if they should fail. This doesn't count
- * the silent key removals, when a weak reference is cleared
- * by the garbage collection. Instead the iterators must make
- * sure to have strong references to the entries they rely on.
- */
- // Package visible for use by nested classes.
- int modCount;
-
- /**
- * The entry set. There is only one instance per hashmap, namely
- * theEntrySet. Note that the entry set may silently shrink, just
- * like the WeakHashMap.
- */
- private final class WeakEntrySet extends AbstractSet
- {
- /**
- * Non-private constructor to reduce bytecode emitted.
- */
- WeakEntrySet()
- {
- }
-
- /**
- * Returns the size of this set.
- *
- * @return the set size
- */
- public int size()
- {
- return size;
- }
-
- /**
- * Returns an iterator for all entries.
- *
- * @return an Entry iterator
- */
- public Iterator iterator()
- {
- return new Iterator()
- {
- /**
- * The entry that was returned by the last
- * <code>next()</code> call. This is also the entry whose
- * bucket should be removed by the <code>remove</code> call. <br>
- *
- * It is null, if the <code>next</code> method wasn't
- * called yet, or if the entry was already removed. <br>
- *
- * Remembering this entry here will also prevent it from
- * being removed under us, since the entry strongly refers
- * to the key.
- */
- WeakBucket.WeakEntry lastEntry;
-
- /**
- * The entry that will be returned by the next
- * <code>next()</code> call. It is <code>null</code> if there
- * is no further entry. <br>
- *
- * Remembering this entry here will also prevent it from
- * being removed under us, since the entry strongly refers
- * to the key.
- */
- WeakBucket.WeakEntry nextEntry = findNext(null);
-
- /**
- * The known number of modification to the list, if it differs
- * from the real number, we throw an exception.
- */
- int knownMod = modCount;
-
- /**
- * Check the known number of modification to the number of
- * modifications of the table. If it differs from the real
- * number, we throw an exception.
- * @throws ConcurrentModificationException if the number
- * of modifications doesn't match.
- */
- private void checkMod()
- {
- // This method will get inlined.
- cleanQueue();
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
- }
-
- /**
- * Get a strong reference to the next entry after
- * lastBucket.
- * @param lastEntry the previous bucket, or null if we should
- * get the first entry.
- * @return the next entry.
- */
- private WeakBucket.WeakEntry findNext(WeakBucket.WeakEntry lastEntry)
- {
- int slot;
- WeakBucket nextBucket;
- if (lastEntry != null)
- {
- nextBucket = lastEntry.getBucket().next;
- slot = lastEntry.getBucket().slot;
- }
- else
- {
- nextBucket = buckets[0];
- slot = 0;
- }
-
- while (true)
- {
- while (nextBucket != null)
- {
- WeakBucket.WeakEntry entry = nextBucket.getEntry();
- if (entry != null)
- // This is the next entry.
- return entry;
-
- // Entry was cleared, try next.
- nextBucket = nextBucket.next;
- }
-
- slot++;
- if (slot == buckets.length)
- // No more buckets, we are through.
- return null;
-
- nextBucket = buckets[slot];
- }
- }
-
- /**
- * Checks if there are more entries.
- * @return true, iff there are more elements.
- * @throws ConcurrentModificationException if the hash map was
- * modified.
- */
- public boolean hasNext()
- {
- checkMod();
- return nextEntry != null;
- }
-
- /**
- * Returns the next entry.
- * @return the next entry.
- * @throws ConcurrentModificationException if the hash map was
- * modified.
- * @throws NoSuchElementException if there is no entry.
- */
- public Object next()
- {
- checkMod();
- if (nextEntry == null)
- throw new NoSuchElementException();
- lastEntry = nextEntry;
- nextEntry = findNext(lastEntry);
- return lastEntry;
- }
-
- /**
- * Removes the last returned entry from this set. This will
- * also remove the bucket of the underlying weak hash map.
- * @throws ConcurrentModificationException if the hash map was
- * modified.
- * @throws IllegalStateException if <code>next()</code> was
- * never called or the element was already removed.
- */
- public void remove()
- {
- checkMod();
- if (lastEntry == null)
- throw new IllegalStateException();
- modCount++;
- internalRemove(lastEntry.getBucket());
- lastEntry = null;
- knownMod++;
- }
- };
- }
- }
-
- /**
- * A bucket is a weak reference to the key, that contains a strong
- * reference to the value, a pointer to the next bucket and its slot
- * number. <br>
- *
- * It would be cleaner to have a WeakReference as field, instead of
- * extending it, but if a weak reference gets cleared, we only get
- * the weak reference (by queue.poll) and wouldn't know where to
- * look for this reference in the hashtable, to remove that entry.
- *
- * @author Jochen Hoenicke
- */
- private static class WeakBucket extends WeakReference
- {
- /**
- * The value of this entry. The key is stored in the weak
- * reference that we extend.
- */
- Object value;
-
- /**
- * The next bucket describing another entry that uses the same
- * slot.
- */
- WeakBucket next;
-
- /**
- * The slot of this entry. This should be
- * <code>Math.abs(key.hashCode() % buckets.length)</code>.
- *
- * But since the key may be silently removed we have to remember
- * the slot number.
- *
- * If this bucket was removed the slot is -1. This marker will
- * prevent the bucket from being removed twice.
- */
- int slot;
-
- /**
- * Creates a new bucket for the given key/value pair and the specified
- * slot.
- * @param key the key
- * @param queue the queue the weak reference belongs to
- * @param value the value
- * @param slot the slot. This must match the slot where this bucket
- * will be enqueued.
- */
- public WeakBucket(Object key, ReferenceQueue queue, Object value,
- int slot)
- {
- super(key, queue);
- this.value = value;
- this.slot = slot;
- }
-
- /**
- * This class gives the <code>Entry</code> representation of the
- * current bucket. It also keeps a strong reference to the
- * key; bad things may happen otherwise.
- */
- class WeakEntry implements Map.Entry
- {
- /**
- * The strong ref to the key.
- */
- Object key;
-
- /**
- * Creates a new entry for the key.
- * @param key the key
- */
- public WeakEntry(Object key)
- {
- this.key = key;
- }
-
- /**
- * Returns the underlying bucket.
- * @return the owning bucket
- */
- public WeakBucket getBucket()
- {
- return WeakBucket.this;
- }
-
- /**
- * Returns the key.
- * @return the key
- */
- public Object getKey()
- {
- return key == NULL_KEY ? null : key;
- }
-
- /**
- * Returns the value.
- * @return the value
- */
- public Object getValue()
- {
- return value;
- }
-
- /**
- * This changes the value. This change takes place in
- * the underlying hash map.
- * @param newVal the new value
- * @return the old value
- */
- public Object setValue(Object newVal)
- {
- Object oldVal = value;
- value = newVal;
- return oldVal;
- }
-
- /**
- * The hashCode as specified in the Entry interface.
- * @return the hash code
- */
- public int hashCode()
- {
- return key.hashCode() ^ WeakHashMap.hashCode(value);
- }
-
- /**
- * The equals method as specified in the Entry interface.
- * @param o the object to compare to
- * @return true iff o represents the same key/value pair
- */
- public boolean equals(Object o)
- {
- if (o instanceof Map.Entry)
- {
- Map.Entry e = (Map.Entry) o;
- return key.equals(e.getKey())
- && WeakHashMap.equals(value, e.getValue());
- }
- return false;
- }
-
- public String toString()
- {
- return key + "=" + value;
- }
- }
-
- /**
- * This returns the entry stored in this bucket, or null, if the
- * bucket got cleared in the mean time.
- * @return the Entry for this bucket, if it exists
- */
- WeakEntry getEntry()
- {
- final Object key = this.get();
- if (key == null)
- return null;
- return new WeakEntry(key);
- }
- }
-
- /**
- * The entry set returned by <code>entrySet()</code>.
- */
- private final WeakEntrySet theEntrySet;
-
- /**
- * The hash buckets. These are linked lists. Package visible for use in
- * nested classes.
- */
- WeakBucket[] buckets;
-
- /**
- * Creates a new weak hash map with default load factor and default
- * capacity.
- */
- public WeakHashMap()
- {
- this(DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR);
- }
-
- /**
- * Creates a new weak hash map with default load factor and the given
- * capacity.
- * @param initialCapacity the initial capacity
- * @throws IllegalArgumentException if initialCapacity is negative
- */
- public WeakHashMap(int initialCapacity)
- {
- this(initialCapacity, DEFAULT_LOAD_FACTOR);
- }
-
- /**
- * Creates a new weak hash map with the given initial capacity and
- * load factor.
- * @param initialCapacity the initial capacity.
- * @param loadFactor the load factor (see class description of HashMap).
- * @throws IllegalArgumentException if initialCapacity is negative, or
- * loadFactor is non-positive
- */
- public WeakHashMap(int initialCapacity, float loadFactor)
- {
- // Check loadFactor for NaN as well.
- if (initialCapacity < 0 || ! (loadFactor > 0))
- throw new IllegalArgumentException();
- if (initialCapacity == 0)
- initialCapacity = 1;
- this.loadFactor = loadFactor;
- threshold = (int) (initialCapacity * loadFactor);
- theEntrySet = new WeakEntrySet();
- queue = new ReferenceQueue();
- buckets = new WeakBucket[initialCapacity];
- }
-
- /**
- * Construct a new WeakHashMap with the same mappings as the given map.
- * The WeakHashMap has a default load factor of 0.75.
- *
- * @param m the map to copy
- * @throws NullPointerException if m is null
- * @since 1.3
- */
- public WeakHashMap(Map m)
- {
- this(m.size(), DEFAULT_LOAD_FACTOR);
- putAll(m);
- }
-
- /**
- * Simply hashes a non-null Object to its array index.
- * @param key the key to hash
- * @return its slot number
- */
- private int hash(Object key)
- {
- return Math.abs(key.hashCode() % buckets.length);
- }
-
- /**
- * Cleans the reference queue. This will poll all references (which
- * are WeakBuckets) from the queue and remove them from this map.
- * This will not change modCount, even if it modifies the map. The
- * iterators have to make sure that nothing bad happens. <br>
- *
- * Currently the iterator maintains a strong reference to the key, so
- * that is no problem.
- */
- // Package visible for use by nested classes.
- void cleanQueue()
- {
- Object bucket = queue.poll();
- while (bucket != null)
- {
- internalRemove((WeakBucket) bucket);
- bucket = queue.poll();
- }
- }
-
- /**
- * Rehashes this hashtable. This will be called by the
- * <code>add()</code> method if the size grows beyond the threshold.
- * It will grow the bucket size at least by factor two and allocates
- * new buckets.
- */
- private void rehash()
- {
- WeakBucket[] oldBuckets = buckets;
- int newsize = buckets.length * 2 + 1; // XXX should be prime.
- threshold = (int) (newsize * loadFactor);
- buckets = new WeakBucket[newsize];
-
- // Now we have to insert the buckets again.
- for (int i = 0; i < oldBuckets.length; i++)
- {
- WeakBucket bucket = oldBuckets[i];
- WeakBucket nextBucket;
- while (bucket != null)
- {
- nextBucket = bucket.next;
-
- Object key = bucket.get();
- if (key == null)
- {
- // This bucket should be removed; it is probably
- // already on the reference queue. We don't insert it
- // at all, and mark it as cleared.
- bucket.slot = -1;
- size--;
- }
- else
- {
- // Add this bucket to its new slot.
- int slot = hash(key);
- bucket.slot = slot;
- bucket.next = buckets[slot];
- buckets[slot] = bucket;
- }
- bucket = nextBucket;
- }
- }
- }
-
- /**
- * Finds the entry corresponding to key. Since it returns an Entry
- * it will also prevent the key from being removed under us.
- * @param key the key, may be null
- * @return The WeakBucket.WeakEntry or null, if the key wasn't found.
- */
- private WeakBucket.WeakEntry internalGet(Object key)
- {
- if (key == null)
- key = NULL_KEY;
- int slot = hash(key);
- WeakBucket bucket = buckets[slot];
- while (bucket != null)
- {
- WeakBucket.WeakEntry entry = bucket.getEntry();
- if (entry != null && key.equals(entry.key))
- return entry;
-
- bucket = bucket.next;
- }
- return null;
- }
-
- /**
- * Adds a new key/value pair to the hash map.
- * @param key the key. This mustn't exists in the map. It may be null.
- * @param value the value.
- */
- private void internalAdd(Object key, Object value)
- {
- if (key == null)
- key = NULL_KEY;
- int slot = hash(key);
- WeakBucket bucket = new WeakBucket(key, queue, value, slot);
- bucket.next = buckets[slot];
- buckets[slot] = bucket;
- size++;
- }
-
- /**
- * Removes a bucket from this hash map, if it wasn't removed before
- * (e.g. one time through rehashing and one time through reference queue).
- * Package visible for use in nested classes.
- *
- * @param bucket the bucket to remove.
- */
- void internalRemove(WeakBucket bucket)
- {
- int slot = bucket.slot;
- if (slot == -1)
- // This bucket was already removed.
- return;
-
- // Mark the bucket as removed. This is necessary, since the
- // bucket may be enqueued later by the garbage collection, and
- // internalRemove will be called a second time.
- bucket.slot = -1;
- if (buckets[slot] == bucket)
- buckets[slot] = bucket.next;
- else
- {
- WeakBucket prev = buckets[slot];
- /* This may throw a NullPointerException. It shouldn't but if
- * a race condition occurred (two threads removing the same
- * bucket at the same time) it may happen. <br>
- * But with race condition many much worse things may happen
- * anyway.
- */
- while (prev.next != bucket)
- prev = prev.next;
- prev.next = bucket.next;
- }
- size--;
- }
-
- /**
- * Returns the size of this hash map. Note that the size() may shrink
- * spontaneously, if the some of the keys were only weakly reachable.
- * @return the number of entries in this hash map.
- */
- public int size()
- {
- cleanQueue();
- return size;
- }
-
- /**
- * Tells if the map is empty. Note that the result may change
- * spontanously, if all of the keys were only weakly reachable.
- * @return true, iff the map is empty.
- */
- public boolean isEmpty()
- {
- cleanQueue();
- return size == 0;
- }
-
- /**
- * Tells if the map contains the given key. Note that the result
- * may change spontanously, if the key was only weakly
- * reachable.
- * @param key the key to look for
- * @return true, iff the map contains an entry for the given key.
- */
- public boolean containsKey(Object key)
- {
- cleanQueue();
- return internalGet(key) != null;
- }
-
- /**
- * Gets the value the key is mapped to.
- * @return the value the key was mapped to. It returns null if
- * the key wasn't in this map, or if the mapped value was
- * explicitly set to null.
- */
- public Object get(Object key)
- {
- cleanQueue();
- WeakBucket.WeakEntry entry = internalGet(key);
- return entry == null ? null : entry.getValue();
- }
-
- /**
- * Adds a new key/value mapping to this map.
- * @param key the key, may be null
- * @param value the value, may be null
- * @return the value the key was mapped to previously. It returns
- * null if the key wasn't in this map, or if the mapped value
- * was explicitly set to null.
- */
- public Object put(Object key, Object value)
- {
- cleanQueue();
- WeakBucket.WeakEntry entry = internalGet(key);
- if (entry != null)
- return entry.setValue(value);
-
- modCount++;
- if (size >= threshold)
- rehash();
-
- internalAdd(key, value);
- return null;
- }
-
- /**
- * Removes the key and the corresponding value from this map.
- * @param key the key. This may be null.
- * @return the value the key was mapped to previously. It returns
- * null if the key wasn't in this map, or if the mapped value was
- * explicitly set to null.
- */
- public Object remove(Object key)
- {
- cleanQueue();
- WeakBucket.WeakEntry entry = internalGet(key);
- if (entry == null)
- return null;
-
- modCount++;
- internalRemove(entry.getBucket());
- return entry.getValue();
- }
-
- /**
- * Returns a set representation of the entries in this map. This
- * set will not have strong references to the keys, so they can be
- * silently removed. The returned set has therefore the same
- * strange behaviour (shrinking size(), disappearing entries) as
- * this weak hash map.
- * @return a set representation of the entries.
- */
- public Set entrySet()
- {
- cleanQueue();
- return theEntrySet;
- }
-
- /**
- * Clears all entries from this map.
- */
- public void clear()
- {
- super.clear();
- }
-
- /**
- * Returns true if the map contains at least one key which points to
- * the specified object as a value. Note that the result
- * may change spontanously, if its key was only weakly reachable.
- * @param value the value to search for
- * @return true if it is found in the set.
- */
- public boolean containsValue(Object value)
- {
- cleanQueue();
- return super.containsValue(value);
- }
-
- /**
- * Returns a set representation of the keys in this map. This
- * set will not have strong references to the keys, so they can be
- * silently removed. The returned set has therefore the same
- * strange behaviour (shrinking size(), disappearing entries) as
- * this weak hash map.
- * @return a set representation of the keys.
- */
- public Set keySet()
- {
- cleanQueue();
- return super.keySet();
- }
-
- /**
- * Puts all of the mappings from the given map into this one. If the
- * key already exists in this map, its value is replaced.
- * @param m the map to copy in
- */
- public void putAll(Map m)
- {
- super.putAll(m);
- }
-
- /**
- * Returns a collection representation of the values in this map. This
- * collection will not have strong references to the keys, so mappings
- * can be silently removed. The returned collection has therefore the same
- * strange behaviour (shrinking size(), disappearing entries) as
- * this weak hash map.
- * @return a collection representation of the values.
- */
- public Collection values()
- {
- cleanQueue();
- return super.values();
- }
-} // class WeakHashMap
diff --git a/libjava/java/util/jar/Attributes.java b/libjava/java/util/jar/Attributes.java
deleted file mode 100644
index 4db2c72e75b..00000000000
--- a/libjava/java/util/jar/Attributes.java
+++ /dev/null
@@ -1,630 +0,0 @@
-/* Attributes.java -- Represents attribute name/value pairs from a Manifest
- Copyright (C) 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.jar;
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Represents attribute name/value pairs from a Manifest as a Map.
- * The names of an attribute are represented by the
- * <code>Attributes.Name</code> class and should confirm to the restrictions
- * described in that class. Note that the Map interface that Attributes
- * implements allows you to put names and values into the attribute that don't
- * follow these restriction (and are not really Atrribute.Names, but if you do
- * that it might cause undefined behaviour later).
- * <p>
- * If you use the constants defined in the inner class Name then you can be
- * sure that you always access the right attribute names. This makes
- * manipulating the Attributes more or less type safe.
- * <p>
- * Most of the methods are wrappers to implement the Map interface. The really
- * useful and often used methods are <code>getValue(Name)</code> and
- * <code>getValue(String)</code>. If you actually want to set attributes you
- * may want to use the <code>putValue(String, String)</code> method
- * (sorry there is no public type safe <code>putValue(Name, String)</code>
- * method).
- *
- * @see java.util.jar.Attributes.Name
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class Attributes implements Cloneable, Map
-{
-
- // Fields
-
- /**
- * The map that holds all the attribute name/value pairs. In this
- * implementation it is actually a Hashtable, but that can be different in
- * other implementations.
- */
- protected Map map;
-
- // Inner class
-
- /**
- * Represents a name of a Manifest Attribute. Defines a couple of well
- * know names for the general main attributes, stand alone application
- * attributes, applet attributes, extension identification attributes,
- * package versioning and sealing attributes, file contents attributes,
- * bean objects attribute and signing attributes. See the
- *
- * <p>The characters of a Name must obey the following restrictions:</p>
- *
- * <ul>
- * <li>Must contain at least one character</li>
- * <li>The first character must be alphanumeric (a-z, A-Z, 0-9)</li>
- * <li>All other characters must be alphanumeric, a '-' or a '_'</li>
- * </ul>
- *
- * <p>When comparing Names (with <code>equals</code>) all characters are
- * converted to lowercase. But you can get the original case sensitive
- * string with the <code>toString()</code> method.</p>
- *
- * <p>Most important attributes have a constant defined in this
- * class. Some other attributes used in Manifest files are:
- * <ul>
- * <li> "Created-By" - General main attribute, tool and version
- * that created this Manifest file.</li>
- * <li> "Java-Bean" - Bean objects attribute, whether the entry is a Bean.
- * Value is either "true" or "false".</li>
- * <li> "Magic" - Signing attribute, application specific signing attribute.
- * Must be understood by the manifest parser when present to validate the
- * jar (entry).</li>
- * </ul>
- *
- * @since 1.2
- * @author Mark Wielaard (mark@klomp.org)
- */
- public static class Name
- {
- // General Main Attributes
-
- /**
- * General main attribute -
- * the version of this Manifest file.
- */
- public static final Name MANIFEST_VERSION = new Name("Manifest-Version");
-
- /**
- * General main attribute -
- * the version of the jar file signature.
- */
- public static final Name SIGNATURE_VERSION
- = new Name("Signature-Version");
-
- /**
- * General main attribute -
- * (relative) file paths of the libraries/classpaths that the Classes in
- * this jar file depend on. Paths are separated by spaces.
- */
- public static final Name CLASS_PATH = new Name("Class-Path");
-
- /**
- * Stand alone application attribute -
- * the entry (without the .class ending) that is the main
- * class of this jar file.
- */
- public static final Name MAIN_CLASS = new Name("Main-Class");
-
- /**
- * Applet attribute -
- * a list of extension libraries that the applet in this
- * jar file depends on.
- * For every named extension there should be some Attributes in the
- * Manifest manifest file with the following Names:
- * <ul>
- * <li> &lt;extension&gt;-Extension-Name:
- * unique name of the extension</li>
- * <li> &lt;extension&gt;-Specification-Version:
- * minimum specification version</li>
- * <li> &lt;extension&gt;-Implementation-Version:
- * minimum implementation version</li>
- * <li> &lt;extension&gt;-Implementation-Vendor-Id:
- * unique id of implementation vendor</li>
- * <li> &lt;extension&gt;-Implementation-URL:
- * where the latest version of the extension library can be found</li>
- * </ul>
- */
- public static final Name EXTENSION_LIST = new Name("Extension-List");
-
- /**
- * Extension identification attribute -
- * the name if the extension library contained in the jar.
- */
- public static final Name EXTENSION_NAME = new Name("Extension-Name");
-
- /**
- * Extension identification attribute -
- * synonym for <code>EXTENSTION_NAME</code>.
- */
- public static final Name EXTENSION_INSTALLATION = EXTENSION_NAME;
-
- // Package versioning and sealing attributes
-
- /**
- * Package versioning -
- * name of extension library contained in this jar.
- */
- public static final Name IMPLEMENTATION_TITLE
- = new Name("Implementation-Title");
-
- /**
- * Package versioning -
- * version of the extension library contained in this jar.
- */
- public static final Name IMPLEMENTATION_VERSION
- = new Name("Implementation-Version");
-
- /**
- * Package versioning -
- * name of extension library creator contained in this jar.
- */
- public static final Name IMPLEMENTATION_VENDOR
- = new Name("Implementation-Vendor");
-
- /**
- * Package versioning -
- * unique id of extension library creator.
- */
- public static final Name IMPLEMENTATION_VENDOR_ID
- = new Name("Implementation-Vendor-Id");
-
- /**
- * Package versioning -
- * location where this implementation can be downloaded.
- */
- public static final Name IMPLEMENTATION_URL
- = new Name("Implementation-URL");
-
- /**
- * Package versioning -
- * title of the specification contained in this jar.
- */
- public static final Name SPECIFICATION_TITLE
- = new Name("Specification-Title");
-
- /**
- * Package versioning -
- * version of the specification contained in this jar.
- */
- public static final Name SPECIFICATION_VERSION
- = new Name("Specification-Version");
-
- /**
- * Package versioning -
- * organisation that maintains the specification contains in this
- * jar.
- */
- public static final Name SPECIFICATION_VENDOR
- = new Name("Specification-Vendor");
-
- /**
- * Package sealing -
- * whether (all) package(s) is(/are) sealed. Value is either "true"
- * or "false".
- */
- public static final Name SEALED = new Name("Sealed");
-
- /**
- * File contents attribute -
- * Mime type and subtype for the jar entry.
- */
- public static final Name CONTENT_TYPE = new Name("Content-Type");
-
- /** The (lowercase) String representation of this Name */
- private final String name;
-
- /** The original String given to the constructor */
- private final String origName;
-
- // Constructor
-
- /**
- * Creates a new Name from the given String.
- * Throws an IllegalArgumentException if the given String is empty or
- * contains any illegal Name characters.
- *
- * @param name the name of the new Name
- * @exception IllegalArgumentException if name isn't a valid String
- * representation of a Name
- * @exception NullPointerException if name is null
- */
- public Name(String name) throws IllegalArgumentException,
- NullPointerException
- {
- // name must not be null
- // this will throw a NullPointerException if it is
- char chars[] = name.toCharArray();
-
- // there must be at least one character
- if (chars.length == 0)
- throw new
- IllegalArgumentException
- ("There must be at least one character in a name");
-
- // first character must be alphanum
- char c = chars[0];
- if (!((c >= 'a' && c <= 'z') ||
- (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')))
- throw new
- IllegalArgumentException("First character must be alphanum");
-
- // all other characters must be alphanums, '-' or '_'
- for (int i = 1; i < chars.length; i++)
- {
- c = chars[i];
- if (!((c >= 'a' && c <= 'z') ||
- (c >= 'A' && c <= 'Z') ||
- (c >= '0' && c <= '9') || (c == '-') || (c == '_')))
- throw new
- IllegalArgumentException
- ("Characters must be alphanums, '-' or '_'");
- }
-
- // Still here? Then convert to lower case and be done.
- // Store the original name for toString();
- this.origName = name;
- this.name = name.toLowerCase();
- }
-
- /**
- * Returns the hash code of the (lowercase) String representation of
- * this Name.
- */
- public int hashCode()
- {
- return name.hashCode();
- }
-
- /**
- * Checks if another object is equal to this Name object.
- * Another object is equal to this Name object if it is an instance of
- * Name and the (lowercase) string representation of the name is equal.
- */
- public boolean equals(Object o)
- {
- // Quick and dirty check
- if (name == o)
- return true;
-
- try
- {
- // Note that the constructor already converts the strings to
- // lowercase.
- String otherName = ((Name) o).name;
- return name.equals(otherName);
- }
- catch (ClassCastException cce)
- {
- return false;
- }
- catch (NullPointerException npe)
- {
- return false;
- }
- }
-
- /**
- * Returns the string representation of this Name as given to the
- * constructor (not neccesarily the lower case representation).
- */
- public String toString()
- {
- return origName;
- }
- }
-
- // Constructors
-
- /**
- * Creates an empty Attributes map.
- */
- public Attributes()
- {
- map = new Hashtable();
- }
-
- /**
- * Creates an empty Attributes map with the given initial size.
- * @param size the initial size of the underlying map
- */
- public Attributes(int size)
- {
- map = new Hashtable(size);
- }
-
- /**
- * Creates an Attributes map with the initial values taken from another
- * Attributes map.
- * @param attr Attributes map to take the initial values from
- */
- public Attributes(Attributes attr)
- {
- map = new Hashtable(attr.map);
- }
-
- // Methods
-
- /**
- * Gets the value of an attribute name given as a String.
- *
- * @param name a String describing the Name to look for
- * @return the value gotten from the map of null when not found
- */
- public String getValue(String name)
- {
- return (String) get(new Name(name));
- }
-
- /**
- * Gets the value of the given attribute name.
- *
- * @param name the Name to look for
- * @return the value gotten from the map of null when not found
- */
- public String getValue(Name name)
- {
- return (String) get(name);
- }
-
- /**
- * Stores an attribute name (represented by a String) and value in this
- * Attributes map.
- * When the (case insensitive string) name already exists the value is
- * replaced and the old value is returned.
- *
- * @param name a (case insensitive) String representation of the attribite
- * name to add/replace
- * @param value the (new) value of the attribute name
- * @returns the old value of the attribute name or null if it didn't exist
- * yet
- */
- public String putValue(String name, String value)
- {
- return putValue(new Name(name), value);
- }
-
- /**
- * Stores an attribute name (represented by a String) and value in this
- * Attributes map.
- * When the name already exists the value is replaced and the old value
- * is returned.
- * <p>
- * I don't know why there is no public method with this signature. I think
- * there should be one.
- *
- * @param name the attribite name to add/replace
- * @param value the (new) value of the attribute name
- * @returns the old value of the attribute name or null if it didn't exist
- * yet
- */
- String putValue(Name name, String value)
- {
- return (String) put(name, value);
- }
-
- // Methods from Cloneable interface
-
- /**
- * Return a clone of this attribute map.
- */
- public Object clone()
- {
- return new Attributes(this);
- }
-
- // Methods from Map interface
-
- /**
- * Removes all attributes.
- */
- public void clear()
- {
- map.clear();
- }
-
- /**
- * Checks to see if there is an attribute with the specified name.
- * XXX - what if the object is a String?
- *
- * @param attrName the name of the attribute to check
- * @return true if there is an attribute with the specified name, false
- * otherwise
- */
- public boolean containsKey(Object attrName)
- {
- return map.containsKey(attrName);
- }
-
- /**
- * Checks to see if there is an attribute name with the specified value.
- *
- * @param attrValue the value of a attribute to check
- * @return true if there is an attribute name with the specified value,
- * false otherwise
- */
- public boolean containsValue(Object attrValue)
- {
- return map.containsValue(attrValue);
- }
-
- /**
- * Gives a Set of attribute name and values pairs as MapEntries.
- * @see java.util.Map.Entry
- * @see java.util.Map#entrySet()
- *
- * @return a set of attribute name value pairs
- */
- public Set entrySet()
- {
- return map.entrySet();
- }
-
- /**
- * Checks to see if two Attributes are equal. The supplied object must be
- * a real instance of Attributes and contain the same attribute name/value
- * pairs.
- *
- * @param o another Attribute object which should be checked for equality
- * @return true if the object is an instance of Attributes and contains the
- * same name/value pairs, false otherwise
- */
- public boolean equals(Object o)
- {
- // quick and dirty check
- if (this == o)
- return true;
-
- try
- {
- return map.equals(((Attributes) o).map);
- }
- catch (ClassCastException cce)
- {
- return false;
- }
- catch (NullPointerException npe)
- {
- return false;
- }
- }
-
- /**
- * Gets the value of a specified attribute name.
- * XXX - what if the object is a String?
- *
- * @param attrName the name of the attribute we want the value of
- * @return the value of the specified attribute name or null when there is
- * no such attribute name
- */
- public Object get(Object attrName)
- {
- return map.get(attrName);
- }
-
- /**
- * Returns the hashcode of the attribute name/value map.
- */
- public int hashCode()
- {
- return map.hashCode();
- }
-
- /**
- * Returns true if there are no attributes set, false otherwise.
- */
- public boolean isEmpty()
- {
- return map.isEmpty();
- }
-
- /**
- * Gives a Set of all the values of defined attribute names.
- */
- public Set keySet()
- {
- return map.keySet();
- }
-
- /**
- * Adds or replaces a attribute name/value pair.
- * XXX - What if the name is a string? What if the name is neither a Name
- * nor a String? What if the value is not a string?
- *
- * @param name the name of the attribute
- * @param value the (new) value of the attribute
- * @return the old value of the attribute or null when there was no old
- * attribute with this name
- */
- public Object put(Object name, Object value)
- {
- return map.put(name, value);
- }
-
- /**
- * Adds or replaces all attribute name/value pairs from another
- * Attributes object to this one. The supplied Map must be an instance of
- * Attributes.
- *
- * @param attr the Attributes object to merge with this one
- * @exception ClassCastException if the supplied map is not an instance of
- * Attributes
- */
- public void putAll(Map attr)
- {
- if (!(attr instanceof Attributes))
- {
- throw new
- ClassCastException("Supplied Map is not an instance of Attributes");
- }
- map.putAll(attr);
- }
-
- /**
- * Remove a attribute name/value pair.
- * XXX - What if the name is a String?
- *
- * @param name the name of the attribute name/value pair to remove
- * @return the old value of the attribute or null if the attribute didn't
- * exist
- */
- public Object remove(Object name)
- {
- return map.remove(name);
- }
-
- /**
- * Returns the number of defined attribute name/value pairs.
- */
- public int size()
- {
- return map.size();
- }
-
- /**
- * Returns all the values of the defined attribute name/value pairs as a
- * Collection.
- */
- public Collection values()
- {
- return map.values();
- }
-}
diff --git a/libjava/java/util/jar/JarEntry.java b/libjava/java/util/jar/JarEntry.java
deleted file mode 100644
index 722a283bba3..00000000000
--- a/libjava/java/util/jar/JarEntry.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/* JarEntry.java - Represents an entry in a jar file
- Copyright (C) 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.jar;
-
-import java.io.IOException;
-import java.security.cert.Certificate;
-import java.util.zip.ZipEntry;
-
-/**
- * Extension to a ZipEntry that contains manifest attributes and certificates.
- * Both the Atrributes and the Certificates can be null when not set.
- * Note that the <code>getCertificates()</code> method only returns a
- * valid value after all of the data of the entry has been read.
- * <p>
- * There are no public methods to set the attributes or certificate of an
- * Entru. Only JarEntries created by the classes in <code>java.util.jar</code>
- * will have these properties set.
- *
- * @since 1.2
- * @author Mark Wielaard (mark@klomp.org)
- */
-
-public class JarEntry extends ZipEntry
-{
- // (Package local) fields
-
- Attributes attr;
- Certificate certs[];
-
- // Constructors
-
- /**
- * Creates a new JarEntry with the specified name and no attributes or
- * or certificates. Calls <code>super(name)</code> so all other (zip)entry
- * fields are null or -1.
- *
- * @param name the name of the new jar entry
- * @exception NullPointerException when the supplied name is null
- * @exception IllegalArgumentException when the supplied name is longer
- * than 65535 bytes
- */
- public JarEntry(String name) throws NullPointerException,
- IllegalArgumentException
- {
- super(name);
- attr = null;
- certs = null;
- }
-
- /**
- * Creates a new JarEntry with the specified ZipEntry as template for
- * all properties of the entry. Both attributes and certificates will be
- * null.
- *
- * @param entry the ZipEntry whose fields should be copied
- */
- public JarEntry(ZipEntry entry)
- {
- super(entry);
- attr = null;
- certs = null;
- }
-
- /**
- * Creates a new JarEntry with the specified JarEntry as template for
- * all properties of the entry.
- *
- * @param entry the jarEntry whose fields should be copied
- */
- public JarEntry(JarEntry entry)
- {
- super(entry);
- try
- {
- attr = entry.getAttributes();
- }
- catch (IOException _)
- {
- }
- certs = entry.getCertificates();
- }
-
- // Methods
-
- /**
- * Returns a copy of the Attributes set for this entry.
- * When no Attributes are set in the manifest null is returned.
- *
- * @return a copy of the Attributes set for this entry
- * @exception IOException This will never be thrown. It is here for
- * binary compatibility.
- */
- public Attributes getAttributes() throws IOException
- {
- if (attr != null)
- {
- return (Attributes) attr.clone();
- }
- else
- {
- return null;
- }
- }
-
- /**
- * Returns a copy of the certificates set for this entry.
- * When no certificates are set or when not all data of this entry has
- * been read null is returned.
- * <p>
- * To make sure that this call returns a valid value you must read all
- * data from the JarInputStream for this entry.
- * When you don't need the data for an entry but want to know the
- * certificates that are set for the entry then you can skip all data by
- * calling <code>skip(entry.getSize())</code> on the JarInputStream for
- * the entry.
- *
- * @return a copy of the certificates set for this entry
- */
- public Certificate[] getCertificates()
- {
- if (certs != null)
- {
- return (Certificate[])certs.clone();
- }
- else
- {
- return null;
- }
- }
-}
diff --git a/libjava/java/util/jar/JarException.java b/libjava/java/util/jar/JarException.java
deleted file mode 100644
index d6f0634fe71..00000000000
--- a/libjava/java/util/jar/JarException.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* JarException.java -- thrown to indicate an problem with a jar file
- Copyright (C) 2000, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.jar;
-
-import java.util.zip.ZipException;
-
-/**
- * This exception is thrown to indicate an problem with a jar file.
- * Note that none of the methods in the java.util.jar package actually declare
- * to throw this exception, most just declare that they throw an IOException
- * which is super class of JarException.
- *
- * @author Mark Wielaard (mark@klomp.org)
- * @since 1.2
- */
-public class JarException extends ZipException
-{
- /**
- * Compatible with JDK 1.2+.
- */
- private static final long serialVersionUID = 7159778400963954473L;
-
- /**
- * Create a new JarException without a descriptive error message.
- */
- public JarException()
- {
- }
-
- /**
- * Create a new JarException with a descriptive error message indicating
- * what went wrong. This message can later be retrieved by calling the
- * <code>getMessage()</code> method.
- *
- * @param message The descriptive error message
- * @see #getMessage()
- */
- public JarException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/java/util/jar/JarFile.java b/libjava/java/util/jar/JarFile.java
deleted file mode 100644
index 3550ad8e0fb..00000000000
--- a/libjava/java/util/jar/JarFile.java
+++ /dev/null
@@ -1,1058 +0,0 @@
-/* JarFile.java - Representation of a jar file
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.jar;
-
-import gnu.java.io.Base64InputStream;
-import gnu.java.security.OID;
-import gnu.java.security.pkcs.PKCS7SignedData;
-import gnu.java.security.pkcs.SignerInfo;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.InvalidKeyException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.Signature;
-import java.security.SignatureException;
-import java.security.cert.CRLException;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.Arrays;
-import java.util.Enumeration;
-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;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipException;
-import java.util.zip.ZipFile;
-
-/**
- * Representation of a jar file.
- * <p>
- * Note that this class is not a subclass of java.io.File but a subclass of
- * java.util.zip.ZipFile and you can only read JarFiles with it (although
- * there are constructors that take a File object).
- *
- * @since 1.2
- * @author Mark Wielaard (mark@klomp.org)
- * @author Casey Marshall (csm@gnu.org) wrote the certificate and entry
- * verification code.
- */
-public class JarFile extends ZipFile
-{
- // Fields
-
- /** The name of the manifest entry: META-INF/MANIFEST.MF */
- public static final String MANIFEST_NAME = "META-INF/MANIFEST.MF";
-
- /** The META-INF directory entry. */
- private static final String META_INF = "META-INF/";
-
- /** The suffix for PKCS7 DSA signature entries. */
- private static final String PKCS7_DSA_SUFFIX = ".DSA";
-
- /** The suffix for PKCS7 RSA signature entries. */
- private static final String PKCS7_RSA_SUFFIX = ".RSA";
-
- /** The suffix for digest attributes. */
- private static final String DIGEST_KEY_SUFFIX = "-Digest";
-
- /** The suffix for signature files. */
- private static final String SF_SUFFIX = ".SF";
-
- // Signature OIDs.
- private static final OID MD2_OID = new OID("1.2.840.113549.2.2");
- private static final OID MD4_OID = new OID("1.2.840.113549.2.4");
- private static final OID MD5_OID = new OID("1.2.840.113549.2.5");
- private static final OID SHA1_OID = new OID("1.3.14.3.2.26");
- private static final OID DSA_ENCRYPTION_OID = new OID("1.2.840.10040.4.1");
- private static final OID RSA_ENCRYPTION_OID = new OID("1.2.840.113549.1.1.1");
-
- /**
- * The manifest of this file, if any, otherwise null.
- * Read when first needed.
- */
- private Manifest manifest;
-
- /** Whether to verify the manifest and all entries. */
- boolean verify;
-
- /** Whether the has already been loaded. */
- private boolean manifestRead = false;
-
- /** Whether the signature files have been loaded. */
- boolean signaturesRead = false;
-
- /**
- * A map between entry names and booleans, signaling whether or
- * not that entry has been verified.
- * Only be accessed with lock on this JarFile*/
- HashMap verified = new HashMap();
-
- /**
- * A mapping from entry name to certificates, if any.
- * Only accessed with lock on this JarFile.
- */
- HashMap entryCerts;
-
- static boolean DEBUG = false;
- static void debug(Object msg)
- {
- System.err.print(JarFile.class.getName());
- System.err.print(" >>> ");
- System.err.println(msg);
- }
-
- // Constructors
-
- /**
- * Creates a new JarFile. All jar entries are verified (when a Manifest file
- * for this JarFile exists). You need to actually open and read the complete
- * jar entry (with <code>getInputStream()</code>) to check its signature.
- *
- * @param fileName the name of the file to open
- * @exception FileNotFoundException if the fileName cannot be found
- * @exception IOException if another IO exception occurs while reading
- */
- public JarFile(String fileName) throws FileNotFoundException, IOException
- {
- this(fileName, true);
- }
-
- /**
- * Creates a new JarFile. If verify is true then all jar entries are
- * verified (when a Manifest file for this JarFile exists). You need to
- * actually open and read the complete jar entry
- * (with <code>getInputStream()</code>) to check its signature.
- *
- * @param fileName the name of the file to open
- * @param verify checks manifest and entries when true and a manifest
- * exists, when false no checks are made
- * @exception FileNotFoundException if the fileName cannot be found
- * @exception IOException if another IO exception occurs while reading
- */
- public JarFile(String fileName, boolean verify) throws
- FileNotFoundException, IOException
- {
- super(fileName);
- if (verify)
- {
- manifest = readManifest();
- verify();
- }
- }
-
- /**
- * Creates a new JarFile. All jar entries are verified (when a Manifest file
- * for this JarFile exists). You need to actually open and read the complete
- * jar entry (with <code>getInputStream()</code>) to check its signature.
- *
- * @param file the file to open as a jar file
- * @exception FileNotFoundException if the file does not exits
- * @exception IOException if another IO exception occurs while reading
- */
- public JarFile(File file) throws FileNotFoundException, IOException
- {
- this(file, true);
- }
-
- /**
- * Creates a new JarFile. If verify is true then all jar entries are
- * verified (when a Manifest file for this JarFile exists). You need to
- * actually open and read the complete jar entry
- * (with <code>getInputStream()</code>) to check its signature.
- *
- * @param file the file to open to open as a jar file
- * @param verify checks manifest and entries when true and a manifest
- * exists, when false no checks are made
- * @exception FileNotFoundException if file does not exist
- * @exception IOException if another IO exception occurs while reading
- */
- public JarFile(File file, boolean verify) throws FileNotFoundException,
- IOException
- {
- super(file);
- if (verify)
- {
- manifest = readManifest();
- verify();
- }
- }
-
- /**
- * Creates a new JarFile with the indicated mode. If verify is true then
- * all jar entries are verified (when a Manifest file for this JarFile
- * exists). You need to actually open and read the complete jar entry
- * (with <code>getInputStream()</code>) to check its signature.
- * manifest and if the manifest exists and verify is true verfies it.
- *
- * @param file the file to open to open as a jar file
- * @param verify checks manifest and entries when true and a manifest
- * exists, when false no checks are made
- * @param mode either ZipFile.OPEN_READ or
- * (ZipFile.OPEN_READ | ZipFile.OPEN_DELETE)
- * @exception FileNotFoundException if the file does not exist
- * @exception IOException if another IO exception occurs while reading
- * @exception IllegalArgumentException when given an illegal mode
- *
- * @since 1.3
- */
- public JarFile(File file, boolean verify, int mode) throws
- FileNotFoundException, IOException, IllegalArgumentException
- {
- super(file, mode);
- if (verify)
- {
- manifest = readManifest();
- verify();
- }
- }
-
- // Methods
-
- /**
- * XXX - should verify the manifest file
- */
- private void verify()
- {
- // only check if manifest is not null
- if (manifest == null)
- {
- verify = false;
- return;
- }
-
- verify = true;
- // XXX - verify manifest
- }
-
- /**
- * Parses and returns the manifest if it exists, otherwise returns null.
- */
- private Manifest readManifest()
- {
- try
- {
- ZipEntry manEntry = super.getEntry(MANIFEST_NAME);
- if (manEntry != null)
- {
- InputStream in = super.getInputStream(manEntry);
- manifestRead = true;
- return new Manifest(in);
- }
- else
- {
- manifestRead = true;
- return null;
- }
- }
- catch (IOException ioe)
- {
- manifestRead = true;
- return null;
- }
- }
-
- /**
- * Returns a enumeration of all the entries in the JarFile.
- * Note that also the Jar META-INF entries are returned.
- *
- * @exception IllegalStateException when the JarFile is already closed
- */
- public Enumeration entries() throws IllegalStateException
- {
- return new JarEnumeration(super.entries(), this);
- }
-
- /**
- * Wraps a given Zip Entries Enumeration. For every zip entry a
- * JarEntry is created and the corresponding Attributes are looked up.
- */
- private static class JarEnumeration implements Enumeration
- {
-
- private final Enumeration entries;
- private final JarFile jarfile;
-
- JarEnumeration(Enumeration e, JarFile f)
- {
- entries = e;
- jarfile = f;
- }
-
- public boolean hasMoreElements()
- {
- return entries.hasMoreElements();
- }
-
- public Object nextElement()
- {
- ZipEntry zip = (ZipEntry) entries.nextElement();
- JarEntry jar = new JarEntry(zip);
- Manifest manifest;
- try
- {
- manifest = jarfile.getManifest();
- }
- catch (IOException ioe)
- {
- manifest = null;
- }
-
- if (manifest != null)
- {
- jar.attr = manifest.getAttributes(jar.getName());
- }
-
- synchronized(jarfile)
- {
- if (!jarfile.signaturesRead)
- try
- {
- jarfile.readSignatures();
- }
- catch (IOException ioe)
- {
- if (JarFile.DEBUG)
- {
- JarFile.debug(ioe);
- ioe.printStackTrace();
- }
- jarfile.signaturesRead = true; // fudge it.
- }
-
- // Include the certificates only if we have asserted that the
- // signatures are valid. This means the certificates will not be
- // available if the entry hasn't been read yet.
- if (jarfile.entryCerts != null
- && jarfile.verified.get(zip.getName()) == Boolean.TRUE)
- {
- Set certs = (Set) jarfile.entryCerts.get(jar.getName());
- if (certs != null)
- jar.certs = (Certificate[])
- certs.toArray(new Certificate[certs.size()]);
- }
- }
- return jar;
- }
- }
-
- /**
- * XXX
- * It actually returns a JarEntry not a zipEntry
- * @param name XXX
- */
- public synchronized ZipEntry getEntry(String name)
- {
- ZipEntry entry = super.getEntry(name);
- if (entry != null)
- {
- JarEntry jarEntry = new JarEntry(entry);
- Manifest manifest;
- try
- {
- manifest = getManifest();
- }
- catch (IOException ioe)
- {
- manifest = null;
- }
-
- if (manifest != null)
- {
- jarEntry.attr = manifest.getAttributes(name);
- }
-
- if (!signaturesRead)
- try
- {
- readSignatures();
- }
- catch (IOException ioe)
- {
- if (DEBUG)
- {
- debug(ioe);
- ioe.printStackTrace();
- }
- signaturesRead = true;
- }
- // See the comments in the JarEnumeration for why we do this
- // check.
- if (DEBUG)
- debug("entryCerts=" + entryCerts + " verified " + name
- + " ? " + verified.get(name));
- if (entryCerts != null && verified.get(name) == Boolean.TRUE)
- {
- Set certs = (Set) entryCerts.get(name);
- if (certs != null)
- jarEntry.certs = (Certificate[])
- certs.toArray(new Certificate[certs.size()]);
- }
- return jarEntry;
- }
- return null;
- }
-
- /**
- * Returns an input stream for the given entry. If configured to
- * verify entries, the input stream returned will verify them while
- * the stream is read, but only on the first time.
- *
- * @param entry The entry to get the input stream for.
- * @exception ZipException XXX
- * @exception IOException XXX
- */
- public synchronized InputStream getInputStream(ZipEntry entry) throws
- ZipException, IOException
- {
- // If we haven't verified the hash, do it now.
- if (!verified.containsKey(entry.getName()) && verify)
- {
- if (DEBUG)
- debug("reading and verifying " + entry);
- return new EntryInputStream(entry, super.getInputStream(entry), this);
- }
- else
- {
- if (DEBUG)
- debug("reading already verified entry " + entry);
- if (verify && verified.get(entry.getName()) == Boolean.FALSE)
- throw new ZipException("digest for " + entry + " is invalid");
- return super.getInputStream(entry);
- }
- }
-
- /**
- * Returns the JarEntry that belongs to the name if such an entry
- * exists in the JarFile. Returns null otherwise
- * Convenience method that just casts the result from <code>getEntry</code>
- * to a JarEntry.
- *
- * @param name the jar entry name to look up
- * @return the JarEntry if it exists, null otherwise
- */
- public JarEntry getJarEntry(String name)
- {
- return (JarEntry) getEntry(name);
- }
-
- /**
- * Returns the manifest for this JarFile or null when the JarFile does not
- * contain a manifest file.
- */
- public synchronized Manifest getManifest() throws IOException
- {
- if (!manifestRead)
- manifest = readManifest();
-
- return manifest;
- }
-
- // Only called with lock on this JarFile.
- private void readSignatures() throws IOException
- {
- Map pkcs7Dsa = new HashMap();
- Map pkcs7Rsa = new HashMap();
- Map sigFiles = new HashMap();
-
- // Phase 1: Read all signature files. These contain the user
- // certificates as well as the signatures themselves.
- for (Enumeration e = super.entries(); e.hasMoreElements(); )
- {
- ZipEntry ze = (ZipEntry) e.nextElement();
- String name = ze.getName();
- if (name.startsWith(META_INF))
- {
- String alias = name.substring(META_INF.length());
- if (alias.lastIndexOf('.') >= 0)
- alias = alias.substring(0, alias.lastIndexOf('.'));
-
- if (name.endsWith(PKCS7_DSA_SUFFIX) || name.endsWith(PKCS7_RSA_SUFFIX))
- {
- if (DEBUG)
- debug("reading PKCS7 info from " + name + ", alias=" + alias);
- PKCS7SignedData sig = null;
- try
- {
- sig = new PKCS7SignedData(super.getInputStream(ze));
- }
- catch (CertificateException ce)
- {
- IOException ioe = new IOException("certificate parsing error");
- ioe.initCause(ce);
- throw ioe;
- }
- catch (CRLException crle)
- {
- IOException ioe = new IOException("CRL parsing error");
- ioe.initCause(crle);
- throw ioe;
- }
- if (name.endsWith(PKCS7_DSA_SUFFIX))
- pkcs7Dsa.put(alias, sig);
- else if (name.endsWith(PKCS7_RSA_SUFFIX))
- pkcs7Rsa.put(alias, sig);
- }
- else if (name.endsWith(SF_SUFFIX))
- {
- if (DEBUG)
- debug("reading signature file for " + alias + ": " + name);
- Manifest sf = new Manifest(super.getInputStream(ze));
- sigFiles.put(alias, sf);
- if (DEBUG)
- debug("result: " + sf);
- }
- }
- }
-
- // Phase 2: verify the signatures on any signature files.
- Set validCerts = new HashSet();
- Map entryCerts = new HashMap();
- for (Iterator it = sigFiles.entrySet().iterator(); it.hasNext(); )
- {
- int valid = 0;
- Map.Entry e = (Map.Entry) it.next();
- String alias = (String) e.getKey();
-
- PKCS7SignedData sig = (PKCS7SignedData) pkcs7Dsa.get(alias);
- if (sig != null)
- {
- Certificate[] certs = sig.getCertificates();
- Set signerInfos = sig.getSignerInfos();
- for (Iterator it2 = signerInfos.iterator(); it2.hasNext(); )
- verify(certs, (SignerInfo) it2.next(), alias, validCerts);
- }
-
- sig = (PKCS7SignedData) pkcs7Rsa.get(alias);
- if (sig != null)
- {
- Certificate[] certs = sig.getCertificates();
- Set signerInfos = sig.getSignerInfos();
- for (Iterator it2 = signerInfos.iterator(); it2.hasNext(); )
- verify(certs, (SignerInfo) it2.next(), alias, validCerts);
- }
-
- // It isn't a signature for anything. Punt it.
- if (validCerts.isEmpty())
- {
- it.remove();
- continue;
- }
-
- entryCerts.put(e.getValue(), new HashSet(validCerts));
- validCerts.clear();
- }
-
- // Phase 3: verify the signature file signatures against the manifest,
- // mapping the entry name to the target certificates.
- this.entryCerts = new HashMap();
- for (Iterator it = entryCerts.entrySet().iterator(); it.hasNext(); )
- {
- Map.Entry e = (Map.Entry) it.next();
- Manifest sigfile = (Manifest) e.getKey();
- Map entries = sigfile.getEntries();
- Set certificates = (Set) e.getValue();
-
- for (Iterator it2 = entries.entrySet().iterator(); it2.hasNext(); )
- {
- Map.Entry e2 = (Map.Entry) it2.next();
- String entryname = String.valueOf(e2.getKey());
- Attributes attr = (Attributes) e2.getValue();
- if (verifyHashes(entryname, attr))
- {
- if (DEBUG)
- debug("entry " + entryname + " has certificates " + certificates);
- Set s = (Set) this.entryCerts.get(entryname);
- if (s != null)
- s.addAll(certificates);
- else
- this.entryCerts.put(entryname, new HashSet(certificates));
- }
- }
- }
-
- signaturesRead = true;
- }
-
- /**
- * Tell if the given signer info is over the given alias's signature file,
- * given one of the certificates specified.
- */
- private void verify(Certificate[] certs, SignerInfo signerInfo,
- String alias, Set validCerts)
- {
- Signature sig = null;
- try
- {
- OID alg = signerInfo.getDigestEncryptionAlgorithmId();
- if (alg.equals(DSA_ENCRYPTION_OID))
- {
- if (!signerInfo.getDigestAlgorithmId().equals(SHA1_OID))
- return;
- sig = Signature.getInstance("SHA1withDSA");
- }
- else if (alg.equals(RSA_ENCRYPTION_OID))
- {
- OID hash = signerInfo.getDigestAlgorithmId();
- if (hash.equals(MD2_OID))
- sig = Signature.getInstance("md2WithRsaEncryption");
- else if (hash.equals(MD4_OID))
- sig = Signature.getInstance("md4WithRsaEncryption");
- else if (hash.equals(MD5_OID))
- sig = Signature.getInstance("md5WithRsaEncryption");
- else if (hash.equals(SHA1_OID))
- sig = Signature.getInstance("sha1WithRsaEncryption");
- else
- return;
- }
- else
- {
- if (DEBUG)
- debug("unsupported signature algorithm: " + alg);
- return;
- }
- }
- catch (NoSuchAlgorithmException nsae)
- {
- if (DEBUG)
- {
- debug(nsae);
- nsae.printStackTrace();
- }
- return;
- }
- ZipEntry sigFileEntry = super.getEntry(META_INF + alias + SF_SUFFIX);
- if (sigFileEntry == null)
- return;
- for (int i = 0; i < certs.length; i++)
- {
- if (!(certs[i] instanceof X509Certificate))
- continue;
- X509Certificate cert = (X509Certificate) certs[i];
- if (!cert.getIssuerX500Principal().equals(signerInfo.getIssuer()) ||
- !cert.getSerialNumber().equals(signerInfo.getSerialNumber()))
- continue;
- try
- {
- sig.initVerify(cert.getPublicKey());
- InputStream in = super.getInputStream(sigFileEntry);
- if (in == null)
- continue;
- byte[] buf = new byte[1024];
- int len = 0;
- while ((len = in.read(buf)) != -1)
- sig.update(buf, 0, len);
- if (sig.verify(signerInfo.getEncryptedDigest()))
- {
- if (DEBUG)
- debug("signature for " + cert.getSubjectDN() + " is good");
- validCerts.add(cert);
- }
- }
- catch (IOException ioe)
- {
- continue;
- }
- catch (InvalidKeyException ike)
- {
- continue;
- }
- catch (SignatureException se)
- {
- continue;
- }
- }
- }
-
- /**
- * Verifies that the digest(s) in a signature file were, in fact, made
- * over the manifest entry for ENTRY.
- *
- * @param entry The entry name.
- * @param attr The attributes from the signature file to verify.
- */
- private boolean verifyHashes(String entry, Attributes attr)
- {
- int verified = 0;
-
- // The bytes for ENTRY's manifest entry, which are signed in the
- // signature file.
- byte[] entryBytes = null;
- try
- {
- ZipEntry e = super.getEntry(entry);
- if (e == null)
- {
- if (DEBUG)
- debug("verifyHashes: no entry '" + entry + "'");
- return false;
- }
- entryBytes = readManifestEntry(e);
- }
- catch (IOException ioe)
- {
- if (DEBUG)
- {
- debug(ioe);
- ioe.printStackTrace();
- }
- return false;
- }
-
- for (Iterator it = attr.entrySet().iterator(); it.hasNext(); )
- {
- Map.Entry e = (Map.Entry) it.next();
- String key = String.valueOf(e.getKey());
- if (!key.endsWith(DIGEST_KEY_SUFFIX))
- continue;
- String alg = key.substring(0, key.length() - DIGEST_KEY_SUFFIX.length());
- try
- {
- byte[] hash = Base64InputStream.decode((String) e.getValue());
- MessageDigest md = MessageDigest.getInstance(alg);
- md.update(entryBytes);
- byte[] hash2 = md.digest();
- if (DEBUG)
- debug("verifying SF entry " + entry + " alg: " + md.getAlgorithm()
- + " expect=" + new java.math.BigInteger(hash).toString(16)
- + " comp=" + new java.math.BigInteger(hash2).toString(16));
- if (!Arrays.equals(hash, hash2))
- return false;
- verified++;
- }
- catch (IOException ioe)
- {
- if (DEBUG)
- {
- debug(ioe);
- ioe.printStackTrace();
- }
- return false;
- }
- catch (NoSuchAlgorithmException nsae)
- {
- if (DEBUG)
- {
- debug(nsae);
- nsae.printStackTrace();
- }
- return false;
- }
- }
-
- // We have to find at least one valid digest.
- return verified > 0;
- }
-
- /**
- * Read the raw bytes that comprise a manifest entry. We can't use the
- * Manifest object itself, because that loses information (such as line
- * endings, and order of entries).
- */
- private byte[] readManifestEntry(ZipEntry entry) throws IOException
- {
- InputStream in = super.getInputStream(super.getEntry(MANIFEST_NAME));
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- byte[] target = ("Name: " + entry.getName()).getBytes();
- int t = 0, c, prev = -1, state = 0, l = -1;
-
- while ((c = in.read()) != -1)
- {
-// if (DEBUG)
-// debug("read "
-// + (c == '\n' ? "\\n" : (c == '\r' ? "\\r" : String.valueOf((char) c)))
-// + " state=" + state + " prev="
-// + (prev == '\n' ? "\\n" : (prev == '\r' ? "\\r" : String.valueOf((char) prev)))
-// + " t=" + t + (t < target.length ? (" target[t]=" + (char) target[t]) : "")
-// + " l=" + l);
- switch (state)
- {
-
- // Step 1: read until we find the "target" bytes: the start
- // of the entry we need to read.
- case 0:
- if (((byte) c) != target[t])
- t = 0;
- else
- {
- t++;
- if (t == target.length)
- {
- out.write(target);
- state = 1;
- }
- }
- break;
-
- // Step 2: assert that there is a newline character after
- // the "target" bytes.
- case 1:
- if (c != '\n' && c != '\r')
- {
- out.reset();
- t = 0;
- state = 0;
- }
- else
- {
- out.write(c);
- state = 2;
- }
- break;
-
- // Step 3: read this whole entry, until we reach an empty
- // line.
- case 2:
- if (c == '\n')
- {
- out.write(c);
- // NL always terminates a line.
- if (l == 0 || (l == 1 && prev == '\r'))
- return out.toByteArray();
- l = 0;
- }
- else
- {
- // Here we see a blank line terminated by a CR,
- // followed by the next entry. Technically, `c' should
- // always be 'N' at this point.
- if (l == 1 && prev == '\r')
- return out.toByteArray();
- out.write(c);
- l++;
- }
- prev = c;
- break;
-
- default:
- throw new RuntimeException("this statement should be unreachable");
- }
- }
-
- // The last entry, with a single CR terminating the line.
- if (state == 2 && prev == '\r' && l == 0)
- return out.toByteArray();
-
- // We should not reach this point, we didn't find the entry (or, possibly,
- // it is the last entry and is malformed).
- throw new IOException("could not find " + entry + " in manifest");
- }
-
- /**
- * A utility class that verifies jar entries as they are read.
- */
- private static class EntryInputStream extends FilterInputStream
- {
- private final JarFile jarfile;
- private final long length;
- private long pos;
- private final ZipEntry entry;
- private final byte[][] hashes;
- private final MessageDigest[] md;
- private boolean checked;
-
- EntryInputStream(final ZipEntry entry,
- final InputStream in,
- final JarFile jar)
- throws IOException
- {
- super(in);
- this.entry = entry;
- this.jarfile = jar;
-
- length = entry.getSize();
- pos = 0;
- checked = false;
-
- Attributes attr;
- Manifest manifest = jarfile.getManifest();
- if (manifest != null)
- attr = manifest.getAttributes(entry.getName());
- else
- attr = null;
- if (DEBUG)
- debug("verifying entry " + entry + " attr=" + attr);
- if (attr == null)
- {
- hashes = new byte[0][];
- md = new MessageDigest[0];
- }
- else
- {
- List hashes = new LinkedList();
- List md = new LinkedList();
- for (Iterator it = attr.entrySet().iterator(); it.hasNext(); )
- {
- Map.Entry e = (Map.Entry) it.next();
- String key = String.valueOf(e.getKey());
- if (key == null)
- continue;
- if (!key.endsWith(DIGEST_KEY_SUFFIX))
- continue;
- hashes.add(Base64InputStream.decode((String) e.getValue()));
- try
- {
- md.add(MessageDigest.getInstance
- (key.substring(0, key.length() - DIGEST_KEY_SUFFIX.length())));
- }
- catch (NoSuchAlgorithmException nsae)
- {
- IOException ioe = new IOException("no such message digest: " + key);
- ioe.initCause(nsae);
- throw ioe;
- }
- }
- if (DEBUG)
- debug("digests=" + md);
- this.hashes = (byte[][]) hashes.toArray(new byte[hashes.size()][]);
- this.md = (MessageDigest[]) md.toArray(new MessageDigest[md.size()]);
- }
- }
-
- public boolean markSupported()
- {
- return false;
- }
-
- public void mark(int readLimit)
- {
- }
-
- public void reset()
- {
- }
-
- public int read() throws IOException
- {
- int b = super.read();
- if (b == -1)
- {
- eof();
- return -1;
- }
- for (int i = 0; i < md.length; i++)
- md[i].update((byte) b);
- pos++;
- if (length > 0 && pos >= length)
- eof();
- return b;
- }
-
- public int read(byte[] buf, int off, int len) throws IOException
- {
- int count = super.read(buf, off, (int) Math.min(len, (length != 0
- ? length - pos
- : Integer.MAX_VALUE)));
- if (count == -1 || (length > 0 && pos >= length))
- {
- eof();
- return -1;
- }
- for (int i = 0; i < md.length; i++)
- md[i].update(buf, off, count);
- pos += count;
- if (length != 0 && pos >= length)
- eof();
- return count;
- }
-
- public int read(byte[] buf) throws IOException
- {
- return read(buf, 0, buf.length);
- }
-
- public long skip(long bytes) throws IOException
- {
- byte[] b = new byte[1024];
- long amount = 0;
- while (amount < bytes)
- {
- int l = read(b, 0, (int) Math.min(b.length, bytes - amount));
- if (l == -1)
- break;
- amount += l;
- }
- return amount;
- }
-
- private void eof() throws IOException
- {
- if (checked)
- return;
- checked = true;
- for (int i = 0; i < md.length; i++)
- {
- byte[] hash = md[i].digest();
- if (DEBUG)
- debug("verifying " + md[i].getAlgorithm() + " expect="
- + new java.math.BigInteger(hashes[i]).toString(16)
- + " comp=" + new java.math.BigInteger(hash).toString(16));
- if (!Arrays.equals(hash, hashes[i]))
- {
- synchronized(jarfile)
- {
- if (DEBUG)
- debug(entry + " could NOT be verified");
- jarfile.verified.put(entry.getName(), Boolean.FALSE);
- }
- return;
- // XXX ??? what do we do here?
- // throw new ZipException("message digest mismatch");
- }
- }
-
- synchronized(jarfile)
- {
- if (DEBUG)
- debug(entry + " has been VERIFIED");
- jarfile.verified.put(entry.getName(), Boolean.TRUE);
- }
- }
- }
-}
diff --git a/libjava/java/util/jar/JarInputStream.java b/libjava/java/util/jar/JarInputStream.java
deleted file mode 100644
index 1788af6add5..00000000000
--- a/libjava/java/util/jar/JarInputStream.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/* JarInputStream.java - InputStream for reading jar files
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.jar;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-/**
- * InputStream for reading jar files.
- * XXX - verification of the signatures in the Manifest file is not yet
- * implemented.
- *
- * @since 1.2
- * @author Mark Wielaard (mark@klomp.org)
- */
-
-public class JarInputStream extends ZipInputStream
-{
- // Fields
-
- /** The manifest for this file or null when there was no manifest. */
- private Manifest manifest;
-
- /** The first real JarEntry for this file. Used by readManifest() to store
- an entry that isn't the manifest but that should be returned by
- getNextEntry next time it is called. Null when no firstEntry was read
- while searching for the manifest entry, or when it has already been
- returned by getNextEntry(). */
- private JarEntry firstEntry;
-
- // Constructors
-
- /**
- * Creates a new JarInputStream and tries to read the manifest.
- * If such a manifest is present the JarInputStream tries to verify all
- * the entry signatures while reading.
- *
- * @param in InputStream to read the jar from
- * @exception IOException when an error occurs when opening or reading
- */
- public JarInputStream(InputStream in) throws IOException
- {
- this(in, true);
- }
-
- /**
- * Creates a new JarInputStream and tries to read the manifest.
- * If such a manifest is present and verify is true, the JarInputStream
- * tries to verify all the entry signatures while reading.
- *
- * @param in InputStream to read the jar from
- * @param verify whether or not to verify the manifest entries
- * @exception IOException when an error occurs when opening or reading
- */
- public JarInputStream(InputStream in, boolean verify) throws IOException
- {
- super(in);
- readManifest(verify);
- }
-
- // Methods
-
- /**
- * Set the manifest if found. Skips all entries that start with "META-INF/"
- *
- * @param verify when true (and a Manifest is found) checks the Manifest,
- * when false no check is performed
- * @exception IOException if an error occurs while reading
- */
- private void readManifest(boolean verify) throws IOException
- {
- firstEntry = (JarEntry) super.getNextEntry();
- while ((firstEntry != null) &&
- firstEntry.getName().startsWith("META-INF/"))
- {
- if (firstEntry.getName().equals(JarFile.MANIFEST_NAME))
- {
- manifest = new Manifest(this);
- }
- firstEntry = (JarEntry) super.getNextEntry();
- }
-
- if (verify)
- {
- // XXX
- }
- }
-
- /**
- * Creates a JarEntry for a particular name and consults the manifest
- * for the Attributes of the entry.
- * Used by <code>ZipEntry.getNextEntry()</code>
- *
- * @param name the name of the new entry
- */
- protected ZipEntry createZipEntry(String name)
- {
- ZipEntry zipEntry = super.createZipEntry(name);
- JarEntry jarEntry = new JarEntry(zipEntry);
- if (manifest != null)
- {
- jarEntry.attr = manifest.getAttributes(name);
- }
- return jarEntry;
- }
-
- /**
- * Returns the Manifest for the jar file or null if there was no Manifest.
- */
- public Manifest getManifest()
- {
- return manifest;
- }
-
- /**
- * Returns the next entry or null when there are no more entries.
- * Does actually return a JarEntry, if you don't want to cast it yourself
- * use <code>getNextJarEntry()</code>. Does not return any entries found
- * at the beginning of the ZipFile that are special
- * (those that start with "META-INF/").
- *
- * @exception IOException if an IO error occurs when reading the entry
- */
- public ZipEntry getNextEntry() throws IOException
- {
- ZipEntry entry;
- if (firstEntry != null)
- {
- entry = firstEntry;
- firstEntry = null;
- }
- else
- {
- entry = super.getNextEntry();
- }
- return entry;
- }
-
- /**
- * Returns the next jar entry or null when there are no more entries.
- *
- * @exception IOException if an IO error occurs when reading the entry
- */
- public JarEntry getNextJarEntry() throws IOException
- {
- return (JarEntry) getNextEntry();
- }
-
- /**
- * XXX
- *
- * @param buf XXX
- * @param off XXX
- * @param len XXX
- * @return XXX
- * @exception IOException XXX
- */
- public int read(byte[]buf, int off, int len) throws IOException
- {
- // XXX if (verify) {}
- return super.read(buf, off, len);
- }
-}
diff --git a/libjava/java/util/jar/JarOutputStream.java b/libjava/java/util/jar/JarOutputStream.java
deleted file mode 100644
index 2c8c2f08d8f..00000000000
--- a/libjava/java/util/jar/JarOutputStream.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* JarOutputStream.java - OutputStream for writing jar files
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.jar;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-/**
- * OutputStream for writing jar files.
- * A special ZipOutputStream that can take JarEntries and can have a optional
- * Manifest as first entry.
- *
- * @author Mark Wielaard (mark@klomp.org)
- */
-
-public class JarOutputStream extends ZipOutputStream
-{
- // Constructors
-
- /**
- * Creates a new JarOutputStream without a manifest entry.
- *
- * @param out the stream to create the new jar on
- * @exception IOException if something unexpected happend
- */
- public JarOutputStream(OutputStream out) throws IOException
- {
- this(out, null);
- }
-
- /**
- * Creates a new JarOutputStream with a manifest entry.
- * The manifest will be the first entry in the jar.
- *
- * @param out the stream to create the new jar on
- * @param man the manifest that should be put in the jar file or null
- * for no manifest entry
- * @exception IOException if something unexpected happend
- */
- public JarOutputStream(OutputStream out, Manifest man) throws IOException
- {
- super(out);
- if (man != null)
- writeManifest(man);
- }
-
- // Methods
-
- /**
- * Writes the manifest to a new JarEntry in this JarOutputStream with as
- * name JarFile.MANIFEST_NAME.
- *
- * @param manifest the non null manifest to be written
- * @exception IOException if something unexpected happend
- */
- private void writeManifest(Manifest manifest) throws IOException
- {
- // Create a new Jar Entry for the Manifest
- JarEntry entry = new JarEntry(JarFile.MANIFEST_NAME);
- putNextEntry(entry);
- manifest.write(this);
- closeEntry();
- }
-
- /**
- * Prepares the JarOutputStream for writing the next entry.
- * This implementation just calls <code>super.putNextEntre()</code>.
- *
- * @param entry The information for the next entry
- * @exception IOException when some unexpected I/O exception occurred
- */
- public void putNextEntry(ZipEntry entry) throws IOException
- {
- super.putNextEntry(entry); // XXX
- }
-}
diff --git a/libjava/java/util/jar/Manifest.java b/libjava/java/util/jar/Manifest.java
deleted file mode 100644
index fdc76ff97ee..00000000000
--- a/libjava/java/util/jar/Manifest.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/* Manifest.java -- Reads, writes and manipulaties jar manifest files
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.jar;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * Reads, writes and manipulaties jar manifest files.
- * XXX
- *
- * @since 1.2
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class Manifest implements Cloneable
-{
- // Fields
-
- /** The main attributes of the manifest (jar file). */
- private final Attributes mainAttr;
-
- /** A map of atrributes for all entries described in this Manifest. */
- private final Map entries;
-
- // Constructors
-
- /**
- * Creates a new empty Manifest.
- */
- public Manifest()
- {
- mainAttr = new Attributes();
- entries = new Hashtable();
- }
-
- /**
- * Creates a Manifest from the supplied input stream.
- *
- * @see read(Inputstream)
- * @see write(OutputStream)
- *
- * @param InputStream the input stream to read the manifest from
- * @exception IOException when an i/o exception occurs or the input stream
- * does not describe a valid manifest
- */
- public Manifest(InputStream in) throws IOException
- {
- this();
- read(in);
- }
-
- /**
- * Creates a Manifest from another Manifest.
- * Makes a deep copy of the main attributes, but a shallow copy of
- * the other entries. This means that you can freely add, change or remove
- * the main attributes or the entries of the new manifest without effecting
- * the original manifest, but adding, changing or removing attributes from
- * a particular entry also changes the attributes of that entry in the
- * original manifest.
- *
- * @see clone()
- * @param man the Manifest to copy from
- */
- public Manifest(Manifest man)
- {
- mainAttr = new Attributes(man.getMainAttributes());
- entries = new Hashtable(man.getEntries());
- }
-
- // Methods
-
- /**
- * Gets the main attributes of this Manifest.
- */
- public Attributes getMainAttributes()
- {
- return mainAttr;
- }
-
- /**
- * Gets a map of entry Strings to Attributes for all the entries described
- * in this manifest. Adding, changing or removing from this entries map
- * changes the entries of this manifest.
- */
- public Map getEntries()
- {
- return entries;
- }
-
- /**
- * Returns the Attributes associated with the Entry.
- * <p>
- * Implemented as:
- * <code>return (Attributes)getEntries().get(entryName)</code>
- *
- * @param entryName the name of the entry to look up
- * @return the attributes associated with the entry or null when none
- */
- public Attributes getAttributes(String entryName)
- {
- return (Attributes) getEntries().get(entryName);
- }
-
- /**
- * Clears the main attributes and removes all the entries from the
- * manifest.
- */
- public void clear()
- {
- mainAttr.clear();
- entries.clear();
- }
-
- /**
- * XXX
- */
- public void read(InputStream in) throws IOException
- {
- BufferedReader br =
- new BufferedReader(new InputStreamReader(in, "8859_1"));
- read_main_section(getMainAttributes(), br);
- read_individual_sections(getEntries(), br);
- }
-
- // Private Static methods for reading the Manifest file from BufferedReader
-
- private static void read_main_section(Attributes attr,
- BufferedReader br) throws IOException
- {
- // According to the spec we should actually call read_version_info() here.
- read_attributes(attr, br);
- // Explicitly set Manifest-Version attribute if not set in Main
- // attributes of Manifest.
- if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null)
- attr.putValue(Attributes.Name.MANIFEST_VERSION, "0.0");
- }
-
- /**
- * Pedantic method that requires the next attribute in the Manifest to be
- * the "Manifest-Version". This follows the Manifest spec closely but
- * reject some jar Manifest files out in the wild.
- */
- private static void read_version_info(Attributes attr,
- BufferedReader br) throws IOException
- {
- String version_header = Attributes.Name.MANIFEST_VERSION.toString();
- try
- {
- String value = expect_header(version_header, br);
- attr.putValue(Attributes.Name.MANIFEST_VERSION, value);
- }
- catch (IOException ioe)
- {
- throw new JarException("Manifest should start with a " +
- version_header + ": " + ioe.getMessage());
- }
- }
-
- private static String expect_header(String header, BufferedReader br)
- throws IOException
- {
- String s = br.readLine();
- if (s == null)
- {
- throw new JarException("unexpected end of file");
- }
- return expect_header(header, br, s);
- }
-
- private static String expect_header(String header, BufferedReader br,
- String s) throws IOException
- {
- try
- {
- String name = s.substring(0, header.length() + 1);
- if (name.equalsIgnoreCase(header + ":"))
- {
- String value_start = s.substring(header.length() + 2);
- return read_header_value(value_start, br);
- }
- }
- catch (IndexOutOfBoundsException iobe)
- {
- }
- // If we arrive here, something went wrong
- throw new JarException("unexpected '" + s + "'");
- }
-
- private static String read_header_value(String s, BufferedReader br)
- throws IOException
- {
- boolean try_next = true;
- while (try_next)
- {
- // Lets see if there is something on the next line
- br.mark(1);
- if (br.read() == ' ')
- {
- s += br.readLine();
- }
- else
- {
- br.reset();
- try_next = false;
- }
- }
- return s;
- }
-
- private static void read_attributes(Attributes attr,
- BufferedReader br) throws IOException
- {
- String s = br.readLine();
- while (s != null && (!s.equals("")))
- {
- read_attribute(attr, s, br);
- s = br.readLine();
- }
- }
-
- private static void read_attribute(Attributes attr, String s,
- BufferedReader br) throws IOException
- {
- try
- {
- int colon = s.indexOf(": ");
- String name = s.substring(0, colon);
- String value_start = s.substring(colon + 2);
- String value = read_header_value(value_start, br);
- attr.putValue(name, value);
- }
- catch (IndexOutOfBoundsException iobe)
- {
- throw new JarException("Manifest contains a bad header: " + s);
- }
- }
-
- private static void read_individual_sections(Map entries,
- BufferedReader br) throws
- IOException
- {
- String s = br.readLine();
- while (s != null && (!s.equals("")))
- {
- Attributes attr = read_section_name(s, br, entries);
- read_attributes(attr, br);
- s = br.readLine();
- }
- }
-
- private static Attributes read_section_name(String s, BufferedReader br,
- Map entries) throws JarException
- {
- try
- {
- String name = expect_header("Name", br, s);
- Attributes attr = new Attributes();
- entries.put(name, attr);
- return attr;
- }
- catch (IOException ioe)
- {
- throw new JarException
- ("Section should start with a Name header: " + ioe.getMessage());
- }
- }
-
- /**
- * XXX
- */
- public void write(OutputStream out) throws IOException
- {
- PrintWriter pw =
- new PrintWriter(new
- BufferedWriter(new OutputStreamWriter(out, "8859_1")));
- write_main_section(getMainAttributes(), pw);
- pw.println();
- write_individual_sections(getEntries(), pw);
- if (pw.checkError())
- {
- throw new JarException("Error while writing manifest");
- }
- }
-
- // Private Static functions for writing the Manifest file to a PrintWriter
-
- private static void write_main_section(Attributes attr,
- PrintWriter pw) throws JarException
- {
- write_version_info(attr, pw);
- write_main_attributes(attr, pw);
- }
-
- private static void write_version_info(Attributes attr, PrintWriter pw)
- {
- // First check if there is already a version attribute set
- String version = attr.getValue(Attributes.Name.MANIFEST_VERSION);
- if (version == null)
- {
- version = "1.0";
- }
- write_header(Attributes.Name.MANIFEST_VERSION.toString(), version, pw);
- }
-
- private static void write_header(String name, String value, PrintWriter pw)
- {
- pw.print(name + ": ");
-
- int last = 68 - name.length();
- if (last > value.length())
- {
- pw.println(value);
- }
- else
- {
- pw.println(value.substring(0, last));
- }
- while (last < value.length())
- {
- pw.print(" ");
- int end = (last + 69);
- if (end > value.length())
- {
- pw.println(value.substring(last));
- }
- else
- {
- pw.println(value.substring(last, end));
- }
- last = end;
- }
- }
-
- private static void write_main_attributes(Attributes attr, PrintWriter pw)
- throws JarException
- {
- Iterator it = attr.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry) it.next();
- // Don't print the manifest version again
- if (!Attributes.Name.MANIFEST_VERSION.equals(entry.getKey()))
- {
- write_attribute_entry(entry, pw);
- }
- }
- }
-
- private static void write_attribute_entry(Map.Entry entry, PrintWriter pw)
- throws JarException
- {
- String name = entry.getKey().toString();
- String value = entry.getValue().toString();
-
- if (name.equalsIgnoreCase("Name"))
- {
- throw new JarException("Attributes cannot be called 'Name'");
- }
- if (name.startsWith("From"))
- {
- throw new
- JarException("Header cannot start with the four letters 'From'" +
- name);
- }
- write_header(name, value, pw);
- }
-
- private static void write_individual_sections(Map entries, PrintWriter pw)
- throws JarException
- {
-
- Iterator it = entries.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry) it.next();
- write_header("Name", entry.getKey().toString(), pw);
- write_entry_attributes((Attributes) entry.getValue(), pw);
- pw.println();
- }
- }
-
- private static void write_entry_attributes(Attributes attr, PrintWriter pw)
- throws JarException
- {
- Iterator it = attr.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry) it.next();
- write_attribute_entry(entry, pw);
- }
- }
-
- /**
- * Makes a deep copy of the main attributes, but a shallow copy of
- * the other entries. This means that you can freely add, change or remove
- * the main attributes or the entries of the new manifest without effecting
- * the original manifest, but adding, changing or removing attributes from
- * a particular entry also changes the attributes of that entry in the
- * original manifest. Calls <CODE>new Manifest(this)</CODE>.
- */
- public Object clone()
- {
- return new Manifest(this);
- }
-
- /**
- * Checks if another object is equal to this Manifest object.
- * Another Object is equal to this Manifest object if it is an instance of
- * Manifest and the main attributes and the entries of the other manifest
- * are equal to this one.
- */
- public boolean equals(Object o)
- {
- return (o instanceof Manifest) &&
- (mainAttr.equals(((Manifest) o).mainAttr)) &&
- (entries.equals(((Manifest) o).entries));
- }
-
- /**
- * Calculates the hash code of the manifest. Implemented by a xor of the
- * hash code of the main attributes with the hash code of the entries map.
- */
- public int hashCode()
- {
- return mainAttr.hashCode() ^ entries.hashCode();
- }
-
-}
diff --git a/libjava/java/util/logging/ConsoleHandler.java b/libjava/java/util/logging/ConsoleHandler.java
deleted file mode 100644
index 3cf4bca3354..00000000000
--- a/libjava/java/util/logging/ConsoleHandler.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/* ConsoleHandler.java -- a class for publishing log messages to System.err
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-/**
- * A <code>ConsoleHandler</code> publishes log records to
- * <code>System.err</code>.
- *
- * <p><strong>Configuration:</strong> Values of the subsequent
- * <code>LogManager</code> properties are taken into consideration
- * when a <code>ConsoleHandler</code> is initialized.
- * If a property is not defined, or if it has an invalid
- * value, a default is taken without an exception being thrown.
- *
- * <ul>
- *
- * <li><code>java.util.logging.ConsoleHandler.level</code> - specifies
- * the initial severity level threshold. Default value:
- * <code>Level.INFO</code>.</li>
- *
- * <li><code>java.util.logging.ConsoleHandler.filter</code> - specifies
- * the name of a Filter class. Default value: No Filter.</li>
- *
- * <li><code>java.util.logging.ConsoleHandler.formatter</code> - specifies
- * the name of a Formatter class. Default value:
- * <code>java.util.logging.SimpleFormatter</code>.</li>
- *
- * <li><code>java.util.logging.ConsoleHandler.encoding</code> - specifies
- * the name of the character encoding. Default value:
- * the default platform encoding.</li>
- *
- * </ul>
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public class ConsoleHandler
- extends StreamHandler
-{
- /**
- * Constructs a <code>StreamHandler</code> that publishes
- * log records to <code>System.err</code>. The initial
- * configuration is determined by the <code>LogManager</code>
- * properties described above.
- */
- public ConsoleHandler()
- {
- super(System.err, "java.util.logging.ConsoleHandler", Level.INFO,
- /* formatter */ null, SimpleFormatter.class);
- }
-
-
- /**
- * Forces any data that may have been buffered to the underlying
- * output device, but does <i>not</i> close <code>System.err</code>.
- *
- * <p>In case of an I/O failure, the <code>ErrorManager</code>
- * of this <code>ConsoleHandler</code> will be informed, but the caller
- * of this method will not receive an exception.
- */
- public void close()
- {
- flush();
- }
-
-
- /**
- * Publishes a <code>LogRecord</code> to the console, provided the
- * record passes all tests for being loggable.
- *
- * <p>Most applications do not need to call this method directly.
- * Instead, they will use use a <code>Logger</code>, which will
- * create LogRecords and distribute them to registered handlers.
- *
- * <p>In case of an I/O failure, the <code>ErrorManager</code>
- * of this <code>SocketHandler</code> will be informed, but the caller
- * of this method will not receive an exception.
- *
- * <p>The GNU implementation of <code>ConsoleHandler.publish</code>
- * calls flush() for every request to publish a record, so
- * they appear immediately on the console.
- *
- * @param record the log event to be published.
- */
- public void publish(LogRecord record)
- {
- super.publish(record);
- flush();
- }
-}
diff --git a/libjava/java/util/logging/ErrorManager.java b/libjava/java/util/logging/ErrorManager.java
deleted file mode 100644
index 57c079fe25b..00000000000
--- a/libjava/java/util/logging/ErrorManager.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/* ErrorManager.java --
- A class for dealing with errors that a Handler encounters
- during logging
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-/**
- * An <code>ErrorManager</code> deals with errors that a <code>Handler</code>
- * encounters while logging.
- *
- * @see Handler#setErrorManager(ErrorManager)
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public class ErrorManager
-{
- /* The values have been taken from Sun's public J2SE 1.4 API
- * documentation.
- * See http://java.sun.com/j2se/1.4/docs/api/constant-values.html
- */
-
- /**
- * Indicates that there was a failure that does not readily
- * fall into any of the other categories.
- */
- public static final int GENERIC_FAILURE = 0;
-
-
- /**
- * Indicates that there was a problem upon writing to
- * an output stream.
- */
- public static final int WRITE_FAILURE = 1;
-
-
- /**
- * Indicates that there was a problem upon flushing
- * an output stream.
- */
- public static final int FLUSH_FAILURE = 2;
-
-
- /**
- * Indicates that there was a problem upon closing
- * an output stream.
- */
- public static final int CLOSE_FAILURE = 3;
-
-
- /**
- * Indicates that there was a problem upon opening
- * an output stream.
- */
- public static final int OPEN_FAILURE = 4;
-
-
- /**
- * Indicates that there was a problem upon formatting
- * the message of a log record.
- */
- public static final int FORMAT_FAILURE = 5;
-
-
- /**
- * Indicates whether the {@link #error} method of this ErrorManager
- * has ever been used.
- *
- * Declared volatile in order to correctly support the
- * double-checked locking idiom (once the revised Java Memory Model
- * gets adopted); see Classpath bug #2944.
- */
- private volatile boolean everUsed = false;
-
-
- public ErrorManager()
- {
- }
-
-
- /**
- * Reports an error that occured upon logging. The default implementation
- * emits the very first error to System.err, ignoring subsequent errors.
- *
- * @param message a message describing the error, or <code>null</code> if
- * there is no suitable description.
- *
- * @param ex an exception, or <code>null</code> if the error is not
- * related to an exception.
- *
- * @param errorCode one of the defined error codes, for example
- * <code>ErrorManager.CLOSE_FAILURE</code>.
- */
- public void error(String message, Exception ex, int errorCode)
- {
- if (everUsed)
- return;
-
- synchronized (this)
- {
- /* The double check is intentional. If the first check was
- * omitted, the monitor would have to be entered every time
- * error() method was called. If the second check was
- * omitted, the code below could be executed by multiple
- * threads simultaneously.
- *
- * This is the 'double-checked locking' idiom, which is broken
- * with the current version of the Java memory model. However,
- * we assume that JVMs will have adopted a revised version of
- * the Java Memory Model by the time GNU Classpath gains
- * widespread acceptance. See Classpath bug #2944.
- */
- if (everUsed)
- return;
-
- everUsed = true;
- }
-
- String codeMsg;
- switch (errorCode)
- {
- case GENERIC_FAILURE:
- codeMsg = "GENERIC_FAILURE";
- break;
-
- case WRITE_FAILURE:
- codeMsg = "WRITE_FAILURE";
- break;
-
- case FLUSH_FAILURE:
- codeMsg = "FLUSH_FAILURE";
- break;
-
- case CLOSE_FAILURE:
- codeMsg = "CLOSE_FAILURE";
- break;
-
- case OPEN_FAILURE:
- codeMsg = "OPEN_FAILURE";
- break;
-
- case FORMAT_FAILURE:
- codeMsg = "FORMAT_FAILURE";
- break;
-
- default:
- codeMsg = String.valueOf(errorCode);
- break;
- }
-
- System.err.println("Error upon logging: " + codeMsg);
- if ((message != null) && (message.length() > 0))
- System.err.println(message);
-
- if (ex != null)
- ex.printStackTrace();
- }
-}
-
diff --git a/libjava/java/util/logging/FileHandler.java b/libjava/java/util/logging/FileHandler.java
deleted file mode 100644
index a948ba389f4..00000000000
--- a/libjava/java/util/logging/FileHandler.java
+++ /dev/null
@@ -1,506 +0,0 @@
-/* FileHandler.java -- a class for publishing log messages to log files
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-/**
- * A <code>FileHandler</code> publishes log records to a set of log
- * files. A maximum file size can be specified; as soon as a log file
- * reaches the size limit, it is closed and the next file in the set
- * is taken.
- *
- * <p><strong>Configuration:</strong> Values of the subsequent
- * <code>LogManager</code> properties are taken into consideration
- * when a <code>FileHandler</code> is initialized. If a property is
- * not defined, or if it has an invalid value, a default is taken
- * without an exception being thrown.
- *
- * <ul>
- *
- * <li><code>java.util.FileHandler.level</code> - specifies
- * the initial severity level threshold. Default value:
- * <code>Level.ALL</code>.</li>
- *
- * <li><code>java.util.FileHandler.filter</code> - specifies
- * the name of a Filter class. Default value: No Filter.</li>
- *
- * <li><code>java.util.FileHandler.formatter</code> - specifies
- * the name of a Formatter class. Default value:
- * <code>java.util.logging.XMLFormatter</code>.</li>
- *
- * <li><code>java.util.FileHandler.encoding</code> - specifies
- * the name of the character encoding. Default value:
- * the default platform encoding.</li>
- *
- * <li><code>java.util.FileHandler.limit</code> - specifies the number
- * of bytes a log file is approximately allowed to reach before it
- * is closed and the handler switches to the next file in the
- * rotating set. A value of zero means that files can grow
- * without limit. Default value: 0 (unlimited growth).</li>
- *
- * <li><code>java.util.FileHandler.count</code> - specifies the number
- * of log files through which this handler cycles. Default value:
- * 1.</li>
- *
- * <li><code>java.util.FileHandler.pattern</code> - specifies a
- * pattern for the location and name of the produced log files.
- * See the section on <a href="#filePatterns">file name
- * patterns</a> for details. Default value:
- * <code>"%h/java%u.log"</code>.</li>
- *
- * <li><code>java.util.FileHandler.append</code> - specifies
- * whether the handler will append log records to existing
- * files, or whether the handler will clear log files
- * upon switching to them. Default value: <code>false</code>,
- * indicating that files will be cleared.</li>
- *
- * </ul>
- *
- * <p><a name="filePatterns"><strong>File Name Patterns:</strong></a>
- * The name and location and log files are specified with pattern
- * strings. The handler will replace the following character sequences
- * when opening log files:
- *
- * <p><ul>
- * <li><code>/</code> - replaced by the platform-specific path name
- * separator. This value is taken from the system property
- * <code>file.separator</code>.</li>
- *
- * <li><code>%t</code> - replaced by the platform-specific location of
- * the directory intended for temporary files. This value is
- * taken from the system property <code>java.io.tmpdir</code>.</li>
- *
- * <li><code>%h</code> - replaced by the location of the home
- * directory of the current user. This value is taken from the
- * system property <code>file.separator</code>.</li>
- *
- * <li><code>%g</code> - replaced by a generation number for
- * distinguisthing the individual items in the rotating set
- * of log files. The generation number cycles through the
- * sequence 0, 1, ..., <code>count</code> - 1.</li>
- *
- * <li><code>%u</code> - replaced by a unique number for
- * distinguisthing the output files of several concurrently
- * running processes. The <code>FileHandler</code> starts
- * with 0 when it tries to open a log file. If the file
- * cannot be opened because it is currently in use,
- * the unique number is incremented by one and opening
- * is tried again. These steps are repeated until the
- * opening operation succeeds.
- *
- * <p>FIXME: Is the following correct? Please review. The unique
- * number is determined for each log file individually when it is
- * opened upon switching to the next file. Therefore, it is not
- * correct to assume that all log files in a rotating set bear the
- * same unique number.
- *
- * <p>FIXME: The Javadoc for the Sun reference implementation
- * says: "Note that the use of unique ids to avoid conflicts is
- * only guaranteed to work reliably when using a local disk file
- * system." Why? This needs to be mentioned as well, in case
- * the reviewers decide the statement is true. Otherwise,
- * file a bug report with Sun.</li>
- *
- * <li><code>%%</code> - replaced by a single percent sign.</li>
- * </ul>
- *
- * <p>If the pattern string does not contain <code>%g</code> and
- * <code>count</code> is greater than one, the handler will append
- * the string <code>.%g</code> to the specified pattern.
- *
- * <p>If the handler attempts to open a log file, this log file
- * is being used at the time of the attempt, and the pattern string
- * does not contain <code>%u</code>, the handler will append
- * the string <code>.%u</code> to the specified pattern. This
- * step is performed after any generation number has been
- * appended.
- *
- * <p><em>Examples for the GNU platform:</em>
- *
- * <p><ul>
- *
- * <li><code>%h/java%u.log</code> will lead to a single log file
- * <code>/home/janet/java0.log</code>, assuming <code>count</code>
- * equals 1, the user's home directory is
- * <code>/home/janet</code>, and the attempt to open the file
- * succeeds.</li>
- *
- * <li><code>%h/java%u.log</code> will lead to three log files
- * <code>/home/janet/java0.log.0</code>,
- * <code>/home/janet/java0.log.1</code>, and
- * <code>/home/janet/java0.log.2</code>,
- * assuming <code>count</code> equals 3, the user's home
- * directory is <code>/home/janet</code>, and all attempts
- * to open files succeed.</li>
- *
- * <li><code>%h/java%u.log</code> will lead to three log files
- * <code>/home/janet/java0.log.0</code>,
- * <code>/home/janet/java1.log.1</code>, and
- * <code>/home/janet/java0.log.2</code>,
- * assuming <code>count</code> equals 3, the user's home
- * directory is <code>/home/janet</code>, and the attempt
- * to open <code>/home/janet/java0.log.1</code> fails.</li>
- *
- * </ul>
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public class FileHandler
- extends StreamHandler
-{
- /**
- * The number of bytes a log file is approximately allowed to reach
- * before it is closed and the handler switches to the next file in
- * the rotating set. A value of zero means that files can grow
- * without limit.
- */
- private final int limit;
-
-
- /**
- * The number of log files through which this handler cycles.
- */
- private final int count;
-
-
- /**
- * The pattern for the location and name of the produced log files.
- * See the section on <a href="#filePatterns">file name patterns</a>
- * for details.
- */
- private final String pattern;
-
-
- /**
- * Indicates whether the handler will append log records to existing
- * files (<code>true</code>), or whether the handler will clear log files
- * upon switching to them (<code>false</code>).
- */
- private final boolean append;
-
-
- /**
- * Constructs a <code>FileHandler</code>, taking all property values
- * from the current {@link LogManager LogManager} configuration.
- *
- * @throws java.io.IOException FIXME: The Sun Javadoc says: "if
- * there are IO problems opening the files." This conflicts
- * with the general principle that configuration errors do
- * not prohibit construction. Needs review.
- *
- * @throws SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- */
- public FileHandler()
- throws IOException, SecurityException
- {
- this(/* pattern: use configiguration */ null,
-
- LogManager.getIntProperty("java.util.logging.FileHandler.limit",
- /* default */ 0),
-
- LogManager.getIntProperty("java.util.logging.FileHandler.count",
- /* default */ 1),
-
- LogManager.getBooleanProperty("java.util.logging.FileHandler.append",
- /* default */ false));
- }
-
-
- /* FIXME: Javadoc missing. */
- public FileHandler(String pattern)
- throws IOException, SecurityException
- {
- this(pattern,
- /* limit */ 0,
- /* count */ 1,
- /* append */ false);
- }
-
-
- /* FIXME: Javadoc missing. */
- public FileHandler(String pattern, boolean append)
- throws IOException, SecurityException
- {
- this(pattern,
- /* limit */ 0,
- /* count */ 1,
- append);
- }
-
-
- /* FIXME: Javadoc missing. */
- public FileHandler(String pattern, int limit, int count)
- throws IOException, SecurityException
- {
- this(pattern, limit, count,
- LogManager.getBooleanProperty(
- "java.util.logging.FileHandler.append",
- /* default */ false));
- }
-
-
- /**
- * Constructs a <code>FileHandler</code> given the pattern for the
- * location and name of the produced log files, the size limit, the
- * number of log files thorough which the handler will rotate, and
- * the <code>append</code> property. All other property values are
- * taken from the current {@link LogManager LogManager}
- * configuration.
- *
- * @param pattern The pattern for the location and name of the
- * produced log files. See the section on <a
- * href="#filePatterns">file name patterns</a> for details.
- * If <code>pattern</code> is <code>null</code>, the value is
- * taken from the {@link LogManager LogManager} configuration
- * property
- * <code>java.util.logging.FileHandler.pattern</code>.
- * However, this is a pecularity of the GNU implementation,
- * and Sun's API specification does not mention what behavior
- * is to be expected for <code>null</code>. Therefore,
- * applications should not rely on this feature.
- *
- * @param limit specifies the number of bytes a log file is
- * approximately allowed to reach before it is closed and the
- * handler switches to the next file in the rotating set. A
- * value of zero means that files can grow without limit.
- *
- * @param count specifies the number of log files through which this
- * handler cycles.
- *
- * @param append specifies whether the handler will append log
- * records to existing files (<code>true</code>), or whether the
- * handler will clear log files upon switching to them
- * (<code>false</code>).
- *
- * @throws java.io.IOException FIXME: The Sun Javadoc says: "if
- * there are IO problems opening the files." This conflicts
- * with the general principle that configuration errors do
- * not prohibit construction. Needs review.
- *
- * @throws SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- * <p>FIXME: This seems in contrast to all other handler
- * constructors -- verify this by running tests against
- * the Sun reference implementation.
- */
- public FileHandler(String pattern,
- int limit,
- int count,
- boolean append)
- throws IOException, SecurityException
- {
- super(createFileStream(pattern, limit, count, append,
- /* generation */ 0),
- "java.util.logging.FileHandler",
- /* default level */ Level.ALL,
- /* formatter */ null,
- /* default formatter */ XMLFormatter.class);
-
- if ((limit <0) || (count < 1))
- throw new IllegalArgumentException();
-
- this.pattern = pattern;
- this.limit = limit;
- this.count = count;
- this.append = append;
- }
-
-
- /* FIXME: Javadoc missing. */
- private static java.io.OutputStream createFileStream(String pattern,
- int limit,
- int count,
- boolean append,
- int generation)
- {
- String path;
- int unique = 0;
-
- /* Throws a SecurityException if the caller does not have
- * LoggingPermission("control").
- */
- LogManager.getLogManager().checkAccess();
-
- /* Default value from the java.util.logging.FileHandler.pattern
- * LogManager configuration property.
- */
- if (pattern == null)
- pattern = LogManager.getLogManager().getProperty(
- "java.util.logging.FileHandler.pattern");
- if (pattern == null)
- pattern = "%h/java%u.log";
-
- do
- {
- path = replaceFileNameEscapes(pattern, generation, unique, count);
-
- try
- {
- File file = new File(path);
- if (file.createNewFile())
- return new FileOutputStream(path, append);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
-
- unique = unique + 1;
- if (pattern.indexOf("%u") < 0)
- pattern = pattern + ".%u";
- }
- while (true);
- }
-
-
- /**
- * Replaces the substrings <code>"/"</code> by the value of the
- * system property <code>"file.separator"</code>, <code>"%t"</code>
- * by the value of the system property
- * <code>"java.io.tmpdir"</code>, <code>"%h"</code> by the value of
- * the system property <code>"user.home"</code>, <code>"%g"</code>
- * by the value of <code>generation</code>, <code>"%u"</code> by the
- * value of <code>uniqueNumber</code>, and <code>"%%"</code> by a
- * single percent character. If <code>pattern</code> does
- * <em>not</em> contain the sequence <code>"%g"</code>,
- * the value of <code>generation</code> will be appended to
- * the result.
- *
- * @throws NullPointerException if one of the system properties
- * <code>"file.separator"</code>,
- * <code>"java.io.tmpdir"</code>, or
- * <code>"user.home"</code> has no value and the
- * corresponding escape sequence appears in
- * <code>pattern</code>.
- */
- private static String replaceFileNameEscapes(String pattern,
- int generation,
- int uniqueNumber,
- int count)
- {
- StringBuffer buf = new StringBuffer(pattern);
- String replaceWith;
- boolean foundGeneration = false;
-
- int pos = 0;
- do
- {
- // Uncomment the next line for finding bugs.
- // System.out.println(buf.substring(0,pos) + '|' + buf.substring(pos));
-
- if (buf.charAt(pos) == '/')
- {
- /* The same value is also provided by java.io.File.separator. */
- replaceWith = System.getProperty("file.separator");
- buf.replace(pos, pos + 1, replaceWith);
- pos = pos + replaceWith.length() - 1;
- continue;
- }
-
- if (buf.charAt(pos) == '%')
- {
- switch (buf.charAt(pos + 1))
- {
- case 't':
- replaceWith = System.getProperty("java.io.tmpdir");
- break;
-
- case 'h':
- replaceWith = System.getProperty("user.home");
- break;
-
- case 'g':
- replaceWith = Integer.toString(generation);
- foundGeneration = true;
- break;
-
- case 'u':
- replaceWith = Integer.toString(uniqueNumber);
- break;
-
- case '%':
- replaceWith = "%";
- break;
-
- default:
- replaceWith = "??";
- break; // FIXME: Throw exception?
- }
-
- buf.replace(pos, pos + 2, replaceWith);
- pos = pos + replaceWith.length() - 1;
- continue;
- }
- }
- while (++pos < buf.length() - 1);
-
- if (!foundGeneration && (count > 1))
- {
- buf.append('.');
- buf.append(generation);
- }
-
- return buf.toString();
- }
-
-
- /* FIXME: Javadoc missing, implementation incomplete. */
- public void publish(LogRecord record)
- {
- super.publish(record);
-
- /* FIXME: Decide when to switch over. How do we get to
- * the number of bytes published so far? Two possibilities:
- * 1. File.length, 2. have metering wrapper around
- * output stream counting the number of written bytes.
- */
-
- /* FIXME: Switch over if needed! This implementation always
- * writes into a single file, i.e. behaves as if limit
- * always was zero. So, the implementation is somewhat
- * functional but incomplete.
- */
- }
-}
diff --git a/libjava/java/util/logging/Filter.java b/libjava/java/util/logging/Filter.java
deleted file mode 100644
index ec4597670d5..00000000000
--- a/libjava/java/util/logging/Filter.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Filter.java -- an interface for filters that decide whether a
- LogRecord should be published or discarded
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-/**
- * By implementing the <code>Filter</code> interface, applications
- * can control what is being logged based on arbitrary properties,
- * not just the severity level. Both <code>Handler</code> and
- * <code>Logger</code> allow to register Filters whose
- * <code>isLoggable</code> method will be called when a
- * <code>LogRecord</code> has passed the test based on the
- * severity level.
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public interface Filter
-{
- /**
- * Determines whether a LogRecord should be published or discarded.
- *
- * @param record the <code>LogRecord</code> to be inspected.
- *
- * @return <code>true</code> if the record should be published,
- * <code>false</code> if it should be discarded.
- */
- boolean isLoggable(LogRecord record);
-}
diff --git a/libjava/java/util/logging/Formatter.java b/libjava/java/util/logging/Formatter.java
deleted file mode 100644
index ee747b0b978..00000000000
--- a/libjava/java/util/logging/Formatter.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* Formatter.java --
- A class for formatting log messages by localizing message texts
- and performing substitution of parameters
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
-
-/**
- * A <code>Formatter</code> supports handlers by localizing
- * message texts and by subsituting parameter values for their
- * placeholders.
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public abstract class Formatter
-{
- /**
- * Constructs a new Formatter.
- */
- protected Formatter()
- {
- }
-
-
- /**
- * Formats a LogRecord into a string. Usually called by handlers
- * which need a string for a log record, for example to append
- * a record to a log file or to transmit a record over the network.
- *
- * @param record the log record for which a string form is requested.
- */
- public abstract String format(LogRecord record);
-
-
- /**
- * Returns a string that handlers are supposed to emit before
- * the first log record. The base implementation returns an
- * empty string, but subclasses such as {@link XMLFormatter}
- * override this method in order to provide a suitable header.
- *
- * @return a string for the header.
- *
- * @param handler the handler which will prepend the returned
- * string in front of the first log record. This method
- * may inspect certain properties of the handler, for
- * example its encoding, in order to construct the header.
- */
- public String getHead(Handler handler)
- {
- return "";
- }
-
-
- /**
- * Returns a string that handlers are supposed to emit after
- * the last log record. The base implementation returns an
- * empty string, but subclasses such as {@link XMLFormatter}
- * override this method in order to provide a suitable tail.
- *
- * @return a string for the header.
- *
- * @param handler the handler which will append the returned
- * string after the last log record. This method
- * may inspect certain properties of the handler
- * in order to construct the tail.
- */
- public String getTail(Handler handler)
- {
- return "";
- }
-
-
- /**
- * Formats the message part of a log record.
- *
- * <p>First, the Formatter localizes the record message to the
- * default locale by looking up the message in the record's
- * localization resource bundle. If this step fails because there
- * is no resource bundle associated with the record, or because the
- * record message is not a key in the bundle, the raw message is
- * used instead.
- *
- * <p>Second, the Formatter substitutes appropriate strings for
- * the message parameters. If the record returns a non-empty
- * array for <code>getParameters()</code> and the localized
- * message string contains the character sequence "{0", the
- * formatter uses <code>java.text.MessageFormat</code> to format
- * the message. Otherwise, no parameter substitution is performed.
- *
- * @param record the log record to be localized and formatted.
- *
- * @return the localized message text where parameters have been
- * substituted by suitable strings.
- *
- * @throws NullPointerException if <code>record</code>
- * is <code>null</code>.
- */
- public String formatMessage(LogRecord record)
- {
- String msg;
- ResourceBundle bundle;
- Object[] params;
-
- /* This will throw a NullPointerExceptionif record is null. */
- msg = record.getMessage();
- if (msg == null)
- msg = "";
-
- /* Try to localize the message. */
- bundle = record.getResourceBundle();
- if (bundle != null)
- {
- try
- {
- msg = bundle.getString(msg);
- }
- catch (java.util.MissingResourceException _)
- {
- }
- }
-
- /* Format the message if there are parameters. */
- params = record.getParameters();
- if ((params != null)
- && (params.length > 0)
- && (msg.indexOf("{0") >= 0))
- {
- msg = MessageFormat.format(msg, params);
- }
-
- return msg;
- }
-}
diff --git a/libjava/java/util/logging/Handler.java b/libjava/java/util/logging/Handler.java
deleted file mode 100644
index c3227d6f531..00000000000
--- a/libjava/java/util/logging/Handler.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/* Handler.java -- a class for publishing log messages
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-import java.io.UnsupportedEncodingException;
-
-/**
- * A <code>Handler</code> publishes <code>LogRecords</code> to
- * a sink, for example a file, the console or a network socket.
- * There are different subclasses of <code>Handler</code>
- * to deal with different kinds of sinks.
- *
- * <p>FIXME: Are handlers thread-safe, or is the assumption that only
- * loggers are, and a handler can belong only to one single logger? If
- * the latter, should we enforce it? (Spec not clear). In any
- * case, it needs documentation.
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public abstract class Handler
-{
- Formatter formatter;
- Filter filter;
- Level level;
- ErrorManager errorManager;
- String encoding;
-
- /**
- * Constructs a Handler with a logging severity level of
- * <code>Level.ALL</code>, no formatter, no filter, and
- * an instance of <code>ErrorManager</code> managing errors.
- *
- * <p><strong>Specification Note:</strong> The specification of the
- * Java<sup>TM</sup> Logging API does not mention which character
- * encoding is to be used by freshly constructed Handlers. The GNU
- * implementation uses the default platform encoding, but other
- * Java implementations might behave differently.
- *
- * <p><strong>Specification Note:</strong> While a freshly constructed
- * Handler is required to have <em>no filter</em> according to the
- * specification, <code>null</code> is not a valid parameter for
- * <code>Handler.setFormatter</code>. Therefore, the following
- * code will throw a <code>java.lang.NullPointerException</code>:
- *
- * <p><pre>Handler h = new MyConcreteSubclassOfHandler();
-h.setFormatter(h.getFormatter());</pre>
- *
- * It seems strange that a freshly constructed Handler is not
- * supposed to provide a Formatter, but this is what the specification
- * says.
- */
- protected Handler()
- {
- level = Level.ALL;
- }
-
-
- /**
- * Publishes a <code>LogRecord</code> to an appropriate sink,
- * provided the record passes all tests for being loggable. The
- * <code>Handler</code> will localize the message of the log
- * record and substitute any message parameters.
- *
- * <p>Most applications do not need to call this method directly.
- * Instead, they will use use a {@link Logger}, which will
- * create LogRecords and distribute them to registered handlers.
- *
- * <p>In case of an I/O failure, the <code>ErrorManager</code>
- * of this <code>Handler</code> will be informed, but the caller
- * of this method will not receive an exception.
- *
- * @param record the log event to be published.
- */
- public abstract void publish(LogRecord record);
-
-
- /**
- * Forces any data that may have been buffered to the underlying
- * output device.
- *
- * <p>In case of an I/O failure, the <code>ErrorManager</code>
- * of this <code>Handler</code> will be informed, but the caller
- * of this method will not receive an exception.
- */
- public abstract void flush();
-
-
- /**
- * Closes this <code>Handler</code> after having flushed
- * the buffers. As soon as <code>close</code> has been called,
- * a <code>Handler</code> should not be used anymore. Attempts
- * to publish log records, to flush buffers, or to modify the
- * <code>Handler</code> in any other way may throw runtime
- * exceptions after calling <code>close</code>.
- *
- * <p>In case of an I/O failure, the <code>ErrorManager</code>
- * of this <code>Handler</code> will be informed, but the caller
- * of this method will not receive an exception.
- *
- * @throws SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- */
- public abstract void close()
- throws SecurityException;
-
-
- /**
- * Returns the <code>Formatter</code> which will be used to
- * localize the text of log messages and to substitute
- * message parameters. A <code>Handler</code> is encouraged,
- * but not required to actually use an assigned
- * <code>Formatter</code>.
- *
- * @return the <code>Formatter</code> being used, or
- * <code>null</code> if this <code>Handler</code>
- * does not use formatters and no formatter has
- * ever been set by calling <code>setFormatter</code>.
- */
- public Formatter getFormatter()
- {
- return formatter;
- }
-
-
- /**
- * Sets the <code>Formatter</code> which will be used to
- * localize the text of log messages and to substitute
- * message parameters. A <code>Handler</code> is encouraged,
- * but not required to actually use an assigned
- * <code>Formatter</code>.
- *
- * @param formatter the new <code>Formatter</code> to use.
- *
- * @throws SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- *
- * @throws NullPointerException if <code>formatter</code> is
- * <code>null</code>.
- */
- public void setFormatter(Formatter formatter)
- throws SecurityException
- {
- LogManager.getLogManager().checkAccess();
-
- /* Throws a NullPointerException if formatter is null. */
- formatter.getClass();
-
- this.formatter = formatter;
- }
-
-
- /**
- * Returns the character encoding which this handler uses for publishing
- * log records.
- *
- * @param encoding the name of a character encoding, or <code>null</code>
- * for the default platform encoding.
- */
- public String getEncoding()
- {
- return encoding;
- }
-
-
- /**
- * Sets the character encoding which this handler uses for publishing
- * log records. The encoding of a <code>Handler</code> must be
- * set before any log records have been published.
- *
- * @param encoding the name of a character encoding, or <code>null</code>
- * for the default encoding.
- *
- * @exception SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- *
- */
- public void setEncoding(String encoding)
- throws SecurityException, UnsupportedEncodingException
- {
- /* Should any developer ever change this implementation, they are
- * advised to have a look at StreamHandler.setEncoding(String),
- * which overrides this method without calling super.setEncoding.
- */
- LogManager.getLogManager().checkAccess();
-
- /* Simple check for supported encodings. This is more expensive
- * than it could be, but this method is overwritten by StreamHandler
- * anyway.
- */
- if (encoding != null)
- new String(new byte[0], encoding);
-
- this.encoding = encoding;
- }
-
-
- /**
- * Returns the <code>Filter</code> that currently controls which
- * log records are being published by this <code>Handler</code>.
- *
- * @return the currently active <code>Filter</code>, or
- * <code>null</code> if no filter has been associated.
- * In the latter case, log records are filtered purely
- * based on their severity level.
- */
- public Filter getFilter()
- {
- return filter;
- }
-
-
- /**
- * Sets the <code>Filter</code> for controlling which
- * log records will be published by this <code>Handler</code>.
- *
- * @return the <code>Filter</code> to use, or
- * <code>null</code> to filter log records purely based
- * on their severity level.
- */
- public void setFilter(Filter filter)
- throws SecurityException
- {
- LogManager.getLogManager().checkAccess();
- this.filter = filter;
- }
-
-
- /**
- * Returns the <code>ErrorManager</code> that currently deals
- * with errors originating from this Handler.
- *
- * @exception SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- */
- public ErrorManager getErrorManager()
- {
- LogManager.getLogManager().checkAccess();
-
- /* Developers wanting to change the subsequent code should
- * have a look at Handler.reportError -- it also can create
- * an ErrorManager, but does so without checking permissions
- * to control the logging infrastructure.
- */
- if (errorManager == null)
- errorManager = new ErrorManager();
-
- return errorManager;
- }
-
-
- public void setErrorManager(ErrorManager manager)
- {
- LogManager.getLogManager().checkAccess();
-
- /* Make sure manager is not null. */
- manager.getClass();
-
- this.errorManager = manager;
- }
-
-
- protected void reportError(String message, Exception ex, int code)
- {
- if (errorManager == null)
- errorManager = new ErrorManager();
-
- errorManager.error(message, ex, code);
- }
-
-
- /**
- * Returns the severity level threshold for this <code>Handler</code>
- * All log records with a lower severity level will be discarded;
- * a log record of the same or a higher level will be published
- * unless an installed <code>Filter</code> decides to discard it.
- *
- * @return the severity level below which all log messages
- * will be discarded.
- */
- public Level getLevel()
- {
- return level;
- }
-
-
- /**
- * Sets the severity level threshold for this <code>Handler</code>.
- * All log records with a lower severity level will be discarded;
- * a log record of the same or a higher level will be published
- * unless an installed <code>Filter</code> decides to discard it.
- *
- * @param level the severity level below which all log messages
- * will be discarded.
- *
- * @exception SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- *
- * @exception NullPointerException if <code>level</code> is
- * <code>null</code>.
- */
- public void setLevel(Level level)
- {
- LogManager.getLogManager().checkAccess();
-
- /* Throw NullPointerException if level is null. */
- level.getClass();
- this.level = level;
- }
-
-
- /**
- * Checks whether a <code>LogRecord</code> would be logged
- * if it was passed to this <code>Handler</code> for publication.
- *
- * <p>The <code>Handler</code> implementation considers a record as
- * loggable if its level is greater than or equal to the severity
- * level threshold. In a second step, if a {@link Filter} has
- * been installed, its {@link Filter#isLoggable(LogRecord) isLoggable}
- * method is invoked. Subclasses of <code>Handler</code> can override
- * this method to impose their own constraints.
- *
- * @param record the <code>LogRecord</code> to be checked.
- *
- * @return <code>true</code> if <code>record</code> would
- * be published by {@link #publish(LogRecord) publish},
- * <code>false</code> if it would be discarded.
- *
- * @see #setLevel(Level)
- * @see #setFilter(Filter)
- * @see Filter#isLoggable(LogRecord)
- *
- * @throws NullPointerException if <code>record</code>
- * is <code>null</code>.
- */
- public boolean isLoggable(LogRecord record)
- {
- if (record.getLevel().intValue() < level.intValue())
- return false;
-
- if (filter != null)
- return filter.isLoggable(record);
- else
- return true;
- }
-}
diff --git a/libjava/java/util/logging/Level.java b/libjava/java/util/logging/Level.java
deleted file mode 100644
index 2c400dc3a90..00000000000
--- a/libjava/java/util/logging/Level.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/* Level.java -- a class for indicating logging levels
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-import java.io.Serializable;
-import java.util.ResourceBundle;
-
-/**
- * A class for indicating logging levels. A number of commonly used
- * levels is pre-defined (such as <code>java.util.logging.Level.INFO</code>),
- * and applications should utilize those whenever possible. For specialized
- * purposes, however, applications can sub-class Level in order to define
- * custom logging levels.
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public class Level implements Serializable
-{
- /* The integer values are the same as in the Sun J2SE 1.4.
- * They have been obtained with a test program. In J2SE 1.4.1,
- * Sun has amended the API documentation; these values are now
- * publicly documented.
- */
-
- /**
- * The <code>OFF</code> level is used as a threshold for filtering
- * log records, meaning that no message should be logged.
- *
- * @see Logger#setLevel(java.util.logging.Level)
- */
- public static final Level OFF = new Level ("OFF", Integer.MAX_VALUE);
-
- /**
- * Log records whose level is <code>SEVERE</code> indicate a serious
- * failure that prevents normal program execution. Messages at this
- * level should be understandable to an inexperienced, non-technical
- * end user. Ideally, they explain in simple words what actions the
- * user can take in order to resolve the problem.
- */
- public static final Level SEVERE = new Level ("SEVERE", 1000);
-
-
- /**
- * Log records whose level is <code>WARNING</code> indicate a
- * potential problem that does not prevent normal program execution.
- * Messages at this level should be understandable to an
- * inexperienced, non-technical end user. Ideally, they explain in
- * simple words what actions the user can take in order to resolve
- * the problem.
- */
- public static final Level WARNING = new Level ("WARNING", 900);
-
-
- /**
- * Log records whose level is <code>INFO</code> are used in purely
- * informational situations that do not constitute serious errors or
- * potential problems. In the default logging configuration, INFO
- * messages will be written to the system console. For this reason,
- * the INFO level should be used only for messages that are
- * important to end users and system administrators. Messages at
- * this level should be understandable to an inexperienced,
- * non-technical user.
- */
- public static final Level INFO = new Level ("INFO", 800);
-
-
- /**
- * Log records whose level is <code>CONFIG</code> are used for
- * describing the static configuration, for example the windowing
- * environment, the operating system version, etc.
- */
- public static final Level CONFIG = new Level ("CONFIG", 700);
-
-
- /**
- * Log records whose level is <code>FINE</code> are typically used
- * for messages that are relevant for developers using
- * the component generating log messages. Examples include minor,
- * recoverable failures, or possible inefficiencies.
- */
- public static final Level FINE = new Level ("FINE", 500);
-
-
- /**
- * Log records whose level is <code>FINER</code> are intended for
- * rather detailed tracing, for example entering a method, returning
- * from a method, or throwing an exception.
- */
- public static final Level FINER = new Level ("FINER", 400);
-
-
- /**
- * Log records whose level is <code>FINEST</code> are used for
- * highly detailed tracing, for example to indicate that a certain
- * point inside the body of a method has been reached.
- */
- public static final Level FINEST = new Level ("FINEST", 300);
-
-
- /**
- * The <code>ALL</code> level is used as a threshold for filtering
- * log records, meaning that every message should be logged.
- *
- * @see Logger#setLevel(java.util.logging.Level)
- */
- public static final Level ALL = new Level ("ALL", Integer.MIN_VALUE);
-
-
- private static final Level[] knownLevels = {
- ALL, FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE, OFF
- };
-
-
- /**
- * The name of the Level without localizing it, for example
- * "WARNING".
- */
- private String name;
-
-
- /**
- * The integer value of this <code>Level</code>.
- */
- private int value;
-
-
- /**
- * The name of the resource bundle used for localizing the level
- * name, or <code>null</code> if the name does not undergo
- * localization.
- */
- private String resourceBundleName;
-
-
- /**
- * Creates a logging level given a name and an integer value.
- * It rarely is necessary to create custom levels,
- * as most applications should be well served with one of the
- * standard levels such as <code>Level.CONFIG</code>,
- * <code>Level.INFO</code>, or <code>Level.FINE</code>.
- *
- * @param name the name of the level.
- *
- * @param value the integer value of the level. Please note
- * that the Java<small><sup>TM</sup></small>
- * Logging API does not specify integer
- * values for standard levels (such as
- * Level.FINE). Therefore, a custom
- * level should pass an integer value that
- * is calculated at run-time, e.g.
- * <code>(Level.FINE.intValue() + Level.CONFIG.intValue())
- * / 2</code> for a level between FINE and CONFIG.
- */
- protected Level(String name, int value)
- {
- this(name, value, null);
- }
-
-
- /**
- * Create a logging level given a name, an integer value and a name
- * of a resource bundle for localizing the level name. It rarely
- * is necessary to create custom levels, as most applications
- * should be well served with one of the standard levels such as
- * <code>Level.CONFIG</code>, <code>Level.INFO</code>, or
- * <code>Level.FINE</code>.
- *
- * @param name the name of the level.
- *
- * @param value the integer value of the level. Please note
- * that the Java<small><sup>TM</sup></small>
- * Logging API does not specify integer
- * values for standard levels (such as
- * Level.FINE). Therefore, a custom
- * level should pass an integer value that
- * is calculated at run-time, e.g.
- * <code>(Level.FINE.intValue() + Level.CONFIG.intValue())
- * / 2</code> for a level between FINE and CONFIG.
- *
- * @param resourceBundleName the name of a resource bundle
- * for localizing the level name, or <code>null</code>
- * if the name does not need to be localized.
- */
- protected Level(String name, int value, String resourceBundleName)
- {
- this.name = name;
- this.value = value;
- this.resourceBundleName = resourceBundleName;
- }
-
-
- static final long serialVersionUID = -8176160795706313070L;
-
-
- /**
- * Checks whether the Level has the same intValue as one of the
- * pre-defined levels. If so, the pre-defined level object is
- * returned.
- *
- * <br/>Since the resource bundle name is not taken into
- * consideration, it is possible to resolve Level objects that have
- * been de-serialized by another implementation, even if the other
- * implementation uses a different resource bundle for localizing
- * the names of pre-defined levels.
- */
- private Object readResolve()
- {
- for (int i = 0; i < knownLevels.length; i++)
- if (value == knownLevels[i].intValue())
- return knownLevels[i];
-
- return this;
- }
-
-
- /**
- * Returns the name of the resource bundle used for localizing the
- * level name.
- *
- * @return the name of the resource bundle used for localizing the
- * level name, or <code>null</code> if the name does not undergo
- * localization.
- */
- public String getResourceBundleName()
- {
- return resourceBundleName;
- }
-
-
- /**
- * Returns the name of the Level without localizing it, for example
- * "WARNING".
- */
- public String getName()
- {
- return name;
- }
-
-
- /**
- * Returns the name of the Level after localizing it, for example
- * "WARNUNG".
- */
- public String getLocalizedName()
- {
- String localizedName = null;
-
- if (resourceBundleName != null)
- {
- try
- {
- ResourceBundle b = ResourceBundle.getBundle(resourceBundleName);
- localizedName = b.getString(name);
- }
- catch (Exception _)
- {
- }
- }
-
- if (localizedName != null)
- return localizedName;
- else
- return name;
- }
-
-
- /**
- * Returns the name of the Level without localizing it, for example
- * "WARNING".
- */
- public final String toString()
- {
- return getName();
- }
-
-
- /**
- * Returns the integer value of the Level.
- */
- public final int intValue()
- {
- return value;
- }
-
-
- /**
- * Returns one of the standard Levels given either its name or its
- * integer value. Custom subclasses of Level will not be returned
- * by this method.
- *
- * @throws IllegalArgumentException if <code>name</code> is neither
- * the name nor the integer value of one of the pre-defined standard
- * logging levels.
- *
- * @throws NullPointerException if <code>name</code> is null.
- *
- */
- public static Level parse(String name)
- throws IllegalArgumentException
- {
- /* This will throw a NullPointerException if name is null,
- * as required by the API specification.
- */
- name = name.intern();
-
- for (int i = 0; i < knownLevels.length; i++)
- {
- if (name == knownLevels[i].name)
- return knownLevels[i];
- }
-
- try
- {
- int num = Integer.parseInt(name);
- for (int i = 0; i < knownLevels.length; i++)
- if (num == knownLevels[i].value)
- return knownLevels[i];
- }
- catch (NumberFormatException _)
- {
- }
-
- String msg = "Not the name of a standard logging level: \"" + name + "\"";
- throw new IllegalArgumentException(msg);
- }
-
-
- /**
- * Checks whether this Level's integer value is equal to that of
- * another object.
- *
- * @return <code>true</code> if <code>other</code> is an instance of
- * <code>java.util.logging.Level</code> and has the same integer
- * value, <code>false</code> otherwise.
- */
- public boolean equals(Object other)
- {
- if (!(other instanceof Level))
- return false;
-
- return value == ((Level) other).value;
- }
-
-
- /**
- * Returns a hash code for this Level which is based on its numeric
- * value.
- */
- public int hashCode()
- {
- return value;
- }
-
-
- /**
- * Determines whether or not this Level is one of the standard
- * levels specified in the Logging API.
- *
- * <p>This method is package-private because it is not part
- * of the logging API specification. However, an XMLFormatter
- * is supposed to emit the numeric value for a custom log
- * level, but the name for a pre-defined level. It seems
- * cleaner to put this method to Level than to write some
- * procedural code for XMLFormatter.
- *
- * @return <code>true</code> if this Level is a standard level,
- * <code>false</code> otherwise.
- */
- final boolean isStandardLevel()
- {
- for (int i = 0; i < knownLevels.length; i++)
- if (knownLevels[i] == this)
- return true;
-
- return false;
- }
-}
-
diff --git a/libjava/java/util/logging/LogRecord.java b/libjava/java/util/logging/LogRecord.java
deleted file mode 100644
index af7f2058dbe..00000000000
--- a/libjava/java/util/logging/LogRecord.java
+++ /dev/null
@@ -1,672 +0,0 @@
-/* LogRecord.java --
- A class for the state associated with individual logging events
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-import java.util.ResourceBundle;
-
-
-/**
- * A <code>LogRecord</code> contains the state for an individual
- * event to be logged.
- *
- * <p>As soon as a LogRecord instance has been handed over to the
- * logging framework, applications should not manipulate it anymore.
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public class LogRecord
- implements java.io.Serializable
-{
- /**
- * The severity level of this <code>LogRecord</code>.
- */
- private Level level;
-
-
- /**
- * The sequence number of this <code>LogRecord</code>.
- */
- private long sequenceNumber;
-
-
- /**
- * The name of the class that issued the logging request, or
- * <code>null</code> if this information could not be obtained.
- */
- private String sourceClassName;
-
-
- /**
- * The name of the method that issued the logging request, or
- * <code>null</code> if this information could not be obtained.
- */
- private String sourceMethodName;
-
-
- /**
- * The message for this <code>LogRecord</code> before
- * any localization or formatting.
- */
- private String message;
-
-
- /**
- * An identifier for the thread in which this <code>LogRecord</code>
- * was created. The identifier is not necessarily related to any
- * thread identifiers used by the operating system.
- */
- private int threadID;
-
-
- /**
- * The time when this <code>LogRecord</code> was created,
- * in milliseconds since the beginning of January 1, 1970.
- */
- private long millis;
-
-
- /**
- * The Throwable associated with this <code>LogRecord</code>, or
- * <code>null</code> if the logged event is not related to an
- * exception or error.
- */
- private Throwable thrown;
-
-
- /**
- * The name of the logger where this <code>LogRecord</code> has
- * originated, or <code>null</code> if this <code>LogRecord</code>
- * does not originate from a <code>Logger</code>.
- */
- private String loggerName;
-
-
- /**
- * The name of the resource bundle used for localizing log messages,
- * or <code>null</code> if no bundle has been specified.
- */
- private String resourceBundleName;
-
- private transient Object[] parameters;
-
- private transient ResourceBundle bundle;
-
-
- /**
- * Constructs a <code>LogRecord</code> given a severity level and
- * an unlocalized message text. In addition, the sequence number,
- * creation time (as returned by <code>getMillis()</code>) and
- * thread ID are assigned. All other properties are set to
- * <code>null</code>.
- *
- * @param level the severity level, for example <code>Level.WARNING</code>.
- *
- * @param message the message text (which will be used as key
- * for looking up the localized message text
- * if a resource bundle has been associated).
- */
- public LogRecord(Level level, String message)
- {
- this.level = level;
- this.message = message;
- this.millis = System.currentTimeMillis();
-
- /* A subclass of java.lang.Thread could override hashCode(),
- * in which case the result would not be guaranteed anymore
- * to be unique among all threads. While System.identityHashCode
- * is not necessarily unique either, it at least cannot be
- * overridden by user code. However, is might be a good idea
- * to use something better for generating thread IDs.
- */
- this.threadID = System.identityHashCode(Thread.currentThread());
-
- sequenceNumber = allocateSeqNum();
- }
-
-
- /**
- * Determined with the serialver tool of the Sun J2SE 1.4.
- */
- static final long serialVersionUID = 5372048053134512534L;
-
- private void readObject(java.io.ObjectInputStream in)
- throws java.io.IOException, java.lang.ClassNotFoundException
- {
- in.defaultReadObject();
-
- /* We assume that future versions will be downwards compatible,
- * so we can ignore the versions.
- */
- byte majorVersion = in.readByte();
- byte minorVersion = in.readByte();
-
- int numParams = in.readInt();
- if (numParams >= 0)
- {
- parameters = new Object[numParams];
- for (int i = 0; i < numParams; i++)
- parameters[i] = in.readObject();
- }
- }
-
-
- /**
- * @serialData The default fields, followed by a major byte version
- * number, followed by a minor byte version number, followed by
- * information about the log record parameters. If
- * <code>parameters</code> is <code>null</code>, the integer -1 is
- * written, otherwise the length of the <code>parameters</code>
- * array (which can be zero), followed by the result of calling
- * {@link Object#toString() toString()} on the parameter (or
- * <code>null</code> if the parameter is <code>null</code>).
- *
- * <p><strong>Specification Note:</strong> The Javadoc for the
- * Sun reference implementation does not specify the version
- * number. FIXME: Reverse-engineer the JDK and file a bug
- * report with Sun, asking for amendment of the specification.
- */
- private void writeObject(java.io.ObjectOutputStream out)
- throws java.io.IOException
- {
- out.defaultWriteObject();
-
- /* Major, minor version number: The Javadoc for J2SE1.4 does not
- * specify the values.
- */
- out.writeByte(0);
- out.writeByte(0);
-
- if (parameters == null)
- out.writeInt(-1);
- else
- {
- out.writeInt(parameters.length);
- for (int i = 0; i < parameters.length; i++)
- {
- if (parameters[i] == null)
- out.writeObject(null);
- else
- out.writeObject(parameters[i].toString());
- }
- }
- }
-
-
- /**
- * Returns the name of the logger where this <code>LogRecord</code>
- * has originated.
- *
- * @return the name of the source {@link Logger}, or
- * <code>null</code> if this <code>LogRecord</code>
- * does not originate from a <code>Logger</code>.
- */
- public String getLoggerName()
- {
- return loggerName;
- }
-
-
- /**
- * Sets the name of the logger where this <code>LogRecord</code>
- * has originated.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param name the name of the source logger, or <code>null</code> to
- * indicate that this <code>LogRecord</code> does not
- * originate from a <code>Logger</code>.
- */
- public void setLoggerName(String name)
- {
- loggerName = name;
- }
-
-
- /**
- * Returns the resource bundle that is used when the message
- * of this <code>LogRecord</code> needs to be localized.
- *
- * @return the resource bundle used for localization,
- * or <code>null</code> if this message does not need
- * to be localized.
- */
- public ResourceBundle getResourceBundle()
- {
- return bundle;
- }
-
-
- /**
- * Sets the resource bundle that is used when the message
- * of this <code>LogRecord</code> needs to be localized.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param bundle the resource bundle to be used, or
- * <code>null</code> to indicate that this
- * message does not need to be localized.
- */
- public void setResourceBundle(ResourceBundle bundle)
- {
- this.bundle = bundle;
-
- /* FIXME: Is there a way to infer the name
- * of a resource bundle from a ResourceBundle object?
- */
- this.resourceBundleName = null;
- }
-
-
- /**
- * Returns the name of the resource bundle that is used when the
- * message of this <code>LogRecord</code> needs to be localized.
- *
- * @return the name of the resource bundle used for localization,
- * or <code>null</code> if this message does not need
- * to be localized.
- */
- public String getResourceBundleName()
- {
- return resourceBundleName;
- }
-
-
- /**
- * Sets the name of the resource bundle that is used when the
- * message of this <code>LogRecord</code> needs to be localized.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param name the name of the resource bundle to be used, or
- * <code>null</code> to indicate that this message
- * does not need to be localized.
- */
- public void setResourceBundleName(String name)
- {
- resourceBundleName = name;
- bundle = null;
-
- try
- {
- if (resourceBundleName != null)
- bundle = ResourceBundle.getBundle(resourceBundleName);
- }
- catch (java.util.MissingResourceException _)
- {
- }
- }
-
-
- /**
- * Returns the level of the LogRecord.
- *
- * <p>Applications should be aware of the possibility that the
- * result is not necessarily one of the standard logging levels,
- * since the logging framework allows to create custom subclasses
- * of <code>java.util.logging.Level</code>. Therefore, filters
- * should perform checks like <code>theRecord.getLevel().intValue()
- * == Level.INFO.intValue()</code> instead of <code>theRecord.getLevel()
- * == Level.INFO</code>.
- */
- public Level getLevel()
- {
- return level;
- }
-
-
- /**
- * Sets the severity level of this <code>LogRecord</code> to a new
- * value.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param level the new severity level, for example
- * <code>Level.WARNING</code>.
- */
- public void setLevel(Level level)
- {
- this.level = level;
- }
-
-
- /**
- * The last used sequence number for any LogRecord.
- */
- private static long lastSeqNum;
-
-
- /**
- * Allocates a sequence number for a new LogRecord. This class
- * method is only called by the LogRecord constructor.
- */
- private static synchronized long allocateSeqNum()
- {
- lastSeqNum += 1;
- return lastSeqNum;
- }
-
-
- /**
- * Returns the sequence number of this <code>LogRecord</code>.
- */
- public long getSequenceNumber()
- {
- return sequenceNumber;
- }
-
-
- /**
- * Sets the sequence number of this <code>LogRecord</code> to a new
- * value.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param seqNum the new sequence number.
- */
- public void setSequenceNumber(long seqNum)
- {
- this.sequenceNumber = seqNum;
- }
-
-
- /**
- * Returns the name of the class where the event being logged
- * has had its origin. This information can be passed as
- * parameter to some logging calls, and in certain cases, the
- * logging framework tries to determine an approximation
- * (which may or may not be accurate).
- *
- * @return the name of the class that issued the logging request,
- * or <code>null</code> if this information could not
- * be obtained.
- */
- public String getSourceClassName()
- {
- if (sourceClassName != null)
- return sourceClassName;
-
- /* FIXME: Should infer this information from the call stack. */
- return null;
- }
-
-
- /**
- * Sets the name of the class where the event being logged
- * has had its origin.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param sourceClassName the name of the class that issued the
- * logging request, or <code>null</code> to indicate that
- * this information could not be obtained.
- */
- public void setSourceClassName(String sourceClassName)
- {
- this.sourceClassName = sourceClassName;
- }
-
-
- /**
- * Returns the name of the method where the event being logged
- * has had its origin. This information can be passed as
- * parameter to some logging calls, and in certain cases, the
- * logging framework tries to determine an approximation
- * (which may or may not be accurate).
- *
- * @return the name of the method that issued the logging request,
- * or <code>null</code> if this information could not
- * be obtained.
- */
- public String getSourceMethodName()
- {
- if (sourceMethodName != null)
- return sourceMethodName;
-
- /* FIXME: Should infer this information from the call stack. */
- return null;
- }
-
-
- /**
- * Sets the name of the method where the event being logged
- * has had its origin.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param sourceMethodName the name of the method that issued the
- * logging request, or <code>null</code> to indicate that
- * this information could not be obtained.
- */
- public void setSourceMethodName(String sourceMethodName)
- {
- this.sourceMethodName = sourceMethodName;
- }
-
-
- /**
- * Returns the message for this <code>LogRecord</code> before
- * any localization or parameter substitution.
- *
- * <p>A {@link Logger} will try to localize the message
- * if a resource bundle has been associated with this
- * <code>LogRecord</code>. In this case, the logger will call
- * <code>getMessage()</code> and use the result as the key
- * for looking up the localized message in the bundle.
- * If no bundle has been associated, or if the result of
- * <code>getMessage()</code> is not a valid key in the
- * bundle, the logger will use the raw message text as
- * returned by this method.
- *
- * @return the message text, or <code>null</code> if there
- * is no message text.
- */
- public String getMessage()
- {
- return message;
- }
-
-
- /**
- * Sets the message for this <code>LogRecord</code>.
- *
- * <p>A <code>Logger</code> will try to localize the message
- * if a resource bundle has been associated with this
- * <code>LogRecord</code>. In this case, the logger will call
- * <code>getMessage()</code> and use the result as the key
- * for looking up the localized message in the bundle.
- * If no bundle has been associated, or if the result of
- * <code>getMessage()</code> is not a valid key in the
- * bundle, the logger will use the raw message text as
- * returned by this method.
- *
- * <p>It is possible to set the message to either an empty String or
- * <code>null</code>, although this does not make the the message
- * very helpful to human users.
- *
- * @param message the message text (which will be used as key
- * for looking up the localized message text
- * if a resource bundle has been associated).
- */
- public void setMessage(String message)
- {
- this.message = message;
- }
-
-
- /**
- * Returns the parameters to the log message.
- *
- * @return the parameters to the message, or <code>null</code> if
- * the message has no parameters.
- */
- public Object[] getParameters()
- {
- return parameters;
- }
-
-
- /**
- * Sets the parameters to the log message.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param parameters the parameters to the message, or <code>null</code>
- * to indicate that the message has no parameters.
- */
- public void setParameters(Object[] parameters)
- {
- this.parameters = parameters;
- }
-
-
- /**
- * Returns an identifier for the thread in which this
- * <code>LogRecord</code> was created. The identifier is not
- * necessarily related to any thread identifiers used by the
- * operating system.
- *
- * @return an identifier for the source thread.
- */
- public int getThreadID()
- {
- return threadID;
- }
-
-
- /**
- * Sets the identifier indicating in which thread this
- * <code>LogRecord</code> was created. The identifier is not
- * necessarily related to any thread identifiers used by the
- * operating system.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param threadID the identifier for the source thread.
- */
- public void setThreadID(int threadID)
- {
- this.threadID = threadID;
- }
-
-
- /**
- * Returns the time when this <code>LogRecord</code> was created.
- *
- * @return the time of creation in milliseconds since the beginning
- * of January 1, 1970.
- */
- public long getMillis()
- {
- return millis;
- }
-
-
- /**
- * Sets the time when this <code>LogRecord</code> was created.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param millis the time of creation in milliseconds since the
- * beginning of January 1, 1970.
- */
- public void setMillis(long millis)
- {
- this.millis = millis;
- }
-
-
- /**
- * Returns the Throwable associated with this <code>LogRecord</code>,
- * or <code>null</code> if the logged event is not related to an exception
- * or error.
- */
- public Throwable getThrown()
- {
- return thrown;
- }
-
-
- /**
- * Associates this <code>LogRecord</code> with an exception or error.
- *
- * <p>As soon as a <code>LogRecord</code> has been handed over
- * to the logging framework, applications should not modify it
- * anymore. Therefore, this method should only be called on
- * freshly constructed LogRecords.
- *
- * @param thrown the exception or error to associate with, or
- * <code>null</code> if this <code>LogRecord</code>
- * should be made unrelated to an exception or error.
- */
- public void setThrown(Throwable thrown)
- {
- this.thrown = thrown;
- }
-}
diff --git a/libjava/java/util/logging/LoggingPermission.java b/libjava/java/util/logging/LoggingPermission.java
deleted file mode 100644
index c7a2255ecea..00000000000
--- a/libjava/java/util/logging/LoggingPermission.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* LoggingPermission.java -- a class for logging permissions.
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-public final class LoggingPermission
- extends java.security.BasicPermission
-{
- /**
- * Creates a new LoggingPermission.
- *
- * @param name the name of the permission, which must be "control".
- *
- * @param actions the list of actions for the permission, which
- * must be either <code>null</code> or an empty
- * string.
- *
- * @exception IllegalArgumentException if <code>name</code>
- * is not "control", or <code>actions</code> is
- * neither <code>null</code> nor empty.
- */
- public LoggingPermission(String name, String actions)
- {
- super("control", "");
-
- if (!"control".equals(name))
- {
- throw new IllegalArgumentException(
- "name of LoggingPermission must be \"control\"");
- }
-
- if ((actions != null) && (actions.length() != 0))
- {
- throw new IllegalArgumentException(
- "actions of LoggingPermissions must be null or empty");
- }
- }
-}
diff --git a/libjava/java/util/logging/MemoryHandler.java b/libjava/java/util/logging/MemoryHandler.java
deleted file mode 100644
index ffa589f1668..00000000000
--- a/libjava/java/util/logging/MemoryHandler.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/* MemoryHandler.java -- a class for buffering log messages in a memory buffer
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-/**
- * A <code>MemoryHandler</code> maintains a circular buffer of
- * log records.
- *
- * <p><strong>Configuration:</strong> Values of the subsequent
- * <code>LogManager</code> properties are taken into consideration
- * when a <code>MemoryHandler</code> is initialized.
- * If a property is not defined, or if it has an invalid
- * value, a default is taken without an exception being thrown.
- *
- * <ul>
- * <li><code>java.util.MemoryHandler.level</code> - specifies
- * the initial severity level threshold. Default value:
- * <code>Level.ALL</code>.</li>
- * <li><code>java.util.MemoryHandler.filter</code> - specifies
- * the name of a Filter class. Default value: No Filter.</li>
- * <li><code>java.util.MemoryHandler.size</code> - specifies the
- * maximum number of log records that are kept in the circular
- * buffer. Default value: 1000.</li>
- * <li><code>java.util.MemoryHandler.push</code> - specifies the
- * <code>pushLevel</code>. Default value:
- * <code>Level.SEVERE</code>.</li>
- * <li><code>java.util.MemoryHandler.target</code> - specifies the
- * name of a subclass of {@link Handler} that will be used as the
- * target handler. There is no default value for this property;
- * if it is not set, the no-argument MemoryHandler constructor
- * will throw an exception.</li>
- * </ul>
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public class MemoryHandler
- extends Handler
-{
- /**
- * The storage area used for buffering the unpushed log records in
- * memory.
- */
- private final LogRecord[] buffer;
-
-
- /**
- * The current position in the circular buffer. For a new
- * MemoryHandler, or immediately after {@link #push()} was called,
- * the value of this variable is zero. Each call to {@link
- * #publish(LogRecord)} will store the published LogRecord into
- * <code>buffer[position]</code> before position is incremented by
- * one. If position becomes greater than the size of the buffer, it
- * is reset to zero.
- */
- private int position;
-
-
- /**
- * The number of log records which have been published, but not
- * pushed yet to the target handler.
- */
- private int numPublished;
-
-
- /**
- * The push level threshold for this <code>Handler</code>. When a
- * record is published whose severity level is greater than or equal
- * to the <code>pushLevel</code> of this <code>MemoryHandler</code>,
- * the {@link #push()} method will be invoked for pushing the buffer
- * contents to the target <code>Handler</code>.
- */
- private Level pushLevel;
-
-
- /**
- * The Handler to which log records are forwarded for actual
- * publication.
- */
- private final Handler target;
-
-
- /**
- * Constructs a <code>MemoryHandler</code> for keeping a circular
- * buffer of LogRecords; the initial configuration is determined by
- * the <code>LogManager</code> properties described above.
- */
- public MemoryHandler()
- {
- this((Handler) LogManager.getInstanceProperty(
- "java.util.logging.MemoryHandler.target",
- Handler.class, /* default */ null),
- LogManager.getIntPropertyClamped(
- "java.util.logging.MemoryHandler.size",
- /* default */ 1000,
- /* minimum value */ 1,
- /* maximum value */ Integer.MAX_VALUE),
- LogManager.getLevelProperty(
- "java.util.logging.MemoryHandler.push",
- /* default push level */ Level.SEVERE));
- }
-
-
- /**
- * Constructs a <code>MemoryHandler</code> for keeping a circular
- * buffer of LogRecords, given some parameters. The values of the
- * other parameters are taken from LogManager properties, as
- * described above.
- *
- * @param target the target handler that will receive those
- * log records that are passed on for publication.
- *
- * @param size the number of log records that are kept in the buffer.
- * The value must be a at least one.
- *
- * @param pushLevel the push level threshold for this
- * <code>MemoryHandler</code>. When a record is published whose
- * severity level is greater than or equal to
- * <code>pushLevel</code>, the {@link #push()} method will be
- * invoked in order to push the bufffer contents to
- * <code>target</code>.
- *
- * @throws java.lang.IllegalArgumentException if <code>size</code>
- * is negative or zero. The GNU implementation also throws
- * an IllegalArgumentException if <code>target</code> or
- * <code>pushLevel</code> are <code>null</code>, but the
- * API specification does not prescribe what should happen
- * in those cases.
- */
- public MemoryHandler(Handler target, int size, Level pushLevel)
- {
- if ((target == null) || (size <= 0) || (pushLevel == null))
- throw new IllegalArgumentException();
-
- buffer = new LogRecord[size];
- this.pushLevel = pushLevel;
- this.target = target;
-
- setLevel(LogManager.getLevelProperty(
- "java.util.logging.MemoryHandler.level",
- /* default value */ Level.ALL));
-
- setFilter((Filter) LogManager.getInstanceProperty(
- "java.util.logging.MemoryHandler.filter",
- /* must be instance of */ Filter.class,
- /* default value */ null));
- }
-
-
- /**
- * Stores a <code>LogRecord</code> in a fixed-size circular buffer,
- * provided the record passes all tests for being loggable. If the
- * buffer is full, the oldest record will be discarded.
- *
- * <p>If the record has a severity level which is greater than or
- * equal to the <code>pushLevel</code> of this
- * <code>MemoryHandler</code>, the {@link #push()} method will be
- * invoked for pushing the buffer contents to the target
- * <code>Handler</code>.
- *
- * <p>Most applications do not need to call this method directly.
- * Instead, they will use use a {@link Logger}, which will create
- * LogRecords and distribute them to registered handlers.
- *
- * @param record the log event to be published.
- */
- public void publish(LogRecord record)
- {
- if (!isLoggable(record))
- return;
-
- buffer[position] = record;
- position = (position + 1) % buffer.length;
- numPublished = numPublished + 1;
-
- if (record.getLevel().intValue() >= pushLevel.intValue())
- push();
- }
-
-
- /**
- * Pushes the contents of the memory buffer to the target
- * <code>Handler</code> and clears the buffer. Note that
- * the target handler will discard those records that do
- * not satisfy its own severity level threshold, or that are
- * not considered loggable by an installed {@link Filter}.
- *
- * <p>In case of an I/O failure, the {@link ErrorManager} of the
- * target <code>Handler</code> will be notified, but the caller of
- * this method will not receive an exception.
- */
- public void push()
- {
- int i;
-
- if (numPublished < buffer.length)
- {
- for (i = 0; i < position; i++)
- target.publish(buffer[i]);
- }
- else
- {
- for (i = position; i < buffer.length; i++)
- target.publish(buffer[i]);
- for (i = 0; i < position; i++)
- target.publish(buffer[i]);
- }
-
- numPublished = 0;
- position = 0;
- }
-
-
- /**
- * Forces any data that may have been buffered by the target
- * <code>Handler</code> to the underlying output device, but
- * does <em>not</em> push the contents of the circular memory
- * buffer to the target handler.
- *
- * <p>In case of an I/O failure, the {@link ErrorManager} of the
- * target <code>Handler</code> will be notified, but the caller of
- * this method will not receive an exception.
- *
- * @see #push()
- */
- public void flush()
- {
- target.flush();
- }
-
-
- /**
- * Closes this <code>MemoryHandler</code> and its associated target
- * handler, discarding the contents of the memory buffer. However,
- * any data that may have been buffered by the target
- * <code>Handler</code> is forced to the underlying output device.
- *
- * <p>As soon as <code>close</code> has been called,
- * a <code>Handler</code> should not be used anymore. Attempts
- * to publish log records, to flush buffers, or to modify the
- * <code>Handler</code> in any other way may throw runtime
- * exceptions after calling <code>close</code>.</p>
- *
- * <p>In case of an I/O failure, the <code>ErrorManager</code> of
- * the associated target <code>Handler</code> will be informed, but
- * the caller of this method will not receive an exception.</p>
- *
- * @throws SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- *
- * @see #push()
- */
- public void close()
- throws SecurityException
- {
- push();
-
- /* This will check for LoggingPermission("control"). If the
- * current security context does not grant this permission,
- * push() has been executed, but this does not impose a
- * security risk.
- */
- target.close();
- }
-
-
-
- /**
- * Returns the push level threshold for this <code>Handler</code>.
- * When a record is published whose severity level is greater
- * than or equal to the <code>pushLevel</code> of this
- * <code>MemoryHandler</code>, the {@link #push()} method will be
- * invoked for pushing the buffer contents to the target
- * <code>Handler</code>.
- *
- * @return the push level threshold for automatic pushing.
- */
- public Level getPushLevel()
- {
- return pushLevel;
- }
-
-
- /**
- * Sets the push level threshold for this <code>Handler</code>.
- * When a record is published whose severity level is greater
- * than or equal to the <code>pushLevel</code> of this
- * <code>MemoryHandler</code>, the {@link #push()} method will be
- * invoked for pushing the buffer contents to the target
- * <code>Handler</code>.
- *
- * @param pushLevel the push level threshold for automatic pushing.
- *
- * @exception SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- *
- * @exception NullPointerException if <code>pushLevel</code> is
- * <code>null</code>.
- */
- public void setPushLevel(Level pushLevel)
- {
- LogManager.getLogManager().checkAccess();
-
- /* Throws a NullPointerException if pushLevel is null. */
- pushLevel.getClass();
-
- this.pushLevel = pushLevel;
- }
-}
diff --git a/libjava/java/util/logging/SimpleFormatter.java b/libjava/java/util/logging/SimpleFormatter.java
deleted file mode 100644
index f7a442792f9..00000000000
--- a/libjava/java/util/logging/SimpleFormatter.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/* SimpleFormatter.java --
- A class for formatting log records into short human-readable messages
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-import java.text.DateFormat;
-import java.util.Date;
-
-/**
- * A <code>SimpleFormatter</code> formats log records into
- * short human-readable messages, typically one or two lines.
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public class SimpleFormatter
- extends Formatter
-{
- /**
- * Constructs a SimpleFormatter.
- */
- public SimpleFormatter()
- {
- }
-
-
- /**
- * An instance of a DateFormatter that is used for formatting
- * the time of a log record into a human-readable string,
- * according to the rules of the current locale. The value
- * is set after the first invocation of format, since it is
- * common that a JVM will instantiate a SimpleFormatter without
- * ever using it.
- */
- private DateFormat dateFormat;
-
- /**
- * The character sequence that is used to separate lines in the
- * generated stream. Somewhat surprisingly, the Sun J2SE 1.4
- * reference implementation always uses UNIX line endings, even on
- * platforms that have different line ending conventions (i.e.,
- * DOS). The GNU implementation does not replicate this bug.
- *
- * @see Sun bug parade, bug #4462871,
- * "java.util.logging.SimpleFormatter uses hard-coded line separator".
- */
- static final String lineSep = System.getProperty("line.separator");
-
-
- /**
- * Formats a log record into a String.
- *
- * @param the log record to be formatted.
- *
- * @return a short human-readable message, typically one or two
- * lines. Lines are separated using the default platform line
- * separator.
- *
- * @throws NullPointerException if <code>record</code>
- * is <code>null</code>.
- */
- public String format(LogRecord record)
- {
- StringBuffer buf = new StringBuffer(180);
-
- if (dateFormat == null)
- dateFormat = DateFormat.getDateTimeInstance();
-
- buf.append(dateFormat.format(new Date(record.getMillis())));
- buf.append(' ');
- buf.append(record.getSourceClassName());
- buf.append(' ');
- buf.append(record.getSourceMethodName());
- buf.append(lineSep);
-
- buf.append(record.getLevel());
- buf.append(": ");
- buf.append(formatMessage(record));
-
- buf.append(lineSep);
-
- return buf.toString();
- }
-}
diff --git a/libjava/java/util/logging/SocketHandler.java b/libjava/java/util/logging/SocketHandler.java
deleted file mode 100644
index 002dfdbbe5e..00000000000
--- a/libjava/java/util/logging/SocketHandler.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/* SocketHandler.java -- a class for publishing log messages to network sockets
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-
-/**
- * A <code>SocketHandler</code> publishes log records to
- * a TCP/IP socket.
- *
- * <p><strong>Configuration:</strong> Values of the subsequent
- * <code>LogManager</code> properties are taken into consideration
- * when a <code>SocketHandler</code> is initialized.
- * If a property is not defined, or if it has an invalid
- * value, a default is taken without an exception being thrown.
- *
- * <ul>
- *
- * <li><code>java.util.SocketHandler.level</code> - specifies
- * the initial severity level threshold. Default value:
- * <code>Level.ALL</code>.</li>
- *
- * <li><code>java.util.SocketHandler.filter</code> - specifies
- * the name of a Filter class. Default value: No Filter.</li>
- *
- * <li><code>java.util.SocketHandler.formatter</code> - specifies
- * the name of a Formatter class. Default value:
- * <code>java.util.logging.XMLFormatter</code>.</li>
- *
- * <li><code>java.util.SocketHandler.encoding</code> - specifies
- * the name of the character encoding. Default value:
- * the default platform encoding.</li>
- *
- * <li><code>java.util.SocketHandler.host</code> - specifies
- * the name of the host to which records are published.
- * There is no default value for this property; if it is
- * not set, the SocketHandler constructor will throw
- * an exception.</li>
- *
- * <li><code>java.util.SocketHandler.port</code> - specifies
- * the TCP/IP port to which records are published.
- * There is no default value for this property; if it is
- * not set, the SocketHandler constructor will throw
- * an exception.</li>
- *
- * </ul>
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public class SocketHandler
- extends StreamHandler
-{
- /**
- * Constructs a <code>SocketHandler</code> that publishes log
- * records to a TCP/IP socket. Tthe initial configuration is
- * determined by the <code>LogManager</code> properties described
- * above.
- *
- * @throws java.io.IOException if the connection to the specified
- * network host and port cannot be established.
- *
- * @throws java.lang.IllegalArgumentException if either the
- * <code>java.util.logging.SocketHandler.host</code>
- * or <code>java.util.logging.SocketHandler.port</code>
- * LogManager properties is not defined, or specifies
- * an invalid value.
- */
- public SocketHandler()
- throws java.io.IOException
- {
- this(LogManager.getLogManager().getProperty("java.util.logging.SocketHandler.host"),
- getPortNumber());
- }
-
-
- /**
- * Constructs a <code>SocketHandler</code> that publishes log
- * records to a TCP/IP socket. With the exception of the internet
- * host and port, the initial configuration is determined by the
- * <code>LogManager</code> properties described above.
- *
- * @param host the Internet host to which log records will be
- * forwarded.
- *
- * @param port the port at the host which will accept a request
- * for a TCP/IP connection.
- *
- * @throws java.io.IOException if the connection to the specified
- * network host and port cannot be established.
- *
- * @throws java.lang.IllegalArgumentException if either
- * <code>host</code> or <code>port</code> specify
- * an invalid value.
- */
- public SocketHandler(String host, int port)
- throws java.io.IOException
- {
- super(createSocket(host, port),
- "java.util.logging.SocketHandler",
- /* default level */ Level.ALL,
- /* formatter */ null,
- /* default formatter */ XMLFormatter.class);
- }
-
-
- /**
- * Retrieves the port number from the java.util.logging.SocketHandler.port
- * LogManager property.
- *
- * @throws IllegalArgumentException if the property is not defined or
- * does not specify an integer value.
- */
- private static int getPortNumber()
- {
- try {
- return Integer.parseInt(LogManager.getLogManager().getProperty("java.util.logging.SocketHandler.port"));
- } catch (Exception ex) {
- throw new IllegalArgumentException();
- }
- }
-
-
- /**
- * Creates an OutputStream for publishing log records to an Internet
- * host and port. This private method is a helper for use by the
- * constructor of SocketHandler.
- *
- * @param host the Internet host to which log records will be
- * forwarded.
- *
- * @param port the port at the host which will accept a request
- * for a TCP/IP connection.
- *
- * @throws java.io.IOException if the connection to the specified
- * network host and port cannot be established.
- *
- * @throws java.lang.IllegalArgumentException if either
- * <code>host</code> or <code>port</code> specify
- * an invalid value.
- */
- private static java.io.OutputStream createSocket(String host, int port)
- throws java.io.IOException, java.lang.IllegalArgumentException
- {
- java.net.Socket socket;
-
- if ((host == null) || (port < 1))
- throw new IllegalArgumentException();
-
- socket = new java.net.Socket(host, port);
-
- socket.shutdownInput();
-
- /* The architecture of the logging framework provides replaceable
- * formatters. Because these formatters perform their task by
- * returning one single String for each LogRecord to be formatted,
- * there is no need to buffer.
- */
- socket.setTcpNoDelay(true);
-
- return socket.getOutputStream();
- }
-
-
- /**
- * Publishes a <code>LogRecord</code> to the network socket,
- * provided the record passes all tests for being loggable.
- * In addition, all data that may have been buffered will
- * be forced to the network stream.
- *
- * <p>Most applications do not need to call this method directly.
- * Instead, they will use a {@link Logger} instance, which will
- * create LogRecords and distribute them to registered handlers.
- *
- * <p>In case of an I/O failure, the <code>ErrorManager</code>
- * of this <code>SocketHandler</code> will be informed, but the caller
- * of this method will not receive an exception.
- *
- * @param record the log event to be published.
- */
- public void publish(LogRecord record)
- {
- super.publish(record);
- flush();
- }
-}
-
diff --git a/libjava/java/util/logging/StreamHandler.java b/libjava/java/util/logging/StreamHandler.java
deleted file mode 100644
index 5c35c1e481d..00000000000
--- a/libjava/java/util/logging/StreamHandler.java
+++ /dev/null
@@ -1,521 +0,0 @@
-/* StreamHandler.java --
- A class for publishing log messages to instances of java.io.OutputStream
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-
-/**
- * A <code>StreamHandler</code> publishes <code>LogRecords</code> to
- * a instances of <code>java.io.OutputStream</code>.
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public class StreamHandler
- extends Handler
-{
- private OutputStream out;
- private Writer writer;
-
-
- /**
- * Indicates the current state of this StreamHandler. The value
- * should be one of STATE_FRESH, STATE_PUBLISHED, or STATE_CLOSED.
- */
- private int streamState = STATE_FRESH;
-
-
- /**
- * streamState having this value indicates that the StreamHandler
- * has been created, but the publish(LogRecord) method has not been
- * called yet. If the StreamHandler has been constructed without an
- * OutputStream, writer will be null, otherwise it is set to a
- * freshly created OutputStreamWriter.
- */
- private static final int STATE_FRESH = 0;
-
-
- /**
- * streamState having this value indicates that the publish(LocRecord)
- * method has been called at least once.
- */
- private static final int STATE_PUBLISHED = 1;
-
-
- /**
- * streamState having this value indicates that the close() method
- * has been called.
- */
- private static final int STATE_CLOSED = 2;
-
-
- /**
- * Creates a <code>StreamHandler</code> without an output stream.
- * Subclasses can later use {@link
- * #setOutputStream(java.io.OutputStream)} to associate an output
- * stream with this StreamHandler.
- */
- public StreamHandler()
- {
- this(null, null);
- }
-
-
- /**
- * Creates a <code>StreamHandler</code> that formats log messages
- * with the specified Formatter and publishes them to the specified
- * output stream.
- *
- * @param out the output stream to which the formatted log messages
- * are published.
- *
- * @param formatter the <code>Formatter</code> that will be used
- * to format log messages.
- */
- public StreamHandler(OutputStream out, Formatter formatter)
- {
- this(out, "java.util.logging.StreamHandler", Level.INFO,
- formatter, SimpleFormatter.class);
- }
-
-
- StreamHandler(
- OutputStream out,
- String propertyPrefix,
- Level defaultLevel,
- Formatter formatter, Class defaultFormatterClass)
- {
- this.level = LogManager.getLevelProperty(propertyPrefix + ".level",
- defaultLevel);
-
- this.filter = (Filter) LogManager.getInstanceProperty(
- propertyPrefix + ".filter",
- /* must be instance of */ Filter.class,
- /* default: new instance of */ null);
-
- if (formatter != null)
- this.formatter = formatter;
- else
- this.formatter = (Formatter) LogManager.getInstanceProperty(
- propertyPrefix + ".formatter",
- /* must be instance of */ Formatter.class,
- /* default: new instance of */ defaultFormatterClass);
-
- try
- {
- String enc = LogManager.getLogManager().getProperty(propertyPrefix
- + ".encoding");
-
- /* make sure enc actually is a valid encoding */
- if ((enc != null) && (enc.length() > 0))
- new String(new byte[0], enc);
-
- this.encoding = enc;
- }
- catch (Exception _)
- {
- }
-
- if (out != null)
- {
- try
- {
- changeWriter(out, getEncoding());
- }
- catch (UnsupportedEncodingException uex)
- {
- /* This should never happen, since the validity of the encoding
- * name has been checked above.
- */
- throw new RuntimeException(uex.getMessage());
- }
- }
- }
-
-
- private void checkOpen()
- {
- if (streamState == STATE_CLOSED)
- throw new IllegalStateException(this.toString() + " has been closed");
- }
-
- private void checkFresh()
- {
- checkOpen();
- if (streamState != STATE_FRESH)
- throw new IllegalStateException("some log records have been published to " + this);
- }
-
-
- private void changeWriter(OutputStream out, String encoding)
- throws UnsupportedEncodingException
- {
- OutputStreamWriter writer;
-
- /* The logging API says that a null encoding means the default
- * platform encoding. However, java.io.OutputStreamWriter needs
- * another constructor for the default platform encoding,
- * passing null would throw an exception.
- */
- if (encoding == null)
- writer = new OutputStreamWriter(out);
- else
- writer = new OutputStreamWriter(out, encoding);
-
- /* Closing the stream has side effects -- do this only after
- * creating a new writer has been successful.
- */
- if ((streamState != STATE_FRESH) || (this.writer != null))
- close();
-
- this.writer = writer;
- this.out = out;
- this.encoding = encoding;
- streamState = STATE_FRESH;
- }
-
-
- /**
- * Sets the character encoding which this handler uses for publishing
- * log records. The encoding of a <code>StreamHandler</code> must be
- * set before any log records have been published.
- *
- * @param encoding the name of a character encoding, or <code>null</code>
- * for the default encoding.
- *
- * @throws SecurityException if a security manager exists and
- * the caller is not granted the permission to control the
- * the logging infrastructure.
- *
- * @exception IllegalStateException if any log records have been
- * published to this <code>StreamHandler</code> before. Please
- * be aware that this is a pecularity of the GNU implementation.
- * While the API specification indicates that it is an error
- * if the encoding is set after records have been published,
- * it does not mandate any specific behavior for that case.
- */
- public void setEncoding(String encoding)
- throws SecurityException, UnsupportedEncodingException
- {
- /* The inherited implementation first checks whether the invoking
- * code indeed has the permission to control the logging infra-
- * structure, and throws a SecurityException if this was not the
- * case.
- *
- * Next, it verifies that the encoding is supported and throws
- * an UnsupportedEncodingExcpetion otherwise. Finally, it remembers
- * the name of the encoding.
- */
- super.setEncoding(encoding);
-
- checkFresh();
-
- /* If out is null, setEncoding is being called before an output
- * stream has been set. In that case, we need to check that the
- * encoding is valid, and remember it if this is the case. Since
- * this is exactly what the inherited implementation of
- * Handler.setEncoding does, we can delegate.
- */
- if (out != null)
- {
- /* The logging API says that a null encoding means the default
- * platform encoding. However, java.io.OutputStreamWriter needs
- * another constructor for the default platform encoding, passing
- * null would throw an exception.
- */
- if (encoding == null)
- writer = new OutputStreamWriter(out);
- else
- writer = new OutputStreamWriter(out, encoding);
- }
- }
-
-
- /**
- * Changes the output stream to which this handler publishes
- * logging records.
- *
- * @throws SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- *
- * @throws NullPointerException if <code>out</code>
- * is <code>null</code>.
- */
- protected void setOutputStream(OutputStream out)
- throws SecurityException
- {
- LogManager.getLogManager().checkAccess();
-
- /* Throw a NullPointerException if out is null. */
- out.getClass();
-
- try
- {
- changeWriter(out, getEncoding());
- }
- catch (UnsupportedEncodingException ex)
- {
- /* This seems quite unlikely to happen, unless the underlying
- * implementation of java.io.OutputStreamWriter changes its
- * mind (at runtime) about the set of supported character
- * encodings.
- */
- throw new RuntimeException(ex.getMessage());
- }
- }
-
-
- /**
- * Publishes a <code>LogRecord</code> to the associated output
- * stream, provided the record passes all tests for being loggable.
- * The <code>StreamHandler</code> will localize the message of the
- * log record and substitute any message parameters.
- *
- * <p>Most applications do not need to call this method directly.
- * Instead, they will use use a {@link Logger}, which will create
- * LogRecords and distribute them to registered handlers.
- *
- * <p>In case of an I/O failure, the <code>ErrorManager</code>
- * of this <code>Handler</code> will be informed, but the caller
- * of this method will not receive an exception.
- *
- * <p>If a log record is being published to a
- * <code>StreamHandler</code> that has been closed earlier, the Sun
- * J2SE 1.4 reference can be observed to silently ignore the
- * call. The GNU implementation, however, intentionally behaves
- * differently by informing the <code>ErrorManager</code> associated
- * with this <code>StreamHandler</code>. Since the condition
- * indicates a programming error, the programmer should be
- * informed. It also seems extremely unlikely that any application
- * would depend on the exact behavior in this rather obscure,
- * erroneous case -- especially since the API specification does not
- * prescribe what is supposed to happen.
- *
- * @param record the log event to be published.
- */
- public void publish(LogRecord record)
- {
- String formattedMessage;
-
- if (!isLoggable(record))
- return;
-
- if (streamState == STATE_FRESH)
- {
- try
- {
- writer.write(formatter.getHead(this));
- }
- catch (java.io.IOException ex)
- {
- reportError(null, ex, ErrorManager.WRITE_FAILURE);
- return;
- }
- catch (Exception ex)
- {
- reportError(null, ex, ErrorManager.GENERIC_FAILURE);
- return;
- }
-
- streamState = STATE_PUBLISHED;
- }
-
- try
- {
- formattedMessage = formatter.format(record);
- }
- catch (Exception ex)
- {
- reportError(null, ex, ErrorManager.FORMAT_FAILURE);
- return;
- }
-
- try
- {
- writer.write(formattedMessage);
- }
- catch (Exception ex)
- {
- reportError(null, ex, ErrorManager.WRITE_FAILURE);
- }
- }
-
-
- /**
- * Checks whether or not a <code>LogRecord</code> would be logged
- * if it was passed to this <code>StreamHandler</code> for publication.
- *
- * <p>The <code>StreamHandler</code> implementation first checks
- * whether a writer is present and the handler's level is greater
- * than or equal to the severity level threshold. In a second step,
- * if a {@link Filter} has been installed, its {@link
- * Filter#isLoggable(LogRecord) isLoggable} method is
- * invoked. Subclasses of <code>StreamHandler</code> can override
- * this method to impose their own constraints.
- *
- * @param record the <code>LogRecord</code> to be checked.
- *
- * @return <code>true</code> if <code>record</code> would
- * be published by {@link #publish(LogRecord) publish},
- * <code>false</code> if it would be discarded.
- *
- * @see #setLevel(Level)
- * @see #setFilter(Filter)
- * @see Filter#isLoggable(LogRecord)
- *
- * @throws NullPointerException if <code>record</code> is
- * <code>null</code>. */
- public boolean isLoggable(LogRecord record)
- {
- return (writer != null) && super.isLoggable(record);
- }
-
-
- /**
- * Forces any data that may have been buffered to the underlying
- * output device.
- *
- * <p>In case of an I/O failure, the <code>ErrorManager</code>
- * of this <code>Handler</code> will be informed, but the caller
- * of this method will not receive an exception.
- *
- * <p>If a <code>StreamHandler</code> that has been closed earlier
- * is closed a second time, the Sun J2SE 1.4 reference can be
- * observed to silently ignore the call. The GNU implementation,
- * however, intentionally behaves differently by informing the
- * <code>ErrorManager</code> associated with this
- * <code>StreamHandler</code>. Since the condition indicates a
- * programming error, the programmer should be informed. It also
- * seems extremely unlikely that any application would depend on the
- * exact behavior in this rather obscure, erroneous case --
- * especially since the API specification does not prescribe what is
- * supposed to happen.
- */
- public void flush()
- {
- try
- {
- checkOpen();
- if (writer != null)
- writer.flush();
- }
- catch (Exception ex)
- {
- reportError(null, ex, ErrorManager.FLUSH_FAILURE);
- }
- }
-
-
- /**
- * Closes this <code>StreamHandler</code> after having forced any
- * data that may have been buffered to the underlying output
- * device.
- *
- * <p>As soon as <code>close</code> has been called,
- * a <code>Handler</code> should not be used anymore. Attempts
- * to publish log records, to flush buffers, or to modify the
- * <code>Handler</code> in any other way may throw runtime
- * exceptions after calling <code>close</code>.</p>
- *
- * <p>In case of an I/O failure, the <code>ErrorManager</code>
- * of this <code>Handler</code> will be informed, but the caller
- * of this method will not receive an exception.</p>
- *
- * <p>If a <code>StreamHandler</code> that has been closed earlier
- * is closed a second time, the Sun J2SE 1.4 reference can be
- * observed to silently ignore the call. The GNU implementation,
- * however, intentionally behaves differently by informing the
- * <code>ErrorManager</code> associated with this
- * <code>StreamHandler</code>. Since the condition indicates a
- * programming error, the programmer should be informed. It also
- * seems extremely unlikely that any application would depend on the
- * exact behavior in this rather obscure, erroneous case --
- * especially since the API specification does not prescribe what is
- * supposed to happen.
- *
- * @throws SecurityException if a security manager exists and
- * the caller is not granted the permission to control
- * the logging infrastructure.
- */
- public void close()
- throws SecurityException
- {
- LogManager.getLogManager().checkAccess();
-
- try
- {
- /* Although flush also calls checkOpen, it catches
- * any exceptions and reports them to the ErrorManager
- * as flush failures. However, we want to report
- * a closed stream as a close failure, not as a
- * flush failure here. Therefore, we call checkOpen()
- * before flush().
- */
- checkOpen();
- flush();
-
- if (writer != null)
- {
- if (formatter != null)
- {
- /* Even if the StreamHandler has never published a record,
- * it emits head and tail upon closing. An earlier version
- * of the GNU Classpath implementation did not emitted
- * anything. However, this had caused XML log files to be
- * entirely empty instead of containing no log records.
- */
- if (streamState == STATE_FRESH)
- writer.write(formatter.getHead(this));
- if (streamState != STATE_CLOSED)
- writer.write(formatter.getTail(this));
- }
- streamState = STATE_CLOSED;
- writer.close();
- }
- }
- catch (Exception ex)
- {
- reportError(null, ex, ErrorManager.CLOSE_FAILURE);
- }
- }
-}
diff --git a/libjava/java/util/logging/XMLFormatter.java b/libjava/java/util/logging/XMLFormatter.java
deleted file mode 100644
index 4dd63281727..00000000000
--- a/libjava/java/util/logging/XMLFormatter.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/* XMLFormatter.java --
- A class for formatting log messages into a standard XML format
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.logging;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.ResourceBundle;
-
-/**
- * An <code>XMLFormatter</code> formats LogRecords into
- * a standard XML format.
- *
- * @author Sascha Brawer (brawer@acm.org)
- */
-public class XMLFormatter
- extends Formatter
-{
- /**
- * Constructs a new XMLFormatter.
- */
- public XMLFormatter()
- {
- }
-
-
- /**
- * The character sequence that is used to separate lines in the
- * generated XML stream. Somewhat surprisingly, the Sun J2SE 1.4
- * reference implementation always uses UNIX line endings, even on
- * platforms that have different line ending conventions (i.e.,
- * DOS). The GNU Classpath implementation does not replicates this
- * bug.
- *
- * See also the Sun bug parade, bug #4462871,
- * "java.util.logging.SimpleFormatter uses hard-coded line separator".
- */
- private static final String lineSep = SimpleFormatter.lineSep;
-
-
- /**
- * A DateFormat for emitting time in the ISO 8601 format.
- * Since the API specification of SimpleDateFormat does not talk
- * about its thread-safety, we cannot share a singleton instance.
- */
- private final SimpleDateFormat iso8601
- = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
-
-
- /**
- * Appends a line consisting of indentation, opening element tag,
- * element content, closing element tag and line separator to
- * a StringBuffer, provided that the element content is
- * actually existing.
- *
- * @param buf the StringBuffer to which the line will be appended.
- *
- * @param indent the indentation level.
- *
- * @param tag the element tag name, for instance <code>method</code>.
- *
- * @param content the element content, or <code>null</code> to
- * have no output whatsoever appended to <code>buf</code>.
- */
- private static void appendTag(StringBuffer buf, int indent,
- String tag, String content)
- {
- int i;
-
- if (content == null)
- return;
-
- for (i = 0; i < indent * 2; i++)
- buf.append(' ');
-
- buf.append("<");
- buf.append(tag);
- buf.append('>');
-
- /* Append the content, but escape for XML by replacing
- * '&', '<', '>' and all non-ASCII characters with
- * appropriate escape sequences.
- * The Sun J2SE 1.4 reference implementation does not
- * escape non-ASCII characters. This is a bug in their
- * implementation which has been reported in the Java
- * bug parade as bug number (FIXME: Insert number here).
- */
- for (i = 0; i < content.length(); i++)
- {
- char c = content.charAt(i);
- switch (c)
- {
- case '&':
- buf.append("&amp;");
- break;
-
- case '<':
- buf.append("&lt;");
- break;
-
- case '>':
- buf.append("&gt;");
- break;
-
- default:
- if (((c >= 0x20) && (c <= 0x7e))
- || (c == /* line feed */ 10)
- || (c == /* carriage return */ 13))
- buf.append(c);
- else
- {
- buf.append("&#");
- buf.append((int) c);
- buf.append(';');
- }
- break;
- } /* switch (c) */
- } /* for i */
-
- buf.append("</");
- buf.append(tag);
- buf.append(">");
- buf.append(lineSep);
- }
-
-
- /**
- * Appends a line consisting of indentation, opening element tag,
- * numeric element content, closing element tag and line separator
- * to a StringBuffer.
- *
- * @param buf the StringBuffer to which the line will be appended.
- *
- * @param indent the indentation level.
- *
- * @param tag the element tag name, for instance <code>method</code>.
- *
- * @param content the element content.
- */
- private static void appendTag(StringBuffer buf, int indent,
- String tag, long content)
- {
- appendTag(buf, indent, tag, Long.toString(content));
- }
-
-
- public String format(LogRecord record)
- {
- StringBuffer buf = new StringBuffer(400);
- Level level = record.getLevel();
- long millis = record.getMillis();
- Object[] params = record.getParameters();
- ResourceBundle bundle = record.getResourceBundle();
- String message;
-
- buf.append("<record>");
- buf.append(lineSep);
-
-
- appendTag(buf, 1, "date", iso8601.format(new Date(millis)));
- appendTag(buf, 1, "millis", record.getMillis());
- appendTag(buf, 1, "sequence", record.getSequenceNumber());
- appendTag(buf, 1, "logger", record.getLoggerName());
-
- if (level.isStandardLevel())
- appendTag(buf, 1, "level", level.toString());
- else
- appendTag(buf, 1, "level", level.intValue());
-
- appendTag(buf, 1, "class", record.getSourceClassName());
- appendTag(buf, 1, "method", record.getSourceMethodName());
- appendTag(buf, 1, "thread", record.getThreadID());
-
- /* The Sun J2SE 1.4 reference implementation does not emit the
- * message in localized form. This is in violation of the API
- * specification. The GNU Classpath implementation intentionally
- * replicates the buggy behavior of the Sun implementation, as
- * different log files might be a big nuisance to users.
- */
- try
- {
- record.setResourceBundle(null);
- message = formatMessage(record);
- }
- finally
- {
- record.setResourceBundle(bundle);
- }
- appendTag(buf, 1, "message", message);
-
- /* The Sun J2SE 1.4 reference implementation does not
- * emit key, catalog and param tags. This is in violation
- * of the API specification. The Classpath implementation
- * intentionally replicates the buggy behavior of the
- * Sun implementation, as different log files might be
- * a big nuisance to users.
- *
- * FIXME: File a bug report with Sun. Insert bug number here.
- *
- *
- * key = record.getMessage();
- * if (key == null)
- * key = "";
- *
- * if ((bundle != null) && !key.equals(message))
- * {
- * appendTag(buf, 1, "key", key);
- * appendTag(buf, 1, "catalog", record.getResourceBundleName());
- * }
- *
- * if (params != null)
- * {
- * for (int i = 0; i < params.length; i++)
- * appendTag(buf, 1, "param", params[i].toString());
- * }
- */
-
- /* FIXME: We have no way to obtain the stacktrace before free JVMs
- * support the corresponding method in java.lang.Throwable. Well,
- * it would be possible to parse the output of printStackTrace,
- * but this would be pretty kludgy. Instead, we postpose the
- * implementation until Throwable has made progress.
- */
- Throwable thrown = record.getThrown();
- if (thrown != null)
- {
- buf.append(" <exception>");
- buf.append(lineSep);
-
- /* The API specification is not clear about what exactly
- * goes into the XML record for a thrown exception: It
- * could be the result of getMessage(), getLocalizedMessage(),
- * or toString(). Therefore, it was necessary to write a
- * Mauve testlet and run it with the Sun J2SE 1.4 reference
- * implementation. It turned out that the we need to call
- * toString().
- *
- * FIXME: File a bug report with Sun, asking for clearer
- * specs.
- */
- appendTag(buf, 2, "message", thrown.toString());
-
- /* FIXME: The Logging DTD specifies:
- *
- * <!ELEMENT exception (message?, frame+)>
- *
- * However, java.lang.Throwable.getStackTrace() is
- * allowed to return an empty array. So, what frame should
- * be emitted for an empty stack trace? We probably
- * should file a bug report with Sun, asking for the DTD
- * to be changed.
- */
-
- buf.append(" </exception>");
- buf.append(lineSep);
- }
-
-
- buf.append("</record>");
- buf.append(lineSep);
-
- return buf.toString();
- }
-
-
- /**
- * Returns a string that handlers are supposed to emit before
- * the first log record. The base implementation returns an
- * empty string, but subclasses such as {@link XMLFormatter}
- * override this method in order to provide a suitable header.
- *
- * @return a string for the header.
- *
- * @param handler the handler which will prepend the returned
- * string in front of the first log record. This method
- * will inspect certain properties of the handler, for
- * example its encoding, in order to construct the header.
- */
- public String getHead(Handler h)
- {
- StringBuffer buf;
- String encoding;
-
- buf = new StringBuffer(80);
- buf.append("<?xml version=\"1.0\" encoding=\"");
-
- encoding = h.getEncoding();
-
- /* file.encoding is a system property with the Sun JVM, indicating
- * the platform-default file encoding. Unfortunately, the API
- * specification for java.lang.System.getProperties() does not
- * list this property.
- */
- if (encoding == null)
- encoding = System.getProperty("file.encoding");
-
- /* Since file.encoding is not listed with the API specification of
- * java.lang.System.getProperties(), there might be some VMs that
- * do not define this system property. Therefore, we use UTF-8 as
- * a reasonable default. Please note that if the platform encoding
- * uses the same codepoints as US-ASCII for the US-ASCII character
- * set (e.g, 65 for A), it does not matter whether we emit the
- * wrong encoding into the XML header -- the GNU Classpath will
- * emit XML escape sequences like &#1234; for any non-ASCII
- * character. Virtually all character encodings use the same code
- * points as US-ASCII for ASCII characters. Probably, EBCDIC is
- * the only exception.
- */
- if (encoding == null)
- encoding = "UTF-8";
-
- /* On Windows XP localized for Swiss German (this is one of
- * my [Sascha Brawer's] test machines), the default encoding
- * has the canonical name "windows-1252". The "historical" name
- * of this encoding is "Cp1252" (see the Javadoc for the class
- * java.nio.charset.Charset for the distinction). Now, that class
- * does have a method for mapping historical to canonical encoding
- * names. However, if we used it here, we would be come dependent
- * on java.nio.*, which was only introduced with J2SE 1.4.
- * Thus, we do this little hack here. As soon as Classpath supports
- * java.nio.charset.CharSet, this hack should be replaced by
- * code that correctly canonicalizes the encoding name.
- */
- if ((encoding.length() > 2) && encoding.startsWith("Cp"))
- encoding = "windows-" + encoding.substring(2);
-
- buf.append(encoding);
-
- buf.append("\" standalone=\"no\"?>");
- buf.append(lineSep);
-
- /* SYSTEM is not a fully qualified URL so that validating
- * XML parsers do not need to connect to the Internet in
- * order to read in a log file. See also the Sun Bug Parade,
- * bug #4372790, "Logging APIs: need to use relative URL for XML
- * doctype".
- */
- buf.append("<!DOCTYPE log SYSTEM \"logger.dtd\">");
- buf.append(lineSep);
- buf.append("<log>");
- buf.append(lineSep);
-
- return buf.toString();
- }
-
-
- public String getTail(Handler h)
- {
- return "</log>" + lineSep;
- }
-}
diff --git a/libjava/java/util/prefs/AbstractPreferences.java b/libjava/java/util/prefs/AbstractPreferences.java
deleted file mode 100644
index 1c40ea8a92f..00000000000
--- a/libjava/java/util/prefs/AbstractPreferences.java
+++ /dev/null
@@ -1,1272 +0,0 @@
-/* AbstractPreferences -- Partial implementation of a Preference node
- Copyright (C) 2001, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.prefs;
-
-import gnu.java.util.prefs.NodeWriter;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.TreeSet;
-
-/**
- * Partial implementation of a Preference node.
- *
- * @since 1.4
- * @author Mark Wielaard (mark@klomp.org)
- */
-public abstract class AbstractPreferences extends Preferences {
-
- // protected fields
-
- /**
- * Object used to lock this preference node. Any thread only locks nodes
- * downwards when it has the lock on the current node. No method should
- * synchronize on the lock of any of its parent nodes while holding the
- * lock on the current node.
- */
- protected final Object lock = new Object();
-
- /**
- * Set to true in the contructor if the node did not exist in the backing
- * store when this preference node object was created. Should be set in
- * the contructor of a subclass. Defaults to false. Used to fire node
- * changed events.
- */
- protected boolean newNode = false;
-
- // private fields
-
- /**
- * The parent preferences node or null when this is the root node.
- */
- private final AbstractPreferences parent;
-
- /**
- * The name of this node.
- * Only when this is a root node (parent == null) the name is empty.
- * It has a maximum of 80 characters and cannot contain any '/' characters.
- */
- private final String name;
-
- /** True when this node has been remove, false otherwise. */
- private boolean removed = false;
-
- /**
- * Holds all the child names and nodes of this node that have been
- * accessed by earlier <code>getChild()</code> or <code>childSpi()</code>
- * invocations and that have not been removed.
- */
- private HashMap childCache = new HashMap();
-
- // constructor
-
- /**
- * Creates a new AbstractPreferences node with the given parent and name.
- *
- * @param parent the parent of this node or null when this is the root node
- * @param name the name of this node, can not be null, only 80 characters
- * maximum, must be empty when parent is null and cannot
- * contain any '/' characters
- * @exception IllegalArgumentException when name is null, greater then 80
- * characters, not the empty string but parent is null or
- * contains a '/' character
- */
- protected AbstractPreferences(AbstractPreferences parent, String name) {
- if ( (name == null) // name should be given
- || (name.length() > MAX_NAME_LENGTH) // 80 characters max
- || (parent == null && name.length() != 0) // root has no name
- || (parent != null && name.length() == 0) // all other nodes do
- || (name.indexOf('/') != -1)) // must not contain '/'
- throw new IllegalArgumentException("Illegal name argument '"
- + name
- + "' (parent is "
- + (parent == null ? "" : "not ")
- + "null)");
- this.parent = parent;
- this.name = name;
- }
-
- // identification methods
-
- /**
- * Returns the absolute path name of this preference node.
- * The absolute path name of a node is the path name of its parent node
- * plus a '/' plus its own name. If the node is the root node and has no
- * parent then its path name is "" and its absolute path name is "/".
- */
- public String absolutePath() {
- if (parent == null)
- return "/";
- else
- return parent.path() + '/' + name;
- }
-
- /**
- * Private helper method for absolutePath. Returns the empty string for a
- * root node and otherwise the parentPath of its parent plus a '/'.
- */
- private String path() {
- if (parent == null)
- return "";
- else
- return parent.path() + '/' + name;
- }
-
- /**
- * Returns true if this node comes from the user preferences tree, false
- * if it comes from the system preferences tree.
- */
- public boolean isUserNode() {
- AbstractPreferences root = this;
- while (root.parent != null)
- root = root.parent;
- return root == Preferences.userRoot();
- }
-
- /**
- * Returns the name of this preferences node. The name of the node cannot
- * be null, can be mostly 80 characters and cannot contain any '/'
- * characters. The root node has as name "".
- */
- public String name() {
- return name;
- }
-
- /**
- * Returns the String given by
- * <code>
- * (isUserNode() ? "User":"System") + " Preference Node: " + absolutePath()
- * </code>
- */
- public String toString() {
- return (isUserNode() ? "User":"System")
- + " Preference Node: "
- + absolutePath();
- }
-
- /**
- * Returns all known unremoved children of this node.
- *
- * @return All known unremoved children of this node
- */
- protected final AbstractPreferences[] cachedChildren()
- {
- return (AbstractPreferences[]) childCache.values().toArray();
- }
-
- /**
- * Returns all the direct sub nodes of this preferences node.
- * Needs access to the backing store to give a meaningfull answer.
- * <p>
- * This implementation locks this node, checks if the node has not yet
- * been removed and throws an <code>IllegalStateException</code> when it
- * has been. Then it creates a new <code>TreeSet</code> and adds any
- * already cached child nodes names. To get any uncached names it calls
- * <code>childrenNamesSpi()</code> and adds the result to the set. Finally
- * it calls <code>toArray()</code> on the created set. When the call to
- * <code>childrenNamesSpi</code> thows an <code>BackingStoreException</code>
- * this method will not catch that exception but propagate the exception
- * to the caller.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException when this node has been removed
- */
- public String[] childrenNames() throws BackingStoreException {
- synchronized(lock) {
- if (isRemoved())
- throw new IllegalStateException("Node removed");
-
- TreeSet childrenNames = new TreeSet();
-
- // First get all cached node names
- childrenNames.addAll(childCache.keySet());
-
- // Then add any others
- String names[] = childrenNamesSpi();
- for (int i = 0; i < names.length; i++) {
- childrenNames.add(names[i]);
- }
-
- // And return the array of names
- String[] children = new String[childrenNames.size()];
- childrenNames.toArray(children);
- return children;
-
- }
- }
-
- /**
- * Returns a sub node of this preferences node if the given path is
- * relative (does not start with a '/') or a sub node of the root
- * if the path is absolute (does start with a '/').
- * <p>
- * This method first locks this node and checks if the node has not been
- * removed, if it has been removed it throws an exception. Then if the
- * path is relative (does not start with a '/') it checks if the path is
- * legal (does not end with a '/' and has no consecutive '/' characters).
- * Then it recursively gets a name from the path, gets the child node
- * from the child-cache of this node or calls the <code>childSpi()</code>
- * method to create a new child sub node. This is done recursively on the
- * newly created sub node with the rest of the path till the path is empty.
- * If the path is absolute (starts with a '/') the lock on this node is
- * droped and this method is called on the root of the preferences tree
- * with as argument the complete path minus the first '/'.
- *
- * @exception IllegalStateException if this node has been removed
- * @exception IllegalArgumentException if the path contains two or more
- * consecutive '/' characters, ends with a '/' charactor and is not the
- * string "/" (indicating the root node) or any name on the path is more
- * then 80 characters long
- */
- public Preferences node(String path) {
- synchronized(lock) {
- if (isRemoved())
- throw new IllegalStateException("Node removed");
-
- // Is it a relative path?
- if (!path.startsWith("/")) {
-
- // Check if it is a valid path
- if (path.indexOf("//") != -1 || path.endsWith("/"))
- throw new IllegalArgumentException(path);
-
- return getNode(path);
- }
- }
-
- // path started with a '/' so it is absolute
- // we drop the lock and start from the root (omitting the first '/')
- Preferences root = isUserNode() ? userRoot() : systemRoot();
- return root.node(path.substring(1));
-
- }
-
- /**
- * Private helper method for <code>node()</code>. Called with this node
- * locked. Returns this node when path is the empty string, if it is not
- * empty the next node name is taken from the path (all chars till the
- * next '/' or end of path string) and the node is either taken from the
- * child-cache of this node or the <code>childSpi()</code> method is called
- * on this node with the name as argument. Then this method is called
- * recursively on the just constructed child node with the rest of the
- * path.
- *
- * @param path should not end with a '/' character and should not contain
- * consecutive '/' characters
- * @exception IllegalArgumentException if path begins with a name that is
- * larger then 80 characters.
- */
- private Preferences getNode(String path) {
- // if mark is dom then goto end
-
- // Empty String "" indicates this node
- if (path.length() == 0)
- return this;
-
- // Calculate child name and rest of path
- String childName;
- String childPath;
- int nextSlash = path.indexOf('/');
- if (nextSlash == -1) {
- childName = path;
- childPath = "";
- } else {
- childName = path.substring(0, nextSlash);
- childPath = path.substring(nextSlash+1);
- }
-
- // Get the child node
- AbstractPreferences child;
- child = (AbstractPreferences)childCache.get(childName);
- if (child == null) {
-
- if (childName.length() > MAX_NAME_LENGTH)
- throw new IllegalArgumentException(childName);
-
- // Not in childCache yet so create a new sub node
- child = childSpi(childName);
- // XXX - check if node is new
- childCache.put(childName, child);
- }
-
- // Lock the child and go down
- synchronized(child.lock) {
- return child.getNode(childPath);
- }
- }
-
- /**
- * Returns true if the node that the path points to exists in memory or
- * in the backing store. Otherwise it returns false or an exception is
- * thrown. When this node is removed the only valid parameter is the
- * empty string (indicating this node), the return value in that case
- * will be false.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has been removed
- * and the path is not the empty string (indicating this node)
- * @exception IllegalArgumentException if the path contains two or more
- * consecutive '/' characters, ends with a '/' charactor and is not the
- * string "/" (indicating the root node) or any name on the path is more
- * then 80 characters long
- */
- public boolean nodeExists(String path) throws BackingStoreException {
- synchronized(lock) {
- if (isRemoved() && path.length() != 0)
- throw new IllegalStateException("Node removed");
-
- // Is it a relative path?
- if (!path.startsWith("/")) {
-
- // Check if it is a valid path
- if (path.indexOf("//") != -1 || path.endsWith("/"))
- throw new IllegalArgumentException(path);
-
- return existsNode(path);
- }
- }
-
- // path started with a '/' so it is absolute
- // we drop the lock and start from the root (omitting the first '/')
- Preferences root = isUserNode() ? userRoot() : systemRoot();
- return root.nodeExists(path.substring(1));
-
- }
-
- private boolean existsNode(String path) throws BackingStoreException {
-
- // Empty String "" indicates this node
- if (path.length() == 0)
- return(!isRemoved());
-
- // Calculate child name and rest of path
- String childName;
- String childPath;
- int nextSlash = path.indexOf('/');
- if (nextSlash == -1) {
- childName = path;
- childPath = "";
- } else {
- childName = path.substring(0, nextSlash);
- childPath = path.substring(nextSlash+1);
- }
-
- // Get the child node
- AbstractPreferences child;
- child = (AbstractPreferences)childCache.get(childName);
- if (child == null) {
-
- if (childName.length() > MAX_NAME_LENGTH)
- throw new IllegalArgumentException(childName);
-
- // Not in childCache yet so create a new sub node
- child = getChild(childName);
-
- if (child == null)
- return false;
-
- childCache.put(childName, child);
- }
-
- // Lock the child and go down
- synchronized(child.lock) {
- return child.existsNode(childPath);
- }
- }
-
- /**
- * Returns the child sub node if it exists in the backing store or null
- * if it does not exist. Called (indirectly) by <code>nodeExists()</code>
- * when a child node name can not be found in the cache.
- * <p>
- * Gets the lock on this node, calls <code>childrenNamesSpi()</code> to
- * get an array of all (possibly uncached) children and compares the
- * given name with the names in the array. If the name is found in the
- * array <code>childSpi()</code> is called to get an instance, otherwise
- * null is returned.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- */
- protected AbstractPreferences getChild(String name)
- throws BackingStoreException
- {
- synchronized(lock) {
- // Get all the names (not yet in the cache)
- String[] names = childrenNamesSpi();
- for (int i=0; i < names.length; i++)
- if (name.equals(names[i]))
- return childSpi(name);
-
- // No child with that name found
- return null;
- }
- }
-
- /**
- * Returns true if this node has been removed with the
- * <code>removeNode()</code> method, false otherwise.
- * <p>
- * Gets the lock on this node and then returns a boolean field set by
- * <code>removeNode</code> methods.
- */
- protected boolean isRemoved() {
- synchronized(lock) {
- return removed;
- }
- }
-
- /**
- * Returns the parent preferences node of this node or null if this is
- * the root of the preferences tree.
- * <p>
- * Gets the lock on this node, checks that the node has not been removed
- * and returns the parent given to the constructor.
- *
- * @exception IllegalStateException if this node has been removed
- */
- public Preferences parent() {
- synchronized(lock) {
- if (isRemoved())
- throw new IllegalStateException("Node removed");
-
- return parent;
- }
- }
-
- // export methods
-
- /**
- * XXX
- */
- public void exportNode(OutputStream os)
- throws BackingStoreException,
- IOException
- {
- NodeWriter nodeWriter = new NodeWriter(this, os);
- nodeWriter.writePrefs();
- }
-
- /**
- * XXX
- */
- public void exportSubtree(OutputStream os)
- throws BackingStoreException,
- IOException
- {
- NodeWriter nodeWriter = new NodeWriter(this, os);
- nodeWriter.writePrefsTree();
- }
-
- // preference entry manipulation methods
-
- /**
- * Returns an (possibly empty) array with all the keys of the preference
- * entries of this node.
- * <p>
- * This method locks this node and checks if the node has not been
- * removed, if it has been removed it throws an exception, then it returns
- * the result of calling <code>keysSpi()</code>.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has been removed
- */
- public String[] keys() throws BackingStoreException {
- synchronized(lock) {
- if (isRemoved())
- throw new IllegalStateException("Node removed");
-
- return keysSpi();
- }
- }
-
-
- /**
- * Returns the value associated with the key in this preferences node. If
- * the default value of the key cannot be found in the preferences node
- * entries or something goes wrong with the backing store the supplied
- * default value is returned.
- * <p>
- * Checks that key is not null and not larger then 80 characters,
- * locks this node, and checks that the node has not been removed.
- * Then it calls <code>keySpi()</code> and returns
- * the result of that method or the given default value if it returned
- * null or throwed an exception.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public String get(String key, String defaultVal) {
- if (key.length() > MAX_KEY_LENGTH)
- throw new IllegalArgumentException(key);
-
- synchronized(lock) {
- if (isRemoved())
- throw new IllegalStateException("Node removed");
-
- String value;
- try {
- value = getSpi(key);
- } catch (ThreadDeath death) {
- throw death;
- } catch (Throwable t) {
- value = null;
- }
-
- if (value != null) {
- return value;
- } else {
- return defaultVal;
- }
- }
- }
-
- /**
- * Convenience method for getting the given entry as a boolean.
- * When the string representation of the requested entry is either
- * "true" or "false" (ignoring case) then that value is returned,
- * otherwise the given default boolean value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public boolean getBoolean(String key, boolean defaultVal) {
- String value = get(key, null);
-
- if ("true".equalsIgnoreCase(value))
- return true;
-
- if ("false".equalsIgnoreCase(value))
- return false;
-
- return defaultVal;
- }
-
- /**
- * Convenience method for getting the given entry as a byte array.
- * When the string representation of the requested entry is a valid
- * Base64 encoded string (without any other characters, such as newlines)
- * then the decoded Base64 string is returned as byte array,
- * otherwise the given default byte array value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public byte[] getByteArray(String key, byte[] defaultVal) {
- String value = get(key, null);
-
- byte[] b = null;
- if (value != null) {
- b = decode64(value);
- }
-
- if (b != null)
- return b;
- else
- return defaultVal;
- }
-
- /**
- * Helper method for decoding a Base64 string as an byte array.
- * Returns null on encoding error. This method does not allow any other
- * characters present in the string then the 65 special base64 chars.
- */
- private static byte[] decode64(String s) {
- ByteArrayOutputStream bs = new ByteArrayOutputStream((s.length()/4)*3);
- char[] c = new char[s.length()];
- s.getChars(0, s.length(), c, 0);
-
- // Convert from base64 chars
- int endchar = -1;
- for(int j = 0; j < c.length && endchar == -1; j++) {
- if (c[j] >= 'A' && c[j] <= 'Z') {
- c[j] -= 'A';
- } else if (c[j] >= 'a' && c[j] <= 'z') {
- c[j] = (char) (c[j] + 26 - 'a');
- } else if (c[j] >= '0' && c[j] <= '9') {
- c[j] = (char) (c[j] + 52 - '0');
- } else if (c[j] == '+') {
- c[j] = 62;
- } else if (c[j] == '/') {
- c[j] = 63;
- } else if (c[j] == '=') {
- endchar = j;
- } else {
- return null; // encoding exception
- }
- }
-
- int remaining = endchar == -1 ? c.length : endchar;
- int i = 0;
- while (remaining > 0) {
- // Four input chars (6 bits) are decoded as three bytes as
- // 000000 001111 111122 222222
-
- byte b0 = (byte) (c[i] << 2);
- if (remaining >= 2) {
- b0 += (c[i+1] & 0x30) >> 4;
- }
- bs.write(b0);
-
- if (remaining >= 3) {
- byte b1 = (byte) ((c[i+1] & 0x0F) << 4);
- b1 += (byte) ((c[i+2] & 0x3C) >> 2);
- bs.write(b1);
- }
-
- if (remaining >= 4) {
- byte b2 = (byte) ((c[i+2] & 0x03) << 6);
- b2 += c[i+3];
- bs.write(b2);
- }
-
- i += 4;
- remaining -= 4;
- }
-
- return bs.toByteArray();
- }
-
- /**
- * Convenience method for getting the given entry as a double.
- * When the string representation of the requested entry can be decoded
- * with <code>Double.parseDouble()</code> then that double is returned,
- * otherwise the given default double value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public double getDouble(String key, double defaultVal) {
- String value = get(key, null);
-
- if (value != null) {
- try {
- return Double.parseDouble(value);
- } catch (NumberFormatException nfe) { /* ignore */ }
- }
-
- return defaultVal;
- }
-
- /**
- * Convenience method for getting the given entry as a float.
- * When the string representation of the requested entry can be decoded
- * with <code>Float.parseFloat()</code> then that float is returned,
- * otherwise the given default float value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public float getFloat(String key, float defaultVal) {
- String value = get(key, null);
-
- if (value != null) {
- try {
- return Float.parseFloat(value);
- } catch (NumberFormatException nfe) { /* ignore */ }
- }
-
- return defaultVal;
- }
-
- /**
- * Convenience method for getting the given entry as an integer.
- * When the string representation of the requested entry can be decoded
- * with <code>Integer.parseInt()</code> then that integer is returned,
- * otherwise the given default integer value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public int getInt(String key, int defaultVal) {
- String value = get(key, null);
-
- if (value != null) {
- try {
- return Integer.parseInt(value);
- } catch (NumberFormatException nfe) { /* ignore */ }
- }
-
- return defaultVal;
- }
-
- /**
- * Convenience method for getting the given entry as a long.
- * When the string representation of the requested entry can be decoded
- * with <code>Long.parseLong()</code> then that long is returned,
- * otherwise the given default long value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public long getLong(String key, long defaultVal) {
- String value = get(key, null);
-
- if (value != null) {
- try {
- return Long.parseLong(value);
- } catch (NumberFormatException nfe) { /* ignore */ }
- }
-
- return defaultVal;
- }
-
- /**
- * Sets the value of the given preferences entry for this node.
- * Key and value cannot be null, the key cannot exceed 80 characters
- * and the value cannot exceed 8192 characters.
- * <p>
- * The result will be immediatly visible in this VM, but may not be
- * immediatly written to the backing store.
- * <p>
- * Checks that key and value are valid, locks this node, and checks that
- * the node has not been removed. Then it calls <code>putSpi()</code>.
- *
- * @exception NullPointerException if either key or value are null
- * @exception IllegalArgumentException if either key or value are to large
- * @exception IllegalStateException when this node has been removed
- */
- public void put(String key, String value) {
- if (key.length() > MAX_KEY_LENGTH
- || value.length() > MAX_VALUE_LENGTH)
- throw new IllegalArgumentException("key ("
- + key.length() + ")"
- + " or value ("
- + value.length() + ")"
- + " to large");
- synchronized(lock) {
- if (isRemoved())
- throw new IllegalStateException("Node removed");
-
- putSpi(key, value);
-
- // XXX - fire events
- }
-
- }
-
- /**
- * Convenience method for setting the given entry as a boolean.
- * The boolean is converted with <code>Boolean.toString(value)</code>
- * and then stored in the preference entry as that string.
- *
- * @exception NullPointerException if key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public void putBoolean(String key, boolean value) {
- put(key, String.valueOf(value));
- // XXX - Use when using 1.4 compatible Boolean
- // put(key, Boolean.toString(value));
- }
-
- /**
- * Convenience method for setting the given entry as an array of bytes.
- * The byte array is converted to a Base64 encoded string
- * and then stored in the preference entry as that string.
- * <p>
- * Note that a byte array encoded as a Base64 string will be about 1.3
- * times larger then the original length of the byte array, which means
- * that the byte array may not be larger about 6 KB.
- *
- * @exception NullPointerException if either key or value are null
- * @exception IllegalArgumentException if either key or value are to large
- * @exception IllegalStateException when this node has been removed
- */
- public void putByteArray(String key, byte[] value) {
- put(key, encode64(value));
- }
-
- /**
- * Helper method for encoding an array of bytes as a Base64 String.
- */
- private static String encode64(byte[] b) {
- StringBuffer sb = new StringBuffer((b.length/3)*4);
-
- int i = 0;
- int remaining = b.length;
- char c[] = new char[4];
- while (remaining > 0) {
- // Three input bytes are encoded as four chars (6 bits) as
- // 00000011 11112222 22333333
-
- c[0] = (char) ((b[i] & 0xFC) >> 2);
- c[1] = (char) ((b[i] & 0x03) << 4);
- if (remaining >= 2) {
- c[1] += (char) ((b[i+1] & 0xF0) >> 4);
- c[2] = (char) ((b[i+1] & 0x0F) << 2);
- if (remaining >= 3) {
- c[2] += (char) ((b[i+2] & 0xC0) >> 6);
- c[3] = (char) (b[i+2] & 0x3F);
- } else {
- c[3] = 64;
- }
- } else {
- c[2] = 64;
- c[3] = 64;
- }
-
- // Convert to base64 chars
- for(int j = 0; j < 4; j++) {
- if (c[j] < 26) {
- c[j] += 'A';
- } else if (c[j] < 52) {
- c[j] = (char) (c[j] - 26 + 'a');
- } else if (c[j] < 62) {
- c[j] = (char) (c[j] - 52 + '0');
- } else if (c[j] == 62) {
- c[j] = '+';
- } else if (c[j] == 63) {
- c[j] = '/';
- } else {
- c[j] = '=';
- }
- }
-
- sb.append(c);
- i += 3;
- remaining -= 3;
- }
-
- return sb.toString();
- }
-
- /**
- * Convenience method for setting the given entry as a double.
- * The double is converted with <code>Double.toString(double)</code>
- * and then stored in the preference entry as that string.
- *
- * @exception NullPointerException if the key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public void putDouble(String key, double value) {
- put(key, Double.toString(value));
- }
-
- /**
- * Convenience method for setting the given entry as a float.
- * The float is converted with <code>Float.toString(float)</code>
- * and then stored in the preference entry as that string.
- *
- * @exception NullPointerException if the key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public void putFloat(String key, float value) {
- put(key, Float.toString(value));
- }
-
- /**
- * Convenience method for setting the given entry as an integer.
- * The integer is converted with <code>Integer.toString(int)</code>
- * and then stored in the preference entry as that string.
- *
- * @exception NullPointerException if the key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public void putInt(String key, int value) {
- put(key, Integer.toString(value));
- }
-
- /**
- * Convenience method for setting the given entry as a long.
- * The long is converted with <code>Long.toString(long)</code>
- * and then stored in the preference entry as that string.
- *
- * @exception NullPointerException if the key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public void putLong(String key, long value) {
- put(key, Long.toString(value));
- }
-
- /**
- * Removes the preferences entry from this preferences node.
- * <p>
- * The result will be immediatly visible in this VM, but may not be
- * immediatly written to the backing store.
- * <p>
- * This implementation checks that the key is not larger then 80
- * characters, gets the lock of this node, checks that the node has
- * not been removed and calls <code>removeSpi</code> with the given key.
- *
- * @exception NullPointerException if the key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public void remove(String key) {
- if (key.length() > MAX_KEY_LENGTH)
- throw new IllegalArgumentException(key);
-
- synchronized(lock) {
- if (isRemoved())
- throw new IllegalStateException("Node removed");
-
- removeSpi(key);
- }
- }
-
- /**
- * Removes all entries from this preferences node. May need access to the
- * backing store to get and clear all entries.
- * <p>
- * The result will be immediatly visible in this VM, but may not be
- * immediatly written to the backing store.
- * <p>
- * This implementation locks this node, checks that the node has not been
- * removed and calls <code>keys()</code> to get a complete array of keys
- * for this node. For every key found <code>removeSpi()</code> is called.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has been removed
- */
- public void clear() throws BackingStoreException {
- synchronized(lock) {
- if (isRemoved())
- throw new IllegalStateException("Node Removed");
-
- String[] keys = keys();
- for (int i = 0; i < keys.length; i++) {
- removeSpi(keys[i]);
- }
- }
- }
-
- /**
- * Writes all preference changes on this and any subnode that have not
- * yet been written to the backing store. This has no effect on the
- * preference entries in this VM, but it makes sure that all changes
- * are visible to other programs (other VMs might need to call the
- * <code>sync()</code> method to actually see the changes to the backing
- * store.
- * <p>
- * Locks this node, calls the <code>flushSpi()</code> method, gets all
- * the (cached - already existing in this VM) subnodes and then calls
- * <code>flushSpi()</code> on every subnode with this node unlocked and
- * only that particular subnode locked.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- */
- public void flush() throws BackingStoreException {
- flushNode(false);
- }
-
- /**
- * Writes and reads all preference changes to and from this and any
- * subnodes. This makes sure that all local changes are written to the
- * backing store and that all changes to the backing store are visible
- * in this preference node (and all subnodes).
- * <p>
- * Checks that this node is not removed, locks this node, calls the
- * <code>syncSpi()</code> method, gets all the subnodes and then calls
- * <code>syncSpi()</code> on every subnode with this node unlocked and
- * only that particular subnode locked.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has been removed
- */
- public void sync() throws BackingStoreException {
- flushNode(true);
- }
-
-
- /**
- * Private helper method that locks this node and calls either
- * <code>flushSpi()</code> if <code>sync</code> is false, or
- * <code>flushSpi()</code> if <code>sync</code> is true. Then it gets all
- * the currently cached subnodes. For every subnode it calls this method
- * recursively with this node no longer locked.
- * <p>
- * Called by either <code>flush()</code> or <code>sync()</code>
- */
- private void flushNode(boolean sync) throws BackingStoreException {
- String[] keys = null;
- synchronized(lock) {
- if (sync) {
- syncSpi();
- } else {
- flushSpi();
- }
- keys = (String[]) childCache.keySet().toArray();
- }
-
- if (keys != null) {
- for (int i = 0; i < keys.length; i++) {
- // Have to lock this node again to access the childCache
- AbstractPreferences subNode;
- synchronized(this) {
- subNode = (AbstractPreferences) childCache.get(keys[i]);
- }
-
- // The child could already have been removed from the cache
- if (subNode != null) {
- subNode.flushNode(sync);
- }
- }
- }
- }
-
- /**
- * Removes this and all subnodes from the backing store and clears all
- * entries. After removal this instance will not be useable (except for
- * a few methods that don't throw a <code>InvalidStateException</code>),
- * even when a new node with the same path name is created this instance
- * will not be usable again.
- * <p>
- * Checks that this is not a root node. If not it locks the parent node,
- * then locks this node and checks that the node has not yet been removed.
- * Then it makes sure that all subnodes of this node are in the child cache,
- * by calling <code>childSpi()</code> on any children not yet in the cache.
- * Then for all children it locks the subnode and removes it. After all
- * subnodes have been purged the child cache is cleared, this nodes removed
- * flag is set and any listeners are called. Finally this node is removed
- * from the child cache of the parent node.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has already been removed
- * @exception UnsupportedOperationException if this is a root node
- */
- public void removeNode() throws BackingStoreException {
- // Check if it is a root node
- if (parent == null)
- throw new UnsupportedOperationException("Cannot remove root node");
-
- synchronized(parent) {
- synchronized(this) {
- if (isRemoved())
- throw new IllegalStateException("Node Removed");
-
- purge();
- }
- parent.childCache.remove(name);
- }
- }
-
- /**
- * Private helper method used to completely remove this node.
- * Called by <code>removeNode</code> with the parent node and this node
- * locked.
- * <p>
- * Makes sure that all subnodes of this node are in the child cache,
- * by calling <code>childSpi()</code> on any children not yet in the
- * cache. Then for all children it locks the subnode and calls this method
- * on that node. After all subnodes have been purged the child cache is
- * cleared, this nodes removed flag is set and any listeners are called.
- */
- private void purge() throws BackingStoreException
- {
- // Make sure all children have an AbstractPreferences node in cache
- String children[] = childrenNamesSpi();
- for (int i = 0; i < children.length; i++) {
- if (childCache.get(children[i]) == null)
- childCache.put(children[i], childSpi(children[i]));
- }
-
- // purge all children
- Iterator i = childCache.values().iterator();
- while (i.hasNext()) {
- AbstractPreferences node = (AbstractPreferences) i.next();
- synchronized(node) {
- node.purge();
- }
- }
-
- // Cache is empty now
- childCache.clear();
-
- // remove this node
- removeNodeSpi();
- removed = true;
-
- // XXX - check for listeners
- }
-
- // listener methods
-
- /**
- * XXX
- */
- public void addNodeChangeListener(NodeChangeListener listener) {
- // XXX
- }
-
- public void addPreferenceChangeListener(PreferenceChangeListener listener) {
- // XXX
- }
-
- public void removeNodeChangeListener(NodeChangeListener listener) {
- // XXX
- }
-
- public void removePreferenceChangeListener
- (PreferenceChangeListener listener)
- {
- // XXX
- }
-
- // abstract spi methods
-
- /**
- * Returns the names of the sub nodes of this preference node.
- * This method only has to return any not yet cached child names,
- * but may return all names if that is easier. It must not return
- * null when there are no children, it has to return an empty array
- * in that case. Since this method must consult the backing store to
- * get all the sub node names it may throw a BackingStoreException.
- * <p>
- * Called by <code>childrenNames()</code> with this node locked.
- */
- protected abstract String[] childrenNamesSpi() throws BackingStoreException;
-
- /**
- * Returns a child note with the given name.
- * This method is called by the <code>node()</code> method (indirectly
- * through the <code>getNode()</code> helper method) with this node locked
- * if a sub node with this name does not already exist in the child cache.
- * If the child node did not aleady exist in the backing store the boolean
- * field <code>newNode</code> of the returned node should be set.
- * <p>
- * Note that this method should even return a non-null child node if the
- * backing store is not available since it may not throw a
- * <code>BackingStoreException</code>.
- */
- protected abstract AbstractPreferences childSpi(String name);
-
- /**
- * Returns an (possibly empty) array with all the keys of the preference
- * entries of this node.
- * <p>
- * Called by <code>keys()</code> with this node locked if this node has
- * not been removed. May throw an exception when the backing store cannot
- * be accessed.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- */
- protected abstract String[] keysSpi() throws BackingStoreException;
-
- /**
- * Returns the value associated with the key in this preferences node or
- * null when the key does not exist in this preferences node.
- * <p>
- * Called by <code>key()</code> with this node locked after checking that
- * key is valid, not null and that the node has not been removed.
- * <code>key()</code> will catch any exceptions that this method throws.
- */
- protected abstract String getSpi(String key);
-
- /**
- * Sets the value of the given preferences entry for this node.
- * The implementation is not required to propagate the change to the
- * backing store immediatly. It may not throw an exception when it tries
- * to write to the backing store and that operation fails, the failure
- * should be registered so a later invocation of <code>flush()</code>
- * or <code>sync()</code> can signal the failure.
- * <p>
- * Called by <code>put()</code> with this node locked after checking that
- * key and value are valid and non-null.
- */
- protected abstract void putSpi(String key, String value);
-
- /**
- * Removes the given key entry from this preferences node.
- * The implementation is not required to propagate the change to the
- * backing store immediatly. It may not throw an exception when it tries
- * to write to the backing store and that operation fails, the failure
- * should be registered so a later invocation of <code>flush()</code>
- * or <code>sync()</code> can signal the failure.
- * <p>
- * Called by <code>remove()</code> with this node locked after checking
- * that the key is valid and non-null.
- */
- protected abstract void removeSpi(String key);
-
- /**
- * Writes all entries of this preferences node that have not yet been
- * written to the backing store and possibly creates this node in the
- * backing store, if it does not yet exist. Should only write changes to
- * this node and not write changes to any subnodes.
- * Note that the node can be already removed in this VM. To check if
- * that is the case the implementation can call <code>isRemoved()</code>.
- * <p>
- * Called (indirectly) by <code>flush()</code> with this node locked.
- */
- protected abstract void flushSpi() throws BackingStoreException;
-
- /**
- * Writes all entries of this preferences node that have not yet been
- * written to the backing store and reads any entries that have changed
- * in the backing store but that are not yet visible in this VM.
- * Should only sync this node and not change any of the subnodes.
- * Note that the node can be already removed in this VM. To check if
- * that is the case the implementation can call <code>isRemoved()</code>.
- * <p>
- * Called (indirectly) by <code>sync()</code> with this node locked.
- */
- protected abstract void syncSpi() throws BackingStoreException;
-
- /**
- * Clears this node from this VM and removes it from the backing store.
- * After this method has been called the node is marked as removed.
- * <p>
- * Called (indirectly) by <code>removeNode()</code> with this node locked
- * after all the sub nodes of this node have already been removed.
- */
- protected abstract void removeNodeSpi() throws BackingStoreException;
-}
diff --git a/libjava/java/util/prefs/BackingStoreException.java b/libjava/java/util/prefs/BackingStoreException.java
deleted file mode 100644
index 0ba358a5688..00000000000
--- a/libjava/java/util/prefs/BackingStoreException.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* BackingStoreException.java - chained exception thrown when backing store
- fails
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.prefs;
-
-import java.io.NotSerializableException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-/**
- * Chained exception thrown when backing store fails. This exception is
- * only thrown from methods that actually have to access the backing store,
- * such as <code>clear(), keys(), childrenNames(), nodeExists(), removeNode(),
- * flush(), sync(), exportNode(), exportSubTree()</code>; normal operations
- * do not throw BackingStoreExceptions.
- *
- * <p>Note that although this class inherits the Serializable interface, an
- * attempt to serialize will fail with a <code>NotSerializableException</code>.
- *
- * @author Mark Wielaard (mark@klomp.org)
- * @since 1.4
- * @status updated to 1.4
- */
-public class BackingStoreException extends Exception
-{
- static final long serialVersionUID = 859796500401108469L;
-
- /**
- * Creates a new exception with a descriptive message.
- *
- * @param message the message
- */
- public BackingStoreException(String message)
- {
- super(message);
- }
-
- /**
- * Create a new exception with the given cause.
- *
- * @param cause the cause
- */
- public BackingStoreException(Throwable cause)
- {
- super(cause);
- }
-
- /**
- * This class should not be serialized.
- *
- * @param o the output stream
- */
- private void writeObject(ObjectOutputStream o) throws NotSerializableException
- {
- throw new NotSerializableException
- ("java.util.prefs.BackingStoreException");
- }
-
- /**
- * This class should not be serialized.
- *
- * @param i the input stream
- */
- private void readObject(ObjectInputStream i) throws NotSerializableException
- {
- throw new NotSerializableException
- ("java.util.prefs.BackingStoreException");
- }
-}
diff --git a/libjava/java/util/prefs/InvalidPreferencesFormatException.java b/libjava/java/util/prefs/InvalidPreferencesFormatException.java
deleted file mode 100644
index f929b56f68e..00000000000
--- a/libjava/java/util/prefs/InvalidPreferencesFormatException.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/* InvalidPreferencesFormatException - indicates reading prefs from stream
- failed
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.prefs;
-
-import java.io.NotSerializableException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-/**
- * Indicates reading prefs from stream failed. Thrown by the
- * <code>importPreferences()</code> method when the supplied input stream
- * could not be read because it was not in the correct XML format.
- *
- * <p>Note that although this class inherits the Serializable interface, an
- * attempt to serialize will fail with a <code>NotSerializableException</code>.
- * </p>
- *
- * @author Mark Wielaard (mark@klomp.org)
- * @see Preferences
- * @since 1.4
- * @status updated to 1.4
- */
-public class InvalidPreferencesFormatException extends Exception
-{
- static final long serialVersionUID = -791715184232119669L;
-
- /**
- * Creates a new exception with a descriptive message. The cause remains
- * uninitialized.
- *
- * @param message the message
- */
- public InvalidPreferencesFormatException(String message)
- {
- super(message);
- }
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param cause the cause
- */
- public InvalidPreferencesFormatException(Throwable cause)
- {
- super(cause);
- }
-
- /**
- * Creates a new exception with a descriptive message and a cause.
- *
- * @param message the message
- * @param cause the cause
- */
- public InvalidPreferencesFormatException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- /**
- * This class should not be serialized.
- *
- * @param o the output stream
- */
- private void writeObject(ObjectOutputStream o) throws NotSerializableException
- {
- throw new NotSerializableException
- ("java.util.prefs.InvalidPreferencesFormatException");
- }
-
- /**
- * This class should not be serialized.
- *
- * @param i the input stream
- */
- private void readObject(ObjectInputStream i) throws NotSerializableException
- {
- throw new NotSerializableException
- ("java.util.prefs.InvalidPreferencesFormatException");
- }
-}
diff --git a/libjava/java/util/prefs/NodeChangeEvent.java b/libjava/java/util/prefs/NodeChangeEvent.java
deleted file mode 100644
index 89986db88b3..00000000000
--- a/libjava/java/util/prefs/NodeChangeEvent.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/* NodeChangeEvent - ObjectEvent fired when a Preference node is added/removed
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.prefs;
-
-import java.util.EventObject;
-
-/**
- * ObjectEvent fired when a Preference node is added/removed.
- * This event is only generated when a new subnode is added or a subnode is
- * removed from a preference node. Changes in the entries of a preference node
- * are indicated with a <code>PreferenceChangeEvent</code>.
- *
- * @since 1.4
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class NodeChangeEvent extends EventObject {
-
- private static final long serialVersionUID =8068949086596572957L;
-
- /**
- * The sub node that was added or removed.
- * Defined transient just like <code>EventObject.source</code> since
- * this object should be serializable, but Preferences is in general not
- * serializable.
- */
- private final transient Preferences child;
-
- /**
- * Creates a new NodeChangeEvent.
- *
- * @param parentNode The source preference node from which a subnode was
- * added or removed
- * @param childNode The preference node that was added or removed
- */
- public NodeChangeEvent(Preferences parentNode, Preferences childNode) {
- super(parentNode);
- child = childNode;
- }
-
- /**
- * Returns the source parent preference node from which a subnode was
- * added or removed.
- */
- public Preferences getParent() {
- return (Preferences) source;
- }
-
- /**
- * Returns the child preference subnode that was added or removed.
- * To see wether it is still a valid preference node one has to call
- * <code>event.getChild().nodeExists("")</code>.
- */
- public Preferences getChild() {
- return child;
- }
-}
diff --git a/libjava/java/util/prefs/NodeChangeListener.java b/libjava/java/util/prefs/NodeChangeListener.java
deleted file mode 100644
index 19664c6652d..00000000000
--- a/libjava/java/util/prefs/NodeChangeListener.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* NodeChangeListener - EventListener for Preferences node addition/removal
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.prefs;
-
-import java.util.EventListener;
-
-/**
- * EventListener for Preferences node addition/removal.
- * <p>
- * Note that these events are only generated for the addition and removal
- * of sub nodes from the preference node. Entry changes in the preference
- * node can be monitored with a <code>PreferenceChangeListener</code>.
- *
- * @since 1.4
- * @author Mark Wielaard (mark@klomp.org)
- */
-public interface NodeChangeListener extends EventListener {
-
- /**
- * Fired when a sub node is added to the preference node.
- */
- void childAdded(NodeChangeEvent event);
-
- /**
- * Fired when a sub node is removed from the preference node.
- */
- void childRemoved(NodeChangeEvent event);
-
-}
diff --git a/libjava/java/util/prefs/PreferenceChangeEvent.java b/libjava/java/util/prefs/PreferenceChangeEvent.java
deleted file mode 100644
index fe371f15e4e..00000000000
--- a/libjava/java/util/prefs/PreferenceChangeEvent.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/* PreferenceChangeEvent - ObjectEvent fired when a Preferences entry changes
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.prefs;
-
-import java.util.EventObject;
-
-/**
- * ObjectEvent fired when a Preferences entry changes.
- * This event is generated when a entry is added, changed or removed.
- * When an entry is removed then <code>getNewValue</code> will return null.
- * <p>
- * Preference change events are only generated for entries in one particular
- * preference node. Notification of subnode addition/removal is given by a
- * <code>NodeChangeEvent</code>.
- *
- * @since 1.4
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class PreferenceChangeEvent extends EventObject {
-
- private static final long serialVersionUID = 793724513368024975L;
-
- /**
- * The key of the changed entry.
- */
- private final String key;
-
- /**
- * The new value of the changed entry, or null when the entry was removed.
- */
- private final String newValue;
-
- /**
- * Creates a new PreferenceChangeEvent.
- *
- * @param node The source preference node for which an entry was added,
- * changed or removed
- * @param key The key of the entry that was added, changed or removed
- * @param value The new value of the entry that was added or changed, or
- * null when the entry was removed
- */
- public PreferenceChangeEvent(Preferences node, String key, String value) {
- super(node);
- this.key = key;
- this.newValue = value;
- }
-
- /**
- * Returns the source Preference node from which an entry was added,
- * changed or removed.
- */
- public Preferences getNode() {
- return (Preferences) source;
- }
-
- /**
- * Returns the key of the entry that was added, changed or removed.
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Returns the new value of the entry that was added or changed, or
- * returns null when the entry was removed.
- */
- public String getNewValue() {
- return newValue;
- }
-}
diff --git a/libjava/java/util/prefs/PreferenceChangeListener.java b/libjava/java/util/prefs/PreferenceChangeListener.java
deleted file mode 100644
index adff3582079..00000000000
--- a/libjava/java/util/prefs/PreferenceChangeListener.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* PreferenceChangeListener - EventListener for Preferences entry changes
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.prefs;
-
-import java.util.EventListener;
-
-/**
- * EventListener for Preferences entry addition, change or removal.
- * <p>
- * Preference change events are only generated for entries in one particular
- * preference node. Notification of subnode addition/removal can be monitored
- * with a <code>NodeChangeListener</code>.
- *
- * @since 1.4
- * @author Mark Wielaard (mark@klomp.org)
- */
-public interface PreferenceChangeListener extends EventListener {
-
- /**
- * Fired when a entry has been added, changed or removed from the
- * preference node.
- */
- void preferenceChange(PreferenceChangeEvent event);
-
-}
diff --git a/libjava/java/util/prefs/Preferences.java b/libjava/java/util/prefs/Preferences.java
deleted file mode 100644
index c407ae6127a..00000000000
--- a/libjava/java/util/prefs/Preferences.java
+++ /dev/null
@@ -1,668 +0,0 @@
-/* Preferences -- Preference node containing key value entries and subnodes
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.prefs;
-
-import gnu.java.util.prefs.NodeReader;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.security.AccessController;
-import java.security.Permission;
-import java.security.PrivilegedAction;
-
-/**
- * Preference node containing key value entries and subnodes.
- * <p>
- * There are two preference node trees, a system tree which can be accessed
- * by calling <code>systemRoot()</code> containing system preferences usefull
- * for all users, and a user tree that can be accessed by calling
- * <code>userRoot()</code> containing preferences that can differ between
- * different users. How different users are identified is implementation
- * depended. It can be determined by Thread, Access Control Context or Subject.
- * <p>
- * This implementation uses the "java.util.prefs.PreferencesFactory" system
- * property to find a class that implement <code>PreferencesFactory</code>
- * and initialized that class (if it has a public no arguments contructor)
- * to get at the actual system or user root. If the system property is not set,
- * or the class cannot be initialized it uses the default implementation
- * <code>gnu.java.util.prefs.FileBasedFactory</code>.
- * <p>
- * Besides the two static method above to get the roots of the system and user
- * preference node trees there are also two convenience methods to access the
- * default preference node for a particular package an object is in. These are
- * <code>userNodeForPackage()</code> and <code>systemNodeForPackage()</code>.
- * Both methods take an Object as an argument so accessing preferences values
- * can be as easy as calling <code>Preferences.userNodeForPackage(this)</code>.
- * <p>
- * Note that if a security manager is installed all static methods check for
- * <code>RuntimePermission("preferences")</code>. But if this permission is
- * given to the code then it can access and change all (user) preference nodes
- * and entries. So you should be carefull not to store to sensitive information
- * or make security decissions based on preference values since there is no
- * more fine grained control over what preference values can be changed once
- * code has been given the correct runtime permission.
- * <p>
- * XXX
- *
- * @since 1.4
- * @author Mark Wielaard (mark@klomp.org)
- */
-public abstract class Preferences {
-
- // Static Fields
-
- /**
- * Default PreferencesFactory class used when the system property
- * "java.util.prefs.PreferencesFactory" is not set.
- * <p>
- * XXX - Currently set to MemoryBasedFactory, should be changed
- * when FileBasedPreferences backend works.
- */
- private static final String defaultFactoryClass
- = "gnu.java.util.prefs.MemoryBasedFactory";
-
- /** Permission needed to access system or user root. */
- private static final Permission prefsPermission
- = new RuntimePermission("preferences");
-
- /**
- * The preferences factory object that supplies the system and user root.
- * Set and returned by the getFactory() method.
- */
- private static PreferencesFactory factory;
-
- /** Maximum node name length. 80 characters. */
- public static final int MAX_NAME_LENGTH = 80;
-
- /** Maximum entry key length. 80 characters. */
- public static final int MAX_KEY_LENGTH = 80;
-
- /** Maximum entry value length. 8192 characters. */
- public static final int MAX_VALUE_LENGTH = 8192;
-
- // Constructors
-
- /**
- * Creates a new Preferences node. Can only be used by subclasses.
- * Empty implementation.
- */
- protected Preferences() {}
-
- // Static methods
-
- /**
- * Returns the system preferences root node containing usefull preferences
- * for all users. It is save to cache this value since it should always
- * return the same preference node.
- *
- * @return the root system preference node
- * @exception SecurityException when a security manager is installed and
- * the caller does not have <code>RuntimePermission("preferences")</code>.
- */
- public static Preferences systemRoot() throws SecurityException {
- // Get the preferences factory and check for permission
- PreferencesFactory factory = getFactory();
-
- return factory.systemRoot();
- }
-
- /**
- * Returns the user preferences root node containing preferences for the
- * the current user. How different users are identified is implementation
- * depended. It can be determined by Thread, Access Control Context or
- * Subject.
- *
- * @return the root user preference node
- * @exception SecurityException when a security manager is installed and
- * the caller does not have <code>RuntimePermission("preferences")</code>.
- */
- public static Preferences userRoot() throws SecurityException {
- // Get the preferences factory and check for permission
- PreferencesFactory factory = getFactory();
- return factory.userRoot();
- }
-
- /**
- * Private helper method for <code>systemRoot()</code> and
- * <code>userRoot()</code>. Checks security permission and instantiates the
- * correct factory if it has not yet been set.
- * <p>
- * When the preferences factory has not yet been set this method first
- * tries to get the system propery "java.util.prefs.PreferencesFactory"
- * and tries to initializes that class. If the system property is not set
- * or initialization fails it returns an instance of the default factory
- * <code>gnu.java.util.prefs.FileBasedPreferencesFactory</code>.
- *
- * @return the preferences factory to use
- * @exception SecurityException when a security manager is installed and
- * the caller does not have <code>RuntimePermission("preferences")</code>.
- */
- private static PreferencesFactory getFactory() throws SecurityException {
-
- // First check for permission
- SecurityManager sm = System.getSecurityManager();
- if (sm != null) {
- sm.checkPermission(prefsPermission);
- }
-
- // Get the factory
- if (factory == null) {
- // Caller might not have enough permissions
- factory = (PreferencesFactory) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
- PreferencesFactory pf = null;
- String className = System.getProperty
- ("java.util.prefs.PreferencesFactory");
- if (className != null) {
- try {
- Class fc = Class.forName(className);
- Object o = fc.newInstance();
- pf = (PreferencesFactory) o;
- } catch (ClassNotFoundException cnfe)
- {/*ignore*/}
- catch (InstantiationException ie)
- {/*ignore*/}
- catch (IllegalAccessException iae)
- {/*ignore*/}
- catch (ClassCastException cce)
- {/*ignore*/}
- }
- return pf;
- }
- });
-
- // Still no factory? Use our default.
- if (factory == null)
- {
- try
- {
- Class cls = Class.forName (defaultFactoryClass);
- factory = (PreferencesFactory) cls.newInstance();
- }
- catch (Exception e)
- {
- throw new RuntimeException ("Couldn't load default factory"
- + " '"+ defaultFactoryClass +"'");
- // XXX - when using 1.4 compatible throwables add cause
- }
- }
-
- }
-
- return factory;
- }
-
- /**
- * Returns the system preferences node for the package of an object.
- * The package node name of the object is determined by dropping the
- * class name of the object of the fully quallified class name and
- * replacing all '.' to '/' in the package name. If the class of the
- * object has no package then the package node name is "&lt;unnamed&gt;".
- * The returened node is <code>systemRoot().node(packageNodeName)</code>.
- *
- * @param o Object whose default system preference node is requested
- * @returns system preferences node that should be used by object o
- * @exception SecurityException when a security manager is installed and
- * the caller does not have <code>RuntimePermission("preferences")</code>.
- */
- public static Preferences systemNodeForPackage(Class c)
- throws SecurityException
- {
- return nodeForPackage(c, systemRoot());
- }
-
- /**
- * Returns the user preferences node for the package of an object.
- * The package node name of the object is determined by dropping the
- * class name of the object of the fully quallified class name and
- * replacing all '.' to '/' in the package name. If the class of the
- * object has no package then the package node name is "&lt;unnamed&gt;".
- * The returened node is <code>userRoot().node(packageNodeName)</code>.
- *
- * @param o Object whose default user preference node is requested
- * @returns user preferences node that should be used by object o
- * @exception SecurityException when a security manager is installed and
- * the caller does not have <code>RuntimePermission("preferences")</code>.
- */
- public static Preferences userNodeForPackage(Class c)
- throws SecurityException
- {
- return nodeForPackage(c, userRoot());
- }
-
- /**
- * Private helper method for <code>systemNodeForPackage()</code> and
- * <code>userNodeForPackage()</code>. Given the correct system or user
- * root it returns the correct Preference node for the package node name
- * of the given object.
- */
- private static Preferences nodeForPackage(Class c, Preferences root) {
- // Get the package path
- String className = c.getName();
- String packagePath;
- int index = className.lastIndexOf('.');
- if(index == -1) {
- packagePath = "<unnamed>";
- } else {
- packagePath = className.substring(0,index).replace('.','/');
- }
-
- return root.node(packagePath);
- }
-
- /**
- * XXX
- */
- public static void importPreferences(InputStream is)
- throws InvalidPreferencesFormatException,
- IOException
- {
- PreferencesFactory factory = getFactory();
- NodeReader reader = new NodeReader(is, factory);
- reader.importPreferences();
- }
-
- // abstract methods (identification)
-
- /**
- * Returns the absolute path name of this preference node.
- * The absolute path name of a node is the path name of its parent node
- * plus a '/' plus its own name. If the node is the root node and has no
- * parent then its name is "" and its absolute path name is "/".
- */
- public abstract String absolutePath();
-
- /**
- * Returns true if this node comes from the user preferences tree, false
- * if it comes from the system preferences tree.
- */
- public abstract boolean isUserNode();
-
- /**
- * Returns the name of this preferences node. The name of the node cannot
- * be null, can be mostly 80 characters and cannot contain any '/'
- * characters. The root node has as name "".
- */
- public abstract String name();
-
- /**
- * Returns the String given by
- * <code>
- * (isUserNode() ? "User":"System") + " Preference Node: " + absolutePath()
- * </code>
- */
- public abstract String toString();
-
- // abstract methods (navigation)
-
- /**
- * Returns all the direct sub nodes of this preferences node.
- * Needs access to the backing store to give a meaningfull answer.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException when this node has been removed
- */
- public abstract String[] childrenNames() throws BackingStoreException;
-
- /**
- * Returns a sub node of this preferences node if the given path is
- * relative (does not start with a '/') or a sub node of the root
- * if the path is absolute (does start with a '/').
- *
- * @exception IllegalStateException if this node has been removed
- * @exception IllegalArgumentException if the path contains two or more
- * consecutive '/' characters, ends with a '/' charactor and is not the
- * string "/" (indicating the root node) or any name on the path is more
- * then 80 characters long
- */
- public abstract Preferences node(String path);
-
- /**
- * Returns true if the node that the path points to exists in memory or
- * in the backing store. Otherwise it returns false or an exception is
- * thrown. When this node is removed the only valid parameter is the
- * empty string (indicating this node), the return value in that case
- * will be false.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has been removed
- * and the path is not the empty string (indicating this node)
- * @exception IllegalArgumentException if the path contains two or more
- * consecutive '/' characters, ends with a '/' charactor and is not the
- * string "/" (indicating the root node) or any name on the path is more
- * then 80 characters long
- */
- public abstract boolean nodeExists(String path)
- throws BackingStoreException;
-
- /**
- * Returns the parent preferences node of this node or null if this is
- * the root of the preferences tree.
- *
- * @exception IllegalStateException if this node has been removed
- */
- public abstract Preferences parent();
-
- // abstract methods (export)
-
- /**
- * XXX
- */
- public abstract void exportNode(OutputStream os)
- throws BackingStoreException,
- IOException;
-
- /**
- * XXX
- */
- public abstract void exportSubtree(OutputStream os)
- throws BackingStoreException,
- IOException;
-
- // abstract methods (preference entry manipulation)
-
- /**
- * Returns an (possibly empty) array with all the keys of the preference
- * entries of this node.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has been removed
- */
- public abstract String[] keys() throws BackingStoreException;
-
- /**
- * Returns the value associated with the key in this preferences node. If
- * the default value of the key cannot be found in the preferences node
- * entries or something goes wrong with the backing store the supplied
- * default value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public abstract String get(String key, String defaultVal);
-
- /**
- * Convenience method for getting the given entry as a boolean.
- * When the string representation of the requested entry is either
- * "true" or "false" (ignoring case) then that value is returned,
- * otherwise the given default boolean value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public abstract boolean getBoolean(String key, boolean defaultVal);
-
- /**
- * Convenience method for getting the given entry as a byte array.
- * When the string representation of the requested entry is a valid
- * Base64 encoded string (without any other characters, such as newlines)
- * then the decoded Base64 string is returned as byte array,
- * otherwise the given default byte array value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public abstract byte[] getByteArray(String key, byte[] defaultVal);
-
- /**
- * Convenience method for getting the given entry as a double.
- * When the string representation of the requested entry can be decoded
- * with <code>Double.parseDouble()</code> then that double is returned,
- * otherwise the given default double value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public abstract double getDouble(String key, double defaultVal);
-
- /**
- * Convenience method for getting the given entry as a float.
- * When the string representation of the requested entry can be decoded
- * with <code>Float.parseFloat()</code> then that float is returned,
- * otherwise the given default float value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public abstract float getFloat(String key, float defaultVal);
-
- /**
- * Convenience method for getting the given entry as an integer.
- * When the string representation of the requested entry can be decoded
- * with <code>Integer.parseInt()</code> then that integer is returned,
- * otherwise the given default integer value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public abstract int getInt(String key, int defaultVal);
-
- /**
- * Convenience method for getting the given entry as a long.
- * When the string representation of the requested entry can be decoded
- * with <code>Long.parseLong()</code> then that long is returned,
- * otherwise the given default long value is returned.
- *
- * @exception IllegalArgumentException if key is larger then 80 characters
- * @exception IllegalStateException if this node has been removed
- * @exception NullPointerException if key is null
- */
- public abstract long getLong(String key, long defaultVal);
-
- /**
- * Sets the value of the given preferences entry for this node.
- * Key and value cannot be null, the key cannot exceed 80 characters
- * and the value cannot exceed 8192 characters.
- * <p>
- * The result will be immediatly visible in this VM, but may not be
- * immediatly written to the backing store.
- *
- * @exception NullPointerException if either key or value are null
- * @exception IllegalArgumentException if either key or value are to large
- * @exception IllegalStateException when this node has been removed
- */
- public abstract void put(String key, String value);
-
- /**
- * Convenience method for setting the given entry as a boolean.
- * The boolean is converted with <code>Boolean.toString(value)</code>
- * and then stored in the preference entry as that string.
- *
- * @exception NullPointerException if key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public abstract void putBoolean(String key, boolean value);
-
- /**
- * Convenience method for setting the given entry as an array of bytes.
- * The byte array is converted to a Base64 encoded string
- * and then stored in the preference entry as that string.
- * <p>
- * Note that a byte array encoded as a Base64 string will be about 1.3
- * times larger then the original length of the byte array, which means
- * that the byte array may not be larger about 6 KB.
- *
- * @exception NullPointerException if either key or value are null
- * @exception IllegalArgumentException if either key or value are to large
- * @exception IllegalStateException when this node has been removed
- */
- public abstract void putByteArray(String key, byte[] value);
-
- /**
- * Convenience method for setting the given entry as a double.
- * The double is converted with <code>Double.toString(double)</code>
- * and then stored in the preference entry as that string.
- *
- * @exception NullPointerException if the key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public abstract void putDouble(String key, double value);
-
- /**
- * Convenience method for setting the given entry as a float.
- * The float is converted with <code>Float.toString(float)</code>
- * and then stored in the preference entry as that string.
- *
- * @exception NullPointerException if the key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public abstract void putFloat(String key, float value);
-
- /**
- * Convenience method for setting the given entry as an integer.
- * The integer is converted with <code>Integer.toString(int)</code>
- * and then stored in the preference entry as that string.
- *
- * @exception NullPointerException if the key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public abstract void putInt(String key, int value);
-
- /**
- * Convenience method for setting the given entry as a long.
- * The long is converted with <code>Long.toString(long)</code>
- * and then stored in the preference entry as that string.
- *
- * @exception NullPointerException if the key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public abstract void putLong(String key, long value);
-
- /**
- * Removes the preferences entry from this preferences node.
- * <p>
- * The result will be immediatly visible in this VM, but may not be
- * immediatly written to the backing store.
- *
- * @exception NullPointerException if the key is null
- * @exception IllegalArgumentException if the key length is to large
- * @exception IllegalStateException when this node has been removed
- */
- public abstract void remove(String key);
-
- // abstract methods (preference node manipulation)
-
- /**
- * Removes all entries from this preferences node. May need access to the
- * backing store to get and clear all entries.
- * <p>
- * The result will be immediatly visible in this VM, but may not be
- * immediatly written to the backing store.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has been removed
- */
- public abstract void clear() throws BackingStoreException;
-
- /**
- * Writes all preference changes on this and any subnode that have not
- * yet been written to the backing store. This has no effect on the
- * preference entries in this VM, but it makes sure that all changes
- * are visible to other programs (other VMs might need to call the
- * <code>sync()</code> method to actually see the changes to the backing
- * store.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has been removed
- */
- public abstract void flush() throws BackingStoreException;
-
- /**
- * Writes and reads all preference changes to and from this and any
- * subnodes. This makes sure that all local changes are written to the
- * backing store and that all changes to the backing store are visible
- * in this preference node (and all subnodes).
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has been removed
- */
- public abstract void sync() throws BackingStoreException;
-
- /**
- * Removes this and all subnodes from the backing store and clears all
- * entries. After removal this instance will not be useable (except for
- * a few methods that don't throw a <code>InvalidStateException</code>),
- * even when a new node with the same path name is created this instance
- * will not be usable again. The root (system or user) may never be removed.
- * <p>
- * Note that according to the specification an implementation may delay
- * removal of the node from the backing store till the <code>flush()</code>
- * method is called. But the <code>flush()</code> method may throw a
- * <code>IllegalStateException</code> when the node has been removed.
- * So most implementations will actually remove the node and any subnodes
- * from the backing store immediatly.
- *
- * @exception BackingStoreException when the backing store cannot be
- * reached
- * @exception IllegalStateException if this node has already been removed
- * @exception UnsupportedOperationException if this is a root node
- */
- public abstract void removeNode() throws BackingStoreException;
-
- // abstract methods (listeners)
-
- public abstract void addNodeChangeListener(NodeChangeListener listener);
-
- public abstract void addPreferenceChangeListener
- (PreferenceChangeListener listener);
-
- public abstract void removeNodeChangeListener(NodeChangeListener listener);
-
- public abstract void removePreferenceChangeListener
- (PreferenceChangeListener listener);
-}
-
diff --git a/libjava/java/util/prefs/PreferencesFactory.java b/libjava/java/util/prefs/PreferencesFactory.java
deleted file mode 100644
index f4fe7e37ffe..00000000000
--- a/libjava/java/util/prefs/PreferencesFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* PreferencesFactory - Preferences system and user root factory interface
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.prefs;
-
-/**
- * Preferences system and user root factory interface. Defines how to get
- * to the system and user root preferences objects. Should be implemented by
- * new preferences backends.
- *
- * @since 1.4
- * @author Mark Wielaard (mark@klomp.org)
- */
-public interface PreferencesFactory {
-
- /**
- * Returns the system root preferences node. Should always return the
- * same object.
- */
- Preferences systemRoot();
-
- /**
- * Returns the user root preferences node. May return different objects
- * depending on the user that called this method. The user may for example
- * be determined by the current Thread or the Subject associated with the
- * current AccessControllContext.
- */
- Preferences userRoot();
-
-}
diff --git a/libjava/java/util/regex/Matcher.java b/libjava/java/util/regex/Matcher.java
deleted file mode 100644
index bd97ace54a8..00000000000
--- a/libjava/java/util/regex/Matcher.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/* Matcher.java -- Instance of a regular expression applied to a char sequence.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.regex;
-
-import gnu.regexp.REMatch;
-
-/**
- * Instance of a regular expression applied to a char sequence.
- *
- * @since 1.4
- */
-public final class Matcher
-{
- private Pattern pattern;
- private CharSequence input;
- private int position;
- private int appendPosition;
- private REMatch match;
-
- Matcher(Pattern pattern, CharSequence input)
- {
- this.pattern = pattern;
- this.input = input;
- }
-
- /**
- * @param sb The target string buffer
- * @param replacement The replacement string
- *
- * @exception IllegalStateException If no match has yet been attempted,
- * or if the previous match operation failed
- * @exception IndexOutOfBoundsException If the replacement string refers
- * to a capturing group that does not exist in the pattern
- */
- public Matcher appendReplacement (StringBuffer sb, String replacement)
- throws IllegalStateException
- {
- assertMatchOp();
- sb.append(input.subSequence(appendPosition,
- match.getStartIndex()).toString());
- sb.append(match.substituteInto(replacement));
- appendPosition = match.getEndIndex();
- return this;
- }
-
- /**
- * @param sb The target string buffer
- */
- public StringBuffer appendTail (StringBuffer sb)
- {
- sb.append(input.subSequence(appendPosition, input.length()).toString());
- return sb;
- }
-
- /**
- * @exception IllegalStateException If no match has yet been attempted,
- * or if the previous match operation failed
- */
- public int end ()
- throws IllegalStateException
- {
- assertMatchOp();
- return match.getEndIndex();
- }
-
- /**
- * @param group The index of a capturing group in this matcher's pattern
- *
- * @exception IllegalStateException If no match has yet been attempted,
- * or if the previous match operation failed
- * @exception IndexOutOfBoundsException If the replacement string refers
- * to a capturing group that does not exist in the pattern
- */
- public int end (int group)
- throws IllegalStateException
- {
- assertMatchOp();
- return match.getEndIndex(group);
- }
-
- public boolean find ()
- {
- boolean first = (match == null);
- match = pattern.getRE().getMatch(input, position);
- if (match != null)
- {
- int endIndex = match.getEndIndex();
- // Are we stuck at the same position?
- if (!first && endIndex == position)
- {
- match = null;
- // Not at the end of the input yet?
- if (position < input.length() - 1)
- {
- position++;
- return find(position);
- }
- else
- return false;
- }
- position = endIndex;
- return true;
- }
- return false;
- }
-
- /**
- * @param start The index to start the new pattern matching
- *
- * @exception IndexOutOfBoundsException If the replacement string refers
- * to a capturing group that does not exist in the pattern
- */
- public boolean find (int start)
- {
- match = pattern.getRE().getMatch(input, start);
- if (match != null)
- {
- position = match.getEndIndex();
- return true;
- }
- return false;
- }
-
- /**
- * @exception IllegalStateException If no match has yet been attempted,
- * or if the previous match operation failed
- */
- public String group ()
- {
- assertMatchOp();
- return match.toString();
- }
-
- /**
- * @param group The index of a capturing group in this matcher's pattern
- *
- * @exception IllegalStateException If no match has yet been attempted,
- * or if the previous match operation failed
- * @exception IndexOutOfBoundsException If the replacement string refers
- * to a capturing group that does not exist in the pattern
- */
- public String group (int group)
- throws IllegalStateException
- {
- assertMatchOp();
- return match.toString(group);
- }
-
- /**
- * @param replacement The replacement string
- */
- public String replaceFirst (String replacement)
- {
- reset();
- // Semantics might not quite match
- return pattern.getRE().substitute(input, replacement, position);
- }
-
- /**
- * @param replacement The replacement string
- */
- public String replaceAll (String replacement)
- {
- reset();
- return pattern.getRE().substituteAll(input, replacement, position);
- }
-
- public int groupCount ()
- {
- return pattern.getRE().getNumSubs();
- }
-
- public boolean lookingAt ()
- {
- match = pattern.getRE().getMatch(input, 0);
- if (match != null)
- {
- if (match.getStartIndex() == 0)
- {
- position = match.getEndIndex();
- return true;
- }
- match = null;
- }
- return false;
- }
-
- /**
- * Attempts to match the entire input sequence against the pattern.
- *
- * If the match succeeds then more information can be obtained via the
- * start, end, and group methods.
- *
- * @see #start
- * @see #end
- * @see #group
- */
- public boolean matches ()
- {
- if (lookingAt())
- {
- if (position == input.length())
- return true;
- match = null;
- }
- return false;
- }
-
- /**
- * Returns the Pattern that is interpreted by this Matcher
- */
- public Pattern pattern ()
- {
- return pattern;
- }
-
- public Matcher reset ()
- {
- position = 0;
- match = null;
- return this;
- }
-
- /**
- * @param input The new input character sequence
- */
- public Matcher reset (CharSequence input)
- {
- this.input = input;
- return reset();
- }
-
- /**
- * @param group The index of a capturing group in this matcher's pattern
- *
- * @exception IllegalStateException If no match has yet been attempted,
- * or if the previous match operation failed
- */
- public int start ()
- throws IllegalStateException
- {
- assertMatchOp();
- return match.getStartIndex();
- }
-
- /**
- * @param group The index of a capturing group in this matcher's pattern
- *
- * @exception IllegalStateException If no match has yet been attempted,
- * or if the previous match operation failed
- * @exception IndexOutOfBoundsException If the replacement string refers
- * to a capturing group that does not exist in the pattern
- */
- public int start (int group)
- throws IllegalStateException
- {
- assertMatchOp();
- return match.getStartIndex(group);
- }
-
- private void assertMatchOp()
- {
- if (match == null) throw new IllegalStateException();
- }
-}
diff --git a/libjava/java/util/regex/Pattern.java b/libjava/java/util/regex/Pattern.java
deleted file mode 100644
index ddd0c257800..00000000000
--- a/libjava/java/util/regex/Pattern.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/* Pattern.java -- Compiled regular expression ready to be applied.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.regex;
-
-import gnu.regexp.RE;
-import gnu.regexp.REException;
-import gnu.regexp.RESyntax;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-
-
-/**
- * Compiled regular expression ready to be applied.
- *
- * @since 1.4
- */
-public final class Pattern implements Serializable
-{
- private static final long serialVersionUID = 5073258162644648461L;
-
- public static final int CANON_EQ = 128;
- public static final int CASE_INSENSITIVE = 2;
- public static final int COMMENTS = 4;
- public static final int DOTALL = 32;
- public static final int MULTILINE = 8;
- public static final int UNICODE_CASE = 64;
- public static final int UNIX_LINES = 1;
-
- private final String regex;
- private final int flags;
-
- private final RE re;
-
- private Pattern (String regex, int flags)
- throws PatternSyntaxException
- {
- this.regex = regex;
- this.flags = flags;
-
- int gnuFlags = 0;
- if ((flags & CASE_INSENSITIVE) != 0)
- gnuFlags |= RE.REG_ICASE;
- if ((flags & MULTILINE) != 0)
- gnuFlags |= RE.REG_MULTILINE;
- if ((flags & DOTALL) != 0)
- gnuFlags |= RE.REG_DOT_NEWLINE;
- // not yet supported:
- // if ((flags & UNICODE_CASE) != 0) gnuFlags =
- // if ((flags & CANON_EQ) != 0) gnuFlags =
-
- RESyntax syntax = RESyntax.RE_SYNTAX_JAVA_1_4;
- if ((flags & UNIX_LINES) != 0)
- {
- // Use a syntax set with \n for linefeeds?
- syntax = new RESyntax(syntax);
- syntax.setLineSeparator("\n");
- }
-
- if ((flags & COMMENTS) != 0)
- {
- // Use a syntax with support for comments?
- }
-
- try
- {
- this.re = new RE(regex, gnuFlags, syntax);
- }
- catch (REException e)
- {
- throw new PatternSyntaxException(e.getMessage(),
- regex, e.getPosition());
- }
- }
-
- // package private accessor method
- RE getRE()
- {
- return re;
- }
-
- /**
- * @param regex The regular expression
- *
- * @exception PatternSyntaxException If the expression's syntax is invalid
- */
- public static Pattern compile (String regex)
- throws PatternSyntaxException
- {
- return compile(regex, 0);
- }
-
- /**
- * @param regex The regular expression
- * @param flags The match flags, a bit mask
- *
- * @exception PatternSyntaxException If the expression's syntax is invalid
- * @exception IllegalArgumentException If bit values other than those
- * corresponding to the defined match flags are set in flags
- */
- public static Pattern compile (String regex, int flags)
- throws PatternSyntaxException
- {
- // FIXME: check which flags are really accepted
- if ((flags & ~0xEF) != 0)
- throw new IllegalArgumentException ();
-
- return new Pattern (regex, flags);
- }
-
- public int flags ()
- {
- return this.flags;
- }
-
- /**
- * @param regex The regular expression
- * @param input The character sequence to be matched
- *
- * @exception PatternSyntaxException If the expression's syntax is invalid
- */
- public static boolean matches (String regex, CharSequence input)
- {
- return compile(regex).matcher(input).matches();
- }
-
- /**
- * @param input The character sequence to be matched
- */
- public Matcher matcher (CharSequence input)
- {
- return new Matcher(this, input);
- }
-
- /**
- * @param input The character sequence to be matched
- */
- public String[] split (CharSequence input)
- {
- return split(input, 0);
- }
-
- /**
- * @param input The character sequence to be matched
- * @param limit The result threshold
- */
- public String[] split (CharSequence input, int limit)
- {
- Matcher matcher = new Matcher(this, input);
- ArrayList list = new ArrayList();
- int empties = 0;
- int count = 0;
- int start = 0;
- int end;
- boolean matched;
-
- while (matched = matcher.find() && (limit <= 0 || count < limit - 1))
- {
- ++count;
- end = matcher.start();
- if (start == end)
- empties++;
- else
- {
- while (empties > 0)
- {
- list.add("");
- empties--;
- }
-
- String text = input.subSequence(start, end).toString();
- list.add(text);
- }
- start = matcher.end();
- }
-
- // We matched nothing.
- if (!matched && count == 0)
- return new String[] { input.toString() };
-
- // Is the last token empty?
- boolean emptyLast = (start == input.length());
-
- // Can/Must we add empties or an extra last token at the end?
- if (list.size() < limit || limit < 0 || (limit == 0 && !emptyLast))
- {
- if (limit > list.size())
- {
- int max = limit - list.size();
- empties = (empties > max) ? max : empties;
- }
- while (empties > 0)
- {
- list.add("");
- empties--;
- }
- }
-
- // last token at end
- if (limit != 0 || (limit == 0 && !emptyLast))
- {
- String t = input.subSequence(start, input.length()).toString();
- if ("".equals(t) && limit == 0)
- ; // Don't add.
- else
- list.add(t);
- }
-
- String[] output = new String [list.size()];
- list.toArray(output);
- return output;
- }
-
- public String pattern ()
- {
- return regex;
- }
-}
diff --git a/libjava/java/util/regex/PatternSyntaxException.java b/libjava/java/util/regex/PatternSyntaxException.java
deleted file mode 100644
index 0c80e119c37..00000000000
--- a/libjava/java/util/regex/PatternSyntaxException.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/* PatternSyntaxException - Indicates illegal pattern for regular expression.
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.regex;
-
-/**
- * Indicates illegal pattern for regular expression.
- * Includes state to inspect the pattern and what and where the expression
- * was not valid regular expression.
- */
-public class PatternSyntaxException extends IllegalArgumentException
-{
- private static final long serialVersionUID = -3864639126226059218L;
-
- /**
- * Human readable escription of the syntax error.
- */
- private final String desc;
-
- /**
- * The original pattern that contained the syntax error.
- */
- private final String pattern;
-
- /**
- * Index of the first character in the String that was probably invalid,
- * or -1 when unknown.
- */
- private final int index;
-
- /**
- * Creates a new PatternSyntaxException.
- *
- * @param description Human readable escription of the syntax error.
- * @param pattern The original pattern that contained the syntax error.
- * @param index Index of the first character in the String that was
- * probably invalid, or -1 when unknown.
- */
- public PatternSyntaxException(String description,
- String pattern,
- int index)
- {
- super(description);
- this.desc = description;
- this.pattern = pattern;
- this.index = index;
- }
-
- /**
- * Returns a human readable escription of the syntax error.
- */
- public String getDescription()
- {
- return desc;
- }
-
- /**
- * Returns the original pattern that contained the syntax error.
- */
- public String getPattern()
- {
- return pattern;
- }
-
- /**
- * Returns the index of the first character in the String that was probably
- * invalid, or -1 when unknown.
- */
- public int getIndex()
- {
- return index;
- }
-
- /**
- * Returns a string containing a line with the description, a line with
- * the original pattern and a line indicating with a ^ which character is
- * probably the first invalid character in the pattern if the index is not
- * negative.
- */
- public String getMessage()
- {
- String lineSep = System.getProperty("line.separator");
- StringBuffer sb = new StringBuffer(desc);
- sb.append(lineSep);
- sb.append('\t');
- sb.append(pattern);
- if (index != -1)
- {
- sb.append(lineSep);
- sb.append('\t');
- for (int i=0; i<index; i++)
- sb.append(' ');
- sb.append('^');
- }
- return sb.toString();
- }
-
-}
diff --git a/libjava/java/util/zip/Adler32.java b/libjava/java/util/zip/Adler32.java
deleted file mode 100644
index 7c411384057..00000000000
--- a/libjava/java/util/zip/Adler32.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/* Adler32.java - Computes Adler32 data checksum of a data stream
- Copyright (C) 1999, 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.zip;
-
-/*
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * The actual Adler32 algorithm is taken from RFC 1950.
- * Status: Believed complete and correct.
- */
-
-/**
- * Computes Adler32 checksum for a stream of data. An Adler32
- * checksum is not as reliable as a CRC32 checksum, but a lot faster to
- * compute.
- *<p>
- * The specification for Adler32 may be found in RFC 1950.
- * (ZLIB Compressed Data Format Specification version 3.3)
- *<p>
- *<p>
- * From that document:
- *<p>
- * "ADLER32 (Adler-32 checksum)
- * This contains a checksum value of the uncompressed data
- * (excluding any dictionary data) computed according to Adler-32
- * algorithm. This algorithm is a 32-bit extension and improvement
- * of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073
- * standard.
- *<p>
- * Adler-32 is composed of two sums accumulated per byte: s1 is
- * the sum of all bytes, s2 is the sum of all s1 values. Both sums
- * are done modulo 65521. s1 is initialized to 1, s2 to zero. The
- * Adler-32 checksum is stored as s2*65536 + s1 in most-
- * significant-byte first (network) order."
- *<p>
- * "8.2. The Adler-32 algorithm
- *<p>
- * The Adler-32 algorithm is much faster than the CRC32 algorithm yet
- * still provides an extremely low probability of undetected errors.
- *<p>
- * The modulo on unsigned long accumulators can be delayed for 5552
- * bytes, so the modulo operation time is negligible. If the bytes
- * are a, b, c, the second sum is 3a + 2b + c + 3, and so is position
- * and order sensitive, unlike the first sum, which is just a
- * checksum. That 65521 is prime is important to avoid a possible
- * large class of two-byte errors that leave the check unchanged.
- * (The Fletcher checksum uses 255, which is not prime and which also
- * makes the Fletcher check insensitive to single byte changes 0 <->
- * 255.)
- *<p>
- * The sum s1 is initialized to 1 instead of zero to make the length
- * of the sequence part of s2, so that the length does not have to be
- * checked separately. (Any sequence of zeroes has a Fletcher
- * checksum of zero.)"
- *
- * @author John Leuner, Per Bothner
- * @since JDK 1.1
- *
- * @see InflaterInputStream
- * @see DeflaterOutputStream
- */
-public class Adler32 implements Checksum
-{
-
- /** largest prime smaller than 65536 */
- private static final int BASE = 65521;
-
- private int checksum; //we do all in int.
-
- //Note that java doesn't have unsigned integers,
- //so we have to be careful with what arithmetic
- //we do. We return the checksum as a long to
- //avoid sign confusion.
-
- /**
- * Creates a new instance of the <code>Adler32</code> class.
- * The checksum starts off with a value of 1.
- */
- public Adler32 ()
- {
- reset();
- }
-
- /**
- * Resets the Adler32 checksum to the initial value.
- */
- public void reset ()
- {
- checksum = 1; //Initialize to 1
- }
-
- /**
- * Updates the checksum with the byte b.
- *
- * @param bval the data value to add. The high byte of the int is ignored.
- */
- public void update (int bval)
- {
- //We could make a length 1 byte array and call update again, but I
- //would rather not have that overhead
- int s1 = checksum & 0xffff;
- int s2 = checksum >>> 16;
-
- s1 = (s1 + (bval & 0xFF)) % BASE;
- s2 = (s1 + s2) % BASE;
-
- checksum = (s2 << 16) + s1;
- }
-
- /**
- * Updates the checksum with the bytes taken from the array.
- *
- * @param buffer an array of bytes
- */
- public void update (byte[] buffer)
- {
- update(buffer, 0, buffer.length);
- }
-
- /**
- * Updates the checksum with the bytes taken from the array.
- *
- * @param buf an array of bytes
- * @param off the start of the data used for this update
- * @param len the number of bytes to use for this update
- */
- public void update (byte[] buf, int off, int len)
- {
- //(By Per Bothner)
- int s1 = checksum & 0xffff;
- int s2 = checksum >>> 16;
-
- while (len > 0)
- {
- // We can defer the modulo operation:
- // s1 maximally grows from 65521 to 65521 + 255 * 3800
- // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31
- int n = 3800;
- if (n > len)
- n = len;
- len -= n;
- while (--n >= 0)
- {
- s1 = s1 + (buf[off++] & 0xFF);
- s2 = s2 + s1;
- }
- s1 %= BASE;
- s2 %= BASE;
- }
-
- /*Old implementation, borrowed from somewhere:
- int n;
-
- while (len-- > 0) {
-
- s1 = (s1 + (bs[offset++] & 0xff)) % BASE;
- s2 = (s2 + s1) % BASE;
- }*/
-
- checksum = (s2 << 16) | s1;
- }
-
- /**
- * Returns the Adler32 data checksum computed so far.
- */
- public long getValue()
- {
- return (long) checksum & 0xffffffffL;
- }
-}
diff --git a/libjava/java/util/zip/CRC32.java b/libjava/java/util/zip/CRC32.java
deleted file mode 100644
index 1c2b3973852..00000000000
--- a/libjava/java/util/zip/CRC32.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/* CRC32.java - Computes CRC32 data checksum of a data stream
- Copyright (C) 1999. 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.zip;
-
-/*
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * The actual CRC32 algorithm is taken from RFC 1952.
- * Status: Believed complete and correct.
- */
-
-/**
- * Computes CRC32 data checksum of a data stream.
- * The actual CRC32 algorithm is described in RFC 1952
- * (GZIP file format specification version 4.3).
- * Can be used to get the CRC32 over a stream if used with checked input/output
- * streams.
- *
- * @see InflaterInputStream
- * @see DeflaterOutputStream
- *
- * @author Per Bothner
- * @date April 1, 1999.
- */
-public class CRC32 implements Checksum
-{
- /** The crc data checksum so far. */
- private int crc = 0;
-
- /** The fast CRC table. Computed once when the CRC32 class is loaded. */
- private static int[] crc_table = make_crc_table();
-
- /** Make the table for a fast CRC. */
- private static int[] make_crc_table ()
- {
- int[] crc_table = new int[256];
- for (int n = 0; n < 256; n++)
- {
- int c = n;
- for (int k = 8; --k >= 0; )
- {
- if ((c & 1) != 0)
- c = 0xedb88320 ^ (c >>> 1);
- else
- c = c >>> 1;
- }
- crc_table[n] = c;
- }
- return crc_table;
- }
-
- /**
- * Returns the CRC32 data checksum computed so far.
- */
- public long getValue ()
- {
- return (long) crc & 0xffffffffL;
- }
-
- /**
- * Resets the CRC32 data checksum as if no update was ever called.
- */
- public void reset () { crc = 0; }
-
- /**
- * Updates the checksum with the int bval.
- *
- * @param bval (the byte is taken as the lower 8 bits of bval)
- */
-
- public void update (int bval)
- {
- int c = ~crc;
- c = crc_table[(c ^ bval) & 0xff] ^ (c >>> 8);
- crc = ~c;
- }
-
- /**
- * Adds the byte array to the data checksum.
- *
- * @param buf the buffer which contains the data
- * @param off the offset in the buffer where the data starts
- * @param len the length of the data
- */
- public void update (byte[] buf, int off, int len)
- {
- int c = ~crc;
- while (--len >= 0)
- c = crc_table[(c ^ buf[off++]) & 0xff] ^ (c >>> 8);
- crc = ~c;
- }
-
- /**
- * Adds the complete byte array to the data checksum.
- */
- public void update (byte[] buf) { update(buf, 0, buf.length); }
-}
diff --git a/libjava/java/util/zip/CheckedInputStream.java b/libjava/java/util/zip/CheckedInputStream.java
deleted file mode 100644
index d743fbb2447..00000000000
--- a/libjava/java/util/zip/CheckedInputStream.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/* CheckedInputStream.java - Compute checksum of data being read
- Copyright (C) 1999, 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.zip;
-
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/* Written using on-line Java Platform 1.2 API Specification
- * and JCL book.
- * Believed complete and correct.
- */
-
-/**
- * InputStream that computes a checksum of the data being read using a
- * supplied Checksum object.
- *
- * @see Checksum
- *
- * @author Tom Tromey
- * @date May 17, 1999
- */
-public class CheckedInputStream extends FilterInputStream
-{
- /**
- * Creates a new CheckInputStream on top of the supplied OutputStream
- * using the supplied Checksum.
- */
- public CheckedInputStream (InputStream in, Checksum sum)
- {
- super (in);
- this.sum = sum;
- }
-
- /**
- * Returns the Checksum object used. To get the data checksum computed so
- * far call <code>getChecksum.getValue()</code>.
- */
- public Checksum getChecksum ()
- {
- return sum;
- }
-
- /**
- * Reads one byte, updates the checksum and returns the read byte
- * (or -1 when the end of file was reached).
- */
- public int read () throws IOException
- {
- int x = in.read();
- if (x != -1)
- sum.update(x);
- return x;
- }
-
- /**
- * Reads at most len bytes in the supplied buffer and updates the checksum
- * with it. Returns the number of bytes actually read or -1 when the end
- * of file was reached.
- */
- public int read (byte[] buf, int off, int len) throws IOException
- {
- int r = in.read(buf, off, len);
- if (r != -1)
- sum.update(buf, off, r);
- return r;
- }
-
- /**
- * Skips n bytes by reading them in a temporary buffer and updating the
- * the checksum with that buffer. Returns the actual number of bytes skiped
- * which can be less then requested when the end of file is reached.
- */
- public long skip (long n) throws IOException
- {
- if (n == 0)
- return 0;
-
- int min = (int) Math.min(n, 1024);
- byte[] buf = new byte[min];
-
- long s = 0;
- while (n > 0)
- {
- int r = in.read(buf, 0, min);
- if (r == -1)
- break;
- n -= r;
- s += r;
- min = (int) Math.min(n, 1024);
- sum.update(buf, 0, r);
- }
-
- return s;
- }
-
- /** The checksum object. */
- private Checksum sum;
-}
diff --git a/libjava/java/util/zip/CheckedOutputStream.java b/libjava/java/util/zip/CheckedOutputStream.java
deleted file mode 100644
index a3c19292fae..00000000000
--- a/libjava/java/util/zip/CheckedOutputStream.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* CheckedOutputStream.java - Compute checksum of data being written.
- Copyright (C) 1999, 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.zip;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/* Written using on-line Java Platform 1.2 API Specification
- * and JCL book.
- * Believed complete and correct.
- */
-
-/**
- * OutputStream that computes a checksum of data being written using a
- * supplied Checksum object.
- *
- * @see Checksum
- *
- * @author Tom Tromey
- * @date May 17, 1999
- */
-public class CheckedOutputStream extends FilterOutputStream
-{
- /**
- * Creates a new CheckInputStream on top of the supplied OutputStream
- * using the supplied Checksum.
- */
- public CheckedOutputStream (OutputStream out, Checksum cksum)
- {
- super (out);
- this.sum = cksum;
- }
-
- /**
- * Returns the Checksum object used. To get the data checksum computed so
- * far call <code>getChecksum.getValue()</code>.
- */
- public Checksum getChecksum ()
- {
- return sum;
- }
-
- /**
- * Writes one byte to the OutputStream and updates the Checksum.
- */
- public void write (int bval) throws IOException
- {
- out.write(bval);
- sum.update(bval);
- }
-
- /**
- * Writes the byte array to the OutputStream and updates the Checksum.
- */
- public void write (byte[] buf, int off, int len) throws IOException
- {
- out.write(buf, off, len);
- sum.update(buf, off, len);
- }
-
- /** The checksum object. */
- private Checksum sum;
-}
diff --git a/libjava/java/util/zip/Checksum.java b/libjava/java/util/zip/Checksum.java
deleted file mode 100644
index 3342ba3a609..00000000000
--- a/libjava/java/util/zip/Checksum.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Checksum.java - Interface to compute a data checksum
- Copyright (C) 1999, 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.zip;
-
-/*
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * Interface to compute a data checksum used by checked input/output streams.
- * A data checksum can be updated by one byte or with a byte array. After each
- * update the value of the current checksum can be returned by calling
- * <code>getValue</code>. The complete checksum object can also be reset
- * so it can be used again with new data.
- *
- * @see CheckedInputStream
- * @see CheckedOutputStream
- *
- * @author Per Bothner
- * @author Jochen Hoenicke
- */
-public interface Checksum
-{
- /**
- * Returns the data checksum computed so far.
- */
- long getValue();
-
- /**
- * Resets the data checksum as if no update was ever called.
- */
- void reset();
-
- /**
- * Adds one byte to the data checksum.
- *
- * @param bval the data value to add. The high byte of the int is ignored.
- */
- void update (int bval);
-
- /**
- * Adds the byte array to the data checksum.
- *
- * @param buf the buffer which contains the data
- * @param off the offset in the buffer where the data starts
- * @param len the length of the data
- */
- void update (byte[] buf, int off, int len);
-}
diff --git a/libjava/java/util/zip/DataFormatException.java b/libjava/java/util/zip/DataFormatException.java
deleted file mode 100644
index dc5b10dec90..00000000000
--- a/libjava/java/util/zip/DataFormatException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* DataformatException.java -- thrown when compressed data is corrupt
- Copyright (C) 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.zip;
-
-/**
- * Exception thrown when compressed data is corrupt.
- *
- * @author Tom Tromey
- * @author John Leuner
- * @since 1.1
- * @status updated to 1.4
- */
-public class DataFormatException extends Exception
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 2219632870893641452L;
-
- /**
- * Create an exception without a message.
- */
- public DataFormatException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param msg the message
- */
- public DataFormatException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/util/zip/ZipConstants.java b/libjava/java/util/zip/ZipConstants.java
deleted file mode 100644
index 952a44def4c..00000000000
--- a/libjava/java/util/zip/ZipConstants.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* java.util.zip.ZipConstants
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.zip;
-
-interface ZipConstants
-{
- /* The local file header */
- int LOCHDR = 30;
- int LOCSIG = 'P'|('K'<<8)|(3<<16)|(4<<24);
-
- int LOCVER = 4;
- int LOCFLG = 6;
- int LOCHOW = 8;
- int LOCTIM = 10;
- int LOCCRC = 14;
- int LOCSIZ = 18;
- int LOCLEN = 22;
- int LOCNAM = 26;
- int LOCEXT = 28;
-
- /* The Data descriptor */
- int EXTSIG = 'P'|('K'<<8)|(7<<16)|(8<<24);
- int EXTHDR = 16;
-
- int EXTCRC = 4;
- int EXTSIZ = 8;
- int EXTLEN = 12;
-
- /* The central directory file header */
- int CENSIG = 'P'|('K'<<8)|(1<<16)|(2<<24);
- int CENHDR = 46;
-
- int CENVEM = 4;
- int CENVER = 6;
- int CENFLG = 8;
- int CENHOW = 10;
- int CENTIM = 12;
- int CENCRC = 16;
- int CENSIZ = 20;
- int CENLEN = 24;
- int CENNAM = 28;
- int CENEXT = 30;
- int CENCOM = 32;
- int CENDSK = 34;
- int CENATT = 36;
- int CENATX = 38;
- int CENOFF = 42;
-
- /* The entries in the end of central directory */
- int ENDSIG = 'P'|('K'<<8)|(5<<16)|(6<<24);
- int ENDHDR = 22;
-
- /* The following two fields are missing in SUN JDK */
- int ENDNRD = 4;
- int ENDDCD = 6;
- int ENDSUB = 8;
- int ENDTOT = 10;
- int ENDSIZ = 12;
- int ENDOFF = 16;
- int ENDCOM = 20;
-}
-
diff --git a/libjava/java/util/zip/ZipException.java b/libjava/java/util/zip/ZipException.java
deleted file mode 100644
index c5bfc1e7c39..00000000000
--- a/libjava/java/util/zip/ZipException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ZipException.java - exception representing a zip related error
- Copyright (C) 1998, 1999, 2000, 2001, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.zip;
-
-import java.io.IOException;
-
-/**
- * Thrown during the creation or input of a zip file.
- *
- * @author Jochen Hoenicke
- * @author Per Bothner
- * @status updated to 1.4
- */
-public class ZipException extends IOException
-{
- /**
- * Compatible with JDK 1.0+.
- */
- private static final long serialVersionUID = 8000196834066748623L;
-
- /**
- * Create an exception without a message.
- */
- public ZipException()
- {
- }
-
- /**
- * Create an exception with a message.
- *
- * @param msg the message
- */
- public ZipException (String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/java/util/zip/ZipInputStream.java b/libjava/java/util/zip/ZipInputStream.java
deleted file mode 100644
index 5732523238e..00000000000
--- a/libjava/java/util/zip/ZipInputStream.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/* ZipInputStream.java --
- Copyright (C) 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.zip;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * This is a FilterInputStream that reads the files in an zip archive
- * one after another. It has a special method to get the zip entry of
- * the next file. The zip entry contains information about the file name
- * size, compressed size, CRC, etc.
- *
- * It includes support for STORED and DEFLATED entries.
- *
- * @author Jochen Hoenicke
- */
-public class ZipInputStream extends InflaterInputStream implements ZipConstants
-{
- private CRC32 crc = new CRC32();
- private ZipEntry entry = null;
-
- private int csize;
- private int size;
- private int method;
- private int flags;
- private int avail;
- private boolean entryAtEOF;
-
- /**
- * Creates a new Zip input stream, reading a zip archive.
- */
- public ZipInputStream(InputStream in)
- {
- super(in, new Inflater(true));
- }
-
- private void fillBuf() throws IOException
- {
- avail = len = in.read(buf, 0, buf.length);
- }
-
- private int readBuf(byte[] out, int offset, int length) throws IOException
- {
- if (avail <= 0)
- {
- fillBuf();
- if (avail <= 0)
- return -1;
- }
- if (length > avail)
- length = avail;
- System.arraycopy(buf, len - avail, out, offset, length);
- avail -= length;
- return length;
- }
-
- private void readFully(byte[] out) throws IOException
- {
- int off = 0;
- int len = out.length;
- while (len > 0)
- {
- int count = readBuf(out, off, len);
- if (count == -1)
- throw new EOFException();
- off += count;
- len -= count;
- }
- }
-
- private int readLeByte() throws IOException
- {
- if (avail <= 0)
- {
- fillBuf();
- if (avail <= 0)
- throw new ZipException("EOF in header");
- }
- return buf[len - avail--] & 0xff;
- }
-
- /**
- * Read an unsigned short in little endian byte order.
- */
- private int readLeShort() throws IOException
- {
- return readLeByte() | (readLeByte() << 8);
- }
-
- /**
- * Read an int in little endian byte order.
- */
- private int readLeInt() throws IOException
- {
- return readLeShort() | (readLeShort() << 16);
- }
-
- /**
- * Open the next entry from the zip archive, and return its description.
- * If the previous entry wasn't closed, this method will close it.
- */
- public ZipEntry getNextEntry() throws IOException
- {
- if (crc == null)
- throw new IOException("Stream closed.");
- if (entry != null)
- closeEntry();
-
- int header = readLeInt();
- if (header == CENSIG)
- {
- /* Central Header reached. */
- close();
- return null;
- }
- if (header != LOCSIG)
- throw new ZipException("Wrong Local header signature: "
- + Integer.toHexString(header));
- /* skip version */
- readLeShort();
- flags = readLeShort();
- method = readLeShort();
- int dostime = readLeInt();
- int crc = readLeInt();
- csize = readLeInt();
- size = readLeInt();
- int nameLen = readLeShort();
- int extraLen = readLeShort();
-
- if (method == ZipOutputStream.STORED && csize != size)
- throw new ZipException("Stored, but compressed != uncompressed");
-
-
- byte[] buffer = new byte[nameLen];
- readFully(buffer);
- String name = new String(buffer);
-
- entry = createZipEntry(name);
- entryAtEOF = false;
- entry.setMethod(method);
- if ((flags & 8) == 0)
- {
- entry.setCrc(crc & 0xffffffffL);
- entry.setSize(size & 0xffffffffL);
- entry.setCompressedSize(csize & 0xffffffffL);
- }
- entry.setDOSTime(dostime);
- if (extraLen > 0)
- {
- byte[] extra = new byte[extraLen];
- readFully(extra);
- entry.setExtra(extra);
- }
-
- if (method == ZipOutputStream.DEFLATED && avail > 0)
- {
- System.arraycopy(buf, len - avail, buf, 0, avail);
- len = avail;
- avail = 0;
- inf.setInput(buf, 0, len);
- }
- return entry;
- }
-
- private void readDataDescr() throws IOException
- {
- if (readLeInt() != EXTSIG)
- throw new ZipException("Data descriptor signature not found");
- entry.setCrc(readLeInt() & 0xffffffffL);
- csize = readLeInt();
- size = readLeInt();
- entry.setSize(size & 0xffffffffL);
- entry.setCompressedSize(csize & 0xffffffffL);
- }
-
- /**
- * Closes the current zip entry and moves to the next one.
- */
- public void closeEntry() throws IOException
- {
- if (crc == null)
- throw new IOException("Stream closed.");
- if (entry == null)
- return;
-
- if (method == ZipOutputStream.DEFLATED)
- {
- if ((flags & 8) != 0)
- {
- /* We don't know how much we must skip, read until end. */
- byte[] tmp = new byte[2048];
- while (read(tmp) > 0)
- ;
- /* read will close this entry */
- return;
- }
- csize -= inf.getTotalIn();
- avail = inf.getRemaining();
- }
-
- if (avail > csize && csize >= 0)
- avail -= csize;
- else
- {
- csize -= avail;
- avail = 0;
- while (csize != 0)
- {
- long skipped = in.skip(csize & 0xffffffffL);
- if (skipped <= 0)
- throw new ZipException("zip archive ends early.");
- csize -= skipped;
- }
- }
-
- size = 0;
- crc.reset();
- if (method == ZipOutputStream.DEFLATED)
- inf.reset();
- entry = null;
- entryAtEOF = true;
- }
-
- public int available() throws IOException
- {
- return entryAtEOF ? 0 : 1;
- }
-
- /**
- * Reads a byte from the current zip entry.
- * @return the byte or -1 on EOF.
- * @exception IOException if a i/o error occured.
- * @exception ZipException if the deflated stream is corrupted.
- */
- public int read() throws IOException
- {
- byte[] b = new byte[1];
- if (read(b, 0, 1) <= 0)
- return -1;
- return b[0] & 0xff;
- }
-
- /**
- * Reads a block of bytes from the current zip entry.
- * @return the number of bytes read (may be smaller, even before
- * EOF), or -1 on EOF.
- * @exception IOException if a i/o error occured.
- * @exception ZipException if the deflated stream is corrupted.
- */
- public int read(byte[] b, int off, int len) throws IOException
- {
- if (len == 0)
- return 0;
- if (crc == null)
- throw new IOException("Stream closed.");
- if (entry == null)
- return -1;
- boolean finished = false;
- switch (method)
- {
- case ZipOutputStream.DEFLATED:
- len = super.read(b, off, len);
- if (len < 0)
- {
- if (!inf.finished())
- throw new ZipException("Inflater not finished!?");
- avail = inf.getRemaining();
- if ((flags & 8) != 0)
- readDataDescr();
-
- if (inf.getTotalIn() != csize
- || inf.getTotalOut() != size)
- throw new ZipException("size mismatch: "+csize+";"+size+" <-> "+inf.getTotalIn()+";"+inf.getTotalOut());
- inf.reset();
- finished = true;
- }
- break;
-
- case ZipOutputStream.STORED:
-
- if (len > csize && csize >= 0)
- len = csize;
-
- len = readBuf(b, off, len);
- if (len > 0)
- {
- csize -= len;
- size -= len;
- }
-
- if (csize == 0)
- finished = true;
- else if (len < 0)
- throw new ZipException("EOF in stored block");
- break;
- }
-
- if (len > 0)
- crc.update(b, off, len);
-
- if (finished)
- {
- if ((crc.getValue() & 0xffffffffL) != entry.getCrc())
- throw new ZipException("CRC mismatch");
- crc.reset();
- entry = null;
- entryAtEOF = true;
- }
- return len;
- }
-
- /**
- * Closes the zip file.
- * @exception IOException if a i/o error occured.
- */
- public void close() throws IOException
- {
- super.close();
- crc = null;
- entry = null;
- entryAtEOF = true;
- }
-
- /**
- * Creates a new zip entry for the given name. This is equivalent
- * to new ZipEntry(name).
- * @param name the name of the zip entry.
- */
- protected ZipEntry createZipEntry(String name)
- {
- return new ZipEntry(name);
- }
-}
diff --git a/libjava/java/util/zip/ZipOutputStream.java b/libjava/java/util/zip/ZipOutputStream.java
deleted file mode 100644
index 5699ff046f5..00000000000
--- a/libjava/java/util/zip/ZipOutputStream.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/* ZipOutputStream.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 java.util.zip;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Enumeration;
-import java.util.Vector;
-
-/**
- * This is a FilterOutputStream that writes the files into a zip
- * archive one after another. It has a special method to start a new
- * zip entry. The zip entries contains information about the file name
- * size, compressed size, CRC, etc.
- *
- * It includes support for STORED and DEFLATED entries.
- *
- * This class is not thread safe.
- *
- * @author Jochen Hoenicke
- */
-public class ZipOutputStream extends DeflaterOutputStream implements ZipConstants
-{
- private Vector entries = new Vector();
- private CRC32 crc = new CRC32();
- private ZipEntry curEntry = null;
-
- private int curMethod;
- private int size;
- private int offset = 0;
-
- private byte[] zipComment = new byte[0];
- private int defaultMethod = DEFLATED;
-
- /**
- * Our Zip version is hard coded to 1.0 resp. 2.0
- */
- private static final int ZIP_STORED_VERSION = 10;
- private static final int ZIP_DEFLATED_VERSION = 20;
-
- /**
- * Compression method. This method doesn't compress at all.
- */
- public static final int STORED = 0;
-
- /**
- * Compression method. This method uses the Deflater.
- */
- public static final int DEFLATED = 8;
-
- /**
- * Creates a new Zip output stream, writing a zip archive.
- * @param out the output stream to which the zip archive is written.
- */
- public ZipOutputStream(OutputStream out)
- {
- super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true));
- }
-
- /**
- * Set the zip file comment.
- * @param comment the comment.
- * @exception IllegalArgumentException if encoding of comment is
- * longer than 0xffff bytes.
- */
- public void setComment(String comment)
- {
- byte[] commentBytes;
- commentBytes = comment.getBytes();
- if (commentBytes.length > 0xffff)
- throw new IllegalArgumentException("Comment too long.");
- zipComment = commentBytes;
- }
-
- /**
- * Sets default compression method. If the Zip entry specifies
- * another method its method takes precedence.
- * @param method the method.
- * @exception IllegalArgumentException if method is not supported.
- * @see #STORED
- * @see #DEFLATED
- */
- public void setMethod(int method)
- {
- if (method != STORED && method != DEFLATED)
- throw new IllegalArgumentException("Method not supported.");
- defaultMethod = method;
- }
-
- /**
- * Sets default compression level. The new level will be activated
- * immediately.
- * @exception IllegalArgumentException if level is not supported.
- * @see Deflater
- */
- public void setLevel(int level)
- {
- def.setLevel(level);
- }
-
- /**
- * Write an unsigned short in little endian byte order.
- */
- private void writeLeShort(int value) throws IOException
- {
- out.write(value & 0xff);
- out.write((value >> 8) & 0xff);
- }
-
- /**
- * Write an int in little endian byte order.
- */
- private void writeLeInt(int value) throws IOException
- {
- writeLeShort(value);
- writeLeShort(value >> 16);
- }
-
- /**
- * Starts a new Zip entry. It automatically closes the previous
- * entry if present. If the compression method is stored, the entry
- * must have a valid size and crc, otherwise all elements (except
- * name) are optional, but must be correct if present. If the time
- * is not set in the entry, the current time is used.
- * @param entry the entry.
- * @exception IOException if an I/O error occured.
- * @exception ZipException if stream was finished.
- */
- public void putNextEntry(ZipEntry entry) throws IOException
- {
- if (entries == null)
- throw new ZipException("ZipOutputStream was finished");
-
- int method = entry.getMethod();
- int flags = 0;
- if (method == -1)
- method = defaultMethod;
-
- if (method == STORED)
- {
- if (entry.getCompressedSize() >= 0)
- {
- if (entry.getSize() < 0)
- entry.setSize(entry.getCompressedSize());
- else if (entry.getSize() != entry.getCompressedSize())
- throw new ZipException
- ("Method STORED, but compressed size != size");
- }
- else
- entry.setCompressedSize(entry.getSize());
-
- if (entry.getSize() < 0)
- throw new ZipException("Method STORED, but size not set");
- if (entry.getCrc() < 0)
- throw new ZipException("Method STORED, but crc not set");
- }
- else if (method == DEFLATED)
- {
- if (entry.getCompressedSize() < 0
- || entry.getSize() < 0 || entry.getCrc() < 0)
- flags |= 8;
- }
-
- if (curEntry != null)
- closeEntry();
-
- if (entry.getTime() < 0)
- entry.setTime(System.currentTimeMillis());
-
- entry.flags = flags;
- entry.offset = offset;
- entry.setMethod(method);
- curMethod = method;
- /* Write the local file header */
- writeLeInt(LOCSIG);
- writeLeShort(method == STORED
- ? ZIP_STORED_VERSION : ZIP_DEFLATED_VERSION);
- writeLeShort(flags);
- writeLeShort(method);
- writeLeInt(entry.getDOSTime());
- if ((flags & 8) == 0)
- {
- writeLeInt((int)entry.getCrc());
- writeLeInt((int)entry.getCompressedSize());
- writeLeInt((int)entry.getSize());
- }
- else
- {
- writeLeInt(0);
- writeLeInt(0);
- writeLeInt(0);
- }
- byte[] name = entry.getName().getBytes();
- if (name.length > 0xffff)
- throw new ZipException("Name too long.");
- byte[] extra = entry.getExtra();
- if (extra == null)
- extra = new byte[0];
- writeLeShort(name.length);
- writeLeShort(extra.length);
- out.write(name);
- out.write(extra);
-
- offset += LOCHDR + name.length + extra.length;
-
- /* Activate the entry. */
-
- curEntry = entry;
- crc.reset();
- if (method == DEFLATED)
- def.reset();
- size = 0;
- }
-
- /**
- * Closes the current entry.
- * @exception IOException if an I/O error occured.
- * @exception ZipException if no entry is active.
- */
- public void closeEntry() throws IOException
- {
- if (curEntry == null)
- throw new ZipException("No open entry");
-
- /* First finish the deflater, if appropriate */
- if (curMethod == DEFLATED)
- super.finish();
-
- int csize = curMethod == DEFLATED ? def.getTotalOut() : size;
-
- if (curEntry.getSize() < 0)
- curEntry.setSize(size);
- else if (curEntry.getSize() != size)
- throw new ZipException("size was "+size
- +", but I expected "+curEntry.getSize());
-
- if (curEntry.getCompressedSize() < 0)
- curEntry.setCompressedSize(csize);
- else if (curEntry.getCompressedSize() != csize)
- throw new ZipException("compressed size was "+csize
- +", but I expected "+curEntry.getSize());
-
- if (curEntry.getCrc() < 0)
- curEntry.setCrc(crc.getValue());
- else if (curEntry.getCrc() != crc.getValue())
- throw new ZipException("crc was " + Long.toHexString(crc.getValue())
- + ", but I expected "
- + Long.toHexString(curEntry.getCrc()));
-
- offset += csize;
-
- /* Now write the data descriptor entry if needed. */
- if (curMethod == DEFLATED && (curEntry.flags & 8) != 0)
- {
- writeLeInt(EXTSIG);
- writeLeInt((int)curEntry.getCrc());
- writeLeInt((int)curEntry.getCompressedSize());
- writeLeInt((int)curEntry.getSize());
- offset += EXTHDR;
- }
-
- entries.addElement(curEntry);
- curEntry = null;
- }
-
- /**
- * Writes the given buffer to the current entry.
- * @exception IOException if an I/O error occured.
- * @exception ZipException if no entry is active.
- */
- public void write(byte[] b, int off, int len) throws IOException
- {
- if (curEntry == null)
- throw new ZipException("No open entry.");
-
- switch (curMethod)
- {
- case DEFLATED:
- super.write(b, off, len);
- break;
-
- case STORED:
- out.write(b, off, len);
- break;
- }
-
- crc.update(b, off, len);
- size += len;
- }
-
- /**
- * Finishes the stream. This will write the central directory at the
- * end of the zip file and flush the stream.
- * @exception IOException if an I/O error occured.
- */
- public void finish() throws IOException
- {
- if (entries == null)
- return;
- if (curEntry != null)
- closeEntry();
-
- int numEntries = 0;
- int sizeEntries = 0;
-
- Enumeration e = entries.elements();
- while (e.hasMoreElements())
- {
- ZipEntry entry = (ZipEntry) e.nextElement();
-
- int method = entry.getMethod();
- writeLeInt(CENSIG);
- writeLeShort(method == STORED
- ? ZIP_STORED_VERSION : ZIP_DEFLATED_VERSION);
- writeLeShort(method == STORED
- ? ZIP_STORED_VERSION : ZIP_DEFLATED_VERSION);
- writeLeShort(entry.flags);
- writeLeShort(method);
- writeLeInt(entry.getDOSTime());
- writeLeInt((int)entry.getCrc());
- writeLeInt((int)entry.getCompressedSize());
- writeLeInt((int)entry.getSize());
-
- byte[] name = entry.getName().getBytes();
- if (name.length > 0xffff)
- throw new ZipException("Name too long.");
- byte[] extra = entry.getExtra();
- if (extra == null)
- extra = new byte[0];
- String strComment = entry.getComment();
- byte[] comment = strComment != null
- ? strComment.getBytes() : new byte[0];
- if (comment.length > 0xffff)
- throw new ZipException("Comment too long.");
-
- writeLeShort(name.length);
- writeLeShort(extra.length);
- writeLeShort(comment.length);
- writeLeShort(0); /* disk number */
- writeLeShort(0); /* internal file attr */
- writeLeInt(0); /* external file attr */
- writeLeInt(entry.offset);
-
- out.write(name);
- out.write(extra);
- out.write(comment);
- numEntries++;
- sizeEntries += CENHDR + name.length + extra.length + comment.length;
- }
-
- writeLeInt(ENDSIG);
- writeLeShort(0); /* disk number */
- writeLeShort(0); /* disk with start of central dir */
- writeLeShort(numEntries);
- writeLeShort(numEntries);
- writeLeInt(sizeEntries);
- writeLeInt(offset);
- writeLeShort(zipComment.length);
- out.write(zipComment);
- out.flush();
- entries = null;
- }
-}
diff --git a/libjava/javax/accessibility/Accessible.java b/libjava/javax/accessibility/Accessible.java
deleted file mode 100644
index 0aa5ea569c7..00000000000
--- a/libjava/javax/accessibility/Accessible.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Accessible.java -- primary Java accessibility interface
- Copyright (C) 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * Implementing the Accessibility API must start with implementation
- * of this interface at a bare minimum. This is the major interface
- * for the Accessibility API which must be implemented by all user
- * interface components.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Accessible
-{
- /**
- * If a component supports the Accessibility API then this method should
- * not return <code>null</code>. Only classes which must extend an accessible
- * class, but must not itself be accessible, may return null.
- *
- * @return the context associated with this accessible object
- */
- AccessibleContext getAccessibleContext();
-} // interface Accessible
diff --git a/libjava/javax/accessibility/AccessibleAction.java b/libjava/javax/accessibility/AccessibleAction.java
deleted file mode 100644
index 2ca683e45eb..00000000000
--- a/libjava/javax/accessibility/AccessibleAction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* AccessibleAction.java -- aids in accessibly performing actions
- Copyright (C) 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * If an object implements this interface then it must be able to perform one
- * or more actions. Accessibility software can use the implementations of this
- * interface to discover and perform actions on an object.
- *
- * <p>The <code>AccessibleContext.getAccessibleAction()</code> method should
- * return <code>null</code> if an object does not implement this interface.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleAction()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleAction
-{
- /**
- * Get the number possible actions for this object, with the zeroth
- * representing the default action.
- *
- * @return the 0-based number of actions
- */
- int getAccessibleActionCount();
-
- /**
- * Get a description for the specified action. Returns null if out of
- * bounds.
- *
- * @param i the action to describe, 0-based
- * @return description of the action
- */
- String getAccessibleActionDescription(int i);
-
- /**
- * Perform the specified action. Does nothing if out of bounds.
- *
- * @param i the action to perform, 0-based
- * @return true if the action was performed
- */
- boolean doAccessibleAction(int i);
-} // interface AccessibleAction
diff --git a/libjava/javax/accessibility/AccessibleBundle.java b/libjava/javax/accessibility/AccessibleBundle.java
deleted file mode 100644
index 7d78c021e34..00000000000
--- a/libjava/javax/accessibility/AccessibleBundle.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/* AccessibleBundle.java -- base class for accessibility "enumerations"
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-import java.util.Locale;
-
-/**
- * This serves as a base class for accessibility "enumerations". These
- * objects are strongly typed; to make up for the lack of true enums in Java.
- * Display should be locale dependent.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see AccessibleRole
- * @see AccessibleState
- * @since 1.2
- * @status updated to 1.4, but missing Locale support
- */
-public abstract class AccessibleBundle
-{
- /**
- * The locale independent name of the object. This is for the computer, not
- * necessarily for humans; changing it in subclasses is frowned upon.
- *
- * @see #toDisplayString(String, Locale)
- */
- protected String key;
-
- /**
- * Default constructor.
- */
- public AccessibleBundle()
- {
- }
-
- /**
- * Obtains the key as a localized string, falling back to the
- * locale-independent version if necessary.
- *
- * @param resourceBundle the resource to use for lookup
- * @param locale the locale to translate to
- * @return the translated name
- * @throws NullPointerException if resourceBundle or locale is null
- * @XXX For now, no transformation is done.
- */
- protected String toDisplayString(String resourceBundle, Locale locale)
- {
- return key;
- }
-
- /**
- * Obtains the key as a localized string, falling back to the
- * locale-independent version if necessary.
- *
- * @param locale the locale to translate to
- * @return the translated name
- * @throws NullPointerException if locale is null
- * @XXX For now, no transformation is done.
- */
- public String toDisplayString(Locale locale)
- {
- return key;
- }
-
- /**
- * Obtains the key as a localized string, using the default locale.
- *
- * @return the translated name
- * @XXX For now, no transformation is done.
- */
- public String toDisplayString()
- {
- return toDisplayString(Locale.getDefault());
- }
-
- /**
- * Obtains the key as a localized string, using the default locale.
- *
- * @return the translated name
- * @XXX For now, no transformation is done.
- */
- public String toString()
- {
- return toDisplayString(Locale.getDefault());
- }
-} // class AccessibleBundle
diff --git a/libjava/javax/accessibility/AccessibleComponent.java b/libjava/javax/accessibility/AccessibleComponent.java
deleted file mode 100644
index ae423d3359e..00000000000
--- a/libjava/javax/accessibility/AccessibleComponent.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/* AccessibleComponent.java -- aids in accessibly rendering Java components
- Copyright (C) 2000, 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-import java.awt.Color;
-import java.awt.Cursor;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.FocusListener;
-
-/**
- * Objects which are to be rendered to a screen as part of a graphical
- * user interface should implement this interface. Accessibility
- * software can use the implementations of this interface to determine
- * and set the screen representation for an object.
- *
- * <p>The <code>AccessibleContext.getAccessibleComponent()</code> method
- * should return <code>null</code> if an object does not implement this
- * interface.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleComponent()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleComponent
-{
- /**
- * Get the background color of this component.
- *
- * @return the background color of this component, or null if not supported
- * @see #setBackground(Color)
- */
- Color getBackground();
-
- /**
- * Set the background color of this component to the specified color.
- *
- * @param color the color to set the background to
- * @see #getBackground()
- */
- void setBackground(Color color);
-
- /**
- * Get the foreground color of this component.
- *
- * @return the foreground color of this component, or null if not supported
- * @see #setForeground(Color)
- */
- Color getForeground();
-
- /**
- * Set the foreground color of this component.
- *
- * @param color the color to set the foreground to
- * @see #getForeground()
- */
- void setForeground(Color color);
-
- /**
- * Get the cursor of this component.
- *
- * @return the Cursor of this component, or null if not supported
- * @see #setCursor(Cursor)
- */
- Cursor getCursor();
-
- /**
- * Set the cursor of the component.
- *
- * @param cursor the graphical representation of the cursor to use
- * @see #getCursor()
- */
- void setCursor(Cursor cursor);
-
- /**
- * Get the font of this component
- *
- * @return the font of the component, or null if not supported
- * @see setFont(Font)
- */
- Font getFont();
-
- /**
- * Set the font of this component.
- *
- * @param font the font to use
- * @see #getFont()
- */
- void setFont(Font font);
-
- /**
- * Get the <code>FontMetrics</code> of the specified font in this component.
- *
- * @param font the specified font
- * @return the metrics for the specified font, or null if not supported
- * @throws NullPointerException if font is null
- * @see #getFont()
- */
- FontMetrics getFontMetrics(Font font);
-
- /**
- * Indicates whether or not this component is enabled. An object which is
- * enabled also has AccessibleState.ENABLED in its StateSet.
- *
- * @return true if the component is enabled
- * @see #setEnabled(boolean)
- * @see AccessibleContext#getAccessibleStateSet()
- * @see AccessibleState#ENABLED
- */
- boolean isEnabled();
-
- /**
- * Set this component to an enabled or disabled state.
- *
- * @param b true to enable the component, else disable it
- * @see #isEnabled()
- */
- void setEnabled(boolean b);
-
- /**
- * Indicates whether or not this component is visible or intends to be
- * visible although one of its ancestors may not be. An object which is
- * visible also has AccessibleState.VISIBLE in its StateSet. Check
- * <code>isShowing()</code> to see if the object is on screen.
- *
- * @return true if the component is visible
- * @see #setVisible(boolean)
- * @see AccessibleContext#getAccessibleStateSet()
- * @see AccessibleState#VISIBLE
- */
- boolean isVisible();
-
- /**
- * Set the visible state of this component.
- *
- * @param b true to make the component visible, else hide it
- * @see #isVisible()
- */
- void setVisible(boolean b);
-
- /**
- * Indicates whether or not this component is visible by checking
- * the visibility of this component and its ancestors. The component may
- * be hidden on screen by another component like pop-up help. An object
- * which is showing on screen also has AccessibleState.SHOWING in its
- * StateSet.
- *
- * @return true if component and ancestors are visible
- * @see #isVisible()
- * @see #setVisible(boolean)
- * @see AccessibleContext#getAccessibleStateSet()
- * @see AccessibleState#SHOWING
- */
- boolean isShowing();
-
- /**
- * Tests whether or not the specified point is contained within
- * this component. The coordinates are specified relative to this
- * component's coordinate system.
- *
- * @param point the Point to locate
- * @return true if the point is within this component
- * @throws NullPointerException if point is null
- * @see #getBounds()
- */
- boolean contains(Point point);
-
- /**
- * Get the location of this component in the screen's coordinate space.
- * The point specified is the top-left corner of this component.
- *
- * @return the location on screen, or null if off-screen
- * @see #getBounds()
- * @see #getLocation()
- */
- Point getLocationOnScreen();
-
- /**
- * Get the location of this component in the parent's coordinate system.
- * The point specified is the top-left corner of this component.
- *
- * @return the location in the parent on screen, or null if off-screen
- * @see #getBounds()
- * @see #getLocationOnScreen()
- * @see #setLocation(Point)
- */
- Point getLocation();
-
- /**
- * Set the location of this component relative to its parent. The point
- * specified represents the top-left corner of this component.
- *
- * @param point the top-left corner of this component relative to the parent
- * @throws NullPointerException if point is null
- * @see #getLocation()
- */
- void setLocation(Point point);
-
- /**
- * Get the bounds of this component relative to its parent - it's width,
- * height, and relative location to its parent.
- *
- * @return the bounds of this component, or null if not on screen
- * @see #contains(Point)
- */
- Rectangle getBounds();
-
- /**
- * Set the bounds of this component to the specified height and width, and
- * relative location to its parent.
- *
- * @param rectangle the new height, width, and relative location
- * @throws NullPointerException if rectangle is null
- */
- void setBounds(Rectangle rectangle);
-
- /**
- * Get the size of this component - it's width and height.
- *
- * @return the dimensions of this component, or null if not on screen
- * @see #setSize(Dimension)
- */
- Dimension getSize();
-
- /**
- * Set the size of this component to the given dimensions.
- *
- * @param dimension the new size of the component
- * @throws NullPointerException if dimension is null
- * @see #getSize()
- */
- void setSize(Dimension dimension);
-
- /**
- * If an object exists at the specified point which is a child of this
- * parent component, and it is accessible, then it is returned.
- *
- * @param point the location within this component's coordinate system
- * @return the accessible child object at that point, or null
- */
- Accessible getAccessibleAt(Point point);
-
- /**
- * Indicates whether or not this component can accept focus. An object
- * which can accept focus also has AccessibleState.FOCUSABLE in its
- * StateSet.
- *
- * @return true if the component can accept focus
- * @see AccessibleContext#getAccessibleStateSet()
- * @see AccessibleState#FOCUSABLE
- * @see AccessibleState#FOCUSED
- */
- boolean isFocusTraversable();
-
- /**
- * If this method is called this component will attempt to gain focus,
- * but if it cannot accept focus nothing happens. On success, the StateSet
- * will contain AccessibleState.FOCUSED
- *
- * @see #isFocusTraversable()
- * @see AccessibleState#FOCUSED
- */
- void requestFocus();
-
- /**
- * Adds the specified listener to this component.
- *
- * @param listener the listener to add to this component
- * @see #removeFocusListener(FocusListener)
- */
- void addFocusListener(FocusListener listener);
-
- /**
- * Removes the specified listener from this component.
- *
- * @param listener the listener to remove
- * @see #addFocusListener(FocusListener)
- */
- void removeFocusListener(FocusListener listener);
-} // interface AccessibleComponent
diff --git a/libjava/javax/accessibility/AccessibleContext.java b/libjava/javax/accessibility/AccessibleContext.java
deleted file mode 100644
index 536deac0dcd..00000000000
--- a/libjava/javax/accessibility/AccessibleContext.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/* AccessibleContext.java -- the context of an accessible object
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.Locale;
-
-/**
- * The minimum information that all accessible objects return. This includes
- * name, description, role, and state of the object, parents and children,
- * and any other useful information. If a component supports further details,
- * it should implement one of the following:<ul>
- * <li>{@link AccessibleAction} - the object can perform actions</li>
- * <li>{@link AccessibleComponent} - the object has a graphical
- * representation</li>
- * <li>{@link AccessibleSelection} - the object allows its children to be
- * selected</li>
- * <li>{@link AccessibleText} - the object represents editable text</li>
- * <li>{@link AccessibleValue} - the object represents a numerical value</li>
- * </ul>
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class AccessibleContext
-{
- /**
- * Constant used when the accessible name has changed. Both the old and new
- * values are listed in the event.
- *
- * @see #getAccessibleName()
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public static final String ACCESSIBLE_NAME_PROPERTY
- = "AccessibleName";
-
- /**
- * Constant used when the accessible description has changed. Both the old
- * and new values are listed in the event.
- *
- * @see #getAccessibleDescription()
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public static final String ACCESSIBLE_DESCRIPTION_PROPERTY
- = "AccessibleDescription";
-
- /**
- * Constant used when the accessibleStateSet has changed. Both the old and
- * new values are listed in the event, although either may be null if a
- * state was disabled at that time.
- *
- * @see #getAccessibleStateSet()
- * @see AccessibleState
- * @see AccessibleStateSet
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public static final String ACCESSIBLE_STATE_PROPERTY
- = "AccessibleState";
-
- /**
- * Constant used when the accessibleValue has changed. Both the old and new
- * values are listed in the event.
- *
- * @see #getAccessibleValue()
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public static final String ACCESSIBLE_VALUE_PROPERTY
- = "AccessibleValue";
-
- /**
- * Constant used when the accessibleSelection has changed. Both the old and
- * new values of the event are reserved for future use.
- *
- * @see #getAccessibleSelection()
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public static final String ACCESSIBLE_SELECTION_PROPERTY
- = "AccessibleSelection";
-
- /**
- * Constant used when the accessibleText has changed. Both the old and new
- * values of the event are reserved for future use.
- *
- * @see #getAccessibleText()
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public static final String ACCESSIBLE_TEXT_PROPERTY
- = "AccessibleText";
-
- /**
- * Constant used when the accessibleText caret has changed. Both the old and
- * new values are listed in the event.
- *
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public static final String ACCESSIBLE_CARET_PROPERTY
- = "AccessibleCaret";
-
- /**
- * Constant used when the visible data has changed. Both the old and new
- * values of the event are reserved for future use.
- *
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public static final String ACCESSIBLE_VISIBLE_DATA_PROPERTY
- = "AccessibleVisibleData";
-
- /**
- * Constant used when children are added or removed. On addition, the new
- * value of the event holds the new child; on removal, the old value holds
- * the removed child.
- *
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public static final String ACCESSIBLE_CHILD_PROPERTY
- = "AccessibleChild";
-
- /**
- * Constant used when active descendent of a component has changed. Both
- * the old and new values are listed in the event.
- *
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public static final String ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY
- = "AccessibleActiveDescendant";
-
- /**
- * Constant used when the accessible table caption has changed. Both the
- * old and new values are listed in the event.
- *
- * @see Accessible
- * @see AccessibleTable
- */
- public static final String ACCESSIBLE_TABLE_CAPTION_CHANGED
- = "accessibleTableCaptionChanged";
-
- /**
- * Constant used when the accessible table summary has changed. Both the
- * old and new values are listed in the event.
- *
- * @see Accessible
- * @see AccessibleTable
- */
- public static final String ACCESSIBLE_TABLE_SUMMARY_CHANGED
- = "accessibleTableSummaryChanged";
-
- /**
- * Constant used when the accessible table model has changed. Only the new
- * value of the event has meaning.
- *
- * @see AccessibleTable
- * @see AccessibleTableModelChange
- */
- public static final String ACCESSIBLE_TABLE_MODEL_CHANGED
- = "accessibleTableModelChanged";
-
- /**
- * Constant used when the accessible table row header has changed. Only the
- * new value of the event has meaning.
- *
- * @see AccessibleTable
- * @see AccessibleTableModelChange
- */
- public static final String ACCESSIBLE_TABLE_ROW_HEADER_CHANGED
- = "accessibleTableRowHeaderChanged";
-
- /**
- * Constant used when the accessible table row description has changed. Only
- * the new value of the event has meaning.
- *
- * @see AccessibleTable
- */
- public static final String ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED
- = "accessibleTableRowDescriptionChanged";
-
- /**
- * Constant used when the accessible table column header has changed. Only
- * the new value of the event has meaning.
- *
- * @see AccessibleTable
- * @see AccessibleTableModelChange
- */
- public static final String ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED
- = "accessibleTableColumnHeaderChanged";
-
- /**
- * Constant used when the accessible table column description has changed.
- * Only the new value of the event has meaning.
- *
- * @see AccessibleTable
- */
- public static final String ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED
- = "accessibleTableColumnDescriptionChanged";
-
- /**
- * Constant used when supported set of actions has changed. Both the old
- * and new values are listed in the event.
- *
- * @see AccessibleAction
- */
- public static final String ACCESSIBLE_ACTION_PROPERTY
- = "accessibleActionProperty";
-
- /**
- * Constant used when a hypertext element received focus. Both the old
- * and new values are listed in the event, with -1 indicating that no link
- * had focus.
- *
- * @see AccessibleHyperlink
- */
- public static final String ACCESSIBLE_HYPERTEXT_OFFSET
- = "AccessibleHypertextOffset";
-
- /**
- * The accessible parent of this object.
- *
- * @see #getAccessibleParent()
- * @see #setAccessibleParent(Accessible)
- */
- protected Accessible accessibleParent;
-
- /**
- * A localized string naming this object.
- *
- * @see #getAccessibleName()
- * @see #setAccessibleName(String)
- */
- protected String accessibleName;
-
- /**
- * A localized string describing this object.
- *
- * @see #getAccessibleDescription()
- * @see #setAccessibleDescription(String)
- */
- protected String accessibleDescription;
-
- /**
- * The listener tool.
- *
- * @see #addPropertyChangeListener(PropertyChangeListener)
- * @see #removePropertyChangeListener(PropertyChangeListener)
- * @see #firePropertyChange(String, Object, Object)
- */
- private final PropertyChangeSupport listeners
- = new PropertyChangeSupport(this);
-
- /**
- * Default constructor.
- */
- public AccessibleContext()
- {
- }
-
- /**
- * Get the localized name of the object. For example, a label may just
- * return the text of the label, while an entry field for city may return
- * "city" in en_US.
- *
- * @return the accessible object's name, or null if it is unnamed
- * @see #setAccessibleName(String)
- */
- public String getAccessibleName()
- {
- return accessibleName;
- }
-
- /**
- * Set the localized name of the object. This will fire a
- * PropertyChangeEvent with ACCESSIBLE_NAME_PROPERTY.
- *
- * @param s the new name
- * @see #getAccessibleName()
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public void setAccessibleName(String s)
- {
- listeners.firePropertyChange(ACCESSIBLE_NAME_PROPERTY, accessibleName, s);
- accessibleName = s;
- }
-
- /**
- * Get the localized description of the object. For example, a 'Cancel'
- * button may be described as "Ignore changes and close dialog box" in
- * en_US.
- *
- * @return the accessible object's description, or null if there is none
- * @see #setAccessibleDescription(String)
- */
- public String getAccessibleDescription()
- {
- return accessibleDescription;
- }
-
- /**
- * Set the localized name of the object. This will fire a
- * PropertyChangeEvent with ACCESSIBLE_DESCRIPTION_PROPERTY.
- *
- * @param s the new description
- * @see #getAccessibleDescription()
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public void setAccessibleDescription(String s)
- {
- listeners.firePropertyChange(ACCESSIBLE_DESCRIPTION_PROPERTY,
- accessibleDescription, s);
- accessibleDescription = s;
- }
-
- /**
- * Gets the role of this object. For example, a button serves the role of
- * AccessibleRole.PUSH_BUTTON. This allows assistive technologies to funnel
- * similar objects into the same assistance classes. Note that the class
- * is extensible, to define new roles if necessary.
- *
- * @return the role of the object
- * @see AccessibleRole
- */
- public abstract AccessibleRole getAccessibleRole();
-
- /**
- * Gets the state set of this object. A change in the state of the object
- * will fire a PropertyChangeEvent for ACCESSIBLE_STATE_PROPERTY.
- *
- * @return the current state of the object
- * @see AccessibleState
- * @see AccessibleStateSet
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public abstract AccessibleStateSet getAccessibleStateSet();
-
- /**
- * Return the accessible parent of this object.
- *
- * @return the accessible parent, or null if there is none
- */
- public Accessible getAccessibleParent()
- {
- return accessibleParent;
- }
-
- /**
- * Sets the accessible parent of this object. This should only be used when
- * the current parent object should not be the accessible parent; only the
- * parent of the accessible child should call this method.
- *
- * @param a the new parent
- */
- public void setAccessibleParent(Accessible a)
- {
- accessibleParent = a;
- }
-
- /**
- * Gets the index of this object within its accessible parent.
- *
- * @return the 0-based index, or -1 if there is no accessible parent
- * @see #getAccessibleParent()
- * @see #getAccessibleChildrenCount()
- * @see #getAccessibleChild(int)
- */
- public abstract int getAccessibleIndexInParent();
-
- /**
- * Returns the number of accessible children of this object.
- *
- * @return the number of accessible children
- * @see #getAccessibleChild(int)
- */
- public abstract int getAccessibleChildrenCount();
-
- /**
- * Returns the specified accessible chile.
- *
- * @param i the 0-based index to get
- * @return the child, or null if out of bounds
- * @see #getAccessibleChildrenCount()
- */
- public abstract Accessible getAccessibleChild(int i);
-
- /**
- * Gets the component locale, deferring to the parent if one is not declared.
- *
- * @return the locale
- * @throws java.awt.IllegalComponentStateException if there is no locale
- * or parent
- */
- public abstract Locale getLocale();
-
- /**
- * Add a PropertyChangeListener to the listener list. This listener will
- * be notified of all property changes to the accessible object.
- *
- * @param l the listener to add
- * @see #ACCESSIBLE_NAME_PROPERTY
- * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
- * @see #ACCESSIBLE_STATE_PROPERTY
- * @see #ACCESSIBLE_VALUE_PROPERTY
- * @see #ACCESSIBLE_SELECTION_PROPERTY
- * @see #ACCESSIBLE_TEXT_PROPERTY
- * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
- * @see #removePropertyChangeListener(PropertyChangeListener)
- */
- public void addPropertyChangeListener(PropertyChangeListener l)
- {
- listeners.addPropertyChangeListener(l);
- }
-
- /**
- * Remove a PropertyChangeListener from the listener list.
- *
- * @param l the listener to remove
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public void removePropertyChangeListener(PropertyChangeListener l)
- {
- listeners.removePropertyChangeListener(l);
- }
-
- /**
- * Get any supported accessible actions. The default implementation returns
- * null.
- *
- * @return the supported action, or null
- * @see AccessibleAction
- */
- public AccessibleAction getAccessibleAction()
- {
- return null;
- }
-
- /**
- * Get any supported accessible compoent. The default implementation returns
- * null.
- *
- * @return the supported component, or null
- * @see AccessibleComponent
- */
- public AccessibleComponent getAccessibleComponent()
- {
- return null;
- }
-
- /**
- * Get any supported accessible selection. The default implementation returns
- * null.
- *
- * @return the supported selection, or null
- * @see AccessibleSelection
- */
- public AccessibleSelection getAccessibleSelection()
- {
- return null;
- }
-
- /**
- * Get any supported accessible text. The default implementation returns
- * null.
- *
- * @return the supported text, or null
- * @see AccessibleText
- */
- public AccessibleText getAccessibleText()
- {
- return null;
- }
-
- /**
- * Get any supported accessible editable text. The default implementation
- * returns null.
- *
- * @return the supported editable text, or null
- * @see AccessibleEditableText
- */
- public AccessibleEditableText getAccessibleEditableText()
- {
- return null;
- }
-
- /**
- * Get any supported accessible value. The default implementation returns
- * null.
- *
- * @return the supported value, or null
- * @see AccessibleValue
- */
- public AccessibleValue getAccessibleValue()
- {
- return null;
- }
-
- /**
- * Get all supported accessible icons. The default implementation returns
- * null.
- *
- * @return the supported icons, or null
- * @see AccessibleIcon
- */
- public AccessibleIcon[] getAccessibleIcon()
- {
- return null;
- }
-
- /**
- * Get any supported accessible relation set. The default implementation
- * returns null.
- *
- * @return the supported relation set, or null
- * @see AccessibleRelationSet
- */
- public AccessibleRelationSet getAccessibleRelationSet()
- {
- return null;
- }
-
- /**
- * Get any supported accessible table. The default implementation returns
- * null.
- *
- * @return the supported table, or null
- * @see AccessibleTable
- */
- public AccessibleTable getAccessibleTable()
- {
- return null;
- }
-
- /**
- * Fire an event to report property changes. This is intended for use by
- * the accessible objects, not general application programs. If oldValue and
- * newValue differ, and the listenter list is not empty, a PropertyChange
- * event is fired to each listener.
- *
- * @param name the property name
- * @param oldValue the prior value
- * @param newValue the updated value
- * @see PropertyChangeSupport
- * @see #addPropertyChangeListener(PropertyChangeListener)
- * @see #removePropertyChangeListener(PropertyChangeListener)
- * @see #ACCESSIBLE_NAME_PROPERTY
- * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
- * @see #ACCESSIBLE_STATE_PROPERTY
- * @see #ACCESSIBLE_VALUE_PROPERTY
- * @see #ACCESSIBLE_SELECTION_PROPERTY
- * @see #ACCESSIBLE_TEXT_PROPERTY
- * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
- */
- public void firePropertyChange(String name, Object oldValue, Object newValue)
- {
- listeners.firePropertyChange(name, oldValue, newValue);
- }
-} // class AccessibleContext
diff --git a/libjava/javax/accessibility/AccessibleEditableText.java b/libjava/javax/accessibility/AccessibleEditableText.java
deleted file mode 100644
index 07d7530e4f4..00000000000
--- a/libjava/javax/accessibility/AccessibleEditableText.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/* AccessibleEditableText.java -- aids in accessibly for editable text
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-import javax.swing.text.AttributeSet;
-
-/**
- * Objects which present editable textual information on the display should
- * implement this interface. Accessibility software can use the
- * implementations of this interface to change the content, attributes,
- * and spacial location of the text.
- *
- * <p>The <code>AccessibleContext.getAccessibleEditableText()</code> method
- * should return <code>null</code> if an object does not implement this
- * interface.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleText()
- * @see AccessibleContext#getAccessibleEditableText()
- * @since 1.2
- * @status updated to 1.4, except for javax.swing support
- */
-public interface AccessibleEditableText extends AccessibleText
-{
- /**
- * Set the text contents to the given string.
- *
- * @param s the new text
- */
- // XXX What happens if s is null?
- void setTextContents(String s);
-
- /**
- * Inserts the given string at the specified location.
- *
- * @param index the index for insertion
- * @param s the new text
- */
- // XXX What happens if index is out of bounds, or s is null?
- void insertTextAtIndex(int index, String s);
-
- /**
- * Return the text between two points.
- *
- * @param start the start position, inclusive
- * @param end the end position, exclusive
- */
- // XXX What happens if indices are out of bounds?
- String getTextRange(int start, int end);
-
- /**
- * Delete the text between two points.
- *
- * @param start the start position, inclusive
- * @param end the end position, exclusive
- */
- // XXX What happens if indices are out of bounds?
- void delete(int start, int end);
-
- /**
- * Cut the text between two points to the system clipboard.
- *
- * @param start the start position, inclusive
- * @param end the end position, exclusive
- */
- // XXX What happens if indices are out of bounds?
- void cut(int start, int end);
-
- /**
- * Paste the text from the system clipboard at the given index.
- *
- * @param start the start position
- */
- // XXX What happens if start is out of bounds?
- void paste(int start);
-
- /**
- * Replace the text between two points with the given string.
- *
- * @param start the start position, inclusive
- * @param end the end position, exclusive
- * @param s the string to paste
- */
- // XXX What happens if indices are out of bounds, or s is null?
- void replaceText(int start, int end, String s);
-
- /**
- * Select the text between two points.
- *
- * @param start the start position, inclusive
- * @param end the end position, exclusive
- */
- // XXX What happens if indices are out of bounds?
- void selectText(int start, int stop);
-
- /**
- * Set the attributes of text between two points.
- *
- * @param start the start position, inclusive
- * @param end the end position, exclusive
- * @param s the new attribute set for the range
- */
- // XXX What happens if indices are out of bounds, or s is null?
- void setAttributes(int start, int end, AttributeSet s);
-} // interface AccessibleEditableText
diff --git a/libjava/javax/accessibility/AccessibleExtendedComponent.java b/libjava/javax/accessibility/AccessibleExtendedComponent.java
deleted file mode 100644
index 5b751f6eb08..00000000000
--- a/libjava/javax/accessibility/AccessibleExtendedComponent.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* AccessibleExtendedComponent.java -- aids in extended component access
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * Objects which present graphical components with extensions such as key
- * bindings or tool-tips should implement this interface. Accessibility
- * software can use the implementations of this interface to display the
- * extended information of the component.
- *
- * <p>The <code>AccessibleContext.getAccessibleComponent()</code> method
- * should return an instance of this interface only when it is supported.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleComponent()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleExtendedComponent extends AccessibleComponent
-{
- /**
- * Returns the tool-tip text for this component.
- *
- * @return the tool-tip, or null if not supported
- */
- String getToolTipText();
-
- /**
- * Returns the title border text for this component.
- *
- * @return the titled border text, or null if not supported
- */
- String getTitledBorderText();
-
- /**
- * Returns the accessible key bindings for this component.
- *
- * @return the key bindings, or null if not supported
- */
- AccessibleKeyBinding getAccessibleKeyBinding();
-} // interface AccessibleExtendedComponent
diff --git a/libjava/javax/accessibility/AccessibleExtendedTable.java b/libjava/javax/accessibility/AccessibleExtendedTable.java
deleted file mode 100644
index 999c1f0b5c7..00000000000
--- a/libjava/javax/accessibility/AccessibleExtendedTable.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* AccessibleExtendedTable.java -- aids in extended table access
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * Objects which present 2-D tables with the extension of a flat address
- * space should implement this interface. Accessibility software can use the
- * implementations of this interface to better manipulate the table.
- *
- * <p>The <code>AccessibleContext.getAccessibleTable()</code> method
- * should return an instance of this interface only when it is supported.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleTable()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleExtendedTable extends AccessibleTable
-{
- /**
- * Returns the row number of an index in the table.
- *
- * @param index the cell index, in row-major form from (0,0)
- * @return the row number, or -1 if out of bounds
- */
- int getAccessibleRow(int index);
-
- /**
- * Returns the column number of an index in the table.
- *
- * @param index the cell index, in row-major form from (0,0)
- * @return the column number, or -1 if out of bounds
- */
- int getAccessibleColumn(int index);
-
- /**
- * Returns the cell number for a row-major address from (0,0).
- *
- * @param r the row
- * @param c the column
- * @return the cell index
- */
- int getAccessibleIndex(int r, int c);
-} // interface AccessibleExtendedTable
diff --git a/libjava/javax/accessibility/AccessibleHyperlink.java b/libjava/javax/accessibility/AccessibleHyperlink.java
deleted file mode 100644
index aec1f2a9cd3..00000000000
--- a/libjava/javax/accessibility/AccessibleHyperlink.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/* AccessibleHyperlink.java -- aids in accessibly navigating hypertext
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * This object encapsulates actions associated with navigating hypertext.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleText
- * @see AccessibleContext#getAccessibleText()
- * @since 1.2
- * @status updated to 1.4
- */
-public abstract class AccessibleHyperlink implements AccessibleAction
-{
- /**
- * The default constructor.
- */
- public AccessibleHyperlink()
- {
- }
-
- /**
- * Returns whether the document the link references is still valid, as the
- * association may have changed with a text edit.
- *
- * @return true if the link is valid with respect to the AccessibleHypertext
- */
- public abstract boolean isValid();
-
- /**
- * Get the number possible actions for this object, starting from 0. In
- * general, a hypertext link has only one action, except for an image map,
- * so there isn't really a default action.
- *
- * @return the 0-based number of actions
- */
- public abstract int getAccessibleActionCount();
-
- /**
- * Perform the specified action. Does nothing if out of bounds.
- *
- * @param i the action to perform, 0-based
- * @return true if the action was performed
- * @see #getAccessibleActionCount()
- */
- public abstract boolean doAccessibleAction(int i);
-
- /**
- * Get the anchor text of the link, or null if the index is out of bounds.
- * For example, &lt;a href="http://www.gnu.org/"&gt;GNU Home Page&lt;/a&gt;
- * would return "GNU Home Page", while &lt;a HREF="#top"&gt;
- * &lt;img src="top-hat.png" alt="top hat"&gt;&lt;/a&gt; would return
- * "top hat".
- *
- * @param i the link to retrieve, 0-based
- * @return the link anchor text
- * @see #getAccessibleActionCount()
- */
- public abstract String getAccessibleActionDescription(int i);
-
- /**
- * Get the link location, or null if the index is out of bounds. For
- * example, &lt;a href="http://www.gnu.org/"&gt;GNU Home Page&lt;/a&gt;
- * would return a java.net.URL("http://www.gnu.org/").
- *
- * @param i the link to retrieve, 0-based
- * @return the link location
- * @see #getAccessibleActionCount()
- */
- public abstract Object getAccessibleActionObject(int i);
-
- /**
- * Get the anchor appropriate for the link, or null if the index is out of
- * bounds. For example, &lt;a href="http://www.gnu.org/"&gt;GNU Home Page
- * &lt;/a&gt; would return "GNU Home Page", while &lt;a HREF="#top"&gt;
- * &lt;img src="top-hat.png" alt="top hat"&gt;&lt;/a&gt; would return
- * an ImageIcon("top-hat.png", "top hat").
- *
- * @param i the link to retrieve, 0-based
- * @return the link anchor object
- * @see #getAccessibleActionCount()
- */
- public abstract Object getAccessibleActionAnchor(int i);
-
- /**
- * Gets the character index where this link starts in the parent hypertext
- * document.
- *
- * @return the starting index
- */
- public abstract int getStartIndex();
-
- /**
- * Gets the character index where this link ends in the parent hypertext
- * document.
- *
- * @return the ending index
- */
- public abstract int getEndIndex();
-} // class AccessibleAction
diff --git a/libjava/javax/accessibility/AccessibleHypertext.java b/libjava/javax/accessibility/AccessibleHypertext.java
deleted file mode 100644
index c70357272fc..00000000000
--- a/libjava/javax/accessibility/AccessibleHypertext.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* AccessibleHypertext.java -- aids in accessibly rendering hypertext
- Copyright (C) 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * Objects which present hyperlinks in a document should implement this
- * interface. Accessibility software can use the implementations of this
- * interface to aid the user in navigating the links.
- *
- * <p>The <code>AccessibleContext.getAccessibleText()</code> method
- * should return an instance of this interface only when it is supported.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleText
- * @see AccessibleContext#getAccessibleText()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleHypertext extends AccessibleText
-{
- /**
- * Returns the number of links in the document, if any exist.
- *
- * @return the number of links, or -1
- */
- int getLinkCount();
-
- /**
- * Returns link object denoted by the number <code>i</code> in this
- * document, or null if i is out of bounds.
- *
- * @param i the ith hyperlink of the document
- * @return link object denoted by <code>i</code>
- */
- AccessibleHyperlink getLink(int i);
-
- /**
- * Returns the link index for this character index if it resides within
- * one of the hyperlinks of the document. If no association exists at that
- * character, or c is out of bounds, returns -1.
- *
- * @param c the character index
- * @return the link index, or -1
- */
- int getLinkIndex(int c);
-} // interface AccessibleHypertext
diff --git a/libjava/javax/accessibility/AccessibleIcon.java b/libjava/javax/accessibility/AccessibleIcon.java
deleted file mode 100644
index 22786e5f3d1..00000000000
--- a/libjava/javax/accessibility/AccessibleIcon.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* AccessibleIcon.java -- aids in accessibly rendering icons
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * Objects which have an associated icon, such as buttons, should implement
- * this interface. Accessibility software can use the implementations of this
- * interface to aid the user in navigating the links.
- *
- * <p>The <code>AccessibleContext.getAccessibleIcon()</code> method should
- * return <code>null</code> if an object does not implement this interface.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleIcon()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleIcon
-{
- /**
- * Returns a textual description of the icon and its purpose.
- *
- * @return the description, or null if there is none
- */
- String getAccessibleIconDescription();
-
- /**
- * Modify the textual description of the icon and its purpose.
- *
- * @param s the new descrption string
- */
- void setAccessibleIconDescription(String s);
-
- /**
- * Get the icon width.
- *
- * @return the width
- */
- int getAccessibleIconWidth();
-
- /**
- * Get the icon height.
- *
- * @return the height
- */
- int getAccessibleIconHeight();
-} // interface AccessibleIcon
diff --git a/libjava/javax/accessibility/AccessibleKeyBinding.java b/libjava/javax/accessibility/AccessibleKeyBinding.java
deleted file mode 100644
index b3a3ac45366..00000000000
--- a/libjava/javax/accessibility/AccessibleKeyBinding.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* AccessibleKeyBinding.java -- aids in using keyboard navigation
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * Objects which have keyboard bindings for mneumonics or shortcuts should
- * implement this interface. Accessibility software can use the
- * implementations of this interface to aid the user in using the key
- * bindings.
- *
- * <p>The <code>AccessibleContext.getAccessibleKeyBinding()</code> method
- * should return <code>null</code> if an object does not implement this
- * interface.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleKeyBinding()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleKeyBinding
-{
- /**
- * Returns the count of key bindings for this object.
- *
- * @return the 0-based count, or -1 if there are none
- */
- int getAccessibleKeyBindingCount();
-
- /**
- * Return the numbered key binding, which can then be cast in an
- * implementation dependent way to the appropriate object type. For example,
- * swing uses <code>javax.swing.KeyStroke</code>. This returns null if i
- * is out of bounds.
- *
- * @param i the 0-based index of key bindings
- * @return the key binding
- * @see #getAccessibleKeyBindingCount()
- */
- Object getAccessibleKeyBinding(int i);
-} // interface AccessibleKeyBinding
diff --git a/libjava/javax/accessibility/AccessibleRelation.java b/libjava/javax/accessibility/AccessibleRelation.java
deleted file mode 100644
index bed45625a72..00000000000
--- a/libjava/javax/accessibility/AccessibleRelation.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/* AccessibleRelation.java -- the relation between accessible objects
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * The relation between one accessible object and one or more other objects.
- * For example, a button may control an action. An AccessibleRelationSet
- * summarizes all relations of the object. This strongly typed "enumeration"
- * supports localized strings. If the constants of this class are not
- * adequate, new ones may be added in a similar matter.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public class AccessibleRelation extends AccessibleBundle
-{
- /**
- * Indicates the object labels other objects.
- *
- * @see #getTarget()
- * @see #CONTROLLER_FOR
- * @see #CONTROLLED_BY
- * @see #LABELED_BY
- * @see #MEMBER_OF
- */
- public static final String LABEL_FOR = "labelFor";
-
- /**
- * Indicates the object is labeled by other objects.
- *
- * @see #getTarget()
- * @see #CONTROLLER_FOR
- * @see #CONTROLLED_BY
- * @see #LABEL_FOR
- * @see #MEMBER_OF
- */
- public static final String LABELED_BY = "labeledBy";
-
- /**
- * Indicates an object is a member of a group of target objects.
- *
- * @see #getTarget()
- * @see #CONTROLLER_FOR
- * @see #CONTROLLED_BY
- * @see #LABEL_FOR
- * @see #LABELED_BY
- */
- public static final String MEMBER_OF = "memberOf";
-
- /**
- * Indicates an object is a controller for other objects.
- *
- * @see #getTarget()
- * @see #CONTROLLED_BY
- * @see #LABEL_FOR
- * @see #LABELED_BY
- * @see #MEMBER_OF
- */
- public static final String CONTROLLER_FOR = "controllerFor";
-
- /**
- * Indicates an object is controlled by other objects.
- *
- * @see #getTarget()
- * @see #CONTROLLER_FOR
- * @see #LABEL_FOR
- * @see #LABELED_BY
- * @see #MEMBER_OF
- */
- public static final String CONTROLLED_BY = "controlledBy";
-
- /** Indicates that the label target group has changed. */
- public static final String LABEL_FOR_PROPERTY = "labelForProperty";
-
- /** Indicates that the labelling objects have changed. */
- public static final String LABELED_BY_PROPERTY = "labeledByProperty";
-
- /** Indicates that group membership has changed. */
- public static final String MEMBER_OF_PROPERTY = "memberOfProperty";
-
- /** Indicates that the controller target group has changed. */
- public static final String CONTROLLER_FOR_PROPERTY = "controllerForProperty";
-
- /** Indicates that the controlling objects have changed. */
- public static final String CONTROLLED_BY_PROPERTY = "controlledByProperty";
-
- /** An empty set of targets. */
- private static final Object[] EMPTY_TARGETS = { };
-
- /**
- * The related objects.
- *
- * @see #getTarget()
- * @see #setTarget(Object)
- * @see #setTarget(Object[])
- */
- Object[] targets;
-
- /**
- * Create a new relation with a locale independent key, and no related
- * objects.
- *
- * @param key the name of the role
- * @see #toDisplayString(String, Locale)
- */
- public AccessibleRelation(String key)
- {
- this.key = key;
- targets = EMPTY_TARGETS;
- }
-
- /**
- * Create a new relation with a locale independent key, and a single related
- * object.
- *
- * @param key the name of the role
- * @param target the related object
- * @see #toDisplayString(String, Locale)
- */
- public AccessibleRelation(String key, Object target)
- {
- this.key = key;
- targets = new Object[] { target };
- }
-
- /**
- * Create a new relation with a locale independent key, and the given
- * related objects.
- *
- * @param key the name of the role
- * @param targets the related objects
- * @see #toDisplayString(String, Locale)
- */
- public AccessibleRelation(String key, Object[] targets)
- {
- this.key = key;
- this.targets = targets == null ? EMPTY_TARGETS : targets;
- }
-
- /**
- * Return the key for this relation.
- *
- * @return the key
- * @see #CONTROLLER_FOR
- * @see #CONTROLLED_BY
- * @see #LABEL_FOR
- * @see #LABELED_BY
- * @see #MEMBER_OF
- */
- public String getKey()
- {
- return key;
- }
-
- /**
- * Return the targets of this relation.
- *
- * @return the targets, may be empty, but never null
- */
- public Object[] getTarget()
- {
- return targets;
- }
-
- /**
- * Set the target to a single object.
- *
- * @param target the new target
- */
- public void setTarget(Object target)
- {
- targets = new Object[] { target };
- }
-
- /**
- * Set the target to an array of objects.
- *
- * @param targets the new targets
- */
- public void setTarget(Object[] targets)
- {
- this.targets = targets == null ? EMPTY_TARGETS : targets;
- }
-} // class AccessibleRelation
diff --git a/libjava/javax/accessibility/AccessibleRelationSet.java b/libjava/javax/accessibility/AccessibleRelationSet.java
deleted file mode 100644
index 522bec394b4..00000000000
--- a/libjava/javax/accessibility/AccessibleRelationSet.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/* AccessibleRelationSet.java -- the combined relations of an accessible object
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-import java.util.Vector;
-
-/**
- * Describes all relations of an accessible object. For example, an object
- * by labeled by one object and control another.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see AccessibleRelation
- * @since 1.2
- * @status updated to 1.4
- */
-public class AccessibleRelationSet
-{
- /**
- * The list of relations, should be instances of AccessibleRelation. Don't
- * set this to null.
- *
- * @see #add(AccessibleRelation)
- * @see #addAll(AccessibleRelation[])
- * @see #remove(AccessibleRelation)
- * @see #contains(String)
- * @see #get(String)
- * @see #size()
- * @see #toArray()
- * @see #clear()
- */
- protected Vector relations = new Vector();
-
- /**
- * Create an empty relation set.
- */
- public AccessibleRelationSet()
- {
- }
-
- /**
- * Create a relation set initialized with the given relations, duplicates are
- * ignored.
- *
- * @param relations the relations to insert
- * @throws NullPointerException if relations is null
- */
- public AccessibleRelationSet(AccessibleRelation[] relations)
- {
- addAll(relations);
- }
-
- /**
- * Add a new relation to the current set. If the relation is already in
- * the set, the targets are merged with the existing relation, possibly
- * resulting in an object being in the target list more than once. Do not
- * add a relation with a null key, as it will cause problems later.
- *
- * @param relation the relation to add
- * @return true if the set was modified, which is always the case
- * @throws NullPointerException if relation is null
- */
- public boolean add(AccessibleRelation relation)
- {
- AccessibleRelation old = get(relation.key);
- if (old == null)
- return relations.add(relation);
- if (old.targets.length == 0)
- old.targets = relation.targets;
- else if (relation.targets.length != 0)
- {
- Object[] t = new Object[old.targets.length + relation.targets.length];
- System.arraycopy(old.targets, 0, t, 0, old.targets.length);
- System.arraycopy(relation.targets, 0, t, old.targets.length,
- relation.targets.length);
- old.targets = t;
- }
- return true;
- }
-
- /**
- * Add all of the relations to the current set. Duplicates are ignored.
- *
- * @param array the array of relations to add
- * @throws NullPointerException if array is null or has null entries
- */
- public void addAll(AccessibleRelation[] array)
- {
- int i = array.length;
- while (--i >= 0)
- add(array[i]);
- }
-
- /**
- * Remove a relation from the set. If a relation was removed, return true.
- * Note that this uses AccessibleRelation.equals, which defaults to ==, so a
- * relation with the same key may still exist in the set afterwords.
- *
- * @param relation the state to remove
- * @return true if the set changed
- */
- public boolean remove(AccessibleRelation relation)
- {
- return relations.remove(relation);
- }
-
- /**
- * Clear all relations in the set.
- */
- public void clear()
- {
- relations.clear();
- }
-
- /**
- * Return the number of relations in the set.
- *
- * @return the set size
- */
- public int size()
- {
- return relations.size();
- }
-
- /**
- * Check if the relation key is in the set.
- *
- * @param relation the relation to locate
- * @return true if it is in the set
- */
- public boolean contains(String key)
- {
- int i = relations.size();
- while (--i >= 0)
- if (((AccessibleRelation) relations.get(i)).key.equals(key))
- return true;
- return false;
- }
-
- /**
- * Get the relation that matches the key.
- *
- * @param relation the relation to locate
- * @return the relation in the set, or null
- */
- public AccessibleRelation get(String key)
- {
- int i = relations.size();
- while (--i >= 0)
- {
- AccessibleRelation r = (AccessibleRelation) relations.get(i);
- if (r.key.equals(key))
- return r;
- }
- return null;
- }
-
- /**
- * Return the relation set as an array.
- *
- * @return an array of the current relations
- */
- public AccessibleRelation[] toArray()
- {
- AccessibleRelation[] result = new AccessibleRelation[relations.size()];
- relations.toArray(result);
- return result;
- }
-
- /**
- * Return a localized, comma-separated string representing all relations
- * in the set. This is in arbitrary order.
- *
- * @return the string representation
- * @see AccessibleBundle#toDisplayString(String, Locale)
- */
- public String toString()
- {
- int i = relations.size();
- if (i == 0)
- return "";
- // Pre-allocate an average of 10 chars per state.
- StringBuffer b = new StringBuffer(i * 10);
- while (--i >= 0)
- b.append(relations.get(i)).append(',');
- return b.substring(0, b.length() - 1);
- }
-} // class AccessibleRelationSet
diff --git a/libjava/javax/accessibility/AccessibleResourceBundle.java b/libjava/javax/accessibility/AccessibleResourceBundle.java
deleted file mode 100644
index 151a156f31f..00000000000
--- a/libjava/javax/accessibility/AccessibleResourceBundle.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* AccessibleResourceBundle.java -- deprecated class
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-import java.util.ListResourceBundle;
-
-/**
- * This class is deprecated. It once was used for localizing accessibility
- * strings, and was never meant for external use anyway.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see AccessibleBundle.toDisplayString(String, Locale)
- * @since 1.2
- * @deprecated this class is no longer used
- * @status updated to 1.4
- */
-public class AccessibleResourceBundle extends ListResourceBundle
-{
- /**
- * Default constructor.
- *
- * @deprecated do not use this class
- */
- public AccessibleResourceBundle()
- {
- }
-
- /**
- * Returns the mapping between keys and display strings.
- *
- * @return null
- * @deprecated do not use this class
- */
- public Object[][] getContents()
- {
- return null;
- }
-} // class AccessibleResourceBundle
diff --git a/libjava/javax/accessibility/AccessibleRole.java b/libjava/javax/accessibility/AccessibleRole.java
deleted file mode 100644
index 841d20a78ba..00000000000
--- a/libjava/javax/accessibility/AccessibleRole.java
+++ /dev/null
@@ -1,478 +0,0 @@
-/* AccessibleRole.java -- the primary role of an accessible object
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * The role of an accessible object. For example, this could be "button" or
- * "table". This strongly typed "enumeration" supports localized strings. If
- * the constants of this class are not adequate, new ones may be added in a
- * similar matter, while avoiding a public constructor.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public class AccessibleRole extends AccessibleBundle
-{
- /** The object alerts the user about something. */
- public static final AccessibleRole ALERT
- = new AccessibleRole("alert");
-
- /** The header for a column of data. */
- public static final AccessibleRole COLUMN_HEADER
- = new AccessibleRole("column header");
-
- /**
- * The object can be drawn into, and traps events.
- *
- * @see #FRAME
- * @see #GLASS_PANE
- * @see #LAYERED_PANE
- */
- public static final AccessibleRole CANVAS
- = new AccessibleRole("canvas");
-
- /**
- * A list of choices, which may optionally allow the user to create a new
- * choice.
- */
- public static final AccessibleRole COMBO_BOX
- = new AccessibleRole("combo box");
-
- /**
- * An iconified frame in a desktop.
- *
- * @see #DESKTOP_PANE
- * @see #INTERNAL_FRAME
- */
- public static final AccessibleRole DESKTOP_ICON
- = new AccessibleRole("desktop icon");
-
- /**
- * A frame-like object clipped by a desktop pane.
- *
- * @see #DESKTOP_ICON
- * @see #DESKTOP_PANE
- * @see #FRAME
- */
- public static final AccessibleRole INTERNAL_FRAME
- = new AccessibleRole("internal frame");
-
- /**
- * A pane which supports internal frames and their icons.
- *
- * @see #DESKTOP_ICON
- * @see #INTERNAL_FRAME
- */
- public static final AccessibleRole DESKTOP_PANE
- = new AccessibleRole("desktop pane");
-
- /**
- * A specialized pane for use in a dialog.
- *
- * @see #DIALOG
- */
- public static final AccessibleRole OPTION_PANE
- = new AccessibleRole("option pane");
-
- /**
- * A top level window with no title or border.
- *
- * @see #FRAME
- * @see #DIALOG
- */
- public static final AccessibleRole WINDOW
- = new AccessibleRole("window");
-
- /**
- * A top level window with title, menu bar, border, and so forth. It is
- * often the primary window of an application.
- *
- * @see #DIALOG
- * @see #CANVAS
- * @see #WINDOW
- */
- public static final AccessibleRole FRAME
- = new AccessibleRole("frame");
-
- /**
- * A top level window title bar and border. It is limited compared to a
- * frame, and is often a secondary window.
- *
- * @see #FRAME
- * @see #WINDOW
- */
- public static final AccessibleRole DIALOG
- = new AccessibleRole("dialog");
-
- /** A specialized dialog for choosing a color. */
- public static final AccessibleRole COLOR_CHOOSER
- = new AccessibleRole("color chooser");
-
- /**
- * A pane for navigating through directories.
- *
- * @see #FILE_CHOOSER
- */
- public static final AccessibleRole DIRECTORY_PANE
- = new AccessibleRole("directory pane");
-
- /**
- * A specialized dialog that allows a user to select a file.
- *
- * @see #DIRECTORY_PANE
- */
- public static final AccessibleRole FILE_CHOOSER
- = new AccessibleRole("file chooser");
-
- /** An object to fill space between other components. */
- public static final AccessibleRole FILLER
- = new AccessibleRole("filler");
-
- /** A hypertext anchor. */
- public static final AccessibleRole HYPERLINK
- = new AccessibleRole("hyperlink");
-
- /** A small picture to decorate components. */
- public static final AccessibleRole ICON
- = new AccessibleRole("icon");
-
- /** An object to label something in a graphic interface. */
- public static final AccessibleRole LABEL
- = new AccessibleRole("label");
-
- /**
- * A specialized pane with a glass pane and layered pane as children.
- *
- * @see #GLASS_PANE
- * @see #LAYERED_PANE
- */
- public static final AccessibleRole ROOT_PANE
- = new AccessibleRole("root pane");
-
- /**
- * A pane guaranteed to be painted on top of panes beneath it.
- *
- * @see #ROOT_PANE
- * @see #LAYERED_PANE
- */
- public static final AccessibleRole GLASS_PANE
- = new AccessibleRole("glass pane");
-
- /**
- * A specialized pane that allows drawing children in layers. This is often
- * used in menus and other visual components.
- *
- * @see #ROOT_PANE
- * @see #GLASS_PANE
- */
- public static final AccessibleRole LAYERED_PANE
- = new AccessibleRole("layered pane");
-
- /**
- * An object which presents a list of items for selection. Often contained
- * in a scroll pane.
- *
- * @see #SCROLL_PANE
- * @see #LIST_ITEM
- */
- public static final AccessibleRole LIST
- = new AccessibleRole("list");
-
- /**
- * An object which represents an item in a list. Often contained in a scroll
- * pane.
- *
- * @see #SCROLL_PANE
- * @see #LIST
- */
- public static final AccessibleRole LIST_ITEM
- = new AccessibleRole("list item");
-
- /**
- * An object usually at the top of a frame to list available menus.
- *
- * @see #MENU
- * @see #POPUP_MENU
- * @see #LAYERED_PANE
- */
- public static final AccessibleRole MENU_BAR
- = new AccessibleRole("menu bar");
-
- /**
- * A temporary window with a menu of options, which hides on selection.
- *
- * @see #MENU
- * @see #MENU_ITEM
- */
- public static final AccessibleRole POPUP_MENU
- = new AccessibleRole("popup menu");
-
- /**
- * An object usually in a menu bar which contains a list of actions to
- * perform. Such actions are usually associated with menu items or submenus.
- *
- * @see #MENU_BAR
- * @see #MENU_ITEM
- * @see #SEPARATOR
- * @see #RADIO_BUTTON
- * @see #CHECK_BOX
- * @see #POPUP_MENU
- */
- public static final AccessibleRole MENU
- = new AccessibleRole("menu");
-
- /**
- * An object usually in a menu with an action available for the user.
- *
- * @see #MENU_BAR
- * @see #SEPARATOR
- * @see #POPUP_MENU
- */
- public static final AccessibleRole MENU_ITEM
- = new AccessibleRole("menu item");
-
- /**
- * An object usually in a menu which separates logical sections of items.
- *
- * @see #MENU
- * @see #MENU_ITEM
- */
- public static final AccessibleRole SEPARATOR
- = new AccessibleRole("separator");
-
- /**
- * An object which presents a series of panels, usually via tabs along the
- * top. Children are all page tabs.
- *
- * @see #PAGE_TAB
- */
- public static final AccessibleRole PAGE_TAB_LIST
- = new AccessibleRole("page tab list");
-
- /**
- * An object in a page tab list, which contains the panel to display when
- * selected from the list.
- *
- * @see #PAGE_TAB_LIST
- */
- public static final AccessibleRole PAGE_TAB
- = new AccessibleRole("page tab");
-
- /** A generic container to group objects. */
- public static final AccessibleRole PANEL
- = new AccessibleRole("panel");
-
- /** An object used to track amount of a task that has completed. */
- public static final AccessibleRole PROGRESS_BAR
- = new AccessibleRole("progress bar");
-
- /** An object for passwords which should not be shown to the user. */
- public static final AccessibleRole PASSWORD_TEXT
- = new AccessibleRole("password text");
-
- /**
- * An object that can be manipulated to do something.
- *
- * @see #CHECK_BOX
- * @see #TOGGLE_BUTTON
- * @see #RADIO_BUTTON
- */
- public static final AccessibleRole PUSH_BUTTON
- = new AccessibleRole("push button");
-
- /**
- * A specialized button which can be on or off, with no separate indicator.
- *
- * @see #PUSH_BUTTON
- * @see #CHECK_BOX
- * @see #RADIO_BUTTON
- */
- public static final AccessibleRole TOGGLE_BUTTON
- = new AccessibleRole("toggle button");
-
- /**
- * A choice which can be on or off, and has a separate indicator.
- *
- * @see #PUSH_BUTTON
- * @see #TOGGLE_BUTTON
- * @see #RADIO_BUTTON
- */
- public static final AccessibleRole CHECK_BOX
- = new AccessibleRole("check box");
-
- /**
- * A specialized choice which toggles radio buttons in the group when it
- * is selected.
- *
- * @see #PUSH_BUTTON
- * @see #TOGGLE_BUTTON
- * @see #CHECK_BOX
- */
- public static final AccessibleRole RADIO_BUTTON
- = new AccessibleRole("radio button");
-
- /** The header for a row of data. */
- public static final AccessibleRole ROW_HEADER
- = new AccessibleRole("row header");
-
- /**
- * An object which allows an incremental view of a larger pane.
- *
- * @see #SCROLL_BAR
- * @see #VIEWPORT
- */
- public static final AccessibleRole SCROLL_PANE
- = new AccessibleRole("scroll pane");
-
- /**
- * An object which allows selection of the view in a scroll pane.
- *
- * @see #SCROLL_PANE
- */
- public static final AccessibleRole SCROLL_BAR
- = new AccessibleRole("scroll bar");
-
- /**
- * An object which represents the visual section in a scroll pane.
- *
- * @see #SCROLL_PANE
- */
- public static final AccessibleRole VIEWPORT
- = new AccessibleRole("viewport");
-
- /** An object which allows selection in a bounded range. */
- public static final AccessibleRole SLIDER
- = new AccessibleRole("slider");
-
- /**
- * A specialized pane which presents two other panels, and can often adjust
- * the divider between them.
- */
- public static final AccessibleRole SPLIT_PANE
- = new AccessibleRole("split pane");
-
- /** An object for presenting data in rows and columns. */
- public static final AccessibleRole TABLE
- = new AccessibleRole("table");
-
- /**
- * An object which represents text, usually editable by the user.
- *
- * @see #LABEL
- */
- public static final AccessibleRole TEXT
- = new AccessibleRole("text");
-
- /**
- * An object which represents a hierachical view of data. Subnodes can
- * often be expanded or collapsed.
- */
- public static final AccessibleRole TREE
- = new AccessibleRole("tree");
-
- /** A bar or pallete with buttons for common actions in an application. */
- public static final AccessibleRole TOOL_BAR
- = new AccessibleRole("tool bar");
-
- /**
- * An object which provides information about another object. This is often
- * displayed as a "help bubble" when a mouse hovers over the other object.
- */
- public static final AccessibleRole TOOL_TIP
- = new AccessibleRole("tool tip");
-
- /**
- * An AWT component with nothing else known about it.
- *
- * @see #SWING_COMPONENT
- * @see #UNKNOWN
- */
- public static final AccessibleRole AWT_COMPONENT
- = new AccessibleRole("AWT component");
-
- /**
- * A swing component with nothing else known about it.
- *
- * @see #AWT_COMPONENT
- * @see #UNKNOWN
- */
- public static final AccessibleRole SWING_COMPONENT
- = new AccessibleRole("SWING component");
-
- /**
- * An accessible object whose role is unknown.
- *
- * @see #AWT_COMPONENT
- * @see #SWING_COMPONENT
- */
- public static final AccessibleRole UNKNOWN
- = new AccessibleRole("unknown");
-
- /** A component with multiple labels of status information. */
- public static final AccessibleRole STATUS_BAR
- = new AccessibleRole("statusbar");
-
- /** A component which allows editing of Date and Time objects. */
- public static final AccessibleRole DATE_EDITOR
- = new AccessibleRole("dateeditor");
-
- /** A component with spinner arrows for simple numbers. */
- public static final AccessibleRole SPIN_BOX
- = new AccessibleRole("spinbox");
-
- /** A component for choosing fonts and their attributes. */
- public static final AccessibleRole FONT_CHOOSER
- = new AccessibleRole("fontchooser");
-
- /** A component with a border to group other components. */
- public static final AccessibleRole GROUP_BOX
- = new AccessibleRole("groupbox");
-
- /**
- * Create a new constant with a locale independent key. Follow the example,
- * keep the constructor private and make public constants instead.
- *
- * @param key the name of the role
- * @see #toDisplayString(String, Locale)
- */
- protected AccessibleRole(String key)
- {
- this.key = key;
- }
-} // class AccessibleRole
diff --git a/libjava/javax/accessibility/AccessibleSelection.java b/libjava/javax/accessibility/AccessibleSelection.java
deleted file mode 100644
index de26de76eee..00000000000
--- a/libjava/javax/accessibility/AccessibleSelection.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* AccessibleSelection.java -- aids in accessibly selecting components
- Copyright (C) 2000, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * If an object implements this interface then it must be able to control
- * the selection of its children. Accessibility software can use the
- * implementations of this interface to change the selection set of children.
- *
- * <p>The <code>AccessibleContext.getAccessibleSelection()</code> method should
- * return <code>null</code> if an object does not implement this interface.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleSelection()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleSelection
-{
- /**
- * Returns the number of currently selected Accessible children, which may
- * be 0 if nothing is selected.
- *
- * @return the number of selected children
- */
- int getAccessibleSelectionCount();
-
- /**
- * Returns the i-th selected child (not necessarily the overall i-th child)
- * of this Accessible object. If i is out of bounds, null is returned.
- *
- * @param i zero-based index of selected child objects
- * @return the Accessible child, or null
- * @see #getAccessibleSelectionCount()
- */
- Accessible getAccessibleSelection(int i);
-
- /**
- * Determine if i-th overall child of this accessible object is selected.
- * If i is out of bounds, false is returned.
- *
- * @param i zero-based index of child objects
- * @return true if specified child exists and is selected
- */
- boolean isAccessibleChildSelected(int i);
-
- /**
- * Select the specified child if it is not already selected, placing it in
- * the object's current selection. If the object does not support multiple
- * selections then the new selection replaces the old. If the specified
- * child is already selected, or is out of bounds, this method does nothing.
- *
- * @param i zero-based index of child objects
- */
- void addAccessibleSelection(int i);
-
- /**
- * Unselect the specified child of this Accessible object. If the specified
- * child is not selected, or is out of bounds, this method does nothing.
- *
- * @param i the zero-based index of the child objects
- */
- void removeAccessibleSelection(int i);
-
- /**
- * Unselect all children of this Accessible object.
- */
- void clearAccessibleSelection();
-
- /**
- * Select all children of this Accessible object if the object supports
- * multiple selections or has a single child. Otherwise this does nothing.
- */
- void selectAllAccessibleSelection();
-} // interface AccessibleSelection
diff --git a/libjava/javax/accessibility/AccessibleState.java b/libjava/javax/accessibility/AccessibleState.java
deleted file mode 100644
index 46135f8cbbf..00000000000
--- a/libjava/javax/accessibility/AccessibleState.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/* AccessibleState.java -- a state of an accessible object
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * A state portion of an accessible object. A combination of states represent
- * the entire object state, in an AccessibleStateSet. For example, this could
- * be "active" or "selected". This strongly typed "enumeration" supports
- * localized strings. If the constants of this class are not adequate, new
- * ones may be added in a similar matter, while avoiding a public constructor.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @since 1.2
- * @status updated to 1.4
- */
-public class AccessibleState extends AccessibleBundle
-{
- /**
- * Indicates an active window, as well as an active child in a list or other
- * collection.
- *
- * @see AccessibleRole#WINDOW
- * @see AccessibleRole#FRAME
- * @see AccessibleRole#DIALOG
- */
- public static final AccessibleState ACTIVE
- = new AccessibleState("active");
-
- /**
- * Indicates a pushed button, usually when the mouse has been pressed but
- * not released.
- *
- * @see AccessibleRole#PUSH_BUTTON
- */
- public static final AccessibleState PRESSED
- = new AccessibleState("pressed");
-
- /**
- * Indicates an armed object, usually a button which has been pushed and
- * the mouse has not left the button area.
- *
- * @see AccessibleRole#PUSH_BUTTON
- */
- public static final AccessibleState ARMED
- = new AccessibleState("armed");
-
- /**
- * Indicates an object is busy, such as a slider, scroll bar, or progress
- * bar in transition.
- *
- * @see AccessibleRole#PROGRESS_BAR
- * @see AccessibleRole#SCROLL_BAR
- * @see AccessibleRole#SLIDER
- */
- public static final AccessibleState BUSY
- = new AccessibleState("busy");
-
- /**
- * Indicates an object is checked.
- *
- * @see AccessibleRole#TOGGLE_BUTTON
- * @see AccessibleRole#RADIO_BUTTON
- * @see AccessibleRole#CHECK_BOX
- */
- public static final AccessibleState CHECKED
- = new AccessibleState("checked");
-
- /**
- * Indicates the user can edit the component contents. This is usually for
- * text, as other objects like scroll bars are automatically editable.
- *
- * @see #ENABLED
- */
- public static final AccessibleState EDITABLE
- = new AccessibleState("editable");
-
- /**
- * Indicates the object allows progressive disclosure of its children,
- * usually in a collapsible tree or other hierachical object.
- *
- * @see #EXPANDED
- * @see #COLLAPSED
- * @see AccessibleRole#TREE
- */
- public static final AccessibleState EXPANDABLE
- = new AccessibleState("expandable");
-
- /**
- * Indicates that the object is collapsed, usually in a tree.
- *
- * @see #EXPANDABLE
- * @see #EXPANDED
- * @see AccessibleRole#TREE
- */
- public static final AccessibleState COLLAPSED
- = new AccessibleState("collapsed");
-
- /**
- * Indicates that the object is expanded, usually in a tree.
- *
- * @see #EXPANDABLE
- * @see #COLLAPSED
- * @see AccessibleRole#TREE
- */
- public static final AccessibleState EXPANDED
- = new AccessibleState("expanded");
-
- /**
- * Indicates that an object is enabled. In the absence of this state,
- * graphics are often grayed out, and cannot be manipulated.
- */
- public static final AccessibleState ENABLED
- = new AccessibleState("enabled");
-
- /**
- * Indicates that an object can accept focus, which means it will process
- * keyboard events when focused.
- *
- * @see #FOCUSED
- */
- public static final AccessibleState FOCUSABLE
- = new AccessibleState("focusable");
-
- /**
- * Indicates that an object has keyboard focus.
- *
- * @see #FOCUSABLE
- */
- public static final AccessibleState FOCUSED
- = new AccessibleState("focused");
-
- /**
- * Indicates that an object is minimized to an icon.
- *
- * @see AccessibleRole#FRAME
- * @see AccessibleRole#INTERNAL_FRAME
- */
- public static final AccessibleState ICONIFIED
- = new AccessibleState("iconified");
-
- /**
- * Indicates that something must be done in the current object before
- * interaction is allowed on other windows, usually for dialogs.
- *
- * @see AccessibleRole#DIALOG
- */
- public static final AccessibleState MODAL
- = new AccessibleState("modal");
-
- /**
- * Indicates that all pixels in the object are painted. If this state is not
- * present, then the object has some degree of transparency, letting lower
- * panes show through.
- *
- * @see Accessible#getAccessibleContext()
- * @see AccessibleContext#getAccessibleComponent()
- * @see AccessibleComponent#getBounds()
- */
- public static final AccessibleState OPAQUE
- = new AccessibleState("opaque");
-
- /**
- * Indicates the size of this object is not fixed.
- *
- * @see Accessible#getAccessibleContext()
- * @see AccessibleContext#getAccessibleComponent()
- * @see AccessibleComponent#getSize()
- * @see AccessibleComponent#setSize(Dimension)
- */
- public static final AccessibleState RESIZABLE
- = new AccessibleState("resizable");
-
- /**
- * Indicates that multiple children can be selected at once.
- *
- * @see Accessible#getAccessibleContext()
- * @see AccessibleContext#getAccessibleSelection()
- * @see AccessibleSelection
- */
- public static final AccessibleState MULTISELECTABLE
- = new AccessibleState("multiselectable");
-
- /**
- * Indicates that this child is one which can be selected from its parent.
- *
- * @see #SELECTED
- * @see Accessible#getAccessibleContext()
- * @see AccessibleContext#getAccessibleSelection()
- * @see AccessibleSelection
- */
- public static final AccessibleState SELECTABLE
- = new AccessibleState("selectable");
-
- /**
- * Indicates that this child has been selected from its parent.
- *
- * @see #SELECTABLE
- * @see Accessible#getAccessibleContext()
- * @see AccessibleContext#getAccessibleSelection()
- * @see AccessibleSelection
- */
- public static final AccessibleState SELECTED
- = new AccessibleState("selected");
-
- /**
- * Indicates that this object and all its parents are visible, so that it
- * is on the screen. However, something opaque may be on top of it.
- *
- * @see #VISIBLE
- */
- public static final AccessibleState SHOWING
- = new AccessibleState("showing");
-
- /**
- * Indicates that this object intends to be visible. However, if its
- * parent is invisible, this object is as well.
- *
- * @see #SHOWING
- */
- public static final AccessibleState VISIBLE
- = new AccessibleState("visible");
-
- /**
- * Indicates that an object has vertical orientation.
- *
- * @see #HORIZONTAL
- * @see AccessibleRole#SCROLL_BAR
- * @see AccessibleRole#SLIDER
- * @see AccessibleRole#PROGRESS_BAR
- */
- public static final AccessibleState VERTICAL
- = new AccessibleState("vertical");
-
- /**
- * Indicates that an object has horizontal orientation.
- *
- * @see #VERTICAL
- * @see AccessibleRole#SCROLL_BAR
- * @see AccessibleRole#SLIDER
- * @see AccessibleRole#PROGRESS_BAR
- */
- public static final AccessibleState HORIZONTAL
- = new AccessibleState("horizontal");
-
- /**
- * Indicates that this text object can only hold a single line.
- *
- * @see #MULTI_LINE
- */
- public static final AccessibleState SINGLE_LINE
- = new AccessibleState("single line");
-
- /**
- * Indicates that this text object can hold multiple lines.
- *
- * @see #SINGLE_LINE
- */
- public static final AccessibleState MULTI_LINE
- = new AccessibleState("multiple line");
-
- /**
- * Indicates that this object is transient. This means the object is
- * generated for method queries, but will never generate events, because
- * its container (such as a tree, list, or table) does all the work.
- */
- public static final AccessibleState TRANSIENT
- = new AccessibleState("transient");
-
- /**
- * Create a new constant with a locale independent key. Follow the example,
- * keep the constructor private and make public constants instead.
- *
- * @param key the name of the state
- * @see #toDisplayString(String, Locale)
- */
- protected AccessibleState(String key)
- {
- this.key = key;
- }
-} // class AccessibleState
diff --git a/libjava/javax/accessibility/AccessibleStateSet.java b/libjava/javax/accessibility/AccessibleStateSet.java
deleted file mode 100644
index bc40dc21255..00000000000
--- a/libjava/javax/accessibility/AccessibleStateSet.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/* AccessibleStateSet.java -- the combined state of an accessible object
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-import java.util.Vector;
-
-/**
- * Describes all elements of an accessible object's state. For example, an
- * object may be enabled and have focus.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see AccessibleState
- * @since 1.2
- * @status updated to 1.4
- */
-public class AccessibleStateSet
-{
- /**
- * The list of states, should be instances of AccessibleState. Don't set
- * this to null.
- *
- * @see #add(AccessibleState)
- * @see #addAll(AccessibleState[])
- * @see #remove(AccessibleState)
- * @see #contains(AccessibleState)
- * @see #toArray()
- * @see #clear()
- */
- protected Vector states = new Vector();
-
- /**
- * Create an empty state set.
- */
- public AccessibleStateSet()
- {
- }
-
- /**
- * Create a state set initialized with the given states, duplicates are
- * ignored.
- *
- * @param states the states to insert
- * @throws NullPointerException if states is null
- */
- public AccessibleStateSet(AccessibleState[] states)
- {
- addAll(states);
- }
-
- /**
- * Add a new state to the current set. Return true if the state was added,
- * as duplicates are ignored. Entering a null state will cause problems
- * later, so don't do it.
- *
- * @param state the state to add
- * @return true if the state was added
- */
- public boolean add(AccessibleState state)
- {
- return states.contains(state) ? false : states.add(state);
- }
-
- /**
- * Add all of the states to the current set. Duplicates are ignored.
- * Entering a null state will cause problems later, so don't do it.
- *
- * @param array the array of states to add
- * @throws NullPointerException if array is null
- */
- public void addAll(AccessibleState[] array)
- {
- int i = array.length;
- while (--i >= 0)
- add(array[i]);
- }
-
- /**
- * Remove a state from the set. If a state was removed, return true.
- *
- * @param state the state to remove
- * @return true if the set changed
- */
- public boolean remove(AccessibleState state)
- {
- return states.remove(state);
- }
-
- /**
- * Clear all states in the set.
- */
- public void clear()
- {
- states.clear();
- }
-
- /**
- * Check if the current state is in the set.
- *
- * @param state the state to locate
- * @return true if it is in the set
- */
- public boolean contains(AccessibleState state)
- {
- return states.contains(state);
- }
-
- /**
- * Return the state set as an array.
- *
- * @return an array of the current states
- */
- public AccessibleState[] toArray()
- {
- AccessibleState[] result = new AccessibleState[states.size()];
- states.toArray(result);
- return result;
- }
-
- /**
- * Return a localized, comma-separated string representing all states
- * in the set. This is in arbitrary order.
- *
- * @return the string representation
- * @see AccessibleBundle#toDisplayString(String, Locale)
- */
- public String toString()
- {
- int i = states.size();
- if (i == 0)
- return "";
- // Pre-allocate an average of 10 chars per state.
- StringBuffer b = new StringBuffer(i * 10);
- while (--i >= 0)
- b.append(states.get(i)).append(',');
- return b.substring(0, b.length() - 1);
- }
-} // class AccessibleStateSet
diff --git a/libjava/javax/accessibility/AccessibleTable.java b/libjava/javax/accessibility/AccessibleTable.java
deleted file mode 100644
index 3be5177ad30..00000000000
--- a/libjava/javax/accessibility/AccessibleTable.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/* AccessibleTable.java -- aids in accessibly manipulating tables
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * Objects which present information in a 2-dimensional table should implement
- * this interface. Accessibility software can use the implementations of
- * this interface to navigate and change the attributes of the table.
- *
- * <p>The <code>AccessibleContext.getAccessibleTable()</code> method
- * should return <code>null</code> if an object does not implement this
- * interface.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleTable()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleTable
-{
- /**
- * Return the caption for the table, or null if unknown.
- *
- * @return the table caption
- */
- Accessible getAccessibleCaption();
-
- /**
- * Set the table caption.
- *
- * @param caption the new caption
- */
- void setAccessibleCaption(Accessible caption);
-
- /**
- * Return the summary description of the table, or null if unknown.
- *
- * @return the summary description
- */
- Accessible getAccessibleSummary();
-
- /**
- * Set the table summary description.
- *
- * @param summary the new summary
- */
- void setAccessibleSummary(Accessible summary);
-
- /**
- * Return the number of rows in the table.
- *
- * @return the row count
- */
- int getAccessibleRowCount();
-
- /**
- * Return the number of columns in the table.
- *
- * @return the column count
- */
- int getAccessibleColumnCount();
-
- /**
- * Return the cell at the specified row and column, or null if out of bounds.
- *
- * @param r the 0-based row index
- * @param c the 0-based column index
- * @return the cell at (r,c)
- */
- Accessible getAccessibleAt(int r, int c);
-
- /**
- * Returns the number of merged rows occupied at the specified row and
- * column, or 0 if out of bounds.
- *
- * @param r the 0-based row index
- * @param c the 0-based column index
- * @return the row extent at (r,c)
- */
- int getAccessibleRowExtentAt(int r, int c);
-
- /**
- * Returns the number of merged columns occupied at the specified row and
- * column, or 0 if out of bounds.
- *
- * @param r the 0-based row index
- * @param c the 0-based column index
- * @return the column extent at (r,c)
- */
- int getAccessibleColumnExtentAt(int r, int c);
-
- /**
- * Return the row headers as a table.
- *
- * @return the row headers, or null if there are none
- */
- AccessibleTable getAccessibleRowHeader();
-
- /**
- * Set the row headers.
- *
- * @param header the new row header
- */
- // XXX What happens if header is incompatible size?
- void setAccessibleRowHeader(AccessibleTable header);
-
- /**
- * Return the column headers as a table.
- *
- * @return the column headers, or null if there are none
- */
- AccessibleTable getAccessibleColumnHeader();
-
- /**
- * Set the column headers.
- *
- * @param header the new column header
- */
- // XXX What happens if header is incompatible size?
- void setAccessibleColumnHeader(AccessibleTable header);
-
- /**
- * Return the description of a row, or null if there is none or the index
- * is out of bounds.
- *
- * @param r the 0-based row index
- * @return the description
- */
- Accessible getAccessibleRowDescription(int r);
-
- /**
- * Set the description of a row. Does nothing if the index is invalid.
- *
- * @param r the 0-based row index
- * @param description the new description
- */
- void setAccessibleRowDescription(int r, Accessible description);
-
- /**
- * Return the description of a column, or null if there is none or the index
- * is out of bounds.
- *
- * @param c the 0-based column index
- * @return the description
- */
- Accessible getAccessibleColumnDescription(int c);
-
- /**
- * Set the description of a column. Does nothing if the index is invalid.
- *
- * @param c the 0-based column index
- * @param description the new description
- */
- void setAccessibleColumnDescription(int c, Accessible description);
-
- /**
- * Return whether the cell at the specified location is selected. Returns
- * false if the index is out of bounds.
- *
- * @param r the 0-based row index
- * @param c the 0-based column index
- * @return true if that cell is selected
- */
- boolean isAccessibleSelected(int r, int c);
-
- /**
- * Return whether the specified row is selected. Returns false if the
- * index is out of bounds.
- *
- * @param r the 0-based row index
- * @return true if that row is selected
- */
- boolean isAccessibleRowSelected(int r);
-
- /**
- * Return whether the specified column is selected. Returns false if the
- * index is out of bounds.
- *
- * @param c the 0-based column index
- * @return true if that column is selected
- */
- boolean isAccessibleColumnSelected(int c);
-
- /**
- * Return the selected rows. May be null or empty if there is no selection.
- *
- * @return the indices of selected rows
- */
- int[] getSelectedAccessibleRows();
-
- /**
- * Return the selected columns. May be null or empty if there is no
- * selection.
- *
- * @return the indices of selected columns
- */
- int[] getSelectedAccessibleColumns();
-} // interface AccessibleTable
diff --git a/libjava/javax/accessibility/AccessibleTableModelChange.java b/libjava/javax/accessibility/AccessibleTableModelChange.java
deleted file mode 100644
index 6a85d0295ea..00000000000
--- a/libjava/javax/accessibility/AccessibleTableModelChange.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* AccessibleTableModelChange.java -- describes change to an accessible table
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * Describes a change to an accessible table. Accessibility software can use
- * the implementations of this interface to update their state after a
- * change to a table.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleTable()
- * @see AccessibleTable
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleTableModelChange
-{
- /** Identifies insertion of rows or columns. */
- int INSERT = 1;
-
- /** Identifies change to existing data. */
- int UPDATE = 0;
-
- /** Identifies deletion of rows or columns. */
- int DELETE = -1;
-
- /**
- * Returns the change type.
- *
- * @return the type
- * @see #INSERT
- * @see #UPDATE
- * @see #DELETE
- */
- int getType();
-
- /**
- * Returns the first row that changed.
- *
- * @return the 0-based index of the first row to change
- */
- int getFirstRow();
-
- /**
- * Returns the last row that changed.
- *
- * @return the 0-based index of the last row to change
- */
- int getLastRow();
-
- /**
- * Returns the first column that changed.
- *
- * @return the 0-based index of the first column to change
- */
- int getFirstColumn();
-
- /**
- * Returns the last column that changed.
- *
- * @return the 0-based index of the last column to change
- */
- int getLastColumn();
-} // interface AccessibleTableModelChange
diff --git a/libjava/javax/accessibility/AccessibleText.java b/libjava/javax/accessibility/AccessibleText.java
deleted file mode 100644
index ce9bb715b1f..00000000000
--- a/libjava/javax/accessibility/AccessibleText.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/* AccessibleText.java -- aids in accessibly manipulating text
- Copyright (C) 2000, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-import java.awt.Point;
-import java.awt.Rectangle;
-
-import javax.swing.text.AttributeSet;
-
-/**
- * Objects which present textual information on the display should implement
- * this interface. Accessibility software can use the implementations of
- * this interface to change the attributes and spacial location of the text.
- *
- * <p>The <code>AccessibleContext.getAccessibleText()</code> method
- * should return <code>null</code> if an object does not implement this
- * interface.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleText()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleText
-{
- /**
- * Constant designating that the next selection should be a character.
- *
- * @see #getAtIndex(int, int)
- * @see #getAfterIndex(int, int)
- * @see #getBeforeIndex(int, int)
- */
- int CHARACTER = 1;
-
- /**
- * Constant designating that the next selection should be a word.
- *
- * @see #getAtIndex(int, int)
- * @see #getAfterIndex(int, int)
- * @see #getBeforeIndex(int, int)
- */
- int WORD = 2;
-
- /**
- * Constant designating that the next selection should be a sentence.
- *
- * @see #getAtIndex(int, int)
- * @see #getAfterIndex(int, int)
- * @see #getBeforeIndex(int, int)
- */
- int SENTENCE = 3;
-
- /**
- * Given a point in the coordinate system of this object, return the
- * 0-based index of the character at that point, or -1 if there is none.
- *
- * @param p the point to look at
- * @return the character index, or -1
- */
- int getIndexAtPoint(Point point);
-
- /**
- * Determines the bounding box of the indexed character. Returns an empty
- * rectangle if the index is out of bounds.
- *
- * @param index the 0-based character index
- * @return the bounding box, may be empty
- */
- Rectangle getCharacterBounds(int index);
-
- /**
- * Return the number of characters.
- *
- * @return the character count
- */
- int getCharCount();
-
- /**
- * Return the offset of the character. The offset matches the index of the
- * character to the right, since the carat lies between characters.
- *
- * @return the 0-based caret position
- */
- int getCaretPosition();
-
- /**
- * Returns the section of text at the index, or null if the index or part
- * is invalid.
- *
- * @param part {@link CHARACTER}, {@link WORD}, or {@link SENTENCE}
- * @param index the 0-based character index
- * @return the selection of text at that index, or null
- */
- String getAtIndex(int part, int index);
-
- /**
- * Returns the section of text after the index, or null if the index or part
- * is invalid.
- *
- * @param part {@link CHARACTER}, {@link WORD}, or {@link SENTENCE}
- * @param index the 0-based character index
- * @return the selection of text after that index, or null
- */
- String getAfterIndex(int part, int index);
-
- /**
- * Returns the section of text before the index, or null if the index or part
- * is invalid.
- *
- * @param part {@link CHARACTER}, {@link WORD}, or {@link SENTENCE}
- * @param index the 0-based character index
- * @return the selection of text before that index, or null
- */
- String getBeforeIndex(int part, int index);
-
- /**
- * Returns the attributes of a character at an index, or null if the index
- * is out of bounds.
- *
- * @param index the 0-based character index
- * @return the character's attributes
- */
- AttributeSet getCharacterAttribute(int index);
-
- /**
- * Returns the start index of the selection. If there is no selection, this
- * is the same as the caret location.
- *
- * @return the 0-based character index of the selection start
- */
- int getSelectionStart();
-
- /**
- * Returns the end index of the selection. If there is no selection, this
- * is the same as the caret location.
- *
- * @return the 0-based character index of the selection end
- */
- int getSelectionEnd();
-
- /**
- * Returns the selected text. This may be null or "" if no text is selected.
- *
- * @return the selected text
- */
- String getSelectedText();
-} // interface AccessibleText
diff --git a/libjava/javax/accessibility/AccessibleValue.java b/libjava/javax/accessibility/AccessibleValue.java
deleted file mode 100644
index 100b3ed8d60..00000000000
--- a/libjava/javax/accessibility/AccessibleValue.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* AccessibleValue.java -- aids in accessibly controlling values
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.accessibility;
-
-/**
- * If an object implements this interface then it must be able to control
- * a numerical value. For example, a scroll bar has a position represented
- * by a number. Accessibility software can use the implementations of this
- * interface to change the associated value.
- *
- * <p>The <code>AccessibleContext.getAccessibleValue()</code> method should
- * return <code>null</code> if an object does not implement this interface.
- *
- * @author Eric Blake (ebb9@email.byu.edu)
- * @see Accessible
- * @see AccessibleContext
- * @see AccessibleContext#getAccessibleValue()
- * @since 1.2
- * @status updated to 1.4
- */
-public interface AccessibleValue
-{
- /**
- * Gets the current value of this object, or null if it has not been set.
- *
- * @return the current value, or null
- * @see #setCurrentAccessibleValue(Number)
- */
- Number getCurrentAccessibleValue();
-
- /**
- * Sets the current value of this object. Returns true if the number
- * successfully changed.
- *
- * @param number the new value
- * @return true on success
- */
- // XXX What happens if number is null?
- boolean setCurrentAccessibleValue(Number number);
-
- /**
- * Gets the minimum value in the range of this object, or null if there is
- * no minimum.
- *
- * @return the minimum
- * @see #getMaximumAccessibleValue()
- */
- Number getMinimumAccessibleValue();
-
- /**
- * Gets the maximum value in the range of this object, or null if there is
- * no maximum.
- *
- * @return the maximum
- * @see #getMinimumAccessibleValue()
- */
- Number getMaximumAccessibleValue();
-} // interface AccessibleValue
diff --git a/libjava/javax/crypto/BadPaddingException.java b/libjava/javax/crypto/BadPaddingException.java
deleted file mode 100644
index a1d6dd595c6..00000000000
--- a/libjava/javax/crypto/BadPaddingException.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* BadPaddingException -- Signals bad padding bytes on decryption.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.GeneralSecurityException;
-
-/**
- * This exception is thrown during decryption when the decrypted input
- * does not have the proper padding bytes that are expected by the padding
- * mechanism.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class BadPaddingException extends GeneralSecurityException
-{
-
- // Constant.
- // ------------------------------------------------------------------------
-
- /** Serialization constant. */
- private static final long serialVersionUID = -5315033893984728443L;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new bad padding exception with no detail message.
- */
- public BadPaddingException()
- {
- super();
- }
-
- /**
- * Creates a new bad padding exception with a detail message.
- *
- * @param message The detail message.
- */
- public BadPaddingException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/crypto/Cipher.java b/libjava/javax/crypto/Cipher.java
deleted file mode 100644
index b9dee74d51a..00000000000
--- a/libjava/javax/crypto/Cipher.java
+++ /dev/null
@@ -1,1095 +0,0 @@
-/* Cipher.java -- Interface to a cryptographic cipher.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import gnu.java.security.Engine;
-
-import java.security.AlgorithmParameters;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.SecureRandom;
-import java.security.Security;
-import java.security.cert.Certificate;
-import java.security.cert.X509Certificate;
-import java.security.spec.AlgorithmParameterSpec;
-import java.util.StringTokenizer;
-
-/**
- * <p>This class implements a cryptographic cipher for transforming
- * data.</p>
- *
- * <p>Ciphers cannot be instantiated directly; rather one of the
- * <code>getInstance</code> must be used to instantiate a given
- * <i>transformation</i>, optionally with a specific provider.</p>
- *
- * <p>A transformation is of the form:</p>
- *
- * <ul>
- * <li><i>algorithm</i>/<i>mode</i>/<i>padding</i>, or</li>
- * <li><i>algorithm</i>
- * </ul>
- *
- * <p>where <i>algorithm</i> is the base name of a cryptographic cipher
- * (such as "AES"), <i>mode</i> is the abbreviated name of a block
- * cipher mode (such as "CBC" for cipher block chaining mode), and
- * <i>padding</i> is the name of a padding scheme (such as
- * "PKCS5Padding"). If only the algorithm name is supplied, then the
- * provider-specific default mode and padding will be used.</p>
- *
- * <p>An example transformation is:</p>
- *
- * <blockquote><code>Cipher c =
- * Cipher.getInstance("AES/CBC/PKCS5Padding");</code></blockquote>
- *
- * <p>Finally, when requesting a block cipher in stream cipher mode
- * (such as <acronym title="Advanced Encryption Standard">AES</acronym>
- * in OFB or CFB mode) the number of bits to be processed
- * at a time may be specified by appending it to the name of the mode;
- * e.g. <code>"AES/OFB8/NoPadding"</code>. If no such number is
- * specified a provider-specific default value is used.</p>
- *
- * @author Casey Marshall (csm@gnu.org)
- * @see java.security.KeyGenerator
- * @see javax.crypto.SecretKey
- */
-public class Cipher
-{
-
- // Constants and variables.
- // ------------------------------------------------------------------------
-
- private static final String SERVICE = "Cipher";
-
- /**
- * The decryption operation mode.
- */
- public static final int DECRYPT_MODE = 2;
-
- /**
- * The encryption operation mode.
- */
- public static final int ENCRYPT_MODE = 1;
-
- /**
- * Constant for when the key to be unwrapped is a private key.
- */
- public static final int PRIVATE_KEY = 2;
-
- /**
- * Constant for when the key to be unwrapped is a public key.
- */
- public static final int PUBLIC_KEY = 1;
-
- /**
- * Constant for when the key to be unwrapped is a secret key.
- */
- public static final int SECRET_KEY = 3;
-
- /**
- * The key unwrapping operation mode.
- */
- public static final int UNWRAP_MODE = 4;
-
- /**
- * The key wrapping operation mode.
- */
- public static final int WRAP_MODE = 3;
-
- /**
- * The uninitialized state. This state signals that any of the
- * <code>init</code> methods have not been called, and therefore no
- * transformations can be done.
- */
- private static final int INITIAL_STATE = 0;
-
- /** The underlying cipher service provider interface. */
- private CipherSpi cipherSpi;
-
- /** The provider from which this instance came. */
- private Provider provider;
-
- /** The transformation requested. */
- private String transformation;
-
- /** Our current state (encrypting, wrapping, etc.) */
- private int state;
-
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * <p>Creates a new cipher instance for the given transformation.</p>
- *
- * <p>The installed providers are tried in order for an
- * implementation, and the first appropriate instance is returned. If
- * no installed provider can provide the implementation, an
- * appropriate exception is thrown.</p>
- *
- * @param transformation The transformation to create.
- * @return An appropriate cipher for this transformation.
- * @throws java.security.NoSuchAlgorithmException If no installed
- * provider can supply the appropriate cipher or mode.
- * @throws javax.crypto.NoSuchPaddingException If no installed
- * provider can supply the appropriate padding.
- */
- public static final Cipher getInstance(String transformation)
- throws NoSuchAlgorithmException, NoSuchPaddingException
- {
- Provider[] providers = Security.getProviders();
- NoSuchPaddingException ex = null;
- String msg = "";
- for (int i = 0; i < providers.length; i++)
- {
- try
- {
- return getInstance(transformation, providers[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- msg = nsae.getMessage();
- ex = null;
- }
- catch (NoSuchPaddingException nspe)
- {
- ex = nspe;
- }
- }
- if (ex != null)
- {
- throw ex;
- }
- throw new NoSuchAlgorithmException(msg);
- }
-
- /**
- * <p>Creates a new cipher instance for the given transformation and
- * the named provider.</p>
- *
- * @param transformation The transformation to create.
- * @param provider The name of the provider to use.
- * @return An appropriate cipher for this transformation.
- * @throws java.security.NoSuchAlgorithmException If the provider cannot
- * supply the appropriate cipher or mode.
- * @throws java.security.NoSuchProviderException If the named provider
- * is not installed.
- * @throws javax.crypto.NoSuchPaddingException If the provider cannot
- * supply the appropriate padding.
- */
- public static final Cipher getInstance(String transformation, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException,
- NoSuchPaddingException
- {
- Provider p = Security.getProvider(provider);
- if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
- return getInstance(transformation, p);
- }
-
- /**
- * Creates a new cipher instance for the given transform and the given
- * provider.
- *
- * @param transformation The transformation to create.
- * @param provider The provider to use.
- * @return An appropriate cipher for this transformation.
- * @throws java.security.NoSuchAlgorithmException If the given
- * provider cannot supply the appropriate cipher or mode.
- * @throws javax.crypto.NoSuchPaddingException If the given
- * provider cannot supply the appropriate padding scheme.
- */
- public static final Cipher getInstance(String transformation, Provider provider)
- throws NoSuchAlgorithmException, NoSuchPaddingException
- {
- CipherSpi result = null;
- String key = null;
- String alg = null, mode = null, pad = null;
- String msg = "";
- if (transformation.indexOf('/') < 0)
- {
- try
- {
- result = (CipherSpi) Engine.getInstance(SERVICE, transformation,
- provider);
- return new Cipher(result, provider, transformation);
- }
- catch (Exception e)
- {
- msg = e.getMessage();
- }
- }
- else
- {
- StringTokenizer tok = new StringTokenizer(transformation, "/");
- if (tok.countTokens() != 3)
- {
- throw new NoSuchAlgorithmException("badly formed transformation");
- }
- alg = tok.nextToken();
- mode = tok.nextToken();
- pad = tok.nextToken();
- try
- {
- result = (CipherSpi) Engine.getInstance(SERVICE, transformation,
- provider);
- return new Cipher(result, provider, transformation);
- }
- catch (Exception e)
- {
- msg = e.getMessage();
- }
- try
- {
- result = (CipherSpi) Engine.getInstance(SERVICE, alg + '/' + mode,
- provider);
- result.engineSetPadding(pad);
- return new Cipher(result, provider, transformation);
- }
- catch (Exception e)
- {
- if (e instanceof NoSuchPaddingException)
- {
- throw (NoSuchPaddingException) e;
- }
- msg = e.getMessage();
- }
- try
- {
- result = (CipherSpi) Engine.getInstance(SERVICE, alg + "//" + pad,
- provider);
- result.engineSetMode(mode);
- return new Cipher(result, provider, transformation);
- }
- catch (Exception e)
- {
- msg = e.getMessage();
- }
- try
- {
- result = (CipherSpi) Engine.getInstance(SERVICE, alg, provider);
- result.engineSetMode(mode);
- result.engineSetPadding(pad);
- return new Cipher(result, provider, transformation);
- }
- catch (Exception e)
- {
- if (e instanceof NoSuchPaddingException)
- {
- throw (NoSuchPaddingException) e;
- }
- msg = e.getMessage();
- }
- }
- throw new NoSuchAlgorithmException(transformation + ": " + msg);
- }
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a cipher.
- *
- * @param cipherSpi The underlying implementation of the cipher.
- * @param provider The provider of this cipher implementation.
- * @param transformation The transformation this cipher performs.
- */
- protected
- Cipher(CipherSpi cipherSpi, Provider provider, String transformation)
- {
- this.cipherSpi = cipherSpi;
- this.provider = provider;
- this.transformation = transformation;
- state = INITIAL_STATE;
- }
-
- // Public instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get the name that this cipher instance was created with; this is
- * equivalent to the "transformation" argument given to any of the
- * {@link #getInstance()} methods.
- *
- * @return The cipher name.
- */
- public final String getAlgorithm()
- {
- return transformation;
- }
-
- /**
- * Return the size of blocks, in bytes, that this cipher processes.
- *
- * @return The block size.
- */
- public final int getBlockSize()
- {
- if (cipherSpi != null)
- {
- return cipherSpi.engineGetBlockSize();
- }
- return 1;
- }
-
- /**
- * Return the currently-operating {@link ExemptionMechanism}.
- *
- * @return null, currently.
- */
- public final ExemptionMechanism getExemptionMechanism()
- {
- return null;
- }
-
- /**
- * Return the <i>initialization vector</i> that this instance was
- * initialized with.
- *
- * @return The IV.
- */
- public final byte[] getIV()
- {
- if (cipherSpi != null)
- {
- return cipherSpi.engineGetIV();
- }
- return null;
- }
-
- /**
- * Return the {@link java.security.AlgorithmParameters} that this
- * instance was initialized with.
- *
- * @return The parameters.
- */
- public final AlgorithmParameters getParameters()
- {
- if (cipherSpi != null) {
- return cipherSpi.engineGetParameters();
- }
- return null;
- }
-
- /**
- * Return this cipher's provider.
- *
- * @return The provider.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Finishes a multi-part transformation, and returns the final
- * transformed bytes.
- *
- * @return The final transformed bytes.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized, or if a <tt>doFinal</tt> call has already
- * been made.
- * @throws javax.crypto.IllegalBlockSizeException If this instance has
- * no padding and the input is not a multiple of this cipher's
- * block size.
- * @throws javax.crypto.BadPaddingException If this instance is
- * decrypting and the padding bytes do not match this
- * instance's padding scheme.
- */
- public final byte[] doFinal()
- throws IllegalStateException, IllegalBlockSizeException, BadPaddingException
- {
- return doFinal(new byte[0], 0, 0);
- }
-
- /**
- * Finishes a multi-part transformation or does an entire
- * transformation on the input, and returns the transformed bytes.
- *
- * @param input The final input bytes.
- * @return The final transformed bytes.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized, or if a <tt>doFinal</tt> call has already
- * been made.
- * @throws javax.crypto.IllegalBlockSizeException If this instance has
- * no padding and the input is not a multiple of this cipher's
- * block size.
- * @throws javax.crypto.BadPaddingException If this instance is
- * decrypting and the padding bytes do not match this
- * instance's padding scheme.
- */
- public final byte[] doFinal(byte[] input)
- throws IllegalStateException, IllegalBlockSizeException, BadPaddingException
- {
- return doFinal(input, 0, input.length);
- }
-
- /**
- * Finishes a multi-part transformation or does an entire
- * transformation on the input, and returns the transformed bytes.
- *
- * @param input The final input bytes.
- * @param inputOffset The index in the input bytes to start.
- * @param inputLength The number of bytes to read from the input.
- * @return The final transformed bytes.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized, or if a <tt>doFinal</tt> call has already
- * been made.
- * @throws javax.crypto.IllegalBlockSizeException If this instance has
- * no padding and the input is not a multiple of this cipher's
- * block size.
- * @throws javax.crypto.BadPaddingException If this instance is
- * decrypting and the padding bytes do not match this
- * instance's padding scheme.
- */
- public final byte[] doFinal(byte[] input, int inputOffset, int inputLength)
- throws IllegalStateException, IllegalBlockSizeException, BadPaddingException
- {
- if (cipherSpi == null)
- {
- byte[] b = new byte[inputLength];
- System.arraycopy(input, inputOffset, b, 0, inputLength);
- return b;
- }
- if (state != ENCRYPT_MODE && state != DECRYPT_MODE)
- {
- throw new IllegalStateException("neither encrypting nor decrypting");
- }
- state = INITIAL_STATE;
- return cipherSpi.engineDoFinal(input, inputOffset, inputLength);
- }
-
- /**
- * Finishes a multi-part transformation and stores the transformed
- * bytes into the given array.
- *
- * @param output The destination for the transformed bytes.
- * @param outputOffset The offset in <tt>output</tt> to start storing
- * bytes.
- * @return The number of bytes placed into the output array.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized, or if a <tt>doFinal</tt> call has already
- * been made.
- * @throws javax.crypto.IllegalBlockSizeException If this instance has
- * no padding and the input is not a multiple of this cipher's
- * block size.
- * @throws javax.crypto.BadPaddingException If this instance is
- * decrypting and the padding bytes do not match this
- * instance's padding scheme.
- * @throws javax.crypto.ShortBufferException If the output array is
- * not large enough to hold the transformed bytes.
- */
- public final int doFinal(byte[] output, int outputOffset)
- throws IllegalStateException, IllegalBlockSizeException, BadPaddingException,
- ShortBufferException
- {
- if (cipherSpi == null)
- {
- return 0;
- }
- if (state != ENCRYPT_MODE && state != DECRYPT_MODE)
- {
- throw new IllegalStateException("neither encrypting nor decrypting");
- }
- state = INITIAL_STATE;
- return cipherSpi.engineDoFinal(new byte[0], 0, 0, output, outputOffset);
- }
-
- /**
- * Finishes a multi-part transformation or transforms a portion of a
- * byte array, and stores the result in the given byte array.
- *
- * @param input The input bytes.
- * @param inputOffset The index in <tt>input</tt> to start.
- * @param inputLength The number of bytes to transform.
- * @param output The output buffer.
- * @param outputOffset The index in <tt>output</tt> to start.
- * @return The number of bytes placed into the output array.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized, or if a <tt>doFinal</tt> call has already
- * been made.
- * @throws javax.crypto.IllegalBlockSizeException If this instance has
- * no padding and the input is not a multiple of this cipher's
- * block size.
- * @throws javax.crypto.BadPaddingException If this instance is
- * decrypting and the padding bytes do not match this
- * instance's padding scheme.
- * @throws javax.crypto.ShortBufferException If the output array is
- * not large enough to hold the transformed bytes.
- */
- public final int doFinal(byte[] input, int inputOffset, int inputLength,
- byte[] output, int outputOffset)
- throws IllegalStateException, IllegalBlockSizeException, BadPaddingException,
- ShortBufferException
- {
- if (cipherSpi == null)
- {
- if (inputLength > output.length - outputOffset)
- {
- throw new ShortBufferException();
- }
- System.arraycopy(input, inputOffset, output, outputOffset, inputLength);
- return inputLength;
- }
- if (state != ENCRYPT_MODE && state != DECRYPT_MODE)
- {
- throw new IllegalStateException("neither encrypting nor decrypting");
- }
- state = INITIAL_STATE;
- return cipherSpi.engineDoFinal(input, inputOffset, inputLength,
- output, outputOffset);
- }
-
- public final int doFinal(byte[] input, int inputOffset, int inputLength,
- byte[] output)
- throws IllegalStateException, IllegalBlockSizeException, BadPaddingException,
- ShortBufferException
- {
- return doFinal(input, inputOffset, inputLength, output, 0);
- }
-
- /**
- * Returns the size an output buffer needs to be if this cipher is
- * updated with a number of bytes.
- *
- * @param inputLength The input length.
- * @return The output length given this input length.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized, or if a <tt>doFinal</tt> call has already
- * been made.
- */
- public final int getOutputSize(int inputLength) throws IllegalStateException
- {
- if (cipherSpi == null)
- {
- return inputLength;
- }
- if (state != ENCRYPT_MODE && state != DECRYPT_MODE)
- {
- throw new IllegalStateException("neither encrypting nor decrypting");
- }
- return cipherSpi.engineGetOutputSize(inputLength);
- }
-
- /**
- * <p>Initialize this cipher with the public key from the given
- * certificate.</p>
- *
- * <p>The cipher will be initialized for encryption, decryption, key
- * wrapping, or key unwrapping, depending upon whether the
- * <code>opmode</code> argument is {@link #ENCRYPT_MODE}, {@link
- * #DECRYPT_MODE}, {@link #WRAP_MODE}, or {@link #UNWRAP_MODE},
- * respectively.</p>
- *
- * <p>As per the Java 1.4 specification, if <code>cert</code> is an
- * instance of an {@link java.security.cert.X509Certificate} and its
- * <i>key usage</i> extension field is incompatible with
- * <code>opmode</code> then an {@link
- * java.security.InvalidKeyException} is thrown.</p>
- *
- * <p>If this cipher requires any random bytes (for example for an
- * initilization vector) than the {@link java.security.SecureRandom}
- * with the highest priority is used as the source of these bytes.</p>
- *
- * <p>A call to any of the <code>init</code> methods overrides the
- * state of the instance, and is equivalent to creating a new instance
- * and calling its <code>init</code> method.</p>
- *
- * @param opmode The operation mode to use.
- * @param certificate The certificate.
- * @throws java.security.InvalidKeyException If the underlying cipher
- * instance rejects the certificate's public key, or if the
- * public key cannot be used as described above.
- */
- public final void init(int opmode, Certificate certificate)
- throws InvalidKeyException
- {
- init(opmode, certificate, new SecureRandom());
- }
-
- /**
- * <p>Initialize this cipher with the supplied key.</p>
- *
- * <p>The cipher will be initialized for encryption, decryption, key
- * wrapping, or key unwrapping, depending upon whether the
- * <code>opmode</code> argument is {@link #ENCRYPT_MODE}, {@link
- * #DECRYPT_MODE}, {@link #WRAP_MODE}, or {@link #UNWRAP_MODE},
- * respectively.</p>
- *
- * <p>If this cipher requires any random bytes (for example for an
- * initilization vector) than the {@link java.security.SecureRandom}
- * with the highest priority is used as the source of these bytes.</p>
- *
- * <p>A call to any of the <code>init</code> methods overrides the
- * state of the instance, and is equivalent to creating a new instance
- * and calling its <code>init</code> method.</p>
- *
- * @param opmode The operation mode to use.
- * @param key The key.
- * @throws java.security.InvalidKeyException If the underlying cipher
- * instance rejects the given key.
- */
- public final void init(int opmode, Key key) throws InvalidKeyException
- {
- state = opmode;
- if (cipherSpi != null)
- {
- cipherSpi.engineInit(opmode, key, new SecureRandom());
- }
- }
-
- /**
- * <p>Initialize this cipher with the public key from the given
- * certificate and the specified source of randomness.</p>
- *
- * <p>The cipher will be initialized for encryption, decryption, key
- * wrapping, or key unwrapping, depending upon whether the
- * <code>opmode</code> argument is {@link #ENCRYPT_MODE}, {@link
- * #DECRYPT_MODE}, {@link #WRAP_MODE}, or {@link #UNWRAP_MODE},
- * respectively.</p>
- *
- * <p>As per the Java 1.4 specification, if <code>cert</code> is an
- * instance of an {@link java.security.cert.X509Certificate} and its
- * <i>key usage</i> extension field is incompatible with
- * <code>opmode</code> then an {@link
- * java.security.InvalidKeyException} is thrown.</p>
- *
- * <p>If this cipher requires any random bytes (for example for an
- * initilization vector) than the {@link java.security.SecureRandom}
- * with the highest priority is used as the source of these bytes.</p>
- *
- * <p>A call to any of the <code>init</code> methods overrides the
- * state of the instance, and is equivalent to creating a new instance
- * and calling its <code>init</code> method.</p>
- *
- * @param opmode The operation mode to use.
- * @param certificate The certificate.
- * @param random The source of randomness.
- * @throws java.security.InvalidKeyException If the underlying cipher
- * instance rejects the certificate's public key, or if the
- * public key cannot be used as described above.
- */
- public final void
- init(int opmode, Certificate certificate, SecureRandom random)
- throws InvalidKeyException
- {
- if (certificate instanceof X509Certificate)
- {
- boolean[] keyInfo = ((X509Certificate) certificate).getKeyUsage();
- if (keyInfo != null)
- {
- switch (opmode)
- {
- case DECRYPT_MODE:
- if (!keyInfo[3])
- {
- throw new InvalidKeyException(
- "the certificate's key cannot be used for transforming data");
- }
- if (keyInfo[7])
- {
- throw new InvalidKeyException(
- "the certificate's key can only be used for encryption");
- }
- break;
-
- case ENCRYPT_MODE:
- if (!keyInfo[3])
- {
- throw new InvalidKeyException(
- "the certificate's key cannot be used for transforming data");
- }
- if (keyInfo[8])
- {
- throw new InvalidKeyException(
- "the certificate's key can only be used for decryption");
- }
- break;
-
- case UNWRAP_MODE:
- if (!keyInfo[2] || keyInfo[7])
- {
- throw new InvalidKeyException(
- "the certificate's key cannot be used for key unwrapping");
- }
- break;
-
- case WRAP_MODE:
- if (!keyInfo[2] || keyInfo[8])
- {
- throw new InvalidKeyException(
- "the certificate's key cannot be used for key wrapping");
- }
- break;
- }
- }
- }
- init(opmode, certificate.getPublicKey(), random);
- }
-
- /**
- * <p>Initialize this cipher with the supplied key and source of
- * randomness.</p>
- *
- * <p>The cipher will be initialized for encryption, decryption, key
- * wrapping, or key unwrapping, depending upon whether the
- * <code>opmode</code> argument is {@link #ENCRYPT_MODE}, {@link
- * #DECRYPT_MODE}, {@link #WRAP_MODE}, or {@link #UNWRAP_MODE},
- * respectively.</p>
- *
- * <p>A call to any of the <code>init</code> methods overrides the
- * state of the instance, and is equivalent to creating a new instance
- * and calling its <code>init</code> method.</p>
- *
- * @param opmode The operation mode to use.
- * @param key The key.
- * @param random The source of randomness to use.
- * @throws java.security.InvalidKeyException If the underlying cipher
- * instance rejects the given key.
- */
- public final void init(int opmode, Key key, SecureRandom random)
- throws InvalidKeyException
- {
- state = opmode;
- if (cipherSpi != null)
- {
- cipherSpi.engineInit(opmode, key, random);
- }
- }
-
- /**
- * <p>Initialize this cipher with the supplied key and parameters.</p>
- *
- * <p>The cipher will be initialized for encryption, decryption, key
- * wrapping, or key unwrapping, depending upon whether the
- * <code>opmode</code> argument is {@link #ENCRYPT_MODE}, {@link
- * #DECRYPT_MODE}, {@link #WRAP_MODE}, or {@link #UNWRAP_MODE},
- * respectively.</p>
- *
- * <p>If this cipher requires any random bytes (for example for an
- * initilization vector) then the {@link java.security.SecureRandom}
- * with the highest priority is used as the source of these bytes.</p>
- *
- * <p>A call to any of the <code>init</code> methods overrides the
- * state of the instance, and is equivalent to creating a new instance
- * and calling its <code>init</code> method.</p>
- *
- * @param opmode The operation mode to use.
- * @param key The key.
- * @param params The algorithm parameters to initialize this instance
- * with.
- * @throws java.security.InvalidKeyException If the underlying cipher
- * instance rejects the given key.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * supplied parameters are inappropriate for this cipher.
- */
- public final void init(int opmode, Key key, AlgorithmParameters params)
- throws InvalidKeyException, InvalidAlgorithmParameterException
- {
- init(opmode, key, params, new SecureRandom());
- }
-
- /**
- * <p>Initialize this cipher with the supplied key and parameters.</p>
- *
- * <p>The cipher will be initialized for encryption, decryption, key
- * wrapping, or key unwrapping, depending upon whether the
- * <code>opmode</code> argument is {@link #ENCRYPT_MODE}, {@link
- * #DECRYPT_MODE}, {@link #WRAP_MODE}, or {@link #UNWRAP_MODE},
- * respectively.</p>
- *
- * <p>If this cipher requires any random bytes (for example for an
- * initilization vector) then the {@link java.security.SecureRandom}
- * with the highest priority is used as the source of these bytes.</p>
- *
- * <p>A call to any of the <code>init</code> methods overrides the
- * state of the instance, and is equivalent to creating a new instance
- * and calling its <code>init</code> method.</p>
- *
- * @param opmode The operation mode to use.
- * @param key The key.
- * @param params The algorithm parameters to initialize this instance
- * with.
- * @throws java.security.InvalidKeyException If the underlying cipher
- * instance rejects the given key.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * supplied parameters are inappropriate for this cipher.
- */
- public final void init(int opmode, Key key, AlgorithmParameterSpec params)
- throws InvalidKeyException, InvalidAlgorithmParameterException
- {
- init(opmode, key, params, new SecureRandom());
- }
-
- /**
- * <p>Initialize this cipher with the supplied key, parameters, and
- * source of randomness.</p>
- *
- * <p>The cipher will be initialized for encryption, decryption, key
- * wrapping, or key unwrapping, depending upon whether the
- * <code>opmode</code> argument is {@link #ENCRYPT_MODE}, {@link
- * #DECRYPT_MODE}, {@link #WRAP_MODE}, or {@link #UNWRAP_MODE},
- * respectively.</p>
- *
- * <p>A call to any of the <code>init</code> methods overrides the
- * state of the instance, and is equivalent to creating a new instance
- * and calling its <code>init</code> method.</p>
- *
- * @param opmode The operation mode to use.
- * @param key The key.
- * @param params The algorithm parameters to initialize this instance
- * with.
- * @param random The source of randomness to use.
- * @throws java.security.InvalidKeyException If the underlying cipher
- * instance rejects the given key.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * supplied parameters are inappropriate for this cipher.
- */
- public final void init(int opmode, Key key, AlgorithmParameters params,
- SecureRandom random)
- throws InvalidKeyException, InvalidAlgorithmParameterException
- {
- state = opmode;
- if (cipherSpi != null)
- {
- cipherSpi.engineInit(opmode, key, params, random);
- }
- }
-
- /**
- * <p>Initialize this cipher with the supplied key, parameters, and
- * source of randomness.</p>
- *
- * <p>The cipher will be initialized for encryption, decryption, key
- * wrapping, or key unwrapping, depending upon whether the
- * <code>opmode</code> argument is {@link #ENCRYPT_MODE}, {@link
- * #DECRYPT_MODE}, {@link #WRAP_MODE}, or {@link #UNWRAP_MODE},
- * respectively.</p>
- *
- * <p>A call to any of the <code>init</code> methods overrides the
- * state of the instance, and is equivalent to creating a new instance
- * and calling its <code>init</code> method.</p>
- *
- * @param opmode The operation mode to use.
- * @param key The key.
- * @param params The algorithm parameters to initialize this instance
- * with.
- * @param random The source of randomness to use.
- * @throws java.security.InvalidKeyException If the underlying cipher
- * instance rejects the given key.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * supplied parameters are inappropriate for this cipher.
- */
- public final void init(int opmode, Key key, AlgorithmParameterSpec params,
- SecureRandom random)
- throws InvalidKeyException, InvalidAlgorithmParameterException
- {
- state = opmode;
- if (cipherSpi != null)
- {
- cipherSpi.engineInit(opmode, key, params, random);
- }
- }
-
- /**
- * Unwrap a previously-wrapped key.
- *
- * @param wrappedKey The wrapped key.
- * @param wrappedKeyAlgorithm The algorithm with which the key was
- * wrapped.
- * @param wrappedKeyType The type of key (public, private, or
- * secret) that this wrapped key respresents.
- * @return The unwrapped key.
- * @throws java.lang.IllegalStateException If this instance has not be
- * initialized for unwrapping.
- * @throws java.security.InvalidKeyException If <code>wrappedKey</code>
- * is not a wrapped key, if the algorithm cannot unwrap this
- * key, or if the unwrapped key's type differs from the
- * specified type.
- * @throws java.security.NoSuchAlgorithmException If
- * <code>wrappedKeyAlgorithm</code> is not a valid algorithm
- * name.
- */
- public final Key unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm,
- int wrappedKeyType)
- throws IllegalStateException, InvalidKeyException, NoSuchAlgorithmException
- {
- if (cipherSpi == null)
- {
- return null;
- }
- if (state != UNWRAP_MODE)
- {
- throw new IllegalStateException("instance is not for unwrapping");
- }
- return cipherSpi.engineUnwrap(wrappedKey, wrappedKeyAlgorithm,
- wrappedKeyType);
- }
-
- /**
- * Continue a multi-part transformation on an entire byte array,
- * returning the transformed bytes.
- *
- * @param input The input bytes.
- * @return The transformed bytes.
- * @throws java.lang.IllegalStateException If this cipher was not
- * initialized for encryption or decryption.
- */
- public final byte[] update(byte[] input) throws IllegalStateException
- {
- return update(input, 0, input.length);
- }
-
- /**
- * Continue a multi-part transformation on part of a byte array,
- * returning the transformed bytes.
- *
- * @param input The input bytes.
- * @param inputOffset The index in the input to start.
- * @param inputLength The number of bytes to transform.
- * @return The transformed bytes.
- * @throws java.lang.IllegalStateException If this cipher was not
- * initialized for encryption or decryption.
- */
- public final byte[] update(byte[] input, int inputOffset, int inputLength)
- throws IllegalStateException
- {
- if (cipherSpi == null)
- {
- byte[] b = new byte[inputLength];
- System.arraycopy(input, inputOffset, b, 0, inputLength);
- return b;
- }
- if (state != ENCRYPT_MODE && state != DECRYPT_MODE)
- {
- throw new IllegalStateException(
- "cipher is not for encrypting or decrypting");
- }
- return cipherSpi.engineUpdate(input, inputOffset, inputLength);
- }
-
- /**
- * Continue a multi-part transformation on part of a byte array,
- * placing the transformed bytes into the given array.
- *
- * @param input The input bytes.
- * @param inputOffset The index in the input to start.
- * @param inputLength The number of bytes to transform.
- * @param output The output byte array.
- * @return The number of transformed bytes.
- * @throws java.lang.IllegalStateException If this cipher was not
- * initialized for encryption or decryption.
- * @throws javax.security.ShortBufferException If there is not enough
- * room in the output array to hold the transformed bytes.
- */
- public final int update(byte[] input, int inputOffset, int inputLength,
- byte[] output)
- throws IllegalStateException, ShortBufferException
- {
- return update(input, inputOffset, inputLength, output, 0);
- }
-
- /**
- * Continue a multi-part transformation on part of a byte array,
- * placing the transformed bytes into the given array.
- *
- * @param input The input bytes.
- * @param inputOffset The index in the input to start.
- * @param inputLength The number of bytes to transform.
- * @param output The output byte array.
- * @param outputOffset The index in the output array to start.
- * @return The number of transformed bytes.
- * @throws java.lang.IllegalStateException If this cipher was not
- * initialized for encryption or decryption.
- * @throws javax.security.ShortBufferException If there is not enough
- * room in the output array to hold the transformed bytes.
- */
- public final int update(byte[] input, int inputOffset, int inputLength,
- byte[] output, int outputOffset)
- throws IllegalStateException, ShortBufferException
- {
- if (cipherSpi == null)
- {
- if (inputLength > output.length - outputOffset)
- {
- throw new ShortBufferException();
- }
- System.arraycopy(input, inputOffset, output, outputOffset, inputLength);
- return inputLength;
- }
- if (state != ENCRYPT_MODE && state != DECRYPT_MODE)
- {
- throw new IllegalStateException(
- "cipher is not for encrypting or decrypting");
- }
- return cipherSpi.engineUpdate(input, inputOffset, inputLength,
- output, outputOffset);
- }
-
- /**
- * Wrap a key.
- *
- * @param key The key to wrap.
- * @return The wrapped key.
- * @throws java.lang.IllegalStateException If this instance was not
- * initialized for key wrapping.
- * @throws javax.crypto.IllegalBlockSizeException If this instance has
- * no padding and the key is not a multiple of the block size.
- * @throws java.security.InvalidKeyException If this instance cannot
- * wrap this key.
- */
- public final byte[] wrap(Key key)
- throws IllegalStateException, IllegalBlockSizeException, InvalidKeyException
- {
- if (cipherSpi == null)
- {
- return null;
- }
- if (state != WRAP_MODE)
- {
- throw new IllegalStateException("instance is not for key wrapping");
- }
- return cipherSpi.engineWrap(key);
- }
-}
diff --git a/libjava/javax/crypto/CipherInputStream.java b/libjava/javax/crypto/CipherInputStream.java
deleted file mode 100644
index 01c9976a174..00000000000
--- a/libjava/javax/crypto/CipherInputStream.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/* CipherInputStream.java -- Filters input through a cipher.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * This is an {@link java.io.InputStream} that filters its data
- * through a {@link Cipher} before returning it. The <code>Cipher</code>
- * argument must have been initialized before it is passed to the
- * constructor.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class CipherInputStream extends FilterInputStream
-{
-
- // Constants and variables.
- // ------------------------------------------------------------------------
-
- /**
- * The underlying {@link Cipher} instance.
- */
- private Cipher cipher;
-
- /**
- * Data that has been transformed but not read.
- */
- private byte[] outBuffer;
-
- /**
- * The offset into {@link #outBuffer} where valid data starts.
- */
- private int outOffset;
-
- /**
- * The number of valid bytes in the {@link #outBuffer}.
- */
- private int outLength;
-
- /**
- * Byte buffer that is filled with raw data from the underlying input
- * stream.
- */
- private byte[][] inBuffer;
-
- /**
- * The amount of bytes in inBuffer[0] that may be input to the cipher.
- */
- private int inLength;
-
- /**
- * We set this when the cipher block size is 1, meaning that we can
- * transform any amount of data.
- */
- private boolean isStream;
-
- private static final int VIRGIN = 0; // I am born.
- private static final int LIVING = 1; // I am nailed to the hull.
- private static final int DYING = 2; // I am eaten by sharks.
- private static final int DEAD = 3;
- private int state;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new input stream with a source input stream and cipher.
- *
- * @param in The underlying input stream.
- * @param cipher The cipher to filter data through.
- */
- public CipherInputStream(InputStream in, Cipher cipher)
- {
- this(in);
- this.cipher = cipher;
- if (!(isStream = cipher.getBlockSize() == 1))
- {
- inBuffer = new byte[2][];
- inBuffer[0] = new byte[cipher.getBlockSize()];
- inBuffer[1] = new byte[cipher.getBlockSize()];
- inLength = 0;
- outBuffer = new byte[cipher.getBlockSize()];
- outOffset = outLength = 0;
- state = VIRGIN;
- }
- }
-
- /**
- * Creates a new input stream without a cipher. This constructor is
- * <code>protected</code> because this class does not work without an
- * underlying cipher.
- *
- * @param in The underlying input stream.
- */
- protected CipherInputStream(InputStream in)
- {
- super(in);
- }
-
- // Instance methods overriding java.io.FilterInputStream.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the number of bytes available without blocking. The value
- * returned by this method is never greater than the underlying
- * cipher's block size.
- *
- * @return The number of bytes immediately available.
- * @throws java.io.IOException If an I/O exception occurs.
- */
- public int available() throws IOException
- {
- if (isStream)
- return super.available();
- return outLength - outOffset;
- }
-
- /**
- * Close this input stream. This method merely calls the {@link
- * java.io.InputStream#close()} method of the underlying input stream.
- *
- * @throws java.io.IOException If an I/O exception occurs.
- */
- public void close() throws IOException
- {
- super.close();
- }
-
- /**
- * Read a single byte from this input stream; returns -1 on the
- * end-of-file.
- *
- * @return The byte read, or -1 if there are no more bytes.
- * @throws java.io.IOExcpetion If an I/O exception occurs.
- */
- public int read() throws IOException
- {
- if (isStream)
- {
- byte[] buf = new byte[1];
- int in = super.read();
- if (in == -1)
- return -1;
- buf[0] = (byte) in;
- try
- {
- cipher.update(buf, 0, 1, buf, 0);
- }
- catch (ShortBufferException shouldNotHappen)
- {
- throw new IOException(shouldNotHappen.getMessage());
- }
- return buf[0] & 0xFF;
- }
- if (state == DEAD) return -1;
- if (available() == 0) nextBlock();
- if (state == DEAD) return -1;
- return outBuffer[outOffset++] & 0xFF;
- }
-
- /**
- * Read bytes into an array, returning the number of bytes read or -1
- * on the end-of-file.
- *
- * @param buf The byte array to read into.
- * @param off The offset in <code>buf</code> to start.
- * @param len The maximum number of bytes to read.
- * @return The number of bytes read, or -1 on the end-of-file.
- * @throws java.io.IOException If an I/O exception occurs.
- */
- public int read(byte[] buf, int off, int len) throws IOException
- {
- if (isStream)
- {
- len = super.read(buf, off, len);
- try
- {
- cipher.update(buf, off, len, buf, off);
- }
- catch (ShortBufferException shouldNotHappen)
- {
- throw new IOException(shouldNotHappen.getMessage());
- }
- return len;
- }
-
- int count = 0;
- while (count < len)
- {
- if (available() == 0)
- nextBlock();
- if (state == DEAD)
- {
- if (count > 0) return count;
- else return -1;
- }
- int l = Math.min(available(), len - count);
- System.arraycopy(outBuffer, outOffset, buf, count+off, l);
- count += l;
- outOffset = outLength = 0;
- }
- return count;
- }
-
- /**
- * Read bytes into an array, returning the number of bytes read or -1
- * on the end-of-file.
- *
- * @param buf The byte arry to read into.
- * @return The number of bytes read, or -1 on the end-of-file.
- * @throws java.io.IOException If an I/O exception occurs.
- */
- public int read(byte[] buf) throws IOException
- {
- return read(buf, 0, buf.length);
- }
-
- /**
- * Skip a number of bytes. This class only supports skipping as many
- * bytes as are returned by {@link #available()}, which is the number
- * of transformed bytes currently in this class's internal buffer.
- *
- * @param bytes The number of bytes to skip.
- * @return The number of bytes skipped.
- */
- public long skip(long bytes) throws IOException
- {
- if (isStream)
- {
- return super.skip(bytes);
- }
- long ret = 0;
- if (bytes > 0 && available() > 0)
- {
- ret = available();
- outOffset = outLength = 0;
- }
- return ret;
- }
-
- /**
- * Returns whether or not this input stream supports the {@link
- * #mark(long)} and {@link #reset()} methods; this input stream does
- * not, however, and invariably returns <code>false</code>.
- *
- * @return <code>false</code>
- */
- public boolean markSupported()
- {
- return false;
- }
-
- /**
- * Set the mark. This method is unsupported and is empty.
- *
- * @param mark Is ignored.
- */
- public void mark(int mark)
- {
- }
-
- /**
- * Reset to the mark. This method is unsupported and is empty.
- */
- public void reset() throws IOException
- {
- throw new IOException("reset not supported");
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private void nextBlock() throws IOException
- {
- byte[] temp = inBuffer[0];
- inBuffer[0] = inBuffer[1];
- inBuffer[1] = temp;
- int count = 0;
- boolean eof = false;
-
- if (state == VIRGIN || state == LIVING)
- {
- do
- {
- int l = in.read(inBuffer[1], count, inBuffer[1].length - count);
- if (l == -1)
- {
- eof = true;
- break;
- }
- count += l;
- }
- while (count < inBuffer[1].length);
- }
-
- try
- {
- switch (state)
- {
- case VIRGIN:
- state = LIVING;
- nextBlock();
- break;
- case LIVING:
- if (eof)
- {
- if (count > 0)
- {
- outOffset = cipher.update(inBuffer[0], 0, inLength, outBuffer, 0);
- state = DYING;
- }
- else
- {
- outOffset = cipher.doFinal(inBuffer[0], 0, inLength, outBuffer, 0);
- state = DEAD;
- }
- }
- else
- {
- outOffset = cipher.update(inBuffer[0], 0, inLength, outBuffer, 0);
- }
- break;
- case DYING:
- outOffset = cipher.doFinal(inBuffer[0], 0, inLength, outBuffer, 0);
- state = DEAD;
- break;
- case DEAD:
- }
- }
- catch (ShortBufferException sbe)
- {
- throw new IOException(sbe.toString());
- }
- catch (BadPaddingException bpe)
- {
- throw new IOException(bpe.toString());
- }
- catch (IllegalBlockSizeException ibse)
- {
- throw new IOException(ibse.toString());
- }
- inLength = count;
- }
-}
diff --git a/libjava/javax/crypto/CipherOutputStream.java b/libjava/javax/crypto/CipherOutputStream.java
deleted file mode 100644
index adeb6e5ed38..00000000000
--- a/libjava/javax/crypto/CipherOutputStream.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/* CipherOutputStream.java -- Filters output through a cipher.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * A filtered output stream that transforms data written to it with a
- * {@link Cipher} before sending it to the underlying output stream.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class CipherOutputStream extends FilterOutputStream
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The underlying cipher. */
- private Cipher cipher;
-
- private byte[][] inBuffer;
-
- private int inLength;
-
- private byte[] outBuffer;
-
- private static final int FIRST_TIME = 0;
- private static final int SECOND_TIME = 1;
- private static final int SEASONED = 2;
- private int state;
-
- /** True if the cipher is a stream cipher (blockSize == 1) */
- private boolean isStream;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new cipher output stream. The cipher argument must have
- * already been initialized.
- *
- * @param out The sink for transformed data.
- * @param cipher The cipher to transform data with.
- */
- public CipherOutputStream(OutputStream out, Cipher cipher)
- {
- super(out);
- if (cipher != null)
- {
- this.cipher = cipher;
- if (!(isStream = cipher.getBlockSize() == 1))
- {
- inBuffer = new byte[2][];
- inBuffer[0] = new byte[cipher.getBlockSize()];
- inBuffer[1] = new byte[cipher.getBlockSize()];
- inLength = 0;
- state = FIRST_TIME;
- }
- }
- else
- this.cipher = new NullCipher();
- }
-
- /**
- * Create a cipher output stream with no cipher.
- *
- * @param out The sink for transformed data.
- */
- protected CipherOutputStream(OutputStream out)
- {
- super(out);
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Close this output stream, and the sink output stream.
- *
- * <p>This method will first invoke the {@link Cipher#doFinal()}
- * method of the underlying {@link Cipher}, and writes the output of
- * that method to the sink output stream.
- *
- * @throws java.io.IOException If an I/O error occurs, or if an error
- * is caused by finalizing the transformation.
- */
- public void close() throws IOException
- {
- try
- {
- int len;
- if (state != FIRST_TIME)
- {
- len = cipher.update(inBuffer[0], 0, inBuffer[0].length, outBuffer);
- out.write(outBuffer, 0, len);
- }
- len = cipher.doFinal(inBuffer[0], 0, inLength, outBuffer);
- out.write(outBuffer, 0, len);
- }
- catch (javax.crypto.IllegalBlockSizeException ibse)
- {
- throw new IOException(ibse.toString());
- }
- catch (javax.crypto.BadPaddingException bpe)
- {
- throw new IOException(bpe.toString());
- }
- catch (ShortBufferException sbe)
- {
- throw new IOException(sbe.toString());
- }
- out.flush();
- out.close();
- }
-
- /**
- * Flush any pending output.
- *
- * @throws java.io.IOException If an I/O error occurs.
- */
- public void flush() throws IOException
- {
- out.flush();
- }
-
- /**
- * Write a single byte to the output stream.
- *
- * @param b The next byte.
- * @throws java.io.IOException If an I/O error occurs, or if the
- * underlying cipher is not in the correct state to transform
- * data.
- */
- public void write(int b) throws IOException
- {
- if (isStream)
- {
- byte[] buf = new byte[] { (byte) b };
- try
- {
- cipher.update(buf, 0, 1, buf, 0);
- }
- catch (ShortBufferException sbe)
- {
- throw new IOException(sbe.toString());
- }
- out.write(buf);
- return;
- }
- inBuffer[1][inLength++] = (byte) b;
- if (inLength == inBuffer[1].length)
- process();
- }
-
- /**
- * Write a byte array to the output stream.
- *
- * @param buf The next bytes.
- * @throws java.io.IOException If an I/O error occurs, or if the
- * underlying cipher is not in the correct state to transform
- * data.
- */
- public void write(byte[] buf) throws IOException
- {
- write(buf, 0, buf.length);
- }
-
- /**
- * Write a portion of a byte array to the output stream.
- *
- * @param buf The next bytes.
- * @param off The offset in the byte array to start.
- * @param len The number of bytes to write.
- * @throws java.io.IOException If an I/O error occurs, or if the
- * underlying cipher is not in the correct state to transform
- * data.
- */
- public void write(byte[] buf, int off, int len) throws IOException
- {
- if (isStream)
- {
- out.write(cipher.update(buf, off, len));
- return;
- }
- int count = 0;
- while (count < len)
- {
- int l = Math.min(inBuffer[1].length - inLength, len - count);
- System.arraycopy(buf, off+count, inBuffer[1], inLength, l);
- count += l;
- inLength += l;
- if (inLength == inBuffer[1].length)
- process();
- }
- }
-
- // Own method.
- // -------------------------------------------------------------------------
-
- private void process() throws IOException
- {
- if (state == SECOND_TIME)
- {
- state = SEASONED;
- }
- else
- {
- byte[] temp = inBuffer[0];
- inBuffer[0] = inBuffer[1];
- inBuffer[1] = temp;
- }
- if (state == FIRST_TIME)
- {
- inLength = 0;
- state = SECOND_TIME;
- return;
- }
- try
- {
- cipher.update(inBuffer[0], 0, inBuffer[0].length, outBuffer);
- }
- catch (ShortBufferException sbe)
- {
- throw new IOException(sbe.toString());
- }
- out.write(outBuffer);
- inLength = 0;
- }
-}
diff --git a/libjava/javax/crypto/CipherSpi.java b/libjava/javax/crypto/CipherSpi.java
deleted file mode 100644
index a51a3aed69b..00000000000
--- a/libjava/javax/crypto/CipherSpi.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/* CipherSpi.java -- The cipher service provider interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.AlgorithmParameters;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * <p>This class represents the <i>Service Provider Interface</i>
- * (<b>SPI</b>) for cryptographic ciphers.</p>
- *
- * <p>Providers of cryptographic ciphers must subclass this for every
- * cipher they implement, implementing the abstract methods as
- * appropriate, then provide an entry that points to the subclass in
- * their implementation of {@link java.security.Provider}.</p>
- *
- * <p>CipherSpi objects are instantiated along with {@link Cipher}s when
- * the {@link Cipher#getInstance(java.lang.String)} methods are invoked.
- * Particular ciphers are referenced by a <i>transformation</i>, which
- * is a String consisting of the cipher's name or the ciper's name
- * followed by a mode and a padding. Transformations all follow the
- * general form:</p>
- *
- * <ul>
- * <li><i>algorithm</i>, or</li>
- * <li><i>algorithm</i>/<i>mode</i>/<i>padding</i>
- * </ul>
- *
- * <p>Cipher names in the master {@link java.security.Provider} class
- * may be:</p>
- *
- * <ol>
- * <li>The algorithm's name, which uses a pluggable mode and padding:
- * <code>Cipher.<i>algorithm</i></code></li>
- * <li>The algorithm's name and the mode, which uses pluggable padding:
- * <code>Cipher.<i>algorithm</i>/<i>mode</i></code></li>
- * <li>The algorithm's name and the padding, which uses a pluggable
- * mode: <code>Cipher.<i>algorithm</i>//<i>padding</i></code></li>
- * <li>The algorihtm's name, the mode, and the padding:
- * <code>Cipher.<i>algorithm</i>/<i>mode</i>/<i>padding</i></code></li>
- * </ol>
- *
- * <p>When any {@link Cipher#getInstance(java.lang.String)} method is
- * invoked, the following happens if the transformation is simply
- * <i>algorithm</i>:</p>
- *
- * <ol>
- * <li>If the provider defines a <code>CipherSpi</code> implementation
- * for "<i>algorithm</i>", return it. Otherwise throw a {@link
- * java.security.NoSuchAlgorithmException}.</li>
- * </ol>
- *
- * <p>If the transformation is of the form
- * <i>algorithm</i>/<i>mode</i>/<i>padding</i>:</p>
- *
- * <ol>
- * <li>If the provider defines a <code>CipherSpi</code> subclass for
- * "<i>algorithm</i>/<i>mode</i>/<i>padding</i>", return it. Otherwise
- * go to step 2.</li>
- *
- * <li>If the provider defines a <code>CipherSpi</code> subclass for
- * "<i>algorithm</i>/<i>mode</i>", instatiate it, call {@link
- * #engineSetPadding(java.lang.String)} for the padding name, and return
- * it. Otherwise go to step 3.</li>
- *
- * <li>If the provider defines a <code>CipherSpi</code> subclass for
- * "<i>algorithm</i>//<i>padding</i>", instatiate it, call {@link
- * #engineSetMode(java.lang.String)} for the mode name, and return
- * it. Otherwise go to step 4.</li>
- *
- * <li>If the provider defines a <code>CipherSpi</code> subclass for
- * "<i>algorithm</i>", instatiate it, call {@link
- * #engineSetMode(java.lang.String)} for the mode name, call {@link
- * #engineSetPadding(java.lang.String)} for the padding name, and return
- * it. Otherwise throw a {@link java.security.NoSuchAlgorithmException}.</li>
- * </ol>
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public abstract class CipherSpi
-{
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new CipherSpi.
- */
- public CipherSpi()
- {
- }
-
- // Abstract methods to be implemented by providers.
- // ------------------------------------------------------------------------
-
- /**
- * Finishes a multi-part transformation or transforms a portion of a
- * byte array, and returns the transformed bytes.
- *
- * @param input The input bytes.
- * @param inputOffset The index in the input at which to start.
- * @param inputLength The number of bytes to transform.
- * @return The transformed bytes in a new array.
- * @throws javax.crypto.IllegalBlockSizeException If this instance has
- * no padding and the input size is not a multiple of the
- * block size.
- * @throws javax.crypto.BadPaddingException If this instance is being
- * used for decryption and the padding is not appropriate for
- * this instance's padding scheme.
- */
- protected abstract byte[]
- engineDoFinal(byte[] input, int inputOffset, int inputLength)
- throws IllegalBlockSizeException, BadPaddingException;
-
- /**
- * Finishes a multi-part transformation or transforms a portion of a
- * byte array, and stores the transformed bytes in the supplied array.
- *
- * @param input The input bytes.
- * @param inputOffset The index in the input at which to start.
- * @param inputLength The number of bytes to transform.
- * @param output The output byte array.
- * @param outputOffset The index in the output array at which to start.
- * @return The number of transformed bytes stored in the output array.
- * @throws javax.crypto.IllegalBlockSizeException If this instance has
- * no padding and the input size is not a multiple of the
- * block size.
- * @throws javax.crypto.BadPaddingException If this instance is being
- * used for decryption and the padding is not appropriate for
- * this instance's padding scheme.
- * @throws javax.crypto.ShortBufferException If there is not enough
- * space in the output array for the transformed bytes.
- */
- protected abstract int
- engineDoFinal(byte[] input, int inputOffset, int inputLength,
- byte[] output, int outputOffset)
- throws IllegalBlockSizeException, BadPaddingException, ShortBufferException;
-
- /**
- * Returns the block size of the underlying cipher.
- *
- * @return The block size.
- */
- protected abstract int engineGetBlockSize();
-
- /**
- * Returns the initializaiton vector this cipher was initialized with,
- * if any.
- *
- * @return The IV, or null if this cipher uses no IV or if this
- * instance has not been initialized yet.
- */
- protected abstract byte[] engineGetIV();
-
- /**
- * <p>Return the length of the given key in bits.</p>
- *
- * <p>For compatibility this method is not declared
- * <code>abstract</code>, and the default implementation will throw an
- * {@link java.lang.UnsupportedOperationException}. Concrete
- * subclasses should override this method to return the correct
- * value.</p>
- *
- * @param key The key to get the size for.
- * @return The size of the key, in bits.
- * @throws java.security.InvalidKeyException If the key's length
- * cannot be determined by this implementation.
- */
- protected int engineGetKeySize(Key key) throws InvalidKeyException
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * <p>Returns the size, in bytes, an output buffer must be for a call
- * to {@link #engineUpdate(byte[],int,int,byte[],int)} or {@link
- * #engineDoFinal(byte[],int,int,byte[],int)} to succeed.</p>
- *
- * <p>The actual output length may be smaller than the value returned
- * by this method, as it considers the padding length as well. The
- * length considered is the argument plus the length of any buffered,
- * unprocessed bytes.</p>
- *
- * @param inputLength The input length, in bytes.
- * @return The size an output buffer must be.
- */
- protected abstract int engineGetOutputSize(int inputLength);
-
- /**
- * Returns the parameters that this cipher is using. This may be the
- * parameters used to initialize this cipher, or it may be parameters
- * that have been initialized with random values.
- *
- * @return This cipher's parameters, or <code>null</code> if this
- * cipher does not use parameters.
- */
- protected abstract AlgorithmParameters engineGetParameters();
-
- /**
- * Initializes this cipher with an operation mode, key, and source of
- * randomness. If this cipher requires any other initializing data,
- * for example an initialization vector, then it should generate it
- * from the provided source of randomness.
- *
- * @param opmode The operation mode, one of {@link
- * Cipher#DECRYPT_MODE}, {@link Cipher#ENCRYPT_MODE}, {@link
- * Cipher#UNWRAP_MODE}, or {@link Cipher#WRAP_MODE}.
- * @param key The key to initialize this cipher with.
- * @param random The source of random bytes to use.
- * @throws java.security.InvalidKeyException If the given key is not
- * acceptable for this implementation.
- */
- protected abstract void engineInit(int opmode, Key key, SecureRandom random)
- throws InvalidKeyException;
-
- /**
- * Initializes this cipher with an operation mode, key, parameters,
- * and source of randomness. If this cipher requires any other
- * initializing data, for example an initialization vector, then it should
- * generate it from the provided source of randomness.
- *
- * @param opmode The operation mode, one of {@link
- * Cipher#DECRYPT_MODE}, {@link Cipher#ENCRYPT_MODE}, {@link
- * Cipher#UNWRAP_MODE}, or {@link Cipher#WRAP_MODE}.
- * @param key The key to initialize this cipher with.
- * @param params The algorithm parameters to initialize with.
- * @param random The source of random bytes to use.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * given parameters are not appropriate for this
- * implementation.
- * @throws java.security.InvalidKeyException If the given key is not
- * acceptable for this implementation.
- */
- protected abstract void
- engineInit(int opmode, Key key, AlgorithmParameters params,
- SecureRandom random)
- throws InvalidAlgorithmParameterException, InvalidKeyException;
-
- /**
- * Initializes this cipher with an operation mode, key, parameters,
- * and source of randomness. If this cipher requires any other
- * initializing data, for example an initialization vector, then it should
- * generate it from the provided source of randomness.
- *
- * @param opmode The operation mode, one of {@link
- * Cipher#DECRYPT_MODE}, {@link Cipher#ENCRYPT_MODE}, {@link
- * Cipher#UNWRAP_MODE}, or {@link Cipher#WRAP_MODE}.
- * @param key The key to initialize this cipher with.
- * @param params The algorithm parameters to initialize with.
- * @param random The source of random bytes to use.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * given parameters are not appropriate for this
- * implementation.
- * @throws java.security.InvalidKeyException If the given key is not
- * acceptable for this implementation.
- */
- protected abstract void
- engineInit(int opmode, Key key, AlgorithmParameterSpec params,
- SecureRandom random)
- throws InvalidAlgorithmParameterException, InvalidKeyException;
-
- /**
- * Set the mode in which this cipher is to run.
- *
- * @param mode The name of the mode to use.
- * @throws java.security.NoSuchAlgorithmException If the mode is
- * not supported by this cipher's provider.
- */
- protected abstract void engineSetMode(String mode)
- throws NoSuchAlgorithmException;
-
- /**
- * Set the method with which the input is to be padded.
- *
- * @param padding The name of the padding to use.
- * @throws javax.crypto.NoSuchPaddingException If the padding is not
- * supported by this cipher's provider.
- */
- protected abstract void engineSetPadding(String padding)
- throws NoSuchPaddingException;
-
- /**
- * <p>Unwraps a previously-wrapped key.</p>
- *
- * <p>For compatibility this method is not declared
- * <code>abstract</code>, and the default implementation will throw an
- * {@link java.lang.UnsupportedOperationException}.</p>
- *
- * @param wrappedKey The wrapped key.
- * @param wrappedKeyAlgorithm The name of the algorithm used to wrap
- * this key.
- * @param wrappedKeyType The type of wrapped key; one of
- * {@link Cipher#PRIVATE_KEY},
- * {@link Cipher#PUBLIC_KEY}, or
- * {@link Cipher#SECRET_KEY}.
- * @return The unwrapped key.
- * @throws java.security.InvalidKeyException If the key cannot be
- * unwrapped, or if <code>wrappedKeyType</code> is an
- * inappropriate type for the unwrapped key.
- * @throws java.security.NoSuchAlgorithmException If the
- * <code>wrappedKeyAlgorithm</code> is unknown.
- */
- protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm,
- int wrappedKeyType)
- throws InvalidKeyException, NoSuchAlgorithmException
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Continue with a multi-part transformation, returning a new array of
- * the transformed bytes.
- *
- * @param input The next input bytes.
- * @param inputOffset The index in the input array from which to start.
- * @param inputLength The number of bytes to input.
- * @return The transformed bytes.
- */
- protected abstract byte[]
- engineUpdate(byte[] input, int inputOffset, int inputLength);
-
- /**
- * Continue with a multi-part transformation, storing the transformed
- * bytes into the specified array.
- *
- * @param input The next input bytes.
- * @param inputOffset The index in the input from which to start.
- * @param inputLength The number of bytes to input.
- * @param output The output buffer.
- * @param outputOffset The index in the output array from which to start.
- * @return The transformed bytes.
- * @throws javax.crypto.ShortBufferException If there is not enough
- * space in the output array to store the transformed bytes.
- */
- protected abstract int
- engineUpdate(byte[] input, int inputOffset, int inputLength,
- byte[] output, int outputOffset)
- throws ShortBufferException;
-
- /**
- * <p>Wrap a key.</p>
- *
- * <p>For compatibility this method is not declared
- * <code>abstract</code>, and the default implementation will throw an
- * {@link java.lang.UnsupportedOperationException}.</p>
- *
- * @param key The key to wrap.
- * @return The wrapped key.
- * @throws java.security.InvalidKeyException If the key cannot be
- * wrapped.
- */
- protected byte[] engineWrap(Key key) throws InvalidKeyException, IllegalBlockSizeException
- {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/libjava/javax/crypto/EncryptedPrivateKeyInfo.java b/libjava/javax/crypto/EncryptedPrivateKeyInfo.java
deleted file mode 100644
index a52d7b15d23..00000000000
--- a/libjava/javax/crypto/EncryptedPrivateKeyInfo.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/* EncryptedPrivateKeyInfo.java -- As in PKCS #8.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.IOException;
-import java.security.AlgorithmParameters;
-import java.security.NoSuchAlgorithmException;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * An implementation of the <code>EncryptedPrivateKeyInfo</code> ASN.1
- * type as specified in <a
- * href="http://www.rsasecurity.com/rsalabs/pkcs/pkcs-8/">PKCS #8 -
- * Private-Key Information Syntax Standard</a>.
- *
- * <p>The ASN.1 type <code>EncryptedPrivateKeyInfo</code> is:
- *
- * <blockquote>
- * <pre>EncryptedPrivateKeyInfo ::= SEQUENCE {
- * encryptionAlgorithm EncryptionAlgorithmIdentifier,
- * encryptedData EncryptedData }
- *
- * EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
- *
- * EncrytpedData ::= OCTET STRING
- *
- * AlgorithmIdentifier ::= SEQUENCE {
- * algorithm OBJECT IDENTIFIER,
- * parameters ANY DEFINED BY algorithm OPTIONAL }</pre>
- * </blockquote>
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see java.security.spec.PKCS8EncodedKeySpec
- */
-public class EncryptedPrivateKeyInfo
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The encrypted data. */
- private byte[] encryptedData;
-
- /** The encoded, encrypted key. */
- private byte[] encoded;
-
- /** The OID of the encryption algorithm. */
- private OID algOid;
-
- /** The encryption algorithm's parameters. */
- private AlgorithmParameters params;
-
- /** The encoded ASN.1 algorithm parameters. */
- private byte[] encodedParams;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new <code>EncryptedPrivateKeyInfo</code> object from raw
- * encrypted data and the parameters used for encryption.
- *
- * <p>The <code>encryptedData</code> array is cloned.
- *
- * @param params The encryption algorithm parameters.
- * @param encryptedData The encrypted key data.
- * @throws java.lang.IllegalArgumentException If the
- * <code>encryptedData</code> array is empty (zero-length).
- * @throws java.security.NoSuchAlgorithmException If the algorithm
- * specified in the parameters is not supported.
- * @throws java.lang.NullPointerException If <code>encryptedData</code>
- * is null.
- */
- public EncryptedPrivateKeyInfo(AlgorithmParameters params,
- byte[] encryptedData)
- throws IllegalArgumentException, NoSuchAlgorithmException
- {
- if (encryptedData.length == 0)
- {
- throw new IllegalArgumentException("0-length encryptedData");
- }
- this.params = params;
- algOid = new OID(params.getAlgorithm());
- this.encryptedData = (byte[]) encryptedData.clone();
- }
-
- /**
- * Create a new <code>EncryptedPrivateKeyInfo</code> from an encoded
- * representation, parsing the ASN.1 sequence.
- *
- * @param encoded The encoded info.
- * @throws java.io.IOException If parsing the encoded data fails.
- * @throws java.lang.NullPointerException If <code>encoded</code> is
- * null.
- */
- public EncryptedPrivateKeyInfo(byte[] encoded)
- throws IOException
- {
- this.encoded = (byte[]) encoded.clone();
- decode();
- }
-
- /**
- * Create a new <code>EncryptedPrivateKeyInfo</code> from the cipher
- * name and the encrytpedData.
- *
- * <p>The <code>encryptedData</code> array is cloned.
- *
- * @param algName The name of the algorithm (as an object identifier).
- * @param encryptedData The encrypted key data.
- * @throws java.lang.IllegalArgumentException If the
- * <code>encryptedData</code> array is empty (zero-length).
- * @throws java.security.NoSuchAlgorithmException If algName is not
- * the name of a supported algorithm.
- * @throws java.lang.NullPointerException If <code>encryptedData</code>
- * is null.
- */
- public EncryptedPrivateKeyInfo(String algName, byte[] encryptedData)
- throws IllegalArgumentException, NoSuchAlgorithmException,
- NullPointerException
- {
- if (encryptedData.length == 0)
- {
- throw new IllegalArgumentException("0-length encryptedData");
- }
- this.algOid = new OID(algName);
- this.encryptedData = (byte[]) encryptedData.clone();
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return the name of the cipher used to encrypt this key.
- *
- * @return The algorithm name.
- */
- public String getAlgName()
- {
- return algOid.toString();
- }
-
- public AlgorithmParameters getAlgParameters()
- {
- if (params == null && encodedParams != null)
- {
- try
- {
- params = AlgorithmParameters.getInstance(getAlgName());
- params.init(encodedParams);
- }
- catch (NoSuchAlgorithmException ignore)
- {
- }
- catch (IOException ignore)
- {
- }
- }
- return params;
- }
-
- public synchronized byte[] getEncoded() throws IOException
- {
- if (encoded == null) encode();
- return (byte[]) encoded.clone();
- }
-
- public byte[] getEncryptedData()
- {
- return encryptedData;
- }
-
- public PKCS8EncodedKeySpec getKeySpec(Cipher cipher)
- throws InvalidKeySpecException
- {
- try
- {
- return new PKCS8EncodedKeySpec(cipher.doFinal(encryptedData));
- }
- catch (Exception x)
- {
- throw new InvalidKeySpecException(x.toString());
- }
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private void decode() throws IOException
- {
- DERReader der = new DERReader(encoded);
- DERValue val = der.read();
- if (val.getTag() != DER.SEQUENCE)
- throw new IOException("malformed EncryptedPrivateKeyInfo");
- val = der.read();
- if (val.getTag() != DER.SEQUENCE)
- throw new IOException("malformed AlgorithmIdentifier");
- int algpLen = val.getLength();
- DERValue oid = der.read();
- if (oid.getTag() != DER.OBJECT_IDENTIFIER)
- throw new IOException("malformed AlgorithmIdentifier");
- algOid = (OID) oid.getValue();
- if (algpLen == 0)
- {
- val = der.read();
- if (val.getTag() != 0)
- {
- encodedParams = val.getEncoded();
- der.read();
- }
- }
- else if (oid.getEncodedLength() < val.getLength())
- {
- val = der.read();
- encodedParams = val.getEncoded();
- }
- val = der.read();
- if (val.getTag() != DER.OCTET_STRING)
- throw new IOException("malformed AlgorithmIdentifier");
- encryptedData = (byte[]) val.getValue();
- }
-
- private void encode() throws IOException
- {
- List algId = new ArrayList(2);
- algId.add(new DERValue(DER.OBJECT_IDENTIFIER, algOid));
- getAlgParameters();
- if (params != null)
- {
- algId.add(DERReader.read(params.getEncoded()));
- }
- List epki = new ArrayList(2);
- epki.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, algId));
- epki.add(new DERValue(DER.OCTET_STRING, encryptedData));
- encoded = new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, epki).getEncoded();
- }
-}
diff --git a/libjava/javax/crypto/ExemptionMechanism.java b/libjava/javax/crypto/ExemptionMechanism.java
deleted file mode 100644
index b6cb02c63c8..00000000000
--- a/libjava/javax/crypto/ExemptionMechanism.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/* ExemptionMechanism.java -- Generic crypto-weakening mechanism.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import gnu.java.security.Engine;
-
-import java.lang.reflect.InvocationTargetException;
-import java.security.AlgorithmParameters;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.Security;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * An exemption mechanism, which will conditionally allow cryptography
- * where it is not normally allowed, implements things such as <i>key
- * recovery</i>, <i>key weakening</i>, or <i>key escrow</i>.
- *
- * <p><b>Implementation note</b>: this class is present for
- * API-compatibility only; it is not actually used anywhere in this library
- * and this library does not, in general, support crypto weakening.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public class ExemptionMechanism
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- private static final String SERVICE = "ExemptionMechanism";
- private ExemptionMechanismSpi emSpi;
- private Provider provider;
- private String mechanism;
- private boolean virgin;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- protected ExemptionMechanism(ExemptionMechanismSpi emSpi, Provider provider,
- String mechanism)
- {
- this.emSpi = emSpi;
- this.provider = provider;
- this.mechanism = mechanism;
- virgin = true;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- public static final ExemptionMechanism getInstance(String mechanism)
- throws NoSuchAlgorithmException
- {
- Provider[] provs = Security.getProviders();
- String msg = "";
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(mechanism, provs[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- msg = nsae.getMessage();
- }
- }
- throw new NoSuchAlgorithmException(msg);
- }
-
- public static final ExemptionMechanism getInstance(String mechanism,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- Provider p = Security.getProvider(provider);
- if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
- return getInstance(mechanism, p);
- }
-
- public static final ExemptionMechanism getInstance(String mechanism,
- Provider provider)
- throws NoSuchAlgorithmException
- {
- try
- {
- return new ExemptionMechanism((ExemptionMechanismSpi)
- Engine.getInstance(SERVICE, mechanism, provider),
- provider, mechanism);
- }
- catch (InvocationTargetException ite)
- {
- if (ite.getCause() instanceof NoSuchAlgorithmException)
- throw (NoSuchAlgorithmException) ite.getCause();
- else
- throw new NoSuchAlgorithmException(mechanism);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(mechanism);
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- public final byte[] genExemptionBlob()
- throws IllegalStateException, ExemptionMechanismException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- return emSpi.engineGenExemptionBlob();
- }
-
- public final int genExemptionBlob(byte[] output)
- throws IllegalStateException, ExemptionMechanismException,
- ShortBufferException
- {
- return genExemptionBlob(output, 0);
- }
-
- public final int genExemptionBlob(byte[] output, int outputOffset)
- throws IllegalStateException, ExemptionMechanismException,
- ShortBufferException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- return emSpi.engineGenExemptionBlob(output, outputOffset);
- }
-
- public final String getName()
- {
- return mechanism;
- }
-
- public final int getOutputSize(int inputLength) throws IllegalStateException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- return emSpi.engineGetOutputSize(inputLength);
- }
-
- public final Provider getProvider()
- {
- return provider;
- }
-
- public final void init(Key key)
- throws ExemptionMechanismException, InvalidKeyException
- {
- emSpi.engineInit(key);
- virgin = false;
- }
-
- public final void init(Key key, AlgorithmParameters params)
- throws ExemptionMechanismException, InvalidAlgorithmParameterException,
- InvalidKeyException
- {
- emSpi.engineInit(key, params);
- virgin = false;
- }
-
- public final void init(Key key, AlgorithmParameterSpec params)
- throws ExemptionMechanismException, InvalidAlgorithmParameterException,
- InvalidKeyException
- {
- emSpi.engineInit(key, params);
- virgin = false;
- }
-
- public final boolean isCryptoAllowed(Key key)
- throws ExemptionMechanismException
- {
- return true;
- }
-
- protected void finalize()
- {
- }
-}
diff --git a/libjava/javax/crypto/ExemptionMechanismException.java b/libjava/javax/crypto/ExemptionMechanismException.java
deleted file mode 100644
index 6cc44c70d1b..00000000000
--- a/libjava/javax/crypto/ExemptionMechanismException.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ExemptionMechanismException -- An error in an exemption mechanism.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.GeneralSecurityException;
-
-/**
- * Signals a general exception in an {@link ExemptionMechanism}.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public class ExemptionMechanismException extends GeneralSecurityException
-{
-
- // Constant.
- // ------------------------------------------------------------------------
-
- /** Compatible with JDK1.4. */
- private static final long serialVersionUID = 1572699429277957109L;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new exception with no detail message.
- */
- public ExemptionMechanismException()
- {
- super();
- }
-
- /**
- * Create a new exception with a detail message.
- *
- * @param message The detail message.
- */
- public ExemptionMechanismException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/crypto/ExemptionMechanismSpi.java b/libjava/javax/crypto/ExemptionMechanismSpi.java
deleted file mode 100644
index 00406095eb1..00000000000
--- a/libjava/javax/crypto/ExemptionMechanismSpi.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* ExemptionMechanismSpi.java -- Exemption mechanism service provider interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.AlgorithmParameters;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * The <i>Service Provider Interface</i> (<b>SPI</b>) for the {@link
- * ExemptionMechanism} class.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public abstract class ExemptionMechanismSpi
-{
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new exemption mechanism SPI.
- */
- public ExemptionMechanismSpi()
- {
- }
-
- // Abstract instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return a key blob for the key that this mechanism was initialized
- * with.
- *
- * @return The key blob.
- * @throws javax.crypto.ExemptionMechanismException If generating the
- * blob fails.
- */
- protected abstract byte[] engineGenExemptionBlob()
- throws ExemptionMechanismException;
-
- /**
- * Generate a key blob for the key that this mechanism was initialized
- * with, storing it into the given byte array.
- *
- * @param output The destination for the key blob.
- * @param outputOffset The index in the output array to start.
- * @return The size of the key blob.
- * @throws javax.crypto.ExemptionMechanismException If generating the
- * blob fails.
- * @throws javax.crypto.ShortBufferException If the output array is
- * not large enough for the key blob.
- */
- protected abstract int engineGenExemptionBlob(byte[] output, int outputOffset)
- throws ExemptionMechanismException, ShortBufferException;
-
- /**
- * Get the size of the output blob given an input key size. The actual
- * blob may be shorter than the value returned by this method. Both
- * values are in bytes.
- *
- * @param inputLength The input size.
- * @return The output size.
- */
- protected abstract int engineGetOutputSize(int inputLength);
-
- /**
- * Initialize this mechanism with a key.
- *
- * @param key The key.
- * @throws javax.crypto.ExemptionMechanismException If generating the
- * blob fails.
- * @throws java.security.InvalidKeyException If the supplied key
- * cannot be used.
- */
- protected abstract void engineInit(Key key)
- throws ExemptionMechanismException, InvalidKeyException;
-
- /**
- * Initialize this mechanism with a key and parameters.
- *
- * @param key The key.
- * @param params The parameters.
- * @throws javax.crypto.ExemptionMechanismException If generating the
- * blob fails.
- * @throws java.security.InvalidAlgorithmParameterExceptin If the
- * supplied parameters are inappropriate.
- * @throws java.security.InvalidKeyException If the supplied key
- * cannot be used.
- */
- protected abstract void engineInit(Key key, AlgorithmParameters params)
- throws ExemptionMechanismException, InvalidAlgorithmParameterException,
- InvalidKeyException;
-
- /**
- * Initialize this mechanism with a key and parameters.
- *
- * @param key The key.
- * @param params The parameters.
- * @throws javax.crypto.ExemptionMechanismException If generating the
- * blob fails.
- * @throws java.security.InvalidAlgorithmParameterExceptin If the
- * supplied parameters are inappropriate.
- * @throws java.security.InvalidKeyException If the supplied key
- * cannot be used.
- */
- protected abstract void engineInit(Key key, AlgorithmParameterSpec params)
- throws ExemptionMechanismException, InvalidAlgorithmParameterException,
- InvalidKeyException;
-}
diff --git a/libjava/javax/crypto/IllegalBlockSizeException.java b/libjava/javax/crypto/IllegalBlockSizeException.java
deleted file mode 100644
index c08752aab0c..00000000000
--- a/libjava/javax/crypto/IllegalBlockSizeException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* IllegalBlockSizeException.java -- Signals illegal block sizes.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.GeneralSecurityException;
-
-/**
- * This exception is thrown when finishing encryption without padding or
- * decryption and the input is not a multiple of the cipher's block
- * size.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class IllegalBlockSizeException extends GeneralSecurityException
-{
-
- // Constant.
- // ------------------------------------------------------------------------
-
- /** Serialization constant. */
- private static final long serialVersionUID = -1965144811953540392L;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- public IllegalBlockSizeException()
- {
- super();
- }
-
- public IllegalBlockSizeException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/crypto/KeyAgreement.java b/libjava/javax/crypto/KeyAgreement.java
deleted file mode 100644
index d71743e3e63..00000000000
--- a/libjava/javax/crypto/KeyAgreement.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/* KeyAgreement.java -- Engine for key agreement methods.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import gnu.java.security.Engine;
-
-import java.lang.reflect.InvocationTargetException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.SecureRandom;
-import java.security.Security;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * Key agreement is a method in which two or more parties may agree on a
- * secret key for symmetric cryptography or message authentication
- * without transmitting any secrets in the clear. Key agreement
- * algorithms typically use a public/private <i>key pair</i>, and the
- * public key (along with some additional information) is sent across
- * untrusted networks.
- *
- * <p>The most common form of key agreement used today is the
- * <i>Diffie-Hellman key exchange algorithm</i>, described in <a
- * href="http://www.rsasecurity.com/rsalabs/pkcs/pkcs-3/">PKCS #3 -
- * Diffie Hellman Key Agreement Standard</a>.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see KeyGenerator
- * @see SecretKey
- */
-public class KeyAgreement
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- private static final String SERVICE = "KeyAgreement";
-
- /** The underlying key agreement implementation. */
- private KeyAgreementSpi kaSpi;
-
- /** The provider of this implementation. */
- private Provider provider;
-
- /** The name of this instance's algorithm. */
- private String algorithm;
-
- /** Singnals whether or not this instance has been initialized. */
- private boolean virgin;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- protected KeyAgreement(KeyAgreementSpi kaSpi, Provider provider,
- String algorithm)
- {
- this.kaSpi = kaSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- virgin = true;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get an implementation of an algorithm from the first provider that
- * implements it.
- *
- * @param algorithm The name of the algorithm to get.
- * @return The proper KeyAgreement instacne, if found.
- * @throws java.security.NoSuchAlgorithmException If the specified
- * algorithm is not implemented by any installed provider.
- */
- public static final KeyAgreement getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] provs = Security.getProviders();
- String msg = algorithm;
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- msg = nsae.getMessage();
- }
- }
- throw new NoSuchAlgorithmException(msg);
- }
-
- /**
- * Get an implementation of an algorithm from a named provider.
- *
- * @param algorithm The name of the algorithm to get.
- * @param provider The name of the provider from which to get the
- * implementation.
- * @return The proper KeyAgreement instance, if found.
- * @throws java.security.NoSuchAlgorithmException If the named provider
- * does not implement the algorithm.
- * @throws java.security.NoSuchProviderException If the named provider
- * does not exist.
- */
- public static final KeyAgreement getInstance(String algorithm,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- Provider p = Security.getProvider(provider);
- if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
- return getInstance(algorithm, p);
- }
-
- /**
- * Get an implementation of an algorithm from a specific provider.
- *
- * @param algorithm The name of the algorithm to get.
- * @param provider The provider from which to get the implementation.
- * @return The proper KeyAgreement instance, if found.
- * @throws java.security.NoSuchAlgorithmException If this provider
- * does not implement the algorithm.
- */
- public static final KeyAgreement getInstance(String algorithm,
- Provider provider)
- throws NoSuchAlgorithmException
- {
- try
- {
- return new KeyAgreement((KeyAgreementSpi)
- Engine.getInstance(SERVICE, algorithm, provider),
- provider, algorithm);
- }
- catch (InvocationTargetException ite)
- {
- if (ite.getCause() == null)
- throw new NoSuchAlgorithmException(algorithm);
- if (ite.getCause() instanceof NoSuchAlgorithmException)
- throw (NoSuchAlgorithmException) ite.getCause();
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Do a phase in the key agreement. The number of times this method is
- * called depends upon the algorithm and the number of parties
- * involved, but must be called at least once with the
- * <code>lastPhase</code> flag set to <code>true</code>.
- *
- * @param key The key for this phase.
- * @param lastPhase Should be <code>true</code> if this will be the
- * last phase before generating the shared secret.
- * @return The intermediate result, or <code>null</code> if there is
- * no intermediate result.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized.
- * @throws java.security.InvalidKeyException If the key is
- * inappropriate for this algorithm.
- */
- public final Key doPhase(Key key, boolean lastPhase)
- throws IllegalStateException, InvalidKeyException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- return kaSpi.engineDoPhase(key, lastPhase);
- }
-
- /**
- * Generate the shared secret in a new byte array.
- *
- * @return The shared secret.
- * @throws java.lang.IllegalStateException If this instnace has not
- * been initialized, or if not enough calls to
- * <code>doPhase</code> have been made.
- */
- public final byte[] generateSecret() throws IllegalStateException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- return kaSpi.engineGenerateSecret();
- }
-
- /**
- * Generate the shared secret and store it into the supplied array.
- *
- * @param sharedSecret The array in which to store the secret.
- * @param offset The index in <code>sharedSecret</code> to start
- * storing data.
- * @return The length of the shared secret, in bytes.
- * @throws java.lang.IllegalStateException If this instnace has not
- * been initialized, or if not enough calls to
- * <code>doPhase</code> have been made.
- * @throws javax.crypto.ShortBufferException If the supplied array is
- * not large enough to store the result.
- */
- public final int generateSecret(byte[] sharedSecret, int offset)
- throws IllegalStateException, ShortBufferException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- return kaSpi.engineGenerateSecret(sharedSecret, offset);
- }
-
- /**
- * Generate the shared secret and return it as an appropriate {@link
- * SecretKey}.
- *
- * @param algorithm The secret key's algorithm.
- * @return The shared secret as a secret key.
- * @throws java.lang.IllegalStateException If this instnace has not
- * been initialized, or if not enough calls to
- * <code>doPhase</code> have been made.
- * @throws java.security.InvalidKeyException If the shared secret
- * cannot be used to make a {@link SecretKey}.
- * @throws java.security.NoSuchAlgorithmException If the specified
- * algorithm does not exist.
- */
- public final SecretKey generateSecret(String algorithm)
- throws IllegalStateException, InvalidKeyException, NoSuchAlgorithmException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- return kaSpi.engineGenerateSecret(algorithm);
- }
-
- /**
- * Return the name of this key-agreement algorithm.
- *
- * @return The algorithm name.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Return the provider of the underlying implementation.
- *
- * @return The provider.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Initialize this key agreement with a key. This method will use the
- * highest-priority {@link java.security.SecureRandom} as its source
- * of randomness.
- *
- * @param key The key, usually the user's private key.
- * @throws java.security.InvalidKeyException If the supplied key is
- * not appropriate.
- */
- public final void init(Key key) throws InvalidKeyException
- {
- init(key, new SecureRandom());
- }
-
- /**
- * Initialize this key agreement with a key and a source of
- * randomness.
- *
- * @param key The key, usually the user's private key.
- * @param random The source of randomness.
- * @throws java.security.InvalidKeyException If the supplied key is
- * not appropriate.
- */
- public final void init(Key key, SecureRandom random)
- throws InvalidKeyException
- {
- kaSpi.engineInit(key, random);
- virgin = false; // w00t!
- }
-
- /**
- * Initialize this key agreement with a key and parameters. This
- * method will use the highest-priority {@link
- * java.security.SecureRandom} as its source of randomness.
- *
- * @param key The key, usually the user's private key.
- * @param params The algorithm parameters.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * supplied parameters are not appropriate.
- * @throws java.security.InvalidKeyException If the supplied key is
- * not appropriate.
- */
- public final void init(Key key, AlgorithmParameterSpec params)
- throws InvalidAlgorithmParameterException, InvalidKeyException
- {
- init(key, params, new SecureRandom());
- }
-
- /**
- * Initialize this key agreement with a key, parameters, and source of
- * randomness.
- *
- * @param key The key, usually the user's private key.
- * @param params The algorithm parameters.
- * @param random The source of randomness.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * supplied parameters are not appropriate.
- * @throws java.security.InvalidKeyException If the supplied key is
- * not appropriate.
- */
- public final void init(Key key, AlgorithmParameterSpec params,
- SecureRandom random)
- throws InvalidAlgorithmParameterException, InvalidKeyException
- {
- kaSpi.engineInit(key, params, random);
- virgin = false; // w00t!
- }
-}
diff --git a/libjava/javax/crypto/KeyAgreementSpi.java b/libjava/javax/crypto/KeyAgreementSpi.java
deleted file mode 100644
index d71c89c1361..00000000000
--- a/libjava/javax/crypto/KeyAgreementSpi.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/* KeyAgreementSpi.java -- The key agreement service provider interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * This is the <i>Service Provider Interface</i> (<b>SPI</b>) for the
- * {@link javax.crypto.KeyAgreement} class.
- *
- * <p>Providers wishing to implement a key agreement algorithm must
- * subclass this and provide an appropriate implementation for all the
- * abstract methods below, and provide an appropriate entry in the
- * master {@link java.security.Provider} class (the service name for key
- * agreement algorithms is <code>"KeyAgreement"</code>).
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see KeyAgreement
- * @see SecretKey
- */
-public abstract class KeyAgreementSpi
-{
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new KeyAgreementSpi instance.
- */
- public KeyAgreementSpi()
- {
- }
-
- // Abstract instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Do a phase in the key agreement.
- *
- * @param key The key to use for this phase.
- * @param lastPhase <code>true</code> if this call should be the last
- * phase.
- * @return The intermediate result, or <code>null</code> if there is
- * no intermediate result.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized.
- * @throws java.security.InvalidKeyException If the supplied key is
- * not appropriate.
- */
- protected abstract Key engineDoPhase(Key key, boolean lastPhase)
- throws IllegalStateException, InvalidKeyException;
-
- /**
- * Generate the shared secret in a new byte array.
- *
- * @return The shared secret in a new byte array.
- * @throws java.lang.IllegalStateException If this key agreement is
- * not ready to generate the secret.
- */
- protected abstract byte[] engineGenerateSecret()
- throws IllegalStateException;
-
- /**
- * Generate the shared secret, storing it into the specified array.
- *
- * @param sharedSecret The byte array in which to store the secret.
- * @param offset The offset into the byte array to start.
- * @return The size of the shared secret.
- * @throws java.lang.IllegalStateException If this key agreement is
- * not ready to generate the secret.
- * @throws javax.crypto.ShortBufferException If there is not enough
- * space in the supplied array for the shared secret.
- */
- protected abstract int engineGenerateSecret(byte[] sharedSecret, int offset)
- throws IllegalStateException, ShortBufferException;
-
- /**
- * Generate the shared secret and return it as a {@link SecretKey}.
- *
- * @param algorithm The algorithm with which to generate the secret key.
- * @return The shared secret as a secret key.
- * @throws java.lang.IllegalStateException If this key agreement is
- * not ready to generate the secret.
- * @throws java.security.InvalidKeyException If the shared secret
- * cannot be made into a {@link SecretKey}.
- * @throws java.security.NoSuchAlgorithmException If
- * <code>algorithm</code> cannot be found.
- */
- protected abstract SecretKey engineGenerateSecret(String algorithm)
- throws IllegalStateException, InvalidKeyException, NoSuchAlgorithmException;
-
- /**
- * Initialize this key agreement with a key, parameters, and source of
- * randomness.
- *
- * @param key The key to initialize with, usually a private key.
- * @param params The parameters to initialize with.
- * @param random The source of randomness to use.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * supplied parameters are inappropriate.
- * @throws java.security.InvalidKeyException If the supplied key is
- * inappropriate.
- */
- protected abstract void engineInit(Key key, AlgorithmParameterSpec params,
- SecureRandom random)
- throws InvalidAlgorithmParameterException, InvalidKeyException;
-
- /**
- * Initialize this key agreement with a key and source of randomness.
- *
- * @param key The key to initialize with, usually a private key.
- * @param random The source of randomness to use.
- * @throws java.security.InvalidKeyException If the supplied key is
- * inappropriate.
- */
- protected abstract void engineInit(Key key, SecureRandom random)
- throws InvalidKeyException;
-}
diff --git a/libjava/javax/crypto/KeyGenerator.java b/libjava/javax/crypto/KeyGenerator.java
deleted file mode 100644
index c3f4cee9f5c..00000000000
--- a/libjava/javax/crypto/KeyGenerator.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/* KeyGenerator.java -- Interface to a symmetric key generator.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import gnu.java.security.Engine;
-
-import java.lang.reflect.InvocationTargetException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.SecureRandom;
-import java.security.Security;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * A generic producer of keys for symmetric cryptography. The keys
- * returned may be simple wrappers around byte arrays, or, if the
- * target cipher requires them, more complex objects.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see Cipher
- * @see Mac
- */
-public class KeyGenerator
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- private static final String SERVICE = "KeyGenerator";
-
- /** The underlying generator implementation. */
- private KeyGeneratorSpi kgSpi;
-
- /** The provider of the implementation. */
- private Provider provider;
-
- /** The name of the algorithm. */
- private String algorithm;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new key generator.
- *
- * @param kgSpi The underlying generator.
- * @param provider The provider of this implementation.
- * @param algorithm The algorithm's name.
- */
- protected KeyGenerator(KeyGeneratorSpi kgSpi, Provider provider,
- String algorithm)
- {
- this.kgSpi = kgSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new key generator, returning the first available
- * implementation.
- *
- * @param algorithm The generator algorithm name.
- * @throws java.security.NoSuchAlgorithmException If the specified
- * algorithm does not exist.
- */
- public static final KeyGenerator getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] provs = Security.getProviders();
- String msg = algorithm;
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- msg = nsae.getMessage();
- }
- }
- throw new NoSuchAlgorithmException(msg);
- }
-
- /**
- * Create a new key generator from the named provider.
- *
- * @param algorithm The generator algorithm name.
- * @param provider The name of the provider to use.
- * @return An appropriate key generator, if found.
- * @throws java.security.NoSuchAlgorithmException If the specified
- * algorithm is not implemented by the named provider.
- * @throws java.security.NoSuchProviderException If the named provider
- * does not exist.
- */
- public static final KeyGenerator getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- Provider p = Security.getProvider(provider);
- if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
- return getInstance(algorithm, p);
- }
-
- /**
- * Create a new key generator from the supplied provider.
- *
- * @param algorithm The generator algorithm name.
- * @param provider The provider to use.
- * @return An appropriate key generator, if found.
- * @throws java.security.NoSuchAlgorithmException If the specified
- * algorithm is not implemented by the provider.
- */
- public static final KeyGenerator getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
- {
- try
- {
- return new KeyGenerator((KeyGeneratorSpi)
- Engine.getInstance(SERVICE, algorithm, provider),
- provider, algorithm);
- }
- catch (InvocationTargetException ite)
- {
- if (ite.getCause() == null)
- throw new NoSuchAlgorithmException(algorithm);
- if (ite.getCause() instanceof NoSuchAlgorithmException)
- throw (NoSuchAlgorithmException) ite.getCause();
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Generate a key.
- *
- * @return The new key.
- */
- public final SecretKey generateKey()
- {
- return kgSpi.engineGenerateKey();
- }
-
- /**
- * Return the name of this key generator.
- *
- * @return The algorithm name.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Return the provider of the underlying implementation.
- *
- * @return The provider.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Initialize this key generator with a set of parameters; the
- * highest-priority {@link java.security.SecureRandom} implementation
- * will be used.
- *
- * @param params The algorithm parameters.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * supplied parameters are inapproprate.
- */
- public final void init(AlgorithmParameterSpec params)
- throws InvalidAlgorithmParameterException
- {
- init(params, new SecureRandom());
- }
-
- /**
- * Initialize this key generator with a set of parameters and a source
- * of randomness.
- *
- * @param params The algorithm parameters.
- * @param random The source of randomness.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * supplied parameters are inapproprate.
- */
- public final void init(AlgorithmParameterSpec params, SecureRandom random)
- throws InvalidAlgorithmParameterException
- {
- kgSpi.engineInit(params, random);
- }
-
- /**
- * Initialize this key generator with a key size (in bits); the
- * highest-priority {@link java.security.SecureRandom} implementation
- * will be used.
- *
- * @param keySize The target key size, in bits.
- * @throws java.security.InvalidParameterException If the
- * key size is unsupported.
- */
- public final void init(int keySize)
- {
- init(keySize, new SecureRandom());
- }
-
- /**
- * Initialize this key generator with a key size (in bits) and a
- * source of randomness.
- *
- * @param keySize The target key size, in bits.
- * @param random The source of randomness.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * key size is unsupported.
- */
- public final void init(int keySize, SecureRandom random)
- {
- kgSpi.engineInit(keySize, random);
- }
-
- /**
- * Initialize this key generator with a source of randomness. The
- * implementation-specific default parameters (such as key size) will
- * be used.
- *
- * @param random The source of randomness.
- */
- public final void init(SecureRandom random)
- {
- kgSpi.engineInit(random);
- }
-}
diff --git a/libjava/javax/crypto/KeyGeneratorSpi.java b/libjava/javax/crypto/KeyGeneratorSpi.java
deleted file mode 100644
index 1c481890b25..00000000000
--- a/libjava/javax/crypto/KeyGeneratorSpi.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* KeyGeneratorSpi.java -- The key generator service provider interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.SecureRandom;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * The <i>Service Provider Interface</i> (<b>SPI</b>) for the {@link
- * KeyGenerator} class.
- *
- * <p>Providers wishing to implement a key generator must subclass this
- * and provide an appropriate implementation for all the abstract
- * methods below, and provide an appropriate entry in the master {@link
- * java.security.Provider} class (the service name for key generators is
- * <code>"KeyGenerator"</code>).
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see KeyGenerator
- */
-public abstract class KeyGeneratorSpi
-{
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /** Create a new key generator SPI. */
- public KeyGeneratorSpi()
- {
- }
-
- // Abstract instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Generate a key, returning it as a {@link SecretKey}.
- *
- * @return The generated key.
- */
- protected abstract SecretKey engineGenerateKey();
-
- /**
- * Initialize this key generator with parameters and a source of
- * randomness.
- *
- * @param params The parameters.
- * @param random The source of randomness.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * parameters are inappropriate for this instance.
- */
- protected abstract void engineInit(AlgorithmParameterSpec params,
- SecureRandom random)
- throws InvalidAlgorithmParameterException;
-
- /**
- * Initialize this key generator with a key size (in bits) and a
- * source of randomness.
- *
- * @param keySize The target key size, in bits.
- * @param random The source of randomness.
- * @throws java.security.InvalidParameterException If the
- * key size is illogical or unsupported.
- */
- protected abstract void engineInit(int keySize, SecureRandom random);
-
- /**
- * Initialize this key generator with a source of randomness; the
- * implementation should use reasonable default parameters (such as
- * generated key size).
- *
- * @param random The source of randomness.
- */
- protected abstract void engineInit(SecureRandom random);
-}
diff --git a/libjava/javax/crypto/Mac.java b/libjava/javax/crypto/Mac.java
deleted file mode 100644
index abbff8b2387..00000000000
--- a/libjava/javax/crypto/Mac.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/* Mac.java -- The message authentication code interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import gnu.java.security.Engine;
-
-import java.lang.reflect.InvocationTargetException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.Security;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * This class implements a "message authentication code" (MAC), a method
- * to ensure the integrity of data transmitted between two parties who
- * share a common secret key.
- *
- * <p>The best way to describe a MAC is as a <i>keyed one-way hash
- * function</i>, which looks like:
- *
- * <blockquote><p><code>D = MAC(K, M)</code></blockquote>
- *
- * <p>where <code>K</code> is the key, <code>M</code> is the message,
- * and <code>D</code> is the resulting digest. One party will usually
- * send the concatenation <code>M || D</code> to the other party, who
- * will then verify <code>D</code> by computing <code>D'</code> in a
- * similar fashion. If <code>D == D'</code>, then the message is assumed
- * to be authentic.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class Mac implements Cloneable
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- private static final String SERVICE = "Mac";
-
- /** The underlying MAC implementation. */
- private MacSpi macSpi;
-
- /** The provider we got our implementation from. */
- private Provider provider;
-
- /** The name of the algorithm. */
- private String algorithm;
-
- /** Whether or not we've been initialized. */
- private boolean virgin;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new Mac instance.
- *
- * @param macSpi The underlying MAC implementation.
- * @param provider The provider of this implementation.
- * @param algorithm The name of this MAC algorithm.
- */
- protected Mac(MacSpi macSpi, Provider provider, String algorithm)
- {
- this.macSpi = macSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- virgin = true;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get an instance of the named algorithm from the first provider with
- * an appropriate implementation.
- *
- * @param algorithm The name of the algorithm.
- * @return An appropriate Mac instance, if the specified algorithm
- * is implemented by a provider.
- * @throws java.security.NoSuchAlgorithmException If no implementation
- * of the named algorithm is installed.
- */
- public static final Mac getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] provs = Security.getProviders();
- String msg = "";
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- msg = nsae.getMessage();
- }
- }
- throw new NoSuchAlgorithmException(msg);
- }
-
- /**
- * Get an instance of the named algorithm from the named provider.
- *
- * @param algorithm The name of the algorithm.
- * @param provider The name of the provider.
- * @return An appropriate Mac instance, if the specified algorithm is
- * implemented by the named provider.
- * @throws java.security.NoSuchAlgorithmException If the named provider
- * has no implementation of the algorithm.
- * @throws java.security.NoSuchProviderException If the named provider
- * does not exist.
- */
- public static final Mac getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- Provider p = Security.getProvider(provider);
- if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
- return getInstance(algorithm, p);
- }
-
- /**
- * Get an instance of the named algorithm from a provider.
- *
- * @param algorithm The name of the algorithm.
- * @param provider The provider.
- * @return An appropriate Mac instance, if the specified algorithm is
- * implemented by the provider.
- * @throws java.security.NoSuchAlgorithmException If the provider
- * has no implementation of the algorithm.
- */
- public static final Mac getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
- {
- try
- {
- return new Mac((MacSpi) Engine.getInstance(SERVICE, algorithm, provider),
- provider, algorithm);
- }
- catch (InvocationTargetException ite)
- {
- if (ite.getCause() == null)
- throw new NoSuchAlgorithmException(algorithm);
- if (ite.getCause() instanceof NoSuchAlgorithmException)
- throw (NoSuchAlgorithmException) ite.getCause();
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Finishes the computation of a MAC and returns the digest.
- *
- * <p>After this method succeeds, it may be used again as just after a
- * call to <code>init</code>, and can compute another MAC using the
- * same key and parameters.
- *
- * @return The message authentication code.
- * @throws java.lang.IllegalStateException If this instnace has not
- * been initialized.
- */
- public final byte[] doFinal() throws IllegalStateException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- byte[] digest = macSpi.engineDoFinal();
- reset();
- return digest;
- }
-
- /**
- * Finishes the computation of a MAC with a final byte array (or
- * computes a MAC over those bytes only) and returns the digest.
- *
- * <p>After this method succeeds, it may be used again as just after a
- * call to <code>init</code>, and can compute another MAC using the
- * same key and parameters.
- *
- * @param input The bytes to add.
- * @return The message authentication code.
- * @throws java.lang.IllegalStateException If this instnace has not
- * been initialized.
- */
- public final byte[] doFinal(byte[] input) throws IllegalStateException
- {
- update(input);
- byte[] digest = macSpi.engineDoFinal();
- reset();
- return digest;
- }
-
- /**
- * Finishes the computation of a MAC and places the result into the
- * given array.
- *
- * <p>After this method succeeds, it may be used again as just after a
- * call to <code>init</code>, and can compute another MAC using the
- * same key and parameters.
- *
- * @param output The destination for the result.
- * @param outOffset The index in the output array to start.
- * @return The message authentication code.
- * @throws java.lang.IllegalStateException If this instnace has not
- * been initialized.
- * @throws javax.crypto.ShortBufferException If <code>output</code> is
- * not large enough to hold the result.
- */
- public final void doFinal(byte[] output, int outOffset)
- throws IllegalStateException, ShortBufferException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- if (output.length - outOffset < getMacLength())
- {
- throw new ShortBufferException();
- }
- byte[] mac = macSpi.engineDoFinal();
- System.arraycopy(mac, 0, output, outOffset, getMacLength());
- reset();
- }
-
- /**
- * Returns the name of this MAC algorithm.
- *
- * @return The MAC name.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Get the size of the MAC. This is the size of the array returned by
- * {@link #doFinal()} and {@link #doFinal(byte[])}, and the minimum
- * number of bytes that must be available in the byte array passed to
- * {@link #doFinal(byte[],int)}.
- *
- * @return The MAC length.
- */
- public final int getMacLength()
- {
- return macSpi.engineGetMacLength();
- }
-
- /**
- * Get the provider of the underlying implementation.
- *
- * @return The provider.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Initialize this MAC with a key and no parameters.
- *
- * @param key The key to initialize this instance with.
- * @throws java.security.InvalidKeyException If the key is
- * unacceptable.
- */
- public final void init(Key key) throws InvalidKeyException
- {
- try
- {
- init(key, null);
- }
- catch (InvalidAlgorithmParameterException iape)
- {
- throw new IllegalArgumentException(algorithm + " needs parameters");
- }
- }
-
- /**
- * Initialize this MAC with a key and parameters.
- *
- * @param key The key to initialize this instance with.
- * @param params The algorithm-specific parameters.
- * @throws java.security.InvalidAlgorithmParameterException If the
- * algorithm parameters are unacceptable.
- * @throws java.security.InvalidKeyException If the key is
- * unacceptable.
- */
- public final void init(Key key, AlgorithmParameterSpec params)
- throws InvalidAlgorithmParameterException, InvalidKeyException
- {
- macSpi.engineInit(key, params);
- virgin = false; // w00t!
- }
-
- /**
- * Reset this instance. A call to this method returns this instance
- * back to the state it was in just after it was initialized.
- */
- public final void reset()
- {
- macSpi.engineReset();
- }
-
- /**
- * Update the computation with a single byte.
- *
- * @param input The next byte.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized.
- */
- public final void update(byte input) throws IllegalStateException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- macSpi.engineUpdate(input);
- }
-
- /**
- * Update the computation with a byte array.
- *
- * @param input The next bytes.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized.
- */
- public final void update(byte[] input) throws IllegalStateException
- {
- update(input, 0, input.length);
- }
-
- /**
- * Update the computation with a portion of a byte array.
- *
- * @param input The next bytes.
- * @param offset The index in <code>input</code> to start.
- * @param length The number of bytes to update.
- * @throws java.lang.IllegalStateException If this instance has not
- * been initialized.
- */
- public final void update(byte[] input, int offset, int length)
- throws IllegalStateException
- {
- if (virgin)
- {
- throw new IllegalStateException("not initialized");
- }
- macSpi.engineUpdate(input, offset, length);
- }
-
- /**
- * Clone this instance, if the underlying implementation supports it.
- *
- * @return A clone of this instance.
- * @throws java.lang.CloneNotSupportedException If the underlying
- * implementation is not cloneable.
- */
- public final Object clone() throws CloneNotSupportedException
- {
- Mac result = new Mac((MacSpi) macSpi.clone(), provider, algorithm);
- result.virgin = virgin;
- return result;
- }
-}
diff --git a/libjava/javax/crypto/MacSpi.java b/libjava/javax/crypto/MacSpi.java
deleted file mode 100644
index b0f96bff367..00000000000
--- a/libjava/javax/crypto/MacSpi.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/* MacSpi.java -- The MAC service provider interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * This is the <i>Service Provider Interface</i> (<b>SPI</b>) for the
- * {@link Mac} class.
- *
- * <p>Providers wishing to implement a Mac must subclass this class and
- * provide appropriate implementations of all its abstract methods,
- * then provide an entry pointing to this implementation in the master
- * {@link java.security.Provider} class.
- *
- * <p>Implementations may optionally implement the {@link
- * java.lang.Cloneable} interface.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public abstract class MacSpi
-{
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new MacSpi instance.
- */
- public MacSpi()
- {
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns a clone of this instance if cloning is supported.
- *
- * @return A clone of this instance.
- * @throws java.lang.CloneNotSupportedException If this instance does
- * not support cloneing.
- */
- public Object clone() throws CloneNotSupportedException
- {
- return super.clone();
- }
-
- // Abstract instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Finalize the computation of this MAC and return the result as a
- * byte array.
- *
- * @return The MAC.
- */
- protected abstract byte[] engineDoFinal();
-
- /**
- * Return the total length, in bytes, of the computed MAC (the length
- * of the byte array returned by {@link #doFinal()}.
- *
- * @return The MAC length.
- */
- protected abstract int engineGetMacLength();
-
- /**
- * Initialize (or re-initialize) this instance.
- *
- * @param key The key to use.
- * @param params The parameters to use.
- * @throws java.security.InvalidAlgorithmParameterException If this
- * instance rejects the specified parameters.
- * @throws java.security.InvalidKeyException If this instance rejects
- * the specified key.
- */
- protected abstract void engineInit(Key key, AlgorithmParameterSpec params)
- throws InvalidAlgorithmParameterException, InvalidKeyException;
-
- /**
- * Reset this instance. After this method succeeds, the state of this
- * instance should be the same as it was before any data was input
- * (possibly after a call to {@link
- * #init(java.security.Key,java.security.spec.AlgorithmParameterSpec)},
- * possibly not).
- */
- protected abstract void engineReset();
-
- /**
- * Update this MAC with a single byte.
- *
- * @param input The next byte.
- */
- protected abstract void engineUpdate(byte input);
-
- /**
- * Update this MAC with a portion of a byte array.
- *
- * @param input The next bytes.
- * @param offset The index in <code>input</code> at which to start.
- * @param length The number of bytes to update.
- */
- protected abstract void engineUpdate(byte[] input, int offset, int length);
-}
diff --git a/libjava/javax/crypto/NoSuchPaddingException.java b/libjava/javax/crypto/NoSuchPaddingException.java
deleted file mode 100644
index 57ada3c5d1d..00000000000
--- a/libjava/javax/crypto/NoSuchPaddingException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* NoSuchPaddingException.java -- Signals an unknown padding scheme.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.GeneralSecurityException;
-
-/**
- * This exception is thrown when a particular padding scheme is
- * requested but is not available.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public class NoSuchPaddingException extends GeneralSecurityException
-{
-
- // Constant.
- // ------------------------------------------------------------------------
-
- /** Serialization constant. */
- private static final long serialVersionUID = -4572885201200175466L;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- public NoSuchPaddingException()
- {
- super();
- }
-
- public NoSuchPaddingException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/crypto/NullCipher.java b/libjava/javax/crypto/NullCipher.java
deleted file mode 100644
index 1913afb3510..00000000000
--- a/libjava/javax/crypto/NullCipher.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* NullCipher.java -- The identity cipher.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-/**
- * Trivial subclass of Cipher that implements the <i>identity
- * transformation</i>, where the input is always copied to the output
- * unchanged. Null ciphers can be instantiated with the public
- * constructor.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class NullCipher extends Cipher
-{
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new identity cipher.
- */
- public NullCipher()
- {
- super(new NullCipherImpl(), null, "NULL");
- }
-}
diff --git a/libjava/javax/crypto/NullCipherImpl.java b/libjava/javax/crypto/NullCipherImpl.java
deleted file mode 100644
index 2ff5e0e7795..00000000000
--- a/libjava/javax/crypto/NullCipherImpl.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/* NullCipherImpl.java -- implementation of NullCipher.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.AlgorithmParameters;
-import java.security.Key;
-import java.security.SecureRandom;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * Implementation of the identity cipher.
- */
-final class NullCipherImpl extends CipherSpi
-{
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- NullCipherImpl()
- {
- super();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- protected void engineSetMode(String mode) { }
- protected void engineSetPadding(String padding) { }
-
- protected int engineGetBlockSize()
- {
- return 1;
- }
-
- protected int engineGetOutputSize(int inputLen)
- {
- return inputLen;
- }
-
- protected byte[] engineGetIV()
- {
- return null;
- }
-
- protected AlgorithmParameters engineGetParameters()
- {
- return null;
- }
-
- protected void engineInit(int mode, Key key, SecureRandom random) { }
- protected void engineInit(int mode, Key key, AlgorithmParameterSpec spec, SecureRandom random) { }
- protected void engineInit(int mode, Key key, AlgorithmParameters params, SecureRandom random) { }
-
- protected byte[] engineUpdate(byte[] input, int inputOffset, int inputLen)
- {
- if (input == null)
- return new byte[0];
- if (inputOffset < 0 || inputLen < 0 || inputOffset + inputLen > input.length)
- throw new ArrayIndexOutOfBoundsException();
- byte[] output = new byte[inputLen];
- System.arraycopy(input, inputOffset, output, 0, inputLen);
- return output;
- }
-
- protected int engineUpdate(byte[] input, int inputOffset, int inputLen,
- byte[] output, int outputOffset)
- throws ShortBufferException
- {
- if (input == null)
- return 0;
- if (inputOffset < 0 || inputLen < 0 || inputOffset + inputLen > input.length
- || outputOffset < 0)
- throw new ArrayIndexOutOfBoundsException();
- if (output.length - outputOffset < inputLen)
- throw new ShortBufferException();
- System.arraycopy(input, inputOffset, output, outputOffset, inputLen);
- return inputLen;
- }
-
- protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen)
- {
- return engineUpdate(input, inputOffset, inputLen);
- }
-
- protected int engineDoFinal(byte[] input, int inputOffset, int inputLen,
- byte[] output, int outputOffset)
- throws ShortBufferException
- {
- return engineUpdate(input, inputOffset, inputLen, output, outputOffset);
- }
-}
diff --git a/libjava/javax/crypto/SealedObject.java b/libjava/javax/crypto/SealedObject.java
deleted file mode 100644
index 0f28f3335e5..00000000000
--- a/libjava/javax/crypto/SealedObject.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/* SealedObject.java -- An encrypted Serializable object.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-import java.security.AlgorithmParameters;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-
-/**
- * This class allows any {@link java.io.Serializable} object to be
- * stored in an encrypted form.
- *
- * <p>When the sealed object is ready to be unsealed (and deserialized)
- * the caller may use either
- *
- * <ol>
- * <li>{@link #getObject(javax.crypto.Cipher)}, which uses an
- * already-initialized {@link javax.crypto.Cipher}.<br>
- * <br>
- * or,</li>
- *
- * <li>{@link #getObject(java.security.Key)} or {@link
- * #getObject(java.security.Key,java.lang.String)}, which will
- * initialize a new cipher instance with the {@link #encodedParams} that
- * were stored with this sealed object (this is so parameters, such as
- * the IV, don't need to be known by the one unsealing the object).</li>
- * </ol>
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public class SealedObject implements Serializable
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** The encoded algorithm parameters. */
- protected byte[] encodedParams;
-
- /** The serialized, encrypted object. */
- private byte[] encryptedContent;
-
- /** The algorithm used to seal the object. */
- private String sealAlg;
-
- /** The parameter type. */
- private String paramsAlg;
-
- /** The cipher that decrypts when this object is unsealed. */
- private transient Cipher sealCipher;
-
- /** Compatible with JDK1.4. */
- private static final long serialVersionUID = 4482838265551344752L;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new sealed object from a {@link java.io.Serializable}
- * object and a cipher.
- *
- * @param object The object to seal.
- * @param cipher The cipher to encrypt with.
- * @throws java.io.IOException If serializing the object fails.
- * @throws javax.crypto.IllegalBlockSizeException If the cipher has no
- * padding and the size of the serialized representation of the
- * object is not a multiple of the cipher's block size.
- */
- public SealedObject(Serializable object, Cipher cipher)
- throws IOException, IllegalBlockSizeException
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(object);
- oos.flush();
- try
- {
- encryptedContent = cipher.doFinal(baos.toByteArray());
- }
- catch (IllegalStateException ise)
- {
- throw new IOException("cipher not in proper state");
- }
- catch (BadPaddingException bpe)
- {
- throw new IOException(
- "encrypting but got javax.crypto.BadPaddingException");
- }
- sealAlg = cipher.getAlgorithm();
- encodedParams = cipher.getParameters().getEncoded();
- paramsAlg = cipher.getParameters().getAlgorithm();
- }
-
- /**
- * Create a new sealed object from another sealed object.
- *
- * @param so The other sealed object.
- */
- protected SealedObject(SealedObject so)
- {
- this.encodedParams = (byte[]) so.encodedParams.clone();
- this.encryptedContent = (byte[]) so.encryptedContent.clone();
- this.sealAlg = so.sealAlg;
- this.paramsAlg = so.paramsAlg;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get the name of the algorithm used to seal this object.
- *
- * @return The algorithm's name.
- */
- public final String getAlgorithm()
- {
- return sealAlg;
- }
-
- /**
- * Unseal and deserialize this sealed object with a specified (already
- * initialized) cipher.
- *
- * @param cipher The cipher to decrypt with.
- * @return The original object.
- * @throws java.io.IOException If reading fails.
- * @throws java.lang.ClassNotFoundException If deserialization fails.
- * @throws javax.crypto.IllegalBlockSizeException If the cipher has no
- * padding and the encrypted data is not a multiple of the
- * cipher's block size.
- * @throws javax.crypto.BadPaddingException If the padding bytes are
- * incorrect.
- */
- public final Object getObject(Cipher cipher)
- throws IOException, ClassNotFoundException, IllegalBlockSizeException,
- BadPaddingException
- {
- sealCipher = cipher;
- return unseal();
- }
-
- /**
- * Unseal and deserialize this sealed object with the specified key.
- *
- * @param key The key to decrypt with.
- * @return The original object.
- * @throws java.io.IOException If reading fails.
- * @throws java.lang.ClassNotFoundException If deserialization fails.
- * @throws java.security.InvalidKeyException If the supplied key
- * cannot be used to unseal this object.
- * @throws java.security.NoSuchAlgorithmException If the algorithm
- * used to originally seal this object is not available.
- */
- public final Object getObject(Key key)
- throws IOException, ClassNotFoundException, InvalidKeyException,
- NoSuchAlgorithmException
- {
- try
- {
- if (sealCipher == null)
- sealCipher = Cipher.getInstance(sealAlg);
- }
- catch (NoSuchPaddingException nspe)
- {
- throw new NoSuchAlgorithmException(nspe.getMessage());
- }
- AlgorithmParameters params = null;
- if (encodedParams != null)
- {
- params = AlgorithmParameters.getInstance(paramsAlg);
- params.init(encodedParams);
- }
- try
- {
- sealCipher.init(Cipher.DECRYPT_MODE, key, params);
- return unseal();
- }
- catch (InvalidAlgorithmParameterException iape)
- {
- throw new IOException("bad parameters");
- }
- catch (IllegalBlockSizeException ibse)
- {
- throw new IOException("illegal block size");
- }
- catch (BadPaddingException bpe)
- {
- throw new IOException("bad padding");
- }
- }
-
- /**
- * Unseal and deserialize this sealed object with the specified key,
- * using a cipher from the named provider.
- *
- * @param key The key to decrypt with.
- * @param provider The name of the provider to use.
- * @return The original object.
- * @throws java.io.IOException If reading fails.
- * @throws java.lang.ClassNotFoundException If deserialization fails.
- * @throws java.security.InvalidKeyException If the supplied key
- * cannot be used to unseal this object.
- * @throws java.security.NoSuchAlgorithmException If the algorithm
- * used to originally seal this object is not available from
- * the named provider.
- * @throws java.security.NoSuchProviderException If the named provider
- * does not exist.
- */
- public final Object getObject(Key key, String provider)
- throws IOException, ClassNotFoundException, InvalidKeyException,
- NoSuchAlgorithmException, NoSuchProviderException
- {
- try
- {
- sealCipher = Cipher.getInstance(sealAlg, provider);
- }
- catch (NoSuchPaddingException nspe)
- {
- throw new NoSuchAlgorithmException(nspe.getMessage());
- }
- AlgorithmParameters params = null;
- if (encodedParams != null)
- {
- params = AlgorithmParameters.getInstance(paramsAlg, provider);
- params.init(encodedParams);
- }
- try
- {
- sealCipher.init(Cipher.DECRYPT_MODE, key, params);
- return unseal();
- }
- catch (InvalidAlgorithmParameterException iape)
- {
- throw new IOException("bad parameters");
- }
- catch (IllegalBlockSizeException ibse)
- {
- throw new IOException("illegal block size");
- }
- catch (BadPaddingException bpe)
- {
- throw new IOException("bad padding");
- }
- }
-
- // Own methods.
- // ------------------------------------------------------------------------
-
- /**
- * Deserialize this object.
- *
- * @param ois The input stream.
- * @throws java.io.IOException If reading fails.
- * @throws java.lang.ClassNotFoundException If reading fails.
- */
- private void readObject(ObjectInputStream ois)
- throws IOException, ClassNotFoundException
- {
- encodedParams = (byte[]) ois.readObject();
- encryptedContent = (byte[]) ois.readObject();
- sealAlg = (String) ois.readObject();
- paramsAlg = (String) ois.readObject();
- }
-
- /**
- * Serialize this object.
- *
- * @param oos The output stream.
- * @throws java.io.IOException If writing fails.
- */
- private void writeObject(ObjectOutputStream oos)
- throws IOException
- {
- oos.writeObject(encodedParams);
- oos.writeObject(encryptedContent);
- oos.writeObject(sealAlg);
- oos.writeObject(paramsAlg);
- }
-
- /**
- * Unseal this object, returning it.
- *
- * @return The unsealed, deserialized Object.
- * @throws java.io.IOException If reading fails.
- * @throws java.io.ClassNotFoundException If reading fails.
- * @throws javax.crypto.IllegalBlockSizeException If the cipher has no
- * padding and the encrypted data is not a multiple of the
- * cipher's block size.
- * @throws javax.crypto.BadPaddingException If the padding bytes are
- * incorrect.
- */
- private Object unseal()
- throws IOException, ClassNotFoundException, IllegalBlockSizeException,
- BadPaddingException
- {
- ByteArrayInputStream bais = null;
- try
- {
- bais = new ByteArrayInputStream(sealCipher.doFinal(encryptedContent));
- }
- catch (IllegalStateException ise)
- {
- throw new IOException("cipher not initialized");
- }
- ObjectInputStream ois = new ObjectInputStream(bais);
- return ois.readObject();
- }
-}
diff --git a/libjava/javax/crypto/SecretKey.java b/libjava/javax/crypto/SecretKey.java
deleted file mode 100644
index 5f95a1a0f9a..00000000000
--- a/libjava/javax/crypto/SecretKey.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* SecretKey.java -- A key for symmetric cryptography.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.Key;
-
-/**
- * A secret key for symmetric cryptography.
- *
- * <p>This interface defines no new methods over {@link
- * java.security.Key}, but rather is intended to be a <i>marker
- * interface</i> and to provide type safety for secret keys.</p>
- *
- * <p>The format of secret keys should be <code>RAW</code>, as returned
- * by {@link java.security.Key#getFormat()}.</p>
- *
- * <p>Concrete implementations of this interface should override the
- * {@link java.lang.Object#equals} and {@link java.lang.Object#hashCode}
- * methods of {@link java.lang.Object} to use the actual key data rather
- * than the identity-based default methods.</p>
- *
- * @author Casey Marshall (csm@gnu.org)
- * @see javax.crypto.SecretKeyFactory
- * @see javax.crypto.Cipher
- */
-public interface SecretKey extends Key
-{
- long serialVersionUID = -4795878709595146952L;
-}
diff --git a/libjava/javax/crypto/SecretKeyFactory.java b/libjava/javax/crypto/SecretKeyFactory.java
deleted file mode 100644
index 0a63ef06745..00000000000
--- a/libjava/javax/crypto/SecretKeyFactory.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/* SecretKeyFactory.java -- Factory for creating secret keys.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import gnu.java.security.Engine;
-
-import java.lang.reflect.InvocationTargetException;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.Security;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-
-/**
- * A secret key factory translates {@link SecretKey} objects to and from
- * {@link java.security.spec.KeySpec} objects, and can translate between
- * different vendors' representations of {@link SecretKey} objects (for
- * security or semantics; whichever applies).
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see SecretKey
- */
-public class SecretKeyFactory
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- private static final String SERVICE = "SecretKeyFactory";
-
- /** The underlying factory implementation. */
- private SecretKeyFactorySpi skfSpi;
-
- /** The provider of the implementation. */
- private Provider provider;
-
- /** The name of the algorithm. */
- private String algorithm;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new secret key factory.
- *
- * @param skfSpi The underlying factory implementation.
- * @param provider The provider.
- * @param algorithm The algorithm name.
- */
- protected SecretKeyFactory(SecretKeyFactorySpi skfSpi, Provider provider,
- String algorithm)
- {
- this.skfSpi = skfSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new secret key factory from the first appropriate
- * instance.
- *
- * @param algorithm The algorithm name.
- * @return The appropriate key factory, if found.
- * @throws java.security.NoSuchAlgorithmException If no provider
- * implements the specified algorithm.
- */
- public static final SecretKeyFactory getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] provs = Security.getProviders();
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- }
- }
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Create a new secret key factory from the named provider.
- *
- * @param algorithm The algorithm name.
- * @param provider The provider name.
- * @return The appropriate key factory, if found.
- * @throws java.security.NoSuchAlgorithmException If the named
- * provider does not implement the algorithm.
- * @throws java.security.NoSuchProviderException If the named provider
- * does not exist.
- */
- public static final SecretKeyFactory getInstance(String algorithm,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- Provider p = Security.getProvider(provider);
- if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
- return getInstance(algorithm, p);
- }
-
- /**
- * Create a new secret key factory from the specified provider.
- *
- * @param algorithm The algorithm name.
- * @param provider The provider.
- * @return The appropriate key factory, if found.
- * @throws java.security.NoSuchAlgorithmException If the provider
- * does not implement the algorithm.
- */
- public static final SecretKeyFactory getInstance(String algorithm,
- Provider provider)
- throws NoSuchAlgorithmException
- {
- try
- {
- return new SecretKeyFactory((SecretKeyFactorySpi)
- Engine.getInstance(SERVICE, algorithm, provider),
- provider, algorithm);
- }
- catch (InvocationTargetException ite)
- {
- if (ite.getCause() == null)
- throw new NoSuchAlgorithmException(algorithm);
- if (ite.getCause() instanceof NoSuchAlgorithmException)
- throw (NoSuchAlgorithmException) ite.getCause();
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Generate a secret key from a key specification, if possible.
- *
- * @param keySpec The key specification.
- * @return The secret key.
- * @throws java.security.InvalidKeySpecException If the key specification
- * cannot be transformed into a secret key.
- */
- public final SecretKey generateSecret(KeySpec keySpec)
- throws InvalidKeySpecException
- {
- return skfSpi.engineGenerateSecret(keySpec);
- }
-
- /**
- * Get the algorithm name.
- *
- * @return The algorithm name.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Get the key specification from a secret key.
- *
- * @param key The secret key.
- * @param keySpec The target key specification class.
- * @return The key specification.
- * @throws java.security.spec.InvalidKeySpecException If the secret key cannot
- * be transformed into the specified key specification.
- */
- public final KeySpec getKeySpec(SecretKey key, Class keySpec)
- throws InvalidKeySpecException
- {
- return skfSpi.engineGetKeySpec(key, keySpec);
- }
-
- /**
- * Get the provider of this implementation.
- *
- * @return The provider.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Translate a secret key into another form.
- *
- * @param key The key to translate.
- * @return The translated key.
- * @throws java.security.InvalidKeyException If the argument cannot be
- * translated.
- */
- public final SecretKey translateKey(SecretKey key)
- throws InvalidKeyException
- {
- return skfSpi.engineTranslateKey(key);
- }
-}
diff --git a/libjava/javax/crypto/SecretKeyFactorySpi.java b/libjava/javax/crypto/SecretKeyFactorySpi.java
deleted file mode 100644
index 6c9a3ca299f..00000000000
--- a/libjava/javax/crypto/SecretKeyFactorySpi.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/* SecretKeyFactorySpi.java -- Secret key factory service provider interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.InvalidKeyException;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-
-/**
- * The <i>Service Provider Interface</i> (<b>SPI</b>) for the {@link
- * SecretKeyFactory} class.
- *
- * <p>Providers wishing to implement a secret key factory must
- * subclass this and provide an appropriate implementation for all the
- * abstract methods below, and provide an appropriate entry in the
- * master {@link java.security.Provider} class (the service name for
- * secret key factories is <code>"SecretKeyFactory"</code>).
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see SecretKeyFactory
- */
-public abstract class SecretKeyFactorySpi
-{
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new secret key factory SPI.
- */
- public SecretKeyFactorySpi()
- {
- }
-
- // Abstract instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Translate a {@link java.security.KeySpec} into a {@link SecretKey}.
- *
- * @param keySpec The key specification.
- * @return The secret key.
- * @throws java.security.spec.InvalidKeySpecException If the key specification
- * cannot be translated into a secret key.
- */
- protected abstract SecretKey engineGenerateSecret(KeySpec keySpec)
- throws InvalidKeySpecException;
-
- /**
- * Translate a {@link SecretKey} into a {@link java.security.KeySpec}.
- *
- * @param key The secret key.
- * @param keySpec The desired key specification class.
- * @return The key specification.
- * @throws java.security.spec.InvalidKeySpecException If the secret key cannot
- * be translated into the desired key specification.
- */
- protected abstract KeySpec engineGetKeySpec(SecretKey key, Class keySpec)
- throws InvalidKeySpecException;
-
- /**
- * Translate a secret key into a different representation.
- *
- * @param key The secret key to translate.
- * @return The translated key.
- * @throws java.security.InvalidKeyException If the specified secret
- * key cannot be translated.
- */
- protected abstract SecretKey engineTranslateKey(SecretKey key)
- throws InvalidKeyException;
-}
diff --git a/libjava/javax/crypto/ShortBufferException.java b/libjava/javax/crypto/ShortBufferException.java
deleted file mode 100644
index 98d2101c38f..00000000000
--- a/libjava/javax/crypto/ShortBufferException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ShortBufferException.java -- Signals a short output buffer.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto;
-
-import java.security.GeneralSecurityException;
-
-/**
- * This exception is thrown on an attempt to transform bytes into a
- * buffer that is too short to contain the data.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class ShortBufferException extends GeneralSecurityException
-{
-
- // Constant.
- // ------------------------------------------------------------------------
-
- /** Serialization constant. */
- private static final long serialVersionUID = 8427718640832943747L;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- public ShortBufferException()
- {
- super();
- }
-
- public ShortBufferException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/crypto/interfaces/DHKey.java b/libjava/javax/crypto/interfaces/DHKey.java
deleted file mode 100644
index 0c3ec97e048..00000000000
--- a/libjava/javax/crypto/interfaces/DHKey.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* DHKey.java -- General interface for a Diffie-Hellman key.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.interfaces;
-
-import javax.crypto.spec.DHParameterSpec;
-
-/**
- * This interface marks public/private keys in the Diffie-Hellman key
- * exchange algorithm. Implementations of Diffie-Hellman keys should
- * implement this interface, and applications can safely cast keys that
- * are known to be Diffie-Hellman keys to this interface.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public interface DHKey
-{
- /**
- * Returns the Diffie-Hellman parameters for this key, which includes
- * the generator and the prime.
- *
- * @return The Diffie-Hellman parameters.
- */
- DHParameterSpec getParams();
-}
diff --git a/libjava/javax/crypto/interfaces/DHPrivateKey.java b/libjava/javax/crypto/interfaces/DHPrivateKey.java
deleted file mode 100644
index 12077bad20b..00000000000
--- a/libjava/javax/crypto/interfaces/DHPrivateKey.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DHPrivateKey.java -- A Diffie-Hellman private key.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.interfaces;
-
-import java.math.BigInteger;
-import java.security.PrivateKey;
-
-/**
- * This interface marks a private key in the Diffie-Hellman key exchange
- * algorithm. It should be treated with as much care as any {@link
- * java.security.PrivateKey}.
- *
- * <p>Implementations of Diffie-Hellman private keys should implement
- * this interface. Applications that know a particular key is a
- * Diffie-Hellman private key can safely cast it to this interface.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see DHKey
- * @see DHPublicKey
- */
-public interface DHPrivateKey extends DHKey, PrivateKey
-{
- /** Compatible with JDK1.4. */
- long serialVersionUID = 2211791113380396553L;
-
- /**
- * Returns the private value <i>x</i>.
- *
- * @return The private value <i>x</i>.
- */
- BigInteger getX();
-}
diff --git a/libjava/javax/crypto/interfaces/DHPublicKey.java b/libjava/javax/crypto/interfaces/DHPublicKey.java
deleted file mode 100644
index d0519d4dbfc..00000000000
--- a/libjava/javax/crypto/interfaces/DHPublicKey.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* DHPublicKey.java -- A Diffie-Hellman public key.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.interfaces;
-
-import java.math.BigInteger;
-import java.security.PublicKey;
-
-/**
- * This interface marks a public key in the Diffie-Hellman key-exchange
- * algorithm.
- *
- * <p>Implementations of Diffie-Hellman public keys should implement
- * this interface. Applications that know that a particular key is a
- * Diffie-Hellman public key it can be safely cast to this interface.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see DHKey
- * @see DHPrivateKey
- */
-public interface DHPublicKey extends DHKey, PublicKey
-{
- /** Compatible with JDK1.4. */
- long serialVersionUID = -6628103563352519193L;
-
- /**
- * Get the public value <i>y</i>.
- *
- * @return The public value <i>y</i>.
- */
- BigInteger getY();
-}
diff --git a/libjava/javax/crypto/interfaces/PBEKey.java b/libjava/javax/crypto/interfaces/PBEKey.java
deleted file mode 100644
index df7f2e2b277..00000000000
--- a/libjava/javax/crypto/interfaces/PBEKey.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* PBEKey.java -- A key derived from a password.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.interfaces;
-
-import javax.crypto.SecretKey;
-
-/**
- * Interface to a password-derived key for password-based encryption
- * (PBE). Applications working with a {@link javax.crypto.SecretKey}
- * that is known to be a password-based key can safely cast such keys to
- * this interface.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public interface PBEKey extends SecretKey
-{
- /** Compatible with JDK1.4. */
- long serialVersionUID = -1430015993304333921L;
-
- /**
- * Retruns the iteration count, or 0 if not specified.
- *
- * @return The iteration count.
- */
- int getIterationCount();
-
- /**
- * Returns a copy of the password as a character array. It is the
- * caller's responsibility to zero-out the password when it is no
- * longer in use.
- *
- * <p>Although it is not specified in the documentation,
- * implementations should not copy or clone the password array, but
- * rather return the reference to the array itself, so the caller has
- * the ability to erase the password.
- *
- * @return The password.
- */
- char[] getPassword();
-
- /**
- * Returns a copy of the salt. It is the caller's responsibility to
- * zero-out the salt when it is no longer in use.
- *
- * <p>Although it is not specified in the documentation,
- * implementations should not copy or clone the salt array, but
- * rather return the reference to the array itself, so the caller has
- * the ability to erase the salt.
- *
- * @return The salt.
- */
- byte[] getSalt();
-}
diff --git a/libjava/javax/crypto/spec/DESKeySpec.java b/libjava/javax/crypto/spec/DESKeySpec.java
deleted file mode 100644
index 9075a77d248..00000000000
--- a/libjava/javax/crypto/spec/DESKeySpec.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/* DESKeySpec -- Keys for DES.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.security.InvalidKeyException;
-import java.security.spec.KeySpec;
-
-/**
- * This class is a transparent wrapper for DES keys, which are arrays
- * of 8 bytes.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public class DESKeySpec implements KeySpec
-{
-
- // Constants.
- // ------------------------------------------------------------------------
-
- /**
- * The length of a DES key, in bytes.
- */
- public static final int DES_KEY_LEN = 8;
-
- /**
- * The key bytes.
- */
- private byte[] key;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new DES key spec, copying the first 8 bytes from the
- * byte array.
- *
- * @param key The key bytes.
- * @throws java.security.InvalidKeyException If there are less than 8
- * bytes in the array.
- */
- public DESKeySpec(byte[] key) throws InvalidKeyException
- {
- this(key, 0);
- }
-
- /**
- * Create a new DES key spec, starting at <code>offset</code> in
- * the byte array. The first 8 bytes starting at <code>offset</code>
- * are copied.
- *
- * @param key The key bytes.
- * @param offset The offset into the byte array at which to begin.
- * @throws java.security.InvalidKeyException If there are less than 8
- * bytes starting at <code>offset</code>.
- */
- public DESKeySpec(byte[] key, int offset) throws InvalidKeyException
- {
- if (key.length - offset < DES_KEY_LEN)
- {
- throw new InvalidKeyException("DES keys must be 8 bytes long");
- }
- this.key = new byte[DES_KEY_LEN];
- System.arraycopy(key, offset, this.key, 0, DES_KEY_LEN);
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns whether or not the given key is <i>parity adjusted</i>;
- * i.e. every byte in the key has an odd number of "1" bits.
- *
- * @param key The key bytes, considered between <code>[offset,
- * offset+7]</code>
- * @param offset The offset into the byte array at which to begin.
- * @return True if all bytes have an odd number of "1" bits.
- * @throws java.security.InvalidKeyException If there are not enough
- * bytes in the array.
- */
- public static boolean isParityAdjusted(byte[] key, int offset)
- throws InvalidKeyException
- {
- if (key.length - offset < DES_KEY_LEN)
- {
- throw new InvalidKeyException("DES keys must be 8 bytes long");
- }
- boolean parity = false;
- boolean oddbits = false;
- for (int i = 0; i < DES_KEY_LEN; i++)
- {
- oddbits = false;
- for (int j = 0; j < 8; j++)
- {
- oddbits ^= (key[i+offset] & 1 << j) != 0;
- }
- parity &= oddbits;
- }
- return parity;
- }
-
- /**
- * One-half of the weak and semiweak DES keys (the other half are the
- * complements of these).
- */
- private static final byte[][] WEAK_KEYS = new byte[][] {
- { 0, 0, 0, 0, 0, 0, 0, 0 }, // 0000 0000 0000 0000
- { -1, -1, -1, -1, 0, 0, 0, 0 }, // ffff ffff 0000 0000
- { 1, 1, 1, 1, 1, 1, 1, 1 }, // 0101 0101 0101 0101
- { 31, 31, 31, 31, 14, 14, 14, 14 }, // 1f1f 1f1f 0e0e 0e0e
- { 1, -2, 1, -2, 1, -2, 1, -2 }, // 01fe 01fe 01fe 01fe
- { 31, -32, 31, -32, -32, 31, -32, 31 }, // 1fe0 1fe0 0e1f 0e1f
- { 1, -32, 1, -32, 1, -15, 1, -15 }, // 01e0 01e0 01f1 01f1
- { 31, -2, 31, -2, 14, -2, 14, -2 }, // 1ffe 1ffe 0efe 0efe
- { 1, 31, 1, 31, 1, 14, 1, 14 }, // 011f 011f 010e 010e
- { -32, -2, -32, -2, -15, -2, -15, -2 }, // e0fe e0fe f1fe f1fe
- };
-
- /**
- * Tests if the bytes between <code>[offset, offset+7]</code>
- * constitute a weak or semi-weak DES key.
- *
- * @param key The key bytes to check.
- * @param offset The offset in the byte array to start.
- * @return true If the key bytes are a weak key.
- */
- public static boolean isWeak(byte[] key, int offset)
- throws InvalidKeyException
- {
- if (key.length - offset < DES_KEY_LEN)
- {
- throw new InvalidKeyException("DES keys must be 8 bytes long");
- }
- for (int i = 0; i < WEAK_KEYS.length; i++)
- {
- if (equalsOrComplementEquals(key, offset, WEAK_KEYS[i]))
- {
- return true;
- }
- }
- return false;
- }
-
- /**
- * This method returns true if the first 8 bytes starting at
- * <code>off</code> in <code>a</code> equal the first 8 bytes in
- * <code>b</code>, or equal the <i>complement</i> of the first 8 bytes
- * in <code>b</code>.
- *
- * @param a The first byte array.
- * @param off The index into the first byte array.
- * @param b The second byte array.
- * @return <code>a == b || a == ~b</code>
- */
- private static boolean equalsOrComplementEquals(byte[] a, int off, byte[] b)
- {
- boolean result = true;
- for (int i = 0; i < DES_KEY_LEN; i++)
- {
- result &= a[off+i] == b[i];
- }
- if (result) return true;
- result = true;
- for (int i = 0; i < DES_KEY_LEN; i++)
- {
- result &= a[off+i] == (~b[i]);
- }
- return result;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return the key as a byte array. This method does not copy the byte
- * array.
- *
- * @return The key bytes.
- */
- public byte[] getKey()
- {
- return key;
- }
-}
diff --git a/libjava/javax/crypto/spec/DESedeKeySpec.java b/libjava/javax/crypto/spec/DESedeKeySpec.java
deleted file mode 100644
index 1f6a25026bb..00000000000
--- a/libjava/javax/crypto/spec/DESedeKeySpec.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/* DESedeKeySpec.java -- Keys for triple-DES.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.security.InvalidKeyException;
-import java.security.spec.KeySpec;
-
-/**
- * This class is a transparent wrapper for DES-EDE (Triple-DES) keys,
- * which are arrays of 24 bytes.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public class DESedeKeySpec implements KeySpec
-{
-
- // Constants.
- // ------------------------------------------------------------------------
-
- /**
- * The length of a triple-DES key, in bytes.
- */
- public static final int DES_EDE_KEY_LEN = 24;
-
- /**
- * The key bytes.
- */
- private byte[] key;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new DES-EDE key spec, copying the first 24 bytes from the
- * byte array.
- *
- * @param key The key bytes.
- * @throws java.security.InvalidKeyException If there are less than 24
- * bytes in the array.
- */
- public DESedeKeySpec(byte[] key) throws InvalidKeyException
- {
- this(key, 0);
- }
-
- /**
- * Create a new DES-EDE key spec, starting at <code>offset</code> in
- * the byte array. The first 24 bytes starting at <code>offset</code>
- * are copied.
- *
- * @param key The key bytes.
- * @param offset The offset into the byte array at which to begin.
- * @throws java.security.InvalidKeyException If there are less than 24
- * bytes starting at <code>offset</code>.
- */
- public DESedeKeySpec(byte[] key, int offset) throws InvalidKeyException
- {
- if (key.length - offset < DES_EDE_KEY_LEN)
- {
- throw new InvalidKeyException("DES-EDE keys must be 24 bytes long");
- }
- this.key = new byte[DES_EDE_KEY_LEN];
- System.arraycopy(key, offset, this.key, 0, DES_EDE_KEY_LEN);
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns whether or not the given key is <i>parity adjusted</i>;
- * i.e. every byte in the key has an odd number of "1" bits.
- *
- * @param key The key bytes, considered between <code>[offset,
- * offset+23]</code>
- * @param offset The offset into the byte array at which to begin.
- * @return True if all bytes have an odd number of "1" bits.
- * @throws java.security.InvalidKeyException If there are not enough
- * bytes in the array.
- */
- public static boolean isParityAdjusted(byte[] key, int offset)
- throws InvalidKeyException
- {
- if (key.length - offset < DES_EDE_KEY_LEN)
- {
- throw new InvalidKeyException("DES-EDE keys must be 24 bytes long");
- }
- boolean parity = false;
- boolean oddbits = false;
- for (int i = 0; i < DES_EDE_KEY_LEN; i++)
- {
- oddbits = false;
- for (int j = 0; j < 8; j++)
- {
- oddbits ^= (key[i+offset] & 1 << j) != 0;
- }
- parity &= oddbits;
- }
- return parity;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return the key as a byte array. This method does not copy the byte
- * array.
- *
- * @return The key bytes.
- */
- public byte[] getKey()
- {
- return key;
- }
-}
diff --git a/libjava/javax/crypto/spec/DHGenParameterSpec.java b/libjava/javax/crypto/spec/DHGenParameterSpec.java
deleted file mode 100644
index 0fc8ed58e22..00000000000
--- a/libjava/javax/crypto/spec/DHGenParameterSpec.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* DHGenParameterSpec.java -- Diffie-Hellman parameter generator spec.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * This class represents the parameters needed for generating
- * Diffie-Hellman parameters.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see DHParameterSpec
- */
-public class DHGenParameterSpec implements AlgorithmParameterSpec
-{
-
- // Variables.
- // ------------------------------------------------------------------------
-
- /** The length of the prime, in bits. */
- private int primeSize;
-
- /** The length of the exponent, in bits. */
- private int exponentSize;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new Diffie-Hellman parameter generator spec.
- *
- * @param primeSize The size of the prime, in bits.
- * @param exponentSize The size of the exponent, in bits.
- */
- public DHGenParameterSpec(int primeSize, int exponentSize)
- {
- this.primeSize = primeSize;
- this.exponentSize = exponentSize;
- }
-
- // Intance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get the size of the exponent, in bits.
- *
- * @return The exponent size.
- */
- public int getExponentSize()
- {
- return exponentSize;
- }
-
- /**
- * Get the size of the prime, in bits.
- *
- * @return The prime size.
- */
- public int getPrimeSize()
- {
- return primeSize;
- }
-}
diff --git a/libjava/javax/crypto/spec/DHParameterSpec.java b/libjava/javax/crypto/spec/DHParameterSpec.java
deleted file mode 100644
index 4db82870f1c..00000000000
--- a/libjava/javax/crypto/spec/DHParameterSpec.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/* DHParameterSpec.java -- Parameters for Diffie-Hellman keys.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.math.BigInteger;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * The base set of parameters necessary to perform Diffie-Hellman key
- * exchange. Each party in the key exchange shares these parameters.
- *
- * <p>Each set of parameters consists of a <i>base generator</i>
- * <code>g</code>, a <i>prime modulus</i> <code>p</code>, and an
- * optional length, in bits, of the private exponent.
- *
- * <p>See <a href="http://www.rsasecurity.com/rsalabs/pkcs/pkcs-3/">PKCS
- * #3 - Diffie-Hellman Key Agreement Standard</a> for more information.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see javax.crypto.KeyAgreement
- */
-public class DHParameterSpec implements AlgorithmParameterSpec
-{
-
- // Variables.
- // ------------------------------------------------------------------------
-
- /** The base generator g. */
- private BigInteger g;
-
- /** The prime modulus p. */
- private BigInteger p;
-
- /** The length, in bits, of the private exponent. */
- private int l;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new set of Diffie-Hellman parameters.
- *
- * @param p The prime modulus.
- * @param g The base generator.
- */
- public DHParameterSpec(BigInteger p, BigInteger g)
- {
- this(p, g, 0);
- }
-
- /**
- * Create a new set of Diffie-Hellman parameters.
- *
- * @param p The prime modulus.
- * @param g The base generator.
- * @param l The size of the private exponent, in bits.
- */
- public DHParameterSpec(BigInteger p, BigInteger g, int l)
- {
- this.p = p;
- this.g = g;
- this.l = l;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get the base generator, <i>g</i>.
- *
- * @return The base generator <i>g</i>.
- */
- public BigInteger getG()
- {
- return g;
- }
-
- /**
- * Get the length of the private exponent, in bits.
- *
- * @return The length of the private exponent, in bits, or 0 if this
- * has not been explicitly set.
- */
- public int getL()
- {
- return l;
- }
-
- /**
- * Get the prime modulus, <i>p</i>.
- *
- * @return The prime modulus, <i>p</i>.
- */
- public BigInteger getP()
- {
- return p;
- }
-}
diff --git a/libjava/javax/crypto/spec/DHPrivateKeySpec.java b/libjava/javax/crypto/spec/DHPrivateKeySpec.java
deleted file mode 100644
index 348a1926409..00000000000
--- a/libjava/javax/crypto/spec/DHPrivateKeySpec.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* DHPrivateKeySpec.java -- Wrapper for Diffie-Hellman private keys.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.math.BigInteger;
-import java.security.spec.KeySpec;
-
-/**
- * A wrapper for Diffie-Hellman private key data.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see DHPublicKeySpec
- */
-public class DHPrivateKeySpec implements KeySpec
-{
-
- // Variables.
- // ------------------------------------------------------------------------
-
- /** The base generator. */
- private BigInteger g;
-
- /** The prime modulus. */
- private BigInteger p;
-
- /** The private exponent. */
- private BigInteger x;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new Diffie-Hellman private key spec.
- *
- * @param x The private exponent.
- * @param p The prime modulus.
- * @param g The base generator.
- */
- public DHPrivateKeySpec(BigInteger x, BigInteger p, BigInteger g)
- {
- this.x = x;
- this.p = p;
- this.g = g;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get the base generator.
- *
- * @return The base generator.
- */
- public BigInteger getG()
- {
- return g;
- }
-
- /**
- * Get the prime modulus.
- *
- * @return The prime modulus.
- */
- public BigInteger getP()
- {
- return p;
- }
-
- /**
- * Get the private exponent.
- *
- * @return The private exponent.
- */
- public BigInteger getX()
- {
- return x;
- }
-}
diff --git a/libjava/javax/crypto/spec/DHPublicKeySpec.java b/libjava/javax/crypto/spec/DHPublicKeySpec.java
deleted file mode 100644
index e8187278548..00000000000
--- a/libjava/javax/crypto/spec/DHPublicKeySpec.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* DHPublicKeySpec.java -- Wrapper for Diffie-Hellman public keys.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.math.BigInteger;
-import java.security.spec.KeySpec;
-
-/**
- * A wrapper for Diffie-Hellman public key data.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see DHPrivateKeySpec
- */
-public class DHPublicKeySpec implements KeySpec
-{
-
- // Variables.
- // ------------------------------------------------------------------------
-
- /** The base generator. */
- private BigInteger g;
-
- /** The prime modulus. */
- private BigInteger p;
-
- /** The public value. */
- private BigInteger y;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new Diffie-Hellman public key spec.
- *
- * @param y The public value.
- * @param p The prime modulus.
- * @param g The base generator.
- */
- public DHPublicKeySpec(BigInteger y, BigInteger p, BigInteger g)
- {
- this.y = y;
- this.p = p;
- this.g = g;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get the base generator.
- *
- * @return The base generator.
- */
- public BigInteger getG()
- {
- return g;
- }
-
- /**
- * Get the prime modulus.
- *
- * @return The prime modulus.
- */
- public BigInteger getP()
- {
- return p;
- }
-
- /**
- * Get the public value.
- *
- * @return The public value.
- */
- public BigInteger getY()
- {
- return y;
- }
-}
diff --git a/libjava/javax/crypto/spec/IvParameterSpec.java b/libjava/javax/crypto/spec/IvParameterSpec.java
deleted file mode 100644
index 3af38f58ee8..00000000000
--- a/libjava/javax/crypto/spec/IvParameterSpec.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* IvParameterSpec.java -- A simple wrapper for initialization vectors.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * A wrapper for an initialization vector. An initialization vector is
- * necessary for any cipher in any <i>feedback mode</i>, e.g. CBC.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public class IvParameterSpec implements AlgorithmParameterSpec
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The IV. */
- private byte[] iv;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new initialization vector spec from an entire byte array.
- *
- * @param iv The IV bytes.
- */
- public IvParameterSpec(byte[] iv)
- {
- this(iv, 0, iv.length);
- }
-
- /**
- * Create a new initialization vector spec from part of a byte array.
- *
- * @param iv The IV bytes.
- * @param off The offset into the IV bytes.
- * @param len The number of IV bytes.
- */
- public IvParameterSpec(byte[] iv, int off, int len)
- {
- this.iv = new byte[len];
- System.arraycopy(iv, off, this.iv, 0, len);
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the IV. This method does not copy the byte array.
- *
- * @return The IV.
- */
- public byte[] getIV()
- {
- return iv;
- }
-}
diff --git a/libjava/javax/crypto/spec/PBEKeySpec.java b/libjava/javax/crypto/spec/PBEKeySpec.java
deleted file mode 100644
index d17dc41eef7..00000000000
--- a/libjava/javax/crypto/spec/PBEKeySpec.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/* PBEKeySpec.java -- Wrapper for password-based keys.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.security.spec.KeySpec;
-
-/**
- * A wrapper for a password-based key, used for password-based
- * encryption (PBE).
- *
- * <p>Examples of password-based encryption algorithms include:
- *
- * <ul>
- * <li><a href="http://www.rsasecurity.com/rsalabs/pkcs/pkcs-5/">PKCS #5
- * - Password-Based Cryptography Standard</a></li>
- * <li><a href="http://www.rsasecurity.com/rsalabs/pkcs/pkcs-12/">PKCS
- * #12 - Personal Information Exchange Syntax Standard</a></li>
- * </ul>
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- * @see javax.crypto.SecretKeyFactory
- * @see PBEParameterSpec
- */
-public class PBEKeySpec implements KeySpec
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The iteration count. */
- private int iterationCount;
-
- /** The generated key length. */
- private int keyLength;
-
- /** The password. */
- private char[] password;
-
- /** The salt. */
- private byte[] salt;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new PBE key spec with just a password.
- *
- * @param password The password char array.
- */
- public PBEKeySpec(char[] password)
- {
- this(password, null, 0, 0);
- }
-
- /**
- * Create a PBE key spec with a password, salt, and iteration count.
- *
- * @param password The password char array.
- * @param salt The salt bytes.
- * @param iterationCount The iteration count.
- */
- public PBEKeySpec(char[] password, byte[] salt, int iterationCount)
- {
- this(password, salt, iterationCount, 0);
- }
-
- /**
- * Create a PBE key spec with a password, salt, iteration count, and
- * key length.
- *
- * @param password The password char array.
- * @param salt The salt bytes.
- * @param iterationCount The iteration count.
- * @param keyLength The generated key length.
- */
- public PBEKeySpec(char[] password, byte[] salt, int iterationCount,
- int keyLength)
- {
- this.password = password;
- this.salt = salt;
- this.iterationCount = iterationCount;
- this.keyLength = keyLength;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Clear the password array by filling it with null characters.
- */
- public final void clearPassword()
- {
- if (password == null) return;
- for (int i = 0; i < password.length; i++)
- {
- password[i] = '\u0000';
- }
- }
-
- /**
- * Get the iteration count, or 0 if it has not been specified.
- *
- * @return The iteration count, or 0 if it has not been specified.
- */
- public final int getIterationCount()
- {
- return iterationCount;
- }
-
- /**
- * Get the generated key length, or 0 if it has not been specified.
- *
- * @return The key length, or 0 if it has not been specified.
- */
- public final int getKeyLength()
- {
- return keyLength;
- }
-
- /**
- * Get the password character array.
- *
- * @return The password.
- */
- public final char[] getPassword()
- {
- return password;
- }
-
- /**
- * Get the salt bytes.
- *
- * @return The salt.
- */
- public final byte[] getSalt()
- {
- return salt;
- }
-}
diff --git a/libjava/javax/crypto/spec/PBEParameterSpec.java b/libjava/javax/crypto/spec/PBEParameterSpec.java
deleted file mode 100644
index 322d9556c6a..00000000000
--- a/libjava/javax/crypto/spec/PBEParameterSpec.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* PBEParameterSpec.java -- A wrapper for PBE parameters.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * A wrapper for the parameters used in <a
- * href="http://www.rsasecurity.com/rsalabs/pkcs/pkcs-5/">PKCS #5 -
- * Password-Based Cryptography Standard</a>.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public class PBEParameterSpec implements AlgorithmParameterSpec
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The iteration count. */
- private int iterationCount;
-
- /** The salt. */
- private byte[] salt;
-
- // Constructor.
- // ------------------------------------------------------------------------
-
- /**
- * Creates a new password-based encryption parameter specification.
- *
- * @param salt The salt.
- * @param iterationCount The iteration count.
- */
- public PBEParameterSpec(byte[] salt, int iterationCount)
- {
- this.salt = salt;
- this.iterationCount = iterationCount;
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get the iteration count.
- *
- * @return The iteration count.
- */
- public int getIterationCount()
- {
- return iterationCount;
- }
-
- /**
- * Get the salt.
- *
- * @return The salt.
- */
- public byte[] getSalt()
- {
- return salt;
- }
-}
diff --git a/libjava/javax/crypto/spec/RC2ParameterSpec.java b/libjava/javax/crypto/spec/RC2ParameterSpec.java
deleted file mode 100644
index 33155b2b3e8..00000000000
--- a/libjava/javax/crypto/spec/RC2ParameterSpec.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/* RC2ParameterSpec.java -- Wrapper for RC2 parameters.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * A wrapper for parameters for the <a
- * href="http://www.rsasecurity.com/rsalabs/faq/3-6-2.html">RC2</a>
- * block cipher ("RC" means either "Rivest Cipher" or "Ron's Code",
- * depending upon who you ask and when).
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public class RC2ParameterSpec implements AlgorithmParameterSpec
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** The length of an RC2 IV, in bytes. */
- private static final int RC2_IV_LENGTH = 8;
-
- /** The effective key length, in bits. */
- private int effectiveKeyBits;
-
- /** The initialization vector. */
- private byte[] iv;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create RC2 parameters without an IV.
- *
- * @param effectiveKeyBits The number of effective key bits.
- */
- public RC2ParameterSpec(int effectiveKeyBits)
- {
- this.effectiveKeyBits = effectiveKeyBits;
- }
-
- /**
- * Create RC2 parameters with an IV.
- *
- * @param effectiveKeyBits The number of effective key bits.
- * @param iv The IV; the first eight bytes of this array
- * are used.
- */
- public RC2ParameterSpec(int effectiveKeyBits, byte[] iv)
- {
- this(effectiveKeyBits, iv, 0);
- }
-
- /**
- * Create RC2 parameters with an IV.
- *
- * @param effectiveKeyBits The number of effective key bits.
- * @param iv The IV; the first eight bytes of this array
- * after <code>offset</code> are used.
- * @param offset From whence to start in the array.
- */
- public RC2ParameterSpec(int effectiveKeyBits, byte[] iv, int offset)
- {
- if (iv.length - offset < RC2_IV_LENGTH)
- {
- throw new IllegalArgumentException("IV too short");
- }
- this.effectiveKeyBits = effectiveKeyBits;
- this.iv = new byte[RC2_IV_LENGTH];
- System.arraycopy(iv, offset, this.iv, 0, RC2_IV_LENGTH);
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Get the number of effective key bits.
- *
- * @return The numer of effective key bits.
- */
- public int getEffectiveKeyBits()
- {
- return effectiveKeyBits;
- }
-
- /**
- * Return the initialization vector, or <code>null</code> if none was
- * specified.
- *
- * @return The IV, or null.
- */
- public byte[] getIV()
- {
- return iv;
- }
-
- public boolean equals(Object o)
- {
- if (this == o) return true;
- byte[] oiv = ((RC2ParameterSpec) o).getIV();
- if (iv != oiv)
- {
- if (iv == null || oiv == null) return false;
- if (iv.length != oiv.length) return false;
- for (int i = 0; i < iv.length; i++)
- {
- if (iv[i] != oiv[i])
- {
- return false;
- }
- }
- }
- return effectiveKeyBits == ((RC2ParameterSpec) o).getEffectiveKeyBits();
- }
-
- public int hashCode()
- {
- int code = effectiveKeyBits;
- if (iv != null)
- {
- for (int i = 0; i < RC2_IV_LENGTH; i++)
- {
- code += iv[i];
- }
- }
- return code;
- }
-}
diff --git a/libjava/javax/crypto/spec/RC5ParameterSpec.java b/libjava/javax/crypto/spec/RC5ParameterSpec.java
deleted file mode 100644
index 8570c86b391..00000000000
--- a/libjava/javax/crypto/spec/RC5ParameterSpec.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/* RC5ParameterSpec.java -- parameters for RC5.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * A wrapper for parameters to the <a
- * href="http://www.rsasecurity.com/rsalabs/faq/3-6-4.html">RC5</a>
- * block cipher.
- *
- * @author Casey Marshall (csm@gnu.org)
- * @since 1.4
- */
-public class RC5ParameterSpec implements AlgorithmParameterSpec
-{
-
- // Fields.
- // ------------------------------------------------------------------------
-
- /** The IV. */
- private byte[] iv;
-
- /** The number of rounds. */
- private int rounds;
-
- /** The version number. */
- private int version;
-
- /** The word size, in bits. */
- private int wordSize;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create RC5 parameters without an IV.
- *
- * @param version The version number.
- * @param rounds The number of rounds.
- * @param wordSize The size of a word, in bits.
- */
- public RC5ParameterSpec(int version, int rounds, int wordSize)
- {
- this.version = version;
- this.rounds = rounds;
- this.wordSize = wordSize;
- }
-
- /**
- * Create RC5 parameters with an IV. The bytes in <code>iv</code> in
- * the range <code>[0, 2*(wordSize/8)-1]</code> are used.
- *
- * @param version The version number.
- * @param rounds The number of rounds.
- * @param wordSize The size of a word, in bits.
- * @param iv The IV data.
- */
- public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv)
- {
- this(version, rounds, wordSize, iv, 0);
- }
-
- /**
- * Create RC5 parameters with an IV. The bytes in <code>iv</code> in
- * the range <code>[off, off+2*(wordSize/8)-1]</code> are used.
- *
- * @param version The version number.
- * @param rounds The number of rounds.
- * @param wordSize The size of a word, in bits.
- * @param iv The IV data.
- * @param off From where in the array the IV starts.
- */
- public
- RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv, int off)
- {
- this(version, rounds, wordSize);
- int ivLength = 2 * (wordSize / 8);
- if (off < 0)
- throw new IllegalArgumentException();
- if (iv.length - off < ivLength)
- {
- throw new IllegalArgumentException("IV too short");
- }
- this.iv = new byte[ivLength];
- System.arraycopy(iv, off, this.iv, 0, ivLength);
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return the initializaiton vector, or <code>null</code> if none was
- * specified.
- *
- * @return The IV, or null.
- */
- public byte[] getIV()
- {
- return iv;
- }
-
- /**
- * Get the number of rounds.
- *
- * @return The number of rounds.
- */
- public int getRounds()
- {
- return rounds;
- }
-
- /**
- * Get the version number.
- *
- * @return The version number.
- */
- public int getVersion()
- {
- return version;
- }
-
- /**
- * Get the word size, in bits.
- *
- * @return The word size, in bits.
- */
- public int getWordSize()
- {
- return wordSize;
- }
-
- public boolean equals(Object o)
- {
- if (this == o) return true;
- byte[] oiv = ((RC5ParameterSpec) o).getIV();
- if (iv != oiv)
- {
- if (iv == null || oiv == null) return false;
- if (iv.length != oiv.length) return false;
- for (int i = 0; i < iv.length; i++)
- {
- if (iv[i] != oiv[i])
- {
- return false;
- }
- }
- }
- return rounds == ((RC5ParameterSpec) o).getRounds()
- && version == ((RC5ParameterSpec) o).getVersion()
- && wordSize == ((RC5ParameterSpec) o).getWordSize();
- }
-
- public int hashCode()
- {
- int code = rounds + version + wordSize;
- if (iv != null)
- {
- for (int i = 0; i < iv.length; i++)
- {
- code += iv[i];
- }
- }
- return code;
- }
-}
diff --git a/libjava/javax/crypto/spec/SecretKeySpec.java b/libjava/javax/crypto/spec/SecretKeySpec.java
deleted file mode 100644
index 4caf51a4615..00000000000
--- a/libjava/javax/crypto/spec/SecretKeySpec.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/* SecretKeySpec.java -- Wrapper for secret keys.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.crypto.spec;
-
-import java.security.spec.KeySpec;
-
-import javax.crypto.SecretKey;
-
-/**
- * This is a simple wrapper around a raw byte array, for ciphers that do
- * not require any key parameters other than the bytes themselves.
- *
- * <p>Since this class implements {@link javax.crypto.SecretKey}, which
- * in turn extends {@link java.security.Key}, so instances of this class
- * may be passed directly to the <code>init()</code> methods of {@link
- * javax.crypto.Cipher}.
- *
- * @see javax.crypto.SecretKey
- * @see javax.crypto.SecretKeyFactory
- */
-public class SecretKeySpec implements KeySpec, SecretKey
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- /** Compatible with JDK1.4. */
- private static final long serialVersionUID = 6577238317307289933L;
-
- /** The key bytes. */
- private byte[] key;
-
- /** The algorithm's name. */
- private String algorithm;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Create a new secret key spec from an entire byte array.
- *
- * @param key The key material.
- * @param algorithm The name of the algorithm using this key.
- */
- public SecretKeySpec(byte[] key, String algorithm)
- {
- this(key, 0, key.length, algorithm);
- }
-
- /**
- * Create a new secret key spec from part of a byte array.
- *
- * @param key The key material.
- * @param off The offset at which key material begins.
- * @param len The length of key material.
- * @param algorithm The name of the algorithm using this key.
- */
- public SecretKeySpec(byte[] key, int off, int len, String algorithm)
- {
- this.key = new byte[len];
- this.algorithm = algorithm;
- System.arraycopy(key, off, this.key, 0, len);
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Return the name of the algorithm associated with this secret key.
- *
- * @return The algorithm's name.
- */
- public String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Return the key as a byte array.
- *
- * @return The key material.
- */
- public byte[] getEncoded()
- {
- return key;
- }
-
- /**
- * This key's format, which is always "RAW".
- *
- * @return "RAW"
- */
- public String getFormat()
- {
- return "RAW";
- }
-
- public boolean equals(Object o)
- {
- byte[] okey = ((SecretKeySpec) o).getEncoded();
- if (key.length != okey.length) return false;
- for (int i = 0; i < key.length; i++)
- {
- if (key[i] != okey[i])
- return false;
- }
- return algorithm.equals(((SecretKeySpec) o).getAlgorithm());
- }
-
- public int hashCode()
- {
- int code = 0;
- for (int i = 0; i < key.length; i++)
- {
- code ^= (key[i] & 0xff) << (i << 3 & 31);
- }
- return code ^ algorithm.hashCode();
- }
-}
diff --git a/libjava/javax/imageio/IIOException.java b/libjava/javax/imageio/IIOException.java
deleted file mode 100644
index 8f8dd03441c..00000000000
--- a/libjava/javax/imageio/IIOException.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* IIOException.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-import java.io.IOException;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class IIOException extends IOException
-{
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message The descriptive error message.
- */
- public IIOException(String message)
- {
- super(message);
- }
-
- /**
- * Create an exception with a descriptive error message.
- *
- * @param message The descriptive error message.
- * @param cause The cause for this exception.
- */
- public IIOException(String message, Throwable cause)
- {
- super(message);
- initCause(cause);
- }
-}
diff --git a/libjava/javax/imageio/IIOImage.java b/libjava/javax/imageio/IIOImage.java
deleted file mode 100644
index 651c9baaa21..00000000000
--- a/libjava/javax/imageio/IIOImage.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* IIOImage.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-import java.awt.image.BufferedImage;
-import java.awt.image.Raster;
-import java.awt.image.RenderedImage;
-import java.util.List;
-
-import javax.imageio.metadata.IIOMetadata;
-
-public class IIOImage
-{
- protected RenderedImage image;
- protected IIOMetadata metadata;
- protected Raster raster;
- protected List thumbnails;
-
- public IIOImage (Raster raster, List thumbnails, IIOMetadata metadata)
- {
- if (raster == null)
- throw new IllegalArgumentException ("raster may not be null");
-
- this.raster = raster;
- this.thumbnails = thumbnails;
- this.metadata = metadata;
- }
-
- public IIOImage (RenderedImage image, List thumbnails, IIOMetadata metadata)
- {
- if (image == null)
- throw new IllegalArgumentException ("image may not be null");
-
- this.image = image;
- this.thumbnails = thumbnails;
- this.metadata = metadata;
- }
-
- public IIOMetadata getMetadata()
- {
- return metadata;
- }
-
- public int getNumThumbnails()
- {
- return thumbnails.size();
- }
-
- public Raster getRaster()
- {
- return raster;
- }
-
- public RenderedImage getRenderedImage()
- {
- return image;
- }
-
- public BufferedImage getThumbnail (int index)
- {
- return (BufferedImage) thumbnails.get (index);
- }
-
- public List getThumbnails()
- {
- return thumbnails;
- }
-
- public boolean hasRaster()
- {
- return raster != null;
- }
-
- public void setMetadata (IIOMetadata metadata)
- {
- this.metadata = metadata;
- }
-
- public void setRaster (Raster raster)
- {
- if (raster == null)
- throw new IllegalArgumentException ("raster may not be null");
-
- this.image = null;
- this.raster = raster;
- }
-
- public void setRenderedImage (RenderedImage image)
- {
- if (image == null)
- throw new IllegalArgumentException ("image may not be null");
-
- this.image = image;
- this.raster = null;
- }
-
- public void setThumbnails (List thumbnails)
- {
- this.thumbnails = thumbnails;
- }
-
-} // class IIOParam
diff --git a/libjava/javax/imageio/IIOParam.java b/libjava/javax/imageio/IIOParam.java
deleted file mode 100644
index 01f6166059d..00000000000
--- a/libjava/javax/imageio/IIOParam.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* IIOParam.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-import java.awt.Point;
-import java.awt.Rectangle;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class IIOParam
-{
- protected IIOParamController controller;
- protected IIOParamController defaultController;
- protected Point destinationOffset = new Point(0, 0);
- protected ImageTypeSpecifier destinationType;
- protected int[] sourceBands;
- protected Rectangle sourceRegion;
- protected int sourceXSubsampling;
- protected int sourceYSubsampling;
- protected int subsamplingXOffset;
- protected int subsamplingYOffset;
-
- /**
- * Initializes an <code>IIOParam</code> object.
- */
- protected IIOParam()
- {
- // Do nothing here.
- }
-
- public boolean activateController()
- {
- if (controller == null)
- return false;
-
- return controller.activate(this);
- }
-
- public IIOParamController getController()
- {
- return controller;
- }
-
- public IIOParamController getDefaultController()
- {
- return defaultController;
- }
-
- public Point getDestinationOffset()
- {
- return destinationOffset;
- }
-
- public ImageTypeSpecifier getDestinationType()
- {
- return destinationType;
- }
-
- public int[] getSourceBands()
- {
- return sourceBands;
- }
-
- public Rectangle getSourceRegion()
- {
- return sourceRegion;
- }
-
- public int getSourceXSubsampling()
- {
- return sourceXSubsampling;
- }
-
- public int getSourceYSubsampling()
- {
- return sourceYSubsampling;
- }
-
- public int getSubsamplingXOffset()
- {
- return subsamplingXOffset;
- }
-
- public int getSubsamplingYOffset()
- {
- return subsamplingYOffset;
- }
-
- public boolean hasController()
- {
- return getController() != null;
- }
-
- public void setController(IIOParamController controller)
- {
- this.controller = controller;
- }
-
- public void setDestinationOffset(Point destinationOffset)
- {
- if (destinationOffset == null)
- throw new IllegalArgumentException("destinationOffset is null");
-
- this.destinationOffset = destinationOffset;
- }
-
- public void setSourceBands(int[] sourceBands)
- {
- this.sourceBands = sourceBands;
- }
-
- public void setSourceRegion(Rectangle sourceRegion)
- {
- if (sourceRegion != null
- && (sourceRegion.x < 0
- || sourceRegion.y < 0
- || sourceRegion.width <= 0
- || sourceRegion.height <= 0))
- throw new IllegalArgumentException("illegal source region");
-
- // FIXME: Throw IllegalStateException.
-
- this.sourceRegion = sourceRegion;
- }
-
- public void setSourceSubsampling(int sourceXSubsampling, int sourceYSubsampling,
- int subsamplingXOffset, int subsamplingYOffset)
- {
- this.sourceXSubsampling = sourceXSubsampling;
- this.sourceYSubsampling = sourceYSubsampling;
- this.subsamplingXOffset = subsamplingXOffset;
- this.subsamplingYOffset = subsamplingYOffset;
- }
-}
diff --git a/libjava/javax/imageio/IIOParamController.java b/libjava/javax/imageio/IIOParamController.java
deleted file mode 100644
index 125520e735b..00000000000
--- a/libjava/javax/imageio/IIOParamController.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* IIOParamController.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface IIOParamController
-{
- /**
- * Activates the controller.
- *
- * @param param the <code>IIOParam</code> to be modified
- *
- * @return true if the <code>IIOParam</code> has been modified,
- * false otherwise
- *
- * @exception IllegalArgumentException if param is null or is not an instance
- * of the correct class
- */
- boolean activate(IIOParam param);
-}
diff --git a/libjava/javax/imageio/ImageIO.java b/libjava/javax/imageio/ImageIO.java
deleted file mode 100644
index 95c7c325121..00000000000
--- a/libjava/javax/imageio/ImageIO.java
+++ /dev/null
@@ -1,605 +0,0 @@
-/* ImageIO.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-import java.awt.image.BufferedImage;
-import java.awt.image.RenderedImage;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-
-import javax.imageio.spi.IIORegistry;
-import javax.imageio.spi.ImageReaderSpi;
-import javax.imageio.spi.ImageWriterSpi;
-import javax.imageio.spi.ServiceRegistry;
-import javax.imageio.stream.ImageInputStream;
-import javax.imageio.stream.ImageOutputStream;
-import javax.imageio.stream.MemoryCacheImageInputStream;
-import javax.imageio.stream.MemoryCacheImageOutputStream;
-
-public final class ImageIO
-{
- /**
- * This class isn't intended to be instantiated.
- */
- private ImageIO() {}
-
- private static final class ReaderFormatFilter implements ServiceRegistry.Filter
- {
- private String formatName;
-
- public ReaderFormatFilter(String formatName)
- {
- this.formatName = formatName;
- }
-
- public boolean filter (Object provider)
- {
- if (provider instanceof ImageReaderSpi)
- {
- ImageReaderSpi spi = (ImageReaderSpi) provider;
- String[] formatNames = spi.getFormatNames();
-
- for (int i = formatNames.length - 1; i >= 0; --i)
- if (formatName.equals(formatNames[i]))
- return true;
- }
-
- return false;
- }
- }
-
- private static final class ReaderMIMETypeFilter implements ServiceRegistry.Filter
- {
- private String MIMEType;
-
- public ReaderMIMETypeFilter(String MIMEType)
- {
- this.MIMEType = MIMEType;
- }
-
- public boolean filter(Object provider)
- {
- if (provider instanceof ImageReaderSpi)
- {
- ImageReaderSpi spi = (ImageReaderSpi) provider;
- String[] mimetypes = spi.getMIMETypes();
-
- for (int i = mimetypes.length - 1; i >= 0; --i)
- if (MIMEType.equals(mimetypes[i]))
- return true;
- }
-
- return false;
- }
- }
-
- private static final class ReaderSuffixFilter implements ServiceRegistry.Filter
- {
- private String fileSuffix;
-
- public ReaderSuffixFilter(String fileSuffix)
- {
- this.fileSuffix = fileSuffix;
- }
-
- public boolean filter(Object provider)
- {
- if (provider instanceof ImageReaderSpi)
- {
- ImageReaderSpi spi = (ImageReaderSpi) provider;
- String[] suffixes = spi.getFileSuffixes();
-
- for (int i = suffixes.length - 1; i >= 0; --i)
- if (fileSuffix.equals(suffixes[i]))
- return true;
- }
-
- return false;
- }
- }
-
- private static final class WriterFormatFilter implements ServiceRegistry.Filter
- {
- private String formatName;
-
- public WriterFormatFilter(String formatName)
- {
- this.formatName = formatName;
- }
-
- public boolean filter(Object provider)
- {
- if (provider instanceof ImageWriterSpi)
- {
- ImageWriterSpi spi = (ImageWriterSpi) provider;
- String[] formatNames = spi.getFormatNames();
-
- for (int i = formatNames.length - 1; i >= 0; --i)
- if (formatName.equals(formatNames[i]))
- return true;
- }
-
- return false;
- }
- }
-
- private static final class WriterMIMETypeFilter implements ServiceRegistry.Filter
- {
- private String MIMEType;
-
- public WriterMIMETypeFilter(String MIMEType)
- {
- this.MIMEType = MIMEType;
- }
-
- public boolean filter(Object provider)
- {
- if (provider instanceof ImageWriterSpi)
- {
- ImageWriterSpi spi = (ImageWriterSpi) provider;
- String[] mimetypes = spi.getMIMETypes();
-
- for (int i = mimetypes.length - 1; i >= 0; --i)
- if (MIMEType.equals(mimetypes[i]))
- return true;
- }
-
- return false;
- }
- }
-
- private static final class WriterSuffixFilter implements ServiceRegistry.Filter
- {
- private String fileSuffix;
-
- public WriterSuffixFilter(String fileSuffix)
- {
- this.fileSuffix = fileSuffix;
- }
-
- public boolean filter(Object provider)
- {
- if (provider instanceof ImageWriterSpi)
- {
- ImageWriterSpi spi = (ImageWriterSpi) provider;
- String[] suffixes = spi.getFileSuffixes();
-
- for (int i = suffixes.length - 1; i >= 0; --i)
- if (fileSuffix.equals(suffixes[i]))
- return true;
- }
-
- return false;
- }
- }
-
- private static final class ImageReaderIterator implements Iterator
- {
- Iterator it;
- Object readerExtension;
-
- public ImageReaderIterator(Iterator it, Object readerExtension)
- {
- this.it = it;
- this.readerExtension = readerExtension;
- }
-
- public boolean hasNext()
- {
- return it.hasNext();
- }
-
- public Object next()
- {
- try
- {
- return ((ImageReaderSpi) it.next()).createReaderInstance(readerExtension);
- }
- catch (IOException e)
- {
- return null;
- }
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
-
- private static final class ImageWriterIterator implements Iterator
- {
- Iterator it;
- Object writerExtension;
-
- public ImageWriterIterator(Iterator it, Object writerExtension)
- {
- this.it = it;
- this.writerExtension = writerExtension;
- }
-
- public boolean hasNext()
- {
- return it.hasNext();
- }
-
- public Object next()
- {
- try
- {
- return ((ImageWriterSpi) it.next()).createWriterInstance(writerExtension);
- }
- catch (IOException e)
- {
- return null;
- }
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
-
- private static File cacheDirectory;
- private static boolean useCache = true;
-
- private static Iterator getReadersByFilter(Class type,
- ServiceRegistry.Filter filter,
- Object readerExtension)
- {
- try
- {
- Iterator it = getRegistry().getServiceProviders(type, filter, true);
- return new ImageReaderIterator(it, readerExtension);
- }
- catch (IllegalArgumentException e)
- {
- return Collections.EMPTY_SET.iterator();
- }
- }
-
- private static Iterator getWritersByFilter(Class type,
- ServiceRegistry.Filter filter,
- Object writerExtension)
- {
- try
- {
- Iterator it = getRegistry().getServiceProviders(type, filter, true);
- return new ImageWriterIterator(it, writerExtension);
- }
- catch (IllegalArgumentException e)
- {
- return Collections.EMPTY_SET.iterator();
- }
- }
-
- public static File getCacheDirectory()
- {
- return cacheDirectory;
- }
-
- public static Iterator getImageReadersByFormatName(String formatName)
- {
- if (formatName == null)
- throw new IllegalArgumentException("formatName may not be null");
-
- return getReadersByFilter(ImageReaderSpi.class,
- new ReaderFormatFilter(formatName),
- formatName);
- }
-
- public static Iterator getImageReadersByMIMEType(String MIMEType)
- {
- if (MIMEType == null)
- throw new IllegalArgumentException("MIMEType may not be null");
-
- return getReadersByFilter(ImageReaderSpi.class,
- new ReaderMIMETypeFilter(MIMEType),
- MIMEType);
- }
-
- public static Iterator getImageReadersBySuffix(String fileSuffix)
- {
- if (fileSuffix == null)
- throw new IllegalArgumentException("formatName may not be null");
-
- return getReadersByFilter(ImageReaderSpi.class,
- new ReaderSuffixFilter(fileSuffix),
- fileSuffix);
- }
-
- public static Iterator getImageWritersByFormatName(String formatName)
- {
- if (formatName == null)
- throw new IllegalArgumentException("formatName may not be null");
-
- return getWritersByFilter(ImageWriterSpi.class,
- new WriterFormatFilter(formatName),
- formatName);
- }
-
- public static Iterator getImageWritersByMIMEType(String MIMEType)
- {
- if (MIMEType == null)
- throw new IllegalArgumentException("MIMEType may not be null");
-
- return getWritersByFilter(ImageWriterSpi.class,
- new WriterMIMETypeFilter(MIMEType),
- MIMEType);
- }
-
- public static Iterator getImageWritersBySuffix(String fileSuffix)
- {
- if (fileSuffix == null)
- throw new IllegalArgumentException("fileSuffix may not be null");
-
- return getWritersByFilter(ImageWriterSpi.class,
- new WriterSuffixFilter(fileSuffix),
- fileSuffix);
- }
-
- public static String[] getReaderFormatNames()
- {
- try
- {
- Iterator it =
- getRegistry().getServiceProviders(ImageReaderSpi.class, true);
- ArrayList result = new ArrayList();
-
- while (it.hasNext())
- {
- ImageReaderSpi spi = (ImageReaderSpi) it.next();
- String[] names = spi.getFormatNames();
-
- for (int i = names.length - 1; i >= 0; --i)
- result.add(names[i]);
- }
-
- return (String[]) result.toArray(new String[result.size()]);
- }
- catch (IllegalArgumentException e)
- {
- return new String[0];
- }
- }
-
- public static String[] getReaderMIMETypes()
- {
- try
- {
- Iterator it =
- getRegistry().getServiceProviders(ImageReaderSpi.class, true);
- ArrayList result = new ArrayList();
-
- while (it.hasNext())
- {
- ImageReaderSpi spi = (ImageReaderSpi) it.next();
- String[] names = spi.getMIMETypes();
-
- for (int i = names.length - 1; i >= 0; --i)
- result.add(names[i]);
- }
-
- return (String[]) result.toArray(new String[result.size()]);
- }
- catch (IllegalArgumentException e)
- {
- return new String[0];
- }
- }
-
- private static IIORegistry getRegistry()
- {
- return IIORegistry.getDefaultInstance();
- }
-
- public static boolean getUseCache()
- {
- return useCache;
- }
-
- public static String[] getWriterFormatNames()
- {
- try
- {
- Iterator it =
- getRegistry().getServiceProviders(ImageWriterSpi.class, true);
- ArrayList result = new ArrayList();
-
- while (it.hasNext())
- {
- ImageWriterSpi spi = (ImageWriterSpi) it.next();
- String[] names = spi.getFormatNames();
-
- for (int i = names.length - 1; i >= 0; --i)
- result.add(names[i]);
- }
-
- return (String[]) result.toArray(new String[result.size()]);
- }
- catch (IllegalArgumentException e)
- {
- return new String[0];
- }
- }
-
- public static String[] getWriterMIMETypes()
- {
- try
- {
- Iterator it =
- getRegistry().getServiceProviders(ImageWriterSpi.class, true);
- ArrayList result = new ArrayList();
-
- while (it.hasNext())
- {
- ImageWriterSpi spi = (ImageWriterSpi) it.next();
- String[] names = spi.getMIMETypes();
-
- for (int i = names.length - 1; i >= 0; --i)
- result.add(names[i]);
- }
-
- return (String[]) result.toArray(new String[result.size()]);
- }
- catch (IllegalArgumentException e)
- {
- return new String[0];
- }
- }
-
- /**
- * Rescans the application classpath for ImageIO service providers
- * and registers them.
- */
- public static void scanForPlugins()
- {
- IIORegistry.getDefaultInstance().registerApplicationClasspathSpis();
- }
-
- public static void setCacheDirectory(File cacheDirectory)
- {
- if (cacheDirectory != null)
- {
- if (!cacheDirectory.isDirectory())
- throw new IllegalArgumentException("cacheDirectory must be a directory");
-
- cacheDirectory.canWrite();
- }
-
- ImageIO.cacheDirectory = cacheDirectory;
- }
-
- public static void setUseCache(boolean useCache)
- {
- ImageIO.useCache = useCache;
- }
-
- /*
- * "Standard" simplified entry points.
- */
-
- public static boolean write(RenderedImage im,
- String formatName,
- File output)
- throws IOException
- {
- return write(im, formatName, new FileOutputStream(output));
- }
-
- public static boolean write(RenderedImage im,
- String formatName,
- OutputStream output)
- throws IOException
- {
- return write(im, formatName, new MemoryCacheImageOutputStream(output));
- }
-
-
- public static boolean write(RenderedImage im,
- String formatName,
- ImageOutputStream output)
- throws IOException
- {
- Iterator writers = getImageWritersByFormatName(formatName);
- IIOImage img = new IIOImage(im, null, null);
- while (writers.hasNext())
- {
- ImageWriter w = (ImageWriter) writers.next();
- try
- {
- w.setOutput(output);
- }
- catch (IllegalArgumentException e)
- {
- continue;
- }
-
- w.write(null, img, null);
- output.close();
- return true;
- }
- return false;
- }
-
- public static BufferedImage read(ImageInputStream stream)
- throws IOException
- {
- Iterator providers = getRegistry().getServiceProviders(ImageReaderSpi.class, true);
- while (providers.hasNext())
- {
- ImageReaderSpi spi = (ImageReaderSpi) providers.next();
- if (spi.canDecodeInput(stream))
- {
- ImageReader reader = spi.createReaderInstance();
- reader.setInput(stream);
- return reader.read(0, null);
- }
- }
- return null;
- }
-
- public static BufferedImage read(URL input)
- throws IOException
- {
- return read(input.openStream());
- }
-
- public static BufferedImage read(InputStream input)
- throws IOException
- {
- return read(new MemoryCacheImageInputStream(input));
- }
-
- public static BufferedImage read(File input)
- throws IOException
- {
- return read(new FileInputStream(input));
- }
-
-}
diff --git a/libjava/javax/imageio/ImageReadParam.java b/libjava/javax/imageio/ImageReadParam.java
deleted file mode 100644
index 889fe6cc97d..00000000000
--- a/libjava/javax/imageio/ImageReadParam.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* ImageReadParam.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-import java.awt.Dimension;
-import java.awt.image.BufferedImage;
-
-/**
- * @author Michel Koch (konqueror@gmx.de)
- */
-public class ImageReadParam extends IIOParam
-{
- protected boolean canSetSourceRenderSize;
- protected BufferedImage destination;
- protected int[] destinationBands;
- protected int minProgressivePass;
- protected int numProgressivePasses = Integer.MAX_VALUE;
- protected Dimension sourceRenderSize;
-
- public ImageReadParam()
- {
- }
-
- public boolean canSetSourceRenderSize()
- {
- return canSetSourceRenderSize;
- }
-
- public BufferedImage getDestination()
- {
- return destination;
- }
-
- public int[] getDestinationBands()
- {
- return destinationBands;
- }
-
- public int getSourceMaxProgressivePass()
- {
- if (getSourceNumProgressivePasses() == Integer.MAX_VALUE)
- return Integer.MAX_VALUE;
-
- return getSourceMinProgressivePass() + getSourceNumProgressivePasses() - 1;
- }
-
- public int getSourceMinProgressivePass()
- {
- return minProgressivePass;
- }
-
- public int getSourceNumProgressivePasses()
- {
- return numProgressivePasses;
- }
-
- public Dimension getSourceRenderSize()
- {
- return sourceRenderSize;
- }
-
- public void setDestination(BufferedImage destination)
- {
- this.destination = destination;
- }
-
- public void setDestinationBands(int[] destinationBands)
- {
- this.destinationBands = destinationBands;
- }
-
- public void setSourceProgressivePasses(int minPass, int numPasses)
- {
- this.minProgressivePass = minPass;
- this.numProgressivePasses = numPasses;
- }
-
- public void setSourceRenderSize(Dimension size)
- throws UnsupportedOperationException
- {
- if (! canSetSourceRenderSize())
- throw new UnsupportedOperationException
- ("setting source render size not supported");
-
- if (size.width <= 0 || size.height <= 0)
- throw new IllegalArgumentException("negative dimension not allowed");
-
- sourceRenderSize = size;
- }
-}
diff --git a/libjava/javax/imageio/ImageReader.java b/libjava/javax/imageio/ImageReader.java
deleted file mode 100644
index fdf692bd2aa..00000000000
--- a/libjava/javax/imageio/ImageReader.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/* ImageReader.java -- Decodes raster images.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-import java.awt.image.BufferedImage;
-import java.awt.image.Raster;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import javax.imageio.event.IIOReadProgressListener;
-import javax.imageio.event.IIOReadUpdateListener;
-import javax.imageio.event.IIOReadWarningListener;
-import javax.imageio.metadata.IIOMetadata;
-import javax.imageio.spi.ImageReaderSpi;
-import javax.imageio.stream.ImageInputStream;
-
-public abstract class ImageReader
-{
- private boolean aborted;
-
- protected Locale[] availableLocales;
- protected boolean ignoreMetadata;
- protected Object input;
- protected Locale locale;
- protected int minIndex;
- protected ImageReaderSpi originatingProvider;
- protected List progressListeners = new ArrayList();
- protected boolean seekForwardOnly;
- protected List updateListeners = new ArrayList();
- protected List warningListeners = new ArrayList();
- protected List warningLocales = new ArrayList();
-
- protected ImageReader(ImageReaderSpi originatingProvider)
- {
- this.originatingProvider = originatingProvider;
- }
-
- public void abort()
- {
- aborted = true;
- }
-
- protected boolean abortRequested()
- {
- return aborted;
- }
-
- public void addIIOReadProgressListener(IIOReadProgressListener listener)
- {
- if (listener == null)
- return;
-
- progressListeners.add(listener);
- }
-
- public void addIIOReadUpdateListener(IIOReadUpdateListener listener)
- {
- if (listener == null)
- return;
-
- updateListeners.add(listener);
- }
-
- public void addIIOReadWarningListener(IIOReadWarningListener listener)
- {
- if (listener == null)
- return;
-
- warningListeners.add(listener);
- }
-
- public boolean canReadRaster()
- {
- return false;
- }
-
- protected void clearAbortRequest()
- {
- aborted = false;
- }
-
- public void dispose()
- {
- // The default implementation does nothing.
- }
-
- public float getAspectRatio(int imageIndex)
- throws IOException
- {
- return (float) (getWidth(imageIndex) / getHeight(imageIndex));
- }
-
- public Locale[] getAvailableLocales()
- {
- if (availableLocales == null)
- return null;
-
- return (Locale[]) availableLocales.clone();
- }
-
- public ImageReadParam getDefaultReadParam()
- {
- return new ImageReadParam();
- }
-
- public String getFormatName()
- throws IOException
- {
- return originatingProvider.getFormatNames()[0];
- }
-
- public abstract int getHeight(int imageIndex)
- throws IOException;
-
- public abstract IIOMetadata getImageMetadata(int imageIndex)
- throws IOException;
-
- public abstract Iterator getImageTypes(int imageIndex)
- throws IOException;
-
- public void setInput(Object input,
- boolean seekForwardOnly,
- boolean ignoreMetadata)
- {
- Class[] okClasses = originatingProvider.getInputTypes();
- if (okClasses == null)
- {
- if (!(input instanceof ImageInputStream))
- throw new IllegalArgumentException();
- }
- else
- {
- boolean classOk = false;
- for (int i = 0; i < okClasses.length; ++i)
- if (okClasses[i].isInstance(input))
- classOk = true;
- if (!classOk)
- throw new IllegalArgumentException();
- }
-
- this.input = input;
- this.seekForwardOnly = seekForwardOnly;
- this.ignoreMetadata = ignoreMetadata;
- this.minIndex = 0;
- }
-
- public void setInput(Object in, boolean seekForwardOnly)
- {
- setInput(in, seekForwardOnly, false);
- }
-
- public void setInput(Object in)
- {
- setInput(in, false, false);
- }
-
- public Object getInput()
- {
- return input;
- }
-
- public Locale getLocale()
- {
- return locale;
- }
-
- public abstract int getNumImages(boolean allowSearch)
- throws IOException;
-
- public int getNumThumbnails(int imageIndex)
- throws IOException
- {
- return 0;
- }
-
- public ImageReaderSpi getOriginatingProvider()
- {
- return originatingProvider;
- }
-
- public abstract IIOMetadata getStreamMetadata()
- throws IOException;
-
- public int getThumbnailHeight(int imageIndex, int thumbnailIndex)
- throws IOException
- {
- return readThumbnail(imageIndex, thumbnailIndex).getHeight();
- }
-
- public int getThumbnailWidth(int imageIndex, int thumbnailIndex)
- throws IOException
- {
- return readThumbnail(imageIndex, thumbnailIndex).getWidth();
- }
-
- public int getTileGridXOffset(int imageIndex)
- throws IOException
- {
- return 0;
- }
-
- public int getTileGridYOffset(int imageIndex)
- throws IOException
- {
- return 0;
- }
-
- public int getTileHeight(int imageIndex)
- throws IOException
- {
- return getHeight(imageIndex);
- }
-
- public int getTileWidth(int imageIndex)
- throws IOException
- {
- return getWidth(imageIndex);
- }
-
- public abstract int getWidth(int imageIndex)
- throws IOException;
-
- public boolean hasThumbnails(int imageIndex)
- throws IOException
- {
- return getNumThumbnails(imageIndex) > 0;
- }
-
- public boolean isIgnoringMetadata()
- {
- return ignoreMetadata;
- }
-
- public boolean isImageTiled(int imageIndex)
- throws IOException
- {
- return false;
- }
-
- public boolean isRandomAccessEasy(int imageIndex)
- throws IOException
- {
- return false;
- }
-
- public boolean isSeekForwardOnly()
- {
- return seekForwardOnly;
- }
-
- protected void processImageComplete()
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadProgressListener listener = (IIOReadProgressListener) it.next();
- listener.imageComplete (this);
- }
- }
-
- protected void processImageProgress(float percentageDone)
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadProgressListener listener = (IIOReadProgressListener) it.next();
- listener.imageProgress(this, percentageDone);
- }
- }
-
- protected void processImageStarted(int imageIndex)
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadProgressListener listener = (IIOReadProgressListener) it.next();
- listener.imageStarted(this, imageIndex);
- }
- }
-
- protected void processImageUpdate(BufferedImage image, int minX, int minY,
- int width, int height, int periodX,
- int periodY, int[] bands)
- {
- Iterator it = updateListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next();
- listener.imageUpdate(this, image, minX, minY, width, height, periodX,
- periodY, bands);
- }
- }
-
- protected void processPassComplete(BufferedImage image)
- {
- Iterator it = updateListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next();
- listener.passComplete(this, image);
- }
- }
-
- protected void processPassStarted(BufferedImage image, int pass, int minPass,
- int maxPass, int minX, int minY,
- int periodX, int periodY, int[] bands)
- {
- Iterator it = updateListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next();
- listener.passStarted(this, image, pass, minPass, maxPass, minX, minY,
- periodX, periodY, bands);
- }
- }
-
- protected void processReadAborted()
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadProgressListener listener = (IIOReadProgressListener) it.next();
- listener.readAborted(this);
- }
- }
-
- protected void processSequenceComplete()
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadProgressListener listener = (IIOReadProgressListener) it.next();
- listener.sequenceComplete(this);
- }
- }
-
- protected void processSequenceStarted(int minIndex)
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadProgressListener listener = (IIOReadProgressListener) it.next();
- listener.sequenceStarted(this, minIndex);
- }
- }
-
- protected void processThumbnailComplete()
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadProgressListener listener = (IIOReadProgressListener) it.next();
- listener.thumbnailComplete(this);
- }
- }
-
- protected void processThumbnailPassComplete(BufferedImage thumbnail)
- {
- Iterator it = updateListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next();
- listener.thumbnailPassComplete(this, thumbnail);
- }
- }
-
- protected void processThumbnailPassStarted(BufferedImage thumbnail, int pass,
- int minPass, int maxPass, int minX,
- int minY, int periodX, int periodY,
- int[] bands)
- {
- Iterator it = updateListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next();
- listener.thumbnailPassStarted(this, thumbnail, pass, minPass, maxPass,
- minX, minY, periodX, periodY, bands);
- }
- }
-
- protected void processThumbnailProgress(float percentageDone)
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadProgressListener listener = (IIOReadProgressListener) it.next();
- listener.thumbnailProgress(this, percentageDone);
- }
- }
-
- protected void processThumbnailStarted(int imageIndex, int thumbnailIndex)
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadProgressListener listener = (IIOReadProgressListener) it.next();
- listener.thumbnailStarted(this, imageIndex, thumbnailIndex);
- }
- }
-
- protected void processThumbnailUpdate(BufferedImage image, int minX, int minY,
- int width, int height, int periodX,
- int periodY, int[] bands)
- {
- Iterator it = updateListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next();
- listener.thumbnailUpdate(this, image, minX, minY, width, height,
- periodX, periodY, bands);
- }
- }
-
- protected void processWarningOccurred(String warning)
- {
- Iterator it = warningListeners.iterator();
-
- while (it.hasNext())
- {
- IIOReadWarningListener listener = (IIOReadWarningListener) it.next();
- listener.warningOccurred(this, warning);
- }
- }
-
- public abstract BufferedImage read(int imageIndex, ImageReadParam param)
- throws IOException;
-
- public boolean readerSupportsThumbnails()
- {
- return false;
- }
-
- public Raster readRaster(int imageIndex, ImageReadParam param)
- throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- public BufferedImage readThumbnail(int imageIndex, int thumbnailIndex)
- throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- public void removeAllIIOReadProgressListeners()
- {
- progressListeners.clear();
- }
-
- public void removeAllIIOReadUpdateListeners()
- {
- updateListeners.clear();
- }
-
- public void removeAllIIOReadWarningListeners()
- {
- warningListeners.clear();
- }
-
- public void removeIIOReadProgressListener(IIOReadProgressListener listener)
- {
- if (listener == null)
- return;
-
- progressListeners.remove(listener);
- }
-
- public void removeIIOReadUpdateListener(IIOReadUpdateListener listener)
- {
- if (listener == null)
- return;
-
- updateListeners.remove(listener);
- }
-
- public void removeIIOReadWarningListener(IIOReadWarningListener listener)
- {
- if (listener == null)
- return;
-
- warningListeners.remove(listener);
- }
-
- public void setLocale(Locale locale)
- {
- if (locale != null)
- {
- // Check if its a valid locale.
- boolean found = false;
-
- if (availableLocales != null)
- for (int i = availableLocales.length - 1; i >= 0; --i)
- if (availableLocales[i].equals(locale))
- found = true;
-
- if (! found)
- throw new IllegalArgumentException("looale not available");
- }
-
- this.locale = locale;
- }
-}
diff --git a/libjava/javax/imageio/ImageTranscoder.java b/libjava/javax/imageio/ImageTranscoder.java
deleted file mode 100644
index ccc99316269..00000000000
--- a/libjava/javax/imageio/ImageTranscoder.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ImageTranscoder.java -- Image metadata transcoder.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-import javax.imageio.metadata.IIOMetadata;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface ImageTranscoder
-{
- IIOMetadata convertImageMetadata(IIOMetadata inData,
- ImageTypeSpecifier imageType,
- ImageWriteParam param);
-
- IIOMetadata convertStreamMetadata(IIOMetadata inData,
- ImageWriteParam param);
-}
diff --git a/libjava/javax/imageio/ImageTypeSpecifier.java b/libjava/javax/imageio/ImageTypeSpecifier.java
deleted file mode 100644
index 0751e376757..00000000000
--- a/libjava/javax/imageio/ImageTypeSpecifier.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ImageTypeSpecifier.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-import java.awt.image.ColorModel;
-import java.awt.image.RenderedImage;
-import java.awt.image.SampleModel;
-
-public class ImageTypeSpecifier
-{
- protected ColorModel colorModel;
- protected SampleModel sampleModel;
-
- public ImageTypeSpecifier(ColorModel colorModel, SampleModel sampleModel)
- {
- if (colorModel == null)
- throw new IllegalArgumentException("colorModel may not be null");
-
- if (sampleModel == null)
- throw new IllegalArgumentException("sampleModel may not be null");
-
- if (!colorModel.isCompatibleSampleModel(sampleModel))
- throw new IllegalArgumentException
- ("sample Model not compatible with colorModel");
-
- this.colorModel = colorModel;
- this.sampleModel = sampleModel;
- }
-
- public ImageTypeSpecifier(RenderedImage image)
- {
- if (image == null)
- throw new IllegalArgumentException("image may not be null");
-
- this.colorModel = image.getColorModel();
- this.sampleModel = image.getSampleModel();
- }
-
- public ColorModel getColorModel()
- {
- return colorModel;
- }
-
- public int getNumBands()
- {
- return sampleModel.getNumBands();
- }
-
- public int getNumComponents()
- {
- return colorModel.getNumComponents();
- }
-
- public SampleModel getSampleModel()
- {
- return sampleModel;
- }
-}
diff --git a/libjava/javax/imageio/ImageWriteParam.java b/libjava/javax/imageio/ImageWriteParam.java
deleted file mode 100644
index 08f4885a8d1..00000000000
--- a/libjava/javax/imageio/ImageWriteParam.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/* ImageWriteParam.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-import java.awt.Dimension;
-import java.util.Locale;
-
-public class ImageWriteParam extends IIOParam
-{
- public static final int MODE_DISABLED = 0;
- public static final int MODE_DEFAULT = 1;
- public static final int MODE_EXPLICIT = 2;
- public static final int MODE_COPY_FROM_METADATA = 3;
-
- protected boolean canOffsetTiles;
- protected boolean canWriteCompressed;
- protected boolean canWriteProgressive;
- protected boolean canWriteTiles;
- protected int compressionMode = MODE_COPY_FROM_METADATA;
- protected float compressionQuality;
- protected String compressionType;
- protected String[] compressionTypes;
- protected Locale locale;
- protected Dimension[] preferredTileSizes;
- protected int progressiveMode = MODE_COPY_FROM_METADATA;
- protected int tileGridXOffset;
- protected int tileGridYOffset;
- protected int tileHeight;
- protected int tileWidth;
- protected int tilingMode;
- protected boolean tilingSet;
-
- /**
- * Creates an empty <code>ImageWriteParam</code> object.
- * The subclass is responsible to initialize all fields.
- */
- protected ImageWriteParam()
- {
- // Do nothing here.
- }
-
- /**
- * Creates an <code>ImageWriteParam</code> object with the given locale.
- *
- * @param locale the locale to use for user visible strings
- */
- public ImageWriteParam(Locale locale)
- {
- this.locale = locale;
- }
-
- public float getBitRate(float quality)
- {
- checkNotExplicitCompression();
- checkCompressionTypesSet();
-
- return -1.0f;
- }
-
- private void checkSupportsCompression()
- {
- if (! canWriteCompressed())
- throw new UnsupportedOperationException("compression not supported");
- }
-
- private void checkNotExplicitCompression()
- {
- if (getCompressionMode() != MODE_EXPLICIT)
- throw new IllegalStateException("compression mode is not MODE_EXPLICIT");
- }
-
- private void checkCompressionTypesSet()
- {
- if (getCompressionType() == null
- && getCompressionTypes() != null)
- throw new IllegalStateException("no compression type set");
- }
-
- private void checkSupportsProgressiveEncoding()
- {
- if (! canWriteProgressive())
- throw new UnsupportedOperationException
- ("progressive output not supported");
- }
-
- private void checkSupportsTiling()
- {
- if (! canWriteTiles())
- throw new UnsupportedOperationException("tiling not supported");
- }
-
- private void checkNotExplicitTiling()
- {
- if (getTilingMode() != MODE_EXPLICIT)
- throw new IllegalStateException("tiling mode not MODE_EXPLICIT");
- }
-
- private void checkTilingInitialized()
- {
- if (! tilingSet)
- throw new IllegalStateException("tiling parameters not set");
- }
-
- private void checkMode(int mode)
- {
- if (mode < MODE_DISABLED || mode > MODE_COPY_FROM_METADATA)
- throw new IllegalArgumentException("mode not supported");
- }
-
- public boolean canOffsetTiles()
- {
- return canOffsetTiles;
- }
-
- public boolean canWriteCompressed()
- {
- return canWriteCompressed;
- }
-
- public boolean canWriteProgressive()
- {
- return canWriteProgressive;
- }
-
- public boolean canWriteTiles()
- {
- return canWriteTiles;
- }
-
- public int getCompressionMode()
- {
- checkSupportsCompression();
-
- return compressionMode;
- }
-
- public float getCompressionQuality()
- {
- checkNotExplicitCompression();
- checkCompressionTypesSet();
-
- return compressionQuality;
- }
-
- public String[] getCompressionQualityDescriptions()
- {
- checkNotExplicitCompression();
- checkCompressionTypesSet();;
-
- return null;
- }
-
- public float[] getCompressionQualityValues()
- {
- checkNotExplicitCompression();
- checkCompressionTypesSet();;
-
- return null;
- }
-
- public String getCompressionType()
- {
- checkNotExplicitCompression();
-
- return compressionType;
- }
-
- public String[] getCompressionTypes()
- {
- checkSupportsCompression();
-
- return compressionTypes != null ? (String[]) compressionTypes.clone() : null;
- }
-
- public Locale getLocale()
- {
- return locale;
- }
-
- public String getLocalizedCompressionTypeName()
- {
- checkNotExplicitCompression();
- checkCompressionTypesSet();
-
- return getCompressionType();
- }
-
- public Dimension[] getPreferredTileSizes()
- {
- checkSupportsTiling();
-
- return preferredTileSizes;
- }
-
- public int getProgressiveMode()
- {
- checkSupportsProgressiveEncoding();
-
- return progressiveMode;
- }
-
- public int getTileGridXOffset()
- {
- checkNotExplicitTiling();
- checkTilingInitialized();
-
- return tileGridXOffset;
- }
-
- public int getTileGridYOffset()
- {
- checkNotExplicitTiling();
- checkTilingInitialized();
-
- return tileGridYOffset;
- }
-
- public int getTileHeight()
- {
- checkNotExplicitTiling();
- checkTilingInitialized();
-
- return tileHeight;
- }
-
- public int getTileWidth()
- {
- checkNotExplicitTiling();
- checkTilingInitialized();
-
- return tileWidth;
- }
-
- public int getTilingMode()
- {
- checkSupportsTiling();
-
- return tilingMode;
- }
-
- public boolean isCompressionLossless()
- {
- checkNotExplicitCompression();
- checkCompressionTypesSet();
-
- return true;
- }
-
- public void setCompressionMode(int mode)
- {
- checkSupportsCompression();
- checkMode(mode);
-
- compressionMode = mode;
-
- if (mode == MODE_EXPLICIT)
- unsetCompression();
- }
-
- public void setCompressionQuality(float quality)
- {
- checkNotExplicitCompression();
- checkCompressionTypesSet();
-
- if (quality < 0.0f || quality > 1.0f)
- throw new IllegalArgumentException("quality out of range");
-
- compressionQuality = quality;
- }
-
- public void setCompressionType(String compressionType)
- {
- checkNotExplicitCompression();
-
- String[] types = getCompressionTypes();
-
- if (types == null)
- throw new UnsupportedOperationException("no settable compression types");
-
- if (compressionType == null)
- this.compressionType = null;
-
- for (int i = types.length - 1; i >= 0; --i)
- if (types[i].equals(compressionType))
- {
- this.compressionType = compressionType;
- return;
- }
-
- throw new IllegalArgumentException("unknown compression type");
- }
-
- public void setProgressiveMode(int mode)
- {
- checkSupportsProgressiveEncoding();
- checkMode(mode);
-
- progressiveMode = mode;
- }
-
- public void setTiling(int tileWidth, int tileHeight,
- int tileGridXOffset, int tileGridYOffset)
- {
- checkNotExplicitTiling();
-
- if (! canOffsetTiles
- && tileGridXOffset != 0
- && tileGridYOffset != 0)
- throw new UnsupportedOperationException("tile offsets not supported");
-
- if (tileWidth < 0 || tileHeight < 0)
- throw new IllegalArgumentException("negative tile dimension");
-
- if (preferredTileSizes != null)
- {
- boolean found = false;
-
- for (int i = 0; i < preferredTileSizes.length; i += 2)
- {
- if (tileWidth >= preferredTileSizes[i].width
- && tileWidth <= preferredTileSizes[i + 1].width
- && tileHeight >= preferredTileSizes[i].height
- && tileHeight <= preferredTileSizes[i + 1].height)
- found = true;
- }
-
- if (! found)
- throw new IllegalArgumentException("illegal tile size");
- }
-
- this.tilingSet = true;
- this.tileWidth = tileWidth;
- this.tileHeight = tileHeight;
- this.tileGridXOffset = tileGridXOffset;
- this.tileGridYOffset = tileGridYOffset;
- }
-
- public void setTilingMode(int mode)
- {
- checkSupportsTiling();
- checkMode(mode);
- tilingMode = mode;
- }
-
- public void unsetCompression()
- {
- checkNotExplicitCompression();
-
- compressionType = null;
- compressionQuality = 1.0F;
- }
-
- public void unsetTiling()
- {
- checkNotExplicitTiling();
-
- tileWidth = 0;
- tileHeight = 0;
- tileGridXOffset = 0;
- tileGridYOffset = 0;
- }
-}
diff --git a/libjava/javax/imageio/ImageWriter.java b/libjava/javax/imageio/ImageWriter.java
deleted file mode 100644
index 7479c3074f7..00000000000
--- a/libjava/javax/imageio/ImageWriter.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/* ImageWriter.java -- Encodes raster images.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio;
-
-import java.awt.Dimension;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import javax.imageio.event.IIOWriteProgressListener;
-import javax.imageio.event.IIOWriteWarningListener;
-import javax.imageio.metadata.IIOMetadata;
-
-import javax.imageio.spi.ImageWriterSpi;
-
-public abstract class ImageWriter
- implements ImageTranscoder
-{
- private boolean aborted;
-
- protected Locale[] availableLocales;
- protected Locale locale;
- protected ImageWriterSpi originatingProvider;
- protected Object output;
- protected List progressListeners = new ArrayList();
- protected List warningListeners = new ArrayList();
- protected List warningLocales = new ArrayList();
-
- protected ImageWriter(ImageWriterSpi originatingProvider)
- {
- this.originatingProvider = originatingProvider;
- }
-
- private void checkOutputSet()
- {
- if (output == null)
- throw new IllegalStateException("no output set");
- }
-
- public void abort()
- {
- aborted = true;
- }
-
- protected boolean abortRequested()
- {
- return aborted;
- }
-
- public void addIIOWriteProgressListener(IIOWriteProgressListener listener)
- {
- if (listener == null)
- return;
-
- progressListeners.add(listener);
- }
-
- public void addIIOWriteWarningListener (IIOWriteWarningListener listener)
- {
- if (listener == null)
- return;
-
- warningListeners.add(listener);
- }
-
- public boolean canInsertEmpty(int imageIndex)
- throws IOException
- {
- checkOutputSet();
- return false;
- }
-
- public boolean canInsertImage(int imageIndex)
- throws IOException
- {
- checkOutputSet();
- return false;
- }
-
- public boolean canRemoveImage(int imageIndex)
- throws IOException
- {
- checkOutputSet();
- return false;
- }
-
- public boolean canReplaceImageMetadata(int imageIndex)
- throws IOException
- {
- checkOutputSet();
- return false;
- }
-
- public boolean canReplacePixels(int imageIndex)
- throws IOException
- {
- checkOutputSet();
- return false;
- }
-
- public boolean canReplaceStreamMetadata()
- throws IOException
- {
- checkOutputSet();
- return false;
- }
-
- public boolean canWriteEmpty()
- throws IOException
- {
- checkOutputSet();
- return false;
- }
-
- public boolean canWriteRasters()
- {
- return false;
- }
-
- public boolean canWriteSequence()
- {
- return false;
- }
-
- protected void clearAbortRequest()
- {
- aborted = false;
- }
-
- public abstract IIOMetadata convertImageMetadata (IIOMetadata inData,
- ImageTypeSpecifier imageType,
- ImageWriteParam param);
-
- public abstract IIOMetadata convertStreamMetadata (IIOMetadata inData,
- ImageWriteParam param);
-
- public void dispose()
- {
- // The default implementation is empty. Subclasses have to overwrite it.
- }
-
- public Locale[] getAvailableLocales()
- {
- return availableLocales;
- }
-
- public abstract IIOMetadata getDefaultImageMetadata (ImageTypeSpecifier imageType, ImageWriteParam param);
-
- public abstract IIOMetadata getDefaultStreamMetadata (ImageWriteParam param);
-
- public ImageWriteParam getDefaultWriteParam()
- {
- return new ImageWriteParam(getLocale());
- }
-
- public Locale getLocale()
- {
- return locale;
- }
-
- public int getNumThumbnailsSupported (ImageTypeSpecifier imageType, ImageWriteParam param,
- IIOMetadata streamMetadata, IIOMetadata imageMetadata)
- {
- return 0;
- }
-
- public ImageWriterSpi getOriginatingProvider()
- {
- return originatingProvider;
- }
-
- public Object getOutput()
- {
- return output;
- }
-
- public Dimension[] getPreferredThumbnailSizes (ImageTypeSpecifier imageType,
- ImageWriteParam param,
- IIOMetadata streamMetadata,
- IIOMetadata imageMetadata)
- {
- return null;
- }
-
- protected void processImageComplete()
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next();
- listener.imageComplete(this);
- }
- }
-
- protected void processImageProgress(float percentageDone)
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next();
- listener.imageProgress(this, percentageDone);
- }
- }
-
- protected void processImageStarted(int imageIndex)
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next();
- listener.imageStarted(this, imageIndex);
- }
- }
-
- protected void processThumbnailComplete()
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next();
- listener.thumbnailComplete(this);
- }
- }
-
- protected void processThumbnailProgress(float percentageDone)
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next();
- listener.thumbnailProgress(this, percentageDone);
- }
- }
-
- protected void processThumbnailStarted(int imageIndex, int thumbnailIndex)
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next();
- listener.thumbnailStarted(this, imageIndex, thumbnailIndex);
- }
- }
-
- protected void processWarningOccurred(int imageIndex, String warning)
- {
- Iterator it = warningListeners.iterator();
-
- while (it.hasNext())
- {
- IIOWriteWarningListener listener = (IIOWriteWarningListener) it.next();
- listener.warningOccurred(this, imageIndex, warning);
- }
- }
-
- protected void processWriteAborted()
- {
- Iterator it = progressListeners.iterator();
-
- while (it.hasNext())
- {
- IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next();
- listener.writeAborted(this);
- }
- }
-
- public void removeAllIIOWriteProgressListeners()
- {
- progressListeners.clear();
- }
-
- public void removeAllIIOWriteWarningListeners()
- {
- progressListeners.clear();
- }
-
- public void removeIIOWriteProgressListener (IIOWriteProgressListener listener)
- {
- if (listener == null)
- return;
-
- progressListeners.remove(listener);
- }
-
- public void removeIIOWriteWarningListener (IIOWriteWarningListener listener)
- {
- if (listener == null)
- return;
-
- warningListeners.remove(listener);
- }
-
- public void reset()
- {
- setOutput(null);
- setLocale(null);
- removeAllIIOWriteWarningListeners();
- removeAllIIOWriteProgressListeners();
- clearAbortRequest();
- }
-
- public void setLocale(Locale locale)
- {
- if (locale != null)
- {
- // Check if its a valid locale.
- boolean found = false;
-
- if (availableLocales != null)
- for (int i = availableLocales.length - 1; i >= 0; --i)
- if (availableLocales[i].equals(locale))
- found = true;
-
- if (! found)
- throw new IllegalArgumentException("looale not available");
- }
-
- this.locale = locale;
- }
-
- public void setOutput(Object output)
- {
- if (output != null)
- {
- // Check if its a valid output object.
- boolean found = false;
- Class[] types = null;
-
- if (originatingProvider != null)
- types = originatingProvider.getOutputTypes();
-
- if (types != null)
- for (int i = types.length - 1; i >= 0; --i)
- if (types[i].isInstance(output))
- found = true;
-
- if (! found)
- throw new IllegalArgumentException("output type not available");
- }
-
- this.output = output;
- }
-
- public abstract void write (IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param)
- throws IOException;
-}
diff --git a/libjava/javax/imageio/event/IIOReadProgressListener.java b/libjava/javax/imageio/event/IIOReadProgressListener.java
deleted file mode 100644
index 404336c24bf..00000000000
--- a/libjava/javax/imageio/event/IIOReadProgressListener.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* IIOReadProgressListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.event;
-
-import java.util.EventListener;
-
-import javax.imageio.ImageReader;
-
-public interface IIOReadProgressListener extends EventListener
-{
- /**
- * Reports that the current image read operation has completed.
- *
- * @param source the <code>ImageReader</code> object calling this method
- */
- void imageComplete(ImageReader source);
-
- /**
- * Reports the approximate percentage of completions of this image read
- * operation.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param percentageDone the approximate percentage of encoding completed
- */
- void imageProgress(ImageReader source, float percentageDone);
-
- /**
- * Reports that the current image read operation has started.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param imageIndex the index of the image to read
- */
- void imageStarted(ImageReader source, int imageIndex);
-
- /**
- * Reports that a read operation has been aborted.
- *
- * @param source the <code>ImageReader</code> object calling this method
- */
- void readAborted(ImageReader source);
-
- /**
- * Reports that a sequence of read operationshas completed.
- *
- * @param source the <code>ImageReader</code> object calling this method
- */
- void sequenceComplete(ImageReader source);
-
- /**
- * Reports that a sequence of read operations is beginning.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param minIndex the index of the first image to be read
- */
- void sequenceStarted(ImageReader source, int minIndex);
-
- /**
- * Reports that a thumbnail read operation has completed.
- *
- * @param source the <code>ImageReader</code> object calling this method
- */
- void thumbnailComplete(ImageReader source);
-
- /**
- * Reports the approximate percentage of completion of a thumbnail read
- * operation.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param percentageDone the approximate percentage of encoding completed
- */
- void thumbnailProgress(ImageReader source, float percentageDone);
-
- /**
- * Reports that a thumbnail read operation is beginning.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param imageIndex the index of the image being read
- * @param thumbnailIndex the index of the thumbnail being read
- */
- void thumbnailStarted(ImageReader source, int imageIndex, int thumbnailIndex);
-}
diff --git a/libjava/javax/imageio/event/IIOReadUpdateListener.java b/libjava/javax/imageio/event/IIOReadUpdateListener.java
deleted file mode 100644
index 77b1a4e0718..00000000000
--- a/libjava/javax/imageio/event/IIOReadUpdateListener.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* IIOReadUpdateListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.event;
-
-import java.awt.image.BufferedImage;
-import java.util.EventListener;
-
-import javax.imageio.ImageReader;
-
-public interface IIOReadUpdateListener extends EventListener
-{
- /**
- * Reports that a given region of the image has been updated.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param image the BufferedImage being updated
- * @param minX the X coordinate of the leftmost updated column of pixels
- * @param minY the Y coordinate of the uppermost updated row of pixels
- * @param width the number of updated pixels horizontally
- * @param height the number of updated pixels vertically
- * @param periodX the horizontal spacing between updated pixels; a value of 1 means no gaps
- * @param periodY the vertical spacing between updated pixels; a value of 1 means no gaps
- * @param bands an array of <code>int</code>s indicating which bands are being updated
- */
- void imageUpdate(ImageReader source, BufferedImage image, int minX,
- int minY, int width, int height, int periodX, int periodY,
- int[] bands);
-
- /**
- * Reports that the current read operation has completed a progressive pass.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param image the BufferedImage being updated
- */
- void passComplete(ImageReader source, BufferedImage image);
-
- /**
- * Reports that the current read operation is about to begin a progressive pass.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param image the BufferedImage being updated
- * @param pass the numer of the pass that is about to begin, starting with 0
- * @param minPass the index of the first pass that will be decoded
- * @param maxPass the index of the last pass that will be decoded
- * @param minX the X coordinate of the leftmost updated column of pixels
- * @param minY the Y coordinate of the uppermost updated row of pixels
- * @param periodX the horizontal spacing between updated pixels; a value of 1 means no gaps
- * @param periodY the vertical spacing between updated pixels; a value of 1 means no gaps
- * @param bands an array of <code>int</code>s indicating which bands are being updated
- */
- void passStarted(ImageReader source, BufferedImage image, int pass,
- int minPass, int maxPass, int minX, int minY, int periodX,
- int periodY, int[] bands);
-
- /**
- * Reports that the current thumbnail read operation has completed a progressive pass.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param image the BufferedImage being updated
- */
- void thumbnailPassComplete(ImageReader source, BufferedImage image);
-
- /**
- * Reports that the current thumbnail read operation is about to begin a progressive pass.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param image the BufferedImage being updated
- * @param pass the numer of the pass that is about to begin, starting with 0
- * @param minPass the index of the first pass that will be decoded
- * @param maxPass the index of the last pass that will be decoded
- * @param minX the X coordinate of the leftmost updated column of pixels
- * @param minY the Y coordinate of the uppermost updated row of pixels
- * @param periodX the horizontal spacing between updated pixels; a value of 1 means no gaps
- * @param periodY the vertical spacing between updated pixels; a value of 1 means no gaps
- * @param bands an array of <code>int</code>s indicating which bands are being updated
- */
- void thumbnailPassStarted(ImageReader source, BufferedImage image, int pass,
- int minPass, int maxPass, int minX, int minY,
- int periodX, int periodY, int[] bands);
-
- /**
- * Reports that a given region of a thumbnail image has been updated.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param image the BufferedImage being updated
- * @param minX the X coordinate of the leftmost updated column of pixels
- * @param minY the Y coordinate of the uppermost updated row of pixels
- * @param width the number of updated pixels horizontally
- * @param height the number of updated pixels vertically
- * @param periodX the horizontal spacing between updated pixels; a value of 1 means no gaps
- * @param periodY the vertical spacing between updated pixels; a value of 1 means no gaps
- * @param bands an array of <code>int</code>s indicating which bands are being updated
- */
- void thumbnailUpdate(ImageReader source, BufferedImage image, int minX,
- int minY, int width, int height, int periodX,
- int periodY, int[] bands);
-}
diff --git a/libjava/javax/imageio/event/IIOReadWarningListener.java b/libjava/javax/imageio/event/IIOReadWarningListener.java
deleted file mode 100644
index e89735035ff..00000000000
--- a/libjava/javax/imageio/event/IIOReadWarningListener.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* IIOReadProgressListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.event;
-
-import java.util.EventListener;
-
-import javax.imageio.ImageReader;
-
-public interface IIOReadWarningListener extends EventListener
-{
- /**
- * Reports the occurrence of a non-fatal error in decoding.
- * Decoding will continue after this method is called.
- *
- * @param source the <code>ImageReader</code> object calling this method
- * @param warning the warning
- */
- void warningOccurred(ImageReader source, String warning);
-}
diff --git a/libjava/javax/imageio/event/IIOWriteProgressListener.java b/libjava/javax/imageio/event/IIOWriteProgressListener.java
deleted file mode 100644
index 16b8891f0f2..00000000000
--- a/libjava/javax/imageio/event/IIOWriteProgressListener.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* IIOWriteProgressListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.event;
-
-import java.util.EventListener;
-
-import javax.imageio.ImageWriter;
-
-public interface IIOWriteProgressListener extends EventListener
-{
- /**
- * Reports that an image write operation has completed.
- *
- * @param source the <code>ImageWriter</code> object calling this method
- */
- void imageComplete(ImageWriter source);
-
- /**
- * Reports the approximate percentage of completion of an image write
- * operation.
- *
- * @param source the <code>ImageWriter</code> object calling this method
- * @param percentageDone the approximate percentage of decoding completed
- */
- void imageProgress(ImageWriter source, float percentageDone);
-
- /**
- * Reports that a thumbnail write operation has started.
- *
- * @param source the <code>ImageWriter</code> object calling this method
- * @param imageIndex the index of the image being written
- */
- void imageStarted(ImageWriter source, int imageIndex);
-
- /**
- * Reports that a thumbnail write operation has completed.
- *
- * @param source the <code>ImageWriter</code> object calling this method
- */
- void thumbnailComplete(ImageWriter source);
-
- /**
- * Reports the approximate percentage of completion of a thumbnail write
- * operation.
- *
- * @param source the <code>ImageWriter</code> object calling this method
- * @param percentageDone the approximate percentage of decoding completed
- */
- void thumbnailProgress(ImageWriter source, float percentageDone);
-
- /**
- * Reports that a thumbnail write operation is beginning.
- *
- * @param source the <code>ImageWriter</code> object calling this method
- * @param imageIndex the index of the image being written
- * @param thumnailIndex the index of the thumbnail being written
- */
- void thumbnailStarted(ImageWriter source, int imageIndex, int thumnailIndex);
-
- /**
- * Reports that an image write operation is aborted.
- *
- * @param source the <code>ImageWriter</code> object calling this method
- */
- void writeAborted(ImageWriter source);
-}
diff --git a/libjava/javax/imageio/event/IIOWriteWarningListener.java b/libjava/javax/imageio/event/IIOWriteWarningListener.java
deleted file mode 100644
index 3c4e3bd99de..00000000000
--- a/libjava/javax/imageio/event/IIOWriteWarningListener.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* IIOWriteWarningListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.event;
-
-import java.util.EventListener;
-
-import javax.imageio.ImageWriter;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface IIOWriteWarningListener extends EventListener
-{
- /**
- * Reports the occurrence of a non-fatal error in encoding.
- * Encoding will continue after this method is called.
- *
- * @param source the <code>ImageWriter</code> object calling this method
- * @param imageIndex the index of the image generating this warning,
- * starting with 0
- * @param warning the warning
- */
- void warningOccurred(ImageWriter source, int imageIndex, String warning);
-}
diff --git a/libjava/javax/imageio/metadata/IIOAttr.java b/libjava/javax/imageio/metadata/IIOAttr.java
deleted file mode 100644
index 0c1d3d2ef3f..00000000000
--- a/libjava/javax/imageio/metadata/IIOAttr.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/* IIOAttr.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.metadata;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * Simple Attr node for metadata trees
- *
- * @author jlquinn
- */
-class IIOAttr implements Attr
-{
- String name;
- String value;
- IIOMetadataNode owner;
-
- public IIOAttr(String name, String value, IIOMetadataNode owner)
- {
- this.name = name;
- this.value = value;
- this.owner = owner;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Attr#getName()
- */
- public String getName()
- {
- return name;
- }
-
- public TypeInfo getSchemaTypeInfo()
- {
- throw new Error("not implemented");
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Attr#getSpecified()
- */
- public boolean getSpecified()
- {
- // I don't think there can be default attrs in metadata
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Attr#getValue()
- */
- public String getValue()
- {
- return value;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Attr#setValue(java.lang.String)
- */
- public void setValue(String value) throws DOMException
- {
- this.value = value;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Attr#getOwnerElement()
- */
- public Element getOwnerElement()
- {
- return owner;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNodeName()
- */
- public String getNodeName()
- {
- return name;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNodeValue()
- */
- public String getNodeValue() throws DOMException
- {
- return value;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#setNodeValue(java.lang.String)
- */
- public void setNodeValue(String nodeValue) throws DOMException
- {
- this.value = nodeValue;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNodeType()
- */
- public short getNodeType()
- {
- return ATTRIBUTE_NODE;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getParentNode()
- */
- public Node getParentNode()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getChildNodes()
- */
- public NodeList getChildNodes()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getFirstChild()
- */
- public Node getFirstChild()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getLastChild()
- */
- public Node getLastChild()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getPreviousSibling()
- */
- public Node getPreviousSibling()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNextSibling()
- */
- public Node getNextSibling()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getAttributes()
- */
- public NamedNodeMap getAttributes()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getOwnerDocument()
- */
- public Document getOwnerDocument()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
- */
- public Node insertBefore(Node newChild, Node refChild) throws DOMException
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
- */
- public Node replaceChild(Node newChild, Node oldChild) throws DOMException
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#removeChild(org.w3c.dom.Node)
- */
- public Node removeChild(Node oldChild) throws DOMException
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#appendChild(org.w3c.dom.Node)
- */
- public Node appendChild(Node newChild) throws DOMException
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#hasChildNodes()
- */
- public boolean hasChildNodes()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#cloneNode(boolean)
- */
- public Node cloneNode(boolean deep)
- {
- return new IIOAttr(name, value, owner);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#normalize()
- */
- public void normalize()
- {
- }
-
- public boolean isDefaultNamespace(String namespaceURI)
- {
- throw new Error("not implemented");
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#isSupported(java.lang.String, java.lang.String)
- */
- public boolean isSupported(String feature, String version)
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNamespaceURI()
- */
- public String getNamespaceURI()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getPrefix()
- */
- public String getPrefix()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#setPrefix(java.lang.String)
- */
- public void setPrefix(String prefix) throws DOMException
- {
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getLocalName()
- */
- public String getLocalName()
- {
- return name;
- }
-
- public Object getUserData(String key)
- {
- throw new Error("not implemented");
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#hasAttributes()
- */
- public boolean hasAttributes()
- {
- return false;
- }
-
- public boolean isId()
- {
- throw new Error("not implemented");
- }
-
- public String lookupNamespaceURI(String prefix)
- {
- throw new Error("not implemented");
- }
-
- public String lookupPrefix(String namespaceURI)
- {
- throw new Error("not implemented");
- }
-
- public Object setUserData(String key, Object data, UserDataHandler handler)
- {
- throw new Error("not implemented");
- }
-
- public String getBaseURI()
- {
- throw new Error("not implemented");
- }
-
- public String getTextContent()
- {
- throw new Error("not implemented");
- }
-
- public void setTextContent(String textContent)
- {
- throw new Error("not implemented");
- }
-
- public short compareDocumentPosition(Node other)
- throws DOMException
- {
- throw new Error("not implemented");
- }
-
- public Object getFeature(String feature, String version)
- {
- throw new Error("not implemented");
- }
-
- public boolean isEqualNode(Node other)
- {
- throw new Error("not implemented");
- }
-
- public boolean isSameNode(Node other)
- {
- throw new Error("not implemented");
- }
-}
diff --git a/libjava/javax/imageio/metadata/IIOInvalidTreeException.java b/libjava/javax/imageio/metadata/IIOInvalidTreeException.java
deleted file mode 100644
index 18d5bf617b1..00000000000
--- a/libjava/javax/imageio/metadata/IIOInvalidTreeException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* IIOInvalidTreeException.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.metadata;
-
-import javax.imageio.IIOException;
-
-import org.w3c.dom.Node;
-
-public class IIOInvalidTreeException extends IIOException
-{
- private static final long serialVersionUID = -1314083172544132777L;
-
- protected Node offendingNode;
-
- public IIOInvalidTreeException(String message, Node offendingNode)
- {
- super(message);
- this.offendingNode = offendingNode;
- }
-
- public IIOInvalidTreeException(String message, Throwable cause,
- Node offendingNode)
- {
- super(message, cause);
- this.offendingNode = offendingNode;
- }
-
- public Node getOffendingNode()
- {
- return offendingNode;
- }
-}
diff --git a/libjava/javax/imageio/metadata/IIOMetadata.java b/libjava/javax/imageio/metadata/IIOMetadata.java
deleted file mode 100644
index d727e1d1e51..00000000000
--- a/libjava/javax/imageio/metadata/IIOMetadata.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/* IIOMetadata.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.metadata;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class IIOMetadata
-{
- protected IIOMetadataController controller;
- protected IIOMetadataController defaultController;
- protected String[] extraMetadataFormatClassNames;
- protected String[] extraMetadataFormatNames;
- protected String nativeMetadataFormatClassName;
- protected String nativeMetadataFormatName;
- protected boolean standardFormatSupported;
-
- /**
- * Creates a <code>IIOMetaData</code> object.
- */
- protected IIOMetadata()
- {
- // Do nothing here.
- }
-
- /**
- * Creates a <code>IIOMetaData</code> object with the given arguments.
- *
- * @param standardMetadataFormatSupported
- * @param nativeMetadataFormatName
- * @param nativeMetadataFormatClassName
- * @param extraMetadataFormatNames
- * @param extraMetadataFormatClassNames
- *
- * @throws IllegalArgumentException if extraMetadataFormatNames has length of
- * zero or extraMetadataFormatNames and extraMetadataFormatClassNames are
- * neither both null, not have the same length
- */
- protected IIOMetadata(boolean standardMetadataFormatSupported,
- String nativeMetadataFormatName,
- String nativeMetadataFormatClassName,
- String[] extraMetadataFormatNames,
- String[] extraMetadataFormatClassNames)
- {
- if (extraMetadataFormatNames != null
- && extraMetadataFormatNames.length == 0)
- throw new IllegalArgumentException
- ("extraMetadataFormatNames may not be empty");
-
- if (((extraMetadataFormatNames == null)
- && (extraMetadataFormatClassNames != null))
- || ((extraMetadataFormatNames != null)
- && (extraMetadataFormatClassNames == null))
- || ((extraMetadataFormatNames != null)
- && (extraMetadataFormatClassNames != null)
- && (extraMetadataFormatNames.length !=
- extraMetadataFormatClassNames.length)))
- throw new IllegalArgumentException
- ("extraMetadataFormatNames and extraMetadataFormatClassNames " +
- "have different lengths");
-
- this.standardFormatSupported = standardMetadataFormatSupported;
- this.nativeMetadataFormatName = nativeMetadataFormatName;
- this.nativeMetadataFormatClassName = nativeMetadataFormatClassName;
- this.extraMetadataFormatNames = extraMetadataFormatNames;
- this.extraMetadataFormatClassNames = extraMetadataFormatClassNames;
- }
-
- public boolean activateController()
- {
- if (! hasController())
- return false;
-
- return getDefaultController().activate(this);
- }
-
- public IIOMetadataController getController()
- {
- return controller;
- }
-
- public IIOMetadataController getDefaultController()
- {
- return defaultController;
- }
-
- public String[] getExtraMetadataFormatNames()
- {
- return (String[]) extraMetadataFormatNames.clone();
- }
-
- public IIOMetadataFormat getMetadataFormat(String formatName)
- {
- if (formatName == null)
- throw new IllegalArgumentException("formatName may not be null");
-
- String formatClassName = null;
-
- if (isStandardMetadataFormatSupported()
- && formatName.equals(nativeMetadataFormatName))
- formatClassName = nativeMetadataFormatClassName;
- else
- {
- String[] extraFormatNames = getExtraMetadataFormatNames();
-
- for (int i = extraFormatNames.length - 1; i >= 0; --i)
- if (extraFormatNames[i].equals(formatName))
- {
- formatClassName = extraFormatNames[i];
- break;
- }
- }
-
- if (formatClassName == null)
- throw new IllegalArgumentException("unknown format");
-
- IIOMetadataFormat format;
-
- try
- {
- format = (IIOMetadataFormat) Class.forName(formatClassName)
- .newInstance();
- }
- catch (Exception e)
- {
- IllegalStateException ise = new IllegalStateException();
- ise.initCause(e);
- throw ise;
- }
-
- return format;
- }
-
- public String[] getMetadataFormatNames()
- {
- String[] formatNames = getExtraMetadataFormatNames();
-
- if (isStandardMetadataFormatSupported())
- {
- // Combine native metadata format name and extra metadata format names
- // into one String array.
- String[] tmp = new String[formatNames.length + 1];
- tmp[0] = getNativeMetadataFormatName();
-
- for (int i = 1; i < tmp.length; ++i)
- tmp[i] = formatNames[i - 1];
-
- formatNames = tmp;
- }
-
- return formatNames;
- }
-
- public String getNativeMetadataFormatName()
- {
- return nativeMetadataFormatName;
- }
-
- public boolean hasController()
- {
- return getController() != null;
- }
-
- public abstract boolean isReadOnly();
-
- public boolean isStandardMetadataFormatSupported()
- {
- return standardFormatSupported;
- }
-
- public abstract void reset();
-
- public void setController(IIOMetadataController controller)
- {
- this.controller = controller;
- }
-}
diff --git a/libjava/javax/imageio/metadata/IIOMetadataController.java b/libjava/javax/imageio/metadata/IIOMetadataController.java
deleted file mode 100644
index 86e544386ee..00000000000
--- a/libjava/javax/imageio/metadata/IIOMetadataController.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* IIOMetadataController.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.metadata;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface IIOMetadataController
-{
- boolean activate(IIOMetadata metadata);
-}
diff --git a/libjava/javax/imageio/metadata/IIOMetadataFormat.java b/libjava/javax/imageio/metadata/IIOMetadataFormat.java
deleted file mode 100644
index 76e0950a3df..00000000000
--- a/libjava/javax/imageio/metadata/IIOMetadataFormat.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/* IIOMetadataFormat.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.metadata;
-
-import java.util.Locale;
-
-import javax.imageio.ImageTypeSpecifier;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface IIOMetadataFormat
-{
- int CHILD_POLICY_ALL = 1;
- int CHILD_POLICY_CHOICE = 3;
- int CHILD_POLICY_EMPTY = 0;
- int CHILD_POLICY_MAX = 5;
- int CHILD_POLICY_REPEAT = 5;
- int CHILD_POLICY_SEQUENCE = 4;
- int CHILD_POLICY_SOME = 2;
- int DATATYPE_BOOLEAN = 1;
- int DATATYPE_DOUBLE = 4;
- int DATATYPE_FLOAT = 3;
- int DATATYPE_INTEGER = 2;
- int DATATYPE_STRING = 0;
- int VALUE_ARBITRARY = 1;
- int VALUE_ENUMERATION = 16;
- int VALUE_LIST = 32;
- int VALUE_NONE = 0;
- int VALUE_RANGE = 2;
- int VALUE_RANGE_MAX_INCLUSIVE = 10;
- int VALUE_RANGE_MAX_INCLUSIVE_MASK = 8;
- int VALUE_RANGE_MIN_INCLUSIVE = 6;
- int VALUE_RANGE_MIN_INCLUSIVE_MASK = 4;
- int VALUE_RANGE_MIN_MAX_INCLUSIVE = 14;
-
- boolean canNodeAppear (String elementName, ImageTypeSpecifier imageType);
-
- int getAttributeDataType (String elementName, String attrName);
-
- String getAttributeDefaultValue (String elementName, String attrName);
-
- String getAttributeDescription (String elementName, String attrName, Locale locale);
-
- String[] getAttributeEnumerations (String elementName, String attrName);
-
- int getAttributeListMaxLength (String elementName, String attrName);
-
- int getAttributeListMinLength (String elementName, String attrName);
-
- String getAttributeMaxValue (String elementName, String attrName);
-
- String getAttributeMinValue (String elementName, String attrName);
-
- String[] getAttributeNames (String elementName);
-
- int getAttributeValueType (String elementName, String attrName);
-
- String[] getChildNames (String elementName);
-
- int getChildPolicy (String elementName);
-
- String getElementDescription (String elementName, Locale locale);
-
- int getElementMaxChildren (String elementName);
-
- int getElementMinChildren (String elementName);
-
- int getObjectArrayMaxLength (String elementName);
-
- int getObjectArrayMinLength (String elementName);
-
- Class getObjectClass (String elementName);
-
- Object getObjectDefaultValue (String elementName);
-
- Object[] getObjectEnumerations (String elementName);
-
- Comparable getObjectMaxValue (String elementName);
-
- Comparable getObjectMinValue (String elementName);
-
- int getObjectValueType (String elementName);
-
- String getRootName();
-
- boolean isAttributeRequired (String elementName, String attrName);
-}
diff --git a/libjava/javax/imageio/metadata/IIOMetadataFormatImpl.java b/libjava/javax/imageio/metadata/IIOMetadataFormatImpl.java
deleted file mode 100644
index 2ce8f9c3d4b..00000000000
--- a/libjava/javax/imageio/metadata/IIOMetadataFormatImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* IIOMetadataFormatImpl.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.metadata;
-
-public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat
-{
-}
diff --git a/libjava/javax/imageio/metadata/IIOMetadataNode.java b/libjava/javax/imageio/metadata/IIOMetadataNode.java
deleted file mode 100644
index d9e0983e94a..00000000000
--- a/libjava/javax/imageio/metadata/IIOMetadataNode.java
+++ /dev/null
@@ -1,592 +0,0 @@
-/* IIOMetadataNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.metadata;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.UserDataHandler;
-
-public class IIOMetadataNode
- implements Element, NodeList
-{
- private String name;
- private HashMap attrs = new HashMap();
- private List children = new ArrayList();
- private IIOMetadataNode parent;
- private Object obj;
-
- public IIOMetadataNode()
- {
- // Do nothing here.
- }
-
- public IIOMetadataNode(String nodename)
- {
- name = nodename;
- }
-
- public Object getUserObject()
- {
- return obj;
- }
-
- public void setUserObject(Object o)
- {
- obj = o;
- }
-
- public short compareDocumentPosition(Node other)
- throws DOMException
- {
- throw new Error("not implemented");
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#getAttribute(java.lang.String)
- */
- public String getAttribute(String name)
- {
- Attr anode = (Attr) attrs.get(name);
- return anode != null ? anode.getValue() : null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#getAttributeNode(java.lang.String)
- */
- public Attr getAttributeNode(String name)
- {
- String val = getAttribute(name);
- if (val != null)
- return new IIOAttr(name, val, this);
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#getAttributeNodeNS(java.lang.String, java.lang.String)
- */
- public Attr getAttributeNodeNS(String namespaceURI, String localName)
- {
- return getAttributeNode(localName);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#getAttributeNS(java.lang.String, java.lang.String)
- */
- public String getAttributeNS(String namespaceURI, String localName)
- {
- return getAttribute(localName);
- }
-
- public String getBaseURI()
- {
- throw new Error("not implemented");
- }
-
- // Recursive function for assembling a node list.
- private void getElementsRecurse(IIONodeList list, String name)
- {
- for (int i=0; i < children.size(); i++)
- {
- if (((Node)children.get(i)).getNodeName().equals(name))
- list.children.add(children.get(i));
- getElementsRecurse(list, name);
- }
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#getElementsByTagName(java.lang.String)
- */
- public NodeList getElementsByTagName(String name)
- {
- IIONodeList list = new IIONodeList();
- getElementsRecurse(list, name);
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#getElementsByTagNameNS(java.lang.String, java.lang.String)
- */
- public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
- {
- IIONodeList list = new IIONodeList();
- getElementsRecurse(list, name);
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#getTagName()
- */
- public String getTagName()
- {
- return name;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#hasAttribute(java.lang.String)
- */
- public boolean hasAttribute(String name)
- {
- return attrs.containsKey(name);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#hasAttributeNS(java.lang.String, java.lang.String)
- */
- public boolean hasAttributeNS(String namespaceURI, String localName)
- {
- return attrs.containsKey(localName);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#removeAttribute(java.lang.String)
- */
- public void removeAttribute(String name)
- {
- attrs.remove(name);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#removeAttributeNode(org.w3c.dom.Attr)
- */
- public Attr removeAttributeNode(Attr oldAttr)
- {
- return (Attr)attrs.remove(oldAttr.getName());
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#removeAttributeNS(java.lang.String, java.lang.String)
- */
- public void removeAttributeNS(String namespaceURI, String localName)
- {
- removeAttribute(localName);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#setAttribute(java.lang.String, java.lang.String)
- */
- public void setAttribute(String name, String value)
- {
- Attr attr = (Attr) getAttributeNode(name);
- if (attr != null)
- attr.setValue(value);
- else
- attrs.put(name, new IIOAttr(name, value, this));
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#setAttributeNode(org.w3c.dom.Attr)
- */
- public Attr setAttributeNode(Attr newAttr)
- {
- return (Attr)attrs.put(newAttr.getName(), newAttr);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#setAttributeNodeNS(org.w3c.dom.Attr)
- */
- public Attr setAttributeNodeNS(Attr newAttr)
- {
- return (Attr)attrs.put(newAttr.getName(), newAttr);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#setAttributeNS(java.lang.String, java.lang.String, java.lang.String)
- */
- public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
- {
- setAttribute(qualifiedName, value);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NodeList#getLength()
- */
- public int getLength()
- {
- return children.size();
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NodeList#item(int)
- */
- public Node item(int index)
- {
- if (index < children.size())
- return (Node)children.get(index);
- else
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#appendChild(org.w3c.dom.Node)
- */
- public Node appendChild(Node newChild)
- {
- if (newChild == null)
- throw new IllegalArgumentException("Child node is null");
-
- IIOMetadataNode child = (IIOMetadataNode) newChild;
-
- children.add(child);
- child.parent = this;
- return this;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#cloneNode(boolean)
- */
- public Node cloneNode(boolean deep)
- {
- IIOMetadataNode newnode = new IIOMetadataNode(name);
- newnode.parent = null;
- newnode.obj = obj;
- if (deep)
- {
- for (int i=0; i < children.size(); i++)
- newnode.children.add(((Node)children.get(i)).cloneNode(deep));
- }
-
- // clone attrs
- for (Iterator it = attrs.values().iterator(); it.hasNext();)
- {
- IIOAttr attr = (IIOAttr)it.next();
- newnode.attrs.put(attr.name, attr.cloneNode(deep));
- attr.owner = newnode;
- }
-
- return newnode;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getAttributes()
- */
- public NamedNodeMap getAttributes()
- {
- return new IIONamedNodeMap(attrs);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getChildNodes()
- */
- public NodeList getChildNodes()
- {
- return this;
- }
-
- public Object getFeature(String feature, String version)
- {
- throw new Error("not implemented");
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getFirstChild()
- */
- public Node getFirstChild()
- {
- return (children.size() > 0) ? (Node)children.get(0) : null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getLastChild()
- */
- public Node getLastChild()
- {
- return (children.size() > 0) ? (Node)children.get(children.size() - 1)
- : null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getLocalName()
- */
- public String getLocalName()
- {
- return name;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNamespaceURI()
- */
- public String getNamespaceURI()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNextSibling()
- */
- public Node getNextSibling()
- {
- // If this op needs to be faster, add links to prev and next nodes.
- if (parent == null) return null;
- int idx = parent.children.indexOf(this);
- return (idx == parent.children.size() - 1) ? null
- : (Node)parent.children.get(idx + 1);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNodeName()
- */
- public String getNodeName()
- {
- return name;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNodeType()
- */
- public short getNodeType()
- {
- return ELEMENT_NODE;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNodeValue()
- */
- public String getNodeValue()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getOwnerDocument()
- */
- public Document getOwnerDocument()
- {
- // IOMetadataNodes have no owner
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getParentNode()
- */
- public Node getParentNode()
- {
- return parent;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getPrefix()
- */
- public String getPrefix()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getPreviousSibling()
- */
- public Node getPreviousSibling()
- {
- // If this op needs to be faster, add links to prev and next nodes.
- if (parent == null) return null;
- int idx = parent.children.indexOf(this);
- return (idx == 0) ? null
- : (Node)parent.children.get(idx - 1);
- }
-
- public TypeInfo getSchemaTypeInfo()
- {
- throw new Error("not implemented");
- }
-
- public String getTextContent()
- throws DOMException
- {
- throw new Error("not implemented");
- }
-
- public Object getUserData(String key)
- {
- throw new Error("not implemented");
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#hasAttributes()
- */
- public boolean hasAttributes()
- {
- return !attrs.isEmpty();
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#hasChildNodes()
- */
- public boolean hasChildNodes()
- {
- return !children.isEmpty();
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
- */
- public Node insertBefore(Node newChild, Node refChild)
- {
- if (newChild == null)
- throw new IllegalArgumentException();
-
- int idx = children.indexOf(refChild);
- if (idx == -1)
- children.add(newChild);
- else
- children.add(idx, newChild);
- ((IIOMetadataNode)newChild).parent = this;
-
- return newChild;
- }
-
- public boolean isDefaultNamespace(String namespaceURI)
- {
- throw new Error("not implemented");
- }
-
- public boolean isEqualNode(Node arg)
- {
- throw new Error("not implemented");
- }
-
- public boolean isSameNode(Node other)
- {
- return this == other;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#isSupported(java.lang.String, java.lang.String)
- */
- public boolean isSupported(String feature, String version)
- {
- // No DOM features are supported
- return false;
- }
-
- public String lookupNamespaceURI(String prefix)
- {
- throw new Error("not implemented");
- }
-
- public String lookupPrefix(String namespaceURI)
- {
- throw new Error("not implemented");
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#normalize()
- */
- public void normalize()
- {
- // No text nodes so no action
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#removeChild(org.w3c.dom.Node)
- */
- public Node removeChild(Node oldChild)
- {
- if (oldChild == null)
- throw new IllegalArgumentException();
- children.remove(oldChild);
- ((IIOMetadataNode)oldChild).parent = null;
-
- return oldChild;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
- */
- public Node replaceChild(Node newChild, Node oldChild)
- {
- if (newChild == null)
- throw new IllegalArgumentException();
- children.set(children.indexOf(oldChild), newChild);
- ((IIOMetadataNode)oldChild).parent = null;
- return oldChild;
- }
-
- public void setIdAttribute(String name, boolean isId)
- throws DOMException
- {
- throw new Error("not implemented");
- }
-
- public void setIdAttributeNode(Attr idAttr, boolean isId)
- throws DOMException
- {
- throw new Error("not implemented");
- }
-
- public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
- throws DOMException
- {
- throw new Error("not implemented");
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#setNodeValue(java.lang.String)
- */
- public void setNodeValue(String nodeValue) throws DOMException
- {
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#setPrefix(java.lang.String)
- */
- public void setPrefix(String prefix)
- {
- }
-
- public void setTextContent(String textContent)
- throws DOMException
- {
- throw new Error("not implemented");
- }
-
- public Object setUserData(String key, Object data, UserDataHandler handler)
- {
- throw new Error("not implemented");
- }
-}
diff --git a/libjava/javax/imageio/metadata/IIONamedNodeMap.java b/libjava/javax/imageio/metadata/IIONamedNodeMap.java
deleted file mode 100644
index 92da28d5bb2..00000000000
--- a/libjava/javax/imageio/metadata/IIONamedNodeMap.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* IIONamedNodeMap.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.metadata;
-
-import java.util.HashMap;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Simple NamedNodeMap class for IIOMetadataNode.
- *
- * @author jlquinn
- */
-class IIONamedNodeMap implements NamedNodeMap
-{
- HashMap attrs;
-
- /**
- * @param attrs
- * @param node
- */
- public IIONamedNodeMap(HashMap attrs)
- {
- this.attrs = attrs;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NamedNodeMap#getNamedItem(java.lang.String)
- */
- public Node getNamedItem(String name)
- {
- return (Node)attrs.get(name);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NamedNodeMap#setNamedItem(org.w3c.dom.Node)
- */
- public Node setNamedItem(Node arg) throws DOMException
- {
- if (arg instanceof IIOAttr)
- {
- IIOAttr attr = (IIOAttr) arg;
- // The only code that can successfully do this is in this package.
- if (attr.owner != null)
- throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, "");
- return (Node)attrs.put(attr.name, attr);
- }
- // Anything else gets treated as an invalid op.
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "");
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NamedNodeMap#removeNamedItem(java.lang.String)
- */
- public Node removeNamedItem(String name) throws DOMException
- {
- return (Node)attrs.remove(name);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NamedNodeMap#item(int)
- */
- public Node item(int index)
- {
- return (Node)attrs.values().toArray()[index];
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NamedNodeMap#getLength()
- */
- public int getLength()
- {
- return attrs.size();
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NamedNodeMap#getNamedItemNS(java.lang.String, java.lang.String)
- */
- public Node getNamedItemNS(String namespaceURI, String localName)
- {
- return getNamedItem(localName);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NamedNodeMap#setNamedItemNS(org.w3c.dom.Node)
- */
- public Node setNamedItemNS(Node arg) throws DOMException
- {
- return setNamedItem(arg);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NamedNodeMap#removeNamedItemNS(java.lang.String, java.lang.String)
- */
- public Node removeNamedItemNS(String namespaceURI, String localName)
- throws DOMException
- {
- return removeNamedItem(localName);
- }
-
-}
diff --git a/libjava/javax/imageio/metadata/IIONodeList.java b/libjava/javax/imageio/metadata/IIONodeList.java
deleted file mode 100644
index 395d261b6c6..00000000000
--- a/libjava/javax/imageio/metadata/IIONodeList.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* IIOAttr.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.metadata;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Simple NodeList implementation for IIOMetadataNode.
- *
- * @author jlquinn
- *
- */
-class IIONodeList implements NodeList
-{
- List children = new ArrayList();
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NodeList#item(int)
- */
- public Node item(int index)
- {
- return (index < children.size()) ? (Node)children.get(index) : null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NodeList#getLength()
- */
- public int getLength()
- {
- return children.size();
- }
-
-}
diff --git a/libjava/javax/imageio/spi/IIORegistry.java b/libjava/javax/imageio/spi/IIORegistry.java
deleted file mode 100644
index a0e11129081..00000000000
--- a/libjava/javax/imageio/spi/IIORegistry.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* IIORegistry.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.spi;
-
-import gnu.classpath.ServiceFactory;
-import gnu.java.awt.ClasspathToolkit;
-
-import java.awt.Toolkit;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-
-public final class IIORegistry extends ServiceRegistry
-{
- private static final HashSet defaultCategories = new HashSet();
-
- private static HashMap instances = new HashMap();
-
- static
- {
- defaultCategories.add(ImageReaderSpi.class);
- defaultCategories.add(ImageWriterSpi.class);
- defaultCategories.add(ImageTranscoderSpi.class);
- defaultCategories.add(ImageInputStreamSpi.class);
- defaultCategories.add(ImageOutputStreamSpi.class);
- }
-
- public static synchronized IIORegistry getDefaultInstance()
- {
- ThreadGroup group = Thread.currentThread().getThreadGroup();
- IIORegistry registry = (IIORegistry) instances.get(group);
-
- if (registry == null)
- {
- registry = new IIORegistry();
- instances.put(group, registry);
- }
-
- return registry;
- }
-
- private IIORegistry()
- {
- super(defaultCategories.iterator());
-
- // XXX: Register built-in Spis here.
-
- Toolkit toolkit = Toolkit.getDefaultToolkit();
- if (toolkit instanceof ClasspathToolkit)
- ((ClasspathToolkit)toolkit).registerImageIOSpis(this);
-
- registerApplicationClasspathSpis();
- }
-
- /**
- * Registers all available service providers found on the application
- * classpath.
- */
- public void registerApplicationClasspathSpis()
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Iterator categories = getCategories();
-
- while (categories.hasNext())
- {
- Class category = (Class) categories.next();
- Iterator providers = ServiceFactory.lookupProviders(category, loader);
-
- while (providers.hasNext())
- registerServiceProvider((IIOServiceProvider) providers.next());
- }
- }
-}
diff --git a/libjava/javax/imageio/spi/IIOServiceProvider.java b/libjava/javax/imageio/spi/IIOServiceProvider.java
deleted file mode 100644
index 1ec59d5263e..00000000000
--- a/libjava/javax/imageio/spi/IIOServiceProvider.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/* IIOServiceProvider.java -- General service provider for image I/O.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.spi;
-
-import java.util.Locale;
-
-
-/**
- * An abstract superclass for service providers that perform image I/O.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class IIOServiceProvider
- implements RegisterableService
-{
- /**
- * The vendor of this service provider, or <code>null</code> if the
- * subclass constructor did not set this field.
- *
- * @see #getVendorName()
- */
- protected String vendorName;
-
-
- /**
- * The version of this service provider, or <code>null</code> if the
- * subclass constructor did not set this field.
- *
- * @see #getVersion()
- */
- protected String version;
-
-
- /**
- * Constructs a general <code>IIOServiceProvider</code>, given the
- * vendor name and a version string.
- *
- * @throws IllegalArgumentException if <code>vendorName</code>
- * or <code>version</code> is <code>null</code>.
- */
- public IIOServiceProvider(String vendorName, String version)
- {
- if (vendorName == null || version == null)
- throw new IllegalArgumentException();
-
- this.vendorName = vendorName;
- this.version = version;
- }
-
-
- /**
- * Constructs a general <code>IIOServiceProvider</code> without
- * specifying a vendor name and a version string. The subclass
- * constructor should set the {@link #vendorName} and {@link
- * #version} to non-null values.
- */
- public IIOServiceProvider()
- {
- }
-
-
- /**
- * Informs this service provider that it has been registered in a
- * {@link ServiceRegistry}. If this provider gets registered as an
- * implementor for several service categories, its
- * <code>onRegistration</code> method will be called multiple times.
- * The default implementation does nothing.
- *
- * @param registry the registry to which this service provider has
- * been added.
- *
- * @param category the service category for which this provider has
- * been registered as an implementor.
- */
- public void onRegistration(ServiceRegistry registry, Class category)
- {
- }
-
-
- /**
- * Informs this service provider that it has been de-registered from
- * a {@link ServiceRegistry}. If this provider had been registered
- * as an implementor for several service categories, its
- * <code>onDeregistration</code> method will be called multiple
- * times. The default implementation does nothing.
- *
- * @param registry the registry from which this service provider has
- * been removed.
- *
- * @param category the service category for which this provider has
- * been registered as an implementor.
- */
- public void onDeregistration(ServiceRegistry registry, Class category)
- {
- }
-
-
- /**
- * Returns the name of the vendor of this service provider.
- */
- public String getVendorName()
- {
- return vendorName;
- }
-
-
- /**
- * Returns an identifier string for the version of this service
- * provider.
- */
- public String getVersion()
- {
- return version;
- }
-
-
- /**
- * Returns a short description of this service provider that can be
- * presented to a human user.
- *
- * @param locale the locale for which the description string should
- * be localized.
- */
- public abstract String getDescription(Locale locale);
-}
diff --git a/libjava/javax/imageio/spi/ImageInputStreamSpi.java b/libjava/javax/imageio/spi/ImageInputStreamSpi.java
deleted file mode 100644
index 51c58395fc0..00000000000
--- a/libjava/javax/imageio/spi/ImageInputStreamSpi.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/* ImageInputStreamSpi.java -- Service provider for image input streams.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.spi;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.imageio.stream.ImageInputStream;
-
-/**
- * An abstract superclass for service providers that create
- * {@linkplain javax.imageio.stream.ImageInputStream image input
- * streams} for a file, URL, byte array or any other source.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ImageInputStreamSpi
- extends IIOServiceProvider
-{
- /**
- * Indicates which kind of input is processable by the streams
- * created by {@link #createInputStreamInstance(Object)}.
- */
- protected Class inputClass;
-
-
- /**
- * Constructs a service provider for image input streams, given no
- * parameters. It is up to the sub-class to set {@link #vendorName},
- * {@link #version} and {@link #inputClass} to non-null values.
- */
- protected ImageInputStreamSpi()
- {
- }
-
-
- /**
- * Constructs a service provider for image input streams, given the
- * vendor name and a version string.
- *
- * @throws IllegalArgumentException if <code>vendorName</code>
- * or <code>version</code> is <code>null</code>.
- */
- public ImageInputStreamSpi(String vendorName, String version,
- Class inputClass)
- {
- super(vendorName, version);
- this.inputClass = inputClass;
- }
-
-
- /**
- * Determines which kind of input is processable by the streams
- * created by {@link #createInputStreamInstance(Object)}.
- */
- public Class getInputClass()
- {
- return inputClass;
- }
-
-
- /**
- * Determines whether <code>ImageInputStreams</code> created
- * by this service provider benefit from using a cache file.
- *
- * <p>The default behavior is to return <code>false</code>.
- *
- * @return <code>true</code> if the created streams are faster or
- * need less memory when a cache file is being used;
- * <code>false</code> if no positive effect results from the cache
- * file.
- */
- public boolean canUseCacheFile()
- {
- return false;
- }
-
-
- /**
- * Determines whether <code>ImageInputStreams</code> created
- * by this service provider require the use of a cache file.
- *
- * <p>The default behavior is to return <code>false</code>.
- *
- * @return <code>true</code> if the created streams can only work
- * when a cache file is being used; <code>false</code> if no cache
- * file is needed.
- */
- public boolean needsCacheFile()
- {
- return false;
- }
-
-
- public abstract ImageInputStream createInputStreamInstance(Object input,
- boolean useCache,
- File cacheDir)
- throws IOException;
-
-
- public ImageInputStream createInputStreamInstance(Object input)
- throws IOException
- {
- return createInputStreamInstance(input, canUseCacheFile(), null);
- }
-}
diff --git a/libjava/javax/imageio/spi/ImageOutputStreamSpi.java b/libjava/javax/imageio/spi/ImageOutputStreamSpi.java
deleted file mode 100644
index 0f1d3cdb2c1..00000000000
--- a/libjava/javax/imageio/spi/ImageOutputStreamSpi.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/* ImageOutputStreamSpi.java -- Service provider for image output streams.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.spi;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.imageio.stream.ImageOutputStream;
-
-/**
- * An abstract superclass for service providers that create
- * {@linkplain javax.imageio.stream.ImageOutputStream image output
- * streams} for a file, URL, byte array or any other target.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ImageOutputStreamSpi
- extends IIOServiceProvider
-{
- /**
- * Indicates which kind of output is produced by the streams
- * created by {@link #createOutputStreamInstance(Object)}.
- */
- protected Class outputClass;
-
-
- /**
- * Constructs a service provider for image output streams, given no
- * parameters. It is up to the sub-class to set {@link #vendorName},
- * {@link #version} and {@link #outputClass} to non-null values.
- */
- protected ImageOutputStreamSpi()
- {
- }
-
-
- /**
- * Constructs a service provider for image output streams, given the
- * vendor name, a version string and the kind of producable output.
- *
- * @throws IllegalArgumentException if <code>vendorName</code>
- * or <code>version</code> is <code>null</code>.
- */
- public ImageOutputStreamSpi(String vendorName, String version,
- Class outputClass)
- {
- super(vendorName, version);
- this.outputClass = outputClass;
- }
-
-
- /**
- * Determines which kind of output is produced by the streams
- * created by {@link #createOutputStreamInstance(Object)}.
- */
- public Class getOutputClass()
- {
- return outputClass;
- }
-
-
- /**
- * Determines whether <code>ImageOutputStreams</code> created
- * by this service provider benefit from using a cache file.
- *
- * <p>The default behavior is to return <code>false</code>.
- *
- * @return <code>true</code> if the created streams are faster or
- * need less memory when a cache file is being used;
- * <code>false</code> if no positive effect results from the cache
- * file.
- */
- public boolean canUseCacheFile()
- {
- return false;
- }
-
-
- /**
- * Determines whether <code>ImageOutputStreams</code> created
- * by this service provider require the use of a cache file.
- *
- * <p>The default behavior is to return <code>false</code>.
- *
- * @return <code>true</code> if the created streams can only work
- * when a cache file is being used; <code>false</code> if no cache
- * file is needed.
- */
- public boolean needsCacheFile()
- {
- return false;
- }
-
-
- public abstract ImageOutputStream createOutputStreamInstance(
- Object output, boolean useCache, File cacheDir)
- throws IOException;
-
-
- public ImageOutputStream createOutputStreamInstance(Object output)
- throws IOException
- {
- return createOutputStreamInstance(output, canUseCacheFile(), null);
- }
-}
diff --git a/libjava/javax/imageio/spi/ImageReaderSpi.java b/libjava/javax/imageio/spi/ImageReaderSpi.java
deleted file mode 100644
index e97d23940ca..00000000000
--- a/libjava/javax/imageio/spi/ImageReaderSpi.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* ImageReaderSpi.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.spi;
-
-import java.io.IOException;
-
-import javax.imageio.ImageReader;
-import javax.imageio.stream.ImageInputStream;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class ImageReaderSpi extends ImageReaderWriterSpi
-{
- public static final Class[] STANDARD_INPUT_TYPE =
- { ImageInputStream.class };
-
- protected Class[] inputTypes;
- protected String[] writerSpiNames;
-
- protected ImageReaderSpi()
- {
- // Do nothing here.
- }
-
- public ImageReaderSpi(String vendorName, String version, String[] names,
- String[] suffixes, String[] MIMETypes,
- String readerClassName, Class[] inputTypes,
- String[] writerSpiNames,
- boolean supportsStandardStreamMetadataFormat,
- String nativeStreamMetadataFormatName,
- String nativeStreamMetadataFormatClassName,
- String[] extraStreamMetadataFormatNames,
- String[] extraStreamMetadataFormatClassNames,
- boolean supportsStandardImageMetadataFormat,
- String nativeImageMetadataFormatName,
- String nativeImageMetadataFormatClassName,
- String[] extraImageMetadataFormatNames,
- String[] extraImageMetadataFormatClassNames)
- {
- super(vendorName, version, names, suffixes, MIMETypes, readerClassName,
- supportsStandardStreamMetadataFormat, nativeStreamMetadataFormatName,
- nativeStreamMetadataFormatClassName, extraStreamMetadataFormatNames,
- extraStreamMetadataFormatClassNames, supportsStandardImageMetadataFormat,
- nativeImageMetadataFormatName, nativeImageMetadataFormatClassName,
- extraImageMetadataFormatNames, extraImageMetadataFormatClassNames);
-
- if (inputTypes == null
- || inputTypes.length == 0)
- throw new IllegalArgumentException("inputTypes may not be null or empty");
-
- this.inputTypes = inputTypes;
- this.writerSpiNames = writerSpiNames;
- }
-
- public abstract boolean canDecodeInput(Object source)
- throws IOException;
-
- public ImageReader createReaderInstance()
- throws IOException
- {
- return createReaderInstance(null);
- }
-
- public abstract ImageReader createReaderInstance(Object extension)
- throws IOException;
-
- public String[] getImageWriterSpiNames()
- {
- return writerSpiNames;
- }
-
- public Class[] getInputTypes()
- {
- return inputTypes;
- }
-
- public boolean isOwnReader(ImageReader reader)
- {
- if (reader == null)
- throw new IllegalArgumentException("reader may not be null");
-
- return pluginClassName.equals(reader.getClass().getName());
- }
-}
diff --git a/libjava/javax/imageio/spi/ImageReaderWriterSpi.java b/libjava/javax/imageio/spi/ImageReaderWriterSpi.java
deleted file mode 100644
index 4aa7fd41272..00000000000
--- a/libjava/javax/imageio/spi/ImageReaderWriterSpi.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/* ImageReaderWriterSpi.java -- Superclass for image reader and writer spis.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.spi;
-
-
-/**
- * An abstract superclass that contains the common parts of {@link
- * javax.imageio.spi.ImageReaderSpi} and {@link
- * javax.imageio.spi.ImageWriterSpi}.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ImageReaderWriterSpi
- extends IIOServiceProvider
-{
- /**
- * The human-readable, localized names of the supported image
- * formats. This value should be non-<code>null</code> after
- * construction.
- *
- * @see #getFormatNames()
- */
- protected String[] names;
-
-
- /**
- * The file suffixes of the supported image formats. This value
- * should be non-<code>null</code> after construction.
- *
- * @see #getFileSuffixes()
- */
- protected String[] suffixes;
-
-
- /**
- * The MIME types of the supported image formats. This value
- * should be non-<code>null</code> after construction.
- *
- * @see #getMIMETypes()
- */
- protected String[] MIMETypes;
-
-
- /**
- * The fully qualified name of the class that implements the {@link
- * javax.imageio.ImageReader} or {@link javax.imageio.ImageWriter}
- * interface. This value should be non-<code>null</code> after
- * construction.
- *
- * @see #getPluginClassName()
- */
- protected String pluginClassName;
-
-
- /**
- * Indicates whether the per-stream {@linkplain
- * javax.imageio.metadata.IIOMetadata metadata objects} associated
- * with this plug-in support format
- * <code>&#x201c;javax_imageio_1.0&#x201d;</code> in their
- * <code>getAsTree</code> and <code>setAsTree</code> methods.
- *
- * @see #isStandardStreamMetadataFormatSupported()
- */
- protected boolean supportsStandardStreamMetadataFormat;
-
-
- /**
- * The name of the format that allows encoding all stream metadata
- * without loss, or <code>null</code> if this plug-in does not
- * provide a format that preserves all stream metadata.
- */
- protected String nativeStreamMetadataFormatName;
-
- protected String nativeStreamMetadataFormatClassName;
-
-
- /**
- * The names of additional formats for encoding stream metadata,
- * other than the {@linkplain
- * #isStandardStreamMetadataFormatSupported() standard} and the
- * {@linkplain #getNativeStreamMetadataFormatName() native} formats,
- * or <code>null</code> if this plug-in does not provide any extra
- * formats.
- */
- protected String[] extraStreamMetadataFormatNames;
-
-
- protected String[] extraStreamMetadataFormatClassNames;
-
-
- /**
- * Indicates whether the per-image {@linkplain
- * javax.imageio.metadata.IIOMetadata metadata objects} associated
- * with this plug-in support format
- * <code>&#x201c;javax_imageio_1.0&#x201d;</code> in their
- * <code>getAsTree</code> and <code>setAsTree</code> methods.
- *
- * @see #isStandardImageMetadataFormatSupported()
- */
- protected boolean supportsStandardImageMetadataFormat;
-
-
- /**
- * The name of the format that allows encoding all image metadata
- * without loss, or <code>null</code> if this plug-in does not
- * provide a format that preserves all image metadata.
- */
- protected String nativeImageMetadataFormatName;
-
- protected String nativeImageMetadataFormatClassName;
-
-
- /**
- * The names of additional formats for encoding image metadata,
- * other than the {@linkplain
- * #isStandardImageMetadataFormatSupported() standard} and the
- * {@linkplain #getNativeImageMetadataFormatName() native} formats,
- * or <code>null</code> if this plug-in does not provide any extra
- * formats.
- */
- protected String[] extraImageMetadataFormatNames;
-
-
- protected String[] extraImageMetadataFormatClassNames;
-
-
- /**
- * Constructs an <code>ImageReaderWriteSpi</code> instance, without
- * specifying a number of parameters. Constructors of concrete
- * subclasses must ensure that they set all inherited fields to
- * meaningful values.
- */
- public ImageReaderWriterSpi()
- {
- }
-
-
- /**
- * Constructs an <code>ImageReaderWriteSpi</code> instance,
- * specifying a number of parameters.
- *
- * @param names the human-readable, localized names of the supported
- * image formats, for example <code>[&#x201c;Tagged Image File
- * Format&#x201d;, &#x201c;Portable Network
- * Graphics&#x201d;]</code>.
- *
- * @param suffixes the file suffixes of the supported image formats,
- * for example <code>[&#x201c;tiff&#x201d;, &#x201c;tif&#x201d;,
- * &#x201c;png&#x201d;]</code>.
- *
- * @param MIMETypes the MIME types of the supported image formats,
- * for example <code>[&#x201c;image/tiff&#x201d;,
- * &#x201c;image/png&#x201d;]</code>.
- *
- * @param pluginClassName the fully qualified name of the class that
- * implements the {@link javax.imageio.ImageReader} or {@link
- * javax.imageio.ImageWriter} interface.
- *
- * @param supportsStandardStreamMetadataFormat whether the
- * per-stream {@linkplain javax.imageio.metadata.IIOMetadata
- * metadata objects} associated with this plug-in support format
- * <code>&#x201c;javax_imageio_1.0&#x201d;</code> in their
- * <code>getAsTree</code> and <code>setAsTree</code> methods.
- *
- * @param nativeStreamMetadataFormatName the name of the format that
- * allows encoding all stream metadata without loss, or
- * <code>null</code> if this plug-in does not provide a format that
- * preserves all stream metadata.
- *
- * @param extraStreamMetadataFormatNames the names of additional
- * formats for encoding stream metadata, other than the {@linkplain
- * #isStandardStreamMetadataFormatSupported() standard} and the
- * {@linkplain #getNativeStreamMetadataFormatName() native} formats,
- * or <code>null</code> if this plug-in does not provide any extra
- * formats.
- *
- * @param supportsStandardImageMetadataFormat whether the per-image
- * {@linkplain javax.imageio.metadata.IIOMetadata metadata objects}
- * associated with this plug-in support format
- * <code>&#x201c;javax_imageio_1.0&#x201d;</code> in their
- * <code>getAsTree</code> and <code>setAsTree</code> methods.
- *
- * @param nativeImageMetadataFormatName the name of the format that
- * allows encoding all image metadata without loss, or
- * <code>null</code> if this plug-in does not provide a format that
- * preserves all image metadata.
- *
- * @param extraImageMetadataFormatNames the names of additional
- * formats for encoding image metadata, other than the {@linkplain
- * #isStandardImageMetadataFormatSupported() standard} and the
- * {@linkplain #getNativeImageMetadataFormatName() native} formats,
- * or <code>null</code> if this plug-in does not provide any extra
- * formats.
- *
- * @throws IllegalArgumentException if <code>vendorName</code>
- * or <code>version</code> is <code>null</code>.
- */
- public ImageReaderWriterSpi(String vendorName, String version,
- String[] names, String[] suffixes,
- String[] MIMETypes, String pluginClassName,
- boolean supportsStandardStreamMetadataFormat,
- String nativeStreamMetadataFormatName,
- String nativeStreamMetadataFormatClassName,
- String[] extraStreamMetadataFormatNames,
- String[] extraStreamMetadataFormatClassNames,
- boolean supportsStandardImageMetadataFormat,
- String nativeImageMetadataFormatName,
- String nativeImageMetadataFormatClassName,
- String[] extraImageMetadataFormatNames,
- String[] extraImageMetadataFormatClassNames)
- {
- /* The inherited constructor will throw IllegalArgumentException
- * if one of its arguments is null.
- */
- super(vendorName, version);
-
- if (names == null || names.length == 0 || pluginClassName == null)
- throw new IllegalArgumentException();
-
- this.names = names;
- this.suffixes = suffixes;
- this.MIMETypes = MIMETypes;
- this.pluginClassName = pluginClassName;
-
- this.supportsStandardStreamMetadataFormat
- = supportsStandardStreamMetadataFormat;
-
- this.nativeStreamMetadataFormatName
- = nativeStreamMetadataFormatName;
-
- this.nativeStreamMetadataFormatClassName
- = nativeStreamMetadataFormatClassName;
-
- this.extraStreamMetadataFormatNames
- = extraStreamMetadataFormatNames;
-
- this.extraStreamMetadataFormatClassNames
- = extraStreamMetadataFormatClassNames;
-
- this.supportsStandardImageMetadataFormat
- = supportsStandardImageMetadataFormat;
-
- this.nativeImageMetadataFormatName
- = nativeImageMetadataFormatName;
-
- this.nativeImageMetadataFormatClassName
- = nativeImageMetadataFormatClassName;
-
- this.extraImageMetadataFormatNames
- = extraImageMetadataFormatNames;
-
- this.extraImageMetadataFormatClassNames
- = extraImageMetadataFormatClassNames;
- }
-
-
- /**
- * Returns the human-readable, localized names of the supported
- * image formats. For example, a plug-in might return an array with
- * the elements <code>[&#x201c;Tagged Image File Format&#x201d;,
- * &#x201c;Portable Network Graphics&#x201d;]</code>.
- */
- public String[] getFormatNames()
- {
- return (String[]) names.clone();
- }
-
-
- /**
- * Returns the file suffixes of the supported image formats, for
- * example <code>[&#x201c;tiff&#x201d;, &#x201c;tif&#x201d;,
- * &#x201c;png&#x201d;]</code>.
- */
- public String[] getFileSuffixes()
- {
- return suffixes;
- }
-
-
- /**
- * Returns the MIME types of the supported image formats, for
- * example <code>[&#x201c;image/tiff&#x201d;,
- * &#x201c;image/png&#x201d;]</code>.
- *
- * @return an array of MIME type strings, or <code>null</code> if
- * none of the supported formats has an associated MIME type.
- */
- public String[] getMIMETypes()
- {
- return MIMETypes;
- }
-
-
- /**
- * Returns the fully qualified name of the class that implements the
- * {@link javax.imageio.ImageReader} or {@link
- * javax.imageio.ImageWriter} interface.
- */
- public String getPluginClassName()
- {
- return pluginClassName;
- }
-
-
- /**
- * Returns whether the per-stream {@linkplain
- * javax.imageio.metadata.IIOMetadata metadata objects} associated
- * with this plug-in support format
- * <code>&#x201c;javax_imageio_1.0&#x201d;</code> in their
- * <code>getAsTree</code> and <code>setAsTree</code> methods.
- */
- public boolean isStandardStreamMetadataFormatSupported()
- {
- return supportsStandardStreamMetadataFormat;
- }
-
-
- /**
- * Returns the name of the format that allows encoding all stream
- * metadata without loss, or <code>null</code> if this plug-in does
- * not provide a format that preserves all stream metadata.
- *
- * @see #getNativeImageMetadataFormatName()
- */
- public String getNativeStreamMetadataFormatName()
- {
- return nativeStreamMetadataFormatName;
- }
-
-
- /**
- * Returns the names of additional formats for encoding stream
- * metadata, other than the {@linkplain
- * #isStandardStreamMetadataFormatSupported() standard} and the
- * {@linkplain #getNativeStreamMetadataFormatName() native} formats,
- * or <code>null</code> if this plug-in does not provide any extra
- * formats.
- *
- * @see #getExtraImageMetadataFormatNames()
- */
- public String[] getExtraStreamMetadataFormatNames()
- {
- return extraStreamMetadataFormatNames;
- }
-
-
- /**
- * Returns whether the per-image {@linkplain
- * javax.imageio.metadata.IIOMetadata metadata objects} associated
- * with this plug-in support format
- * <code>&#x201c;javax_imageio_1.0&#x201d;</code> in their
- * <code>getAsTree</code> and <code>setAsTree</code> methods.
- */
- public boolean isStandardImageMetadataFormatSupported()
- {
- return supportsStandardImageMetadataFormat;
- }
-
-
- /**
- * Returns the name of the format that allows encoding all image
- * metadata without loss, or <code>null</code> if this plug-in does
- * not provide a format that preserves all image metadata.
- *
- * @see #getNativeStreamMetadataFormatName()
- */
- public String getNativeImageMetadataFormatName()
- {
- return nativeImageMetadataFormatName;
- }
-
-
- /**
- * Returns the names of additional formats for encoding image
- * metadata, other than the {@linkplain
- * #isStandardImageMetadataFormatSupported() standard} and the
- * {@linkplain #getNativeImageMetadataFormatName() native} formats,
- * or <code>null</code> if this plug-in does not provide any extra
- * formats.
- *
- * @see #getExtraStreamMetadataFormatNames()
- */
- public String[] getExtraImageMetadataFormatNames()
- {
- return extraImageMetadataFormatNames;
- }
-}
diff --git a/libjava/javax/imageio/spi/ImageTranscoderSpi.java b/libjava/javax/imageio/spi/ImageTranscoderSpi.java
deleted file mode 100644
index 1c04ad20c88..00000000000
--- a/libjava/javax/imageio/spi/ImageTranscoderSpi.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ImageTranscoderSpi.java -- Factory for image metadata transcoders.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.spi;
-
-import javax.imageio.ImageTranscoder;
-
-
-/**
- * An abstract superclass for service providers that create
- * {@linkplain javax.imageio.ImageTranscoder image metadata
- * transcoders}.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ImageTranscoderSpi
- extends IIOServiceProvider
-{
- /**
- * Constructs a service provider for image metadata transcoders,
- * given no parameters. It is up to the sub-class to set {@link
- * #vendorName} and {@link #version} to non-null values.
- */
- protected ImageTranscoderSpi()
- {
- }
-
-
- /**
- * Constructs a service provider for image metadata transcoders,
- * given the vendor name and a version string.
- *
- * @throws IllegalArgumentException if <code>vendorName</code>
- * or <code>version</code> is <code>null</code>.
- */
- public ImageTranscoderSpi(String vendorName, String version)
- {
- super(vendorName, version);
- }
-
-
- public abstract String getReaderServiceProviderName();
-
- public abstract String getWriterServiceProviderName();
-
- public abstract ImageTranscoder createTranscoderInstance();
-}
diff --git a/libjava/javax/imageio/spi/ImageWriterSpi.java b/libjava/javax/imageio/spi/ImageWriterSpi.java
deleted file mode 100644
index 3ec52c51c23..00000000000
--- a/libjava/javax/imageio/spi/ImageWriterSpi.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/* ImageWriterSpi.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.spi;
-
-import java.awt.image.RenderedImage;
-import java.io.IOException;
-
-import javax.imageio.ImageTypeSpecifier;
-import javax.imageio.ImageWriter;
-import javax.imageio.stream.ImageOutputStream;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class ImageWriterSpi extends ImageReaderWriterSpi
-{
- public static final Class[] STANDARD_OUTPUT_TYPE =
- { ImageOutputStream.class };
-
- protected Class[] outputTypes;
- protected String[] readerSpiNames;
-
- protected ImageWriterSpi()
- {
- // Do nothing here.
- }
-
- public ImageWriterSpi(String vendorName, String version, String[] names,
- String[] suffixes, String[] MIMETypes,
- String writerClassName, Class[] outputTypes,
- String[] readerSpiNames,
- boolean supportsStandardStreamMetadataFormat,
- String nativeStreamMetadataFormatName,
- String nativeStreamMetadataFormatClassName,
- String[] extraStreamMetadataFormatNames,
- String[] extraStreamMetadataFormatClassNames,
- boolean supportsStandardImageMetadataFormat,
- String nativeImageMetadataFormatName,
- String nativeImageMetadataFormatClassName,
- String[] extraImageMetadataFormatNames,
- String[] extraImageMetadataFormatClassNames)
- {
- super(vendorName, version, names, suffixes, MIMETypes, writerClassName,
- supportsStandardStreamMetadataFormat, nativeStreamMetadataFormatName,
- nativeStreamMetadataFormatClassName, extraStreamMetadataFormatNames,
- extraStreamMetadataFormatClassNames, supportsStandardImageMetadataFormat,
- nativeImageMetadataFormatName, nativeImageMetadataFormatClassName,
- extraImageMetadataFormatNames, extraImageMetadataFormatClassNames);
-
- if (writerClassName == null)
- throw new IllegalArgumentException("writerClassName is null");
-
- if (outputTypes == null
- || outputTypes.length == 0)
- throw new IllegalArgumentException("outputTypes may not be null or empty");
-
- this.outputTypes = outputTypes;
- this.readerSpiNames = readerSpiNames;
- }
-
- public abstract boolean canEncodeImage(ImageTypeSpecifier type);
-
- public boolean canEncodeImage(RenderedImage image)
- {
- return canEncodeImage (new ImageTypeSpecifier(image));
- }
-
- public ImageWriter createWriterInstance()
- throws IOException
- {
- return createWriterInstance(null);
- }
-
- public abstract ImageWriter createWriterInstance(Object extension)
- throws IOException;
-
- public String[] getImageReaderSpiNames()
- {
- return readerSpiNames;
- }
-
- public Class[] getOutputTypes()
- {
- return outputTypes;
- }
-
- public boolean isFormatLossless()
- {
- return true;
- }
-
- public boolean isOwnWriter(ImageWriter writer)
- {
- if (writer == null)
- throw new IllegalArgumentException("writer may not be null");
-
- return pluginClassName.equals(writer.getClass().getName());
- }
-}
diff --git a/libjava/javax/imageio/spi/RegisterableService.java b/libjava/javax/imageio/spi/RegisterableService.java
deleted file mode 100644
index ccf734e69ac..00000000000
--- a/libjava/javax/imageio/spi/RegisterableService.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* RegisterableService.java -- An interface for service providers.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.spi;
-
-
-/**
- * An interface which service providers may optionally implement in
- * order to get notified when they are added or removed from a {@link
- * ServiceRegistry}.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public interface RegisterableService
-{
- /**
- * Informs this service provider that it has been registered in a
- * {@link ServiceRegistry}. If this provider gets registered as an
- * implementor for several service categories, its
- * <code>onRegistration</code> method will be called multiple times.
- *
- * @param registry the registry to which this service provider has
- * been added.
- *
- * @param category the service category for which this provider has
- * been registered as an implementor.
- */
- void onRegistration(ServiceRegistry registry, Class category);
-
-
- /**
- * Informs this service provider that it has been de-registered from
- * a {@link ServiceRegistry}. If this provider had been registered
- * as an implementor for several service categories, its
- * <code>onDeregistration</code> method will be called multiple
- * times.
- *
- * @param registry the registry from which this service provider has
- * been removed.
- *
- * @param category the service category for which this provider has
- * been registered as an implementor.
- */
- void onDeregistration(ServiceRegistry registry, Class category);
-}
-
diff --git a/libjava/javax/imageio/spi/ServiceRegistry.java b/libjava/javax/imageio/spi/ServiceRegistry.java
deleted file mode 100644
index 031b666046c..00000000000
--- a/libjava/javax/imageio/spi/ServiceRegistry.java
+++ /dev/null
@@ -1,961 +0,0 @@
-/* ServiceRegistry.java -- A simple registry for service providers.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.spi;
-
-import gnu.classpath.ServiceFactory;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-/**
- * A registry for service providers.
- *
- * @since 1.4
- *
- * @author Michael Koch (konqueror@gmx.de)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class ServiceRegistry
-{
- // Package-private to avoid a trampoline.
- /**
- * The service categories of this registry.
- *
- * <p>Note that we expect that only very few categories will
- * typically be used with a registry. The most common case will be
- * one, it seems unlikely that any registry would contain more than
- * five or six categories. Therefore, we intentionally avoid the
- * overhead of a HashMap.
- *
- * @see #providers
- */
- final Class[] categories;
-
-
- /**
- * The registered providers for each service category, indexed by
- * the same index as the {@link #categories} array. If no provider
- * is registered for a category, the array entry will be
- * <code>null</code>.
- *
- * <p>Note that we expect that only very few providers will
- * typically be registered for a category. The most common case will
- * be one or two. Therefore, we intentionally avoid the overhead of
- * a HashMap.
- */
- private final LinkedList[] providers;
-
-
- /**
- * The ordring constaints for each service category, indexed by the
- * same index as the {@link #categories} array. The constraints for
- * a service category are stored as a <code>Map&lt;Object,
- * Set&lt;Object&gt;&gt;</code>, where the Map&#x2019;s values are
- * those providers that need to come after the key. If no
- * constraints are imposed on the providers of a category, the array
- * entry will be <code>null</code>. If no constraints have been set
- * whatsoever, <code>constraints</code> will be <code>null</code>.
- *
- * <p>Note that we expect that only very few constraints will
- * typically be imposed on a category. The most common case will
- * be zero.
- */
- private IdentityHashMap[] constraints;
-
-
- /**
- * Constructs a <code>ServiceRegistry</code> for the specified
- * service categories.
- *
- * @param categories the categories to support
- *
- * @throws IllegalArgumentException if <code>categories</code> is
- * <code>null</code>, or if its {@link Iterator#next()} method
- * returns <code>null</code>.
- *
- * @throws ClassCastException if <code>categories</code> does not
- * iterate over instances of {@link java.lang.Class}.
- */
- public ServiceRegistry(Iterator categories)
- {
- ArrayList cats = new ArrayList(/* expected size */ 10);
-
- if (categories == null)
- throw new IllegalArgumentException();
-
- while (categories.hasNext())
- {
- Class cat = (Class) categories.next();
- if (cat == null)
- throw new IllegalArgumentException();
- cats.add(cat);
- }
-
- int numCats = cats.size();
- this.categories = (Class[]) cats.toArray(new Class[numCats]);
- this.providers = new LinkedList[numCats];
- }
-
-
- /**
- * Finds service providers that are implementing the specified
- * Service Provider Interface.
- *
- * <p><b>On-demand loading:</b> Loading and initializing service
- * providers is delayed as much as possible. The rationale is that
- * typical clients will iterate through the set of installed service
- * providers until one is found that matches some criteria (like
- * supported formats, or quality of service). In such scenarios, it
- * might make sense to install only the frequently needed service
- * providers on the local machine. More exotic providers can be put
- * onto a server; the server will only be contacted when no suitable
- * service could be found locally.</p>
- *
- * <p><b>Security considerations:</b> Any loaded service providers
- * are loaded through the specified ClassLoader, or the system
- * ClassLoader if <code>classLoader</code> is
- * <code>null</code>. When <code>lookupProviders</code> is called,
- * the current {@link java.security.AccessControlContext} gets
- * recorded. This captured security context will determine the
- * permissions when services get loaded via the <code>next()</code>
- * method of the returned <code>Iterator</code>.</p>
- *
- * @param spi the service provider interface which must be
- * implemented by any loaded service providers.
- *
- * @param loader the class loader that will be used to load the
- * service providers, or <code>null</code> for the system class
- * loader. For using the context class loader, see {@link
- * #lookupProviders(Class)}.
- *
- * @return an iterator over instances of <code>spi</code>.
- *
- * @throws IllegalArgumentException if <code>spi</code> is
- * <code>null</code>.
- */
- public static Iterator lookupProviders(Class spi,
- ClassLoader loader)
- {
- return ServiceFactory.lookupProviders(spi, loader);
- }
-
-
- /**
- * Finds service providers that are implementing the specified
- * Service Provider Interface, using the context class loader
- * for loading providers.
- *
- * @param spi the service provider interface which must be
- * implemented by any loaded service providers.
- *
- * @return an iterator over instances of <code>spi</code>.
- *
- * @throws IllegalArgumentException if <code>spi</code> is
- * <code>null</code>.
- *
- * @see #lookupProviders(Class, ClassLoader)
- */
- public static Iterator lookupProviders(Class spi)
- {
- return ServiceFactory.lookupProviders(spi);
- }
-
-
- /**
- * Returns an iterator over all service categories.
- *
- * @return an unmodifiable {@link
- * java.util.Iterator}&lt;{@link java.lang.Class}&gt;.
- */
- public Iterator getCategories()
- {
- return new Iterator()
- {
- int index = -1;
-
- public boolean hasNext()
- {
- return index < categories.length - 1;
- }
-
- public Object next()
- {
- if (!hasNext())
- throw new NoSuchElementException();
-
- return categories[++index];
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- };
- }
-
-
- /**
- * Registers a provider for a service category which is specified by
- * the class-internal category ID.
- *
- * @param provider the service provider to be registered.
- *
- * @param cat the service category, which is identified by an index
- * into the {@link #categories} array.
- *
- * @return <code>true</code> if <code>provider</code> is the first
- * provider that gets registered for the specified service category;
- * <code>false</code> if other providers have already been
- * registered for the same servide category.
- *
- * @throws IllegalArgumentException if <code>provider</code> is
- * <code>null</code>.
- *
- * @throws ClassCastException if <code>provider</code> does not
- * implement the specified service provider interface.
- */
- private synchronized boolean registerServiceProvider(Object provider,
- int cat)
- {
- LinkedList provs;
- boolean result;
- Class category;
-
- if (provider == null)
- throw new IllegalArgumentException();
-
- category = categories[cat];
- if (!category.isInstance(provider))
- throw new ClassCastException(category.getName());
-
- provs = providers[cat];
- if (provs == null)
- {
- result = true;
- provs = providers[cat] = new LinkedList();
- }
- else
- result = false;
-
- provs.add(provider);
- if (provider instanceof RegisterableService)
- ((RegisterableService) provider).onRegistration(this, category);
-
- return result;
- }
-
-
- /**
- * Registers a provider for the specified service category.
- *
- * <p>If <code>provider</code> implements the {@link
- * RegisterableService} interface, its {@link
- * RegisterableService#onRegistration onRegistration} method is
- * invoked in order to inform the provider about the addition to
- * this registry.
- *
- * @param provider the service provider to be registered.
- *
- * @param category the service category under which
- * <code>provider</code> shall be registered.
- *
- * @return <code>true</code> if <code>provider</code> is the first
- * provider that gets registered for the specified service category;
- * <code>false</code> if other providers have already been
- * registered for the same servide category.
- *
- * @throws IllegalArgumentException if <code>provider</code> is
- * <code>null</code>, or if <code>category</code> is not among the
- * categories passed to the {@linkplain #ServiceRegistry(Iterator)
- * constructor} of this ServiceRegistry.
- *
- * @throws ClassCastException if <code>provider</code> does not
- * implement <code>category</code>.
- */
- public synchronized boolean registerServiceProvider(Object provider,
- Class category)
- {
- for (int i = 0; i < categories.length; i++)
- if (categories[i] == category)
- return registerServiceProvider(provider, i);
- throw new IllegalArgumentException();
- }
-
-
- /**
- * Registers a provider under all service categories it
- * implements.
- *
- * <p>If <code>provider</code> implements the {@link
- * RegisterableService} interface, its {@link
- * RegisterableService#onRegistration onRegistration} method is
- * invoked in order to inform the provider about the addition to
- * this registry. If <code>provider</code> implements several
- * service categories, <code>onRegistration</code> gets called
- * multiple times.
- *
- * @param provider the service provider to be registered.
- *
- * @throws IllegalArgumentException if <code>provider</code> is
- * <code>null</code>, or if <code>provider</code> does not implement
- * any of the service categories passed to the {@linkplain
- * #ServiceRegistry(Iterator) constructor} of this ServiceRegistry.
- */
- public synchronized void registerServiceProvider(Object provider)
- {
- boolean ok = false;
-
- if (provider == null)
- throw new IllegalArgumentException();
-
- for (int i = 0; i < categories.length; i++)
- if (categories[i].isInstance(provider))
- {
- ok = true;
- registerServiceProvider(provider, i);
- }
-
- if (!ok)
- throw new IllegalArgumentException();
- }
-
-
- /**
- * Registers a number of providers under all service categories they
- * implement.
- *
- * <p>If a provider implements the {@link RegisterableService}
- * interface, its {@link RegisterableService#onRegistration
- * onRegistration} method is invoked in order to inform the provider
- * about the addition to this registry. If <code>provider</code>
- * implements several service categories,
- * <code>onRegistration</code> gets called multiple times.
- *
- * @throws IllegalArgumentException if <code>providers</code> is
- * <code>null</code>, if any iterated provider is <code>null</code>,
- * or if some iterated provider does not implement any of the
- * service categories passed to the {@linkplain
- * #ServiceRegistry(Iterator) constructor} of this
- * <code>ServiceRegistry</code>.
- */
- public synchronized void registerServiceProviders(Iterator providers)
- {
- if (providers == null)
- throw new IllegalArgumentException();
-
- while (providers.hasNext())
- registerServiceProvider(providers.next());
- }
-
-
- /**
- * De-registers a provider for a service category which is specified
- * by the class-internal category ID.
- *
- * @param provider the service provider to be registered.
- *
- * @param cat the service category, which is identified by an index
- * into the {@link #categories} array.
- *
- * @return <code>true</code> if <code>provider</code> was previously
- * registered for the specified service category; <code>false</code>
- * if if the provider had not been registered.
- *
- * @throws IllegalArgumentException if <code>provider</code> is
- * <code>null</code>.
- *
- * @throws ClassCastException if <code>provider</code> does not
- * implement the specified service provider interface.
- */
- private synchronized boolean deregisterServiceProvider(Object provider,
- int cat)
- {
- LinkedList provs;
- boolean result;
- Class category;
-
- if (provider == null)
- throw new IllegalArgumentException();
-
- category = categories[cat];
- if (!category.isInstance(provider))
- throw new ClassCastException(category.getName());
-
- provs = providers[cat];
- if (provs == null)
- return false;
-
- result = provs.remove(provider);
- if (provs.isEmpty())
- providers[cat] = null;
-
- if (result && (provider instanceof RegisterableService))
- ((RegisterableService) provider).onDeregistration(this, category);
-
- return result;
- }
-
-
- /**
- * De-registers a provider for the specified service category.
- *
- * <p>If <code>provider</code> implements the {@link
- * RegisterableService} interface, its {@link
- * RegisterableService#onDeregistration onDeregistration} method is
- * invoked in order to inform the provider about the removal from
- * this registry.
- *
- * @param provider the service provider to be de-registered.
- *
- * @param category the service category from which
- * <code>provider</code> shall be de-registered.
- *
- * @return <code>true</code> if <code>provider</code> was previously
- * registered for the specified service category; <code>false</code>
- * if if the provider had not been registered.
- *
- * @throws IllegalArgumentException if <code>provider</code> is
- * <code>null</code>, or if <code>category</code> is not among the
- * categories passed to the {@linkplain #ServiceRegistry(Iterator)
- * constructor} of this ServiceRegistry.
- *
- * @throws ClassCastException if <code>provider</code> does not
- * implement <code>category</code>.
- */
- public synchronized boolean deregisterServiceProvider(Object provider,
- Class category)
- {
- for (int i = 0; i < categories.length; i++)
- if (categories[i] == category)
- return deregisterServiceProvider(provider, i);
- throw new IllegalArgumentException();
- }
-
-
- /**
- * De-registers a provider from all service categories it
- * implements.
- *
- * <p>If <code>provider</code> implements the {@link
- * RegisterableService} interface, its {@link
- * RegisterableService#onDeregistration onDeregistration} method is
- * invoked in order to inform the provider about the removal from
- * this registry. If <code>provider</code> implements several
- * service categories, <code>onDeregistration</code> gets called
- * multiple times.</p>
- *
- * @param provider the service provider to be de-registered.
- *
- * @throws IllegalArgumentException if <code>provider</code> is
- * <code>null</code>, or if <code>provider</code> does not implement
- * any of the service categories passed to the {@linkplain
- * #ServiceRegistry(Iterator) constructor} of this
- * <code>ServiceRegistry</code>.
- */
- public synchronized void deregisterServiceProvider(Object provider)
- {
- boolean ok = false;
-
- if (provider == null)
- throw new IllegalArgumentException();
-
- for (int i = 0; i < categories.length; i++)
- if (categories[i].isInstance(provider))
- {
- ok = true;
- deregisterServiceProvider(provider, i);
- }
-
- if (!ok)
- throw new IllegalArgumentException();
- }
-
-
- /**
- * De-registers all providers which have been registered for the
- * specified service category.
- *
- * <p>If a provider implements the {@link RegisterableService}
- * interface, its {@link RegisterableService#onDeregistration
- * onDeregistration} method is invoked in order to inform the
- * provider about the removal from this registry. If the provider
- * implements several service categories,
- * <code>onDeregistration</code> gets called multiple times.
- *
- * @param category the category whose registered providers will be
- * de-registered.
- *
- * @throws IllegalArgumentException if <code>category</code> is not
- * among the categories passed to the {@linkplain
- * #ServiceRegistry(Iterator) constructor} of this
- * <code>ServiceRegistry</code>.
- */
- public synchronized void deregisterAll(Class category)
- {
- boolean ok = false;
-
- for (int i = 0; i < categories.length; i++)
- {
- if (categories[i] != category)
- continue;
-
- ok = true;
- while (providers[i] != null)
- deregisterServiceProvider(providers[i].get(0), i);
- }
-
- if (!ok)
- throw new IllegalArgumentException();
- }
-
-
- /**
- * De-registers all service providers.
- *
- * <p>If a provider implements the {@link RegisterableService}
- * interface, its {@link RegisterableService#onDeregistration
- * onDeregistration} method is invoked in order to inform the
- * provider about the removal from this registry. If the provider
- * implements several service categories,
- * <code>onDeregistration</code> gets called multiple times.
- */
- public synchronized void deregisterAll()
- {
- for (int i = 0; i < categories.length; i++)
- while (providers[i] != null)
- deregisterServiceProvider(providers[i].get(0), i);
- }
-
-
- /**
- * Called by the Virtual Machine when it detects that this
- * <code>ServiceRegistry</code> has become garbage. De-registers all
- * service providers, which will cause those that implement {@link
- * RegisterableService} to receive a {@link
- * RegisterableService#onDeregistration onDeregistration}
- * notification.
- */
- public void finalize()
- throws Throwable
- {
- super.finalize();
- deregisterAll();
- }
-
-
- /**
- * Determines whether a provider has been registered with this
- * registry.
- *
- * @return <code>true</code> if <code>provider</code> has been
- * registered under any service category; <code>false</code> if
- * it is not registered.
- *
- * @throws IllegalArgumentException if <code>provider</code> is
- * <code>null</code>.
- */
- public synchronized boolean contains(Object provider)
- {
- if (provider == null)
- throw new IllegalArgumentException();
-
- // Note that contains is rather unlikely to be ever called,
- // so it would be wasteful to keep a special data structure
- // (such as a HashSet) for making it a fast operation.
- for (int i = 0; i < providers.length; i++)
- {
- // If provider does not implement categories[i],
- // it would not have been possible to register it there.
- // In that case, it would be pointless to look there.
- if (!categories[i].isInstance(provider))
- continue;
-
- // But if the list of registered providers contains provider,
- // we have found it.
- LinkedList p = providers[i];
- if (p != null && p.contains(provider))
- return true;
- }
-
- return false;
- }
-
-
- /**
- * Returns the index in {@link #categories} occupied by the
- * specified service category.
- *
- * @throws IllegalArgumentException if <code>category</code> is not
- * among the categories passed to the {@linkplain
- * #ServiceRegistry(Iterator) constructor} of this ServiceRegistry.
- */
- private int getCategoryID(Class category)
- {
- for (int i = 0; i < categories.length; i++)
- if (categories[i] == category)
- return i;
-
- throw new IllegalArgumentException();
- }
-
-
- /**
- * Retrieves all providers that have been registered for the
- * specified service category.
- *
- * @param category the service category whose providers are
- * to be retrieved.
- *
- * @param useOrdering <code>true</code> in order to retrieve the
- * providers in an order imposed by the {@linkplain #setOrdering
- * ordering constraints}; <code>false</code> in order to retrieve
- * the providers in any order.
- *
- * @throws IllegalArgumentException if <code>category</code> is not
- * among the categories passed to the {@linkplain
- * #ServiceRegistry(Iterator) constructor} of this
- * <code>ServiceRegistry</code>.
- *
- * @see #getServiceProviders(Class, Filter, boolean)
- */
- public Iterator getServiceProviders(Class category, boolean useOrdering)
- {
- return getServiceProviders(category, null, useOrdering);
- }
-
-
- /**
- * Retrieves all providers that have been registered for the
- * specified service category and that satisfy the criteria
- * of a custom filter.
- *
- * @param category the service category whose providers are
- * to be retrieved.
- *
- * @param filter a custom filter, or <code>null</code> to
- * retrieve all registered providers for the specified
- * category.
- *
- * @param useOrdering <code>true</code> in order to retrieve the
- * providers in an order imposed by the {@linkplain #setOrdering
- * ordering constraints}; <code>false</code> in order to retrieve
- * the providers in any order.
- *
- * @throws IllegalArgumentException if <code>category</code> is not
- * among the categories passed to the {@linkplain
- * #ServiceRegistry(Iterator) constructor} of this
- * <code>ServiceRegistry</code>.
- */
- public synchronized Iterator getServiceProviders(Class category,
- Filter filter,
- boolean useOrdering)
- {
- int catid;
- LinkedList provs;
- ArrayList result;
-
- catid = getCategoryID(category);
- provs = providers[catid];
- if (provs == null)
- return Collections.EMPTY_LIST.iterator();
-
- result = new ArrayList(provs.size());
- for (Iterator iter = provs.iterator(); iter.hasNext();)
- {
- Object provider = iter.next();
- if (filter == null || filter.filter(provider))
- result.add(provider);
- }
-
- // If we are supposed to obey ordering constraints, and
- // if any constraints have been imposed on the specified
- // service category, sort the result.
- if (useOrdering && constraints != null)
- {
- final Map cons = constraints[catid];
- if (cons != null)
- Collections.sort(result, new Comparator()
- {
- public int compare(Object o1, Object o2)
- {
- Set s;
-
- if (o1 == o2)
- return 0;
-
- s = (Set) cons.get(o1);
- if (s != null && s.contains(o2))
- return -1; // o1 < o2
-
- s = (Set) cons.get(o2);
- if (s != null && s.contains(o1))
- return 1; // o1 > o2
-
- return 0; // o1 == o2
- }
- });
- }
-
- return result.iterator();
- }
-
-
- /**
- * Returns one of the service providers that is a subclass of the
- * specified class.
- *
- * @param providerClass a class to search for.
- */
- public synchronized Object getServiceProviderByClass(Class providerClass)
- {
- if (providerClass == null)
- throw new IllegalArgumentException();
-
- // Note that the method getServiceProviderByClass is rather
- // unlikely to be ever called, so it would be wasteful to keep a
- // special data structure for making it a fast operation.
- for (int cat = 0; cat < categories.length; cat++)
- {
- if (!categories[cat].isAssignableFrom(providerClass))
- continue;
-
- LinkedList provs = providers[cat];
- if (provs == null)
- continue;
-
- for (Iterator iter = provs.iterator(); iter.hasNext();)
- {
- Object provider = iter.next();
- if (providerClass.isInstance(provider))
- return provider;
- }
- }
-
- return null;
- }
-
-
- /**
- * Adds an ordering constraint on service providers.
- *
- * @param category the service category to which an ordering
- * constraint is to be added.
- *
- * @param first the provider which is supposed to come before
- * <code>second</code>.
- *
- * @param second the provider which is supposed to come after
- * <code>first</code>.
- *
- * @throws IllegalArgumentException if <code>first</code> and
- * <code>second</code> are referring to the same object, or if one
- * of them is <code>null</code>.
- *
- * @see #unsetOrdering
- * @see #getServiceProviders(Class, Filter, boolean)
- */
- public synchronized boolean setOrdering(Class category,
- Object firstProvider,
- Object secondProvider)
- {
- return addConstraint(getCategoryID(category), firstProvider,
- secondProvider);
- }
-
-
- /**
- * Removes an ordering constraint on service providers.
- *
- * @param category the service category from which an ordering
- * constraint is to be removed.
- *
- * @param first the provider which is supposed to come before
- * <code>second</code>.
- *
- * @param second the provider which is supposed to come after
- * <code>first</code>.
- *
- * @throws IllegalArgumentException if <code>first</code> and
- * <code>second</code> are referring to the same object, or if one
- * of them is <code>null</code>.
- *
- * @see #setOrdering
- */
- public synchronized boolean unsetOrdering(Class category,
- Object firstProvider,
- Object secondProvider)
- {
- return removeConstraint(getCategoryID(category),
- firstProvider, secondProvider);
- }
-
-
- /**
- * Adds an ordering constraint on service providers.
- *
- * @param catid the service category ID, which is the
- * category&#x2019;s index into the {@link #categories} array.
- *
- * @param first the provider which is supposed to come before
- * <code>second</code>.
- *
- * @param second the provider which is supposed to come after
- * <code>first</code>.
- *
- * @throws IllegalArgumentException if <code>first</code> and
- * <code>second</code> are referring to the same object, or if one
- * of them is <code>null</code>.
- */
- private boolean addConstraint(int catid, Object first, Object second)
- {
- Set s;
- IdentityHashMap cons;
-
- // Also checks argument validity.
- removeConstraint(catid, second, first);
-
- if (constraints == null)
- constraints = new IdentityHashMap[categories.length];
- cons = constraints[catid];
- if (cons == null)
- cons = constraints[catid] = new IdentityHashMap();
-
- s = (Set) cons.get(first);
- if (s == null)
- cons.put(first, s = new HashSet());
- return s.add(second);
- }
-
-
- /**
- * Removes an ordering constraint on service providers.
- *
- * @param catid the service category ID, which is the
- * category&#x2019;s index into the {@link #categories} array.
- *
- * @param first the provider which is supposed to come before
- * <code>second</code>.
- *
- * @param second the provider which is supposed to come after
- * <code>first</code>.
- *
- * @throws IllegalArgumentException if <code>first</code> and
- * <code>second</code> are referring to the same object, or if one
- * of them is <code>null</code>.
- */
- private boolean removeConstraint(int catid, Object first, Object second)
- {
- Collection s;
- IdentityHashMap cons;
-
- if (first == null || second == null || first == second)
- throw new IllegalArgumentException();
-
- if (constraints == null)
- return false;
-
- cons = constraints[catid];
- if (cons == null)
- return false;
-
- s = (Collection) cons.get(first);
- if (s == null)
- return false;
-
- if (!s.remove(second))
- return false;
-
- // If we removed the last constraint for a service category,
- // we can get free some memory.
- if (cons.isEmpty())
- {
- constraints[catid] = null;
- boolean anyConstraints = false;
- for (int i = 0; i < constraints.length; i++)
- {
- if (constraints[i] != null)
- {
- anyConstraints = true;
- break;
- }
- }
- if (!anyConstraints)
- constraints = null;
- }
-
- return true;
- }
-
-
- /**
- * A filter for selecting service providers that match custom
- * criteria.
- *
- * @see ServiceRegistry#getServiceProviders(Class, Filter,
- * boolean)
- *
- * @since 1.4
- *
- * @author Michael Koch (konqueror@gmx.de)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static interface Filter
- {
- /**
- * Checks whether the specified service provider matches the
- * constraints of this Filter.
- *
- * @param provider the service provider in question.
- *
- * @return <code>true</code> if <code>provider</code> matches the
- * criteria; <code>false</code> if it does not match.
- */
- boolean filter(Object provider);
- };
-}
-
diff --git a/libjava/javax/imageio/stream/FileCacheImageInputStream.java b/libjava/javax/imageio/stream/FileCacheImageInputStream.java
deleted file mode 100644
index 40fed63af01..00000000000
--- a/libjava/javax/imageio/stream/FileCacheImageInputStream.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* FileCacheImageInputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class FileCacheImageInputStream extends ImageInputStreamImpl
-{
- private InputStream stream;
- private File cacheDir;
-
- public FileCacheImageInputStream(InputStream stream, File cacheDir)
- throws IOException
- {
- super();
- this.stream = stream;
- // FIXME: We do not support caching yet.
- this.cacheDir = cacheDir;
- }
-
- public void close()
- throws IOException
- {
- if (stream != null)
- {
- stream.close();
- stream = null;
- }
- }
-
- private void checkStreamClosed()
- throws IOException
- {
- if (stream == null)
- throw new IOException("stream closed");
- }
-
- public boolean isCached()
- {
- return true;
- }
-
- public boolean isCachedFile()
- {
- return true;
- }
-
- public boolean isCachedMemory()
- {
- return false;
- }
-
- public int read()
- throws IOException
- {
- checkStreamClosed();
- setBitOffset(0);
- return stream.read();
- }
-
- public int read(byte[] data, int offset, int len)
- throws IOException
- {
- checkStreamClosed();
- setBitOffset(0);
- return stream.read(data, offset, len);
- }
-}
diff --git a/libjava/javax/imageio/stream/FileCacheImageOutputStream.java b/libjava/javax/imageio/stream/FileCacheImageOutputStream.java
deleted file mode 100644
index 16cd0a7a95e..00000000000
--- a/libjava/javax/imageio/stream/FileCacheImageOutputStream.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/* FileCacheImageOutputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class FileCacheImageOutputStream extends ImageOutputStreamImpl
-{
- private OutputStream stream;
- private File cacheDir;
-
- public FileCacheImageOutputStream(OutputStream stream, File cacheDir)
- throws IOException
- {
- super();
- this.stream = stream;
- // FIXME: We do not support caching yet.
- this.cacheDir = cacheDir;
- }
-
- public void close()
- throws IOException
- {
- if (stream != null)
- {
- stream.close();
- stream = null;
- }
- }
-
- private void checkStreamClosed()
- throws IOException
- {
- if (stream == null)
- throw new IOException("stream closed");
- }
-
- public boolean isCached()
- {
- return true;
- }
-
- public boolean isCachedFile()
- {
- return true;
- }
-
- public boolean isCachedMemory()
- {
- return false;
- }
-
- public int read()
- throws IOException
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public int read(byte[] data, int offset, int len)
- throws IOException
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public void write(byte[] data, int offset, int len)
- throws IOException
- {
- checkStreamClosed();
- // FIXME: Flush pending bits.
- stream.write(data, offset, len);
- }
-
- public void write(int value)
- throws IOException
- {
- checkStreamClosed();
- // FIXME: Flush pending bits.
- stream.write(value);
- }
-}
diff --git a/libjava/javax/imageio/stream/FileImageInputStream.java b/libjava/javax/imageio/stream/FileImageInputStream.java
deleted file mode 100644
index 4fa1ac8a3dc..00000000000
--- a/libjava/javax/imageio/stream/FileImageInputStream.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/* FileImageInputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class FileImageInputStream extends ImageInputStreamImpl
-{
- private RandomAccessFile file;
-
- public FileImageInputStream(File file)
- throws FileNotFoundException, IOException
- {
- if (file == null)
- throw new IllegalArgumentException ("file may not be null");
-
- this.file = new RandomAccessFile(file, "r");
- }
-
- public FileImageInputStream(RandomAccessFile file)
- {
- if (file == null)
- throw new IllegalArgumentException ("file may not be null");
-
- this.file = file;
- }
-
- public void close()
- throws IOException
- {
- file.close();
- }
-
- public long length()
- {
- try
- {
- return file.length();
- }
- catch (IOException e)
- {
- return -1L;
- }
- }
-
- public int read()
- throws IOException
- {
- setBitOffset(0);
- return file.read();
- }
-
- public int read(byte[] data, int offset, int len)
- throws IOException
- {
- setBitOffset(0);
- return file.read(data, offset, len);
- }
-
- public void seek(long position)
- throws IOException
- {
- super.seek(position);
- file.seek(position);
- }
-}
diff --git a/libjava/javax/imageio/stream/FileImageOutputStream.java b/libjava/javax/imageio/stream/FileImageOutputStream.java
deleted file mode 100644
index e1ce5c25eec..00000000000
--- a/libjava/javax/imageio/stream/FileImageOutputStream.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* FileImageOutputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class FileImageOutputStream extends ImageOutputStreamImpl
-{
- private RandomAccessFile file;
-
- public FileImageOutputStream(File file)
- throws FileNotFoundException, IOException
- {
- if (file == null)
- throw new IllegalArgumentException("file may not be null");
-
- // Do security check.
- file.canRead();
-
- this.file = new RandomAccessFile(file, "r");
- }
-
- public FileImageOutputStream(RandomAccessFile file)
- {
- if (file == null)
- throw new IllegalArgumentException("file may not be null");
-
- this.file = file;
- }
-
- public void close()
- throws IOException
- {
- file.close();
- }
-
- public long length()
- {
- try
- {
- return file.length();
- }
- catch (IOException e)
- {
- return -1L;
- }
- }
-
- public int read()
- throws IOException
- {
- checkClosed();
-
- setBitOffset(0);
- return file.read();
- }
-
- public int read(byte[] data, int offset, int len)
- throws IOException
- {
- checkClosed();
-
- setBitOffset(0);
- return file.read(data, offset, len);
- }
-
- public void seek(long position)
- throws IOException
- {
- super.seek(position);
- file.seek(position);
- }
-
- public void write(byte[] data, int offset, int len)
- throws IOException
- {
- checkClosed();
-
- flushBits();
- file.write(data, offset, len);
- }
-
- public void write(int value)
- throws IOException
- {
- checkClosed();
-
- // FIXME: Flush pending bits.
- file.write(value);
- }
-}
diff --git a/libjava/javax/imageio/stream/IIOByteBuffer.java b/libjava/javax/imageio/stream/IIOByteBuffer.java
deleted file mode 100644
index f783653a78b..00000000000
--- a/libjava/javax/imageio/stream/IIOByteBuffer.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* IIOByteBuffer.java
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-/**
- * A data structure for holding a reference to a byte array, an index
- * into that array, and a number of bytes, that can be passed to one
- * specific variant of the {@link
- * javax.imageio.stream.ImageInputStream#readBytes(IIOByteBuffer, int)
- * readBytes} method.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class IIOByteBuffer
-{
- private byte[] data;
- private int offset;
- private int length;
-
- public IIOByteBuffer(byte[] data, int offset, int length)
- {
- this.data = data;
- this.offset = offset;
- this.length = length;
- }
-
- public byte[] getData()
- {
- return data;
- }
-
- public void setData(byte[] data)
- {
- this.data = data;
- }
-
- public int getOffset()
- {
- return offset;
- }
-
- public void setOffset(int offset)
- {
- this.offset = offset;
- }
-
- public int getLength()
- {
- return length;
- }
-
- public void setLength(int length)
- {
- this.length = length;
- }
-}
diff --git a/libjava/javax/imageio/stream/ImageInputStream.java b/libjava/javax/imageio/stream/ImageInputStream.java
deleted file mode 100644
index ec39fd3294e..00000000000
--- a/libjava/javax/imageio/stream/ImageInputStream.java
+++ /dev/null
@@ -1,650 +0,0 @@
-/* ImageInputStream.java
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-import java.io.DataInput;
-import java.io.IOException;
-import java.nio.ByteOrder;
-
-
-/**
- * An input stream for use by {@link javax.imageio.ImageReader
- * ImageReaders}.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public interface ImageInputStream
- extends DataInput
-{
- void setByteOrder(ByteOrder order);
-
- ByteOrder getByteOrder();
-
- int read()
- throws IOException;
-
- int read(byte[] b)
- throws IOException;
-
- int read(byte[] b, int offset, int length)
- throws IOException;
-
-
- /**
- * Reads up to a specified number of bytes, and modifies a
- * {@link IIOByteBuffer} to hold the read data.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @param buf an <code>IIOByteBuffer</code> that will hold the read
- * data.
- *
- * @param numBytes the maximum number of bytes to read.
- *
- * @throws IndexOutOfBoundsException if <code>numBytes</code> is
- * negative.
- *
- * @throws NullPointerException if <code>buf</code> is
- * <code>null</code>.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- */
- void readBytes(IIOByteBuffer buf, int numBytes)
- throws IOException;
-
-
- /**
- * Reads a byte and checks whether or not its value is zero.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before the byte is read.
- *
- * @throws EOFException if the input stream is at its end.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readBit()
- * @see #readByte()
- * @see #readFully(byte[], int, int)
- */
- boolean readBoolean()
- throws IOException;
-
-
- /**
- * Reads a signed byte.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @throws EOFException if the input stream is at its end.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readUnsignedByte()
- * @see #readFully(byte[], int, int)
- */
- byte readByte()
- throws IOException;
-
-
- /**
- * Reads an unsigned byte.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @throws EOFException if the input stream is at its end.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readByte()
- * @see #readFully(byte[], int, int)
- */
- int readUnsignedByte()
- throws IOException;
-
-
- /**
- * Reads an signed 16-bit integer. If necessary, the value gets
- * converted from the stream&#x2019;s {@linkplain #getByteOrder()
- * current byte order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @throws EOFException if the input stream ends before all two
- * bytes were read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readUnsignedShort()
- * @see #readChar()
- * @see #readFully(short[], int, int)
- */
- short readShort()
- throws IOException;
-
-
- /**
- * Reads an unsigned 16-bit integer. If necessary, the value gets
- * converted from the stream&#x2019;s {@linkplain #getByteOrder()
- * current byte order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * <p>This method does the same as {@link #readChar()}.
- *
- * @throws EOFException if the input stream ends before all two
- * bytes were read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readShort()
- * @see #readChar()
- * @see #readFully(char[], int, int)
- */
- int readUnsignedShort()
- throws IOException;
-
-
- /**
- * Reads an unsigned 16-bit integer. If necessary, the value gets
- * converted from the stream&#x2019;s {@linkplain #getByteOrder()
- * current byte order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * <p>This method does the same as {@link #readUnsignedShort()}.
- *
- * @throws EOFException if the input stream ends before all two
- * bytes were read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readFully(char[], int, int)
- */
- char readChar()
- throws IOException;
-
-
- /**
- * Reads a signed 32-bit integer. If necessary, the value gets
- * converted from the stream&#x2019;s {@linkplain #getByteOrder()
- * current byte order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @throws EOFException if the input stream ends before all four
- * bytes were read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readUnsignedInt()
- * @see #readFully(int[], int, int)
- */
- int readInt()
- throws IOException;
-
-
- /**
- * Reads an unsigned 32-bit integer. If necessary, the value gets
- * converted from the stream&#x2019;s {@linkplain #getByteOrder()
- * current byte order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @throws EOFException if the input stream ends before all four
- * bytes were read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readInt()
- * @see #readFully(int[], int, int)
- */
- long readUnsignedInt()
- throws IOException;
-
-
- /**
- * Reads a signed 64-bit integer. If necessary, the value gets
- * converted from the stream&#x2019;s {@linkplain #getByteOrder()
- * current byte order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @throws EOFException if the input stream ends before all eight
- * bytes were read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readFully(long[], int, int)
- */
- long readLong()
- throws IOException;
-
-
- /**
- * Reads an IEEE 32-bit single-precision floating point number. If
- * necessary, the value gets converted from the stream&#x2019;s
- * {@linkplain #getByteOrder() current byte order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @throws EOFException if the input stream ends before all four
- * bytes were read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readFully(float[], int, int)
- */
- float readFloat()
- throws IOException;
-
-
- /**
- * Reads an IEEE 64-bit double-precision floating point number. If
- * necessary, the value gets converted from the stream&#x2019;s
- * {@linkplain #getByteOrder() current byte order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @throws EOFException if the input stream ends before all eight
- * bytes were read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readFully(double[], int, int)
- */
- double readDouble()
- throws IOException;
-
- String readLine()
- throws IOException;
-
- String readUTF()
- throws IOException;
-
-
- /**
- * Reads a sequence of signed 8-bit integers into a
- * <code>byte[]</code> array.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @param b an array for storing the read values.
- *
- * @param offset the index of the first element in <code>b</code>
- * that will hold read data.
- *
- * @param numBytes the number of bytes to read.
- *
- * @throws IndexOutOfBoundsException if <code>offset</code> or
- * <code>numBytes</code> is negative, or if <code>offset +
- * numBytes</code> exceeds <code>b.length</code>.
- *
- * @throws NullPointerException if <code>b</code> is
- * <code>null</code>.
- *
- * @throws EOFException if the input stream ends before all content
- * was read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readByte()
- */
- void readFully(byte[] b, int offset, int numBytes)
- throws IOException;
-
-
- /**
- * Reads a sequence of signed 8-bit integers into a
- * <code>byte[]</code> array.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @param b an array for storing the read values.
- *
- * @throws NullPointerException if <code>b</code> is
- * <code>null</code>.
- *
- * @throws EOFException if the input stream ends before all content
- * was read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readByte()
- * @see #readFully(byte[], int, int)
- */
- void readFully(byte[] b)
- throws IOException;
-
-
- /**
- * Reads a sequence of signed 16-bit integers into a
- * <code>short[]</code> array. If necessary, values are converted
- * from the stream&#x2019;s {@linkplain #getByteOrder() current byte
- * order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @param s an array for storing the read values.
- *
- * @param offset the index of the first element in <code>s</code>
- * that will hold read data.
- *
- * @param numShorts the number of signed 16-bit integers to read
- * (which is one half of the number of bytes).
- *
- * @throws IndexOutOfBoundsException if <code>offset</code> or
- * <code>numShorts</code> is negative, or if <code>offset +
- * numShorts</code> exceeds <code>s.length</code>.
- *
- * @throws NullPointerException if <code>s</code> is
- * <code>null</code>.
- *
- * @throws EOFException if the input stream ends before all content
- * was read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readShort()
- */
- void readFully(short[] s, int offset, int numShorts)
- throws IOException;
-
-
- /**
- * Reads a sequence of unsigned 16-bit integers into a
- * <code>char[]</code> array. If necessary, values are converted
- * from the stream&#x2019;s {@linkplain #getByteOrder() current byte
- * order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @param c an array for storing the read values.
- *
- * @param offset the index of the first element in <code>c</code>
- * that will hold read data.
- *
- * @param numChars the number of unsigned 16-bit integers to read
- * (which is one half of the number of bytes).
- *
- * @throws IndexOutOfBoundsException if <code>offset</code> or
- * <code>numChars</code> is negative, or if <code>offset +
- * numChars</code> exceeds <code>c.length</code>.
- *
- * @throws NullPointerException if <code>c</code> is
- * <code>null</code>.
- *
- * @throws EOFException if the input stream ends before all content
- * was read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readChar()
- */
- void readFully(char[] c, int offset, int numChars)
- throws IOException;
-
-
- /**
- * Reads a sequence of signed 32-bit integers into a
- * <code>long[]</code> array. If necessary, values are converted
- * from the stream&#x2019;s {@linkplain #getByteOrder() current byte
- * order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @param i an array for storing the read values.
- *
- * @param offset the index of the first element in <code>i</code>
- * that will hold read data.
- *
- * @param numLongs the number of signed 32-bit integers to read
- * (which is one fourth of the number of bytes).
- *
- * @throws IndexOutOfBoundsException if <code>offset</code> or
- * <code>numInts</code> is negative, or if <code>offset +
- * numInts</code> exceeds <code>i.length</code>.
- *
- * @throws NullPointerException if <code>i</code> is
- * <code>null</code>.
- *
- * @throws EOFException if the input stream ends before all content
- * was read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readInt()
- */
- void readFully(int[] i, int offset, int numInts)
- throws IOException;
-
-
- /**
- * Reads a sequence of signed 64-bit integers into a
- * <code>long[]</code> array. If necessary, values are converted
- * from the stream&#x2019;s {@linkplain #getByteOrder() current byte
- * order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @param l an array for storing the read values.
- *
- * @param offset the index of the first element in <code>l</code>
- * that will hold read data.
- *
- * @param numLongs the number of signed 64-bit integers to read
- * (which is one eight of the number of bytes).
- *
- * @throws IndexOutOfBoundsException if <code>offset</code> or
- * <code>numLongs</code> is negative, or if <code>offset +
- * numLongs</code> exceeds <code>l.length</code>.
- *
- * @throws NullPointerException if <code>l</code> is
- * <code>null</code>.
- *
- * @throws EOFException if the input stream ends before all content
- * was read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readLong()
- */
- void readFully(long[] l, int offset, int numLongs)
- throws IOException;
-
-
- /**
- * Reads a sequence of IEEE 32-bit single-precision floating point
- * numbers into a <code>float[]</code> array. If necessary, values
- * are converted from the stream&#x2019;s {@linkplain
- * #getByteOrder() current byte order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @param d an array for storing the read values.
- *
- * @param offset the index of the first element in <code>d</code>
- * that will hold read data.
- *
- * @param numFloats the number of IEEE 32-bit single-precision
- * floating point numbers to read (which is one fourth of the number
- * of bytes).
- *
- * @throws IndexOutOfBoundsException if <code>offset</code> or
- * <code>numFloats</code> is negative, or if <code>offset +
- * numFloats</code> exceeds <code>f.length</code>.
- *
- * @throws NullPointerException if <code>f</code> is
- * <code>null</code>.
- *
- * @throws EOFException if the input stream ends before all content
- * was read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readFloat()
- */
- void readFully(float[] f, int offset, int numFloats)
- throws IOException;
-
-
- /**
- * Reads a sequence of IEEE 64-bit double-precision floating point
- * numbers into a <code>double[]</code> array. If necessary, values
- * are converted from the stream&#x2019;s {@linkplain
- * #getByteOrder() current byte order}.
- *
- * <p>The {@linkplain #getBitOffset() bit offset} is set to zero
- * before any data is read.
- *
- * @param d an array for storing the read values.
- *
- * @param offset the index of the first element in <code>d</code>
- * that will hold read data.
- *
- * @param numDoubles the number of IEEE 64-bit double-precision
- * floating point numbers to read (which is one eight of the number
- * of bytes).
- *
- * @throws IndexOutOfBoundsException if <code>offset</code> or
- * <code>numDoubles</code> is negative, or if <code>offset +
- * numDoubles</code> exceeds <code>d.length</code>.
- *
- * @throws NullPointerException if <code>d</code> is
- * <code>null</code>.
- *
- * @throws EOFException if the input stream ends before all content
- * was read.
- *
- * @throws IOException if some general problem happens with
- * accessing data.
- *
- * @see #readDouble()
- */
- void readFully(double[] d, int offset, int numDoubles)
- throws IOException;
-
- long getStreamPosition()
- throws IOException;
-
- int getBitOffset()
- throws IOException;
-
- void setBitOffset(int bitOffset)
- throws IOException;
-
- int readBit()
- throws IOException;
-
- long readBits(int numBits)
- throws IOException;
-
- long length()
- throws IOException;
-
- int skipBytes(int numBytes)
- throws IOException;
-
- long skipBytes(long numBytes)
- throws IOException;
-
- void seek(long pos)
- throws IOException;
-
- void mark();
-
- void reset()
- throws IOException;
-
- void flushBefore(long pos)
- throws IOException;
-
- void flush()
- throws IOException;
-
- long getFlushedPosition();
-
- boolean isCached();
-
- boolean isCachedMemory();
-
- boolean isCachedFile();
-
- void close()
- throws IOException;
-}
diff --git a/libjava/javax/imageio/stream/ImageInputStreamImpl.java b/libjava/javax/imageio/stream/ImageInputStreamImpl.java
deleted file mode 100644
index 0967fee467a..00000000000
--- a/libjava/javax/imageio/stream/ImageInputStreamImpl.java
+++ /dev/null
@@ -1,515 +0,0 @@
-/* ImageInputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-import java.io.DataInputStream;
-import java.io.EOFException;
-import java.io.IOException;
-import java.nio.ByteOrder;
-import java.util.Stack;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class ImageInputStreamImpl implements ImageInputStream
-{
- private boolean closed;
- private Stack markStack = new Stack();
-
- byte[] buffer = new byte[8];
-
- protected int bitOffset;
- protected ByteOrder byteOrder;
- protected long flushedPos;
- protected long streamPos;
-
- public ImageInputStreamImpl()
- {
- // Do nothing here.
- }
-
- protected final void checkClosed()
- throws IOException
- {
- if (closed)
- throw new IOException("stream closed");
- }
-
- public void close()
- throws IOException
- {
- checkClosed();
- closed = true;
- }
-
- protected void finalize()
- throws Throwable
- {
- close();
- }
-
- public void flush()
- throws IOException
- {
- flushBefore(getStreamPosition());
- }
-
- public void flushBefore(long position)
- throws IOException
- {
- if (position < flushedPos)
- throw new IndexOutOfBoundsException();
-
- if (position > streamPos)
- throw new IndexOutOfBoundsException();
-
- flushedPos = position;
- }
-
- public int getBitOffset()
- throws IOException
- {
- checkClosed();
- return bitOffset;
- }
-
- public ByteOrder getByteOrder()
- {
- return byteOrder;
- }
-
- public long getFlushedPosition()
- {
- return flushedPos;
- }
-
- public long getStreamPosition()
- throws IOException
- {
- checkClosed();
- return streamPos;
- }
-
- public boolean isCached()
- {
- return false;
- }
-
- public boolean isCachedFile()
- {
- return false;
- }
-
- public boolean isCachedMemory()
- {
- return false;
- }
-
- public long length()
- {
- return -1L;
- }
-
- public void mark()
- {
- try
- {
- markStack.push(new Long(getStreamPosition()));
- }
- catch (IOException e)
- {
- // Ignored.
- }
- }
-
- public abstract int read()
- throws IOException;
-
- public int read(byte[] data)
- throws IOException
- {
- return read(data, 0, data.length);
- }
-
- public abstract int read(byte[] data, int offset, int len)
- throws IOException;
-
- public int readBit()
- throws IOException
- {
- checkClosed();
-
- // Calc new bit offset here, readByte resets it.
- int newOffset = (bitOffset + 1) & 0x7;
-
- byte data = readByte();
-
- if (bitOffset != 0)
- {
- seek(getStreamPosition() - 1);
- data = (byte) (data >> (8 - newOffset));
- }
-
- bitOffset = newOffset;
- return data & 0x1;
- }
-
- public long readBits(int numBits)
- throws IOException
- {
- checkClosed();
-
- if (numBits < 0 || numBits > 64)
- throw new IllegalArgumentException();
-
- if (numBits == 0)
- return 0L;
-
- long bits = 0L;
-
- for (int i = 0; i < numBits; i++)
- {
- bits <<= 1;
- bits |= readBit();
- }
-
- return bits;
- }
-
- public boolean readBoolean()
- throws IOException
- {
- byte data = readByte();
- return data != 0;
- }
-
- public byte readByte()
- throws IOException
- {
- int data = read();
-
- if (data == -1)
- throw new EOFException();
-
- return (byte) data;
- }
-
- public void readBytes(IIOByteBuffer buffer, int len)
- throws IOException
- {
- int result = read(buffer.getData(), buffer.getOffset(), len);
-
- if (result == -1 || result < len)
- throw new EOFException();
-
- buffer.setLength(len);
- }
-
- public char readChar()
- throws IOException
- {
- return (char) readShort();
- }
-
- public double readDouble()
- throws IOException
- {
- return (double) readLong();
- }
-
- public float readFloat()
- throws IOException
- {
- return (float) readInt();
- }
-
- public void readFully(byte[] data)
- throws IOException
- {
- readFully(data, 0, data.length);
- }
-
- public void readFully(byte[] data, int offset, int len)
- throws IOException
- {
- for (int i = 0; i < len; ++i)
- data[offset + i] = readByte();
- }
-
- public void readFully(char[] data, int offset, int len)
- throws IOException
- {
- for (int i = 0; i < len; ++i)
- data[offset + i] = readChar();
- }
-
- public void readFully(double[] data, int offset, int len)
- throws IOException
- {
- for (int i = 0; i < len; ++i)
- data[offset + i] = readDouble();
- }
-
- public void readFully(float[] data, int offset, int len)
- throws IOException
- {
- for (int i = 0; i < len; ++i)
- data[offset + i] = readFloat();
- }
-
- public void readFully(int[] data, int offset, int len)
- throws IOException
- {
- for (int i = 0; i < len; ++i)
- data[offset + i] = readInt();
- }
-
- public void readFully(long[] data, int offset, int len)
- throws IOException
- {
- for (int i = 0; i < len; ++i)
- data[offset + i] = readLong();
- }
-
- public void readFully(short[] data, int offset, int len)
- throws IOException
- {
- for (int i = 0; i < len; ++i)
- data[offset + i] = readShort();
- }
-
- public int readInt()
- throws IOException
- {
- int result = read(buffer, 0, 4);
-
- if (result == -1)
- throw new EOFException();
-
- if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
- {
- return ((buffer[0] & 0xff)
- + (buffer[1] << 8)
- + (buffer[2] << 16)
- + (buffer[3] << 24));
- }
-
- return ((buffer[4] << 24)
- + (buffer[3] << 16)
- + (buffer[2] << 8)
- + (buffer[1] & 0xff));
- }
-
- public String readLine()
- throws IOException
- {
- checkClosed();
-
- int c = -1;
- boolean eol = false;
- StringBuffer buffer = new StringBuffer();
-
- while (!eol && (c = read()) != -1)
- {
- switch(c)
- {
- case '\r':
- // Consume following \n'
- long oldPosition = getStreamPosition();
- if (read() != '\n')
- seek(oldPosition);
- case '\n':
- eol = true;
- break;
- default:
- buffer.append((char) c);
- break;
- }
- }
-
- if (c == -1 && buffer.length() == 0)
- return null;
-
- return buffer.toString();
- }
-
- public long readLong()
- throws IOException
- {
- int result = read(buffer, 0, 8);
-
- if (result == -1)
- throw new EOFException();
-
- if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
- {
- return ((buffer[0] & 0xff)
- + (((buffer[1] & 0xff)) << 8)
- + (((buffer[2] & 0xff)) << 16)
- + (((buffer[3] & 0xffL)) << 24)
- + (((buffer[4] & 0xffL)) << 32)
- + (((buffer[5] & 0xffL)) << 40)
- + (((buffer[6] & 0xffL)) << 48)
- + (((long) buffer[7]) << 56));
- }
-
- return ((((long) buffer[7]) << 56)
- + ((buffer[6] & 0xffL) << 48)
- + ((buffer[5] & 0xffL) << 40)
- + ((buffer[4] & 0xffL) << 32)
- + ((buffer[3] & 0xffL) << 24)
- + ((buffer[2] & 0xff) << 16)
- + ((buffer[1] & 0xff) << 8)
- + (buffer[0] & 0xff));
- }
-
- public short readShort()
- throws IOException
- {
- int result = read(buffer, 0, 2);
-
- if (result == -1)
- throw new EOFException();
-
- if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
- {
- return (short) ((buffer[0] & 0xff)
- + (buffer[1] << 8));
- }
-
- return (short) ((buffer[0] << 8)
- + (buffer[1] & 0xff));
- }
-
- public int readUnsignedByte()
- throws IOException
- {
- return readByte() & 0xff;
- }
-
- public long readUnsignedInt()
- throws IOException
- {
- return readInt() & 0xffffffff;
- }
-
- public int readUnsignedShort()
- throws IOException
- {
- return readShort() & 0xffff;
- }
-
- public String readUTF()
- throws IOException
- {
- checkClosed();
-
- String data;
- ByteOrder old = getByteOrder();
- setByteOrder(ByteOrder.BIG_ENDIAN); // Strings are always big endian.
-
- try
- {
- data = DataInputStream.readUTF(this);
- }
- finally
- {
- setByteOrder(old);
- }
-
- return data;
- }
-
- public void reset()
- throws IOException
- {
- checkClosed();
-
- long mark = ((Long) markStack.pop()).longValue();
- seek(mark);
- }
-
- public void seek(long position)
- throws IOException
- {
- checkClosed();
-
- if (position < getFlushedPosition())
- throw new IndexOutOfBoundsException("position < flushed position");
-
- streamPos = position;
- bitOffset = 0;
- }
-
- public void setBitOffset (int bitOffset)
- throws IOException
- {
- checkClosed();
-
- if (bitOffset < 0 || bitOffset > 7)
- throw new IllegalArgumentException();
-
- this.bitOffset = bitOffset;
- }
-
- public void setByteOrder(ByteOrder byteOrder)
- {
- this.byteOrder = byteOrder;
- }
-
- public int skipBytes(int num)
- throws IOException
- {
- checkClosed();
-
- seek(getStreamPosition() + num);
- bitOffset = 0;
- return num;
- }
-
- public long skipBytes(long num)
- throws IOException
- {
- checkClosed();
-
- seek(getStreamPosition() + num);
- bitOffset = 0;
- return num;
- }
-}
diff --git a/libjava/javax/imageio/stream/ImageOutputStream.java b/libjava/javax/imageio/stream/ImageOutputStream.java
deleted file mode 100644
index 49a1bcf33be..00000000000
--- a/libjava/javax/imageio/stream/ImageOutputStream.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/* ImageOutputStream.java
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-import java.io.DataOutput;
-import java.io.IOException;
-
-
-/**
- * An output stream for use by {@link javax.imageio.ImageWriter
- * ImageWriters}.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public interface ImageOutputStream
- extends ImageInputStream, DataOutput
-{
- /**
- * @param postion
- *
- * @throws IOException if an errror occurs
- */
- void flushBefore(long position) throws IOException;
-
- /**
- * Writes an array into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void write(byte[] data) throws IOException;
-
- /**
- * Writes a region of data from an array into the stream.
- *
- * @param data the data to be written
- * @param offset the offset in the array
- * @param len the length in the array
- *
- * @throws IOException if an errror occurs
- */
- void write(byte[] data, int offset, int len) throws IOException;
-
- /**
- * Writes an <code>int</code> into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void write(int data) throws IOException;
-
- /**
- * Writes a bit value to the stream.
- *
- * @throws IOException if an error occurs
- */
- void writeBit(int bit) throws IOException;
-
- /**
- * Writes a number of bit values to the stream.
- *
- * @throws IOException if an errror occurs
- */
- void writeBits(long bits, int numBits) throws IOException;
-
- /**
- * Writes a <code>boolean</code> value into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeBoolean(boolean data) throws IOException;
-
- /**
- * Writes a <code>byte</code> value into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeByte(int data) throws IOException;
-
- /**
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeBytes(String data) throws IOException;
-
- /**
- * Writes a character into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeChar(int data) throws IOException;
-
- /**
- * Writes characters to the stream.
- *
- * @param data the data to be written
- * @param offset the offset in the array
- * @param len the lenth in the array
- *
- * @throws IOException if an errror occurs
- */
- void writeChars(char[] data, int offset, int len) throws IOException;
-
- /**
- * Writes characters from a given <code>String</code> into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeChars(String data) throws IOException;
-
- /**
- * Writes a <code>double</code> into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeDouble(double data) throws IOException;
-
- /**
- * Writes an array of <code>double</code> into the stream.
- *
- * @param data the data to be written
- * @param offset the offset in the array
- * @param len the lenth in the array
- *
- * @throws IOException if an errror occurs
- */
- void writeDoubles(double[] data, int offset, int len)
- throws IOException;
-
- /**
- * Writes a <code>float</code> into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeFloat(float data) throws IOException;
-
- /**
- * Writes an array of <code>float</code> into the stream.
- *
- * @param data the data to be written
- * @param offset the offset in the array
- * @param len the lenth in the array
- *
- * @throws IOException if an errror occurs
- */
- void writeFloats(float[] data, int offset, int len) throws IOException;
-
- /**
- * Writes a <code>int</code> into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeInt(int data) throws IOException;
-
- /**
- * Writes an array of <code>int</code> into the stream.
- *
- * @param data the data to be written
- * @param offset the offset in the array
- * @param len the lenth in the array
- *
- * @throws IOException if an errror occurs
- */
- void writeInts(int[] data, int offset, int len) throws IOException;
-
- /**
- * Writes a <code>long</code> into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeLong(long data) throws IOException;
-
- /**
- * Writes an array of <code>long</code> into the stream.
- *
- * @param data the data to be written
- * @param offset the offset in the array
- * @param len the lenth in the array
- *
- * @throws IOException if an errror occurs
- */
- void writeLongs(long[] data, int offset, int len) throws IOException;
-
- /**
- * Writes a <code>short</code> into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeShort(int data) throws IOException;
-
- /**
- * Writes an array of <code>short</code> into the stream.
- *
- * @param data the data to be written
- * @param offset the offset in the array
- * @param len the lenth in the array
- *
- * @throws IOException if an errror occurs
- */
- void writeShorts(short[] data, int offset, int len) throws IOException;
-
- /**
- * Writes a <code>String</code> into the stream.
- *
- * @param data the data to be written
- *
- * @throws IOException if an errror occurs
- */
- void writeUTF(String data) throws IOException;
-}
diff --git a/libjava/javax/imageio/stream/ImageOutputStreamImpl.java b/libjava/javax/imageio/stream/ImageOutputStreamImpl.java
deleted file mode 100644
index c708a2368d7..00000000000
--- a/libjava/javax/imageio/stream/ImageOutputStreamImpl.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/* ImageOutputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-import java.io.IOException;
-import java.nio.ByteOrder;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class ImageOutputStreamImpl extends ImageInputStreamImpl
- implements ImageOutputStream
-{
- public ImageOutputStreamImpl()
- {
- // Do nothing here.
- }
-
- protected void flushBits()
- throws IOException
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public void write(byte[] data)
- throws IOException
- {
- write(data, 0, data.length);
- }
-
- public abstract void write(byte[] data, int offset, int len)
- throws IOException;
-
- public abstract void write(int value)
- throws IOException;
-
- public void writeBit(int bit)
- throws IOException
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public void writeBits(long bits, int numBits)
- throws IOException
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public void writeBoolean(boolean value)
- throws IOException
- {
- writeByte(value ? 1 : 0);
- }
-
- public void writeByte(int value)
- throws IOException
- {
- write(value & 0xff);
- }
-
- public void writeBytes(String data)
- throws IOException
- {
- write(data.getBytes());
- }
-
- public void writeChar(int value)
- throws IOException
- {
- writeShort((short) value);
- }
-
- public void writeChars(char[] data, int offset, int len)
- throws IOException
- {
- for(int i = 0; i < len; ++len)
- writeChar(data[offset + i]);
- }
-
- public void writeChars(String data)
- throws IOException
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public void writeDouble(double value)
- throws IOException
- {
- writeLong((long) value);
- }
-
- public void writeDoubles(double[] data, int offset, int len)
- throws IOException
- {
- for(int i = 0; i < len; ++len)
- writeDouble(data[offset + i]);
- }
-
- public void writeFloat(float value)
- throws IOException
- {
- writeInt((int) value);
- }
-
- public void writeFloats(float[] data, int offset, int len)
- throws IOException
- {
- for(int i = 0; i < len; ++len)
- writeFloat(data[offset + i]);
- }
-
- public void writeInt(int value)
- throws IOException
- {
- if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
- {
- buffer[0] = ((byte) value);
- buffer[1] = ((byte) (value >> 8));
- buffer[2] = ((byte) (value >> 16));
- buffer[3] = ((byte) (value >> 24));
- }
- else
- {
- buffer[0] = ((byte) (value >> 24));
- buffer[1] = ((byte) (value >> 16));
- buffer[2] = ((byte) (value >> 8));
- buffer[3] = ((byte) value);
- }
-
- write(buffer, 0, 4);
- }
-
- public void writeInts(int[] data, int offset, int len)
- throws IOException
- {
- for(int i = 0; i < len; ++len)
- writeInt(data[offset + i]);
- }
-
- public void writeLong(long value)
- throws IOException
- {
- if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
- {
- buffer[0] = ((byte) value);
- buffer[1] = ((byte) (value >> 8));
- buffer[2] = ((byte) (value >> 16));
- buffer[3] = ((byte) (value >> 24));
- buffer[4] = ((byte) (value >> 32));
- buffer[5] = ((byte) (value >> 40));
- buffer[6] = ((byte) (value >> 48));
- buffer[7] = ((byte) (value >> 56));
- }
- else
- {
- buffer[0] = ((byte) (value >> 56));
- buffer[1] = ((byte) (value >> 48));
- buffer[2] = ((byte) (value >> 40));
- buffer[3] = ((byte) (value >> 32));
- buffer[4] = ((byte) (value >> 24));
- buffer[5] = ((byte) (value >> 16));
- buffer[6] = ((byte) (value >> 8));
- buffer[7] = ((byte) value);
- }
-
- write(buffer, 0, 8);
- }
-
- public void writeLongs(long[] data, int offset, int len)
- throws IOException
- {
- for(int i = 0; i < len; ++len)
- writeLong(data[offset + i]);
- }
-
- public void writeShort(int value)
- throws IOException
- {
- if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
- {
- buffer[0] = ((byte) value);
- buffer[1] = ((byte) (value >> 8));
- }
- else
- {
- buffer[0] = ((byte) (value >> 8));
- buffer[1] = ((byte) value);
- }
-
- write(buffer, 0, 2);
- }
-
- public void writeShorts(short[] data, int offset, int len)
- throws IOException
- {
- for(int i = 0; i < len; ++len)
- writeShort(data[offset + i]);
- }
-
- public void writeUTF(String data)
- throws IOException
- {
- throw new Error("not implemented");
- }
-}
diff --git a/libjava/javax/imageio/stream/MemoryCacheImageInputStream.java b/libjava/javax/imageio/stream/MemoryCacheImageInputStream.java
deleted file mode 100644
index 3d9f6184697..00000000000
--- a/libjava/javax/imageio/stream/MemoryCacheImageInputStream.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* MemoryCacheImageInputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class MemoryCacheImageInputStream extends ImageInputStreamImpl
-{
- private InputStream stream;
-
- public MemoryCacheImageInputStream(InputStream stream)
- {
- this.stream = stream;
- }
-
- public void close()
- throws IOException
- {
- super.close();
- stream.close();
- }
-
- public void flushBefore(long position)
- throws IOException
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public boolean isCached()
- {
- return true;
- }
-
- public boolean isCachedFile()
- {
- return false;
- }
-
- public boolean isCachedMemory()
- {
- return true;
- }
-
- public int read()
- throws IOException
- {
- setBitOffset(0);
- return stream.read();
- }
-
- public int read(byte[] data, int offset, int len)
- throws IOException
- {
- setBitOffset(0);
- return stream.read(data, offset, len);
- }
-}
diff --git a/libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java b/libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java
deleted file mode 100644
index 8914c3305df..00000000000
--- a/libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* MemoryCacheImageOutputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.imageio.stream;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class MemoryCacheImageOutputStream extends ImageOutputStreamImpl
-{
- private OutputStream stream;
-
- public MemoryCacheImageOutputStream(OutputStream stream)
- {
- this.stream = stream;
- }
-
- public void close()
- throws IOException
- {
- super.close();
- stream.close();
- }
-
- public void flushBefore(long position)
- throws IOException
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public boolean isCached()
- {
- return true;
- }
-
- public boolean isCachedFile()
- {
- return false;
- }
-
- public boolean isCachedMemory()
- {
- return true;
- }
-
- public int read()
- throws IOException
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public int read (byte[] data, int offset, int len)
- throws IOException
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public void write(byte[] data, int offset, int len)
- throws IOException
- {
- // FIXME: Flush pending bits.
- stream.write(data, offset, len);
- }
-
- public void write(int value)
- throws IOException
- {
- // FIXME: Flush pending bits.
- stream.write(value);
- }
-}
diff --git a/libjava/javax/naming/AuthenticationException.java b/libjava/javax/naming/AuthenticationException.java
deleted file mode 100644
index f332561e49b..00000000000
--- a/libjava/javax/naming/AuthenticationException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* AuthenticationException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class AuthenticationException extends NamingSecurityException
-{
- public AuthenticationException ()
- {
- super ();
- }
-
- public AuthenticationException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/AuthenticationNotSupportedException.java b/libjava/javax/naming/AuthenticationNotSupportedException.java
deleted file mode 100644
index 52b133a5cf5..00000000000
--- a/libjava/javax/naming/AuthenticationNotSupportedException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* AuthenticationNotSupportedException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class AuthenticationNotSupportedException
- extends NamingSecurityException
-{
- public AuthenticationNotSupportedException ()
- {
- super ();
- }
-
- public AuthenticationNotSupportedException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/BinaryRefAddr.java b/libjava/javax/naming/BinaryRefAddr.java
deleted file mode 100644
index 0b813abc352..00000000000
--- a/libjava/javax/naming/BinaryRefAddr.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* BinaryRefAddr.java -- RefAddr that uses a byte array as content.
- Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.util.Arrays;
-
-/**
- * RefAddr that uses a byte array as content.
- * This can be used to reference objects that can only be represented as
- * byte arrays.
- *
- * @see Reference
- * @since 1.3
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class BinaryRefAddr extends RefAddr
-{
- static final long serialVersionUID = -3415254970957330361L;
-
- /**
- * The possibly null content of this RefAddr.
- * Set by the constructor and returned by getContent.
- */
- private final byte[] buf;
-
- /**
- * Contructs a new BinaryRefAddr with the given type and content.
- * The complete content of the byte array is copied to a new array.
- */
- public BinaryRefAddr (String addrType, byte[] buf)
- {
- this(addrType, buf, 0, buf.length);
- }
-
- /**
- * Contructs a new BinaryRefAddr with the given type and the content
- * taken from the given byte array.
- * The content of the byte array is copied to a new array.
- */
- public BinaryRefAddr (String addrType, byte[] buf, int off, int length)
- {
- super(addrType);
- this.buf = new byte[length];
- System.arraycopy(buf, off, this.buf, 0, length);
- }
-
- /**
- * Returns the byte array contents as given to the constructor.
- * The returned byte array is shared with this object and other callers.
- * Changing the content of the buffer is discouraged and should only be
- * done when the byte array is locked.
- */
- public Object getContent ()
- {
- return buf;
- }
-
- /**
- * Checks if the object is a BinaryRefAddr with the same type and with the
- * same bytes in the content.
- *
- * @return true if the given object is an instance of BinaryRefAddr,
- * the addrType is the same as this addrType and the bytes of the
- * content are the same.
- */
- public boolean equals(Object o)
- {
- if (o instanceof BinaryRefAddr)
- {
- BinaryRefAddr refAddr = (BinaryRefAddr) o;
- if (this.getType().equals(refAddr.getType()))
- {
- byte[] c1 = (byte[]) this.getContent();
- byte[] c2 = (byte[]) refAddr.getContent();
- return Arrays.equals(c1, c2);
- }
- }
- return false;
- }
-
- /**
- * Returns the hashCode which is the hasCode of the String returned by
- * <code>getType()</code> plus the hashCode of the byte array returned by
- * <code>getContent</code>. The hashCode of the byte array is calculated
- * by taking the xor of all the bytes in the array, or zero when there are
- * no bytes in the array.
- */
- public int hashCode()
- {
- int result = 0;
- byte[] b = (byte[]) getContent();
- for (int i=0; i < b.length; i++)
- result = result^b[i];
-
- return getType().hashCode() + result;
- }
-
- private static char[] hex = {'0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
- /**
- * Returns a String representation of the RefAddr. Only the first 32 bytes
- * of the content are added as hex encoded characters.
- * Should only be used for debugging purposes.
- */
- public String toString()
- {
- StringBuffer sb = new StringBuffer("[RefAddr type: ");
- sb.append(getType());
- sb.append(" content: 0x");
- byte[] b = (byte[]) getContent();
- for (int i=0; i < b.length && i < 32; i++)
- {
- sb.append(hex[(b[i]&0xf0)>>4]);
- sb.append(hex[b[i]&0x0f]);
- }
- if (b.length > 32)
- sb.append("...");
- sb.append("]");
- return sb.toString();
- }
-}
diff --git a/libjava/javax/naming/Binding.java b/libjava/javax/naming/Binding.java
deleted file mode 100644
index 91c0d95f7d5..00000000000
--- a/libjava/javax/naming/Binding.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Binding.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date May 16, 2001
- */
-public class Binding extends NameClassPair
-{
- public Binding (String name, Object obj)
- {
- super (name, null);
- boundObj = obj;
- }
-
- public Binding (String name, Object obj, boolean isRelative)
- {
- super (name, null, isRelative);
- boundObj = obj;
- }
-
- public Binding (String name, String className, Object obj)
- {
- super (name, className);
- boundObj = obj;
- }
-
- public Binding (String name, String className, Object obj,
- boolean isRelative)
- {
- super (name, className, isRelative);
- boundObj = obj;
- }
-
- public String getClassName ()
- {
- String r = super.getClassName ();
- if (r != null)
- return r;
- return boundObj == null ? null : boundObj.getClass ().getName ();
- }
-
- public Object getObject ()
- {
- return boundObj;
- }
-
- public void setObject (Object obj)
- {
- boundObj = obj;
- }
-
- public String toString ()
- {
- // Format specified by the documentation.
- return super.toString () + ":" + boundObj.toString ();
- }
-
- // This name is fixed by the serialization spec.
- private Object boundObj;
-}
diff --git a/libjava/javax/naming/CannotProceedException.java b/libjava/javax/naming/CannotProceedException.java
deleted file mode 100644
index 3a69cd3819c..00000000000
--- a/libjava/javax/naming/CannotProceedException.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/* CannotProceedException.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.util.Hashtable;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 14, 2001
- */
-
-public class CannotProceedException extends NamingException
-{
- // Serialized fields.
- protected Name remainingNewName;
- protected Hashtable environment;
- protected Name altName;
- protected Context altNameCtx;
-
- public CannotProceedException ()
- {
- super ();
- }
-
- public CannotProceedException (String msg)
- {
- super (msg);
- }
-
- public Hashtable getEnvironment()
- {
- return environment;
- }
-
- public void setEnvironment(Hashtable environment)
- {
- this.environment = environment;
- }
-
- public Name getRemainingNewName()
- {
- return remainingNewName;
- }
-
- public void setRemainingNewName(Name newName)
- {
- remainingNewName = (Name) newName.clone();
- }
-
- public Name getAltName()
- {
- return altName;
- }
-
- public void setAltName(Name altName)
- {
- this.altName = altName;
- }
-
- public Context getAltNameCtx()
- {
- return altNameCtx;
- }
-
- public void setAltNameCtx(Context altNameCtx)
- {
- this.altNameCtx = altNameCtx;
- }
-}
diff --git a/libjava/javax/naming/CommunicationException.java b/libjava/javax/naming/CommunicationException.java
deleted file mode 100644
index c780387cf05..00000000000
--- a/libjava/javax/naming/CommunicationException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* CommunicationException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class CommunicationException extends NamingException
-{
- public CommunicationException ()
- {
- super ();
- }
-
- public CommunicationException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/CompositeName.java b/libjava/javax/naming/CompositeName.java
deleted file mode 100644
index 61adcf177a6..00000000000
--- a/libjava/javax/naming/CompositeName.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/* CompositeName.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date May 16, 2001
- *
- * FIXME: must write readObject and writeObject to conform to
- * serialization spec.
- */
-public class CompositeName implements Name, Cloneable, Serializable
-{
- private static final long serialVersionUID = 1667768148915813118L;
-
- public CompositeName ()
- {
- elts = new Vector ();
- }
-
- protected CompositeName (Enumeration comps)
- {
- elts = new Vector ();
- try
- {
- while (comps.hasMoreElements ())
- elts.add (comps.nextElement ());
- }
- catch (NoSuchElementException ignore)
- {
- }
- }
-
- public CompositeName (String n) throws InvalidNameException
- {
- elts = new Vector ();
- // Parse the string into its components.
- final char no_quote = 'x'; // Use 'x' to mean no quoting.
- char quote = no_quote;
- boolean escaped = false;
- StringBuffer new_element = new StringBuffer ();
- for (int i = 0; i < n.length (); ++i)
- {
- char c = n.charAt (i);
- if (escaped)
- escaped = false;
- else if (c == '\\')
- {
- escaped = true;
- continue;
- }
- else if (quote != no_quote)
- {
- if (quote == c)
- {
- // The quotes must surround a complete component.
- if (i + 1 < n.length () && n.charAt (i + 1) != '/')
- throw new InvalidNameException ("close quote before end of component");
- elts.add (new_element.toString ());
- new_element.setLength (0);
- quote = no_quote;
- continue;
- }
- // Otherwise, fall through.
- }
- // Quotes are only special at the start of a component.
- else if (new_element.length () == 0
- && (c == '\'' || c == '"'))
- {
- quote = c;
- continue;
- }
- else if (c == '/')
- {
- elts.add (new_element.toString ());
- new_element.setLength (0);
- continue;
- }
-
- new_element.append (c);
- }
-
- if (new_element.length () != 0)
- elts.add (new_element.toString ());
-
- // Error checking.
- if (quote != no_quote)
- throw new InvalidNameException ("unterminated quote");
- if (escaped)
- throw new InvalidNameException ("trailing escape character");
- }
-
- public Name add (int posn, String comp) throws InvalidNameException
- {
- elts.add (posn, comp);
- return this;
- }
-
- public Name add (String comp) throws InvalidNameException
- {
- elts.add (comp);
- return this;
- }
-
- public Name addAll (int posn, Name n) throws InvalidNameException
- {
- Enumeration e = n.getAll ();
- try
- {
- while (e.hasMoreElements ())
- {
- elts.add (posn, e.nextElement ());
- ++posn;
- }
- }
- catch (NoSuchElementException ignore)
- {
- }
- return this;
- }
-
- public Name addAll (Name suffix) throws InvalidNameException
- {
- Enumeration e = suffix.getAll ();
- try
- {
- while (e.hasMoreElements ())
- elts.add (e.nextElement ());
- }
- catch (NoSuchElementException ignore)
- {
- }
- return this;
- }
-
- public Object clone ()
- {
- return new CompositeName (elts.elements ());
- }
-
- public int compareTo (Object obj)
- {
- if (obj == null || ! (obj instanceof CompositeName))
- throw new ClassCastException ("CompositeName.compareTo() expected CompositeName");
- CompositeName cn = (CompositeName) obj;
- int last = Math.min (cn.elts.size (), elts.size ());
- for (int i = 0; i < last; ++i)
- {
- String f = (String) elts.get (i);
- int comp = f.compareTo ((String) cn.elts.get (i));
- if (comp != 0)
- return comp;
- }
- return elts.size () - cn.elts.size ();
- }
-
- public boolean endsWith (Name n)
- {
- if (! (n instanceof CompositeName))
- return false;
- CompositeName cn = (CompositeName) n;
- if (cn.elts.size () > elts.size ())
- return false;
- int delta = elts.size () - cn.elts.size ();
- for (int i = 0; i < cn.elts.size (); ++i)
- {
- if (! cn.elts.get (i).equals (elts.get (delta + i)))
- return false;
- }
- return true;
- }
-
- public boolean equals (Object obj)
- {
- if (! (obj instanceof CompositeName))
- return false;
- CompositeName cn = (CompositeName) obj;
- return elts.equals (cn.elts);
- }
-
- public String get (int posn)
- {
- return (String) elts.get (posn);
- }
-
- public Enumeration getAll ()
- {
- return elts.elements ();
- }
-
- public Name getPrefix (int posn)
- {
- CompositeName cn = new CompositeName ();
- for (int i = 0; i < posn; ++i)
- cn.elts.add ((String) elts.get (i));
- return cn;
- }
-
- public Name getSuffix (int posn)
- {
- if (posn > elts.size ())
- throw new ArrayIndexOutOfBoundsException (posn);
- CompositeName cn = new CompositeName ();
- for (int i = posn; i < elts.size (); ++i)
- cn.elts.add ((String) elts.get (i));
- return cn;
- }
-
- public int hashCode ()
- {
- // Specified in documentation.
- int h = 0;
- for (int i = 0; i < elts.size (); ++i)
- h += elts.get (i).hashCode ();
- return h;
- }
-
- public boolean isEmpty ()
- {
- return elts.isEmpty ();
- }
-
- public Object remove (int posn) throws InvalidNameException
- {
- return elts.remove (posn);
- }
-
- public int size ()
- {
- return elts.size ();
- }
-
- public boolean startsWith (Name n)
- {
- if (! (n instanceof CompositeName))
- return false;
- CompositeName cn = (CompositeName) n;
- if (cn.elts.size () > elts.size ())
- return false;
- for (int i = 0; i < cn.elts.size (); ++i)
- {
- if (! cn.elts.get (i).equals (elts.get (i)))
- return false;
- }
- return true;
- }
-
- public String toString ()
- {
- StringBuffer result = new StringBuffer ();
- for (int i = 0; i < elts.size (); ++i)
- {
- // For simplicity we choose to always quote using escapes and
- // never quotes.
- String elt = (String) elts.get (i);
- if (i > 0
- || (i == elts.size () - 1 && elt.equals ("")))
- result.append ('/');
- for (int k = 0; k < elt.length (); ++k)
- {
- char c = elt.charAt (k);
- // We must quote
- // ... a leading quote,
- if ((k == 0 && (c == '"' || c == '\''))
- // ... an escape preceding a meta character,
- // or at the end of a component,
- || (c == '\\'
- && (k == elt.length () - 1
- || "\\'\"/".indexOf (elt.charAt (k + 1)) != -1))
- // ... or a component separator.
- || c == '/')
- result.append ('\\');
- result.append (c);
- }
- }
- return result.toString ();
- }
-
- private transient Vector elts;
-}
diff --git a/libjava/javax/naming/CompoundName.java b/libjava/javax/naming/CompoundName.java
deleted file mode 100644
index 4b30557f8d3..00000000000
--- a/libjava/javax/naming/CompoundName.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/* CompoundName.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import java.util.Properties;
-import java.util.Vector;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date May 16, 2001
- *
- * FIXME: must write readObject and writeObject to conform to
- * serialization spec.
- *
- * FIXME: this class is underspecified. For instance, the `flat'
- * direction is never described. If it means that the CompoundName
- * can only have a single element, then the Enumeration-based
- * constructor ought to throw InvalidNameException.
- *
- * @since 1.3
- */
-public class CompoundName implements Name, Cloneable, Serializable
-{
- private static final long serialVersionUID = 3513100557083972036L;
-
- private CompoundName (Properties syntax)
- {
- elts = new Vector ();
- mySyntax = syntax;
- initializeSyntax ();
- }
-
- protected CompoundName (Enumeration comps, Properties syntax)
- {
- elts = new Vector ();
- mySyntax = syntax;
- initializeSyntax ();
- try
- {
- while (comps.hasMoreElements ())
- elts.add (comps.nextElement ());
- }
- catch (NoSuchElementException ignore)
- {
- }
- }
-
- public CompoundName (String n, Properties syntax)
- throws InvalidNameException
- {
- elts = new Vector ();
- mySyntax = syntax;
- initializeSyntax ();
-
- StringBuffer new_element = new StringBuffer ();
- int i = 0;
- // QUOTE==null means no quoting right now. When it is set it is
- // the value of the closing quote.
- String quote = null;
- while (i < n.length ())
- {
- String special = isSpecial (n, i);
-
- if (special == escape && escape != null)
- {
- if (n.length () == i + special.length ())
- {
- // A trailing escape is treated as itself.
- new_element.append (special);
- i += special.length ();
- }
- else
- {
- String eSpecial = isSpecial (n, i + special.length ());
- if (eSpecial != null)
- {
- // Treat the escape as an escape.
- new_element.append (eSpecial);
- i += special.length () + eSpecial.length ();
- }
- else
- {
- // Treat the escape as itself.
- new_element.append (special);
- i += special.length ();
- }
- continue;
- }
- }
- else if (quote != null)
- {
- // It is safe to use == here.
- if (quote == special)
- {
- // Quotes must surround a complete component.
- if (i + quote.length () < n.length ()
- && ! n.startsWith (separator, i + quote.length ()))
- throw new InvalidNameException ("close quote before end of component");
- elts.add (new_element.toString ());
- new_element.setLength (0);
- i += quote.length ();
- quote = null;
- continue;
- }
- // Otherwise, fall through.
- }
- // Quotes are only special at the start of a component.
- else if (new_element.length () == 0
- && special == beginQuote
- && beginQuote != null)
- {
- quote = endQuote;
- i += special.length ();
- continue;
- }
- else if (new_element.length () == 0
- && special == beginQuote2
- && beginQuote2 != null)
- {
- quote = endQuote2;
- i += special.length ();
- continue;
- }
- else if (direction != FLAT && special == separator)
- {
- elts.add (new_element.toString ());
- new_element.setLength (0);
- i += special.length ();
- continue;
- }
-
- // Nothing in particular, so try the next character.
- new_element.append (n.charAt (i));
- ++i;
- }
-
- if (new_element.length () != 0)
- elts.add (new_element.toString ());
-
- if (direction == RIGHT_TO_LEFT)
- {
- // Reverse the order of the elements.
- int len = elts.size ();
- for (i = 0; i < len / 2; ++i)
- {
- Object t = elts.set (i, elts.get (len - i - 1));
- elts.set (len - i - 1, t);
- }
- }
-
- // Error checking.
- if (quote != null)
- throw new InvalidNameException ("unterminated quote");
- }
-
- public Name add (int posn, String comp) throws InvalidNameException
- {
- elts.add (posn, comp);
- return this;
- }
-
- public Name add (String comp) throws InvalidNameException
- {
- elts.add (comp);
- return this;
- }
-
- public Name addAll (int posn, Name n) throws InvalidNameException
- {
- Enumeration e = n.getAll ();
- try
- {
- while (e.hasMoreElements ())
- {
- elts.add (posn, e.nextElement ());
- ++posn;
- }
- }
- catch (NoSuchElementException ignore)
- {
- }
- return this;
- }
-
- public Name addAll (Name suffix) throws InvalidNameException
- {
- Enumeration e = suffix.getAll ();
- try
- {
- while (e.hasMoreElements ())
- elts.add (e.nextElement ());
- }
- catch (NoSuchElementException ignore)
- {
- }
- return this;
- }
-
- public Object clone ()
- {
- return new CompoundName (elts.elements (), mySyntax);
- }
-
- public int compareTo (Object obj)
- {
- if (! (obj instanceof CompoundName))
- throw new ClassCastException ("CompoundName.compareTo() expected CompoundName");
- CompoundName cn = (CompoundName) obj;
- int last = Math.min (cn.elts.size (), elts.size ());
- for (int i = 0; i < last; ++i)
- {
- String f = canonicalize ((String) elts.get (i));
- int comp = f.compareTo (canonicalize ((String) cn.elts.get (i)));
- if (comp != 0)
- return comp;
- }
- return elts.size () - cn.elts.size ();
- }
-
- public boolean endsWith (Name n)
- {
- if (! (n instanceof CompoundName))
- return false;
- CompoundName cn = (CompoundName) n;
- if (cn.elts.size () > elts.size ())
- return false;
- int delta = elts.size () - cn.elts.size ();
- for (int i = 0; i < cn.elts.size (); ++i)
- {
- String f = canonicalize ((String) elts.get (delta + i));
- if (! f.equals (canonicalize ((String) cn.elts.get (i))))
- return false;
- }
- return true;
- }
-
- public boolean equals (Object obj)
- {
- if (! (obj instanceof CompoundName))
- return false;
- return compareTo (obj) == 0;
- }
-
- public String get (int posn)
- {
- return (String) elts.get (posn);
- }
-
- public Enumeration getAll ()
- {
- return elts.elements ();
- }
-
- public Name getPrefix (int posn)
- {
- CompoundName cn = new CompoundName (mySyntax);
- for (int i = 0; i < posn; ++i)
- cn.elts.add (elts.get (i));
- return cn;
- }
-
- public Name getSuffix (int posn)
- {
- if (posn > elts.size ())
- throw new ArrayIndexOutOfBoundsException (posn);
- CompoundName cn = new CompoundName (mySyntax);
- for (int i = posn; i < elts.size (); ++i)
- cn.elts.add (elts.get (i));
- return cn;
- }
-
- public int hashCode ()
- {
- int h = 0;
- for (int i = 0; i < elts.size (); ++i)
- h += canonicalize ((String) elts.get (i)).hashCode ();
- return h;
- }
-
- public boolean isEmpty ()
- {
- return elts.isEmpty ();
- }
-
- public Object remove (int posn) throws InvalidNameException
- {
- return elts.remove (posn);
- }
-
- public int size ()
- {
- return elts.size ();
- }
-
- public boolean startsWith (Name n)
- {
- if (! (n instanceof CompoundName))
- return false;
- CompoundName cn = (CompoundName) n;
- if (cn.elts.size () > elts.size ())
- return false;
- for (int i = 0; i < cn.elts.size (); ++i)
- {
- String f = canonicalize ((String) elts.get (i));
- if (! f.equals (canonicalize ((String) cn.elts.get (i))))
- return false;
- }
- return true;
- }
-
- // If ELEMENT starts with some meta-sequence at OFFSET, then return
- // the string representing the meta-sequence. Otherwise return
- // null.
- private String isSpecial (String element, int offset)
- {
- String special = null;
- if (separator != null && element.startsWith (separator, offset))
- special = separator;
- else if (escape != null && element.startsWith (escape, offset))
- special = escape;
- else if (beginQuote != null && element.startsWith (beginQuote, offset))
- special = beginQuote;
- else if (endQuote != null && element.startsWith (endQuote, offset))
- special = endQuote;
- else if (beginQuote2 != null
- && element.startsWith (beginQuote2, offset))
- special = beginQuote2;
- else if (endQuote2 != null && element.startsWith (endQuote2, offset))
- special = endQuote2;
-
- return special;
- }
-
- public String toString ()
- {
- StringBuffer result = new StringBuffer ();
- int size = elts.size ();
- for (int i = 0; i < size; ++i)
- {
- // Find the appropriate element. FIXME: not clear what FLAT
- // means.
- int offset = (direction == RIGHT_TO_LEFT) ? (size - i - 1) : i;
- String element = (String) elts.get (offset);
- if (i > 0
- || (i == size - 1 && element.equals ("")))
- result.append (separator);
-
- int k = 0;
- while (k < element.length ())
- {
- String special = isSpecial (element, k);
- if (special != null)
- {
- result.append (escape);
- result.append (special);
- k += special.length ();
- }
- else
- {
- result.append (element.charAt (k));
- ++k;
- }
- }
- }
-
- return result.toString ();
- }
-
- // This canonicalizes a String, based on the syntax, for comparison
- // or other similar purposes.
- private String canonicalize (String element)
- {
- String ret = element;
-
- if (ignoreCase)
- ret = ret.toLowerCase ();
-
- if (trimBlanks)
- {
- int first = 0;
- while (first < ret.length ()
- && Character.isWhitespace (ret.charAt (first)))
- ++first;
-
- int last = ret.length () - 1;
- while (last >= first
- && Character.isWhitespace (ret.charAt (last)))
- --last;
-
- ret = ret.substring (first, last);
- }
-
- return ret;
- }
-
- // This initializes all the syntax variables. This seems easier
- // than re-querying the properties every time. We're allowed to do
- // this because the spec says that subclasses should consider the
- // syntax as being read-only.
- private void initializeSyntax ()
- {
- String t = mySyntax.getProperty ("jndi.syntax.direction", "flat");
- if (t.equals ("right_to_left"))
- this.direction = RIGHT_TO_LEFT;
- else if (t.equals ("left_to_right"))
- this.direction = LEFT_TO_RIGHT;
- else
- {
- // If we don't recognize it, default to flat.
- this.direction = FLAT;
- }
-
- // This is required unless the direction is FLAT. Unfortunately
- // there is no way to report this error.
- this.separator = mySyntax.getProperty ("jndi.syntax.separator", "");
-
- this.ignoreCase
- = Boolean.valueOf (mySyntax.getProperty ("jndi.syntax.ignorecase",
- "false")).booleanValue ();
- this.escape = mySyntax.getProperty ("jndi.syntax.escape", null);
- this.beginQuote = mySyntax.getProperty ("jndi.syntax.beginquote", null);
- this.endQuote = mySyntax.getProperty ("jndi.syntax.endquote",
- this.beginQuote);
- this.beginQuote2 = mySyntax.getProperty ("jndi.syntax.beginquote2",
- null);
- this.endQuote2 = mySyntax.getProperty ("jndi.syntax.endquote2",
- this.beginQuote2);
- this.trimBlanks
- = Boolean.valueOf (mySyntax.getProperty ("jndi.syntax.trimblanks",
- "false")).booleanValue ();
- }
-
- // The spec specifies this but does not document it in any way (it
- // is a package-private class). It is useless as far as I can tell.
- // So we ignore it.
- // protected transient NameImpl impl;
- protected transient Properties mySyntax;
-
- // The actual elements.
- private transient Vector elts;
-
- // The following are all used for syntax.
- private transient int direction;
- private transient String separator;
- private transient boolean ignoreCase;
- private transient String escape;
- private transient String beginQuote;
- private transient String endQuote;
- private transient String beginQuote2;
- private transient String endQuote2;
- private transient boolean trimBlanks;
- // We didn't need these for parsing, so they are gone.
- // private transient String avaSeparator;
- // private transient String typevalSeparator;
-
- private static final int RIGHT_TO_LEFT = -1;
- private static final int LEFT_TO_RIGHT = 1;
- private static final int FLAT = 0;
-}
diff --git a/libjava/javax/naming/ConfigurationException.java b/libjava/javax/naming/ConfigurationException.java
deleted file mode 100644
index 196654865b8..00000000000
--- a/libjava/javax/naming/ConfigurationException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ConfigurationException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class ConfigurationException extends NamingException
-{
- public ConfigurationException ()
- {
- super ();
- }
-
- public ConfigurationException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/Context.java b/libjava/javax/naming/Context.java
deleted file mode 100644
index 9df82c68490..00000000000
--- a/libjava/javax/naming/Context.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/* Context.java --
- Copyright (C) 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.util.Hashtable;
-
-public interface Context
-{
- // Property with name of the inital context factory to use
- String INITIAL_CONTEXT_FACTORY
- = "java.naming.factory.initial";
-
- // Property with colon-separated list of object factories to use.
- String OBJECT_FACTORIES
- = "java.naming.factory.object";
-
- // Property with colon-separated list of state factories to use.
- String STATE_FACTORIES
- = "java.naming.factory.state";
-
- // Property with colon-separated list of package prefixes to use.
- String URL_PKG_PREFIXES
- = "java.naming.factory.url.pkgs";
-
- // Property with URL specifying configuration for the service
- // provider to use.
- String PROVIDER_URL
- = "java.naming.provider.url";
-
- // Property with the DNS host and domain names to use.
- String DNS_URL
- = "java.naming.dns.url";
-
- // Property with the authoritativeness of the service requested.
- String AUTHORITATIVE
- = "java.naming.authoritative";
-
- // Property with the batch size to use when returning data via the
- // service's protocol.
- String BATCHSIZE
- = "java.naming.batchsize";
-
- // Property defining how referrals encountered by the service
- // provider are to be processed.
- String REFERRAL
- = "java.naming.referral";
-
- // Property specifying the security protocol to use.
- String SECURITY_PROTOCOL
- = "java.naming.security.protocol";
-
- // Property specifying the security level to use.
- String SECURITY_AUTHENTICATION
- = "java.naming.security.authentication";
-
- // Property for the identity of the principal for authenticating
- // the caller to the service.
- String SECURITY_PRINCIPAL
- = "java.naming.security.principal";
-
- // Property specifying the credentials of the principal for
- // authenticating the caller to the service.
- String SECURITY_CREDENTIALS
- = "java.naming.security.credentials";
-
- // Property for specifying the preferred language to use with the
- // service.
- String LANGUAGE
- = "java.naming.language";
-
- // Property for the initial context constructor to use when searching
- // for other properties.
- String APPLET
- = "java.naming.applet";
-
- void bind (Name name, Object obj) throws NamingException;
- void bind (String name, Object obj) throws NamingException;
-
- Object lookup (Name name) throws NamingException;
- Object lookup (String name) throws NamingException;
-
- void rebind (Name name, Object obj) throws NamingException;
- void rebind (String name, Object obj) throws NamingException;
-
- void unbind (Name name) throws NamingException;
- void unbind (String name) throws NamingException;
-
- void rename (Name oldName, Name newName) throws NamingException;
- void rename (String oldName, String newName) throws NamingException;
-
- NamingEnumeration list (Name name) throws NamingException;
- NamingEnumeration list (String name) throws NamingException;
-
- NamingEnumeration listBindings (Name name) throws NamingException;
- NamingEnumeration listBindings (String name) throws NamingException;
-
- void destroySubcontext (Name name) throws NamingException;
- void destroySubcontext (String name) throws NamingException;
-
- Context createSubcontext (Name name) throws NamingException;
- Context createSubcontext (String name) throws NamingException;
-
- Object lookupLink (Name name) throws NamingException;
- Object lookupLink (String name) throws NamingException;
-
- NameParser getNameParser (Name name) throws NamingException;
- NameParser getNameParser (String name) throws NamingException;
-
- Name composeName (Name name, Name prefix) throws NamingException;
- String composeName (String name,
- String prefix) throws NamingException;
-
- Object addToEnvironment (String propName,
- Object propVal) throws NamingException;
-
- Object removeFromEnvironment (String propName) throws NamingException;
-
- Hashtable getEnvironment () throws NamingException;
-
- void close () throws NamingException;
-
- String getNameInNamespace () throws NamingException;
-}
-
diff --git a/libjava/javax/naming/ContextNotEmptyException.java b/libjava/javax/naming/ContextNotEmptyException.java
deleted file mode 100644
index c6fe5e81c39..00000000000
--- a/libjava/javax/naming/ContextNotEmptyException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ContextNotEmptyException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class ContextNotEmptyException extends NamingException
-{
- public ContextNotEmptyException ()
- {
- super ();
- }
-
- public ContextNotEmptyException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/InitialContext.java b/libjava/javax/naming/InitialContext.java
deleted file mode 100644
index 1a9ee5a2738..00000000000
--- a/libjava/javax/naming/InitialContext.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/* InitialContext.java --
- Copyright (C) 2000, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.applet.Applet;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Properties;
-
-import javax.naming.spi.NamingManager;
-
-public class InitialContext implements Context
-{
- protected Context defaultInitCtx;
- protected boolean gotDefault = false;
- protected Hashtable myProps;
-
- public InitialContext (Hashtable environment)
- throws NamingException
- {
- init (environment);
- }
-
- protected InitialContext (boolean lazy)
- throws NamingException
- {
- if (! lazy)
- init (null);
- }
-
- public InitialContext ()
- throws NamingException
- {
- init (null);
- }
-
- /** @since 1.3 */
- protected void init (Hashtable environment)
- throws NamingException
- {
- // FIXME: Is this enough?
- final String[] properties = {
- Context.DNS_URL,
- Context.INITIAL_CONTEXT_FACTORY,
- Context.OBJECT_FACTORIES,
- Context.PROVIDER_URL,
- Context.STATE_FACTORIES,
- Context.URL_PKG_PREFIXES,
- };
-
- // Create myProps, cloning environment if needed.
- if (environment != null)
- myProps = (Hashtable) environment.clone ();
- else
- myProps = new Hashtable ();
-
- Applet napplet = (Applet) myProps.get (Context.APPLET);
-
- for (int i = properties.length - 1; i >= 0; i--)
- {
- Object o = myProps.get (properties[i]);
-
- if (o == null)
- {
- if (napplet != null)
- o = napplet.getParameter (properties[i]);
- if (o == null)
- o = System.getProperty (properties[i]);
- if (o != null)
- myProps.put (properties[i], o);
- }
- }
-
- try
- {
- Enumeration ep = Thread.currentThread().getContextClassLoader().getResources("jndi.naming");
- while (ep.hasMoreElements ())
- {
- URL url = (URL) ep.nextElement ();
- Properties p = new Properties ();
-
- try
- {
- InputStream is = url.openStream ();
- p.load (is);
- is.close ();
- }
- catch (IOException e)
- {
- }
-
- merge (myProps, p);
- }
- }
- catch (IOException e)
- {
- }
-
- String home = System.getProperty("gnu.classpath.home.url");
- if (home != null)
- {
- String url = home + "/jndi.properties";
- Properties p = new Properties ();
-
- try
- {
- InputStream is = new URL(url).openStream();
- p.load (is);
- is.close ();
- }
- catch (IOException e)
- {
- // Ignore.
- }
-
- merge (myProps, p);
- }
- }
-
- // FIXME: Is this enough?
- private static final String[] colon_list =
- {
- Context.OBJECT_FACTORIES,
- Context.URL_PKG_PREFIXES,
- Context.STATE_FACTORIES
- };
-
- private static void merge (Hashtable h1, Hashtable h2)
- {
- Enumeration e2 = h2.keys();
-
- while (e2.hasMoreElements())
- {
- String key2 = (String) e2.nextElement();
- Object value1 = h1.get(key2);
- if (value1 == null)
- h1.put(key2, h2.get(key2));
- else if (key2.compareTo(colon_list[0]) == 0
- || key2.compareTo(colon_list[1]) == 0
- || key2.compareTo(colon_list[2]) == 0
- || key2.compareTo(colon_list[3]) == 0)
- {
- String value2 = (String) h2.get(key2);
- h1.put(key2, (String) value1 + ":" + value2);
- }
- }
- }
-
- protected Context getDefaultInitCtx () throws NamingException
- {
- if (! gotDefault)
- {
- defaultInitCtx = NamingManager.getInitialContext (myProps);
- gotDefault = true;
- }
- return defaultInitCtx;
- }
-
-
- protected Context getURLOrDefaultInitCtx (Name name)
- throws NamingException
- {
- if (name.size () > 0)
- return getURLOrDefaultInitCtx (name.get (0));
- else
- return getDefaultInitCtx ();
- }
-
- protected Context getURLOrDefaultInitCtx (String name)
- throws NamingException
- {
- String scheme = null;
-
- if (NamingManager.hasInitialContextFactoryBuilder())
- return getDefaultInitCtx();
- int colon = name.indexOf(':');
- int slash = name.indexOf('/');
- if (colon > 0 && (slash == -1 || colon < slash))
- scheme = name.substring(0, colon);
- if (scheme != null)
- {
- Context context =
- NamingManager.getURLContext(scheme, myProps);
- if (context != null)
- return context;
- }
-
- return getDefaultInitCtx();
- }
-
- public void bind (Name name, Object obj) throws NamingException
- {
- getURLOrDefaultInitCtx (name).bind (name, obj);
- }
-
- public void bind (String name, Object obj) throws NamingException
- {
- getURLOrDefaultInitCtx (name).bind (name, obj);
- }
-
- public Object lookup (Name name) throws NamingException
- {
- try
- {
- return getURLOrDefaultInitCtx (name).lookup (name);
- }
- catch (CannotProceedException cpe)
- {
- Context ctx = NamingManager.getContinuationContext (cpe);
- return ctx.lookup (cpe.getRemainingName());
- }
- }
-
- public Object lookup (String name) throws NamingException
- {
- try
- {
- return getURLOrDefaultInitCtx (name).lookup (name);
- }
- catch (CannotProceedException cpe)
- {
- Context ctx = NamingManager.getContinuationContext (cpe);
- return ctx.lookup (cpe.getRemainingName());
- }
- }
-
- public void rebind (Name name, Object obj) throws NamingException
- {
- getURLOrDefaultInitCtx (name).rebind (name, obj);
- }
-
- public void rebind (String name, Object obj) throws NamingException
- {
- getURLOrDefaultInitCtx (name).rebind (name, obj);
- }
-
- public void unbind (Name name) throws NamingException
- {
- getURLOrDefaultInitCtx (name).unbind (name);
- }
-
- public void unbind (String name) throws NamingException
- {
- getURLOrDefaultInitCtx (name).unbind (name);
- }
-
- public void rename (Name oldName, Name newName) throws NamingException
- {
- getURLOrDefaultInitCtx (oldName).rename (oldName, newName);
- }
-
- public void rename (String oldName, String newName) throws NamingException
- {
- getURLOrDefaultInitCtx (oldName).rename (oldName, newName);
- }
-
- public NamingEnumeration list (Name name) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).list (name);
- }
-
- public NamingEnumeration list (String name) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).list (name);
- }
-
- public NamingEnumeration listBindings (Name name) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).listBindings (name);
- }
-
- public NamingEnumeration listBindings (String name) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).listBindings (name);
- }
-
- public void destroySubcontext (Name name) throws NamingException
- {
- getURLOrDefaultInitCtx (name).destroySubcontext (name);
- }
-
- public void destroySubcontext (String name) throws NamingException
- {
- getURLOrDefaultInitCtx (name).destroySubcontext (name);
- }
-
- public Context createSubcontext (Name name) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).createSubcontext (name);
- }
-
- public Context createSubcontext (String name) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).createSubcontext (name);
- }
-
- public Object lookupLink (Name name) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).lookupLink (name);
- }
-
- public Object lookupLink (String name) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).lookupLink (name);
- }
-
- public NameParser getNameParser (Name name) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).getNameParser (name);
- }
-
- public NameParser getNameParser (String name) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).getNameParser (name);
- }
-
- public Name composeName (Name name, Name prefix) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).composeName (name, prefix);
- }
-
- public String composeName (String name,
- String prefix) throws NamingException
- {
- return getURLOrDefaultInitCtx (name).composeName (name, prefix);
- }
-
- public Object addToEnvironment (String propName,
- Object propVal) throws NamingException
- {
- return myProps.put (propName, propVal);
- }
-
- public Object removeFromEnvironment (String propName) throws NamingException
- {
- return myProps.remove (propName);
- }
-
- public Hashtable getEnvironment () throws NamingException
- {
- return myProps;
- }
-
- public void close () throws NamingException
- {
- myProps = null;
- defaultInitCtx = null;
- }
-
- public String getNameInNamespace () throws NamingException
- {
- throw new OperationNotSupportedException ();
- }
-}
diff --git a/libjava/javax/naming/InsufficientResourcesException.java b/libjava/javax/naming/InsufficientResourcesException.java
deleted file mode 100644
index bcb9fe577f8..00000000000
--- a/libjava/javax/naming/InsufficientResourcesException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* InsufficientResourcesException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class InsufficientResourcesException extends NamingException
-{
- public InsufficientResourcesException ()
- {
- super ();
- }
-
- public InsufficientResourcesException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/InterruptedNamingException.java b/libjava/javax/naming/InterruptedNamingException.java
deleted file mode 100644
index 8cdf30d4e4c..00000000000
--- a/libjava/javax/naming/InterruptedNamingException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* InterruptedNamingException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class InterruptedNamingException extends NamingException
-{
- public InterruptedNamingException ()
- {
- super ();
- }
-
- public InterruptedNamingException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/InvalidNameException.java b/libjava/javax/naming/InvalidNameException.java
deleted file mode 100644
index a3b99e1f69f..00000000000
--- a/libjava/javax/naming/InvalidNameException.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* InvalidNameException.java -- Exception indicating an invalid component/name
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-/**
- * Exception indicating an invalid component or <code>Name</code>.
- * Thrown when a <code>Name</code> or component of a name is encountered that
- * does not follow the syntactic rules of a particular <code>Name</code> class.
- *
- * @author Anthony Green (green@redhat.com)
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class InvalidNameException extends NamingException
-{
- /**
- * Creates a new exception without setting any of its fields.
- */
- public InvalidNameException ()
- {
- super ();
- }
-
- /**
- * Creates a new exception and sets the detailed message field.
- * All other fields are not set.
- */
- public InvalidNameException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/LimitExceededException.java b/libjava/javax/naming/LimitExceededException.java
deleted file mode 100644
index 7e7af81c76b..00000000000
--- a/libjava/javax/naming/LimitExceededException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* LimitExceededException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class LimitExceededException extends NamingException
-{
- public LimitExceededException ()
- {
- super ();
- }
-
- public LimitExceededException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/LinkException.java b/libjava/javax/naming/LinkException.java
deleted file mode 100644
index 2c3c507113c..00000000000
--- a/libjava/javax/naming/LinkException.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* LinkException.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 14, 2001
- */
-
-public class LinkException extends NamingException
-{
- // Serialized fields.
- protected Name linkResolvedName;
- protected Object linkResolvedObj;
- protected Name linkRemainingName;
- protected String linkExplanation;
-
- public LinkException ()
- {
- super ();
- }
-
- public LinkException (String msg)
- {
- super (msg);
- }
-
- public Name getLinkResolvedName()
- {
- return linkResolvedName;
- }
-
- public Name getLinkRemainingName()
- {
- return linkRemainingName;
- }
-
- public Object getLinkResolvedObj()
- {
- return linkResolvedObj;
- }
-
- public String getLinkExplanation()
- {
- return linkExplanation;
- }
-
- public void setLinkExplanation(String msg)
- {
- linkExplanation = msg;
- }
-
- public void setLinkResolvedName(Name name)
- {
- linkResolvedName = (Name) name.clone();
- }
-
- public void setLinkRemainingName(Name name)
- {
- linkRemainingName = (Name) name.clone();
- }
-
- public void setLinkResolvedObj(Object obj)
- {
- linkResolvedObj = obj;
- }
-
- public String toString ()
- {
- return super.toString () + "; " + linkRemainingName.toString ();
- }
-
- public String toString (boolean detail)
- {
- String r = super.toString (detail) + "; " + linkRemainingName.toString ();
- if (detail)
- r += "; " + linkResolvedObj.toString ();
- return r;
- }
-}
diff --git a/libjava/javax/naming/LinkLoopException.java b/libjava/javax/naming/LinkLoopException.java
deleted file mode 100644
index 9c00dbeb622..00000000000
--- a/libjava/javax/naming/LinkLoopException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* LinkLoopException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class LinkLoopException extends LinkException
-{
- public LinkLoopException ()
- {
- super ();
- }
-
- public LinkLoopException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/LinkRef.java b/libjava/javax/naming/LinkRef.java
deleted file mode 100644
index 35d9a406f66..00000000000
--- a/libjava/javax/naming/LinkRef.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* LinkRef.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date May 16, 2001
- */
-public class LinkRef extends Reference
-{
- private static final long serialVersionUID = -5386290613498931298L;
-
- public LinkRef (Name name)
- {
- this (name.toString ());
- }
-
- public LinkRef (String name)
- {
- // FIXME: javax.naming.LinkRef?
- super ("LinkRef", new StringRefAddr ("LinkAddress", name));
- }
-
- public String getLinkName ()
- throws NamingException
- {
- StringRefAddr sra = (StringRefAddr) get (0);
- return (String) sra.getContent ();
- }
-}
diff --git a/libjava/javax/naming/MalformedLinkException.java b/libjava/javax/naming/MalformedLinkException.java
deleted file mode 100644
index 5422b90946f..00000000000
--- a/libjava/javax/naming/MalformedLinkException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* MalformedLinkException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class MalformedLinkException extends LinkException
-{
- public MalformedLinkException ()
- {
- super ();
- }
-
- public MalformedLinkException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/Name.java b/libjava/javax/naming/Name.java
deleted file mode 100644
index f8592d9ea3d..00000000000
--- a/libjava/javax/naming/Name.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/* Name.java -- Name build up from different components
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-
-/**
- * Interface descriping a name build up from different components.
- * The components are represented as <code>String</code>s which are
- * ordered from most significant to least significant. There are methods to
- * get the number of components. Methods to get a particular component or group
- * of components. Components can be added as <code>String</code>s or
- * <code>Name</code>s and a component can be removed from any position in the
- * <code>Name</code>.
- * A <code>Name</code> can be compared to another <code>Name</code> and it can
- * be checked if a particular <code>Name</code> starts or ends with the same
- * components as another <code>Name</code>. Finally <code>Name</code>s can be
- * serialized and cloned.
- * <p>
- * Since <code>Name</code>s can be empty (have no components) methods that
- * return a <code>Name</code> will never return <code>null</code>.
- *
- * @since 1.3
- * @author Anthony Green (green@redhat.com)
- * @author Mark Wielaard (mark@klomp.org)
- */
-public interface Name extends Cloneable, Serializable
-{
- long serialVersionUID = -3617482732056931635L;
-
- /**
- * Returns the number of components of this <code>Name</code>.
- * The returned number can be zero.
- */
- int size();
-
- /**
- * Returns <code>true</code> if the number of components of this
- * <code>Name</code> is zero, <code>false</code> otherwise.
- */
- boolean isEmpty();
-
- /**
- * Returns a non-null (but possibly empty) <code>Enumeration</code> of the
- * components of the <code>Name</code> as <code>String</code>s.
- */
- Enumeration getAll();
-
- /**
- * Gets the component at the given index.
- *
- * @exception ArrayIndexOutOfBoundsException if the given index is smaller
- * then zero or greater then or equal to <code>size()</code>.
- */
- String get(int i);
-
- /**
- * Returns the components till the given index as a <code>Name</code>.
- * The returned <code>Name</code> can be modified without changing the
- * original.
- *
- * @exception ArrayIndexOutOfBoundsException if the given index is smaller
- * then zero or greater then or equal to <code>size()</code>.
- */
- Name getPrefix(int i);
-
- /**
- * Returns the components from the given index till the end as a
- * <code>Name</code>.
- * The returned <code>Name</code> can be modified without changing the
- * original.
- *
- * @exception ArrayIndexOutOfBoundsException if the given index is smaller
- * then zero or greater then or equal to <code>size()</code>.
- */
- Name getSuffix(int i);
-
- /**
- * Adds the given <code>String</code> component to the end of this
- * <code>Name</code>. The method modifies the current <code>Name</code> and
- * then returns it.
- *
- * @exception InvalidNameException if the given <code>String</code> is not a
- * valid component for this <code>Name</code>.
- */
- Name add(String comp) throws InvalidNameException;
-
- /**
- * Inserts the given <code>String</code> component to this <code>Name</code>
- * at the given index. The method modifies the current <code>Name</code> and
- * then returns it.
- *
- * @exception ArrayIndexOutOfBoundsException if the given index is smaller
- * then zero or greater then or equal to <code>size()</code>.
- * @exception InvalidNameException if the given <code>String</code> is not a
- * valid component for this <code>Name</code>.
- */
- Name add(int posn, String comp) throws InvalidNameException;
-
- /**
- * Adds all the components of the given <code>Name</code> to the end of this
- * <code>Name</code>. The method modifies the current <code>Name</code> and
- * then returns it.
- *
- * @exception InvalidNameException if any of the given components is not a
- * valid component for this <code>Name</code>.
- */
- Name addAll(Name suffix) throws InvalidNameException;
-
- /**
- * Inserts all the components of the given <code>Name</code> to this
- * <code>Name</code> at the given index. The method modifies the current
- * <code>Name</code> and then returns it.
- *
- * @exception ArrayIndexOutOfBoundsException if the given index is smaller
- * then zero or greater then or equal to <code>size()</code>.
- * @exception InvalidNameException if any of the given components is not a
- * valid component for this <code>Name</code>.
- */
- Name addAll(int posn, Name n) throws InvalidNameException;
-
- /**
- * Removes the component at the given index from this <code>Name</code>.
- * The method modifies the current <code>Name</code> and then returns it.
- *
- * @exception InvalidNameException if the given <code>String</code> is not a
- * valid component for this <code>Name</code>.
- */
- Object remove(int posn) throws InvalidNameException;
-
- /**
- * Returns <code>true</code> if this <code>Name</code> starts with the
- * components of the given <code>Name</code>, <code>false</code> otherwise.
- */
- boolean startsWith(Name name);
-
- /**
- * Returns <code>true</code> if this <code>Name</code> ends with the
- * components of the given <code>Name</code>, <code>false</code> otherwise.
- */
- boolean endsWith(Name name);
-
- /**
- * Compares the given object to this <code>Name</code>.
- * Returns a negative value if the given <code>Object</code> is smaller then
- * this <code>Name</code>, a positive value if the <code>Object</code> is
- * bigger, and zero if the are equal. If the <code>Object</code> is not of
- * a class that can be compared to the class of this <code>Name</code> then
- * a <code>ClassCastException</code> is thrown. Note that it is not
- * guaranteed that <code>Name</code>s implemented in different classes can
- * be compared. The definition of smaller, bigger and equal is up to the
- * actual implementing class.
- */
- int compareTo(Object obj);
-
- /**
- * Returns a clone of this <code>Name</code>. It will be a deep copy of
- * all the components of the <code>Name</code> so that changes to components
- * of the components does not change the component in this <code>Name</code>.
- */
- Object clone();
-}
diff --git a/libjava/javax/naming/NameAlreadyBoundException.java b/libjava/javax/naming/NameAlreadyBoundException.java
deleted file mode 100644
index 4b2fb0e74f9..00000000000
--- a/libjava/javax/naming/NameAlreadyBoundException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* NameAlreadyBoundException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class NameAlreadyBoundException extends NamingException
-{
- public NameAlreadyBoundException ()
- {
- super ();
- }
-
- public NameAlreadyBoundException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/NameClassPair.java b/libjava/javax/naming/NameClassPair.java
deleted file mode 100644
index 4e260513171..00000000000
--- a/libjava/javax/naming/NameClassPair.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* NameClassPair.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.io.Serializable;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date May 16, 2001
- */
-public class NameClassPair implements Serializable
-{
- public NameClassPair (String name, String className)
- {
- this (name, className, true);
- }
-
- public NameClassPair (String name, String className, boolean isRelative)
- {
- this.name = name;
- this.className = className;
- this.isRel = isRelative;
- }
-
- public String getClassName ()
- {
- return className;
- }
-
- public String getName ()
- {
- return name;
- }
-
- public boolean isRelative ()
- {
- return isRel;
- }
-
- public void setClassName (String name)
- {
- this.className = name;
- }
-
- public void setName (String name)
- {
- this.name = name;
- }
-
- public void setRelative (boolean r)
- {
- this.isRel = r;
- }
-
- public String toString ()
- {
- // Specified by class documentation.
- return name + ":" + className;
- }
-
- // These field names are fixed by the serialization spec.
- private String name;
- private String className;
- private boolean isRel;
-}
diff --git a/libjava/javax/naming/NameNotFoundException.java b/libjava/javax/naming/NameNotFoundException.java
deleted file mode 100644
index b533b041261..00000000000
--- a/libjava/javax/naming/NameNotFoundException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* NameNotFoundException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class NameNotFoundException extends NamingException
-{
- public NameNotFoundException ()
- {
- super ();
- }
-
- public NameNotFoundException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/NameParser.java b/libjava/javax/naming/NameParser.java
deleted file mode 100644
index 1aeaf3600c4..00000000000
--- a/libjava/javax/naming/NameParser.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/* NameParser.java --
- Copyright (C) 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-public interface NameParser
-{
- Name parse (String name) throws NamingException;
-}
-
-
diff --git a/libjava/javax/naming/NamingEnumeration.java b/libjava/javax/naming/NamingEnumeration.java
deleted file mode 100644
index 3c9ee2d011d..00000000000
--- a/libjava/javax/naming/NamingEnumeration.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* NamingEnumeration.java --
- Copyright (C) 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.util.Enumeration;
-
-public interface NamingEnumeration extends Enumeration
-{
- void close() throws NamingException;
- boolean hasMore() throws NamingException;
- Object next() throws NamingException;
-}
diff --git a/libjava/javax/naming/NamingException.java b/libjava/javax/naming/NamingException.java
deleted file mode 100644
index ad3923326db..00000000000
--- a/libjava/javax/naming/NamingException.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/* NamingException.java -- Superclass of all naming Exceptions
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-/**
- * Superclass of all naming Exceptions.
- * Can contain extra information about the root cause of this exception
- * (for example when the original exception was not a subclass of
- * <code>NamingException</code>), the part of the <code>Name</code> that
- * could be resolved (including the <code>Object</code> it resolved to)
- * and the part of the <code>Name</code> that could not be resolved when
- * the exception occured.
- *
- * @since 1.3
- * @author Anthony Green (green@redhat.com)
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class NamingException extends Exception
-{
- private static final long serialVersionUID = -1299181962103167177L;
-
- /**
- * The root cause of this exception. Might be null. Set by calling
- * <code>setRootCause()</code>, can be accessed by calling
- * <code>getRootCause()</code>.
- */
- protected Throwable rootException;
-
- /**
- * If the exception was caused while resolving a <code>Name</code> then
- * this field contains that part of the name that could be resolved.
- * Field might be null. Set by calling <code>setResolvedName()</code>.
- * Can be accessed by calling <code>getResolvedName</code>.
- */
- protected Name resolvedName;
-
- /**
- * If the exception was caused while resolving a <code>Name</code> then
- * this field contains the object that part of the name could be resolved to.
- * Field might be null. Set by calling <code>setResolvedObj()</code>.
- * Can be accessed by calling <code>getResolvedObj</code>.
- */
- protected Object resolvedObj;
-
- /**
- * If the exception was caused while resolving a <code>Name</code> then
- * this field contains that part of the name that could not be resolved.
- * Field might be null. Set by calling <code>setRemainingName()</code>.
- * The field can be extended by calling <code>appendRemainingName()</code>
- * or <code>appendRemainingComponent()</code>.
- * Can be accessed by calling <code>getRemainingName</code>.
- */
- protected Name remainingName;
-
- /**
- * Creates a new NamingException without a message. Does not set any of the
- * <code>rootException</code>, <code>resolvedName</code>,
- * <code>resolvedObj</code> or <code>remainingObject</code> fields.
- * These fields can be set later.
- */
- public NamingException ()
- {
- super();
- }
-
- /**
- * Creates a new NamingException with a detailed message. Does not set
- * the <code>rootException</code>, <code>resolvedName</code>,
- * <code>resolvedObj</code> or <code>remainingObject,</code> fields.
- * These fields can be set later.
- */
- public NamingException (String msg)
- {
- super(msg);
- }
-
- /**
- * Gets the root cause field <code>rootException</code> of this Exception.
- */
- public Throwable getRootCause ()
- {
- return rootException;
- }
-
- /**
- * Sets the root cause field <code>rootException</code> of this Exception.
- */
- public void setRootCause (Throwable e)
- {
- rootException = e;
- }
-
- /**
- * Gets the part of the name that could be resolved before this exception
- * happend. Returns the <code>resolvedName</code> field of this Exception.
- */
- public Name getResolvedName ()
- {
- return resolvedName;
- }
-
- /**
- * Sets the part of the name that could be resolved before this exception
- * happend. Sets the <code>resolvedName</code> field of this Exception.
- */
- public void setResolvedName (Name name)
- {
- resolvedName = name;
- }
-
- /**
- * Gets the Object to which (part of) the name could be resolved before this
- * exception happend. Returns the <code>resolvedObj</code> field of this
- * Exception.
- */
- public Object getResolvedObj ()
- {
- return resolvedObj;
- }
-
- /**
- * Sets the Object to which (part of) the name could be resolved before this
- * exception happend. Sets the <code>resolvedObj</code> field of this
- * Exception.
- */
- public void setResolvedObj (Object o)
- {
- resolvedObj = o;
- }
-
- /**
- * Gets the part of the name that could not be resolved before this exception
- * happend. Returns the <code>remainingName</code> field of this Exception.
- */
- public Name getRemainingName ()
- {
- return remainingName;
- }
-
- /**
- * Sets the part of the name that could be resolved before this exception
- * happend. Sets the <code>resolvedName</code> field of this Exception.
- * The field can be extended by calling <code>appendRemainingName()</code>
- * or <code>appendRemainingComponent()</code>.
- */
- public void setRemainingName (Name name)
- {
- remainingName = name;
- }
-
- /**
- * Adds the given <code>Name</code> to the <code>remainingName</code> field.
- * Does nothing when <code>name</code> is null or when a
- * <code>InvalidNameException</code> is thrown when adding the name.
- *
- * @see Name#addAll(Name)
- */
- public void appendRemainingName (Name name)
- {
- if (name != null)
- try
- {
- remainingName.addAll(name);
- }
- catch(InvalidNameException ine) { /* ignored */ }
- }
-
- /**
- * Adds the given <code>String</code> to the <code>remainingName</code> field.
- * Does nothing when <code>name</code> is null or when a
- * <code>InvalidNameException</code> is thrown when adding the component.
- *
- * @see Name#add(String)
- */
- public void appendRemainingComponent (String name)
- {
- if (name != null)
- try
- {
- remainingName.add(name);
- }
- catch(InvalidNameException ine) { /* ignored */ }
- }
-
- /**
- * Gets the message given to the constructor or null if no message was given.
- *
- * @see Throwable#getMessage();
- */
- public String getExplanation()
- {
- return getMessage();
- }
-
- /**
- * Returns a String representation of this exception and possibly including
- * the part object that could be resolved if the given flag is set to true.
- * Always includes the root cause and the remaining name if not null.
- */
- public String toString(boolean objectInfo)
- {
- StringBuffer sb = new StringBuffer(super.toString());
- Throwable cause = getRootCause();
- if (cause != null)
- {
- sb.append(" caused by ");
- sb.append(cause);
- }
- Name remaining = getRemainingName();
- if (remaining != null)
- {
- sb.append(" [remainingName: ");
- sb.append(remaining);
- }
- Object resolved = getResolvedObj();
- if (objectInfo && resolved != null)
- {
- if (remainingName == null)
- sb.append(" [");
- else
- sb.append(", ");
- sb.append("resolvedObj: ");
- sb.append(resolved);
- }
- if ((remaining != null) || (objectInfo && resolved != null))
- sb.append(']');
-
- return sb.toString();
- }
-
- /**
- * Returns a string representation of this exception.
- * Calls <code>toString(false)</code>.
- */
- public String toString()
- {
- return toString(false);
- }
- /**
- * Prints the stacktrace of this exception or of the root cause if not null.
- */
- public void printStackTrace()
- {
- Throwable cause = getRootCause();
- if (cause != null)
- cause.printStackTrace();
- else
- super.printStackTrace();
- }
-
- /**
- * Prints the stacktrace of this exception or of the root cause if not null
- * to the given <code>PrintStream</code>.
- */
- public void printStackTrace(PrintStream ps)
- {
- Throwable cause = getRootCause();
- if (cause != null)
- cause.printStackTrace(ps);
- else
- super.printStackTrace(ps);
- }
-
- /**
- * Prints the stacktrace of this exception or of the root cause if not null
- * to the given <code>PrintWriter</code>.
- */
- public void printStackTrace(PrintWriter pw)
- {
- Throwable cause = getRootCause();
- if (cause != null)
- cause.printStackTrace(pw);
- else
- super.printStackTrace(pw);
- }
-}
-
diff --git a/libjava/javax/naming/NamingSecurityException.java b/libjava/javax/naming/NamingSecurityException.java
deleted file mode 100644
index ae7f5edf649..00000000000
--- a/libjava/javax/naming/NamingSecurityException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* NamingSecurityException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public abstract class NamingSecurityException extends NamingException
-{
- private static final long serialVersionUID = 5855287647294685775L;
-
- public NamingSecurityException ()
- {
- super ();
- }
-
- public NamingSecurityException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/NoInitialContextException.java b/libjava/javax/naming/NoInitialContextException.java
deleted file mode 100644
index d12dfcb7b27..00000000000
--- a/libjava/javax/naming/NoInitialContextException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* NoInitialContextException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class NoInitialContextException extends NamingException
-{
- public NoInitialContextException()
- {
- super();
- }
-
- public NoInitialContextException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/naming/NoPermissionException.java b/libjava/javax/naming/NoPermissionException.java
deleted file mode 100644
index ddc43937ce8..00000000000
--- a/libjava/javax/naming/NoPermissionException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* NoPermissionException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class NoPermissionException extends NamingSecurityException
-{
- public NoPermissionException ()
- {
- super ();
- }
-
- public NoPermissionException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/NotContextException.java b/libjava/javax/naming/NotContextException.java
deleted file mode 100644
index b3d02cfbb4e..00000000000
--- a/libjava/javax/naming/NotContextException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* NotContextException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class NotContextException extends NamingException
-{
- public NotContextException ()
- {
- super ();
- }
-
- public NotContextException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/OperationNotSupportedException.java b/libjava/javax/naming/OperationNotSupportedException.java
deleted file mode 100644
index a4a4945af55..00000000000
--- a/libjava/javax/naming/OperationNotSupportedException.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* OperationNotSupportedException.java --
- Copyright (C) 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-public class OperationNotSupportedException extends NamingException
-{
- public OperationNotSupportedException()
- {
- super();
- }
-
- public OperationNotSupportedException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/naming/PartialResultException.java b/libjava/javax/naming/PartialResultException.java
deleted file mode 100644
index 32f389d1335..00000000000
--- a/libjava/javax/naming/PartialResultException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* PartialResultException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class PartialResultException extends NamingException
-{
- public PartialResultException ()
- {
- super ();
- }
-
- public PartialResultException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/RefAddr.java b/libjava/javax/naming/RefAddr.java
deleted file mode 100644
index f345c8829de..00000000000
--- a/libjava/javax/naming/RefAddr.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/* RefAddr.java -- Abstract superclass of addresses used in References
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.io.Serializable;
-
-/**
- * Abstract superclass of addresses used in References.
- * A <code>Reference</code> object contains a <code>Vector</code> of
- * <code>RefAddr</code>s which are used to reference/address the object.
- * This abstract superclass keeps track of the type of address, which will be
- * returned by <code>getType()</code>. And defines a abstract method
- * <code>getContent()</code> which must be implemented in concrete subclasses
- * such as <code>BinaryRefAddr</code> and <code>StringRefAddr</code>.
- *
- * @see Reference
- * @see BinaryRefAddr
- * @see StringRefAddr
- * @since 1.3
- * @author Anthony Green (green@redhat.com)
- * @author Mark Wielaard (mark@klomp.org)
- */
-public abstract class RefAddr implements Serializable
-{
- /**
- * The string resprenstation of the type of address.
- * Set by the constructor and returned by the getType() method.
- */
- protected String addrType;
-
- /**
- * Protected constructor for use by subclasses.
- * Sets the addrType field of this object to the supplied String.
- *
- * @exception NullPointerException if the supplied String is null.
- */
- protected RefAddr(String addrType)
- {
- if (addrType == null)
- throw new NullPointerException("addrType cannot be null");
-
- this.addrType = addrType;
- }
-
- /**
- * Returns the non-null address type given to the constructor.
- */
- public String getType()
- {
- return addrType;
- }
-
- /**
- * Returns the possibly null content of this RefAddr.
- * The actual value is defined by the non-abstract subclass.
- */
- public abstract Object getContent();
-
- /**
- * Checks if the object is a RefAddr with the same type and content.
- *
- * @return true if the given object is an instance of RefAddr, the addrType
- * is the same as this addrType and the content is equals to the
- * content of this object.
- */
- public boolean equals(Object o)
- {
- if (o instanceof RefAddr)
- {
- RefAddr refAddr = (RefAddr) o;
- if (this.getType().equals(refAddr.getType()))
- {
- Object c1 = this.getContent();
- Object c2 = refAddr.getContent();
- if (c1 == null)
- return c2 == null;
- else
- return c1.equals(c2);
- }
- }
- return false;
- }
-
- /**
- * Returns the hashCode which is the hasCode of the String returned by
- * <code>getType()</code> plus the hashCode of the Object returned by
- * <code>getContent</code> (when not null).
- */
- public int hashCode()
- {
- int result = getType().hashCode();
- Object o = getContent();
- if (o != null)
- result += o.hashCode();
-
- return result;
- }
-
- /**
- * Returns a String representation of the RefAddr.
- * Should only be used for debugging purposes.
- */
- public String toString()
- {
- return "[RefAddr type: " + getType() + " content: " + getContent() + ']';
- }
-}
diff --git a/libjava/javax/naming/Reference.java b/libjava/javax/naming/Reference.java
deleted file mode 100644
index 6cc4d15708b..00000000000
--- a/libjava/javax/naming/Reference.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Reference.java --
- Copyright (C) 2000, 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.Vector;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date May 16, 2001
- */
-public class Reference implements Cloneable, Serializable
-{
- public Reference (String className)
- {
- this.className = className;
- addrs = new Vector ();
- }
-
- public Reference (String className, RefAddr addr)
- {
- this.className = className;
- addrs = new Vector ();
- addrs.add (addr);
- }
-
- public Reference (String className, String factory, String factoryLocation)
- {
- this.className = className;
- this.classFactory = factory;
- this.classFactoryLocation = factoryLocation;
- addrs = new Vector ();
- }
-
- public Reference (String className, RefAddr addr,
- String factory, String factoryLocation)
- {
- this.className = className;
- this.classFactory = factory;
- this.classFactoryLocation = factoryLocation;
- addrs = new Vector ();
- addrs.add (addr);
- }
-
- public void add (int posn, RefAddr addr)
- {
- addrs.add (posn, addr);
- }
-
- public void add (RefAddr addr)
- {
- addrs.add (addr);
- }
-
- public void clear ()
- {
- addrs.clear ();
- }
-
- public Object clone ()
- {
- Reference r = new Reference (className, classFactory,
- classFactoryLocation);
- r.addrs = (Vector) addrs.clone ();
- return r;
- }
-
- // Convenience function.
- private boolean equals (String a, String b)
- {
- return (a == null) ? (b == null) : a.equals (b);
- }
-
- public boolean equals (Object obj)
- {
- if (! (obj instanceof Reference))
- return false;
- Reference r = (Reference) obj;
- return (equals (classFactory, r.classFactory)
- && equals (classFactoryLocation, r.classFactoryLocation)
- && equals (className, r.className)
- && addrs.equals (r.addrs));
- }
-
- public RefAddr get (int posn)
- {
- return (RefAddr) addrs.get (posn);
- }
-
- public RefAddr get (String addrType)
- {
- for (int i = 0; i < addrs.size (); ++i)
- {
- RefAddr r = (RefAddr) addrs.get (i);
- if (addrType.equals (r.getType ()))
- return r;
- }
- return null;
- }
-
- public Enumeration getAll ()
- {
- return addrs.elements ();
- }
-
- public String getClassName ()
- {
- return className;
- }
-
- public String getFactoryClassLocation ()
- {
- return classFactoryLocation;
- }
-
- public String getFactoryClassName ()
- {
- return classFactory;
- }
-
- public int hashCode ()
- {
- // The spec says the hash code is the sum of the hash codes of the
- // addresses. It does not mention the other fields.
- int h = 0;
- for (int i = 0; i < addrs.size (); ++i)
- h += addrs.get (i).hashCode ();
- return h;
- }
-
- public Object remove (int posn)
- {
- return addrs.remove (posn);
- }
-
- public int size ()
- {
- return addrs.size ();
- }
-
- public String toString ()
- {
- String x = getClass ().toString () + "[";
- for (int i = 0; i < addrs.size (); ++i)
- {
- if (i > 0)
- x += ",";
- x += addrs.get (i).toString ();
- }
- return x + "]";
- }
-
- protected Vector addrs;
- protected String classFactory;
- protected String classFactoryLocation;
- protected String className;
-}
diff --git a/libjava/javax/naming/Referenceable.java b/libjava/javax/naming/Referenceable.java
deleted file mode 100644
index cf1100aab83..00000000000
--- a/libjava/javax/naming/Referenceable.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Referenceable.java --
- Copyright (C) 2000 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-public interface Referenceable
-{
- Reference getReference() throws NamingException;
-}
diff --git a/libjava/javax/naming/ReferralException.java b/libjava/javax/naming/ReferralException.java
deleted file mode 100644
index ec2178e77e6..00000000000
--- a/libjava/javax/naming/ReferralException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ReferralException.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-import java.util.Hashtable;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 14, 2001
- */
-
-public abstract class ReferralException extends NamingException
-{
- private static final long serialVersionUID = -2881363844695698876L;
-
- protected ReferralException ()
- {
- super ();
- }
-
- protected ReferralException (String msg)
- {
- super (msg);
- }
-
- public abstract Object getReferralInfo();
- public abstract Context getReferralContext() throws NamingException;
- public abstract Context getReferralContext(Hashtable env)
- throws NamingException;
- public abstract boolean skipReferral();
- public abstract void retryReferral();
-}
diff --git a/libjava/javax/naming/ServiceUnavailableException.java b/libjava/javax/naming/ServiceUnavailableException.java
deleted file mode 100644
index 678eb132866..00000000000
--- a/libjava/javax/naming/ServiceUnavailableException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ServiceUnavailableException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class ServiceUnavailableException extends NamingException
-{
- public ServiceUnavailableException ()
- {
- super ();
- }
-
- public ServiceUnavailableException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/SizeLimitExceededException.java b/libjava/javax/naming/SizeLimitExceededException.java
deleted file mode 100644
index e23f4d2da09..00000000000
--- a/libjava/javax/naming/SizeLimitExceededException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* SizeLimitExceededException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class SizeLimitExceededException extends LimitExceededException
-{
- public SizeLimitExceededException ()
- {
- super ();
- }
-
- public SizeLimitExceededException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/StringRefAddr.java b/libjava/javax/naming/StringRefAddr.java
deleted file mode 100644
index f40da8fd800..00000000000
--- a/libjava/javax/naming/StringRefAddr.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* StringRefAddr.java -- RefAddr that uses a String as content.
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-/**
- * RefAddr that uses a String as content.
- * This can for example be used to address things through URLs.
- *
- * @see Reference
- * @since 1.3
- * @author Anthony Green (green@redhat.com)
- * @author Mark Wielaard (mark@klomp.org)
- */
-public class StringRefAddr extends RefAddr
-{
- private static final long serialVersionUID = -8913762495138505527L;
-
- /**
- * The possibly null content of this RefAddr.
- * Set by the constructor and returned by getContent.
- */
- private final String contents;
-
- /**
- * Contructs a new StringRefAddr with the given type and content.
- */
- public StringRefAddr (String addrType, String contents)
- {
- super(addrType);
- this.contents = contents;
- }
-
- /**
- * Returns the String contents as given to the constructor.
- */
- public Object getContent ()
- {
- return contents;
- }
-}
diff --git a/libjava/javax/naming/TimeLimitExceededException.java b/libjava/javax/naming/TimeLimitExceededException.java
deleted file mode 100644
index f4be6759b49..00000000000
--- a/libjava/javax/naming/TimeLimitExceededException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* TimeLimitExceededException.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming;
-
-
-public class TimeLimitExceededException extends LimitExceededException
-{
- public TimeLimitExceededException ()
- {
- super ();
- }
-
- public TimeLimitExceededException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/directory/Attribute.java b/libjava/javax/naming/directory/Attribute.java
deleted file mode 100644
index 59bf66dabc8..00000000000
--- a/libjava/javax/naming/directory/Attribute.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Attribute.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import java.io.Serializable;
-
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 14, 2001
- */
-public interface Attribute extends Cloneable, Serializable
-{
- long serialVersionUID = 8707690322213556804L;
-
- NamingEnumeration getAll() throws NamingException;
- Object get() throws NamingException;
- int size();
- String getID();
- boolean contains(Object attrVal);
- boolean add(Object attrVal);
- boolean remove(Object attrval);
- void clear();
- DirContext getAttributeSyntaxDefinition() throws NamingException;
- DirContext getAttributeDefinition() throws NamingException;
- Object clone();
- boolean isOrdered();
- Object get(int ix) throws NamingException;
- Object remove(int ix);
- void add(int ix, Object attrVal);
- Object set(int ix, Object attrVal);
-}
diff --git a/libjava/javax/naming/directory/AttributeInUseException.java b/libjava/javax/naming/directory/AttributeInUseException.java
deleted file mode 100644
index 46614245282..00000000000
--- a/libjava/javax/naming/directory/AttributeInUseException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* AttributeInUseException.java --
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.NamingException;
-
-public class AttributeInUseException extends NamingException
-{
- public AttributeInUseException ()
- {
- super ();
- }
-
- public AttributeInUseException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/directory/AttributeModificationException.java b/libjava/javax/naming/directory/AttributeModificationException.java
deleted file mode 100644
index 4ef6fc20b66..00000000000
--- a/libjava/javax/naming/directory/AttributeModificationException.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* AttributeModificationException.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 14, 2001
- */
-
-public class AttributeModificationException extends NamingException
-{
- // Serialized fields.
- private ModificationItem[] unexecs;
-
- public AttributeModificationException ()
- {
- super ();
- }
-
- public AttributeModificationException (String msg)
- {
- super (msg);
- }
-
- public void setUnexecutedModifications(ModificationItem[] e)
- {
- unexecs = e;
- }
-
- public ModificationItem[] getUnexecutedModifications()
- {
- return unexecs;
- }
-
- public String toString()
- {
- return super.toString () + ": " + unexecs[0].toString ();
- }
-}
diff --git a/libjava/javax/naming/directory/Attributes.java b/libjava/javax/naming/directory/Attributes.java
deleted file mode 100644
index 3d5ef9f4fa7..00000000000
--- a/libjava/javax/naming/directory/Attributes.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Attributes.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import java.io.Serializable;
-
-import javax.naming.NamingEnumeration;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 14, 2001
- */
-
-public interface Attributes extends Cloneable, Serializable
-{
- boolean isCaseIgnored();
- int size();
- Attribute get(String attrID);
- NamingEnumeration getAll();
- NamingEnumeration getIDs();
- Attribute put(String attrID, Object val);
- Attribute put(Attribute attr);
- Attribute remove(String attrID);
- Object clone();
-}
-
diff --git a/libjava/javax/naming/directory/BasicAttribute.java b/libjava/javax/naming/directory/BasicAttribute.java
deleted file mode 100644
index 047036585e4..00000000000
--- a/libjava/javax/naming/directory/BasicAttribute.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/* BasicAttribute.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import java.util.NoSuchElementException;
-import java.util.Vector;
-
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.OperationNotSupportedException;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date June 20, 2001
- */
-public class BasicAttribute implements Attribute
-{
- private static final long serialVersionUID = 6743528196119291326L;
-
- /** The ID of this attribute. */
- protected String attrID;
- /** True if this attribute's values are ordered. */
- protected boolean ordered;
- /** Values for this attribute. */
- protected transient Vector values;
-
- // Used by cloning.
- private BasicAttribute ()
- {
- }
-
- public BasicAttribute (String id)
- {
- this (id, false);
- }
-
- public BasicAttribute (String id, boolean ordered)
- {
- attrID = id;
- this.ordered = ordered;
- values = new Vector ();
- }
-
- public BasicAttribute (String id, Object value)
- {
- this (id, value, false);
- }
-
- public BasicAttribute (String id, Object value, boolean ordered)
- {
- attrID = id;
- this.ordered = ordered;
- values = new Vector ();
- values.add (value);
- }
-
- public void add (int index, Object val)
- {
- if (! ordered && contains (val))
- throw new IllegalStateException ("value already in attribute");
- values.add (index, val);
- }
-
- public boolean add (Object val)
- {
- if (! ordered && contains (val))
- throw new IllegalStateException ("value already in attribute");
- return values.add (val);
- }
-
- public void clear ()
- {
- values.clear ();
- }
-
- public Object clone ()
- {
- BasicAttribute c = new BasicAttribute ();
- c.attrID = attrID;
- c.ordered = ordered;
- c.values = (Vector) values.clone ();
- return c;
- }
-
- public boolean contains (Object val)
- {
- for (int i = 0; i < values.size (); ++i)
- {
- if (equals (val, values.get (i)))
- return true;
- }
-
- return false;
- }
-
- public boolean equals (Object obj)
- {
- if (! (obj instanceof BasicAttribute))
- return false;
- BasicAttribute b = (BasicAttribute) obj;
-
- if (ordered != b.ordered
- || ! attrID.equals (b.attrID)
- || values.size () != b.values.size ())
- return false;
-
- for (int i = 0; i < values.size (); ++i)
- {
- boolean ok = false;
- if (ordered)
- ok = equals (values.get (i), b.values.get (i));
- else
- {
- for (int j = 0; j < b.values.size (); ++j)
- {
- if (equals (values.get (i), b.values.get (j)))
- {
- ok = true;
- break;
- }
- }
- }
-
- if (! ok)
- return false;
- }
-
- return true;
- }
-
- public Object get ()
- throws NamingException
- {
- if (values.size () == 0)
- throw new NoSuchElementException ("no values");
- return get (0);
- }
-
- public Object get (int index)
- throws NamingException
- {
- return values.get (index);
- }
-
- public NamingEnumeration getAll ()
- throws NamingException
- {
- return new BasicAttributeEnumeration ();
- }
-
- public DirContext getAttributeDefinition ()
- throws OperationNotSupportedException, NamingException
- {
- throw new OperationNotSupportedException ();
- }
-
- public DirContext getAttributeSyntaxDefinition ()
- throws OperationNotSupportedException, NamingException
- {
- throw new OperationNotSupportedException ();
- }
-
- public String getID ()
- {
- return attrID;
- }
-
- public int hashCode ()
- {
- int val = attrID.hashCode ();
- for (int i = 0; i < values.size (); ++i)
- {
- Object o = values.get (i);
- if (o == null)
- {
- // Nothing.
- }
- else if (o instanceof Object[])
- {
- Object[] a = (Object[]) o;
- for (int j = 0; j < a.length; ++j)
- val += a[j].hashCode ();
- }
- else
- val += o.hashCode ();
- }
-
- return val;
- }
-
- public boolean isOrdered ()
- {
- return ordered;
- }
-
- public Object remove (int index)
- {
- return values.remove (index);
- }
-
- public boolean remove (Object val)
- {
- for (int i = 0; i < values.size (); ++i)
- {
- if (equals (val, values.get (i)))
- {
- values.remove (i);
- return true;
- }
- }
-
- return false;
- }
-
- public Object set (int index, Object val)
- {
- if (! ordered && contains (val))
- throw new IllegalStateException ("value already in attribute");
- return values.set (index, val);
- }
-
- public int size ()
- {
- return values.size ();
- }
-
- public String toString ()
- {
- String r = attrID;
- for (int i = 0; i < values.size (); ++i)
- r += ";" + values.get (i).toString ();
- return r;
- }
-
- // This is used for testing equality of two Objects according to our
- // local rules.
- private boolean equals (Object one, Object two)
- {
- if (one == null)
- return two == null;
-
- if (one instanceof Object[])
- {
- if (! (two instanceof Object[]))
- return false;
-
- Object[] aone = (Object[]) one;
- Object[] atwo = (Object[]) two;
-
- if (aone.length != atwo.length)
- return false;
-
- for (int i = 0; i < aone.length; ++i)
- {
- if (! aone[i].equals (atwo[i]))
- return false;
- }
-
- return true;
- }
-
- return one.equals (two);
- }
-
- // Used when enumerating this attribute.
- private class BasicAttributeEnumeration implements NamingEnumeration
- {
- int where = -1;
-
- public BasicAttributeEnumeration ()
- {
- }
-
- public void close () throws NamingException
- {
- }
-
- public boolean hasMore () throws NamingException
- {
- return hasMoreElements ();
- }
-
- public Object next () throws NamingException
- {
- return nextElement ();
- }
-
- public boolean hasMoreElements ()
- {
- return where < values.size ();
- }
-
- public Object nextElement () throws NoSuchElementException
- {
- if (where + 1 >= values.size ())
- throw new NoSuchElementException ("no more elements");
- ++where;
- return values.get (where);
- }
- }
-}
diff --git a/libjava/javax/naming/directory/BasicAttributes.java b/libjava/javax/naming/directory/BasicAttributes.java
deleted file mode 100644
index 37ec195771e..00000000000
--- a/libjava/javax/naming/directory/BasicAttributes.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/* BasicAttributes.java --
- Copyright (C) 2000, 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import java.util.NoSuchElementException;
-import java.util.Vector;
-
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date June 22, 2001
- */
-public class BasicAttributes implements Attributes
-{
- private static final long serialVersionUID = 4980164073184639448L;
-
- public BasicAttributes ()
- {
- this (false);
- }
-
- public BasicAttributes (boolean ignoreCase)
- {
- this.ignoreCase = ignoreCase;
- this.attributes = new Vector ();
- }
-
- public BasicAttributes (String attrID, Object val)
- {
- this (attrID, val, false);
- }
-
- public BasicAttributes (String attrID, Object val, boolean ignoreCase)
- {
- this.ignoreCase = ignoreCase;
- attributes = new Vector ();
- attributes.add (new BasicAttribute (attrID, val));
- }
-
- public Object clone ()
- {
- // Slightly inefficient as we make a garbage Vector here.
- BasicAttributes ba = new BasicAttributes (ignoreCase);
- ba.attributes = (Vector) attributes.clone ();
- return ba;
- }
-
- /**
- * Returns true if and only if the given Object is an instance of
- * Attributes, the given attributes both do or don't ignore case for
- * IDs and the collection of attributes is the same.
- */
- public boolean equals (Object obj)
- {
- if (! (obj instanceof Attributes))
- return false;
-
- Attributes bs = (Attributes) obj;
- if (ignoreCase != bs.isCaseIgnored()
- || attributes.size () != bs.size ())
- return false;
-
- NamingEnumeration bas = bs.getAll();
- while (bas.hasMoreElements())
- {
- Attribute a = (Attribute) bas.nextElement();
- Attribute b = get(a.getID ());
- if (! a.equals(b))
- return false;
- }
-
- return true;
- }
-
- public Attribute get (String attrID)
- {
- for (int i = 0; i < attributes.size (); ++i)
- {
- Attribute at = (Attribute) attributes.get (i);
- if ((ignoreCase && attrID.equalsIgnoreCase (at.getID ()))
- || (! ignoreCase && attrID.equals (at.getID ())))
- return at;
- }
-
- return null;
- }
-
- public NamingEnumeration getAll ()
- {
- return new BasicAttributesEnumeration (false);
- }
-
- public NamingEnumeration getIDs ()
- {
- return new BasicAttributesEnumeration (true);
- }
-
- public int hashCode ()
- {
- int val = 0;
- for (int i = 0; i < attributes.size (); ++i)
- val += attributes.get (i).hashCode ();
- return val;
- }
-
- public boolean isCaseIgnored ()
- {
- return ignoreCase;
- }
-
- public Attribute put (Attribute attr)
- {
- Attribute r = remove (attr.getID ());
- attributes.add (attr);
- return r;
- }
-
- public Attribute put (String attrID, Object val)
- {
- return put (new BasicAttribute (attrID, val));
- }
-
- public Attribute remove (String attrID)
- {
- for (int i = 0; i < attributes.size (); ++i)
- {
- Attribute at = (Attribute) attributes.get (i);
- if ((ignoreCase && attrID.equalsIgnoreCase (at.getID ()))
- || (! ignoreCase && attrID.equals (at.getID ())))
- {
- attributes.remove (i);
- return at;
- }
- }
-
- return null;
- }
-
- public int size ()
- {
- return attributes.size ();
- }
-
- public String toString ()
- {
- String r = "";
- for (int i = 0; i < attributes.size (); ++i)
- {
- if (i > 0)
- r += "; ";
- r += attributes.get (i).toString ();
- }
- return r;
- }
-
- // This is set by the serialization spec.
- private boolean ignoreCase;
- // Package-private to avoid a trampoline.
- transient Vector attributes;
-
- // Used when enumerating.
- private class BasicAttributesEnumeration implements NamingEnumeration
- {
- int where = 0;
- boolean id;
-
- public BasicAttributesEnumeration (boolean id)
- {
- this.id = id;
- }
-
- public void close () throws NamingException
- {
- }
-
- public boolean hasMore () throws NamingException
- {
- return hasMoreElements ();
- }
-
- public Object next () throws NamingException
- {
- return nextElement ();
- }
-
- public boolean hasMoreElements ()
- {
- return where < attributes.size ();
- }
-
- public Object nextElement () throws NoSuchElementException
- {
- if (where >= attributes.size ())
- throw new NoSuchElementException ("no more elements");
- Attribute at = (Attribute) attributes.get (where);
- ++where;
- return id ? (Object) at.getID () : (Object) at;
- }
- }
-}
diff --git a/libjava/javax/naming/directory/DirContext.java b/libjava/javax/naming/directory/DirContext.java
deleted file mode 100644
index 002cb78a913..00000000000
--- a/libjava/javax/naming/directory/DirContext.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* DirContext.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 13, 2001
- */
-
-public interface DirContext extends Context
-{
- int ADD_ATTRIBUTE = 1;
- int REPLACE_ATTRIBUTE = 2;
- int REMOVE_ATTRIBUTE = 3;
-
- Attributes getAttributes (String name) throws NamingException;
- Attributes getAttributes (String name, String[] attrIds) throws NamingException;
- Attributes getAttributes (Name name) throws NamingException;
- Attributes getAttributes(Name name, String[] attrIds) throws NamingException;
- void modifyAttributes(Name name, int mod_op, Attributes attrs) throws NamingException;
- void modifyAttributes(String name, int mod_op, Attributes attrs) throws NamingException;
- void modifyAttributes(Name name, ModificationItem[] mods) throws NamingException;
- void modifyAttributes(String name, ModificationItem[] mods) throws NamingException;
- void bind(Name name, Object obj, Attributes attrs) throws NamingException;
- void bind(String name, Object obj, Attributes attrs) throws NamingException;
- void rebind(Name name, Object obj, Attributes attrs) throws NamingException;
- void rebind(String name, Object obj, Attributes attrs) throws NamingException;
- DirContext createSubcontext(Name name, Attributes attrs) throws NamingException;
- DirContext createSubcontext(String name, Attributes attrs) throws NamingException;
- DirContext getSchema(Name name) throws NamingException;
- DirContext getSchema(String name) throws NamingException;
- DirContext getSchemaClassDefinition(Name name) throws NamingException;
- DirContext getSchemaClassDefinition(String name) throws NamingException;
- NamingEnumeration search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException;
- NamingEnumeration search(String name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException;
- NamingEnumeration search(Name name, Attributes matchingAttributes) throws NamingException;
- NamingEnumeration search(String name, Attributes matchingAttributes) throws NamingException;
- NamingEnumeration search(Name name, String filter, SearchControls cons) throws NamingException;
- NamingEnumeration search(String name, String filter, SearchControls cons) throws NamingException;
- NamingEnumeration search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException;
- NamingEnumeration search(String name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException;
-}
diff --git a/libjava/javax/naming/directory/InitialDirContext.java b/libjava/javax/naming/directory/InitialDirContext.java
deleted file mode 100644
index c946f416bff..00000000000
--- a/libjava/javax/naming/directory/InitialDirContext.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/* InitialDirContext.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.Name;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.NoInitialContextException;
-import javax.naming.NotContextException;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date June 25, 2001
- */
-public class InitialDirContext extends InitialContext implements DirContext
-{
- public InitialDirContext ()
- throws NamingException
- {
- this (null);
- }
-
- protected InitialDirContext (boolean lazy)
- throws NamingException
- {
- super (lazy);
- }
-
- public InitialDirContext (Hashtable environment)
- throws NamingException
- {
- super (environment);
- }
-
- // The InitialContext docs suggest that this exist. And it does
- // seem like a good idea. but the InitialDirContext docs indicate
- // it cannot be non-private.
- private DirContext getURLOrDefaultInitDirCtx (Name name)
- throws NamingException
- {
- Context c = getURLOrDefaultInitCtx (name);
- if (c == null)
- throw new NoInitialContextException ();
- else if (! (c instanceof DirContext))
- throw new NotContextException ();
- return (DirContext) c;
- }
-
- private DirContext getURLOrDefaultInitDirCtx (String name)
- throws NamingException
- {
- Context c = getURLOrDefaultInitCtx (name);
- if (c == null)
- throw new NoInitialContextException ();
- else if (! (c instanceof DirContext))
- throw new NotContextException ();
- return (DirContext) c;
- }
-
- public Attributes getAttributes (String name)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).getAttributes (name);
- }
-
- public Attributes getAttributes (String name, String[] attrIds)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).getAttributes (name, attrIds);
- }
-
- public Attributes getAttributes (Name name)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).getAttributes (name);
- }
-
- public Attributes getAttributes(Name name, String[] attrIds)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).getAttributes (name, attrIds);
- }
-
- public void modifyAttributes(Name name, int mod_op, Attributes attrs)
- throws NamingException
- {
- getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mod_op, attrs);
- }
-
- public void modifyAttributes(String name, int mod_op, Attributes attrs)
- throws NamingException
- {
- getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mod_op, attrs);
- }
-
- public void modifyAttributes(Name name, ModificationItem[] mods)
- throws NamingException
- {
- getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mods);
- }
-
- public void modifyAttributes(String name, ModificationItem[] mods)
- throws NamingException
- {
- getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mods);
- }
-
- public void bind(Name name, Object obj, Attributes attrs)
- throws NamingException
- {
- getURLOrDefaultInitDirCtx (name).bind (name, obj, attrs);
- }
-
- public void bind(String name, Object obj, Attributes attrs)
- throws NamingException
- {
- getURLOrDefaultInitDirCtx (name).bind (name, obj, attrs);
- }
-
- public void rebind(Name name, Object obj, Attributes attrs)
- throws NamingException
- {
- getURLOrDefaultInitDirCtx (name).rebind (name, obj, attrs);
- }
-
- public void rebind(String name, Object obj, Attributes attrs)
- throws NamingException
- {
- getURLOrDefaultInitDirCtx (name).rebind (name, obj, attrs);
- }
-
- public DirContext createSubcontext(Name name, Attributes attrs)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).createSubcontext (name, attrs);
- }
-
- public DirContext createSubcontext(String name, Attributes attrs)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).createSubcontext (name, attrs);
- }
-
- public DirContext getSchema(Name name)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).getSchema (name);
- }
-
- public DirContext getSchema(String name)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).getSchema (name);
- }
-
- public DirContext getSchemaClassDefinition(Name name)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).getSchemaClassDefinition (name);
- }
-
- public DirContext getSchemaClassDefinition(String name)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).getSchemaClassDefinition (name);
- }
-
- public NamingEnumeration search(Name name, Attributes matchingAttributes,
- String[] attributesToReturn)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes,
- attributesToReturn);
- }
-
- public NamingEnumeration search(String name, Attributes matchingAttributes,
- String[] attributesToReturn)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes,
- attributesToReturn);
- }
-
- public NamingEnumeration search(Name name, Attributes matchingAttributes)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes);
- }
-
- public NamingEnumeration search(String name, Attributes matchingAttributes)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes);
- }
-
- public NamingEnumeration search(Name name, String filter,
- SearchControls cons)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).search (name, filter, cons);
- }
-
- public NamingEnumeration search(String name, String filter,
- SearchControls cons)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).search (name, filter, cons);
- }
-
- public NamingEnumeration search(Name name, String filterExpr,
- Object[] filterArgs, SearchControls cons)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).search (name, filterExpr,
- filterArgs, cons);
- }
-
- public NamingEnumeration search(String name, String filterExpr,
- Object[] filterArgs, SearchControls cons)
- throws NamingException
- {
- return getURLOrDefaultInitDirCtx (name).search (name, filterExpr,
- filterArgs, cons);
- }
-}
diff --git a/libjava/javax/naming/directory/InvalidAttributeIdentifierException.java b/libjava/javax/naming/directory/InvalidAttributeIdentifierException.java
deleted file mode 100644
index af1a8c7a27f..00000000000
--- a/libjava/javax/naming/directory/InvalidAttributeIdentifierException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* InvalidAttributeIdentifierException.java --
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.NamingException;
-
-public class InvalidAttributeIdentifierException extends NamingException
-{
- public InvalidAttributeIdentifierException ()
- {
- super ();
- }
-
- public InvalidAttributeIdentifierException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/directory/InvalidAttributeValueException.java b/libjava/javax/naming/directory/InvalidAttributeValueException.java
deleted file mode 100644
index b667fa9a732..00000000000
--- a/libjava/javax/naming/directory/InvalidAttributeValueException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* InvalidAttributeValueException.java --
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.NamingException;
-
-public class InvalidAttributeValueException extends NamingException
-{
- public InvalidAttributeValueException ()
- {
- super ();
- }
-
- public InvalidAttributeValueException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/directory/InvalidAttributesException.java b/libjava/javax/naming/directory/InvalidAttributesException.java
deleted file mode 100644
index ad7f7c1c111..00000000000
--- a/libjava/javax/naming/directory/InvalidAttributesException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* InvalidAttributesException.java --
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.NamingException;
-
-public class InvalidAttributesException extends NamingException
-{
- public InvalidAttributesException ()
- {
- super ();
- }
-
- public InvalidAttributesException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/directory/InvalidSearchControlsException.java b/libjava/javax/naming/directory/InvalidSearchControlsException.java
deleted file mode 100644
index 594e5d1bfe5..00000000000
--- a/libjava/javax/naming/directory/InvalidSearchControlsException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* InvalidSearchControlsException.java --
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.NamingException;
-
-public class InvalidSearchControlsException extends NamingException
-{
- public InvalidSearchControlsException ()
- {
- super ();
- }
-
- public InvalidSearchControlsException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/directory/InvalidSearchFilterException.java b/libjava/javax/naming/directory/InvalidSearchFilterException.java
deleted file mode 100644
index 127b381ea6d..00000000000
--- a/libjava/javax/naming/directory/InvalidSearchFilterException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* InvalidSearchFilterException.java --
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.NamingException;
-
-public class InvalidSearchFilterException extends NamingException
-{
- public InvalidSearchFilterException ()
- {
- super ();
- }
-
- public InvalidSearchFilterException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/directory/ModificationItem.java b/libjava/javax/naming/directory/ModificationItem.java
deleted file mode 100644
index f0a69f56a8c..00000000000
--- a/libjava/javax/naming/directory/ModificationItem.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* ModificationItem.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import java.io.Serializable;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 13, 2001
- */
-
-public class ModificationItem implements Serializable
-{
- // Serialized fields.
- private int mod_op;
- private Attribute attr;
-
- public ModificationItem(int mod_op, Attribute attr)
- {
- if (attr == null)
- throw new IllegalArgumentException("attr is null");
- if (mod_op != DirContext.ADD_ATTRIBUTE &&
- mod_op != DirContext.REPLACE_ATTRIBUTE &&
- mod_op != DirContext.REMOVE_ATTRIBUTE)
- throw new IllegalArgumentException("mod_op is invalid");
- this.mod_op = mod_op;
- this.attr = attr;
- }
-
- public int getModificationOp()
- {
- return mod_op;
- }
-
- public Attribute getAttribute()
- {
- return attr;
- }
-
- public String toString()
- {
- return "mod_op=" + mod_op + ":" + "attr=" + attr.toString();
- }
-}
diff --git a/libjava/javax/naming/directory/NoSuchAttributeException.java b/libjava/javax/naming/directory/NoSuchAttributeException.java
deleted file mode 100644
index cff9f95b7e5..00000000000
--- a/libjava/javax/naming/directory/NoSuchAttributeException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* NoSuchAttributeException.java --
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.NamingException;
-
-public class NoSuchAttributeException extends NamingException
-{
- public NoSuchAttributeException ()
- {
- super ();
- }
-
- public NoSuchAttributeException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/directory/SchemaViolationException.java b/libjava/javax/naming/directory/SchemaViolationException.java
deleted file mode 100644
index a11e50f2002..00000000000
--- a/libjava/javax/naming/directory/SchemaViolationException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* SchemaViolationException.java --
- Copyright (C) 2000, 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.NamingException;
-
-public class SchemaViolationException extends NamingException
-{
- public SchemaViolationException ()
- {
- super ();
- }
-
- public SchemaViolationException (String msg)
- {
- super (msg);
- }
-}
diff --git a/libjava/javax/naming/directory/SearchControls.java b/libjava/javax/naming/directory/SearchControls.java
deleted file mode 100644
index 4cc789d52e1..00000000000
--- a/libjava/javax/naming/directory/SearchControls.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* SearchControls.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import java.io.Serializable;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 5, 2001
- */
-
-public class SearchControls implements Serializable
-{
- public static final int OBJECT_SCOPE = 0;
- public static final int ONELEVEL_SCOPE = 1;
- public static final int SUBTREE_SCOPE = 2;
-
- // Serialized fields.
- private int searchScope;
- private int timeLimit;
- private boolean derefLink;
- private boolean returnObj;
- private long countLimit;
- private String[] attributesToReturn;
-
- public SearchControls()
- {
- this(ONELEVEL_SCOPE, 0L, 0, null, false, false);
- }
-
- public SearchControls(int scope, long countlim, int timelim, String[] attrs,
- boolean retobj, boolean deref)
- {
- searchScope = scope;
- timeLimit = timelim;
- derefLink = deref;
- returnObj = retobj;
- countLimit = countlim;
- attributesToReturn = attrs;
- }
-
- public int getSearchScope()
- {
- return searchScope;
- }
-
- public int getTimeLimit()
- {
- return timeLimit;
- }
-
- public boolean getDerefLinkFlag()
- {
- return derefLink;
- }
-
- public boolean getReturningObjFlag()
- {
- return returnObj;
- }
-
- public long getCountLimit()
- {
- return countLimit;
- }
-
- public String[] getReturningAttributes()
- {
- return attributesToReturn;
- }
-
- public void setSearchScope(int scope)
- {
- searchScope = scope;
- }
-
- public void setTimeLimit(int ms)
- {
- timeLimit = ms;
- }
-
- public void setDerefLinkFlag(boolean on)
- {
- derefLink = on;
- }
-
- public void setReturningObjFlag(boolean on)
- {
- returnObj = on;
- }
-
- public void setCountLimit(long limit)
- {
- countLimit = limit;
- }
-
- public void setReturningAttributes(String[] attrs)
- {
- attributesToReturn = attrs;
- }
-}
diff --git a/libjava/javax/naming/directory/SearchResult.java b/libjava/javax/naming/directory/SearchResult.java
deleted file mode 100644
index a6d5490df99..00000000000
--- a/libjava/javax/naming/directory/SearchResult.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* SearchResult.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.directory;
-
-import javax.naming.Binding;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 13, 2001
- */
-
-public class SearchResult extends Binding
-{
- // Serialized fields.
- private Attributes attrs;
-
- public SearchResult(String name, Object obj, Attributes attrs)
- {
- super(name, obj);
- this.attrs = attrs;
- }
-
- public SearchResult(String name, Object obj, Attributes attrs,
- boolean isRelative)
- {
- super(name, obj, isRelative);
- this.attrs = attrs;
- }
-
- public SearchResult(String name, String className, Object obj,
- Attributes attrs)
- {
- super(name, className, obj);
- this.attrs = attrs;
- }
-
- public SearchResult(String name, String className, Object obj,
- Attributes attrs, boolean isRelative)
- {
- super(name, className, obj, isRelative);
- this.attrs = attrs;
- }
-
- public Attributes getAttributes()
- {
- return attrs;
- }
-
- public void setAttributes(Attributes attrs)
- {
- this.attrs = attrs;
- }
-
- public String toString()
- {
- return super.toString() + ":" + attrs.toString();
- }
-}
diff --git a/libjava/javax/naming/event/EventContext.java b/libjava/javax/naming/event/EventContext.java
deleted file mode 100644
index 32629c04c65..00000000000
--- a/libjava/javax/naming/event/EventContext.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* EventContext.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.event;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface EventContext extends Context
-{
- int OBJECT_SCOPE = 0;
- int ONELEVEL_SCOPE = 1;
- int SUBTREE_SCOPE = 2;
-
- void addNamingListener (Name target, int scope, NamingListener l)
- throws NamingException;
-
- void addNamingListener (String target, int scope, NamingListener l)
- throws NamingException;
-
- void removeNamingListener (NamingListener l) throws NamingException;
-
- boolean targetMustExist() throws NamingException;
-}
diff --git a/libjava/javax/naming/event/EventDirContext.java b/libjava/javax/naming/event/EventDirContext.java
deleted file mode 100644
index d2883aec380..00000000000
--- a/libjava/javax/naming/event/EventDirContext.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* EventDirContext.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.event;
-
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-public interface EventDirContext extends EventContext, DirContext
-{
- void addNamingListener(Name target, String filter, SearchControls ctls,
- NamingListener l) throws NamingException;
-
- void addNamingListener(String target, String filter, SearchControls ctls,
- NamingListener l) throws NamingException;
-
- void addNamingListener(Name target, String filter, Object[] filterArgs,
- SearchControls ctls, NamingListener l)
- throws NamingException;
-
- void addNamingListener(String target, String filter, Object[] filterArgs,
- SearchControls ctls, NamingListener l)
- throws NamingException;
-}
diff --git a/libjava/javax/naming/event/NamespaceChangeListener.java b/libjava/javax/naming/event/NamespaceChangeListener.java
deleted file mode 100644
index 464b7187a9d..00000000000
--- a/libjava/javax/naming/event/NamespaceChangeListener.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* NamespaceChangeListener.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.event;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface NamespaceChangeListener extends NamingListener
-{
- void objectAdded(NamingEvent evt);
- void objectRemoved(NamingEvent evt);
- void objectRenamed(NamingEvent evt);
-}
diff --git a/libjava/javax/naming/event/NamingEvent.java b/libjava/javax/naming/event/NamingEvent.java
deleted file mode 100644
index a121b8e13d3..00000000000
--- a/libjava/javax/naming/event/NamingEvent.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/* NamingEvent.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.event;
-
-import java.util.EventObject;
-
-import javax.naming.Binding;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 5, 2001
- */
-public class NamingEvent extends EventObject
-{
- public static final int OBJECT_ADDED = 0;
- public static final int OBJECT_REMOVED = 1;
- public static final int OBJECT_RENAMED = 2;
- public static final int OBJECT_CHANGED = 3;
-
- // Serialized fields.
- protected Object changeInfo;
- protected int type;
- protected Binding oldBinding;
- protected Binding newBinding;
-
- public NamingEvent(EventContext source, int type, Binding newBd,
- Binding oldBd, Object changeInfo)
- {
- super(source);
- this.type = type;
- this.oldBinding = oldBd;
- this.newBinding = newBd;
- this.changeInfo = changeInfo;
- // FIXME: for OBJECT_ADDED, newBd must not be null;
- // FIXME: for OBJECT_CHANGED, newBd and oldBd must not be null;
- // FIXME: for OBJECT_RENAMED, one of newBd or oldBd may be null if newBd or
- // FIXME: oldBd is outside of the scope for which listener has registered.
- // FIXME: namingExceptionThrown() is called for the listener in question.
- }
-
- public int getType()
- {
- return type;
- }
-
- public EventContext getEventContext()
- {
- return (EventContext) getSource();
- }
-
- public Binding getOldBinding()
- {
- return oldBinding;
- }
-
- public Binding getNewBinding()
- {
- return newBinding;
- }
-
- public Object getChangeInfo()
- {
- return changeInfo;
- }
-
- public void dispatch(NamingListener listener)
- {
- switch (type)
- {
- case OBJECT_ADDED:
- ((NamespaceChangeListener) listener).objectAdded(this);
- break;
- case OBJECT_REMOVED:
- ((NamespaceChangeListener) listener).objectRemoved(this);
- break;
- case OBJECT_RENAMED:
- ((NamespaceChangeListener) listener).objectRenamed(this);
- break;
- case OBJECT_CHANGED:
- ((ObjectChangeListener) listener).objectChanged(this);
- break;
- }
- }
-}
diff --git a/libjava/javax/naming/event/NamingExceptionEvent.java b/libjava/javax/naming/event/NamingExceptionEvent.java
deleted file mode 100644
index 07896d48d45..00000000000
--- a/libjava/javax/naming/event/NamingExceptionEvent.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* NamingExceptionEvent.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.event;
-
-import java.util.EventObject;
-
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 5, 2001
- */
-
-public class NamingExceptionEvent extends EventObject
-{
- // Serialized fields.
- private NamingException exception;
-
- public NamingExceptionEvent(EventContext source, NamingException exc)
- {
- super(source);
- exception = exc;
- }
-
- public NamingException getException()
- {
- return exception;
- }
-
- public EventContext getEventContext()
- {
- return (EventContext) getSource();
- }
-
- public void dispatch(NamingListener listener)
- {
- listener.namingExceptionThrown(this);
- }
-}
diff --git a/libjava/javax/naming/event/NamingListener.java b/libjava/javax/naming/event/NamingListener.java
deleted file mode 100644
index 4f313a35cbf..00000000000
--- a/libjava/javax/naming/event/NamingListener.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* NamingListener.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.event;
-
-import java.util.EventListener;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface NamingListener extends EventListener
-{
- void namingExceptionThrown(NamingExceptionEvent evt);
-}
diff --git a/libjava/javax/naming/event/ObjectChangeListener.java b/libjava/javax/naming/event/ObjectChangeListener.java
deleted file mode 100644
index 00e8c4cb024..00000000000
--- a/libjava/javax/naming/event/ObjectChangeListener.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* ObjectChangeListener.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.event;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface ObjectChangeListener extends NamingListener
-{
- void objectChanged(NamingEvent evt);
-}
diff --git a/libjava/javax/naming/ldap/Control.java b/libjava/javax/naming/ldap/Control.java
deleted file mode 100644
index 9f6409b532f..00000000000
--- a/libjava/javax/naming/ldap/Control.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Control.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import java.io.Serializable;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface Control extends Serializable
-{
- boolean CRITICAL = true;
- boolean NONCRITICAL = false;
-
- String getID();
- boolean isCritical();
- byte[] getEncodedValue();
-}
diff --git a/libjava/javax/naming/ldap/ControlFactory.java b/libjava/javax/naming/ldap/ControlFactory.java
deleted file mode 100644
index f72e67a7587..00000000000
--- a/libjava/javax/naming/ldap/ControlFactory.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ControlFactory.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date June 22, 2001
- */
-public abstract class ControlFactory
-{
- protected ControlFactory ()
- {
- }
-
- public abstract Control getControlInstance (Control control)
- throws NamingException;
-
- public static Control getControlInstance (Control control,
- Context ctx,
- Hashtable env)
- throws NamingException
- {
- String path = (String) env.get (LdapContext.CONTROL_FACTORIES);
- String path2 = null;
- if (ctx != null)
- path2 = (String) ctx.getEnvironment ().get (LdapContext.CONTROL_FACTORIES);
- if (path == null)
- path = path2;
- else if (path2 != null)
- path += ":" + path2;
-
- StringTokenizer tokens = new StringTokenizer (path, ":");
- while (tokens.hasMoreTokens ())
- {
- String name = tokens.nextToken ();
- try
- {
- Class k = Class.forName (name);
- ControlFactory cf = (ControlFactory) k.newInstance ();
- Control ctrl = cf.getControlInstance (control);
- if (ctrl != null)
- return ctrl;
- }
- catch (ClassNotFoundException _1)
- {
- // Ignore it.
- }
- catch (ClassCastException _2)
- {
- // Ignore it.
- }
- catch (InstantiationException _3)
- {
- // If we couldn't instantiate the factory we might get
- // this.
- }
- catch (IllegalAccessException _4)
- {
- // Another possibility when instantiating.
- }
- }
-
- return control;
- }
-}
diff --git a/libjava/javax/naming/ldap/ExtendedRequest.java b/libjava/javax/naming/ldap/ExtendedRequest.java
deleted file mode 100644
index e6379c0c0f2..00000000000
--- a/libjava/javax/naming/ldap/ExtendedRequest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ExtendedRequest.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import java.io.Serializable;
-
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-public interface ExtendedRequest extends Serializable
-{
- String getID();
- byte[] getEncodedValue();
- ExtendedResponse createExtendedResponse(String id,
- byte[] berValue, int offset,
- int length)
- throws NamingException;
-}
diff --git a/libjava/javax/naming/ldap/ExtendedResponse.java b/libjava/javax/naming/ldap/ExtendedResponse.java
deleted file mode 100644
index a3b6dd12c7e..00000000000
--- a/libjava/javax/naming/ldap/ExtendedResponse.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ExtendedResponse.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import java.io.Serializable;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface ExtendedResponse extends Serializable
-{
- String getID();
- byte[] getEncodedValue();
-}
diff --git a/libjava/javax/naming/ldap/HasControls.java b/libjava/javax/naming/ldap/HasControls.java
deleted file mode 100644
index a1698963fc8..00000000000
--- a/libjava/javax/naming/ldap/HasControls.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* HasControls.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface HasControls
-{
- Control[] getControls() throws NamingException;
-}
diff --git a/libjava/javax/naming/ldap/InitialLdapContext.java b/libjava/javax/naming/ldap/InitialLdapContext.java
deleted file mode 100644
index 45a9eae1af5..00000000000
--- a/libjava/javax/naming/ldap/InitialLdapContext.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* InitialLdapContext.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.NoInitialContextException;
-import javax.naming.NotContextException;
-import javax.naming.directory.InitialDirContext;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date June 21, 2001
- */
-public class InitialLdapContext
- extends InitialDirContext
- implements LdapContext
-{
- public InitialLdapContext ()
- throws NamingException
- {
- this (null, null);
- }
-
- public InitialLdapContext (Hashtable environment, Control[] connControls)
- throws NamingException
- {
- super (false);
-
- if (connControls != null)
- {
- if (environment == null)
- environment = new Hashtable ();
- else
- environment = (Hashtable) environment.clone ();
- environment.put ("java.naming.ldap.control.connect",
- connControls);
- }
-
- init (environment);
- }
-
- private LdapContext getDefaultInitLdapCtx ()
- throws NamingException
- {
- Context c = getDefaultInitCtx ();
- if (c == null)
- throw new NoInitialContextException ();
- else if (! (c instanceof LdapContext))
- throw new NotContextException ();
- return (LdapContext) c;
- }
-
- public ExtendedResponse extendedOperation (ExtendedRequest request)
- throws NamingException
- {
- return getDefaultInitLdapCtx ().extendedOperation (request);
- }
-
- public Control[] getConnectControls ()
- throws NamingException
- {
- return getDefaultInitLdapCtx ().getConnectControls ();
- }
-
- public Control[] getRequestControls ()
- throws NamingException
- {
- return getDefaultInitLdapCtx ().getRequestControls ();
- }
-
- public Control[] getResponseControls ()
- throws NamingException
- {
- return getDefaultInitLdapCtx ().getResponseControls ();
- }
-
- public LdapContext newInstance (Control[] reqControls)
- throws NamingException
- {
- return getDefaultInitLdapCtx ().newInstance (reqControls);
- }
-
- public void reconnect (Control[] connControls)
- throws NamingException
- {
- getDefaultInitLdapCtx ().reconnect (connControls);
- }
-
- public void setRequestControls (Control[] reqControls)
- throws NamingException
- {
- getDefaultInitLdapCtx ().setRequestControls (reqControls);
- }
-}
diff --git a/libjava/javax/naming/ldap/LdapContext.java b/libjava/javax/naming/ldap/LdapContext.java
deleted file mode 100644
index 10b72f77f34..00000000000
--- a/libjava/javax/naming/ldap/LdapContext.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* LdapContext.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import javax.naming.NamingException;
-import javax.naming.directory.DirContext;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface LdapContext extends DirContext
-{
- String CONTROL_FACTORIES = "java.naming.factory.control";
-
- ExtendedResponse extendedOperation(ExtendedRequest request)
- throws NamingException;
- LdapContext newInstance(Control[] requestControls)
- throws NamingException;
- void reconnect(Control[] connCtls) throws NamingException;
- Control[] getConnectControls() throws NamingException;
- void setRequestControls(Control[] requestControls)
- throws NamingException;
- Control[] getRequestControls() throws NamingException;
- Control[] getResponseControls() throws NamingException;
-}
diff --git a/libjava/javax/naming/ldap/LdapReferralException.java b/libjava/javax/naming/ldap/LdapReferralException.java
deleted file mode 100644
index 61a2b8e440c..00000000000
--- a/libjava/javax/naming/ldap/LdapReferralException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* LdapReferralException.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.ReferralException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-public abstract class LdapReferralException extends ReferralException
-{
- protected LdapReferralException()
- {
- super();
- }
-
- protected LdapReferralException(String explanation)
- {
- super(explanation);
- }
-
- public abstract Context getReferralContext() throws NamingException;
- public abstract Context getReferralContext(Hashtable env)
- throws NamingException;
- public abstract Context getReferralContext(Hashtable env, Control[] reqCtls)
- throws NamingException;
-}
diff --git a/libjava/javax/naming/ldap/UnsolicitedNotification.java b/libjava/javax/naming/ldap/UnsolicitedNotification.java
deleted file mode 100644
index 0b6f9d7792e..00000000000
--- a/libjava/javax/naming/ldap/UnsolicitedNotification.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* UnsolicitedNotification.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface UnsolicitedNotification extends ExtendedResponse, HasControls
-{
- String[] getReferrals();
- NamingException getException();
-}
diff --git a/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java b/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java
deleted file mode 100644
index f9946064aaf..00000000000
--- a/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* UnsolicitedNotificationEvent.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import java.util.EventObject;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 5, 2001
- */
-public class UnsolicitedNotificationEvent extends EventObject
-{
- private static final long serialVersionUID = -2382603380799883705L;
-
- // Serialized fields.
- private UnsolicitedNotification notice;
-
- public UnsolicitedNotificationEvent(Object src,
- UnsolicitedNotification notice)
- {
- super(src);
- this.notice = notice;
- }
-
- public UnsolicitedNotification getNotification()
- {
- return notice;
- }
-
- public void dispatch(UnsolicitedNotificationListener listener)
- {
- listener.notificationReceived(this);
- }
-}
diff --git a/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java b/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java
deleted file mode 100644
index fd56f059870..00000000000
--- a/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* UnsolicitedNotificationListener.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.ldap;
-
-import javax.naming.event.NamingListener;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface UnsolicitedNotificationListener extends NamingListener
-{
- void notificationReceived(UnsolicitedNotificationEvent evt);
-}
diff --git a/libjava/javax/naming/spi/DirObjectFactory.java b/libjava/javax/naming/spi/DirObjectFactory.java
deleted file mode 100644
index ea0e69706cc..00000000000
--- a/libjava/javax/naming/spi/DirObjectFactory.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* DirObjectFactory.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.directory.Attributes;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-public interface DirObjectFactory extends ObjectFactory
-{
- Object getObjectInstance(Object obj, Name name, Context nameCtx,
- Hashtable environment, Attributes attrs)
- throws Exception;
-}
diff --git a/libjava/javax/naming/spi/DirStateFactory.java b/libjava/javax/naming/spi/DirStateFactory.java
deleted file mode 100644
index b5add91cba7..00000000000
--- a/libjava/javax/naming/spi/DirStateFactory.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* DirStateFactory.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-public interface DirStateFactory extends StateFactory
-{
- // Inner class
-
- public static class Result
- {
- private Object obj;
- private Attributes outAttrs;
-
- public Result(Object obj, Attributes outAttrs)
- {
- this.obj = obj;
- this.outAttrs = outAttrs;
- }
-
- public Object getObject()
- {
- return obj;
- }
-
- public Attributes getAttributes()
- {
- return outAttrs;
- }
- }
-
- DirStateFactory.Result getStateToBind(Object obj, Name name,
- Context nameCtx,
- Hashtable environment,
- Attributes inAttrs)
- throws NamingException;
-}
diff --git a/libjava/javax/naming/spi/DirectoryManager.java b/libjava/javax/naming/spi/DirectoryManager.java
deleted file mode 100644
index fd482efb5c6..00000000000
--- a/libjava/javax/naming/spi/DirectoryManager.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/* DirectoryManager.java --
- Copyright (C) 2000, 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-import javax.naming.CannotProceedException;
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date June 25, 2001
- */
-public class DirectoryManager extends NamingManager
-{
- // Can't instantiate this class.
- DirectoryManager ()
- {
- }
-
- public static DirContext getContinuationDirContext (CannotProceedException c)
- throws NamingException
- {
- return (DirContext) getContinuationContext (c);
- }
-
- // Try to create an object using the factory. Return null on
- // failure.
- private static Object tryCreateObject (ObjectFactory factory,
- Object refInfo,
- Name name,
- Context nameCtx,
- Hashtable environment,
- Attributes attrs)
- throws Exception
- {
- if (factory instanceof DirObjectFactory)
- {
- DirObjectFactory dof = (DirObjectFactory) factory;
- return dof.getObjectInstance (refInfo, name, nameCtx,
- environment, attrs);
- }
- else
- return factory.getObjectInstance (refInfo, name, nameCtx,
- environment);
- }
-
- public static Object getObjectInstance (Object refInfo, Name name,
- Context nameCtx,
- Hashtable environment,
- Attributes attrs)
- throws Exception
- {
- ObjectFactory factory = null;
-
- if (ofb != null)
- factory = ofb.createObjectFactory (refInfo, environment);
- else
- {
- // First see if we have a Reference or a Referenceable. If so
- // we do some special processing.
- Object ref2 = refInfo;
- if (refInfo instanceof Referenceable)
- ref2 = ((Referenceable) refInfo).getReference ();
- if (ref2 instanceof Reference)
- {
- Reference ref = (Reference) ref2;
-
- // If we have a factory class name then we use that.
- String fClass = ref.getFactoryClassName ();
- if (fClass != null)
- {
- // Exceptions here are passed to the caller.
- Class k = Class.forName (fClass);
- factory = (ObjectFactory) k.newInstance ();
- }
- else
- {
- // There's no factory class name. If the address is a
- // StringRefAddr with address type `URL', then we try
- // the URL's context factory.
- Enumeration e = ref.getAll ();
- while (e.hasMoreElements ())
- {
- RefAddr ra = (RefAddr) e.nextElement ();
- if (ra instanceof StringRefAddr
- && "URL".equals (ra.getType ()))
- {
- factory
- = (ObjectFactory) getURLContext (refInfo,
- name,
- nameCtx,
- (String) ra.getContent (),
- environment);
- Object obj = tryCreateObject (factory,
- refInfo,
- name,
- nameCtx,
- environment,
- attrs);
- if (obj != null)
- return obj;
- }
- }
-
- // Have to try the next step.
- factory = null;
- }
- }
-
- // Now look at OBJECT_FACTORIES to find the factory.
- if (factory == null)
- {
- StringTokenizer tokens = getPlusPath (Context.OBJECT_FACTORIES,
- environment, nameCtx);
-
- while (tokens.hasMoreTokens ())
- {
- String klassName = tokens.nextToken ();
- Class k = Class.forName (klassName);
- factory = (ObjectFactory) k.newInstance ();
- Object obj = tryCreateObject (factory, refInfo, name,
- nameCtx, environment, attrs);
- if (obj != null)
- return obj;
- }
-
- // Failure.
- return refInfo;
- }
- }
-
- if (factory == null)
- return refInfo;
- Object obj = tryCreateObject (factory, refInfo, name,
- nameCtx, environment, attrs);
- return obj == null ? refInfo : obj;
- }
-
- public static DirStateFactory.Result getStateToBind (Object obj,
- Name name,
- Context nameCtx,
- Hashtable environment,
- Attributes attrs)
- throws NamingException
- {
- StringTokenizer tokens = getPlusPath (Context.STATE_FACTORIES,
- environment, nameCtx);
- while (tokens.hasMoreTokens ())
- {
- String klassName = tokens.nextToken ();
- try
- {
- Class k = Class.forName (klassName);
- StateFactory factory = (StateFactory) k.newInstance ();
-
- DirStateFactory.Result result = null;
- if (factory instanceof DirStateFactory)
- {
- DirStateFactory dsf = (DirStateFactory) factory;
- result = dsf.getStateToBind (obj, name, nameCtx, environment,
- attrs);
- }
- else
- {
- Object o = factory.getStateToBind (obj, name, nameCtx,
- environment);
- if (o != null)
- result = new DirStateFactory.Result (o, attrs);
- }
- if (result != null)
- return result;
- }
- catch (ClassNotFoundException _1)
- {
- // Ignore it.
- }
- catch (ClassCastException _2)
- {
- // This means that the class we found was not an
- // ObjectFactory or that the factory returned something
- // which was not a Context.
- }
- catch (InstantiationException _3)
- {
- // If we couldn't instantiate the factory we might get
- // this.
- }
- catch (IllegalAccessException _4)
- {
- // Another possibility when instantiating.
- }
- }
-
- return new DirStateFactory.Result (obj, attrs);
- }
-}
diff --git a/libjava/javax/naming/spi/InitialContextFactory.java b/libjava/javax/naming/spi/InitialContextFactory.java
deleted file mode 100644
index 7bfcf095e52..00000000000
--- a/libjava/javax/naming/spi/InitialContextFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* InitialContextFactory.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-public interface InitialContextFactory
-{
- Context getInitialContext (Hashtable environment) throws NamingException;
-}
diff --git a/libjava/javax/naming/spi/InitialContextFactoryBuilder.java b/libjava/javax/naming/spi/InitialContextFactoryBuilder.java
deleted file mode 100644
index 76564ab5ef9..00000000000
--- a/libjava/javax/naming/spi/InitialContextFactoryBuilder.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* InitialContextFactoryBuilder.java --
- Copyright (C) 2000, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import java.util.Hashtable;
-
-import javax.naming.NamingException;
-
-public interface InitialContextFactoryBuilder
-{
- InitialContextFactory createInitialContextFactory (Hashtable environment)
- throws NamingException;
-}
diff --git a/libjava/javax/naming/spi/NamingManager.java b/libjava/javax/naming/spi/NamingManager.java
deleted file mode 100644
index cfc9dbd5f10..00000000000
--- a/libjava/javax/naming/spi/NamingManager.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/* NamingManager.java --
- Copyright (C) 2000, 2001, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-import javax.naming.CannotProceedException;
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.NoInitialContextException;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
-
-public class NamingManager
-{
- public static final String CPE = "java.naming.spi.CannotProceedException";
-
- private static InitialContextFactoryBuilder icfb;
-
- // Package private so DirectoryManager can access it.
- static ObjectFactoryBuilder ofb;
-
- // This class cannot be instantiated.
- NamingManager ()
- {
- }
-
- public static boolean hasInitialContextFactoryBuilder ()
- {
- return icfb != null;
- }
-
- public static Context getInitialContext (Hashtable environment)
- throws NamingException
- {
- InitialContextFactory icf = null;
-
- if (icfb != null)
- icf = icfb.createInitialContextFactory(environment);
- else
- {
- String java_naming_factory_initial = null;
- if (environment != null)
- java_naming_factory_initial
- = (String) environment.get (Context.INITIAL_CONTEXT_FACTORY);
- if (java_naming_factory_initial == null)
- java_naming_factory_initial =
- System.getProperty (Context.INITIAL_CONTEXT_FACTORY);
- if (java_naming_factory_initial == null)
- throw new
- NoInitialContextException ("Can't find property: "
- + Context.INITIAL_CONTEXT_FACTORY);
-
- try
- {
- icf = (InitialContextFactory)Class.forName
- (java_naming_factory_initial, true,
- Thread.currentThread().getContextClassLoader())
- .newInstance ();
- }
- catch (Exception exception)
- {
- NoInitialContextException e
- = new NoInitialContextException
- ("Can't load InitialContextFactory class: "
- + java_naming_factory_initial);
- e.setRootCause(exception);
- throw e;
- }
- }
-
- return icf.getInitialContext (environment);
- }
-
- static Context getURLContext (Object refInfo,
- Name name,
- Context nameCtx,
- String scheme,
- Hashtable environment)
- throws NamingException
- {
- String prefixes = null;
- if (environment != null)
- prefixes = (String) environment.get (Context.URL_PKG_PREFIXES);
- if (prefixes == null)
- prefixes = System.getProperty (Context.URL_PKG_PREFIXES);
- if (prefixes == null)
- {
- // Specified as the default in the docs. Unclear if this is
- // right for us.
- prefixes = "com.sun.jndi.url";
- }
-
- scheme = scheme + "." + scheme + "URLContextFactory";
-
- StringTokenizer tokens = new StringTokenizer (prefixes, ":");
- while (tokens.hasMoreTokens ())
- {
- String aTry = tokens.nextToken ();
- try
- {
- Class factoryClass = Class.forName (aTry + "." + scheme,
- true,
- Thread.currentThread().getContextClassLoader());
- ObjectFactory factory =
- (ObjectFactory) factoryClass.newInstance ();
- Object obj = factory.getObjectInstance (refInfo, name,
- nameCtx, environment);
- Context ctx = (Context) obj;
- if (ctx != null)
- return ctx;
- }
- catch (ClassNotFoundException _1)
- {
- // Ignore it.
- }
- catch (ClassCastException _2)
- {
- // This means that the class we found was not an
- // ObjectFactory or that the factory returned something
- // which was not a Context.
- }
- catch (InstantiationException _3)
- {
- // If we couldn't instantiate the factory we might get
- // this.
- }
- catch (IllegalAccessException _4)
- {
- // Another possibility when instantiating.
- }
- catch (NamingException _5)
- {
- throw _5;
- }
- catch (Exception _6)
- {
- // Anything from getObjectInstance.
- }
- }
-
- return null;
- }
-
- public static Context getURLContext (String scheme,
- Hashtable environment)
- throws NamingException
- {
- return getURLContext (null, null, null, scheme, environment);
- }
-
- public static void setObjectFactoryBuilder (ObjectFactoryBuilder builder)
- throws NamingException
- {
- SecurityManager sm = System.getSecurityManager ();
- if (sm != null)
- sm.checkSetFactory ();
- // Once the builder is installed it cannot be replaced.
- if (ofb != null)
- throw new IllegalStateException ("builder already installed");
- if (builder != null)
- ofb = builder;
- }
-
- static StringTokenizer getPlusPath (String property, Hashtable env,
- Context nameCtx)
- throws NamingException
- {
- String path = (String) env.get (property);
- if (nameCtx == null)
- nameCtx = getInitialContext (env);
- String path2 = (String) nameCtx.getEnvironment ().get (property);
- if (path == null)
- path = path2;
- else if (path2 != null)
- path += ":" + path2;
- return new StringTokenizer (path != null ? path : "", ":");
- }
-
- public static Object getObjectInstance (Object refInfo,
- Name name,
- Context nameCtx,
- Hashtable environment)
- throws Exception
- {
- ObjectFactory factory = null;
-
- if (ofb != null)
- factory = ofb.createObjectFactory (refInfo, environment);
- else
- {
- // First see if we have a Reference or a Referenceable. If so
- // we do some special processing.
- Object ref2 = refInfo;
- if (refInfo instanceof Referenceable)
- ref2 = ((Referenceable) refInfo).getReference ();
- if (ref2 instanceof Reference)
- {
- Reference ref = (Reference) ref2;
-
- // If we have a factory class name then we use that.
- String fClass = ref.getFactoryClassName ();
- if (fClass != null)
- {
- // Exceptions here are passed to the caller.
- Class k = Class.forName (fClass,
- true,
- Thread.currentThread().getContextClassLoader());
- factory = (ObjectFactory) k.newInstance ();
- }
- else
- {
- // There's no factory class name. If the address is a
- // StringRefAddr with address type `URL', then we try
- // the URL's context factory.
- Enumeration e = ref.getAll ();
- while (e.hasMoreElements ())
- {
- RefAddr ra = (RefAddr) e.nextElement ();
- if (ra instanceof StringRefAddr
- && "URL".equals (ra.getType ()))
- {
- factory
- = (ObjectFactory) getURLContext (refInfo,
- name,
- nameCtx,
- (String) ra.getContent (),
- environment);
- Object obj = factory.getObjectInstance (refInfo,
- name,
- nameCtx,
- environment);
- if (obj != null)
- return obj;
- }
- }
-
- // Have to try the next step.
- factory = null;
- }
- }
-
- // Now look at OBJECT_FACTORIES to find the factory.
- if (factory == null)
- {
- StringTokenizer tokens = getPlusPath (Context.OBJECT_FACTORIES,
- environment, nameCtx);
-
- while (tokens.hasMoreTokens ())
- {
- String klassName = tokens.nextToken ();
- Class k = Class.forName (klassName,
- true,
- Thread.currentThread().getContextClassLoader());
- factory = (ObjectFactory) k.newInstance ();
- Object obj = factory.getObjectInstance (refInfo, name,
- nameCtx, environment);
- if (obj != null)
- return obj;
- }
-
- // Failure.
- return refInfo;
- }
- }
-
- if (factory == null)
- return refInfo;
- Object obj = factory.getObjectInstance (refInfo, name,
- nameCtx, environment);
- return obj == null ? refInfo : obj;
- }
-
- public static void setInitialContextFactoryBuilder (InitialContextFactoryBuilder builder)
- throws NamingException
- {
- SecurityManager sm = System.getSecurityManager ();
- if (sm != null)
- sm.checkSetFactory ();
- // Once the builder is installed it cannot be replaced.
- if (icfb != null)
- throw new IllegalStateException ("builder already installed");
- if (builder != null)
- icfb = builder;
- }
-
- public static Context getContinuationContext (CannotProceedException cpe)
- throws NamingException
- {
- Hashtable env = cpe.getEnvironment ();
- if (env != null)
- env.put (CPE, cpe);
-
- // It is really unclear to me if this is right.
- try
- {
- Object obj = getObjectInstance (cpe.getResolvedObj(),
- cpe.getAltName (),
- cpe.getAltNameCtx (),
- env);
- if (obj != null)
- return (Context) obj;
- }
- catch (Exception _)
- {
- }
-
- // fix stack trace for re-thrown exception (message confusing otherwise)
- cpe.fillInStackTrace();
-
- throw cpe;
- }
-
- public static Object getStateToBind (Object obj, Name name,
- Context nameCtx, Hashtable environment)
- throws NamingException
- {
- StringTokenizer tokens = getPlusPath (Context.STATE_FACTORIES,
- environment, nameCtx);
- while (tokens.hasMoreTokens ())
- {
- String klassName = tokens.nextToken ();
- try
- {
- Class k = Class.forName (klassName,
- true,
- Thread.currentThread().getContextClassLoader());
- StateFactory factory = (StateFactory) k.newInstance ();
- Object o = factory.getStateToBind (obj, name, nameCtx,
- environment);
- if (o != null)
- return o;
- }
- catch (ClassNotFoundException _1)
- {
- // Ignore it.
- }
- catch (ClassCastException _2)
- {
- // This means that the class we found was not an
- // ObjectFactory or that the factory returned something
- // which was not a Context.
- }
- catch (InstantiationException _3)
- {
- // If we couldn't instantiate the factory we might get
- // this.
- }
- catch (IllegalAccessException _4)
- {
- // Another possibility when instantiating.
- }
- }
-
- return obj;
- }
-}
diff --git a/libjava/javax/naming/spi/ObjectFactory.java b/libjava/javax/naming/spi/ObjectFactory.java
deleted file mode 100644
index 81648d9a8b5..00000000000
--- a/libjava/javax/naming/spi/ObjectFactory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ObjectFactory.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.Name;
-
-public interface ObjectFactory
-{
- Object getObjectInstance (Object obj, Name name, Context nameCtx,
- Hashtable environment)
- throws Exception;
-}
diff --git a/libjava/javax/naming/spi/ObjectFactoryBuilder.java b/libjava/javax/naming/spi/ObjectFactoryBuilder.java
deleted file mode 100644
index a7613931548..00000000000
--- a/libjava/javax/naming/spi/ObjectFactoryBuilder.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ObjectFactoryBuilder.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import java.util.Hashtable;
-
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-public interface ObjectFactoryBuilder
-{
- ObjectFactory createObjectFactory(Object obj,
- Hashtable environment)
- throws NamingException;
-}
diff --git a/libjava/javax/naming/spi/ResolveResult.java b/libjava/javax/naming/spi/ResolveResult.java
deleted file mode 100644
index 72a101ec567..00000000000
--- a/libjava/javax/naming/spi/ResolveResult.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* ResolveResult.java --
- Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import java.io.Serializable;
-
-import javax.naming.CompositeName;
-import javax.naming.InvalidNameException;
-import javax.naming.Name;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 5, 2001
- */
-
-public class ResolveResult implements Serializable
-{
- // Serialized fields.
- protected Object resolvedObj;
- protected Name remainingName;
-
- protected ResolveResult()
- {
- resolvedObj = null;
- remainingName = null;
- }
-
- public ResolveResult(Object robj, String rcomp)
- {
- if (robj == null || rcomp == null)
- throw new IllegalArgumentException ();
- resolvedObj = robj;
- remainingName = new CompositeName ();
- try
- {
- remainingName.add (rcomp);
- }
- catch (InvalidNameException _)
- {
- }
- }
-
- public ResolveResult(Object robj, Name rname)
- {
- resolvedObj = robj;
- remainingName = rname;
- }
-
- public Name getRemainingName()
- {
- return remainingName;
- }
-
- public Object getResolvedObj()
- {
- return resolvedObj;
- }
-
- public void setRemainingName(Name name)
- {
- remainingName = (Name) name.clone();
- }
-
- public void appendRemainingName(Name name)
- {
- try
- {
- remainingName.addAll(name);
- }
- catch (InvalidNameException _)
- {
- }
- }
-
- public void appendRemainingComponent(String name)
- {
- try
- {
- remainingName.add(name);
- }
- catch (InvalidNameException _)
- {
- }
- }
-
- public void setResolvedObj(Object obj)
- {
- resolvedObj = obj;
- }
-}
diff --git a/libjava/javax/naming/spi/Resolver.java b/libjava/javax/naming/spi/Resolver.java
deleted file mode 100644
index d80fb616924..00000000000
--- a/libjava/javax/naming/spi/Resolver.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Resolver.java --
- Copyright (C) 2001, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import javax.naming.Name;
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-
-public interface Resolver
-{
- ResolveResult resolveToClass(Name name, Class contextType)
- throws NamingException;
- ResolveResult resolveToClass(String name, Class contextType)
- throws NamingException;
-}
diff --git a/libjava/javax/naming/spi/StateFactory.java b/libjava/javax/naming/spi/StateFactory.java
deleted file mode 100644
index 1fbdeb1fa1e..00000000000
--- a/libjava/javax/naming/spi/StateFactory.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* StateFactory.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.naming.spi;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingException;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date June 1, 2001
- */
-public interface StateFactory
-{
- Object getStateToBind(Object obj, Name name, Context nameCtx,
- Hashtable environment) throws NamingException;
-}
diff --git a/libjava/javax/net/ServerSocketFactory.java b/libjava/javax/net/ServerSocketFactory.java
deleted file mode 100644
index 0fc13d1846e..00000000000
--- a/libjava/javax/net/ServerSocketFactory.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ServerSocketFactory.java -- factory for server sockets.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-import java.io.IOException;
-
-import java.net.InetAddress;
-import java.net.ServerSocket;
-
-import java.security.Security;
-
-/**
- * A factory for server sockets. The purpose of this class is to serve
- * as the superclass of server socket factories that produce server
- * sockets of a particular type, such as <i>Secure Socket Layer</i>
- * (<b>SSL</b>) server sockets.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public abstract class ServerSocketFactory
-{
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- /**
- * Default 0-argument constructor.
- */
- protected ServerSocketFactory()
- {
- super();
- }
-
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Returns the default server socket factory. The type of factory
- * returned may depend upon the installation.
- *
- * @return The default server socket factory.
- */
- public static synchronized ServerSocketFactory getDefault()
- {
- try
- {
- String s = Security.getProperty("gnu.defaultServerSocketFactory");
- if (s != null)
- {
- Class c = Class.forName(s);
- return (ServerSocketFactory) c.newInstance();
- }
- }
- catch (Exception e)
- {
- }
- return new VanillaServerSocketFactory();
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- /**
- * Create an unbound server socket.
- *
- * @return The new server socket.
- * @throws IOException If a networking error occurs.
- */
- public ServerSocket createServerSocket() throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Create a server socket bound to the given port.
- *
- * @param port The port to bind the server socket to.
- * @return A server socket bound to <i>port</i>.
- * @throws IOException If a networking error occurs.
- */
- public abstract ServerSocket createServerSocket(int port) throws IOException;
-
- public abstract ServerSocket createServerSocket(int port, int backlog) throws IOException;
-
- public abstract ServerSocket createServerSocket(int port, int backlog, InetAddress bindAddress) throws IOException;
-}
diff --git a/libjava/javax/net/SocketFactory.java b/libjava/javax/net/SocketFactory.java
deleted file mode 100644
index 945a52b6800..00000000000
--- a/libjava/javax/net/SocketFactory.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/* SocketFactory.java -- factory for client sockets.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-import java.io.IOException;
-
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.UnknownHostException;
-
-import java.security.Security;
-
-/**
- * A factory for client sockets. The purpose of this class is to serve
- * as the superclass of server socket factories that produce client
- * sockets of a particular type, such as <i>Secure Socket Layer</i>
- * (<b>SSL</b>) sockets.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public abstract class SocketFactory
-{
-
- // Constructor.
- // -------------------------------------------------------------------
-
- /**
- * Default 0-arguments constructor.
- */
- protected SocketFactory()
- {
- super();
- }
-
- // Class methods.
- // -------------------------------------------------------------------
-
- /**
- * Returns the default socket factory. The type of factory
- * returned may depend upon the installation.
- *
- * @return The default socket factory.
- */
- public static synchronized SocketFactory getDefault()
- {
- try
- {
- String s = Security.getProperty("gnu.defaultSocketFactory");
- if (s != null)
- {
- Class c = Class.forName(s);
- return (SocketFactory) c.newInstance();
- }
- }
- catch (Exception e)
- {
- }
- return new VanillaSocketFactory();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------
-
- /**
- * Returns an unbound client socket.
- *
- * @return The new, unbound socket.
- */
- public Socket createSocket() throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Creates a socket connected to a given host on a given port.
- *
- * @param host The hostname to connect to.
- * @param port The port on <i>host</i> to connect to.
- * @return A socket connected to <i>host</i> on <i>port</i>.
- * @throws IOException If a network error occurs.
- * @throws UnknownHostException If <i>host</i> cannot be resolved.
- */
- public abstract Socket createSocket(String host, int port) throws IOException, UnknownHostException;
-
- /**
- * Creates a socket connected to a given host on a given port,
- * connecting locally to the interface with the given address and port.
- *
- * @param host The hostname to connect to.
- * @param port The port on <i>host</i> to connect to.
- * @param localHost The address of the local interface to bind to.
- * @param localPort The local port to bind to.
- * @return A socket connected to <i>host</i> on <i>port</i>.
- * @throws IOException If a network error occurs.
- * @throws UnknownHostException If <i>host</i> cannot be resolved.
- */
- public abstract Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException;
-
- /**
- * Creates a socket connected to a given host on a given port.
- *
- * @param host The host address to connect to.
- * @param port The port on <i>host</i> to connect to.
- * @return A socket connected to <i>host</i> on <i>port</i>.
- * @throws IOException If a network error occurs.
- */
- public abstract Socket createSocket(InetAddress host, int port) throws IOException;
-
- /**
- * Creates a socket connected to a given host on a given port,
- * connecting locally to the interface with the given address and port.
- *
- * @param host The host address to connect to.
- * @param port The port on <i>host</i> to connect to.
- * @param localHost The address of the local interface to bind to.
- * @param localPort The local port to bind to.
- * @return A socket connected to <i>host</i> on <i>port</i>.
- * @throws IOException If a network error occurs.
- */
- public abstract Socket createSocket(InetAddress hast, int port, InetAddress localHost, int localPort) throws IOException;
-}
diff --git a/libjava/javax/net/VanillaServerSocketFactory.java b/libjava/javax/net/VanillaServerSocketFactory.java
deleted file mode 100644
index f6e4dc876dd..00000000000
--- a/libjava/javax/net/VanillaServerSocketFactory.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* VanillaServerSocketFactory.java -- trivial socket factory.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-import java.io.IOException;
-
-import java.net.InetAddress;
-import java.net.ServerSocket;
-
-/**
- * A trivial server socket factory.
- */
-class VanillaServerSocketFactory extends ServerSocketFactory
-{
-
- // Constructor.
- // ------------------------------------------------------------------
-
- VanillaServerSocketFactory()
- {
- super();
- }
-
- // Instance methods.
- // ------------------------------------------------------------------
-
- public ServerSocket createServerSocket() throws IOException
- {
- return new ServerSocket();
- }
-
- public ServerSocket createServerSocket(int port) throws IOException
- {
- return new ServerSocket(port);
- }
-
- public ServerSocket createServerSocket(int port, int backlog) throws IOException
- {
- return new ServerSocket(port, backlog);
- }
-
- public ServerSocket createServerSocket(int port, int backlog, InetAddress bindAddress) throws IOException
- {
- return new ServerSocket(port, backlog, bindAddress);
- }
-}
diff --git a/libjava/javax/net/VanillaSocketFactory.java b/libjava/javax/net/VanillaSocketFactory.java
deleted file mode 100644
index 5fffe106d33..00000000000
--- a/libjava/javax/net/VanillaSocketFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* VanillaSocketFactory.java -- trivial socket factory.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net;
-
-import java.io.IOException;
-
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.UnknownHostException;
-
-/**
- * A trivial client socket factory.
- */
-class VanillaSocketFactory extends SocketFactory
-{
-
- // Constructor.
- // ------------------------------------------------------------------
-
- VanillaSocketFactory()
- {
- super();
- }
-
- // Instance methods.
- // ------------------------------------------------------------------
-
- public Socket createSocket() throws IOException
- {
- return new Socket();
- }
-
- public Socket createSocket(String host, int port) throws IOException, UnknownHostException
- {
- return new Socket(host, port);
- }
-
- public Socket createSocket(String host, int port, InetAddress localAddr, int localPort) throws IOException, UnknownHostException
- {
- return new Socket(host, port, localAddr, localPort);
- }
-
- public Socket createSocket(InetAddress address, int port) throws IOException
- {
- return new Socket(address, port);
- }
-
- public Socket createSocket(InetAddress address, int port, InetAddress localAddr, int localPort) throws IOException
- {
- return new Socket(address, port, localAddr, localPort);
- }
-}
diff --git a/libjava/javax/net/ssl/HandshakeCompletedEvent.java b/libjava/javax/net/ssl/HandshakeCompletedEvent.java
deleted file mode 100644
index 743f1372672..00000000000
--- a/libjava/javax/net/ssl/HandshakeCompletedEvent.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/* HandshakeCompletedEvent.java -- SSL handshake completed.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.security.cert.Certificate;
-
-import javax.security.cert.X509Certificate;
-
-/**
- * An event raised by a SSLSocket and passed to the {@link
- * HandshakeCompletedListener#handshakeCompleted(HandshakeCompletedEvent)}
- * method of all registered listeners when a SSL handshake in a SSL
- * protocol is completed.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class HandshakeCompletedEvent extends java.util.EventObject
-{
- // Fields.
- // -------------------------------------------------------------------
-
- /** Serialization constant. */
- private static final long serialVersionUID = 7914963744257769778L;
-
- /** The session. */
- private final transient SSLSession session;
-
- // Constructor.
- // -------------------------------------------------------------------
-
- /**
- * Creates a new handshake completed event.
- *
- * @param socket The socket (also the source) creating this event.
- * @param session The associated session object.
- * @throws NullPointerException If <i>session</i> is null.
- */
- public HandshakeCompletedEvent(SSLSocket socket, SSLSession session)
- {
- super(socket);
- if (session == null)
- throw new NullPointerException();
- this.session = session;
- }
-
- // Instance methods.
- // --------------------------------------------------------------------
-
- /**
- * Returns the name of the cipher that was negotiated in this
- * connection.
- *
- * @return The negotiated cipher name.
- */
- public String getCipherSuite()
- {
- if (session != null)
- return session.getCipherSuite();
- return null;
- }
-
- /**
- * Returns the local certificates being used in this connection.
- *
- * @return The local certificates.
- */
- public Certificate[] getLocalCertificates()
- {
- if (session != null)
- return session.getLocalCertificates();
- return null;
- }
-
- /**
- * Returns the peer's certificates being used in this connection.
- *
- * @return The peer's certificates.
- * @throws SSLPeerUnverifiedException If the peer has not been
- * verified.
- */
- public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException
- {
- if (session != null)
- return session.getPeerCertificates();
- return null;
- }
-
- public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException
- {
- if (session != null)
- return session.getPeerCertificateChain();
- return null;
- }
-
- /**
- * Returns the SSL session object associated with this connection.
- *
- * @return The session object.
- */
- public SSLSession getSession()
- {
- return session;
- }
-
- /**
- * Returns the socket over which this connection is being
- * negotiated. This method is equivalent to the {@link
- * java.util.EventObject#getSource()} method.
- *
- * @return The socket.
- */
- public SSLSocket getSocket()
- {
- return (SSLSocket) getSource();
- }
-}
diff --git a/libjava/javax/net/ssl/HandshakeCompletedListener.java b/libjava/javax/net/ssl/HandshakeCompletedListener.java
deleted file mode 100644
index 98584f290df..00000000000
--- a/libjava/javax/net/ssl/HandshakeCompletedListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* HandshakeCompletedListener.java -- listens for handshake events.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-/**
- * An event listener that waits to be notified of {@link
- * HandshakeCompletedEvent} objects created when handshake phase of
- * the SSL protocol is completed for a particular connection.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public interface HandshakeCompletedListener extends java.util.EventListener
-{
-
- /**
- * Called when the handshake phase of the SSL protocol completes.
- *
- * @param event The event describing the new connection.
- */
- void handshakeCompleted(HandshakeCompletedEvent event);
-}
diff --git a/libjava/javax/net/ssl/HostnameVerifier.java b/libjava/javax/net/ssl/HostnameVerifier.java
deleted file mode 100644
index 4b04656785e..00000000000
--- a/libjava/javax/net/ssl/HostnameVerifier.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* HostnameVerifier.java -- verifies disparate hostnames.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-/**
- * The interface for classes that perform hostname verification for cases
- * when the hostname used to begin the connection (such as in a URL)
- * does not match the hostname used in the SSL handshake.
- * Implementations of this interface should provide an implementation
- * of the {@link #verify(java.lang.String,javax.net.ssl.SSLSession)}
- * method that accepts or rejects hostnames as appropriate.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public interface HostnameVerifier
-{
-
- /**
- * Verifies a hostname given a particular SSL session. This method
- * should return <code>true</code> if the hostname is an accepted
- * alias for the hostname negotiated in the SSL handshake.
- *
- * @param hostname The hostname in question.
- * @param session The current SSL session.
- * @return <code>true</code> if the hostname is acceptable.
- */
- boolean verify(String hostname, SSLSession session);
-}
diff --git a/libjava/javax/net/ssl/HttpsURLConnection.java b/libjava/javax/net/ssl/HttpsURLConnection.java
deleted file mode 100644
index 4c73edbcd2e..00000000000
--- a/libjava/javax/net/ssl/HttpsURLConnection.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/* HttpsURLConnection.java -- an HTTPS connection.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.security.cert.Certificate;
-
-/**
- * A URL connection that connects via the <i>Secure Socket Layer</i>
- * (<b>SSL</b>) for HTTPS connections.
- *
- * <p>This class may be used in the same way as {@link
- * HttpURLConnection}, and it will transparently negotiate the SSL
- * connection.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public abstract class HttpsURLConnection extends HttpURLConnection
-{
-
- // Fields.
- // ------------------------------------------------------------------
-
- /**
- * The default verifier.
- * This is lazily initialized as required.
- * @see #getDefaultHostnameVerifier
- */
- private static HostnameVerifier defaultVerifier;
-
- /**
- * The default factory.
- * This is lazily initialized as required.
- * @see #getDefaultSSLSocketFactory
- */
- private static SSLSocketFactory defaultFactory;
-
- /**
- * The hostname verifier used for this connection.
- */
- protected HostnameVerifier hostnameVerifier;
-
- /**
- * This connection's socket factory.
- */
- private SSLSocketFactory factory;
-
- // Constructor.
- // ------------------------------------------------------------------
-
- /**
- * Creates a new HTTPS URL connection.
- *
- * @param url The URL of the connection being established.
- * @throws IOException If the connection cannot be established.
- */
- protected HttpsURLConnection(URL url) throws IOException
- {
- super(url);
- }
-
- // Class methods.
- // ------------------------------------------------------------------
-
- /**
- * Returns the default hostname verifier used in all new
- * connections.
- * If the default verifier has not been set, a new default one will be
- * provided by this method.
- *
- * @return The default hostname verifier.
- */
- public static synchronized HostnameVerifier getDefaultHostnameVerifier()
- {
- if (defaultVerifier == null)
- {
- defaultVerifier = new TrivialHostnameVerifier();
- }
- return defaultVerifier;
- }
-
- /**
- * Sets the default hostname verifier to be used in all new
- * connections.
- *
- * @param newDefault The new default hostname verifier.
- * @throws IllegalArgumentException If <i>newDefault</i> is null.
- * @throws SecurityException If there is a security manager
- * currently installed and the caller does not have the {@link
- * SSLPermission} "setHostnameVerifier".
- */
- public static void setDefaultHostnameVerifier(HostnameVerifier newDefault)
- {
- if (newDefault == null)
- throw new IllegalArgumentException("default verifier cannot be null");
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new SSLPermission("setHostnameVerifier"));
- synchronized (HttpsURLConnection.class)
- {
- defaultVerifier = newDefault;
- }
- }
-
- /**
- * Returns the default SSL socket factory used in all new
- * connections.
- * If the default SSL socket factory has not been set, a new default one
- * will be provided by this method.
- *
- * @return The default SSL socket factory.
- */
- public static synchronized SSLSocketFactory getDefaultSSLSocketFactory()
- {
- if (defaultFactory == null)
- {
- try
- {
- defaultFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- }
- }
- return defaultFactory;
- }
-
- /**
- * Sets the default SSL socket factory to be used in all new
- * connections.
- *
- * @param newDefault The new socket factory.
- * @throws IllegalArgumentException If <i>newDefault</i> is null.
- * @throws SecurityException If there is a security manager
- * installed and a call to {@link
- * SecurityManager#checkSetFactory()} fails.
- */
- public static void setDefaultSSLSocketFactory(SSLSocketFactory newDefault)
- {
- if (newDefault == null)
- throw new IllegalArgumentException("default factory cannot be null");
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSetFactory();
- synchronized (HttpsURLConnection.class)
- {
- defaultFactory = newDefault;
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------
-
- /**
- * Returns the current hostname verifier for this instance.
- *
- * @return The hostname verifier.
- */
- public HostnameVerifier getHostnameVerifier()
- {
- if (hostnameVerifier == null)
- {
- hostnameVerifier = getDefaultHostnameVerifier();
- }
- return hostnameVerifier;
- }
-
- /**
- * Sets the hostname verifier for this instance.
- *
- * @param hostnameVerifier The new verifier.
- * @throws IllegalArgumentException If <i>hostnameVerifier</i> is
- * null.
- */
- public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
- {
- if (hostnameVerifier == null)
- throw new IllegalArgumentException("verifier cannot be null");
- this.hostnameVerifier = hostnameVerifier;
- }
-
- /**
- * Returns the current SSL socket factory for this instance.
- *
- * @return The current SSL socket factory.
- */
- public SSLSocketFactory getSSLSocketFactory()
- {
- if (factory == null)
- {
- factory = getDefaultSSLSocketFactory();
- }
- return factory;
- }
-
- /**
- * Sets the SSL socket factory for this instance.
- *
- * @param factory The new factory.
- * @throws IllegalArgumentException If <i>factory</i> is null.
- */
- public void setSSLSocketFactory(SSLSocketFactory factory)
- {
- if (factory == null)
- throw new IllegalArgumentException("factory cannot be null");
- this.factory = factory;
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------
-
- /**
- * Returns the cipher name negotiated for this connection.
- *
- * @return The cipher name.
- * @throws IllegalStateException If the connection has not yet been
- * established.
- */
- public abstract String getCipherSuite();
-
- /**
- * Returns the certificates used on the local side in this
- * connection.
- *
- * @return The local certificates.
- * @throws IllegalStateException If the connection has not yet been
- * established.
- */
- public abstract Certificate[] getLocalCertificates();
-
- /**
- * Returns the certificates sent by the other party.
- *
- * @return The peer's certificates.
- * @throws IllegalStateException If the connection has not yet been
- * established.
- * @throws SSLPeerUnverifiedException If the peer could not be
- * verified.
- */
- public abstract Certificate[] getServerCertificates() throws SSLPeerUnverifiedException;
-}
diff --git a/libjava/javax/net/ssl/KeyManager.java b/libjava/javax/net/ssl/KeyManager.java
deleted file mode 100644
index 688faa5d573..00000000000
--- a/libjava/javax/net/ssl/KeyManager.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* KeyManager.java -- marker interface for key manager classes.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-/**
- * A marker interface for objects that serve as key managers in SSL
- * communications. Key managers typically keep track of the public
- * certificates and private keys when authenticating the local host to
- * remote host, and thus is typically used in SSL servers.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public interface KeyManager
-{
-}
diff --git a/libjava/javax/net/ssl/KeyManagerFactory.java b/libjava/javax/net/ssl/KeyManagerFactory.java
deleted file mode 100644
index ab8abd6264c..00000000000
--- a/libjava/javax/net/ssl/KeyManagerFactory.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/* KeyManagerFactory.java -- factory for key managers.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import gnu.java.security.Engine;
-
-import java.lang.reflect.InvocationTargetException;
-import java.security.AccessController;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.PrivilegedAction;
-import java.security.Provider;
-import java.security.Security;
-import java.security.UnrecoverableKeyException;
-
-/**
- * A class that creates key manager implementations based on a
- * requested algorithm.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class KeyManagerFactory
-{
-
- // Constants and fields.
- // ------------------------------------------------------------------
-
- /** The service name for key manager factories. */
- private static final String KEY_MANAGER_FACTORY = "KeyManagerFactory";
-
- /** The system default trust manager algorithm. */
- private static final String DEFAULT_ALGORITHM = "JessieX509";
-
- /** The underlying engine. */
- private final KeyManagerFactorySpi kmfSpi;
-
- /** The provider of this implementation. */
- private final Provider provider;
-
- /** The name of this algorithm. */
- private final String algorithm;
-
- // Constructor.
- // ------------------------------------------------------------------
-
- /**
- * Create a new key manager factory.
- *
- * @param kmfSpi The underlying engine.
- * @param provider The engine's provider.
- * @param algorithm The name of this algorithm.
- */
- protected KeyManagerFactory(KeyManagerFactorySpi kmfSpi,
- Provider provider, String algorithm)
- {
- this.kmfSpi = kmfSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- }
-
- // Class methods.
- // ------------------------------------------------------------------
-
- /**
- * Get the default algorithm name. This value may be specified at
- * run-time via the security property
- * "ssl.KeyManagerFactory.algorithm". If this property is
- * not specified, this method returns "JessieX509".
- *
- * @return The default key manager factory algorithm's name.
- */
- public static final String getDefaultAlgorithm()
- {
- String alg = null;
- try
- {
- alg = (String) AccessController.doPrivileged(
- new PrivilegedAction()
- {
- public Object run()
- {
- return Security.getProperty("ssl.KeyManagerFactory.algorithm");
- }
- }
- );
- }
- catch (SecurityException se)
- {
- }
- if (alg == null)
- alg = DEFAULT_ALGORITHM;
- return alg;
- }
-
- /**
- * Get an instance of the named key manager factory, from the first
- * provider that implements it.
- *
- * @param algorithm The type of key manager factory to get.
- * @return An appropriate implementation of that algoritm.
- * @throws NoSuchAlgorithmException If no provider implements the
- * requested algorithm.
- */
- public static final KeyManagerFactory getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] provs = Security.getProviders();
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException ignore)
- {
- }
- }
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Get an instance of the named key manager factory, from the named
- * provider.
- *
- * @param algorithm The type of key manager factory to get.
- * @param provider The name of the provider to get the
- * implementation from.
- * @return An appropriate implementation of that algorithm.
- * @throws NoSuchAlgorithmException If the provider does not
- * implement the requested algorithm.
- * @throws NoSuchProviderException If the named provider does not
- * exist.
- */
- public static final KeyManagerFactory getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- if (provider == null)
- throw new IllegalArgumentException("provider is null");
- Provider p = Security.getProvider(provider);
- if (p == null)
- throw new NoSuchProviderException(provider);
- return getInstance(algorithm, p);
- }
-
- /**
- * Get an instance of the named key manager factory, from the given
- * provider.
- *
- * @param algorithm The type of key manager factory to get.
- * @param provider The provider to get the implementation from.
- * @return An appropriate implementation of that algorithm.
- * @throws NoSuchAlgorithmException If the provider does not
- * implement the requested algorithm.
- * @throws IllegalArgumentException If <i>provider</i> is null.
- */
- public static final KeyManagerFactory getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- throw new IllegalArgumentException("provider is null");
- try
- {
- return new KeyManagerFactory((KeyManagerFactorySpi)
- Engine.getInstance(KEY_MANAGER_FACTORY, algorithm, provider),
- provider, algorithm);
- }
- catch (InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- // Instance methods.
- // -------------------------------------------------------------------
-
- /**
- * Returns the name of this key manager factory algorithm.
- *
- * @return The name of this key manager factory algorithm.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Get an array of key managers appropriate for this algorithm, with
- * the most preferred manager first.
- *
- * @return The array of key managers.
- */
- public final KeyManager[] getKeyManagers()
- {
- return kmfSpi.engineGetKeyManagers();
- }
-
- /**
- * Returns the provider of this implementation.
- *
- * @return The provider of this implementation.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Initialize this instance with an implementation-dependent
- * parameter object.
- *
- * @param params The parameters to initialize with.
- * @throws InvalidAlgorithmParameterException If the specified
- * parameters are inappropriate.
- */
- public final void init(ManagerFactoryParameters params)
- throws InvalidAlgorithmParameterException
- {
- kmfSpi.engineInit(params);
- }
-
- /**
- * Initialize this instance with a key store and a password for
- * private key entries.
- *
- * @param store The key store to read.
- * @param passwd The password protecting private keys in the store.
- * @throws KeyStoreException If an error occurs reading the keys.
- * @throws NoSuchAlgorithmException If an algorithm (such as a
- * certificate algorithm) is not available.
- * @throws UnrecoverableKeyException If the password is incorrect.
- */
- public final void init(KeyStore store, char[] passwd)
- throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException
- {
- kmfSpi.engineInit(store, passwd);
- }
-}
diff --git a/libjava/javax/net/ssl/KeyManagerFactorySpi.java b/libjava/javax/net/ssl/KeyManagerFactorySpi.java
deleted file mode 100644
index a74bcee3aad..00000000000
--- a/libjava/javax/net/ssl/KeyManagerFactorySpi.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* KeyManagerFactorySpi.java -- SPI for key manager factories.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-
-/**
- * The <i>Service Provider Interface</i> (<b>SPI</b>) for key manager
- * factories.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public abstract class KeyManagerFactorySpi
-{
-
- // Constructor.
- // ------------------------------------------------------------------
-
- public KeyManagerFactorySpi()
- {
- super();
- }
-
- // Abstract methods.
- // ------------------------------------------------------------------
-
- /**
- * Engine method for retrieving this factory's key managers.
- *
- * @return The key managers.
- */
- protected abstract KeyManager[] engineGetKeyManagers();
-
- /**
- * Engine method for initializing this factory with some
- * algorithm-specific parameters.
- *
- * @param params The factory parameters.
- * @throws InvalidAlgorithmParameterException If the supplied parameters
- * are inappropriate for this instance.
- */
- protected abstract void engineInit(ManagerFactoryParameters params)
- throws InvalidAlgorithmParameterException;
-
- /**
- * Engine method for initializing this factory with a key store and a
- * password for private keys. Either parameter may be <code>null</code>,
- * in which case some default parameters (possibly derived from system
- * properties) should be used.
- *
- * @param store The key store.
- * @param passwd The private key password.
- * @throws KeyStoreException If the key store cannot be accessed.
- * @throws NoSuchAlgorithmException If some of the data from the key
- * store cannot be retrieved.
- * @throws UnrecoverableKeyException If a private key cannot be retrieved,
- * likely from a wrong password.
- */
- protected abstract void engineInit(KeyStore store, char[] passwd)
- throws KeyStoreException, NoSuchAlgorithmException,
- UnrecoverableKeyException;
-}
diff --git a/libjava/javax/net/ssl/ManagerFactoryParameters.java b/libjava/javax/net/ssl/ManagerFactoryParameters.java
deleted file mode 100644
index 59c92150981..00000000000
--- a/libjava/javax/net/ssl/ManagerFactoryParameters.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ManagerFactoryParameters.java -- marker interface for manager parameters.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-/**
- * A marker interface for classes that serve as key or trust manager
- * parameters, used to initialize instances of {@link
- * KeyManagerFactory} or {@link TrustManagerFactory}.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public interface ManagerFactoryParameters
-{
-}
diff --git a/libjava/javax/net/ssl/SSLContext.java b/libjava/javax/net/ssl/SSLContext.java
deleted file mode 100644
index eaf3e3638e2..00000000000
--- a/libjava/javax/net/ssl/SSLContext.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/* SSLContext.java -- an SSL protocol context.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import gnu.java.security.Engine;
-
-import java.lang.reflect.InvocationTargetException;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.SecureRandom;
-import java.security.Security;
-
-/**
- * A "meta-factory" for protocol-specific socket and server socket
- * factories. This class serves as a clearinghouse for socket
- * factories and cached session contexts for a particular protocol,
- * such as SSLv3.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class SSLContext
-{
- // Constants and fields.
- // ------------------------------------------------------------------
-
- /** Service name for SSL contexts. */
- private static final String SSL_CONTEXT = "SSLContext";
-
- /** The underlying engine. */
- private final SSLContextSpi ctxSpi;
-
- /** The provider of the engine class. */
- private final Provider provider;
-
- /** The protocal name. */
- private final String protocol;
-
- // Constructor.
- // ------------------------------------------------------------------
-
- /**
- * Create a new SSL context.
- *
- * @param ctxSpi The context engine.
- * @param provider The provider of the implementation.
- * @param protocol The name of the SSL protocol.
- */
- protected SSLContext(SSLContextSpi ctxSpi, Provider provider,
- String protocol)
- {
- this.ctxSpi = ctxSpi;
- this.provider = provider;
- this.protocol = protocol;
- }
-
- // Class methods.
- // ------------------------------------------------------------------
-
- /**
- * Get an instance of a context for the specified protocol from the
- * first provider that implements it.
- *
- * @param protocol The name of the protocol to get a context for.
- * @return The new context.
- * @throws NoSuchAlgorithm If no provider implements the given
- * protocol.
- */
- public static final SSLContext getInstance(String protocol)
- throws NoSuchAlgorithmException
- {
- Provider[] provs = Security.getProviders();
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(protocol, provs[i]);
- }
- catch (NoSuchAlgorithmException ignore)
- {
- }
- }
- throw new NoSuchAlgorithmException(protocol);
- }
-
- /**
- * Get an instance of a context for the specified protocol from the
- * named provider.
- *
- * @param protocol The name of the protocol to get a context for.
- * @param provider The name of the provider to get the
- * implementation from.
- * @return The new context.
- * @throws NoSuchAlgorithmException If the provider does not
- * implement the given protocol.
- * @throws NoSuchProviderException If the named provider does not
- * exist.
- * @throws IllegalArgumentException If <i>provider</i> is null.
- */
- public static final SSLContext getInstance(String protocol,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- if (provider == null)
- {
- throw new IllegalArgumentException("null provider");
- }
- Provider p = Security.getProvider(provider);
- if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
- return getInstance(protocol, p);
- }
-
- /**
- * Get an instance of a context for the specified protocol from the
- * specified provider.
- *
- * @param protocol The name of the protocol to get a context for.
- * @param provider The name of the provider to get the
- * implementation from.
- * @return The new context.
- * @throws NoSuchAlgorithmException If the provider does not
- * implement the given protocol.
- * @throws IllegalArgumentException If <i>provider</i> is null.
- */
- public static final SSLContext getInstance(String protocol,
- Provider provider)
- throws NoSuchAlgorithmException
- {
- try
- {
- return new SSLContext((SSLContextSpi)
- Engine.getInstance(SSL_CONTEXT, protocol, provider),
- provider, protocol);
- }
- catch (InvocationTargetException ite)
- {
- NoSuchAlgorithmException nsae = new NoSuchAlgorithmException(protocol);
- throw (NoSuchAlgorithmException) nsae.initCause(ite);
- }
- catch (ClassCastException cce)
- {
- NoSuchAlgorithmException nsae = new NoSuchAlgorithmException(protocol);
- throw (NoSuchAlgorithmException) nsae.initCause(cce);
- }
- }
-
- // Instance methods.
- // -----------------------------------------------------------------
-
- /**
- * Returns the set of SSL contexts available for client connections.
- *
- * @return The set of SSL contexts available for client connections.
- */
- public final SSLSessionContext getClientSessionContext()
- {
- return ctxSpi.engineGetClientSessionContext();
- }
-
- /**
- * Returns the protocol name of this context.
- *
- * @return The protocol name of this context.
- */
- public final String getProtocol()
- {
- return protocol;
- }
-
- /**
- * Returns the provider of this implementation.
- *
- * @return The provider of this implementation.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Returns the set of SSL contexts available for server connections.
- *
- * @return The set of SSL contexts available for server connections.
- */
- public final SSLSessionContext getServerSessionContext()
- {
- return ctxSpi.engineGetServerSessionContext();
- }
-
- /**
- * Returns the factory for server SSL sockets.
- *
- * @return The factory for server SSL sockets.
- */
- public final SSLServerSocketFactory getServerSocketFactory()
- {
- return ctxSpi.engineGetServerSocketFactory();
- }
-
- /**
- * Returns the factory for client SSL sockets.
- *
- * @return The factory for client SSL sockets.
- */
- public final SSLSocketFactory getSocketFactory()
- {
- return ctxSpi.engineGetSocketFactory();
- }
-
- /**
- * Initializes this context and prepares it for producing socket
- * factories. All of the parameters are optional; default values are
- * used if left unspecified.
- *
- * @param keyManagers The set of key managers to use.
- * @param trustManagers The set of trust managers to use.
- * @param random A source of random bits to use.
- * @throws KeyManagementException If initialization fails.
- */
- public final void init(KeyManager[] keyManagers,
- TrustManager[] trustManagers,
- SecureRandom random)
- throws KeyManagementException
- {
- ctxSpi.engineInit(keyManagers, trustManagers, random);
- }
-}
diff --git a/libjava/javax/net/ssl/SSLContextSpi.java b/libjava/javax/net/ssl/SSLContextSpi.java
deleted file mode 100644
index a6b0c758117..00000000000
--- a/libjava/javax/net/ssl/SSLContextSpi.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* SSLContextSpi.java -- SPI for SSL contexts.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.security.KeyManagementException;
-import java.security.SecureRandom;
-
-/**
- * The <i>Service Provider Interface</i> (<b>SPI</b>) for SSLContext
- * objects.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public abstract class SSLContextSpi
-{
-
- // Constructor.
- // -------------------------------------------------------------------
-
- /**
- * Create a new SSLContextSpi.
- */
- public SSLContextSpi()
- {
- super();
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------
-
- /**
- * Returns the set of SSL sessions available for client connections.
- *
- * @return The set of SSL sessions available for client connections.
- */
- protected abstract SSLSessionContext engineGetClientSessionContext();
-
- /**
- * Returns the set of SSL sessions available for server connections.
- *
- * @return The set of SSL sessions available for server connections.
- */
- protected abstract SSLSessionContext engineGetServerSessionContext();
-
- /**
- * Returns the SSL server socket factory.
- *
- * @return The SSL server socket factory.
- */
- protected abstract SSLServerSocketFactory engineGetServerSocketFactory();
-
- /**
- * Returns the SSL client socket factory.
- *
- * @return The SSL client socket factory.
- */
- protected abstract SSLSocketFactory engineGetSocketFactory();
-
- /**
- * Initialize this context with key and trust managers, and a source
- * of randomness. All of the parameters are optional.
- *
- * @param keyManagers The set of key managers.
- * @param trustManagers The set of trust managers.
- * @param random The source of randomness.
- * @throws KeyManagementException If this context cannot be
- * initialized with these parameters.
- */
- protected abstract void engineInit(KeyManager[] keyManagers,
- TrustManager[] trustManagers,
- SecureRandom random)
- throws KeyManagementException;
-}
diff --git a/libjava/javax/net/ssl/SSLException.java b/libjava/javax/net/ssl/SSLException.java
deleted file mode 100644
index 91d4cb78cbf..00000000000
--- a/libjava/javax/net/ssl/SSLException.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* SSLException.java -- generic SSL exception.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.io.IOException;
-
-/**
- * The superclass of all possible SSL exceptions. Usually, a specific
- * exception is thrown instead of this exception.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public class SSLException extends IOException
-{
-
- // Constructor.
- // ------------------------------------------------------------------
-
- public SSLException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/net/ssl/SSLHandshakeException.java b/libjava/javax/net/ssl/SSLHandshakeException.java
deleted file mode 100644
index 2572d3b53ee..00000000000
--- a/libjava/javax/net/ssl/SSLHandshakeException.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* SSLHandshakeException.java -- exception in SSL handshake.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-/**
- * An exception that signals an error in the SSL handshake phase.
- */
-public class SSLHandshakeException extends SSLException
-{
-
- public SSLHandshakeException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/net/ssl/SSLKeyException.java b/libjava/javax/net/ssl/SSLKeyException.java
deleted file mode 100644
index bab47275dc7..00000000000
--- a/libjava/javax/net/ssl/SSLKeyException.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* SSLKeyException.java -- exception in using a key in SSL.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-/**
- * An exception signaling a problem using a public or private key in
- * an SSL communication.
- */
-public class SSLKeyException extends SSLException
-{
-
- public SSLKeyException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/net/ssl/SSLPeerUnverifiedException.java b/libjava/javax/net/ssl/SSLPeerUnverifiedException.java
deleted file mode 100644
index c53fcdf5a5d..00000000000
--- a/libjava/javax/net/ssl/SSLPeerUnverifiedException.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* SSLPeerUnverifiedException.java -- unverified peer exception.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-/**
- * An exception thrown when the remote peer could not be verified.
- */
-public class SSLPeerUnverifiedException extends SSLException
-{
-
- public SSLPeerUnverifiedException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/net/ssl/SSLPermission.java b/libjava/javax/net/ssl/SSLPermission.java
deleted file mode 100644
index 4b1e2953911..00000000000
--- a/libjava/javax/net/ssl/SSLPermission.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* SSLPermission.java -- SSL permission class.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.security.BasicPermission;
-
-/**
- * A permission used for accessing SSL classes.
- */
-public final class SSLPermission extends BasicPermission
-{
-
- // Constant.
- // -------------------------------------------------------------------------
-
- private static final long serialVersionUID = -3456898025505876775L;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public SSLPermission(String name)
- {
- super(name);
- }
-
- public SSLPermission(String name, String actions)
- {
- super(name, actions);
- }
-}
diff --git a/libjava/javax/net/ssl/SSLProtocolException.java b/libjava/javax/net/ssl/SSLProtocolException.java
deleted file mode 100644
index 5f9f327a3ef..00000000000
--- a/libjava/javax/net/ssl/SSLProtocolException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* SSLProtocolException.java -- exception in SSL protocol.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-/**
- * An exception thrown when a fatal protocol error is encountered. This
- * exception usually indicates some serious problem with the local or
- * remote SSL implementation.
- */
-public class SSLProtocolException extends SSLException
-{
-
- public SSLProtocolException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/net/ssl/SSLServerSocket.java b/libjava/javax/net/ssl/SSLServerSocket.java
deleted file mode 100644
index 5748c0794e5..00000000000
--- a/libjava/javax/net/ssl/SSLServerSocket.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/* SSLServerSocket.java -- a server socket for SSL connections.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.io.IOException;
-
-import java.net.InetAddress;
-import java.net.ServerSocket;
-
-/**
- * A server socket that allows clients to connect via the SSL protocol.
- */
-public abstract class SSLServerSocket extends ServerSocket
-{
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- protected SSLServerSocket() throws IOException
- {
- super();
- //super(0);
- //throw new UnsupportedOperationException("1.4 socket methods not enabled");
- }
-
- protected SSLServerSocket(int port) throws IOException
- {
- super(port);
- }
-
- protected SSLServerSocket(int port, int backlog) throws IOException
- {
- super(port, backlog);
- }
-
- protected SSLServerSocket(int port, int backlog, InetAddress bindAddress)
- throws IOException
- {
- super(port, backlog, bindAddress);
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------------
-
- /**
- * Returns the list of cihper suites that are currently enabled in this
- * server socket. Sockets accepted by this server socket will only have
- * these suites enabled.
- *
- * @return The enabled cipher suites.
- */
- public abstract String[] getEnabledCipherSuites();
-
- /**
- * Sets the list enabled cipher suites.
- *
- * @param suites The cipher suites to enable.
- */
- public abstract void setEnabledCipherSuites(String[] suites);
-
- /**
- * Returns the list of enabled protocols, such as "SSLv3" and "TLSv1".
- *
- * @return The enabled protocols.
- */
- public abstract String[] getEnabledProtocols();
-
- /**
- * Sets the list of enabled protocols.
- *
- * @param protocols The list of protocols to enable.
- */
- public abstract void setEnabledProtocols(String[] protocols);
-
- /**
- * Returns whether or not sessions will be created, i.e., whether or not
- * this server socket will allow SSL session resumption.
- *
- * @return True if sessions will be created.
- */
- public abstract boolean getEnableSessionCreation();
-
- /**
- * Sets whether or not sessions will be created.
- *
- * @param enabled The new enabled value.
- */
- public abstract void setEnableSessionCreation(boolean enabled);
-
- /**
- * Returns whether or not this server socket will require clients to
- * authenticate themselves, such as through a certificate.
- *
- * @return True if clients must authenticate themselves.
- */
- public abstract boolean getNeedClientAuth();
-
- /**
- * Enabled or disables the requirement that clients authenticate themselves.
- * When this is set to <code>true</code>, connections will be rejected if
- * connecting clients do not provide proper authentication.
- *
- * @param needAuth The new need auth value.
- */
- public abstract void setNeedClientAuth(boolean needAuth);
-
- /**
- * Returns whether or not sockets accepted by this server socket will do
- * their handshake as the client-side. The default is false.
- *
- * @return True if client mode will be used.
- */
- public abstract boolean getUseClientMode();
-
- /**
- * Sets whether or not sockets accepted by this server socket will be
- * created in client mode.
- *
- * @param clientMode The new client mode value.
- */
- public abstract void setUseClientMode(boolean clientMode);
-
- /**
- * Returns whether or not this socket will ask for, but not require, that
- * connecting clients authenticate themselves. Clients that do not
- * provide authentication they will still be allowed to connect.
- *
- * @return True if this server socket wants client authentication.
- */
- public abstract boolean getWantClientAuth();
-
- /**
- * Sets whether or not this server socket will want client authentication.
- *
- * @param wantAuth The new want auth value.
- */
- public abstract void setWantClientAuth(boolean wantAuth);
-
- /**
- * Returns a list of cipher suites that this server socket supports.
- *
- * @return The list of supported suites.
- */
- public abstract String[] getSupportedCipherSuites();
-
- /**
- * Returns a list of SSL protocols supported by this server socket.
- *
- * @return The list of supported protocols.
- */
- public abstract String[] getSupportedProtocols();
-}
diff --git a/libjava/javax/net/ssl/SSLServerSocketFactory.java b/libjava/javax/net/ssl/SSLServerSocketFactory.java
deleted file mode 100644
index f02619afae2..00000000000
--- a/libjava/javax/net/ssl/SSLServerSocketFactory.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/* SSLServerSocketFactory.java -- factory for SSL server sockets.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.security.KeyStore;
-import java.security.Security;
-
-import javax.net.ServerSocketFactory;
-
-/**
- * A server socket factory for <i>Secure Socket Layer</i> (<b>SSL</b>)
- * server sockets.
- */
-public abstract class SSLServerSocketFactory extends ServerSocketFactory
-{
- // Field.
- // -------------------------------------------------------------------------
-
- private static SSLContext context;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- protected SSLServerSocketFactory()
- {
- super();
- }
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- /**
- * Returns a default implementation of a SSL server socket factory.
- *
- * <p>To control the class that gets returned by this method, set the
- * security property "ssl.ServerSocketFactory.provider" to the class
- * name of a concrete implementation of this class. If not set, a
- * system-dependent implementation will be used.</p>
- *
- * <p>The implementation returned is created by the first implementation
- * of the {@link SSLContext} class found, which is initialized with
- * default parameters. To control the key and trust manager factory
- * algorithms used as defaults, set the security properties
- * "ssl.keyManagerFactory.algorithm" and "ssl.trustManagerFactory.algorithm"
- * to the appropriate names.</p>
- *
- * <p>Using this method is not recommended. Instead, use the methods of
- * {@link SSLContext}, which provide much better control over the
- * creation of server socket factories.</p>
- *
- * @return The default server socket factory.
- * @throws RuntimeException If no default can be created.
- */
- public static synchronized ServerSocketFactory getDefault()
- {
- try
- {
- String s = Security.getProperty("ssl.ServerSocketFactory.provider");
- ClassLoader cl = ClassLoader.getSystemClassLoader();
- if (s != null && cl != null)
- {
- return (ServerSocketFactory) cl.loadClass(s).newInstance();
- }
- }
- catch (Exception e)
- {
- }
- if (context == null)
- {
- KeyManager[] km = null;
- TrustManager[] tm = null;
-
- // 1. Determine which algorithms to use for the key and trust
- // manager factories.
- String kmAlg = KeyManagerFactory.getDefaultAlgorithm();
- String tmAlg = TrustManagerFactory.getDefaultAlgorithm();
- // 2. Try to initialize the factories with default parameters.
- try
- {
- KeyManagerFactory kmf = KeyManagerFactory.getInstance(kmAlg);
- kmf.init(null, null);
- km = kmf.getKeyManagers();
- }
- catch (Exception ex)
- {
- }
- try
- {
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmAlg);
- tmf.init((KeyStore) null);
- tm = tmf.getTrustManagers();
- }
- catch (Exception ex)
- {
- }
-
- // 3. Create and initialize a context.
- try
- {
- context = SSLContext.getInstance("SSLv3");
- context.init(km, tm, null);
- }
- catch (Exception ex)
- {
- throw new RuntimeException("error instantiating default server socket factory: "
- + ex.toString());
- }
- }
- try
- {
- return context.getServerSocketFactory();
- }
- catch (Exception e)
- {
- }
- throw new RuntimeException("no SSLSocketFactory implementation available");
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------------
-
- /**
- * Returns the list of cipher suites that will be enabled in server sockets
- * created by this factory.
- *
- * @return The default cipher suites.
- */
- public abstract String[] getDefaultCipherSuites();
-
- /**
- * Returns the list of all cipher suites supported by this factory.
- *
- * @return The list of supported cipher suites.
- */
- public abstract String[] getSupportedCipherSuites();
-}
diff --git a/libjava/javax/net/ssl/SSLSession.java b/libjava/javax/net/ssl/SSLSession.java
deleted file mode 100644
index 9400a1a512d..00000000000
--- a/libjava/javax/net/ssl/SSLSession.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/* SSLSession.java -- an SSL session.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.security.cert.Certificate;
-
-import javax.security.cert.X509Certificate;
-
-/**
- * An SSL session is a mechanism through which connections can be established
- * by re-using previously negotiated handshakes.
- */
-public interface SSLSession
-{
- /**
- * Returns this session's cihper suite.
- *
- * @return The cipher suite.
- */
- String getCipherSuite();
-
- /**
- * Returns the time in milliseconds since midnight GMT, 1 January 1970, that
- * this session was created.
- *
- * @return The creation time.
- */
- long getCreationTime();
-
- /**
- * Returns this session's unique identifier, a arbitrary byte array of up
- * to 32 bytes.
- *
- * @return The session identifier.
- */
- byte[] getId();
-
- /**
- * Returns the last time this session was accessed.
- *
- * @return The lest time this session was accessed.
- */
- long getLastAccessedTime();
-
- /**
- * Returns the chain of certificates that the local side used in the
- * handshake, or null if none were used.
- *
- * @return The local certificate chain.
- */
- Certificate[] getLocalCertificates();
-
- /**
- * Returns the chain of certificates that the remote side used in
- * the handshake, or null if none were used.
- *
- * @return The peer's certificate chain.
- * @throws SSLPeerUnverifiedException If the identity of the peer has
- * not been verified.
- */
- Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException;
-
- /**
- * Returns the chain of certificates that the remote side used in
- * the handshake, or null if none were used.
- *
- * @return The peer's certificate chain.
- * @throws SSLPeerUnverifiedException If the identity of the peer has
- * not been verified.
- */
- X509Certificate[] getPeerCertificateChain()
- throws SSLPeerUnverifiedException;
-
- /**
- * Returns the remote host's name.
- *
- * @return The name of the remote host.
- */
- String getPeerHost();
-
- /**
- * Returns the protocol this session uses.
- *
- * @return The protocol.
- */
- String getProtocol();
-
- /**
- * Returns this session's session context object.
- *
- * @return The session context.
- * @throws SecurityException If the caller does not have the
- * {@link SSLPermission} "getSessionContext".
- */
- SSLSessionContext getSessionContext();
-
- /**
- * Returns the names of all values bound to this session.
- *
- * @return The list of bound names.
- */
- String[] getValueNames();
-
- /**
- * Returns the object bound to the given name.
- *
- * @param name The name of the value to get.
- * @return The object bound by that name, or null.
- */
- Object getValue(String name);
-
- /**
- * Invalidates this session, ensuring that it will not be continued by
- * another socket.
- */
- void invalidate();
-
- /**
- * Binds a value to this session, with the given name.
- *
- * @param name The name to bind the object with.
- * @param value The value to bind.
- */
- void putValue(String name, Object value);
-
- /**
- * Un-binds a value.
- *
- * @param name The name of the value to un-bind.
- */
- void removeValue(String name);
-}
diff --git a/libjava/javax/net/ssl/SSLSessionBindingEvent.java b/libjava/javax/net/ssl/SSLSessionBindingEvent.java
deleted file mode 100644
index af26efaa802..00000000000
--- a/libjava/javax/net/ssl/SSLSessionBindingEvent.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* SSLSessionBindingEvent.java -- SSL binding event.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.util.EventObject;
-
-/**
- * An event raised by {@link SSLSession} objects when objects are bound to
- * them.
- */
-public class SSLSessionBindingEvent extends EventObject
-{
-
- // Fields.
- // -------------------------------------------------------------------
-
- private static final long serialVersionUID = 3989172637106345L;
-
- private final String name;
-
- // Constructor.
- // -------------------------------------------------------------------
-
- /**
- * Creates a new binding event.
- *
- * @param session The session being bound to.
- * @param name The name the object was bound under.
- */
- public SSLSessionBindingEvent(SSLSession session, String name)
- {
- super(session);
- this.name = name;
- }
-
- // Instance methods.
- // --------------------------------------------------------------------
-
- /**
- * Returns the name the object was bound under.
- *
- * @return The name.
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Returns the session that the object was bound to.
- *
- * @return The session.
- */
- public SSLSession getSession()
- {
- return (SSLSession) getSource();
- }
-}
diff --git a/libjava/javax/net/ssl/SSLSessionBindingListener.java b/libjava/javax/net/ssl/SSLSessionBindingListener.java
deleted file mode 100644
index 1941ce55308..00000000000
--- a/libjava/javax/net/ssl/SSLSessionBindingListener.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* SSLSessionBindingListener.java -- listener for SSL bindings.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.util.EventListener;
-
-/**
- * An event listener interface that should be notified when it is bound or
- * unbound to a {@link SSLSession}.
- */
-public interface SSLSessionBindingListener extends EventListener
-{
-
- /**
- * This method is called of all objects when they are bound to an SSL
- * session.
- *
- * @param event The binding event.
- */
- void valueBound(SSLSessionBindingEvent event);
-
- /**
- * This method is called of all objects when they are unbound to an SSL
- * session.
- *
- * @param event The binding event.
- */
- void valueUnbound(SSLSessionBindingEvent event);
-}
diff --git a/libjava/javax/net/ssl/SSLSessionContext.java b/libjava/javax/net/ssl/SSLSessionContext.java
deleted file mode 100644
index f9127e781d8..00000000000
--- a/libjava/javax/net/ssl/SSLSessionContext.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* SSLSessionContext.java -- collection of SSL sessions.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.util.Enumeration;
-
-/**
- * A collection of saved SSL sessions, with thier corresponding session
- * IDs.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-public interface SSLSessionContext
-{
-
- /**
- * Returns an enumeration of all saved session IDs. Every element in
- * the returned enumeration is a byte array.
- *
- * @return The session IDs.
- */
- Enumeration getIds();
-
- /**
- * Gets the session specified by its ID, or <code>null</code> if there
- * is no session, or if it has expired.
- *
- * @param sessionId The ID of the session to get.
- * @return The session, or <code>null</code>.
- */
- SSLSession getSession(byte[] sessionId);
-
- /**
- * Returns the maximum number of sessions that may be cached by this
- * session context.
- *
- * @return The maximum number of sessions that may be cached.
- */
- int getSessionCacheSize();
-
- /**
- * Returns the period of time (in seconds) that a session may be cached
- * for before becoming invalid.
- *
- * @return The time a session may be valid.
- */
- int getSessionTimeout();
-
- /**
- * Sets the maximum number of sessions that may be cached by this
- * session context. A cache size of 0 means no limit.
- *
- * @param size The new cache size.
- * @throws IllegalArgumentException If <code>size</code> is negative.
- */
- void setSessionCacheSize(int size);
-
- /**
- * Sets the period of time (in seconds) that a session may be cached
- * for before becoming invalid. A timeout of 0 means that sessions
- * never expire.
- *
- * @param seconds The new timeout.
- * @throws IllegalArgumentException If <code>seconds</code> is negative.
- */
- void setSessionTimeout(int seconds);
-}
diff --git a/libjava/javax/net/ssl/SSLSocket.java b/libjava/javax/net/ssl/SSLSocket.java
deleted file mode 100644
index 32a2b5f1736..00000000000
--- a/libjava/javax/net/ssl/SSLSocket.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/* SSLSocket.java -- an SSL client socket.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.UnknownHostException;
-
-/**
- * A socket that communicates over the secure socket layer protocol.
- */
-public abstract class SSLSocket extends Socket
-{
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- protected SSLSocket()
- {
- super();
- }
-
- protected SSLSocket(String host, int port)
- throws IOException, UnknownHostException
- {
- super(host, port);
- }
-
- protected SSLSocket(InetAddress address, int port) throws IOException
- {
- super(address, port);
- }
-
- protected SSLSocket(String host, int port,
- InetAddress localAddr, int localPort)
- throws IOException, UnknownHostException
- {
- super(host, port, localAddr, localPort);
- }
-
- protected SSLSocket(InetAddress address, int port,
- InetAddress localAddr, int localPort)
- throws IOException
- {
- super(address, port, localAddr, localPort);
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------------
-
- /**
- * Adds a handshake completed listener that wants to be notified when the
- * SSL handshake completes.
- *
- * @param listener The listener to add.
- */
- public abstract void
- addHandshakeCompletedListener(HandshakeCompletedListener listener);
-
- /**
- * Removes a handshake listener from this socket.
- *
- * @param listener The listener to remove.
- */
- public abstract void
- removeHandshakeCompletedListener(HandshakeCompletedListener listener);
-
- /**
- * Returns the list of currently enabled cipher suites.
- *
- * @return The list of enabled cipher suites.
- */
- public abstract String[] getEnabledCipherSuites();
-
- /**
- * Sets the list of enabled cipher suites.
- *
- * @param suites The list of suites to enable.
- */
- public abstract void setEnabledCipherSuites(String[] suites);
-
- /**
- * Returns the list of enabled SSL protocols.
- *
- * @return The list of enabled protocols.
- */
- public abstract String[] getEnabledProtocols();
-
- /**
- * Sets the list of enabled SSL protocols.
- *
- * @param protocols The list of protocols to enable.
- */
- public abstract void setEnabledProtocols(String[] protocols);
-
- /**
- * Returns whether or not sessions will be created by this socket, and thus
- * allow sessions to be continued later.
- *
- * @return Whether or not sessions will be created.
- */
- public abstract boolean getEnableSessionCreation();
-
- /**
- * Sets whether or not sessions will be created by this socket.
- *
- * @param enable The new value.
- */
- public abstract void setEnableSessionCreation(boolean enable);
-
- /**
- * Returns whether or not this socket will require connecting clients to
- * authenticate themselves. This value only applies to sockets in server
- * mode.
- *
- * @return Whether or not this socket requires client authentication.
- */
- public abstract boolean getNeedClientAuth();
-
- /**
- * Sets whether or not this socket will require connecting clients to
- * authenticate themselves. This value only applies to sockets in server
- * mode.
- *
- * @param needAuth The new need auth value.
- */
- public abstract void setNeedClientAuth(boolean needAuth);
-
- /**
- * Returns this socket's session object.
- *
- * @return The session.
- */
- public abstract SSLSession getSession();
-
- /**
- * Returns the list of cipher suites supported by this socket.
- *
- * @return The list of supported cipher suites.
- */
- public abstract String[] getSupportedCipherSuites();
-
- /**
- * Returns the list of protocols supported by this socket.
- *
- * @return The list of supported protocols.
- */
- public abstract String[] getSupportedProtocols();
-
- /**
- * Returns whether or not this socket will connect in client mode.
- *
- * @return True if this is a client socket.
- */
- public abstract boolean getUseClientMode();
-
- /**
- * Sets whether or not this socket will connect in client mode.
- *
- * @param clientMode The new value.
- */
- public abstract void setUseClientMode(boolean clientMode);
-
- /**
- * Returns whether or not this socket will request that connecting clients
- * authenticate themselves. This value only applies to sockets in server
- * mode.
- *
- * @return The want client auth value.
- */
- public abstract boolean getWantClientAuth();
-
- /**
- * Sets whether or not this socket will request that connecting clients
- * authenticate themselves. This value only applies to sockets in server
- * mode.
- *
- * @param wantAuth The new want auth value.
- */
- public abstract void setWantClientAuth(boolean wantAuth);
-
- /**
- * Explicitly begins the handshake, or, if the handshake has already
- * completed, requests that the handshake be repeated.
- *
- * <p>The handshake will begin implicitly when any attempt to read or
- * write to the socket is made.</p>
- *
- * @throws IOException If an I/O or SSL error occurs.
- */
- public abstract void startHandshake() throws IOException;
-}
diff --git a/libjava/javax/net/ssl/SSLSocketFactory.java b/libjava/javax/net/ssl/SSLSocketFactory.java
deleted file mode 100644
index d5d9b6e145a..00000000000
--- a/libjava/javax/net/ssl/SSLSocketFactory.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/* SSLSocketFactory.java -- factory for SSL client sockets.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.security.KeyStore;
-import java.security.Security;
-
-import javax.net.SocketFactory;
-
-/**
- * A socket factory for creating <i>Secure Socket Layer</i> (<b>SSL</b>)
- * sockets.
- */
-public abstract class SSLSocketFactory extends SocketFactory
-{
- // Constants.
- // -------------------------------------------------------------------------
-
- private static SSLContext context;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public SSLSocketFactory()
- {
- super();
- }
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- /**
- * Returns a default implementation of a SSL socket factory.
- *
- * <p>To control the class that gets returned by this method, set the
- * security property "ssl.SocketFactory.provider" to the class
- * name of a concrete implementation of this class. If not set, a
- * system-dependent implementation will be used.</p>
- *
- * <p>The implementation returned is created by the first implementation
- * of the {@link SSLContext} class found, which is initialized with
- * default parameters. To control the key and trust manager factory
- * algorithms used as defaults, set the security properties
- * "ssl.keyManagerFactory.algorithm" and "ssl.trustManagerFactory.algorithm"
- * to the appropriate names.</p>
- *
- * <p>Using this method is not recommended. Instead, use the methods of
- * {@link SSLContext}, which provide much better control over the
- * creation of socket factories.</p>
- *
- * @return The default socket factory.
- * @throws RuntimeException If no default can be created.
- */
- public static synchronized SocketFactory getDefault()
- {
- try
- {
- String s = Security.getProperty("ssl.SocketFactory.provider");
- ClassLoader cl = ClassLoader.getSystemClassLoader();
- if (s != null && cl != null)
- {
- return (SocketFactory) cl.loadClass(s).newInstance();
- }
- }
- catch (Exception e)
- {
- }
- if (context == null)
- {
- KeyManager[] km = null;
- TrustManager[] tm = null;
-
- // 1. Determine which algorithms to use for the key and trust
- // manager factories.
- String kmAlg = KeyManagerFactory.getDefaultAlgorithm();
- String tmAlg = TrustManagerFactory.getDefaultAlgorithm();
-
- // 2. Try to initialize the factories with default parameters.
- try
- {
- KeyManagerFactory kmf = KeyManagerFactory.getInstance(kmAlg);
- kmf.init(null, null);
- km = kmf.getKeyManagers();
- }
- catch (Exception ex)
- {
- }
- try
- {
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmAlg);
- tmf.init((KeyStore) null);
- tm = tmf.getTrustManagers();
- }
- catch (Exception ex)
- {
- }
-
- // 3. Create and initialize a context.
- try
- {
- context = SSLContext.getInstance("SSLv3");
- context.init(km, tm, null);
- }
- catch (Exception ex)
- {
- throw new RuntimeException("error instantiating default socket factory: "
- + ex.toString());
- }
- }
- try
- {
- return context.getSocketFactory();
- }
- catch (Exception e)
- {
- }
- throw new RuntimeException("no SSLSocketFactory implementation available");
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------------
-
- /**
- * Creates a SSL socket wrapped around an existing socket.
- *
- * @param socket The socket to wrap.
- * @param host The host the socket is connected to.
- * @param port The port the socket is connected to.
- * @param autoClose Whether or not the wrapped socket should be closed
- * automatically.
- * @return The new SSL socket.
- * @throws IOException If the socket could not be created.
- */
- public abstract Socket createSocket(Socket socket, String host,
- int port, boolean autoClose)
- throws IOException;
-
- /**
- * Returns the list of cipher suites that will be enabled in sockets
- * created by this factory.
- *
- * @return The default cipher suites.
- */
- public abstract String[] getDefaultCipherSuites();
-
- /**
- * Returns the list of all cipher suites supported by this factory.
- *
- * @return The list of supported cipher suites.
- */
- public abstract String[] getSupportedCipherSuites();
-}
diff --git a/libjava/javax/net/ssl/TrivialHostnameVerifier.java b/libjava/javax/net/ssl/TrivialHostnameVerifier.java
deleted file mode 100644
index abf1a7f22d1..00000000000
--- a/libjava/javax/net/ssl/TrivialHostnameVerifier.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* TrivialHostnameVerifier.java -- non-verifing verifier.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-/**
- * A hostname verifier that always rejects mismatched hostnames.
- */
-class TrivialHostnameVerifier implements HostnameVerifier
-{
-
- public boolean verify(String hostname, SSLSession session)
- {
- return false;
- }
-}
diff --git a/libjava/javax/net/ssl/TrustManager.java b/libjava/javax/net/ssl/TrustManager.java
deleted file mode 100644
index 3bded8b5695..00000000000
--- a/libjava/javax/net/ssl/TrustManager.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* TrustManager.java -- marker interface for trust managers.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-/**
- * A marker interface for classes that establish the trust of remote
- * hosts.
- */
-public interface TrustManager
-{
-}
diff --git a/libjava/javax/net/ssl/TrustManagerFactory.java b/libjava/javax/net/ssl/TrustManagerFactory.java
deleted file mode 100644
index 62ab1c2df05..00000000000
--- a/libjava/javax/net/ssl/TrustManagerFactory.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/* TrustManagerFactory.java -- factory for trust managers.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import gnu.java.security.Engine;
-
-import java.lang.reflect.InvocationTargetException;
-import java.security.AccessController;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.PrivilegedAction;
-import java.security.Provider;
-import java.security.Security;
-
-/**
- * A factory for creating trust manager objects.
- */
-public class TrustManagerFactory
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- /** The service name for trust manager factories. */
- private static final String TRUST_MANAGER_FACTORY = "TrustManagerFactory";
-
- /** The system default trust manager algorithm. */
- private static final String DEFAULT_ALGORITHM = "JessieX509";
-
- /** The underlying engine class. */
- private final TrustManagerFactorySpi tmfSpi;
-
- /** The provider of the engine class. */
- private final Provider provider;
-
- /** The name of this trust manager algorithm. */
- private final String algorithm;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- /**
- * Creates a new trust manager factory.
- *
- * @param tmfSpi The underlying engine class.
- * @param provider The provider of the engine class.
- * @param algorithm The trust manager algorithm name.
- */
- protected TrustManagerFactory(TrustManagerFactorySpi tmfSpi,
- Provider provider, String algorithm)
- {
- this.tmfSpi = tmfSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- }
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- /**
- * Returns an instance of a trust manager factory for the given algorithm
- * from the first provider that implements it.
- *
- * @param algorithm The name of the algorithm to get.
- * @return The instance of the trust manager factory.
- * @throws NoSuchAlgorithmException If no provider implements the given
- * algorithm.
- */
- public static final TrustManagerFactory getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- Provider[] provs = Security.getProviders();
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException ignore)
- {
- }
- }
- throw new NoSuchAlgorithmException(algorithm);
- }
-
- /**
- * Returns an instance of a trust manager factory for the given algorithm
- * from the named provider.
- *
- * @param algorithm The name of the algorithm to get.
- * @param provider The name of the provider to get the instance from.
- * @return The instance of the trust manager factory.
- * @throws NoSuchAlgorithmException If the provider does not implement the
- * given algorithm.
- * @throws NoSuchProviderException If there is no such named provider.
- * @throws IllegalArgumentException If the provider argument is null.
- */
- public static final TrustManagerFactory getInstance(String algorithm,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- if (provider == null)
- {
- throw new IllegalArgumentException();
- }
- Provider p = Security.getProvider(provider);
- if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
- return getInstance(algorithm, p);
- }
-
- /**
- * Returns an instance of a trust manager factory for the given algorithm
- * from the specified provider.
- *
- * @param algorithm The name of the algorithm to get.
- * @param provider The provider to get the instance from.
- * @return The instance of the trust manager factory.
- * @throws NoSuchAlgorithmException If the provider does not implement the
- * given algorithm.
- * @throws IllegalArgumentException If the provider argument is null.
- */
- public static final TrustManagerFactory getInstance(String algorithm,
- Provider provider)
- throws NoSuchAlgorithmException
- {
- if (provider == null)
- {
- throw new IllegalArgumentException();
- }
- try
- {
- return new TrustManagerFactory((TrustManagerFactorySpi)
- Engine.getInstance(TRUST_MANAGER_FACTORY, algorithm, provider),
- provider, algorithm);
- }
- catch (InvocationTargetException ite)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- catch (ClassCastException cce)
- {
- throw new NoSuchAlgorithmException(algorithm);
- }
- }
-
- /**
- * Returns the default algorithm for trust manager factories. The value
- * returned is either the value of the security property
- * "ssl.TrustManagerFactory.algorithm" if it is set, or the value "JessieX509"
- * if not.
- *
- * @return The default algorithm name.
- * @see Security.getProperty(java.lang.String)
- */
- public static final String getDefaultAlgorithm()
- {
- String alg = null;
- try
- {
- alg = (String) AccessController.doPrivileged(
- new PrivilegedAction()
- {
- public Object run()
- {
- return Security.getProperty("ssl.TrustManagerFactory.algorithm");
- }
- }
- );
- }
- catch (SecurityException se)
- {
- }
- if (alg == null)
- alg = DEFAULT_ALGORITHM;
- return alg;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- /**
- * Returns the name of this trust manager algorithm.
- *
- * @return The algorithm name.
- */
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- /**
- * Returns the provider of the underlying implementation.
- *
- * @return The provider.
- */
- public final Provider getProvider()
- {
- return provider;
- }
-
- /**
- * Returns the trust managers created by this factory.
- *
- * @return The trust managers.
- */
- public final TrustManager[] getTrustManagers()
- {
- return tmfSpi.engineGetTrustManagers();
- }
-
- /**
- * Initialize this instance with some algorithm-specific parameters.
- *
- * @param params The parameters.
- * @throws InvalidAlgorithmParameterException If the supplied parameters
- * are inappropriate for this instance.
- */
- public final void init(ManagerFactoryParameters params)
- throws InvalidAlgorithmParameterException
- {
- tmfSpi.engineInit(params);
- }
-
- /**
- * Initialize this instance with a key store. The key store may be null,
- * in which case a default will be used.
- *
- * @param store The key store.
- * @throws KeyStoreException If there is a problem reading from the
- * key store.
- */
- public final void init(KeyStore store) throws KeyStoreException
- {
- tmfSpi.engineInit(store);
- }
-}
diff --git a/libjava/javax/net/ssl/TrustManagerFactorySpi.java b/libjava/javax/net/ssl/TrustManagerFactorySpi.java
deleted file mode 100644
index 3706674d421..00000000000
--- a/libjava/javax/net/ssl/TrustManagerFactorySpi.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* TrustManagerFactorySpi.java -- SPI for trust manager factories.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-
-/**
- * The <i>service provider interface</i> (<b>SPI</b>) for trust managers.
- */
-public abstract class TrustManagerFactorySpi
-{
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public TrustManagerFactorySpi()
- {
- super();
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------------
-
- /**
- * Engine method that returns the trust managers created by this factory.
- *
- * @return The trust managers.
- */
- protected abstract TrustManager[] engineGetTrustManagers();
-
- /**
- * Engine method that initializes this factory with some algorithm-specific
- * parameters.
- *
- * @param params The parameters.
- * @throws InvalidAlgorithmParameterException If the given parameters are
- * inappropriate.
- */
- protected abstract void engineInit(ManagerFactoryParameters params)
- throws InvalidAlgorithmParameterException;
-
- /**
- * Engine method that initializes this factory with a key store. The key
- * store parameter may be null, in which case some default should be used.
- *
- * @param store The key store.
- * @throws KeyStoreException If a problem occurs reading from the key store.
- */
- protected abstract void engineInit(KeyStore store) throws KeyStoreException;
-}
diff --git a/libjava/javax/net/ssl/X509KeyManager.java b/libjava/javax/net/ssl/X509KeyManager.java
deleted file mode 100644
index 6fb6b40bc88..00000000000
--- a/libjava/javax/net/ssl/X509KeyManager.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/* X509KeyManager.java -- X.509 key manager interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.net.Socket;
-
-import java.security.Principal;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-
-/**
- * A key manager for X.509 certificates and their associated private keys.
- */
-public interface X509KeyManager extends KeyManager
-{
-
- /**
- * Choose an alias for client-side authentication.
- *
- * @param keyTypes A list of acceptable key types.
- * @param issuers A list of acceptable certificate issuers.
- * @param socket The connecting socket.
- * @return The chosen alias.
- */
- String chooseClientAlias(String[] keyTypes, Principal[] issuers,
- Socket socket);
-
- /**
- * Choose an alias for server-side authentication.
- *
- * @param keyType The desired certificate type.
- * @param issuers A list of acceptable certificate issuers.
- * @param socket The connecting socket.
- * @return The chosen alias.
- */
- String chooseServerAlias(String keyType, Principal[] issuers,
- Socket socket);
-
- /**
- * Gets the X.509 certificate chain associated with the given alias.
- *
- * @param alias The alias.
- * @return The certificate chain.
- */
- X509Certificate[] getCertificateChain(String alias);
-
- /**
- * Returns all client aliases that support the given key type.
- *
- * @param keyType The desired key type.
- * @param issuers A list of acceptable certificate issuers.
- * @return The (possibly empty) list of aliases.
- */
- String[] getClientAliases(String keyType, Principal[] issuers);
-
- /**
- * Gets the private key associated with the given alias.
- *
- * @param alias The alias.
- * @return The private key.
- */
- PrivateKey getPrivateKey(String alias);
-
- /**
- * Returns all server aliases that support the given key type.
- *
- * @param keyType The desired key type.
- * @param issuers A list of acceptable certificate issuers.
- * @return The (possibly empty) list of aliases.
- */
- String[] getServerAliases(String keyType, Principal[] issuers);
-}
diff --git a/libjava/javax/net/ssl/X509TrustManager.java b/libjava/javax/net/ssl/X509TrustManager.java
deleted file mode 100644
index 97daaf04607..00000000000
--- a/libjava/javax/net/ssl/X509TrustManager.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* X509TrustManager.java -- X.509 trust manager interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.net.ssl;
-
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-/**
- * A trust manager for dealing with X.509 certificates.
- */
-public interface X509TrustManager extends TrustManager
-{
-
- /**
- * Checks if a certificate chain sent by the client is trusted.
- *
- * @param chain The certificate chain to check.
- * @param authType The authentication type.
- * @throws CertificateException If the client's certificates are not trusted.
- */
- void checkClientTrusted(X509Certificate[] chain, String authType)
- throws CertificateException;
-
- /**
- * Checks if a certificate chain sent by the server is trusted.
- *
- * @param chain The certificate chain to check.
- * @param authType The authentication type.
- * @throws CertificateException If the server's certificates are not trusted.
- */
- void checkServerTrusted(X509Certificate[] chain, String authType)
- throws CertificateException;
-
- /**
- * Returns the list of trusted issuer certificates currently in use.
- *
- * @return The list of trusted issuer certificates.
- */
- X509Certificate[] getAcceptedIssuers();
-}
diff --git a/libjava/javax/print/AttributeException.java b/libjava/javax/print/AttributeException.java
deleted file mode 100644
index d22c5bfab59..00000000000
--- a/libjava/javax/print/AttributeException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* CancelablePrintJob.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-import javax.print.attribute.Attribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface AttributeException
-{
- /**
- * Returns the unsupported printing attribute classes for a print service
- * that does not support them.
- *
- * @return array of unsupported attribute classes, or null
- */
- Class[] getUnsupportedAttributes();
-
- /**
- * Returns the unsupported values of printing attributes for a print service
- * that does not support them.
- *
- * @return array of unsupperted attribute values, or null
- */
- Attribute[] getUnsupportedValues();
-}
diff --git a/libjava/javax/print/CancelablePrintJob.java b/libjava/javax/print/CancelablePrintJob.java
deleted file mode 100644
index 94e9475e587..00000000000
--- a/libjava/javax/print/CancelablePrintJob.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* CancelablePrintJob.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface CancelablePrintJob extends DocPrintJob
-{
- /**
- * Cancel print job.
- *
- * @exception PrintException if an error occured
- */
- void cancel() throws PrintException;
-}
diff --git a/libjava/javax/print/Doc.java b/libjava/javax/print/Doc.java
deleted file mode 100644
index 2f4c468a0c7..00000000000
--- a/libjava/javax/print/Doc.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Doc.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.print.attribute.DocAttributeSet;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface Doc
-{
- /**
- * Returns a set of attributes applying to this document.
- *
- * @return the attributes
- */
- DocAttributeSet getAttributes();
-
- /**
- * Returns the flavor in which this document will provide its print data.
- *
- * @return the document flavor for printing
- */
- DocFlavor getDocFlavor();
-
- /**
- * Returns the print data of this document represented in a format that supports
- * the document flavor.
- *
- * @return the print data
- *
- * @throws IOException if an error occurs
- */
- Object getPrintData() throws IOException;
-
- /**
- * Returns a <code>Reader</code> object for extracting character print data
- * from this document.
- *
- * @return the <code>Reader</code> object
- *
- * @throws IOException if an error occurs
- */
- Reader getReaderForText() throws IOException;
-
- /**
- * Returns an <code>InputStream</code> object for extracting byte print data
- * from this document.
- *
- * @return the <code>InputStream</code> object
- *
- * @throws IOException if an error occurs
- */
- InputStream getStreamForBytes() throws IOException;
-}
diff --git a/libjava/javax/print/DocFlavor.java b/libjava/javax/print/DocFlavor.java
deleted file mode 100644
index 732823fbeb2..00000000000
--- a/libjava/javax/print/DocFlavor.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/* DocFlavor.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class DocFlavor implements Cloneable, Serializable
-{
- /**
- * @author Michael Koch (konqueror@gmx.de)
- */
- public static class BYTE_ARRAY
- extends DocFlavor
- {
- public static final BYTE_ARRAY AUTOSENSE = new BYTE_ARRAY("application/octet-stream");
- public static final BYTE_ARRAY GIF = new BYTE_ARRAY("image/gif");
- public static final BYTE_ARRAY JPEG = new BYTE_ARRAY("image/jpeg");
- public static final BYTE_ARRAY PCL = new BYTE_ARRAY("application/vnd.hp-PCL");
- public static final BYTE_ARRAY PDF = new BYTE_ARRAY("application/pdf");
- public static final BYTE_ARRAY PNG = new BYTE_ARRAY("image/png");
- public static final BYTE_ARRAY POSTSCRIPT = new BYTE_ARRAY("application/postscript");
- public static final BYTE_ARRAY TEXT_HTML_HOST = new BYTE_ARRAY("text/html");
- public static final BYTE_ARRAY TEXT_HTML_US_ASCII = new BYTE_ARRAY("text/html; charset=us-ascii");
- public static final BYTE_ARRAY TEXT_HTML_UTF_16 = new BYTE_ARRAY("text/html; charset=utf-16");
- public static final BYTE_ARRAY TEXT_HTML_UTF_16BE = new BYTE_ARRAY("text/html; charset=utf-16be");
- public static final BYTE_ARRAY TEXT_HTML_UTF_16LE = new BYTE_ARRAY("text/html; charset=utf-16le");
- public static final BYTE_ARRAY TEXT_HTML_UTF_8 = new BYTE_ARRAY("text/html; charset=utf-8");
- public static final BYTE_ARRAY TEXT_PLAIN_HOST = new BYTE_ARRAY("text/plain");
- public static final BYTE_ARRAY TEXT_PLAIN_US_ASCII = new BYTE_ARRAY("text/plain; charset=us-ascii");
- public static final BYTE_ARRAY TEXT_PLAIN_UTF_16 = new BYTE_ARRAY("text/plain; charset=utf-16");
- public static final BYTE_ARRAY TEXT_PLAIN_UTF_16BE = new BYTE_ARRAY("text/plain; charset=utf-16be");
- public static final BYTE_ARRAY TEXT_PLAIN_UTF_16LE = new BYTE_ARRAY("text/plain; charset=utf-16le");
- public static final BYTE_ARRAY TEXT_PLAIN_UTF_8 = new BYTE_ARRAY("text/plain; charset=utf-8");
-
- public BYTE_ARRAY(String mimeType)
- {
- super(mimeType, "[B");
- }
- }
-
- /**
- * @author Michael Koch (konqueror@gmx.de)
- */
- public static class CHAR_ARRAY
- extends DocFlavor
- {
- private static final long serialVersionUID = -8720590903724405128L;
-
- public static final DocFlavor.CHAR_ARRAY TEXT_HTML = new CHAR_ARRAY("text/html; charset=utf-16");
- public static final DocFlavor.CHAR_ARRAY TEXT_PLAIN = new CHAR_ARRAY("text/plain; charset=utf-16");
-
- public CHAR_ARRAY(String mimeType)
- {
- super(mimeType, "[C");
- }
- }
-
- /**
- * @author Michael Koch (konqueror@gmx.de)
- */
- public static class INPUT_STREAM
- extends DocFlavor
- {
- public static final INPUT_STREAM AUTOSENSE = new INPUT_STREAM("application/octet-stream");
- public static final INPUT_STREAM GIF = new INPUT_STREAM("image/gif");
- public static final INPUT_STREAM JPEG = new INPUT_STREAM("image/jpeg");
- public static final INPUT_STREAM PCL = new INPUT_STREAM("application/vnd.hp-PCL");
- public static final INPUT_STREAM PDF = new INPUT_STREAM("application/pdf");
- public static final INPUT_STREAM PNG = new INPUT_STREAM("image/png");
- public static final INPUT_STREAM POSTSCRIPT = new INPUT_STREAM("application/postscript");
- public static final INPUT_STREAM TEXT_HTML_HOST = new INPUT_STREAM("text/html");
- public static final INPUT_STREAM TEXT_HTML_US_ASCII = new INPUT_STREAM("text/html; charset=us-ascii");
- public static final INPUT_STREAM TEXT_HTML_UTF_16 = new INPUT_STREAM("text/html; charset=utf-16");
- public static final INPUT_STREAM TEXT_HTML_UTF_16BE = new INPUT_STREAM("text/html; charset=utf-16be");
- public static final INPUT_STREAM TEXT_HTML_UTF_16LE = new INPUT_STREAM("text/html; charset=utf-16le");
- public static final INPUT_STREAM TEXT_HTML_UTF_8 = new INPUT_STREAM("text/html; charset=utf-8");
- public static final INPUT_STREAM TEXT_PLAIN_HOST = new INPUT_STREAM("text/plain");
- public static final INPUT_STREAM TEXT_PLAIN_US_ASCII = new INPUT_STREAM("text/plain; charset=us-ascii");
- public static final INPUT_STREAM TEXT_PLAIN_UTF_16 = new INPUT_STREAM("text/plain; charset=utf-16");
- public static final INPUT_STREAM TEXT_PLAIN_UTF_16BE = new INPUT_STREAM("text/plain; charset=utf-16be");
- public static final INPUT_STREAM TEXT_PLAIN_UTF_16LE = new INPUT_STREAM("text/plain; charset=utf-16le");
- public static final INPUT_STREAM TEXT_PLAIN_UTF_8 = new INPUT_STREAM("text/plain; charset=utf-8");
-
- public INPUT_STREAM(String mimeType)
- {
- super(mimeType, "java.io.InputStream");
- }
- }
-
- /**
- * @author Michael Koch (konqueror@gmx.de)
- */
- public static class READER
- extends DocFlavor
- {
- private static final long serialVersionUID = 7100295812579351567L;
-
- public static final DocFlavor.READER TEXT_HTML = new READER("text/html; charset=utf-16");
- public static final DocFlavor.READER TEXT_PLAIN = new READER("text/plain; charset=utf-16");
-
- public READER(String mimeType)
- {
- super(mimeType, "java.io.Reader");
- }
- }
-
- /**
- * @author Michael Koch (konqueror@gmx.de)
- */
- public static class SERVICE_FORMATTED
- extends DocFlavor
- {
- private static final long serialVersionUID = 6181337766266637256L;
-
- public static final DocFlavor.SERVICE_FORMATTED PAGEABLE = new SERVICE_FORMATTED("java.awt.print.Pageable");
- public static final DocFlavor.SERVICE_FORMATTED PRINTABLE = new SERVICE_FORMATTED("java.awt.print.Printable");
- public static final DocFlavor.SERVICE_FORMATTED RENDERABLE_IMAGE = new SERVICE_FORMATTED("java.awt.image.renderable.RenderableImage");
-
- public SERVICE_FORMATTED(String className)
- {
- super("application/x-java-jvm-local-objectref", className);
- }
- }
-
- /**
- * @author Michael Koch (konqueror@gmx.de)
- */
- public static class STRING
- extends DocFlavor
- {
- private static final long serialVersionUID = 4414407504887034035L;
-
- public static final DocFlavor.STRING TEXT_HTML = new STRING("text/html; charset=utf-16");
- public static final DocFlavor.STRING TEXT_PLAIN = new STRING("text/plain; charset=utf-16");
-
- public STRING(String mimeType)
- {
- super(mimeType, "java.lang.String");
- }
- }
-
- /**
- * @author Michael Koch (konqueror@gmx.de)
- */
- public static class URL
- extends DocFlavor
- {
- private static final long serialVersionUID = 2936725788144902062L;
-
- public static final DocFlavor.URL AUTOSENSE = new URL("application/octet-stream");
- public static final DocFlavor.URL GIF = new URL("image/gif");
- public static final DocFlavor.URL JPEG = new URL("image/jpeg");
- public static final DocFlavor.URL PCL = new URL("application/vnd.hp-PCL");
- public static final DocFlavor.URL PDF = new URL("application/pdf");
- public static final DocFlavor.URL PNG = new URL("image/png");
- public static final DocFlavor.URL POSTSCRIPT = new URL("application/postscript");
- public static final DocFlavor.URL TEXT_HTML_HOST = new URL("text/html");
- public static final DocFlavor.URL TEXT_HTML_US_ASCII = new URL("text/html; charset=us-ascii");
- public static final DocFlavor.URL TEXT_HTML_UTF_16 = new URL("text/html; charset=utf-16");
- public static final DocFlavor.URL TEXT_HTML_UTF_16BE = new URL("text/html; charset=utf-16be");
- public static final DocFlavor.URL TEXT_HTML_UTF_16LE = new URL("text/html; charset=utf-16le");
- public static final DocFlavor.URL TEXT_HTML_UTF_8 = new URL("text/html; charset=utf-8");
- public static final DocFlavor.URL TEXT_PLAIN_HOST = new URL("text/plain");
- public static final DocFlavor.URL TEXT_PLAIN_US_ASCII = new URL("text/plain; charset=us-ascii");
- public static final DocFlavor.URL TEXT_PLAIN_UTF_16 = new URL("text/plain; charset=utf-16");
- public static final DocFlavor.URL TEXT_PLAIN_UTF_16BE = new URL("text/plain; charset=utf-16be");
- public static final DocFlavor.URL TEXT_PLAIN_UTF_16LE = new URL("text/plain; charset=utf-16le");
- public static final DocFlavor.URL TEXT_PLAIN_UTF_8 = new URL("text/plain; charset=utf-8");
-
- public URL(String mimeType)
- {
- super(mimeType, "java.net.URL");
- }
- }
-
- private static final long serialVersionUID = -4512080796965449721L;
-
- // FIXME: Get the host encoding from somewhere. Note that the new String is to make
- // sure the field won't be a compile time constant.
- public static final String hostEncoding = new String("US-ASCII");
-
- private String mediaSubtype;
- private String mediaType;
- private String className;
- private HashMap params = new HashMap();
-
- public DocFlavor(String mimeType, String className)
- {
- if (mimeType == null || className == null)
- throw new NullPointerException();
-
- parseMimeType(mimeType);
- this.className = className;
- }
-
- private void parseMimeType(String mimeType)
- {
- // FIXME: This method is know to be not completely correct, but it works for now.
-
- int pos = mimeType.indexOf(';');
-
- if (pos != -1)
- {
- String tmp = mimeType.substring(pos + 2);
- mimeType = mimeType.substring(0, pos);
- pos = tmp.indexOf('=');
- params.put(tmp.substring(0, pos), tmp.substring(pos + 1));
- }
-
- pos = mimeType.indexOf('/');
-
- if (pos == -1)
- throw new IllegalArgumentException();
-
- mediaType = mimeType.substring(0, pos);
- mediaSubtype = mimeType.substring(pos + 1);
- }
-
- public boolean equals(Object obj)
- {
- if (! (obj instanceof DocFlavor))
- return false;
-
- DocFlavor tmp = (DocFlavor) obj;
-
- return (getMimeType().equals(tmp.getMimeType())
- && getRepresentationClassName().equals(tmp.getRepresentationClassName()));
- }
-
- public String getMediaSubtype()
- {
- return mediaSubtype;
- }
-
- public String getMediaType()
- {
- return mediaType;
- }
-
- public String getMimeType()
- {
- // FIXME: Check if this algorithm is correct.
-
- String mimeType = getMediaType() + "/" + getMediaSubtype();
- Iterator it = params.entrySet().iterator();
-
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry) it.next();
- mimeType += "; " + entry.getKey() + "=\"" + entry.getValue() + "\"";
- }
-
- return mimeType;
- }
-
- public String getParameter(String paramName)
- {
- if (paramName == null)
- throw new NullPointerException();
-
- return (String) params.get(paramName);
- }
-
- public String getRepresentationClassName()
- {
- return className;
- }
-
- public int hashCode()
- {
- return ((mediaType.hashCode()
- * mediaSubtype.hashCode()
- * className.hashCode()) ^ params.hashCode());
- }
-
- public String toString()
- {
- return getMimeType();
- }
-}
diff --git a/libjava/javax/print/DocPrintJob.java b/libjava/javax/print/DocPrintJob.java
deleted file mode 100644
index 8172b8b09b4..00000000000
--- a/libjava/javax/print/DocPrintJob.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* DocPrintJob.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-import javax.print.attribute.PrintJobAttributeSet;
-import javax.print.attribute.PrintRequestAttributeSet;
-import javax.print.event.PrintJobAttributeListener;
-import javax.print.event.PrintJobListener;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface DocPrintJob
-{
- /**
- * Registers a listener for changes in the specified attributes.
- *
- * @param listener the listener to add
- * @param attributes the attributes to observe
- */
- void addPrintJobAttributeListener(PrintJobAttributeListener listener,
- PrintJobAttributeSet attributes);
-
- /**
- * Registers a listener for events occuring during this print job.
- *
- * @param listener the listener to add
- */
- void addPrintJobListener(PrintJobListener listener);
-
- /**
- * Returns the print job's attributes.
- *
- * @return the attributes of this print job
- */
- PrintJobAttributeSet getAttributes();
-
- /**
- * Returns the <code>PrintService</code> object this print job is bound to.
- *
- * @return the print service
- */
- PrintService getPrintService();
-
- /**
- * Prints a document with the specified print job attributes.
- *
- * @param doc the document to print
- * @param attributes the attributes to use
- *
- * @throws PrintException if an error occurs
- */
- void print(Doc doc, PrintRequestAttributeSet attributes) throws PrintException;
-
- /**
- * De-registers an attribute listener.
- *
- * @param listener the listener to remove
- */
- void removePrintJobAttributeListener(PrintJobAttributeListener listener);
-
- /**
- * De-registers a print job listener.
- *
- * @param listener the listener to remove
- */
- void removePrintJobListener(PrintJobListener listener);
-}
diff --git a/libjava/javax/print/FlavorException.java b/libjava/javax/print/FlavorException.java
deleted file mode 100644
index 30c002da679..00000000000
--- a/libjava/javax/print/FlavorException.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* FlavorException.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface FlavorException
-{
- /**
- * Returns the unsupported document flavors.
- *
- * @return the unsupported document flavors
- */
- DocFlavor[] getUnsupportedFlavors();
-}
diff --git a/libjava/javax/print/MultiDoc.java b/libjava/javax/print/MultiDoc.java
deleted file mode 100644
index 54fe90d9ccc..00000000000
--- a/libjava/javax/print/MultiDoc.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* MultiDoc.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-import java.io.IOException;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface MultiDoc
-{
- /**
- * Returns the current document.
- *
- * @return the current document
- *
- * @throws IOException if an error occurs
- */
- Doc getDoc() throws IOException;
-
- /**
- * Returns the next <code>MultiDoc</code> object.
- *
- * @return the next <code>MultiDoc</code> object
- *
- * @throws IOException if an error occurs
- */
- MultiDoc next() throws IOException;
-}
diff --git a/libjava/javax/print/MultiDocPrintJob.java b/libjava/javax/print/MultiDocPrintJob.java
deleted file mode 100644
index 5a8da43c0b0..00000000000
--- a/libjava/javax/print/MultiDocPrintJob.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* MultiDocPrintJob.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-import javax.print.attribute.PrintRequestAttributeSet;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface MultiDocPrintJob extends DocPrintJob
-{
- /**
- * Request a print of a <code>MultiDoc</code> object.
- *
- * @param multiDoc the document to print
- * @param attributes the printing attributes to apply
- *
- * @throws PrintExeption if an error occurs
- */
- void print(MultiDoc multiDoc, PrintRequestAttributeSet attributes)
- throws PrintException;
-}
-
diff --git a/libjava/javax/print/MultiDocPrintService.java b/libjava/javax/print/MultiDocPrintService.java
deleted file mode 100644
index ab6acf9f79b..00000000000
--- a/libjava/javax/print/MultiDocPrintService.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* MultiDocPrintService.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface MultiDocPrintService extends PrintService
-{
- /**
- * Create a job that can print a <code>MultiDoc</code> object.
- *
- * @return the new print job
- */
- MultiDocPrintJob createMultiDocPrintJob();
-}
diff --git a/libjava/javax/print/PrintException.java b/libjava/javax/print/PrintException.java
deleted file mode 100644
index b471e0a19fd..00000000000
--- a/libjava/javax/print/PrintException.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* PrintException.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class PrintException extends Exception
-{
- /**
- * Construct a print exception.
- */
- public PrintException()
- {
- super();
- }
-
- /**
- * Construct a print exception.
- *
- * @param e chained exception
- */
- public PrintException(Exception e)
- {
- super(e);
- }
-
- /**
- * Construct a print exception.
- *
- * @param s detailed message, or null for no message
- */
- public PrintException(String s)
- {
- super(s);
- }
-
- /**
- * Construct a print exception.
- *
- * @param s detailed message, or null for no message
- * @param e chained exception
- */
- public PrintException(String s, Exception e)
- {
- super(s, e);
- }
-}
diff --git a/libjava/javax/print/PrintService.java b/libjava/javax/print/PrintService.java
deleted file mode 100644
index d34fde843f0..00000000000
--- a/libjava/javax/print/PrintService.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/* PrintService.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-import javax.print.attribute.Attribute;
-import javax.print.attribute.AttributeSet;
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.PrintServiceAttributeSet;
-import javax.print.event.PrintServiceAttributeListener;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface PrintService
-{
- /**
- * Returns a new print job capable to handle all supported document flavors.
- *
- * @return the new print job
- */
- DocPrintJob createPrintJob();
-
- /**
- * Determines if two services refer to the same underlying service.
- *
- * @param obj the service to check against
- *
- * @return <code>true</code> if both services refer to the sam underlying
- * service, <code>false</code> otherwise
- */
- boolean equals(Object obj);
-
- /**
- * Returns the value of a single specified attribute.
- *
- * @param category the category of a <code>PrintServiceAttribute</code>
- *
- * @return the value of the attribute
- *
- * @throws NullPointerException if category is null
- * @throws IllegalArgumentException if category is not a class that
- * implements <code>PrintServiceAttribute</code>
- */
- PrintServiceAttribute getAttribute(Class category);
-
- /**
- * Returns all attributes of this printer service
- *
- * @return all attributes of this print service
- */
- PrintServiceAttributeSet getAttributes();
-
- /**
- * Returns the service's default value for a given attribute.
- *
- * @param category the category of the attribute
- *
- * @return the default value
- *
- * @throws NullPointerException if <code>category</code> is null
- * @throws IllegalArgumentException if <code>category</code> is a class
- * not implementing <code>Attribute</code>
- */
- Object getDefaultAttributeValue(Class category);
-
- /**
- * Returns the name of this print service.
- *
- * @return the name
- */
- String getName();
-
- /**
- * Returns a factory for UI components.
- *
- * @return the factory
- */
- ServiceUIFactory getServiceUIFactory();
-
- /**
- * Returns all supported attribute categories.
- *
- * @return an array of all supported attribute categories
- */
- Class[] getSupportedAttributeCategories();
-
- /**
- * Returns all supported attribute values a client can use when setting up
- * a print job with this service.
- *
- * @param category the attribute category to test
- * @param flavor the document flavor to use, or null
- * @param attributes set of printing attributes for a supposed job, or null
- *
- * @return object indicating supported values for <code>category</code>,
- * or null if this print service doesnt support specifying doc-level or
- * job-level attribute in a print request.
- *
- * @throws NullPointerException if <code>category</code> is null
- * @throws IllegalArgumentException if <code>category</code> is a class not
- * implementing <code>Attribute</code>, or if <code>flavor</code> is not
- * supported
- */
- Object getSupportedAttributeValues(Class category, DocFlavor flavor, AttributeSet attributes);
-
- /**
- * Returns an array of all supproted document flavors.
- *
- * @return the supported document flavors
- */
- DocFlavor[] getSupportedDocFlavors();
-
- /**
- * Returns all attributes that are unsupported for a print request in the
- * context of a particular document flavor.
- *
- * @param flavor document flavor to test, or null
- * @param attributes set of printing attributes for a supposed job
- *
- * @return null if this <code>PrintService</code> supports the print request
- * specification, else the unsupported attributes
- *
- * @throws IllegalArgumentException if <code>flavor</code> is unsupported
- */
- AttributeSet getUnsupportedAttributes(DocFlavor flavor, AttributeSet attributes);
-
- /**
- * Returns a hashcode for this printer service.
- *
- * @return the hashcode
- */
- int hashCode();
-
- /**
- * Determines a given attribute category is supported or not.
- *
- * @param category the category to check
- *
- * @return <code>true</code> if <code>category</code> is supported,
- * <code>false</code> otherwise
- *
- * @throws NullPointerException if <code>category</code> is null
- * @throws IllegalArgumentException if <code>category</code> is a class not
- * implementing <code>Attribute</code>.
- */
- boolean isAttributeCategorySupported(Class category);
-
- /**
- * Determines a given attribute value is supported when creating a print job
- * for this print service.
- *
- * @param attrval the attribute value to check
- * @param flavor the document flavor to use, or null
- * @param attributes set of printing attributes to use, or null
- *
- * @return <code>true</code> if the attribute value is supported,
- * <code>false</code> otherwise
- *
- * @throws NullPointerException if <code>attrval</code> is null
- * @throws IllegalArgumentException if <code>flavor</code> is not supported
- * by this print service
- */
- boolean isAttributeValueSupported(Attribute attrval, DocFlavor flavor, AttributeSet attributes);
-
- /**
- * Determines a given document flavor is supported or not.
- *
- * @param flavor the document flavor to check
- *
- * @return <code>true</code> if <code>flavor</code> is supported,
- * <code>false</code> otherwise
- *
- * @throws NullPointerException if <code>flavor</code> is null
- */
- boolean isDocFlavorSupported(DocFlavor flavor);
-
- /**
- * Registers a print service attribute listener to this print service.
- *
- * @param listener the listener to add
- */
- void addPrintServiceAttributeListener(PrintServiceAttributeListener listener);
-
- /**
- * De-registers a print service attribute listener from this print service.
- *
- * @param listener the listener to remove
- */
- void removePrintServiceAttributeListener(PrintServiceAttributeListener listener);
-}
diff --git a/libjava/javax/print/PrintServiceLookup.java b/libjava/javax/print/PrintServiceLookup.java
deleted file mode 100644
index 2add8d1a6f7..00000000000
--- a/libjava/javax/print/PrintServiceLookup.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* PrintServiceLookup.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-import javax.print.attribute.AttributeSet;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class PrintServiceLookup
-{
- /**
- * Constructs a <code>PrintServiceLookup</code> object.
- */
- public PrintServiceLookup()
- {
- // Do nothing here
- }
-
- /**
- * Not called direclty by applications.
- */
- public abstract PrintService getDefaultPrintService();
-
- /**
- * Not called direclty by applications.
- */
- public abstract MultiDocPrintService[] getMultiDocPrintServices(DocFlavor[] flavors, AttributeSet attributes);
-
- /**
- * Not called direclty by applications.
- */
- public abstract PrintService[] getPrintServices();
-
- /**
- * Not called direclty by applications.
- */
- public abstract PrintService[] getPrintServices(DocFlavor flavor, AttributeSet attributes);
-}
diff --git a/libjava/javax/print/ServiceUIFactory.java b/libjava/javax/print/ServiceUIFactory.java
deleted file mode 100644
index f07aee1c6ba..00000000000
--- a/libjava/javax/print/ServiceUIFactory.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ServiceUIFactory.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-/**
- * @author Michael Koch
- */
-public abstract class ServiceUIFactory
-{
- public static final int ABOUT_UIROLE = 1;
- public static final int ADMIN_UIROLE = 2;
- public static final int MAIN_UIROLE = 3;
- public static final int RESERVED_UIROLE = 99;
-
- public static final String DIALOG_UI = "java.awt.Dialog";
- public static final String JCOMPONENT_UI = "javax.swing.JComponent";
- public static final String JDIALOG_UI = "javax.swing.JDialog";
- public static final String PANEL_UI = "java.awt.Panel";
-
- /**
- * Constructs a <code>ServiceUIFactory</code> object.
- */
- public ServiceUIFactory()
- {
- // Do nothing here.
- }
-
- /**
- * Returns an UI object which may be cast to the requested UI type.
- *
- * @param role the role requested. Must be one of the standard roles
- * or a private role supported by this factory
- * @param ui type in which the role is requested
- *
- * @return the UI role or null of this role is not supported by this factory
- *
- * @throws IllegalArgumentException if <code>role</code> is neither one of
- * the standard ones nor a private one supported by this factory
- */
- public abstract Object getUI(int role, String ui);
-
- /**
- * Returns the UI types supported by this factory for an UI role.
- *
- * @param role the role to be looked up
- *
- * @return an array of UI types
- *
- * @throws IllegalArgumentException if <code>role</code> is neither one of
- * the standard ones nor a private one supported by this factory
- */
- public abstract String[] getUIClassNamesForRole(int role);
-}
diff --git a/libjava/javax/print/StreamPrintService.java b/libjava/javax/print/StreamPrintService.java
deleted file mode 100644
index 2521dcaddb7..00000000000
--- a/libjava/javax/print/StreamPrintService.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* StreamPrintService.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-import java.io.OutputStream;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class StreamPrintService implements PrintService
-{
- private boolean disposed;
- private OutputStream out;
-
- /**
- * Constructs a <code>StreamPrintService</code> object.
- *
- * @param out the <code>OutputStream</code> to use
- */
- protected StreamPrintService(OutputStream out)
- {
- this.out = out;
- }
-
- /**
- * Dispose this <code>StreamPrintService</code> object.
- */
- public void dispose()
- {
- disposed = true;
- }
-
- /**
- * Returns the document format emited by this print service.
- *
- * @return the document format
- */
- public abstract String getOutputFormat();
-
- /**
- * Returns the <code>OutputStream</code> of this object.
- *
- * @return the <code>OutputStream</code>
- */
- public OutputStream getOutputStream()
- {
- return out;
- }
-
- /**
- * Determines if this <code>StreamPrintService</code> object is disposed.
- *
- * @return <code>true</code> if disposed already,
- * otherwise <code>false</code>
- */
- public boolean isDisposed()
- {
- return disposed;
- }
-}
diff --git a/libjava/javax/print/URIException.java b/libjava/javax/print/URIException.java
deleted file mode 100644
index 5cc4c0ddd26..00000000000
--- a/libjava/javax/print/URIException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* URIException.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print;
-
-import java.net.URI;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface URIException
-{
- int URIInaccessible = 1;
- int URIOtherProblem = -1;
- int URISchemeNotSupported = 2;
-
- /**
- * Returns the reason for this exception.
- *
- * @return the reason
- */
- int getReason();
-
- /**
- * Returns the unsupported <code>URI</code> for this exception.
- *
- * @return the unsupported <code>URI</code>.
- */
- URI getUnsupportedURI();
-}
diff --git a/libjava/javax/print/attribute/Attribute.java b/libjava/javax/print/attribute/Attribute.java
deleted file mode 100644
index fcaa7d84cfe..00000000000
--- a/libjava/javax/print/attribute/Attribute.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Attribute.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-
-/**
- * @author Michael Koch
- */
-public interface Attribute extends Serializable
-{
- Class getCategory ();
-
- String getName ();
-}
diff --git a/libjava/javax/print/attribute/AttributeSet.java b/libjava/javax/print/attribute/AttributeSet.java
deleted file mode 100644
index cdc7a8e4876..00000000000
--- a/libjava/javax/print/attribute/AttributeSet.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* AttributeSet.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- */
-public interface AttributeSet
-{
- /**
- * Adds the specified attribute value to this attribute set
- * if it is not already present.
- */
- boolean add (Attribute attribute);
-
- /**
- * Adds all of the elements in the specified set to this attribute.
- */
- boolean addAll (AttributeSet attributes);
-
- void clear ();
-
- boolean containsKey (Class category);
-
- boolean containsValue (Attribute attribute);
-
- boolean equals (Object obj);
-
- Attribute get (Class Category);
-
- int hashCode ();
-
- boolean isEmpty ();
-
- boolean remove (Attribute attribute);
-
- boolean remove (Class category);
-
- int size ();
-
- Attribute[] toArray ();
-}
diff --git a/libjava/javax/print/attribute/AttributeSetUtilities.java b/libjava/javax/print/attribute/AttributeSetUtilities.java
deleted file mode 100644
index 6f0ffc10d7f..00000000000
--- a/libjava/javax/print/attribute/AttributeSetUtilities.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/* AttributeSetUtilities.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-
-public final class AttributeSetUtilities
-{
- /**
- * This class isn't intended to be instantiated.
- */
- private AttributeSetUtilities() {}
-
- private static class UnmodifiableAttributeSet
- implements AttributeSet, Serializable
- {
- private AttributeSet set;
-
- public UnmodifiableAttributeSet(AttributeSet attributeSet)
- {
- if (attributeSet == null)
- throw new NullPointerException("attributeSet may not be null");
-
- this.set = attributeSet;
- }
-
- public boolean add(Attribute attribute)
- {
- throw new UnmodifiableSetException();
- }
-
- public boolean addAll(AttributeSet attributes)
- {
- throw new UnmodifiableSetException();
- }
-
- public void clear()
- {
- throw new UnmodifiableSetException();
- }
-
- public boolean containsKey(Class category)
- {
- return set.containsKey(category);
- }
-
- public boolean containsValue(Attribute attribute)
- {
- return set.containsValue(attribute);
- }
-
- public boolean equals(Object obj)
- {
- return set.equals(obj);
- }
-
- public Attribute get(Class interfaceName)
- {
- return set.get(interfaceName);
- }
-
- public int hashCode()
- {
- return set.hashCode();
- }
-
- public boolean isEmpty()
- {
- return set.isEmpty();
- }
-
- public boolean remove(Class category)
- {
- throw new UnmodifiableSetException();
- }
-
- public boolean remove(Attribute attribute)
- {
- throw new UnmodifiableSetException();
- }
-
- public int size()
- {
- return set.size();
- }
-
- public Attribute[] toArray()
- {
- return set.toArray();
- }
- }
-
- private static class UnmodifiableDocAttributeSet
- extends UnmodifiableAttributeSet
- implements DocAttributeSet, Serializable
- {
- public UnmodifiableDocAttributeSet(DocAttributeSet attributeSet)
- {
- super(attributeSet);
- }
- }
-
- private static class UnmodifiablePrintJobAttributeSet
- extends UnmodifiableAttributeSet
- implements PrintJobAttributeSet, Serializable
- {
- public UnmodifiablePrintJobAttributeSet(PrintJobAttributeSet attributeSet)
- {
- super(attributeSet);
- }
- }
-
- private static class UnmodifiablePrintRequestAttributeSet
- extends UnmodifiableAttributeSet
- implements PrintRequestAttributeSet, Serializable
- {
- public UnmodifiablePrintRequestAttributeSet(PrintRequestAttributeSet attributeSet)
- {
- super(attributeSet);
- }
- }
-
- private static class UnmodifiablePrintServiceAttributeSet
- extends UnmodifiableAttributeSet
- implements PrintServiceAttributeSet, Serializable
- {
- public UnmodifiablePrintServiceAttributeSet(PrintServiceAttributeSet attributeSet)
- {
- super(attributeSet);
- }
- }
-
- private static class SynchronizedAttributeSet
- implements AttributeSet, Serializable
- {
- private AttributeSet set;
-
- public SynchronizedAttributeSet(AttributeSet attributeSet)
- {
- if (attributeSet == null)
- throw new NullPointerException("attributeSet may not be null");
-
- this.set = attributeSet;
- }
-
- public synchronized boolean add(Attribute attribute)
- {
- return set.add(attribute);
- }
-
- public synchronized boolean addAll(AttributeSet attributes)
- {
- return set.addAll(attributes);
- }
-
- public synchronized void clear()
- {
- set.clear();
- }
-
- public synchronized boolean containsKey(Class category)
- {
- return set.containsKey(category);
- }
-
- public synchronized boolean containsValue(Attribute attribute)
- {
- return set.containsValue(attribute);
- }
-
- public synchronized boolean equals(Object obj)
- {
- return set.equals(obj);
- }
-
- public synchronized Attribute get(Class interfaceName)
- {
- return set.get(interfaceName);
- }
-
- public synchronized int hashCode()
- {
- return set.hashCode();
- }
-
- public synchronized boolean isEmpty()
- {
- return set.isEmpty();
- }
-
- public synchronized boolean remove(Class category)
- {
- return set.remove(category);
- }
-
- public synchronized boolean remove(Attribute attribute)
- {
- return set.remove(attribute);
- }
-
- public synchronized int size()
- {
- return set.size();
- }
-
- public synchronized Attribute[] toArray()
- {
- return set.toArray();
- }
- }
-
- private static class SynchronizedDocAttributeSet
- extends SynchronizedAttributeSet
- implements DocAttributeSet, Serializable
- {
- public SynchronizedDocAttributeSet(DocAttributeSet attributeSet)
- {
- super(attributeSet);
- }
- }
-
- private static class SynchronizedPrintJobAttributeSet
- extends SynchronizedAttributeSet
- implements PrintJobAttributeSet, Serializable
- {
- public SynchronizedPrintJobAttributeSet(PrintJobAttributeSet attributeSet)
- {
- super(attributeSet);
- }
- }
-
- private static class SynchronizedPrintRequestAttributeSet
- extends SynchronizedAttributeSet
- implements PrintRequestAttributeSet, Serializable
- {
- public SynchronizedPrintRequestAttributeSet(PrintRequestAttributeSet attributeSet)
- {
- super(attributeSet);
- }
- }
-
- private static class SynchronizedPrintServiceAttributeSet
- extends SynchronizedAttributeSet
- implements PrintServiceAttributeSet, Serializable
- {
- public SynchronizedPrintServiceAttributeSet(PrintServiceAttributeSet attributeSet)
- {
- super(attributeSet);
- }
- }
-
- /**
- * Returns a synchronized view of the given attribute set.
- *
- * @return the sychronized attribute set
- */
- public static AttributeSet synchronizedView(AttributeSet attributeSet)
- {
- return new SynchronizedAttributeSet(attributeSet);
- }
-
- /**
- * Returns a synchronized view of the given attribute set.
- *
- * @return the sychronized attribute set
- */
- public static DocAttributeSet synchronizedView(DocAttributeSet attributeSet)
- {
- return new SynchronizedDocAttributeSet(attributeSet);
- }
-
- /**
- * Returns a synchronized view of the given attribute set.
- *
- * @return the sychronized attribute set
- */
- public static PrintJobAttributeSet synchronizedView(PrintJobAttributeSet attributeSet)
- {
- return new SynchronizedPrintJobAttributeSet(attributeSet);
- }
-
- /**
- * Returns a synchronized view of the given attribute set.
- *
- * @return the sychronized attribute set
- */
- public static PrintRequestAttributeSet synchronizedView(PrintRequestAttributeSet attributeSet)
- {
- return new SynchronizedPrintRequestAttributeSet(attributeSet);
- }
-
- /**
- * Returns a synchronized view of the given attribute set.
- *
- * @return the sychronized attribute set
- */
- public static PrintServiceAttributeSet synchronizedView(PrintServiceAttributeSet attributeSet)
- {
- return new SynchronizedPrintServiceAttributeSet(attributeSet);
- }
-
- /**
- * Returns an unmodifiable view of the given attribute set.
- *
- * @return the sychronized attribute set
- */
- public static AttributeSet unmodifiableView(AttributeSet attributeSet)
- {
- return new UnmodifiableAttributeSet(attributeSet);
- }
-
- /**
- * Returns an unmodifiable view of the given attribute set.
- *
- * @return the sychronized attribute set
- */
- public static DocAttributeSet unmodifiableView(DocAttributeSet attributeSet)
- {
- return new UnmodifiableDocAttributeSet(attributeSet);
- }
-
- /**
- * Returns an unmodifiable view of the given attribute set.
- *
- * @return the sychronized attribute set
- */
- public static PrintJobAttributeSet unmodifiableView(PrintJobAttributeSet attributeSet)
- {
- return new UnmodifiablePrintJobAttributeSet(attributeSet);
- }
-
- /**
- * Returns an unmodifiable view of the given attribute set.
- *
- * @return the sychronized attribute set
- */
- public static PrintRequestAttributeSet unmodifiableView(PrintRequestAttributeSet attributeSet)
- {
- return new UnmodifiablePrintRequestAttributeSet(attributeSet);
- }
-
- /**
- * Returns an unmodifiable view of the given attribute set.
- *
- * @return the sychronized attribute set
- */
- public static PrintServiceAttributeSet unmodifiableView(PrintServiceAttributeSet attributeSet)
- {
- return new UnmodifiablePrintServiceAttributeSet(attributeSet);
- }
-
- /**
- * Verifies that the given object is a <code>Class</code> that
- * implements the given interface name.
- *
- * @return object casted to <code>Class</code>
- *
- * @exception ClassCastException if object is not a <code>Class</code>
- * that implements interfaceName
- * @exception NullPointerException if object is null
- */
- public static Class verifyAttributeCategory(Object object,
- Class interfaceName)
- {
- if (object == null)
- throw new NullPointerException("object may not be null");
-
- Class clazz = (Class) object;
-
- if (interfaceName.isAssignableFrom(clazz))
- return clazz;
-
- throw new ClassCastException();
- }
-
- /**
- * Verifies that the given object is an attribute of the given interface.
- *
- * @return the object casted to <code>Attribute</code>
- *
- * @exception ClassCastException if object is no instance of interfaceName.
- * @exception NullPointerException if object is null
- */
- public static Attribute verifyAttributeValue(Object object,
- Class interfaceName)
- {
- if (object == null)
- throw new NullPointerException("object may not be null");
-
- if (interfaceName.isInstance(object))
- return (Attribute) object;
-
- throw new ClassCastException();
- }
-
- /**
- * Verifies that the category of attribute is equals to category.
- *
- * @param category the category the atteribute should be
- * @param attribute the attribute to verify
- *
- * @exception IllegalArgumentException if the categories are not equal
- * @exception NullPointerException if category is null
- */
- public static void verifyCategoryForValue(Class category,
- Attribute attribute)
- {
- if (category == null)
- throw new NullPointerException("object may not be null");
-
- if (category.equals(attribute.getCategory()))
- throw new IllegalArgumentException
- ("category of attribute not equal to category");
- }
-}
diff --git a/libjava/javax/print/attribute/DateTimeSyntax.java b/libjava/javax/print/attribute/DateTimeSyntax.java
deleted file mode 100644
index 0e583e0b990..00000000000
--- a/libjava/javax/print/attribute/DateTimeSyntax.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* DateTimeSyntax.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * @author Michael Koch
- */
-public abstract class DateTimeSyntax implements Cloneable, Serializable
-{
- private static final long serialVersionUID = -1400819079791208582L;
-
- private Date value;
-
- /**
- * Creates a <code>DateTimeSyntax</code> with a given value.
- *
- * @param value the value for this syntax
- *
- * @exception NullPointerException if value is null
- */
- protected DateTimeSyntax(Date value)
- {
- if (value == null)
- throw new NullPointerException("value may not be null");
-
- this.value = value;
- }
-
- /**
- * Returns the date value of this object.
- *
- * @return the date value
- */
- public Date getValue()
- {
- return value;
- }
-
- /**
- * Tests if the given object is equal to this one.
- *
- * @param obj the object to test
- *
- * @return True if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof DateTimeSyntax))
- return false;
-
- return value.equals(((DateTimeSyntax) obj).getValue());
- }
-
- /**
- * Returns the hashcode for this object.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return value.hashCode();
- }
-}
diff --git a/libjava/javax/print/attribute/DocAttribute.java b/libjava/javax/print/attribute/DocAttribute.java
deleted file mode 100644
index 669d7d98251..00000000000
--- a/libjava/javax/print/attribute/DocAttribute.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* DocAttribute.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- */
-public interface DocAttribute extends Attribute
-{
-}
diff --git a/libjava/javax/print/attribute/DocAttributeSet.java b/libjava/javax/print/attribute/DocAttributeSet.java
deleted file mode 100644
index 72cd6d88a00..00000000000
--- a/libjava/javax/print/attribute/DocAttributeSet.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* DocAttributeSet.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- */
-public interface DocAttributeSet extends AttributeSet
-{
- /**
- * Adds the specified attribute value to this attribute set
- * if it is not already present.
- */
- boolean add (Attribute attribute);
-
- /**
- * Adds all of the elements in the specified set to this attribute.
- */
- boolean addAll (AttributeSet attributes);
-}
diff --git a/libjava/javax/print/attribute/EnumSyntax.java b/libjava/javax/print/attribute/EnumSyntax.java
deleted file mode 100644
index 3ed79fc5f68..00000000000
--- a/libjava/javax/print/attribute/EnumSyntax.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/* EnumSyntax.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-
-/**
- * @author Michael Koch
- */
-public abstract class EnumSyntax implements Cloneable, Serializable
-{
- private static final long serialVersionUID = -2739521845085831642L;
-
- private int value;
-
- /**
- * Creates a <code>EnumSyntax</code> object.
- *
- * @param value the value to set
- */
- protected EnumSyntax(int value)
- {
- this.value = value;
- }
-
- /**
- * Returns the value of this object.
- *
- * @return the value
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * Clones this object.
- *
- * @return a clone of this object
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- // Cannot happen as we implement java.lang.Cloneable.
- return null;
- }
- }
-
- /**
- * Returns the hashcode for this object.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return value;
- }
-
- /**
- * Returns the string representation for this object.
- *
- * @return the string representation
- */
- public String toString()
- {
- int index = value - getOffset();
- String[] table = getStringTable();
-
- if (table != null
- && index >= 0
- && index < table.length)
- return table[index];
-
- return "" + value;
- }
-
- /**
- * Returns a table with the enumeration values represented as strings
- * for this object.
- *
- * The default implementation just returns null.
- *
- * @return the enumeration values as strings
- */
- protected String[] getStringTable()
- {
- return null;
- }
-
- /**
- * Returns a table with the enumeration values for this object.
- *
- * The default implementation just returns null.
- *
- * @return the enumeration values
- */
- protected EnumSyntax[] getEnumValueTable()
- {
- return null;
- }
-
- protected int getOffset()
- {
- return 0;
- }
-}
diff --git a/libjava/javax/print/attribute/HashAttributeSet.java b/libjava/javax/print/attribute/HashAttributeSet.java
deleted file mode 100644
index c5fbe5ea88a..00000000000
--- a/libjava/javax/print/attribute/HashAttributeSet.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/* HashAttributeSet.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Iterator;
-
-public class HashAttributeSet implements AttributeSet, Serializable
-{
- private static final long serialVersionUID = 5311560590283707917L;
-
- private Class interfaceName;
- private HashMap attributeMap = new HashMap();
-
- /**
- * Creates an empty <code>HashAttributeSet</code> object.
- */
- public HashAttributeSet()
- {
- this(Attribute.class);
- }
-
- /**
- * Creates a <code>HashAttributeSet</code> object with the given
- * attribute in it.
- *
- * @param attribute the attribute to put into the set
- *
- * @exception NullPointerException if attribute is null
- */
- public HashAttributeSet(Attribute attribute)
- {
- this(attribute, Attribute.class);
- }
-
- /**
- * Creates a <code>HashAttributeSet</code> object with the given
- * attributes in it.
- *
- * @param attributes the attributes to put into the set
- *
- * @exception NullPointerException If attributes is null
- */
- public HashAttributeSet(Attribute[] attributes)
- {
- this(attributes, Attribute.class);
- }
-
- /**
- * Creates a <code>HashAttributeSet</code> object with the given
- * attributes in it.
- *
- * @param attributes the attributes to put into the set
- *
- * @exception NullPointerException If attributes is null
- */
- public HashAttributeSet(AttributeSet attributes)
- {
- this(attributes, Attribute.class);
- }
-
- /**
- * Creates an empty <code>HashAttributeSet</code> object.
- *
- * @param interfaceName the interface that all members must implement
- *
- * @exception NullPointerException if interfaceName is null
- */
- protected HashAttributeSet(Class interfaceName)
- {
- if (interfaceName == null)
- throw new NullPointerException("interfaceName may not be null");
-
- this.interfaceName = interfaceName;
- }
-
- /**
- * Creates an empty <code>HashAttributeSet</code> object.
- *
- * @exception ClassCastException if attribute is not an interface of
- * interfaceName
- * @exception NullPointerException if attribute or interfaceName is null
- */
- protected HashAttributeSet(Attribute attribute, Class interfaceName)
- {
- this(interfaceName);
-
- if (attribute == null)
- throw new NullPointerException();
-
- addInternal(attribute, interfaceName);
- }
-
- /**
- * Creates an empty <code>HashAttributeSet</code> object.
- *
- * @exception ClassCastException if any element of attributes is not an
- * interface of interfaceName
- * @exception NullPointerException if attributes or interfaceName is null
- */
- protected HashAttributeSet(Attribute[] attributes, Class interfaceName)
- {
- this(interfaceName);
-
- if (attributes == null)
- throw new NullPointerException();
-
- for (int index = 0; index < attributes.length; index++)
- addInternal(attributes[index], interfaceName);
- }
-
- /**
- * Creates an empty <code>HashAttributeSet</code> object.
- *
- * @exception ClassCastException if any element of attributes is not an
- * interface of interfaceName
- */
- protected HashAttributeSet(AttributeSet attributes, Class interfaceName)
- {
- this(interfaceName);
-
- if (attributes != null)
- addAllInternal(attributes, interfaceName);
- }
-
- /**
- * Adds the given attribute to the set.
- *
- * @param attribute the attribute to add
- *
- * @return true if the attribute set has changed, false otherwise
- *
- * @exception NullPointerException if attribute is null
- * @exception UnmodifiableSetException if this attribute set does not
- * support this action.
- */
- public boolean add(Attribute attribute)
- {
- return addInternal(attribute, interfaceName);
- }
-
- private boolean addInternal(Attribute attribute, Class interfaceName)
- {
- if (attribute == null)
- throw new NullPointerException("attribute may not be null");
-
- AttributeSetUtilities.verifyAttributeCategory(interfaceName,
- this.interfaceName);
-
- Object old = attributeMap.put
- (attribute.getCategory(), AttributeSetUtilities.verifyAttributeValue
- (attribute, interfaceName));
- return !attribute.equals(old);
- }
-
- /**
- * Adds the given attributes to the set.
- *
- * @param attributes the attributes to add
- *
- * @return true if the attribute set has changed, false otherwise
- *
- * @exception UnmodifiableSetException if this attribute set does not
- * support this action.
- */
- public boolean addAll(AttributeSet attributes)
- {
- return addAllInternal(attributes, interfaceName);
- }
-
- private boolean addAllInternal(AttributeSet attributes, Class interfaceName)
- {
- boolean modified = false;
- Attribute[] array = attributes.toArray();
-
- for (int index = 0; index < array.length; index++)
- if (addInternal(array[index], interfaceName))
- modified = true;
-
- return modified;
- }
-
- /**
- * Removes all attributes from this attribute set.
- *
- * @exception UnmodifiableSetException if this attribute set does not
- * support this action.
- */
- public void clear()
- {
- attributeMap.clear();
- }
-
- /**
- * Checks if this attribute set contains an entry with the given category.
- *
- * @param category the category to test for
- *
- * @return true if the category exists in this attribute set, false otherwise.
- */
- public boolean containsKey(Class category)
- {
- return attributeMap.containsKey(category);
- }
-
- /**
- * Checks if this attribute set contains an entry with the given attribute.
- *
- * @param attribute the attribute to test for
- *
- * @return true if the attribute exists in this attribute set,
- * false otherwise.
- */
- public boolean containsValue(Attribute attribute)
- {
- return attributeMap.containsValue(attribute);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof HashAttributeSet))
- return false;
-
- return attributeMap.equals(((HashAttributeSet) obj).attributeMap);
- }
-
- /**
- * Returns the attribute value that is connected to the given attribute
- * category. If the attribute set does not contains the given category null
- * will be returned.
- *
- * @param category the attribute category to return the attribute value for
- *
- * @return the attribute associated to category, or null
- */
- public Attribute get(Class category)
- {
- return (Attribute) attributeMap.get(category);
- }
-
- /**
- * Returns the hashcode for this object.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return attributeMap.hashCode() + interfaceName.hashCode();
- }
-
- /**
- * Checks if the attribute set is empty.
- *
- * @return true if the attribute set is empty, false otherwise
- */
- public boolean isEmpty()
- {
- return attributeMap.isEmpty();
- }
-
- /**
- * Removes the entry with the given attribute in it.
- *
- * @param attribute the attribute value of the entry to be removed
- *
- * @return true if the attribute set has changed, false otherwise.
- *
- * @exception UnmodifiableSetException if this attribute set does not
- * support this action.
- */
- public boolean remove(Attribute attribute)
- {
- if (attribute == null)
- return false;
-
- return attributeMap.remove(attribute.getCategory()) != null;
- }
-
- /**
- * Removes the entry with the given category in it.
- *
- * @param category the category value of the entry to be removed
- *
- * @return true if the attribute set has changed, false otherwise.
- */
- public boolean remove(Class category)
- {
- if (category == null)
- return false;
-
- return attributeMap.remove(category) != null;
- }
-
- /**
- * Returns the number of elements in this attribute set.
- *
- * @return the number of elements.
- */
- public int size()
- {
- return attributeMap.size();
- }
-
- /**
- * Returns the content of the attribute set as an array
- *
- * @return an array of attributes
- */
- public Attribute[] toArray()
- {
- int index = 0;
- Iterator it = attributeMap.entrySet().iterator();
- Attribute[] array = new Attribute[size()];
-
- while (it.hasNext())
- {
- array[index] = (Attribute) it.next();
- index++;
- }
-
- return array;
- }
-}
diff --git a/libjava/javax/print/attribute/HashDocAttributeSet.java b/libjava/javax/print/attribute/HashDocAttributeSet.java
deleted file mode 100644
index 1647ae2f999..00000000000
--- a/libjava/javax/print/attribute/HashDocAttributeSet.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* HashDocAttributeSet.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-
-public class HashDocAttributeSet extends HashAttributeSet
- implements DocAttributeSet, Serializable
-{
- private static final long serialVersionUID = -1128534486061432528L;
-
- /**
- * Creates an empty <code>HashDocAttributeSet</code> object.
- */
- public HashDocAttributeSet()
- {
- super(DocAttribute.class);
- }
-
- /**
- * Creates a <code>HashDocAttributeSet</code> object with the given
- * attribute in it.
- *
- * @param attribute the attriute tu put into the attribute set
- *
- * @exception NullPointerException if attribute is null
- */
- public HashDocAttributeSet(DocAttribute attribute)
- {
- super(attribute, DocAttribute.class);
- }
-
- /**
- * Creates a <code>HashDocAttributeSet</code> object with the given
- * attributes in it.
- *
- * @param attributes the attributes to put into the attribute set
- *
- * @exception NullPointerException if attributes is null
- */
- public HashDocAttributeSet(DocAttribute[] attributes)
- {
- super(attributes, DocAttribute.class);
- }
-
- /**
- * Creates a <code>HashDocAttributeSet</code> object with the given
- * attributes in it.
- *
- * @param attributes the attributes to put into the attribute set
- *
- * @exception ClassCastException if any element of attributes is not
- * an instance of <code>DocAttribute</code>
- */
- public HashDocAttributeSet(DocAttributeSet attributes)
- {
- super(attributes, DocAttribute.class);
- }
-}
diff --git a/libjava/javax/print/attribute/HashPrintJobAttributeSet.java b/libjava/javax/print/attribute/HashPrintJobAttributeSet.java
deleted file mode 100644
index 84fa7ec5d6a..00000000000
--- a/libjava/javax/print/attribute/HashPrintJobAttributeSet.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* HashPrintJobAttributeSet.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-
-public class HashPrintJobAttributeSet extends HashAttributeSet
- implements Serializable, PrintJobAttributeSet
-{
- private static final long serialVersionUID = -4204473656070350348L;
-
- /**
- * Creates an empty <code>HashPrintJobAttributeSet</code> object.
- */
- public HashPrintJobAttributeSet()
- {
- super(PrintJobAttribute.class);
- }
-
- /**
- * Creates a <code>HashPrintJobAttributeSet</code> object with the given
- * attribute in it.
- *
- * @param attribute the attriute tu put into the attribute set
- *
- * @exception NullPointerException if attribute is null
- */
- public HashPrintJobAttributeSet(PrintJobAttribute attribute)
- {
- super(attribute, PrintJobAttribute.class);
- }
-
- /**
- * Creates a <code>HashPrintJobAttributeSet</code> object with the given
- * attributes in it.
- *
- * @param attributes the attributes to put into the attribute set
- *
- * @exception NullPointerException if attributes is null
- */
- public HashPrintJobAttributeSet(PrintJobAttribute[] attributes)
- {
- super(attributes, PrintJobAttribute.class);
- }
-
- /**
- * Creates a <code>HashPrintJobAttributeSet</code> object with the given
- * attributes in it.
- *
- * @param attributes the attributes to put into the attribute set
- *
- * @exception ClassCastException if any element of attributes is not
- * an instance of <code>PrintJobAttribute</code>
- */
- public HashPrintJobAttributeSet(PrintJobAttributeSet attributes)
- {
- super(attributes, PrintJobAttribute.class);
- }
-}
diff --git a/libjava/javax/print/attribute/HashPrintRequestAttributeSet.java b/libjava/javax/print/attribute/HashPrintRequestAttributeSet.java
deleted file mode 100644
index 29a17861f7b..00000000000
--- a/libjava/javax/print/attribute/HashPrintRequestAttributeSet.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* HashPrintRequestAttributeSet.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-
-public class HashPrintRequestAttributeSet extends HashAttributeSet
- implements Serializable, PrintRequestAttributeSet
-{
- private static final long serialVersionUID = 2364756266107751933L;
-
- /**
- * Creates an empty <code>HashPrintRequestAttributeSet</code> object.
- */
- public HashPrintRequestAttributeSet()
- {
- super(PrintRequestAttribute.class);
- }
-
- /**
- * Creates a <code>HashPrintRequestAttributeSet</code> object with the given
- * attribute in it.
- *
- * @param attribute the attriute tu put into the attribute set
- *
- * @exception NullPointerException if attribute is null
- */
- public HashPrintRequestAttributeSet(PrintRequestAttribute attribute)
- {
- super(attribute, PrintRequestAttribute.class);
- }
-
- /**
- * Creates a <code>HashPrintRequestAttributeSet</code> object with the given
- * attributes in it.
- *
- * @param attributes the attributes to put into the attribute set
- *
- * @exception NullPointerException if attributes is null
- */
- public HashPrintRequestAttributeSet(PrintRequestAttribute[] attributes)
- {
- super(attributes, PrintRequestAttribute.class);
- }
-
- /**
- * Creates a <code>HashPrintRequestAttributeSet</code> object with the given
- * attributes in it.
- *
- * @param attributes the attributes to put into the attribute set
- *
- * @exception ClassCastException if any element of attributes is not
- * an instance of <code>PrintRequestAttribute</code>
- */
- public HashPrintRequestAttributeSet(PrintRequestAttributeSet attributes)
- {
- super(attributes, PrintRequestAttribute.class);
- }
-}
diff --git a/libjava/javax/print/attribute/HashPrintServiceAttributeSet.java b/libjava/javax/print/attribute/HashPrintServiceAttributeSet.java
deleted file mode 100644
index 60e12bff0d1..00000000000
--- a/libjava/javax/print/attribute/HashPrintServiceAttributeSet.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* HashPrintServiceAttributeSet.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-
-public class HashPrintServiceAttributeSet extends HashAttributeSet
- implements Serializable, PrintServiceAttributeSet
-{
- private static final long serialVersionUID = 6642904616179203070L;
-
- /**
- * Creates an empty <code>HashPrintServiceAttributeSet</code> object.
- */
- public HashPrintServiceAttributeSet()
- {
- super(PrintServiceAttribute.class);
- }
-
- /**
- * Creates a <code>HashPrintServiceAttributeSet</code> object with the given
- * attribute in it.
- *
- * @param attribute the attriute tu put into the attribute set
- *
- * @exception NullPointerException if attribute is null
- */
- public HashPrintServiceAttributeSet(PrintServiceAttribute attribute)
- {
- super(attribute, PrintServiceAttribute.class);
- }
-
- /**
- * Creates a <code>HashPrintServiceAttributeSet</code> object with the given
- * attributes in it.
- *
- * @param attributes the attributes to put into the attribute set
- *
- * @exception NullPointerException if attributes is null
- */
- public HashPrintServiceAttributeSet(PrintServiceAttribute[] attributes)
- {
- super(attributes, PrintServiceAttribute.class);
- }
-
- /**
- * Creates a <code>HashPrintServiceAttributeSet</code> object with the given
- * attributes in it.
- *
- * @param attributes the attributes to put into the attribute set
- *
- * @exception ClassCastException if any element of attributes is not
- * an instance of <code>PrintServiceAttribute</code>
- */
- public HashPrintServiceAttributeSet(PrintServiceAttributeSet attributes)
- {
- super(attributes, PrintServiceAttribute.class);
- }
-}
diff --git a/libjava/javax/print/attribute/IntegerSyntax.java b/libjava/javax/print/attribute/IntegerSyntax.java
deleted file mode 100644
index d5500b4ca8a..00000000000
--- a/libjava/javax/print/attribute/IntegerSyntax.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/* IntegerSyntax.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-
-/**
- * @author Michael Koch
- */
-public abstract class IntegerSyntax implements Cloneable, Serializable
-{
- private int value;
-
- /**
- * Creates a <code>IntegerSyntax</code> with the given value.
- *
- * @param value the value to set
- */
- protected IntegerSyntax(int value)
- {
- this.value = value;
- }
-
- /**
- * Creates a <code>IntegerSyntax</code> with the given arguments.
- *
- * @param value the value to set
- * @param lowerBound the lower bound for the value
- * @param upperBound the upper bound for the value
- *
- * @exception IllegalArgumentException if value < lowerBound
- * or value > upperBound
- */
- protected IntegerSyntax(int value, int lowerBound, int upperBound)
- {
- if (value < lowerBound
- || value > upperBound)
- throw new IllegalArgumentException("value not in range");
-
- this.value = value;
- }
-
- /**
- * Returns the value of this object.
- *
- * @return the value
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof IntegerSyntax))
- return false;
-
- return value == ((IntegerSyntax) obj).getValue();
- }
-
- /**
- * Returns the hashcode for this object.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return value;
- }
-
- /**
- * Returns the string representation for this object.
- *
- * @return the string representation
- */
- public String toString()
- {
- return "" + value;
- }
-}
diff --git a/libjava/javax/print/attribute/PrintJobAttribute.java b/libjava/javax/print/attribute/PrintJobAttribute.java
deleted file mode 100644
index ba3a737b523..00000000000
--- a/libjava/javax/print/attribute/PrintJobAttribute.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* PrintJobAttribute.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- */
-public interface PrintJobAttribute extends Attribute
-{
-}
diff --git a/libjava/javax/print/attribute/PrintJobAttributeSet.java b/libjava/javax/print/attribute/PrintJobAttributeSet.java
deleted file mode 100644
index 905d53c2d71..00000000000
--- a/libjava/javax/print/attribute/PrintJobAttributeSet.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* PrintJobAttributeSet.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- */
-public interface PrintJobAttributeSet extends AttributeSet
-{
- /**
- * Adds the specified attribute value to this attribute set
- * if it is not already present.
- */
- boolean add (Attribute attribute);
-
- /**
- * Adds all of the elements in the specified set to this attribute.
- */
- boolean addAll (AttributeSet attributes);
-}
diff --git a/libjava/javax/print/attribute/PrintRequestAttribute.java b/libjava/javax/print/attribute/PrintRequestAttribute.java
deleted file mode 100644
index 756350020d2..00000000000
--- a/libjava/javax/print/attribute/PrintRequestAttribute.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* PrintRequestAttribute.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- */
-public interface PrintRequestAttribute extends Attribute
-{
-}
diff --git a/libjava/javax/print/attribute/PrintRequestAttributeSet.java b/libjava/javax/print/attribute/PrintRequestAttributeSet.java
deleted file mode 100644
index d72d2d71c47..00000000000
--- a/libjava/javax/print/attribute/PrintRequestAttributeSet.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* PrintRequestAttributeSet.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- */
-public interface PrintRequestAttributeSet extends AttributeSet
-{
- /**
- * Adds the specified attribute value to this attribute set
- * if it is not already present.
- */
- boolean add (Attribute attribute);
-
- /**
- * Adds all of the elements in the specified set to this attribute.
- */
- boolean addAll (AttributeSet attributes);
-}
diff --git a/libjava/javax/print/attribute/PrintServiceAttribute.java b/libjava/javax/print/attribute/PrintServiceAttribute.java
deleted file mode 100644
index 3cf8825f560..00000000000
--- a/libjava/javax/print/attribute/PrintServiceAttribute.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* PrintServiceAttribute.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- */
-public interface PrintServiceAttribute extends Attribute
-{
-}
diff --git a/libjava/javax/print/attribute/PrintServiceAttributeSet.java b/libjava/javax/print/attribute/PrintServiceAttributeSet.java
deleted file mode 100644
index d67c9af55f0..00000000000
--- a/libjava/javax/print/attribute/PrintServiceAttributeSet.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* PrintServiceAttributeSet.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- */
-public interface PrintServiceAttributeSet extends AttributeSet
-{
- /**
- * Adds the specified attribute value to this attribute set
- * if it is not already present.
- */
- boolean add (Attribute attribute);
-
- /**
- * Adds all of the elements in the specified set to this attribute.
- */
- boolean addAll (AttributeSet attributes);
-}
diff --git a/libjava/javax/print/attribute/ResolutionSyntax.java b/libjava/javax/print/attribute/ResolutionSyntax.java
deleted file mode 100644
index a7878c50b9e..00000000000
--- a/libjava/javax/print/attribute/ResolutionSyntax.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/* ResolutionSyntax.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-
-/**
- * @author Michael Koch
- */
-public abstract class ResolutionSyntax
- implements Cloneable, Serializable
-{
- private static final long serialVersionUID = 2706743076526672017L;
-
- /**
- * Constant for units of dots per centimeter.
- */
- public static final int DPCM = 254;
-
- /**
- * Constant for units of dots per inch
- */
- public static final int DPI = 100;
-
- private int crossFeedResolution;
- private int feedResolution;
-
- /**
- * Creates a <code>ResolutionSyntax</code> object with the given arguments.
- *
- * @param crossFeedResolution the cross feed resolution
- * @param feedResolution the feed resolution
- * @param units the unit to use
- *
- * @exception IllegalArgumentException if preconditions fail
- */
- public ResolutionSyntax(int crossFeedResolution, int feedResolution,
- int units)
- {
- if (crossFeedResolution < 1
- || feedResolution < 1
- || units < 1)
- throw new IllegalArgumentException("no argument may be less than 1");
-
- this.crossFeedResolution = crossFeedResolution * units;
- this.feedResolution = feedResolution * units;
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof ResolutionSyntax))
- return false;
-
- ResolutionSyntax tmp = (ResolutionSyntax) obj;
-
- return (crossFeedResolution == tmp.getCrossFeedResolutionDphi()
- && feedResolution == tmp.getFeedResolutionDphi());
- }
-
- /**
- * Returns the cross feed resolution in units.
- *
- * @return the resolution
- *
- * @exception IllegalArgumentException if units < 1
- */
- public int getCrossFeedResolution(int units)
- {
- if (units < 1)
- throw new IllegalArgumentException("units may not be less then 1");
-
- return (crossFeedResolution + units) / units;
- }
-
- /**
- * Returns the raw cross feed resolution in units.
- *
- * @return the raw resolution
- */
- protected int getCrossFeedResolutionDphi()
- {
- return crossFeedResolution;
- }
-
- /**
- * Returns the feed resolution in units.
- *
- * @return the resolution
- *
- * @exception IllegalArgumentException if units < 1
- */
- public int getFeedResolution(int units)
- {
- if (units < 1)
- throw new IllegalArgumentException("units may not be less then 1");
-
- return (crossFeedResolution + units) / units;
- }
-
- /**
- * Returns the raw feed resolution in units.
- *
- * @return the raw resolution
- */
- protected int getFeedResolutionDphi()
- {
- return feedResolution;
- }
-
- /**
- * Returns the resolution as two field array. Index 0 is the cross feed
- * resolution, index 1 the feed resolution.
- *
- * @param units the units to use
- *
- * @return the array with the resolutions
- */
- public int[] getResolution(int units)
- {
- int[] resolution = new int[2];
- resolution[0] = getCrossFeedResolution(units);
- resolution[1] = getFeedResolution(units);
- return resolution;
- }
-
- /**
- * Returns the hashcode for this object.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return crossFeedResolution + feedResolution;
- }
-
- /**
- * Checks of other is a lower or equal resolution.
- *
- * @param other the resolution to check against
- *
- * @return true if other describes a lower or equal resolution
- */
- public boolean lessThanOrEquals(ResolutionSyntax other)
- {
- if (other == null)
- throw new NullPointerException("other may not be null");
-
- return (crossFeedResolution <= other.getCrossFeedResolutionDphi()
- && feedResolution <= other.getFeedResolutionDphi());
- }
-
- /**
- * Returns the string representation for this object.
- *
- * @return the string representation
- */
- public String toString()
- {
- return toString(1, "dphi");
- }
-
- /**
- * Returns the string representation for this object.
- *
- * @param units the units to use
- * @param unitsName the name of the units
- *
- * @return the string representation
- */
- public String toString(int units, String unitsName)
- {
- return ("" + getCrossFeedResolution(units)
- + "x" + getFeedResolution(units)
- + " " + unitsName);
- }
-}
diff --git a/libjava/javax/print/attribute/SetOfIntegerSyntax.java b/libjava/javax/print/attribute/SetOfIntegerSyntax.java
deleted file mode 100644
index d73b867d5f6..00000000000
--- a/libjava/javax/print/attribute/SetOfIntegerSyntax.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/* SetOfIntegerSyntax.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-import java.util.Vector;
-
-/**
- * @author Michael Koch
- */
-public abstract class SetOfIntegerSyntax
- implements Cloneable, Serializable
-{
- private static final long serialVersionUID = 3666874174847632203L;
-
- private int[][] members;
-
- private static int[][] normalize(Vector vecMembers)
- {
- // XXX: Perhaps we should merge ranges that overlap.
-
- int current = 0;
- int[][] members = new int[vecMembers.size()][];
-
- while (vecMembers.size() > 0)
- {
- // Search the lowest range.
- int[] range = (int[]) vecMembers.elementAt(0);
-
- for (int index = 1; index < vecMembers.size(); index++)
- {
- int[] tmp = (int[]) vecMembers.elementAt(index);
-
- if (range[0] > tmp[0]
- || (range[0] == tmp[0]
- && range[0] > tmp[0]))
- range = tmp;
- }
-
- members[current] = range;
- current++;
- }
-
- return members;
- }
-
- /**
- * Creates a <code>SetOfIntegerSyntax</code> object.
- *
- * @param member the member value
- *
- * @exception IllegalArgumentException if member is < 0
- */
- protected SetOfIntegerSyntax(int member)
- {
- if (member < 0)
- throw new IllegalArgumentException("member may not be less than 0");
-
- this.members = new int[][]{{member, member}};
- }
-
- /**
- * Creates a <code>SetOfIntegerSyntax</code> object.
- *
- * @param members the members to use in this set
- *
- * @exception IllegalArgumentException if any element is invalid
- * @exception NullPointerException if any element of members is null
- */
- protected SetOfIntegerSyntax(int[][] members)
- {
- Vector vecMembers = new Vector();
-
- if (members != null)
- {
- for (int index = 0; index < members.length; index++)
- {
- int lower;
- int upper;
-
- if (members[index].length == 1)
- {
- lower = members[index][0];
- upper = members[index][0];
- }
- else if (members[index].length == 2)
- {
- lower = members[index][0];
- upper = members[index][1];
- }
- else
- throw new IllegalArgumentException("invalid member element");
-
- if (lower <= upper && lower < 0)
- throw new IllegalArgumentException("invalid member element");
-
- if (lower <= upper)
- {
- int[] range = new int[2];
- range[0] = lower;
- range[1] = upper;
- vecMembers.add(range);
- }
- }
- }
-
- this.members = normalize(vecMembers);
- }
-
- /**
- * Creates a <code>SetOfIntegerSyntax</code> object.
- *
- * @param lowerBound the lower bound value
- * @param upperBound the upper bound value
- *
- * @exception IllegalArgumentException if lowerBound &lt;= upperbound
- * and lowerBound &lt; 0
- */
- protected SetOfIntegerSyntax(int lowerBound, int upperBound)
- {
- if (lowerBound <= upperBound
- && lowerBound < 0)
- throw new IllegalArgumentException();
-
- members = (lowerBound <= upperBound ? new int[][]{{lowerBound, upperBound}}
- : new int[0][]);
- }
-
- /**
- * Checks if this set contains value.
- *
- * @param value the value to test for
- *
- * @return true if this set contains value, false otherwise
- */
- public boolean contains(int value)
- {
- // This only works on a normalized member array.
- for (int index = 0; index < members.length; index++)
- {
- if (value < members[index][0])
- return false;
- else if (value < members[index][1])
- return true;
- }
-
- return false;
- }
-
- /**
- * Checks if this set contains value.
- *
- * @param value the value to test for
- *
- * @return true if this set contains value, false otherwise
- */
- public boolean contains(IntegerSyntax value)
- {
- return contains(value.getValue());
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof SetOfIntegerSyntax))
- return false;
-
- throw new Error("not implemented");
- }
-
- /**
- * Returns an array describing the members included in this set.
- *
- * @return the array with the members
- */
- public int[][] getMembers()
- {
- throw new Error("not implemented");
- }
-
- /**
- * Returns the hashcode for this object.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- throw new Error("not implemented");
- }
-
- /**
- * Returns the smallest value that is greater then x.
- *
- * @param x an integer value
- *
- * @return the next value
- */
- public int next(int x)
- {
- throw new Error("not implemented");
- }
-
- /**
- * Returns the string representation for this object.
- *
- * @return the string representation
- */
- public String toString()
- {
- throw new Error("not implemented");
- }
-}
diff --git a/libjava/javax/print/attribute/Size2DSyntax.java b/libjava/javax/print/attribute/Size2DSyntax.java
deleted file mode 100644
index c8d6ec781ba..00000000000
--- a/libjava/javax/print/attribute/Size2DSyntax.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/* Size2DSyntax.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-
-/**
- * @author Michael Koch
- */
-public abstract class Size2DSyntax implements Cloneable, Serializable
-{
- /**
- * Constant for units of dots per mircometer to describe an inch.
- */
- public static final int INCH = 25400;
-
- /**
- * Constant for units of dots per mircometer to describe a centimeter.
- */
- public static final int MM = 1000;
-
- private int x;
- private int y;
-
- /**
- * Creates a <code>Size2DSyntax</code> object with the given arguments.
- *
- * @param x the size in x direction
- * @param y the size in y direction
- * @param units the units to use for the sizes
- *
- * @exception IllegalArgumentException if preconditions fail
- */
- protected Size2DSyntax(float x, float y, int units)
- {
- if (x < 0.0f || y < 0.0f)
- throw new IllegalArgumentException("x and/or y may not be less than 0");
-
- if (units < 1)
- throw new IllegalArgumentException("units may not be less then 1");
-
- this.x = (int) (x * units + 0.5f);
- this.y = (int) (y * units + 0.5f);
- }
-
- /**
- * Creates a <code>Size2DSyntax</code> object with the given arguments.
- *
- * @param x the size in x direction
- * @param y the size in y direction
- * @param units the units to use for the sizes
- *
- * @exception IllegalArgumentException if preconditions fail
- */
- protected Size2DSyntax(int x, int y, int units)
- {
- if (x < 0 || y < 0)
- throw new IllegalArgumentException("x and/or y may not be less then 0");
-
- if (units < 1)
- throw new IllegalArgumentException("units may not be less then 1");
-
- this.x = x * units;
- this.y = y * units;
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @returns true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof Size2DSyntax))
- return false;
-
- Size2DSyntax tmp = (Size2DSyntax) obj;
-
- return (x == tmp.getXMicrometers()
- && y == tmp.getYMicrometers());
- }
-
- /**
- * Return the size described in this object as a two field array.
- * Index 0 contains the size in x direction, index 1 the size in
- * y direction.
- *
- * @param units the units to use
- *
- * @return the array that describes the size
- *
- * @exception IllegalArgumentException if units < 1
- */
- public float[] getSize(int units)
- {
- float[] size = new float[2];
- size[0] = getX(units);
- size[1] = getY(units);
- return size;
- }
-
- /**
- * Return the size in x direction.
- *
- * @param units the units to use
- *
- * @return the size value
- *
- * @exception IllegalArgumentException if units < 1
- */
- public float getX(int units)
- {
- if (units < 1)
- throw new IllegalArgumentException("units may not be less then 1");
-
- return ((float) x) / ((float) units);
- }
-
- /**
- * Returns the size in x direction in mircometers.
- *
- * @return the size value
- */
- protected int getXMicrometers()
- {
- return x;
- }
-
- /**
- * Return the size in y direction.
- *
- * @param units the units to use
- *
- * @return the size value
- *
- * @exception IllegalArgumentException if units < 1
- */
- public float getY(int units)
- {
- if (units < 1)
- throw new IllegalArgumentException("units may not be less then 1");
-
- return ((float) y) / ((float) units);
- }
-
- /**
- * Returns the size in y direction in mircometers.
- *
- * @return the size value
- */
- protected int getYMicrometers()
- {
- return y;
- }
-
- /**
- * Returns the hashcode for this object.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return x + y;
- }
-
- /**
- * Returns the string representation for this object.
- *
- * @return the string representation
- */
- public String toString()
- {
- return toString(1, "um");
- }
-
- /**
- * Returns the string representation for this object.
- *
- * @param units the units to use
- * @param unitsName the name of the units
- *
- * @return the string representation
- */
- public String toString(int units, String unitsName)
- {
- return "" + getX(units) + "x" + getY(units) + " " + unitsName;
- }
-}
diff --git a/libjava/javax/print/attribute/SupportedValuesAttribute.java b/libjava/javax/print/attribute/SupportedValuesAttribute.java
deleted file mode 100644
index d0f4b65c647..00000000000
--- a/libjava/javax/print/attribute/SupportedValuesAttribute.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Attribute.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- */
-public interface SupportedValuesAttribute extends Attribute
-{
-}
diff --git a/libjava/javax/print/attribute/TextSyntax.java b/libjava/javax/print/attribute/TextSyntax.java
deleted file mode 100644
index 98fabdc6777..00000000000
--- a/libjava/javax/print/attribute/TextSyntax.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* TextSyntax.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-import java.util.Locale;
-
-/**
- * @author Michael Koch
- */
-public abstract class TextSyntax implements Cloneable, Serializable
-{
- private static final long serialVersionUID = -8130648736378144102L;
-
- private String value;
- private Locale locale;
-
- /**
- * Creates a <code>TextSyntax</code> object with the given value
- * and locale.
- *
- * @param value the value for this syntax
- * @param locale the locale to use
- *
- * @exception NullPointerException if value and/or locale is null
- */
- protected TextSyntax(String value, Locale locale)
- {
- if (value == null || locale == null)
- throw new NullPointerException("value and/or locale may not be null");
-
- this.value = value;
- this.locale = locale;
- }
-
- /**
- * Returns the value of this syntax object.
- *
- * @return the value
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Returns the locale of this syntax object.
- *
- * @return the locale
- */
- public Locale getLocale()
- {
- return locale;
- }
-
- /**
- * Returns the hashcode for this object.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return value.hashCode() ^ locale.hashCode();
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof TextSyntax))
- return false;
-
- TextSyntax tmp = (TextSyntax) obj;
-
- return (value.equals(tmp.getValue())
- && locale.equals(tmp.getLocale()));
- }
-
- /**
- * Returns a string representing the object.
- */
- public String toString()
- {
- return getValue();
- }
-}
diff --git a/libjava/javax/print/attribute/URISyntax.java b/libjava/javax/print/attribute/URISyntax.java
deleted file mode 100644
index f0583f7e53c..00000000000
--- a/libjava/javax/print/attribute/URISyntax.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* URISyntax.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-import java.io.Serializable;
-import java.net.URI;
-
-/**
- * @author Michael Koch
- */
-public abstract class URISyntax
- implements Cloneable, Serializable
-{
- private static final long serialVersionUID = -7842661210486401678L;
-
- private URI uri;
-
- /**
- * Creates a <code>URISyntax</code> object.
- *
- * @param uri the URI value for the syntax
- *
- * @exception NullPointerException if uri is null
- */
- protected URISyntax(URI uri)
- {
- if (uri == null)
- throw new NullPointerException("uri may not be null");
-
- this.uri = uri;
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @returns true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof URISyntax))
- return false;
-
- return uri.equals(((URISyntax) obj).getURI());
- }
-
- /**
- * Returns the URI value of this syntax object.
- *
- * @return the URI
- */
- public URI getURI()
- {
- return uri;
- }
-
- /**
- * Returns the hashcode for this object.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return uri.hashCode();
- }
-
- /**
- * Returns the string representation for this object.
- *
- * @return the string representation
- */
- public String toString()
- {
- return uri.toString();
- }
-}
diff --git a/libjava/javax/print/attribute/UnmodifiableSetException.java b/libjava/javax/print/attribute/UnmodifiableSetException.java
deleted file mode 100644
index 678531769a5..00000000000
--- a/libjava/javax/print/attribute/UnmodifiableSetException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Attribute.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute;
-
-/**
- * @author Michael Koch
- *
- * @since 1.4
- */
-public class UnmodifiableSetException extends RuntimeException
-{
- /**
- * Creates a <code>UnmodifiableSetException</code>.
- */
- public UnmodifiableSetException()
- {
- super();
- }
-
- /**
- * Creates a <code>UnmodifiableSetException</code>
- * with the given message.
- *
- * @param message the message for the exception
- */
- public UnmodifiableSetException(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/javax/print/attribute/standard/Chromaticity.java b/libjava/javax/print/attribute/standard/Chromaticity.java
deleted file mode 100644
index 3d336a4822c..00000000000
--- a/libjava/javax/print/attribute/standard/Chromaticity.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Chromaticity.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class Chromaticity extends EnumSyntax
- implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
-{
- private static final long serialVersionUID = 4660543931355214012L;
-
- public static final Chromaticity MONOCHROME = new Chromaticity(0);
- public static final Chromaticity COLOR = new Chromaticity(1);
-
- /**
- * Creates a <code>Chromaticity</code> object.
- *
- * @param value the enum value
- */
- protected Chromaticity(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>Sides</code> itself
- */
- public Class getCategory()
- {
- return Chromaticity.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "chromaticity";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/ColorSupported.java b/libjava/javax/print/attribute/standard/ColorSupported.java
deleted file mode 100644
index fad7ced0191..00000000000
--- a/libjava/javax/print/attribute/standard/ColorSupported.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ColorSupported.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintServiceAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class ColorSupported extends EnumSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = -2700555589688535545L;
-
- public static final ColorSupported NOT_SUPPORTED = new ColorSupported(0);
- public static final ColorSupported SUPPORTED = new ColorSupported(1);
-
- /**
- * Constructs a <code>ColorSupported</code> object.
- *
- * @param value the value
- */
- protected ColorSupported(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>ColorSupported</code> itself
- */
- public Class getCategory()
- {
- return ColorSupported.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "color-supported";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/Compression.java b/libjava/javax/print/attribute/standard/Compression.java
deleted file mode 100644
index 112202a0b4a..00000000000
--- a/libjava/javax/print/attribute/standard/Compression.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Compression.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.EnumSyntax;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class Compression extends EnumSyntax
- implements DocAttribute
-{
- private static final long serialVersionUID = -5716748913324997674L;
-
- public static final Compression NONE = new Compression(0);
- public static final Compression DEFLATE = new Compression(1);
- public static final Compression GZIP = new Compression(2);
- public static final Compression COMPRESS = new Compression(3);
-
- /**
- * Constructs a <code>Compression</code> object.
- *
- * @param value that value
- */
- protected Compression(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>Compression</code> itself
- */
- public Class getCategory()
- {
- return Compression.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "compression";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/Copies.java b/libjava/javax/print/attribute/standard/Copies.java
deleted file mode 100644
index 7c5fdff0cc7..00000000000
--- a/libjava/javax/print/attribute/standard/Copies.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Copies.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-/**
- * @author Michael Koch
- */
-public final class Copies extends IntegerSyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = -6426631521680023833L;
-
- /**
- * Creates a <code>Copies</code> object.
- *
- * @param value the number of copies
- *
- * @exception IllegalArgumentException if value < 1
- */
- public Copies(int value)
- {
- super(value);
-
- if (value < 1)
- throw new IllegalArgumentException("value may not be less than 1");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof Copies))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>Copies</code> itself
- */
- public Class getCategory()
- {
- return Copies.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "copies"
- */
- public String getName()
- {
- return "copies";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/CopiesSupported.java b/libjava/javax/print/attribute/standard/CopiesSupported.java
deleted file mode 100644
index 8062ebca192..00000000000
--- a/libjava/javax/print/attribute/standard/CopiesSupported.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* CopiesSupported.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.SetOfIntegerSyntax;
-import javax.print.attribute.SupportedValuesAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class CopiesSupported extends SetOfIntegerSyntax
- implements SupportedValuesAttribute
-{
- private static final long serialVersionUID = 6927711687034846001L;
-
- /**
- * Constructs a <code>CopiesSupported</code> object.
- */
- public CopiesSupported(int member)
- {
- super(member);
- }
-
- /**
- * Constructs a <code>CopiesSupported</code> object.
- */
- public CopiesSupported(int lowerBound, int upperBound)
- {
- super(lowerBound, upperBound);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>CopiesSupported</code> itself
- */
- public Class getCategory()
- {
- return CopiesSupported.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "copies-supported";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/DateTimeAtCompleted.java b/libjava/javax/print/attribute/standard/DateTimeAtCompleted.java
deleted file mode 100644
index fbb9e084a20..00000000000
--- a/libjava/javax/print/attribute/standard/DateTimeAtCompleted.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* DateTimeAtCompleted.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Date;
-
-import javax.print.attribute.DateTimeSyntax;
-import javax.print.attribute.PrintJobAttribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class DateTimeAtCompleted extends DateTimeSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = 6497399708058490000L;
-
- /**
- * Creates a <code>DateTimeAtCompleted</code> object.
- *
- * @param value the date at completion time
- *
- * @exception NullPointerException if value is null
- */
- public DateTimeAtCompleted(Date value)
- {
- super(value);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof DateTimeAtCompleted))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>DateTimeAtCompleted</code> itself
- */
- public Class getCategory()
- {
- return DateTimeAtCompleted.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "date-time-at-completed"
- */
- public String getName()
- {
- return "date-time-at-completed";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/DateTimeAtCreation.java b/libjava/javax/print/attribute/standard/DateTimeAtCreation.java
deleted file mode 100644
index b98af57a7c7..00000000000
--- a/libjava/javax/print/attribute/standard/DateTimeAtCreation.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* DateTimeAtCreation.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Date;
-
-import javax.print.attribute.DateTimeSyntax;
-import javax.print.attribute.PrintJobAttribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class DateTimeAtCreation extends DateTimeSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = -2923732231056647903L;
-
- /**
- * Creates a <code>DateTimeAtCreation</code> object.
- *
- * @param value the date at creation time
- *
- * @exception NullPointerException if value is null
- */
- public DateTimeAtCreation(Date value)
- {
- super(value);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof DateTimeAtCreation))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>DateTimeAtCreation</code> itself
- */
- public Class getCategory()
- {
- return DateTimeAtCreation.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "date-time-at-creation"
- */
- public String getName()
- {
- return "date-time-at-creation";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/DateTimeAtProcessing.java b/libjava/javax/print/attribute/standard/DateTimeAtProcessing.java
deleted file mode 100644
index ff537b98a85..00000000000
--- a/libjava/javax/print/attribute/standard/DateTimeAtProcessing.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* DateTimeAtProcessing.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Date;
-
-import javax.print.attribute.DateTimeSyntax;
-import javax.print.attribute.PrintJobAttribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class DateTimeAtProcessing extends DateTimeSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = -3710068197278263244L;
-
- /**
- * Creates a <code>DateTimeAtProcessing</code> object.
- *
- * @param value the date at processing time
- *
- * @exception NullPointerException if value is null
- */
- public DateTimeAtProcessing(Date value)
- {
- super(value);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof DateTimeAtProcessing))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>DateTimeAtProcessing</code> itself
- */
- public Class getCategory()
- {
- return DateTimeAtProcessing.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "date-time-at-processing"
- */
- public String getName()
- {
- return "date-time-at-processing";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/Destination.java b/libjava/javax/print/attribute/standard/Destination.java
deleted file mode 100644
index c2da19926f4..00000000000
--- a/libjava/javax/print/attribute/standard/Destination.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Destination.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.net.URI;
-
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.URISyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class Destination extends URISyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = 6776739171700415321L;
-
- /**
- * Constructs a <code>Destination</code> object.
- */
- public Destination(URI uri)
- {
- super(uri);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>Destination</code> itself
- */
- public Class getCategory()
- {
- return Destination.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "printer-uri"
- */
- public String getName()
- {
- return "destination";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/DocumentName.java b/libjava/javax/print/attribute/standard/DocumentName.java
deleted file mode 100644
index 2c472aa2012..00000000000
--- a/libjava/javax/print/attribute/standard/DocumentName.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* DocumentName.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class DocumentName extends TextSyntax
- implements DocAttribute
-{
- private static final long serialVersionUID = 7883105848533280430L;
-
- /**
- * Creates a <code>DocumentName</code> object.
- *
- * @param documentName the document name
- *
- * @exception NullPointerException if documentName is null
- */
- public DocumentName(String documentName, Locale locale)
- {
- super(documentName, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof DocumentName))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>DocumentName</code> itself
- */
- public Class getCategory()
- {
- return DocumentName.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "document-name"
- */
- public String getName()
- {
- return "document-name";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/Fidelity.java b/libjava/javax/print/attribute/standard/Fidelity.java
deleted file mode 100644
index 9b26906fdb6..00000000000
--- a/libjava/javax/print/attribute/standard/Fidelity.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Fidelity.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class Fidelity extends EnumSyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = 6320827847329172308L;
-
- public static final Fidelity FIDELITY_TRUE = new Fidelity(0);
- public static final Fidelity FIDELITY_FALSE = new Fidelity(1);
-
- /**
- * Constructs a <code>Fidelity</code> object.
- *
- * @param value the value
- */
- protected Fidelity(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>Fidelity</code> itself
- */
- public Class getCategory()
- {
- return Fidelity.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "fidelity";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/Finishings.java b/libjava/javax/print/attribute/standard/Finishings.java
deleted file mode 100644
index 1224c1da163..00000000000
--- a/libjava/javax/print/attribute/standard/Finishings.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Finishings.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class Finishings extends EnumSyntax
- implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = -627840419548391754L;
-
- public static final Finishings NONE = new Finishings(0);
- public static final Finishings STAPLE = new Finishings(1);
- public static final Finishings COVER = new Finishings(2);
- public static final Finishings BIND = new Finishings(3);
- public static final Finishings SADDLE_STITCH = new Finishings(4);
- public static final Finishings EDGE_STITCH = new Finishings(5);
- public static final Finishings STAPLE_TOP_LEFT = new Finishings(6);
- public static final Finishings STAPLE_BOTTOM_LEFT = new Finishings(7);
- public static final Finishings STAPLE_TOP_RIGHT = new Finishings(8);
- public static final Finishings STAPLE_BOTTOM_RIGHT = new Finishings(9);
- public static final Finishings EDGE_STITCH_LEFT = new Finishings(10);
- public static final Finishings EDGE_STITCH_TOP = new Finishings(11);
- public static final Finishings EDGE_STITCH_RIGHT = new Finishings(12);
- public static final Finishings EDGE_STITCH_BOTTOM = new Finishings(13);
- public static final Finishings STAPLE_DUAL_LEFT = new Finishings(14);
- public static final Finishings STAPLE_DUAL_TOP = new Finishings(15);
- public static final Finishings STAPLE_DUAL_RIGHT = new Finishings(16);
- public static final Finishings STAPLE_DUAL_BOTTOM = new Finishings(17);
-
- /**
- * Constructs a <code>Finishings</code> object.
- *
- * @param value the value
- */
- protected Finishings(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>Finishings</code> itself
- */
- public Class getCategory()
- {
- return Finishings.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "finishings";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobHoldUntil.java b/libjava/javax/print/attribute/standard/JobHoldUntil.java
deleted file mode 100644
index 5f054638280..00000000000
--- a/libjava/javax/print/attribute/standard/JobHoldUntil.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* JobHoldUntil.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Date;
-
-import javax.print.attribute.DateTimeSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobHoldUntil extends DateTimeSyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = -1664471048860415024L;
-
- /**
- * Creates a <code>JobHoldUntil</code> object.
- *
- * @param value the date to hold the job until
- *
- * @exception NullPointerException if value is null
- */
- public JobHoldUntil(Date value)
- {
- super(value);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobHoldUntil))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobHoldUntil</code> itself
- */
- public Class getCategory()
- {
- return JobHoldUntil.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-hold-until"
- */
- public String getName()
- {
- return "job-hold-until";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobImpressions.java b/libjava/javax/print/attribute/standard/JobImpressions.java
deleted file mode 100644
index a29c24cd4e2..00000000000
--- a/libjava/javax/print/attribute/standard/JobImpressions.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* JobImpressions.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-/**
- * @author Michael Koch
- */
-public final class JobImpressions extends IntegerSyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = 8225537206784322464L;
-
- /**
- * Creates a <code>JobImpressions</code> object.
- *
- * @param value the number of impressions
- *
- * @exception IllegalArgumentException if value < 0
- */
- public JobImpressions(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobImpressions))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobImpressions</code> itself
- */
- public Class getCategory()
- {
- return JobImpressions.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-impressions"
- */
- public String getName()
- {
- return "job-impressions";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobImpressionsCompleted.java b/libjava/javax/print/attribute/standard/JobImpressionsCompleted.java
deleted file mode 100644
index d1b3e964e23..00000000000
--- a/libjava/javax/print/attribute/standard/JobImpressionsCompleted.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* JobImpressionsCompleted.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobImpressionsCompleted extends IntegerSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = 6722648442432393294L;
-
- /**
- * Creates a <code>JobImpressionsCompleted</code> object.
- *
- * @param value the number of completed impressions
- *
- * @exception IllegalArgumentException if value < 0
- */
- public JobImpressionsCompleted(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobImpressionsCompleted))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobImpressionsCompleted</code> itself
- */
- public Class getCategory()
- {
- return JobImpressionsCompleted.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-impressions-completed"
- */
- public String getName()
- {
- return "job-impressions";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobImpressionsSupported.java b/libjava/javax/print/attribute/standard/JobImpressionsSupported.java
deleted file mode 100644
index 0ba7089c6d3..00000000000
--- a/libjava/javax/print/attribute/standard/JobImpressionsSupported.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* JobImpressionsSupported.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.SetOfIntegerSyntax;
-import javax.print.attribute.SupportedValuesAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobImpressionsSupported extends SetOfIntegerSyntax
- implements SupportedValuesAttribute
-{
- private static final long serialVersionUID = -4887354803843173692L;
-
- /**
- * Constructs a <code>JobImpressionsSupported</code> object.
- */
- public JobImpressionsSupported(int lowerBound, int upperBound)
- {
- super(lowerBound, upperBound);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobImpressionsSupported</code> itself
- */
- public Class getCategory()
- {
- return JobImpressionsSupported.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "job-impressions-supported";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobKOctets.java b/libjava/javax/print/attribute/standard/JobKOctets.java
deleted file mode 100644
index 71f02c577a7..00000000000
--- a/libjava/javax/print/attribute/standard/JobKOctets.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* JobKOctets.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-/**
- * @author Michael Koch
- */
-public final class JobKOctets extends IntegerSyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = -8959710146498202869L;
-
- /**
- * Creates a <code>JobKOctets</code> object.
- *
- * @param value the number of K octets
- *
- * @exception IllegalArgumentException if value < 0
- */
- public JobKOctets(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobKOctets))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobKOctets</code> itself
- */
- public Class getCategory()
- {
- return JobKOctets.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-k-octets"
- */
- public String getName()
- {
- return "job-k-octets";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobKOctetsProcessed.java b/libjava/javax/print/attribute/standard/JobKOctetsProcessed.java
deleted file mode 100644
index 7561222ca6a..00000000000
--- a/libjava/javax/print/attribute/standard/JobKOctetsProcessed.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* JobKOctetsProcessed.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-
-/**
- * @author Michael Koch
- */
-public final class JobKOctetsProcessed extends IntegerSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = -6265238509657881806L;
-
- /**
- * Creates a <code>JobKOctetsProcessed</code> object.
- *
- * @param value the number of processed K octets
- *
- * @exception IllegalArgumentException if value < 0
- */
- public JobKOctetsProcessed(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobKOctetsProcessed))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobKOctetsProcessed</code> itself
- */
- public Class getCategory()
- {
- return JobKOctetsProcessed.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-k-octets-processed"
- */
- public String getName()
- {
- return "job-k-octets-processed";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobKOctetsSupported.java b/libjava/javax/print/attribute/standard/JobKOctetsSupported.java
deleted file mode 100644
index 303dc953bd0..00000000000
--- a/libjava/javax/print/attribute/standard/JobKOctetsSupported.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* JobKOctetsSupported.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.SetOfIntegerSyntax;
-import javax.print.attribute.SupportedValuesAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobKOctetsSupported extends SetOfIntegerSyntax
- implements SupportedValuesAttribute
-{
- private static final long serialVersionUID = -2867871140549897443L;
-
- /**
- * Constructs a <code>JobKOctetsSupported</code> object.
- */
- public JobKOctetsSupported(int lowerBound, int upperBound)
- {
- super(lowerBound, upperBound);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>ColorSupported</code> itself
- */
- public Class getCategory()
- {
- return JobKOctetsSupported.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "job-k-octets-supported";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobMediaSheets.java b/libjava/javax/print/attribute/standard/JobMediaSheets.java
deleted file mode 100644
index 662c54acb22..00000000000
--- a/libjava/javax/print/attribute/standard/JobMediaSheets.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* JobMediaSheets.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-/**
- * @author Michael Koch
- */
-public class JobMediaSheets extends IntegerSyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = 408871131531979741L;
-
- /**
- * Creates a <code>JobMediaSheets</code> object.
- *
- * @param value the number of media sheets for a print job
- *
- * @exception IllegalArgumentException if value < 0
- */
- public JobMediaSheets(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobMediaSheets))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobMediaSheets</code> itself
- */
- public Class getCategory()
- {
- return JobMediaSheets.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-media-sheets"
- */
- public String getName()
- {
- return "job-media-sheets";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobMediaSheetsCompleted.java b/libjava/javax/print/attribute/standard/JobMediaSheetsCompleted.java
deleted file mode 100644
index 09b82bfcdcc..00000000000
--- a/libjava/javax/print/attribute/standard/JobMediaSheetsCompleted.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* JobMediaSheetsCompleted.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-
-/**
- * @author Michael Koch
- */
-public final class JobMediaSheetsCompleted extends IntegerSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = 1739595973810840475L;
-
- /**
- * Creates a <code>JobMediaSheetsCompleted</code> object.
- *
- * @param value the number of completed media sheets for a print job
- *
- * @exception IllegalArgumentException if value < 0
- */
- public JobMediaSheetsCompleted(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobMediaSheetsCompleted))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobMediaSheetsCompleted</code> itself
- */
- public Class getCategory()
- {
- return JobMediaSheetsCompleted.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-media-sheets-completed"
- */
- public String getName()
- {
- return "job-media-sheets-completed";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobMediaSheetsSupported.java b/libjava/javax/print/attribute/standard/JobMediaSheetsSupported.java
deleted file mode 100644
index 392fe7ed708..00000000000
--- a/libjava/javax/print/attribute/standard/JobMediaSheetsSupported.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* JobMediaSheetsSupported.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.SetOfIntegerSyntax;
-import javax.print.attribute.SupportedValuesAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobMediaSheetsSupported extends SetOfIntegerSyntax
- implements SupportedValuesAttribute
-{
- private static final long serialVersionUID = 2953685470388672940L;
-
- /**
- * Constructs a <code>JobMediaSheetsSupported</code> object.
- */
- public JobMediaSheetsSupported(int lowerBound, int upperBound)
- {
- super(lowerBound, upperBound);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobMediaSheetsSupported</code> itself
- */
- public Class getCategory()
- {
- return JobMediaSheetsSupported.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "job-media-sheets-supported";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobMessageFromOperator.java b/libjava/javax/print/attribute/standard/JobMessageFromOperator.java
deleted file mode 100644
index 84eab8b6219..00000000000
--- a/libjava/javax/print/attribute/standard/JobMessageFromOperator.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* JobMessageFromOperator.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobMessageFromOperator extends TextSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = -4620751846003142047L;
-
- /**
- * Creates a <code>JobMessageFromOperator</code> object.
- *
- * @param message the message
- *
- * @exception NullPointerException if message is null
- */
- public JobMessageFromOperator(String message, Locale locale)
- {
- super(message, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobMessageFromOperator))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobMessageFromOperator</code> itself
- */
- public Class getCategory()
- {
- return JobMessageFromOperator.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-message-from-operator"
- */
- public String getName()
- {
- return "job-message-from-operator";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobName.java b/libjava/javax/print/attribute/standard/JobName.java
deleted file mode 100644
index a64a88cf395..00000000000
--- a/libjava/javax/print/attribute/standard/JobName.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* JobName.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobName extends TextSyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = 4660359192078689545L;
-
- /**
- * Creates a <code>JobName</code> object.
- *
- * @param jobName the job name
- *
- * @exception NullPointerException if jobName is null
- */
- public JobName(String jobName, Locale locale)
- {
- super(jobName, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobName))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobName</code> itself
- */
- public Class getCategory()
- {
- return JobName.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-name"
- */
- public String getName()
- {
- return "job-name";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobOriginatingUserName.java b/libjava/javax/print/attribute/standard/JobOriginatingUserName.java
deleted file mode 100644
index 116de28cfb7..00000000000
--- a/libjava/javax/print/attribute/standard/JobOriginatingUserName.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* JobOriginatingUserName.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobOriginatingUserName extends TextSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = -8052537926362933477L;
-
- /**
- * Creates a <code>JobOriginatingUserName</code> object.
- *
- * @param userName the user name
- *
- * @exception NullPointerException if userName is null
- */
- public JobOriginatingUserName(String userName, Locale locale)
- {
- super(userName, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobOriginatingUserName))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobOriginatingUserName</code> itself
- */
- public Class getCategory()
- {
- return JobOriginatingUserName.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-originating-user-name"
- */
- public String getName()
- {
- return "job-originating-user-name";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobPriority.java b/libjava/javax/print/attribute/standard/JobPriority.java
deleted file mode 100644
index 6c88dfc9ee5..00000000000
--- a/libjava/javax/print/attribute/standard/JobPriority.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* JobPriority.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobPriority extends IntegerSyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = -4599900369040602769L;
-
- /**
- * Creates a <code>JobPriority</code> object.
- *
- * @param value the priority
- *
- * @exception IllegalArgumentException if value < 1 or value > 100
- */
- public JobPriority(int value)
- {
- super(value);
-
- if (value < 1 || value > 100)
- throw new IllegalArgumentException("value out of range");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobPriority))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobPriority</code> itself
- */
- public Class getCategory()
- {
- return JobPriority.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-priority"
- */
- public String getName()
- {
- return "job-priority";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobPrioritySupported.java b/libjava/javax/print/attribute/standard/JobPrioritySupported.java
deleted file mode 100644
index fdfe6c7c587..00000000000
--- a/libjava/javax/print/attribute/standard/JobPrioritySupported.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* JobPrioritySupported.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.SupportedValuesAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobPrioritySupported extends IntegerSyntax
- implements SupportedValuesAttribute
-{
- private static final long serialVersionUID = 2564840378013555894L;
-
- /**
- * Creates a <code>JobPrioritySupported</code> object.
- *
- * @param value the priority
- *
- * @exception IllegalArgumentException if value < 1 or value > 100
- */
- public JobPrioritySupported(int value)
- {
- super(value);
-
- if (value < 1 || value > 100)
- throw new IllegalArgumentException("value out of range");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof JobPrioritySupported))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobPrioritySupported</code> itself
- */
- public Class getCategory()
- {
- return JobPrioritySupported.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "job-priority-supported"
- */
- public String getName()
- {
- return "job-priority-supported";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobSheets.java b/libjava/javax/print/attribute/standard/JobSheets.java
deleted file mode 100644
index 183aed2a124..00000000000
--- a/libjava/javax/print/attribute/standard/JobSheets.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* JobSheets.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class JobSheets extends EnumSyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = -4735258056132519759L;
-
- public static final JobSheets NONE = new JobSheets(0);
- public static final JobSheets STANDARD = new JobSheets(1);
-
- /**
- * Constructs a <code>JobSheets</code> object.
- */
- protected JobSheets(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobSheets</code> itself
- */
- public Class getCategory()
- {
- return JobSheets.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "job-sheets";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobState.java b/libjava/javax/print/attribute/standard/JobState.java
deleted file mode 100644
index 1350e697f87..00000000000
--- a/libjava/javax/print/attribute/standard/JobState.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* JobState.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class JobState extends EnumSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = 400465010094018920L;
-
- public static final JobState UNKNOWN = new JobState(0);
- public static final JobState PENDING = new JobState(1);
- public static final JobState PENDING_HELD = new JobState(2);
- public static final JobState PROCESSING = new JobState(3);
- public static final JobState PROCESSING_STOPPED = new JobState(4);
- public static final JobState CANCELED = new JobState(5);
- public static final JobState ABORTED = new JobState(6);
- public static final JobState COMPLETED = new JobState(7);
-
- /**
- * Constructs a <code>JobState</code> object.
- */
- protected JobState(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobState</code> itself
- */
- public Class getCategory()
- {
- return JobState.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "job-state";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobStateReason.java b/libjava/javax/print/attribute/standard/JobStateReason.java
deleted file mode 100644
index 4a9f1a91a98..00000000000
--- a/libjava/javax/print/attribute/standard/JobStateReason.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* JobStateReason.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.Attribute;
-import javax.print.attribute.EnumSyntax;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class JobStateReason extends EnumSyntax
- implements Attribute
-{
- private static final long serialVersionUID = -8765894420449009168L;
-
- public static final JobStateReason JOB_INCOMING = new JobStateReason(0);
- public static final JobStateReason JOB_DATA_INSUFFICIENT = new JobStateReason(1);
- public static final JobStateReason DOCUMENT_ACCESS_ERROR = new JobStateReason(2);
- public static final JobStateReason SUBMISSION_INTERRUPTED = new JobStateReason(3);
- public static final JobStateReason JOB_OUTGOING = new JobStateReason(4);
- public static final JobStateReason JOB_HOLD_UNTIL_SPECIFIED = new JobStateReason(5);
- public static final JobStateReason RESOURCES_ARE_NOT_READY = new JobStateReason(6);
- public static final JobStateReason PRINTER_STOPPED_PARTLY = new JobStateReason(7);
- public static final JobStateReason PRINTER_STOPPED = new JobStateReason(8);
- public static final JobStateReason JOB_INTERPRETING = new JobStateReason(9);
- public static final JobStateReason JOB_QUEUED = new JobStateReason(10);
- public static final JobStateReason JOB_TRANSFORMING = new JobStateReason(11);
- public static final JobStateReason JOB_QUEUED_FOR_MARKER = new JobStateReason(12);
- public static final JobStateReason JOB_PRINTING = new JobStateReason(13);
- public static final JobStateReason JOB_CANCELED_BY_USER = new JobStateReason(14);
- public static final JobStateReason JOB_CANCELED_BY_OPERATOR = new JobStateReason(15);
- public static final JobStateReason JOB_CANCELED_AT_DEVICE = new JobStateReason(16);
- public static final JobStateReason ABORTED_BY_SYSTEM = new JobStateReason(17);
- public static final JobStateReason UNSUPPORTED_COMPRESSION = new JobStateReason(18);
- public static final JobStateReason COMPRESSION_ERROR = new JobStateReason(19);
- public static final JobStateReason UNSUPPORTED_DOCUMENT_FORMAT = new JobStateReason(20);
- public static final JobStateReason DOCUMENT_FORMAT_ERROR = new JobStateReason(21);
- public static final JobStateReason PROCESSING_TO_STOP_POINT = new JobStateReason(22);
- public static final JobStateReason SERVICE_OFF_LINE = new JobStateReason(23);
- public static final JobStateReason JOB_COMPLETED_SUCCESSFULLY = new JobStateReason(24);
- public static final JobStateReason JOB_COMPLETED_WITH_WARNINGS = new JobStateReason(25);
- public static final JobStateReason JOB_COMPLETED_WITH_ERRORS = new JobStateReason(26);
- public static final JobStateReason JOB_RESTARTABLE = new JobStateReason(27);
- public static final JobStateReason QUEUED_IN_DEVICE = new JobStateReason(28);
-
- /**
- * Constructs a <code>JobStateReason</code> object.
- */
- protected JobStateReason(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>JobStateReason</code> itself
- */
- public Class getCategory()
- {
- return JobStateReason.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "job-state-reason";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/JobStateReasons.java b/libjava/javax/print/attribute/standard/JobStateReasons.java
deleted file mode 100644
index 39187373ded..00000000000
--- a/libjava/javax/print/attribute/standard/JobStateReasons.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* JobStateReasons.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.HashSet;
-
-import javax.print.attribute.PrintJobAttribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class JobStateReasons extends HashSet
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = 8849088261264331812L;
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>ColorSupported</code> itself
- */
- public Class getCategory()
- {
- return JobStateReasons.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "job-state-reasons";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/Media.java b/libjava/javax/print/attribute/standard/Media.java
deleted file mode 100644
index ebb15d0d074..00000000000
--- a/libjava/javax/print/attribute/standard/Media.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Media.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class Media extends EnumSyntax
- implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
-{
- private static final long serialVersionUID = -2823970704630722439L;
-
- /**
- * Constructs a <code>Media</code> object.
- */
- protected Media(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>Media</code> itself
- */
- public Class getCategory()
- {
- return Media.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "media";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/MediaPrintableArea.java b/libjava/javax/print/attribute/standard/MediaPrintableArea.java
deleted file mode 100644
index c7cf8d3a991..00000000000
--- a/libjava/javax/print/attribute/standard/MediaPrintableArea.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/* MediaPrintableArea.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class MediaPrintableArea
- implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = -1597171464050795793L;
-
- public static final int INCH = 25400;
- public static final int MM = 1000;
-
- private float x;
- private float y;
- private float width;
- private float height;
-
- /**
- * Creates a new <code>MediaPrintableArea</code> object.
- *
- * @throws IllegalArgumentException if x i&lt; 0 or y i&lt; 0 or w i&lt;= 0
- * or h i&lt;= 0 or units i&lt; 1
- */
- public MediaPrintableArea(float x, float y, float w, float h, int units)
- {
- if (x < 0.0f || y < 0.0f || w <= 0.0f || h <= 0.0f)
- throw new IllegalArgumentException();
-
- this.x = x;
- this.y = y;
- this.width = w;
- this.height = h;
- }
-
- /**
- * Creates a new <code>MediaPrintableArea</code> object.
- *
- * @throws IllegalArgumentException if x i&lt; 0 or y i&lt; 0 or w i&lt;= 0
- * or h i&lt;= 0 or units i&lt; 1
- */
- public MediaPrintableArea(int x, int y, int w, int h, int units)
- {
- if (x < 0 || y < 0 || w <= 0 || h <= 0)
- throw new IllegalArgumentException();
-
- this.x = x;
- this.y = y;
- this.width = w;
- this.height = h;
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>MediaPrintableArea</code> itself
- */
- public Class getCategory()
- {
- return MediaPrintableArea.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "media-printable-area"
- */
- public String getName()
- {
- return "media-printable-area";
- }
-
- public float getHeight(int units)
- {
- if (units < 1)
- throw new IllegalArgumentException();
-
- return height * units;
- }
-
- public float getWidth(int units)
- {
- if (units < 1)
- throw new IllegalArgumentException();
-
- return width * units;
- }
-
- public float getX(int units)
- {
- if (units < 1)
- throw new IllegalArgumentException();
-
- return x * units;
- }
-
- public float getY(int units)
- {
- if (units < 1)
- throw new IllegalArgumentException();
-
- return y * units;
- }
-}
diff --git a/libjava/javax/print/attribute/standard/MediaSize.java b/libjava/javax/print/attribute/standard/MediaSize.java
deleted file mode 100644
index 6abf97974bd..00000000000
--- a/libjava/javax/print/attribute/standard/MediaSize.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* MediaSize.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.ArrayList;
-
-import javax.print.attribute.Attribute;
-import javax.print.attribute.Size2DSyntax;
-
-public class MediaSize extends Size2DSyntax
- implements Attribute
-{
- private static final long serialVersionUID = -1967958664615414771L;
-
- private static ArrayList mediaCache = new ArrayList();
-
- private MediaSizeName media;
-
- public MediaSize(float x, float y, int units)
- {
- super(x, y, units);
- }
-
- public MediaSize(float x, float y, int units, MediaSizeName media)
- {
- super(x, y, units);
- this.media = media;
- }
-
- public MediaSize(int x, int y, int units)
- {
- super(x, y, units);
- }
-
- public MediaSize(int x, int y, int units, MediaSizeName media)
- {
- super(x, y, units);
- this.media = media;
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>MediaSize</code> itself
- */
- public Class getCategory()
- {
- return MediaSize.class;
- }
-
- public static MediaSize getMediaSizeForName(MediaSizeName media)
- {
- for (int i = 0; i < mediaCache.size(); i++)
- {
- MediaSize size = (MediaSize) mediaCache.get(i);
-
- if (size.getMediaSizeName().equals(media))
- return size;
- }
-
- return null;
- }
-
- public MediaSizeName getMediaSizeName()
- {
- return media;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "media-size"
- */
- public String getName()
- {
- return "media-size";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/MediaSizeName.java b/libjava/javax/print/attribute/standard/MediaSizeName.java
deleted file mode 100644
index 9990a2def42..00000000000
--- a/libjava/javax/print/attribute/standard/MediaSizeName.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/* MediaSizeName.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class MediaSizeName extends Media
-{
- private static final long serialVersionUID = 2778798329756942747L;
-
- public static final MediaSizeName ISO_A0 = new MediaSizeName(0);
- public static final MediaSizeName ISO_A1 = new MediaSizeName(1);
- public static final MediaSizeName ISO_A2 = new MediaSizeName(2);
- public static final MediaSizeName ISO_A3 = new MediaSizeName(3);
- public static final MediaSizeName ISO_A4 = new MediaSizeName(4);
- public static final MediaSizeName ISO_A5 = new MediaSizeName(5);
- public static final MediaSizeName ISO_A6 = new MediaSizeName(6);
- public static final MediaSizeName ISO_A7 = new MediaSizeName(7);
- public static final MediaSizeName ISO_A8 = new MediaSizeName(8);
- public static final MediaSizeName ISO_A9 = new MediaSizeName(9);
- public static final MediaSizeName ISO_A10 = new MediaSizeName(10);
- public static final MediaSizeName ISO_B0 = new MediaSizeName(11);
- public static final MediaSizeName ISO_B1 = new MediaSizeName(12);
- public static final MediaSizeName ISO_B2 = new MediaSizeName(13);
- public static final MediaSizeName ISO_B3 = new MediaSizeName(14);
- public static final MediaSizeName ISO_B4 = new MediaSizeName(15);
- public static final MediaSizeName ISO_B5 = new MediaSizeName(16);
- public static final MediaSizeName ISO_B6 = new MediaSizeName(17);
- public static final MediaSizeName ISO_B7 = new MediaSizeName(18);
- public static final MediaSizeName ISO_B8 = new MediaSizeName(19);
- public static final MediaSizeName ISO_B9 = new MediaSizeName(20);
- public static final MediaSizeName ISO_B10 = new MediaSizeName(21);
- public static final MediaSizeName JIS_B0 = new MediaSizeName(22);
- public static final MediaSizeName JIS_B1 = new MediaSizeName(23);
- public static final MediaSizeName JIS_B2 = new MediaSizeName(24);
- public static final MediaSizeName JIS_B3 = new MediaSizeName(25);
- public static final MediaSizeName JIS_B4 = new MediaSizeName(26);
- public static final MediaSizeName JIS_B5 = new MediaSizeName(27);
- public static final MediaSizeName JIS_B6 = new MediaSizeName(28);
- public static final MediaSizeName JIS_B7 = new MediaSizeName(29);
- public static final MediaSizeName JIS_B8 = new MediaSizeName(30);
- public static final MediaSizeName JIS_B9 = new MediaSizeName(31);
- public static final MediaSizeName JIS_B10 = new MediaSizeName(32);
- public static final MediaSizeName ISO_C0 = new MediaSizeName(33);
- public static final MediaSizeName ISO_C1 = new MediaSizeName(34);
- public static final MediaSizeName ISO_C2 = new MediaSizeName(35);
- public static final MediaSizeName ISO_C3 = new MediaSizeName(36);
- public static final MediaSizeName ISO_C4 = new MediaSizeName(37);
- public static final MediaSizeName ISO_C5 = new MediaSizeName(38);
- public static final MediaSizeName ISO_C6 = new MediaSizeName(39);
- public static final MediaSizeName NA_LETTER = new MediaSizeName(40);
- public static final MediaSizeName NA_LEGAL = new MediaSizeName(41);
- public static final MediaSizeName EXECUTIVE = new MediaSizeName(42);
- public static final MediaSizeName LEDGER = new MediaSizeName(43);
- public static final MediaSizeName TABLOID = new MediaSizeName(44);
- public static final MediaSizeName INVOICE = new MediaSizeName(45);
- public static final MediaSizeName FOLIO = new MediaSizeName(46);
- public static final MediaSizeName QUARTO = new MediaSizeName(47);
- public static final MediaSizeName JAPANESE_POSTCARD = new MediaSizeName(48);
- public static final MediaSizeName JAPANESE_DOUBLE_POSTCARD =
- new MediaSizeName(49);
- public static final MediaSizeName A = new MediaSizeName(50);
- public static final MediaSizeName B = new MediaSizeName(51);
- public static final MediaSizeName C = new MediaSizeName(52);
- public static final MediaSizeName D = new MediaSizeName(53);
- public static final MediaSizeName E = new MediaSizeName(54);
- public static final MediaSizeName ISO_DESIGNATED_LONG =
- new MediaSizeName(55);
- public static final MediaSizeName ITALY_ENVELOPE = new MediaSizeName(56);
- public static final MediaSizeName MONARCH_ENVELOPE = new MediaSizeName(57);
- public static final MediaSizeName PERSONAL_ENVELOPE = new MediaSizeName(58);
- public static final MediaSizeName NA_NUMBER_9_ENVELOPE =
- new MediaSizeName(59);
- public static final MediaSizeName NA_NUMBER_10_ENVELOPE =
- new MediaSizeName(60);
- public static final MediaSizeName NA_NUMBER_11_ENVELOPE =
- new MediaSizeName(61);
- public static final MediaSizeName NA_NUMBER_12_ENVELOPE =
- new MediaSizeName(62);
- public static final MediaSizeName NA_NUMBER_14_ENVELOPE =
- new MediaSizeName(63);
- public static final MediaSizeName NA_6X9_ENVELOPE = new MediaSizeName(64);
- public static final MediaSizeName NA_7X9_ENVELOPE = new MediaSizeName(65);
- public static final MediaSizeName NA_9X11_ENVELOPE = new MediaSizeName(66);
- public static final MediaSizeName NA_9X12_ENVELOPE = new MediaSizeName(67);
- public static final MediaSizeName NA_10X13_ENVELOPE = new MediaSizeName(68);
- public static final MediaSizeName NA_10X14_ENVELOPE = new MediaSizeName(69);
- public static final MediaSizeName NA_10X15_ENVELOPE = new MediaSizeName(70);
- public static final MediaSizeName NA_5X7 = new MediaSizeName(71);
- public static final MediaSizeName NA_8X10 = new MediaSizeName(72);
-
- /**
- * Constructs a <code>MediaSizeName</code> object.
- */
- protected MediaSizeName(int value)
- {
- super(value);
- }
-}
diff --git a/libjava/javax/print/attribute/standard/MultipleDocumentHandling.java b/libjava/javax/print/attribute/standard/MultipleDocumentHandling.java
deleted file mode 100644
index 8298092b0d7..00000000000
--- a/libjava/javax/print/attribute/standard/MultipleDocumentHandling.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* MultipleDocumentHandling.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class MultipleDocumentHandling extends EnumSyntax
- implements PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = 8098326460746413466L;
-
- public static final MultipleDocumentHandling SINGLE_DOCUMENT =
- new MultipleDocumentHandling(0);
- public static final MultipleDocumentHandling SEPARATE_DOCUMENTS_UNCOLLATED_COPIES =
- new MultipleDocumentHandling(1);
- public static final MultipleDocumentHandling SEPARATE_DOCUMENTS_COLLATED_COPIES =
- new MultipleDocumentHandling(2);
- public static final MultipleDocumentHandling SINGLE_DOCUMENT_NEW_SHEET =
- new MultipleDocumentHandling(3);
-
- /**
- * Constructs a <code>MultipleDocumentHandling</code> object.
- */
- protected MultipleDocumentHandling(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>MultipleDocumentHandling</code> itself
- */
- public Class getCategory()
- {
- return MultipleDocumentHandling.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "multiple-document-handling";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/NumberOfDocuments.java b/libjava/javax/print/attribute/standard/NumberOfDocuments.java
deleted file mode 100644
index cf2e9dccada..00000000000
--- a/libjava/javax/print/attribute/standard/NumberOfDocuments.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* NumberOfDocuments.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-
-/**
- * @author Michael Koch
- */
-public final class NumberOfDocuments extends IntegerSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = 7891881310684461097L;
-
- /**
- * Creates a <code>NumberOfDocuments</code> object.
- *
- * @param value the number of documents
- *
- * @exception IllegalArgumentException if value < 0
- */
- public NumberOfDocuments(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof NumberOfDocuments))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>NumberOfDocuments</code> itself
- */
- public Class getCategory()
- {
- return NumberOfDocuments.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "number-of-documents"
- */
- public String getName()
- {
- return "number-of-documents";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/NumberOfInterveningJobs.java b/libjava/javax/print/attribute/standard/NumberOfInterveningJobs.java
deleted file mode 100644
index 1da2e1b466a..00000000000
--- a/libjava/javax/print/attribute/standard/NumberOfInterveningJobs.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* NumberOfInterveningJobs.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-
-/**
- * @author Michael Koch
- */
-public final class NumberOfInterveningJobs extends IntegerSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = 2568141124844982746L;
-
- /**
- * Creates a <code>NumberOfInterveningJobs</code> object.
- *
- * @param value the number of intervening jobs
- *
- * @exception IllegalArgumentException if value < 0
- */
- public NumberOfInterveningJobs(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof NumberOfInterveningJobs))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>NumberOfInterveningJobs</code> itself
- */
- public Class getCategory()
- {
- return NumberOfInterveningJobs.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "number-of-intervening-jobs"
- */
- public String getName()
- {
- return "number-of-intervening-jobs";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/NumberUp.java b/libjava/javax/print/attribute/standard/NumberUp.java
deleted file mode 100644
index 4dee55394c4..00000000000
--- a/libjava/javax/print/attribute/standard/NumberUp.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* NumberUp.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-/**
- * @author Michael Koch
- */
-public final class NumberUp extends IntegerSyntax
- implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = -3040436486786527811L;
-
- /**
- * Creates a <code>NumberUp</code> object.
- *
- * @param value the number of print-stream pages to print on a single side
- * of a media
- *
- * @exception IllegalArgumentException if value < 1
- */
- public NumberUp(int value)
- {
- super(value);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof NumberUp))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>NumberUp</code> itself
- */
- public Class getCategory()
- {
- return NumberUp.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "number-up"
- */
- public String getName()
- {
- return "number-up";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/NumberUpSupported.java b/libjava/javax/print/attribute/standard/NumberUpSupported.java
deleted file mode 100644
index 512bdaa00c7..00000000000
--- a/libjava/javax/print/attribute/standard/NumberUpSupported.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* NumberUpSupported.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.SetOfIntegerSyntax;
-import javax.print.attribute.SupportedValuesAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class NumberUpSupported extends SetOfIntegerSyntax
- implements SupportedValuesAttribute
-{
- private static final long serialVersionUID = -1041573395759141805L;
-
- /**
- * Constructs a <code>NumberUp</code> object.
- */
- public NumberUpSupported(int member)
- {
- super(member);
- }
-
- /**
- * Constructs a <code>NumberUp</code> object.
- */
- public NumberUpSupported(int[][] members)
- {
- super(members);
- }
-
- /**
- * Constructs a <code>NumberUp</code> object.
- */
- public NumberUpSupported(int lowerBound, int upperBound)
- {
- super(lowerBound, upperBound);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>NumberUpSupported</code> itself
- */
- public Class getCategory()
- {
- return NumberUpSupported.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "number-up-supported";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/OrientationRequested.java b/libjava/javax/print/attribute/standard/OrientationRequested.java
deleted file mode 100644
index ca63fffdaeb..00000000000
--- a/libjava/javax/print/attribute/standard/OrientationRequested.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* OrientationRequested.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class OrientationRequested extends EnumSyntax
- implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
-{
- private static final long serialVersionUID = -4447437289862822276L;
-
- public static final OrientationRequested PORTRAIT =
- new OrientationRequested(0);
- public static final OrientationRequested LANDSCAPE =
- new OrientationRequested(1);
- public static final OrientationRequested REVERSE_LANDSCAPE =
- new OrientationRequested(2);
- public static final OrientationRequested REVERSE_PORTRAIT =
- new OrientationRequested(3);
-
- /**
- * Constructs a <code>OrientationRequested</code> object.
- */
- protected OrientationRequested(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>OrientationRequested</code> itself
- */
- public Class getCategory()
- {
- return OrientationRequested.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "orientation-requested";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/OutputDeviceAssigned.java b/libjava/javax/print/attribute/standard/OutputDeviceAssigned.java
deleted file mode 100644
index 4bc1f6c8339..00000000000
--- a/libjava/javax/print/attribute/standard/OutputDeviceAssigned.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* OutputDeviceAssigned.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class OutputDeviceAssigned extends TextSyntax
- implements PrintJobAttribute
-{
- private static final long serialVersionUID = 5486733778854271081L;
-
- /**
- * Creates a <code>OutputDeviceAssigned</code> object.
- *
- * @param deviceName the user name
- *
- * @exception NullPointerException if deviceName is null
- */
- public OutputDeviceAssigned(String deviceName, Locale locale)
- {
- super(deviceName, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof OutputDeviceAssigned))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>OutputDeviceAssigned</code> itself
- */
- public Class getCategory()
- {
- return OutputDeviceAssigned.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "output-device-assigned"
- */
- public String getName()
- {
- return "output-device-assigned";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PDLOverrideSupported.java b/libjava/javax/print/attribute/standard/PDLOverrideSupported.java
deleted file mode 100644
index 79865390464..00000000000
--- a/libjava/javax/print/attribute/standard/PDLOverrideSupported.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* PDLOverrideSupported.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintServiceAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class PDLOverrideSupported extends EnumSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = -4393264467928463934L;
-
- public static final PDLOverrideSupported NOT_ATTEMPTED =
- new PDLOverrideSupported(0);
- public static final PDLOverrideSupported ATTEMPTED =
- new PDLOverrideSupported(0);
-
- /**
- * Constructs a <code>PDLOverrideSupported</code> object.
- */
- protected PDLOverrideSupported(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PDLOverrideSupported</code> itself
- */
- public Class getCategory()
- {
- return PDLOverrideSupported.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "pdl-override-supported";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PageRanges.java b/libjava/javax/print/attribute/standard/PageRanges.java
deleted file mode 100644
index 2b3c632e2ad..00000000000
--- a/libjava/javax/print/attribute/standard/PageRanges.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* PageRanges.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.SetOfIntegerSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PageRanges extends SetOfIntegerSyntax
- implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
-{
- private static final long serialVersionUID = 8639895197656148392L;
-
- /**
- * Constructs a <code>PageRanges</code> object.
- */
- public PageRanges(int member)
- {
- super(member);
- }
-
- /**
- * Constructs a <code>PageRanges</code> object.
- */
- public PageRanges(int[][] members)
- {
- super(members);
- }
-
- /**
- * Constructs a <code>PageRanges</code> object.
- */
- public PageRanges(int lowerBound, int upperBound)
- {
- super(lowerBound, upperBound);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PageRanges</code> itself
- */
- public Class getCategory()
- {
- return PageRanges.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "page-ranges";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PagesPerMinute.java b/libjava/javax/print/attribute/standard/PagesPerMinute.java
deleted file mode 100644
index db2658a7fdb..00000000000
--- a/libjava/javax/print/attribute/standard/PagesPerMinute.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* PagesPerMinute.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintServiceAttribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PagesPerMinute extends IntegerSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = -6366403993072862015L;
-
- /**
- * Creates a <code>PagesPerMinute</code> object.
- *
- * @param value the number of pages per minute
- *
- * @exception IllegalArgumentException if value < 0
- */
- public PagesPerMinute(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof PagesPerMinute))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PagesPerMinute</code> itself
- */
- public Class getCategory()
- {
- return PagesPerMinute.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "pages-per-minute"
- */
- public String getName()
- {
- return "pages-per-minute";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PagesPerMinuteColor.java b/libjava/javax/print/attribute/standard/PagesPerMinuteColor.java
deleted file mode 100644
index 85421d70d4d..00000000000
--- a/libjava/javax/print/attribute/standard/PagesPerMinuteColor.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* PagesPerMinuteColor.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintServiceAttribute;
-
-/**
- * @author Michael Koch
- */
-public final class PagesPerMinuteColor extends IntegerSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = 1684993151687470944L;
-
- /**
- * Creates a <code>PagesPerMinuteColor</code> object.
- *
- * @param value the number of pages per minute
- *
- * @exception IllegalArgumentException if value < 0
- */
- public PagesPerMinuteColor(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof PagesPerMinuteColor))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PagesPerMinuteColor</code> itself
- */
- public Class getCategory()
- {
- return PagesPerMinuteColor.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "pages-per-minute-color"
- */
- public String getName()
- {
- return "pages-per-minute-color";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PresentationDirection.java b/libjava/javax/print/attribute/standard/PresentationDirection.java
deleted file mode 100644
index bd1821d12f8..00000000000
--- a/libjava/javax/print/attribute/standard/PresentationDirection.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* PresentationDirection.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PresentationDirection extends EnumSyntax
- implements PrintRequestAttribute, PrintJobAttribute
-{
- private static final long serialVersionUID = 8294728067230931780L;
-
- public static final PresentationDirection TOBOTTOM_TORIGHT =
- new PresentationDirection(0);
- public static final PresentationDirection TOBOTTOM_TOLEFT =
- new PresentationDirection(1);
- public static final PresentationDirection TOTOP_TORIGHT =
- new PresentationDirection(2);
- public static final PresentationDirection TOTOP_TOLEFT =
- new PresentationDirection(3);
- public static final PresentationDirection TORIGHT_TOBOTTOM =
- new PresentationDirection(4);
- public static final PresentationDirection TORIGHT_TOTOP =
- new PresentationDirection(5);
- public static final PresentationDirection TOLEFT_TOBOTTOM =
- new PresentationDirection(6);
- public static final PresentationDirection TOLEFT_TOTOP =
- new PresentationDirection(7);
-
- /**
- * Constructs a <code>PresentationDirection</code> object.
- */
- private PresentationDirection(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PresentationDirection</code> itself
- */
- public Class getCategory()
- {
- return PresentationDirection.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "presentation-direction";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrintQuality.java b/libjava/javax/print/attribute/standard/PrintQuality.java
deleted file mode 100644
index 63be24e70f2..00000000000
--- a/libjava/javax/print/attribute/standard/PrintQuality.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* PrintQuality.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class PrintQuality extends EnumSyntax
- implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = -3072341285225858365L;
-
- public static final PrintQuality DRAFT = new PrintQuality(0);
- public static final PrintQuality NORMAL = new PrintQuality(1);
- public static final PrintQuality HIGH = new PrintQuality(2);
-
- /**
- * Constructs a <code>PrintQuality</code> object.
- */
- protected PrintQuality(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrintQuality</code> itself
- */
- public Class getCategory()
- {
- return PrintQuality.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "print-quality"
- */
- public String getName()
- {
- return "print-quality";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterInfo.java b/libjava/javax/print/attribute/standard/PrinterInfo.java
deleted file mode 100644
index 66199c4821a..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterInfo.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* PrinterInfo.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterInfo extends TextSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = 7765280618777599727L;
-
- /**
- * Creates a <code>PrinterInfo</code> object.
- *
- * @param printerInfo the printer info
- * @param locale the locale of the info, null means default locale
- *
- * @exception NullPointerException if printerInfo is null
- */
- public PrinterInfo(String printerInfo, Locale locale)
- {
- super(printerInfo, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof PrinterInfo))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterInfo</code> itself
- */
- public Class getCategory()
- {
- return PrinterInfo.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "printer-info"
- */
- public String getName()
- {
- return "printer-info";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterIsAcceptingJobs.java b/libjava/javax/print/attribute/standard/PrinterIsAcceptingJobs.java
deleted file mode 100644
index 19b555a3619..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterIsAcceptingJobs.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* PrinterIsAcceptingJobs.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintServiceAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class PrinterIsAcceptingJobs extends EnumSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = -5052010680537678061L;
-
- public static final PrinterIsAcceptingJobs NOT_ACCEPTING_JOBS =
- new PrinterIsAcceptingJobs(0);
- public static final PrinterIsAcceptingJobs ACCEPTING_JOBS =
- new PrinterIsAcceptingJobs(1);
-
- /**
- * Constructs a <code>PrinterIsAcceptingJobs</code> object.
- */
- protected PrinterIsAcceptingJobs(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterIsAcceptingJobs</code> itself
- */
- public Class getCategory()
- {
- return PrinterIsAcceptingJobs.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "printer-is-accepting-jobs";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterLocation.java b/libjava/javax/print/attribute/standard/PrinterLocation.java
deleted file mode 100644
index f342e8c4b89..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterLocation.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* PrinterLocation.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterLocation extends TextSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = -1598610039865566337L;
-
- /**
- * Creates a <code>PrinterLocation</code> object.
- *
- * @param printerLocation the printer location
- * @param locale the locale of the location, null means default locale
- *
- * @exception NullPointerException if printerLocation is null
- */
- public PrinterLocation(String printerLocation, Locale locale)
- {
- super(printerLocation, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof PrinterLocation))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterLocation</code> itself
- */
- public Class getCategory()
- {
- return PrinterLocation.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "printer-location"
- */
- public String getName()
- {
- return "printer-location";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterMakeAndModel.java b/libjava/javax/print/attribute/standard/PrinterMakeAndModel.java
deleted file mode 100644
index c3f3a63881f..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterMakeAndModel.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* PrinterMakeAndModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterMakeAndModel extends TextSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = 4580461489499351411L;
-
- /**
- * Creates a <code>PrinterMakeAndModel</code> object.
- *
- * @param makeAndModel the make and model string
- * @param locale the locale of the make and model, null means default locale
- *
- * @exception NullPointerException if makeAndModel is null
- */
- public PrinterMakeAndModel(String makeAndModel, Locale locale)
- {
- super(makeAndModel, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof PrinterMakeAndModel))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterMakeAndModel</code> itself
- */
- public Class getCategory()
- {
- return PrinterMakeAndModel.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "printer-make-and-model"
- */
- public String getName()
- {
- return "printer-make-and-model";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterMessageFromOperator.java b/libjava/javax/print/attribute/standard/PrinterMessageFromOperator.java
deleted file mode 100644
index d231eb2aa82..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterMessageFromOperator.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* PrinterMessageFromOperator.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterMessageFromOperator extends TextSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = -4486871203218629318L;
-
- /**
- * Creates a <code>PrinterMessageFromOperator</code> object.
- *
- * @param message the message
- * @param locale the locale of the message, null means default locale
- *
- * @exception NullPointerException if message is null
- */
- public PrinterMessageFromOperator(String message, Locale locale)
- {
- super(message, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof PrinterMessageFromOperator))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterMessageFromOperator</code> itself
- */
- public Class getCategory()
- {
- return PrinterMessageFromOperator.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "printer-message-from-operator"
- */
- public String getName()
- {
- return "printer-message-from-operator";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterMoreInfo.java b/libjava/javax/print/attribute/standard/PrinterMoreInfo.java
deleted file mode 100644
index b0cf9739777..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterMoreInfo.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* PrinterMoreInfo.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.net.URI;
-
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.URISyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterMoreInfo extends URISyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = 4555850007675338574L;
-
- /**
- * Constructs a <code>PrinterMoreInfo</code> object.
- */
- public PrinterMoreInfo(URI uri)
- {
- super(uri);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterMoreInfo</code> itself
- */
- public Class getCategory()
- {
- return PrinterMoreInfo.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "printer-more-info";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java b/libjava/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
deleted file mode 100644
index 0a39b866c7f..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* PrinterMoreInfoManufacturer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.net.URI;
-
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.URISyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterMoreInfoManufacturer extends URISyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = 3323271346485076608L;
-
- /**
- * Constructs a <code>PrinterMoreInfoManufacturer</code> object.
- */
- public PrinterMoreInfoManufacturer(URI uri)
- {
- super(uri);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterMoreInfoManufacturer</code> itself
- */
- public Class getCategory()
- {
- return PrinterMoreInfoManufacturer.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "printer-more-info-manufacturer";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterName.java b/libjava/javax/print/attribute/standard/PrinterName.java
deleted file mode 100644
index d3b495bdb5c..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterName.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* PrinterName.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterName extends TextSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = 299740639137803127L;
-
- /**
- * Creates a <code>PrinterName</code> object.
- *
- * @param printerName the printer name
- * @param locale the locale of the name, null means default locale
- *
- * @exception NullPointerException if printerName is null
- */
- public PrinterName(String printerName, Locale locale)
- {
- super(printerName, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof PrinterName))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterName</code> itself
- */
- public Class getCategory()
- {
- return PrinterName.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "printer-name"
- */
- public String getName()
- {
- return "printer-name";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterResolution.java b/libjava/javax/print/attribute/standard/PrinterResolution.java
deleted file mode 100644
index 6a237a8c33e..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterResolution.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* PrinterMoreInfoManufacturer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.ResolutionSyntax;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterResolution extends ResolutionSyntax
- implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
-{
- private static final long serialVersionUID = 13090306561090558L;
-
- /**
- * Constructs a <code>PrinterResolution</code> object.
- */
- public PrinterResolution(int crossFeedResolution, int feedResolution,
- int units)
- {
- super(crossFeedResolution, feedResolution, units);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterResolution</code> itself
- */
- public Class getCategory()
- {
- return PrinterResolution.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "printer-resolution";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterState.java b/libjava/javax/print/attribute/standard/PrinterState.java
deleted file mode 100644
index 28d78cd50d3..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterState.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* PrinterState.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintServiceAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterState extends EnumSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = -649578618346507718L;
-
- public static final PrinterState UNKNOWN = new PrinterState(0);
- public static final PrinterState IDLE = new PrinterState(1);
- public static final PrinterState PROCESSING = new PrinterState(2);
- public static final PrinterState STOPPED = new PrinterState(3);
-
- /**
- * Constructs a <code>PrinterState</code> object.
- */
- protected PrinterState(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterState</code> itself
- */
- public Class getCategory()
- {
- return PrinterState.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "printer-state";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterStateReason.java b/libjava/javax/print/attribute/standard/PrinterStateReason.java
deleted file mode 100644
index 847395e4946..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterStateReason.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* PrinterStateReason.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.Attribute;
-import javax.print.attribute.EnumSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class PrinterStateReason extends EnumSyntax
- implements Attribute
-{
- private static final long serialVersionUID = -1623720656201472593L;
-
- public static final PrinterStateReason OTHER = new PrinterStateReason(0);
- public static final PrinterStateReason MEDIA_NEEDED =
- new PrinterStateReason(1);
- public static final PrinterStateReason MEDIA_JAM = new PrinterStateReason(2);
- public static final PrinterStateReason MOVING_TO_PAUSED =
- new PrinterStateReason(3);
- public static final PrinterStateReason PAUSED = new PrinterStateReason(4);
- public static final PrinterStateReason SHUTDOWN = new PrinterStateReason(5);
- public static final PrinterStateReason CONNECTING_TO_DEVICE =
- new PrinterStateReason(6);
- public static final PrinterStateReason TIMED_OUT = new PrinterStateReason(7);
- public static final PrinterStateReason STOPPING = new PrinterStateReason(8);
- public static final PrinterStateReason STOPPED_PARTLY =
- new PrinterStateReason(9);
- public static final PrinterStateReason TONER_LOW =
- new PrinterStateReason(10);
- public static final PrinterStateReason TONER_EMPTY =
- new PrinterStateReason(11);
- public static final PrinterStateReason SPOOL_AREA_FULL =
- new PrinterStateReason(12);
- public static final PrinterStateReason COVER_OPEN =
- new PrinterStateReason(13);
- public static final PrinterStateReason INTERLOCK_OPEN =
- new PrinterStateReason(14);
- public static final PrinterStateReason DOOR_OPEN =
- new PrinterStateReason(15);
- public static final PrinterStateReason INPUT_TRAY_MISSING =
- new PrinterStateReason(16);
- public static final PrinterStateReason MEDIA_LOW =
- new PrinterStateReason(17);
- public static final PrinterStateReason MEDIA_EMPTY =
- new PrinterStateReason(18);
- public static final PrinterStateReason OUTPUT_TRAY_MISSING =
- new PrinterStateReason(19);
- public static final PrinterStateReason OUTPUT_AREA_ALMOST_FULL =
- new PrinterStateReason(20);
- public static final PrinterStateReason OUTPUT_AREA_FULL =
- new PrinterStateReason(21);
- public static final PrinterStateReason MARKER_SUPPLY_LOW =
- new PrinterStateReason(22);
- public static final PrinterStateReason MARKER_SUPPLY_EMPTY =
- new PrinterStateReason(23);
- public static final PrinterStateReason MARKER_WASTE_ALMOST_FULL =
- new PrinterStateReason(24);
- public static final PrinterStateReason MARKER_WASTE_FULL =
- new PrinterStateReason(25);
- public static final PrinterStateReason FUSER_OVER_TEMP =
- new PrinterStateReason(26);
- public static final PrinterStateReason FUSER_UNDER_TEMP =
- new PrinterStateReason(27);
- public static final PrinterStateReason OPC_NEAR_EOL =
- new PrinterStateReason(28);
- public static final PrinterStateReason OPC_LIFE_OVER =
- new PrinterStateReason(29);
- public static final PrinterStateReason DEVELOPER_LOW =
- new PrinterStateReason(30);
- public static final PrinterStateReason DEVELOPER_EMPTY =
- new PrinterStateReason(31);
- public static final PrinterStateReason INTERPRETER_RESOURCE_UNAVAILABLE =
- new PrinterStateReason(32);
-
- /**
- * Constructs a <code>PrinterStateReason</code> object.
- */
- protected PrinterStateReason(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrintStateReason</code> itself
- */
- public Class getCategory()
- {
- return PrinterStateReason.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "printer-state-reason"
- */
- public String getName()
- {
- return "printer-state-reason";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterStateReasons.java b/libjava/javax/print/attribute/standard/PrinterStateReasons.java
deleted file mode 100644
index d81313f7c85..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterStateReasons.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* PrinterStateReasons.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.HashMap;
-
-import javax.print.attribute.PrintServiceAttribute;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterStateReasons extends HashMap
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = -3731791085163619457L;
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrintStateReasons</code> itself
- */
- public Class getCategory()
- {
- return PrinterStateReasons.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "printer-state-reasons"
- */
- public String getName()
- {
- return "printer-state-reasons";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/PrinterURI.java b/libjava/javax/print/attribute/standard/PrinterURI.java
deleted file mode 100644
index e4c89a5c84f..00000000000
--- a/libjava/javax/print/attribute/standard/PrinterURI.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* PrinterURI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.net.URI;
-
-import javax.print.attribute.PrintServiceAttribute;
-import javax.print.attribute.URISyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class PrinterURI extends URISyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = 7923912792485606497L;
-
- /**
- * Constructs a <code>PrinterURI</code> object.
- */
- public PrinterURI(URI uri)
- {
- super(uri);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>PrinterURI</code> itself
- */
- public Class getCategory()
- {
- return PrinterURI.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "printer-uri"
- */
- public String getName()
- {
- return "printer-uri";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/QueuedJobCount.java b/libjava/javax/print/attribute/standard/QueuedJobCount.java
deleted file mode 100644
index 7ee0f7c3598..00000000000
--- a/libjava/javax/print/attribute/standard/QueuedJobCount.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* QueuedJobCount.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.IntegerSyntax;
-import javax.print.attribute.PrintServiceAttribute;
-
-/**
- * @author Michael Koch
- */
-public final class QueuedJobCount extends IntegerSyntax
- implements PrintServiceAttribute
-{
- private static final long serialVersionUID = 7499723077864047742L;
-
- /**
- * Creates a <code>QueuedJobCount</code> object.
- *
- * @param value the number of queued jobs
- *
- * @exception IllegalArgumentException if value < 0
- */
- public QueuedJobCount(int value)
- {
- super(value);
-
- if (value < 0)
- throw new IllegalArgumentException("value may not be less than 0");
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof QueuedJobCount))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>QueuedJobCount</code> itself
- */
- public Class getCategory()
- {
- return QueuedJobCount.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "queued-job-count"
- */
- public String getName()
- {
- return "queued-job-count";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/ReferenceUriSchemesSupported.java b/libjava/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
deleted file mode 100644
index b4c0d9408c8..00000000000
--- a/libjava/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ReferenceUriSchemesSupported.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.Attribute;
-import javax.print.attribute.EnumSyntax;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class ReferenceUriSchemesSupported extends EnumSyntax
- implements Attribute
-{
- private static final long serialVersionUID = -8989076942813442805L;
-
- public static final ReferenceUriSchemesSupported FTP =
- new ReferenceUriSchemesSupported(0);
- public static final ReferenceUriSchemesSupported HTTP =
- new ReferenceUriSchemesSupported(1);
- public static final ReferenceUriSchemesSupported HTTPS =
- new ReferenceUriSchemesSupported(2);
- public static final ReferenceUriSchemesSupported GOPHER =
- new ReferenceUriSchemesSupported(3);
- public static final ReferenceUriSchemesSupported NEWS =
- new ReferenceUriSchemesSupported(4);
- public static final ReferenceUriSchemesSupported NNTP =
- new ReferenceUriSchemesSupported(5);
- public static final ReferenceUriSchemesSupported WAIS =
- new ReferenceUriSchemesSupported(6);
- public static final ReferenceUriSchemesSupported FILE =
- new ReferenceUriSchemesSupported(7);
-
- /**
- * Constructs a <code>ReferenceUriSchemeSupported</code> object.
- */
- protected ReferenceUriSchemesSupported(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>ReferenceUriSchemesSupported</code> itself
- */
- public Class getCategory()
- {
- return ReferenceUriSchemesSupported.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "reference-uri-schemes-supported"
- */
- public String getName()
- {
- return "reference-uri-schemes-supported";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/RequestingUserName.java b/libjava/javax/print/attribute/standard/RequestingUserName.java
deleted file mode 100644
index bca7fbbb435..00000000000
--- a/libjava/javax/print/attribute/standard/RequestingUserName.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* RequestingUserName.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import java.util.Locale;
-
-import javax.print.attribute.PrintRequestAttribute;
-import javax.print.attribute.TextSyntax;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class RequestingUserName extends TextSyntax
- implements PrintRequestAttribute
-{
- private static final long serialVersionUID = -2683049894310331454L;
-
- /**
- * Creates a <code>RequestingUserName</code> object.
- *
- * @param userName the job name
- * @param locale the locale of the user, null means default locale
- *
- * @exception NullPointerException if userName is null
- */
- public RequestingUserName(String userName, Locale locale)
- {
- super(userName, locale);
- }
-
- /**
- * Tests of obj is equal to this object.
- *
- * @param obj the object to test
- *
- * @return true if both objects are equal, false otherwise.
- */
- public boolean equals(Object obj)
- {
- if(! (obj instanceof RequestingUserName))
- return false;
-
- return super.equals(obj);
- }
-
- /**
- * Returns category of this attribute.
- *
- * @return the class <code>RequestingUserName</code> itself
- */
- public Class getCategory()
- {
- return RequestingUserName.class;
- }
-
- /**
- * Returns name of this attribute.
- *
- * @return the string "requesting-user-name"
- */
- public String getName()
- {
- return "requesting-user-name";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/Severity.java b/libjava/javax/print/attribute/standard/Severity.java
deleted file mode 100644
index c34ed3e29fa..00000000000
--- a/libjava/javax/print/attribute/standard/Severity.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Severity.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.Attribute;
-import javax.print.attribute.EnumSyntax;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class Severity extends EnumSyntax
- implements Attribute
-{
- private static final long serialVersionUID = 8781881462717925380L;
-
- public static final Severity REPORT = new Severity(0);
- public static final Severity WARNING = new Severity(1);
- public static final Severity ERROR = new Severity(2);
-
- /**
- * Constructs a <code>Severity</code> object.
- */
- protected Severity(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>Severity</code> itself
- */
- public Class getCategory()
- {
- return Severity.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "severity"
- */
- public String getName()
- {
- return "severity";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/SheetCollate.java b/libjava/javax/print/attribute/standard/SheetCollate.java
deleted file mode 100644
index a4e31f44374..00000000000
--- a/libjava/javax/print/attribute/standard/SheetCollate.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* SheetCollate.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class SheetCollate extends EnumSyntax
- implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
-{
- private static final long serialVersionUID = 7080587914259873003L;
-
- public static final SheetCollate UNCOLLATED = new SheetCollate(0);
- public static final SheetCollate COLLATED = new SheetCollate(1);
-
- protected SheetCollate(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>SheetCollate</code> itself
- */
- public Class getCategory()
- {
- return SheetCollate.class;
- }
-
- /**
- * Returns name of this class.
- *
- * @return the string "sheet-collate"
- */
- public String getName()
- {
- return "sheet-collate";
- }
-}
diff --git a/libjava/javax/print/attribute/standard/Sides.java b/libjava/javax/print/attribute/standard/Sides.java
deleted file mode 100644
index 94b473c338f..00000000000
--- a/libjava/javax/print/attribute/standard/Sides.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Sides.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.attribute.standard;
-
-import javax.print.attribute.DocAttribute;
-import javax.print.attribute.EnumSyntax;
-import javax.print.attribute.PrintJobAttribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public final class Sides extends EnumSyntax
- implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
-{
- private static final long serialVersionUID = -6890309414893262822L;
-
- public static final Sides ONE_SIDED = new Sides(0);
- public static final Sides TWO_SIDED_LONG_EDGE = new Sides(1);
- public static final Sides TWO_SIDED_SHORT_EDGE = new Sides(2);
- public static final Sides DUPLEX = new Sides(3);
- public static final Sides TUMBLE = new Sides(4);
-
- /**
- * Creates a <code>Sides</code> object.
- *
- * @param value the number of sides
- */
- protected Sides(int value)
- {
- super(value);
- }
-
- /**
- * Returns category of this class.
- *
- * @return the class <code>Sides</code> itself
- */
- public Class getCategory()
- {
- return Sides.class;
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name
- */
- public String getName()
- {
- return "sides";
- }
-}
diff --git a/libjava/javax/print/event/PrintEvent.java b/libjava/javax/print/event/PrintEvent.java
deleted file mode 100644
index cbf93852cc5..00000000000
--- a/libjava/javax/print/event/PrintEvent.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* PrintEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.event;
-
-import java.util.EventObject;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class PrintEvent extends EventObject
-{
- /**
- * Constructs a <code>PrintEvent</code> object.
- *
- * @param source the source of this event
- */
- public PrintEvent(Object source)
- {
- super(source);
- }
-
- /**
- * Returns a string representation of this object.
- *
- * @return the string representation
- */
- public String toString()
- {
- return "PrintEvent on " + getSource().toString();
- }
-}
diff --git a/libjava/javax/print/event/PrintJobAdapter.java b/libjava/javax/print/event/PrintJobAdapter.java
deleted file mode 100644
index 3615108f93a..00000000000
--- a/libjava/javax/print/event/PrintJobAdapter.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* PrintJobAdapter.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.event;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public abstract class PrintJobAdapter
- implements PrintJobListener
-{
- /**
- * Constructs a <code>PrintJobAdapter</code> object.
- */
- public PrintJobAdapter()
- {
- // Do nothing here.
- }
-
- /**
- * Called to notify the client that all data has bin successfully transferred
- * to the print service.
- *
- * <p>The default implementation does nothing</p>
- */
- public void printDataTransferCompleted(PrintJobEvent event)
- {
- // Do nothing here.
- }
-
- /**
- * Called to notify the client that a print job was canceled.
- *
- * <p>The default implementation does nothing</p>
- */
- public void printJobCanceled(PrintJobEvent event)
- {
- // Do nothing here.
- }
-
- /**
- * Called to notify the client that a print job was successfully completed.
- *
- * <p>The default implementation does nothing</p>
- */
- public void printJobCompleted(PrintJobEvent event)
- {
- // Do nothing here.
- }
-
- /**
- * Called to notify the client that a print job failed to complete
- * successfully.
- *
- * <p>The default implementation does nothing</p>
- */
- public void printJobFailed(PrintJobEvent event)
- {
- // Do nothing here.
- }
-
- /**
- * Called to notify the client that no more job events will be send.
- *
- * <p>The default implementation does nothing</p>
- */
- public void printJobNoMoreEvents(PrintJobEvent event)
- {
- // Do nothing here.
- }
-
- /**
- * Called to notify the client that a problem occured during printing
- * but the user may be able to fix it.
- *
- * <p>The default implementation does nothing</p>
- */
- public void printJobRequiresAttention(PrintJobEvent event)
- {
- // Do nothing here.
- }
-}
diff --git a/libjava/javax/print/event/PrintJobAttributeEvent.java b/libjava/javax/print/event/PrintJobAttributeEvent.java
deleted file mode 100644
index 0914aea9f4b..00000000000
--- a/libjava/javax/print/event/PrintJobAttributeEvent.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* PrintJobAttributeEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.event;
-
-import javax.print.DocPrintJob;
-import javax.print.attribute.PrintJobAttributeSet;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class PrintJobAttributeEvent extends PrintEvent
-{
- private static final long serialVersionUID = -6534469883874742101L;
-
- private PrintJobAttributeSet attributes;
-
- /**
- * Constructs a <code>PrintJobAttributeEvent</code> object.
- *
- * @param source the source of this event
- * @param attributes the attribute changes being reported
- */
- public PrintJobAttributeEvent(DocPrintJob source,
- PrintJobAttributeSet attributes)
- {
- super(source);
- this.attributes = attributes;
- }
-
- /**
- * Returns the print job generating this event.
- *
- * @return the print job
- */
- public DocPrintJob getPrintJob()
- {
- return (DocPrintJob) getSource();
- }
-
- /**
- * Returns the attributes that changed and their new values.
- *
- * @return the changes attributes
- */
- public PrintJobAttributeSet getAttributes()
- {
- return attributes;
- }
-}
diff --git a/libjava/javax/print/event/PrintJobAttributeListener.java b/libjava/javax/print/event/PrintJobAttributeListener.java
deleted file mode 100644
index ee816d22a1c..00000000000
--- a/libjava/javax/print/event/PrintJobAttributeListener.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* PrintJobAttributeListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.event;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface PrintJobAttributeListener
-{
- /**
- * Notifies the listener of an attribute change.
- *
- * @param event the event
- */
- void attributeUpdate(PrintJobAttributeEvent event);
-}
diff --git a/libjava/javax/print/event/PrintJobEvent.java b/libjava/javax/print/event/PrintJobEvent.java
deleted file mode 100644
index c4b7cd6f942..00000000000
--- a/libjava/javax/print/event/PrintJobEvent.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* PrintEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.event;
-
-import javax.print.DocPrintJob;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class PrintJobEvent extends PrintEvent
-{
- private static final long serialVersionUID = -1711656903622072997L;
-
- public static final int DATA_TRANSFER_COMPLETE = 106;
- public static final int JOB_CANCELED = 101;
- public static final int JOB_COMPLETE = 102;
- public static final int JOB_FAILED = 103;
- public static final int NO_MORE_EVENTS = 105;
- public static final int REQUIRES_ATTENTION = 104;
-
- private int reason;
-
- /**
- * Constructs a <code>PrintJobEvent</code> object.
- *
- * @param source the source generating this event
- * @param reason the reason for this event
- */
- public PrintJobEvent(DocPrintJob source, int reason)
- {
- super(source);
- this.reason = reason;
- }
-
- /**
- * Returns the reason for this event.
- *
- * @return the reason
- */
- public int getPrintEventType()
- {
- return reason;
- }
-
- /**
- * Returns the print job that generated this event.
- *
- * @return the print job
- */
- public DocPrintJob getPrintJob()
- {
- return (DocPrintJob) getSource();
- }
-}
diff --git a/libjava/javax/print/event/PrintJobListener.java b/libjava/javax/print/event/PrintJobListener.java
deleted file mode 100644
index d1dcf42be71..00000000000
--- a/libjava/javax/print/event/PrintJobListener.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* PrintJobListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.event;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de) */
-public interface PrintJobListener
-{
- /**
- * Notifies the listener that all data has been successfully transferred
- * to the print service.
- *
- * @param event the event
- */
- void printDataTransferCompleted(PrintJobEvent event);
-
- /**
- * Notifies the listener that a print job got canceled.
- *
- * @param event the event
- */
- void printJobCanceled(PrintJobEvent event);
-
- /**
- * Notifies the listener that a print job has completed.
- *
- * @param event the event
- */
- void printJobCompleted(PrintJobEvent event);
-
- /**
- * Notifies the listener that a print job has failed to complete.
- *
- * @param event the event.
- */
- void printJobFailed(PrintJobEvent event);
-
- /**
- * Notifies the listener that no more events will be delivered.
- *
- * @param event the event
- */
- void printJobNoMoreEvents(PrintJobEvent event);
-
- /**
- * Notifies the listener that an error occured and the user might be able to fix it.
- *
- * @param event the event
- */
- void printJobRequiresAttention(PrintJobEvent event);
-}
diff --git a/libjava/javax/print/event/PrintServiceAttributeEvent.java b/libjava/javax/print/event/PrintServiceAttributeEvent.java
deleted file mode 100644
index d3981747fa8..00000000000
--- a/libjava/javax/print/event/PrintServiceAttributeEvent.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* PrintServiceAttributeEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.event;
-
-import javax.print.PrintService;
-import javax.print.attribute.PrintServiceAttributeSet;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class PrintServiceAttributeEvent extends PrintEvent
-{
- private PrintServiceAttributeSet attributes;
-
- /**
- * Constructs a <code>PrintServiceAttributeEvent</code> object.
- *
- * @param source the source of this event
- * @param attributes the attribute changes being reported
- */
- public PrintServiceAttributeEvent(PrintService source,
- PrintServiceAttributeSet attributes)
- {
- super(source);
- this.attributes = attributes;
- }
-
- /**
- * Returns the print service that generated this event.
- *
- * @return the print service
- */
- public PrintService getPrintService()
- {
- return (PrintService) getSource();
- }
-
- /**
- * Returns the changed attributes this event reports.
- *
- * @return the changed attributes
- */
- public PrintServiceAttributeSet getAttributes()
- {
- return attributes;
- }
-}
diff --git a/libjava/javax/print/event/PrintServiceAttributeListener.java b/libjava/javax/print/event/PrintServiceAttributeListener.java
deleted file mode 100644
index e43d9ad65ee..00000000000
--- a/libjava/javax/print/event/PrintServiceAttributeListener.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* PrintServiceAttributeListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.print.event;
-
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public interface PrintServiceAttributeListener
-{
- /**
- * Notifies the listener that some attributes have changed.
- *
- * @param event the event
- */
- void attributeUpdate(PrintServiceAttributeEvent event);
-}
diff --git a/libjava/javax/security/auth/AuthPermission.java b/libjava/javax/security/auth/AuthPermission.java
deleted file mode 100644
index 176ed9fb43d..00000000000
--- a/libjava/javax/security/auth/AuthPermission.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/* AuthPermission.java -- permissions related to authentication.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth;
-
-import java.security.BasicPermission;
-
-/**
- * <p>A permission controlling access to authentication service. The
- * <i>actions</i> field of auth permission objects is ignored; the whole
- * of the permission is defined by the <i>target</i>.</p>
- *
- * <p>The authentication permission targets recognized are:</p>
- *
- * <dl>
- * <dt><code>doAs</code></dt>
- *
- * <dd><p>Allows access to the {@link
- * Subject#doAs(javax.security.auth.Subject java.security.PrivilegedAction)}
- * methods.</p></dd>
- *
- * <dt><code>doAsPrivileged</code></dt>
- *
- * <dd><p>Allows access to the {@link
- * Subject#doAsPrivileged(javax.security.auth.Subject,
- * java.security.PrivilegedAction, java.security.AccessControlContext)}
- * methods.</p></dd>
- *
- * <dt><code>getSubject</code></dt>
- *
- * <dd><p>Allows access to the {@link Subject} associated with a
- * thread.</p></dd>
- *
- * <dt><code>getSubjectFromDomainCombiner</code></dt>
- *
- * <dd><p>Allows access to the {@link Subject} associated with a
- * {@link SubjectDomainCombiner}.</p></dd>
- *
- * <dt><code>setReadOnly</code></dt>
- *
- * <dd><p>Allows a {@link Subject} to be marked as read-only.</p></dd>
- *
- * <dt><code>modifyPrincipals</code></dt>
- *
- * <dd><p>Allows the set of principals of a subject to be modified.</p></dd>
- *
- * <dt><code>modifyPublicCredentials</code></dt>
- *
- * <dd><p>Allows the set of public credentials of a subject to be
- * modified.</p></dd>
- *
- * <dt><code>modifyPrivateCredentials</code></dt>
- *
- * <dd><p>Allows the set of private credentials of a subject to be
- * modified.</p></dd>
- *
- * <dt><code>refreshCredential</code></dt>
- *
- * <dd><p>Allows a {@link Refreshable} credential to be refreshed.</p></dd>
- *
- * <dt><code>destroyCredential</code></dt>
- *
- * <dd><p>Allows a {@link Destroyable} credential to be destroyed.</p></dd>
- *
- * <dt><code>createLoginContext.<i>name</i></code></dt>
- *
- * <dd><p>Allows a {@link javax.security.auth.login.LoginContext} for the
- * given <i>name</i>. <i>name</i> can also be a wildcard (<code>'*'</code>),
- * which allows the creation of a context with any name.</p></dd>
- *
- * <dt><code>getLoginConfiguration</code></dt>
- *
- * <dd><p>Allows the system-wide login {@link
- * javax.security.auth.login.Configuration} to be retrieved.</p></dd>
- *
- * <dt><code>setLoginConfiguration</code></dt>
- *
- * <dd><p>Allows the system-wide login {@link
- * javax.security.auth.login.Configuration} to be set.</p></dd>
- *
- * <dt><code>refreshLoginConfiguration</code></dt>
- *
- * <dd><p>Allows the system-wide login {@link
- * javax.security.auth.login.Configuration} to be refreshed.</p></dd>
- * </dl>
- */
-public final class AuthPermission extends BasicPermission
-{
-
- /**
- * Creates a new authentication permission for the given target name.
- *
- * @param name The target name.
- */
- public AuthPermission (String name)
- {
- super (name);
- }
-
- /**
- * Creates a new authentication permission for the given target name.
- * The actions list is not used by this class.
- *
- * @param name The target name.
- * @param actions The action list.
- */
- public AuthPermission (String name, String actions)
- {
- super (name, actions);
- }
-}
diff --git a/libjava/javax/security/auth/DestroyFailedException.java b/libjava/javax/security/auth/DestroyFailedException.java
deleted file mode 100644
index 98de82bd491..00000000000
--- a/libjava/javax/security/auth/DestroyFailedException.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* DestroyFailedException.java -- signals an object could not be destroyed.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth;
-
-/**
- * An exception thrown when the {@link Destroyable#destroy()} method
- * fails for a credential.
- *
- * @see Destroyable
- */
-public class DestroyFailedException extends Exception
-{
-
- /**
- * Creates a new DestroyFailedException with no detail message.
- */
- public DestroyFailedException()
- {
- super();
- }
-
- /**
- * Creates a new DestroyFailedException with a detail message.
- *
- * @param message The detail message.
- */
- public DestroyFailedException (String message)
- {
- super (message);
- }
-}
diff --git a/libjava/javax/security/auth/Destroyable.java b/libjava/javax/security/auth/Destroyable.java
deleted file mode 100644
index 1ebd85c07d4..00000000000
--- a/libjava/javax/security/auth/Destroyable.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Destroyable.java -- an immutable object that may be destroyed.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth;
-
-/**
- * An interface for objects that are immutable but whose sensitive
- * data may be wiped out.
- */
-public interface Destroyable
-{
-
- /**
- * Destroy this object, clearing all sensitive fields appropriately.
- *
- * @throws DestroyFailedException If this object could not be
- * destroyed.
- * @throws SecurityException If the caller does not have permission
- * to destroy this object.
- */
- void destroy() throws DestroyFailedException;
-
- /**
- * Tells whether or not this object has been destroyed.
- *
- * @return True if this object has been destroyed.
- */
- boolean isDestroyed();
-}
diff --git a/libjava/javax/security/auth/Policy.java b/libjava/javax/security/auth/Policy.java
deleted file mode 100644
index 4da9a84dffe..00000000000
--- a/libjava/javax/security/auth/Policy.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Policy.java -- deprecated precursor to java.security.Policy.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth;
-
-import java.security.CodeSource;
-import java.security.PermissionCollection;
-
-/**
- * @deprecated The classes java.security.Policy and
- * java.security.ProtectionDomain provide the functionality of this class.
- */
-public abstract class Policy
-{
-
- private static Policy policy;
-
- protected Policy()
- {
- }
-
- public static synchronized Policy getPolicy()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("getPolicy"));
- }
- return policy;
- }
-
- public static synchronized void setPolicy (Policy p)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("setPolicy"));
- }
- policy = p;
- }
-
- public abstract PermissionCollection getPermissions (Subject subject, CodeSource source);
- public abstract void refresh();
-}
diff --git a/libjava/javax/security/auth/PrivateCredentialPermission.java b/libjava/javax/security/auth/PrivateCredentialPermission.java
deleted file mode 100644
index 1982eef3d6a..00000000000
--- a/libjava/javax/security/auth/PrivateCredentialPermission.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/* PrivateCredentialPermission.java -- permissions governing private credentials.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth;
-
-import java.io.Serializable;
-
-import java.security.Permission;
-import java.security.PermissionCollection;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-/**
- * A permission governing access to a private credential. The action of this
- * permission is always "read" -- meaning that the private credential
- * information can be read from an object.
- *
- * <p>The target of this permission is formatted as follows:</p>
- *
- * <p><code>CredentialClassName ( PrinicpalClassName PrincipalName )*</code></p>
- *
- * <p><i>CredentialClassName</i> is either the name of a private credential
- * class name, or a wildcard character (<code>'*'</code>).
- * <i>PrinicpalClassName</i> is the class name of a principal object, and
- * <i>PrincipalName</i> is a string representing the principal, or the
- * wildcard character.</p>
- */
-public final class PrivateCredentialPermission extends Permission
- implements Serializable
-{
- /**
- * For compatability with Sun's JDK 1.4.2 rev. 5
- */
- private static final long serialVersionUID = 5284372143517237068L;
-
- // Fields.
- // -------------------------------------------------------------------------
-
- /**
- * @serial The credential class name.
- */
- private final String credentialClass;
-
- /**
- * @serial The principals, a set of CredOwner objects (an undocumented
- * inner class of this class).
- */
- private final Set principals;
-
- /**
- * @serial Who knows?
- */
- private final boolean testing;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- /**
- * Create a new private credential permission.
- *
- * @param name The permission target name.
- * @param actions The list of actions, which, for this class, must be
- * <code>"read"</code>.
- */
- public PrivateCredentialPermission (final String name, String actions)
- {
- super(name);
- actions = actions.trim().toLowerCase();
- if (!"read".equals (actions))
- {
- throw new IllegalArgumentException("actions must be \"read\"");
- }
- StringTokenizer st = new StringTokenizer (name, " \"'");
- principals = new HashSet();
- if (st.countTokens() < 3 || (st.countTokens() & 1) == 0)
- {
- throw new IllegalArgumentException ("badly formed credential name");
- }
- credentialClass = st.nextToken();
- while (st.hasMoreTokens())
- {
- principals.add (new CredOwner (st.nextToken(), st.nextToken()));
- }
- testing = false; // WTF ever.
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public boolean equals (Object o)
- {
- if (! (o instanceof PrivateCredentialPermission))
- {
- return false;
- }
- PrivateCredentialPermission that = (PrivateCredentialPermission) o;
- if (!that.getActions().equals (getActions()))
- {
- return false;
- }
- if (!that.getCredentialClass().equals (getCredentialClass()))
- {
- return false;
- }
-
- final String[][] principals = getPrincipals();
- final String[][] that_principals = that.getPrincipals();
- if (that_principals == null)
- {
- return false;
- }
- if (that_principals.length != principals.length)
- {
- return false;
- }
- for (int i = 0; i < principals.length; i++)
- {
- if (!principals[i][0].equals (that_principals[i][0]) ||
- !principals[i][1].equals (that_principals[i][1]))
- {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Returns the actions this permission encompasses. For private credential
- * permissions, this is always the string <code>"read"</code>.
- *
- * @return The list of actions.
- */
- public String getActions()
- {
- return "read";
- }
-
- /**
- * Returns the credential class name that was embedded in this permission's
- * target name.
- *
- * @return The credential class name.
- */
- public String getCredentialClass()
- {
- return credentialClass;
- }
-
- /**
- * Returns the principal list that was embedded in this permission's target
- * name.
- *
- * <p>Each element of the returned array is a pair; the first element is the
- * principal class name, and the second is the principal name.
- *
- * @return The principal list.
- */
- public String[][] getPrincipals()
- {
- String[][] ret = new String[principals.size()][];
- Iterator it = principals.iterator();
- for (int i = 0; i < principals.size() && it.hasNext(); i++)
- {
- CredOwner co = (CredOwner) it.next();
- ret[i] = new String[] { co.getPrincipalClass(), co.getPrincipalName() };
- }
- return ret;
- }
-
- public int hashCode()
- {
- return credentialClass.hashCode() + principals.hashCode();
- }
-
- /**
- * Test if this permission implies another. This method returns true if:
- *
- * <ol>
- * <li><i>p</i> is an instance of PrivateCredentialPermission</li>.
- * <li>The credential class name of this instance matches that of <i>p</i>,
- * and one of the principals of <i>p</i> is contained in the principals of
- * this class. Thus,
- * <ul>
- * <li><code>[ * P "foo" ] implies [ C P "foo" ]</code></li>
- * <li><code>[ C P1 "foo" ] implies [ C P1 "foo" P2 "bar" ]</code></li>
- * <li><code>[ C P1 "*" ] implies [ C P1 "foo" ]</code></li>
- * </ul>
- * </ol>
- *
- * @param p The permission to check.
- * @return True if this permission implies <i>p</i>.
- */
- public boolean implies (Permission p)
- {
- if (! (p instanceof PrivateCredentialPermission))
- {
- return false;
- }
- PrivateCredentialPermission that = (PrivateCredentialPermission) p;
- if (!credentialClass.equals ("*")
- && !credentialClass.equals (that.getCredentialClass()))
- {
- return false;
- }
- String[][] principals = getPrincipals();
- String[][] that_principals = that.getPrincipals();
- if (that_principals == null)
- {
- return false;
- }
- for (int i = 0; i < principals.length; i++)
- {
- for (int j = 0; j < that_principals.length; j++)
- {
- if (principals[i][0].equals (that_principals[j][0]) &&
- (principals[i][1].equals ("*") ||
- principals[i][1].equals (that_principals[j][1])))
- {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * This method is not necessary for this class, thus it always returns null.
- *
- * @return null.
- */
- public PermissionCollection newPermissionCollection()
- {
- return null;
- }
-
- // Inner class.
- // -------------------------------------------------------------------------
-
- /**
- * An undocumented inner class present for serialization compatibility.
- */
- private static class CredOwner implements Serializable
- {
-
- // Fields.
- // -----------------------------------------------------------------------
-
- private final String principalClass;
- private final String principalName;
-
- // Constructor.
- // -----------------------------------------------------------------------
-
- CredOwner (final String principalClass, final String principalName)
- {
- this.principalClass = principalClass;
- this.principalName = principalName;
- }
-
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public boolean equals (Object o)
- {
- if (!(o instanceof CredOwner))
- {
- return false;
- }
- return principalClass.equals (((CredOwner) o).getPrincipalClass()) &&
- principalName.equals (((CredOwner) o).getPrincipalName());
- }
-
- public int hashCode()
- {
- return principalClass.hashCode() + principalName.hashCode();
- }
-
- public String getPrincipalClass()
- {
- return principalClass;
- }
-
- public String getPrincipalName()
- {
- return principalName;
- }
- }
-}
diff --git a/libjava/javax/security/auth/RefreshFailedException.java b/libjava/javax/security/auth/RefreshFailedException.java
deleted file mode 100644
index 6b8f94dcd33..00000000000
--- a/libjava/javax/security/auth/RefreshFailedException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* RefreshFailedException.java -- signals a failed refresh.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth;
-
-/**
- * A signal that a call to {@link Refreshable#refresh()} failed.
- */
-public class RefreshFailedException extends Exception
-{
-
- /**
- * Create a new RefreshFailedException with no detail message.
- */
- public RefreshFailedException()
- {
- }
-
- /**
- * Create a new RefreshFailedException with a detail message.
- *
- * @param message The detail message.
- */
- public RefreshFailedException (String message)
- {
- super (message);
- }
-}
diff --git a/libjava/javax/security/auth/Refreshable.java b/libjava/javax/security/auth/Refreshable.java
deleted file mode 100644
index 14d766079e2..00000000000
--- a/libjava/javax/security/auth/Refreshable.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Refreshable.java -- an object whose state may be refreshed.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth;
-
-/**
- * An object whose internal state may be <em>refreshed:</em> as in a
- * credential object with a expiry date.
- */
-public interface Refreshable
-{
-
- /**
- * Tells whether or not this object is current. Refreshable objects that
- * are not current may need to be refreshed.
- *
- * @return Whether this object is current.
- */
- boolean isCurrent();
-
- /**
- * Refresh this object. The process involved in refreshing an object is
- * per-implementation dependent.
- *
- * @throws RefreshFailedException If refreshing this object fails.
- * @throws SecurityException If the caller does not have permission to
- * refresh, or to take the steps involved in refreshing, this object.
- */
- void refresh() throws RefreshFailedException;
-}
diff --git a/libjava/javax/security/auth/Subject.java b/libjava/javax/security/auth/Subject.java
deleted file mode 100644
index 4e35a645ddb..00000000000
--- a/libjava/javax/security/auth/Subject.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/* Subject.java -- a single entity in the system.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.DomainCombiner;
-import java.security.Principal;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import java.util.AbstractSet;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Set;
-
-public final class Subject implements Serializable
-{
- // Fields.
- // -------------------------------------------------------------------------
-
- private static final long serialVersionUID = -8308522755600156056L;
-
- /**
- * @serial The set of principals. The type of this field is SecureSet, a
- * private inner class.
- */
- private final Set principals;
-
- /**
- * @serial The read-only flag.
- */
- private boolean readOnly;
-
- private final transient SecureSet pubCred;
- private final transient SecureSet privCred;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public Subject()
- {
- principals = new SecureSet (this, SecureSet.PRINCIPALS);
- pubCred = new SecureSet (this, SecureSet.PUBLIC_CREDENTIALS);
- privCred = new SecureSet (this, SecureSet.PRIVATE_CREDENTIALS);
- readOnly = false;
- }
-
- public Subject (final boolean readOnly, final Set principals,
- final Set pubCred, final Set privCred)
- {
- if (principals == null || pubCred == null || privCred == null)
- {
- throw new NullPointerException();
- }
- this.principals = new SecureSet (this, SecureSet.PRINCIPALS, principals);
- this.pubCred = new SecureSet (this, SecureSet.PUBLIC_CREDENTIALS, pubCred);
- this.privCred = new SecureSet (this, SecureSet.PRIVATE_CREDENTIALS, privCred);
- this.readOnly = readOnly;
- }
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- /**
- * <p>Returns the subject associated with the given {@link
- * AccessControlContext}.</p>
- *
- * <p>All this method does is retrieve the Subject object from the supplied
- * context's {@link DomainCombiner}, if any, and if it is an instance of
- * a {@link SubjectDomainCombiner}.
- *
- * @param context The context to retrieve the subject from.
- * @return The subject assoctiated with the context, or <code>null</code>
- * if there is none.
- * @throws NullPointerException If <i>subject</i> is null.
- * @throws SecurityException If the caller does not have permission to get
- * the subject (<code>"getSubject"</code> target of {@link AuthPermission}.
- */
- public static Subject getSubject (final AccessControlContext context)
- {
- final SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("getSubject"));
- }
- DomainCombiner dc = context.getDomainCombiner();
- if (!(dc instanceof SubjectDomainCombiner))
- {
- return null;
- }
- return ((SubjectDomainCombiner) dc).getSubject();
- }
-
- /**
- * <p>Run a method as another subject. This method will obtain the current
- * {@link AccessControlContext} for this thread, then creates another with
- * a {@link SubjectDomainCombiner} with the given subject. The supplied
- * action will then be run with the modified context.</p>
- *
- * @param subject The subject to run as.
- * @param action The action to run.
- * @return The value returned by the privileged action.
- * @throws SecurityException If the caller is not allowed to run under a
- * different identity (<code>"doAs"</code> target of {@link AuthPermission}.
- */
- public static Object doAs (final Subject subject, final PrivilegedAction action)
- {
- final SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("doAs"));
- }
- AccessControlContext context =
- new AccessControlContext (AccessController.getContext(),
- new SubjectDomainCombiner (subject));
- return AccessController.doPrivileged (action, context);
- }
-
- /**
- * <p>Run a method as another subject. This method will obtain the current
- * {@link AccessControlContext} for this thread, then creates another with
- * a {@link SubjectDomainCombiner} with the given subject. The supplied
- * action will then be run with the modified context.</p>
- *
- * @param subject The subject to run as.
- * @param action The action to run.
- * @return The value returned by the privileged action.
- * @throws SecurityException If the caller is not allowed to run under a
- * different identity (<code>"doAs"</code> target of {@link AuthPermission}.
- * @throws PrivilegedActionException If the action throws an exception.
- */
- public static Object doAs (final Subject subject,
- final PrivilegedExceptionAction action)
- throws PrivilegedActionException
- {
- final SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("doAs"));
- }
- AccessControlContext context =
- new AccessControlContext (AccessController.getContext(),
- new SubjectDomainCombiner(subject));
- return AccessController.doPrivileged (action, context);
- }
-
- /**
- * <p>Run a method as another subject. This method will create a new
- * {@link AccessControlContext} derived from the given one, with a
- * {@link SubjectDomainCombiner} with the given subject. The supplied
- * action will then be run with the modified context.</p>
- *
- * @param subject The subject to run as.
- * @param action The action to run.
- * @param acc The context to use.
- * @return The value returned by the privileged action.
- * @throws SecurityException If the caller is not allowed to run under a
- * different identity (<code>"doAsPrivileged"</code> target of {@link
- * AuthPermission}.
- */
- public static Object doAsPrivileged (final Subject subject,
- final PrivilegedAction action,
- final AccessControlContext acc)
- {
- final SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("doAsPrivileged"));
- }
- AccessControlContext context =
- new AccessControlContext (acc, new SubjectDomainCombiner (subject));
- return AccessController.doPrivileged (action, context);
- }
-
- /**
- * <p>Run a method as another subject. This method will create a new
- * {@link AccessControlContext} derived from the given one, with a
- * {@link SubjectDomainCombiner} with the given subject. The supplied
- * action will then be run with the modified context.</p>
- *
- * @param subject The subject to run as.
- * @param action The action to run.
- * @param acc The context to use.
- * @return The value returned by the privileged action.
- * @throws SecurityException If the caller is not allowed to run under a
- * different identity (<code>"doAsPrivileged"</code> target of
- * {@link AuthPermission}.
- * @throws PrivilegedActionException If the action throws an exception.
- */
- public static Object doAsPrivileged (final Subject subject,
- final PrivilegedExceptionAction action,
- AccessControlContext acc)
- throws PrivilegedActionException
- {
- final SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("doAsPrivileged"));
- }
- if (acc == null)
- acc = new AccessControlContext (new java.security.ProtectionDomain[0]);
- AccessControlContext context =
- new AccessControlContext (acc, new SubjectDomainCombiner (subject));
- return AccessController.doPrivileged (action, context);
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public boolean equals (Object o)
- {
- if (!(o instanceof Subject))
- {
- return false;
- }
- Subject that = (Subject) o;
- return principals.containsAll (that.getPrincipals()) &&
- pubCred.containsAll (that.getPublicCredentials()) &&
- privCred.containsAll (that.getPrivateCredentials());
- }
-
- public Set getPrincipals()
- {
- return principals;
- }
-
- public Set getPrincipals(Class clazz)
- {
- HashSet result = new HashSet (principals.size());
- for (Iterator it = principals.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o != null && clazz.isAssignableFrom (o.getClass()))
- {
- result.add(o);
- }
- }
- return Collections.unmodifiableSet (result);
- }
-
- public Set getPrivateCredentials()
- {
- return privCred;
- }
-
- public Set getPrivateCredentials (Class clazz)
- {
- HashSet result = new HashSet (privCred.size());
- for (Iterator it = privCred.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o != null && clazz.isAssignableFrom (o.getClass()))
- {
- result.add(o);
- }
- }
- return Collections.unmodifiableSet (result);
- }
-
- public Set getPublicCredentials()
- {
- return pubCred;
- }
-
- public Set getPublicCredentials (Class clazz)
- {
- HashSet result = new HashSet (pubCred.size());
- for (Iterator it = pubCred.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o != null && clazz.isAssignableFrom (o.getClass()))
- {
- result.add(o);
- }
- }
- return Collections.unmodifiableSet (result);
- }
-
- public int hashCode()
- {
- return principals.hashCode() + privCred.hashCode() + pubCred.hashCode();
- }
-
- /**
- * <p>Returns whether or not this subject is read-only.</p>
- *
- * @return True is this subject is read-only.
- */
- public boolean isReadOnly()
- {
- return readOnly;
- }
-
- /**
- * <p>Marks this subject as read-only.</p>
- *
- * @throws SecurityException If the caller does not have permission to
- * set this subject as read-only (<code>"setReadOnly"</code> target of
- * {@link AuthPermission}.
- */
- public void setReadOnly()
- {
- final SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("setReadOnly"));
- }
- readOnly = true;
- }
-
- public String toString()
- {
- return Subject.class.getName() + " [ principals=" + principals +
- ", private credentials=" + privCred + ", public credentials=" +
- pubCred + ", read-only=" + readOnly + " ]";
- }
-
- // Inner class.
- // -------------------------------------------------------------------------
-
- /**
- * An undocumented inner class that is used for sets in the parent class.
- */
- private static class SecureSet extends AbstractSet implements Serializable
- {
- // Fields.
- // -----------------------------------------------------------------------
-
- private static final long serialVersionUID = 7911754171111800359L;
-
- static final int PRINCIPALS = 0;
- static final int PUBLIC_CREDENTIALS = 1;
- static final int PRIVATE_CREDENTIALS = 2;
-
- private final Subject subject;
- private final LinkedList elements;
- private final transient int type;
-
- // Constructors.
- // -----------------------------------------------------------------------
-
- SecureSet (final Subject subject, final int type, final Collection elements)
- {
- this (subject, type);
- for (Iterator it = elements.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (type == PRINCIPALS && !(o instanceof Principal))
- {
- throw new IllegalArgumentException(o+" is not a Principal");
- }
- if (!elements.contains (o))
- {
- elements.add (o);
- }
- }
- }
-
- SecureSet (final Subject subject, final int type)
- {
- this.subject = subject;
- this.type = type;
- this.elements = new LinkedList();
- }
-
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public synchronized int size()
- {
- return elements.size();
- }
-
- public Iterator iterator()
- {
- return elements.iterator();
- }
-
- public synchronized boolean add(Object element)
- {
- if (subject.isReadOnly())
- {
- throw new IllegalStateException ("subject is read-only");
- }
- final SecurityManager sm = System.getSecurityManager();
- switch (type)
- {
- case PRINCIPALS:
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("modifyPrincipals"));
- }
- if (!(element instanceof Principal))
- {
- throw new IllegalArgumentException ("element is not a Principal");
- }
- break;
-
- case PUBLIC_CREDENTIALS:
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("modifyPublicCredentials"));
- }
- break;
-
- case PRIVATE_CREDENTIALS:
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("modifyPrivateCredentials"));
- }
- break;
-
- default:
- throw new Error ("this statement should be unreachable");
- }
-
- if (elements.contains (element))
- {
- return false;
- }
-
- return elements.add (element);
- }
-
- public synchronized boolean remove (final Object element)
- {
- if (subject.isReadOnly())
- {
- throw new IllegalStateException ("subject is read-only");
- }
- final SecurityManager sm = System.getSecurityManager();
- switch (type)
- {
- case PRINCIPALS:
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("modifyPrincipals"));
- }
- if (!(element instanceof Principal))
- {
- throw new IllegalArgumentException ("element is not a Principal");
- }
- break;
-
- case PUBLIC_CREDENTIALS:
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("modifyPublicCredentials"));
- }
- break;
-
- case PRIVATE_CREDENTIALS:
- if (sm != null)
- {
- sm.checkPermission (new AuthPermission ("modifyPrivateCredentials"));
- }
- break;
-
- default:
- throw new Error("this statement should be unreachable");
- }
-
- return elements.remove(element);
- }
-
- public synchronized boolean contains (final Object element)
- {
- return elements.remove (element);
- }
-
- public boolean removeAll (final Collection c)
- {
- if (subject.isReadOnly())
- {
- throw new IllegalStateException ("subject is read-only");
- }
- return super.removeAll (c);
- }
-
- public boolean retainAll (final Collection c)
- {
- if (subject.isReadOnly())
- {
- throw new IllegalStateException ("subject is read-only");
- }
- return super.retainAll (c);
- }
-
- public void clear()
- {
- if (subject.isReadOnly())
- {
- throw new IllegalStateException ("subject is read-only");
- }
- elements.clear();
- }
-
- private synchronized void writeObject (ObjectOutputStream out)
- throws IOException
- {
- throw new UnsupportedOperationException ("FIXME: determine serialization");
- }
-
- private void readObject (ObjectInputStream in)
- throws ClassNotFoundException, IOException
- {
- throw new UnsupportedOperationException ("FIXME: determine serialization");
- }
- }
-}
diff --git a/libjava/javax/security/auth/SubjectDomainCombiner.java b/libjava/javax/security/auth/SubjectDomainCombiner.java
deleted file mode 100644
index 94a7160eb18..00000000000
--- a/libjava/javax/security/auth/SubjectDomainCombiner.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* SubjectDomainCombiner.java -- domain combiner for Subjects.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth;
-
-import java.security.DomainCombiner;
-import java.security.Principal;
-import java.security.ProtectionDomain;
-
-import java.util.LinkedList;
-
-public class SubjectDomainCombiner implements DomainCombiner
-{
-
- // Field.
- // -------------------------------------------------------------------------
-
- private final Subject subject;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public SubjectDomainCombiner (final Subject subject)
- {
- this.subject = subject;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public ProtectionDomain[] combine (final ProtectionDomain[] current,
- final ProtectionDomain[] assigned)
- {
- LinkedList domains = new LinkedList();
- Principal[] principals =
- (Principal[]) subject.getPrincipals().toArray (new Principal[0]);
- if (current != null)
- {
- for (int i = 0; i < current.length; i++)
- {
- domains.add (new ProtectionDomain (current[i].getCodeSource(),
- current[i].getPermissions(),
- current[i].getClassLoader(),
- principals));
- }
- }
- if (assigned != null)
- {
- for (int i = 0; i < assigned.length; i++)
- {
- domains.add (assigned[i]);
- }
- }
- return (ProtectionDomain[]) domains.toArray (new ProtectionDomain[domains.size()]);
- }
-
- public Subject getSubject()
- {
- return subject;
- }
-}
diff --git a/libjava/javax/security/auth/callback/Callback.java b/libjava/javax/security/auth/callback/Callback.java
deleted file mode 100644
index 359828e1a3c..00000000000
--- a/libjava/javax/security/auth/callback/Callback.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Callback.java -- marker interface for callback classes
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.callback;
-
-/**
- * <p>Implementations of this interface are passed to a {@link CallbackHandler},
- * allowing underlying security services the ability to interact with a calling
- * application to retrieve specific authentication data such as usernames and
- * passwords, or to display certain information, such as error and warning
- * messages.</p>
- *
- * <p><code>Callback</code> implementations do not retrieve or display the
- * information requested by underlying security services. <code>Callback</code>
- * implementations simply provide the means to pass such requests to
- * applications, and for applications, if appropriate, to return requested
- * information back to the underlying security services.</p>
- *
- * @see CallbackHandler
- * @see ChoiceCallback
- * @see ConfirmationCallback
- * @see LanguageCallback
- * @see NameCallback
- * @see PasswordCallback
- * @see TextInputCallback
- * @see TextOutputCallback
- */
-public interface Callback {
-}
diff --git a/libjava/javax/security/auth/callback/CallbackHandler.java b/libjava/javax/security/auth/callback/CallbackHandler.java
deleted file mode 100644
index 8d22943cace..00000000000
--- a/libjava/javax/security/auth/callback/CallbackHandler.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/* CallbackHandler.java -- base interface for callback handlers.
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.callback;
-
-import java.io.IOException;
-
-/**
- * <p>An application implements a <code>CallbackHandler</code> and passes it to
- * underlying security services so that they may interact with the application
- * to retrieve specific authentication data, such as usernames and passwords, or
- * to display certain information, such as error and warning messages.</p>
- *
- * <p><code>CallbackHandler</code>s are implemented in an application-dependent
- * fashion. For example, implementations for an application with a graphical
- * user interface (GUI) may pop up windows to prompt for requested information
- * or to display error messages. An implementation may also choose to obtain
- * requested information from an alternate source without asking the end user.</p>
- *
- * <p>Underlying security services make requests for different types of
- * information by passing individual Callbacks to the <code>CallbackHandler</code>.
- * The <code>CallbackHandler</code> implementation decides how to retrieve and
- * display information depending on the {@link Callback}s passed to it. For
- * example, if the underlying service needs a username and password to
- * authenticate a user, it uses a {@link NameCallback} and
- * {@link PasswordCallback}. The <code>CallbackHandler</code> can then choose
- * to prompt for a username and password serially, or to prompt for both in a
- * single window.</p>
- *
- * <p>A default <code>CallbackHandler</code> class implementation may be
- * specified in the <code>auth.login.defaultCallbackHandler</code> security
- * property. The security property can be set in the Java security properties
- * file located in the file named
- * <code>&lt;JAVA_HOME>/lib/security/java.security</code>, where
- * <code>&lt;JAVA_HOME></code> refers to the directory where the SDK was
- * installed.</p>
- *
- * <p>If the security property is set to the fully qualified name of a
- * <code>CallbackHandler</code> implementation class, then a
- * <code>LoginContext</code>will load the specified <code>CallbackHandler</code>
- * and pass it to the underlying <code>LoginModules</code>. The
- * <code>LoginContext</code> only loads the default handler if one was not
- * provided.</p>
- *
- * <p>All default handler implementations must provide a public zero-argument
- * constructor.</p>
- *
- */
-public interface CallbackHandler
-{
-
- /**
- * <p>Retrieve or display the information requested in the provided
- * {@link Callback}s.</p>
- *
- * <p>The <code>handle()</code> method implementation checks the instance(s)
- * of the {@link Callback} object(s) passed in to retrieve or display the
- * requested information. The following example is provided to help
- * demonstrate what an <code>handle()</code> method implementation might look
- * like. This example code is for guidance only. Many details, including
- * proper error handling, are left out for simplicity.</p>
- *
- * <pre>
- *public void handle(Callback[] callbacks)
- *throws IOException, UnsupportedCallbackException {
- * for (int i = 0; i < callbacks.length; i++) {
- * if (callbacks[i] instanceof TextOutputCallback) {
- * // display the message according to the specified type
- * TextOutputCallback toc = (TextOutputCallback)callbacks[i];
- * switch (toc.getMessageType()) {
- * case TextOutputCallback.INFORMATION:
- * System.out.println(toc.getMessage());
- * break;
- * case TextOutputCallback.ERROR:
- * System.out.println("ERROR: " + toc.getMessage());
- * break;
- * case TextOutputCallback.WARNING:
- * System.out.println("WARNING: " + toc.getMessage());
- * break;
- * default:
- * throw new IOException("Unsupported message type: "
- * + toc.getMessageType());
- * }
- * } else if (callbacks[i] instanceof NameCallback) {
- * // prompt the user for a username
- * NameCallback nc = (NameCallback)callbacks[i];
- * // ignore the provided defaultName
- * System.err.print(nc.getPrompt());
- * System.err.flush();
- * nc.setName((new BufferedReader(
- * new InputStreamReader(System.in))).readLine());
- * } else if (callbacks[i] instanceof PasswordCallback) {
- * // prompt the user for sensitive information
- * PasswordCallback pc = (PasswordCallback)callbacks[i];
- * System.err.print(pc.getPrompt());
- * System.err.flush();
- * pc.setPassword(readPassword(System.in));
- * } else {
- * throw new UnsupportedCallbackException(
- * callbacks[i], "Unrecognized Callback");
- * }
- * }
- *}
- *
- * // Reads user password from given input stream.
- *private char[] readPassword(InputStream in) throws IOException {
- * // insert code to read a user password from the input stream
- *}
- * </pre>
- *
- * @param callbacks an array of {@link Callback} objects provided by an
- * underlying security service which contains the information requested to
- * be retrieved or displayed.
- * @throws IOException if an input or output error occurs.
- * @throws UnsupportedCallbackException if the implementation of this method
- * does not support one or more of the Callbacks specified in the
- * <code>callbacks</code> parameter.
- */
- void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException;
-}
diff --git a/libjava/javax/security/auth/callback/ChoiceCallback.java b/libjava/javax/security/auth/callback/ChoiceCallback.java
deleted file mode 100644
index ec12a668514..00000000000
--- a/libjava/javax/security/auth/callback/ChoiceCallback.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/* ChoiceCallback.java -- callback for a choice of values.
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.callback;
-
-import java.io.Serializable;
-
-/**
- * Underlying security services instantiate and pass a
- * <code>ChoiceCallback</code> to the <code>handle()</code> method of a
- * {@link CallbackHandler} to display a list of choices and to retrieve the
- * selected choice(s).
- *
- * @see CallbackHandler
- */
-public class ChoiceCallback implements Callback, Serializable
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /**
- * @serial
- * @since 1.4
- */
- private String prompt;
-
- /**
- * @serial the list of choices.
- * @since 1.4
- */
- private String[] choices;
-
- /**
- * @serial the choice to be used as the default choice.
- * @since 1.4
- */
- private int defaultChoice;
-
- /**
- * @serial whether multiple selections are allowed from the list of choices.
- * @since 1.4
- */
- private boolean multipleSelectionsAllowed;
-
- /**
- * @serial the selected choices, represented as indexes into the choices list.
- * @since 1.4
- */
- private int[] selections;
-
- // Constructor(s)
- //--------------------------------------------------------------------------
-
- /**
- * Construct a <code>ChoiceCallback</code> with a prompt, a list of choices,
- * a default choice, and a boolean specifying whether or not multiple
- * selections from the list of choices are allowed.
- *
- * @param prompt the prompt used to describe the list of choices.
- * @param choices the list of choices.
- * @param defaultChoice the choice to be used as the default choice when the
- * list of choices are displayed. This value is represented as an index into
- * the <code>choices</code> array.
- * @param multipleSelectionsAllowed boolean specifying whether or not
- * multiple selections can be made from the list of choices.
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
- * if <code>prompt</code> has a length of <code>0</code>, if <code>choices</code>
- * is <code>null</code>, if <code>choices</code> has a length of <code>0</code>,
- * if any element from <code>choices</code> is <code>null</code>, if any
- * element from <code>choices</code> has a length of <code>0</code> or if
- * <code>defaultChoice</code> does not fall within the array boundaries of
- * <code>choices</code>.
- */
- public ChoiceCallback(String prompt, String[] choices, int defaultChoice,
- boolean multipleSelectionsAllowed)
- {
- super();
-
- setPrompt(prompt);
- setChoices(choices);
- if (defaultChoice < 0 || defaultChoice >= this.choices.length)
- {
- throw new IllegalArgumentException("default choice is out of bounds");
- }
- this.defaultChoice = defaultChoice;
- this.multipleSelectionsAllowed = multipleSelectionsAllowed;
- }
-
- // Instance methods
- // -------------------------------------------------------------------------
-
- /**
- * Get the prompt.
- *
- * @return the prompt.
- */
- public String getPrompt()
- {
- return prompt;
- }
-
- /**
- * Get the list of choices.
- *
- * @return the list of choices.
- */
- public String[] getChoices()
- {
- return choices;
- }
-
- /**
- * Get the defaultChoice.
- *
- * @return the defaultChoice, represented as an index into the choices list.
- */
- public int getDefaultChoice()
- {
- return defaultChoice;
- }
-
- /**
- * Get the boolean determining whether multiple selections from the choices
- * list are allowed.
- *
- * @return whether multiple selections are allowed.
- */
- public boolean allowMultipleSelections()
- {
- return multipleSelectionsAllowed;
- }
-
- /**
- * Set the selected choice.
- *
- * @param selection the selection represented as an index into the choices
- * list.
- * @see #getSelectedIndexes()
- */
- public void setSelectedIndex(int selection)
- {
- this.selections = new int[1];
- this.selections[0] = selection;
- }
-
- /**
- * Set the selected choices.
- *
- * @param selections the selections represented as indexes into the choices
- * list.
- * @throws UnsupportedOperationException if multiple selections are not
- * allowed, as determined by <code>allowMultipleSelections</code>.
- * @see #getSelectedIndexes()
- */
- public void setSelectedIndexes(int[] selections)
- {
- if (!multipleSelectionsAllowed)
- {
- throw new UnsupportedOperationException("not allowed");
- }
-
- this.selections = selections;
- }
-
- /**
- * Get the selected choices.
- *
- * @return the selected choices, represented as indexes into the choices list.
- * @see #setSelectedIndexes(int[])
- */
- public int[] getSelectedIndexes()
- {
- return selections;
- }
-
- private void setPrompt(String prompt) throws IllegalArgumentException
- {
- if ((prompt == null) || (prompt.length() == 0))
- {
- throw new IllegalArgumentException("invalid prompt");
- }
- this.prompt = prompt;
- }
-
- private void setChoices(String[] choices) throws IllegalArgumentException
- {
- if (choices == null || choices.length == 0)
- {
- throw new IllegalArgumentException("invalid choices");
- }
- for (int i = 0; i < choices.length; i++)
- {
- if (choices[i] == null || choices[i].length() == 0)
- {
- throw new IllegalArgumentException("invalid choice at index #"+i);
- }
- }
- this.choices = choices;
- }
-}
diff --git a/libjava/javax/security/auth/callback/ConfirmationCallback.java b/libjava/javax/security/auth/callback/ConfirmationCallback.java
deleted file mode 100644
index 938b3017380..00000000000
--- a/libjava/javax/security/auth/callback/ConfirmationCallback.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/* ConfirmationCallback.java -- callback for confirmations.
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.callback;
-
-import java.io.Serializable;
-
-/**
- * Underlying security services instantiate and pass a
- * <code>ConfirmationCallback</code> to the <code>handle()</code> method of a
- * {@link CallbackHandler} to ask for YES/NO, OK/CANCEL, YES/NO/CANCEL or other
- * similar confirmations.
- *
- * @see CallbackHandler
- */
-public class ConfirmationCallback implements Callback, Serializable
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /**
- * <p>Unspecified option type.</p>
- *
- * <p>The <code>getOptionType</code> method returns this value if this
- * <code>ConfirmationCallback</code> was instantiated with <code>options</code>
- * instead of an <code>optionType</code>.</p>
- */
- public static final int UNSPECIFIED_OPTION = -1;
-
- /**
- * <p>YES/NO confirmation option.</p>
- *
- * <p>An underlying security service specifies this as the <code>optionType</code>
- * to a <code>ConfirmationCallback</code> constructor if it requires a
- * confirmation which can be answered with either <code>YES</code> or
- * <code>NO</code>.</p>
- */
- public static final int YES_NO_OPTION = 0;
-
- /**
- * <p>YES/NO/CANCEL confirmation confirmation option.</p>
- *
- * <p>An underlying security service specifies this as the <code>optionType</code>
- * to a <code>ConfirmationCallback</code> constructor if it requires a
- * confirmation which can be answered with either <code>YES</code>,
- * <code>NO</code> or <code>CANCEL</code>.
- */
- public static final int YES_NO_CANCEL_OPTION = 1;
-
- /**
- * <p>OK/CANCEL confirmation confirmation option.</p>
- *
- * <p>An underlying security service specifies this as the <code>optionType</code>
- * to a <code>ConfirmationCallback</code> constructor if it requires a
- * confirmation which can be answered with either <code>OK</code> or
- * <code>CANCEL</code>.</p>
- */
- public static final int OK_CANCEL_OPTION = 2;
-
- /**
- * <p>YES option.</p>
- *
- * <p>If an <code>optionType</code> was specified to this
- * <code>ConfirmationCallback</code>, this option may be specified as a
- * <code>defaultOption</code> or returned as the selected index.</p>
- */
- public static final int YES = 0;
-
- /**
- * <p>NO option.</p>
- *
- * <p>If an <code>optionType</code> was specified to this
- * <code>ConfirmationCallback</code>, this option may be specified as a
- * <code>defaultOption</code> or returned as the selected index.</p>
- */
- public static final int NO = 1;
-
- /**
- * <p>CANCEL option.</p>
- *
- * <p>If an <code>optionType</code> was specified to this
- * <code>ConfirmationCallback</code>, this option may be specified as a
- * <code>defaultOption</code> or returned as the selected index.</p>
- */
- public static final int CANCEL = 2;
-
- /**
- * <p>OK option.</p>
- *
- * <p>If an <code>optionType</code> was specified to this
- * <code>ConfirmationCallback</code>, this option may be specified as a
- * <code>defaultOption</code> or returned as the selected index.</p>
- */
- public static final int OK = 3;
-
- /** INFORMATION message type. */
- public static final int INFORMATION = 0;
-
- /** WARNING message type. */
- public static final int WARNING = 1;
-
- /** ERROR message type. */
- public static final int ERROR = 2;
-
- /**
- * @serial
- * @since 1.4
- */
- private String prompt;
-
- /**
- * @serial
- * @since 1.4
- */
- private int messageType;
-
- /**
- * @serial
- * @since 1.4
- */
- private int optionType;
-
- /**
- * @serial
- * @since 1.4
- */
- private int defaultOption;
-
- /**
- * @serial
- * @since 1.4
- */
- private String[] options = null;
-
- /**
- * @serial
- * @since 1.4
- */
- private int selection;
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- /**
- * <p>Construct a <code>ConfirmationCallback</code> with a message type, an
- * option type and a default option.</p>
- *
- * <p>Underlying security services use this constructor if they require
- * either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation.</p>
- *
- * @param messageType the message type (INFORMATION, WARNING or ERROR).
- * @param optionType the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or
- * OK_CANCEL_OPTION).
- * @param defaultOption the default option from the provided optionType (YES,
- * NO, CANCEL or OK).
- * @throws IllegalArgumentException if <code>messageType</code> is not either
- * <code>INFORMATION</code>, <code>WARNING</code>, or <code>ERROR</code>, if
- * <code>optionType</code> is not either <code>YES_NO_OPTION</code>,
- * <code>YES_NO_CANCEL_OPTION</code>, or <code>OK_CANCEL_OPTION</code>, or if
- * <code>defaultOption</code> does not correspond to one of the options in
- * <code>optionType</code>.
- */
- public ConfirmationCallback(int messageType, int optionType, int defaultOption)
- throws IllegalArgumentException
- {
- super();
-
- setMessageType(messageType);
- setOptionType(optionType, defaultOption);
- this.defaultOption = defaultOption;
- }
-
- /**
- * <p>Construct a <code>ConfirmationCallback</code> with a message type, a
- * list of options and a default option.</p>
- *
- * <p>Underlying security services use this constructor if they require a
- * confirmation different from the available preset confirmations provided
- * (for example, CONTINUE/ABORT or STOP/GO). The confirmation options are
- * listed in the <code>options</code> array, and are displayed by the
- * {@link CallbackHandler} implementation in a manner consistent with the
- * way preset options are displayed.</p>
- *
- * @param messageType the message type (INFORMATION, WARNING or ERROR).
- * @param options the list of confirmation options.
- * @param defaultOption the default option, represented as an index into the
- * <code>options</code> array.
- * @throws IllegalArgumentException if <code>messageType</code> is not either
- * <code>INFORMATION</code>, <code>WARNING</code>, or <code>ERROR</code>, if
- * <code>options</code> is <code>null</code>, if <code>options</code> has a
- * length of <code>0</code>, if any element from <code>options</code> is
- * <code>null</code>, if any element from <code>options</code> has a length
- * of <code>0</code>, or if <code>defaultOption</code> does not lie within
- * the array boundaries of <code>options</code>.
- */
- public ConfirmationCallback(int messageType, String[] options, int defaultOption)
- {
- super();
-
- setMessageType(messageType);
- setOptions(options, defaultOption);
- this.defaultOption = defaultOption;
- }
-
- /**
- * <p>Construct a <code>ConfirmationCallback</code> with a prompt, message
- * type, an option type and a default option.</p>
- *
- * <p>Underlying security services use this constructor if they require
- * either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation.</p>
- *
- * @param prompt the prompt used to describe the list of options.
- * @param messageType the message type (INFORMATION, WARNING or ERROR).
- * @param optionType the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or
- * OK_CANCEL_OPTION).
- * @param defaultOption the default option from the provided optionType (YES,
- * NO, CANCEL or OK).
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
- * if <code>prompt</code> has a length of <code>0</code>, if
- * <code>messageType</code> is not either <code>INFORMATION</code>,
- * <code>WARNING</code>, or <code>ERROR</code>, if <code>optionType</code> is
- * not either <code>YES_NO_OPTION</code>, <code>YES_NO_CANCEL_OPTION</code>,
- * or <code>OK_CANCEL_OPTION</code>, or if <code>defaultOption</code> does
- * not correspond to one of the options in <code>optionType</code>.
- */
- public ConfirmationCallback(String prompt, int messageType, int optionType,
- int defaultOption)
- {
- super();
-
- setPrompt(prompt);
- setMessageType(messageType);
- setOptionType(optionType, defaultOption);
- this.defaultOption = defaultOption;
- }
-
- /**
- * <p>Construct a <code>ConfirmationCallback</code> with a prompt, message
- * type, a list of options and a default option.</p>
- *
- * <p>Underlying security services use this constructor if they require a
- * confirmation different from the available preset confirmations provided
- * (for example, CONTINUE/ABORT or STOP/GO). The confirmation options are
- * listed in the <code>options</code> array, and are displayed by the
- * {@link CallbackHandler} implementation in a manner consistent with the
- * way preset options are displayed.</p>
- *
- * @param prompt the prompt used to describe the list of options.
- * @param messageType the message type (INFORMATION, WARNING or ERROR).
- * @param options the list of confirmation options.
- * @param defaultOption the default option, represented as an index into the
- * <code>options</code> array.
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
- * if <code>prompt</code> has a length of <code>0</code>, if
- * <code>messageType</code> is not either <code>INFORMATION</code>,
- * <code>WARNING</code>, or <code>ERROR</code>, if <code>options</code> is
- * <code>null</code>, if <code>options</code> has a length of <code>0</code>,
- * if any element from <code>options</code> is <code>null</code>, if any
- * element from <code>options</code> has a length of <code>0</code>, or if
- * <code>defaultOption</code> does not lie within the array boundaries of
- * <code>options</code>.
- */
- public ConfirmationCallback(String prompt, int messageType, String[] options,
- int defaultOption)
- {
- super();
-
- setPrompt(prompt);
- setMessageType(messageType);
- setOptions(options, defaultOption);
- this.defaultOption = defaultOption;
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- // Instance methods
- // -------------------------------------------------------------------------
-
- /**
- * Get the prompt.
- *
- * @return the prompt, or <code>null</code> if this
- * <code>ConfirmationCallback</code> was instantiated without a prompt.
- */
- public String getPrompt()
- {
- return prompt;
- }
-
- /**
- * Get the message type.
- *
- * @return the message type (INFORMATION, WARNING or ERROR).
- */
- public int getMessageType()
- {
- return messageType;
- }
-
- /**
- * <p>Get the option type.</p>
- *
- * <p>If this method returns {@link #UNSPECIFIED_OPTION}, then this
- * <code>ConfirmationCallback</code> was instantiated with <code>options</code>
- * instead of an <code>optionType</code>. In this case, invoke the
- * {@link #getOptions()} method to determine which confirmation options to
- * display.</p>
- *
- * @return the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or
- * OK_CANCEL_OPTION), or UNSPECIFIED_OPTION if this
- * <code>ConfirmationCallback</code> was instantiated with <code>options</code>
- * instead of an <code>optionType</code>.
- */
- public int getOptionType()
- {
- if (options != null)
- {
- return UNSPECIFIED_OPTION;
- }
- return optionType;
- }
-
- /**
- * Get the confirmation options.
- *
- * @return the list of confirmation options, or <code>null</code> if this
- * <code>ConfirmationCallback</code> was instantiated with an
- * <code>optionType</code> instead of <code>options</code>.
- */
- public String[] getOptions()
- {
- return options;
- }
-
- /**
- * Get the default option.
- *
- * @return the default option, represented as <code>YES</code>, <code>NO</code>,
- * <code>OK</code> or <code>CANCEL</code> if an <code>optionType</code> was
- * specified to the constructor of this <code>ConfirmationCallback</code>.
- * Otherwise, this method returns the default option as an index into the
- * <code>options</code> array specified to the constructor of this
- * <code>ConfirmationCallback</code>.
- */
- public int getDefaultOption()
- {
- return defaultOption;
- }
-
- /**
- * Set the selected confirmation option.
- *
- * @param selection the selection represented as <code>YES</code>,
- * <code>NO</code>, <code>OK</code> or <code>CANCEL</code> if an
- * <code>optionType</code> was specified to the constructor of this
- * <code>ConfirmationCallback</code>. Otherwise, the <code>selection</code>
- * represents the index into the <code>options</code> array specified to the
- * constructor of this <code>ConfirmationCallback</code>.
- * @see #getSelectedIndex()
- */
- public void setSelectedIndex(int selection)
- {
- if (options != null)
- {
- setOptions(options, selection);
- }
- else
- {
- setOptionType(optionType, selection);
- }
- }
-
- /**
- * Get the selected confirmation option.
- *
- * @return the selected confirmation option represented as <code>YES</code>,
- * <code>NO</code>, <code>OK</code> or <code>CANCEL</code> if an
- * <code>optionType</code> was specified to the constructor of this
- * <code>ConfirmationCallback</code>. Otherwise, this method returns the
- * selected confirmation option as an index into the <code>options</code>
- * array specified to the constructor of this <code>ConfirmationCallback</code>.
- * @see #setSelectedIndex(int)
- */
- public int getSelectedIndex()
- {
- return this.selection;
- }
-
- private void setMessageType(int messageType) throws IllegalArgumentException
- {
- switch (messageType)
- {
- case INFORMATION:
- case WARNING:
- case ERROR: this.messageType = messageType; break;
- default: throw new IllegalArgumentException("illegal message type");
- }
- }
-
- private void setOptionType(int optionType, int selectedOption)
- throws IllegalArgumentException
- {
- switch (optionType)
- {
- case YES_NO_OPTION:
- this.optionType = optionType;
- switch (selectedOption)
- {
- case YES:
- case NO: this.selection = selectedOption; break;
- default: throw new IllegalArgumentException("invalid option");
- }
- break;
- case YES_NO_CANCEL_OPTION:
- this.optionType = optionType;
- switch (selectedOption)
- {
- case YES:
- case NO:
- case CANCEL: this.selection = selectedOption; break;
- default: throw new IllegalArgumentException("invalid option");
- }
- break;
- case OK_CANCEL_OPTION:
- this.optionType = optionType;
- switch (selectedOption)
- {
- case OK:
- case CANCEL: this.selection = selectedOption; break;
- default: throw new IllegalArgumentException("invalid option");
- }
- break;
- default:
- throw new IllegalArgumentException("illegal option type");
- }
- }
-
- private void setOptions(String[] options, int selectedOption)
- throws IllegalArgumentException
- {
- if ((selectedOption < 0) || (selectedOption > options.length - 1))
- {
- throw new IllegalArgumentException("invalid selection");
- }
- if ((options == null) || (options.length == 0))
- {
- throw new IllegalArgumentException("options is null or empty");
- }
- for (int i = 0; i < options.length; i++)
- {
- if ((options[i] == null) || (options[i].length() == 0))
- {
- throw new IllegalArgumentException("options[" + i + "] is null or empty");
- }
- }
- this.options = options;
- this.selection = selectedOption;
- }
-
- private void setPrompt(String prompt) throws IllegalArgumentException
- {
- if ((prompt == null) || (prompt.length() == 0))
- {
- throw new IllegalArgumentException("prompt is null or empty");
- }
- this.prompt = prompt;
- }
-}
diff --git a/libjava/javax/security/auth/callback/LanguageCallback.java b/libjava/javax/security/auth/callback/LanguageCallback.java
deleted file mode 100644
index e0190e6ccaf..00000000000
--- a/libjava/javax/security/auth/callback/LanguageCallback.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* LanguageCallback.java -- callback for language choices.
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.callback;
-
-import java.io.Serializable;
-import java.util.Locale;
-
-/**
- * Underlying security services instantiate and pass a <code>LanguageCallback</code>
- * to the <code>handle()</code> method of a {@link CallbackHandler} to retrieve
- * the {@link Locale} used for localizing text.
- *
- * @see CallbackHandler
- */
-public class LanguageCallback implements Callback, Serializable
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /**
- * @serial
- * @since 1.4
- */
- private Locale locale;
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- /** Construct a <code>LanguageCallback</code>. */
- public LanguageCallback()
- {
- super();
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- // Instance methods
- // -------------------------------------------------------------------------
-
- /**
- * Set the retrieved Locale.
- *
- * @param locale the retrieved Locale.
- * @see #getLocale()
- */
- public void setLocale(Locale locale)
- {
- this.locale = locale;
- }
-
- /**
- * Get the retrieved Locale.
- *
- * @return the retrieved Locale, or <code>null</code> if no Locale could be
- * retrieved.
- * @see #setLocale(Locale)
- */
- public Locale getLocale()
- {
- return locale;
- }
-}
diff --git a/libjava/javax/security/auth/callback/NameCallback.java b/libjava/javax/security/auth/callback/NameCallback.java
deleted file mode 100644
index 0e281d1cc8b..00000000000
--- a/libjava/javax/security/auth/callback/NameCallback.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/* NameCallback.java -- callback for user names.
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.callback;
-
-import java.io.Serializable;
-
-/**
- * Underlying security services instantiate and pass a <code>NameCallback</code>
- * to the <code>handle()</code> method of a {@link CallbackHandler} to retrieve
- * name information.
- *
- * @see CallbackHandler
- */
-public class NameCallback implements Callback, Serializable
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /**
- * @serial
- * @since 1.4
- */
- private String prompt;
-
- /**
- * @serial
- * @since 1.4
- */
- private String defaultName;
-
- /**
- * @serial
- * @since 1.4
- */
- private String inputName;
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- /**
- * Construct a <code>NameCallback</code> with a prompt.
- *
- * @param prompt the prompt used to request the name.
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
- * or if <code>prompt</code> has a length of <code>0</code>.
- */
- public NameCallback(String prompt)
- {
- super();
-
- setPrompt(prompt);
- }
-
- /**
- * Construct a <code>NameCallback</code> with a prompt and default name.
- *
- * @param prompt the prompt used to request the information.
- * @param defaultName the name to be used as the default name displayed with
- * the prompt.
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
- * or if <code>prompt</code> has a length of <code>0</code>, if
- * <code>defaultName</code> is <code>null</code>, or if <code>defaultName</code>
- * has a length of <code>0</code>.
- */
- public NameCallback(String prompt, String defaultName)
- throws IllegalArgumentException
- {
- super();
-
- setPrompt(prompt);
- setDefaultName(defaultName);
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- // Instance methods
- // -------------------------------------------------------------------------
-
- /**
- * Get the prompt.
- *
- * @return the prompt.
- */
- public String getPrompt()
- {
- return prompt;
- }
-
- /**
- * Get the default name.
- *
- * @return the default name, or <code>null</code> if this
- * <code>NameCallback</code> was not instantiated with a
- * <code>defaultName</code>.
- */
- public String getDefaultName()
- {
- return defaultName;
- }
-
- /**
- * Set the retrieved name.
- *
- * @param name the retrieved name (which may be <code>null</code>).
- * @see #getName()
- */
- public void setName(String name)
- {
- this.inputName = name;
- }
-
- /**
- * Get the retrieved name.
- *
- * @return the retrieved name (which may be <code>null</code>)
- * @see #setName(String)
- */
- public String getName()
- {
- return inputName;
- }
-
- private void setPrompt(String prompt) throws IllegalArgumentException
- {
- if ((prompt == null) || (prompt.length() == 0))
- {
- throw new IllegalArgumentException("invalid prompt");
- }
- this.prompt = prompt;
- }
-
- private void setDefaultName(String defaultName) throws IllegalArgumentException
- {
- if ((defaultName == null) || (defaultName.length() == 0))
- {
- throw new IllegalArgumentException("invalid default name");
- }
- this.defaultName = defaultName;
- }
-}
diff --git a/libjava/javax/security/auth/callback/PasswordCallback.java b/libjava/javax/security/auth/callback/PasswordCallback.java
deleted file mode 100644
index e8c862aca3e..00000000000
--- a/libjava/javax/security/auth/callback/PasswordCallback.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/* PasswordCallback.java -- callback for passwords.
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.callback;
-
-import java.io.Serializable;
-
-/**
- * Underlying security services instantiate and pass a <code>PasswordCallback</code>
- * to the <code>handle()</code> method of a {@link CallbackHandler} to retrieve
- * password information.
- *
- * @see CallbackHandler,
- */
-public class PasswordCallback implements Callback, Serializable
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /**
- * @serial
- * @since 1.4
- */
- private String prompt;
-
- /**
- * @serial
- * @since 1.4
- */
- private boolean echoOn;
-
- /**
- * @serial
- * @since 1.4
- */
- private char[] inputPassword;
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- /**
- * Construct a <code>PasswordCallback</code> with a prompt and a boolean
- * specifying whether the password should be displayed as it is being typed.
- *
- * @param prompt the prompt used to request the password.
- * @param echoOn <code>true</code> if the password should be displayed as it
- * is being typed.
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
- * or if <code>prompt</code> has a length of <code>0</code>.
- */
- public PasswordCallback(String prompt, boolean echoOn)
- {
- super();
-
- setPrompt(prompt);
- this.echoOn = echoOn;
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- // Instance methods
- // -------------------------------------------------------------------------
-
- /**
- * Get the prompt.
- *
- * @return the prompt.
- */
- public String getPrompt()
- {
- return prompt;
- }
-
- /**
- * Return whether the password should be displayed as it is being typed.
- *
- * @return the whether the password should be displayed as it is being typed.
- */
- public boolean isEchoOn()
- {
- return echoOn;
- }
-
- /**
- * <p>Set the retrieved password.</p>
- *
- * <p>This method makes a copy of the input password before storing it.</p>
- *
- * @param password the retrieved password, which may be <code>null</code>.
- * @see #getPassword()
- */
- public void setPassword(char[] password)
- {
- inputPassword = (password == null ? null : (char[]) password.clone());
- }
-
- /**
- * <p>Get the retrieved password.</p>
- *
- * <p>This method returns a copy of the retrieved password.</p>
- *
- * @return the retrieved password, which may be <code>null</code>.
- * @see #setPassword(char[])
- */
- public char[] getPassword()
- {
- return (inputPassword == null ? null : (char[]) inputPassword.clone());
- }
-
- /** Clear the retrieved password. */
- public void clearPassword()
- {
- if (inputPassword != null)
- {
- for (int i = 0; i < inputPassword.length; i++)
- {
- inputPassword[i] = '\0';
- }
- inputPassword = null;
- }
- }
-
- private void setPrompt(String prompt) throws IllegalArgumentException
- {
- if ((prompt == null) || (prompt.length() == 0))
- {
- throw new IllegalArgumentException("invalid prompt");
- }
- this.prompt = prompt;
- }
-}
diff --git a/libjava/javax/security/auth/callback/TextInputCallback.java b/libjava/javax/security/auth/callback/TextInputCallback.java
deleted file mode 100644
index 98b0ae3c12d..00000000000
--- a/libjava/javax/security/auth/callback/TextInputCallback.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/* TextInputCallback.java -- callbacks for user input.
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.callback;
-
-import java.io.Serializable;
-
-/**
- * Underlying security services instantiate and pass a <code>TextInputCallback</code>
- * to the <code>handle()</code> method of a {@link CallbackHandler} to retrieve
- * generic text information.
- *
- * @see CallbackHandler
- */
-public class TextInputCallback implements Callback, Serializable
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /**
- * @serial
- * @since 1.4
- */
- private String prompt;
-
- /**
- * @serial
- * @since 1.4
- */
- private String defaultText;
-
- /**
- * @serial
- * @since 1.4
- */
- private String inputText;
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- /**
- * Construct a <code>TextInputCallback</code> with a prompt.
- *
- * @param prompt the prompt used to request the information.
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
- * or if <code>prompt</code> has a length of <code>0</code>.
- */
- public TextInputCallback(String prompt) throws IllegalArgumentException
- {
- super();
-
- setPrompt(prompt);
- }
-
- /**
- * Construct a <code>TextInputCallback</code> with a prompt and default
- * input value.
- *
- * @param prompt the prompt used to request the information.
- * @param defaultText the text to be used as the default text displayed with
- * the prompt.
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
- * if <code>prompt</code> has a length of <code>0</code>, if
- * <code>defaultText</code> is <code>null</code> or if <code>defaultText</code>
- * has a length of <code>0</code>.
- */
- public TextInputCallback(String prompt, String defaultText)
- throws IllegalArgumentException
- {
- super();
-
- setPrompt(prompt);
- setDefaultText(defaultText);
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- // Instance methods
- // -------------------------------------------------------------------------
-
- /**
- * Get the prompt.
- *
- * @return the prompt.
- */
- public String getPrompt()
- {
- return prompt;
- }
-
- /**
- * Get the default text.
- *
- * @return the default text, or <code>null</code> if this
- * <code>TextInputCallback</code> was not instantiated with
- * <code>defaultText</code>.
- */
- public String getDefaultText()
- {
- return defaultText;
- }
-
- /**
- * Set the retrieved text.
- *
- * @param text the retrieved text, which may be <code>null</code>.
- */
- public void setText(String text)
- {
- this.inputText = text;
- }
-
- /**
- * Get the retrieved text.
- *
- * @return the retrieved text, which may be <code>null</code>.
- */
- public String getText()
- {
- return inputText;
- }
-
- private void setPrompt(String prompt) throws IllegalArgumentException
- {
- if ((prompt == null) || (prompt.length() == 0))
- {
- throw new IllegalArgumentException("invalid prompt");
- }
- this.prompt = prompt;
- }
-
- private void setDefaultText(String defaultText) throws IllegalArgumentException
- {
- if ((defaultText == null) || (defaultText.length() == 0))
- {
- throw new IllegalArgumentException("invalid default text");
- }
- this.defaultText = defaultText;
- }
-}
diff --git a/libjava/javax/security/auth/callback/TextOutputCallback.java b/libjava/javax/security/auth/callback/TextOutputCallback.java
deleted file mode 100644
index 197cece5fe9..00000000000
--- a/libjava/javax/security/auth/callback/TextOutputCallback.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* TextOutputCallback.java -- callback for text output.
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.callback;
-
-import java.io.Serializable;
-
-/**
- * <p>Underlying security services instantiate and pass a
- * <code>TextOutputCallback</code> to the <code>handle()</code> method of a
- * {@link CallbackHandler} to display information messages, warning messages and
- * error messages.</p>
- *
- * @see CallbackHandler
- */
-public class TextOutputCallback implements Callback, Serializable
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /** Information message */
- public static final int INFORMATION = 0;
-
- /** Warning message */
- public static final int WARNING = 1;
-
- /** Error message */
- public static final int ERROR = 2;
-
- /**
- * @serial
- * @since 1.4
- */
- private int messageType;
-
- /**
- * @serial
- * @since 1.4
- */
- private String message;
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- /**
- * <p>Construct a <code>TextOutputCallback</code> with a message type and
- * message to be displayed.</p>
- *
- * @param messageType the message type (INFORMATION, WARNING or ERROR).
- * @param message the message to be displayed.
- * @throws IllegalArgumentException if <code>messageType</code> is not either
- * <code>INFORMATION</code>, <code>WARNING</code> or <code>ERROR</code>, if
- * <code>message</code> is <code>null</code>, or if <code>message</code> has
- * a length of <code>0</code>.
- */
- public TextOutputCallback(int messageType, String message)
- throws IllegalArgumentException
- {
- switch (messageType)
- {
- case INFORMATION:
- case WARNING:
- case ERROR: this.messageType = messageType; break;
- default: throw new IllegalArgumentException("invalid message type");
- }
-
- setMessage(message);
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- // Instance methods
- // -------------------------------------------------------------------------
-
- /**
- * <p>Returns the message's <code>messageType</code>.</p>
- *
- * @return the message type (INFORMATION, WARNING or ERROR).
- */
- public int getMessageType()
- {
- return messageType;
- }
-
- /**
- * <p>Returns the <code>message</code> to be displayed.</p>
- *
- * @return the message to be displayed.
- */
- public String getMessage()
- {
- return message;
- }
-
- private void setMessage(String message) throws IllegalArgumentException
- {
- if ((message == null) || (message.length() == 0))
- {
- throw new IllegalArgumentException("invalid message");
- }
- this.message = message;
- }
-}
diff --git a/libjava/javax/security/auth/callback/UnsupportedCallbackException.java b/libjava/javax/security/auth/callback/UnsupportedCallbackException.java
deleted file mode 100644
index f5308b9ea0b..00000000000
--- a/libjava/javax/security/auth/callback/UnsupportedCallbackException.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* UnsupportedCallbackException.java -- signals an unsupported callback type.
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.callback;
-
-/**
- * Signals that a {@link CallbackHandler} does not recognize a particular
- * {@link Callback}.
- *
- */
-public class UnsupportedCallbackException extends Exception
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /** @serial */
- private Callback callback;
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- /**
- * Constructs an <code>UnsupportedCallbackException</code> with no detail
- * message.
- *
- * @param callback the unrecognized {@link Callback}.
- */
- public UnsupportedCallbackException(Callback callback)
- {
- super();
-
- this.callback = callback;
- }
-
- /**
- * Constructs an <code>UnsupportedCallbackException</code> with the specified
- * detail message. A detail message is a {@link String} that describes this
- * particular exception.
- *
- * @param callback the unrecognized {@link Callback}.
- * @param msg the detail message.
- */
- public UnsupportedCallbackException(Callback callback, String msg)
- {
- super(msg);
-
- this.callback = callback;
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- // Instance methods
- // -------------------------------------------------------------------------
-
- /**
- * Get the unrecognized {@link Callback}.
- *
- * @return the unrecognized {@link Callback}.
- */
- public Callback getCallback()
- {
- return this.callback;
- }
-}
diff --git a/libjava/javax/security/auth/login/AccountExpiredException.java b/libjava/javax/security/auth/login/AccountExpiredException.java
deleted file mode 100644
index 74a97a7dd3b..00000000000
--- a/libjava/javax/security/auth/login/AccountExpiredException.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* AccountExpiredException.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.login;
-
-/**
- * An exception that signals that an attempt was made to login to an account
- * that has expired.
- */
-public class AccountExpiredException extends LoginException
-{
-
- // Constant.
- // -------------------------------------------------------------------------
-
- private static final long serialVersionUID = -6064064890162661560L;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public AccountExpiredException()
- {
- }
-
- public AccountExpiredException (String message)
- {
- super (message);
- }
-}
diff --git a/libjava/javax/security/auth/login/AppConfigurationEntry.java b/libjava/javax/security/auth/login/AppConfigurationEntry.java
deleted file mode 100644
index 557d3d7f89f..00000000000
--- a/libjava/javax/security/auth/login/AppConfigurationEntry.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/* AppConfigurationEntry.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.login;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-public class AppConfigurationEntry
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final String loginModuleName;
- private final LoginModuleControlFlag controlFlag;
- private final Map options;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public AppConfigurationEntry (final String loginModuleName,
- final LoginModuleControlFlag controlFlag,
- final Map options)
- {
- if (loginModuleName == null || loginModuleName.length() == 0)
- throw new IllegalArgumentException ("module name cannot be null nor empty");
- if (LoginModuleControlFlag.OPTIONAL != controlFlag &&
- LoginModuleControlFlag.REQUIRED != controlFlag &&
- LoginModuleControlFlag.REQUISITE != controlFlag &&
- LoginModuleControlFlag.SUFFICIENT != controlFlag)
- throw new IllegalArgumentException ("invalid controlFlag");
- if (options == null)
- throw new IllegalArgumentException ("options cannot be null");
- this.loginModuleName = loginModuleName;
- this.controlFlag = controlFlag;
- this.options = Collections.unmodifiableMap (new HashMap (options));
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public LoginModuleControlFlag getControlFlag()
- {
- return controlFlag;
- }
-
- public String getLoginModuleName()
- {
- return loginModuleName;
- }
-
- public Map getOptions()
- {
- return options;
- }
-
- // Inner class.
- // -------------------------------------------------------------------------
-
- public static class LoginModuleControlFlag
- {
-
- // Constants.
- // -----------------------------------------------------------------------
-
- public static final LoginModuleControlFlag OPTIONAL = new LoginModuleControlFlag();
- public static final LoginModuleControlFlag REQUIRED = new LoginModuleControlFlag();
- public static final LoginModuleControlFlag REQUISITE = new LoginModuleControlFlag();
- public static final LoginModuleControlFlag SUFFICIENT = new LoginModuleControlFlag();
-
- // Constructor.
- // -----------------------------------------------------------------------
-
- private LoginModuleControlFlag()
- {
- }
-
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer (LoginModuleControlFlag.class.getName());
- buf.append ('.');
- if (this == OPTIONAL)
- buf.append ("OPTIONAL");
- else if (this == REQUIRED)
- buf.append ("REQUIRED");
- else if (this == REQUISITE)
- buf.append ("REQUISITE");
- else if (this == SUFFICIENT)
- buf.append ("SUFFICIENT");
- else
- buf.append ("HARVEY_THE_RABBIT");
- return buf.toString();
- }
- }
-}
diff --git a/libjava/javax/security/auth/login/Configuration.java b/libjava/javax/security/auth/login/Configuration.java
deleted file mode 100644
index 1e0d272f19e..00000000000
--- a/libjava/javax/security/auth/login/Configuration.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Configuration.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.login;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.Security;
-
-import javax.security.auth.AuthPermission;
-
-public abstract class Configuration
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private static Configuration config;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- protected Configuration()
- {
- }
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- public static synchronized Configuration getConfiguration()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission (new AuthPermission ("getLoginConfiguration"));
- if (config == null)
- {
- String conf = (String) AccessController.doPrivileged
- (new PrivilegedAction()
- {
- public Object run()
- {
- return Security.getProperty ("login.configuration.provider");
- }
- });
- try
- {
- if (conf != null)
- config = (Configuration) Class.forName (conf).newInstance();
- else
- config = new NullConfiguration();
- }
- catch (Exception x)
- {
- config = new NullConfiguration();
- }
- }
- return config;
- }
-
- public static synchronized void setConfiguration (Configuration config)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission (new AuthPermission ("setLoginConfiguration"));
- Configuration.config = config;
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------------
-
- public abstract AppConfigurationEntry[] getAppConfigurationEntry (String applicationName);
-
- public abstract void refresh();
-
- // Package-private methods.
- // -------------------------------------------------------------------------
-
- /**
- * Get the current configuration, bypassing security checks.
- */
- static Configuration getConfig()
- {
- return config;
- }
-}
diff --git a/libjava/javax/security/auth/login/CredentialExpiredException.java b/libjava/javax/security/auth/login/CredentialExpiredException.java
deleted file mode 100644
index 03f7ec964a3..00000000000
--- a/libjava/javax/security/auth/login/CredentialExpiredException.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* CredentialExpiredException.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.login;
-
-/**
- * An exception that signals an attempt to login with a credential that
- * has expired.
- */
-public class CredentialExpiredException extends LoginException
-{
-
- // Constant.
- // -------------------------------------------------------------------------
-
- private static final long serialVersionUID = -5344739593859737937L;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public CredentialExpiredException()
- {
- }
-
- public CredentialExpiredException (String message)
- {
- super (message);
- }
-}
diff --git a/libjava/javax/security/auth/login/FailedLoginException.java b/libjava/javax/security/auth/login/FailedLoginException.java
deleted file mode 100644
index db975fbdd00..00000000000
--- a/libjava/javax/security/auth/login/FailedLoginException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* FailedLoginException.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.login;
-
-/**
- * An exception that signals that an attempt to login was unsuccessful.
- */
-public class FailedLoginException extends LoginException
-{
-
- // Constant.
- // -------------------------------------------------------------------------
-
- private static final long serialVersionUID = 802556922354616286L;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public FailedLoginException()
- {
- }
-
- public FailedLoginException (String message)
- {
- super (message);
- }
-}
diff --git a/libjava/javax/security/auth/login/LoginContext.java b/libjava/javax/security/auth/login/LoginContext.java
deleted file mode 100644
index 8fc2ca75983..00000000000
--- a/libjava/javax/security/auth/login/LoginContext.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/* LoginContext.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.login;
-
-import gnu.java.security.action.GetSecurityPropertyAction;
-
-import java.security.AccessController;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.security.auth.Subject;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.spi.LoginModule;
-
-public class LoginContext
-{
-
- private static final String OTHER = "other";
-
- private final String name;
- private final CallbackHandler cbHandler;
- private final Subject subject;
- private final AppConfigurationEntry[] entries;
- private final LoginModule[] modules;
- private final Map sharedState;
-
- public LoginContext (final String name) throws LoginException
- {
- this (name, new Subject(), defaultHandler());
- }
-
- public LoginContext (final String name, final CallbackHandler cbHandler)
- throws LoginException
- {
- this (name, new Subject(), cbHandler);
- }
-
- public LoginContext (final String name, final Subject subject)
- throws LoginException
- {
- this (name, subject, defaultHandler());
- }
-
- public LoginContext (final String name, final Subject subject,
- final CallbackHandler cbHandler)
- throws LoginException
- {
- Configuration config = Configuration.getConfig();
- AppConfigurationEntry[] entries = config.getAppConfigurationEntry (name);
- if (entries == null)
- entries = config.getAppConfigurationEntry (OTHER);
- if (entries == null)
- throw new LoginException ("no configured modules for application "
- + name);
- this.entries = entries;
- modules = new LoginModule[entries.length];
- sharedState = new HashMap();
- for (int i = 0; i < entries.length; i++)
- modules[i] = lookupModule (entries[i], subject, sharedState);
- this.name = name;
- this.subject = subject;
- this.cbHandler = cbHandler;
- }
-
- /**
- * Returns the authenticated subject, or the parameter passed to one
- * of the constructors. <code>null</code> is returned if the previous
- * login attempt failed and there was no subject provided.
- *
- * @return The subject, or null.
- */
- public Subject getSubject()
- {
- return subject;
- }
-
- /**
- * Logs a subject in, using all login modules configured for this
- * application. This method will call the {@link LoginModule#login()}
- * method of each module configured for this application, stopping
- * if a REQUISITE module fails or if a SUFFICIENT module succeeds. If
- * the overall login attempt fails, a {@link LoginException} will be
- * thrown.
- *
- * @throws LoginException If logging in fails.
- */
- public void login() throws LoginException
- {
- boolean failure = false;
- for (int i = 0; i < modules.length; i++)
- {
- try
- {
- boolean result = modules[i].login();
- if (!result)
- {
- if (entries[i].getControlFlag() ==
- AppConfigurationEntry.LoginModuleControlFlag.REQUISITE)
- throw new LoginException ("REQUISITE module " + entries[i].getLoginModuleName()
- + " failed");
- else if (entries[i].getControlFlag() ==
- AppConfigurationEntry.LoginModuleControlFlag.REQUIRED)
- failure = true;
- }
- else
- {
- if (entries[i].getControlFlag() ==
- AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT)
- break;
- }
- }
- catch (LoginException le)
- {
- if (entries[i].getControlFlag() !=
- AppConfigurationEntry.LoginModuleControlFlag.REQUISITE)
- continue;
- for (int j = 0; j < modules.length; j++)
- modules[i].abort();
- throw le;
- }
- }
- if (failure)
- throw new LoginException ("not all REQUIRED modules succeeded");
-
- for (int i = 0; i < modules.length; i++)
- modules[i].commit();
- }
-
- /**
- * Logs a subject out, cleaning up any state that may be in memory.
- *
- * @throws LoginException If logging out fails.
- */
- public void logout() throws LoginException
- {
- for (int i = 0; i < modules.length; i++)
- modules[i].logout();
- }
-
- // Own methods.
-
- /**
- * Fetch the default callback handler, based on the
- * auth.login.defaultCallbackHandler property, or null if it is not
- * set.
- */
- private static CallbackHandler defaultHandler()
- {
- GetSecurityPropertyAction act =
- new GetSecurityPropertyAction ("auth.login.defaultCallbackHandler");
- String classname = (String) AccessController.doPrivileged (act);
- if (classname != null)
- {
- try
- {
- return (CallbackHandler) Class.forName (classname).newInstance();
- }
- catch (ClassNotFoundException cnfe)
- {
- return null;
- }
- catch (ClassCastException cce)
- {
- return null;
- }
- catch (IllegalAccessException iae)
- {
- return null;
- }
- catch (InstantiationException ie)
- {
- return null;
- }
- }
- return null;
- }
-
- private LoginModule lookupModule (AppConfigurationEntry entry,
- Subject subject, Map sharedState)
- throws LoginException
- {
- LoginModule module = null;
- Exception cause = null;
- try
- {
- module = (LoginModule) Class.forName (entry.getLoginModuleName()).newInstance();
- }
- catch (ClassNotFoundException cnfe)
- {
- cause = cnfe;
- }
- catch (ClassCastException cce)
- {
- cause = cce;
- }
- catch (IllegalAccessException iae)
- {
- cause = iae;
- }
- catch (InstantiationException ie)
- {
- cause = ie;
- }
-
- if (cause != null)
- {
- LoginException le = new LoginException ("could not load module "
- + entry.getLoginModuleName());
- le.initCause (cause);
- throw le;
- }
-
- module.initialize (subject, cbHandler, sharedState, entry.getOptions());
- return module;
- }
-}
diff --git a/libjava/javax/security/auth/login/LoginException.java b/libjava/javax/security/auth/login/LoginException.java
deleted file mode 100644
index 46ec33aed51..00000000000
--- a/libjava/javax/security/auth/login/LoginException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* LoginException.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.login;
-
-import java.security.GeneralSecurityException;
-
-/**
- * A general exception during authentication and authorization.
- */
-public class LoginException extends GeneralSecurityException
-{
-
- // Constant.
- // -------------------------------------------------------------------------
-
- private static final long serialVersionUID = -4679091624035232488L;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public LoginException()
- {
- }
-
- public LoginException (String message)
- {
- super (message);
- }
-}
diff --git a/libjava/javax/security/auth/login/NullConfiguration.java b/libjava/javax/security/auth/login/NullConfiguration.java
deleted file mode 100644
index a3f0c994330..00000000000
--- a/libjava/javax/security/auth/login/NullConfiguration.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* NullConfiguration.java -- no-op default login configuration.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.login;
-
-final class NullConfiguration extends Configuration
-{
-
- // Contructor.
- // -------------------------------------------------------------------------
-
- NullConfiguration()
- {
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public AppConfigurationEntry[] getAppConfigurationEntry (String applicationName)
- {
- return null;
- }
-
- public void refresh()
- {
- }
-}
diff --git a/libjava/javax/security/auth/spi/LoginModule.java b/libjava/javax/security/auth/spi/LoginModule.java
deleted file mode 100644
index 00b33c517e4..00000000000
--- a/libjava/javax/security/auth/spi/LoginModule.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/* LoginModule.java -- interface for login implementations.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.spi;
-
-import java.util.Map;
-
-import javax.security.auth.Subject;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.login.LoginException;
-
-/**
- * The base interface for login methods in the Java Authentication and
- * Authorization Service (JAAS).
- *
- * <p>This interface is used by service providers that implement login
- * services, and is used internally by the JAAS system. It is not useful
- * to application programmers, who should use the {@link
- * javax.security.auth.login.LoginContext} instead.
- *
- * @author Casey Marshall (csm@gnu.org)
- */
-public interface LoginModule
-{
- /**
- * Abort the current login attempt. This is called after {@link #login()}
- * if the overall login attempt fails (that is, if one of the other login
- * modules that is REQUIRED or REQUISITE fails). This method should clean
- * up this module's saved state, if any.
- *
- * @return True if the abort succeeded, or false if this module should
- * be ignored.
- * @throws LoginException If the abort fails.
- */
- boolean abort() throws LoginException;
-
- /**
- * Commit the current login attempt. This is called after {@link
- * #login()} if the overall login attempt succeeds (that is, all
- * methods have satisfied all REQUIRED, REQUISITE, SUFFICIENT and
- * OPTIONAL module requirements).
- *
- * @return True if the commit succeeded, or false if this module
- * should be ignored.
- * @throws LoginException If the commit fails.
- */
- boolean commit() throws LoginException;
-
- /**
- * Initializes this login module. This method is called when the
- * instance implementing this interface is instantiated, and should
- * perform any initialization based on the given parameters.
- * Implementations should ignore state variables and options they do
- * not recognize.
- *
- * @param subject The subject being authenticated.
- * @param handler The callback handler for user input.
- * @param sharedState A mapping that is shared between all login
- * modules.
- * @param options A mapping of options given to this module.
- */
- void initialize(Subject subject, CallbackHandler handler,
- Map sharedState, Map options);
-
- /**
- * Authenticates a subject to the system. This is the primary
- * mechanism by which subjects are authenticated, and typically
- * implementations will ask for credentials (for example, a user
- * name and password) which will then be verified.
- *
- * @return True if the subject was authenticated, or false if this
- * module should be ignored.
- * @throws LoginException If this method fails.
- */
- boolean login() throws LoginException;
-
- /**
- * Logs a subject out. This is primarily used for modules that must
- * destroy or remove the authentication state associated with a
- * logged-in subject.
- *
- * @return True if the logout succeeds, or false if this module
- * should be ignored.
- * @throws LoginException If this method fails.
- */
- boolean logout() throws LoginException;
-}
diff --git a/libjava/javax/security/auth/x500/X500Principal.java b/libjava/javax/security/auth/x500/X500Principal.java
deleted file mode 100644
index 31f870d2650..00000000000
--- a/libjava/javax/security/auth/x500/X500Principal.java
+++ /dev/null
@@ -1,530 +0,0 @@
-/* X500Principal.java -- X.500 principal.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.x500;
-
-import gnu.java.security.OID;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
-import java.io.ByteArrayInputStream;
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.NotActiveException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Reader;
-import java.io.Serializable;
-import java.io.StringReader;
-
-import java.security.Principal;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-
-public final class X500Principal implements Principal, Serializable
-{
- private static final long serialVersionUID = -500463348111345721L;
-
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- public static final String CANONICAL = "CANONICAL";
- public static final String RFC1779 = "RFC1779";
- public static final String RFC2253 = "RFC2253";
-
- private static final OID CN = new OID("2.5.4.3");
- private static final OID C = new OID("2.5.4.6");
- private static final OID L = new OID("2.5.4.7");
- private static final OID ST = new OID("2.5.4.8");
- private static final OID STREET = new OID("2.5.4.9");
- private static final OID O = new OID("2.5.4.10");
- private static final OID OU = new OID("2.5.4.11");
- private static final OID DC = new OID("0.9.2342.19200300.100.1.25");
- private static final OID UID = new OID("0.9.2342.19200300.100.1.1");
-
- private transient List components;
- private transient Map currentRdn;
- private transient boolean fixed;
- private transient byte[] encoded;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
- private X500Principal()
- {
- components = new LinkedList();
- currentRdn = new LinkedHashMap();
- components.add (currentRdn);
- }
-
- public X500Principal (String name)
- {
- this();
- if (name == null)
- throw new NullPointerException();
- try
- {
- parseString (name);
- }
- catch (IOException ioe)
- {
- IllegalArgumentException iae = new IllegalArgumentException("malformed name");
- iae.initCause (ioe);
- throw iae;
- }
- }
-
- public X500Principal (byte[] encoded)
- {
- this(new ByteArrayInputStream (encoded));
- }
-
- public X500Principal (InputStream encoded)
- {
- this();
- try
- {
- parseDer (encoded);
- }
- catch (IOException ioe)
- {
- throw new IllegalArgumentException (ioe.toString());
- }
- }
-
- // Instance methods.
- // ------------------------------------------------------------------------
-
- public boolean equals(Object o)
- {
- if (!(o instanceof X500Principal))
- return false;
- if (size() != ((X500Principal) o).size())
- return false;
- for (int i = 0; i < size(); i++)
- {
- Map m = (Map) components.get (i);
- for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
- {
- Map.Entry e = (Map.Entry) it2.next();
- OID oid = (OID) e.getKey();
- String v1 = (String) e.getValue();
- String v2 = ((X500Principal) o).getComponent (oid, i);
- if (v2 == null)
- return false;
- if (!compressWS (v1).equalsIgnoreCase (compressWS (v2)))
- return false;
- }
- }
- return true;
- }
-
- public byte[] getEncoded()
- {
- if (encoded == null)
- encodeDer();
- return (byte[]) encoded.clone();
- }
-
- public String getName()
- {
- return getName (RFC2253);
- }
-
- public String getName (final String format)
- {
- boolean rfc2253 = RFC2253.equalsIgnoreCase (format) ||
- CANONICAL.equalsIgnoreCase (format);
- boolean rfc1779 = RFC1779.equalsIgnoreCase (format);
- boolean canon = CANONICAL.equalsIgnoreCase (format);
- if (! (rfc2253 || rfc1779 || canon))
- throw new IllegalArgumentException ("unsupported format " + format);
- StringBuffer str = new StringBuffer();
- for (Iterator it = components.iterator(); it.hasNext(); )
- {
- Map m = (Map) it.next();
- for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
- {
- Map.Entry entry = (Map.Entry) it2.next();
- OID oid = (OID) entry.getKey();
- String value = (String) entry.getValue();
- if (oid.equals (CN))
- str.append ("CN");
- else if (oid.equals (C))
- str.append ("C");
- else if (oid.equals (L))
- str.append ("L");
- else if (oid.equals (ST))
- str.append ("ST");
- else if (oid.equals (STREET))
- str.append ("STREET");
- else if (oid.equals (O))
- str.append ("O");
- else if (oid.equals (OU))
- str.append ("OU");
- else if (oid.equals (DC) && rfc2253)
- str.append ("DC");
- else if (oid.equals ("UID") && rfc2253)
- str.append ("UID");
- else
- str.append (oid.toString());
- str.append('=');
- str.append(value);
- if (it2.hasNext())
- str.append('+');
- }
- if (it.hasNext())
- str.append(',');
- }
- if (canon)
- return str.toString().toUpperCase (Locale.US).toLowerCase (Locale.US);
- return str.toString();
- }
-
- public String toString()
- {
- return getName (RFC2253);
- }
-
- // Serialization methods.
- // ------------------------------------------------------------------------
-
- private void writeObject (ObjectOutputStream out) throws IOException
- {
- if (encoded != null)
- encodeDer();
- out.writeObject (encoded);
- }
-
- private void readObject (ObjectInputStream in)
- throws IOException, NotActiveException, ClassNotFoundException
- {
- byte[] buf = (byte[]) in.readObject();
- parseDer (new ByteArrayInputStream (buf));
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private int size()
- {
- return components.size();
- }
-
- private String getComponent(OID oid, int rdn)
- {
- if (rdn >= size())
- return null;
- return (String) ((Map) components.get (rdn)).get (oid);
- }
-
- private void encodeDer()
- {
- ArrayList name = new ArrayList(components.size());
- for (Iterator it = components.iterator(); it.hasNext(); )
- {
- Map m = (Map) it.next();
- if (m.isEmpty())
- continue;
- Set rdn = new HashSet();
- for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
- {
- Map.Entry e = (Map.Entry) it.next();
- ArrayList atav = new ArrayList(2);
- atav.add(new DERValue(DER.OBJECT_IDENTIFIER, e.getKey()));
- atav.add(new DERValue(DER.UTF8_STRING, e.getValue()));
- rdn.add(new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, atav));
- }
- name.add(new DERValue(DER.SET|DER.CONSTRUCTED, rdn));
- }
- DERValue val = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, name);
- encoded = val.getEncoded();
- }
-
- private int sep;
-
- private void parseString(String str) throws IOException
- {
- Reader in = new StringReader(str);
- while (true)
- {
- String key = readAttributeType(in);
- if (key == null)
- break;
- String value = readAttributeValue(in);
- putComponent(key, value);
- if (sep == ',')
- newRelativeDistinguishedName();
- }
- }
-
- private String readAttributeType(Reader in) throws IOException
- {
- StringBuffer buf = new StringBuffer();
- int ch;
- while ((ch = in.read()) != '=')
- {
- if (ch == -1)
- {
- if (buf.length() > 0)
- throw new EOFException();
- return null;
- }
- if (ch > 127)
- throw new IOException("Invalid char: " + (char) ch);
- if (Character.isLetterOrDigit((char) ch) || ch == '-' || ch == '.')
- buf.append((char) ch);
- else
- throw new IOException("Invalid char: " + (char) ch);
- }
- return buf.toString();
- }
-
- private String readAttributeValue(Reader in) throws IOException
- {
- StringBuffer buf = new StringBuffer();
- int ch = in.read();
- if (ch == '#')
- {
- while (true)
- {
- ch = in.read();
- if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
- || Character.isDigit((char) ch))
- buf.append((char) ch);
- else if (ch == '+' || ch == ',')
- {
- sep = ch;
- String hex = buf.toString();
- return new String(toByteArray(hex));
- }
- else
- throw new IOException("illegal character: " + (char) ch);
- }
- }
- else if (ch == '"')
- {
- while (true)
- {
- ch = in.read();
- if (ch == '"')
- break;
- else if (ch == '\\')
- {
- ch = in.read();
- if (ch == -1)
- throw new EOFException();
- if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
- || Character.isDigit((char) ch))
- {
- int i = Character.digit((char) ch, 16) << 4;
- ch = in.read();
- if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
- || Character.isDigit((char) ch)))
- throw new IOException("illegal hex char");
- i |= Character.digit((char) ch, 16);
- buf.append((char) i);
- }
- else
- buf.append((char) ch);
- }
- else
- buf.append((char) ch);
- }
- sep = in.read();
- if (sep != '+' || sep != ',')
- throw new IOException("illegal character: " + (char) ch);
- return buf.toString();
- }
- else
- {
- while (true)
- {
- switch (ch)
- {
- case '+':
- case ',':
- sep = ch;
- return buf.toString();
- case '\\':
- ch = in.read();
- if (ch == -1)
- throw new EOFException();
- if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
- || Character.isDigit((char) ch))
- {
- int i = Character.digit((char) ch, 16) << 4;
- ch = in.read();
- if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
- || Character.isDigit((char) ch)))
- throw new IOException("illegal hex char");
- i |= Character.digit((char) ch, 16);
- buf.append((char) i);
- }
- else
- buf.append((char) ch);
- break;
- case '=':
- case '<':
- case '>':
- case '#':
- case ';':
- throw new IOException("illegal character: " + (char) ch);
- case -1:
- throw new EOFException();
- default:
- buf.append((char) ch);
- }
- }
- }
- }
-
- private void parseDer (InputStream encoded) throws IOException
- {
- DERReader der = new DERReader (encoded);
- DERValue name = der.read();
- if (!name.isConstructed())
- throw new IOException ("malformed Name");
- this.encoded = name.getEncoded();
- int len = 0;
- while (len < name.getLength())
- {
- DERValue rdn = der.read();
- if (!rdn.isConstructed())
- throw new IOException ("badly formed RDNSequence");
- int len2 = 0;
- while (len2 < rdn.getLength())
- {
- DERValue atav = der.read();
- if (!atav.isConstructed())
- throw new IOException ("badly formed AttributeTypeAndValue");
- DERValue val = der.read();
- if (val.getTag() != DER.OBJECT_IDENTIFIER)
- throw new IOException ("badly formed AttributeTypeAndValue");
- OID oid = (OID) val.getValue();
- val = der.read();
- if (!(val.getValue() instanceof String))
- throw new IOException ("badly formed AttributeTypeAndValue");
- String value = (String) val.getValue();
- putComponent(oid, value);
- len2 += atav.getEncodedLength();
- }
- len += rdn.getEncodedLength();
- if (len < name.getLength())
- newRelativeDistinguishedName();
- }
- }
-
- private void newRelativeDistinguishedName()
- {
- currentRdn = new LinkedHashMap();
- components.add(currentRdn);
- }
-
- private void putComponent(OID oid, String value)
- {
- currentRdn.put(oid, value);
- }
-
- private void putComponent(String name, String value)
- {
- name = name.trim().toLowerCase();
- if (name.equals("cn"))
- putComponent(CN, value);
- else if (name.equals("c"))
- putComponent(C, value);
- else if (name.equals("l"))
- putComponent(L, value);
- else if (name.equals("street"))
- putComponent(STREET, value);
- else if (name.equals("st"))
- putComponent(ST, value);
- else if (name.equals("dc"))
- putComponent(DC, value);
- else if (name.equals("uid"))
- putComponent(UID, value);
- else
- putComponent(new OID(name), value);
- }
-
- private static String compressWS(String str)
- {
- StringBuffer buf = new StringBuffer();
- char lastChar = 0;
- for (int i = 0; i < str.length(); i++)
- {
- char c = str.charAt(i);
- if (Character.isWhitespace(c))
- {
- if (!Character.isWhitespace(lastChar))
- buf.append(' ');
- }
- else
- buf.append(c);
- lastChar = c;
- }
- return buf.toString().trim();
- }
-
- private static byte[] toByteArray (String str)
- {
- int limit = str.length();
- byte[] result = new byte[((limit + 1) / 2)];
- int i = 0, j = 0;
- if ((limit % 2) == 1)
- {
- result[j++] = (byte) Character.digit (str.charAt(i++), 16);
- }
- while (i < limit)
- {
- result[j ] = (byte) (Character.digit (str.charAt(i++), 16) << 4);
- result[j++] |= (byte) Character.digit (str.charAt(i++), 16);
- }
- return result;
- }
-}
diff --git a/libjava/javax/security/auth/x500/X500PrivateCredential.java b/libjava/javax/security/auth/x500/X500PrivateCredential.java
deleted file mode 100644
index 8cba93c6f77..00000000000
--- a/libjava/javax/security/auth/x500/X500PrivateCredential.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* X500PrivateCredential.java -- certificate and private key pair.
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.auth.x500;
-
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-
-import javax.security.auth.Destroyable;
-
-/**
- * A pairing of a {@link X509Certificate} and its corresponding {@link
- * PrivateKey}, with an optional keystore alias.
- */
-public final class X500PrivateCredential implements Destroyable
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private PrivateKey key;
- private X509Certificate certificate;
- private String alias;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- /**
- * Creates a new private credential with no associated keystore alias.
- *
- * @param certificate The X.509 certificate.
- * @param key The private key.
- * @throws IllegalArgumentException If either parameter is null.
- */
- public X500PrivateCredential (X509Certificate certificate, PrivateKey key)
- {
- if (certificate == null || key == null)
- throw new IllegalArgumentException();
- this.certificate = certificate;
- this.key = key;
- }
-
- /**
- * Creates a new private credential with a keystore alias.
- *
- * @param certificate The X.509 certificate.
- * @param key The private key.
- * @param alias The keystore alias for this credential.
- * @throws IllegalArgumentException If any parameter is null.
- */
- public X500PrivateCredential (X509Certificate certificate, PrivateKey key,
- String alias)
- {
- this (certificate, key);
- if (alias == null)
- throw new IllegalArgumentException();
- this.alias = alias;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- /**
- * Returns the certificate of this credential.
- *
- * @return The certificate of this credential.
- */
- public X509Certificate getCertificate()
- {
- return certificate;
- }
-
- /**
- * Returns the private key of this credential.
- *
- * @return The private key of this credential.
- */
- public PrivateKey getPrivateKey()
- {
- return key;
- }
-
- /**
- * Returns the keystore alias of this credential, or null if not present.
- *
- * @return The keystore alias, or null.
- */
- public String getAlias()
- {
- return alias;
- }
-
- /**
- * Destroy the sensitive data of this credential, setting the certificate,
- * private key, and keystore alias to null.
- */
- public void destroy()
- {
- certificate = null;
- key = null;
- alias = null;
- }
-
- /**
- * Tells whether or not this credential has been destroyed, and that
- * the certificate and private key fields are null.
- *
- * @return True if this object has been destroyed.
- */
- public boolean isDestroyed()
- {
- return certificate == null && key == null;
- }
-}
diff --git a/libjava/javax/security/cert/Certificate.java b/libjava/javax/security/cert/Certificate.java
deleted file mode 100644
index 50c7340fb4f..00000000000
--- a/libjava/javax/security/cert/Certificate.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Certificate.java -- base class of public-key certificates.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.cert;
-
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.PublicKey;
-import java.security.SignatureException;
-
-import java.util.Arrays;
-import java.util.zip.Adler32;
-
-/**
- * <p>The base class for public-key certificates.</p>
- *
- * <p><b>This class is deprecated in favor of the {@link
- * java.security.cert.Certificate} class. It should not be used in new
- * applications.</b></p>
- */
-public abstract class Certificate
-{
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- public Certificate()
- {
- super();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- /**
- * <p>Tests if this certificate equals another.</p>
- *
- * @param other The object to test.
- * @return True if the certificates are equal.
- */
- public boolean equals(Object other)
- {
- if (other == null || !(other instanceof Certificate))
- {
- return false;
- }
- if (other == this)
- {
- return true;
- }
- try
- {
- return Arrays.equals(getEncoded(), ((Certificate) other).getEncoded());
- }
- catch (CertificateEncodingException cee)
- {
- return false;
- }
- }
-
- /**
- * <p>Computes a hash code for this certificate.</p>
- *
- * @return The hash code.
- */
- public int hashCode()
- {
- try
- {
- Adler32 csum = new Adler32();
- csum.update(getEncoded());
- return (int) csum.getValue();
- }
- catch (CertificateEncodingException cee)
- {
- return 0;
- }
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------------
-
- /**
- * <p>Return the encoded form of this certificate.</p>
- *
- * @return The encoded form.
- * @throws CertificateEncodingException If the certificate could not be
- * encoded.
- */
- public abstract byte[] getEncoded() throws CertificateEncodingException;
-
- /**
- * <p>Verifies the signature of this certificate.</p>
- *
- * @param key The signer's public key.
- * @throws CertificateException
- * @throws NoSuchAlgorithmException If the algorithm used to sign the
- * certificate is not available.
- * @throws InvalidKeyException If the supplied key is not appropriate for the
- * certificate's signature algorithm.
- * @throws NoSuchProviderException
- * @throws SignatureException If the signature could not be verified.
- */
- public abstract void verify(PublicKey key)
- throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
- NoSuchProviderException, SignatureException;
-
- /**
- * <p>Verifies the signature of this certificate, using the specified security
- * provider.</p>
- *
- * @param key The signer's public key.
- * @param sigProvider The name of the signature provider.
- * @throws CertificateException
- * @throws NoSuchAlgorithmException If the algorithm used to sign the
- * certificate is not available.
- * @throws InvalidKeyException If the supplied key is not appropriate for the
- * certificate's signature algorithm.
- * @throws NoSuchProviderException If <i>sigProvider</i> is not the name of an
- * installed provider.
- * @throws SignatureException If the signature could not be verified.
- */
- public abstract void verify(PublicKey key, String sigProvider)
- throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
- NoSuchProviderException, SignatureException;
-
- /**
- * <p>Returns a printable representation of this certificate.</p>
- *
- * @return The string.
- */
- public abstract String toString();
-
- /**
- * <p>Returns this certificate's public key.</p>
- *
- * @return The public key.
- */
- public abstract PublicKey getPublicKey();
-}
diff --git a/libjava/javax/security/cert/CertificateEncodingException.java b/libjava/javax/security/cert/CertificateEncodingException.java
deleted file mode 100644
index 47aedcf05e8..00000000000
--- a/libjava/javax/security/cert/CertificateEncodingException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* CertificateEncodingException.java -- certificate encoding exception.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.cert;
-
-/**
- * <p>Signals a problem when encoding certificates.</p>
- *
- * <p><b>This class is deprecated in favor of the {@link
- * java.security.cert.CertificateEncodingException} class. It should not be used
- * in new applications.</b></p>
- */
-public class CertificateEncodingException extends CertificateException
-{
-
- public CertificateEncodingException()
- {
- super();
- }
-
- public CertificateEncodingException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/security/cert/CertificateException.java b/libjava/javax/security/cert/CertificateException.java
deleted file mode 100644
index 270cc926ffb..00000000000
--- a/libjava/javax/security/cert/CertificateException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* CertificateException.java -- certificate exception.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.cert;
-
-/**
- * <p>Signals a generic problem with certificates.</p>
- *
- * <p><b>This class is deprecated in favor of the {@link
- * java.security.cert.CertificateException} class. It should not be used in new
- * applications.</b></p>
- */
-public class CertificateException extends Exception
-{
-
- public CertificateException()
- {
- super();
- }
-
- public CertificateException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/security/cert/CertificateExpiredException.java b/libjava/javax/security/cert/CertificateExpiredException.java
deleted file mode 100644
index 3a8c0515e01..00000000000
--- a/libjava/javax/security/cert/CertificateExpiredException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* CertificateExpiredException.java -- certificate expired exception.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.cert;
-
-/**
- * <p>Signals that a certificate has expired.</p>
- *
- * <p><b>This class is deprecated in favor of the {@link
- * java.security.cert.CertificateExpiredException} class. It should not be used
- * in new applications.</b></p>
- */
-public class CertificateExpiredException extends CertificateException
-{
-
- public CertificateExpiredException()
- {
- super();
- }
-
- public CertificateExpiredException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/security/cert/CertificateNotYetValidException.java b/libjava/javax/security/cert/CertificateNotYetValidException.java
deleted file mode 100644
index 22a7c4a226b..00000000000
--- a/libjava/javax/security/cert/CertificateNotYetValidException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* CertificateNotYetValidException.java -- certificate not yet valid exception.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.cert;
-
-/**
- * <p>Signals that a certificate is not yet valid.</p>
- *
- * <p><b>This class is deprecated in favor of the {@link
- * java.security.cert.CertificateNotYetValidException} class. It should not be
- * used in new applications.</b></p>
- */
-public class CertificateNotYetValidException extends CertificateException
-{
-
- public CertificateNotYetValidException()
- {
- super();
- }
-
- public CertificateNotYetValidException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/security/cert/CertificateParsingException.java b/libjava/javax/security/cert/CertificateParsingException.java
deleted file mode 100644
index f359f8d7aa0..00000000000
--- a/libjava/javax/security/cert/CertificateParsingException.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* CertificateParsingException.java -- certificate parsing exception.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.cert;
-
-/**
- * <p>Signals a parsing error when decoding a certificate.</p>
- *
- * <p><b>This class is deprecated. It should not be used in new
- * applications.</b></p>
- */
-public class CertificateParsingException extends CertificateException
-{
-
- public CertificateParsingException()
- {
- super();
- }
-
- public CertificateParsingException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/security/cert/X509CertBridge.java b/libjava/javax/security/cert/X509CertBridge.java
deleted file mode 100644
index 36fc4202a7a..00000000000
--- a/libjava/javax/security/cert/X509CertBridge.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/* X509CertBridge.java -- bridge between JDK and JSSE cert APIs.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.cert;
-
-import java.math.BigInteger;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Principal;
-import java.security.PublicKey;
-import java.security.SignatureException;
-import java.util.Date;
-
-/**
- * <p>An implementation of the {@link X509Certificate} class that delegates
- * calls to a {@link java.security.cert.X509Certificate}.</p>
- */
-final class X509CertBridge extends X509Certificate
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private java.security.cert.X509Certificate cert;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- X509CertBridge(java.security.cert.X509Certificate cert)
- {
- this.cert = cert;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public byte[] getEncoded() throws CertificateEncodingException
- {
- try
- {
- return cert.getEncoded();
- }
- catch (java.security.cert.CertificateEncodingException cee)
- {
- throw new CertificateEncodingException(cee.getMessage());
- }
- }
-
- public void verify(PublicKey key)
- throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
- NoSuchProviderException, SignatureException
- {
- try
- {
- cert.verify(key);
- }
- catch (java.security.cert.CertificateException ce)
- {
- throw new CertificateException(ce.getMessage());
- }
- }
-
- public void verify(PublicKey key, String sigProvider)
- throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
- NoSuchProviderException, SignatureException
- {
- try
- {
- cert.verify(key, sigProvider);
- }
- catch (java.security.cert.CertificateException ce)
- {
- throw new CertificateException(ce.getMessage());
- }
- }
-
- public String toString()
- {
- return cert.toString();
- }
-
- public PublicKey getPublicKey()
- {
- return cert.getPublicKey();
- }
-
- public void checkValidity()
- throws CertificateExpiredException, CertificateNotYetValidException
- {
- try
- {
- cert.checkValidity();
- }
- catch (java.security.cert.CertificateExpiredException cee)
- {
- throw new CertificateExpiredException(cee.getMessage());
- }
- catch (java.security.cert.CertificateNotYetValidException cnyve)
- {
- throw new CertificateNotYetValidException(cnyve.getMessage());
- }
- }
-
- public void checkValidity(Date date)
- throws CertificateExpiredException, CertificateNotYetValidException
- {
- try
- {
- cert.checkValidity(date);
- }
- catch (java.security.cert.CertificateExpiredException cee)
- {
- throw new CertificateExpiredException(cee.getMessage());
- }
- catch (java.security.cert.CertificateNotYetValidException cnyve)
- {
- throw new CertificateNotYetValidException(cnyve.getMessage());
- }
- }
-
- public int getVersion()
- {
- return cert.getVersion();
- }
-
- public BigInteger getSerialNumber()
- {
- return cert.getSerialNumber();
- }
-
- public Principal getIssuerDN()
- {
- return cert.getIssuerDN();
- }
-
- public Principal getSubjectDN()
- {
- return cert.getSubjectDN();
- }
-
- public Date getNotBefore()
- {
- return cert.getNotBefore();
- }
-
- public Date getNotAfter()
- {
- return cert.getNotAfter();
- }
-
- public String getSigAlgName()
- {
- return cert.getSigAlgName();
- }
-
- public String getSigAlgOID()
- {
- return cert.getSigAlgOID();
- }
-
- public byte[] getSigAlgParams()
- {
- return cert.getSigAlgParams();
- }
-}
diff --git a/libjava/javax/security/cert/X509Certificate.java b/libjava/javax/security/cert/X509Certificate.java
deleted file mode 100644
index e7f6b05e496..00000000000
--- a/libjava/javax/security/cert/X509Certificate.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* X509Certificate.java -- base class of X.509 certificates.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.cert;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import java.math.BigInteger;
-
-import java.security.Principal;
-import java.security.cert.CertificateFactory;
-
-import java.util.Date;
-
-/**
- * <p>The base class of all X.509 certificates.</p>
- *
- * <p><b>This class is deprecated in favor of the {@link
- * java.security.cert.X509Certificate} class. It should not be used in new
- * applications.</b></p>
- */
-public abstract class X509Certificate extends Certificate
-{
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- /**
- * <p>Get an instance of X509Certificate for the given encoded bytes.</p>
- *
- * @param encoded The encoded certificate.
- * @return An instance of X509Certificate.
- * @throws CertificateException If the encoded certificate cannot be parsed.
- */
- public static X509Certificate getInstance(byte[] encoded)
- throws CertificateException
- {
- return getInstance(new ByteArrayInputStream(encoded));
- }
-
- /**
- * <p>Get an instance of X509Certificate for the given encoded stream.</p>
- *
- * @param encoded The encoded certificate stream..
- * @return An instance of X509Certificate.
- * @throws CertificateException If the encoded certificate cannot be parsed.
- */
- public static X509Certificate getInstance(InputStream encoded)
- throws CertificateException
- {
- try
- {
- CertificateFactory cf = CertificateFactory.getInstance("X.509");
- return new X509CertBridge((java.security.cert.X509Certificate)
- cf.generateCertificate(encoded));
- }
- catch (java.security.cert.CertificateException ce)
- {
- throw new CertificateException(ce.getMessage());
- }
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------------
-
- /**
- * <p>Check if this certificate is valid now.</p>
- *
- * @throws CertificateExpiredException If the certificate has expired.
- * @throws CertificateNotYetValidException If the certificate is not yet valid.
- * @see #checkValidity(java.util.Date)
- */
- public abstract void checkValidity()
- throws CertificateExpiredException, CertificateNotYetValidException;
-
- /**
- * <p>Check if this certificate is valid for the given date.</p>
- *
- * @param date The date to check.
- * @throws CertificateExpiredException If the certificate has expired.
- * @throws CertificateNotYetValidException If the certificate is not yet valid.
- */
- public abstract void checkValidity(Date date)
- throws CertificateExpiredException, CertificateNotYetValidException;
-
- /**
- * <p>Returns the X.509 version number.</p>
- *
- * @return The version number.
- */
- public abstract int getVersion();
-
- /**
- * <p>Returns this certificate's serial number.</p>
- *
- * @return The serial number.
- */
- public abstract BigInteger getSerialNumber();
-
- /**
- * <p>Returns the distinguished name of this certificate's issuer.</p>
- *
- * @return The issuer's distinguished name.
- */
- public abstract Principal getIssuerDN();
-
- /**
- * <p>Returns the distinguished name of this certificate's subject.</p>
- *
- * @return The subject's distinguished name.
- */
- public abstract Principal getSubjectDN();
-
- /**
- * <p>Returns the <i>not before</i> portion of this certificate's validity
- * period.</p>
- *
- * @return The not before date.
- */
- public abstract Date getNotBefore();
-
- /**
- * <p>Returns the <i>not after</i> portion of this certificate's validity
- * period.</p>
- *
- * @return The not after date.
- */
- public abstract Date getNotAfter();
-
- /**
- * <p>Returns the name of this certificate's signature algorithm.</p>
- *
- * @return The name of the signature algorithm.
- */
- public abstract String getSigAlgName();
-
- /**
- * <p>Returns the object identifier (OID) of this certificate's signature
- * algorithm. The returned string is a sequence of integers separated by
- * periods.</p>
- *
- * @return The signature OID.
- */
- public abstract String getSigAlgOID();
-
- /**
- * <p>Returns the signature parameters. The returned byte array contains the
- * raw DER-encoded parameters.</p>
- *
- * @return The signature parameters.
- */
- public abstract byte[] getSigAlgParams();
-}
diff --git a/libjava/javax/security/sasl/AuthenticationException.java b/libjava/javax/security/sasl/AuthenticationException.java
deleted file mode 100644
index 12a8fe0529b..00000000000
--- a/libjava/javax/security/sasl/AuthenticationException.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/* AuthenticationException.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.sasl;
-
-/**
- * <p>This exception is thrown by a SASL mechanism implementation to indicate
- * that the SASL exchange has failed due to reasons related to authentication,
- * such as an invalid identity, passphrase, or key.</p>
- *
- * <p>Note that the lack of an <code>AuthenticationException</code> does not
- * mean that the failure was not due to an authentication error. A SASL
- * mechanism implementation might throw the more general {@link SaslException}
- * instead of <code>AuthenticationException</code> if it is unable to determine
- * the nature of the failure, or if does not want to disclose the nature of the
- * failure, for example, due to security reasons.</p>
- */
-public class AuthenticationException extends SaslException
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- /**
- * Constructs a new instance of <code>AuthenticationException</code>. The
- * root exception and the detailed message are <code>null</code>.
- */
- public AuthenticationException()
- {
- super();
- }
-
- /**
- * Constructs a new instance of <code>AuthenticationException</code> with a
- * detailed message. The root exception is <code>null</code>.
- *
- * @param detail a possibly <code>null</code> string containing details of
- * the exception.
- * @see Throwable#getMessage()
- */
- public AuthenticationException(String detail)
- {
- super(detail);
- }
-
- /**
- * Constructs a new instance of <code>AuthenticationException</code> with a
- * detailed message and a root exception.
- *
- * @param detail a possibly <code>null</code> string containing details of
- * the exception.
- * @param ex a possibly <code>null</code> root exception that caused this
- * exception.
- * @see Throwable#getMessage()
- * @see SaslException#getCause()
- */
- public AuthenticationException(String detail, Throwable ex)
- {
- super(detail, ex);
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- // Instance methods
- // -------------------------------------------------------------------------
-}
diff --git a/libjava/javax/security/sasl/AuthorizeCallback.java b/libjava/javax/security/sasl/AuthorizeCallback.java
deleted file mode 100644
index bf1b8470d31..00000000000
--- a/libjava/javax/security/sasl/AuthorizeCallback.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* AuthorizeCallback.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.sasl;
-
-import javax.security.auth.callback.Callback;
-
-/**
- * This callback is used by {@link SaslServer} to determine whether one entity
- * (identified by an authenticated authentication ID) can act on behalf of
- * another entity (identified by an authorization ID).
- */
-public class AuthorizeCallback implements Callback
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /** @serial The (authenticated) authentication id to check. */
- private String authenticationID = null;
-
- /** @serial The authorization id to check. */
- private String authorizationID = null;
-
- /**
- * @serial The id of the authorized entity. If null, the id of the authorized
- * entity is authorizationID.
- */
- private String authorizedID = null;
-
- /**
- * @serial A flag indicating whether the authentication id is allowed to act
- * on behalf of the authorization id.
- */
- private boolean authorized = false;
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- /**
- * Constructs an instance of <code>AuthorizeCallback</code>.
- *
- * @param authnID the (authenticated) authentication ID.
- * @param authzID the authorization ID.
- */
- public AuthorizeCallback(String authnID, String authzID)
- {
- super();
-
- this.authenticationID = authnID;
- this.authorizationID = authzID;
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- // Instance methods
- // -------------------------------------------------------------------------
-
- /**
- * Returns the authentication ID to check.
- *
- * @return the authentication ID to check
- */
- public String getAuthenticationID()
- {
- return authenticationID;
- }
-
- /**
- * Returns the authorization ID to check.
- *
- * @return the authorization ID to check.
- */
- public String getAuthorizationID()
- {
- return authorizationID;
- }
-
- /**
- * Determines if the identity represented by authentication ID is allowed to
- * act on behalf of the authorization ID.
- *
- * @return <code>true</code> if authorization is allowed; <code>false</code>
- * otherwise.
- * @see #setAuthorized(boolean)
- * @see #getAuthorizedID()
- */
- public boolean isAuthorized()
- {
- return authorized;
- }
-
- /**
- * Sets if authorization is allowed or not.
- *
- * @param authorized <code>true</code> if authorization is allowed;
- * <code>false</code> otherwise.
- * @see #isAuthorized()
- * @see #setAuthorizedID(String)
- */
- public void setAuthorized(boolean authorized)
- {
- this.authorized = authorized;
- }
-
- /**
- * Returns the ID of the authorized user.
- *
- * @return the ID of the authorized user. <code>null</code> means the
- * authorization failed.
- * @see #setAuthorized(boolean)
- * @see #setAuthorizedID(String)
- */
- public String getAuthorizedID()
- {
- if (!authorized)
- {
- return null;
- }
- return (authorizedID != null ? authorizedID : authorizationID);
- }
-
- /**
- * Sets the ID of the authorized entity. Called by handler only when the ID
- * is different from {@link #getAuthorizationID()}. For example, the ID might
- * need to be canonicalized for the environment in which it will be used.
- *
- * @see #setAuthorized(boolean)
- * @see #getAuthorizedID()
- */
- public void setAuthorizedID(String id)
- {
- this.authorizedID = id;
- }
-}
diff --git a/libjava/javax/security/sasl/RealmCallback.java b/libjava/javax/security/sasl/RealmCallback.java
deleted file mode 100644
index 12d834054a4..00000000000
--- a/libjava/javax/security/sasl/RealmCallback.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* RealmCallback.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.sasl;
-
-import javax.security.auth.callback.TextInputCallback;
-
-/**
- * This callback is used by {@link SaslClient} and {@link SaslServer} to
- * retrieve realm information.
- */
-public class RealmCallback extends TextInputCallback
-{
-
- /**
- * Constructs a <code>RealmCallback</code> with a prompt.
- *
- * @param prompt the non-null prompt to use to request the realm information.
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
- * or empty.
- */
- public RealmCallback(String prompt)
- {
- super(prompt);
- }
-
- /**
- * Constructs a <code>RealmCallback</code> with a prompt and default realm
- * information.
- *
- * @param prompt the non-null prompt to use to request the realm information.
- * @param defaultRealmInfo the non-null default realm information to use.
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
- * or empty, or if <code>defaultRealm</code> is empty or <code>null</code>.
- */
- public RealmCallback(String prompt, String defaultRealmInfo)
- {
- super(prompt, defaultRealmInfo);
- }
-}
diff --git a/libjava/javax/security/sasl/RealmChoiceCallback.java b/libjava/javax/security/sasl/RealmChoiceCallback.java
deleted file mode 100644
index d16e61f6afd..00000000000
--- a/libjava/javax/security/sasl/RealmChoiceCallback.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* RealmChoiceCallback.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.sasl;
-
-import javax.security.auth.callback.ChoiceCallback;
-
-/**
- * This callback is used by {@link SaslClient} and {@link SaslServer} to obtain
- * a realm given a list of realm choices.
- */
-public class RealmChoiceCallback extends ChoiceCallback
-{
-
- /**
- * Constructs a <code>RealmChoiceCallback</code> with a prompt, a list of
- * choices and a default choice.
- *
- * @param prompt the non-null prompt to use to request the realm.
- * @param choices the non-null list of realms to choose from.
- * @param defaultChoice the choice to be used as the default when the list of
- * choices is displayed. It is an index into the <code>choices</code> array.
- * @param multiple <code>true</code> if multiple choices allowed;
- * <code>false</code> otherwise.
- * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
- * or empty, if <code>choices</code> has a length of <code>0</code>, if any
- * element from <code>choices</code> is <code>null</code> or empty, or if
- * <code>defaultChoice</code> does not fall within the array boundary of
- * <code>choices</code>.
- */
- public RealmChoiceCallback(String prompt, String[] choices, int defaultChoice,
- boolean multiple)
- {
- super(prompt, choices, defaultChoice, multiple);
- }
-}
diff --git a/libjava/javax/security/sasl/Sasl.java b/libjava/javax/security/sasl/Sasl.java
deleted file mode 100644
index 27ac7012f42..00000000000
--- a/libjava/javax/security/sasl/Sasl.java
+++ /dev/null
@@ -1,690 +0,0 @@
-/* Sasl.java --
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.sasl;
-
-import java.security.Provider;
-import java.security.Security;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.security.auth.callback.CallbackHandler;
-
-/**
- * <p>A static class for creating SASL clients and servers.</p>
- *
- * <p>This class defines the policy of how to locate, load, and instantiate SASL
- * clients and servers.</p>
- *
- * <p>For example, an application or library gets a SASL client instance by
- * doing something like:</p>
- *
- * <pre>
- *SaslClient sc =
- * Sasl.createSaslClient(mechanisms, authorizationID, protocol,
- * serverName, props, callbackHandler);
- * </pre>
- *
- * <p>It can then proceed to use the instance to create an authenticated
- * connection.</p>
- *
- * <p>Similarly, a server gets a SASL server instance by using code that looks
- * as follows:</p>
- *
- * <pre>
- *SaslServer ss =
- * Sasl.createSaslServer(mechanism, protocol, serverName, props,
- * callbackHandler);
- * </pre>
- */
-public class Sasl
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /**
- * <p>The name of a property that specifies the quality-of-protection to use.
- * The property contains a comma-separated, ordered list of quality-of-
- * protection values that the client or server is willing to support. A qop
- * value is one of:</p>
- *
- * <ul>
- * <li><code>"auth"</code> - authentication only,</li>
- * <li><code>"auth-int"</code> - authentication plus integrity
- * protection,</li>
- * <li><code>"auth-conf"</code> - authentication plus integrity and
- * confidentiality protection.</li>
- * </ul>
- *
- * <p>The order of the list specifies the preference order of the client or
- * server.</p>
- *
- * <p>If this property is absent, the default qop is <code>"auth"</code>.</p>
- *
- * <p>The value of this constant is <code>"javax.security.sasl.qop"</code>.</p>
- */
- public static final String QOP = "javax.security.sasl.qop";
-
- /**
- * <p>The name of a property that specifies the cipher strength to use. The
- * property contains a comma-separated, ordered list of cipher strength
- * values that the client or server is willing to support. A strength value
- * is one of:</p>
- *
- * <ul>
- * <li><code>"low"</code>,</li>
- * <li><code>"medium"</code>,</li>
- * <li><code>"high"</code>.</li>
- * </ul>
- *
- * <p>The order of the list specifies the preference order of the client or
- * server. An implementation should allow configuration of the meaning of
- * these values. An application may use the Java Cryptography Extension (JCE)
- * with JCE-aware mechanisms to control the selection of cipher suites that
- * match the strength values.</p>
- *
- * <p>If this property is absent, the default strength is
- * <code>"high,medium,low"</code>.</p>
- *
- * <p>The value of this constant is <code>"javax.security.sasl.strength"</code>.
- * </p>
- */
- public static final String STRENGTH = "javax.security.sasl.strength";
-
- /**
- * <p>The name of a property that specifies whether the server must authenticate
- * to the client. The property contains <code>"true"</code> if the server
- * must authenticate the to client; <code>"false"</code> otherwise. The
- * default is <code>"false"</code>.</p>
- *
- * <p>The value of this constant is
- * <code>"javax.security.sasl.server.authentication"</code>.</p>
- */
- public static final String SERVER_AUTH = "javax.security.sasl.server.authentication";
-
- /**
- * <p>The name of a property that specifies the maximum size of the receive
- * buffer in bytes of {@link SaslClient}/{@link SaslServer}. The property
- * contains the string representation of an integer.</p>
- *
- * <p>If this property is absent, the default size is defined by the
- * mechanism.</p>
- *
- * <p>The value of this constant is <code>"javax.security.sasl.maxbuffer"</code>.
- * </p>
- */
- public static final String MAX_BUFFER = "javax.security.sasl.maxbuffer";
-
- /**
- * <p>The name of a property that specifies the maximum size of the raw send
- * buffer in bytes of {@link SaslClient}/{@link SaslServer}. The property
- * contains the string representation of an integer. The value of this
- * property is negotiated between the client and server during the
- * authentication exchange.</p>
- *
- * <p>The value of this constant is <code>"javax.security.sasl.rawsendsize"</code>.
- * </p>
- */
- public static final String RAW_SEND_SIZE = "javax.security.sasl.rawsendsize";
-
- /**
- * <p>The name of a property that specifies whether mechanisms susceptible
- * to simple plain passive attacks (e.g., "PLAIN") are not permitted. The
- * property contains <code>"true"</code> if such mechanisms are not
- * permitted; <code>"false"</code> if such mechanisms are permitted. The
- * default is <code>"false"</code>.</p>
- *
- * <p>The value of this constant is <code>"javax.security.sasl.policy.noplaintext"</code>.
- * </p>
- */
- public static final String POLICY_NOPLAINTEXT = "javax.security.sasl.policy.noplaintext";
-
- /**
- * <p>The name of a property that specifies whether mechanisms susceptible to
- * active (non-dictionary) attacks are not permitted. The property contains
- * <code>"true"</code> if mechanisms susceptible to active attacks are not
- * permitted; <code>"false"</code> if such mechanisms are permitted. The
- * default is <code>"false"</code>.</p>
- *
- * <p>The value of this constant is <code>"javax.security.sasl.policy.noactive"</code>.
- * </p>
- */
- public static final String POLICY_NOACTIVE = "javax.security.sasl.policy.noactive";
-
- /**
- * <p>The name of a property that specifies whether mechanisms susceptible to
- * passive dictionary attacks are not permitted. The property contains
- * <code>"true"</code> if mechanisms susceptible to dictionary attacks are
- * not permitted; <code>"false"</code> if such mechanisms are permitted. The
- * default is <code>"false"</code>.</p>
- *
- * <p>The value of this constant is <code>"javax.security.sasl.policy.nodictionary"</code>.
- * </p>
- */
- public static final String POLICY_NODICTIONARY = "javax.security.sasl.policy.nodictionary";
-
- /**
- * <p>The name of a property that specifies whether mechanisms that accept
- * anonymous login are not permitted. The property contains <code>"true"</code>
- * if mechanisms that accept anonymous login are not permitted; <code>"false"
- * </code> if such mechanisms are permitted. The default is <code>"false"</code>.
- * </p>
- *
- * <p>The value of this constant is <code>"javax.security.sasl.policy.noanonymous"</code>.
- * </p>
- */
- public static final String POLICY_NOANONYMOUS = "javax.security.sasl.policy.noanonymous";
-
- /**
- * The name of a property that specifies whether mechanisms that implement
- * forward secrecy between sessions are required. Forward secrecy means that
- * breaking into one session will not automatically provide information for
- * breaking into future sessions. The property contains <code>"true"</code>
- * if mechanisms that implement forward secrecy between sessions are
- * required; <code>"false"</code> if such mechanisms are not required. The
- * default is <code>"false"</code>.
- *
- * <p>The value of this constant is <code>"javax.security.sasl.policy.forward"</code>.
- * </p>
- */
- public static final String POLICY_FORWARD_SECRECY = "javax.security.sasl.policy.forward";
-
- /**
- * The name of a property that specifies whether mechanisms that pass client
- * credentials are required. The property contains <code>"true"</code> if
- * mechanisms that pass client credentials are required; <code>"false"</code>
- * if such mechanisms are not required. The default is <code>"false"</code>.
- *
- * <p>The value of this constant is <code>"javax.security.sasl.policy.credentials"</code>.
- * </p>
- */
- public static final String POLICY_PASS_CREDENTIALS = "javax.security.sasl.policy.credentials";
-
- /**
- * <p>The name of a property that specifies whether to reuse previously
- * authenticated session information. The property contains <code>"true"</code>
- * if the mechanism implementation may attempt to reuse previously
- * authenticated session information; it contains <code>"false"</code> if the
- * implementation must not reuse previously authenticated session information.
- * A setting of <code>"true"</code> serves only as a hint; it does not
- * necessarily entail actual reuse because reuse might not be possible due to
- * a number of reasons, including, but not limited to, lack of mechanism
- * support for reuse, expiration of reusable information, and the peer's
- * refusal to support reuse. The property's default value is <code>"false"</code>.
- * </p>
- *
- * <p>The value of this constant is <code>"javax.security.sasl.reuse"</code>.
- * Note that all other parameters and properties required to create a SASL
- * client/server instance must be provided regardless of whether this
- * property has been supplied. That is, you cannot supply any less
- * information in anticipation of reuse. Mechanism implementations that
- * support reuse might allow customization of its implementation for factors
- * such as cache size, timeouts, and criteria for reuseability. Such
- * customizations are implementation-dependent.</p>
- */
- public static final String REUSE = "javax.security.sasl.reuse";
-
- private static final String CLIENT_FACTORY_SVC = "SaslClientFactory.";
- private static final String SERVER_FACTORY_SVC = "SaslServerFactory.";
- private static final String ALIAS = "Alg.Alias.";
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- private Sasl()
- {
- super();
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- /**
- * Creates a {@link SaslClient} for the specified mechanism.
- *
- * <p>This method uses the JCA Security Provider Framework, described in the
- * "Java Cryptography Architecture API Specification &amp; Reference", for
- * locating and selecting a {@link SaslClient} implementation.</p>
- *
- * <p>First, it obtains an ordered list of {@link SaslClientFactory}
- * instances from the registered security providers for the
- * <code>"SaslClientFactory"</code> service and the specified mechanism. It
- * then invokes <code>createSaslClient()</code> on each factory instance on
- * the list until one produces a non-null {@link SaslClient} instance. It
- * returns the non-null {@link SaslClient} instance, or <code>null</code> if
- * the search fails to produce a non-null {@link SaslClient} instance.</p>
- *
- * <p>A security provider for <code>SaslClientFactory</code> registers with
- * the JCA Security Provider Framework keys of the form:</p>
- *
- * <pre>
- * SaslClientFactory.mechanism_name
- * </pre>
- *
- * <p>and values that are class names of implementations of {@link
- * SaslClientFactory}.</p>
- *
- * <p>For example, a provider that contains a factory class,
- * <code>com.wiz.sasl.digest.ClientFactory</code>, that supports the
- * <code>"DIGEST-MD5"</code> mechanism would register the following entry
- * with the JCA:</p>
- *
- * <pre>
- * SaslClientFactory.DIGEST-MD5 com.wiz.sasl.digest.ClientFactory
- * </pre>
- *
- * <p>See the "Java Cryptography Architecture API Specification &amp;
- * Reference" for information about how to install and configure security
- * service providers.</p>
- *
- * @param mechanisms the non-null list of mechanism names to try. Each is the
- * IANA-registered name of a SASL mechanism. (e.g. "GSSAPI", "CRAM-MD5").
- * @param authorizationID the possibly <code>null</code> protocol-dependent
- * identification to be used for authorization. If <code>null</code> or
- * empty, the server derives an authorization ID from the client's
- * authentication credentials. When the SASL authentication completes
- * successfully, the specified entity is granted access.
- * @param protocol the non-null string name of the protocol for which the
- * authentication is being performed (e.g. "ldap").
- * @param serverName the non-null fully-qualified host name of the server to
- * authenticate to.
- * @param props the possibly null set of properties used to select the SASL
- * mechanism and to configure the authentication exchange of the selected
- * mechanism. For example, if props contains the {@link Sasl#POLICY_NOPLAINTEXT}
- * property with the value <code>"true"</code>, then the selected SASL
- * mechanism must not be susceptible to simple plain passive attacks. In
- * addition to the standard properties declared in this class, other,
- * possibly mechanism-specific, properties can be included. Properties not
- * relevant to the selected mechanism are ignored.
- * @param cbh the possibly <code>null</code> callback handler to used by the
- * SASL mechanisms to get further information from the application/library to
- * complete the authentication. For example, a SASL mechanism might require
- * the authentication ID, password and realm from the caller. The
- * authentication ID is requested by using a
- * {@link javax.security.auth.callback.NameCallback}. The password is
- * requested by using a {@link javax.security.auth.callback.PasswordCallback}.
- * The realm is requested by using a {@link RealmChoiceCallback} if there is
- * a list of realms to choose from, and by using a {@link RealmCallback} if
- * the realm must be entered.
- * @return a possibly <code>null</code> {@link SaslClient} created using the
- * parameters supplied. If <code>null</code>, the method could not find a
- * {@link SaslClientFactory} that will produce one.
- * @throws SaslException if a {@link SaslClient} cannot be created because
- * of an error.
- */
- public static SaslClient createSaslClient(String[] mechanisms,
- String authorizationID,
- String protocol,
- String serverName, Map props,
- CallbackHandler cbh)
- throws SaslException
- {
- if (mechanisms == null)
- {
- return null;
- }
- Provider[] providers = Security.getProviders();
- if (providers == null || providers.length == 0)
- {
- return null;
- }
-
- SaslClient result = null;
- SaslClientFactory factory = null;
- String m, clazz = null, upper, alias;
- int j;
- Provider p;
- for (int i = 0; i < mechanisms.length; i++)
- {
- m = mechanisms[i];
- if (m == null)
- continue;
- for (j = 0; j < providers.length; j++)
- {
- p = providers[j];
- if (p != null)
- {
- // try the name as is
- clazz = p.getProperty(CLIENT_FACTORY_SVC + m);
- if (clazz == null) // try all uppercase
- {
- upper = m.toUpperCase();
- clazz = p.getProperty(CLIENT_FACTORY_SVC + upper);
- if (clazz == null) // try if it's an alias
- {
- alias = p.getProperty(ALIAS + CLIENT_FACTORY_SVC + m);
- if (alias == null) // try all-uppercase alias name
- {
- alias = p.getProperty(ALIAS + CLIENT_FACTORY_SVC + upper);
- if (alias == null) // spit the dummy
- continue;
- }
- clazz = p.getProperty(CLIENT_FACTORY_SVC + alias);
- }
- }
- if (clazz == null)
- continue;
- else
- clazz = clazz.trim();
- }
-
- try
- {
- result = null;
- factory = (SaslClientFactory) Class.forName(clazz).newInstance();
- result = factory.createSaslClient(mechanisms, authorizationID,
- protocol, serverName, props, cbh);
- }
- catch (ClassCastException ignored) // ignore instantiation exceptions
- {
- }
- catch (ClassNotFoundException ignored)
- {
- }
- catch (InstantiationException ignored)
- {
- }
- catch (IllegalAccessException ignored)
- {
- }
- if (result != null)
- return result;
- }
- }
- return null;
- }
-
- /**
- * Gets an enumeration of known factories for producing a {@link SaslClient}
- * instance. This method uses the same sources for locating factories as
- * <code>createSaslClient()</code>.
- *
- * @return a non-null {@link Enumeration} of known factories for producing a
- * {@link SaslClient} instance.
- * @see #createSaslClient(String[],String,String,String,Map,CallbackHandler)
- */
- public static Enumeration getSaslClientFactories()
- {
- Vector result = new Vector();
- HashSet names = new HashSet();
- Provider[] providers = Security.getProviders();
- Iterator it;
- if (providers == null)
- {
- Provider p;
- String key;
- for (int i = 0; i < providers.length; i++)
- {
- p = providers[i];
- for (it = p.keySet().iterator(); it.hasNext(); )
- {
- key = (String) it.next();
- // add key's binding (a) it is a class of a client factory,
- // and (b) the key does not include blanks
- if (key.startsWith(CLIENT_FACTORY_SVC) && key.indexOf(" ") == -1)
- {
- names.add(p.getProperty(key));
- break;
- }
- }
- }
- }
- // we have the factory class names in names; instantiate and enumerate
- String c;
- for (it = names.iterator(); it.hasNext(); )
- {
- c = (String) it.next();
- try
- {
- SaslClientFactory f = (SaslClientFactory) Class.forName(c).newInstance();
- if (f != null)
- result.add(f);
- } catch (ClassCastException ignored) { // ignore instantiation exceptions
- } catch (ClassNotFoundException ignored) {
- } catch (InstantiationException ignored) {
- } catch (IllegalAccessException ignored) {
- }
- }
-
- return result.elements();
- }
-
- /**
- * Creates a {@link SaslServer} for the specified mechanism.
- *
- * <p>This method uses the JCA Security Provider Framework, described in the
- * "Java Cryptography Architecture API Specification &amp; Reference", for
- * locating and selecting a SaslServer implementation.</p>
- *
- * <p>First, it obtains an ordered list of {@link SaslServerFactory}
- * instances from the registered security providers for the
- * <code>"SaslServerFactory"</code> service and the specified mechanism. It
- * then invokes <code>createSaslServer()</code> on each factory instance on
- * the list until one produces a non-null {@link SaslServer} instance. It
- * returns the non-null {@link SaslServer} instance, or <code>null</code> if
- * the search fails to produce a non-null {@link SaslServer} instance.</p>
- *
- * <p>A security provider for {@link SaslServerFactory} registers with the
- * JCA Security Provider Framework keys of the form:</p>
- *
- * <pre>
- * SaslServerFactory.mechanism_name
- * </pre>
- *
- * <p>and values that are class names of implementations of {@link
- * SaslServerFactory}.</p>
- *
- * <p>For example, a provider that contains a factory class,
- * <code>com.wiz.sasl.digest.ServerFactory</code>, that supports the
- * <code>"DIGEST-MD5"</code> mechanism would register the following entry
- * with the JCA:</p>
- *
- * <pre>
- * SaslServerFactory.DIGEST-MD5 com.wiz.sasl.digest.ServerFactory
- * </pre>
- *
- * <p>See the "Java Cryptography Architecture API Specification &amp;
- * Reference" for information about how to install and configure security
- * service providers.</p>
- *
- * @param mechanism the non-null mechanism name. It must be an
- * IANA-registered name of a SASL mechanism. (e.g. "GSSAPI", "CRAM-MD5").
- * @param protocol the non-null string name of the protocol for which the
- * authentication is being performed (e.g. "ldap").
- * @param serverName the non-null fully qualified host name of the server.
- * @param props the possibly <code>null</code> set of properties used to
- * select the SASL mechanism and to configure the authentication exchange of
- * the selected mechanism. For example, if props contains the {@link
- * Sasl#POLICY_NOPLAINTEXT} property with the value <code>"true"</code>, then
- * the selected SASL mechanism must not be susceptible to simple plain
- * passive attacks. In addition to the standard properties declared in this
- * class, other, possibly mechanism-specific, properties can be included.
- * Properties not relevant to the selected mechanism are ignored.
- * @param cbh the possibly <code>null</code> callback handler to used by the
- * SASL mechanisms to get further information from the application/library to
- * complete the authentication. For example, a SASL mechanism might require
- * the authentication ID, password and realm from the caller. The
- * authentication ID is requested by using a
- * {@link javax.security.auth.callback.NameCallback}. The password is
- * requested by using a {@link javax.security.auth.callback.PasswordCallback}.
- * The realm is requested by using a {@link RealmChoiceCallback} if there is
- * a list of realms to choose from, and by using a {@link RealmCallback} if
- * the realm must be entered.
- * @return a possibly <code>null</code> {@link SaslServer} created using the
- * parameters supplied. If <code>null</code>, the method cannot find a
- * {@link SaslServerFactory} instance that will produce one.
- * @throws SaslException if a {@link SaslServer} instance cannot be created
- * because of an error.
- */
- public static SaslServer createSaslServer(String mechanism, String protocol,
- String serverName,
- Map props, CallbackHandler cbh)
- throws SaslException
- {
- if (mechanism == null)
- return null;
- Provider[] providers = Security.getProviders();
- if (providers == null || providers.length == 0)
- return null;
-
- SaslServer result = null;
- SaslServerFactory factory = null;
- String clazz = null, upper, alias = null;
- int j;
- Provider p;
- for (j = 0; j < providers.length; j++)
- {
- p = providers[j];
- if (p != null)
- {
- // try the name as is
- clazz = p.getProperty(SERVER_FACTORY_SVC + mechanism);
- if (clazz == null) // try all uppercase
- {
- upper = mechanism.toUpperCase();
- clazz = p.getProperty(SERVER_FACTORY_SVC + upper);
- if (clazz == null) // try if it's an alias
- {
- alias = p.getProperty(ALIAS + SERVER_FACTORY_SVC + mechanism);
- if (alias == null) // try all-uppercase alias name
- {
- alias = p.getProperty(ALIAS + SERVER_FACTORY_SVC + upper);
- if (alias == null) // spit the dummy
- continue;
- }
- }
- clazz = p.getProperty(SERVER_FACTORY_SVC + alias);
- }
- }
- if (clazz == null)
- continue;
- else
- clazz = clazz.trim();
-
- try
- {
- result = null;
- factory = (SaslServerFactory) Class.forName(clazz).newInstance();
- result =
- factory.createSaslServer(mechanism, protocol, serverName, props, cbh);
- }
- catch (ClassCastException ignored) // ignore instantiation exceptions
- {
- }
- catch (ClassNotFoundException ignored)
- {
- }
- catch (InstantiationException ignored)
- {
- }
- catch (IllegalAccessException ignored)
- {
- }
- if (result != null)
- return result;
- }
- return null;
- }
-
- /**
- * Gets an enumeration of known factories for producing a {@link SaslServer}
- * instance. This method uses the same sources for locating factories as
- * <code>createSaslServer()</code>.
- *
- * @return a non-null {@link Enumeration} of known factories for producing a
- * {@link SaslServer} instance.
- * @see #createSaslServer(String,String,String,Map,CallbackHandler)
- */
- public static Enumeration getSaslServerFactories()
- {
- Vector result = new Vector();
- HashSet names = new HashSet();
- Provider[] providers = Security.getProviders();
- Iterator it;
- if (providers == null)
- {
- Provider p;
- String key;
- for (int i = 0; i < providers.length; i++)
- {
- p = providers[i];
- for (it = p.keySet().iterator(); it.hasNext(); )
- {
- key = (String) it.next();
- // add key's binding (a) it is a class of a server factory,
- // and (b) the key does not include blanks
- if (key.startsWith(SERVER_FACTORY_SVC) && key.indexOf(" ") == -1)
- {
- names.add(p.getProperty(key));
- break;
- }
- }
- }
- }
- // we have the factory class names in names; instantiate and enumerate
- String c;
- for (it = names.iterator(); it.hasNext(); )
- {
- c = (String) it.next();
- try
- {
- SaslServerFactory f = (SaslServerFactory) Class.forName(c).newInstance();
- if (f != null)
- result.add(f);
- }
- catch (ClassCastException ignored) // ignore instantiation exceptions
- {
- }
- catch (ClassNotFoundException ignored)
- {
- }
- catch (InstantiationException ignored)
- {
- }
- catch (IllegalAccessException ignored)
- {
- }
- }
-
- return result.elements();
- }
-}
diff --git a/libjava/javax/security/sasl/SaslClient.java b/libjava/javax/security/sasl/SaslClient.java
deleted file mode 100644
index 544ab17d6a8..00000000000
--- a/libjava/javax/security/sasl/SaslClient.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/* SaslClient.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.sasl;
-
-/**
- * <p>Performs SASL authentication as a client.</p>
- *
- * <p>A protocol library such as one for LDAP gets an instance of this class in
- * order to perform authentication defined by a specific SASL mechanism.
- * Invoking methods on the <code>SaslClient</code> instance process challenges
- * and create responses according to the SASL mechanism implemented by the
- * <code>SaslClient</code>. As the authentication proceeds, the instance
- * encapsulates the state of a SASL client's authentication exchange.</p>
- *
- * <p>Here's an example of how an LDAP library might use a <code>SaslClient</code>.
- * It first gets an instance of a SaslClient:</p>
- * <pre>
- *SaslClient sc =
- * Sasl.createSaslClient(mechanisms, authorizationID, protocol,
- * serverName, props, callbackHandler);
- * </pre>
- *
- * <p>It can then proceed to use the client for authentication. For example, an
- * LDAP library might use the client as follows:</p>
- * <pre>
- * // Get initial response and send to server
- *byte[] response = sc.hasInitialResponse()
- * ? sc.evaluateChallenge(new byte[0]) : null;
- *LdapResult res = ldap.sendBindRequest(dn, sc.getName(), response);
- *while (!sc.isComplete()
- * && ((res.status == SASL_BIND_IN_PROGRESS) || (res.status == SUCCESS))) {
- * response = sc.evaluateChallenge( res.getBytes() );
- * if (res.status == SUCCESS) {
- * // we're done; don't expect to send another BIND
- * if ( response != null ) {
- * throw new SaslException(
- * "Protocol error: attempting to send response after completion");
- * }
- * break;
- * }
- * res = ldap.sendBindRequest(dn, sc.getName(), response);
- *}
- *if (sc.isComplete() && (res.status == SUCCESS) ) {
- * String qop = (String)sc.getNegotiatedProperty(Sasl.QOP);
- * if ((qop != null)
- * && (qop.equalsIgnoreCase("auth-int")
- * || qop.equalsIgnoreCase("auth-conf"))) {
- * // Use SaslClient.wrap() and SaslClient.unwrap() for future
- * // communication with server
- * ldap.in = new SecureInputStream(sc, ldap.in);
- * ldap.out = new SecureOutputStream(sc, ldap.out);
- * }
- *}
- * </pre>
- *
- * <p>If the mechanism has an initial response, the library invokes
- * {@link #evaluateChallenge(byte[])} with an empty challenge to get the initial
- * response. Protocols such as IMAP4, which do not include an initial response
- * with their first authentication command to the server, initiate the
- * authentication without first calling {@link #hasInitialResponse()} or
- * {@link #evaluateChallenge(byte[])}. When the server responds to the command,
- * it sends an initial challenge. For a SASL mechanism in which the client sends
- * data first, the server should have issued a challenge with no data. This will
- * then result in a call (on the client) to {@link #evaluateChallenge(byte[])}
- * with an empty challenge.</p>
- *
- * @see Sasl
- * @see SaslClientFactory
- */
-public interface SaslClient
-{
-
- /**
- * Returns the IANA-registered mechanism name of this SASL client. (e.g.
- * "CRAM-MD5", "GSSAPI").
- *
- * @return a non-null string representing the IANA-registered mechanism name.
- */
- String getMechanismName();
-
- /**
- * Determines if this mechanism has an optional initial response. If
- * <code>true</code>, caller should call {@link #evaluateChallenge(byte[])}
- * with an empty array to get the initial response.
- *
- * @return <code>true</code> if this mechanism has an initial response.
- */
- boolean hasInitialResponse();
-
- /**
- * Evaluates the challenge data and generates a response. If a challenge is
- * received from the server during the authentication process, this method is
- * called to prepare an appropriate next response to submit to the server.
- *
- * @param challenge the non-null challenge sent from the server. The
- * challenge array may have zero length.
- * @return the possibly <code>null</code> reponse to send to the server. It
- * is <code>null</code> if the challenge accompanied a "SUCCESS" status and
- * the challenge only contains data for the client to update its state and no
- * response needs to be sent to the server. The response is a zero-length
- * byte array if the client is to send a response with no data.
- * @throws SaslException if an error occurred while processing the challenge
- * or generating a response.
- */
- byte[] evaluateChallenge(byte[] challenge) throws SaslException;
-
- /**
- * Determines if the authentication exchange has completed. This method may
- * be called at any time, but typically, it will not be called until the
- * caller has received indication from the server (in a protocol-specific
- * manner) that the exchange has completed.
- *
- * @return <code>true</code> if the authentication exchange has completed;
- * <code>false</code> otherwise.
- */
- boolean isComplete();
-
- /**
- * <p>Unwraps a byte array received from the server. This method can be
- * called only after the authentication exchange has completed (i.e., when
- * {@link #isComplete()} returns <code>true</code>) and only if the
- * authentication exchange has negotiated integrity and/or privacy as the
- * quality of protection; otherwise, an {@link IllegalStateException} is
- * thrown.</p>
- *
- * <p><code>incoming</code> is the contents of the SASL buffer as defined in
- * RFC 2222 without the leading four octet field that represents the length.
- * <code>offset</code> and <code>len</code> specify the portion of incoming
- * to use.</p>
- *
- * @param incoming a non-null byte array containing the encoded bytes from
- * the server.
- * @param offset the starting position at <code>incoming</code> of the bytes
- * to use.
- * @param len the number of bytes from <code>incoming</code> to use.
- * @return a non-null byte array containing the decoded bytes.
- * @throws SaslException if <code>incoming</code> cannot be successfully
- * unwrapped.
- * @throws IllegalStateException if the authentication exchange has not
- * completed, or if the negotiated quality of protection has neither
- * integrity nor privacy.
- */
- byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException;
-
- /**
- * <p>Wraps a byte array to be sent to the server. This method can be called
- * only after the authentication exchange has completed (i.e., when
- * {@link #isComplete()} returns <code>true</code>) and only if the
- * authentication exchange has negotiated integrity and/or privacy as the
- * quality of protection; otherwise, an {@link IllegalStateException} is
- * thrown.</p>
- *
- * <p>The result of this method will make up the contents of the SASL buffer
- * as defined in RFC 2222 without the leading four octet field that
- * represents the length. <code>offset</code> and <code>len</code> specify
- * the portion of <code>outgoing</code> to use.</p>
- *
- * @param outgoing a non-null byte array containing the bytes to encode.
- * @param offset the starting position at <code>outgoing</code> of the bytes
- * to use.
- * @param len the number of bytes from <code>outgoing</code> to use.
- * @return a non-null byte array containing the encoded bytes.
- * @throws SaslException if <code>outgoing</code> cannot be successfully
- * wrapped.
- * @throws IllegalStateException if the authentication exchange has not
- * completed, or if the negotiated quality of protection has neither
- * integrity nor privacy.
- */
- byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException;
-
- /**
- * Retrieves the negotiated property. This method can be called only after
- * the authentication exchange has completed (i.e., when {@link #isComplete()}
- * returns <code>true</code>); otherwise, an {@link IllegalStateException} is
- * thrown.
- *
- * @param propName the non-null property name.
- * @return the value of the negotiated property. If <code>null</code>, the
- * property was not negotiated or is not applicable to this mechanism.
- * @throws IllegalStateException if this authentication exchange has not
- * completed.
- */
- Object getNegotiatedProperty(String propName) throws SaslException;
-
- /**
- * Disposes of any system resources or security-sensitive information the
- * <code>SaslClient</code> might be using. Invoking this method invalidates
- * the <code>SaslClient</code> instance. This method is idempotent.
- *
- * @throws SaslException if a problem was encountered while disposing of the
- * resources.
- */
- void dispose() throws SaslException;
-}
diff --git a/libjava/javax/security/sasl/SaslClientFactory.java b/libjava/javax/security/sasl/SaslClientFactory.java
deleted file mode 100644
index d6e8cd5ffd1..00000000000
--- a/libjava/javax/security/sasl/SaslClientFactory.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/* SaslClientFactory.java
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.sasl;
-
-import java.util.Map;
-
-import javax.security.auth.callback.CallbackHandler;
-
-/**
- * <p>An interface for creating instances of {@link SaslClient}. A class that
- * implements this interface must be thread-safe and handle multiple
- * simultaneous requests. It must also have a public constructor that accepts
- * no arguments.</p>
- *
- * <p>This interface is not normally accessed directly by a client, which will
- * use the {@link Sasl} static methods to create a client instance instead.
- * However, a particular environment may provide and install a new or different
- * <code>SaslClientFactory</code>.</p>
- *
- * @see SaslClient
- * @see Sasl
- */
-public interface SaslClientFactory
-{
-
- /**
- * Creates a {@link SaslClient} using the parameters supplied.
- *
- * @param mechanisms the non-null list of mechanism names to try. Each is the
- * IANA-registered name of a SASL mechanism (e.g. "GSSAPI", "CRAM-MD5").
- * @param authorizationID the possibly null protocol-dependent identification
- * to be used for authorization. If <code>null</code> or empty, the server
- * derives an authorization ID from the client's authentication credentials.
- * When the SASL authentication completes successfully, the specified entity
- * is granted access.
- * @param protocol the non-null string name of the protocol for which the
- * authentication is being performed (e.g. "ldap").
- * @param serverName the non-null fully qualified host name of the server to
- * authenticate to.
- * @param props the possibly <code>null</code> set of properties used to
- * select the SASL mechanism and to configure the authentication exchange of
- * the selected mechanism. See the {@link Sasl} class for a list of standard
- * properties. Other, possibly mechanism-specific, properties can be included.
- * Properties not relevant to the selected mechanism are ignored.
- * @param cbh the possibly <code>null</code> callback handler to used by the
- * SASL mechanisms to get further information from the application/library to
- * complete the authentication. For example, a SASL mechanism might require
- * the authentication ID, password and realm from the caller. The
- * authentication ID is requested by using a
- * {@link javax.security.auth.callback.NameCallback}. The password is
- * requested by using a {@link javax.security.auth.callback.PasswordCallback}.
- * The realm is requested by using a {@link RealmChoiceCallback} if there is
- * a list of realms to choose from, and by using a {@link RealmCallback} if
- * the realm must be entered.
- * @return a possibly <code>null</code> {@link SaslClient} created using the
- * parameters supplied. If <code>null</code>, this factory cannot produce a
- * {@link SaslClient} using the parameters supplied.
- * @throws SaslException if a {@link SaslClient} instance cannot be created
- * because of an error.
- */
- SaslClient createSaslClient(String[] mechanisms, String authorizationID,
- String protocol, String serverName, Map props,
- CallbackHandler cbh)
- throws SaslException;
-
- /**
- * Returns an array of names of mechanisms that match the specified mechanism
- * selection policies.
- *
- * @param props the possibly <code>null</code> set of properties used to
- * specify the security policy of the SASL mechanisms. For example, if props
- * contains the {@link Sasl#POLICY_NOPLAINTEXT} property with the value
- * <code>"true"</code>, then the factory must not return any SASL mechanisms
- * that are susceptible to simple plain passive attacks. See the {@link Sasl}
- * class for a complete list of policy properties. Non-policy related
- * properties, if present in props, are ignored.
- * @return a non-null array containing IANA-registered SASL mechanism names.
- */
- String[] getMechanismNames(Map props);
-}
diff --git a/libjava/javax/security/sasl/SaslException.java b/libjava/javax/security/sasl/SaslException.java
deleted file mode 100644
index 13113e6bcda..00000000000
--- a/libjava/javax/security/sasl/SaslException.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/* SaslException.java
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.sasl;
-
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.Serializable;
-
-/**
- * This class represents an error that has occurred when using SASL.
- */
-public class SaslException extends IOException implements Serializable
-{
-
- // Constants and variables
- // -------------------------------------------------------------------------
-
- /**
- * @serial The possibly null root cause exception.
- */
- private Throwable _exception = null;
-
- // Constructor(s)
- // -------------------------------------------------------------------------
-
- /**
- * Constructs a new instance of <code>SaslException</code>. The root
- * exception and the detailed message are null.
- */
- public SaslException()
- {
- super();
- }
-
- /**
- * Constructs a new instance of <code>SaslException</code> with a detailed
- * message. The <code>root</code> exception is <code>null</code>.
- *
- * @param detail a possibly null string containing details of the exception.
- * @see Throwable#getMessage()
- */
- public SaslException(String detail)
- {
- super(detail);
- }
-
- /**
- * Constructs a new instance of <code>SaslException</code> with a detailed
- * message and a root exception. For example, a <code>SaslException</code>
- * might result from a problem with the callback handler, which might throw a
- * {@link javax.security.auth.callback.UnsupportedCallbackException} if it
- * does not support the requested callback, or throw an {@link IOException}
- * if it had problems obtaining data for the callback. The
- * <code>SaslException</code>'s root exception would be then be the exception
- * thrown by the callback handler.
- *
- * @param detail a possibly <code>null</code> string containing details of
- * the exception.
- * @param ex a possibly <code>null</code> root exception that caused this
- * exception.
- * @see Throwable#getMessage()
- * @see #getCause()
- */
- public SaslException(String detail, Throwable ex)
- {
- super(detail);
- _exception = ex;
- }
-
- // Class methods
- // -------------------------------------------------------------------------
-
- // Instance methods
- // -------------------------------------------------------------------------
-
- /**
- * Returns the cause of this throwable or <code>null</code> if the cause is
- * nonexistent or unknown. The cause is the throwable that caused this
- * exception to be thrown.
- *
- * @return the possibly <code>null</code> exception that caused this exception.
- */
- public Throwable getCause()
- {
- return _exception;
- }
-
- /**
- * Prints this exception's stack trace to <code>System.err</code>. If this
- * exception has a root exception; the stack trace of the root exception is
- * also printed to <code>System.err</code>.
- */
- public void printStackTrace()
- {
- super.printStackTrace();
- if (_exception != null)
- _exception.printStackTrace();
- }
-
- /**
- * Prints this exception's stack trace to a print stream. If this exception
- * has a root exception; the stack trace of the root exception is also
- * printed to the print stream.
- *
- * @param ps the non-null print stream to which to print.
- */
- public void printStackTrace(PrintStream ps)
- {
- super.printStackTrace(ps);
- if (_exception != null)
- _exception.printStackTrace(ps);
- }
-
- /**
- * Prints this exception's stack trace to a print writer. If this exception
- * has a root exception; the stack trace of the root exception is also
- * printed to the print writer.
- *
- * @param pw the non-null print writer to use for output.
- */
- public void printStackTrace(PrintWriter pw)
- {
- super.printStackTrace(pw);
- if (_exception != null)
- _exception.printStackTrace(pw);
- }
-
- /**
- * Returns the string representation of this exception. The string
- * representation contains this exception's class name, its detailed
- * messsage, and if it has a root exception, the string representation of the
- * root exception. This string representation is meant for debugging and not
- * meant to be interpreted programmatically.
- *
- * @return the non-null string representation of this exception.
- * @see Throwable#getMessage()
- */
- public String toString()
- {
- StringBuffer sb = new StringBuffer(this.getClass().getName())
- .append(": ").append(super.toString());
- if (_exception != null)
- sb.append("; caused by: ").append(_exception.toString());
- return sb.toString();
- }
-}
diff --git a/libjava/javax/security/sasl/SaslServer.java b/libjava/javax/security/sasl/SaslServer.java
deleted file mode 100644
index f5a04975d53..00000000000
--- a/libjava/javax/security/sasl/SaslServer.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/* SasServer.java
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.sasl;
-
-/**
- * <p>Performs SASL authentication as a server.</p>
- *
- * <p>A server such as an LDAP server gets an instance of this class in order to
- * perform authentication defined by a specific SASL mechanism. Invoking methods
- * on the <code>SaslServer</code> instance generates challenges corresponding to
- * the SASL mechanism implemented by the <code>SaslServer</code> instance. As
- * the authentication proceeds, the instance encapsulates the state of a SASL
- * server's authentication exchange.</p>
- *
- * <p>Here's an example of how an LDAP server might use a <code>SaslServer</code>
- * instance. It first gets an instance of a <code>SaslServer</code> for the SASL
- * mechanism requested by the client:</p>
- *
- * <pre>
- *SaslServer ss =
- * Sasl.createSaslServer(mechanism, "ldap", myFQDN, props, callbackHandler);
- * </pre>
- *
- * <p>It can then proceed to use the server for authentication. For example,
- * suppose the LDAP server received an LDAP BIND request containing the name of
- * the SASL mechanism and an (optional) initial response. It then might use the
- * server as follows:</p>
- *
- * <pre>
- *while (!ss.isComplete()) {
- * try {
- * byte[] challenge = ss.evaluateResponse(response);
- * if (ss.isComplete()) {
- * status = ldap.sendBindResponse(mechanism, challenge, SUCCESS);
- * } else {
- * status = ldap.sendBindResponse(mechanism, challenge, SASL_BIND_IN_PROGRESS);
- * response = ldap.readBindRequest();
- * }
- * } catch (SaslException x) {
- * status = ldap.sendErrorResponse(x);
- * break;
- * }
- *}
- *if (ss.isComplete() && (status == SUCCESS)) {
- * String qop = (String) sc.getNegotiatedProperty(Sasl.QOP);
- * if (qop != null
- * && (qop.equalsIgnoreCase("auth-int")
- * || qop.equalsIgnoreCase("auth-conf"))) {
- * // Use SaslServer.wrap() and SaslServer.unwrap() for future
- * // communication with client
- * ldap.in = new SecureInputStream(ss, ldap.in);
- * ldap.out = new SecureOutputStream(ss, ldap.out);
- * }
- *}
- * </pre>
- *
- * @see Sasl
- * @see SaslServerFactory
- */
-public interface SaslServer
-{
-
- /**
- * Returns the IANA-registered mechanism name of this SASL server (e.g.
- * "CRAM-MD5", "GSSAPI").
- *
- * @return a non-null string representing the IANA-registered mechanism name.
- */
- String getMechanismName();
-
- /**
- * Evaluates the response data and generates a challenge. If a response is
- * received from the client during the authentication process, this method is
- * called to prepare an appropriate next challenge to submit to the client.
- * The challenge is <code>null</code> if the authentication has succeeded and
- * no more challenge data is to be sent to the client. It is non-null if the
- * authentication must be continued by sending a challenge to the client, or
- * if the authentication has succeeded but challenge data needs to be
- * processed by the client. {@link #isComplete()} should be called after each
- * call to <code>evaluateResponse()</code>,to determine if any further
- * response is needed from the client.
- *
- * @param response the non-null (but possibly empty) response sent by the
- * client.
- * @return the possibly <code>null</code> challenge to send to the client.
- * It is <code>null</code> if the authentication has succeeded and there is
- * no more challenge data to be sent to the client.
- * @throws SaslException if an error occurred while processing the response
- * or generating a challenge.
- */
- byte[] evaluateResponse(byte[] response) throws SaslException;
-
- /**
- * Determines if the authentication exchange has completed. This method is
- * typically called after each invocation of {@link #evaluateResponse(byte[])}
- * to determine whether the authentication has completed successfully or
- * should be continued.
- *
- * @return <code>true</code> if the authentication exchange has completed;
- * <code>false</code> otherwise.
- */
- boolean isComplete();
-
- /**
- * Reports the authorization ID in effect for the client of this session This
- * method can only be called if {@link #isComplete()} returns <code>true</code>.
- *
- * @return the authorization ID of the client.
- * @throws IllegalStateException if this authentication session has not
- * completed.
- */
- String getAuthorizationID();
-
- /**
- * <p>Unwraps a byte array received from the client. This method can be called
- * only after the authentication exchange has completed (i.e., when
- * {@link #isComplete()} returns <code>true</code>) and only if the
- * authentication exchange has negotiated integrity and/or privacy as the
- * quality of protection; otherwise, an {@link IllegalStateException} is
- * thrown.</p>
- *
- * <p><code>incoming</code> is the contents of the SASL buffer as defined in
- * RFC 2222 without the leading four octet field that represents the length.
- * <code>offset</code> and <code>len</code> specify the portion of incoming
- * to use.</p>
- *
- * @param incoming a non-null byte array containing the encoded bytes from
- * the client.
- * @param offset the starting position at <code>incoming</code> of the bytes
- * to use.
- * @param len the number of bytes from <code>incoming</code> to use.
- * @return a non-null byte array containing the decoded bytes.
- * @throws SaslException if <code>incoming</code> cannot be successfully
- * unwrapped.
- * @throws IllegalStateException if the authentication exchange has not
- * completed, or if the negotiated quality of protection has neither
- * integrity nor privacy.
- */
- byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException;
-
- /**
- * <p>Wraps a byte array to be sent to the client. This method can be called
- * only after the authentication exchange has completed (i.e., when
- * {@link #isComplete()} returns <code>true</code>) and only if the
- * authentication exchange has negotiated integrity and/or privacy as the
- * quality of protection; otherwise, an {@link IllegalStateException} is
- * thrown.</p>
- *
- * <p>The result of this method will make up the contents of the SASL buffer
- * as defined in RFC 2222 without the leading four octet field that
- * represents the length. <code>offset</code> and <code>len</code> specify
- * the portion of <code>outgoing</code> to use.
- *
- * @param outgoing a non-null byte array containing the bytes to encode.
- * @param offset the starting position at <code>outgoing</code> of the bytes
- * to use.
- * @param len the number of bytes from <code>outgoing</code> to use.
- * @return a non-null byte array containing the encoded bytes.
- * @throws SaslException if <code>outgoing</code> cannot be successfully
- * wrapped.
- * @throws IllegalStateException if the authentication exchange has not
- * completed, or if the negotiated quality of protection has neither
- * integrity nor privacy.
- */
- byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException;
-
- /**
- * Retrieves the negotiated property. This method can be called only after
- * the authentication exchange has completed (i.e., when
- * {@link #isComplete()} returns <code>true</code>); otherwise, an
- * {@link IllegalStateException} is thrown.
- *
- * @return the value of the negotiated property. If <code>null</code>, the
- * property was not negotiated or is not applicable to this mechanism.
- * @throws IllegalStateException if this authentication exchange has not
- * completed.
- */
- Object getNegotiatedProperty(String propName) throws SaslException;
-
- /**
- * Disposes of any system resources or security-sensitive information the
- * <code>SaslServer</code> might be using. Invoking this method invalidates
- * the <code>SaslServer</code> instance. This method is idempotent.
- *
- * @throws SaslException if a problem was encountered while disposing of the
- * resources.
- */
- void dispose() throws SaslException;
-}
diff --git a/libjava/javax/security/sasl/SaslServerFactory.java b/libjava/javax/security/sasl/SaslServerFactory.java
deleted file mode 100644
index 0fff32fa43b..00000000000
--- a/libjava/javax/security/sasl/SaslServerFactory.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* SaslServerFactory.java
- Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.security.sasl;
-
-import java.util.Map;
-
-import javax.security.auth.callback.CallbackHandler;
-
-/**
- * <p>An interface for creating instances of {@link SaslServer}. A class that
- * implements this interface must be thread-safe and handle multiple
- * simultaneous requests. It must also have a public constructor that accepts
- * no arguments.</p>
- *
- * <p>This interface is not normally accessed directly by a server, which will
- * use the {@link Sasl} static methods to create a {@link SaslServer} instance
- * instead. However, a particular environment may provide and install a new or
- * different <code>SaslServerFactory</code>.</p>
- *
- * @see SaslServer
- * @see Sasl
- */
-public interface SaslServerFactory
-{
-
- /**
- * Creates a {@link SaslServer} instance using the parameters supplied. It
- * returns <code>null</code> if no {@link SaslServer} instance can be created
- * using the parameters supplied. Throws {@link SaslException} if it cannot
- * create a {@link SaslServer} because of an error.
- *
- * @param mechanism the non-null IANA-registered name of a SASL mechanism
- * (e.g. "GSSAPI", "CRAM-MD5").
- * @param protocol the non-null string name of the protocol for which the
- * authentication is being performed (e.g. "ldap").
- * @param serverName the non-null fully qualified host name of the server to
- * authenticate to.
- * @param props the possibly null set of properties used to select the SASL
- * mechanism and to configure the authentication exchange of the selected
- * mechanism. See the {@link Sasl} class for a list of standard properties.
- * Other, possibly mechanism-specific, properties can be included. Properties
- * not relevant to the selected mechanism are ignored.
- * @param cbh the possibly null callback handler to used by the SASL
- * mechanisms to get further information from the application/library to
- * complete the authentication. For example, a SASL mechanism might require
- * the authentication ID, password and realm from the caller. The
- * authentication ID is requested by using a
- * {@link javax.security.auth.callback.NameCallback}. The password is
- * requested by using a {@link javax.security.auth.callback.PasswordCallback}.
- * The realm is requested by using a {@link RealmChoiceCallback} if there is
- * a list of realms to choose from, and by using a {@link RealmCallback} if
- * the realm must be entered.
- * @return a possibly null {@link SaslServer} created using the parameters
- * supplied. If <code>null</code> is returned, it means that this factory
- * cannot produce a {@link SaslServer} using the parameters supplied.
- * @throws SaslException if a SaslServer instance cannot be created because
- * of an error.
- */
- SaslServer createSaslServer(String mechanism, String protocol,
- String serverName, Map props, CallbackHandler cbh)
- throws SaslException;
-
- /**
- * Returns an array of names of mechanisms that match the specified mechanism
- * selection policies.
- *
- * @param props the possibly <code>null</code> set of properties used to
- * specify the security policy of the SASL mechanisms. For example, if props
- * contains the {@link Sasl#POLICY_NOPLAINTEXT} property with the value
- * <code>"true"</code>, then the factory must not return any SASL mechanisms
- * that are susceptible to simple plain passive attacks. See the {@link Sasl}
- * class for a complete list of policy properties. Non-policy related
- * properties, if present in props, are ignored.
- * @return a non-null array containing IANA-registered SASL mechanism names.
- */
- String[] getMechanismNames(Map props);
-}
diff --git a/libjava/javax/sql/ConnectionEvent.java b/libjava/javax/sql/ConnectionEvent.java
deleted file mode 100644
index 0d20b1afb83..00000000000
--- a/libjava/javax/sql/ConnectionEvent.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ConnectionEvent.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.sql.SQLException;
-import java.util.EventObject;
-
-/**
- * @since 1.4
- */
-public class ConnectionEvent extends EventObject
-{
- private static final long serialVersionUID = -4843217645290030002L;
-
- // Note that the name is chosen for serialization.
- private SQLException ex;
-
- /**
- * @since 1.4
- */
- public ConnectionEvent(PooledConnection con)
- {
- super(con);
- }
-
- /**
- * @since 1.4
- */
- public ConnectionEvent(PooledConnection con, SQLException ex)
- {
- super(con);
- this.ex = ex;
- }
-
- /**
- * @since 1.4
- */
- public SQLException getSQLException()
- {
- return ex;
- }
-}
diff --git a/libjava/javax/sql/ConnectionEventListener.java b/libjava/javax/sql/ConnectionEventListener.java
deleted file mode 100644
index 08011896688..00000000000
--- a/libjava/javax/sql/ConnectionEventListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ConnectionEventListener.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.util.EventListener;
-
-/**
- * @since 1.4
- */
-public interface ConnectionEventListener extends EventListener
-{
- /**
- * @since 1.4
- */
- void connectionClosed(ConnectionEvent event);
-
- /**
- * @since 1.4
- */
- void connectionErrorOccurred(ConnectionEvent event);
-}
diff --git a/libjava/javax/sql/ConnectionPoolDataSource.java b/libjava/javax/sql/ConnectionPoolDataSource.java
deleted file mode 100644
index 99661d7f40f..00000000000
--- a/libjava/javax/sql/ConnectionPoolDataSource.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ConnectionPoolDataSource.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.io.PrintWriter;
-import java.sql.SQLException;
-
-/**
- * @since 1.4
- */
-public interface ConnectionPoolDataSource
-{
- /**
- * @since 1.4
- */
- PooledConnection getPooledConnection() throws SQLException;
-
- /**
- * @since 1.4
- */
- PooledConnection getPooledConnection(String user, String password)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- PrintWriter getLogWriter() throws SQLException;
-
- /**
- * @since 1.4
- */
- void setLogWriter(PrintWriter out) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setLoginTimeout(int seconds) throws SQLException;
-
- /**
- * @since 1.4
- */
- int getLoginTimeout() throws SQLException;
-}
diff --git a/libjava/javax/sql/DataSource.java b/libjava/javax/sql/DataSource.java
deleted file mode 100644
index de1bc82679f..00000000000
--- a/libjava/javax/sql/DataSource.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* DataSource.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.SQLException;
-
-/**
- * @since 1.4
- */
-public interface DataSource
-{
- /**
- * @since 1.4
- */
- Connection getConnection() throws SQLException;
-
- /**
- * @since 1.4
- */
- Connection getConnection(String username, String password)
- throws SQLException;
-
- /**
- * @since 1.4
- */
- PrintWriter getLogWriter() throws SQLException;
-
- /**
- * @since 1.4
- */
- void setLogWriter(PrintWriter out) throws SQLException;
-
- /**
- * @since 1.4
- */
- void setLoginTimeout(int seconds) throws SQLException;
-
- /**
- * @since 1.4
- */
- int getLoginTimeout() throws SQLException;
-}
diff --git a/libjava/javax/sql/PooledConnection.java b/libjava/javax/sql/PooledConnection.java
deleted file mode 100644
index 1fb23df1447..00000000000
--- a/libjava/javax/sql/PooledConnection.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* PooledConnection.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-/**
- * @since 1.4
- */
-public interface PooledConnection
-{
- /**
- * @since 1.4
- */
- Connection getConnection() throws SQLException;
-
- /**
- * @since 1.4
- */
- void close() throws SQLException;
-
- /**
- * @since 1.4
- */
- void addConnectionEventListener(ConnectionEventListener listener);
-
- /**
- * @since 1.4
- */
- void removeConnectionEventListener(ConnectionEventListener listener);
-}
diff --git a/libjava/javax/sql/RowSet.java b/libjava/javax/sql/RowSet.java
deleted file mode 100644
index 46b776b3c10..00000000000
--- a/libjava/javax/sql/RowSet.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/* RowSet.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.math.BigDecimal;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.Date;
-import java.sql.Ref;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.Calendar;
-import java.util.Map;
-
-/**
- * @since 1.4
- */
-public interface RowSet extends ResultSet
-{
- String getUrl() throws SQLException;
-
- void setUrl(String url) throws SQLException;
-
- String getDataSourceName();
-
- void setDataSourceName(String name) throws SQLException;
-
- String getUsername();
-
- void setUsername(String name) throws SQLException;
-
- String getPassword();
-
- void setPassword(String password) throws SQLException;
-
- int getTransactionIsolation();
-
- void setTransactionIsolation(int level) throws SQLException;
-
- Map getTypeMap() throws SQLException;
-
- void setTypeMap(Map map) throws SQLException;
-
- String getCommand();
-
- void setCommand(String cmd) throws SQLException;
-
- boolean isReadOnly();
-
- void setReadOnly(boolean value) throws SQLException;
-
- int getMaxFieldSize() throws SQLException;
-
- void setMaxFieldSize(int max) throws SQLException;
-
- int getMaxRows() throws SQLException;
-
- void setMaxRows(int max) throws SQLException;
-
- boolean getEscapeProcessing() throws SQLException;
-
- void setEscapeProcessing(boolean enable) throws SQLException;
-
- int getQueryTimeout() throws SQLException;
-
- void setQueryTimeout(int seconds) throws SQLException;
-
- void setType(int type) throws SQLException;
-
- void setConcurrency(int concurrency) throws SQLException;
-
- void setNull(int parameterIndex, int sqlType) throws SQLException;
-
- void setNull(int paramIndex, int sqlType, String typeName) throws
- SQLException;
-
- void setBoolean(int parameterIndex, boolean x) throws SQLException;
-
- void setByte(int parameterIndex, byte x) throws SQLException;
-
- void setShort(int parameterIndex, short x) throws SQLException;
-
- void setInt(int parameterIndex, int x) throws SQLException;
-
- void setLong(int parameterIndex, long x) throws SQLException;
-
- void setFloat(int parameterIndex, float x) throws SQLException;
-
- void setDouble(int parameterIndex, double x) throws SQLException;
-
- void setBigDecimal(int parameterIndex, BigDecimal x) throws
- SQLException;
-
- void setString(int parameterIndex, String x) throws SQLException;
-
- void setBytes(int parameterIndex, byte[] x) throws SQLException;
-
- void setDate(int parameterIndex, Date x) throws SQLException;
-
- void setTime(int parameterIndex, Time x) throws SQLException;
-
- void setTimestamp(int parameterIndex, Timestamp x) throws
- SQLException;
-
- void setAsciiStream(int parameterIndex, InputStream x, int length)
- throws SQLException;
-
- void setBinaryStream(int parameterIndex, InputStream x, int length)
- throws SQLException;
-
- void setCharacterStream(int parameterIndex, Reader reader, int
- length) throws SQLException;
-
- void setObject(int parameterIndex, Object x, int targetSqlType, int
- scale) throws SQLException;
-
- void setObject(int parameterIndex, Object x, int targetSqlType)
- throws SQLException;
-
- void setObject(int parameterIndex, Object x) throws SQLException;
-
- void setRef(int i, Ref x) throws SQLException;
-
- void setBlob(int i, Blob x) throws SQLException;
-
- void setClob(int i, Clob x) throws SQLException;
-
- void setArray(int i, Array x) throws SQLException;
-
- void setDate(int parameterIndex, Date x, Calendar cal) throws
- SQLException;
-
- void setTime(int parameterIndex, Time x, Calendar cal) throws
- SQLException;
-
- void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
- throws SQLException;
-
- void clearParameters() throws SQLException;
-
- void execute() throws SQLException;
-
- void addRowSetListener(RowSetListener listener);
-
- void removeRowSetListener(RowSetListener listener);
-}
diff --git a/libjava/javax/sql/RowSetEvent.java b/libjava/javax/sql/RowSetEvent.java
deleted file mode 100644
index 26de4e97330..00000000000
--- a/libjava/javax/sql/RowSetEvent.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* RowSetEvent.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.util.EventObject;
-
-/**
- * @since 1.4
- */
-public class RowSetEvent extends EventObject
-{
- public RowSetEvent(RowSet source)
- {
- super(source);
- }
-}
diff --git a/libjava/javax/sql/RowSetInternal.java b/libjava/javax/sql/RowSetInternal.java
deleted file mode 100644
index 1fdacb9e766..00000000000
--- a/libjava/javax/sql/RowSetInternal.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* RowSetInternal.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-/**
- * @since 1.4
- */
-public interface RowSetInternal
-{
- /**
- * @since 1.4
- */
- Object[] getParams() throws SQLException;
-
- /**
- * @since 1.4
- */
- Connection getConnection() throws SQLException;
-
- /**
- * @since 1.4
- */
- void setMetaData(RowSetMetaData md) throws SQLException;
-
- /**
- * @since 1.4
- */
- ResultSet getOriginal() throws SQLException;
-
- /**
- * @since 1.4
- */
- ResultSet getOriginalRow() throws SQLException;
-}
diff --git a/libjava/javax/sql/RowSetListener.java b/libjava/javax/sql/RowSetListener.java
deleted file mode 100644
index 86726747ffa..00000000000
--- a/libjava/javax/sql/RowSetListener.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* RowSetListener.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.util.EventListener;
-
-/**
- * @since 1.4
- */
-public interface RowSetListener extends EventListener
-{
- void rowSetChanged(RowSetEvent event);
-
- void rowChanged(RowSetEvent event);
-
- void cursorMoved(RowSetEvent event);
-}
diff --git a/libjava/javax/sql/RowSetMetaData.java b/libjava/javax/sql/RowSetMetaData.java
deleted file mode 100644
index 8279fee3950..00000000000
--- a/libjava/javax/sql/RowSetMetaData.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* RowSetMetaData.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-
-/**
- * @since 1.4
- */
-public interface RowSetMetaData extends ResultSetMetaData
-{
- void setColumnCount(int columnCount) throws SQLException;
-
- void setAutoIncrement(int columnIndex, boolean property)
- throws SQLException;
-
- void setCaseSensitive(int columnIndex, boolean property)
- throws SQLException;
-
- void setSearchable(int columnIndex, boolean property)
- throws SQLException;
-
- void setCurrency(int columnIndex, boolean property)
- throws SQLException;
-
- void setNullable(int columnIndex, int property) throws SQLException;
-
- void setSigned(int columnIndex, boolean property)
- throws SQLException;
-
- void setColumnDisplaySize(int columnIndex, int size)
- throws SQLException;
-
- void setColumnLabel(int columnIndex, String label)
- throws SQLException;
-
- void setColumnName(int columnIndex, String columnName)
- throws SQLException;
-
- void setSchemaName(int columnIndex, String schemaName)
- throws SQLException;
-
- void setPrecision(int columnIndex, int precision)
- throws SQLException;
-
- void setScale(int columnIndex, int scale) throws SQLException;
-
- void setTableName(int columnIndex, String tableName)
- throws SQLException;
-
- void setCatalogName(int columnIndex, String catalogName)
- throws SQLException;
-
- void setColumnType(int columnIndex, int SQLType) throws SQLException;
-
- void setColumnTypeName(int columnIndex, String typeName)
- throws SQLException;
-}
diff --git a/libjava/javax/sql/RowSetReader.java b/libjava/javax/sql/RowSetReader.java
deleted file mode 100644
index fb33315b457..00000000000
--- a/libjava/javax/sql/RowSetReader.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* RowSetReader.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.sql.SQLException;
-
-/**
- * @since 1.4
- */
-public interface RowSetReader
-{
- void readData(RowSetInternal caller) throws SQLException;
-}
diff --git a/libjava/javax/sql/RowSetWriter.java b/libjava/javax/sql/RowSetWriter.java
deleted file mode 100644
index 20c1034dd54..00000000000
--- a/libjava/javax/sql/RowSetWriter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* RowSetWriter.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.sql.SQLException;
-
-/**
- * @since 1.4
- */
-public interface RowSetWriter
-{
- boolean writeData(RowSetInternal caller) throws SQLException;
-}
diff --git a/libjava/javax/sql/XAConnection.java b/libjava/javax/sql/XAConnection.java
deleted file mode 100644
index 2fadffcfece..00000000000
--- a/libjava/javax/sql/XAConnection.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* XAConnection.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.sql.SQLException;
-
-import javax.transaction.xa.XAResource;
-
-/**
- * @since 1.4
- */
-public interface XAConnection extends PooledConnection
-{
- XAResource getXAResource() throws SQLException;
-}
diff --git a/libjava/javax/sql/XADataSource.java b/libjava/javax/sql/XADataSource.java
deleted file mode 100644
index 724e2f08a3e..00000000000
--- a/libjava/javax/sql/XADataSource.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* XADataSource.java
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.sql;
-
-import java.io.PrintWriter;
-import java.sql.SQLException;
-
-/**
- * @since 1.4
- */
-public interface XADataSource
-{
- XAConnection getXAConnection() throws SQLException;
-
- XAConnection getXAConnection(String user, String password) throws
- SQLException;
-
- PrintWriter getLogWriter() throws SQLException;
-
- void setLogWriter(PrintWriter out) throws SQLException;
-
- void setLoginTimeout(int seconds) throws SQLException;
-
- int getLoginTimeout() throws SQLException;
-}
diff --git a/libjava/javax/swing/AbstractAction.java b/libjava/javax/swing/AbstractAction.java
deleted file mode 100644
index a58c8b42099..00000000000
--- a/libjava/javax/swing/AbstractAction.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/* AbstractAction.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.beans.PropertyChangeListener;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.HashMap;
-
-import javax.swing.event.SwingPropertyChangeSupport;
-
-/**
- * AbstractAction
- * @author Andrew Selkirk
- * @version 1.0
- */
-public abstract class AbstractAction
- implements Action, Cloneable, Serializable
-{
- private static final long serialVersionUID = -6803159439231523484L;
-
- /**
- * enabled
- */
- protected boolean enabled = true;
-
- /**
- * changeSupport
- */
- protected SwingPropertyChangeSupport changeSupport =
- new SwingPropertyChangeSupport(this);
-
- /**
- * store
- */
- private transient HashMap store = new HashMap();
-
- /**
- * Constructor AbstractAction
- */
- public AbstractAction()
- {
- this(""); // TODO: default name
- }
-
- /**
- * Constructor AbstractAction
- *
- * @param name TODO
- */
- public AbstractAction(String name)
- {
- this(name, null); // TODO: default icon??
- }
-
- /**
- * Constructor AbstractAction
- *
- * @param name TODO
- * @param icon TODO
- */
- public AbstractAction(String name, Icon icon)
- {
- putValue(NAME, name);
- putValue(SMALL_ICON, icon);
- }
-
- /**
- * readObject
- *
- * @param stream the stream to read from
- *
- * @exception ClassNotFoundException TODO
- * @exception IOException if an error occurs
- */
- private void readObject(ObjectInputStream stream)
- throws ClassNotFoundException, IOException
- {
- // TODO
- }
-
- /**
- * writeObject
- *
- * @param stream the stream to write to
- *
- * @exception IOException if an error occurs
- */
- private void writeObject(ObjectOutputStream stream) throws IOException
- {
- // TODO
- }
-
- /**
- * clone
- *
- * @return Object
- *
- * @exception CloneNotSupportedException TODO
- */
- protected Object clone() throws CloneNotSupportedException
- {
- AbstractAction copy = (AbstractAction) super.clone();
- copy.store = (HashMap) store.clone();
- return copy;
- }
-
- /**
- * Returns a value for a given key from the built-in store.
- *
- * @param key the key to get the value for
- *
- * @return Object
- */
- public Object getValue(String key)
- {
- return store.get(key);
- }
-
- /**
- * Puts a key/value pair into the built-in store.
- *
- * @param key the key
- * @param value the value
- */
- public void putValue(String key, Object value)
- {
- Object old = getValue(key);
- if (old != value)
- {
- store.put(key, value);
- firePropertyChange(key, old, value);
- }
- }
-
- /**
- * isEnabled
- *
- * @return boolean
- */
- public boolean isEnabled()
- {
- return enabled;
- }
-
- /**
- * setEnabled
- *
- * @param enabled TODO
- */
- public void setEnabled(boolean enabled)
- {
- if (enabled != this.enabled)
- {
- this.enabled = enabled;
- firePropertyChange("enabled", !this.enabled, this.enabled);
- }
- }
-
- /**
- * getKeys
- * @returns Object[]
- */
- public Object[] getKeys()
- {
- return store.keySet().toArray();
- }
-
- /**
- * This method fires a PropertyChangeEvent given the propertyName
- * and the old and new values.
- *
- * @param propertyName The property that changed.
- * @param oldValue The old value of the property.
- * @param newValue The new value of the property.
- */
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue)
- {
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
- /**
- * This convenience method fires a PropertyChangeEvent given
- * the propertyName and the old and new values.
- *
- * @param propertyName The property that changed.
- * @param oldValue The old value of the property.
- * @param newValue The new value of the property.
- */
- private void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
- {
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
- /**
- * addPropertyChangeListener
- *
- * @param listener the listener to add
- */
- public void addPropertyChangeListener(PropertyChangeListener listener)
- {
- changeSupport.addPropertyChangeListener(listener);
- }
-
- /**
- * removePropertyChangeListener
- *
- * @param listener the listener to remove
- */
- public void removePropertyChangeListener(PropertyChangeListener listener)
- {
- changeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * Returns all registered listeners.
- *
- * @return array of listeners.
- *
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners()
- {
- return changeSupport.getPropertyChangeListeners();
- }
-}
diff --git a/libjava/javax/swing/AbstractButton.java b/libjava/javax/swing/AbstractButton.java
deleted file mode 100644
index 4a5e05a90de..00000000000
--- a/libjava/javax/swing/AbstractButton.java
+++ /dev/null
@@ -1,1945 +0,0 @@
-/* AbstractButton.java -- Provides basic button functionality.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Graphics;
-import java.awt.Image;
-import java.awt.Insets;
-import java.awt.ItemSelectable;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.accessibility.AccessibleAction;
-import javax.accessibility.AccessibleIcon;
-import javax.accessibility.AccessibleRelationSet;
-import javax.accessibility.AccessibleStateSet;
-import javax.accessibility.AccessibleText;
-import javax.accessibility.AccessibleValue;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ButtonUI;
-import javax.swing.text.AttributeSet;
-
-
-/**
- * <p>The purpose of this class is to serve as a facade over a number of
- * classes which collectively represent the semantics of a button: the
- * button's model, its listeners, its action, and its look and feel. Some
- * parts of a button's state are stored explicitly in this class, other
- * parts are delegates to the model. Some methods related to buttons are
- * implemented in this class, other methods pass through to the current
- * model or look and feel.</p>
- *
- * <p>Furthermore this class is supposed to serve as a base class for
- * several kinds of buttons with similar but non-identical semantics:
- * toggle buttons (radio buttons and checkboxes), simple "push" buttons,
- * menu items.</p>
- *
- * <p>Buttons have many properties, some of which are stored in this class
- * while others are delegated to the button's model. The following properties
- * are available:</p>
- *
- * <table>
- * <tr><th>Property </th><th>Stored in</th><th>Bound?</th></tr>
- *
- * <tr><td>action </td><td>button</td> <td>no</td></tr>
- * <tr><td>actionCommand </td><td>model</td> <td>no</td></tr>
- * <tr><td>borderPainted </td><td>button</td> <td>yes</td></tr>
- * <tr><td>contentAreaFilled </td><td>button</td> <td>yes</td></tr>
- * <tr><td>disabledIcon </td><td>button</td> <td>yes</td></tr>
- * <tr><td>disabledSelectedIcon </td><td>button</td> <td>yes</td></tr>
- * <tr><td>displayedMnemonicIndex </td><td>button</td> <td>no</td></tr>
- * <tr><td>enabled </td><td>model</td> <td>no</td></tr>
- * <tr><td>focusPainted </td><td>button</td> <td>yes</td></tr>
- * <tr><td>horizontalAlignment </td><td>button</td> <td>yes</td></tr>
- * <tr><td>horizontalTextPosition </td><td>button</td> <td>yes</td></tr>
- * <tr><td>icon </td><td>button</td> <td>yes</td></tr>
- * <tr><td>iconTextGap </td><td>button</td> <td>no</td></tr>
- * <tr><td>label (same as text) </td><td>model</td> <td>yes</td></tr>
- * <tr><td>margin </td><td>button</td> <td>yes</td></tr>
- * <tr><td>multiClickThreshold </td><td>button</td> <td>no</td></tr>
- * <tr><td>pressedIcon </td><td>button</td> <td>yes</td></tr>
- * <tr><td>rolloverEnabled </td><td>button</td> <td>yes</td></tr>
- * <tr><td>rolloverIcon </td><td>button</td> <td>yes</td></tr>
- * <tr><td>rolloverSelectedIcon </td><td>button</td> <td>yes</td></tr>
- * <tr><td>selected </td><td>model</td> <td>no</td></tr>
- * <tr><td>selectedIcon </td><td>button</td> <td>yes</td></tr>
- * <tr><td>selectedObjects </td><td>button</td> <td>no</td></tr>
- * <tr><td>text </td><td>model</td> <td>yes</td></tr>
- * <tr><td>UI </td><td>button</td> <td>yes</td></tr>
- * <tr><td>verticalAlignment </td><td>button</td> <td>yes</td></tr>
- * <tr><td>verticalTextPosition </td><td>button</td> <td>yes</td></tr>
- *
- * </table>
- *
- * <p>The various behavioral aspects of these properties follows:</p>
- *
- * <ul>
- *
- * <li>When non-bound properties stored in the button change, the button
- * fires ChangeEvents to its ChangeListeners.</li>
- *
- * <li>When bound properties stored in the button change, the button fires
- * PropertyChangeEvents to its PropertyChangeListeners</li>
- *
- * <li>If any of the model's properties change, it fires a ChangeEvent to
- * its ChangeListeners, which include the button.</li>
- *
- * <li>If the button receives a ChangeEvent from its model, it will
- * propagate the ChangeEvent to its ChangeListeners, with the ChangeEvent's
- * "source" property set to refer to the button, rather than the model. The
- * the button will request a repaint, to paint its updated state.</li>
- *
- * <li>If the model's "selected" property changes, the model will fire an
- * ItemEvent to its ItemListeners, which include the button, in addition to
- * the ChangeEvent which models the property change. The button propagates
- * ItemEvents directly to its ItemListeners.</li>
- *
- * <li>If the model's armed and pressed properties are simultaneously
- * <code>true</code>, the model will fire an ActionEvent to its
- * ActionListeners, which include the button. The button will propagate
- * this ActionEvent to its ActionListeners, with the ActionEvent's "source"
- * property set to refer to the button, rather than the model.</li>
- *
- * </ul>
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- * @author Graydon Hoare (graydon@redhat.com)
- */
-
-public abstract class AbstractButton extends JComponent
- implements ItemSelectable, SwingConstants
-{
- private static final long serialVersionUID = -937921345538462020L;
-
- /** The icon displayed by default. */
- Icon default_icon;
-
- /** The icon displayed when the button is pressed. */
- Icon pressed_icon;
-
- /** The icon displayed when the button is disabled. */
- Icon disabeldIcon;
-
- /** The icon displayed when the button is selected. */
- Icon selectedIcon;
-
- /** The icon displayed when the button is selected but disabled. */
- Icon disabledSelectedIcon;
-
- /** The icon displayed when the button is rolled over. */
- Icon rolloverIcon;
-
- /** The icon displayed when the button is selected and rolled over. */
- Icon rolloverSelectedIcon;
-
- /** The icon currently displayed. */
- Icon current_icon;
-
- /** The text displayed in the button. */
- String text;
-
- /** The gap between icon and text, if both icon and text are non-<code>null</code>. */
- int iconTextGap;
-
- /** The vertical alignment of the button's text and icon. */
- int verticalAlignment;
-
- /** The horizontal alignment of the button's text and icon. */
- int horizontalAlignment;
-
- /** The horizontal position of the button's text relative to its icon. */
- int horizontalTextPosition;
-
- /** The vertical position of the button's text relative to its icon. */
- int verticalTextPosition;
-
- /** Whether or not the button paints its border. */
- boolean borderPainted;
-
- /** Whether or not the button paints its focus state. */
- boolean focusPainted;
-
- /** Whether or not the button fills its content area. */
- boolean contentAreaFilled;
-
- /** Whether rollover is enabled. */
- boolean rollOverEnabled;
-
- /** The action taken when the button is clicked. */
- Action action;
-
- /** The button's current state. */
- protected ButtonModel model;
-
- /** The margin between the button's border and its label. */
- Insets margin;
-
- /** A hint to the look and feel class, suggesting which character in the
- * button's label should be underlined when drawing the label. */
- int mnemonicIndex;
-
- /** Listener the button uses to receive ActionEvents from its model. */
- protected ActionListener actionListener;
-
- /** Listener the button uses to receive ItemEvents from its model. */
- protected ItemListener itemListener;
-
- /** Listener the button uses to receive ChangeEvents from its model. */
- protected ChangeListener changeListener;
-
- /** The time in miliseconds in which clicks get coalesced into a single
- * <code>ActionEvent</code>. */
- long multiClickThreshhold;
-
- /** Listener the button uses to receive PropertyChangeEvents from its
- Action. */
- PropertyChangeListener actionPropertyChangeListener;
-
- /** ChangeEvent that is fired to button's ChangeEventListeners */
- protected ChangeEvent changeEvent = new ChangeEvent(this);
-
- /** Fired in a PropertyChangeEvent when the "borderPainted" property changes. */
- public static final String BORDER_PAINTED_CHANGED_PROPERTY = "borderPainted";
-
- /** Fired in a PropertyChangeEvent when the "contentAreaFilled" property changes. */
- public static final String CONTENT_AREA_FILLED_CHANGED_PROPERTY = "contentAreaFilled";
-
- /** Fired in a PropertyChangeEvent when the "disabledIcon" property changes. */
- public static final String DISABLED_ICON_CHANGED_PROPERTY = "disabledIcon";
-
- /** Fired in a PropertyChangeEvent when the "disabledSelectedIcon" property changes. */
- public static final String DISABLED_SELECTED_ICON_CHANGED_PROPERTY = "disabledSelectedIcon";
-
- /** Fired in a PropertyChangeEvent when the "focusPainted" property changes. */
- public static final String FOCUS_PAINTED_CHANGED_PROPERTY = "focusPainted";
-
- /** Fired in a PropertyChangeEvent when the "horizontalAlignment" property changes. */
- public static final String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY = "horizontalAlignment";
-
- /** Fired in a PropertyChangeEvent when the "horizontalTextPosition" property changes. */
- public static final String HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY = "horizontalTextPosition";
-
- /** Fired in a PropertyChangeEvent when the "icon" property changes. */
- public static final String ICON_CHANGED_PROPERTY = "icon";
-
- /** Fired in a PropertyChangeEvent when the "margin" property changes. */
- public static final String MARGIN_CHANGED_PROPERTY = "margin";
-
- /** Fired in a PropertyChangeEvent when the "mnemonic" property changes. */
- public static final String MNEMONIC_CHANGED_PROPERTY = "mnemonic";
-
- /** Fired in a PropertyChangeEvent when the "model" property changes. */
- public static final String MODEL_CHANGED_PROPERTY = "model";
-
- /** Fired in a PropertyChangeEvent when the "pressedIcon" property changes. */
- public static final String PRESSED_ICON_CHANGED_PROPERTY = "pressedIcon";
-
- /** Fired in a PropertyChangeEvent when the "rolloverEnabled" property changes. */
- public static final String ROLLOVER_ENABLED_CHANGED_PROPERTY = "rolloverEnabled";
-
- /** Fired in a PropertyChangeEvent when the "rolloverIcon" property changes. */
- public static final String ROLLOVER_ICON_CHANGED_PROPERTY = "rolloverIcon";
-
- /** Fired in a PropertyChangeEvent when the "rolloverSelectedIcon" property changes. */
- public static final String ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY = "rolloverSelectedIcon";
-
- /** Fired in a PropertyChangeEvent when the "selectedIcon" property changes. */
- public static final String SELECTED_ICON_CHANGED_PROPERTY = "selectedIcon";
-
- /** Fired in a PropertyChangeEvent when the "text" property changes. */
- public static final String TEXT_CHANGED_PROPERTY = "text";
-
- /** Fired in a PropertyChangeEvent when the "verticalAlignment" property changes. */
- public static final String VERTICAL_ALIGNMENT_CHANGED_PROPERTY = "verticalAlignment";
-
- /** Fired in a PropertyChangeEvent when the "verticalTextPosition" property changes. */
- public static final String VERTICAL_TEXT_POSITION_CHANGED_PROPERTY = "verticalTextPosition";
-
- /**
- * A Java Accessibility extension of the AbstractButton.
- */
- protected abstract class AccessibleAbstractButton
- extends AccessibleJComponent implements AccessibleAction, AccessibleValue,
- AccessibleText
- {
- private static final long serialVersionUID = -5673062525319836790L;
-
- protected AccessibleAbstractButton()
- {
- }
-
- public AccessibleStateSet getAccessibleStateSet()
- {
- return null; // TODO
- }
-
- public String getAccessibleName()
- {
- return null; // TODO
- }
-
- public AccessibleIcon[] getAccessibleIcon()
- {
- return null; // TODO
- }
-
- public AccessibleRelationSet getAccessibleRelationSet()
- {
- return null; // TODO
- }
-
- public AccessibleAction getAccessibleAction()
- {
- return null; // TODO
- }
-
- public AccessibleValue getAccessibleValue()
- {
- return null; // TODO
- }
-
- public int getAccessibleActionCount()
- {
- return 0; // TODO
- }
-
- public String getAccessibleActionDescription(int value0)
- {
- return null; // TODO
- }
-
- public boolean doAccessibleAction(int value0)
- {
- return false; // TODO
- }
-
- public Number getCurrentAccessibleValue()
- {
- return null; // TODO
- }
-
- public boolean setCurrentAccessibleValue(Number value0)
- {
- return false; // TODO
- }
-
- public Number getMinimumAccessibleValue()
- {
- return null; // TODO
- }
-
- public Number getMaximumAccessibleValue()
- {
- return null; // TODO
- }
-
- public AccessibleText getAccessibleText()
- {
- return null; // TODO
- }
-
- public int getIndexAtPoint(Point value0)
- {
- return 0; // TODO
- }
-
- public Rectangle getCharacterBounds(int value0)
- {
- return null; // TODO
- }
-
- public int getCharCount()
- {
- return 0; // TODO
- }
-
- public int getCaretPosition()
- {
- return 0; // TODO
- }
-
- public String getAtIndex(int value0, int value1)
- {
- return null; // TODO
- }
-
- public String getAfterIndex(int value0, int value1)
- {
- return null; // TODO
- }
-
- public String getBeforeIndex(int value0, int value1)
- {
- return null; // TODO
- }
-
- public AttributeSet getCharacterAttribute(int value0)
- {
- return null; // TODO
- }
-
- public int getSelectionStart()
- {
- return 0; // TODO
- }
-
- public int getSelectionEnd()
- {
- return 0; // TODO
- }
-
- public String getSelectedText()
- {
- return null; // TODO
- }
-
- private Rectangle getTextRectangle()
- {
- return null; // TODO
- }
- }
-
- /**
- * Creates a new AbstractButton object.
- */
- public AbstractButton()
- {
- this("",null);
- }
-
- /**
- * Creates a new AbstractButton object.
- *
- * @param txt Value to use for the button's "text" property
- * @param icon Value to use for the button's "defaultIcon" property
- */
- AbstractButton(String txt, Icon icon)
- {
- init (txt, icon);
- updateUI();
- }
-
- /**
- * Get the model the button is currently using.
- *
- * @return The current model
- */
- public ButtonModel getModel()
- {
- return model;
- }
-
- /**
- * Set the model the button is currently using. This un-registers all
- * listeners associated with the current model, and re-registers them
- * with the new model.
- *
- * @param newModel The new model
- */
- public void setModel(ButtonModel newModel)
- {
- if (newModel == model)
- return;
-
- if (model != null)
- {
- model.removeActionListener(actionListener);
- model.removeChangeListener(changeListener);
- model.removeItemListener(itemListener);
- }
- ButtonModel old = model;
- model = newModel;
- if (model != null)
- {
- model.addActionListener(actionListener);
- model.addChangeListener(changeListener);
- model.addItemListener(itemListener);
- }
- firePropertyChange(MODEL_CHANGED_PROPERTY, old, model);
- revalidate();
- repaint();
- }
-
- protected void init(String text, Icon icon)
- {
- this.text = text;
- default_icon = icon;
- model = new DefaultButtonModel();
- actionListener = createActionListener();
- changeListener = createChangeListener();
- itemListener = createItemListener();
-
- model.addActionListener(actionListener);
- model.addChangeListener(changeListener);
- model.addItemListener(itemListener);
-
- horizontalAlignment = CENTER;
- horizontalTextPosition = TRAILING;
- verticalAlignment = CENTER;
- verticalTextPosition = CENTER;
- borderPainted = true;
- contentAreaFilled = true;
-
- focusPainted = true;
- setFocusable(true);
-
- setAlignmentX(LEFT_ALIGNMENT);
- setAlignmentY(CENTER_ALIGNMENT);
-
- setDisplayedMnemonicIndex(-1);
- }
-
- /**
- * Get the action command string for this button's model.
- *
- * @return The current action command string from the button's model
- */
- public String getActionCommand()
- {
- return getModel().getActionCommand();
- }
-
- /**
- * Set the action command string for this button's model.
- *
- * @param aCommand The new action command string to set in the button's
- * model.
- */
- public void setActionCommand(String aCommand)
- {
- getModel().setActionCommand(aCommand);
- }
-
- /**
- * Adds an ActionListener to the button's listener list. When the
- * button's model is clicked it fires an ActionEvent, and these
- * listeners will be called.
- *
- * @param l The new listener to add
- */
- public void addActionListener(ActionListener l)
- {
- listenerList.add(ActionListener.class, l);
- }
-
- /**
- * Removes an ActionListener from the button's listener list.
- *
- * @param l The listener to remove
- */
- public void removeActionListener(ActionListener l)
- {
- listenerList.remove(ActionListener.class, l);
- }
-
- /**
- * Returns all added <code>ActionListener</code> objects.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public ActionListener[] getActionListeners()
- {
- return (ActionListener[]) listenerList.getListeners(ActionListener.class);
- }
-
- /**
- * Adds an ItemListener to the button's listener list. When the button's
- * model changes state (between any of ARMED, ENABLED, PRESSED, ROLLOVER
- * or SELECTED) it fires an ItemEvent, and these listeners will be
- * called.
- *
- * @param l The new listener to add
- */
- public void addItemListener(ItemListener l)
- {
- listenerList.add(ItemListener.class, l);
- }
-
- /**
- * Removes an ItemListener from the button's listener list.
- *
- * @param l The listener to remove
- */
- public void removeItemListener(ItemListener l)
- {
- listenerList.remove(ItemListener.class, l);
- }
-
- /**
- * Returns all added <code>ItemListener</code> objects.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public ItemListener[] getItemListeners()
- {
- return (ItemListener[]) listenerList.getListeners(ItemListener.class);
- }
-
- /**
- * Adds a ChangeListener to the button's listener list. When the button's
- * model changes any of its (non-bound) properties, these listeners will be
- * called.
- *
- * @param l The new listener to add
- */
- public void addChangeListener(ChangeListener l)
- {
- listenerList.add(ChangeListener.class, l);
- }
-
- /**
- * Removes a ChangeListener from the button's listener list.
- *
- * @param l The listener to remove
- */
- public void removeChangeListener(ChangeListener l)
- {
- listenerList.remove(ChangeListener.class, l);
- }
-
- /**
- * Returns all added <code>ChangeListener</code> objects.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
- }
-
- /**
- * Calls {@link ItemListener.itemStateChanged} on each ItemListener in
- * the button's listener list.
- *
- * @param e The event signifying that the button's model changed state
- */
- protected void fireItemStateChanged(ItemEvent e)
- {
- e.setSource(this);
- ItemListener[] listeners = getItemListeners();
-
- for (int i = 0; i < listeners.length; i++)
- listeners[i].itemStateChanged(e);
- }
-
- /**
- * Calls {@link ActionListener.actionPerformed} on each {@link
- * ActionListener} in the button's listener list.
- *
- * @param e The event signifying that the button's model was clicked
- */
- protected void fireActionPerformed(ActionEvent e)
- {
- e.setSource(this);
- ActionListener[] listeners = getActionListeners();
-
- for (int i = 0; i < listeners.length; i++)
- listeners[i].actionPerformed(e);
- }
-
- /**
- * Calls {@link ChangeEvent.stateChanged} on each {@link ChangeListener}
- * in the button's listener list.
- */
- protected void fireStateChanged()
- {
- ChangeListener[] listeners = getChangeListeners();
-
- for (int i = 0; i < listeners.length; i++)
- listeners[i].stateChanged(changeEvent);
- }
-
- /**
- * Get the current keyboard mnemonic value. This value corresponds to a
- * single key code (one of the {@link java.awt.event.KeyEvent} VK_*
- * codes) and is used to activate the button when pressed in conjunction
- * with the "mouseless modifier" of the button's look and feel class, and
- * when focus is in one of the button's ancestors.
- *
- * @return The button's current keyboard mnemonic
- */
- public int getMnemonic()
- {
- return getModel().getMnemonic();
- }
-
- /**
- * Set the current keyboard mnemonic value. This value corresponds to a
- * single key code (one of the {@link java.awt.event.KeyEvent} VK_*
- * codes) and is used to activate the button when pressed in conjunction
- * with the "mouseless modifier" of the button's look and feel class, and
- * when focus is in one of the button's ancestors.
- *
- * @param mne A new mnemonic to use for the button
- */
- public void setMnemonic(char mne)
- {
- setMnemonic((int) mne);
- }
-
- /**
- * Set the current keyboard mnemonic value. This value corresponds to a
- * single key code (one of the {@link java.awt.event.KeyEvent} VK_*
- * codes) and is used to activate the button when pressed in conjunction
- * with the "mouseless modifier" of the button's look and feel class, and
- * when focus is in one of the button's ancestors.
- *
- * @param mne A new mnemonic to use for the button
- */
- public void setMnemonic(int mne)
- {
- int old = getModel().getMnemonic();
-
- if (old != mne)
- {
- getModel().setMnemonic(mne);
-
- if (text != null && ! text.equals(""))
- {
- // Since lower case char = upper case char for
- // mnemonic, we will convert both text and mnemonic
- // to upper case before checking if mnemonic character occurs
- // in the menu item text.
- int upperCaseMne = Character.toUpperCase((char) mne);
- String upperCaseText = text.toUpperCase();
- setDisplayedMnemonicIndex(upperCaseText.indexOf(upperCaseMne));
- }
-
- firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne);
- revalidate();
- repaint();
- }
- }
-
- /**
- * Sets the button's mnemonic index. The mnemonic index is a hint to the
- * look and feel class, suggesting which character in the button's label
- * should be underlined when drawing the label. If the mnemonic index is
- * -1, no mnemonic will be displayed.
- *
- * If no mnemonic index is set, the button will choose a mnemonic index
- * by default, which will be the first occurrence of the mnemonic
- * character in the button's text.
- *
- * @param index An offset into the "text" property of the button
- * @throws IllegalArgumentException If <code>index</code> is not within the
- * range of legal offsets for the "text" property of the button.
- * @since 1.4
- */
-
- public void setDisplayedMnemonicIndex(int index)
- {
- if (index < -1 || (text != null && index >= text.length()))
- throw new IllegalArgumentException();
-
- mnemonicIndex = index;
- }
-
- /**
- * Get the button's mnemonic index, which is an offset into the button's
- * "text" property. The character specified by this offset should be
- * underlined when the look and feel class draws this button.
- *
- * @return An index into the button's "text" property
- */
- public int getDisplayedMnemonicIndex()
- {
- return mnemonicIndex;
- }
-
-
- /**
- * Set the "rolloverEnabled" property. When rollover is enabled, and the
- * look and feel supports it, the button will change its icon to
- * rolloverIcon, when the mouse passes over it.
- *
- * @param r Whether or not to enable rollover icon changes
- */
- public void setRolloverEnabled(boolean r)
- {
- if (rollOverEnabled != r)
- {
- rollOverEnabled = r;
- firePropertyChange(ROLLOVER_ENABLED_CHANGED_PROPERTY, !r, r);
- revalidate();
- repaint();
- }
- }
-
- /**
- * Returns whether or not rollover icon changes are enabled on the
- * button.
- *
- * @return The state of the "rolloverEnabled" property
- */
- public boolean isRolloverEnabled()
- {
- return rollOverEnabled;
- }
-
- /**
- * Set the value of the button's "selected" property. Selection is only
- * meaningful for toggle-type buttons (check boxes, radio buttons).
- *
- * @param s New value for the property
- */
- public void setSelected(boolean s)
- {
- getModel().setSelected(s);
- }
-
- /**
- * Get the value of the button's "selected" property. Selection is only
- * meaningful for toggle-type buttons (check boxes, radio buttons).
- *
- * @return The value of the property
- */
- public boolean isSelected()
- {
- return getModel().isSelected();
- }
-
- /**
- * Enables or disables the button. A button will neither be selectable
- * nor preform any actions unless it is enabled.
- *
- * @param b Whether or not to enable the button
- */
- public void setEnabled(boolean b)
- {
- super.setEnabled(b);
- getModel().setEnabled(b);
- }
-
- /**
- * Set the horizontal alignment of the button's text and icon. The
- * alignment is a numeric constant from {@link SwingConstants}. It must
- * be one of: <code>RIGHT</code>, <code>LEFT</code>, <code>CENTER</code>,
- * <code>LEADING</code> or <code>TRAILING</code>. The default is
- * <code>RIGHT</code>.
- *
- * @return The current horizontal alignment
- */
- public int getHorizontalAlignment()
- {
- return horizontalAlignment;
- }
-
- /**
- * Set the horizontal alignment of the button's text and icon. The
- * alignment is a numeric constant from {@link SwingConstants}. It must
- * be one of: <code>RIGHT</code>, <code>LEFT</code>, <code>CENTER</code>,
- * <code>LEADING</code> or <code>TRAILING</code>. The default is
- * <code>RIGHT</code>.
- *
- * @param a The new horizontal alignment
- * @throws IllegalArgumentException If alignment is not one of the legal
- * constants.
- */
- public void setHorizontalAlignment(int a)
- {
- if (horizontalAlignment == a)
- return;
-
- int old = horizontalAlignment;
- horizontalAlignment = a;
- firePropertyChange(HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, old, a);
- revalidate();
- repaint();
- }
-
- /**
- * Get the horizontal position of the button's text relative to its
- * icon. The position is a numeric constant from {@link
- * SwingConstants}. It must be one of: <code>RIGHT</code>,
- * <code>LEFT</code>, <code>CENTER</code>, <code>LEADING</code> or
- * <code>TRAILING</code>. The default is <code>TRAILING</code>.
- *
- * @return The current horizontal text position
- */
- public int getHorizontalTextPosition()
- {
- return horizontalTextPosition;
- }
-
- /**
- * Set the horizontal position of the button's text relative to its
- * icon. The position is a numeric constant from {@link
- * SwingConstants}. It must be one of: <code>RIGHT</code>,
- * <code>LEFT</code>, <code>CENTER</code>, <code>LEADING</code> or
- * <code>TRAILING</code>. The default is <code>TRAILING</code>.
- *
- * @param t The new horizontal text position
- * @throws IllegalArgumentException If position is not one of the legal
- * constants.
- */
- public void setHorizontalTextPosition(int t)
- {
- if (horizontalTextPosition == t)
- return;
-
- int old = horizontalTextPosition;
- horizontalTextPosition = t;
- firePropertyChange(HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, old, t);
- revalidate();
- repaint();
- }
-
- /**
- * Get the vertical alignment of the button's text and icon. The
- * alignment is a numeric constant from {@link SwingConstants}. It must
- * be one of: <code>CENTER</code>, <code>TOP</code>, or
- * <code>BOTTOM</code>. The default is <code>CENTER</code>.
- *
- * @return The current vertical alignment
- */
- public int getVerticalAlignment()
- {
- return verticalAlignment;
- }
-
- /**
- * Set the vertical alignment of the button's text and icon. The
- * alignment is a numeric constant from {@link SwingConstants}. It must
- * be one of: <code>CENTER</code>, <code>TOP</code>, or
- * <code>BOTTOM</code>. The default is <code>CENTER</code>.
- *
- * @param a The new vertical alignment
- * @throws IllegalArgumentException If alignment is not one of the legal
- * constants.
- */
- public void setVerticalAlignment(int a)
- {
- if (verticalAlignment == a)
- return;
-
- int old = verticalAlignment;
- verticalAlignment = a;
- firePropertyChange(VERTICAL_ALIGNMENT_CHANGED_PROPERTY, old, a);
- revalidate();
- repaint();
- }
-
- /**
- * Get the vertical position of the button's text relative to its
- * icon. The alignment is a numeric constant from {@link
- * SwingConstants}. It must be one of: <code>CENTER</code>,
- * <code>TOP</code>, or <code>BOTTOM</code>. The default is
- * <code>CENTER</code>.
- *
- * @return The current vertical position
- */
- public int getVerticalTextPosition()
- {
- return verticalTextPosition;
- }
-
- /**
- * Set the vertical position of the button's text relative to its
- * icon. The alignment is a numeric constant from {@link
- * SwingConstants}. It must be one of: <code>CENTER</code>,
- * <code>TOP</code>, or <code>BOTTOM</code>. The default is
- * <code>CENTER</code>.
- *
- * @param t The new vertical position
- * @throws IllegalArgumentException If position is not one of the legal
- * constants.
- */
- public void setVerticalTextPosition(int t)
- {
- if (verticalTextPosition == t)
- return;
-
- int old = verticalTextPosition;
- verticalTextPosition = t;
- firePropertyChange(VERTICAL_TEXT_POSITION_CHANGED_PROPERTY, old, t);
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the "borderPainted" property. If set to
- * <code>false</code>, the button's look and feel class should not paint
- * a border for the button. The default is <code>true</code>.
- *
- * @return The current value of the property.
- */
- public boolean isBorderPainted()
- {
- return borderPainted;
- }
-
- /**
- * Set the value of the "borderPainted" property. If set to
- * <code>false</code>, the button's look and feel class should not paint
- * a border for the button. The default is <code>true</code>.
- *
- * @param b The new value of the property.
- */
- public void setBorderPainted(boolean b)
- {
- if (borderPainted == b)
- return;
-
- boolean old = borderPainted;
- borderPainted = b;
- firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, old, b);
- revalidate();
- repaint();
- }
-
- /**
- * Get the value of the "action" property.
- *
- * @return The current value of the "action" property
- */
- public Action getAction()
- {
- return action;
- }
-
- /**
- * <p>Set the button's "action" property, subscribing the new action to the
- * button, as an ActionListener, if it is not already subscribed. The old
- * Action, if it exists, is unsubscribed, and the button is unsubscribed
- * from the old Action if it was previously subscribed as a
- * PropertyChangeListener.</p>
- *
- * <p>This method also configures several of the button's properties from
- * the Action, by calling {@link configurePropertiesFromAction}, and
- * subscribes the button to the Action as a PropertyChangeListener.
- * Subsequent changes to the Action will thus reconfigure the button
- * automatically.</p>
- *
- * @param a The new value of the "action" property
- */
- public void setAction(Action a)
- {
- if (action != null)
- {
- action.removePropertyChangeListener(actionPropertyChangeListener);
- removeActionListener(action);
- if (actionPropertyChangeListener != null)
- {
- action.removePropertyChangeListener(actionPropertyChangeListener);
- actionPropertyChangeListener = null;
- }
- }
-
- Action old = action;
- action = a;
- configurePropertiesFromAction(action);
- if (action != null)
- {
- actionPropertyChangeListener = createActionPropertyChangeListener(a);
- action.addPropertyChangeListener(actionPropertyChangeListener);
- addActionListener(action);
- }
- }
-
- /**
- * Return the button's default "icon" property.
- *
- * @return The current default icon
- */
- public Icon getIcon()
- {
- return default_icon;
- }
-
- /**
- * Set the button's default "icon" property. This icon is used as a basis
- * for the pressed and disabled icons, if none are explicitly set.
- *
- * @param i The new default icon
- */
- public void setIcon(Icon i)
- {
- if (default_icon == i)
- return;
-
- Icon old = default_icon;
- default_icon = i;
- firePropertyChange(ICON_CHANGED_PROPERTY, old, i);
- revalidate();
- repaint();
- }
-
- /**
- * Return the button's "text" property. This property is synonymous with
- * the "label" property.
- *
- * @return The current "text" property
- */
- public String getText()
- {
- return text;
- }
-
- /**
- * Set the button's "label" property. This property is synonymous with the
- * "text" property.
- *
- * @param label The new "label" property
- *
- * @deprecated use <code>setText(text)</code>
- */
- public void setLabel(String label)
- {
- setText(label);
- }
-
- /**
- * Return the button's "label" property. This property is synonymous with
- * the "text" property.
- *
- * @return The current "label" property
- *
- * @deprecated use <code>getText()</code>
- */
- public String getLabel()
- {
- return getText();
- }
-
- /**
- * Set the button's "text" property. This property is synonymous with the
- * "label" property.
- *
- * @param t The new "text" property
- */
- public void setText(String t)
- {
- if (text == t)
- return;
-
- String old = text;
- text = t;
- firePropertyChange(TEXT_CHANGED_PROPERTY, old, t);
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #iconTextGap} property.
- *
- * @param i The new value of the property
- */
- public void setIconTextGap(int i)
- {
- if (iconTextGap == i)
- return;
-
- int old = iconTextGap;
- iconTextGap = i;
- fireStateChanged();
- revalidate();
- repaint();
- }
-
- /**
- * Get the value of the {@link #iconTextGap} property.
- *
- * @return The current value of the property
- */
- public int getIconTextGap()
- {
- return iconTextGap;
- }
-
- /**
- * Return the button's "margin" property, which is an {@link Insets} object
- * describing the distance between the button's border and its text and
- * icon.
- *
- * @return The current "margin" property
- */
- public Insets getMargin()
- {
- return margin;
- }
-
- /**
- * Set the button's "margin" property, which is an {@link Insets} object
- * describing the distance between the button's border and its text and
- * icon.
- *
- * @param m The new "margin" property
- */
- public void setMargin(Insets m)
- {
- if (margin == m)
- return;
-
- Insets old = margin;
- margin = m;
- firePropertyChange(MARGIN_CHANGED_PROPERTY, old, m);
- revalidate();
- repaint();
- }
-
- /**
- * Return the button's "pressedIcon" property. The look and feel class
- * should paint this icon when the "pressed" property of the button's
- * {@link ButtonModel} is <code>true</code>. This property may be
- * <code>null</code>, in which case the default icon is used.
- *
- * @return The current "pressedIcon" property
- */
- public Icon getPressedIcon()
- {
- return pressed_icon;
- }
-
- /**
- * Set the button's "pressedIcon" property. The look and feel class
- * should paint this icon when the "pressed" property of the button's
- * {@link ButtonModel} is <code>true</code>. This property may be
- * <code>null</code>, in which case the default icon is used.
- *
- * @param pressedIcon The new "pressedIcon" property
- */
- public void setPressedIcon(Icon pressedIcon)
- {
- if (pressed_icon == pressedIcon)
- return;
-
- Icon old = pressed_icon;
- pressed_icon = pressedIcon;
- firePropertyChange(PRESSED_ICON_CHANGED_PROPERTY, old, pressed_icon);
- revalidate();
- repaint();
- }
-
- /**
- * Return the button's "disabledIcon" property. The look and feel class
- * should paint this icon when the "enabled" property of the button's
- * {@link ButtonModel} is <code>false</code>. This property may be
- * <code>null</code>, in which case an icon is constructed, based on the
- * default icon.
- *
- * @return The current "disabledIcon" property
- */
- public Icon getDisabledIcon()
- {
- if (disabeldIcon == null
- && default_icon instanceof ImageIcon)
- disabeldIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon) default_icon).getImage()));
-
- return disabeldIcon;
- }
-
- /**
- * Set the button's "disabledIcon" property. The look and feel class should
- * paint this icon when the "enabled" property of the button's {@link
- * ButtonModel} is <code>false</code>. This property may be
- * <code>null</code>, in which case an icon is constructed, based on the
- * default icon.
- *
- * @param disabledIcon The new "disabledIcon" property
- */
- public void setDisabledIcon(Icon d)
- {
- disabeldIcon = d;
- revalidate();
- repaint();
- }
-
- /**
- * Return the button's "paintFocus" property. This property controls
- * whether or not the look and feel class will paint a special indicator
- * of focus state for the button. If it is false, the button still paints
- * when focused, but no special decoration is painted to indicate the
- * presence of focus.
- *
- * @return The current "paintFocus" property
- */
- public boolean isFocusPainted()
- {
- return focusPainted;
- }
-
- /**
- * Set the button's "paintFocus" property. This property controls whether
- * or not the look and feel class will paint a special indicator of focus
- * state for the button. If it is false, the button still paints when
- * focused, but no special decoration is painted to indicate the presence
- * of focus.
- *
- * @param b The new "paintFocus" property
- */
- public void setFocusPainted(boolean p)
- {
- if (focusPainted == p)
- return;
-
- boolean old = focusPainted;
- focusPainted = p;
- firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY, old, p);
- revalidate();
- repaint();
- }
-
- /**
- * Return the button's "focusTraversable" property. This property controls
- * whether or not the button can receive focus when the user attempts to
- * traverse the focus hierarchy.
- *
- * @return The current "focusTraversable" property
- */
- public boolean isFocusTraversable()
- {
- return true;
- }
-
- /**
- * Verifies that a particular key is one of the valid constants used for
- * describing horizontal alignment and positioning. The valid constants
- * are the following members of {@link SwingConstants}:
- * <code>RIGHT</code>, <code>LEFT</code>, <code>CENTER</code>,
- * <code>LEADING</code> or <code>TRAILING</code>.
- *
- * @param key The key to check
- * @param exception A message to include in an IllegalArgumentException
- *
- * @return the value of key
- *
- * @throws IllegalArgumentException If key is not one of the valid constants
- *
- * @see setHorizontalTextPosition()
- * @see setHorizontalAlignment()
- */
- protected int checkHorizontalKey(int key, String exception)
- {
- switch (key)
- {
- case SwingConstants.RIGHT:
- case SwingConstants.LEFT:
- case SwingConstants.CENTER:
- case SwingConstants.LEADING:
- case SwingConstants.TRAILING:
- break;
- default:
- throw new IllegalArgumentException(exception);
- }
- return key;
- }
-
- /**
- * Verifies that a particular key is one of the valid constants used for
- * describing vertical alignment and positioning. The valid constants are
- * the following members of {@link SwingConstants}: <code>TOP</code>,
- * <code>BOTTOM</code> or <code>CENTER</code>.
- *
- * @param key The key to check
- * @param exception A message to include in an IllegalArgumentException
- *
- * @return the value of key
- *
- * @throws IllegalArgumentException If key is not one of the valid constants
- *
- * @see setVerticalTextPosition()
- * @see setVerticalAlignment()
- */
- protected int checkVerticalKey(int key, String exception)
- {
- switch (key)
- {
- case SwingConstants.TOP:
- case SwingConstants.BOTTOM:
- case SwingConstants.CENTER:
- break;
- default:
- throw new IllegalArgumentException(exception);
- }
- return key;
- }
-
- /**
- * Configure various properties of the button by reading properties
- * of an {@link Action}. The mapping of properties is as follows:
- *
- * <table>
- *
- * <tr><th>Action keyed property</th> <th>AbstractButton property</th></tr>
- *
- * <tr><td>NAME </td> <td>text </td></tr>
- * <tr><td>SMALL_ICON </td> <td>icon </td></tr>
- * <tr><td>SHORT_DESCRIPTION </td> <td>toolTipText </td></tr>
- * <tr><td>MNEMONIC_KEY </td> <td>mnemonic </td></tr>
- * <tr><td>ACTION_COMMAND_KEY </td> <td>actionCommand </td></tr>
- *
- * </table>
- *
- * <p>In addition, this method always sets the button's "enabled" property to
- * the value of the Action's "enabled" property.</p>
- *
- * <p>If the provided Action is <code>null</code>, the text, icon, and
- * toolTipText properties of the button are set to <code>null</code>, and
- * the "enabled" property is set to <code>true</code>; the mnemonic and
- * actionCommand properties are unchanged.</p>
- *
- * @param a An Action to configure the button from
- */
- protected void configurePropertiesFromAction(Action a)
- {
- if (a == null)
- {
- setText(null);
- setIcon(null);
- setEnabled(true);
- setToolTipText(null);
- }
- else
- {
- setText((String)(a.getValue(Action.NAME)));
- setIcon((Icon)(a.getValue(Action.SMALL_ICON)));
- setEnabled(a.isEnabled());
- setToolTipText((String)(a.getValue(Action.SHORT_DESCRIPTION)));
- if (a.getValue(Action.MNEMONIC_KEY) != null)
- setMnemonic(((Integer)(a.getValue(Action.MNEMONIC_KEY))).intValue());
- String actionCommand = (String)(a.getValue(Action.ACTION_COMMAND_KEY));
-
- // Set actionCommand to button's text by default if it is not specified
- if (actionCommand != null)
- setActionCommand((String)(a.getValue(Action.ACTION_COMMAND_KEY)));
- else
- setActionCommand(getText());
- }
- }
-
- /**
- * <p>A factory method which should return an {@link ActionListener} that
- * propagates events from the button's {@link ButtonModel} to any of the
- * button's ActionListeners. By default, this is an inner class which
- * calls {@link AbstractButton.fireActionPerformed} with a modified copy
- * of the incoming model {@link ActionEvent}.</p>
- *
- * <p>The button calls this method during construction, stores the
- * resulting ActionListener in its <code>actionListener</code> member
- * field, and subscribes it to the button's model. If the button's model
- * is changed, this listener is unsubscribed from the old model and
- * subscribed to the new one.</p>
- *
- * @return A new ActionListener
- */
- protected ActionListener createActionListener()
- {
- return new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- AbstractButton.this.fireActionPerformed(e);
- }
- };
- }
-
- /**
- * <p>A factory method which should return a {@link PropertyChangeListener}
- * that accepts changes to the specified {@link Action} and reconfigure
- * the {@link AbstractButton}, by default using the {@link
- * configurePropertiesFromAction} method.</p>
- *
- * <p>The button calls this method whenever a new Action is assigned to
- * the button's "action" property, via {@link setAction}, and stores the
- * resulting PropertyChangeListener in its
- * <code>actionPropertyChangeListener</code> member field. The button
- * then subscribes the listener to the button's new action. If the
- * button's action is changed subsequently, the listener is unsubscribed
- * from the old action and subscribed to the new one.</p>
- *
- * @param a The Action which will be listened to, and which should be
- * the same as the source of any PropertyChangeEvents received by the
- * new listener returned from this method.
- *
- * @return A new PropertyChangeListener
- */
- protected PropertyChangeListener createActionPropertyChangeListener(Action a)
- {
- return new PropertyChangeListener()
- {
- public void propertyChange(PropertyChangeEvent e)
- {
- Action act = (Action) (e.getSource());
- if (e.getPropertyName().equals("enabled"))
- setEnabled(act.isEnabled());
- else if (e.getPropertyName().equals(Action.NAME))
- setText((String)(act.getValue(Action.NAME)));
- else if (e.getPropertyName().equals(Action.SMALL_ICON))
- setIcon((Icon)(act.getValue(Action.SMALL_ICON)));
- else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION))
- setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION)));
- else if (e.getPropertyName().equals(Action.MNEMONIC_KEY))
- if (act.getValue(Action.MNEMONIC_KEY) != null)
- setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue());
- else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY))
- setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY)));
- }
- };
- }
-
- /**
- * <p>Factory method which creates a {@link ChangeListener}, used to
- * subscribe to ChangeEvents from the button's model. Subclasses of
- * AbstractButton may wish to override the listener used to subscribe to
- * such ChangeEvents. By default, the listener just propagates the
- * {@link ChangeEvent} to the button's ChangeListeners, via the {@link
- * AbstractButton.fireStateChanged} method.</p>
- *
- * <p>The button calls this method during construction, stores the
- * resulting ChangeListener in its <code>changeListener</code> member
- * field, and subscribes it to the button's model. If the button's model
- * is changed, this listener is unsubscribed from the old model and
- * subscribed to the new one.</p>
- *
- * @return The new ChangeListener
- */
- protected ChangeListener createChangeListener()
- {
- return new ChangeListener()
- {
- public void stateChanged(ChangeEvent e)
- {
- AbstractButton.this.fireStateChanged();
- AbstractButton.this.repaint();
- }
- };
- }
-
- /**
- * <p>Factory method which creates a {@link ItemListener}, used to
- * subscribe to ItemEvents from the button's model. Subclasses of
- * AbstractButton may wish to override the listener used to subscribe to
- * such ItemEvents. By default, the listener just propagates the
- * {@link ItemEvent} to the button's ItemListeners, via the {@link
- * AbstractButton.fireItemStateChanged} method.</p>
- *
- * <p>The button calls this method during construction, stores the
- * resulting ItemListener in its <code>changeListener</code> member
- * field, and subscribes it to the button's model. If the button's model
- * is changed, this listener is unsubscribed from the old model and
- * subscribed to the new one.</p>
- *
- * <p>Note that ItemEvents are only generated from the button's model
- * when the model's <em>selected</em> property changes. If you want to
- * subscribe to other properties of the model, you must subscribe to
- * ChangeEvents.
- *
- * @return The new ItemListener
- */
- protected ItemListener createItemListener()
- {
- return new ItemListener()
- {
- public void itemStateChanged(ItemEvent e)
- {
- AbstractButton.this.fireItemStateChanged(e);
- }
- };
- }
-
- /**
- * Programmatically perform a "click" on the button: arming, pressing,
- * waiting, un-pressing, and disarming the model.
- */
- public void doClick()
- {
- doClick(100);
- }
-
- /**
- * Programmatically perform a "click" on the button: arming, pressing,
- * waiting, un-pressing, and disarming the model.
- *
- * @param pressTime The number of milliseconds to wait in the pressed state
- */
- public void doClick(int pressTime)
- {
- getModel().setArmed(true);
- getModel().setPressed(true);
- try
- {
- java.lang.Thread.sleep(pressTime);
- }
- catch (java.lang.InterruptedException e)
- {
- // probably harmless
- }
- getModel().setPressed(false);
- getModel().setArmed(false);
- }
-
- /**
- * Return the button's disabled selected icon. The look and feel class
- * should paint this icon when the "enabled" property of the button's model
- * is <code>false</code> and its "selected" property is
- * <code>true</code>. This icon can be <code>null</code>, in which case
- * it is synthesized from the button's selected icon.
- *
- * @return The current disabled selected icon
- */
- public Icon getDisabledSelectedIcon()
- {
- return disabledSelectedIcon;
- }
-
- /**
- * Set the button's disabled selected icon. The look and feel class
- * should paint this icon when the "enabled" property of the button's model
- * is <code>false</code> and its "selected" property is
- * <code>true</code>. This icon can be <code>null</code>, in which case
- * it is synthesized from the button's selected icon.
- *
- * @param icon The new disabled selected icon
- */
- public void setDisabledSelectedIcon(Icon icon)
- {
- if (disabledSelectedIcon == icon)
- return;
-
- Icon old = disabledSelectedIcon;
- disabledSelectedIcon = icon;
- firePropertyChange(DISABLED_SELECTED_ICON_CHANGED_PROPERTY, old, icon);
- revalidate();
- repaint();
- }
-
- /**
- * Return the button's rollover icon. The look and feel class should
- * paint this icon when the "rolloverEnabled" property of the button is
- * <code>true</code> and the mouse rolls over the button.
- *
- * @return The current rollover icon
- */
- public Icon getRolloverIcon()
- {
- return rolloverIcon;
- }
-
- /**
- * Set the button's rollover icon. The look and feel class should
- * paint this icon when the "rolloverEnabled" property of the button is
- * <code>true</code> and the mouse rolls over the button.
- *
- * @param rolloverIcon The new rollover icon
- */
- public void setRolloverIcon(Icon r)
- {
- if (rolloverIcon == r)
- return;
-
- Icon old = rolloverIcon;
- rolloverIcon = r;
- firePropertyChange(ROLLOVER_ICON_CHANGED_PROPERTY, old, rolloverIcon);
- revalidate();
- repaint();
- }
-
- /**
- * Return the button's rollover selected icon. The look and feel class
- * should paint this icon when the "rolloverEnabled" property of the button
- * is <code>true</code>, the "selected" property of the button's model is
- * <code>true</code>, and the mouse rolls over the button.
- *
- * @return The current rollover selected icon
- */
- public Icon getRolloverSelectedIcon()
- {
- return rolloverSelectedIcon;
- }
-
- /**
- * Set the button's rollover selected icon. The look and feel class
- * should paint this icon when the "rolloverEnabled" property of the button
- * is <code>true</code>, the "selected" property of the button's model is
- * <code>true</code>, and the mouse rolls over the button.
- *
- * @param rolloverSelectedIcon The new rollover selected icon
- */
- public void setRolloverSelectedIcon(Icon r)
- {
- if (rolloverSelectedIcon == r)
- return;
-
- Icon old = rolloverSelectedIcon;
- rolloverSelectedIcon = r;
- firePropertyChange(ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, old, r);
- revalidate();
- repaint();
- }
-
- /**
- * Return the button's selected icon. The look and feel class should
- * paint this icon when the "selected" property of the button's model is
- * <code>true</code>, and either the "rolloverEnabled" property of the
- * button is <code>false</code> or the mouse is not currently rolled
- * over the button.
- *
- * @return The current selected icon
- */
- public Icon getSelectedIcon()
- {
- return selectedIcon;
- }
-
- /**
- * Set the button's selected icon. The look and feel class should
- * paint this icon when the "selected" property of the button's model is
- * <code>true</code>, and either the "rolloverEnabled" property of the
- * button is <code>false</code> or the mouse is not currently rolled
- * over the button.
- *
- * @param selectedIcon The new selected icon
- */
- public void setSelectedIcon(Icon s)
- {
- if (selectedIcon == s)
- return;
-
- Icon old = selectedIcon;
- selectedIcon = s;
- firePropertyChange(SELECTED_ICON_CHANGED_PROPERTY, old, s);
- revalidate();
- repaint();
- }
-
- /**
- * Returns an single-element array containing the "text" property of the
- * button if the "selected" property of the button's model is
- * <code>true</code>, otherwise returns <code>null</code>.
- *
- * @return The button's "selected object" array
- */
- public Object[] getSelectedObjects()
- {
- if (isSelected())
- {
- Object[] objs = new Object[1];
- objs[0] = getText();
- return objs;
- }
- else
- {
- return null;
- }
- }
-
- /**
- * Called when image data becomes available for one of the button's icons.
- *
- * @param img The image being updated
- * @param infoflags One of the constant codes in {@link ImageObserver} used to describe
- * updated portions of an image.
- * @param x X coordinate of the region being updated
- * @param y Y coordinate of the region being updated
- * @param w Width of the region beign updated
- * @param h Height of the region being updated
- *
- * @return <code>true</code> if img is equal to the button's current
- * icon, otherwise <code>false</code>
- */
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int w,
- int h)
- {
- return current_icon == img;
- }
-
- /**
- * Returns the value of the button's "contentAreaFilled" property. This
- * property indicates whether the area surrounding the text and icon of
- * the button should be filled by the look and feel class. If this
- * property is <code>false</code>, the look and feel class should leave
- * the content area transparent.
- *
- * @return The current value of the "contentAreaFilled" property
- */
- public boolean isContentAreaFilled()
- {
- return contentAreaFilled;
- }
-
- /**
- * Sets the value of the button's "contentAreaFilled" property. This
- * property indicates whether the area surrounding the text and icon of
- * the button should be filled by the look and feel class. If this
- * property is <code>false</code>, the look and feel class should leave
- * the content area transparent.
- *
- * @param b The new value of the "contentAreaFilled" property
- */
- public void setContentAreaFilled(boolean b)
- {
- if (contentAreaFilled == b)
- return;
-
- boolean old = contentAreaFilled;
- contentAreaFilled = b;
- firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY, old, b);
- revalidate();
- repaint();
- }
-
- /**
- * Paints the button's border, if the button's "borderPainted" property is
- * <code>true</code>, by out calling to the button's look and feel class.
- *
- * @param g The graphics context used to paint the border
- */
- protected void paintBorder(Graphics g)
- {
- if (isBorderPainted())
- super.paintBorder(g);
- }
-
- /**
- * Returns a string, used only for debugging, which identifies or somehow
- * represents this button. The exact value is implementation-defined.
- *
- * @return A string representation of the button
- */
- protected String paramString()
- {
- StringBuffer sb = new StringBuffer();
- sb.append(super.paramString());
- sb.append(",defaultIcon=");
- if (getIcon() != null)
- sb.append(getIcon());
- sb.append(",disabledIcon=");
- if (getDisabledIcon() != null)
- sb.append(getDisabledIcon());
- sb.append(",disabledSelectedIcon=");
- if (getDisabledSelectedIcon() != null)
- sb.append(getDisabledSelectedIcon());
- sb.append(",margin=");
- if (getMargin() != null)
- sb.append(getMargin());
- sb.append(",paintBorder=").append(isBorderPainted());
- sb.append(",paintFocus=").append(isFocusPainted());
- sb.append(",pressedIcon=");
- if (getPressedIcon() != null)
- sb.append(getPressedIcon());
- sb.append(",rolloverEnabled=").append(isRolloverEnabled());
- sb.append(",rolloverIcon=");
- if (getRolloverIcon() != null)
- sb.append(getRolloverIcon());
- sb.append(",rolloverSelected=");
- if (getRolloverSelectedIcon() != null)
- sb.append(getRolloverSelectedIcon());
- sb.append(",selectedIcon=");
- if (getSelectedIcon() != null)
- sb.append(getSelectedIcon());
- sb.append(",text=");
- if (getText() != null)
- sb.append(getText());
- return sb.toString();
- }
-
- /**
- * Set the "UI" property of the button, which is a look and feel class
- * responsible for handling the button's input events and painting it.
- *
- * @param ui The new "UI" property
- */
- public void setUI(ButtonUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * Set the "UI" property of the button, which is a look and feel class
- * responsible for handling the button's input events and painting it.
- *
- * @return The current "UI" property
- */
- public ButtonUI getUI()
- {
- return (ButtonUI) ui;
- }
-
- /**
- * Set the "UI" property to a class constructed, via the {@link
- * UIManager}, from the current look and feel. This should be overridden
- * for each subclass of AbstractButton, to retrieve a suitable {@link
- * ButtonUI} look and feel class.
- */
- public void updateUI()
- {
- }
-
- /**
- * Returns the current time in milliseconds in which clicks gets coalesced
- * into a single <code>ActionEvent</code>.
- *
- * @return the time in milliseconds
- *
- * @since 1.4
- */
- public long getMultiClickThreshhold()
- {
- return multiClickThreshhold;
- }
-
- /**
- * Sets the time in milliseconds in which clicks gets coalesced into a single
- * <code>ActionEvent</code>.
- *
- * @param threshhold the time in milliseconds
- *
- * @since 1.4
- */
- public void setMultiClickThreshhold(long threshhold)
- {
- if (threshhold < 0)
- throw new IllegalArgumentException();
-
- multiClickThreshhold = threshhold;
- }
-}
diff --git a/libjava/javax/swing/AbstractCellEditor.java b/libjava/javax/swing/AbstractCellEditor.java
deleted file mode 100644
index 188c3ee2f38..00000000000
--- a/libjava/javax/swing/AbstractCellEditor.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/* AbstractCellEditor.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.EventObject;
-
-import javax.swing.event.CellEditorListener;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.EventListenerList;
-
-/**
- * AbstractCellEditor
- * @author Andrew Selkirk
- * @version 1.0
- */
-public abstract class AbstractCellEditor
- implements CellEditor, Serializable
-{
- private static final long serialVersionUID = -1048006551406220959L;
-
- /**
- * listenerList
- */
- protected EventListenerList listenerList;
-
- /**
- * changeEvent
- */
- protected transient ChangeEvent changeEvent;
-
- /**
- * Constructor AbstractCellEditor
- */
- public AbstractCellEditor() {
- // TODO
- } // AbstractCellEditor()
-
- /**
- * isCellEditable
- * @param event TODO
- * @returns boolean
- */
- public boolean isCellEditable(EventObject event) {
- return false; // TODO
- } // isCellEditable()
-
- /**
- * shouldSelectCell
- * @param event TODO
- * @returns boolean
- */
- public boolean shouldSelectCell(EventObject event) {
- return false; // TODO
- } // shouldSelectCell()
-
- /**
- * stopCellEditing
- * @returns boolean
- */
- public boolean stopCellEditing() {
- return false; // TODO
- } // stopCellEditing()
-
- /**
- * cancelCellEditing
- */
- public void cancelCellEditing() {
- // TODO
- } // cancelCellEditing()
-
- /**
- * addCellEditorListener
- *
- * @param listener The listener to add
- */
- public void addCellEditorListener (CellEditorListener listener)
- {
- listenerList.add (CellEditorListener.class, listener);
- }
-
- /**
- * removeCellEditorListener
- *
- * @param listener The listener to remove
- */
- public void removeCellEditorListener (CellEditorListener listener)
- {
- listenerList.remove (CellEditorListener.class, listener);
- }
-
- /**
- * getCellEditorListeners
- *
- * @since 1.4
- */
- public CellEditorListener[] getCellEditorListeners()
- {
- return (CellEditorListener[]) listenerList.getListeners (CellEditorListener.class);
- }
-
- /**
- * fireEditingStopped
- */
- protected void fireEditingStopped()
- {
- CellEditorListener[] listeners = getCellEditorListeners();
-
- for (int index = 0; index < listeners.length; index++)
- {
- listeners [index].editingStopped (changeEvent);
- }
- }
-
- /**
- * fireEditingCanceled
- */
- protected void fireEditingCanceled()
- {
- CellEditorListener[] listeners = getCellEditorListeners();
-
- for (int index = 0; index < listeners.length; index++)
- {
- listeners [index].editingCanceled (changeEvent);
- }
- }
-}
diff --git a/libjava/javax/swing/AbstractListModel.java b/libjava/javax/swing/AbstractListModel.java
deleted file mode 100644
index a924b73a25f..00000000000
--- a/libjava/javax/swing/AbstractListModel.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/* AbstractListModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.EventListener;
-
-import javax.swing.event.EventListenerList;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-
-/**
- * AbstractListModel
- *
- * @author Ronald Veldema
- * @author Andrew Selkirk
- * @version 1.0
- */
-public abstract class AbstractListModel implements ListModel, Serializable
-{
- private static final long serialVersionUID = -3285184064379168730L;
-
- /** List of ListDataListeners called for each change to the list. */
- protected EventListenerList listenerList;
-
- public AbstractListModel()
- {
- listenerList = new EventListenerList();
- }
-
- /**
- * Add a listener object to this model. The listener will be called
- * any time the set of elements in the model is changed.
- *
- * @param listener The listener to add
- */
- public void addListDataListener(ListDataListener listener)
- {
- listenerList.add(ListDataListener.class, listener);
- }
-
- /**
- * Add a listener object to this model. The listener will no longer be
- * called when the set of elements in the model is changed.
- *
- * @param listener The listener to remove
- */
- public void removeListDataListener(ListDataListener listener)
- {
- listenerList.remove(ListDataListener.class, listener);
- }
-
- /**
- * Call {@link ListDataListener#contentsChanged} on each element of the
- * {@link listenerList} which is a {@link ListDataListener}. The event
- * fired has type {@ListDataEvent.CONTENTS_CHANGED} and represents a
- * change to the data elements in the range [startIndex, endIndex]
- * inclusive.
- *
- * @param source The source of the change, typically <code>this</code>
- * @param startIndex The index of the first element which changed
- * @param endIndex The index of the last element which changed
- */
- protected void fireContentsChanged(Object source, int startIndex,
- int endIndex)
- {
- ListDataEvent event = new ListDataEvent(source, ListDataEvent.CONTENTS_CHANGED,
- startIndex, endIndex);
- ListDataListener[] listeners = getListDataListeners();
-
- for (int index = 0; index < listeners.length; index++)
- listeners[index].contentsChanged(event);
- }
-
- /**
- * Call {@link ListDataListener#intervalAdded} on each element of the
- * {@link listenerList} which is a {@link ListDataListener}. The event
- * fired has type {@ListDataEvent.INTERVAL_ADDED} and represents an
- * addition of the data elements in the range [startIndex, endIndex]
- * inclusive.
- *
- * @param source The source of the change, typically <code>this</code>
- * @param startIndex The index of the first new element
- * @param endIndex The index of the last new element
- */
- protected void fireIntervalAdded(Object source, int startIndex, int endIndex)
- {
- ListDataEvent event =
- new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED,
- startIndex, endIndex);
- ListDataListener[] listeners = getListDataListeners();
-
- for (int index = 0; index < listeners.length; index++)
- listeners[index].intervalAdded(event);
- }
-
- /**
- * Call {@link ListDataListener#intervalRemoved} on each element of the
- * {@link listenerList} which is a {@link ListDataListener}. The event
- * fired has type {@ListDataEvent.INTERVAL_REMOVED} and represents a
- * removal of the data elements in the range [startIndex, endIndex]
- * inclusive.
- *
- * @param source The source of the change, typically <code>this</code>
- * @param startIndex The index of the first element removed
- * @param endIndex The index of the last element removed
- */
- protected void fireIntervalRemoved(Object source, int startIndex,
- int endIndex)
- {
- ListDataEvent event =
- new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED,
- startIndex, endIndex);
- ListDataListener[] listeners = getListDataListeners();
-
- for (int index = 0; index < listeners.length; index++)
- listeners[index].intervalRemoved(event);
- }
-
- /**
- * Return the subset of {@link EventListener} objects found in this
- * object's {@link listenerList} which are elements of the specified
- * type.
- *
- * @param listenerType The type of listeners to select
- *
- * @return The set of listeners of the specified type
- */
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
- /**
- * A synonym for <code>getListeners(ListDataListener.class)</code>.
- *
- * @return The set of ListDataListeners found in the {@link listenerList}
- */
- public ListDataListener[] getListDataListeners()
- {
- return (ListDataListener[]) getListeners(ListDataListener.class);
- }
-}
diff --git a/libjava/javax/swing/AbstractSpinnerModel.java b/libjava/javax/swing/AbstractSpinnerModel.java
deleted file mode 100644
index 05a98923fb0..00000000000
--- a/libjava/javax/swing/AbstractSpinnerModel.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* AbstractSpinnerModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util.EventListener;
-
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-/**
- * AbstractSpinnerModel
- * @author Ka-Hing Cheung
- * @version 1.0
- */
-public abstract class AbstractSpinnerModel implements SpinnerModel
-{
- private ChangeEvent changeEvent = new ChangeEvent(this);
-
- protected EventListenerList listenerList = new EventListenerList();
-
- /**
- * Creates an <code>AbstractSpinnerModel</code>.
- */
- public AbstractSpinnerModel()
- {
- }
-
- /**
- * Adds a <code>ChangeListener</code>.
- *
- * @param listener the listener to add
- */
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- /**
- * Gets all the listeners that are of a particular type.
- *
- * @param c the type of listener
- * @return the listeners that are of the specific type
- */
- public EventListener[] getListeners(Class c)
- {
- return listenerList.getListeners(c);
- }
-
- /**
- * Gets all the <code>ChangeListener</code>s.
- *
- * @return all the <code>ChangeListener</code>s
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
- }
-
- /**
- * Remove a particular listener.
- *
- * @param listener the listener to remove
- */
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- /**
- * Fires a <code>ChangeEvent</code> to all the <code>ChangeListener</code>s
- * added to this model
- */
- protected void fireStateChanged()
- {
- ChangeListener[] listeners = getChangeListeners();
-
- for(int i = 0; i < listeners.length; ++i)
- listeners[i].stateChanged(changeEvent);
- }
-}
diff --git a/libjava/javax/swing/Action.java b/libjava/javax/swing/Action.java
deleted file mode 100644
index 72b8bae4b63..00000000000
--- a/libjava/javax/swing/Action.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* Action.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.event.ActionListener;
-import java.beans.PropertyChangeListener;
-
-/**
- * Action
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- * @author Andrew Selkirk
- */
-public interface Action extends ActionListener {
-
- //-------------------------------------------------------------
- // Constants --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * DEFAULT
- */
- String DEFAULT = "Default";
-
- /**
- * LONG_DESCRIPTION
- */
- String LONG_DESCRIPTION = "LongDescription";
-
- /**
- * NAME
- */
- String NAME = "Name";
-
- /**
- * SHORT_DESCRIPTION
- */
- String SHORT_DESCRIPTION = "ShortDescription";
-
- /**
- * SMALL_ICON
- */
- String SMALL_ICON = "SmallIcon";
-
- /**
- * ACCELERATOR_KEY
- */
- String ACCELERATOR_KEY = "AcceleratorKey";
-
- /**
- * ACTION_COMMAND_KEY
- */
- String ACTION_COMMAND_KEY = "ActionCommandKey";
-
- /**
- * MNEMONIC_KEY
- */
- String MNEMONIC_KEY = "MnemonicKey";
-
-
- //-------------------------------------------------------------
- // Interface: Action ------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getValue
- * @param key TODO
- * @returns TODO
- */
- Object getValue(String key);
-
- /**
- * setValue
- * @param key TODO
- * @param value TODO
- */
- void putValue(String key, Object value);
-
- /**
- * isEnabled
- * @returns TODO
- */
- boolean isEnabled();
-
- /**
- * setEnabled
- * @param b TODO
- */
- void setEnabled(boolean b);
-
- /**
- * addPropertyChangeListener
- * @param listener TODO
- */
- void addPropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * removePropertyChangeListener
- * @param listener TODO
- */
- void removePropertyChangeListener(PropertyChangeListener listener);
-
-
-} // Action
diff --git a/libjava/javax/swing/ActionMap.java b/libjava/javax/swing/ActionMap.java
deleted file mode 100644
index d7b8b91d8dd..00000000000
--- a/libjava/javax/swing/ActionMap.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/* ActionMap.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * @author Andrew Selkirk
- * @author Michael Koch
- */
-public class ActionMap
- implements Serializable
-{
- private static final long serialVersionUID = -6277518704513986346L;
-
- /**
- * actionMap
- */
- private Map actionMap = new HashMap();
-
- /**
- * parent
- */
- private ActionMap parent;
-
- /**
- * Creates a new <code>ActionMap</code> instance.
- */
- public ActionMap()
- {
- }
-
- /**
- * Returns an action associated with an object.
- *
- * @param key the key of the enty
- *
- * @return the action associated with key, may be null
- */
- public Action get(Object key)
- {
- Object result = actionMap.get(key);
-
- if (result == null && parent != null)
- result = parent.get(key);
-
- return (Action) result;
- }
-
- /**
- * Puts a new <code>Action</code> into the <code>ActionMap</code>.
- * If action is null an existing entry will be removed.
- *
- * @param key the key for the entry
- * @param action the action.
- */
- public void put(Object key, Action action)
- {
- if (action == null)
- actionMap.remove(key);
- else
- actionMap.put(key, action);
- }
-
- /**
- * Remove an entry from the <code>ActionMap</code>.
- *
- * @param key the key of the entry to remove
- */
- public void remove(Object key)
- {
- actionMap.remove(key);
- }
-
- /**
- * Returns the parent of this <code>ActionMap</code>.
- *
- * @return the parent, may be null.
- */
- public ActionMap getParent()
- {
- return parent;
- }
-
- /**
- * Sets a parent for this <code>ActionMap</code>.
- *
- * @param parentMap the new parent
- */
- public void setParent(ActionMap parentMap)
- {
- parent = parentMap;
- }
-
- /**
- * Returns the number of entries in this <code>ActionMap</code>.
- *
- * @return the number of entries
- */
- public int size()
- {
- return actionMap.size();
- }
-
- /**
- * Clears the <code>ActionMap</code>.
- */
- public void clear()
- {
- actionMap.clear();
- }
-
- /**
- * Returns all keys of entries in this <code>ActionMap</code>.
- *
- * @return an array of keys
- */
- public Object[] keys()
- {
- return actionMap.keySet().toArray();
- }
-
- /**
- * Returns all keys of entries in this <code>ActionMap</code>
- * and all its parents.
- *
- * @return an array of keys
- */
- public Object[] allKeys()
- {
- Set set = new HashSet();
-
- if (parent != null)
- set.addAll(Arrays.asList(parent.allKeys()));
-
- set.addAll(actionMap.keySet());
- return set.toArray();
- }
-
- /**
- * writeObject
- *
- * @param stream the stream to write to
- *
- * @exception IOException If an error occurs
- */
- private void writeObject(ObjectOutputStream stream)
- throws IOException
- {
- // TODO
- }
-
- /**
- * readObject
- *
- * @param stream the stream to read from
- *
- * @exception ClassNotFoundException If the serialized class cannot be found
- * @exception IOException If an error occurs
- */
- private void readObject(ObjectInputStream stream)
- throws ClassNotFoundException, IOException
- {
- // TODO
- }
-}
diff --git a/libjava/javax/swing/BorderFactory.java b/libjava/javax/swing/BorderFactory.java
deleted file mode 100644
index b0b313597b6..00000000000
--- a/libjava/javax/swing/BorderFactory.java
+++ /dev/null
@@ -1,449 +0,0 @@
-/* BorderFactory.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Color;
-import java.awt.Font;
-
-import javax.swing.border.BevelBorder;
-import javax.swing.border.Border;
-import javax.swing.border.CompoundBorder;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.EtchedBorder;
-import javax.swing.border.LineBorder;
-import javax.swing.border.MatteBorder;
-import javax.swing.border.TitledBorder;
-
-public class BorderFactory
-{
- private BorderFactory()
- {
- // Do nothing.
- }
-
- /**
- * Creates a line border withe the specified color.
- *
- * @param color A color to use for the line.
- *
- * @return The Border object
- */
- public static Border createLineBorder(Color color)
- {
- return null;
- }
-
- /**
- * Creates a line border withe the specified color and width. The width
- * applies to all 4 sides of the border. To specify widths individually for
- * the top, bottom, left, and right, use
- * createMatteBorder(int,int,int,int,Color).
- *
- * @param color A color to use for the line.
- * @param thickness An int specifying the width in pixels.
- *
- * @return The Border object
- */
- public static Border createLineBorder (Color color, int thickness)
- {
- return new LineBorder (color, thickness);
- }
-
- /**
- * Created a border with a raised beveled edge, using brighter shades of
- * the component's current background color for highlighting, and darker
- * shading for shadows. (In a raised border, highlights are on top and
- * shadows are underneath.)
- *
- * @return The Border object
- */
- public static Border createRaisedBevelBorder ()
- {
- return new BevelBorder (BevelBorder.RAISED);
- }
-
- /**
- * Created a border with a lowered beveled edge, using brighter shades of
- * the component's current background color for highlighting, and darker
- * shading for shadows. (In a lowered border, shadows are on top and
- * highlights are underneath.)
- *
- * @return The Border object
- */
- public static Border createLoweredBevelBorder ()
- {
- return new BevelBorder (BevelBorder.LOWERED);
- }
-
- /**
- * Create a beveled border of the specified type, using brighter shades of
- * the component's current background color for highlighting, and darker
- * shading for shadows. (In a lowered border, shadows are on top and
- * highlights are underneath.).
- *
- * @param type An int specifying either BevelBorder.LOWERED or
- * BevelBorder.RAISED
- *
- * @Return The Border object
- */
- public static Border createBevelBorder (int type)
- {
- return new BevelBorder (type);
- }
-
- /**
- * Create a beveled border of the specified type, using the specified
- * highlighting and shadowing. The outer edge of the highlighted area uses
- * a brighter shade of the highlight color. The inner edge of the shadow
- * area uses a brighter shade of the shadaw color.
- *
- * @param type An int specifying either BevelBorder.LOWERED or
- * BevelBorder.RAISED
- * @param highlight A Color object for highlights
- * @param shadow A Color object for shadows
- *
- * @return The Border object
- */
- public static Border createBevelBorder (int type, Color highlight,
- Color shadow)
- {
- return new BevelBorder (type, highlight, shadow);
- }
-
- /**
- * Create a beveled border of the specified type, using the specified colors
- * for the inner and outer highlight and shadow areas.
- *
- * @param type An int specifying either BevelBorder.LOWERED or
- * BevelBorder.RAISED
- * @param highlightOuter A Color object for the outer edge of the
- * highlight area
- * @param highlightInner A Color object for the inner edge of the
- * highlight area
- * @param shadowOuter A Color object for the outer edge of the shadow area
- * @param shadowInner A Color object for the inner edge of the shadow area
- *
- * @return The Border object
- */
- public static Border createBevelBorder (int type, Color highlightOuter,
- Color highlightInner,
- Color shadowOuter, Color shadowInner)
- {
- return new BevelBorder (type, highlightOuter, highlightInner, shadowOuter,
- shadowInner);
- }
-
- /**
- * Create a border with an "etched" look using the component's current
- * background color for highlighting and shading.
- *
- * @return The Border object
- */
- public static Border createEtchedBorder ()
- {
- return new EtchedBorder ();
- }
-
- /**
- * Create a border with an "etched" look using the component's current
- * background color for highlighting and shading.
- *
- * @return The Border object
- */
- public static Border createEtchedBorder (int etchType)
- {
- return new EtchedBorder (etchType);
- }
-
- /**
- * Create a border with an "etched" look using the specified highlighting and
- * shading colors.
- *
- * @param highlight A Color object for the border highlights
- * @param shadow A Color object for the border shadows
- *
- * @return The Border object
- */
- public static Border createEtchedBorder (Color highlight, Color shadow)
- {
- return new EtchedBorder (highlight, shadow);
- }
-
- /**
- * Create a border with an "etched" look using the specified highlighting and
- * shading colors.
- *
- * @param highlight A Color object for the border highlights
- * @param shadow A Color object for the border shadows
- *
- * @return The Border object
- */
- public static Border createEtchedBorder (int etchType, Color highlight,
- Color shadow)
- {
- return new EtchedBorder (etchType, highlight, shadow);
- }
-
- /**
- * Create a new title border specifying the text of the title, using the
- * default border (etched), using the default text position (sitting on the
- * top line) and default justification (left) and using the default font and
- * text color determined by the current look and feel.
- *
- * @param title A String containing the text of the title
- *
- * @return The TitledBorder object
- */
- public static TitledBorder createTitledBorder (String title)
- {
- return new TitledBorder (title);
- }
-
- /**
- * Create a new title border with an empty title specifying the border
- * object, using the default text position (sitting on the top line) and
- * default justification (left) and using the default font, text color,
- * and border determined by the current look and feel. (The Motif and Windows
- * look and feels use an etched border; The Java look and feel use a
- * gray border.)
- *
- * @param border The Border object to add the title to
- *
- * @return The TitledBorder object
- */
- public static TitledBorder createTitledBorder (Border border)
- {
- return new TitledBorder (border);
- }
-
- /**
- * Add a title to an existing border, specifying the text of the title, using
- * the default positioning (sitting on the top line) and default
- * justification (left) and using the default font and text color determined
- * by the current look and feel.
- *
- * @param order The Border object to add the title to
- * @param title A String containing the text of the title
- *
- * @return The TitledBorder object
- */
- public static TitledBorder createTitledBorder (Border border, String title)
- {
- return new TitledBorder (border, title);
- }
-
- /**
- * Add a title to an existing border, specifying the text of the title along
- * with its positioning, using the default font and text color determined by
- * the current look and feel.
- *
- * @param border The Border object to add the title to
- * @param title A String containing the text of the title
- * @param titleJustification An int specifying the left/right position of
- * the title -- one of TitledBorder.LEFT, TitledBorder.CENTER, or
- * TitledBorder.RIGHT, TitledBorder.DEFAULT_JUSTIFICATION (left).
- * @param titlePosition An int specifying the vertical position of the text
- * in relation to the border -- one of: TitledBorder.ABOVE_TOP,
- * TitledBorder.TOP (sitting on the top line), TitledBorder.BELOW_TOP,
- * TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM (sitting on the bottom
- * line), TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION (top).
- *
- * @return The TitledBorder object
- */
- public static TitledBorder createTitledBorder (Border border, String title,
- int titleJustification,
- int titlePosition)
- {
- return new TitledBorder (border, title, titleJustification, titlePosition);
- }
-
- /**
- * Add a title to an existing border, specifying the text of the title along
- * with its positioning and font, using the default text color determined by
- * the current look and feel.
- *
- * @param border - the Border object to add the title to
- * @param title - a String containing the text of the title
- * @param titleJustification - an int specifying the left/right position of
- * the title -- one of TitledBorder.LEFT, TitledBorder.CENTER, or
- * TitledBorder.RIGHT, TitledBorder.DEFAULT_JUSTIFICATION (left).
- * @param titlePosition - an int specifying the vertical position of the
- * text in relation to the border -- one of: TitledBorder.ABOVE_TOP,
- * TitledBorder.TOP (sitting on the top line), TitledBorder.BELOW_TOP,
- * TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM (sitting on the bottom
- * line), TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION (top).
- * @param titleFont - a Font object specifying the title font
- *
- * @return The TitledBorder object
- */
- public static TitledBorder createTitledBorder (Border border, String title,
- int titleJustification,
- int titlePosition,
- Font titleFont)
- {
- return new TitledBorder (border, title, titleJustification, titlePosition,
- titleFont);
- }
-
- /**
- * Add a title to an existing border, specifying the text of the title along
- * with its positioning, font, and color.
- *
- * @param border - the Border object to add the title to
- * @param title - a String containing the text of the title
- * @param titleJustification - an int specifying the left/right position of
- * the title -- one of TitledBorder.LEFT, TitledBorder.CENTER, or
- * TitledBorder.RIGHT, TitledBorder.DEFAULT_JUSTIFICATION (left).
- * @param titlePosition - an int specifying the vertical position of the text
- * in relation to the border -- one of: TitledBorder.ABOVE_TOP,
- * TitledBorder.TOP (sitting on the top line), TitledBorder.BELOW_TOP,
- * TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM (sitting on the bottom
- * line), TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION (top).
- * @param titleFont - a Font object specifying the title font
- * @param titleColor - a Color object specifying the title color
- *
- * @return The TitledBorder object
- */
- public static TitledBorder createTitledBorder (Border border,
- String title,
- int titleJustification,
- int titlePosition,
- Font titleFont,
- Color titleColor)
- {
- return new TitledBorder (border, title, titleJustification, titlePosition,
- titleFont, titleColor);
- }
-
- /**
- * Creates an empty border that takes up no space. (The width of the top,
- * bottom, left, and right sides are all zero.)
- *
- * @return The Border object
- */
- public static Border createEmptyBorder ()
- {
- return new EmptyBorder (0, 0, 0, 0);
- }
-
- /**
- * Creates an empty border that takes up no space but which does no drawing,
- * specifying the width of the top, left, bottom, and right sides.
- *
- * @param top An int specifying the width of the top in pixels
- * @param left An int specifying the width of the left side in pixels
- * @param bottom An int specifying the width of the right side in pixels
- * @param right An int specifying the width of the bottom in pixels
- *
- * @return The Border object
- */
- public static Border createEmptyBorder (int top, int left, int bottom,
- int right)
- {
- return new EmptyBorder (top, left, bottom, right);
- }
-
- /**
- * Create a compound border with a null inside edge and a null outside edge.
- *
- * @return The CompoundBorder object
- */
- public static CompoundBorder createCompoundBorder ()
- {
- return new CompoundBorder ();
- }
-
- /**
- * Create a compound border specifying the border objects to use for the
- * outside and inside edges.
- *
- * @param outsideBorder A Border object for the outer edge of the
- * compound border
- * @param insideBorder A Border object for the inner edge of the
- * compound border
- *
- * @return The CompoundBorder object
- */
- public static CompoundBorder createCompoundBorder (Border outsideBorder,
- Border insideBorder)
- {
- return new CompoundBorder (outsideBorder, insideBorder);
- }
-
- /**
- * Create a matte-look border using a solid color. (The difference between
- * this border and a line border is that you can specify the individual
- * border dimensions.)
- *
- * @param top An int specifying the width of the top in pixels
- * @param left An int specifying the width of the left side in pixels
- * @param bottom An int specifying the width of the right side in pixels
- * @param right An int specifying the width of the bottom in pixels
- * @param color A Color to use for the border
- *
- * @return The MatteBorder object
- */
- public static MatteBorder createMatteBorder (int top, int left, int bottom,
- int right, Color color)
- {
- return new MatteBorder (top, left, bottom, right, color);
- }
-
- /**
- * Create a matte-look border that consists of multiple tiles of a specified
- * icon. Multiple copies of the icon are placed side-by-side to fill up the
- * border area.
- *
- * Note:
- * If the icon doesn't load, the border area is painted gray.
- *
- * @param top An int specifying the width of the top in pixels
- * @param left An int specifying the width of the left side in pixels
- * @param bottom An int specifying the width of the right side in pixels
- * @param right An int specifying the width of the bottom in pixels
- * @param tileIcon The Icon object used for the border tiles
- *
- * @return The MatteBorder object
- */
- public static MatteBorder createMatteBorder (int top, int left, int bottom,
- int right, Icon tileIcon)
- {
- return new MatteBorder (top, left, bottom, right, tileIcon);
- }
-}
diff --git a/libjava/javax/swing/BoundedRangeModel.java b/libjava/javax/swing/BoundedRangeModel.java
deleted file mode 100644
index 7ff56ccf425..00000000000
--- a/libjava/javax/swing/BoundedRangeModel.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/* BoundedRangeModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.swing.event.ChangeListener;
-
-/**
- * @author Andrew Selkirk
- */
-public interface BoundedRangeModel
-{
- /**
- * getValue
- *
- * @return int
- *
- * @see #setValue(int)
- */
- int getValue();
-
- /**
- * setValue
- *
- * @param value the value
- *
- * @see #getValue()
- */
- void setValue(int value);
-
- /**
- * getMinimum
- *
- * @return int
- *
- * @see #setMinimum(int)
- */
- int getMinimum();
-
- /**
- * setMinimum
- *
- * @param minimum the minimum value
- *
- * @see #getMinimum()
- */
- void setMinimum(int minimum);
-
- /**
- * getMaximum
- *
- * @return int
- *
- * @see #setMaximum(int)
- */
- int getMaximum();
-
- /**
- * setMaximum
- *
- * @param maximum the maximum value
- *
- * @see #getMaximum()
- */
- void setMaximum(int maximum);
-
- /**
- * Returns the value of the <code>valueIsAdjusting</code> property.
- *
- * @return <code>true</code> if value is adjusting,
- * otherwise <code>false</code>
- *
- * @see setValueIsAdjusting(boolean)
- */
- boolean getValueIsAdjusting();
-
- /**
- * setValueIsAdjusting
- *
- * @param adjusting <code>true</code> if adjusting,
- * <code>false</code> otherwise
- *
- * @see #getValueIsAdjusting()
- */
- void setValueIsAdjusting(boolean adjusting);
-
- /**
- * Returns the current extent.
- *
- * @return the extent
- *
- * @see #setExtent(int)
- */
- int getExtent();
-
- /**
- * setExtent
- *
- * @param extent the extent
- *
- * @see #getExtent()
- */
- void setExtent(int extent);
-
- /**
- * setRangeProperties
- * @param value the value
- * @param extent the extent
- * @param minnimum the minimum value
- * @param maximum the maximum value
- * @param adjusting TODO
- */
- void setRangeProperties(int value, int extent, int minimum, int maximum,
- boolean adjusting);
-
- /**
- * Adds a <code>ChangeListener</code> to this object.
- *
- * @param listener the listener to add
- *
- * @see #removeChangeListener(javax.swing.event.ChangeListener)
- */
- void addChangeListener(ChangeListener listener);
-
- /**
- * Removes a <code>ChangeListener</code> from this object.
- *
- * @param listener the listener to remove
- *
- * @see #addChangeListener(javax.swing.event.ChangeListener)
- */
- void removeChangeListener(ChangeListener listener);
-}
diff --git a/libjava/javax/swing/Box.java b/libjava/javax/swing/Box.java
deleted file mode 100644
index 2355414bcdd..00000000000
--- a/libjava/javax/swing/Box.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/* Box.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.AWTError;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.LayoutManager;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * A component that uses a {@link BoxLayout} as Layout Manager.
- *
- * In addition to that, this class provides a set of static methods for
- * creating some filler components ('struts' and 'glue') for use in
- * containers that are laid out using BoxLayout.
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public class Box extends JComponent implements Accessible
-{
- private static final long serialVersionUID = 1525417495883046342L;
-
- // FIXME: disable to make libjava compile; visibility rules are broken
- protected class AccessibleBox // extends Container.AccessibleAWTContainer
- {
- private static final long serialVersionUID = -7775079816389931944L;
-
- protected AccessibleBox()
- {
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return null;
- }
- }
-
- /**
- * A component that servers as a filler in BoxLayout controlled containers.
- */
- public static class Filler extends JComponent implements Accessible
- {
- private static final long serialVersionUID = -1204263191910183998L;
-
- // FIXME: disable to make libjava compile; visibility rules are broken
- protected class AccessibleBoxFiller // extends Component.AccessibleAWTComponent
- {
- private static final long serialVersionUID = 164963348357479321L;
-
- protected AccessibleBoxFiller()
- {
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return null;
- }
- }
-
- protected AccessibleContext accessibleContext;
-
- private transient Dimension min, pref, max;
-
- /**
- * Creates a new instance of Filler.
- *
- * @param min the minimum size of the filler.
- * @param pref the preferred size of the filler.
- * @param max the maximum size of the filler.
- */
- public Filler(Dimension min, Dimension pref, Dimension max)
- {
- changeShape(min, pref, max);
- }
-
- /**
- * Changes the dimensions of this Filler.
- *
- * @param min the new minimum size of the filler.
- * @param pref the new preferred size of the filler.
- * @param max the new maximum size of the filler.
- */
- public void changeShape(Dimension min, Dimension pref, Dimension max)
- {
- this.min = min;
- this.pref = pref;
- this.max = max;
- }
-
- public AccessibleContext getAccessibleContext()
- {
- // FIXME: disable to make libjava compile; visibility rules are broken
- // if (accessibleContext == null)
- // accessibleContext = new AccessibleBoxFiller();
- return accessibleContext;
- }
-
- /**
- * Returns the maximum size of this Filler.
- *
- * @return the maximum size of this Filler.
- */
- public Dimension getMaximumSize()
- {
- return max;
- }
-
- /**
- * Returns the minimum size of this Filler.
- *
- * @return the minimum size of this Filler.
- */
- public Dimension getMinimumSize()
- {
- return min;
- }
-
- /**
- * Returns the preferred size of this Filler.
- *
- * @return the preferred size of this Filler.
- */
- public Dimension getPreferredSize()
- {
- return pref;
- }
- }
-
- /**
- * Creates a new Box component, that lays out its children according
- * to the <code>axis</code> parameter.
- *
- * @param axis the orientation of the BoxLayout.
- *
- * @see BoxLayout#X_AXIS
- * @see BoxLayout#Y_AXIS
- * @see BoxLayout#LINE_AXIS
- * @see BoxLayout#PAGE_AXIS
- */
- public Box(int axis)
- {
- super.setLayout(new BoxLayout(this, axis));
- }
-
- /**
- * Creates a filler component which acts as glue between components.
- * It does not take space unless some extra space is available. If extra
- * space is available, this component can expand in both X and Y directions.
- *
- * @return a glue-like filler component.
- */
- public static Component createGlue()
- {
- Filler glue = new Filler(new Dimension(0,0), new Dimension(0,0),
- new Dimension(Integer.MAX_VALUE,Integer.MAX_VALUE)
- );
- return glue;
- }
-
- public static Box createHorizontalBox()
- {
- return new Box(BoxLayout.X_AXIS);
- }
-
- /**
- * Creates a filler component which acts as glue between components.
- * It does not take space unless some extra space is available. If extra
- * space is available, this component can expand in the X direction.
- *
- * @return a glue-like filler component.
- */
- public static Component createHorizontalGlue()
- {
- return createGlue();
- }
-
- /**
- * Creates a filler component which acts as strut between components.
- * It will fill exactly the specified horizontal size.
- *
- * @param width the width of this strut in pixels.
- *
- * @return a strut-like filler component.
- */
- public static Component createHorizontalStrut(int width)
- {
- Filler strut = new Filler(new Dimension(width, 0),
- new Dimension(width, 0),
- new Dimension(width, Integer.MAX_VALUE));
- return strut;
- }
-
- public static Component createRigidArea(Dimension d)
- {
- return new Filler(d, d, d);
- }
-
- public static Box createVerticalBox()
- {
- return new Box(BoxLayout.Y_AXIS);
- }
-
- /**
- * Creates a filler component which acts as glue between components.
- * It does not take space unless some extra space is available. If extra
- * space is available, this component can expand in the Y direction.
- *
- * @return a glue-like filler component.
- */
- public static Component createVerticalGlue()
- {
- return createGlue();
- }
-
- /**
- * Creates a filler component which acts as strut between components.
- * It will fill exactly the specified vertical size.
- *
- * @param height the height of this strut in pixels.
- *
- * @return a strut-like filler component.
- */
- public static Component createVerticalStrut(int height)
- {
- Filler strut = new Filler(new Dimension(0, height),
- new Dimension(0, height),
- new Dimension(Integer.MAX_VALUE, height));
- return strut;
- }
-
- public void setLayout(LayoutManager l)
- {
- throw new AWTError("Not allowed to set layout managers for boxes.");
- }
-
- public AccessibleContext getAccessibleContext()
- {
- // if (accessibleContext == null)
- // accessibleContext = new AccessibleBox();
- return accessibleContext;
- }
-
-
-}
diff --git a/libjava/javax/swing/BoxLayout.java b/libjava/javax/swing/BoxLayout.java
deleted file mode 100644
index a5ae2b71768..00000000000
--- a/libjava/javax/swing/BoxLayout.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/* BoxLayout.java -- A layout for swing components.
- Copyright (C) 2002, 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.AWTError;
-import java.awt.Component;
-import java.awt.ComponentOrientation;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.LayoutManager2;
-import java.io.Serializable;
-
-/**
- * A layout for swing components.
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public class BoxLayout implements LayoutManager2, Serializable
-{
- /**
- * Specifies that components are laid out left to right.
- */
- public static final int X_AXIS = 0;
-
- /**
- * Specifies that components are laid out top to bottom.
- */
- public static final int Y_AXIS = 1;
-
- /**
- * Specifies that components are laid out in the direction of a line of text.
- */
- public static final int LINE_AXIS = 2;
-
- /**
- * Sepcifies that components are laid out in the direction of the line flow.
- */
- public static final int PAGE_AXIS = 3;
-
- /*
- * Needed for serialization.
- */
- private static final long serialVersionUID = -2474455742719112368L;
-
- /*
- * The container given to the constructor.
- */
- private Container container;
-
- /*
- * Current type of component layouting. Defaults to X_AXIS.
- */
- private int way = X_AXIS;
-
- /**
- * Constructs a <code>BoxLayout</code> object.
- *
- * @param container The container that needs to be laid out.
- * @param way The orientation of the components.
- *
- * @exception AWTError If way has an invalid value.
- */
- public BoxLayout(Container container, int way)
- {
- int width = 0;
- int height = 0;
- this.container = container;
- this.way = way;
- }
-
- /**
- * Adds a component to the layout. Not used in BoxLayout.
- *
- * @param name The name of the component to add.
- * @param component the component to add to the layout.
- */
- public void addLayoutComponent(String name, Component component)
- {
- }
-
- /**
- * Removes a component from the layout. Not used in BoxLayout.
- *
- * @param component The component to remove from the layout.
- */
- public void removeLayoutComponent(Component component)
- {
- }
-
- private boolean isHorizontalIn(Container parent)
- {
- ComponentOrientation orientation = parent.getComponentOrientation();
- return this.way == X_AXIS
- || (this.way == LINE_AXIS
- && orientation.isHorizontal())
- || (this.way == PAGE_AXIS
- && (!orientation.isHorizontal()));
- }
-
-
-
- /**
- * Returns the preferred size of the layout.
- *
- * @param parent The container that needs to be laid out.
- *
- * @return The dimension of the layout.
- */
- public Dimension preferredLayoutSize(Container parent)
- {
- if (parent != container)
- throw new AWTError("invalid parent");
-
- Insets insets = parent.getInsets();
- int x = 0;
- int y = 0;
-
- Component[] children = parent.getComponents();
-
- if (isHorizontalIn(parent))
- {
- x = insets.left + insets.right;
- // sum up preferred widths of components, find maximum of preferred
- // heights
- for (int index = 0; index < children.length; index++)
- {
- Component comp = children[index];
- Dimension sz = comp.getPreferredSize();
- x += sz.width;
- y = Math.max(y, sz.height);
- }
- y += insets.bottom + insets.top;
- }
- else
- {
- y = insets.top + insets.bottom;
- // sum up preferred heights of components, find maximum of
- // preferred widths
- for (int index = 0; index < children.length; index++)
- {
- Component comp = children[index];
- Dimension sz = comp.getPreferredSize();
- y += sz.height;
- x = Math.max(x, sz.width);
- }
- x += insets.left + insets.right;
- }
-
- return new Dimension(x, y);
- }
-
- /**
- * Returns the minimum size of the layout.
- *
- * @param parent The container that needs to be laid out.
- *
- * @return The dimension of the layout.
- */
- public Dimension minimumLayoutSize(Container parent)
- {
- if (parent != container)
- throw new AWTError("invalid parent");
-
- Insets insets = parent.getInsets();
- int x = insets.left + insets.right;
- int y = insets.bottom + insets.top;
-
- Component[] children = parent.getComponents();
-
- if (isHorizontalIn(parent))
- {
- // sum up preferred widths of components, find maximum of preferred
- // heights
- for (int index = 0; index < children.length; index++)
- {
- Component comp = children[index];
- Dimension sz = comp.getMinimumSize();
- x += sz.width;
- y = Math.max(y, sz.height);
- }
- }
- else
- {
- // sum up preferred heights of components, find maximum of
- // preferred widths
- for (int index = 0; index < children.length; index++)
- {
- Component comp = children[index];
- Dimension sz = comp.getMinimumSize();
- y += sz.height;
- x = Math.max(x, sz.width);
- }
- }
-
- return new Dimension(x, y);
- }
-
- /**
- * Lays out the specified container using this layout.
- *
- * @param parent The container that needs to be laid out.
- */
- public void layoutContainer(Container parent)
- {
- if (parent != container)
- throw new AWTError("invalid parent");
-
- Dimension size = parent.getSize();
- Insets insets = parent.getInsets();
- Dimension innerSize = new Dimension(size.width - insets.left
- - insets.right, size.height
- - insets.bottom - insets.top);
- Component[] children = parent.getComponents();
- boolean[] laidOut = new boolean[children.length];
- for (int index = 0; index < laidOut.length; index++)
- laidOut[index] = false;
-
- if (isHorizontalIn(parent))
- {
- // compute overall preferred width
- int preferredWidthAll = 0;
- for (int index = 0; index < children.length; index++)
- {
- preferredWidthAll += children[index].getPreferredSize().width;
- }
- double widthFactor = (double) innerSize.width /
- (double) preferredWidthAll;
-
- // sort out components that are constrained by minimum or maximum size
- int widthRemain = innerSize.width;
- for (int index = 0; index < children.length; index++)
- {
- Component comp = children[index];
- Dimension sz = comp.getPreferredSize();
- Dimension minSize = comp.getMinimumSize();
- Dimension maxSize = comp.getMaximumSize();
- int width = (int) (sz.width * widthFactor);
- int height = Math.min(innerSize.height, maxSize.height);
- // check min size
- if (width < minSize.width)
- {
- width = minSize.width;
- comp.setSize(width, height);
- laidOut[index] = true;
- preferredWidthAll -= sz.width;
- widthRemain -= width;
- continue;
- }
- // check max size
- if (width > maxSize.width)
- {
- width = maxSize.width;
- comp.setSize(width, height);
- laidOut[index] = true;
- preferredWidthAll -= sz.width;
- widthRemain -= width;
- continue;
- }
-
- }
-
- // recompute widthFactor for remaining components
- widthFactor = (double) widthRemain / (double) preferredWidthAll;
-
- int x = insets.left;
-
- // lay out remaining comonents
- for (int index = 0; index < children.length; index++)
- {
- Component comp = children[index];
- int width = 0;
-
- if (!laidOut[index])
- {
- Dimension sz = comp.getPreferredSize();
- Dimension maxSize = comp.getMaximumSize();
- width = (int) (sz.width * widthFactor);
- int height = Math.min(innerSize.height, maxSize.height);
- comp.setSize(width, height);
- }
- else
- width = comp.getWidth();
-
- int cy = (int) ((innerSize.height - comp.getHeight())
- * comp.getAlignmentY() + insets.top);
- comp.setLocation(x, cy);
- x = x + width;
- }
- }
- else
- {
- // compute overall preferred height
- int preferredHeightAll = 0;
- for (int index = 0; index < children.length; index++)
- {
- preferredHeightAll += children[index].getPreferredSize().height;
- }
- double heightFactor = (double) innerSize.height /
- (double) preferredHeightAll;
-
- // sort out components that are constrained by minimum or maximum size
- int heightRemain = innerSize.height;
- for (int index = 0; index < children.length; index++)
- {
- Component comp = children[index];
- Dimension sz = comp.getPreferredSize();
- Dimension minSize = comp.getMinimumSize();
- Dimension maxSize = comp.getMaximumSize();
- int height = (int) (sz.height * heightFactor);
- int width = Math.min(innerSize.width, maxSize.width);
- // check min size
- if (height < minSize.height)
- {
- height = minSize.height;
- comp.setSize(width, height);
- laidOut[index] = true;
- preferredHeightAll -= sz.height;
- heightRemain -= height;
- continue;
- }
- // check max size
- if (height > maxSize.height)
- {
- height = maxSize.height;
- comp.setSize(width, height);
- laidOut[index] = true;
- preferredHeightAll -= sz.height;
- heightRemain -= height;
- continue;
- }
-
- }
-
- // recompute heightFactor for remaining components
- heightFactor = (double) heightRemain / (double) preferredHeightAll;
-
- int y = insets.top;
-
- // lay out remaining comonents
- for (int index = 0; index < children.length; index++)
- {
- Component comp = children[index];
- int height = 0;
-
- if (!laidOut[index])
- {
- Dimension sz = comp.getPreferredSize();
- Dimension maxSize = comp.getMaximumSize();
- height = (int) (sz.height * heightFactor);
- int width = Math.min(innerSize.width, maxSize.width);
- comp.setSize(width, height);
- }
- else
- height = comp.getHeight();
-
- int cx = (int) ((innerSize.width - comp.getWidth())
- * comp.getAlignmentX() + insets.left);
- comp.setLocation(cx, y);
- y = y + height;
- }
- }
- }
-
- /**
- * Adds a component to the layout. Not used in BoxLayout
- *
- * @param child The component to add to the layout.
- * @param constraints The constraints for the component in the layout.
- */
- public void addLayoutComponent(Component child, Object constraints)
- {
- }
-
- /**
- * Returns the alignment along the X axis for the container.
- *
- * @param parent The container that needs to be laid out.
- *
- * @return The alignment.
- */
- public float getLayoutAlignmentX(Container parent)
- {
- if (parent != container)
- throw new AWTError("invalid parent");
-
- return 0;
- }
-
- /**
- * Returns the alignment along the Y axis for the container.
- *
- * @param parent The container that needs to be laid out.
- *
- * @return The alignment.
- */
- public float getLayoutAlignmentY(Container parent)
- {
- if (parent != container)
- throw new AWTError("invalid parent");
-
- return 0;
- }
-
- /**
- * Invalidates the layout.
- *
- * @param parent The container that needs to be laid out.
- */
- public void invalidateLayout(Container parent)
- {
- if (parent != container)
- throw new AWTError("invalid parent");
- }
-
- /**
- * Returns the maximum size of the layout gived the components
- * in the given container.
- *
- * @param parent The container that needs to be laid out.
- *
- * @return The dimension of the layout.
- */
- public Dimension maximumLayoutSize(Container parent)
- {
- if (parent != container)
- throw new AWTError("invalid parent");
-
- Insets insets = parent.getInsets();
- int x = insets.left + insets.right;
- int y = insets.top + insets.bottom;
-
- Component[] children = parent.getComponents();
-
- if (isHorizontalIn(parent))
- {
-
- // sum up preferred widths of components, find maximum of preferred
- // heights
- for (int index = 0; index < children.length; index++)
- {
- Component comp = children[index];
- Dimension sz = comp.getMaximumSize();
- x += sz.width;
- y = Math.max(y, sz.height);
- }
- }
- else
- {
- // sum up preferred heights of components, find maximum of
- // preferred widths
- for (int index = 0; index < children.length; index++)
- {
- Component comp = children[index];
- Dimension sz = comp.getMaximumSize();
- y += sz.height;
- x = Math.max(x, sz.width);
- }
- }
- return new Dimension(x, y);
- }
-}
diff --git a/libjava/javax/swing/ButtonGroup.java b/libjava/javax/swing/ButtonGroup.java
deleted file mode 100644
index 8a7cc532c06..00000000000
--- a/libjava/javax/swing/ButtonGroup.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/* ButtonGroup.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Enumeration;
-import java.util.Vector;
-
-
-/**
- * DOCUMENT ME!
- */
-public class ButtonGroup implements Serializable
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 4259076101881721375L;
-
- /** The buttons added to this button group. */
- protected Vector buttons = new Vector();
-
- /** The currently selected button model. */
- ButtonModel sel;
-
- /**
- * Creates a new button group.
- */
- public ButtonGroup()
- {
- }
-
- /**
- * Adds a button to this group.
- *
- * @param b the button to add
- */
- public void add(AbstractButton b)
- {
- b.getModel().setGroup(this);
- buttons.addElement(b);
- }
-
- /**
- * Removed a given button from this group.
- *
- * @param b the button to remove
- */
- public void remove(AbstractButton b)
- {
- b.getModel().setGroup(null);
- buttons.removeElement(b);
- }
-
- /**
- * Returns the currently added buttons.
- *
- * @return <code>Enumeration</code> over all added buttons
- */
- public Enumeration getElements()
- {
- return buttons.elements();
- }
-
- /**
- * Returns the currently selected button model.
- *
- * @return the currently selected button model, null if none was selected
- * yet
- */
- public ButtonModel getSelection()
- {
- return sel;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param m DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- AbstractButton FindButton(ButtonModel m)
- {
- for (int i = 0; i < buttons.size(); i++)
- {
- AbstractButton a = (AbstractButton) buttons.get(i);
- if (a.getModel() == m)
- return a;
- }
- return null;
- }
-
- /**
- * Sets the currently selected button model. Only one button of a group can
- * be selected at a time.
- *
- * @param m the model to select
- * @param b true if this button is to be selected, false otherwise
- */
- public void setSelected(ButtonModel m, boolean b)
- {
- if ((sel != m || b) && (! b || sel == m))
- return;
-
- if (b && sel != m)
- {
- ButtonModel old = sel;
- sel = m;
-
- if (old != null)
- old.setSelected(false);
- AbstractButton button = FindButton(old);
- if (button != null)
- button.repaint();
- }
- else if (! b && sel == m)
- m.setSelected(true);
- }
-
- /**
- * Checks if the given <code>ButtonModel</code> is selected in this button
- * group.
- *
- * @param m DOCUMENT ME!
- *
- * @return true of given <code>ButtonModel</code> is selected, false
- * otherwise
- */
- public boolean isSelected(ButtonModel m)
- {
- return m == sel;
- }
-
- /**
- * Return the number of buttons in this button group.
- *
- * @return the number of buttons
- *
- * @since 1.3
- */
- public int getButtonCount()
- {
- return buttons.size();
- }
-}
diff --git a/libjava/javax/swing/ButtonModel.java b/libjava/javax/swing/ButtonModel.java
deleted file mode 100644
index 31b6de2f686..00000000000
--- a/libjava/javax/swing/ButtonModel.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* ButtonModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.ItemSelectable;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemListener;
-
-import javax.swing.event.ChangeListener;
-
-public interface ButtonModel extends ItemSelectable
-{
- boolean isArmed();
- void setArmed(boolean b);
-
-
- boolean isEnabled();
- void setEnabled(boolean b);
-
- void setPressed(boolean b);
- boolean isPressed();
-
-
- void removeActionListener(ActionListener l);
- void addActionListener(ActionListener l);
-
- void addItemListener(ItemListener l);
- void removeItemListener(ItemListener l);
-
- void addChangeListener(ChangeListener l);
- void removeChangeListener(ChangeListener l);
-
- void setRollover(boolean b);
- boolean isRollover();
-
- int getMnemonic();
- void setMnemonic(int key);
-
- void setActionCommand(String s);
- String getActionCommand();
-
- void setGroup(ButtonGroup group);
-
- void setSelected(boolean b);
- boolean isSelected();
-}
diff --git a/libjava/javax/swing/CellEditor.java b/libjava/javax/swing/CellEditor.java
deleted file mode 100644
index ec42afdc678..00000000000
--- a/libjava/javax/swing/CellEditor.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* CellEditor.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util.EventObject;
-
-import javax.swing.event.CellEditorListener;
-
-/**
- * CellEditor
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface CellEditor
-{
- /**
- * getCellEditorValue
- * @returns Object
- */
- Object getCellEditorValue();
-
- /**
- * isCellEditable
- * @param event TODO
- * @returns boolean
- */
- boolean isCellEditable(EventObject event);
-
- /**
- * shouldSelectCell
- * @param event TODO
- * @returns boolean
- */
- boolean shouldSelectCell(EventObject event);
-
- /**
- * stopCellEditing
- * @returns boolean
- */
- boolean stopCellEditing();
-
- /**
- * cancelCellEditing
- */
- void cancelCellEditing();
-
- /**
- * addCellEditorListener
- * @param value0 TODO
- */
- void addCellEditorListener(CellEditorListener listener);
-
- /**
- * removeCellEditorListener
- * @param listener TODO
- */
- void removeCellEditorListener(CellEditorListener listener);
-
-} // CellEditor
diff --git a/libjava/javax/swing/CellRendererPane.java b/libjava/javax/swing/CellRendererPane.java
deleted file mode 100644
index c93e9f54bff..00000000000
--- a/libjava/javax/swing/CellRendererPane.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/* CellRendererPane.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * The CellRendererPane's purpose is to paint the cells of JList, JTable and
- * JTree. It intercepts the usual paint tree, so that we don't walk up and
- * repaint everything.
- *
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class CellRendererPane
- extends Container
- implements Accessible
-{
- private static final long serialVersionUID = -7642183829532984273L;
-
- /**
- * AccessibleCellRendererPane
- */
- protected class AccessibleCellRendererPane extends AccessibleAWTContainer
- {
- private static final long serialVersionUID = -8981090083147391074L;
-
- /**
- * Constructor AccessibleCellRendererPane
- * @param component TODO
- */
- protected AccessibleCellRendererPane()
- {
- }
-
- /**
- * getAccessibleRole
- * @returns AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.PANEL;
- }
- }
-
- /**
- * accessibleContext
- */
- protected AccessibleContext accessibleContext = null;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructs a new CellRendererPane.
- */
- public CellRendererPane()
- {
- } // CellRendererPane()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Should not be called.
- *
- * @param graphics not used here
- */
- public void update(Graphics graphics)
- {
- } // update()
-
- /**
- * Despite normal behaviour this does <em>not</em> cause the container
- * to be invalidated. This prevents propagating up the paint tree.
- */
- public void invalidate()
- {
- } // invalidate()
-
- /**
- * Should not be called.
- *
- * @param graphics not used here
- */
- public void paint(Graphics graphics)
- {
- }
-
- /**
- * Overridden to check if a component is already a child of this Container.
- * If it's already a child, nothing is done. Otherwise we pass this to
- * <code>super.addImpl()</code>.
- *
- * @param c the component to add
- * @param constraints not used here
- * @param index not used here
- */
- protected void addImpl(Component c, Object constraints, int index)
- {
- if (!isAncestorOf(c))
- {
- super.addImpl(c, constraints, index);
- }
- } // addImpl()
-
- /**
- * Paints the specified component <code>c</code> on the {@link Graphics}
- * context <code>graphics</code>. The Graphics context is tranlated to
- * (x,y) and the components bounds are set to (w,h). If
- * <code>shouldValidate</code>
- * is set to true, then the component is validated before painting.
- *
- * @param graphics the graphics context to paint on
- * @param c the component to be painted
- * @param p the parent of the component
- * @param x the X coordinate of the upper left corner where c should
- be painted
- * @param y the Y coordinate of the upper left corner where c should
- be painted
- * @param w the width of the components drawing area
- * @param h the height of the components drawing area
- * @param shouldValidate if <code>c</code> should be validated before
- * painting
- */
- public void paintComponent(Graphics graphics, Component c,
- Container p, int x, int y, int w, int h,
- boolean shouldValidate)
- {
- // reparent c
- addImpl(c, null, 0);
-
- // translate to (x,y)
- graphics.translate(x, y);
-
- // set bounds of c
- c.setBounds(0, 0, w, h);
-
- // validate if necessary
- if (shouldValidate)
- {
- c.validate();
- }
-
- // paint component
- c.paint(graphics);
-
- // untranslate g
- graphics.translate(-x, -y);
-
- } // paintComponent()
-
- /**
- * Paints the specified component <code>c</code> on the {@link Graphics}
- * context <code>graphics</code>. The Graphics context is tranlated to (x,y)
- * and the components bounds are set to (w,h). The component is <em>not</em>
- * validated before painting.
- *
- * @param graphics the graphics context to paint on
- * @param c the component to be painted
- * @param p the parent of the component
- * @param x the X coordinate of the upper left corner where c should
- be painted
- * @param y the Y coordinate of the upper left corner where c should
- be painted
- * @param w the width of the components drawing area
- * @param h the height of the components drawing area
- */
- public void paintComponent(Graphics graphics, Component c,
- Container p, int x, int y, int w, int h) {
-
- paintComponent(graphics, c, p, x, y, w, h, false);
-
- } // paintComponent()
-
- /**
- * Paints the specified component <code>c</code> on the {@link Graphics}
- * context <code>g</code>. The Graphics context is tranlated to (r.x,r.y) and
- * the components bounds are set to (r.width,r.height).
- * The component is <em>not</em>
- * validated before painting.
- *
- * @param graphics the graphics context to paint on
- * @param c the component to be painted
- * @param p the component on which we paint
- * @param r the bounding rectangle of c
- */
- public void paintComponent(Graphics graphics, Component c,
- Container p, Rectangle r)
- {
-
- paintComponent(graphics, c, p, r.x, r.y, r.width, r.height);
-
- } // paintComponent()
-
- /**
- * getAccessibleContext <em>TODO</em>
- * @return AccessibleContext
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleCellRendererPane();
-
- return accessibleContext;
- }
-}
diff --git a/libjava/javax/swing/ComboBoxEditor.java b/libjava/javax/swing/ComboBoxEditor.java
deleted file mode 100644
index c2dad698e36..00000000000
--- a/libjava/javax/swing/ComboBoxEditor.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ComboBoxEditor.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.event.ActionListener;
-
-/**
- * ComboBoxEditor
- *
- * @author Andrew Selkirk
- * @author Olga Rodimina
- * @version 1.0
- */
-public interface ComboBoxEditor
-{
- /**
- * This method returns component that will be used by the combo box to
- * display/edit currently selected item in the combo box.
- *
- * @return Component that will be used by the combo box to display/edit
- * currently selected item
- */
- Component getEditorComponent();
-
- /**
- * Sets item that should be editted when any editting operation is performed
- * by the user. The value is always equal to the currently selected value
- * in the combo box. Thus, whenever a different value is selected from the
- * combo box list then this method should be called to change editting item
- * to the new selected item.
- *
- * @param selectedItem item that is currently selected in the combo box
- */
- void setItem(Object item);
-
- /**
- * This method returns item that is currently editable.
- *
- * @return Item in the combo box that is currently editable
- */
- Object getItem();
-
- /**
- * selectAll
- */
- void selectAll();
-
- /**
- * This method adds specified ActionListener to this ComboBoxEditor.
- *
- * @param listener
- */
- void addActionListener(ActionListener listener);
-
- /**
- * This method removes given ActionListener from this ComboBoxEditor.
- *
- * @param listener TODO
- */
- void removeActionListener(ActionListener listener);
-} // ComboBoxEditor
diff --git a/libjava/javax/swing/ComboBoxModel.java b/libjava/javax/swing/ComboBoxModel.java
deleted file mode 100644
index 6b2382819fa..00000000000
--- a/libjava/javax/swing/ComboBoxModel.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ComboBoxModel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-
-/**
- * ComboBoxModel is a data model for JComboBox. This model keeps
- * track of elements contained in the JComboBox as well as the current
- * combo box selection. Whenever selection in the JComboBox changes, the
- * ComboBoxModel should fire ListDataEvents to ComboBox's ListDataListeners.
- *
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface ComboBoxModel extends ListModel
-{
- /**
- * This method sets the selected item in the combo box. Class
- * implementing this interface should fire ListDataEvents to
- * all registered ListDataListeners to indicated that the
- * selection has changed.
- *
- * @param item item in the combo box that should be selected
- */
- void setSelectedItem(Object item);
-
- /**
- * The method returns currently selected item in the combo box
- *
- * @returns item that is currently selected in the combo box.
- */
- Object getSelectedItem();
-} // ComboBoxModel
diff --git a/libjava/javax/swing/ComponentInputMap.java b/libjava/javax/swing/ComponentInputMap.java
deleted file mode 100644
index 4ecc0585267..00000000000
--- a/libjava/javax/swing/ComponentInputMap.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* ComponentInputMap.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-
-/**
- * @author Andrew Selkirk
- * @author Michael Koch
- */
-public class ComponentInputMap extends InputMap
-{
- /**
- * The component to notify.
- */
- private JComponent component;
-
- /**
- * Creates <code>ComponentInputMap</code> object that notifies the given
- * component about changes to it.
- *
- * @param comp the component to notify
- *
- * @exception IllegalArgumentException if comp is null
- */
- public ComponentInputMap(JComponent comp)
- {
- if (comp == null)
- throw new IllegalArgumentException();
-
- this.component = comp;
- }
-
- /**
- * Puts a new entry into the <code>InputMap</code>.
- * If actionMapKey is null an existing entry will be removed.
- *
- * @param keystroke the keystroke for the entry
- * @param actionMapKey the action.
- */
- public void put(KeyStroke keystroke, Object value)
- {
- super.put(keystroke, value);
- // FIXME: Notify component.
- }
-
- /**
- * Clears the <code>InputMap</code>.
- */
- public void clear()
- {
- super.clear();
- // FIXME: Notify component.
- }
-
- /**
- * Remove an entry from the <code>InputMap</code>.
- *
- * @param key the key of the entry to remove
- */
- public void remove(KeyStroke keystroke)
- {
- super.remove(keystroke);
- // FIXME: Notify component.
- }
-
- /**
- * Sets a parent for this <code>ComponentInputMap</code>.
- *
- * @param parentMap the new parent
- *
- * @exception IllegalArgument if parentMap is not a
- * <code>ComponentInputMap</code> or not associated with the same component
- */
- public void setParent(InputMap parentMap)
- {
- if (! (parentMap instanceof ComponentInputMap))
- throw new IllegalArgumentException();
-
- if (((ComponentInputMap) parentMap).getComponent() != component)
- throw new IllegalArgumentException();
-
- super.setParent(parentMap);
- // FIXME: Notify component.
- }
-
- /**
- * Returns the component to notify about changes.
- *
- * @return a <code>JComponent</code> object
- */
- public JComponent getComponent()
- {
- return component;
- }
-}
diff --git a/libjava/javax/swing/DebugGraphics.java b/libjava/javax/swing/DebugGraphics.java
deleted file mode 100644
index 22e44f9ed31..00000000000
--- a/libjava/javax/swing/DebugGraphics.java
+++ /dev/null
@@ -1,885 +0,0 @@
-/* DebugGraphics.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Color;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Image;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.awt.image.ImageObserver;
-import java.io.PrintStream;
-import java.text.AttributedCharacterIterator;
-
-
-/**
- * DebugGraphics
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class DebugGraphics extends Graphics
-{
- /**
- * LOG_OPTION
- */
- public static final int LOG_OPTION = 1;
-
- /**
- * FLASH_OPTION
- */
- public static final int FLASH_OPTION = 2;
-
- /**
- * BUFFERED_OPTION
- */
- public static final int BUFFERED_OPTION = 4;
-
- /**
- * NONE_OPTION
- */
- public static final int NONE_OPTION = -1;
-
- static Color debugFlashColor = Color.RED;
- static int debugFlashCount = 10;
- static int debugFlashTime = 1000;
- static PrintStream debugLogStream = System.out;
-
- /**
- * graphics
- */
- Graphics graphics;
-
- /**
- * color
- */
- Color color = Color.BLACK;
-
- /**
- * buffer
- */
- Image buffer;
-
- /**
- * debugOptions
- */
- int debugOptions;
-
- /**
- * graphicsID
- */
- int graphicsID;
-
- /**
- * xOffset
- */
- int xOffset;
-
- /**
- * yOffset
- */
- int yOffset;
-
- /**
- * Creates a <code>DebugGraphics</code> object.
- */
- public DebugGraphics()
- {
- // TODO
- }
-
- /**
- * Creates a <code>DebugGraphics</code> object.
- *
- * @param graphics The <code>Graphics</code> object to wrap
- * @param component TODO
- */
- public DebugGraphics(Graphics graphics, JComponent component)
- {
- this.graphics = graphics;
- // FIXME: What shall we do with component ?
- }
-
- /**
- * Creates a <code>DebugGraphics</code> object.
- *
- * @param graphics The <code>Graphics</code> object to wrap
- */
- public DebugGraphics(Graphics graphics)
- {
- this.graphics = graphics;
- }
-
- /**
- * Sets the color to draw stuff with.
- *
- * @param color The color
- */
- public void setColor(Color color)
- {
- this.color = color;
- }
-
- /**
- * Creates a overrides <code>Graphics.create</code> to create a
- * <code>DebugGraphics</code> object.
- *
- * @return a new <code>DebugGraphics</code> object.
- */
- public Graphics create()
- {
- return new DebugGraphics(graphics.create());
- }
-
- /**
- * Creates a overrides <code>Graphics.create</code> to create a
- * <code>DebugGraphics</code> object.
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param width the width
- * @param height the height
- *
- * @return a new <code>DebugGraphics</code> object.
- */
- public Graphics create(int x, int y, int width, int height)
- {
- return new DebugGraphics(graphics.create(x, y, width, height));
- }
-
- /**
- * flashColor
- *
- * @return Color
- */
- public static Color flashColor()
- {
- return debugFlashColor;
- }
-
- /**
- * setFlashColor
- *
- * @param color the color to use for flashing
- */
- public static void setFlashColor(Color color)
- {
- debugFlashColor = color;
- }
-
- /**
- * flashTime
- *
- * @return The time in milliseconds
- */
- public static int flashTime()
- {
- return debugFlashTime;
- }
-
- /**
- * setFlashTime
- *
- * @param time The time in milliseconds
- */
- public static void setFlashTime(int time)
- {
- debugFlashTime = time;
- }
-
- /**
- * flashCount
- *
- * @return The number of flashes
- */
- public static int flashCount()
- {
- return debugFlashCount;
- }
-
- /**
- * setFlashCount
- *
- * @param count The number of flashes
- */
- public static void setFlashCount(int count)
- {
- debugFlashCount = count;
- }
-
- /**
- * logStream
- *
- * @return The <code>PrintStream</code> to write logging messages to
- */
- public static PrintStream logStream()
- {
- return debugLogStream;
- }
-
- /**
- * setLogStream
- *
- * @param stream The currently set <code>PrintStream</code>.
- */
- public static void setLogStream(PrintStream stream)
- {
- debugLogStream = stream;
- }
-
- /**
- * getFont
- *
- * @return The font
- */
- public Font getFont()
- {
- return graphics.getFont();
- }
-
- /**
- * setFont
- *
- * @param font The font to use for drawing text
- */
- public void setFont(Font font)
- {
- graphics.setFont(font);
- }
-
- /**
- * Returns the color used for drawing.
- *
- * @return The color.
- */
- public Color getColor()
- {
- return color;
- }
-
- /**
- * Returns the font metrics of the current font.
- *
- * @return a <code>FontMetrics</code> object
- */
- public FontMetrics getFontMetrics()
- {
- return graphics.getFontMetrics();
- }
-
- /**
- * Returns the font metrics for a given font.
- *
- * @param font the font to get the metrics for
- *
- * @return a <code>FontMetrics</code> object
- */
- public FontMetrics getFontMetrics(Font font)
- {
- return graphics.getFontMetrics(font);
- }
-
- /**
- * translate
- *
- * @param x the x coordinate
- * @param y the y coordinate
- */
- public void translate(int x, int y)
- {
- graphics.translate(x, y);
- }
-
- /**
- * setPaintMode
- */
- public void setPaintMode()
- {
- graphics.setPaintMode();
- }
-
- /**
- * setXORMode
- *
- * @param color the color
- */
- public void setXORMode(Color color)
- {
- graphics.setXORMode(color);
- }
-
- /**
- * getClipBounds
- *
- * @return Rectangle
- */
- public Rectangle getClipBounds()
- {
- return graphics.getClipBounds();
- }
-
- /**
- * Intersects the current clip region with the given region.
- *
- * @param x The x-position of the region
- * @param y The y-position of the region
- * @param width The width of the region
- * @param height The height of the region
- */
- public void clipRect(int x, int y, int width, int height)
- {
- graphics.clipRect(x, y, width, height);
- }
-
- /**
- * Sets the clipping region.
- *
- * @param x The x-position of the region
- * @param y The y-position of the region
- * @param width The width of the region
- * @param height The height of the region
- */
- public void setClip(int x, int y, int width, int height)
- {
- graphics.setClip(x, y, width, height);
- }
-
- /**
- * Returns the current clipping region.
- *
- * @return Shape
- */
- public Shape getClip()
- {
- return graphics.getClip();
- }
-
- /**
- * Sets the current clipping region
- *
- * @param shape The clippin region
- */
- public void setClip(Shape shape)
- {
- graphics.setClip(shape);
- }
-
- private void sleep(int milliseconds)
- {
- try
- {
- Thread.sleep(milliseconds);
- }
- catch (InterruptedException e)
- {
- // Ignore this.
- }
- }
-
- /**
- * Draws a rectangle.
- *
- * @param x The x-position of the rectangle
- * @param y The y-position of the rectangle
- * @param width The width of the rectangle
- * @param height The height of the rectangle
- */
- public void drawRect(int x, int y, int width, int height)
- {
- for (int index = 0; index < (debugFlashCount - 1); ++index)
- {
- graphics.setColor(color);
- graphics.drawRect(x, y, width, height);
- sleep(debugFlashTime);
-
- graphics.setColor(debugFlashColor);
- graphics.drawRect(x, y, width, height);
- sleep(debugFlashTime);
- }
-
- graphics.setColor(color);
- graphics.drawRect(x, y, width, height);
- }
-
- /**
- * Draws a filled rectangle.
- *
- * @param x The x-position of the rectangle
- * @param y The y-position of the rectangle
- * @param width The width of the rectangle
- * @param height The height of the rectangle
- */
- public void fillRect(int x, int y, int width, int height)
- {
- for (int index = 0; index < (debugFlashCount - 1); ++index)
- {
- graphics.setColor(color);
- graphics.fillRect(x, y, width, height);
- sleep(debugFlashTime);
-
- graphics.setColor(debugFlashColor);
- graphics.fillRect(x, y, width, height);
- sleep(debugFlashTime);
- }
-
- graphics.setColor(color);
- graphics.fillRect(x, y, width, height);
- }
-
- /**
- * clearRect
- *
- * @param x The x-position of the rectangle
- * @param y The y-position of the rectangle
- * @param width The width of the rectangle
- * @param height The height of the rectangle
- */
- public void clearRect(int x, int y, int width, int height)
- {
- graphics.clearRect(x, y, width, height);
- }
-
- /**
- * drawRoundRect
- *
- * @param x The x-position of the rectangle
- * @param y The y-position of the rectangle
- * @param width The width of the rectangle
- * @param height The height of the rectangle
- * @param arcWidth TODO
- * @param arcHeight TODO
- */
- public void drawRoundRect(int x, int y, int width, int height,
- int arcWidth, int arcHeight)
- {
- graphics.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
- }
-
- /**
- * fillRoundRect
- *
- * @param x The x-position of the rectangle
- * @param y The y-position of the rectangle
- * @param width The width of the rectangle
- * @param height The height of the rectangle
- * @param arcWidth TODO
- * @param arcHeight TODO
- */
- public void fillRoundRect(int x, int y, int width, int height,
- int arcWidth, int arcHeight)
- {
- graphics.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
- }
-
- /**
- * drawLine
- *
- * @param x1 The x-position of the start
- * @param y1 The y-position of the start
- * @param x2 The x-position of the end
- * @param y2 The y-position of the end
- */
- public void drawLine(int x1, int y1, int x2, int y2)
- {
- graphics.drawLine(x1, y1, x2, y2);
- }
-
- /**
- * draw3DRect
- *
- * @param x The x-position of the rectangle
- * @param y The y-position of the rectangle
- * @param width The width of the rectangle
- * @param height The height of the rectangle
- * @param raised TODO
- */
- public void draw3DRect(int x, int y, int width, int height, boolean raised)
- {
- graphics.draw3DRect(x, y, width, height, raised);
- }
-
- /**
- * fill3DRect
- *
- * @param x The x-position of the rectangle
- * @param y The y-position of the rectangle
- * @param width The width of the rectangle
- * @param height The height of the rectangle
- * @param raised TODO
- */
- public void fill3DRect(int x, int y, int width, int height, boolean raised)
- {
- graphics.fill3DRect(x, y, width, height, raised);
- }
-
- /**
- * drawOval
- *
- * @param x the x coordinate
- * @param y the y coordiante
- * @param width the width
- * @param height the height
- */
- public void drawOval(int x, int y, int width, int height)
- {
- graphics.drawOval(x, y, width, height);
- }
-
- /**
- * fillOval
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param width the width
- * @param height the height
- */
- public void fillOval(int x, int y, int width, int height)
- {
- graphics.fillOval(x, y, width, height);
- }
-
- /**
- * drawArc
- *
- * @param x the x coordinate
- * @param y the y coordinate
- * @param width the width
- * @param height the height
- * @param startAngle TODO
- * @param arcAngle TODO
- */
- public void drawArc(int x, int y, int width, int height,
- int startAngle, int arcAngle)
- {
- graphics.drawArc(x, y, width, height, startAngle, arcAngle);
- }
-
- /**
- * fillArc
- *
- * @param x the coordinate
- * @param y the y coordinate
- * @param width the width
- * @param height the height
- * @param startAngle TODO
- * @param arcAngle TODO
- */
- public void fillArc(int x, int y, int width, int height,
- int startAngle, int arcAngle)
- {
- graphics.fillArc(x, y, width, height, startAngle, arcAngle);
- }
-
- /**
- * drawPolyline
- *
- * @param xpoints TODO
- * @param ypoints TODO
- * @param npoints TODO
- */
- public void drawPolyline(int[] xpoints, int[] ypoints, int npoints)
- {
- graphics.drawPolyline(xpoints, ypoints, npoints);
- }
-
- /**
- * drawPolygon
- *
- * @param xpoints TODO
- * @param ypoints TODO
- * @param npoints TODO
- */
- public void drawPolygon(int[] xpoints, int[] ypoints, int npoints)
- {
- graphics.drawPolygon(xpoints, ypoints, npoints);
- }
-
- /**
- * fillPolygon
- *
- * @param xpoints TODO
- * @param ypoints TODO
- * @param npoints TODO
- */
- public void fillPolygon(int[] xpoints, int[] ypoints, int npoints)
- {
- graphics.fillPolygon(xpoints, ypoints, npoints);
- }
-
- /**
- * drawString
- *
- * @param string the string
- * @param x the x coordinate
- * @param y the y coordinate
- */
- public void drawString(String string, int x, int y)
- {
- graphics.drawString(string, x, y);
- }
-
- /**
- * drawString
- *
- * @param iterator TODO
- * @param x the x coordinate
- * @param y the y coordinate
- */
- public void drawString(AttributedCharacterIterator iterator,
- int x, int y)
- {
- graphics.drawString(iterator, x, y);
- }
-
- /**
- * drawBytes
- *
- * @param data TODO
- * @param offset TODO
- * @param length TODO
- * @param x the x coordinate
- * @param y the y coordinate
- */
- public void drawBytes(byte[] data, int offset, int length,
- int x, int y)
- {
- graphics.drawBytes(data, offset, length, x, y);
- }
-
- /**
- * drawChars
- *
- * @param data array of characters to draw
- * @param offset offset in array
- * @param length number of characters in array to draw
- * @param x x-position
- * @param y y-position
- */
- public void drawChars(char[] data, int offset, int length,
- int x, int y)
- {
- for (int index = 0; index < (debugFlashCount - 1); ++index)
- {
- graphics.setColor(color);
- graphics.drawChars(data, offset, length, x, y);
- sleep(debugFlashTime);
-
- graphics.setColor(debugFlashColor);
- graphics.drawChars(data, offset, length, x, y);
- sleep(debugFlashTime);
- }
-
- graphics.setColor(color);
- graphics.drawChars(data, offset, length, x, y);
- }
-
- /**
- * drawImage
- *
- * @param image The image to draw
- * @param x The x position
- * @param y The y position
- * @param observer The image observer
- * @return boolean
- */
- public boolean drawImage(Image image, int x, int y,
- ImageObserver observer)
- {
- return graphics.drawImage(image, x, y, observer);
- }
-
- /**
- * drawImage
- *
- * @param image The image to draw
- * @param x The x position
- * @param y The y position
- * @param width The width of the area to draw the image
- * @param height The height of the area to draw the image
- * @param observer The image observer
- *
- * @return boolean
- */
- public boolean drawImage(Image image, int x, int y, int width,
- int height, ImageObserver observer)
- {
- return graphics.drawImage(image, x, y, width, height, observer);
- }
-
- /**
- * drawImage
- *
- * @param image The image to draw
- * @param x The x position
- * @param y The y position
- * @param background The color for the background in the opaque regions
- * of the image
- * @param observer The image observer
- *
- * @return boolean
- */
- public boolean drawImage(Image image, int x, int y,
- Color background, ImageObserver observer)
- {
- return graphics.drawImage(image, x, y, background, observer);
- }
-
- /**
- * drawImage
- *
- * @param image The image to draw
- * @param x The x position
- * @param y The y position
- * @param width The width of the area to draw the image
- * @param height The height of the area to draw the image
- * @param background The color for the background in the opaque regions
- * of the image
- * @param observer The image observer
- *
- * @return boolean
- */
- public boolean drawImage(Image image, int x, int y, int width, int height,
- Color background, ImageObserver observer)
- {
- return graphics.drawImage(image, x, y, width, height, background, observer);
- }
-
- /**
- * drawImage
- *
- * @param image The image to draw
- * @param dx1 TODO
- * @param dy1 TODO
- * @param dx2 TODO
- * @param dy2 TODO
- * @param sx1 TODO
- * @param sy1 TODO
- * @param sx2 TODO
- * @param sy2 TODO
- * @param observer The image observer
- *
- * @return boolean
- */
- public boolean drawImage(Image image, int dx1, int dy1,
- int dx2, int dy2, int sx1, int sy1, int sx2, int sy2,
- ImageObserver observer)
- {
- return graphics.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer);
- }
-
- /**
- * drawImage
- *
- * @param image The image to draw
- * @param dx1 TODO
- * @param dy1 TODO
- * @param dx2 TODO
- * @param dy2 TODO
- * @param sx1 TODO
- * @param sy1 TODO
- * @param sx2 TODO
- * @param sy2 TODO
- * @param background The color for the background in the opaque regions
- * of the image
- * @param observer The image observer
- *
- * @return boolean
- */
- public boolean drawImage(Image image, int dx1, int dy1,
- int dx2, int dy2, int sx1, int sy1, int sx2, int sy2,
- Color background, ImageObserver observer)
- {
- return graphics.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, background, observer);
- }
-
- /**
- * copyArea
- *
- * @param x The x position of the source area
- * @param y The y position of the source area
- * @param width The width of the area
- * @param height The height of the area
- * @param destx The x position of the destination area
- * @param desty The y posiiton of the destination area
- */
- public void copyArea(int x, int y, int width, int height,
- int destx, int desty)
- {
- graphics.copyArea(x, y, width, height, destx, desty);
- }
-
- /**
- * Releases all system resources that this <code>Graphics</code> is using.
- */
- public void dispose()
- {
- graphics.dispose();
- graphics = null;
- }
-
- /**
- * isDrawingBuffer
- *
- * @return boolean
- */
- public boolean isDrawingBuffer()
- {
- return false; // TODO
- }
-
- /**
- * setDebugOptions
- *
- * @param options the debug options
- */
- public void setDebugOptions(int options)
- {
- debugOptions = options;
- }
-
- /**
- * getDebugOptions
- *
- * @return the debug options
- */
- public int getDebugOptions()
- {
- return debugOptions;
- }
-}
diff --git a/libjava/javax/swing/DefaultBoundedRangeModel.java b/libjava/javax/swing/DefaultBoundedRangeModel.java
deleted file mode 100644
index fa38eab9c8a..00000000000
--- a/libjava/javax/swing/DefaultBoundedRangeModel.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/* DefaultBoundedRangeModel.java -- Default implementation
- of BoundedRangeModel.
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.EventListener;
-
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-/**
- * A default implementation of <code>BoundedRangeModel</code>.
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class DefaultBoundedRangeModel
- implements BoundedRangeModel, Serializable
-{
- /**
- * The identifier of this class in object serialization. Verified
- * using the serialver tool of Sun J2SE 1.4.1_01.
- */
- private static final long serialVersionUID = 5034068491295259790L;
-
-
- /**
- * An event that is sent to all registered {@link ChangeListener}s
- * when the state of this range model has changed.
- *
- * <p>The event object is created on demand, the first time it
- * is actually needed.</p>
- *
- * @see #fireStateChanged()
- */
- protected transient ChangeEvent changeEvent;
-
-
- /**
- * The list of the currently registered EventListeners.
- */
- protected EventListenerList listenerList = new EventListenerList();
-
-
- /**
- * The current value of the range model, which is always between
- * {@link #minimum} and ({@link #maximum} - {@link #extent}). In a
- * scroll bar visualization of a {@link BoundedRangeModel}, the
- * <code>value</code> is displayed as the position of the thumb.
- */
- private int value;
-
-
- /**
- * The current extent of the range model, which is a number greater
- * than or equal to zero. In a scroll bar visualization of a {@link
- * BoundedRangeModel}, the <code>extent</code> is displayed as the
- * size of the thumb.
- */
- private int extent;
-
-
- /**
- * The current minimum value of the range model, which is always
- * less than or equal to {@link #maximum}.
- */
- private int minimum;
-
-
- /**
- * The current maximum value of the range model, which is always
- * greater than or equal to {@link #minimum}.
- */
- private int maximum;
-
-
- /**
- * A property that indicates whether the value of this {@link
- * BoundedRangeModel} is going to change in the immediate future.
- */
- private boolean isAdjusting;
-
-
- /**
- * Constructs a <code>DefaultBoundedRangeModel</code> with default
- * values for the properties. The properties <code>value</code>,
- * <code>extent</code> and <code>minimum</code> will be initialized
- * to zero; <code>maximum</code> will be set to 100; the property
- * <code>valueIsAdjusting</code> will be <code>false</code>.
- */
- public DefaultBoundedRangeModel()
- {
- // The fields value, extent, minimum have the default value 0, and
- // isAdjusting is already false. These fields no not need to be
- // set explicitly.
- maximum = 100;
- }
-
-
- /**
- * Constructs a <code>DefaultBoundedRangeModel</code> with the
- * specified values for some properties.
- *
- * @param value the initial value of the range model, which must be
- * a number between <code>minimum</code> and <code>(maximum -
- * extent)</code>. In a scroll bar visualization of a {@link
- * BoundedRangeModel}, the <code>value</code> is displayed as the
- * position of the thumb.
- *
- * @param extent the initial extent of the range model, which is a
- * number greater than or equal to zero. In a scroll bar
- * visualization of a {@link BoundedRangeModel}, the
- * <code>extent</code> is displayed as the size of the thumb.
- *
- * @param minimum the initial minimal value of the range model.
- *
- * @param maximum the initial maximal value of the range model.
- *
- * @throws IllegalArgumentException if the following condition is
- * not satisfied: <code>minimum &lt;= value &lt;= value + extent &lt;=
- * maximum</code>.
- */
- public DefaultBoundedRangeModel(int value, int extent, int minimum,
- int maximum)
- {
- if (!(minimum <= value && extent >= 0 && (value + extent) <= maximum))
- throw new IllegalArgumentException();
-
- this.value = value;
- this.extent = extent;
- this.minimum = minimum;
- this.maximum = maximum;
-
- // The isAdjusting field already has a false value by default.
- }
-
-
- /**
- * Returns a string with all relevant properties of this range
- * model.
- *
- * @return a string representing the object
- */
- public String toString()
- {
- return getClass().getName()
- + "[value=" + value
- + ", extent=" + extent
- + ", min=" + minimum
- + ", max=" + maximum
- + ", adj=" + isAdjusting
- + ']';
- }
-
-
- /**
- * Returns the current value of this bounded range model. In a
- * scroll bar visualization of a {@link BoundedRangeModel}, the
- * <code>value</code> is displayed as the position of the thumb.
- *
- * @return the value
- */
- public int getValue()
- {
- return value;
- }
-
-
- /**
- * Changes the current value of this bounded range model. In a
- * scroll bar visualization of a {@link BoundedRangeModel}, the
- * <code>value</code> is displayed as the position of the thumb;
- * changing the <code>value</code> of a scroll bar's model
- * thus moves the thumb to a different position.
- *
- * @param value the value
- */
- public void setValue(int value)
- {
- value = Math.max(minimum, value);
- if (value + extent > maximum)
- value = maximum - extent;
-
- if (value != this.value)
- {
- this.value = value;
- fireStateChanged();
- }
- }
-
-
- /**
- * Returns the current extent of this bounded range model, which is
- * a number greater than or equal to zero. In a scroll bar
- * visualization of a {@link BoundedRangeModel}, the
- * <code>extent</code> is displayed as the size of the thumb.
- *
- * @return the extent
- */
- public int getExtent()
- {
- return extent;
- }
-
-
- /**
- * Changes the current extent of this bounded range model. In a
- * scroll bar visualization of a {@link BoundedRangeModel}, the
- * <code>extent</code> is displayed as the size of the thumb.
- *
- * @param extent the new extent of the range model, which is a
- * number greater than or equal to zero.
- */
- public void setExtent(int extent)
- {
- extent = Math.max(extent, 0);
- if (value + extent > maximum)
- extent = maximum - value;
-
- if (extent != this.extent)
- {
- this.extent = extent;
- fireStateChanged();
- }
- }
-
-
- /**
- * Returns the current minimal value of this bounded range model.
- */
- public int getMinimum()
- {
- return minimum;
- }
-
-
- /**
- * Changes the current minimal value of this bounded range model.
- *
- * @param minimum the new minimal value.
- */
- public void setMinimum(int minimum)
- {
- int value, maximum;
-
- maximum = Math.max(minimum, this.maximum);
- value = Math.max(minimum, this.value);
-
- setRangeProperties(value, extent, minimum, maximum, isAdjusting);
- }
-
-
- /**
- * Returns the current maximal value of this bounded range model.
- *
- * @return the maximum
- */
- public int getMaximum()
- {
- return maximum;
- }
-
-
- /**
- * Changes the current maximal value of this bounded range model.
- *
- * @param maximum the new maximal value.
- */
- public void setMaximum(int maximum)
- {
- int value, extent, minimum;
-
- minimum = Math.min(this.minimum, maximum);
- extent = Math.min(this.extent, maximum - minimum);
- value = Math.min(this.value, maximum - extent);
-
- setRangeProperties(value, extent, minimum, maximum, isAdjusting);
- }
-
-
- /**
- * Returns whether or not the value of this bounded range model is
- * going to change in the immediate future. Scroll bars set this
- * property to <code>true</code> while the thumb is being dragged
- * around; when the mouse is relased, they set the property to
- * <code>false</code> and post a final {@link ChangeEvent}.
- *
- * @return <code>true</code> if the value will change soon again;
- * <code>false</code> if the value will probably not change soon.
- */
- public boolean getValueIsAdjusting()
- {
- return isAdjusting;
- }
-
-
- /**
- * Specifies whether or not the value of this bounded range model is
- * going to change in the immediate future. Scroll bars set this
- * property to <code>true</code> while the thumb is being dragged
- * around; when the mouse is relased, they set the property to
- * <code>false</code>.
- *
- * @param isAdjusting <code>true</code> if the value will change
- * soon again; <code>false</code> if the value will probably not
- * change soon.
- */
- public void setValueIsAdjusting(boolean isAdjusting)
- {
- if (isAdjusting == this.isAdjusting)
- return;
-
- this.isAdjusting = isAdjusting;
- fireStateChanged();
- }
-
-
- /**
- * Sets all properties.
- *
- * @param value the new value of the range model. In a scroll bar
- * visualization of a {@link BoundedRangeModel}, the
- * <code>value</code> is displayed as the position of the thumb.
- *
- * @param extent the new extent of the range model, which is a
- * number greater than or equal to zero. In a scroll bar
- * visualization of a {@link BoundedRangeModel}, the
- * <code>extent</code> is displayed as the size of the thumb.
- *
- * @param minimum the new minimal value of the range model.
- *
- * @param maximum the new maximal value of the range model.
-
- * @param isAdjusting whether or not the value of this bounded range
- * model is going to change in the immediate future. Scroll bars set
- * this property to <code>true</code> while the thumb is being
- * dragged around; when the mouse is relased, they set the property
- * to <code>false</code>.
- */
- public void setRangeProperties(int value, int extent, int minimum,
- int maximum, boolean isAdjusting)
- {
- minimum = Math.min(Math.min(minimum, maximum), value);
- maximum = Math.max(value, maximum);
- if (extent + value > maximum)
- extent = maximum - value;
- extent = Math.max(0, extent);
-
- if ((value == this.value)
- && (extent == this.extent)
- && (minimum == this.minimum)
- && (maximum == this.maximum)
- && (isAdjusting == this.isAdjusting))
- return;
-
- this.value = value;
- this.extent = extent;
- this.minimum = minimum;
- this.maximum = maximum;
- this.isAdjusting = isAdjusting;
-
- fireStateChanged();
- }
-
-
- /**
- * Subscribes a ChangeListener to state changes.
- *
- * @param listener the listener to be subscribed.
- */
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
-
- /**
- * Cancels the subscription of a ChangeListener.
- *
- * @param listener the listener to be unsubscribed.
- */
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
-
- /**
- * Sends a {@link ChangeEvent} to any registered {@link
- * ChangeListener}s.
- *
- * @see #addChangeListener(ChangeListener)
- * @see #removeChangeListener(ChangeListener)
- */
- protected void fireStateChanged()
- {
- ChangeListener[] listeners = getChangeListeners();
-
- if (changeEvent == null)
- changeEvent = new ChangeEvent(this);
-
- for (int i = listeners.length - 1; i >= 0; --i)
- listeners[i].stateChanged(changeEvent);
- }
-
-
- /**
- * Retrieves the current listeners of the specified class.
- *
- * @param c the class of listeners; usually {@link
- * ChangeListener}<code>.class</code>.
- *
- * @return an array with the currently subscribed listeners, or
- * an empty array if there are currently no listeners.
- *
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
-
- /**
- * Returns all <code>ChangeListeners</code> that are currently
- * subscribed for changes to this
- * <code>DefaultBoundedRangeModel</code>.
- *
- * @return an array with the currently subscribed listeners, or
- * an empty array if there are currently no listeners.
- *
- * @since 1.4
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) getListeners(ChangeListener.class);
- }
-}
diff --git a/libjava/javax/swing/DefaultButtonModel.java b/libjava/javax/swing/DefaultButtonModel.java
deleted file mode 100644
index d00e46db3d0..00000000000
--- a/libjava/javax/swing/DefaultButtonModel.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/* DefaultButtonModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.KeyEvent;
-import java.io.Serializable;
-import java.util.EventListener;
-
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-/**
- * The purpose of this class is to model the dynamic state of an abstract
- * button. The concrete button type holding this state may be a a "toggle"
- * button (checkbox, radio button) or a "push" button (menu button, button).
- * If the model is disabled, only the "selected" property can be changed. An
- * attempt to change the "armed", "rollover" or "pressed" properties while
- * the model is disabled will be blocked. Any successful (non-blocked) change
- * to the model's properties will trigger the firing of a ChangeEvent. Any
- * change to the "selected" property will trigger the firing of an ItemEvent
- * in addition to ChangeEvent. This is true whether the model is enabled or
- * not. One other state change is special: the transition from "enabled,
- * armed and pressd" to "enabled, armed and not-pressed". This is considered
- * the "trailing edge" of a successful mouse click, and therefore fires an
- * ActionEvent in addition to a ChangeEvent. In all other respects this class
- * is just a container of boolean flags.
- *
- * @author Graydon Hoare (graydon_at_redhat.com)
- */
-public class DefaultButtonModel implements ButtonModel, Serializable
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -5342609566534980231L;
-
- /**
- * Indicates that the button is <em>partially</em> committed to being
- * pressed, but not entirely. This usually happens when a user has pressed
- * but not yet released the mouse button.
- */
- public static final int ARMED = 1;
-
- /**
- * State constant indicating that the button is enabled. Buttons cannot be
- * pressed or selected unless they are enabled.
- */
- public static final int ENABLED = 8;
-
- /**
- * State constant indicating that the user is holding down the button. When
- * this transitions from true to false, an ActionEvent may be fired,
- * depending on the value of the "armed" property.
- */
- public static final int PRESSED = 4;
-
- /**
- * State constant indicating that the mouse is currently positioned over the
- * button.
- */
- public static final int ROLLOVER = 16;
-
- /**
- * State constant indicating that the button is selected. This constant is
- * only meaningful for toggle-type buttons (radio buttons, checkboxes).
- */
- public static final int SELECTED = 2;
-
- /**
- * Represents the "state properties" (armed, enabled, pressed, rollover and
- * selected) by a bitwise combination of integer constants.
- */
- protected int stateMask = ENABLED;
-
- /**
- * List of ItemListeners, ChangeListeners, and ActionListeners registered on
- * this model.
- */
- protected EventListenerList listenerList = new EventListenerList();
- ;
-
- /** The single ChangeEvent this model (re)uses to call its ChangeListeners. */
- protected ChangeEvent changeEvent = new ChangeEvent(this);
-
- /**
- * The group this model belongs to. Only one button in a group may be
- * selected at any given time.
- */
- protected ButtonGroup group;
-
- /**
- * The key code (one of {@link java.awt.event.KeyEvent} VK_) used to press
- * this button via a keyboard interface.
- */
- protected int mnemonic = KeyEvent.VK_UNDEFINED;
-
- /**
- * The string used as the "command" property of any ActionEvent this model
- * sends.
- */
- protected String actionCommand;
-
- /**
- * Creates a new DefaultButtonModel object.
- */
- public DefaultButtonModel()
- {
- }
-
- /**
- * Return <code>null</code>. Use {@link AbstractButton} if you wish to
- * interface with a button via an {@link ItemSelectable} interface.
- *
- * @return <code>null</code>
- */
- public Object[] getSelectedObjects()
- {
- return null;
- }
-
- /**
- * Returns a specified class of listeners.
- *
- * @param listenerType the type of listener to return
- *
- * @return array of listeners
- */
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
- /**
- * Add an ActionListener to the model. Usually only called to subscribe an
- * AbstractButton's listener to the model.
- *
- * @param l The listener to add
- */
- public void addActionListener(ActionListener l)
- {
- listenerList.add(ActionListener.class, l);
- }
-
- /**
- * Remove an ActionListener to the model. Usually only called to unsubscribe
- * an AbstractButton's listener to the model.
- *
- * @param l The listener to remove
- */
- public void removeActionListener(ActionListener l)
- {
- listenerList.remove(ActionListener.class, l);
- }
-
- /**
- * Returns all registered <code>ActionListener</code> objects.
- *
- * @return array of <code>ActionListener</code> objects
- */
- public ActionListener[] getActionListeners()
- {
- return (ActionListener[]) listenerList.getListeners(ActionListener.class);
- }
-
- /**
- * Add an ItemListener to the model. Usually only called to subscribe an
- * AbstractButton's listener to the model.
- *
- * @param l The listener to add
- */
- public void addItemListener(ItemListener l)
- {
- listenerList.add(ItemListener.class, l);
- }
-
- /**
- * Remove an ItemListener to the model. Usually only called to unsubscribe
- * an AbstractButton's listener to the model.
- *
- * @param l The listener to remove
- */
- public void removeItemListener(ItemListener l)
- {
- listenerList.remove(ItemListener.class, l);
- }
-
- /**
- * Returns all registered <code>ItemListener</code> objects.
- *
- * @return array of <code>ItemListener</code> objects
- */
- public ItemListener[] getItemListeners()
- {
- return (ItemListener[]) listenerList.getListeners(ItemListener.class);
- }
-
- /**
- * Add a ChangeListener to the model. Usually only called to subscribe an
- * AbstractButton's listener to the model.
- *
- * @param l The listener to add
- */
- public void addChangeListener(ChangeListener l)
- {
- listenerList.add(ChangeListener.class, l);
- }
-
- /**
- * Remove a ChangeListener to the model. Usually only called to unsubscribe
- * an AbstractButton's listener to the model.
- *
- * @param l The listener to remove
- */
- public void removeChangeListener(ChangeListener l)
- {
- listenerList.remove(ChangeListener.class, l);
- }
-
- /**
- * Returns all registered <code>ChangeListener</code> objects.
- *
- * @return array of <code>ChangeListener</code> objects
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
- }
-
- /**
- * Inform each ItemListener in the {@link listenerList} that an ItemEvent
- * has occurred. This happens in response to any change to the {@link
- * stateMask} field.
- *
- * @param e The ItemEvent to fire
- */
- protected void fireItemStateChanged(ItemEvent e)
- {
- ItemListener[] ll = getItemListeners();
-
- for (int i = 0; i < ll.length; i++)
- ll[i].itemStateChanged(e);
- }
-
- /**
- * Inform each ActionListener in the {@link listenerList} that an
- * ActionEvent has occurred. This happens in response to the any change to
- * the {@link stateMask} field which makes the enabled, armed and pressed
- * properties all simultaneously <code>true</code>.
- *
- * @param e The ActionEvent to fire
- */
- protected void fireActionPerformed(ActionEvent e)
- {
- ActionListener[] ll = getActionListeners();
-
- for (int i = 0; i < ll.length; i++)
- ll[i].actionPerformed(e);
- }
-
- /**
- * Inform each ChangeListener in the {@link listenerList} that a ChangeEvent
- * has occurred. This happens in response to the any change to a property
- * of the model.
- */
- protected void fireStateChanged()
- {
- ChangeListener[] ll = getChangeListeners();
-
- for (int i = 0; i < ll.length; i++)
- ll[i].stateChanged(changeEvent);
- }
-
- /**
- * Helper method to fire a ChangeEvent with the model as the event's source.
- *
- * @param stateflag DOCUMENT ME!
- * @param b DOCUMENT ME!
- */
- private void changeState(int stateflag, boolean b)
- {
- int oldstate = stateMask;
- int newstate;
-
- if (b)
- newstate = oldstate | stateflag;
- else
- newstate = oldstate & ~ stateflag;
-
- if (oldstate == newstate)
- return;
-
- if ((stateflag != SELECTED) && (stateflag != ENABLED)
- && (stateMask & ENABLED) == 0)
- return;
-
- stateMask = newstate;
-
- fireStateChanged();
-
- if ((oldstate & SELECTED) == 0 && (newstate & SELECTED) == SELECTED)
- {
- fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
- null, ItemEvent.SELECTED));
- if (group != null)
- group.setSelected(this, true);
- }
-
- else if ((oldstate & SELECTED) == SELECTED && (newstate & SELECTED) == 0)
- {
- fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
- null, ItemEvent.DESELECTED));
- if (group != null)
- group.setSelected(this, false);
- }
-
- else if (((oldstate & ARMED) == ARMED && (oldstate & PRESSED) == PRESSED)
- && ((newstate & ARMED) == ARMED && (newstate & PRESSED) == 0))
- fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
- actionCommand));
- }
-
- /**
- * Get the value of the model's "armed" property.
- *
- * @return The current "armed" property
- */
- public boolean isArmed()
- {
- return (stateMask & ARMED) == ARMED;
- }
-
- /**
- * Set the value of the model's "armed" property.
- *
- * @param a The new "armed" property
- */
- public void setArmed(boolean a)
- {
- changeState(ARMED, a);
- }
-
- /**
- * Get the value of the model's "enabled" property.
- *
- * @return The current "enabled" property.
- */
- public boolean isEnabled()
- {
- return (stateMask & ENABLED) == ENABLED;
- }
-
- /**
- * Set the value of the model's "enabled" property.
- *
- * @param e The new "enabled" property
- */
- public void setEnabled(boolean e)
- {
- changeState(ENABLED, e);
- }
-
- /**
- * Set the value of the model's "pressed" property.
- *
- * @param p The new "pressed" property
- */
- public void setPressed(boolean p)
- {
- changeState(PRESSED, p);
- }
-
- /**
- * Get the value of the model's "pressed" property.
- *
- * @return The current "pressed" property
- */
- public boolean isPressed()
- {
- return (stateMask & PRESSED) == PRESSED;
- }
-
- /**
- * Set the value of the model's "rollover" property.
- *
- * @param r The new "rollover" property
- */
- public void setRollover(boolean r)
- {
- changeState(ROLLOVER, r);
- }
-
- /**
- * Set the value of the model's "selected" property.
- *
- * @param s The new "selected" property
- */
- public void setSelected(boolean s)
- {
- changeState(SELECTED, s);
- }
-
- /**
- * Get the value of the model's "selected" property.
- *
- * @return The current "selected" property
- */
- public boolean isSelected()
- {
- return (stateMask & SELECTED) == SELECTED;
- }
-
- /**
- * Get the value of the model's "rollover" property.
- *
- * @return The current "rollover" property
- */
- public boolean isRollover()
- {
- return (stateMask & ROLLOVER) == ROLLOVER;
- }
-
- /**
- * Get the value of the model's "mnemonic" property.
- *
- * @return The current "mnemonic" property
- */
- public int getMnemonic()
- {
- return mnemonic;
- }
-
- /**
- * Set the value of the model's "mnemonic" property.
- *
- * @param key The new "mnemonic" property
- */
- public void setMnemonic(int key)
- {
- if (mnemonic != key)
- {
- mnemonic = key;
- fireStateChanged();
- }
- }
-
- /**
- * Set the value of the model's "actionCommand" property. This property is
- * used as the "command" property of the {@link ActionEvent} fired from the
- * model.
- *
- * @param s The new "actionCommand" property.
- */
- public void setActionCommand(String s)
- {
- if (actionCommand != s)
- {
- actionCommand = s;
- fireStateChanged();
- }
- }
-
- /**
- * Returns the current value of the model's "actionCommand" property.
- *
- * @return The current "actionCommand" property
- */
- public String getActionCommand()
- {
- return actionCommand;
- }
-
- /**
- * Set the value of the model's "group" property. The model is said to be a
- * member of the {@link ButtonGroup} held in its "group" property, and only
- * one model in a given group can have their "selected" property be
- * <code>true</code> at a time.
- *
- * @param g The new "group" property
- */
- public void setGroup(ButtonGroup g)
- {
- if (group != g)
- {
- group = g;
- fireStateChanged();
- }
- }
-
- /**
- * Returns the current value of the model's "group" property.
- *
- * @return The value of the "group" property
- */
- public ButtonGroup getGroup()
- {
- return group;
- }
-}
diff --git a/libjava/javax/swing/DefaultCellEditor.java b/libjava/javax/swing/DefaultCellEditor.java
deleted file mode 100644
index fba02320d87..00000000000
--- a/libjava/javax/swing/DefaultCellEditor.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/* DefaultCellEditor.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.io.Serializable;
-import java.util.EventObject;
-
-import javax.swing.table.TableCellEditor;
-import javax.swing.tree.TreeCellEditor;
-
-/**
- * DefaultCellEditor
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class DefaultCellEditor
- extends AbstractCellEditor
- implements TableCellEditor, TreeCellEditor
-{
- private static final long serialVersionUID = 3564035141373880027L;
-
- /**
- * EditorDelegate
- */
- protected class EditorDelegate
- implements ActionListener, ItemListener, Serializable
- {
- private static final long serialVersionUID = -1420007406015481933L;
-
- /**
- * value
- */
- protected Object value;
-
- /**
- * Constructor EditorDelegate
- * @param value0 TODO
- */
- protected EditorDelegate()
- {
- }
-
- /**
- * setValue
- * @param event TODO
- */
- public void setValue(Object event)
- {
- }
-
- /**
- * getCellEditorValue
- * @returns Object
- */
- public Object getCellEditorValue() {
- return null; // TODO
- } // getCellEditorValue()
-
- /**
- * isCellEditable
- * @param event TODO
- * @returns boolean
- */
- public boolean isCellEditable(EventObject event) {
- return false; // TODO
- } // isCellEditable()
-
- /**
- * shouldSelectCell
- * @param event TODO
- * @returns boolean
- */
- public boolean shouldSelectCell(EventObject event) {
- return false; // TODO
- } // shouldSelectCell()
-
- /**
- * stopCellEditing
- * @returns boolean
- */
- public boolean stopCellEditing() {
- return false; // TODO
- } // stopCellEditing()
-
- /**
- * cancelCellEditing
- */
- public void cancelCellEditing() {
- // TODO
- } // cancelCellEditing()
-
- /**
- * startCellEditing
- * @param event TODO
- * @returns boolean
- */
- public boolean startCellEditing(EventObject event) {
- return false; // TODO
- } // startCellEditing()
-
- /**
- * actionPerformed
- * @param event TODO
- */
- public void actionPerformed(ActionEvent event) {
- // TODO
- } // actionPerformed()
-
- /**
- * itemStateChanged
- * @param event TODO
- */
- public void itemStateChanged(ItemEvent event) {
- // TODO
- } // itemStateChanged()
-
-
- } // EditorDelegate
-
- /**
- * editorComponent
- */
- protected JComponent editorComponent;
-
- /**
- * delegate
- */
- protected EditorDelegate delegate;
-
- /**
- * clickCountToStart
- */
- protected int clickCountToStart;
-
- /**
- * Constructor DefaultCellEditor
- * @param textfield TODO
- */
- public DefaultCellEditor(JTextField textfield) {
- // TODO
- } // DefaultCellEditor()
-
- /**
- * Constructor DefaultCellEditor
- * @param checkbox TODO
- */
- public DefaultCellEditor(JCheckBox checkbox) {
- // TODO
- } // DefaultCellEditor()
-
- /**
- * Constructor DefaultCellEditor
- * @param combobox TODO
- */
- public DefaultCellEditor(JComboBox combobox) {
- // TODO
- } // DefaultCellEditor()
-
- /**
- * getComponent
- * @returns Component
- */
- public Component getComponent() {
- return null; // TODO
- } // getComponent()
-
- /**
- * getClickCountToStart
- * @returns int
- */
- public int getClickCountToStart() {
- return 0; // TODO
- } // getClickCountToStart()
-
- /**
- * setClickCountToStart
- * @param count TODO
- */
- public void setClickCountToStart(int count) {
- // TODO
- } // setClickCountToStart()
-
- /**
- * getCellEditorValue
- * @returns Object
- */
- public Object getCellEditorValue() {
- return null; // TODO
- } // getCellEditorValue()
-
- /**
- * isCellEditable
- * @param event TODO
- * @returns boolean
- */
- public boolean isCellEditable(EventObject event) {
- return false; // TODO
- } // isCellEditable()
-
- /**
- * shouldSelectCell
- * @param event TODO
- * @returns boolean
- */
- public boolean shouldSelectCell(EventObject event) {
- return false; // TODO
- } // shouldSelectCell()
-
- /**
- * stopCellEditing
- * @returns boolean
- */
- public boolean stopCellEditing() {
- return false; // TODO
- } // stopCellEditing()
-
- /**
- * cancelCellEditing
- */
- public void cancelCellEditing() {
- // TODO
- } // cancelCellEditing()
-
- /**
- * getTreeCellEditorComponent
- * @param tree TODO
- * @param value TODO
- * @param isSelected TODO
- * @param expanded TODO
- * @param leaf TODO
- * @param row TODO
- * @returns Component
- */
- public Component getTreeCellEditorComponent(JTree tree,
- Object value, boolean isSelected, boolean expanded,
- boolean leaf, int row) {
- return null; // TODO
- } // getTreeCellEditorComponent()
-
- /**
- * getTableCellEditorComponent
- * @param tree TODO
- * @param value TODO
- * @param isSelected TODO
- * @param row TODO
- * @param column TODO
- * @returns Component
- */
- public Component getTableCellEditorComponent(JTable tree,
- Object value, boolean isSelected, int row, int column) {
- return null; // TODO
- } // getTableCellEditorComponent()
-}
diff --git a/libjava/javax/swing/DefaultComboBoxModel.java b/libjava/javax/swing/DefaultComboBoxModel.java
deleted file mode 100644
index 3678ab9b72e..00000000000
--- a/libjava/javax/swing/DefaultComboBoxModel.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/* DefaultComboBoxModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.Arrays;
-import java.util.Vector;
-
-
-/**
- * DefaultComboBoxModel is a data model for JComboBox. This model keeps track
- * of elements contained in the JComboBox as well as the current combo box
- * selection. Whenever selection in the JComboBox changes, the ComboBoxModel
- * will fire ListDataEvents to ComboBox's ListDataListeners.
- *
- * @author Andrew Selkirk
- * @author Olga Rodimina
- * @author Robert Schuster
- * @version 1.0
- */
-public class DefaultComboBoxModel extends AbstractListModel
- implements MutableComboBoxModel, Serializable
-{
- private static final long serialVersionUID = 6698657703676921904L;
-
- /**
- * List containing items in the combo box
- */
- private Vector list;
-
- /**
- * Currently selected item in the combo box list
- */
- private Object selectedItem = null;
-
- /**
- * Constructor DefaultComboBoxModel. Create empty JComboBox.
- */
- public DefaultComboBoxModel()
- {
- list = new Vector();
- }
-
- /**
- * Constructs new DefaultComboBoxModel object and initializes its item list
- * to values in the given array.
- *
- * @param items array containing items of the combo box.
- */
- public DefaultComboBoxModel(Object[] items)
- {
- list = new Vector(Arrays.asList(items));
- }
-
- /**
- * Consturcts new DefaultComboBoxModel object and initializes its item list
- * to values in the given vector.
- *
- * @param vector Vector containing items for this combo box.
- */
- public DefaultComboBoxModel(Vector vector)
- {
- this.list = vector;
- }
-
- /**
- * This method adds element to the combo box list. It fires ListDataEvent
- * indicating that component was added to the combo box to all of the
- * JComboBox's registered ListDataListeners.
- *
- * @param object item to add to the combo box list
- */
- public void addElement(Object object)
- {
- list.add(object);
- fireIntervalAdded(this, list.size(), list.size());
- }
-
- /**
- * This method removes element at the specified index from the combo box
- * list. It fires ListDataEvent indicating that component was removed from
- * the combo box list to all of the JComboBox's registered
- * ListDataListeners.
- *
- * @param index index specifying location of the element to remove in the
- * combo box list.
- */
- public void removeElementAt(int index)
- {
- list.remove(index);
- fireIntervalRemoved(this, index, index);
- }
-
- /**
- * This method inserts given object to the combo box list at the specified
- * index. It fires ListDataEvent indicating that component was inserted to
- * the combo box list to all of the JComboBox's registered
- * ListDataListeners.
- *
- * @param object element to insert
- * @param index index specifing position in the list where given element
- * should be inserted.
- */
- public void insertElementAt(Object object, int index)
- {
- list.insertElementAt(object, index);
- fireIntervalAdded(this, index, index);
- }
-
- /**
- * Removes given object from the combo box list. It fires ListDataEvent
- * indicating that component was removed from the combo box list to all of
- * the JComboBox's registered ListDataListeners.
- *
- * @param object Element that will be removed from the combo box list
- */
- public void removeElement(Object object)
- {
- int index = getIndexOf(object);
- if (index != -1)
- removeElementAt(index);
- }
-
- /**
- * Removes all the items from the JComboBox's item list. It fires
- * ListDataEvent indicating that all the elements were removed from the
- * combo box list to all of the JComboBox's registered ListDataListeners.
- */
- public void removeAllElements()
- {
- int listSize = getSize();
- list.clear();
- fireIntervalAdded(this, 0, listSize - 1);
- }
-
- /**
- * Returns number of items in the combo box list
- *
- * @return number of items in the combo box list
- */
- public int getSize()
- {
- return list.size();
- }
-
- /**
- * Selects given object in the combo box list. This method fires
- * ListDataEvent to all registered ListDataListeners of the JComboBox. The
- * start and end index of the event is set to -1 to indicate combo box's
- * selection has changed, and not its contents.
- *
- * <p>If the given object is not contained in the combo box list then nothing
- * happens.</p>
- *
- * @param object item to select in the JComboBox
- */
- public void setSelectedItem(Object object)
- {
-
- /* Updates the selected item only if the given object
- * is null or in the list (this is how the JDK behaves).
- */
- if(object == null || list.contains(object)) {
- selectedItem = object;
- fireContentsChanged(this, -1, -1);
- }
-
- }
-
- /**
- * Returns currently selected item in the combo box list
- *
- * @return currently selected item in the combo box list
- */
- public Object getSelectedItem()
- {
- return selectedItem;
- }
-
- /**
- * Returns element in the combo box list located at the given index
- *
- * @param index specifying location of the element in the list
- *
- * @return return element in the combo box list located at the given index
- */
- public Object getElementAt(int index)
- {
- return list.elementAt(index);
- }
-
- /**
- * Returns index of the specified object in the combo box list.
- *
- * @param object element to look for in the combo box list .
- *
- * @return Index specifying position of the specified element in combo box
- * list.
- */
- public int getIndexOf(Object object)
- {
- return list.indexOf(object);
- }
-}
diff --git a/libjava/javax/swing/DefaultDesktopManager.java b/libjava/javax/swing/DefaultDesktopManager.java
deleted file mode 100644
index f505481ef98..00000000000
--- a/libjava/javax/swing/DefaultDesktopManager.java
+++ /dev/null
@@ -1,627 +0,0 @@
-/* DefaultDesktopManager.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.beans.PropertyVetoException;
-import java.io.Serializable;
-
-import javax.swing.JInternalFrame.JDesktopIcon;
-
-/**
- * DefaultDesktopManager is the default implementation of DesktopManager for
- * swing. It implements the basic beaviours for JInternalFrames in arbitrary
- * parents. The methods provided by the class are not meant to be called by
- * the user, instead, the JInternalFrame methods will call these methods.
- */
-public class DefaultDesktopManager implements DesktopManager, Serializable
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 4657624909838017887L;
-
- /** The property change event fired when the wasIcon property changes. */
- static final String WAS_ICON_ONCE_PROPERTY = "wasIconOnce";
-
- /**
- * The method of dragging used by the JDesktopPane that parents the
- * JInternalFrame that is being dragged.
- */
- private int currentDragMode = 0;
-
- /**
- * The cache of the bounds used to draw the outline rectangle when
- * OUTLINE_DRAG_MODE is used.
- */
- private transient Rectangle dragCache = new Rectangle();
-
- /**
- * A cached JDesktopPane that is stored when the JInternalFrame is initially
- * dragged.
- */
- private transient Container pane;
-
- /**
- * An array of Rectangles that holds the bounds of the JDesktopIcons in the
- * JDesktopPane when looking for where to place a new icon.
- */
- private transient Rectangle[] iconRects;
-
- /**
- * This creates a new DefaultDesktopManager object.
- */
- public DefaultDesktopManager()
- {
- }
-
- /**
- * This method is not normally called since the user will typically add the
- * JInternalFrame to a Container. If this is called, it will try to
- * determine the parent of the JInternalFrame and remove any icon that
- * represents this JInternalFrame and add this JInternalFrame.
- *
- * @param frame The JInternalFrame to open.
- */
- public void openFrame(JInternalFrame frame)
- {
- Container c = frame.getParent();
- if (c == null)
- c = frame.getDesktopIcon().getParent();
- if (c == null)
- return;
-
- c.remove(frame.getDesktopIcon());
- c.add(frame);
- frame.setVisible(true);
- }
-
- /**
- * This method removes the JInternalFrame and JDesktopIcon (if one is
- * present) from their parents.
- *
- * @param frame The JInternalFrame to close.
- */
- public void closeFrame(JInternalFrame frame)
- {
- Container c = frame.getParent();
- frame.doDefaultCloseAction();
-
- if (c != null)
- {
- if (frame.isIcon())
- c.remove(frame.getDesktopIcon());
- else
- c.remove(frame);
- c.repaint();
- }
- }
-
- /**
- * This method resizes the JInternalFrame to match its parent's bounds.
- *
- * @param frame The JInternalFrame to maximize.
- */
- public void maximizeFrame(JInternalFrame frame)
- {
- // Can't maximize from iconified state.
- // It can only return to maximized state, but that would fall under
- // deiconify.
- if (frame.isIcon())
- return;
- frame.setNormalBounds(frame.getBounds());
-
- Container p = frame.getParent();
- if (p != null)
- {
- Rectangle pBounds = p.getBounds();
- Insets insets = p.getInsets();
- pBounds.width -= insets.left + insets.right;
- pBounds.height -= insets.top + insets.bottom;
-
- setBoundsForFrame(frame, 0, 0, pBounds.width, pBounds.height);
- }
- if (p instanceof JDesktopPane)
- ((JDesktopPane) p).setSelectedFrame(frame);
- else
- {
- try
- {
- frame.setSelected(true);
- }
- catch (PropertyVetoException e)
- {
- // Do nothing.
- }
- }
- }
-
- /**
- * This method restores the JInternalFrame's bounds to what they were
- * previous to the setMaximize call.
- *
- * @param frame The JInternalFrame to minimize.
- */
- public void minimizeFrame(JInternalFrame frame)
- {
- Rectangle normalBounds = frame.getNormalBounds();
-
- JDesktopPane p = frame.getDesktopPane();
- if (p != null)
- p.setSelectedFrame(frame);
- else
- {
- try
- {
- frame.setSelected(true);
- }
- catch (PropertyVetoException e)
- {
- // Do nothing.
- }
- }
-
- setBoundsForFrame(frame, normalBounds.x, normalBounds.y,
- normalBounds.width, normalBounds.height);
- }
-
- /**
- * This method removes the JInternalFrame from its parent and adds its
- * JDesktopIcon representation.
- *
- * @param frame The JInternalFrame to iconify.
- */
- public void iconifyFrame(JInternalFrame frame)
- {
- JDesktopPane p = frame.getDesktopPane();
- JDesktopIcon icon = frame.getDesktopIcon();
- if (p != null && p.getSelectedFrame() == frame)
- p.setSelectedFrame(null);
- else
- {
- try
- {
- frame.setSelected(false);
- }
- catch (PropertyVetoException e)
- {
- }
- }
-
- Container c = frame.getParent();
-
- if (! wasIcon(frame))
- {
- Rectangle r = getBoundsForIconOf(frame);
- icon.setBounds(r);
- setWasIcon(frame, Boolean.TRUE);
- }
-
- if (c != null)
- {
- if (icon != null)
- {
- c.add(icon);
- icon.setVisible(true);
- }
- c.remove(frame);
- }
- }
-
- /**
- * This method removes the JInternalFrame's JDesktopIcon representation and
- * adds the JInternalFrame back to its parent.
- *
- * @param frame The JInternalFrame to deiconify.
- */
- public void deiconifyFrame(JInternalFrame frame)
- {
- JDesktopIcon icon = frame.getDesktopIcon();
- Container c = icon.getParent();
-
- removeIconFor(frame);
- c.add(frame);
- frame.setVisible(true);
-
- if (! frame.isSelected())
- {
- JDesktopPane p = frame.getDesktopPane();
- if (p != null)
- p.setSelectedFrame(frame);
- else
- {
- try
- {
- frame.setSelected(true);
- }
- catch (PropertyVetoException e)
- {
- // Do nothing.
- }
- }
- }
-
- c.invalidate();
- }
-
- /**
- * This method activates the JInternalFrame by moving it to the front and
- * selecting it.
- *
- * @param frame The JInternalFrame to activate.
- */
- public void activateFrame(JInternalFrame frame)
- {
- JDesktopPane p = frame.getDesktopPane();
-
- if (p != null)
- p.setSelectedFrame(frame);
- else
- {
- try
- {
- frame.setSelected(true);
- }
- catch (PropertyVetoException e)
- {
- }
- }
-
- frame.toFront();
- }
-
- /**
- * This method is called when the JInternalFrame loses focus.
- *
- * @param frame The JInternalFram to deactivate.
- */
- public void deactivateFrame(JInternalFrame frame)
- {
- JDesktopPane p = frame.getDesktopPane();
- if (p != null)
- {
- if (p.getSelectedFrame() == frame)
- p.setSelectedFrame(null);
- }
- else
- {
- try
- {
- frame.setSelected(false);
- }
- catch (PropertyVetoException e)
- {
- }
- }
- }
-
- /**
- * This method is called to indicate that the DesktopManager should prepare
- * to drag the JInternalFrame. Any state information needed to drag the
- * frame will be prepared now.
- *
- * @param component The JComponent to drag, usually a JInternalFrame.
- */
- public void beginDraggingFrame(JComponent component)
- {
- if (component instanceof JDesktopIcon)
- pane = ((JDesktopIcon) component).getInternalFrame().getDesktopPane();
- else
- pane = ((JInternalFrame) component).getDesktopPane();
- if (pane == null)
- return;
-
- dragCache = component.getBounds();
-
- if (! (pane instanceof JDesktopPane))
- currentDragMode = JDesktopPane.LIVE_DRAG_MODE;
- else
- currentDragMode = ((JDesktopPane) pane).getDragMode();
- }
-
- /**
- * This method is called to drag the JInternalFrame to a new location.
- *
- * @param component The JComponent to drag, usually a JInternalFrame.
- * @param newX The new x coordinate.
- * @param newY The new y coordinate.
- */
- public void dragFrame(JComponent component, int newX, int newY)
- {
- if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE)
- {
- // FIXME: Do outline drag mode painting.
- }
- else
- {
- Rectangle b = component.getBounds();
- if (component instanceof JDesktopIcon)
- component.setBounds(newX, newY, b.width, b.height);
- else
- setBoundsForFrame((JInternalFrame) component, newX, newY, b.width,
- b.height);
- }
- }
-
- /**
- * This method indicates that the dragging is done. Any state information
- * stored by the DesktopManager can be cleared.
- *
- * @param component The JComponent that has finished dragging.
- */
- public void endDraggingFrame(JComponent component)
- {
- if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE)
- {
- setBoundsForFrame((JInternalFrame) component, dragCache.x,
- dragCache.y, dragCache.width, dragCache.height);
- pane = null;
- dragCache = null;
- }
- component.repaint();
- }
-
- /**
- * This method is called to indicate that the given JComponent will be
- * resized. Any state information necessary to resize the JComponent will
- * be prepared now.
- *
- * @param component The JComponent to resize, usually a JInternalFrame.
- * @param direction The direction to drag in (a SwingConstant).
- */
- public void beginResizingFrame(JComponent component, int direction)
- {
- pane = ((JInternalFrame) component).getDesktopPane();
- if (pane == null)
- return;
-
- dragCache = component.getBounds();
- if (! (pane instanceof JDesktopPane))
- currentDragMode = JDesktopPane.LIVE_DRAG_MODE;
- else
- currentDragMode = ((JDesktopPane) pane).getDragMode();
- }
-
- /**
- * This method resizes the give JComponent.
- *
- * @param component The JComponent to resize.
- * @param newX The new x coordinate.
- * @param newY The new y coordinate.
- * @param newWidth The new width.
- * @param newHeight The new height.
- */
- public void resizeFrame(JComponent component, int newX, int newY,
- int newWidth, int newHeight)
- {
- dragCache.setBounds(newX, newY, newWidth, newHeight);
-
- if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE)
- {
- // FIXME: Do outline drag painting.
- }
- else
- setBoundsForFrame(component, dragCache.x, dragCache.y, dragCache.width,
- dragCache.height);
- }
-
- /**
- * This method is called to indicate that the given JComponent has finished
- * dragging. Any state information stored by the DesktopManager can be
- * cleared.
- *
- * @param component The JComponent that finished resizing.
- */
- public void endResizingFrame(JComponent component)
- {
- if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE)
- {
- setBoundsForFrame((JInternalFrame) component, dragCache.x,
- dragCache.y, dragCache.width, dragCache.height);
- pane = null;
- dragCache = null;
- }
- component.repaint();
- }
-
- /**
- * This method calls setBounds with the given parameters and repaints the
- * JComponent.
- *
- * @param component The JComponent to set bounds for.
- * @param newX The new x coordinate.
- * @param newY The new y coordinate.
- * @param newWidth The new width.
- * @param newHeight The new height.
- */
- public void setBoundsForFrame(JComponent component, int newX, int newY,
- int newWidth, int newHeight)
- {
- component.setBounds(newX, newY, newWidth, newHeight);
- component.revalidate();
-
- // If not null, I'd rather repaint the parent
- if (component.getParent() != null)
- component.getParent().repaint();
- else
- component.repaint();
- }
-
- /**
- * This is a helper method that removes the JDesktopIcon of the given
- * JInternalFrame from the parent.
- *
- * @param frame The JInternalFrame to remove an icon for.
- */
- protected void removeIconFor(JInternalFrame frame)
- {
- JDesktopIcon icon = frame.getDesktopIcon();
- Container c = icon.getParent();
- if (c != null && icon != null)
- c.remove(icon);
- }
-
- /**
- * This method is called by iconifyFrame to determine the bounds of the
- * JDesktopIcon for the given JInternalFrame.
- *
- * @param frame The JInternalFrame to find the bounds of its JDesktopIcon
- * for.
- *
- * @return The bounds of the JDesktopIcon.
- */
- protected Rectangle getBoundsForIconOf(JInternalFrame frame)
- {
- // IconRects has no order to it.
- // The icon _must_ be placed in the first free slot (working from
- // the bottom left corner)
- // The icon also must not be placed where another icon is placed
- // (regardless whether that frame is an icon currently or not)
- JDesktopPane desktopPane = frame.getDesktopPane();
- Rectangle paneBounds = desktopPane.getBounds();
- Insets insets = desktopPane.getInsets();
- Dimension pref = frame.getDesktopIcon().getPreferredSize();
-
- if (desktopPane == null)
- return frame.getDesktopIcon().getBounds();
-
- Component[] frames = desktopPane.getComponents();
-
- int count = 0;
- for (int i = 0, j = 0; i < frames.length; i++)
- if (frames[i] instanceof JDesktopIcon
- || frames[i] instanceof JInternalFrame
- && ((JInternalFrame) frames[i]).getWasIcon() && frames[i] != frame)
- count++;
- iconRects = new Rectangle[count];
- for (int i = 0, j = 0; i < frames.length; i++)
- if (frames[i] instanceof JDesktopIcon)
- iconRects[--count] = frames[i].getBounds();
- else if (frames[i] instanceof JInternalFrame
- && ((JInternalFrame) frames[i]).getWasIcon()
- && frames[i] != frame)
- iconRects[--count] = ((JInternalFrame) frames[i]).getDesktopIcon()
- .getBounds();
-
- int startingX = insets.left;
- int startingY = paneBounds.height - insets.bottom - pref.height;
- Rectangle ideal = new Rectangle(startingX, startingY, pref.width,
- pref.height);
- boolean clear = true;
-
- while (iconRects.length > 0)
- {
- clear = true;
- for (int i = 0; i < iconRects.length; i++)
- {
- if (iconRects[i] != null && iconRects[i].intersects(ideal))
- {
- clear = false;
- break;
- }
- }
- if (clear)
- return ideal;
-
- startingX += pref.width;
- if (startingX + pref.width > paneBounds.width - insets.right)
- {
- startingX = insets.left;
- startingY -= pref.height;
- }
- ideal.setBounds(startingX, startingY, pref.width, pref.height);
- }
-
- return ideal;
- }
-
- /**
- * This method sets the bounds of the JInternalFrame right before the
- * maximizeFrame call.
- *
- * @param frame The JInternalFrame being maximized.
- * @param rect The normal bounds.
- */
- protected void setPreviousBounds(JInternalFrame frame, Rectangle rect)
- {
- frame.setNormalBounds(rect);
- }
-
- /**
- * This method returns the normal bounds of the JInternalFrame from before
- * the maximize call.
- *
- * @param frame The JInternalFrame that is being restored.
- *
- * @return The previous bounds of the JInternalFrame.
- */
- protected Rectangle getPreviousBounds(JInternalFrame frame)
- {
- return frame.getNormalBounds();
- }
-
- /**
- * This method sets the value to true if the given JInternalFrame has been
- * iconized and the bounds of its DesktopIcon are valid.
- *
- * @param frame The JInternalFrame for the JDesktopIcon.
- * @param value True if the JInternalFrame has been iconized and the bounds
- * of the JDesktopIcon are valid.
- */
- protected void setWasIcon(JInternalFrame frame, Boolean value)
- {
- frame.setWasIcon(value.booleanValue(), WAS_ICON_ONCE_PROPERTY);
- }
-
- /**
- * This method returns true if the given JInternalFrame has been iconized
- * and the bounds of its DesktopIcon are valid.
- *
- * @param frame The JInternalFrame for the JDesktopIcon.
- *
- * @return True if the given JInternalFrame has been iconized and the bounds
- * of its DesktopIcon are valid.
- */
- protected boolean wasIcon(JInternalFrame frame)
- {
- return frame.getWasIcon();
- }
-}
diff --git a/libjava/javax/swing/DefaultFocusManager.java b/libjava/javax/swing/DefaultFocusManager.java
deleted file mode 100644
index 9a1de86db0e..00000000000
--- a/libjava/javax/swing/DefaultFocusManager.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/* DefaultFocusManager.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.event.KeyEvent;
-import java.util.Stack;
-
-/**
- * DefaultFocusManager
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class DefaultFocusManager extends FocusManager {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * historyStack
- */
- private Stack historyStack;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor DefaultFocusManager
- */
- public DefaultFocusManager() {
- // TODO
- } // DefaultFocusManager()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * processKeyEvent
- * @param component TODO
- * @param event TODO
- */
- public void processKeyEvent(Component component, KeyEvent event) {
- // TODO
- } // processKeyEvent()
-
- /**
- * focusNextComponent
- * @param component TODO
- */
- public void focusNextComponent(Component component) {
- // TODO
- } // focusNextComponent()
-
- /**
- * focusPreviousComponent
- * @param component TODO
- */
- public void focusPreviousComponent(Component component) {
- // TODO
- } // focusPreviousComponent()
-
- /**
- * getFirstComponent
- * @param container TODO
- * @returns Component
- */
- public Component getFirstComponent(Container container) {
- return null; // TODO
- } // getFirstComponent()
-
- /**
- * getLastComponent
- * @param container TODO
- * @returns Component
- */
- public Component getLastComponent(Container container) {
- return null; // TODO
- } // getLastComponent()
-
- /**
- * getComponentBefore
- * @param container TODO
- * @param component TODO
- * @returns Component
- */
- public Component getComponentBefore(Container container,
- Component component) {
- return null; // TODO
- } // getComponentBefore()
-
- /**
- * getComponentAfter
- * @param container TODO
- * @param component TODO
- * @returns Component
- */
- public Component getComponentAfter(Container container,
- Component component) {
- return null; // TODO
- } // getComponentAfter()
-
- /**
- * compareTabOrder
- * @param component1 TODO
- * @param component2 TODO
- * @returns boolean
- */
- public boolean compareTabOrder(Component component1,
- Component component2) {
- return false; // TODO
- } // compareTabOrder()
-
-
-} // DefaultFocusManager
diff --git a/libjava/javax/swing/DefaultListCellRenderer.java b/libjava/javax/swing/DefaultListCellRenderer.java
deleted file mode 100644
index 7aa78a2f014..00000000000
--- a/libjava/javax/swing/DefaultListCellRenderer.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/* DefaultListCellRenderer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Rectangle;
-import java.io.Serializable;
-
-import javax.swing.border.Border;
-import javax.swing.border.EmptyBorder;
-
-/**
- * DefaultListCellRenderer. This class is responsible for rendering list
- * cells.
- *
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class DefaultListCellRenderer extends JLabel
- implements ListCellRenderer, Serializable
-{
- private static final long serialVersionUID = 7708947179685189462L;
-
- public static class UIResource extends DefaultListCellRenderer
- implements javax.swing.plaf.UIResource
- {
- public UIResource()
- {
- }
- }
-
- /**
- * This border is used whenever renderer doesn't have a focus.
- */
- protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
-
- /**
- * getListCellRendererComponent
- *
- * @param list JList list for the 'value'
- * @param value object that should be rendered in the cell
- * @param index index of the cell
- * @param isSelected draw cell highlighted if isSelected is true
- * @param cellHasFocus draw focus rectangle around cell if the cell has
- * focus
- *
- * @return Component that will be painted to the desired cell.
- */
- public Component getListCellRendererComponent(JList list, Object value,
- int index, boolean isSelected,
- boolean cellHasFocus)
- {
- String s = value.toString();
- setText(s);
- setOpaque(true);
- setHorizontalAlignment(LEFT);
-
- if (isSelected)
- {
- setBackground(list.getSelectionBackground());
- setForeground(list.getSelectionForeground());
- }
- else
- {
- setBackground(list.getBackground());
- setForeground(list.getForeground());
- }
-
- setEnabled(list.isEnabled());
- setFont(list.getFont());
-
- // Use focusCellHighlightBorder when renderer has focus and
- // noFocusBorder otherwise
-
- if (cellHasFocus)
- setBorder(UIManager.getBorder("List.focusCellHighlightBorder"));
- else
- setBorder(noFocusBorder);
-
- return this;
- }
-
- public void validate()
- {
- }
-
- public void revalidate()
- {
- }
-
- public void repaint(long tm, int x, int y, int w, int h)
- {
- }
-
- public void repaint(Rectangle rect)
- {
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue)
- {
- }
-
- public void firePropertyChange(String propertyName, byte oldValue,
- byte newValue)
- {
- }
-
- public void firePropertyChange(String propertyName, char oldValue,
- char newValue)
- {
- }
-
- public void firePropertyChange(String propertyName, short oldValue,
- short newValue)
- {
- }
-
- public void firePropertyChange(String propertyName, int oldValue,
- int newValue)
- {
- }
-
- public void firePropertyChange(String propertyName, long oldValue,
- long newValue)
- {
- }
-
- public void firePropertyChange(String propertyName, float oldValue,
- float newValue)
- {
- }
-
- public void firePropertyChange(String propertyName, double oldValue,
- double newValue)
- {
- }
-
- public void firePropertyChange(String propertyName, boolean oldValue,
- boolean newValue)
- {
- }
-}
diff --git a/libjava/javax/swing/DefaultListModel.java b/libjava/javax/swing/DefaultListModel.java
deleted file mode 100644
index e956dea0ec2..00000000000
--- a/libjava/javax/swing/DefaultListModel.java
+++ /dev/null
@@ -1,521 +0,0 @@
-/* DefaultListModel.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.util.Enumeration;
-import java.util.Vector;
-
-/**
- * This is a default subclass of the {@link AbstractListModel}, used by
- * {@link javax.swing.JList} and similar objects as the model of a list of
- * values. The implementation is based on an underlying {@link
- * java.util.Vector}.
- *
- * @author Andrew Selkirk
- * @author Graydon Hoare (graydon@redhat.com)
- */
-
-public class DefaultListModel extends AbstractListModel
-{
- private static final long serialVersionUID = 2315945659722172272L;
-
- /**
- * The vector of elements in this list model.
- */
- private Vector elements = new Vector();
-
- /**
- * Gets an element of the list at the provided index.
- *
- * @param index The index of the element to get
- *
- * @return The object at the given index
- *
- * @throws ArrayIndexOutOfBoundsException If the provided index is
- * outside the bounds of the list <code>[0, size())</code>
- */
- public Object elementAt(int index)
- {
- return elements.elementAt(index);
- }
-
- /**
- * Convert the list to a string representation.
- *
- * @return A string representation of the list
- */
- public String toString()
- {
- return elements.toString();
- }
-
- /**
- * Gets the first index of a particular element in the list.
- *
- * @param element The element to search for
- *
- * @return The first index in the list at which an object
- * <code>obj</code> exists such that <code>obj.equals(element)</code> is
- * <code>true</code>; if no such object exists, the method returns
- * <code>-1</code>
- */
- public int indexOf(Object element)
- {
- return elements.indexOf(element);
- }
-
- /**
- * Gets the first index of a particular element in a list which occurs
- * <em>at or after</em> a particular index.
- *
- * @param element The element to search for
- * @param startIndex The index to begin searching at
- *
- * @return The first index in the list, greater than or equal to
- * <code>startIndex</code>, at which an object <code>obj</code> exists
- * such that <code>obj.equals(element)</code> is <code>true</code>; if no
- * such object exists, the method returns <code>-1</code>
- */
- public int indexOf(Object element, int startIndex)
- {
- return elements.indexOf(element, startIndex);
- }
-
- /**
- * Gets the last index of a particular element in the list.
- *
- * @param element The element to search for
- *
- * @return The last index in the list at which an object
- * <code>obj</code> exists such that <code>obj.equals(element)</code> is
- * <code>true</code>; if no such object exists, the method returns
- * <code>-1</code>
- */
- public int lastIndexOf(Object element)
- {
- return elements.lastIndexOf(element);
- }
-
- /**
- * Gets the last index of a particular element in a list which occurs
- * <em>at or before</em> a particular index.
- *
- * @param element The element to search for
- * @param endIndex The index to finish searching at
- *
- * @return The last index in the list, less than to or equal to
- * <code>endIndexIndex</code>, at which an object <code>obj</code> exists
- * such that <code>obj.equals(element)</code> is <code>true</code>; if no
- * such object exists, the method returns <code>-1</code>
- */
- public int lastIndexOf(Object element, int endIndex)
- {
- return elements.lastIndexOf(element, endIndex);
- }
-
- /**
- * Gets the list element at a particular index.
- *
- * @param index The index to get the list value at
- *
- * @return The list value at the provided index
- *
- * @throws ArrayIndexOutOfBoundsException If the provided index is
- * outside the bounds of the list <code>[0, size())</code>
- */
- public Object get(int index)
- {
- return elements.get(index);
- }
-
- /**
- * Sets the list element at a particular index.
- *
- * @param index The list index at which to set a value
- * @param element The value to set at the specified index
- *
- * @return The value previously held at the specified index
- *
- * @throws ArrayIndexOutOfBoundsException If the provided index is
- * outside the bounds of the list <code>[0, size())</code>
- */
- public Object set(int index, Object element)
- {
- Object result;
- result = elements.set(index, element);
- fireContentsChanged(this, index, index);
- return result;
- }
-
- /**
- * Inserts an element at a particular index in the list. Each element at
- * index <code>i >= index</code> is shifted to position <code>i+1</code>.
- * If <code>index</code> is equal to <code>size()</code>, this is
- * equivalent to appending an element to the array. Any
- * <code>index</code> greater than <code>size()</code> is illegal.
- *
- * @param index The index to insert the element at
- * @param element The element to insert at the index
- *
- * @throws ArrayIndexOutOfBoundsException If the provided index is
- * outside the bounds <code>[0, size()]</code>
- */
- public void add(int index, Object element)
- {
- elements.add(index, element);
- fireIntervalAdded(this, index, index);
- }
-
- /**
- * Inserts an element at the end of the list. This is equivalent to
- * calling <code>list.add(list.size(), element)</code>.
- *
- * @param element The element to add to the list
- */
- public void addElement(Object element)
- {
- int s = elements.size();
- elements.add(element);
- fireIntervalAdded(this, s, s);
- }
-
- /**
- * Gets the number of elements in the list.
- *
- * @return The number of elements in the list
- */
- public int size()
- {
- return elements.size();
- }
-
- /**
- * Gets an array containing the elements of the list.
- *
- * @return An array of the objects in the list, in the order they occur
- * in the list
- */
- public Object[] toArray()
- {
- return elements.toArray();
- }
-
- /**
- * Determines whether a particular element is a member of the list.
- *
- * @param element The element to search for
- *
- * @return <code>true</code> if <code>element</code> is a member of the
- * list, otherwise <code>false</code>
- */
- public boolean contains(Object element)
- {
- return elements.contains(element);
- }
-
- /**
- * Copies the list into a provided array. The provided array must be at
- * least as large as the list.
- *
- * @param array The array to copy the list into
- *
- * @throws IndexOutOfBoundsException if the array is too small to hold the
- * elements of the list
- */
- public void copyInto(Object[] array)
- {
- elements.copyInto(array);
- }
-
- /**
- * Erases all the elements of the list, setting the list's size to 0.
- */
- public void clear()
- {
- int s = elements.size();
- if (s > 0)
- {
- elements.clear();
- fireIntervalRemoved(this, 0, s - 1);
- }
- }
-
- /**
- * Removes the element at a particular index from the list.
- *
- * @param index The index of the element to remove
- *
- * @return The value at the index, which has been removed from the list
- *
- * @throws ArrayIndexOutOfBoundsException If the provided index is
- * outside the bounds of the list <code>[0, size())</code>
- */
- public Object remove(int index)
- {
- Object result;
- result = elements.remove(index);
- fireIntervalRemoved(this, index, index);
- return result;
- }
-
- /**
- * Determines whether the list is empty.
- *
- * @return <code>true</code> if the list is empty, otherwise
- * <code>false</code>
- */
- public boolean isEmpty()
- {
- return elements.isEmpty();
- }
-
- /**
- * Returns an {@link java.util.Enumeration} over the elements of the list.
- *
- * @return A new enumeration which iterates over the list
- */
- public Enumeration elements()
- {
- return elements.elements();
- }
-
- /**
- * Sets the capacity of the list to be equal to its size. The list's capacity
- * is the number of elements it can hold before it needs to be reallocated.
- * The list's size is the number of elements it currently holds.
- */
- public void trimToSize()
- {
- elements.trimToSize();
- }
-
- /**
- * Ensures that the list's capacity is at least equal to
- * <code>size</code>. The list's capacity is the number of elements it
- * can hold before it needs to be reallocated.
- *
- * @param size The capacity to ensure the list can hold
- */
- public void ensureCapacity(int size)
- {
- elements.ensureCapacity(size);
- }
-
- /**
- * Sets the size of the list to a particular value. If the specified size
- * is greater than the current size, the values at the excess list
- * indices are set to <code>null</code>. If the specified size is less
- * than the current size, the excess elements are removed from the list.
- *
- * @param size The new size to set the list to
- */
- public void setSize(int size)
- {
- int oldSize = elements.size();
- elements.setSize(size);
- if (oldSize < size)
- {
- fireIntervalAdded(this, oldSize, size - 1);
- }
- else if (oldSize > size)
- {
- this.fireIntervalRemoved(this, size, oldSize - 1);
- }
- }
-
- /**
- * Gets the capacity of the list. The list's capacity is the number of
- * elements it can hold before it needs to be reallocated.
- *
- * @return The capacity of the list
- */
- public int capacity()
- {
- return elements.capacity();
- }
-
- /**
- * Gets the first element in the list.
- *
- * @return The first element in the list
- */
- public Object firstElement()
- {
- return elements.firstElement();
- }
-
- /**
- * Gets the last element in the list.
- *
- * @return The last element in the list
- */
- public Object lastElement()
- {
- return elements.lastElement();
- }
-
- /**
- * Sets the list element at a particular index.
- *
- * @param element The value to set at the specified index
- * @param index The list index at which to set a value
- *
- * @throws ArrayIndexOutOfBoundsException If the provided index is
- * outside the bounds of the list <code>[0, size())</code>
- */
- public void setElementAt(Object element, int index)
- {
- elements.setElementAt(element, index);
- fireContentsChanged(this, index, index);
- }
-
- /**
- * Removes the element at a particular index from the list.
- *
- * @param index The index of the element to remove
- *
- * @throws ArrayIndexOutOfBoundsException If the provided index is
- * outside the bounds of the list <code>[0, size())</code>
- */
- public void removeElementAt(int index)
- {
- elements.remove(index);
- fireIntervalRemoved(this, index, index);
- }
-
- /**
- * Inserts an element at a particular index in the list. Each element at
- * index <code>i >= index</code> is shifted to position <code>i+1</code>.
- * If <code>index</code> is equal to <code>size()</code>, this is
- * equivalent to appending an element to the array. Any
- * <code>index</code> greater than <code>size()</code> is illegal.
- *
- * @param element The element to insert at the index
- * @param index The index to insert the element at
- *
- * @throws ArrayIndexOutOfBoundsException If the provided index is
- * outside the bounds <code>[0, size()]</code>
- */
- public void insertElementAt(Object element, int index)
- {
- elements.insertElementAt(element, index);
- fireIntervalAdded(this, index, index);
- }
-
- /**
- * Removes the first occurrence of a particular element in the list. If the
- * element does not exist in the list, nothing happens.
- *
- * @param element The element to remove
- *
- * @return <code>true</code> if the element existed in the list (and was
- * removed), <code>false</code> otherwise
- */
- public boolean removeElement(Object element)
- {
- int index;
- index = elements.indexOf(element);
- if (index != -1)
- {
- elements.remove(index);
- fireIntervalRemoved(this, index, index);
- return true;
- }
- return false;
- }
-
- /**
- * Remove all elements in the list.
- */
- public void removeAllElements()
- {
- int size;
- size = size();
- if (size > 0)
- {
- elements.clear();
- fireIntervalRemoved(this, 0, size - 1);
- }
- }
-
- /**
- * Remove all elements between <code>startIndex</code> and
- * <code>endIndex</code> inclusive.
- *
- * @param startIndex The first index in the range to remove
- * @param endIndex The last index in the range to remove
- *
- * @throws ArrayIndexOutOfBoundsException if either index is outside the
- * valid range of indices for this list <code>[0, size())</code>
- * @throws IllegalArgumentException if <code>startIndex > endIndex</code>
- */
- public void removeRange(int startIndex, int endIndex)
- {
- int index;
- if (startIndex > endIndex)
- throw new IllegalArgumentException();
- for (index = endIndex; index >= startIndex; index--)
- elements.remove(index);
- fireIntervalRemoved(this, startIndex, endIndex);
- }
-
- /**
- * Gets the size of the list.
- *
- * @return The number of elements currently in the list
- */
- public int getSize()
- {
- return elements.size();
- }
-
- /**
- * Gets the list element at a particular index.
- *
- * @param index The index to get the list value at
- *
- * @return The list value at the provided index
- *
- * @throws ArrayIndexOutOfBoundsException If the provided index is
- * outside the bounds of the list <code>[0, size())</code>
- */
- public Object getElementAt(int index)
- {
- return elements.get(index);
- }
-}
diff --git a/libjava/javax/swing/DefaultListSelectionModel.java b/libjava/javax/swing/DefaultListSelectionModel.java
deleted file mode 100644
index b321ce53172..00000000000
--- a/libjava/javax/swing/DefaultListSelectionModel.java
+++ /dev/null
@@ -1,620 +0,0 @@
-/* DefaultListSelectionModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.BitSet;
-import java.util.EventListener;
-
-import javax.swing.event.EventListenerList;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-/**
- * <p>This class provides a default implementation of {@link
- * ListSelectioModel}, which is used by {@link javax.swing.JList} and
- * similar classes to manage the selection status of a number of data
- * elements. </p>
- *
- * <p>The class is organized <em>abstractly</em> as a set of intervals of
- * integers. Each interval indicates an inclusive range of indices in a
- * list -- held by some other object and unknown to this class -- which is
- * considered "selected". There are various accessors for querying and
- * modifying the set of intervals, with simplified forms accepting a single
- * index, representing an interval with only one element. </p>
- */
-public class DefaultListSelectionModel implements Cloneable,
- ListSelectionModel,
- Serializable
-{
- private static final long serialVersionUID = -5718799865110415860L;
-
- /** The list of ListSelectionListeners subscribed to this selection model. */
- protected EventListenerList listenerList = new EventListenerList();
-
-
- /**
- * The current list selection mode. Must be one of the numeric constants
- * <code>SINGLE_SELECTION</code>, <code>SINGLE_INTERVAL_SELECTION</code>
- * or <code>MULTIPLE_INTERVAL_SELECTION</code> from {@link
- * ListSelectionModel}. The default value is
- * <code>MULTIPLE_INTERVAL_SELECTION</code>.
- */
- int selectionMode = MULTIPLE_INTERVAL_SELECTION;
-
-
- /**
- * The index of the "lead" of the most recent selection. The lead is the
- * second argument in any call to {@link #setSelectionInterval}, {@link
- * #addSelectionInterval} or {@link #removeSelectionInterval}. Generally
- * the lead refers to the most recent position a user dragged their mouse
- * over.
- */
- int leadSelectionIndex = -1;
-
-
- /**
- * The index of the "anchor" of the most recent selection. The anchor is
- * the first argument in any call to {@link #setSelectionInterval},
- * {@link #addSelectionInterval} or {@link
- * #removeSelectionInterval}. Generally the anchor refers to the first
- * recent position a user clicks when they begin to drag their mouse over
- * a list.
- *
- * @see #getAnchorSelectionIndex
- * @see #setAnchorSelectionIndex
- */
- int anchorSelectionIndex = -1;
-
-
- /**
- * controls the range of indices provided in any {@link
- * ListSelectionEvent} fired by the selectionModel. Let
- * <code>[A,L]</code> be the range of indices between {@link
- * anchorSelectionIndex} and {@link leadSelectionIndex} inclusive, and
- * let <code>[i0,i1]</code> be the range of indices changed in a given
- * call which generates a {@link ListSelectionEvent}. Then when this
- * property is <code>true</code>, the {@link ListSelectionEvent} contains
- * the range <code>[A,L] union [i0,i1]</code>; when <code>false</code> it
- * will contain only <code>[i0,i1]</code>. The default is
- * <code>true</code>.
- *
- * @see #isLeadAnchorNotificationEnabled
- * @see #setLeadAnchorNotificationEnabled
- */
- protected boolean leadAnchorNotificationEnabled = true;
-
-
- /**
- * Whether the selection is currently "adjusting". Any {@link
- * ListSelectionEvent} events constructed in response to changes in this
- * list selection model will have their {@link
- * ListSelectionEvent#isAdjusting} field set to this value.
- *
- * @see #getValueIsAdjusting
- * @see #setValueIsAdjusting
- */
- boolean valueIsAdjusting = false;
-
-
- /**
- * The current set of "intervals", represented simply by a {@link
- * java.util.BitSet}. A set bit indicates a selected index, whereas a
- * cleared bit indicates a non-selected index.
- */
- BitSet sel = new BitSet();
-
-
- /**
- * Gets the value of the {@link #selectionMode} property.
- *
- * @return The current value of the property
- */
- public int getSelectionMode()
- {
- return selectionMode;
- }
-
- /**
- * Sets the value of the {@link #selectionMode} property.
- *
- * @param a The new value of the property
- */
- public void setSelectionMode(int a)
- {
- selectionMode = a;
- }
-
- /**
- * Gets the value of the {@link #anchorSelectionIndex} property.
- *
- * @return The current property value
- *
- * @see #setAnchorSelectionIndex
- */
- public int getAnchorSelectionIndex()
- {
- return anchorSelectionIndex;
- }
-
- /**
- * Sets the value of the {@link #anchorSelectionIndex} property.
- *
- * @param anchorIndex The new property value
- *
- * @see #getAnchorSelectionIndex
- */
- public void setAnchorSelectionIndex(int anchorIndex)
- {
- anchorSelectionIndex = anchorIndex;
- }
-
- /**
- * Gets the value of the {@link #leadSelectionIndex} property.
- *
- * @return The current property value
- *
- * @see #setLeadSelectionIndex
- */
- public int getLeadSelectionIndex()
- {
- return leadSelectionIndex;
- }
-
- /**
- * <p>Sets the value of the {@link #anchorSelectionIndex} property. As a
- * side effect, alters the selection status of two ranges of indices. Let
- * <code>OL</code> be the old lead selection index, <code>NL</code> be
- * the new lead selection index, and <code>A</code> be the anchor
- * selection index. Then if <code>A</code> is a valid selection index,
- * one of two things happens depending on the seleciton status of
- * <code>A</code>:</p>
- *
- * <ul>
- *
- * <li><code>isSelectedIndex(A) == true</code>: set <code>[A,OL]</code>
- * to <em>deselected</em>, then set <code>[A,NL]</code> to
- * <em>selected</em>.</li>
- *
- * <li><code>isSelectedIndex(A) == false</code>: set <code>[A,OL]</code>
- * to <em>selected</em>, then set <code>[A,NL]</code> to
- * <em>deselected</em>.</li>
- *
- * </ul>
- *
- * <p>This method generates at most a single {@link ListSelectionEvent}
- * despite changing multiple ranges. The range of values provided to the
- * {@link ListSelectionEvent} includes only the minimum range of values
- * which changed selection status between the beginning and end of the
- * method.</p>
- *
- * @param anchorIndex The new property value
- *
- * @see #getAnchorSelectionIndex
- */
- public void setLeadSelectionIndex(int leadIndex)
- {
- int oldLeadIndex = leadSelectionIndex;
- leadSelectionIndex = leadIndex;
-
- if (anchorSelectionIndex == -1)
- return;
-
- int R1 = Math.min(anchorSelectionIndex, oldLeadIndex);
- int R2 = Math.max(anchorSelectionIndex, oldLeadIndex);
- int S1 = Math.min(anchorSelectionIndex, leadIndex);
- int S2 = Math.max(anchorSelectionIndex, leadIndex);
-
- int lo = Math.min(R1, S1);
- int hi = Math.max(R2, S2);
-
- BitSet oldRange = sel.get(lo, hi+1);
-
- if (isSelectedIndex(anchorSelectionIndex))
- {
- sel.clear(R1, R2+1);
- sel.set(S1, S2+1);
- }
- else
- {
- sel.set(R1, R2+1);
- sel.clear(S1, S2+1);
- }
-
- BitSet newRange = sel.get(lo, hi+1);
- newRange.xor(oldRange);
-
- int beg = sel.nextSetBit(0), end = -1;
- for(int i=beg; i >= 0; i=sel.nextSetBit(i+1))
- {
- end = i;
- }
- fireValueChanged(beg, end, valueIsAdjusting);
- }
-
- /**
- * Gets the value of the {@link #leadAnchorNotificationEnabled} property.
- *
- * @return The current property value
- *
- * @see #setLeadAnchorNotificationEnabled
- */
- public boolean isLeadAnchorNotificationEnabled()
- {
- return leadAnchorNotificationEnabled;
- }
-
- /**
- * Sets the value of the {@link #leadAnchorNotificationEnabled} property.
- *
- * @param flag The new property value
- *
- * @see #getLeadAnchorNotificationEnabled
- */
- public void setLeadAnchorNotificationEnabled(boolean l)
- {
- leadAnchorNotificationEnabled = l;
- }
-
-
- /**
- * Gets the value of the {@link #valueIsAdjusting} property.
- *
- * @return The current property value
- *
- * @see #setValueIsAdjusting
- */
- public boolean getValueIsAdjusting()
- {
- return valueIsAdjusting;
- }
-
- /**
- * Sets the value of the {@link #valueIsAdjusting} property.
- *
- * @param v The new property value
- *
- * @see #getValueIsAdjusting
- */
- public void setValueIsAdjusting(boolean v)
- {
- valueIsAdjusting = v;
- }
-
- /**
- * Determines whether the selection is empty.
- *
- * @return <code>true</code> if the selection is empty, otherwise
- * <code>false</code>
- */
- public boolean isSelectionEmpty()
- {
- return sel.isEmpty();
- }
-
-
- /**
- * Gets the smallest index which is currently a member of a selection
- * interval.
- *
- * @return The least integer <code>i</code> such that <code>i >=
- * 0</code> and <code>i</code> is a member of a selected interval, or
- * <code>-1</code> if there are no selected intervals
- *
- * @see #getMaxSelectionIndex
- */
- public int getMinSelectionIndex()
- {
- if (isSelectionEmpty())
- return -1;
-
- return sel.nextSetBit(0);
- }
-
- /**
- * Gets the largest index which is currently a member of a selection
- * interval.
- *
- * @return The greatest integer <code>i</code> such that <code>i >=
- * 0</code> and <code>i</code> is a member of a selected interval, or
- * <code>-1</code> if there are no selected intervals
- *
- * @see #getMinSelectionIndex
- */
- public int getMaxSelectionIndex()
- {
- if (isSelectionEmpty())
- return -1;
-
- int mx = -1;
- for(int i=sel.nextSetBit(0); i >= 0; i=sel.nextSetBit(i+1))
- {
- mx = i;
- }
- return mx;
- }
-
- /**
- * Determines whether a particular index is a member of a selection
- * interval.
- *
- * @param a The index to search for
- *
- * @return <code>true</code> if the index is a member of a selection interval,
- * otherwise <code>false</code>
- */
- public boolean isSelectedIndex(int a)
- {
- return sel.get(a);
- }
-
- /**
- * If the {@link #selectionMode} property is equal to
- * <code>SINGLE_SELECTION</code> or
- * <code>SINGLE_INTERVAL_SELECTION</code>, equivalent to calling
- * <code>setSelectionInterval(index1, index2)</code>; otherwise adds the
- * range <code>[index0, index1]</code> to the selection interval set.
- *
- * @param index0 The beginning of the range of indices to select
- * @param index1 The end of the range of indices to select
- *
- * @see #setSelectionInterval
- * @see #removeSelectionInterval
- */
- public void addSelectionInterval(int index0, int index1)
- {
- if (selectionMode == SINGLE_SELECTION
- || selectionMode == SINGLE_INTERVAL_SELECTION)
- sel.clear();
-
- if (selectionMode == SINGLE_SELECTION)
- index0 = index1;
-
- int lo = Math.min(index0, index1);
- int hi = Math.max(index0, index1);
-
- sel.set(lo, hi+1);
- fireValueChanged(lo, hi, valueIsAdjusting);
- }
-
-
- /**
- * Deselects all indices in the inclusive range
- * <code>[index0,index1]</code>.
- *
- * @param index0 The beginning of the range of indices to deselect
- * @param index1 The end of the range of indices to deselect
- *
- * @see #addSelectionInterval
- * @see #setSelectionInterval
- */
- public void removeSelectionInterval(int index0,
- int index1)
- {
- int lo = Math.min(index0, index1);
- int hi = Math.max(index0, index1);
- sel.clear(lo, hi+1);
- fireValueChanged(lo, hi, valueIsAdjusting);
- }
-
- /**
- * Removes all intervals in the selection set.
- */
- public void clearSelection()
- {
- int sz = sel.size();
- sel.clear();
- fireValueChanged(0, sz, valueIsAdjusting);
- }
-
- /**
- * Clears the current selection and marks a given interval as
- * "selected". If the current selection mode is
- * <code>SINGLE_SELECTION</code> only the index <code>index2</code> is
- * selected.
- *
- * @param index0 The low end of the new selection
- * @param index1 The high end of the new selection
- */
- public void setSelectionInterval(int index0, int index1)
- {
- sel.clear();
- if (selectionMode == SINGLE_SELECTION)
- index0 = index1;
-
- int lo = Math.min(index0, index1);
- int hi = Math.max(index0, index1);
- sel.set(lo, hi+1);
- fireValueChanged(lo, hi, valueIsAdjusting);
- }
-
- /**
- * Inserts a number of indices either before or after a particular
- * position in the set of indices. Renumbers all indices after the
- * inserted range. The new indices in the inserted range are not
- * selected. This method is typically called to synchronize the selection
- * model with an inserted range of elements in a {@link ListModel}.
- *
- * @param index The position to insert indices at
- * @param length The number of indices to insert
- * @param before Indicates whether to insert the indices before the index
- * or after it
- */
- public void insertIndexInterval(int index,
- int length,
- boolean before)
- {
- if (!before)
- {
- index++;
- length--;
- }
- BitSet tmp = sel.get(index, sel.size());
- sel.clear(index, sel.size());
- int n = tmp.size();
- for (int i = 0; i < n; ++i)
- sel.set(index + length + i, tmp.get(i));
- }
-
- /**
- * Removes a range from the set of indices. Renumbers all indices after
- * the removed range. This method is typically called to synchronize the
- * selection model with a deleted range of elements in a {@link
- * ListModel}.
- *
- * @param index0 The first index to remove (inclusive)
- * @param index1 The last index to remove (inclusive)
- */
- public void removeIndexInterval(int index0,
- int index1)
- {
- int lo = Math.min(index0, index1);
- int hi = Math.max(index0, index1);
-
- BitSet tmp = sel.get(hi, sel.size());
- sel.clear(lo, sel.size());
- int n = tmp.size();
- for (int i = 0; i < n; ++i)
- sel.set(lo + i, tmp.get(i));
- }
-
- /**
- * Fires a {@link ListSelectionEvent} to all the listeners of type {@link
- * ListSelectionListener} registered with this selection model.
- *
- * @param firstIndex The low index of the changed range
- * @param lastIndex The high index of the changed range
- */
- protected void fireValueChanged(int firstIndex, int lastIndex)
- {
- fireValueChanged(firstIndex, lastIndex, getValueIsAdjusting());
- }
-
- /**
- * Fires a {@link ListSelectionEvent} to all the listeners of type {@link
- * ListSelectionListener} registered with this selection model.
- *
- * @param firstIndex The low index of the changed range
- * @param lastIndex The high index of the changed range
- * @param isAdjusting Whether this change is part of a seqence of adjustments
- * made to the selection, such as during interactive scrolling
- */
- protected void fireValueChanged(int firstIndex, int lastIndex,
- boolean isAdjusting)
- {
- ListSelectionEvent evt = new ListSelectionEvent(this, firstIndex,
- lastIndex, isAdjusting);
- ListSelectionListener[] listeners = getListSelectionListeners();
- for (int i = 0; i < listeners.length; ++i)
- listeners[i].valueChanged(evt);
- }
-
- /**
- * Adds a listener.
- *
- * @param listener The listener to add
- *
- * @see removeListSelectionListener
- * @see getListSelectionListeners
- */
- public void addListSelectionListener(ListSelectionListener listener)
- {
- listenerList.add(ListSelectionListener.class, listener);
- }
-
- /**
- * Removes a registered listener.
- *
- * @param listener The listener to remove
- *
- * @see addListSelectionListener
- * @see getListSelectionListeners
- */
- public void removeListSelectionListener(ListSelectionListener listener)
- {
- listenerList.remove(ListSelectionListener.class, listener);
- }
-
- /**
- * Returns an array of all registerers listeners.
- *
- * @param listenerType The type of listener to retrieve
- *
- * @return The array
- *
- * @see getListSelectionListener
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
- /**
- * Returns an array of all registerd list selection listeners.
- *
- * @return the array
- *
- * @see addListSelectionListener
- * @see removeListSelectionListener
- * @see getListeners
- * @since 1.4
- */
- public ListSelectionListener[] getListSelectionListeners()
- {
- return (ListSelectionListener[]) getListeners(ListSelectionListener.class);
- }
-
- /**
- * Returns a clone of this object.
- * <code>listenerList</code> don't gets duplicated.
- *
- * @return the cloned object
- *
- * @throws CloneNotSupportedException if an error occurs
- */
- public Object clone()
- throws CloneNotSupportedException
- {
- DefaultListSelectionModel model =
- (DefaultListSelectionModel) super.clone();
- model.sel = (BitSet) sel.clone();
- return model;
- }
-}
diff --git a/libjava/javax/swing/DefaultSingleSelectionModel.java b/libjava/javax/swing/DefaultSingleSelectionModel.java
deleted file mode 100644
index 039883e23ae..00000000000
--- a/libjava/javax/swing/DefaultSingleSelectionModel.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/* DefaultSingleSelectionModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.EventListener;
-
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-/**
- * DefaultSingleSelectionModel
- *
- * @author Andrew Selkirk
- */
-public class DefaultSingleSelectionModel
- implements SingleSelectionModel, Serializable
-{
- private static final long serialVersionUID = 3676229404753786004L;
-
- /**
- * changeEvent
- */
- protected transient ChangeEvent changeEvent = new ChangeEvent(this);
-
- /**
- * listenerList
- */
- protected EventListenerList listenerList = new EventListenerList();
-
- /**
- * index
- */
- private int index = -1;
-
- /**
- * Constructor DefaultSingleSelectionModel
- */
- public DefaultSingleSelectionModel()
- {
- // Do nothing.
- }
-
- /**
- * getSelectedIndex
- * @return int
- */
- public int getSelectedIndex()
- {
- return index;
- }
-
- /**
- * setSelectedIndex
- * @param index TODO
- */
- public void setSelectedIndex(int index)
- {
- this.index = index;
- fireStateChanged();
- }
-
- /**
- * clearSelection
- */
- public void clearSelection()
- {
- index = -1;
- fireStateChanged();
- }
-
- /**
- * isSelected
- * @return boolean
- */
- public boolean isSelected()
- {
- return index != -1;
- }
-
- /**
- * addChangeListener
- *
- * @param listener the listener to add
- */
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- /**
- * removeChangeListener
- *
- * @param listener the listener to remove
- */
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- /**
- * fireStateChanged
- */
- protected void fireStateChanged()
- {
- ChangeListener[] listeners = getChangeListeners();
-
- for (int i = 0; i < listeners.length; i++)
- listeners[i].stateChanged(changeEvent);
- }
-
- /**
- * getListeners
- *
- * @param listenerClass the type fo listener
- *
- * @return an array of listeners
- *
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerClass)
- {
- return listenerList.getListeners(listenerClass);
- }
-
- /**
- * getChangeListeners
- *
- * @since 1.4
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) getListeners(ChangeListener.class);
- }
-}
diff --git a/libjava/javax/swing/DesktopManager.java b/libjava/javax/swing/DesktopManager.java
deleted file mode 100644
index 300d66517ba..00000000000
--- a/libjava/javax/swing/DesktopManager.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/* DesktopManager.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * DesktopManagers are responsible for implementing the behaviours for the
- * JInternalFrames that belong to JDesktopPanes. Actions such as maximizing,
- * minimizing, iconifying, etc will be delegated to the DesktopManager.
- */
-public interface DesktopManager
-{
- /**
- * This method will cause the JInternalFrame to be displayed in the set
- * location. This usually is not needed since the user will add the
- * JInternalFrame to a Container separately.
- *
- * @param frame The JInternalFrame to open.
- */
- void openFrame(JInternalFrame frame);
-
- /**
- * This method should remove the JInternalFrame from its parent.
- *
- * @param frame The JInternalFrame to close.
- */
- void closeFrame(JInternalFrame frame);
-
- /**
- * This method should maximize the JInternalFrame to match its parent's
- * bounds.
- *
- * @param frame The JInternalFrame to maximize.
- */
- void maximizeFrame(JInternalFrame frame);
-
- /**
- * This method should restore the JInternalFrame to its normal bounds.
- *
- * @param frame The JInternalFrame to minimize.
- */
- void minimizeFrame(JInternalFrame frame);
-
- /**
- * This method should remove the JInternalFrame from its parent and replace
- * it with a JDesktopIcon.
- *
- * @param frame The JInternalFrame to iconify.
- */
- void iconifyFrame(JInternalFrame frame);
-
- /**
- * This method should remove the JDesktopIcon from its parent and replace it
- * with the JInternalFrame that the JDesktopIcon represents.
- *
- * @param frame The JInternalFrame to deiconify.
- */
- void deiconifyFrame(JInternalFrame frame);
-
- /**
- * This method should give focus to the JInternalFrame and its default focus
- * owner.
- *
- * @param frame The JInternalFrame to activate.
- */
- void activateFrame(JInternalFrame vframe);
-
- /**
- * This method should be called when the JInternalFrame gets deselected and
- * subsequently loses focus.
- *
- * @param frame The JInternalFrame to deactivate.
- */
- void deactivateFrame(JInternalFrame frame);
-
- /**
- * This method should be called in preparation for dragging. This needs to
- * be called prior to dragFrame calls so that the DesktopManager can
- * prepare any state information.
- *
- * @param frame The JInternalFrame to prepare for dragging.
- */
- void beginDraggingFrame(JComponent frame);
-
- /**
- * This method drags the given JInternalFrame to the given x and y
- * coordinates.
- *
- * @param frame The JInternalFrame to drag.
- * @param x The new x coordinate.
- * @param y The new y coordinate.
- */
- void dragFrame(JComponent frame, int x, int y);
-
- /**
- * This method should be called after dragFrame calls. Any information used
- * by the DesktopManager for dragging the JInternalFrame can be cleared.
- *
- * @param frame The JInternalFrame that finished dragging.
- */
- void endDraggingFrame(JComponent frame);
-
- /**
- * This method should be called prior to any resizeFrame calls. Any state
- * information needed by the DesktopManager to resize the JInternalFrame
- * will be prepared here.
- *
- * @param frame The JInternalFrame to resize.
- * @param direction One of eight directions specified by SwingConstants.
- */
- void beginResizingFrame(JComponent frame, int direction);
-
- /**
- * This method is called to resize the given JInternalFrame to the given
- * bounds.
- *
- * @param frame The JInternalFrame to resize.
- * @param x The new x coordinate.
- * @param y The new y coordinate.
- * @param width The new width.
- * @param height The new height.
- */
- void resizeFrame(JComponent frame, int x, int y, int width, int height);
-
- /**
- * This method is called to signify that the resize is finished. Any
- * information used to resize the JInternalFrame can now be cleared.
- *
- * @param frame The JInternalFrame that just finished dragging.
- */
- void endResizingFrame(JComponent frame);
-
- /**
- * This method does the actual work for reshaping the JInternalFrame.
- *
- * @param frame The JInternalFrame to resize.
- * @param x The new x coordinate.
- * @param y The new y coordinate.
- * @param width The new width.
- * @param height The new height.
- */
- void setBoundsForFrame(JComponent frame, int x, int y, int width, int height);
-} // DesktopManager
diff --git a/libjava/javax/swing/FocusManager.java b/libjava/javax/swing/FocusManager.java
deleted file mode 100644
index 45b9685e05d..00000000000
--- a/libjava/javax/swing/FocusManager.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/* FocusManager.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.DefaultKeyboardFocusManager;
-import java.awt.event.KeyEvent;
-
-/**
- * FocusManager
- * @author Andrew Selkirk
- * @version 1.0
- */
-public abstract class FocusManager extends DefaultKeyboardFocusManager
-{
-
- //-------------------------------------------------------------
- // Classes ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * DisabledFocusManager
- */
- static class DisabledFocusManager extends FocusManager {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor DisabledFocusManager
- */
- DisabledFocusManager() {
- // TODO
- } // DisabledFocusManager()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * processKeyEvent
- * @param component TODO
- * @param event TODO
- */
- public void processKeyEvent(Component component, KeyEvent event) {
- // TODO
- } // processKeyEvent()
-
- /**
- * focusNextComponent
- * @param component TODO
- */
- public void focusNextComponent(Component component) {
- // TODO
- } // focusNextComponent()
-
- /**
- * focusPreviousComponent
- * @param value0 TODO
- */
- public void focusPreviousComponent(Component value0) {
- // TODO
- } // focusPreviousComponent()
-
-
- } // DisabledFocusManager
-
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * FOCUS_MANAGER_CLASS_PROPERTY
- */
- public static final String FOCUS_MANAGER_CLASS_PROPERTY = "FocusManagerClassName";
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor FocusManager
- */
- public FocusManager() {
- // TODO
- } // FocusManager()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getCurrentManager
- * @returns FocusManager
- */
- public static FocusManager getCurrentManager() {
- return null; // TODO
- } // getCurrentManager()
-
- /**
- * setCurrentManager
- * @param manager TODO
- */
- public static void setCurrentManager(FocusManager manager) {
- // TODO
- } // setCurrentManager()
-
- /**
- * disableSwingFocusManager
- * @deprecated 1.4
- */
- public static void disableSwingFocusManager() {
- // TODO
- } // disableSwingFocusManager()
-
- /**
- * isFocusManagerEnabled
- * @return boolean
- * @deprecated 1.4
- */
- public static boolean isFocusManagerEnabled() {
- return false; // TODO
- } // isFocusManagerEnabled()
-
- /**
- * processKeyEvent
- * @param component TODO
- * @param event TODO
- */
- public abstract void processKeyEvent(Component component, KeyEvent event);
-
- /**
- * focusNextComponent
- * @param component TODO
- */
- public abstract void focusNextComponent(Component component);
-
- /**
- * focusPreviousComponent
- * @param component TODO
- */
- public abstract void focusPreviousComponent(Component component);
-
-
-} // FocusManager
diff --git a/libjava/javax/swing/GrayFilter.java b/libjava/javax/swing/GrayFilter.java
deleted file mode 100644
index 3e4573b9b0f..00000000000
--- a/libjava/javax/swing/GrayFilter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* GrayFilter.java -- Java class for filtering Pixels to produce Gray Pictures
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Image;
-import java.awt.Toolkit;
-import java.awt.image.FilteredImageSource;
-import java.awt.image.RGBImageFilter;
-
-public class GrayFilter extends RGBImageFilter
-{
- private boolean b;
- private int p;
-
- /**
- * Create a GrayFilter. If b is true then brighten. Also, indicate how much gray.
- *
- * @param b if brighten
- * @param p percent of gray, 0 - 100
- */
- public GrayFilter(boolean b, int p)
- {
- this.b = b; //FIXME - HANDLE THIS
- this.p = p;
- }
-
- /**
- * Create grayed image
- *
- * @param src image to gray
- *
- * @return a grayed image
- */
- public static Image createDisabledImage(Image src)
- {
- return (Toolkit.getDefaultToolkit().
- createImage(new FilteredImageSource(src.getSource(),
- new GrayFilter(false, 100))));
- }
-
- /**
- * Filter RGB to gray
- */
- public int filterRGB(int x, int y, int rgb)
- {
- return (int) (p * (0.299 * ((0xff0000 & rgb) >> 16)
- + 0.587 * ((0xff00 & rgb) >> 8) + 0.114 * (0xff & rgb)));
- }
-}
diff --git a/libjava/javax/swing/Icon.java b/libjava/javax/swing/Icon.java
deleted file mode 100644
index cd8b6d590f6..00000000000
--- a/libjava/javax/swing/Icon.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Icon.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Graphics;
-
-public interface Icon
-{
- int getIconHeight();
- int getIconWidth();
- void paintIcon(Component c, Graphics g, int x, int y);
-}
diff --git a/libjava/javax/swing/ImageIcon.java b/libjava/javax/swing/ImageIcon.java
deleted file mode 100644
index 3f2d0120e0a..00000000000
--- a/libjava/javax/swing/ImageIcon.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/* ImageIcon.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Graphics;
-import java.awt.Image;
-import java.awt.MediaTracker;
-import java.awt.Toolkit;
-import java.awt.image.ImageObserver;
-import java.io.Serializable;
-import java.net.URL;
-
-
-public class ImageIcon
- implements Icon, Serializable
-{
- private static final long serialVersionUID = 532615968316031794L;
-
- /** A dummy Component that is used in the MediaTracker. */
- protected static Component component = new Component(){};
-
- /** The MediaTracker used to monitor the loading of images. */
- protected static MediaTracker tracker = new MediaTracker(component);
-
- /** The ID that is used in the tracker. */
- private static int id;
-
- Image image;
- String description;
- ImageObserver observer;
-
- /** The image loading status. */
- private int loadStatus;
-
- public ImageIcon()
- {
- }
-
- public ImageIcon(String file)
- {
- this(file, file);
- }
-
- public ImageIcon(String file, String description)
- {
- this(Toolkit.getDefaultToolkit().getImage(file), description);
- }
-
- public ImageIcon(byte[] imageData)
- {
- this(imageData, null);
- }
-
- public ImageIcon(byte[] imageData, String description)
- {
- this(Toolkit.getDefaultToolkit().createImage(imageData), description);
- }
-
- public ImageIcon(URL url)
- {
- this(url, null);
- }
-
- public ImageIcon(URL url, String description)
- {
- this(Toolkit.getDefaultToolkit().getImage(url), description);
- }
-
- public ImageIcon(Image image)
- {
- this(image, null);
- }
-
- public ImageIcon(Image image, String description)
- {
- setImage(image);
- setDescription(description);
- }
-
- public ImageObserver getImageObserver()
- {
- return observer;
- }
-
- public void setImageObserver(ImageObserver newObserver)
- {
- observer = newObserver;
- }
-
- public Image getImage()
- {
- return image;
- }
-
- public void setImage(Image image)
- {
- loadImage(image);
- this.image = image;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- public int getIconHeight()
- {
- return image.getHeight(observer);
- }
-
- public int getIconWidth()
- {
- return image.getWidth(observer);
- }
-
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- g.drawImage(image, x, y, observer != null ? observer : c);
- }
-
- /**
- * Loads the image and blocks until the loading operation is finished.
- *
- * @param image the image to be loaded
- */
- protected void loadImage(Image image)
- {
- try
- {
- tracker.addImage(image, id);
- id++;
- tracker.waitForID(id - 1);
- }
- catch (InterruptedException ex)
- {
- ; // ignore this for now
- }
- finally
- {
- loadStatus = tracker.statusID(id - 1, false);
- }
- }
-
- /**
- * Returns the load status of the icon image.
- *
- * @return the load status of the icon image
- *
- * @see {@link MediaTracker.COMPLETE}
- * @see {@link MediaTracker.ABORTED}
- * @see {@link MediaTracker.ERRORED}
- */
- public int getImageLoadStatus()
- {
- return loadStatus;
- }
-}
diff --git a/libjava/javax/swing/InputMap.java b/libjava/javax/swing/InputMap.java
deleted file mode 100644
index afc431d4836..00000000000
--- a/libjava/javax/swing/InputMap.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/* InputMap.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * @author Andrew Selkirk
- * @author Michael Koch
- *
- * @since 1.3
- */
-public class InputMap
- implements Serializable
-{
- private static final long serialVersionUID = -5429059542008604257L;
-
- /**
- * inputMap
- */
- private Map inputMap = new HashMap();
-
- /**
- * parent
- */
- private InputMap parent;
-
- /**
- * Creates a new <code>InputMap</code> instance.
- */
- public InputMap()
- {
- // TODO
- }
-
- /**
- * Returns the binding for keystroke.
- *
- * @param key the key of the enty
- *
- * @return the binding associated with keystroke may be null
- */
- public Object get(KeyStroke keystroke)
- {
- Object result = inputMap.get(keystroke);
-
- if (result == null && parent != null)
- result = parent.get(keystroke);
- return result;
- }
-
- /**
- * Puts a new entry into the <code>InputMap</code>.
- * If actionMapKey is null an existing entry will be removed.
- *
- * @param keystroke the keystroke for the entry
- * @param actionMapKey the action.
- */
- public void put(KeyStroke keystroke, Object actionMapKey)
- {
- if (actionMapKey == null)
- inputMap.remove(keystroke);
- else
- inputMap.put(keystroke, actionMapKey);
- }
-
- /**
- * Remove an entry from the <code>InputMap</code>.
- *
- * @param key the key of the entry to remove
- */
- public void remove(KeyStroke keystroke)
- {
- inputMap.remove(keystroke);
- }
-
- /**
- * Returns the parent of this <code>InputMap</code>.
- *
- * @return the parent, may be null.
- */
- public InputMap getParent()
- {
- return parent;
- }
-
- /**
- * Sets a parent for this <code>InputMap</code>.
- *
- * @param parentMap the new parent
- */
- public void setParent(InputMap parentMap)
- {
- parent = parentMap;
- }
-
- /**
- * Returns the number of entries in this <code>InputMap</code>.
- *
- * @return the number of entries
- */
- public int size()
- {
- return inputMap.size();
- }
-
- /**
- * Clears the <code>InputMap</code>.
- */
- public void clear()
- {
- inputMap.clear();
- }
-
- /**
- * Returns all keys of entries in this <code>InputMap</code>.
- *
- * @return an array of keys
- */
- public KeyStroke[] keys()
- {
- KeyStroke[] array = new KeyStroke[size()];
- return (KeyStroke[]) inputMap.keySet().toArray(array);
- }
-
- /**
- * Returns all keys of entries in this <code>InputMap</code>
- * and all its parents.
- *
- * @return an array of keys
- */
- public KeyStroke[] allKeys()
- {
- Set set = new HashSet();
-
- if (parent != null)
- set.addAll(Arrays.asList(parent.allKeys()));
-
- set.addAll(inputMap.keySet());
- KeyStroke[] array = new KeyStroke[size()];
- return (KeyStroke[]) set.toArray(array);
- }
-
- /**
- * writeObject
- *
- * @param stream the stream to write to
- *
- * @exception IOException If an error occurs
- */
- private void writeObject(ObjectOutputStream stream) throws IOException
- {
- // TODO
- }
-
- /**
- * readObject
- *
- * @param stream the stream to read from
- *
- * @exception ClassNotFoundException If the serialized class cannot be found
- * @exception IOException If an error occurs
- */
- private void readObject(ObjectInputStream stream)
- throws ClassNotFoundException, IOException
- {
- // TODO
- }
-}
diff --git a/libjava/javax/swing/InputVerifier.java b/libjava/javax/swing/InputVerifier.java
deleted file mode 100644
index 836c1a558ad..00000000000
--- a/libjava/javax/swing/InputVerifier.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* InputVerifier.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-
-/**
- * InputVerifier
- * @author Andrew Selkirk
- * @version 1.0
- */
-public abstract class InputVerifier
-{
- /**
- * Creates a <code>InputVerifier</code>
- */
- public InputVerifier()
- {
- }
-
- /**
- * verify
- *
- * @param component the component to verify
- *
- * @return <code>true</code> if valid, <code>false</code> otherwise.
- */
- public abstract boolean verify(JComponent component);
-
- /**
- * shouldYieldFocus
- *
- * @param component the component to verify
- *
- * @return <code>true</code> if valid, <code>false</code> otherwise.
- */
- public boolean shouldYieldFocus(JComponent component)
- {
- return verify(component);
- }
-}
diff --git a/libjava/javax/swing/InternalFrameFocusTraversalPolicy.java b/libjava/javax/swing/InternalFrameFocusTraversalPolicy.java
deleted file mode 100644
index 0609f09f8f2..00000000000
--- a/libjava/javax/swing/InternalFrameFocusTraversalPolicy.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* InternalFrameFocusTraversalPolicy.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.FocusTraversalPolicy;
-
-/**
- * @author Michael Koch
- *
- * @since 1.4
- */
-public abstract class InternalFrameFocusTraversalPolicy extends FocusTraversalPolicy
-{
- public Component getInitialComponent(JInternalFrame frame)
- {
- return getDefaultComponent(frame);
- }
-}
diff --git a/libjava/javax/swing/JApplet.java b/libjava/javax/swing/JApplet.java
deleted file mode 100644
index c102bd4476f..00000000000
--- a/libjava/javax/swing/JApplet.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/* JApplet.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.applet.Applet;
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.LayoutManager;
-import java.awt.event.KeyEvent;
-
-import javax.accessibility.AccessibleContext;
-
-public class JApplet extends Applet
- implements RootPaneContainer
-{
- private static final long serialVersionUID = 7269359214497372587L;
-
- protected JRootPane rootPane;
- protected boolean rootPaneCheckingEnabled;
-
- public JApplet()
- {
- super.setLayout(new BorderLayout(1, 1));
- getRootPane(); // will do set/create
- }
-
- public Dimension getPreferredSize()
- {
- return super.getPreferredSize();
- }
-
- public void setLayout(LayoutManager manager)
- {
- super.setLayout(manager);
- }
-
- public void setLayeredPane(JLayeredPane layeredPane)
- {
- getRootPane().setLayeredPane(layeredPane);
- }
-
- public JLayeredPane getLayeredPane()
- {
- return getRootPane().getLayeredPane();
- }
-
- public JRootPane getRootPane()
- {
- if (rootPane == null)
- setRootPane(createRootPane());
- return rootPane;
- }
-
- protected void setRootPane(JRootPane root)
- {
- if (rootPane != null)
- remove(rootPane);
-
- rootPane = root;
- add(rootPane, BorderLayout.CENTER);
- }
-
- protected JRootPane createRootPane()
- {
- return new JRootPane();
- }
-
- public Container getContentPane()
- {
- return getRootPane().getContentPane();
- }
-
- public void setContentPane(Container contentPane)
- {
- getRootPane().setContentPane(contentPane);
- }
-
- public Component getGlassPane()
- {
- return getRootPane().getGlassPane();
- }
-
- public void setGlassPane(Component glassPane)
- {
- getRootPane().setGlassPane(glassPane);
- }
-
- protected void addImpl(Component comp, Object constraints, int index)
- {
- super.addImpl(comp, constraints, index);
- }
-
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
- public JMenuBar getJMenuBar()
- {
- return getRootPane().getJMenuBar();
- }
-
- public void setJMenuBar(JMenuBar menubar)
- {
- getRootPane().setJMenuBar(menubar);
- }
-
- protected String paramString()
- {
- return "JFrame";
- }
-
- protected void processKeyEvent(KeyEvent e)
- {
- super.processKeyEvent(e);
- }
-
- public void remove(Component comp)
- {
- getContentPane().remove(comp);
- }
-
- protected boolean isRootPaneCheckingEnabled()
- {
- return rootPaneCheckingEnabled;
- }
-
- protected void setRootPaneCheckingEnabled(boolean enabled)
- {
- rootPaneCheckingEnabled = enabled;
- }
-
- public void update(Graphics g)
- {
- paint(g);
- }
-}
diff --git a/libjava/javax/swing/JButton.java b/libjava/javax/swing/JButton.java
deleted file mode 100644
index 1e9e7b694d0..00000000000
--- a/libjava/javax/swing/JButton.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/* JButton.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.swing.plaf.ButtonUI;
-
-
-/**
- * An instance of JButton can be added to a panel, frame etc
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public class JButton extends AbstractButton
- implements Accessible
-{
- private static final long serialVersionUID = -1907255238954382202L;
- boolean def;
- boolean is_def;
-
- public JButton()
- {
- this(null, null);
- }
-
- public JButton(Action a)
- {
- this();
- setAction(a);
- }
-
- public JButton(Icon icon)
- {
- this(null, icon);
- }
-
- public JButton(String text)
- {
- this(text, null);
- }
-
- public JButton(String text, Icon icon)
- {
- super(text, icon);
- }
-
- public Object[] getSelectedObjects()
- {
- return null;
- }
-
- protected void configurePropertiesFromAction(Action a)
- {
- //Factory method which sets the AbstractButton's properties according to values from the Action instance.
- super.configurePropertiesFromAction(a);
- }
-
- public AccessibleContext getAccessibleContext()
- {
- //Gets the AccessibleContext associated with this JButton.
- return null;
- }
-
- public String getUIClassID()
- {
- //Returns a string that specifies the name of the L&F class that renders this component.
- return "ButtonUI";
- }
-
- public boolean isDefaultButton()
- {
- //Returns whether or not this button is the default button on the RootPane.
- return is_def;
- }
-
- public boolean isDefaultCapable()
- {
- //Returns whether or not this button is capable of being the default button on the RootPane.
- return def;
- }
-
- protected String paramString()
- {
- return "JButton";
- }
-
- /**
- * Overrides JComponent.removeNotify to check if this button is currently
- * set as the default button on the RootPane, and if so, sets the RootPane's
- * default button to null to ensure the RootPane doesn't hold onto an invalid
- * button reference.
- */
- public void removeNotify()
- {
- }
-
- public void setDefaultCapable(boolean defaultCapable)
- {
- def = defaultCapable;
- }
-
- public void updateUI()
- {
- setUI((ButtonUI) UIManager.getUI(this));
- }
-}
diff --git a/libjava/javax/swing/JCheckBox.java b/libjava/javax/swing/JCheckBox.java
deleted file mode 100644
index 79fb10d1350..00000000000
--- a/libjava/javax/swing/JCheckBox.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/* JCheckBox.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.accessibility.AccessibleContext;
-
-/**
- * An instance of JCheckbox can be added to a panel, frame etc
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public class JCheckBox extends JToggleButton
-{
- private static final long serialVersionUID = -5246739313864538930L;
-
- public static final String BORDER_PAINTED_FLAT_CHANGED_PROPERTY =
- "borderPaintedFlat";
-
- private boolean borderPaintedFlat;
-
- private void init()
- {
- borderPainted = false;
- contentAreaFilled = false;
- }
-
- public JCheckBox()
- {
- super();
- init();
- }
-
- public JCheckBox(Action action)
- {
- super(action);
- init();
- }
-
- public JCheckBox(Icon icon)
- {
- super(icon);
- init();
- }
-
- public JCheckBox(Icon icon, boolean selected)
- {
- super(icon, selected);
- init();
- }
-
- public JCheckBox(String text)
- {
- super(text);
- init();
- }
-
- public JCheckBox(String text, boolean selected)
- {
- super(text, selected);
- init();
- }
-
- public JCheckBox(String text, Icon icon)
- {
- super(text, icon);
- init();
- }
-
- public JCheckBox(String text, Icon icon, boolean selected)
- {
- super(text, icon, selected);
- init();
- }
-
- /**
- * Gets the AccessibleContext associated with this JCheckBox.
- */
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
- /**
- * Returns a string that specifies the name of the Look and Feel class
- * that renders this component.
- */
- public String getUIClassID()
- {
- return "CheckBoxUI";
- }
-
- protected String paramString()
- {
- return "JCheckBox";
- }
-
- public boolean isBorderPaintedFlat()
- {
- return borderPaintedFlat;
- }
-
- public void setBorderPaintedFlat(boolean newValue)
- {
- firePropertyChange("borderPaintedFlat", borderPaintedFlat, newValue);
- borderPaintedFlat = newValue;
- }
-}
diff --git a/libjava/javax/swing/JCheckBoxMenuItem.java b/libjava/javax/swing/JCheckBoxMenuItem.java
deleted file mode 100644
index 34e5de9e5ba..00000000000
--- a/libjava/javax/swing/JCheckBoxMenuItem.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/* JCheckBoxMenuItem.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.IOException;
-import java.io.ObjectOutputStream;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * This class represents JCheckBoxMenuItem. Its behaviour is very similar
- * to JCheckBoxButton. Just like the JCheckBoxButton, user can check and
- * uncheck this menu item by clicking on it. Also setSelected()/setState()
- * can be use used for the same purpose. JCheckBoxMenuItem uses
- * ToggleButtonModel to keep track of its selection.
- */
-public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants,
- Accessible
-{
- private static final long serialVersionUID = -6676402307973384715L;
-
- /** name for the UI delegate for this menuItem. */
- private static final String uiClassID = "CheckBoxMenuItemUI";
-
- /** Indicates whether this menu item is checked. */
- private boolean state;
-
- /**
- * This array contains text of this menu item if this menu item is in
- * checked state and null it is not.
- */
- private Object[] selectedObjects = new Object[1];
-
- /**
- * Creates a new JCheckBoxMenuItem object.
- */
- public JCheckBoxMenuItem()
- {
- this(null, null);
- }
-
- /**
- * Creates a new JCheckBoxMenuItem with given icon
- *
- * @param icon Icon for this menu item
- */
- public JCheckBoxMenuItem(Icon icon)
- {
- this(null, icon);
- }
-
- /**
- * Creates a new JCheckBoxMenuItem with given label
- *
- * @param text Label for this menu item
- */
- public JCheckBoxMenuItem(String text)
- {
- this(text, null);
- }
-
- /**
- * Creates a new JCheckBoxMenuItem using given action
- *
- * @param action Action for this menu item.
- */
- public JCheckBoxMenuItem(Action action)
- {
- this();
- setAction(action);
- }
-
- /**
- * Creates a new JCheckBoxMenuItem object with given label and icon
- *
- * @param text Label for this menu item
- * @param icon Icon for this menu item
- */
- public JCheckBoxMenuItem(String text, Icon icon)
- {
- this(text, icon, false);
- }
-
- /**
- * Creates a new JCheckBoxMenuItem object using specified label and
- * marked as checked if given 'state' is true
- *
- * @param text Label for this menu item
- * @param state True if this item should be in checked state and false otherwise
- */
- public JCheckBoxMenuItem(String text, boolean state)
- {
- this(text, null, state);
- }
-
- /**
- * Creates a new JCheckBoxMenuItem object with given label, icon,
- * and marked as checked if given 'state' is true
- *
- * @param text Label for this menu item
- * @param icon icon for this menu item
- * @param state True if this item should be in checked state and false otherwise
- */
- public JCheckBoxMenuItem(String text, Icon icon, boolean state)
- {
- super(text, icon);
- setModel(new JToggleButton.ToggleButtonModel());
- this.state = state;
- }
-
- private void writeObject(ObjectOutputStream stream) throws IOException
- {
- }
-
- /**
- * This method returns a name to identify which look and feel class will be
- * the UI delegate for the menuItem.
- *
- * @return The Look and Feel classID. "JCheckBoxMenuItemUI"
- */
- public String getUIClassID()
- {
- return uiClassID;
- }
-
- /**
- * Returns checked state for this check box menu item.
- *
- * @return Returns true if this menu item is in checked state
- * and false otherwise.
- */
- public boolean getState()
- {
- return state;
- }
-
- /**
- * Sets state for this check box menu item. If
- * given 'state' is true, then mark menu item as checked,
- * and uncheck this menu item otherwise.
- *
- * @param state new state for this menu item
- *
- */
- public synchronized void setState(boolean state)
- {
- this.state = state;
- }
-
- /**
- * This method returns array containing label of this
- * menu item if it is selected and null otherwise.
- *
- * @return Array containing label of this
- * menu item if this menu item is selected or null otherwise.
- */
- public Object[] getSelectedObjects()
- {
- if (state == true)
- selectedObjects[0] = this.getText();
- else
- selectedObjects[0] = null;
-
- return selectedObjects;
- }
-
- /**
- * This method overrides JComponent.requestFocus with an empty
- * implementation, since JCheckBoxMenuItems should not
- * receve focus in general.
- */
- public void requestFocus()
- {
- // Should do nothing here
- }
-
- /**
- * A string that describes this JCheckBoxMenuItem. Normally only used
- * for debugging.
- *
- * @return A string describing this JCheckBoxMenuItem
- */
- protected String paramString()
- {
- return "JCheckBoxMenuItem";
- }
-
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJCheckBoxMenuItem();
-
- return accessibleContext;
- }
-
- protected class AccessibleJCheckBoxMenuItem extends AccessibleJMenuItem
- {
- private static final long serialVersionUID = 1079958073579370777L;
-
- /**
- * Creates a new AccessibleJCheckBoxMenuItem object.
- */
- protected AccessibleJCheckBoxMenuItem()
- {
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.CHECK_BOX;
- }
- }
-}
diff --git a/libjava/javax/swing/JColorChooser.java b/libjava/javax/swing/JColorChooser.java
deleted file mode 100644
index 889f5141c68..00000000000
--- a/libjava/javax/swing/JColorChooser.java
+++ /dev/null
@@ -1,704 +0,0 @@
-/* JColorChooser.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.AWTError;
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dialog;
-import java.awt.FlowLayout;
-import java.awt.Frame;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.swing.colorchooser.AbstractColorChooserPanel;
-import javax.swing.colorchooser.ColorSelectionModel;
-import javax.swing.colorchooser.DefaultColorSelectionModel;
-import javax.swing.plaf.ColorChooserUI;
-
-
-/**
- * The JColorChooser is a Swing widget that offers users different ways to
- * select a color. By default, three different panels are presented to the
- * user that are capable of changing the selected color. There are three ways
- * to utilize JColorChooser. The first is to build a JColorChooser and add it
- * to the content pane. The second is to use the createDialog method to
- * create a JDialog that holds a JColorChooser. The third is to show a
- * JColorChooser in a JDialog directly using the showDialog method.
- */
-public class JColorChooser extends JComponent implements Accessible
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 9168066781620640889L;
-
- /**
- * AccessibleJColorChooser
- */
- protected class AccessibleJColorChooser
- extends JComponent.AccessibleJComponent
- {
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -2038297864782299082L;
-
- /**
- * Constructor AccessibleJColorChooser
- */
- protected AccessibleJColorChooser()
- {
- }
-
- /**
- * getAccessibleRole
- *
- * @return AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.COLOR_CHOOSER;
- } // getAccessibleRole()
- } // AccessibleJColorChooser
-
- /** The model used with the JColorChooser. */
- private ColorSelectionModel selectionModel;
-
- /** The preview panel associated with the JColorChooser. */
- private JComponent previewPanel;
-
- /**
- * The set of AbstractColorChooserPanels associated with the JColorChooser.
- */
- private AbstractColorChooserPanel[] chooserPanels;
-
- /** A Drag and Drop property. */
- private boolean dragEnabled;
-
- /**
- * The property fired by the JColorChooser when the selectionModel property
- * changes.
- */
- public static final String SELECTION_MODEL_PROPERTY = "selectionModel";
-
- /**
- * The property fired by the JColorChooser when the previewPanel property
- * changes.
- */
- public static final String PREVIEW_PANEL_PROPERTY = "previewPanel";
-
- /**
- * The property fired by the JColorChooser when the chooserPanels property
- * changes.
- */
- public static final String CHOOSER_PANELS_PROPERTY = "chooserPanels";
-
- /** accessibleContext */
- protected AccessibleContext accessibleContext;
-
- /**
- * This method creates a new JColorChooser with the default initial color.
- */
- public JColorChooser()
- {
- this(new DefaultColorSelectionModel());
- } // JColorChooser()
-
- /**
- * This method creates a new JColorChooser with the given initial color.
- *
- * @param initial The initial color.
- */
- public JColorChooser(Color initial)
- {
- this(new DefaultColorSelectionModel(initial));
- } // JColorChooser()
-
- /**
- * This method creates a new JColorChooser with the given model. The model
- * will dictate what the initial color for the JColorChooser is.
- *
- * @param model The Model to use with the JColorChooser.
- */
- public JColorChooser(ColorSelectionModel model)
- {
- if (model == null)
- model = new DefaultColorSelectionModel();
- selectionModel = model;
- updateUI();
- } // JColorChooser()
-
- /**
- * This method sets the current color for the JColorChooser.
- *
- * @param color The new color for the JColorChooser.
- */
- public void setColor(Color color)
- {
- if (color != null)
- selectionModel.setSelectedColor(color);
- } // setColor()
-
- /**
- * This method sets the current color for the JColorChooser using RGB
- * values.
- *
- * @param r The red value.
- * @param g The green value.
- * @param b The blue value.
- */
- public void setColor(int r, int g, int b)
- {
- selectionModel.setSelectedColor(new Color(r, g, b));
- } // setColor()
-
- /**
- * This method sets the current color for the JColorChooser using the
- * integer value. Bits 0-7 represent the blue value. Bits 8-15 represent
- * the green value. Bits 16-23 represent the red value.
- *
- * @param color The new current color of the JColorChooser.
- */
- public void setColor(int color)
- {
- setColor(new Color(color, false));
- } // setColor()
-
- /**
- * This method shows a JColorChooser inside a JDialog. The JDialog will
- * block until it is hidden. The JDialog comes with three buttons: OK,
- * Cancel, and Reset. Pressing OK or Cancel hide the JDialog. Pressing
- * Reset will reset the JColorChooser to its initial value.
- *
- * @param component The Component that parents the JDialog.
- * @param title The title displayed in the JDialog.
- * @param initial The initial color.
- *
- * @return The selected color.
- */
- public static Color showDialog(Component component, String title,
- Color initial)
- {
- JColorChooser choose = new JColorChooser(initial);
-
- JDialog dialog = createDialog(component, title, true, choose, null, null);
-
- dialog.getContentPane().add(choose);
- dialog.pack();
- dialog.show();
-
- return choose.getColor();
- } // showDialog()
-
- /**
- * This is a helper method to make the given JDialog block until it is
- * hidden. This is package-private to avoid an accessor method.
- *
- * @param dialog The JDialog to block.
- */
- static void makeModal(JDialog dialog)
- {
- try
- {
- synchronized (dialog)
- {
- while (dialog.isVisible())
- dialog.wait();
- }
- }
- catch (InterruptedException e)
- {
- }
- }
-
- /**
- * This is a helper method to find the first Frame or Dialog ancestor of the
- * given Component.
- *
- * @param c The Component to find ancestors for.
- *
- * @return A Frame or Dialog ancestor. Null if none are found.
- */
- private static Component findParent(Component c)
- {
- Component parent = SwingUtilities.getAncestorOfClass(Frame.class, c);
- if (parent != null)
- return parent;
- parent = SwingUtilities.getAncestorOfClass(Dialog.class, c);
- return parent;
- }
-
- /**
- * This method will take the given JColorChooser and place it in a JDialog
- * with the given modal property. Three buttons are displayed in the
- * JDialog: OK, Cancel and Reset. If OK or Cancel are pressed, the JDialog
- * is hidden. If Reset is pressed, then the JColorChooser will take on its
- * default color value. The given okListener will be registered to the OK
- * button and the cancelListener will be registered to the Cancel button.
- * If the modal property is set, then the JDialog will block until it is
- * hidden.
- *
- * @param component The Component that will parent the JDialog.
- * @param title The title displayed in the JDialog.
- * @param modal The modal property.
- * @param chooserPane The JColorChooser to place in the JDialog.
- * @param okListener The ActionListener to register to the OK button.
- * @param cancelListener The ActionListener to register to the Cancel
- * button.
- *
- * @return A JDialog with the JColorChooser inside of it.
- *
- * @throws AWTError If the component is not a suitable parent.
- */
- public static JDialog createDialog(Component component, String title,
- boolean modal, JColorChooser chooserPane,
- ActionListener okListener,
- ActionListener cancelListener)
- {
- Component parent = findParent(component);
- if (parent == null)
- throw new AWTError("No suitable parent found for Component.");
- JDialog dialog;
- if (parent instanceof Frame)
- dialog = new ModalDialog((Frame) parent, title);
- else
- dialog = new ModalDialog((Dialog) parent, title);
- dialog.setModal(modal);
-
- dialog.getContentPane().setLayout(new BorderLayout());
-
- JPanel panel = new JPanel();
- panel.setLayout(new FlowLayout());
-
- ActionListener al = new DefaultOKCancelListener(dialog);
-
- JButton ok = new JButton("OK");
- ok.addActionListener(okListener);
- ok.addActionListener(al);
-
- JButton cancel = new JButton("Cancel");
- cancel.addActionListener(cancelListener);
- cancel.addActionListener(al);
-
- JButton reset = new JButton("Reset");
- reset.addActionListener(new DefaultResetListener(chooserPane));
-
- dialog.getContentPane().add(chooserPane, BorderLayout.NORTH);
-
- panel.add(ok);
- panel.add(cancel);
- panel.add(reset);
-
- dialog.getContentPane().add(panel, BorderLayout.SOUTH);
-
- return dialog;
- } // createDialog()
-
- /**
- * This method returns the UI Component used for this JColorChooser.
- *
- * @return The UI Component for this JColorChooser.
- */
- public ColorChooserUI getUI()
- {
- return (ColorChooserUI) ui;
- } // getUI()
-
- /**
- * This method sets the UI Component used for this JColorChooser.
- *
- * @param ui The UI Component to use with this JColorChooser.
- */
- public void setUI(ColorChooserUI ui)
- {
- super.setUI(ui);
- } // setUI()
-
- /**
- * This method resets the UI Component property to the Look and Feel
- * default.
- */
- public void updateUI()
- {
- setUI((ColorChooserUI) UIManager.getUI(this));
- revalidate();
- } // updateUI()
-
- /**
- * This method returns a String identifier for the UI Class to be used with
- * the JColorChooser.
- *
- * @return The String identifier for the UI Class.
- */
- public String getUIClassID()
- {
- return "ColorChooserUI";
- } // getUIClassID()
-
- /**
- * This method returns the current color for the JColorChooser.
- *
- * @return The current color for the JColorChooser.
- */
- public Color getColor()
- {
- return selectionModel.getSelectedColor(); // TODO
- } // getColor()
-
- /**
- * This method changes the previewPanel property for the JTabbedPane. The
- * previewPanel is responsible for indicating the current color of the
- * JColorChooser.
- *
- * @param component The Component that will act as the previewPanel.
- */
- public void setPreviewPanel(JComponent component)
- {
- if (component != previewPanel)
- {
- JComponent old = previewPanel;
- previewPanel = component;
- firePropertyChange(PREVIEW_PANEL_PROPERTY, old, previewPanel);
- }
- } // setPreviewPanel()
-
- /**
- * This method returns the current previewPanel used with this
- * JColorChooser.
- *
- * @return The current previewPanel.
- */
- public JComponent getPreviewPanel()
- {
- return previewPanel; // TODO
- } // getPreviewPanel()
-
- /**
- * This method adds the given AbstractColorChooserPanel to the list of the
- * JColorChooser's chooserPanels.
- *
- * @param panel The AbstractColorChooserPanel to add.
- */
- public void addChooserPanel(AbstractColorChooserPanel panel)
- {
- if (panel == null)
- return;
- AbstractColorChooserPanel[] old = chooserPanels;
- AbstractColorChooserPanel[] newPanels = new AbstractColorChooserPanel[(old == null)
- ? 1
- : old.length
- + 1];
- if (old != null)
- System.arraycopy(old, 0, newPanels, 0, old.length);
- newPanels[newPanels.length - 1] = panel;
- chooserPanels = newPanels;
- panel.installChooserPanel(this);
- firePropertyChange(CHOOSER_PANELS_PROPERTY, old, newPanels);
- } // addChooserPanel()
-
- /**
- * This method removes the given AbstractColorChooserPanel from the
- * JColorChooser's list of chooserPanels.
- *
- * @param panel The AbstractColorChooserPanel to remove.
- *
- * @return The AbstractColorChooserPanel that was removed.
- */
- public AbstractColorChooserPanel removeChooserPanel(AbstractColorChooserPanel panel)
- {
- int index = -1;
- for (int i = 0; i < chooserPanels.length; i++)
- if (panel == chooserPanels[i])
- {
- index = i;
- break;
- }
-
- if (index == -1)
- return null;
-
- AbstractColorChooserPanel[] old = chooserPanels;
- if (chooserPanels.length == 1)
- chooserPanels = null;
- else
- {
- AbstractColorChooserPanel[] newPanels = new AbstractColorChooserPanel[chooserPanels.length
- - 1];
- System.arraycopy(chooserPanels, 0, newPanels, 0, index);
- System.arraycopy(chooserPanels, index, newPanels, index - 1,
- chooserPanels.length - index);
- chooserPanels = newPanels;
- }
- panel.uninstallChooserPanel(this);
- firePropertyChange(CHOOSER_PANELS_PROPERTY, old, chooserPanels);
- return panel;
- }
-
- /**
- * This method sets the chooserPanels property for this JColorChooser.
- *
- * @param panels The new set of AbstractColorChooserPanels to use.
- */
- public void setChooserPanels(AbstractColorChooserPanel[] panels)
- {
- if (panels != chooserPanels)
- {
- if (chooserPanels != null)
- for (int i = 0; i < chooserPanels.length; i++)
- if (chooserPanels[i] != null)
- chooserPanels[i].uninstallChooserPanel(this);
-
- AbstractColorChooserPanel[] old = chooserPanels;
- chooserPanels = panels;
-
- if (panels != null)
- for (int i = 0; i < panels.length; i++)
- if (panels[i] != null)
- panels[i].installChooserPanel(this);
-
- firePropertyChange(CHOOSER_PANELS_PROPERTY, old, chooserPanels);
- }
- } // setChooserPanels()
-
- /**
- * This method returns the AbstractColorChooserPanels used with this
- * JColorChooser.
- *
- * @return The AbstractColorChooserPanels used with this JColorChooser.
- */
- public AbstractColorChooserPanel[] getChooserPanels()
- {
- return chooserPanels;
- } // getChooserPanels()
-
- /**
- * This method returns the ColorSelectionModel used with this JColorChooser.
- *
- * @return The ColorSelectionModel.
- */
- public ColorSelectionModel getSelectionModel()
- {
- return selectionModel;
- } // getSelectionModel()
-
- /**
- * This method sets the ColorSelectionModel to be used with this
- * JColorChooser.
- *
- * @param model The ColorSelectionModel to be used with this JColorChooser.
- *
- * @throws AWTError If the given model is null.
- */
- public void setSelectionModel(ColorSelectionModel model)
- {
- if (model == null)
- throw new AWTError("ColorSelectionModel is not allowed to be null.");
- selectionModel = model;
- } // setSelectionModel()
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public boolean getDragEnabled()
- {
- return dragEnabled;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param b DOCUMENT ME!
- */
- public void setDragEnabled(boolean b)
- {
- dragEnabled = b;
- }
-
- /**
- * This method returns a String describing the JColorChooser.
- *
- * @return A String describing the JColorChooser.
- */
- protected String paramString()
- {
- return "JColorChooser";
- } // paramString()
-
- /**
- * getAccessibleContext
- *
- * @return AccessibleContext
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJColorChooser();
-
- return accessibleContext;
- }
-
- /**
- * A helper class that hides a JDialog when the action is performed.
- */
- static class DefaultOKCancelListener implements ActionListener
- {
- /** The JDialog to hide. */
- private JDialog dialog;
-
- /**
- * Creates a new DefaultOKCancelListener with the given JDialog to hide.
- *
- * @param dialog The JDialog to hide.
- */
- public DefaultOKCancelListener(JDialog dialog)
- {
- super();
- this.dialog = dialog;
- }
-
- /**
- * This method hides the JDialog when called.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- dialog.hide();
- }
- }
-
- /**
- * This method resets the JColorChooser color to the initial color when the
- * action is performed.
- */
- static class DefaultResetListener implements ActionListener
- {
- /** The JColorChooser to reset. */
- private JColorChooser chooser;
-
- /** The initial color. */
- private Color init;
-
- /**
- * Creates a new DefaultResetListener with the given JColorChooser.
- *
- * @param chooser The JColorChooser to reset.
- */
- public DefaultResetListener(JColorChooser chooser)
- {
- super();
- this.chooser = chooser;
- init = chooser.getColor();
- }
-
- /**
- * This method resets the JColorChooser to its initial color.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- chooser.setColor(init);
- }
- }
-
- /**
- * This is a custom JDialog that will notify when it is hidden and the modal
- * property is set.
- */
- static class ModalDialog extends JDialog
- {
- /** The modal property. */
- private boolean modal;
-
- /**
- * Creates a new ModalDialog object with the given parent and title.
- *
- * @param parent The parent of the JDialog.
- * @param title The title of the JDialog.
- */
- public ModalDialog(Frame parent, String title)
- {
- super(parent, title);
- }
-
- /**
- * Creates a new ModalDialog object with the given parent and title.
- *
- * @param parent The parent of the JDialog.
- * @param title The title of the JDialog.
- */
- public ModalDialog(Dialog parent, String title)
- {
- super(parent, title);
- }
-
- /**
- * This method sets the modal property.
- *
- * @param modal The modal property.
- */
- public void setModal(boolean modal)
- {
- this.modal = modal;
- }
-
- /**
- * This method shows the ModalDialog.
- */
- public void show()
- {
- super.show();
- if (modal)
- makeModal(this);
- }
-
- /**
- * This method hides the ModalDialog.
- */
- public synchronized void hide()
- {
- super.hide();
- notifyAll();
- }
- }
-}
diff --git a/libjava/javax/swing/JComboBox.java b/libjava/javax/swing/JComboBox.java
deleted file mode 100644
index 3070e63b9f4..00000000000
--- a/libjava/javax/swing/JComboBox.java
+++ /dev/null
@@ -1,1221 +0,0 @@
-/* JComboBox.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.ItemSelectable;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.KeyEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleAction;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleSelection;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-import javax.swing.event.PopupMenuListener;
-import javax.swing.plaf.ComboBoxUI;
-
-/**
- * JComboBox. JComboBox is a container, that keeps track of elements added to
- * it by the user. JComboBox allows user to select any item in its list and
- * displays the selected item to the user. JComboBox also can show/hide popup
- * menu containing its list of item whenever the mouse is pressed over it.
- *
- * @author Andrew Selkirk
- * @author Olga Rodimina
- * @author Robert Schuster
- */
-public class JComboBox extends JComponent implements ItemSelectable,
- ListDataListener,
- ActionListener,
- Accessible
-{
-
- private static final long serialVersionUID = 5654585963292734470L;
-
- /**
- * KeySelectionManager interface. Class implementing this interface are
- * responsible for matching key characters typed by the user with combo
- * box's items.
- */
- public static interface KeySelectionManager
- {
- int selectionForKey(char aKey, ComboBoxModel aModel);
- }
-
- /**
- * Maximum number of rows that should be visible by default in the
- * JComboBox's popup
- */
- private static final int DEFAULT_MAXIMUM_ROW_COUNT = 8;
-
- /**
- * dataModel used by JComboBox to keep track of its list data and currently
- * selected element in the list.
- */
- protected ComboBoxModel dataModel;
-
- /**
- * Renderer renders(paints) every object in the combo box list in its
- * associated list cell. This ListCellRenderer is used only when this
- * JComboBox is uneditable.
- */
- protected ListCellRenderer renderer;
-
- /**
- * Editor that is responsible for editing an object in a combo box list.
- */
- protected ComboBoxEditor editor;
-
- /**
- * Number of rows that will be visible in the JComboBox's popup.
- */
- protected int maximumRowCount;
-
- /**
- * This field indicates if textfield of this JComboBox is editable or not.
- */
- protected boolean isEditable;
-
- /**
- * This field is reference to the current selection of the combo box.
- */
- protected Object selectedItemReminder;
-
- /**
- * keySelectionManager
- */
- protected KeySelectionManager keySelectionManager;
-
- /**
- * This actionCommand is used in ActionEvent that is fired to JComboBox's
- * ActionListeneres.
- */
- protected String actionCommand;
-
- /**
- * This property indicates if heavyweight popup or lightweight popup will be
- * used to diplay JComboBox's elements.
- */
- protected boolean lightWeightPopupEnabled;
-
- /**
- * The action taken when new item is selected in the JComboBox
- */
- private Action action;
-
- /**
- * since 1.4 If this field is set then comboBox's display area for the
- * selected item will be set by default to this value.
- */
- private Object prototypeDisplayValue;
-
- /**
- * Constructs JComboBox object with specified data model for it.
- * <p>Note that the JComboBox will not change the value that
- * is preselected by your ComboBoxModel implementation.</p>
- *
- * @param model Data model that will be used by this JComboBox to keep track
- * of its list of items.
- */
- public JComboBox(ComboBoxModel model)
- {
- setEditable(false);
- setEnabled(true);
- setMaximumRowCount(DEFAULT_MAXIMUM_ROW_COUNT);
- setModel(model);
- setActionCommand("comboBoxChanged");
-
- lightWeightPopupEnabled = true;
- isEditable = false;
-
- updateUI();
- }
-
- /**
- * Constructs JComboBox with specified list of items.
- *
- * @param itemArray array containing list of items for this JComboBox
- */
- public JComboBox(Object[] itemArray)
- {
- this(new DefaultComboBoxModel(itemArray));
-
- if (itemArray.length > 0)
- setSelectedIndex(0);
- }
-
- /**
- * Constructs JComboBox object with specified list of items.
- *
- * @param itemVector vector containing list of items for this JComboBox.
- */
- public JComboBox(Vector itemVector)
- {
- this(new DefaultComboBoxModel(itemVector));
-
- if (itemVector.size() > 0)
- setSelectedIndex(0);
- }
-
- /**
- * Constructor. Creates new empty JComboBox. ComboBox's data model is set to
- * DefaultComboBoxModel.
- */
- public JComboBox()
- {
- this(new DefaultComboBoxModel());
- }
-
- private void writeObject(ObjectOutputStream stream) throws IOException
- {
- }
-
- /**
- * This method returns true JComboBox is editable and false otherwise
- *
- * @return boolean true if JComboBox is editable and false otherwise
- */
- public boolean isEditable()
- {
- return isEditable;
- }
-
- /*
- * This method adds ancestor listener to this JComboBox.
- */
- protected void installAncestorListener()
- {
- /* FIXME: Need to implement.
- *
- * Need to add ancestor listener to this JComboBox. This listener
- * should close combo box's popup list of items whenever it
- * receives an AncestorEvent.
- */
- }
-
- /**
- * Set the "UI" property of the combo box, which is a look and feel class
- * responsible for handling comboBox's input events and painting it.
- *
- * @param ui The new "UI" property
- */
- public void setUI(ComboBoxUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method sets this comboBox's UI to the UIManager's default for the
- * current look and feel.
- */
- public void updateUI()
- {
- setUI((ComboBoxUI) UIManager.getUI(this));
- invalidate();
- }
-
- /**
- * This method returns the String identifier for the UI class to the used
- * with the JComboBox.
- *
- * @return The String identifier for the UI class.
- */
- public String getUIClassID()
- {
- return "ComboBoxUI";
- }
-
- /**
- * This method returns the UI used to display the JComboBox.
- *
- * @return The UI used to display the JComboBox.
- */
- public ComboBoxUI getUI()
- {
- return (ComboBoxUI) ui;
- }
-
- /**
- * Set the data model for this JComboBox. This un-registers all listeners
- * associated with the current model, and re-registers them with the new
- * model.
- *
- * @param newDataModel The new data model for this JComboBox
- */
- public void setModel(ComboBoxModel newDataModel)
- {
-
- // dataModel is null if it this method is called from inside the constructors.
- if(dataModel != null) {
- // Prevents unneccessary updates.
- if (dataModel == newDataModel)
- return;
-
- // Removes itself (as DataListener) from the to-be-replaced model.
- dataModel.removeListDataListener(this);
- }
-
- /* Adds itself as a DataListener to the new model.
- * It is intentioned that this operation will fail with a NullPointerException if the
- * caller delivered a null argument.
- */
- newDataModel.addListDataListener(this);
-
- // Stores old data model for event notification.
- ComboBoxModel oldDataModel = dataModel;
- dataModel = newDataModel;
-
- // Notifies the listeners of the model change.
- firePropertyChange("model", oldDataModel, dataModel);
- }
-
- /**
- * This method returns data model for this comboBox.
- *
- * @return ComboBoxModel containing items for this combo box.
- */
- public ComboBoxModel getModel()
- {
- return dataModel;
- }
-
- /**
- * This method sets JComboBox's popup to be either lightweight or
- * heavyweight. If 'enabled' is true then lightweight popup is used and
- * heavyweight otherwise. By default lightweight popup is used to display
- * this JComboBox's elements.
- *
- * @param enabled indicates if lightweight popup or heavyweight popup should
- * be used to display JComboBox's elements.
- */
- public void setLightWeightPopupEnabled(boolean enabled)
- {
- lightWeightPopupEnabled = enabled;
- }
-
- /**
- * This method returns whether popup menu that is used to display list of
- * combo box's item is lightWeight or not.
- *
- * @return boolean true if popup menu is lightweight and false otherwise.
- */
- public boolean isLightWeightPopupEnabled()
- {
- return lightWeightPopupEnabled;
- }
-
- /**
- * This method sets editability of the combo box. If combo box is editable
- * the user can choose component from the combo box list by typing
- * component's name in the editor(JTextfield by default). Otherwise if not
- * editable, the user should use the list to choose the component. This
- * method fires PropertyChangeEvents to JComboBox's registered
- * PropertyChangeListeners to indicate that 'editable' property of the
- * JComboBox has changed.
- *
- * @param editable indicates if the JComboBox's textfield should be editable
- * or not.
- */
- public void setEditable(boolean editable)
- {
- if (isEditable != editable)
- {
- isEditable = editable;
- firePropertyChange("editable", ! isEditable, isEditable);
- }
- }
-
- /**
- * Sets number of rows that should be visible in this JComboBox's popup. If
- * this JComboBox's popup has more elements that maximum number or rows
- * then popup will have a scroll pane to allow users to view other
- * elements.
- *
- * @param rowCount number of rows that will be visible in JComboBox's popup.
- */
- public void setMaximumRowCount(int rowCount)
- {
- if (maximumRowCount != rowCount)
- {
- int oldMaximumRowCount = maximumRowCount;
- maximumRowCount = rowCount;
- firePropertyChange("maximumRowCount",
- oldMaximumRowCount, maximumRowCount);
- }
- }
-
- /**
- * This method returns number of rows visible in the JComboBox's list of
- * items.
- *
- * @return int maximun number of visible rows in the JComboBox's list.
- */
- public int getMaximumRowCount()
- {
- return maximumRowCount;
- }
-
- /**
- * This method sets cell renderer for this JComboBox that will be used to
- * paint combo box's items. The Renderer should only be used only when
- * JComboBox is not editable. In the case when JComboBox is editable the
- * editor must be used. This method also fires PropertyChangeEvent when
- * cellRendered for this JComboBox has changed.
- *
- * @param aRenderer cell renderer that will be used by this JComboBox to
- * paint its elements.
- */
- public void setRenderer(ListCellRenderer aRenderer)
- {
- if (renderer != aRenderer)
- {
- ListCellRenderer oldRenderer = renderer;
- renderer = aRenderer;
- firePropertyChange("renderer", oldRenderer,
- renderer);
- }
- }
-
- /**
- * This method returns renderer responsible for rendering selected item in
- * the combo box
- *
- * @return ListCellRenderer
- */
- public ListCellRenderer getRenderer()
- {
- return renderer;
- }
-
- /**
- * Sets editor for this JComboBox
- *
- * @param newEditor ComboBoxEditor for this JComboBox. This method fires
- * PropertyChangeEvent when 'editor' property is changed.
- */
- public void setEditor(ComboBoxEditor newEditor)
- {
- if (editor == newEditor)
- return;
-
- if (editor != null)
- editor.removeActionListener(this);
-
- ComboBoxEditor oldEditor = editor;
- editor = newEditor;
-
- if (editor != null)
- editor.addActionListener(this);
-
- firePropertyChange("editor", oldEditor, editor);
- }
-
- /**
- * Returns editor component that is responsible for displaying/editing
- * selected item in the combo box.
- *
- * @return ComboBoxEditor
- */
- public ComboBoxEditor getEditor()
- {
- return editor;
- }
-
- /**
- * Forces combo box to select given item
- *
- * @param item element in the combo box to select.
- */
- public void setSelectedItem(Object item)
- {
- dataModel.setSelectedItem(item);
- }
-
- /**
- * Returns currently selected item in the combo box.
- * The result may be <code>null</code> to indicate that nothing is
- * currently selected.
- *
- * @return element that is currently selected in this combo box.
- */
- public Object getSelectedItem()
- {
- return dataModel.getSelectedItem();
- }
-
- /**
- * Forces JComboBox to select component located in the given index in the
- * combo box.
- * <p>If the index is below -1 or exceeds the upper bound an
- * <code>IllegalArgumentException</code> is thrown.<p/>
- * <p>If the index is -1 then no item gets selected.</p>
- *
- * @param index index specifying location of the component that should be
- * selected.
- */
- public void setSelectedIndex(int index)
- {
- if(index < -1 || index >= dataModel.getSize()) {
- // Fails because index is out of bounds.
- throw new IllegalArgumentException("illegal index: " + index);
- } else {
- /* Selects the item at the given index or clears the selection if the
- * index value is -1.
- */
- setSelectedItem((index == -1) ? null : dataModel.getElementAt(index));
- }
- }
-
- /**
- * Returns index of the item that is currently selected in the combo box.
- * If no item is currently selected, then -1 is returned.
- *
- * <p>Note: For performance reasons you should minimize invocation of this
- * method. If the data model is not an instance of
- * <code>DefaultComboBoxModel</code> the complexity is O(n) where
- * n is the number of elements in the combo box.</p>
- *
- * @return int Index specifying location of the currently selected item in
- * the combo box or -1 if nothing is selected in the combo box.
- */
- public int getSelectedIndex()
- {
- Object selectedItem = getSelectedItem();
-
- if (selectedItem != null) {
-
- if(dataModel instanceof DefaultComboBoxModel) {
- // Uses special method of DefaultComboBoxModel to retrieve the index.
- return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem);
- } else {
- // Iterates over all items to retrieve the index.
- int size = dataModel.getSize();
-
- for(int i=0; i < size; i++) {
- Object o = dataModel.getElementAt(i);
-
- // XXX: Is special handling of ComparableS neccessary?
- if((selectedItem != null) ? selectedItem.equals(o) : o == null) {
- return i;
- }
- }
- }
- }
-
- // returns that no item is currently selected
- return -1;
- }
-
- public Object getPrototypeDisplayValue()
- {
- return prototypeDisplayValue;
- }
-
- public void setPrototypeDisplayValue(Object newPrototypeDisplayValue)
- {
- prototypeDisplayValue = newPrototypeDisplayValue;
- }
-
- /**
- * This method adds given element to this JComboBox.
- * <p>A <code>RuntimeException</code> is thrown if the data model is not
- * an instance of {@link MutableComboBoxModel}.</p>
- *
- * @param element element to add
- */
- public void addItem(Object element)
- {
- if(dataModel instanceof MutableComboBoxModel) {
- ((MutableComboBoxModel) dataModel).addElement(element);
- } else {
- throw new RuntimeException("Unable to add the item because the data model it is not an instance of MutableComboBoxModel.");
- }
- }
-
- /**
- * Inserts given element at the specified index to this JComboBox.
- * <p>A <code>RuntimeException</code> is thrown if the data model is not
- * an instance of {@link MutableComboBoxModel}.</p>
- *
- * @param element element to insert
- * @param index position where to insert the element
- */
- public void insertItemAt(Object element, int index)
- {
- if(dataModel instanceof MutableComboBoxModel) {
- ((MutableComboBoxModel) dataModel).insertElementAt(element, index);
- } else {
- throw new RuntimeException("Unable to insert the item because the data model it is not an instance of MutableComboBoxModel.");
- }
- }
-
- /**
- * This method removes given element from this JComboBox.
- * <p>A <code>RuntimeException</code> is thrown if the data model is not
- * an instance of {@link MutableComboBoxModel}.</p>
- *
- * @param element element to remove
- */
- public void removeItem(Object element)
- {
- if(dataModel instanceof MutableComboBoxModel) {
- ((MutableComboBoxModel) dataModel).removeElement(element);
- } else {
- throw new RuntimeException("Unable to remove the item because the data model it is not an instance of MutableComboBoxModel.");
- }
- }
-
- /**
- * This method remove element location in the specified index in the
- * JComboBox.
- * <p>A <code>RuntimeException</code> is thrown if the data model is not
- * an instance of {@link MutableComboBoxModel}.</p>
- *
- * @param index index specifying position of the element to remove
- */
- public void removeItemAt(int index)
- {
- if(dataModel instanceof MutableComboBoxModel) {
- ((MutableComboBoxModel) dataModel).removeElementAt(index);
- } else {
- throw new RuntimeException("Unable to remove the item because the data model it is not an instance of MutableComboBoxModel.");
- }
- }
-
- /**
- * This method removes all elements from this JComboBox.
- * <p>A <code>RuntimeException</code> is thrown if the data model is not
- * an instance of {@link MutableComboBoxModel}.</p>
- *
- */
- public void removeAllItems()
- {
- if (dataModel instanceof DefaultComboBoxModel) {
- // Uses special method if we have a DefaultComboBoxModel.
- ((DefaultComboBoxModel) dataModel).removeAllElements();
- } else if(dataModel instanceof MutableComboBoxModel){
- // Iterates over all items and removes each.
- MutableComboBoxModel mcbm = (MutableComboBoxModel) dataModel;
-
- /* We intentionally remove the items backwards to support
- * models which shift their content to the beginning (e.g.
- * linked lists)
- */
- for(int i=mcbm.getSize()-1; i >= 0; i--) {
- mcbm.removeElementAt(i);
- }
-
- } else {
- throw new RuntimeException("Unable to remove the items because the data model it is not an instance of MutableComboBoxModel.");
- }
-
- }
-
- /**
- * This method displays popup with list of combo box's items on the screen
- */
- public void showPopup()
- {
- setPopupVisible(true);
- }
-
- /**
- * This method hides popup containing list of combo box's items
- */
- public void hidePopup()
- {
- setPopupVisible(false);
- }
-
- /**
- * This method either displayes or hides the popup containing list of combo
- * box's items.
- *
- * @param visible show popup if 'visible' is true and hide it otherwise
- */
- public void setPopupVisible(boolean visible)
- {
- getUI().setPopupVisible(this, visible);
- }
-
- /**
- * Checks if popup is currently visible on the screen.
- *
- * @return boolean true if popup is visible and false otherwise
- */
- public boolean isPopupVisible()
- {
- return getUI().isPopupVisible(this);
- }
-
- /**
- * This method sets actionCommand to the specified string. ActionEvent fired
- * to this JComboBox registered ActionListeners will contain this
- * actionCommand.
- *
- * @param aCommand new action command for the JComboBox's ActionEvent
- */
- public void setActionCommand(String aCommand)
- {
- actionCommand = aCommand;
- }
-
- /**
- * Returns actionCommand associated with the ActionEvent fired by the
- * JComboBox to its registered ActionListeners.
- *
- * @return String actionCommand for the ActionEvent
- */
- public String getActionCommand()
- {
- return actionCommand;
- }
-
- /**
- * setAction
- *
- * @param a action to set
- */
- public void setAction(Action a)
- {
- Action old = action;
- action = a;
- configurePropertiesFromAction(action);
- if (action != null)
- // FIXME: remove from old action and add to new action
- // PropertyChangeListener to listen to changes in the action
- addActionListener(action);
- }
-
- /**
- * This method returns Action that is invoked when selected item is changed
- * in the JComboBox.
- *
- * @return Action
- */
- public Action getAction()
- {
- return action;
- }
-
- /**
- * Configure properties of the JComboBox by reading properties of specified
- * action. This method always sets the comboBox's "enabled" property to the
- * value of the Action's "enabled" property.
- *
- * @param a An Action to configure the combo box from
- */
- protected void configurePropertiesFromAction(Action a)
- {
- if (a == null)
- {
- setEnabled(true);
- setToolTipText(null);
- }
- else
- {
- setEnabled(a.isEnabled());
- setToolTipText((String) (a.getValue(Action.SHORT_DESCRIPTION)));
- }
- }
-
- /**
- * Creates PropertyChangeListener to listen for the changes in comboBox's
- * action properties.
- *
- * @param action action to listen to for property changes
- *
- * @return $PropertyChangeListener$ Listener that listens to changes in
- * action properties.
- */
- protected PropertyChangeListener createActionPropertyChangeListener(Action action)
- {
- return new PropertyChangeListener()
- {
- public void propertyChange(PropertyChangeEvent e)
- {
- Action act = (Action) (e.getSource());
- configurePropertiesFromAction(act);
- }
- };
- }
-
- /**
- * This method fires ItemEvent to this JComboBox's registered ItemListeners.
- * This method is invoked when currently selected item in this combo box
- * has changed.
- *
- * @param e the ItemEvent describing the change in the combo box's
- * selection.
- */
- protected void fireItemStateChanged(ItemEvent e)
- {
- ItemListener[] ll = getItemListeners();
-
- for (int i = 0; i < ll.length; i++)
- ll[i].itemStateChanged(e);
- }
-
- /**
- * This method fires ActionEvent to this JComboBox's registered
- * ActionListeners. This method is invoked when user explicitly changes
- * currently selected item.
- */
- protected void fireActionEvent()
- {
- ActionListener[] ll = getActionListeners();
-
- for (int i = 0; i < ll.length; i++)
- ll[i].actionPerformed(new ActionEvent(this,
- ActionEvent.ACTION_PERFORMED,
- actionCommand));
- }
-
- /**
- * This method is invoked whenever selected item changes in the combo box's
- * data model. It fires ItemEvent and ActionEvent to all registered
- * ComboBox's ItemListeners and ActionListeners respectively, indicating
- * the change.
- */
- protected void selectedItemChanged()
- {
- // Fire ItemEvent to indicated that previously selected item is now
- // deselected
- if (selectedItemReminder != null)
- fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
- selectedItemReminder,
- ItemEvent.DESELECTED));
-
- // Fire ItemEvent to indicate that new item is selected
- Object newSelection = getSelectedItem();
- fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
- newSelection, ItemEvent.SELECTED));
-
- // Fire Action Event to JComboBox's registered listeners
- fireActionEvent();
-
- selectedItemReminder = newSelection;
- }
-
- /**
- * Returns Object array of size 1 containing currently selected element in
- * the JComboBox.
- *
- * @return Object[] Object array of size 1 containing currently selected
- * element in the JComboBox.
- */
- public Object[] getSelectedObjects()
- {
- return new Object[] { getSelectedItem() };
- }
-
- /**
- * This method handles actionEvents fired by the ComboBoxEditor. It changes
- * this JComboBox's selection to the new value currently in the editor and
- * hides list of combo box items.
- *
- * @param e the ActionEvent
- */
- public void actionPerformed(ActionEvent e)
- {
- setSelectedItem(((ComboBoxEditor) e.getSource()).getItem());
- setPopupVisible(false);
- }
-
- /**
- * This method selects item in this combo box that matches specified
- * specified keyChar and returns true if such item is found. Otherwise
- * false is returned.
- *
- * @param keyChar character indicating which item in the combo box should be
- * selected.
- *
- * @return boolean true if item corresponding to the specified keyChar
- * exists in the combo box. Otherwise false is returned.
- */
- public boolean selectWithKeyChar(char keyChar)
- {
- // FIXME: Need to implement
- return false;
- }
-
- /**
- * The part of implementation of ListDataListener interface. This method is
- * invoked when some items where added to the JComboBox's data model.
- *
- * @param event ListDataEvent describing the change
- */
- public void intervalAdded(ListDataEvent event)
- {
- // FIXME: Need to implement
- repaint();
- }
-
- /**
- * The part of implementation of ListDataListener interface. This method is
- * invoked when some items where removed from the JComboBox's data model.
- *
- * @param event ListDataEvent describing the change.
- */
- public void intervalRemoved(ListDataEvent event)
- {
- // FIXME: Need to implement
- repaint();
- }
-
- /**
- * The part of implementation of ListDataListener interface. This method is
- * invoked when contents of the JComboBox's data model changed.
- *
- * @param event ListDataEvent describing the change
- */
- public void contentsChanged(ListDataEvent event)
- {
- // if first and last index of the given ListDataEvent are both -1,
- // then it indicates that selected item in the combo box data model
- // have changed.
- if (event.getIndex0() == -1 && event.getIndex1() == -1)
- selectedItemChanged();
- }
-
- /**
- * This method disables or enables JComboBox. If the JComboBox is enabled,
- * then user is able to make item choice, otherwise if JComboBox is
- * disabled then user is not able to make a selection.
- *
- * @param enabled if 'enabled' is true then enable JComboBox and disable it
- */
- public void setEnabled(boolean enabled)
- {
- boolean oldEnabled = super.isEnabled();
- if (enabled != oldEnabled)
- {
- super.setEnabled(enabled);
- firePropertyChange("enabled", oldEnabled, enabled);
- }
- }
-
- /**
- * This method initializes specified ComboBoxEditor to display given item.
- *
- * @param anEditor ComboBoxEditor to initialize
- * @param anItem Item that should displayed in the specified editor
- */
- public void configureEditor(ComboBoxEditor anEditor, Object anItem)
- {
- anEditor.setItem(anItem);
- }
-
- /**
- * This method hides combo box's popup whenever TAB key is pressed.
- *
- * @param e The KeyEvent indicating which key was pressed.
- */
- public void processKeyEvent(KeyEvent e)
- {
- }
-
- /**
- * This method always returns false to indicate that JComboBox itself is
- * not focus traversable.
- *
- * @return false to indicate that JComboBox itself is not focus traversable.
- *
- * @deprecated
- */
- public boolean isFocusTraversable()
- {
- return false;
- }
-
- /**
- * setKeySelectionManager
- *
- * @param aManager
- */
- public void setKeySelectionManager(KeySelectionManager aManager)
- {
- }
-
- /**
- * getKeySelectionManager
- *
- * @return JComboBox.KeySelectionManager
- */
- public KeySelectionManager getKeySelectionManager()
- {
- return null;
- }
-
- /**
- * This method returns number of elements in this JComboBox
- *
- * @return int number of elements in this JComboBox
- */
- public int getItemCount()
- {
- return dataModel.getSize();
- }
-
- /**
- * Returns elements located in the combo box at the given index.
- *
- * @param index index specifying location of the component to return.
- *
- * @return component in the combo box that is located in the given index.
- */
- public Object getItemAt(int index)
- {
- return dataModel.getElementAt(index);
- }
-
- /**
- * createDefaultKeySelectionManager
- *
- * @return KeySelectionManager
- */
- protected KeySelectionManager createDefaultKeySelectionManager()
- {
- return null;
- }
-
- /**
- * A string that describes this JComboBox. Normally only used for debugging.
- *
- * @return A string describing this JComboBox
- */
- protected String paramString()
- {
- return "JComboBox";
- }
-
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJComboBox();
-
- return accessibleContext;
- }
-
- /**
- * This methods adds specified ActionListener to this JComboBox.
- *
- * @param listener to add
- */
- public void addActionListener(ActionListener listener)
- {
- listenerList.add(ActionListener.class, listener);
- }
-
- /**
- * This method removes specified ActionListener from this JComboBox.
- *
- * @param listener ActionListener
- */
- public void removeActionListener(ActionListener listener)
- {
- listenerList.remove(ActionListener.class, listener);
- }
-
- /**
- * This method returns array of ActionListeners that are registered with
- * this JComboBox.
- *
- * @since 1.4
- */
- public ActionListener[] getActionListeners()
- {
- return (ActionListener[]) getListeners(ActionListener.class);
- }
-
- /**
- * This method registers given ItemListener with this JComboBox
- *
- * @param listener to remove
- */
- public void addItemListener(ItemListener listener)
- {
- listenerList.add(ItemListener.class, listener);
- }
-
- /**
- * This method unregisters given ItemListener from this JComboBox
- *
- * @param listener to remove
- */
- public void removeItemListener(ItemListener listener)
- {
- listenerList.remove(ItemListener.class, listener);
- }
-
- /**
- * This method returns array of ItemListeners that are registered with this
- * JComboBox.
- *
- * @since 1.4
- */
- public ItemListener[] getItemListeners()
- {
- return (ItemListener[]) getListeners(ItemListener.class);
- }
-
- /**
- * Adds PopupMenuListener to combo box to listen to the events fired by the
- * combo box's popup menu containing its list of items
- *
- * @param listener to add
- */
- public void addPopupMenuListener(PopupMenuListener listener)
- {
- listenerList.add(PopupMenuListener.class, listener);
- }
-
- /**
- * Removes PopupMenuListener to combo box to listen to the events fired by
- * the combo box's popup menu containing its list of items
- *
- * @param listener to add
- */
- public void removePopupMenuListener(PopupMenuListener listener)
- {
- listenerList.remove(PopupMenuListener.class, listener);
- }
-
- /**
- * Returns array of PopupMenuListeners that are registered with combo box.
- */
- public PopupMenuListener[] getPopupMenuListeners()
- {
- return (PopupMenuListener[]) getListeners(PopupMenuListener.class);
- }
-
- /**
- * AccessibleJComboBox
- */
- protected class AccessibleJComboBox extends AccessibleJComponent
- implements AccessibleAction, AccessibleSelection
- {
- private static final long serialVersionUID = 8217828307256675666L;
-
- protected AccessibleJComboBox()
- {
- }
-
- public int getAccessibleChildrenCount()
- {
- return 0;
- }
-
- public Accessible getAccessibleChild(int value0)
- {
- return null;
- }
-
- public AccessibleSelection getAccessibleSelection()
- {
- return null;
- }
-
- public Accessible getAccessibleSelection(int value0)
- {
- return null;
- }
-
- public boolean isAccessibleChildSelected(int value0)
- {
- return false;
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.COMBO_BOX;
- }
-
- public AccessibleAction getAccessibleAction()
- {
- return null;
- }
-
- public String getAccessibleActionDescription(int value0)
- {
- return null;
- }
-
- public int getAccessibleActionCount()
- {
- return 0;
- }
-
- public boolean doAccessibleAction(int value0)
- {
- return false;
- }
-
- public int getAccessibleSelectionCount()
- {
- return 0;
- }
-
- public void addAccessibleSelection(int value0)
- {
- }
-
- public void removeAccessibleSelection(int value0)
- {
- }
-
- public void clearAccessibleSelection()
- {
- }
-
- public void selectAllAccessibleSelection()
- {
- }
- }
-}
diff --git a/libjava/javax/swing/JComponent.java b/libjava/javax/swing/JComponent.java
deleted file mode 100644
index d0bf8c9ae6f..00000000000
--- a/libjava/javax/swing/JComponent.java
+++ /dev/null
@@ -1,2279 +0,0 @@
-/* JComponent.java -- Every component in swing inherits from this class.
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.AWTEvent;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.Graphics;
-import java.awt.Image;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.dnd.DropTarget;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ContainerEvent;
-import java.awt.event.ContainerListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.ImageObserver;
-import java.awt.peer.LightweightPeer;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
-import java.beans.VetoableChangeListener;
-import java.io.Serializable;
-import java.util.EventListener;
-import java.util.Hashtable;
-import java.util.Locale;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleKeyBinding;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleStateSet;
-import javax.swing.border.Border;
-import javax.swing.event.AncestorListener;
-import javax.swing.event.EventListenerList;
-import javax.swing.event.SwingPropertyChangeSupport;
-import javax.swing.plaf.ComponentUI;
-
-/**
- * Every component in swing inherits from this class (JLabel, JButton, etc).
- * It contains generic methods to manage events, properties and sizes. Actual
- * drawing of the component is channeled to a look-and-feel class that is
- * implemented elsewhere.
- *
- * @author Ronald Veldema (rveldema&064;cs.vu.nl)
- * @author Graydon Hoare (graydon&064;redhat.com)
- */
-public abstract class JComponent extends Container implements Serializable
-{
- private static final long serialVersionUID = -7908749299918704233L;
-
- /**
- * Accessibility support is currently missing.
- */
-
- protected AccessibleContext accessibleContext;
-
- public abstract class AccessibleJComponent
- extends AccessibleAWTContainer
- {
- protected class AccessibleFocusHandler
- implements FocusListener
- {
- protected AccessibleFocusHandler(){}
- public void focusGained(FocusEvent event){}
- public void focusLost(FocusEvent valevent){}
- }
-
- protected class AccessibleContainerHandler
- implements ContainerListener
- {
- protected AccessibleContainerHandler() {}
- public void componentAdded(ContainerEvent event) {}
- public void componentRemoved(ContainerEvent valevent) {}
- }
-
- private static final long serialVersionUID = -7047089700479897799L;
-
- protected ContainerListener accessibleContainerHandler;
- protected FocusListener accessibleFocusHandler;
-
- protected AccessibleJComponent() {}
- public void addPropertyChangeListener(PropertyChangeListener listener) {}
- public void removePropertyChangeListener(PropertyChangeListener listener) {}
- public int getAccessibleChildrenCount() { return 0; }
- public Accessible getAccessibleChild(int value0) { return null; }
- public AccessibleStateSet getAccessibleStateSet() { return null; }
- public String getAccessibleName() { return null; }
- public String getAccessibleDescription() { return null; }
- public AccessibleRole getAccessibleRole() { return null; }
- protected String getBorderTitle(Border value0) { return null; }
- public String getToolTipText() { return null; }
- public String getTitledBorderText() { return null; }
- public AccessibleKeyBinding getAccessibleKeyBinding() { return null; }
- }
-
- /**
- * An explicit value for the component's preferred size; if not set by a
- * user, this is calculated on the fly by delegating to the {@link
- * ComponentUI.getPreferredSize} method on the {@link #ui} property.
- */
- Dimension preferredSize;
-
- /**
- * An explicit value for the component's minimum size; if not set by a
- * user, this is calculated on the fly by delegating to the {@link
- * ComponentUI.getMinimumSize} method on the {@link #ui} property.
- */
- Dimension minimumSize;
-
- /**
- * An explicit value for the component's maximum size; if not set by a
- * user, this is calculated on the fly by delegating to the {@link
- * ComponentUI.getMaximumSize} method on the {@link #ui} property.
- */
- Dimension maximumSize;
-
-
- /**
- * A value between 0.0 and 1.0 indicating the preferred horizontal
- * alignment of the component, relative to its siblings. The values
- * {@link #LEFT_ALIGNMENT}, {@link #CENTER_ALIGNMENT}, and {@link
- * #RIGHT_ALIGNMENT} can also be used, as synonyms for <code>0.0</code>,
- * <code>0.5</code>, and <code>1.0</code>, respectively. Not all layout
- * managers use this property.
- *
- * @see #getAlignmentX
- * @see #setAlignmentX
- * @see javax.swing.OverlayLayout
- * @see javax.swing.BoxLayout
- */
- float alignmentX = 0.5f;
-
- /**
- * A value between 0.0 and 1.0 indicating the preferred vertical
- * alignment of the component, relative to its siblings. The values
- * {@link #TOP_ALIGNMENT}, {@link #CENTER_ALIGNMENT}, and {@link
- * #BOTTOM_ALIGNMENT} can also be used, as synonyms for <code>0.0</code>,
- * <code>0.5</code>, and <code>1.0</code>, respectively. Not all layout
- * managers use this property.
- *
- * @see #getAlignmentY
- * @see #setAlignmentY
- * @see javax.swing.OverlayLayout
- * @see javax.swing.BoxLayout
- */
- float alignmentY = 0.5f;
-
- /**
- * The border painted around this component.
- *
- * @see #paintBorder
- */
- Border border;
-
- /**
- * The text to show in the tooltip associated with this component.
- *
- * @see #setToolTipText
- * @see #getToolTipText
- */
- String toolTipText;
-
- /**
- * <p>Whether to double buffer this component when painting. This flag
- * should generally be <code>false</code>, except for top level
- * components such as {@link JFrame} or {@link JApplet}.</p>
- *
- * <p>All children of a double buffered component are painted into the
- * double buffer automatically, so only the top widget in a window needs
- * to be double buffered.</p>
- *
- * @see #setDoubleBuffered
- * @see #isDoubleBuffered
- * @see #paintLock
- * @see #paint
- */
- boolean doubleBuffered = false;
-
- /**
- * A set of flags indicating which debugging graphics facilities should
- * be enabled on this component. The values should be a combination of
- * {@link DebugGraphics.NONE_OPTION}, {@link DebugGraphics.LOG_OPTION},
- * {@link DebugGraphics.FLASH_OPTION}, or {@link
- * DebugGraphics.BUFFERED_OPTION}.
- *
- * @see setDebugGraphicsOptions
- * @see getDebugGraphicsOptions
- * @see DebugGraphics
- * @see getComponentGraphics
- */
- int debugGraphicsOptions;
-
- /**
- * <p>This property controls two independent behaviors simultaneously.</p>
- *
- * <p>First, it controls whether to fill the background of this widget
- * when painting its body. This affects calls to {@link
- * JComponent#paintComponent}, which in turn calls {@link
- * ComponentUI#update} on the component's {@link #ui} property. If the
- * component is opaque during this call, the background will be filled
- * before calling {@link ComponentUI#paint}. This happens merely as a
- * convenience; you may fill the component's background yourself too,
- * but there is no need to do so if you will be filling with the same
- * color.</p>
- *
- * <p>Second, it the opaque property informs swing's repaint system
- * whether it will be necessary to paint the components "underneath" this
- * component, in Z-order. If the component is opaque, it is considered to
- * completely occlude components "underneath" it, so they will not be
- * repainted along with the opaque component.</p>
- *
- * <p>The default value for this property is <code>false</code>, but most
- * components will want to set it to <code>true</code> when installing UI
- * defaults in {@link ComponentUI#installUI}.</p>
- *
- * @see #setOpaque
- * @see #isOpaque
- * @see #paintComponent
- */
- boolean opaque = false;
-
- /**
- * The user interface delegate for this component. Event delivery and
- * repainting of the component are usually delegated to this object.
- *
- * @see #setUI
- * @see #getUI
- * @see #updateUI
- */
- protected ComponentUI ui;
-
- /**
- * A hint to the focus system that this component should or should not
- * get focus. If this is <code>false</code>, swing will not try to
- * request focus on this component; if <code>true</code>, swing might
- * try to request focus, but the request might fail. Thus it is only
- * a hint guiding swing's behavior.
- *
- * @see #requestFocus
- * @see #isRequestFocusEnabled
- * @see #setRequestFocusEnabled
- */
- boolean requestFocusEnabled;
-
- /**
- * Flag indicating behavior of this component when the mouse is dragged
- * outside the component and the mouse <em>stops moving</em>. If
- * <code>true</code>, synthetic mouse events will be delivered on regular
- * timed intervals, continuing off in the direction the mouse exited the
- * component, until the mouse is released or re-enters the component.
- *
- * @see setAutoscrolls
- * @see getAutoscrolls
- */
- boolean autoscrolls = false;
-
- /**
- * Listeners for events other than {@link PropertyChangeEvent} are
- * handled by this listener list. PropertyChangeEvents are handled in
- * {@link #changeSupport}.
- */
- protected EventListenerList listenerList = new EventListenerList();
-
- /**
- * Support for {@link PropertyChangeEvent} events. This is constructed
- * lazily when the component gets its first {@link
- * PropertyChangeListener} subscription; until then it's an empty slot.
- */
- private SwingPropertyChangeSupport changeSupport;
-
-
- /**
- * Storage for "client properties", which are key/value pairs associated
- * with this component by a "client", such as a user application or a
- * layout manager. This is lazily constructed when the component gets its
- * first client property.
- */
- private Hashtable clientProperties;
-
- private InputMap inputMap_whenFocused;
- private InputMap inputMap_whenAncestorOfFocused;
- private InputMap inputMap_whenInFocusedWindow;
- private ActionMap actionMap;
- /** @since 1.3 */
- private boolean verifyInputWhenFocusTarget;
- private InputVerifier inputVerifier;
-
- private TransferHandler transferHandler;
-
- /**
- * A lock held during recursive painting; this is used to serialize
- * access to the double buffer, and also to select the "top level"
- * object which should acquire the double buffer in a given widget
- * tree (which may have multiple double buffered children).
- *
- * @see #doubleBuffered
- * @see #paint
- */
- private static final Object paintLock = new Object();
-
-
- /**
- * The default locale of the component.
- *
- * @see #getDefaultLocale
- * @see #setDefaultLocale
- */
- private static Locale defaultLocale;
-
- public static final String TOOL_TIP_TEXT_KEY = "ToolTipText";
-
- /**
- * Constant used to indicate that no condition has been assigned to a
- * particular action.
- *
- * @see #registerKeyboardAction
- */
- public static final int UNDEFINED_CONDITION = -1;
-
- /**
- * Constant used to indicate that an action should be performed only when
- * the component has focus.
- *
- * @see #registerKeyboardAction
- */
- public static final int WHEN_FOCUSED = 0;
-
- /**
- * Constant used to indicate that an action should be performed only when
- * the component is an ancestor of the component which has focus.
- *
- * @see #registerKeyboardAction
- */
- public static final int WHEN_ANCESTOR_OF_FOCUSED_COMPONENT = 1;
-
- /**
- * Constant used to indicate that an action should be performed only when
- * the component is in the window which has focus.
- *
- * @see #registerKeyboardAction
- */
- public static final int WHEN_IN_FOCUSED_WINDOW = 2;
-
-
- /**
- * Creates a new <code>JComponent</code> instance.
- */
- public JComponent()
- {
- super();
- super.setLayout(new FlowLayout());
- setDropTarget(new DropTarget());
- defaultLocale = Locale.getDefault();
- debugGraphicsOptions = DebugGraphics.NONE_OPTION;
- }
-
- /**
- * Helper to lazily construct and return the client properties table.
- *
- * @return The current client properties table
- *
- * @see #clientProperties
- * @see #getClientProperty
- * @see #putClientProperty
- */
- private Hashtable getClientProperties()
- {
- if (clientProperties == null)
- clientProperties = new Hashtable();
- return clientProperties;
- }
-
- /**
- * Get a client property associated with this component and a particular
- * key.
- *
- * @param key The key with which to look up the client property
- *
- * @return A client property associated with this object and key
- *
- * @see #clientProperties
- * @see #getClientProperties
- * @see #putClientProperty
- */
- public final Object getClientProperty(Object key)
- {
- return getClientProperties().get(key);
- }
-
- /**
- * Add a client property <code>value</code> to this component, associated
- * with <code>key</code>. If there is an existing client property
- * associated with <code>key</code>, it will be replaced.
- *
- * @param key The key of the client property association to add
- * @param value The value of the client property association to add
- *
- * @see #clientProperties
- * @see #getClientProperties
- * @see #getClientProperty
- */
- public final void putClientProperty(Object key, Object value)
- {
- getClientProperties().put(key, value);
- }
-
- /**
- * Unregister an <code>AncestorListener</code>.
- *
- * @param listener The listener to unregister
- *
- * @see addAncestorListener
- */
- public void removeAncestorListener(AncestorListener listener)
- {
- listenerList.remove(AncestorListener.class, listener);
- }
-
- /**
- * Unregister a <code>PropertyChangeListener</code>.
- *
- * @param listener The listener to register
- *
- * @see #addPropertyChangeListener
- * @see #changeSupport
- */
- public void removePropertyChangeListener(PropertyChangeListener listener)
- {
- if (changeSupport != null)
- changeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * Unregister a <code>PropertyChangeListener</code>.
- *
- * @param propertyName The property name to unregister the listener from
- * @param listener The listener to unregister
- *
- * @see #addPropertyChangeListener
- * @see #changeSupport
- */
- public void removePropertyChangeListener(String propertyName,
- PropertyChangeListener listener)
- {
- if (changeSupport != null)
- changeSupport.removePropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Unregister a <code>VetoableChangeChangeListener</code>.
- *
- * @param listener The listener to unregister
- *
- * @see #addVetoableChangeListener
- */
- public void removeVetoableChangeListener(VetoableChangeListener listener)
- {
- listenerList.remove(VetoableChangeListener.class, listener);
- }
-
- /**
- * Register an <code>AncestorListener</code>.
- *
- * @param listener The listener to register
- *
- * @see #removeVetoableChangeListener
- */
- public void addAncestorListener(AncestorListener listener)
- {
- listenerList.add(AncestorListener.class, listener);
- }
-
- /**
- * Register a <code>PropertyChangeListener</code>. This listener will
- * receive any PropertyChangeEvent, regardless of property name. To
- * listen to a specific property name, use {@link
- * #addPropertyChangeListener(String,PropertyChangeListener)} instead.
- *
- * @param listener The listener to register
- *
- * @see #removePropertyChangeListener
- * @see #changeSupport
- */
- public void addPropertyChangeListener(PropertyChangeListener listener)
- {
- if (changeSupport == null)
- changeSupport = new SwingPropertyChangeSupport(this);
- changeSupport.addPropertyChangeListener(listener);
- }
-
- /**
- * Register a <code>PropertyChangeListener</code> for a specific, named
- * property. To listen to all property changes, regardless of name, use
- * {@link #addPropertyChangeListener(PropertyChangeListener)} instead.
- *
- * @param propertyName The property name to listen to
- * @param listener The listener to register
- *
- * @see #removePropertyChangeListener
- * @see #changeSupport
- */
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener listener)
- {
- listenerList.add(PropertyChangeListener.class, listener);
- }
-
- /**
- * Register a <code>VetoableChangeListener</code>.
- *
- * @param listener The listener to register
- *
- * @see #removeVetoableChangeListener
- * @see #listenerList
- */
- public void addVetoableChangeListener(VetoableChangeListener listener)
- {
- listenerList.add(VetoableChangeListener.class, listener);
- }
-
- /**
- * Return all registered listeners of a particular type.
- *
- * @param listenerType The type of listener to return
- *
- * @return All listeners in the {@link #listenerList} which
- * are of the specified type
- *
- * @see #listenerList
- */
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
- /**
- * Return all registered <code>AncestorListener</code> objects.
- *
- * @return The set of <code>AncestorListener</code> objects in {@link
- * #listenerList}
- */
- public AncestorListener[] getAncestorListeners()
- {
- return (AncestorListener[]) getListeners(AncestorListener.class);
- }
-
- /**
- * Return all registered <code>VetoableChangeListener</code> objects.
- *
- * @return The set of <code>VetoableChangeListener</code> objects in {@link
- * #listenerList}
- */
- public VetoableChangeListener[] getVetoableChangeListeners()
- {
- return (VetoableChangeListener[]) getListeners(VetoableChangeListener.class);
- }
-
- /**
- * Return all <code>PropertyChangeListener</code> objects registered to listen
- * for a particular property.
- *
- * @param property The property to return the listeners of
- *
- * @return The set of <code>PropertyChangeListener</code> objects in
- * {@link #changeSupport} registered to listen on the specified propert
- */
- public PropertyChangeListener[] getPropertyChangeListeners(String property)
- {
- return changeSupport == null ? new PropertyChangeListener[0]
- : changeSupport.getPropertyChangeListeners(property);
- }
-
- /**
- * A variant of {@link #firePropertyChange(String,Object,Object)}
- * for properties with <code>boolean</code> values.
- */
- public void firePropertyChange(String propertyName, boolean oldValue,
- boolean newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, Boolean.valueOf(oldValue),
- Boolean.valueOf(newValue));
- }
-
- /**
- * A variant of {@link #firePropertyChange(String,Object,Object)}
- * for properties with <code>byte</code> values.
- */
- public void firePropertyChange(String propertyName, byte oldValue,
- byte newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, new Byte(oldValue),
- new Byte(newValue));
- }
-
- /**
- * A variant of {@link #firePropertyChange(String,Object,Object)}
- * for properties with <code>char</code> values.
- */
- public void firePropertyChange(String propertyName, char oldValue,
- char newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, new Character(oldValue),
- new Character(newValue));
- }
-
- /**
- * A variant of {@link #firePropertyChange(String,Object,Object)}
- * for properties with <code>double</code> values.
- */
- public void firePropertyChange(String propertyName, double oldValue,
- double newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, new Double(oldValue),
- new Double(newValue));
- }
-
- /**
- * A variant of {@link #firePropertyChange(String,Object,Object)}
- * for properties with <code>float</code> values.
- */
- public void firePropertyChange(String propertyName, float oldValue,
- float newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, new Float(oldValue),
- new Float(newValue));
- }
-
- /**
- * A variant of {@link #firePropertyChange(String,Object,Object)}
- * for properties with <code>int</code> values.
- */
- public void firePropertyChange(String propertyName, int oldValue,
- int newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, new Integer(oldValue),
- new Integer(newValue));
- }
-
- /**
- * A variant of {@link #firePropertyChange(String,Object,Object)}
- * for properties with <code>long</code> values.
- */
- public void firePropertyChange(String propertyName, long oldValue,
- long newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, new Long(oldValue),
- new Long(newValue));
- }
-
- /**
- * Call {@link PropertyChangeListener#propertyChange} on all listeners
- * registered to listen to a given property. Any method which changes
- * the specified property of this component should call this method.
- *
- * @param propertyName The property which changed
- * @param oldValue The old value of the property
- * @param newValue The new value of the property
- *
- * @see #changeSupport
- * @see #addPropertyChangeListener
- * @see #removePropertyChangeListener
- */
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
- /**
- * A variant of {@link #firePropertyChange(String,Object,Object)}
- * for properties with <code>short</code> values.
- */
- public void firePropertyChange(String propertyName, short oldValue,
- short newValue)
- {
- if (changeSupport != null)
- changeSupport.firePropertyChange(propertyName, new Short(oldValue),
- new Short(newValue));
- }
-
- /**
- * Call {@link VetoableChangeListener#vetoableChange} on all listeners
- * registered to listen to a given property. Any method which changes
- * the specified property of this component should call this method.
- *
- * @param propertyName The property which changed
- * @param oldValue The old value of the property
- * @param newValue The new value of the property
- *
- * @throws PropertyVetoException if the change was vetoed by a listener
- *
- * @see addVetoableChangeListener
- * @see removeVetoableChangeListener
- */
- protected void fireVetoableChange(String propertyName, Object oldValue,
- Object newValue)
- throws PropertyVetoException
- {
- VetoableChangeListener[] listeners = getVetoableChangeListeners();
-
- PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue);
-
- for (int i = 0; i < listeners.length; i++)
- listeners[i].vetoableChange(evt);
- }
-
- /**
- * Get the value of the accessibleContext property for this component.
- *
- * @return the current value of the property
- */
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
-
- /**
- * Get the value of the {@link #alignmentX} property.
- *
- * @return The current value of the property.
- *
- * @see #setAlignmentX
- * @see #alignmentY
- */
- public float getAlignmentX()
- {
- return alignmentX;
- }
-
- /**
- * Get the value of the {@link #alignmentY} property.
- *
- * @return The current value of the property.
- *
- * @see #setAlignmentY
- * @see #alignmentX
- */
- public float getAlignmentY()
- {
- return alignmentY;
- }
-
- /**
- * Get the current value of the {@link #autoscrolls} property.
- *
- * @return The current value of the property
- */
- public boolean getAutoscrolls()
- {
- return autoscrolls;
- }
-
- /**
- * Set the value of the {@link #border} property, revalidate
- * and repaint this component.
- *
- * @param newBorder The new value of the property
- *
- * @see #getBorder
- */
- public void setBorder(Border newBorder)
- {
- Border oldBorder = border;
- border = newBorder;
- firePropertyChange("border", oldBorder, newBorder);
- revalidate();
- repaint();
- }
-
- /**
- * Get the value of the {@link #border} property.
- *
- * @return The property's current value
- *
- * @see #setBorder
- */
- public Border getBorder()
- {
- return border;
- }
-
- /**
- * Get the component's current bounding box. If a rectangle is provided,
- * use this as the return value (adjusting its fields in place);
- * otherwise (of <code>null</code> is provided) return a new {@link
- * Rectangle}.
- *
- * @param rv Optional return value to use
- *
- * @return A rectangle bounding the component
- */
- public Rectangle getBounds(Rectangle rv)
- {
- if (rv == null)
- return new Rectangle(getX(), getY(), getWidth(), getHeight());
- else
- {
- rv.setBounds(getX(), getY(), getWidth(), getHeight());
- return rv;
- }
- }
-
- /**
- * Prepares a graphics context for painting this object. If {@link
- * #debugGraphicsOptions} is not equal to {@link
- * DebugGraphics#NONE_OPTION}, produce a new {@link DebugGraphics} object
- * wrapping the parameter. Otherwise configure the parameter with this
- * component's foreground color and font.
- *
- * @param g The graphics context to wrap or configure
- *
- * @return A graphics context to paint this object with
- *
- * @see #debugGraphicsOptions
- * @see #paint
- */
- protected Graphics getComponentGraphics(Graphics g)
- {
- Graphics g2 = g.create();
- g2.setFont(this.getFont());
- g2.setColor(this.getForeground());
- return g2;
- }
-
-
- /**
- * Get the value of the {@link #debugGraphicsOptions} property.
- *
- * @return The current value of the property.
- *
- * @see #setDebugGraphicsOptions
- * @see #debugGraphicsOptions
- */
- public int getDebugGraphicsOptions()
- {
- return 0;
- }
-
- /**
- * Get the component's insets, which are calculated from
- * the {@link #border} property. If the border is <code>null</code>,
- * calls {@link Container#getInsets}.
- *
- * @return The component's current insets
- */
- public Insets getInsets()
- {
- if (border == null)
- return super.getInsets();
- return getBorder().getBorderInsets(this);
- }
-
- /**
- * Get the component's insets, which are calculated from the {@link
- * #border} property. If the border is <code>null</code>, calls {@link
- * Container#getInsets}. The passed-in {@link Insets} value will be
- * used as the return value, if possible.
- *
- * @param insets Return value object to reuse, if possible
- *
- * @return The component's current insets
- */
- public Insets getInsets(Insets insets)
- {
- Insets t = getInsets();
-
- if (insets == null)
- return t;
-
- insets.left = t.left;
- insets.right = t.right;
- insets.top = t.top;
- insets.bottom = t.bottom;
- return insets;
- }
-
- /**
- * Get the component's location. The passed-in {@link Point} value
- * will be used as the return value, if possible.
- *
- * @param rv Return value object to reuse, if possible
- *
- * @return The component's current location
- */
- public Point getLocation(Point rv)
- {
- if (rv == null)
- return new Point(getX(), getY());
-
- rv.setLocation(getX(), getY());
- return rv;
- }
-
- /**
- * Get the component's maximum size. If the {@link #maximumSize} property
- * has been explicitly set, it is returned. If the {@link #maximumSize}
- * property has not been set but the {@link ui} property has been, the
- * result of {@link ComponentUI#getMaximumSize} is returned. If neither
- * property has been set, the result of {@link Container#getMaximumSize}
- * is returned.
- *
- * @return The maximum size of the component
- *
- * @see #maximumSize
- * @see #setMaximumSize
- */
- public Dimension getMaximumSize()
- {
- if (maximumSize != null)
- return maximumSize;
-
- if (ui != null)
- {
- Dimension s = ui.getMaximumSize(this);
- if (s != null)
- return s;
- }
-
- Dimension p = super.getMaximumSize();
- return p;
- }
-
- /**
- * Get the component's minimum size. If the {@link #minimumSize} property
- * has been explicitly set, it is returned. If the {@link #minimumSize}
- * property has not been set but the {@link ui} property has been, the
- * result of {@link ComponentUI#getMinimumSize} is returned. If neither
- * property has been set, the result of {@link Container#getMinimumSize}
- * is returned.
- *
- * @return The minimum size of the component
- *
- * @see #minimumSize
- * @see #setMinimumSize
- */
- public Dimension getMinimumSize()
- {
- if (minimumSize != null)
- return minimumSize;
-
- if (ui != null)
- {
- Dimension s = ui.getMinimumSize(this);
- if (s != null)
- return s;
- }
-
- Dimension p = super.getMinimumSize();
- return p;
- }
-
- /**
- * Get the component's preferred size. If the {@link #preferredSize}
- * property has been explicitly set, it is returned. If the {@link
- * #preferredSize} property has not been set but the {@link ui} property
- * has been, the result of {@link ComponentUI#getPreferredSize} is
- * returned. If neither property has been set, the result of {@link
- * Container#getPreferredSize} is returned.
- *
- * @return The preferred size of the component
- *
- * @see #preferredSize
- * @see #setPreferredSize
- */
- public Dimension getPreferredSize()
- {
- if (preferredSize != null)
- return preferredSize;
-
- if (ui != null)
- {
- Dimension s = ui.getPreferredSize(this);
- if (s != null)
- return s;
- }
- Dimension p = super.getPreferredSize();
- return p;
- }
-
- /**
- * Checks if a maximum size was explicitely set on the component.
- *
- * @return <code>true</code> if a maximum size was set,
- * <code>false</code> otherwise
- *
- * @since 1.3
- */
- public boolean isMaximumSizeSet()
- {
- return maximumSize != null;
- }
-
- /**
- * Checks if a minimum size was explicitely set on the component.
- *
- * @return <code>true</code> if a minimum size was set,
- * <code>false</code> otherwise
- *
- * @since 1.3
- */
- public boolean isMinimumSizeSet()
- {
- return minimumSize != null;
- }
-
- /**
- * Checks if a preferred size was explicitely set on the component.
- *
- * @return <code>true</code> if a preferred size was set,
- * <code>false</code> otherwise
- *
- * @since 1.3
- */
- public boolean isPreferredSizeSet()
- {
- return preferredSize != null;
- }
-
- /**
- * Return the value of the {@link #nextFocusableComponent} property.
- *
- * @return The current value of the property, or <code>null</code>
- * if none has been set.
- *
- * @deprecated See {@link java.awt.FocusTraversalPolicy}
- */
- public Component getNextFocusableComponent()
- {
- return null;
- }
-
- /**
- * Return the set of {@link KeyStroke} objects which are registered
- * to initiate actions on this component.
- *
- * @return An array of the registered keystrokes
- */
- public KeyStroke[] getRegisteredKeyStrokes()
- {
- return null;
- }
-
- /**
- * Returns the first ancestor of this component which is a {@link JRootPane}.
- * Equivalent to calling <code>SwingUtilities.getRootPane(this);</code>.
- *
- * @return An ancestral JRootPane, or <code>null</code> if none exists.
- */
- public JRootPane getRootPane()
- {
- JRootPane p = SwingUtilities.getRootPane(this);
- return p;
- }
-
- /**
- * Get the component's size. The passed-in {@link Dimension} value
- * will be used as the return value, if possible.
- *
- * @param rv Return value object to reuse, if possible
- *
- * @return The component's current size
- */
- public Dimension getSize(Dimension rv)
- {
- if (rv == null)
- return new Dimension(getWidth(), getHeight());
- else
- {
- rv.setSize(getWidth(), getHeight());
- return rv;
- }
- }
-
- /**
- * Return the {@link #toolTip} property of this component, creating it and
- * setting it if it is currently <code>null</code>. This method can be
- * overridden in subclasses which wish to control the exact form of
- * tooltip created.
- *
- * @return The current toolTip
- */
- public JToolTip createToolTip()
- {
- JToolTip toolTip = new JToolTip();
- toolTip.setComponent(this);
- toolTip.setTipText(toolTipText);
-
- return toolTip;
- }
-
- /**
- * Return the location at which the {@link #toolTip} property should be
- * displayed, when triggered by a particular mouse event.
- *
- * @param event The event the tooltip is being presented in response to
- *
- * @return The point at which to display a tooltip, or <code>null</code>
- * if swing is to choose a default location.
- */
- public Point getToolTipLocation(MouseEvent event)
- {
- return null;
- }
-
- /**
- * Set the value of the {@link #toolTipText} property.
- *
- * @param text The new property value
- *
- * @see #getToolTipText
- */
- public void setToolTipText(String text)
- {
- if (text == null)
- {
- ToolTipManager.sharedInstance().unregisterComponent(this);
- toolTipText = null;
- return;
- }
-
- // XXX: The tip text doesn't get updated unless you set it to null
- // and then to something not-null. This is consistent with the behaviour
- // of Sun's ToolTipManager.
-
- String oldText = toolTipText;
- toolTipText = text;
-
- if (oldText == null)
- ToolTipManager.sharedInstance().registerComponent(this);
- }
-
- /**
- * Get the value of the {@link #toolTipText} property.
- *
- * @return The current property value
- *
- * @see #setToolTipText
- */
- public String getToolTipText()
- {
- return toolTipText;
- }
-
- /**
- * Get the value of the {@link #toolTipText} property, in response to a
- * particular mouse event.
- *
- * @param event The mouse event which triggered the tooltip
- *
- * @return The current property value
- *
- * @see #setToolTipText
- */
- public String getToolTipText(MouseEvent event)
- {
- return getToolTipText();
- }
-
- /**
- * Return the top level ancestral container (usually a {@link
- * java.awt.Window} or {@link java.awt.Applet}) which this component is
- * contained within, or <code>null</code> if no ancestors exist.
- *
- * @return The top level container, if it exists
- */
- public Container getTopLevelAncestor()
- {
- Container c = getParent();
- for (Container peek = c; peek != null; peek = peek.getParent())
- c = peek;
- return c;
- }
-
- /**
- * Compute the component's visible rectangle, which is defined
- * recursively as either the component's bounds, if it has no parent, or
- * the intersection of the component's bounds with the visible rectangle
- * of its parent.
- *
- * @param rect The return value slot to place the visible rectangle in
- */
- public void computeVisibleRect(Rectangle rect)
- {
- Component c = getParent();
- if (c != null && c instanceof JComponent)
- {
- ((JComponent) c).computeVisibleRect(rect);
- rect.translate(-getX(), -getY());
- Rectangle2D.intersect(rect,
- new Rectangle(0, 0, getWidth(), getHeight()),
- rect);
- }
- else
- rect.setRect(0, 0, getWidth(), getHeight());
- }
-
- /**
- * Return the component's visible rectangle in a new {@link Rectangle},
- * rather than via a return slot.
- *
- * @return The component's visible rectangle
- *
- * @see #computeVisibleRect(Rectangle)
- */
- public Rectangle getVisibleRect()
- {
- Rectangle r = new Rectangle();
- computeVisibleRect(r);
- return r;
- }
-
- /**
- * <p>Requests that this component receive input focus, giving window
- * focus to the top level ancestor of this component. Only works on
- * displayable, focusable, visible components.</p>
- *
- * <p>This method should not be called by clients; it is intended for
- * focus implementations. Use {@link Component#requestFocus} instead.</p>
- *
- * @see {@link Component#requestFocus}
- */
- public void grabFocus()
- {
- }
-
- /**
- * Get the value of the {@link #doubleBuffered} property.
- *
- * @return The property's current value
- */
- public boolean isDoubleBuffered()
- {
- return doubleBuffered;
- }
-
- /**
- * Return <code>true</code> if the provided component has no native peer;
- * in other words, if it is a "lightweight component".
- *
- * @param c The component to test for lightweight-ness
- *
- * @return Whether or not the component is lightweight
- */
- public static boolean isLightweightComponent(Component c)
- {
- return c.getPeer() instanceof LightweightPeer;
- }
-
- /**
- * Return <code>true</code> if you wish this component to manage its own
- * focus. In particular: if you want this component to be sent
- * <code>TAB</code> and <code>SHIFT+TAB</code> key events, and to not
- * have its children considered as focus transfer targets. If
- * <code>true</code>, focus traversal around this component changes to
- * <code>CTRL+TAB</code> and <code>CTRL+SHIFT+TAB</code>.
- *
- * @return <code>true</code> if you want this component to manage its own
- * focus, otherwise (by default) <code>false</code>
- *
- * @deprecated 1.4 Use {@link Component.setFocusTraversalKeys(int,Set)} and
- * {@link Container.setFocusCycleRoot(boolean)} instead
- */
- public boolean isManagingFocus()
- {
- return false;
- }
-
- /**
- * Return the current value of the {@link opaque} property.
- *
- * @return The current property value
- */
- public boolean isOpaque()
- {
- return opaque;
- }
-
- /**
- * Return <code>true</code> if the component can guarantee that none of its
- * children will overlap in Z-order. This is a hint to the painting system.
- * The default is to return <code>true</code>, but some components such as
- * {@link JLayeredPane} should override this to return <code>false</code>.
- *
- * @return Whether the component tiles its children
- */
- public boolean isOptimizedDrawingEnabled()
- {
- return true;
- }
-
- /**
- * Return <code>true</code> if this component is currently painting a tile.
- *
- * @return Whether the component is painting a tile
- */
- public boolean isPaintingTile()
- {
- return false;
- }
-
- /**
- * Get the value of the {@link #requestFocusEnabled} property.
- *
- * @return The current value of the property
- */
- public boolean isRequestFocusEnabled()
- {
- return requestFocusEnabled;
- }
-
- /**
- * Return <code>true</code> if this component is a validation root; this
- * will cause calls to {@link #invalidate} in this component's children
- * to be "captured" at this component, and not propagate to its parents.
- * For most components this should return <code>false</code>, but some
- * components such as {@link JViewPort} will want to return
- * <code>true</code>.
- *
- * @return Whether this component is a validation root
- */
- public boolean isValidateRoot()
- {
- return false;
- }
-
- /**
- * <p>Paint the component. This is a delicate process, and should only be
- * called from the repaint thread, under control of the {@link
- * RepaintManager}. Client code should usually call {@link #repaint} to
- * trigger painting.</p>
- *
- * <p>This method will acquire a double buffer from the {@link
- * RepaintManager} if the component's {@link #doubleBuffered} property is
- * <code>true</code> and the <code>paint</code> call is the
- * <em>first</em> recursive <code>paint</code> call inside swing.</p>
- *
- * <p>The method will also modify the provided {@link Graphics} context
- * via the {@link #getComponentGraphics} method. If you want to customize
- * the graphics object used for painting, you should override that method
- * rather than <code>paint</code>.</p>
- *
- * <p>The body of the <code>paint</code> call involves calling {@link
- * #paintComponent}, {@link #paintBorder}, and {@link #paintChildren} in
- * order. If you want to customize painting behavior, you should override
- * one of these methods rather than <code>paint</code>.</p>
- *
- * <p>For more details on the painting sequence, see <a
- * href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">this
- * article</a>.</p>
- *
- * @param g The graphics context to paint with
- *
- * @see #paintImmediately
- */
- public void paint(Graphics g)
- {
- Graphics g2 = g;
- Image doubleBuffer = null;
- RepaintManager rm = RepaintManager.currentManager(this);
-
- if (isDoubleBuffered()
- && (rm.isDoubleBufferingEnabled())
- && (! Thread.holdsLock(paintLock)))
- {
- doubleBuffer = rm.getOffscreenBuffer(this, getWidth(), getHeight());
- }
-
- synchronized (paintLock)
- {
- if (doubleBuffer != null)
- {
- g2 = doubleBuffer.getGraphics();
- g2.setClip(g.getClipBounds());
- }
-
- g2 = getComponentGraphics(g2);
- paintComponent(g2);
- paintBorder(g2);
- paintChildren(g2);
-
- if (doubleBuffer != null)
- g.drawImage(doubleBuffer, 0, 0, (ImageObserver) null);
- }
- }
-
- /**
- * Paint the component's border. This usually means calling {@link
- * Border#paintBorder} on the {@link #border} property, if it is
- * non-<code>null</code>. You may override this if you wish to customize
- * border painting behavior. The border is painted after the component's
- * body, but before the component's children.
- *
- * @param g The graphics context with which to paint the border
- *
- * @see #paint
- * @see #paintChildren
- * @see #paintComponent
- */
- protected void paintBorder(Graphics g)
- {
- if (getBorder() != null)
- getBorder().paintBorder(this, g, 0, 0, getWidth(), getHeight());
- }
-
- /**
- * Paint the component's children. This usually means calling {@link
- * Container#paint}, which recursively calls {@link #paint} on any of the
- * component's children, with appropriate changes to coordinate space and
- * clipping region. You may override this if you wish to customize
- * children painting behavior. The children are painted after the
- * component's body and border.
- *
- * @param g The graphics context with which to paint the children
- *
- * @see #paint
- * @see #paintBorder
- * @see #paintComponent
- */
- protected void paintChildren(Graphics g)
- {
- super.paint(g);
- }
-
- /**
- * Paint the component's body. This usually means calling {@link
- * ComponentUI#update} on the {@link #ui} property of the component, if
- * it is non-<code>null</code>. You may override this if you wish to
- * customize the component's body-painting behavior. The component's body
- * is painted first, before the border and children.
- *
- * @param g The graphics context with which to paint the body
- *
- * @see #paint
- * @see #paintBorder
- * @see #paintChildren
- */
- protected void paintComponent(Graphics g)
- {
- if (ui != null)
- ui.update(g, this);
- }
-
- /**
- * A variant of {@link #paintImmediately(Rectangle)} which takes
- * integer parameters.
- *
- * @param x The left x coordinate of the dirty region
- * @param y The top y coordinate of the dirty region
- * @param w The width of the dirty region
- * @param h The height of the dirty region
- */
- public void paintImmediately(int x, int y, int w, int h)
- {
- paintImmediately(new Rectangle(x, y, w, h));
- }
-
- /**
- * Transform the provided dirty rectangle for this component into the
- * appropriate ancestral {@link JRootPane} and call {@link #paint} on
- * that root pane. This method is called from the {@link RepaintManager}
- * and should always be called within the painting thread.
- *
- * @param r The dirty rectangle to paint
- */
- public void paintImmediately(Rectangle r)
- {
- Component root = SwingUtilities.getRoot(this);
- if (root == null || ! root.isShowing())
- return;
- Graphics g = root.getGraphics();
- if (g == null)
- return;
-
- Rectangle clip = SwingUtilities.convertRectangle(this, r, root);
- g.setClip(clip);
- root.paint(g);
- g.dispose();
- }
-
- /**
- * Return a string representation for this component, for use in
- * debugging.
- *
- * @return A string describing this component.
- */
- protected String paramString()
- {
- StringBuffer sb = new StringBuffer();
- sb.append(super.paramString());
- sb.append(",alignmentX=").append(getAlignmentX());
- sb.append(",alignmentY=").append(getAlignmentY());
- sb.append(",border=");
- if (getBorder() != null)
- sb.append(getBorder());
- sb.append(",maximumSize=");
- if (getMaximumSize() != null)
- sb.append(getMaximumSize());
- sb.append(",minimumSize=");
- if (getMinimumSize() != null)
- sb.append(getMinimumSize());
- sb.append(",preferredSize=");
- if (getPreferredSize() != null)
- sb.append(getPreferredSize());
- return sb.toString();
- }
-
- /**
- * A variant of {@link
- * #registerKeyboardAction(ActionListener,String,KeyStroke,int)} which
- * provides <code>null</code> for the command name.
- */
- public void registerKeyboardAction(ActionListener act,
- KeyStroke stroke,
- int cond)
- {
- registerKeyboardAction(act, null, stroke, cond);
- }
-
- /*
- * There is some charmingly undocumented behavior sun seems to be using
- * to simulate the old register/unregister keyboard binding API. It's not
- * clear to me why this matters, but we shall endeavour to follow suit.
- *
- * Two main thing seem to be happening when you do registerKeyboardAction():
- *
- * - no actionMap() entry gets created, just an entry in inputMap()
- *
- * - the inputMap() entry is a proxy class which invokes the the
- * binding's actionListener as a target, and which clobbers the command
- * name sent in the ActionEvent, providing the binding command name
- * instead.
- *
- * This much you can work out just by asking the input and action maps
- * what they contain after making bindings, and watching the event which
- * gets delivered to the recipient. Beyond that, it seems to be a
- * sun-private solution so I will only immitate it as much as it matters
- * to external observers.
- */
-
- private static class ActionListenerProxy
- extends AbstractAction
- {
- ActionListener target;
- String bindingCommandName;
-
- public ActionListenerProxy(ActionListener li,
- String cmd)
- {
- target = li;
- bindingCommandName = cmd;
- }
-
- public void actionPerformed(ActionEvent e)
- {
- ActionEvent derivedEvent = new ActionEvent(e.getSource(),
- e.getID(),
- bindingCommandName,
- e.getModifiers());
- target.actionPerformed(derivedEvent);
- }
- }
-
-
- /**
- * An obsolete method to register a keyboard action on this component.
- * You should use <code>getInputMap</code> and <code>getActionMap</code>
- * to fetch mapping tables from keystrokes to commands, and commands to
- * actions, respectively, and modify those mappings directly.
- *
- * @param anAction The action to be registered
- * @param aCommand The command to deliver in the delivered {@link
- * java.awt.ActionEvent}
- * @param aKeyStroke The keystroke to register on
- * @param aCondition One of the values {@link #UNDEFINED_CONDITION},
- * {@link #WHEN_ANCESTOR_OF_FOCUSED_COMPONENT}, {@link #WHEN_FOCUSED}, or
- * {@link #WHEN_IN_FOCUSED_WINDOW}, indicating the condition which must
- * be met for the action to be fired
- *
- * @see #unregisterKeyboardAction
- * @see #getConditionForKeystroke
- * @see #resetKeyboardActiond
- */
- public void registerKeyboardAction(ActionListener act,
- String cmd,
- KeyStroke stroke,
- int cond)
- {
- getInputMap(cond).put(stroke, new ActionListenerProxy(act, cmd));
- }
-
-
-
- public final void setInputMap(int condition, InputMap map)
- {
- enableEvents(AWTEvent.KEY_EVENT_MASK);
- switch (condition)
- {
- case WHEN_FOCUSED:
- inputMap_whenFocused = map;
- break;
-
- case WHEN_ANCESTOR_OF_FOCUSED_COMPONENT:
- inputMap_whenAncestorOfFocused = map;
- break;
-
- case WHEN_IN_FOCUSED_WINDOW:
- inputMap_whenInFocusedWindow = map;
- break;
-
- case UNDEFINED_CONDITION:
- default:
- throw new IllegalArgumentException();
- }
- }
-
- public final InputMap getInputMap(int condition)
- {
- enableEvents(AWTEvent.KEY_EVENT_MASK);
- switch (condition)
- {
- case WHEN_FOCUSED:
- if (inputMap_whenFocused == null)
- inputMap_whenFocused = new InputMap();
- return inputMap_whenFocused;
-
- case WHEN_ANCESTOR_OF_FOCUSED_COMPONENT:
- if (inputMap_whenAncestorOfFocused == null)
- inputMap_whenAncestorOfFocused = new InputMap();
- return inputMap_whenAncestorOfFocused;
-
- case WHEN_IN_FOCUSED_WINDOW:
- if (inputMap_whenInFocusedWindow == null)
- inputMap_whenInFocusedWindow = new InputMap();
- return inputMap_whenInFocusedWindow;
-
- case UNDEFINED_CONDITION:
- default:
- return null;
- }
- }
-
- public final InputMap getInputMap()
- {
- return getInputMap(WHEN_FOCUSED);
- }
-
- public final ActionMap getActionMap()
- {
- if (actionMap == null)
- actionMap = new ActionMap();
- return actionMap;
- }
-
- public final void setActionMap(ActionMap map)
- {
- actionMap = map;
- }
-
- /**
- * Return the condition that determines whether a registered action
- * occurs in response to the specified keystroke.
- *
- * @param aKeyStroke The keystroke to return the condition of
- *
- * @return One of the values {@link #UNDEFINED_CONDITION}, {@link
- * #WHEN_ANCESTOR_OF_FOCUSED_COMPONENT}, {@link #WHEN_FOCUSED}, or {@link
- * #WHEN_IN_FOCUSED_WINDOW}
- *
- * @deprecated As of 1.3 KeyStrokes can be registered with multiple
- * simultaneous conditions.
- *
- * @see #registerKeyboardAction
- * @see #unregisterKeyboardAction
- * @see #resetKeyboardActiond
- */
- public int getConditionForKeyStroke(KeyStroke ks)
- {
- if (inputMap_whenFocused != null
- && inputMap_whenFocused.get(ks) != null)
- return WHEN_FOCUSED;
- else if (inputMap_whenAncestorOfFocused != null
- && inputMap_whenAncestorOfFocused.get(ks) != null)
- return WHEN_ANCESTOR_OF_FOCUSED_COMPONENT;
- else if (inputMap_whenInFocusedWindow != null
- && inputMap_whenInFocusedWindow.get(ks) != null)
- return WHEN_IN_FOCUSED_WINDOW;
- else
- return UNDEFINED_CONDITION;
- }
-
- /**
- * Get the ActionListener (typically an {@link Action} object) which is
- * associated with a particular keystroke.
- *
- * @param aKeyStroke The keystroke to retrieve the action of
- *
- * @return The action associated with the specified keystroke
- *
- * @deprecated Use {@link #getActionMap()}
- */
- public ActionListener getActionForKeyStroke(KeyStroke ks)
- {
- Object cmd = getInputMap().get(ks);
- if (cmd != null)
- {
- if (cmd instanceof ActionListenerProxy)
- return (ActionListenerProxy) cmd;
- else if (cmd instanceof String)
- return getActionMap().get(cmd);
- }
- return null;
- }
-
- /**
- * A hook for subclasses which want to customize event processing.
- */
- protected void processComponentKeyEvent(KeyEvent e)
- {
- }
-
- /**
- * Override the default key dispatch system from Component to hook into
- * the swing {@link InputMap} / {@link ActionMap} system.
- *
- * See <a
- * href="http://java.sun.com/products/jfc/tsc/special_report/kestrel/keybindings.html">this
- * report</a> for more details, it's somewhat complex.
- */
- protected void processKeyEvent(KeyEvent e)
- {
- processComponentKeyEvent(e);
-
- // FIXME: this needs to be elaborated significantly, to do all the
- // focus / ancestor / window searching for the various binding modes.
- if (! e.isConsumed() &&
- processKeyBinding(KeyStroke.getKeyStrokeForEvent(e),
- e, WHEN_FOCUSED, e.getID() == KeyEvent.KEY_PRESSED))
- e.consume();
- }
-
- protected boolean processKeyBinding(KeyStroke ks,
- KeyEvent e,
- int condition,
- boolean pressed)
- {
- if (isEnabled())
- {
- Action act = null;
- InputMap map = getInputMap(condition);
- if (map != null)
- {
- Object cmd = map.get(ks);
- if (cmd != null)
- {
- if (cmd instanceof ActionListenerProxy)
- act = (Action) cmd;
- else
- act = (Action) getActionMap().get(cmd);
- }
- }
- if (act != null && act.isEnabled())
- return SwingUtilities.notifyAction(act, ks, e, this, e.getModifiers());
- }
- return false;
- }
-
- /**
- * Remove a keyboard action registry.
- *
- * @param stroke The keystroke to unregister
- *
- * @see #registerKeyboardAction
- * @see #getConditionForKeystroke
- * @see #resetKeyboardActiond
- */
- public void unregisterKeyboardAction(KeyStroke aKeyStroke)
- {
- }
-
-
- /**
- * Reset all keyboard action registries.
- *
- * @see #registerKeyboardAction
- * @see #unregisterKeyboardAction
- * @see #getConditionForKeystroke
- */
- public void resetKeyboardActions()
- {
- if (inputMap_whenFocused != null)
- inputMap_whenFocused.clear();
- if (inputMap_whenAncestorOfFocused != null)
- inputMap_whenAncestorOfFocused.clear();
- if (inputMap_whenInFocusedWindow != null)
- inputMap_whenInFocusedWindow.clear();
- if (actionMap != null)
- actionMap.clear();
- }
-
-
- /**
- * Mark the described region of this component as dirty in the current
- * {@link RepaintManager}. This will queue an asynchronous repaint using
- * the system painting thread in the near future.
- *
- * @param tm ignored
- * @param x coordinate of the region to mark as dirty
- * @param y coordinate of the region to mark as dirty
- * @param width dimension of the region to mark as dirty
- * @param height dimension of the region to mark as dirty
- */
- public void repaint(long tm, int x, int y, int width, int height)
- {
- Rectangle dirty = new Rectangle(x, y, width, height);
- Rectangle vis = getVisibleRect();
- dirty = dirty.intersection(vis);
- RepaintManager.currentManager(this).addDirtyRegion(this, dirty.x, dirty.y,
- dirty.width,
- dirty.height);
- }
-
- /**
- * Mark the described region of this component as dirty in the current
- * {@link RepaintManager}. This will queue an asynchronous repaint using
- * the system painting thread in the near future.
- *
- * @param r The rectangle to mark as dirty
- */
- public void repaint(Rectangle r)
- {
- repaint((long) 0, (int) r.getX(), (int) r.getY(), (int) r.getWidth(),
- (int) r.getHeight());
- }
-
- /**
- * Request focus on the default component of this component's {@link
- * FocusTraversalPolicy}.
- *
- * @return The result of {@link #requestFocus}
- *
- * @deprecated Use {@link #requestFocus()} on the default component provided from
- * the {@link FocusTraversalPolicy} instead.
- */
- public boolean requestDefaultFocus()
- {
- return false;
- }
-
- /**
- * Queue a an invalidation and revalidation of this component, using
- * {@link RepaintManager#addInvalidComponent}.
- */
- public void revalidate()
- {
- invalidate();
- RepaintManager.currentManager(this).addInvalidComponent(this);
- }
-
- /**
- * Calls <code>scrollRectToVisible</code> on the component's parent.
- * Components which can service this call should override.
- *
- * @param r The rectangle to make visible
- */
- public void scrollRectToVisible(Rectangle r)
- {
- Component p = getParent();
- if (p instanceof JComponent)
- ((JComponent) p).scrollRectToVisible(r);
- }
-
- /**
- * Set the value of the {@link #alignmentX} property.
- *
- * @param a The new value of the property
- */
- public void setAlignmentX(float a)
- {
- alignmentX = a;
- }
-
- /**
- * Set the value of the {@link #alignmentY} property.
- *
- * @param a The new value of the property
- */
- public void setAlignmentY(float a)
- {
- alignmentY = a;
- }
-
- /**
- * Set the value of the {@link #autoscrolls} property.
- *
- * @param a The new value of the property
- */
- public void setAutoscrolls(boolean a)
- {
- autoscrolls = a;
- }
-
- /**
- * Set the value of the {@link #debugGraphicsOptions} property.
- *
- * @param debugOptions The new value of the property
- */
- public void setDebugGraphicsOptions(int debugOptions)
- {
- debugGraphicsOptions = debugOptions;
- }
-
- /**
- * Set the value of the {@link #doubleBuffered} property.
- *
- * @param db The new value of the property
- */
- public void setDoubleBuffered(boolean db)
- {
- doubleBuffered = db;
- }
-
- /**
- * Set the value of the {@link #enabled} property, revalidate
- * and repaint this component.
- *
- * @param enable The new value of the property
- */
- public void setEnabled(boolean enable)
- {
- boolean oldEnabled = isEnabled();
- super.setEnabled(enable);
- firePropertyChange("enabeld", oldEnabled, enable);
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #font} property, revalidate
- * and repaint this component.
- *
- * @param f The new value of the property
- */
- public void setFont(Font f)
- {
- super.setFont(f);
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #background} property, revalidate
- * and repaint this component.
- *
- * @param bg The new value of the property
- */
- public void setBackground(Color bg)
- {
- super.setBackground(bg);
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #foreground} property, revalidate
- * and repaint this component.
- *
- * @param fg The new value of the property
- */
- public void setForeground(Color fg)
- {
- super.setForeground(fg);
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #maximumSize} property, revalidate
- * and repaint this component.
- *
- * @param max The new value of the property
- */
- public void setMaximumSize(Dimension max)
- {
- Dimension oldMaximumSize = maximumSize;
- maximumSize = max;
- firePropertyChange("maximumSize", oldMaximumSize, maximumSize);
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #minimumSize} property, revalidate
- * and repaint this component.
- *
- * @param min The new value of the property
- */
- public void setMinimumSize(Dimension min)
- {
- Dimension oldMinimumSize = minimumSize;
- minimumSize = min;
- firePropertyChange("minimumSize", oldMinimumSize, minimumSize);
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #preferredSize} property, revalidate
- * and repaint this component.
- *
- * @param pref The new value of the property
- */
- public void setPreferredSize(Dimension pref)
- {
- Dimension oldPreferredSize = preferredSize;
- preferredSize = pref;
- firePropertyChange("preferredSize", oldPreferredSize, preferredSize);
- }
-
- /**
- * Set the specified component to be the next component in the
- * focus cycle, overriding the {@link FocusTraversalPolicy} for
- * this component.
- *
- * @param aComponent The component to set as the next focusable
- *
- * @deprecated Use FocusTraversalPolicy instead
- */
- public void setNextFocusableComponent(Component aComponent)
- {
- }
-
- /**
- * Set the value of the {@link #requestFocusEnabled} property.
- *
- * @param e The new value of the property
- */
- public void setRequestFocusEnabled(boolean e)
- {
- requestFocusEnabled = e;
- }
-
- /**
- * Get the value of the {@link #transferHandler} property.
- *
- * @return The current value of the property
- *
- * @see ComponentUI#setTransferHandler
- */
-
- public TransferHandler getTransferHandler()
- {
- return transferHandler;
- }
-
- /**
- * Set the value of the {@link #transferHandler} property.
- *
- * @param newHandler The new value of the property
- *
- * @see ComponentUI#getTransferHandler
- */
-
- public void setTransferHandler(TransferHandler newHandler)
- {
- if (transferHandler == newHandler)
- return;
-
- TransferHandler oldHandler = transferHandler;
- transferHandler = newHandler;
- firePropertyChange("transferHandler", oldHandler, newHandler);
- }
-
- /**
- * Set the value of the {@link #opaque} property, revalidate and repaint
- * this component.
- *
- * @param isOpaque The new value of the property
- *
- * @see ComponentUI#update
- */
- public void setOpaque(boolean isOpaque)
- {
- boolean oldOpaque = opaque;
- opaque = isOpaque;
- firePropertyChange("opaque", oldOpaque, opaque);
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the visible property, and revalidate / repaint the
- * component.
- *
- * @param v The new value of the property
- */
- public void setVisible(boolean v)
- {
- super.setVisible(v);
- revalidate();
- repaint();
- }
-
- /**
- * Call {@link paint}.
- *
- * @param g The graphics context to paint into
- */
- public void update(Graphics g)
- {
- paint(g);
- }
-
- /**
- * Get the value of the UIClassID property. This property should be a key
- * in the {@link UIDefaults} table managed by {@link UIManager}, the
- * value of which is the name of a class to load for the component's
- * {@link ui} property.
- *
- * @return A "symbolic" name which will map to a class to use for the
- * component's UI, such as <code>"ComponentUI"</code>
- *
- * @see #setUI
- * @see #updateUI
- */
- public String getUIClassID()
- {
- return "ComponentUI";
- }
-
- /**
- * Install a new UI delegate as the component's {@link ui} property. In
- * the process, this will call {@link ComponentUI.uninstallUI} on any
- * existing value for the {@link ui} property, and {@link
- * ComponentUI.installUI} on the new UI delegate.
- *
- * @param newUI The new UI delegate to install
- *
- * @see #updateUI
- * @see #getUIClassID
- */
- protected void setUI(ComponentUI newUI)
- {
- if (ui != null)
- ui.uninstallUI(this);
-
- ComponentUI oldUI = ui;
- ui = newUI;
-
- if (ui != null)
- ui.installUI(this);
-
- firePropertyChange("UI", oldUI, newUI);
-
- revalidate();
- repaint();
- }
-
- /**
- * This method should be overridden in subclasses. In JComponent, the
- * method does nothing. In subclasses, it should a UI delegate
- * (corresponding to the symbolic name returned from {@link
- * getUIClassID}) from the {@link UIManager}, and calls {@link setUI}
- * with the new delegate.
- */
- public void updateUI()
- {
- System.out.println("update UI not overwritten in class: " + this);
- }
-
- public static Locale getDefaultLocale()
- {
- return defaultLocale;
- }
-
- public static void setDefaultLocale(Locale l)
- {
- defaultLocale = l;
- }
-
- /**
- * Returns the currently set input verifier for this component.
- *
- * @return the input verifier, or <code>null</code> if none
- */
- public InputVerifier getInputVerifier()
- {
- return inputVerifier;
- }
-
- /**
- * Sets the input verifier to use by this component.
- *
- * @param verifier the input verifier, or <code>null</code>
- */
- public void setInputVerifier(InputVerifier verifier)
- {
- InputVerifier oldVerifier = inputVerifier;
- inputVerifier = verifier;
- firePropertyChange("inputVerifier", oldVerifier, verifier);
- }
-
- /**
- * @since 1.3
- */
- public boolean getVerifyInputWhenFocusTarget()
- {
- return verifyInputWhenFocusTarget;
- }
-
- /**
- * @since 1.3
- */
- public void setVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget)
- {
- if (this.verifyInputWhenFocusTarget == verifyInputWhenFocusTarget)
- return;
-
- this.verifyInputWhenFocusTarget = verifyInputWhenFocusTarget;
- firePropertyChange("verifyInputWhenFocusTarget",
- ! verifyInputWhenFocusTarget,
- verifyInputWhenFocusTarget);
- }
-}
diff --git a/libjava/javax/swing/JDesktopPane.java b/libjava/javax/swing/JDesktopPane.java
deleted file mode 100644
index f802d29d5b8..00000000000
--- a/libjava/javax/swing/JDesktopPane.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/* JDesktopPane.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.beans.PropertyVetoException;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.swing.plaf.DesktopPaneUI;
-
-/**
- * JDesktopPane is a container (usually for JInternalFrames) that simulates a
- * desktop. Typically, the user will create JInternalFrames and place thme in
- * a JDesktopPane. The user can then interact with JInternalFrames like they
- * usually would with JFrames. The actions (minimize, maximize, close, etc)
- * are done by using a DesktopManager that is associated with the
- * JDesktopPane.
- */
-public class JDesktopPane extends JLayeredPane implements Accessible
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 766333777224038726L;
-
- /**
- * This specifies that when dragged, a JInternalFrame should be completely
- * visible.
- *
- * @specnote final since 1.5.0.
- */
- public static final int LIVE_DRAG_MODE = 0;
-
- /**
- * This specifies that when dragged, a JInternalFrame should only be visible
- * as an outline.
- *
- * @specnote final since 1.5.0.
- */
- public static final int OUTLINE_DRAG_MODE = 1;
-
- /** The selected frame in the JDesktopPane. */
- private transient JInternalFrame selectedFrame;
-
- /** The JDesktopManager to use for acting on JInternalFrames. */
- transient DesktopManager desktopManager;
-
- /** The drag mode used by the JDesktopPane. */
- private transient int dragMode = LIVE_DRAG_MODE;
-
- /**
- * AccessibleJDesktopPane
- */
- protected class AccessibleJDesktopPane extends AccessibleJComponent
- {
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 6079388927946077570L;
-
- /**
- * Constructor AccessibleJDesktopPane
- */
- protected AccessibleJDesktopPane()
- {
- }
-
- /**
- * getAccessibleRole
- *
- * @return AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.DESKTOP_PANE;
- }
- }
-
- /**
- * Creates a new JDesktopPane object.
- */
- public JDesktopPane()
- {
- setLayout(null);
- updateUI();
- }
-
- /**
- * This method returns the UI used with the JDesktopPane.
- *
- * @return The UI used with the JDesktopPane.
- */
- public DesktopPaneUI getUI()
- {
- return (DesktopPaneUI) ui;
- }
-
- /**
- * This method sets the UI used with the JDesktopPane.
- *
- * @param ui The UI to use with the JDesktopPane.
- */
- public void setUI(DesktopPaneUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method sets the drag mode to use with the JDesktopPane.
- *
- * @param mode The drag mode to use.
- *
- * @throws IllegalArgumentException If the drag mode given is not
- * LIVE_DRAG_MODE or OUTLINE_DRAG_MODE.
- */
- public void setDragMode(int mode)
- {
- if ((mode != LIVE_DRAG_MODE) && (mode != OUTLINE_DRAG_MODE))
- throw new IllegalArgumentException("Drag mode not valid.");
-
- // FIXME: Unsupported mode.
- if (mode == OUTLINE_DRAG_MODE)
- {
- // throw new IllegalArgumentException("Outline drag modes are unsupported.");
- mode = LIVE_DRAG_MODE;
- }
-
- dragMode = mode;
- }
-
- /**
- * This method returns the drag mode used with the JDesktopPane.
- *
- * @return The drag mode used with the JDesktopPane.
- */
- public int getDragMode()
- {
- return dragMode;
- }
-
- /**
- * This method returns the DesktopManager used with the JDesktopPane.
- *
- * @return The DesktopManager to use with the JDesktopPane.
- */
- public DesktopManager getDesktopManager()
- {
- return desktopManager;
- }
-
- /**
- * This method sets the DesktopManager to use with the JDesktopPane.
- *
- * @param manager The DesktopManager to use with the JDesktopPane.
- */
- public void setDesktopManager(DesktopManager manager)
- {
- desktopManager = manager;
- }
-
- /**
- * This method restores the UI used with the JDesktopPane to the default.
- */
- public void updateUI()
- {
- setUI((DesktopPaneUI) UIManager.getUI(this));
- invalidate();
- }
-
- /**
- * This method returns a String identifier that allows the UIManager to know
- * which class will act as JDesktopPane's UI.
- *
- * @return A String identifier for the UI class to use.
- */
- public String getUIClassID()
- {
- return "DesktopPaneUI";
- }
-
- /**
- * This method returns all JInternalFrames that are in the JDesktopPane.
- *
- * @return All JInternalFrames that are in the JDesktopPane.
- */
- public JInternalFrame[] getAllFrames()
- {
- return getFramesFromComponents(getComponents());
- }
-
- /**
- * This method returns the currently selected frame in the JDesktopPane.
- *
- * @return The currently selected frame in the JDesktopPane.
- */
- public JInternalFrame getSelectedFrame()
- {
- return selectedFrame;
- }
-
- /**
- * This method sets the selected frame in the JDesktopPane.
- *
- * @param frame The selected frame in the JDesktopPane.
- */
- public void setSelectedFrame(JInternalFrame frame)
- {
- if (selectedFrame != null)
- {
- try
- {
- selectedFrame.setSelected(false);
- }
- catch (PropertyVetoException e)
- {
- }
- }
- selectedFrame = null;
-
- try
- {
- if (frame != null)
- frame.setSelected(true);
-
- selectedFrame = frame;
- }
- catch (PropertyVetoException e)
- {
- }
- }
-
- /**
- * This method returns all the JInternalFrames in the given layer.
- *
- * @param layer The layer to grab frames in.
- *
- * @return All JInternalFrames in the given layer.
- */
- public JInternalFrame[] getAllFramesInLayer(int layer)
- {
- return getFramesFromComponents(getComponentsInLayer(layer));
- }
-
- /**
- * This method always returns true to indicate that it is not transparent.
- *
- * @return true.
- */
- public boolean isOpaque()
- {
- return true;
- }
-
- /**
- * This method returns a String that describes the JDesktopPane.
- *
- * @return A String that describes the JDesktopPane.
- */
- protected String paramString()
- {
- return "JDesktopPane";
- }
-
- /**
- * This method returns all the JInternalFrames in the given Component array.
- *
- * @param components An array to search for JInternalFrames in.
- *
- * @return An array of JInternalFrames found in the Component array.
- */
- private static JInternalFrame[] getFramesFromComponents(Component[] components)
- {
- int count = 0;
-
- for (int i = 0; i < components.length; i++)
- if (components[i] instanceof JInternalFrame)
- count++;
-
- JInternalFrame[] value = new JInternalFrame[count];
- for (int i = 0, j = 0; i < components.length && j != count; i++)
- if (components[i] instanceof JInternalFrame)
- value[j++] = (JInternalFrame) components[i];
- return value;
- }
-
- /**
- * getAccessibleContext
- *
- * @return AccessibleContext
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJDesktopPane();
-
- return accessibleContext;
- }
-}
diff --git a/libjava/javax/swing/JDialog.java b/libjava/javax/swing/JDialog.java
deleted file mode 100644
index 62980ccfa88..00000000000
--- a/libjava/javax/swing/JDialog.java
+++ /dev/null
@@ -1,561 +0,0 @@
-/* JDialog.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Dialog;
-import java.awt.Dimension;
-import java.awt.Frame;
-import java.awt.Graphics;
-import java.awt.GraphicsConfiguration;
-import java.awt.IllegalComponentStateException;
-import java.awt.LayoutManager;
-import java.awt.event.WindowEvent;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-
-/**
- * Unlike JComponent derivatives, JDialog inherits from java.awt.Dialog. But
- * also lets a look-and-feel component to its work.
- *
- * @author Ronald Veldema (rveldema_AT_cs.vu.nl)
- */
-public class JDialog extends Dialog implements Accessible, WindowConstants,
- RootPaneContainer
-{
- private static final long serialVersionUID = -864070866424508218L;
-
- /** DOCUMENT ME! */
- protected AccessibleContext accessibleContext;
-
- /** The single RootPane in the Dialog. */
- protected JRootPane rootPane;
-
- /** Whether checking is enabled on the RootPane */
- protected boolean rootPaneCheckingEnabled = true;
-
- /** The default action taken when closed. */
- private int close_action = HIDE_ON_CLOSE;
-
- /** Whether JDialogs are decorated by the Look and Feel. */
- private static boolean decorated;
-
- /**
- * Creates a new non-modal JDialog with no title
- * using a shared Frame as the owner.
- */
- public JDialog()
- {
- this(SwingUtilities.getOwnerFrame(), "", false, null);
- }
-
- /**
- * Creates a new non-modal JDialog with no title
- * using the given owner.
- *
- * @param owner The owner of the JDialog.
- */
- public JDialog(Dialog owner)
- {
- this(owner, "", false, null);
- }
-
- /**
- * Creates a new JDialog with no title using the
- * given modal setting and owner.
- *
- * @param owner The owner of the JDialog.
- * @param modal Whether the JDialog is modal.
- */
- public JDialog(Dialog owner, boolean modal)
- {
- this(owner, "", modal, null);
- }
-
- /**
- * Creates a new non-modal JDialog using the
- * given title and owner.
- *
- * @param owner The owner of the JDialog.
- * @param title The title of the JDialog.
- */
- public JDialog(Dialog owner, String title)
- {
- this(owner, title, false, null);
- }
-
- /**
- * Creates a new JDialog using the given modal
- * settings, title, and owner.
- *
- * @param owner The owner of the JDialog.
- * @param title The title of the JDialog.
- * @param modal Whether the JDialog is modal.
- */
- public JDialog(Dialog owner, String title, boolean modal)
- {
- this(owner, title, modal, null);
- }
-
- /**
- * Creates a new JDialog using the given modal
- * settings, title, owner and graphics configuration.
- *
- * @param owner The owner of the JDialog.
- * @param title The title of the JDialog.
- * @param modal Whether the JDialog is modal.
- * @param gc The Graphics Configuration to use.
- */
- public JDialog(Dialog owner, String title, boolean modal,
- GraphicsConfiguration gc)
- {
- super(owner, title, modal, gc);
- dialogInit();
- }
-
- /**
- * Creates a new non-modal JDialog with no title
- * using the given owner.
- *
- * @param owner The owner of the JDialog.
- */
- public JDialog(Frame owner)
- {
- this(owner, "", false, null);
- }
-
- /**
- * Creates a new JDialog with no title using the
- * given modal setting and owner.
- *
- * @param owner The owner of the JDialog.
- * @param modal Whether the JDialog is modal.
- */
- public JDialog(Frame owner, boolean modal)
- {
- this(owner, "", modal, null);
- }
-
- /**
- * Creates a new non-modal JDialog using the
- * given title and owner.
- *
- * @param owner The owner of the JDialog.
- * @param title The title of the JDialog.
- */
- public JDialog(Frame owner, String title)
- {
- this(owner, title, false, null);
- }
-
- /**
- * Creates a new JDialog using the given modal
- * settings, title, and owner.
- *
- * @param owner The owner of the JDialog.
- * @param title The title of the JDialog.
- * @param modal Whether the JDialog is modal.
- */
- public JDialog(Frame owner, String title, boolean modal)
- {
- this(owner, title, modal, null);
- }
-
- /**
- * Creates a new JDialog using the given modal
- * settings, title, owner and graphics configuration.
- *
- * @param owner The owner of the JDialog.
- * @param title The title of the JDialog.
- * @param modal Whether the JDialog is modal.
- * @param gc The Graphics Configuration to use.
- */
- public JDialog(Frame owner, String title, boolean modal,
- GraphicsConfiguration gc)
- {
- super((owner == null) ? SwingUtilities.getOwnerFrame() : owner,
- title, modal, gc);
- dialogInit();
- }
-
- /**
- * This method is called to initialize the
- * JDialog. It sets the layout used, the locale,
- * and creates the RootPane.
- */
- protected void dialogInit()
- {
- // FIXME: Do a check on GraphicsEnvironment.isHeadless()
- setRootPaneCheckingEnabled(false);
- setLocale(JComponent.getDefaultLocale());
- getRootPane(); // will do set/create
- setRootPaneCheckingEnabled(true);
- invalidate();
-
- }
-
- /**
- * This method returns whether JDialogs will have their
- * window decorations provided by the Look and Feel.
- *
- * @return Whether the window decorations are Look and Feel provided.
- */
- public static boolean isDefaultLookAndFeelDecorated()
- {
- return decorated;
- }
-
- /**
- * This method sets whether JDialogs will have their
- * window decorations provided by the Look and Feel.
- *
- * @param defaultLookAndFeelDecorated Whether the window
- * decorations are Look and Feel provided.
- */
- public static void setDefaultLookAndFeelDecorated(boolean defaultLookAndFeelDecorated)
- {
- decorated = defaultLookAndFeelDecorated;
- }
-
- /**
- * This method returns the preferred size of
- * the JDialog.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize()
- {
- Dimension d = super.getPreferredSize();
- return d;
- }
-
- /**
- * This method returns the JMenuBar used
- * in this JDialog.
- *
- * @return The JMenuBar in the JDialog.
- */
- public JMenuBar getJMenuBar()
- {
- return getRootPane().getJMenuBar();
- }
-
- /**
- * This method sets the JMenuBar used
- * in this JDialog.
- *
- * @param menubar The JMenuBar to use.
- */
- public void setJMenuBar(JMenuBar menubar)
- {
- getRootPane().setJMenuBar(menubar);
- }
-
- /**
- * This method sets the LayoutManager used in the JDialog.
- * This method will throw an Error if rootPaneChecking is
- * enabled.
- *
- * @param manager The LayoutManager to use.
- */
- public void setLayout(LayoutManager manager)
- {
- if (isRootPaneCheckingEnabled())
- throw new Error("rootPaneChecking is enabled - cannot set layout.");
- super.setLayout(manager);
- }
-
- /**
- * This method sets the JLayeredPane used in the JDialog.
- * If the given JLayeredPane is null, then this method
- * will throw an Error.
- *
- * @param layeredPane The JLayeredPane to use.
- */
- public void setLayeredPane(JLayeredPane layeredPane)
- {
- if (layeredPane == null)
- throw new IllegalComponentStateException("layeredPane cannot be null.");
- getRootPane().setLayeredPane(layeredPane);
- }
-
- /**
- * This method returns the JLayeredPane used with this JDialog.
- *
- * @return The JLayeredPane used with this JDialog.
- */
- public JLayeredPane getLayeredPane()
- {
- return getRootPane().getLayeredPane();
- }
-
- /**
- * This method returns the JRootPane used with this JDialog.
- *
- * @return The JRootPane used with this JDialog.
- */
- public JRootPane getRootPane()
- {
- if (rootPane == null)
- setRootPane(createRootPane());
- return rootPane;
- }
-
- /**
- * This method sets the JRootPane used with this JDialog.
- *
- * @param root The JRootPane to use.
- */
- protected void setRootPane(JRootPane root)
- {
- if (rootPane != null)
- remove(rootPane);
-
- rootPane = root;
- rootPane.show();
- add(rootPane);
- }
-
- /**
- * This method creates a new JRootPane.
- *
- * @return A new JRootPane.
- */
- protected JRootPane createRootPane()
- {
- return new JRootPane();
- }
-
- /**
- * This method returns the ContentPane
- * in the JRootPane.
- *
- * @return The ContentPane in the JRootPane.
- */
- public Container getContentPane()
- {
- return getRootPane().getContentPane();
- }
-
- /**
- * This method sets the ContentPane to use with this
- * JDialog. If the ContentPane given is null, this method
- * will throw an exception.
- *
- * @param contentPane The ContentPane to use with the JDialog.
- */
- public void setContentPane(Container contentPane)
- {
- if (contentPane == null)
- throw new IllegalComponentStateException("contentPane cannot be null.");
- getRootPane().setContentPane(contentPane);
- }
-
- /**
- * This method returns the GlassPane for this JDialog.
- *
- * @return The GlassPane for this JDialog.
- */
- public Component getGlassPane()
- {
- return getRootPane().getGlassPane();
- }
-
- /**
- * This method sets the GlassPane for this JDialog.
- *
- * @param glassPane The GlassPane for this JDialog.
- */
- public void setGlassPane(Component glassPane)
- {
- getRootPane().setGlassPane(glassPane);
- }
-
- /**
- * This method is called when a component is added to the
- * the JDialog. Calling this method with rootPaneCheckingEnabled
- * will cause an Error to be thrown.
- *
- * @param comp The component to add.
- * @param constraints The constraints.
- * @param index The position of the component.
- */
- protected void addImpl(Component comp, Object constraints, int index)
- {
- if (isRootPaneCheckingEnabled())
- throw new Error("rootPaneChecking is enabled - adding components disallowed.");
- super.addImpl(comp, constraints, index);
- }
-
- /**
- * This method removes a component from the JDialog.
- *
- * @param comp The component to remove.
- */
- public void remove(Component comp)
- {
- // The path changes if the component == root.
- if (comp == rootPane)
- super.remove(rootPane);
- else
- getContentPane().remove(comp);
- }
-
- /**
- * This method returns whether rootPane checking is enabled.
- *
- * @return Whether rootPane checking is enabled.
- */
- protected boolean isRootPaneCheckingEnabled()
- {
- return rootPaneCheckingEnabled;
- }
-
- /**
- * This method sets whether rootPane checking is enabled.
- *
- * @param enabled Whether rootPane checking is enabled.
- */
- protected void setRootPaneCheckingEnabled(boolean enabled)
- {
- rootPaneCheckingEnabled = enabled;
- }
-
- /**
- * This method simply calls paint and returns.
- *
- * @param g The Graphics object to paint with.
- */
- public void update(Graphics g)
- {
- paint(g);
- }
-
-
- /**
- * This method handles window events. This allows the JDialog
- * to honour its default close operation.
- *
- * @param e The WindowEvent.
- */
- protected void processWindowEvent(WindowEvent e)
- {
- // System.out.println("PROCESS_WIN_EV-1: " + e);
- super.processWindowEvent(e);
- // System.out.println("PROCESS_WIN_EV-2: " + e);
- switch (e.getID())
- {
- case WindowEvent.WINDOW_CLOSING:
- {
- switch (getDefaultCloseOperation())
- {
- case DISPOSE_ON_CLOSE:
- {
- dispose();
- break;
- }
- case HIDE_ON_CLOSE:
- {
- setVisible(false);
- break;
- }
- case DO_NOTHING_ON_CLOSE:
- break;
- }
- break;
- }
- case WindowEvent.WINDOW_CLOSED:
- case WindowEvent.WINDOW_OPENED:
- case WindowEvent.WINDOW_ICONIFIED:
- case WindowEvent.WINDOW_DEICONIFIED:
- case WindowEvent.WINDOW_ACTIVATED:
- case WindowEvent.WINDOW_DEACTIVATED:
- break;
- }
- }
-
- /**
- * This method sets the action to take
- * when the JDialog is closed.
- *
- * @param operation The action to take.
- */
- public void setDefaultCloseOperation(int operation)
- {
- if (operation == DO_NOTHING_ON_CLOSE ||
- operation == HIDE_ON_CLOSE ||
- operation == DISPOSE_ON_CLOSE)
- close_action = operation;
- else
- throw new IllegalArgumentException("Default close operation must be one of DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE");
- }
-
- /**
- * This method returns the action taken when
- * the JDialog is closed.
- *
- * @return The action to take.
- */
- public int getDefaultCloseOperation()
- {
- return close_action;
- }
-
- /**
- * This method returns a String describing the JDialog.
- *
- * @return A String describing the JDialog.
- */
- protected String paramString()
- {
- return "JDialog";
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-}
diff --git a/libjava/javax/swing/JEditorPane.java b/libjava/javax/swing/JEditorPane.java
deleted file mode 100644
index bfa72369be9..00000000000
--- a/libjava/javax/swing/JEditorPane.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/* JEditorPane.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Dimension;
-import java.awt.event.KeyEvent;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.accessibility.AccessibleContext;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.DefaultEditorKit;
-import javax.swing.text.EditorKit;
-import javax.swing.text.JTextComponent;
-
-
-public class JEditorPane extends JTextComponent
-{
- private static final long serialVersionUID = 3140472492599046285L;
-
- private URL page;
- private EditorKit editorKit;
-
- boolean focus_root;
- boolean manages_focus;
-
- public JEditorPane()
- {
- setEditorKit(createDefaultEditorKit());
- }
-
- public JEditorPane(String url) throws IOException
- {
- this(new URL(url));
- }
-
- public JEditorPane(String type, String text)
- {
- setEditorKit(createEditorKitForContentType(type));
- setText(text);
- }
-
- public JEditorPane(URL url) throws IOException
- {
- this();
- setPage(url);
- }
-
- protected EditorKit createDefaultEditorKit()
- {
- return new DefaultEditorKit();
- }
-
- public static EditorKit createEditorKitForContentType(String type)
- {
- return new DefaultEditorKit();
- }
-
- /**
- * Sends a given <code>HyperlinkEvent</code> to all registered listeners.
- *
- * @param event the event to send
- */
- public void fireHyperlinkUpdate(HyperlinkEvent event)
- {
- HyperlinkListener[] listeners = getHyperlinkListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].hyperlinkUpdate(event);
- }
-
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
- public final String getContentType()
- {
- return getEditorKit().getContentType();
- }
-
- public EditorKit getEditorKit()
- {
- return editorKit;
- }
-
- public static String getEditorKitClassNameForContentType(String type)
- {
- return "text/plain";
- }
-
- public EditorKit getEditorKitForContentType(String type)
- {
- return editorKit;
- }
-
- /**
- * Returns the preferred size for the JEditorPane.
- */
- public Dimension getPreferredSize()
- {
- return super.getPreferredSize();
- }
-
- public boolean getScrollableTracksViewportHeight()
- {
- return false;
- }
-
- public boolean getScrollableTracksViewportWidth()
- {
- return false;
- }
-
- public URL getPage()
- {
- return page;
- }
-
- protected InputStream getStream(URL page)
- throws IOException
- {
- return page.openStream();
- }
-
- public String getText()
- {
- return super.getText();
- }
-
- public String getUIClassID()
- {
- return "EditorPaneUI";
- }
-
- public boolean isFocusCycleRoot()
- {
- return focus_root;
- }
-
- public boolean isManagingFocus()
- {
- return manages_focus;
- }
-
- protected String paramString()
- {
- return "JEditorPane";
- }
-
- /**
- * Overridden to handle processing of tab/shift tab.
- */
- protected void processComponentKeyEvent(KeyEvent e)
- {
- }
-
- /**
- * Make sure that TAB and Shift-TAB events get consumed,
- * so that awt doesn't attempt focus traversal.
- */
- protected void processKeyEvent(KeyEvent e)
- {
- }
-
- /**
- * This method initializes from a stream.
- */
- public void read(InputStream in, Object desc)
- throws IOException
- {
- }
-
- /**
- * Establishes the default bindings of type to classname.
- */
- public static void registerEditorKitForContentType(String type,
- String classname)
- {
- }
-
- /**
- * Establishes the default bindings of type to classname.
- */
- public static void registerEditorKitForContentType(String type,
- String classname,
- ClassLoader loader)
- {
- }
-
- /**
- * Replaces the currently selected content with new content represented
- * by the given string.
- */
- public void replaceSelection(String content)
- {
- }
-
- /**
- * Scrolls the view to the given reference location (that is, the value
- * returned by the UL.getRef method for the URL being displayed).
- */
- public void scrollToReference(String reference)
- {
- }
-
- public final void setContentType(String type)
- {
- if (editorKit != null
- && editorKit.getContentType().equals(type))
- return;
-
- EditorKit kit = getEditorKitForContentType(type);
-
- if (kit != null)
- setEditorKit(kit);
- }
-
- public void setEditorKit(EditorKit newValue)
- {
- if (editorKit == newValue)
- return;
-
- if (editorKit != null)
- editorKit.deinstall(this);
-
- EditorKit oldValue = editorKit;
- editorKit = newValue;
-
- if (editorKit != null)
- {
- editorKit.install(this);
- setDocument(editorKit.createDefaultDocument());
- }
-
- firePropertyChange("editorKit", oldValue, newValue);
- invalidate();
- repaint();
- }
-
- public void setEditorKitForContentType(String type, EditorKit k)
- {
- // FIXME: editorKitCache.put(type, kit);
- }
-
- /**
- * Sets the current URL being displayed.
- */
- public void setPage(String url) throws IOException
- {
- setPage(new URL(url));
- }
-
- /**
- * Sets the current URL being displayed.
- */
- public void setPage(URL page) throws IOException
- {
- if (page == null)
- throw new IOException("invalid url");
-
- try
- {
- this.page = page;
- getEditorKit().read(page.openStream(), getDocument(), 0);
- }
- catch (BadLocationException e)
- {
- // Ignored. '0' is always a valid offset.
- }
- }
-
- public void setText(String t)
- {
- super.setText(t);
- }
-
- /**
- * Add a <code>HyperlinkListener</code> object to this editor pane.
- *
- * @param listener the listener to add
- */
- public void addHyperlinkListener(HyperlinkListener listener)
- {
- listenerList.add(HyperlinkListener.class, listener);
- }
-
- /**
- * Removes a <code>HyperlinkListener</code> object to this editor pane.
- *
- * @param listener the listener to remove
- */
- public void removeHyperlinkListener(HyperlinkListener listener)
- {
- listenerList.remove(HyperlinkListener.class, listener);
- }
-
- /**
- * Returns all added <code>HyperlinkListener</code> objects.
- *
- * @return array of listeners
- *
- * @since 1.4
- */
- public HyperlinkListener[] getHyperlinkListeners()
- {
- return (HyperlinkListener[]) getListeners(HyperlinkListener.class);
- }
-}
diff --git a/libjava/javax/swing/JFileChooser.java b/libjava/javax/swing/JFileChooser.java
deleted file mode 100644
index bed2818ba7b..00000000000
--- a/libjava/javax/swing/JFileChooser.java
+++ /dev/null
@@ -1,959 +0,0 @@
-/* JFileChooser.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.event.ActionListener;
-import java.io.File;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.swing.filechooser.FileFilter;
-import javax.swing.filechooser.FileSystemView;
-import javax.swing.filechooser.FileView;
-import javax.swing.plaf.FileChooserUI;
-
-/**
- * JFileChooser
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class JFileChooser extends JComponent implements Accessible {
-
- private static final long serialVersionUID = 3162921138695327837L;
-
- /**
- * AccessibleJFileChooser
- */
- protected class AccessibleJFileChooser extends AccessibleJComponent
- {
- private static final long serialVersionUID = 8205148454060169244L;
-
- /**
- * Constructor AccessibleJFileChooser
- * @param component TODO
- */
- protected AccessibleJFileChooser()
- {
- }
-
- /**
- * getAccessibleRole
- * @return AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.FILE_CHOOSER;
- }
- }
-
- /**
- * uiClassID
- */
- private static final String uiClassID = "FileChooserUI";
-
- /**
- * OPEN_DIALOG
- */
- public static final int OPEN_DIALOG = 0;
-
- /**
- * SAVE_DIALOG
- */
- public static final int SAVE_DIALOG = 1;
-
- /**
- * CUSTOM_DIALOG
- */
- public static final int CUSTOM_DIALOG = 2;
-
- /**
- * CANCEL_OPTION
- */
- public static final int CANCEL_OPTION = 1;
-
- /**
- * APPROVE_OPTION
- */
- public static final int APPROVE_OPTION = 0;
-
- /**
- * ERROR_OPTION
- */
- public static final int ERROR_OPTION = -1;
-
- /**
- * FILES_ONLY
- */
- public static final int FILES_ONLY = 0;
-
- /**
- * DIRECTORIES_ONLY
- */
- public static final int DIRECTORIES_ONLY = 1;
-
- /**
- * FILES_AND_DIRECTORIES
- */
- public static final int FILES_AND_DIRECTORIES = 2;
-
- /**
- * CANCEL_SELECTION
- */
- public static final String CANCEL_SELECTION = "CancelSelection";
-
- /**
- * APPROVE_SELECTION
- */
- public static final String APPROVE_SELECTION = "ApproveSelection";
-
- /**
- * APPROVE_BUTTON_TEXT_CHANGED_PROPERTY
- */
- public static final String APPROVE_BUTTON_TEXT_CHANGED_PROPERTY = "ApproveButtonTextChangedProperty";
-
- /**
- * APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY
- */
- public static final String APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY = "ApproveButtonToolTipTextChangedProperty";
-
- /**
- * APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY
- */
- public static final String APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY = "ApproveButtonMnemonicChangedProperty";
-
- /**
- * CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY
- */
- public static final String CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY = "ControlButtonsAreShownChangedProperty";
-
- /**
- * DIRECTORY_CHANGED_PROPERTY
- */
- public static final String DIRECTORY_CHANGED_PROPERTY = "directoryChanged";
-
- /**
- * SELECTED_FILE_CHANGED_PROPERTY
- */
- public static final String SELECTED_FILE_CHANGED_PROPERTY = "SelectedFileChangedProperty";
-
- /**
- * SELECTED_FILES_CHANGED_PROPERTY
- */
- public static final String SELECTED_FILES_CHANGED_PROPERTY = "SelectedFilesChangedProperty";
-
- /**
- * MULTI_SELECTION_ENABLED_CHANGED_PROPERTY
- */
- public static final String MULTI_SELECTION_ENABLED_CHANGED_PROPERTY = "MultiSelectionEnabledChangedProperty";
-
- /**
- * FILE_SYSTEM_VIEW_CHANGED_PROPERTY
- */
- public static final String FILE_SYSTEM_VIEW_CHANGED_PROPERTY = "FileSystemViewChanged";
-
- /**
- * FILE_VIEW_CHANGED_PROPERTY
- */
- public static final String FILE_VIEW_CHANGED_PROPERTY = "fileViewChanged";
-
- /**
- * FILE_HIDING_CHANGED_PROPERTY
- */
- public static final String FILE_HIDING_CHANGED_PROPERTY = "FileHidingChanged";
-
- /**
- * FILE_FILTER_CHANGED_PROPERTY
- */
- public static final String FILE_FILTER_CHANGED_PROPERTY = "fileFilterChanged";
-
- /**
- * FILE_SELECTION_MODE_CHANGED_PROPERTY
- */
- public static final String FILE_SELECTION_MODE_CHANGED_PROPERTY = "fileSelectionChanged";
-
- /**
- * ACCESSORY_CHANGED_PROPERTY
- */
- public static final String ACCESSORY_CHANGED_PROPERTY = "AccessoryChangedProperty";
-
- /**
- * ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY
- */
- public static final String ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY = "acceptAllFileFilterUsedChanged";
-
- /**
- * DIALOG_TITLE_CHANGED_PROPERTY
- */
- public static final String DIALOG_TITLE_CHANGED_PROPERTY = "DialogTitleChangedProperty";
-
- /**
- * DIALOG_TYPE_CHANGED_PROPERTY
- */
- public static final String DIALOG_TYPE_CHANGED_PROPERTY = "DialogTypeChangedProperty";
-
- /**
- * CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY
- */
- public static final String CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY = "ChoosableFileFilterChangedProperty";
-
- /**
- * dialogTitle
- */
- private String dialogTitle;
-
- /**
- * approveButtonText
- */
- private String approveButtonText;
-
- /**
- * approveButtonToolTipText
- */
- private String approveButtonToolTipText;
-
- /**
- * approveButtonMnemonic
- */
- private int approveButtonMnemonic;
-
- /**
- * actionListener
- */
- private ActionListener actionListener;
-
- /**
- * filters
- */
- private Vector filters;
-
- /**
- * dialog
- */
- private JDialog dialog;
-
- /**
- * dialogType
- */
- private int dialogType;
-
- /**
- * returnValue
- */
- private int returnValue;
-
- /**
- * accessory
- */
- private JComponent accessory;
-
- /**
- * fileView
- */
- private FileView fileView;
-
- /**
- * uiFileView
- */
- private FileView uiFileView;
-
- /**
- * controlsShown
- */
- private boolean controlsShown;
-
- /**
- * useFileHiding
- */
- private boolean useFileHiding;
-
- /**
- * fileSelectionMode
- */
- private int fileSelectionMode;
-
- /**
- * multiSelectionEnabled
- */
- private boolean multiSelectionEnabled;
-
- /**
- * useAcceptAllFileFilter
- */
- private boolean useAcceptAllFileFilter;
-
- /**
- * fileFilter
- */
- private FileFilter fileFilter;
-
- /**
- * fileSystemView
- */
- private FileSystemView fileSystemView;
-
- /**
- * currentDirectory
- */
- private File currentDirectory;
-
- /**
- * selectedFile
- */
- private File selectedFile;
-
- /**
- * selectedFiles
- */
- private File[] selectedFiles;
-
- /**
- * accessibleContext
- */
- protected AccessibleContext accessibleContext;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor JFileChooser
- */
- public JFileChooser() {
- // TODO
- } // JFileChooser()
-
- /**
- * Constructor JFileChooser
- * @param currentDirectoryPath TODO
- */
- public JFileChooser(String currentDirectoryPath) {
- // TODO
- } // JFileChooser()
-
- /**
- * Constructor JFileChooser
- * @param currentDirectory TODO
- */
- public JFileChooser(File currentDirectory) {
- // TODO
- } // JFileChooser()
-
- /**
- * Constructor JFileChooser
- * @param value0 TODO
- */
- public JFileChooser(FileSystemView fsv) {
- // TODO
- } // JFileChooser()
-
- /**
- * Constructor JFileChooser
- * @param currentDirectory TODO
- * @param fsv TODO
- */
- public JFileChooser(File currentDirectory, FileSystemView fsv) {
- // TODO
- } // JFileChooser()
-
- /**
- * Constructor JFileChooser
- * @param currentDirectoryPath TODO
- * @param fsv TODO
- */
- public JFileChooser(String currentDirectoryPath, FileSystemView fsv) {
- // TODO
- } // JFileChooser()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * writeObject
- * @param stream TODO
- * @exception IOException TODO
- */
- private void writeObject(ObjectOutputStream stream) throws IOException {
- // TODO
- } // writeObject()
-
- /**
- * getName
- * @param file TODO
- * @returns String
- */
- public String getName(File file) {
- return null; // TODO
- } // getName()
-
- /**
- * setup
- * @param view TODO
- */
- protected void setup(FileSystemView view) {
- // TODO
- } // setup()
-
- /**
- * accept
- * @param file TODO
- * @returns boolean
- */
- public boolean accept(File file) {
- return false; // TODO
- } // accept()
-
- /**
- * getSelectedFile
- * @returns File
- */
- public File getSelectedFile() {
- return null; // TODO
- } // getSelectedFile()
-
- /**
- * setSelectedFile
- * @param file TODO
- */
- public void setSelectedFile(File file) {
- // TODO
- } // setSelectedFile()
-
- /**
- * getSelectedFiles
- * @returns File[]
- */
- public File[] getSelectedFiles() {
- return null; // TODO
- } // getSelectedFiles()
-
- /**
- * setSelectedFiles
- * @param files TODO
- */
- public void setSelectedFiles(File[] files) {
- // TODO
- } // setSelectedFiles()
-
- /**
- * getCurrentDirectory
- * @returns File
- */
- public File getCurrentDirectory() {
- return null; // TODO
- } // getCurrentDirectory()
-
- /**
- * setCurrentDirectory
- * @param directory TODO
- */
- public void setCurrentDirectory(File directory) {
- // TODO
- } // setCurrentDirectory()
-
- /**
- * changeToParentDirectory
- */
- public void changeToParentDirectory() {
- // TODO
- } // changeToParentDirectory()
-
- /**
- * rescanCurrentDirectory
- */
- public void rescanCurrentDirectory() {
- // TODO
- } // rescanCurrentDirectory()
-
- /**
- * ensureFileIsVisible
- * @param file TODO
- */
- public void ensureFileIsVisible(File file) {
- // TODO
- } // ensureFileIsVisible()
-
- /**
- * showOpenDialog
- * @param parent TODO
- * @returns int
- */
- public int showOpenDialog(Component parent) {
- return CANCEL_OPTION; // TODO
- } // showOpenDialog()
-
- /**
- * showSaveDialog
- * @param parent TODO
- * @returns int
- */
- public int showSaveDialog(Component parent) {
- return CANCEL_OPTION; // TODO
- } // showSaveDialog()
-
- /**
- * showDialog
- * @param parent TODO
- * @param approveButtonText TODO
- * @returns int
- */
- public int showDialog(Component parent, String approveButtonText) {
- return CANCEL_OPTION; // TODO
- } // showDialog()
-
- /**
- * getControlButtonsAreShown
- * @returns boolean
- */
- public boolean getControlButtonsAreShown() {
- return false; // TODO
- } // getControlButtonsAreShown()
-
- /**
- * setControlButtonsAreShown
- * @param value TODO
- */
- public void setControlButtonsAreShown(boolean value) {
- // TODO
- } // setControlButtonsAreShown()
-
- /**
- * getDialogType
- * @returns int
- */
- public int getDialogType() {
- return 0; // TODO
- } // getDialogType()
-
- /**
- * setDialogType
- * @param type TODO
- */
- public void setDialogType(int type) {
- // TODO
- } // setDialogType()
-
- /**
- * setDialogTitle
- * @param title TODO
- */
- public void setDialogTitle(String title) {
- // TODO
- } // setDialogTitle()
-
- /**
- * getDialogTitle
- * @returns String
- */
- public String getDialogTitle() {
- return null; // TODO
- } // getDialogTitle()
-
- /**
- * setApproveButtonToolTipText
- * @param text TODO
- */
- public void setApproveButtonToolTipText(String text) {
- // TODO
- } // setApproveButtonToolTipText()
-
- /**
- * getApproveButtonToolTipText
- * @returns String
- */
- public String getApproveButtonToolTipText() {
- return null; // TODO
- } // getApproveButtonToolTipText()
-
- /**
- * getApproveButtonMnemonic
- * @returns int
- */
- public int getApproveButtonMnemonic() {
- return 0; // TODO
- } // getApproveButtonMnemonic()
-
- /**
- * setApproveButtonMnemonic
- * @param mnemonic TODO
- */
- public void setApproveButtonMnemonic(int mnemonic) {
- // TODO
- } // setApproveButtonMnemonic()
-
- /**
- * setApproveButtonMnemonic
- * @param mnemonic TODO
- */
- public void setApproveButtonMnemonic(char mnemonic) {
- // TODO
- } // setApproveButtonMnemonic()
-
- /**
- * setApproveButtonText
- * @param text TODO
- */
- public void setApproveButtonText(String text) {
- // TODO
- } // setApproveButtonText()
-
- /**
- * getApproveButtonText
- * @returns String
- */
- public String getApproveButtonText() {
- return null; // TODO
- } // getApproveButtonText()
-
- /**
- * getChoosableFileFilters
- * @returns FileFilter[]
- */
- public FileFilter[] getChoosableFileFilters() {
- return null; // TODO
- } // getChoosableFileFilters()
-
- /**
- * addChoosableFileFilter
- * @param filter TODO
- */
- public void addChoosableFileFilter(FileFilter filter) {
- // TODO
- } // addChoosableFileFilter()
-
- /**
- * removeChoosableFileFilter
- * @param filter TODO
- * @returns boolean
- */
- public boolean removeChoosableFileFilter(FileFilter filter) {
- return false; // TODO
- } // removeChoosableFileFilter()
-
- /**
- * resetChoosableFileFilters
- */
- public void resetChoosableFileFilters() {
- // TODO
- } // resetChoosableFileFilters()
-
- /**
- * getAcceptAllFileFilter
- * @returns FileFilter
- */
- public FileFilter getAcceptAllFileFilter() {
- return null; // TODO
- } // getAcceptAllFileFilter()
-
- /**
- * isAcceptAllFileFilterUsed
- * @returns boolean
- */
- public boolean isAcceptAllFileFilterUsed() {
- return false; // TODO
- } // isAcceptAllFileFilterUsed()
-
- /**
- * setAcceptAllFileFilterUsed
- * @param value TODO
- */
- public void setAcceptAllFileFilterUsed(boolean value) {
- // TODO
- } // setAcceptAllFileFilterUsed()
-
- /**
- * getAccessory
- * @returns JComponent
- */
- public JComponent getAccessory() {
- return null; // TODO
- } // getAccessory()
-
- /**
- * setAccessory
- * @param accessory TODO
- */
- public void setAccessory(JComponent accessory) {
- // TODO
- } // setAccessory()
-
- /**
- * setFileSelectionMode
- * @param mode TODO
- */
- public void setFileSelectionMode(int mode) {
- // TODO
- } // setFileSelectionMode()
-
- /**
- * getFileSelectionMode
- * @returns int
- */
- public int getFileSelectionMode() {
- return 0; // TODO
- } // getFileSelectionMode()
-
- /**
- * isFileSelectionEnabled
- * @returns boolean
- */
- public boolean isFileSelectionEnabled() {
- return false; // TODO
- } // isFileSelectionEnabled()
-
- /**
- * isDirectorySelectionEnabled
- * @returns boolean
- */
- public boolean isDirectorySelectionEnabled() {
- return false; // TODO
- } // isDirectorySelectionEnabled()
-
- /**
- * isMultiSelectionEnabled
- * @returns boolean
- */
- public boolean isMultiSelectionEnabled() {
- return false; // TODO
- } // isMultiSelectionEnabled()
-
- /**
- * setMultiSelectionEnabled
- * @param enabled TODO
- */
- public void setMultiSelectionEnabled(boolean enabled) {
- // TODO
- } // setMultiSelectionEnabled()
-
- /**
- * isFileHidingEnabled
- * @returns boolean
- */
- public boolean isFileHidingEnabled() {
- return false; // TODO
- } // isFileHidingEnabled()
-
- /**
- * setFileHidingEnabled
- * @param enabled TODO
- */
- public void setFileHidingEnabled(boolean enabled) {
- // TODO
- } // setFileHidingEnabled()
-
- /**
- * getFileFilter
- * @returns FileFilter
- */
- public FileFilter getFileFilter() {
- return null; // TODO
- } // getFileFilter()
-
- /**
- * setFileFilter
- * @param filter TODO
- */
- public void setFileFilter(FileFilter filter) {
- // TODO
- } // setFileFilter()
-
- /**
- * getFileView
- * @returns FileView
- */
- public FileView getFileView() {
- return null; // TODO
- } // getFileView()
-
- /**
- * setFileView
- * @param view TODO
- */
- public void setFileView(FileView view) {
- // TODO
- } // setFileView()
-
- /**
- * getDescription
- * @param file TODO
- * @returns String
- */
- public String getDescription(File file) {
- return null; // TODO
- } // getDescription()
-
- /**
- * getTypeDescription
- * @param file TODO
- * @returns String
- */
- public String getTypeDescription(File file) {
- return null; // TODO
- } // getTypeDescription()
-
- /**
- * getIcon
- * @param file TODO
- * @returns Icon
- */
- public Icon getIcon(File file) {
- return null; // TODO
- } // getIcon()
-
- /**
- * isTraversable
- * @param file TODO
- * @returns boolean
- */
- public boolean isTraversable(File file) {
- return false; // TODO
- } // isTraversable()
-
- /**
- * getFileSystemView
- * @returns FileSystemView
- */
- public FileSystemView getFileSystemView() {
- return null; // TODO
- } // getFileSystemView()
-
- /**
- * setFileSystemView
- * @param fsv TODO
- */
- public void setFileSystemView(FileSystemView fsv) {
- // TODO
- } // setFileSystemView()
-
- /**
- * approveSelection
- */
- public void approveSelection() {
- // TODO
- } // approveSelection()
-
- /**
- * cancelSelection
- */
- public void cancelSelection() {
- // TODO
- } // cancelSelection()
-
- /**
- * addActionListener
- * @param listener TODO
- */
- public void addActionListener(ActionListener listener)
- {
- listenerList.add (ActionListener.class, listener);
- }
-
- /**
- * removeActionListener
- * @param listener TODO
- */
- public void removeActionListener(ActionListener listener)
- {
- listenerList.remove (ActionListener.class, listener);
- }
-
- public ActionListener[] getActionListeners()
- {
- return (ActionListener[]) listenerList.getListeners (ActionListener.class);
- }
-
- /**
- * fireActionPerformed
- * @param command TODO
- */
- protected void fireActionPerformed(String command) {
- // TODO
- } // fireActionPerformed()
-
- /**
- * updateUI
- */
- public void updateUI() {
- setUI((FileChooserUI) UIManager.get(this));
- invalidate();
- } // updateUI()
-
- /**
- * getUIClassID
- * @returns String
- */
- public String getUIClassID() {
- return uiClassID;
- } // getUIClassID()
-
- /**
- * getUI
- * @returns FileChooserUI
- */
- public FileChooserUI getUI() {
- return (FileChooserUI) ui;
- } // getUI()
-
- /**
- * paramString
- * @returns String
- */
- protected String paramString() {
- return null; // TODO
- } // paramString()
-
- /**
- * getAccessibleContext
- * @returns AccessibleContext
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJFileChooser();
-
- return accessibleContext;
- }
-}
diff --git a/libjava/javax/swing/JFormattedTextField.java b/libjava/javax/swing/JFormattedTextField.java
deleted file mode 100644
index cfa2733d870..00000000000
--- a/libjava/javax/swing/JFormattedTextField.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/* JFormattedTextField.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.event.FocusEvent;
-import java.io.Serializable;
-import java.text.Format;
-import java.text.ParseException;
-
-import javax.swing.text.Document;
-import javax.swing.text.DocumentFilter;
-import javax.swing.text.NavigationFilter;
-
-/**
- * @author Michael Koch
- * @since 1.4
- */
-public class JFormattedTextField extends JTextField
-{
- private static final long serialVersionUID = 5464657870110180632L;
-
- public abstract static class AbstractFormatter implements Serializable
- {
- private static final long serialVersionUID = -5193212041738979680L;
-
- private JFormattedTextField textField;
-
- public AbstractFormatter ()
- {
- //Do nothing here.
- }
-
- protected Object clone ()
- throws CloneNotSupportedException
- {
- throw new InternalError ("not implemented");
- }
-
- protected Action[] getActions ()
- {
- return textField.getActions();
- }
-
- protected DocumentFilter getDocumentFilter ()
- {
- throw new InternalError ("not implemented");
- }
-
- protected JFormattedTextField getFormattedTextField ()
- {
- return textField;
- }
-
- protected NavigationFilter getNavigationFilter ()
- {
- return textField.getNavigationFilter();
- }
-
- public void install(JFormattedTextField textField)
- {
- if (this.textField != null)
- uninstall();
-
- this.textField = textField;
- }
-
- public void uninstall ()
- {
- this.textField = null;
- }
-
- protected void invalidEdit ()
- {
- textField.invalidEdit();
- }
-
- protected void setEditValid (boolean valid)
- {
- textField.editValid = valid;
- }
-
- public abstract Object stringToValue (String text)
- throws ParseException;
-
- public abstract String valueToString (Object value)
- throws ParseException;
- }
-
- public abstract static class AbstractFormatterFactory
- {
- public AbstractFormatterFactory ()
- {
- // Do nothing here.
- }
-
- public abstract AbstractFormatter getFormatter (JFormattedTextField tf);
- }
-
- static class FormatterFactoryWrapper extends AbstractFormatterFactory
- {
- AbstractFormatter formatter;
-
- public FormatterFactoryWrapper(AbstractFormatter formatter)
- {
- this.formatter = formatter;
- }
-
- public AbstractFormatter getFormatter(JFormattedTextField tf)
- {
- return formatter;
- }
- }
-
- public static final int COMMIT = 0;
- public static final int COMMIT_OR_REVERT = 1;
- public static final int REVERT = 2;
- public static final int PERSIST = 3;
-
- private Object value;
- private int focusLostBehavior = COMMIT_OR_REVERT;
- private AbstractFormatterFactory formatterFactory;
- // Package-private to avoid an accessor method.
- boolean editValid = true;
-
- public JFormattedTextField ()
- {
- this((AbstractFormatterFactory) null, null);
- }
-
- public JFormattedTextField (Format format)
- {
- throw new InternalError ("not implemented");
- }
-
- public JFormattedTextField (AbstractFormatter formatter)
- {
- this(new FormatterFactoryWrapper(formatter), null);
- }
-
- public JFormattedTextField (AbstractFormatterFactory factory)
- {
- this(factory, null);
- }
-
- public JFormattedTextField (AbstractFormatterFactory factory, Object value)
- {
- this.formatterFactory = factory;
- this.value = value;
- }
-
- public JFormattedTextField (Object value)
- {
- this.value = value;
- }
-
- public void commitEdit ()
- throws ParseException
- {
- throw new InternalError ("not implemented");
- }
-
- public Action[] getActions ()
- {
- throw new InternalError ("not implemented");
- }
-
- public int getFocusLostBehavior()
- {
- return focusLostBehavior;
- }
-
- public AbstractFormatter getFormatter ()
- {
- if (formatterFactory == null)
- return null;
-
- return formatterFactory.getFormatter(this);
- }
-
- public AbstractFormatterFactory getFormatterFactory ()
- {
- return formatterFactory;
- }
-
- public String getUIClassID ()
- {
- return "FormattedTextFieldUI";
- }
-
- public Object getValue ()
- {
- return value;
- }
-
- protected void invalidEdit ()
- {
- UIManager.getLookAndFeel().provideErrorFeedback(this);
- }
-
- public boolean isEditValid ()
- {
- return editValid;
- }
-
- protected void processFocusEvent (FocusEvent evt)
- {
- throw new InternalError ("not implemented");
- }
-
- public void setDocument(Document newDocument)
- {
- Document oldDocument = getDocument();
-
- if (oldDocument == newDocument)
- return;
-
- super.setDocument(newDocument);
- }
-
- public void setFocusLostBehavior(int behavior)
- {
- if (behavior != COMMIT
- && behavior != COMMIT_OR_REVERT
- && behavior != PERSIST
- && behavior != REVERT)
- throw new IllegalArgumentException("invalid behavior");
-
- this.focusLostBehavior = behavior;
- }
-
- protected void setFormatter (AbstractFormatter formatter)
- {
- AbstractFormatter oldFormatter = null;
-
- if (formatterFactory != null)
- oldFormatter = formatterFactory.getFormatter(this);
-
- if (oldFormatter == formatter)
- return;
-
- setFormatterFactory(new FormatterFactoryWrapper(formatter));
- firePropertyChange("formatter", oldFormatter, formatter);
- }
-
- public void setFormatterFactory (AbstractFormatterFactory factory)
- {
- if (formatterFactory == factory)
- return;
-
- AbstractFormatterFactory oldFactory = formatterFactory;
- formatterFactory = factory;
- firePropertyChange("formatterFactory", oldFactory, factory);
- }
-
- public void setValue (Object newValue)
- {
- if (value == newValue)
- return;
-
- Object oldValue = value;
- value = newValue;
- firePropertyChange("value", oldValue, newValue);
- }
-}
diff --git a/libjava/javax/swing/JFrame.java b/libjava/javax/swing/JFrame.java
deleted file mode 100644
index db8edbf47b6..00000000000
--- a/libjava/javax/swing/JFrame.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/* JFrame.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.AWTEvent;
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Frame;
-import java.awt.Graphics;
-import java.awt.LayoutManager;
-import java.awt.event.KeyEvent;
-import java.awt.event.WindowEvent;
-
-import javax.accessibility.AccessibleContext;
-
-/**
- * Unlike JComponent derivatives, JFrame inherits from
- * java.awt.Frame. But also lets a look-and-feel component to its work.
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public class JFrame extends Frame
- implements WindowConstants, RootPaneContainer
-{
- private static final long serialVersionUID = -3362141868504252139L;
- private static boolean defaultLookAndFeelDecorated;
- private int close_action = HIDE_ON_CLOSE;
- protected AccessibleContext accessibleContext;
- protected JRootPane rootPane;
- protected boolean rootPaneCheckingEnabled;
-
- public JFrame()
- {
- super("JFrame");
- frameInit();
- }
-
- public JFrame(String title)
- {
- super(title);
- frameInit();
- }
-
- protected void frameInit()
- {
- super.setLayout(new BorderLayout(1, 1));
- enableEvents(AWTEvent.WINDOW_EVENT_MASK);
- getRootPane(); // will do set/create
- }
-
- public Dimension getPreferredSize()
- {
- return super.getPreferredSize();
- }
-
- public JMenuBar getJMenuBar()
- {
- return getRootPane().getJMenuBar();
- }
-
- public void setJMenuBar(JMenuBar menubar)
- {
- getRootPane().setJMenuBar(menubar);
- }
-
- public void setLayout(LayoutManager manager)
- {
- super.setLayout(manager);
- }
-
- public void setLayeredPane(JLayeredPane layeredPane)
- {
- getRootPane().setLayeredPane(layeredPane);
- }
-
- public JLayeredPane getLayeredPane()
- {
- return getRootPane().getLayeredPane();
- }
-
- public JRootPane getRootPane()
- {
- if (rootPane == null)
- setRootPane(createRootPane());
- return rootPane;
- }
-
- protected void setRootPane(JRootPane root)
- {
- if (rootPane != null)
- remove(rootPane);
-
- rootPane = root;
- add(rootPane, BorderLayout.CENTER);
- }
-
- protected JRootPane createRootPane()
- {
- return new JRootPane();
- }
-
- public Container getContentPane()
- {
- return getRootPane().getContentPane();
- }
-
- public void setContentPane(Container contentPane)
- {
- getRootPane().setContentPane(contentPane);
- }
-
- public Component getGlassPane()
- {
- return getRootPane().getGlassPane();
- }
-
- public void setGlassPane(Component glassPane)
- {
- getRootPane().setGlassPane(glassPane);
- }
-
- protected void addImpl(Component comp, Object constraints, int index)
- {
- super.addImpl(comp, constraints, index);
- }
-
- public void remove(Component comp)
- {
- getContentPane().remove(comp);
- }
-
- protected boolean isRootPaneCheckingEnabled()
- {
- return rootPaneCheckingEnabled;
- }
-
- protected void setRootPaneCheckingEnabled(boolean enabled)
- {
- rootPaneCheckingEnabled = enabled;
- }
-
- public void update(Graphics g)
- {
- paint(g);
- }
-
- protected void processKeyEvent(KeyEvent e)
- {
- super.processKeyEvent(e);
- }
-
- public static void setDefaultLookAndFeelDecorated(boolean decorated)
- {
- defaultLookAndFeelDecorated = decorated;
- }
-
- public static boolean isDefaultLookAndFeelDecorated()
- {
- return defaultLookAndFeelDecorated;
- }
-
- public AccessibleContext getAccessibleContext()
- {
- return accessibleContext;
- }
-
- public int getDefaultCloseOperation()
- {
- return close_action;
- }
-
- protected String paramString()
- {
- return "JFrame";
- }
-
- protected void processWindowEvent(WindowEvent e)
- {
- super.processWindowEvent(e);
- switch (e.getID())
- {
- case WindowEvent.WINDOW_CLOSING:
- {
- switch (close_action)
- {
- case EXIT_ON_CLOSE:
- {
- System.exit(0);
- break;
- }
- case DISPOSE_ON_CLOSE:
- {
- dispose();
- break;
- }
- case HIDE_ON_CLOSE:
- {
- setVisible(false);
- break;
- }
- case DO_NOTHING_ON_CLOSE:
- break;
- }
- break;
- }
- case WindowEvent.WINDOW_CLOSED:
- case WindowEvent.WINDOW_OPENED:
- case WindowEvent.WINDOW_ICONIFIED:
- case WindowEvent.WINDOW_DEICONIFIED:
- case WindowEvent.WINDOW_ACTIVATED:
- case WindowEvent.WINDOW_DEACTIVATED:
- break;
- }
- }
-
- /**
- * Defines what happens when this frame is closed. Can be one off
- * <code>EXIT_ON_CLOSE</code>,
- * <code>DISPOSE_ON_CLOSE</code>,
- * <code>HIDE_ON_CLOSE</code> or
- * <code>DO_NOTHING_ON_CLOSE</code>.
- * The default is <code>HIDE_ON_CLOSE</code>.
- * When <code>EXIT_ON_CLOSE</code> is specified this method calls
- * <code>SecurityManager.checkExit(0)</code> which might throw a
- * <code>SecurityException</code>. When the specified operation is
- * not one of the above a <code>IllegalArgumentException</code> is
- * thrown.
- */
- public void setDefaultCloseOperation(int operation)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null && operation == EXIT_ON_CLOSE)
- sm.checkExit(0);
-
- if (operation != EXIT_ON_CLOSE && operation != DISPOSE_ON_CLOSE
- && operation != HIDE_ON_CLOSE && operation != DO_NOTHING_ON_CLOSE)
- throw new IllegalArgumentException("operation = " + operation);
-
- close_action = operation;
- }
-}
diff --git a/libjava/javax/swing/JInternalFrame.java b/libjava/javax/swing/JInternalFrame.java
deleted file mode 100644
index 95cb08d735c..00000000000
--- a/libjava/javax/swing/JInternalFrame.java
+++ /dev/null
@@ -1,1716 +0,0 @@
-/* JInternalFrame.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Graphics;
-import java.awt.KeyboardFocusManager;
-import java.awt.LayoutManager;
-import java.awt.Rectangle;
-import java.beans.PropertyVetoException;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleValue;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.event.InternalFrameListener;
-import javax.swing.plaf.DesktopIconUI;
-import javax.swing.plaf.InternalFrameUI;
-
-/**
- * This class implements a Swing widget that looks and acts like a native
- * frame. The frame can be dragged, resized, closed, etc. Typically,
- * JInternalFrames are placed in JDesktopPanes. The actions that the
- * JInternalFrame performs (maximizing, minimizing, etc.) are performed by a
- * DesktopManager. As with regular frames, components are added by calling
- * frame.getContentPane().add.
- */
-public class JInternalFrame extends JComponent implements Accessible,
- WindowConstants,
- RootPaneContainer
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -5425177187760785402L;
-
- /**
- * DOCUMENT ME!
- */
- protected class AccessibleJInternalFrame extends AccessibleJComponent
- implements AccessibleValue
- {
- /**
- * Creates a new AccessibleJInternalFrame object.
- */
- protected AccessibleJInternalFrame()
- {
- super();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public String getAccessibleName()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleRole getAccessibleRole()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleValue getAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getCurrentAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getMaximumAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getMinimumAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param n DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public boolean setCurrentAccessibleValue(Number n)
- {
- return false;
- }
- }
-
- /**
- * This class represents the JInternalFrame while it is iconified.
- */
- public static class JDesktopIcon extends JComponent implements Accessible
- {
- /**
- * DOCUMENT ME!
- */
- protected class AccessibleJDesktopIcon extends AccessibleJComponent
- implements AccessibleValue
- {
- /**
- * Creates a new AccessibleJDesktopIcon object.
- */
- protected AccessibleJDesktopIcon()
- {
- super();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleRole getAccessibleRole()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleValue getAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getCurrentAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getMaximumAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getMinimumAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param n DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public boolean setCurrentAccessibleValue(Number n)
- {
- return false;
- }
- }
-
- /** The JInternalFrame this DesktopIcon represents. */
- JInternalFrame frame;
-
- /**
- * Creates a new JDesktopIcon object for representing the given frame.
- *
- * @param f The JInternalFrame to represent.
- */
- public JDesktopIcon(JInternalFrame f)
- {
- frame = f;
- updateUI();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJDesktopIcon();
- return accessibleContext;
- }
-
- /**
- * This method returns the JDesktopPane this JDesktopIcon is in.
- *
- * @return The JDesktopPane this JDesktopIcon is in.
- */
- public JDesktopPane getDesktopPane()
- {
- JDesktopPane p = (JDesktopPane) SwingUtilities.getAncestorOfClass(JDesktopPane.class,
- this);
- return p;
- }
-
- /**
- * This method returns the JInternalFrame this JDesktopIcon represents.
- *
- * @return The JInternalFrame this JDesktopIcon represents.
- */
- public JInternalFrame getInternalFrame()
- {
- return frame;
- }
-
- /**
- * This method returns the UI that is responsible for the JDesktopIcon.
- *
- * @return The UI that is responsible for the JDesktopIcon.
- */
- public DesktopIconUI getUI()
- {
- return (DesktopIconUI) ui;
- }
-
- /**
- * This method returns the String identifier that is used to determine
- * which class is used for JDesktopIcon's UI.
- *
- * @return A String identifier for the UI class.
- */
- public String getUIClassID()
- {
- return "DesktopIconUI";
- }
-
- /**
- * This method sets the JInternalFrame that this JDesktopIcon represents.
- *
- * @param f The JInternalFrame that this JDesktopIcon represents.
- */
- public void setInternalFrame(JInternalFrame f)
- {
- frame = f;
- }
-
- /**
- * This method sets the UI used for this JDesktopIcon.
- *
- * @param ui The UI to use.
- */
- public void setUI(DesktopIconUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method restores the UI property to the defaults.
- */
- public void updateUI()
- {
- setUI((DesktopIconUI) UIManager.getUI(this));
- }
- }
-
- /**
- * The property fired in a PropertyChangeEvent when the contentPane property
- * changes.
- */
- public static final String CONTENT_PANE_PROPERTY = "contentPane";
-
- /**
- * The property fired in a PropertyChangeEvent when the frameIcon property
- * changes.
- */
- public static final String FRAME_ICON_PROPERTY = "frameIcon";
-
- /**
- * The property fired in a PropertyChangeEvent when the glassPane property
- * changes.
- */
- public static final String GLASS_PANE_PROPERTY = "glassPane";
-
- /**
- * The property fired in a PropertyChangeEvent when the closed property
- * changes.
- */
- public static final String IS_CLOSED_PROPERTY = "closed";
-
- /**
- * The property fired in a PropertyChangeEvent when the icon property
- * changes.
- */
- public static final String IS_ICON_PROPERTY = "icon";
-
- /**
- * The property fired in a PropertyChangeEvent when the maximum property
- * changes.
- */
- public static final String IS_MAXIMUM_PROPERTY = "maximum";
-
- /**
- * The property fired in a PropertyChangeEvent when the selected property
- * changes.
- */
- public static final String IS_SELECTED_PROPERTY = "selected";
-
- /**
- * The property fired in a PropertyChangeEvent when the layeredPane property
- * changes.
- */
- public static final String LAYERED_PANE_PROPERTY = "layeredPane";
-
- /**
- * The property fired in a PropertyChangeEvent when the jMenuBar property
- * changes.
- */
- public static final String MENU_BAR_PROPERTY = "JMenuBar";
-
- /**
- * The property fired in a PropertyChangeEvent when the rootPane property
- * changes.
- */
- public static final String ROOT_PANE_PROPERTY = "rootPane";
-
- /**
- * The property fired in a PropertyChangeEvent when the title property
- * changes.
- */
- public static final String TITLE_PROPERTY = "title";
-
- /** Whether the JInternalFrame is closable. */
- protected boolean closable;
-
- /** Whether the JInternalFrame can be iconified. */
- protected boolean iconable;
-
- /** Whether the JInternalFrame is closed. */
- protected boolean isClosed;
-
- /** Whether the JInternalFrame has been iconified. */
- protected boolean isIcon;
-
- /** Whether the JInternalFrame has been maximized. */
- protected boolean isMaximum;
-
- /** Whether the JInternalFrame is the active frame. */
- protected boolean isSelected;
-
- /** Whether the JInternalFrame can be maximized. */
- protected boolean maximizable;
-
- /** Whether the JInternalFrame has rootPaneChecking enabled. */
- protected boolean rootPaneCheckingEnabled = true;
-
- /** Whether the JInternalFrame is resizable. */
- protected boolean resizable;
-
- /**
- * The JDesktopIcon that represents the JInternalFrame while it is
- * iconified.
- */
- protected JDesktopIcon desktopIcon;
-
- /** The icon used in the JMenuBar in the TitlePane. */
- protected Icon frameIcon;
-
- /** The rootPane of the JInternalFrame. */
- protected JRootPane rootPane;
-
- /** The title on the TitlePane of the JInternalFrame. */
- protected String title;
-
- /** The bounds of the JInternalFrame before it was maximized. */
- private transient Rectangle storedBounds;
-
- /** The Component that receives focus by default. */
- private transient Component defaultFocus;
-
- /** The default close action taken, */
- private transient int defaultCloseOperation = DISPOSE_ON_CLOSE;
-
- /** Whether the JInternalFrame has become visible for the very first time. */
- private transient boolean isFirstTimeVisible = true;
-
- /**
- * Whether the JInternalFrame is in the transition from being a maximized
- * frame back to a regular sized frame.
- */
- private transient boolean maxTransition = false;
-
- /** DOCUMENT ME! */
- private transient boolean wasIcon = false;
-
- /**
- * Creates a new JInternalFrame object that has no title, and is
- * non-resizable, non-maximizable, non-iconifiable, and non-closable.
- */
- public JInternalFrame()
- {
- this(null, false, false, false, false);
- }
-
- /**
- * Creates a new JInternalFrame object with the given title and is
- * non-resizable, non-maximizable, non-iconifiable, and non-closable.
- *
- * @param title The title displayed in the JInternalFrame.
- */
- public JInternalFrame(String title)
- {
- this(title, false, false, false, false);
- }
-
- /**
- * Creates a new JInternalFrame object with the given title and resizable
- * properties. The JInternalFrame is non-maximizable, non-iconifiable, and
- * non-closable.
- *
- * @param title The title displayed in the JInternalFrame.
- * @param resizable Whether the JInternalFrame is resizable.
- */
- public JInternalFrame(String title, boolean resizable)
- {
- this(title, resizable, false, false, false);
- }
-
- /**
- * Creates a new JInternalFrame object with the given title, resizable, and
- * closable properties. The JInternalFrame is non-maximizable and
- * non-iconifiable.
- *
- * @param title The title displayed in the JInternalFrame.
- * @param resizable Whether the JInternalFrame is resizable.
- * @param closable Whether the JInternalFrame is closable.
- */
- public JInternalFrame(String title, boolean resizable, boolean closable)
- {
- this(title, resizable, closable, false, false);
- }
-
- /**
- * Creates a new JInternalFrame object with the given title, resizable,
- * closable and maximizable properties. The JInternalFrame is
- * non-iconifiable.
- *
- * @param title The title displayed in the JInternalFrame.
- * @param resizable Whether the JInternalFrame is resizable.
- * @param closable Whether the JInternalFrame is closable.
- * @param maximizable Whether the JInternalFrame is maximizable.
- */
- public JInternalFrame(String title, boolean resizable, boolean closable,
- boolean maximizable)
- {
- this(title, resizable, closable, maximizable, false);
- }
-
- /**
- * Creates a new JInternalFrame object with the given title, resizable,
- * closable, maximizable and iconifiable properties.
- *
- * @param title The title displayed in the JInternalFrame.
- * @param resizable Whether the JInternalFrame is resizable.
- * @param closable Whether the JInternalFrame is closable.
- * @param maximizable Whether the JInternalFrame is maximizable.
- * @param iconifiable Whether the JInternalFrame is iconifiable.
- */
- public JInternalFrame(String title, boolean resizable, boolean closable,
- boolean maximizable, boolean iconifiable)
- {
- this.title = title;
- this.resizable = resizable;
- this.closable = closable;
- this.maximizable = maximizable;
- this.iconable = iconifiable;
- storedBounds = new Rectangle();
-
- setRootPaneCheckingEnabled(false);
- setRootPane(createRootPane());
-
- updateUI();
- setRootPaneCheckingEnabled(true);
- }
-
- /**
- * This method adds Components to this Container. For JInternalFrames,
- * instead of calling add directly on the JInternalFrame, it should be
- * called with JInternalFrame.getContentPane().add. If root pane checking
- * is enabled, calling this method will cause an exception to be thrown.
- *
- * @param comp The Component to add.
- * @param constraints The constraints on the Component added.
- * @param index The position to place the Component.
- *
- * @throws Error DOCUMENT ME!
- */
- protected void addImpl(Component comp, Object constraints, int index)
- {
- if (isRootPaneCheckingEnabled())
- throw new Error("Do not use add() on JInternalPane directly. Use getContentPane().add() instead");
-
- super.addImpl(comp, constraints, index);
- }
-
- /**
- * This method adds an InternalFrameListener to this JInternalFrame.
- *
- * @param l The listener to add.
- */
- public void addInternalFrameListener(InternalFrameListener l)
- {
- listenerList.add(InternalFrameListener.class, l);
- }
-
- /**
- * This method is used to create a root pane for the JInternalFrame. This
- * method is called by the constructors.
- *
- * @return A root pane for the JInternalFrame to use.
- */
- protected JRootPane createRootPane()
- {
- return new JRootPane();
- }
-
- /**
- * This method makes this JInternalFrame invisible, unselected and closed.
- * If this JInternalFrame is not closed already, it will fire an
- * INTERNAL_FRAME_CLoSED event. This method is similar to setClosed but it
- * doesn't give vetoable listeners a chance to veto and it will not fire an
- * INTERNAL_FRAME_CLOSING event.
- */
- public void dispose()
- {
- hide();
- JDesktopPane pane = getDesktopPane();
- if (pane != null)
- pane.setSelectedFrame(null);
- else
- {
- try
- {
- setSelected(false);
- }
- catch (PropertyVetoException e)
- {
- // Do nothing if they don't want to be unselected.
- }
- }
- isClosed = true;
- fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSED);
- removeNotify();
- }
-
- /**
- * This method is used for closing this JInternalFrame. It fires an
- * INTERNAL_FRAME_CLOSING event and then performs the action specified by
- * the default close operation.
- */
- public void doDefaultCloseAction()
- {
- fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSING);
- switch (getDefaultCloseOperation())
- {
- case HIDE_ON_CLOSE:
- hide();
- break;
- case DISPOSE_ON_CLOSE:
- dispose();
- break;
- }
- }
-
- /**
- * This method fires an InternalFrameEvent to the listeners.
- *
- * @param id The type of event being fired. See InternalFrameEvent.
- */
- protected void fireInternalFrameEvent(int id)
- {
- Object[] ifListeners = listenerList.getListenerList();
- InternalFrameEvent evt = new InternalFrameEvent(this, id);
- switch (id)
- {
- case InternalFrameEvent.INTERNAL_FRAME_CLOSING:
- for (int i = ifListeners.length - 2; i >= 0; i -= 2)
- {
- if (ifListeners[i] == InternalFrameListener.class)
- ((InternalFrameListener) ifListeners[i + 1])
- .internalFrameClosing(evt);
- }
- break;
- case InternalFrameEvent.INTERNAL_FRAME_ACTIVATED:
- for (int i = ifListeners.length - 2; i >= 0; i -= 2)
- {
- if (ifListeners[i] == InternalFrameListener.class)
- ((InternalFrameListener) ifListeners[i + 1])
- .internalFrameActivated(evt);
- }
- break;
- case InternalFrameEvent.INTERNAL_FRAME_CLOSED:
- for (int i = ifListeners.length - 2; i >= 0; i -= 2)
- {
- if (ifListeners[i] == InternalFrameListener.class)
- ((InternalFrameListener) ifListeners[i + 1]).internalFrameClosed(evt);
- }
- break;
- case InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED:
- for (int i = ifListeners.length - 2; i >= 0; i -= 2)
- {
- if (ifListeners[i] == InternalFrameListener.class)
- ((InternalFrameListener) ifListeners[i + 1])
- .internalFrameDeactivated(evt);
- }
- break;
- case InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED:
- for (int i = ifListeners.length - 2; i >= 0; i -= 2)
- {
- if (ifListeners[i] == InternalFrameListener.class)
- ((InternalFrameListener) ifListeners[i + 1])
- .internalFrameDeiconified(evt);
- }
- break;
- case InternalFrameEvent.INTERNAL_FRAME_ICONIFIED:
- for (int i = ifListeners.length - 2; i >= 0; i -= 2)
- {
- if (ifListeners[i] == InternalFrameListener.class)
- ((InternalFrameListener) ifListeners[i + 1])
- .internalFrameIconified(evt);
- }
- break;
- case InternalFrameEvent.INTERNAL_FRAME_OPENED:
- for (int i = ifListeners.length - 2; i >= 0; i -= 2)
- {
- if (ifListeners[i] == InternalFrameListener.class)
- ((InternalFrameListener) ifListeners[i + 1]).internalFrameOpened(evt);
- }
- break;
- }
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJInternalFrame();
- return accessibleContext;
- }
-
- /**
- * This method returns the Content Pane for this JInternalFrame.
- *
- * @return The Content Pane for this JInternalFrame.
- */
- public Container getContentPane()
- {
- return getRootPane().getContentPane();
- }
-
- /**
- * This method returns the default action taken when this JInternalFrame is
- * closed.
- *
- * @return The default action taken when this JInternalFrame is closed.
- */
- public int getDefaultCloseOperation()
- {
- return defaultCloseOperation;
- }
-
- /**
- * This method returns the JDesktopIcon that represents this JInternalFrame
- * while it is iconified.
- *
- * @return The JDesktopIcon that represents this JInternalFrame while it is
- * iconified.
- */
- public JDesktopIcon getDesktopIcon()
- {
- if (desktopIcon == null)
- desktopIcon = new JDesktopIcon(this);
- return desktopIcon;
- }
-
- /**
- * This method searches this JInternalFrame ancestors for an instance of
- * JDesktopPane. If one is found, it is returned. If none is found, then it
- * will search the JDesktopIcon for a JDesktopPane.
- *
- * @return The JDesktopPane that this JInternalFrame belongs to.
- */
- public JDesktopPane getDesktopPane()
- {
- JDesktopPane value = (JDesktopPane) SwingUtilities.getAncestorOfClass(JDesktopPane.class,
- this);
- if (value == null && desktopIcon != null)
- value = desktopIcon.getDesktopPane();
- return value;
- }
-
- /**
- * This method returns null because this must always be the root of a focus
- * traversal.
- *
- * @return always null
- *
- * @since 1.4
- */
- public final Container getFocusCycleRootAncestor()
- {
- // as defined.
- return null;
- }
-
- /**
- * This method returns the child Component that will receive focus if this
- * JInternalFrame is selected.
- *
- * @return The child Component that will receive focus.
- */
- public Component getFocusOwner()
- {
- if (isSelected())
- {
- Component focus = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
- if (SwingUtilities.isDescendingFrom(focus, this))
- {
- defaultFocus = focus;
- return focus;
- }
- }
- return null;
- }
-
- /**
- * This method returns the Frame Icon (the icon used in the JInternalFrame
- * TitlePane and iconified frame).
- *
- * @return The Frame Icon.
- */
- public Icon getFrameIcon()
- {
- return frameIcon;
- }
-
- /**
- * This method returns the Glass Pane used with this JInternalFrame.
- *
- * @return The Glass Pane used with this JInternalFrame.
- */
- public Component getGlassPane()
- {
- return getRootPane().getGlassPane();
- }
-
- /**
- * This method returns an array of InternalFrameListeners that are listening
- * to this JInternalFrame.
- *
- * @return An array of InternalFrameListeners that are listening to this
- * JInternalFrame.
- */
- public InternalFrameListener[] getInternalFrameListeners()
- {
- return (InternalFrameListener[]) listenerList.getListeners(InternalFrameListener.class);
- }
-
- /**
- * This method returns the JMenuBar for this JInternalFrame.
- *
- * @return The JMenuBar for this JInternalFrame.
- */
- public JMenuBar getJMenuBar()
- {
- return getRootPane().getJMenuBar();
- }
-
- /**
- * This method returns the layer that this JInternalFrame resides in.
- *
- * @return The layer that this JInternalFrame resides in.
- */
- public int getLayer()
- {
- JDesktopPane pane = getDesktopPane();
- if (pane != null)
- return pane.getLayer(this);
- return -1;
- }
-
- /**
- * This method returns the LayeredPane for this JInternalFrame.
- *
- * @return The LayeredPane for this JInternalFrame.
- */
- public JLayeredPane getLayeredPane()
- {
- return getRootPane().getLayeredPane();
- }
-
- /**
- * This method is deprecated. This method returns the JMenuBar for this
- * JInternalFrame.
- *
- * @return The JMenuBar for this JInternalFrame.
- *
- * @deprecated 1.0.3
- */
- public JMenuBar getMenuBar()
- {
- return getJMenuBar();
- }
-
- /**
- * This method returns the child Component that will receive focus when the
- * JInternalFrame is selected. If the JInternalFrame is selected, this
- * method returns getFocusOwner(). Otherwise, it will return the child
- * Component that most recently requested focus. If that is null, then the
- * initial focus Component is returned. If that is null, then the default
- * focus component is returned.
- *
- * @return The most recent focus owner.
- */
- public Component getMostRecentFocusOwner()
- {
- if (isSelected())
- return getFocusOwner();
- else
- return defaultFocus;
- }
-
- /**
- * This method returns the bounds of the JInternalFrame if it is not
- * maximized. If it is maximized, it returns the bounds of the
- * JInternalFrame before it was maximized (the bounds that it will be
- * restored to).
- *
- * @return A Rectangle that contains this JInternalFrame's normal bounds (or
- * just its bounds if it is not maximized).
- */
- public Rectangle getNormalBounds()
- {
- if (! isMaximum() && ! maxTransition)
- return getBounds();
- else
- return storedBounds;
- }
-
- /**
- * This method returns the Root Pane for this JInternalFrame.
- *
- * @return The Root Pane for this JInternalFrame.
- */
- public JRootPane getRootPane()
- {
- return rootPane;
- }
-
- /**
- * This method sets the title of the JInternalFrame.
- *
- * @return The String displayed in the TitlePane of this JInternalFrame.
- */
- public String getTitle()
- {
- return title;
- }
-
- /**
- * This method returns the UI used to represent the JInternalFrame.
- *
- * @return The UI used to represent the JInternalFrame.
- */
- public InternalFrameUI getUI()
- {
- return (InternalFrameUI) ui;
- }
-
- /**
- * This method returns a String identifier that is used to determine which
- * class acts as the JInternalFrame's UI.
- *
- * @return A String identifier to determine a UI class.
- */
- public String getUIClassID()
- {
- return "InternalFrameUI";
- }
-
- /**
- * This method returns null.
- *
- * @return null.
- */
- public final String getWarningString()
- {
- // as defined.
- return null;
- }
-
- /**
- * This method deselects this JInternalFrame and hides it.
- */
- public void hide()
- {
- JDesktopPane pane = getDesktopPane();
- if (pane != null)
- pane.setSelectedFrame(null);
- else
- {
- try
- {
- setSelected(false);
- }
- catch (PropertyVetoException e)
- {
- // Do nothing.
- }
- }
- super.hide();
- }
-
- /**
- * This method returns whether this JInternalFrame is closable.
- *
- * @return Whether this JInternalFrame is closable.
- */
- public boolean isClosable()
- {
- return closable;
- }
-
- /**
- * This method returns whether this JInternalFrame has been closed.
- *
- * @return Whether this JInternalFrame is closed.
- */
- public boolean isClosed()
- {
- return isClosed;
- }
-
- /**
- * This must always return true.
- *
- * @return always true
- *
- * @since 1.4
- */
- public final boolean isFocusCycleRoot()
- {
- return true;
- }
-
- /**
- * This method returns whether this JInternalFrame is currently iconified.
- *
- * @return Whether this JInternalFrame is currently iconified.
- */
- public boolean isIcon()
- {
- return isIcon;
- }
-
- /**
- * This method returns whether the JInternalFrame can be iconified.
- *
- * @return Whether the JInternalFrame can be iconified.
- */
- public boolean isIconifiable()
- {
- return iconable;
- }
-
- /**
- * This method returns whether this JInternalFrame can be maximized.
- *
- * @return Whether this JInternalFrame can be maximized.
- */
- public boolean isMaximizable()
- {
- return maximizable;
- }
-
- /**
- * This method returns whether this JInternalFrame is currently maximized.
- *
- * @return Whether this JInternalFrame is maximized.
- */
- public boolean isMaximum()
- {
- return isMaximum;
- }
-
- /**
- * This method returns whether this JInternalFrame is resizable.
- *
- * @return Whether this JInternalFrame is resizable.
- */
- public boolean isResizable()
- {
- return resizable;
- }
-
- /**
- * This method returns whether root pane checking is enabled. If root pane
- * checking is enabled, then calls to addImpl and setLayout will throw
- * exceptions.
- *
- * @return Whether root pane checking is enabled.
- */
- protected boolean isRootPaneCheckingEnabled()
- {
- return rootPaneCheckingEnabled;
- }
-
- /**
- * This method returns whether this JInternalFrame is selected.
- *
- * @return Whether this JInternalFrame is selected.
- */
- public boolean isSelected()
- {
- return isSelected;
- }
-
- /**
- * A helper method that moves this JInternalFrame to the back if the parent
- * is a JLayeredPane.
- */
- public void moveToBack()
- {
- if (getParent() instanceof JLayeredPane)
- ((JLayeredPane) getParent()).moveToBack(this);
- }
-
- /**
- * A helper method that moves this JInternalFrame to the front if the parent
- * is a JLayeredPane.
- */
- public void moveToFront()
- {
- if (getParent() instanceof JLayeredPane)
- ((JLayeredPane) getParent()).moveToFront(this);
- }
-
- /**
- * This method causes the children of this JInternalFrame to be laid out.
- * Before it begins, if this JInternalFrame is an icon, then it will be
- * deiconified. If it is maximized, then it will be restored. If either
- * operation fails, then this method will return.
- */
- public void pack()
- {
- try
- {
- if (isIcon())
- setIcon(false);
- else if (isMaximum())
- setMaximum(false);
- }
- catch (PropertyVetoException e)
- {
- // Do nothing if they don't want to be restored first.
- }
- doLayout();
- }
-
- /**
- * This method is overridden to allow for speedier painting while this
- * JInternalFramme is being dragged.
- *
- * @param g The Graphics object to paint with.
- */
- protected void paintComponent(Graphics g)
- {
- super.paintComponent(g);
- }
-
- /**
- * This method returns a String describing this JInternalFrame.
- *
- * @return A String describing this JInternalFrame.
- */
- protected String paramString()
- {
- return "JInternalFrame";
- }
-
- /**
- * This method removes the given Component from the Container.
- *
- * @param comp The Component to remove.
- */
- public void remove(Component comp)
- {
- super.remove(comp);
- }
-
- /**
- * This method removes an InternalFrameListener from this JInternalFrame.
- *
- * @param l The listener to remove.
- */
- public void removeInternalFrameListener(InternalFrameListener l)
- {
- listenerList.remove(InternalFrameListener.class, l);
- }
-
- /**
- * This method resizes and positions this JInternalFrame. It also forces a
- * relayout of the Container.
- *
- * @param x The x position of this JInternalFrame.
- * @param y The y position of this JInternalFrame.
- * @param width The width of this JInternalFrame.
- * @param height The height of this JInternalFrame.
- */
- public void reshape(int x, int y, int width, int height)
- {
- super.reshape(x, y, width, height);
- invalidate();
- doLayout();
- }
-
- /**
- * This method gives focus to the last child Component that had focus. This
- * is used by the UI when this JInternalFrame is activated.
- */
- public void restoreSubcomponentFocus()
- {
- Component c = getMostRecentFocusOwner();
- if (c != null)
- c.requestFocus();
- }
-
- /**
- * This method sets whether this JInternalFrame can be closed.
- *
- * @param b Whether this JInternalFrame can be closed.
- */
- public void setClosable(boolean b)
- {
- closable = b;
- }
-
- /**
- * This method closes the JInternalFrame if the given boolean is true. If it
- * is false, then the result of this method is unspecified. If the
- * JInternalFrame is closed, this method does nothing. This method will
- * first fire an INTERNAL_FRAME_CLOSING event and give a chance for veto
- * listeners to cancel the close. If no listener vetoes the change, the
- * closed property is set to true and the JInternalFrame is hidden and
- * unselected. The method will finish by firing an INTERNAL_FRAME_CLOSED
- * event.
- *
- * @param b Whether the JInternalFrame will be closed.
- *
- * @throws PropertyVetoException If a VetoableChangeListener vetoes the change.
- */
- public void setClosed(boolean b) throws PropertyVetoException
- {
- if (b && ! isClosed())
- {
- fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSING);
- fireVetoableChange(IS_CLOSED_PROPERTY, false, true);
-
- isClosed = b;
-
- firePropertyChange(IS_CLOSED_PROPERTY, false, true);
- fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSED);
- }
- }
-
- /**
- * This method sets the Container to be used as a Content Pane for this
- * JInternalFrame.
- *
- * @param c The Container to use as a Content Pane.
- */
- public void setContentPane(Container c)
- {
- if (c != getContentPane())
- {
- Container old = getContentPane();
- getRootPane().setContentPane(c);
- firePropertyChange(CONTENT_PANE_PROPERTY, old, c);
- }
- }
-
- /**
- * This method sets the action taken when this JInternalFrame is closed.
- *
- * @param operation One of DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE or
- * DISPOSE_ON_CLOSE.
- *
- * @throws Error If the given operation is not one of the allowed modes.
- */
- public void setDefaultCloseOperation(int operation)
- {
- if (operation != DO_NOTHING_ON_CLOSE
- && operation != HIDE_ON_CLOSE
- && operation != DISPOSE_ON_CLOSE)
- throw new Error("Close operation must be one of DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE");
- defaultCloseOperation = operation;
- }
-
- /**
- * This method sets the JDesktopIcon that represents this JInternalFrame
- * while it is iconified.
- *
- * @param d The JDesktopIcon that represents this JInternalFrame while it is
- * iconified.
- */
- public void setDesktopIcon(JDesktopIcon d)
- {
- d.setInternalFrame(this);
- desktopIcon = d;
- }
-
- /**
- * This method does nothing because this must be the root of a focus
- * traversal cycle.
- *
- * @param focusCycleRoot Not used.
- */
- public final void setFocusCycleRoot(boolean focusCycleRoot)
- {
- // Do nothing
- }
-
- /**
- * This method sets the Icon to be used in two places. The first is icon
- * that is painted at the top left corner of the JInternalFrame when it is
- * not iconified (clicking on that icon will activate the TitlePane
- * JMenuBar). When the JInternalFrame is iconified, it will be the icon
- * displayed in the JDesktopIcon. If no icon is set, the JInternalFrame
- * will use a Look and Feel default.
- *
- * @param icon The Icon used in the TitlePane JMenuBar and iconified frames.
- */
- public void setFrameIcon(Icon icon)
- {
- if (icon != frameIcon)
- {
- Icon old = frameIcon;
- frameIcon = icon;
- firePropertyChange(FRAME_ICON_PROPERTY, old, frameIcon);
- }
- }
-
- /**
- * This method sets the Glass Pane used with this JInternalFrame.
- *
- * @param glass The Glass Pane to use with this JInternalFrame.
- */
- public void setGlassPane(Component glass)
- {
- if (glass != getGlassPane())
- {
- Component old = getGlassPane();
- getRootPane().setGlassPane(glass);
- firePropertyChange(GLASS_PANE_PROPERTY, old, glass);
- }
- }
-
- /**
- * This method iconifies or deiconifies this JInternalFrame given the
- * boolean argument. If the JInternalFrame becomes iconified, it will fire
- * an INTERNAL_FRAME_ICONIFIED event. If the JInternalFrame becomes
- * deiconified, it will fire anINTERNAL_FRAME_DEICONIFIED event.
- *
- * @param b Whether this JInternalFrame is to be iconified or deiconified.
- *
- * @throws PropertyVetoException DOCUMENT ME!
- */
- public void setIcon(boolean b) throws PropertyVetoException
- {
- if (b != isIcon())
- {
- fireVetoableChange(IS_ICON_PROPERTY, b, isIcon);
-
- isIcon = b;
-
- firePropertyChange(IS_ICON_PROPERTY, ! isIcon, isIcon);
- if (b)
- fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ICONIFIED);
- else
- fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED);
- }
- }
-
- /**
- * This method sets whether the JInternalFrame can be iconified. (This means
- * that the JInternalFrame can be turned into an icon if minimized).
- *
- * @param b Whether the JInternalFrame can be iconified.
- */
- public void setIconifiable(boolean b)
- {
- iconable = b;
- }
-
- /**
- * This method sets the JMenuBar to be used with this JInternalFrame.
- *
- * @param b The JMenuBar to be used with this JInternalFrame.
- */
- public void setJMenuBar(JMenuBar b)
- {
- getRootPane().setJMenuBar(b);
- }
-
- /**
- * A helper method that set the layer that this JInternalFrame resides in.
- * Using this version of the method means that the user should not set it
- * to values that are already defined in JLayeredPane. If predefined values
- * are to be used, the user should use the setLayer(Integer) version.
- *
- * @param layer The layer to place this JInternalFrame in.
- */
- public void setLayer(int layer)
- {
- setLayer(new Integer(layer));
- }
-
- /**
- * A helper method that sets the layer that this JInternalFrame resides in.
- * Calling this version of the method should use layer values that are
- * already defined in JLayeredPane.
- *
- * @param layer The layer to place this JInternalFrame in.
- */
- public void setLayer(Integer layer)
- {
- JDesktopPane p = getDesktopPane();
- if (p != null)
- {
- int pos = p.getPosition(this);
- p.setLayer(this, layer.intValue(), pos);
- }
- }
-
- /**
- * This method sets the JLayeredPane to use with this JInternalFrame.
- *
- * @param layered The JLayeredPane to use as a layeredPane.
- */
- public void setLayeredPane(JLayeredPane layered)
- {
- if (layered != getLayeredPane())
- {
- JLayeredPane old = getLayeredPane();
- getRootPane().setLayeredPane(layered);
- firePropertyChange(LAYERED_PANE_PROPERTY, old, layered);
- }
- }
-
- /**
- * This method sets whether the JInternalFrame can be maximized.
- *
- * @param b Whether this JInternalFrame can be maximized.
- */
- public void setMaximizable(boolean b)
- {
- maximizable = b;
- }
-
- /**
- * This method sets the Layout Manager used in the JInternalFrame. SetLayout
- * should not be called on the JInternalFrame directly. Instead, it should
- * be called with JInternalFrame.getContentPane().setLayout. Calls to this
- * method with root pane checking enabled will cause exceptions to be
- * thrown.
- *
- * @param manager The Layout Manager to be used with the JInternalFrame.
- *
- * @throws Error If rootPaneChecking is enabled.
- */
- public void setLayout(LayoutManager manager)
- {
- if (isRootPaneCheckingEnabled())
- throw new Error("Cannot set layout. Use getContentPane().setLayout() instead.");
- super.setLayout(manager);
- }
-
- /**
- * This method sets the JInternalFrame to maximized (if the given argument
- * is true) or restores the JInternalFrame to its normal bounds otherwise.
- *
- * @param b Whether this JInteralFrame will be maximized or restored.
- *
- * @throws PropertyVetoException If a VetoableChangeListener vetoes the change.
- */
- public void setMaximum(boolean b) throws PropertyVetoException
- {
- if (b != isMaximum())
- {
- fireVetoableChange(IS_MAXIMUM_PROPERTY, b, isMaximum);
- isMaximum = b;
- if (b)
- setNormalBounds(getBounds());
- maxTransition = ! b;
- firePropertyChange(IS_MAXIMUM_PROPERTY, ! isMaximum, isMaximum);
- maxTransition = false;
- }
- }
-
- /**
- * This method is deprecated. This method sets the JMenuBar used with this
- * JInternalFrame.
- *
- * @param m The JMenuBar to use with this JInternalFrame.
- *
- * @deprecated 1.0.3
- */
- public void setMenuBar(JMenuBar m)
- {
- setJMenuBar(m);
- }
-
- /**
- * This method sets the bounds that this JInternalFrame will be restored to.
- *
- * @param r The bounds that this JInternalFrame will be restored to.
- */
- public void setNormalBounds(Rectangle r)
- {
- storedBounds.setBounds(r.x, r.y, r.width, r.height);
- }
-
- /**
- * This method sets whether the JInternalFrame can be resized by a user
- * action (like dragging at the frame borders).
- *
- * @param b Whether this JInternalFramer can be resized.
- */
- public void setResizable(boolean b)
- {
- resizable = b;
- }
-
- /**
- * This method sets the Root Pane for this JInternalFrame.
- *
- * @param root The Root Pane for this JInternalFrame.
- */
- protected void setRootPane(JRootPane root)
- {
- if (rootPane != null)
- remove(rootPane);
-
- rootPane = root;
- add(root);
- }
-
- /**
- * This method sets whether root pane checking is enabled. If root pane
- * checking is enabled, then calls to addImpl and setLayout will throw
- * exceptions.
- *
- * @param enabled Whether root pane checking is enabled.
- */
- protected void setRootPaneCheckingEnabled(boolean enabled)
- {
- rootPaneCheckingEnabled = enabled;
- }
-
- /**
- * This method sets whether this JInternalFrame is the selected frame in the
- * JDesktopPane (or other container). When selected, a JInternalFrame will
- * have focus and paint its TitlePane differently (usually a different
- * colour). If this method selects the frame, this JInternalFrame will fire
- * an INTERNAL_FRAME_ACTIVATED event. If it deselects this frame, it will
- * fire an INTERNAL_FRAME_DEACTIVATED event.
- *
- * @param selected Whether this JInternalFrame will become selected or
- * deselected.
- *
- * @throws PropertyVetoException If a VetoableChangeListener vetoes the change.
- */
- public void setSelected(boolean selected) throws PropertyVetoException
- {
- if (selected != isSelected())
- {
- fireVetoableChange(IS_SELECTED_PROPERTY, selected, isSelected);
-
- if (! selected)
- defaultFocus = getMostRecentFocusOwner();
-
- isSelected = selected;
-
- if (selected)
- restoreSubcomponentFocus();
-
- firePropertyChange(IS_SELECTED_PROPERTY, ! isSelected, isSelected);
-
- if (isSelected)
- fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
- else
- fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED);
- }
- }
-
- /**
- * This method sets the title displayed in the TitlePane of this
- * JInternalFrame.
- *
- * @param title The title displayed.
- */
- public void setTitle(String title)
- {
- if (title == null && this.title == null)
- return;
- if (title == null || this.title == null || ! this.title.equals(title))
- {
- String old = title;
- this.title = title;
- firePropertyChange(TITLE_PROPERTY, old, this.title);
- }
- }
-
- /**
- * This method displays the JInternalFrame. If it is not visible, this
- * method will bring this JInternalFrame to the front, make it visible and
- * select it. If this is the first time this JInternalFrame is made
- * visible, an INTERNAL_FRAME_OPENED event will be fired.
- */
- public void show()
- {
- if (! isVisible())
- {
- moveToFront();
- super.show();
-
- JDesktopPane pane = getDesktopPane();
- if (pane != null)
- pane.setSelectedFrame(this);
- else
- {
- try
- {
- setSelected(true);
- }
- catch (PropertyVetoException e)
- {
- // Do nothing. if they don't want to be selected.
- }
- }
- if (isFirstTimeVisible)
- {
- isFirstTimeVisible = false;
- fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
- }
- }
- }
-
- /**
- * This method is used to set the UI responsible for the JInternalFrame.
- *
- * @param ui The UI responsible for the JInternalFrame.
- */
- public void setUI(InternalFrameUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method causes the JInternalFrame to be brough to back in the
- * z-order.
- */
- public void toBack()
- {
- moveToBack();
- }
-
- /**
- * This method causes the JInternalFrame to be brought to front in the
- * z-order.
- */
- public void toFront()
- {
- moveToFront();
- }
-
- /**
- * This method resets the UI to the Look and Feel defaults.
- */
- public void updateUI()
- {
- setUI((InternalFrameUI) UIManager.getUI(this));
- }
-
- /**
- * This helper method allows JInternalFrames to signal that they were
- * iconned for the first time.
- *
- * @param b Whether the JInternalFrame was iconned.
- * @param ID The identifier of the property change event to fire if the
- * JInternalFrame is iconned for the first time.
- */
- void setWasIcon(boolean b, String ID)
- {
- if (b && ! wasIcon)
- {
- wasIcon = b;
- firePropertyChange(ID, ! b, b);
- }
- }
-
- /**
- * This helper method returns whether the JInternalFrame has been iconned
- * once already.
- *
- * @return Whether the JInternalFrame has been iconned once already.
- */
- boolean getWasIcon()
- {
- return wasIcon;
- }
-
- /**
- * This method is a convenience method to fire vetoable property changes.
- *
- * @param name The identifier of the property change.
- * @param oldValue The old value.
- * @param newValue The new value.
- *
- * @throws PropertyVetoException Fired if a vetoable change listener vetoes
- * the change.
- */
- private void fireVetoableChange(String name, boolean oldValue,
- boolean newValue)
- throws PropertyVetoException
- {
- super.fireVetoableChange(name, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
- }
-}
diff --git a/libjava/javax/swing/JLabel.java b/libjava/javax/swing/JLabel.java
deleted file mode 100644
index 6dc4b1d3a7b..00000000000
--- a/libjava/javax/swing/JLabel.java
+++ /dev/null
@@ -1,647 +0,0 @@
-/* JLabel.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Font;
-import java.awt.Image;
-import java.awt.event.KeyEvent;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.swing.plaf.LabelUI;
-
-/**
- * A swing widget that displays a text message and/or an icon.
- */
-public class JLabel extends JComponent implements Accessible, SwingConstants
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 5496508283662221534L;
-
- /**
- * The Component the label will give focus to when its mnemonic is
- * activated.
- */
- protected Component labelFor;
-
- /** The label's text. */
- private transient String text;
-
- /** Where the label will be positioned horizontally. */
- private transient int horizontalAlignment = LEADING;
-
- /** Where the label text will be placed horizontally relative to the icon. */
- private transient int horizontalTextPosition = TRAILING;
-
- /** Where the label will be positioned vertically. */
- private transient int verticalAlignment = CENTER;
-
- /** Where the label text will be place vertically relative to the icon. */
- private transient int verticalTextPosition = CENTER;
-
- /** The icon painted when the label is enabled. */
- private transient Icon icon;
-
- /** The icon painted when the label is disabled. */
- private transient Icon disabledIcon;
-
- /** The label's mnemnonic key. */
- private transient int displayedMnemonic = KeyEvent.VK_UNDEFINED;
-
- /** The index of the menemonic character in the text. */
- private transient int displayedMnemonicIndex = -1;
-
- /** The gap between the icon and the text. */
- private transient int iconTextGap = 4;
-
- /**
- * Creates a new horizontally and vertically centered JLabel object with no
- * text and no icon.
- */
- public JLabel()
- {
- this(null, null, CENTER);
- }
-
- /**
- * Creates a new horizontally and vertically centered JLabel object with no
- * text and the given icon.
- *
- * @param image The icon to use with the label.
- */
- public JLabel(Icon image)
- {
- this(null, image, CENTER);
- }
-
- /**
- * Creates a new vertically centered JLabel object with no text and the
- * given icon and horizontal alignment. By default, the text is TRAILING
- * the image.
- *
- * @param image The icon to use with the label.
- * @param horizontalAlignment The horizontal alignment of the label.
- */
- public JLabel(Icon image, int horizontalAlignment)
- {
- this(null, image, horizontalAlignment);
- }
-
- /**
- * Creates a new horizontally and vertically centered JLabel object with no
- * icon and the given text.
- *
- * @param text The text to use with the label.
- */
- public JLabel(String text)
- {
- this(text, null, CENTER);
- }
-
- /**
- * Creates a new vertically centered JLabel object with no icon and the
- * given text and horizontal alignment.
- *
- * @param text The text to use with the label.
- * @param horizontalAlignment The horizontal alignment of the label.
- */
- public JLabel(String text, int horizontalAlignment)
- {
- this(text, null, horizontalAlignment);
- }
-
- /**
- * Creates a new vertically centered JLabel object with the given text,
- * icon, and horizontal alignment.
- *
- * @param text The text to use with the label.
- * @param icon The icon to use with the label.
- * @param horizontalAlignment The horizontal alignment of the label.
- */
- public JLabel(String text, Icon icon, int horizontalAlignment)
- {
- this.text = text;
- this.icon = icon;
- this.horizontalAlignment = horizontalAlignment;
- updateUI();
- }
-
- /**
- * This method returns the label's UI delegate.
- *
- * @return The label's UI delegate.
- */
- public LabelUI getUI()
- {
- return (LabelUI) ui;
- }
-
- /**
- * This method sets the label's UI delegate.
- *
- * @param ui The label's UI delegate.
- */
- public void setUI(LabelUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method resets the label's UI delegate to the default UI for the
- * current look and feel.
- */
- public void updateUI()
- {
- setUI((LabelUI) UIManager.getUI(this));
- }
-
- /**
- * This method returns a name to identify which look and feel class will be
- * the UI delegate for this label.
- *
- * @return The UIClass identifier. "LabelUI"
- */
- public String getUIClassID()
- {
- return "LabelUI";
- }
-
- /**
- * This method is used primarily for debugging purposes and returns a string
- * that can be used to represent this label.
- *
- * @return A string to represent this label.
- */
- protected String paramString()
- {
- return "JLabel";
- }
-
- /**
- * This method returns the label text.
- *
- * @return The label text.
- */
- public String getText()
- {
- return text;
- }
-
- /**
- * This method changes the "text" property. The given text will be painted
- * in the label.
- *
- * @param newText The label's text.
- */
- public void setText(String newText)
- {
- if (text != newText)
- {
- String oldText = text;
- text = newText;
- firePropertyChange("text", oldText, newText);
-
- if (text != null && text.length() <= displayedMnemonicIndex)
- setDisplayedMnemonicIndex(text.length() - 1);
- }
- }
-
- /**
- * This method returns the active icon. The active icon is painted when the
- * label is enabled.
- *
- * @return The active icon.
- */
- public Icon getIcon()
- {
- return icon;
- }
-
- /**
- * This method changes the "icon" property. This icon (the active icon) will
- * be the one displayed when the label is enabled.
- *
- * @param newIcon The active icon.
- */
- public void setIcon(Icon newIcon)
- {
- if (icon != newIcon)
- {
- Icon oldIcon = icon;
- icon = newIcon;
- firePropertyChange("icon", oldIcon, newIcon);
- }
- }
-
- /**
- * This method returns the disabled icon. The disabled icon is painted when
- * the label is disabled. If the disabled icon is null and the active icon
- * is an ImageIcon, this method returns a grayed version of the icon. The
- * grayed version of the icon becomes the disabledIcon.
- *
- * @return The disabled icon.
- */
- public Icon getDisabledIcon()
- {
- if (disabledIcon == null && icon instanceof ImageIcon)
- disabledIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon) icon)
- .getImage()));
-
- return disabledIcon;
- }
-
- /**
- * This method changes the "disabledIcon" property. This icon (the disabled
- * icon) will be the one displayed when the label is disabled.
- *
- * @param newIcon The disabled icon.
- */
- public void setDisabledIcon(Icon newIcon)
- {
- if (disabledIcon != newIcon)
- {
- Icon oldIcon = disabledIcon;
- disabledIcon = newIcon;
- firePropertyChange("disabledIcon", oldIcon, newIcon);
- }
- }
-
- /**
- * This method sets the keycode that will be the label's mnemonic. If the
- * label is used as a label for another component, the label will give
- * focus to that component when the mnemonic is activated.
- *
- * @param mnemonic The keycode to use for the mnemonic.
- */
- public void setDisplayedMnemonic(int mnemonic)
- {
- if (displayedMnemonic != mnemonic)
- {
- firePropertyChange("displayedMnemonic",
- displayedMnemonic, mnemonic);
- displayedMnemonic = mnemonic;
-
- if (text != null)
- setDisplayedMnemonicIndex(text.toUpperCase().indexOf(mnemonic));
- }
- }
-
- /**
- * This method sets the character that will be the mnemonic used. If the
- * label is used as a label for another component, the label will give
- * focus to that component when the mnemonic is activated.
- *
- * @param mnemonic The character to use for the mnemonic.
- */
- public void setDisplayedMnemonic(char mnemonic)
- {
- setDisplayedMnemonic((int) Character.toUpperCase(mnemonic));
- }
-
- /**
- * This method returns the keycode that is used for the label's mnemonic.
- *
- * @return The keycode that is used for the label's mnemonic.
- */
- public int getDisplayedMnemonic()
- {
- return (int) displayedMnemonic;
- }
-
- /**
- * This method sets which character in the text will be the underlined
- * character. If the given index is -1, then this indicates that there is
- * no mnemonic. If the index is less than -1 or if the index is equal to
- * the length, this method will throw an IllegalArgumentException.
- *
- * @param newIndex The index of the character to underline.
- *
- * @throws IllegalArgumentException If index less than -1 or index equals
- * length.
- */
- public void setDisplayedMnemonicIndex(int newIndex)
- throws IllegalArgumentException
- {
- if (newIndex < -1 || (text != null && newIndex >= text.length()))
- throw new IllegalArgumentException();
-
- if (newIndex == -1
- || text == null
- || text.charAt(newIndex) != displayedMnemonic)
- newIndex = -1;
-
- if (newIndex != displayedMnemonicIndex)
- {
- int oldIndex = displayedMnemonicIndex;
- displayedMnemonicIndex = newIndex;
- firePropertyChange("displayedMnemonicIndex",
- oldIndex, newIndex);
- }
- }
-
- /**
- * This method returns which character in the text will be the underlined
- * character.
- *
- * @return The index of the character that will be underlined.
- */
- public int getDisplayedMnemonicIndex()
- {
- return displayedMnemonicIndex;
- }
-
- /**
- * This method ensures that the key is valid as a horizontal alignment.
- * Valid keys are: LEFT, CENTER, RIGHT, LEADING, TRAILING
- *
- * @param key The key to check.
- * @param message The message of the exception to be thrown if the key is
- * invalid.
- *
- * @return The key if it's valid.
- *
- * @throws IllegalArgumentException If the key is invalid.
- */
- protected int checkHorizontalKey(int key, String message)
- {
- if (key != LEFT && key != CENTER && key != RIGHT && key != LEADING
- && key != TRAILING)
- throw new IllegalArgumentException(message);
- else
- return key;
- }
-
- /**
- * This method ensures that the key is valid as a vertical alignment. Valid
- * keys are: TOP, CENTER, and BOTTOM.
- *
- * @param key The key to check.
- * @param message The message of the exception to be thrown if the key is
- * invalid.
- *
- * @return The key if it's valid.
- *
- * @throws IllegalArgumentException If the key is invalid.
- */
- protected int checkVerticalKey(int key, String message)
- {
- if (key != TOP && key != BOTTOM && key != CENTER)
- throw new IllegalArgumentException(message);
- else
- return key;
- }
-
- /**
- * This method returns the gap between the icon and the text.
- *
- * @return The gap between the icon and the text.
- */
- public int getIconTextGap()
- {
- return iconTextGap;
- }
-
- /**
- * This method changes the "iconTextGap" property. The iconTextGap
- * determines how much space there is between the icon and the text.
- *
- * @param newGap The gap between the icon and the text.
- */
- public void setIconTextGap(int newGap)
- {
- if (iconTextGap != newGap)
- {
- firePropertyChange("iconTextGap", iconTextGap, newGap);
- iconTextGap = newGap;
- }
- }
-
- /**
- * This method returns the vertical alignment of the label.
- *
- * @return The vertical alignment of the label.
- */
- public int getVerticalAlignment()
- {
- return verticalAlignment;
- }
-
- /**
- * This method changes the "verticalAlignment" property of the label. The
- * vertical alignment determines how where the label will be placed
- * vertically. If the alignment is not valid, it will default to the
- * center.
- *
- * @param alignment The vertical alignment of the label.
- */
- public void setVerticalAlignment(int alignment)
- {
- if (alignment == verticalAlignment)
- return;
-
- int oldAlignment = verticalAlignment;
- verticalAlignment = checkVerticalKey(alignment, "verticalAlignment");
- firePropertyChange("verticalAlignment", oldAlignment, verticalAlignment);
- }
-
- /**
- * This method returns the horziontal alignment of the label.
- *
- * @return The horizontal alignment of the label.
- */
- public int getHorizontalAlignment()
- {
- return horizontalAlignment;
- }
-
- /**
- * This method changes the "horizontalAlignment" property. The horizontal
- * alignment determines where the label will be placed horizontally.
- *
- * @param alignment The horizontal alignment of the label.
- */
- public void setHorizontalAlignment(int alignment)
- {
- if (horizontalAlignment == alignment)
- return;
-
- int oldAlignment = horizontalAlignment;
- horizontalAlignment = checkHorizontalKey(alignment, "horizontalAlignment");
- firePropertyChange("horizontalAlignment", oldAlignment,
- horizontalAlignment);
- }
-
- /**
- * This method returns the vertical text position of the label.
- *
- * @return The vertical text position of the label.
- */
- public int getVerticalTextPosition()
- {
- return verticalTextPosition;
- }
-
- /**
- * This method changes the "verticalTextPosition" property of the label. The
- * vertical text position determines where the text will be placed
- * vertically relative to the icon.
- *
- * @param textPosition The vertical text position.
- */
- public void setVerticalTextPosition(int textPosition)
- {
- if (textPosition != verticalTextPosition)
- {
- int oldPos = verticalTextPosition;
- verticalTextPosition = checkVerticalKey(textPosition,
- "verticalTextPosition");
- firePropertyChange("verticalTextPosition", oldPos,
- verticalTextPosition);
- }
- }
-
- /**
- * This method returns the horizontal text position of the label.
- *
- * @return The horizontal text position.
- */
- public int getHorizontalTextPosition()
- {
- return horizontalTextPosition;
- }
-
- /**
- * This method changes the "horizontalTextPosition" property of the label.
- * The horizontal text position determines where the text will be placed
- * horizontally relative to the icon.
- *
- * @param textPosition The horizontal text position.
- */
- public void setHorizontalTextPosition(int textPosition)
- {
- if (textPosition != horizontalTextPosition)
- {
- int oldPos = horizontalTextPosition;
- horizontalTextPosition = checkHorizontalKey(textPosition,
- "horizontalTextPosition");
- firePropertyChange("horizontalTextPosition", oldPos,
- horizontalTextPosition);
- }
- }
-
- /**
- * This method simply returns false if the current icon image (current icon
- * will depend on whether the label is enabled) is not equal to the passed
- * in image.
- *
- * @param img The image to check.
- * @param infoflags The bitwise inclusive OR of ABORT, ALLBITS, ERROR,
- * FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, and WIDTH
- * @param x The x position
- * @param y The y position
- * @param w The width
- * @param h The height
- *
- * @return Whether the current icon image is equal to the image given.
- */
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int w,
- int h)
- {
- Icon currIcon = isEnabled() ? icon : disabledIcon;
-
- // XXX: Is this the correct way to check for image equality?
- if (currIcon != null && currIcon instanceof ImageIcon)
- return (((ImageIcon) currIcon).getImage() == img);
-
- return false;
- }
-
- /**
- * This method returns the component that the label gives focus to when the
- * mnemonic is activated.
- *
- * @return The component that gets focus when the label's mnemonic is
- * activated.
- */
- public Component getLabelFor()
- {
- return labelFor;
- }
-
- /**
- * This method changes the "labelFor" property. The component that the label
- * is acting as a label for will request focus when the label's mnemonic
- * is activated.
- *
- * @param c The component that gets focus when the label's mnemonic is
- * activated.
- */
- public void setLabelFor(Component c)
- {
- if (c != labelFor)
- {
- Component oldLabelFor = labelFor;
- labelFor = c;
- firePropertyChange("labelFor", oldLabelFor, labelFor);
- }
- }
-
- /**
- * This method overrides setFont so that we can call for a repaint after the
- * font is changed.
- *
- * @param f The font for this label.
- */
- public void setFont(Font f)
- {
- super.setFont(f);
- repaint();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return
- */
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-}
diff --git a/libjava/javax/swing/JLayeredPane.java b/libjava/javax/swing/JLayeredPane.java
deleted file mode 100644
index 7375cc2d21f..00000000000
--- a/libjava/javax/swing/JLayeredPane.java
+++ /dev/null
@@ -1,560 +0,0 @@
-/* JLayeredPane.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.accessibility.Accessible;
-
-/**
- * <p>The "Layered Pane" is a container which divides its children into 6 (or
- * more) disjoint sets. the pre-defined sets are:</p>
- *
- * <ul>
- * <li>"Frame Content"</li>
- * <li>"Default"</li>
- * <li>"Palette"</li>
- * <li>"Modal"</li>
- * <li>"Popup"</li>
- * <li>"Drag"</li>
- * </ul>
- *
- * <p>A child is in exactly one of these layers at any time, though there may
- * be other layers if someone creates them.</p>
- *
- * <p>The purpose of this class is to translate this view of "layers" into a
- * contiguous array of components: the one held in our ancestor,
- * {@link java.awt.Container}.</p>
- *
- * <p>There is a precise set of words we will use to refer to numbers within
- * this class:</p>
- *
- * <dl>
- * <dt>Component Index:</dt>
- * <dd>An offset into the <code>component</code> array held in our ancestor,
- * {@link java.awt.Container}, from <code>[0 .. component.length)</code>. The drawing
- * rule with indices is that 0 is drawn last.</dd>
- *
- * <dt>Layer Number:</dt>
- * <dd>A general <code>int</code> specifying a layer within this component. Negative
- * numbers are drawn first, then layer 0, then positive numbered layers, in
- * ascending order.</dd>
- *
- * <dt>Position:</dt>
- * <dd>An offset into a layer's "logical drawing order". Layer position 0
- * is drawn last. Layer position -1 is a synonym for the first layer
- * position (the logical "bottom").</dd>
- * </dl>
- *
- * <p><b>Note:</b> the layer numbering order is the <em>reverse</em> of the
- * component indexing and position order</p>
- *
- * @author Graydon Hoare (graydon@redhat.com)
- */
-public class JLayeredPane extends JComponent implements Accessible
-{
- private static final long serialVersionUID = 5534920399324590459L;
-
- public static final String LAYER_PROPERTY = "layeredContainerLayer";
-
- public static Integer FRAME_CONTENT_LAYER = new Integer (-30000);
-
- public static Integer DEFAULT_LAYER = new Integer (0);
- public static Integer PALETTE_LAYER = new Integer (100);
- public static Integer MODAL_LAYER = new Integer (200);
- public static Integer POPUP_LAYER = new Integer (300);
- public static Integer DRAG_LAYER = new Integer (400);
-
- TreeMap layers; // Layer Number (Integer) -> Layer Size (Integer)
- Hashtable componentToLayer; // Component -> Layer Number (Integer)
-
- public JLayeredPane()
- {
- layers = new TreeMap ();
- componentToLayer = new Hashtable ();
- }
-
-
- /**
- * Looks up the layer a child component is currently assigned to.
- *
- * @param c the component to look up.
- * @return the layer the component is currently assigned to, in this container.
- * @throws IllegalArgumentException if the component is not a child of this container.
- */
- public int getLayer(Component c)
- {
- if (! componentToLayer.containsKey (c))
- throw new IllegalArgumentException ();
- return ((Integer) componentToLayer.get(c)).intValue();
- }
-
- /**
- * <p>Returns a pair of ints representing a half-open interval
- * <code>[top, bottom)</code>, which is the range of component indices
- * the provided layer number corresponds to.</p>
- *
- * <p>Note that "bottom" is <em>not</em> included in the interval of
- * component indices in this layer: a layer with 0 elements in it has
- * <code>ret[0] == ret[1]</code>.</p>
- *
- * @param layer the layer to look up.
- * @return the half-open range of indices this layer spans.
- * @throws IllegalArgumentException if layer does not refer to an active layer
- * in this container.
- */
- private int[] layerToRange (Integer layer)
- {
- int[] ret = new int[2];
- ret[1] = getComponents ().length;
- Iterator i = layers.entrySet ().iterator ();
- while (i.hasNext())
- {
- Map.Entry pair = (Map.Entry) i.next();
- Integer layerNum = (Integer) pair.getKey ();
- Integer layerSz = (Integer) pair.getValue ();
- if (layerNum.intValue() == layer.intValue())
- {
- ret[0] = ret[1] - layerSz.intValue ();
- return ret;
- }
- else
- {
- ret[1] -= layerSz.intValue ();
- }
- }
- // should have found the layer during iteration
- throw new IllegalArgumentException ();
- }
-
- /**
- * Increments the recorded size of a given layer.
- *
- * @param layer the layer number to increment.
- * @see #incrLayer()
- */
- private void incrLayer(Integer layer)
- {
- int sz = 1;
- if (layers.containsKey (layer))
- sz += ((Integer)(layers.get (layer))).intValue ();
- layers.put (layer, new Integer(sz));
- }
-
- /**
- * Decrements the recorded size of a given layer.
- *
- * @param layer the layer number to decrement.
- * @see #decrLayer()
- */
- private void decrLayer(Integer layer)
- {
- int sz = 0;
- if (layers.containsKey (layer))
- sz = ((Integer)(layers.get (layer))).intValue () - 1;
- layers.put (layer, new Integer(sz));
- }
-
- /**
- * Return the greatest layer number currently in use, in this container.
- * This number may legally be positive <em>or</em> negative.
- *
- * @return the least layer number.
- * @see #lowestLayer()
- */
- public int highestLayer()
- {
- if (layers.size() == 0)
- return 0;
- return ((Integer)(layers.lastKey ())).intValue ();
- }
-
- /**
- * Return the least layer number currently in use, in this container.
- * This number may legally be positive <em>or</em> negative.
- *
- * @return the least layer number.
- * @see #highestLayer()
- */
- public int lowestLayer()
- {
- if (layers.size() == 0)
- return 0;
- return ((Integer)(layers.firstKey ())).intValue ();
- }
-
- /**
- * Moves a component to the "front" of its layer. The "front" is a
- * synonym for position 0, which is also the last position drawn in each
- * layer, so is usually the component which occludes the most other
- * components in its layer.
- *
- * @param c the component to move to the front of its layer.
- * @throws IllegalArgumentException if the component is not a child of
- * this container.
- * @see #moveToBack()
- */
- public void moveToFront(Component c)
- {
- setPosition (c, 0);
- }
-
- /**
- * <p>Moves a component to the "back" of its layer. The "back" is a
- * synonym for position N-1 (also known as position -1), where N is the
- * size of the layer.</p>
- *
- * <p>The "back" of a layer is the first position drawn, so the component at
- * the "back" is usually the component which is occluded by the most
- * other components in its layer.</p>
- *
- * @param c the component to move to the back of its layer.
- * @throws IllegalArgumentException if the component is not a child of
- * this container.
- * @see #moveToFront()
- */
- public void moveToBack(Component c)
- {
- setPosition (c, -1);
- }
-
- /**
- * Return the position of a component within its layer. Positions are assigned
- * from the "front" (position 0) to the "back" (position N-1), and drawn from
- * the back towards the front.
- *
- * @param c the component to get the position of.
- * @throws IllegalArgumentException if the component is not a child of
- * this container.
- * @see #setPosition()
- */
- public int getPosition(Component c)
- {
- int layer = getLayer (c);
- int[] range = layerToRange(new Integer(layer));
- int top = range[0];
- int bot = range[1];
- Component[] comps = getComponents ();
- for (int i = top; i < bot; ++i)
- {
- if (comps[i] == c)
- return i - top;
- }
- // should have found it
- throw new IllegalArgumentException ();
- }
-
- /**
- * Change the position of a component within its layer. Positions are assigned
- * from the "front" (position 0) to the "back" (position N-1), and drawn from
- * the back towards the front.
- *
- * @param c the component to change the position of.
- * @param position the position to assign the component to.
- * @throws IllegalArgumentException if the component is not a child of
- * this container.
- * @see #getPosition()
- */
- public void setPosition(Component c, int position)
- {
- int layer = getLayer (c);
- int[] range = layerToRange(new Integer(layer));
- if (range[0] == range[1])
- throw new IllegalArgumentException ();
-
- int top = range[0];
- int bot = range[1];
- if (position == -1)
- position = (bot - top) - 1;
- int targ = Math.min(top + position, bot-1);
- int curr = -1;
-
- Component[] comps = getComponents();
- for (int i = top; i < bot; ++i)
- {
- if (comps[i] == c)
- {
- curr = i;
- break;
- }
- }
- if (curr == -1)
- // should have found it
- throw new IllegalArgumentException();
-
- super.swapComponents (curr, targ);
- revalidate();
- repaint();
- }
-
- /**
- * Return an array of all components within a layer of this
- * container. Components are ordered front-to-back, with the "front"
- * element (which draws last) at position 0 of the returned array.
- *
- * @param layer the layer to return components from.
- * @return the components in the layer.
- */
- public Component[] getComponentsInLayer(int layer)
- {
- int[] range = layerToRange (getObjectForLayer (layer));
- if (range[0] == range[1])
- return new Component[0];
- else
- {
- Component[] comps = getComponents ();
- int sz = range[1] - range[0];
- Component[] nc = new Component[sz];
- for (int i = 0; i < sz; ++i)
- nc[i] = comps[range[0] + i];
- return nc;
- }
- }
-
- /**
- * Return the number of components within a layer of this
- * container.
- *
- * @param layer the layer count components in.
- * @return the number of components in the layer.
- */
- public int getComponentCountInLayer(int layer)
- {
- int[] range = layerToRange (getObjectForLayer (layer));
- if (range[0] == range[1])
- return 0;
- else
- return (range[1] - range[0]);
- }
-
- /**
- * Return a hashtable mapping child components of this container to
- * Integer objects representing the component's layer assignments.
- */
- protected Hashtable getComponentToLayer()
- {
- return componentToLayer;
- }
-
- /**
- * Return the index of a component within the underlying (contiguous)
- * array of children. This is a "raw" number which does not represent the
- * child's position in a layer, but rather its position in the logical
- * drawing order of all children of the container.
- *
- * @param c the component to look up.
- * @return the external index of the component.
- * @throws IllegalArgumentException if the component is not a child of
- * this container.
- */
- public int getIndexOf(Component c)
- {
- int layer = getLayer (c);
- int[] range = layerToRange(new Integer(layer));
- Component[] comps = getComponents();
- for (int i = range[0]; i < range[1]; ++i)
- {
- if (comps[i] == c)
- return i;
- }
- // should have found the component during iteration
- throw new IllegalArgumentException ();
- }
-
- /**
- * Return an Integer object which holds the same int value as the
- * parameter. This is strictly an optimization to minimize the number of
- * identical Integer objects which we allocate.
- *
- * @param layer the layer number as an int.
- * @return the layer number as an Integer, possibly shared.
- */
- protected Integer getObjectForLayer(int layer)
- {
- switch (layer)
- {
- case -30000:
- return FRAME_CONTENT_LAYER;
-
- case 0:
- return DEFAULT_LAYER;
-
- case 100:
- return PALETTE_LAYER;
-
- case 200:
- return MODAL_LAYER;
-
- case 300:
- return POPUP_LAYER;
-
- case 400:
- return DRAG_LAYER;
-
- default:
- break;
- }
-
- return new Integer(layer);
- }
-
- /**
- * Computes an index at which to request the superclass {@link
- * java.awt.Container} inserts a component, given an abstract layer and
- * position number.
- *
- * @param layer the layer in which to insert a component.
- * @param position the position in the layer at which to insert a component.
- * @return the index at which to insert the component.
- */
- protected int insertIndexForLayer(int layer, int position)
- {
-
- Integer lobj = getObjectForLayer (layer);
- if (! layers.containsKey(lobj))
- layers.put (lobj, new Integer (0));
- int[] range = layerToRange (lobj);
- if (range[0] == range[1])
- return range[0];
-
- int top = range[0];
- int bot = range[1];
-
- if (position == -1 || position > (bot - top))
- return bot;
- else
- return top + position;
- }
-
- /**
- * Removes a child from this container. The child is specified by
- * index. After removal, the child no longer occupies a layer.
- *
- * @param index the index of the child component to remove.
- */
- public void remove (int index)
- {
- Component c = getComponent (index);
- int layer = getLayer (c);
- decrLayer (new Integer(layer));
- componentToLayer.remove (c);
- super.remove (index);
- revalidate();
- repaint();
- }
-
- /**
- * Removes a child from this container. The child is specified directly.
- * After removal, the child no longer occupies a layer.
- *
- * @param comp the child to remove.
- */
- public void remove (Component comp)
- {
- remove (getIndexOf (comp));
- }
-
- /**
- * <p>Set the layer property for a component, within this container. The
- * component will be implicitly mapped to the bottom-most position in the
- * layer, but only if added <em>after</em> calling this method.</p>
- *
- * <p>Read that carefully: this method should be called <em>before</em> the
- * component is added to the container.</p>
- *
- * @param c the component to set the layer property for.
- * @param layer the layer number to assign to the component.
- */
- public void setLayer(Component c, int layer)
- {
- componentToLayer.put (c, getObjectForLayer (layer));
- }
-
- /**
- * Set the layer and position of a component, within this container.
- *
- * @param c the child component to set the layer property for.
- * @param layer the layer number to assign to the component.
- * @param position the position number to assign to the component.
- */
- public void setLayer(Component c,
- int layer,
- int position)
- {
- remove(c);
- add(c, getObjectForLayer (layer));
- setPosition(c, position);
- revalidate();
- repaint();
- }
-
- /**
- * Overrides the default implementation from {@link java.awt.Container}
- * such that <code>layerConstraint</code> is interpreted as an {@link
- * Integer}, specifying the layer to which the component will be added
- * (at the bottom position).
- *
- * @param comp the component to add.
- * @param layerConstraint an integer specifying the layer to add the component to.
- * @param index an ignored parameter, for compatibility.
- */
- protected void addImpl(Component comp, Object layerConstraint, int index)
- {
- Integer layer;
- if (layerConstraint != null && layerConstraint instanceof Integer)
- layer = (Integer) layerConstraint;
- else if (componentToLayer.containsKey (comp))
- layer = (Integer) componentToLayer.remove (comp);
- else
- layer = DEFAULT_LAYER;
-
- int newIdx = insertIndexForLayer(layer.intValue (), index);
-
- componentToLayer.put (comp, layer);
- incrLayer (layer);
-
- super.addImpl(comp, null, newIdx);
- revalidate();
- repaint();
- }
-}
diff --git a/libjava/javax/swing/JList.java b/libjava/javax/swing/JList.java
deleted file mode 100644
index 117163505d0..00000000000
--- a/libjava/javax/swing/JList.java
+++ /dev/null
@@ -1,1338 +0,0 @@
-/* JList.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Color;
-import java.awt.Component;
-import java.awt.ComponentOrientation;
-import java.awt.Dimension;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.plaf.ListUI;
-
-/**
- * <p>This class is a facade over three separate objects: {@link
- * javax.swing.ListModel}, {@link javax.swing.ListSelectionModel} and
- * {@link javax.swing.plaf.ListUI}. The facade represents a unified "list"
- * concept, with independently replacable (possibly client-provided) models
- * for its contents and its current selection. In addition, each element in
- * the list is rendered via a strategy class {@link
- * javax.swing.ListCellRenderer}.</p>
- *
- * <p>Lists have many properties, some of which are stored in this class
- * while others are delegated to the list's model or selection. The
- * following properties are available:</p>
- *
- * <table>
- * <tr><th>Property </th><th>Stored in</th><th>Bound?</th></tr>
- * <tr><td>accessibleContext </td><td>list </td><td>no </td></tr>
- * <tr><td>anchorSelectionIndex </td><td>selection</td><td>no </td></tr>
- * <tr><td>cellRenderer </td><td>list </td><td>yes </td></tr>
- * <tr><td>dragEnabled </td><td>list </td><td>no </td></tr>
- * <tr><td>firstVisibleIndex </td><td>list </td><td>no </td></tr>
- * <tr><td>fixedCellHeight </td><td>list </td><td>yes </td></tr>
- * <tr><td>fixedCellWidth </td><td>list </td><td>yes </td></tr>
- * <tr><td>lastVisibleIndex </td><td>list </td><td>no </td></tr>
- * <tr><td>layoutOrientation </td><td>list </td><td>yes </td></tr>
- * <tr><td>leadSelectionIndex </td><td>selection</td><td>no </td></tr>
- * <tr><td>maxSelectionIndex </td><td>selection</td><td>no </td></tr>
- * <tr><td>minSelectionIndex </td><td>selection</td><td>no </td></tr>
- * <tr><td>model </td><td>list </td><td>yes </td></tr>
- * <tr><td>opaque </td><td>list </td><td>no </td></tr>
- * <tr><td>preferredScrollableViewportSize</td><td>list </td><td>no </td></tr>
- * <tr><td>prototypeCellValue </td><td>list </td><td>yes </td></tr>
- * <tr><td>scrollableTracksViewportHeight </td><td>list </td><td>no </td></tr>
- * <tr><td>scrollableTracksViewportWidth </td><td>list </td><td>no </td></tr>
- * <tr><td>selectedIndex </td><td>selection</td><td>no </td></tr>
- * <tr><td>selectedIndices </td><td>selection</td><td>no </td></tr>
- * <tr><td>selectedValue </td><td>model </td><td>no </td></tr>
- * <tr><td>selectedValues </td><td>model </td><td>no </td></tr>
- * <tr><td>selectionBackground </td><td>list </td><td>yes </td></tr>
- * <tr><td>selectionEmpty </td><td>selection</td><td>no </td></tr>
- * <tr><td>selectionForeground </td><td>list </td><td>yes </td></tr>
- * <tr><td>selectionMode </td><td>selection</td><td>no </td></tr>
- * <tr><td>selectionModel </td><td>list </td><td>yes </td></tr>
- * <tr><td>UI </td><td>list </td><td>yes </td></tr>
- * <tr><td>UIClassID </td><td>list </td><td>no </td></tr>
- * <tr><td>valueIsAdjusting </td><td>list </td><td>no </td></tr>
- * <tr><td>visibleRowCount </td><td>list </td><td>no </td></tr>
- * </table>
- *
- * @author Graydon Hoare (graydon@redhat.com)
- */
-
-public class JList extends JComponent implements Accessible, Scrollable
-{
- private static final long serialVersionUID = 4406629526391098046L;
-
- /**
- * Constant value used in "layoutOrientation" property. This value means
- * that cells are laid out in a single vertical column. This is the default.
- */
- public static final int VERTICAL = 0;
-
- /**
- * Constant value used in "layoutOrientation" property. This value means
- * that cells are laid out in multiple columns "newspaper style", filling
- * vertically first, then horizontally.
- */
- public static final int VERTICAL_WRAP = 1;
-
- /**
- * Constant value used in "layoutOrientation" property. This value means
- * that cells are laid out in multiple columns "newspaper style",
- * filling horizontally first, then vertically.
- */
- public static final int HORIZONTAL_WRAP = 2;
-
- /**
- * This property indicates whether "drag and drop" functions are enabled
- * on the list.
- */
- boolean dragEnabled;
-
- /** This property provides a strategy for rendering cells in the list. */
- ListCellRenderer cellRenderer;
-
- /**
- * This property indicates an fixed width to assign to all cells in the
- * list. If its value is <code>-1</code>, no width has been
- * assigned. This value can be set explicitly, or implicitly by setting
- * the {@link #prototypeCellValue} property.
- */
- int fixedCellWidth;
-
- /**
- * This property indicates an fixed height to assign to all cells in the
- * list. If its value is <code>-1</code>, no height has been
- * assigned. This value can be set explicitly, or implicitly by setting
- * the {@link #prototypeCellValue} property.
- */
- int fixedCellHeight;
-
- /**
- * This property holds the current layout orientation of the list, which
- * is one of the integer constants {@link #VERTICAL}, {@link
- * #VERTICAL_WRAP}, or {@link #HORIZONTAL_WRAP}.
- */
- int layoutOrientation;
-
- /** This property holds the data elements displayed by the list. */
- ListModel model;
-
- /**
- * <p>This property holds a reference to a "prototype" data value --
- * typically a String -- which is used to calculate the {@link
- * #fixedCellWidth} and {@link #fixedCellHeight} properties, using the
- * {@link #cellRenderer} property to acquire a component to render the
- * prototype.</p>
- *
- * <p>It is important that you <em>not</em> set this value to a
- * component. It has to be a <em>data value</em> such as the objects you
- * would find in the list's model. Setting it to a component will have
- * undefined (and undesirable) affects. </p>
- */
- Object prototypeCellValue;
-
- /**
- * This property specifies a foreground color for the selected cells in
- * the list. When {@link ListCellRenderer.getListCellRendererComponent}
- * is called with a selected cell object, the component returned will
- * have its "foreground" set to this color.
- */
- Color selectionBackground;
-
- /**
- * This property specifies a background color for the selected cells in
- * the list. When {@link ListCellRenderer.getListCellRendererComponent}
- * is called with a selected cell object, the component returned will
- * have its "background" property set to this color.
- */
- Color selectionForeground;
-
- /**
- * This property holds a description of which data elements in the {@link
- * #model} property should be considered "selected", when displaying and
- * interacting with the list.
- */
- ListSelectionModel selectionModel;
-
-
- /**
- * This property indicates that the list's selection is currently
- * "adjusting" -- perhaps due to a user actively dragging the mouse over
- * multiple list elements -- and is therefore likely to change again in
- * the near future. A {@link ListSelectionListener} might choose to delay
- * updating its view of the list's selection until this property is
- * false, meaning that the adjustment has completed.
- */
- boolean valueIsAdjusting;
-
- /**
- * This property indicates a <em>preference</em> for the number of rows
- * displayed in the list, and will scale the
- * {@link #preferredScrollableViewportSize} property accordingly. The actual
- * number of displayed rows, when the list is placed in a real {@link
- * Viewport} or other component, may be greater or less than this number.
- */
- int visibleRowCount;
-
- /**
- * Fire a {@link ListSelectionEvent} to all the registered ListSelectionListeners.
- */
- protected void fireSelectionValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
- {
- ListSelectionEvent evt = new ListSelectionEvent(this, firstIndex, lastIndex, isAdjusting);
- ListSelectionListener listeners[] = getListSelectionListeners();
- for (int i = 0; i < listeners.length; ++i)
- {
- listeners[i].valueChanged(evt);
- }
- }
-
- /**
- * This private listener propagates {@link ListSelectionEvent} events
- * from the list's "selectionModel" property to the list's {@link
- * ListSelectionListener} listeners. It also listens to {@link
- * ListDataEvent} events from the list's {@link #model} property. If this
- * class receives either type of event, it triggers repainting of the
- * list.
- */
- private class ListListener
- implements ListSelectionListener, ListDataListener
- {
- // ListDataListener events
- public void contentsChanged(ListDataEvent event)
- {
- JList.this.revalidate();
- JList.this.repaint();
- }
- public void intervalAdded(ListDataEvent event)
- {
- JList.this.revalidate();
- JList.this.repaint();
- }
- public void intervalRemoved(ListDataEvent event)
- {
- JList.this.revalidate();
- JList.this.repaint();
- }
- // ListSelectionListener events
- public void valueChanged(ListSelectionEvent event)
- {
- JList.this.fireSelectionValueChanged(event.getFirstIndex(),
- event.getLastIndex(),
- event.getValueIsAdjusting());
- JList.this.repaint();
- }
- };
-
- /**
- * Shared ListListener instance, subscribed to both the current {@link
- * #model} and {@link #selectionModel} properties of the list.
- */
- ListListener listListener;
-
-
- /**
- * Creates a new JList object.
- */
- public JList()
- {
- init();
- }
-
- /**
- * Creates a new JList object.
- *
- * @param listData Initial data to populate the list with
- */
- public JList(Object[] listData)
- {
- init();
- setListData(listData);
- }
-
- /**
- * Creates a new JList object.
- *
- * @param listData Initial data to populate the list with
- */
- public JList(Vector listData)
- {
- init();
- setListData(listData);
- }
-
- /**
- * Creates a new JList object.
- *
- * @param listData Initial data to populate the list with
- */
- public JList(ListModel listData)
- {
- init();
- setModel(listData);
- }
-
- void init()
- {
- dragEnabled = false;
- fixedCellHeight = -1;
- fixedCellWidth = -1;
- layoutOrientation = VERTICAL;
- opaque = true;
- valueIsAdjusting = false;
- visibleRowCount = 8;
-
- cellRenderer = new DefaultListCellRenderer();
- listListener = new ListListener();
-
- setModel(new DefaultListModel());
- setSelectionModel(createSelectionModel());
-
- updateUI();
- }
-
- /**
- * Creates the default <code>ListSelectionModel</code>.
- *
- * @return the <code>ListSelectionModel</code>
- */
- protected ListSelectionModel createSelectionModel()
- {
- return new DefaultListSelectionModel();
- }
-
- /**
- * Gets the value of the {@link #fixedCellHeight} property. This property
- * may be <code>-1</code> to indicate that no cell height has been
- * set. This property is also set implicitly when the
- * {@link #prototypeCellValue} property is set.
- *
- * @return The current value of the property
- *
- * @see #fixedCellHeight
- * @see #setFixedCellHeight
- * @see #setPrototypeCellValue
- */
- public int getFixedCellHeight()
- {
- return fixedCellHeight;
- }
-
- /**
- * Sets the value of the {@link #fixedCellHeight} property. This property
- * may be <code>-1</code> to indicate that no cell height has been
- * set. This property is also set implicitly when the {@link
- * #prototypeCellValue} property is set, but setting it explicitly
- * overrides the height computed from {@link #prototypeCellValue}.
- *
- * @see #getFixedCellHeight
- * @see #getPrototypeCellValue
- */
- public void setFixedCellHeight(int h)
- {
- if (fixedCellHeight == h)
- return;
-
- int old = fixedCellHeight;
- fixedCellHeight = h;
- firePropertyChange("fixedCellWidth", old, h);
- }
-
-
- /**
- * Gets the value of the {@link #fixedCellWidth} property. This property
- * may be <code>-1</code> to indicate that no cell width has been
- * set. This property is also set implicitly when the {@link
- * #prototypeCellValue} property is set.
- *
- * @return The current value of the property
- *
- * @see #setFixedCellWidth
- * @see #setPrototypeCellValue
- */
- public int getFixedCellWidth()
- {
- return fixedCellWidth;
- }
-
- /**
- * Sets the value of the {@link #fixedCellWidth} property. This property
- * may be <code>-1</code> to indicate that no cell width has been
- * set. This property is also set implicitly when the {@link
- * #prototypeCellValue} property is set, but setting it explicitly
- * overrides the width computed from {@link #prototypeCellValue}.
- *
- * @see #getFixedCellHeight
- * @see #getPrototypeCellValue
- */
- public void setFixedCellWidth(int w)
- {
- if (fixedCellWidth == w)
- return;
-
- int old = fixedCellWidth;
- fixedCellWidth = w;
- firePropertyChange("fixedCellWidth", old, w);
- }
-
- /**
- * Gets the value of the {@link #visibleRowCount} property.
- *
- * @return the current value of the property.
- */
-
- public int getVisibleRowCount()
- {
- return visibleRowCount;
- }
-
- /**
- * Sets the value of the {@link #visibleRowCount} property.
- *
- * @param visibleRowCount The new property value
- */
- public void setVisibleRowCount(int vc)
- {
- visibleRowCount = vc;
- revalidate();
- repaint();
- }
-
- /**
- * Adds a {@link ListSelectionListener} to the listener list for this
- * list. The listener will be called back with a {@link
- * ListSelectionEvent} any time the list's {@link #selectionModel}
- * property changes. The source of such events will be the JList,
- * not the selection model.
- *
- * @param listener The new listener to add
- */
- public void addListSelectionListener(ListSelectionListener listener)
- {
- listenerList.add (ListSelectionListener.class, listener);
- }
-
- /**
- * Removes a {@link ListSelectionListener} from the listener list for
- * this list. The listener will no longer be called when the list's
- * {@link #selectionModel} changes.
- *
- * @param listener The listener to remove
- */
- public void removeListSelectionListener(ListSelectionListener listener)
- {
- listenerList.remove(ListSelectionListener.class, listener);
- }
-
- /**
- * Returns an array of all ListSelectionListeners subscribed to this
- * list.
- *
- * @return The current subscribed listeners
- *
- * @since 1.4
- */
- public ListSelectionListener[] getListSelectionListeners()
- {
- return (ListSelectionListener[]) getListeners(ListSelectionListener.class);
- }
-
- public int getSelectionMode()
- {
- return selectionModel.getSelectionMode();
- }
-
- /**
- * Sets the list's "selectionMode" property, which simply mirrors the
- * same property on the list's {@link #selectionModel} property. This
- * property should be one of the integer constants
- * <code>SINGLE_SELECTION</code>, <code>SINGLE_INTERVAL_SELECTION</code>,
- * or <code>MULTIPLE_INTERVAL_SELECTION</code> from the {@link
- * ListSelectionModel} interface.
- *
- * @param a The new selection mode
- */
- public void setSelectionMode(int a)
- {
- selectionModel.setSelectionMode(a);
- }
-
- /**
- * Adds the interval <code>[a,a]</code> to the set of selections managed
- * by this list's {@link #selectionModel} property. Depending on the
- * selection mode, this may cause existing selections to become invalid,
- * or may simply expand the set of selections.
- *
- * @param a A number in the half-open range <code>[0, x)</code> where
- * <code>x = getModel.getSize()</code>, indicating the index of an
- * element in the list to select.
- *
- * @see #setSelectionMode
- * @see #selectionModel
- */
- public void setSelectedIndex(int a)
- {
- selectionModel.setSelectionInterval(a, a);
- }
-
- /**
- * For each element <code>a[i]</code> of the provided array
- * <code>a</code>, calls {@link #setSelectedIndex} on <code>a[i]</code>.
- *
- * @see #setSelectionMode
- * @see #selectionModel
- */
- public void setSelectedIndices(int [] a)
- {
- for (int i = 0; i < a.length; ++i)
- setSelectedIndex(a[i]);
- }
-
- /**
- * Returns the minimum index of an element in the list which is currently
- * selected.
- *
- * @return A number in the half-open range <code>[0, x)</code> where
- * <code>x = getModel.getSize()</code>, indicating the minimum index of
- * an element in the list for which the element is selected, or
- * <code>-1</code> if no elements are selected
- */
- public int getSelectedIndex()
- {
- return selectionModel.getMinSelectionIndex();
- }
-
- /**
- * Returns <code>true</code> if the model's selection is empty, otherwise
- * <code>false</code>.
- *
- * @return The return value of {@link ListSelectionModel#isSelectionEmpty}
- */
- public boolean isSelectionEmpty()
- {
- return selectionModel.isSelectionEmpty();
- }
-
- /**
- * Returns the list index of the upper left or upper right corner of the
- * {@link #visibleRect} property, depending on the {@link
- * #componentOrientation} property.
- *
- * @return The index of the first visible list cell, or <code>-1</code>
- * if none is visible.
- */
- public int getFirstVisibleIndex()
- {
- ComponentOrientation or = getComponentOrientation();
- Rectangle r = getVisibleRect();
- if (or == ComponentOrientation.RIGHT_TO_LEFT)
- r.translate((int) r.getWidth(), 0);
- return getUI().locationToIndex(this, r.getLocation());
- }
-
-
- /**
- * Returns index of the cell to which specified location is closest to
- * @param location for which to look for in the list
- *
- * @return index of the cell to which specified location is closest to.
- */
- public int locationToIndex(Point location) {
- return getUI().locationToIndex(this, location);
- }
-
- /**
- * Returns location of the cell located at the specified index in the list.
- * @param index of the cell for which location will be determined
- *
- * @return location of the cell located at the specified index in the list.
- */
- public Point indexToLocation(int index){
- //FIXME: Need to implement.
- return null;
- }
-
- /**
- * Returns the list index of the lower right or lower left corner of the
- * {@link #visibleRect} property, depending on the {@link
- * #componentOrientation} property.
- *
- * @return The index of the first visible list cell, or <code>-1</code>
- * if none is visible.
- */
- public int getLastVisibleIndex()
- {
- ComponentOrientation or = getComponentOrientation();
- Rectangle r = getVisibleRect();
- r.translate(0, (int) r.getHeight());
- if (or == ComponentOrientation.LEFT_TO_RIGHT)
- r.translate((int) r.getWidth(), 0);
- return getUI().locationToIndex(this, r.getLocation());
- }
-
- /**
- * Returns the indices of values in the {@link #model} property which are
- * selected.
- *
- * @return An array of model indices, each of which is selected according
- * to the {@link #selection} property
- */
- public int[] getSelectedIndices()
- {
- int lo, hi, n, i, j;
- if (selectionModel.isSelectionEmpty())
- return new int[0];
- lo = selectionModel.getMinSelectionIndex();
- hi = selectionModel.getMaxSelectionIndex();
- n = 0;
- for (i = lo; i < hi; ++i)
- if (selectionModel.isSelectedIndex(i))
- n++;
- int [] v = new int[n];
- j = 0;
- for (i = lo; i < hi; ++i)
- if (selectionModel.isSelectedIndex(i))
- v[j++] = i;
- return v;
- }
-
- /**
- * Indicates whether the list element at a given index value is
- * currently selected.
- *
- * @param a The index to check
- * @return <code>true</code> if <code>a</code> is the index of a selected
- * list element
- */
- public boolean isSelectedIndex(int a)
- {
- return selectionModel.isSelectedIndex(a);
- }
-
- /**
- * Returns the first value in the list's {@link #model} property which is
- * selected, according to the list's {@link #selectionModel} property.
- * This is equivalent to calling
- * <code>getModel()getElementAt(getSelectedIndex())</code>, with a check
- * for the special index value of <code>-1</code> which returns null
- * <code>null</code>.
- *
- * @return The first selected element, or <code>null</code> if no element
- * is selected.
- *
- * @see getSelectedValues
- */
- public Object getSelectedValue()
- {
- int index = getSelectedIndex();
- if (index == -1)
- return null;
- return getModel().getElementAt(index);
- }
-
- /**
- * Returns all the values in the list's {@link #model} property which
- * are selected, according to the list's {@link #selectionModel} property.
- *
- * @return An array containing all the selected values
- *
- * @see getSelectedValue
- */
- public Object[] getSelectedValues()
- {
- int [] idx = getSelectedIndices();
- Object [] v = new Object[idx.length];
- for (int i = 0; i < idx.length; ++i)
- v[i] = getModel().getElementAt(i);
- return v;
- }
-
- /**
- * Gets the value of the {@link #selectionBackground} property.
- *
- * @return The current value of the property
- */
- public Color getSelectionBackground()
- {
- return selectionBackground;
- }
-
- /**
- * Sets the value of the {@link #selectionBackground} property.
- *
- * @param c The new value of the property
- */
- public void setSelectionBackground(Color c)
- {
- if (selectionBackground == c)
- return;
-
- Color old = selectionBackground;
- selectionBackground = c;
- firePropertyChange("selectionBackground", old, c);
- repaint();
- }
-
- /**
- * Gets the value of the {@link #selectionForeground} property.
- *
- * @return The current value of the property
- */
- public Color getSelectionForeground()
- {
- return selectionForeground;
- }
-
- /**
- * Sets the value of the {@link #selectionForeground} property.
- *
- * @param c The new value of the property
- */
- public void setSelectionForeground(Color c)
- {
- if (selectionForeground == c)
- return;
-
- Color old = selectionForeground;
- selectionForeground = c;
- firePropertyChange("selectionForeground", old, c);
- }
-
- /**
- * Sets the selection to cover only the specified value, if it
- * exists in the model.
- *
- * @param obj The object to select
- * @param scroll Whether to scroll the list to make the newly selected
- * value visible
- *
- * @see #ensureIndexIsVisible
- */
-
- public void setSelectedValue(Object obj, boolean scroll)
- {
- for (int i = 0; i < model.getSize(); ++i)
- {
- if (model.getElementAt(i).equals(obj))
- {
- setSelectedIndex(i);
- if (scroll)
- ensureIndexIsVisible(i);
- break;
- }
- }
- }
-
- /**
- * Scrolls this list to make the specified cell visible. This
- * only works if the list is contained within a viewport.
- *
- * @param i The list index to make visible
- *
- * @see JComponent#scrollRectToVisible
- */
- public void ensureIndexIsVisible(int i)
- {
- scrollRectToVisible(getUI().getCellBounds(this, i, i));
- }
-
- /**
- * Sets the {@link #model} property of the list to a new anonymous
- * {@link AbstractListModel} subclass which accesses the provided Object
- * array directly.
- *
- * @param listData The object array to build a new list model on
- * @see #setModel
- */
- public void setListData(final Object[] listData)
- {
- setModel(new AbstractListModel()
- {
- public int getSize()
- {
- return listData.length;
- }
-
- public Object getElementAt(int i)
- {
- return listData[i];
- }
- });
- }
-
- /**
- * Sets the {@link #model} property of the list to a new anonymous {@link
- * AbstractListModel} subclass which accesses the provided vector
- * directly.
- *
- * @param listData The object array to build a new list model on
- * @see #setModel
- */
- public void setListData(final Vector listData)
- {
- setModel(new AbstractListModel()
- {
- public int getSize()
- {
- return listData.size();
- }
-
- public Object getElementAt(int i)
- {
- return listData.elementAt(i);
- }
- });
- }
-
- /**
- * Gets the value of the {@link #cellRenderer} property.
- *
- * @return The current value of the property
- */
- public ListCellRenderer getCellRenderer()
- {
- return cellRenderer;
- }
-
- /**
- * Sets the value of the {@link #celLRenderer} property.
- *
- * @param renderer The new property value
- */
- public void setCellRenderer(ListCellRenderer renderer)
- {
- if (cellRenderer == renderer)
- return;
-
- ListCellRenderer old = cellRenderer;
- cellRenderer = renderer;
- firePropertyChange("cellRenderer", old, renderer);
- revalidate();
- repaint();
- }
-
- /**
- * Gets the value of the {@link #model} property.
- *
- * @return The current value of the property
- */
- public ListModel getModel()
- {
- return model;
- }
-
- /**
- * Sets the value of the {@link #model} property. The list's {@link
- * #listListener} is unsubscribed from the existing model, if it exists,
- * and re-subscribed to the new model.
- *
- * @param model The new property value
- */
- public void setModel(ListModel model)
- {
- if (this.model == model)
- return;
-
- if (this.model != null)
- this.model.removeListDataListener(listListener);
-
- ListModel old = this.model;
- this.model = model;
-
- if (this.model != null)
- this.model.addListDataListener(listListener);
-
- firePropertyChange("model", old, model);
- revalidate();
- repaint();
- }
-
-
- public ListSelectionModel getSelectionModel()
- {
- return selectionModel;
- }
-
- /**
- * Sets the value of the {@link #selectionModel} property. The list's
- * {@link #listListener} is unsubscribed from the existing selection
- * model, if it exists, and re-subscribed to the new selection model.
- *
- * @param model The new property value
- */
- public void setSelectionModel(ListSelectionModel model)
- {
- if (selectionModel == model)
- return;
-
- if (selectionModel != null)
- selectionModel.removeListSelectionListener(listListener);
-
- ListSelectionModel old = selectionModel;
- selectionModel = model;
-
- if (selectionModel != null)
- selectionModel.addListSelectionListener(listListener);
-
- firePropertyChange("selectionModel", old, model);
- revalidate();
- repaint();
- }
-
- /**
- * Gets the value of the UI property.
- *
- * @return The current property value
- */
- public ListUI getUI()
- {
- return (ListUI) ui;
- }
-
- /**
- * Sets the value of the UI property.
- *
- * @param ui The new property value
- */
- public void setUI(ListUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * Calls {@link #setUI} with the {@link ListUI} subclass
- * returned from calling {@link UIManager#getUI}.
- */
- public void updateUI()
- {
- setUI((ListUI) UIManager.getUI(this));
- }
-
- /**
- * Return the class identifier for the list's UI property. This should
- * be the constant string <code>"ListUI"</code>, and map to an
- * appropriate UI class in the {@link UIManager}.
- *
- * @return The class identifier
- */
- public String getUIClassID()
- {
- return "ListUI";
- }
-
-
- /**
- * Returns the current value of the {@link #prototypeCellValue}
- * property. This property holds a reference to a "prototype" data value
- * -- typically a String -- which is used to calculate the {@link
- * #fixedCellWidth} and {@link #fixedCellHeight} properties, using the
- * {@link #cellRenderer} property to acquire a component to render the
- * prototype.
- *
- * @return The current prototype cell value
- * @see #setPrototypeCellValue
- */
- public Object getPrototypeCellValue()
- {
- return prototypeCellValue;
- }
-
- /**
- * <p>Set the {@link #prototypeCellValue} property. This property holds a
- * reference to a "prototype" data value -- typically a String -- which
- * is used to calculate the {@link #fixedCellWidth} and {@link
- * #fixedCellHeight} properties, using the {@link #cellRenderer} property
- * to acquire a component to render the prototype.</p>
- *
- * <p>It is important that you <em>not</em> set this value to a
- * component. It has to be a <em>data value</em> such as the objects you
- * would find in the list's model. Setting it to a component will have
- * undefined (and undesirable) affects. </p>
- *
- * @param obj The new prototype cell value
- * @see #getPrototypeCellValue
- */
- public void setPrototypeCellValue(Object obj)
- {
- if (prototypeCellValue == obj)
- return;
-
- Object old = prototypeCellValue;
- Component comp = getCellRenderer()
- .getListCellRendererComponent(this, obj, 0, false, false);
- Dimension d = comp.getPreferredSize();
- fixedCellWidth = d.width;
- fixedCellHeight = d.height;
- prototypeCellValue = obj;
- firePropertyChange("prototypeCellValue", old, obj);
- }
-
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
- /**
- * Returns a size indicating how much space this list would like to
- * consume, when contained in a scrollable viewport. This is part of the
- * {@link Scrollable} interface, which interacts with {@link
- * ScrollPaneLayout} and {@link Viewport} to define scrollable objects.
- *
- * @return The preferred size
- */
- public Dimension getPreferredScrollableViewportSize()
- {
-
- Dimension retVal = getPreferredSize();
- if (getLayoutOrientation() == VERTICAL)
- {
- if (fixedCellHeight != -1)
- {
- if (fixedCellWidth != -1)
- {
- int size = getModel().getSize();
- retVal = new Dimension(fixedCellWidth, size * fixedCellHeight);
- } // TODO: add else clause (preferredSize is ok for now)
- } // TODO: add else clause (preferredSize is ok for now)
- }
- return retVal;
- }
-
- /**
- * <p>Return the number of pixels the list must scroll in order to move a
- * "unit" of the list into the provided visible rectangle. When the
- * provided direction is positive, the call describes a "downwards"
- * scroll, which will be exposing a cell at a <em>greater</em> index in
- * the list than those elements currently showing. Then the provided
- * direction is negative, the call describes an "upwards" scroll, which
- * will be exposing a cell at a <em>lesser</em> index in the list than
- * those elements currently showing.</p>
- *
- * <p>If the provided orientation is <code>HORIZONTAL</code>, the above
- * comments refer to "rightwards" for positive direction, and "leftwards"
- * for negative.</p>
- *
- *
- * @param visibleRect The rectangle to scroll an element into
- * @param orientation One of the numeric consants <code>VERTICAL</code>
- * or <code>HORIZONTAL</code>
- * @param direction An integer indicating the scroll direction: positive means
- * forwards (down, right), negative means backwards (up, left)
- *
- * @return The scrollable unit increment, in pixels
- */
- public int getScrollableUnitIncrement(Rectangle visibleRect,
- int orientation, int direction)
- {
- ListUI lui = this.getUI();
- if (orientation == SwingConstants.VERTICAL)
- {
- if (direction > 0)
- {
- // Scrolling down
- Point bottomLeft = new Point(visibleRect.x,
- visibleRect.y + visibleRect.height);
- int curIdx = lui.locationToIndex(this, bottomLeft);
- Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx);
- if (curBounds.y + curBounds.height == bottomLeft.y)
- {
- // we are at the exact bottom of the current cell, so we
- // are being asked to scroll to the end of the next one
- if (curIdx + 1 < model.getSize())
- {
- // there *is* a next item in the list
- Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1);
- return nxtBounds.height;
- }
- else
- {
- // no next item, no advance possible
- return 0;
- }
- }
- else
- {
- // we are part way through an existing cell, so we are being
- // asked to scroll to the bottom of it
- return (curBounds.y + curBounds.height) - bottomLeft.y;
- }
- }
- else
- {
- // scrolling up
- Point topLeft = new Point(visibleRect.x, visibleRect.y);
- int curIdx = lui.locationToIndex(this, topLeft);
- Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx);
- if (curBounds.y == topLeft.y)
- {
- // we are at the exact top of the current cell, so we
- // are being asked to scroll to the top of the previous one
- if (curIdx > 0)
- {
- // there *is* a previous item in the list
- Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1);
- return -nxtBounds.height;
- }
- else
- {
- // no previous item, no advance possible
- return 0;
- }
- }
- else
- {
- // we are part way through an existing cell, so we are being
- // asked to scroll to the top of it
- return curBounds.y - topLeft.y;
- }
- }
- }
-
- // FIXME: handle horizontal scrolling (also wrapping?)
- return 1;
- }
-
- /**
- * <p>Return the number of pixels the list must scroll in order to move a
- * "block" of the list into the provided visible rectangle. When the
- * provided direction is positive, the call describes a "downwards"
- * scroll, which will be exposing a cell at a <em>greater</em> index in
- * the list than those elements currently showing. Then the provided
- * direction is negative, the call describes an "upwards" scroll, which
- * will be exposing a cell at a <em>lesser</em> index in the list than
- * those elements currently showing.</p>
- *
- * <p>If the provided orientation is <code>HORIZONTAL</code>, the above
- * comments refer to "rightwards" for positive direction, and "leftwards"
- * for negative.</p>
- *
- *
- * @param visibleRect The rectangle to scroll an element into
- * @param orientation One of the numeric consants <code>VERTICAL</code>
- * or <code>HORIZONTAL</code>
- * @param direction An integer indicating the scroll direction: positive means
- * forwards (down, right), negative means backwards (up, left)
- *
- * @return The scrollable unit increment, in pixels
- */
- public int getScrollableBlockIncrement(Rectangle visibleRect,
- int orientation, int direction)
- {
- if (orientation == VERTICAL)
- return visibleRect.height * direction;
- else
- return visibleRect.width * direction;
- }
-
- /**
- * Gets the value of the {@link #scrollableTracksViewportWidth} property.
- *
- * @return <code>true</code> if the viewport is larger (horizontally)
- * than the list and the list should be expanded to fit the viewport;
- * <code>false</code> if the viewport is smaller than the list and the
- * list should scroll (horizontally) within the viewport
- */
- public boolean getScrollableTracksViewportWidth()
- {
- Component parent = getParent();
- boolean retVal = false;
- if (parent instanceof JViewport)
- {
- JViewport viewport = (JViewport) parent;
- Dimension pref = getPreferredSize();
- if (viewport.getSize().width > pref.width)
- retVal = true;
- if ((getLayoutOrientation() == HORIZONTAL_WRAP)
- && (getVisibleRowCount() <= 0))
- retVal = true;
- }
- return retVal;
- }
-
- /**
- * Gets the value of the {@link #scrollableTracksViewportWidth} property.
- *
- * @return <code>true</code> if the viewport is larger (vertically)
- * than the list and the list should be expanded to fit the viewport;
- * <code>false</code> if the viewport is smaller than the list and the
- * list should scroll (vertically) within the viewport
- */
- public boolean getScrollableTracksViewportHeight()
- {
- Component parent = getParent();
- boolean retVal = false;
- if (parent instanceof JViewport)
- {
- JViewport viewport = (JViewport) parent;
- Dimension pref = getPreferredSize();
- if (viewport.getSize().height > pref.height)
- retVal = true;
- if ((getLayoutOrientation() == VERTICAL_WRAP)
- && (getVisibleRowCount() <= 0))
- retVal = true;
- }
- return retVal;
- }
-
- public int getAnchorSelectionIndex()
- {
- return selectionModel.getAnchorSelectionIndex();
- }
-
- public int getLeadSelectionIndex()
- {
- return selectionModel.getLeadSelectionIndex();
- }
-
- public int getMinSelectionIndex()
- {
- return selectionModel.getMaxSelectionIndex();
- }
-
- public int getMaxSelectionIndex()
- {
- return selectionModel.getMaxSelectionIndex();
- }
-
- public void clearSelection()
- {
- selectionModel.clearSelection();
- }
-
- public void setSelectionInterval(int anchor, int lead)
- {
- selectionModel.setSelectionInterval(anchor, lead);
- }
-
- public void addSelectionInterval(int anchor, int lead)
- {
- selectionModel.addSelectionInterval(anchor, lead);
- }
-
- public void removeSelectionInterval(int index0, int index1)
- {
- selectionModel.removeSelectionInterval(index0, index1);
- }
-
- /**
- * Returns the value of the <code>valueIsAdjusting</code> property.
- *
- * @return the value
- */
- public boolean getValueIsAdjusting()
- {
- return valueIsAdjusting;
- }
-
- /**
- * Sets the <code>valueIsAdjusting</code> property.
- *
- * @param isAdjusting the new value
- */
- public void setValueIsAdjusting(boolean isAdjusting)
- {
- valueIsAdjusting = isAdjusting;
- }
-
- /**
- * Return the value of the <code>dragEnabled</code> property.
- *
- * @return the value
- *
- * @since 1.4
- */
- public boolean getDragEnabled()
- {
- return dragEnabled;
- }
-
- /**
- * Set the <code>dragEnabled</code> property.
- *
- * @param enabled new value
- *
- * @since 1.4
- */
- public void setDragEnabled(boolean enabled)
- {
- dragEnabled = enabled;
- }
-
- /**
- * Returns the layout orientation.
- *
- * @return the orientation, one of <code>JList.VERTICAL</code>,
- * <code>JList.VERTICAL_WRAP</code> and <code>JList.HORIZONTAL_WRAP</code>
- *
- * @since 1.4
- */
- public int getLayoutOrientation()
- {
- return layoutOrientation;
- }
-
- /**
- * Sets the layout orientation.
- *
- * @param orientation the orientation to set, one of <code>JList.VERTICAL</code>,
- * <code>JList.VERTICAL_WRAP</code> and <code>JList.HORIZONTAL_WRAP</code>
- *
- * @since 1.4
- */
- public void setLayoutOrientation(int orientation)
- {
- if (layoutOrientation == orientation)
- return;
-
- int old = layoutOrientation;
- layoutOrientation = orientation;
- firePropertyChange("layoutOrientation", old, orientation);
- }
-}
diff --git a/libjava/javax/swing/JMenu.java b/libjava/javax/swing/JMenu.java
deleted file mode 100644
index 04c2d2b4841..00000000000
--- a/libjava/javax/swing/JMenu.java
+++ /dev/null
@@ -1,894 +0,0 @@
-/* JMenu.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Point;
-import java.awt.event.KeyEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.EventListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleSelection;
-import javax.swing.event.MenuEvent;
-import javax.swing.event.MenuListener;
-import javax.swing.plaf.MenuItemUI;
-
-/**
- * This class represents a menu that can be added to a menu bar or
- * can be a submenu in some other menu. When JMenu is selected it
- * displays JPopupMenu containing its menu items.
- *
- * <p>
- * JMenu's fires MenuEvents when this menu's selection changes. If this menu
- * is selected, then fireMenuSelectedEvent() is invoked. In case when menu is
- * deselected or cancelled, then fireMenuDeselectedEvent() or
- * fireMenuCancelledEvent() is invoked, respectivelly.
- * </p>
- */
-public class JMenu extends JMenuItem implements Accessible, MenuElement
-{
- private static final long serialVersionUID = 4227225638931828014L;
-
- /** A Popup menu associated with this menu, which pops up when menu is selected */
- private JPopupMenu popupMenu = new JPopupMenu();
-
- /** Whenever menu is selected or deselected the MenuEvent is fired to
- menu's registered listeners. */
- private MenuEvent menuEvent = new MenuEvent(this);
-
- /*Amount of time, in milliseconds, that should pass before popupMenu
- associated with this menu appears or disappers */
- private int delay;
-
- /* PopupListener */
- protected WinListener popupListener;
-
- /** Location at which popup menu associated with this menu will be
- displayed */
- private Point menuLocation;
-
- /**
- * Creates a new JMenu object.
- */
- public JMenu()
- {
- super();
- }
-
- /**
- * Creates a new <code>JMenu</code> with the specified label.
- *
- * @param text label for this menu
- */
- public JMenu(String text)
- {
- super(text);
- popupMenu.setInvoker(this);
- }
-
- /**
- * Creates a new <code>JMenu</code> object.
- *
- * @param action Action that is used to create menu item tha will be
- * added to the menu.
- */
- public JMenu(Action action)
- {
- super(action);
- createActionChangeListener(this);
- popupMenu.setInvoker(this);
- }
-
- /**
- * Creates a new <code>JMenu</code> with specified label and an option
- * for this menu to be tear-off menu.
- *
- * @param text label for this menu
- * @param tearoff true if this menu should be tear-off and false otherwise
- */
- public JMenu(String text, boolean tearoff)
- {
- // FIXME: tearoff not implemented
- this(text);
- }
-
- private void writeObject(ObjectOutputStream stream) throws IOException
- {
- }
-
- /**
- * Adds specified menu item to this menu
- *
- * @param item Menu item to add to this menu
- *
- * @return Menu item that was added
- */
- public JMenuItem add(JMenuItem item)
- {
- return popupMenu.add(item);
- }
-
- /**
- * Adds specified component to this menu.
- *
- * @param component Component to add to this menu
- *
- * @return Component that was added
- */
- public Component add(Component component)
- {
- popupMenu.insert(component, -1);
- return component;
- }
-
- /**
- * Adds specified component to this menu at the given index
- *
- * @param component Component to add
- * @param index Position of this menu item in the menu
- *
- * @return Component that was added
- */
- public Component add(Component component, int index)
- {
- return popupMenu.add(component, index);
- }
-
- /**
- * Adds JMenuItem constructed with the specified label to this menu
- *
- * @param text label for the menu item that will be added
- *
- * @return Menu Item that was added to this menu
- */
- public JMenuItem add(String text)
- {
- return popupMenu.add(text);
- }
-
- /**
- * Adds JMenuItem constructed using properties from specified action.
- *
- * @param action action to construct the menu item with
- *
- * @return Menu Item that was added to this menu
- */
- public JMenuItem add(Action action)
- {
- return popupMenu.add(action);
- }
-
- /**
- * Removes given menu item from this menu. Nothing happens if
- * this menu doesn't contain specified menu item.
- *
- * @param item Menu Item which needs to be removed
- */
- public void remove(JMenuItem item)
- {
- popupMenu.remove(item);
- }
-
- /**
- * Removes component at the specified index from this menu
- *
- * @param index Position of the component that needs to be removed in the menu
- */
- public void remove(int index)
- {
- popupMenu.remove(index);
- }
-
- /**
- * Removes given component from this menu.
- *
- * @param component Component to remove
- */
- public void remove(Component component)
- {
- int index = popupMenu.getComponentIndex(component);
- popupMenu.remove(index);
- }
-
- /**
- * Removes all menu items from the menu
- */
- public void removeAll()
- {
- popupMenu.removeAll();
- }
-
- /**
- * Creates JMenuItem with the specified text and inserts it in the
- * at the specified index
- *
- * @param text label for the new menu item
- * @param index index at which to insert newly created menu item.
- */
- public void insert(String text, int index)
- {
- this.insert(new JMenuItem(text), index);
- }
-
- /**
- * Creates JMenuItem with the specified text and inserts it in the
- * at the specified index. IllegalArgumentException is thrown
- * if index is less than 0
- *
- * @param item menu item to insert
- * @param index index at which to insert menu item.
- * @return Menu item that was added to the menu
- */
- public JMenuItem insert(JMenuItem item, int index)
- {
- if (index < 0)
- throw new IllegalArgumentException("index less than zero");
-
- popupMenu.insert(item, index);
- return item;
- }
-
- /**
- * Creates JMenuItem with the associated action and inserts it to the menu
- * at the specified index. IllegalArgumentException is thrown
- * if index is less than 0
- *
- * @param action Action for the new menu item
- * @param index index at which to insert newly created menu item.
- * @return Menu item that was added to the menu
- */
- public JMenuItem insert(Action action, int index)
- {
- JMenuItem item = new JMenuItem(action);
- this.insert(item, index);
-
- return item;
- }
-
- /**
- * This method sets this menuItem's UI to the UIManager's default for the
- * current look and feel.
- */
- public void updateUI()
- {
- super.setUI((MenuItemUI) UIManager.getUI(this));
- invalidate();
- }
-
- /**
- * This method returns a name to identify which look and feel class will be
- * the UI delegate for the menu.
- *
- * @return The Look and Feel classID. "MenuUI"
- */
- public String getUIClassID()
- {
- return "MenuUI";
- }
-
- /**
- * Sets model for this menu.
- *
- * @param model model to set
- */
- public void setModel(ButtonModel model)
- {
- super.setModel(model);
- }
-
- /**
- * Returns true if the menu is selected and false otherwise
- *
- * @return true if the menu is selected and false otherwise
- */
- public boolean isSelected()
- {
- return super.isArmed();
- }
-
- /**
- * Changes this menu selected state if selected is true and false otherwise
- * This method fires menuEvents to menu's registered listeners.
- *
- * @param selected true if the menu should be selected and false otherwise
- */
- public void setSelected(boolean selected)
- {
- // if this menu selection is true, then activate this menu and
- // display popup associated with this menu
- if (selected)
- {
- super.setArmed(true);
- super.setSelected(true);
-
- // FIXME: The popup menu should be shown on the screen after certain
- // number of seconds pass. The 'delay' property of this menu indicates
- // this amount of seconds. 'delay' property is 0 by default.
- if (this.isShowing())
- {
- fireMenuSelected();
-
- int x = 0;
- int y = 0;
-
- if (menuLocation == null)
- {
- // Calculate correct position of the popup. Note that location of the popup
- // passed to show() should be relative to the popup's invoker
- if (isTopLevelMenu())
- y = this.getHeight();
- else
- x = this.getWidth();
-
- getPopupMenu().show(this, x, y);
- }
- else
- getPopupMenu().show(this, menuLocation.x, menuLocation.y);
- }
- }
-
- else
- {
- super.setSelected(false);
- super.setArmed(false);
- fireMenuDeselected();
- popupMenu.setVisible(false);
- }
- }
-
- /**
- * Checks if PopupMenu associated with this menu is visible
- *
- * @return true if the popup associated with this menu is currently visible
- * on the screen and false otherwise.
- */
- public boolean isPopupMenuVisible()
- {
- return popupMenu.isVisible();
- }
-
- /**
- * Sets popup menu visibility
- *
- * @param popup true if popup should be visible and false otherwise
- */
- public void setPopupMenuVisible(boolean popup)
- {
- if (getModel().isEnabled())
- popupMenu.setVisible(popup);
- }
-
- /**
- * Returns origin point of the popup menu
- *
- * @return Point containing
- */
- protected Point getPopupMenuOrigin()
- {
- // if menu in the menu bar
- if (isTopLevelMenu())
- return new Point(0, this.getHeight());
-
- // if submenu
- return new Point(this.getWidth(), 0);
- }
-
- /**
- * Returns delay property.
- *
- * @return delay property, indicating number of milliseconds before
- * popup menu associated with the menu appears or disappears after
- * menu was selected or deselected respectively
- */
- public int getDelay()
- {
- return delay;
- }
-
- /**
- * Sets delay property for this menu. If given time for the delay
- * property is negative, then IllegalArgumentException is thrown
- *
- * @param delay number of milliseconds before
- * popup menu associated with the menu appears or disappears after
- * menu was selected or deselected respectively
- */
- public void setDelay(int delay)
- {
- if (delay < 0)
- throw new IllegalArgumentException("delay less than 0");
- this.delay = delay;
- }
-
- /**
- * Sets location at which popup menu should be displayed
- * The location given is relative to this menu item
- *
- * @param x x-coordinate of the menu location
- * @param y y-coordinate of the menu location
- */
- public void setMenuLocation(int x, int y)
- {
- menuLocation = new Point(x, y);
- }
-
- /**
- * Creates and returns JMenuItem associated with the given action
- *
- * @param action Action to use for creation of JMenuItem
- *
- * @return JMenuItem that was creted with given action
- */
- protected JMenuItem createActionComponent(Action action)
- {
- return new JMenuItem(action);
- }
-
- /**
- * Creates ActionChangeListener to listen for PropertyChangeEvents occuring
- * in the action that is associated with this menu
- *
- * @param item menu that contains action to listen to
- *
- * @return The PropertyChangeListener
- */
- protected PropertyChangeListener createActionChangeListener(JMenuItem item)
- {
- return new ActionChangedListener(item);
- }
-
- /**
- * Adds separator to the end of the menu items in the menu.
- */
- public void addSeparator()
- {
- getPopupMenu().addSeparator();
- }
-
- /**
- * Inserts separator in the menu at the specified index.
- *
- * @param index Index at which separator should be inserted
- */
- public void insertSeparator(int index)
- {
- if (index < 0)
- throw new IllegalArgumentException("index less than 0");
-
- getPopupMenu().insert(new JPopupMenu.Separator(), index);
- }
-
- /**
- * Returns menu item located at the specified index in the menu
- *
- * @param index Index at which to look for the menu item
- *
- * @return menu item located at the specified index in the menu
- */
- public JMenuItem getItem(int index)
- {
- if (index < 0)
- throw new IllegalArgumentException("index less than 0");
-
- Component c = popupMenu.getComponentAtIndex(index);
-
- if (c instanceof JMenuItem)
- return (JMenuItem) c;
- else
- return null;
- }
-
- /**
- * Returns number of items in the menu including separators.
- *
- * @return number of items in the menu
- *
- * @see #getMenuComponentCount()
- */
- public int getItemCount()
- {
- return getMenuComponentCount();
- }
-
- /**
- * Checks if this menu is a tear-off menu.
- *
- * @return true if this menu is a tear-off menu and false otherwise
- */
- public boolean isTearOff()
- {
- // NOT YET IMPLEMENTED
- return false;
- }
-
- /**
- * Returns number of menu components in this menu
- *
- * @return number of menu components in this menu
- */
- public int getMenuComponentCount()
- {
- return popupMenu.getComponentCount();
- }
-
- /**
- * Returns menu component located at the givent index
- * in the menu
- *
- * @param index index at which to get the menu component in the menu
- *
- * @return Menu Component located in the menu at the specified index
- */
- public Component getMenuComponent(int index)
- {
- return (Component) popupMenu.getComponentAtIndex(index);
- }
-
- /**
- * Return components belonging to this menu
- *
- * @return components belonging to this menu
- */
- public Component[] getMenuComponents()
- {
- return popupMenu.getComponents();
- }
-
- /**
- * Checks if this menu is a top level menu. The menu is top
- * level menu if it is inside the menu bar. While if the menu
- * inside some other menu, it is considered to be a pull-right menu.
- *
- * @return true if this menu is top level menu, and false otherwise
- */
- public boolean isTopLevelMenu()
- {
- return getParent() instanceof JMenuBar;
- }
-
- /**
- * Checks if given component exists in this menu. The submenus of
- * this menu are checked as well
- *
- * @param component Component to look for
- *
- * @return true if the given component exists in this menu, and false otherwise
- */
- public boolean isMenuComponent(Component component)
- {
- return false;
- }
-
- /**
- * Returns popup menu associated with the menu.
- *
- * @return popup menu associated with the menu.
- */
- public JPopupMenu getPopupMenu()
- {
- return popupMenu;
- }
-
- /**
- * Adds MenuListener to the menu
- *
- * @param listener MenuListener to add
- */
- public void addMenuListener(MenuListener listener)
- {
- listenerList.add(MenuListener.class, listener);
- }
-
- /**
- * Removes MenuListener from the menu
- *
- * @param listener MenuListener to remove
- */
- public void removeMenuListener(MenuListener listener)
- {
- listenerList.remove(MenuListener.class, listener);
- }
-
- /**
- * Returns all registered <code>MenuListener</code> objects.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public MenuListener[] getMenuListeners()
- {
- return (MenuListener[]) listenerList.getListeners(MenuListener.class);
- }
-
- /**
- * This method fires MenuEvents to all menu's MenuListeners. In this case
- * menuSelected() method of MenuListeners is called to indicated that the menu
- * was selected.
- */
- protected void fireMenuSelected()
- {
- MenuListener[] listeners = getMenuListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].menuSelected(menuEvent);
- }
-
- /**
- * This method fires MenuEvents to all menu's MenuListeners. In this case
- * menuDeselected() method of MenuListeners is called to indicated that the menu
- * was deselected.
- */
- protected void fireMenuDeselected()
- {
- EventListener[] ll = listenerList.getListeners(MenuListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((MenuListener) ll[i]).menuDeselected(menuEvent);
- }
-
- /**
- * This method fires MenuEvents to all menu's MenuListeners. In this case
- * menuSelected() method of MenuListeners is called to indicated that the menu
- * was cancelled. The menu is cancelled when it's popup menu is close without selection.
- */
- protected void fireMenuCanceled()
- {
- EventListener[] ll = listenerList.getListeners(MenuListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((MenuListener) ll[i]).menuCanceled(menuEvent);
- }
-
- /**
- * Creates WinListener that listens to the menu;s popup menu.
- *
- * @param popup JPopupMenu to listen to
- *
- * @return The WinListener
- */
- protected WinListener createWinListener(JPopupMenu popup)
- {
- return new WinListener(popup);
- }
-
- /**
- * Method of the MenuElementInterface. It reacts to the selection
- * changes in the menu. If this menu was selected, then it
- * displayes popup menu associated with it and if this menu was
- * deselected it hides the popup menu.
- *
- * @param changed true if the menu was selected and false otherwise
- */
- public void menuSelectionChanged(boolean changed)
- {
- // if this menu selection is true, then activate this menu and
- // display popup associated with this menu
- setSelected(changed);
- }
-
- /**
- * Method of MenuElement interface. Returns sub components of
- * this menu.
- *
- * @return array containing popupMenu that is associated with this menu
- */
- public MenuElement[] getSubElements()
- {
- return new MenuElement[] { popupMenu };
- }
-
- /**
- * @return Returns reference to itself
- */
- public Component getComponent()
- {
- return this;
- }
-
- /**
- * This method is overriden with empty implementation, s.t the
- * accelerator couldn't be set for the menu. The mnemonic should
- * be used for the menu instead.
- *
- * @param keystroke accelerator for this menu
- */
- public void setAccelerator(KeyStroke keystroke)
- {
- throw new Error("setAccelerator() is not defined for JMenu. Use setMnemonic() instead.");
- }
-
- /**
- * This method process KeyEvent occuring when the menu is visible
- *
- * @param event The KeyEvent
- */
- protected void processKeyEvent(KeyEvent event)
- {
- }
-
- /**
- * Programatically performs click
- *
- * @param time Number of milliseconds for which this menu stays pressed
- */
- public void doClick(int time)
- {
- getModel().setArmed(true);
- getModel().setPressed(true);
- try
- {
- java.lang.Thread.sleep(time);
- }
- catch (java.lang.InterruptedException e)
- {
- // probably harmless
- }
-
- getModel().setPressed(false);
- getModel().setArmed(false);
- popupMenu.show(this, this.getWidth(), 0);
- }
-
- /**
- * A string that describes this JMenu. Normally only used
- * for debugging.
- *
- * @return A string describing this JMenu
- */
- protected String paramString()
- {
- return super.paramString();
- }
-
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJMenu();
-
- return accessibleContext;
- }
-
- protected class AccessibleJMenu extends AccessibleJMenuItem
- implements AccessibleSelection
- {
- protected AccessibleJMenu()
- {
- }
-
- public int getAccessibleChildrenCount()
- {
- return 0;
- }
-
- public Accessible getAccessibleChild(int value0)
- {
- return null;
- }
-
- public AccessibleSelection getAccessibleSelection()
- {
- return null;
- }
-
- public Accessible getAccessibleSelection(int value0)
- {
- return null;
- }
-
- public boolean isAccessibleChildSelected(int value0)
- {
- return false;
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.MENU;
- }
-
- public int getAccessibleSelectionCount()
- {
- return 0;
- }
-
- public void addAccessibleSelection(int value0)
- {
- }
-
- public void removeAccessibleSelection(int value0)
- {
- }
-
- public void clearAccessibleSelection()
- {
- }
-
- public void selectAllAccessibleSelection()
- {
- }
- }
-
- protected class WinListener extends WindowAdapter implements Serializable
- {
- JPopupMenu popupMenu;
- private static final long serialVersionUID = -6415815570638474823L;
-
- public WinListener(JPopupMenu popup)
- {
- }
-
- public void windowClosing(WindowEvent event)
- {
- }
- }
-
- /**
- * This class listens to PropertyChangeEvents occuring in menu's action
- */
- protected class ActionChangedListener implements PropertyChangeListener
- {
- /** menu item associated with the action */
- private JMenuItem menuItem;
-
- /** Creates new ActionChangedListener and adds it to menuItem's action */
- public ActionChangedListener(JMenuItem menuItem)
- {
- this.menuItem = menuItem;
-
- Action a = menuItem.getAction();
- if (a != null)
- a.addPropertyChangeListener(this);
- }
-
- /**This method is invoked when some change occures in menuItem's action*/
- public void propertyChange(PropertyChangeEvent evt)
- {
- // FIXME: Need to implement
- }
- }
-}
diff --git a/libjava/javax/swing/JMenuBar.java b/libjava/javax/swing/JMenuBar.java
deleted file mode 100644
index a464fff9bae..00000000000
--- a/libjava/javax/swing/JMenuBar.java
+++ /dev/null
@@ -1,459 +0,0 @@
-/* JMenuBar.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.swing.plaf.MenuBarUI;
-
-/**
- * JMenuBar is a container for menu's. For a menu bar to be seen on the
- * screen, at least one menu should be added to it. Just like adding
- * components to container, one can use add() to add menu's to the menu bar.
- * Menu's will be displayed in the menu bar in the order they were added.
- * The JMenuBar uses selectionModel to keep track of selected menu index.
- * JMenuBar's selectionModel will fire ChangeEvents to its registered
- * listeners when the selected index changes.
- */
-public class JMenuBar extends JComponent implements Accessible, MenuElement
-{
- private static final long serialVersionUID = -8191026883931977036L;
-
- /** JMenuBar's model. It keeps track of selected menu's index */
- private transient SingleSelectionModel selectionModel;
-
- /* borderPainted property indicating if the menuBar's border will be painted*/
- private boolean borderPainted;
-
- /* margin between menu bar's border and its menues*/
- private Insets margin;
-
- /**
- * Creates a new JMenuBar object.
- */
- public JMenuBar()
- {
- selectionModel = new DefaultSingleSelectionModel();
- borderPainted = true;
- updateUI();
- }
-
- /**
- * Adds menu to the menu bar
- *
- * @param c menu to add
- *
- * @return reference to the added menu
- */
- public JMenu add(JMenu c)
- {
- c.setAlignmentX(Component.LEFT_ALIGNMENT);
- super.add(c);
- return c;
- }
-
- /**
- * This method overrides addNotify() in the Container to register
- * this menu bar with the current keyboard manager.
- */
- public void addNotify()
- {
- // FIXME: Should register this menu bar with the keyboard manager
- super.addNotify();
- }
-
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
- /**
- * Returns reference to this menu bar
- *
- * @return reference to this menu bar
- */
- public Component getComponent()
- {
- return this;
- }
-
- /**
- * Returns component at the specified index.
- *
- * @param i index of the component to get
- *
- * @return component at the specified index. Null is returned if
- * component at the specified index doesn't exist.
- * @deprecated Replaced by getComponent(int)
- */
- public Component getComponentAtIndex(int i)
- {
- return getComponent(i);
- }
-
- /**
- * Returns index of the specified component
- *
- * @param c Component to search for
- *
- * @return index of the specified component. -1 is returned if
- * specified component doesnt' exist in the menu bar.
- */
- public int getComponentIndex(Component c)
- {
- Component[] comps = getComponents();
-
- int index = -1;
-
- for (int i = 0; i < comps.length; i++)
- {
- if (comps[i].equals(c))
- {
- index = i;
- break;
- }
- }
-
- return index;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public JMenu getHelpMenu()
- {
- return null;
- }
-
- /**
- * Returns margin betweeen menu bar's border and its menues
- *
- * @return margin between menu bar's border and its menues
- */
- public Insets getMargin()
- {
- if (margin == null)
- return new Insets(0, 0, 0, 0);
- else
- return margin;
- }
-
- /**
- * Return menu at the specified index. If component at the
- * specified index is not a menu, then null is returned.
- *
- * @param index index to look for the menu
- *
- * @return menu at specified index, or null if menu doesn't exist
- * at the specified index.
- */
- public JMenu getMenu(int index)
- {
- if (getComponentAtIndex(index) instanceof JMenu)
- return (JMenu) getComponentAtIndex(index);
- else
- return null;
- }
-
- /**
- * Returns number of menu's in this menu bar
- *
- * @return number of menu's in this menu bar
- */
- public int getMenuCount()
- {
- return getComponentCount();
- }
-
- /**
- * Returns selection model for this menu bar. SelectionModel
- * keeps track of the selected menu in the menu bar. Whenever
- * selected property of selectionModel changes, the ChangeEvent
- * will be fired its ChangeListeners.
- *
- * @return selection model for this menu bar.
- */
- public SingleSelectionModel getSelectionModel()
- {
- return selectionModel;
- }
-
- /**
- * Method of MenuElement interface. It returns subcomponents
- * of the menu bar, which are all the menues that it contains.
- *
- * @return MenuElement[] array containing menues in this menu bar
- */
- public MenuElement[] getSubElements()
- {
- MenuElement[] subElements = new MenuElement[getComponentCount()];
-
- for (int i = 0; i < getComponentCount(); i++)
- subElements[i] = (MenuElement) getMenu(i);
-
- return subElements;
- }
-
- /**
- * Set the "UI" property of the menu bar, which is a look and feel class
- * responsible for handling the menuBar's input events and painting it.
- *
- * @return The current "UI" property
- */
- public MenuBarUI getUI()
- {
- return (MenuBarUI) ui;
- }
-
- /**
- * This method returns a name to identify which look and feel class will be
- * the UI delegate for the menu bar.
- *
- * @return The Look and Feel classID. "MenuItemUI"
- */
- public String getUIClassID()
- {
- return "MenuBarUI";
- }
-
- /**
- * Returns true if menu bar paints its border and false otherwise
- *
- * @return true if menu bar paints its border and false otherwise
- */
- public boolean isBorderPainted()
- {
- return borderPainted;
- }
-
- /**
- * Returns true if some menu in menu bar is selected.
- *
- * @return true if some menu in menu bar is selected and false otherwise
- */
- public boolean isSelected()
- {
- return selectionModel.isSelected();
- }
-
- /**
- * This method does nothing by default. This method is need for the
- * MenuElement interface to be implemented.
- *
- * @param isIncluded true if menuBar is included in the selection
- * and false otherwise
- */
- public void menuSelectionChanged(boolean isIncluded)
- {
- // Do nothing - needed for implementation of MenuElement interface
- }
-
- /**
- * Paints border of the menu bar, if its borderPainted property is set to
- * true.
- *
- * @param g The graphics context with which to paint the border
- */
- protected void paintBorder(Graphics g)
- {
- if (borderPainted)
- getBorder().paintBorder(this, g, 0, 0, getSize(null).width,
- getSize(null).height);
- }
-
- /**
- * A string that describes this JMenuBar. Normally only used
- * for debugging.
- *
- * @return A string describing this JMenuBar
- */
- protected String paramString()
- {
- StringBuffer sb = new StringBuffer();
- sb.append(super.paramString());
- sb.append(",margin=");
- if (getMargin() != null)
- sb.append(getMargin());
- sb.append(",paintBorder=").append(isBorderPainted());
- return sb.toString();
- }
-
- /**
- * Process key events forwarded from MenuSelectionManager. This method
- * doesn't do anything. It is here to conform to the MenuElement interface.
- *
- * @param event event forwarded from MenuSelectionManager
- * @param path path to the menu element from which event was generated
- * @param manager MenuSelectionManager for the current menu hierarchy
- *
- */
- public void processKeyEvent(KeyEvent e, MenuElement[] path,
- MenuSelectionManager manager)
- {
- // Do nothing - needed for implementation of MenuElement interface
- }
-
- /**
- * Process mouse events forwarded from MenuSelectionManager. This method
- * doesn't do anything. It is here to conform to the MenuElement interface.
- *
- * @param event event forwarded from MenuSelectionManager
- * @param path path to the menu element from which event was generated
- * @param manager MenuSelectionManager for the current menu hierarchy
- *
- */
- public void processMouseEvent(MouseEvent event, MenuElement[] path,
- MenuSelectionManager manager)
- {
- // Do nothing - needed for implementation of MenuElement interface
- }
-
- /**
- * This method overrides removeNotify() in the Container to
- * unregister this menu bar from the current keyboard manager.
- */
- public void removeNotify()
- {
- // Must unregister this menu bar with the current keyboard manager.
- super.removeNotify();
- }
-
- /**
- * Sets painting status of the border. If 'b' is true then menu bar's
- * border will be painted, and it will not be painted otherwise.
- *
- * @param b indicates if menu bar's border should be painted.
- */
- public void setBorderPainted(boolean b)
- {
- if (b != borderPainted)
- {
- boolean old = borderPainted;
- borderPainted = b;
- firePropertyChange("borderPainted", old, b);
- revalidate();
- repaint();
- }
- }
-
- /**
- * Sets help menu for this menu bar
- *
- * @param menu help menu
- */
- public void setHelpMenu(JMenu menu)
- {
- }
-
- /**
- * Sets the menu bar's "margin" bound property, which represents
- * distance between the menubar's border and its menus.
- * icon. When marging property is modified, PropertyChangeEvent will
- * be fired to menuBar's PropertyChangeListener's.
- *
- * @param m distance between the menubar's border and its menus.
- *
- */
- public void setMargin(Insets m)
- {
- if (m != margin)
- {
- Insets oldMargin = margin;
- margin = m;
- firePropertyChange("margin", oldMargin, margin);
- }
- }
-
- /**
- * Changes menu bar's selection to the specified menu.
- * This method updates selected index of menu bar's selection model,
- * which results in a model firing change event.
- *
- * @param sel menu to select
- */
- public void setSelected(Component sel)
- {
- int index = getComponentIndex(sel);
- selectionModel.setSelectedIndex(index);
- }
-
- /**
- * Sets menuBar's selection model to the one specified
- *
- * @param model SingleSelectionModel that needs to be set for this menu bar
- */
- public void setSelectionModel(SingleSelectionModel model)
- {
- if (selectionModel != model)
- {
- SingleSelectionModel oldModel = selectionModel;
- selectionModel = model;
- firePropertyChange("model", oldModel, selectionModel);
- }
- }
-
- /**
- * Set the "UI" property of the menu bar, which is a look and feel class
- * responsible for handling menuBar's input events and painting it.
- *
- * @param ui The new "UI" property
- */
- public void setUI(MenuBarUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * Set the "UI" property to a class constructed, via the {@link
- * UIManager}, from the current look and feel.
- */
- public void updateUI()
- {
- setUI((MenuBarUI) UIManager.getUI(this));
- invalidate();
- }
-}
diff --git a/libjava/javax/swing/JMenuItem.java b/libjava/javax/swing/JMenuItem.java
deleted file mode 100644
index 8b912edac51..00000000000
--- a/libjava/javax/swing/JMenuItem.java
+++ /dev/null
@@ -1,674 +0,0 @@
-/* JMenuItem.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.EventListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.MenuDragMouseEvent;
-import javax.swing.event.MenuDragMouseListener;
-import javax.swing.event.MenuKeyEvent;
-import javax.swing.event.MenuKeyListener;
-import javax.swing.plaf.MenuItemUI;
-
-/**
- * JMenuItem represents element in the menu. It inherits most of
- * its functionality from AbstractButton, however its behavior somewhat
- * varies from it. JMenuItem fire different kinds of events.
- * PropertyChangeEvents are fired when menuItems properties are modified;
- * ChangeEvents are fired when menuItem's state changes and actionEvents are
- * fired when menu item is selected. In addition to this events menuItem also
- * fire MenuDragMouseEvent and MenuKeyEvents when mouse is dragged over
- * the menu item or associated key with menu item is invoked respectively.
- */
-public class JMenuItem extends AbstractButton implements Accessible,
- MenuElement
-{
- private static final long serialVersionUID = -1681004643499461044L;
-
- /** Combination of keyboard keys that can be used to activate this menu item */
- private KeyStroke accelerator;
-
- /**
- * Creates a new JMenuItem object.
- */
- public JMenuItem()
- {
- super(null, null);
- }
-
- /**
- * Creates a new JMenuItem with the given icon.
- *
- * @param icon Icon that will be displayed on the menu item
- */
- public JMenuItem(Icon icon)
- {
- // FIXME: The requestedFocusEnabled property should
- // be set to false, when only icon is set for menu item.
- super(null, icon);
- }
-
- /**
- * Creates a new JMenuItem with the given label.
- *
- * @param text label for the menu item
- */
- public JMenuItem(String text)
- {
- super(text, null);
- }
-
- /**
- * Creates a new JMenuItem associated with the specified action.
- *
- * @param action action for this menu item
- */
- public JMenuItem(Action action)
- {
- super(null, null);
- super.setAction(action);
- }
-
- /**
- * Creates a new JMenuItem with specified text and icon.
- * Text is displayed to the left of icon by default.
- *
- * @param text label for this menu item
- * @param icon icon that will be displayed on this menu item
- */
- public JMenuItem(String text, Icon icon)
- {
- super(text, icon);
- }
-
- /**
- * Creates a new JMenuItem object.
- *
- * @param text label for this menu item
- * @param mnemonic - Single key that can be used with a
- * look-and-feel meta key to activate this menu item. However
- * menu item should be visible on the screen when mnemonic is used.
- */
- public JMenuItem(String text, int mnemonic)
- {
- super(text, null);
- setMnemonic(mnemonic);
- }
-
- private void readObject(ObjectInputStream stream)
- throws IOException, ClassNotFoundException
- {
- }
-
- private void writeObject(ObjectOutputStream stream) throws IOException
- {
- }
-
- /**
- * Initializes this menu item
- *
- * @param text label for this menu item
- * @param icon icon to be displayed for this menu item
- */
- protected void init(String text, Icon icon)
- {
- super.init(text, icon);
-
- // Initializes properties for this menu item, that are different
- // from Abstract button properties.
- /* NOTE: According to java specifications paint_border should be set to false,
- since menu item should not have a border. However running few java programs
- it seems that menu items and menues can have a border. Commenting
- out statement below for now. */
- //borderPainted = false;
- focusPainted = false;
- horizontalAlignment = JButton.LEFT;
- horizontalTextPosition = JButton.LEFT;
- }
-
- /**
- * Set the "UI" property of the menu item, which is a look and feel class
- * responsible for handling menuItem's input events and painting it.
- *
- * @param ui The new "UI" property
- */
- public void setUI(MenuItemUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method sets this menuItem's UI to the UIManager's default for the
- * current look and feel.
- */
- public void updateUI()
- {
- MenuItemUI mi = ((MenuItemUI) UIManager.getUI(this));
- setUI(mi);
- invalidate();
- }
-
- /**
- * This method returns a name to identify which look and feel class will be
- * the UI delegate for the menuItem.
- *
- * @return The Look and Feel classID. "MenuItemUI"
- */
- public String getUIClassID()
- {
- return "MenuItemUI";
- }
-
- /**
- * Returns true if button's model is armed and false otherwise. The
- * button model is armed if menu item has focus or it is selected.
- *
- * @return $boolean$ true if button's model is armed and false otherwise
- */
- public boolean isArmed()
- {
- return getModel().isArmed();
- }
-
- /**
- * Sets menuItem's "ARMED" property
- *
- * @param armed DOCUMENT ME!
- */
- public void setArmed(boolean armed)
- {
- getModel().setArmed(armed);
- }
-
- /**
- * Enable or disable menu item. When menu item is disabled,
- * its text and icon are grayed out if they exist.
- *
- * @param enabled if true enable menu item, and disable otherwise.
- */
- public void setEnabled(boolean enabled)
- {
- super.setEnabled(enabled);
- }
-
- /**
- * Return accelerator for this menu item.
- *
- * @return $KeyStroke$ accelerator for this menu item.
- */
- public KeyStroke getAccelerator()
- {
- return accelerator;
- }
-
- /**
- * Sets accelerator for this menu item.
- *
- * @param keystroke accelerator for this menu item.
- */
- public void setAccelerator(KeyStroke keystroke)
- {
- this.accelerator = keystroke;
- }
-
- /**
- * Configures menu items' properties from properties of the specified action.
- * This method overrides configurePropertiesFromAction from AbstractButton
- * to also set accelerator property.
- *
- * @param action action to configure properties from
- */
- protected void configurePropertiesFromAction(Action action)
- {
- super.configurePropertiesFromAction(action);
-
- if (! (this instanceof JMenu) && action != null)
- setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY)));
- }
-
- /**
- * Creates PropertyChangeListener to listen for the changes in action
- * properties.
- *
- * @param action action to listen to for property changes
- *
- * @return $PropertyChangeListener$ Listener that listens to changes in
- * action properties.
- */
- protected PropertyChangeListener createActionPropertyChangeListener(Action action)
- {
- return new PropertyChangeListener()
- {
- public void propertyChange(PropertyChangeEvent e)
- {
- Action act = (Action) (e.getSource());
- configurePropertiesFromAction(act);
- }
- };
- }
-
- /**
- * Process mouse events forwarded from MenuSelectionManager.
- *
- * @param event event forwarded from MenuSelectionManager
- * @param path path to the menu element from which event was generated
- * @param manager MenuSelectionManager for the current menu hierarchy
- */
- public void processMouseEvent(MouseEvent event, MenuElement[] path,
- MenuSelectionManager manager)
- {
- // Fire MenuDragMouseEvents if mouse is being dragged.
- boolean dragged
- = (event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0;
- if (dragged)
- processMenuDragMouseEvent(createMenuDragMouseEvent(event, path, manager));
-
- switch (event.getID())
- {
- case MouseEvent.MOUSE_CLICKED:
- break;
- case MouseEvent.MOUSE_ENTERED:
- if (isRolloverEnabled())
- model.setRollover(true);
- break;
- case MouseEvent.MOUSE_EXITED:
- if (isRolloverEnabled())
- model.setRollover(false);
-
- // for JMenu last element on the path is its popupMenu.
- // JMenu shouldn't me disarmed.
- if (! (path[path.length - 1] instanceof JPopupMenu) && ! dragged)
- setArmed(false);
- break;
- case MouseEvent.MOUSE_PRESSED:
- if ((event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0)
- {
- model.setArmed(true);
- model.setPressed(true);
- }
- break;
- case MouseEvent.MOUSE_RELEASED:
- break;
- case MouseEvent.MOUSE_MOVED:
- break;
- case MouseEvent.MOUSE_DRAGGED:
- break;
- }
- }
-
- /**
- * Creates MenuDragMouseEvent.
- *
- * @param event MouseEvent that occured while mouse was pressed.
- * @param path Path the the menu element where the dragging event was
- * originated
- * @param manager MenuSelectionManager for the current menu hierarchy.
- *
- * @return new MenuDragMouseEvent
- */
- private MenuDragMouseEvent createMenuDragMouseEvent(MouseEvent event,
- MenuElement[] path,
- MenuSelectionManager manager)
- {
- return new MenuDragMouseEvent((Component) event.getSource(),
- event.getID(), event.getWhen(),
- event.getModifiers(), event.getX(),
- event.getY(), event.getClickCount(),
- event.isPopupTrigger(), path, manager);
- }
-
- /**
- * Process key events forwarded from MenuSelectionManager.
- *
- * @param event event forwarded from MenuSelectionManager
- * @param path path to the menu element from which event was generated
- * @param manager MenuSelectionManager for the current menu hierarchy
- */
- public void processKeyEvent(KeyEvent event, MenuElement[] path,
- MenuSelectionManager manager)
- {
- // Need to implement.
- }
-
- /**
- * This method fires MenuDragMouseEvents to registered listeners.
- * Different types of MenuDragMouseEvents are fired depending
- * on the observed mouse event.
- *
- * @param event Mouse
- */
- public void processMenuDragMouseEvent(MenuDragMouseEvent event)
- {
- switch (event.getID())
- {
- case MouseEvent.MOUSE_ENTERED:
- fireMenuDragMouseEntered(event);
- break;
- case MouseEvent.MOUSE_EXITED:
- fireMenuDragMouseExited(event);
- break;
- case MouseEvent.MOUSE_DRAGGED:
- fireMenuDragMouseDragged(event);
- break;
- case MouseEvent.MOUSE_RELEASED:
- fireMenuDragMouseReleased(event);
- break;
- }
- }
-
- /**
- * This method fires MenuKeyEvent to registered listeners.
- * Different types of MenuKeyEvents are fired depending
- * on the observed key event.
- *
- * @param event DOCUMENT ME!
- */
- public void processMenuKeyEvent(MenuKeyEvent event)
- {
- // Need to implement.
- }
-
- /**
- * Fires MenuDragMouseEvent to all of the menuItem's MouseInputListeners.
- *
- * @param event The event signifying that mouse entered menuItem while it was dragged
- */
- protected void fireMenuDragMouseEntered(MenuDragMouseEvent event)
- {
- EventListener[] ll = listenerList.getListeners(MenuDragMouseListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((MenuDragMouseListener) ll[i]).menuDragMouseEntered(event);
- }
-
- /**
- * Fires MenuDragMouseEvent to all of the menuItem's MouseInputListeners.
- *
- * @param event The event signifying that mouse has exited menu item, while it was dragged
- */
- protected void fireMenuDragMouseExited(MenuDragMouseEvent event)
- {
- EventListener[] ll = listenerList.getListeners(MenuDragMouseListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((MenuDragMouseListener) ll[i]).menuDragMouseExited(event);
- }
-
- /**
- * Fires MenuDragMouseEvent to all of the menuItem's MouseInputListeners.
- *
- * @param event The event signifying that mouse is being dragged over the menuItem
- */
- protected void fireMenuDragMouseDragged(MenuDragMouseEvent event)
- {
- EventListener[] ll = listenerList.getListeners(MenuDragMouseListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((MenuDragMouseListener) ll[i]).menuDragMouseDragged(event);
- }
-
- /**
- * This method fires a MenuDragMouseEvent to all the MenuItem's MouseInputListeners.
- *
- * @param event The event signifying that mouse was released while it was dragged over the menuItem
- */
- protected void fireMenuDragMouseReleased(MenuDragMouseEvent event)
- {
- EventListener[] ll = listenerList.getListeners(MenuDragMouseListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((MenuDragMouseListener) ll[i]).menuDragMouseReleased(event);
- }
-
- /**
- * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
- *
- * @param event The event signifying that key associated with this menu was pressed
- */
- protected void fireMenuKeyPressed(MenuKeyEvent event)
- {
- EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((MenuKeyListener) ll[i]).menuKeyPressed(event);
- }
-
- /**
- * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
- *
- * @param event The event signifying that key associated with this menu was released
- */
- protected void fireMenuKeyReleased(MenuKeyEvent event)
- {
- EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((MenuKeyListener) ll[i]).menuKeyTyped(event);
- }
-
- /**
- * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
- *
- * @param event The event signifying that key associated with this menu was typed.
- * The key is typed when it was pressed and then released
- */
- protected void fireMenuKeyTyped(MenuKeyEvent event)
- {
- EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((MenuKeyListener) ll[i]).menuKeyTyped(event);
- }
-
- /**
- * Method of the MenuElement interface.
- * This method is invoked by MenuSelectionManager when selection of
- * this menu item has changed. If this menu item was selected then
- * arm it's model, and disarm the model otherwise. The menu item
- * is considered to be selected, and thus highlighted when its model
- * is armed.
- *
- * @param changed indicates selection status of this menu item. If changed is
- * true then menu item is selected and deselected otherwise.
- */
- public void menuSelectionChanged(boolean changed)
- {
- Component parent = this.getParent();
- if (changed)
- {
- model.setArmed(true);
-
- if (parent != null && parent instanceof JPopupMenu)
- ((JPopupMenu) parent).setSelected(this);
- }
- else
- {
- model.setArmed(false);
-
- if (parent != null && parent instanceof JPopupMenu)
- ((JPopupMenu) parent).getSelectionModel().clearSelection();
- }
- }
-
- /**
- * Method of the MenuElement interface.
- *
- * @return $MenuElement[]$ Returns array of sub-components for this menu
- * item. By default menuItem doesn't have any subcomponents and so
- * empty array is returned instead.
- */
- public MenuElement[] getSubElements()
- {
- return new MenuElement[0];
- }
-
- /**
- * Returns reference to the component that will paint this menu item.
- *
- * @return $Component$ Component that will paint this menu item.
- * Simply returns reference to this menu item.
- */
- public Component getComponent()
- {
- return this;
- }
-
- /**
- * Adds a MenuDragMouseListener to this menu item. When mouse
- * is dragged over the menu item the MenuDragMouseEvents will be
- * fired, and these listeners will be called.
- *
- * @param listener The new listener to add
- */
- public void addMenuDragMouseListener(MenuDragMouseListener listener)
- {
- listenerList.add(MenuDragMouseListener.class, listener);
- }
-
- /**
- * Removes a MenuDragMouseListener from the menuItem's listener list.
- *
- * @param listener The listener to remove
- */
- public void removeMenuDragMouseListener(MenuDragMouseListener listener)
- {
- listenerList.remove(MenuDragMouseListener.class, listener);
- }
-
- /**
- * Returns all added MenuDragMouseListener objects.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public MenuDragMouseListener[] getMenuDragMouseListeners()
- {
- return (MenuDragMouseListener[]) listenerList.getListeners(MenuDragMouseListener.class);
- }
-
- /**
- * Adds an MenuKeyListener to this menu item. This listener will be
- * invoked when MenuKeyEvents will be fired by this menu item.
- *
- * @param listener The new listener to add
- */
- public void addMenuKeyListener(MenuKeyListener listener)
- {
- listenerList.add(MenuKeyListener.class, listener);
- }
-
- /**
- * Removes an MenuKeyListener from the menuItem's listener list.
- *
- * @param listener The listener to remove
- */
- public void removeMenuKeyListener(MenuKeyListener listener)
- {
- listenerList.remove(MenuKeyListener.class, listener);
- }
-
- /**
- * Returns all added MenuKeyListener objects.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public MenuKeyListener[] getMenuKeyListeners()
- {
- return (MenuKeyListener[]) listenerList.getListeners(MenuKeyListener.class);
- }
-
- /**
- * A string that describes this JMenuItem. Normally only used
- * for debugging.
- *
- * @return A string describing this JMenuItem
- */
- protected String paramString()
- {
- return super.paramString();
- }
-
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJMenuItem();
-
- return accessibleContext;
- }
-
- protected class AccessibleJMenuItem extends AccessibleAbstractButton
- implements ChangeListener
- {
- private static final long serialVersionUID = 6748924232082076534L;
-
- /**
- * Creates a new AccessibleJMenuItem object.
- */
- AccessibleJMenuItem()
- {
- //super(component);
- }
-
- public void stateChanged(ChangeEvent event)
- {
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.MENU_ITEM;
- }
- }
-}
diff --git a/libjava/javax/swing/JOptionPane.java b/libjava/javax/swing/JOptionPane.java
deleted file mode 100644
index 88fa993be00..00000000000
--- a/libjava/javax/swing/JOptionPane.java
+++ /dev/null
@@ -1,1547 +0,0 @@
-/* JOptionPane.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Dimension;
-import java.awt.Frame;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.plaf.OptionPaneUI;
-
-/**
- * This class creates different types of JDialogs and JInternalFrames that can
- * ask users for input or pass on information. JOptionPane can be used by
- * calling one of the show static methods or by creating an instance of
- * JOptionPane and calling createDialog or createInternalFrame.
- */
-public class JOptionPane extends JComponent implements Accessible
-{
- /**
- * DOCUMENT ME!
- */
- protected class AccessibleJOptionPane extends JComponent.AccessibleJComponent
- {
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 686071432213084821L;
-
- /**
- * Creates a new AccessibleJOptionPane object.
- */
- protected AccessibleJOptionPane()
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleRole getAccessibleRole()
- {
- return null;
- }
- }
-
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 5231143276678566796L;
-
- /** The value returned when cancel option is selected. */
- public static final int CANCEL_OPTION = 2;
-
- /** The value returned when the dialog is closed without a selection. */
- public static final int CLOSED_OPTION = -1;
-
- /** An option used in confirmation dialog methods. */
- public static final int DEFAULT_OPTION = -1;
-
- /** The value returned when the no option is selected. */
- public static final int NO_OPTION = 1;
-
- /** An option used in confirmation dialog methods. */
- public static final int OK_CANCEL_OPTION = 2;
-
- /** The value returned when the ok option is selected. */
- public static final int OK_OPTION = 0;
-
- /** An option used in confirmation dialog methods. */
- public static final int YES_NO_CANCEL_OPTION = 1;
-
- /** An option used in confirmation dialog methods. */
- public static final int YES_NO_OPTION = 0;
-
- /** The value returned when the yes option is selected. */
- public static final int YES_OPTION = 0;
-
- /** Identifier for the error message type. */
- public static final int ERROR_MESSAGE = 0;
-
- /** Identifier for the information message type. */
- public static final int INFORMATION_MESSAGE = 1;
-
- /** Identifier for the plain message type. */
- public static final int PLAIN_MESSAGE = -1;
-
- /** Identifier for the question message type. */
- public static final int QUESTION_MESSAGE = 3;
-
- /** Identifier for the warning message type. */
- public static final int WARNING_MESSAGE = 2;
-
- /**
- * The identifier for the propertyChangeEvent when the icon property
- * changes.
- */
- public static final String ICON_PROPERTY = "icon";
-
- /**
- * The identifier for the propertyChangeEvent when the initialSelectionValue
- * property changes.
- */
- public static final String INITIAL_SELECTION_VALUE_PROPERTY = "initialSelectionValue";
-
- /**
- * The identifier for the propertyChangeEvent when the initialValue property
- * changes.
- */
- public static final String INITIAL_VALUE_PROPERTY = "initialValue";
-
- /**
- * The identifier for the propertyChangeEvent when the inputValue property
- * changes.
- */
- public static final String INPUT_VALUE_PROPERTY = "inputValue";
-
- /**
- * The identifier for the propertyChangeEvent when the message property
- * changes.
- */
- public static final String MESSAGE_PROPERTY = "message";
-
- /**
- * The identifier for the propertyChangeEvent when the messageType property
- * changes.
- */
- public static final String MESSAGE_TYPE_PROPERTY = "messageType";
-
- /**
- * The identifier for the propertyChangeEvent when the optionType property
- * changes.
- */
- public static final String OPTION_TYPE_PROPERTY = "optionType";
-
- /**
- * The identifier for the propertyChangeEvent when the options property
- * changes.
- */
- public static final String OPTIONS_PROPERTY = "options";
-
- /**
- * The identifier for the propertyChangeEvent when the selectionValues
- * property changes.
- */
- public static final String SELECTION_VALUES_PROPERTY = "selectionValues";
-
- /**
- * The identifier for the propertyChangeEvent when the value property
- * changes.
- */
- public static final String VALUE_PROPERTY = "value";
-
- /**
- * The identifier for the propertyChangeEvent when the wantsInput property
- * changes.
- */
- public static final String WANTS_INPUT_PROPERTY = "wantsInput";
-
- /** The value returned when the inputValue is uninitialized. */
- public static Object UNINITIALIZED_VALUE = "uninitializedValue";
-
- /** The icon displayed in the dialog/internal frame. */
- protected Icon icon;
-
- /** The initial selected value in the input component. */
- protected Object initialSelectionValue;
-
- /** The object that is initially selected for options. */
- protected Object initialValue;
-
- /** The value the user inputs. */
- protected Object inputValue = UNINITIALIZED_VALUE;
-
- /** The message displayed in the dialog/internal frame. */
- protected Object message;
-
- /** The type of message displayed. */
- protected int messageType = PLAIN_MESSAGE;
-
- /**
- * The options (usually buttons) aligned at the bottom for the user to
- * select.
- */
- protected Object[] options;
-
- /** The type of options to display. */
- protected int optionType = DEFAULT_OPTION;
-
- /** The input values the user can select. */
- protected Object[] selectionValues;
-
- /** The value returned by selecting an option. */
- protected Object value = UNINITIALIZED_VALUE;
-
- /** Whether the Dialog/InternalFrame needs input. */
- protected boolean wantsInput;
-
- /** The common frame used when no parent is provided. */
- private static Frame privFrame = SwingUtilities.getOwnerFrame();
-
- /**
- * Creates a new JOptionPane object using a message of "JOptionPane
- * message", using the PLAIN_MESSAGE type and DEFAULT_OPTION.
- */
- public JOptionPane()
- {
- this("JOptionPane message", PLAIN_MESSAGE, DEFAULT_OPTION, null, null, null);
- }
-
- /**
- * Creates a new JOptionPane object using the given message using the
- * PLAIN_MESSAGE type and DEFAULT_OPTION.
- *
- * @param message The message to display.
- */
- public JOptionPane(Object message)
- {
- this(message, PLAIN_MESSAGE, DEFAULT_OPTION, null, null, null);
- }
-
- /**
- * Creates a new JOptionPane object using the given message and messageType
- * and DEFAULT_OPTION.
- *
- * @param message The message to display.
- * @param messageType The type of message.
- */
- public JOptionPane(Object message, int messageType)
- {
- this(message, messageType, DEFAULT_OPTION, null, null, null);
- }
-
- /**
- * Creates a new JOptionPane object using the given message, messageType and
- * optionType.
- *
- * @param message The message to display.
- * @param messageType The type of message.
- * @param optionType The type of options.
- */
- public JOptionPane(Object message, int messageType, int optionType)
- {
- this(message, messageType, optionType, null, null, null);
- }
-
- /**
- * Creates a new JOptionPane object using the given message, messageType,
- * optionType and icon.
- *
- * @param message The message to display.
- * @param messageType The type of message.
- * @param optionType The type of options.
- * @param icon The icon to display.
- */
- public JOptionPane(Object message, int messageType, int optionType, Icon icon)
- {
- this(message, messageType, optionType, icon, null, null);
- }
-
- /**
- * Creates a new JOptionPane object using the given message, messageType,
- * optionType, icon and options.
- *
- * @param message The message to display.
- * @param messageType The type of message.
- * @param optionType The type of options.
- * @param icon The icon to display.
- * @param options The options given.
- */
- public JOptionPane(Object message, int messageType, int optionType,
- Icon icon, Object[] options)
- {
- this(message, messageType, optionType, icon, options, null);
- }
-
- /**
- * Creates a new JOptionPane object using the given message, messageType,
- * optionType, icon, options and initialValue. The initialValue will be
- * focused initially.
- *
- * @param message The message to display.
- * @param messageType The type of message.
- * @param optionType The type of options.
- * @param icon The icon to display.
- * @param options The options given.
- * @param initialValue The component to focus on initially.
- *
- * @throws IllegalArgumentException If the messageType or optionType are not
- * legal values.
- */
- public JOptionPane(Object message, int messageType, int optionType,
- Icon icon, Object[] options, Object initialValue)
- {
- this.message = message;
- if (! validMessageType(messageType))
- throw new IllegalArgumentException("Message Type not legal value.");
- this.messageType = messageType;
- if (! validOptionType(optionType))
- throw new IllegalArgumentException("Option Type not legal value.");
- this.optionType = optionType;
- this.icon = icon;
- this.options = options;
- this.initialValue = initialValue;
-
- setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
-
- updateUI();
- invalidate();
- repaint();
- }
-
- /**
- * This method creates a new JDialog that is either centered around the
- * parent's frame or centered on the screen (if the parent is null). The
- * JDialog will not be resizable and will be modal. Once the JDialog is
- * disposed, the inputValue and value properties will be set by the
- * optionPane.
- *
- * @param parentComponent The parent of the Dialog.
- * @param title The title in the bar of the JDialog.
- *
- * @return A new JDialog based on the JOptionPane configuration.
- */
- public JDialog createDialog(Component parentComponent, String title)
- {
- Frame toUse = getFrameForComponent(parentComponent);
- if (toUse == null)
- toUse = getRootFrame();
-
- JDialog dialog = new JDialog(toUse, title);
- inputValue = UNINITIALIZED_VALUE;
- value = UNINITIALIZED_VALUE;
-
- // FIXME: This dialog should be centered on the parent
- // or at the center of the screen (if the parent is null)
- // Need getGraphicsConfiguration to return non-null in
- // order for that to work so we know how large the
- // screen is.
- dialog.getContentPane().add(this);
- dialog.setModal(true);
- dialog.setResizable(false);
- dialog.invalidate();
- dialog.repaint();
-
- return dialog;
- }
-
- /**
- * This method creates a new JInternalFrame that is in the JDesktopPane
- * which contains the parentComponent given. If no suitable JDesktopPane
- * can be found from the parentComponent given, a RuntimeException will be
- * thrown.
- *
- * @param parentComponent The parent to find a JDesktopPane from.
- * @param title The title of the JInternalFrame.
- *
- * @return A new JInternalFrame based on the JOptionPane configuration.
- *
- * @throws RuntimeException If no suitable JDesktopPane is found.
- */
- public JInternalFrame createInternalFrame(Component parentComponent,
- String title)
- throws RuntimeException
- {
- JDesktopPane toUse = getDesktopPaneForComponent(parentComponent);
- if (toUse == null)
- throw new RuntimeException("parentComponent does not have a valid parent");
-
- JInternalFrame frame = new JInternalFrame(title);
-
- inputValue = UNINITIALIZED_VALUE;
- value = UNINITIALIZED_VALUE;
-
- frame.setClosable(true);
- toUse.add(frame);
-
- // FIXME: JLayeredPane broken? See bug # 16576
- // frame.setLayer(JLayeredPane.MODAL_LAYER);
- return frame;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJOptionPane();
- return accessibleContext;
- }
-
- /**
- * This method returns the JDesktopPane for the given parentComponent or
- * null if none can be found.
- *
- * @param parentComponent The component to look in.
- *
- * @return The JDesktopPane for the given component or null if none can be
- * found.
- */
- public static JDesktopPane getDesktopPaneForComponent(Component parentComponent)
- {
- return (JDesktopPane) SwingUtilities.getAncestorOfClass(JDesktopPane.class,
- parentComponent);
- }
-
- /**
- * This method returns the Frame for the given parentComponent or null if
- * none can be found.
- *
- * @param parentComponent The component to look in.
- *
- * @return The Frame for the given component or null if none can be found.
- */
- public static Frame getFrameForComponent(Component parentComponent)
- {
- return (Frame) SwingUtilities.getAncestorOfClass(Frame.class,
- parentComponent);
- }
-
- /**
- * This method returns the icon displayed.
- *
- * @return The icon displayed.
- */
- public Icon getIcon()
- {
- return icon;
- }
-
- /**
- * This method returns the value initially selected from the list of values
- * the user can input.
- *
- * @return The initial selection value.
- */
- public Object getInitialSelectionValue()
- {
- return initialSelectionValue;
- }
-
- /**
- * This method returns the value that is focused from the list of options.
- *
- * @return The initial value from options.
- */
- public Object getInitialValue()
- {
- return initialValue;
- }
-
- /**
- * This method returns the value that the user input.
- *
- * @return The user's input value.
- */
- public Object getInputValue()
- {
- return inputValue;
- }
-
- /**
- * This method returns the maximum characters per line. By default, this is
- * Integer.MAX_VALUE.
- *
- * @return The maximum characters per line.
- */
- public int getMaxCharactersPerLineCount()
- {
- return Integer.MAX_VALUE;
- }
-
- /**
- * This method returns the message displayed.
- *
- * @return The message displayed.
- */
- public Object getMessage()
- {
- return message;
- }
-
- /**
- * This method returns the message type.
- *
- * @return The message type.
- */
- public int getMessageType()
- {
- return messageType;
- }
-
- /**
- * This method returns the options.
- *
- * @return The options.
- */
- public Object[] getOptions()
- {
- return options;
- }
-
- /**
- * This method returns the option type.
- *
- * @return The option type.
- */
- public int getOptionType()
- {
- return optionType;
- }
-
- /**
- * This method returns the Frame used by JOptionPane dialog's that have no
- * parent.
- *
- * @return The Frame used by dialogs that have no parent.
- */
- public static Frame getRootFrame()
- {
- return privFrame;
- }
-
- /**
- * This method returns the selection values.
- *
- * @return The selection values.
- */
- public Object[] getSelectionValues()
- {
- return selectionValues;
- }
-
- /**
- * This method returns the UI used by the JOptionPane.
- *
- * @return The UI used by the JOptionPane.
- */
- public OptionPaneUI getUI()
- {
- return (OptionPaneUI) ui;
- }
-
- /**
- * This method returns an identifier to determine which UI class will act as
- * the UI.
- *
- * @return The UI identifier.
- */
- public String getUIClassID()
- {
- return "OptionPaneUI";
- }
-
- /**
- * This method returns the value that the user selected out of options.
- *
- * @return The value that the user selected out of options.
- */
- public Object getValue()
- {
- return value;
- }
-
- /**
- * This method returns whether this JOptionPane wants input.
- *
- * @return Whether this JOptionPane wants input.
- */
- public boolean getWantsInput()
- {
- return wantsInput;
- }
-
- /**
- * This method returns a String that describes this JOptionPane.
- *
- * @return A String that describes this JOptionPane.
- */
- protected String paramString()
- {
- return "JOptionPane";
- }
-
- /**
- * This method requests focus for the initial value.
- */
- public void selectInitialValue()
- {
- if (ui != null)
- ((OptionPaneUI) ui).selectInitialValue(this);
- }
-
- /**
- * This method changes the icon property.
- *
- * @param newIcon The new icon to use.
- */
- public void setIcon(Icon newIcon)
- {
- if (icon != newIcon)
- {
- Icon old = icon;
- icon = newIcon;
- firePropertyChange(ICON_PROPERTY, old, icon);
- }
- }
-
- /**
- * This method changes the initial selection property.
- *
- * @param newValue The new initial selection.
- */
- public void setInitialSelectionValue(Object newValue)
- {
- if (initialSelectionValue != newValue)
- {
- Object old = initialSelectionValue;
- initialSelectionValue = newValue;
- firePropertyChange(INITIAL_SELECTION_VALUE_PROPERTY, old,
- initialSelectionValue);
- }
- }
-
- /**
- * This method changes the initial value property.
- *
- * @param newValue The new initial value.
- */
- public void setInitialValue(Object newValue)
- {
- if (initialValue != newValue)
- {
- Object old = initialValue;
- initialValue = newValue;
- firePropertyChange(INITIAL_VALUE_PROPERTY, old, initialValue);
- }
- }
-
- /**
- * This method changes the inputValue property.
- *
- * @param newValue The new inputValue.
- */
- public void setInputValue(Object newValue)
- {
- if (inputValue != newValue)
- {
- Object old = inputValue;
- inputValue = newValue;
- firePropertyChange(INPUT_VALUE_PROPERTY, old, inputValue);
- }
- }
-
- /**
- * This method changes the message property.
- *
- * @param newMessage The new message.
- */
- public void setMessage(Object newMessage)
- {
- if (message != newMessage)
- {
- Object old = message;
- message = newMessage;
- firePropertyChange(MESSAGE_PROPERTY, old, message);
- }
- }
-
- /**
- * This method changes the messageType property.
- *
- * @param newType The new messageType.
- *
- * @throws IllegalArgumentException If the messageType is not valid.
- */
- public void setMessageType(int newType)
- {
- if (! validMessageType(newType))
- throw new IllegalArgumentException("Message Type not legal value.");
- if (newType != messageType)
- {
- int old = messageType;
- messageType = newType;
- firePropertyChange(MESSAGE_TYPE_PROPERTY, old, messageType);
- }
- }
-
- /**
- * This method changes the options property.
- *
- * @param newOptions The new options.
- */
- public void setOptions(Object[] newOptions)
- {
- if (options != newOptions)
- {
- Object[] old = options;
- options = newOptions;
- firePropertyChange(OPTIONS_PROPERTY, old, options);
- }
- }
-
- /**
- * This method changes the optionType property.
- *
- * @param newType The new optionType.
- *
- * @throws IllegalArgumentException If the optionType is not valid.
- */
- public void setOptionType(int newType)
- {
- if (! validOptionType(newType))
- throw new IllegalArgumentException("Option Type not legal value.");
- if (newType != optionType)
- {
- int old = optionType;
- optionType = newType;
- firePropertyChange(OPTION_TYPE_PROPERTY, old, optionType);
- }
- }
-
- /**
- * This method changes the Frame used for JOptionPane dialogs that have no
- * parent.
- *
- * @param newRootFrame The Frame to use for dialogs that have no parent.
- */
- public static void setRootFrame(Frame newRootFrame)
- {
- privFrame = newRootFrame;
- }
-
- /**
- * This method changes the selectionValues property.
- *
- * @param newValues The new selectionValues.
- */
- public void setSelectionValues(Object[] newValues)
- {
- if (newValues != selectionValues)
- {
- if (newValues != null)
- wantsInput = true;
- Object[] old = selectionValues;
- selectionValues = newValues;
- firePropertyChange(SELECTION_VALUES_PROPERTY, old, selectionValues);
- }
- }
-
- /**
- * This method sets the UI used with the JOptionPane.
- *
- * @param ui The UI used with the JOptionPane.
- */
- public void setUI(OptionPaneUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method sets the value has been selected out of options.
- *
- * @param newValue The value that has been selected out of options.
- */
- public void setValue(Object newValue)
- {
- if (value != newValue)
- {
- Object old = value;
- value = newValue;
- firePropertyChange(VALUE_PROPERTY, old, value);
- }
- }
-
- /**
- * This method changes the wantsInput property.
- *
- * @param newValue Whether this JOptionPane requires input.
- */
- public void setWantsInput(boolean newValue)
- {
- if (wantsInput != newValue)
- {
- boolean old = wantsInput;
- wantsInput = newValue;
- firePropertyChange(WANTS_INPUT_PROPERTY, old, wantsInput);
- }
- }
-
- /**
- * This method shows a confirmation dialog with the title "Select an Option"
- * and displays the given message. The parent frame will be the same as the
- * parent frame of the given parentComponent. This method returns the
- * option chosen by the user.
- *
- * @param parentComponent The parentComponent to find a frame in.
- * @param message The message to display.
- *
- * @return The option that was selected.
- */
- public static int showConfirmDialog(Component parentComponent, Object message)
- {
- JOptionPane pane = new JOptionPane(message);
- JDialog dialog = pane.createDialog(parentComponent, "Select an Option");
-
- dialog.pack();
- dialog.show();
-
- return ((Integer) pane.getValue()).intValue();
- }
-
- /**
- * This method shows a confirmation dialog with the given message,
- * optionType and title. The frame that owns the dialog will be the same
- * frame that holds the given parentComponent. This method returns the
- * option that was chosen.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message displayed.
- * @param title The title of the dialog.
- * @param optionType The optionType.
- *
- * @return The option that was chosen.
- */
- public static int showConfirmDialog(Component parentComponent,
- Object message, String title,
- int optionType)
- {
- JOptionPane pane = new JOptionPane(message, PLAIN_MESSAGE, optionType);
- JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
- dialog.show();
-
- return ((Integer) pane.getValue()).intValue();
- }
-
- /**
- * This method shows a confirmation dialog with the given message, title,
- * messageType and optionType. The frame owner will be the same frame as
- * the one that holds the given parentComponent. This method returns the
- * option selected by the user.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message displayed.
- * @param title The title of the dialog.
- * @param optionType The optionType.
- * @param messageType The messageType.
- *
- * @return The selected option.
- */
- public static int showConfirmDialog(Component parentComponent,
- Object message, String title,
- int optionType, int messageType)
- {
- JOptionPane pane = new JOptionPane(message, messageType, optionType);
- JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
- dialog.show();
-
- return ((Integer) pane.getValue()).intValue();
- }
-
- /**
- * This method shows a confirmation dialog with the given message, title,
- * optionType, messageType and icon. The frame owner will be the same as
- * the one that holds the given parentComponent. This method returns the
- * option selected by the user.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message displayed.
- * @param title The title of the dialog.
- * @param optionType The optionType.
- * @param messageType The messsageType.
- * @param icon The icon displayed.
- *
- * @return The selected option.
- */
- public static int showConfirmDialog(Component parentComponent,
- Object message, String title,
- int optionType, int messageType,
- Icon icon)
- {
- JOptionPane pane = new JOptionPane(message, messageType, optionType, icon);
- JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
- dialog.show();
-
- return ((Integer) pane.getValue()).intValue();
- }
-
- /**
- * This method will show a QUESTION_MESSAGE input dialog with the given
- * message. No selectionValues is set so the Look and Feel will usually
- * give the user a TextField to fill out. The frame owner will be the same
- * frame that holds the given parentComponent. This method will return the
- * value entered by the user.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message displayed.
- *
- * @return The value entered by the user.
- */
- public static String showInputDialog(Component parentComponent,
- Object message)
- {
- JOptionPane pane = new JOptionPane(message, QUESTION_MESSAGE);
- pane.setWantsInput(true);
- JDialog dialog = pane.createDialog(parentComponent, null);
- dialog.pack();
- dialog.show();
-
- return (String) pane.getInputValue();
- }
-
- /**
- * This method will show a QUESTION_MESSAGE type input dialog with the given
- * message and initialSelectionValue. Since there is no selectionValues
- * set, the Look and Feel will usually give a TextField to fill out. The
- * frame owner will be the same as the one that holds the given
- * parentComponent. This method will return the value entered by the user.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message to display.
- * @param initialSelectionValue The initially selected value.
- *
- * @return The value the user input.
- */
- public static String showInputDialog(Component parentComponent,
- Object message,
- Object initialSelectionValue)
- {
- JOptionPane pane = new JOptionPane(message, QUESTION_MESSAGE);
- pane.setInitialSelectionValue(initialSelectionValue);
- pane.setWantsInput(true);
- JDialog dialog = pane.createDialog(parentComponent, null);
- dialog.pack();
- dialog.show();
-
- return (String) pane.getInputValue();
- }
-
- /**
- * This method displays a new input dialog with the given message, title and
- * messageType. Since no selectionValues value is given, the Look and Feel
- * will usually give the user a TextField to input data to. This method
- * returns the value the user inputs.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message to display.
- * @param title The title of the dialog.
- * @param messageType The messageType.
- *
- * @return The value the user input.
- */
- public static String showInputDialog(Component parentComponent,
- Object message, String title,
- int messageType)
- {
- JOptionPane pane = new JOptionPane(message, messageType);
- pane.setWantsInput(true);
- JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
- dialog.show();
-
- return (String) pane.getInputValue();
- }
-
- /**
- * This method shows an input dialog with the given message, title,
- * messageType, icon, selectionValues, and initialSelectionValue. This
- * method returns the value that the user selects.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message displayed.
- * @param title The title of the dialog.
- * @param messageType The messageType.
- * @param icon The icon displayed.
- * @param selectionValues The list of values to select from.
- * @param initialSelectionValue The initially selected value.
- *
- * @return The user selected value.
- */
- public static Object showInputDialog(Component parentComponent,
- Object message, String title,
- int messageType, Icon icon,
- Object[] selectionValues,
- Object initialSelectionValue)
- {
- JOptionPane pane = new JOptionPane(message, messageType);
- pane.setWantsInput(true);
- pane.setIcon(icon);
- pane.setSelectionValues(selectionValues);
- pane.setInitialSelectionValue(initialSelectionValue);
- JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
- dialog.show();
-
- return (String) pane.getInputValue();
- }
-
- /**
- * This method shows a QUESTION_MESSAGE type input dialog. Since no
- * selectionValues is set, the Look and Feel will usually give the user a
- * TextField to input data to. This method returns the value the user
- * inputs.
- *
- * @param message The message to display.
- *
- * @return The user selected value.
- */
- public static String showInputDialog(Object message)
- {
- JOptionPane pane = new JOptionPane(message, QUESTION_MESSAGE);
- pane.setWantsInput(true);
- JDialog dialog = pane.createDialog(null, null);
- dialog.pack();
- dialog.show();
-
- return (String) pane.getInputValue();
- }
-
- /**
- * This method shows a QUESTION_MESSAGE type input dialog. Since no
- * selectionValues is set, the Look and Feel will usually give the user a
- * TextField to input data to. The input component will be initialized with
- * the initialSelectionValue. This method returns the value the user
- * inputs.
- *
- * @param message The message to display.
- * @param initialSelectionValue The initialSelectionValue.
- *
- * @return The user selected value.
- */
- public static String showInputDialog(Object message,
- Object initialSelectionValue)
- {
- JOptionPane pane = new JOptionPane(message, QUESTION_MESSAGE);
- pane.setWantsInput(true);
- pane.setInitialSelectionValue(initialSelectionValue);
- JDialog dialog = pane.createDialog(null, null);
- dialog.pack();
- dialog.show();
-
- return (String) pane.getInputValue();
- }
-
- /**
- * This method shows an internal confirmation dialog with the given message.
- * The internal frame dialog will be placed in the first JDesktopPane
- * ancestor of the given parentComponent. This method will return the value
- * selected.
- *
- * @param parentComponent The parent to find a JDesktopPane in.
- * @param message The message to display.
- *
- * @return The value selected.
- */
- public static int showInternalConfirmDialog(Component parentComponent,
- Object message)
- {
- JOptionPane pane = new JOptionPane(message);
- JInternalFrame frame = pane.createInternalFrame(parentComponent, null);
-
- startModal(frame, pane);
-
- return ((Integer) pane.getValue()).intValue();
- }
-
- /**
- * This method shows an internal confirmation dialog with the given message,
- * optionType and title. The internal frame dialog will be placed in the
- * first JDesktopPane ancestor of the given parentComponent. This method
- * will return the selected value.
- *
- * @param parentComponent The parent to find a JDesktopPane in.
- * @param message The message to display.
- * @param title The title to display.
- * @param optionType The option type.
- *
- * @return The selected value.
- */
- public static int showInternalConfirmDialog(Component parentComponent,
- Object message, String title,
- int optionType)
- {
- JOptionPane pane = new JOptionPane(message, PLAIN_MESSAGE, optionType);
- JInternalFrame frame = pane.createInternalFrame(parentComponent, title);
-
- startModal(frame, pane);
-
- return ((Integer) pane.getValue()).intValue();
- }
-
- /**
- * This method shows an internal confirmation dialog with the given message,
- * title, optionTypes and icon for the given message type. The internal
- * confirmation dialog will be placed in the first instance of
- * JDesktopPane ancestor of the given parentComponent.
- *
- * @param parentComponent The component to find a JDesktopPane in.
- * @param message The message to display.
- * @param title The title of the dialog.
- * @param optionType The option type.
- * @param messageType The message type.
- *
- * @return The selected value.
- */
- public static int showInternalConfirmDialog(Component parentComponent,
- Object message, String title,
- int optionType, int messageType)
- {
- JOptionPane pane = new JOptionPane(message, messageType, optionType);
- JInternalFrame frame = pane.createInternalFrame(parentComponent, title);
-
- startModal(frame, pane);
-
- return ((Integer) pane.getValue()).intValue();
- }
-
- /**
- * This method shows an internal confirmation dialog with the given message,
- * title, option type, message type, and icon. The internal frame dialog
- * will be placed in the first JDesktopPane ancestor that is found in the
- * given parentComponent. This method returns the selected value.
- *
- * @param parentComponent The parent to find a JDesktopPane in.
- * @param message The message to display.
- * @param title The title to display.
- * @param optionType The option type.
- * @param messageType The message type.
- * @param icon The icon to display.
- *
- * @return The selected value.
- */
- public static int showInternalConfirmDialog(Component parentComponent,
- Object message, String title,
- int optionType, int messageType,
- Icon icon)
- {
- JOptionPane pane = new JOptionPane(message, messageType, optionType, icon);
- JInternalFrame frame = pane.createInternalFrame(parentComponent, title);
-
- startModal(frame, pane);
-
- return ((Integer) pane.getValue()).intValue();
- }
-
- /**
- * This method shows an internal input dialog with the given message. The
- * internal frame dialog will be placed in the first JDesktopPane ancestor
- * of the given parent component. This method returns the value input by
- * the user.
- *
- * @param parentComponent The parent to find a JDesktopPane in.
- * @param message The message to display.
- *
- * @return The user selected value.
- */
- public static String showInternalInputDialog(Component parentComponent,
- Object message)
- {
- JOptionPane pane = new JOptionPane(message);
- pane.setWantsInput(true);
- JInternalFrame frame = pane.createInternalFrame(parentComponent, null);
-
- startModal(frame, pane);
-
- return (String) pane.getInputValue();
- }
-
- /**
- * This method shows an internal input dialog with the given message, title
- * and message type. The internal input dialog will be placed in the first
- * JDesktopPane ancestor found in the given parent component. This method
- * will return the input value given by the user.
- *
- * @param parentComponent The component to find a JDesktopPane in.
- * @param message The message to display.
- * @param title The title to display.
- * @param messageType The message type.
- *
- * @return The user input value.
- */
- public static String showInternalInputDialog(Component parentComponent,
- Object message, String title,
- int messageType)
- {
- JOptionPane pane = new JOptionPane(message, messageType);
- pane.setWantsInput(true);
- JInternalFrame frame = pane.createInternalFrame(parentComponent, title);
-
- startModal(frame, pane);
-
- return (String) pane.getInputValue();
- }
-
- /**
- * This method shows an internal input dialog with the given message, title
- * message type, icon, selection value list and initial selection value.
- * The internal frame dialog will be placed in the first JDesktopPane
- * ancestor found in the given parent component. This method returns the
- * input value from the user.
- *
- * @param parentComponent The parent to find a JDesktopPane in.
- * @param message The message to display.
- * @param title The title to display.
- * @param messageType The message type.
- * @param icon The icon to display.
- * @param selectionValues The selection value list.
- * @param initialSelectionValue The initial selection value.
- *
- * @return The user input value.
- */
- public static Object showInternalInputDialog(Component parentComponent,
- Object message, String title,
- int messageType, Icon icon,
- Object[] selectionValues,
- Object initialSelectionValue)
- {
- JOptionPane pane = new JOptionPane(message, messageType);
- pane.setWantsInput(true);
- pane.setIcon(icon);
- pane.setSelectionValues(selectionValues);
- pane.setInitialSelectionValue(initialSelectionValue);
- JInternalFrame frame = pane.createInternalFrame(parentComponent, title);
-
- startModal(frame, pane);
-
- return (String) pane.getInputValue();
- }
-
- /**
- * This method shows an internal message dialog with the given message. The
- * internal frame dialog will be placed in the first JDesktopPane ancestor
- * found in the given parent component.
- *
- * @param parentComponent The component to find a JDesktopPane in.
- * @param message The message to display.
- */
- public static void showInternalMessageDialog(Component parentComponent,
- Object message)
- {
- JOptionPane pane = new JOptionPane(message);
- JInternalFrame frame = pane.createInternalFrame(parentComponent, null);
-
- startModal(frame, pane);
- }
-
- /**
- * This method shows an internal message dialog with the given message,
- * title and message type. The internal message dialog is placed in the
- * first JDesktopPane ancestor found in the given parent component.
- *
- * @param parentComponent The parent component to find a JDesktopPane in.
- * @param message The message to display.
- * @param title The title to display.
- * @param messageType The message type.
- */
- public static void showInternalMessageDialog(Component parentComponent,
- Object message, String title,
- int messageType)
- {
- JOptionPane pane = new JOptionPane(message, messageType);
- JInternalFrame frame = pane.createInternalFrame(parentComponent, title);
-
- startModal(frame, pane);
- }
-
- /**
- * This method shows an internal message dialog with the given message,
- * title, message type and icon. The internal message dialog is placed in
- * the first JDesktopPane ancestor found in the given parent component.
- *
- * @param parentComponent The component to find a JDesktopPane in.
- * @param message The message to display.
- * @param title The title to display.
- * @param messageType The message type.
- * @param icon The icon to display.
- */
- public static void showInternalMessageDialog(Component parentComponent,
- Object message, String title,
- int messageType, Icon icon)
- {
- JOptionPane pane = new JOptionPane(message, messageType);
- pane.setIcon(icon);
- JInternalFrame frame = pane.createInternalFrame(parentComponent, title);
-
- startModal(frame, pane);
- }
-
- /**
- * This method displays an internal option dialog with the given message,
- * title, option type, message type, icon, option list, and initial option
- * value. The internal option dialog is placed in the first JDesktopPane
- * ancestor found in the parent component. This method returns the option
- * selected.
- *
- * @param parentComponent The parent to find a JDesktopPane in.
- * @param message The message displayed.
- * @param title The title displayed.
- * @param optionType The option type.
- * @param messageType The message type.
- * @param icon The icon to display.
- * @param options The array of options.
- * @param initialValue The initial value selected.
- *
- * @return The option that was selected.
- */
- public static int showInternalOptionDialog(Component parentComponent,
- Object message, String title,
- int optionType, int messageType,
- Icon icon, Object[] options,
- Object initialValue)
- {
- JOptionPane pane = new JOptionPane(message, messageType, optionType, icon,
- options, initialValue);
-
- JInternalFrame frame = pane.createInternalFrame(parentComponent, title);
-
- startModal(frame, pane);
-
- return ((Integer) pane.getValue()).intValue();
- }
-
- /**
- * This method shows an INFORMATION_MESSAGE type message dialog.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message displayed.
- */
- public static void showMessageDialog(Component parentComponent,
- Object message)
- {
- JOptionPane pane = new JOptionPane(message, INFORMATION_MESSAGE);
- JDialog dialog = pane.createDialog(parentComponent, null);
- dialog.pack();
- dialog.show();
- }
-
- /**
- * This method shows a message dialog with the given message, title and
- * messageType.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message displayed.
- * @param title The title of the dialog.
- * @param messageType The messageType.
- */
- public static void showMessageDialog(Component parentComponent,
- Object message, String title,
- int messageType)
- {
- JOptionPane pane = new JOptionPane(message, messageType);
- JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
- dialog.show();
- }
-
- /**
- * This method shows a message dialog with the given message, title,
- * messageType and icon.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message displayed.
- * @param title The title of the dialog.
- * @param messageType The messageType.
- * @param icon The icon displayed.
- */
- public static void showMessageDialog(Component parentComponent,
- Object message, String title,
- int messageType, Icon icon)
- {
- JOptionPane pane = new JOptionPane(message, messageType);
- pane.setIcon(icon);
- JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
- dialog.show();
- }
-
- /**
- * This method shows an option dialog with the given message, title,
- * optionType, messageType, icon, options and initialValue. This method
- * returns the option that was selected.
- *
- * @param parentComponent The component to find a frame in.
- * @param message The message displayed.
- * @param title The title of the dialog.
- * @param optionType The optionType.
- * @param messageType The messageType.
- * @param icon The icon displayed.
- * @param options The options to choose from.
- * @param initialValue The initial value.
- *
- * @return The selected option.
- */
- public static int showOptionDialog(Component parentComponent,
- Object message, String title,
- int optionType, int messageType,
- Icon icon, Object[] options,
- Object initialValue)
- {
- JOptionPane pane = new JOptionPane(message, messageType, optionType, icon,
- options, initialValue);
-
- JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
- dialog.show();
-
- return ((Integer) pane.getValue()).intValue();
- }
-
- /**
- * This method resets the UI to the Look and Feel default.
- */
- public void updateUI()
- {
- setUI((OptionPaneUI) UIManager.getUI(this));
- invalidate();
- }
-
- /**
- * This method returns true if the key is a valid messageType.
- *
- * @param key The key to check.
- *
- * @return True if key is valid.
- */
- private boolean validMessageType(int key)
- {
- switch (key)
- {
- case ERROR_MESSAGE:
- case INFORMATION_MESSAGE:
- case PLAIN_MESSAGE:
- case QUESTION_MESSAGE:
- case WARNING_MESSAGE:
- return true;
- }
- return false;
- }
-
- /**
- * This method returns true if the key is a valid optionType.
- *
- * @param key The key to check.
- *
- * @return True if key is valid.
- */
- private boolean validOptionType(int key)
- {
- switch (key)
- {
- case DEFAULT_OPTION:
- case OK_CANCEL_OPTION:
- case YES_NO_CANCEL_OPTION:
- case YES_NO_OPTION:
- return true;
- }
- return false;
- }
-
- /**
- * This helper method makes the JInternalFrame wait until it is notified by
- * an InternalFrameClosing event. This method also adds the given
- * JOptionPane to the JInternalFrame and sizes it according to the
- * JInternalFrame's preferred size.
- *
- * @param f The JInternalFrame to make modal.
- * @param pane The JOptionPane to add to the JInternalFrame.
- */
- private static void startModal(JInternalFrame f, JOptionPane pane)
- {
- f.getContentPane().add(pane);
- f.pack();
- f.show();
-
- Dimension pref = f.getPreferredSize();
- f.setBounds(0, 0, pref.width, pref.height);
-
- synchronized (f)
- {
- final JInternalFrame tmp = f;
- tmp.toFront();
-
- f.addInternalFrameListener(new InternalFrameAdapter()
- {
- public void internalFrameClosed(InternalFrameEvent e)
- {
- synchronized (tmp)
- {
- tmp.removeInternalFrameListener(this);
- tmp.notifyAll();
- }
- }
- });
- try
- {
- while (! f.isClosed())
- f.wait();
- }
- catch (InterruptedException ignored)
- {
- }
- }
- }
-}
diff --git a/libjava/javax/swing/JPanel.java b/libjava/javax/swing/JPanel.java
deleted file mode 100644
index c7f7c448331..00000000000
--- a/libjava/javax/swing/JPanel.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* JPanel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.FlowLayout;
-import java.awt.LayoutManager;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.swing.plaf.PanelUI;
-
-/**
- * An instance of JPanel can be added to a panel, frame etc
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public class JPanel extends JComponent implements Accessible
-{
- public JPanel()
- {
- this(new FlowLayout(),
- true);
- }
-
- public JPanel(boolean double_buffered)
- {
- this(new FlowLayout(),
- double_buffered);
- }
-
- public JPanel(LayoutManager layout)
- {
- this(layout,
- true);
- }
-
-
- public JPanel(LayoutManager layout,
- boolean isDoubleBuffered)
- {
- if (layout == null)
- {
- System.err.println("NO LAYOUT SET !!!");
- layout = new FlowLayout();
- }
- setLayout(layout);
- setOpaque(true);
-
- updateUI();
- }
-
- public String getUIClassID()
- { return "PanelUI"; }
-
-
- public void setUI(PanelUI ui) {
- super.setUI(ui);
- }
-
- public PanelUI getUI() {
- return (PanelUI)ui;
- }
-
- public void updateUI() {
- setUI((PanelUI)UIManager.getUI(this));
- }
-
-
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
- protected String paramString()
- {
- return "JPanel";
- }
-}
diff --git a/libjava/javax/swing/JPasswordField.java b/libjava/javax/swing/JPasswordField.java
deleted file mode 100644
index f9df10217c8..00000000000
--- a/libjava/javax/swing/JPasswordField.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/* JPasswordField.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.IOException;
-import java.io.ObjectOutputStream;
-
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-
-/**
- * class JPasswordField
- *
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class JPasswordField extends JTextField
-{
- /**
- * AccessibleJPasswordField
- */
- protected class AccessibleJPasswordField extends AccessibleJTextField
- {
- private static final long serialVersionUID = -8477039424200681086L;
-
- /**
- * Constructor AccessibleJPasswordField
- */
- protected AccessibleJPasswordField()
- {
- }
-
- /**
- * getAccessibleRole
- *
- * @return AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.PASSWORD_TEXT;
- }
- }
-
- /**
- * echoChar. Default is 0.
- */
- private char echoChar = 0;
-
- /**
- * Creates a <code>JPasswordField</code> object.
- */
- public JPasswordField()
- {
- this(null, null, 0);
- }
-
- /**
- * Creates a <code>JPasswordField</code> object.
- *
- * @param text the initial text
- */
- public JPasswordField(String text)
- {
- this(null, text, 0);
- }
-
- /**
- * Creates a <code>JPasswordField</code> object.
- *
- * @param columns the number of columns
- */
- public JPasswordField(int columns)
- {
- this(null, null, columns);
- }
-
- /**
- * Creates a <code>JPasswordField</code> object.
- *
- * @param text the initial text
- * @param columns the number of columns
- */
- public JPasswordField(String text, int columns)
- {
- this(null, text, columns);
- }
-
- /**
- * Creates a <code>JPasswordField</code> object.
- *
- * @param document the document to use
- * @param text the initial text
- * @param columns the number of columns
- */
- public JPasswordField(Document document, String text, int columns)
- {
- super(document, text, columns);
- }
-
- /**
- * writeObject
- *
- * @param stream the stream to write to
- *
- * @exception IOException if an error occurs
- */
- private void writeObject(ObjectOutputStream stream) throws IOException
- {
- // TODO: Implement me.
- }
-
- /**
- * Returns the <code>UIClassID</code>
- *
- * @return the string "PasswordFieldUI"
- */
- public String getUIClassID()
- {
- return "PasswordFieldUI";
- }
-
- /**
- * getEchoChar
- *
- * @return the echo char
- */
- public char getEchoChar()
- {
- return echoChar;
- }
-
- /**
- * setEchoChar
- *
- * @param echo the echo char
- */
- public void setEchoChar(char echo)
- {
- this.echoChar = echo;
- }
-
- /**
- * echoCharIsSet
- *
- * @return <code>true</code> if the echo char is set,
- * <code>false</code> otherwise.
- */
- public boolean echoCharIsSet()
- {
- return echoChar == 0;
- }
-
- /**
- * Copies the selected text into the clipboard. This operation is not
- * allowed in a password input field.
- */
- public void copy()
- {
- UIManager.getLookAndFeel().provideErrorFeedback(this);
- }
-
- /**
- * Cuts the selected text and puts it into the clipboard. This operation
- * is not allowed in a password input field.
- */
- public void cut()
- {
- UIManager.getLookAndFeel().provideErrorFeedback(this);
- }
-
- /**
- * getText
- *
- * @return String
- *
- * @deprecated
- */
- public String getText()
- {
- return null; // TODO
- }
-
- /**
- * getText
- *
- * @param offset TODO
- * @param length TODO
- *
- * @return String
- *
- * @exception BadLocationException TODO
- *
- * @deprecated
- */
- public String getText(int offset, int length) throws BadLocationException
- {
- return null; // TODO
- }
-
- /**
- * getPassword
- *
- * @return char[]
- */
- public char[] getPassword()
- {
- return new char[0]; // TODO
- }
-
- /**
- * paramString
- *
- * @return String
- */
- protected String paramString()
- {
- return null; // TODO
- }
-
- /**
- * getAccessibleContext
- *
- * @return the <code>AccessibleContext</code> object
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJPasswordField();
-
- return accessibleContext;
- }
-}
diff --git a/libjava/javax/swing/JPopupMenu.java b/libjava/javax/swing/JPopupMenu.java
deleted file mode 100644
index 2ee31ddffd9..00000000000
--- a/libjava/javax/swing/JPopupMenu.java
+++ /dev/null
@@ -1,1074 +0,0 @@
-/* JPopupMenu.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.GridBagConstraints;
-import java.awt.Insets;
-import java.awt.Panel;
-import java.awt.Point;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.ArrayList;
-import java.util.EventListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.swing.event.PopupMenuEvent;
-import javax.swing.event.PopupMenuListener;
-import javax.swing.plaf.PopupMenuUI;
-
-/**
- * JPopupMenu is a container that is used to display popup menu's menu
- * items. By default JPopupMenu is a lightweight container, however if it
- * is the case that JPopupMenu's bounds are outside of main window, then
- * heawyweight container will be used to display menu items. It is also
- * possible to change JPopupMenu's default behavior and set JPopupMenu
- * to always use heavyweight container.
- *
- * JPopupMenu can be displayed anywhere; it is a floating free popup menu.
- * However before JPopupMenu is diplayed, its invoker property should be set.
- * JPopupMenu's invoker is a component relative to which popup menu is
- * displayed.
- *
- * JPopupMenu fires PopupMenuEvents to its registered listeners. Whenever
- * JPopupMenu becomes visible on the screen then PopupMenuEvent indicating
- * that popup menu became visible will be fired. In the case when
- * JPopupMenu becomes invisible or cancelled without selection, then
- * popupMenuBecomeInvisible() or popupMenuCancelled() methods of
- * PopupMenuListeners will be invoked.
- *
- * JPopupMenu also fires PropertyChangeEvents when its bound properties
- * change.In addittion to inheritted bound properties, JPopupMenu has
- * 'visible' bound property. When JPopupMenu becomes visible/invisible on
- * the screen it fires PropertyChangeEvents to its registered
- * PropertyChangeListeners.
- */
-public class JPopupMenu extends JComponent implements Accessible, MenuElement
-{
- private static final long serialVersionUID = -8336996630009646009L;
-
- /* indicates if popup's menu border should be painted*/
- private boolean borderPainted = true;
-
- /** Flag indicating whether lightweight, mediumweight or heavyweight popup
- is used to display menu items.
-
- These are the possible cases:
-
- 1. if DefaultLightWeightPopupEnabled true
- (i) use lightweight container if popup feets inside top-level window
- (ii) only use heavyweight container (JWindow) if popup doesn't fit.
-
- 2. if DefaultLightWeightPopupEnabled false
- (i) if popup fits, use awt.Panel (mediumWeight)
- (ii) if popup doesn't fit, use JWindow (heavyWeight)
- */
- private static boolean DefaultLightWeightPopupEnabled = true;
-
- /* Component that invokes popup menu. */
- transient Component invoker;
-
- /* Label for this popup menu. It is not used in most of the look and feel themes. */
- private String label;
-
- /*Amount of space between menuItem's in JPopupMenu and JPopupMenu's border */
- private Insets margin;
-
- /** Indicates whether ligthWeight container can be used to display popup
- menu. This flag is the same as DefaultLightWeightPopupEnabled, but setting
- this flag can change popup menu after creation of the object */
- private boolean lightWeightPopupEnabled;
-
- /** SelectionModel that keeps track of menu selection. */
- private SingleSelectionModel selectionModel;
-
- /* Popup that is used to display JPopupMenu */
- private transient Popup popup;
-
- /* Location of the popup */
- private Point popupLocation;
-
- /* Field indicating if popup menu is visible or not */
- private boolean visible = false;
-
- /**
- * Creates a new JPopupMenu object.
- */
- public JPopupMenu()
- {
- this(null);
- }
-
- /**
- * Creates a new JPopupMenu with specified label
- *
- * @param label Label for popup menu.
- */
- public JPopupMenu(String label)
- {
- lightWeightPopupEnabled = getDefaultLightWeightPopupEnabled();
- setLabel(label);
- setSelectionModel(new DefaultSingleSelectionModel());
- super.setVisible(false);
- updateUI();
- }
-
- private void readObject(ObjectInputStream stream)
- throws IOException, ClassNotFoundException
- {
- }
-
- private void writeObject(ObjectOutputStream stream) throws IOException
- {
- }
-
- /**
- * Adds given menu item to the popup menu
- *
- * @param item menu item to add to the popup menu
- *
- * @return menu item that was added to the popup menu
- */
- public JMenuItem add(JMenuItem item)
- {
- this.insert(item, -1);
- return item;
- }
-
- /**
- * Constructs menu item with a specified label and adds it to
- * popup menu
- *
- * @param text label for the menu item to be added
- *
- * @return constructed menu item that was added to the popup menu
- */
- public JMenuItem add(String text)
- {
- JMenuItem item = new JMenuItem(text);
- return add(item);
- }
-
- /**
- * Constructs menu item associated with the specified action
- * and adds it to the popup menu
- *
- * @param action Action for the new menu item
- *
- * @return menu item that was added to the menu
- */
- public JMenuItem add(Action action)
- {
- JMenuItem item = createActionComponent(action);
-
- if (action != null)
- action.addPropertyChangeListener(createActionChangeListener(item));
-
- return add(item);
- }
-
- /**
- * Revomes component at the given index from the menu.
- *
- * @param index index of the component that will be removed in the menu
- */
- public void remove(int index)
- {
- super.remove(index);
-
- GridBagConstraints constraints = new GridBagConstraints();
- constraints.fill = GridBagConstraints.BOTH;
- constraints.weightx = 100.0;
- constraints.weighty = 100.0;
-
- Component[] items = getComponents();
- for (int i = index; i < items.length; i++)
- {
- constraints.gridy = i;
- super.add(items[i], constraints, i);
- }
- }
-
- /**
- * Create menu item associated with the given action
- * and inserts it into the popup menu at the specified index
- *
- * @param action Action for the new menu item
- * @param index index in the popup menu at which to insert new menu item.
- */
- public void insert(Action action, int index)
- {
- JMenuItem item = new JMenuItem(action);
- this.insert(item, index);
- }
-
- /**
- * Insert given component to the popup menu at the
- * specified index
- *
- * @param component Component to insert
- * @param index Index at which to insert given component
- */
- public void insert(Component component, int index)
- {
- GridBagConstraints constraints = new GridBagConstraints();
- constraints.fill = GridBagConstraints.BOTH;
- constraints.weightx = 100.0;
- constraints.weighty = 100.0;
-
- if (index == -1)
- index = getComponents().length;
-
- constraints.gridy = index;
- super.add(component, constraints, index);
-
- // need to change constraints for the components that were moved by 1
- // due to the insertion
- if (index != -1)
- {
- Component[] items = getComponents();
-
- for (int i = index + 1; i < items.length; i++)
- {
- constraints.gridy = i;
- super.add(items[i], constraints, i);
- }
- }
- }
-
- /**
- * Returns flag indicating if newly created JPopupMenu will use
- * heavyweight or lightweight container to display its menu items
- *
- * @return true if JPopupMenu will use lightweight container to display
- * menu items by default, and false otherwise.
- */
- public static boolean getDefaultLightWeightPopupEnabled()
- {
- return DefaultLightWeightPopupEnabled;
- }
-
- /**
- * Sets whether JPopupMenu should use ligthWeight container to
- * display it menu items by default
- *
- * @param enabled true if JPopupMenu should use lightweight container
- * for displaying its menu items, and false otherwise.
- */
- public static void setDefaultLightWeightPopupEnabled(boolean enabled)
- {
- DefaultLightWeightPopupEnabled = enabled;
- }
-
- /**
- * This method returns the UI used to display the JPopupMenu.
- *
- * @return The UI used to display the JPopupMenu.
- */
- public PopupMenuUI getUI()
- {
- return (PopupMenuUI) ui;
- }
-
- /**
- * Set the "UI" property of the menu item, which is a look and feel class
- * responsible for handling popupMenu's input events and painting it.
- *
- * @param ui The new "UI" property
- */
- public void setUI(PopupMenuUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method sets this menuItem's UI to the UIManager's default for the
- * current look and feel.
- */
- public void updateUI()
- {
- setUI((PopupMenuUI) UIManager.getUI(this));
- invalidate();
- }
-
- /**
- * This method returns a name to identify which look and feel class will be
- * the UI delegate for the menuItem.
- *
- * @return The Look and Feel classID. "PopupMenuUI"
- */
- public String getUIClassID()
- {
- return "PopupMenuUI";
- }
-
- /**
- * Returns selectionModel used by this popup menu to keep
- * track of the selection.
- *
- * @return popup menu's selection model
- */
- public SingleSelectionModel getSelectionModel()
- {
- return selectionModel;
- }
-
- /**
- * Sets selection model for this popup menu
- *
- * @param model new selection model of this popup menu
- */
- public void setSelectionModel(SingleSelectionModel model)
- {
- selectionModel = model;
- }
-
- /**
- * Creates new menu item associated with a given action.
- *
- * @param action Action used to create new menu item
- *
- * @return new created menu item associated with a given action.
- */
- protected JMenuItem createActionComponent(Action action)
- {
- return new JMenuItem(action);
- }
-
- /**
- * Creates PropertyChangeListener that listens to PropertyChangeEvents
- * occuring in the Action associated with given menu item in this popup menu.
- *
- * @param item MenuItem
- *
- * @return The PropertyChangeListener
- */
- protected PropertyChangeListener createActionChangeListener(JMenuItem item)
- {
- return new ActionChangeListener();
- }
-
- /**
- * Returns true if this popup menu will display its menu item in
- * a lightweight container and false otherwise.
- *
- * @return true if this popup menu will display its menu items
- * in a lightweight container and false otherwise.
- */
- public boolean isLightWeightPopupEnabled()
- {
- return lightWeightPopupEnabled;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param enabled DOCUMENT ME!
- */
- public void setLightWeightPopupEnabled(boolean enabled)
- {
- lightWeightPopupEnabled = enabled;
- }
-
- /**
- * Returns label for this popup menu
- *
- * @return label for this popup menu
- */
- public String getLabel()
- {
- return label;
- }
-
- /**
- * Sets label for this popup menu. This method fires PropertyChangeEvent
- * when the label property is changed. Please note that most
- * of the Look &amp; Feel will ignore this property.
- *
- * @param label label for this popup menu
- */
- public void setLabel(String label)
- {
- if (label != this.label)
- {
- String oldLabel = this.label;
- this.label = label;
- firePropertyChange("label", oldLabel, label);
- }
- }
-
- /**
- * Adds separator to this popup menu
- */
- public void addSeparator()
- {
- // insert separator at the end of the list of menu items
- this.insert(new Separator(), -1);
- }
-
- /**
- * Adds popupMenuListener to listen for PopupMenuEvents fired
- * by the JPopupMenu
- *
- * @param listener PopupMenuListener to add to JPopupMenu
- */
- public void addPopupMenuListener(PopupMenuListener listener)
- {
- listenerList.add(PopupMenuListener.class, listener);
- }
-
- /**
- * Removes PopupMenuListener from JPopupMenu's list of listeners
- *
- * @param listener PopupMenuListener which needs to be removed
- */
- public void removePopupMenuListener(PopupMenuListener listener)
- {
- listenerList.remove(PopupMenuListener.class, listener);
- }
-
- /**
- * Returns array of PopupMenuListeners that are listening to JPopupMenu
- *
- * @return Array of PopupMenuListeners that are listening to JPopupMenu
- */
- public PopupMenuListener[] getPopupMenuListeners()
- {
- return ((PopupMenuListener[]) listenerList.getListeners(PopupMenuListener.class));
- }
-
- /**
- * This method calls popupMenuWillBecomeVisible() of popup menu's
- * PopupMenuListeners. This method is invoked just before popup menu
- * will appear on the screen.
- */
- protected void firePopupMenuWillBecomeVisible()
- {
- EventListener[] ll = listenerList.getListeners(PopupMenuListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((PopupMenuListener) ll[i]).popupMenuWillBecomeVisible(new PopupMenuEvent(this));
- }
-
- /**
- * This method calls popupMenuWillBecomeInvisible() of popup
- * menu's PopupMenuListeners. This method is invoked just before popup
- * menu will disappear from the screen
- */
- protected void firePopupMenuWillBecomeInvisible()
- {
- EventListener[] ll = listenerList.getListeners(PopupMenuListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((PopupMenuListener) ll[i]).popupMenuWillBecomeInvisible(new PopupMenuEvent(this));
- }
-
- /**
- * This method calls popupMenuCanceled() of popup menu's PopupMenuListeners.
- * This method is invoked just before popup menu is cancelled. This happens
- * when popup menu is closed without selecting any of its menu items. This
- * usually happens when the top-level window is resized or moved.
- */
- protected void firePopupMenuCanceled()
- {
- EventListener[] ll = listenerList.getListeners(PopupMenuListener.class);
-
- for (int i = 0; i < ll.length; i++)
- ((PopupMenuListener) ll[i]).popupMenuCanceled(new PopupMenuEvent(this));
- }
-
- /**
- * This methods sets popup menu's size to its' preferred size. If the
- * popup menu's size is previously set it will be ignored.
- */
- public void pack()
- {
- super.setSize(null);
- }
-
- /**
- * Return visibility of the popup menu
- *
- * @return true if popup menu is visible on the screen and false otherwise.
- */
- public boolean isVisible()
- {
- return visible;
- }
-
- /**
- * Sets visibility property of this popup menu. If the property is
- * set to true then popup menu will be dispayed and popup menu will
- * hide itself if visible property is set to false.
- *
- * @param visible true if popup menu will become visible and false otherwise.
- */
- public void setVisible(boolean visible)
- {
- if (visible == isVisible())
- return;
-
- boolean old = isVisible();
- this.visible = visible;
- if (old != isVisible())
- {
- firePropertyChange("visible", old, isVisible());
- if (visible)
- {
- firePopupMenuWillBecomeVisible();
- Container rootContainer = (Container) SwingUtilities.getRoot(invoker);
-
- boolean fit = true;
- Dimension size;
-
- // Determine the size of the popup menu
- if (this.getSize().width == 0 && this.getSize().width == 0)
- size = this.getPreferredSize();
- else
- size = this.getSize();
-
- if ((size.width > (rootContainer.getWidth() - popupLocation.x))
- || (size.height > (rootContainer.getHeight() - popupLocation.y)))
- fit = false;
- if (lightWeightPopupEnabled && fit)
- popup = new LightWeightPopup(this);
- else
- {
- if (fit)
- popup = new MediumWeightPopup(this);
- else
- popup = new HeavyWeightPopup(this);
- }
- if (popup instanceof LightWeightPopup
- || popup instanceof MediumWeightPopup)
- {
- JLayeredPane layeredPane;
- layeredPane = SwingUtilities.getRootPane(invoker)
- .getLayeredPane();
- Point p = new Point(popupLocation.x, popupLocation.y);
- SwingUtilities.convertPointFromScreen(p, layeredPane);
- popup.show(p.x, p.y, size.width, size.height);
- }
- else
- {
- // Subtract insets of the top-level container if popup menu's
- // top-left corner is inside it.
- Insets insets = rootContainer.getInsets();
- popup.show(popupLocation.x - insets.left,
- popupLocation.y - insets.top, size.width,
- size.height);
- }
- }
- else
- {
- firePopupMenuWillBecomeInvisible();
- popup.hide();
- }
- }
- }
-
- /**
- * Sets location of the popup menu.
- *
- * @param x X coordinate of the popup menu's location
- * @param y Y coordinate of the popup menu's location
- */
- public void setLocation(int x, int y)
- {
- if (popupLocation == null)
- popupLocation = new Point();
-
- popupLocation.x = x;
- popupLocation.y = y;
- }
-
- /**
- * Returns popup menu's invoker.
- *
- * @return popup menu's invoker
- */
- public Component getInvoker()
- {
- return invoker;
- }
-
- /**
- * Sets popup menu's invoker.
- *
- * @param component The new invoker of this popup menu
- */
- public void setInvoker(Component component)
- {
- invoker = component;
- }
-
- /**
- * This method displays JPopupMenu on the screen at the specified
- * location. Note that x and y coordinates given to this method
- * should be expressed in terms of the popup menus' invoker.
- *
- * @param component Invoker for this popup menu
- * @param x x-coordinate of the popup menu relative to the specified invoker
- * @param y y-coordiate of the popup menu relative to the specified invoker
- */
- public void show(Component component, int x, int y)
- {
- setInvoker(component);
- Point p = new Point(x, y);
- SwingUtilities.convertPointToScreen(p, component);
- setLocation(p.x, p.y);
- setVisible(true);
- }
-
- /**
- * Returns component located at the specified index in the popup menu
- *
- * @param index index of the component to return
- *
- * @return component located at the specified index in the popup menu
- *
- * @deprecated Replaced by getComponent(int)
- */
- public Component getComponentAtIndex(int index)
- {
- return getComponent(index);
- }
-
- /**
- * Returns index of the specified component in the popup menu
- *
- * @param component Component to look for
- *
- * @return index of the specified component in the popup menu
- */
- public int getComponentIndex(Component component)
- {
- Component[] items = getComponents();
-
- for (int i = 0; i < items.length; i++)
- {
- if (items[i].equals(component))
- return i;
- }
-
- return -1;
- }
-
- /**
- * Sets size of the popup
- *
- * @param size Dimensions representing new size of the popup menu
- */
- public void setPopupSize(Dimension size)
- {
- super.setSize(size);
- }
-
- /**
- * Sets size of the popup menu
- *
- * @param width width for the new size
- * @param height height for the new size
- */
- public void setPopupSize(int width, int height)
- {
- super.setSize(width, height);
- }
-
- /**
- * Selects specified component in this popup menu.
- *
- * @param selected component to select
- */
- public void setSelected(Component selected)
- {
- int index = getComponentIndex(selected);
- selectionModel.setSelectedIndex(index);
- }
-
- /**
- * Checks if this popup menu paints its border.
- *
- * @return true if this popup menu paints its border and false otherwise.
- */
- public boolean isBorderPainted()
- {
- return borderPainted;
- }
-
- /**
- * Sets if the border of the popup menu should be
- * painter or not.
- *
- * @param painted true if the border should be painted and false otherwise
- */
- public void setBorderPainted(boolean painted)
- {
- borderPainted = painted;
- }
-
- /**
- * Returns margin for this popup menu.
- *
- * @return margin for this popup menu.
- */
- public Insets getMargin()
- {
- return margin;
- }
-
- /**
- * A string that describes this JPopupMenu. Normally only used
- * for debugging.
- *
- * @return A string describing this JMenuItem
- */
- protected String paramString()
- {
- StringBuffer sb = new StringBuffer();
- sb.append(super.paramString());
- sb.append(",label=");
- if (getLabel() != null)
- sb.append(getLabel());
- sb.append(",lightWeightPopupEnabled=").append(isLightWeightPopupEnabled());
- sb.append(",margin=");
- if (getMargin() != null)
- sb.append(margin);
- sb.append(",paintBorder=").append(isBorderPainted());
- return sb.toString();
- }
-
- /**
- * Process mouse events forwarded from MenuSelectionManager. This method
- * doesn't do anything. It is here to conform to the MenuElement interface.
- *
- * @param event event forwarded from MenuSelectionManager
- * @param path path to the menu element from which event was generated
- * @param manager MenuSelectionManager for the current menu hierarchy
- */
- public void processMouseEvent(MouseEvent event, MenuElement[] path,
- MenuSelectionManager manager)
- {
- // Empty Implementation. This method is needed for the implementation
- // of MenuElement interface
- }
-
- /**
- * Process key events forwarded from MenuSelectionManager. This method
- * doesn't do anything. It is here to conform to the MenuElement interface.
- *
- * @param event event forwarded from MenuSelectionManager
- * @param path path to the menu element from which event was generated
- * @param manager MenuSelectionManager for the current menu hierarchy
- *
- */
- public void processKeyEvent(KeyEvent event, MenuElement[] path,
- MenuSelectionManager manager)
- {
- // Empty Implementation. This method is needed for the implementation
- // of MenuElement interface
- }
-
- /**
- * Method of MenuElement Interface. It is invoked when
- * popupMenu's selection has changed
- *
- * @param changed true if this popupMenu is part of current menu
- * hierarchy and false otherwise.
- */
- public void menuSelectionChanged(boolean changed)
- {
- if (! changed)
- setVisible(false);
- }
-
- /**
- * Return subcomonents of this popup menu. This method returns only
- * components that implement the <code>MenuElement</code> interface.
- *
- * @return array of menu items belonging to this popup menu
- */
- public MenuElement[] getSubElements()
- {
- Component[] items = getComponents();
- ArrayList subElements = new ArrayList();
-
- for (int i = 0; i < items.length; i++)
- if (items[i] instanceof MenuElement)
- subElements.add(items[i]);
-
- return (MenuElement[])
- subElements.toArray(new MenuElement[subElements.size()]);
- }
-
- /**
- * Method of the MenuElement interface. Returns reference to itself.
- *
- * @return Returns reference to itself
- */
- public Component getComponent()
- {
- return this;
- }
-
- /**
- * Checks if observing mouse event should trigger popup
- * menu to show on the screen.
- *
- * @param event MouseEvent to check
- *
- * @return true if the observing mouse event is popup trigger and false otherwise
- */
- public boolean isPopupTrigger(MouseEvent event)
- {
- return ((PopupMenuUI) getUI()).isPopupTrigger(event);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJPopupMenu();
-
- return accessibleContext;
- }
-
- /**
- * This interface is used to display menu items of the JPopupMenu
- */
- private interface Popup
- {
- /**
- * Displays container on the screen
- *
- * @param x x-coordinate of popup menu's location on the screen
- * @param y y-coordinate of popup menu's location on the screen
- * @param width width of the container that is used to display menu
- * item's for popup menu
- * @param height height of the container that is used to display menu
- * item's for popup menu
- */
- void show(int x, int y, int width, int height);
-
- /**
- * Hides container used to display popup menu item's from the screen
- */
- void hide();
- }
-
- /**
- * This class represents Popup menu that uses light weight container
- * to display its contents.
- */
- private class LightWeightPopup extends Container implements Popup
- {
- /**
- * Creates a new LightWeightPopup menu
- *
- * @param c Container containing menu items
- */
- private Component c;
-
- public LightWeightPopup(Container c)
- {
- this.c = c;
- }
-
- /**
- * Displayes lightweight container with menu items to the screen
- *
- * @param x x-coordinate of lightweight container on the screen
- * @param y y-coordinate of lightweight container on the screen
- * @param width width of the lightweight container
- * @param height height of the lightweight container
- */
- public void show(int x, int y, int width, int height)
- {
- JLayeredPane layeredPane;
- layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane();
- c.setBounds(x, y, width, height);
- layeredPane.add(c, JLayeredPane.POPUP_LAYER, 0);
- }
-
- /**
- * Hides lightweight container from the screen
- */
- public void hide()
- {
- // FIXME: Right now the lightweight container is removed from JLayered
- // pane. It is probably would be better in order to improve performance
- // to make the container invisible instead of removing it everytime.
- JLayeredPane layeredPane;
- layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane();
- int index = layeredPane.getIndexOf(c);
- layeredPane.remove(index);
- }
- }
-
- /**
- * MediumWeightPopup is an AWT Panel with JPopupMenu's menu items.
- * It is used to display JPopupMenu's menu items on the screen
- */
- private class MediumWeightPopup extends Panel implements Popup
- {
- /**
- * Creates a new MediumWeightPopup object.
- *
- * @param c Container with JPopupMenu's menu items
- */
- public MediumWeightPopup(Container c)
- {
- this.add(c);
- }
-
- /**
- * Displays AWT Panel with its components on the screen
- *
- * @param x x-coordinate of the upper-left corner of the panel's
- * @param y y-coordinate of the upper-left corner of the panel's
- * @param width width of the panel
- * @param height height of the panel
- */
- public void show(int x, int y, int width, int height)
- {
- JLayeredPane layeredPane;
- layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane();
- layeredPane.add(this, JLayeredPane.POPUP_LAYER, 0);
- this.setBounds(x, y, width, height);
- }
-
- /**
- * Hides This panel from the screen
- */
- public void hide()
- {
- // FIXME: Right now the lightweight container is removed from JLayered
- // pane. It is probably would be better in order to improve performance
- // to make the container invisible instead of removing it everytime.
- JLayeredPane layeredPane;
- layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane();
- int index = layeredPane.getIndexOf(this);
- layeredPane.remove(index);
- }
- }
-
- /**
- * HeavyWeightPopup is JWindow that is used to display JPopupMenu menu item's
- * on the screen
- */
- private class HeavyWeightPopup extends JWindow implements Popup
- {
- /**
- * Creates a new HeavyWeightPopup object.
- *
- * @param c Container containing menu items
- */
- public HeavyWeightPopup(Container c)
- {
- this.setContentPane(c);
- }
-
- /**
- * Displays JWindow container JPopupMenu's menu items to the screen
- *
- * @param x x-coordinate of JWindow containing menu items
- * @param y y-coordinate of JWindow containing menu items
- * @param width width of the JWindow
- * @param height height of the JWindow
- */
- public void show(int x, int y, int width, int height)
- {
- this.setBounds(x, y, width, height);
- this.show();
- }
- }
-
- /**
- * This is the separator that can be used in popup menu.
- */
- public static class Separator extends JSeparator
- {
- public Separator()
- {
- }
-
- public String getUIClassID()
- {
- return "PopupMenuSeparatorUI";
- }
- }
-
- protected class AccessibleJPopupMenu extends AccessibleJComponent
- {
- private static final long serialVersionUID = 7423261328879849768L;
-
- protected AccessibleJPopupMenu()
- {
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.POPUP_MENU;
- }
- }
-
- /* This class resizes popup menu and repaints popup menu appropriately if one
- of item's action has changed */
- protected class ActionChangeListener implements PropertyChangeListener
- {
- public void propertyChange(PropertyChangeEvent evt)
- {
- JPopupMenu.this.revalidate();
- JPopupMenu.this.repaint();
- }
- }
-}
diff --git a/libjava/javax/swing/JProgressBar.java b/libjava/javax/swing/JProgressBar.java
deleted file mode 100644
index dc6c6700402..00000000000
--- a/libjava/javax/swing/JProgressBar.java
+++ /dev/null
@@ -1,654 +0,0 @@
-/* JProgressBar.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Graphics;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleStateSet;
-import javax.accessibility.AccessibleValue;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ProgressBarUI;
-
-/**
- * The ProgressBar is a widget that displays in two modes. In
- * determinate mode, it displays fills a percentage of its bar
- * based on its current value. In indeterminate mode, it creates
- * box and bounces it between its bounds.
- *
- * <p>
- * JProgressBars have the following properties:
- * </p>
- *
- * <table>
- * <tr><th> Property </th><th> Stored in </th><th> Bound? </th></tr>
- * <tr><td> borderPainted </td><td> progressBar </td><td> yes </td></tr>
- * <tr><td> changeListeners </td><td> progressBar </td><td> no </td></tr>
- * <tr><td> indeterminate </td><td> progressBar </td><td> yes </td></tr>
- * <tr><td> maximum </td><td> model </td><td> no </td></tr>
- * <tr><td> minimum </td><td> model </td><td> no </td></tr>
- * <tr><td> model </td><td> progressBar </td><td> no </td></tr>
- * <tr><td> orientation </td><td> progressBar </td><td> yes </td></tr>
- * <tr><td> percentComplete </td><td> progressBar </td><td> no </td></tr>
- * <tr><td> string </td><td> progressBar </td><td> yes </td></tr>
- * <tr><td> stringPainted </td><td> progressBar </td><td> yes </td></tr>
- * <tr><td> value </td><td> model </td><td> no </td></tr>
- * </table>
- */
-public class JProgressBar extends JComponent implements SwingConstants,
- Accessible
-{
- /**
- * AccessibleJProgressBar
- */
- protected class AccessibleJProgressBar extends AccessibleJComponent
- implements AccessibleValue
- {
- private static final long serialVersionUID = -2938130009392721813L;
-
- /**
- * Constructor AccessibleJProgressBar
- *
- * @param component TODO
- */
- protected AccessibleJProgressBar()
- {
- }
-
- /**
- * getAccessibleStateSet
- *
- * @return AccessibleStateSet
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- return null;
- }
-
- /**
- * getAccessibleRole
- *
- * @return AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.PROGRESS_BAR;
- }
-
- /**
- * getAccessibleValue
- *
- * @return AccessibleValue
- */
- public AccessibleValue getAccessibleValue()
- {
- return null;
- }
-
- /**
- * getCurrentAccessibleValue
- *
- * @return Number
- */
- public Number getCurrentAccessibleValue()
- {
- return null;
- }
-
- /**
- * setCurrentAccessibleValue
- *
- * @param value0 TODO
- *
- * @return boolean
- */
- public boolean setCurrentAccessibleValue(Number value0)
- {
- return false;
- }
-
- /**
- * getMinimumAccessibleValue
- *
- * @return Number
- */
- public Number getMinimumAccessibleValue()
- {
- return null;
- }
-
- /**
- * getMaximumAccessibleValue
- *
- * @return Number
- */
- public Number getMaximumAccessibleValue()
- {
- return null;
- }
- }
-
- private static final long serialVersionUID = 1980046021813598781L;
-
- /** Whether the ProgressBar is determinate. */
- private transient boolean indeterminate = false;
-
- /** The orientation of the ProgressBar */
- protected int orientation = HORIZONTAL;
-
- /** Whether borders should be painted. */
- protected boolean paintBorder = true;
-
- /** The model describing this ProgressBar. */
- protected BoundedRangeModel model;
-
- /** The string that is displayed by the ProgressBar. */
- protected String progressString;
-
- /** Whether the string should be painted. */
- protected boolean paintString = false;
-
- /** The static changeEvent passed to all ChangeListeners. */
- protected transient ChangeEvent changeEvent;
-
- /** The ChangeListener that listens to the model. */
- protected ChangeListener changeListener;
-
- /**
- * Creates a new horizontally oriented JProgressBar object
- * with a minimum of 0 and a maximum of 100.
- */
- public JProgressBar()
- {
- this(0, 100, HORIZONTAL);
- }
-
- /**
- * Creates a new JProgressBar object with a minimum of 0,
- * a maximum of 100, and the given orientation.
- *
- * @param orientation The orientation of the JProgressBar.
- */
- public JProgressBar(int orientation)
- {
- this(0, 100, orientation);
- }
-
- /**
- * Creates a new horizontally oriented JProgressBar object
- * with the given minimum and maximum.
- *
- * @param minimum The minimum of the JProgressBar.
- * @param maximum The maximum of the JProgressBar.
- */
- public JProgressBar(int minimum, int maximum)
- {
- this(minimum, maximum, HORIZONTAL);
- }
-
- /**
- * Creates a new JProgressBar object with the given minimum,
- * maximum, and orientation.
- *
- * @param minimum The minimum of the JProgressBar.
- * @param maximum The maximum of the JProgressBar.
- * @param orientation The orientation of the JProgressBar.
- */
- public JProgressBar(int minimum, int maximum, int orientation)
- {
- model = new DefaultBoundedRangeModel(minimum, 0, minimum, maximum);
- if (orientation != HORIZONTAL && orientation != VERTICAL)
- throw new IllegalArgumentException(orientation + " is not a legal orientation");
- this.orientation = orientation;
- changeListener = createChangeListener();
- model.addChangeListener(changeListener);
- updateUI();
- }
-
- /**
- * Creates a new horizontally oriented JProgressBar object
- * with the given model.
- *
- * @param model The model to be used with the JProgressBar.
- */
- public JProgressBar(BoundedRangeModel model)
- {
- this.model = model;
- changeListener = createChangeListener();
- model.addChangeListener(changeListener);
- updateUI();
- }
-
- /**
- * This method returns the current value of the JProgressBar.
- *
- * @return The current value of the JProgressBar.
- */
- public int getValue()
- {
- return model.getValue();
- }
-
- /**
- * This method sets the value of the JProgressBar.
- *
- * @param value The value of the JProgressBar.
- */
- public void setValue(int value)
- {
- model.setValue(value);
- }
-
- /**
- * This method paints the border of the JProgressBar
- *
- * @param graphics The graphics object to paint with.
- */
- protected void paintBorder(Graphics graphics)
- {
- getBorder().paintBorder(this, graphics, 0, 0,
- getWidth(),
- getHeight());
- }
-
- /**
- * This method returns the orientation of the JProgressBar.
- *
- * @return The orientation of the JProgressBar.
- */
- public int getOrientation()
- {
- return orientation;
- }
-
- /**
- * This method changes the orientation property. The orientation of the
- * JProgressBar can be either horizontal or vertical.
- *
- * @param orientation The orientation of the JProgressBar.
- */
- public void setOrientation(int orientation)
- {
- if (orientation != VERTICAL && orientation != HORIZONTAL)
- throw new IllegalArgumentException("orientation must be one of VERTICAL or HORIZONTAL");
- if (this.orientation != orientation)
- {
- int oldOrientation = this.orientation;
- this.orientation = orientation;
- firePropertyChange("orientation", oldOrientation,
- this.orientation);
- }
- }
-
- /**
- * This method returns whether the progressString will be painted.
- *
- * @return Whether the string is painted.
- */
- public boolean isStringPainted()
- {
- return paintString;
- }
-
- /**
- * This method changes the stringPainted property.
- *
- * @param painted Whether the string is painted.
- */
- public void setStringPainted(boolean painted)
- {
- if (paintString != painted)
- {
- boolean oldPainted = paintString;
- paintString = painted;
- firePropertyChange("stringPainted", oldPainted,
- paintString);
- }
- }
-
- /**
- * This method returns the string that is painted if the
- * stringPainted property is set to true. If there is no
- * string set, it will return a string containing the
- * JProgressBar's value as a percent.
- *
- * @return The string that is painted.
- */
- public String getString()
- {
- if (progressString != null)
- return progressString;
- else
- return (int) (getPercentComplete() * 100) + "%";
- }
-
- /**
- * This method changes the string property. The string
- * given will be the one painted. If you want to
- * revert to the default string given, set the
- * string to null.
- *
- * @param string The string to be painted.
- */
- public void setString(String string)
- {
- if (((string == null || progressString == null) &&
- string != progressString) || (string != null &&
- ! string.equals(progressString)))
- {
- String oldString = progressString;
- progressString = string;
- firePropertyChange("string", oldString, progressString);
- }
- }
-
- /**
- * This method returns the percent of the bar
- * that is "complete". (This is the amount value / (max - min)).
- *
- * @return DOCUMENT ME!
- */
- public double getPercentComplete()
- {
- if (getMaximum() == getMinimum())
- return 1.0;
- else
- return (double) (model.getValue() - model.getMinimum()) / (model
- .getMaximum()
- - model.getMinimum());
- }
-
- /**
- * This method returns whether the border is painted.
- *
- * @return Whether the border is painted.
- */
- public boolean isBorderPainted()
- {
- return paintBorder;
- }
-
- /**
- * This method changes the borderPainted property.
- *
- * @param painted Whether the border is painted.
- */
- public void setBorderPainted(boolean painted)
- {
- if (painted != paintBorder)
- {
- boolean oldPainted = paintBorder;
- paintBorder = painted;
- firePropertyChange("borderPainted", oldPainted,
- paintBorder);
- }
- }
-
- /**
- * This method returns the JProgressBar's UI delegate.
- *
- * @return This JProgressBar's UI delegate.
- */
- public ProgressBarUI getUI()
- {
- return (ProgressBarUI) ui;
- }
-
- /**
- * This method changes the UI property for this JProgressBar.
- *
- * @param ui The new UI delegate.
- */
- public void setUI(ProgressBarUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method reverts the UI delegate for this JProgressBar
- * to the default for this Look and Feel.
- */
- public void updateUI()
- {
- setUI((ProgressBarUI) UIManager.getUI(this));
- invalidate();
- }
-
- /**
- * This method returns the identifier to allow the UIManager
- * to pick the correct class to act as the UI for
- * this JProgressBar.
- *
- * @return The UIClassID: "ProgressBarUI".
- */
- public String getUIClassID()
- {
- return "ProgressBarUI";
- }
-
- /**
- * This method returns a ChangeListener that gets registered
- * model. By default, the ChangeListener, propagates the
- * ChangeEvents to the ChangeListeners of the JProgressBar.
- *
- * @return A new ChangeListener.
- */
- protected ChangeListener createChangeListener()
- {
- return new ChangeListener()
- {
- public void stateChanged(ChangeEvent ce)
- {
- fireStateChanged();
- }
- };
- }
-
- /**
- * This method adds a ChangeListener to this JProgressBar.
- *
- * @param listener The ChangeListener to add to this JProgressBar.
- */
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- /**
- * This method removes a ChangeListener from this JProgressBar.
- *
- * @param listener The ChangeListener to remove from this JProgressBar.
- */
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- /**
- * This method returns an array of all ChangeListeners listening to this
- * progress bar.
- *
- * @return An array of ChangeListeners listening to this progress bar.
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
- }
-
- /**
- * This method is called when the JProgressBar receives a ChangeEvent
- * from its model. This simply propagates the event (changing the source
- * to the JProgressBar) to the JProgressBar's listeners.
- */
- protected void fireStateChanged()
- {
- Object[] changeListeners = listenerList.getListenerList();
- if (changeEvent == null)
- changeEvent = new ChangeEvent(this);
- for (int i = changeListeners.length - 2; i >= 0; i -= 2)
- {
- if (changeListeners[i] == ChangeListener.class)
- ((ChangeListener) changeListeners[i + 1]).stateChanged(changeEvent);
- }
- }
-
- /**
- * This method returns the model used with this JProgressBar.
- *
- * @return The model used with this JProgressBar.
- */
- public BoundedRangeModel getModel()
- {
- return model;
- }
-
- /**
- * This method changes the model property for this JProgressBar.
- *
- * @param model The model to use with this JProgressBar.
- */
- public void setModel(BoundedRangeModel model)
- {
- if (model != this.model)
- {
- this.model.removeChangeListener(changeListener);
- this.model = model;
- this.model.addChangeListener(changeListener);
- fireStateChanged();
- }
- }
-
- /**
- * This method returns the minimum value of this JProgressBar.
- *
- * @return The minimum value of this JProgressBar.
- */
- public int getMinimum()
- {
- return model.getMinimum();
- }
-
- /**
- * This method sets the minimum value of this JProgressBar.
- *
- * @param minimum The minimum value of this JProgressBar.
- */
- public void setMinimum(int minimum)
- {
- model.setMinimum(minimum);
- }
-
- /**
- * This method returns the maximum value of this JProgressBar.
- *
- * @return The maximum value of this JProgressBar.
- */
- public int getMaximum()
- {
- return model.getMaximum();
- }
-
- /**
- * This method sets the maximum value of this JProgressBar.
- *
- * @param maximum The maximum value of this JProgressBar.
- */
- public void setMaximum(int maximum)
- {
- model.setMaximum(maximum);
- }
-
- /**
- * This method returns a string that can be used to
- * describe this JProgressBar. This method is usually
- * only used for debugging purposes.
- *
- * @return A string that describes this JProgressBar.
- */
- protected String paramString()
- {
- return "JProgressBar";
- }
-
- /**
- * This method changes the indeterminate property. If the
- * JProgressBar is determinate, it paints a percentage
- * of the bar described by its value. If it is indeterminate,
- * it simply bounces a box between the ends of the bar; the
- * value of the JProgressBar is ignored.
- *
- * @param newValue Whether the JProgressBar is indeterminate.
- */
- public void setIndeterminate(boolean newValue)
- {
- if (indeterminate != newValue)
- {
- boolean olddeter = indeterminate;
- indeterminate = newValue;
- firePropertyChange("indeterminate", olddeter,
- indeterminate);
- }
- }
-
- /**
- * This method returns whether the JProgressBar is indeterminate.
- *
- * @return Whether this JProgressBar is indeterminate.
- */
- public boolean isIndeterminate()
- {
- return indeterminate;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJProgressBar();
-
- return accessibleContext;
- }
-}
diff --git a/libjava/javax/swing/JRadioButton.java b/libjava/javax/swing/JRadioButton.java
deleted file mode 100644
index e6d64e153ef..00000000000
--- a/libjava/javax/swing/JRadioButton.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/* JRadioButton.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.swing.plaf.ButtonUI;
-
-/**
- * The <code>JRadioButton</code> component provides a visually selectable
- * button with mutually exclusive behaviour within a <code>ButtonGroup</code>.
- * A series of radio buttons can be used to provide options to the user,
- * where the user can only select one of the available options. The state
- * of the button is provided by the superclass, <code>JToggleButton</code>.
- * <code>JRadioButton</code> adds the additional behaviour, that if two
- * or more radio buttons are grouped together, the selection of one implies
- * the deselection of the other buttons within the group.
- * <p>
- *
- * Buttons are grouped by adding each instance to a <code>ButtonGroup</code>.
- * The existence of such a grouping is not reflected visually, so other means
- * should be used to denote this. For instance, the grouped buttons can be placed
- * within the same panel, possibly with an appropriate border to denote
- * the connection between the components.
- *
- * @author Michael Koch (konqueror@gmx.de)
- * @author Graydon Hoare (graydon@redhat.com)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @see JToggleButton
- * @see ButtonGroup
- * @since 1.2
- */
-public class JRadioButton extends JToggleButton
-{
- /**
- * Compatible with Sun's JDK.
- */
- private static final long serialVersionUID = 7751949583255506856L;
-
- /**
- * This class provides accessibility support for the toggle button.
- */
- protected class AccessibleJRadioButton
- extends AccessibleJToggleButton
- {
-
- /**
- * Constructor for the accessible toggle button.
- */
- protected AccessibleJRadioButton()
- {
- /* Call the superclass to register for events */
- super();
- }
-
- /**
- * Returns the accessible role for the toggle button.
- *
- * @return An instance of <code>AccessibleRole</code>, describing
- * the role of the toggle button.
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.RADIO_BUTTON;
- }
-
- }
-
- /**
- * Constructs an unselected radio button with no text or icon.
- */
- public JRadioButton()
- {
- this(null, null, false);
- }
-
- /**
- * Constructs a radio button using the labelling, state
- * and icon specified by the supplied action.
- *
- * @param a the action to use to define the properties of the button.
- */
- public JRadioButton(Action a)
- {
- this();
- setAction(a);
- }
-
- /**
- * Constructs an unselected radio button with the supplied icon
- * and no text.
- *
- * @param icon the icon to use.
- */
- public JRadioButton(Icon icon)
- {
- this(null, icon, false);
- }
-
- /**
- * Constructs a radio button with the supplied icon and state.
- *
- * @param icon the icon to use.
- * @param selected if true, the radio button is initially in the
- * selected state. Otherwise, the button is unselected.
- */
- public JRadioButton(Icon icon, boolean selected)
- {
- this(null, icon, selected);
- }
-
- /**
- * Constructs an unselected radio button using the supplied text
- * and no icon.
- *
- * @param text the text to use.
- */
- public JRadioButton(String text)
- {
- this(text, null, false);
- }
-
- /**
- * Constructs a radio button with the supplied text and state.
- *
- * @param text the text to use.
- * @param selected if true, the radio button is initially in the
- * selected state. Otherwise, the button is unselected.
- */
- public JRadioButton(String text, boolean selected)
- {
- this(text, null, selected);
- }
-
- /**
- * Constructs an unselected radio button with the supplied text
- * and icon.
- *
- * @param text the text to use.
- * @param icon the icon to use.
- */
- public JRadioButton(String text, Icon icon)
- {
- this(text, icon, false);
- }
-
- /**
- * Constructs a radio button with the supplied text, icon and state.
- *
- * @param text the text to use.
- * @param icon the icon to use.
- * @param selected if true, the radio button is initially in the
- * selected state. Otherwise, the button is unselected.
- */
- public JRadioButton(String text, Icon icon, boolean selected)
- {
- super(text, icon, selected);
- borderPainted = false;
- contentAreaFilled = false;
- }
-
- /**
- * Returns the accessible context for this <code>JRadioButton</code>,
- * in the form of an instance of <code>AccessibleJRadioButton</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- {
- /* Create the context */
- accessibleContext = new AccessibleJRadioButton();
- }
- return accessibleContext;
- }
-
- /**
- * Returns a string specifying the name of the Look and Feel UI class
- * that renders this component.
- *
- * @return the Look and Feel UI class for <code>JRadioButton</code>s
- * as a <code>String</code>.
- */
- public String getUIClassID()
- {
- return "RadioButtonUI";
- }
-
- /**
- * Returns a string representation of this component for debugging use.
- * Users should not depend on anything as regards the content or formatting
- * of this string, except for the fact that the returned string may never be
- * null (only empty).
- *
- * @return the component in <code>String</code> form for debugging.
- */
- protected String paramString()
- {
- return "JRadioButton";
- }
-
- /**
- * This method resets the radio button's UI delegate to the default UI for
- * the current look and feel.
- */
- public void updateUI()
- {
- /*
- I can't see any difference between this and the superclass one,
- but Sun reimplements it... there is no RadioButtonUI class for it
- to be cast to.
- */
- setUI((ButtonUI) UIManager.getUI(this));
- }
-
-}
-
-
-
diff --git a/libjava/javax/swing/JRadioButtonMenuItem.java b/libjava/javax/swing/JRadioButtonMenuItem.java
deleted file mode 100644
index 76a8fef640a..00000000000
--- a/libjava/javax/swing/JRadioButtonMenuItem.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/* JRadioButtonMenuItem.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.IOException;
-import java.io.ObjectOutputStream;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * This class represents JRadioButtonMenuItem. Its behaviour is very similar
- * to JRadioButton. Just like JRadioButton, user can check and uncheck this
- * menu item by clicking on it. JRadioButtonMenuItem uses ToggleButtonModel
- * to keep track of its selection. If the JRadioButtonMenuItem is included in
- * the button group, then only one JRadioButtonMenuItem can be selected at
- * one time.
- */
-public class JRadioButtonMenuItem extends JMenuItem implements Accessible
-{
- private static final long serialVersionUID = 8482658191548521743L;
-
- /** name for the UI delegate for this radio button menu item. */
- private static final String uiClassID = "RadioButtonMenuItemUI";
-
- /**
- * Creates a new JRadioButtonMenuItem object.
- */
- public JRadioButtonMenuItem()
- {
- this(null, null);
- }
-
- /**
- * Creates a new JRadioButtonMenuItem with specified icon
- *
- * @param icon Icon to be used for this menu item
- */
- public JRadioButtonMenuItem(Icon icon)
- {
- this(null, icon);
- }
-
- /**
- * Creates a new JRadioButtonMenuItem with specified label
- *
- * @param text Label for this menu item
- */
- public JRadioButtonMenuItem(String text)
- {
- this(text, null);
- }
-
- /**
- * Creates a new JRadioButtonMenuItem using specified action
- *
- * @param action Action for this menu item
- */
- public JRadioButtonMenuItem(Action action)
- {
- this();
- setAction(action);
- }
-
- /**
- * Creates a new JRadioButtonMenuItem with specified label and icon
- *
- * @param text Label for this menu item
- * @param icon Icon for this menu item
- */
- public JRadioButtonMenuItem(String text, Icon icon)
- {
- this(text, icon, false);
- }
-
- /**
- * Creates a new JRadioButtonMenuItem with specified label
- * and marked selected if 'selected' is true.
- *
- * @param text Text for this menu item
- * @param selected Selected state of this menu item
- */
- public JRadioButtonMenuItem(String text, boolean selected)
- {
- this(text, null, selected);
- }
-
- /**
- * Creates a new JRadioButtonMenuItem with specified icon
- * and given selected state
- *
- * @param icon Icon for this menu item
- * @param selected Selected state for this menu item
- */
- public JRadioButtonMenuItem(Icon icon, boolean selected)
- {
- this(null, icon, selected);
- }
-
- /**
- * Creates a new JRadioButtonMenuItem with specified label,
- * icon and selected state.
- *
- * @param text Label for this menu item
- * @param icon Icon to be use for this menu item
- * @param selected selected state of this menu item
- */
- public JRadioButtonMenuItem(String text, Icon icon, boolean selected)
- {
- super(text, icon);
- setModel(new JToggleButton.ToggleButtonModel());
- model.setSelected(selected);
- }
-
- private void writeObject(ObjectOutputStream stream) throws IOException
- {
- }
-
- /**
- * This method returns a name to identify which look and feel class will be
- * the UI delegate for the menuItem.
- *
- * @return The Look and Feel classID. "JRadioButtonMenuItemUI"
- */
- public String getUIClassID()
- {
- return uiClassID;
- }
-
- /**
- * This method overrides JComponent.requestFocus with an empty
- * implementation, since JRadioButtonMenuItems should not
- * receve focus in general.
- */
- public void requestFocus()
- {
- // Should do nothing here
- }
-
- /**
- * A string that describes this JRadioButtonMenuItem. Normally only used
- * for debugging.
- *
- * @return A string describing this JRadioButtonMenuItem
- */
- protected String paramString()
- {
- return "JRadioButtonMenuItem";
- }
-
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJRadioButtonMenuItem();
-
- return accessibleContext;
- }
-
- protected class AccessibleJRadioButtonMenuItem extends AccessibleJMenuItem
- {
- private static final long serialVersionUID = 4381471510145292179L;
-
- /**
- * Creates a new AccessibleJRadioButtonMenuItem object.
- */
- protected AccessibleJRadioButtonMenuItem()
- {
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.RADIO_BUTTON;
- }
- }
-}
diff --git a/libjava/javax/swing/JRootPane.java b/libjava/javax/swing/JRootPane.java
deleted file mode 100644
index cb0bafd84e0..00000000000
--- a/libjava/javax/swing/JRootPane.java
+++ /dev/null
@@ -1,625 +0,0 @@
-/* JRootPane.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.LayoutManager;
-import java.awt.LayoutManager2;
-import java.io.Serializable;
-
-import javax.accessibility.AccessibleRole;
-import javax.swing.plaf.RootPaneUI;
-
-/**
- * This class is where JComponents are added to. Unlike awt where you could
- * just say frame.add(), with swing you need to say frame.getRootPane()
- * (which delivers an instance of this class) and add your components to
- * that. It is implemented by several 'layers' (pane() should be read as
- * plane()) each on top of the others where you can add components to.
- * (getContentPane(), getGlassPane(), getLayeredPane())
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public class JRootPane extends JComponent
-{
- // The class used to obtain the accessible role for this object.
- protected static class AccessibleJRootPane
- {
- /**
- * For compatability with Sun's JDK
- */
- private static final long serialVersionUID = 1082432482784468088L;
-
- /**
- * Creates a new <code>AccessibleJRootPane</code> object.
- */
- protected AccessibleJRootPane()
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.ROOT_PANE;
- }
- }
-
- // Custom Layout Manager for JRootPane. It positions contentPane and
- // menuBar withing its layeredPane.
- protected class RootLayout implements LayoutManager2, Serializable
- {
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -4100116998559815027L;
-
- /**
- * Creates a new <code>RootLayout</code> object.
- */
- protected RootLayout()
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param comp DOCUMENT ME!
- * @param constraints DOCUMENT ME!
- */
- public void addLayoutComponent(Component comp, Object constraints)
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param name DOCUMENT ME!
- * @param comp DOCUMENT ME!
- */
- public void addLayoutComponent(String name, Component comp)
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param target DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public float getLayoutAlignmentX(Container target)
- {
- return target.getAlignmentX();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param target DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public float getLayoutAlignmentY(Container target)
- {
- return target.getAlignmentY();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param target DOCUMENT ME!
- */
- public void invalidateLayout(Container target)
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param c DOCUMENT ME!
- */
- public void layoutContainer(Container c)
- {
- Dimension menuBarSize;
- Dimension containerSize = c.getSize(null);
- Dimension contentPaneSize = contentPane.getPreferredSize();
-
- /*
- if size of top-level window wasn't set then just set
- contentPane and menuBar to its preferred sizes.
- Otherwise, if the size of top-level window was specified then
- set menuBar to its preferred size and make content pane
- to fit into the remaining space
-
-
- +-------------------------------+
- | JLayeredPane |
- | +--------------------------+ |
- | | menuBar | |
- | +--------------------------+ |
- | +--------------------------+ |
- | |contentPane | |
- | | | |
- | | | |
- | | | |
- | +--------------------------+ |
- +-------------------------------+
-
- */
- if (containerSize.width == 0 && containerSize.height == 0)
- {
- if (menuBar != null)
- {
- int maxWidth;
- menuBarSize = menuBar.getPreferredSize();
- maxWidth = Math.max(menuBarSize.width, contentPaneSize.width);
- menuBar.setBounds(0, 0, maxWidth, menuBarSize.height);
- glassPane.setBounds(0, menuBarSize.height, maxWidth,
- contentPaneSize.height);
- contentPane.setBounds(0, menuBarSize.height, maxWidth,
- contentPaneSize.height);
- layeredPane.setSize(maxWidth,
- menuBarSize.height + contentPaneSize.height);
- }
- else
- {
- glassPane.setBounds(0, 0, contentPaneSize.width,
- contentPaneSize.height);
- contentPane.setBounds(0, 0, contentPaneSize.width,
- contentPaneSize.height);
- layeredPane.setSize(contentPaneSize.width, contentPaneSize.height);
- }
- }
- else
- {
- if (menuBar != null)
- {
- menuBarSize = menuBar.getPreferredSize();
- if (menuBarSize.height > containerSize.height)
- menuBarSize.height = containerSize.height;
- menuBar.setBounds(0, 0, containerSize.width, menuBarSize.height);
- int remainingHeight = containerSize.height - menuBarSize.height;
- glassPane.setBounds(0, menuBarSize.height, containerSize.width,
- containerSize.height - menuBarSize.height);
- contentPane.setBounds(0, menuBarSize.height,
- containerSize.width,
- (containerSize.height - menuBarSize.height));
- }
- else
- {
- glassPane.setBounds(0, 0, containerSize.width,
- containerSize.height);
- contentPane.setBounds(0, 0, containerSize.width,
- containerSize.height);
- }
-
- layeredPane.setSize(containerSize.width, containerSize.height);
- }
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param target DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Dimension maximumLayoutSize(Container target)
- {
- return preferredLayoutSize(target);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param target DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Dimension minimumLayoutSize(Container target)
- {
- return preferredLayoutSize(target);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param c DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Dimension preferredLayoutSize(Container c)
- {
- Dimension menuBarSize;
- Dimension prefSize;
-
- Dimension containerSize = c.getSize();
- Dimension contentPaneSize = contentPane.getPreferredSize();
-
- if (containerSize.width == 0 && containerSize.height == 0)
- {
- if (menuBar != null)
- {
- int maxWidth;
- menuBarSize = menuBar.getPreferredSize();
- maxWidth = Math.max(menuBarSize.width, contentPaneSize.width);
- prefSize = new Dimension(maxWidth,
- contentPaneSize.height
- + menuBarSize.height);
- }
- else
- prefSize = contentPaneSize;
- }
- else
- prefSize = c.getSize();
-
- return prefSize;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param comp DOCUMENT ME!
- */
- public void removeLayoutComponent(Component comp)
- {
- }
- }
-
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 8690748000348575668L;
-
- public static final int NONE = 0;
- public static final int FRAME = 1;
- public static final int PLAIN_DIALOG = 2;
- public static final int INFORMATION_DIALOG = 3;
- public static final int ERROR_DIALOG = 4;
- public static final int COLOR_CHOOSER_DIALOG = 5;
- public static final int FILE_CHOOSER_DIALOG = 6;
- public static final int QUESTION_DIALOG = 7;
- public static final int WARNING_DIALOG = 8;
-
- /** DOCUMENT ME! */
- protected Component glassPane;
-
- /** DOCUMENT ME! */
- protected JLayeredPane layeredPane;
-
- /** DOCUMENT ME! */
- protected JMenuBar menuBar;
-
- /** DOCUMENT ME! */
- protected Container contentPane;
-
- protected JButton defaultButton;
-
- /**
- * @since 1.4
- */
- private int windowDecorationStyle = NONE;
-
- /**
- * DOCUMENT ME!
- *
- * @param m DOCUMENT ME!
- */
- public void setJMenuBar(JMenuBar m)
- {
- JLayeredPane jlPane = getLayeredPane();
- if (menuBar != null)
- jlPane.remove(menuBar);
- menuBar = m;
- if (menuBar != null)
- jlPane.add(menuBar, JLayeredPane.FRAME_CONTENT_LAYER);
- }
-
- /**
- * @deprecated Replaced by <code>setJMenuBar()</code>
- */
- public void setMenuBar(JMenuBar m)
- {
- setJMenuBar(m);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public JMenuBar getJMenuBar()
- {
- return menuBar;
- }
-
- /**
- * @deprecated Replaced by <code>getJMenuBar()</code>
- */
- public JMenuBar getMenuBar()
- {
- return getJMenuBar();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public boolean isValidateRoot()
- {
- return true;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Container getContentPane()
- {
- if (contentPane == null)
- setContentPane(createContentPane());
- return contentPane;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param p DOCUMENT ME!
- */
- public void setContentPane(Container p)
- {
- contentPane = p;
- getLayeredPane().add(contentPane, JLayeredPane.FRAME_CONTENT_LAYER);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param comp DOCUMENT ME!
- * @param constraints DOCUMENT ME!
- * @param index DOCUMENT ME!
- */
- protected void addImpl(Component comp, Object constraints, int index)
- {
- super.addImpl(comp, constraints, index);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Component getGlassPane()
- {
- if (glassPane == null)
- setGlassPane(createGlassPane());
- return glassPane;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param f DOCUMENT ME!
- */
- public void setGlassPane(Component f)
- {
- if (glassPane != null)
- remove(glassPane);
-
- glassPane = f;
-
- glassPane.setVisible(false);
- add(glassPane, 0);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public JLayeredPane getLayeredPane()
- {
- if (layeredPane == null)
- setLayeredPane(createLayeredPane());
- return layeredPane;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param f DOCUMENT ME!
- */
- public void setLayeredPane(JLayeredPane f)
- {
- if (layeredPane != null)
- remove(layeredPane);
-
- layeredPane = f;
- add(f, -1);
- }
-
- /**
- * Creates a new <code>JRootPane</code> object.
- */
- public JRootPane()
- {
- setLayout(createRootLayout());
- getGlassPane();
- getLayeredPane();
- getContentPane();
- setDoubleBuffered(true);
- updateUI();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- protected LayoutManager createRootLayout()
- {
- return new RootLayout();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- protected Container createContentPane()
- {
- JPanel p = new JPanel();
- p.setName(this.getName() + ".contentPane");
- p.setLayout(new BorderLayout());
- return p;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- protected Component createGlassPane()
- {
- JPanel p = new JPanel();
- p.setName(this.getName() + ".glassPane");
- p.setLayout(new BorderLayout());
- p.setVisible(false);
- p.setOpaque(false);
- return p;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- protected JLayeredPane createLayeredPane()
- {
- JLayeredPane l = new JLayeredPane();
- l.setLayout(null);
- return l;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public RootPaneUI getUI()
- {
- return (RootPaneUI) ui;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param ui DOCUMENT ME!
- */
- public void setUI(RootPaneUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * DOCUMENT ME!
- */
- public void updateUI()
- {
- setUI((RootPaneUI) UIManager.getUI(this));
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public String getUIClassID()
- {
- return "RootPaneUI";
- }
-
- public JButton getDefaultButton()
- {
- return defaultButton;
- }
-
- public void setDefaultButton(JButton newButton)
- {
- if (defaultButton == newButton)
- return;
-
- JButton oldButton = defaultButton;
- defaultButton = newButton;
- firePropertyChange("defaultButton", oldButton, newButton);
- }
-
- /**
- * @since 1.4
- */
- public int getWindowDecorationStyle()
- {
- return windowDecorationStyle;
- }
-
- /**
- * @since 1.4
- */
- public void setWindowDecorationStyle(int style)
- {
- if (style != NONE
- && style != FRAME
- && style != INFORMATION_DIALOG
- && style != ERROR_DIALOG
- && style != COLOR_CHOOSER_DIALOG
- && style != FILE_CHOOSER_DIALOG
- && style != QUESTION_DIALOG
- && style != WARNING_DIALOG)
- throw new IllegalArgumentException("invalid style");
-
- int oldStyle = windowDecorationStyle;
- windowDecorationStyle = style;
- firePropertyChange("windowDecorationStyle", oldStyle, style);
- }
-}
diff --git a/libjava/javax/swing/JScrollBar.java b/libjava/javax/swing/JScrollBar.java
deleted file mode 100644
index caed92cf60e..00000000000
--- a/libjava/javax/swing/JScrollBar.java
+++ /dev/null
@@ -1,647 +0,0 @@
-/* JScrollBar.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Adjustable;
-import java.awt.Dimension;
-import java.awt.event.AdjustmentEvent;
-import java.awt.event.AdjustmentListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleStateSet;
-import javax.accessibility.AccessibleValue;
-import javax.swing.plaf.ScrollBarUI;
-
-/**
- * The JScrollBar. Two buttons control how the values that the
- * scroll bar can take. You can also drag the thumb or click the track
- * to move the scroll bar. Typically, the JScrollBar is used with
- * other components to translate the value of the bar to the viewable
- * contents of the other components.
- */
-public class JScrollBar extends JComponent implements Adjustable, Accessible
-{
- /**
- * DOCUMENT ME!
- */
- protected class AccessibleJScrollBar extends JComponent.AccessibleJComponent
- implements AccessibleValue
- {
- private static final long serialVersionUID = -7758162392045586663L;
-
- /**
- * Creates a new AccessibleJSlider object.
- *
- * @param value0 DOCUMENT ME!
- */
- protected AccessibleJScrollBar()
- {
- super();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleRole getAccessibleRole()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleValue getAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getCurrentAccessibleValue()
- {
- return null;
- }
-
- /**
- * setCurrentAccessibleValue
- *
- * @param value0 TODO
- *
- * @return boolean
- */
- public boolean setCurrentAccessibleValue(Number value0)
- {
- return false;
- }
-
- /**
- * getMinimumAccessibleValue
- *
- * @return Number
- */
- public Number getMinimumAccessibleValue()
- {
- return null;
- }
-
- /**
- * getMaximumAccessibleValue
- *
- * @return Number
- */
- public Number getMaximumAccessibleValue()
- {
- return null;
- }
- }
-
- private static final long serialVersionUID = -8195169869225066566L;
-
- /** How much the thumb moves when moving in a block. */
- protected int blockIncrement = 10;
-
- /** The model that holds the scroll bar's data. */
- protected BoundedRangeModel model;
-
- /** The orientation of the scroll bar. */
- protected int orientation = SwingConstants.VERTICAL;
-
- /** How much the thumb moves when moving in a unit. */
- protected int unitIncrement = 1;
-
- /**
- * Creates a new horizontal JScrollBar object with a minimum
- * of 0, a maxmium of 100, a value of 0 and an extent of 10.
- */
- public JScrollBar()
- {
- this(SwingConstants.VERTICAL, 0, 10, 0, 100);
- }
-
- /**
- * Creates a new JScrollBar object with a minimum of 0, a
- * maximum of 100, a value of 0, an extent of 10 and the given
- * orientation.
- *
- * @param orientation The orientation of the JScrollBar.
- */
- public JScrollBar(int orientation)
- {
- this(orientation, 0, 10, 0, 100);
- }
-
- /**
- * Creates a new JScrollBar object with the given orientation,
- * value, min, max, and extent.
- *
- * @param orientation The orientation to use.
- * @param value The value to use.
- * @param extent The extent to use.
- * @param min The minimum value of the scrollbar.
- * @param max The maximum value of the scrollbar.
- */
- public JScrollBar(int orientation, int value, int extent, int min, int max)
- {
- model = new DefaultBoundedRangeModel(value, extent, min, max);
- if (orientation != SwingConstants.HORIZONTAL
- && orientation != SwingConstants.VERTICAL)
- throw new IllegalArgumentException(orientation
- + " is not a legal orientation");
- this.orientation = orientation;
- updateUI();
- }
-
- /**
- * This method sets the UI of this scrollbar to
- * the given UI.
- *
- * @param ui The UI to use with this scrollbar.
- */
- public void setUI(ScrollBarUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method returns the UI that is being used
- * with this scrollbar.
- *
- * @return The scrollbar's current UI.
- */
- public ScrollBarUI getUI()
- {
- return (ScrollBarUI) ui;
- }
-
- /**
- * This method changes the UI to be the
- * default for the current look and feel.
- */
- public void updateUI()
- {
- setUI((ScrollBarUI) UIManager.getUI(this));
- invalidate();
- repaint();
- }
-
- /**
- * This method returns an identifier to
- * choose the correct UI delegate for the
- * scrollbar.
- *
- * @return The identifer to choose the UI delegate; "ScrollBarUI"
- */
- public String getUIClassID()
- {
- return "ScrollBarUI";
- }
-
- /**
- * This method returns the orientation of the scrollbar.
- *
- * @return The orientation of the scrollbar.
- */
- public int getOrientation()
- {
- return orientation;
- }
-
- /**
- * This method sets the orientation of the scrollbar.
- *
- * @param orientation The orientation of the scrollbar.
- */
- public void setOrientation(int orientation)
- {
- if (orientation != SwingConstants.HORIZONTAL
- && orientation != SwingConstants.VERTICAL)
- throw new IllegalArgumentException("orientation must be one of HORIZONTAL or VERTICAL");
- if (orientation != this.orientation)
- {
- int oldOrientation = this.orientation;
- this.orientation = orientation;
- firePropertyChange("orientation", oldOrientation,
- this.orientation);
- }
- }
-
- /**
- * This method returns the model being used with
- * the scrollbar.
- *
- * @return The scrollbar's model.
- */
- public BoundedRangeModel getModel()
- {
- return model;
- }
-
- /**
- * This method sets the model to use with
- * the scrollbar.
- *
- * @param newModel The new model to use with the scrollbar.
- */
- public void setModel(BoundedRangeModel newModel)
- {
- if (model != newModel)
- {
- BoundedRangeModel oldModel = model;
- model = newModel;
- firePropertyChange("model", oldModel, model);
- }
- }
-
- /**
- * This method returns how much the scrollbar's value
- * should change for a unit increment depending on the
- * given direction.
- *
- * @param direction The direction to scroll in.
- *
- * @return The amount the scrollbar's value will change given the direction.
- */
- public int getUnitIncrement(int direction)
- {
- return direction * unitIncrement;
- }
-
- /**
- * This method sets the unitIncrement property.
- *
- * @param unitIncrement The new unitIncrement.
- */
- public void setUnitIncrement(int unitIncrement)
- {
- if (unitIncrement != this.unitIncrement)
- {
- int oldInc = this.unitIncrement;
- this.unitIncrement = unitIncrement;
- firePropertyChange("unitIncrement", oldInc,
- this.unitIncrement);
- }
- }
-
- /**
- * The method returns how much the scrollbar's value
- * should change for a block increment depending on
- * the given direction.
- *
- * @param direction The direction to scroll in.
- *
- * @return The amount the scrollbar's value will change given the direction.
- */
- public int getBlockIncrement(int direction)
- {
- return direction * blockIncrement;
- }
-
- /**
- * This method sets the blockIncrement property.
- *
- * @param blockIncrement The new blockIncrement.
- */
- public void setBlockIncrement(int blockIncrement)
- {
- if (blockIncrement != this.blockIncrement)
- {
- int oldInc = this.blockIncrement;
- this.blockIncrement = blockIncrement;
- firePropertyChange("blockIncrement", oldInc,
- this.blockIncrement);
- }
- }
-
- /**
- * This method returns the unitIncrement.
- *
- * @return The unitIncrement.
- */
- public int getUnitIncrement()
- {
- return unitIncrement;
- }
-
- /**
- * This method returns the blockIncrement.
- *
- * @return The blockIncrement.
- */
- public int getBlockIncrement()
- {
- return blockIncrement;
- }
-
- /**
- * This method returns the value of the scrollbar.
- *
- * @return The value of the scrollbar.
- */
- public int getValue()
- {
- return model.getValue();
- }
-
- /**
- * This method changes the value of the scrollbar.
- *
- * @param value The new value of the scrollbar.
- */
- public void setValue(int value)
- {
- if (isEnabled() && value != getValue())
- {
- model.setValue(value);
- fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK, value);
- }
- }
-
- /**
- * This method returns the visible amount (AKA extent).
- * The visible amount can be used by UI delegates to
- * determine the size of the thumb.
- *
- * @return The visible amount (AKA extent).
- */
- public int getVisibleAmount()
- {
- return model.getExtent();
- }
-
- /**
- * This method sets the visible amount (AKA extent).
- *
- * @param extent The visible amount (AKA extent).
- */
- public void setVisibleAmount(int extent)
- {
- if (extent != getVisibleAmount())
- {
- model.setExtent(extent);
- fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK, extent);
- }
- }
-
- /**
- * This method returns the minimum value of the scrollbar.
- *
- * @return The minimum value of the scrollbar.
- */
- public int getMinimum()
- {
- return model.getMinimum();
- }
-
- /**
- * This method sets the minimum value of the scrollbar.
- *
- * @param minimum The minimum value of the scrollbar.
- */
- public void setMinimum(int minimum)
- {
- if (minimum != getMinimum())
- {
- model.setMinimum(minimum);
- fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK, minimum);
- }
- }
-
- /**
- * This method returns the maximum value of the scrollbar.
- *
- * @return The maximum value of the scrollbar.
- */
- public int getMaximum()
- {
- return model.getMaximum();
- }
-
- /**
- * This method sets the maximum value of the scrollbar.
- *
- * @param maximum The maximum value of the scrollbar.
- */
- public void setMaximum(int maximum)
- {
- if (maximum != getMaximum())
- {
- model.setMaximum(maximum);
- fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK, maximum);
- }
- }
-
- /**
- * This method returns the model's isAjusting value.
- *
- * @return The model's isAdjusting value.
- */
- public boolean getValueIsAdjusting()
- {
- return model.getValueIsAdjusting();
- }
-
- /**
- * This method sets the model's isAdjusting value.
- *
- * @param b The new isAdjusting value.
- */
- public void setValueIsAdjusting(boolean b)
- {
- model.setValueIsAdjusting(b);
- }
-
- /**
- * This method sets the value, extent, minimum and
- * maximum.
- *
- * @param newValue The new value.
- * @param newExtent The new extent.
- * @param newMin The new minimum.
- * @param newMax The new maximum.
- */
- public void setValues(int newValue, int newExtent, int newMin, int newMax)
- {
- if (!isEnabled())
- newValue = model.getValue();
- // It seems to be that on any change the value is fired.
- if (newValue != getValue() || newExtent != getVisibleAmount() ||
- newMin != getMinimum() || newMax != getMaximum())
- {
- model.setRangeProperties(newValue, newExtent, newMin, newMax,
- model.getValueIsAdjusting());
- fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK, newValue);
- }
- }
-
- /**
- * This method adds an AdjustmentListener to the scroll bar.
- *
- * @param listener The listener to add.
- */
- public void addAdjustmentListener(AdjustmentListener listener)
- {
- listenerList.add(AdjustmentListener.class, listener);
- }
-
- /**
- * This method removes an AdjustmentListener from the scroll bar.
- *
- * @param listener The listener to remove.
- */
- public void removeAdjustmentListener(AdjustmentListener listener)
- {
- listenerList.remove(AdjustmentListener.class, listener);
- }
-
- /**
- * This method returns an arry of all AdjustmentListeners listening to
- * this scroll bar.
- *
- * @return An array of AdjustmentListeners listening to this scroll bar.
- */
- public AdjustmentListener[] getAdjustmentListeners()
- {
- return (AdjustmentListener[]) listenerList.getListeners(AdjustmentListener.class);
- }
-
- /**
- * This method is called to fired AdjustmentEvents to the listeners
- * of this scroll bar. All AdjustmentEvents that are fired
- * will have an ID of ADJUSTMENT_VALUE_CHANGED and a type of
- * TRACK.
- *
- * @param id The ID of the adjustment event.
- * @param type The Type of change.
- * @param value The new value for the property that was changed..
- */
- protected void fireAdjustmentValueChanged(int id, int type, int value)
- {
- Object[] adjustmentListeners = listenerList.getListenerList();
- AdjustmentEvent adjustmentEvent = new AdjustmentEvent(this,
- AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK,
- value);
- for (int i = adjustmentListeners.length - 2; i >= 0; i -= 2)
- {
- if (adjustmentListeners[i] == AdjustmentListener.class)
- ((AdjustmentListener) adjustmentListeners[i + 1]).adjustmentValueChanged(adjustmentEvent);
- }
- }
-
- /**
- * This method returns the minimum size for this scroll bar.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize()
- {
- return ui.getMinimumSize(this);
- }
-
- /**
- * This method returns the maximum size for this scroll bar.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize()
- {
- return ui.getMaximumSize(this);
- }
-
- /**
- * This method overrides the setEnabled in JComponent.
- * When the scroll bar is disabled, the knob cannot
- * be moved.
- *
- * @param x Whether the scrollbar is enabled.
- */
- public void setEnabled(boolean x)
- {
- // nothing special needs to be done here since we
- // just check the enabled setting before changing the value.
- super.setEnabled(x);
- }
-
- /**
- * A string that describes this JScrollBar. Normally only used
- * for debugging.
- *
- * @return A string describing this JScrollBar.
- */
- protected String paramString()
- {
- return "JScrollBar";
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJScrollBar();
- return accessibleContext;
- }
-}
diff --git a/libjava/javax/swing/JScrollPane.java b/libjava/javax/swing/JScrollPane.java
deleted file mode 100644
index 62df956a998..00000000000
--- a/libjava/javax/swing/JScrollPane.java
+++ /dev/null
@@ -1,681 +0,0 @@
-/* JScrollPane.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.ComponentOrientation;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.Point;
-import java.awt.Rectangle;
-
-import javax.accessibility.Accessible;
-import javax.swing.border.Border;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ScrollPaneUI;
-import javax.swing.plaf.UIResource;
-
-/**
- * <table>
- * <tr><th>Property </th><th>Stored in </th><th>Bound?</th></tr>
- * <tr><td>columnHeader </td><td>scrollPane </td><td>yes </td></tr>
- * <tr><td>columnHeaderView </td><td>columnHeader </td><td>no </td></tr>
- * <tr><td>componentOrientation </td><td>scrollPane </td><td>yes </td></tr>
- * <tr><td>horizontalScrollBar </td><td>scrollPane </td><td>yes </td></tr>
- * <tr><td>horizontalScrollBarPolicy </td><td>scrollPane </td><td>yes </td></tr>
- * <tr><td>layout </td><td>scrollPane </td><td>yes </td></tr>
- * <tr><td>rowHeader </td><td>scrollPane </td><td>yes </td></tr>
- * <tr><td>rowHeaderView </td><td>rowHeader </td><td>no </td></tr>
- * <tr><td>validateRoot </td><td>scrollPane </td><td>no </td></tr>
- * <tr><td>verticalScrollBar </td><td>scrollPane </td><td>yes </td></tr>
- * <tr><td>verticalScrollBarPolicy </td><td>scrollPane </td><td>yes </td></tr>
- * <tr><td>viewport </td><td>scrollPane </td><td>yes </td></tr>
- * <tr><td>viewportBorder </td><td>scrollPane </td><td>yes </td></tr>
- * <tr><td>viewportBorderBounds </td><td>scrollPane </td><td>no </td></tr>
- * <tr><td>viewportView </td><td>viewport </td><td>no </td></tr>
- * <tr><td>wheelScrollingEnabled </td><td>scrollPane </td><td>yes </td></tr>
- * </table>
- */
-public class JScrollPane
- extends JComponent
- implements Accessible, ScrollPaneConstants
-{
- private static final long serialVersionUID = 5203525440012340014L;
-
- protected JViewport columnHeader;
- protected JViewport rowHeader;
-
- protected Component lowerLeft;
- protected Component lowerRight;
- protected Component upperLeft;
- protected Component upperRight;
-
- protected JScrollBar horizontalScrollBar;
- protected int horizontalScrollBarPolicy;
- protected JScrollBar verticalScrollBar;
- protected int verticalScrollBarPolicy;
-
- protected JViewport viewport;
-
- Border viewportBorder;
- boolean wheelScrollingEnabled;
- ChangeListener scrollListener;
-
- public JViewport getColumnHeader()
- {
- return columnHeader;
- }
-
- public Component getCorner(String key) {
- if (getComponentOrientation()
- == ComponentOrientation.LEFT_TO_RIGHT)
- {
- if (key == LOWER_LEADING_CORNER)
- key = LOWER_LEFT_CORNER;
- else if (key == LOWER_TRAILING_CORNER)
- key = LOWER_RIGHT_CORNER;
- else if (key == UPPER_LEADING_CORNER)
- key = UPPER_LEFT_CORNER;
- else if (key == UPPER_TRAILING_CORNER)
- key = UPPER_RIGHT_CORNER;
- }
- else if (getComponentOrientation()
- == ComponentOrientation.RIGHT_TO_LEFT)
- {
- if (key == LOWER_LEADING_CORNER)
- key = LOWER_RIGHT_CORNER;
- else if (key == LOWER_TRAILING_CORNER)
- key = LOWER_LEFT_CORNER;
- else if (key == UPPER_LEADING_CORNER)
- key = UPPER_RIGHT_CORNER;
- else if (key == UPPER_TRAILING_CORNER)
- key = UPPER_LEFT_CORNER;
- }
-
- if (key == LOWER_RIGHT_CORNER)
- return lowerRight;
- else if (key == UPPER_RIGHT_CORNER)
- return upperRight;
- else if (key == LOWER_LEFT_CORNER)
- return lowerLeft;
- else if (key == UPPER_LEFT_CORNER)
- return upperLeft;
- return null;
- }
-
- public JScrollBar getHorizontalScrollBar()
- {
- return horizontalScrollBar;
- }
-
- public int getHorizontalScrollBarPolicy()
- {
- return horizontalScrollBarPolicy;
- }
-
- public JViewport getRowHeader()
- {
- return rowHeader;
- }
-
- public JScrollBar getVerticalScrollBar()
- {
- return verticalScrollBar;
- }
-
- public int getVerticalScrollBarPolicy()
- {
- return verticalScrollBarPolicy;
- }
-
- public JViewport getViewport()
- {
- return viewport;
- }
-
- public Border getViewportBorder()
- {
- return viewportBorder;
- }
-
- public Rectangle getViewportBorderBounds()
- {
- if (viewportBorder == null)
- {
- if (getViewport() == null)
- return new Rectangle(0,0,0,0);
- else
- return getViewport().getBounds();
- }
- else
- {
- Insets i = viewportBorder.getBorderInsets(getViewport());
- if (getViewport() == null)
- return new Rectangle(0,0,
- i.left+i.right, i.top+i.bottom);
- else
- {
- Rectangle b = getViewport().getBounds();
- return new Rectangle(b.x - i.left,
- b.y - i.top,
- b.width + i.left + i.right,
- b.height + i.top + i.bottom);
- }
- }
- }
-
- public boolean isWheelScrollingEnabled()
- {
- return wheelScrollingEnabled;
- }
-
-
-
- private void sync()
- {
- LayoutManager m = super.getLayout();
- if (m != null && m instanceof ScrollPaneLayout)
- {
- ScrollPaneLayout sl = (ScrollPaneLayout) m;
- sl.syncWithScrollPane(this);
- }
- }
-
- private void removeNonNull(Component c)
- {
- if (c != null)
- remove(c);
- }
-
- private void addNonNull(Component c)
- {
- if (c != null)
- add(c);
- }
-
- public void setComponentOrientation(ComponentOrientation co)
- {
- ComponentOrientation old = super.getComponentOrientation();
- super.setComponentOrientation(co);
- firePropertyChange("componentOrientation", old, co);
- sync();
- }
-
- public void setColumnHeader(JViewport h)
- {
- if (columnHeader == h)
- return;
-
- JViewport old = columnHeader;
- removeNonNull(old);
- columnHeader = h;
- addNonNull(h);
- firePropertyChange("columnHeader", old, h);
- sync();
- }
-
- public void setColumnHeaderView(Component c)
- {
- if (columnHeader == null)
- setColumnHeader(createViewport());
- columnHeader.setView(c);
- sync();
- }
-
- public void setCorner(String key, Component c)
- {
- if (getComponentOrientation()
- == ComponentOrientation.LEFT_TO_RIGHT)
- {
- if (key == LOWER_LEADING_CORNER)
- key = LOWER_LEFT_CORNER;
- else if (key == LOWER_TRAILING_CORNER)
- key = LOWER_RIGHT_CORNER;
- else if (key == UPPER_LEADING_CORNER)
- key = UPPER_LEFT_CORNER;
- else if (key == UPPER_TRAILING_CORNER)
- key = UPPER_RIGHT_CORNER;
- }
- else if (getComponentOrientation()
- == ComponentOrientation.RIGHT_TO_LEFT)
- {
- if (key == LOWER_LEADING_CORNER)
- key = LOWER_RIGHT_CORNER;
- else if (key == LOWER_TRAILING_CORNER)
- key = LOWER_LEFT_CORNER;
- else if (key == UPPER_LEADING_CORNER)
- key = UPPER_RIGHT_CORNER;
- else if (key == UPPER_TRAILING_CORNER)
- key = UPPER_LEFT_CORNER;
- }
-
- if (key == LOWER_RIGHT_CORNER)
- {
- removeNonNull(lowerRight);
- lowerRight = c;
- addNonNull(c);
- }
- else if (key == UPPER_RIGHT_CORNER)
- {
- removeNonNull(upperRight);
- upperRight = c;
- addNonNull(c);
- }
- else if (key == LOWER_LEFT_CORNER)
- {
- removeNonNull(lowerLeft);
- lowerLeft = c;
- addNonNull(c);
- }
- else if (key == UPPER_LEFT_CORNER)
- {
- removeNonNull(upperLeft);
- upperLeft = c;
- addNonNull(c);
- }
- else
- throw new IllegalArgumentException("unknown corner " + key);
- sync();
- }
-
- public void setHorizontalScrollBar(JScrollBar h)
- {
- if (horizontalScrollBar == h)
- return;
-
- JScrollBar old = horizontalScrollBar;
- removeNonNull(old);
- horizontalScrollBar = h;
- addNonNull(h);
- firePropertyChange("horizontalScrollBar", old, h);
- sync();
-
- if (old != null)
- {
- BoundedRangeModel model = old.getModel();
- if (model != null)
- model.removeChangeListener(scrollListener);
- }
- if (h != null)
- {
- BoundedRangeModel model = h.getModel();
- if (model != null)
- model.addChangeListener(scrollListener);
- }
- }
-
- public void setHorizontalScrollBarPolicy(int h)
- {
- if (horizontalScrollBarPolicy == h)
- return;
-
- if (h != HORIZONTAL_SCROLLBAR_AS_NEEDED
- && h != HORIZONTAL_SCROLLBAR_NEVER
- && h != HORIZONTAL_SCROLLBAR_ALWAYS)
- throw new IllegalArgumentException("unknown horizontal scrollbar policy");
-
- int old = horizontalScrollBarPolicy;
- horizontalScrollBarPolicy = h;
- firePropertyChange("horizontalScrollBarPolicy", old, h);
- sync();
- }
-
- public void setLayout(LayoutManager l)
- {
- LayoutManager old = super.getLayout();
- ScrollPaneLayout tmp = (ScrollPaneLayout) l;
- super.setLayout(l);
- tmp.syncWithScrollPane(this);
- firePropertyChange("layout", old, l);
- sync();
- }
-
- public void setRowHeader(JViewport v)
- {
- if (rowHeader == v)
- return;
-
- JViewport old = rowHeader;
- removeNonNull(old);
- rowHeader = v;
- addNonNull(v);
- firePropertyChange("rowHeader", old, v);
- sync();
- }
-
- public void setRowHeaderView(Component c)
- {
- if (rowHeader == null)
- setRowHeader(createViewport());
- rowHeader.setView(c);
- sync();
- }
-
- public void setVerticalScrollBar(JScrollBar v)
- {
- if (verticalScrollBar == v)
- return;
-
- JScrollBar old = verticalScrollBar;
- removeNonNull(old);
- verticalScrollBar = v;
- addNonNull(v);
- firePropertyChange("verticalScrollBar", old, v);
- sync();
-
- if (old != null)
- {
- BoundedRangeModel model = old.getModel();
- if (model != null)
- model.removeChangeListener(scrollListener);
- }
- if (v != null)
- {
- BoundedRangeModel model = v.getModel();
- if (model != null)
- model.addChangeListener(scrollListener);
- }
- }
-
- public void setVerticalScrollBarPolicy(int v)
- {
- if (verticalScrollBarPolicy == v)
- return;
-
- if (v != VERTICAL_SCROLLBAR_AS_NEEDED
- && v != VERTICAL_SCROLLBAR_NEVER
- && v != VERTICAL_SCROLLBAR_ALWAYS)
- throw new IllegalArgumentException("unknown vertical scrollbar policy");
-
- int old = verticalScrollBarPolicy;
- verticalScrollBarPolicy = v;
- firePropertyChange("verticalScrollBarPolicy", old, v);
- sync();
- }
-
- public void setWheelScrollingEnabled(boolean b)
- {
- if (wheelScrollingEnabled == b)
- return;
-
- boolean old = wheelScrollingEnabled;
- wheelScrollingEnabled = b;
- firePropertyChange("wheelScrollingEnabled", old, b);
- sync();
- }
-
- public void setViewport(JViewport v)
- {
- if (viewport == v)
- return;
-
- JViewport old = viewport;
- removeNonNull(old);
- if (old != null)
- old.removeChangeListener(scrollListener);
- viewport = v;
- if (v != null)
- v.addChangeListener(scrollListener);
- addNonNull(v);
- revalidate();
- repaint();
- firePropertyChange("viewport", old, v);
- sync();
- }
-
- public void setViewportBorder(Border b)
- {
- if (viewportBorder == b)
- return;
-
- Border old = viewportBorder;
- viewportBorder = b;
- firePropertyChange("viewportBorder", old, b);
- sync();
- }
-
- public void setViewportView(Component view)
- {
- if (getViewport() == null)
- {
- setViewport(createViewport());
- }
-
- if (view != null)
- {
- getViewport().setView(view);
- }
- sync();
- }
-
- public boolean isValidateRoot()
- {
- return true;
- }
-
- ChangeListener createScrollListener()
- {
- return new ChangeListener()
- {
-
- public void stateChanged(ChangeEvent event)
- {
- JScrollBar vsb = JScrollPane.this.getVerticalScrollBar();
- JScrollBar hsb = JScrollPane.this.getHorizontalScrollBar();
- JViewport vp = JScrollPane.this.getViewport();
-
- if (vp != null && event.getSource() == vp)
- {
- // if the viewport changed, we should update the VSB / HSB
- // models according to the new vertical and horizontal sizes
-
- Rectangle vr = vp.getViewRect();
- Dimension vs = vp.getViewSize();
- if (vsb != null
- && (vsb.getMinimum() != 0
- || vsb.getMaximum() != vs.height
- || vsb.getValue() != vr.y
- || vsb.getVisibleAmount() != vr.height))
- vsb.setValues(vr.y, vr.height, 0, vs.height);
-
- if (hsb != null
- && (hsb.getMinimum() != 0
- || hsb.getMaximum() != vs.width
- || hsb.getValue() != vr.width
- || hsb.getVisibleAmount() != vr.height))
- hsb.setValues(vr.x, vr.width, 0, vs.width);
- }
- else
- {
- // otherwise we got a change update from either the VSB or
- // HSB model, and we need to update the viewport positions of
- // both the main viewport and any row or column headers to
- // match.
-
- int xpos = 0;
- int ypos = 0;
-
- if (vsb != null)
- ypos = vsb.getValue();
-
- if (hsb != null)
- xpos = hsb.getValue();
-
- Point pt = new Point(xpos, ypos);
-
- if (vp != null
- && vp.getViewPosition() != pt)
- vp.setViewPosition(pt);
-
- pt.x = 0;
-
- if (rowHeader != null
- && rowHeader.getViewPosition() != pt)
- rowHeader.setViewPosition(pt);
-
- pt.x = xpos;
- pt.y = 0;
-
- if (columnHeader != null
- && columnHeader.getViewPosition() != pt)
- columnHeader.setViewPosition(pt);
-
- }
- }
- };
- }
-
-
- public JScrollPane()
- {
- this(null);
- }
-
- public JScrollPane(Component view)
- {
- this(view,
- VERTICAL_SCROLLBAR_AS_NEEDED,
- HORIZONTAL_SCROLLBAR_AS_NEEDED);
- }
-
- public JScrollPane(int vsbPolicy, int hsbPolicy)
- {
- this(null, vsbPolicy, hsbPolicy);
- }
-
- public JScrollPane(Component view, int vsbPolicy, int hsbPolicy)
- {
- scrollListener = createScrollListener();
- setVerticalScrollBarPolicy(vsbPolicy);
- setVerticalScrollBar(createVerticalScrollBar());
- setHorizontalScrollBarPolicy(hsbPolicy);
- setHorizontalScrollBar(createHorizontalScrollBar());
- setViewportView(view);
- setLayout(new ScrollPaneLayout());
- setOpaque(false);
- updateUI();
- }
-
-
- public JScrollBar createHorizontalScrollBar()
- {
- return new ScrollBar(SwingConstants.HORIZONTAL);
- }
-
- public JScrollBar createVerticalScrollBar()
- {
- return new ScrollBar(SwingConstants.VERTICAL);
- }
-
- protected JViewport createViewport()
- {
- return new JViewport();
- }
-
- public String getUIClassID()
- {
- return "ScrollPaneUI";
- }
-
- public void updateUI()
- {
- ScrollPaneUI b = (ScrollPaneUI)UIManager.getUI(this);
- setUI(b);
- }
-
- /**
- * This method returns the scrollpane's UI delegate.
- *
- * @return The scrollpane's UI delegate.
- */
- public ScrollPaneUI getUI()
- {
- return (ScrollPaneUI) ui;
- }
-
- /**
- * This method sets the scrollpane's UI delegate.
- *
- * @param ui The scrollpane's UI delegate.
- */
- public void setUI(ScrollPaneUI ui)
- {
- super.setUI(ui);
- }
-
- protected class ScrollBar
- extends JScrollBar
- implements UIResource
- {
- public ScrollBar(int orientation)
- {
- super(orientation);
- }
-
- public int getBlockIncrement(int direction)
- {
- Component view = JScrollPane.this.getViewport().getView();
- if (view == null || (! (view instanceof Scrollable)))
- return super.getBlockIncrement(direction);
- else
- {
- Scrollable s = (Scrollable) view;
- return s.getScrollableBlockIncrement(JScrollPane.this.getViewport().getViewRect(),
- this.getOrientation(),
- direction);
- }
- }
-
- public int getUnitIncrement(int direction)
- {
- Component view = JScrollPane.this.getViewport().getView();
- if (view == null || (! (view instanceof Scrollable)))
- return super.getUnitIncrement(direction);
- else
- {
- Scrollable s = (Scrollable) view;
- return s.getScrollableUnitIncrement(JScrollPane.this.getViewport().getViewRect(),
- this.getOrientation(),
- direction);
- }
- }
- }
-}
diff --git a/libjava/javax/swing/JSeparator.java b/libjava/javax/swing/JSeparator.java
deleted file mode 100644
index 3d3e58a71a0..00000000000
--- a/libjava/javax/swing/JSeparator.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/* JSeparator.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.swing.plaf.SeparatorUI;
-
-
-/**
- * The JSeparator. It is mostly used to divide/space out
- * components.
- */
-public class JSeparator extends JComponent implements SwingConstants,
- Accessible
-{
- /**
- * AccessibleJSeparator
- */
- protected class AccessibleJSeparator extends AccessibleJComponent
- {
- private static final long serialVersionUID = 916332890553201095L;
-
- /**
- * Constructor AccessibleJSeparator
- *
- * @param component TODO
- */
- protected AccessibleJSeparator()
- {
- }
-
- /**
- * getAccessibleRole
- *
- * @return AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.SEPARATOR;
- }
- }
-
- private static final long serialVersionUID = 125301223445282357L;
-
- /** The orientation of the JSeparator. */
- private transient int orientation = HORIZONTAL;
-
- /**
- * Creates a new horizontal JSeparator object.
- */
- public JSeparator()
- {
- this(HORIZONTAL);
- }
-
- /**
- * Creates a new JSeparator object with the given orientation.
- *
- * @param orientation The orientation of the JSeparator.
- */
- public JSeparator(int orientation)
- {
- if (orientation != HORIZONTAL && orientation != VERTICAL)
- throw new IllegalArgumentException(orientation
- + " is not a valid orientation.");
- this.orientation = orientation;
- updateUI();
- }
-
- /**
- * This method returns the UI delegate being
- * used with the JSeparator.
- *
- * @return SeparatorUI The JSeparator's UI delegate.
- */
- public SeparatorUI getUI()
- {
- return (SeparatorUI) ui;
- }
-
- /**
- * This method sets the UI delegate to use
- * with the JSeparator.
- *
- * @param ui The UI delegate to use.
- */
- public void setUI(SeparatorUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method resets the UI delegate to the
- * default for the current look and feel.
- */
- public void updateUI()
- {
- setUI((SeparatorUI) UIManager.getUI(this));
- invalidate();
- }
-
- /**
- * This method returns the identifier string
- * that is used to determine the UI delegate
- * from the current look and feel.
- *
- * @return String The identifier string for the UI.
- */
- public String getUIClassID()
- {
- return "SeparatorUI";
- }
-
- /**
- * This method returns the JSeparator's orientation.
- *
- * @return int The JSeparator's orientation.
- */
- public int getOrientation()
- {
- return orientation;
- }
-
- /**
- * This method changes the JSeparator's orientation.
- *
- * @param orientation The JSeparator's orientation.
- */
- public void setOrientation(int orientation)
- {
- if (orientation != HORIZONTAL && orientation != VERTICAL)
- throw new IllegalArgumentException(orientation
- + " is not a valid orientation.");
- this.orientation = orientation;
- }
-
- /**
- * This method returns a string desribing the JSeparator.
- * Normally only used in debugging.
- *
- * @return String A string describing the JSeparator.
- */
- protected String paramString()
- {
- return "JSeparator";
- }
-
- /**
- * This method overrides the isFocusTraversable method from
- * Component to false. JSeparator cannot be focused on.
- *
- * @return boolean False.
- */
- public boolean isFocusTraversable()
- {
- return false;
- }
-
- /**
- * getAccessibleContext
- *
- * @return AccessibleContext
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJSeparator();
-
- return accessibleContext;
- }
-}
diff --git a/libjava/javax/swing/JSlider.java b/libjava/javax/swing/JSlider.java
deleted file mode 100644
index 7f995115d8f..00000000000
--- a/libjava/javax/swing/JSlider.java
+++ /dev/null
@@ -1,907 +0,0 @@
-/* JSlider.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Dimension;
-import java.awt.MenuContainer;
-import java.awt.image.ImageObserver;
-import java.io.Serializable;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleStateSet;
-import javax.accessibility.AccessibleValue;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.SliderUI;
-
-/**
- * The JSlider is a Swing component that allows selection of a value within a
- * range by adjusting a thumb in a track. The values for the minimum,
- * maximum, extent and value are stored in a {@link
- * DefaultBoundedRangeModel}.
- *
- * <p>
- * JSliders have the following properties:
- * </p>
- *
- * <table>
- * <tr><th> Property </th><th> Stored in </th><th> Bound? </th></tr>
- * <tr><td> extent </td><td> model </td><td> no </td></tr>
- * <tr><td> inverted </td><td> slider </td><td> yes </td></tr>
- * <tr><td> labelTable </td><td> slider </td><td> yes </td></tr>
- * <tr><td> majorTickSpacing </td><td> slider </td><td> yes </td></tr>
- * <tr><td> maximum </td><td> model </td><td> no </td></tr>
- * <tr><td> minimum </td><td> model </td><td> no </td></tr>
- * <tr><td> minorTickSpacing </td><td> slider </td><td> yes </td></tr>
- * <tr><td> model </td><td> slider </td><td> yes </td></tr>
- * <tr><td> orientation </td><td> slider </td><td> yes </td></tr>
- * <tr><td> paintLabels </td><td> slider </td><td> yes </td></tr>
- * <tr><td> paintTicks </td><td> slider </td><td> yes </td></tr>
- * <tr><td> snapToTicks </td><td> slider </td><td> no </td></tr>
- * <tr><td> value </td><td> model </td><td> no </td></tr>
- * <tr><td> valueIsAdjusting </td><td> model </td><td> no </td></tr>
- * </table>
- *
- * <p>
- * The various behavioral aspects of these properties follows:
- * </p>
- *
- * <ul>
- * <li>
- * When non-bound properties stored in the slider change, the slider fires
- * ChangeEvents to its ChangeListeners.
- * </li>
- * <li>
- * When bound properties stored in the slider change, the slider fires
- * PropertyChangeEvents to its PropertyChangeListeners
- * </li>
- * <li>
- * If any of the model's properties change, it fires a ChangeEvent to its
- * ChangeListeners, which include the slider.
- * </li>
- * <li>
- * If the slider receives a ChangeEvent from its model, it will propagate the
- * ChangeEvent to its ChangeListeners, with the ChangeEvent's "source"
- * property set to refer to the slider, rather than the model.
- * </li>
- * </ul>
- */
-public class JSlider extends JComponent implements SwingConstants, Accessible,
- ImageObserver,
- MenuContainer, Serializable
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -1441275936141218479L;
-
- /**
- * DOCUMENT ME!
- */
- protected class AccessibleJSlider extends JComponent.AccessibleJComponent
- implements AccessibleValue
- {
- private static final long serialVersionUID = -6301740148041106789L;
-
- /**
- * Creates a new AccessibleJSlider object.
- *
- * @param value0 DOCUMENT ME!
- */
- protected AccessibleJSlider()
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleRole getAccessibleRole()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleValue getAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getCurrentAccessibleValue()
- {
- return null;
- }
-
- /**
- * setCurrentAccessibleValue
- *
- * @param value0 TODO
- *
- * @return boolean
- */
- public boolean setCurrentAccessibleValue(Number value0)
- {
- return false;
- }
-
- /**
- * getMinimumAccessibleValue
- *
- * @return Number
- */
- public Number getMinimumAccessibleValue()
- {
- return null;
- }
-
- /**
- * getMaximumAccessibleValue
- *
- * @return Number
- */
- public Number getMaximumAccessibleValue()
- {
- return null;
- }
- }
-
- /** Whether or not this slider paints its ticks. */
- private transient boolean paintTicks = false;
-
- /** Whether or not this slider paints its track. */
- private transient boolean paintTrack = true;
-
- /** Whether or not this slider paints its labels. */
- private transient boolean paintLabels = false;
-
- /**
- * A dictionary of (Integer, Component) pairs where each Component is a
- * JLabel and the Integer determines where the label will be painted.
- */
- private transient Dictionary labelTable;
-
- /** The model used to describe the slider. */
- protected BoundedRangeModel sliderModel;
-
- /** The space between major ticks. */
- protected int majorTickSpacing;
-
- /** The space between minor ticks. */
- protected int minorTickSpacing;
-
- /** Whether the slider snaps its values to ticks. */
- protected boolean snapToTicks = true;
-
- /** The orientation of the slider. */
- protected int orientation = HORIZONTAL;
-
- /** Whether the slider is inverted. */
- private transient boolean isInverted;
-
- /** The ChangeListener that listens to the model. */
- protected ChangeListener changeListener;
-
- /** The ChangeEvent that is passed to all listeners of this slider. */
- protected transient ChangeEvent changeEvent;
-
- /**
- * Creates a new horizontal JSlider object with a minimum of 0, a maximum of
- * 100, and a value of 50.
- */
- public JSlider()
- {
- this(HORIZONTAL, 0, 100, 50);
- }
-
- /**
- * Creates a new JSlider object with the given orientation and a minimum of
- * 0, a maximum of 100, and a value of 50.
- *
- * @param orientation The orientation of the slider.
- */
- public JSlider(int orientation)
- {
- this(orientation, 0, 100, 50);
- }
-
- /**
- * Creates a new horizontal JSlider object with the given maximum and
- * minimum and a value that is halfway between the minimum and the
- * maximum.
- *
- * @param minimum The minimum value of the JSlider.
- * @param maximum The maximum value of the JSlider.
- */
- public JSlider(int minimum, int maximum)
- {
- this(HORIZONTAL, minimum, maximum, (maximum + minimum) / 2);
- }
-
- /**
- * Creates a new horizontal JSlider object with the given minimum, maximum,
- * and value.
- *
- * @param minimum The minimum value of the JSlider.
- * @param maximum The maximum value of the JSlider.
- * @param value The initial value of the JSlider.
- */
- public JSlider(int minimum, int maximum, int value)
- {
- this(HORIZONTAL, minimum, maximum, value);
- }
-
- /**
- * Creates a new JSlider object with the given orientation, minimum,
- * maximum, and value.
- *
- * @param orientation The orientation of the JSlider.
- * @param minimum The minimum value of the JSlider.
- * @param maximum The maximum value of the JSlider.
- * @param value The initial value of the JSlider.
- */
- public JSlider(int orientation, int minimum, int maximum, int value)
- {
- sliderModel = new DefaultBoundedRangeModel(value, 0, minimum, maximum);
- if (orientation != HORIZONTAL && orientation != VERTICAL)
- throw new IllegalArgumentException(orientation + " is not a legal orientation");
- this.orientation = orientation;
- changeListener = createChangeListener();
- sliderModel.addChangeListener(changeListener);
- updateUI();
- }
-
- /**
- * Creates a new horizontal JSlider object with the given model.
- *
- * @param model The model the slider will be created with.
- */
- public JSlider(BoundedRangeModel model)
- {
- if (model == null)
- sliderModel = new DefaultBoundedRangeModel(50, 0, 0, 100);
- else
- sliderModel = model;
- changeListener = createChangeListener();
- sliderModel.addChangeListener(changeListener);
- updateUI();
- }
-
- /**
- * This method returns the current value of the slider.
- *
- * @return The value of the slider stored in the model.
- */
- public int getValue()
- {
- return sliderModel.getValue();
- }
-
- /**
- * This method sets the value of the slider.
- *
- * @param value The slider's new value.
- */
- public void setValue(int value)
- {
- sliderModel.setValue(value);
- }
-
- /**
- * This method returns the slider's UI delegate.
- *
- * @return The slider's UI delegate.
- */
- public SliderUI getUI()
- {
- return (SliderUI) ui;
- }
-
- /**
- * This method sets the slider's UI delegate.
- *
- * @param ui A SliderUI object to use with this slider.
- */
- public void setUI(SliderUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method sets this slider's UI to the UIManager's default for the
- * current look and feel.
- */
- public void updateUI()
- {
- setUI((SliderUI) UIManager.getUI(this));
- invalidate();
- repaint();
- }
-
- /**
- * This method returns a name to identify which look and feel class will be
- * the UI delegate for the slider.
- *
- * @return The Look and Feel classID. "SliderUI"
- */
- public String getUIClassID()
- {
- return "SliderUI";
- }
-
- /**
- * Creates a ChangeListener for this Slider.
- *
- * @return A new ChangeListener.
- */
- protected ChangeListener createChangeListener()
- {
- return new ChangeListener()
- {
- public void stateChanged(ChangeEvent ce)
- {
- // No need to trigger a repaint since the UI listens to the model
- // as well. All we need to do is pass on the stateChanged event
- // to our listeners.
- fireStateChanged();
- }
- };
- }
-
- /**
- * This method registers a listener to this slider. The listener will be
- * informed of new ChangeEvents.
- *
- * @param listener The listener to register.
- */
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- /**
- * This method removes a listener from this slider.
- *
- * @param listener The listener to remove.
- */
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- /**
- * This method is called whenever the model fires a ChangeEvent. It should
- * propagate the ChangeEvent to its listeners with a new ChangeEvent that
- * identifies the slider as the source.
- */
- protected void fireStateChanged()
- {
- Object[] changeListeners = listenerList.getListenerList();
- if (changeEvent == null)
- changeEvent = new ChangeEvent(this);
- for (int i = changeListeners.length - 2; i >= 0; i -= 2)
- {
- if (changeListeners[i] == ChangeListener.class)
- ((ChangeListener) changeListeners[i + 1]).stateChanged(changeEvent);
- }
- }
-
- /**
- * This method returns an array of all ChangeListeners listening to this
- * slider.
- *
- * @return An array of ChangeListeners listening to this slider.
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
- }
-
- /**
- * This method returns the model of the slider.
- *
- * @return The slider's model.
- */
- public BoundedRangeModel getModel()
- {
- return sliderModel;
- }
-
- /**
- * This method changes the "model" property. It also needs to unregister
- * any listeners to the old model and register any listeners to the new
- * model.
- *
- * @param model The model to use with the slider.
- */
- public void setModel(BoundedRangeModel model)
- {
- // I didn't do the null pointer check on purpose.
- // If you try it with Sun's, it'll go ahead and set it to null
- // and bork the next time it tries to access the model.
- if (model != sliderModel)
- {
- BoundedRangeModel oldModel = sliderModel;
- sliderModel = model;
- oldModel.removeChangeListener(changeListener);
- sliderModel.addChangeListener(changeListener);
- firePropertyChange("model", oldModel, sliderModel);
- }
- }
-
- /**
- * This method returns the minimum value of the slider.
- *
- * @return The minimum value of the slider.
- */
- public int getMinimum()
- {
- return sliderModel.getMinimum();
- }
-
- /**
- * This method sets the minimum value of the slider.
- *
- * @param minimum The minimum value of the slider.
- */
- public void setMinimum(int minimum)
- {
- sliderModel.setMinimum(minimum);
- }
-
- /**
- * This method returns the maximum value of the slider.
- *
- * @return The maximum value of the slider.
- */
- public int getMaximum()
- {
- return sliderModel.getMaximum();
- }
-
- /**
- * This method sets the maximum value of the slider.
- *
- * @param maximum The maximum value of the slider.
- */
- public void setMaximum(int maximum)
- {
- sliderModel.setMaximum(maximum);
- }
-
- /**
- * This method returns this slider's isAdjusting value which is true if the
- * thumb is being dragged.
- *
- * @return The slider's isAdjusting value.
- */
- public boolean getValueIsAdjusting()
- {
- return sliderModel.getValueIsAdjusting();
- }
-
- /**
- * This method sets the isAdjusting value for the slider.
- *
- * @param adjusting The slider's isAdjusting value.
- */
- public void setValueIsAdjusting(boolean adjusting)
- {
- sliderModel.setValueIsAdjusting(adjusting);
- }
-
- /**
- * This method returns the extent value for this slider.
- *
- * @return The extent value for this slider.
- */
- public int getExtent()
- {
- return sliderModel.getExtent();
- }
-
- /**
- * This method sets the extent value for this slider.
- *
- * @param extent The extent value for this slider.
- */
- public void setExtent(int extent)
- {
- sliderModel.setExtent(extent);
- }
-
- /**
- * This method returns the slider orientation.
- *
- * @return The orientation of the slider.
- */
- public int getOrientation()
- {
- return orientation;
- }
-
- /**
- * This method changes the "orientation" property of this slider. If the
- * orientation is not VERTICAL or HORIZONTAL, this method does nothing.
- *
- * @param orientation The orientation of this slider.
- */
- public void setOrientation(int orientation)
- {
- if (orientation != VERTICAL && orientation != HORIZONTAL)
- throw new IllegalArgumentException("orientation must be one of: VERTICAL, HORIZONTAL");
- if (orientation != this.orientation)
- {
- int oldOrientation = this.orientation;
- this.orientation = orientation;
- firePropertyChange("orientation", oldOrientation,
- this.orientation);
- }
- }
-
- /**
- * This method returns the label table for this slider.
- *
- * @return The label table for this slider.
- */
- public Dictionary getLabelTable()
- {
- return labelTable;
- }
-
- /**
- * This method changes the "labelTable" property of this slider.
- *
- * @param table The label table for this slider.
- */
- public void setLabelTable(Dictionary table)
- {
- if (table != labelTable)
- {
- Dictionary oldTable = labelTable;
- labelTable = table;
- firePropertyChange("labelTable", oldTable, labelTable);
- }
- }
-
- /**
- * This method is called to reset UI delegates for the labels in the
- * labelTable to a default for the current look and feel.
- */
- protected void updateLabelUIs()
- {
- if (labelTable == null)
- return;
- for (Enumeration list = labelTable.elements(); list.hasMoreElements();)
- {
- JLabel label = (JLabel) list.nextElement();
- label.updateUI();
- }
- }
-
- /**
- * Creates a hashtable of (Integer, JLabel) pairs that can be used as a
- * label table for this slider. The labels will start from the sliders
- * minimum and increase by the increment. Each label will have a text
- * string indicating their integer value.
- *
- * @param increment The increment to between labels.
- *
- * @return A hashtable with the labels and their keys.
- */
- public Hashtable createStandardLabels(int increment)
- {
- return createStandardLabels(increment, sliderModel.getMinimum());
- }
-
- /**
- * Creates a hashtable of (Integer, JLabel) pairs that can be used as a
- * label table for this slider. The labels will start from the given start
- * value and increase by the increment. Each label will have a text string
- * indicating their integer value.
- *
- * @param increment The increment to between labels.
- * @param start The value to start from.
- *
- * @return A hashtable with the labels and their keys.
- */
- public Hashtable createStandardLabels(int increment, int start)
- {
- Hashtable table = new Hashtable();
- JLabel label;
- Dimension dim;
-
- int max = sliderModel.getMaximum();
-
- for (int i = start; i <= max; i += increment)
- {
- label = new JLabel(String.valueOf(i));
- label.setVerticalAlignment(CENTER);
- label.setHorizontalAlignment(CENTER);
-
- // Make sure these labels have the width and height
- // they want.
- dim = label.getPreferredSize();
- label.setBounds(label.getX(), label.getY(),
- (int) dim.getWidth(),
- (int) dim.getHeight());
- table.put(new Integer(i), label);
- }
- return table;
- }
-
- /**
- * This method returns whether the slider is inverted. Horizontal sliders
- * that are not inverted will have the minimums on the left. If they are
- * inverted, the minimums will be on the right. Vertical sliders that are
- * not inverted will have the minimums at the bottom. If they are inverted,
- * the minimums will be at the top.
- *
- * @return Whether this slider is inverted.
- */
- public boolean getInverted()
- {
- return isInverted;
- }
-
- /**
- * This method changes the "inverted" property for this slider.Horizontal
- * sliders that are not inverted will have the minimums on the left. If
- * they are inverted, the minimums will be on the right. Vertical sliders
- * that are not inverted will have the minimums at the bottom. If they are
- * inverted, the minimums will be at the top. However, if the slider's
- * componentOrientation is set to RIGHT_TO_LEFT, then everything gets
- * reversed again.
- *
- * @param inverted Whether the slider should be inverted.
- */
- public void setInverted(boolean inverted)
- {
- if (isInverted != inverted)
- {
- boolean oldInverted = isInverted;
- isInverted = inverted;
- firePropertyChange("inverted", oldInverted, isInverted);
- }
- }
-
- /**
- * This method returns the amount of units between each major tick mark.
- *
- * @return The amount of units between each major tick mark.
- */
- public int getMajorTickSpacing()
- {
- return majorTickSpacing;
- }
-
- /**
- * This method changes the "majorTickSpacing" property for this slider. The
- * major tick spacing is the amount of units between each major tick mark.
- *
- * @param spacing The amount of units between each major tick mark.
- */
- public void setMajorTickSpacing(int spacing)
- {
- if (majorTickSpacing != spacing)
- {
- int oldSpacing = majorTickSpacing;
- majorTickSpacing = spacing;
- firePropertyChange("majorTickSpacing", oldSpacing,
- majorTickSpacing);
- }
- }
-
- /**
- * This method returns the amount of units between each minor tick mark.
- *
- * @return The amount of units between each minor tick mark.
- */
- public int getMinorTickSpacing()
- {
- return minorTickSpacing;
- }
-
- /**
- * This method changes the "minorTickSpacing" property for this slider. The
- * minor tick spacing is the amount of units between each minor tick mark.
- *
- * @param spacing The amount of units between each minor tick mark.
- */
- public void setMinorTickSpacing(int spacing)
- {
- if (minorTickSpacing != spacing)
- {
- int oldSpacing = minorTickSpacing;
- minorTickSpacing = spacing;
- firePropertyChange("minorTickSpacing", oldSpacing,
- minorTickSpacing);
- }
- }
-
- /**
- * This method returns whether this slider is snapping to ticks. Sliders
- * that snap to ticks will automatically move the thumb to the nearest tick
- * mark.
- *
- * @return Whether this slider snaps to ticks.
- */
- public boolean getSnapToTicks()
- {
- return snapToTicks;
- }
-
- /**
- * This method sets whether this slider will snap to ticks. Sliders that
- * snap to ticks will automatically move the thumb to the nearest tick
- * mark.
- *
- * @param snap Whether this slider snaps to ticks.
- */
- public void setSnapToTicks(boolean snap)
- {
- if (snap != snapToTicks)
- {
- snapToTicks = snap;
- fireStateChanged();
- }
- }
-
- /**
- * This method returns whether the slider will paint its tick marks. In
- * addition to setting this property to true, one of minor tick spacing or
- * major tick spacing must be set to a value greater than 0 in order for
- * ticks to be painted.
- *
- * @return Whether ticks will be painted.
- */
- public boolean getPaintTicks()
- {
- return paintTicks;
- }
-
- /**
- * This method changes the "paintTicks" property for this slider. In
- * addition to setting this property to true, one of minor tick spacing or
- * major tick spacing must be set to a value greater than 0 in order for
- * ticks to be painted.
- *
- * @param paint Whether ticks will be painted.
- */
- public void setPaintTicks(boolean paint)
- {
- if (paint != paintTicks)
- {
- boolean oldPaintTicks = paintTicks;
- paintTicks = paint;
- firePropertyChange("paintTicks", oldPaintTicks, paintTicks);
- }
- }
-
- /**
- * This method returns whether the track will be painted.
- *
- * @return Whether the track will be painted.
- */
- public boolean getPaintTrack()
- {
- return paintTrack;
- }
-
- /**
- * This method sets whether the track will be painted.
- *
- * @param paint Whether the track will be painted.
- */
- public void setPaintTrack(boolean paint)
- {
- paintTrack = paint;
- }
-
- /**
- * This method returns whether labels will be painted.
- *
- * @return Whether labels will be painted.
- */
- public boolean getPaintLabels()
- {
- return paintLabels;
- }
-
- /**
- * This method changes the "paintLabels" property.
- *
- * @param paint Whether labels will be painted.
- */
- public void setPaintLabels(boolean paint)
- {
- if (paint != paintLabels)
- {
- boolean oldPaintLabels = paintLabels;
- paintLabels = paint;
- firePropertyChange("paintLabels", oldPaintLabels, paintLabels);
- }
- }
-
- /**
- * This method is used primarily for debugging purposes and returns a string
- * that can be used to represent this slider.
- *
- * @return A string representing this slider.
- */
- protected String paramString()
- {
- return "JSlider";
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJSlider();
-
- return accessibleContext;
- }
-}
diff --git a/libjava/javax/swing/JSpinner.java b/libjava/javax/swing/JSpinner.java
deleted file mode 100644
index b34382a1463..00000000000
--- a/libjava/javax/swing/JSpinner.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/* JSpinner.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.LayoutManager;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.text.DecimalFormat;
-import java.text.ParseException;
-
-import javax.swing.border.EtchedBorder;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.SpinnerUI;
-
-
-/**
- * A JSpinner is a component which typically contains a numeric value and a
- * way to manipulate the value.
- *
- * @author Ka-Hing Cheung
- *
- * @since 1.4
- */
-public class JSpinner extends JComponent
-{
- /**
- * DOCUMENT ME!
- */
- public static class StubEditor extends JLabel implements ChangeListener
- {
- /** DOCUMENT ME! */
- private JLabel label;
-
- /** DOCUMENT ME! */
- private JButton up;
-
- /** DOCUMENT ME! */
- private JButton down;
-
- /** DOCUMENT ME! */
- private JSpinner spinner;
-
- /**
- * Creates a new StubEditor object.
- *
- * @param spinner DOCUMENT ME!
- */
- public StubEditor(JSpinner spinner)
- {
- this.spinner = spinner;
- setBorder(new EtchedBorder());
- setHorizontalAlignment(SwingConstants.TRAILING);
- stateChanged(null); /* fill in the label */
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param evt DOCUMENT ME!
- */
- public void stateChanged(ChangeEvent evt)
- {
- setText(String.valueOf(spinner.getValue()));
- }
- }
-
- /**
- * DOCUMENT ME!
- */
- public static class DefaultEditor extends JPanel implements ChangeListener,
- PropertyChangeListener,
- LayoutManager
- {
- private JSpinner spinner;
-
- /**
- * For compatability with Sun's JDK 1.4.2 rev. 5
- */
- private static final long serialVersionUID = -5317788736173368172L;
-
- /**
- * Creates a new <code>DefaultEditor</code> object.
- *
- * @param spinner the <code>JSpinner</code> associated with this editor
- */
- public DefaultEditor(JSpinner spinner)
- {
- this.spinner = spinner;
-
- spinner.addChangeListener(this);
- }
-
- /**
- * Returns the <code>JSpinner</code> object for this editor.
- */
- public JSpinner getSpinner()
- {
- return spinner;
- }
-
- /**
- * DOCUMENT ME!
- */
- public void commitEdit()
- throws ParseException
- {
- } /* TODO */
-
- /**
- * DOCUMENT ME!
- *
- * @param spinner DOCUMENT ME!
- */
- public void dismiss(JSpinner spinner)
- {
- spinner.removeChangeListener(this);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public JFormattedTextField getTextField()
- {
- return null;
- } /* TODO */
-
- /**
- * DOCUMENT ME!
- *
- * @param parent DOCUMENT ME!
- */
- public void layoutContainer(Container parent)
- {
- } /* TODO */
-
- /**
- * DOCUMENT ME!
- *
- * @param parent DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Dimension minimumLayoutSize(Container parent)
- {
- return null;
- } /* TODO */
-
- /**
- * DOCUMENT ME!
- *
- * @param parent DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Dimension preferredLayoutSize(Container parent)
- {
- return null;
- } /* TODO */
-
- /**
- * DOCUMENT ME!
- *
- * @param event DOCUMENT ME!
- */
- public void propertyChange(PropertyChangeEvent event)
- {
- } /* TODO */
-
- /**
- * DOCUMENT ME!
- *
- * @param event DOCUMENT ME!
- */
- public void stateChanged(ChangeEvent event)
- {
- } /* TODO */
-
- /* no-ops */
- public void removeLayoutComponent(Component child)
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param name DOCUMENT ME!
- * @param child DOCUMENT ME!
- */
- public void addLayoutComponent(String name, Component child)
- {
- }
- }
-
- /**
- * DOCUMENT ME!
- */
- public static class NumberEditor extends DefaultEditor
- {
- /**
- * For compatability with Sun's JDK
- */
- private static final long serialVersionUID = 3791956183098282942L;
-
- /**
- * Creates a new NumberEditor object.
- *
- * @param spinner DOCUMENT ME!
- */
- public NumberEditor(JSpinner spinner)
- {
- super(spinner);
- }
-
- /**
- * Creates a new NumberEditor object.
- *
- * @param spinner DOCUMENT ME!
- */
- public NumberEditor(JSpinner spinner, String decimalFormatPattern)
- {
- super(spinner);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public DecimalFormat getFormat()
- {
- return null;
- }
-
- public SpinnerNumberModel getModel()
- {
- return (SpinnerNumberModel) getSpinner().getModel();
- }
- }
-
- /** DOCUMENT ME! */
- private SpinnerModel model;
-
- /** DOCUMENT ME! */
- private JComponent editor;
-
- /** DOCUMENT ME! */
- private ChangeListener listener = new ChangeListener()
- {
- public void stateChanged(ChangeEvent evt)
- {
- fireStateChanged();
- }
- };
-
- /**
- * Creates a JSpinner with <code>SpinnerNumberModel</code>
- *
- * @see javax.swing.SpinnerNumberModel
- */
- public JSpinner()
- {
- this(new SpinnerNumberModel());
- }
-
- /**
- * Creates a JSpinner with the specific model and sets the default editor
- *
- * @param model DOCUMENT ME!
- */
- public JSpinner(SpinnerModel model)
- {
- this.model = model;
- model.addChangeListener(listener);
- setEditor(createEditor(model));
- updateUI();
- }
-
- /**
- * If the editor is <code>JSpinner.DefaultEditor</code>, then forwards the
- * call to it, otherwise do nothing.
- *
- * @throws ParseException DOCUMENT ME!
- */
- public void commitEdit() throws ParseException
- {
- if (editor instanceof DefaultEditor)
- ((DefaultEditor) editor).commitEdit();
- }
-
- /**
- * Gets the current editor
- *
- * @return the current editor
- *
- * @see #setEditor
- */
- public JComponent getEditor()
- {
- return editor;
- }
-
- /**
- * Changes the current editor to the new editor. This methods should remove
- * the old listeners (if any) and adds the new listeners (if any).
- *
- * @param editor the new editor
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- *
- * @see #getEditor
- */
- public void setEditor(JComponent editor)
- {
- if (editor == null)
- throw new IllegalArgumentException("editor may not be null");
-
- if (this.editor instanceof DefaultEditor)
- ((DefaultEditor) editor).dismiss(this);
- else if (this.editor instanceof ChangeListener)
- removeChangeListener((ChangeListener) this.editor);
-
- if (editor instanceof ChangeListener)
- addChangeListener((ChangeListener) editor);
-
- this.editor = editor;
- }
-
- /**
- * Gets the underly model.
- *
- * @return the underly model
- */
- public SpinnerModel getModel()
- {
- return model;
- }
-
- /**
- * Sets a new underlying model.
- *
- * @param newModel the new model to set
- *
- * @exception IllegalArgumentException if newModel is <code>null</code>
- */
- public void setModel(SpinnerModel newModel)
- {
- if (newModel == null)
- throw new IllegalArgumentException();
-
- if (model == newModel)
- return;
-
- SpinnerModel oldModel = model;
- model = newModel;
- firePropertyChange("model", oldModel, newModel);
-
- if (editor == null)
- setEditor(createEditor(model));
- }
-
- /**
- * Gets the next value without changing the current value.
- *
- * @return the next value
- *
- * @see javax.swing.SpinnerModel#getNextValue
- */
- public Object getNextValue()
- {
- return model.getNextValue();
- }
-
- /**
- * Gets the previous value without changing the current value.
- *
- * @return the previous value
- *
- * @see javax.swing.SpinnerModel#getPreviousValue
- */
- public Object getPreviousValue()
- {
- return model.getPreviousValue();
- }
-
- /**
- * Gets the <code>SpinnerUI</code> that handles this spinner
- *
- * @return the <code>SpinnerUI</code>
- */
- public SpinnerUI getUI()
- {
- return (SpinnerUI) ui;
- }
-
- /**
- * Gets the current value of the spinner, according to the underly model,
- * not the UI.
- *
- * @return the current value
- *
- * @see javax.swing.SpinnerModel#getValue
- */
- public Object getValue()
- {
- return model.getValue();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param value DOCUMENT ME!
- */
- public void setValue(Object value)
- {
- model.setValue(value);
- }
-
- /**
- * This method returns a name to identify which look and feel class will be
- * the UI delegate for this spinner.
- *
- * @return The UIClass identifier. "SpinnerUI"
- */
- public String getUIClassID()
- {
- return "SpinnerUI";
- }
-
- /**
- * This method resets the spinner's UI delegate to the default UI for the
- * current look and feel.
- */
- public void updateUI()
- {
- setUI((SpinnerUI) UIManager.getUI(this));
- }
-
- /**
- * This method sets the spinner's UI delegate.
- *
- * @param ui The spinner's UI delegate.
- */
- public void setUI(SpinnerUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * Adds a <code>ChangeListener</code>
- *
- * @param listener the listener to add
- */
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- /**
- * Remove a particular listener
- *
- * @param listener the listener to remove
- */
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- /**
- * Gets all the <code>ChangeListener</code>s
- *
- * @return all the <code>ChangeListener</code>s
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
- }
-
- /**
- * Fires a <code>ChangeEvent</code> to all the <code>ChangeListener</code>s
- * added to this <code>JSpinner</code>
- */
- protected void fireStateChanged()
- {
- ChangeEvent evt = new ChangeEvent(this);
- ChangeListener[] listeners = getChangeListeners();
-
- for (int i = 0; i < listeners.length; ++i)
- listeners[i].stateChanged(evt);
- }
-
- /**
- * Creates an editor for this <code>JSpinner</code>. Really, it should be a
- * <code>JSpinner.DefaultEditor</code>, but since that should be
- * implemented by a JFormattedTextField, and one is not written, I am just
- * using a dummy one backed by a JLabel.
- *
- * @param model DOCUMENT ME!
- *
- * @return the default editor
- */
- protected JComponent createEditor(SpinnerModel model)
- {
- return new StubEditor(this);
- } /* TODO */}
diff --git a/libjava/javax/swing/JSplitPane.java b/libjava/javax/swing/JSplitPane.java
deleted file mode 100644
index d7abce99a7c..00000000000
--- a/libjava/javax/swing/JSplitPane.java
+++ /dev/null
@@ -1,815 +0,0 @@
-/* JSplitPane.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Graphics;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleStateSet;
-import javax.accessibility.AccessibleValue;
-import javax.swing.plaf.SplitPaneUI;
-
-/**
- * This class implements JSplitPane. It is used to divide two components. By
- * dragging the SplitPane's divider, the user can resize the two components.
- * Note that the divider cannot resize a component to smaller than it's
- * minimum size.
- */
-public class JSplitPane extends JComponent implements Accessible
-{
- /**
- * DOCUMENT ME!
- */
- protected class AccessibleJSplitPane extends JComponent.AccessibleJComponent
- implements AccessibleValue
- {
- private static final long serialVersionUID = -1788116871416305366L;
-
- /**
- * Creates a new AccessibleJSplitPane object.
- *
- * @param value0 DOCUMENT ME!
- */
- protected AccessibleJSplitPane()
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleRole getAccessibleRole()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleValue getAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getCurrentAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param value0 DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public boolean setCurrentAccessibleValue(Number value0)
- {
- return false;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getMinimumAccessibleValue()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getMaximumAccessibleValue()
- {
- return null;
- }
- }
-
- private static final long serialVersionUID = -5634142046175988380L;
-
- /** The constraints string used to add components to the bottom. */
- public static final String BOTTOM = "bottom";
-
- /** The property fired when the continuousLayout property changes. */
- public static final String CONTINUOUS_LAYOUT_PROPERTY = "continuousLayout";
-
- /** The property fired when the divider property changes. */
- public static final String DIVIDER = "divider";
-
- /** The property fired when the divider location property changes. */
- public static final String DIVIDER_LOCATION_PROPERTY = "dividerLocation";
-
- /** The property fired when the divider size property changes. */
- public static final String DIVIDER_SIZE_PROPERTY = "dividerSize";
-
- /**
- * The value of the orientation when the components are split horizontally.
- */
- public static final int HORIZONTAL_SPLIT = 1;
-
- /** The property fired when the last divider location property changes. */
- public static final String LAST_DIVIDER_LOCATION_PROPERTY = "lastDividerLocation";
-
- /** The constraints string used to add components to the left. */
- public static final String LEFT = "left";
-
- /** The property fired when the one touch expandable property changes. */
- public static final String ONE_TOUCH_EXPANDABLE_PROPERTY = "oneTouchExpandable";
-
- /** The property fired when the orientation property changes. */
- public static final String ORIENTATION_PROPERTY = "orientation";
-
- /** The property fired when the resize weight property changes. */
- public static final String RESIZE_WEIGHT_PROPERTY = "resizeWeight";
-
- /** The constraints string used to add components to the right. */
- public static final String RIGHT = "right";
-
- /** The constraints string used to add components to the top. */
- public static final String TOP = "top";
-
- /** The value of the orientation when the components are split vertically. */
- public static final int VERTICAL_SPLIT = 0;
-
- /** Whether the JSplitPane uses continuous layout. */
- protected boolean continuousLayout;
-
- /** Whether the JSplitPane uses one touch expandable buttons. */
- protected boolean oneTouchExpandable = false;
-
- // This is the master dividerSize variable and sets the BasicSplitPaneDivider one accordingly
-
- /** The size of the divider. */
- protected int dividerSize = 10;
-
- /** The last location of the divider given by the UI. */
- protected int lastDividerLocation;
-
- /** The orientation of the JSplitPane. */
- protected int orientation;
-
- /** The component on the top or left. */
- protected Component leftComponent;
-
- /** The component on the right or bottom. */
- protected Component rightComponent;
-
- /** Determines how extra space should be allocated. */
- private transient double resizeWeight;
-
- /**
- * Creates a new JSplitPane object with the given orientation, layout mode,
- * and left and right components.
- *
- * @param newOrientation The orientation to use.
- * @param newContinuousLayout The layout mode to use.
- * @param newLeftComponent The left component.
- * @param newRightComponent The right component.
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- */
- public JSplitPane(int newOrientation, boolean newContinuousLayout,
- Component newLeftComponent, Component newRightComponent)
- {
- if (newOrientation != HORIZONTAL_SPLIT && newOrientation != VERTICAL_SPLIT)
- throw new IllegalArgumentException("orientation is invalid.");
- orientation = newOrientation;
- continuousLayout = newContinuousLayout;
- setLeftComponent(newLeftComponent);
- setRightComponent(newRightComponent);
-
- updateUI();
- }
-
- /**
- * Creates a new JSplitPane object using nonContinuousLayout mode, the given
- * orientation and left and right components.
- *
- * @param newOrientation The orientation to use.
- * @param newLeftComponent The left component.
- * @param newRightComponent The right component.
- */
- public JSplitPane(int newOrientation, Component newLeftComponent,
- Component newRightComponent)
- {
- this(newOrientation, false, newLeftComponent, newRightComponent);
- }
-
- /**
- * Creates a new JSplitPane object with the given layout mode and
- * orientation.
- *
- * @param newOrientation The orientation to use.
- * @param newContinuousLayout The layout mode to use.
- */
- public JSplitPane(int newOrientation, boolean newContinuousLayout)
- {
- this(newOrientation, newContinuousLayout, null, null);
- }
-
- /**
- * Creates a new JSplitPane object using a nonContinuousLayout mode and the
- * given orientation.
- *
- * @param newOrientation The orientation to use.
- */
- public JSplitPane(int newOrientation)
- {
- this(newOrientation, false, null, null);
- }
-
- /**
- * Creates a new JSplitPane object using HORIZONTAL_SPLIT and a
- * nonContinuousLayout mode.
- */
- public JSplitPane()
- {
- this(HORIZONTAL_SPLIT, false, null, null);
- }
-
- /**
- * This method adds a component to the JSplitPane. The constraints object is
- * a string that identifies where this component should go. If the
- * constraints is not a known one, it will throw an
- * IllegalArgumentException. The valid constraints are LEFT, TOP, RIGHT,
- * BOTTOM and DIVIDER.
- *
- * @param comp The component to add.
- * @param constraints The constraints string to use.
- * @param index Where to place to component in the list of components.
- *
- * @throws IllegalArgumentException When the constraints is not a known identifier.
- */
- protected void addImpl(Component comp, Object constraints, int index)
- {
- int left = 0;
- int right = 1;
- int div = 2;
- int place;
- if (constraints == null)
- {
- if (leftComponent == null)
- constraints = LEFT;
- else if (rightComponent == null)
- constraints = RIGHT;
- }
-
- if (constraints instanceof String)
- {
- String placement = (String) constraints;
-
- if (placement.equals(BOTTOM) || placement.equals(RIGHT))
- {
- if (rightComponent != null)
- remove(rightComponent);
- rightComponent = comp;
- }
- else if (placement.equals(LEFT) || placement.equals(TOP))
- {
- if (leftComponent != null)
- remove(leftComponent);
- leftComponent = comp;
- }
- else if (placement.equals(DIVIDER))
- constraints = null;
- else
- throw new IllegalArgumentException("Constraints is not a known identifier.");
-
- super.addImpl(comp, constraints, index);
- }
- invalidate();
- layout();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJSplitPane();
-
- return accessibleContext;
- }
-
- /**
- * This method returns the bottom component.
- *
- * @return The bottom component.
- */
- public Component getBottomComponent()
- {
- return rightComponent;
- }
-
- /**
- * This method returns the location of the divider. This method is passed to
- * the UI.
- *
- * @return The location of the divider.
- */
- public int getDividerLocation()
- {
- if (ui != null)
- return ((SplitPaneUI) ui).getDividerLocation(this);
- else
- return -1;
- }
-
- /**
- * This method returns the size of the divider.
- *
- * @return The size of the divider.
- */
- public int getDividerSize()
- {
- return dividerSize;
- }
-
- /**
- * This method returns the last divider location.
- *
- * @return The last divider location.
- */
- public int getLastDividerLocation()
- {
- return lastDividerLocation;
- }
-
- /**
- * This method returns the left component.
- *
- * @return The left component.
- */
- public Component getLeftComponent()
- {
- return leftComponent;
- }
-
- /**
- * This method returns the maximum divider location. This method is passed
- * to the UI.
- *
- * @return DOCUMENT ME!
- */
- public int getMaximumDividerLocation()
- {
- if (ui != null)
- return ((SplitPaneUI) ui).getMaximumDividerLocation(this);
- else
- return -1;
- }
-
- /**
- * This method returns the minimum divider location. This method is passed
- * to the UI.
- *
- * @return The minimum divider location.
- */
- public int getMinimumDividerLocation()
- {
- if (ui != null)
- return ((SplitPaneUI) ui).getMinimumDividerLocation(this);
- else
- return -1;
- }
-
- /**
- * This method returns the orientation that the JSplitPane is using.
- *
- * @return The current orientation.
- */
- public int getOrientation()
- {
- return orientation;
- }
-
- /**
- * This method returns the current resize weight.
- *
- * @return The current resize weight.
- */
- public double getResizeWeight()
- {
- return resizeWeight;
- }
-
- /**
- * This method returns the right component.
- *
- * @return The right component.
- */
- public Component getRightComponent()
- {
- return rightComponent;
- }
-
- /**
- * This method returns the top component.
- *
- * @return The top component.
- */
- public Component getTopComponent()
- {
- return leftComponent;
- }
-
- /**
- * This method returns the UI.
- *
- * @return The UI.
- */
- public SplitPaneUI getUI()
- {
- return (SplitPaneUI) ui;
- }
-
- /**
- * This method returns true if the JSplitPane is using a continuousLayout.
- *
- * @return True if using a continuousLayout.
- */
- public boolean isContinuousLayout()
- {
- return continuousLayout;
- }
-
- /**
- * This method returns true if the divider has one touch expandable buttons.
- *
- * @return True if one touch expandable is used.
- */
- public boolean isOneTouchExpandable()
- {
- return oneTouchExpandable;
- }
-
- /**
- * This method returns true.
- *
- * @return true.
- */
- public boolean isValidateRoot()
- {
- return true;
- }
-
- /**
- * This method overrides JComponent's paintChildren so the UI can be
- * messaged when the children have finished painting.
- *
- * @param g The Graphics object to paint with.
- */
- protected void paintChildren(Graphics g)
- {
- super.paintChildren(g);
- if (ui != null)
- ((SplitPaneUI) ui).finishedPaintingChildren(this, g);
- }
-
- /**
- * This method returns a String that describes this JSplitPane. The string
- * is primarily used for debugging purposes.
- *
- * @return A String used for debugging purposes.
- */
- protected String paramString()
- {
- return "JSplitPane";
- }
-
- /**
- * This method removes the given component from the JSplitPane.
- *
- * @param component The Component to remove.
- */
- public void remove(Component component)
- {
- if (component == leftComponent)
- leftComponent = null;
- else if (component == rightComponent)
- rightComponent = null;
- super.remove(component);
- }
-
- /**
- * This method removes the component at the given index.
- *
- * @param index The index of the component to remove.
- */
- public void remove(int index)
- {
- Component component = getComponent(index);
- if (component == leftComponent)
- leftComponent = null;
- else if (component == rightComponent)
- rightComponent = null;
- super.remove(index);
- }
-
- /**
- * This method removes all components from the JSplitPane.
- */
- public void removeAll()
- {
- leftComponent = null;
- rightComponent = null;
- super.removeAll();
- }
-
- /**
- * This method resets all children of the JSplitPane to their preferred
- * sizes.
- */
- public void resetToPreferredSizes()
- {
- if (ui != null)
- ((SplitPaneUI) ui).resetToPreferredSizes(this);
- }
-
- /**
- * This method sets the bottom component.
- *
- * @param comp The Component to be placed at the bottom.
- */
- public void setBottomComponent(Component comp)
- {
- if (comp != null)
- add(comp, BOTTOM);
- else
- add(new JButton("right button"), BOTTOM);
- }
-
- /**
- * This method sets the layout mode for the JSplitPane.
- *
- * @param newContinuousLayout Whether the JSplitPane is in continuousLayout
- * mode.
- */
- public void setContinuousLayout(boolean newContinuousLayout)
- {
- if (newContinuousLayout != continuousLayout)
- {
- boolean oldValue = continuousLayout;
- continuousLayout = newContinuousLayout;
- firePropertyChange(CONTINUOUS_LAYOUT_PROPERTY, oldValue,
- continuousLayout);
- }
- }
-
- /**
- * This method sets the location of the divider. A value of 0 sets the
- * divider to the farthest left. A value of 1 sets the divider to the
- * farthest right.
- *
- * @param proportionalLocation A double that describes the location of the
- * divider.
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- */
- public void setDividerLocation(double proportionalLocation)
- {
- if (proportionalLocation > 1 || proportionalLocation < 0)
- throw new IllegalArgumentException("proportion has to be between 0 and 1.");
-
- int max = (orientation == HORIZONTAL_SPLIT) ? getWidth() : getHeight();
- setDividerLocation((int) (proportionalLocation * max));
- }
-
- /**
- * This method sets the location of the divider.
- *
- * @param location The location of the divider.
- */
- public void setDividerLocation(int location)
- {
- if (ui != null && location != getDividerLocation())
- {
- int oldLocation = getDividerLocation();
- ((SplitPaneUI) ui).setDividerLocation(this, location);
- firePropertyChange(DIVIDER_LOCATION_PROPERTY, oldLocation, location);
- }
- }
-
- /**
- * This method sets the size of the divider.
- *
- * @param newSize The size of the divider.
- */
- public void setDividerSize(int newSize)
- {
- if (newSize != dividerSize)
- {
- int oldSize = dividerSize;
- dividerSize = newSize;
- firePropertyChange(DIVIDER_SIZE_PROPERTY, oldSize, dividerSize);
- }
- }
-
- // This doesn't appear to do anything when set from user side.
- // so it probably is only used from the UI side to change the
- // lastDividerLocation var.
-
- /**
- * This method sets the last location of the divider.
- *
- * @param newLastLocation The last location of the divider.
- */
- public void setLastDividerLocation(int newLastLocation)
- {
- if (newLastLocation != lastDividerLocation)
- {
- int oldValue = lastDividerLocation;
- lastDividerLocation = newLastLocation;
- firePropertyChange(LAST_DIVIDER_LOCATION_PROPERTY, oldValue,
- lastDividerLocation);
- }
- }
-
- /**
- * This method sets the left component.
- *
- * @param comp The left component.
- */
- public void setLeftComponent(Component comp)
- {
- if (comp != null)
- add(comp, LEFT);
- else
- add(new JButton("left button"), LEFT);
- }
-
- /**
- * This method sets whether the divider has one touch expandable buttons.
- * The one touch expandable buttons can expand the size of either component
- * to the maximum allowed size.
- *
- * @param newValue Whether the divider will have one touch expandable
- * buttons.
- */
- public void setOneTouchExpandable(boolean newValue)
- {
- if (newValue != oneTouchExpandable)
- {
- boolean oldValue = oneTouchExpandable;
- oneTouchExpandable = newValue;
- firePropertyChange(ONE_TOUCH_EXPANDABLE_PROPERTY, oldValue,
- oneTouchExpandable);
- }
- }
-
- /**
- * This method sets the orientation of the JSplitPane.
- *
- * @param orientation The orientation of the JSplitPane.
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- */
- public void setOrientation(int orientation)
- {
- if (orientation != HORIZONTAL_SPLIT && orientation != VERTICAL_SPLIT)
- throw new IllegalArgumentException("orientation must be one of VERTICAL_SPLIT, HORIZONTAL_SPLIT");
- if (orientation != this.orientation)
- {
- int oldOrientation = this.orientation;
- this.orientation = orientation;
- firePropertyChange(ORIENTATION_PROPERTY, oldOrientation,
- this.orientation);
- }
- }
-
- /**
- * This method determines how extra space will be distributed among the left
- * and right components. A value of 0 will allocate all extra space to the
- * right component. A value of 1 indicates that all extra space will go to
- * the left component. A value in between 1 and 0 will split the space
- * accordingly.
- *
- * @param value The resize weight.
- */
- public void setResizeWeight(double value)
- {
- resizeWeight = value;
- }
-
- /**
- * This method sets the right component.
- *
- * @param comp The right component.
- */
- public void setRightComponent(Component comp)
- {
- if (comp != null)
- add(comp, RIGHT);
- else
- add(new JButton("right button"), RIGHT);
- }
-
- /**
- * This method sets the top component.
- *
- * @param comp The top component.
- */
- public void setTopComponent(Component comp)
- {
- if (comp != null)
- add(comp, TOP);
- else
- add(new JButton("left button"), TOP);
- }
-
- /**
- * This method sets the UI used by the JSplitPane.
- *
- * @param ui The UI to use.
- */
- public void setUI(SplitPaneUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method resets the UI to the one specified by the current Look and
- * Feel.
- */
- public void updateUI()
- {
- setUI((SplitPaneUI) UIManager.getUI(this));
- invalidate();
- repaint();
- }
-
- /**
- * This method returns a string identifier to determine which UI class it
- * needs.
- *
- * @return A string that identifies it's UI class.
- */
- public String getUIClassID()
- {
- return "SplitPaneUI";
- }
-}
diff --git a/libjava/javax/swing/JTabbedPane.java b/libjava/javax/swing/JTabbedPane.java
deleted file mode 100644
index bd7adfd9951..00000000000
--- a/libjava/javax/swing/JTabbedPane.java
+++ /dev/null
@@ -1,1476 +0,0 @@
-/* JTabbedPane.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Color;
-import java.awt.Component;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.MouseEvent;
-import java.io.Serializable;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleSelection;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.TabbedPaneUI;
-import javax.swing.plaf.UIResource;
-
-/**
- * This is a container for components. One component is displayed at a time.
- * Users can switch between components by clicking on tabs.
- *
- * <p>
- * Tabs can be oriented in several ways. They can be above, below, left and
- * right of the component. Tabs can either wrap around (by creating multiple
- * rows of tabs) or they can be scrolled (where only a subset of the tabs
- * can be seen at once). More tabs can be added by calling the
- * add/addTab/insertTab methods.
- * </p>
- */
-public class JTabbedPane extends JComponent implements Serializable,
- Accessible,
- SwingConstants
-{
- /**
- * DOCUMENT ME!
- */
- protected class AccessibleJTabbedPane extends JComponent.AccessibleJComponent
- implements AccessibleSelection, ChangeListener
- {
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 7610530885966830483L;
-
- /**
- * Creates a new AccessibleJTabbedPane object.
- */
- public AccessibleJTabbedPane()
- {
- super();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param e DOCUMENT ME!
- */
- public void stateChanged(ChangeEvent e)
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleRole getAccessibleRole()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public int getAccessibleChildrenCount()
- {
- return 0;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param i DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Accessible getAccessibleChild(int i)
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleSelection getAccessibleSelection()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param p DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Accessible getAccessibleAt(Point p)
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public int getAccessibleSelectionCount()
- {
- return 0;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param i DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Accessible getAccessibleSelection(int i)
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param i DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public boolean isAccessibleChildSelected(int i)
- {
- return false;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param i DOCUMENT ME!
- */
- public void addAccessibleSelection(int i)
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param i DOCUMENT ME!
- */
- public void removeAccessibleSelection(int i)
- {
- }
-
- /**
- * DOCUMENT ME!
- */
- public void clearAccessibleSelection()
- {
- }
-
- /**
- * DOCUMENT ME!
- */
- public void selectAllAccessibleSelection()
- {
- }
- }
-
- /**
- * A helper class that listens for changes to the model.
- */
- protected class ModelListener implements ChangeListener, Serializable
- {
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 497359819958114132L;
-
- /**
- * Creates a new ModelListener object.
- */
- protected ModelListener()
- {
- }
-
- /**
- * This method is called whenever the model is changed.
- *
- * @param e The ChangeEvent that is passed from the model.
- */
- public void stateChanged(ChangeEvent e)
- {
- // Propagate to our listeners.
- fireStateChanged();
- }
- }
-
- /**
- * A private class that holds all the information for each tab.
- */
- private class Page
- {
- /** The tooltip string. */
- private String tip;
-
- /** The component associated with the tab. */
- private Component component;
-
- /** The active icon associated with the tab. */
- private transient Icon icon;
-
- /** The disabled icon associated with the tab. */
- private transient Icon disabledIcon;
-
- /** The tab's enabled status. */
- private transient boolean enabled = true;
-
- /** The string painted on the tab. */
- private transient String title;
-
- /** The background color of the tab. */
- private transient Color bg;
-
- /** The foreground color of the tab. */
- private transient Color fg;
-
- /** The mnemonic associated with the tab. */
- private transient int mnemonicKey;
-
- /** The index of the underlined character in the string. */
- private transient int underlinedChar = -1;
-
- /**
- * Creates a new data storage for the tab.
- *
- * @param title The string displayed on the tab.
- * @param icon The active icon displayed on the tab.
- * @param component The component associated with the tab.
- * @param tip The tooltip associated with the tab.
- */
- protected Page(String title, Icon icon, Component component, String tip)
- {
- this.title = title;
- this.icon = icon;
- this.component = component;
- this.tip = tip;
- }
-
- /**
- * This method returns the component associated with the tab.
- *
- * @return The component associated with the tab.
- */
- public Component getComponent()
- {
- return component;
- }
-
- /**
- * This method sets the component associated with the tab.
- *
- * @param c The component associated with the tab.
- */
- public void setComponent(Component c)
- {
- remove(component);
- this.component = c;
- add(c);
- }
-
- /**
- * This method returns the tooltip string.
- *
- * @return The tooltip string.
- */
- public String getTip()
- {
- return tip;
- }
-
- /**
- * This method sets the tooltip string.
- *
- * @param tip The tooltip string.
- */
- public void setTip(String tip)
- {
- this.tip = tip;
- }
-
- /**
- * This method returns the background color.
- *
- * @return The background color.
- */
- public Color getBackground()
- {
- return bg;
- }
-
- /**
- * This method sets the background color.
- *
- * @param background The background color.
- */
- public void setBackground(Color background)
- {
- bg = background;
- }
-
- /**
- * This method returns the foreground color.
- *
- * @return The foreground color.
- */
- public Color getForeground()
- {
- return fg;
- }
-
- /**
- * This method sets the foreground color.
- *
- * @param foreground The foreground color.
- */
- public void setForeground(Color foreground)
- {
- fg = foreground;
- }
-
- /**
- * This method returns the title associated with the tab.
- *
- * @return The title of the tab.
- */
- public String getTitle()
- {
- return title;
- }
-
- /** DOCUMENT ME! */
- private static final long serialVersionUID = 1614381073220130939L;
-
- /**
- * This method sets the title of the tab.
- *
- * @param text The title of the tab.
- */
- public void setTitle(String text)
- {
- title = text;
- if (title != null && title.length() <= underlinedChar)
- setDisplayedMnemonicIndex(title.length() - 1);
- }
-
- /**
- * This method returns the active icon.
- *
- * @return The active icon.
- */
- public Icon getIcon()
- {
- return icon;
- }
-
- /**
- * This method sets the active icon.
- *
- * @param icon The active icon.
- */
- public void setIcon(Icon icon)
- {
- this.icon = icon;
- }
-
- /**
- * This method returns the disabled icon.
- *
- * @return The disabled icon.
- */
- public Icon getDisabledIcon()
- {
- if (disabledIcon == null && icon instanceof ImageIcon)
- setDisabledIcon(icon);
- return disabledIcon;
- }
-
- /**
- * This method sets the disabled icon.
- *
- * @param disabledIcon The disabled icon.
- */
- public void setDisabledIcon(Icon disabledIcon)
- {
- this.disabledIcon = disabledIcon;
- }
-
- /**
- * This method returns whether the tab is enabled.
- *
- * @return Whether the tab is enabled.
- */
- public boolean isEnabled()
- {
- return enabled;
- }
-
- /**
- * This method sets whether the tab is enabled.
- *
- * @param enabled Whether this tab is enabled.
- */
- public void setEnabled(boolean enabled)
- {
- this.enabled = enabled;
- }
-
- /**
- * This method returns the mnemonic.
- *
- * @return The mnemonic.
- */
- public int getMnemonic()
- {
- return (int) mnemonicKey;
- }
-
- /**
- * This method sets the mnemonic. If the title is set, it will update the
- * mnemonicIndex.
- *
- * @param key The mnemonic.
- */
- public void setMnemonic(int key)
- {
- setMnemonic((char) key);
- }
-
- /**
- * This method sets the mnemonic. If the title is set, it will update the
- * mnemonicIndex.
- *
- * @param aChar The mnemonic.
- */
- public void setMnemonic(char aChar)
- {
- mnemonicKey = aChar;
- if (title != null)
- setDisplayedMnemonicIndex(title.indexOf(mnemonicKey));
- }
-
- /**
- * This method returns the mnemonicIndex.
- *
- * @return The mnemonicIndex.
- */
- public int getDisplayedMnemonicIndex()
- {
- return underlinedChar;
- }
-
- /**
- * This method sets the mnemonicIndex.
- *
- * @param index The mnemonicIndex.
- *
- * @throws IllegalArgumentException If index less than -1 || index greater
- * or equal to title.length.
- */
- public void setDisplayedMnemonicIndex(int index)
- throws IllegalArgumentException
- {
- if (index < -1 || title != null && index >= title.length())
- throw new IllegalArgumentException();
-
- if (title == null || mnemonicKey == 0 || title.charAt(index) != mnemonicKey)
- index = -1;
-
- underlinedChar = index;
- }
- }
-
- /** The changeEvent used to fire changes to listeners. */
- protected ChangeEvent changeEvent;
-
- /** The listener that listens to the model. */
- protected ChangeListener changeListener;
-
- /** The model that describes this JTabbedPane. */
- protected SingleSelectionModel model;
-
- /** Indicates that the TabbedPane is in scrolling mode. */
- public static final int SCROLL_TAB_LAYOUT = 1;
-
- /** Indicates that the TabbedPane is in wrap mode. */
- public static final int WRAP_TAB_LAYOUT = 0;
-
- /** The current tabPlacement of the TabbedPane. */
- protected int tabPlacement = SwingConstants.TOP;
-
- /** The current tabLayoutPolicy of the TabbedPane. */
- private transient int layoutPolicy;
-
- /** The list of tabs associated with the TabbedPane. */
- transient Vector tabs = new Vector();
-
- /**
- * Creates a new JTabbedPane object with tabs on top and using wrap tab
- * layout.
- */
- public JTabbedPane()
- {
- this(SwingConstants.TOP, WRAP_TAB_LAYOUT);
- }
-
- /**
- * Creates a new JTabbedPane object using wrap tab layout and the given
- * tabPlacement.
- *
- * @param tabPlacement Where the tabs will be placed.
- */
- public JTabbedPane(int tabPlacement)
- {
- this(tabPlacement, WRAP_TAB_LAYOUT);
- }
-
- /**
- * Creates a new JTabbedPane object with the given tabPlacement and
- * tabLayoutPolicy.
- *
- * @param tabPlacement Where the tabs will be placed.
- * @param tabLayoutPolicy The way tabs will be placed.
- *
- * @throws IllegalArgumentException If tabLayoutPolicy or tabPlacement are
- * not valid.
- */
- public JTabbedPane(int tabPlacement, int tabLayoutPolicy)
- {
- if (tabPlacement != TOP && tabPlacement != BOTTOM && tabPlacement != RIGHT
- && tabPlacement != LEFT)
- throw new IllegalArgumentException("tabPlacement is not valid.");
- if (tabLayoutPolicy != SCROLL_TAB_LAYOUT
- && tabLayoutPolicy != WRAP_TAB_LAYOUT)
- throw new IllegalArgumentException("tabLayoutPolicy is not valid.");
- this.tabPlacement = tabPlacement;
- layoutPolicy = tabLayoutPolicy;
-
- changeEvent = new ChangeEvent(this);
- changeListener = createChangeListener();
-
- model = new DefaultSingleSelectionModel();
- model.addChangeListener(changeListener);
-
- updateUI();
- }
-
- /**
- * This method returns the UI used to display the JTabbedPane.
- *
- * @return The UI used to display the JTabbedPane.
- */
- public TabbedPaneUI getUI()
- {
- return (TabbedPaneUI) ui;
- }
-
- /**
- * This method sets the UI used to display the JTabbedPane.
- *
- * @param ui The UI used to display the JTabbedPane.
- */
- public void setUI(TabbedPaneUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method restores the UI to the defaults given by the UIManager.
- */
- public void updateUI()
- {
- setUI((TabbedPaneUI) UIManager.getUI(this));
- invalidate();
- }
-
- /**
- * This method returns a string identifier that is used to determine which
- * UI will be used with the JTabbedPane.
- *
- * @return A string identifier for the UI.
- */
- public String getUIClassID()
- {
- return "TabbedPaneUI";
- }
-
- /**
- * This method creates a ChangeListener that is used to listen to the model
- * for events.
- *
- * @return A ChangeListener to listen to the model.
- */
- protected ChangeListener createChangeListener()
- {
- return new ModelListener();
- }
-
- /**
- * This method adds a ChangeListener to the JTabbedPane.
- *
- * @param l The ChangeListener to add.
- */
- public void addChangeListener(ChangeListener l)
- {
- listenerList.add(ChangeListener.class, l);
- }
-
- /**
- * This method removes a ChangeListener to the JTabbedPane.
- *
- * @param l The ChangeListener to remove.
- */
- public void removeChangeListener(ChangeListener l)
- {
- listenerList.remove(ChangeListener.class, l);
- }
-
- /**
- * This method fires a ChangeEvent to all the JTabbedPane's ChangeListeners.
- */
- protected void fireStateChanged()
- {
- Object[] changeListeners = listenerList.getListenerList();
- if (changeEvent == null)
- changeEvent = new ChangeEvent(this);
- for (int i = changeListeners.length - 2; i >= 0; i -= 2)
- {
- if (changeListeners[i] == ChangeListener.class)
- ((ChangeListener) changeListeners[i + 1]).stateChanged(changeEvent);
- }
- }
-
- /**
- * This method returns all ChangeListeners registered with the JTabbedPane.
- *
- * @return The ChangeListeners registered with the JTabbedPane.
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) super.getListeners(ChangeListener.class);
- }
-
- /**
- * This method returns the model used with the JTabbedPane.
- *
- * @return The JTabbedPane's model.
- */
- public SingleSelectionModel getModel()
- {
- return model;
- }
-
- /**
- * This method changes the model property of the JTabbedPane.
- *
- * @param model The new model to use with the JTabbedPane.
- */
- public void setModel(SingleSelectionModel model)
- {
- if (model != this.model)
- {
- SingleSelectionModel oldModel = this.model;
- this.model.removeChangeListener(changeListener);
- this.model = model;
- this.model.addChangeListener(changeListener);
- firePropertyChange("model", oldModel, this.model);
- }
- }
-
- /**
- * This method returns the tabPlacement.
- *
- * @return The tabPlacement used with the JTabbedPane.
- */
- public int getTabPlacement()
- {
- return tabPlacement;
- }
-
- /**
- * This method changes the tabPlacement property of the JTabbedPane.
- *
- * @param tabPlacement The tabPlacement to use.
- *
- * @throws IllegalArgumentException If tabPlacement is not one of TOP,
- * BOTTOM, LEFT, or RIGHT.
- */
- public void setTabPlacement(int tabPlacement)
- {
- if (tabPlacement != TOP && tabPlacement != BOTTOM && tabPlacement != RIGHT
- && tabPlacement != LEFT)
- throw new IllegalArgumentException("tabPlacement is not valid.");
- if (tabPlacement != this.tabPlacement)
- {
- int oldPlacement = this.tabPlacement;
- this.tabPlacement = tabPlacement;
- firePropertyChange("tabPlacement", oldPlacement, this.tabPlacement);
- }
- }
-
- /**
- * This method returns the tabLayoutPolicy.
- *
- * @return The tabLayoutPolicy.
- */
- public int getTabLayoutPolicy()
- {
- return layoutPolicy;
- }
-
- /**
- * This method changes the tabLayoutPolicy property of the JTabbedPane.
- *
- * @param tabLayoutPolicy The tabLayoutPolicy to use.
- *
- * @throws IllegalArgumentException If tabLayoutPolicy is not one of
- * SCROLL_TAB_LAYOUT or WRAP_TAB_LAYOUT.
- */
- public void setTabLayoutPolicy(int tabLayoutPolicy)
- {
- if (tabLayoutPolicy != SCROLL_TAB_LAYOUT
- && tabLayoutPolicy != WRAP_TAB_LAYOUT)
- throw new IllegalArgumentException("tabLayoutPolicy is not valid.");
- if (tabLayoutPolicy != layoutPolicy)
- {
- int oldPolicy = layoutPolicy;
- layoutPolicy = tabLayoutPolicy;
- firePropertyChange("tabLayoutPolicy", oldPolicy, layoutPolicy);
- }
- }
-
- /**
- * This method returns the index of the tab that is currently selected.
- *
- * @return The index of the selected tab.
- */
- public int getSelectedIndex()
- {
- return model.getSelectedIndex();
- }
-
- /**
- * This method checks the index.
- *
- * @param index The index to check.
- * @param start DOCUMENT ME!
- * @param end DOCUMENT ME!
- *
- * @throws IndexOutOfBoundsException DOCUMENT ME!
- */
- private void checkIndex(int index, int start, int end)
- {
- if (index < start || index >= end)
- throw new IndexOutOfBoundsException("Index < " + start + " || Index >= "
- + end);
- }
-
- /**
- * This method sets the selected index. This method will hide the old
- * component and show the new component.
- *
- * @param index The index to set it at.
- */
- public void setSelectedIndex(int index)
- {
- checkIndex(index, -1, tabs.size());
- if (index != getSelectedIndex())
- {
- if (getSelectedIndex() != -1 && getSelectedComponent() != null)
- getSelectedComponent().hide();
- if (index != -1 && getComponentAt(index) != null)
- getComponentAt(index).show();
- model.setSelectedIndex(index);
- }
- }
-
- /**
- * This method returns the component at the selected index.
- *
- * @return The component at the selected index.
- */
- public Component getSelectedComponent()
- {
- return getComponentAt(getSelectedIndex());
- }
-
- /**
- * This method sets the component at the selected index.
- *
- * @param c The component associated with the selected index.
- */
- public void setSelectedComponent(Component c)
- {
- if (c.getParent() == this)
- setSelectedIndex(indexOfComponent(c));
- else
- setComponentAt(getSelectedIndex(), c);
- }
-
- /**
- * This method inserts tabs into JTabbedPane. This includes adding the
- * component to the JTabbedPane and hiding it.
- *
- * @param title The title of the tab.
- * @param icon The tab's icon.
- * @param component The component associated with the tab.
- * @param tip The tooltip for the tab.
- * @param index The index to insert the tab at.
- */
- public void insertTab(String title, Icon icon, Component component,
- String tip, int index)
- {
- Page p = new Page(title, icon, component, tip);
- tabs.insertElementAt(p, index);
-
- // Hide the component so we don't see it. Do it before we parent it
- // so we don't trigger a repaint.
- if (component != null)
- {
- component.hide();
- super.add(component);
- }
-
- if (getSelectedIndex() == -1)
- setSelectedIndex(0);
-
- layout();
- repaint();
- }
-
- /**
- * This method adds a tab to the JTabbedPane.
- *
- * @param title The title of the tab.
- * @param icon The icon for the tab.
- * @param component The associated component.
- * @param tip The associated tooltip.
- */
- public void addTab(String title, Icon icon, Component component, String tip)
- {
- insertTab(title, icon, component, tip, tabs.size());
- }
-
- /**
- * This method adds a tab to the JTabbedPane.
- *
- * @param title The title of the tab.
- * @param icon The icon for the tab.
- * @param component The associated component.
- */
- public void addTab(String title, Icon icon, Component component)
- {
- insertTab(title, icon, component, null, tabs.size());
- }
-
- /**
- * This method adds a tab to the JTabbedPane.
- *
- * @param title The title of the tab.
- * @param component The associated component.
- */
- public void addTab(String title, Component component)
- {
- insertTab(title, null, component, null, tabs.size());
- }
-
- /**
- * This method adds a tab to the JTabbedPane. The title of the tab is the
- * Component's name. If the Component is an instance of UIResource, it
- * doesn't add the tab and instead add the component directly to the
- * JTabbedPane.
- *
- * @param component The associated component.
- *
- * @return The Component that was added.
- */
- public Component add(Component component)
- {
- if (component instanceof UIResource)
- super.add(component);
- else
- insertTab(component.getName(), null, component, null, tabs.size());
- return component;
- }
-
- /**
- * This method adds a tab to the JTabbedPane. If the Component is an
- * instance of UIResource, it doesn't add the tab and instead add the
- * component directly to the JTabbedPane.
- *
- * @param title The title of the tab.
- * @param component The associated component.
- *
- * @return The Component that was added.
- */
- public Component add(String title, Component component)
- {
- if (component instanceof UIResource)
- super.add(component);
- else
- insertTab(title, null, component, null, tabs.size());
- return component;
- }
-
- /**
- * This method adds a tab to the JTabbedPane. If the Component is an
- * instance of UIResource, it doesn't add the tab and instead add the
- * component directly to the JTabbedPane.
- *
- * @param component The associated component.
- * @param index The index to insert the tab at.
- *
- * @return The Component that was added.
- */
- public Component add(Component component, int index)
- {
- if (component instanceof UIResource)
- super.add(component);
- else
- insertTab(component.getName(), null, component, null, index);
- return component;
- }
-
- /**
- * This method adds a tab to the JTabbedPane. If the Component is an
- * instance of UIResource, it doesn't add the tab and instead add the
- * component directly to the JTabbedPane. If the constraints object is an
- * icon, it will be used as the tab's icon. If the constraints object is a
- * string, we will use it as the title.
- *
- * @param component The associated component.
- * @param constraints The constraints object.
- */
- public void add(Component component, Object constraints)
- {
- add(component, constraints, tabs.size());
- }
-
- /**
- * This method adds a tab to the JTabbedPane. If the Component is an
- * instance of UIResource, it doesn't add the tab and instead add the
- * component directly to the JTabbedPane. If the constraints object is an
- * icon, it will be used as the tab's icon. If the constraints object is a
- * string, we will use it as the title.
- *
- * @param component The associated component.
- * @param constraints The constraints object.
- * @param index The index to insert the tab at.
- */
- public void add(Component component, Object constraints, int index)
- {
- if (component instanceof UIResource)
- super.add(component);
- else
- {
- if (constraints instanceof String)
- insertTab((String) constraints, null, component, null, index);
- else
- insertTab(component.getName(),
- (constraints instanceof Icon) ? (Icon) constraints : null,
- component, null, index);
- }
- }
-
- /**
- * The tab and it's associated component are removed. After the component
- * has been removed from the JTabbedPane, it's set visible to ensure that
- * it can be seen.
- *
- * @param index The index of the tab to remove.
- */
- public void removeTabAt(int index)
- {
- checkIndex(index, 0, tabs.size());
- Component c = getComponentAt(index);
- super.remove(index);
- c.show();
- tabs.remove(index);
- }
-
- /**
- * This method removes the component from the JTabbedPane. After the
- * component has been removed from the JTabbedPane, it's set visible to
- * ensure that it can be seen.
- *
- * @param component The Component to remove.
- */
- public void remove(Component component)
- {
- // This simply removes the component.
- int index = indexOfComponent(component);
- super.remove(component);
- component.show();
- setComponentAt(index, null);
- }
-
- /**
- * This method removes the tab and component from the JTabbedPane. It simply
- * calls removeTabAt(int index).
- *
- * @param index The index of the tab to remove.
- */
- public void remove(int index)
- {
- removeTabAt(index);
- }
-
- /**
- * This method removes all tabs and associated components from the
- * JTabbedPane.
- */
- public void removeAll()
- {
- for (int i = tabs.size() - 1; i >= 0; i--)
- removeTabAt(i);
- }
-
- /**
- * This method returns how many tabs are in the JTabbedPane.
- *
- * @return The number of tabs in the JTabbedPane.
- */
- public int getTabCount()
- {
- return tabs.size();
- }
-
- /**
- * This method returns the number of runs used to paint the JTabbedPane.
- *
- * @return The number of runs.
- */
- public int getTabRunCount()
- {
- return ((TabbedPaneUI) ui).getTabRunCount(this);
- }
-
- /**
- * This method returns the tab title given the index.
- *
- * @param index The index of the tab.
- *
- * @return The title for the tab.
- */
- public String getTitleAt(int index)
- {
- checkIndex(index, 0, tabs.size());
- return ((Page) tabs.elementAt(index)).getTitle();
- }
-
- /**
- * This method returns the active icon given the index.
- *
- * @param index The index of the tab.
- *
- * @return The active icon for the tab.
- */
- public Icon getIconAt(int index)
- {
- checkIndex(index, 0, tabs.size());
- return ((Page) tabs.elementAt(index)).getIcon();
- }
-
- /**
- * This method returns the disabled icon given the index.
- *
- * @param index The index of the tab.
- *
- * @return The disabled icon for the tab.
- */
- public Icon getDisabledIconAt(int index)
- {
- checkIndex(index, 0, tabs.size());
- return ((Page) tabs.elementAt(index)).getDisabledIcon();
- }
-
- /**
- * This method returns the tooltip string for the tab.
- *
- * @param index The index of the tab.
- *
- * @return The tooltip string for the tab.
- */
- public String getToolTipTextAt(int index)
- {
- checkIndex(index, 0, tabs.size());
- return ((Page) tabs.elementAt(index)).getTip();
- }
-
- /**
- * This method returns the foreground color for the tab.
- *
- * @param index The index of the tab.
- *
- * @return The foreground color for the tab.
- */
- public Color getForegroundAt(int index)
- {
- checkIndex(index, 0, tabs.size());
- return ((Page) tabs.elementAt(index)).getForeground();
- }
-
- /**
- * This method returns the background color for the tab.
- *
- * @param index The index of the tab.
- *
- * @return The background color for the tab.
- */
- public Color getBackgroundAt(int index)
- {
- checkIndex(index, 0, tabs.size());
- return ((Page) tabs.elementAt(index)).getBackground();
- }
-
- /**
- * This method returns the component associated with the tab.
- *
- * @param index The index of the tab.
- *
- * @return The component associated with the tab.
- */
- public Component getComponentAt(int index)
- {
- checkIndex(index, 0, tabs.size());
- return ((Page) tabs.elementAt(index)).getComponent();
- }
-
- /**
- * This method returns whether this tab is enabled. Disabled tabs cannot be
- * selected.
- *
- * @param index The index of the tab.
- *
- * @return Whether the tab is enabled.
- */
- public boolean isEnabledAt(int index)
- {
- checkIndex(index, 0, tabs.size());
- return ((Page) tabs.elementAt(index)).isEnabled();
- }
-
- /**
- * This method returns the mnemonic for the tab.
- *
- * @param tabIndex The index of the tab.
- *
- * @return The mnemonic for the tab.
- */
- public int getMnemonicAt(int tabIndex)
- {
- checkIndex(tabIndex, 0, tabs.size());
- return ((Page) tabs.elementAt(tabIndex)).getMnemonic();
- }
-
- /**
- * This method returns the mnemonic index for the tab.
- *
- * @param tabIndex The index of the tab.
- *
- * @return The mnemonic index for the tab.
- */
- public int getDisplayedMnemonicIndexAt(int tabIndex)
- {
- checkIndex(tabIndex, 0, tabs.size());
- return ((Page) tabs.elementAt(tabIndex)).getDisplayedMnemonicIndex();
- }
-
- /**
- * This method returns the bounds of the tab given the index.
- *
- * @param index The index of the tab.
- *
- * @return A rectangle describing the bounds of the tab.
- */
- public Rectangle getBoundsAt(int index)
- {
- checkIndex(index, 0, tabs.size());
- return ((TabbedPaneUI) ui).getTabBounds(this, index);
- }
-
- /**
- * This method sets the title of the tab.
- *
- * @param index The index of the tab.
- * @param title The new title.
- */
- public void setTitleAt(int index, String title)
- {
- checkIndex(index, 0, tabs.size());
- ((Page) tabs.elementAt(index)).setTitle(title);
- }
-
- /**
- * This method sets the icon of the tab.
- *
- * @param index The index of the tab.
- * @param icon The new icon.
- */
- public void setIconAt(int index, Icon icon)
- {
- checkIndex(index, 0, tabs.size());
- ((Page) tabs.elementAt(index)).setIcon(icon);
- }
-
- /**
- * This method sets the disabled icon of the tab.
- *
- * @param index The index of the tab.
- * @param disabledIcon The new disabled icon.
- */
- public void setDisabledIconAt(int index, Icon disabledIcon)
- {
- checkIndex(index, 0, tabs.size());
- ((Page) tabs.elementAt(index)).setDisabledIcon(disabledIcon);
- }
-
- /**
- * This method sets the tooltip text of the tab.
- *
- * @param index The index of the tab.
- * @param toolTipText The tooltip text.
- */
- public void setToolTipTextAt(int index, String toolTipText)
- {
- checkIndex(index, 0, tabs.size());
- ((Page) tabs.elementAt(index)).setTip(toolTipText);
- }
-
- /**
- * This method sets the background color of the tab.
- *
- * @param index The index of the tab.
- * @param background The background color of the tab.
- */
- public void setBackgroundAt(int index, Color background)
- {
- checkIndex(index, 0, tabs.size());
- ((Page) tabs.elementAt(index)).setBackground(background);
- }
-
- /**
- * This method sets the foreground color of the tab.
- *
- * @param index The index of the tab.
- * @param foreground The foreground color of the tab.
- */
- public void setForegroundAt(int index, Color foreground)
- {
- checkIndex(index, 0, tabs.size());
- ((Page) tabs.elementAt(index)).setForeground(foreground);
- }
-
- /**
- * This method sets whether the tab is enabled.
- *
- * @param index The index of the tab.
- * @param enabled Whether the tab is enabled.
- */
- public void setEnabledAt(int index, boolean enabled)
- {
- checkIndex(index, 0, tabs.size());
- ((Page) tabs.elementAt(index)).setEnabled(enabled);
- }
-
- /**
- * This method sets the component associated with the tab.
- *
- * @param index The index of the tab.
- * @param component The component associated with the tab.
- */
- public void setComponentAt(int index, Component component)
- {
- checkIndex(index, 0, tabs.size());
- ((Page) tabs.elementAt(index)).setComponent(component);
- }
-
- /**
- * This method sets the displayed mnemonic index of the tab.
- *
- * @param tabIndex The index of the tab.
- * @param mnemonicIndex The mnemonic index.
- */
- public void setDisplayedMnemonicIndexAt(int tabIndex, int mnemonicIndex)
- {
- checkIndex(tabIndex, 0, tabs.size());
- ((Page) tabs.elementAt(tabIndex)).setDisplayedMnemonicIndex(mnemonicIndex);
- }
-
- /**
- * This method sets the mnemonic for the tab.
- *
- * @param tabIndex The index of the tab.
- * @param mnemonic The mnemonic.
- */
- public void setMnemonicAt(int tabIndex, int mnemonic)
- {
- checkIndex(tabIndex, 0, tabs.size());
- ((Page) tabs.elementAt(tabIndex)).setMnemonic(mnemonic);
- }
-
- /**
- * This method finds the index of a tab given the title.
- *
- * @param title The title that belongs to a tab.
- *
- * @return The index of the tab that has the title or -1 if not found.
- */
- public int indexOfTab(String title)
- {
- int index = -1;
- for (int i = 0; i < tabs.size(); i++)
- {
- if (((Page) tabs.elementAt(i)).getTitle().equals(title))
- {
- index = i;
- break;
- }
- }
- return index;
- }
-
- /**
- * This method finds the index of a tab given the icon.
- *
- * @param icon The icon that belongs to a tab.
- *
- * @return The index of the tab that has the icon or -1 if not found.
- */
- public int indexOfTab(Icon icon)
- {
- int index = -1;
- for (int i = 0; i < tabs.size(); i++)
- {
- if (((Page) tabs.elementAt(i)).getIcon() == icon)
- {
- index = i;
- break;
- }
- }
- return index;
- }
-
- /**
- * This method finds the index of a tab given the component.
- *
- * @param component A component associated with a tab.
- *
- * @return The index of the tab that has this component or -1 if not found.
- */
- public int indexOfComponent(Component component)
- {
- int index = -1;
- for (int i = 0; i < tabs.size(); i++)
- {
- if (((Page) tabs.elementAt(i)).getComponent() == component)
- {
- index = i;
- break;
- }
- }
- return index;
- }
-
- /**
- * This method returns a tab index given an (x,y) location. The origin of
- * the (x,y) pair will be the JTabbedPane's top left position. The tab
- * returned will be the one that contains the point. This method is
- * delegated to the UI.
- *
- * @param x The x coordinate of the point.
- * @param y The y coordinate of the point.
- *
- * @return The index of the tab that contains the point.
- */
- public int indexAtLocation(int x, int y)
- {
- return ((TabbedPaneUI) ui).tabForCoordinate(this, x, y);
- }
-
- /**
- * This method returns the tooltip text given a mouse event.
- *
- * @param event The mouse event.
- *
- * @return The tool tip text that is associated with this mouse event.
- */
- public String getToolTipText(MouseEvent event)
- {
- int index = indexAtLocation(event.getX(), event.getY());
- return ((Page) tabs.elementAt(index)).getTip();
- }
-
- /**
- * This method returns a string representation of this JTabbedPane. It is
- * mainly used for debugging purposes.
- *
- * @return A string representation of this JTabbedPane.
- */
- protected String paramString()
- {
- return "JTabbedPane";
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJTabbedPane();
- return accessibleContext;
- }
-}
diff --git a/libjava/javax/swing/JTable.java b/libjava/javax/swing/JTable.java
deleted file mode 100644
index 6ee5d2d0810..00000000000
--- a/libjava/javax/swing/JTable.java
+++ /dev/null
@@ -1,1877 +0,0 @@
-/* JTable.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.swing.event.CellEditorListener;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableColumnModelEvent;
-import javax.swing.event.TableColumnModelListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.plaf.TableUI;
-import javax.swing.table.DefaultTableCellRenderer;
-import javax.swing.table.DefaultTableColumnModel;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.JTableHeader;
-import javax.swing.table.TableCellEditor;
-import javax.swing.table.TableCellRenderer;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableColumnModel;
-import javax.swing.table.TableModel;
-
-public class JTable extends JComponent
- implements TableModelListener, Scrollable, TableColumnModelListener,
- ListSelectionListener, CellEditorListener, Accessible
-{
- private static final long serialVersionUID = 3876025080382781659L;
-
-
- /**
- * When resizing columns, do not automatically change any columns. In this
- * case the table should be enclosed in a {@link JScrollPane} in order to
- * accomodate cases in which the table size exceeds its visible area.
- */
- public static final int AUTO_RESIZE_OFF = 0;
-
- /**
- * When resizing column <code>i</code>, automatically change only the
- * single column <code>i+1</code> to provide or absorb excess space
- * requirements.
- */
- public static final int AUTO_RESIZE_NEXT_COLUMN = 1;
-
- /**
- * When resizing column <code>i</code> in a table of <code>n</code>
- * columns, automatically change all columns in the range <code>[i+1,
- * n)</code>, uniformly, to provide or absorb excess space requirements.
- */
- public static final int AUTO_RESIZE_SUBSEQUENT_COLUMNS = 2;
-
- /**
- * When resizing column <code>i</code> in a table of <code>n</code>
- * columns, automatically change all columns in the range <code>[0,
- * n)</code> (with the exception of column i) uniformly, to provide or
- * absorb excess space requirements.
- */
- public static final int AUTO_RESIZE_ALL_COLUMNS = 4;
-
- /**
- * When resizing column <code>i</code> in a table of <code>n</code>
- * columns, automatically change column <code>n-1</code> (the last column
- * in the table) to provide or absorb excess space requirements.
- */
- public static final int AUTO_RESIZE_LAST_COLUMN = 3;
-
-
- /**
- * A table mapping {@link java.lang.Class} objects to
- * {@link TableCellEditor} objects. This table is consulted by the
- * FIXME
- */
- protected Hashtable defaultEditorsByColumnClass;
-
- /**
- * A table mapping {@link java.lang.Class} objects to
- * {@link TableCellEditor} objects. This table is consulted by the
- * FIXME
- */
- protected Hashtable defaultRenderersByColumnClass;
-
- /**
- * The column that is edited, -1 if the table is not edited currently.
- */
- protected int editingColumn;
-
- /**
- * The row that is edited, -1 if the table is not edited currently.
- */
- protected int editingRow;
-
- /**
- * The component that is used for editing.
- * <code>null</code> if the table is not editing currently.
- *
- */
- protected transient Component editorComp;
-
- /**
- * Whether or not the table should automatically compute a matching
- * {@link TableColumnModel} and assign it to the {@link #columnModel}
- * property when the {@link #dataModel} property is changed.
- *
- * @see #setModel()
- * @see #createColumnsFromModel()
- * @see #setColumnModel()
- * @see #setAutoCreateColumnsFromModel()
- * @see #getAutoCreateColumnsFromModel()
- */
- protected boolean autoCreateColumnsFromModel;
-
- /**
- * A numeric code specifying the resizing behavior of the table. Must be
- * one of {@link #AUTO_RESIZE_ALL_COLUMNS} (the default), {@link
- * #AUTO_RESIZE_LAST_COLUMN}, {@link #AUTO_RESIZE_NEXT_COLUMN}, {@link
- * #AUTO_RESIZE_SUBSEQUENT_COLUMNS}, or {@link #AUTO_RESIZE_OFF}.
- *
- * @see #doLayout()
- * @see #setAutoResizeMode()
- * @see #getAutoResizeMode()
- */
- protected int autoResizeMode;
-
- /**
- * The height in pixels of any row of the table. All rows in a table are
- * of uniform height. This differs from column width, which varies on a
- * per-column basis, and is stored in the individual columns of the
- * {@link #columnModel}.
- *
- * @see #getRowHeight()
- * @see #setRowHeight()
- * @see TableColumn#getWidth()
- * @see TableColumn#setWidth()
- */
- protected int rowHeight;
-
- /**
- * The height in pixels of the gap left between any two rows of the table.
- *
- * @see #setRowMargin()
- * @see #getRowHeight()
- * @see #getIntercellSpacing()
- * @see #setIntercellSpacing()
- * @see TableColumnModel#getColumnMargin()
- * @see TableColumnModel#setColumnMargin()
- */
- protected int rowMargin;
-
- /**
- * Whether or not the table should allow row selection. If the table
- * allows both row <em>and</em> column selection, it is said to allow
- * "cell selection". Previous versions of the JDK supported cell
- * selection as an independent concept, but it is now represented solely
- * in terms of simultaneous row and column selection.
- *
- * @see TableColumnModel#columnSelectionAllowed()
- * @see #setRowSelectionAllowed()
- * @see #getRowSelectionAllowed()
- * @see #getCellSelectionEnabled()
- * @see #setCellSelectionEnabled()
- */
- protected boolean rowSelectionAllowed;
-
- /**
- * @deprecated Use {@link #rowSelectionAllowed}, {@link
- * #columnSelectionAllowed}, or the combined methods {@link
- * getCellSelectionEnabled} and {@link setCellSelectionEnabled}.
- */
- protected boolean cellSelectionEnabled;
-
- /**
- * The model for data stored in the table. Confusingly, the published API
- * requires that this field be called <code>dataModel</code>, despite its
- * property name. The table listens to its model as a {@link
- * TableModelListener}.
- *
- * @see #tableChanged()
- * @see TableModel#addTableModelListener()
- */
- protected TableModel dataModel;
-
- /**
- * <p>A model of various aspects of the columns of the table, <em>not
- * including</em> the data stored in them. The {@link TableColumnModel}
- * is principally concerned with holding a set of {@link TableColumn}
- * objects, each of which describes the display parameters of a column
- * and the numeric index of the column from the data model which the
- * column is presenting.</p>
- *
- * <p>The TableColumnModel also contains a {@link ListSelectionModel} which
- * indicates which columns are currently selected. This selection model
- * works in combination with the {@link selectionModel} of the table
- * itself to specify a <em>table selection</em>: a combination of row and
- * column selections.</p>
- *
- * <p>Most application programmers do not need to work with this property
- * at all: setting {@link #autoCreateColumnsFromModel} will construct the
- * columnModel automatically, and the table acts as a facade for most of
- * the interesting properties of the columnModel anyways.</p>
- *
- * @see #setColumnModel()
- * @see #getColumnModel()
- */
- protected TableColumnModel columnModel;
-
- /**
- * A model of the rows of this table which are currently selected. This
- * model is used in combination with the column selection model held as a
- * member of the {@link columnModel} property, to represent the rows and
- * columns (or both: cells) of the table which are currently selected.
- *
- * @see #rowSelectionAllowed
- * @see #setSelectionModel()
- * @see #getSelectionModel()
- * @see TableColumnModel#getSelectionModel()
- * @see ListSelectionModel#addListSelectionListener()
- */
- protected ListSelectionModel selectionModel;
-
- /**
- * The accessibleContext property.
- */
- protected AccessibleContext accessibleContext;
-
- /**
- * The current cell editor.
- */
- protected TableCellEditor cellEditor;
-
- /**
- * Whether or not drag-and-drop is enabled on this table.
- *
- * @see #setDragEnabled()
- * @see #getDragEnabled()
- */
- private boolean dragEnabled;
-
- /**
- * The color to paint the grid lines of the table, when either {@link
- * #showHorizontalLines} or {@link #showVerticalLines} is set.
- *
- * @see #setGridColor()
- * @see #getGridColor()
- */
- protected Color gridColor;
-
- /**
- * The size this table would prefer its viewport assume, if it is
- * contained in a {@link JScrollPane}.
- *
- * @see #setPreferredScrollableViewportSize()
- * @see #getPreferredScrollableViewportSize()
- */
- protected Dimension preferredViewportSize;
-
- /**
- * The color to paint the background of selected cells. Fires a property
- * change event with name {@link #SELECTION_BACKGROUND_CHANGED_PROPERTY}
- * when its value changes.
- *
- * @see #setSelectionBackground()
- * @see #getSelectionBackground()
- */
- protected Color selectionBackground;
-
- /**
- * The name carried in property change events when the {@link
- * #selectionBackground} property changes.
- */
- private static final String SELECTION_BACKGROUND_CHANGED_PROPERTY = "selectionBackground";
-
- /**
- * The color to paint the foreground of selected cells. Fires a property
- * change event with name {@link #SELECTION_FOREGROUND_CHANGED_PROPERTY}
- * when its value changes.
- *
- * @see #setSelectionForeground()
- * @see #getSelectionForeground()
- */
- protected Color selectionForeground;
-
- /**
- * The name carried in property change events when the
- * {@link #selectionForeground} property changes.
- */
- private static final String SELECTION_FOREGROUND_CHANGED_PROPERTY = "selectionForeground";
-
- /**
- * The showHorizontalLines property.
- */
- protected boolean showHorizontalLines;
-
- /**
- * The showVerticalLines property.
- */
- protected boolean showVerticalLines;
-
- /**
- * The tableHeader property.
- */
- protected JTableHeader tableHeader;
-
-
- /**
- * Creates a new <code>JTable</code> instance.
- */
- public JTable ()
- {
- this(null, null, null);
- }
-
- /**
- * Creates a new <code>JTable</code> instance.
- *
- * @param numRows an <code>int</code> value
- * @param numColumns an <code>int</code> value
- */
- public JTable (int numRows, int numColumns)
- {
- this(new DefaultTableModel(numRows, numColumns));
- }
-
- /**
- * Creates a new <code>JTable</code> instance.
- *
- * @param data an <code>Object[][]</code> value
- * @param columnNames an <code>Object[]</code> value
- */
- public JTable(Object[][] data, Object[] columnNames)
- {
- this(new DefaultTableModel(data, columnNames));
- }
-
- /**
- * Creates a new <code>JTable</code> instance.
- *
- * @param dm a <code>TableModel</code> value
- */
- public JTable (TableModel dm)
- {
- this(dm, null, null);
- }
-
- /**
- * Creates a new <code>JTable</code> instance.
- *
- * @param dm a <code>TableModel</code> value
- * @param cm a <code>TableColumnModel</code> value
- */
- public JTable (TableModel dm, TableColumnModel cm)
- {
- this(dm, cm, null);
- }
-
- /**
- * Creates a new <code>JTable</code> instance.
- *
- * @param dm a <code>TableModel</code> value
- * @param cm a <code>TableColumnModel</code> value
- * @param sm a <code>ListSelectionModel</code> value
- */
- public JTable (TableModel dm, TableColumnModel cm, ListSelectionModel sm)
- {
- this.dataModel = dm == null ? createDefaultDataModel() : dm;
- setSelectionModel(sm == null ? createDefaultSelectionModel() : sm);
-
- this.columnModel = cm;
- initializeLocalVars();
- updateUI();
- }
-
- protected void initializeLocalVars()
- {
- this.autoCreateColumnsFromModel = false;
- if (columnModel == null)
- {
- this.autoCreateColumnsFromModel = true;
- createColumnsFromModel();
- }
- this.columnModel.addColumnModelListener(this);
-
- this.defaultRenderersByColumnClass = new Hashtable();
- createDefaultRenderers();
-
- this.defaultEditorsByColumnClass = new Hashtable();
- createDefaultEditors();
-
- this.autoResizeMode = AUTO_RESIZE_ALL_COLUMNS;
- this.rowHeight = 16;
- this.rowMargin = 1;
- this.rowSelectionAllowed = true;
- // this.accessibleContext = new AccessibleJTable();
- this.cellEditor = null;
- this.dragEnabled = false;
- this.preferredViewportSize = new Dimension(450,400);
- this.showHorizontalLines = true;
- this.showVerticalLines = true;
- this.editingColumn = -1;
- this.editingRow = -1;
- setIntercellSpacing(new Dimension(1,1));
- setTableHeader(createDefaultTableHeader());
- }
-
- /**
- * Creates a new <code>JTable</code> instance.
- *
- * @param data a <code>Vector</code> value
- * @param columnNames a <code>Vector</code> value
- */
- public JTable(Vector data, Vector columnNames)
- {
- this(new DefaultTableModel(data, columnNames));
- }
-
- public void addColumn(TableColumn column)
- {
- if (column.getHeaderValue() == null)
- {
- String name = getColumnName(column.getModelIndex());
- column.setHeaderValue(name);
- }
-
- columnModel.addColumn(column);
- }
-
- protected void createDefaultEditors()
- {
- //FIXME: Create the editor object.
- }
-
- protected void createDefaultRenderers()
- {
- //FIXME: Create the renderer object.
- }
-
- /**
- * @deprecated 1.0.2, replaced by <code>new JScrollPane(JTable)</code>
- */
- public static JScrollPane createScrollPaneForTable(JTable table)
- {
- return new JScrollPane(table);
- }
-
- protected TableColumnModel createDefaultColumnModel()
- {
- return new DefaultTableColumnModel();
- }
-
- protected TableModel createDefaultDataModel()
- {
- return new DefaultTableModel();
- }
-
- protected ListSelectionModel createDefaultSelectionModel()
- {
- return new DefaultListSelectionModel();
- }
-
- protected JTableHeader createDefaultTableHeader()
- {
- return new JTableHeader(columnModel);
- }
-
- private void createColumnsFromModel()
- {
- if (dataModel == null)
- return;
-
- TableColumnModel cm = createDefaultColumnModel();
-
- for (int i = 0; i < dataModel.getColumnCount(); ++i)
- {
- cm.addColumn(new TableColumn(i));
- }
- this.setColumnModel(cm);
- }
-
- // listener support
-
- public void columnAdded (TableColumnModelEvent event)
- {
- revalidate();
- repaint();
- }
-
- public void columnMarginChanged (ChangeEvent event)
- {
- revalidate();
- repaint();
- }
-
- public void columnMoved (TableColumnModelEvent event)
- {
- revalidate();
- repaint();
- }
-
- public void columnRemoved (TableColumnModelEvent event)
- {
- revalidate();
- repaint();
- }
-
- public void columnSelectionChanged (ListSelectionEvent event)
- {
- repaint();
- }
-
- public void editingCanceled (ChangeEvent event)
- {
- repaint();
- }
-
- public void editingStopped (ChangeEvent event)
- {
- repaint();
- }
-
- public void tableChanged (TableModelEvent event)
- {
- repaint();
- }
-
- public void valueChanged (ListSelectionEvent event)
- {
- repaint();
- }
-
- /**
- * Returns index of the column that contains specified point
- * or -1 if this table doesn't contain this point.
- *
- * @param point point to identify the column
- * @return index of the column that contains specified point or
- * -1 if this table doesn't contain this point.
- */
- public int columnAtPoint(Point point)
- {
- int x0 = getLocation().x;
- int ncols = getColumnCount();
- Dimension gap = getIntercellSpacing();
- TableColumnModel cols = getColumnModel();
- int x = point.x;
-
- for (int i = 0; i < ncols; ++i)
- {
- int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width);
- if (0 <= x && x < width)
- return i;
- x -= width;
- }
-
- return -1;
- }
-
- /**
- * Returns index of the row that contains specified point or
- * -1 if this table doesn't contain this point.
- *
- * @param point point to identify the row
- * @return index of the row that contains specified point or
- * -1 if this table doesn't contain this point.
- */
- public int rowAtPoint(Point point)
- {
- int y0 = getLocation().y;
- int nrows = getRowCount();
- Dimension gap = getIntercellSpacing();
- int height = getRowHeight() + (gap == null ? 0 : gap.height);
- int y = point.y;
-
- for (int i = 0; i < nrows; ++i)
- {
- if (0 <= y && y < height)
- return i;
- y -= height;
- }
-
- return -1;
- }
-
- /**
- * Calculate the visible rectangle for a particular row and column. The
- * row and column are specified in visual terms; the column may not match
- * the {@link #dataModel} column.
- *
- * @param row the visible row to get the cell rectangle of
- *
- * @param column the visible column to get the cell rectangle of, which may
- * differ from the {@link #dataModel} column
- *
- * @param includeSpacing whether or not to include the cell margins in the
- * resulting cell. If <code>false</code>, the result will only contain the
- * inner area of the target cell, not including its margins.
- *
- * @return a rectangle enclosing the specified cell
- */
- public Rectangle getCellRect(int row,
- int column,
- boolean includeSpacing)
- {
- int height = getHeight();
- int width = columnModel.getColumn(column).getWidth();
- int x_gap = columnModel.getColumnMargin();
- int y_gap = rowMargin;
-
- column = Math.max(0, Math.min(column, getColumnCount() - 1));
- row = Math.max(0, Math.min(row, getRowCount() - 1));
-
- int x = 0;
- int y = (height + y_gap) * row;
-
- for (int i = 0; i < column; ++i)
- {
- x += columnModel.getColumn(i).getWidth();
- x += x_gap;
- }
-
- if (includeSpacing)
- return new Rectangle(x, y, width, height);
- else
- return new Rectangle(x, y, width - x_gap, height - y_gap);
- }
-
- public void clearSelection()
- {
- selectionModel.clearSelection();
- }
-
- /**
- * Get the value of the {@link #selectedRow} property by delegation to
- * the {@link ListSelectionModel#getMinSelectionIndex} method of the
- * {@link #selectionModel} field.
- *
- * @return The current value of the selectedRow property
- */
- public int getSelectedRow ()
- {
- return selectionModel.getMinSelectionIndex();
- }
-
- /**
- * Get the value of the {@link #selectionModel} property.
- *
- * @return The current value of the property
- */
- public ListSelectionModel getSelectionModel()
- {
- if (! rowSelectionAllowed)
- return null;
-
- return selectionModel;
- }
-
- public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
- {
- if (orientation == SwingConstants.VERTICAL)
- return visibleRect.height * direction;
- else
- return visibleRect.width * direction;
- }
-
- /**
- * Get the value of the {@link #scrollableTracksViewportHeight} property.
- *
- * @return The constant value <code>false</code>
- */
-
- public boolean getScrollableTracksViewportHeight()
- {
- return false;
- }
-
- /**
- * Get the value of the {@link #scrollableTracksViewportWidth} property.
- *
- * @return <code>true</code> unless the {@link autoResizeMode} prperty is
- * <code>AUTO_RESIZE_OFF</code>
- */
-
- public boolean getScrollableTracksViewportWidth()
- {
- if (autoResizeMode == AUTO_RESIZE_OFF)
- return false;
- else
- return true;
- }
-
- public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
- {
- // FIXME: I don't exactly know what sun does here. in both cases they
- // pick values which do *not* simply expose the next cell in a given
- // scroll direction.
-
- if (orientation == SwingConstants.VERTICAL)
- return rowHeight;
- else
- {
- int sum = 0;
- for (int i = 0; i < getColumnCount(); ++i)
- sum += columnModel.getColumn(0).getWidth();
- return getColumnCount() == 0 ? 10 : sum / getColumnCount();
- }
- }
-
-
- public TableCellEditor getCellEditor(int row, int column)
- {
- TableCellEditor editor = columnModel.getColumn(column).getCellEditor();
-
- if (editor == null)
- editor = getDefaultEditor(dataModel.getColumnClass(column));
-
- return editor;
- }
-
- public TableCellEditor getDefaultEditor(Class columnClass)
- {
- if (defaultEditorsByColumnClass.containsKey(columnClass))
- return (TableCellEditor) defaultEditorsByColumnClass.get(columnClass);
- else
- {
- // FIXME: We have at least an editor for Object.class in our defaults.
- TableCellEditor r = new DefaultCellEditor(new JTextField());
- defaultEditorsByColumnClass.put(columnClass, r);
- return r;
- }
- }
-
-
-
- public TableCellRenderer getCellRenderer(int row, int column)
- {
- TableCellRenderer renderer =
- columnModel.getColumn(column).getCellRenderer();
-
- if (renderer == null)
- renderer = getDefaultRenderer(dataModel.getColumnClass(column));
-
- return renderer;
- }
-
- public void setDefaultRenderer(Class columnClass, TableCellRenderer rend)
- {
- defaultRenderersByColumnClass.put(columnClass, rend);
- }
-
- public TableCellRenderer getDefaultRenderer(Class columnClass)
- {
- if (defaultRenderersByColumnClass.containsKey(columnClass))
- return (TableCellRenderer) defaultRenderersByColumnClass.get(columnClass);
- else
- {
- TableCellRenderer r = new DefaultTableCellRenderer();
- defaultRenderersByColumnClass.put(columnClass, r);
- return r;
- }
- }
-
- public int convertColumnIndexToModel(int vc)
- {
- if (vc < 0)
- return vc;
- else if (vc > getColumnCount())
- return -1;
- else
- return columnModel.getColumn(vc).getModelIndex();
- }
-
- public int convertColumnIndexToView(int mc)
- {
- if (mc < 0)
- return mc;
- int ncols = getColumnCount();
- for (int vc = 0; vc < ncols; ++vc)
- {
- if (columnModel.getColumn(vc).getModelIndex() == mc)
- return vc;
- }
- return -1;
- }
-
- public Component prepareRenderer(TableCellRenderer renderer,
- int row,
- int column)
- {
- boolean rsa = getRowSelectionAllowed();
- boolean csa = getColumnSelectionAllowed();
- boolean rs = rsa ? getSelectionModel().isSelectedIndex(row) : false;
- boolean cs = csa ? columnModel.getSelectionModel().isSelectedIndex(column) : false;
- boolean isSelected = ((rsa && csa && rs && cs)
- || (rsa && !csa && rs)
- || (!rsa && csa && cs));
-
- return renderer.getTableCellRendererComponent(this,
- dataModel.getValueAt(row,
- convertColumnIndexToModel(column)),
- isSelected,
- false, // hasFocus
- row, column);
- }
-
-
- /**
- * Get the value of the {@link #autoCreateColumnsFromModel} property.
- *
- * @return The current value of the property
- */
- public boolean getAutoCreateColumnsFromModel()
- {
- return autoCreateColumnsFromModel;
- }
-
- /**
- * Get the value of the {@link #autoResizeMode} property.
- *
- * @return The current value of the property
- */
- public int getAutoResizeMode()
- {
- return autoResizeMode;
- }
-
- /**
- * Get the value of the {@link #rowHeight} property.
- *
- * @return The current value of the property
- */
- public int getRowHeight()
- {
- return rowHeight;
- }
-
- /**
- * Get the value of the {@link #rowMargin} property.
- *
- * @return The current value of the property
- */
- public int getRowMargin()
- {
- return rowMargin;
- }
-
- /**
- * Get the value of the {@link #rowSelectionAllowed} property.
- *
- * @return The current value of the property
- */
- public boolean getRowSelectionAllowed()
- {
- return rowSelectionAllowed;
- }
-
- /**
- * Get the value of the {@link #cellSelectionEnabled} property.
- *
- * @return The current value of the property
- */
- public boolean getCellSelectionEnabled()
- {
- return getColumnSelectionAllowed() && getRowSelectionAllowed();
- }
-
- /**
- * Get the value of the {@link #dataModel} property.
- *
- * @return The current value of the property
- */
- public TableModel getModel()
- {
- return dataModel;
- }
-
- /**
- * Get the value of the {@link #columnCount} property by
- * delegation to the @{link #columnModel} field.
- *
- * @return The current value of the columnCount property
- */
- public int getColumnCount()
- {
- return columnModel.getColumnCount();
- }
-
- /**
- * Get the value of the {@link #rowCount} property by
- * delegation to the @{link #dataModel} field.
- *
- * @return The current value of the rowCount property
- */
- public int getRowCount()
- {
- return dataModel.getRowCount();
- }
-
- /**
- * Get the value of the {@link #columnModel} property.
- *
- * @return The current value of the property
- */
- public TableColumnModel getColumnModel()
- {
- return columnModel;
- }
-
- /**
- * Get the value of the {@link #selectedColumn} property by
- * delegation to the @{link #columnModel} field.
- *
- * @return The current value of the selectedColumn property
- */
- public int getSelectedColumn()
- {
- return columnModel.getSelectionModel().getMinSelectionIndex();
- }
-
- private static int countSelections(ListSelectionModel lsm)
- {
- int lo = lsm.getMinSelectionIndex();
- int hi = lsm.getMaxSelectionIndex();
- int sum = 0;
- if (lo != -1 && hi != -1)
- {
- switch (lsm.getSelectionMode())
- {
- case ListSelectionModel.SINGLE_SELECTION:
- sum = 1;
- break;
-
- case ListSelectionModel.SINGLE_INTERVAL_SELECTION:
- sum = hi - lo + 1;
- break;
-
- case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:
- for (int i = lo; i <= hi; ++i)
- if (lsm.isSelectedIndex(i))
- ++sum;
- break;
- }
- }
- return sum;
- }
-
- private static int[] getSelections(ListSelectionModel lsm)
- {
- int sz = countSelections(lsm);
- int [] ret = new int[sz];
-
- int lo = lsm.getMinSelectionIndex();
- int hi = lsm.getMaxSelectionIndex();
- int j = 0;
- java.util.ArrayList ls = new java.util.ArrayList();
- if (lo != -1 && hi != -1)
- {
- switch (lsm.getSelectionMode())
- {
- case ListSelectionModel.SINGLE_SELECTION:
- ret[0] = lo;
- break;
-
- case ListSelectionModel.SINGLE_INTERVAL_SELECTION:
- for (int i = lo; i <= hi; ++i)
- ret[j++] = i;
- break;
-
- case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:
- for (int i = lo; i <= hi; ++i)
- if (lsm.isSelectedIndex(i))
- ret[j++] = i;
- break;
- }
- }
- return ret;
- }
-
- /**
- * Get the value of the {@link #selectedColumnCount} property by
- * delegation to the @{link #columnModel} field.
- *
- * @return The current value of the selectedColumnCount property
- */
- public int getSelectedColumnCount()
- {
- return countSelections(columnModel.getSelectionModel());
- }
-
- /**
- * Get the value of the {@link #selectedColumns} property by
- * delegation to the @{link #columnModel} field.
- *
- * @return The current value of the selectedColumns property
- */
- public int[] getSelectedColumns()
- {
- return getSelections(columnModel.getSelectionModel());
- }
-
- /**
- * Get the value of the {@link #columnSelectionAllowed} property.
- *
- * @return The current value of the columnSelectionAllowed property
- */
- public boolean getColumnSelectionAllowed()
- {
- return getColumnModel().getColumnSelectionAllowed();
- }
-
- /**
- * Get the value of the {@link #selectedRowCount} property by
- * delegation to the @{link #selectionModel} field.
- *
- * @return The current value of the selectedRowCount property
- */
- public int getSelectedRowCount()
- {
- return countSelections(selectionModel);
- }
-
- /**
- * Get the value of the {@link #selectedRows} property by
- * delegation to the @{link #selectionModel} field.
- *
- * @return The current value of the selectedRows property
- */
- public int[] getSelectedRows()
- {
- return getSelections(selectionModel);
- }
-
- /**
- * Get the value of the {@link #accessibleContext} property.
- *
- * @return The current value of the property
- */
- public AccessibleContext getAccessibleContext()
- {
- return accessibleContext;
- }
-
- /**
- * Get the value of the {@link #cellEditor} property.
- *
- * @return The current value of the property
- */
- public TableCellEditor getCellEditor()
- {
- return cellEditor;
- }
-
- /**
- * Get the value of the {@link #dragEnabled} property.
- *
- * @return The current value of the property
- */
- public boolean getDragEnabled()
- {
- return dragEnabled;
- }
-
- /**
- * Get the value of the {@link #gridColor} property.
- *
- * @return The current value of the property
- */
- public Color getGridColor()
- {
- return gridColor;
- }
-
- /**
- * Get the value of the {@link #intercellSpacing} property.
- *
- * @return The current value of the property
- */
- public Dimension getIntercellSpacing()
- {
- return new Dimension(columnModel.getColumnMargin(), rowMargin);
- }
-
- /**
- * Get the value of the {@link #preferredViewportSize} property.
- *
- * @return The current value of the property
- */
- public Dimension getPreferredScrollableViewportSize()
- {
- return preferredViewportSize;
- }
-
- /**
- * Get the value of the {@link #selectionBackground} property.
- *
- * @return The current value of the property
- */
- public Color getSelectionBackground()
- {
- return selectionBackground;
- }
-
- /**
- * Get the value of the {@link #selectionForeground} property.
- *
- * @return The current value of the property
- */
- public Color getSelectionForeground()
- {
- return selectionForeground;
- }
-
- /**
- * Get the value of the {@link #showHorizontalLines} property.
- *
- * @return The current value of the property
- */
- public boolean getShowHorizontalLines()
- {
- return showHorizontalLines;
- }
-
- /**
- * Get the value of the {@link #showVerticalLines} property.
- *
- * @return The current value of the property
- */
- public boolean getShowVerticalLines()
- {
- return showVerticalLines;
- }
-
- /**
- * Get the value of the {@link #tableHeader} property.
- *
- * @return The current value of the property
- */
- public JTableHeader getTableHeader()
- {
- return tableHeader;
- }
-
- /**
- * Removes specified column from displayable columns of this table.
- *
- * @param column column to removed
- */
- public void removeColumn(TableColumn column)
- {
- columnModel.removeColumn(column);
- }
-
- /**
- * Moves column at the specified index to new given location.
- *
- * @param column index of the column to move
- * @param targetColumn index specifying new location of the column
- */
- public void moveColumn(int column,int targetColumn)
- {
- columnModel.moveColumn(column, targetColumn);
- }
-
- /**
- * Set the value of the {@link #autoCreateColumnsFromModel} property.
- *
- * @param a The new value of the autoCreateColumnsFromModel property
- */
- public void setAutoCreateColumnsFromModel(boolean a)
- {
- autoCreateColumnsFromModel = a;
- }
-
- /**
- * Set the value of the {@link #autoResizeMode} property.
- *
- * @param a The new value of the autoResizeMode property
- */
- public void setAutoResizeMode(int a)
- {
- autoResizeMode = a;
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #rowHeight} property.
- *
- * @param r The new value of the rowHeight property
- */
- public void setRowHeight(int r)
- {
- if (rowHeight < 1)
- throw new IllegalArgumentException();
-
- rowHeight = r;
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #rowMargin} property.
- *
- * @param r The new value of the rowMargin property
- */
- public void setRowMargin(int r)
- {
- rowMargin = r;
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #rowSelectionAllowed} property.
- *
- * @param r The new value of the rowSelectionAllowed property
- */
- public void setRowSelectionAllowed(boolean r)
- {
- rowSelectionAllowed = r;
- repaint();
- }
-
- /**
- * Set the value of the {@link #cellSelectionEnabled} property.
- *
- * @param c The new value of the cellSelectionEnabled property
- */
- public void setCellSelectionEnabled(boolean c)
- {
- setColumnSelectionAllowed(c);
- setRowSelectionAllowed(c);
- // for backward-compatibility sake:
- cellSelectionEnabled = true;
- }
-
- /**
- * <p>Set the value of the {@link #dataModel} property.</p>
- *
- * <p>Unregister <code>this</code> as a {@link TableModelListener} from
- * previous {@link #dataModel} and register it with new parameter
- * <code>m</code>.</p>
- *
- * @param m The new value of the model property
- */
- public void setModel(TableModel m)
- {
- // Throw exception is m is null.
- if (m == null)
- throw new IllegalArgumentException();
-
- // Don't do anything if setting the current model again.
- if (dataModel == m)
- return;
-
- // Remove table as TableModelListener from old model.
- if (dataModel != null)
- dataModel.removeTableModelListener(this);
-
- if (m != null)
- {
- // Set property.
- dataModel = m;
-
- // Add table as TableModelListener to new model.
- dataModel.addTableModelListener(this);
-
- // Automatically create columns.
- if (autoCreateColumnsFromModel)
- createColumnsFromModel();
- }
-
- // Repaint table.
- revalidate();
- repaint();
- }
-
- /**
- * <p>Set the value of the {@link #columnModel} property.</p>
- *
- * <p>Unregister <code>this</code> as a {@link TableColumnModelListener}
- * from previous {@link #columnModel} and register it with new parameter
- * <code>c</code>.</p>
- *
- * @param c The new value of the columnModel property
- */
- public void setColumnModel(TableColumnModel c)
- {
- if (c == null)
- throw new IllegalArgumentException();
- TableColumnModel tmp = columnModel;
- if (tmp != null)
- tmp.removeColumnModelListener(this);
- if (c != null)
- c.addColumnModelListener(this);
- columnModel = c;
- if (dataModel != null && columnModel != null)
- {
- int ncols = getColumnCount();
- for (int i = 0; i < ncols; ++i)
- columnModel.getColumn(i).setHeaderValue(dataModel.getColumnName(i));
- }
- revalidate();
- repaint();
- }
-
- /**
- * Set the value of the {@link #columnSelectionAllowed} property.
- *
- * @param c The new value of the property
- */
- public void setColumnSelectionAllowed(boolean c)
- {
- getColumnModel().setColumnSelectionAllowed(c);
- repaint();
- }
-
- /**
- * <p>Set the value of the {@link #selectionModel} property.</p>
- *
- * <p>Unregister <code>this</code> as a {@link ListSelectionListener}
- * from previous {@link #selectionModel} and register it with new
- * parameter <code>s</code>.</p>
- *
- * @param s The new value of the selectionModel property
- */
- public void setSelectionModel(ListSelectionModel s)
- {
- if (s == null)
- throw new IllegalArgumentException();
- ListSelectionModel tmp = selectionModel;
- if (tmp != null)
- tmp.removeListSelectionListener(this);
- if (s != null)
- s.addListSelectionListener(this);
- selectionModel = s;
- }
-
- /**
- * Set the value of the {@link #selectionMode} property by
- * delegation to the {@link #selectionModel} field. The same selection
- * mode is set for row and column selection models.
- *
- * @param s The new value of the property
- */
- public void setSelectionMode(int s)
- {
- selectionModel.setSelectionMode(s);
- columnModel.getSelectionModel().setSelectionMode(s);
-
- repaint();
- }
-
- /**
- * <p>Set the value of the {@link #cellEditor} property.</p>
- *
- * <p>Unregister <code>this</code> as a {@link CellEditorListener} from
- * previous {@link #cellEditor} and register it with new parameter
- * <code>c</code>.</p>
- *
- * @param c The new value of the cellEditor property
- */
- public void setCellEditor(TableCellEditor c)
- {
- TableCellEditor tmp = cellEditor;
- if (tmp != null)
- tmp.removeCellEditorListener(this);
- if (c != null)
- c.addCellEditorListener(this);
- cellEditor = c;
- }
-
- /**
- * Set the value of the {@link #dragEnabled} property.
- *
- * @param d The new value of the dragEnabled property
- */
- public void setDragEnabled(boolean d)
- {
- dragEnabled = d;
- }
-
- /**
- * Set the value of the {@link #gridColor} property.
- *
- * @param g The new value of the gridColor property
- */
- public void setGridColor(Color g)
- {
- gridColor = g;
- repaint();
- }
-
- /**
- * Set the value of the {@link #intercellSpacing} property.
- *
- * @param i The new value of the intercellSpacing property
- */
- public void setIntercellSpacing(Dimension i)
- {
- rowMargin = i.height;
- columnModel.setColumnMargin(i.width);
- repaint();
- }
-
- /**
- * Set the value of the {@link #preferredViewportSize} property.
- *
- * @param p The new value of the preferredViewportSize property
- */
- public void setPreferredScrollableViewportSize(Dimension p)
- {
- preferredViewportSize = p;
- revalidate();
- repaint();
- }
-
- /**
- * <p>Set the value of the {@link #selectionBackground} property.</p>
- *
- * <p>Fire a PropertyChangeEvent with name {@link
- * #SELECTION_BACKGROUND_CHANGED_PROPERTY} to registered listeners, if
- * selectionBackground changed.</p>
- *
- * @param s The new value of the selectionBackground property
- */
- public void setSelectionBackground(Color s)
- {
- Color tmp = selectionBackground;
- selectionBackground = s;
- if (((tmp == null && s != null)
- || (s == null && tmp != null)
- || (tmp != null && s != null && !tmp.equals(s))))
- firePropertyChange(SELECTION_BACKGROUND_CHANGED_PROPERTY, tmp, s);
- repaint();
- }
-
- /**
- * <p>Set the value of the {@link #selectionForeground} property.</p>
- *
- * <p>Fire a PropertyChangeEvent with name {@link
- * SELECTION_FOREGROUND_CHANGED_PROPERTY} to registered listeners, if
- * selectionForeground changed.</p>
- *
- * @param s The new value of the selectionForeground property
- */
- public void setSelectionForeground(Color s)
- {
- Color tmp = selectionForeground;
- selectionForeground = s;
- if (((tmp == null && s != null)
- || (s == null && tmp != null)
- || (tmp != null && s != null && !tmp.equals(s))))
- firePropertyChange(SELECTION_FOREGROUND_CHANGED_PROPERTY, tmp, s);
- repaint();
- }
-
- /**
- * Set the value of the {@link #showGrid} property.
- *
- * @param s The new value of the showGrid property
- */
- public void setShowGrid(boolean s)
- {
- setShowVerticalLines(s);
- setShowHorizontalLines(s);
- }
-
- /**
- * Set the value of the {@link #showHorizontalLines} property.
- *
- * @param s The new value of the showHorizontalLines property
- */
- public void setShowHorizontalLines(boolean s)
- {
- showHorizontalLines = s;
- repaint();
- }
-
- /**
- * Set the value of the {@link #showVerticalLines} property.
- *
- * @param s The new value of the showVerticalLines property
- */
- public void setShowVerticalLines(boolean s)
- {
- showVerticalLines = s;
- repaint();
- }
-
- /**
- * Set the value of the {@link #tableHeader} property.
- *
- * @param t The new value of the tableHeader property
- */
- public void setTableHeader(JTableHeader t)
- {
- if (tableHeader != null)
- tableHeader.setTable(null);
- tableHeader = t;
- if (tableHeader != null)
- tableHeader.setTable(this);
- revalidate();
- repaint();
- }
-
- protected void configureEnclosingScrollPane()
- {
- JScrollPane jsp = (JScrollPane) SwingUtilities.getAncestorOfClass(JScrollPane.class, this);
- if (jsp != null && tableHeader != null)
- {
- jsp.setColumnHeaderView(tableHeader);
- }
- }
-
- protected void unconfigureEnclosingScrollPane()
- {
- JScrollPane jsp = (JScrollPane) SwingUtilities.getAncestorOfClass(JScrollPane.class, this);
- if (jsp != null)
- {
- jsp.setColumnHeaderView(null);
- }
- }
-
-
- public void addNotify()
- {
- super.addNotify();
- configureEnclosingScrollPane();
- }
-
- public void removeNotify()
- {
- super.addNotify();
- unconfigureEnclosingScrollPane();
- }
-
-
- /**
- * Sun javadocs describe an unusual implementation of
- * <code>doLayout</code> which involves some private interfaces. We try
- * to implement the same algorithm as is documented, but using the
- * columnModel directly. We still use a private helper method, but it has
- * a simpler signature.
- */
-
- private void distributeSpill(TableColumn[] cols, int spill)
- {
- int MIN = 0;
- int MAX = 0;
- int PREF = 0;
-
- int[] min = new int[cols.length];
- int[] max = new int[cols.length];
- int[] pref = new int[cols.length];
-
- for (int i = 0; i < cols.length; ++i)
- {
- pref[i] = cols[i].getPreferredWidth();
- min[i] = cols[i].getMinWidth();
- max[i] = cols[i].getMaxWidth();
- PREF += pref[i];
- MIN += min[i];
- MAX += max[i];
- }
-
- for (int i = 0; i < cols.length; ++i)
- {
- int adj = 0;
- if (spill > 0)
- adj = (spill * (pref[i] - min[i])) / (PREF - MIN);
- else
- adj = (spill * (max[i] - pref[i])) / (MAX - PREF);
- cols[i].setWidth(pref[i] + adj);
- }
- }
-
- public void doLayout()
- {
- TableColumn resizingColumn = null;
-
- int ncols = getColumnCount();
- if (ncols < 1)
- return;
-
- int[] pref = new int[ncols];
- int prefSum = 0;
- int rCol = -1;
-
- if (tableHeader != null)
- resizingColumn = tableHeader.getResizingColumn();
-
- for (int i = 0; i < ncols; ++i)
- {
- TableColumn col = columnModel.getColumn(i);
- int p = col.getWidth();
- pref[i] = p;
- prefSum += p;
- if (resizingColumn == col)
- rCol = i;
- }
-
- int spill = prefSum - getWidth();
-
- if (resizingColumn != null)
- {
- TableColumn col;
- TableColumn [] cols;
-
- switch (getAutoResizeMode())
- {
- case AUTO_RESIZE_LAST_COLUMN:
- col = columnModel.getColumn(ncols-1);
- col.setWidth(col.getPreferredWidth() + spill);
- break;
-
- case AUTO_RESIZE_NEXT_COLUMN:
- col = columnModel.getColumn(ncols-1);
- col.setWidth(col.getPreferredWidth() + spill);
- break;
-
- case AUTO_RESIZE_ALL_COLUMNS:
- cols = new TableColumn[ncols];
- for (int i = 0; i < ncols; ++i)
- cols[i] = columnModel.getColumn(i);
- distributeSpill(cols, spill);
- break;
-
- case AUTO_RESIZE_SUBSEQUENT_COLUMNS:
- cols = new TableColumn[ncols];
- for (int i = rCol; i < ncols; ++i)
- cols[i] = columnModel.getColumn(i);
- distributeSpill(cols, spill);
- break;
-
- case AUTO_RESIZE_OFF:
- default:
- }
- }
- else
- {
- TableColumn [] cols = new TableColumn[ncols];
- for (int i = 0; i < ncols; ++i)
- cols[i] = columnModel.getColumn(i);
- distributeSpill(cols, spill);
- }
- }
-
- /**
- * @deprecated Replaced by <code>doLayout()</code>
- */
- public void sizeColumnsToFit(boolean lastColumnOnly)
- {
- doLayout();
- }
-
- /**
- * Obsolete since JDK 1.4. Please use <code>doLayout()</code>.
- */
- public void sizeColumnsToFit(int resizingColumn)
- {
- doLayout();
- }
-
- public String getUIClassID()
- {
- return "TableUI";
- }
-
- /**
- * This method returns the table's UI delegate.
- *
- * @return The table's UI delegate.
- */
- public TableUI getUI()
- {
- return (TableUI) ui;
- }
-
- /**
- * This method sets the table's UI delegate.
- *
- * @param ui The table's UI delegate.
- */
- public void setUI(TableUI ui)
- {
- super.setUI(ui);
- }
-
- public void updateUI()
- {
- setUI((TableUI) UIManager.getUI(this));
- revalidate();
- repaint();
- }
-
- public Class getColumnClass(int column)
- {
- return dataModel.getColumnClass(column);
- }
-
- public String getColumnName(int column)
- {
- return dataModel.getColumnName(column);
- }
-
- public int getEditingColumn()
- {
- return editingColumn;
- }
-
- public void setEditingColumn(int column)
- {
- editingColumn = column;
- }
-
- public int getEditingRow()
- {
- return editingRow;
- }
-
- public void setEditingRow(int column)
- {
- editingRow = column;
- }
-
- public Component getEditorComponent()
- {
- return editorComp;
- }
-
- public boolean isEditing()
- {
- return editorComp != null;
- }
-
- public void setDefaultEditor(Class columnClass, TableCellEditor editor)
- {
- if (editor != null)
- defaultEditorsByColumnClass.put(columnClass, editor);
- else
- defaultEditorsByColumnClass.remove(columnClass);
- }
-
- public void addColumnSelectionInterval(int index0, int index1)
- {
- if ((index0 < 0 || index0 > (getColumnCount()-1)
- || index1 < 0 || index1 > (getColumnCount()-1)))
- throw new IllegalArgumentException("Column index out of range.");
-
- getColumnModel().getSelectionModel().addSelectionInterval(index0, index1);
- }
-
- public void addRowSelectionInterval(int index0, int index1)
- {
- if ((index0 < 0 || index0 > (getRowCount()-1)
- || index1 < 0 || index1 > (getRowCount()-1)))
- throw new IllegalArgumentException("Row index out of range.");
-
- getSelectionModel().addSelectionInterval(index0, index1);
- }
-
- public void setColumnSelectionInterval(int index0, int index1)
- {
- if ((index0 < 0 || index0 > (getColumnCount()-1)
- || index1 < 0 || index1 > (getColumnCount()-1)))
- throw new IllegalArgumentException("Column index out of range.");
-
- getColumnModel().getSelectionModel().setSelectionInterval(index0, index1);
- }
-
- public void setRowSelectionInterval(int index0, int index1)
- {
- if ((index0 < 0 || index0 > (getRowCount()-1)
- || index1 < 0 || index1 > (getRowCount()-1)))
- throw new IllegalArgumentException("Row index out of range.");
-
- getSelectionModel().setSelectionInterval(index0, index1);
- }
-
- public void removeColumnSelectionInterval(int index0, int index1)
- {
- if ((index0 < 0 || index0 > (getColumnCount()-1)
- || index1 < 0 || index1 > (getColumnCount()-1)))
- throw new IllegalArgumentException("Column index out of range.");
-
- getColumnModel().getSelectionModel().removeSelectionInterval(index0, index1);
- }
-
- public void removeRowSelectionInterval(int index0, int index1)
- {
- if ((index0 < 0 || index0 > (getRowCount()-1)
- || index1 < 0 || index1 > (getRowCount()-1)))
- throw new IllegalArgumentException("Row index out of range.");
-
- getSelectionModel().removeSelectionInterval(index0, index1);
- }
-
- public boolean isColumnSelected(int column)
- {
- return getColumnModel().getSelectionModel().isSelectedIndex(column);
- }
-
- public boolean isRowSelected(int row)
- {
- return getSelectionModel().isSelectedIndex(row);
- }
-
- public boolean isCellSelected(int row, int column)
- {
- return isRowSelected(row) && isColumnSelected(column);
- }
-
- public void selectAll()
- {
- setColumnSelectionInterval(0, getColumnCount() - 1);
- setRowSelectionInterval(0, getRowCount() - 1);
- }
-
- public Object getValueAt(int row, int column)
- {
- return dataModel.getValueAt(row, convertColumnIndexToModel(column));
- }
-
- public void setValueAt(Object value, int row, int column)
- {
- dataModel.setValueAt(value, row, convertColumnIndexToModel(column));
- }
-
- public TableColumn getColumn(Object identifier)
- {
- return columnModel.getColumn(columnModel.getColumnIndex(identifier));
- }
-}
diff --git a/libjava/javax/swing/JTextArea.java b/libjava/javax/swing/JTextArea.java
deleted file mode 100644
index 6360f62bf8b..00000000000
--- a/libjava/javax/swing/JTextArea.java
+++ /dev/null
@@ -1,480 +0,0 @@
-/* JTextArea.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.FontMetrics;
-
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-import javax.swing.text.Element;
-import javax.swing.text.JTextComponent;
-import javax.swing.text.PlainDocument;
-
-/**
- * The <code>JTextArea</code> component provides a multi-line area for displaying
- * and editing plain text. The component is designed to act as a lightweight
- * replacement for the heavyweight <code>java.awt.TextArea</code> component,
- * which provides similar functionality using native widgets.
- * <p>
- *
- * This component has additional functionality to the AWT class. It follows
- * the same design pattern as seen in other text components, such as
- * <code>JTextField</code>, <code>JTextPane</code> and <code>JEditorPane</code>,
- * and embodied in <code>JTextComponent</code>. These classes separate the text
- * (the model) from its appearance within the onscreen component (the view). The
- * text is held within a <code>javax.swing.text.Document</code> object, which can
- * also maintain relevant style information where necessary. As a result, it is the
- * document that should be monitored for textual changes, via
- * <code>DocumentEvent</code>s delivered to registered
- * <code>DocumentListener</code>s, rather than this component.
- * <p>
- *
- * Unlike <code>java.awt.TextArea</code>, <code>JTextArea</code> does not
- * handle scrolling. Instead, this functionality is delegated to a
- * <code>JScrollPane</code>, which can contain the text area and handle
- * scrolling when required. Likewise, the word wrapping functionality
- * of the AWT component is converted to a property of this component
- * and the <code>rows</code> and <code>columns</code> properties
- * are used in calculating the preferred size of the scroll pane's
- * view port.
- *
- * @author Michael Koch (konqueror@gmx.de)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @see java.awt.TextArea
- * @see javax.swing.JTextComponent
- * @see javax.swing.JTextField
- * @see javax.swing.JTextPane
- * @see javax.swing.JEditorPane
- * @see javax.swing.text.Document
- * @see javax.swing.text.DocumentEvent
- * @see javax.swing.text.DocumentListener
- */
-
-public class JTextArea extends JTextComponent
-{
- /**
- * Compatible with Sun's JDK
- */
- private static final long serialVersionUID = -6141680179310439825L;
-
- /**
- * The number of rows used by the component.
- */
- private int rows;
-
- /**
- * The number of columns used by the component.
- */
- private int columns;
-
- /**
- * Whether line wrapping is enabled or not.
- */
- private boolean lineWrap;
-
- /**
- * The number of characters equal to a tab within the text.
- */
- private int tabSize = 8;
-
- private boolean wrapStyleWord;
-
- /**
- * Creates a new <code>JTextArea</code> object.
- */
- public JTextArea()
- {
- this(null, null, 0, 0);
- }
-
- /**
- * Creates a new <code>JTextArea</code> object.
- *
- * @param text the initial text
- */
- public JTextArea(String text)
- {
- this(null, text, 0, 0);
- }
-
- /**
- * Creates a new <code>JTextArea</code> object.
- *
- * @param rows the number of rows
- * @param columns the number of cols
- *
- * @exception IllegalArgumentException if rows or columns are negative
- */
- public JTextArea(int rows, int columns)
- {
- this(null, null, rows, columns);
- }
-
- /**
- * Creates a new <code>JTextArea</code> object.
- *
- * @param text the initial text
- * @param rows the number of rows
- * @param columns the number of cols
- *
- * @exception IllegalArgumentException if rows or columns are negative
- */
- public JTextArea(String text, int rows, int columns)
- {
- this(null, text, rows, columns);
- }
-
- /**
- * Creates a new <code>JTextArea</code> object.
- *
- * @param the document model to use
- */
- public JTextArea(Document doc)
- {
- this(doc, null, 0, 0);
- }
-
- /**
- * Creates a new <code>JTextArea</code> object.
- *
- * @param the document model to use
- * @param text the initial text
- * @param rows the number of rows
- * @param columns the number of cols
- *
- * @exception IllegalArgumentException if rows or columns are negative
- */
- public JTextArea(Document doc, String text, int rows, int columns)
- {
- setDocument(doc == null ? createDefaultModel() : doc);
- setText(text);
- setRows(rows);
- setColumns(columns);
- }
-
- /**
- * Appends the supplied text to the current contents
- * of the document model.
- *
- * @param toAppend the text to append
- */
- public void append(String toAppend)
- {
- try
- {
- getDocument().insertString(getText().length(), toAppend, null);
- }
- catch (BadLocationException exception)
- {
- /* This shouldn't happen in theory -- but, if it does... */
- throw new RuntimeException("Unexpected exception occurred.", exception);
- }
- }
-
- /**
- * Creates the default document model.
- *
- * @return a new default model
- */
- protected Document createDefaultModel()
- {
- return new PlainDocument();
- }
-
- /**
- * Returns true if the width of this component should be forced
- * to match the width of a surrounding view port. When line wrapping
- * is turned on, this method returns true.
- *
- * @return true if lines are wrapped.
- */
- public boolean getScrollableTracksViewportWidth()
- {
- return lineWrap ? true : super.getScrollableTracksViewportWidth();
- }
-
- /**
- * Returns the UI class ID string.
- *
- * @return the string "TextAreaUI"
- */
- public String getUIClassID()
- {
- return "TextAreaUI";
- }
-
- /**
- * Returns the current number of columns.
- *
- * @return number of columns
- */
- public int getColumns()
- {
- return columns;
- }
-
- /**
- * Sets the number of rows.
- *
- * @param columns number of columns
- *
- * @exception IllegalArgumentException if columns is negative
- */
- public void setColumns(int columns)
- {
- if (columns < 0)
- throw new IllegalArgumentException();
-
- this.columns = columns;
- }
-
- /**
- * Returns the current number of rows.
- *
- * @return number of rows
- */
- public int getRows()
- {
- return rows;
- }
-
- /**
- * Sets the number of rows.
- *
- * @param columns number of columns
- *
- * @exception IllegalArgumentException if rows is negative
- */
- public void setRows(int rows)
- {
- if (rows < 0)
- throw new IllegalArgumentException();
-
- this.rows = rows;
- }
-
- /**
- * Checks whether line wrapping is enabled.
- *
- * @return <code>true</code> if line wrapping is enabled,
- * <code>false</code> otherwise
- */
- public boolean getLineWrap()
- {
- return lineWrap;
- }
-
- /**
- * Enables/disables line wrapping.
- *
- * @param wrapping <code>true</code> to enable line wrapping,
- * <code>false</code> otherwise
- */
- public void setLineWrap(boolean flag)
- {
- if (lineWrap == flag)
- return;
-
- boolean oldValue = lineWrap;
- lineWrap = flag;
- firePropertyChange("lineWrap", oldValue, lineWrap);
- }
-
- /**
- * Checks whether word style wrapping is enabled.
- *
- * @return <code>true</code> if word style wrapping is enabled,
- * <code>false</code> otherwise
- */
- public boolean getWrapStyleWord()
- {
- return wrapStyleWord;
- }
-
- /**
- * Enables/Disables word style wrapping.
- *
- * @param flag <code>true</code> to enable word style wrapping,
- * <code>false</code> otherwise
- */
- public void setWrapStyleWord(boolean flag)
- {
- if (wrapStyleWord == flag)
- return;
-
- boolean oldValue = wrapStyleWord;
- wrapStyleWord = flag;
- firePropertyChange("wrapStyleWord", oldValue, wrapStyleWord);
- }
-
- /**
- * Returns the number of characters used for a tab.
- * This defaults to 8.
- *
- * @return the current number of spaces used for a tab.
- */
- public int getTabSize()
- {
- return tabSize;
- }
-
- /**
- * Sets the number of characters used for a tab to the
- * supplied value. If a change to the tab size property
- * occurs (i.e. newSize != tabSize), a property change event
- * is fired.
- *
- * @param newSize The new number of characters to use for a tab.
- */
- public void setTabSize(int newSize)
- {
- if (tabSize == newSize)
- return;
-
- int oldValue = tabSize;
- tabSize = newSize;
- firePropertyChange("tabSize", oldValue, tabSize);
- }
-
- protected int getColumnWidth()
- {
- FontMetrics metrics = getToolkit().getFontMetrics(getFont());
- return metrics.charWidth('m');
- }
-
- public int getLineCount()
- {
- return getDocument().getDefaultRootElement().getElementCount();
- }
-
- public int getLineStartOffset(int line)
- throws BadLocationException
- {
- int lineCount = getLineCount();
-
- if (line < 0 || line > lineCount)
- throw new BadLocationException("Non-existing line number", line);
-
- Element lineElem = getDocument().getDefaultRootElement().getElement(line);
- return lineElem.getStartOffset();
- }
-
- public int getLineEndOffset(int line)
- throws BadLocationException
- {
- int lineCount = getLineCount();
-
- if (line < 0 || line > lineCount)
- throw new BadLocationException("Non-existing line number", line);
-
- Element lineElem = getDocument().getDefaultRootElement().getElement(line);
- return lineElem.getEndOffset();
- }
-
- public int getLineOfOffset(int offset)
- throws BadLocationException
- {
- Document doc = getDocument();
-
- if (offset < doc.getStartPosition().getOffset()
- || offset >= doc.getEndPosition().getOffset())
- throw new BadLocationException("offset outside of document", offset);
-
- return doc.getDefaultRootElement().getElementIndex(offset);
- }
-
- protected int getRowHeight()
- {
- FontMetrics metrics = getToolkit().getFontMetrics(getFont());
- return metrics.getHeight();
- }
-
- /**
- * Inserts the supplied text at the specified position. Nothing
- * happens in the case that the model or the supplied string is null
- * or of zero length.
- *
- * @param string The string of text to insert.
- * @param position The position at which to insert the supplied text.
- * @throws IllegalArgumentException if the position is &lt; 0 or greater
- * than the length of the current text.
- */
- public void insert(String string, int position)
- {
- // Retrieve the document model.
- Document doc = getDocument();
-
- // Check the model and string for validity.
- if (doc == null
- || string == null
- || string.length() == 0)
- return;
-
- // Insert the text into the model.
- try
- {
- doc.insertString(position, string, null);
- }
- catch (BadLocationException e)
- {
- throw new IllegalArgumentException("The supplied position, "
- + position + ", was invalid.");
- }
- }
-
- public void replaceRange(String text, int start, int end)
- {
- Document doc = getDocument();
-
- if (start > end
- || start < doc.getStartPosition().getOffset()
- || end >= doc.getEndPosition().getOffset())
- throw new IllegalArgumentException();
-
- try
- {
- doc.remove(start, end - start);
- doc.insertString(start, text, null);
- }
- catch (BadLocationException e)
- {
- // This cannot happen as we check offset above.
- }
- }
-}
diff --git a/libjava/javax/swing/JTextField.java b/libjava/javax/swing/JTextField.java
deleted file mode 100644
index fb19d79c5f2..00000000000
--- a/libjava/javax/swing/JTextField.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/* JTextField.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.accessibility.AccessibleStateSet;
-import javax.swing.text.Document;
-import javax.swing.text.JTextComponent;
-import javax.swing.text.PlainDocument;
-import javax.swing.text.TextAction;
-
-public class JTextField extends JTextComponent
- implements SwingConstants
-{
- /**
- * AccessibleJTextField
- */
- protected class AccessibleJTextField extends AccessibleJTextComponent
- {
- private static final long serialVersionUID = 8255147276740453036L;
-
- /**
- * Constructor AccessibleJTextField
- */
- protected AccessibleJTextField()
- {
- }
-
- /**
- * getAccessibleStateSet
- * @return AccessibleStateSet
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- return null;
- }
- }
-
- private static final long serialVersionUID = 353853209832607592L;
-
- private static final Action[] actions;
-
- /**
- * Name of the action that gets sent when the content of the text field
- * gets accepted.
- */
- public static final String notifyAction = "notify-field-accept";
-
- static
- {
- actions = new Action[1];
- actions[0] = new TextAction(notifyAction)
- {
- public void actionPerformed(ActionEvent event)
- {
- JTextField textField = (JTextField) event.getSource();
- textField.fireActionPerformed();
- }
- };
- }
-
- private int columns;
- private int align;
- private int scrollOffset;
-
- /** @since 1.3 */
- private Action action;
-
- /** @since 1.3 */
- private String actionCommand;
-
- private PropertyChangeListener actionPropertyChangeListener;
-
- /**
- * Creates a new instance of <code>JTextField</code>.
- */
- public JTextField()
- {
- this(null, null, 0);
- }
-
- /**
- * Creates a new instance of <code>JTextField</code>.
- *
- * @param text the initial text
- */
- public JTextField(String text)
- {
- this(null, text, 0);
- }
-
- /**
- * Creates a new instance of <code>JTextField</code>.
- *
- * @param columns the number of columns
- *
- * @exception IllegalArgumentException if columns %lt; 0
- */
- public JTextField(int columns)
- {
- this(null, null, columns);
- }
-
- /**
- * Creates a new instance of <code>JTextField</code>.
- *
- * @param text the initial text
- * @param columns the number of columns
- *
- * @exception IllegalArgumentException if columns %lt; 0
- */
- public JTextField(String text, int columns)
- {
- this(null, text, columns);
- }
-
- /**
- * Creates a new instance of <code>JTextField</code>.
- *
- * @param doc the document to use
- * @param text the initial text
- * @param columns the number of columns
- *
- * @exception IllegalArgumentException if columns %lt; 0
- */
- public JTextField(Document doc, String text, int columns)
- {
- if (columns < 0)
- throw new IllegalArgumentException();
-
- this.columns = columns;
-
- setDocument(doc == null ? createDefaultModel() : doc);
-
- if (text != null)
- setText(text);
- }
-
- /**
- * Creates the default model for this text field.
- * This implementation returns an instance of <code>PlainDocument</code>.
- *
- * @return a new instance of the default model
- */
- protected Document createDefaultModel()
- {
- return new PlainDocument();
- }
-
- /**
- * Returns the class ID for the UI.
- *
- * @return "TextFieldUI";
- */
- public String getUIClassID()
- {
- return "TextFieldUI";
- }
-
- /**
- * Adds a new listener object to this text field.
- *
- * @param listener the listener to add
- */
- public void addActionListener(ActionListener listener)
- {
- listenerList.add(ActionListener.class, listener);
- }
-
- /**
- * Removes a listener object from this text field.
- *
- * @param listener the listener to remove
- */
- public void removeActionListener(ActionListener listener)
- {
- listenerList.remove(ActionListener.class, listener);
- }
-
- /**
- * Returns all registered <code>ActionListener</code> objects.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public ActionListener[] getActionListeners()
- {
- return (ActionListener[]) getListeners(ActionListener.class);
- }
-
- /**
- * Sends an action event to all registered
- * <code>ActionListener</code> objects.
- */
- protected void fireActionPerformed()
- {
- ActionEvent event = new ActionEvent(this, 0, notifyAction);
- ActionListener[] listeners = getActionListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].actionPerformed(event);
- }
-
- /**
- * Returns the number of columns of this text field.
- *
- * @return the number of columns
- */
- public int getColumns()
- {
- return columns;
- }
-
- public void setColumns(int columns)
- {
- if (columns < 0)
- throw new IllegalArgumentException();
-
- this.columns = columns;
- invalidate();
- repaint();
- }
-
- public int getHorizontalAlignment()
- {
- return align;
- }
-
- public void setHorizontalAlignment(int newAlign)
- {
- if (align == newAlign)
- return;
-
- int oldAlign = align;
- align = newAlign;
- firePropertyChange("horizontalAlignment", oldAlign, newAlign);
- invalidate();
- repaint();
- }
-
- public void setFont(Font newFont)
- {
- super.setFont(newFont);
- revalidate();
- }
-
- public Dimension getPreferredSize()
- {
- Dimension size = super.getPreferredSize();
-
- if (columns != 0)
- size.width = columns * getColumnWidth();
-
- return size;
- }
-
- /**
- * Returns the scroll offset in pixels.
- *
- * @return the scroll offset
- */
- public int getScrollOffset()
- {
- return scrollOffset;
- }
-
- /**
- * Sets the scroll offset in pixels.
- *
- * @param offset the scroll offset
- */
- public void setScrollOffset(int offset)
- {
- scrollOffset = offset;
- }
-
- public Action[] getActions()
- {
- return TextAction.augmentList(super.getActions(), actions);
- }
-
- public void postActionEvent()
- {
- String command = actionCommand != null ? actionCommand : getText();
- ActionEvent event = new ActionEvent(this, 0, command);
- ActionListener[] listeners = getActionListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].actionPerformed(event);
- }
-
- /**
- * @since 1.3
- */
- public Action getAction()
- {
- return action;
- }
-
- /**
- * @since 1.3
- */
- public void setAction(Action newAction)
- {
- if (action == newAction)
- return;
-
- if (action != null)
- {
- removeActionListener(action);
- action.removePropertyChangeListener(actionPropertyChangeListener);
- actionPropertyChangeListener = null;
- }
-
- Action oldAction = action;
- action = newAction;
-
- if (action != null)
- {
- addActionListener(action);
- actionPropertyChangeListener =
- createActionPropertyChangeListener(action);
- action.addPropertyChangeListener(actionPropertyChangeListener);
- }
-
- firePropertyChange("horizontalAlignment", oldAction, newAction);
- }
-
- /**
- * @since 1.3
- */
- public void setActionCommand(String command)
- {
- actionCommand = command;
- }
-
- /**
- * @since 1.3
- */
- protected PropertyChangeListener createActionPropertyChangeListener(Action action)
- {
- return new PropertyChangeListener()
- {
- public void propertyChange(PropertyChangeEvent event)
- {
- // Update properties "action" and "horizontalAlignment".
- String name = event.getPropertyName();
-
- if (name.equals("enabled"))
- {
- boolean enabled = ((Boolean) event.getNewValue()).booleanValue();
- JTextField.this.setEnabled(enabled);
- }
- else if (name.equals(Action.SHORT_DESCRIPTION))
- {
- JTextField.this.setToolTipText((String) event.getNewValue());
- }
- }
- };
- }
-
- /**
- * @since 1.3
- */
- protected void configurePropertiesFromAction(Action action)
- {
- if (action != null)
- {
- setEnabled(action.isEnabled());
- setToolTipText((String) action.getValue(Action.SHORT_DESCRIPTION));
- }
- else
- {
- setEnabled(true);
- setToolTipText(null);
- }
- }
-
- protected int getColumnWidth()
- {
- FontMetrics metrics = getToolkit().getFontMetrics(getFont());
- return metrics.charWidth('m');
- }
-}
diff --git a/libjava/javax/swing/JTextPane.java b/libjava/javax/swing/JTextPane.java
deleted file mode 100644
index 80c698ddb2b..00000000000
--- a/libjava/javax/swing/JTextPane.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/* JTextPane.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
-import javax.swing.text.AttributeSet;
-import javax.swing.text.Document;
-import javax.swing.text.EditorKit;
-import javax.swing.text.MutableAttributeSet;
-import javax.swing.text.Style;
-import javax.swing.text.StyledDocument;
-import javax.swing.text.StyledEditorKit;
-
-/**
- * JTextPane
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class JTextPane extends JEditorPane {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * uiClassID
- */
- private static final String uiClassID = "TextPaneUI";
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor JTextPane
- */
- public JTextPane() {
- // TODO
- } // JTextPane()
-
- /**
- * Constructor JTextPane
- * @param document TODO
- */
- public JTextPane(StyledDocument document) {
- // TODO
- } // JTextPane()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * writeObject
- * @param stream TODO
- * @exception IOException TODO
- */
- private void writeObject(ObjectOutputStream stream) throws IOException {
- // TODO
- } // writeObject()
-
- /**
- * getUIClassID
- * @returns String
- */
- public String getUIClassID() {
- return uiClassID;
- } // getUIClassID()
-
- /**
- * setDocument
- * @param document TODO
- */
- public void setDocument(Document document) {
- // TODO
- } // setDocument()
-
- /**
- * getStyledDocument
- * @returns StyledDocument
- */
- public StyledDocument getStyledDocument() {
- return null; // TODO
- } // getStyledDocument()
-
- /**
- * setStyledDocument
- * @param document TODO
- */
- public void setStyledDocument(StyledDocument document) {
- // TODO
- } // setStyledDocument()
-
- /**
- * replaceSelection
- * @param content TODO
- */
- public void replaceSelection(String content) {
- // TODO
- } // replaceSelection()
-
- /**
- * insertComponent
- * @param component TODO
- */
- public void insertComponent(Component component) {
- // TODO
- } // insertComponent()
-
- /**
- * insertIcon
- * @param icon TODO
- */
- public void insertIcon(Icon icon) {
- // TODO
- } // insertIcon()
-
- /**
- * addStyle
- * @param nm TODO
- * @param parent TODO
- * @returns Style
- */
- public Style addStyle(String nm, Style parent) {
- return null; // TODO
- } // addStyle()
-
- /**
- * removeStyle
- * @param nm TODO
- */
- public void removeStyle(String nm) {
- // TODO
- } // removeStyle()
-
- /**
- * getStyle
- * @param nm TODO
- * @returns Style
- */
- public Style getStyle(String nm) {
- return null; // TODO
- } // getStyle()
-
- /**
- * getLogicalStyle
- * @returns Style
- */
- public Style getLogicalStyle() {
- return null; // TODO
- } // getLogicalStyle()
-
- /**
- * setLogicalStyle
- * @param style TODO
- */
- public void setLogicalStyle(Style style) {
- // TODO
- } // setLogicalStyle()
-
- /**
- * getCharacterAttributes
- * @returns AttributeSet
- */
- public AttributeSet getCharacterAttributes() {
- return null; // TODO
- } // getCharacterAttributes()
-
- /**
- * setCharacterAttributes
- * @param attribute TODO
- * @param replace TODO
- */
- public void setCharacterAttributes(AttributeSet attribute,
- boolean replace) {
- // TODO
- } // setCharacterAttributes()
-
- /**
- * getParagraphAttributes
- * @returns AttributeSet
- */
- public AttributeSet getParagraphAttributes() {
- return null; // TODO
- } // getParagraphAttributes()
-
- /**
- * setParagraphAttributes
- * @param attribute TODO
- * @param replace TODO
- */
- public void setParagraphAttributes(AttributeSet attribute,
- boolean replace) {
- // TODO
- } // setParagraphAttributes()
-
- /**
- * getInputAttributes
- * @returns MutableAttributeSet
- */
- public MutableAttributeSet getInputAttributes() {
- return null; // TODO
- } // getInputAttributes()
-
- /**
- * getStyledEditorKit
- * @returns StyledEditorKit
- */
- protected final StyledEditorKit getStyledEditorKit() {
- return null; // TODO
- } // getStyledEditorKit()
-
- /**
- * createDefaultEditorKit
- * @returns EditorKit
- */
- protected EditorKit createDefaultEditorKit() {
- return null; // TODO
- } // createDefaultEditorKit()
-
- /**
- * setEditorKit
- * @param editor TODO
- */
- public final void setEditorKit(EditorKit editor) {
- // TODO
- } // setEditorKit()
-
- /**
- * paramString
- * @returns String
- */
- protected String paramString() {
- return null; // TODO
- } // paramString()
-
-
-} // JTextPane
diff --git a/libjava/javax/swing/JToggleButton.java b/libjava/javax/swing/JToggleButton.java
deleted file mode 100644
index 26424b931e3..00000000000
--- a/libjava/javax/swing/JToggleButton.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/* JToggleButton.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleState;
-import javax.swing.plaf.ButtonUI;
-
-/**
- * The <code>JToggleButton</code> component provides a stateful button,
- * which can be either selected or unselected. This provides the basis
- * for the implementations of radio buttons (<code>JRadioButton</code>)
- * and check boxes (<code>JCheckBox</code>).
- *
- * @author Michael Koch (konqueror@gmx.de)
- * @author Graydon Hoare (graydon@redhat.com)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @see JRadioButton
- * @see JCheckBox
- * @since 1.2
- */
-public class JToggleButton extends AbstractButton implements Accessible
-{
- /**
- * This class provides accessibility support for the toggle button.
- */
- protected class AccessibleJToggleButton
- extends AccessibleAbstractButton
- implements ItemListener
- {
-
- /**
- * Constructor for the accessible toggle button.
- */
- public AccessibleJToggleButton()
- {
- super();
- /* Register the accessible toggle button as a listener for item events */
- addItemListener(this);
- }
-
- /**
- * Returns the accessible role for the toggle button.
- *
- * @return An instance of <code>AccessibleRole</code>, describing
- * the role of the toggle button.
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.TOGGLE_BUTTON;
- }
-
- /**
- * Monitors the toggle button for state changes and fires accessible
- * property change events when they occur.
- *
- * @param event the event that occurred.
- */
- public void itemStateChanged(ItemEvent event)
- {
- /* Fire a state property change event as the button's state has changed */
- if (event.getStateChange() == ItemEvent.SELECTED)
- {
- /* State has changed from unselected (null) to selected */
- firePropertyChange(ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.SELECTED);
- }
- else
- {
- /* State has changed from selected to unselected (null) */
- firePropertyChange(ACCESSIBLE_STATE_PROPERTY, AccessibleState.ENABLED, null);
- }
- }
-
- }
-
- /**
- * The model handles the storage and maintenance of the state of
- * the toggle button. This follows the same paradigm (the MVC
- * or Model-View-Controller design pattern) employed by
- * other Swing components, where the data associated with a component
- * is stored separately from the display aspects.
- */
- public static class ToggleButtonModel extends DefaultButtonModel
- {
- /**
- * Compatible with Sun's JDK.
- */
- private static final long serialVersionUID = -1589950750899943974L;
-
- /**
- * Sets the pressed state of the button. The selected state
- * of the button also changes follwing the button being pressed.
- *
- * @param b true if the button is pressed down.
- */
- public void setPressed(boolean b)
- {
- if (! isEnabled())
- return;
-
- super.setPressed(b);
-
- // setPressed(false) == mouse release on us,
- // if we were armed, we flip the selected state.
- if (!b && isArmed())
- setSelected(! isSelected());
- }
- }
-
- /**
- * Compatible with Sun's JDK.
- */
- private static final long serialVersionUID = -3128248873429850443L;
-
- /**
- * Constructs an unselected toggle button with no text or icon.
- */
- public JToggleButton()
- {
- this(null, null, false);
- }
-
- /**
- * Constructs a toggle button using the labelling, state
- * and icon specified by the supplied action.
- *
- * @param a the action to use to define the properties of the button.
- */
- public JToggleButton(Action a)
- {
- this();
- setAction(a);
- }
-
- /**
- * Constructs an unselected toggle button with the supplied icon
- * and no text.
- *
- * @param icon the icon to use.
- */
- public JToggleButton(Icon icon)
- {
- this(null, icon, false);
- }
-
- /**
- * Constructs a toggle button with the supplied icon and state.
- *
- * @param icon the icon to use.
- * @param selected if true, the toggle button is initially in the
- * selected state. Otherwise, the button is unselected.
- */
- public JToggleButton(Icon icon, boolean selected)
- {
- this(null, icon, selected);
- }
-
- /**
- * Constructs an unselected toggle button using the supplied text
- * and no icon.
- *
- * @param text the text to use.
- */
- public JToggleButton(String text)
- {
- this(text, null, false);
- }
-
- /**
- * Constructs a toggle button with the supplied text and state.
- *
- * @param text the text to use.
- * @param selected if true, the toggle button is initially in the
- * selected state. Otherwise, the button is unselected.
- */
- public JToggleButton(String text, boolean selected)
- {
- this(text, null, selected);
- }
-
- /**
- * Constructs an unselected toggle button with the supplied text
- * and icon.
- *
- * @param text the text to use.
- * @param icon the icon to use.
- */
- public JToggleButton(String text, Icon icon)
- {
- this(text, icon, false);
- }
-
- /**
- * Constructs a toggle button with the supplied text, icon and state.
- *
- * @param text the text to use.
- * @param icon the icon to use.
- * @param selected if true, the toggle button is initially in the
- * selected state. Otherwise, the button is unselected.
- */
- public JToggleButton (String text, Icon icon, boolean selected)
- {
- super(text, icon);
-
- setModel(new ToggleButtonModel());
- model.setSelected(selected);
- model.setActionCommand("");
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>JToggleButton</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- {
- /* Create the context */
- accessibleContext = new AccessibleJToggleButton();
- }
- return accessibleContext;
- }
-
- /**
- * Returns a string that specifies the name of the Look and Feel
- * class that renders this component.
- *
- * @return The Look and Feel UI class in <code>String</code> form.
- */
- public String getUIClassID()
- {
- return "ToggleButtonUI";
- }
-
- /**
- * Returns a textual representation of this component for debugging.
- * Users should not depend on anything as regards the content or formatting
- * of this string, except for the fact that the returned string may never be
- * null (only empty).
- *
- * @return the component in <code>String</code> form for debugging.
- */
- protected String paramString()
- {
- return "JToggleButton";
- }
-
- /**
- * This method resets the toggle button's UI delegate to the default UI for
- * the current look and feel.
- */
- public void updateUI()
- {
- setUI((ButtonUI)UIManager.getUI(this));
- }
-
-}
-
-
-
diff --git a/libjava/javax/swing/JToolBar.java b/libjava/javax/swing/JToolBar.java
deleted file mode 100644
index 649919e0618..00000000000
--- a/libjava/javax/swing/JToolBar.java
+++ /dev/null
@@ -1,779 +0,0 @@
-/* JToolBar.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.beans.PropertyChangeListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleStateSet;
-import javax.swing.JButton;
-import javax.swing.plaf.ToolBarUI;
-
-/**
- * JToolBar is a component that provides a toolbar to Swing programs. Users
- * can add buttons (or actions that will be represented by JButtons) as well
- * as other components to the JToolBar. JToolBars can be dragged in and out
- * of their parent components. If the JToolBar is dragged out of the parent,
- * then it will be displayed in its own RootPaneContainer. For dragging to
- * work properly, JToolBars need to be placed in a Container that has a
- * BorderLayout. That parent Container cannot have components in the NORTH,
- * EAST, SOUTH, or WEST components (that is not the JToolBar).
- */
-public class JToolBar extends JComponent implements SwingConstants, Accessible
-{
- /**
- * AccessibleJToolBar
- */
- protected class AccessibleJToolBar extends AccessibleJComponent
- {
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -5516888265903814215L;
-
- /**
- * Constructor AccessibleJToolBar
- */
- protected AccessibleJToolBar()
- {
- }
-
- /**
- * getAccessibleStateSet
- *
- * @return AccessibleStateSet
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- return null; // TODO
- }
-
- /**
- * getAccessibleRole
- *
- * @return AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.TOOL_BAR;
- }
- }
-
- /**
- * This is the private JToolBar layout manager.
- */
- private class DefaultToolBarLayout implements LayoutManager
- {
- /**
- * This method is called when a new component is added to the container.
- *
- * @param name The name of the component added.
- * @param comp The component that was added.
- */
- public void addLayoutComponent(String name, Component comp)
- {
- // Do nothing.
- }
-
- /**
- * This method is called to lay out the given container to position and
- * size the child components.
- *
- * @param c The container to lay out.
- *
- * @throws Error DOCUMENT ME!
- */
- public void layoutContainer(Container c)
- {
- if (! (c instanceof JToolBar))
- throw new Error("DefaultToolBarLayout can only be used on JToolBars.");
- Insets insets = getInsets();
- Insets margin = getMargin();
- int middle;
- if (margin != null)
- {
- insets.left += margin.left;
- insets.top += margin.top;
- insets.bottom += margin.bottom;
- insets.right += margin.right;
- }
- Component[] components = c.getComponents();
- Dimension tdims = c.getSize();
- int start = 0;
- Dimension pref;
-
- if (getOrientation() == SwingUtilities.HORIZONTAL)
- {
- start += insets.left;
- for (int i = 0; i < components.length; i++)
- {
- if (components[i] != null && components[i].isVisible())
- {
- pref = components[i].getPreferredSize();
- if (pref != null)
- {
- middle = (tdims.height - pref.height) / 2;
- components[i].setBounds(start, middle, pref.width,
- pref.height);
- start += pref.width;
- }
- }
- }
- }
- else
- {
- start += insets.top;
- for (int i = 0; i < components.length; i++)
- {
- if (components[i] != null && components[i].isVisible())
- {
- pref = components[i].getPreferredSize();
- if (pref != null)
- {
- middle = (tdims.width - pref.width) / 2;
- components[i].setBounds(middle, start, pref.width,
- pref.height);
- start += pref.height;
- }
- }
- }
- }
- }
-
- /**
- * This method returns the minimum size of the given container given the
- * child components.
- *
- * @param parent The container to measure.
- *
- * @return The minimum size of the given container.
- */
- public Dimension minimumLayoutSize(Container parent)
- {
- return preferredLayoutSize(parent);
- }
-
- /**
- * This method returns the preferred size of the given container given the
- * child components.
- *
- * @param parent The container to measure.
- *
- * @return The preferred size of the given container.
- */
- public Dimension preferredLayoutSize(Container parent)
- {
- int orientation = getOrientation();
- Component[] components = getComponents();
-
- int limit = 0;
- int total = 0;
- Dimension dims;
-
- int w = 0;
- int h = 0;
-
- if (orientation == SwingConstants.HORIZONTAL)
- {
- for (int i = 0; i < components.length; i++)
- {
- dims = components[i].getPreferredSize();
- if (dims != null)
- {
- if (dims.height > limit)
- limit = dims.height;
- total += dims.width;
- }
- }
- w = total;
- h = limit;
- }
- else
- {
- for (int i = 0; i < components.length; i++)
- {
- dims = components[i].getPreferredSize();
- if (dims != null)
- {
- if (dims.width > limit)
- limit = dims.width;
- total += dims.height;
- }
- }
- w = limit;
- h = total;
- }
-
- Insets insets = getInsets();
- w += insets.left + insets.right;
- h += insets.top + insets.bottom;
-
- Insets margin = getMargin();
- if (margin != null)
- {
- w += margin.left + margin.right;
- h += margin.top + margin.bottom;
- }
-
- return new Dimension(w, h);
- }
-
- /**
- * This method is called when the given component is removed from the
- * container.
- *
- * @param comp The component removed.
- */
- public void removeLayoutComponent(Component comp)
- {
- // Do nothing.
- }
- }
-
- /**
- * This is an extension of JSeparator used in toolbars. Unlike JSeparator,
- * nothing is painted for this Separator, it is only blank space that
- * separates components.
- */
- public static class Separator extends JSeparator
- {
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -1656745644823105219L;
-
- /**
- * Creates a new Separator object.
- */
- public Separator()
- {
- super();
- } // Separator()
-
- /**
- * Creates a new Separator object with the given size.
- *
- * @param size The size of the separator.
- */
- public Separator(Dimension size)
- {
- setPreferredSize(size);
- } // Separator()
-
- /**
- * This method returns the String ID of the UI class of Separator.
- *
- * @return The UI class' String ID.
- */
- public String getUIClassID()
- {
- return "ToolBarSeparatorUI";
- } // getUIClassID()
-
- /**
- * This method returns the preferred size of the Separator.
- *
- * @return The preferred size of the Separator.
- */
- public Dimension getPreferredSize()
- {
- return super.getPreferredSize();
- } // getPreferredSize()
-
- /**
- * This method returns the maximum size of the Separator.
- *
- * @return The maximum size of the Separator.
- */
- public Dimension getMaximumSize()
- {
- return super.getPreferredSize();
- } // getMaximumSize()
-
- /**
- * This method returns the minimum size of the Separator.
- *
- * @return The minimum size of the Separator.
- */
- public Dimension getMinimumSize()
- {
- return super.getPreferredSize();
- } // getMinimumSize()
-
- /**
- * This method returns the size of the Separator.
- *
- * @return The size of the Separator.
- */
- public Dimension getSeparatorSize()
- {
- return super.getPreferredSize();
- } // getSeparatorSize()
-
- /**
- * This method sets the size of the Separator.
- *
- * @param size The new size of the Separator.
- */
- public void setSeparatorSize(Dimension size)
- {
- setPreferredSize(size);
- } // setSeparatorSize()
- } // Separator
-
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -1269915519555129643L;
-
- /** Whether the JToolBar paints its border. */
- private transient boolean paintBorder = true;
-
- /** The extra insets around the JToolBar. */
- private transient Insets margin;
-
- /** Whether the JToolBar can float (and be dragged around). */
- private transient boolean floatable = true;
-
- /** Whether the buttons will have rollover borders. */
- private transient boolean rollover;
-
- /** The orientation of the JToolBar. */
- private int orientation = HORIZONTAL;
-
- /**
- * This method creates a new JToolBar object with horizontal orientation
- * and no name.
- */
- public JToolBar()
- {
- this(null, HORIZONTAL);
- } // JToolBar()
-
- /**
- * This method creates a new JToolBar with the given orientation and no
- * name.
- *
- * @param orientation JToolBar orientation (HORIZONTAL or VERTICAL)
- */
- public JToolBar(int orientation)
- {
- this(null, orientation);
- } // JToolBar()
-
- /**
- * This method creates a new JToolBar object with the given name and
- * horizontal orientation.
- *
- * @param name Name assigned to undocked tool bar.
- */
- public JToolBar(String name)
- {
- this(name, HORIZONTAL);
- } // JToolBar()
-
- /**
- * This method creates a new JToolBar object with the given name and
- * orientation.
- *
- * @param name Name assigned to undocked tool bar.
- * @param orientation JToolBar orientation (HORIZONTAL or VERTICAL)
- */
- public JToolBar(String name, int orientation)
- {
- setName(name);
- setOrientation(orientation);
- setLayout(new DefaultToolBarLayout());
- revalidate();
- updateUI();
- } // JToolBar()
-
- /**
- * This method adds a new JButton that performs the given Action to the
- * JToolBar.
- *
- * @param action The Action to add to the JToolBar.
- *
- * @return The JButton that wraps the Action.
- */
- public JButton add(Action action)
- {
- JButton b = createActionComponent(action);
- add(b);
- return b;
- } // add()
-
- /**
- * This method paints the border if the borderPainted property is true.
- *
- * @param graphics The graphics object to paint with.
- */
- protected void paintBorder(Graphics graphics)
- {
- if (paintBorder && isFloatable())
- super.paintBorder(graphics);
- } // paintBorder()
-
- /**
- * This method returns the UI class used to paint this JToolBar.
- *
- * @return The UI class for this JToolBar.
- */
- public ToolBarUI getUI()
- {
- return (ToolBarUI) ui;
- } // getUI()
-
- /**
- * This method sets the UI used with the JToolBar.
- *
- * @param ui The UI used with the JToolBar.
- */
- public void setUI(ToolBarUI ui)
- {
- super.setUI(ui);
- } // setUI()
-
- /**
- * This method resets the UI used to the Look and Feel defaults.
- */
- public void updateUI()
- {
- setUI((ToolBarUI) UIManager.getUI(this));
- revalidate();
- repaint();
- } // updateUI()
-
- /**
- * This method returns the String identifier for the UI class to the used
- * with the JToolBar.
- *
- * @return The String identifier for the UI class.
- */
- public String getUIClassID()
- {
- return "ToolBarUI";
- } // getUIClassID()
-
- /**
- * This method sets the rollover property for the JToolBar. In rollover
- * mode, JButtons inside the JToolBar will only display their borders when
- * the mouse is moving over them.
- *
- * @param b The new rollover property.
- */
- public void setRollover(boolean b)
- {
- if (b != rollover)
- {
- rollover = b;
- firePropertyChange("rollover", ! rollover, rollover);
- revalidate();
- repaint();
- }
- }
-
- /**
- * This method returns the rollover property.
- *
- * @return The rollover property.
- */
- public boolean isRollover()
- {
- return rollover;
- }
-
- /**
- * This method returns the index of the given component.
- *
- * @param component The component to find.
- *
- * @return The index of the given component.
- */
- public int getComponentIndex(Component component)
- {
- Component[] components = getComponents();
- if (components == null)
- return -1;
-
- for (int i = 0; i < components.length; i++)
- if (components[i] == component)
- return i;
-
- return -1;
- } // getComponentIndex()
-
- /**
- * This method returns the component at the given index.
- *
- * @param index The index of the component.
- *
- * @return The component at the given index.
- */
- public Component getComponentAtIndex(int index)
- {
- return getComponent(index);
- } // getComponentAtIndex()
-
- /**
- * This method returns the margin property.
- *
- * @return The margin property.
- */
- public Insets getMargin()
- {
- return margin;
- } // getMargin()
-
- /**
- * This method sets the margin property. The margin property determines the
- * extra space between the children components of the JToolBar and the
- * border.
- *
- * @param margin The margin property.
- */
- public void setMargin(Insets margin)
- {
- if ((this.margin != null && margin == null)
- || (this.margin == null && margin != null)
- || (margin != null && this.margin != null
- && (margin.left != this.margin.left
- || margin.right != this.margin.right || margin.top != this.margin.top
- || margin.bottom != this.margin.bottom)))
- {
- Insets oldMargin = this.margin;
- this.margin = margin;
- firePropertyChange("margin", oldMargin, this.margin);
- revalidate();
- repaint();
- }
- } // setMargin()
-
- /**
- * This method returns the borderPainted property.
- *
- * @return The borderPainted property.
- */
- public boolean isBorderPainted()
- {
- return paintBorder;
- } // isBorderPainted()
-
- /**
- * This method sets the borderPainted property. If set to false, the border
- * will not be painted.
- *
- * @param painted Whether the border will be painted.
- */
- public void setBorderPainted(boolean painted)
- {
- if (painted != paintBorder)
- {
- paintBorder = painted;
- firePropertyChange("borderPainted", ! paintBorder,
- paintBorder);
- repaint();
- }
- } // setBorderPainted()
-
- /**
- * This method returns the floatable property.
- *
- * @return The floatable property.
- */
- public boolean isFloatable()
- {
- return floatable;
- } // isFloatable()
-
- /**
- * This method sets the floatable property. If set to false, the JToolBar
- * cannot be dragged.
- *
- * @param floatable Whether the JToolBar can be dragged.
- */
- public void setFloatable(boolean floatable)
- {
- if (floatable != this.floatable)
- {
- this.floatable = floatable;
- firePropertyChange("floatable", ! floatable, floatable);
- }
- } // setFloatable()
-
- /**
- * This method returns the orientation of the JToolBar.
- *
- * @return The orientation of the JToolBar.
- */
- public int getOrientation()
- {
- return orientation;
- } // getOrientation()
-
- /**
- * This method sets the layout manager to be used with the JToolBar.
- *
- * @param mgr The Layout Manager used with the JToolBar.
- */
- public void setLayout(LayoutManager mgr)
- {
- super.setLayout(mgr);
- revalidate();
- repaint();
- } // setLayout()
-
- /**
- * This method sets the orientation property for JToolBar.
- *
- * @param orientation The new orientation for JToolBar.
- *
- * @throws IllegalArgumentException If the orientation is not HORIZONTAL or
- * VERTICAL.
- */
- public void setOrientation(int orientation)
- {
- if (orientation != HORIZONTAL && orientation != VERTICAL)
- throw new IllegalArgumentException(orientation
- + " is not a legal orientation");
- if (orientation != this.orientation)
- {
- int oldOrientation = this.orientation;
- this.orientation = orientation;
- firePropertyChange("orientation", oldOrientation, this.orientation);
- revalidate();
- repaint();
- }
- } // setOrientation()
-
- /**
- * This method adds a Separator of default size to the JToolBar.
- */
- public void addSeparator()
- {
- add(new Separator());
- } // addSeparator()
-
- /**
- * This method adds a Separator with the given size to the JToolBar.
- *
- * @param size The size of the Separator.
- */
- public void addSeparator(Dimension size)
- {
- add(new Separator(size));
- } // addSeparator()
-
- /**
- * This method is used to create JButtons which can be added to the JToolBar
- * for the given action.
- *
- * @param action The action to create a JButton for.
- *
- * @return The JButton created from the action.
- */
- protected JButton createActionComponent(Action action)
- {
- return new JButton(action);
- } // createActionComponent()
-
- /**
- * This method creates a pre-configured PropertyChangeListener which updates
- * the control as changes are made to the Action. However, this is no
- * longer the recommended way of adding Actions to Containers. As such,
- * this method returns null.
- *
- * @param button The JButton to configure a PropertyChangeListener for.
- *
- * @return null.
- */
- protected PropertyChangeListener createActionChangeListener(JButton button)
- {
- // XXX: As specified, this returns null. But seems kind of strange, usually deprecated methods don't just return null, verify!
- return null;
- } // createActionChangeListener()
-
- /**
- * This method overrides Container's addImpl method. If a JButton is added,
- * it is disabled.
- *
- * @param component The Component to add.
- * @param constraints The Constraints placed on the component.
- * @param index The index to place the Component at.
- */
- protected void addImpl(Component component, Object constraints, int index)
- {
- // XXX: Sun says disable button but test cases show otherwise.
- super.addImpl(component, constraints, index);
-
- // if we added a Swing Button then adjust this a little
- if (component instanceof AbstractButton)
- {
- AbstractButton b = (AbstractButton) component;
- b.setRolloverEnabled(rollover);
- b.updateUI();
- }
-
- } // addImpl()
-
- /**
- * This method returns a String description of the JToolBar.
- *
- * @return A String description of the JToolBar.
- */
- protected String paramString()
- {
- return "JToolBar";
- } // paramString()
-
- /**
- * getAccessibleContext
- *
- * @return AccessibleContext
- */
- public AccessibleContext getAccessibleContext()
- {
- if (accessibleContext == null)
- accessibleContext = new AccessibleJToolBar();
-
- return accessibleContext;
- }
-}
diff --git a/libjava/javax/swing/JToolTip.java b/libjava/javax/swing/JToolTip.java
deleted file mode 100644
index ca93c6f2ee3..00000000000
--- a/libjava/javax/swing/JToolTip.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/* JToolTip.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.AWTEvent;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.swing.plaf.ToolTipUI;
-
-/**
- * This class is used to display ToolTips. ToolTips are small floating windows
- * that display text when the mouse comes to rest over a Component. ToolTips
- * are set for JComponents using JComponent.setToolTipText(String).
- */
-public class JToolTip extends JComponent implements Accessible
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -1138929898906751643L;
-
- /**
- * DOCUMENT ME!
- */
- protected class AccessibleJToolTip extends AccessibleJComponent
- {
- /**
- * Creates a new AccessibleJToolTip object.
- */
- protected AccessibleJToolTip()
- {
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public String getAccessibleDescription()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleRole getAccessibleRole()
- {
- return null;
- }
- }
-
- /** The text to display in the JToolTip. */
- String text;
-
- /** The JComponent this JToolTip is used for. */
- JComponent component;
-
- /**
- * Creates a new JToolTip object.
- */
- public JToolTip()
- {
- disableEvents(AWTEvent.MOUSE_EVENT_MASK);
- updateUI();
- }
-
- /**
- * This method returns the text this JToolTip displays.
- *
- * @return The text that this JToolTip displays.
- */
- public String getTipText()
- {
- return text;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
- /**
- * This method returns the JComponent this JToolTip displays for.
- *
- * @return The JComponent this JToolTip displays for.
- */
- public JComponent getComponent()
- {
- return component;
- }
-
- /**
- * This method returns the UI responsible for displaying this JToolTip.
- *
- * @return The UI responsible for displaying this JToolTip.
- */
- public ToolTipUI getUI()
- {
- return (ToolTipUI) ui;
- }
-
- /**
- * This method returns the String identifier for the UI class.
- *
- * @return The String identifier for the UI class.
- */
- public String getUIClassID()
- {
- return "ToolTipUI";
- }
-
- /**
- * This method returns a debugging String describing the JToolTip.
- *
- * @return A debugging String describing the JToolTip.
- */
- protected String paramString()
- {
- return "JToolTip";
- }
-
- /**
- * This method sets the JComponent that the JToolTip displays for.
- *
- * @param c The JComponent that the JToolTip displays for.
- */
- public void setComponent(JComponent c)
- {
- component = c;
- }
-
- /**
- * This method sets the text that the JToolTip displays.
- *
- * @param tipText The text that the JToolTip displays.
- */
- public void setTipText(String tipText)
- {
- text = tipText;
- }
-
- /**
- * This method resets the UI used to the Look and Feel default.
- */
- public void updateUI()
- {
- setUI((ToolTipUI) UIManager.getUI(this));
- revalidate();
- repaint();
- }
-}
diff --git a/libjava/javax/swing/JTree.java b/libjava/javax/swing/JTree.java
deleted file mode 100644
index 70d9c33c656..00000000000
--- a/libjava/javax/swing/JTree.java
+++ /dev/null
@@ -1,1392 +0,0 @@
-/* JTree.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Dimension;
-import java.awt.Rectangle;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.swing.event.TreeExpansionEvent;
-import javax.swing.event.TreeExpansionListener;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-import javax.swing.event.TreeWillExpandListener;
-import javax.swing.plaf.TreeUI;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.DefaultTreeCellRenderer;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.ExpandVetoException;
-import javax.swing.tree.TreeCellEditor;
-import javax.swing.tree.TreeCellRenderer;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
-
-
-public class JTree extends JComponent
- implements Scrollable, Accessible
-{
- private static final long serialVersionUID = 7559816092864483649L;
-
- public static final String CELL_EDITOR_PROPERTY = "cellEditor";
- public static final String CELL_RENDERER_PROPERTY = "cellRenderer";
- public static final String EDITABLE_PROPERTY = "editable";
- public static final String INVOKES_STOP_CELL_EDITING_PROPERTY = "invokesStopCellEditing";
- public static final String LARGE_MODEL_PROPERTY = "largeModel";
- public static final String ROOT_VISIBLE_PROPERTY = "rootVisible";
- public static final String ROW_HEIGHT_PROPERTY = "rowHeight";
- public static final String SCROLLS_ON_EXPAND_PROPERTY = "scrollsOnExpand";
- public static final String SELECTION_MODEL_PROPERTY = "selectionModel";
- public static final String SHOWS_ROOT_HANDLES_PROPERTY = "showsRootHandles";
- public static final String TOGGLE_CLICK_COUNT_PROPERTY = "toggleClickCount";
- public static final String TREE_MODEL_PROPERTY = "model";
- public static final String VISIBLE_ROW_COUNT_PROPERTY = "visibleRowCount";
-
- /** @since 1.3 */
- public static final String ANCHOR_SELECTION_PATH_PROPERTY = "anchorSelectionPath";
- /** @since 1.3 */
- public static final String LEAD_SELECTION_PATH_PROPERTY = "leadSelectionPath";
- /** @since 1.3 */
- public static final String EXPANDS_SELECTED_PATHS_PROPERTY = "expandsSelectedPaths";
-
- private static final Object EXPANDED = new Object();
- private static final Object COLLAPSED = new Object();
-
- private boolean dragEnabled;
- private boolean expandsSelectedPaths;
- private TreePath anchorSelectionPath;
- private TreePath leadSelectionPath;
-
- /*
- * This contains the state of all nodes in the tree. Al/ entries map the
- * TreePath of a note to to its state. Valid states are EXPANDED and
- * COLLAPSED. Nodes not in this Hashtable are assumed state COLLAPSED.
- */
- private Hashtable nodeStates;
-
- protected transient TreeCellEditor cellEditor;
- protected transient TreeCellRenderer cellRenderer;
- protected boolean editable;
- protected boolean invokesStopCellEditing;
- protected boolean largeModel;
- protected boolean rootVisible;
- protected int rowHeight;
- protected boolean scrollsOnExpand;
- protected transient TreeSelectionModel selectionModel;
- protected boolean showsRootHandles;
- protected int toggleClickCount;
- protected transient TreeModel treeModel;
- protected int visibleRowCount;
-
- /**
- * Creates a new <code>JTree</code> object.
- */
- public JTree()
- {
- this(createTreeModel(null));
- }
-
- /**
- * Creates a new <code>JTree</code> object.
- *
- * @param value the initial nodes in the tree
- */
- public JTree(Hashtable value)
- {
- this(createTreeModel(value));
- }
-
- /**
- * Creates a new <code>JTree</code> object.
- *
- * @param value the initial nodes in the tree
- */
- public JTree(Object[] value)
- {
- this(createTreeModel(value));
- }
-
- /**
- * Creates a new <code>JTree</code> object.
- *
- * @param model the model to use
- */
- public JTree(TreeModel model)
- {
- treeModel = model;
- setCellRenderer(new DefaultTreeCellRenderer());
- updateUI();
- }
-
- /**
- * Creates a new <code>JTree</code> object.
- *
- * @param root the root node
- */
- public JTree(TreeNode root)
- {
- this(root, false);
- }
-
- /**
- * Creates a new <code>JTree</code> object.
- *
- * @param root the root node
- * @param asksAllowChildren if false, all nodes without children are leaf nodes.
- * If true, only nodes that do not allow children are leaf nodes.
- */
- public JTree(TreeNode root, boolean asksAllowChildren)
- {
- this(new DefaultTreeModel(root, asksAllowChildren));
- }
-
- /**
- * Creates a new <code>JTree</code> object.
- *
- * @param value the initial nodes in the tree
- */
- public JTree(Vector value)
- {
- this(createTreeModel(value));
- }
-
- public static class DynamicUtilTreeNode
- extends DefaultMutableTreeNode
- {
- protected Object childValue;
- protected boolean loadedChildren;
-
- /**
- * Currently not set or used by this class.
- * It might be set and used in later versions of this class.
- */
- protected boolean hasChildren;
-
- public DynamicUtilTreeNode(Object value,
- Object children)
- {
- super(value);
- childValue = children;
- loadedChildren = false;
- }
-
- public int getChildCount()
- {
- loadChildren();
- return super.getChildCount();
- }
-
- protected void loadChildren()
- {
- if (!loadedChildren)
- {
- createChildren(this, childValue);
- loadedChildren = true;
- }
- }
-
- public Enumeration children()
- {
- loadChildren();
- return super.children();
- }
-
- public boolean isLeaf()
- {
- return (childValue == null ||
- !(childValue instanceof Hashtable
- || childValue instanceof Vector
- || childValue.getClass().isArray()));
- }
-
- public static void createChildren(DefaultMutableTreeNode parent,
- Object children)
- {
- if (children instanceof Hashtable)
- {
- Hashtable tab = (Hashtable) children;
- Enumeration e = tab.keys();
- while (e.hasMoreElements())
- {
- Object key = e.nextElement();
- Object val = tab.get(key);
- parent.add(new DynamicUtilTreeNode(key, val));
- }
- }
- else if (children instanceof Vector)
- {
- Iterator i = ((Vector)children).iterator();
- while (i.hasNext())
- {
- Object n = i.next();
- parent.add(new DynamicUtilTreeNode(n,n));
- }
- }
- else if (children.getClass().isArray())
- {
- Object[] arr = (Object[]) children;
- for (int i = 0; i < arr.length; ++i)
- parent.add(new DynamicUtilTreeNode(arr[i], arr[i]));
- }
- }
- }
-
- public int getRowForPath(TreePath path)
- {
- TreeUI ui = getUI();
-
- if (ui != null)
- return ui.getRowForPath(this, path);
-
- return -1;
- }
-
- public TreePath getPathForRow(int row)
- {
- TreeUI ui = getUI();
- return ui != null ? ui.getPathForRow(this, row) : null;
- }
-
- protected TreePath[] getPathBetweenRows(int index0, int index1)
- {
- TreeUI ui = getUI();
-
- if (ui == null)
- return null;
-
- int minIndex = Math.min(index0, index1);
- int maxIndex = Math.max(index0, index1);
- TreePath[] paths = new TreePath[maxIndex - minIndex + 1];
-
- for (int i = minIndex; i <= maxIndex; ++i)
- paths[i - minIndex] = ui.getPathForRow(this, i);
-
- return paths;
- }
-
- /**
- * Creates a new <code>TreeModel</code> object.
- *
- * @param value the values stored in the model
- */
- protected static TreeModel createTreeModel(Object value)
- {
- return new DefaultTreeModel(new DynamicUtilTreeNode(value, value));
- }
-
- /**
- * Return the UI associated with this <code>JTree</code> object.
- *
- * @return the associated <code>TreeUI</code> object
- */
- public TreeUI getUI()
- {
- return (TreeUI) ui;
- }
-
- /**
- * Sets the UI associated with this <code>JTree</code> object.
- *
- * @param ui the <code>TreeUI</code> to associate
- */
- public void setUI(TreeUI ui)
- {
- super.setUI(ui);
- }
-
- /**
- * This method resets the UI used to the Look and Feel defaults..
- */
- public void updateUI()
- {
- setUI((TreeUI) UIManager.getUI(this));
- revalidate();
- repaint();
- }
-
- /**
- * This method returns the String ID of the UI class of Separator.
- *
- * @return The UI class' String ID.
- */
- public String getUIClassID()
- {
- return "TreeUI";
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>JToggleButton</code>.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
- /**
- * Returns the preferred viewport size..
- *
- * @return the preferred size
- */
- public Dimension getPreferredScrollableViewportSize()
- {
- return null;
- }
-
- public int getScrollableUnitIncrement(Rectangle visibleRect,
- int orientation, int direction)
- {
- return 1;
- }
-
- public int getScrollableBlockIncrement(Rectangle visibleRect,
- int orientation, int direction)
- {
- return 1;
- }
-
- public boolean getScrollableTracksViewportWidth()
- {
- return false;
- }
-
- public boolean getScrollableTracksViewportHeight()
- {
- return false;
- }
-
- /**
- * Adds a <code>TreeExpansionListener</code> object to the tree.
- *
- * @param listener the listener to add
- */
- public void addTreeExpansionListener(TreeExpansionListener listener)
- {
- listenerList.add(TreeExpansionListener.class, listener);
- }
-
- /**
- * Removes a <code>TreeExpansionListener</code> object from the tree.
- *
- * @param listener the listener to remove
- */
- public void removeTreeExpansionListener(TreeExpansionListener listener)
- {
- listenerList.remove(TreeExpansionListener.class, listener);
- }
-
- /**
- * Returns all added <code>TreeExpansionListener</code> objects.
- *
- * @return an array of listeners
- */
- public TreeExpansionListener[] getTreeExpansionListeners()
- {
- return (TreeExpansionListener[]) getListeners(TreeExpansionListener.class);
- }
-
- /**
- * Notifies all listeners that the tree was collapsed.
- *
- * @param path the path to the node that was collapsed
- */
- public void fireTreeCollapsed(TreePath path)
- {
- TreeExpansionEvent event = new TreeExpansionEvent(this, path);
- TreeExpansionListener[] listeners = getTreeExpansionListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].treeCollapsed(event);
- }
-
- /**
- * Notifies all listeners that the tree was expanded.
- *
- * @param path the path to the node that was expanded
- */
- public void fireTreeExpanded(TreePath path)
- {
- TreeExpansionEvent event = new TreeExpansionEvent(this, path);
- TreeExpansionListener[] listeners = getTreeExpansionListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].treeExpanded(event);
- }
-
- /**
- * Adds a <code>TreeSelctionListener</code> object to the tree.
- *
- * @param listener the listener to add
- */
- public void addTreeSelectionListener(TreeSelectionListener listener)
- {
- listenerList.add(TreeSelectionListener.class, listener);
- }
-
- /**
- * Removes a <code>TreeSelectionListener</code> object from the tree.
- *
- * @param listener the listener to remove
- */
- public void removeTreeSelectionListener(TreeSelectionListener listener)
- {
- listenerList.remove(TreeSelectionListener.class, listener);
- }
-
- /**
- * Returns all added <code>TreeSelectionListener</code> objects.
- *
- * @return an array of listeners
- */
- public TreeSelectionListener[] getTreeSelectionListeners()
- {
- return (TreeSelectionListener[]) getListeners(TreeSelectionListener.class);
- }
-
- /**
- * Notifies all listeners when the selection of the tree changed.
- *
- * @param event the event to send
- */
- protected void fireValueChanged(TreeSelectionEvent event)
- {
- TreeSelectionListener[] listeners = getTreeSelectionListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].valueChanged(event);
- }
-
- /**
- * Adds a <code>TreeWillExpandListener</code> object to the tree.
- *
- * @param listener the listener to add
- */
- public void addTreeWillExpandListener(TreeWillExpandListener listener)
- {
- listenerList.add(TreeWillExpandListener.class, listener);
- }
-
- /**
- * Removes a <code>TreeWillExpandListener</code> object from the tree.
- *
- * @param listener the listener to remove
- */
- public void removeTreeWillExpandListener(TreeWillExpandListener listener)
- {
- listenerList.remove(TreeWillExpandListener.class, listener);
- }
-
- /**
- * Returns all added <code>TreeWillExpandListener</code> objects.
- *
- * @return an array of listeners
- */
- public TreeWillExpandListener[] getTreeWillExpandListeners()
- {
- return (TreeWillExpandListener[]) getListeners(TreeWillExpandListener.class);
- }
-
- /**
- * Notifies all listeners that the tree will collapse.
- *
- * @param path the path to the node that will collapse
- */
- public void fireTreeWillCollapse(TreePath path)
- throws ExpandVetoException
- {
- TreeExpansionEvent event = new TreeExpansionEvent(this, path);
- TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].treeWillCollapse(event);
- }
-
- /**
- * Notifies all listeners that the tree will expand.
- *
- * @param path the path to the node that will expand
- */
- public void fireTreeWillExpand(TreePath path)
- throws ExpandVetoException
- {
- TreeExpansionEvent event = new TreeExpansionEvent(this, path);
- TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].treeWillExpand(event);
- }
-
- /**
- * Returns the model of this <code>JTree</code> object.
- *
- * @return the associated <code>TreeModel</code>
- */
- public TreeModel getModel()
- {
- return treeModel;
- }
-
- /**
- * Sets the model to use in <code>JTree</code>.
- *
- * @param model the <code>TreeModel</code> to use
- */
- public void setModel(TreeModel model)
- {
- if (treeModel == model)
- return;
-
- TreeModel oldValue = treeModel;
- treeModel = model;
- firePropertyChange(TREE_MODEL_PROPERTY, oldValue, model);
- }
-
- /**
- * Checks if this <code>JTree</code> object is editable.
- *
- * @return <code>true</code> if this tree object is editable,
- * <code>false</code> otherwise
- */
- public boolean isEditable()
- {
- return editable;
- }
-
- /**
- * Sets the <code>editable</code> property.
- *
- * @param flag <code>true</code> to make this tree object editable,
- * <code>false</code> otherwise
- */
- public void setEditable(boolean flag)
- {
- if (editable == flag)
- return;
-
- boolean oldValue = editable;
- editable = flag;
- firePropertyChange(EDITABLE_PROPERTY, oldValue, editable);
- }
-
- /**
- * Checks if the root element is visible.
- *
- * @return <code>true</code> if the root element is visible,
- * <code>false</code> otherwise
- */
- public boolean isRootVisible()
- {
- return rootVisible;
- }
-
- public void setRootVisible(boolean flag)
- {
- if (rootVisible == flag)
- return;
-
- boolean oldValue = rootVisible;
- rootVisible = flag;
- firePropertyChange(ROOT_VISIBLE_PROPERTY, oldValue, flag);
- }
-
- public boolean getShowsRootHandles()
- {
- return showsRootHandles;
- }
-
- public void setShowsRootHandles(boolean flag)
- {
- if (showsRootHandles == flag)
- return;
-
- boolean oldValue = showsRootHandles;
- showsRootHandles = flag;
- firePropertyChange(SHOWS_ROOT_HANDLES_PROPERTY, oldValue, flag);
- }
-
- public TreeCellEditor getCellEditor()
- {
- return cellEditor;
- }
-
- public void setCellEditor(TreeCellEditor editor)
- {
- if (cellEditor == editor)
- return;
-
- TreeCellEditor oldValue = cellEditor;
- cellEditor = editor;
- firePropertyChange(CELL_EDITOR_PROPERTY, oldValue, editor);
- }
-
- public TreeCellRenderer getCellRenderer()
- {
- return cellRenderer;
- }
-
- public void setCellRenderer(TreeCellRenderer newRenderer)
- {
- if (cellRenderer == newRenderer)
- return;
-
- TreeCellRenderer oldValue = cellRenderer;
- cellRenderer = newRenderer;
- firePropertyChange(CELL_RENDERER_PROPERTY, oldValue, newRenderer);
- }
-
- public TreeSelectionModel getSelectionModel()
- {
- return selectionModel;
- }
-
- public void setSelectionModel(TreeSelectionModel model)
- {
- if (selectionModel == model)
- return;
-
- TreeSelectionModel oldValue = selectionModel;
- selectionModel = model;
- firePropertyChange(SELECTION_MODEL_PROPERTY, oldValue, model);
- }
-
- public int getVisibleRowCount()
- {
- return visibleRowCount;
- }
-
- public void setVisibleRowCount(int rows)
- {
- if (visibleRowCount == rows)
- return;
-
- int oldValue = visibleRowCount;
- visibleRowCount = rows;
- firePropertyChange(VISIBLE_ROW_COUNT_PROPERTY, oldValue, rows);
- }
-
- public boolean isLargeModel()
- {
- return largeModel;
- }
-
- public void setLargeModel(boolean large)
- {
- if (largeModel == large)
- return;
-
- boolean oldValue = largeModel;
- largeModel = large;
- firePropertyChange(LARGE_MODEL_PROPERTY, oldValue, large);
- }
-
- public int getRowHeight()
- {
- return rowHeight;
- }
-
- public void setRowHeight(int height)
- {
- if (rowHeight == height)
- return;
-
- int oldValue = rowHeight;
- rowHeight = height;
- firePropertyChange(ROW_HEIGHT_PROPERTY, oldValue, height);
- }
-
- public boolean isFixedRowHeight()
- {
- return rowHeight > 0;
- }
-
- public boolean getInvokesStopCellEditing()
- {
- return invokesStopCellEditing;
- }
-
- public void setInvokesStopCellEditing(boolean invoke)
- {
- if (invokesStopCellEditing == invoke)
- return;
-
- boolean oldValue = invokesStopCellEditing;
- invokesStopCellEditing = invoke;
- firePropertyChange(INVOKES_STOP_CELL_EDITING_PROPERTY, oldValue, invoke);
- }
-
- /**
- * @since 1.3
- */
- public int getToggleClickCount()
- {
- return toggleClickCount;
- }
-
- /**
- * @since 1.3
- */
- public void setToggleClickCount(int count)
- {
- if (toggleClickCount == count)
- return;
-
- int oldValue = toggleClickCount;
- toggleClickCount = count;
- firePropertyChange(TOGGLE_CLICK_COUNT_PROPERTY, oldValue, count);
- }
-
- public void scrollPathToVisible(TreePath path)
- {
- if (path == null)
- return;
-
- Rectangle rect = getPathBounds(path);
-
- if (rect == null)
- return;
-
- scrollRectToVisible(rect);
- }
-
- public void scrollRowToVisible(int row)
- {
- scrollPathToVisible(getPathForRow(row));
- }
-
- public boolean getScrollsOnExpand()
- {
- return scrollsOnExpand;
- }
-
- public void setScrollsOnExpand(boolean scroll)
- {
- if (scrollsOnExpand == scroll)
- return;
-
- boolean oldValue = scrollsOnExpand;
- scrollsOnExpand = scroll;
- firePropertyChange(SCROLLS_ON_EXPAND_PROPERTY, oldValue, scroll);
- }
-
- public void setSelectionPath(TreePath path)
- {
- selectionModel.setSelectionPath(path);
- }
-
- public void setSelectionPaths(TreePath[] paths)
- {
- selectionModel.setSelectionPaths(paths);
- }
-
- public void setSelectionRow(int row)
- {
- TreePath path = getPathForRow(row);
-
- if (path != null)
- selectionModel.setSelectionPath(path);
- }
-
- public void setSelectionRows(int[] rows)
- {
- // Make sure we have an UI so getPathForRow() does not return null.
- if (rows == null || getUI() == null)
- return;
-
- TreePath[] paths = new TreePath[rows.length];
-
- for (int i = rows.length - 1; i >= 0; --i)
- paths[i] = getPathForRow(rows[i]);
-
- setSelectionPaths(paths);
- }
-
- public void setSelectionInterval(int index0, int index1)
- {
- TreePath[] paths = getPathBetweenRows(index0, index1);
-
- if (paths != null)
- setSelectionPaths(paths);
- }
-
- public void addSelectionPath(TreePath path)
- {
- selectionModel.addSelectionPath(path);
- }
-
- public void addSelectionPaths(TreePath[] paths)
- {
- selectionModel.addSelectionPaths(paths);
- }
-
- public void addSelectionRow(int row)
- {
- TreePath path = getPathForRow(row);
-
- if (path != null)
- selectionModel.addSelectionPath(path);
- }
-
- public void addSelectionRows(int[] rows)
- {
- // Make sure we have an UI so getPathForRow() does not return null.
- if (rows == null || getUI() == null)
- return;
-
- TreePath[] paths = new TreePath[rows.length];
-
- for (int i = rows.length - 1; i >= 0; --i)
- paths[i] = getPathForRow(rows[i]);
-
- addSelectionPaths(paths);
- }
-
- public void addSelectionInterval(int index0, int index1)
- {
- TreePath[] paths = getPathBetweenRows(index0, index1);
-
- if (paths != null)
- addSelectionPaths(paths);
- }
-
- public void removeSelectionPath(TreePath path)
- {
- selectionModel.removeSelectionPath(path);
- }
-
- public void removeSelectionPaths(TreePath[] paths)
- {
- selectionModel.removeSelectionPaths(paths);
- }
-
- public void removeSelectionRow(int row)
- {
- TreePath path = getPathForRow(row);
-
- if (path != null)
- selectionModel.removeSelectionPath(path);
- }
-
- public void removeSelectionRows(int[] rows)
- {
- // Make sure we have an UI so getPathForRow() does not return null.
- if (rows == null || getUI() == null)
- return;
-
- TreePath[] paths = new TreePath[rows.length];
-
- for (int i = rows.length - 1; i >= 0; --i)
- paths[i] = getPathForRow(rows[i]);
-
- removeSelectionPaths(paths);
- }
-
- public void removeSelectionInterval(int index0, int index1)
- {
- TreePath[] paths = getPathBetweenRows(index0, index1);
-
- if (paths != null)
- removeSelectionPaths(paths);
- }
-
- public void clearSelection()
- {
- selectionModel.clearSelection();
- }
-
- public TreePath getLeadSelectionPath()
- {
- return leadSelectionPath;
- }
-
- /**
- * @since 1.3
- */
- public void setLeadSelectionPath(TreePath path)
- {
- if (leadSelectionPath == path)
- return;
-
- TreePath oldValue = leadSelectionPath;
- leadSelectionPath = path;
- firePropertyChange(LEAD_SELECTION_PATH_PROPERTY, oldValue, path);
- }
-
- /**
- * @since 1.3
- */
- public TreePath getAnchorSelectionPath()
- {
- return anchorSelectionPath;
- }
-
- /**
- * @since 1.3
- */
- public void setAnchorSelectionPath(TreePath path)
- {
- if (anchorSelectionPath == path)
- return;
-
- TreePath oldValue = anchorSelectionPath;
- anchorSelectionPath = path;
- firePropertyChange(ANCHOR_SELECTION_PATH_PROPERTY, oldValue, path);
- }
-
- public int getLeadSelectionRow()
- {
- return selectionModel.getLeadSelectionRow();
- }
-
- public int getMaxSelectionRow()
- {
- return selectionModel.getMaxSelectionRow();
- }
-
- public int getMinSelectionRow()
- {
- return selectionModel.getMinSelectionRow();
- }
-
- public int getSelectionCount()
- {
- return selectionModel.getSelectionCount();
- }
-
- public TreePath getSelectionPath()
- {
- return selectionModel.getSelectionPath();
- }
-
- public TreePath[] getSelectionPaths()
- {
- return selectionModel.getSelectionPaths();
- }
-
- public int[] getSelectionRows()
- {
- return selectionModel.getSelectionRows();
- }
-
- public boolean isPathSelected(TreePath path)
- {
- return selectionModel.isPathSelected(path);
- }
-
- public boolean isRowSelected(int row)
- {
- return selectionModel.isRowSelected(row);
- }
-
- public boolean isSelectionEmpty()
- {
- return selectionModel.isSelectionEmpty();
- }
-
- /**
- * Return the value of the <code>dragEnabled</code> property.
- *
- * @return the value
- *
- * @since 1.4
- */
- public boolean getDragEnabled()
- {
- return dragEnabled;
- }
-
- /**
- * Set the <code>dragEnabled</code> property.
- *
- * @param enabled new value
- *
- * @since 1.4
- */
- public void setDragEnabled(boolean enabled)
- {
- dragEnabled = enabled;
- }
-
- public int getRowCount()
- {
- TreeUI ui = getUI();
-
- if (ui != null)
- return ui.getRowCount(this);
-
- return 0;
- }
-
- public void collapsePath(TreePath path)
- {
- setExpandedState(path, false);
- }
-
- public void collapseRow(int row)
- {
- if (row < 0 || row >= getRowCount())
- return;
-
- TreePath path = getPathForRow(row);
-
- if (path != null)
- collapsePath(path);
- }
-
- public void expandPath(TreePath path)
- {
- // Don't expand if last path component is a leaf node.
- if ((path == null)
- || (treeModel.isLeaf(path.getLastPathComponent())))
- return;
-
- setExpandedState(path, true);
- }
-
- public void expandRow(int row)
- {
- if (row < 0 || row >= getRowCount())
- return;
-
- TreePath path = getPathForRow(row);
-
- if (path != null)
- expandPath(path);
- }
-
- public boolean isCollapsed(TreePath path)
- {
- return ! isExpanded(path);
- }
-
- public boolean isCollapsed(int row)
- {
- if (row < 0 || row >= getRowCount())
- return false;
-
- TreePath path = getPathForRow(row);
-
- if (path != null)
- return isCollapsed(path);
-
- return false;
- }
-
- public boolean isExpanded(TreePath path)
- {
- if (path == null)
- return false;
-
- Object state = nodeStates.get(path);
-
- if ((state == null) || (state != EXPANDED))
- return false;
-
- TreePath parent = path.getParentPath();
-
- if (parent != null)
- return isExpanded(parent);
-
- return true;
- }
-
- public boolean isExpanded(int row)
- {
- if (row < 0 || row >= getRowCount())
- return false;
-
- TreePath path = getPathForRow(row);
-
- if (path != null)
- return isExpanded(path);
-
- return false;
- }
-
- /**
- * @since 1.3
- */
- public boolean getExpandsSelectedPaths()
- {
- return expandsSelectedPaths;
- }
-
- /**
- * @since 1.3
- */
- public void setExpandsSelectedPaths(boolean flag)
- {
- if (expandsSelectedPaths == flag)
- return;
-
- boolean oldValue = expandsSelectedPaths;
- expandsSelectedPaths = flag;
- firePropertyChange(EXPANDS_SELECTED_PATHS_PROPERTY, oldValue, flag);
- }
-
- public Rectangle getPathBounds(TreePath path)
- {
- TreeUI ui = getUI();
-
- if (ui == null)
- return null;
-
- return ui.getPathBounds(this, path);
- }
-
- public Rectangle getRowBounds(int row)
- {
- TreePath path = getPathForRow(row);
-
- if (path != null)
- return getPathBounds(path);
-
- return null;
- }
-
- public boolean isEditing()
- {
- TreeUI ui = getUI();
-
- if (ui != null)
- return ui.isEditing(this);
-
- return false;
- }
-
- public boolean stopEditing()
- {
- TreeUI ui = getUI();
-
- if (ui != null)
- return ui.stopEditing(this);
-
- return false;
- }
-
- public void cancelEditing()
- {
- TreeUI ui = getUI();
-
- if (ui != null)
- ui.cancelEditing(this);
- }
-
- public void startEditingAtPath(TreePath path)
- {
- TreeUI ui = getUI();
-
- if (ui != null)
- ui.startEditingAtPath(this, path);
- }
-
- public TreePath getEditingPath()
- {
- TreeUI ui = getUI();
-
- if (ui != null)
- return ui.getEditingPath(this);
-
- return null;
- }
-
- public TreePath getPathForLocation(int x, int y)
- {
- TreePath path = getClosestPathForLocation(x, y);
-
- if (path != null)
- {
- Rectangle rect = getPathBounds(path);
-
- if ((rect != null) && rect.contains(x, y))
- return path;
- }
-
- return null;
- }
-
- public int getRowForLocation(int x, int y)
- {
- TreePath path = getPathForLocation(x, y);
-
- if (path != null)
- return getRowForPath(path);
-
- return -1;
- }
-
- public TreePath getClosestPathForLocation(int x, int y)
- {
- TreeUI ui = getUI();
-
- if (ui != null)
- return ui.getClosestPathForLocation(this, x, y);
-
- return null;
- }
-
- public int getClosestRowForLocation(int x, int y)
- {
- TreePath path = getClosestPathForLocation(x, y);
-
- if (path != null)
- return getRowForPath(path);
-
- return -1;
- }
-
- public Object getLastSelectedPathComponent()
- {
- TreePath path = getSelectionPath();
-
- if (path != null)
- return path.getLastPathComponent();
-
- return null;
- }
-
- private void checkExpandParents(TreePath path)
- throws ExpandVetoException
- {
- TreePath parent = path.getParentPath();
-
- if (parent != null)
- checkExpandParents(parent);
-
- fireTreeWillExpand(path);
- }
-
- private void doExpandParents(TreePath path, boolean state)
- {
- TreePath parent = path.getParentPath();
-
- if (isExpanded(parent))
- return;
-
- if (parent != null)
- doExpandParents(parent, false);
-
- nodeStates.put(path, state ? EXPANDED : COLLAPSED);
- }
-
- protected void setExpandedState(TreePath path, boolean state)
- {
- if (path == null)
- return;
-
- TreePath parent = path.getParentPath();
-
- try
- {
- while (parent != null)
- checkExpandParents(parent);
- }
- catch (ExpandVetoException e)
- {
- // Expansion vetoed.
- return;
- }
-
- doExpandParents(path, state);
- }
-
- protected void clearToggledPaths()
- {
- nodeStates.clear();
- }
-
- protected Enumeration getDescendantToggledPaths(TreePath parent)
- {
- if (parent == null)
- return null;
-
- Enumeration nodes = nodeStates.keys();
- Vector result = new Vector();
-
- while (nodes.hasMoreElements())
- {
- TreePath path = (TreePath) nodes.nextElement();
-
- if (path.isDescendant(parent))
- result.addElement(path);
- }
-
- return result.elements();
- }
-
- public boolean hasBeenExpanded(TreePath path)
- {
- if (path == null)
- return false;
-
- return nodeStates.get(path) != null;
- }
-
- public boolean isVisible(TreePath path)
- {
- if (path == null)
- return false;
-
- TreePath parent = path.getParentPath();
-
- if (parent == null)
- return true; // Is root node.
-
- return isExpanded(parent);
- }
-
- public void makeVisible(TreePath path)
- {
- if (path == null)
- return;
-
- expandPath(path.getParentPath());
- }
-
- public boolean isPathEditable(TreePath path)
- {
- return isEditable();
- }
-}
diff --git a/libjava/javax/swing/JViewport.java b/libjava/javax/swing/JViewport.java
deleted file mode 100644
index 63d06cd86af..00000000000
--- a/libjava/javax/swing/JViewport.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/* JViewport.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Rectangle;
-
-import javax.swing.border.Border;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ViewportUI;
-
-/**
- *
- * <pre>
- * _
- * +-------------------------------+ ...........Y1 \
- * | view | . \
- * | (this component's child) | . > VY
- * | | . / = Y2-Y1
- * | +------------------------------+ ....Y2_/
- * | | viewport | | .
- * | | (this component) | | .
- * | | | | .
- * | | | | .
- * | | | | .
- * | | | | .
- * | +------------------------------+ ....Y3
- * | | .
- * | . | . .
- * | . | . .
- * +---------.---------------------+ ...........Y4
- * . . . .
- * . . . .
- * . . . .
- * X1.......X2.....................X3.......X4
- * \____ ___/
- * \/
- * VX = X2-X1
- *</pre>
- *
- * <p>A viewport is, like all swing components, located at some position in
- * the swing component tree; that location is exactly the same as any other
- * components: the viewport's "bounds".</p>
- *
- * <p>But in terms of drawing its child, the viewport thinks of itself as
- * covering a particular position <em>of the view's coordinate space</em>.
- * For example, the {@link javax.JViewPort.getViewPosition} method returns
- * the position <code>(VX,VY)</code> shown above, which is an position in
- * "view space", even though this is <em>implemented</em> by positioning
- * the underlying child at position <code>(-VX,-VY)</code></p>
- *
- */
-public class JViewport extends JComponent
-{
- private static final long serialVersionUID = -6925142919680527970L;
-
- public static final int SIMPLE_SCROLL_MODE = 0;
- public static final int BLIT_SCROLL_MODE = 1;
- public static final int BACKINGSTORE_SCROLL_MODE = 2;
-
- ChangeEvent changeEvent = new ChangeEvent(this);
-
- int scrollMode;
-
- protected boolean scrollUnderway;
- protected boolean isViewSizeSet;
-
- /**
- * The width and height of the Viewport's area in terms of view
- * coordinates. Typically this will be the same as the width and height
- * of the viewport's bounds, unless the viewport transforms units of
- * width and height, which it may do, for example if it magnifies or
- * rotates its view.
- *
- * @see #toViewCoordinates
- */
- Dimension extentSize;
-
- /**
- * The width and height of the view in its own coordinate space.
- */
-
- Dimension viewSize;
-
- Point lastPaintPosition;
-
- public JViewport()
- {
- setOpaque(true);
- setScrollMode(BLIT_SCROLL_MODE);
- updateUI();
- }
-
- public Dimension getExtentSize()
- {
- if (extentSize == null)
- return toViewCoordinates(getSize());
- else
- return extentSize;
- }
-
- public Dimension toViewCoordinates(Dimension size)
- {
- return size;
- }
-
- public Point toViewCoordinates(Point p)
- {
- Point pos = getViewPosition();
- return new Point(p.x + pos.x,
- p.y + pos.y);
- }
-
- public void setExtentSize(Dimension newSize)
- {
- extentSize = newSize;
- fireStateChanged();
- }
-
- /**
- * Returns the viewSize when set, or the preferred size of the set
- * Component view. If no viewSize and no Component view is set an
- * empty Dimension is returned.
- */
- public Dimension getViewSize()
- {
- if (isViewSizeSet)
- return viewSize;
- else
- {
- Component view = getView();
- if (view != null)
- return view.getPreferredSize();
- else
- return new Dimension();
- }
- }
-
-
- public void setViewSize(Dimension newSize)
- {
- viewSize = newSize;
- Component view = getView();
- if (view != null)
- view.setSize(viewSize);
- isViewSizeSet = true;
- fireStateChanged();
- }
-
- /**
- * Get the viewport's position in view space. Despite confusing name,
- * this really does return the viewport's (0,0) position in view space,
- * not the view's position.
- */
-
- public Point getViewPosition()
- {
- Component view = getView();
- if (view == null)
- return new Point(0,0);
- else
- {
- Point p = view.getLocation();
- p.x = -p.x;
- p.y = -p.y;
- return p;
- }
- }
-
- public void setViewPosition(Point p)
- {
- Component view = getView();
- if (view != null)
- {
- Point q = new Point(-p.x, -p.y);
- view.setLocation(q);
- fireStateChanged();
- }
- }
-
- public Rectangle getViewRect()
- {
- return new Rectangle(getViewPosition(),
- getExtentSize());
- }
-
- /**
- * @deprecated 1.4
- */
- public boolean isBackingStoreEnabled()
- {
- return scrollMode == BACKINGSTORE_SCROLL_MODE;
- }
-
- /**
- * @deprecated 1.4
- */
- public void setBackingStoreEnabled(boolean b)
- {
- if (b && scrollMode != BACKINGSTORE_SCROLL_MODE)
- {
- scrollMode = BACKINGSTORE_SCROLL_MODE;
- fireStateChanged();
- }
- }
-
- public void setScrollMode(int mode)
- {
- scrollMode = mode;
- fireStateChanged();
- }
-
- public int getScrollMode()
- {
- return scrollMode;
- }
-
- public Component getView()
- {
- if (getComponentCount() == 0)
- return null;
-
- return getComponents()[0];
- }
-
- public void setView(Component v)
- {
- while (getComponentCount() > 0)
- remove(0);
- if (v != null)
- {
- add(v);
- fireStateChanged();
- }
- }
-
- public void revalidate()
- {
- fireStateChanged();
- super.revalidate();
- }
-
- public void reshape(int x, int y, int w, int h)
- {
- boolean changed =
- (x != getX())
- || (y != getY())
- || (w != getWidth())
- || (h != getHeight());
- super.reshape(x, y, w, h);
- if (changed)
- fireStateChanged();
- }
-
- protected void addImpl(Component comp, Object constraints, int index)
- {
- if (getComponentCount() > 0)
- remove(getComponents()[0]);
-
- super.addImpl(comp, constraints, index);
- }
-
- public final Insets getInsets()
- {
- return new Insets(0,0,0,0);
- }
-
- public final Insets getInsets(Insets insets)
- {
- if (insets == null)
- return getInsets();
- insets.top = 0;
- insets.bottom = 0;
- insets.left = 0;
- insets.right = 0;
- return insets;
- }
-
- public boolean isOptimizedDrawingEnabled()
- {
- return false;
- }
-
- public void paint(Graphics g)
- {
- paintComponent(g);
- }
-
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) getListeners(ChangeListener.class);
- }
-
- protected void fireStateChanged()
- {
- ChangeListener[] listeners = getChangeListeners();
- for (int i = 0; i < listeners.length; ++i)
- listeners[i].stateChanged(changeEvent);
- }
-
- /**
- * This method returns the String ID of the UI class of Separator.
- *
- * @return The UI class' String ID.
- */
- public String getUIClassID()
- {
- return "ViewportUI";
- }
-
- /**
- * This method resets the UI used to the Look and Feel defaults..
- */
- public void updateUI()
- {
- setUI((ViewportUI) UIManager.getUI(this));
- }
-
- /**
- * This method returns the viewport's UI delegate.
- *
- * @return The viewport's UI delegate.
- */
- public ViewportUI getUI()
- {
- return (ViewportUI) ui;
- }
-
- /**
- * This method sets the viewport's UI delegate.
- *
- * @param ui The viewport's UI delegate.
- */
- public void setUI(ViewportUI ui)
- {
- super.setUI(ui);
- }
-
- public final void setBorder(Border border)
- {
- if (border != null)
- throw new IllegalArgumentException();
- }
-}
diff --git a/libjava/javax/swing/JWindow.java b/libjava/javax/swing/JWindow.java
deleted file mode 100644
index a336b396c20..00000000000
--- a/libjava/javax/swing/JWindow.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/* JWindow.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Frame;
-import java.awt.Graphics;
-import java.awt.GraphicsConfiguration;
-import java.awt.LayoutManager;
-import java.awt.Window;
-import java.awt.event.KeyEvent;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-
-/**
- * Unlike JComponent derivatives, JWindow inherits from
- * java.awt.Window. But also lets a look-and-feel component to its work.
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public class JWindow extends Window implements Accessible, RootPaneContainer
-{
- private static final long serialVersionUID = 5420698392125238833L;
-
- protected JRootPane rootPane;
- protected boolean rootPaneCheckingEnabled;
- protected AccessibleContext accessibleContext;
-
- public JWindow()
- {
- super(SwingUtilities.getOwnerFrame());
- windowInit();
- }
-
- public JWindow(GraphicsConfiguration gc)
- {
- super(SwingUtilities.getOwnerFrame(), gc);
- windowInit();
- }
-
- public JWindow(Frame owner)
- {
- super(owner);
- windowInit();
- }
-
- public JWindow(Window owner)
- {
- super(owner);
- windowInit();
- }
-
- public JWindow(Window owner, GraphicsConfiguration gc)
- {
- super(owner, gc);
- windowInit();
- }
-
- protected void windowInit()
- {
- super.setLayout(new BorderLayout(1, 1));
- getRootPane(); // will do set/create
- }
-
- public Dimension getPreferredSize()
- {
- return super.getPreferredSize();
- }
-
- public void setLayout(LayoutManager manager)
- {
- super.setLayout(manager);
- }
-
- public void setLayeredPane(JLayeredPane layeredPane)
- {
- getRootPane().setLayeredPane(layeredPane);
- }
-
- public JLayeredPane getLayeredPane()
- {
- return getRootPane().getLayeredPane();
- }
-
- public JRootPane getRootPane()
- {
- if (rootPane == null)
- setRootPane(createRootPane());
- return rootPane;
- }
-
- protected void setRootPane(JRootPane root)
- {
- if (rootPane != null)
- remove(rootPane);
-
- rootPane = root;
- add(rootPane, BorderLayout.CENTER);
- }
-
- protected JRootPane createRootPane()
- {
- return new JRootPane();
- }
-
- public Container getContentPane()
- {
- return getRootPane().getContentPane();
- }
-
- public void setContentPane(Container contentPane)
- {
- getRootPane().setContentPane(contentPane);
- }
-
- public Component getGlassPane()
- {
- return getRootPane().getGlassPane();
- }
-
- public void setGlassPane(Component glassPane)
- {
- getRootPane().setGlassPane(glassPane);
- }
-
- protected void addImpl(Component comp, Object constraints, int index)
- {
- super.addImpl(comp, constraints, index);
- }
-
- public void remove(Component comp)
- {
- getContentPane().remove(comp);
- }
-
- protected boolean isRootPaneCheckingEnabled()
- {
- return rootPaneCheckingEnabled;
- }
-
- protected void setRootPaneCheckingEnabled(boolean enabled)
- {
- rootPaneCheckingEnabled = enabled;
- }
-
- public void update(Graphics g)
- {
- paint(g);
- }
-
- protected void processKeyEvent(KeyEvent e)
- {
- super.processKeyEvent(e);
- }
-
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
- protected String paramString()
- {
- return "JWindow";
- }
-}
diff --git a/libjava/javax/swing/KeyStroke.java b/libjava/javax/swing/KeyStroke.java
deleted file mode 100644
index 12a280c217a..00000000000
--- a/libjava/javax/swing/KeyStroke.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/* KeyStroke.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.AWTKeyStroke;
-import java.awt.event.KeyEvent;
-import java.io.Serializable;
-
-public class KeyStroke
- extends AWTKeyStroke
- implements Serializable
-{
- private static final long serialVersionUID = -9060180771037902530L;
-
- // Called by java.awt.AWTKeyStroke.registerSubclass via reflection.
- private KeyStroke()
- {
- }
-
- private KeyStroke(char keyChar, int keyCode, int modifiers,
- boolean onKeyRelease)
- {
- super(keyChar, keyCode, modifiers, onKeyRelease);
- }
-
- static
- {
- AWTKeyStroke.registerSubclass(KeyStroke.class);
- }
-
- public static KeyStroke getKeyStroke(char keyChar)
- {
- return (KeyStroke) getAWTKeyStroke(keyChar);
- }
-
- /**
- * @deprecated Use {@link #getKeyStroke(char)}
- *
- * This method, unlike all the other factory methods on this object,
- * returns a non-cached, non-shared object. New code should not use it.
- */
- public static KeyStroke getKeyStroke(char keyChar, boolean onKeyRelease)
- {
- return new KeyStroke(keyChar, KeyEvent.VK_UNDEFINED, 0, onKeyRelease);
- }
-
- public static KeyStroke getKeyStroke(Character keyChar, int modifiers)
- {
- return (KeyStroke) getAWTKeyStroke(keyChar, modifiers);
- }
-
- public static KeyStroke getKeyStroke(int keyCode, int modifiers,
- boolean onKeyRelease)
- {
- return (KeyStroke) getAWTKeyStroke(keyCode, modifiers, onKeyRelease);
- }
-
- public static KeyStroke getKeyStroke(int keyCode, int modifiers)
- {
- return (KeyStroke) getAWTKeyStroke(keyCode, modifiers);
- }
-
- /**
- * Returns the KeyStroke according to <code>getAWTKeyStroke()</code>.
- * But it returns null instead of throwing
- * <code>IllegalArugmentException</code> when
- * the keystoke sequence cannot be parsed from the given string.
- */
- public static KeyStroke getKeyStroke(String str)
- {
- try
- {
- return (KeyStroke) getAWTKeyStroke(str);
- }
- catch (IllegalArgumentException iae)
- {
- return null;
- }
- }
-
- public static KeyStroke getKeyStrokeForEvent(KeyEvent event)
- {
- return (KeyStroke) getAWTKeyStrokeForEvent(event);
- }
-
-}
diff --git a/libjava/javax/swing/LayoutFocusTraversalPolicy.java b/libjava/javax/swing/LayoutFocusTraversalPolicy.java
deleted file mode 100644
index 752d84b188c..00000000000
--- a/libjava/javax/swing/LayoutFocusTraversalPolicy.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* LayoutFocusTraversalPolicy.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.io.Serializable;
-import java.util.Comparator;
-
-/**
- * @author Graydon Hoare
- * @author Michael Koch
- *
- * @since 1.4
- */
-public class LayoutFocusTraversalPolicy
- extends SortingFocusTraversalPolicy
- implements Serializable
-{
- private static class LayoutComparator
- implements Comparator
- {
- public LayoutComparator()
- {
- // Do nothing here.
- }
-
- public int compare(Object o1, Object o2)
- {
- Component comp1 = (Component) o1;
- Component comp2 = (Component) o2;
-
- int x1 = comp1.getX();
- int y1 = comp1.getY();
- int x2 = comp2.getX();
- int y2 = comp2.getY();
-
- if (x1 == x2 && y1 == y2)
- return 0;
-
- if ((y1 < y2) || ((y1 == y2) && (x1 < x2)))
- return -1;
-
- return 1;
- }
- }
-
- public LayoutFocusTraversalPolicy()
- {
- super(new LayoutComparator());
- }
-}
diff --git a/libjava/javax/swing/ListCellRenderer.java b/libjava/javax/swing/ListCellRenderer.java
deleted file mode 100644
index 153c36801fa..00000000000
--- a/libjava/javax/swing/ListCellRenderer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* ListCellRenderer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-
-public interface ListCellRenderer
-{
- Component getListCellRendererComponent(JList list,
- Object value,
- int index,
- boolean isSelected,
- boolean cellHasFocus);
-}
diff --git a/libjava/javax/swing/ListModel.java b/libjava/javax/swing/ListModel.java
deleted file mode 100644
index bbaf5e30d62..00000000000
--- a/libjava/javax/swing/ListModel.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* ListModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.swing.event.ListDataListener;
-
-/**
- * This is an interface to general list-like data, typically used as the
- * model object of a {@link JList} component.
- *
- * @author Graydon Hoare (graydon@redhat.com)
- */
-public interface ListModel
-{
- /**
- * Return the number of data elements in the list.
- *
- * @return The number of data elements in the list
- */
- int getSize();
-
- /**
- * Retrieves a data element at a specified index.
- *
- * @param index The index of the element to retrieve
- *
- * @return The data element at the specified index
- */
- Object getElementAt(int index);
-
- /**
- * Add a listener object to this model. The listener will be called
- * any time the set of elements in the model is changed.
- *
- * @param l The listener to add
- */
- void addListDataListener(ListDataListener l);
-
- /**
- * Add a listener object to this model. The listener will no longer be
- * called when the set of elements in the model is changed.
- *
- * @param l The listener to remove
- */
- void removeListDataListener(ListDataListener l);
-}
diff --git a/libjava/javax/swing/ListSelectionModel.java b/libjava/javax/swing/ListSelectionModel.java
deleted file mode 100644
index 498a50e8e4a..00000000000
--- a/libjava/javax/swing/ListSelectionModel.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* ListSelectionModel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.swing.event.ListSelectionListener;
-
-public interface ListSelectionModel
-{
- int SINGLE_SELECTION = 0;
- int SINGLE_INTERVAL_SELECTION = 1;
- int MULTIPLE_INTERVAL_SELECTION = 2;
-
- void setSelectionMode(int a);
- int getSelectionMode();
-
- void clearSelection();
-
- int getMinSelectionIndex();
- int getMaxSelectionIndex();
-
- boolean isSelectedIndex(int a);
-
- boolean isSelectionEmpty();
- void setSelectionInterval(int index0, int index1);
- void addSelectionInterval(int index0,
- int index1);
- void removeSelectionInterval(int index0,
- int index1);
- void insertIndexInterval(int index,
- int length,
- boolean before);
- void removeIndexInterval(int index0,
- int index1);
-
- int getAnchorSelectionIndex();
- void setAnchorSelectionIndex(int index);
- int getLeadSelectionIndex();
- void setLeadSelectionIndex(int index);
-
- void setValueIsAdjusting(boolean valueIsAdjusting);
- boolean getValueIsAdjusting();
-
- void addListSelectionListener(ListSelectionListener listener);
- void removeListSelectionListener(ListSelectionListener listener);
-
-}
diff --git a/libjava/javax/swing/LookAndFeel.java b/libjava/javax/swing/LookAndFeel.java
deleted file mode 100644
index 3918636cfb3..00000000000
--- a/libjava/javax/swing/LookAndFeel.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/* LookAndFeel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Toolkit;
-
-import javax.swing.text.JTextComponent;
-
-public abstract class LookAndFeel
-{
- /**
- * This method is called once by UIManager.setLookAndFeel to create
- * the look and feel specific defaults table.
- *
- * @return the UI defaults
- */
- public UIDefaults getDefaults()
- {
- return null;
- }
-
- public abstract String getDescription();
-
- public static Object getDesktopPropertyValue(String systemPropertyName, Object fallbackValue)
- {
- Object value = Toolkit.getDefaultToolkit().getDesktopProperty(systemPropertyName);
- return value != null ? value : fallbackValue;
- }
-
- public abstract String getID();
-
- public abstract String getName();
-
- /**
- * Returns true when the Look and Feel supports window decorations,
- * false others. This method returns always false and needs to be overwritten
- * when the derived Look and Feel supports this.
- *
- * @return false
- *
- * @since 1.4
- */
- public boolean getSupportsWindowDecorations()
- {
- return false;
- }
-
- /**
- * UIManager.setLookAndFeel calls this method before the first call
- * (and typically the only call) to getDefaults().
- */
- public void initialize()
- {
- }
-
- /**
- * Convenience method for installing a component's default Border object
- * on the specified component if either the border is currently null
- * or already an instance of UIResource.
- */
- public static void installBorder(JComponent c, String defaultBorderName)
- {
- }
-
- /**
- * Convenience method for initializing a component's foreground and
- * background color properties with values from the current defaults table.
- */
- public static void installColors(JComponent c, String defaultBgName, String defaultFgName)
- {
- }
-
- /**
- * Convenience method for initializing a components foreground background
- * and font properties with values from the current defaults table.
- */
- public static void installColorsAndFont(JComponent component,
- String defaultBgName,
- String defaultFgName,
- String defaultFontName)
- {
- }
-
- public abstract boolean isNativeLookAndFeel();
-
- public abstract boolean isSupportedLookAndFeel();
-
- /**
- * Loads the bindings in keys into retMap.
- */
- public static void loadKeyBindings(InputMap retMap, Object[] keys)
- {
- }
-
- /**
- * Creates a ComponentInputMap from keys.
- */
- public static ComponentInputMap makeComponentInputMap(JComponent c,
- Object[] keys)
- {
- return null;
- }
-
- /**
- * Utility method that creates a UIDefaults.LazyValue that creates an
- * ImageIcon UIResource for the specified gifFile filename.
- */
- public static Object makeIcon(Class baseClass, String gifFile)
- {
- return null;
- }
-
- /**
- * Creates a InputMap from keys.
- */
- public static InputMap makeInputMap(Object[] keys)
- {
- return null;
- }
-
- /**
- * Convenience method for building lists of KeyBindings.
- */
- public static JTextComponent.KeyBinding[] makeKeyBindings(Object[] keyBindingList)
- {
- return null;
- }
-
- /**
- * Invoked when the user attempts an invalid operation. The default implement
- * just beeps. Subclasses that wish to change this need to override this
- * method.
- *
- * @param component the component the error occured in
- */
- public void provideErrorFeedback(Component component)
- {
- Toolkit.getDefaultToolkit().beep();
- }
-
- /**
- * Returns a string that displays and identifies this object's properties.
- *
- * @return the string "LookAndFeel"
- */
- public String toString()
- {
- return "LookAndFeel";
- }
-
- /**
- * UIManager.setLookAndFeel calls this method just before we're replaced by
- * a new default look and feel.
- */
- public void uninitialize()
- {
- }
-
- /**
- * Convenience method for un-installing a component's default border on the
- * specified component if the border is currently an instance of UIResource.
- */
- public static void uninstallBorder(JComponent c)
- {
- }
-}
diff --git a/libjava/javax/swing/MenuElement.java b/libjava/javax/swing/MenuElement.java
deleted file mode 100644
index 1ce67a4a49c..00000000000
--- a/libjava/javax/swing/MenuElement.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* MenuElement.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-
-/**
- * MenuElement
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface MenuElement {
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * processMouseEvent
- * @param event TODO
- * @param path TODO
- * @param manager TODO
- */
- void processMouseEvent(MouseEvent event,
- MenuElement[] path, MenuSelectionManager manager);
-
- /**
- * processKeyEvent
- * @param event TODO
- * @param path TODO
- * @param manager TODO
- */
- void processKeyEvent(KeyEvent event,
- MenuElement[] path, MenuSelectionManager manager);
-
- /**
- * menuSelectionChanged
- * @param included TODO
- */
- void menuSelectionChanged(boolean included);
-
- /**
- * getSubElements
- * @returns MenuElement[]
- */
- MenuElement[] getSubElements();
-
- /**
- * getComponent
- * @returns Component
- */
- Component getComponent();
-
-
-} // MenuElement
diff --git a/libjava/javax/swing/MenuSelectionManager.java b/libjava/javax/swing/MenuSelectionManager.java
deleted file mode 100644
index fb57794a685..00000000000
--- a/libjava/javax/swing/MenuSelectionManager.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/* MenuSelectionManager.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Dimension;
-import java.awt.Point;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.util.ArrayList;
-import java.util.Vector;
-
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-/**
- * This class manages current menu selectection. It provides
- * methods to clear and set current selected menu path.
- * It also fires StateChange event to its registered
- * listeners whenever selected path of the current menu hierarchy
- * changes.
- *
- */
-public class MenuSelectionManager
-{
- /** ChangeEvent fired when selected path changes*/
- protected ChangeEvent changeEvent = new ChangeEvent(this);
-
- /** List of listeners for this MenuSelectionManager */
- protected EventListenerList listenerList = new EventListenerList();
-
- /** Default manager for the current menu hierarchy*/
- private static final MenuSelectionManager manager = new MenuSelectionManager();
-
- /** Path to the currently selected menu */
- private Vector selectedPath = new Vector();
-
- /**
- * Fires StateChange event to registered listeners
- */
- protected void fireStateChanged()
- {
- ChangeListener[] listeners = getChangeListeners();
-
- for (int i = 0; i < listeners.length; i++)
- listeners[i].stateChanged(changeEvent);
- }
-
- /**
- * Adds ChangeListener to this MenuSelectionManager
- *
- * @param listener ChangeListener to add
- */
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- /**
- * Removes ChangeListener from the list of registered listeners
- * for this MenuSelectionManager.
- *
- * @param listener ChangeListner to remove
- */
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- /**
- * Returns list of registered listeners with MenuSelectionManager
- *
- * @since 1.4
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
- }
-
- /**
- * Unselects all the menu elements on the selection path
- */
- public void clearSelectedPath()
- {
- // Send events from the bottom most item in the menu - hierarchy to the
- // top most
- for (int i = selectedPath.size() - 1; i >= 0; i--)
- ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false);
-
- // clear selected path
- selectedPath.clear();
-
- // notify all listeners that the selected path was changed
- fireStateChanged();
- }
-
- /**
- * This method returns menu element on the selected path that contains
- * given source point. If no menu element on the selected path contains this
- * point, then null is returned.
- *
- * @param source Component relative to which sourcePoint is given
- * @param sourcePoint point for which we want to find menu element that contains it
- *
- * @return Returns menu element that contains given source point and belongs
- * to the currently selected path. Null is return if no such menu element found.
- */
- public Component componentForPoint(Component source, Point sourcePoint)
- {
- // Convert sourcePoint to screen coordinates.
- Point sourcePointOnScreen = sourcePoint;
- SwingUtilities.convertPointToScreen(sourcePointOnScreen, source);
-
- Point compPointOnScreen;
- Component resultComp = null;
-
- // For each menu element on the selected path, express its location
- // in terms of screen coordinates and check if there is any
- // menu element on the selected path that contains given source point.
- for (int i = 0; i < selectedPath.size(); i++)
- {
- Component comp = ((Component) selectedPath.get(i));
- Dimension size = comp.getSize();
-
- // convert location of this menu item to screen coordinates
- compPointOnScreen = comp.getLocationOnScreen();
-
- if (compPointOnScreen.x <= sourcePointOnScreen.x
- && sourcePointOnScreen.x < compPointOnScreen.x + size.width
- && compPointOnScreen.y <= sourcePointOnScreen.y
- && sourcePointOnScreen.y < compPointOnScreen.y + size.height)
- {
- Point p = sourcePointOnScreen;
- SwingUtilities.convertPointFromScreen(p, comp);
- resultComp = SwingUtilities.getDeepestComponentAt(comp, p.x, p.y);
- break;
- }
- }
- return resultComp;
- }
-
- /**
- * Returns shared instance of MenuSelection Manager
- *
- * @return default Manager
- */
- public static MenuSelectionManager defaultManager()
- {
- return manager;
- }
-
- /**
- * Returns path representing current menu selection
- *
- * @return Current selection path
- */
- public MenuElement[] getSelectedPath()
- {
- MenuElement[] path = new MenuElement[selectedPath.size()];
-
- for (int i = 0; i < path.length; i++)
- path[i] = (MenuElement) selectedPath.get(i);
-
- return path;
- }
-
- /**
- * Returns true if specified component is part of current menu
- * heirarchy and false otherwise
- *
- * @param c Component for which to check
- * @return True if specified component is part of current menu
- */
- public boolean isComponentPartOfCurrentMenu(Component c)
- {
- MenuElement[] subElements;
- for (int i = 0; i < selectedPath.size(); i++)
- {
- subElements = ((MenuElement) selectedPath.get(i)).getSubElements();
- for (int j = 0; j < subElements.length; j++)
- {
- if ((subElements[j].getComponent()).equals(c))
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param e DOCUMENT ME!
- */
- public void processKeyEvent(KeyEvent e)
- {
- throw new UnsupportedOperationException("not implemented");
- }
-
- /**
- * Forwards given mouse event to all of the source subcomponents.
- *
- * @param event Mouse event
- */
- public void processMouseEvent(MouseEvent event)
- {
- Component source = ((Component) event.getSource());
-
- // In the case of drag event, event.getSource() returns component
- // where drag event originated. However menu element processing this
- // event should be the one over which mouse is currently located,
- // which is not necessary the source of the drag event.
- Component mouseOverMenuComp;
-
- // find over which menu element the mouse is currently located
- if (event.getID() == MouseEvent.MOUSE_DRAGGED
- || event.getID() == MouseEvent.MOUSE_RELEASED)
- mouseOverMenuComp = componentForPoint(source, event.getPoint());
- else
- mouseOverMenuComp = source;
-
- // Process this event only if mouse is located over some menu element
- if (mouseOverMenuComp != null && (mouseOverMenuComp instanceof MenuElement))
- {
- MenuElement[] path = getPath(mouseOverMenuComp);
- ((MenuElement) mouseOverMenuComp).processMouseEvent(event, path,
- manager);
-
- // FIXME: Java specification says that mouse events should be
- // forwarded to subcomponents. The code below does it, but
- // menu's work fine without it. This code is commented for now.
-
- /*
- MenuElement[] subComponents = ((MenuElement) mouseOverMenuComp)
- .getSubElements();
-
- for (int i = 0; i < subComponents.length; i++)
- {
- subComponents[i].processMouseEvent(event, path, manager);
- }
- */
- }
- }
-
- /**
- * Sets menu selection to the specified path
- *
- * @param path new selection path
- */
- public void setSelectedPath(MenuElement[] path)
- {
- if (path == null)
- {
- clearSelectedPath();
- return;
- }
-
- int i;
- int minSize = path.length; // size of the smaller path.
-
- if (path.length > selectedPath.size())
- {
- minSize = selectedPath.size();
-
- // if new selected path contains more elements then current
- // selection then first add all elements at
- // the indexes > selectedPath.size
- for (i = selectedPath.size(); i < path.length; i++)
- {
- selectedPath.add(path[i]);
- path[i].menuSelectionChanged(true);
- }
- }
-
- else if (path.length < selectedPath.size())
- {
- // if new selected path contains less elements then current
- // selection then first remove all elements from the selection
- // at the indexes > path.length
- for (i = selectedPath.size() - 1; i >= path.length; i--)
- {
- ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false);
- selectedPath.remove(i);
- }
-
- minSize = path.length;
- }
-
- // Now compare elements in new and current selection path at the
- // same location and adjust selection until
- // same menu elements will be encountered at the
- // same index in both current and new selection path.
- MenuElement oldSelectedItem;
-
- for (i = minSize - 1; i >= 0; i--)
- {
- oldSelectedItem = (MenuElement) selectedPath.get(i);
-
- if (path[i].equals(oldSelectedItem))
- break;
-
- oldSelectedItem.menuSelectionChanged(false);
- path[i].menuSelectionChanged(true);
- selectedPath.setElementAt(path[i], i);
- }
-
- fireStateChanged();
- }
-
- /**
- * Returns path to the specified component
- *
- * @param c component for which to find path for
- *
- * @return path to the specified component
- */
- private MenuElement[] getPath(Component c)
- {
- // FIXME: There is the same method in BasicMenuItemUI. However I
- // cannot use it here instead of this method, since I cannot assume that
- // all the menu elements on the selected path are JMenuItem or JMenu.
- // For now I've just duplicated it here. Please
- // fix me or delete me if another better approach will be found, and
- // this method will not be necessary.
- ArrayList path = new ArrayList();
-
- // if given component is JMenu, we also need to include
- // it's popup menu in the path
- if (c instanceof JMenu)
- path.add(((JMenu) c).getPopupMenu());
- while (c instanceof MenuElement)
- {
- path.add(0, (MenuElement) c);
-
- if (c instanceof JPopupMenu)
- c = ((JPopupMenu) c).getInvoker();
- else
- c = c.getParent();
- }
-
- MenuElement[] pathArray = new MenuElement[path.size()];
- path.toArray(pathArray);
- return pathArray;
- }
-}
diff --git a/libjava/javax/swing/MutableComboBoxModel.java b/libjava/javax/swing/MutableComboBoxModel.java
deleted file mode 100644
index 385d1211c2c..00000000000
--- a/libjava/javax/swing/MutableComboBoxModel.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* MutableComboBoxModel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * MutableComboBoxModel is interface for data model that keeps track of the
- * components data and provides methods to insert and remove elements from
- * it. The Classes implementing this interface should fire appropriate
- * events indicating the undergoing change in the data model.
- *
- * @author Andrew Selkirk
- * @author Olga Rodimina
- * @version 1.0
- */
-public interface MutableComboBoxModel extends ComboBoxModel
-{
- /**
- * This method adds given object to its data model.
- *
- * @param object element to add to the data model.
- */
- void addElement(Object object);
-
- /**
- * This method removes elements located at the given index in the data
- * model.
- *
- * @param index index specifying location of the element to remove.
- */
- void removeElementAt(int index);
-
- /**
- * This method inserts givent element to the data model, at the specified
- * index.
- *
- * @param object element to insert
- * @param index index specifying the position in the data model where the
- * given element should be inserted.
- */
- void insertElementAt(Object object, int index);
-
- /**
- * This method removes given element from the data model
- *
- * @param element to remove.
- */
- void removeElement(Object object);
-} // MutableComboBoxModel
diff --git a/libjava/javax/swing/OverlayLayout.java b/libjava/javax/swing/OverlayLayout.java
deleted file mode 100644
index e8aef98a521..00000000000
--- a/libjava/javax/swing/OverlayLayout.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/* OverlayLayout.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.LayoutManager2;
-import java.io.Serializable;
-
-/**
- * OverlayLayout
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class OverlayLayout
- implements LayoutManager2, Serializable
-{
- private static final long serialVersionUID = 18082829169631543L;
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * target
- */
- private Container target;
-
- /**
- * xChildren
- */
- private SizeRequirements[] xChildren;
-
- /**
- * yChildren
- */
- private SizeRequirements[] yChildren;
-
- /**
- * xTotal
- */
- private SizeRequirements xTotal;
-
- /**
- * yTotal
- */
- private SizeRequirements yTotal;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor OverlayLayout
- * @param target TODO
- */
- public OverlayLayout(Container target) {
- // TODO
- } // OverlayLayout()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * invalidateLayout
- * @param target TODO
- */
- public void invalidateLayout(Container target) {
- // TODO
- } // invalidateLayout()
-
- /**
- * addLayoutComponent
- * @param string TODO
- * @param component TODO
- */
- public void addLayoutComponent(String string, Component component) {
- // TODO
- } // addLayoutComponent()
-
- /**
- * addLayoutComponent
- * @param component TODO
- * @param constraints TODO
- */
- public void addLayoutComponent(Component component, Object constraints) {
- // TODO
- } // addLayoutComponent()
-
- /**
- * removeLayoutComponent
- * @param component TODO
- */
- public void removeLayoutComponent(Component component) {
- // TODO
- } // removeLayoutComponent()
-
- /**
- * preferredLayoutSize
- * @param target TODO
- * @returns Dimension
- */
- public Dimension preferredLayoutSize(Container target) {
- return null; // TODO
- } // preferredLayoutSize()
-
- /**
- * minimumLayoutSize
- * @param target TODO
- * @returns Dimension
- */
- public Dimension minimumLayoutSize(Container target) {
- return null; // TODO
- } // minimumLayoutSize()
-
- /**
- * maximumLayoutSize
- * @param target TODO
- * @returns Dimension
- */
- public Dimension maximumLayoutSize(Container target) {
- return null; // TODO
- } // maximumLayoutSize()
-
- /**
- * getLayoutAlignmentX
- * @param target TODO
- * @returns float
- */
- public float getLayoutAlignmentX(Container target) {
- return (float) 0.0; // TODO
- } // getLayoutAlignmentX()
-
- /**
- * getLayoutAlignmentY
- * @param target TODO
- * @returns float
- */
- public float getLayoutAlignmentY(Container target) {
- return (float) 0.0; // TODO
- } // getLayoutAlignmentY()
-
- /**
- * layoutContainer
- * @param target TODO
- */
- public void layoutContainer(Container target) {
- // TODO
- } // layoutContainer()
-
-
-} // OverlayLayout
diff --git a/libjava/javax/swing/Popup.java b/libjava/javax/swing/Popup.java
deleted file mode 100644
index 69e1f516802..00000000000
--- a/libjava/javax/swing/Popup.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* Popup.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-
-
-/**
- * Manages a popup window that displays a Component on top of
- * everything else.
- *
- * <p>To obtain an instance of <code>Popup</code>, use the
- * {@link javax.swing.PopupFactory}.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class Popup
-{
- /**
- * Constructs a new <code>Popup</code> given its owner,
- * contents and the screen position where the popup
- * will appear.
- *
- * @param owner the Component to which <code>x</code> and
- * <code>y</code> are relative, or <code>null</code> for
- * placing the popup relative to the origin of the screen.
- *
- * @param contents the contents that will be displayed inside
- * the <code>Popup</code>.
- *
- * @param x the horizontal position where the Popup will appear.
- *
- * @param y the vertical position where the Popup will appear.
- *
- * @throws IllegalArgumentException if <code>contents</code>
- * is <code>null</code>.
- */
- protected Popup(Component owner, Component contents,
- int x, int y)
- {
- if (contents == null)
- throw new IllegalArgumentException();
-
- // The real stuff happens in the implementation of subclasses,
- // for instance JWindowPopup.
- }
-
-
- /**
- * Constructs a new <code>Popup</code>.
- */
- protected Popup()
- {
- }
-
-
- /**
- * Displays the <code>Popup</code> on the screen. Nothing happens
- * if it is currently shown.
- */
- public void show()
- {
- // Implemented by subclasses, for instance JWindowPopup.
- }
-
-
- /**
- * Removes the <code>Popup</code> from the screen. Nothing happens
- * if it is currently hidden.
- */
- public void hide()
- {
- // Implemented by subclasses, for instance JWindowPopup.
- }
-
-
- /**
- * A <code>Popup</code> that uses a <code>JWindow</code> for
- * displaying its contents.
- *
- * @see PopupFactory#getPopup
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- static class JWindowPopup
- extends Popup
- {
- /**
- * The <code>JWindow</code> used for displaying the contents
- * of the popup.
- */
- JWindow window;
-
-
- /**
- * Constructs a new <code>JWindowPopup</code> given its owner,
- * contents and the screen position where the popup
- * will appear.
- *
- * @param owner the Component to which <code>x</code> and
- * <code>y</code> are relative, or <code>null</code> for
- * placing the popup relative to the origin of the screen.
- *
- * @param contents the contents that will be displayed inside
- * the <code>Popup</code>.
- *
- * @param x the horizontal position where the Popup will appear.
- *
- * @param y the vertical position where the Popup will appear.
- *
- * @throws IllegalArgumentException if <code>contents</code>
- * is <code>null</code>.
- */
- public JWindowPopup(Component owner, Component contents,
- int x, int y)
- {
- /* Checks whether contents is null. */
- super(owner, contents, x, y);
-
- window = new JWindow();
- window.getRootPane().add(contents);
- window.setLocation(x, y);
- window.pack();
- }
-
-
- /**
- * Displays the popup's <code>JWindow</code> on the screen.
- * Nothing happens if it is already visible.
- */
- public void show()
- {
- window.show();
- }
-
-
- /**
- * Removes the popup's <code>JWindow</code> from the
- * screen. Nothing happens if it is currently not visible.
- */
- public void hide()
- {
- /* Calling dispose() instead of hide() will conserve native
- * system resources, for example memory in an X11 server.
- * They will automatically be re-allocated by a call to
- * show().
- */
- window.dispose();
- }
- }
-}
diff --git a/libjava/javax/swing/PopupFactory.java b/libjava/javax/swing/PopupFactory.java
deleted file mode 100644
index 29cf86d5530..00000000000
--- a/libjava/javax/swing/PopupFactory.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/* PopupFactory.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-
-
-/**
- * A factory for <code>Popup</code> objects. These are used to
- * managed little windows that float over everything else,
- * typically containing a popup menu.
- *
- * @since 1.4
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class PopupFactory
-{
- /**
- * The shared factory object.
- *
- * @see #getSharedFactory
- * @see #setSharedFactory
- */
- private static PopupFactory sharedFactory;
-
-
- /**
- * Constructs a new <code>PopupFactory</code>. Usually, a single
- * <code>PopupFactory</code> is shared among multiple consumers
- * of <code>Popup</code>. Use {@link #getSharedInstance} to retrieve
- * the current factory.
- */
- public PopupFactory()
- {
- }
-
-
- /**
- * Sets the shared factory.
- *
- * @param factory the PopupFactory that future invocations of
- * {@link #getSharedInstance} will return.
- *
- * @throws IllegalArgumentException if <code>factory</code>
- * is <code>null</code>.
- */
- public static void setSharedInstance(PopupFactory factory)
- {
- if (factory == null)
- throw new IllegalArgumentException();
-
- /* Swing is not designed to be thread-safe, so there is no
- * need to synchronize the access to the global variable.
- */
- sharedFactory = factory;
- }
-
-
- /**
- * Retrieves the shared factory, creating a new factory if
- * necessary.
- *
- * @return a <code>PopupFactory</code> that can be used
- * to create <code>Popup</code> objects.
- */
- public static PopupFactory getSharedInstance()
- {
- /* Swing is not designed to be thread-safe, so there is no
- * need to synchronize the access to the global variable.
- */
- if (sharedFactory == null)
- sharedFactory = new PopupFactory();
-
- return sharedFactory;
- }
-
-
- /**
- * Creates a new <code>Popup</code> given its owner,
- * contents and the screen position where the popup
- * will appear.
- *
- * @param owner the Component to which <code>x</code> and
- * <code>y</code> are relative, or <code>null</code> for
- * placing the popup relative to the origin of the screen.
- *
- * @param contents the contents that will be displayed inside
- * the <code>Popup</code>.
- *
- * @param x the horizontal position where the Popup will appear.
- *
- * @param y the vertical position where the Popup will appear.
- *
- * @throws IllegalArgumentException if <code>contents</code>
- * is <code>null</code>.
- */
- public Popup getPopup(Component owner, Component contents,
- int x, int y)
- {
- return new Popup.JWindowPopup(owner, contents, x, y);
- }
-}
diff --git a/libjava/javax/swing/ProgressMonitor.java b/libjava/javax/swing/ProgressMonitor.java
deleted file mode 100644
index 844258f1b90..00000000000
--- a/libjava/javax/swing/ProgressMonitor.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/* ProgressMonitor.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-
-/**
- * ProgressMonitor
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class ProgressMonitor {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * parentComponent
- */
- private Component component;
-
- /**
- * note
- */
- private String note;
-
- /**
- * message
- */
- private Object message;
-
- /**
- * millisToDecideToPopup
- */
- private int millisToDecideToPopup;
-
- /**
- * millisToPopup
- */
- private int millisToPopup;
-
- /**
- * min
- */
- private int minimum;
-
- /**
- * max
- */
- private int maximum;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ProgressMonitor
- * @param component TODO
- * @param message TODO
- * @param note TODO
- * @param minimum TODO
- * @param maximum TODO
- */
- public ProgressMonitor(Component component, Object message,
- String note, int minimum, int maximum) {
-
- // Set Data
- this.component = component;
- this.message = message;
- this.note = note;
- this.minimum = minimum;
- this.maximum = maximum;
-
- // TODO
- } // ProgressMonitor()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * close
- */
- public void close() {
- // TODO
- } // close()
-
- /**
- * setProgress
- * @param progress TODO
- */
- public void setProgress(int progress) {
- // TODO
- } // setProgress()
-
- /**
- * getMinimum
- * @returns int
- */
- public int getMinimum() {
- return minimum; // TODO
- } // getMinimum()
-
- /**
- * setMinimum
- * @param minimum TODO
- */
- public void setMinimum(int minimum) {
- this.minimum = minimum;
- // TODO
- } // setMinimum()
-
- /**
- * getMaximum
- * @returns int
- */
- public int getMaximum() {
- return maximum; // TODO
- } // getMaximum()
-
- /**
- * setMaximum
- * @param maximum TODO
- */
- public void setMaximum(int maximum) {
- this.maximum = maximum;
- // TODO
- } // setMaximum()
-
- /**
- * isCanceled
- * @returns boolean
- */
- public boolean isCanceled() {
- return false; // TODO
- } // isCanceled()
-
- /**
- * getMillisToDecideToPopup
- * @returns int
- */
- public int getMillisToDecideToPopup() {
- return millisToDecideToPopup; // TODO
- } // getMillisToDecideToPopup()
-
- /**
- * setMillisToDecideToPopup
- * @param time TODO
- */
- public void setMillisToDecideToPopup(int time) {
- millisToDecideToPopup = time;
- // TODO
- } // setMillisToDecideToPopup()
-
- /**
- * getMillisToPopup
- * @returns int
- */
- public int getMillisToPopup() {
- return millisToPopup; // TODO
- } // getMillisToPopup()
-
- /**
- * setMillisToPopup
- * @param time TODO
- */
- public void setMillisToPopup(int time) {
- millisToPopup = time;
- // TODO
- } // setMillisToPopup()
-
- /**
- * getNote
- * @returns String
- */
- public String getNote() {
- return note; // TODO
- } // getNote()
-
- /**
- * setNote
- * @param note TODO
- */
- public void setNote(String note) {
- this.note = note;
- // TODO
- } // setNote()
-
-
-} // ProgressMonitor
diff --git a/libjava/javax/swing/ProgressMonitorInputStream.java b/libjava/javax/swing/ProgressMonitorInputStream.java
deleted file mode 100644
index 2022a1c24a3..00000000000
--- a/libjava/javax/swing/ProgressMonitorInputStream.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/* ProgressMonitorInputStream.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * ProgressMonitorInputStream
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class ProgressMonitorInputStream extends FilterInputStream {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * monitor
- */
- private ProgressMonitor monitor;
-
- /**
- * nread
- */
- private int nread;
-
- /**
- * size
- */
- private int size;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ProgressMonitorInputStream
- * @param component TODO
- * @param message TODO
- * @param stream TODO
- */
- public ProgressMonitorInputStream(Component component, Object message,
- InputStream stream) {
- super(stream);
- // TODO
- } // ProgressMonitorInputStream()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * reset
- * @exception IOException TODO
- */
- public synchronized void reset() throws IOException {
- // TODO
- } // reset()
-
- /**
- * read
- * @exception IOException TODO
- * @returns int
- */
- public int read() throws IOException {
- return 0; // TODO
- } // read()
-
- /**
- * read
- * @param data TODO
- * @exception IOException TODO
- * @returns int
- */
- public int read(byte[] data) throws IOException {
- return 0; // TODO
- } // read()
-
- /**
- * read
- * @param data TODO
- * @param offset TODO
- * @param length TODO
- * @exception IOException TODO
- * @returns int
- */
- public int read(byte[] data, int offset, int length) throws IOException {
- return 0; // TODO
- } // read()
-
- /**
- * skip
- * @param length TODO
- * @exception IOException TODO
- * @returns long
- */
- public long skip(long length) throws IOException {
- return 0; // TODO
- } // skip()
-
- /**
- * close
- * @exception IOException TODO
- */
- public void close() throws IOException {
- // TODO
- } // close()
-
- /**
- * getProgressMonitor
- * @returns ProgressMonitor
- */
- public ProgressMonitor getProgressMonitor() {
- return null; // TODO
- } // getProgressMonitor()
-
-
-} // ProgressMonitorInputStream
diff --git a/libjava/javax/swing/Renderer.java b/libjava/javax/swing/Renderer.java
deleted file mode 100644
index 9cca189788a..00000000000
--- a/libjava/javax/swing/Renderer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Renderer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-
-/**
- * Renderer
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface Renderer {
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * setValue
- * @param value TODO
- * @param selected TODO
- */
- void setValue(Object value, boolean selected);
-
- /**
- * getComponent
- * @returns Component
- */
- Component getComponent();
-
-
-} // Renderer
diff --git a/libjava/javax/swing/RepaintManager.java b/libjava/javax/swing/RepaintManager.java
deleted file mode 100644
index b7102f56e20..00000000000
--- a/libjava/javax/swing/RepaintManager.java
+++ /dev/null
@@ -1,543 +0,0 @@
-/* RepaintManager.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Dimension;
-import java.awt.Image;
-import java.awt.Rectangle;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-/**
- * <p>The repaint manager holds a set of dirty regions, invalid components,
- * and a double buffer surface. The dirty regions and invalid components
- * are used to coalesce multiple revalidate() and repaint() calls in the
- * component tree into larger groups to be refreshed "all at once"; the
- * double buffer surface is used by root components to paint
- * themselves.</p>
- *
- * <p>In general, painting is very confusing in swing. see <a
- * href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">this
- * document</a> for more details.</p>
- *
- * @author Graydon Hoare (graydon@redhat.com)
- */
-public class RepaintManager
-{
-
- /**
- * <p>A helper class which is placed into the system event queue at
- * various times in order to facilitate repainting and layout. There is
- * typically only one of these objects active at any time. When the
- * {@link RepaintManager} is told to queue a repaint, it checks to see if
- * a {@link RepaintWorker} is "live" in the system event queue, and if
- * not it inserts one using {@link SwingUtilities.invokeLater}.</p>
- *
- * <p>When the {@link RepaintWorker} comes to the head of the system
- * event queue, its {@link RepaintWorker#run} method is executed by the
- * swing paint thread, which revalidates all invalid components and
- * repaints any damage in the swing scene.</p>
- */
-
- protected class RepaintWorker
- implements Runnable
- {
- boolean live;
- public RepaintWorker()
- {
- live = false;
- }
- public synchronized void setLive(boolean b)
- {
- live = b;
- }
- public synchronized boolean isLive()
- {
- return live;
- }
- public void run()
- {
- RepaintManager rm = RepaintManager.globalManager;
- setLive(false);
- rm.validateInvalidComponents();
- rm.paintDirtyRegions();
- }
- }
-
-
- /**
- * A table storing the dirty regions of components. The keys of this
- * table are components, the values are rectangles. Each component maps
- * to exactly one rectangle. When more regions are marked as dirty on a
- * component, they are union'ed with the existing rectangle.
- *
- * @see #addDirtyRegion
- * @see #getDirtyRegion
- * @see #isCompletelyDirty
- * @see #markCompletelyClean
- * @see #markCompletelyDirty
- */
- Hashtable dirtyComponents;
-
- /**
- * A single, shared instance of the helper class. Any methods which mark
- * components as invalid or dirty eventually activate this instance. It
- * is added to the event queue if it is not already active, otherwise
- * reused.
- *
- * @see #addDirtyRegion
- * @see #addInvalidComponent
- */
- RepaintWorker repaintWorker;
-
- /**
- * The set of components which need revalidation, in the "layout" sense.
- * There is no additional information about "what kind of layout" they
- * need (as there is with dirty regions), so it is just a vector rather
- * than a table.
- *
- * @see #addInvalidComponent
- * @see #removeInvalidComponent
- * @see #validateInvalidComponents
- */
- Vector invalidComponents;
-
- /**
- * Whether or not double buffering is enabled on this repaint
- * manager. This is merely a hint to clients; the RepaintManager will
- * always return an offscreen buffer when one is requested.
- *
- * @see #getDoubleBufferingEnabled
- * @see #setDoubleBufferingEnabled
- */
- boolean doubleBufferingEnabled;
-
- /**
- * The current offscreen buffer. This is reused for all requests for
- * offscreen drawing buffers. It grows as necessary, up to {@link
- * #doubleBufferMaximumSize}, but there is only one shared instance.
- *
- * @see #getOffscreenBuffer
- * @see #doubleBufferMaximumSize
- */
- Image doubleBuffer;
-
- /**
- * The maximum width and height to allocate as a double buffer. Requests
- * beyond this size are ignored.
- *
- * @see #paintDirtyRegions
- * @see #getDoubleBufferMaximumSize
- * @see #setDoubleBufferMaximumSize
- */
- Dimension doubleBufferMaximumSize;
-
-
- /**
- * The global, shared RepaintManager instance. This is reused for all
- * components in all windows. This is package-private to avoid an accessor
- * method.
- *
- * @see #currentManager
- * @see #setCurrentManager
- */
- static RepaintManager globalManager;
-
- /**
- * Create a new RepaintManager object.
- */
- public RepaintManager()
- {
- dirtyComponents = new Hashtable();
- invalidComponents = new Vector();
- repaintWorker = new RepaintWorker();
- doubleBufferMaximumSize = new Dimension(2000,2000);
- doubleBufferingEnabled = true;
- }
-
- /**
- * Get the value of the shared {@link #globalManager} instance, possibly
- * returning a special manager associated with the specified
- * component. The default implementaiton ignores the component parameter.
- *
- * @param component A component to look up the manager of
- *
- * @return The current repaint manager
- *
- * @see #setCurrentManager
- */
- public static RepaintManager currentManager(Component component)
- {
- if (globalManager == null)
- globalManager = new RepaintManager();
- return globalManager;
- }
-
- /**
- * Get the value of the shared {@link #globalManager} instance, possibly
- * returning a special manager associated with the specified
- * component. The default implementaiton ignores the component parameter.
- *
- * @param component A component to look up the manager of
- *
- * @return The current repaint manager
- *
- * @see #setCurrentManager
- */
- public static RepaintManager currentManager(JComponent component)
- {
- return currentManager((Component)component);
- }
-
- /**
- * Set the value of the shared {@link #globalManager} instance.
- *
- * @param manager The new value of the shared instance
- *
- * @see #currentManager
- */
- public static void setCurrentManager(RepaintManager manager)
- {
- globalManager = manager;
- }
-
- /**
- * Add a component to the {@link #invalidComponents} vector. If the
- * {@link #repaintWorker} class is not active, insert it in the system
- * event queue.
- *
- * @param component The component to add
- *
- * @see #removeInvalidComponent
- */
- public synchronized void addInvalidComponent(JComponent component)
- {
- Component ancestor = component.getParent();
-
- while (ancestor != null
- && (! (ancestor instanceof JComponent)
- || ! ((JComponent) ancestor).isValidateRoot() ))
- ancestor = ancestor.getParent();
-
- if (ancestor != null
- && ancestor instanceof JComponent
- && ((JComponent) ancestor).isValidateRoot())
- component = (JComponent) ancestor;
-
- if (invalidComponents.contains(component))
- return;
-
- invalidComponents.add(component);
-
- if (! repaintWorker.isLive())
- {
- repaintWorker.setLive(true);
- SwingUtilities.invokeLater(repaintWorker);
- }
- }
-
- /**
- * Remove a component from the {@link #invalidComponents} vector.
- *
- * @param component The component to remove
- *
- * @see #addInvalidComponent
- */
- public synchronized void removeInvalidComponent(JComponent component)
- {
- invalidComponents.removeElement(component);
- }
-
- /**
- * Add a region to the set of dirty regions for a specified component.
- * This involves union'ing the new region with any existing dirty region
- * associated with the component. If the {@link #repaintWorker} class
- * is not active, insert it in the system event queue.
- *
- * @param component The component to add a dirty region for
- * @param x The left x coordinate of the new dirty region
- * @param y The top y coordinate of the new dirty region
- * @param w The width of the new dirty region
- * @param h The height of the new dirty region
- *
- * @see #addDirtyRegion
- * @see #getDirtyRegion
- * @see #isCompletelyDirty
- * @see #markCompletelyClean
- * @see #markCompletelyDirty
- */
- public synchronized void addDirtyRegion(JComponent component, int x, int y,
- int w, int h)
- {
- if (w == 0 || h == 0)
- return;
-
- Rectangle r = new Rectangle(x, y, w, h);
- if (dirtyComponents.containsKey(component))
- r = r.union((Rectangle)dirtyComponents.get(component));
- dirtyComponents.put(component, r);
- if (! repaintWorker.isLive())
- {
- repaintWorker.setLive(true);
- SwingUtilities.invokeLater(repaintWorker);
- }
- }
-
- /**
- * Get the dirty region associated with a component, or <code>null</code>
- * if the component has no dirty region.
- *
- * @param component The component to get the dirty region of
- *
- * @return The dirty region of the component
- *
- * @see #dirtyComponents
- * @see #addDirtyRegion
- * @see #isCompletelyDirty
- * @see #markCompletelyClean
- * @see #markCompletelyDirty
- */
- public Rectangle getDirtyRegion(JComponent component)
- {
- return (Rectangle) dirtyComponents.get(component);
- }
-
- /**
- * Mark a component as dirty over its entire bounds.
- *
- * @param component The component to mark as dirty
- *
- * @see #dirtyComponents
- * @see #addDirtyRegion
- * @see #getDirtyRegion
- * @see #isCompletelyDirty
- * @see #markCompletelyClean
- */
- public void markCompletelyDirty(JComponent component)
- {
- Rectangle r = component.getBounds();
- addDirtyRegion(component, r.x, r.y, r.width, r.height);
- }
-
- /**
- * Remove all dirty regions for a specified component
- *
- * @param component The component to mark as clean
- *
- * @see #dirtyComponents
- * @see #addDirtyRegion
- * @see #getDirtyRegion
- * @see #isCompletelyDirty
- * @see #markCompletelyDirty
- */
- public void markCompletelyClean(JComponent component)
- {
- dirtyComponents.remove(component);
- }
-
- /**
- * Return <code>true</code> if the specified component is completely
- * contained within its dirty region, otherwise <code>false</code>
- *
- * @param component The component to check for complete dirtyness
- *
- * @return Whether the component is completely dirty
- *
- * @see #dirtyComponents
- * @see #addDirtyRegion
- * @see #getDirtyRegion
- * @see #isCompletelyDirty
- * @see #markCompletelyClean
- */
- public boolean isCompletelyDirty(JComponent component)
- {
- Rectangle dirty = (Rectangle) dirtyComponents.get(component);
- if (dirty == null)
- return false;
- Rectangle r = component.getBounds();
- if (r == null)
- return true;
- return dirty.contains(r);
- }
-
- /**
- * Validate all components which have been marked invalid in the {@link
- * #invalidComponents} vector.
- */
- public void validateInvalidComponents()
- {
- for (Enumeration e = invalidComponents.elements(); e.hasMoreElements(); )
- {
- JComponent comp = (JComponent) e.nextElement();
- if (! (comp.isVisible() && comp.isShowing()))
- continue;
- comp.validate();
- }
- invalidComponents.clear();
- }
-
- /**
- * Repaint all regions of all components which have been marked dirty in
- * the {@link #dirtyComponents} table.
- */
- public void paintDirtyRegions()
- {
- // step 1: pull out roots and calculate spanning damage
-
- HashMap roots = new HashMap();
- for (Enumeration e = dirtyComponents.keys(); e.hasMoreElements(); )
- {
- JComponent comp = (JComponent) e.nextElement();
- if (! (comp.isVisible() && comp.isShowing()))
- continue;
- Rectangle damaged = getDirtyRegion(comp);
- if (damaged.width == 0 || damaged.height == 0)
- continue;
- JRootPane root = comp.getRootPane();
- // If the component has no root, no repainting will occur.
- if (root == null)
- continue;
- Rectangle rootDamage = SwingUtilities.convertRectangle(comp, damaged, root);
- if (! roots.containsKey(root))
- {
- roots.put(root, rootDamage);
- }
- else
- {
- roots.put(root, ((Rectangle)roots.get(root)).union(rootDamage));
- }
- }
- dirtyComponents.clear();
-
- // step 2: paint those roots
- Iterator i = roots.entrySet().iterator();
- while(i.hasNext())
- {
- Map.Entry ent = (Map.Entry) i.next();
- JRootPane root = (JRootPane) ent.getKey();
- Rectangle rect = (Rectangle) ent.getValue();
- root.paintImmediately(rect);
- }
- }
-
- /**
- * Get an offscreen buffer for painting a component's image. This image
- * may be smaller than the proposed dimensions, depending on the value of
- * the {@link #doubleBufferMaximumSize} property.
- *
- * @param component The component to return an offscreen buffer for
- * @param proposedWidth The proposed width of the offscreen buffer
- * @param proposedHeight The proposed height of the offscreen buffer
- *
- * @return A shared offscreen buffer for painting
- *
- * @see #doubleBuffer
- */
- public Image getOffscreenBuffer(Component component, int proposedWidth,
- int proposedHeight)
- {
- if (doubleBuffer == null
- || (((doubleBuffer.getWidth(null) < proposedWidth)
- || (doubleBuffer.getHeight(null) < proposedHeight))
- && (proposedWidth < doubleBufferMaximumSize.width)
- && (proposedHeight < doubleBufferMaximumSize.height)))
- {
- doubleBuffer = component.createImage(proposedWidth, proposedHeight);
- }
- return doubleBuffer;
- }
-
- /**
- * Get the value of the {@link #doubleBufferMaximumSize} property.
- *
- * @return The current value of the property
- *
- * @see #setDoubleBufferMaximumSize
- */
- public Dimension getDoubleBufferMaximumSize()
- {
- return doubleBufferMaximumSize;
- }
-
- /**
- * Set the value of the {@link #doubleBufferMaximumSize} property.
- *
- * @param size The new value of the property
- *
- * @see #getDoubleBufferMaximumSize
- */
- public void setDoubleBufferMaximumSize(Dimension size)
- {
- doubleBufferMaximumSize = size;
- }
-
- /**
- * Set the value of the {@link #doubleBufferingEnabled} property.
- *
- * @param buffer The new value of the property
- *
- * @see #getDoubleBufferingEnabled
- */
- public void setDoubleBufferingEnabled(boolean buffer)
- {
- doubleBufferingEnabled = buffer;
- }
-
- /**
- * Get the value of the {@link #doubleBufferingEnabled} property.
- *
- * @return The current value of the property
- *
- * @see #setDoubleBufferingEnabled
- */
- public boolean isDoubleBufferingEnabled()
- {
- return doubleBufferingEnabled;
- }
-
- public String toString()
- {
- return "RepaintManager";
- }
-}
diff --git a/libjava/javax/swing/RootPaneContainer.java b/libjava/javax/swing/RootPaneContainer.java
deleted file mode 100644
index 38695ad759f..00000000000
--- a/libjava/javax/swing/RootPaneContainer.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* RootPaneContainer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-
-/**
- * RootPaneContainer
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface RootPaneContainer {
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getRootPane
- * @returns JRootPane
- */
- JRootPane getRootPane();
-
- /**
- * setContentPane
- * @param contentPane TODO
- */
- void setContentPane(Container contentPane);
-
- /**
- * getContentPane
- * @returns Container
- */
- Container getContentPane();
-
- /**
- * setLayeredPane
- * @param layeredPane TODO
- */
- void setLayeredPane(JLayeredPane layeredPane);
-
- /**
- * getLayeredPane
- * @returns JLayeredPane
- */
- JLayeredPane getLayeredPane();
-
- /**
- * setGlassPane
- * @param glassPane TODO
- */
- void setGlassPane(Component glassPane);
-
- /**
- * getGlassPane
- * @returns Component
- */
- Component getGlassPane();
-
-
-} // RootPaneContainer
diff --git a/libjava/javax/swing/ScrollPaneConstants.java b/libjava/javax/swing/ScrollPaneConstants.java
deleted file mode 100644
index 6d6d9160716..00000000000
--- a/libjava/javax/swing/ScrollPaneConstants.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/* ScrollPaneConstants.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * ScrollPaneConstants
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface ScrollPaneConstants
-{
- /**
- * VIEWPORT
- */
- String VIEWPORT = "VIEWPORT";
-
- /**
- * VERTICAL_SCROLLBAR
- */
- String VERTICAL_SCROLLBAR = "VERTICAL_SCROLLBAR";
-
- /**
- * HORIZONTAL_SCROLLBAR
- */
- String HORIZONTAL_SCROLLBAR = "HORIZONTAL_SCROLLBAR";
-
- /**
- * ROW_HEADER
- */
- String ROW_HEADER = "ROW_HEADER";
-
- /**
- * COLUMN_HEADER
- */
- String COLUMN_HEADER = "COLUMN_HEADER";
-
- /**
- * LOWER_LEFT_CORNER
- */
- String LOWER_LEFT_CORNER = "LOWER_LEFT_CORNER";
-
- /**
- * LOWER_RIGHT_CORNER
- */
- String LOWER_RIGHT_CORNER = "LOWER_RIGHT_CORNER";
-
- /**
- * UPPER_LEFT_CORNER
- */
- String UPPER_LEFT_CORNER = "UPPER_LEFT_CORNER";
-
- /**
- * UPPER_RIGHT_CORNER
- */
- String UPPER_RIGHT_CORNER = "UPPER_RIGHT_CORNER";
-
- /**
- * LOWER_LEADING_CORNER
- */
- String LOWER_LEADING_CORNER = "LOWER_LEADING_CORNER";
-
- /**
- * LOWER_TRAILING_CORNER
- */
- String LOWER_TRAILING_CORNER = "LOWER_TRAILING_CORNER";
-
- /**
- * UPPER_LEADING_CORNER
- */
- String UPPER_LEADING_CORNER = "UPPER_LEADING_CORNER";
-
- /**
- * UPPER_TRAILING_CORNER
- */
- String UPPER_TRAILING_CORNER = "UPPER_TRAILING_CORNER";
-
- /**
- * VERTICAL_SCROLLBAR_POLICY
- */
- String VERTICAL_SCROLLBAR_POLICY = "VERTICAL_SCROLLBAR_POLICY";
-
- /**
- * HORIZONTAL_SCROLLBAR_POLICY
- */
- String HORIZONTAL_SCROLLBAR_POLICY = "HORIZONTAL_SCROLLBAR_POLICY";
-
- /**
- * VERTICAL_SCROLLBAR_AS_NEEDED
- */
- int VERTICAL_SCROLLBAR_AS_NEEDED = 20;
-
- /**
- * VERTICAL_SCROLLBAR_NEVER
- */
- int VERTICAL_SCROLLBAR_NEVER = 21;
-
- /**
- * VERTICAL_SCROLLBAR_ALWAYS
- */
- int VERTICAL_SCROLLBAR_ALWAYS = 22;
-
- /**
- * HORIZONTAL_SCROLLBAR_AS_NEEDED
- */
- int HORIZONTAL_SCROLLBAR_AS_NEEDED = 30;
-
- /**
- * HORIZONTAL_SCROLLBAR_NEVER
- */
- int HORIZONTAL_SCROLLBAR_NEVER = 31;
-
- /**
- * HORIZONTAL_SCROLLBAR_ALWAYS
- */
- int HORIZONTAL_SCROLLBAR_ALWAYS = 32;
-}
diff --git a/libjava/javax/swing/ScrollPaneLayout.java b/libjava/javax/swing/ScrollPaneLayout.java
deleted file mode 100644
index 683a6db4168..00000000000
--- a/libjava/javax/swing/ScrollPaneLayout.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/* ScrollPaneLayout.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.io.Serializable;
-
-import javax.swing.border.Border;
-
-/**
- * ScrollPaneLayout
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class ScrollPaneLayout
- implements LayoutManager, ScrollPaneConstants, Serializable
-{
- private static final long serialVersionUID = -4480022884523193743L;
-
- public static class UIResource extends ScrollPaneLayout
- implements javax.swing.plaf.UIResource {
- public UIResource() {
- }
- }
-
- protected JViewport viewport;
- protected JScrollBar vsb;
- protected JScrollBar hsb;
- protected JViewport rowHead;
- protected JViewport colHead;
- protected Component lowerLeft;
- protected Component lowerRight;
- protected Component upperLeft;
- protected Component upperRight;
- protected int vsbPolicy;
- protected int hsbPolicy;
-
- public ScrollPaneLayout() {
-
- }
-
- public void syncWithScrollPane(JScrollPane scrollPane) {
- viewport = scrollPane.getViewport();
- rowHead = scrollPane.getRowHeader();
- colHead = scrollPane.getColumnHeader();
- vsb = scrollPane.getVerticalScrollBar();
- hsb = scrollPane.getHorizontalScrollBar();
- vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
- hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();
- lowerLeft = scrollPane.getCorner(LOWER_LEFT_CORNER);
- lowerRight = scrollPane.getCorner(LOWER_RIGHT_CORNER);
- upperLeft = scrollPane.getCorner(UPPER_LEFT_CORNER);
- upperRight = scrollPane.getCorner(UPPER_RIGHT_CORNER);
- }
-
- protected Component addSingletonComponent(Component oldComponent,
- Component newComponent) {
- return null;
- }
-
- public void addLayoutComponent(String key, Component component)
- {
- if (key == VIEWPORT)
- viewport = (JViewport) component;
- else if (key == VERTICAL_SCROLLBAR)
- vsb = (JScrollBar) component;
- else if (key == HORIZONTAL_SCROLLBAR)
- hsb = (JScrollBar) component;
- else if (key == ROW_HEADER)
- rowHead = (JViewport) component;
- else if (key == COLUMN_HEADER)
- colHead = (JViewport) component;
- else if (key == LOWER_RIGHT_CORNER)
- lowerRight = component;
- else if (key == UPPER_RIGHT_CORNER)
- upperRight = component;
- else if (key == LOWER_LEFT_CORNER)
- lowerLeft = component;
- else if (key == UPPER_LEFT_CORNER)
- upperLeft = component;
- }
-
- public void removeLayoutComponent(Component component) {
- if (component == viewport)
- viewport = null;
- else if (component == vsb)
- vsb = null;
- else if (component == hsb)
- hsb = null;
- else if (component == rowHead)
- rowHead = null;
- else if (component == colHead)
- colHead = null;
- else if (component == lowerRight)
- lowerRight = null;
- else if (component == upperRight)
- upperRight = null;
- else if (component == lowerLeft)
- lowerLeft = null;
- else if (component == upperLeft)
- upperLeft = null;
- }
-
- public int getVerticalScrollBarPolicy()
- {
- return vsbPolicy;
- }
-
- public void setVerticalScrollBarPolicy(int policy)
- {
- vsbPolicy = policy;
- }
-
- public int getHorizontalScrollBarPolicy()
- {
- return hsbPolicy;
- }
-
- public void setHorizontalScrollBarPolicy(int policy)
- {
- hsbPolicy = policy;
- }
-
- public JViewport getViewport()
- {
- return viewport;
- }
-
- public JScrollBar getHorizontalScrollBar()
- {
- return hsb;
- }
-
- public JScrollBar getVerticalScrollBar()
- {
- return vsb;
- }
-
- public JViewport getRowHeader()
- {
- return rowHead;
- }
-
- public JViewport getColumnHeader()
- {
- return colHead;
- }
-
- public Component getCorner(String key)
- {
- if (key == LOWER_RIGHT_CORNER)
- return lowerRight;
- else if (key == UPPER_RIGHT_CORNER)
- return upperRight;
- else if (key == LOWER_LEFT_CORNER)
- return lowerLeft;
- else if (key == UPPER_LEFT_CORNER)
- return upperLeft;
- return null;
- }
-
- private static void maybeSetPreferredSize(JComponent src, Dimension dim)
- {
- Dimension tmp = null;
- if (src != null)
- tmp = src.getPreferredSize();
- if (tmp != null)
- dim.setSize(tmp);
- }
-
- private static void maybeSetMinimumSize(JComponent src, Dimension dim)
- {
- Dimension tmp = null;
- if (src != null)
- tmp = src.getMinimumSize();
- if (tmp != null)
- dim.setSize(tmp);
- }
-
- public Dimension preferredLayoutSize(Container parent)
- {
- if (parent != null && parent instanceof JScrollPane)
- {
- JScrollPane sc = (JScrollPane) parent;
- synchronized (sc.getTreeLock ())
- {
- Dimension insetsSize = new Dimension(0,0);
- Dimension viewportSize = new Dimension(0,0);
- Dimension viewportInsetsSize = new Dimension(0,0);
- Dimension columnHeaderSize = new Dimension(0,0);
- Dimension rowHeaderSize = new Dimension(0,0);
- Dimension verticalScrollBarSize = new Dimension(0,0);
- Dimension horizontalScrollBarSize = new Dimension(0,0);
-
- Insets insets = sc.getInsets();
- Border viewportBorder = sc.getViewportBorder();
- Insets viewportInsets = null;
-
- if (viewportBorder != null)
- {
- viewportInsets = viewportBorder.getBorderInsets(parent);
- if (viewportInsets != null)
- viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right,
- viewportInsets.top + viewportInsets.bottom);
- }
-
- if (insets != null)
- insetsSize.setSize(insets.left + insets.right,
- insets.top + insets.bottom);
-
- if (viewport != null)
- {
- Component view = null;
- Scrollable scr = null;
- Dimension pref = null;
-
- view = viewport.getView();
- if (view != null && view instanceof Scrollable)
- scr = (Scrollable) view;
- if (scr != null)
- pref = scr.getPreferredScrollableViewportSize();
- if (pref == null)
- pref = viewport.getPreferredSize();
- if (pref != null)
- viewportSize.setSize(pref);
- }
-
- maybeSetPreferredSize(colHead, columnHeaderSize);
- maybeSetPreferredSize(rowHead, rowHeaderSize);
- maybeSetPreferredSize(vsb, verticalScrollBarSize);
- maybeSetPreferredSize(hsb, horizontalScrollBarSize);
-
- return new Dimension(insetsSize.width
- + viewportSize.width
- + viewportInsetsSize.width
- + rowHeaderSize.width
- + verticalScrollBarSize.width,
- insetsSize.height
- + viewportSize.height
- + viewportInsetsSize.height
- + columnHeaderSize.height
- + horizontalScrollBarSize.height);
- }
- }
- else
- {
- return new Dimension(0,0);
- }
- }
-
- public Dimension minimumLayoutSize(Container parent)
- {
- if (parent instanceof JScrollPane)
- {
- JScrollPane sc = (JScrollPane) parent;
- synchronized (sc.getTreeLock ())
- {
- Dimension insetsSize = new Dimension(0,0);
- Dimension viewportSize = new Dimension(0,0);
- Dimension viewportInsetsSize = new Dimension(0,0);
- Dimension columnHeaderSize = new Dimension(0,0);
- Dimension rowHeaderSize = new Dimension(0,0);
- Dimension verticalScrollBarSize = new Dimension(0,0);
- Dimension horizontalScrollBarSize = new Dimension(0,0);
-
- Insets insets = sc.getInsets();
- Border viewportBorder = sc.getViewportBorder();
- Insets viewportInsets = null;
-
- if (viewportBorder != null)
- {
- viewportInsets = viewportBorder.getBorderInsets(parent);
- if (viewportInsets != null)
- viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right,
- viewportInsets.top + viewportInsets.bottom);
- }
-
- if (insets != null)
- insetsSize.setSize(insets.left + insets.right,
- insets.top + insets.bottom);
-
- maybeSetMinimumSize(colHead, columnHeaderSize);
- maybeSetMinimumSize(rowHead, rowHeaderSize);
-
- if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER)
- maybeSetMinimumSize(vsb, verticalScrollBarSize);
-
- if (hsbPolicy != HORIZONTAL_SCROLLBAR_NEVER)
- maybeSetMinimumSize(hsb, horizontalScrollBarSize);
-
- return new Dimension(insetsSize.width
- + viewportSize.width
- + viewportInsetsSize.width
- + rowHeaderSize.width
- + verticalScrollBarSize.width,
- insetsSize.height
- + viewportSize.height
- + viewportInsetsSize.height
- + columnHeaderSize.height
- + horizontalScrollBarSize.height);
- }
- }
- else
- {
- return new Dimension(0,0);
- }
- }
-
- /**
- *
- * +----+--------------------+----+ y1
- * | c1 | column header | c2 |
- * +----+--------------------+----+ y2
- * | r | | v |
- * | o | | |
- * | w | | s |
- * | | | r |
- * | h | | o |
- * | e | viewport | l |
- * | a | | l |
- * | d | | b |
- * | e | | a |
- * | r | | r |
- * +----+--------------------+----+ y3
- * | c3 | h scrollbar | c4 |
- * +----+--------------------+----+ y4
- * x1 x2 x3 x4
- *
- */
- public void layoutContainer(Container parent)
- {
- if (parent instanceof JScrollPane)
- {
- JScrollPane sc = (JScrollPane) parent;
- synchronized (sc.getTreeLock ())
- {
- JViewport viewport = sc.getViewport();
- Dimension viewSize = viewport.getViewSize();
- Point viewPos = viewport.getViewPosition();
-
- int x1 = 0, x2 = 0, x3 = 0, x4 = 0;
- int y1 = 0, y2 = 0, y3 = 0, y4 = 0;
-
- Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null);
-
- x1 = scrollPaneBounds.x;
- y1 = scrollPaneBounds.y;
- x4 = scrollPaneBounds.x + scrollPaneBounds.width;
- y4 = scrollPaneBounds.y + scrollPaneBounds.height;
-
- if (colHead != null)
- y2 = y1 + colHead.getPreferredSize().height;
- else
- y2 = y1;
-
- if (rowHead != null)
- x2 = x1 + rowHead.getPreferredSize().width;
- else
- x2 = x1;
-
- int vsbPolicy = sc.getVerticalScrollBarPolicy();
- int hsbPolicy = sc.getHorizontalScrollBarPolicy();
-
- x3 = x4 - vsb.getPreferredSize().width;
- y3 = y4 - hsb.getPreferredSize().height;
-
- boolean showVsb =
- (vsb != null)
- && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS)
- || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED
- && viewSize.height > (y3 - y2)));
-
- boolean showHsb =
- (hsb != null)
- && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS)
- || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED
- && viewSize.width > (x3 - x2)));
-
- if (!showVsb)
- x3 = x4;
-
- if (!showHsb)
- y3 = y4;
-
- // now set the layout
-
- if (viewport != null)
- viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2));
-
- if (colHead != null)
- colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1));
-
- if (rowHead != null)
- rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2));
-
- if (showVsb)
- {
- vsb.setVisible(true);
- vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2));
- }
- else if (vsb != null)
- vsb.setVisible(false);
-
- if (showHsb)
- {
- hsb.setVisible(true);
- hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3));
- }
- else if (hsb != null)
- hsb.setVisible(false);
-
- if (upperLeft != null)
- upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1));
-
- if (upperRight != null)
- upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1));
-
- if (lowerLeft != null)
- lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3));
-
- if (lowerRight != null)
- lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3));
-
- }
- }
- }
-
- public Rectangle getViewportBorderBounds(JScrollPane scrollPane) {
- return null;
- }
-
-
-}
diff --git a/libjava/javax/swing/Scrollable.java b/libjava/javax/swing/Scrollable.java
deleted file mode 100644
index 87cfac9d290..00000000000
--- a/libjava/javax/swing/Scrollable.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Scrollable.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Dimension;
-import java.awt.Rectangle;
-
-public interface Scrollable
-{
- Dimension getPreferredScrollableViewportSize();
- int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction);
- int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction);
- boolean getScrollableTracksViewportWidth();
- boolean getScrollableTracksViewportHeight();
-}
diff --git a/libjava/javax/swing/SingleSelectionModel.java b/libjava/javax/swing/SingleSelectionModel.java
deleted file mode 100644
index f5afad9f26f..00000000000
--- a/libjava/javax/swing/SingleSelectionModel.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* SingleSelectionModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.swing.event.ChangeListener;
-
-/**
- * SingleSelectionModel
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface SingleSelectionModel {
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getSelectedIndex
- * @returns int
- */
- int getSelectedIndex();
-
- /**
- * setSelectedIndex
- * @param index TODO
- */
- void setSelectedIndex(int index);
-
- /**
- * clearSelection
- */
- void clearSelection();
-
- /**
- * isSelected
- * @returns boolean
- */
- boolean isSelected();
-
- /**
- * addChangeListener
- * @param listener TODO
- */
- void addChangeListener(ChangeListener listener);
-
- /**
- * removeChangeListener
- * @param listener TODO
- */
- void removeChangeListener(ChangeListener listener);
-
-
-} // SingleSelectionModel
diff --git a/libjava/javax/swing/SizeRequirements.java b/libjava/javax/swing/SizeRequirements.java
deleted file mode 100644
index dee63c93009..00000000000
--- a/libjava/javax/swing/SizeRequirements.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* SizeRequirements.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * SizeRequirements
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class SizeRequirements implements Serializable
-{
- private static final long serialVersionUID = 9217749429906736553L;
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * minimum
- */
- public int minimum;
-
- /**
- * preferred
- */
- public int preferred;
-
- /**
- * maximum
- */
- public int maximum;
-
- /**
- * alignment
- */
- public float alignment;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor SizeRequirements
- */
- public SizeRequirements() {
- // TODO
- } // SizeRequirements()
-
- /**
- * Constructor SizeRequirements
- * @param min TODO
- * @param pref TODO
- * @param max TODO
- * @param align TODO
- */
- public SizeRequirements(int min, int pref, int max, float align) {
- // TODO
- } // SizeRequirements()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * toString
- * @returns String
- */
- public String toString() {
- return null; // TODO
- } // toString()
-
- /**
- * getTiledSizeRequirements
- * @param children TODO
- * @returns SizeRequirements
- */
- public static SizeRequirements getTiledSizeRequirements(
- SizeRequirements[] children) {
- return null; // TODO
- } // getTiledSizeRequirements()
-
- /**
- * getAlignedSizeRequirements
- * @param children TODO
- * @returns SizeRequirements
- */
- public static SizeRequirements getAlignedSizeRequirements(
- SizeRequirements[] children) {
- return null; // TODO
- } // getAlignedSizeRequirements()
-
- /**
- * calculateTiledPositions
- * @param allocated TODO
- * @param total TODO
- * @param children TODO
- * @param offset TODO
- * @param spans TODO
- */
- public static void calculateTiledPositions(int allocated,
- SizeRequirements total, SizeRequirements[] children,
- int[] offset, int[] spans) {
- // TODO
- } // calculateTiledPositions()
-
- /**
- * calculateAlignedPositions
- * @param allocated TODO
- * @param total TODO
- * @param children TODO
- * @param offset TODO
- * @param spans TODO
- */
- public static void calculateAlignedPositions(int allocated,
- SizeRequirements total, SizeRequirements[] children,
- int[] offset, int[] spans) {
- // TODO
- } // calculateAlignedPositions()
-
- /**
- * adjustSizes
- * @param delta TODO
- * @param children TODO
- * @returns int[]
- */
- public static int[] adjustSizes(int delta, SizeRequirements[] children) {
- return null; // TODO
- } // adjustSizes()
-
-
-} // SizeRequirements
diff --git a/libjava/javax/swing/SizeSequence.java b/libjava/javax/swing/SizeSequence.java
deleted file mode 100644
index cf6e5f042a1..00000000000
--- a/libjava/javax/swing/SizeSequence.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/* SizeSequence.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * SizeSequence
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class SizeSequence {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * sizes
- */
- private int[] sizes = new int[0];
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor SizeSequence
- */
- public SizeSequence() {
- sizes = new int[0];
- } // SizeSequence()
-
- /**
- * Constructor SizeSequence
- * @param numEntries TODO
- */
- public SizeSequence(int numEntries) {
- this(numEntries, 0);
- } // SizeSequence()
-
- /**
- * Constructor SizeSequence
- * @param numEntries TODO
- * @param value TODO
- */
- public SizeSequence(int numEntries, int value) {
- insertEntries(0, numEntries, value);
- } // SizeSequence()
-
- /**
- * Constructor SizeSequence
- * @param sizes TODO
- */
- public SizeSequence(int[] sizes) {
- setSizes(sizes);
- } // SizeSequence()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * setSize
- * @param index TODO
- * @param size TODO
- */
- public void setSize(int index, int size) {
- sizes[index] = size;
- } // setSize()
-
- /**
- * getIndex
- * @param position TODO
- * @returns int
- */
- public int getIndex(int position) {
- return 0; // TODO
- } // getIndex()
-
- /**
- * getSize
- * @param index TODO
- * @returns int
- */
- public int getSize(int index) {
- return sizes[index];
- } // getSize()
-
- /**
- * setSizes
- * @param sizes TODO
- */
- public void setSizes(int[] sizes) {
-
- // Variables
- int index;
-
- // Initialize Sizes
- this.sizes = new int[sizes.length];
- for (index = 0; index < sizes.length; index++) {
- this.sizes[index] = sizes[index];
- } // for
-
- } // setSizes()
-
- /**
- * getSizes
- * @returns int[]
- */
- public int[] getSizes() {
-
- // Variables
- int[] array;
- int index;
-
- // Create New Array
- array = new int[sizes.length];
- for (index = 0; index < sizes.length; index++) {
- array[index] = sizes[index];
- } // for
-
- // Return Newly created array
- return array;
-
- } // getSizes()
-
- /**
- * getPosition
- * @param index TODO
- * @returns int
- */
- public int getPosition(int index) {
-
- // Variables
- int position;
- int loop;
-
- // Process Sizes
- position = 0;
- for (loop = 0; loop < index; loop++) {
- position += sizes[loop];
- } // for
-
- // Return Position
- return position;
-
- } // getPosition()
-
- /**
- * insertEntries
- * @param start TODO
- * @param length TODO
- * @param value TODO
- */
- public void insertEntries(int start, int length, int value) {
-
- // Variables
- int[] array;
- int index;
- int arrayIndex;
- int loop;
-
- // Create New Array
- array = new int[sizes.length + length];
- arrayIndex = 0;
- for (index = 0; index < sizes.length; index++) {
- if (index == start) {
- for (loop = 0; loop < length; loop++) {
- array[arrayIndex] = value;
- arrayIndex++;
- } // for
- } else {
- array[arrayIndex] = sizes[index];
- arrayIndex++;
- } // if
- } // for
-
- } // insertEntries()
-
- /**
- * removeEntries
- * @param start TODO
- * @param length TODO
- */
- public void removeEntries(int start, int length) {
-
- // Variables
- int[] array;
- int index;
- int arrayIndex;
-
- // Sanity Check
- if ((start + length) > sizes.length) {
- throw new IllegalArgumentException("Specified start/length that " +
- "is greater than available sizes");
- } // if
-
- // Create New Array
- array = new int[sizes.length - length];
- arrayIndex = 0;
- for (index = 0; index < sizes.length; index++) {
- if (index == start) {
- index += length - 1;
- } else {
- array[arrayIndex] = sizes[index];
- arrayIndex++;
- } // if
- } // for
-
- } // removeEntries()
-
-
-} // SizeSequence
diff --git a/libjava/javax/swing/SortingFocusTraversalPolicy.java b/libjava/javax/swing/SortingFocusTraversalPolicy.java
deleted file mode 100644
index 48f864b5bd9..00000000000
--- a/libjava/javax/swing/SortingFocusTraversalPolicy.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/* SortingFocusTraversalPolicy.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.TreeSet;
-
-/**
- * @author Graydon Hoare
- * @author Michael Koch
- *
- * @since 1.4
- */
-public class SortingFocusTraversalPolicy
- extends InternalFrameFocusTraversalPolicy
-{
- /**
- * The comparator used to sort elements in the focus traversal cycle
- * managed by this class.
- */
- Comparator comparator;
-
- /**
- * <p>Whether or not to perform an "implicit DownCycle" when selecting
- * successor components within a focus cycle.</p>
- *
- * <p>When this is true, requesting the "next" component following a
- * component which is a focus cycle root (and, necessarily, a container)
- * will enter the focus cycle root of that container, and return its
- * default focus.</p>
- *
- * <p>When this property is false, requesting the "next" component will
- * simply advance within the containing focus cycle, subject to the
- * {@link #comparator} order and the {@link #accept} judgment.</p>
- *
- * @see #getNextFocusableComponent
- */
- boolean implicitDownCycleTraversal = true;
-
- /**
- * Creates a new <code>SortingFocusTraversalPolicy</code> with no
- * comparator set.
- */
- protected SortingFocusTraversalPolicy()
- {
- // Do nothing here.
- }
-
- /**
- * Creates a new <code>SortingFocusTraversalPolicy</code> with the given
- * comparator set.
- *
- * @param the comparator to set
- */
- public SortingFocusTraversalPolicy(Comparator comparator)
- {
- this.comparator = comparator;
- }
-
- /**
- * Decide whether a component is an acceptable focus owner.
- *
- * @param comp The component which is a candidate for focus ownership.
- *
- * @return true if the component is focusable, displayable, visible, and
- * enabled; otherwise false
- */
- protected boolean accept(Component comp)
- {
- return (comp.isVisible()
- && comp.isDisplayable()
- && comp.isEnabled()
- && comp.isFocusable());
- }
-
- /**
- * Get the current value of the {@link #comparator} property.
- *
- * @return the current value of the property
- *
- * @see #setComparator
- */
- protected Comparator getComparator()
- {
- return comparator;
- }
-
- /**
- * Set the current value of the {@link #comparator} property.
- *
- * @param comparator the new value of the property
- *
- * @see #getComparator
- */
- protected void setComparator(Comparator comparator)
- {
- this.comparator = comparator;
- }
-
- private TreeSet getSortedCycle(Container root, TreeSet set)
- {
- if (set == null)
- set = (getComparator() == null
- ? new TreeSet()
- : new TreeSet(getComparator()));
-
- if (root != null)
- {
- Component[] comps = root.getComponents();
- for (int i = 0; i < comps.length; ++i)
- {
- Component c = comps[i];
- if (accept(c))
- set.add(c);
- if (c instanceof Container)
- getSortedCycle((Container) c, set);
- }
- }
- return set;
- }
-
- /**
- * Return the component which follows the specified component in this
- * focus cycle, relative to the order imposed by {@link
- * #comparator}. Candidate components are only considered if they are
- * accepted by the {@link #accept} method.
- *
- * If {@link #getImplicitDownCycleTraversal} is <code>true</code> and the
- * <code>comp</code> is a focus cycle root, an "implicit DownCycle"
- * occurs and the method returns the
- * <code>getDefaultComponent(comp)</code>.
- *
- * @param root the focus cycle root to search for a successor within
- * @param comp the component to search for the successor of
- *
- * @return the component following the specified component under
- * the specified root, or null if no such component is found
- *
- * @throws IllegalArgumentException if either argument is null, or
- * if the root is not a focus cycle root of the component
- */
- public Component getComponentAfter(Container root,
- Component comp)
- {
- if (comp == null || root == null || !comp.isFocusCycleRoot(root))
- throw new IllegalArgumentException();
-
- if (getImplicitDownCycleTraversal()
- && comp instanceof Container
- && ((Container)comp).isFocusCycleRoot())
- {
- return getDefaultComponent((Container) comp);
- }
-
- TreeSet set = getSortedCycle(root, null);
- Iterator i = set.iterator();
- while (i.hasNext())
- {
- Component c = (Component) i.next();
- if (c != null && c.equals(comp))
- {
- if (i.hasNext())
- return (Component) i.next();
- break;
- }
- }
- return null;
- }
-
-
- /**
- * Return the component which precedes the specified component in this
- * focus cycle, relative to the order imposed by {@link
- * #comparator}. Candidate components are only considered if they are
- * accepted by the {@link #accept} method.
- *
- * @param root the focus cycle root to search for a predecessor within
- * @param comp the component to search for the predecessor of
- *
- * @return the component preceding the specified component under the
- * specified root, or null if no such component is found
- *
- * @throws IllegalArgumentException if either argument is null, or
- * if the root is not a focus cycle root of the component
- */
- public Component getComponentBefore(Container root,
- Component comp)
- {
- if (comp == null || root == null || !comp.isFocusCycleRoot(root))
- throw new IllegalArgumentException();
- TreeSet set = getSortedCycle(root, null);
- Iterator i = set.iterator();
- Component prev = null;
- while (i.hasNext())
- {
- Component c = (Component) i.next();
- if (c != null && c.equals(comp))
- break;
- prev = c;
- }
- return prev;
- }
-
- /**
- * Return the default component of <code>root</code>, which is by default
- * the same as the first component, returned by {@link
- * #getFirstComponent}.
- *
- * @param root the focus cycle root to return the default component of
- *
- * @return the default focus component for <code>root</code>
- *
- * @throws IllegalArgumentException if root is null
- */
- public Component getDefaultComponent(Container root)
- {
- return getFirstComponent(root);
- }
-
- /**
- * Return the first focusable component of the focus cycle root
- * <code>comp</code> under the ordering imposed by the {@link
- * #comparator} property. Candidate components are only considered if
- * they are accepted by the {@link #accept} method.
- *
- * @param root the focus cycle root to search for the first component of
- *
- * @return the first component under <code>root</code>, or null if
- * no components are found.
- *
- * @throws IllegalArgumentException if root is null
- */
- public Component getFirstComponent(Container root)
- {
- if (root == null)
- throw new IllegalArgumentException();
- TreeSet set = getSortedCycle(root, null);
- Iterator i = set.iterator();
- if (i.hasNext())
- return (Component) i.next();
- return null;
- }
-
- /**
- * Return the last focusable component of the focus cycle root
- * <code>comp</code> under the ordering imposed by the {@link
- * #comparator} property. Candidate components are only considered if
- * they are accepted by the {@link #accept} method.
- *
- * @param root the focus cycle root to search for the last component of
- *
- * @return the last component under <code>root</code>, or null if
- * no components are found.
- *
- * @throws IllegalArgumentException if root is null
- */
- public Component getLastComponent(Container root)
- {
- if (root == null)
- throw new IllegalArgumentException();
- TreeSet set = getSortedCycle(root, null);
- Iterator i = set.iterator();
- Component last = null;
- while (i.hasNext())
- last = (Component) i.next();
- return last;
- }
-
- /**
- * Return the current value of the {@link implicitDownCycleTraversal}
- * property.
- *
- * @return the current value of the property
- *
- * @see setImplicitDownCycleTraversal
- */
- public boolean getImplicitDownCycleTraversal()
- {
- return implicitDownCycleTraversal;
- }
-
- /**
- * Set the current value of the {@link implicitDownCycleTraversal}
- * property.
- *
- * @param down the new value of the property
- *
- * @see getImplicitDownCycleTraversal
- */
- public void setImplicitDownCycleTraversal(boolean down)
- {
- implicitDownCycleTraversal = down;
- }
-}
diff --git a/libjava/javax/swing/SpinnerDateModel.java b/libjava/javax/swing/SpinnerDateModel.java
deleted file mode 100644
index a02b400240d..00000000000
--- a/libjava/javax/swing/SpinnerDateModel.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 <code>null</code>
- * for no lower limit.
- * @param end - end limit, or <code>null</code> for no upper limit.
- * @param calendarField - the <code>Calendar</code> 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 <code>Date</code> object.
- */
- public Date getDate()
- {
- return date.getTime();
- }
-
- /**
- * Returns the starting limit of the SpinnerModel.
- * @return a Date object, or <code>null</code> if there is no limit.
- */
- public Comparable getStart()
- {
- return start;
- }
-
- /**
- * Returns the end limit of the SpinnerModel.
- * @return a Date object, or <code>null</code> if there is no limit.
- */
- public Comparable getEnd()
- {
- return end;
- }
-
- /**
- * Returns the current date in the sequence,
- * this method returns the same as <code>getDate()</code>.
- * @return a <code>Date</code> object.
- */
- public Object getValue()
- {
- return date.getTime();
- }
-
- /**
- * Returns the next date in the sequence, or <code>null</code> if the
- * next date is equal to or past the end limit.
- * @return a Date object, or <code>null</code>.
- */
- 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 <code>null</code> if the
- * next date is equal to or past the end limit.
- * @return a Date object, or <code>null</code>.
- */
- 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 <code>null</code> 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 <code>null</code> 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();
- }
-}
diff --git a/libjava/javax/swing/SpinnerListModel.java b/libjava/javax/swing/SpinnerListModel.java
deleted file mode 100644
index a0dc4d14462..00000000000
--- a/libjava/javax/swing/SpinnerListModel.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/* SpinnerListModel.java -- A spinner model backed by a list or an array.
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * An implementation of <code>SpinnerModel</code> which uses the values
- * contained within a list or an array. The backing list or array is
- * only stored as a reference within the class. As a result, changes
- * made elsewhere to the members of the list or array are reflected by
- * this model.
- * <p>
- *
- * The model itself inherits a list of <code>ChangeListener</code>s from
- * <code>AbstractSpinnerModel</code>. As this code is unaware of changes
- * made to the backing list or array, it is the responsibility of the
- * application using the model to invoke <code>fireStateChanged()</code>,
- * in order to notify any <code>ChangeListener</code>s, when the list or array
- * changes. The model handles notification when the reference itself
- * is changed via <code>setList()</code> or when the current value is
- * set directly using <code>setValue()</code>.
- *
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @see SpinnerModel
- * @see AbstractSpinnerModel
- * @see JSpinner
- * @since 1.4
- */
-
-public class SpinnerListModel
- extends AbstractSpinnerModel
- implements Serializable
-{
- /**
- * For compatability with Sun's JDK
- */
- private static final long serialVersionUID = 3358804052191994516L;
-
- /**
- * The backing list for this model.
- */
- private List list;
-
- /**
- * The current index in the list.
- */
- private transient int index;
-
- /**
- * Constructs a default <code>SpinnerListModel</code>. This
- * is a model backed by a list containing only the single
- * <code>String</code> element, "empty".
- */
- public SpinnerListModel()
- {
- List defaultList;
-
- /* Create an empty list */
- defaultList = new ArrayList();
- /* Add the string "empty" */
- defaultList.add("empty");
- /* Set the list */
- setList(defaultList);
- }
-
- /**
- * Constructs a <code>SpinnerListModel</code> using the supplied list.
- * The model maintains a reference to this list, and returns
- * consecutive elements in response to calls to <code>getNextValue()</code>.
- * The initial value is that at position 0, so an initial call
- * to <code>getValue()</code> returns the same as <code>list.get(0)</code>.
- *
- * @param list The list to use for this model.
- * @throws IllegalArgumentException if the list is null or contains no
- * elements.
- * @see SpinnerListModel#getNextValue()
- * @see SpinnerListModel#getValue()
- */
- public SpinnerListModel(List list)
- {
- /* Retain a reference to the valid list */
- setList(list);
- }
-
- /**
- * Constructs a <code>SpinnerListModel</code> using the supplied array.
- * The model stores a reference to the wrapper list returned by
- * <code>Arrays.asList()</code>. The wrapper list reflects modifications
- * in the underlying array, so these changes will also be reflected
- * by the model. The model produces consecutive elements from the array
- * in response to calls to <code>getNextValue()</code>. The initial
- * value returned by <code>getValue()</code> is the same as
- * <code>array[0]</code>.
- *
- * @param array The array to use for this model.
- * @throws IllegalArgumentException if the array is null or contains
- * no elements.
- * @see Arrays#asList(Object[])
- * @see SpinnerListModel#getNextValue()
- * @see SpinnerListModel#getValue()
- */
- public SpinnerListModel(Object[] array)
- {
- /* Check for a null or zero-sized array */
- if (array == null || array.length == 0)
- {
- throw new IllegalArgumentException("The supplied array was invalid.");
- }
- /*
- Retain a reference to a wrapper around the valid array
- The array, in list form, will be tested again here, but we can't really
- avoid this -- a null value to Arrays.asList will throw a NullPointerException
- */
- setList(Arrays.asList(array));
- }
-
- /**
- * Returns the backing list for this model.
- *
- * @return The backing list.
- */
- public List getList()
- {
- return list;
- }
-
- /**
- * Returns the next value from the list, which is the same as the element
- * stored at the current index + 1. Null is returned if there are no more
- * values to be returned (the end of the list has been reached). An
- * ambiguity can occur here, as null may also be returned as a valid list
- * element. This operation does not change the current value.
- *
- * @return The next value from the list or null.
- */
- public Object getNextValue()
- {
- /* Check for a next value */
- if (index < (list.size() - 1))
- {
- /* Return the element at the next index */
- return list.get(index + 1);
- }
- else
- {
- /* Return null as this is the end of the list */
- return null;
- }
- }
-
- /**
- * Returns the previous value from the list, which is the same as the element
- * stored at the current index - 1. Null is returned if there are no more
- * values to be returned (the start of the list has been reached). An
- * ambiguity can occur here, as null may also be returned as a valid list
- * element. This operation does not change the current value.
- *
- * @return The previous value from the list or null.
- */
- public Object getPreviousValue()
- {
- /* Check for a previous value. */
- if (index > 0)
- {
- /* Return the element at the previous position */
- return list.get(index - 1);
- }
- else
- {
- /* Return null as this is the start of the list */
- return null;
- }
- }
-
- /**
- * Returns the current value of the model. Initially, this will
- * be the element at position 0. On later invocations, this will
- * be the last element returned by <code>getNextValue()</code>
- * or <code>getPreviousValue()</code>.
- *
- * @return The current value.
- * @see SpinnerListModel#getPreviousValue()
- * @see SpinnerListModel#getNextValue()
- */
- public Object getValue()
- {
- return list.get(index);
- }
-
- /**
- * Changes the backing list for this model. The model only stores
- * a reference to the list, so any changes made to the list elsewhere
- * will be reflected in the values returned by the model. A
- * <code>ChangeEvent</code> is fired if the list being used actually
- * changes (i.e. the new list is not referentially equal (!=) to the
- * old one).
- *
- * @param list The new list to use.
- * @throws IllegalArgumentException if the list is null or contains
- * no elements.
- * @see ChangeEvent
- */
- public void setList(List list)
- {
- /* Check for null or zero size list */
- if (list == null || list.size() == 0)
- {
- throw new IllegalArgumentException("The supplied list was invalid.");
- }
- /* Check for a change of referenced list */
- if (this.list != list)
- {
- /* Store the new list */
- this.list = list;
- /* Notify listeners of a change */
- fireStateChanged();
- }
- /* We reset the other values in either case */
- /* Set the index to 0 */
- index = 0;
- }
-
- /**
- * Sets the current value of the model to be the one supplied.
- * The value must exist within the backing list in order for
- * the change to take place. Otherwise, an exception is thrown.
- * The value used is the first occurrence of the value within
- * the backing list. Listeners are notified of this change.
- * Following the change, <code>getNextValue()</code> and
- * <code>getPreviousValue()</code> return the objects following
- * and prior to the supplied value, respectively.
- *
- * @param value The requested new value of the list.
- * @throws IllegalArgumentException if the supplied value does
- * not exist in the backing list.
- * @see SpinnerListModel#getPreviousValue()
- * @see SpinnerListModel#getNextValue()
- */
- public void setValue(Object value)
- {
- int valueIndex;
-
- /* Search for the value in the list */
- valueIndex = list.indexOf(value);
- /* Check for the value being found */
- if (valueIndex == -1)
- {
- throw new IllegalArgumentException("The supplied value does not "
- + "exist in this list");
- }
- /* Make the indices match */
- index = valueIndex;
- /* Notify the listeners */
- fireStateChanged();
- }
-
-}
diff --git a/libjava/javax/swing/SpinnerModel.java b/libjava/javax/swing/SpinnerModel.java
deleted file mode 100644
index 4f8426ba7c6..00000000000
--- a/libjava/javax/swing/SpinnerModel.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* SpinnerModel.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 javax.swing.event.ChangeListener;
-
-/**
- * @since 1.4
- */
-public interface SpinnerModel
-{
- /**
- * Sets the current value of the model to that specified.
- * Implementations can choose to refuse to accept the value
- * and throw an exception instead. For example, a date model
- * may throw invalid dates, or a list model may throw out
- * values which don't exist in the underlying list. Models
- * may also throw out unusual values, such as null. The decision
- * is left to the discretion of the implementator. If the
- * operation succeeds, the implementation should also notify
- * any registered <code>ChangeListener</code>s.
- *
- * @param value The new value of the model.
- * @throws IllegalArgumentException if the model does not accept
- * the given value.
- */
- void setValue(Object value);
-
- /**
- * Returns the current value of the model.
- *
- * @return The current value.
- */
- Object getValue();
-
- /**
- * Returns the next value from the model. If the model is bounded,
- * this method may return null when the upper bound is met.
- * The current value is not changed.
- *
- * @return The next value, or null if there are no more values
- * to retrieve.
- */
- Object getNextValue();
-
- /**
- * Returns the previous value from the model. If the model is
- * bounded, this method may return null when the lower bound is
- * met. The current value is not changed.
- *
- * @return The previous value, or null if there are no more
- * values to retrieve.
- */
- Object getPreviousValue();
-
- /**
- * Adds a <code>ChangeListener</code> to the list of registered
- * listeners. Each listener is notified when the current value
- * is changed.
- *
- * @param listener The new listener to register.
- */
- void addChangeListener(ChangeListener listener);
-
- /**
- * Removes a given <code>ChangeListener</code> from the list
- * of registered listeners.
- *
- * @param listener The listener to remove.
- */
- void removeChangeListener(ChangeListener listener);
-
-}
diff --git a/libjava/javax/swing/SpinnerNumberModel.java b/libjava/javax/swing/SpinnerNumberModel.java
deleted file mode 100644
index 2274c9ec038..00000000000
--- a/libjava/javax/swing/SpinnerNumberModel.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/* SpinnerNumberModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * SpinnerNumberModel
- *
- * @author Ka-Hing Cheung
- * @version 1.0
- */
-public class SpinnerNumberModel extends AbstractSpinnerModel
- implements Serializable
-{
- /**
- * For compatability with Sun's JDK
- */
- private static final long serialVersionUID = 7279176385485777821L;
-
- /** DOCUMENT ME! */
- private Number value;
-
- /** DOCUMENT ME! */
- private Comparable minimum;
-
- /** DOCUMENT ME! */
- private Comparable maximum;
-
- /** DOCUMENT ME! */
- private Number stepSize;
-
- /**
- * Creates a <code>SpinnerNumberModel</code> with initial value 0, step 1,
- * and no maximum nor minimum.
- */
- public SpinnerNumberModel()
- {
- this(new Integer(0), null, null, new Integer(1));
- }
-
- /**
- * Creates a <code>SpinnerNumberModel</code> with double precision
- *
- * @param value the initial value
- * @param minimum the minimum value
- * @param maximum the maximum value
- * @param stepSize the step size
- * @throws IllegalArgumentException if minimum &lt;= value &lt;= maximum does not
- * hold
- */
- public SpinnerNumberModel(double value, double minimum, double maximum,
- double stepSize)
- {
- this(new Double(value), new Double(minimum), new Double(maximum),
- new Double(stepSize));
- }
-
- /**
- * Creates a <code>SpinnerNumberModel</code> with integer precision
- *
- * @param value the initial value
- * @param minimum the minimum value
- * @param maximum the maximum value
- * @param stepSize the step size
- * @throws IllegalArgumentException if minimum &lt;= value &lt;= maximum does not
- * hold
- */
- public SpinnerNumberModel(int value, int minimum, int maximum, int stepSize)
- {
- this(new Integer(value), new Integer(minimum), new Integer(maximum),
- new Integer(stepSize));
- }
-
- /**
- * Creates a <code>SpinnerNumberModel</code> with <code>Number</code>s and
- * <code>Comparable</code>s.
- *
- * @param value the initial value
- * @param minimum the minimum value, if null there's no minimum
- * @param maximum the maximum value, if null there's no maximum
- * @param stepSize the step size
- *
- * @throws IllegalArgumentException if minimum &lt;= value &lt;= maximum
- * does not hold
- */
- public SpinnerNumberModel(Number value, Comparable minimum,
- Comparable maximum, Number stepSize)
- {
- if (stepSize == null)
- throw new IllegalArgumentException("stepSize may not be null");
- if (value == null)
- throw new IllegalArgumentException("value may not be null");
- if (minimum != null)
- {
- if (minimum.compareTo(value) > 0)
- throw new IllegalArgumentException("minimum is not <= value");
- }
- else
- minimum = new Comparable()
- {
- public int compareTo(Object obj)
- {
- return -1;
- }
- };
-
-
- if (maximum != null)
- {
- if (maximum.compareTo(value) < 0)
- throw new IllegalArgumentException("maximum is not >= value");
- }
- else
- maximum = new Comparable()
- {
- public int compareTo(Object obj)
- {
- return 1;
- }
- };
-
-
- this.value = value;
- this.stepSize = stepSize;
- this.minimum = minimum;
- this.maximum = maximum;
- }
-
- /**
- * Sets the new value and fire a change event
- *
- * @param value the new value
- *
- * @throws IllegalArgumentException if minimum &lt;= value &lt;= maximum
- * does not hold
- */
- public void setValue(Object value)
- {
- if (! (value instanceof Number))
- throw new IllegalArgumentException("value must be a Number");
-
- this.value = (Number) value;
- fireStateChanged();
- }
-
- /**
- * Gets the current value
- *
- * @return the current value
- */
- public Object getValue()
- {
- return value;
- }
-
- /**
- * Gets the next value without changing the current value, or null if the
- * current value is maximum.
- *
- * @return the next value
- */
- public Object getNextValue()
- {
- Number num;
-
- if (value instanceof Double)
- num = new Double(value.doubleValue() + stepSize.doubleValue());
- else if (value instanceof Float)
- num = new Double(value.floatValue() + stepSize.floatValue());
- else if (value instanceof Long)
- num = new Long(value.longValue() + stepSize.longValue());
- else if (value instanceof Integer)
- num = new Integer(value.intValue() + stepSize.intValue());
- else if (value instanceof Short)
- num = new Short((short) (value.shortValue() + stepSize.shortValue()));
- else
- num = new Byte((byte) (value.byteValue() + stepSize.byteValue()));
-
- return maximum.compareTo(num) >= 0 ? num : null;
- }
-
- /**
- * Gets the previous value without changing the current value, or null if
- * the current value is minimum.
- *
- * @return the previous value
- */
- public Object getPreviousValue()
- {
- Number num;
-
- if (value instanceof Double)
- num = new Double(value.doubleValue() - stepSize.doubleValue());
- else if (value instanceof Float)
- num = new Double(value.floatValue() - stepSize.floatValue());
- else if (value instanceof Long)
- num = new Long(value.longValue() - stepSize.longValue());
- else if (value instanceof Integer)
- num = new Integer(value.intValue() - stepSize.intValue());
- else if (value instanceof Short)
- num = new Short((short) (value.shortValue() - stepSize.shortValue()));
- else
- num = new Byte((byte) (value.byteValue() - stepSize.byteValue()));
-
- return minimum.compareTo(num) <= 0 ? num : null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Number getNumber()
- {
- return value;
- }
-
- public Comparable getMinimum()
- {
- return minimum;
- }
-
- public void setMinimum(Comparable newMinimum)
- {
- if (minimum != newMinimum)
- {
- minimum = newMinimum;
- fireStateChanged();
- }
- }
-
- public Comparable getMaximum()
- {
- return maximum;
- }
-
- public void setMaximum(Comparable newMaximum)
- {
- if (maximum != newMaximum)
- {
- maximum = newMaximum;
- fireStateChanged();
- }
- }
-
- public Number getStepSize()
- {
- return stepSize;
- }
-
- public void setStepSize(Number newStepSize)
- {
- if (newStepSize == null)
- throw new IllegalArgumentException();
-
- if (stepSize != newStepSize)
- {
- stepSize = newStepSize;
- fireStateChanged();
- }
- }
-}
diff --git a/libjava/javax/swing/Spring.java b/libjava/javax/swing/Spring.java
deleted file mode 100644
index 4255e86f8e6..00000000000
--- a/libjava/javax/swing/Spring.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/* Spring.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * Calculates the space between component edges, that are layed out by
- * {@link SpringLayout}.
- * <p>
- * A Spring defines a minimum, preferred and maximum distance for each edge
- * (north, east, south, west) of a component.
- * </p>
- * However, springs are not static, their actual values are computed at
- * runtime. That means, if a Spring C is defined as the sum of Spring A and
- * Spring B, then the values (min, pref and max) are not calculated at
- * creation of Spring C, but instead always when {@link #getValue} is
- * called. So, when Spring A or Spring B changes, this is reflected in
- * Spring C.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
-public abstract class Spring
-{
-
- /** Indicates a not-set value. **/
- public static final int UNSET = -2147483648;
-
- /**
- * Creates a new Spring object. This constructor is used by the static
- * methods which create Springs.
- */
- protected Spring()
- {
- }
-
- /**
- * Creates a Spring which min, pref and max values are all the same.
- * These kind of Springs are 'struts'.
- *
- * @param val the constant for min, pref and max values.
- * @return a Spring object with constant values for min, pref and max.
- */
- public static Spring constant(int val)
- {
- return new SimpleSpring(val, val, val);
- }
-
- /** Creates a Spring which min, pref and max values are constants.
- * @param min the constant for the minimum value.
- * @param pref the constant for the preferred value.
- * @param max the constant for the maximum value.
- * @return a Spring object with constant values for min, pref and max.
- */
- public static Spring constant(int min, int pref, int max)
- {
- return new SimpleSpring(min, pref, max);
- }
-
- /**
- * Returns the maximum value of the Spring.
- *
- * @return the maximum value.
- */
- public abstract int getMaximumValue();
-
- /**
- * Returns the minimum value of this Spring.
- *
- * @return the minimum value.
- */
- public abstract int getMinimumValue();
-
- /**
- * Return the preferred value of this Spring.
- *
- * @return the preferred value.
- */
- public abstract int getPreferredValue();
-
- /**
- * Return the actual value of this Spring.
- *
- * @return the actual value of this Spring.
- */
- public abstract int getValue();
-
- /**
- * Creates and returns a Spring, which always has the maximum values
- * min = max(min_s1, min_s2), pref = max(pref_s1, pref_s2), max =
- * max(max_s1, max_s2).
- *
- * @param s1 the first summand of the max Spring.
- * @param s2 the second summand of the max Spring.
- * @return a Spring which is max(s1, s2).
- */
- public static Spring max(Spring s1, Spring s2)
- {
- return new MaxSpring(s1, s2);
- }
-
- /**
- * Creates and returns a Spring, which is always the negation of s.
- * min = -min_s, pref = -pref_s, max = -max_pref.
- *
- * @param s the Spring to be negated.
- * @return the negative of <code>s</code>.
- */
- public static Spring minus(Spring s)
- {
- return new MinusSpring(s);
- }
-
- /**
- * Sets the actual value. If <code>value</code> is out of the (min, max)
- * bounds, then the value is adjusted, so that is inside these bounds.
- *
- * @param value the value to be set.
- */
- public abstract void setValue(int value);
-
- /**
- * Creates and returns a Spring, which is always the sum of s1 and s2.
- * min_sum = min_s1 + min_s2, pref_sum = pref_s1 + pref_s2, max_sum =
- * max_s1 + max_s2.
- *
- * @param s1 the 1st summand of the sum Spring.
- * @param s2 the 2nd summand of the sum Spring.
- * @return a sum which is <code>s1 + s2</code>.
- */
- public static Spring sum(Spring s1, Spring s2)
- {
- return new AddSpring(s1, s2);
- }
-
- /**
- * A simple Spring, that holds constant values for min, pref and max.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
- private static final class SimpleSpring extends Spring
- {
-
- /** The constant value for min. */
- private final int min;
-
- /** The constant value for pref. */
- private final int pref;
-
- /** The constant value for max. */
- private final int max;
-
- /** The actual value of the spring. */
- private int value;
-
- /**
- * Creates a new SimpleSpring object.
- *
- * @param min the constant minimum value.
- * @param pref the constant preferred value.
- * @param max the constant maximum value.
- */
- public SimpleSpring(int newMin, int newPref, int newMax)
- {
- min = newMin;
- pref = newPref;
- max = newMax;
- value = Spring.UNSET;
- }
-
- /**
- * Returns the maximum value of this Spring.
- *
- * @return the maximum value.
- */
- public int getMaximumValue()
- {
- return max;
- }
-
- /**
- * Returns the minimum value of this Spring.
- *
- * @return the minimum value.
- */
- public int getMinimumValue()
- {
- return min;
- }
-
- /**
- * Returns the preferred value of this Spring.
- *
- * @return the preferred value.
- */
- public int getPreferredValue()
- {
- return pref;
- }
-
- /**
- * Return the actual current value of this Spring.
- *
- * @return the current value.
- */
- public int getValue()
- {
-
- if (value == Spring.UNSET)
- {
- value = pref;
- }
-
- return value;
- }
-
- /**
- * Sets the current value.
- *
- * @param val the value to be set.
- */
- public void setValue(int val)
- {
-
- if (val > max)
- {
- value = max;
- }
- else if (val < min)
- {
- value = min;
- }
- else
- {
- value = val;
- }
- }
-
- }
-
-
- /**
- * A Spring, that is the sum of two other Springs.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
- private static final class AddSpring extends Spring
- {
-
- /** The springs, that are the 'operands' of this Spring. */
- private final Spring s1;
- private final Spring s2;
-
- /** The current value for this Spring. */
- private int value;
-
- /**
- * Creates a new AddSpring object.
- *
- * @param s1 the first operand.
- * @param s2 the second operand.
- */
- protected AddSpring(Spring s1, Spring s2)
- {
- super();
- this.s1 = s1;
- this.s2 = s2;
- value = Spring.UNSET;
- }
-
- /**
- * Returns the maximum value of this Spring.
- *
- * @return the maximum value.
- */
- public int getMaximumValue()
- {
- int max1 = s1.getMaximumValue();
- int max2 = s2.getMaximumValue();
- return max1 + max2;
- }
-
- /**
- * Return the minimum value of this Spring.
- *
- * @return the minimum value.
- */
- public int getMinimumValue()
- {
- int min1 = s1.getMinimumValue();
- int min2 = s2.getMinimumValue();
- return min1 + min2;
- }
-
- /**
- * Returns the preferred value of this Spring.
- *
- * @return the preferred value.
- */
- public int getPreferredValue()
- {
- int pref1 = s1.getPreferredValue();
- int pref2 = s2.getPreferredValue();
- return pref1 + pref2;
- }
-
- /**
- * Returns the actual current value of this Spring.
- *
- * @return the current value of this Spring.
- */
- public int getValue()
- {
- if (value == Spring.UNSET)
- {
- int val1 = s1.getValue();
- int val2 = s2.getValue();
- value = val1 + val2;
- }
- return value;
- }
-
- /**
- * Sets the current value.
- *
- * @param val the value to be set.
- */
- public void setValue(int val)
- {
-
- if (val > getMaximumValue())
- {
- value = getMaximumValue();
- }
- else if (val < getMinimumValue())
- {
- value = getMinimumValue();
- }
- else
- {
- value = val;
- }
-
- }
-
- }
-
-
- /**
- * A Spring that is calculated as the negation of another Spring.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
- private static final class MinusSpring extends Spring
- {
-
- /** The Spring from which to calculate the negation. */
- private final Spring s;
-
- /** The current value of this Spring. */
- private int value;
-
- /**
- * Creates a new MinusSpring object.
- * @param s the Spring from which to calculate the negation.
- */
- protected MinusSpring(Spring s)
- {
- super();
- this.s = s;
- value = Spring.UNSET;
- }
-
- /** Returns the maximum value of this Spring.
- *
- * @return the maximum value.
- */
- public int getMaximumValue()
- {
- return -s.getMinimumValue();
- }
-
- /**
- * Returns the minimum value of this Spring.
- *
- * @return the minimum value.
- */
- public int getMinimumValue()
- {
- return -s.getMaximumValue();
- }
-
- /**
- * Returns the preferred value of this Spring.
- *
- * @return the preferred value.
- */
- public int getPreferredValue()
- {
- return -s.getPreferredValue();
- }
-
- /**
- * Returns the current value of this Spring.
- *
- * @return the current value.
- */
- public int getValue()
- {
- if (value == Spring.UNSET)
- {
- value = -s.getValue();
- }
- return value;
- }
-
- /**
- * Sets the current value.
- *
- * @param val the value to be set.
- */
- public void setValue(int val)
- {
-
- if (val > getMaximumValue())
- {
- value = getMaximumValue();
- }
- else if (val < getMinimumValue())
- {
- value = getMinimumValue();
- }
- else
- {
- value = val;
- }
-
- }
-
- }
-
-
- /**
- * A Spring, that is calculated as the maximum of two Springs.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
- private static final class MaxSpring extends Spring
- {
-
- /** The two other Springs from which to calculate the maximum. */
- private final Spring s1;
- private final Spring s2;
-
- /** The current value of this Spring. */
- private int value;
-
- /**
- * Creates a new MaxSpring object.
- *
- * @param s1 the 1st operand.
- * @param s2 the 2nd operand.
- */
- protected MaxSpring(Spring s1, Spring s2)
- {
- super();
- this.s1 = s1;
- this.s2 = s2;
- value = Spring.UNSET;
- }
-
-
- /**
- * Returns the maximum value of this Spring.
- *
- * @return the maximum value.
- */
- public int getMaximumValue()
- {
- int max1 = s1.getMaximumValue();
- int max2 = s2.getMaximumValue();
- return Math.max(max1, max2);
- }
-
- /**
- * Returns the minimum value of this Spring.
- *
- * @return the minimum value.
- */
- public int getMinimumValue()
- {
- int min1 = s1.getMinimumValue();
- int min2 = s2.getMinimumValue();
- return Math.max(min1, min2);
- }
-
- /**
- * Returns the preferred value of this Spring.
- *
- * @return the preferred value.
- */
- public int getPreferredValue()
- {
- int pref1 = s1.getPreferredValue();
- int pref2 = s2.getPreferredValue();
- return Math.max(pref1, pref2);
- }
-
- /**
- * Returns the actual value of this Spring.
- *
- * @return the current value.
- */
- public int getValue()
- {
- if (value == Spring.UNSET)
- {
- int val1 = s1.getValue();
- int val2 = s2.getValue();
- value = Math.max(val1, val2);
- }
- return value;
- }
-
- /**
- * Sets the current value.
- *
- * @param val the value to be set.
- */
- public void setValue(int val)
- {
-
- if (val > getMaximumValue())
- {
- value = getMaximumValue();
- }
- else if (val < getMinimumValue())
- {
- value = getMinimumValue();
- }
- else
- {
- value = val;
- }
- }
- }
-}
diff --git a/libjava/javax/swing/SpringLayout.java b/libjava/javax/swing/SpringLayout.java
deleted file mode 100644
index b45edba5357..00000000000
--- a/libjava/javax/swing/SpringLayout.java
+++ /dev/null
@@ -1,657 +0,0 @@
-/* SpringLayout.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.LayoutManager2;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A very flexible layout manager. Components are laid out by defining the
- * relationships between them. The relationships are expressed as
- * {@link Spring}s. You can attach a Spring for each edge of a component and
- * link it to an edge of a different component. For example, you can say,
- * the northern edge of component A should be attached to the southern edge
- * of component B, and the space between them should be something between
- * x and y pixels, and preferably z pixels.
- * <p>While quite simple, this layout manager can be used to emulate most other
- * layout managers, and can also be used to solve some layout problems, which
- * would be hard to solve with other layout managers.</p>
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
-public class SpringLayout implements LayoutManager2
-{
-
- /** The right edge of a component. */
- public static final String EAST = "East";
-
- /** The top edge of a component. */
- public static final String NORTH = "North";
-
- /** The bottom edge of a component. */
- public static final String SOUTH = "South";
-
- /** The left edge of a component. */
- public static final String WEST = "West";
-
- /** maps components to their constraints. */
- private Map constraintsMap;
-
- /**
- * The constraints that define the relationships between components.
- * Each Constraints object can hold 4 Springs: one for each edge of the
- * component. Additionally it can hold Springs for the components width
- * and the components height. Since the height and width constraints are
- * dependend on the other constraints, a component can be over-constraint.
- * In this case (like when all of NORTH, SOUTH and HEIGHT are constraint),
- * the values are adjusted, so that the mathematics still hold true.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
- public static class Constraints
- {
-
- // The constraints for each edge, and width and height.
- /** The Spring for the left edge. */
- private Spring x;
-
- /** The Spring for the upper edge. */
- private Spring y;
-
- /** The Spring for the height. */
- private Spring height;
-
- /** The Spring for the width. */
- private Spring width;
-
- /** The Spring for the right edge. */
- private Spring east;
-
- /** The Spring for the bottom edge. */
- private Spring south;
-
- /**
- * Creates a new Constraints object.
- * There is no constraint set.
- */
- public Constraints()
- {
- x = y = height = width = east = south = null;
- }
-
- /**
- * Creates a new Constraints object.
- *
- * @param x the constraint for the left edge of the component.
- * @param y the constraint for the upper edge of the component.
- */
- public Constraints(Spring x, Spring y)
- {
- this.x = x;
- this.y = y;
- width = height = east = south = null;
- }
-
- /**
- * Creates a new Constraints object.
- *
- * @param x the constraint for the left edge of the component.
- * @param y the constraint for the upper edge of the component.
- * @param width the constraint for the width of the component.
- * @param height the constraint for the height of the component.
- */
- public Constraints(Spring x, Spring y, Spring width, Spring height)
- {
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- east = south = null;
- }
-
- /**
- * Returns the constraint for the edge with the <code>edgeName</code>.
- * This is expected to be one of
- * {@link #EAST}, {@link #WEST}, {@link NORTH} or {@link SOUTH}.
- *
- * @param edgeName the name of the edge.
- * @return the constraint for the specified edge.
- */
- public Spring getConstraint(String edgeName)
- {
- Spring retVal = null;
- if (edgeName.equals(SpringLayout.NORTH))
- retVal = y;
- else if (edgeName.equals(SpringLayout.WEST))
- retVal = x;
- else if (edgeName.equals(SpringLayout.SOUTH))
- {
- retVal = south;
- if ((retVal == null) && (y != null) && (height != null))
- retVal = Spring.sum(y, height);
- }
- else if (edgeName.equals(SpringLayout.EAST))
- {
- retVal = east;
- if ((retVal == null) && (x != null) && (width != null))
- retVal = Spring.sum(x, width);
- }
-
- return retVal;
- }
-
- /**
- * Returns the constraint for the height of the component.
- *
- * @return the height constraint.
- */
- public Spring getHeight()
- {
- Spring retVal = height;
- if ((retVal == null) && (y != null) && (south != null))
- {
- retVal = Spring.sum(south, Spring.minus(y));
- }
- return retVal;
- }
-
- /**
- * Returns the constraint for the width of the component.
- *
- * @return the width constraint.
- */
- public Spring getWidth()
- {
- Spring retVal = width;
- if ((retVal == null) && (x != null) && (east != null))
- {
- retVal = Spring.sum(east, Spring.minus(x));
- }
- return retVal;
- }
-
- /**
- * Returns the constraint for the left edge of the component.
- *
- * @return the left-edge constraint (== WEST).
- */
- public Spring getX()
- {
- Spring retVal = x;
- if ((retVal == null) && (width != null) && (east != null))
- {
- retVal = Spring.sum(east, Spring.minus(width));
- }
- return retVal;
- }
-
- /**
- * Returns the constraint for the upper edge of the component.
- *
- * @return the upper-edge constraint (== NORTH).
- */
- public Spring getY()
- {
- Spring retVal = y;
- if ((retVal == null) && (height != null) && (south != null))
- {
- retVal = Spring.sum(south, Spring.minus(height));
- }
- return retVal;
- }
-
- /**
- * Sets a constraint for the specified edge. If this leads to an
- * over-constrained situation, the constraints get adjusted, so that
- * the mathematics still hold true.
- *
- * @param edgeName the name of the edge, one of {@link #EAST},
- * {@link #WEST}, {@link NORTH} or {@link SOUTH}.
- * @param s the constraint to be set.
- */
- public void setConstraint(String edgeName, Spring s)
- {
-
- if (edgeName.equals(SpringLayout.WEST))
- {
- x = s;
- if ((width != null) && (east != null))
- width = Spring.sum(east, Spring.minus(x));
- }
- else if (edgeName.equals(SpringLayout.NORTH))
- {
- y = s;
- if ((height != null) && (south != null))
- height = Spring.sum(south, Spring.minus(y));
- }
- else if (edgeName.equals(SpringLayout.EAST))
- {
- east = s;
- if ((x != null) && (width != null))
- x = Spring.sum(east, Spring.minus(width));
- }
- else if (edgeName.equals(SpringLayout.SOUTH))
- {
- south = s;
- if ((height != null) && (y != null))
- y = Spring.sum(south, Spring.minus(height));
- }
-
- }
-
- /**
- * Sets the height-constraint.
- *
- * @param s the constraint to be set.
- */
- public void setHeight(Spring s)
- {
- height = s;
- if ((south != null) && (y != null))
- south = Spring.sum(y, height);
-
- }
-
- /**
- * Sets the width-constraint.
- *
- * @param s the constraint to be set.
- */
- public void setWidth(Spring s)
- {
- width = s;
- if ((east != null) && (x != null))
- east = Spring.sum(x, width);
-
- }
-
- /**
- * Sets the WEST-constraint.
- *
- * @param s the constraint to be set.
- */
- public void setX(Spring s)
- {
- x = s;
- if ((width != null) && (east != null))
- width = Spring.sum(east, Spring.minus(x));
-
- }
-
- /**
- * Sets the NORTH-constraint.
- *
- * @param s the constraint to be set.
- */
- public void setY(Spring s)
- {
- y = s;
- if ((height != null) && (south != null))
- height = Spring.sum(south, Spring.minus(y));
-
- }
- }
-
- /**
- * Creates a new SpringLayout.
- */
- public SpringLayout()
- {
-
- constraintsMap = new HashMap();
- }
-
- /**
- * Adds a layout component and a constraint object to this layout.
- * This method is usually only called by a {@java.awt.Container}s add
- * Method.
- *
- * @param component the component to be added.
- * @param constraint the constraint to be set.
- */
- public void addLayoutComponent(Component component, Object constraint)
- {
- constraintsMap.put(component, constraint);
- }
-
-
- /**
- * Adds a layout component and a constraint object to this layout.
- * This method is usually only called by a {@java.awt.Container}s add
- * Method. This method does nothing, since SpringLayout does not manage
- * String-indexed components.
- *
- * @param component the component to be added.
- * @param constraint the constraint to be set.
- */
- public void addLayoutComponent(String name, Component c)
- {
- // do nothing here.
- }
-
- /**
- * Returns the constraint of the edge named by <code>edgeName</code>.
- *
- * @param c the component from which to get the constraint.
- * @param edgeName the name of the edge, one of {@link #EAST},
- * {@link #WEST}, {@link NORTH} or {@link SOUTH}.
- * @return the constraint of the edge <code>edgeName</code> of the
- * component c.
- */
- public Spring getConstraint(String edgeName, Component c)
- {
- Constraints constraints = getConstraints(c);
- return constraints.getConstraint(edgeName);
- }
-
- /**
- * Returns the {@link Constraints} object associated with the specified
- * component.
- *
- * @param c the component for which to determine the constraint.
- * @return the {@link Constraints} object associated with the specified
- * component.
- */
- public SpringLayout.Constraints getConstraints(Component c)
- {
- Constraints constraints = (Constraints) constraintsMap.get(c);
- if (constraints == null)
- {
- Container parent = c.getParent();
- constraints = new Constraints();
- if (parent != null)
- {
- constraints.setX
- (Spring.constant(parent.getInsets().left));
- constraints.setY
- (Spring.constant(parent.getInsets().top));
- }
- else
- {
- constraints.setX
- (Spring.constant(0));
- constraints.setY
- (Spring.constant(0));
-
- }
- constraints.setWidth
- (Spring.constant(c.getMinimumSize().width,
- c.getPreferredSize().width,
- c.getMaximumSize().width));
- constraints.setHeight
- (Spring.constant(c.getMinimumSize().height,
- c.getPreferredSize().height,
- c.getMaximumSize().height));
-
- constraintsMap.put(c, constraints);
-
- }
-
- return constraints;
- }
-
- /**
- * Returns the X alignment of the Container <code>p</code>.
- *
- * @param p the {@link java.awt.Container} for which to determine the X
- * alignment.
- * @return always 0.0
- */
- public float getLayoutAlignmentX(Container p)
- {
- return 0.0F;
- }
-
- /**
- * Returns the Y alignment of the Container <code>p</code>.
- *
- * @param p the {@link java.awt.Container} for which to determine the Y
- * alignment.
- * @return always 0.0
- */
- public float getLayoutAlignmentY(Container p)
- {
- return 0.0F;
- }
-
- /**
- * Recalculate a possibly cached layout.
- */
- public void invalidateLayout(Container p)
- {
- // nothing to do here yet
- }
-
- /**
- * Lays out the container <code>p</code>.
- *
- * @param p the container to be laid out.
- */
- public void layoutContainer(Container p)
- {
-
- addLayoutComponent(p, new Constraints(Spring.constant(0),
- Spring.constant(0)));
-
- int offsetX = p.getInsets().left;
- int offsetY = p.getInsets().right;
-
- Component[] components = p.getComponents();
- for (int index = 0; index < components.length; index++)
- {
- Component c = components[index];
- Constraints constraints = getConstraints(c);
- int x = constraints.getX().getValue();
- int y = constraints.getY().getValue();
- int width = constraints.getWidth().getValue();
- int height = constraints.getHeight().getValue();
-
- c.setLocation(x + offsetX, y + offsetY);
- c.setSize(width, height);
- }
-
- }
-
- /**
- * Calculates the maximum size of the layed out container. This
- * respects the maximum sizes of all contained components.
- *
- * @param p the container to be laid out.
- * @return the maximum size of the container.
- */
- public Dimension maximumLayoutSize(Container p)
- {
- int maxX = 0;
- int maxY = 0;
-
- int offsetX = p.getInsets().left;
- int offsetY = p.getInsets().right;
-
- Component[] components = p.getComponents();
- for (int index = 0; index < components.length; index++)
- {
- Component c = components[index];
- Constraints constraints = getConstraints(c);
- int x = constraints.getX().getMaximumValue();
- int y = constraints.getY().getMaximumValue();
- int width = constraints.getWidth().getMaximumValue();
- int height = constraints.getHeight().getMaximumValue();
-
- int rightEdge = offsetX + x + width;
- if (rightEdge > maxX)
- maxX = rightEdge;
- int bottomEdge = offsetY + y + height;
- if (bottomEdge > maxY)
- maxY = bottomEdge;
- }
-
- return new Dimension(maxX, maxY);
- }
-
-
- /**
- * Calculates the minimum size of the layed out container. This
- * respects the minimum sizes of all contained components.
- *
- * @param p the container to be laid out.
- * @return the minimum size of the container.
- */
- public Dimension minimumLayoutSize(Container p)
- {
- int maxX = 0;
- int maxY = 0;
-
- int offsetX = p.getInsets().left;
- int offsetY = p.getInsets().right;
-
- Component[] components = p.getComponents();
- for (int index = 0; index < components.length; index++)
- {
- Component c = components[index];
- Constraints constraints = getConstraints(c);
- int x = constraints.getX().getMinimumValue();
- int y = constraints.getY().getMinimumValue();
- int width = constraints.getWidth().getMinimumValue();
- int height = constraints.getHeight().getMinimumValue();
-
- int rightEdge = offsetX + x + width;
- if (rightEdge > maxX)
- maxX = rightEdge;
- int bottomEdge = offsetY + y + height;
- if (bottomEdge > maxY)
- maxY = bottomEdge;
- }
-
- return new Dimension(maxX, maxY);
- }
-
- /**
- * Calculates the preferred size of the layed out container. This
- * respects the preferred sizes of all contained components.
- *
- * @param p the container to be laid out.
- * @return the preferred size of the container.
- */
- public Dimension preferredLayoutSize(Container p)
- {
- int maxX = 0;
- int maxY = 0;
-
- int offsetX = p.getInsets().left;
- int offsetY = p.getInsets().right;
-
- Component[] components = p.getComponents();
- for (int index = 0; index < components.length; index++)
- {
- Component c = components[index];
- Constraints constraints = getConstraints(c);
- int x = constraints.getX().getPreferredValue();
- int y = constraints.getY().getPreferredValue();
- int width = constraints.getWidth().getPreferredValue();
- int height = constraints.getHeight().getPreferredValue();
-
- int rightEdge = offsetX + x + width;
- if (rightEdge > maxX)
- maxX = rightEdge;
- int bottomEdge = offsetY + y + height;
- if (bottomEdge > maxY)
- maxY = bottomEdge;
- }
-
- return new Dimension(maxX, maxY);
- }
-
- /**
- * Attaches the edge <code>e1</code> of component <code>c1</code> to
- * the edge <code>e2</code> of component <code>c2</code> width the
- * fixed strut <code>pad</code>.
- *
- * @param e1 the edge of component 1.
- * @param c1 the component 1.
- * @param pad the space between the components in pixels.
- * @param e2 the edge of component 2.
- * @param c2 the component 2.
- */
- public void putConstraint(String e1, Component c1, int pad, String e2,
- Component c2)
- {
- Constraints constraints1 = getConstraints(c1);
- Constraints constraints2 = getConstraints(c2);
-
- Spring strut = Spring.constant(pad);
- Spring otherEdge = constraints2.getConstraint(e2);
- constraints1.setConstraint(e1, Spring.sum(strut, otherEdge));
-
- }
-
- /**
- * Attaches the edge <code>e1</code> of component <code>c1</code> to
- * the edge <code>e2</code> of component <code>c2</code> width the
- * {@link Spring} <code>s</code>.
- *
- * @param e1 the edge of component 1.
- * @param c1 the component 1.
- * @param s the space between the components as a {@link Spring} object.
- * @param e2 the edge of component 2.
- * @param c2 the component 2.
- */
- public void putConstraint(String e1, Component c1, Spring s, String e2,
- Component c2)
- {
- Constraints constraints1 = getConstraints(c1);
- Constraints constraints2 = getConstraints(c2);
-
- Spring otherEdge = constraints2.getConstraint(e2);
- constraints1.setConstraint(e1, Spring.sum(s, otherEdge));
-
- }
-
- /**
- * Removes a layout component.
- * @param c the layout component to remove.
- */
- public void removeLayoutComponent(Component c)
- {
- // do nothing here
- }
-}
diff --git a/libjava/javax/swing/SwingConstants.java b/libjava/javax/swing/SwingConstants.java
deleted file mode 100644
index 2ec53b16a46..00000000000
--- a/libjava/javax/swing/SwingConstants.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* SwingConstants.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-public interface SwingConstants
-{
- int CENTER = 0;
- int TOP = 1;
- int LEFT = 2;
- int BOTTOM = 3;
- int RIGHT = 4;
-
- int NORTH = 1;
- int NORTH_EAST = 2;
- int EAST = 3;
- int SOUTH_EAST = 4;
- int SOUTH = 5;
- int SOUTH_WEST = 6;
- int WEST = 7;
- int NORTH_WEST = 8;
-
- int HORIZONTAL = 0;
- int VERTICAL = 1;
-
- int LEADING = 10;
- int TRAILING = 11;
-
- /**
- * @since 1.4
- */
- int NEXT = 12;
-
- /**
- * @since 1.4
- */
- int PREVIOUS = 13;
-}
-
diff --git a/libjava/javax/swing/SwingUtilities.java b/libjava/javax/swing/SwingUtilities.java
deleted file mode 100644
index c29612c6162..00000000000
--- a/libjava/javax/swing/SwingUtilities.java
+++ /dev/null
@@ -1,1322 +0,0 @@
-/* SwingUtilities.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.applet.Applet;
-import java.awt.Component;
-import java.awt.ComponentOrientation;
-import java.awt.Container;
-import java.awt.FontMetrics;
-import java.awt.Frame;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.KeyboardFocusManager;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.awt.Window;
-import java.awt.event.ActionEvent;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.lang.reflect.InvocationTargetException;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleStateSet;
-import javax.swing.plaf.ActionMapUIResource;
-import javax.swing.plaf.InputMapUIResource;
-
-/**
- * This class contains a number of static utility functions which are
- * useful when drawing swing components, dispatching events, or calculating
- * regions which need painting.
- *
- * @author Graydon Hoare (graydon@redhat.com)
- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- */
-public class SwingUtilities
- implements SwingConstants
-{
- /**
- * This frame should be used as parent for JWindow or JDialog
- * that doesn't an owner
- */
- private static OwnerFrame ownerFrame;
-
- private SwingUtilities()
- {
- // Do nothing.
- }
-
- /**
- * Calculates the portion of the base rectangle which is inside the
- * insets.
- *
- * @param base The rectangle to apply the insets to
- * @param insets The insets to apply to the base rectangle
- * @param ret A rectangle to use for storing the return value, or
- * <code>null</code>
- *
- * @return The calculated area inside the base rectangle and its insets,
- * either stored in ret or a new Rectangle if ret is <code>null</code>
- *
- * @see #calculateInnerArea
- */
- public static Rectangle calculateInsetArea(Rectangle base, Insets insets,
- Rectangle ret)
- {
- if (ret == null)
- ret = new Rectangle();
- ret.setBounds(base.x + insets.left, base.y + insets.top,
- base.width - (insets.left + insets.right),
- base.height - (insets.top + insets.bottom));
- return ret;
- }
-
- /**
- * Calculates the portion of the component's bounds which is inside the
- * component's border insets. This area is usually the area a component
- * should confine its painting to. The coordinates are returned in terms
- * of the <em>component's</em> coordinate system, where (0,0) is the
- * upper left corner of the component's bounds.
- *
- * @param c The component to measure the bounds of
- * @param r A Rectangle to store the return value in, or
- * <code>null</code>
- *
- * @return The calculated area inside the component and its border
- * insets
- *
- * @see #calculateInsetArea
- */
- public static Rectangle calculateInnerArea(JComponent c, Rectangle r)
- {
- Rectangle b = getLocalBounds(c);
- return calculateInsetArea(b, c.getInsets(), r);
- }
-
- /**
- * Returns the focus owner or <code>null</code> if <code>comp</code> is not
- * the focus owner or a parent of it.
- *
- * @param comp the focus owner or a parent of it
- *
- * @return the focus owner, or <code>null</code>
- *
- * @deprecated 1.4 Replaced by
- * <code>KeyboardFocusManager.getFocusOwner()</code>.
- */
- public static Component findFocusOwner(Component comp)
- {
- // Get real focus owner.
- Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager()
- .getFocusOwner();
-
- // Check if comp is the focus owner or a parent of it.
- Component tmp = focusOwner;
-
- while (tmp != null)
- {
- if (tmp == comp)
- return focusOwner;
-
- tmp = tmp.getParent();
- }
-
- return null;
- }
-
- /**
- * Returns the <code>Accessible</code> child of the specified component
- * which appears at the supplied <code>Point</code>. If there is no
- * child located at that particular pair of co-ordinates, null is returned
- * instead.
- *
- * @param c the component whose children may be found at the specified
- * point.
- * @param p the point at which to look for the existence of children
- * of the specified component.
- * @return the <code>Accessible</code> child at the point, <code>p</code>,
- * or null if there is no child at this point.
- * @see javax.accessibility.AccessibleComponent#getAccessibleAt
- */
- public static Accessible getAccessibleAt(Component c, Point p)
- {
- return c.getAccessibleContext().getAccessibleComponent().getAccessibleAt(p);
- }
-
- /**
- * <p>
- * Returns the <code>Accessible</code> child of the specified component
- * that has the supplied index within the parent component. The indexing
- * of the children is zero-based, making the first child have an index of
- * 0.
- * </p>
- * <p>
- * Caution is advised when using this method, as its operation relies
- * on the behaviour of varying implementations of an abstract method.
- * For greater surety, direct use of the AWT component implementation
- * of this method is advised.
- * </p>
- *
- * @param c the component whose child should be returned.
- * @param i the index of the child within the parent component.
- * @return the <code>Accessible</code> child at index <code>i</code>
- * in the component, <code>c</code>.
- * @see javax.accessibility.AccessibleContext#getAccessibleChild
- * @see java.awt.Component.AccessibleAWTComponent#getAccessibleChild
- */
- public static Accessible getAccessibleChild(Component c, int i)
- {
- return c.getAccessibleContext().getAccessibleChild(i);
- }
-
- /**
- * <p>
- * Returns the number of <code>Accessible</code> children within
- * the supplied component.
- * </p>
- * <p>
- * Caution is advised when using this method, as its operation relies
- * on the behaviour of varying implementations of an abstract method.
- * For greater surety, direct use of the AWT component implementation
- * of this method is advised.
- * </p>
- *
- * @param c the component whose children should be counted.
- * @return the number of children belonging to the component,
- * <code>c</code>.
- * @see javax.accessibility.AccessibleContext#getAccessibleChildrenCount
- * @see java.awt.Component.AccessibleAWTComponent#getAccessibleChildrenCount
- */
- public static int getAccessibleChildrenCount(Component c)
- {
- return c.getAccessibleContext().getAccessibleChildrenCount();
- }
-
- /**
- * <p>
- * Returns the zero-based index of the specified component
- * within its parent. If the component doesn't have a parent,
- * -1 is returned.
- * </p>
- * <p>
- * Caution is advised when using this method, as its operation relies
- * on the behaviour of varying implementations of an abstract method.
- * For greater surety, direct use of the AWT component implementation
- * of this method is advised.
- * </p>
- *
- * @param c the component whose parental index should be found.
- * @return the index of the component within its parent, or -1
- * if the component doesn't have a parent.
- * @see javax.accessibility.AccessibleContext#getAccessibleIndexInParent
- * @see java.awt.Component.AccessibleAWTComponent#getAccessibleIndexInParent
- */
- public static int getAccessibleIndexInParent(Component c)
- {
- return c.getAccessibleContext().getAccessibleIndexInParent();
- }
-
- /**
- * <p>
- * Returns a set of <code>AccessibleState</code>s, which represent
- * the state of the supplied component.
- * </p>
- * <p>
- * Caution is advised when using this method, as its operation relies
- * on the behaviour of varying implementations of an abstract method.
- * For greater surety, direct use of the AWT component implementation
- * of this method is advised.
- * </p>
- *
- * @param c the component whose accessible state should be retrieved.
- * @return a set of <code>AccessibleState</code> objects, which represent
- * the state of the supplied component.
- * @see javax.accessibility.AccessibleContext#getAccessibleStateSet
- * @see java.awt.Component.AccessibleAWTComponent#getAccessibleStateSet
- */
- public static AccessibleStateSet getAccessibleStateSet(Component c)
- {
- return c.getAccessibleContext().getAccessibleStateSet();
- }
-
- /**
- * Calculates the bounds of a component in the component's own coordinate
- * space. The result has the same height and width as the component's
- * bounds, but its location is set to (0,0).
- *
- * @param aComponent The component to measure
- *
- * @return The component's bounds in its local coordinate space
- */
- public static Rectangle getLocalBounds(Component aComponent)
- {
- Rectangle bounds = aComponent.getBounds();
- return new Rectangle(0, 0, bounds.width, bounds.height);
- }
-
- /**
- * If <code>comp</code> is a RootPaneContainer, return its JRootPane.
- * Otherwise call <code>getAncestorOfClass(JRootPane.class, a)</code>.
- *
- * @param comp The component to get the JRootPane of
- *
- * @return a suitable JRootPane for <code>comp</code>, or <code>null</code>
- *
- * @see javax.swing.RootPaneContainer#getRootPane
- * @see #getAncestorOfClass
- */
- public static JRootPane getRootPane(Component comp)
- {
- if (comp instanceof RootPaneContainer)
- return ((RootPaneContainer)comp).getRootPane();
- else
- return (JRootPane) getAncestorOfClass(JRootPane.class, comp);
- }
-
- /**
- * Returns the least ancestor of <code>comp</code> which has the
- * specified name.
- *
- * @param name The name to search for
- * @param comp The component to search the ancestors of
- *
- * @return The nearest ancestor of <code>comp</code> with the given
- * name, or <code>null</code> if no such ancestor exists
- *
- * @see java.awt.Component#getName
- * @see #getAncestorOfClass
- */
- public static Container getAncestorNamed(String name, Component comp)
- {
- while (comp != null && (comp.getName() != name))
- comp = comp.getParent();
- return (Container) comp;
- }
-
- /**
- * Returns the least ancestor of <code>comp</code> which is an instance
- * of the specified class.
- *
- * @param c The class to search for
- * @param comp The component to search the ancestors of
- *
- * @return The nearest ancestor of <code>comp</code> which is an instance
- * of the given class, or <code>null</code> if no such ancestor exists
- *
- * @see #getAncestorOfClass
- * @see #windowForComponent
- */
- public static Container getAncestorOfClass(Class c, Component comp)
- {
- while (comp != null && (! c.isInstance(comp)))
- comp = comp.getParent();
- return (Container) comp;
- }
-
- /**
- * Equivalent to calling <code>getAncestorOfClass(Window, comp)</code>.
- *
- * @param comp The component to search for an ancestor window
- *
- * @return An ancestral window, or <code>null</code> if none exists
- */
- public static Window windowForComponent(Component comp)
- {
- return (Window) getAncestorOfClass(Window.class, comp);
- }
-
- /**
- * Returns the "root" of the component tree containint <code>comp</code>
- * The root is defined as either the <em>least</em> ancestor of
- * <code>comp</code> which is a {@link Window}, or the <em>greatest</em>
- * ancestor of <code>comp</code> which is a {@link Applet} if no {@link
- * Window} ancestors are found.
- *
- * @param comp The component to search for a root
- *
- * @return The root of the component's tree, or <code>null</code>
- */
- public static Component getRoot(Component comp)
- {
- Applet app = null;
- Window win = null;
-
- while (comp != null)
- {
- if (win == null && comp instanceof Window)
- win = (Window) comp;
- else if (comp instanceof Applet)
- app = (Applet) comp;
- comp = comp.getParent();
- }
-
- if (win != null)
- return win;
- else
- return app;
- }
-
- /**
- * Return true if a descends from b, in other words if b is an
- * ancestor of a.
- *
- * @param a The child to search the ancestry of
- * @param b The potential ancestor to search for
- *
- * @return true if a is a descendent of b, false otherwise
- */
- public static boolean isDescendingFrom(Component a, Component b)
- {
- while (true)
- {
- if (a == null || b == null)
- return false;
- if (a == b)
- return true;
- a = a.getParent();
- }
- }
-
- /**
- * Returns the deepest descendent of parent which is both visible and
- * contains the point <code>(x,y)</code>. Returns parent when either
- * parent is not a container, or has no children which contain
- * <code>(x,y)</code>. Returns <code>null</code> when either
- * <code>(x,y)</code> is outside the bounds of parent, or parent is
- * <code>null</code>.
- *
- * @param parent The component to search the descendents of
- * @param x Horizontal coordinate to search for
- * @param y Vertical coordinate to search for
- *
- * @return A component containing <code>(x,y)</code>, or
- * <code>null</code>
- *
- * @see java.awt.Container#findComponentAt
- */
- public static Component getDeepestComponentAt(Component parent, int x, int y)
- {
- if (parent == null || (! parent.contains(x, y)))
- return null;
-
- if (! (parent instanceof Container))
- return parent;
-
- Container c = (Container) parent;
- return c.findComponentAt(x, y);
- }
-
- /**
- * Converts a point from a component's local coordinate space to "screen"
- * coordinates (such as the coordinate space mouse events are delivered
- * in). This operation is equivalent to translating the point by the
- * location of the component (which is the origin of its coordinate
- * space).
- *
- * @param p The point to convert
- * @param c The component which the point is expressed in terms of
- *
- * @see convertPointFromScreen
- */
- public static void convertPointToScreen(Point p, Component c)
- {
- Point c0 = c.getLocationOnScreen();
- p.translate(c0.x, c0.y);
- }
-
- /**
- * Converts a point from "screen" coordinates (such as the coordinate
- * space mouse events are delivered in) to a component's local coordinate
- * space. This operation is equivalent to translating the point by the
- * negation of the component's location (which is the origin of its
- * coordinate space).
- *
- * @param p The point to convert
- * @param c The component which the point should be expressed in terms of
- */
- public static void convertPointFromScreen(Point p, Component c)
- {
- Point c0 = c.getLocationOnScreen();
- p.translate(-c0.x, -c0.y);
- }
-
- /**
- * Converts a point <code>(x,y)</code> from the coordinate space of one
- * component to another. This is equivalent to converting the point from
- * <code>source</code> space to screen space, then back from screen space
- * to <code>destination</code> space. If exactly one of the two
- * Components is <code>null</code>, it is taken to refer to the root
- * ancestor of the other component. If both are <code>null</code>, no
- * transformation is done.
- *
- * @param source The component which the point is expressed in terms of
- * @param x Horizontal coordinate of point to transform
- * @param y Vertical coordinate of point to transform
- * @param destination The component which the return value will be
- * expressed in terms of
- *
- * @return The point <code>(x,y)</code> converted from the coordinate space of the
- * source component to the coordinate space of the destination component
- *
- * @see #convertPointToScreen
- * @see #convertPointFromScreen
- * @see #convertRectangle
- * @see #getRoot
- */
- public static Point convertPoint(Component source, int x, int y,
- Component destination)
- {
- Point pt = new Point(x, y);
-
- if (source == null && destination == null)
- return pt;
-
- if (source == null)
- source = getRoot(destination);
-
- if (destination == null)
- destination = getRoot(source);
-
- convertPointToScreen(pt, source);
- convertPointFromScreen(pt, destination);
-
- return pt;
- }
-
- public static Point convertPoint(Component source, Point aPoint, Component destination)
- {
- return convertPoint(source, aPoint.x, aPoint.y, destination);
- }
-
- /**
- * Converts a rectangle from the coordinate space of one component to
- * another. This is equivalent to converting the rectangle from
- * <code>source</code> space to screen space, then back from screen space
- * to <code>destination</code> space. If exactly one of the two
- * Components is <code>null</code>, it is taken to refer to the root
- * ancestor of the other component. If both are <code>null</code>, no
- * transformation is done.
- *
- * @param source The component which the rectangle is expressed in terms of
- * @param rect The rectangle to convert
- * @param destination The component which the return value will be
- * expressed in terms of
- *
- * @return A new rectangle, equal in size to the input rectangle, but
- * with its position converted from the coordinate space of the source
- * component to the coordinate space of the destination component
- *
- * @see #convertPointToScreen
- * @see #convertPointFromScreen
- * @see #convertPoint
- * @see #getRoot
- */
- public static Rectangle convertRectangle(Component source,
- Rectangle rect,
- Component destination)
- {
- Point pt = convertPoint(source, rect.x, rect.y, destination);
- return new Rectangle(pt.x, pt.y, rect.width, rect.height);
- }
-
- /**
- * Convert a mouse event which refrers to one component to another. This
- * includes changing the mouse event's coordinate space, as well as the
- * source property of the event. If <code>source</code> is
- * <code>null</code>, it is taken to refer to <code>destination</code>'s
- * root component. If <code>destination</code> is <code>null</code>, the
- * new event will remain expressed in <code>source</code>'s coordinate
- * system.
- *
- * @param source The component the mouse event currently refers to
- * @param sourceEvent The mouse event to convert
- * @param destination The component the new mouse event should refer to
- *
- * @return A new mouse event expressed in terms of the destination
- * component's coordinate space, and with the destination component as
- * its source
- *
- * @see #convertPoint
- */
- public static MouseEvent convertMouseEvent(Component source,
- MouseEvent sourceEvent,
- Component destination)
- {
- Point newpt = convertPoint(source, sourceEvent.getX(), sourceEvent.getY(),
- destination);
-
- return new MouseEvent(destination, sourceEvent.getID(),
- sourceEvent.getWhen(), sourceEvent.getModifiersEx(),
- newpt.x, newpt.y, sourceEvent.getClickCount(),
- sourceEvent.isPopupTrigger(), sourceEvent.getButton());
- }
-
- /**
- * Recursively walk the component tree under <code>comp</code> calling
- * <code>updateUI</code> on each {@link JComponent} found. This causes
- * the entire tree to re-initialize its UI delegates.
- *
- * @param comp The component to walk the children of, calling <code>updateUI</code>
- */
- public static void updateComponentTreeUI(Component comp)
- {
- if (comp == null)
- return;
-
- if (comp instanceof Container)
- {
- Component[] children = ((Container)comp).getComponents();
- for (int i = 0; i < children.length; ++i)
- updateComponentTreeUI(children[i]);
- }
-
- if (comp instanceof JComponent)
- ((JComponent)comp).updateUI();
- }
-
-
- /**
- * <p>Layout a "compound label" consisting of a text string and an icon
- * which is to be placed near the rendered text. Once the text and icon
- * are laid out, the text rectangle and icon rectangle parameters are
- * altered to store the calculated positions.</p>
- *
- * <p>The size of the text is calculated from the provided font metrics
- * object. This object should be the metrics of the font you intend to
- * paint the label with.</p>
- *
- * <p>The position values control where the text is placed relative to
- * the icon. The horizontal position value should be one of the constants
- * <code>LEADING</code>, <code>TRAILING</code>, <code>LEFT</code>,
- * <code>RIGHT</code> or <code>CENTER</code>. The vertical position value
- * should be one fo the constants <code>TOP</code>, <code>BOTTOM</code>
- * or <code>CENTER</code>.</p>
- *
- * <p>The text-icon gap value controls the number of pixels between the
- * icon and the text.</p>
- *
- * <p>The alignment values control where the text and icon are placed, as
- * a combined unit, within the view rectangle. The horizontal alignment
- * value should be one of the constants <code>LEADING</code>,
- * <code>TRAILING</code>, <code>LEFT</code>, <code>RIGHT</code> or
- * <code>CENTER</code>. The vertical alignment valus should be one of the
- * constants <code>TOP</code>, <code>BOTTOM</code> or
- * <code>CENTER</code>.</p>
- *
- * <p>If the <code>LEADING</code> or <code>TRAILING</code> constants are
- * given for horizontal alignment or horizontal text position, they are
- * interpreted relative to the provided component's orientation property,
- * a constant in the {@link java.awt.ComponentOrientation} class. For
- * example, if the component's orientation is <code>LEFT_TO_RIGHT</code>,
- * then the <code>LEADING</code> value is a synonym for <code>LEFT</code>
- * and the <code>TRAILING</code> value is a synonym for
- * <code>RIGHT</code></p>
- *
- * <p>If the text and icon are equal to or larger than the view
- * rectangle, the horizontal and vertical alignment values have no
- * affect.</p>
- *
- * @param c A component used for its orientation value
- * @param fm The font metrics used to measure the text
- * @param text The text to place in the compound label
- * @param icon The icon to place next to the text
- * @param verticalAlignment The vertical alignment of the label relative
- * to its component
- * @param horizontalAlignment The horizontal alignment of the label
- * relative to its component
- * @param verticalTextPosition The vertical position of the label's text
- * relative to its icon
- * @param horizontalTextPosition The horizontal position of the label's
- * text relative to its icon
- * @param viewR The view rectangle, specifying the area which layout is
- * constrained to
- * @param iconR A rectangle which is modified to hold the laid-out
- * position of the icon
- * @param textR A rectangle which is modified to hold the laid-out
- * position of the text
- * @param textIconGap The distance between text and icon
- *
- * @return The string of characters, possibly truncated with an elipsis,
- * which is laid out in this label
- */
-
- public static String layoutCompoundLabel(JComponent c,
- FontMetrics fm,
- String text,
- Icon icon,
- int verticalAlignment,
- int horizontalAlignment,
- int verticalTextPosition,
- int horizontalTextPosition,
- Rectangle viewR,
- Rectangle iconR,
- Rectangle textR,
- int textIconGap)
- {
-
- // Fix up the orientation-based horizontal positions.
-
- if (horizontalTextPosition == LEADING)
- {
- if (c.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
- horizontalTextPosition = RIGHT;
- else
- horizontalTextPosition = LEFT;
- }
- else if (horizontalTextPosition == TRAILING)
- {
- if (c.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
- horizontalTextPosition = LEFT;
- else
- horizontalTextPosition = RIGHT;
- }
-
- // Fix up the orientation-based alignments.
-
- if (horizontalAlignment == LEADING)
- {
- if (c.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
- horizontalAlignment = RIGHT;
- else
- horizontalAlignment = LEFT;
- }
- else if (horizontalAlignment == TRAILING)
- {
- if (c.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
- horizontalAlignment = LEFT;
- else
- horizontalAlignment = RIGHT;
- }
-
- return layoutCompoundLabel(fm, text, icon,
- verticalAlignment,
- horizontalAlignment,
- verticalTextPosition,
- horizontalTextPosition,
- viewR, iconR, textR, textIconGap);
- }
-
- /**
- * <p>Layout a "compound label" consisting of a text string and an icon
- * which is to be placed near the rendered text. Once the text and icon
- * are laid out, the text rectangle and icon rectangle parameters are
- * altered to store the calculated positions.</p>
- *
- * <p>The size of the text is calculated from the provided font metrics
- * object. This object should be the metrics of the font you intend to
- * paint the label with.</p>
- *
- * <p>The position values control where the text is placed relative to
- * the icon. The horizontal position value should be one of the constants
- * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>. The
- * vertical position value should be one fo the constants
- * <code>TOP</code>, <code>BOTTOM</code> or <code>CENTER</code>.</p>
- *
- * <p>The text-icon gap value controls the number of pixels between the
- * icon and the text.</p>
- *
- * <p>The alignment values control where the text and icon are placed, as
- * a combined unit, within the view rectangle. The horizontal alignment
- * value should be one of the constants <code>LEFT</code>, <code>RIGHT</code> or
- * <code>CENTER</code>. The vertical alignment valus should be one of the
- * constants <code>TOP</code>, <code>BOTTOM</code> or
- * <code>CENTER</code>.</p>
- *
- * <p>If the text and icon are equal to or larger than the view
- * rectangle, the horizontal and vertical alignment values have no
- * affect.</p>
- *
- * <p>Note that this method does <em>not</em> know how to deal with
- * horizontal alignments or positions given as <code>LEADING</code> or
- * <code>TRAILING</code> values. Use the other overloaded variant of this
- * method if you wish to use such values.
- *
- * @param fm The font metrics used to measure the text
- * @param text The text to place in the compound label
- * @param icon The icon to place next to the text
- * @param verticalAlignment The vertical alignment of the label relative
- * to its component
- * @param horizontalAlignment The horizontal alignment of the label
- * relative to its component
- * @param verticalTextPosition The vertical position of the label's text
- * relative to its icon
- * @param horizontalTextPosition The horizontal position of the label's
- * text relative to its icon
- * @param viewR The view rectangle, specifying the area which layout is
- * constrained to
- * @param iconR A rectangle which is modified to hold the laid-out
- * position of the icon
- * @param textR A rectangle which is modified to hold the laid-out
- * position of the text
- * @param textIconGap The distance between text and icon
- *
- * @return The string of characters, possibly truncated with an elipsis,
- * which is laid out in this label
- */
-
- public static String layoutCompoundLabel(FontMetrics fm,
- String text,
- Icon icon,
- int verticalAlignment,
- int horizontalAlignment,
- int verticalTextPosition,
- int horizontalTextPosition,
- Rectangle viewR,
- Rectangle iconR,
- Rectangle textR,
- int textIconGap)
- {
-
- // Work out basic height and width.
-
- if (icon == null)
- {
- textIconGap = 0;
- iconR.width = 0;
- iconR.height = 0;
- }
- else
- {
- iconR.width = icon.getIconWidth();
- iconR.height = icon.getIconHeight();
- }
- if (text == null)
- {
- textIconGap = 0;
- textR.width = 0;
- textR.height = 0;
- }
- else
- {
- textR.width = fm.stringWidth(text);
- textR.height = fm.getHeight();
- }
-
- // Work out the position of text and icon, assuming the top-left coord
- // starts at (0,0). We will fix that up momentarily, after these
- // "position" decisions are made and we look at alignment.
-
- switch (horizontalTextPosition)
- {
- case LEFT:
- textR.x = 0;
- iconR.x = textR.width + textIconGap;
- break;
- case RIGHT:
- iconR.x = 0;
- textR.x = iconR.width + textIconGap;
- break;
- case CENTER:
- int centerLine = Math.max(textR.width, iconR.width) / 2;
- textR.x = centerLine - textR.width/2;
- iconR.x = centerLine - iconR.width/2;
- break;
- }
-
- switch (verticalTextPosition)
- {
- case TOP:
- textR.y = 0;
- iconR.y = (horizontalTextPosition == CENTER
- ? textR.height + textIconGap : 0);
- break;
- case BOTTOM:
- iconR.y = 0;
- textR.y = (horizontalTextPosition == CENTER
- ? iconR.height + textIconGap
- : iconR.height - textR.height);
- break;
- case CENTER:
- int centerLine = Math.max(textR.height, iconR.height) / 2;
- textR.y = centerLine - textR.height/2;
- iconR.y = centerLine - iconR.height/2;
- break;
- }
- // The two rectangles are laid out correctly now, but only assuming
- // that their upper left corner is at (0,0). If we have any alignment other
- // than TOP and LEFT, we need to adjust them.
-
- Rectangle u = textR.union(iconR);
- int horizontalAdjustment = viewR.x;
- int verticalAdjustment = viewR.y;
- switch (verticalAlignment)
- {
- case TOP:
- break;
- case BOTTOM:
- verticalAdjustment += (viewR.height - u.height);
- break;
- case CENTER:
- verticalAdjustment += ((viewR.height/2) - (u.height/2));
- break;
- }
- switch (horizontalAlignment)
- {
- case LEFT:
- break;
- case RIGHT:
- horizontalAdjustment += (viewR.width - u.width);
- break;
- case CENTER:
- horizontalAdjustment += ((viewR.width/2) - (u.width/2));
- break;
- }
-
- iconR.x += horizontalAdjustment;
- iconR.y += verticalAdjustment;
-
- textR.x += horizontalAdjustment;
- textR.y += verticalAdjustment;
-
- return text;
- }
-
- /**
- * Calls {@link java.awt.EventQueue.invokeLater} with the
- * specified {@link Runnable}.
- */
- public static void invokeLater(Runnable doRun)
- {
- java.awt.EventQueue.invokeLater(doRun);
- }
-
- /**
- * Calls {@link java.awt.EventQueue.invokeAndWait} with the
- * specified {@link Runnable}.
- */
- public static void invokeAndWait(Runnable doRun)
- throws InterruptedException,
- InvocationTargetException
- {
- java.awt.EventQueue.invokeAndWait(doRun);
- }
-
- /**
- * Calls {@link java.awt.EventQueue.isEventDispatchThread}.
- */
- public static boolean isEventDispatchThread()
- {
- return java.awt.EventQueue.isDispatchThread();
- }
-
- /**
- * This method paints the given component at the given position and size.
- * The component will be reparented to the container given.
- *
- * @param g The Graphics object to draw with.
- * @param c The Component to draw
- * @param p The Container to reparent to.
- * @param x The x coordinate to draw at.
- * @param y The y coordinate to draw at.
- * @param w The width of the drawing area.
- * @param h The height of the drawing area.
- */
- public static void paintComponent(Graphics g, Component c, Container p,
- int x, int y, int w, int h)
- {
- Container parent = c.getParent();
- if (parent != null)
- parent.remove(c);
- if (p != null)
- p.add(c);
-
- Shape savedClip = g.getClip();
-
- g.setClip(x, y, w, h);
- g.translate(x, y);
-
- c.paint(g);
-
- g.translate(-x, -y);
- g.setClip(savedClip);
- }
-
- /**
- * This method paints the given component in the given rectangle.
- * The component will be reparented to the container given.
- *
- * @param g The Graphics object to draw with.
- * @param c The Component to draw
- * @param p The Container to reparent to.
- * @param r The rectangle that describes the drawing area.
- */
- public static void paintComponent(Graphics g, Component c,
- Container p, Rectangle r)
- {
- paintComponent(g, c, p, r.x, r.y, r.width, r.height);
- }
-
- /**
- * This method returns the common Frame owner used in JDialogs or
- * JWindow when no owner is provided.
- *
- * @return The common Frame
- */
- static Frame getOwnerFrame()
- {
- if (ownerFrame == null)
- ownerFrame = new OwnerFrame();
- return ownerFrame;
- }
-
- /**
- * Checks if left mouse button was clicked.
- *
- * @param event the event to check
- *
- * @return true if left mouse was clicked, false otherwise.
- */
- public static boolean isLeftMouseButton(MouseEvent event)
- {
- return ((event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK)
- == InputEvent.BUTTON1_DOWN_MASK);
- }
-
- /**
- * Checks if middle mouse button was clicked.
- *
- * @param event the event to check
- *
- * @return true if middle mouse was clicked, false otherwise.
- */
- public static boolean isMiddleMouseButton(MouseEvent event)
- {
- return ((event.getModifiersEx() & InputEvent.BUTTON2_DOWN_MASK)
- == InputEvent.BUTTON2_DOWN_MASK);
- }
-
- /**
- * Checks if right mouse button was clicked.
- *
- * @param event the event to check
- *
- * @return true if right mouse was clicked, false otherwise.
- */
- public static boolean isRightMouseButton(MouseEvent event)
- {
- return ((event.getModifiersEx() & InputEvent.BUTTON3_DOWN_MASK)
- == InputEvent.BUTTON3_DOWN_MASK);
- }
-
- /**
- * This frame should be used when constructing a Window/JDialog without
- * a parent. In this case, we are forced to use this frame as a window's
- * parent, because we simply cannot pass null instead of parent to Window
- * constructor, since doing it will result in NullPointerException.
- */
- private static class OwnerFrame extends Frame
- {
- public void setVisible(boolean b)
- {
- // Do nothing here.
- }
-
- public boolean isShowing()
- {
- return true;
- }
- }
-
- public static boolean notifyAction(Action action,
- KeyStroke ks,
- KeyEvent event,
- Object sender,
- int modifiers)
- {
- if (action != null && action.isEnabled())
- {
- String name = (String) action.getValue(Action.ACTION_COMMAND_KEY);
- if (name == null
- && event.getKeyChar() != KeyEvent.CHAR_UNDEFINED)
- name = new String(new char[] {event.getKeyChar()});
- action.actionPerformed(new ActionEvent(sender,
- ActionEvent.ACTION_PERFORMED,
- name, modifiers));
- return true;
- }
- return false;
- }
-
- /**
- * <p>Change the shared, UI-managed {@link ActionMap} for a given
- * component. ActionMaps are arranged in a hierarchy, in order to
- * encourage sharing of common actions between components. The hierarchy
- * unfortunately places UI-managed ActionMaps at the <em>end</em> of the
- * parent-pointer chain, as illustrated:</p>
- *
- * <pre>
- * [{@link javax.swing.JComponent#getActionMap()}]
- * --&gt; [{@link javax.swing.ActionMap}]
- * parent --&gt; [{@link javax.swing.text.KeymapActionMap}]
- * parent --&gt; [{@link javax.swing.plaf.ActionMapUIResource}]
- * </pre>
- *
- * <p>Our goal with this method is to replace the first ActionMap along
- * this chain which is an instance of {@link ActionMapUIResource}, since
- * these are the ActionMaps which are supposed to be shared between
- * components.</p>
- *
- * <p>If the provided ActionMap is <code>null</code>, we interpret the
- * call as a request to remove the UI-managed ActionMap from the
- * component's ActionMap parent chain.</p>
- */
- public static void replaceUIActionMap(JComponent component,
- ActionMap uiActionMap)
- {
- ActionMap child = component.getActionMap();
- if (child == null)
- component.setActionMap(uiActionMap);
- else
- {
- while(child.getParent() != null
- && !(child.getParent() instanceof ActionMapUIResource))
- child = child.getParent();
- if (child != null)
- child.setParent(uiActionMap);
- }
- }
-
- /**
- * <p>Change the shared, UI-managed {@link InputMap} for a given
- * component. InputMaps are arranged in a hierarchy, in order to
- * encourage sharing of common input mappings between components. The
- * hierarchy unfortunately places UI-managed InputMaps at the
- * <em>end</em> of the parent-pointer chain, as illustrated:</p>
- *
- * <pre>
- * [{@link javax.swing.JComponent#getInputMap()}]
- * --&gt; [{@link javax.swing.InputMap}]
- * parent --&gt; [{@link javax.swing.text.KeymapWrapper}]
- * parent --&gt; [{@link javax.swing.plaf.InputMapUIResource}]
- * </pre>
- *
- * <p>Our goal with this method is to replace the first InputMap along
- * this chain which is an instance of {@link InputMapUIResource}, since
- * these are the InputMaps which are supposed to be shared between
- * components.</p>
- *
- * <p>If the provided InputMap is <code>null</code>, we interpret the
- * call as a request to remove the UI-managed InputMap from the
- * component's InputMap parent chain.</p>
- */
- public static void replaceUIInputMap(JComponent component,
- int condition,
- InputMap uiInputMap)
- {
- InputMap child = component.getInputMap(condition);
- if (child == null)
- component.setInputMap(condition, uiInputMap);
- else
- {
- while(child.getParent() != null
- && !(child.getParent() instanceof InputMapUIResource))
- child = child.getParent();
- if (child != null)
- child.setParent(uiInputMap);
- }
- }
-
- /**
- * Subtracts a rectangle from another and return the area as an array
- * of rectangles.
- * Returns the areas of rectA which are not covered by rectB.
- * If the rectangles do not overlap, or if either parameter is
- * <code>null</code>, a zero-size array is returned.
- * @param rectA The first rectangle
- * @param rectB The rectangle to subtract from the first
- * @return An array of rectangles representing the area in rectA
- * not overlapped by rectB
- */
- public static Rectangle[] computeDifference(Rectangle rectA, Rectangle rectB)
- {
- if (rectA == null || rectB == null)
- return new Rectangle[0];
-
- Rectangle[] r = new Rectangle[4];
- int x1 = rectA.x;
- int y1 = rectA.y;
- int w1 = rectA.width;
- int h1 = rectA.height;
- int x2 = rectB.x;
- int y2 = rectB.y;
- int w2 = rectB.width;
- int h2 = rectB.height;
-
- // (outer box = rectA)
- // -------------
- // |_____0_____|
- // | |rectB| |
- // |_1|_____|_2|
- // | 3 |
- // -------------
- int H0 = (y2 > y1) ? y2 - y1 : 0; // height of box 0
- int H3 = (y2 + h2 < y1 + h1) ? y1 + h1 - y2 - h2 : 0; // height box 3
- int W1 = (x2 > x1) ? x2 - x1 : 0; // width box 1
- int W2 = (x1 + w1 > x2 + w2) ? x1 + w1 - x2 - w2 : 0; // w. box 2
- int H12 = (H0 + H3 < h1) ? h1 - H0 - H3 : 0; // height box 1 & 2
-
- if (H0 > 0)
- r[0] = new Rectangle(x1, y1, w1, H0);
- else
- r[0] = null;
-
- if (W1 > 0 && H12 > 0)
- r[1] = new Rectangle(x1, y1 + H0, W1, H12);
- else
- r[1] = null;
-
- if (W2 > 0 && H12 > 0)
- r[2] = new Rectangle(x2 + w2, y1 + H0, W2, H12);
- else
- r[2] = null;
-
- if (H3 > 0)
- r[3] = new Rectangle(x1, y1 + H0 + H12, w1, H3);
- else
- r[3] = null;
-
- // sort out null objects
- int n = 0;
- for (int i = 0; i < 4; i++)
- if (r[i] != null)
- n++;
- Rectangle[] out = new Rectangle[n];
- for (int i = 3; i >= 0; i--)
- if (r[i] != null)
- out[--n] = r[i];
-
- return out;
- }
-
- /**
- * Calculates the intersection of two rectangles.
- *
- * @param x upper-left x coodinate of first rectangle
- * @param x upper-left y coodinate of first rectangle
- * @param w width of first rectangle
- * @param h height of first rectangle
- * @param rect a Rectangle object of the second rectangle
- * @throws a NullPointerException if rect is null.
- *
- * @return a rectangle corresponding to the intersection of the
- * two rectangles. A zero rectangle is returned if the rectangles
- * do not overlap.
- */
- public static Rectangle computeIntersection(int x, int y, int w, int h,
- Rectangle rect)
- {
- int x2 = (int) rect.getX();
- int y2 = (int) rect.getY();
- int w2 = (int) rect.getWidth();
- int h2 = (int) rect.getHeight();
-
- int dx = (x > x2) ? x : x2;
- int dy = (y > y2) ? y : y2;
- int dw = (x + w < x2 + w2) ? (x + w - dx) : (x2 + w2 - dx);
- int dh = (y + h < y2 + h2) ? (y + h - dy) : (y2 + h2 - dy);
-
- if (dw >= 0 && dh >= 0)
- return new Rectangle(dx, dy, dw, dh);
-
- return new Rectangle(0, 0, 0, 0);
- }
-
- /**
- * Calculates the width of a given string.
- *
- * @param fm the <code>FontMetrics</code> object to use
- * @param str the string
- *
- * @return the width of the the string.
- */
- public static int computeStringWidth(FontMetrics fm, String str)
- {
- return fm.stringWidth(str);
- }
-
- /**
- * Calculates the union of two rectangles.
- *
- * @param x upper-left x coodinate of first rectangle
- * @param x upper-left y coodinate of first rectangle
- * @param w width of first rectangle
- * @param h height of first rectangle
- * @param rect a Rectangle object of the second rectangle
- * @throws a NullPointerException if rect is null.
- *
- * @return a rectangle corresponding to the union of the
- * two rectangles. A rectangle encompassing both is returned if the
- * rectangles do not overlap.
- */
- public static Rectangle computeUnion(int x, int y, int w, int h,
- Rectangle rect)
- {
- int x2 = (int) rect.getX();
- int y2 = (int) rect.getY();
- int w2 = (int) rect.getWidth();
- int h2 = (int) rect.getHeight();
-
- int dx = (x < x2) ? x : x2;
- int dy = (y < y2) ? y : y2;
- int dw = (x + w > x2 + w2) ? (x + w - dx) : (x2 + w2 - dx);
- int dh = (y + h > y2 + h2) ? (y + h - dy) : (y2 + h2 - dy);
-
- if (dw >= 0 && dh >= 0)
- return new Rectangle(dx, dy, dw, dh);
-
- return new Rectangle(0, 0, 0, 0);
- }
-
- /**
- * Tests if a rectangle contains another.
- * @param a first rectangle
- * @param b second rectangle
- * @return true if a contains b, false otherwise
- * @throws NullPointerException
- */
- public static boolean isRectangleContainingRectangle(Rectangle a, Rectangle b)
- {
- // Note: zero-size rects inclusive, differs from Rectangle.contains()
- return b.width >= 0 && b.height >= 0 && b.width >= 0 && b.height >= 0
- && b.x >= a.x && b.x + b.width <= a.x + a.width && b.y >= a.y
- && b.y + b.height <= a.y + a.height;
- }
-}
diff --git a/libjava/javax/swing/Timer.java b/libjava/javax/swing/Timer.java
deleted file mode 100644
index 87f420a4367..00000000000
--- a/libjava/javax/swing/Timer.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/* Timer.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.Serializable;
-import java.util.EventListener;
-
-import javax.swing.event.EventListenerList;
-
-/**
- * Fires one or more action events after the specified delay.
- * @author Ronald Veldema
- * @author Audrius Meskauskas (audriusa@Bionformatics.org) - bug fixes
- * and documentation comments
- */
-public class Timer
- implements Serializable
-{
- /**
- * The timer thread
- */
- private class Waker
- extends Thread
- {
- /**
- * Fires events, pausing for required intervals.
- */
- public void run()
- {
- running = true;
- try
- {
- sleep(initialDelay);
-
- queueEvent();
-
- while (running)
- {
- try
- {
- sleep(delay);
- }
- catch (InterruptedException e)
- {
- return;
- }
- queueEvent();
-
- if (logTimers)
- System.out.println("javax.swing.Timer -> clocktick");
-
- if ( ! repeats)
- break;
- }
- running = false;
- }
- catch (Exception e)
- {
- // The timer is no longer running.
- running = false;
- }
- }
- }
-
- /**
- * Use serialVersionUID for interoperability.
- */
- private static final long serialVersionUID = -1116180831621385484L;
-
- /**
- * The encloding class, used with {@link SwingUtilities#invokeLater}
- * to invoke the {@link #drainEvents()}.
- */
- private Runnable drainer = new Runnable()
- {
- public void run()
- {
- drainEvents();
- }
- };
-
- /**
- * If <code>true</code>, the timer prints a message to
- * {@link System#out} when firing each event.
- */
- static boolean logTimers;
-
- /**
- * A field to store all listeners who are listening to this timer.
- */
- protected EventListenerList listenerList = new EventListenerList();
-
- /**
- * <code>true</code> if the timer coalesces events.
- */
- boolean coalesce = true;
-
- /**
- * <code>true</code> if the timer is firing repetetive events.
- */
- boolean repeats = true;
-
- /**
- * <code>true</code> if the timer is currently active, firing events
- * as scheduled.
- */
- boolean running;
-
- /**
- * The delay between subsequent repetetive events.
- */
- int delay;
-
- /**
- * The initial delay before the first event.
- */
- int initialDelay;
-
- /**
- * The number of events that have been already fired by this timer.
- * This is used as a numeric identifier for the next event that would
- * be fired.
- */
- int ticks;
-
- /**
- * Stores the thread that posts events to the queue at required time
- * intervals.
- */
- private Waker waker;
-
- /**
- * This object manages a "queue" of virtual actionEvents, maintained as a
- * simple long counter. When the timer expires, a new event is queued,
- * and a dispatcher object is pushed into the system event queue. When
- * the system thread runs the dispatcher, it will fire as many
- * ActionEvents as have been queued, unless the timer is set to
- * coalescing mode, in which case it will fire only one ActionEvent.
- */
- private long queue;
-
- /**
- * <code>synchronized(queueLock)</code> replaces
- * <code>synchronized(queue)</code> that is not supported by this language.
- */
- private Object queueLock = new Object();
-
- /**
- * Creates a new Timer object.
- *
- * @param d the default value for both initial and between event delay, in
- * milliseconds.
- * @param listener the first action listener, can be <code>null</code>.
- */
- public Timer(int d, ActionListener listener)
- {
- delay = d;
- initialDelay = d;
-
- if (listener != null)
- addActionListener(listener);
- }
-
- /**
- * Get the array of action listeners.
- *
- * @return the array of action listeners that are listening for the events,
- * fired by this timer
- *
- * @since 1.4
- */
- public ActionListener[] getActionListeners()
- {
- return (ActionListener[]) listenerList.getListeners(ActionListener.class);
- }
-
- /**
- * Sets whether the Timer coalesces multiple pending event firings.
- * If the coalescing is enabled, the multiple events that have not been
- * fired on time are replaced by the single event. The events may not
- * be fired on time if the application is busy.
- *
- * @param c <code>true</code> (default) to enable the event coalescing,
- * <code>false</code> otherwise
- */
- public void setCoalesce(boolean c)
- {
- coalesce = c;
- }
-
- /**
- * Checks if the Timer coalesces multiple pending event firings.
- * If the coalescing is enabled, the multiple events that have not been
- * fired on time are replaced by the single event. The events may not
- * be fired on time if the application is busy.
- *
- * @return <code>true</code> if the coalescing is enabled,
- * <code>false</code> otherwise
- */
- public boolean isCoalesce()
- {
- return coalesce;
- }
-
- /**
- * Get the event listeners of the given type that are listening for the
- * events, fired by this timer.
- *
- * @param listenerType the listener type (for example, ActionListener.class)
- *
- * @return the array of event listeners that are listening for the events,
- * fired by this timer
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
- /**
- * Set the timer logging state. If it is set to <code>true</code>, the
- * timer prints a message to {@link System#out} when firing each
- * action event.
- *
- * @param lt <code>true</code> if logging is enabled, <code>false</code>
- * (default value) otherwise
- */
- public static void setLogTimers(boolean lt)
- {
- logTimers = lt;
- }
-
- /**
- * Return the logging state.
- *
- * @return <code>true</code> if the timer is printing a message to
- * {@link System#out}
- * when firing each action event
- */
- public static boolean getLogTimers()
- {
- return logTimers;
- }
-
- /**
- * Set the delay between firing the subsequent events.
- * This parameter does not change the value of the initial delay before
- * firing the first event.
- *
- * @param d The time gap between the subsequent events, in milliseconds
- */
- public void setDelay(int d)
- {
- delay = d;
- }
-
- /**
- * Get the delay between firing the subsequent events.
- *
- * @return The delay between subsequent events, in milliseconds
- */
- public int getDelay()
- {
- return delay;
- }
-
- /**
- * Set the intial delay before firing the first event since calling
- * the {@link #start()} method. If the initial delay has not been
- * set, it is assumed having the same value as the delay between the
- * subsequent events.
- *
- * @param i the initial delay, in milliseconds
- */
- public void setInitialDelay(int i)
- {
- initialDelay = i;
- }
-
- /**
- * Get the intial delay before firing the first event since calling
- * the {@link #start()} method. If the initial delay has not been
- * set, returns the same value as {@link #getDelay()}.
- *
- * @return the initial delay before firing the first action event.
- */
- public int getInitialDelay()
- {
- return initialDelay;
- }
-
- /**
- * Enable firing the repetetive events.
- *
- * @param r <code>true</code> (default value) to fire repetetive events.
- * <code>false</code> to fire
- * only one event after the initial delay
- */
- public void setRepeats(boolean r)
- {
- repeats = r;
- }
-
- /**
- * Check is this timer fires repetetive events.
- *
- * @return <code>true</code> if the timer fires repetetive events,
- * <code>false</code> if it fires
- * only one event after the initial delay
- */
- public boolean isRepeats()
- {
- return repeats;
- }
-
- /**
- * Get the timer state.
- *
- * @return <code>true</code> if the timer has been started and is firing
- * the action events as scheduled. <code>false</code>
- * if the timer is inactive.
- */
- public boolean isRunning()
- {
- return running;
- }
-
- /**
- * Add the action listener
- *
- * @param listener the action listener to add
- */
- public void addActionListener(ActionListener listener)
- {
- listenerList.add(ActionListener.class, listener);
- }
-
- /**
- * Remove the action listener.
- *
- * @param listener the action listener to remove
- */
- public void removeActionListener(ActionListener listener)
- {
- listenerList.remove(ActionListener.class, listener);
- }
-
- /**
- * Cancel all pending tasks and fire the first event after the initial
- * delay.
- */
- public void restart()
- {
- stop();
- start();
- }
-
- /**
- * Start firing the action events.
- */
- public void start()
- {
- if (isRunning())
- return;
- waker = new Waker();
- waker.start();
- }
-
- /**
- * Stop firing the action events.
- */
- public void stop()
- {
- running = false;
- if (waker != null)
- waker.interrupt();
- synchronized (queueLock)
- {
- queue = 0;
- }
- }
-
- /**
- * Fire the given action event to the action listeners.
- *
- * @param event the event to fire
- */
- protected void fireActionPerformed(ActionEvent event)
- {
- ActionListener[] listeners = getActionListeners();
-
- for (int i = 0; i < listeners.length; i++)
- listeners [ i ].actionPerformed(event);
- }
-
- /**
- * Fire the action event, named "Timer" and having the numeric
- * identifier, equal to the numer of events that have been
- * already fired before.
- */
- void fireActionPerformed()
- {
- fireActionPerformed(new ActionEvent(this, ticks++, "Timer"));
- }
-
- /**
- * Fire the queued action events.
- * In the coalescing mode, a single event is fired as a replacement
- * for all queued events. In non coalescing mode, a series of
- * all queued events is fired.
- * This is package-private to avoid an accessor method.
- */
- void drainEvents()
- {
- synchronized (queueLock)
- {
- if (isCoalesce())
- {
- if (queue > 0)
- fireActionPerformed();
- }
- else
- {
- while (queue > 0)
- {
- fireActionPerformed();
- queue--;
- }
- }
- queue = 0;
- }
- }
-
- /**
- * Post a scheduled event to the event queue.
- * Package-private to avoid an accessor method.
- */
- void queueEvent()
- {
- synchronized (queueLock)
- {
- queue++;
- if (queue == 1)
- SwingUtilities.invokeLater(drainer);
- }
- }
-}
diff --git a/libjava/javax/swing/ToolTipManager.java b/libjava/javax/swing/ToolTipManager.java
deleted file mode 100644
index 1bd66c2a10b..00000000000
--- a/libjava/javax/swing/ToolTipManager.java
+++ /dev/null
@@ -1,642 +0,0 @@
-/* ToolTipManager.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.LayoutManager;
-import java.awt.Panel;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseMotionListener;
-
-/**
- * This class is responsible for the registration of JToolTips to Components
- * and for displaying them when appropriate.
- */
-public class ToolTipManager extends MouseAdapter implements MouseMotionListener
-{
- /**
- * This ActionListener is associated with the Timer that listens to whether
- * the JToolTip can be hidden after four seconds.
- */
- protected class stillInsideTimerAction implements ActionListener
- {
- /**
- * This method creates a new stillInsideTimerAction object.
- */
- protected stillInsideTimerAction()
- {
- }
-
- /**
- * This method hides the JToolTip when the Timer has finished.
- *
- * @param event The ActionEvent.
- */
- public void actionPerformed(ActionEvent event)
- {
- hideTip();
- }
- }
-
- /**
- * This Actionlistener is associated with the Timer that listens to whether
- * the mouse cursor has re-entered the JComponent in time for an immediate
- * redisplay of the JToolTip.
- */
- protected class outsideTimerAction implements ActionListener
- {
- /**
- * This method creates a new outsideTimerAction object.
- */
- protected outsideTimerAction()
- {
- }
-
- /**
- * This method is called when the Timer that listens to whether the mouse
- * cursor has re-entered the JComponent has run out.
- *
- * @param event The ActionEvent.
- */
- public void actionPerformed(ActionEvent event)
- {
- }
- }
-
- /**
- * This ActionListener is associated with the Timer that listens to whether
- * it is time for the JToolTip to be displayed after the mouse has entered
- * the JComponent.
- */
- protected class insideTimerAction implements ActionListener
- {
- /**
- * This method creates a new insideTimerAction object.
- */
- protected insideTimerAction()
- {
- }
-
- /**
- * This method displays the JToolTip when the Mouse has been still for the
- * delay.
- *
- * @param event The ActionEvent.
- */
- public void actionPerformed(ActionEvent event)
- {
- showTip();
- if (insideTimer != null)
- insideTimer.start();
- }
- }
-
- /**
- * The Timer that determines whether the Mouse has been still long enough
- * for the JToolTip to be displayed.
- */
- Timer enterTimer;
-
- /**
- * The Timer that determines whether the Mouse has re-entered the JComponent
- * quickly enough for the JToolTip to be displayed immediately.
- */
- Timer exitTimer;
-
- /**
- * The Timer that determines whether the JToolTip has been displayed long
- * enough for it to be hidden.
- */
- Timer insideTimer;
-
- /** A global enabled setting for the ToolTipManager. */
- private transient boolean enabled = true;
-
- /** lightWeightPopupEnabled */
- protected boolean lightWeightPopupEnabled = true;
-
- /** heavyWeightPopupEnabled */
- protected boolean heavyWeightPopupEnabled = false;
-
- /** The shared instance of the ToolTipManager. */
- private static ToolTipManager shared;
-
- /** The current component the tooltip is being displayed for. */
- private static Component currentComponent;
-
- /** The current tooltip. */
- private static JToolTip currentTip;
-
- /** The last known position of the mouse cursor. */
- private static Point currentPoint;
-
- /**
- * The panel that holds the tooltip when the tooltip is displayed fully
- * inside the current container.
- */
- private static Container containerPanel;
-
- /**
- * The window used when the tooltip doesn't fit inside the current
- * container.
- */
- private static JWindow tooltipWindow;
-
- /**
- * Creates a new ToolTipManager and sets up the timers.
- */
- ToolTipManager()
- {
- enterTimer = new Timer(750, new insideTimerAction());
- enterTimer.setRepeats(false);
-
- insideTimer = new Timer(4000, new stillInsideTimerAction());
- insideTimer.setRepeats(false);
-
- exitTimer = new Timer(500, new outsideTimerAction());
- exitTimer.setRepeats(false);
- }
-
- /**
- * This method returns the shared instance of ToolTipManager used by all
- * JComponents.
- *
- * @return The shared instance of ToolTipManager.
- */
- public static ToolTipManager sharedInstance()
- {
- if (shared == null)
- shared = new ToolTipManager();
-
- return shared;
- }
-
- /**
- * This method sets whether ToolTips are enabled or disabled for all
- * JComponents.
- *
- * @param enabled Whether ToolTips are enabled or disabled for all
- * JComponents.
- */
- public void setEnabled(boolean enabled)
- {
- if (! enabled)
- {
- enterTimer.stop();
- exitTimer.stop();
- insideTimer.stop();
- }
-
- this.enabled = enabled;
- }
-
- /**
- * This method returns whether ToolTips are enabled.
- *
- * @return Whether ToolTips are enabled.
- */
- public boolean isEnabled()
- {
- return enabled;
- }
-
- /**
- * This method returns whether LightweightToolTips are enabled.
- *
- * @return Whether LighweightToolTips are enabled.
- */
- public boolean isLightWeightPopupEnabled()
- {
- return lightWeightPopupEnabled;
- }
-
- /**
- * This method sets whether LightweightToolTips are enabled. If you mix
- * Lightweight and Heavyweight components, you must set this to false to
- * ensure that the ToolTips popup above all other components.
- *
- * @param enabled Whether LightweightToolTips will be enabled.
- */
- public void setLightWeightPopupEnabled(boolean enabled)
- {
- lightWeightPopupEnabled = enabled;
- heavyWeightPopupEnabled = ! enabled;
- }
-
- /**
- * This method returns the initial delay before the ToolTip is shown when
- * the mouse enters a Component.
- *
- * @return The initial delay before the ToolTip is shown.
- */
- public int getInitialDelay()
- {
- return enterTimer.getDelay();
- }
-
- /**
- * This method sets the initial delay before the ToolTip is shown when the
- * mouse enters a Component.
- *
- * @param delay The initial delay before the ToolTip is shown.
- */
- public void setInitialDelay(int delay)
- {
- enterTimer.setDelay(delay);
- }
-
- /**
- * This method returns the time the ToolTip will be shown before being
- * hidden.
- *
- * @return The time the ToolTip will be shown before being hidden.
- */
- public int getDismissDelay()
- {
- return insideTimer.getDelay();
- }
-
- /**
- * This method sets the time the ToolTip will be shown before being hidden.
- *
- * @param delay The time the ToolTip will be shown before being hidden.
- */
- public void setDismissDelay(int delay)
- {
- insideTimer.setDelay(delay);
- }
-
- /**
- * This method returns the amount of delay where if the mouse re-enters a
- * Component, the tooltip will be shown immediately.
- *
- * @return The reshow delay.
- */
- public int getReshowDelay()
- {
- return exitTimer.getDelay();
- }
-
- /**
- * This method sets the amount of delay where if the mouse re-enters a
- * Component, the tooltip will be shown immediately.
- *
- * @param delay The reshow delay.
- */
- public void setReshowDelay(int delay)
- {
- exitTimer.setDelay(delay);
- }
-
- /**
- * This method registers a JComponent with the ToolTipManager.
- *
- * @param component The JComponent to register with the ToolTipManager.
- */
- public void registerComponent(JComponent component)
- {
- component.addMouseListener(this);
- component.addMouseMotionListener(this);
- }
-
- /**
- * This method unregisters a JComponent with the ToolTipManager.
- *
- * @param component The JComponent to unregister with the ToolTipManager.
- */
- public void unregisterComponent(JComponent component)
- {
- component.removeMouseMotionListener(this);
- component.removeMouseListener(this);
- }
-
- /**
- * This method is called whenever the mouse enters a JComponent registered
- * with the ToolTipManager. When the mouse enters within the period of time
- * specified by the reshow delay, the tooltip will be displayed
- * immediately. Otherwise, it must wait for the initial delay before
- * displaying the tooltip.
- *
- * @param event The MouseEvent.
- */
- public void mouseEntered(MouseEvent event)
- {
- if (currentComponent != null
- && getContentPaneDeepestComponent(event) == currentComponent)
- return;
- currentPoint = event.getPoint();
- currentComponent = (Component) event.getSource();
-
- if (exitTimer.isRunning())
- {
- exitTimer.stop();
- showTip();
- insideTimer.start();
- return;
- }
-
- // This should always be stopped unless we have just fake-exited.
- if (! enterTimer.isRunning())
- enterTimer.start();
- }
-
- /**
- * This method is called when the mouse exits a JComponent registered with
- * the ToolTipManager. When the mouse exits, the tooltip should be hidden
- * immediately.
- *
- * @param event The MouseEvent.
- */
- public void mouseExited(MouseEvent event)
- {
- if (getContentPaneDeepestComponent(event) == currentComponent)
- return;
-
- currentPoint = event.getPoint();
- currentComponent = null;
- hideTip();
-
- if (! enterTimer.isRunning() && insideTimer.isRunning())
- exitTimer.start();
- if (enterTimer.isRunning())
- enterTimer.stop();
- if (insideTimer.isRunning())
- insideTimer.stop();
- }
-
- /**
- * This method is called when the mouse is pressed on a JComponent
- * registered with the ToolTipManager. When the mouse is pressed, the
- * tooltip (if it is shown) must be hidden immediately.
- *
- * @param event The MouseEvent.
- */
- public void mousePressed(MouseEvent event)
- {
- currentPoint = event.getPoint();
- if (enterTimer.isRunning())
- enterTimer.restart();
- else if (insideTimer.isRunning())
- {
- insideTimer.stop();
- hideTip();
- }
- currentComponent.invalidate();
- currentComponent.validate();
- currentComponent.repaint();
- }
-
- /**
- * This method is called when the mouse is dragged in a JComponent
- * registered with the ToolTipManager.
- *
- * @param event The MouseEvent.
- */
- public void mouseDragged(MouseEvent event)
- {
- currentPoint = event.getPoint();
- if (enterTimer.isRunning())
- enterTimer.restart();
- }
-
- /**
- * This method is called when the mouse is moved in a JComponent registered
- * with the ToolTipManager.
- *
- * @param event The MouseEvent.
- */
- public void mouseMoved(MouseEvent event)
- {
- currentPoint = event.getPoint();
- if (currentTip != null)
- {
- if (currentComponent == null)
- currentComponent = (Component) event.getSource();
-
- String text = ((JComponent) currentComponent).getToolTipText(event);
- currentTip.setTipText(text);
- }
- if (enterTimer.isRunning())
- enterTimer.restart();
- }
-
- /**
- * This method displays the ToolTip. It can figure out the method needed to
- * show it as well (whether to display it in heavyweight/lightweight panel
- * or a window.) This is package-private to avoid an accessor method.
- */
- void showTip()
- {
- if (! enabled || currentComponent == null)
- return;
-
- if (currentTip == null
- || currentTip.getComponent() != currentComponent
- && currentComponent instanceof JComponent)
- currentTip = ((JComponent) currentComponent).createToolTip();
- Point p = currentPoint;
- Dimension dims = currentTip.getPreferredSize();
- if (canToolTipFit(currentTip))
- {
- JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class,
- currentComponent))
- .getLayeredPane();
-
- // This should never happen, but just in case.
- if (pane == null)
- return;
-
- if (containerPanel != null)
- hideTip();
- if (isLightWeightPopupEnabled())
- {
- containerPanel = new Panel();
- JRootPane root = new JRootPane();
- root.getContentPane().add(currentTip);
- containerPanel.add(root);
- }
- else
- {
- containerPanel = new JPanel();
- containerPanel.add(currentTip);
- }
- LayoutManager lm = containerPanel.getLayout();
- if (lm instanceof FlowLayout)
- {
- FlowLayout fm = (FlowLayout) lm;
- fm.setVgap(0);
- fm.setHgap(0);
- }
-
- p = getGoodPoint(p, pane, currentTip, dims);
-
- pane.add(containerPanel);
- containerPanel.setBounds(p.x, p.y, dims.width, dims.height);
- currentTip.setBounds(0, 0, dims.width, dims.height);
-
- pane.revalidate();
- pane.repaint();
- }
- else
- {
- SwingUtilities.convertPointToScreen(p, currentComponent);
- tooltipWindow = new JWindow();
- tooltipWindow.getContentPane().add(currentTip);
- tooltipWindow.setFocusable(false);
- tooltipWindow.pack();
- tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height);
- tooltipWindow.show();
- }
- currentTip.setVisible(true);
- }
-
- /**
- * This method hides the ToolTip.
- * This is package-private to avoid an accessor method.
- */
- void hideTip()
- {
- if (currentTip == null || ! currentTip.isVisible() || ! enabled)
- return;
- currentTip.setVisible(false);
- if (containerPanel != null)
- {
- Container parent = containerPanel.getParent();
- if (parent == null)
- return;
- parent.remove(containerPanel);
- parent.invalidate();
- parent.validate();
- parent.repaint();
-
- parent = currentTip.getParent();
- if (parent == null)
- return;
- parent.remove(currentTip);
-
- containerPanel = null;
- }
- if (tooltipWindow != null)
- {
- tooltipWindow.hide();
- tooltipWindow.dispose();
- tooltipWindow = null;
- }
- }
-
- /**
- * This method returns a point in the LayeredPane where the ToolTip can be
- * shown. The point returned (if the ToolTip is to be displayed at the
- * preferred dimensions) will always place the ToolTip inside the
- * currentComponent if possible.
- *
- * @param p The last known good point for the mouse.
- * @param c The JLayeredPane in the first RootPaneContainer up from the
- * currentComponent.
- * @param tip The ToolTip to display.
- * @param dims The ToolTip preferred dimensions (can be null).
- *
- * @return A good point to place the ToolTip.
- */
- private Point getGoodPoint(Point p, JLayeredPane c, JToolTip tip,
- Dimension dims)
- {
- if (dims == null)
- dims = tip.getPreferredSize();
- Rectangle bounds = currentComponent.getBounds();
- if (p.x + dims.width > bounds.width)
- p.x = bounds.width - dims.width;
- if (p.y + dims.height > bounds.height)
- p.y = bounds.height - dims.height;
-
- p = SwingUtilities.convertPoint(currentComponent, p, c);
- return p;
- }
-
- /**
- * This method returns the deepest component in the content pane for the
- * first RootPaneContainer up from the currentComponent. This method is
- * used in conjunction with one of the mouseXXX methods.
- *
- * @param e The MouseEvent.
- *
- * @return The deepest component in the content pane.
- */
- private Component getContentPaneDeepestComponent(MouseEvent e)
- {
- Component source = (Component) e.getSource();
- Container parent = (Container) SwingUtilities.getAncestorOfClass(JRootPane.class,
- currentComponent);
- if (parent == null)
- return null;
- parent = ((JRootPane) parent).getContentPane();
- Point p = e.getPoint();
- p = SwingUtilities.convertPoint(source, p, parent);
- Component target = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y);
- return target;
- }
-
- /**
- * This method returns whether the ToolTip can fit in the first
- * RootPaneContainer up from the currentComponent.
- *
- * @param tip The ToolTip.
- *
- * @return Whether the ToolTip can fit.
- */
- private boolean canToolTipFit(JToolTip tip)
- {
- JRootPane root = (JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class,
- currentComponent);
- if (root == null)
- return false;
- Dimension pref = tip.getPreferredSize();
- Dimension rootSize = root.getSize();
- if (rootSize.width > pref.width && rootSize.height > pref.height)
- return true;
- return false;
- }
-}
diff --git a/libjava/javax/swing/TransferHandler.java b/libjava/javax/swing/TransferHandler.java
deleted file mode 100644
index d5948aa1f28..00000000000
--- a/libjava/javax/swing/TransferHandler.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/* TransferHandler.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.datatransfer.Clipboard;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.event.ActionEvent;
-import java.awt.event.InputEvent;
-import java.io.Serializable;
-
-public class TransferHandler implements Serializable
-{
- static class TransferAction extends AbstractAction
- {
- private String command;
-
- public TransferAction(String command)
- {
- this.command = command;
- }
-
- public void actionPerformed(ActionEvent event)
- {
- JComponent component = (JComponent) event.getSource();
- TransferHandler transferHandler = component.getTransferHandler();
- Clipboard clipboard = getClipboard(component);
-
- if (command.equals(COMMAND_COPY))
- transferHandler.exportToClipboard(component, clipboard, COPY);
- else if (command.equals(COMMAND_CUT))
- transferHandler.exportToClipboard(component, clipboard, MOVE);
- else if (command.equals(COMMAND_PASTE))
- {
- Transferable transferable = clipboard.getContents(null);
-
- if (transferable != null)
- transferHandler.importData(component, transferable);
- }
- }
-
- private static Clipboard getClipboard(JComponent component)
- {
- SecurityManager sm = System.getSecurityManager();
-
- if (sm != null)
- {
- try
- {
- sm.checkSystemClipboardAccess();
-
- // We may access system clipboard.
- return component.getToolkit().getSystemClipboard();
- }
- catch (SecurityException e)
- {
- // We may not access system clipboard.
- }
- }
-
- // Create VM-local clipboard if non exists yet.
- if (clipboard == null)
- clipboard = new Clipboard("Clipboard");
-
- return clipboard;
- }
- }
-
- private static final long serialVersionUID = -7908749299918704233L;
-
- private static final String COMMAND_COPY = "copy";
- private static final String COMMAND_CUT = "cut";
- private static final String COMMAND_PASTE = "paste";
-
- public static final int NONE = 0;
- public static final int COPY = 1;
- public static final int MOVE = 2;
- public static final int COPY_OR_MOVE = 3;
-
- private static Action copyAction = new TransferAction(COMMAND_COPY);
- private static Action cutAction = new TransferAction(COMMAND_CUT);
- private static Action pasteAction = new TransferAction(COMMAND_PASTE);
-
- /**
- * Clipboard if system clipboard may not be used.
- * Package-private to avoid an accessor method.
- */
- static Clipboard clipboard;
-
- private int sourceActions;
- private Icon visualRepresentation;
-
- public static Action getCopyAction()
- {
- return copyAction;
- }
-
- public static Action getCutAction()
- {
- return cutAction;
- }
-
- public static Action getPasteAction()
- {
- return pasteAction;
- }
-
- protected TransferHandler()
- {
- this.sourceActions = NONE;
- }
-
- public TransferHandler(String property)
- {
- this.sourceActions = property != null ? COPY : NONE;
- }
-
- public boolean canImport (JComponent c, DataFlavor[] flavors)
- {
- return false;
- }
-
- protected Transferable createTransferable(JComponent c)
- {
- return null;
- }
-
- public void exportAsDrag (JComponent c, InputEvent e, int action)
- {
- }
-
- protected void exportDone (JComponent c, Transferable data, int action)
- {
- }
-
- public void exportToClipboard(JComponent c, Clipboard clip, int action)
- {
- }
-
- public int getSourceActions (JComponent c)
- {
- return sourceActions;
- }
-
- public Icon getVisualRepresentation (Transferable t)
- {
- return visualRepresentation;
- }
-
- public boolean importData (JComponent c, Transferable t)
- {
- return false;
- }
-}
diff --git a/libjava/javax/swing/UIDefaults.java b/libjava/javax/swing/UIDefaults.java
deleted file mode 100644
index 641d8488972..00000000000
--- a/libjava/javax/swing/UIDefaults.java
+++ /dev/null
@@ -1,828 +0,0 @@
-/* UIDefaults.java -- database for all settings and interface bindings.
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.Insets;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.lang.reflect.Method;
-import java.util.Hashtable;
-import java.util.LinkedList;
-import java.util.ListIterator;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import javax.swing.border.Border;
-import javax.swing.plaf.ComponentUI;
-
-/**
- * UIDefaults is a database where all settings and interface bindings are
- * stored into. A PLAF implementation fills one of these (see for example
- * plaf/basic/BasicLookAndFeel.java) with "ButtonUI" -&gt; new BasicButtonUI().
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public class UIDefaults extends Hashtable
-{
-
- /** Our ResourceBundles. */
- private LinkedList bundles;
-
- /** The default locale. */
- private Locale defaultLocale;
-
- /** We use this for firing PropertyChangeEvents. */
- private PropertyChangeSupport propertyChangeSupport;
-
- public static interface ActiveValue
- {
- Object createValue(UIDefaults table);
- }
-
- public static class LazyInputMap implements LazyValue
- {
- Object[] bind;
- public LazyInputMap(Object[] bindings)
- {
- bind = bindings;
- }
- public Object createValue(UIDefaults table)
- {
- InputMap im = new InputMap ();
- for (int i = 0; 2*i+1 < bind.length; ++i)
- {
- im.put (KeyStroke.getKeyStroke ((String) bind[2*i]),
- bind[2*i+1]);
- }
- return im;
- }
- }
-
- public static interface LazyValue
- {
- Object createValue(UIDefaults table);
- }
-
- public static class ProxyLazyValue implements LazyValue
- {
- LazyValue inner;
- public ProxyLazyValue(String s)
- {
- final String className = s;
- inner = new LazyValue ()
- {
- public Object createValue (UIDefaults table)
- {
- try
- {
- return Class
- .forName(className)
- .getConstructor(new Class[] {})
- .newInstance(new Object[] {});
- }
- catch (Exception e)
- {
- return null;
- }
- }
- };
- }
-
- public ProxyLazyValue(String c, String m)
- {
- final String className = c;
- final String methodName = m;
- inner = new LazyValue ()
- {
- public Object createValue (UIDefaults table)
- {
- try
- {
- return Class
- .forName (className)
- .getMethod (methodName, new Class[] {})
- .invoke (null, new Object[] {});
- }
- catch (Exception e)
- {
- return null;
- }
- }
- };
- }
-
- public ProxyLazyValue(String c, Object[] os)
- {
- final String className = c;
- final Object[] objs = os;
- final Class[] clss = new Class[objs.length];
- for (int i = 0; i < objs.length; ++i)
- {
- clss[i] = objs[i].getClass();
- }
- inner = new LazyValue()
- {
- public Object createValue(UIDefaults table)
- {
- try
- {
- return Class
- .forName(className)
- .getConstructor(clss)
- .newInstance(objs);
- }
- catch (Exception e)
- {
- return null;
- }
- }
- };
- }
-
- public ProxyLazyValue(String c, String m, Object[] os)
- {
- final String className = c;
- final String methodName = m;
- final Object[] objs = os;
- final Class[] clss = new Class[objs.length];
- for (int i = 0; i < objs.length; ++i)
- {
- clss[i] = objs[i].getClass();
- }
- inner = new LazyValue()
- {
- public Object createValue(UIDefaults table)
- {
- try
- {
- return Class
- .forName(className)
- .getMethod(methodName, clss)
- .invoke(null, objs);
- }
- catch (Exception e)
- {
- return null;
- }
- }
- };
- }
-
- public Object createValue(UIDefaults table)
- {
- return inner.createValue(table);
- }
- }
-
- /** Our serialVersionUID for serialization. */
- private static final long serialVersionUID = 7341222528856548117L;
-
- /**
- * Constructs a new empty UIDefaults instance.
- */
- public UIDefaults()
- {
- bundles = new LinkedList();
- defaultLocale = Locale.getDefault();
- propertyChangeSupport = new PropertyChangeSupport(this);
- }
-
- /**
- * Constructs a new UIDefaults instance and loads the specified entries.
- * The entries are expected to come in pairs, that means
- * <code>entries[0]</code> is a key, <code>entries[1]</code> is a value,
- * <code>entries[2]</code> a key and so forth.
- *
- * @param entries the entries to initialize the UIDefaults instance with
- */
- public UIDefaults(Object[] entries)
- {
- this();
-
- for (int i = 0; (2 * i + 1) < entries.length; ++i)
- put(entries[2 * i], entries[2 * i + 1]);
- }
-
- /**
- * Returns the entry for the specified <code>key</code> in the default
- * locale.
- *
- * @return the entry for the specified <code>key</code>
- */
- public Object get(Object key)
- {
- return this.get(key, getDefaultLocale());
- }
-
- /**
- * Returns the entry for the specified <code>key</code> in the Locale
- * <code>loc</code>.
- *
- * @param key the key for which we return the value
- * @param loc the locale
- */
- public Object get(Object key, Locale loc)
- {
- Object obj = null;
-
- if (super.containsKey(key))
- {
- obj = super.get(key);
- }
- else if (key instanceof String)
- {
- String keyString = (String) key;
- ListIterator i = bundles.listIterator(0);
- while (i.hasNext())
- {
- String bundle_name = (String) i.next();
- ResourceBundle res =
- ResourceBundle.getBundle(bundle_name, loc);
- if (res != null)
- {
- try
- {
- obj = res.getObject(keyString);
- break;
- }
- catch (MissingResourceException me)
- {
- // continue, this bundle has no such key
- }
- }
- }
- }
-
- // now we've found the object, resolve it.
- // nb: LazyValues aren't supported in resource bundles, so it's correct
- // to insert their results in the locale-less hashtable.
-
- if (obj == null)
- return null;
-
- if (obj instanceof LazyValue)
- {
- Object resolved = ((LazyValue) obj).createValue(this);
- super.remove(key);
- super.put(key, resolved);
- return resolved;
- }
- else if (obj instanceof ActiveValue)
- {
- return ((ActiveValue) obj).createValue(this);
- }
-
- return obj;
- }
-
- /**
- * Puts a key and value into this UIDefaults object.<br>
- * In contrast to
- * {@link java.util.Hashtable}s <code>null</code>-values are accepted
- * here and treated like #remove(key).
- * <br>
- * This fires a PropertyChangeEvent with key as name and the old and new
- * values.
- *
- * @param key the key to put into the map
- * @param value the value to put into the map
- *
- * @return the old value for key or <code>null</code> if <code>key</code>
- * had no value assigned
- */
- public Object put(Object key, Object value)
- {
- Object old = checkAndPut(key, value);
-
- if (key instanceof String && old != value)
- firePropertyChange((String) key, old, value);
- return old;
- }
-
- /**
- * Puts a set of key-value pairs into the map.
- * The entries are expected to come in pairs, that means
- * <code>entries[0]</code> is a key, <code>entries[1]</code> is a value,
- * <code>entries[2]</code> a key and so forth.
- * <br>
- * If a value is <code>null</code> it is treated like #remove(key).
- * <br>
- * This unconditionally fires a PropertyChangeEvent with
- * <code>&apos;UIDefaults&apos;</code> as name and <code>null</code> for
- * old and new value.
- *
- * @param entries the entries to be put into the map
- */
- public void putDefaults(Object[] entries)
- {
- for (int i = 0; (2 * i + 1) < entries.length; ++i)
- {
- checkAndPut(entries[2 * i], entries[2 * i + 1]);
- }
- firePropertyChange("UIDefaults", null, null);
- }
-
- /**
- * Checks the value for <code>null</code> and put it into the Hashtable, if
- * it is not <code>null</code>. If the value is <code>null</code> then
- * remove the corresponding key.
- *
- * @param key the key to put into this UIDefauls table
- * @param value the value to put into this UIDefaults table
- *
- * @return the old value for <code>key</code>
- */
- private Object checkAndPut(Object key, Object value)
- {
- Object old;
-
- if (value != null)
- old = super.put(key, value);
- else
- old = super.remove(key);
-
- return old;
- }
-
- /**
- * Returns a font entry for the default locale.
- *
- * @param key the key to the requested entry
- *
- * @return the font entry for <code>key</code> or null if no such entry
- * exists
- */
- public Font getFont(Object key)
- {
- Object o = get(key);
- return o instanceof Font ? (Font) o : null;
- }
-
- /**
- * Returns a font entry for a specic locale.
- *
- * @param key the key to the requested entry
- * @param locale the locale to the requested entry
- *
- * @return the font entry for <code>key</code> or null if no such entry
- * exists
- */
- public Font getFont(Object key, Locale l)
- {
- Object o = get(key, l);
- return o instanceof Font ? (Font) o : null;
- }
-
- /**
- * Returns a color entry for the default locale.
- *
- * @param key the key to the requested entry
- *
- * @return the color entry for <code>key</code> or null if no such entry
- * exists
- */
- public Color getColor(Object key)
- {
- Object o = get(key);
- return o instanceof Color ? (Color) o : null;
- }
-
- /**
- * Returns a color entry for a specic locale.
- *
- * @param key the key to the requested entry
- * @param locale the locale to the requested entry
- *
- * @return the color entry for <code>key</code> or null if no such entry
- * exists
- */
- public Color getColor(Object key, Locale l)
- {
- Object o = get(key, l);
- return o instanceof Color ? (Color) o : null;
- }
-
- /**
- * Returns an icon entry for the default locale.
- *
- * @param key the key to the requested entry
- *
- * @return the icon entry for <code>key</code> or null if no such entry
- * exists
- */
- public Icon getIcon(Object key)
- {
- Object o = get(key);
- return o instanceof Icon ? (Icon) o : null;
- }
-
- /**
- * Returns an icon entry for a specic locale.
- *
- * @param key the key to the requested entry
- * @param locale the locale to the requested entry
- *
- * @return the icon entry for <code>key</code> or null if no such entry
- * exists
- */
- public Icon getIcon(Object key, Locale l)
- {
- Object o = get(key, l);
- return o instanceof Icon ? (Icon) o : null;
- }
-
- /**
- * Returns a border entry for the default locale.
- *
- * @param key the key to the requested entry
- *
- * @return the border entry for <code>key</code> or null if no such entry
- * exists
- */
- public Border getBorder(Object key)
- {
- Object o = get(key);
- return o instanceof Border ? (Border) o : null;
- }
-
- /**
- * Returns a border entry for a specic locale.
- *
- * @param key the key to the requested entry
- * @param locale the locale to the requested entry
- *
- * @return the border entry for <code>key</code> or null if no such entry
- * exists
- */
- public Border getBorder(Object key, Locale l)
- {
- Object o = get(key, l);
- return o instanceof Border ? (Border) o : null;
- }
-
- /**
- * Returns a string entry for the default locale.
- *
- * @param key the key to the requested entry
- *
- * @return the string entry for <code>key</code> or null if no such entry
- * exists
- */
- public String getString(Object key)
- {
- Object o = get(key);
- return o instanceof String ? (String) o : null;
- }
-
- /**
- * Returns a string entry for a specic locale.
- *
- * @param key the key to the requested entry
- * @param locale the locale to the requested entry
- *
- * @return the string entry for <code>key</code> or null if no such entry
- * exists
- */
- public String getString(Object key, Locale l)
- {
- Object o = get(key, l);
- return o instanceof String ? (String) o : null;
- }
-
- /**
- * Returns an integer entry for the default locale.
- *
- * @param key the key to the requested entry
- *
- * @return the integer entry for <code>key</code> or null if no such entry
- * exists
- */
- public int getInt(Object key)
- {
- Object o = get(key);
- return o instanceof Integer ? ((Integer) o).intValue() : 0;
- }
-
- /**
- * Returns an integer entry for a specic locale.
- *
- * @param key the key to the requested entry
- * @param locale the locale to the requested entry
- *
- * @return the integer entry for <code>key</code> or null if no such entry
- * exists
- */
- public int getInt(Object key, Locale l)
- {
- Object o = get(key, l);
- return o instanceof Integer ? ((Integer) o).intValue() : 0;
- }
-
- /**
- * Returns a boolean entry for the default locale.
- *
- * @param key the key to the requested entry
- *
- * @return the boolean entry for <code>key</code> or null if no such entry
- * exists
- */
- public boolean getBoolean(Object key)
- {
- return Boolean.TRUE.equals(get(key));
- }
-
- /**
- * Returns a boolean entry for a specic locale.
- *
- * @param key the key to the requested entry
- * @param locale the locale to the requested entry
- *
- * @return the boolean entry for <code>key</code> or null if no such entry
- * exists
- */
- public boolean getBoolean(Object key, Locale l)
- {
- return Boolean.TRUE.equals(get(key, l));
- }
-
- /**
- * Returns an insets entry for the default locale.
- *
- * @param key the key to the requested entry
- *
- * @return the insets entry for <code>key</code> or null if no such entry
- * exists
- */
- public Insets getInsets(Object key)
- {
- Object o = get(key);
- return o instanceof Insets ? (Insets) o : null;
- }
-
- /**
- * Returns an insets entry for a specic locale.
- *
- * @param key the key to the requested entry
- * @param locale the locale to the requested entry
- *
- * @return the boolean entry for <code>key</code> or null if no such entry
- * exists
- */
- public Insets getInsets(Object key, Locale l)
- {
- Object o = get(key, l);
- return o instanceof Insets ? (Insets) o : null;
- }
-
- /**
- * Returns a dimension entry for the default locale.
- *
- * @param key the key to the requested entry
- *
- * @return the dimension entry for <code>key</code> or null if no such entry
- * exists
- */
- public Dimension getDimension(Object key)
- {
- Object o = get(key);
- return o instanceof Dimension ? (Dimension) o : null;
- }
-
- /**
- * Returns a dimension entry for a specic locale.
- *
- * @param key the key to the requested entry
- * @param locale the locale to the requested entry
- *
- * @return the boolean entry for <code>key</code> or null if no such entry
- * exists
- */
- public Dimension getDimension(Object key, Locale l)
- {
- Object o = get(key, l);
- return o instanceof Dimension ? (Dimension) o : null;
- }
-
- /**
- * Returns the ComponentUI class that renders a component. <code>id</code>
- * is the ID for which the String value of the classname is stored in
- * this UIDefaults map.
- *
- * @param id the ID of the UI class
- * @param loader the ClassLoader to use
- *
- * @return the UI class for <code>id</code>
- */
- public Class getUIClass(String id, ClassLoader loader)
- {
- String className = (String) get (id);
- if (className == null)
- return null;
- try
- {
- if (loader != null)
- return loader.loadClass (className);
- return Class.forName (className);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * Returns the ComponentUI class that renders a component. <code>id</code>
- * is the ID for which the String value of the classname is stored in
- * this UIDefaults map.
- *
- * @param id the ID of the UI class
- *
- * @return the UI class for <code>id</code>
- */
- public Class getUIClass(String id)
- {
- return getUIClass (id, null);
- }
-
- /**
- * If a key is requested in #get(key) that has no value, this method
- * is called before returning <code>null</code>.
- *
- * @param msg the error message
- */
- protected void getUIError(String msg)
- {
- System.err.println ("UIDefaults.getUIError: " + msg);
- }
-
- /**
- * Returns the {@link ComponentUI} for the specified {@link JComponent}.
- *
- * @param target the component for which the ComponentUI is requested
- *
- * @return the {@link ComponentUI} for the specified {@link JComponent}
- */
- public ComponentUI getUI(JComponent target)
- {
- String classId = target.getUIClassID ();
- Class cls = getUIClass (classId);
- if (cls == null)
- {
- getUIError ("failed to locate UI class:" + classId);
- return null;
- }
-
- Method factory;
-
- try
- {
- factory = cls.getMethod ("createUI", new Class[] { JComponent.class } );
- }
- catch (NoSuchMethodException nme)
- {
- getUIError ("failed to locate createUI method on " + cls.toString ());
- return null;
- }
-
- try
- {
- return (ComponentUI) factory.invoke (null, new Object[] { target });
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- getUIError ("InvocationTargetException ("+ ite.getTargetException()
- +") calling createUI(...) on " + cls.toString ());
- return null;
- }
- catch (Exception e)
- {
- getUIError ("exception calling createUI(...) on " + cls.toString ());
- return null;
- }
- }
-
- /**
- * Adds a {@link PropertyChangeListener} to this UIDefaults map.
- * Registered PropertyChangeListener are notified when values
- * are beeing put into this UIDefaults map.
- *
- * @param listener the PropertyChangeListener to add
- */
- public void addPropertyChangeListener(PropertyChangeListener listener)
- {
- propertyChangeSupport.addPropertyChangeListener(listener);
- }
-
- /**
- * Removes a PropertyChangeListener from this UIDefaults map.
- *
- * @param listener the PropertyChangeListener to remove
- */
- public void removePropertyChangeListener(PropertyChangeListener listener)
- {
- propertyChangeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * Returns an array of all registered PropertyChangeListeners.
- *
- * @return all registered PropertyChangeListeners
- */
- public PropertyChangeListener[] getPropertyChangeListeners()
- {
- return propertyChangeSupport.getPropertyChangeListeners();
- }
-
- /**
- * Fires a PropertyChangeEvent.
- *
- * @param property the property name
- * @param oldValue the old value
- * @param newValue the new value
- */
- protected void firePropertyChange(String property,
- Object oldValue, Object newValue)
- {
- propertyChangeSupport.firePropertyChange(property, oldValue, newValue);
- }
-
- /**
- * Adds a ResourceBundle for localized values.
- *
- * @param name the name of the ResourceBundle to add
- */
- public void addResourceBundle(String name)
- {
- bundles.addFirst(name);
- }
-
- /**
- * Removes a ResourceBundle.
- *
- * @param name the name of the ResourceBundle to remove
- */
- public void removeResourceBundle(String name)
- {
- bundles.remove(name);
- }
-
- /**
- * Sets the current locale to <code>loc</code>.
- *
- * @param loc the Locale to be set
- */
- public void setDefaultLocale(Locale loc)
- {
- defaultLocale = loc;
- }
-
- /**
- * Returns the current default locale.
- *
- * @return the current default locale
- */
- public Locale getDefaultLocale()
- {
- return defaultLocale;
- }
-}
diff --git a/libjava/javax/swing/UIManager.java b/libjava/javax/swing/UIManager.java
deleted file mode 100644
index 8a9d1d9db32..00000000000
--- a/libjava/javax/swing/UIManager.java
+++ /dev/null
@@ -1,474 +0,0 @@
-/* UIManager.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.Insets;
-import java.beans.PropertyChangeListener;
-import java.io.Serializable;
-import java.util.Locale;
-
-import javax.swing.border.Border;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.metal.MetalLookAndFeel;
-
-public class UIManager implements Serializable
-{
- public static class LookAndFeelInfo
- {
- String name, clazz;
-
- public LookAndFeelInfo(String name,
- String clazz)
- {
- this.name = name;
- this.clazz = clazz;
- }
-
- public String getName()
- {
- return name;
- }
-
- public String getClassName()
- {
- return clazz;
- }
- }
-
- private static final long serialVersionUID = -5547433830339189365L;
-
- static LookAndFeelInfo [] installed = {
- new LookAndFeelInfo ("Metal", "javax.swing.plaf.metal.MetalLookAndFeel")
- };
-
- static LookAndFeel[] aux_installed;
-
- static LookAndFeel look_and_feel = new MetalLookAndFeel();
-
- static
- {
- String defaultlaf = System.getProperty("swing.defaultlaf");
- try {
- if (defaultlaf != null)
- {
- Class lafClass = Class.forName(defaultlaf);
- LookAndFeel laf = (LookAndFeel) lafClass.newInstance();
- setLookAndFeel(laf);
- }
- }
- catch (Exception ex)
- {
- System.err.println("cannot initialize Look and Feel: " + defaultlaf);
- System.err.println("errot: " + ex.getMessage());
- System.err.println("falling back to Metal Look and Feel");
- }
- }
-
- public UIManager()
- {
- // Do nothing here.
- }
-
- /**
- * Add a <code>PropertyChangeListener</code> to the listener list.
- *
- * @param listener the listener to add
- */
- public static void addPropertyChangeListener(PropertyChangeListener listener)
- {
- // FIXME
- }
-
- /**
- * Remove a <code>PropertyChangeListener</code> from the listener list.
- *
- * @param listener the listener to remove
- */
- public static void removePropertyChangeListener(PropertyChangeListener listener)
- {
- // FIXME
- }
-
- /**
- * Returns an array of all added <code>PropertyChangeListener</code> objects.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public static PropertyChangeListener[] getPropertyChangeListeners()
- {
- // FIXME
- throw new Error ("Not implemented");
- }
-
- /**
- * Add a LookAndFeel to the list of auxiliary look and feels.
- */
- public static void addAuxiliaryLookAndFeel (LookAndFeel l)
- {
- if (aux_installed == null)
- {
- aux_installed = new LookAndFeel[1];
- aux_installed[0] = l;
- return;
- }
-
- LookAndFeel[] T = new LookAndFeel[ aux_installed.length+1 ];
- System.arraycopy(aux_installed, 0, T, 0, aux_installed.length);
- aux_installed = T;
- aux_installed[aux_installed.length-1] = l;
- }
-
- public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)
- {
- if (aux_installed == null)
- return false;
-
- for (int i=0;i<aux_installed.length;i++)
- {
- if (aux_installed[i] == laf)
- {
- aux_installed[ i ] = aux_installed[aux_installed.length-1];
- LookAndFeel[] T = new LookAndFeel[ aux_installed.length-1 ];
- System.arraycopy (aux_installed, 0, T, 0, aux_installed.length-1);
- aux_installed = T;
- return true;
- }
- }
- return false;
- }
-
- public static LookAndFeel[] getAuxiliaryLookAndFeels()
- {
- return aux_installed;
- }
-
- public static Object get(Object key)
- {
- return getLookAndFeel().getDefaults().get(key);
- }
-
- public static Object get(Object key, Locale locale)
- {
- return getLookAndFeel().getDefaults().get(key ,locale);
- }
-
- /**
- * Returns a boolean value from the defaults table,
- * <code>false</code> if key is not present.
- *
- * @since 1.4
- */
- public static boolean getBoolean(Object key)
- {
- Boolean value = (Boolean) getLookAndFeel().getDefaults().get(key);
- return value != null ? value.booleanValue() : false;
- }
-
- /**
- * Returns a boolean value from the defaults table,
- * <code>false</code> if key is not present.
- *
- * @since 1.4
- */
- public static boolean getBoolean(Object key, Locale locale)
- {
- Boolean value = (Boolean) getLookAndFeel().getDefaults().get(key, locale);
- return value != null ? value.booleanValue() : false;
- }
-
- /**
- * Returns a border from the defaults table.
- */
- public static Border getBorder(Object key)
- {
- return (Border) getLookAndFeel().getDefaults().get(key);
- }
-
- /**
- * Returns a border from the defaults table.
- *
- * @since 1.4
- */
- public static Border getBorder(Object key, Locale locale)
- {
- return (Border) getLookAndFeel().getDefaults().get(key, locale);
- }
-
- /**
- * Returns a drawing color from the defaults table.
- */
- public static Color getColor(Object key)
- {
- return (Color) getLookAndFeel().getDefaults().get(key);
- }
-
- /**
- * Returns a drawing color from the defaults table.
- */
- public static Color getColor(Object key, Locale locale)
- {
- return (Color) getLookAndFeel().getDefaults().get(key);
- }
-
- /**
- * this string can be passed to Class.forName()
- */
- public static String getCrossPlatformLookAndFeelClassName()
- {
- return "javax.swing.plaf.metal.MetalLookAndFeel";
- }
-
- /**
- * Returns the default values for this look and feel.
- */
- public static UIDefaults getDefaults()
- {
- return getLookAndFeel().getDefaults();
- }
-
- /**
- * Returns a dimension from the defaults table.
- */
- public static Dimension getDimension(Object key)
- {
- return (Dimension) getLookAndFeel().getDefaults().get(key);
- }
-
- /**
- * Returns a dimension from the defaults table.
- */
- public static Dimension getDimension(Object key, Locale locale)
- {
- return (Dimension) getLookAndFeel().getDefaults().get(key, locale);
- }
-
- /**
- * Retrieves a font from the defaults table of the current
- * LookAndFeel.
- *
- * @param key an Object that specifies the font. Typically,
- * this is a String such as
- * <code>TitledBorder.font</code>.
- */
- public static Font getFont(Object key)
- {
- return (Font) getLookAndFeel().getDefaults().get(key);
- }
-
- /**
- * Retrieves a font from the defaults table of the current
- * LookAndFeel.
- *
- * @param key an Object that specifies the font. Typically,
- * this is a String such as
- * <code>TitledBorder.font</code>.
- */
- public static Font getFont(Object key, Locale locale)
- {
- return (Font) getLookAndFeel().getDefaults().get(key ,locale);
- }
-
- /**
- * Returns an Icon from the defaults table.
- */
- public static Icon getIcon(Object key)
- {
- return (Icon) getLookAndFeel().getDefaults().get(key);
- }
-
- /**
- * Returns an Icon from the defaults table.
- */
- public static Icon getIcon(Object key, Locale locale)
- {
- return (Icon) getLookAndFeel().getDefaults().get(key, locale);
- }
-
- /**
- * Returns an Insets object from the defaults table.
- */
- public static Insets getInsets(Object key)
- {
- return (Insets) getLookAndFeel().getDefaults().getInsets(key);
- }
-
- /**
- * Returns an Insets object from the defaults table.
- */
- public static Insets getInsets(Object key, Locale locale)
- {
- return (Insets) getLookAndFeel().getDefaults().getInsets(key, locale);
- }
-
- public static LookAndFeelInfo[] getInstalledLookAndFeels()
- {
- return installed;
- }
-
- public static int getInt(Object key)
- {
- Integer x = (Integer) getLookAndFeel().getDefaults().get(key);
- if (x == null)
- return 0;
- return x.intValue();
- }
-
- public static int getInt(Object key, Locale locale)
- {
- Integer x = (Integer) getLookAndFeel().getDefaults().get(key, locale);
- if (x == null)
- return 0;
- return x.intValue();
- }
-
- public static LookAndFeel getLookAndFeel()
- {
- return look_and_feel;
- }
-
- /**
- * Returns the <code>UIDefaults</code> table of the currently active
- * look and feel.
- */
- public static UIDefaults getLookAndFeelDefaults()
- {
- return getLookAndFeel().getDefaults();
- }
-
- /**
- * Returns a string from the defaults table.
- */
- public static String getString(Object key)
- {
- return (String) getLookAndFeel().getDefaults().get(key);
- }
-
- /**
- * Returns a string from the defaults table.
- */
- public static String getString(Object key, Locale locale)
- {
- return (String) getLookAndFeel().getDefaults().get(key, locale);
- }
-
- /**
- * Returns the name of the LookAndFeel class that implements the
- * native systems look and feel if there is one, otherwise the name
- * of the default cross platform LookAndFeel class.
- */
- public static String getSystemLookAndFeelClassName()
- {
- return getCrossPlatformLookAndFeelClassName();
- }
-
- /**
- * Returns the Look and Feel object that renders the target component.
- */
- public static ComponentUI getUI(JComponent target)
- {
- return getDefaults().getUI(target);
- }
-
- /**
- * Creates a new look and feel and adds it to the current array.
- */
- public static void installLookAndFeel(String name, String className)
- {
- }
-
- /**
- * Adds the specified look and feel to the current array and then calls
- * setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]).
- */
- public static void installLookAndFeel(LookAndFeelInfo info)
- {
- }
-
- /**
- * Stores an object in the defaults table.
- */
- public static Object put(Object key, Object value)
- {
- return getLookAndFeel().getDefaults().put(key,value);
- }
-
- /**
- * Replaces the current array of installed LookAndFeelInfos.
- */
- public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
- {
- }
-
- /**
- * Set the current default look.
- */
- public static void setLookAndFeel(LookAndFeel newLookAndFeel)
- throws UnsupportedLookAndFeelException
- {
- if (! newLookAndFeel.isSupportedLookAndFeel())
- throw new UnsupportedLookAndFeelException(newLookAndFeel.getName());
-
- if (look_and_feel != null)
- look_and_feel.uninitialize();
-
- // Set the current default look and feel using a LookAndFeel object.
- look_and_feel = newLookAndFeel;
- look_and_feel.initialize();
-
- //revalidate();
- //repaint();
- }
-
- /**
- * Set the current default look and feel using a class name.
- */
- public static void setLookAndFeel (String className)
- throws ClassNotFoundException, InstantiationException, IllegalAccessException,
- UnsupportedLookAndFeelException
- {
- Class c = Class.forName(className);
- LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception
- setLookAndFeel(a);
- }
-}
diff --git a/libjava/javax/swing/UnsupportedLookAndFeelException.java b/libjava/javax/swing/UnsupportedLookAndFeelException.java
deleted file mode 100644
index 5abe45fe117..00000000000
--- a/libjava/javax/swing/UnsupportedLookAndFeelException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* UnsupportedLookAndFeelException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-
-public class UnsupportedLookAndFeelException extends Exception
-{
- public UnsupportedLookAndFeelException(String a)
- {
- super(a);
- }
-}
diff --git a/libjava/javax/swing/ViewportLayout.java b/libjava/javax/swing/ViewportLayout.java
deleted file mode 100644
index 18b49125743..00000000000
--- a/libjava/javax/swing/ViewportLayout.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/* ViewportLayout.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.LayoutManager;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.io.Serializable;
-
-/**
- * ViewportLayout
- * @author Andrew Selkirk
- * @author Graydon Hoare
- */
-public class ViewportLayout implements LayoutManager, Serializable
-{
- private static final long serialVersionUID = -788225906076097229L;
-
- public ViewportLayout()
- {
- }
- public void addLayoutComponent(String name, Component c)
- {
- }
- public void removeLayoutComponent(Component c)
- {
- }
-
- public Dimension preferredLayoutSize(Container parent)
- {
- JViewport vp = (JViewport)parent;
- Component view = vp.getView();
- if (view != null)
- return view.getPreferredSize();
- else
- return new Dimension();
- }
-
- public Dimension minimumLayoutSize(Container parent)
- {
- JViewport vp = (JViewport)parent;
- Component view = vp.getView();
- if (view != null)
- return view.getMinimumSize();
- else
- return new Dimension();
- }
-
- /**
- * Layout the view and viewport to respect the following rules. These are
- * not precisely the rules described in sun's javadocs, but they are the
- * rules which sun's swing implementation follows, if you watch its
- * behavior:
- *
- * <ol>
- *
- * <li>If the port is larger than the view's minimum size, put the port
- * at view position <code>(0,0)</code> and make the view's size equal to
- * the port's.</li>
- *
- * <li>If the port is smaller than the view, leave the view at its
- * minimum size. also, do not move the port, <em>unless</em> the port
- * extends into space <em>past</em> the edge of the view. If so, move the
- * port up or to the left, in view space, by the amount of empty space
- * (keep the lower and right edges lined up)</li>
- *
- * </ol>
- *
- * @see JViewport#getViewSize
- * @see JViewport#setViewSize
- * @see JViewport#getViewPosition
- * @see JViewport#setViewPosition
- */
-
- public void layoutContainer(Container parent)
- {
- // The way to interpret this function is basically to ignore the names
- // of methods it calls, and focus on the variable names here. getViewRect
- // doesn't, for example, return the view; it returns the port bounds in
- // view space. Likwise setViewPosition doesn't reposition the view; it
- // positions the port, in view coordinates.
-
- 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
- // the viewport require inputs in view space.
-
- Rectangle portBounds = port.getViewRect();
- Dimension viewPref = view.getPreferredSize();
- Dimension viewMinimum = view.getMinimumSize();
- Point portLowerRight = new Point(portBounds.x + portBounds.width,
- portBounds.y + portBounds.height);
-
- // vertical implementation of the above rules
- if (portBounds.height >= viewMinimum.height)
- {
- portBounds.y = 0;
- viewPref.height = portBounds.height;
- }
- else
- {
- viewPref.height = viewMinimum.height;
- int overextension = portLowerRight.y - viewPref.height;
- if (overextension > 0)
- portBounds.y -= overextension;
- }
-
- // horizontal implementation of the above rules
- if (portBounds.width >= viewMinimum.width)
- {
- portBounds.x = 0;
- viewPref.width = portBounds.width;
- }
- else
- {
- viewPref.width = viewMinimum.width;
- int overextension = portLowerRight.x - viewPref.width;
- if (overextension > 0)
- portBounds.x -= overextension;
- }
-
- port.setViewPosition(portBounds.getLocation());
- port.setViewSize(viewPref);
- }
-}
diff --git a/libjava/javax/swing/WindowConstants.java b/libjava/javax/swing/WindowConstants.java
deleted file mode 100644
index 3a68e14384c..00000000000
--- a/libjava/javax/swing/WindowConstants.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* WindowConstants.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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;
-
-/**
- * WindowConstants
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface WindowConstants {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * DO_NOTHING_ON_CLOSE
- */
- int DO_NOTHING_ON_CLOSE = 0;
-
- /**
- * HIDE_ON_CLOSE
- */
- int HIDE_ON_CLOSE = 1;
-
- /**
- * DISPOSE_ON_CLOSE
- */
- int DISPOSE_ON_CLOSE = 2;
-
- /**
- * EXIT_ON_CLOSE
- */
- int EXIT_ON_CLOSE =3;
-
-
-} // WindowConstants
diff --git a/libjava/javax/swing/border/AbstractBorder.java b/libjava/javax/swing/border/AbstractBorder.java
deleted file mode 100644
index d755b6779d8..00000000000
--- a/libjava/javax/swing/border/AbstractBorder.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/* AbstractBorder.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.border;
-
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.io.Serializable;
-
-
-/**
- * An invisible zero-width border, serving as a base class for
- * implementing more interesting borders.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public abstract class AbstractBorder
- implements Border, Serializable
-{
- static final long serialVersionUID = -545885975315191844L;
-
-
- /**
- * Constructs a new AbstractBorder.
- */
- public AbstractBorder ()
- {
- }
-
-
- /**
- * Performs nothing, because the default implementation provided by
- * this class is an invisible, zero-width border. Subclasses will
- * likely want to override this method, but they are not required
- * for doing so.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder (Component c, Graphics g,
- int x, int y, int width, int height)
- {
- /* A previous version of Classpath had emitted a warning when
- * this method was called. The warning was removed because it is
- * perfectly legal for a subclass to not override the paintBorder
- * method. An example would be EmptyBorder.
- */
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge, which is zero
- * for the default implementation provided by AbstractButton.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets (Component c)
- {
- return new Insets (0, 0, 0, 0);
- }
-
-
- /**
- * Determines the insets of this border. The implementation provided
- * by AbstractButton sets the <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields of the passed
- * <code>insets</code> parameter to zero.
- *
- * @param c the component whose border is to be measured.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets (Component c, Insets insets)
- {
- insets.left = insets.right = insets.top = insets.bottom = 0;
- return insets;
- }
-
-
- /**
- * Determines whether or not this border is opaque. An opaque border
- * fills every pixel in its area when painting. Partially
- * translucent borders must return <code>false</code>, or ugly
- * artifacts can appear on screen. The default implementation
- * provided by AbstractBorder always returns <code>false</code>.
- *
- * @return <code>false</code>.
- */
- public boolean isBorderOpaque ()
- {
- return false;
- }
-
-
- /**
- * Returns a rectangle that covers the specified area minus this
- * border. Components that wish to determine an area into which
- * they can safely draw without intersecting with a border might
- * want to use this helper method.
- *
- * @param c the component in the center of this border.
- * @param x the horizontal position of the border.
- * @param y the vertical position of the border.
- * @param width the width of the available area for the border.
- * @param height the height of the available area for the border.
- */
- public Rectangle getInteriorRectangle (Component c,
- int x, int y, int width, int height)
- {
- return getInteriorRectangle (c, this, x, y, width, height);
- }
-
-
- /**
- * Returns a rectangle that covers the specified area minus a
- * border. Components that wish to determine an area into which
- * they can safely draw without intersecting with a border might
- * want to use this helper method.
- *
- * @param c the component in the center of this border.
- * @param x the horizontal position of the border.
- * @param y the vertical position of the border.
- * @param width the width of the available area for the border.
- * @param height the height of the available area for the border.
- */
- public static Rectangle getInteriorRectangle (Component c, Border b,
- int x, int y, int width, int height)
- {
- Insets borderInsets;
-
- if (b != null)
- {
- borderInsets = b.getBorderInsets (c);
- x += borderInsets.left;
- y += borderInsets.top;
- width -= borderInsets.left + borderInsets.right;
- height -= borderInsets.top + borderInsets.bottom;
- }
-
- return new Rectangle (x, y, width, height);
- }
-}
diff --git a/libjava/javax/swing/border/BevelBorder.java b/libjava/javax/swing/border/BevelBorder.java
deleted file mode 100644
index e755fdcc94c..00000000000
--- a/libjava/javax/swing/border/BevelBorder.java
+++ /dev/null
@@ -1,568 +0,0 @@
-/* BevelBorder.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.border;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-
-/**
- * A rectangular, two pixel thick border that causes the enclosed area
- * to appear as if it was raising out of or lowered into the screen. Some
- * LookAndFeels use this kind of border for rectangular buttons.
- *
- * <p>A BevelBorder has a highlight and a shadow color. In the raised
- * variant, the highlight color is used for the top and left edges,
- * and the shadow color is used for the bottom and right edge. For an
- * image, see the documentation of the individual constructors.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class BevelBorder
- extends AbstractBorder
-{
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = -1034942243356299676L;
-
-
- /**
- * Indicates that the BevelBorder looks like if the enclosed area was
- * raising out of the screen.
- */
- public static final int RAISED = 0;
-
-
- /**
- * Indicates that the BevelBorder looks like if the enclosed area was
- * pressed into the screen.
- */
- public static final int LOWERED = 1;
-
-
- /**
- * The type of this BevelBorder, which is either {@link #RAISED}
- * or {@link #LOWERED}.
- */
- protected int bevelType;
-
-
- /**
- * The outer highlight color, or <code>null</code> to indicate that
- * the color shall be derived from the background of the component
- * whose border is being painted.
- */
- protected Color highlightOuter;
-
-
- /**
- * The inner highlight color, or <code>null</code> to indicate that
- * the color shall be derived from the background of the component
- * whose border is being painted.
- */
- protected Color highlightInner;
-
-
- /**
- * The outer shadow color, or <code>null</code> to indicate that the
- * color shall be derived from the background of the component whose
- * border is being painted.
- */
- protected Color shadowOuter;
-
-
- /**
- * The inner shadow color, or <code>null</code> to indicate that the
- * color shall be derived from the background of the component whose
- * border is being painted.
- */
- protected Color shadowInner;
-
-
- /**
- * Constructs a BevelBorder whose colors will be derived from the
- * background of the enclosed component. The background color is
- * retrieved each time the border is painted, so a BevelBorder
- * constructed by this method will automatically reflect a change
- * to the component&#x2019;s background color.
- *
- * <p><img src="doc-files/BevelBorder-1.png" width="500" height="150"
- * alt="[An illustration showing raised and lowered BevelBorders]" />
- *
- * @param bevelType the desired appearance of the border. The value
- * must be either {@link #RAISED} or {@link #LOWERED}.
- *
- * @throws IllegalArgumentException if <code>bevelType</code> has
- * an unsupported value.
- */
- public BevelBorder(int bevelType)
- {
- if ((bevelType != RAISED) && (bevelType != LOWERED))
- throw new IllegalArgumentException();
-
- this.bevelType = bevelType;
- }
-
-
- /**
- * Constructs a BevelBorder given its appearance type and two colors
- * for its highlight and shadow.
- *
- * <p><img src="doc-files/BevelBorder-2.png" width="500" height="150"
- * alt="[An illustration showing BevelBorders that were constructed
- * with this method]" />
- *
- * @param bevelType the desired appearance of the border. The value
- * must be either {@link #RAISED} or {@link #LOWERED}.
- *
- * @param highlight the color that will be used for the inner
- * side of the highlighted edges (top and left if
- * if <code>bevelType</code> is {@link #RAISED}; bottom
- * and right otherwise). The color for the outer side
- * is a brightened version of this color.
- *
- * @param shadow the color that will be used for the outer
- * side of the shadowed edges (bottom and right
- * if <code>bevelType</code> is {@link #RAISED}; top
- * and left otherwise). The color for the inner side
- * is a brightened version of this color.
- *
- * @throws IllegalArgumentException if <code>bevelType</code> has
- * an unsupported value.
- *
- * @throws NullPointerException if <code>highlight</code> or
- * <code>shadow</code> is <code>null</code>.
- *
- * @see java.awt.Color.brighter()
- */
- public BevelBorder(int bevelType, Color highlight, Color shadow)
- {
- this(bevelType,
- /* highlightOuter */ highlight.brighter(),
- /* highlightInner */ highlight,
- /* shadowOuter */ shadow,
- /* shadowInner */ shadow.brighter());
- }
-
-
- /**
- * Constructs a BevelBorder given its appearance type and all
- * colors.
- *
- * <p><img src="doc-files/BevelBorder-3.png" width="500" height="150"
- * alt="[An illustration showing BevelBorders that were constructed
- * with this method]" />
- *
- * @param bevelType the desired appearance of the border. The value
- * must be either {@link #RAISED} or {@link #LOWERED}.
- *
- * @param highlightOuter the color that will be used for the outer
- * side of the highlighted edges (top and left if
- * <code>bevelType</code> is {@link #RAISED}; bottom and
- * right otherwise).
- *
- * @param highlightInner the color that will be used for the inner
- * side of the highlighted edges.
- *
- * @param shadowOuter the color that will be used for the outer
- * side of the shadowed edges (bottom and right
- * if <code>bevelType</code> is {@link #RAISED}; top
- * and left otherwise).
- *
- * @param shadowInner the color that will be used for the inner
- * side of the shadowed edges.
- *
- * @throws IllegalArgumentException if <code>bevelType</code> has
- * an unsupported value.
- *
- * @throws NullPointerException if one of the passed colors
- * is <code>null</code>.
- */
- public BevelBorder(int bevelType,
- Color highlightOuter, Color highlightInner,
- Color shadowOuter, Color shadowInner)
- {
- this(bevelType); // checks the validity of bevelType
-
- if ((highlightOuter == null) || (highlightInner == null)
- || (shadowOuter == null) || (shadowInner == null))
- throw new NullPointerException();
-
- this.highlightOuter = highlightOuter;
- this.highlightInner = highlightInner;
- this.shadowOuter = shadowOuter;
- this.shadowInner = shadowInner;
- }
-
-
- /**
- * Paints the border for a given component.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- switch (bevelType)
- {
- case RAISED:
- paintRaisedBevel(c, g, x, y, width, height);
- break;
-
- case LOWERED:
- paintLoweredBevel(c, g, x, y, width, height);
- break;
- }
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- return new Insets(2, 2, 2, 2);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- insets.left = insets.right = insets.top = insets.bottom = 2;
- return insets;
- }
-
-
- /**
- * Determines the color that will be used for the outer side of
- * highlighted edges when painting the border. If a highlight color
- * has been specified upon constructing the border, that color is
- * returned. Otherwise, the inner highlight color is brightened.
- *
- * @param c the component enclosed by this border.
- *
- * @see #getHighlightInnerColor(java.awt.Component)
- * @see java.awt.Color#brighter()
- */
- public Color getHighlightOuterColor(Component c)
- {
- if (highlightOuter != null)
- return highlightOuter;
- else
- return getHighlightInnerColor(c).brighter();
- }
-
-
- /**
- * Determines the color that will be used for the inner side of
- * highlighted edges when painting the border. If a highlight color
- * has been specified upon constructing the border, that color is
- * returned. Otherwise, the background color of the enclosed
- * component is brightened.
- *
- * @param c the component enclosed by this border.
- *
- * @see java.awt.Component#getBackground()
- * @see java.awt.Color#brighter()
- */
- public Color getHighlightInnerColor(Component c)
- {
- if (highlightInner != null)
- return highlightInner;
- else
- return c.getBackground().brighter();
- }
-
-
- /**
- * Determines the color that will be used for the inner side of
- * shadowed edges when painting the border. If a shadow color has
- * been specified upon constructing the border, that color is
- * returned. Otherwise, the background color of the enclosed
- * component is darkened.
- *
- * @param c the component enclosed by this border.
- *
- * @see java.awt.Component#getBackground()
- * @see java.awt.Color#darker()
- */
- public Color getShadowInnerColor(Component c)
- {
- if (shadowInner != null)
- return shadowInner;
- else
- return c.getBackground().darker();
- }
-
-
- /**
- * Determines the color that will be used for the outer side of
- * shadowed edges when painting the border. If a shadow color
- * has been specified upon constructing the border, that color is
- * returned. Otherwise, the inner shadow color is darkened.
- *
- * @param c the component enclosed by this border.
- *
- * @see #getShadowInnerColor(java.awt.Component)
- * @see java.awt.Color#darker()
- */
- public Color getShadowOuterColor(Component c)
- {
- if (shadowOuter != null)
- return shadowOuter;
- else
- return getShadowInnerColor(c).darker();
- }
-
-
- /**
- * Returns the color that will be used for the outer side of
- * highlighted edges when painting the border, or <code>null</code>
- * if that color will be derived from the background of the enclosed
- * Component.
- */
- public Color getHighlightOuterColor()
- {
- return highlightOuter;
- }
-
-
- /**
- * Returns the color that will be used for the inner side of
- * highlighted edges when painting the border, or <code>null</code>
- * if that color will be derived from the background of the enclosed
- * Component.
- */
- public Color getHighlightInnerColor()
- {
- return highlightInner;
- }
-
-
- /**
- * Returns the color that will be used for the inner side of
- * shadowed edges when painting the border, or <code>null</code> if
- * that color will be derived from the background of the enclosed
- * Component.
- */
- public Color getShadowInnerColor()
- {
- return shadowInner;
- }
-
-
- /**
- * Returns the color that will be used for the outer side of
- * shadowed edges when painting the border, or <code>null</code> if
- * that color will be derived from the background of the enclosed
- * Component.
- */
- public Color getShadowOuterColor()
- {
- return shadowOuter;
- }
-
-
- /**
- * Returns the appearance of this border, which is either {@link
- * #RAISED} or {@link #LOWERED}.
- */
- public int getBevelType()
- {
- return bevelType;
- }
-
-
- /**
- * Determines whether this border fills every pixel in its area
- * when painting.
- *
- * <p>If the border colors are derived from the background color of
- * the enclosed component, the result is <code>true</code> because
- * the derivation method always returns opaque colors. Otherwise,
- * the result depends on the opacity of the individual colors.
- *
- * @return <code>true</code> if the border is fully opaque, or
- * <code>false</code> if some pixels of the background
- * can shine through the border.
- */
- public boolean isBorderOpaque()
- {
- /* If the colors are to be drived from the enclosed Component's
- * background color, the border is guaranteed to be fully opaque
- * because Color.brighten() and Color.darken() always return an
- * opaque color.
- */
- return
- ((highlightOuter == null) || (highlightOuter.getAlpha() == 255))
- && ((highlightInner == null) || (highlightInner.getAlpha() == 255))
- && ((shadowInner == null) || (shadowInner.getAlpha() == 255))
- && ((shadowOuter == null) ||(shadowOuter.getAlpha() == 255));
- }
-
-
- /**
- * Paints a raised bevel border around a component.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- protected void paintRaisedBevel(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- paintBevel(g, x, y, width, height,
- getHighlightOuterColor(c), getHighlightInnerColor(c),
- getShadowInnerColor(c), getShadowOuterColor(c));
- }
-
-
- /**
- * Paints a lowered bevel border around a component.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- protected void paintLoweredBevel(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- paintBevel(g, x, y, width, height,
- getShadowInnerColor(c), getShadowOuterColor(c),
- getHighlightInnerColor(c), getHighlightOuterColor(c));
- }
-
-
- /**
- * Paints a two-pixel bevel in four colors.
- *
- * <pre>
- * @@@@@@@@@@@@
- * @..........# @ = color a
- * @. X# . = color b
- * @. X# X = color c
- * @.XXXXXXXXX# # = color d
- * ############</pre>
- *
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- * @param a the color for the outer side of the top and left edges.
- * @param b the color for the inner side of the top and left edges.
- * @param c the color for the inner side of the bottom and right edges.
- * @param d the color for the outer side of the bottom and right edges.
- */
- private static void paintBevel(Graphics g,
- int x, int y, int width, int height,
- Color a, Color b, Color c, Color d)
- {
- Color oldColor;
-
- oldColor = g.getColor();
- g.translate(x, y);
- width = width - 1;
- height = height - 1;
-
- try
- {
- /* To understand this code, it might be helpful to look at the
- * images that are included with the JavaDoc. They are located
- * in the "doc-files" subdirectory.
- */
- g.setColor(a);
- g.drawLine(0, 0, width, 0); // a, horizontal
- g.drawLine(0, 1, 0, height); // a, vertical
-
- g.setColor(b);
- g.drawLine(1, 1, width - 1, 1); // b, horizontal
- g.drawLine(1, 2, 1, height - 1); // b, vertical
-
- g.setColor(c);
- g.drawLine(2, height - 1, width - 1, height - 1); // c, horizontal
- g.drawLine(width - 1, 2, width - 1, height - 2); // c, vertical
-
- g.setColor(d);
- g.drawLine(1, height, width, height); // d, horizontal
- g.drawLine(width, 1, width, height - 1); // d, vertical
- }
- finally
- {
- g.translate(-x, -y);
- g.setColor(oldColor);
- }
- }
-}
-
diff --git a/libjava/javax/swing/border/Border.java b/libjava/javax/swing/border/Border.java
deleted file mode 100644
index 11bddfe78b3..00000000000
--- a/libjava/javax/swing/border/Border.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Border.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.border;
-
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-
-/**
- * An public interface for decorative or spacing borders around a Component.
- *
- * <p>To reduce memory consumption, several Components may share a
- * single Border instance. {@link javax.swing.BorderFactory} is a
- * factory class for producing commonly used shared borders.
- *
- * @see javax.swing.BorderFactory
- * @see EmptyBorder
- * @see CompoundBorder
- * @see BevelBorder
- * @see EtchedBorder
- * @see LineBorder
- * @see MatteBorder
- * @see SoftBevelBorder
- * @see TitledBorder
- * @see AbstractBorder
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- * @author Michael Koch (konqueror@gmx.de)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public interface Border
-{
- /**
- * Paints the border for a given component.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height);
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- */
- Insets getBorderInsets(Component c);
-
-
- /**
- * Determines whether this border fills every pixel in its area
- * when painting.
- *
- * @return <code>true</code> if the border is fully opaque, or
- * <code>false</code> if some pixels of the background
- * can shine through the border.
- */
- boolean isBorderOpaque();
-}
diff --git a/libjava/javax/swing/border/CompoundBorder.java b/libjava/javax/swing/border/CompoundBorder.java
deleted file mode 100644
index 2130a0e3447..00000000000
--- a/libjava/javax/swing/border/CompoundBorder.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/* CompoundBorder.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.border;
-
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-/**
- * A Border that is composed of an interior and an exterior border,
- * where the interior border is tightly nested into the exterior.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class CompoundBorder
- extends AbstractBorder
-{
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = 9054540377030555103L;
-
-
- /**
- * The inside border, which is painted between the bordered
- * Component and the outside border. It is valid for
- * <code>insideBorder</code> to be <code>null</code>.
- */
- protected Border insideBorder;
-
-
- /**
- * The outside border, which is painted outside both the
- * bordered Component and the inside border. It is valid for
- * <code>outsideBorder</code> to be <code>null</code>.
- */
- protected Border outsideBorder;
-
-
- /**
- * Constructs a CompoundBorder whose inside and outside borders
- * are both <code>null</code>. While this does not really make
- * any sense (there exists a class EmptyBorder as well, and not
- * every Component needs to have a border at all), the API
- * specification requires the existence of this constructor.
- *
- * @see EmptyBorder
- */
- public CompoundBorder ()
- {
- this (null, null);
- }
-
-
- /**
- * Constructs a CompoundBorder with the specified inside and
- * outside borders.
- *
- * @param outsideBorder the outside border, which is painted to the
- * outside of both <code>insideBorder</code> and the enclosed
- * component. It is acceptable to pass <code>null</code>, in
- * which case no outside border is painted.
- *
- * @param insideBorder the inside border, which is painted to
- * between <code>outsideBorder</code> and the enclosed
- * component. It is acceptable to pass <code>null</code>, in
- * which case no inside border is painted.
- */
- public CompoundBorder (Border outsideBorder, Border insideBorder)
- {
- this.outsideBorder = outsideBorder;
- this.insideBorder = insideBorder;
- }
-
-
- /**
- * Determines whether or not this border is opaque. An opaque
- * border fills every pixel in its area when painting. Partially
- * translucent borders must return <code>false</code>, or ugly
- * artifacts can appear on screen.
- *
- * @return <code>true</code> if both the inside and outside borders
- * are opaque, or <code>false</code> otherwise.
- */
- public boolean isBorderOpaque ()
- {
- /* While it would be safe to assume true for the opacity of
- * a null border, this behavior would not be according to
- * the API specification. Also, it is pathological to have
- * null borders anyway.
- */
- if ((insideBorder == null) || (outsideBorder == null))
- return false;
-
- return insideBorder.isBorderOpaque()
- && outsideBorder.isBorderOpaque();
- }
-
-
- /**
- * Paints the compound border by first painting the outside border,
- * then painting the inside border tightly nested into the outside.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- /* If there is an outside border, paint it and reduce the
- * bounding box by its insets.
- */
- if (outsideBorder != null)
- {
- Insets outsideInsets;
-
- outsideBorder.paintBorder(c, g, x, y, width, height);
- outsideInsets = outsideBorder.getBorderInsets(c);
-
- x += outsideInsets.left;
- y += outsideInsets.top;
-
- /* Reduce width and height by the respective extent of the
- * outside border.
- */
- width -= outsideInsets.left + outsideInsets.right;
- height -= outsideInsets.top + outsideInsets.bottom;
- }
-
- if (insideBorder != null)
- insideBorder.paintBorder(c, g, x, y, width, height);
- }
-
-
- /**
- * Changes the specified insets to the insets of this border,
- * which is the sum of the insets of the inside and the outside
- * border.
- *
- * @param c the component in the center of this border.
- * @param insets an Insets object for holding the added insets.
- *
- * @return the <code>insets</code> object.
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- Insets borderInsets;
-
- if (insets == null)
- insets = new Insets (0,0,0,0);
- else
- insets.left = insets.right = insets.top = insets.bottom = 0;
-
- /* If there is an outside border, add it to insets. */
- if (outsideBorder != null)
- {
- borderInsets = outsideBorder.getBorderInsets(c);
- insets.left += borderInsets.left;
- insets.right += borderInsets.right;
- insets.top += borderInsets.top;
- insets.bottom += borderInsets.bottom;
- }
-
- /* If there is an inside border, add it to insets. */
- if (insideBorder != null)
- {
- borderInsets = insideBorder.getBorderInsets(c);
- insets.left += borderInsets.left;
- insets.right += borderInsets.right;
- insets.top += borderInsets.top;
- insets.bottom += borderInsets.bottom;
- }
-
- return insets;
- }
-
-
- /**
- * Determines the insets of this border, which is the sum of the
- * insets of the inside and the outside border.
- *
- * @param c the component in the center of this border.
- */
- public Insets getBorderInsets (Component c)
- {
- /* It is not clear why CompoundBorder does not simply inherit
- * the implementation from AbstractBorder. However, we want
- * to be compatible with the API specification, which overrides
- * the getBorderInsets(Component) method.
- */
- return getBorderInsets (c, null);
- }
-
-
- /**
- * Returns the outside border, which is painted outside both the
- * bordered Component and the inside border. It is valid for the
- * result to be <code>null</code>.
- */
- public Border getOutsideBorder ()
- {
- return outsideBorder;
- }
-
-
- /**
- * Returns the inside border, which is painted between the bordered
- * Component and the outside border. It is valid for the result to
- * be <code>null</code>.
- */
- public Border getInsideBorder ()
- {
- return insideBorder;
- }
-}
-
diff --git a/libjava/javax/swing/border/EmptyBorder.java b/libjava/javax/swing/border/EmptyBorder.java
deleted file mode 100644
index 0f3b7b6931c..00000000000
--- a/libjava/javax/swing/border/EmptyBorder.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/* EmptyBorder.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.border;
-
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-
-/**
- * A border for leaving a specifiable number of pixels empty around
- * the enclosed component. An EmptyBorder requires some space on each
- * edge, but does not perform any drawing.
- *
- * <p><img src="EmptyBorder-1.png" width="290" height="200"
- * alt="[An illustration of EmptyBorder]" />
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class EmptyBorder
- extends AbstractBorder
-{
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = -8116076291731988694L;
-
-
- /**
- * The number of pixels required at the left edge.
- */
- protected int left;
-
-
- /**
- * The number of pixels required at the right edge.
- */
- protected int right;
-
-
- /**
- * The number of pixels required at the top edge.
- */
- protected int top;
-
-
- /**
- * The number of pixels required at the bottom edge.
- */
- protected int bottom;
-
-
- /**
- * Constructs an empty border given the number of pixels required
- * on each side.
- *
- * @param top the number of pixels that the border will need
- * for its top edge.
- *
- * @param left the number of pixels that the border will need
- * for its left edge.
- *
- * @param bottom the number of pixels that the border will need
- * for its bottom edge.
- *
- * @param right the number of pixels that the border will need
- * for its right edge.
- */
- public EmptyBorder(int top, int left, int bottom, int right)
- {
- this.top = top;
- this.left = left;
- this.bottom = bottom;
- this.right = right;
- }
-
-
- /**
- * Constructs an empty border given the number of pixels required
- * on each side, passed in an Insets object.
- *
- * @param borderInsets the Insets for the new border.
- */
- public EmptyBorder(Insets borderInsets)
- {
- this(borderInsets.top, borderInsets.left,
- borderInsets.bottom, borderInsets.right);
- }
-
-
- /**
- * Performs nothing because an EmptyBorder does not paint any
- * pixels. While the inherited implementation provided by
- * {@link AbstractBorder#paintBorder} is a no-op as well,
- * it is overwritten in order to match the API of the Sun
- * reference implementation.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- return getBorderInsets(c, null);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- if (insets == null)
- insets = new Insets(0, 0, 0, 0);
-
- insets.left = left;
- insets.right = right;
- insets.top = top;
- insets.bottom = bottom;
- return insets;
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets()
- {
- return getBorderInsets(null, null);
- }
-
-
- /**
- * Determines whether this border fills every pixel in its area
- * when painting. Since an empty border does not paint any pixels
- * whatsoever, the result is <code>false</code>.
- *
- * @return <code>false</code>.
- */
- public boolean isBorderOpaque()
- {
- /* The inherited implementation of AbstractBorder.isBorderOpaque()
- * would also return false. It is not clear why this is overriden
- * in the Sun implementation, at least not from just reading the
- * JavaDoc.
- */
- return false;
- }
-}
diff --git a/libjava/javax/swing/border/EtchedBorder.java b/libjava/javax/swing/border/EtchedBorder.java
deleted file mode 100644
index ea2a61d9e67..00000000000
--- a/libjava/javax/swing/border/EtchedBorder.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/* EtchedBorder.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.border;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-
-/**
- * A border that looks like an engraving etched into the background
- * surface, or (in its raised variant) coming out of the surface
- * plane. Using different constructors, it is possible to either
- * explicitly specify the border colors, or to let the colors derive
- * from the background color of the enclosed Component.
- *
- * <p><img src="doc-files/EtchedBorder-1.png" width="500" height="200"
- * alt="[An illustration of the two EtchedBorder variants]" />
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class EtchedBorder
- extends AbstractBorder
-{
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = 4001244046866360638L;
-
-
- /**
- * Indicates that the border appears as coming out of the
- * background.
- */
- public static final int RAISED = 0;
-
-
- /**
- * Indicates that the border appears as engraved into the
- * background.
- */
- public static final int LOWERED = 1;
-
-
- /**
- * The type of this EtchedBorder, which is either {@link #RAISED}
- * or {@link #LOWERED}.
- */
- protected int etchType;
-
-
- /**
- * The highlight color, or <code>null</code> to indicate that the
- * color shall be derived from the background of the enclosed
- * component.
- */
- protected Color highlight;
-
-
- /**
- * The shadow color, or <code>null</code> to indicate that the
- * color shall be derived from the background of the enclosed
- * component.
- */
- protected Color shadow;
-
-
- /**
- * Constructs a lowered EtchedBorder. The colors will be derived
- * from the background color of the enclosed Component when the
- * border gets painted.
- */
- public EtchedBorder()
- {
- this(LOWERED);
- }
-
-
- /**
- * Constructs an EtchedBorder with the specified appearance. The
- * colors will be derived from the background color of the enclosed
- * Component when the border gets painted.
- *
- * <p><img src="doc-files/EtchedBorder-1.png" width="500" height="200"
- * alt="[An illustration of the two EtchedBorder variants]" />
- *
- * @param etchType the desired appearance of the border. The value
- * must be either {@link #RAISED} or {@link #LOWERED}.
- *
- * @throws IllegalArgumentException if <code>etchType</code> has
- * an unsupported value.
- */
- public EtchedBorder(int etchType)
- {
- if ((etchType != RAISED) && (etchType != LOWERED))
- throw new IllegalArgumentException();
-
- this.etchType = etchType;
-
- /* The highlight and shadow fields already have a null value
- * when the constructor gets called, so there is no need to
- * assign a value here.
- */
- }
-
-
- /**
- * Constructs a lowered EtchedBorder, explicitly selecting the
- * colors that will be used for highlight and shadow.
- *
- * @param highlight the color that will be used for painting
- * the highlight part of the border.
- *
- * @param shadow the color that will be used for painting
- * the shadow part of the border.
- *
- * @see #EtchedBorder(int, Color, Color)
- */
- public EtchedBorder(Color highlight, Color shadow)
- {
- this(LOWERED, highlight, shadow);
- }
-
-
- /**
- * Constructs an EtchedBorder with the specified appearance,
- * explicitly selecting the colors that will be used for
- * highlight and shadow.
- *
- * <p><img src="doc-files/EtchedBorder-2.png" width="500" height="200"
- * alt="[An illustration that shows which pixels get painted
- * in what color]" />
- *
- * @param etchType the desired appearance of the border. The value
- * must be either {@link #RAISED} or {@link #LOWERED}.
- *
- * @param highlight the color that will be used for painting
- * the highlight part of the border.
- *
- * @param shadow the color that will be used for painting
- * the shadow part of the border.
- *
- * @throws IllegalArgumentException if <code>etchType</code> has
- * an unsupported value.
- */
- public EtchedBorder(int etchType, Color highlight, Color shadow)
- {
- this(etchType); // Checks the validity of the value.
- this.highlight = highlight;
- this.shadow = shadow;
- }
-
-
- /**
- * Paints the border for a given component.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- switch (etchType)
- {
- case RAISED:
- paintEtchedBorder(g, x, y, width, height,
- getHighlightColor(c), getShadowColor(c));
- break;
-
- case LOWERED:
- paintEtchedBorder(g, x, y, width, height,
- getShadowColor(c), getHighlightColor(c));
- break;
- }
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- return new Insets(2, 2, 2, 2);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- insets.left = insets.right = insets.top = insets.bottom = 2;
- return insets;
- }
-
-
- /**
- * Determines whether this border fills every pixel in its area
- * when painting.
- *
- * <p>If the border colors are derived from the background color of
- * the enclosed component, the result is <code>true</code> because
- * the derivation method always returns opaque colors. Otherwise,
- * the result depends on the opacity of the individual colors.
- *
- * @return <code>true</code> if the border is fully opaque, or
- * <code>false</code> if some pixels of the background
- * can shine through the border.
- */
- public boolean isBorderOpaque()
- {
- /* If the colors are to be drived from the enclosed Component's
- * background color, the border is guaranteed to be fully opaque
- * because Color.brighten() and Color.darken() always return an
- * opaque color.
- */
- return
- ((highlight == null) || (highlight.getAlpha() == 255))
- && ((shadow == null) || (shadow.getAlpha() == 255));
- }
-
-
- /**
- * Returns the appearance of this EtchedBorder, which is either
- * {@link #RAISED} or {@link #LOWERED}.
- */
- public int getEtchType()
- {
- return etchType;
- }
-
-
- /**
- * Determines the color that will be used for highlighted parts when
- * painting the border around a given component. If a highlight
- * color has been specified upon constructing the border, that color
- * is returned. Otherwise, the background color of the enclosed
- * component is brightened.
- *
- * @param c the component enclosed by this border.
- *
- * @see java.awt.Component#getBackground()
- * @see java.awt.Color#brighter()
- */
- public Color getHighlightColor(Component c)
- {
- if (highlight != null)
- return highlight;
- else
- return c.getBackground().brighter();
- }
-
-
- /**
- * Returns the color that will be used for highlighted parts when
- * painting the border, or <code>null</code> if that color will be
- * derived from the background of the enclosed Component.
- */
- public Color getHighlightColor()
- {
- return highlight;
- }
-
-
- /**
- * Determines the color that will be used for shadowed parts when
- * painting the border around a given component. If a shadow color
- * has been specified upon constructing the border, that color is
- * returned. Otherwise, the background color of the enclosed
- * component is darkened.
- *
- * @param c the component enclosed by this border.
- *
- * @see java.awt.Component#getBackground()
- * @see java.awt.Color#darker()
- */
- public Color getShadowColor(Component c)
- {
- if (shadow != null)
- return shadow;
- else
- return c.getBackground().darker();
- }
-
-
- /**
- * Returns the color that will be used for shadowed parts when
- * painting the border, or <code>null</code> if that color will be
- * derived from the background of the enclosed Component.
- */
- public Color getShadowColor()
- {
- return shadow;
- }
-
-
- /**
- * Paints a two-pixel etching in two colors.
- *
- * <pre>
- * @@@@@@@@@@@.
- * @.........@. @ = color a
- * @. @. . = color b
- * @. @.
- * @@@@@@@@@@@.
- * ............</pre>
- *
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- * @param a one of the two colors.
- * @param b the second of the two colors.
- */
- private static void paintEtchedBorder(Graphics g,
- int x, int y, int width, int height,
- Color a, Color b)
- {
- Color oldColor;
-
- oldColor = g.getColor();
- g.translate(x, y);
- width = width - 1;
- height = height - 1;
-
- try
- {
- /* To understand this code, it might be helpful to look at the
- * images that are included with the JavaDoc. They are located
- * in the "doc-files" subdirectory. EtchedBorder-2.png might
- * be especially informative.
- */
- g.setColor(a);
- g.drawRect(0, 0, width - 1, height - 1);
-
- g.setColor(b);
- g.drawLine(1, 1, width - 2, 1); // top edge
- g.drawLine(1, 2, 1, height - 2); // left edge
- g.drawLine(0, height, width, height); // bottom edge
- g.drawLine(width, 0, width, height - 1); // right edge
- }
- finally
- {
- g.translate(-x, -y);
- g.setColor(oldColor);
- }
- }
-}
-
diff --git a/libjava/javax/swing/border/LineBorder.java b/libjava/javax/swing/border/LineBorder.java
deleted file mode 100644
index 00c16342c96..00000000000
--- a/libjava/javax/swing/border/LineBorder.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/* LineBorder.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.border;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-
-/**
- * A border that consists of a line whose thickness and color can be
- * specified. There also is a variant with rounded corners.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class LineBorder
- extends AbstractBorder
-{
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = -787563427772288970L;
-
-
- /**
- * A shared instance of a black, one pixel thick, plain LineBorder.
- * The singleton object is lazily created by {@link
- * #createBlackLineBorder()} upon its first invocation.
- */
- private static LineBorder blackLineBorder;
-
-
- /**
- * A shared instance of a gray, one pixel thick, plain LineBorder.
- * The singleton object is lazily created by {@link
- * #createBlackGrayBorder()} upon its first invocation.
- */
- private static LineBorder grayLineBorder;
-
-
- /**
- * The width of the line in pixels.
- */
- protected int thickness;
-
-
- /**
- * The color of the line.
- */
- protected Color lineColor;
-
-
- /**
- * Indicates whether the line is drawn with rounded corners
- * (<code>true</code>) or not ((<code>false</code>).
- */
- protected boolean roundedCorners;
-
-
- /**
- * Constructs a LineBorder given its color. The border will be one
- * pixel thick and have plain corners.
- *
- * @param color the color for drawing the border.
- *
- * @see #LineBorder(java.awt.Color, int, boolean)
- */
- public LineBorder(Color color)
- {
- this(color, /* thickness */ 1, /* roundedCorners */ false);
- }
-
-
- /**
- * Constructs a LineBorder given its color and thickness. The
- * border will have plain corners.
- *
- * @param color the color for drawing the border.
- * @param thickness the width of the line in pixels.
- *
- * @see #LineBorder(java.awt.Color, int, boolean)
- */
- public LineBorder(Color color, int thickness)
- {
- this (color, thickness, /* roundedCorners */ false);
- }
-
-
- /**
- * Constructs a LineBorder given its color, thickness, and whether
- * it has rounded corners.
- *
- * <p><img src="doc-files/LineBorder-1.png" width="500" height="200"
- * alt="[An illustration of two LineBorders]" />
- *
- * <p>Note that the enlarged view in the right-hand picture shows
- * that the implementation draws one more pixel than specified,
- * provided that <code>roundedCorders</code> is <code>true</code>
- * and anti-aliasing is turned on while painting. While this might
- * be considered a bug, the Sun reference implementation (at least
- * JDK 1.3.1 on Apple MacOS X 10.1.5) can be observed to fill
- * exactly the same pixels as shown above. The GNU Classpath
- * LineBorder replicates the observed behavior of the Sun
- * implementation.
- *
- * @param color the color for drawing the border.
- * @param thickness the width of the line in pixels.
- * @param roundedCorners <code>true</code> for rounded corners,
- * <code>false</code> for plain corners.
- *
- * @since 1.3
- */
- // For the bug mentioned in the JavaDoc, please see also the comment
- // in the paintBorder method below.
- //
- public LineBorder(Color color, int thickness, boolean roundedCorners)
- {
- if ((color == null) || (thickness < 0))
- throw new IllegalArgumentException();
-
- this.lineColor = color;
- this.thickness = thickness;
- this.roundedCorners = roundedCorners;
- }
-
-
- /**
- * Returns a black, one pixel thick, plain LineBorder. The method
- * may always return the same (singleton) LineBorder instance.
- */
- public static Border createBlackLineBorder()
- {
- /* Swing is not designed to be thread-safe, so there is no
- * need to synchronize the access to the global variable.
- */
- if (blackLineBorder == null)
- blackLineBorder = new LineBorder(Color.black);
-
- return blackLineBorder;
- }
-
-
- /**
- * Returns a gray, one pixel thick, plain LineBorder. The method
- * may always return the same (singleton) LineBorder instance.
- */
- public static Border createGrayLineBorder()
- {
- /* Swing is not designed to be thread-safe, so there is no
- * need to synchronize the access to the global variable.
- */
- if (grayLineBorder == null)
- grayLineBorder = new LineBorder(Color.gray);
-
- return grayLineBorder;
- }
-
-
- /**
- * Paints the line border around a given Component.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- Color oldColor = g.getColor();
-
- try
- {
- g.setColor(lineColor);
-
- /* If width and height were not adjusted, the border would
- * appear one pixel too large in both directions.
- */
- width -= 1;
- height -= 1;
-
- /* Blurred, too large appearance
- * -----------------------------
- * While Java 2D has introduced line strokes of arbitrary width,
- * it seems desirable to keep this code independent of Java 2D.
- * Therefore, multiple nested rectangles (or rounded rectangles)
- * are drawn in order to simulate a line whose thickness is
- * greater than one pixel.
- *
- * This hack causes a blurred appearance when anti-aliasing is
- * on. Interestingly enough, though, the Sun JDK 1.3.1 (at least
- * on MacOS X 10.1.5) shows exactly the same appearance under
- * this condition. It thus seems likely that Sun does the same
- * hack for simulating thick lines. For this reason, the
- * blurred appearance seems acceptable -- especially since GNU
- * Classpath tries to be compatible with the Sun reference
- * implementation.
- */
- for (int i = 0; i < thickness; i++)
- {
- if (roundedCorners)
- g.drawRoundRect(x, y, width, height, thickness, thickness);
- else
- g.drawRect(x, y, width, height);
-
- x += 1;
- y += 1;
- width -= 2;
- height -= 2;
- }
- }
- finally
- {
- g.setColor(oldColor);
- }
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge, which is the
- * thickness of the line.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- return new Insets(thickness, thickness, thickness, thickness);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge, which is the thickness
- * of the line.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- insets.left = insets.right = insets.top = insets.bottom = thickness;
- return insets;
- }
-
-
- /**
- * Returns the color of the line.
- */
- public Color getLineColor()
- {
- return lineColor;
- }
-
-
- /**
- * Returns the thickness of the line in pixels.
- */
- public int getThickness()
- {
- return thickness;
- }
-
-
- /**
- * Returns whether this LineBorder os drawm with rounded
- * or with plain corners.
- *
- * @return <code>true</code> if the corners are rounded,
- * <code>false</code> if the corners are plain.
- */
- public boolean getRoundedCorners()
- {
- return roundedCorners;
- }
-
-
- /**
- * Determines whether this border fills every pixel in its area
- * when painting.
- *
- * @return <code>true</code> if the corners are plain and the line
- * color is fully opaque; <code>false</code> if the corners
- * are rounded or the line color is partially transparent.
- */
- public boolean isBorderOpaque()
- {
- return (!roundedCorners) && (lineColor.getAlpha() == 255);
- }
-}
-
diff --git a/libjava/javax/swing/border/MatteBorder.java b/libjava/javax/swing/border/MatteBorder.java
deleted file mode 100644
index f7ff1ca01c3..00000000000
--- a/libjava/javax/swing/border/MatteBorder.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/* MatteBorder.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.border;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-import javax.swing.Icon;
-
-/**
- * A border that is filled with either a solid color or with repeated
- * icon tiles.
- *
- * <p><img src="doc-files/MatteBorder-1.png" width="500" height="150"
- * alt="[Two MatteBorders]" />
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class MatteBorder
- extends EmptyBorder
-{
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = 4422248989617298224L;
-
-
- /**
- * The color that is used for filling the border, or
- * <code>null</code> if the border is filled with repetitions of a
- * tile icon.
- *
- * @see #tileIcon
- */
- protected Color color;
-
-
- /**
- * The icon is used for filling the border with a tile, or
- * <code>null</code> if the border is filled with a solid
- * color.
- *
- * @see #color
- */
- protected Icon tileIcon;
-
-
- /**
- * Constructs a MatteBorder given the width on each side
- * and a fill color.
- *
- * <p><img src="doc-files/MatteBorder-2.png" width="500" height="150"
- * alt="[A picture of a MatteBorder made by this constructor]" />
- *
- * @param top the width of the border at its top edge.
- * @param left the width of the border at its left edge.
- * @param bottom the width of the border at its bottom edge.
- * @param right the width of the border at its right edge.
- * @param matteColor the color for filling the border.
- */
- public MatteBorder(int top, int left, int bottom, int right,
- Color matteColor)
- {
- super(top, left, bottom, right);
-
- if (matteColor == null)
- throw new IllegalArgumentException();
-
- this.color = matteColor;
- }
-
-
- /**
- * Constructs a MatteBorder given its insets and fill color.
- *
- * <p><img src="doc-files/MatteBorder-3.png" width="500" height="150"
- * alt="[A picture of a MatteBorder made by this constructor]" />
- *
- * @param borderInsets an Insets object whose <code>top</code>,
- * <code>left</code>, <code>bottom</code> and <code>right</code>
- * fields indicate the with of the border at the respective
- * edge.
- *
- * @param matteColor the color for filling the border.
- */
- public MatteBorder(Insets borderInsets, Color matteColor)
- {
- this(borderInsets.top, borderInsets.left,
- borderInsets.bottom, borderInsets.right,
- matteColor);
- }
-
-
- /**
- * Constructs a MatteBorder given the width on each side
- * and an icon for tiling the border area.
- *
- * <p><img src="doc-files/MatteBorder-4.png" width="500" height="150"
- * alt="[A picture of a MatteBorder made by this constructor]" />
- *
- * @param top the width of the border at its top edge.
- * @param left the width of the border at its left edge.
- * @param bottom the width of the border at its bottom edge.
- * @param right the width of the border at its right edge.
- * @param tileIcon an icon for tiling the border area.
- */
- public MatteBorder(int top, int left, int bottom, int right,
- Icon tileIcon)
- {
- super(top, left, bottom, right);
-
- if (tileIcon == null)
- throw new IllegalArgumentException();
-
- this.tileIcon = tileIcon;
- }
-
-
- /**
- * Constructs a MatteBorder given its insets and an icon
- * for tiling the border area.
- *
- * <p><img src="doc-files/MatteBorder-5.png" width="500" height="150"
- * alt="[A picture of a MatteBorder made by this constructor]" />
- *
- * @param borderInsets an Insets object whose <code>top</code>,
- * <code>left</code>, <code>bottom</code> and <code>right</code>
- * fields indicate the with of the border at the respective
- * edge.
- *
- * @param tileIcon an icon for tiling the border area.
- */
- public MatteBorder(Insets borderInsets, Icon tileIcon)
- {
- this(borderInsets.top, borderInsets.left,
- borderInsets.bottom, borderInsets.right,
- tileIcon);
- }
-
-
- /**
- * Constructs a MatteBorder given an icon for tiling the
- * border area. The icon width is used for the border insets
- * at the left and right edge, the icon height for the top and
- * bottom edge.
- *
- * <p><img src="doc-files/MatteBorder-6.png" width="379" height="150"
- * alt="[A picture of a MatteBorder made by this constructor]" />
- *
- * @param tileIcon an icon for tiling the border area.
- */
- public MatteBorder(Icon tileIcon)
- {
- this(-1, -1, -1, -1, tileIcon);
- }
-
-
- /**
- * Paints the border for a given component.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- Insets i = getBorderInsets();
- paintEdge(c, g, x, y, width, i.top, 0, 0); // top edge
- paintEdge(c, g, x, y + height - i.bottom, // bottom edge
- width, i.bottom,
- 0, height - i.bottom);
- paintEdge(c, g, x, y + i.top, // left edge
- i.left, height - i.top,
- 0, i.top);
- paintEdge(c, g, x + width - i.right, y + i.top, // right edge
- i.right, height - i.bottom,
- width - i.right, i.top);
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- /* There is no obvious reason for overriding this method, but we
- * try to have exactly the same API as the Sun reference
- * implementation.
- */
- return this.getBorderInsets(c, null);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- if (insets == null)
- insets = new Insets(0, 0, 0, 0);
-
- if ((tileIcon != null)
- && (top < 0) && (left < 0)
- && (right < 0) && (bottom < 0))
- {
- insets.left = insets.right = tileIcon.getIconWidth();
- insets.top = insets.bottom = tileIcon.getIconHeight();
- return insets;
- }
-
- /* Copy top, left, bottom and right into the respective
- * field of insets.
- */
- return super.getBorderInsets(c, insets);
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets()
- {
- /* The inherited implementation of EmptyBorder.isBorderOpaque()
- * would do the same. It is not clear why this is overriden in the
- * Sun implementation, at least not from just reading the JavaDoc.
- */
- return this.getBorderInsets(null, null);
- }
-
-
- /**
- * Returns the color that is used for filling the border, or
- * <code>null</code> if the border is filled with repetitions of a
- * tile icon.
- */
- public Color getMatteColor()
- {
- return color;
- }
-
-
- /**
- * Returns the icon is used for tiling the border, or
- * <code>null</code> if the border is filled with a color instead of
- * an icon.
- */
- public Icon getTileIcon()
- {
- return tileIcon;
- }
-
-
- /**
- * Determines whether this border fills every pixel in its area
- * when painting.
- *
- * @return <code>true</code> if the border is filled with an
- * opaque color; <code>false</code> if it is filled with
- * a semi-transparent color or with an icon.
- */
- public boolean isBorderOpaque()
- {
- return (color != null) && (color.getAlpha() == 255);
- }
-
-
- /**
- * Paints a rectangular area of the border. This private helper
- * method is called once for each of the border edges
- * by {@link #paintBorder}.
- *
- * @param c the component whose border is being painted.
- * @param g the graphics for painting.
- * @param x the horizontal position of the rectangular area.
- * @param y the vertical position of the rectangular area.
- * @param width the width of the rectangular area.
- * @param height the height of the rectangular area.
- * @param dx the x displacement for repeating the tile.
- * @param dy the y displacement for repeating the tile.
- */
- private void paintEdge(Component c, Graphics g,
- int x, int y, int width, int height,
- int dx, int dy)
- {
- Color oldColor;
- int iconWidth, iconHeight;
- Graphics clipped;
-
- if ((width <= 0) || (height <= 0))
- return;
-
- /* Paint a colored rectangle if desired. */
- if (color != null)
- {
- oldColor = g.getColor();
- try
- {
- g.setColor(color);
- g.fillRect(x, y, width, height);
- }
- finally
- {
- g.setColor(oldColor);
- }
- return;
- }
-
- /* Determine the width and height of the icon. Some icons return
- * -1 if it is an image whose dimensions have not yet been
- * retrieved. There is not much we can do about this, but we
- * should at least avoid entering the paint loop below
- * with negative increments.
- */
- iconWidth = tileIcon.getIconWidth();
- iconHeight = tileIcon.getIconHeight();
- if ((iconWidth <= 0) || (iconHeight <= 0))
- return;
-
- dx = dx % iconWidth;
- dy = dy % iconHeight;
-
- clipped = g.create();
- try
- {
- clipped.setClip(x, y, width, height);
- for (int ty = y - dy; ty < y + height; ty += iconHeight)
- for (int tx = x - dx; tx < x + width; tx += iconWidth)
- tileIcon.paintIcon(c, clipped, tx, ty);
- }
- finally
- {
- clipped.dispose();
- }
- }
-}
-
diff --git a/libjava/javax/swing/border/SoftBevelBorder.java b/libjava/javax/swing/border/SoftBevelBorder.java
deleted file mode 100644
index fa718e35bac..00000000000
--- a/libjava/javax/swing/border/SoftBevelBorder.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/* SoftBevelBorder.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.border;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-
-/**
- * A rectangular, three pixel thick border that looks like a BevelBorder
- * with slightly softened corners.
- *
- * <p>Like BevelBorder, SoftBevelBorder has a highlight and a shadow
- * color. In the raised variant, the highlight color is used for the
- * top and left edges, and the shadow color is used for the bottom and
- * right edge. In the lowered variant, color usage is reversed. For
- * an image, see the documentation of the individual constructors.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class SoftBevelBorder
- extends BevelBorder
-{
- /**
- * Determined using the <code>serialver</code> tool
- * of Sun JDK 1.4.1_01 on GNU/Linux 2.4.20. Interestingly,
- * the Apple/Sun JDK 1.3.1 on MacOS X 10.1.5 gives a different
- * value, namely -6658357140774549493L.
- */
- static final long serialVersionUID = 5248789787305979975L;
-
-
- /**
- * Constructs a SoftBevelBorder whose colors will be derived from the
- * background of the enclosed component. The background color is
- * retrieved each time the border is painted, so a SoftBevelBorder
- * constructed by this method will automatically reflect a change
- * to the component&#x2019;s background color.
- *
- * <p><img src="doc-files/SoftBevelBorder-1.png" width="500" height="200"
- * alt="[An illustration showing raised and lowered SoftBevelBorders]" />
- *
- * @param bevelType the desired appearance of the border. The value
- * must be either {@link BevelBorder#RAISED}
- * or {@link BevelBorder#LOWERED}.
- *
- * @throws IllegalArgumentException if <code>bevelType</code> has
- * an unsupported value.
- */
- public SoftBevelBorder(int bevelType)
- {
- super(bevelType);
- }
-
-
- /**
- * Constructs a SoftBevelBorder given its appearance type and two
- * colors for its highlight and shadow.
- *
- * <p><img src="doc-files/SoftBevelBorder-2.png" width="500" height="150"
- * alt="[An illustration showing SoftBevelBorders that were
- * constructed with this method]" />
- *
- * @param bevelType the desired appearance of the border. The value
- * must be either {@link BevelBorder#RAISED} or {@link
- * BevelBorder#LOWERED}.
- *
- * @param highlight the color that will be used for the inner side
- * of the highlighted edges (top and left if if
- * <code>bevelType</code> is {@link BevelBorder#RAISED};
- * bottom and right otherwise). The color for the outer side
- * is a brightened version of this color.
- *
- * @param shadow the color that will be used for the outer side of
- * the shadowed edges (bottom and right if
- * <code>bevelType</code> is {@link BevelBorder#RAISED}; top
- * and left otherwise). The color for the inner side is a
- * brightened version of this color.
- *
- * @throws IllegalArgumentException if <code>bevelType</code> has an
- * unsupported value.
- *
- * @throws NullPointerException if <code>highlight</code> or
- * <code>shadow</code> is <code>null</code>.
- *
- * @see java.awt.Color.brighter()
- */
- public SoftBevelBorder(int bevelType, Color highlight, Color shadow)
- {
- this(bevelType,
- /* highlightOuter */ highlight.brighter(),
- /* highlightInner */ highlight,
- /* shadowOuter */ shadow,
- /* shadowInner */ shadow.brighter());
- }
-
-
- /**
- * Constructs a SoftBevelBorder given its appearance type and all
- * colors.
- *
- * <p><img src="doc-files/SoftBevelBorder-3.png" width="500" height="150"
- * alt="[An illustration showing SoftBevelBorders that were
- * constructed with this method]" />
- *
- * @param bevelType the desired appearance of the border. The value
- * must be either {@link BevelBorder#RAISED} or {@link
- * BevelBorder#LOWERED}.
- *
- * @param highlightOuter the color that will be used for the outer
- * side of the highlighted edges (top and left if
- * <code>bevelType</code> is {@link BevelBorder#RAISED};
- * bottom and right otherwise).
- *
- * @param highlightInner the color that will be used for the inner
- * side of the highlighted edges.
- *
- * @param shadowOuter the color that will be used for the outer side
- * of the shadowed edges (bottom and right if
- * <code>bevelType</code> is {@link BevelBorder#RAISED}; top
- * and left otherwise).
- *
- * @param shadowInner the color that will be used for the inner
- * side of the shadowed edges.
- *
- * @throws IllegalArgumentException if <code>bevelType</code> has
- * an unsupported value.
- *
- * @throws NullPointerException if one of the passed colors
- * is <code>null</code>.
- */
- public SoftBevelBorder(int bevelType,
- Color highlightOuter, Color highlightInner,
- Color shadowOuter, Color shadowInner)
- {
- super(bevelType,
- highlightOuter, highlightInner,
- shadowOuter, shadowInner);
- }
-
-
- /**
- * Paints the border for a given component.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- switch (bevelType)
- {
- case RAISED:
- paintSoftBevel(g, x, y, width, height,
- getHighlightOuterColor(c), getHighlightInnerColor(c),
- getShadowInnerColor(c), getShadowOuterColor(c));
- break;
-
- case LOWERED:
- paintSoftBevel(g, x, y, width, height,
- getShadowOuterColor(c), getShadowInnerColor(c),
- getHighlightInnerColor(c), getHighlightOuterColor(c));
- break;
- }
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- return new Insets(3, 3, 3, 3);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- insets.left = insets.right = insets.top = insets.bottom = 3;
- return insets;
- }
-
-
- /**
- * Determines whether this border fills every pixel in its area
- * when painting.
- *
- * <p>The enlarged view (see documentation for constructors) shows
- * that a SoftBevelBorder does not paint all pixels. Therefore,
- * this method always returns <code>false</code>.
- *
- * @return <code>false</code>.
- */
- public boolean isBorderOpaque()
- {
- return false;
- }
-
-
- /**
- * Paints a soft bevel in four colors.
- *
- * <pre>
- * @@@@@@@@@@@.
- * @@.........# @ = color a
- * @.. # . = color b
- * @. # X = color c
- * .. X# # = color d
- * . ##########</pre>
- *
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- * @param a the color for the outer side of the top and left edges.
- * @param b the color for the inner side of the top and left edges.
- * @param c the color for the inner side of the bottom and right edges.
- * @param d the color for the outer side of the bottom and right edges.
- */
- private static void paintSoftBevel(Graphics g,
- int x, int y, int width, int height,
- Color a, Color b, Color c, Color d)
- {
- Color oldColor;
-
- oldColor = g.getColor();
- g.translate(x, y);
- width = width - 1;
- height = height - 1;
-
- try
- {
- /* To understand this code, it might be helpful to look at the
- * images that are included with the JavaDoc, especially
- * SoftBevelBorder-3.png. They are located in the "doc-files"
- * subdirectory.
- */
- g.setColor(a);
- g.drawLine(0, 0, width - 1, 0); // a, horizontal
- g.drawLine(0, 1, 2, 1); // a, horizontal
- g.drawLine(0, 2, 0, height - 1); // a, vertical
-
- g.setColor(b);
- g.drawLine(width, 0, width, 0); // b, horizontal
- g.drawLine(2, 1, width - 1, 1); // b, horizontal
- g.drawLine(1, 2, 2, 2); // b, horizontal
- g.drawLine(1, 3, 1, height - 1); // b, vertical
- g.drawLine(0, height - 1, 0, height); // b, vertical
-
- g.setColor(c);
- g.drawLine(width - 1, height - 1, // c, one pixel
- width - 1, height - 1);
-
- g.setColor(d);
- g.drawLine(2, height, width, height); // d, horizontal
- g.drawLine(width, 2, width, height - 1); // d, vertical
- }
- finally
- {
- g.translate(-x, -y);
- g.setColor(oldColor);
- }
- }
-}
-
diff --git a/libjava/javax/swing/border/TitledBorder.java b/libjava/javax/swing/border/TitledBorder.java
deleted file mode 100644
index 30e4bcd6947..00000000000
--- a/libjava/javax/swing/border/TitledBorder.java
+++ /dev/null
@@ -1,1155 +0,0 @@
-/* TitledBorder.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.border;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Shape;
-
-import javax.swing.UIManager;
-
-
-/**
- * A border that paints a title on top of another border.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class TitledBorder
- extends AbstractBorder
-{
- /**
- * A value for the <code>titlePosition</code> property that vertically
- * positions the title text at the default vertical position, which
- * is in the middle of the top line of the border.
- *
- * @see #getTitlePosition()
- * @see #setTitlePosition(int)
- */
- public static final int DEFAULT_POSITION = 0;
-
-
- /**
- * A value for the <code>titlePosition</code> property that vertically
- * positions the title text above the top line of the border.
- *
- * @see #getTitlePosition()
- * @see #setTitlePosition(int)
- */
- public static final int ABOVE_TOP = 1;
-
-
- /**
- * A value for the <code>titlePosition</code> property that vertically
- * positions the title text at the middle of the top line
- * of the border.
- *
- * @see #getTitlePosition()
- * @see #setTitlePosition(int)
- */
- public static final int TOP = 2;
-
-
- /**
- * A value for the <code>titlePosition</code> property that vertically
- * positions the title text below the top line of the border.
- *
- * @see #getTitlePosition()
- * @see #setTitlePosition(int)
- */
- public static final int BELOW_TOP = 3;
-
-
- /**
- * A value for the <code>titlePosition</code> property that vertically
- * positions the title text above the bottom line of the border.
- *
- * @see #getTitlePosition()
- * @see #setTitlePosition(int)
- */
- public static final int ABOVE_BOTTOM = 4;
-
-
- /**
- * A value for the <code>titlePosition</code> property that vertically
- * positions the title text at the center of the bottom line
- * of the border.
- *
- * @see #getTitlePosition()
- * @see #setTitlePosition(int)
- */
- public static final int BOTTOM = 5;
-
-
- /**
- * A value for the <code>titlePosition</code> property that vertically
- * positions the title text below the bottom line of the border.
- *
- * @see #getTitlePosition()
- * @see #setTitlePosition(int)
- */
- public static final int BELOW_BOTTOM = 6;
-
-
- /**
- * A value for the <code>titleJustification</code> property that
- * horizontally aligns the title text with either the left or the
- * right edge of the border, depending on the orientation of the
- * component nested into the border. If the component orientation
- * is left-to-right, the title text is aligned with the left edge;
- * otherwise, it is aligned with the right edge. This is the same
- * behavior as with {@link #LEADING}.
- *
- * @see #getTitleJustification()
- * @see #setTitleJustification(int)
- * @see java.awt.ComponentOrientation#isLeftToRight()
- */
- public static final int DEFAULT_JUSTIFICATION = 0;
-
-
- /**
- * A value for the <code>titleJustification</code> property that
- * horizontally aligns the title text with the left-hand edge of
- * the border.
- *
- * @see #getTitleJustification()
- * @see #setTitleJustification(int)
- */
- public static final int LEFT = 1;
-
-
- /**
- * A value for the <code>titleJustification</code> property that
- * horizontally aligns the title text with the center of the border.
- *
- * @see #getTitleJustification()
- * @see #setTitleJustification(int)
- */
- public static final int CENTER = 2;
-
-
- /**
- * A value for the <code>titleJustification</code> property that
- * horizontally aligns the title text with the right-hand edge of
- * the border.
- *
- * @see #getTitleJustification()
- * @see #setTitleJustification(int)
- */
- public static final int RIGHT = 3;
-
-
- /**
- * A value for the <code>titleJustification</code> property that
- * horizontally aligns the title text with either the left or the
- * right edge of the border, depending on the orientation of the
- * component nested into the border. If the component orientation
- * is left-to-right, the title text is aligned with the left edge;
- * otherwise, it is aligned with the right edge. This is the same
- * behavior as with {@link #DEFAULT_JUSTIFICATION}.
- *
- * @see #getTitleJustification()
- * @see #setTitleJustification(int)
- * @see java.awt.ComponentOrientation#isLeftToRight()
- */
- public static final int LEADING = 4;
-
-
- /**
- * A value for the <code>titleJustification</code> property that
- * horizontally aligns the title text with either the right or the
- * left edge of the border, depending on the orientation of the
- * component nested into the border. If the component orientation
- * is left-to-right, the title text is aligned with the right edge;
- * otherwise, it is aligned with the left edge.
- *
- * @see #getTitleJustification()
- * @see #setTitleJustification(int)
- * @see java.awt.ComponentOrientation#isLeftToRight()
- */
- public static final int TRAILING = 5;
-
-
- /**
- * The number of pixels between the inside of {@link #border}
- * and the bordered component.
- */
- protected static final int EDGE_SPACING = 2;
-
-
- /**
- * The number of pixels between the outside of this TitledBorder
- * and the beginning (if left-aligned) or end (if right-aligned)
- * of the title text.
- */
- protected static final int TEXT_INSET_H = 5;
-
-
- /**
- * The number of pixels between the title text and {@link #border}.
- * This value is only relevant if the title text does not intersect
- * {@link #border}. No intersection occurs if {@link #titlePosition}
- * is one of {@link #ABOVE_TOP}, {@link #BELOW_TOP}, {@link #ABOVE_BOTTOM},
- * or {@link #BELOW_BOTTOM}.
- */
- protected static final int TEXT_SPACING = 2;
-
-
- /**
- * Determined using the <code>serialver</code> tool of Apple/Sun JDK 1.3.1
- * on MacOS X 10.1.5.
- */
- static final long serialVersionUID = 8012999415147721601L;
-
-
- /**
- * The title, or <code>null</code> to display no title.
- */
- protected String title;
-
-
- /**
- * The border underneath the title. If this value is
- * <code>null</code>, the border will be retrieved from the {@link
- * javax.swing.UIManager}&#x2019;s defaults table using the key
- * <code>TitledBorder.border</code>.
- */
- protected Border border;
-
-
- /**
- * The vertical position of the title text relative to the border,
- * which is one of {@link #ABOVE_TOP}, {@link #TOP}, {@link
- * #BELOW_TOP}, {@link #ABOVE_BOTTOM}, {@link #BOTTOM}, {@link
- * #BELOW_BOTTOM}, or {@link #DEFAULT_POSITION}.
- */
- protected int titlePosition;
-
-
- /**
- * The horizontal alignment of the title text in relation to the
- * border, which is one of {@link #LEFT}, {@link #CENTER}, {@link
- * #RIGHT}, {@link #LEADING}, {@link #TRAILING}, or {@link
- * #DEFAULT_JUSTIFICATION}.
- */
- protected int titleJustification;
-
-
- /**
- * The font for displaying the title text. If this value is
- * <code>null</code>, the font will be retrieved from the {@link
- * javax.swing.UIManager}&#x2019;s defaults table using the key
- * <code>TitledBorder.font</code>.
- */
- protected Font titleFont;
-
-
- /**
- * The color for displaying the title text. If this value is
- * <code>null</code>, the color will be retrieved from the {@link
- * javax.swing.UIManager}&#x2019;s defaults table using the key
- * <code>TitledBorder.titleColor</code>.
- */
- protected Color titleColor;
-
-
- /**
- * Constructs a TitledBorder given the text of its title.
- *
- * @param title the title text, or <code>null</code> to use no title text.
- */
- public TitledBorder(String title)
- {
- this(/* border */ null,
- title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION,
- /* titleFont */ null, /* titleColor */ null);
- }
-
-
- /**
- * Constructs an initially untitled TitledBorder given another border.
- *
- * @param border the border underneath the title, or <code>null</code>
- * to use a default from the current look and feel.
- */
- public TitledBorder(Border border)
- {
- this(border, /* title */ "", DEFAULT_JUSTIFICATION, DEFAULT_POSITION,
- /* titleFont */ null, /* titleColor */ null);
- }
-
-
- /**
- * Constructs a TitledBorder given its border and title text.
- *
- * @param border the border underneath the title, or <code>null</code>
- * to use a default from the current look and feel.
- *
- * @param title the title text, or <code>null</code> to use no title
- * text.
- */
- public TitledBorder(Border border, String title)
- {
- this(border, title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION,
- /* titleFont */ null, /* titleColor */ null);
- }
-
-
- /**
- * Constructs a TitledBorder given its border, title text, horizontal
- * alignment, and vertical position.
- *
- * @param border the border underneath the title, or <code>null</code>
- * to use a default from the current look and feel.
- *
- * @param title the title text, or <code>null</code> to use no title
- * text.
- *
- * @param titleJustification the horizontal alignment of the title
- * text in relation to the border. The value must be one of
- * {@link #LEFT}, {@link #CENTER}, {@link #RIGHT}, {@link #LEADING},
- * {@link #TRAILING}, or {@link #DEFAULT_JUSTIFICATION}.
-
- * @param titlePosition the vertical position of the title text
- * in relation to the border. The value must be one of
- * {@link #ABOVE_TOP}, {@link #TOP}, {@link #BELOW_TOP},
- * {@link #ABOVE_BOTTOM}, {@link #BOTTOM}, {@link #BELOW_BOTTOM},
- * or {@link #DEFAULT_POSITION}.
- *
- * @throws IllegalArgumentException if <code>titleJustification</code>
- * or <code>titlePosition</code> have an unsupported value.
- */
- public TitledBorder(Border border, String title, int titleJustification,
- int titlePosition)
- {
- this(border, title, titleJustification, titlePosition,
- /* titleFont */ null, /* titleColor */ null);
- }
-
-
- /**
- * Constructs a TitledBorder given its border, title text, horizontal
- * alignment, vertical position, and font.
- *
- * @param border the border underneath the title, or <code>null</code>
- * to use a default from the current look and feel.
- *
- * @param title the title text, or <code>null</code> to use no title
- * text.
- *
- * @param titleJustification the horizontal alignment of the title
- * text in relation to the border. The value must be one of
- * {@link #LEFT}, {@link #CENTER}, {@link #RIGHT}, {@link #LEADING},
- * {@link #TRAILING}, or {@link #DEFAULT_JUSTIFICATION}.
- *
- * @param titlePosition the vertical position of the title text
- * in relation to the border. The value must be one of
- * {@link #ABOVE_TOP}, {@link #TOP}, {@link #BELOW_TOP},
- * {@link #ABOVE_BOTTOM}, {@link #BOTTOM}, {@link #BELOW_BOTTOM},
- * or {@link #DEFAULT_POSITION}.
- *
- * @param titleFont the font for the title text, or <code>null</code>
- * to use a default from the current look and feel.
- *
- * @throws IllegalArgumentException if <code>titleJustification</code>
- * or <code>titlePosition</code> have an unsupported value.
- */
- public TitledBorder(Border border, String title, int titleJustification,
- int titlePosition, Font titleFont)
- {
- this(border, title, titleJustification, titlePosition, titleFont,
- /* titleColor */ null);
- }
-
-
- /**
- * Constructs a TitledBorder given its border, title text, horizontal
- * alignment, vertical position, font, and color.
- *
- * @param border the border underneath the title, or <code>null</code>
- * to use a default from the current look and feel.
- *
- * @param title the title text, or <code>null</code> to use no title
- * text.
- *
- * @param titleJustification the horizontal alignment of the title
- * text in relation to the border. The value must be one of
- * {@link #LEFT}, {@link #CENTER}, {@link #RIGHT}, {@link #LEADING},
- * {@link #TRAILING}, or {@link #DEFAULT_JUSTIFICATION}.
- *
- * @param titlePosition the vertical position of the title text
- * in relation to the border. The value must be one of
- * {@link #ABOVE_TOP}, {@link #TOP}, {@link #BELOW_TOP},
- * {@link #ABOVE_BOTTOM}, {@link #BOTTOM}, {@link #BELOW_BOTTOM},
- * or {@link #DEFAULT_POSITION}.
- *
- * @param titleFont the font for the title text, or <code>null</code>
- * to use a default from the current look and feel.
- *
- * @param titleColor the color for the title text, or <code>null</code>
- * to use a default from the current look and feel.
- *
- * @throws IllegalArgumentException if <code>titleJustification</code>
- * or <code>titlePosition</code> have an unsupported value.
- */
- public TitledBorder(Border border, String title, int titleJustification,
- int titlePosition, Font titleFont, Color titleColor)
- {
- this.border = border;
- this.title = title;
-
- /* Invoking the setter methods ensures that the newly constructed
- * TitledBorder has valid property values.
- */
- setTitleJustification(titleJustification);
- setTitlePosition(titlePosition);
-
- this.titleFont = titleFont;
- this.titleColor = titleColor;
- }
-
-
- /**
- * Paints the border and the title text.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- Measurements mes = getMeasurements(c);
- Font oldFont = g.getFont();
- Color oldColor = g.getColor();
-
- /**
- * A local helper class for painting the border without changing
- * any pixels inside the rectangle of the title text.
- */
- class BorderPainter
- {
- private Component c;
- private Border b;
- private int x, y, width, height;
-
- /**
- * Constructs a BorderPainter.
- *
- * @param c the component whose border is being painted.
- * @param b the border object.
- * @param x the x coordinate of the rectangle delimiting the border.
- * @param y the y coordinate of the rectangle delimiting the border.
- * @param width the width of the rectangle delimiting the border.
- * @param height the width of the rectangle delimiting the border.
- */
- public BorderPainter(Component c, Border b,
- int x, int y, int width, int height)
- {
- this.c = c;
- this.b = b;
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- }
-
-
- /**
- * Paints the entire border.
- */
- public void paint(Graphics g)
- {
- if (b != null)
- b.paintBorder(c, g, x, y, width - 1, height - 1);
- }
-
-
- /**
- * Paints the border, clipping the drawing operation to a
- * given rectangular area.
- */
- private void paint(Graphics g,
- int clipX, int clipY, int clipWidth, int clipHeight)
- {
- Shape oldClip = g.getClip();
- try
- {
- g.clipRect(clipX, clipY, clipWidth, clipHeight);
- paint(g);
- }
- finally
- {
- g.setClip(oldClip);
- }
- }
-
-
- /**
- * Paints the border without affecting a given rectangular area.
- * This is used for painting the border without drawing anything
- * underneath the title text.
- *
- * <p>Since we do not want to introduce unnecessary dependencies
- * on Java 2D, we perform the clipping without constructive geometry
- * (provided by java.awt.geom.Area). Instead, the border&#x2019;s
- * bounding rectangle is split into smaller parts, which are then
- * clipped and painted individually.:
- *
- * <p><pre>
- * +--------------------+ +--------------------+
- * | | | 1 |
- * | +--------+ | +---+--------+-------+
- * | | hole | | |====> | 2 | hole | 3 |
- * | +--------+ | |---+--------+-------+
- * | | | 4 |
- * +--------------------+ +--------------------+</pre>
- *
- */
- public void paintExcept(Graphics g,
- int holeX, int holeY, int holeWidth, int holeHeight)
- {
- int stripeHeight;
-
- stripeHeight = holeY - y;
- if (stripeHeight > 0)
- paint(g, x, y, width, stripeHeight); // patch #1 in the image above
-
- stripeHeight = holeHeight;
- if (stripeHeight > 0)
- {
- paint(g, x, holeY, holeX - x, stripeHeight); // patches #2 and #3
- paint(g, holeX + holeWidth, holeY, width - (holeX + holeWidth), stripeHeight);
- }
-
- stripeHeight = height - (holeY - y + holeHeight);
- if (stripeHeight > 0)
- paint(g, x, y + height - stripeHeight, width, stripeHeight); // #4
- }
- };
-
- BorderPainter bp;
- int textX, textY, borderWidth, borderHeight;
-
- borderWidth = width - (mes.borderSpacing.left + mes.borderSpacing.right);
- borderHeight = height - (mes.borderSpacing.top + mes.borderSpacing.bottom);
- bp = new BorderPainter(c, getBorder(),
- x + mes.borderSpacing.left, y + mes.borderSpacing.top,
- borderWidth, borderHeight);
-
- switch (getRealTitleJustification(c))
- {
- case LEFT:
- textX = x + TEXT_INSET_H;
- break;
-
- case CENTER:
- textX = x + (borderWidth - mes.textWidth) / 2;
- break;
-
- case RIGHT:
- textX = x + borderWidth - (mes.textWidth + TEXT_INSET_H);
- break;
-
- default:
- throw new IllegalStateException();
- }
-
- switch (titlePosition)
- {
- case ABOVE_TOP:
- textY = y;
- break;
-
- case TOP:
- case DEFAULT_POSITION:
- default:
- textY = y + mes.borderSpacing.top + mes.borderInsets.top - mes.textAscent;
- break;
-
- case BELOW_TOP:
- textY = y + mes.borderSpacing.top + mes.borderInsets.top + TEXT_SPACING;
- break;
-
- case ABOVE_BOTTOM:
- textY = y + height - mes.borderSpacing.bottom - mes.borderInsets.bottom
- - TEXT_SPACING - (mes.textAscent + mes.textDescent);
- break;
-
- case BOTTOM:
- case BELOW_BOTTOM:
- textY = y + height - (mes.textAscent + mes.textDescent);
- break;
- }
-
- if (mes.trimmedText == null)
- bp.paint(g);
- else
- {
- try
- {
- g.setFont(mes.font);
- g.setColor(getTitleColor());
- g.drawString(mes.trimmedText, textX, textY + mes.textAscent);
- }
- finally
- {
- g.setFont(oldFont);
- g.setColor(oldColor);
- }
- bp.paintExcept(g, textX - 2, textY,
- mes.textWidth + 2, mes.textAscent + mes.textDescent);
- }
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- return getBorderInsets(c, new Insets(0, 0, 0, 0));
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- return getMeasurements(c).getContentInsets(insets);
- }
-
-
- /**
- * Returns <code>false</code>, indicating that there are pixels inside
- * the area of this border where the background shines through.
- *
- * @return <code>false</code>.
- */
- public boolean isBorderOpaque()
- {
- /* Note that the AbstractBorder.isBorderOpaque would also return
- * false, so there is actually no need to override the inherited
- * implementation. However, GNU Classpath strives for exact
- * compatibility with the Sun reference implementation, which
- * overrides isBorderOpaque for unknown reasons.
- */
- return false;
- }
-
-
- /**
- * Returns the text of the title.
- *
- * @return the title text, or <code>null</code> if no title is
- * displayed.
- */
- public String getTitle()
- {
- return title;
- }
-
-
- /**
- * Retrieves the border underneath the title. If no border has been
- * set, or if it has been set to<code>null</code>, the current
- * {@link javax.swing.LookAndFeel} will be asked for a border
- * using the key <code>TitledBorder.border</code>.
- *
- * @return a border, or <code>null</code> if the current LookAndFeel
- * does not provide a border for the key
- * <code>TitledBorder.border</code>.
- *
- * @see javax.swing.UIManager#getBorder(Object)
- */
- public Border getBorder()
- {
- if (border != null)
- return border;
-
- return UIManager.getBorder("TitledBorder.border");
- }
-
-
- /**
- * Returns the vertical position of the title text in relation
- * to the border.
- *
- * @return one of the values {@link #ABOVE_TOP}, {@link #TOP},
- * {@link #BELOW_TOP}, {@link #ABOVE_BOTTOM}, {@link #BOTTOM},
- * {@link #BELOW_BOTTOM}, or {@link #DEFAULT_POSITION}.
- */
- public int getTitlePosition()
- {
- return titlePosition;
- }
-
-
- /**
- * Returns the horizontal alignment of the title text in relation to
- * the border.
- *
- * @return one of the values {@link #LEFT}, {@link #CENTER}, {@link
- * #RIGHT}, {@link #LEADING}, {@link #TRAILING}, or {@link
- * #DEFAULT_JUSTIFICATION}.
- */
- public int getTitleJustification()
- {
- return titleJustification;
- }
-
-
- /**
- * Retrieves the font for displaying the title text. If no font has
- * been set, or if it has been set to<code>null</code>, the current
- * {@link javax.swing.LookAndFeel} will be asked for a font
- * using the key <code>TitledBorder.font</code>.
- *
- * @return a font, or <code>null</code> if the current LookAndFeel
- * does not provide a font for the key
- * <code>TitledBorder.font</code>.
- *
- * @see javax.swing.UIManager#getFont(Object)
- */
- public Font getTitleFont()
- {
- if (titleFont != null)
- return titleFont;
-
- return UIManager.getFont("TitledBorder.font");
- }
-
-
- /**
- * Retrieves the color for displaying the title text. If no color has
- * been set, or if it has been set to<code>null</code>, the current
- * {@link javax.swing.LookAndFeel} will be asked for a color
- * using the key <code>TitledBorder.titleColor</code>.
- *
- * @return a color, or <code>null</code> if the current LookAndFeel
- * does not provide a color for the key
- * <code>TitledBorder.titleColor</code>.
- *
- * @see javax.swing.UIManager#getColor(Object)
- */
- public Color getTitleColor()
- {
- if (titleColor != null)
- return titleColor;
-
- return UIManager.getColor("TitledBorder.titleColor");
- }
-
-
- /**
- * Sets the text of the title.
- *
- * @param title the new title text, or <code>null</code> for displaying
- * no text at all.
- */
- public void setTitle(String title)
- {
- // Swing borders are not JavaBeans, thus no need to fire an event.
- this.title = title;
- }
-
-
- /**
- * Sets the border underneath the title.
- *
- * @param border a border, or <code>null</code> to use the
- * border that is supplied by the current LookAndFeel.
- *
- * @see #getBorder()
- */
- public void setBorder(Border border)
- {
- // Swing borders are not JavaBeans, thus no need to fire an event.
- this.border = border;
- }
-
-
- /**
- * Sets the vertical position of the title text in relation
- * to the border.
- *
- * @param titlePosition one of the values {@link #ABOVE_TOP},
- * {@link #TOP}, {@link #BELOW_TOP}, {@link #ABOVE_BOTTOM},
- * {@link #BOTTOM}, {@link #BELOW_BOTTOM},
- * or {@link #DEFAULT_POSITION}.
- *
- * @throws IllegalArgumentException if an unsupported value is passed
- * for <code>titlePosition</code>.
- */
- public void setTitlePosition(int titlePosition)
- {
- if ((titlePosition < DEFAULT_POSITION) || (titlePosition > BELOW_BOTTOM))
- throw new IllegalArgumentException();
-
- // Swing borders are not JavaBeans, thus no need to fire an event.
- this.titlePosition = titlePosition;
- }
-
-
- /**
- * Sets the horizontal alignment of the title text in relation to the border.
- *
- * @param titleJustification the new alignment, which must be one of
- * {@link #LEFT}, {@link #CENTER}, {@link #RIGHT}, {@link #LEADING},
- * {@link #TRAILING}, or {@link #DEFAULT_JUSTIFICATION}.
- *
- * @throws IllegalArgumentException if an unsupported value is passed
- * for <code>titleJustification</code>.
- */
- public void setTitleJustification(int titleJustification)
- {
- if ((titleJustification < DEFAULT_JUSTIFICATION)
- || (titleJustification > TRAILING))
- throw new IllegalArgumentException();
-
- // Swing borders are not JavaBeans, thus no need to fire an event.
- this.titleJustification = titleJustification;
- }
-
-
- /**
- * Sets the font for displaying the title text.
- *
- * @param titleFont the font, or <code>null</code> to use the font
- * provided by the current {@link javax.swing.LookAndFeel}.
- *
- * @see #getTitleFont()
- */
- public void setTitleFont(Font titleFont)
- {
- // Swing borders are not JavaBeans, thus no need to fire an event.
- this.titleFont = titleFont;
- }
-
-
- /**
- * Sets the color for displaying the title text.
- *
- * @param titleColor the color, or <code>null</code> to use the color
- * provided by the current {@link javax.swing.LookAndFeel}.
- *
- * @see #getTitleColor()
- */
- public void setTitleColor(Color titleColor)
- {
- // Swing borders are not JavaBeans, thus no need to fire an event.
- this.titleColor = titleColor;
- }
-
-
- /**
- * Calculates the minimum size needed for displaying the border
- * and its title.
- *
- * @param c the Component for which this TitledBorder consitutes
- * a border.
- */
- public Dimension getMinimumSize(Component c)
- {
- return getMeasurements(c).getMinimumSize();
- }
-
-
- /**
- * Returns the font that is used for displaying the title text for
- * a given Component.
- *
- * @param c the Component for which this TitledBorder is the border.
- *
- * @return The font returned by {@link #getTitleFont()}, or a fallback
- * if {@link #getTitleFont()} returned <code>null</code>.
- */
- protected Font getFont(Component c)
- {
- Font f;
-
- f = getTitleFont();
- if (f != null)
- return f;
-
- return new Font("Dialog", Font.PLAIN, 12);
- }
-
-
- /**
- * Returns the horizontal alignment of the title text in relation to
- * the border, mapping the component-dependent alignment constants
- * {@link #LEADING}, {@link #TRAILING} and {@link #DEFAULT_JUSTIFICATION}
- * to the correct value according to the embedded component&#x2019;s
- * orientation.
- *
- * @param c the Component for which this TitledBorder is the border.
- *
- * @return one of the values {@link #LEFT}, {@link #CENTER}, or {@link
- * #RIGHT}.
- */
- private int getRealTitleJustification(Component c)
- {
- switch (titleJustification)
- {
- case DEFAULT_JUSTIFICATION:
- case LEADING:
- if ((c == null) || c.getComponentOrientation().isLeftToRight())
- return LEFT;
- else
- return RIGHT;
-
- case TRAILING:
- if ((c == null) || c.getComponentOrientation().isLeftToRight())
- return RIGHT;
- else
- return LEFT;
-
- default:
- return titleJustification;
- }
- }
-
-
- /**
- * Performs various measurements for the current state of this TitledBorder
- * and the given Component.
- */
- private Measurements getMeasurements(Component c)
- {
- Measurements m = new Measurements();
- FontMetrics fmet;
-
- m.font = getFont(c);
- fmet = c.getFontMetrics(m.font);
- m.border = getBorder();
- if (m.border != null)
- m.borderInsets = m.border.getBorderInsets(c);
- else
- m.borderInsets = new Insets(0, 0, 0, 0);
-
- if (title != null)
- {
- m.trimmedText = title.trim();
- if (m.trimmedText.length() == 0)
- m.trimmedText = null;
- }
-
- m.textAscent = fmet.getAscent();
- m.textDescent = fmet.getDescent();
- if (m.trimmedText != null)
- m.textWidth = fmet.stringWidth(m.trimmedText) + 3;
-
- m.edgeSpacing = new Insets(EDGE_SPACING, EDGE_SPACING, EDGE_SPACING, EDGE_SPACING);
- m.borderSpacing = new Insets(0, 0, 0, 0);
-
- switch (titlePosition)
- {
- case ABOVE_TOP:
- m.borderSpacing.top += m.textAscent + m.textDescent + TEXT_SPACING;
- break;
-
- case BELOW_TOP:
- m.edgeSpacing.top += m.textAscent + m.textDescent + TEXT_SPACING;
- break;
-
- case ABOVE_BOTTOM:
- m.edgeSpacing.bottom += m.textAscent + m.textDescent + TEXT_SPACING;
- break;
-
- case BOTTOM:
- m.edgeSpacing.bottom += Math.max(m.textAscent - m.borderInsets.bottom, 0);
- m.borderSpacing.bottom += m.textDescent;
- break;
-
- case BELOW_BOTTOM:
- m.borderSpacing.bottom += m.textAscent + m.textDescent + TEXT_SPACING;
- break;
-
- default:
- m.borderSpacing.top += m.textAscent;
- }
-
- return m;
- }
-
-
- /**
- * A private helper class for holding the result of measuring the
- * distances of a TitledBorder. While it would be possible to cache
- * these objects, it does not seem to be worth the effort. Note that
- * invalidating the cache would be tricky, especially since there is
- * no notification mechanism that would inform the cache when
- * border has changed, so it would return different insets.
- */
- private static class Measurements
- {
- /**
- * The font used for displaying the title text. Note that it can
- * well be that the TitledBorder&#x2019;s font is <code>null</code>,
- * which means that the font is to be retrieved from the current
- * LookAndFeel. In this case, this <code>font</code> field will
- * contain the result of the retrieval. Therefore, it is safe
- * to assume that his <code>font</code> field will never have
- * a <code>null</code> value.
- */
- Font font;
-
-
- /**
- * The number of pixels between the base line and the top of the
- * text box.
- */
- int textAscent;
-
-
- /**
- * The number of pixels between the base line and the bottom of
- * the text box.
- */
- int textDescent;
-
-
- /**
- * The title text after removing leading and trailing white space
- * characters. If the title consists only of white space, the
- * value of <code>trimmedText</code> will be <code>null</code>.
- */
- String trimmedText;
-
-
- /**
- * The width of the trimmed title text in pixels.
- */
- int textWidth;
-
-
- /**
- * The border that constitues the interior border
- * underneath the title text.
- */
- Border border;
-
-
- /**
- * The distance between the TitledBorder and the interior border.
- */
- Insets borderSpacing;
-
-
- /**
- * The width of the interior border, as returned by
- * <code>border.getBorderInsets()</code>.
- */
- Insets borderInsets;
-
-
- /**
- * The distance between the interior border and the nested
- * Component for which this TitledBorder is a border.
- */
- Insets edgeSpacing;
-
-
- /**
- * Determines the insets of the nested component when it has a
- * TitledBorder as its border. Used by {@link
- * TitledBorder#getBorderInsets()}.
- *
- * @param i an Insets object for storing the results into, or
- * <code>null</code> to cause the creation of a
- * new instance.
- *
- * @return the <code>i</code> object, or a new Insets object
- * if <code>null</code> was passed for <code>i</code>.
- */
- public Insets getContentInsets(Insets i)
- {
- if (i == null)
- i = new Insets(0, 0, 0, 0);
- i.left = borderSpacing.left + borderInsets.left + edgeSpacing.left;
- i.right = borderSpacing.right + borderInsets.right + edgeSpacing.right;
- i.top = borderSpacing.top + borderInsets.top + edgeSpacing.top;
- i.bottom = borderSpacing.bottom + borderInsets.bottom + edgeSpacing.bottom;
- return i;
- }
-
-
- /**
- * Calculates the minimum size needed for displaying the border
- * and its title. Used by {@link TitledBorder#getMiminumSize()}.
- */
- public Dimension getMinimumSize()
- {
- int width;
- Insets insets;
-
- insets = getContentInsets(null);
- width = Math.max(insets.left + insets.right, textWidth + 2 * TEXT_INSET_H);
- return new Dimension(width, insets.top + insets.bottom);
- }
- }
-}
diff --git a/libjava/javax/swing/colorchooser/AbstractColorChooserPanel.java b/libjava/javax/swing/colorchooser/AbstractColorChooserPanel.java
deleted file mode 100644
index d55346aaf2c..00000000000
--- a/libjava/javax/swing/colorchooser/AbstractColorChooserPanel.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/* AbstractColorChooserPanel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.colorchooser;
-
-import java.awt.Color;
-import java.awt.Graphics;
-
-import javax.swing.Icon;
-import javax.swing.JColorChooser;
-import javax.swing.JPanel;
-
-/**
- * AbstractColorChooserPanel
- *
- * @author Andrew Selkirk
- * @version 1.0
- */
-public abstract class AbstractColorChooserPanel extends JPanel
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -977469671210173863L;
-
- /** The chooser associated with this panel. */
- private JColorChooser chooser;
-
- /**
- * This is the constructor for the AbstractColorChooserPanel.
- */
- public AbstractColorChooserPanel()
- {
- } // AbstractColorChooserPanel()
-
- /**
- * This method returns the name displayed in the tab for this chooser panel.
- *
- * @return The name displayed in the JTabbedPane's tabs.
- */
- public abstract String getDisplayName();
-
- /**
- * This method updates the chooser panel when the JColorChooser's color has
- * changed.
- */
- public abstract void updateChooser();
-
- /**
- * This method constructs and does any initialization necessary for the
- * chooser panel.
- */
- protected abstract void buildChooser();
-
- /**
- * This method sets the small icon used in the JTabbedPane for this chooser
- * panel.
- *
- * @return The small icon used in the JTabbedPane.
- */
- public abstract Icon getSmallDisplayIcon();
-
- /**
- * This method sets the large icon useed in the jTabbedPane for this chooser
- * panel.
- *
- * @return The large icon.
- */
- public abstract Icon getLargeDisplayIcon();
-
- /**
- * This method installs the chooser panel for the given JColorChooser.
- *
- * @param chooser The JColorChooser that will have this panel installed.
- */
- public void installChooserPanel(JColorChooser chooser)
- {
- this.chooser = chooser;
- buildChooser();
- } // installChooserPanel()
-
- /**
- * This method removes the chooser panel from the given JColorChooser and
- * does any necessary clean up for the chooser panel.
- *
- * @param chooser The JColorChooser that is having this panel removed.
- */
- public void uninstallChooserPanel(JColorChooser chooser)
- {
- this.chooser = null;
- } // uninstallChooserPanel()
-
- /**
- * This method returns the ColorSelectionModel for the JColorChooser
- * associated with this chooser panel.
- *
- * @return The ColorSelectionModel for the JColorChooser associated with
- * this chooser panel.
- */
- public ColorSelectionModel getColorSelectionModel()
- {
- if (chooser != null)
- return chooser.getSelectionModel();
- return null;
- } // getColorSelectionModel()
-
- /**
- * This method returns the current color stored in the model for this
- * chooser panel.
- *
- * @return The current color.
- */
- protected Color getColorFromModel()
- {
- if (chooser != null)
- return chooser.getColor();
- return null;
- } // getColorFromModel()
-
- /**
- * This method paints the chooser panel.
- *
- * @param graphics The Graphics object to paint with.
- */
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- } // paint()
-} // AbstractColorChooserPanel
diff --git a/libjava/javax/swing/colorchooser/ColorChooserComponentFactory.java b/libjava/javax/swing/colorchooser/ColorChooserComponentFactory.java
deleted file mode 100644
index 77e319c70e4..00000000000
--- a/libjava/javax/swing/colorchooser/ColorChooserComponentFactory.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ColorChooserComponentFactory.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.colorchooser;
-
-import javax.swing.JComponent;
-
-
-/**
- * ColorChooserComponentFactory
- *
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class ColorChooserComponentFactory
-{
- /**
- * Constructor ColorChooserComponentFactory
- */
- private ColorChooserComponentFactory()
- {
- } // ColorChooserComponentFactory()
-
- /**
- * This method returns the three default chooser panels to be used in
- * JColorChooser.
- *
- * @return The default chooser panels.
- */
- public static AbstractColorChooserPanel[] getDefaultChooserPanels()
- {
- AbstractColorChooserPanel[] values =
- {
- new DefaultSwatchChooserPanel(),
- new DefaultHSBChooserPanel(),
- new DefaultRGBChooserPanel()
- };
- return values;
- }
-
- /**
- * This method returns the default preview panel to be used with
- * JColorChoosers.
- *
- * @return The default preview panel.
- */
- public static JComponent getPreviewPanel()
- {
- return new DefaultPreviewPanel();
- } // getPreviewPanel()
-} // ColorChooserComponentFactory
diff --git a/libjava/javax/swing/colorchooser/ColorSelectionModel.java b/libjava/javax/swing/colorchooser/ColorSelectionModel.java
deleted file mode 100644
index 5f3070813ce..00000000000
--- a/libjava/javax/swing/colorchooser/ColorSelectionModel.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* ColorSelectionModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.colorchooser;
-
-import java.awt.Color;
-
-import javax.swing.event.ChangeListener;
-
-/**
- * ColorSelectionModel
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface ColorSelectionModel {
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getSelectedColor
- * @returns Color
- */
- Color getSelectedColor();
-
- /**
- * setSelectedColor
- * @param color TODO
- */
- void setSelectedColor(Color color);
-
- /**
- * addChangeListener
- * @param listener TODO
- */
- void addChangeListener(ChangeListener listener);
-
- /**
- * removeChangeListener
- * @param listener TODO
- */
- void removeChangeListener(ChangeListener listener);
-
-
-} // ColorSelectionModel
diff --git a/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java b/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java
deleted file mode 100644
index aae2bed68e5..00000000000
--- a/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/* DefaultColorSelectionModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.colorchooser;
-
-import java.awt.Color;
-import java.io.Serializable;
-
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-/**
- * This is the default implementation of the ColorSelectionModel interface
- * that JColorChoosers use.
- *
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class DefaultColorSelectionModel implements ColorSelectionModel,
- Serializable
-{
- /** DOCUMENT ME! */
- private static final long serialVersionUID = -8117143602864778804L;
-
- /** The currently selected color. */
- private Color selectedColor;
-
- /** The ChangeEvent fired to all ChangeListeners. */
- protected transient ChangeEvent changeEvent = new ChangeEvent(this);
-
- /** The list of listeners. */
- protected EventListenerList listenerList = new EventListenerList();
-
- /**
- * Creates a new color selection model with the default white color.
- */
- public DefaultColorSelectionModel()
- {
- this(Color.white);
- }
-
- /**
- * Creates a new color selection model with a given selected color.
- *
- * @param color The initial color.
- *
- * @throws Error If the color is null.
- */
- public DefaultColorSelectionModel(Color color)
- {
- super();
- if (color == null)
- throw new Error("ColorSelectionModel cannot be set to have null color.");
- this.selectedColor = color;
- }
-
- /**
- * Returns the selected color.
- *
- * @return The selected color.
- */
- public Color getSelectedColor()
- {
- return selectedColor;
- }
-
- /**
- * This method sets the color.
- *
- * @param color The color to set.
- *
- * @throws Error If the color is set.
- */
- public void setSelectedColor(Color color)
- {
- if (color == null)
- throw new Error("ColorSelectionModel cannot be set to have null color.");
- if (color != selectedColor)
- {
- this.selectedColor = color;
- fireStateChanged();
- }
- }
-
- /**
- * Adds a listener to this model.
- *
- * @param listener The listener to add.
- */
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- /**
- * Removes a listener from this model.
- *
- * @param listener The listener to remove.
- */
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- /**
- * Returns all currently added <code>ChangeListener</code> objects.
- *
- * @return Array of <code>ChangeListener</code> objects.
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
- }
-
- /**
- * Calls all the <code>stateChanged()</code> method of all added
- * <code>ChangeListener</code> objects with <code>changeEvent</code> as
- * argument.
- */
- protected void fireStateChanged()
- {
- ChangeListener[] listeners = getChangeListeners();
-
- for (int i = 0; i < listeners.length; i++)
- listeners[i].stateChanged(changeEvent);
- }
-}
diff --git a/libjava/javax/swing/colorchooser/DefaultHSBChooserPanel.java b/libjava/javax/swing/colorchooser/DefaultHSBChooserPanel.java
deleted file mode 100644
index 71d6c75b5f9..00000000000
--- a/libjava/javax/swing/colorchooser/DefaultHSBChooserPanel.java
+++ /dev/null
@@ -1,891 +0,0 @@
-/* DefaultHSBChooserPanel.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.colorchooser;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.GridLayout;
-import java.awt.Image;
-import java.awt.Point;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseMotionListener;
-import java.awt.image.MemoryImageSource;
-
-import javax.swing.AbstractButton;
-import javax.swing.ButtonGroup;
-import javax.swing.Icon;
-import javax.swing.JColorChooser;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-import javax.swing.JSlider;
-import javax.swing.JSpinner;
-import javax.swing.SpinnerNumberModel;
-import javax.swing.SwingConstants;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-/**
- * This is the Default HSB Panel displayed in the JColorChooser.
- */
-class DefaultHSBChooserPanel extends AbstractColorChooserPanel
-{
- /** The gradient image displayed.
- * This is package-private to avoid an accessor method. */
- transient Image gradientImage;
-
- /** The Panel that holds the gradient image. */
- private transient JPanel gradientPanel;
-
- /** The track gradient image.
- * This is package-private to avoid an accessor method. */
- transient Image trackImage;
-
- /** The panel that holds the track. */
- private transient JPanel trackPanel;
-
- /** The slider for the locked HSB value.
- * This is package-private to avoid an accessor method. */
- transient JSlider slider;
-
- /** The RadioButton that controls the Hue.
- * This is package-private to avoid an accessor method. */
- transient JRadioButton hRadio;
-
- /** The RadioButton that controls the Saturation.
- * This is package-private to avoid an accessor method. */
- transient JRadioButton sRadio;
-
- /** The RadioButton that controls the Brightness.
- * This is package-private to avoid an accessor method. */
- transient JRadioButton bRadio;
-
- /** The JSpinner that controls the Hue.
- * This is package-private to avoid an accessor method. */
- transient JSpinner hSpinner;
-
- /** The JSpinner that controls the Saturation.
- * This is package-private to avoid an accessor method. */
- transient JSpinner sSpinner;
-
- /** The JSpinner that controls the Brightness.
- * This is package-private to avoid an accessor method. */
- transient JSpinner bSpinner;
-
- /** The default width of the gradient image. */
- private static final int imgWidth = 200;
-
- /** The default height of the gradient image. */
- private static final int imgHeight = 200;
-
- /** The default width of the track gradient. */
- private static final int trackWidth = 30;
-
- /** The JLabel for Red. */
- private static final JLabel R = new JLabel("R");
-
- /** The JLabel for Green. */
- private static final JLabel G = new JLabel("G");
-
- /** The JLabel for Blue. */
- private static final JLabel B = new JLabel("B");
-
- // FIXME: Should be textfields.
-
- /** The JLabel that displays the value of Red. */
- private transient JLabel rFull;
-
- /** The JLabel that displays the value of Green. */
- private transient JLabel gFull;
-
- /** The JLabel that displays the value of Blue. */
- private transient JLabel bFull;
-
- /** The point that is displayed in the gradient image.
- * Package-private to avoid an accessor method.
- */
- transient Point gradientPoint = new Point();
-
- /**
- * This indicates that the change to the slider or point is triggered
- * internally.
- * This is package-private to avoid an accessor method.
- */
- transient boolean internalChange = false;
-
- /** This indicates that the change to the spinner is triggered
- * internally.
- * This is package-private to avoid an accessor method. */
- transient boolean spinnerTrigger = false;
-
- /** This int identifies which spinner is currently locked.
- * This is package-private to avoid an accessor method. */
- transient int locked = -1;
-
- /** This value indicates that the Hue spinner is locked. */
- static final int HLOCKED = 0;
-
- /** This value indicates that the Saturation spinner is locked. */
- static final int SLOCKED = 1;
-
- /** This value indicates that the Brightness spinner is locked. */
- static final int BLOCKED = 2;
-
- /**
- * This method indicates that the mouse event is in the process of being
- * handled.
- * This is package-private to avoid an accessor method.
- */
- transient boolean handlingMouse;
-
- /**
- * This helper class handles mouse events on the gradient image.
- */
- class MainGradientMouseListener extends MouseAdapter
- implements MouseMotionListener
- {
- /**
- * This method is called when the mouse is pressed over the gradient
- * image. The JColorChooser is then updated with new HSB values.
- *
- * @param e The MouseEvent.
- */
- public void mousePressed(MouseEvent e)
- {
- gradientPoint = e.getPoint();
- update(e.getPoint());
- }
-
- /**
- * This method is called when the mouse is dragged over the gradient
- * image. The JColorChooser is then updated with the new HSB values.
- *
- * @param e The MouseEvent.
- */
- public void mouseDragged(MouseEvent e)
- {
- Point p = e.getPoint();
- if (p.x < 0 || p.y < 0 || p.y > imgHeight || p.x > imgWidth)
- return;
-
- gradientPoint = p;
- update(p);
- }
-
- /**
- * This method is called when the mouse is moved over the gradient image.
- *
- * @param e The MouseEvent.
- */
- public void mouseMoved(MouseEvent e)
- {
- // Do nothing.
- }
-
- /**
- * This method updates the JColorChooser with the new values.
- *
- * @param p The Point where the MouseEvent occurred.
- */
- private void update(Point p)
- {
- handlingMouse = true;
- if (hSpinner.isEnabled())
- updateH(p);
- else if (sSpinner.isEnabled())
- updateS(p);
- else
- updateB(p);
- handlingMouse = false;
- }
-
- /**
- * This method updates the SB values if Hue is locked.
- *
- * @param p The point where the MouseEvent occurred.
- */
- private void updateH(Point p)
- {
- float s = (imgWidth - p.x * 1f) / imgWidth;
- float b = (imgHeight - p.y * 1f) / imgHeight;
-
- // Avoid two changes to the model by changing internalChange to true.
- internalChange = true;
- sSpinner.setValue(new Integer((int) (s * 100)));
- internalChange = false;
- bSpinner.setValue(new Integer((int) (b * 100)));
-
- revalidate();
- }
-
- /**
- * This method updates the HB values if Saturation is locked.
- *
- * @param p The point where the MouseEvent occurred.
- */
- private void updateS(Point p)
- {
- float h = p.x * 1f / imgWidth;
- float b = (imgHeight - p.y * 1f) / imgHeight;
-
- internalChange = true;
- hSpinner.setValue(new Integer((int) (h * 365)));
- internalChange = false;
- bSpinner.setValue(new Integer((int) (b * 100)));
-
- revalidate();
- }
-
- /**
- * This method updates the HS values if Brightness is locked.
- *
- * @param p The point where the MouseEvent occurred.
- */
- private void updateB(Point p)
- {
- float h = p.x * 1f / imgWidth;
- float s = (imgHeight - p.y * 1f) / imgHeight;
-
- internalChange = true;
- hSpinner.setValue(new Integer((int) (h * 365)));
- internalChange = false;
- sSpinner.setValue(new Integer((int) (s * 100)));
-
- revalidate();
- }
- }
-
- /**
- * This method listens for slider value changes.
- */
- class SliderChangeListener implements ChangeListener
- {
- /**
- * This method is called when the slider value changes. It should change
- * the color of the JColorChooser.
- *
- * @param e The ChangeEvent.
- */
- public void stateChanged(ChangeEvent e)
- {
- if (internalChange)
- return;
-
- Integer value = new Integer(slider.getValue());
-
- switch (locked)
- {
- case HLOCKED:
- hSpinner.setValue(value);
- break;
- case SLOCKED:
- sSpinner.setValue(value);
- break;
- case BLOCKED:
- bSpinner.setValue(value);
- break;
- }
- }
- }
-
- /**
- * This helper class determines the active JSpinner.
- */
- class RadioStateListener implements ChangeListener
- {
- /**
- * This method is called when there is a new JRadioButton that was
- * selected. As a result, it should activate the associated JSpinner.
- *
- * @param e The ChangeEvent.
- */
- public void stateChanged(ChangeEvent e)
- {
- JSpinner change;
- if (e.getSource() == hRadio)
- {
- locked = HLOCKED;
- change = hSpinner;
- }
- else if (e.getSource() == sRadio)
- {
- locked = SLOCKED;
- change = sSpinner;
- }
- else
- {
- locked = BLOCKED;
- change = bSpinner;
- }
-
- change.setEnabled(((AbstractButton) e.getSource()).isSelected());
- updateSlider();
- updateTrack();
- updateImage();
- repaint();
- }
- }
-
- /**
- * This class listens to the JSpinners for changes.
- */
- class ImageScrollListener implements ChangeListener
- {
- /**
- * This method is called whenever one of the JSpinner values change. The
- * JColorChooser should be updated with the new HSB values.
- *
- * @param e The ChangeEvent.
- */
- public void stateChanged(ChangeEvent e)
- {
- if (internalChange)
- return;
-
- float h = ((Number) hSpinner.getValue()).intValue() / 360f;
- float s = ((Number) sSpinner.getValue()).intValue() / 100f;
- float b = ((Number) bSpinner.getValue()).intValue() / 100f;
-
- spinnerTrigger = true;
- getColorSelectionModel().setSelectedColor(new Color(Color.HSBtoRGB(h, s,
- b)));
- spinnerTrigger = false;
-
- if (! handlingMouse && slider != null && ! slider.getValueIsAdjusting())
- {
- updateImage();
- updateTrack();
- }
- repaint();
- }
- }
-
- /**
- * Creates a new DefaultHSBChooserPanel object.
- */
- DefaultHSBChooserPanel()
- {
- super();
- }
-
- /**
- * This method returns the name displayed by the JColorChooser tab that
- * holds this panel.
- *
- * @return The name displayed in the JColorChooser tab.
- */
- public String getDisplayName()
- {
- return "HSB";
- }
-
- /**
- * This method updates the various components inside the HSBPanel (the
- * JSpinners, the JSlider, and the gradient image point) with updated
- * values when the JColorChooser color value changes.
- */
- public void updateChooser()
- {
- Color c = getColorSelectionModel().getSelectedColor();
-
- float[] hsbVals = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(),
- null);
-
- internalChange = true;
-
- if (! spinnerTrigger)
- {
- hSpinner.setValue(new Integer((int) (hsbVals[0] * 360)));
- sSpinner.setValue(new Integer((int) (hsbVals[1] * 100)));
- bSpinner.setValue(new Integer((int) (hsbVals[2] * 100)));
- }
-
- switch (locked)
- {
- case HLOCKED:
- if (slider != null)
- slider.setValue(((Number) hSpinner.getValue()).intValue());
- if (! handlingMouse)
- {
- gradientPoint.x = (int) ((1
- - ((Number) sSpinner.getValue()).intValue() / 100f) * imgWidth);
- gradientPoint.y = (int) ((1
- - ((Number) bSpinner.getValue()).intValue() / 100f) * imgHeight);
- }
- break;
- case SLOCKED:
- if (slider != null)
- slider.setValue(((Number) sSpinner.getValue()).intValue());
- if (! handlingMouse)
- {
- gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / 360f * imgWidth);
- gradientPoint.y = (int) ((1
- - ((Number) bSpinner.getValue()).intValue() / 100f) * imgHeight);
- }
- break;
- case BLOCKED:
- if (slider != null)
- slider.setValue(((Number) bSpinner.getValue()).intValue());
- if (! handlingMouse)
- {
- gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / 360f * imgWidth);
- gradientPoint.y = (int) ((1
- - ((Number) sSpinner.getValue()).intValue() / 100f) * imgHeight);
- }
- break;
- }
- internalChange = false;
-
- if (! handlingMouse && slider != null && ! slider.getValueIsAdjusting())
- updateImage();
-
- if (! handlingMouse || locked != HLOCKED)
- updateTrack();
- updateTextFields();
- }
-
- /**
- * This method builds the DefaultHSBChooserPanel.
- */
- protected void buildChooser()
- {
- setLayout(new BorderLayout());
-
- add(buildRightPanel(), BorderLayout.EAST);
-
- JPanel container = new JPanel();
- container.setLayout(new BorderLayout());
-
- gradientPanel = new JPanel()
- {
- public Dimension getPreferredSize()
- {
- return new Dimension(imgWidth, imgHeight);
- }
-
- public void paint(Graphics g)
- {
- if (gradientImage != null)
- g.drawImage(gradientImage, 0, 0, this);
-
- Color saved = g.getColor();
- g.setColor(Color.WHITE);
- g.drawOval(gradientPoint.x - 3, gradientPoint.y - 3, 6, 6);
- g.setColor(saved);
- }
- };
-
- MouseAdapter ml = new MainGradientMouseListener();
- gradientPanel.addMouseListener(ml);
- gradientPanel.addMouseMotionListener((MouseMotionListener) ml);
-
- trackPanel = new JPanel()
- {
- public Dimension getPreferredSize()
- {
- return new Dimension(trackWidth, imgHeight);
- }
-
- public void paint(Graphics g)
- {
- if (trackImage != null)
- g.drawImage(trackImage, 0, 0, this);
- }
- };
-
- slider = new JSlider();
- slider.setPaintTrack(false);
- slider.setPaintTicks(false);
-
- slider.setOrientation(SwingConstants.VERTICAL);
-
- updateSlider();
-
- container.add(gradientPanel, BorderLayout.WEST);
- container.add(slider, BorderLayout.CENTER);
- container.add(trackPanel, BorderLayout.EAST);
-
- add(container, BorderLayout.WEST);
- slider.addChangeListener(new SliderChangeListener());
- repaint();
- }
-
- /**
- * This method uninstalls the DefaultHSBPanel.
- *
- * @param chooser The JColorChooser to remove this panel from.
- */
- public void uninstallChooserPanel(JColorChooser chooser)
- {
- trackImage = null;
- gradientImage = null;
- gradientPanel = null;
- slider = null;
-
- hSpinner = null;
- sSpinner = null;
- bSpinner = null;
-
- hRadio = null;
- sRadio = null;
- bRadio = null;
-
- removeAll();
- super.uninstallChooserPanel(chooser);
- }
-
- /**
- * This helper method creates the right side panel (the panel with the
- * Spinners and TextFields).
- *
- * @return The right side panel.
- */
- private Container buildRightPanel()
- {
- JPanel container = new JPanel();
- container.setLayout(new GridLayout(6, 2));
-
- hRadio = new JRadioButton("H");
- sRadio = new JRadioButton("S");
- bRadio = new JRadioButton("B");
-
- ButtonGroup group = new ButtonGroup();
- group.add(hRadio);
- group.add(sRadio);
- group.add(bRadio);
-
- hSpinner = new JSpinner(new SpinnerNumberModel(0, 0, 359, 1));
- sSpinner = new JSpinner(new SpinnerNumberModel(0, 0, 100, 1));
- bSpinner = new JSpinner(new SpinnerNumberModel(100, 0, 100, 1));
-
- hSpinner.setEnabled(false);
- sSpinner.setEnabled(false);
- bSpinner.setEnabled(false);
-
- ChangeListener cl = new RadioStateListener();
- ChangeListener scroll = new ImageScrollListener();
-
- hRadio.addChangeListener(cl);
- sRadio.addChangeListener(cl);
- bRadio.addChangeListener(cl);
-
- hSpinner.addChangeListener(scroll);
- sSpinner.addChangeListener(scroll);
- bSpinner.addChangeListener(scroll);
-
- hRadio.setSelected(true);
-
- container.add(hRadio);
- container.add(hSpinner);
-
- container.add(sRadio);
- container.add(sSpinner);
-
- container.add(bRadio);
- container.add(bSpinner);
-
- rFull = new JLabel("red full");
- gFull = new JLabel("green full");
- bFull = new JLabel("blue full");
-
- container.add(R);
- container.add(rFull);
-
- container.add(G);
- container.add(gFull);
-
- container.add(B);
- container.add(bFull);
-
- return container;
- }
-
- /**
- * This method returns the small display icon.
- *
- * @return The small display icon.
- */
- public Icon getSmallDisplayIcon()
- {
- return null;
- }
-
- /**
- * This method returns the large display icon.
- *
- * @return The large display icon.
- */
- public Icon getLargeDisplayIcon()
- {
- return null;
- }
-
- /**
- * This method paints the chooser panel.
- *
- * @param g The graphics object to paint with.
- */
- public void paint(Graphics g)
- {
- super.paint(g);
- }
-
- /**
- * This method updates the gradient image with a new one taking the Hue
- * value as the constant.
- */
- private void updateHLockImage()
- {
- int index = 0;
- int[] pix = new int[imgWidth * imgHeight];
- float hValue = ((Number) hSpinner.getValue()).intValue() / 360f;
-
- for (int j = 0; j < imgHeight; j++)
- for (int i = 0; i < imgWidth; i++)
- pix[index++] = Color.HSBtoRGB(hValue, (imgWidth - i * 1f) / imgWidth,
- (imgHeight - j * 1f) / imgHeight)
- | (255 << 24);
-
- gradientImage = createImage(new MemoryImageSource(imgWidth, imgHeight,
- pix, 0, imgWidth));
- }
-
- /**
- * This method updates the gradient image with a new one taking the
- * Brightness value as the constant.
- */
- private void updateBLockImage()
- {
- int[] pix = new int[imgWidth * imgHeight];
- float bValue = ((Number) bSpinner.getValue()).intValue() / 100f;
-
- int index = 0;
- for (int j = 0; j < imgHeight; j++)
- for (int i = 0; i < imgWidth; i++)
- pix[index++] = Color.HSBtoRGB(i * 1f / imgWidth,
- (imgHeight - j * 1f) / imgHeight, bValue)
- | (255 << 24);
-
- gradientImage = createImage(new MemoryImageSource(imgWidth, imgHeight,
- pix, 0, imgWidth));
- }
-
- /**
- * This method updates the gradient image with a new one taking the
- * Saturation value as the constant.
- */
- private void updateSLockImage()
- {
- int[] pix = new int[imgWidth * imgHeight];
- float sValue = ((Number) sSpinner.getValue()).intValue() / 100f;
-
- int index = 0;
- for (int j = 0; j < imgHeight; j++)
- for (int i = 0; i < imgWidth; i++)
- pix[index++] = Color.HSBtoRGB(i * 1f / imgWidth, sValue,
- (imgHeight - j * 1f) / imgHeight)
- | (255 << 24);
- gradientImage = createImage(new MemoryImageSource(imgWidth, imgHeight,
- pix, 0, imgWidth));
- }
-
- /**
- * This method calls the appropriate method to update the gradient image
- * depending on which HSB value is constant.
- * This is package-private to avoid an accessor method.
- */
- void updateImage()
- {
- switch (locked)
- {
- case HLOCKED:
- updateHLockImage();
- break;
- case SLOCKED:
- updateSLockImage();
- break;
- case BLOCKED:
- updateBLockImage();
- break;
- }
- }
-
- /**
- * This method updates the TextFields with the correct RGB values.
- */
- private void updateTextFields()
- {
- int c = getColorSelectionModel().getSelectedColor().getRGB();
-
- rFull.setText("" + (c >> 16 & 0xff));
- gFull.setText("" + (c >> 8 & 0xff));
- bFull.setText("" + (c & 0xff));
-
- repaint();
- }
-
- /**
- * This method updates the slider in response to making a different HSB
- * property the constant.
- * This is package-private to avoid an accessor method.
- */
- void updateSlider()
- {
- if (slider == null)
- return;
-
- slider.setMinimum(0);
- if (locked == HLOCKED)
- {
- slider.setMaximum(359);
- ;
- slider.setValue(((Number) hSpinner.getValue()).intValue());
- slider.setInverted(true);
- }
- else
- {
- slider.setMaximum(100);
- slider.setInverted(false);
- if (sRadio.isSelected())
- slider.setValue(((Number) sSpinner.getValue()).intValue());
- else
- slider.setValue(((Number) bSpinner.getValue()).intValue());
- }
- repaint();
- }
-
- /**
- * This method updates the track gradient image depending on which HSB
- * property is constant.
- * This is package-private to avoid an accessor method.
- */
- void updateTrack()
- {
- switch (locked)
- {
- case HLOCKED:
- updateHTrack();
- break;
- case SLOCKED:
- updateSTrack();
- break;
- case BLOCKED:
- updateBTrack();
- break;
- }
- }
-
- /**
- * This method updates the track gradient image if the Hue value is allowed
- * to change (according to the JRadioButtons).
- */
- private void updateHTrack()
- {
- int trackIndex = 0;
- int[] trackPix = new int[trackWidth * imgHeight];
-
- for (int j = 0; j < imgHeight; j++)
- for (int i = 0; i < trackWidth; i++)
- trackPix[trackIndex++] = Color.HSBtoRGB(j * 1f / imgHeight, 1f, 1f)
- | (255 << 24);
-
- trackImage = createImage(new MemoryImageSource(trackWidth, imgHeight,
- trackPix, 0, trackWidth));
- }
-
- /**
- * This method updates the track gradient image if the Saturation value is
- * allowed to change (according to the JRadioButtons).
- */
- private void updateSTrack()
- {
- int[] trackPix = new int[trackWidth * imgHeight];
-
- float hValue = ((Number) hSpinner.getValue()).intValue() / 360f;
- float bValue = ((Number) bSpinner.getValue()).intValue() / 100f;
-
- int trackIndex = 0;
- for (int j = 0; j < imgHeight; j++)
- for (int i = 0; i < trackWidth; i++)
- trackPix[trackIndex++] = Color.HSBtoRGB(hValue,
- (imgHeight - j * 1f) / imgHeight,
- bValue) | (255 << 24);
-
- trackImage = createImage(new MemoryImageSource(trackWidth, imgHeight,
- trackPix, 0, trackWidth));
- }
-
- /**
- * This method updates the track gradient image if the Brightness value is
- * allowed to change (according to the JRadioButtons).
- */
- private void updateBTrack()
- {
- int[] trackPix = new int[trackWidth * imgHeight];
-
- float hValue = ((Number) hSpinner.getValue()).intValue() / 360f;
- float sValue = ((Number) sSpinner.getValue()).intValue() / 100f;
-
- int trackIndex = 0;
- for (int j = 0; j < imgHeight; j++)
- for (int i = 0; i < trackWidth; i++)
- trackPix[trackIndex++] = Color.HSBtoRGB(hValue, sValue,
- (imgHeight - j * 1f) / imgHeight)
- | (255 << 24);
-
- trackImage = createImage(new MemoryImageSource(trackWidth, imgHeight,
- trackPix, 0, trackWidth));
- }
-
- /**
- * This method returns the HSB values for the currently selected color.
- *
- * @return The HSB values for the currently selected color.
- */
- private float[] getHSBValues()
- {
- Color c = getColorFromModel();
- float[] f = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null);
- return f;
- }
-}
diff --git a/libjava/javax/swing/colorchooser/DefaultPreviewPanel.java b/libjava/javax/swing/colorchooser/DefaultPreviewPanel.java
deleted file mode 100644
index 2462add3df2..00000000000
--- a/libjava/javax/swing/colorchooser/DefaultPreviewPanel.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/* DefaultPreviewPanel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.colorchooser;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-import javax.swing.JColorChooser;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-import javax.swing.border.Border;
-
-/**
- * This is the default preview panel for the JColorChooser. The default
- * preview panel is responsible for displaying the currently selected color
- * of the JColorChooser.
- */
-class DefaultPreviewPanel extends JPanel
-{
- /**
- * This is the border around the preview panel.
- */
- class PreviewBorder implements Border
- {
- /** This is the value of the top, bottom, top, and right inset. */
- private static final int edge = 20;
-
- /**
- * This is the distance from the top left corner of the border to the
- * text.
- */
- private static final int lead = 5;
-
- /** This is the horizontal gap between the text and the border. */
- private static final int gap = 3;
-
- /**
- * This method returns the border insets for the given Component.
- *
- * @param c The Component to retrieve insets for.
- *
- * @return The insets for the given Component.
- */
- public Insets getBorderInsets(Component c)
- {
- return new Insets(edge, edge, edge, edge);
- }
-
- /**
- * This method returns whether the border is responsible for painting its
- * own background.
- *
- * @return Whether the border is responsible for painting its own
- * background.
- */
- public boolean isBorderOpaque()
- {
- return true;
- }
-
- /**
- * This method paints the border for the given component with the graphics
- * object using the given properties.
- *
- * @param c The Component to paint the border for.
- * @param g The Graphics object to paint with.
- * @param x The x location to paint at.
- * @param y The y location to paint at.
- * @param width The width of the component.
- * @param height The height of the component.
- */
- public void paintBorder(Component c, Graphics g, int x, int y, int width,
- int height)
- {
- Color saved = g.getColor();
- FontMetrics fm = g.getFontMetrics();
-
- g.setColor(Color.BLACK);
- g.drawLine(x + edge / 2, y + edge / 2, x + edge / 2,
- y + height - edge / 2);
- g.drawLine(x + edge / 2, y + height - edge / 2, x + width - edge / 2,
- y + height - edge / 2);
- g.drawLine(x + width - edge / 2, y + edge / 2, x + width - edge / 2,
- y + height - edge / 2);
- g.drawLine(x + edge / 2, y + edge / 2, x + edge / 2 + lead, y + edge / 2);
-
- int strwidth = fm.stringWidth("Preview");
-
- g.drawString("Preview", x + edge / 2 + lead + gap,
- y + edge / 2 + fm.getAscent() / 2);
-
- g.drawLine(x + lead + edge / 2 + strwidth + gap * 2, y + edge / 2,
- x + width - edge / 2, y + edge / 2);
-
- g.setColor(saved);
- }
- }
-
- /** A standard large gap size. */
- private static int largeGap = 6;
-
- /** A standard small gap size. */
- private static int smallGap = 2;
-
- /** The size of each side of the square. */
- private static int squareSize = 36;
-
- /** This padding between the text and the edge of its box. */
- private static int textPadding = 4;
-
- /** The width of the right most rectangles. */
- private static int rightSideRectWidth = 60;
-
- /** The sample text. */
- private static String sample = "Sample Text Sample Text";
-
- /**
- * Creates a new DefaultPreviewPanel object.
- */
- DefaultPreviewPanel()
- {
- super();
- setBorder(new PreviewBorder());
- }
-
- /**
- * This method paints the default preview panel with the given Graphics
- * object.
- *
- * @param g The Graphics object.
- */
- public void paint(Graphics g)
- {
- super.paint(g);
- Color currentColor = null;
- JColorChooser chooser = (JColorChooser) SwingUtilities.getAncestorOfClass(JColorChooser.class,
- this);
- if (chooser != null)
- currentColor = chooser.getColor();
-
- Color saved = g.getColor();
- Insets insets = getInsets();
-
- int down = insets.top + squareSize + largeGap;
- int currX = insets.left;
-
- paintSquare(g, currX, insets.top, Color.WHITE, currentColor, Color.WHITE,
- -1, -1, -1);
- paintSquare(g, currX, down, currentColor, null, null, -1, -1, -1);
-
- currX += squareSize + largeGap;
-
- paintSquare(g, currX, insets.top, Color.BLACK, currentColor, Color.WHITE,
- -1, -1, -1);
- paintSquare(g, currX, down, Color.WHITE, currentColor, null, -1, -1, -1);
-
- currX += squareSize + largeGap;
-
- paintSquare(g, currX, insets.top, Color.WHITE, currentColor, Color.BLACK,
- -1, -1, -1);
- paintSquare(g, currX, down, Color.BLACK, currentColor, null, -1, -1, -1);
-
- FontMetrics fm = g.getFontMetrics();
- int strWidth = fm.stringWidth(sample);
- int strHeight = fm.getHeight();
-
- currX += squareSize + largeGap;
-
- int boxWidth = 2 * textPadding + strWidth;
- int boxHeight = 2 * textPadding + strHeight;
-
- int first = insets.top + textPadding;
- int second = insets.top + boxHeight + smallGap;
- int third = insets.top + 2 * (boxHeight + smallGap);
-
- g.setColor(Color.WHITE);
- g.fillRect(currX, third, boxWidth, boxHeight);
-
- g.setColor(currentColor);
- g.drawString(sample, currX + textPadding,
- first + textPadding + fm.getAscent());
-
- g.fillRect(currX, second, boxWidth, boxHeight);
-
- g.drawString(sample, currX + textPadding,
- third + textPadding + fm.getAscent());
-
- g.setColor(Color.BLACK);
- g.drawString(sample, currX + textPadding,
- second + textPadding + fm.getAscent());
-
- currX += boxWidth + largeGap;
-
- g.setColor(Color.WHITE);
- g.fillRect(currX, insets.top, rightSideRectWidth, squareSize
- + largeGap / 2);
-
- g.setColor(currentColor);
- g.fillRect(currX, insets.top + squareSize + largeGap / 2,
- rightSideRectWidth, squareSize + largeGap / 2);
-
- g.setColor(saved);
- }
-
- /**
- * This method creates and paints a square. The square has two smaller
- * squares inside of it. Each of the three squares has their sizes
- * determined by the size arguments. If the size is not given (by passing
- * in -1), then the size is determined automatically.
- *
- * @param g The Graphics object to paint with.
- * @param x The x location to paint at.
- * @param y The y location to paint at.
- * @param first The color of the first square.
- * @param second The color of the second square.
- * @param third The color of the third square.
- * @param firstSize The size of the first square.
- * @param secondSize The size of the second square.
- * @param thirdSize The size of the third square.
- */
- private void paintSquare(Graphics g, int x, int y, Color first,
- Color second, Color third, int firstSize,
- int secondSize, int thirdSize)
- {
- Color saved = g.getColor();
- if (firstSize == -1)
- firstSize = squareSize;
- if (secondSize == -1)
- secondSize = squareSize * 2 / 3;
- if (thirdSize == -1)
- thirdSize = squareSize / 3;
- int secondOffset = (firstSize - secondSize) / 2;
- int thirdOffset = (firstSize - thirdSize) / 2;
-
- if (first == null)
- return;
- g.setColor(first);
- g.fillRect(x, y, firstSize, firstSize);
- if (second == null)
- return;
- g.setColor(second);
- g.fillRect(x + secondOffset, y + secondOffset, secondSize, secondSize);
- if (third == null)
- return;
- g.setColor(third);
- g.fillRect(x + thirdOffset, y + thirdOffset, thirdSize, thirdSize);
-
- g.setColor(saved);
- }
-
- /**
- * This method returns the preferred size of the default preview panel.
- *
- * @return The preferred size of the default preview panel.
- */
- public Dimension getPreferredSize()
- {
- Graphics g = getGraphics();
- FontMetrics fm = g.getFontMetrics();
- g.dispose();
-
- int strWidth = fm.stringWidth(sample);
- int strHeight = fm.getHeight();
-
- int h1 = (strHeight + 2 * textPadding) * 3 + 2 * smallGap;
- int h2 = 2 * squareSize + largeGap;
-
- int height = Math.max(h1, h2);
-
- int width = 3 * (squareSize + largeGap) + strWidth + 2 * textPadding
- + largeGap + rightSideRectWidth;
-
- Insets insets = getInsets();
-
- return new Dimension(width + insets.right + insets.left,
- height + insets.top + insets.bottom);
- }
-}
diff --git a/libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java b/libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java
deleted file mode 100644
index 39a1732502d..00000000000
--- a/libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/* DefaultRGHChooserPanel.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.colorchooser;
-
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-
-import javax.swing.Icon;
-import javax.swing.JColorChooser;
-import javax.swing.JLabel;
-import javax.swing.JSlider;
-import javax.swing.JSpinner;
-import javax.swing.SpinnerNumberModel;
-import javax.swing.SwingConstants;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-/**
- * This is the default RGB panel for the JColorChooser. The color is selected
- * using three sliders that represent the RGB values.
- */
-class DefaultRGBChooserPanel extends AbstractColorChooserPanel
-{
- /**
- * This class handles the slider value changes for all three sliders.
- */
- class SliderHandler implements ChangeListener
- {
- /**
- * This method is called whenever any of the slider values change.
- *
- * @param e The ChangeEvent.
- */
- public void stateChanged(ChangeEvent e)
- {
- if (updateChange)
- return;
-
- int color = R.getValue() << 16 | G.getValue() << 8 | B.getValue();
-
- sliderChange = true;
- getColorSelectionModel().setSelectedColor(new Color(color));
- sliderChange = false;
- }
- }
-
- /**
- * This class handles the Spinner values changing.
- */
- class SpinnerHandler implements ChangeListener
- {
- /**
- * This method is called whenever any of the JSpinners change values.
- *
- * @param e The ChangeEvent.
- */
- public void stateChanged(ChangeEvent e)
- {
- if (updateChange)
- return;
-
- int red = ((Number) RSpinner.getValue()).intValue();
- int green = ((Number) GSpinner.getValue()).intValue();
- int blue = ((Number) BSpinner.getValue()).intValue();
-
- int color = red << 16 | green << 8 | blue;
-
- spinnerChange = true;
- getColorSelectionModel().setSelectedColor(new Color(color));
- spinnerChange = false;
- }
- }
-
- /** Whether the color change was initiated by the spinners.
- * This is package-private to avoid an accessor method. */
- transient boolean spinnerChange = false;
-
- /** Whether the color change was initiated by the sliders.
- * This is package-private to avoid an accessor method. */
- transient boolean sliderChange = false;
-
- /**
- * Whether the change was forced by the chooser (meaning the color has
- * already been changed).
- * This is package-private to avoid an accessor method.
- */
- transient boolean updateChange = false;
-
- /** The ChangeListener for the sliders. */
- private transient ChangeListener colorChanger;
-
- /** The ChangeListener for the spinners. */
- private transient ChangeListener spinnerHandler;
-
- /** The slider that handles the red values.
- * This is package-private to avoid an accessor method. */
- transient JSlider R;
-
- /** The slider that handles the green values.
- * This is package-private to avoid an accessor method. */
- transient JSlider G;
-
- /** The slider that handles the blue values.
- * This is package-private to avoid an accessor method. */
- transient JSlider B;
-
- /** The label for the red slider. */
- private transient JLabel RLabel;
-
- /** The label for the green slider. */
- private transient JLabel GLabel;
-
- /** The label for the blue slider. */
- private transient JLabel BLabel;
-
- /** The spinner that handles the red values.
- * This is package-private to avoid an accessor method. */
- transient JSpinner RSpinner;
-
- /** The spinner that handles the green values.
- * This is package-private to avoid an accessor method. */
- transient JSpinner GSpinner;
-
- /** The spinner that handles the blue values.
- * This is package-private to avoid an accessor method. */
- transient JSpinner BSpinner;
-
- /**
- * Creates a new DefaultRGBChooserPanel object.
- */
- public DefaultRGBChooserPanel()
- {
- super();
- }
-
- /**
- * This method returns the name displayed in the JTabbedPane.
- *
- * @return The name displayed in the JTabbedPane.
- */
- public String getDisplayName()
- {
- return "RGB";
- }
-
- /**
- * This method updates the chooser panel with the new color chosen in the
- * JColorChooser.
- */
- public void updateChooser()
- {
- Color c = getColorFromModel();
- int rgb = c.getRGB();
-
- int red = rgb >> 16 & 0xff;
- int green = rgb >> 8 & 0xff;
- int blue = rgb & 0xff;
-
- updateChange = true;
-
- if (! sliderChange)
- {
- if (R != null)
- R.setValue(red);
- if (G != null)
- G.setValue(green);
- if (B != null)
- B.setValue(blue);
- }
- if (! spinnerChange)
- {
- if (GSpinner != null)
- GSpinner.setValue(new Integer(green));
- if (RSpinner != null)
- RSpinner.setValue(new Integer(red));
- if (BSpinner != null)
- BSpinner.setValue(new Integer(blue));
- }
-
- updateChange = false;
-
- revalidate();
- repaint();
- }
-
- /**
- * This method builds the chooser panel.
- */
- protected void buildChooser()
- {
- setLayout(new GridBagLayout());
-
- RLabel = new JLabel("Red");
- RLabel.setDisplayedMnemonic('d');
- GLabel = new JLabel("Green");
- GLabel.setDisplayedMnemonic('n');
- BLabel = new JLabel("Blue");
- BLabel.setDisplayedMnemonic('B');
-
- R = new JSlider(SwingConstants.HORIZONTAL, 0, 255, 255);
- G = new JSlider(SwingConstants.HORIZONTAL, 0, 255, 255);
- B = new JSlider(SwingConstants.HORIZONTAL, 0, 255, 255);
-
- R.setPaintTicks(true);
- R.setSnapToTicks(false);
- G.setPaintTicks(true);
- G.setSnapToTicks(false);
- B.setPaintTicks(true);
- B.setSnapToTicks(false);
-
- R.setLabelTable(R.createStandardLabels(85));
- R.setPaintLabels(true);
- G.setLabelTable(G.createStandardLabels(85));
- G.setPaintLabels(true);
- B.setLabelTable(B.createStandardLabels(85));
- B.setPaintLabels(true);
-
- R.setMajorTickSpacing(85);
- G.setMajorTickSpacing(85);
- B.setMajorTickSpacing(85);
-
- R.setMinorTickSpacing(17);
- G.setMinorTickSpacing(17);
- B.setMinorTickSpacing(17);
-
- RSpinner = new JSpinner(new SpinnerNumberModel(R.getValue(),
- R.getMinimum(),
- R.getMaximum(), 1));
- GSpinner = new JSpinner(new SpinnerNumberModel(G.getValue(),
- G.getMinimum(),
- G.getMaximum(), 1));
- BSpinner = new JSpinner(new SpinnerNumberModel(B.getValue(),
- B.getMinimum(),
- B.getMaximum(), 1));
-
- RLabel.setLabelFor(R);
- GLabel.setLabelFor(G);
- BLabel.setLabelFor(B);
-
- GridBagConstraints bag = new GridBagConstraints();
- bag.fill = GridBagConstraints.VERTICAL;
-
- bag.gridx = 0;
- bag.gridy = 0;
- add(RLabel, bag);
-
- bag.gridx = 1;
- add(R, bag);
-
- bag.gridx = 2;
- add(RSpinner, bag);
-
- bag.gridx = 0;
- bag.gridy = 1;
- add(GLabel, bag);
-
- bag.gridx = 1;
- add(G, bag);
-
- bag.gridx = 2;
- add(GSpinner, bag);
-
- bag.gridx = 0;
- bag.gridy = 2;
- add(BLabel, bag);
-
- bag.gridx = 1;
- add(B, bag);
-
- bag.gridx = 2;
- add(BSpinner, bag);
-
- installListeners();
- }
-
- /**
- * This method uninstalls the chooser panel from the JColorChooser.
- *
- * @param chooser The JColorChooser to remove this chooser panel from.
- */
- public void uninstallChooserPanel(JColorChooser chooser)
- {
- uninstallListeners();
- removeAll();
-
- R = null;
- G = null;
- B = null;
-
- RSpinner = null;
- GSpinner = null;
- BSpinner = null;
-
- super.uninstallChooserPanel(chooser);
- }
-
- /**
- * This method uninstalls any listeners that were added by the chooser
- * panel.
- */
- private void uninstallListeners()
- {
- R.removeChangeListener(colorChanger);
- G.removeChangeListener(colorChanger);
- B.removeChangeListener(colorChanger);
-
- colorChanger = null;
-
- RSpinner.removeChangeListener(spinnerHandler);
- GSpinner.removeChangeListener(spinnerHandler);
- BSpinner.removeChangeListener(spinnerHandler);
-
- spinnerHandler = null;
- }
-
- /**
- * This method installs any listeners that the chooser panel needs to
- * operate.
- */
- private void installListeners()
- {
- colorChanger = new SliderHandler();
-
- R.addChangeListener(colorChanger);
- G.addChangeListener(colorChanger);
- B.addChangeListener(colorChanger);
-
- spinnerHandler = new SpinnerHandler();
-
- RSpinner.addChangeListener(spinnerHandler);
- GSpinner.addChangeListener(spinnerHandler);
- BSpinner.addChangeListener(spinnerHandler);
- }
-
- /**
- * This method returns the small display icon.
- *
- * @return The small display icon.
- */
- public Icon getSmallDisplayIcon()
- {
- return null;
- }
-
- /**
- * This method returns the large display icon.
- *
- * @return The large display icon.
- */
- public Icon getLargeDisplayIcon()
- {
- return null;
- }
-
- /**
- * This method paints the default RGB chooser panel.
- *
- * @param g The Graphics object to paint with.
- */
- public void paint(Graphics g)
- {
- super.paint(g);
- }
-}
diff --git a/libjava/javax/swing/colorchooser/DefaultSwatchChooserPanel.java b/libjava/javax/swing/colorchooser/DefaultSwatchChooserPanel.java
deleted file mode 100644
index f28af4cac7c..00000000000
--- a/libjava/javax/swing/colorchooser/DefaultSwatchChooserPanel.java
+++ /dev/null
@@ -1,893 +0,0 @@
-/* DefaultSwatchChooserPanel.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.colorchooser;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-import javax.swing.Icon;
-import javax.swing.JColorChooser;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-/**
- * This class is the DefaultSwatchChooserPanel. This chooser panel displays a
- * set of colors that can be picked. Recently picked items will go into a
- * side panel so the user can see the history of the chosen colors.
- */
-class DefaultSwatchChooserPanel extends AbstractColorChooserPanel
-{
- /** The main panel that holds the set of choosable colors. */
- MainSwatchPanel mainPalette;
-
- /** A panel that holds the recent colors. */
- RecentSwatchPanel recentPalette;
-
- /** The mouse handlers for the panels. */
- MouseListener mouseHandler;
-
- /**
- * This the base class for all swatch panels. Swatch panels are panels that
- * hold a set of blocks where colors are displayed.
- */
- abstract static class SwatchPanel extends JPanel
- {
- /** The width of each block. */
- protected int cellWidth = 10;
-
- /** The height of each block. */
- protected int cellHeight = 10;
-
- /** The gap between blocks. */
- protected int gap = 1;
-
- /** The number of rows in the swatch panel. */
- protected int numRows;
-
- /** The number of columns in the swatch panel. */
- protected int numCols;
-
- /**
- * Creates a new SwatchPanel object.
- */
- SwatchPanel()
- {
- super();
- setBackground(Color.WHITE);
- }
-
- /**
- * This method returns the preferred size of the swatch panel based on the
- * number of rows and columns and the size of each cell.
- *
- * @return The preferred size of the swatch panel.
- */
- public Dimension getPreferredSize()
- {
- int height = numRows * cellHeight + (numRows - 1) * gap;
- int width = numCols * cellWidth + (numCols - 1) * gap;
- Insets insets = getInsets();
-
- return new Dimension(width + insets.left + insets.right,
- height + insets.top + insets.bottom);
- }
-
- /**
- * This method returns the color for the given position.
- *
- * @param x The x coordinate of the position.
- * @param y The y coordinate of the position.
- *
- * @return The color at the given position.
- */
- public abstract Color getColorForPosition(int x, int y);
-
- /**
- * This method initializes the colors for the swatch panel.
- */
- protected abstract void initializeColors();
- }
-
- /**
- * This is the main swatch panel. This panel sits in the middle and allows a
- * set of colors to be picked which will move to the recent swatch panel.
- */
- static class MainSwatchPanel extends SwatchPanel
- {
- /** The color describing (204, 255, 255) */
- public static final Color C204255255 = new Color(204, 204, 255);
-
- /** The color describing (255, 204, 204) */
- public static final Color C255204204 = new Color(255, 204, 204);
-
- /** The color describing (204, 255, 204) */
- public static final Color C204255204 = new Color(204, 255, 204);
-
- /** The color describing (204, 204, 204) */
- public static final Color C204204204 = new Color(204, 204, 204);
-
- /** The color (153, 153, 255). */
- public static final Color C153153255 = new Color(153, 153, 255);
-
- /** The color (51, 51, 255). */
- public static final Color C051051255 = new Color(51, 51, 255);
-
- /** The color (153, 0, 153). */
- public static final Color C153000153 = new Color(153, 0, 153);
-
- /** The color (0, 51, 51). */
- public static final Color C000051051 = new Color(0, 51, 51);
-
- /** The color (51, 0, 51). */
- public static final Color C051000051 = new Color(51, 0, 51);
-
- /** The color (51, 51, 0). */
- public static final Color C051051000 = new Color(51, 51, 0);
-
- /** The color (102, 102, 0). */
- public static final Color C102102000 = new Color(102, 102, 0);
-
- /** The color (153, 255, 153). */
- public static final Color C153255153 = new Color(153, 255, 153);
-
- /** The color (102, 255, 102). */
- public static final Color C102255102 = new Color(102, 255, 102);
-
- /** The color (0, 102, 102). */
- public static final Color C000102102 = new Color(0, 102, 102);
-
- /** The color (102, 0, 102). */
- public static final Color C102000102 = new Color(102, 0, 102);
-
- /** The color (0, 153, 153). */
- public static final Color C000153153 = new Color(0, 153, 153);
-
- /** The color (153, 153, 0). */
- public static final Color C153153000 = new Color(153, 153, 0);
-
- /** The color (204, 204, 0). */
- public static final Color C204204000 = new Color(204, 204, 0);
-
- /** The color (204, 0, 204). */
- public static final Color C204000204 = new Color(204, 0, 204);
-
- /** The color (0, 204, 204). */
- public static final Color C000204204 = new Color(0, 204, 204);
-
- /** The color (51, 255, 51). */
- public static final Color C051255051 = new Color(51, 255, 51);
-
- /** The color (255, 51, 51). */
- public static final Color C255051051 = new Color(255, 51, 51);
-
- /** The color (255, 102, 102). */
- public static final Color C255102102 = new Color(255, 102, 102);
-
- /** The color (102, 102, 255). */
- public static final Color C102102255 = new Color(102, 102, 255);
-
- /** The color (255, 153, 153). */
- public static final Color C255153153 = new Color(255, 153, 153);
- static Color[] colors =
- {
- // Row 1
- Color.WHITE, new Color(204, 255, 255), C204255255, C204255255, C204255255,
- C204255255, C204255255, C204255255, C204255255,
- C204255255, C204255255, new Color(255, 204, 255),
- C255204204, C255204204, C255204204, C255204204,
- C255204204, C255204204, C255204204, C255204204,
- C255204204, new Color(255, 255, 204), C204255204,
- C204255204, C204255204, C204255204, C204255204,
- C204255204, C204255204, C204255204, C204255204,
-
- // Row 2
- C204204204, new Color(153, 255, 255), new Color(153, 204, 255), C153153255,
- C153153255, C153153255, C153153255, C153153255,
- C153153255, C153153255, new Color(204, 153, 255),
- new Color(255, 153, 255),
- new Color(255, 153, 204), C255153153, C255153153,
- C255153153, C255153153, C255153153, C255153153,
- C255153153, new Color(255, 204, 153),
- new Color(255, 255, 153),
- new Color(204, 255, 153), C153255153, C153255153,
- C153255153, C153255153, C153255153, C153255153,
- C153255153, new Color(153, 255, 204),
-
- // Row 3
- C204204204, new Color(102, 255, 255), new Color(102, 204, 255),
- new Color(102, 153, 255), C102102255, C102102255,
- C102102255, C102102255, C102102255,
- new Color(153, 102, 255),
- new Color(204, 102, 255),
- new Color(255, 102, 255),
- new Color(255, 102, 204),
- new Color(255, 102, 153), C255102102, C255102102,
- C255102102, C255102102, C255102102,
- new Color(255, 153, 102),
- new Color(255, 204, 102),
- new Color(255, 255, 102),
- new Color(204, 255, 102),
- new Color(153, 255, 102), C102255102, C102255102,
- C102255102, C102255102, C102255102,
- new Color(102, 255, 153),
- new Color(102, 255, 204),
-
- // Row 4
- new Color(153, 153, 153), new Color(51, 255, 255), new Color(51, 204, 255),
- new Color(51, 153, 255), new Color(51, 102, 255),
- C051051255, C051051255, C051051255,
- new Color(102, 51, 255), new Color(153, 51, 255),
- new Color(204, 51, 255), new Color(255, 51, 255),
- new Color(255, 51, 204), new Color(255, 51, 153),
- new Color(255, 51, 102), C255051051, C255051051,
- C255051051, new Color(255, 102, 51),
- new Color(255, 153, 51), new Color(255, 204, 51),
- new Color(255, 255, 51), new Color(204, 255, 51),
- new Color(153, 255, 51), new Color(102, 255, 51),
- C051255051, C051255051, C051255051,
- new Color(51, 255, 102), new Color(51, 255, 153),
- new Color(51, 255, 204),
-
- // Row 5
- new Color(153, 153, 153), new Color(0, 255, 255), new Color(0, 204, 255),
- new Color(0, 153, 255), new Color(0, 102, 255),
- new Color(0, 51, 255), new Color(0, 0, 255),
- new Color(51, 0, 255), new Color(102, 0, 255),
- new Color(153, 0, 255), new Color(204, 0, 255),
- new Color(255, 0, 255), new Color(255, 0, 204),
- new Color(255, 0, 153), new Color(255, 0, 102),
- new Color(255, 0, 51), new Color(255, 0, 0),
- new Color(255, 51, 0), new Color(255, 102, 0),
- new Color(255, 153, 0), new Color(255, 204, 0),
- new Color(255, 255, 0), new Color(204, 255, 0),
- new Color(153, 255, 0), new Color(102, 255, 0),
- new Color(51, 255, 0), new Color(0, 255, 0),
- new Color(0, 255, 51), new Color(0, 255, 102),
- new Color(0, 255, 153), new Color(0, 255, 204),
-
- // Row 6
- new Color(102, 102, 102), C000204204, C000204204, new Color(0, 153, 204),
- new Color(0, 102, 204), new Color(0, 51, 204),
- new Color(0, 0, 204), new Color(51, 0, 204),
- new Color(102, 0, 204), new Color(153, 0, 204),
- C204000204, C204000204, C204000204,
- new Color(204, 0, 153), new Color(204, 0, 102),
- new Color(204, 0, 51), new Color(204, 0, 0),
- new Color(204, 51, 0), new Color(204, 102, 0),
- new Color(204, 153, 0), C204204000, C204204000,
- C204204000, new Color(153, 204, 0),
- new Color(102, 204, 0), new Color(51, 204, 0),
- new Color(0, 204, 0), new Color(0, 204, 51),
- new Color(0, 204, 102), new Color(0, 204, 153),
- new Color(0, 204, 204),
-
- // Row 7
- new Color(102, 102, 102), C000153153, C000153153, C000153153,
- new Color(0, 102, 153), new Color(0, 51, 153),
- new Color(0, 0, 153), new Color(51, 0, 153),
- new Color(102, 0, 153), C153000153, C153000153,
- C153000153, C153000153, C153000153,
- new Color(153, 0, 102), new Color(153, 0, 51),
- new Color(153, 0, 0), new Color(153, 51, 0),
- new Color(153, 102, 0), C153153000, C153153000,
- C153153000, C153153000, C153153000,
- new Color(102, 153, 0), new Color(51, 153, 0),
- new Color(0, 153, 0), new Color(0, 153, 51),
- new Color(0, 153, 102), C000153153, C000153153,
-
- // Row 8
- new Color(51, 51, 51), C000102102, C000102102, C000102102, C000102102,
- new Color(0, 51, 102), new Color(0, 0, 102),
- new Color(51, 0, 102), C102000102, C102000102,
- C102000102, C102000102, C102000102, C102000102,
- C102000102, new Color(102, 0, 51),
- new Color(102, 0, 0), new Color(102, 51, 0),
- C102102000, C102102000, C102102000, C102102000,
- C102102000, C102102000, C102102000,
- new Color(51, 102, 0), new Color(0, 102, 0),
- new Color(0, 102, 51), C000102102, C000102102,
- C000102102,
-
- // Row 9.
- Color.BLACK, C000051051, C000051051, C000051051, C000051051, C000051051,
- new Color(0, 0, 51), C051000051, C051000051,
- C051000051, C051000051, C051000051, C051000051,
- C051000051, C051000051, C051000051,
- new Color(51, 0, 0), C051051000, C051051000,
- C051051000, C051051000, C051051000, C051051000,
- C051051000, C051051000, new Color(0, 51, 0),
- C000051051, C000051051, C000051051, C000051051,
- new Color(51, 51, 51)
- };
-
- /**
- * Creates a new MainSwatchPanel object.
- */
- MainSwatchPanel()
- {
- super();
- numCols = 31;
- numRows = 9;
- initializeColors();
- revalidate();
- }
-
- /**
- * This method returns the color for the given position.
- *
- * @param x The x location for the position.
- * @param y The y location for the position.
- *
- * @return The color for the given position.
- */
- public Color getColorForPosition(int x, int y)
- {
- if (x % (cellWidth + gap) > cellWidth
- || y % (cellHeight + gap) > cellHeight)
- // position is located in gap.
- return null;
-
- int row = y / (cellHeight + gap);
- int col = x / (cellWidth + gap);
- return colors[row * numCols + col];
- }
-
- /**
- * This method initializes the colors for the main swatch panel.
- */
- protected void initializeColors()
- {
- // Unnecessary
- }
-
- /**
- * This method paints the main graphics panel with the given Graphics
- * object.
- *
- * @param graphics The Graphics object to paint with.
- */
- public void paint(Graphics graphics)
- {
- int index = 0;
- Insets insets = getInsets();
- int currX = insets.left;
- int currY = insets.top;
- Color saved = graphics.getColor();
-
- for (int i = 0; i < numRows; i++)
- {
- for (int j = 0; j < numCols; j++)
- {
- graphics.setColor(colors[index++]);
- graphics.fill3DRect(currX, currY, cellWidth, cellHeight, true);
- currX += gap + cellWidth;
- }
- currX = insets.left;
- currY += gap + cellHeight;
- }
- graphics.setColor(saved);
- }
-
- /**
- * This method returns the tooltip text for the given MouseEvent.
- *
- * @param e The MouseEvent to find tooltip text for.
- *
- * @return The tooltip text.
- */
- public String getToolTipText(MouseEvent e)
- {
- Color c = getColorForPosition(e.getX(), e.getY());
- if (c == null)
- return null;
- return (c.getRed() + "," + c.getGreen() + "," + c.getBlue());
- }
- }
-
- /**
- * This class is the recent swatch panel. It holds recently selected colors.
- */
- static class RecentSwatchPanel extends SwatchPanel
- {
- /** The array for storing recently stored colors. */
- Color[] colors;
-
- /** The default color. */
- public static final Color defaultColor = Color.GRAY;
-
- /** The index of the array that is the start. */
- int start = 0;
-
- /**
- * Creates a new RecentSwatchPanel object.
- */
- RecentSwatchPanel()
- {
- super();
- numCols = 5;
- numRows = 7;
- initializeColors();
- revalidate();
- }
-
- /**
- * This method returns the color for the given position.
- *
- * @param x The x coordinate of the position.
- * @param y The y coordinate of the position.
- *
- * @return The color for the given position.
- */
- public Color getColorForPosition(int x, int y)
- {
- if (x % (cellWidth + gap) > cellWidth
- || y % (cellHeight + gap) > cellHeight)
- // position is located in gap.
- return null;
-
- int row = y / (cellHeight + gap);
- int col = x / (cellWidth + gap);
-
- return colors[getIndexForCell(row, col)];
- }
-
- /**
- * This method initializes the colors for the recent swatch panel.
- */
- protected void initializeColors()
- {
- colors = new Color[numRows * numCols];
- for (int i = 0; i < colors.length; i++)
- colors[i] = defaultColor;
- }
-
- /**
- * This method returns the array index for the given row and column.
- *
- * @param row The row.
- * @param col The column.
- *
- * @return The array index for the given row and column.
- */
- private int getIndexForCell(int row, int col)
- {
- return ((row * numCols) + col + start) % (numRows * numCols);
- }
-
- /**
- * This method adds the given color to the beginning of the swatch panel.
- * Package-private to avoid an accessor method.
- *
- * @param c The color to add.
- */
- void addColorToQueue(Color c)
- {
- if (--start == -1)
- start = numRows * numCols - 1;
-
- colors[start] = c;
- }
-
- /**
- * This method paints the panel with the given Graphics object.
- *
- * @param g The Graphics object to paint with.
- */
- public void paint(Graphics g)
- {
- Color saved = g.getColor();
- Insets insets = getInsets();
- int currX = insets.left;
- int currY = insets.top;
-
- for (int i = 0; i < numRows; i++)
- {
- for (int j = 0; j < numCols; j++)
- {
- g.setColor(colors[getIndexForCell(i, j)]);
- g.fill3DRect(currX, currY, cellWidth, cellHeight, true);
- currX += cellWidth + gap;
- }
- currX = insets.left;
- currY += cellWidth + gap;
- }
- }
-
- /**
- * This method returns the tooltip text for the given MouseEvent.
- *
- * @param e The MouseEvent.
- *
- * @return The tooltip text.
- */
- public String getToolTipText(MouseEvent e)
- {
- Color c = getColorForPosition(e.getX(), e.getY());
- if (c == null)
- return null;
- return c.getRed() + "," + c.getGreen() + "," + c.getBlue();
- }
- }
-
- /**
- * This class handles mouse events for the two swatch panels.
- */
- class MouseHandler extends MouseAdapter
- {
- /**
- * This method is called whenever the mouse is pressed.
- *
- * @param e The MouseEvent.
- */
- public void mousePressed(MouseEvent e)
- {
- SwatchPanel panel = (SwatchPanel) e.getSource();
- Color c = panel.getColorForPosition(e.getX(), e.getY());
- recentPalette.addColorToQueue(c);
- DefaultSwatchChooserPanel.this.getColorSelectionModel().setSelectedColor(c);
- DefaultSwatchChooserPanel.this.repaint();
- }
- }
-
- /**
- * This is the layout manager for the main panel.
- */
- static class MainPanelLayout implements LayoutManager
- {
- /**
- * This method is called when a new component is added to the container.
- *
- * @param name The name of the component.
- * @param comp The added component.
- */
- public void addLayoutComponent(String name, Component comp)
- {
- }
-
- /**
- * This method is called to set the size and position of the child
- * components for the given container.
- *
- * @param parent The container to lay out.
- */
- public void layoutContainer(Container parent)
- {
- Component[] comps = parent.getComponents();
- Insets insets = parent.getInsets();
- Dimension[] pref = new Dimension[comps.length];
-
- int xpos = 0;
- int ypos = 0;
- int maxHeight = 0;
- int totalWidth = 0;
-
- for (int i = 0; i < comps.length; i++)
- {
- pref[i] = comps[i].getPreferredSize();
- if (pref[i] == null)
- return;
- maxHeight = Math.max(maxHeight, pref[i].height);
- totalWidth += pref[i].width;
- }
-
- ypos = (parent.getSize().height - maxHeight) / 2 + insets.top;
- xpos = insets.left + (parent.getSize().width - totalWidth) / 2;
-
- for (int i = 0; i < comps.length; i++)
- {
- if (pref[i] == null)
- continue;
- comps[i].setBounds(xpos, ypos, pref[i].width, pref[i].height);
- xpos += pref[i].width;
- }
- }
-
- /**
- * This method is called when a component is removed from the container.
- *
- * @param comp The component that was removed.
- */
- public void removeLayoutComponent(Component comp)
- {
- }
-
- /**
- * This methods calculates the minimum layout size for the container.
- *
- * @param parent The container.
- *
- * @return The minimum layout size.
- */
- public Dimension minimumLayoutSize(Container parent)
- {
- return preferredLayoutSize(parent);
- }
-
- /**
- * This method returns the preferred layout size for the given container.
- *
- * @param parent The container.
- *
- * @return The preferred layout size.
- */
- public Dimension preferredLayoutSize(Container parent)
- {
- int xmax = 0;
- int ymax = 0;
-
- Component[] comps = parent.getComponents();
- Dimension pref;
-
- for (int i = 0; i < comps.length; i++)
- {
- pref = comps[i].getPreferredSize();
- if (pref == null)
- continue;
- xmax += pref.width;
- ymax = Math.max(ymax, pref.height);
- }
-
- Insets insets = parent.getInsets();
-
- return new Dimension(insets.left + insets.right + xmax,
- insets.top + insets.bottom + ymax);
- }
- }
-
- /**
- * This is the layout manager for the recent swatch panel.
- */
- static class RecentPanelLayout implements LayoutManager
- {
- /**
- * This method is called when a component is added to the container.
- *
- * @param name The name of the component.
- * @param comp The added component.
- */
- public void addLayoutComponent(String name, Component comp)
- {
- // Nothing needs to be done.
- }
-
- /**
- * This method sets the size and position of the child components of the
- * given container.
- *
- * @param parent The container to lay out.
- */
- public void layoutContainer(Container parent)
- {
- Component[] comps = parent.getComponents();
- Dimension parentSize = parent.getSize();
- Insets insets = parent.getInsets();
- int currY = insets.top;
- Dimension pref;
-
- for (int i = 0; i < comps.length; i++)
- {
- pref = comps[i].getPreferredSize();
- if (pref == null)
- continue;
- comps[i].setBounds(insets.left, currY, pref.width, pref.height);
- currY += pref.height;
- }
- }
-
- /**
- * This method calculates the minimum layout size for the given container.
- *
- * @param parent The container.
- *
- * @return The minimum layout size.
- */
- public Dimension minimumLayoutSize(Container parent)
- {
- return preferredLayoutSize(parent);
- }
-
- /**
- * This method calculates the preferred layout size for the given
- * container.
- *
- * @param parent The container.
- *
- * @return The preferred layout size.
- */
- public Dimension preferredLayoutSize(Container parent)
- {
- int width = 0;
- int height = 0;
- Insets insets = parent.getInsets();
- Component[] comps = parent.getComponents();
- Dimension pref;
- for (int i = 0; i < comps.length; i++)
- {
- pref = comps[i].getPreferredSize();
- if (pref != null)
- {
- width = Math.max(width, pref.width);
- height += pref.height;
- }
- }
-
- return new Dimension(width + insets.left + insets.right,
- height + insets.top + insets.bottom);
- }
-
- /**
- * This method is called whenever a component is removed from the
- * container.
- *
- * @param comp The removed component.
- */
- public void removeLayoutComponent(Component comp)
- {
- // Nothing needs to be done.
- }
- }
-
- /**
- * Creates a new DefaultSwatchChooserPanel object.
- */
- DefaultSwatchChooserPanel()
- {
- super();
- }
-
- /**
- * This method updates the chooser panel with the new value from the
- * JColorChooser.
- */
- public void updateChooser()
- {
- }
-
- /**
- * This method builds the chooser panel.
- */
- protected void buildChooser()
- {
- // The structure of the swatch panel is:
- // One large panel (minus the insets).
- // Inside that panel, there are two panels, one holds the palette.
- // The other holds the label and the recent colors palette.
- // The two palettes are two custom swatch panels.
- setLayout(new MainPanelLayout());
-
- JPanel mainPaletteHolder = new JPanel();
- JPanel recentPaletteHolder = new JPanel();
-
- mainPalette = new MainSwatchPanel();
- recentPalette = new RecentSwatchPanel();
- JLabel label = new JLabel("Recent:");
-
- mouseHandler = new MouseHandler();
- mainPalette.addMouseListener(mouseHandler);
- recentPalette.addMouseListener(mouseHandler);
-
- mainPaletteHolder.setLayout(new BorderLayout());
- mainPaletteHolder.add(mainPalette, BorderLayout.CENTER);
-
- recentPaletteHolder.setLayout(new RecentPanelLayout());
- recentPaletteHolder.add(label);
- recentPaletteHolder.add(recentPalette);
-
- JPanel main = new JPanel();
- main.add(mainPaletteHolder);
- main.add(recentPaletteHolder);
-
- this.add(main);
- }
-
- /**
- * This method removes the chooser panel from the JColorChooser.
- *
- * @param chooser The JColorChooser this panel is being removed from.
- */
- public void uninstallChooserPanel(JColorChooser chooser)
- {
- recentPalette = null;
- mainPalette = null;
-
- removeAll();
- super.uninstallChooserPanel(chooser);
- }
-
- /**
- * This method returns the JTabbedPane displayed name.
- *
- * @return The name displayed in the JTabbedPane.
- */
- public String getDisplayName()
- {
- return "Swatches";
- }
-
- /**
- * This method returns the small display icon.
- *
- * @return The small display icon.
- */
- public Icon getSmallDisplayIcon()
- {
- return null;
- }
-
- /**
- * This method returns the large display icon.
- *
- * @return The large display icon.
- */
- public Icon getLargeDisplayIcon()
- {
- return null;
- }
-
- /**
- * This method paints the chooser panel with the given Graphics object.
- *
- * @param g The Graphics object to paint with.
- */
- public void paint(Graphics g)
- {
- super.paint(g);
- }
-
- /**
- * This method returns the tooltip text for the given MouseEvent.
- *
- * @param e The MouseEvent.
- *
- * @return The tooltip text.
- */
- public String getToolTipText(MouseEvent e)
- {
- return null;
- }
-}
diff --git a/libjava/javax/swing/event/AncestorEvent.java b/libjava/javax/swing/event/AncestorEvent.java
deleted file mode 100644
index d06c6e39612..00000000000
--- a/libjava/javax/swing/event/AncestorEvent.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* AncestorEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.awt.AWTEvent;
-import java.awt.Container;
-
-import javax.swing.JComponent;
-
-/**
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public class AncestorEvent extends AWTEvent
-{
- private static final long serialVersionUID = -8079801679695605002L;
-
- public static final int ANCESTOR_ADDED = 1;
- public static final int ANCESTOR_REMOVED = 2;
- public static final int ANCESTOR_MOVED = 3;
-
- private JComponent sourceComponent;
- private Container ancestor;
- private Container ancestorParent;
-
- /**
- * @param source Source component
- * @param id ID
- * @param ancestor ancestor
- * @param ancestorParent parent ancestor
- */
- public AncestorEvent(JComponent source, int id, Container ancestor,
- Container ancestorParent)
- {
- super(source, id);
- this.sourceComponent = source;
- this.ancestor = ancestor;
- this.ancestorParent = ancestorParent;
- }
-
- /**
- * Returns the ancestor of this event.
- */
- public Container getAncestor()
- {
- return ancestor;
- }
-
- /**
- * Returns the ancester parent of this event.
- */
- public Container getAncestorParent()
- {
- return ancestorParent;
- }
-
- /**
- * Returns the source of this event.
- */
- public JComponent getComponent()
- {
- return sourceComponent;
- }
-}
diff --git a/libjava/javax/swing/event/AncestorListener.java b/libjava/javax/swing/event/AncestorListener.java
deleted file mode 100644
index 61d5aedb7c9..00000000000
--- a/libjava/javax/swing/event/AncestorListener.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* AncestorListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * AncestorListener Interface
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public interface AncestorListener extends EventListener {
-
- /**
- * Ancestor Added
- * @param event Ancestor Event
- */
- void ancestorAdded(AncestorEvent event);
-
- /**
- * Ancestor Removed
- * @param event Ancestor Event
- */
- void ancestorRemoved(AncestorEvent event);
-
- /**
- * Ancestor Moved
- * @param event Ancestor Event
- */
- void ancestorMoved(AncestorEvent event);
-
-
-} // AncestorListener
diff --git a/libjava/javax/swing/event/CaretEvent.java b/libjava/javax/swing/event/CaretEvent.java
deleted file mode 100644
index c4870a8008f..00000000000
--- a/libjava/javax/swing/event/CaretEvent.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* CaretEvent.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventObject;
-
-/**
- * CaretEvent
- * @author Andrew Selkirk
- */
-public abstract class CaretEvent extends EventObject {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * CaretEvent constructor
- * @param source Source object
- */
- public CaretEvent(Object source) {
- super(source);
- } // CaretEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Get caret location
- * @returns the dot
- */
- public abstract int getDot();
-
- /**
- * Get mark
- * @returns the mark
- */
- public abstract int getMark();
-
-
-} // CaretEvent
diff --git a/libjava/javax/swing/event/CaretListener.java b/libjava/javax/swing/event/CaretListener.java
deleted file mode 100644
index aeee434e50b..00000000000
--- a/libjava/javax/swing/event/CaretListener.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* CaretListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * CaretListener public interface
- * @author Andrew Selkirk
- */
-public interface CaretListener extends EventListener {
-
- /**
- * Caret position has been updated
- * @param event Caret Event
- */
- void caretUpdate(CaretEvent event);
-
-
-} // CaretListener
diff --git a/libjava/javax/swing/event/CellEditorListener.java b/libjava/javax/swing/event/CellEditorListener.java
deleted file mode 100644
index d2dd5bab8ec..00000000000
--- a/libjava/javax/swing/event/CellEditorListener.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* CellEditorListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * CellEditorListener public interface
- * @author Andrew Selkirk
- */
-public interface CellEditorListener extends EventListener {
-
- /**
- * Editing has been canceled
- * @param event Change Event
- */
- void editingCanceled(ChangeEvent event);
-
- /**
- * Editing has been stopped
- * @param event Change Event
- */
- void editingStopped(ChangeEvent event);
-
-
-} // CellEditorListener
diff --git a/libjava/javax/swing/event/ChangeEvent.java b/libjava/javax/swing/event/ChangeEvent.java
deleted file mode 100644
index f75c15aac83..00000000000
--- a/libjava/javax/swing/event/ChangeEvent.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ChangeEvent.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventObject;
-
-/**
- * ChangeEvent
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public class ChangeEvent extends EventObject {
-
- /**
- * ChangeEvent constructor
- * @param source Source object
- */
- public ChangeEvent(Object source) {
- super(source);
- } // ChangeEvent()
-
-
-} // ChangeEvent
diff --git a/libjava/javax/swing/event/ChangeListener.java b/libjava/javax/swing/event/ChangeListener.java
deleted file mode 100644
index 1e58b1d82d9..00000000000
--- a/libjava/javax/swing/event/ChangeListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ChangeListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * ChangeListener interface
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public interface ChangeListener extends EventListener {
-
- /**
- * State changed
- * @param event Change Event
- */
- void stateChanged(ChangeEvent event);
-
-
-} // ChangeListener
diff --git a/libjava/javax/swing/event/DocumentEvent.java b/libjava/javax/swing/event/DocumentEvent.java
deleted file mode 100644
index 6a005ea7a5b..00000000000
--- a/libjava/javax/swing/event/DocumentEvent.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/* DocumentEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import javax.swing.text.Document;
-import javax.swing.text.Element;
-
-/**
- * DocumentEvent public interface
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public interface DocumentEvent {
-
- //-------------------------------------------------------------
- // Classes ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * ElementChange public interface
- */
- public interface ElementChange {
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getIndex
- * @returns int
- */
- int getIndex();
-
- /**
- * getElement
- * @returns Element
- */
- Element getElement();
-
- /**
- * getChildrenRemoved
- * @returns Element[]
- */
- Element[] getChildrenRemoved();
-
- /**
- * getChildrenAdded
- * @returns Element[]
- */
- Element[] getChildrenAdded();
-
-
- } // ElementChange
-
- /**
- * EventType
- */
- class EventType
- {
- /**
- * INSERT
- */
- public static final EventType INSERT = new EventType("INSERT"); // TODO
-
- /**
- * REMOVE
- */
- public static final EventType REMOVE = new EventType("REMOVE"); // TODO
-
- /**
- * CHANGE
- */
- public static final EventType CHANGE = new EventType("CHANGE"); // TODO
-
- /**
- * typeString
- */
- private String type;
-
- /**
- * Constructor EventType
- * @param type TODO
- */
- private EventType(String type)
- {
- this.type = type;
- }
-
- /**
- * toString
- * @returns String
- */
- public String toString()
- {
- return type;
- }
- }
-
- /**
- * getType
- * @returns EventType
- */
- EventType getType();
-
- /**
- * getOffset
- * @returns int
- */
- int getOffset();
-
- /**
- * getLength
- * @returns int
- */
- int getLength();
-
- /**
- * getDocument
- * @returns Document
- */
- Document getDocument();
-
- /**
- * getChange
- * @param element TODO
- * @returns ElementChange
- */
- ElementChange getChange(Element element);
-
-
-} // DocumentEvent
diff --git a/libjava/javax/swing/event/DocumentListener.java b/libjava/javax/swing/event/DocumentListener.java
deleted file mode 100644
index df5e784e40f..00000000000
--- a/libjava/javax/swing/event/DocumentListener.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* DocumentListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventListener;
-
-/**
- * DocumentListener public interface
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public interface DocumentListener extends EventListener {
-
- /**
- * Changed update
- * @param event Document Event
- */
- void changedUpdate(DocumentEvent event);
-
- /**
- * Insert update
- * @param event Document Event
- */
- void insertUpdate(DocumentEvent event);
-
- /**
- * Remove update
- * @param event Document Event
- */
- void removeUpdate(DocumentEvent event);
-
-
-} // DocumentListener
diff --git a/libjava/javax/swing/event/EventListenerList.java b/libjava/javax/swing/event/EventListenerList.java
deleted file mode 100644
index ea14d4d1474..00000000000
--- a/libjava/javax/swing/event/EventListenerList.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/* EventListenerList.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.util.EventListener;
-
-
-/**
- * A utility class for keeping track of {@link EventListener}s.
- *
- * <p><b>Example for using this class:</b>
- *
- * <blockquote><pre> import java.util.EventListener;
- * import javax.swing.event.EventListenerList;
- *
- * class Foo
- * {
- * protected final EventListenerList listeners = new EventListenerList();
- * protected BarClosedEvent barClosedEvent = null;
- *
- * public void addBarListener(BarListener l)
- * {
- * listeners.<a href="#add(java.lang.Class, java.util.EventListener)"
- * >add</a>(BarListener.class, l);
- * }
- *
- * public void removeBarListener(BarListener l)
- * {
- * listeners.<a href="#remove(java.lang.Class, java.util.EventListener)"
- * >remove</a>(BarListener.class, l);
- * }
- *
- * protected void fireBarClosedEvent()
- * {
- * Object[] l = listeners.<a href="#getListenerList()"
- * >getListenerList()</a>;
- *
- * for (int i = l.length - 2; i >= 0; i -= 2)
- * if (l[i] == BarListener.class)
- * {
- * // Create the event on demand, when it is needed the first time.
- * if (barClosedEvent == null)
- * barClosedEvent = new BarClosedEvent(this);
- *
- * ((BarClosedListener) l[i + 1]).barClosed(barClosedEvent);
- * }
- * }
- * }</pre></blockquote>
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class EventListenerList
- implements Serializable
-{
- /**
- * An ID for serializing instances of this class; verified with the
- * serialver tool of Sun J2SE 1.4.1_01.
- */
- static final long serialVersionUID = -5677132037850737084L;
-
-
- /**
- * An empty array that is shared by all instances of this class that
- * have no listeners.
- */
- private static final Object[] NO_LISTENERS = new Object[0];
-
-
- /**
- * An array with all currently registered listeners. The array has
- * twice as many elements as there are listeners. For an even
- * integer <code>i</code>, <code>listenerList[i]</code> indicates
- * the registered class, and <code>listenerList[i+1]</code> is the
- * listener.
- */
- protected transient Object[] listenerList = NO_LISTENERS;
-
-
- /**
- * EventListenerList constructor
- */
- public EventListenerList()
- {
- }
-
-
- /**
- * Registers a listener of a specific type.
- *
- * @param t the type of the listener.
- *
- * @param listener the listener to add, which must be an instance of
- * <code>t</code>, or of a subclass of <code>t</code>.
- *
- * @throws IllegalArgumentException if <code>listener</code> is not
- * an instance of <code>t</code> (or a subclass thereof).
- *
- * @throws Exception if <code>t</code> is <code>null</code>.
- */
- public void add(Class t, EventListener listener)
- {
- int oldLength;
- Object[] newList;
-
- if (listener == null)
- return;
-
- if (!t.isInstance(listener))
- throw new IllegalArgumentException();
-
- oldLength = listenerList.length;
- newList = new Object[oldLength + 2];
- if (oldLength > 0)
- System.arraycopy(listenerList, 0, newList, 0, oldLength);
-
- newList[oldLength] = t;
- newList[oldLength + 1] = listener;
- listenerList = newList;
- }
-
-
- /**
- * Determines the number of listeners.
- */
- public int getListenerCount()
- {
- return listenerList.length / 2;
- }
-
-
- /**
- * Determines the number of listeners of a particular class.
- *
- * @param t the type of listeners to be counted. In order to get
- * counted, a subscribed listener must be exactly of class
- * <code>t</code>. Thus, subclasses of <code>t</code> will not be
- * counted.
- */
- public int getListenerCount(Class t)
- {
- int result = 0;
- for (int i = 0; i < listenerList.length; i += 2)
- if (t == listenerList[i])
- ++result;
-
- return result;
- }
-
-
- /**
- * Get a list of listenerType/listener pairs
- * @returns Listener list
- */
- public Object[] getListenerList()
- {
- return listenerList;
- }
-
-
- /**
- * Retrieves the currently subscribed listeners of a particular
- * type. For a listener to be returned, it must have been
- * registered with exactly the type <code>c</code>; subclasses are
- * not considered equal.
- *
- * <p>The returned array can always be cast to <code>c[]</code>.
- * Since it is a newly allocated copy, the caller may arbitrarily
- * modify the array.
- *
- * @param c the class which was passed to {@link #add}.
- *
- * @throws ClassCastException if <code>c</code> does not implement
- * the {@link EventListener} interface.
- *
- * @throws NullPointerException if <code>c</code> is
- * <code>null</code>.
- *
- * @returns an array of <code>c</code> whose elements are the
- * currently subscribed listeners of the specified type. If there
- * are no such listeners, an empty array is returned.
- *
- * @since 1.3
- */
- public EventListener[] getListeners(Class c)
- {
- int count, f;
- EventListener[] result;
-
- count = getListenerCount(c);
- result = (EventListener[]) Array.newInstance(c, count);
- f = 0;
- for (int i = 0; i < listenerList.length; i += 2)
- if (listenerList[i] == c)
- result[f++] = (EventListener) listenerList[i + 1];
-
- return result;
- }
-
-
- /**
- * Removes a listener of a specific type.
- *
- * @param t the type of the listener.
- *
- * @param listener the listener to remove, which must be an instance
- * of <code>t</code>, or of a subclass of <code>t</code>.
- *
- * @throws IllegalArgumentException if <code>listener</code> is not
- * an instance of <code>t</code> (or a subclass thereof).
- *
- * @throws Exception if <code>t</code> is <code>null</code>.
- */
- public void remove(Class t, EventListener listener)
- {
- Object[] oldList, newList;
- int oldLength;
-
- if (listener == null)
- return;
-
- if (!t.isInstance(listener))
- throw new IllegalArgumentException();
-
- oldList = listenerList;
- oldLength = oldList.length;
- for (int i = 0; i < oldLength; i += 2)
- if (oldList[i] == t && oldList[i + 1] == listener)
- {
- if (oldLength == 2)
- newList = NO_LISTENERS;
- else
- {
- newList = new Object[oldLength - 2];
- if (i > 0)
- System.arraycopy(oldList, 0, newList, 0, i);
- if (i < oldLength - 2)
- System.arraycopy(oldList, i + 2, newList, i,
- oldLength - 2 - i);
- }
- listenerList = newList;
- return;
- }
- }
-
-
- /**
- * Returns a string representation of this object that may be useful
- * for debugging purposes.
- */
- public String toString()
- {
- StringBuffer buf = new StringBuffer("EventListenerList: ");
- buf.append(listenerList.length / 2);
- buf.append(" listeners: ");
- for (int i = 0; i < listenerList.length; i += 2)
- {
- buf.append(" type ");
- buf.append(((Class) listenerList[i]).getName());
- buf.append(" listener ");
- buf.append(listenerList[i + 1]);
- }
- return buf.toString();
- }
-}
diff --git a/libjava/javax/swing/event/HyperlinkEvent.java b/libjava/javax/swing/event/HyperlinkEvent.java
deleted file mode 100644
index 4afa009f4f9..00000000000
--- a/libjava/javax/swing/event/HyperlinkEvent.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/* HyperlinkEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.net.URL;
-import java.util.EventObject;
-
-import javax.swing.text.Element;
-
-/**
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public class HyperlinkEvent extends EventObject
-{
- public static final class EventType
- {
- public static final EventType ENTERED = new EventType("ENTERED"); // TODO
- public static final EventType EXITED = new EventType("EXITED"); // TODO
- public static final EventType ACTIVATED = new EventType("ACTIVATED"); // TODO
-
- private String type;
-
- /**
- * Creates a new Event type.
- *
- * @param type String representing the event type.
- */
- private EventType(String type)
- {
- this.type = type;
- }
-
- /**
- * Returns a <code>String</code> of this object.
- */
- public String toString()
- {
- return type;
- }
- }
-
- private static final long serialVersionUID = -2054640811732867012L;
-
- private EventType type;
- private URL url;
- private String description;
- private Element element;
-
- /**
- * Creates a new <code>HyperlinkEvent</code> with the given arguments.
- *
- * @param source The object this link is associated to.
- * @param type The type of event.
- * @param url The URL this link pointing too.
- */
- public HyperlinkEvent(Object source, EventType type, URL url)
- {
- this (source, type, url, null, null);
- }
-
- /**
- * Creates a new <code>HyperlinkEvent</code> with the given arguments.
- *
- * @param source The object this link is associated to.
- * @param type The type of event.
- * @param url The URL this link pointing too.
- * @param description The description for this link.
- */
- public HyperlinkEvent(Object source, EventType type, URL url,
- String description)
- {
- this (source, type, url, description, null);
- }
-
- /**
- * Creates a new <code>HyperlinkEvent</code> with the given arguments.
- *
- * @param source The object this link is associated to.
- * @param type The type of event.
- * @param url The URL this link pointing too.
- * @param description The description for this link.
- * @param element The element in the document representing the anchor.
- */
- public HyperlinkEvent(Object source, EventType type, URL url,
- String description, Element element)
- {
- super(source);
- this.type = type;
- this.url = url;
- this.description = description;
- this.element = element;
- }
-
- /**
- * Returns the element of the document repesenting this anchor.
- */
- public Element getSourceElement()
- {
- return element;
- }
-
- /**
- * Returns the URL of this event.
- */
- public URL getURL()
- {
- return url;
- }
-
- /**
- * Returns the type of this event.
- */
- public EventType getEventType()
- {
- return type;
- }
-
- /**
- * Returns the description of this event.
- */
- public String getDescription()
- {
- return description;
- }
-}
diff --git a/libjava/javax/swing/event/HyperlinkListener.java b/libjava/javax/swing/event/HyperlinkListener.java
deleted file mode 100644
index 5dede993fc0..00000000000
--- a/libjava/javax/swing/event/HyperlinkListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* HyperlinkListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * HyperlinkListener
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public interface HyperlinkListener extends EventListener {
-
- /**
- * Hyperlink updated
- * @param event Hyperlink Event
- */
- void hyperlinkUpdate(HyperlinkEvent event);
-
-
-} // HyperlinkListener
diff --git a/libjava/javax/swing/event/InternalFrameAdapter.java b/libjava/javax/swing/event/InternalFrameAdapter.java
deleted file mode 100644
index a2878e76e79..00000000000
--- a/libjava/javax/swing/event/InternalFrameAdapter.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* InternalFrameAdapter.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-/**
- * InternalFrameAdapter
- * @author Andrew Selkirk
- */
-public abstract class InternalFrameAdapter implements InternalFrameListener
-{
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * InternalFrameAdapter constructor
- */
- public InternalFrameAdapter() {
- } // InternalFrameAdapter()
-
-
- //-------------------------------------------------------------
- // Interface: InternalFrameListener ---------------------------
- //-------------------------------------------------------------
-
- /**
- * Internal frame activated
- * @param event Internal frame event
- */
- public void internalFrameActivated(InternalFrameEvent event) {
- } // internalFrameActivated()
-
- /**
- * Internal frame closed
- * @param event Internal frame event
- */
- public void internalFrameClosed(InternalFrameEvent event) {
- } // internalFrameClosed()
-
- /**
- * Internal frame closing
- * @param event Internal frame event
- */
- public void internalFrameClosing(InternalFrameEvent event) {
- } // internalFrameClosing()
-
- /**
- * Internal frame deactivated
- * @param event Internal frame event
- */
- public void internalFrameDeactivated(InternalFrameEvent event) {
- } // internalFrameDeactivated()
-
- /**
- * Internal frame deiconified
- * @param event Internal frame event
- */
- public void internalFrameDeiconified(InternalFrameEvent event) {
- } // internalFrameDeiconified()
-
- /**
- * Internal frame iconified
- * @param event Internal frame event
- */
- public void internalFrameIconified(InternalFrameEvent event) {
- } // internalFrameIconified()
-
- /**
- * Internal frame opened
- * @param event Internal frame event
- */
- public void internalFrameOpened(InternalFrameEvent event) {
- } // internalFrameOpened()
-
-
-} // InternalFrameAdapter
diff --git a/libjava/javax/swing/event/InternalFrameEvent.java b/libjava/javax/swing/event/InternalFrameEvent.java
deleted file mode 100644
index badfa80aca7..00000000000
--- a/libjava/javax/swing/event/InternalFrameEvent.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* InternalFrameEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.awt.AWTEvent;
-
-import javax.swing.JInternalFrame;
-
-/**
- * @author Andrew Selkirk
- */
-public class InternalFrameEvent extends AWTEvent
-{
- private static final long serialVersionUID = -5204823611874873183L;
-
- /**
- * Internal frame activated event
- */
- public static final int INTERNAL_FRAME_ACTIVATED = 25554;
-
- /**
- * Internal frame closed event
- */
- public static final int INTERNAL_FRAME_CLOSED = 25551;
-
- /**
- * Internal frame closing event
- */
- public static final int INTERNAL_FRAME_CLOSING = 25550;
-
- /**
- * Internal frame deactivated event
- */
- public static final int INTERNAL_FRAME_DEACTIVATED = 25555;
-
- /**
- * Internal frame deiconifed event
- */
- public static final int INTERNAL_FRAME_DEICONIFIED = 25553;
-
- /**
- * Internal frame frame first event
- */
- public static final int INTERNAL_FRAME_FIRST = 25549;
-
- /**
- * Internal frame iconified event
- */
- public static final int INTERNAL_FRAME_ICONIFIED = 25552;
-
- /**
- * Internal frame last event
- */
- public static final int INTERNAL_FRAME_LAST = 25555;
-
- /**
- * Internal frame opened event
- */
- public static final int INTERNAL_FRAME_OPENED = 25549;
-
- /**
- * Creates a <code>JInternalFrameEvent</code> object.
- *
- * @param source The source of this event.
- * @param id Then event ID of this event.
- */
- public InternalFrameEvent(JInternalFrame source, int id)
- {
- super(source, id);
- }
-
- /**
- * Returns the <code>JInternalFrame</code> object stored in this event.
- */
- public JInternalFrame getInternalFrame()
- {
- return (JInternalFrame) source;
- }
-}
diff --git a/libjava/javax/swing/event/InternalFrameListener.java b/libjava/javax/swing/event/InternalFrameListener.java
deleted file mode 100644
index d1b2812a86f..00000000000
--- a/libjava/javax/swing/event/InternalFrameListener.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* InternalFrameListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * InternalFrameListener public interface
- * @author Andrew Selkirk
- */
-public interface InternalFrameListener extends EventListener {
-
- /**
- * Internal frame activated
- * @param event Internal Frame Event
- */
- void internalFrameActivated(InternalFrameEvent event);
-
- /**
- * Internal frame closed
- * @param event Internal Frame Event
- */
- void internalFrameClosed(InternalFrameEvent event);
-
- /**
- * Internal frame closing
- * @param event Internal Frame Event
- */
- void internalFrameClosing(InternalFrameEvent event);
-
- /**
- * Internal frame deactivated
- * @param event Internal Frame Event
- */
- void internalFrameDeactivated(InternalFrameEvent event);
-
- /**
- * Internal frame deiconified
- * @param event Internal Frame Event
- */
- void internalFrameDeiconified(InternalFrameEvent event);
-
- /**
- * Internal frame iconified
- * @param event Internal Frame Event
- */
- void internalFrameIconified(InternalFrameEvent event);
-
- /**
- * Internal frame opened
- * @param event Internal Frame Event
- */
- void internalFrameOpened(InternalFrameEvent event);
-
-
-} // InternalFrameListener
diff --git a/libjava/javax/swing/event/ListDataEvent.java b/libjava/javax/swing/event/ListDataEvent.java
deleted file mode 100644
index 2a6e6dbe9f0..00000000000
--- a/libjava/javax/swing/event/ListDataEvent.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ListDataEvent.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventObject;
-
-/**
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public class ListDataEvent extends EventObject
-{
- private static final long serialVersionUID = 2510353260071004774L;
-
- public static final int CONTENTS_CHANGED = 0;
- public static final int INTERVAL_ADDED = 1;
- public static final int INTERVAL_REMOVED = 2;
-
- private int type = 0;
- private int index0 = 0;
- private int index1 = 0;
-
- /**
- * Creates a <code>ListDataEvent</code> object.
- *
- * @param source The source of the event.
- * @param type The type of the event
- * @param index0 Bottom of range
- * @param index1 Top of range
- */
- public ListDataEvent(Object source, int type, int index0, int index1)
- {
- super(source);
- this.type = type;
- this.index0 = index0;
- this.index1 = index1;
- }
-
- /**
- * Returns the bottom index.
- */
- public int getIndex0()
- {
- return index0;
- }
-
- /**
- * Returns the top index.
- */
- public int getIndex1()
- {
- return index1;
- }
-
- /**
- * Returns the type of this event.
- */
- public int getType()
- {
- return type;
- }
-}
diff --git a/libjava/javax/swing/event/ListDataListener.java b/libjava/javax/swing/event/ListDataListener.java
deleted file mode 100644
index 7ce17d86fa6..00000000000
--- a/libjava/javax/swing/event/ListDataListener.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ListDataListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * ListDataListener public interface
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public interface ListDataListener extends EventListener {
-
- /**
- * Contents Changed
- * @param event ListDataEvent Event
- */
- void contentsChanged(ListDataEvent event);
-
- /**
- * Interval Added
- * @param event ListDataEvent Event
- */
- void intervalAdded(ListDataEvent event);
-
- /**
- * Interval Removed
- * @param event ListDataEvent Event
- */
- void intervalRemoved(ListDataEvent event);
-
-
-} // ListDataListener
diff --git a/libjava/javax/swing/event/ListSelectionEvent.java b/libjava/javax/swing/event/ListSelectionEvent.java
deleted file mode 100644
index e5e4c33bad9..00000000000
--- a/libjava/javax/swing/event/ListSelectionEvent.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* ListSelectionEvent.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventObject;
-
-/**
- * ListSelectionEvent
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public class ListSelectionEvent extends EventObject {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * firstIndex
- */
- private int firstIndex = 0;
-
- /**
- * lastIndex
- */
- private int lastIndex = 0;
-
- /**
- * isAdjusting
- */
- private boolean isAdjusting = false;
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ListSelectionEvent
- * @param source Source
- * @param firstIndex First index
- * @param lastIndex Last index
- * @param isAdjusting Is Adjusting?
- */
- public ListSelectionEvent(Object source, int firstIndex,
- int lastIndex, boolean isAdjusting) {
- super(source);
- this.firstIndex = firstIndex;
- this.lastIndex = lastIndex;
- this.isAdjusting = isAdjusting;
- } // ListSelectionEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getFirstIndex
- * @returns firstIndex
- */
- public int getFirstIndex() {
- return firstIndex;
- } // getFirstIndex()
-
- /**
- * getLastIndex
- * @returns lastIndex
- */
- public int getLastIndex() {
- return lastIndex;
- } // getLastIndex()
-
- /**
- * getValueIsAdjusting
- * @returns isAdjusting
- */
- public boolean getValueIsAdjusting() {
- return isAdjusting;
- } // getValueIsAdjusting()
-
- /**
- * String representation
- * @returns String representation
- */
- public String toString() {
- return null; // TODO
- } // toString()
-
-
-} // ListSelectionEvent
diff --git a/libjava/javax/swing/event/ListSelectionListener.java b/libjava/javax/swing/event/ListSelectionListener.java
deleted file mode 100644
index 4ebf5830432..00000000000
--- a/libjava/javax/swing/event/ListSelectionListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ListSelectionListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * ListSelectionListener public interface
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public interface ListSelectionListener extends EventListener {
-
- /**
- * Value changed
- * @param event List Selection Event
- */
- void valueChanged(ListSelectionEvent event);
-
-
-} // ListSelectionListener
diff --git a/libjava/javax/swing/event/MenuDragMouseEvent.java b/libjava/javax/swing/event/MenuDragMouseEvent.java
deleted file mode 100644
index 99761670629..00000000000
--- a/libjava/javax/swing/event/MenuDragMouseEvent.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* MenuDragMouseEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.awt.Component;
-import java.awt.event.MouseEvent;
-
-import javax.swing.MenuElement;
-import javax.swing.MenuSelectionManager;
-
-/**
- * MenuDragMouseEvent
- * @author Andrew Selkirk
- */
-public class MenuDragMouseEvent extends MouseEvent {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * path
- */
- private MenuElement[] path = null;
-
- /**
- * manager
- */
- private MenuSelectionManager manager = null;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor MenuDragMouseEvent
- * @param source Source
- * @param id MouseEvent type
- * @param when Time
- * @param modifiers Key modifiers
- * @param x Horizontal position
- * @param y Vertical position
- * @param clickCount Click count
- * @param popupTrigger Popup trigger?
- * @param path Path
- * @param manager MenuSelectionManager
- */
- public MenuDragMouseEvent(Component source, int id, long when, int modifiers,
- int x, int y, int clickCount, boolean popupTrigger,
- MenuElement[] path, MenuSelectionManager manager) {
- super(source, id, when, modifiers, x, y, clickCount, popupTrigger);
- this.path = path;
- this.manager = manager;
- } // MenuDragMouseEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Get path
- * @returns path
- */
- public MenuElement[] getPath() {
- return path;
- } // getPath()
-
- /**
- * Get menu selection manager
- * @returns manager
- */
- public MenuSelectionManager getMenuSelectionManager() {
- return manager;
- } // getMenuSelectionManager()
-
-
-} // MenuDragMouseEvent
diff --git a/libjava/javax/swing/event/MenuDragMouseListener.java b/libjava/javax/swing/event/MenuDragMouseListener.java
deleted file mode 100644
index bfca315e333..00000000000
--- a/libjava/javax/swing/event/MenuDragMouseListener.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MenuDragMouseListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * MenuDragMouseListener public interface
- * @author Andrew Selkirk
- */
-public interface MenuDragMouseListener extends EventListener {
-
- /**
- * Menu drag mouse dragged
- * @param event Menu Drag Mouse Event
- */
- void menuDragMouseDragged(MenuDragMouseEvent event);
-
- /**
- * Menu drag mouse entered
- * @param event Menu Drag Mouse Event
- */
- void menuDragMouseEntered(MenuDragMouseEvent event);
-
- /**
- * Menu drag mouse exited
- * @param event Menu Drag Mouse Event
- */
- void menuDragMouseExited(MenuDragMouseEvent event);
-
- /**
- * Menu drag mouse released
- * @param event Menu Drag Mouse Event
- */
- void menuDragMouseReleased(MenuDragMouseEvent event);
-
-
-} // MenuDragMouseListener
diff --git a/libjava/javax/swing/event/MenuEvent.java b/libjava/javax/swing/event/MenuEvent.java
deleted file mode 100644
index 35bb5b97b43..00000000000
--- a/libjava/javax/swing/event/MenuEvent.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* MenuEvent.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventObject;
-
-/**
- * MenuEvent
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public class MenuEvent extends EventObject {
-
- /**
- * Constructor MenuEvent
- * @param source Source object
- */
- public MenuEvent(Object source) {
- super(source);
- } // MenuEvent()
-
-
-} // MenuEvent
diff --git a/libjava/javax/swing/event/MenuKeyEvent.java b/libjava/javax/swing/event/MenuKeyEvent.java
deleted file mode 100644
index 48fcb45b5b3..00000000000
--- a/libjava/javax/swing/event/MenuKeyEvent.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* MenuKeyEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.awt.Component;
-import java.awt.event.KeyEvent;
-
-import javax.swing.MenuElement;
-import javax.swing.MenuSelectionManager;
-
-/**
- * MenuKeyEvent
- * @author Andrew Selkirk
- */
-public class MenuKeyEvent extends KeyEvent {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * path
- */
- private MenuElement[] path = null;
-
- /**
- * manager
- */
- private MenuSelectionManager manager = null;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor MenuKeyEvent
- * @param source Source
- * @param id KeyEvent ID
- * @param when Time
- * @param modifiers Modifier keys
- * @param keyCode Key code
- * @param keyhar Key char
- * @param path Path
- * @param manager MenuSelectionManager
- */
- public MenuKeyEvent(Component source, int id, long when, int modifiers,
- int keyCode, char keyChar, MenuElement[] path,
- MenuSelectionManager manager) {
- super(source, id, when, modifiers, keyCode, keyChar);
- this.path = path;
- this.manager = manager;
- } // MenuKeyEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getPath
- * @returns path
- */
- public MenuElement[] getPath() {
- return path;
- } // getPath()
-
- /**
- * getMenuSelectionManager
- * @returns MenuSelectionManager
- */
- public MenuSelectionManager getMenuSelectionManager() {
- return manager;
- } // getMenuSelectionManager()
-
-
-} // MenuKeyEvent
diff --git a/libjava/javax/swing/event/MenuKeyListener.java b/libjava/javax/swing/event/MenuKeyListener.java
deleted file mode 100644
index 7a1eb89b428..00000000000
--- a/libjava/javax/swing/event/MenuKeyListener.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* MenuKeyListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * MenuKeyListener public interface
- * @author Andrew Selkirk
- */
-public interface MenuKeyListener extends EventListener {
-
- /**
- * Menu key pressed
- * @param event Menu Key Event
- */
- void menuKeyPressed(MenuKeyEvent event);
-
- /**
- * Menu key released
- * @param event Menu Key Event
- */
- void menuKeyReleased(MenuKeyEvent event);
-
- /**
- * Menu key typed
- * @param event Menu Key Event
- */
- void menuKeyTyped(MenuKeyEvent event);
-
-
-} // MenuKeyListener
diff --git a/libjava/javax/swing/event/MenuListener.java b/libjava/javax/swing/event/MenuListener.java
deleted file mode 100644
index dba704a8ee1..00000000000
--- a/libjava/javax/swing/event/MenuListener.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* MenuListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * MenuListener public interface
- * @author Andrew Selkirk
- */
-public interface MenuListener extends EventListener {
-
- /**
- * Menu canceled
- * @param event Menu Event
- */
- void menuCanceled(MenuEvent event);
-
- /**
- * Menu deselected
- * @param event Menu Event
- */
- void menuDeselected(MenuEvent event);
-
- /**
- * Menu selected
- * @param event Menu Event
- */
- void menuSelected(MenuEvent event);
-
-
-} // MenuListener
diff --git a/libjava/javax/swing/event/MouseInputAdapter.java b/libjava/javax/swing/event/MouseInputAdapter.java
deleted file mode 100644
index 2da5543eb91..00000000000
--- a/libjava/javax/swing/event/MouseInputAdapter.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/* MouseInputAdapter.java --
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.awt.event.MouseEvent;
-
-/**
- * MouseInputAdapter
- * @author Andrew Selkirk
- */
-public abstract class MouseInputAdapter implements MouseInputListener
-{
- /**
- * Constructor MouseInputAdapter
- */
- public MouseInputAdapter()
- {
- // Do nothing here.
- }
-
- /**
- * Mouse clicked
- * @param event Mouse event
- */
- public void mouseClicked(MouseEvent event)
- {
- // Do nothing by default.
- }
-
- /**
- * Mouse dragged
- * @param event Mouse event
- */
- public void mouseDragged(MouseEvent event)
- {
- // Do nothing by default.
- }
-
- /**
- * Mouse entered
- * @param event Mouse event
- */
- public void mouseEntered(MouseEvent event)
- {
- // Do nothing by default.
- }
-
- /**
- * Mouse exited
- * @param event Mouse event
- */
- public void mouseExited(MouseEvent event)
- {
- // Do nothing by default.
- }
-
- /**
- * Mouse moved
- * @param event Mouse event
- */
- public void mouseMoved(MouseEvent event)
- {
- // Do nothing by default.
- }
-
- /**
- * Mouse pressed
- * @param event Mouse event
- */
- public void mousePressed(MouseEvent event)
- {
- // Do nothing by default.
- }
-
- /**
- * Mouse released
- * @param event Mouse event
- */
- public void mouseReleased(MouseEvent event)
- {
- // Do nothing by default.
- }
-}
diff --git a/libjava/javax/swing/event/MouseInputListener.java b/libjava/javax/swing/event/MouseInputListener.java
deleted file mode 100644
index 3c3ca2347fe..00000000000
--- a/libjava/javax/swing/event/MouseInputListener.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* MouseInputListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-
-/**
- * MouseInputListener public interface
- * @author Andrew Selkirk
- */
-public interface MouseInputListener extends MouseListener,
- MouseMotionListener {
-
-} // MouseInputListener
-
diff --git a/libjava/javax/swing/event/PopupMenuEvent.java b/libjava/javax/swing/event/PopupMenuEvent.java
deleted file mode 100644
index 055555086ef..00000000000
--- a/libjava/javax/swing/event/PopupMenuEvent.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* PopupMenuEvent.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventObject;
-
-/**
- * PopupMenuEvent
- * @author Andrew Selkirk
- */
-public class PopupMenuEvent extends EventObject {
-
- /**
- * Constructor PopupMenuEvent
- * @param source Source
- */
- public PopupMenuEvent(Object source) {
- super(source);
- } // PopupMenuEvent()
-
-
-} // PopupMenuEvent
diff --git a/libjava/javax/swing/event/PopupMenuListener.java b/libjava/javax/swing/event/PopupMenuListener.java
deleted file mode 100644
index dc917d2414c..00000000000
--- a/libjava/javax/swing/event/PopupMenuListener.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* PopupMenuListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * PopupMenuListener public interface
- * @author Andrew Selkirk
- */
-public interface PopupMenuListener extends EventListener {
-
- /**
- * Popup Menu Canceled
- * @param event Popup Menu Event
- */
- void popupMenuCanceled(PopupMenuEvent event);
-
- /**
- * Popup Menu will become invisible
- * @param event Popup Menu Event
- */
- void popupMenuWillBecomeInvisible(PopupMenuEvent event);
-
- /**
- * Popup Menu will become visible
- * @param event Popup Menu Event
- */
- void popupMenuWillBecomeVisible(PopupMenuEvent event);
-
-
-} // PopupMenuListener
diff --git a/libjava/javax/swing/event/SwingPropertyChangeSupport.java b/libjava/javax/swing/event/SwingPropertyChangeSupport.java
deleted file mode 100644
index ddbb4865883..00000000000
--- a/libjava/javax/swing/event/SwingPropertyChangeSupport.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/* SwingPropertyChangeSupport.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.EventListener;
-import java.util.Hashtable;
-
-/**
- * SwingPropertyChangeSupport
- * @author Andrew Selkirk
-*/
-public final class SwingPropertyChangeSupport
- extends PropertyChangeSupport {
-
- private static final long serialVersionUID = 7162625831330845068L;
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * listeners
- */
- private transient EventListenerList listeners;
-
- /**
- * propertyListeners
- */
- private Hashtable propertyListeners;
-
- /**
- * source
- */
- private Object source;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor SwingPropertyChangeSupport
- * @param source TODO
- */
- public SwingPropertyChangeSupport(Object source) {
- super(source);
- this.source = source;
- this.listeners = new EventListenerList();
- this.propertyListeners = new Hashtable();
- } // SwingPropertyChangeSupport()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * writeObject
- * @param stream TODO
- * @exception IOException TODO
- */
- private void writeObject(ObjectOutputStream stream) throws IOException {
- // TODO
- } // writeObject()
-
- /**
- * readObject
- * @param stream TODO
- * @exception ClassNotFoundException TODO
- * @exception IOException TODO
- */
- private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException {
- // TODO
- } // readObject()
-
- /**
- * addPropertyChangeListener
- * @param listener TODO
- */
- public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
- listeners.add(PropertyChangeListener.class, listener);
- } // addPropertyChangeListener()
-
- /**
- * addPropertyChangeListener
- * @param propertyName TODO
- * @param listener TODO
- */
- public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
-
- // Variables
- EventListenerList list;
-
- // Get Listener list
- list = (EventListenerList) propertyListeners.get(propertyName);
- if (list == null) {
- list = new EventListenerList();
- propertyListeners.put(propertyName, list);
- } // if
-
- // Add Listeners
- list.add(PropertyChangeListener.class, listener);
-
- } // addPropertyChangeListener()
-
- /**
- * removePropertyChangeListener
- * @param listener TODO
- */
- public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
- listeners.remove(PropertyChangeListener.class, listener);
- } // removePropertyChangeListener()
-
- /**
- * removePropertyChangeListener
- * @param propertyName TODO
- * @param listener TODO
- */
- public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
-
- // Variables
- EventListenerList list;
-
- // Get Listener list
- list = (EventListenerList) propertyListeners.get(propertyName);
- if (list == null) {
- return;
- } // if
-
- // Remove Listeners
- list.remove(PropertyChangeListener.class, listener);
-
- // Clean up propertyListeners
- if (list.getListenerCount() == 0) {
- propertyListeners.remove(propertyName);
- } // if
-
- } // removePropertyChangeListener()
-
- /**
- * firePropertyChange
- * @param propertyName TODO
- * @param oldValue TODO
- * @param newValue TODO
- */
- public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
-
- // Variables
- PropertyChangeEvent event;
-
- // Create Property Change Event
- event = new PropertyChangeEvent(source, propertyName, oldValue, newValue);
-
- // Fire Event
- firePropertyChange(event);
-
- } // firePropertyChange()
-
- /**
- * firePropertyChange
- * @param event TODO
- */
- public void firePropertyChange(PropertyChangeEvent event) {
-
- // Variables
- EventListenerList list;
- EventListener[] listenerList;
- int index;
- PropertyChangeListener listener;
-
- // Check Values if they are equal
- if (event.getOldValue() == null && event.getNewValue() == null ||
- (event.getOldValue() != null && event.getNewValue() != null &&
- event.getOldValue().equals(event.getNewValue()))) {
- return;
- } // if
-
- // Process Main Listener List
- listenerList = listeners.getListeners(PropertyChangeListener.class);
- for (index = 0; index < listenerList.length; index++) {
- listener = (PropertyChangeListener) listenerList[index];
- listener.propertyChange(event);
- } // for
-
- // Process Property Listener List
- list = (EventListenerList) propertyListeners.get(event.getPropertyName());
- if (list != null) {
- listenerList = list.getListeners(PropertyChangeListener.class);
- for (index = 0; index < listenerList.length; index++) {
- listener = (PropertyChangeListener) listenerList[index];
- listener.propertyChange(event);
- } // for
- } // if
-
- } // firePropertyChange()
-
- /**
- * hasListeners
- * @param propertyName TODO
- * @returns boolean
- */
- public synchronized boolean hasListeners(String propertyName) {
-
- // Get Listener list
- if (propertyListeners.get(propertyName) == null) {
- return false;
- } // if
-
- return true;
-
- } // hasListeners()
-
-
-} // SwingPropertyChangeSupport
diff --git a/libjava/javax/swing/event/TableColumnModelEvent.java b/libjava/javax/swing/event/TableColumnModelEvent.java
deleted file mode 100644
index 2ca4148aadb..00000000000
--- a/libjava/javax/swing/event/TableColumnModelEvent.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/* TableColumnModelEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventObject;
-
-import javax.swing.table.TableColumnModel;
-
-/**
- * TableColumnModelEvent
- * @author Andrew Selkirk
- */
-public class TableColumnModelEvent extends EventObject {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * fromIndex
- */
- protected int fromIndex = 0;
-
- /**
- * toIndex
- */
- protected int toIndex = 0;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor TableColumnModelEvent
- * @param source Source TableColumnModel
- * @param from From index
- * @param to To index
- */
- public TableColumnModelEvent(TableColumnModel source,
- int from, int to) {
- super(source);
- fromIndex = from;
- toIndex = to;
- } // TableColumnModelEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getFromIndex.
- * @returns From index
- */
- public int getFromIndex() {
- return fromIndex;
- } // getFromIndex()
-
- /**
- * getToIndex.
- * @returns To index
- */
- public int getToIndex() {
- return toIndex;
- } // getToIndex()
-
-
-} // TableColumnModelEvent
diff --git a/libjava/javax/swing/event/TableColumnModelListener.java b/libjava/javax/swing/event/TableColumnModelListener.java
deleted file mode 100644
index 90e1b29cc57..00000000000
--- a/libjava/javax/swing/event/TableColumnModelListener.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* TableColumnModelListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * TableColumnModelListener public interface
- * @author Andrew Selkirk
- */
-public interface TableColumnModelListener extends EventListener {
-
- /**
- * Column added
- * @param event Table Column Model Event
- */
- void columnAdded(TableColumnModelEvent event);
-
- /**
- * Column margin changed
- * @param event Change Event
- */
- void columnMarginChanged(ChangeEvent event);
-
- /**
- * Column moved
- * @param event Table Column Model Event
- */
- void columnMoved(TableColumnModelEvent event);
-
- /**
- * Column removed
- * @param event Table Column Model Event
- */
- void columnRemoved(TableColumnModelEvent event);
-
- /**
- * Column selection changed
- * @param event List Selection Event
- */
- void columnSelectionChanged(ListSelectionEvent event);
-
-
-} // TableColumnModelListener
diff --git a/libjava/javax/swing/event/TableModelEvent.java b/libjava/javax/swing/event/TableModelEvent.java
deleted file mode 100644
index aa4c6c18084..00000000000
--- a/libjava/javax/swing/event/TableModelEvent.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* TableModelEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventObject;
-
-import javax.swing.table.TableModel;
-
-/**
- * @author Andrew Selkirk
- */
-public class TableModelEvent extends EventObject
-{
- private static final long serialVersionUID = -7849342674552212824L;
-
- public static final int ALL_COLUMNS = -1;
- public static final int DELETE = -1;
- public static final int HEADER_ROW = -1;
- public static final int INSERT = 1;
- public static final int UPDATE = 0;
-
- protected int column = 0;
- protected int firstRow = 0;
- protected int lastRow = 0;
- protected int type = 0;
-
- /**
- * Creates a <code>TableModelEvent</code> event.
- *
- * @param source The source object
- */
- public TableModelEvent(TableModel source)
- {
- this(source, 0, source.getRowCount(), ALL_COLUMNS, UPDATE);
- }
-
- /**
- * Creates a <code>TableModelEvent</code> event.
- *
- * @param source The source object
- * @param row The updated row
- */
- public TableModelEvent(TableModel source, int row)
- {
- this(source, row, row, ALL_COLUMNS, UPDATE);
- }
-
- /**
- * Creates a <code>TableModelEvent</code> event.
- *
- * @param source The source object
- * @param firstRow The first row of update
- * @param lastRow The last row of update
- */
- public TableModelEvent(TableModel source, int firstRow, int lastRow)
- {
- this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE);
- }
-
- /**
- * Creates a <code>TableModelEvent</code> event.
- *
- * @param source The source object
- * @param firstRow The first row of update
- * @param lastRow The last row of update
- * @param column The affected column
- */
- public TableModelEvent(TableModel source, int firstRow, int lastRow, int column)
- {
- this(source, firstRow, lastRow, column, UPDATE);
- }
-
- /**
- * Creates a <code>TableModelEvent</code> event.
- *
- * @param source The source object
- * @param firstRow The first row of update
- * @param lastRow The last row of update
- * @param column The affected column
- * @param type The type of change
- */
- public TableModelEvent(TableModel source, int firstRow, int lastRow, int column, int type)
- {
- super(source);
- this.firstRow = firstRow;
- this.lastRow = lastRow;
- this.column = column;
- this.type = type;
- }
-
- /**
- * Returns the affected column of this event.
- */
- public int getColumn()
- {
- return column;
- }
-
- /**
- * Returns the first affected row of this event.
- */
- public int getFirstRow()
- {
- return firstRow;
- }
-
- /**
- * Returns the last affected row of this event.
- */
- public int getLastRow()
- {
- return lastRow;
- }
-
- /**
- * Returns the type of change of this event.
- */
- public int getType()
- {
- return type;
- }
-}
diff --git a/libjava/javax/swing/event/TableModelListener.java b/libjava/javax/swing/event/TableModelListener.java
deleted file mode 100644
index c8d6e8f8dbc..00000000000
--- a/libjava/javax/swing/event/TableModelListener.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* TableModelListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventListener;
-
-/**
- * TableModelListener public interface
- * @author Andrew Selkirk
- */
-public interface TableModelListener extends EventListener {
-
- /**
- * Table changed
- * @param event Table Model Event
- */
- void tableChanged(TableModelEvent event);
-
-
-} // TableModelListener
diff --git a/libjava/javax/swing/event/TreeExpansionEvent.java b/libjava/javax/swing/event/TreeExpansionEvent.java
deleted file mode 100644
index c4b33134694..00000000000
--- a/libjava/javax/swing/event/TreeExpansionEvent.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* TreeExpansionEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventObject;
-
-import javax.swing.tree.TreePath;
-
-/**
- * TreeExpansionEvent
- * @author Andrew Selkirk
- */
-public class TreeExpansionEvent extends EventObject {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * path
- */
- protected TreePath path = null;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor TreeExpansionEvent
- * @param source Source object
- * @param path Path
- */
- public TreeExpansionEvent(Object source, TreePath path) {
- super(source);
- this.path = path;
- } // TreeExpansionEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getPath
- * @returns Tree path
- */
- public TreePath getPath() {
- return path;
- } // getPath()
-
-
-} // TreeExpansionEvent
diff --git a/libjava/javax/swing/event/TreeExpansionListener.java b/libjava/javax/swing/event/TreeExpansionListener.java
deleted file mode 100644
index 08507a0ffe9..00000000000
--- a/libjava/javax/swing/event/TreeExpansionListener.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* TreeExpansionListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * TreeExpansionListener public interface
- * @author Andrew Selkirk
- */
-public interface TreeExpansionListener extends EventListener {
-
- /**
- * Tree collapsed
- * @param event Tree Expansion Event
- */
- void treeCollapsed(TreeExpansionEvent event);
-
- /**
- * Tree expanded
- * @param event Tree Expansion Event
- */
- void treeExpanded(TreeExpansionEvent event);
-
-
-} // TreeExpansionListener
diff --git a/libjava/javax/swing/event/TreeModelEvent.java b/libjava/javax/swing/event/TreeModelEvent.java
deleted file mode 100644
index a217e3b4053..00000000000
--- a/libjava/javax/swing/event/TreeModelEvent.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* TreeModelEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventObject;
-
-import javax.swing.tree.TreePath;
-
-/**
- * TreeModelEvent
- * @author Andrew Selkirk
- */
-public class TreeModelEvent extends EventObject {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * childIndices
- */
- protected int[] childIndices = new int[0];
-
- /**
- * children
- */
- protected Object[] children = new Object[0];
-
- /**
- * path
- */
- protected TreePath path = null;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor TreeModelEvent
- * @param source Source object
- * @param path
- */
- public TreeModelEvent(Object source, Object[] path) {
- super(source);
- this.path = new TreePath(path);
- } // TreeModelEvent()
-
- /**
- * Constructor TreeModelEvent
- * @param source Source object
- * @param path path
- * @param childIndices Child indices
- * @param children Children
- */
- public TreeModelEvent(Object source, Object[] path,
- int[] childIndices, Object[] children) {
- super(source);
- this.path = new TreePath(path);
- this.childIndices = childIndices;
- this.children = children;
- } // TreeModelEvent()
-
- /**
- * Constructor TreeModelEvent
- * @param source Source object
- * @param path Path
- */
- public TreeModelEvent(Object source, TreePath path) {
- super(source);
- this.path = path;
- } // TreeModelEvent()
-
- /**
- * Constructor TreeModelEvent
- * @param source Source object
- * @param path Path
- * @param childIndices Child indices
- * @param children Children
- */
- public TreeModelEvent(Object source, TreePath path,
- int[] childIndices, Object[] children) {
- super(source);
- this.path = path;
- this.childIndices = childIndices;
- this.children = children;
- } // TreeModelEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getChildIndices
- * @returns child indices
- */
- public int[] getChildIndices() {
- return childIndices;
- } // getChildIndices()
-
- /**
- * getChildren
- * @returns children
- */
- public Object[] getChildren() {
- return children;
- } // getChildren()
-
- /**
- * getPath
- * @returns path
- */
- public Object[] getPath() {
- return path.getPath();
- } // getPath()
-
- /**
- * getTreePath
- * @returns TreePath
- */
- public TreePath getTreePath() {
- return path;
- } // getTreePath()
-
- /**
- * String representation
- * @returns String representation
- */
- public String toString() {
- return null; // TODO
- } // toString()
-
-
-} // TreeModelEvent
diff --git a/libjava/javax/swing/event/TreeModelListener.java b/libjava/javax/swing/event/TreeModelListener.java
deleted file mode 100644
index 57b5c511b8b..00000000000
--- a/libjava/javax/swing/event/TreeModelListener.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* TreeModelListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * TreeModelListener public interface
- * @author Andrew Selkirk
- */
-public interface TreeModelListener extends EventListener {
-
- /**
- * Tree nodes changed
- * @param event Tree Model Event
- */
- void treeNodesChanged(TreeModelEvent event);
-
- /**
- * Tree nodes inserted
- * @param event Tree Model Event
- */
- void treeNodesInserted(TreeModelEvent event);
-
- /**
- * Tree nodes removed
- * @param event Tree Model Event
- */
- void treeNodesRemoved(TreeModelEvent event);
-
- /**
- * Tree structured changed
- * @param event Tree Model Event
- */
- void treeStructureChanged(TreeModelEvent event);
-
-
-} // TreeModelListener
diff --git a/libjava/javax/swing/event/TreeSelectionEvent.java b/libjava/javax/swing/event/TreeSelectionEvent.java
deleted file mode 100644
index c7fe759285a..00000000000
--- a/libjava/javax/swing/event/TreeSelectionEvent.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/* TreeSelectionEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventObject;
-
-import javax.swing.tree.TreePath;
-
-/**
- * TreeSelectionEvent
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class TreeSelectionEvent extends EventObject {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * paths
- */
- protected TreePath[] paths;
-
- /**
- * areNew
- */
- protected boolean[] areNew;
-
- /**
- * oldLeadSelectionPath
- */
- protected TreePath oldLeadSelectionPath;
-
- /**
- * newLeadSelectionPath
- */
- protected TreePath newLeadSelectionPath;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor TreeSelectionEvent
- * @param source TODO
- * @param paths TODO
- * @param areNew TODO
- * @param oldLeadSelectionPath TODO
- * @param newLeadSelectionPath TODO
- */
- public TreeSelectionEvent(Object source, TreePath[] paths,
- boolean[] areNew, TreePath oldLeadSelectionPath,
- TreePath newLeadSelectionPath) {
- super(source);
- this.paths = paths;
- this.areNew = areNew;
- this.oldLeadSelectionPath = oldLeadSelectionPath;
- this.newLeadSelectionPath = newLeadSelectionPath;
- } // TreeSelectionEvent()
-
- /**
- * Constructor TreeSelectionEvent
- * @param source TODO
- * @param paths TODO
- * @param areNew TODO
- * @param oldLeadSelectionPath TODO
- * @param newLeadSelectionPath TODO
- */
- public TreeSelectionEvent(Object source, TreePath path,
- boolean isNew, TreePath oldLeadSelectionPath,
- TreePath newLeadSelectionPath) {
- super(source);
-//TODO this.paths = new TreePath[1]{path};
-//TODO this.areNew = new boolean[1]{isNew};
- this.oldLeadSelectionPath = oldLeadSelectionPath;
- this.newLeadSelectionPath = newLeadSelectionPath;
- } // TreeSelectionEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getPath
- * @returns TreePath
- */
- public TreePath getPath() {
- return paths[0];
- } // getPath()
-
- /**
- * getPaths
- * @returns TreePath[]
- */
- public TreePath[] getPaths() {
- return paths;
- } // getPaths()
-
- /**
- * isAddedPath
- * @returns boolean
- */
- public boolean isAddedPath() {
- return false; // TODO
- } // isAddedPath()
-
- /**
- * isAddedPath
- * @param path TODO
- * @returns boolean
- */
- public boolean isAddedPath(TreePath path) {
- return false; // TODO
- } // isAddedPath()
-
- /**
- * isAddedPath
- * @param index TODO
- * @returns boolean
- */
- public boolean isAddedPath(int index) {
- return false; // TODO
- } // isAddedPath()
-
- /**
- * getOldLeadSelectionPath
- * @returns TreePath
- */
- public TreePath getOldLeadSelectionPath() {
- return oldLeadSelectionPath;
- } // getOldLeadSelectionPath()
-
- /**
- * getNewLeadSelectionPath
- * @returns TreePath
- */
- public TreePath getNewLeadSelectionPath() {
- return newLeadSelectionPath;
- } // getNewLeadSelectionPath()
-
- /**
- * cloneWithSource
- * @param source TODO
- * @returns Object
- */
- public Object cloneWithSource(Object source) {
- return null; // TODO
- } // cloneWithSource()
-
-
-} // TreeSelectionEvent
diff --git a/libjava/javax/swing/event/TreeSelectionListener.java b/libjava/javax/swing/event/TreeSelectionListener.java
deleted file mode 100644
index b844a6e0b51..00000000000
--- a/libjava/javax/swing/event/TreeSelectionListener.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* TreeSelectionListener.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-// Imports
-import java.util.EventListener;
-
-/**
- * TreeSelectionListener public interface
- * @author Andrew Selkirk
- */
-public interface TreeSelectionListener extends EventListener {
-
- /**
- * Value changed
- * @param event Tree Selection Event
- */
- void valueChanged(TreeSelectionEvent event);
-
-
-} // TreeSelectionListener
diff --git a/libjava/javax/swing/event/TreeWillExpandListener.java b/libjava/javax/swing/event/TreeWillExpandListener.java
deleted file mode 100644
index 89d3764f3bd..00000000000
--- a/libjava/javax/swing/event/TreeWillExpandListener.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* TreeWillExpandListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventListener;
-
-import javax.swing.tree.ExpandVetoException;
-
-/**
- * @author Andrew Selkirk
- */
-public interface TreeWillExpandListener extends EventListener
-{
- /**
- * Invoked whenever a node in the tree is about to be collapsed.
- *
- * @param event The tree expansion Event
- */
- void treeWillCollapse(TreeExpansionEvent event)
- throws ExpandVetoException;
-
- /**
- * Invoked whenever a node in the tree is about to be expanded.
- *
- * @param event The tree expansion Event
- */
- void treeWillExpand(TreeExpansionEvent event)
- throws ExpandVetoException;
-}
diff --git a/libjava/javax/swing/event/UndoableEditEvent.java b/libjava/javax/swing/event/UndoableEditEvent.java
deleted file mode 100644
index 147c2e5b1c5..00000000000
--- a/libjava/javax/swing/event/UndoableEditEvent.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* UndoableEditEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventObject;
-
-import javax.swing.undo.UndoableEdit;
-
-/**
- * UndoableEditEvent
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public class UndoableEditEvent extends EventObject {
-
- private static final long serialVersionUID = 4418044561759134484L;
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * edit
- */
- private UndoableEdit edit;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor UndoableEditEvent
- * @param source TODO
- * @param edit TODO
- */
- public UndoableEditEvent(Object source, UndoableEdit edit) {
- super(source);
- this.edit = edit;
- } // UndoableEditEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getEdit
- * @returns UndoableEdit
- */
- public UndoableEdit getEdit() {
- return edit;
- } // getEdit()
-
-
-} // UndoableEditEvent
diff --git a/libjava/javax/swing/event/UndoableEditListener.java b/libjava/javax/swing/event/UndoableEditListener.java
deleted file mode 100644
index 13eecf51afb..00000000000
--- a/libjava/javax/swing/event/UndoableEditListener.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* UndoableEditListener.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.event;
-
-import java.util.EventListener;
-
-
-/**
- * UndoableEditListener public interface
- * @author Andrew Selkirk
- * @author Ronald Veldema
- */
-public interface UndoableEditListener extends EventListener
-{
- /**
- * Undoable edit has happened
- *
- * @param event Undoable Edit Event
- */
- void undoableEditHappened(UndoableEditEvent event);
-}
diff --git a/libjava/javax/swing/filechooser/FileFilter.java b/libjava/javax/swing/filechooser/FileFilter.java
deleted file mode 100644
index 42770d98186..00000000000
--- a/libjava/javax/swing/filechooser/FileFilter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* FileFilter.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.filechooser;
-
-import java.io.File;
-
-/**
- * FileFilter
- * @author Andrew Selkirk
- * @version 1.0
- */
-public abstract class FileFilter {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor FileFilter
- */
- public FileFilter() {
- // TODO
- } // FileFilter()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * accept
- * @param file TODO
- * @returns boolean
- */
- public abstract boolean accept(File file);
-
- /**
- * getDescription
- * @returns String
- */
- public abstract String getDescription();
-
-
-} // FileFilter
diff --git a/libjava/javax/swing/filechooser/FileSystemView.java b/libjava/javax/swing/filechooser/FileSystemView.java
deleted file mode 100644
index ba45f4136cc..00000000000
--- a/libjava/javax/swing/filechooser/FileSystemView.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/* FileSystemView.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.filechooser;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * FileSystemView
- * @author Andrew Selkirk
- * @version 1.0
- */
-public abstract class FileSystemView {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor FileSystemView
- */
- public FileSystemView() {
- // TODO
- } // FileSystemView()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getFileSystemView
- * @returns FileSystemView
- */
- public static FileSystemView getFileSystemView() {
- return null; // TODO
- } // getFileSystemView()
-
- /**
- * isRoot
- * @param file TODO
- * @returns boolean
- */
- public abstract boolean isRoot(File file);
-
- /**
- * createNewFolder
- * @param file TODO
- * @exception IOException TODO
- * @returns File
- */
- public abstract File createNewFolder(File file) throws IOException;
-
- /**
- * isHiddenFile
- * @param file TODO
- * @returns boolean
- */
- public abstract boolean isHiddenFile(File file);
-
- /**
- * getRoots
- * @returns File[]
- */
- public abstract File[] getRoots();
-
- /**
- * getHomeDirectory
- * @returns File
- */
- public File getHomeDirectory() {
- return null; // TODO
- } // getHomeDirectory()
-
- /**
- * createFileObject
- * @param directory TODO
- * @param filename TODO
- * @returns File
- */
- public File createFileObject(File directory, String filename) {
- return null; // TODO
- } // createFileObject()
-
- /**
- * createFileObject
- * @param path TODO
- * @returns File
- */
- public File createFileObject(String path) {
- return null; // TODO
- } // createFileObject()
-
- /**
- * getFiles
- * @param directory TODO
- * @param fileHiding TODO
- * @returns File[]
- */
- public File[] getFiles(File directory, boolean fileHiding) {
- return null; // TODO
- } // getFiles()
-
- /**
- * getParentDirectory
- * @param directory TODO
- * @returns File
- */
- public File getParentDirectory(File directory) {
- return null; // TODO
- } // getParentDirectory()
-
-
-} // FileSystemView
diff --git a/libjava/javax/swing/filechooser/FileView.java b/libjava/javax/swing/filechooser/FileView.java
deleted file mode 100644
index c431fd46127..00000000000
--- a/libjava/javax/swing/filechooser/FileView.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* FileView.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.filechooser;
-
-import java.io.File;
-
-import javax.swing.Icon;
-
-/**
- * FileView
- * @author Andrew Selkirk
- * @version 1.0
- */
-public abstract class FileView {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor FileView
- */
- public FileView() {
- // TODO
- } // FileView()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getName
- * @param file TODO
- * @returns String
- */
- public String getName(File file) {
- return null; // TODO
- } // getName()
-
- /**
- * getDescription
- * @param value0 TODO
- * @returns String
- */
- public String getDescription(File value0) {
- return null; // TODO
- } // getDescription()
-
- /**
- * getTypeDescription
- * @param value0 TODO
- * @returns String
- */
- public String getTypeDescription(File value0) {
- return null; // TODO
- } // getTypeDescription()
-
- /**
- * getIcon
- * @param value0 TODO
- * @returns Icon
- */
- public Icon getIcon(File value0) {
- return null; // TODO
- } // getIcon()
-
- /**
- * isTraversable
- * @param value0 TODO
- * @returns Boolean
- */
- public Boolean isTraversable(File value0) {
- return null; // TODO
- } // isTraversable()
-
-
-} // FileView
diff --git a/libjava/javax/swing/plaf/ActionMapUIResource.java b/libjava/javax/swing/plaf/ActionMapUIResource.java
deleted file mode 100644
index f6af0880ddb..00000000000
--- a/libjava/javax/swing/plaf/ActionMapUIResource.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ActionMapUIResource.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import javax.swing.ActionMap;
-
-
-/**
- * An <code>ActionMap</code> that implements the {@link UIResource}
- * interface to indicate that it belongs to a pluggable
- * LookAndFeel.
- *
- * @see javax.swing.ActionMap
- *
- * @author Andrew Selkirk
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class ActionMapUIResource
- extends ActionMap
- implements UIResource
-{
- /**
- * Constructs a new ActionMapUIResource.
- */
- public ActionMapUIResource()
- {
- /* The constructor does nothing. */
- }
-}
diff --git a/libjava/javax/swing/plaf/BorderUIResource.java b/libjava/javax/swing/plaf/BorderUIResource.java
deleted file mode 100644
index 1bf854033b2..00000000000
--- a/libjava/javax/swing/plaf/BorderUIResource.java
+++ /dev/null
@@ -1,933 +0,0 @@
-/* BorderUIResource.java
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Font;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.io.Serializable;
-
-import javax.swing.Icon;
-import javax.swing.border.BevelBorder;
-import javax.swing.border.Border;
-import javax.swing.border.CompoundBorder;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.EtchedBorder;
-import javax.swing.border.LineBorder;
-import javax.swing.border.MatteBorder;
-import javax.swing.border.TitledBorder;
-
-/**
- * A wrapper for {@link javax.swing.border.Border} that also
- * implements the {@link UIResource} marker interface. This is useful
- * for implementing pluggable look-and-feels: When switching the
- * current LookAndFeel, only those borders are replaced that are
- * marked as {@link UIResource}. For this reason, a look-and-feel
- * should always install borders that implement
- * <code>UIResource</code>, such as the borders provided by this
- * class.
- *
- * @serial
- * @serialField delegate Border the <code>Border</code> wrapped
- *
- * @author Brian Jones (cbj@gnu.org)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class BorderUIResource
- extends Object
- implements Border, UIResource, Serializable
-{
- /**
- * Verified using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = -3440553684010079691L;
-
-
- /**
- * A shared instance of an {@link EtchedBorderUIResource}, or
- * <code>null</code> if the {@link #getEtchedBorderUIResource()}
- * method has not yet been called.
- */
- private static Border etchedBorderUIResource;
-
-
- /**
- * A shared instance of a {@link BevelBorderUIResource} whose
- * <code>bevelType</code> is {@link
- * javax.swing.border.BevelBorder#LOWERED}, or <code>null</code> if
- * the {@link #getLoweredBevelBorderUIResource()} has not yet been
- * called.
- */
- private static Border loweredBevelBorderUIResource;
-
-
- /**
- * A shared instance of a {@link BevelBorderUIResource} whose
- * <code>bevelType</code> is {@link
- * javax.swing.border.BevelBorder#RAISED}, or <code>null</code> if
- * the {@link #getRaisedBevelBorderUIResource()} has not yet been
- * called.
- */
- private static Border raisedBevelBorderUIResource;
-
-
- /**
- * A shared instance of a {@link LineBorderUIResource} for
- * a one-pixel thick black line, or <code>null</code> if
- * the {@link #getBlackLineBorderUIResource()} has not yet been
- * called.
- */
- private static Border blackLineBorderUIResource;
-
-
- /**
- * Returns a shared instance of an etched border which also
- * is marked as an {@link UIResource}.
- *
- * @see javax.swing.border.EtchedBorder
- */
- public static Border getEtchedBorderUIResource()
- {
- /* Swing is not designed to be thread-safe, so there is no
- * need to synchronize the access to the global variable.
- */
- if (etchedBorderUIResource == null)
- etchedBorderUIResource = new EtchedBorderUIResource();
- return etchedBorderUIResource;
- }
-
-
- /**
- * Returns a shared instance of {@link BevelBorderUIResource} whose
- * <code>bevelType</code> is {@link
- * javax.swing.border.BevelBorder#LOWERED}.
- *
- * @see javax.swing.border.BevelBorder
- */
- public static Border getLoweredBevelBorderUIResource()
- {
- /* Swing is not designed to be thread-safe, so there is no
- * need to synchronize the access to the global variable.
- */
- if (loweredBevelBorderUIResource == null)
- loweredBevelBorderUIResource = new BevelBorderUIResource(
- BevelBorder.LOWERED);
- return loweredBevelBorderUIResource;
- }
-
-
- /**
- * Returns a shared instance of {@link BevelBorderUIResource} whose
- * <code>bevelType</code> is {@link
- * javax.swing.border.BevelBorder#RAISED}.
- *
- * @see javax.swing.border.BevelBorder
- */
- public static Border getRaisedBevelBorderUIResource()
- {
- /* Swing is not designed to be thread-safe, so there is no
- * need to synchronize the access to the global variable.
- */
- if (raisedBevelBorderUIResource == null)
- raisedBevelBorderUIResource = new BevelBorderUIResource(
- BevelBorder.RAISED);
- return raisedBevelBorderUIResource;
- }
-
-
- /**
- * Returns a shared instance of {@link LineBorderUIResource} for
- * a black, one-pixel width border.
- *
- * @see javax.swing.border.LineBorder
- */
- public static Border getBlackLineBorderUIResource()
- {
- /* Swing is not designed to be thread-safe, so there is no
- * need to synchronize the access to the global variable.
- */
- if (blackLineBorderUIResource == null)
- blackLineBorderUIResource = new LineBorderUIResource(Color.black);
- return blackLineBorderUIResource;
- }
-
-
- /**
- * The wrapped border.
- */
- private Border delegate;
-
-
- /**
- * Constructs a <code>BorderUIResource</code> for wrapping
- * a <code>Border</code> object.
- *
- * @param delegate the border to be wrapped.
- */
- public BorderUIResource(Border delegate)
- {
- if (delegate == null)
- throw new IllegalArgumentException();
-
- this.delegate = delegate;
- }
-
-
- /**
- * Paints the border around an enclosed component by calling
- * the <code>paintBorder</code> method of the wrapped delegate.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- delegate.paintBorder(c, g, x, y, width, height);
- }
-
-
- /**
- * Measures the width of this border by calling the
- * <code>getBorderInsets</code> method of the wrapped
- * delegate.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- */
- public Insets getBorderInsets(Component c)
- {
- return delegate.getBorderInsets(c);
- }
-
-
- /**
- * Determines whether this border fills every pixel in its area
- * when painting by calling the <code>isBorderOpaque</code>
- * method of the wrapped delegate.
- *
- * @return <code>true</code> if the border is fully opaque, or
- * <code>false</code> if some pixels of the background
- * can shine through the border.
- */
- public boolean isBorderOpaque()
- {
- return delegate.isBorderOpaque();
- }
-
-
- /**
- * A {@link javax.swing.border.BevelBorder} that also implements the
- * {@link UIResource} marker interface. This is useful for
- * implementing pluggable look-and-feels: When switching the current
- * LookAndFeel, only those borders are replaced that are marked as
- * {@link UIResource}. For this reason, a look-and-feel should
- * always install borders that implement <code>UIResource</code>,
- * such as the borders provided by this class.
- *
- * @author Brian Jones (cbj@gnu.org)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class BevelBorderUIResource
- extends BevelBorder
- implements UIResource, Serializable
- {
- private static final long serialVersionUID = -1275542891108351642L;
-
- /**
- * Constructs a BevelBorderUIResource whose colors will be derived
- * from the background of the enclosed component. The background
- * color is retrieved each time the border is painted, so a border
- * constructed by this method will automatically reflect a change
- * to the component&#x2019;s background color.
- *
- * <p><img src="../border/doc-files/BevelBorder-1.png"
- * width="500" height="150"
- * alt="[An illustration showing raised and lowered BevelBorders]" /></p>
- *
- * @param bevelType the desired appearance of the border. The value
- * must be either {@link javax.swing.border.BevelBorder#RAISED}
- * or {@link javax.swing.border.BevelBorder#LOWERED}.
- *
- * @throws IllegalArgumentException if <code>bevelType</code> has
- * an unsupported value.
- */
- public BevelBorderUIResource(int bevelType)
- {
- super(bevelType);
- }
-
-
- /**
- * Constructs a BevelBorderUIResource given its appearance type
- * and two colors for its highlight and shadow.
- *
- * <p><img src="../border/doc-files/BevelBorder-2.png" width="500"
- * height="150" alt="[An illustration showing BevelBorders that were
- * constructed with this method]" /></p>
- *
- * @param bevelType the desired appearance of the border. The value
- * must be either {@link javax.swing.border.BevelBorder#RAISED}
- * or {@link javax.swing.border.BevelBorder#LOWERED}.
- *
- * @param highlight the color that will be used for the inner side
- * of the highlighted edges (top and left if if
- * <code>bevelType</code> is {@link
- * javax.swing.border.BevelBorder#RAISED}; bottom and right
- * otherwise). The color for the outer side is a brightened
- * version of this color.
- *
- * @param shadow the color that will be used for the outer side of
- * the shadowed edges (bottom and right if
- * <code>bevelType</code> is {@link
- * javax.swing.border.BevelBorder#RAISED}; top and left
- * otherwise). The color for the inner side is a brightened
- * version of this color.
- *
- * @throws IllegalArgumentException if <code>bevelType</code> has
- * an unsupported value.
- *
- * @throws NullPointerException if <code>highlight</code> or
- * <code>shadow</code> is <code>null</code>.
- */
- public BevelBorderUIResource(int bevelType,
- Color highlight,
- Color shadow)
- {
- super(bevelType, highlight, shadow);
- }
-
-
- /**
- * Constructs a BevelBorderUIResource given its appearance type
- * and all its colors.
- *
- * <p><img src="../border/doc-files/BevelBorder-3.png" width="500"
- * height="150" alt="[An illustration showing BevelBorders that
- * were constructed with this method]" /></p>
- *
- * @param bevelType the desired appearance of the border. The value
- * must be either {@link javax.swing.border.BevelBorder#RAISED}
- * or {@link javax.swing.border.BevelBorder#LOWERED}.
- *
- * @param highlightOuter the color that will be used for the outer
- * side of the highlighted edges (top and left if
- * <code>bevelType</code> is {@link
- * javax.swing.border.BevelBorder#RAISED}; bottom and right
- * otherwise).
- *
- * @param highlightInner the color that will be used for the inner
- * side of the highlighted edges.
- *
- * @param shadowOuter the color that will be used for the outer
- * side of the shadowed edges (bottom and right if
- * <code>bevelType</code> is {@link
- * javax.swing.border.BevelBorder#RAISED}; top and left
- * otherwise).
- *
- * @param shadowInner the color that will be used for the inner
- * side of the shadowed edges.
- *
- * @throws IllegalArgumentException if <code>bevelType</code> has
- * an unsupported value.
- *
- * @throws NullPointerException if one of the passed colors
- * is <code>null</code>.
- */
- public BevelBorderUIResource(int bevelType,
- Color highlightOuter,
- Color highlightInner,
- Color shadowOuter,
- Color shadowInner)
- {
- super(bevelType,
- highlightOuter, highlightInner,
- shadowOuter, shadowInner);
- }
- }
-
-
- /**
- * A {@link javax.swing.border.CompoundBorder} that also implements the
- * {@link UIResource} marker interface. This is useful for
- * implementing pluggable look-and-feels: When switching the current
- * LookAndFeel, only those borders are replaced that are marked as
- * {@link UIResource}. For this reason, a look-and-feel should
- * always install borders that implement <code>UIResource</code>,
- * such as the borders provided by this class.
- *
- * @author Brian Jones (cbj@gnu.org)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class CompoundBorderUIResource
- extends CompoundBorder
- implements UIResource, Serializable
- {
- private static final long serialVersionUID = 7550017084975167341L;
-
- /**
- * Constructs a CompoundBorderUIResource with the specified inside
- * and outside borders.
- *
- * @param outsideBorder the outside border, which is painted to the
- * outside of both <code>insideBorder</code> and the enclosed
- * component. It is acceptable to pass <code>null</code>, in
- * which case no outside border is painted.
- *
- * @param insideBorder the inside border, which is painted to
- * between <code>outsideBorder</code> and the enclosed
- * component. It is acceptable to pass <code>null</code>, in
- * which case no inside border is painted.
- */
- public CompoundBorderUIResource(Border outsideBorder,
- Border insideBorder)
- {
- super(outsideBorder, insideBorder);
- }
- }
-
-
- /**
- * An {@link javax.swing.border.EmptyBorder} that also implements the
- * {@link UIResource} marker interface. This is useful for
- * implementing pluggable look-and-feels: When switching the current
- * LookAndFeel, only those borders are replaced that are marked as
- * {@link UIResource}. For this reason, a look-and-feel should
- * always install borders that implement <code>UIResource</code>,
- * such as the borders provided by this class.
- *
- * <p><img src="../border/doc-files/EmptyBorder-1.png"
- * width="290" height="200"
- * alt="[An illustration of EmptyBorder]" /></p>
- *
- * @author Brian Jones (cbj@gnu.org)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class EmptyBorderUIResource
- extends EmptyBorder
- implements UIResource, Serializable
- {
- private static final long serialVersionUID = -4914187529340071708L;
-
- /**
- * Constructs an empty border given the number of pixels required
- * on each side.
- *
- * @param top the number of pixels that the border will need
- * for its top edge.
- *
- * @param left the number of pixels that the border will need
- * for its left edge.
- *
- * @param bottom the number of pixels that the border will need
- * for its bottom edge.
- *
- * @param right the number of pixels that the border will need
- * for its right edge.
- */
- public EmptyBorderUIResource(int top, int left, int bottom, int right)
- {
- super(top, left, bottom, right);
- }
-
-
- /**
- * Constructs an empty border given the number of pixels required
- * on each side, passed in an Insets object.
- *
- * @param insets the Insets for the new border.
- */
- public EmptyBorderUIResource(Insets insets)
- {
- super(insets);
- }
- }
-
-
- /**
- * An {@link javax.swing.border.EtchedBorder} that also implements the
- * {@link UIResource} marker interface. This is useful for
- * implementing pluggable look-and-feels: When switching the current
- * LookAndFeel, only those borders are replaced that are marked as
- * {@link UIResource}. For this reason, a look-and-feel should
- * always install borders that implement <code>UIResource</code>,
- * such as the borders provided by this class.
- *
- * <p><img src="../border/doc-files/EtchedBorder-1.png" width="500"
- * height="200" alt="[An illustration of the two EtchedBorder
- * variants]" /></p>
- *
- * @author Brian Jones (cbj@gnu.org)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class EtchedBorderUIResource
- extends EtchedBorder
- implements UIResource, Serializable
- {
- private static final long serialVersionUID = -8186391754165296656L;
-
- /**
- * Constructs an EtchedBorderUIResource that appears lowered into
- * the surface. The colors will be derived from the background
- * color of the enclosed Component when the border gets painted.
- */
- public EtchedBorderUIResource()
- {
- super();
- }
-
-
- /**
- * Constructs an EtchedBorderUIResource with the specified
- * appearance. The colors will be derived from the background
- * color of the enclosed Component when the border gets painted.
- *
- * <p><img src="../border/doc-files/EtchedBorder-1.png"
- * width="500" height="200" alt="[An illustration of the two
- * EtchedBorder variants]" /></p>
- *
- * @param etchType the desired appearance of the border. The value
- * must be either {@link javax.swing.border.EtchedBorder#RAISED}
- * or {@link javax.swing.border.EtchedBorder#LOWERED}.
- *
- * @throws IllegalArgumentException if <code>etchType</code> has
- * an unsupported value.
- */
- public EtchedBorderUIResource(int etchType)
- {
- super(etchType);
- }
-
-
- /**
- * Constructs a lowered EtchedBorderUIResource, explicitly
- * selecting the colors that will be used for highlight and
- * shadow.
- *
- * @param highlight the color that will be used for painting
- * the highlight part of the border.
- *
- * @param shadow the color that will be used for painting
- * the shadow part of the border.
- *
- * @see #EtchedBorderUIResource(int, Color, Color)
- */
- public EtchedBorderUIResource(Color highlight, Color shadow)
- {
- super(highlight, shadow);
- }
-
-
- /**
- * Constructs an EtchedBorderUIResource with the specified
- * appearance, explicitly selecting the colors that will be used
- * for highlight and shadow.
- *
- * <p><img src="../border/doc-files/EtchedBorder-2.png" width="500"
- * height="200" alt="[An illustration that shows which pixels get
- * painted in what color]" /></p>
- *
- * @param etchType the desired appearance of the border. The value
- * must be either {@link javax.swing.border.EtchedBorder#RAISED}
- * or {@link javax.swing.border.EtchedBorder#LOWERED}.
- *
- * @param highlight the color that will be used for painting
- * the highlight part of the border.
- *
- * @param shadow the color that will be used for painting
- * the shadow part of the border.
- *
- * @throws IllegalArgumentException if <code>etchType</code> has
- * an unsupported value.
- */
- public EtchedBorderUIResource(int etchType,
- Color highlight, Color shadow)
- {
- super(etchType, highlight, shadow);
- }
- }
-
-
- /**
- * A {@link javax.swing.border.LineBorder} that also implements the
- * {@link UIResource} marker interface. This is useful for
- * implementing pluggable look-and-feels: When switching the current
- * LookAndFeel, only those borders are replaced that are marked as
- * {@link UIResource}. For this reason, a look-and-feel should
- * always install borders that implement <code>UIResource</code>,
- * such as the borders provided by this class.
- *
- * <p><img src="../border/doc-files/LineBorder-1.png" width="500"
- * height="200" alt="[An illustration of two LineBorders]" /></p>
- *
- * @author Brian Jones (cbj@gnu.org)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class LineBorderUIResource
- extends LineBorder
- implements UIResource, Serializable
- {
- private static final long serialVersionUID = -6171232338180172310L;
-
- /**
- * Constructs a LineBorderUIResource given its color. The border
- * will be one pixel thick and have plain corners.
- *
- * @param color the color for drawing the border.
- */
- public LineBorderUIResource(Color color)
- {
- super(color);
- }
-
-
- /**
- * Constructs a LineBorder given its color and thickness. The
- * border will have plain corners.
- *
- * @param color the color for drawing the border.
- * @param thickness the width of the line in pixels.
- */
- public LineBorderUIResource(Color color, int thickness)
- {
- super(color, thickness);
- }
-
-
- /* Note: Since JDK1.3, javax.swing.border.LineBorder also has a
- * constructor which accepts a value for the roundedCorners
- * property. However, as of JDK1.4.1, the LineBorderUIResource
- * subclass does not have a corresponding constructor.
- *
- * A request for enhancing the Swing API has been filed with Sun:
- * http://developer.java.sun.com/developer/bugParade/bugs/4879999.html
- */
- }
-
-
- /**
- * A {@link javax.swing.border.MatteBorder} that also implements the
- * {@link UIResource} marker interface. This is useful for
- * implementing pluggable look-and-feels: When switching the current
- * LookAndFeel, only those borders are replaced that are marked as
- * {@link UIResource}. For this reason, a look-and-feel should
- * always install borders that implement <code>UIResource</code>,
- * such as the borders provided by this class.
- *
- * <p><img src="../border/doc-files/MatteBorder-1.png" width="500"
- * height="150" alt="[An illustration of two MatteBorders]" /></p>
- *
- * @author Brian Jones (cbj@gnu.org)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class MatteBorderUIResource
- extends MatteBorder
- implements UIResource, Serializable
- {
- private static final long serialVersionUID = -8107923147541851122L;
-
- /**
- * Constructs a MatteBorderUIResource given the width on each side
- * and a fill color.
- *
- * <p><img src="../border/doc-files/MatteBorder-2.png" width="500"
- * height="150" alt="[A picture of a MatteBorder made by this
- * constructor]" /></p>
- *
- * @param top the width of the border at its top edge.
- * @param left the width of the border at its left edge.
- * @param bottom the width of the border at its bottom edge.
- * @param right the width of the border at its right edge.
- * @param matteColor the color for filling the border.
- */
- public MatteBorderUIResource(int top, int left,
- int bottom, int right,
- Color color)
- {
- super(top, left, bottom, right, color);
- }
-
-
- /**
- * Constructs a MatteBorderUIResource given the width on each side
- * and an icon for tiling the border area.
- *
- * <p><img src="../border/doc-files/MatteBorder-4.png" width="500"
- * height="150" alt="[A picture of a MatteBorder made by this
- * constructor]" /></p>
- *
- * @param top the width of the border at its top edge.
- * @param left the width of the border at its left edge.
- * @param bottom the width of the border at its bottom edge.
- * @param right the width of the border at its right edge.
- * @param tileIcon an icon for tiling the border area.
- */
- public MatteBorderUIResource(int top, int left,
- int bottom, int right,
- Icon tileIcon)
- {
- super(top, left, bottom, right, tileIcon);
- }
-
-
- /**
- * Constructs a MatteBorderUIResource given an icon for tiling the
- * border area. The icon width is used for the border insets at
- * the left and right edge, the icon height for the top and bottom
- * edge.
- *
- * <p><img src="../border/doc-files/MatteBorder-6.png" width="500"
- * height="150" alt="[A picture of a MatteBorder made by this
- * constructor]" /></p>
- *
- * @param tileIcon an icon for tiling the border area.
- */
- public MatteBorderUIResource(Icon tileIcon)
- {
- super(tileIcon);
- }
- }
-
-
- /**
- * A {@link javax.swing.border.TitledBorder} that also implements the
- * {@link UIResource} marker interface. This is useful for
- * implementing pluggable look-and-feels: When switching the current
- * LookAndFeel, only those borders are replaced that are marked as
- * {@link UIResource}. For this reason, a look-and-feel should
- * always install borders that implement <code>UIResource</code>,
- * such as the borders provided by this class.
- *
- * @author Brian Jones (cbj@gnu.org)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class TitledBorderUIResource
- extends TitledBorder
- implements UIResource, Serializable
- {
- private static final long serialVersionUID = 7667113547406407427L;
-
- /**
- * Constructs a TitledBorderUIResource given the text of its title.
- *
- * @param title the title text, or <code>null</code> to use no
- * title text.
- */
- public TitledBorderUIResource(String title)
- {
- super(title);
- }
-
-
- /**
- * Constructs an initially untitled TitledBorderUIResource
- * given another border.
- *
- * @param border the border underneath the title, or
- * <code>null</code> to use a default from
- * the current look and feel.
- */
- public TitledBorderUIResource(Border border)
- {
- super(border);
- }
-
-
- /**
- * Constructs a TitledBorder given its border and title text.
- *
- * @param border the border underneath the title, or
- * <code>null</code> to use a default from
- * the current look and feel.
- *
- * @param title the title text, or <code>null</code>
- * to use no title text.
- */
- public TitledBorderUIResource(Border border, String title)
- {
- super(border, title);
- }
-
-
- /**
- * Constructs a TitledBorderUIResource given its border, title
- * text, horizontal alignment, and vertical position.
- *
- * @param border the border underneath the title, or
- * <code>null</code> to use a default
- * from the current look and feel.
- *
- * @param title the title text, or <code>null</code>
- * to use no title text.
- *
- * @param titleJustification the horizontal alignment of the title
- * text in relation to the border. The value must be one of
- * {@link javax.swing.border.TitledBorder#LEFT},
- * {@link javax.swing.border.TitledBorder#CENTER},
- * {@link javax.swing.border.TitledBorder#RIGHT},
- * {@link javax.swing.border.TitledBorder#LEADING},
- * {@link javax.swing.border.TitledBorder#TRAILING}, or
- * {@link javax.swing.border.TitledBorder#DEFAULT_JUSTIFICATION}.
- *
- * @param titlePosition the vertical position of the title text
- * in relation to the border. The value must be one of
- * {@link javax.swing.border.TitledBorder#ABOVE_TOP},
- * {@link javax.swing.border.TitledBorder#TOP},
- * {@link javax.swing.border.TitledBorder#BELOW_TOP},
- * {@link javax.swing.border.TitledBorder#ABOVE_BOTTOM},
- * {@link javax.swing.border.TitledBorder#BOTTOM},
- * {@link javax.swing.border.TitledBorder#BELOW_BOTTOM},
- * or {@link javax.swing.border.TitledBorder#DEFAULT_POSITION}.
- *
- * @throws IllegalArgumentException if <code>titleJustification</code>
- * or <code>titlePosition</code> have an unsupported value.
- */
- public TitledBorderUIResource(Border border, String title,
- int titleJustification,
- int titlePosition)
- {
- super(border, title, titleJustification, titlePosition);
- }
-
-
- /**
- * Constructs a TitledBorder given its border, title text,
- * horizontal alignment, vertical position, and font.
- *
- * @param border the border underneath the title, or
- * <code>null</code> to use a default
- * from the current look and feel.
- *
- * @param title the title text, or <code>null</code>
- * to use no title text.
- *
- * @param titleJustification the horizontal alignment of the title
- * text in relation to the border. The value must be one of
- * {@link javax.swing.border.TitledBorder#LEFT},
- * {@link javax.swing.border.TitledBorder#CENTER},
- * {@link javax.swing.border.TitledBorder#RIGHT},
- * {@link javax.swing.border.TitledBorder#LEADING},
- * {@link javax.swing.border.TitledBorder#TRAILING}, or
- * {@link javax.swing.border.TitledBorder#DEFAULT_JUSTIFICATION}.
- *
- * @param titlePosition the vertical position of the title text
- * in relation to the border. The value must be one of
- * {@link javax.swing.border.TitledBorder#ABOVE_TOP},
- * {@link javax.swing.border.TitledBorder#TOP},
- * {@link javax.swing.border.TitledBorder#BELOW_TOP},
- * {@link javax.swing.border.TitledBorder#ABOVE_BOTTOM},
- * {@link javax.swing.border.TitledBorder#BOTTOM},
- * {@link javax.swing.border.TitledBorder#BELOW_BOTTOM},
- * or {@link javax.swing.border.TitledBorder#DEFAULT_POSITION}.
- *
- * @param titleFont the font for the title text, or <code>null</code>
- * to use a default from the current look and feel.
- *
- * @throws IllegalArgumentException if <code>titleJustification</code>
- * or <code>titlePosition</code> have an unsupported value.
- */
- public TitledBorderUIResource(Border border, String title,
- int titleJustification,
- int titlePosition,
- Font titleFont)
- {
- super(border, title, titleJustification, titlePosition,
- titleFont);
- }
-
-
- /**
- * Constructs a TitledBorder given its border, title text,
- * horizontal alignment, vertical position, font, and color.
- *
- * @param border the border underneath the title, or
- * <code>null</code> to use a default
- * from the current look and feel.
- *
- * @param title the title text, or <code>null</code>
- * to use no title text.
- *
- * @param titleJustification the horizontal alignment of the title
- * text in relation to the border. The value must be one of
- * {@link javax.swing.border.TitledBorder#LEFT},
- * {@link javax.swing.border.TitledBorder#CENTER},
- * {@link javax.swing.border.TitledBorder#RIGHT},
- * {@link javax.swing.border.TitledBorder#LEADING},
- * {@link javax.swing.border.TitledBorder#TRAILING}, or
- * {@link javax.swing.border.TitledBorder#DEFAULT_JUSTIFICATION}.
- *
- * @param titlePosition the vertical position of the title text
- * in relation to the border. The value must be one of
- * {@link javax.swing.border.TitledBorder#ABOVE_TOP},
- * {@link javax.swing.border.TitledBorder#TOP},
- * {@link javax.swing.border.TitledBorder#BELOW_TOP},
- * {@link javax.swing.border.TitledBorder#ABOVE_BOTTOM},
- * {@link javax.swing.border.TitledBorder#BOTTOM},
- * {@link javax.swing.border.TitledBorder#BELOW_BOTTOM},
- * or {@link javax.swing.border.TitledBorder#DEFAULT_POSITION}.
- *
- * @param titleFont the font for the title text, or <code>null</code>
- * to use a default from the current look and feel.
- *
- * @param titleColor the color for the title text, or <code>null</code>
- * to use a default from the current look and feel.
- *
- * @throws IllegalArgumentException if <code>titleJustification</code>
- * or <code>titlePosition</code> have an unsupported value.
- */
- public TitledBorderUIResource(Border border, String title,
- int titleJustification, int titlePosition,
- Font titleFont, Color titleColor)
- {
- super(border, title, titleJustification, titlePosition,
- titleFont, titleColor);
- }
- }
-}
-
diff --git a/libjava/javax/swing/plaf/ButtonUI.java b/libjava/javax/swing/plaf/ButtonUI.java
deleted file mode 100644
index 197299e0c95..00000000000
--- a/libjava/javax/swing/plaf/ButtonUI.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ButtonUI.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JButton</code>.
- *
- * @see javax.swing.JButton
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ButtonUI
- extends ComponentUI
-{
-}
diff --git a/libjava/javax/swing/plaf/ColorChooserUI.java b/libjava/javax/swing/plaf/ColorChooserUI.java
deleted file mode 100644
index 68ffd916d21..00000000000
--- a/libjava/javax/swing/plaf/ColorChooserUI.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ColorChooserUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JColorChooser</code>.
- *
- * @see javax.swing.JColorChooser
- *
- * @author Andrew Selkirk
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ColorChooserUI
- extends ComponentUI
-{
- /**
- * Constructs a ColorChooserUI.
- */
- public ColorChooserUI()
- {
- /* The constructor does not do anything. */
- }
-}
-
diff --git a/libjava/javax/swing/plaf/ColorUIResource.java b/libjava/javax/swing/plaf/ColorUIResource.java
deleted file mode 100644
index 06d7236f1f2..00000000000
--- a/libjava/javax/swing/plaf/ColorUIResource.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* ColorUIResource.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Color;
-
-
-/**
- * A Color that is marked as <code>UIResource</code>, which indicates that
- * the color has been installed by a pluggable LookAndFeel. Such colors
- * are replaced when the LookAndFeel changes.
- *
- * @see java.awt.Color
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class ColorUIResource
- extends Color
- implements UIResource
-{
- /**
- * Constructs a <code>ColorUIResource</code> using the specified
- * red, green, and blue values, which must be given as integers in
- * the range of 0-255. The alpha channel value will default to 255,
- * meaning that the color is fully opaque.
- *
- * @param r the red intensity, which must be in the range [0 .. 255].
- * @param g the green intensity, which must be in the range [0 .. 255].
- * @param b the blue intensity, which must be in the range [0 .. 255].
- */
- public ColorUIResource(int r, int g, int b)
- {
- super(r, g, b);
- }
-
-
- /**
- * Consructs a <code>ColorUIResource</code> using the specified
- * RGB value. The blue value is in bits 0-7, green in bits 8-15, and
- * red in bits 16-23. The other bits are ignored. The alpha value is set
- * to 255, meaning that the color is fully opaque.
- *
- * @param rgb the rgb value, as discussed above.
- */
- public ColorUIResource(int rgb)
- {
- super(rgb);
- }
-
-
- /**
- * Constructs a <code>ColorUIResource</code> using the specified
- * red, green, and blue intensities, which must be given as floats in
- * the range of 0-1. The alpha channel value will default to 1.0f,
- * meaning that the color is fully opaque.
- *
- * @param r the red intensity, which must be in the range [0.0 .. 1.0].
- * @param g the green intensity, which must be in the range [0.0 .. 1.0].
- * @param b the blue intensity, which must be in the range [0.0 .. 1.0].
- */
- public ColorUIResource(float r, float g, float b)
- {
- super(r, g, b);
- }
-
-
- /**
- * Constructs a <code>ColorUIResource</code>, using the intensities
- * of another color.
- *
- * @param c the color whose intensities will be considered when
- * constructing this <code>ColorUIResource</code>.
- */
- public ColorUIResource(Color c)
- {
- super(c.getRGB());
- }
-}
diff --git a/libjava/javax/swing/plaf/ComboBoxUI.java b/libjava/javax/swing/plaf/ComboBoxUI.java
deleted file mode 100644
index 9498a48153a..00000000000
--- a/libjava/javax/swing/plaf/ComboBoxUI.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ComboBoxUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import javax.swing.JComboBox;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JButton</code>.
- *
- * @see javax.swing.JComboBox
- *
- * @author Andrew Selkirk
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ComboBoxUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>ComboBoxUI</code>.
- */
- public ComboBoxUI()
- {
- }
-
-
- /**
- * Sets the visibility of the popup button.
- *
- * @param c the <code>JComboBox</code> whose popup
- * is shown or hidden.
- *
- * @param visible <code>true</code> to show the popup, <code>false</code>
- * to hide it.
- */
- public abstract void setPopupVisible(JComboBox c, boolean visible);
-
-
- /**
- * Determines whether the popup button is currently visible.
- *
- * @param c the <code>JComboBox</code> whose popup visibility
- * is retrieved.
- *
- * @return <code>true</code> if the popup button is currently
- * visible, <code>false</code> otherwise.
- */
- public abstract boolean isPopupVisible(JComboBox c);
-
-
- /**
- * Determines whether the combo box can receive input focus.
- *
- * @param c <code>JComboBox</code> whose focus traversability
- * is to be retrieved.
- *
- * @returns <code>true</code> if <code>c</code> can receive
- * input focus, <code>false</code> otherwise.
- */
- public abstract boolean isFocusTraversable(JComboBox c);
-}
diff --git a/libjava/javax/swing/plaf/ComponentInputMapUIResource.java b/libjava/javax/swing/plaf/ComponentInputMapUIResource.java
deleted file mode 100644
index e1418710fb2..00000000000
--- a/libjava/javax/swing/plaf/ComponentInputMapUIResource.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ComponentInputMapUIResource.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import javax.swing.ComponentInputMap;
-import javax.swing.JComponent;
-
-
-/**
- * A <code>ComponentInputMap</code> that implements the {@link UIResource}
- * interface to indicate that it belongs to a pluggable
- * LookAndFeel.
- *
- * @see javax.swing.ComponentInputMap
- * @see javax.swing.InputMap
- *
- * @author Andrew Selkirk
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class ComponentInputMapUIResource
- extends ComponentInputMap
- implements UIResource
-{
- /**
- * Constructs a new <code>ComponentInputMapUIResource</code>.
- *
- * @param component the <code>JComponent</code> associated with
- * this <code>InputMap</code>.
- */
- public ComponentInputMapUIResource(JComponent component)
- {
- super(component);
- }
-}
-
diff --git a/libjava/javax/swing/plaf/ComponentUI.java b/libjava/javax/swing/plaf/ComponentUI.java
deleted file mode 100644
index 0e7680542f7..00000000000
--- a/libjava/javax/swing/plaf/ComponentUI.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/* ComponentUI.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Dimension;
-import java.awt.Graphics;
-
-import javax.accessibility.Accessible;
-import javax.swing.JComponent;
-
-/**
- * The abstract base class for all delegates that provide the
- * pluggable look and feel for Swing components. User applications
- * should not need to access this class; it is internal to Swing
- * and the look-and-feel implementations.
- *
- * <p><img src="doc-files/ComponentUI-1.png" width="700" height="550"
- * alt="[UML diagram illustrating the architecture for pluggable
- * look and feels]" /></p>
- *
- * <p>Components such as {@link javax.swing.JSlider} do not directly
- * implement operations related to the look and feel of the user
- * interface, such as painting or layout. Instead, they use a delegate
- * object for all such tasks. In the case of <code>JSlider</code>, the
- * user interface would be provided by some concrete subclass of
- * {@link javax.swing.plaf.SliderUI}.
- *
- * <p>Soon after its creation, a <code>ComponentUI</code> will be sent
- * an {@link #installUI} message. The <code>ComponentUI</code> will
- * react by setting properties such as the border or the background
- * color of the <code>JComponent</code> for which it provides its
- * services. Soon before the end of its lifecycle, the
- * <code>ComponentUI</code> will receive an {@link #uninstallUI}
- * message, at which time the <code>ComponentUI</code> is expected to
- * undo any changes.</p>
- *
- * <p>Note that the <code>ui</code> of a <code>JComponent</code>
- * changes whenever the user switches between look and feels. For
- * example, the <code>ui</code> property of a <code>JSlider</code>
- * could change from an instance of <code>MetalSliderUI</code> to an
- * instance of <code>FooSliderUI</code>. This switch can happen at any
- * time, but it will always be performed from inside the Swing thread.</p>
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ComponentUI
-{
- /**
- * Constructs a new UI delegate.
- */
- public ComponentUI()
- {
- }
-
-
- /**
- * Sets up the specified component so it conforms the the design
- * guidelines of the implemented look and feel. When the look and
- * feel changes, a <code>ComponentUI</code> delegate is created.
- * The delegate object then receives an <code>installUI</code>
- * message.
- *
- * <p>This method should perform the following tasks:</p>
- *
- * <ul>
- * <li>Set visual properties such as borders, fonts, colors, or
- * icons. However, no change should be performed for those
- * properties whose values have been directly set by the client
- * application. To allow the distinction, LookAndFeels are expected
- * to use values that implement the {@link UIResource} marker
- * interface, such as {@link BorderUIResource} or {@link
- * ColorUIResource}.</li>
- * <li>If necessary, install a {@link java.awt.LayoutManager}.</li>
- * <li>Embed custom sub-components. For instance, the UI delegate
- * for a {@link javax.swing.JSplitPane} might install a special
- * component for the divider.</li>
- * <li>Register event listeners.</li>
- * <li>Set up properties related to keyborad navigation, such as
- * mnemonics or focus traversal policies.</li>
- * </ul>
- *
- * @param c the component for which this delegate will provide
- * services.
- *
- * @see #uninstallUI
- * @see javax.swing.JComponent#setUI
- * @see javax.swing.JComponent#updateUI
- */
- public void installUI(JComponent c)
- {
- // The default implementation does not change any properties.
- }
-
-
- /**
- * Puts the specified component into the state it had before
- * {@link #installUI} was called.
- *
- * @param c the component for which this delegate has provided
- * services.
- *
- * @see #installUI
- * @see javax.swing.JComponent#setUI
- * @see javax.swing.JComponent#updateUI
- */
- public void uninstallUI(JComponent c)
- {
- // The default implementation does not change any properties.
- }
-
-
- /**
- * Paints the component according to the design guidelines
- * of the look and feel. Most subclasses will want to override
- * this method.
- *
- * @param g the graphics for painting.
- *
- * @param c the component for which this delegate performs
- * services.
- */
- public void paint(Graphics g, JComponent c)
- {
- }
-
-
- /**
- * Fills the specified component with its background color
- * (unless the <code>opaque</code> property is <code>false</code>)
- * before calling {@link #paint}.
- *
- * <p>It is unlikely that a subclass needs to override this method.
- * The actual rendering should be performed by the {@link #paint}
- * method.
- *
- * @param g the graphics for painting.
- *
- * @param c the component for which this delegate performs
- * services.
- *
- * @see #paint
- * @see javax.swing.JComponent#paintComponent
- */
- public void update(Graphics g, JComponent c)
- {
- if (c.isOpaque())
- {
- g.setColor(c.getBackground());
- g.fillRect(0, 0, c.getWidth(), c.getHeight());
- }
- paint(g, c);
- }
-
-
- /**
- * Determines the preferred size of a component. The default
- * implementation returns <code>null</code>, which means that
- * <code>c</code>&#x2019;s layout manager should be asked to
- * calculate the preferred size.
- *
- * @param c the component for which this delegate performs services.
- *
- * @return the preferred size, or <code>null</code> to indicate that
- * <code>c</code>&#x2019;s layout manager should be asked
- * for the preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- return null;
- }
-
-
- /**
- * Determines the minimum size of a component. The default
- * implementation calls {@link #getPreferredSize}, but subclasses
- * might want to override this.
- *
- * @param c the component for which this delegate performs services.
- *
- * @return the minimum size, or <code>null</code> to indicate that
- * <code>c</code>&#x2019;s layout manager should be asked
- * to calculate the minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
-
- /**
- * Determines the maximum size of a component. The default
- * implementation calls {@link #getPreferredSize}, but subclasses
- * might want to override this.
- *
- * @param c the component for which this delegate performs services.
- *
- * @return the maximum size, or <code>null</code> to indicate that
- * <code>c</code>&#x2019;s layout manager should be asked
- * to calculate the maximum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
-
- /**
- * Determines whether a click into the component at a specified
- * location is considered as having hit the component. The default
- * implementation checks whether the point falls into the
- * component&#x2019;s bounding rectangle. Some subclasses might want
- * to override this, for example in the case of a rounded button.
- *
- * @param c the component for which this delegate performs services.
- *
- * @param x the x coordinate of the point, relative to the local
- * coordinate system of the component. Zero would be be
- * component&#x2019;s left edge, irrespective of the location
- * inside its parent.
- *
- * @param y the y coordinate of the point, relative to the local
- * coordinate system of the component. Zero would be be
- * component&#x2019;s top edge, irrespective of the location
- * inside its parent.
- */
- public boolean contains(JComponent c, int x, int y)
- {
- /* JComponent.contains calls the ui delegate for hit
- * testing. Therefore, endless mutual recursion would result if we
- * called c.contains(x, y) here.
- *
- * The previous Classpath implementation called the deprecated
- * method java.awt.Component.inside. In the Sun implementation, it
- * can be observed that inside, other than contains, does not call
- * the ui delegate. But that inside() behaves different to
- * contains() clearly is in violation of the method contract, and
- * it is not something that a good implementation should rely upon
- * -- even if Classpath ends up being forced to replicate this
- * apparent bug of the Sun implementation.
- */
- return (x >= 0) && (x < c.getWidth())
- && (y >= 0) && (y < c.getHeight());
- }
-
-
- /**
- * Creates a delegate object for the specified component. Users
- * should use the <code>createUI</code> method of a suitable
- * subclass. The implementation of <code>ComponentUI</code>
- * always throws an error.
- *
- * @param c the component for which a UI delegate is requested.
- */
- public static ComponentUI createUI(JComponent c)
- {
- throw new Error(
- "javax.swing.plaf.ComponentUI does not implement createUI; call "
- + "createUI on a subclass.");
- }
-
-
- /**
- * Counts the number of accessible children in the component. The
- * default implementation delegates the inquiry to the {@link
- * javax.accessibility.AccessibleContext} of <code>c</code>.
- *
- * @param c the component whose accessible children
- * are to be counted.
- */
- public int getAccessibleChildrenCount(JComponent c)
- {
- return c.getAccessibleContext().getAccessibleChildrenCount();
- }
-
-
- /**
- * Returns the specified accessible child of the component. The
- * default implementation delegates the inquiry to the {@link
- * javax.accessibility.AccessibleContext} of <code>c</code>.
- *
- * @param i the index of the accessible child, starting at zero.
- *
- * @param c the component whose <code>i</code>-th accessible child
- * is requested.
- */
- public Accessible getAccessibleChild(JComponent c, int i)
- {
- return c.getAccessibleContext().getAccessibleChild(i);
- }
-}
diff --git a/libjava/javax/swing/plaf/DesktopIconUI.java b/libjava/javax/swing/plaf/DesktopIconUI.java
deleted file mode 100644
index 2e44088cadd..00000000000
--- a/libjava/javax/swing/plaf/DesktopIconUI.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* DesktopIconUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a desktop icon.
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class DesktopIconUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>DesktopIconUI</code>.
- */
- public DesktopIconUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/DesktopPaneUI.java b/libjava/javax/swing/plaf/DesktopPaneUI.java
deleted file mode 100644
index de553eaf4de..00000000000
--- a/libjava/javax/swing/plaf/DesktopPaneUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* DesktopPaneUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JDesktopPane</code>.
- *
- * @see javax.swing.JDesktopPane
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class DesktopPaneUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>DesktopPaneUI</code>.
- */
- public DesktopPaneUI()
- {
- }
-}
-
diff --git a/libjava/javax/swing/plaf/DimensionUIResource.java b/libjava/javax/swing/plaf/DimensionUIResource.java
deleted file mode 100644
index 63c6838c4d1..00000000000
--- a/libjava/javax/swing/plaf/DimensionUIResource.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* DimensionUIResource.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Dimension;
-
-/**
- * A Dimension that is marked as <code>UIResource</code>, which
- * indicates that it has been installed by a pluggable
- * LookAndFeel. Such dimensions are replaced when the LookAndFeel
- * changes.
- *
- * @see java.awt.Dimension
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class DimensionUIResource
- extends Dimension
- implements UIResource
-{
- /**
- * Constructs a new DimensionUIResource, given its width and height.
- *
- * @param width the width in pixels.
- * @param height the height in pixels.
- */
- public DimensionUIResource(int width, int height)
- {
- super(width, height);
- }
-}
diff --git a/libjava/javax/swing/plaf/FileChooserUI.java b/libjava/javax/swing/plaf/FileChooserUI.java
deleted file mode 100644
index 87847c44fe1..00000000000
--- a/libjava/javax/swing/plaf/FileChooserUI.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/* FileChooserUI.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.io.File;
-
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-import javax.swing.filechooser.FileView;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JFileChooser</code>.
- *
- * @see javax.swing.JFileChooser
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class FileChooserUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>FileChooserUI</code>.
- */
- public FileChooserUI()
- {
- }
-
-
- /**
- * Returns a <code>FileFilter</code> that accepts every file. While
- * the filtering itself is not specific to any look and feel, the
- * text returned by <code>FileFilter.getDescription()</code> need
- * not be the same across all look and feels.
- *
- * @param chooser the <code>JFileChooser</code> for which
- * a <code>FileFilter</code> is requested.
- *
- * @see javax.swing.JFileChooser#getAcceptAllFileFilter
- * @see javax.swing.filechooser.FileFilter#getDescription
- */
- public abstract FileFilter getAcceptAllFileFilter(JFileChooser chooser);
-
-
- /**
- * Returns a view to a file, which is able to retrieve its name,
- * icon, and other properties that are relevant for presenting
- * the file to the user.
- *
- * @param chooser the <code>JFileChooser</code> for which
- * a <code>FileFilter</code> is requested.
- */
- public abstract FileView getFileView(JFileChooser chooser);
-
-
- /**
- * Determines which text is appropriate for the approve button
- * according to the design guidelines of the implemented
- * look and feel.
- *
- * @param chooser the <code>JFileChooser</code> whose
- * button text is requested.
- *
- * @see javax.swing.JFileChoose#getApproveButtonText
- */
- public abstract String getApproveButtonText(JFileChooser chooser);
-
-
- /**
- * Determines which text is appropriate for the title bar of a
- * <code>JFileChooser</code> according to the design guidelines of
- * the implemented look and feel.
- *
- * @param chooser the <code>JFileChooser</code> whose
- * dialog title is requested.
- *
- * @see javax.swing.JFileChoose#getDialogtitle
- */
- public abstract String getDialogTitle(JFileChooser chooser);
-
-
- /**
- * Refreshes the currently displayed directory.
- *
- * @param chooser the <code>JFileChooser</code> whose
- * dialog title needs re-scanning.
- */
- public abstract void rescanCurrentDirectory(JFileChooser chooser);
-
-
- /**
- * Ensures that a specified file is visible in the
- * <code>JFileChooser</code>
- *
- * @param chooser the <code>JFileChooser</code> that
- * should display the file <code>file</code>.
- *
- * @param file the file that needs to be made visible.
- */
- public abstract void ensureFileIsVisible(JFileChooser chooser, File file);
-}
diff --git a/libjava/javax/swing/plaf/FontUIResource.java b/libjava/javax/swing/plaf/FontUIResource.java
deleted file mode 100644
index 1c1731048e8..00000000000
--- a/libjava/javax/swing/plaf/FontUIResource.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* FontUIResource.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Font;
-
-
-/**
- * A font that is marked as <code>UIResource</code>, which
- * indicates that it has been installed by a pluggable
- * LookAndFeel. Such dimensions are replaced when the LookAndFeel
- * changes.
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class FontUIResource
- extends Font
- implements UIResource
-{
- /**
- * Constructs a new <code>FontUIResource</code> given
- * the name, style and size of the font.
- *
- * @param name the name of the font. A number of
- * &#x201c;logical&#x201d; names are supported by any Java
- * implementation. These are
- * <code>&#x201c;Dialog&#x201d;</code>,
- * <code>&#x201c;DialogInput&#x201d;</code>,
- * <code>&#x201c;Monospaced&#x201d;</code>,
- * <code>&#x201c;Serif&#x201d;</code>, and
- * <code>&#x201c;SansSerif&#x201d;</code>.
- *
- * @param style the style of the font, for instance {@link
- * java.awt.Font#BOLD} or {@link java.awt.Font#PLAIN}.
- *
- * @param size the size of the font in typographic points, for
- * instance 10, 12 or 13. Designers of LookAndFeels should be
- * aware that some languages (like Japanese and Chinese) have
- * glyphs that are too complex to be legible at small point
- * sizes.
- */
- public FontUIResource(String name, int style, int size)
- {
- super(name, style, size);
- }
-
-
- /**
- * Constructs a new <code>FontUIResource</code> given
- * an existing font.
- *
- * @param f the font that serves as a template.
- */
- public FontUIResource(Font f)
- {
- /* This implementation will get rid of many font properties,
- * such as skewing, values of multiple master design axes,
- * etc., unless they get encoded into the name. It probably
- * is not a problem for LookAndFeels because user interfaces
- * are usually not very advanced with respect to typography.
- */
- super(f.getName(), f.getStyle(), f.getSize());
- }
-}
diff --git a/libjava/javax/swing/plaf/IconUIResource.java b/libjava/javax/swing/plaf/IconUIResource.java
deleted file mode 100644
index 1b09ed31f39..00000000000
--- a/libjava/javax/swing/plaf/IconUIResource.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/* IconUIResource.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Component;
-import java.awt.Graphics;
-import java.io.Serializable;
-
-import javax.swing.Icon;
-
-/**
- * An icon that is marked as <code>UIResource</code>, which
- * indicates that it has been installed by a pluggable
- * LookAndFeel. Such icons are replaced when the LookAndFeel
- * changes.
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class IconUIResource
- implements Icon, UIResource, Serializable
-{
- /**
- * Verified using the <code>serialver</code> tool of Sun JDK 1.4.1_01
- * on GNU/Linux 2.4.18.
- */
- static final long serialVersionUID = 3327049506004830542L;
-
-
- /**
- * The icon that is wrapped by this <code>IconUIResource</code>.
- */
- private Icon delegate;
-
-
- /**
- * Constructs a <code>IconUIResource</code> that wraps another
- * icon. All messages are forwarded to the delegate icon.
- *
- * @param delegate the icon that is wrapped by this
- * <code>IconUIResource</code>.
- */
- public IconUIResource(Icon delegate)
- {
- this.delegate = delegate;
- }
-
-
- /**
- * Paints the icon by asking the delegate icon to paint itself.
- *
- * @param c the Component whose icon is being painted. Some icons
- * use this argument to retrieve properties like the
- * background color.
- *
- * @param g the graphics into which the icon will be painted.
- *
- * @param x the horizontal position of the icon.
- *
- * @param y the vertical position of the icon.
- */
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- delegate.paintIcon(c, g, x, y);
- }
-
-
- /**
- * Returns the width of the icon in pixels. The implementation
- * determines and returns the width of the delegate icon.
- */
- public int getIconWidth()
- {
- return delegate.getIconWidth();
- }
-
-
- /**
- * Returns the height of the icon in pixels. The implementation
- * determines and returns the height of the delegate icon.
- */
- public int getIconHeight()
- {
- return delegate.getIconHeight();
- }
-}
diff --git a/libjava/javax/swing/plaf/InputMapUIResource.java b/libjava/javax/swing/plaf/InputMapUIResource.java
deleted file mode 100644
index ae032e51fa8..00000000000
--- a/libjava/javax/swing/plaf/InputMapUIResource.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* InputMapUIResource.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import javax.swing.InputMap;
-
-
-/**
- * An <code>InputMap</code> that is marked as <code>UIResource</code>,
- * which indicates that it has been installed by a pluggable
- * LookAndFeel. Such dimensions are replaced when the LookAndFeel
- * changes.
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class InputMapUIResource
- extends InputMap
- implements UIResource
-{
- /**
- * Constructs a new <code>InputMapUIResource</code>.
- */
- public InputMapUIResource()
- {
- }
-}
-
diff --git a/libjava/javax/swing/plaf/InsetsUIResource.java b/libjava/javax/swing/plaf/InsetsUIResource.java
deleted file mode 100644
index 755d8add1b2..00000000000
--- a/libjava/javax/swing/plaf/InsetsUIResource.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* InsetsUIResource.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Insets;
-import java.io.Serializable;
-
-
-/**
- * An <code>Insets</code> that is marked as <code>UIResource</code>,
- * which indicates that it has been installed by a pluggable
- * LookAndFeel. Such insets are replaced when the LookAndFeel changes.
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class InsetsUIResource
- extends Insets
- implements Cloneable, UIResource, Serializable
-{
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = 5622110143266315421L;
-
-
- /**
- * Constructs a new <code>InsetsUIResource</code> given the
- * inset at each edge.
- *
- * @param top the inset at the top, in pixels.
- * @param left the inset at the left, in pixels.
- * @param bottom the inset at the bottom, in pixels.
- * @param right the inset at the right, in pixels.
- */
- public InsetsUIResource(int top, int left, int bottom, int right)
- {
- super(top, left, bottom, right);
- }
-}
diff --git a/libjava/javax/swing/plaf/InternalFrameUI.java b/libjava/javax/swing/plaf/InternalFrameUI.java
deleted file mode 100644
index fd1e3374c13..00000000000
--- a/libjava/javax/swing/plaf/InternalFrameUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* InternalFrameUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JInternalFrame</code>.
- *
- * @see javax.swing.JInternalFrame
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class InternalFrameUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>InternalFrameUI</code>.
- */
- public InternalFrameUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/LabelUI.java b/libjava/javax/swing/plaf/LabelUI.java
deleted file mode 100644
index 8fc1d711b0e..00000000000
--- a/libjava/javax/swing/plaf/LabelUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* LabelUI.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JLabel</code>.
- *
- * @see javax.swing.JLabel
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class LabelUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>LabelUI</code>.
- */
- public LabelUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/ListUI.java b/libjava/javax/swing/plaf/ListUI.java
deleted file mode 100644
index 2385332ebd5..00000000000
--- a/libjava/javax/swing/plaf/ListUI.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* ListUI.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Point;
-import java.awt.Rectangle;
-
-import javax.swing.JList;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JList</code>.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ListUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>ListUI</code>.
- */
- public ListUI()
- {
- }
-
-
- /**
- * Determines the cell index which is the closest to the specified
- * location. The find out whether the returned cell actually
- * contains the location, the caller should also use {@link
- * #getCellBounds}.
- *
- * @param list the <code>JList</code> for which this delegate object
- * provides the pluggable user interface.
- *
- * @param location a point in the <code>JList</code> coordinate
- * system.
- *
- * @return the index of the closest cell, or -1 if the list model
- * is empty.
- */
- public abstract int locationToIndex(JList index, Point location);
-
-
- /**
- * Determines the location of the specified cell.
- *
- * @param list the <code>JList</code> for which this delegate object
- * provides the pluggable user interface.
- *
- * @param index the zero-based index of the cell whose location shall be
- * determined.
- *
- * @return the position of the top left corner of the cell in the
- * <code>JList</code> coordinate system, or <code>null</code>
- * if <code>cell</code> does not designate a valid cell.
- */
- public abstract Point indexToLocation(JList list, int index);
-
-
- /**
- * Determines the bounding box of the rectangle spanned by
- * two list indices.
- *
- * @param list the <code>JList</code> for which this delegate object
- * provides the pluggable user interface.
- *
- * @param index1 the zero-based index of the first cell.
- *
- * @param index2 the zero-based index of the second cell.
- *
- * @return the spanned rectangle, or <code>null</code> if either
- * <code>index1</code> or <code>index2</code> does not
- * designate a valid cell.
- */
- public abstract Rectangle getCellBounds(JList list,
- int index1, int index2);
-}
diff --git a/libjava/javax/swing/plaf/MenuBarUI.java b/libjava/javax/swing/plaf/MenuBarUI.java
deleted file mode 100644
index 8835571ac75..00000000000
--- a/libjava/javax/swing/plaf/MenuBarUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* MenuBarUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JMenuBar</code>.
- *
- * @see javax.swing.JMenuBar
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class MenuBarUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>MenuBarUI</code>.
- */
- public MenuBarUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/MenuItemUI.java b/libjava/javax/swing/plaf/MenuItemUI.java
deleted file mode 100644
index 31d73194a18..00000000000
--- a/libjava/javax/swing/plaf/MenuItemUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* MenuItemUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JMenuItem</code>.
- *
- * @see javax.swing.JMenuItem
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class MenuItemUI
- extends ButtonUI
-{
- /**
- * Constructs a new <code>MenuItemUI</code>.
- */
- public MenuItemUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/OptionPaneUI.java b/libjava/javax/swing/plaf/OptionPaneUI.java
deleted file mode 100644
index 13d1caa6ac8..00000000000
--- a/libjava/javax/swing/plaf/OptionPaneUI.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* OptionPaneUI.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import javax.swing.JOptionPane;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JOptionPane</code>.
- *
- * @see javax.swing.JOptionPane
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class OptionPaneUI
- extends ComponentUI
-{
- /**
- * Gives keyboard input focus to the component that represents
- * the default value.
- *
- * @param pane the <code>JOptionPane</code> for which this delegate
- * object provides the pluggable user interface.
- */
- public abstract void selectInitialValue(JOptionPane pane);
-
-
- /**
- * Determines whether the user has provided custom components
- * for the options or the message.
- *
- * @param pane the <code>JOptionPane</code> for which this delegate
- * object provides the pluggable user interface.
- *
- * @return <code>true</code> if the user has supplied any custom
- * components; <code>false</code> if all components are
- * provided by Swing or a LookAndFeel.
- */
- public abstract boolean containsCustomComponents(JOptionPane pane);
-}
diff --git a/libjava/javax/swing/plaf/PanelUI.java b/libjava/javax/swing/plaf/PanelUI.java
deleted file mode 100644
index b1171b80d30..00000000000
--- a/libjava/javax/swing/plaf/PanelUI.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* PanelUI.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JPanel</code>.
- *
- * @see javax.swing.JPanel
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class PanelUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>PanelUI</code>.
- */
- public PanelUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/PopupMenuUI.java b/libjava/javax/swing/plaf/PopupMenuUI.java
deleted file mode 100644
index c70ad2a4e9b..00000000000
--- a/libjava/javax/swing/plaf/PopupMenuUI.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* PopupMenuUI.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.event.MouseEvent;
-
-import javax.swing.JPopupMenu;
-import javax.swing.Popup;
-import javax.swing.PopupFactory;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JPopupMenu</code>.
- *
- * @see javax.swing.JPopupMenu
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class PopupMenuUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>PopupMenuUI</code>.
- */
- public PopupMenuUI()
- {
- }
-
-
- /**
- * Tests whether or not a mouse event triggers a popup menu.
- *
- * <p>The default implementation calls
- * <code>event.isPopupTrigger()</code>, which checks for the gesture
- * that is common for the platform on which the application runs. If
- * a look and feel wants to employ non-standard conventions for
- * triggering a popup menu, it can override this method.
- *
- * @param event the event to check.
- *
- * @return <code>true</code> if the event triggers a popup menu;
- * <code>false</code> otherwise.
- *
- * @since 1.3
- */
- public boolean isPopupTrigger(MouseEvent event)
- {
- return event.isPopupTrigger();
- }
-
-
- /**
- * Creates a <code>Popup</code> for displaying the popup menu. The
- * default implementation uses the {@link javax.swing.PopupFactory}
- * for retrieving a suitable <code>Popup</code>, but subclasses
- * might want to override this method if a LookAndFeel needs special
- * Popups.
- *
- * @param popup the <code>JPopupMenu</code> for whose display
- * a <code>Popup</code> is needed.
- *
- * @param x the horizontal position where the popup will be
- * displayed.
- *
- * @param y the vertical position where the popup will be
- * displayed.
- *
- * @return a <code>Popup</code> for showing and hiding
- * the menu.
- *
- * @since 1.4
- */
- public Popup getPopup(JPopupMenu popup, int x, int y)
- {
- return PopupFactory.getSharedInstance().getPopup(
- /* origin/owner of the popup */ popup.getInvoker(),
- /* contents */ popup,
- x, y);
- }
-}
diff --git a/libjava/javax/swing/plaf/ProgressBarUI.java b/libjava/javax/swing/plaf/ProgressBarUI.java
deleted file mode 100644
index 79c1b95a34a..00000000000
--- a/libjava/javax/swing/plaf/ProgressBarUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ProgressBarUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JProgressBar</code>.
- *
- * @see javax.swing.JProgressBar
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ProgressBarUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>ProgressBarUI</code>.
- */
- public ProgressBarUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/RootPaneUI.java b/libjava/javax/swing/plaf/RootPaneUI.java
deleted file mode 100644
index ff7d0a6e78a..00000000000
--- a/libjava/javax/swing/plaf/RootPaneUI.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* RootPaneUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JRootPane</code>.
- *
- * @see javax.swing.JRootPane
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class RootPaneUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>RootPaneUI</code>.
- */
- public RootPaneUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/ScrollBarUI.java b/libjava/javax/swing/plaf/ScrollBarUI.java
deleted file mode 100644
index 3cad3932720..00000000000
--- a/libjava/javax/swing/plaf/ScrollBarUI.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* ScrollBarUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JScrollBar</code>.
- *
- * @see javax.swing.JScrollBar
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ScrollBarUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>ScrollBarUI</code>.
- */
- public ScrollBarUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/ScrollPaneUI.java b/libjava/javax/swing/plaf/ScrollPaneUI.java
deleted file mode 100644
index 14d2ac61ef2..00000000000
--- a/libjava/javax/swing/plaf/ScrollPaneUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ScrollPaneUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JScrollPane</code>.
- *
- * @see javax.swing.JScrollPane
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ScrollPaneUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>ScrollPaneUI</code>.
- */
- public ScrollPaneUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/SeparatorUI.java b/libjava/javax/swing/plaf/SeparatorUI.java
deleted file mode 100644
index 6855bd0357e..00000000000
--- a/libjava/javax/swing/plaf/SeparatorUI.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* SeparatorUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JSeparator</code>.
- *
- * @see javax.swing.JSeparator
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class SeparatorUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>SeparatorUI</code>.
- */
- public SeparatorUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/SliderUI.java b/libjava/javax/swing/plaf/SliderUI.java
deleted file mode 100644
index 775f19620a8..00000000000
--- a/libjava/javax/swing/plaf/SliderUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* SliderUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JSlider</code>.
- *
- * @see javax.swing.JSlider
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class SliderUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>SliderUI</code>.
- */
- public SliderUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/SpinnerUI.java b/libjava/javax/swing/plaf/SpinnerUI.java
deleted file mode 100644
index fb4a3b13a93..00000000000
--- a/libjava/javax/swing/plaf/SpinnerUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* SpinnerUI.java --
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JSpinner</code>.
- *
- * @since 1.4
- * @see javax.swing.JSpinner
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class SpinnerUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>SpinnerUI</code>.
- */
- public SpinnerUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/SplitPaneUI.java b/libjava/javax/swing/plaf/SplitPaneUI.java
deleted file mode 100644
index ea9af2b1716..00000000000
--- a/libjava/javax/swing/plaf/SplitPaneUI.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* SplitPaneUI.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Graphics;
-
-import javax.swing.JSplitPane;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JSplitPane</code>.
- *
- * @see javax.swing.JSplitPane
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class SplitPaneUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>SplitPaneUI</code>.
- */
- public SplitPaneUI()
- {
- }
-
-
- /**
- * Moves the divider to the location which best respects
- * the preferred sizes of the children.
- *
- * @param pane the <code>JSplitPane</code> for thich this
- * delegate provides the look and feel.
- */
- public abstract void resetToPreferredSizes(JSplitPane pane);
-
-
- /**
- * Moves the divider to the specified location.
- *
- * @param pane the <code>JSplitPane</code> for thich this
- * delegate provides the look and feel.
- *
- * @param location the new location of the divider.
- */
- public abstract void setDividerLocation(JSplitPane pane,
- int location);
-
-
- /**
- * Determines the current location of the divider.
- *
- * @param pane the <code>JSplitPane</code> for thich this
- * delegate provides the look and feel.
- *
- * @return the current location of the divider.
- */
- public abstract int getDividerLocation(JSplitPane pane);
-
-
- /**
- * Determines the minimum location of the divider.
- *
- * @param pane the <code>JSplitPane</code> for thich this
- * delegate provides the look and feel.
- *
- * @return the leftmost (or topmost) possible location
- * of the divider.
- */
- public abstract int getMinimumDividerLocation(JSplitPane pane);
-
-
- /**
- * Determines the maximum location of the divider.
- *
- * @param pane the <code>JSplitPane</code> for thich this
- * delegate provides the look and feel.
- *
- * @return the bottommost (or rightmost) possible location
- * of the divider.
- */
- public abstract int getMaximumDividerLocation(JSplitPane pane);
-
-
- /**
- * Called by the <code>JSplitPane</code> after it has finished
- * painting its children.
- *
- * @param pane the <code>JSplitPane</code> for thich this
- * delegate provides the look and feel.
- *
- * @param g the Graphics used for painting.
- */
- public abstract void finishedPaintingChildren(JSplitPane pane,
- Graphics g);
-}
diff --git a/libjava/javax/swing/plaf/TabbedPaneUI.java b/libjava/javax/swing/plaf/TabbedPaneUI.java
deleted file mode 100644
index 6ab823b50a8..00000000000
--- a/libjava/javax/swing/plaf/TabbedPaneUI.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/* TabbedPaneUI.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Rectangle;
-
-import javax.swing.JTabbedPane;
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JTabbedPane</code>.
- *
- * @see javax.swing.JTabbedPane
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class TabbedPaneUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>TabbedPaneUI</code>.
- */
- public TabbedPaneUI()
- {
- }
-
-
- /**
- * Determines which tab lies at a given position.
- *
- * @param pane the <code>JTabbedPane</code> for which this
- * delegate object provides the user interface.
- *
- * @param x the horizontal position, where zero is the left
- * edge of <code>pane</code>.
- *
- * @param y the vertical position, where zero is the top
- * edge of <code>pane</code>.
- *
- * @return the zero-based index of the tab, or -1 if no
- * tab is at the specified position.
- */
- public abstract int tabForCoordinate(JTabbedPane pane,
- int x, int y);
-
-
- /**
- * Calculates the bounding box of a tab.
- *
- * @param pane the <code>JTabbedPane</code> for which this
- * delegate object provides the user interface.
- *
- * @param index the index of the tab, which must be an integer
- * in the range <code>[0 .. pane.getTabCount() - 1]</code>.
- *
- * @return the bounding box of the <code>index</code>-th tab,
- * in the coordinate system of <code>pane</code>.
- */
- public abstract Rectangle getTabBounds(JTabbedPane pane, int index);
-
-
- /**
- * Determines how many runs are used to display tabs.
- *
- * @param pane the <code>JTabbedPane</code> for which this
- * delegate object provides the user interface.
- *
- * @return the number of tab runs.
- *
- * @see javax.swing.JTabbedPane#getTabRunCount()
- */
- public abstract int getTabRunCount(JTabbedPane pane);
-}
-
diff --git a/libjava/javax/swing/plaf/TableHeaderUI.java b/libjava/javax/swing/plaf/TableHeaderUI.java
deleted file mode 100644
index f23ca74d7ed..00000000000
--- a/libjava/javax/swing/plaf/TableHeaderUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* TableHeaderUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JTableHeader</code>.
- *
- * @see javax.swing.table.JTableHeader
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class TableHeaderUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>TableHeaderUI</code>.
- */
- public TableHeaderUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/TableUI.java b/libjava/javax/swing/plaf/TableUI.java
deleted file mode 100644
index e56bcd13160..00000000000
--- a/libjava/javax/swing/plaf/TableUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* TableUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JTable</code>.
- *
- * @see javax.swing.JTable
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class TableUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>TableUI</code>.
- */
- public TableUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/TextUI.java b/libjava/javax/swing/plaf/TextUI.java
deleted file mode 100644
index 86d1f1f1b80..00000000000
--- a/libjava/javax/swing/plaf/TextUI.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/* TextUI.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Point;
-import java.awt.Rectangle;
-
-import javax.swing.text.BadLocationException;
-import javax.swing.text.EditorKit;
-import javax.swing.text.JTextComponent;
-import javax.swing.text.Position;
-import javax.swing.text.View;
-
-/**
- * An abstract base class for delegates that provide the user
- * interface for text editors.
- *
- * @see javax.swing.text.JTextComponent
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class TextUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>TextUI</code>.
- */
- public TextUI()
- {
- }
-
-
- /**
- * Calculates the geometric extent of the character at the
- * given offset.
- *
- * @param tc the <code>JTextComponent</code> for which this
- * delegate object provides the user interface.
- *
- * @param pos the zero-based index of the character into the
- * document model.
- *
- * @return the bounding box of the character at index
- * <code>pos</code>, in view coordinates.
- *
- * @throws BadLocationException if <code>pos</code> does not
- * designate a valid position in the document model.
- *
- * @see javax.swing.text.View#modelToView(int,
- * javax.swing.text.Position.Bias, int,
- * javax.swing.text.position.Bias, java.awt.Shape)
- */
- public abstract Rectangle modelToView(JTextComponent tc, int pos)
- throws BadLocationException;
-
-
- /**
- * Calculates the geometric extent of the character at the
- * given offset.
- *
- * @param tc the <code>JTextComponent</code> for which this
- * delegate object provides the user interface.
- *
- * @param pos the zero-based index of the character into the
- * document model.
- *
- * @param bias whether to take the character before or after the
- * caret position indicated by <code>pos</code>. The value
- * must be either {@link
- * javax.swing.text.Position.Bias#Backward} or {@link
- * javax.swing.text.Position.Bias#Forward}.
- *
- * @return the bounding box of the character at index
- * <code>pos</code>, in view coordinates.
- *
- * @throws BadLocationException if <code>pos</code> does not
- * designate a valid position in the document model.
- *
- * @see javax.swing.text.View#modelToView(int,
- * javax.swing.text.Position.Bias, int,
- * javax.swing.text.position.Bias, java.awt.Shape)
- */
- public abstract Rectangle modelToView(JTextComponent tc, int pos,
- Position.Bias bias)
- throws BadLocationException;
-
-
- /**
- * Finds the caret position which is closest to the specified visual
- * location.
- *
- * @param tc the <code>JTextComponent</code> for which this
- * delegate object provides the user interface.
- *
- * @param loc the position in view coordinates.
- *
- * @return the caret position which is closest to <code>loc</code>.
- *
- * @see #viewToModel(JTextComponent, Point, Position.Bias[])
- */
- public abstract int viewToModel(JTextComponent t, Point pt);
-
-
- /**
- * Finds the caret position which is closest to the specified visual
- * location.
- *
- * @param tc the <code>JTextComponent</code> for which this
- * delegate object provides the user interface.
- *
- * @param loc the position in view coordinates.
- *
- * @param outBias an array whose size must be at least one.
- * After the call, <code>outBias[0]</code> will indicate
- * whether <code>loc</code> is in the glyph before
- * (<code>Position.Bias.Backward</code>) or after
- * (<code>Position.Bias.Forward</code>) the returned
- * caret position.
- *
- * @return the caret position which is closest to <code>loc</code>.
- */
- public abstract int viewToModel(JTextComponent tc, Point loc,
- Position.Bias[] outBias);
-
-
-
- /**
- * Calculates the caret position that is visually next to the given
- * position. This is useful to determine where to move the caret
- * after the user has pressed an arrow key.
- *
- * @param tc the <code>JTextComponent</code> for which this
- * delegate object provides the user interface.
- *
- * @param pos the current caret position, a zero-based index
- * into the document model.
- *
- * @param bias whether to take the character before or after the
- * caret position indicated by <code>pos</code>. The value
- * must be either {@link
- * javax.swing.text.Position.Bias#Backward} or {@link
- * javax.swing.text.Position.Bias#Forward}.
- *
- * @param direction the visual direction. Pass
- * {@link javax.swing.SwingConstants#WEST} for the left
- * arrow key, {@link javax.swing.SwingConstants#EAST}
- * for the right arrow key, {@link
- * javax.swing.SwingConstants#NORTH} for the up arrow
- * key, or {@link javax.swing.SwingConstants#SOUTH}
- * for the down arrow key.
- *
- * @throws BadLocationException if <code>pos</code> does not
- * designate a valid position in the document model.
- *
- * @throws IllegalArgumentException if <code>direction</code>
- * is not one of <code>Position.Bias.Forward</code>
- * or <code>Position.Biad.Backward</code>.
- */
- public abstract int getNextVisualPositionFrom(JTextComponent tc,
- int pos,
- Position.Bias bias,
- int direction,
- Position.Bias[] outBias)
- throws BadLocationException;
-
-
- /**
- * Repaints a range of characters.
- *
- * @param tc the <code>JTextComponent</code> for which this
- * delegate object provides the user interface.
- *
- * @param start the first character in the range that needs
- * painting, indicated as an index into the document model.
- *
- * @param end the last character in the range that needs
- * painting, indicated as an index into the document model.
- * <code>end</code> must be greater than or equal to
- * <code>start</code>.
- */
- public abstract void damageRange(JTextComponent tc, int start, int end);
-
-
- /**
- * Repaints a range of characters, also specifying the bias for the
- * start and end of the range.
- *
- * @param tc the <code>JTextComponent</code> for which this
- * delegate object provides the user interface.
- *
- * @param start the first character in the range that needs
- * painting, indicated as an index into the document model.
- *
- * @param end the last character in the range that needs
- * painting, indicated as an index into the document model.
- * <code>end</code> must be greater than or equal to
- * <code>start</code>.
- */
- public abstract void damageRange(JTextComponent tc,
- int start, int end,
- Position.Bias startBias,
- Position.Bias endBias);
-
-
- /**
- * Retrieves the <code>EditorKit</code> managing policies and
- * persistent state.
- *
- * @param tc the <code>JTextComponent</code> for which this
- * delegate object provides the user interface.
- *
- * @return the <code>EditorKit</code> used by <code>tc</code>.
- */
- public abstract EditorKit getEditorKit(JTextComponent tc);
-
-
- /**
- * Retrieves the root of the view tree that visually presents
- * the text.
- *
- * @param tc the <code>JTextComponent</code> for which this
- * delegate object provides the user interface.
- *
- * @return the root <code>View</code> used by <code>tc</code>.
- */
- public abstract View getRootView(JTextComponent tc);
-
-
- /**
- * Returns a String for presenting a tool tip at the specified
- * location.
- *
- * @param tc the <code>JTextComponent</code> for which this
- * delegate object provides the user interface.
- *
- * @param loc the location for which the tool tip is requested.
- *
- * @return the text for the tool tip, or <code>null</code> to
- * display no tool tip.
- *
- * @since 1.4
- */
- public String getToolTipText(JTextComponent tc, Point loc)
- {
- return null;
- }
-}
diff --git a/libjava/javax/swing/plaf/ToolBarUI.java b/libjava/javax/swing/plaf/ToolBarUI.java
deleted file mode 100644
index 730cf4887db..00000000000
--- a/libjava/javax/swing/plaf/ToolBarUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ToolBarUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JToolBar</code>.
- *
- * @see javax.swing.JToolBar
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ToolBarUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>ToolBarUI</code>.
- */
- public ToolBarUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/ToolTipUI.java b/libjava/javax/swing/plaf/ToolTipUI.java
deleted file mode 100644
index 4383d0edd11..00000000000
--- a/libjava/javax/swing/plaf/ToolTipUI.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ToolTipUI.java --
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JToolTip</code>.
- *
- * @see javax.swing.JToolTip
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ToolTipUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>ToolTipUI</code>.
- */
- public ToolTipUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/TreeUI.java b/libjava/javax/swing/plaf/TreeUI.java
deleted file mode 100644
index e32952de70f..00000000000
--- a/libjava/javax/swing/plaf/TreeUI.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/* TreeUI.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-import java.awt.Rectangle;
-
-import javax.swing.JTree;
-import javax.swing.tree.TreePath;
-
-/**
- * An abstract base class for delegates that provide the user
- * interface for <code>JTree</code>.
- *
- * @see javax.swing.JTree
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class TreeUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>TreeUI</code>.
- */
- public TreeUI()
- {
- }
-
-
- /**
- * Determines the geometric extent of the label that is
- * drawn for a path.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @param path the path whose label extent is requested.
- *
- * @return a rectangle enclosing the label, or <code>null</code>
- * if <code>path</code> contains invalid nodes.
- */
- public abstract Rectangle getPathBounds(JTree tree, TreePath path);
-
-
- /**
- * Creates a <code>TreePath</code> for the specified row.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @param row the index of the row, which should be a number
- * in the range <code>[0, getRowCount(tree) - 1]</code>.
- *
- * @return a <code>TreePath</code> for the specified row, or
- * <code>null</code> if <code>row</code> is outside
- * the valid range.
- */
- public abstract TreePath getPathForRow(JTree tree, int row);
-
-
- /**
- * Determines in which row a <code>TreePath</code> is currently
- * being displayed.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @param path the path for which the caller wants to know
- * in which row it is being displayed.
- *
- * @return a number in the range <code>[0, getRowCount(tree)
- * - 1]</code> if the path is currently on display;
- * <code>-1</code> if the path is not shown to the
- * user.
- */
- public abstract int getRowForPath(JTree tree, TreePath path);
-
-
- /**
- * Counts how many rows are currently displayed.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @return the number of visible rows.
- */
- public abstract int getRowCount(JTree tree);
-
-
- /**
- * Finds the path that is closest to the specified position.
- *
- * <p><img src="doc-files/TreeUI-1.png" width="300" height="250"
- * alt="[A screen shot of a JTree]" />
- *
- * <p>As shown by the above illustration, the bounds of the
- * closest path do not necessarily need to contain the passed
- * location.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @param x the horizontal location, relative to the origin
- * of <code>tree</code>.
- *
- * @param y the vertical location, relative to the origin
- * of <code>tree</code>.
- *
- * @return the closest path, or <code>null</code> if the
- * tree is currenlty not displaying any paths at all.
- */
- public abstract TreePath getClosestPathForLocation(JTree tree,
- int x, int y);
-
-
- /**
- * Determines whether the user is currently editing a tree cell.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @see #getEditingPath
- */
- public abstract boolean isEditing(JTree tree);
-
-
- /**
- * Stops editing a tree cell, committing the entered value into the
- * tree&#x2019;s model. If no editing session is active, or if the
- * active editor does not agree to stopping, nothing happens. In
- * some look and feels, this action happens when the user has
- * pressed the enter key.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @return <code>false</code> if the editing still goes on because
- * the cell editor has objected to stopping the session;
- * <code>true</code> if editing has been stopped.
- */
- public abstract boolean stopEditing(JTree tree);
-
-
- /**
- * Cancels editing a tree cell, discarding any entered value.
- * If no editing session is active, nothing happens. The cell
- * editor is not given an opportunity to veto the canceling.
- * In some look and feels, this action happens when the user has
- * pressed the escape key.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- */
- public abstract void cancelEditing(JTree tree);
-
-
- /**
- * Starts a session to edit a tree cell. If the cell editor
- * rejects editing the cell, it will just be selected.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @param path the cell to edit.
- */
- public abstract void startEditingAtPath(JTree tree, TreePath path);
-
-
- /**
- * Retrieves the tree cell that is currently being edited.
- *
- * @return the currently edited path, or <code>null</code>
- * if no editing session is currently active.
- */
- public abstract TreePath getEditingPath(JTree tree);
-}
diff --git a/libjava/javax/swing/plaf/UIResource.java b/libjava/javax/swing/plaf/UIResource.java
deleted file mode 100644
index 1e28280e82f..00000000000
--- a/libjava/javax/swing/plaf/UIResource.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* UIResource.java
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-/**
- * This public interface is used to designate which objects were created by
- * <code>ComponentUI</code> delegates. When uninstalling the user public interface
- * renderer with <code>ComponentUI.uninstallUI()</code> the renderer
- * property is set to <code>null</code>.
- * <br>
- * A comparison against null can be used with all properties except for
- * the <code>java.awt.Component</code> properties font, foreground, and
- * background. The container can provide the value of the properties if
- * they are initialized or set to <code>null</code>.
- *
- * @author Brian Jones
- * @see java.lang.ComponentUI
- */
-public interface UIResource { }
diff --git a/libjava/javax/swing/plaf/ViewportUI.java b/libjava/javax/swing/plaf/ViewportUI.java
deleted file mode 100644
index 087938f1ed2..00000000000
--- a/libjava/javax/swing/plaf/ViewportUI.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ViewportUI.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf;
-
-
-/**
- * An abstract base class for delegates that implement the pluggable
- * look and feel for a <code>JViewport</code>.
- *
- * @see javax.swing.JViewport
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public abstract class ViewportUI
- extends ComponentUI
-{
- /**
- * Constructs a new <code>ViewportUI</code>.
- */
- public ViewportUI()
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicArrowButton.java b/libjava/javax/swing/plaf/basic/BasicArrowButton.java
deleted file mode 100644
index 4da4691f6d8..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicArrowButton.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/* BasicArrowButton.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Polygon;
-import java.awt.Rectangle;
-
-import javax.swing.JButton;
-import javax.swing.SwingConstants;
-import javax.swing.border.Border;
-
-/**
- * This class draws simple arrow buttons for the Basic Look and Feel.
- */
-public class BasicArrowButton extends JButton implements SwingConstants
-{
- /** The default size of the Arrow buttons. */
- private static int defaultSize = 10;
-
- /** The Polygon that points up. */
- private static Polygon upIcon = new Polygon(new int[] { 0, 5, 9 },
- new int[] { 7, 2, 7 }, 3);
-
- /** The Polygon that points down. */
- private static Polygon downIcon = new Polygon(new int[] { 1, 5, 9 },
- new int[] { 3, 7, 3 }, 3);
-
- /** The Polygon that points left. */
- private static Polygon leftIcon = new Polygon(new int[] { 7, 3, 7 },
- new int[] { 1, 5, 9 }, 3);
-
- /** The Polygon that points right. */
- private static Polygon rightIcon = new Polygon(new int[] { 3, 7, 3 },
- new int[] { 1, 5, 9 }, 3);
-
- /** The direction to point in. */
- protected int direction;
-
- /**
- * The color the arrow is painted in if disabled and the bottom and right
- * edges of the button.
- * This is package-private to avoid an accessor method.
- */
- transient Color shadow = Color.GRAY;
-
- /**
- * The color the arrow is painted in if enabled and the bottom and right
- * edges of the button.
- * This is package-private to avoid an accessor method.
- */
- transient Color darkShadow = Color.DARK_GRAY;
-
- /**
- * The top and left edges of the button.
- * This is package-private to avoid an accessor method.
- */
- transient Color highlight = Color.WHITE;
-
- /** The border around the ArrowButton. */
- private transient Border buttonBorder = new Border()
- {
- public Insets getBorderInsets(Component c)
- {
- return new Insets(2, 2, 2, 2);
- }
-
- public boolean isBorderOpaque()
- {
- return true;
- }
-
- public void paintBorder(Component c, Graphics g, int x, int y, int w,
- int h)
- {
- Color saved = g.getColor();
- g.setColor(highlight);
-
- g.drawLine(x + 1, y + 1, x + w - 1, y + 1);
- g.drawLine(x + 1, y + 1, x + 1, y + h - 1);
-
- g.setColor(shadow);
-
- g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1);
- g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1);
-
- g.setColor(darkShadow);
-
- g.drawLine(x, y + h, x + w, y + h);
- g.drawLine(x + w, y, x + w, y + h);
-
- g.setColor(saved);
- }
- };
-
- /**
- * Creates a new BasicArrowButton object.
- *
- * @param direction The direction the arrow points in.
- */
- public BasicArrowButton(int direction)
- {
- super();
- setBorder(buttonBorder);
- setDirection(direction);
- }
-
- /**
- * Creates a new BasicArrowButton object with the given colors and
- * direction.
- *
- * @param direction The direction to point in.
- * @param background The background color.
- * @param shadow The shadow color.
- * @param darkShadow The dark shadow color.
- * @param highlight The highlight color.
- */
- public BasicArrowButton(int direction, Color background, Color shadow,
- Color darkShadow, Color highlight)
- {
- this(direction);
- setBackground(background);
- this.shadow = shadow;
- this.darkShadow = darkShadow;
- this.highlight = highlight;
- }
-
- /**
- * This method returns whether the focus can traverse to this component.
- *
- * @return Whether the focus can traverse to this component.
- */
- public boolean isFocusTraversable()
- {
- return false;
- }
-
- /**
- * This method returns the direction of the arrow.
- *
- * @return The direction of the arrow.
- */
- public int getDirection()
- {
- return direction;
- }
-
- /**
- * This method changes the direction of the arrow.
- *
- * @param dir The new direction of the arrow.
- */
- public void setDirection(int dir)
- {
- this.direction = dir;
- }
-
- /**
- * This method paints the arrow button. The painting is delegated to the
- * paintTriangle method.
- *
- * @param g The Graphics object to paint with.
- */
- public void paint(Graphics g)
- {
- super.paint(g);
- Insets insets = getInsets();
- Rectangle bounds = getBounds();
- int x = insets.left
- + (bounds.width - insets.left - insets.right - defaultSize) / 2;
- int y = insets.top
- + (bounds.height - insets.left - insets.right - defaultSize) / 2;
- paintTriangle(g, x, y, defaultSize, direction, isEnabled());
- }
-
- /**
- * This method returns the preferred size of the arrow button.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize()
- {
- Insets insets = getInsets();
- int w = defaultSize + insets.left + insets.right;
- int h = defaultSize + insets.top + insets.bottom;
-
- return new Dimension(w, h);
- }
-
- /**
- * This method returns the minimum size of the arrow button.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize()
- {
- return getPreferredSize();
- }
-
- /**
- * This method returns the maximum size of the arrow button.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize()
- {
- return getPreferredSize();
- }
-
- /**
- * The method paints a triangle with the given size and direction at the
- * given x and y coordinates.
- *
- * @param g The Graphics object to paint with.
- * @param x The x coordinate to paint at.
- * @param y The y coordinate to paint at.
- * @param size The size of the icon.
- * @param direction The direction of the icon.
- * @param isEnabled Whether it is enabled.
- */
- public void paintTriangle(Graphics g, int x, int y, int size, int direction,
- boolean isEnabled)
- {
- Polygon arrow = null;
- switch (direction)
- {
- case NORTH:
- arrow = upIcon;
- break;
- case SOUTH:
- arrow = downIcon;
- break;
- case EAST:
- case RIGHT:
- arrow = rightIcon;
- break;
- case WEST:
- case LEFT:
- arrow = leftIcon;
- break;
- }
-
- int[] xPoints = arrow.xpoints;
- int[] yPoints = arrow.ypoints;
- int x1;
- int y1;
- int x2;
- int y2;
- x1 = y1 = x2 = y2 = 0;
-
- if (size != defaultSize)
- {
- float scale = size * 1f / defaultSize;
- for (int i = 0; i < 3; i++)
- {
- xPoints[i] *= scale;
- yPoints[i] *= scale;
- }
- }
- g.translate(x, y);
-
- switch (direction)
- {
- case NORTH:
- x1 = xPoints[0] + 2;
- y1 = yPoints[0];
- y2 = y1;
- x2 = xPoints[2] - 1;
- break;
- case SOUTH:
- x1 = xPoints[1];
- y1 = yPoints[1] + 1;
- x2 = xPoints[2] - 1;
- y2 = yPoints[2];
- break;
- case LEFT:
- case WEST:
- x1 = xPoints[0] + 1;
- y1 = yPoints[0] + 1;
- x2 = x1;
- y2 = yPoints[2] + 1;
- break;
- case RIGHT:
- case EAST:
- x1 = xPoints[2];
- y1 = yPoints[2] + 1;
- x2 = xPoints[1] - 1;
- y2 = yPoints[1] + 1;
- break;
- }
- Color saved = g.getColor();
-
- if (isEnabled)
- {
- g.setColor(Color.DARK_GRAY);
-
- if (arrow != null)
- g.fillPolygon(xPoints, yPoints, 3);
- }
- else
- {
- g.setColor(Color.GRAY);
- g.fillPolygon(xPoints, yPoints, 3);
- g.setColor(Color.WHITE);
- g.drawLine(x1, y1, x2, y2);
- }
- g.setColor(saved);
- g.translate(-x, -y);
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicBorders.java b/libjava/javax/swing/plaf/basic/BasicBorders.java
deleted file mode 100644
index bff6ff4fafb..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicBorders.java
+++ /dev/null
@@ -1,1815 +0,0 @@
-/* BasicBorders.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.io.Serializable;
-
-import javax.swing.AbstractButton;
-import javax.swing.ButtonModel;
-import javax.swing.JButton;
-import javax.swing.JPopupMenu;
-import javax.swing.JSplitPane;
-import javax.swing.JToolBar;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.border.AbstractBorder;
-import javax.swing.border.BevelBorder;
-import javax.swing.border.Border;
-import javax.swing.plaf.BorderUIResource;
-import javax.swing.plaf.UIResource;
-import javax.swing.text.JTextComponent;
-
-/**
- * Provides various borders for the Basic look and feel.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class BasicBorders
-{
- /**
- * A MarginBorder that gets shared by multiple components.
- * Created on demand by the private helper function {@link
- * #getMarginBorder()}.
- */
- private static MarginBorder sharedMarginBorder;
-
-
- /**
- * Returns a border for drawing push buttons.
- *
- * <p>The colors of the border are retrieved from the
- * <code>UIDefaults</code> of the currently active look and feel
- * using the keys <code>&#x201c;Button.shadow&#x201d;</code>,
- * <code>&#x201c;Button.darkShadow&#x201d;</code>,
- * <code>&#x201c;Button.light&#x201d;</code>, and
- * <code>&#x201c;Button.highlight&#x201d;</code>.
- *
- * <p><img src="doc-files/BasicBorders.ButtonBorder-1.png" width="300"
- * height="170" alt="[A screen shot of the returned border]" />
- *
- * @return a {@link
- * javax.swing.plaf.BorderUIResource#CompoundBorderUIResource}
- * whose outer border is a {@link #ButtonBorder} and whose
- * inner border is a {@link #MarginBorder}.
- */
- public static Border getButtonBorder()
- {
- UIDefaults defaults;
- Border outer;
-
- defaults = UIManager.getLookAndFeelDefaults();
-
- /* The keys for UIDefaults have been determined by writing a
- * test program that dumps the UIDefaults to stdout; that program
- * was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
- * the key "light" is usually called "highlight", and "highlight"
- * is usually called "lightHighlight".
- */
- outer = new ButtonBorder(defaults.getColor("Button.shadow"),
- defaults.getColor("Button.darkShadow"),
- defaults.getColor("Button.light"),
- defaults.getColor("Button.highlight"));
-
- /* While the inner border is shared between multiple buttons,
- * we do not share the outer border because ButtonBorders store
- * their border colors. We cannot guarantee that the colors
- * (which come from UIDefaults) are unchanged between invocations
- * of getButtonBorder. We could store the last colors, and share
- * the button border if the colors are the same as in the last
- * invocation, but it probably is not worth the effort.
- */
- return new BorderUIResource.CompoundBorderUIResource(
- outer,
- /* inner */ getMarginBorder());
- }
-
-
- /**
- * Returns a border for drawing radio buttons.
- *
- * <p>The colors of the border are retrieved from the
- * <code>UIDefaults</code> of the currently active look and feel
- * using the keys <code>&#x201c;RadioButton.shadow&#x201d;</code>,
- * <code>&#x201c;RadioButton.darkShadow&#x201d;</code>,
- * <code>&#x201c;RadioButton.light&#x201d;</code>, and
- * <code>&#x201c;RadioButton.highlight&#x201d;</code>.
- *
- * <p><img src="doc-files/BasicBorders.RadioButtonBorder-1.png" width="300"
- * height="135" alt="[A screen shot of the returned border]" />
- *
- * @return a {@link
- * javax.swing.plaf.BorderUIResource#CompoundBorderUIResource}
- * whose outer border is a {@link #RadioButtonBorder} and whose
- * inner border is a {@link #MarginBorder}.
- */
- public static Border getRadioButtonBorder()
- {
- UIDefaults defaults;
- Border outer;
-
- defaults = UIManager.getLookAndFeelDefaults();
-
- /* The keys for UIDefaults have been determined by writing a
- * test program that dumps the UIDefaults to stdout; that program
- * was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
- * the key "light" is usually called "highlight", and "highlight"
- * is usually called "lightHighlight".
- */
- outer = new RadioButtonBorder(
- defaults.getColor("RadioButton.shadow"),
- defaults.getColor("RadioButton.darkShadow"),
- defaults.getColor("RadioButton.light"),
- defaults.getColor("RadioButton.highlight"));
-
- /* While the inner border is shared between multiple buttons, we
- * do not share the outer border because RadioButtonBorders, being
- * ButtonBorders, store their border colors. We cannot guarantee
- * that the colors (which come from UIDefaults) are unchanged
- * between invocations of getButtonBorder. We could store the last
- * colors, and share the button border if the colors are the same
- * as in the last invocation, but it probably is not worth the
- * effort.
- */
- return new BorderUIResource.CompoundBorderUIResource(
- outer,
- /* inner */ getMarginBorder());
- }
-
-
- /**
- * Returns a border for drawing toggle buttons.
- *
- * <p>The colors of the border are retrieved from the
- * <code>UIDefaults</code> of the currently active look and feel
- * using the keys <code>&#x201c;ToggleButton.shadow&#x201d;</code>,
- * <code>&#x201c;ToggleButton.darkShadow&#x201d;</code>,
- * <code>&#x201c;ToggleButton.light&#x201d;</code>, and
- * <code>&#x201c;ToggleButton.highlight&#x201d;</code>.
- *
- * <p><img src="doc-files/BasicBorders.ToggleButtonBorder-1.png" width="270"
- * height="135" alt="[A screen shot of the returned border]" />
- *
- * @return a {@link
- * javax.swing.plaf.BorderUIResource#CompoundBorderUIResource}
- * whose outer border is a {@link #ToggleButtonBorder} and whose
- * inner border is a {@link #MarginBorder}.
- */
- public static Border getToggleButtonBorder()
- {
- UIDefaults defaults;
- Border outer;
-
- defaults = UIManager.getLookAndFeelDefaults();
-
- /* The keys for UIDefaults have been determined by writing a
- * test program that dumps the UIDefaults to stdout; that program
- * was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
- * the key "light" is usually called "highlight", and "highlight"
- * is usually called "lightHighlight".
- */
- outer = new ToggleButtonBorder(
- defaults.getColor("ToggleButton.shadow"),
- defaults.getColor("ToggleButton.darkShadow"),
- defaults.getColor("ToggleButton.light"),
- defaults.getColor("ToggleButton.highlight"));
-
- /* While the inner border is shared between multiple buttons, we
- * do not share the outer border because ToggleButtonBorders, being
- * ButtonBorders, store their border colors. We cannot guarantee
- * that the colors (which come from UIDefaults) are unchanged
- * between invocations of getButtonBorder. We could store the last
- * colors, and share the button border if the colors are the same
- * as in the last invocation, but it probably is not worth the
- * effort.
- */
- return new BorderUIResource.CompoundBorderUIResource(
- outer,
- /* inner */ getMarginBorder());
- }
-
-
- /**
- * Returns a border for drawing a two-pixel thick separator line
- * below menu bars.
- *
- * <p>The colors of the border are retrieved from the
- * <code>UIDefaults</code> of the currently active look and feel
- * using the keys <code>&#x201c;MenuBar.shadow&#x201d;</code> and
- * <code>&#x201c;MenuBar.highlight&#x201d;</code>.
- *
- * <p><img src="doc-files/BasicBorders.MenuBarBorder-1.png" width="500"
- * height="140" alt="[A screen shot of a JMenuBar with this border]" />
- *
- * @return a {@link #MenuBarBorder}.
- *
- * @see javax.swing.JMenuBar
- */
- public static Border getMenuBarBorder()
- {
- UIDefaults defaults;
-
- /* See comment in methods above for why this border is not shared. */
- defaults = UIManager.getLookAndFeelDefaults();
- return new MenuBarBorder(defaults.getColor("MenuBar.shadow"),
- defaults.getColor("MenuBar.highlight"));
- }
-
-
- /**
- * Returns a border for drawing a one-pixel thick border around
- * split panes that are interrupted where the divider joins the
- * border.
- *
- * <p>The colors of the border are retrieved from the
- * <code>UIDefaults</code> of the currently active look and feel
- * using the keys <code>&#x201c;SplitPane.darkShadow&#x201d;</code> and
- * <code>&#x201c;SplitPane.highlight&#x201d;</code>.
- *
- * <p><img src="doc-files/BasicBorders.SplitPaneBorder-1.png" width="520"
- * height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
- *
- * <p><img src="doc-files/BasicBorders.SplitPaneBorder-2.png" width="520"
- * height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
- *
- * @return a {@link #SplitPaneBorder}.
- *
- * @see javax.swing.JSplitPane
- * @see #getSplitPaneDividerBorder()
- */
- public static Border getSplitPaneBorder()
- {
- UIDefaults defaults;
-
- /* See comment in methods above for why this border is not shared. */
- defaults = UIManager.getLookAndFeelDefaults();
- return new SplitPaneBorder(defaults.getColor("SplitPane.highlight"),
- defaults.getColor("SplitPane.darkShadow"));
- }
-
-
- /**
- * Returns a border for drawing a one-pixel thick border around
- * the divider of split panes.
- *
- * <p>The colors of the edges that are adjacent to the child components
- * of the <code>JSplitPane</code> are retrieved from the
- * <code>UIDefaults</code> of the currently active look and feel
- * using the keys <code>&#x201c;SplitPane.darkShadow&#x201d;</code> and
- * <code>&#x201c;SplitPane.highlight&#x201d;</code>. The color of the
- * other two edges is the background color of the divider.
- *
- * <p><img src="doc-files/BasicBorders.SplitPaneDividerBorder-1.png"
- * width="520" height="200" alt=
- * "[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
- *
- * @return an instance of <code>SplitPaneDividerBorder</code>, which is
- * not a public API class of this package.
- *
- * @see javax.swing.JSplitPane
- * @see javax.swing.plaf.basic.BasicSplitPaneDivider
- * @see #getSplitPaneBorder()
- *
- * @since 1.3
- */
- public static Border getSplitPaneDividerBorder()
- {
- UIDefaults defaults;
-
- /* See comment in methods above for why this border is not shared. */
- defaults = UIManager.getLookAndFeelDefaults();
- return new SplitPaneDividerBorder(
- defaults.getColor("SplitPane.highlight"),
- defaults.getColor("SplitPane.darkShadow"));
- }
-
-
- /**
- * Returns a border for drawing a border around a text field
- * that makes the field appear as etched into the surface.
- *
- * <p>The colors of the border are retrieved from the
- * <code>UIDefaults</code> of the currently active look and feel
- * using the keys <code>&#x201c;TextField.shadow&#x201d;</code>,
- * <code>&#x201c;TextField.darkShadow&#x201d;</code>,
- * <code>&#x201c;TextField.light&#x201d;</code>, and
- * <code>&#x201c;TextField.highlight&#x201d;</code>.
- *
- * <p><img src="doc-files/BasicBorders.FieldBorder-1.png" width="500"
- * height="200" alt="[A screen shot of a border returned by
- * this method]" />
- *
- * @return an instance of
- * {@link javax.swing.plaf.basic.BasicBorders$FieldBorder}.
- *
- * @see javax.swing.JTextField
- * @see javax.swing.text.JTextComponent
- */
- public static Border getTextFieldBorder()
- {
- UIDefaults defaults;
-
- /* See comment in methods above for why this border is not shared. */
- defaults = UIManager.getLookAndFeelDefaults();
- return new FieldBorder(
- defaults.getColor("TextField.shadow"),
- defaults.getColor("TextField.darkShadow"),
- defaults.getColor("TextField.light"),
- defaults.getColor("TextField.highlight"));
- }
-
-
- /**
- * Returns a two-pixel thick, green
- * <code>LineBorderUIResource</code>. This is so ugly that look and
- * feels better use different borders for their progress bars, or
- * they will look really terrible.
- *
- * <p><img src="doc-files/BasicBorders-1.png" width="120" height="80"
- * alt="[A screen shot of a border returned by this method]" />
- */
- public static Border getProgressBarBorder()
- {
- /* There does not seem to exist a way to parametrize the color
- * or thickness of the border through UIDefaults.
- */
- return new BorderUIResource.LineBorderUIResource(Color.green, 2);
- }
-
-
- /**
- * Returns a border that is composed of a raised bevel border and a
- * one-pixel thick line border.
- *
- * <p><img src="doc-files/BasicBorders-2.png" width="300" height="200"
- * alt="[A screen shot of a border returned by this method]" />
- *
- * <p>The colors of the border are retrieved from the
- * <code>UIDefaults</code> of the currently active look and feel
- * using the keys <code>&#x201c;InternalFrame.borderShadow&#x201d;</code>,
- * <code>&#x201c;InternalFrame.borderDarkShadow&#x201d;</code>,
- * <code>&#x201c;InternalFrame.borderLight&#x201d;</code>,
- * <code>&#x201c;InternalFrame.borderHighlight&#x201d;</code>, and
- * (for the inner one-pixel thick line)
- * <code>&#x201c;InternalFrame.borderColor&#x201d;</code>.
- */
- public static Border getInternalFrameBorder()
- {
- UIDefaults defaults;
- Color shadow, darkShadow, highlight, lightHighlight, line;
-
- /* See comment in methods above for why this border is not shared. */
- defaults = UIManager.getLookAndFeelDefaults();
-
- shadow = defaults.getColor("InternalFrame.borderShadow");
- darkShadow = defaults.getColor("InternalFrame.borderDarkShadow");
- highlight = defaults.getColor("InternalFrame.borderLight");
- lightHighlight = defaults.getColor("InternalFrame.borderHighlight");
- line = defaults.getColor("InternalFrame.borderColor");
-
- return new BorderUIResource.CompoundBorderUIResource(
- /* outer border */
- new BorderUIResource.BevelBorderUIResource(
- BevelBorder.RAISED,
- (highlight != null) ? highlight : Color.lightGray,
- (lightHighlight != null) ? lightHighlight : Color.white,
- (darkShadow != null) ? darkShadow : Color.black,
- (shadow != null) ? shadow : Color.gray),
-
- /* inner border */
- new BorderUIResource.LineBorderUIResource(
- (line != null) ? line : Color.lightGray));
- }
-
-
- /**
- * Returns a shared MarginBorder.
- */
- static Border getMarginBorder() // intentionally not public
- {
- /* Swing is not designed to be thread-safe, so there is no
- * need to synchronize the access to the global variable.
- */
- if (sharedMarginBorder == null)
- sharedMarginBorder = new MarginBorder();
-
- return sharedMarginBorder;
- }
-
-
- /**
- * A border whose appearance depends on the state of
- * the enclosed button.
- *
- * <p><img src="doc-files/BasicBorders.ButtonBorder-1.png" width="300"
- * height="170" alt="[A screen shot of this border]" />
- *
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class ButtonBorder
- extends AbstractBorder
- implements Serializable, UIResource
- {
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = -157053874580739687L;
-
-
- /**
- * The color for drawing the shaded parts of the border.
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
- */
- protected Color shadow;
-
-
- /**
- * The color for drawing the dark shaded parts of the border.
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
- */
- protected Color darkShadow;
-
-
- /**
- * The color for drawing the highlighted parts of the border.
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
- */
- protected Color highlight;
-
-
- /**
- * The color for drawing the bright highlighted parts of the border.
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
- */
- protected Color lightHighlight;
-
-
- /**
- * Constructs a new border for drawing a button in the Basic
- * look and feel.
- *
- * @param shadow the shadow color.
- * @param darkShadow a darker variant of the shadow color.
- * @param highlight the highlight color.
- * @param lightHighlight a brighter variant of the highlight color.
- */
- public ButtonBorder(Color shadow, Color darkShadow,
- Color highlight, Color lightHighlight)
- {
- /* These colors usually come from the UIDefaults of the current
- * look and feel. Use fallback values if the colors are not
- * supplied. The API specification is silent about what
- * behavior is expected for null colors, so users should not
- * rely on this fallback (which is why it is not documented in
- * the above Javadoc).
- */
- this.shadow = (shadow != null) ? shadow : Color.gray;
- this.darkShadow = (darkShadow != null) ? darkShadow : Color.black;
- this.highlight = (highlight != null) ? highlight : Color.lightGray;
- this.lightHighlight = (lightHighlight != null)
- ? lightHighlight
- : Color.white;
- }
-
-
- /**
- * Paints the ButtonBorder around a given component.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- *
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- ButtonModel bmodel = null;
-
- if (c instanceof AbstractButton)
- bmodel = ((AbstractButton) c).getModel();
-
- BasicGraphicsUtils.drawBezel(
- g, x, y, width, height,
- /* pressed */ (bmodel != null)
- && /* mouse button pressed */ bmodel.isPressed()
- && /* mouse inside */ bmodel.isArmed(),
- /* default */ (c instanceof JButton)
- && ((JButton) c).isDefaultButton(),
- shadow, darkShadow, highlight, lightHighlight);
- }
-
-
- /**
- * Measures the width of this border.
- *
- * <p>Although the thickness of the actually painted border
- * depends on the state of the enclosed component, this
- * measurement always returns the same amount of pixels. Indeed,
- * it would be rather confusing if a button was appearing to
- * change its size depending on whether it is pressed or not.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- /* There is no obvious reason for overriding this method, but we
- * try to have exactly the same API as the Sun reference
- * implementation.
- */
- return getBorderInsets(c, null);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * <p>Although the thickness of the actually painted border
- * depends on the state of the enclosed component, this
- * measurement always returns the same amount of pixels. Indeed,
- * it would be rather confusing if a button was appearing to
- * change its size depending on whether it is pressed or not.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- /* The exact amount has been determined using a test program
- * that was run on the Sun reference implementation. With
- * Apple/Sun JDK 1.3.1 on MacOS X 10.1.5, the result is
- * [3, 3, 3, 3]. With Sun JDK 1.4.1_01 on Linux/x86, the
- * result is [2, 3, 3, 3]. We use the values from the 1.4.1_01
- * release.
- */
- if (insets == null)
- return new Insets(2, 3, 3, 3);
-
- insets.top = 2;
- insets.bottom = insets.left = insets.right = 3;
- return insets;
- }
- }
-
-
- /**
- * A border that makes its enclosed component appear as lowered
- * into the surface. Typically used for text fields.
- *
- * <p><img src="doc-files/BasicBorders.FieldBorder-1.png" width="500"
- * height="200" alt="[A screen shot of this border]" />
- *
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawEtchedRect
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class FieldBorder
- extends AbstractBorder
- implements UIResource
- {
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = 949220756998454908L;
-
-
- /**
- * The color for drawing the outer half of the top and left
- * edges.
- */
- protected Color shadow;
-
-
- /**
- * The color for drawing the inner half of the top and left
- * edges.
- */
- protected Color darkShadow;
-
-
- /**
- * The color for drawing the inner half of the bottom and right
- * edges.
- */
- protected Color highlight;
-
-
- /**
- * The color for drawing the outer half of the bottom and right
- * edges.
- */
- protected Color lightHighlight;
-
-
- /**
- * Constructs a new border for drawing a text field in the Basic
- * look and feel.
- *
- * @param shadow the color for drawing the outer half
- * of the top and left edges.
- *
- * @param darkShadow the color for drawing the inner half
- * of the top and left edges.
- *
- * @param highlight the color for drawing the inner half
- * of the bottom and right edges.
- *
- * @param lightHighlight the color for drawing the outer half
- * of the bottom and right edges.
- */
- public FieldBorder(Color shadow, Color darkShadow,
- Color highlight, Color lightHighlight)
- {
- /* These colors usually come from the UIDefaults of the current
- * look and feel. Use fallback values if the colors are not
- * supplied. The API specification is silent about what
- * behavior is expected for null colors, so users should not
- * rely on this fallback (which is why it is not documented in
- * the above Javadoc).
- */
- this.shadow = (shadow != null) ? shadow : Color.gray;
- this.darkShadow = (darkShadow != null) ? darkShadow : Color.black;
- this.highlight = (highlight != null) ? highlight : Color.lightGray;
- this.lightHighlight = (lightHighlight != null)
- ? lightHighlight : Color.white;
- }
-
-
- /**
- * Paints the FieldBorder around a given component.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- *
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawEtchedRect
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- BasicGraphicsUtils.drawEtchedRect(g, x, y, width, height,
- shadow, darkShadow,
- highlight, lightHighlight);
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- * If <code>c</code> is an instance of {@link
- * javax.swing.text.JTextComponent}, its margin is
- * added to the border size.
- *
- * @return an Insets object whose <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- return getBorderInsets(c, null);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param c the component whose border is to be measured.
- * If <code>c</code> is an instance of {@link
- * javax.swing.text.JTextComponent}, its margin is
- * added to the border size.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- if (insets == null)
- insets = new Insets(2, 2, 2, 2);
- else
- insets.top = insets.left = insets.bottom = insets.right = 2;
-
- if (c instanceof JTextComponent)
- {
- Insets margin = ((JTextComponent) c).getMargin();
- insets.top += margin.top;
- insets.left += margin.left;
- insets.bottom += margin.bottom;
- insets.right += margin.right;
- }
-
- return insets;
- }
- }
-
-
- /**
- * An invisible, but spacing border whose margin is determined
- * by calling the <code>getMargin()</code> method of the enclosed
- * component. If the enclosed component has no such method,
- * this border will not occupy any space.
- *
- * <p><img src="doc-files/BasicBorders.MarginBorder-1.png" width="325"
- * height="200" alt="[An illustration that shows how MarginBorder
- * determines its borders]" />
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class MarginBorder
- extends AbstractBorder
- implements Serializable, UIResource
- {
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = -3035848353448896090L;
-
-
- /**
- * Constructs a new MarginBorder.
- */
- public MarginBorder()
- {
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>, <code>right</code>,
- * <code>top</code> and <code>bottom</code> fields indicate the
- * width of the border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- return getBorderInsets(c, new Insets(0, 0, 0, 0));
- }
-
-
- /**
- * Determines the insets of this border by calling the
- * <code>getMargin()</code> method of the enclosed component. The
- * resulting margin will be stored into the the <code>left</code>,
- * <code>right</code>, <code>top</code> and <code>bottom</code>
- * fields of the passed <code>insets</code> parameter.
- *
- * <p>Unfortunately, <code>getMargin()</code> is not a method of
- * {@link javax.swing.JComponent} or some other common superclass
- * of things with margins. While reflection could be used to
- * determine the existence of this method, this would be slow on
- * many virtual machines. Therefore, the current implementation
- * knows about {@link javax.swing.AbstractButton#getMargin()},
- * {@link javax.swing.JPopupMenu#getMargin()}, {@link
- * javax.swing.JToolBar#getMargin()}, and {@link
- * javax.swing.text.JTextComponent}. If <code>c</code> is an
- * instance of a known class, the respective
- * <code>getMargin()</code> method is called to determine the
- * correct margin. Otherwise, a zero-width margin is returned.
- *
- * @param c the component whose border is to be measured.
- *
- * @return the same object that was passed for <code>insets</code>,
- * but with changed fields.
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- Insets margin = null;
-
- /* This is terrible object-oriented design. See the above Javadoc
- * for an excuse.
- */
- if (c instanceof AbstractButton)
- margin = ((AbstractButton) c).getMargin();
- else if (c instanceof JPopupMenu)
- margin = ((JPopupMenu) c).getMargin();
- else if (c instanceof JToolBar)
- margin = ((JToolBar) c).getMargin();
- else if (c instanceof JTextComponent)
- margin = ((JTextComponent) c).getMargin();
-
- if (margin == null)
- insets.top = insets.left = insets.bottom = insets.right = 0;
- else
- {
- insets.top = margin.top;
- insets.left = margin.left;
- insets.bottom = margin.bottom;
- insets.right = margin.right;
- }
-
- return insets;
- }
- }
-
-
- /**
- * A border for drawing a separator line below JMenuBar.
- *
- * <p><img src="doc-files/BasicBorders.MenuBarBorder-1.png" width="500"
- * height="140" alt="[A screen shot of a JMenuBar with this border]" />
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class MenuBarBorder
- extends AbstractBorder
- implements UIResource
- {
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = -6909056571935227506L;
-
-
- /**
- * The shadow color, which is used for the upper line of the
- * two-pixel thick bottom edge.
- */
- private Color shadow;
-
-
- /**
- * The highlight color, which is used for the lower line of the
- * two-pixel thick bottom edge.
- */
- private Color highlight;
-
-
- /**
- * Constructs a new MenuBarBorder for drawing a JMenuBar in
- * the Basic look and feel.
- *
- * <p><img src="doc-files/BasicBorders.MenuBarBorder-1.png" width="500"
- * height="140" alt="[A screen shot of a JMenuBar with this
- * border]" />
- *
- * @param shadow the shadow color, which is used for the upper
- * line of the two-pixel thick bottom edge.
- *
- * @param highlight the shadow color, which is used for the lower
- * line of the two-pixel thick bottom edge.
- */
- public MenuBarBorder(Color shadow, Color highlight)
- {
- /* These colors usually come from the UIDefaults of the current
- * look and feel. Use fallback values if the colors are not
- * supplied. The API specification is silent about what
- * behavior is expected for null colors, so users should not
- * rely on this fallback (which is why it is not documented in
- * the above Javadoc).
- */
- this.shadow = (shadow != null) ? shadow : Color.gray;
- this.highlight = (highlight != null) ? highlight : Color.white;
- }
-
-
- /**
- * Paints the MenuBarBorder around a given component.
- *
- * @param c the component whose border is to be painted, usually
- * an instance of {@link javax.swing.JMenuBar}.
- *
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- Color oldColor;
-
- /* To understand this code, it might be helpful to look at the
- * image "BasicBorders.MenuBarBorder-1.png" that is included
- * with the JavaDoc. It is located in the "doc-files"
- * subdirectory.
- */
- oldColor = g.getColor();
- y = y + height - 2;
- try
- {
- g.setColor(shadow);
- g.drawLine(x, y, x + width - 2, y);
- g.drawLine(x, y + 1, x, y + 1);
- g.drawLine(x + width - 2, y + 1, x + width - 2, y + 1);
-
- g.setColor(highlight);
- g.drawLine(x + 1, y + 1, x + width - 3, y + 1);
- g.drawLine(x + width - 1, y, x + width - 1, y + 1);
- }
- finally
- {
- g.setColor(oldColor);
- }
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- /* There is no obvious reason for overriding this method, but we
- * try to have exactly the same API as the Sun reference
- * implementation.
- */
- return getBorderInsets(c, null);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- /* The exact amount has been determined using a test program
- * that was run on the Apple/Sun JDK 1.3.1 on MacOS X, and the
- * Sun JDK 1.4.1_01 on GNU/Linux for x86. Both gave [0,0,2,0],
- * which was expected from looking at the screen shot.
- */
- if (insets == null)
- return new Insets(0, 0, 2, 0);
-
- insets.left = insets.right = insets.top = 0;
- insets.bottom = 2;
- return insets;
- }
- }
-
-
- /**
- * A border for drawing radio buttons in the Basic look and feel.
- *
- * <p><img src="doc-files/BasicBorders.RadioButtonBorder-1.png" width="300"
- * height="135" alt="[A screen shot of this border]" />
- *
- * <p>Note about the screen shot: Normally, the
- * <code>borderPainted</code> property is <code>false</code> for
- * JRadioButtons. For this screen shot, it has been set to
- * <code>true</code> so the borders get drawn. Also, a
- * concretization of the Basic look and would typically provide
- * icons for the various states of radio buttons.
- *
- * <p>Note that the focus rectangle is invisible If the radio button
- * is currently selected. While it might be debatable whether this
- * makes a lot of sense, this behavior can be observed in the Sun
- * reference implementation (in JDK 1.3.1 and 1.4.1). The Classpath
- * implementation tries to exactly replicate the JDK appearance.
- *
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class RadioButtonBorder
- extends ButtonBorder
- {
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = 1596945751743747369L;
-
-
- /**
- * Constructs a new border for drawing a JRadioButton in
- * the Basic look and feel.
- *
- * @param shadow the shadow color.
- * @param darkShadow a darker variant of the shadow color.
- * @param highlight the highlight color.
- * @param lightHighlight a brighter variant of the highlight color.
- */
- public RadioButtonBorder(Color shadow, Color darkShadow,
- Color highlight, Color lightHighlight)
- {
- /* The superclass ButtonBorder substitutes null arguments
- * with fallback colors.
- */
- super(shadow, darkShadow, highlight, lightHighlight);
- }
-
-
- /**
- * Paints the RadioButtonBorder around a given component.
- *
- * <p>The Sun implementation always seems to draw exactly
- * the same border, irrespective of the state of the button.
- * This is rather surprising, but GNU Classpath emulates the
- * observable behavior.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- *
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- AbstractButton button = null;
- ButtonModel bmodel = null;
- boolean lowered = false;
- boolean focused = false;
-
- if (c instanceof AbstractButton)
- {
- button = (AbstractButton) c;
- bmodel = button.getModel();
- }
-
- if (bmodel != null)
- {
- lowered = button.isSelected()
- || (/* mouse inside */ bmodel.isArmed() && bmodel.isPressed());
- focused = button.hasFocus() && button.isFocusPainted();
- }
-
- if (lowered)
- BasicGraphicsUtils.drawLoweredBezel(g, x, y, width, height,
- shadow, darkShadow,
- highlight, lightHighlight);
- else
- BasicGraphicsUtils.drawBezel(g, x, y, width, height,
- /* isPressed */ false,
- /* isPefault */ focused,
- shadow, darkShadow,
- highlight, lightHighlight);
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- /* There is no obvious reason for overriding this method, but we
- * try to have exactly the same API as the Sun reference
- * implementation.
- */
- return getBorderInsets(c, null);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- /* The exact amount has been determined using a test program
- * that was run on the Apple/Sun JDK 1.3.1 on MacOS X, and the
- * Sun JDK 1.4.1_01 on GNU/Linux for x86. Both gave [2,2,2,2].
- */
- if (insets == null)
- return new Insets(2, 2, 2, 2);
-
- insets.left = insets.right = insets.top = insets.bottom = 2;
- return insets;
- }
- }
-
-
- /**
- * A one-pixel thick border for rollover buttons, for example in
- * tool bars.
- *
- * @since 1.4
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class RolloverButtonBorder
- extends ButtonBorder
- {
- /**
- * Determined using the <code>serialver</code> tool
- * of Sun JDK 1.4.1_01 on GNU/Linux 2.4.20 for x86.
- */
- static final long serialVersionUID = 1976364864896996846L;
-
-
- /**
- * Constructs a new border for drawing a roll-over button
- * in the Basic look and feel.
- *
- * @param shadow the shadow color.
- * @param darkShadow a darker variant of the shadow color.
- * @param highlight the highlight color.
- * @param lightHighlight a brighter variant of the highlight color.
- */
- public RolloverButtonBorder(Color shadow, Color darkShadow,
- Color highlight, Color lightHighlight)
- {
- super(shadow, darkShadow, highlight, lightHighlight);
- }
-
-
- /**
- * Paints the border around a rollover button. If <code>c</code>
- * is not an {@link javax.swing.AbstractButton} whose model
- * returns <code>true</code> for {@link
- * javax.swing.ButtonModel#isRollver}, nothing gets painted at
- * all.
- *
- * @param c the button whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- ButtonModel bmodel = null;
- boolean drawPressed;
- Color oldColor = g.getColor();
- int x2, y2;
-
- if (c instanceof AbstractButton)
- bmodel = ((AbstractButton) c).getModel();
-
- /* Draw nothing if c is not a rollover button. */
- if ((bmodel == null) || !bmodel.isRollover())
- return;
-
- /* Draw nothing if the mouse is pressed, but outside the button. */
- if (bmodel.isPressed() && !bmodel.isArmed())
- return;
-
- drawPressed = bmodel.isSelected() || bmodel.isPressed();
- x2 = x + width - 1;
- y2 = y + height - 1;
-
- try
- {
- g.setColor(drawPressed ? shadow : lightHighlight);
- g.drawLine(x, y, x2 - 1, y); // top edge
- g.drawLine(x, y + 1, x, y2 - 1); // left edge
-
- g.setColor(drawPressed ? lightHighlight : shadow);
- g.drawLine(x, y2, x2, y2); // bottom edge
- g.drawLine(x2, y, x2, y2 - 1); // right edge
- }
- finally
- {
- g.setColor(oldColor);
- }
- }
- }
-
-
- /**
- * A border for JSplitPanes in the Basic look and feel. The divider
- * in the middle of the JSplitPane has its own border class, of which
- * an instance can be obtained with {@link #getSplitPaneDividerBorder()}.
- *
- * <p><img src="doc-files/BasicBorders.SplitPaneBorder-1.png" width="520"
- * height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
- *
- * <p><img src="doc-files/BasicBorders.SplitPaneBorder-2.png" width="520"
- * height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
- *
- * <p>In contrast to the other borders of the Basic look and feel,
- * this class is not serializable. While this might be unintended,
- * GNU Classpath follows the specification in order to be fully
- * compatible with the Sun reference implementation.
- *
- * <p>In the Sun JDK, the bottom edge of the divider also gets
- * painted if the orientation of the enclosed JSplitPane is
- * <code>JSplitPane.VERTICAL_SPLIT</code> (at least in versions
- * 1.3.1 and 1.4.1). GNU Classpath does not replicate this bug. A
- * report has been filed with Sun (bug ID 4885629).
- *
- * <p>Note that the bottom left pixel of the border has a different
- * color depending on the orientation of the enclosed JSplitPane.
- * Although this is visually inconsistent, Classpath replicates the
- * appearance of the Sun reference implementation. A bug report has
- * been filed with Sun (review ID 188774).
- *
- * @see {@link #getSplitPaneBorder()}
- * @see {@link #getSplitPaneDividerBorder()}
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class SplitPaneBorder
- implements Border, UIResource
- {
- /**
- * Indicates that the top edge shall be not be painted
- * by {@link #paintRect(java.awt.Graphics, int, int, int, int, int)}.
- */
- private static final int SUPPRESS_TOP = 1;
-
-
- /**
- * Indicates that the left edge shall be not be painted
- * by {@link #paintRect(java.awt.Graphics, int, int, int, int, int)}.
- */
- private static final int SUPPRESS_LEFT = 2;
-
-
- /**
- * Indicates that the bottom edge shall be not be painted
- * by {@link #paintRect(java.awt.Graphics, int, int, int, int, int)}.
- */
- private static final int SUPPRESS_BOTTOM = 4;
-
-
- /**
- * Indicates that the right edge shall be not be painted
- * by {@link #paintRect(java.awt.Graphics, int, int, int, int, int)}.
- */
- private static final int SUPPRESS_RIGHT = 8;
-
-
- /**
- * The color for drawing the bottom and right edges of the border.
- */
- protected Color highlight;
-
-
- /**
- * The color for drawing the top and left edges of the border.
- */
- protected Color shadow;
-
-
- /**
- * Constructs a new border for drawing a JSplitPane in the Basic
- * look and feel. The divider in the middle of the JSplitPane has
- * its own border class, <code>SplitPaneDividerBorder</code>.
- *
- * @param shadow the shadow color.
- * @param highlight the highlight color.
- */
- public SplitPaneBorder(Color highlight, Color shadow)
- {
- /* These colors usually come from the UIDefaults of the current
- * look and feel. Use fallback values if the colors are not
- * supplied. The API specification is silent about what
- * behavior is expected for null colors, so users should not
- * rely on this fallback (which is why it is not documented in
- * the above Javadoc).
- */
- this.shadow = (shadow != null) ? shadow : Color.black;
- this.highlight = (highlight != null) ? highlight : Color.white;
- }
-
-
- /**
- * Paints the border around a <code>JSplitPane</code>.
- *
- * <p><img src="doc-files/BasicBorders.SplitPaneBorder-1.png" width="520"
- * height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
- *
- * <p><img src="doc-files/BasicBorders.SplitPaneBorder-2.png" width="520"
- * height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
- *
- * @param c the <code>JSplitPane</code> whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- JSplitPane splitPane;
- Component content;
-
- if (!(c instanceof JSplitPane))
- return;
-
- splitPane = (JSplitPane) c;
- switch (splitPane.getOrientation())
- {
- case JSplitPane.HORIZONTAL_SPLIT:
- if ((content = splitPane.getLeftComponent()) != null)
- paintRect(g, SUPPRESS_RIGHT, true, x, y, content.getBounds());
- if ((content = splitPane.getRightComponent()) != null)
- paintRect(g, SUPPRESS_LEFT, true, x, y, content.getBounds());
- break;
-
- case JSplitPane.VERTICAL_SPLIT:
- if ((content = splitPane.getTopComponent()) != null)
- paintRect(g, SUPPRESS_BOTTOM, false, x, y, content.getBounds());
- if ((content = splitPane.getBottomComponent()) != null)
- paintRect(g, SUPPRESS_TOP, false, x, y, content.getBounds());
- break;
- }
- }
-
-
- /**
- * Paints a border around a child of a <code>JSplitPane</code>,
- * omitting some of the edges.
- *
- * @param g the graphics for painting.
- *
- * @param suppress a bit mask indicating the set of suppressed
- * edges, for example <code>SUPPRESS_TOP | SUPPRESS_RIGHT</code>.
- *
- * @param x the x coordinate of the SplitPaneBorder.
- *
- * @param y the y coordinate of the SplitPaneBorder.
- *
- * @param shadeBottomLeftPixel <code>true</code> to paint the
- * bottom left pixel in the shadow color,
- * <code>false</code> for the highlight color. The Basic
- * look and feel uses the highlight color for the bottom
- * left pixel of the border of a JSplitPane whose
- * orientation is VERTICAL_SPLIT, and the shadow color
- * otherwise. While this might be a strange distinction,
- * Classpath tries to look identical to the reference
- * implementation. A bug report has been filed with Sun;
- * its review ID is 188774. We currently replicate the
- * Sun behavior.
- *
- * @param rect the bounds of the child of JSplitPane whose
- * border is to be painted.
- */
- private void paintRect(Graphics g, int suppress,
- boolean shadeBottomLeftPixel,
- int x, int y,
- Rectangle rect)
- {
- if (rect == null)
- return;
-
- /* On each edge, the border exceeds the enclosed child by one
- * pixel. See the image "BasicBorders.SplitPaneBorder-1.png" in
- * the directory "doc-files".
- */
- x += rect.x - 1;
- y += rect.y - 1;
- int right = x + rect.width + 1;
- int bottom = y + rect.height + 1;
-
- Color oldColor = g.getColor();
- try
- {
- g.setColor(shadow);
- if ((suppress & SUPPRESS_TOP) == 0)
- g.drawLine(x, y, right, y);
- if ((suppress & SUPPRESS_LEFT) == 0)
- g.drawLine(x, y, x, bottom);
- else
- g.drawLine(x, bottom, x, bottom); // one pixel
-
- g.setColor(highlight);
- if ((suppress & SUPPRESS_BOTTOM) == 0)
- g.drawLine(x + (shadeBottomLeftPixel ? 1 : 0), bottom, right, bottom);
- else if (!shadeBottomLeftPixel)
- g.drawLine(x, bottom, x, bottom); // one pixel
-
- if ((suppress & SUPPRESS_RIGHT) == 0)
- g.drawLine(right, y, right, bottom);
- }
- finally
- {
- g.setColor(oldColor);
- }
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured, usually
- * an instance of {@link javax.swing.JSplitPane}.
- *
- * @return an Insets object whose <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- */
- public Insets getBorderInsets(Component c)
- {
- return new Insets(1, 1, 1, 1);
- }
-
-
- /**
- * Determines whether this border fills every pixel in its area
- * when painting.
- *
- * @return <code>false</code> because this border does not
- * paint over the pixels where the divider joins
- * the border.
- */
- public boolean isBorderOpaque()
- {
- /* Strangely, the Sun implementation (tested with JDK 1.3.1 and
- * 1.4.1_01) seems to always return true. It could be a bug,
- * but without knowing the details of their implementation, it is
- * hard to decide.
- */
- return false;
- }
- }
-
-
- /**
- * A border for the divider inside a JSplitPane.
- *
- * <p><img src="doc-files/BasicBorders.SplitPaneDividerBorder-1.png"
- * width="520" height="200" alt="[A screen shot of this border]" />
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- private static class SplitPaneDividerBorder
- implements Border, UIResource, Serializable
- {
- /**
- * The highlight color, which is drawn on the left or top edge
- * depending on the orientation of the JSplitPanel.
- */
- protected Color highlight;
-
-
- /**
- * The highlight color, which is drawn on the right or bottom edge
- * depending on the orientation of the JSplitPanel.
- */
- protected Color shadow;
-
-
- /**
- * Constructs a new border for drawing the divider of a JSplitPane
- * in the Basic look and feel. The outer parts of the JSplitPane have
- * their own border class, <code>SplitPaneBorder</code>.
- *
- * @param shadow the shadow color.
- * @param highlight the highlight color.
- */
- public SplitPaneDividerBorder(Color highlight, Color shadow)
- {
- this.highlight = (highlight != null) ? highlight : Color.white;
- this.shadow = (shadow != null) ? shadow : Color.black;
- }
-
-
- /**
- * Paints the border around the divider of a <code>JSplitPane</code>.
- *
- * <p><img src="doc-files/BasicBorders.SplitPaneDividerBorder-1.png"
- * width="520" height="200" alt="[A picture that shows which pixels
- * get painted in what color]" />
- *
- * @param c the <code>JSplitPane</code> whose divider&#x2019;s border
- * is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- Color oldColor, dcol;
- int x2, y2;
- JSplitPane sp;
-
- sp = getSplitPane(c);
- if (sp == null)
- return;
-
- x2 = x + width - 1;
- y2 = y + height - 1;
- oldColor = g.getColor();
- dcol = c.getBackground();
- try
- {
- switch (sp.getOrientation())
- {
- case JSplitPane.HORIZONTAL_SPLIT:
- g.setColor(dcol);
- g.drawLine(x + 1, y, x2 - 1, y);
- g.drawLine(x + 1, y2, x2 - 1, y2);
- g.setColor(sp.getLeftComponent() != null ? highlight : dcol);
- g.drawLine(x, y, x, y2);
- g.setColor(sp.getRightComponent() != null ? shadow : dcol);
- g.drawLine(x2, y, x2, y2);
- break;
-
- case JSplitPane.VERTICAL_SPLIT:
- g.setColor(dcol);
- g.drawLine(x, y + 1, x, y2 - 1);
- g.drawLine(x2, y + 1, x2, y2 - 1);
- g.setColor(sp.getTopComponent() != null ? highlight : dcol);
- g.drawLine(x, y, x2, y);
- g.setColor(sp.getBottomComponent() != null ? shadow : dcol);
- g.drawLine(x, y2, x2, y2);
- break;
- }
- }
- finally
- {
- g.setColor(oldColor);
- }
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured, usually
- * an instance of {@link javax.swing.JSplitPane}.
- *
- * @return an Insets object whose <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- */
- public Insets getBorderInsets(Component c)
- {
- return new Insets(1, 1, 1, 1);
- }
-
-
- /**
- * Determines whether this border fills every pixel in its area
- * when painting.
- *
- * @return <code>true</code> if both highlight and shadow
- * color are fully opaque.
- */
- public boolean isBorderOpaque()
- {
- return (highlight.getAlpha() == 255) && (shadow.getAlpha() == 255);
- }
-
-
- /**
- * Determines the JSplitPane whose divider is being painted.
- *
- * @param c an instance of BasicSplitPaneDivider.
- *
- * @return a <code>JSplitPane</code>, or <code>null</code> if
- * <code>c</code> is not an instance of {@link
- * javax.swing.plaf.basic.BasicSplitPaneDivider}.
- */
- private JSplitPane getSplitPane(Component c)
- {
- if (c instanceof BasicSplitPaneDivider)
- return (((BasicSplitPaneDivider) c).getBasicSplitPaneUI())
- .getSplitPane();
- else
- return null;
- }
- }
-
-
- /**
- * A border for toggle buttons in the Basic look and feel.
- *
- * <p><img src="doc-files/BasicBorders.ToggleButtonBorder-1.png"
- * width="270" height="135" alt="[A screen shot of this border]" />
- *
- * <p>The Sun implementation always seems to draw exactly
- * the same border, irrespective of the state of the button.
- * This is rather surprising, but GNU Classpath emulates the
- * observable behavior.
- *
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
- public static class ToggleButtonBorder
- extends ButtonBorder
- {
- /**
- * Determined using the <code>serialver</code> tool
- * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
- */
- static final long serialVersionUID = -3528666548001058394L;
-
-
- /**
- * Constructs a new border for drawing a JToggleButton in
- * the Basic look and feel.
- *
- * @param shadow the shadow color.
- * @param darkShadow a darker variant of the shadow color.
- * @param highlight the highlight color.
- * @param lightHighlight a brighter variant of the highlight color.
- */
- public ToggleButtonBorder(Color shadow, Color darkShadow,
- Color highlight, Color lightHighlight)
- {
- /* The superclass ButtonBorder substitutes null arguments
- * with fallback colors.
- */
- super(shadow, darkShadow, highlight, lightHighlight);
- }
-
-
- /**
- * Paints the ToggleButtonBorder around a given component.
- *
- * <p>The Sun implementation always seems to draw exactly
- * the same border, irrespective of the state of the button.
- * This is rather surprising, but GNU Classpath emulates the
- * observable behavior.
- *
- * @param c the component whose border is to be painted.
- * @param g the graphics for painting.
- * @param x the horizontal position for painting the border.
- * @param y the vertical position for painting the border.
- * @param width the width of the available area for painting the border.
- * @param height the height of the available area for painting the border.
- *
- * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
- */
- public void paintBorder(Component c, Graphics g,
- int x, int y, int width, int height)
- {
- /* The author of this code tried various variants for setting
- * the state of the enclosed JToggleButton, but it seems that
- * the drawn border is always identical. Weird, because this
- * means that the user does not see whether the JToggleButton
- * is selected or not.
- */
- BasicGraphicsUtils.drawBezel(g, x, y, width, height,
- /* pressed */ false,
- /* default */ false,
- shadow, darkShadow,
- highlight, lightHighlight);
- }
-
-
- /**
- * Measures the width of this border.
- *
- * @param c the component whose border is to be measured.
- *
- * @return an Insets object whose <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
- */
- public Insets getBorderInsets(Component c)
- {
- /* There is no obvious reason for overriding this method, but we
- * try to have exactly the same API as the Sun reference
- * implementation.
- */
- return getBorderInsets(c, null);
- }
-
-
- /**
- * Measures the width of this border, storing the results into a
- * pre-existing Insets object.
- *
- * @param insets an Insets object for holding the result values.
- * After invoking this method, the <code>left</code>,
- * <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields indicate the width of the
- * border at the respective edge.
- *
- * @return the same object that was passed for <code>insets</code>.
- *
- * @see #getBorderInsets()
- */
- public Insets getBorderInsets(Component c, Insets insets)
- {
- /* The exact amount has been determined using a test program
- * that was run on the Apple/Sun JDK 1.3.1 on MacOS X, and the
- * Sun JDK 1.4.1_01 on GNU/Linux for x86. Both gave [2,2,2,2].
- */
- if (insets == null)
- return new Insets(2, 2, 2, 2);
-
- insets.left = insets.right = insets.top = insets.bottom = 2;
- return insets;
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicButtonListener.java b/libjava/javax/swing/plaf/basic/BasicButtonListener.java
deleted file mode 100644
index 1d7f940ff4e..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicButtonListener.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/* BasicButtonListener.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.InputEvent;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.AbstractAction;
-import javax.swing.AbstractButton;
-import javax.swing.ButtonModel;
-import javax.swing.JComponent;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-public class BasicButtonListener
- implements MouseListener, MouseMotionListener, FocusListener,
- ChangeListener, PropertyChangeListener
-{
- public BasicButtonListener(AbstractButton b)
- {
- // Do nothing here.
- }
-
- public void propertyChange(PropertyChangeEvent e)
- {
- }
-
- protected void checkOpacity(AbstractButton b)
- {
- }
-
- public void focusGained(FocusEvent e)
- {
- if (e.getSource() instanceof AbstractButton)
- {
- AbstractButton button = (AbstractButton) e.getSource();
- if (button.isFocusPainted())
- button.repaint();
- }
- }
-
- public void focusLost(FocusEvent e)
- {
- if (e.getSource() instanceof AbstractButton)
- {
- AbstractButton button = (AbstractButton) e.getSource();
- ButtonModel model = button.getModel();
- model.setArmed(false);
-
- if (button.isFocusPainted())
- button.repaint();
- }
- }
-
- public void installKeyboardActions(JComponent c)
- {
- c.getActionMap().put("pressed",
- new AbstractAction()
- {
- public void actionPerformed(ActionEvent e)
- {
- AbstractButton button = (AbstractButton) e.getSource();
- ButtonModel model = button.getModel();
- // It is important that these transitions happen in this order.
- model.setArmed(true);
- model.setPressed(true);
- }
- });
-
- c.getActionMap().put("released",
- new AbstractAction()
- {
- public void actionPerformed(ActionEvent e)
- {
- AbstractButton button = (AbstractButton) e.getSource();
- ButtonModel model = button.getModel();
- // It is important that these transitions happen in this order.
- model.setPressed(false);
- model.setArmed(false);
- }
- });
- }
-
- public void uninstallKeyboardActions(JComponent c)
- {
- c.getActionMap().put("pressed", null);
- c.getActionMap().put("released", null);
- }
-
- public void stateChanged(ChangeEvent e)
- {
- }
-
- public void mouseMoved(MouseEvent e)
- {
- }
-
- public void mouseDragged(MouseEvent e)
- {
- }
-
- public void mouseClicked(MouseEvent e)
- {
- }
-
- /**
- * Accept a mouse press event and arm the button.
- *
- * @param e The mouse press event to accept
- */
- public void mousePressed(MouseEvent e)
- {
- if (e.getSource() instanceof AbstractButton)
- {
- AbstractButton button = (AbstractButton) e.getSource();
- ButtonModel model = button.getModel();
- if (e.getButton() == MouseEvent.BUTTON1)
- {
- // It is important that these transitions happen in this order.
- model.setArmed(true);
- model.setPressed(true);
- }
- }
- }
-
- /**
- * Accept a mouse release event and set the button's
- * "pressed" property to <code>true</code>, if the model
- * is armed. If the model is not armed, ignore the event.
- *
- * @param e The mouse release event to accept
- */
- public void mouseReleased(MouseEvent e)
- {
- if (e.getSource() instanceof AbstractButton)
- {
- AbstractButton button = (AbstractButton) e.getSource();
- ButtonModel model = button.getModel();
- if (e.getButton() == MouseEvent.BUTTON1)
- {
- // It is important that these transitions happen in this order.
- model.setPressed(false);
- model.setArmed(false);
- }
- }
- }
-
- /**
- * Accept a mouse enter event and set the button's "rollover" property to
- * <code>true</code>, if the button's "rolloverEnabled" property is
- * <code>true</code>. If the button is currently armed and the mouse
- * button is not held down, this enter event will also disarm the model.
- *
- * @param e The mouse enter event to accept
- */
- public void mouseEntered(MouseEvent e)
- {
- if (e.getSource() instanceof AbstractButton)
- {
- AbstractButton button = (AbstractButton) e.getSource();
- ButtonModel model = button.getModel();
- if (button.isRolloverEnabled())
- model.setRollover(true);
-
- if (model.isPressed()
- && (e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0)
- model.setArmed(true);
- else
- model.setArmed(false);
- }
- }
-
- /**
- * Accept a mouse exit event and set the button's model's "rollover"
- * property to <code>false</code>, if it's "rolloverEnabled" property is
- * <code>true</code>. Also disarm the button.
- *
- * @param e The mouse exit event to accept
- */
- public void mouseExited(MouseEvent e)
- {
- if (e.getSource() instanceof AbstractButton)
- {
- AbstractButton button = (AbstractButton) e.getSource();
- ButtonModel model = button.getModel();
- if (button.isRolloverEnabled())
- model.setRollover(false);
- model.setArmed(false);
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicButtonUI.java b/libjava/javax/swing/plaf/basic/BasicButtonUI.java
deleted file mode 100644
index d55c776b1d3..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicButtonUI.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/* BasicButtonUI.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-
-import javax.swing.AbstractButton;
-import javax.swing.ButtonModel;
-import javax.swing.Icon;
-import javax.swing.InputMap;
-import javax.swing.JComponent;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ButtonUI;
-import javax.swing.plaf.ComponentUI;
-
-public class BasicButtonUI extends ButtonUI
-{
- /**
- * A constant used to pad out elements in the button's layout and
- * preferred size calculations.
- */
- protected int defaultTextIconGap = 4;
-
- /**
- * A constant added to the defaultTextIconGap to adjust the text
- * within this particular button.
- */
- protected int defaultTextShiftOffset = 0;
-
- private int textShiftOffset;
-
- private Color focusColor;
-
- /**
- * Factory method to create an instance of BasicButtonUI for a given
- * {@link JComponent}, which should be an {@link AbstractButton}.
- *
- * @param c The component to create a UI got
- *
- * @return A new UI capable of drawing the component
- */
- public static ComponentUI createUI(final JComponent c)
- {
- return new BasicButtonUI();
- }
-
- public int getDefaultTextIconGap(AbstractButton b)
- {
- return defaultTextIconGap;
- }
-
- protected void clearTextShiftOffset()
- {
- textShiftOffset = 0;
- }
-
- protected int getTextShiftOffset()
- {
- return textShiftOffset;
- }
-
- protected void setTextShiftOffset()
- {
- textShiftOffset = defaultTextShiftOffset;
- }
-
- /**
- * Returns the prefix for the UI defaults property for this UI class.
- * This is &apos;Button&apos; for this class.
- *
- * @return the prefix for the UI defaults property
- */
- protected String getPropertyPrefix()
- {
- return "Button";
- }
-
- protected void installDefaults(AbstractButton b)
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- String prefix = getPropertyPrefix();
- focusColor = defaults.getColor(prefix + ".focus");
- b.setForeground(defaults.getColor(prefix + ".foreground"));
- b.setBackground(defaults.getColor(prefix + ".background"));
- b.setMargin(defaults.getInsets(prefix + ".margin"));
- b.setBorder(defaults.getBorder(prefix + ".border"));
- b.setIconTextGap(defaults.getInt(prefix + ".textIconGap"));
- b.setInputMap(JComponent.WHEN_FOCUSED,
- (InputMap) defaults.get(prefix + ".focusInputMap"));
- b.setOpaque(true);
- }
-
- protected void uninstallDefaults(AbstractButton b)
- {
- b.setForeground(null);
- b.setBackground(null);
- b.setBorder(null);
- b.setIconTextGap(defaultTextIconGap);
- b.setMargin(null);
- }
-
- protected BasicButtonListener listener;
-
- protected BasicButtonListener createButtonListener(AbstractButton b)
- {
- return new BasicButtonListener(b);
- }
-
- protected void installListeners(AbstractButton b)
- {
- listener = createButtonListener(b);
- b.addChangeListener(listener);
- b.addPropertyChangeListener(listener);
- b.addFocusListener(listener);
- b.addMouseListener(listener);
- b.addMouseMotionListener(listener);
- }
-
- protected void uninstallListeners(AbstractButton b)
- {
- b.removeChangeListener(listener);
- b.removePropertyChangeListener(listener);
- b.removeFocusListener(listener);
- b.removeMouseListener(listener);
- b.removeMouseMotionListener(listener);
- }
-
- protected void installKeyboardActions(AbstractButton b)
- {
- listener.installKeyboardActions(b);
- }
-
- protected void uninstallKeyboardActions(AbstractButton b)
- {
- listener.uninstallKeyboardActions(b);
- }
-
- /**
- * Install the BasicButtonUI as the UI for a particular component.
- * This means registering all the UI's listeners with the component,
- * and setting any properties of the button which are particular to
- * this look and feel.
- *
- * @param c The component to install the UI into
- */
- public void installUI(final JComponent c)
- {
- super.installUI(c);
- if (c instanceof AbstractButton)
- {
- AbstractButton b = (AbstractButton) c;
- installDefaults(b);
- installListeners(b);
- installKeyboardActions(b);
- }
- }
-
- /**
- * Calculate the preferred size of this component, by delegating to
- * {@link BasicGraphicsUtils.getPreferredButtonSize}.
- *
- * @param c The component to measure
- *
- * @return The preferred dimensions of the component
- */
- public Dimension getPreferredSize(JComponent c)
- {
- AbstractButton b = (AbstractButton)c;
- Dimension d =
- BasicGraphicsUtils.getPreferredButtonSize
- (b, defaultTextIconGap + defaultTextShiftOffset);
- return d;
- }
-
- private static Icon currentIcon(AbstractButton b)
- {
- Icon i = b.getIcon();
- ButtonModel model = b.getModel();
-
- if (model.isPressed() && b.getPressedIcon() != null)
- i = b.getPressedIcon();
-
- else if (model.isRollover())
- {
- if (b.isSelected() && b.getRolloverSelectedIcon() != null)
- i = b.getRolloverSelectedIcon();
- else if (b.getRolloverIcon() != null)
- i = b.getRolloverIcon();
- }
-
- else if (b.isSelected())
- {
- if (b.isEnabled() && b.getSelectedIcon() != null)
- i = b.getSelectedIcon();
- else if (b.getDisabledSelectedIcon() != null)
- i = b.getDisabledSelectedIcon();
- }
-
- else if (! b.isEnabled() && b.getDisabledIcon() != null)
- i = b.getDisabledIcon();
-
- return i;
- }
-
- /**
- * Paint the component, which is an {@link AbstractButton}, according to
- * its current state.
- *
- * @param g The graphics context to paint with
- * @param c The component to paint the state of
- */
- public void paint(Graphics g, JComponent c)
- {
- AbstractButton b = (AbstractButton) c;
-
- Rectangle tr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle vr = new Rectangle();
-
- Font f = c.getFont();
-
- g.setFont(f);
-
- SwingUtilities.calculateInnerArea(b, vr);
- String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f),
- b.getText(),
- currentIcon(b),
- b.getVerticalAlignment(),
- b.getHorizontalAlignment(),
- b.getVerticalTextPosition(),
- b.getHorizontalTextPosition(),
- vr, ir, tr,
- b.getIconTextGap()
- + defaultTextShiftOffset);
-
- if ((b.getModel().isArmed() && b.getModel().isPressed())
- || b.isSelected())
- paintButtonPressed(g, b);
- else
- paintButtonNormal(g, vr, c);
-
- paintIcon(g, c, ir);
- if (text != null)
- paintText(g, b, tr, text);
- paintFocus(g, b, vr, tr, ir);
- }
-
- /**
- * Paint any focus decoration this {@link JComponent} might have. The
- * component, which in this case will be an {@link AbstractButton},
- * should only have focus decoration painted if it has the focus, and its
- * "focusPainted" property is <code>true</code>.
- *
- * @param g Graphics context to paint with
- * @param b Button to paint the focus of
- * @param vr Visible rectangle, the area in which to paint
- * @param tr Text rectangle, contained in visible rectangle
- * @param ir Icon rectangle, contained in visible rectangle
- *
- * @see AbstractButton.isFocusPainted()
- * @see JComponent.hasFocus()
- */
- protected void paintFocus(Graphics g, AbstractButton b, Rectangle vr,
- Rectangle tr, Rectangle ir)
- {
- if (b.hasFocus() && b.isFocusPainted())
- {
- Color saved_color = g.getColor();
- g.setColor(focusColor);
- Rectangle focusRect = ir.union(tr);
- g.drawRect(focusRect.x, focusRect.y,
- focusRect.width, focusRect.height);
- g.setColor(saved_color);
- }
- }
-
- /**
- * Paint the icon for this component. Depending on the state of the
- * component and the availability of the button's various icon
- * properties, this might mean painting one of several different icons.
- *
- * @param g Graphics context to paint with
- * @param c Component to paint the icon of
- * @param iconRect Rectangle in which the icon should be painted
- */
- protected void paintIcon(Graphics g, JComponent c, Rectangle iconRect)
- {
- AbstractButton b = (AbstractButton) c;
- Icon i = currentIcon(b);
-
- if (i != null)
- i.paintIcon(c, g, iconRect.x, iconRect.y);
- }
-
- /**
- * Paints the background area of an {@link AbstractButton} in the pressed
- * state. This means filling the supplied area with the {@link
- * pressedBackgroundColor}.
- *
- * @param g The graphics context to paint with
- * @param b The button to paint the state of
- */
- protected void paintButtonPressed(Graphics g, AbstractButton b)
- {
- if (b.isContentAreaFilled())
- {
- Rectangle area = new Rectangle();
- SwingUtilities.calculateInnerArea(b, area);
- g.setColor(b.getBackground().darker());
- g.fillRect(area.x, area.y, area.width, area.height);
- }
- }
-
- /**
- * Paints the background area of an {@link AbstractButton} in the normal,
- * non-pressed state. This means filling the supplied area with the
- * {@link normalBackgroundColor}.
- *
- * @param g The graphics context to paint with
- * @param area The area in which to paint
- * @param b The component to paint the state of
- */
- private void paintButtonNormal(Graphics g, Rectangle area, JComponent b)
- {
- if (((AbstractButton)b).isContentAreaFilled() && b.isOpaque())
- {
- g.setColor(b.getBackground());
- g.fillRect(area.x, area.y, area.width, area.height);
- }
- }
-
- /**
- * Paints the "text" property of an {@link AbstractButton}, using the
- * {@link textColor} color.
- *
- * @param g The graphics context to paint with
- * @param c The component to paint the state of
- * @param textRect The area in which to paint the text
- * @param text The text to paint
- */
- protected void paintText(Graphics g, JComponent c, Rectangle textRect,
- String text)
- {
- paintText(g, (AbstractButton) c, textRect, text);
- }
-
- /**
- * Paints the "text" property of an {@link AbstractButton}, using the
- * {@link textColor} color.
- *
- * @param g The graphics context to paint with
- * @param b The button to paint the state of
- * @param textRect The area in which to paint the text
- * @param text The text to paint
- *
- * @since 1.4
- */
- protected void paintText(Graphics g, AbstractButton b, Rectangle textRect,
- String text)
- {
- Font f = b.getFont();
- g.setFont(f);
- FontMetrics fm = g.getFontMetrics(f);
-
- if (b.isEnabled())
- {
- g.setColor(b.getForeground());
- g.drawString(text, textRect.x, textRect.y + fm.getAscent());
- }
- else
- {
- g.setColor(b.getBackground().brighter());
- g.drawString(text, textRect.x, textRect.y + fm.getAscent());
- g.setColor(b.getBackground().darker());
- g.drawString(text, textRect.x + 1, textRect.y + fm.getAscent() + 1);
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java b/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
deleted file mode 100644
index da11898bf0b..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* BasicCheckBoxMenuItemUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.event.MouseEvent;
-
-import javax.swing.JComponent;
-import javax.swing.JMenuItem;
-import javax.swing.MenuElement;
-import javax.swing.MenuSelectionManager;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-
-/**
- * DOCUMENT ME!
- */
-public class BasicCheckBoxMenuItemUI extends BasicMenuItemUI
-{
- /**
- * Factory method to create a BasicCheckBoxMenuItemUI for the given {@link
- * JComponent}, which should be a JCheckBoxMenuItem
- *
- * @param c The {@link JComponent} a UI is being created for.
- *
- * @return A BasicCheckBoxMenuItemUI for the {@link JComponent}.
- */
- public static ComponentUI createUI(final JComponent c)
- {
- return new BasicCheckBoxMenuItemUI();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return $returnType$ DOCUMENT ME!
- */
- protected String getPropertyPrefix()
- {
- return null;
- }
-
- /**
- * This method installs the defaults that are defined in the Basic look and
- * feel for this JRadioButtonMenuItem
- */
- protected void installDefaults()
- {
- super.installDefaults();
-
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- checkIcon = defaults.getIcon("CheckBoxMenuItem.checkIcon");
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param item DOCUMENT ME!
- * @param e DOCUMENT ME!
- * @param path DOCUMENT ME!
- * @param manager DOCUMENT ME!
- */
- public void processMouseEvent(JMenuItem item, MouseEvent e,
- MenuElement[] path,
- MenuSelectionManager manager)
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java b/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java
deleted file mode 100644
index a5bf9f9c995..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* BasicCheckBoxUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import javax.swing.Icon;
-import javax.swing.JComponent;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-
-public class BasicCheckBoxUI extends BasicRadioButtonUI
-{
-
- public static ComponentUI createUI(final JComponent c) {
- return new BasicCheckBoxUI();
- }
-
- public Icon getDefaultIcon()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- return defaults.getIcon("CheckBox.icon");
- }
-
- public void installUI(final JComponent c) {
- super.installUI(c);
- }
-}
-
-
-
-
diff --git a/libjava/javax/swing/plaf/basic/BasicColorChooserUI.java b/libjava/javax/swing/plaf/basic/BasicColorChooserUI.java
deleted file mode 100644
index 4e6d3815453..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicColorChooserUI.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/* BasicColorChooserUI.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.JColorChooser;
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-import javax.swing.JTabbedPane;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.colorchooser.AbstractColorChooserPanel;
-import javax.swing.colorchooser.ColorChooserComponentFactory;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ColorChooserUI;
-import javax.swing.plaf.ComponentUI;
-
-/**
- * This is the UI Class for the JColorChooser in the Basic Look and Feel.
- */
-public class BasicColorChooserUI extends ColorChooserUI
-{
- /**
- * This helper class handles property changes from the JColorChooser.
- */
- public class PropertyHandler implements PropertyChangeListener
- {
- /**
- * This method is called when any of the properties of the JColorChooser
- * change.
- *
- * @param e The PropertyChangeEvent.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getPropertyName() == JColorChooser.CHOOSER_PANELS_PROPERTY)
- makeTabs(chooser.getChooserPanels());
- else if (e.getPropertyName() == JColorChooser.PREVIEW_PANEL_PROPERTY)
- updatePreviewPanel(chooser.getPreviewPanel());
- else if (e.getPropertyName() == JColorChooser.SELECTION_MODEL_PROPERTY)
- ((AbstractColorChooserPanel) pane.getSelectedComponent())
- .updateChooser();
-
- chooser.repaint();
- }
- }
-
- /**
- * This is a helper class that listens to the Model of the JColorChooser for
- * color change events so it can update the preview panel.
- */
- private class PreviewListener implements ChangeListener
- {
- /**
- * This method is called whenever the JColorChooser's color changes.
- *
- * @param e The ChangeEvent.
- */
- public void stateChanged(ChangeEvent e)
- {
- if (pane != null)
- {
- AbstractColorChooserPanel panel = (AbstractColorChooserPanel) pane
- .getSelectedComponent();
- if (panel != null)
- panel.updateChooser();
- }
- chooser.repaint();
- }
- }
-
- /**
- * This helper class listens to the JTabbedPane that is used for tab
- * changes.
- */
- private class TabPaneListener implements ChangeListener
- {
- /**
- * This method is called whenever a different tab is selected in the
- * JTabbedPane.
- *
- * @param e The ChangeEvent.
- */
- public void stateChanged(ChangeEvent e)
- {
- // Need to do this because we don't update all the tabs when they're not
- // visible, so they are not informed of new colors when they're hidden.
- AbstractColorChooserPanel comp = (AbstractColorChooserPanel) pane
- .getSelectedComponent();
- comp.updateChooser();
- }
- }
-
- /** An array of default choosers to use in the JColorChooser. */
- protected AbstractColorChooserPanel[] defaultChoosers;
-
- /** The listener for the preview panel. */
- protected ChangeListener previewListener;
-
- /** The PropertyChangeListener for the JColorChooser. */
- protected PropertyChangeListener propertyChangeListener;
-
- /**
- * The JColorChooser.
- * This is package-private to avoid an accessor method.
- */
- JColorChooser chooser;
-
- /** The JTabbedPane that is used. */
- JTabbedPane pane;
-
- /** The Container that holds the preview panel. */
- private Container prevContainer;
-
- /**
- * Creates a new BasicColorChooserUI object.
- */
- public BasicColorChooserUI()
- {
- super();
- }
-
- /**
- * This method creates a new UI Component for the given JComponent.
- *
- * @param c The JComponent to create an UI for.
- *
- * @return A new BasicColorChooserUI.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicColorChooserUI();
- }
-
- /**
- * This method creates the default chooser panels for the JColorChooser.
- *
- * @return The default chooser panels.
- */
- protected AbstractColorChooserPanel[] createDefaultChoosers()
- {
- return ColorChooserComponentFactory.getDefaultChooserPanels();
- }
-
- /**
- * This method installs the UI Component for the given JComponent.
- *
- * @param c The JComponent to install this UI for.
- */
- public void installUI(JComponent c)
- {
- if (c instanceof JColorChooser)
- {
- chooser = (JColorChooser) c;
- chooser.setLayout(new BorderLayout());
-
- // Do this first, so we avoid doing work for property change events.
- defaultChoosers = createDefaultChoosers();
- chooser.setChooserPanels(defaultChoosers);
- pane = new JTabbedPane();
-
- pane.addChangeListener(new ChangeListener()
- {
- public void stateChanged(ChangeEvent e)
- {
- pane.repaint();
- }
- });
-
- makeTabs(defaultChoosers);
-
- chooser.add(pane, BorderLayout.NORTH);
-
- installPreviewPanel();
-
- installDefaults();
- installListeners();
- }
- }
-
- /**
- * This method adds tabs to the JTabbedPane for the chooserPanels defined in
- * the JColorChooser.
- * This is package-private to avoid an accessor method.
- *
- * @param panels The Panels that need tabs to be made for them.
- */
- void makeTabs(AbstractColorChooserPanel[] panels)
- {
- pane.removeAll();
- for (int i = 0; i < panels.length; i++)
- pane.addTab(panels[i].getDisplayName(), panels[i].getSmallDisplayIcon(),
- panels[i]);
- }
-
- /**
- * This method uninstalls this UI for the given JComponent.
- *
- * @param c The JComponent that will have this UI removed.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallListeners();
- uninstallDefaults();
-
- pane = null;
- chooser = null;
- }
-
- /**
- * This method installs the preview panel for the JColorChooser.
- */
- protected void installPreviewPanel()
- {
- updatePreviewPanel(ColorChooserComponentFactory.getPreviewPanel());
- }
-
- /**
- * This is a helper method that swaps the existing preview panel with the
- * given panel.
- * This is package-private to avoid an accessor method.
- *
- * @param preview The new preview panel.
- */
- void updatePreviewPanel(JComponent preview)
- {
- if (prevContainer == null)
- {
- prevContainer = new JPanel();
- prevContainer.setLayout(new BorderLayout());
- chooser.add(prevContainer, BorderLayout.CENTER);
- }
- prevContainer.removeAll();
- prevContainer.add(preview, BorderLayout.CENTER);
- }
-
- /**
- * This method installs the default properties given by the Basic Look and
- * Feel.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- chooser.setFont(defaults.getFont("ColorChooser.font"));
- chooser.setForeground(defaults.getColor("ColorChooser.foreground"));
- chooser.setBackground(defaults.getColor("ColorChooser.background"));
- }
-
- /**
- * This method uninstalls the default properties given by the Basic Look and
- * Feel.
- */
- protected void uninstallDefaults()
- {
- chooser.setBackground(null);
- chooser.setForeground(null);
- chooser.setFont(null);
- }
-
- /**
- * This method installs any listeners required for this UI to function.
- */
- protected void installListeners()
- {
- propertyChangeListener = createPropertyChangeListener();
- previewListener = new PreviewListener();
-
- chooser.addPropertyChangeListener(propertyChangeListener);
- chooser.getSelectionModel().addChangeListener(previewListener);
-
- pane.addChangeListener(new TabPaneListener());
- }
-
- /**
- * This method creates the PropertyChangeListener used for listening to the
- * JColorChooser.
- *
- * @return A PropertyChangeListener.
- */
- protected PropertyChangeListener createPropertyChangeListener()
- {
- return new PropertyHandler();
- }
-
- /**
- * This method uninstalls any listeners that were previously installed by
- * the UI.
- */
- protected void uninstallListeners()
- {
- chooser.removePropertyChangeListener(propertyChangeListener);
- chooser.getSelectionModel().removeChangeListener(previewListener);
-
- previewListener = null;
- propertyChangeListener = null;
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java b/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java
deleted file mode 100644
index 098e6d00e56..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/* BasicComboBoxEditor.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Component;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-
-import javax.swing.ComboBoxEditor;
-import javax.swing.JTextField;
-import javax.swing.border.EmptyBorder;
-
-/**
- * This is a component that is responsible for displaying/editting selected
- * item in comboBox. By default, the JTextField is returned as
- * BasicComboBoxEditor.
- *
- * @author Olga Rodimina
- */
-public class BasicComboBoxEditor extends Object implements ComboBoxEditor,
- FocusListener
-{
- protected JTextField editor;
-
- /**
- * Creates a new BasicComboBoxEditor object.
- */
- public BasicComboBoxEditor()
- {
- editor = new JTextField();
- editor.setBorder(new EmptyBorder(1, 1, 1, 1));
- }
-
- /**
- * This method returns textfield that will be used by the combo box to
- * display/edit currently selected item in the combo box.
- *
- * @return textfield that will be used by the combo box to display/edit
- * currently selected item
- */
- public Component getEditorComponent()
- {
- return editor;
- }
-
- /**
- * Sets item that should be editted when any editting operation is performed
- * by the user. The value is always equal to the currently selected value
- * in the combo box. Thus whenever a different value is selected from the
- * combo box list then this method should be called to change editting
- * item to the new selected item.
- *
- * @param selectedItem item that is currently selected in the combo box
- */
- public void setItem(Object item)
- {
- editor.setText(item.toString());
- }
-
- /**
- * This method returns item that is currently editable.
- *
- * @return item in the combo box that is currently editable
- */
- public Object getItem()
- {
- return editor.getText();
- }
-
- public void selectAll()
- {
- editor.selectAll();
- }
-
- /**
- * This method is called when textfield gains focus. This will enable
- * editing of the selected item.
- *
- * @param e the FocusEvent describing change in focus.
- */
- public void focusGained(FocusEvent e)
- {
- // FIXME: Need to implement
- }
-
- /**
- * This method is called when textfield loses focus. If during this time any
- * editting operation was performed by the user, then it will be cancelled
- * and selected item will not be changed.
- *
- * @param e the FocusEvent describing change in focus
- */
- public void focusLost(FocusEvent e)
- {
- // FIXME: Need to implement
- }
-
- /**
- * This method adds actionListener to the editor. If the user will edit
- * currently selected item in the textfield and pressEnter, then action
- * will be performed. The actionPerformed of this ActionListener should
- * change the selected item of the comboBox to the newly editted selected
- * item.
- *
- * @param l the ActionListener responsible for changing selected item of the
- * combo box when it is editted by the user.
- */
- public void addActionListener(ActionListener l)
- {
- // FIXME: Need to implement
- }
-
- /**
- * This method removes actionListener from the textfield.
- *
- * @param l the ActionListener to remove from the textfield.
- */
- public void removeActionListener(ActionListener l)
- {
- // FIXME: Need to implement
- }
-
- public static class UIResource extends BasicComboBoxEditor
- implements javax.swing.plaf.UIResource
- {
- /**
- * Creates a new UIResource object.
- */
- public UIResource()
- {
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java b/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java
deleted file mode 100644
index e4fbb8352a9..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/* BasicComboBoxRenderer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Component;
-import java.awt.Dimension;
-import java.io.Serializable;
-
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.ListCellRenderer;
-import javax.swing.SwingConstants;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import javax.swing.border.EmptyBorder;
-
-/**
- * This class is renderer for the combo box.
- *
- * @author Olga Rodimina
- */
-public class BasicComboBoxRenderer extends JLabel implements ListCellRenderer,
- Serializable
-{
- /**
- * This border is used whenever renderer doesn't have a focus.
- */
- protected static Border noFocusBorder = new EmptyBorder(0, 0, 0, 0);
-
- /**
- * Creates a new BasicComboBoxRenderer object.
- */
- public BasicComboBoxRenderer()
- {
- setHorizontalAlignment(SwingConstants.LEFT);
- }
-
- /**
- * Returns preferredSize of the renderer
- *
- * @return preferredSize of the renderer
- */
- public Dimension getPreferredSize()
- {
- return super.getPreferredSize();
- }
-
- /**
- * getListCellRendererComponent
- *
- * @param list List of items for which to the background and foreground
- * colors
- * @param value object that should be rendered in the cell
- * @param index index of the cell in the list of items.
- * @param isSelected draw cell highlighted if isSelected is true
- * @param cellHasFocus draw focus rectangle around cell if the cell has
- * focus
- *
- * @return Component that will be used to draw the desired cell.
- */
- public Component getListCellRendererComponent(JList list, Object value,
- int index, boolean isSelected,
- boolean cellHasFocus)
- {
- String s = value.toString();
- setText(s);
- setOpaque(true);
-
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- if (isSelected)
- {
- setBackground(list.getSelectionBackground());
- setForeground(list.getSelectionForeground());
- }
- else
- {
- setBackground(list.getBackground());
- setForeground(list.getForeground());
- }
-
- setEnabled(list.isEnabled());
- setFont(list.getFont());
-
- // Use focusCellHighlightBorder when renderer has focus and
- // noFocusBorder otherwise
- if (cellHasFocus)
- setBorder(UIManager.getBorder("List.focusCellHighlightBorder"));
- else
- setBorder(noFocusBorder);
-
- return this;
- }
-
- public static class UIResource extends BasicComboBoxRenderer
- implements javax.swing.plaf.UIResource
- {
- /**
- * Creates a new UIResource object.
- */
- public UIResource()
- {
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java b/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java
deleted file mode 100644
index 7ad0638d195..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java
+++ /dev/null
@@ -1,1243 +0,0 @@
-/* BasicComboBoxUI.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.Rectangle;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.accessibility.Accessible;
-import javax.swing.CellRendererPane;
-import javax.swing.ComboBoxEditor;
-import javax.swing.ComboBoxModel;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.JList;
-import javax.swing.ListCellRenderer;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-import javax.swing.plaf.ComboBoxUI;
-import javax.swing.plaf.ComponentUI;
-
-/**
- * UI Delegate for JComboBox
- *
- * @author Olga Rodimina
- * @author Robert Schuster
- */
-public class BasicComboBoxUI extends ComboBoxUI
-{
- /**
- * This arrow button that is displayed in the rigth side of JComboBox. This
- * button is used to hide and show combo box's list of items
- */
- protected JButton arrowButton;
-
- /**
- * The combo box for which this UI delegate is for
- */
- protected JComboBox comboBox;
-
- /**
- * Component that is responsible for displaying/editting selected item of
- * the combo box. By default JTextField is used as an editor for the
- * JComboBox
- */
- protected Component editor;
-
- /**
- * Listener listening to focus events occuring in the JComboBox
- */
- protected FocusListener focusListener;
-
- /**
- * tells whether JComboBox currently has focus
- */
- protected boolean hasFocus;
-
- /**
- * Listener listening to item events fired by the JComboBox
- */
- protected ItemListener itemListener;
-
- /**
- * KeyListener listening to key events that occur while JComboBox has focus
- */
- protected KeyListener keyListener;
-
- /**
- * MouseListener listening to mouse events occuring in the combo box
- */
- private MouseListener mouseListener;
-
- /**
- * List used when rendering selected item of the combo box. The selection
- * and foreground colors for combo box renderer are configured from this
- * list
- */
- protected JList listBox;
-
- /**
- * ListDataListener listening to JComboBox model
- */
- protected ListDataListener listDataListener;
-
- /**
- * Popup list containing combo box's menu items
- */
- protected ComboPopup popup;
- protected KeyListener popupKeyListener;
- protected MouseListener popupMouseListener;
- protected MouseMotionListener popupMouseMotionListener;
-
- /**
- * Listener listening to changes in the bound properties of JComboBox
- */
- protected PropertyChangeListener propertyChangeListener;
-
- /**
- * Colors that are used to render selected item in the combo box.
- */
- private Color shadow;
- private Color darkShadow;
- private Color highlight;
- private Color lightHighlight;
-
- /* Size of the largest item in the comboBox
- * This is package-private to avoid an accessor method.
- */
- Dimension largestItemSize;
-
- // It seems that JComboBox doesn't have a border set explicitely. So we just
- // paint the border everytime combo box is displayed.
-
- /* border insets for this JComboBox
- * This is package-private to avoid an accessor method. */
- static final Insets borderInsets = new Insets(2, 2, 2, 2);
-
- // Width of the arrow button
- // This is package-private to avoid an accessor method.
- // FIXME: has wrong name for a constant.
- static final int arrowButtonWidth = 15;
-
- // FIXME: This fields aren't used anywhere at this moment.
- protected Dimension cachedMinimumSize;
- protected CellRendererPane currentValuePane;
- protected boolean isMinimumSizeDirty;
-
- /**
- * Creates a new BasicComboBoxUI object.
- */
- public BasicComboBoxUI()
- {
- }
-
- /**
- * Factory method to create a BasicComboBoxUI for the given {@link
- * JComponent}, which should be a {@link JComboBox}.
- *
- * @param c The {@link JComponent} a UI is being created for.
- *
- * @return A BasicComboBoxUI for the {@link JComponent}.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicComboBoxUI();
- }
-
- /**
- * This method installs the UI for the given JComponent.
- *
- * @param c The JComponent to install a UI for.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
-
- if (c instanceof JComboBox)
- {
- comboBox = (JComboBox) c;
- comboBox.setOpaque(true);
- comboBox.setLayout(createLayoutManager());
- installDefaults();
- installComponents();
- installListeners();
- installKeyboardActions();
- }
- }
-
- /**
- * This method uninstalls the UI.
- *
- * @param c The JComponent that is having this UI removed.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallKeyboardActions();
- uninstallListeners();
- uninstallComponents();
- uninstallDefaults();
- comboBox = null;
- }
-
- /**
- * This method installs the defaults that are defined in the Basic look and
- * feel for this {@link JComboBox}.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- comboBox.setBackground(defaults.getColor("ComboBox.background"));
- comboBox.setFont(defaults.getFont("ComboBox.font"));
- comboBox.setForeground(defaults.getColor("ComboBox.foreground"));
-
- // Set default color that should be used to to render selected item
- // of the combo box.
- shadow = defaults.getColor("Button.shadow");
- darkShadow = defaults.getColor("Button.darkShadow");
- lightHighlight = defaults.getColor("Button.light");
- highlight = defaults.getColor("Button.highlight");
- }
-
- /**
- * This method creates and installs the listeners for this UI.
- */
- protected void installListeners()
- {
- // install combo box's listeners
- propertyChangeListener = createPropertyChangeListener();
- comboBox.addPropertyChangeListener(propertyChangeListener);
-
- focusListener = createFocusListener();
- comboBox.addFocusListener(focusListener);
-
- itemListener = createItemListener();
- comboBox.addItemListener(itemListener);
-
- keyListener = createKeyListener();
- comboBox.addKeyListener(keyListener);
-
- mouseListener = createMouseListener();
- comboBox.addMouseListener(mouseListener);
-
- // install listeners that listen to combo box model
- listDataListener = createListDataListener();
- comboBox.getModel().addListDataListener(listDataListener);
-
- configureArrowButton();
- }
-
- /**
- * This method uninstalls the defaults and sets any objects created during
- * install to null
- */
- protected void uninstallDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- comboBox.setBackground(null);
- comboBox.setFont(null);
- comboBox.setForeground(null);
-
- shadow = null;
- darkShadow = null;
- lightHighlight = null;
- highlight = null;
- }
-
- /**
- * Detaches all the listeners we attached in {@link #installListeners}.
- */
- protected void uninstallListeners()
- {
- comboBox.removePropertyChangeListener(propertyChangeListener);
- propertyChangeListener = null;
-
- comboBox.removeFocusListener(focusListener);
- focusListener = null;
-
- comboBox.removeItemListener(itemListener);
- itemListener = null;
-
- comboBox.removeKeyListener(keyListener);
- keyListener = null;
-
- comboBox.removeMouseListener(mouseListener);
- mouseListener = null;
-
- comboBox.getModel().removeListDataListener(listDataListener);
- listDataListener = null;
-
- unconfigureArrowButton();
- }
-
- /**
- * This method creates popup that will contain list of combo box's items
- *
- * @return popup containing list of combo box's items
- */
- protected ComboPopup createPopup()
- {
- return new BasicComboPopup(comboBox);
- }
-
- /**
- * Creates KeyListener to listen to key events.
- *
- * @return KeyListener that listens to key events.
- */
- protected KeyListener createKeyListener()
- {
- return new KeyHandler();
- }
-
- /**
- * This method create MouseListener that will listen to mouse event occuring
- * in combo box.
- *
- * @return the MouseListener
- */
- private MouseListener createMouseListener()
- {
- return new MouseHandler();
- }
-
- /**
- * This method create FocusListener that will listen to changes in this
- * JComboBox's focus.
- *
- * @return theFocusListener
- */
- protected FocusListener createFocusListener()
- {
- return new FocusHandler();
- }
-
- /**
- * This method create ListDataListener to listen to ComboBox's data model
- *
- * @return ListDataListener
- */
- protected ListDataListener createListDataListener()
- {
- return new ListDataHandler();
- }
-
- /**
- * This method creates ItemListener that will listen to to the changes in
- * the JComboBox's selection.
- *
- * @return the ItemListener
- */
- protected ItemListener createItemListener()
- {
- return new ItemHandler();
- }
-
- /**
- * This method creates PropertyChangeListener to listen to the changes in
- * the JComboBox's bound properties.
- *
- * @return the PropertyChangeListener
- */
- protected PropertyChangeListener createPropertyChangeListener()
- {
- return new PropertyChangeHandler();
- }
-
- /**
- * This method returns layout manager for the combo box.
- *
- * @return layout manager for the combo box
- */
- protected LayoutManager createLayoutManager()
- {
- return new ComboBoxLayoutManager();
- }
-
- /**
- * This method creates component that will be responsible for rendering the
- * selected component in the combo box.
- *
- * @return render for the combo box
- */
- protected ListCellRenderer createRenderer()
- {
- return new BasicComboBoxRenderer();
- }
-
- /**
- * Creates component that will be responsible for displaying/editting
- * selected item in the combo box. This editor is used only when combo box
- * is editable.
- *
- * @return component that will be responsible for displaying/editting
- * selected item in the combo box.
- */
- protected ComboBoxEditor createEditor()
- {
- return new BasicComboBoxEditor();
- }
-
- /**
- * This method installs components for this JComboBox. ArrowButton, main
- * part of combo box (upper part) and popup list of items are created and
- * configured here.
- */
- protected void installComponents()
- {
- // create and install arrow button
- arrowButton = createArrowButton();
-
- comboBox.add(arrowButton);
-
- // Set list that will be used by BasicComboBoxRender
- // in order to determine the right colors when rendering
- listBox = new JList();
-
- Color background = arrowButton.getBackground();
- listBox.setBackground(background);
- listBox.setSelectionBackground(background.darker());
-
- Color foreground = arrowButton.getForeground();
- listBox.setForeground(foreground);
- listBox.setSelectionForeground(foreground);
-
- // set editor and renderer for the combo box. Editor is used
- // only if combo box becomes editable, otherwise renderer is used
- // to paint the selected item; combobox is not editable by default.
- comboBox.setRenderer(createRenderer());
-
- comboBox.setEditor(createEditor());
- editor = comboBox.getEditor().getEditorComponent();
-
- // create drop down list of items
- popup = createPopup();
-
- comboBox.revalidate();
- }
-
- /**
- * This method uninstalls components from this JComboBox
- */
- protected void uninstallComponents()
- {
- // uninstall arrow button
- unconfigureArrowButton();
- comboBox.remove(arrowButton);
- arrowButton = null;
-
- listBox = null;
- popup = null;
-
- comboBox.setRenderer(null);
-
- comboBox.setEditor(null);
- editor = null;
- }
-
- /**
- * This method adds editor to the combo box
- */
- public void addEditor()
- {
- comboBox.add(editor);
- }
-
- /**
- * This method removes editor from the combo box
- */
- public void removeEditor()
- {
- comboBox.remove(editor);
- }
-
- /**
- * This method configures editor for this combo box.
- */
- protected void configureEditor()
- {
- // FIXME: Need to implement. Set font and add listeners.
- }
-
- /**
- * This method removes all the listeners for the editor.
- */
- protected void unconfigureEditor()
- {
- // FIXME: Need to implement
- }
-
- /**
- * This method adds listeners to the arrow button part of the combo box.
- */
- public void configureArrowButton()
- {
- arrowButton.addMouseListener(mouseListener);
- }
-
- /**
- * This method removes listeners from the arrow button part of the combo
- * box.
- */
- public void unconfigureArrowButton()
- {
- arrowButton.removeMouseListener(mouseListener);
- }
-
- /**
- * This method create arrow button for this JComboBox. Arrow button is
- * responsible for displaying / hiding drop down list of items when it is
- * clicked.
- *
- * @return JButton arrow button for this JComboBox.
- */
- protected JButton createArrowButton()
- {
- return new BasicArrowButton(BasicArrowButton.SOUTH);
- }
-
- /**
- * This method checks if popup part of the combo box is visible on the
- * screen
- *
- * @param c The JComboBox to check
- *
- * @return true if popup part of the JComboBox is visible and false
- * otherwise.
- */
- public boolean isPopupVisible(JComboBox c)
- {
- return popup.isVisible();
- }
-
- /**
- * Displays/Hides JComboBox's list of items on the screen.
- *
- * @param c The combo box, for which list of items should be
- * displayed/hidden
- * @param v true if show popup part of the jcomboBox and false to hide.
- */
- public void setPopupVisible(JComboBox c, boolean v)
- {
- if (v)
- popup.show();
- else
- popup.hide();
- }
-
- /**
- * JComboBox is focus traversable if it is editable and not otherwise.
- *
- * @param c combo box for which to check whether it is focus traversable
- *
- * @return true if focus tranversable and false otherwise
- */
- public boolean isFocusTraversable(JComboBox c)
- {
- if (comboBox.isEditable())
- return true;
-
- return false;
- }
-
- /**
- * Paints given menu item using specified graphics context
- *
- * @param g The graphics context used to paint this combo box
- * @param c comboBox which needs to be painted.
- */
- public void paint(Graphics g, JComponent c)
- {
- if (c instanceof JComboBox)
- {
- JComboBox cb = (JComboBox) c;
-
- paintBorder(g, comboBox.getBounds(), hasFocus);
-
- Rectangle rect = rectangleForCurrentValue();
- paintCurrentValueBackground(g, rect, hasFocus);
- paintCurrentValue(g, rect, hasFocus);
- }
- }
-
- private void paintBorder(Graphics g, Rectangle bounds, boolean hasFocus)
- {
- int x = 0;
- int y = 0;
- int width = bounds.width;
- int height = bounds.height;
-
- Color oldColor = g.getColor();
-
- if (! arrowButton.getModel().isPressed())
- BasicGraphicsUtils.drawEtchedRect(g, x, y, width, height, Color.gray,
- Color.white, Color.gray, Color.white);
- else
- {
- g.setColor(darkShadow);
- g.drawRect(x, y, width, height);
- g.setColor(shadow);
- g.drawRect(x + 1, y + 1, width - 3, height - 3);
- }
- g.setColor(oldColor);
- }
-
- /**
- * Returns preferred size for the given menu item.
- *
- * @param c comboBox for which to get preferred size
- *
- * @return $Dimension$ preferred size for the given combo box
- */
- public Dimension getPreferredSize(JComponent c)
- {
- // return null to indicate that combo box's layout will determin its
- // preferred size
- return null;
- }
-
- /**
- * This method returns the minimum size for this {@link JComboBox} for this
- * look and feel.
- *
- * @param c The {@link JComponent} to find the minimum size for.
- *
- * @return The dimensions of the minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return null;
- }
-
- /**
- * This method returns the maximum size for this {@link JComboBox} for this
- * look and feel.
- *
- * @param c The {@link JComponent} to find the maximum size for
- *
- * @return The dimensions of the minimum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return null;
- }
-
- public int getAccessibleChildrenCount(JComponent c)
- {
- // FIXME: Need to implement
- return 0;
- }
-
- public Accessible getAccessibleChild(JComponent c, int i)
- {
- // FIXME: Need to implement
- return null;
- }
-
- /**
- * Returns true if the specified key is a navigation key and false otherwise
- *
- * @param keyCode a key for which to check whether it is navigation key or
- * not.
- *
- * @return true if the specified key is a navigation key and false otherwis
- */
- protected boolean isNavigationKey(int keyCode)
- {
- return false;
- }
-
- /**
- * This method selects next possible item relative to the current selection
- * to be next selected item in the combo box.
- */
- protected void selectNextPossibleValue()
- {
- int index = comboBox.getSelectedIndex();
- if (index != comboBox.getItemCount() - 1)
- comboBox.setSelectedIndex(index + 1);
- }
-
- /**
- * This method selects previous item relative to current selection to be
- * next selected item.
- */
- protected void selectPreviousPossibleValue()
- {
- int index = comboBox.getSelectedIndex();
- if (index != 0)
- comboBox.setSelectedIndex(index - 1);
- }
-
- /**
- * This method displays combo box popup if the popup is not currently shown
- * on the screen and hides it if it is currently shown
- */
- protected void toggleOpenClose()
- {
- setPopupVisible(comboBox, ! isPopupVisible(comboBox));
- }
-
- /**
- * This method returns bounds in which comboBox's selected Item will be
- * displayed
- *
- * @return rectangle bounds in which comboBox's selected Item will be
- * displayed
- */
- protected Rectangle rectangleForCurrentValue()
- {
- Rectangle cbBounds = comboBox.getBounds();
-
- // Subtract width or the arrow button and border insets
- Rectangle rectForCurrentValue = new Rectangle(cbBounds.x
- + borderInsets.left,
- cbBounds.y
- + borderInsets.top,
- cbBounds.width
- - arrowButtonWidth
- - borderInsets.left
- - borderInsets.right,
- cbBounds.height
- - borderInsets.top
- - borderInsets.bottom);
-
- return rectForCurrentValue;
- }
-
- /**
- * This method returns insets of the current border.
- *
- * @return Insets representing space between combo box and its border
- */
- protected Insets getInsets()
- {
- return new Insets(0, 0, 0, 0);
- }
-
- /**
- * This method paints currently selected value in the main part of the combo
- * box (part without popup).
- *
- * @param g graphics context
- * @param bounds Rectangle representing the size of the area in which
- * selected item should be drawn
- * @param hasFocus true if combo box has focus and false otherwise
- */
- public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus)
- {
- if (! comboBox.isEditable())
- {
- Object currentValue = comboBox.getSelectedItem();
- boolean isPressed = arrowButton.getModel().isPressed();
-
- /* Gets the component to be drawn for the current value.
- * If there is currently no selected item we will take an empty
- * String as replacement.
- */
- Component comp = comboBox.getRenderer()
- .getListCellRendererComponent(listBox,
- (currentValue != null ? currentValue : ""),
- -1,
- isPressed,
- hasFocus);
- if (! comboBox.isEnabled())
- comp.setEnabled(false);
-
- g.translate(borderInsets.left, borderInsets.top);
- comp.setBounds(0, 0, bounds.width, bounds.height);
- comp.paint(g);
- g.translate(-borderInsets.left, -borderInsets.top);
-
- comboBox.revalidate();
- }
- else
- comboBox.getEditor().setItem(comboBox.getSelectedItem());
- }
-
- /**
- * This method paints background of part of the combo box, where currently
- * selected value is displayed. If the combo box has focus this method
- * should also paint focus rectangle around the combo box.
- *
- * @param g graphics context
- * @param bounds Rectangle representing the size of the largest item in the
- * comboBox
- * @param hasFocus true if combo box has fox and false otherwise
- */
- public void paintCurrentValueBackground(Graphics g, Rectangle bounds,
- boolean hasFocus)
- {
- // background is painted by renderer, so it seems that nothing
- // should be done here.
- }
-
- /**
- * Returns default size for the combo box that doesn't contain any elements
- * in it
- *
- * @return Default size of the combo box with no elements in it.
- */
- protected Dimension getDefaultSize()
- {
- return new Dimension(6, 17);
- }
-
- /**
- * Returns size of the largest item in the combo box. This size will be the
- * size of the combo box, not including the arrowButton.
- *
- * @return dimensions of the largest item in the combo box.
- */
- protected Dimension getLargestItemSize()
- {
- ComboBoxModel model = comboBox.getModel();
- int numItems = model.getSize();
-
- // if combo box doesn't have any items then simply
- // return its default size
- if (numItems == 0)
- {
- largestItemSize = getDefaultSize();
- return largestItemSize;
- }
-
- Dimension size = new Dimension(0, 0);
-
- // ComboBox's display size should be equal to the
- // size of the largest item in the combo box.
- ListCellRenderer renderer = comboBox.getRenderer();
-
- for (int i = 0; i < numItems; i++)
- {
- Object item = model.getElementAt(i);
- String s = item.toString();
- Component comp = renderer.getListCellRendererComponent(listBox, item,
- -1, false, false);
-
- if (comp.getPreferredSize().getWidth() > size.getWidth())
- size = comp.getPreferredSize();
- }
-
- largestItemSize = size;
- return largestItemSize;
- }
-
- /**
- * This method installs the keyboard actions for the JComboBox as specified
- * by the look and feel.
- */
- protected void installKeyboardActions()
- {
- // FIXME: Need to implement.
- }
-
- /**
- * This method uninstalls the keyboard actions for the JComboBox there were
- * installed by in {@link #installListeners}.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: Need to implement.
- }
-
- /**
- * This class is Layout Manager for this combo box.
- */
- public class ComboBoxLayoutManager extends Object implements LayoutManager
- {
- /**
- * Creates a new ComboBoxLayoutManager object.
- */
- public ComboBoxLayoutManager()
- {
- }
-
- public void addLayoutComponent(String name, Component comp)
- {
- // Do nothing
- }
-
- public void removeLayoutComponent(Component comp)
- {
- // Do nothing
- }
-
- /**
- * Returns preferred layout size of the JComboBox.
- *
- * @param parent Container for which preferred size should be calculated
- *
- * @return preferred size for the given container
- */
- public Dimension preferredLayoutSize(Container parent)
- {
- Dimension d = new Dimension(0, 0);
-
- if (largestItemSize == null)
- largestItemSize = getLargestItemSize();
-
- // add size for the area that will display selected item
- d.width += largestItemSize.getWidth();
- d.height += largestItemSize.getHeight();
-
- // add size of the arrow button
- d.width += arrowButtonWidth;
-
- // add width and height of the border
- d.width += borderInsets.left + borderInsets.right;
- d.height += borderInsets.left + borderInsets.right;
-
- // Add combo box's insets
- Insets insets = parent.getInsets();
- d.width += insets.left + insets.right;
- d.width += insets.left + insets.right;
-
- return d;
- }
-
- public Dimension minimumLayoutSize(Container parent)
- {
- return preferredLayoutSize(parent);
- }
-
- /**
- * This method layouts out the components in the container. It puts arrow
- * button right end part of the comboBox. If the comboBox is editable
- * then editor is placed to the left of arrow button, starting from the
- * beginning.
- *
- * @param parent Container that should be layed out.
- */
- public void layoutContainer(Container parent)
- {
- // Position editor component to the left of arrow button if combo box is
- // editable
- int editorWidth = comboBox.getBounds().width - arrowButtonWidth - 2;
-
- if (comboBox.isEditable())
- editor.setBounds(borderInsets.left, borderInsets.top, editorWidth,
- comboBox.getBounds().height - borderInsets.left
- - borderInsets.top);
-
- arrowButton.setBounds(editorWidth, 2, arrowButtonWidth,
- comboBox.getBounds().height - 4);
- comboBox.revalidate();
- }
- }
-
- /**
- * This class handles focus changes occuring in the combo box. This class is
- * responsible for repainting combo box whenever focus is gained or lost
- * and also for hiding popup list of items whenever combo box loses its
- * focus.
- */
- public class FocusHandler extends Object implements FocusListener
- {
- /**
- * Creates a new FocusHandler object.
- */
- public FocusHandler()
- {
- }
-
- /**
- * This mehtod is invoked when combo box gains focus. It repaints main
- * part of combo box accordingally.
- *
- * @param e the FocusEvent
- */
- public void focusGained(FocusEvent e)
- {
- hasFocus = true;
- comboBox.repaint();
- }
-
- /**
- * This method is invoked when combo box loses focus It repaint main part
- * of combo box accordingally and hides popup list of items.
- *
- * @param e the FocusEvent
- */
- public void focusLost(FocusEvent e)
- {
- hasFocus = false;
- comboBox.repaint();
- popup.hide();
- }
- }
-
- /**
- * This class handles ItemEvent fired by the JComboBox when its selected
- * item changes.
- */
- public class ItemHandler extends Object implements ItemListener
- {
- /**
- * Creates a new ItemHandler object.
- */
- public ItemHandler()
- {
- }
-
- /**
- * This method is invoked when selected item becomes deselected or when
- * new item becomes selected.
- *
- * @param e the ItemEvent representing item's state change.
- */
- public void itemStateChanged(ItemEvent e)
- {
- comboBox.repaint();
- }
- }
-
- /**
- * KeyHandler handles key events occuring while JComboBox has focus.
- */
- public class KeyHandler extends KeyAdapter
- {
- public KeyHandler()
- {
- }
-
- /*
- * This method is invoked whenever key is pressed while JComboBox is in
- * focus.
- */
- public void keyPressed(KeyEvent e)
- {
- // FIXME: This method calls JComboBox.selectWithKeyChar if the key that was
- // pressed is not a navigation key.
- }
- }
-
- /**
- * This class handles to the changes occuring in the JComboBox's data model
- */
- public class ListDataHandler extends Object implements ListDataListener
- {
- /**
- * Creates a new ListDataHandler object.
- */
- public ListDataHandler()
- {
- }
-
- /**
- * This method is invoked content's of JComboBox's data model are changed
- *
- * @param e ListDataEvent describing the change.
- */
- public void contentsChanged(ListDataEvent e)
- {
- // if the item is selected or deselected
- }
-
- /**
- * This method is invoked when items were added to the JComboBox's data
- * model.
- *
- * @param e ListDataEvent describing the change.
- */
- public void intervalAdded(ListDataEvent e)
- {
- // must determine if the size of the combo box should change
- int start = e.getIndex0();
- int end = e.getIndex1();
-
- ComboBoxModel model = comboBox.getModel();
- ListCellRenderer renderer = comboBox.getRenderer();
-
- if (largestItemSize == null)
- largestItemSize = new Dimension(0, 0);
-
- for (int i = start - 1; i < end; i++)
- {
- Object item = model.getElementAt(i);
- Component comp = renderer.getListCellRendererComponent(new JList(),
- item, -1,
- false, false);
- if (comp.getPreferredSize().getWidth() > largestItemSize.getWidth())
- largestItemSize = comp.getPreferredSize();
- }
- }
-
- /**
- * This method is invoked when items were removed from the JComboBox's
- * data model.
- *
- * @param e ListDataEvent describing the change.
- */
- public void intervalRemoved(ListDataEvent e)
- {
- // recalculate display size of the JComboBox.
- largestItemSize = getLargestItemSize();
- comboBox.repaint();
- }
- }
-
- /**
- * This class handles PropertyChangeEvents fired by JComboBox.
- */
- public class PropertyChangeHandler extends Object
- implements PropertyChangeListener
- {
- public PropertyChangeHandler()
- {
- }
-
- /**
- * This method is invoked whenever bound property of JComboBox changes.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getPropertyName().equals("enabled"))
- {
- arrowButton.setEnabled(comboBox.isEnabled());
-
- if (comboBox.isEditable())
- comboBox.getEditor().getEditorComponent().setEnabled(comboBox
- .isEnabled());
- }
- else if (e.getPropertyName().equals("editable"))
- {
- if (comboBox.isEditable())
- {
- configureEditor();
- addEditor();
- }
- else
- {
- unconfigureEditor();
- removeEditor();
- }
-
- comboBox.revalidate();
- comboBox.repaint();
- }
- else if (e.getPropertyName().equals("dataModel"))
- {
- // remove ListDataListener from old model and add it to new model
- ComboBoxModel oldModel = (ComboBoxModel) e.getOldValue();
- if (oldModel != null)
- oldModel.removeListDataListener(listDataListener);
-
- if ((ComboBoxModel) e.getNewValue() != null)
- comboBox.getModel().addListDataListener(listDataListener);
- }
-
- // FIXME: Need to handle changes in other bound properties.
- }
- }
-
- /**
- * MouseHandler listens to mouse events occuring in the combo box. This
- * class is responsible for repainting this JComboBox whenever the mouse is
- * being pressed or released over it.
- */
- private class MouseHandler extends MouseAdapter
- {
- /**
- * This method is invoked when mouse is pressed over the combo box. It
- * repaints the combo box accordinglly
- *
- * @param e the MouseEvent
- */
- public void mousePressed(MouseEvent e)
- {
- if (comboBox.isEnabled())
- {
- if (e.getSource() instanceof JComboBox)
- {
- arrowButton.getModel().setPressed(true);
- arrowButton.getModel().setArmed(true);
- }
-
- comboBox.repaint();
-
- if (e.getSource() instanceof BasicArrowButton)
- toggleOpenClose();
- }
- }
-
- /**
- * This method is invoked when mouse is released over the combo box. It
- * repaints the combo box accordinglly
- *
- * @param e the MouseEvent
- */
- public void mouseReleased(MouseEvent e)
- {
- if (comboBox.isEnabled())
- {
- if (e.getSource() instanceof JComboBox)
- {
- arrowButton.getModel().setPressed(false);
- arrowButton.getModel().setArmed(false);
- }
-
- comboBox.repaint();
- }
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicComboPopup.java b/libjava/javax/swing/plaf/basic/BasicComboPopup.java
deleted file mode 100644
index 73aac8d4e65..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicComboPopup.java
+++ /dev/null
@@ -1,1055 +0,0 @@
-/* BasicComboPopup.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionAdapter;
-import java.awt.event.MouseMotionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.ComboBoxModel;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPopupMenu;
-import javax.swing.JScrollBar;
-import javax.swing.JScrollPane;
-import javax.swing.ListCellRenderer;
-import javax.swing.ListSelectionModel;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.Timer;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.PopupMenuEvent;
-import javax.swing.event.PopupMenuListener;
-
-/**
- * UI Delegate for ComboPopup
- *
- * @author Olga Rodimina
- */
-public class BasicComboPopup extends JPopupMenu implements ComboPopup
-{
- /* Timer for autoscrolling */
- protected Timer autoscrollTimer;
-
- /** ComboBox associated with this popup */
- protected JComboBox comboBox;
-
- /** FIXME: Need to document */
- protected boolean hasEntered;
-
- /**
- * Indicates whether the scroll bar located in popup menu with comboBox's
- * list of items is currently autoscrolling. This happens when mouse event
- * originated in the combo box and is dragged outside of its bounds
- */
- protected boolean isAutoScrolling;
-
- /** ItemListener listening to the selection changes in the combo box */
- protected ItemListener itemListener;
-
- /** This listener is not used */
- protected KeyListener keyListener;
-
- /** JList which is used to display item is the combo box */
- protected JList list;
-
- /** This listener is not used */
- protected ListDataListener listDataListener;
-
- /**
- * MouseListener listening to mouse events occuring in the combo box's
- * list.
- */
- protected MouseListener listMouseListener;
-
- /**
- * MouseMotionListener listening to mouse motion events occuring in the
- * combo box's list
- */
- protected MouseMotionListener listMouseMotionListener;
-
- /** This listener is not used */
- protected ListSelectionListener listSelectionListener;
-
- /** MouseListener listening to mouse events occuring in the combo box */
- protected MouseListener mouseListener;
-
- /**
- * MouseMotionListener listening to mouse motion events occuring in the
- * combo box
- */
- protected MouseMotionListener mouseMotionListener;
-
- /**
- * PropertyChangeListener listening to changes occuring in the bound
- * properties of the combo box
- */
- protected PropertyChangeListener propertyChangeListener;
-
- /** direction for scrolling down list of combo box's items */
- protected static final int SCROLL_DOWN = 1;
-
- /** direction for scrolling up list of combo box's items */
- protected static final int SCROLL_UP = 0;
-
- /** Indicates auto scrolling direction */
- protected int scrollDirection;
-
- /** JScrollPane that contains list portion of the combo box */
- protected JScrollPane scroller;
-
- /** This field is not used */
- protected boolean valueIsAdjusting;
-
- /**
- * Creates a new BasicComboPopup object.
- *
- * @param comboBox the combo box with which this popup should be associated
- */
- public BasicComboPopup(JComboBox comboBox)
- {
- this.comboBox = comboBox;
- installComboBoxListeners();
- configurePopup();
- setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled());
- }
-
- /**
- * This method displays drow down list of combo box items on the screen.
- */
- public void show()
- {
- Rectangle cbBounds = comboBox.getBounds();
-
- // popup should have same width as the comboBox and should be hight anough
- // to display number of rows equal to 'maximumRowCount' property
- int popupHeight = getPopupHeightForRowCount(comboBox.getMaximumRowCount());
-
- list.setPreferredSize(new Dimension(cbBounds.width, popupHeight));
- super.setPopupSize(cbBounds.width, popupHeight);
-
- // Highlight selected item in the combo box's drop down list
- if (comboBox.getSelectedIndex() != -1)
- list.setSelectedIndex(comboBox.getSelectedIndex());
-
- //scroll scrollbar s.t. selected item is visible
- JScrollBar scrollbar = scroller.getVerticalScrollBar();
- int selectedIndex = comboBox.getSelectedIndex();
- if (selectedIndex > comboBox.getMaximumRowCount())
- scrollbar.setValue(getPopupHeightForRowCount(selectedIndex));
-
- // location specified is relative to comboBox
- super.show(comboBox, 0, cbBounds.height);
- }
-
- /**
- * This method hides drop down list of items
- */
- public void hide()
- {
- super.setVisible(false);
- }
-
- /**
- * Return list cointaining JComboBox's items
- *
- * @return list cointaining JComboBox's items
- */
- public JList getList()
- {
- return list;
- }
-
- /**
- * Returns MouseListener that is listening to mouse events occuring in the
- * combo box.
- *
- * @return MouseListener
- */
- public MouseListener getMouseListener()
- {
- return mouseListener;
- }
-
- /**
- * Returns MouseMotionListener that is listening to mouse motion events
- * occuring in the combo box.
- *
- * @return MouseMotionListener
- */
- public MouseMotionListener getMouseMotionListener()
- {
- return mouseMotionListener;
- }
-
- /**
- * Returns KeyListener listening to key events occuring in the combo box.
- * This method returns null because KeyHandler is not longer used.
- *
- * @return KeyListener
- */
- public KeyListener getKeyListener()
- {
- return keyListener;
- }
-
- /**
- * This method uninstalls the UI for the given JComponent.
- */
- public void uninstallingUI()
- {
- uninstallComboBoxModelListeners(comboBox.getModel());
-
- uninstallListeners();
- uninstallKeyboardActions();
- }
-
- /**
- * This method uninstalls listeners that were listening to changes occuring
- * in the comb box's data model
- *
- * @param model data model for the combo box from which to uninstall
- * listeners
- */
- protected void uninstallComboBoxModelListeners(ComboBoxModel model)
- {
- model.removeListDataListener(listDataListener);
- }
-
- /**
- * This method uninstalls keyboard actions installed by the UI.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: Need to implement
- }
-
- /**
- * This method fires PopupMenuEvent indicating that combo box's popup list
- * of items will become visible
- */
- protected void firePopupMenuWillBecomeVisible()
- {
- PopupMenuListener[] ll = comboBox.getPopupMenuListeners();
-
- for (int i = 0; i < ll.length; i++)
- ll[i].popupMenuWillBecomeVisible(new PopupMenuEvent(comboBox));
- }
-
- /**
- * This method fires PopupMenuEvent indicating that combo box's popup list
- * of items will become invisible.
- */
- protected void firePopupMenuWillBecomeInvisible()
- {
- PopupMenuListener[] ll = comboBox.getPopupMenuListeners();
-
- for (int i = 0; i < ll.length; i++)
- ll[i].popupMenuWillBecomeInvisible(new PopupMenuEvent(comboBox));
- }
-
- /**
- * This method fires PopupMenuEvent indicating that combo box's popup list
- * of items was closed without selection.
- */
- protected void firePopupMenuCanceled()
- {
- PopupMenuListener[] ll = comboBox.getPopupMenuListeners();
-
- for (int i = 0; i < ll.length; i++)
- ll[i].popupMenuCanceled(new PopupMenuEvent(comboBox));
- }
-
- /**
- * Creates MouseListener to listen to mouse events occuring in the combo
- * box. Note that this listener doesn't listen to mouse events occuring in
- * the popup portion of the combo box, it only listens to main combo box
- * part.
- *
- * @return new MouseMotionListener that listens to mouse events occuring in
- * the combo box
- */
- protected MouseListener createMouseListener()
- {
- return new InvocationMouseHandler();
- }
-
- /**
- * Create Mouse listener that listens to mouse dragging events occuring in
- * the combo box. This listener is responsible for changing the selection
- * in the combo box list to the component over which mouse is being
- * currently dragged
- *
- * @return new MouseMotionListener that listens to mouse dragging events
- * occuring in the combo box
- */
- protected MouseMotionListener createMouseMotionListener()
- {
- return new InvocationMouseMotionHandler();
- }
-
- /**
- * KeyListener created in this method is not used anymore.
- *
- * @return KeyListener that does nothing
- */
- protected KeyListener createKeyListener()
- {
- return new InvocationKeyHandler();
- }
-
- /**
- * ListSelectionListener created in this method is not used anymore
- *
- * @return ListSelectionListener that does nothing
- */
- protected ListSelectionListener createListSelectionListener()
- {
- return new ListSelectionHandler();
- }
-
- /**
- * Creates ListDataListener. This method returns null, because
- * ListDataHandler class is obsolete and is no longer used.
- *
- * @return null
- */
- protected ListDataListener createListDataListener()
- {
- return null;
- }
-
- /**
- * This method creates ListMouseListener to listen to mouse events occuring
- * in the combo box's item list.
- *
- * @return MouseListener to listen to mouse events occuring in the combo
- * box's items list.
- */
- protected MouseListener createListMouseListener()
- {
- return new ListMouseHandler();
- }
-
- /**
- * Creates ListMouseMotionlistener to listen to mouse motion events occuring
- * in the combo box's list. This listener is responsible for highlighting
- * items in the list when mouse is moved over them.
- *
- * @return MouseMotionListener that handles mouse motion events occuring in
- * the list of the combo box.
- */
- protected MouseMotionListener createListMouseMotionListener()
- {
- return new ListMouseMotionHandler();
- }
-
- /**
- * Creates PropertyChangeListener to handle changes in the JComboBox's bound
- * properties.
- *
- * @return PropertyChangeListener to handle changes in the JComboBox's bound
- * properties.
- */
- protected PropertyChangeListener createPropertyChangeListener()
- {
- return new PropertyChangeHandler();
- }
-
- /**
- * Creates new ItemListener that will listen to ItemEvents occuring in the
- * combo box.
- *
- * @return ItemListener to listen to ItemEvents occuring in the combo box.
- */
- protected ItemListener createItemListener()
- {
- return new ItemHandler();
- }
-
- /**
- * Creates JList that will be used to display items in the combo box.
- *
- * @return JList that will be used to display items in the combo box.
- */
- protected JList createList()
- {
- JList l = new JList(comboBox.getModel());
- l.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
- return l;
- }
-
- /**
- * This method configures the list of comboBox's items by setting default
- * properties and installing listeners.
- */
- protected void configureList()
- {
- list.setModel(comboBox.getModel());
- list.setVisibleRowCount(comboBox.getMaximumRowCount());
- installListListeners();
- }
-
- /**
- * This method installs list listeners.
- */
- protected void installListListeners()
- {
- // mouse listener listening to mouse events occuring in the
- // combo box's list of items.
- listMouseListener = createListMouseListener();
- list.addMouseListener(listMouseListener);
-
- // mouse listener listening to mouse motion events occuring in the
- // combo box's list of items
- listMouseMotionListener = createListMouseMotionListener();
- list.addMouseMotionListener(listMouseMotionListener);
-
- listSelectionListener = createListSelectionListener();
- list.addListSelectionListener(listSelectionListener);
- }
-
- /**
- * This method creates scroll pane that will contain the list of comboBox's
- * items inside of it.
- *
- * @return JScrollPane
- */
- protected JScrollPane createScroller()
- {
- return new JScrollPane();
- }
-
- /**
- * This method configures scroll pane to contain list of comboBox's items
- */
- protected void configureScroller()
- {
- scroller.getViewport().setView(list);
- scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- }
-
- /**
- * This method configures popup menu that will be used to display Scrollpane
- * with list of items inside of it.
- */
- protected void configurePopup()
- {
- // initialize list that will be used to display combo box's items
- this.list = createList();
- ((JLabel) list.getCellRenderer()).setHorizontalAlignment(SwingConstants.LEFT);
- configureList();
-
- // initialize scroller. Add list to the scroller.
- scroller = createScroller();
- configureScroller();
-
- // add scroller with list inside of it to JPopupMenu
- super.add(scroller);
- }
-
- /*
- * This method installs listeners that will listen to changes occuring
- * in the combo box.
- */
- protected void installComboBoxListeners()
- {
- // mouse listener that listens to mouse event in combo box
- mouseListener = createMouseListener();
- comboBox.addMouseListener(mouseListener);
-
- // mouse listener that listens to mouse dragging events in the combo box
- mouseMotionListener = createMouseMotionListener();
- comboBox.addMouseMotionListener(mouseMotionListener);
-
- // item listener listenening to selection events in the combo box
- itemListener = createItemListener();
- comboBox.addItemListener(itemListener);
-
- propertyChangeListener = createPropertyChangeListener();
- comboBox.addPropertyChangeListener(propertyChangeListener);
- }
-
- /**
- * This method installs listeners that will listen to changes occuring in
- * the comb box's data model
- *
- * @param model data model for the combo box for which to install listeners
- */
- protected void installComboBoxModelListeners(ComboBoxModel model)
- {
- // list data listener to listen for ListDataEvents in combo box.
- // This listener is now obsolete and nothing is done here
- listDataListener = createListDataListener();
- comboBox.getModel().addListDataListener(listDataListener);
- }
-
- /**
- * DOCUMENT ME!
- */
- protected void installKeyboardActions()
- {
- // FIXME: Need to implement
- }
-
- /**
- * This method always returns false to indicate that items in the combo box
- * list are not focus traversable.
- *
- * @return false
- */
- public boolean isFocusTraversable()
- {
- return false;
- }
-
- /**
- * This method start scrolling combo box's list of items either up or down
- * depending on the specified 'direction'
- *
- * @param direction of the scrolling.
- */
- protected void startAutoScrolling(int direction)
- {
- // FIXME: add timer
- isAutoScrolling = true;
-
- if (direction == SCROLL_UP)
- autoScrollUp();
- else
- autoScrollDown();
- }
-
- /**
- * This method stops scrolling the combo box's list of items
- */
- protected void stopAutoScrolling()
- {
- // FIXME: add timer
- isAutoScrolling = false;
- }
-
- /**
- * This method scrolls up list of combo box's items up and highlights that
- * just became visible.
- */
- protected void autoScrollUp()
- {
- // scroll up the scroll bar to make the item above visible
- JScrollBar scrollbar = scroller.getVerticalScrollBar();
- int scrollToNext = list.getScrollableUnitIncrement(super.getBounds(),
- SwingConstants.VERTICAL,
- SCROLL_UP);
-
- scrollbar.setValue(scrollbar.getValue() - scrollToNext);
-
- // If we haven't reached the begging of the combo box's list of items,
- // then highlight next element above currently highlighted element
- if (list.getSelectedIndex() != 0)
- list.setSelectedIndex(list.getSelectedIndex() - 1);
- }
-
- /**
- * This method scrolls down list of combo box's and highlights item in the
- * list that just became visible.
- */
- protected void autoScrollDown()
- {
- // scroll scrollbar down to make next item visible
- JScrollBar scrollbar = scroller.getVerticalScrollBar();
- int scrollToNext = list.getScrollableUnitIncrement(super.getBounds(),
- SwingConstants.VERTICAL,
- SCROLL_DOWN);
- scrollbar.setValue(scrollbar.getValue() + scrollToNext);
-
- // If we haven't reached the end of the combo box's list of items
- // then highlight next element below currently highlighted element
- if (list.getSelectedIndex() + 1 != comboBox.getItemCount())
- list.setSelectedIndex(list.getSelectedIndex() + 1);
- }
-
- /**
- * This method helps to delegate focus to the right component in the
- * JComboBox. If the comboBox is editable then focus is sent to
- * ComboBoxEditor, otherwise it is delegated to JComboBox.
- *
- * @param e MouseEvent
- */
- protected void delegateFocus(MouseEvent e)
- {
- // FIXME: Need to implement
- }
-
- /**
- * This method displays combo box popup if the popup is not currently shown
- * on the screen and hides it if it is currently visible
- */
- protected void togglePopup()
- {
- if (BasicComboPopup.this.isVisible())
- hide();
- else
- show();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param e DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- protected MouseEvent convertMouseEvent(MouseEvent e)
- {
- return null;
- }
-
- /**
- * Returns required height of the popup such that number of items visible in
- * it are equal to the maximum row count. By default
- * comboBox.maximumRowCount=8
- *
- * @param maxRowCount number of maximum visible rows in the combo box's
- * popup list of items
- *
- * @return height of the popup required to fit number of items equal to
- * JComboBox.maximumRowCount.
- */
- protected int getPopupHeightForRowCount(int maxRowCount)
- {
- int totalHeight = 0;
- ListCellRenderer rend = list.getCellRenderer();
-
- if (comboBox.getItemCount() < maxRowCount)
- maxRowCount = comboBox.getItemCount();
-
- for (int i = 0; i < maxRowCount; i++)
- {
- Component comp = rend.getListCellRendererComponent(list,
- comboBox.getModel()
- .getElementAt(i),
- -1, false, false);
- Dimension dim = comp.getPreferredSize();
- totalHeight += dim.height;
- }
-
- return totalHeight;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param px DOCUMENT ME!
- * @param py DOCUMENT ME!
- * @param pw DOCUMENT ME!
- * @param ph DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- protected Rectangle computePopupBounds(int px, int py, int pw, int ph)
- {
- return new Rectangle(px, py, pw, ph);
- }
-
- /**
- * This method changes the selection in the list to the item over which the
- * mouse is currently located.
- *
- * @param anEvent MouseEvent
- * @param shouldScroll DOCUMENT ME!
- */
- protected void updateListBoxSelectionForEvent(MouseEvent anEvent,
- boolean shouldScroll)
- {
- // FIXME: Need to implement
- }
-
- /**
- * InvocationMouseHandler is a listener that listens to mouse events
- * occuring in the combo box. Note that this listener doesn't listen to
- * mouse events occuring in the popup portion of the combo box, it only
- * listens to main combo box part(area that displays selected item). This
- * listener is responsible for showing and hiding popup portion of the
- * combo box.
- */
- protected class InvocationMouseHandler extends MouseAdapter
- {
- /**
- * Creates a new InvocationMouseHandler object.
- */
- protected InvocationMouseHandler()
- {
- }
-
- /**
- * This method is invoked whenever mouse is being pressed over the main
- * part of the combo box. This method will show popup if the popup is
- * not shown on the screen right now, and it will hide popup otherwise.
- *
- * @param e MouseEvent that should be handled
- */
- public void mousePressed(MouseEvent e)
- {
- if (comboBox.isEnabled())
- togglePopup();
- }
-
- /**
- * This method is invoked whenever mouse event was originated in the combo
- * box and released either in the combBox list of items or in the combo
- * box itself.
- *
- * @param e MouseEvent that should be handled
- */
- public void mouseReleased(MouseEvent e)
- {
- // Get component over which mouse was released
- Component src = (Component) e.getSource();
- int x = e.getX();
- int y = e.getY();
- Component releasedComponent = SwingUtilities.getDeepestComponentAt(src,
- x, y);
-
- // if mouse was released inside the bounds of combo box then do nothing,
- // Otherwise if mouse was released inside the list of combo box items
- // then change selection and close popup
- if (! (releasedComponent instanceof JComboBox))
- {
- // List model contains the item over which mouse is released,
- // since it is updated every time the mouse is moved over a different
- // item in the list. Now that the mouse is released we need to
- // update model of the combo box as well.
- comboBox.setSelectedIndex(list.getSelectedIndex());
-
- if (isAutoScrolling)
- stopAutoScrolling();
- hide();
- }
- }
- }
-
- /**
- * InvocationMouseMotionListener is a mouse listener that listens to mouse
- * dragging events occuring in the combo box.
- */
- protected class InvocationMouseMotionHandler extends MouseMotionAdapter
- {
- /**
- * Creates a new InvocationMouseMotionHandler object.
- */
- protected InvocationMouseMotionHandler()
- {
- }
-
- /**
- * This method is responsible for highlighting item in the drop down list
- * over which the mouse is currently being dragged.
- */
- public void mouseDragged(MouseEvent e)
- {
- // convert point of the drag event relative to combo box list component
- // figure out over which list cell the mouse is currently being dragged
- // and highlight the cell. The list model is changed but the change has
- // no effect on combo box's data model. The list model is changed so
- // that the appropriate item would be highlighted in the combo box's
- // list.
- if (BasicComboPopup.this.isVisible())
- {
- int cbHeight = (int) comboBox.getPreferredSize().getHeight();
- int popupHeight = BasicComboPopup.this.getSize().height;
-
- // if mouse is dragged inside the the combo box's items list.
- if (e.getY() > cbHeight && ! (e.getY() - cbHeight >= popupHeight))
- {
- int index = list.locationToIndex(new Point(e.getX(),
- (int) (e.getY()
- - cbHeight)));
-
- int firstVisibleIndex = list.getFirstVisibleIndex();
-
- // list.locationToIndex returns item's index that would
- // be located at the specified point if the first item that
- // is visible is item 0. However in the JComboBox it is not
- // necessarily the case since list is contained in the
- // JScrollPane so we need to adjust the index returned.
- if (firstVisibleIndex != 0)
- // FIXME: adjusted index here is off by one. I am adding one
- // here to compensate for that. This should be
- // index += firstVisibleIndex. Remove +1 once the bug is fixed.
- index += firstVisibleIndex + 1;
-
- list.setSelectedIndex(index);
- }
- else
- {
- // if mouse is being dragged at the bottom of combo box's list
- // of items or at the very top then scroll the list in the
- // desired direction.
- boolean movingUP = e.getY() < cbHeight;
- boolean movingDown = e.getY() > cbHeight;
-
- if (movingUP)
- {
- scrollDirection = SCROLL_UP;
- startAutoScrolling(SCROLL_UP);
- }
- else if (movingDown)
- {
- scrollDirection = SCROLL_DOWN;
- startAutoScrolling(SCROLL_DOWN);
- }
- }
- }
- }
- }
-
- /**
- * ItemHandler is an item listener that listens to selection events occuring
- * in the combo box. FIXME: should specify here what it does when item is
- * selected or deselected in the combo box list.
- */
- protected class ItemHandler extends Object implements ItemListener
- {
- /**
- * Creates a new ItemHandler object.
- */
- protected ItemHandler()
- {
- }
-
- /**
- * This method responds to the selection events occuring in the combo box.
- *
- * @param e ItemEvent specifying the combo box's selection
- */
- public void itemStateChanged(ItemEvent e)
- {
- }
- }
-
- /**
- * ListMouseHandler is a listener that listens to mouse events occuring in
- * the combo box's list of items. This class is responsible for hiding
- * popup portion of the combo box if the mouse is released inside the combo
- * box's list.
- */
- protected class ListMouseHandler extends MouseAdapter
- {
- protected ListMouseHandler()
- {
- }
-
- public void mousePressed(MouseEvent e)
- {
- }
-
- public void mouseReleased(MouseEvent anEvent)
- {
- int index = list.locationToIndex(anEvent.getPoint());
- comboBox.setSelectedIndex(index);
- hide();
- }
- }
-
- /**
- * ListMouseMotionHandler listens to mouse motion events occuring in the
- * combo box's list. This class is responsible for highlighting items in
- * the list when mouse is moved over them
- */
- protected class ListMouseMotionHandler extends MouseMotionAdapter
- {
- protected ListMouseMotionHandler()
- {
- }
-
- public void mouseMoved(MouseEvent anEvent)
- {
- // Highlight list cells over which the mouse is located.
- // This changes list model, but has no effect on combo box's data model
- int index = list.locationToIndex(anEvent.getPoint());
- list.setSelectedIndex(index);
- list.repaint();
- }
- }
-
- /**
- * This class listens to changes occuring in the bound properties of the
- * combo box
- */
- protected class PropertyChangeHandler extends Object
- implements PropertyChangeListener
- {
- protected PropertyChangeHandler()
- {
- }
-
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getPropertyName().equals("renderer"))
- {
- list.setCellRenderer((ListCellRenderer) e.getNewValue());
- revalidate();
- repaint();
- }
- if (e.getPropertyName().equals("dataModel"))
- {
- list.setModel((ComboBoxModel) e.getNewValue());
- revalidate();
- repaint();
- }
- }
- }
-
- // ------ private helper methods --------------------
-
- /**
- * This method uninstalls listeners installed by the UI
- */
- private void uninstallListeners()
- {
- uninstallListListeners();
- uninstallComboBoxListeners();
- uninstallComboBoxModelListeners(comboBox.getModel());
- }
-
- /**
- * This method uninstalls Listeners registered with combo boxes list of
- * items
- */
- private void uninstallListListeners()
- {
- list.removeMouseListener(listMouseListener);
- listMouseListener = null;
-
- list.removeMouseMotionListener(listMouseMotionListener);
- listMouseMotionListener = null;
- }
-
- /**
- * This method uninstalls listeners listening to combo box associated with
- * this popup menu
- */
- private void uninstallComboBoxListeners()
- {
- comboBox.removeMouseListener(mouseListener);
- mouseListener = null;
-
- comboBox.removeMouseMotionListener(mouseMotionListener);
- mouseMotionListener = null;
-
- comboBox.removeItemListener(itemListener);
- itemListener = null;
-
- comboBox.removePropertyChangeListener(propertyChangeListener);
- propertyChangeListener = null;
- }
-
- // --------------------------------------------------------------------
- // The following classes are here only for backwards API compatibility
- // They aren't used.
- // --------------------------------------------------------------------
-
- /**
- * This class is not used any more.
- */
- public class ListDataHandler extends Object implements ListDataListener
- {
- public ListDataHandler()
- {
- }
-
- public void contentsChanged(ListDataEvent e)
- {
- }
-
- public void intervalAdded(ListDataEvent e)
- {
- }
-
- public void intervalRemoved(ListDataEvent e)
- {
- }
- }
-
- /**
- * This class is not used anymore
- */
- protected class ListSelectionHandler extends Object
- implements ListSelectionListener
- {
- protected ListSelectionHandler()
- {
- }
-
- public void valueChanged(ListSelectionEvent e)
- {
- }
- }
-
- /**
- * This class is not used anymore
- */
- public class InvocationKeyHandler extends KeyAdapter
- {
- public InvocationKeyHandler()
- {
- }
-
- public void keyReleased(KeyEvent e)
- {
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicDesktopIconUI.java b/libjava/javax/swing/plaf/basic/BasicDesktopIconUI.java
deleted file mode 100644
index 561b497f1c3..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicDesktopIconUI.java
+++ /dev/null
@@ -1,590 +0,0 @@
-/* BasicDesktopIconUI.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
-
-import javax.swing.Icon;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JDesktopPane;
-import javax.swing.JInternalFrame;
-import javax.swing.JInternalFrame.JDesktopIcon;
-import javax.swing.SwingConstants;
-import javax.swing.border.Border;
-import javax.swing.event.MouseInputAdapter;
-import javax.swing.event.MouseInputListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.DesktopIconUI;
-
-/**
- * This class acts as the UI delegate for JDesktopIcons for the Basic look and feel.
- */
-public class BasicDesktopIconUI extends DesktopIconUI
-{
- /**
- * This helper class handles mouse events that occur on the JDesktopIcon.
- */
- public class MouseInputHandler extends MouseInputAdapter
- {
- /** The x offset from the MouseEvent coordinates to the top left corner. */
- private transient int xOffset;
-
- /** The y offset fromt he MouseEvent coordinates to the top left corner. */
- private transient int yOffset;
-
- /** A cached value of the JDesktopPane that parents this JDesktopIcon. */
- private transient JDesktopPane pane;
-
- /**
- * This method is called when the mouse is dragged in the JDesktopIcon.
- *
- * @param e The MouseEvent.
- */
- public void mouseDragged(MouseEvent e)
- {
- Rectangle b = desktopIcon.getBounds();
-
- moveAndRepaint(desktopIcon, b.x + e.getX() - xOffset,
- b.y + e.getY() - yOffset, b.width, b.height);
- }
-
- /**
- * This method is called when the mouse is moved in the JDesktopIcon.
- *
- * @param e The MouseEvent.
- */
- public void mouseMoved(MouseEvent e)
- {
- // Nothing to do.
- }
-
- /**
- * This method is called when the mouse is pressed in the JDesktopIcon.
- *
- * @param e The MouseEvent.
- */
- public void mousePressed(MouseEvent e)
- {
- xOffset = e.getX();
- yOffset = e.getY();
- pane = frame.getDesktopPane();
- if (pane != null)
- pane.getDesktopManager().beginDraggingFrame(desktopIcon);
- }
-
- /**
- * This method is called when the mouse is released in the JDesktopIcon.
- *
- * @param e The MouseEvent.
- */
- public void mouseReleased(MouseEvent e)
- {
- if (pane != null)
- pane.getDesktopManager().endDraggingFrame(desktopIcon);
- xOffset = 0;
- yOffset = 0;
- }
-
- /**
- * This method moves and repaints the JDesktopIcon to the given bounds.
- *
- * @param f The JComponent to move and repaint.
- * @param newX The new x coordinate.
- * @param newY The new y coordinate.
- * @param newWidth The new width.
- * @param newHeight The new height.
- */
- public void moveAndRepaint(JComponent f, int newX, int newY, int newWidth,
- int newHeight)
- {
- if (pane != null)
- pane.getDesktopManager().dragFrame(f, newX, newY);
- else
- desktopIcon.setBounds(newX, newY, newWidth, newHeight);
- }
- }
-
- /**
- * This class acts as the border for the JDesktopIcon.
- */
- private class DesktopIconBorder implements Border
- {
- /** The left inset value. */
- int left = 10;
-
- /** The top inset value. */
- int top = 4;
-
- /** The right inset value. */
- int right = top;
-
- /** The bottom inset value. */
- int bottom = top;
-
- /**
- * This method returns the insets of the border.
- *
- * @param c The Component to find border insets for.
- *
- * @return The border insets.
- */
- public Insets getBorderInsets(Component c)
- {
- return new Insets(top, left, bottom, right);
- }
-
- /**
- * This method returns whether the border is opaque.
- *
- * @return Whether the border is opaque.
- */
- public boolean isBorderOpaque()
- {
- return true;
- }
-
- /**
- * This method paints the border.
- *
- * @param c The Component the border is in.
- * @param g The Graphics object to paint with.
- * @param x The x coordinate of the Component.
- * @param y The y coordinate of the Component.
- * @param width The width of the Component.
- * @param height The height of the Component.
- */
- public void paintBorder(Component c, Graphics g, int x, int y, int width,
- int height)
- {
- g.translate(x, y);
- Color saved = g.getColor();
-
- g.setColor(Color.LIGHT_GRAY);
-
- g.fillRect(0, 0, left, height);
- g.fillRect(0, 0, width, top);
- g.fillRect(0, height - bottom, width, bottom);
- g.fillRect(width - right, 0, right, height);
-
- g.setColor(Color.BLACK);
- g.drawRect(0, 0, width - 1, height - 1);
-
- int fHeight = height / 4;
- int hLeft = left / 2;
-
- g.setColor(Color.BLACK);
- g.fillRect(hLeft, fHeight, 2, 2);
- g.fillRect(hLeft, fHeight * 2, 2, 2);
- g.fillRect(hLeft, fHeight * 3, 2, 2);
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- }
-
- /** The static width and height of the iconSize. */
- private static final int iconSize = 16;
-
- /**
- * This class represents the default frame icon when none
- * is supplied by the JInternalFrame.
- */
- static class InternalFrameDefaultMenuIcon implements Icon
- {
- /**
- * This returns the icon height.
- *
- * @return The icon height.
- */
- public int getIconHeight()
- {
- return iconSize;
- }
-
- /**
- * This returns the icon width.
- *
- * @return The icon width.
- */
- public int getIconWidth()
- {
- return iconSize;
- }
-
- /**
- * This method paints the icon.
- *
- * @param c The Component this icon belongs to.
- * @param g The Graphics object to paint with.
- * @param x The x coordinate to paint at.
- * @param y The y coordinate to paint at.
- */
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- g.translate(x, y);
- Color saved = g.getColor();
-
- g.setColor(Color.BLUE);
- g.fillRect(0, 0, iconSize, (int) ((double) iconSize / 3) + 1);
-
- g.setColor(Color.WHITE);
- g.fillRect(0, (int) ((double) iconSize / 3), iconSize, iconSize * 5 / 6);
-
- g.setColor(Color.GRAY);
- g.drawRect(0, 0, iconSize, iconSize);
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- }
-
- /** The default JDesktopIcon width. */
- private static final int iconWidth = 160;
-
- /** The default JDesktopIcon height */
- private static final int iconHeight = 35;
-
- /** The JDesktopIcon this UI delegate represents. */
- protected JDesktopIcon desktopIcon;
-
- /** The JInternalFrame associated with the JDesktopIcon. */
- protected JInternalFrame frame;
-
- /** The MouseListener responsible for reacting to MouseEvents on the JDesktopIcon. */
- private transient MouseInputListener mouseHandler;
-
- /** The Button in the JDesktopIcon responsible for deiconifying it.
- * This is package-private to avoid an accessor method. */
- transient BoundButton button;
-
- /** The PropertyChangeListener listening to the JDesktopIcon. */
- private transient PropertyChangeListener propertyHandler;
-
- /** The default icon used when no frame icon is given by the JInternalFrame. */
- static Icon defaultIcon = new InternalFrameDefaultMenuIcon();
-
- /**
- * This is a helper class that is used in JDesktopIcon and gives the Button a predetermined size.
- */
- private class BoundButton extends JButton
- {
- /**
- * Creates a new BoundButton object.
- *
- * @param title The title of the button.
- */
- public BoundButton(String title)
- {
- super(title);
- }
-
- /**
- * This method returns a standard size (based on the defaults of the JDesktopIcon) and the insets.
- *
- * @return The preferred size of the JDesktopIcon.
- */
- public Dimension getPreferredSize()
- {
- Insets insets = desktopIcon.getInsets();
- return new Dimension(iconWidth - insets.left - insets.right,
- iconHeight - insets.top - insets.bottom);
- }
-
- /**
- * This method returns the minimum size of the button.
- *
- * @return The minimum size of the button.
- */
- public Dimension getMinimumSize()
- {
- return getPreferredSize();
- }
-
- /**
- * This method returns the maximum size of the button.
- *
- * @return The maximum size of the button.
- */
- public Dimension getMaximumSize()
- {
- return getPreferredSize();
- }
- }
-
- /**
- * Creates a new BasicDesktopIconUI object.
- */
- public BasicDesktopIconUI()
- {
- }
-
- /**
- * This method creates a new BasicDesktopIconUI for the given JComponent.
- *
- * @param c The JComponent to create a UI for.
- *
- * @return A new BasicDesktopIconUI.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicDesktopIconUI();
- }
-
- /**
- * This method installs the UI for the given JComponent.
- *
- * @param c The JComponent to install this UI for.
- */
- public void installUI(JComponent c)
- {
- if (c instanceof JDesktopIcon)
- {
- desktopIcon = (JDesktopIcon) c;
- desktopIcon.setLayout(new BorderLayout());
- frame = desktopIcon.getInternalFrame();
-
- installDefaults();
- installComponents();
- installListeners();
-
- desktopIcon.setOpaque(true);
- }
- }
-
- /**
- * This method uninstalls the UI for the given JComponent.
- *
- * @param c The JComponent to uninstall this UI for.
- */
- public void uninstallUI(JComponent c)
- {
- desktopIcon.setOpaque(false);
-
- uninstallListeners();
- uninstallComponents();
- uninstallDefaults();
-
- frame = null;
- desktopIcon.setLayout(null);
- desktopIcon = null;
- }
-
- /**
- * This method installs the necessary sub components for the JDesktopIcon.
- */
- protected void installComponents()
- {
- // Try to create a button based on what the frame's
- // state is currently
- button = new BoundButton(frame.getTitle());
- button.setHorizontalAlignment(SwingConstants.LEFT);
- button.setHorizontalTextPosition(SwingConstants.TRAILING);
-
- Icon use = frame.getFrameIcon();
- if (use == null)
- use = defaultIcon;
- button.setIcon(use);
-
- desktopIcon.add(button, SwingConstants.CENTER);
- }
-
- /**
- * This method uninstalls the sub components for the JDesktopIcon.
- */
- protected void uninstallComponents()
- {
- desktopIcon.remove(button);
-
- button = null;
- }
-
- /**
- * This method installs the listeners needed by this UI.
- */
- protected void installListeners()
- {
- mouseHandler = createMouseInputListener();
-
- desktopIcon.addMouseMotionListener(mouseHandler);
- desktopIcon.addMouseListener(mouseHandler);
-
- propertyHandler = new PropertyChangeListener()
- {
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getPropertyName().equals(JInternalFrame.TITLE_PROPERTY))
- button.setText(desktopIcon.getInternalFrame().getTitle());
- else if (e.getPropertyName().equals(JInternalFrame.FRAME_ICON_PROPERTY))
- {
- Icon use = desktopIcon.getInternalFrame().getFrameIcon();
- if (use == null)
- use = defaultIcon;
- button.setIcon(use);
- }
- desktopIcon.revalidate();
- desktopIcon.repaint();
- }
- };
- frame.addPropertyChangeListener(propertyHandler);
-
- button.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- deiconize();
- }
- });
- }
-
- /**
- * This method uninstalls the listeners needed by the UI.
- */
- protected void uninstallListeners()
- {
- // button is nulled so no need to remove it.
-
- frame.removePropertyChangeListener(propertyHandler);
- propertyHandler = null;
-
- desktopIcon.removeMouseMotionListener(mouseHandler);
- desktopIcon.removeMouseListener(mouseHandler);
- }
-
- /**
- * This method installs the defaults for the JDesktopIcon.
- */
- protected void installDefaults()
- {
- // FIXME: Move border to defaults.
- desktopIcon.setBorder(new DesktopIconBorder());
- }
-
- /**
- * This method uninstalls the defaults for the JDesktopIcon.
- */
- protected void uninstallDefaults()
- {
- desktopIcon.setBorder(null);
- }
-
- /**
- * This method creates a new MouseInputListener for the JDesktopIcon.
- *
- * @return A new MouseInputListener.
- */
- protected MouseInputListener createMouseInputListener()
- {
- return new MouseInputHandler();
- }
-
- /**
- * This method returns the preferred size for the given JComponent.
- *
- * @param c The JComponent to find a preferred size for.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- return new Dimension(iconWidth, iconHeight);
- }
-
- /**
- * This method returns the minimum size for the given JComponent.
- *
- * @param c The JComponent to find a minimum size for.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the maximum size for the given JComponent.
- *
- * @param c The JComponent to find a maximum size for.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the insets of the given JComponent.
- *
- * @param c The JComponent to find insets for.
- *
- * @return The insets of the given JComponent.
- */
- public Insets getInsets(JComponent c)
- {
- return c.getInsets();
- }
-
- /**
- * This method deiconizes the JInternalFrame associated with the JDesktopIcon.
- */
- public void deiconize()
- {
- try
- {
- frame.setIcon(false);
- }
- catch (PropertyVetoException pve)
- {
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicDesktopPaneUI.java b/libjava/javax/swing/plaf/basic/BasicDesktopPaneUI.java
deleted file mode 100644
index b15700d6fc8..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicDesktopPaneUI.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/* BasicDesktopPaneUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.beans.PropertyVetoException;
-
-import javax.swing.AbstractAction;
-import javax.swing.DefaultDesktopManager;
-import javax.swing.DesktopManager;
-import javax.swing.JComponent;
-import javax.swing.JDesktopPane;
-import javax.swing.JInternalFrame;
-import javax.swing.KeyStroke;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.DesktopPaneUI;
-
-/**
- * This class is the UI delegate for JDesktopPane for the Basic look and feel.
- */
-public class BasicDesktopPaneUI extends DesktopPaneUI
-{
- /**
- * This helper class is used to handle key events that cause JInternalFrames
- * to be closed.
- */
- protected class CloseAction extends AbstractAction
- {
- /**
- * This method is called when the action is performed.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- if (desktop.getSelectedFrame() != null)
- {
- try
- {
- desktop.getSelectedFrame().setClosed(true);
- }
- catch (PropertyVetoException pve)
- {
- }
- }
- }
-
- /**
- * This method returns whether the action is enabled.
- *
- * @return Whether the action is enabled.
- */
- public boolean isEnabled()
- {
- if (desktop.getSelectedFrame() != null)
- return desktop.getSelectedFrame().isClosable();
- return false;
- }
- }
-
- /**
- * This helper class is used to handle key events that cause JInternalFrames
- * to be maximized.
- */
- protected class MaximizeAction extends AbstractAction
- {
- /**
- * This method is called when the action is performed.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- if (desktop.getSelectedFrame() != null)
- {
- try
- {
- desktop.getSelectedFrame().setMaximum(true);
- }
- catch (PropertyVetoException pve)
- {
- }
- }
- }
-
- /**
- * This method returns whether the action is enabled.
- *
- * @return Whether the action is enabled.
- */
- public boolean isEnabled()
- {
- if (desktop.getSelectedFrame() != null)
- return desktop.getSelectedFrame().isMaximizable();
- return false;
- }
- }
-
- /**
- * This helper class is used to handle key events that cause JInternalFrames
- * to be minimized.
- */
- protected class MinimizeAction extends AbstractAction
- {
- /**
- * This method is called when the action is performed.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- if (desktop.getSelectedFrame() != null)
- {
- try
- {
- desktop.getSelectedFrame().setIcon(true);
- }
- catch (PropertyVetoException pve)
- {
- }
- }
- }
-
- /**
- * This method returns whether the action is enabled.
- *
- * @return Whether the action is enabled.
- */
- public boolean isEnabled()
- {
- if (desktop.getSelectedFrame() != null)
- return desktop.getSelectedFrame().isIconifiable();
- return false;
- }
- }
-
- /**
- * This helper class is used to handle key events that pass the SELECTED
- * property to the next JInternalFrame in the JDesktopPane's list of
- * children.
- */
- protected class NavigateAction extends AbstractAction
- {
- /**
- * This method is called when the action is performed.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- // This is supposed to set the next selected frame.
- JInternalFrame[] frames = desktop.getAllFrames();
- if (frames.length == 0)
- return;
-
- JInternalFrame sFrame = frames[0];
- if (desktop.getSelectedFrame() != null)
- sFrame = desktop.getSelectedFrame();
-
- int i = 0;
- for (; i < frames.length; i++)
- if (frames[i] == sFrame)
- break;
-
- // FIXME: Navigate actions go reverse too.
- if (i == frames.length)
- i = 0;
-
- desktop.setSelectedFrame(frames[i]);
- }
-
- /**
- * This method returns whether the action is enabled.
- *
- * @return Whether this action is enabled.
- */
- public boolean isEnabled()
- {
- // Always true.
- return true;
- }
- }
-
- /**
- * This helper class is used to restore the JInternalFrame to its original
- * size before maximizing or iconifying.
- */
- protected class OpenAction extends AbstractAction
- {
- /**
- * This method is called when the action is performed.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- JInternalFrame frame = desktop.getSelectedFrame();
- if (frame != null)
- {
- try
- {
- if (frame.isIcon())
- frame.setIcon(false);
- else if (frame.isMaximum())
- frame.setMaximum(false);
- }
- catch (PropertyVetoException pve)
- {
- }
- }
- }
-
- /**
- * This method returns whether the action is enabled.
- *
- * @return Whether this action is enabled.
- */
- public boolean isEnabled()
- {
- // JInternalFrames are always restorable.
- return true;
- }
- }
-
- /**
- * The KeyStroke associated with closing JInternalFrames.
- * @deprecated
- */
- protected KeyStroke closeKey;
-
- /**
- * The KeyStroke associated with maximizing JInternalFrames.
- * @deprecated
- */
- protected KeyStroke maximizeKey;
-
- /**
- * The KeyStroke associated with minimizing JInternalFrames.
- * @deprecated
- */
- protected KeyStroke minimizeKey;
-
- /**
- * The KeyStroke associated with navigating (forward?) through
- * JInternalFrames.
- * @deprecated
- */
- protected KeyStroke navigateKey;
-
- /**
- * The KeyStroke associated with navigating (backward?) through
- * JInternalFrames.
- * @deprecated
- */
- protected KeyStroke navigateKey2;
-
- /** The default desktop manager used with JDesktopPane. */
- protected DesktopManager desktopManager;
-
- /** The JDesktopPane this UI is used with. */
- protected JDesktopPane desktop;
-
- /**
- * Creates a new BasicDesktopPaneUI object.
- */
- public BasicDesktopPaneUI()
- {
- }
-
- /**
- * This method creates a BasicDesktopPaneUI for the given JComponent.
- *
- * @param c The JComponent to create a UI for.
- *
- * @return A new BasicDesktopPaneUI.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicDesktopPaneUI();
- }
-
- /**
- * This method returns the maximum size for the given JComponent.
- *
- * @param c The JComponent to find a maximum size for.
- *
- * @return The maximum size for the given JComponent.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the minimum size for the given JComponent.
- *
- * @param c The JComponent to find a minimum size for.
- *
- * @return The minimum size for the given JComponent.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the preferred size for the given JComponent.
- *
- * @param c The JComponent to find a preferred size for.
- *
- * @return The preferred size for the given JComponent.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- // return null because JDesktopPanes don't have preferred sizes.
- return null;
- }
-
- /**
- * This method installs the defaults for the JDesktopPane provided by the
- * current look and feel.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- desktop.setBackground(defaults.getColor("Desktop.background"));
- }
-
- /**
- * This method installs the desktop manager for the JDesktopPane.
- */
- protected void installDesktopManager()
- {
- desktopManager = new DefaultDesktopManager();
- desktop.setDesktopManager(desktopManager);
- }
-
- /**
- * This method installs the keyboard actions for the JDesktopPane.
- */
- protected void installKeyboardActions()
- {
- // FIXME: create actions and keystrokes.
- registerKeyboardAction();
- }
-
- /**
- * This method installs the UI for the given JComponent.
- *
- * @param c The JComponent to install this UI for.
- */
- public void installUI(JComponent c)
- {
- if (c instanceof JDesktopPane)
- {
- desktop = (JDesktopPane) c;
-
- installDefaults();
- installDesktopManager();
- installKeyboardActions();
- }
- }
-
- /**
- * This method registers the actions to the appropriate Action and Input
- * maps.
- */
- protected void registerKeyboardAction()
- {
- // FIXME: Do the binding.
- // XXX: the gtk windows tend to intercept a lot of the
- // key events for themselves. must figure a way past that
- // before binding
- }
-
- /**
- * This method reverses the work done by the installDefaults method.
- */
- protected void uninstallDefaults()
- {
- desktop.setBackground(null);
- }
-
- /**
- * This method reverses the work done by the installDesktopManager method.
- */
- protected void uninstallDesktopManager()
- {
- desktopManager = null;
- desktop.setDesktopManager(null);
- }
-
- /**
- * This method reverses the work done by the installKeyboardActions method.
- */
- protected void uninstallKeyboardActions()
- {
- unregisterKeyboardActions();
- // FIXME: null the actions and keystrokes.
- }
-
- /**
- * This method reverses the work done by the registerKeyboardActions method.
- */
- protected void unregisterKeyboardActions()
- {
- // FIXME: unmap the keystrokes
- }
-
- /**
- * This method uninstalls the UI for the given JComponent. It should reverse
- * all the work done by the installUI method.
- *
- * @param c The JComponent to uninstall this UI for.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallKeyboardActions();
- uninstallDesktopManager();
- uninstallDefaults();
-
- desktop = null;
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicEditorPaneUI.java b/libjava/javax/swing/plaf/basic/BasicEditorPaneUI.java
deleted file mode 100644
index 6dd15a8f982..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicEditorPaneUI.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* BasicEditorPaneUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.text.Element;
-import javax.swing.text.PlainView;
-import javax.swing.text.View;
-
-public class BasicEditorPaneUI extends BasicTextUI
-{
- public static ComponentUI createUI(JComponent comp)
- {
- return new BasicEditorPaneUI();
- }
-
- public BasicEditorPaneUI()
- {
- // Do nothing here.
- }
-
- public View create(Element elem)
- {
- return new PlainView(elem);
- }
-
- protected String getPropertyPrefix()
- {
- return "EditorPane";
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicFormattedTextFieldUI.java b/libjava/javax/swing/plaf/basic/BasicFormattedTextFieldUI.java
deleted file mode 100644
index 38a2527afae..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicFormattedTextFieldUI.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* BasicFormattedTextFieldUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-
-/**
- * @since 1.4
- */
-public class BasicFormattedTextFieldUI extends BasicTextFieldUI
-{
- public BasicFormattedTextFieldUI()
- {
- }
-
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicFormattedTextFieldUI();
- }
-
- protected String getPropertyPrefix()
- {
- return "FormattedTextField";
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
deleted file mode 100644
index f98963a216c..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
+++ /dev/null
@@ -1,637 +0,0 @@
-/* BasicGraphicsUtils.java
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.awt.font.FontRenderContext;
-import java.awt.font.LineMetrics;
-import java.awt.font.TextLayout;
-import java.awt.geom.Rectangle2D;
-
-import javax.swing.AbstractButton;
-import javax.swing.SwingUtilities;
-
-
-/**
- * A utility class providing commonly used drawing and measurement
- * routines.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class BasicGraphicsUtils
-{
- /**
- * Constructor. It is utterly unclear why this class should
- * be constructable, but this is what the API specification
- * says.
- */
- public BasicGraphicsUtils()
- {
- }
-
-
- /**
- * Draws a rectangle that appears etched into the surface, given
- * four colors that are used for drawing.
- *
- * <p><img src="doc-files/BasicGraphicsUtils-1.png" width="360"
- * height="200" alt="[An illustration that shows which pixels
- * get painted in what color]" />
- *
- * @param g the graphics into which the rectangle is drawn.
- * @param x the x coordinate of the rectangle.
- * @param y the y coordinate of the rectangle.
- * @param width the width of the rectangle in pixels.
- * @param height the height of the rectangle in pixels.
- *
- * @param shadow the color that will be used for painting
- * the outer side of the top and left edges.
- *
- * @param darkShadow the color that will be used for painting
- * the inner side of the top and left edges.
- *
- * @param highlight the color that will be used for painting
- * the inner side of the bottom and right edges.
- *
- * @param lightHighlight the color that will be used for painting
- * the outer side of the bottom and right edges.
- *
- * @see #getEtchedInsets()
- * @see javax.swing.border.EtchedBorder
- */
- public static void drawEtchedRect(Graphics g,
- int x, int y, int width, int height,
- Color shadow, Color darkShadow,
- Color highlight, Color lightHighlight)
- {
- Color oldColor;
- int x2, y2;
-
- oldColor = g.getColor();
- x2 = x + width - 1;
- y2 = y + height - 1;
-
- try
- {
- /* To understand this code, it might be helpful to look at the
- * image "BasicGraphicsUtils-1.png" that is included with the
- * JavaDoc. The file is located in the "doc-files" subdirectory.
- *
- * (x2, y2) is the coordinate of the most right and bottom pixel
- * to be painted.
- */
- g.setColor(shadow);
- g.drawLine(x, y, x2 - 1, y); // top, outer
- g.drawLine(x, y + 1, x, y2 - 1); // left, outer
-
- g.setColor(darkShadow);
- g.drawLine(x + 1, y + 1, x2 - 2, y + 1); // top, inner
- g.drawLine(x + 1, y + 2, x + 1, y2 - 2); // left, inner
-
- g.setColor(highlight);
- g.drawLine(x + 1, y2 - 1, x2 - 1, y2 - 1); // bottom, inner
- g.drawLine(x2 - 1, y + 1, x2 - 1, y2 - 2); // right, inner
-
- g.setColor(lightHighlight);
- g.drawLine(x, y2, x2, y2); // bottom, outer
- g.drawLine(x2, y, x2, y2 - 1); // right, outer
- }
- finally
- {
- g.setColor(oldColor);
- }
- }
-
-
- /**
- * Determines the width of the border that gets painted by
- * {@link #drawEtchedRect}.
- *
- * @return an <code>Insets</code> object whose <code>top</code>,
- * <code>left</code>, <code>bottom</code> and
- * <code>right</code> field contain the border width at the
- * respective edge in pixels.
- */
- public static Insets getEtchedInsets()
- {
- return new Insets(2, 2, 2, 2);
- }
-
-
- /**
- * Draws a rectangle that appears etched into the surface, given
- * two colors that are used for drawing.
- *
- * <p><img src="doc-files/BasicGraphicsUtils-2.png" width="360"
- * height="200" alt="[An illustration that shows which pixels
- * get painted in what color]" />
- *
- * @param g the graphics into which the rectangle is drawn.
- * @param x the x coordinate of the rectangle.
- * @param y the y coordinate of the rectangle.
- * @param width the width of the rectangle in pixels.
- * @param height the height of the rectangle in pixels.
- *
- * @param shadow the color that will be used for painting the outer
- * side of the top and left edges, and for the inner side of
- * the bottom and right ones.
- *
- * @param highlight the color that will be used for painting the
- * inner side of the top and left edges, and for the outer
- * side of the bottom and right ones.
- *
- * @see #getGrooveInsets()
- * @see javax.swing.border.EtchedBorder
- */
- public static void drawGroove(Graphics g,
- int x, int y, int width, int height,
- Color shadow, Color highlight)
- {
- /* To understand this, it might be helpful to look at the image
- * "BasicGraphicsUtils-2.png" that is included with the JavaDoc,
- * and to compare it with "BasicGraphicsUtils-1.png" which shows
- * the pixels painted by drawEtchedRect. These image files are
- * located in the "doc-files" subdirectory.
- */
- drawEtchedRect(g, x, y, width, height,
- /* outer topLeft */ shadow,
- /* inner topLeft */ highlight,
- /* inner bottomRight */ shadow,
- /* outer bottomRight */ highlight);
- }
-
-
- /**
- * Determines the width of the border that gets painted by
- * {@link #drawGroove}.
- *
- * @return an <code>Insets</code> object whose <code>top</code>,
- * <code>left</code>, <code>bottom</code> and
- * <code>right</code> field contain the border width at the
- * respective edge in pixels.
- */
- public static Insets getGrooveInsets()
- {
- return new Insets(2, 2, 2, 2);
- }
-
-
- /**
- * Draws a border that is suitable for buttons of the Basic look and
- * feel.
- *
- * <p><img src="doc-files/BasicGraphicsUtils-3.png" width="500"
- * height="300" alt="[An illustration that shows which pixels
- * get painted in what color]" />
- *
- * @param g the graphics into which the rectangle is drawn.
- * @param x the x coordinate of the rectangle.
- * @param y the y coordinate of the rectangle.
- * @param width the width of the rectangle in pixels.
- * @param height the height of the rectangle in pixels.
- *
- * @param isPressed <code>true</code> to draw the button border
- * with a pressed-in appearance; <code>false</code> for
- * normal (unpressed) appearance.
- *
- * @param isDefault <code>true</code> to draw the border with
- * the appearance it has when hitting the enter key in a
- * dialog will simulate a click to this button;
- * <code>false</code> for normal appearance.
- *
- * @param shadow the shadow color.
- * @param darkShadow a darker variant of the shadow color.
- * @param highlight the highlight color.
- * @param lightHighlight a brighter variant of the highlight color.
- */
- public static void drawBezel(Graphics g,
- int x, int y, int width, int height,
- boolean isPressed, boolean isDefault,
- Color shadow, Color darkShadow,
- Color highlight, Color lightHighlight)
- {
- Color oldColor = g.getColor();
-
- /* To understand this, it might be helpful to look at the image
- * "BasicGraphicsUtils-3.png" that is included with the JavaDoc,
- * and to compare it with "BasicGraphicsUtils-1.png" which shows
- * the pixels painted by drawEtchedRect. These image files are
- * located in the "doc-files" subdirectory.
- */
- try
- {
- if ((isPressed == false) && (isDefault == false))
- {
- drawEtchedRect(g, x, y, width, height,
- lightHighlight, highlight,
- shadow, darkShadow);
- }
-
- if ((isPressed == true) && (isDefault == false))
- {
- g.setColor(shadow);
- g.drawRect(x + 1, y + 1, width - 2, height - 2);
- }
-
- if ((isPressed == false) && (isDefault == true))
- {
- g.setColor(darkShadow);
- g.drawRect(x, y, width - 1, height - 1);
- drawEtchedRect(g, x + 1, y + 1, width - 2, height - 2,
- lightHighlight, highlight,
- shadow, darkShadow);
- }
-
- if ((isPressed == true) && (isDefault == true))
- {
- g.setColor(darkShadow);
- g.drawRect(x, y, width - 1, height - 1);
- g.setColor(shadow);
- g.drawRect(x + 1, y + 1, width - 3, height - 3);
- }
- }
- finally
- {
- g.setColor(oldColor);
- }
- }
-
-
- /**
- * Draws a rectangle that appears lowered into the surface, given
- * four colors that are used for drawing.
- *
- * <p><img src="doc-files/BasicGraphicsUtils-4.png" width="360"
- * height="200" alt="[An illustration that shows which pixels
- * get painted in what color]" />
- *
- * <p><strong>Compatibility with the Sun reference
- * implementation:</strong> The Sun reference implementation seems
- * to ignore the <code>x</code> and <code>y</code> arguments, at
- * least in JDK 1.3.1 and 1.4.1_01. The method always draws the
- * rectangular area at location (0, 0). A bug report has been filed
- * with Sun; its &#x201c;bug ID&#x201d; is 4880003. The GNU Classpath
- * implementation behaves correctly, thus not replicating this bug.
- *
- * @param g the graphics into which the rectangle is drawn.
- * @param x the x coordinate of the rectangle.
- * @param y the y coordinate of the rectangle.
- * @param width the width of the rectangle in pixels.
- * @param height the height of the rectangle in pixels.
- *
- * @param shadow the color that will be used for painting
- * the inner side of the top and left edges.
- *
- * @param darkShadow the color that will be used for painting
- * the outer side of the top and left edges.
- *
- * @param highlight the color that will be used for painting
- * the inner side of the bottom and right edges.
- *
- * @param lightHighlight the color that will be used for painting
- * the outer side of the bottom and right edges.
- */
- public static void drawLoweredBezel(Graphics g,
- int x, int y, int width, int height,
- Color shadow, Color darkShadow,
- Color highlight, Color lightHighlight)
- {
- /* Like drawEtchedRect, but swapping darkShadow and shadow.
- *
- * To understand this, it might be helpful to look at the image
- * "BasicGraphicsUtils-4.png" that is included with the JavaDoc,
- * and to compare it with "BasicGraphicsUtils-1.png" which shows
- * the pixels painted by drawEtchedRect. These image files are
- * located in the "doc-files" subdirectory.
- */
- drawEtchedRect(g, x, y, width, height,
- darkShadow, shadow,
- highlight, lightHighlight);
- }
-
-
- /**
- * Draws a String at the given location, underlining the first
- * occurence of a specified character. The algorithm for determining
- * the underlined position is not sensitive to case. If the
- * character is not part of <code>text</code>, the text will be
- * drawn without underlining. Drawing is performed in the current
- * color and font of <code>g</code>.
- *
- * <p><img src="doc-files/BasicGraphicsUtils-5.png" width="500"
- * height="100" alt="[An illustration showing how to use the
- * method]" />
- *
- * @param g the graphics into which the String is drawn.
- *
- * @param text the String to draw.
- *
- * @param underlinedChar the character whose first occurence in
- * <code>text</code> will be underlined. It is not clear
- * why the API specification declares this argument to be
- * of type <code>int</code> instead of <code>char</code>.
- * While this would allow to pass Unicode characters outside
- * Basic Multilingual Plane 0 (U+0000 .. U+FFFE), at least
- * the GNU Classpath implementation does not underline
- * anything if <code>underlinedChar</code> is outside
- * the range of <code>char</code>.
- *
- * @param x the x coordinate of the text, as it would be passed to
- * {@link java.awt.Graphics#drawString(java.lang.String,
- * int, int)}.
- *
- * @param y the y coordinate of the text, as it would be passed to
- * {@link java.awt.Graphics#drawString(java.lang.String,
- * int, int)}.
- */
- public static void drawString(Graphics g, String text,
- int underlinedChar, int x, int y)
- {
- int index = -1;
-
- /* It is intentional that lower case is used. In some languages,
- * the set of lowercase characters is larger than the set of
- * uppercase ones. Therefore, it is good practice to use lowercase
- * for such comparisons (which really means that the author of this
- * code can vaguely remember having read some Unicode techreport
- * with this recommendation, but is too lazy to look for the URL).
- */
- if ((underlinedChar >= 0) || (underlinedChar <= 0xffff))
- index = text.toLowerCase().indexOf(
- Character.toLowerCase((char) underlinedChar));
-
- drawStringUnderlineCharAt(g, text, index, x, y);
- }
-
-
- /**
- * Draws a String at the given location, underlining the character
- * at the specified index. Drawing is performed in the current color
- * and font of <code>g</code>.
- *
- * <p><img src="doc-files/BasicGraphicsUtils-5.png" width="500"
- * height="100" alt="[An illustration showing how to use the
- * method]" />
- *
- * @param g the graphics into which the String is drawn.
- *
- * @param text the String to draw.
- *
- * @param underlinedIndex the index of the underlined character in
- * <code>text</code>. If <code>underlinedIndex</code> falls
- * outside the range <code>[0, text.length() - 1]</code>, the
- * text will be drawn without underlining anything.
- *
- * @param x the x coordinate of the text, as it would be passed to
- * {@link java.awt.Graphics#drawString(java.lang.String,
- * int, int)}.
- *
- * @param y the y coordinate of the text, as it would be passed to
- * {@link java.awt.Graphics#drawString(java.lang.String,
- * int, int)}.
- *
- * @since 1.4
- */
- public static void drawStringUnderlineCharAt(Graphics g, String text,
- int underlinedIndex,
- int x, int y)
- {
- Graphics2D g2;
- Rectangle2D.Double underline;
- FontRenderContext frc;
- FontMetrics fmet;
- LineMetrics lineMetrics;
- Font font;
- TextLayout layout;
- double underlineX1, underlineX2;
- boolean drawUnderline;
- int textLength;
-
- textLength = text.length();
- if (textLength == 0)
- return;
-
- drawUnderline = (underlinedIndex >= 0) && (underlinedIndex < textLength);
-
- // FIXME: unfortunately pango and cairo can't agree on metrics
- // so for the time being we continue to *not* use TextLayouts.
- if (true || !(g instanceof Graphics2D))
- {
- /* Fall-back. This is likely to produce garbage for any text
- * containing right-to-left (Hebrew or Arabic) characters, even
- * if the underlined character is left-to-right.
- */
- g.drawString(text, x, y);
- if (drawUnderline)
- {
- fmet = g.getFontMetrics();
- g.fillRect(
- /* x */ x + fmet.stringWidth(text.substring(0, underlinedIndex)),
- /* y */ y + fmet.getDescent() - 1,
- /* width */ fmet.charWidth(text.charAt(underlinedIndex)),
- /* height */ 1);
- }
-
- return;
- }
-
- g2 = (Graphics2D) g;
- font = g2.getFont();
- frc = g2.getFontRenderContext();
- lineMetrics = font.getLineMetrics(text, frc);
- layout = new TextLayout(text, font, frc);
-
- /* Draw the text. */
- layout.draw(g2, x, y);
- if (!drawUnderline)
- return;
-
- underlineX1 = x + layout.getLogicalHighlightShape(
- underlinedIndex, underlinedIndex).getBounds2D().getX();
- underlineX2 = x + layout.getLogicalHighlightShape(
- underlinedIndex + 1, underlinedIndex + 1).getBounds2D().getX();
-
- underline = new Rectangle2D.Double();
- if (underlineX1 < underlineX2)
- {
- underline.x = underlineX1;
- underline.width = underlineX2 - underlineX1;
- }
- else
- {
- underline.x = underlineX2;
- underline.width = underlineX1 - underlineX2;
- }
-
-
- underline.height = lineMetrics.getUnderlineThickness();
- underline.y = lineMetrics.getUnderlineOffset();
- if (underline.y == 0)
- {
- /* Some fonts do not specify an underline offset, although they
- * actually should do so. In that case, the result of calling
- * lineMetrics.getUnderlineOffset() will be zero. Since it would
- * look very ugly if the underline was be positioned immediately
- * below the baseline, we check for this and move the underline
- * below the descent, as shown in the following ASCII picture:
- *
- * ##### ##### #
- * # # # #
- * # # # #
- * # # # #
- * ##### ###### ---- baseline (0)
- * #
- * #
- * ------------------###----------- lineMetrics.getDescent()
- */
- underline.y = lineMetrics.getDescent();
- }
-
- underline.y += y;
- g2.fill(underline);
- }
-
-
- /**
- * Draws a rectangle, simulating a dotted stroke by painting only
- * every second pixel along the one-pixel thick edge. The color of
- * those pixels is the current color of the Graphics <code>g</code>.
- * Any other pixels are left unchanged.
- *
- * <p><img src="doc-files/BasicGraphicsUtils-7.png" width="360"
- * height="200" alt="[An illustration that shows which pixels
- * get painted]" />
- *
- * @param g the graphics into which the rectangle is drawn.
- * @param x the x coordinate of the rectangle.
- * @param y the y coordinate of the rectangle.
- * @param width the width of the rectangle in pixels.
- * @param height the height of the rectangle in pixels.
- */
- public static void drawDashedRect(Graphics g,
- int x, int y, int width, int height)
- {
- int right = x + width - 1;
- int bottom = y + height - 1;
-
- /* Draw the top and bottom edge of the dotted rectangle. */
- for (int i = x; i <= right; i += 2)
- {
- g.drawLine(i, y, i, y);
- g.drawLine(i, bottom, i, bottom);
- }
-
- /* Draw the left and right edge of the dotted rectangle. */
- for (int i = y; i <= bottom; i += 2)
- {
- g.drawLine(x, i, x, i);
- g.drawLine(right, i, right, i);
- }
- }
-
-
- /**
- * Determines the preferred width and height of an AbstractButton,
- * given the gap between the button&#x2019;s text and icon.
- *
- * @param b the button whose preferred size is determined.
- *
- * @param textIconGap the gap between the button&#x2019;s text and
- * icon.
- *
- * @return a <code>Dimension</code> object whose <code>width</code>
- * and <code>height</code> fields indicate the preferred
- * extent in pixels.
- *
- * @see javax.swing.SwingUtilities#layoutCompoundLabel
- */
- public static Dimension getPreferredButtonSize(AbstractButton b,
- int textIconGap)
- {
- Rectangle contentRect;
- Rectangle viewRect;
- Rectangle iconRect = new Rectangle();
- Rectangle textRect = new Rectangle();
- Insets insets = b.getInsets();
-
- viewRect = new Rectangle();
-
- /* java.awt.Toolkit.getFontMetrics is deprecated. However, it
- * seems not obvious how to get to the correct FontMetrics object
- * otherwise. The real problem probably is that the method
- * javax.swing.SwingUtilities.layoutCompundLabel should take a
- * LineMetrics, not a FontMetrics argument. But fixing this that
- * would change the public API.
- */
- SwingUtilities.layoutCompoundLabel(
- b, // for the component orientation
- b.getToolkit().getFontMetrics(b.getFont()), // see comment above
- b.getText(),
- b.getIcon(),
- b.getVerticalAlignment(),
- b.getHorizontalAlignment(),
- b.getVerticalTextPosition(),
- b.getHorizontalTextPosition(),
- viewRect, iconRect, textRect,
- textIconGap);
-
- /* +------------------------+ +------------------------+
- * | | | |
- * | ICON | | CONTENTCONTENTCONTENT |
- * | TEXTTEXTTEXT | --> | CONTENTCONTENTCONTENT |
- * | TEXTTEXTTEXT | | CONTENTCONTENTCONTENT |
- * +------------------------+ +------------------------+
- */
-
- contentRect = textRect.union(iconRect);
-
- return new Dimension(insets.left
- + contentRect.width
- + insets.right,
- insets.top
- + contentRect.height
- + insets.bottom);
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicIconFactory.java b/libjava/javax/swing/plaf/basic/BasicIconFactory.java
deleted file mode 100644
index e7aad8964ba..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicIconFactory.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/* BasicIconFactory.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Polygon;
-import java.io.Serializable;
-
-import javax.swing.AbstractButton;
-import javax.swing.Icon;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-
-/**
- * STUBBED
- */
-public class BasicIconFactory implements Serializable
-{
- static final long serialVersionUID = 5605588811185324383L;
-
- private static class DummyIcon
- implements Icon
- {
- public int getIconHeight() { return 10; }
- public int getIconWidth() { return 10; }
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- Color save = g.getColor();
- g.setColor(c.getForeground());
- g.drawRect(x, y, 10, 10);
- g.setColor(save);
- }
- }
-
-
- public BasicIconFactory()
- {
- }
- public static Icon getMenuItemCheckIcon()
- {
- return new DummyIcon();
- }
- public static Icon getMenuItemArrowIcon()
- {
- return new DummyIcon();
- }
- public static Icon getMenuArrowIcon()
- {
- return new Icon()
- {
- public int getIconHeight()
- {
- return 12;
- }
-
- public int getIconWidth()
- {
- return 12;
- }
-
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- g.translate(x, y);
-
- Color saved = g.getColor();
-
- g.setColor(Color.BLACK);
-
- g.fillPolygon(new Polygon(new int[] { 3, 9, 3 },
- new int[] { 2, 6, 10 },
- 3));
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- };
- }
-
- public static Icon getCheckBoxIcon()
- {
- return new Icon()
- {
- public int getIconHeight()
- {
- return 10;
- }
- public int getIconWidth()
- {
- return 10;
- }
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- if (c instanceof AbstractButton)
- {
- UIDefaults defaults;
- defaults = UIManager.getLookAndFeelDefaults();
- Color hi = defaults.getColor("CheckBox.highlight");
- Color low = defaults.getColor("CheckBox.darkShadow");
- Color sel = defaults.getColor("CheckBox.foreground");
- Color dim = defaults.getColor("CheckBox.shadow");
- Polygon check = new Polygon(new int[] {x+3, x+3, x+8},
- new int[] {y+5, y+9, y+3}, 3);
- AbstractButton b = (AbstractButton) c;
- Color saved = g.getColor();
- if (b.isEnabled())
- {
- g.setColor(low);
- g.drawRect(x, y, 10, 10);
- g.setColor(hi);
- g.drawRect(x+1, y+1, 10, 10);
- if (b.isSelected())
- {
- g.setColor(sel);
- if (b.isSelected())
- {
- g.drawLine(x+3, y+5, x+3, y+8);
- g.drawLine(x+4, y+5, x+4, y+8);
- g.drawLine(x+3, y+8, x+8, y+3);
- g.drawLine(x+4, y+8, x+8, y+3);
- }
- }
- }
- else
- {
- g.setColor(hi);
- g.drawRect(x, y, 10, 10);
- if (b.isSelected())
- {
- g.drawLine(x+3, y+5, x+3, y+9);
- g.drawLine(x+3, y+9, x+8, y+3);
- }
- }
- g.setColor(saved);
- }
- }
- };
- }
-
- public static Icon getRadioButtonIcon()
- {
- return new Icon()
- {
- public int getIconHeight()
- {
- return 12;
- }
- public int getIconWidth()
- {
- return 12;
- }
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- UIDefaults defaults;
- defaults = UIManager.getLookAndFeelDefaults();
- Color hi = defaults.getColor("RadioButton.highlight");
- Color low = defaults.getColor("RadioButton.darkShadow");
- Color sel = defaults.getColor("RadioButton.foreground");
- Color dim = defaults.getColor("RadioButton.shadow");
-
- if (c instanceof AbstractButton)
- {
- AbstractButton b = (AbstractButton) c;
- Color saved = g.getColor();
- if (b.isEnabled())
- {
- g.setColor(low);
- g.drawOval(x, y, 12, 12);
- g.setColor(hi);
- g.drawOval(x+1, y+1, 12, 12);
- if (b.isSelected())
- {
- g.setColor(sel);
- g.fillOval(x+4, y+4, 6, 6);
- }
- }
- else
- {
- g.setColor(hi);
- g.drawOval(x, y, 12, 12);
- if (b.isSelected())
- g.fillOval(x+4, y+4, 6, 6);
- }
- g.setColor(saved);
- }
- }
- };
- }
- public static Icon getCheckBoxMenuItemIcon()
- {
- return getCheckBoxIcon();
- }
- public static Icon getRadioButtonMenuItemIcon()
- {
- return getRadioButtonIcon();
- }
- public static Icon createEmptyFrameIcon()
- {
- return new DummyIcon();
- }
-} // class BasicIconFactory
diff --git a/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java b/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
deleted file mode 100644
index e8c0ff9dc3e..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
+++ /dev/null
@@ -1,1014 +0,0 @@
-/* BasicInternalFrameTitlePane.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.Polygon;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.Icon;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JInternalFrame;
-import javax.swing.JLabel;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-
-/**
- * This class acts as a titlebar for JInternalFrames.
- */
-public class BasicInternalFrameTitlePane extends JComponent
-{
- /**
- * The Action responsible for closing the JInternalFrame.
- */
- public class CloseAction extends AbstractAction
- {
- /**
- * This method is called when something closes the JInternalFrame.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- if (frame.isClosable())
- {
- try
- {
- frame.setClosed(true);
- }
- catch (PropertyVetoException pve)
- {
- }
- }
- }
- }
-
- /**
- * This Action is responsible for iconifying the JInternalFrame.
- */
- public class IconifyAction extends AbstractAction
- {
- /**
- * This method is called when the user wants to iconify the
- * JInternalFrame.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- if (frame.isIconifiable() && ! frame.isIcon())
- {
- try
- {
- frame.setIcon(true);
- }
- catch (PropertyVetoException pve)
- {
- }
- }
- }
- }
-
- /**
- * This Action is responsible for maximizing the JInternalFrame.
- */
- public class MaximizeAction extends AbstractAction
- {
- /**
- * This method is called when the user wants to maximize the
- * JInternalFrame.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- try
- {
- if (frame.isMaximizable() && ! frame.isMaximum())
- frame.setMaximum(true);
- else if (frame.isMaximum())
- frame.setMaximum(false);
- }
- catch (PropertyVetoException pve)
- {
- }
- }
- }
-
- /**
- * This Action is responsible for dragging the JInternalFrame.
- */
- public class MoveAction extends AbstractAction
- {
- /**
- * This method is called when the user wants to drag the JInternalFrame.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- // FIXME: Implement keyboard driven? move actions.
- }
- }
-
- /**
- * This Action is responsible for restoring the JInternalFrame. Restoring
- * the JInternalFrame is the same as setting the maximum property to false.
- */
- public class RestoreAction extends AbstractAction
- {
- /**
- * This method is called when the user wants to restore the
- * JInternalFrame.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- if (frame.isMaximum())
- {
- try
- {
- frame.setMaximum(false);
- }
- catch (PropertyVetoException pve)
- {
- }
- }
- }
- }
-
- /**
- * This action is responsible for sizing the JInternalFrame.
- */
- public class SizeAction extends AbstractAction
- {
- /**
- * This method is called when the user wants to resize the JInternalFrame.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- // FIXME: Not sure how size actions should be handled.
- }
- }
-
- /**
- * This class is responsible for handling property change events from the
- * JInternalFrame and adjusting the Title Pane as necessary.
- */
- protected class PropertyChangeHandler implements PropertyChangeListener
- {
- /**
- * This method is called when a PropertyChangeEvent is received by the
- * Title Pane.
- *
- * @param evt The PropertyChangeEvent.
- */
- public void propertyChange(PropertyChangeEvent evt)
- {
- // The title and frameIcon are taken care of during painting time.
- // The only other thing this will care about are the "is----izable"
- // properties. So we call enable actions to properly handle the
- // buttons and menu items for us.
- enableActions();
- }
- }
-
- /**
- * This class acts as the MenuBar for the TitlePane. Clicking on the Frame
- * Icon in the top left corner will activate it.
- */
- public class SystemMenuBar extends JMenuBar
- {
- /**
- * This method returns true if it can receive focus.
- *
- * @return True if this Component can receive focus.
- */
- public boolean isFocusTransversable()
- {
- return true;
- }
-
- /**
- * This method returns true if this Component is expected to paint all of
- * itself.
- *
- * @return True if this Component is expect to paint all of itself.
- */
- public boolean isOpaque()
- {
- return true;
- }
-
- /**
- * This method paints this Component.
- *
- * @param g The Graphics object to paint with.
- */
- public void paint(Graphics g)
- {
- Icon frameIcon = frame.getFrameIcon();
- if (frameIcon == null)
- frameIcon = BasicDesktopIconUI.defaultIcon;
- frameIcon.paintIcon(this, g, 0, 0);
- }
-
- /**
- * This method requests that focus be given to this Component.
- */
- public void requestFocus()
- {
- super.requestFocus();
- }
- }
-
- /**
- * This class acts as the Layout Manager for the TitlePane.
- */
- protected class TitlePaneLayout implements LayoutManager
- {
- /**
- * Creates a new <code>TitlePaneLayout</code> object.
- */
- public TitlePaneLayout()
- {
- // Do nothing.
- }
-
- /**
- * This method is called when adding a Component to the Container.
- *
- * @param name The name to reference the added Component by.
- * @param c The Component to add.
- */
- public void addLayoutComponent(String name, Component c)
- {
- // Do nothing.
- }
-
- /**
- * This method is called to lay out the children of the Title Pane.
- *
- * @param c The Container to lay out.
- */
- public void layoutContainer(Container c)
- {
- enableActions();
-
- Insets insets = c.getInsets();
- int width = c.getBounds().width - insets.left - insets.right;
- int height = c.getBounds().height - insets.top - insets.bottom;
-
- // MenuBar is always present and located at the top left corner.
- Dimension menupref = menuBar.getPreferredSize();
- menuBar.setBounds(insets.left, insets.top, menupref.width, height);
-
- int loc = width + insets.left;
-
- Insets i = closeButton.getInsets();
- Dimension prefs = new Dimension(iconSize + i.left + i.right,
- iconSize + i.top + i.bottom);
- int top = insets.top + (height - prefs.height) / 2;
- if (closeAction.isEnabled())
- {
- loc -= prefs.width;
- closeButton.setVisible(true);
- closeButton.setBounds(loc, top, prefs.width, prefs.height);
- }
- else
- closeButton.setVisible(false);
-
- if (maximizeAction.isEnabled())
- {
- loc -= prefs.width;
- maxButton.setVisible(true);
- maxButton.setBounds(loc, top, prefs.width, prefs.height);
- }
- else
- maxButton.setVisible(false);
-
- if (iconifyAction.isEnabled())
- {
- loc -= prefs.width;
- iconButton.setVisible(true);
- iconButton.setBounds(loc, top, prefs.width, prefs.height);
- }
- else
- iconButton.setVisible(false);
-
- if (title != null)
- title.setBounds(insets.left + menupref.width, insets.top,
- loc - menupref.width - insets.left, height);
- }
-
- /**
- * This method returns the minimum size of the given Container given the
- * children that it has.
- *
- * @param c The Container to get a minimum size for.
- *
- * @return The minimum size of the Container.
- */
- public Dimension minimumLayoutSize(Container c)
- {
- return preferredLayoutSize(c);
- }
-
- /**
- * This method returns the preferred size of the given Container taking
- * into account the children that it has.
- *
- * @param c The Container to lay out.
- *
- * @return The preferred size of the Container.
- */
- public Dimension preferredLayoutSize(Container c)
- {
- Insets frameInsets = frame.getInsets();
-
- // Height is the max of the preferredHeights of all components
- // inside the pane
- int height = 0;
- int width = 0;
- Dimension d;
-
- Component[] components = BasicInternalFrameTitlePane.this.getComponents();
- for (int i = 0; i < components.length; i++)
- {
- d = components[i].getPreferredSize();
- height = Math.max(height, d.height);
- width += d.width;
- }
-
- Insets insets = BasicInternalFrameTitlePane.this.getInsets();
- height += insets.top + insets.bottom;
-
- return new Dimension(width, height);
- }
-
- /**
- * This method is called when removing a Component from the Container.
- *
- * @param c The Component to remove.
- */
- public void removeLayoutComponent(Component c)
- {
- }
- }
-
- /**
- * This helper class is used to create the minimize, maximize and close
- * buttons in the top right corner of the Title Pane. These buttons are
- * special since they cannot be given focus and have no border.
- */
- private class PaneButton extends JButton
- {
- /**
- * Creates a new PaneButton object with the given Action.
- *
- * @param a The Action that the button uses.
- */
- public PaneButton(Action a)
- {
- super(a);
- setMargin(new Insets(0, 0, 0, 0));
- setBorder(null);
- }
-
- /**
- * This method returns true if the Component can be focused.
- *
- * @return false.
- */
- public boolean isFocusable()
- {
- // These buttons cannot be given focus.
- return false;
- }
- }
-
- /** The action command for the Close action. */
- protected static final String CLOSE_CMD = "Close";
-
- /** The action command for the Minimize action. */
- protected static final String ICONIFY_CMD = "Minimize";
-
- /** The action command for the Maximize action. */
- protected static final String MAXIMIZE_CMD = "Maximize";
-
- /** The action command for the Move action. */
- protected static final String MOVE_CMD = "Move";
-
- /** The action command for the Restore action. */
- protected static final String RESTORE_CMD = "Restore";
-
- /** The action command for the Size action. */
- protected static final String SIZE_CMD = "Size";
-
- /** The action associated with closing the JInternalFrame. */
- protected Action closeAction;
-
- /** The action associated with iconifying the JInternalFrame. */
- protected Action iconifyAction;
-
- /** The action associated with maximizing the JInternalFrame. */
- protected Action maximizeAction;
-
- /** The action associated with moving the JInternalFrame. */
- protected Action moveAction;
-
- /** The action associated with restoring the JInternalFrame. */
- protected Action restoreAction;
-
- /** The action associated with resizing the JInternalFrame. */
- protected Action sizeAction;
-
- /** The button that closes the JInternalFrame. */
- protected JButton closeButton;
-
- /** The button that iconifies the JInternalFrame. */
- protected JButton iconButton;
-
- /** The button that maximizes the JInternalFrame. */
- protected JButton maxButton;
-
- /** Active background color. */
- protected Color activeBGColor;
-
- /** Active foreground color. */
- protected Color activeFGColor;
-
- /** Inactive background color. */
- protected Color inactiveBGColor;
-
- /** Inactive foreground color. */
- protected Color inactiveFGColor;
-
- // FIXME: These icons need to be moved to MetalIconFactory.
-
- /** The size of the icons in the buttons. */
- private static final int iconSize = 16;
-
- /** The icon displayed in the close button. */
- protected Icon closeIcon = new Icon()
- {
- public int getIconHeight()
- {
- return iconSize;
- }
-
- public int getIconWidth()
- {
- return iconSize;
- }
-
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- g.translate(x, y);
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- int four = iconSize / 4;
- int six = iconSize * 6 / 16;
- int ten = iconSize * 10 / 16;
- int twelve = iconSize * 12 / 16;
-
- Polygon a = new Polygon(new int[] { four, six, ten, twelve },
- new int[] { six, four, twelve, ten }, 4);
- Polygon b = new Polygon(new int[] { four, six, ten, twelve },
- new int[] { ten, twelve, four, six }, 4);
-
- g.fillPolygon(a);
- g.fillPolygon(b);
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- };
-
- // FIXME: Create new icon.
-
- /** The icon displayed in the restore button. */
- protected Icon minIcon;
-
- /** The icon displayed in the maximize button. */
- protected Icon maxIcon = new Icon()
- {
- public int getIconHeight()
- {
- return iconSize;
- }
-
- public int getIconWidth()
- {
- return iconSize;
- }
-
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- g.translate(x, y);
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- int four = iconSize / 4;
- int two = four / 2;
- int six = iconSize * 6 / 16;
- int eight = four * 2;
-
- g.fillRect(four, four, eight, two);
- g.drawRect(four, six, eight, six);
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- };
-
- /** The icon displayed in the iconify button. */
- protected Icon iconIcon = new Icon()
- {
- public int getIconHeight()
- {
- return iconSize;
- }
-
- public int getIconWidth()
- {
- return iconSize;
- }
-
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- g.translate(x, y);
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- g.fillRect(iconSize / 4, iconSize * 10 / 16, iconSize / 2, iconSize / 8);
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- };
-
- /** The JInternalFrame that this TitlePane is used in. */
- protected JInternalFrame frame;
-
- /** The JMenuBar that is located at the top left of the Title Pane. */
- protected JMenuBar menuBar;
-
- /** The JMenu inside the menuBar. */
- protected JMenu windowMenu;
-
- /**
- * The text color of the TitlePane when the JInternalFrame is not selected.
- */
- protected Color notSelectedTextColor;
-
- /**
- * The background color of the TitlePane when the JInternalFrame is not
- * selected.
- */
- protected Color notSelectedTitleColor;
-
- /** The text color of the titlePane when the JInternalFrame is selected. */
- protected Color selectedTextColor;
-
- /**
- * The background color of the TitlePane when the JInternalFrame is
- * selected.
- */
- protected Color selectedTitleColor;
-
- /** The Property Change listener that listens to the JInternalFrame. */
- protected PropertyChangeListener propertyChangeListener;
-
- /**
- * The label used to display the title. This label is not added to the
- * TitlePane.
- * This is package-private to avoid an accessor method.
- */
- transient JLabel title;
-
- /**
- * Creates a new BasicInternalFrameTitlePane object that is used in the
- * given JInternalFrame.
- *
- * @param f The JInternalFrame this BasicInternalFrameTitlePane will be used
- * in.
- */
- public BasicInternalFrameTitlePane(JInternalFrame f)
- {
- frame = f;
- setLayout(createLayout());
- title = new JLabel();
- title.setHorizontalAlignment(SwingConstants.LEFT);
- title.setHorizontalTextPosition(SwingConstants.LEFT);
- title.setOpaque(false);
- setOpaque(true);
-
- setBackground(Color.LIGHT_GRAY);
-
- installTitlePane();
- }
-
- /**
- * This method installs the TitlePane onto the JInternalFrameTitlePane. It
- * also creates any children components that need to be created and adds
- * listeners to the appropriate components.
- */
- protected void installTitlePane()
- {
- installDefaults();
- installListeners();
- createActions();
-
- assembleSystemMenu();
-
- createButtons();
- setButtonIcons();
- addSubComponents();
- enableActions();
- }
-
- /**
- * This method adds the sub components to the TitlePane.
- */
- protected void addSubComponents()
- {
- add(menuBar);
-
- add(closeButton);
- add(iconButton);
- add(maxButton);
- }
-
- /**
- * This method creates the actions that are used to manipulate the
- * JInternalFrame.
- */
- protected void createActions()
- {
- closeAction = new CloseAction();
- closeAction.putValue(AbstractAction.ACTION_COMMAND_KEY, CLOSE_CMD);
-
- iconifyAction = new IconifyAction();
- iconifyAction.putValue(AbstractAction.ACTION_COMMAND_KEY, ICONIFY_CMD);
-
- maximizeAction = new MaximizeAction();
- maximizeAction.putValue(AbstractAction.ACTION_COMMAND_KEY, MAXIMIZE_CMD);
-
- sizeAction = new SizeAction();
- sizeAction.putValue(AbstractAction.ACTION_COMMAND_KEY, SIZE_CMD);
-
- restoreAction = new RestoreAction();
- restoreAction.putValue(AbstractAction.ACTION_COMMAND_KEY, RESTORE_CMD);
-
- moveAction = new MoveAction();
- moveAction.putValue(AbstractAction.ACTION_COMMAND_KEY, MOVE_CMD);
- }
-
- /**
- * This method is used to install the listeners.
- */
- protected void installListeners()
- {
- propertyChangeListener = new PropertyChangeHandler();
- frame.addPropertyChangeListener(propertyChangeListener);
- }
-
- /**
- * This method is used to uninstall the listeners.
- */
- protected void uninstallListeners()
- {
- frame.removePropertyChangeListener(propertyChangeListener);
- propertyChangeListener = null;
- }
-
- /**
- * This method installs the defaults determined by the look and feel.
- */
- protected void installDefaults()
- {
- // FIXME: move icons to defaults.
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- setFont(defaults.getFont("InternalFrame.titleFont"));
- activeFGColor = defaults.getColor("InternalFrame.activeTitleForeground");
- activeBGColor = defaults.getColor("InternalFrame.activeTitleBackground");
- inactiveFGColor = defaults.getColor("InternalFrame.inactiveTitleForeground");
- inactiveBGColor = defaults.getColor("InternalFrame.inactiveTitleBackground");
- }
-
- /**
- * This method uninstalls the defaults.
- */
- protected void uninstallDefaults()
- {
- setFont(null);
- activeFGColor = null;
- activeBGColor = null;
- inactiveFGColor = null;
- inactiveBGColor = null;
- }
-
- /**
- * This method creates the buttons used in the TitlePane.
- */
- protected void createButtons()
- {
- closeButton = new PaneButton(closeAction);
- closeButton.setOpaque(false);
-
- iconButton = new PaneButton(iconifyAction);
- iconButton.setOpaque(false);
-
- maxButton = new PaneButton(maximizeAction);
- maxButton.setOpaque(false);
- }
-
- /**
- * This method sets the icons in the buttons.
- */
- protected void setButtonIcons()
- {
- closeButton.setIcon(closeIcon);
- iconButton.setIcon(iconIcon);
- maxButton.setIcon(maxIcon);
- }
-
- /**
- * This method creates the MenuBar used in the TitlePane.
- */
- protected void assembleSystemMenu()
- {
- menuBar = createSystemMenuBar();
- windowMenu = createSystemMenu();
-
- menuBar.add(windowMenu);
-
- addSystemMenuItems(windowMenu);
- enableActions();
- }
-
- /**
- * This method adds the MenuItems to the given JMenu.
- *
- * @param systemMenu The JMenu to add MenuItems to.
- */
- protected void addSystemMenuItems(JMenu systemMenu)
- {
- JMenuItem tmp;
-
- tmp = new JMenuItem(RESTORE_CMD);
- tmp.addActionListener(restoreAction);
- tmp.setMnemonic(KeyEvent.VK_R);
- systemMenu.add(tmp);
-
- tmp = new JMenuItem(MOVE_CMD);
- tmp.addActionListener(moveAction);
- tmp.setMnemonic(KeyEvent.VK_M);
- systemMenu.add(tmp);
-
- tmp = new JMenuItem(SIZE_CMD);
- tmp.addActionListener(sizeAction);
- tmp.setMnemonic(KeyEvent.VK_S);
- systemMenu.add(tmp);
-
- tmp = new JMenuItem(ICONIFY_CMD);
- tmp.addActionListener(iconifyAction);
- tmp.setMnemonic(KeyEvent.VK_N);
- systemMenu.add(tmp);
-
- tmp = new JMenuItem(MAXIMIZE_CMD);
- tmp.addActionListener(maximizeAction);
- tmp.setMnemonic(KeyEvent.VK_X);
- systemMenu.add(tmp);
-
- systemMenu.addSeparator();
-
- tmp = new JMenuItem(CLOSE_CMD);
- tmp.addActionListener(closeAction);
- tmp.setMnemonic(KeyEvent.VK_C);
- systemMenu.add(tmp);
- }
-
- /**
- * This method creates a new JMenubar.
- *
- * @return A new JMenuBar.
- */
- protected JMenuBar createSystemMenuBar()
- {
- if (menuBar == null)
- menuBar = new SystemMenuBar();
- menuBar.removeAll();
- return menuBar;
- }
-
- /**
- * This method creates a new JMenu.
- *
- * @return A new JMenu.
- */
- protected JMenu createSystemMenu()
- {
- if (windowMenu == null)
- windowMenu = new JMenu();
- windowMenu.removeAll();
- return windowMenu;
- }
-
- /**
- * This method programmatically shows the JMenu.
- */
- protected void showSystemMenu()
- {
- // FIXME: Untested as KeyEvents are not hooked up.
- menuBar.getMenu(1).getPopupMenu().show();
- }
-
- /**
- * This method paints the TitlePane.
- *
- * @param g The Graphics object to paint with.
- */
- public void paintComponent(Graphics g)
- {
- paintTitleBackground(g);
- Font f = g.getFont();
- FontMetrics fm = g.getFontMetrics(f);
- if (frame.getTitle() != null && title != null)
- {
- Color saved = g.getColor();
- if (frame.isSelected())
- g.setColor(activeFGColor);
- else
- g.setColor(inactiveFGColor);
- title.setText(getTitle(frame.getTitle(), fm, title.getBounds().width));
- SwingUtilities.paintComponent(g, title, null, title.getBounds());
- g.setColor(saved);
- }
- }
-
- /**
- * This method paints the TitlePane's background.
- *
- * @param g The Graphics object to paint with.
- */
- protected void paintTitleBackground(Graphics g)
- {
- Color saved = g.getColor();
- Dimension dims = getSize();
-
- Color bg = getBackground();
- if (frame.isSelected())
- bg = activeBGColor;
- else
- bg = inactiveBGColor;
- g.setColor(bg);
- g.fillRect(0, 0, dims.width, dims.height);
- g.setColor(saved);
- }
-
- /**
- * This method returns the title string based on the available width and the
- * font metrics.
- *
- * @param text The desired title.
- * @param fm The FontMetrics of the font used.
- * @param availableWidth The available width.
- *
- * @return The allowable string.
- */
- protected String getTitle(String text, FontMetrics fm, int availableWidth)
- {
- Rectangle vr = new Rectangle(0, 0, availableWidth, fm.getHeight());
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
- String value = SwingUtilities.layoutCompoundLabel(this, fm, text, null,
- SwingConstants.CENTER,
- SwingConstants.LEFT,
- SwingConstants.CENTER,
- SwingConstants.LEFT, vr,
- ir, tr, 0);
- return value;
- }
-
- /**
- * This method fires something similar to a WINDOW_CLOSING event.
- *
- * @param frame The JInternalFrame that is being closed.
- */
- protected void postClosingEvent(JInternalFrame frame)
- {
- // FIXME: Implement postClosingEvent when I figure out what
- // it's supposed to do.
- // It says that this fires an WINDOW_CLOSING like event.
- // So the closest thing is some kind of InternalFrameEvent.
- // But none is fired.
- // Can't see it called or anything.
- }
-
- /**
- * This method enables the actions for the TitlePane given the frame's
- * properties.
- */
- protected void enableActions()
- {
- closeAction.setEnabled(frame.isClosable());
-
- iconifyAction.setEnabled(frame.isIconifiable());
- // The maximize action is responsible for restoring it
- // as well, if clicked from the button
- maximizeAction.setEnabled(frame.isMaximizable());
-
- // The restoring action is only active when selected
- // from the menu.
- restoreAction.setEnabled(frame.isMaximum());
-
- sizeAction.setEnabled(frame.isResizable());
-
- // FIXME: Tie MoveAction enabled status to a variable.
- moveAction.setEnabled(false);
- }
-
- /**
- * This method creates a new PropertyChangeListener.
- *
- * @return A new PropertyChangeListener.
- */
- protected PropertyChangeListener createPropertyChangeListener()
- {
- return new PropertyChangeHandler();
- }
-
- /**
- * This method creates a new LayoutManager for the TitlePane.
- *
- * @return A new LayoutManager.
- */
- protected LayoutManager createLayout()
- {
- return new TitlePaneLayout();
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java b/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java
deleted file mode 100644
index 6b81c37f212..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java
+++ /dev/null
@@ -1,1652 +0,0 @@
-/* BasicInternalFrameUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.AWTEvent;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.DefaultDesktopManager;
-import javax.swing.DesktopManager;
-import javax.swing.JComponent;
-import javax.swing.JDesktopPane;
-import javax.swing.JInternalFrame;
-import javax.swing.KeyStroke;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.border.AbstractBorder;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.event.InternalFrameListener;
-import javax.swing.event.MouseInputAdapter;
-import javax.swing.event.MouseInputListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.InternalFrameUI;
-import javax.swing.plaf.UIResource;
-
-/**
- * This is the UI delegate for the Basic look and feel for JInternalFrames.
- */
-public class BasicInternalFrameUI extends InternalFrameUI
-{
- /**
- * This is a helper class that listens to the JInternalFrame for
- * InternalFrameEvents.
- */
- protected class BasicInternalFrameListener implements InternalFrameListener
- {
- /**
- * This method is called when the JInternalFrame is activated.
- *
- * @param e The InternalFrameEvent.
- */
- public void internalFrameActivated(InternalFrameEvent e)
- {
- // FIXME: Implement.
- }
-
- /**
- * This method is called when the JInternalFrame is closed.
- *
- * @param e The InternalFrameEvent.
- */
- public void internalFrameClosed(InternalFrameEvent e)
- {
- // FIXME: Implement.
- }
-
- /**
- * This method is called when the JInternalFrame is closing.
- *
- * @param e The InternalFrameEvent.
- */
- public void internalFrameClosing(InternalFrameEvent e)
- {
- // FIXME: Implement.
- }
-
- /**
- * This method is called when the JInternalFrame is deactivated.
- *
- * @param e The InternalFrameEvent.
- */
- public void internalFrameDeactivated(InternalFrameEvent e)
- {
- // FIXME: Implement.
- }
-
- /**
- * This method is called when the JInternalFrame is deiconified.
- *
- * @param e The InternalFrameEvent.
- */
- public void internalFrameDeiconified(InternalFrameEvent e)
- {
- // FIXME: Implement.
- }
-
- /**
- * This method is called when the JInternalFrame is iconified.
- *
- * @param e The InternalFrameEvent.
- */
- public void internalFrameIconified(InternalFrameEvent e)
- {
- // FIXME: Implement.
- }
-
- /**
- * This method is called when the JInternalFrame is opened.
- *
- * @param e The InternalFrameEvent.
- */
- public void internalFrameOpened(InternalFrameEvent e)
- {
- // FIXME: Implement.
- }
- }
-
- /**
- * This helper class listens to the edges of the JInternalFrame and the
- * TitlePane for mouse events. It is responsible for dragging and resizing
- * the JInternalFrame in response to the MouseEvents.
- */
- protected class BorderListener extends MouseInputAdapter
- implements SwingConstants
- {
- /** FIXME: Use for something. */
- protected int RESIZE_NONE;
-
- /** The x offset from the top left corner of the JInternalFrame. */
- private transient int xOffset = 0;
-
- /** The y offset from the top left corner of the JInternalFrame. */
- private transient int yOffset = 0;
-
- /** The direction that the resize is occuring in. */
- private transient int direction = -1;
-
- /** Cache rectangle that can be reused. */
- private transient Rectangle cacheRect = new Rectangle();
-
- /**
- * This method is called when the mouse is clicked.
- *
- * @param e The MouseEvent.
- */
- public void mouseClicked(MouseEvent e)
- {
- // There is nothing to do when the mouse is clicked
- // on the border.
- }
-
- /**
- * This method is called when the mouse is dragged. This method is
- * responsible for resizing or dragging the JInternalFrame.
- *
- * @param e The MouseEvent.
- */
- public void mouseDragged(MouseEvent e)
- {
- // If the frame is maximized, there is nothing that
- // can be dragged around.
- if (frame.isMaximum())
- return;
- DesktopManager dm = getDesktopManager();
- Rectangle b = frame.getBounds();
- Dimension min = frame.getMinimumSize();
- if (min == null)
- min = new Dimension(0, 0);
- Insets insets = frame.getInsets();
- int x = e.getX();
- int y = e.getY();
- if (e.getSource() == frame && frame.isResizable())
- {
- switch (direction)
- {
- case NORTH:
- cacheRect.setBounds(b.x,
- Math.min(b.y + y, b.y + b.height
- - min.height), b.width, b.height
- - y);
- break;
- case NORTH_EAST:
- cacheRect.setBounds(b.x,
- Math.min(b.y + y, b.y + b.height
- - min.height), x, b.height - y);
- break;
- case EAST:
- cacheRect.setBounds(b.x, b.y, x, b.height);
- break;
- case SOUTH_EAST:
- cacheRect.setBounds(b.x, b.y, x, y);
- break;
- case SOUTH:
- cacheRect.setBounds(b.x, b.y, b.width, y);
- break;
- case SOUTH_WEST:
- cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width),
- b.y, b.width - x, y);
- break;
- case WEST:
- cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width),
- b.y, b.width - x, b.height);
- break;
- case NORTH_WEST:
- cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width),
- Math.min(b.y + y, b.y + b.height
- - min.height), b.width - x,
- b.height - y);
- break;
- }
- dm.resizeFrame(frame, cacheRect.x, cacheRect.y,
- Math.max(min.width, cacheRect.width),
- Math.max(min.height, cacheRect.height));
- }
- else if (e.getSource() == titlePane)
- {
- Rectangle fBounds = frame.getBounds();
-
- dm.dragFrame(frame, e.getX() - xOffset + b.x,
- e.getY() - yOffset + b.y);
- }
- }
-
- /**
- * This method is called when the mouse exits the JInternalFrame.
- *
- * @param e The MouseEvent.
- */
- public void mouseExited(MouseEvent e)
- {
- // There is nothing to do when the mouse exits
- // the border area.
- }
-
- /**
- * This method is called when the mouse is moved inside the
- * JInternalFrame.
- *
- * @param e The MouseEvent.
- */
- public void mouseMoved(MouseEvent e)
- {
- // There is nothing to do when the mouse moves
- // over the border area.
- }
-
- /**
- * This method is called when the mouse is pressed.
- *
- * @param e The MouseEvent.
- */
- public void mousePressed(MouseEvent e)
- {
- activateFrame(frame);
- DesktopManager dm = getDesktopManager();
- int x = e.getX();
- int y = e.getY();
- Insets insets = frame.getInsets();
-
- if (e.getSource() == frame && frame.isResizable())
- {
- direction = sectionOfClick(x, y);
- dm.beginResizingFrame(frame, direction);
- }
- else if (e.getSource() == titlePane)
- {
- Rectangle tBounds = titlePane.getBounds();
-
- xOffset = e.getX() - tBounds.x + insets.left;
- yOffset = e.getY() - tBounds.y + insets.top;
-
- dm.beginDraggingFrame(frame);
- }
- }
-
- /**
- * This method is called when the mouse is released.
- *
- * @param e The MouseEvent.
- */
- public void mouseReleased(MouseEvent e)
- {
- DesktopManager dm = getDesktopManager();
- xOffset = 0;
- yOffset = 0;
- if (e.getSource() == frame && frame.isResizable())
- dm.endResizingFrame(frame);
- else if (e.getSource() == titlePane)
- dm.endDraggingFrame(frame);
- }
-
- /**
- * This method determines the direction of the resize based on the
- * coordinates and the size of the JInternalFrame.
- *
- * @param x The x coordinate of the MouseEvent.
- * @param y The y coordinate of the MouseEvent.
- *
- * @return The direction of the resize (a SwingConstant direction).
- */
- private int sectionOfClick(int x, int y)
- {
- Insets insets = frame.getInsets();
- Rectangle b = frame.getBounds();
- if (x < insets.left && y < insets.top)
- return NORTH_WEST;
- else if (x > b.width - insets.right && y < insets.top)
- return NORTH_EAST;
- else if (x > b.width - insets.right && y > b.height - insets.bottom)
- return SOUTH_EAST;
- else if (x < insets.left && y > b.height - insets.bottom)
- return SOUTH_WEST;
- else if (y < insets.top)
- return NORTH;
- else if (x < insets.left)
- return WEST;
- else if (y > b.height - insets.bottom)
- return SOUTH;
- else if (x > b.width - insets.right)
- return EAST;
-
- return -1;
- }
- }
-
- /**
- * This helper class listens to the JDesktopPane that parents this
- * JInternalFrame and listens for resize events and resizes the
- * JInternalFrame appropriately.
- */
- protected class ComponentHandler implements ComponentListener
- {
- /**
- * This method is called when the JDesktopPane is hidden.
- *
- * @param e The ComponentEvent fired.
- */
- public void componentHidden(ComponentEvent e)
- {
- // Do nothing.
- }
-
- /**
- * This method is called when the JDesktopPane is moved.
- *
- * @param e The ComponentEvent fired.
- */
- public void componentMoved(ComponentEvent e)
- {
- // Do nothing.
- }
-
- /**
- * This method is called when the JDesktopPane is resized.
- *
- * @param e The ComponentEvent fired.
- */
- public void componentResized(ComponentEvent e)
- {
- if (frame.isMaximum())
- {
- JDesktopPane pane = (JDesktopPane) e.getSource();
- Insets insets = pane.getInsets();
- Rectangle bounds = pane.getBounds();
-
- frame.setBounds(bounds.x + insets.left, bounds.y + insets.top,
- bounds.width - insets.left - insets.right,
- bounds.height - insets.top - insets.bottom);
- frame.revalidate();
- frame.repaint();
- }
-
- // Sun also resizes the icons. but it doesn't seem to do anything.
- }
-
- /**
- * This method is called when the JDesktopPane is shown.
- *
- * @param e The ComponentEvent fired.
- */
- public void componentShown(ComponentEvent e)
- {
- // Do nothing.
- }
- }
-
- /**
- * This helper class acts as the LayoutManager for JInternalFrames.
- */
- public class InternalFrameLayout implements LayoutManager
- {
- /**
- * This method is called when the given Component is added to the
- * JInternalFrame.
- *
- * @param name The name of the Component.
- * @param c The Component added.
- */
- public void addLayoutComponent(String name, Component c)
- {
- }
-
- /**
- * This method is used to set the bounds of the children of the
- * JInternalFrame.
- *
- * @param c The Container to lay out.
- */
- public void layoutContainer(Container c)
- {
- Dimension dims = frame.getSize();
- Insets insets = frame.getInsets();
-
- dims.width -= insets.left + insets.right;
- dims.height -= insets.top + insets.bottom;
-
- frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width,
- dims.height);
- int nh = 0;
- int sh = 0;
- int ew = 0;
- int ww = 0;
-
- if (northPane != null)
- {
- Dimension nDims = northPane.getPreferredSize();
- nh = Math.min(nDims.height, dims.height);
-
- northPane.setBounds(insets.left, insets.top, dims.width, nh);
- }
-
- if (southPane != null)
- {
- Dimension sDims = southPane.getPreferredSize();
- sh = Math.min(sDims.height, dims.height - nh);
-
- southPane.setBounds(insets.left, insets.top + dims.height - sh,
- dims.width, sh);
- }
-
- int remHeight = dims.height - sh - nh;
-
- if (westPane != null)
- {
- Dimension wDims = westPane.getPreferredSize();
- ww = Math.min(dims.width, wDims.width);
-
- westPane.setBounds(insets.left, insets.top + nh, ww, remHeight);
- }
-
- if (eastPane != null)
- {
- Dimension eDims = eastPane.getPreferredSize();
- ew = Math.min(eDims.width, dims.width - ww);
-
- eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh,
- ew, remHeight);
- }
-
- int remWidth = dims.width - ww - ew;
-
- frame.getRootPane().setBounds(insets.left + ww, insets.top + nh,
- remWidth, remHeight);
- }
-
- /**
- * This method returns the minimum layout size.
- *
- * @param c The Container to find a minimum layout size for.
- *
- * @return The minimum dimensions for the JInternalFrame.
- */
- public Dimension minimumLayoutSize(Container c)
- {
- return getSize(c, true);
- }
-
- /**
- * This method returns the maximum layout size.
- *
- * @param c The Container to find a maximum layout size for.
- *
- * @return The maximum dimensions for the JInternalFrame.
- */
- public Dimension maximumLayoutSize(Container c)
- {
- return preferredLayoutSize(c);
- }
-
- /**
- * Th8is method returns the preferred layout size.
- *
- * @param c The Container to find a preferred layout size for.
- *
- * @return The preferred dimensions for the JInternalFrame.
- */
- public Dimension preferredLayoutSize(Container c)
- {
- return getSize(c, false);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param c DOCUMENT ME!
- * @param min DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- private Dimension getSize(Container c, boolean min)
- {
- Insets insets = frame.getInsets();
-
- Dimension contentDims = frame.getContentPane().getPreferredSize();
- if (min)
- contentDims.width = contentDims.height = 0;
- int nWidth = 0;
- int nHeight = 0;
- int sWidth = 0;
- int sHeight = 0;
- int eWidth = 0;
- int eHeight = 0;
- int wWidth = 0;
- int wHeight = 0;
- Dimension dims;
-
- if (northPane != null)
- {
- dims = northPane.getPreferredSize();
- if (dims != null)
- {
- nWidth = dims.width;
- nHeight = dims.height;
- }
- }
-
- if (southPane != null)
- {
- dims = southPane.getPreferredSize();
- if (dims != null)
- {
- sWidth = dims.width;
- sHeight = dims.height;
- }
- }
-
- if (eastPane != null)
- {
- dims = eastPane.getPreferredSize();
- if (dims != null)
- {
- sWidth = dims.width;
- sHeight = dims.height;
- }
- }
-
- if (westPane != null)
- {
- dims = westPane.getPreferredSize();
- if (dims != null)
- {
- wWidth = dims.width;
- wHeight = dims.height;
- }
- }
-
- int width = Math.max(sWidth, nWidth);
- width = Math.max(width, contentDims.width + eWidth + wWidth);
-
- int height = Math.max(eHeight, wHeight);
- height = Math.max(height, contentDims.height);
- height += nHeight + sHeight;
-
- width += insets.left + insets.right;
- height += insets.top + insets.bottom;
-
- return new Dimension(width, height);
- }
-
- /**
- * This method is called when a Component is removed from the
- * JInternalFrame.
- *
- * @param c The Component that was removed.
- */
- public void removeLayoutComponent(Component c)
- {
- }
- }
-
- /**
- * This helper class is used to listen to the JDesktopPane's glassPane for
- * MouseEvents. The JInternalFrame can then be selected if a click is
- * detected on its children.
- */
- protected class GlassPaneDispatcher implements MouseInputListener
- {
- /** The MouseEvent target. */
- private transient Component mouseEventTarget;
-
- /** The component pressed. */
- private transient Component pressedComponent;
-
- /** The last component entered. */
- private transient Component lastComponentEntered;
-
- /** The number of presses. */
- private transient int pressCount;
-
- /**
- * This method is called when the mouse enters the glass pane.
- *
- * @param e The MouseEvent.
- */
- public void mouseEntered(MouseEvent e)
- {
- handleEvent(e);
- }
-
- /**
- * This method is called when the mouse is clicked on the glass pane.
- *
- * @param e The MouseEvent.
- */
- public void mouseClicked(MouseEvent e)
- {
- handleEvent(e);
- }
-
- /**
- * This method is called when the mouse is dragged in the glass pane.
- *
- * @param e The MouseEvent.
- */
- public void mouseDragged(MouseEvent e)
- {
- handleEvent(e);
- }
-
- /**
- * This method is called when the mouse exits the glass pane.
- *
- * @param e The MouseEvent.
- */
- public void mouseExited(MouseEvent e)
- {
- handleEvent(e);
- }
-
- /**
- * This method is called when the mouse is moved in the glass pane.
- *
- * @param e The MouseEvent.
- */
- public void mouseMoved(MouseEvent e)
- {
- handleEvent(e);
- }
-
- /**
- * This method is called when the mouse is pressed in the glass pane.
- *
- * @param e The MouseEvent.
- */
- public void mousePressed(MouseEvent e)
- {
- activateFrame(frame);
- handleEvent(e);
- }
-
- /**
- * This method is called when the mouse is released in the glass pane.
- *
- * @param e The MouseEvent.
- */
- public void mouseReleased(MouseEvent e)
- {
- handleEvent(e);
- }
-
- /**
- * This method acquires a candidate component to dispatch the MouseEvent
- * to.
- *
- * @param me The MouseEvent to acquire a component for.
- */
- private void acquireComponentForMouseEvent(MouseEvent me)
- {
- int x = me.getX();
- int y = me.getY();
-
- // Find the candidate which should receive this event.
- Component parent = frame.getContentPane();
- if (parent == null)
- return;
- Component candidate = null;
- Point p = me.getPoint();
- while (candidate == null && parent != null)
- {
- candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y);
- if (candidate == null)
- {
- p = SwingUtilities.convertPoint(parent, p.x, p.y,
- parent.getParent());
- parent = parent.getParent();
- }
- }
-
- // If the only candidate we found was the native container itself,
- // don't dispatch any event at all. We only care about the lightweight
- // children here.
- if (candidate == frame.getContentPane())
- candidate = null;
-
- // If our candidate is new, inform the old target we're leaving.
- if (lastComponentEntered != null && lastComponentEntered.isShowing()
- && lastComponentEntered != candidate)
- {
- Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y,
- lastComponentEntered);
- MouseEvent exited = new MouseEvent(lastComponentEntered,
- MouseEvent.MOUSE_EXITED,
- me.getWhen(), me.getModifiersEx(),
- tp.x, tp.y, me.getClickCount(),
- me.isPopupTrigger(),
- me.getButton());
- lastComponentEntered.dispatchEvent(exited);
- lastComponentEntered = null;
- }
-
- // If we have a candidate, maybe enter it.
- if (candidate != null)
- {
- mouseEventTarget = candidate;
- if (candidate.isLightweight() && candidate.isShowing()
- && candidate != frame.getContentPane()
- && candidate != lastComponentEntered)
- {
- lastComponentEntered = mouseEventTarget;
- Point cp = SwingUtilities.convertPoint(frame.getContentPane(),
- x, y, lastComponentEntered);
- MouseEvent entered = new MouseEvent(lastComponentEntered,
- MouseEvent.MOUSE_ENTERED,
- me.getWhen(),
- me.getModifiersEx(), cp.x,
- cp.y, me.getClickCount(),
- me.isPopupTrigger(),
- me.getButton());
- lastComponentEntered.dispatchEvent(entered);
- }
- }
-
- if (me.getID() == MouseEvent.MOUSE_RELEASED
- || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0
- || me.getID() == MouseEvent.MOUSE_DRAGGED)
- // If any of the following events occur while a button is held down,
- // they should be dispatched to the same component to which the
- // original MOUSE_PRESSED event was dispatched:
- // - MOUSE_RELEASED
- // - MOUSE_PRESSED: another button pressed while the first is held down
- // - MOUSE_DRAGGED
- mouseEventTarget = pressedComponent;
- else if (me.getID() == MouseEvent.MOUSE_CLICKED)
- {
- // Don't dispatch CLICKED events whose target is not the same as the
- // target for the original PRESSED event.
- if (candidate != pressedComponent)
- mouseEventTarget = null;
- else if (pressCount == 0)
- pressedComponent = null;
- }
- }
-
- /**
- * This is a helper method that dispatches the GlassPane MouseEvents to
- * the proper component.
- *
- * @param e The AWTEvent to be dispatched. Usually an instance of
- * MouseEvent.
- */
- private void handleEvent(AWTEvent e)
- {
- if (e instanceof MouseEvent)
- {
- MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane()
- .getGlassPane(),
- (MouseEvent) e,
- frame.getRootPane()
- .getGlassPane());
-
- acquireComponentForMouseEvent(me);
-
- // Avoid dispatching ENTERED and EXITED events twice.
- if (mouseEventTarget != null && mouseEventTarget.isShowing()
- && e.getID() != MouseEvent.MOUSE_ENTERED
- && e.getID() != MouseEvent.MOUSE_EXITED)
- {
- MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame
- .getContentPane(),
- me,
- mouseEventTarget);
- mouseEventTarget.dispatchEvent(newEvt);
-
- switch (e.getID())
- {
- case MouseEvent.MOUSE_PRESSED:
- if (pressCount++ == 0)
- pressedComponent = mouseEventTarget;
- break;
- case MouseEvent.MOUSE_RELEASED:
- // Clear our memory of the original PRESSED event, only if
- // we're not expecting a CLICKED event after this. If
- // there is a CLICKED event after this, it will do clean up.
- if (--pressCount == 0
- && mouseEventTarget != pressedComponent)
- pressedComponent = null;
- break;
- }
- }
- }
- }
- }
-
- /**
- * This helper class listens for PropertyChangeEvents from the
- * JInternalFrame.
- */
- public class InternalFramePropertyChangeListener
- implements PropertyChangeListener
- {
- /**
- * This method is called when one of the JInternalFrame's properties
- * change.
- *
- * @param evt The PropertyChangeEvent.
- */
- public void propertyChange(PropertyChangeEvent evt)
- {
- if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY))
- {
- if (frame.isMaximum())
- maximizeFrame(frame);
- else
- minimizeFrame(frame);
- }
- else if (evt.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY))
- closeFrame(frame);
- else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY))
- {
- if (frame.isIcon())
- iconifyFrame(frame);
- else
- deiconifyFrame(frame);
- }
- else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY))
- {
- if (frame.isSelected())
- activateFrame(frame);
- else
- getDesktopManager().deactivateFrame(frame);
- }
- else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY)
- || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY))
- {
- Component old = (Component) evt.getOldValue();
- old.removeMouseListener(glassPaneDispatcher);
- old.removeMouseMotionListener(glassPaneDispatcher);
-
- Component newPane = (Component) evt.getNewValue();
- newPane.addMouseListener(glassPaneDispatcher);
- newPane.addMouseMotionListener(glassPaneDispatcher);
-
- frame.revalidate();
- }
- /* FIXME: need to add ancestor properties to JComponents.
- else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY))
- {
- if (desktopPane != null)
- desktopPane.removeComponentListener(componentListener);
- desktopPane = frame.getDesktopPane();
- if (desktopPane != null)
- desktopPane.addComponentListener(componentListener);
- }
- */
- }
- }
-
- /**
- * This helper class is the border for the JInternalFrame.
- */
- private class InternalFrameBorder extends AbstractBorder
- implements UIResource
- {
- /** The width of the border. */
- private static final int bSize = 5;
-
- /** The size of the corners. */
- private static final int offset = 10;
-
- /**
- * This method returns whether the border is opaque.
- *
- * @return Whether the border is opaque.
- */
- public boolean isBorderOpaque()
- {
- return true;
- }
-
- /**
- * This method returns the insets of the border.
- *
- * @param c The Component to find border insets for.
- *
- * @return The border insets.
- */
- public Insets getBorderInsets(Component c)
- {
- return new Insets(bSize, bSize, bSize, bSize);
- }
-
- /**
- * This method paints the border.
- *
- * @param c The Component that owns the border.
- * @param g The Graphics object to paint with.
- * @param x The x coordinate to paint at.
- * @param y The y coordinate to paint at.
- * @param width The width of the Component.
- * @param height The height of the Component.
- */
- public void paintBorder(Component c, Graphics g, int x, int y, int width,
- int height)
- {
- g.translate(x, y);
- Color saved = g.getColor();
- Rectangle b = frame.getBounds();
-
- Color d = c.getBackground();
- g.setColor(d);
- g.fillRect(0, 0, bSize, b.height);
- g.fillRect(0, 0, b.width, bSize);
- g.fillRect(0, b.height - bSize, b.width, bSize);
- g.fillRect(b.width - bSize, 0, bSize, b.height);
-
- int x1 = 0;
- int x2 = bSize;
- int x3 = b.width - bSize;
- int x4 = b.width;
-
- int y1 = 0;
- int y2 = bSize;
- int y3 = b.height - bSize;
- int y4 = b.height;
-
- g.setColor(Color.GRAY);
- g.fillRect(0, 0, bSize, y4);
- g.fillRect(0, 0, x4, bSize);
- g.fillRect(0, y3, b.width, bSize);
- g.fillRect(x3, 0, bSize, b.height);
-
- g.fill3DRect(0, offset, bSize, b.height - 2 * offset, false);
- g.fill3DRect(offset, 0, b.width - 2 * offset, bSize, false);
- g.fill3DRect(offset, b.height - bSize, b.width - 2 * offset, bSize, false);
- g.fill3DRect(b.width - bSize, offset, bSize, b.height - 2 * offset, false);
-
- g.translate(-x, -y);
- g.setColor(saved);
- }
- }
-
- /**
- * The MouseListener that is responsible for dragging and resizing the
- * JInternalFrame in response to MouseEvents.
- */
- protected MouseInputAdapter borderListener;
-
- /**
- * The ComponentListener that is responsible for resizing the JInternalFrame
- * in response to ComponentEvents from the JDesktopPane.
- */
- protected ComponentListener componentListener;
-
- /**
- * The MouseListener that is responsible for activating the JInternalFrame
- * when the mouse press activates one of its descendents.
- */
- protected MouseInputListener glassPaneDispatcher;
-
- /**
- * The PropertyChangeListener that is responsible for listening to
- * PropertyChangeEvents from the JInternalFrame.
- */
- protected PropertyChangeListener propertyChangeListener;
-
- /** The InternalFrameListener that listens to the JInternalFrame. */
- private transient BasicInternalFrameListener internalFrameListener;
-
- /** The JComponent placed at the east region of the JInternalFrame. */
- protected JComponent eastPane;
-
- /** The JComponent placed at the north region of the JInternalFrame. */
- protected JComponent northPane;
-
- /** The JComponent placed at the south region of the JInternalFrame. */
- protected JComponent southPane;
-
- /** The JComponent placed at the west region of the JInternalFrame. */
- protected JComponent westPane;
-
- /**
- * The Keystroke bound to open the menu.
- * @deprecated
- */
- protected KeyStroke openMenuKey;
-
- /** The TitlePane displayed at the top of the JInternalFrame. */
- protected BasicInternalFrameTitlePane titlePane;
-
- /** The JInternalFrame this UI is responsible for. */
- protected JInternalFrame frame;
-
- /** The LayoutManager used in the JInternalFrame. */
- protected LayoutManager internalFrameLayout;
-
- /** The JDesktopPane that is the parent of the JInternalFrame. */
- private transient JDesktopPane desktopPane;
-
- /**
- * Creates a new BasicInternalFrameUI object.
- *
- * @param b The JInternalFrame this UI will represent.
- */
- public BasicInternalFrameUI(JInternalFrame b)
- {
- }
-
- /**
- * This method will create a new BasicInternalFrameUI for the given
- * JComponent.
- *
- * @param b The JComponent to create a BasicInternalFrameUI for.
- *
- * @return A new BasicInternalFrameUI.
- */
- public static ComponentUI createUI(JComponent b)
- {
- return new BasicInternalFrameUI((JInternalFrame) b);
- }
-
- /**
- * This method installs a UI for the JInternalFrame.
- *
- * @param c The JComponent to install this UI on.
- */
- public void installUI(JComponent c)
- {
- if (c instanceof JInternalFrame)
- {
- frame = (JInternalFrame) c;
-
- internalFrameLayout = createLayoutManager();
- frame.setLayout(internalFrameLayout);
-
- ((JComponent) frame.getRootPane().getGlassPane()).setOpaque(false);
- frame.getRootPane().getGlassPane().setVisible(true);
-
- installDefaults();
- installListeners();
- installComponents();
- installKeyboardActions();
-
- frame.setOpaque(true);
- titlePane.setOpaque(true);
- frame.invalidate();
- }
- }
-
- /**
- * This method reverses the work done by installUI.
- *
- * @param c The JComponent to uninstall this UI for.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallKeyboardActions();
- uninstallComponents();
- uninstallListeners();
- uninstallDefaults();
-
- frame.setLayout(null);
- ((JComponent) frame.getRootPane().getGlassPane()).setOpaque(true);
- frame.getRootPane().getGlassPane().setVisible(false);
-
- frame = null;
- }
-
- /**
- * This method installs the defaults specified by the look and feel.
- */
- protected void installDefaults()
- {
- // FIXME: Move border to MetalBorders
- frame.setBorder(new InternalFrameBorder());
- }
-
- /**
- * This method installs the keyboard actions for the JInternalFrame.
- */
- protected void installKeyboardActions()
- {
- // FIXME: Implement.
- }
-
- /**
- * This method installs the Components for the JInternalFrame.
- */
- protected void installComponents()
- {
- setNorthPane(createNorthPane(frame));
- setSouthPane(createSouthPane(frame));
- setEastPane(createEastPane(frame));
- setWestPane(createWestPane(frame));
- }
-
- /**
- * This method installs the listeners for the JInternalFrame.
- */
- protected void installListeners()
- {
- glassPaneDispatcher = createGlassPaneDispatcher();
- createInternalFrameListener();
- borderListener = createBorderListener(frame);
- componentListener = createComponentListener();
- propertyChangeListener = createPropertyChangeListener();
-
- frame.addMouseListener(borderListener);
- frame.addMouseMotionListener(borderListener);
- frame.addInternalFrameListener(internalFrameListener);
- frame.addPropertyChangeListener(propertyChangeListener);
-
- frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher);
- frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher);
- }
-
- /**
- * This method uninstalls the defaults for the JInternalFrame.
- */
- protected void uninstallDefaults()
- {
- frame.setBorder(null);
- }
-
- /**
- * This method uninstalls the Components for the JInternalFrame.
- */
- protected void uninstallComponents()
- {
- setNorthPane(null);
- setSouthPane(null);
- setEastPane(null);
- setWestPane(null);
- }
-
- /**
- * This method uninstalls the listeners for the JInternalFrame.
- */
- protected void uninstallListeners()
- {
- if (desktopPane != null)
- desktopPane.removeComponentListener(componentListener);
-
- frame.getRootPane().getGlassPane().removeMouseMotionListener(glassPaneDispatcher);
- frame.getRootPane().getGlassPane().removeMouseListener(glassPaneDispatcher);
-
- frame.removePropertyChangeListener(propertyChangeListener);
- frame.removeInternalFrameListener(internalFrameListener);
- frame.removeMouseMotionListener(borderListener);
- frame.removeMouseListener(borderListener);
-
- propertyChangeListener = null;
- componentListener = null;
- borderListener = null;
- internalFrameListener = null;
- glassPaneDispatcher = null;
- }
-
- /**
- * This method uninstalls the keyboard actions for the JInternalFrame.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: Implement.
- }
-
- /**
- * This method creates a new LayoutManager for the JInternalFrame.
- *
- * @return A new LayoutManager for the JInternalFrame.
- */
- protected LayoutManager createLayoutManager()
- {
- return new InternalFrameLayout();
- }
-
- /**
- * This method creates a new PropertyChangeListener for the JInternalFrame.
- *
- * @return A new PropertyChangeListener for the JInternalFrame.
- */
- protected PropertyChangeListener createPropertyChangeListener()
- {
- return new InternalFramePropertyChangeListener();
- }
-
- /**
- * This method returns the preferred size of the given JComponent.
- *
- * @param x The JComponent to find a preferred size for.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize(JComponent x)
- {
- return internalFrameLayout.preferredLayoutSize(x);
- }
-
- /**
- * This method returns the minimum size of the given JComponent.
- *
- * @param x The JComponent to find a minimum size for.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize(JComponent x)
- {
- return internalFrameLayout.minimumLayoutSize(x);
- }
-
- /**
- * This method returns the maximum size of the given JComponent.
- *
- * @param x The JComponent to find a maximum size for.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize(JComponent x)
- {
- return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
- }
-
- /**
- * This method replaces the currentPane with the newPane. When replacing it
- * also removes the MouseHandlers for the old pane and installs them on
- * the new pane.
- *
- * @param currentPane The old pane to remove.
- * @param newPane The new pane to install.
- */
- protected void replacePane(JComponent currentPane, JComponent newPane)
- {
- if (currentPane != null)
- {
- deinstallMouseHandlers(currentPane);
- frame.remove(currentPane);
- }
-
- if (newPane != null)
- {
- installMouseHandlers(newPane);
- frame.add(newPane);
- }
- }
-
- /**
- * This method removes the necessary MouseListeners from the given
- * JComponent.
- *
- * @param c The JComponent to remove MouseListeners from.
- */
- protected void deinstallMouseHandlers(JComponent c)
- {
- c.removeMouseListener(borderListener);
- c.removeMouseMotionListener(borderListener);
- }
-
- /**
- * This method installs the necessary MouseListeners from the given
- * JComponent.
- *
- * @param c The JComponent to install MouseListeners on.
- */
- protected void installMouseHandlers(JComponent c)
- {
- c.addMouseListener(borderListener);
- c.addMouseMotionListener(borderListener);
- }
-
- /**
- * This method creates the north pane used in the JInternalFrame.
- *
- * @param w The JInternalFrame to create a north pane for.
- *
- * @return The north pane.
- */
- protected JComponent createNorthPane(JInternalFrame w)
- {
- titlePane = new BasicInternalFrameTitlePane(w);
- return titlePane;
- }
-
- /**
- * This method creates the west pane used in the JInternalFrame.
- *
- * @param w The JInternalFrame to create a west pane for.
- *
- * @return The west pane.
- */
- protected JComponent createWestPane(JInternalFrame w)
- {
- return null;
- }
-
- /**
- * This method creates the south pane used in the JInternalFrame.
- *
- * @param w The JInternalFrame to create a south pane for.
- *
- * @return The south pane.
- */
- protected JComponent createSouthPane(JInternalFrame w)
- {
- return null;
- }
-
- /**
- * This method creates the east pane used in the JInternalFrame.
- *
- * @param w The JInternalFrame to create an east pane for.
- *
- * @return The east pane.
- */
- protected JComponent createEastPane(JInternalFrame w)
- {
- return null;
- }
-
- /**
- * This method returns a new BorderListener for the given JInternalFrame.
- *
- * @param w The JIntenalFrame to create a BorderListener for.
- *
- * @return A new BorderListener.
- */
- protected MouseInputAdapter createBorderListener(JInternalFrame w)
- {
- return new BorderListener();
- }
-
- /**
- * This method creates a new InternalFrameListener for the JInternalFrame.
- */
- protected void createInternalFrameListener()
- {
- internalFrameListener = new BasicInternalFrameListener();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- protected final boolean isKeyBindingRegistered()
- {
- // FIXME: Implement.
- return false;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param b DOCUMENT ME!
- */
- protected final void setKeyBindingRegistered(boolean b)
- {
- // FIXME: Implement.
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public final boolean isKeyBindingActive()
- {
- // FIXME: Implement.
- return false;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param b DOCUMENT ME!
- */
- protected final void setKeyBindingActive(boolean b)
- {
- // FIXME: Implement.
- }
-
- /**
- * DOCUMENT ME!
- */
- protected void setupMenuOpenKey()
- {
- // FIXME: Implement.
- }
-
- /**
- * DOCUMENT ME!
- */
- protected void setupMenuCloseKey()
- {
- // FIXME: Implement.
- }
-
- /**
- * This method returns the north pane.
- *
- * @return The north pane.
- */
- public JComponent getNorthPane()
- {
- return northPane;
- }
-
- /**
- * This method sets the north pane to be the given JComponent.
- *
- * @param c The new north pane.
- */
- public void setNorthPane(JComponent c)
- {
- replacePane(northPane, c);
- northPane = c;
- }
-
- /**
- * This method returns the south pane.
- *
- * @return The south pane.
- */
- public JComponent getSouthPane()
- {
- return southPane;
- }
-
- /**
- * This method sets the south pane to be the given JComponent.
- *
- * @param c The new south pane.
- */
- public void setSouthPane(JComponent c)
- {
- replacePane(southPane, c);
- southPane = c;
- }
-
- /**
- * This method sets the east pane to be the given JComponent.
- *
- * @param c The new east pane.
- */
- public void setEastPane(JComponent c)
- {
- replacePane(eastPane, c);
- eastPane = c;
- }
-
- /**
- * This method returns the east pane.
- *
- * @return The east pane.
- */
- public JComponent getEastPane()
- {
- return eastPane;
- }
-
- /**
- * This method sets the west pane to be the given JComponent.
- *
- * @param c The new west pane.
- */
- public void setWestPane(JComponent c)
- {
- replacePane(westPane, c);
- westPane = c;
- }
-
- /**
- * This method returns the west pane.
- *
- * @return The west pane.
- */
- public JComponent getWestPane()
- {
- return westPane;
- }
-
- /**
- * This method returns the DesktopManager to use with the JInternalFrame.
- *
- * @return The DesktopManager to use with the JInternalFrame.
- */
- protected DesktopManager getDesktopManager()
- {
- DesktopManager value = frame.getDesktopPane().getDesktopManager();
- if (value == null)
- value = createDesktopManager();
- return value;
- }
-
- /**
- * This method returns a default DesktopManager that can be used with this
- * JInternalFrame.
- *
- * @return A default DesktopManager that can be used with this
- * JInternalFrame.
- */
- protected DesktopManager createDesktopManager()
- {
- return new DefaultDesktopManager();
- }
-
- /**
- * This is a convenience method that closes the JInternalFrame.
- *
- * @param f The JInternalFrame to close.
- */
- protected void closeFrame(JInternalFrame f)
- {
- getDesktopManager().closeFrame(f);
- }
-
- /**
- * This is a convenience method that maximizes the JInternalFrame.
- *
- * @param f The JInternalFrame to maximize.
- */
- protected void maximizeFrame(JInternalFrame f)
- {
- getDesktopManager().maximizeFrame(f);
- }
-
- /**
- * This is a convenience method that minimizes the JInternalFrame.
- *
- * @param f The JInternalFrame to minimize.
- */
- protected void minimizeFrame(JInternalFrame f)
- {
- getDesktopManager().minimizeFrame(f);
- }
-
- /**
- * This is a convenience method that iconifies the JInternalFrame.
- *
- * @param f The JInternalFrame to iconify.
- */
- protected void iconifyFrame(JInternalFrame f)
- {
- getDesktopManager().iconifyFrame(f);
- }
-
- /**
- * This is a convenience method that deiconifies the JInternalFrame.
- *
- * @param f The JInternalFrame to deiconify.
- */
- protected void deiconifyFrame(JInternalFrame f)
- {
- getDesktopManager().deiconifyFrame(f);
- }
-
- /**
- * This is a convenience method that activates the JInternalFrame.
- *
- * @param f The JInternalFrame to activate.
- */
- protected void activateFrame(JInternalFrame f)
- {
- getDesktopManager().activateFrame(f);
- }
-
- /**
- * This method returns a new ComponentListener for the JDesktopPane.
- *
- * @return A new ComponentListener.
- */
- protected ComponentListener createComponentListener()
- {
- return new ComponentHandler();
- }
-
- /**
- * This method returns a new GlassPaneDispatcher.
- *
- * @return A new GlassPaneDispatcher.
- */
- protected MouseInputListener createGlassPaneDispatcher()
- {
- return new GlassPaneDispatcher();
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicLabelUI.java b/libjava/javax/swing/plaf/basic/BasicLabelUI.java
deleted file mode 100644
index 9ed7b1f7d02..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicLabelUI.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/* BasicLabelUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.Icon;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.LabelUI;
-
-
-/**
- * This is the Basic Look and Feel class for the JLabel. One BasicLabelUI
- * object is used to paint all JLabels that utilize the Basic Look and Feel.
- */
-public class BasicLabelUI extends LabelUI implements PropertyChangeListener
-{
- /** The labelUI that is shared by all labels. */
- protected static BasicLabelUI labelUI;
-
- /**
- * Creates a new BasicLabelUI object.
- */
- public BasicLabelUI()
- {
- super();
- }
-
- /**
- * Creates and returns a UI for the label. Since one UI is shared by all
- * labels, this means creating only if necessary and returning the shared
- * UI.
- *
- * @param c The {@link JComponent} that a UI is being created for.
- *
- * @return A label UI for the Basic Look and Feel.
- */
- public static ComponentUI createUI(JComponent c)
- {
- if (labelUI == null)
- labelUI = new BasicLabelUI();
- return labelUI;
- }
-
- /**
- * Returns the preferred size of this component as calculated by the
- * {@link layoutCL} method.
- *
- * @param c This {@link JComponent} to get a preferred size for.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- JLabel lab = (JLabel)c;
- Rectangle vr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
- Insets insets = lab.getInsets();
- FontMetrics fm = lab.getToolkit().getFontMetrics(lab.getFont());
- layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr);
- Rectangle cr = tr.union(ir);
- return new Dimension(insets.left + cr.width + insets.right,
- insets.top + cr.height + insets.bottom);
-
- }
-
- /**
- * This method returns the minimum size of the {@link JComponent} given. If
- * this method returns null, then it is up to the Layout Manager to give
- * this component a minimum size.
- *
- * @param c The {@link JComponent} to get a minimum size for.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the maximum size of the {@link JComponent} given. If
- * this method returns null, then it is up to the Layout Manager to give
- * this component a maximum size.
- *
- * @param c The {@link JComponent} to get a maximum size for.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * The method that paints the label according to its current state.
- *
- * @param g The {@link Graphics} object to paint with.
- * @param c The {@link JComponent} to paint.
- */
- public void paint(Graphics g, JComponent c)
- {
- JLabel b = (JLabel) c;
-
- Font saved_font = g.getFont();
-
- Rectangle tr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle vr = new Rectangle();
-
- Font f = c.getFont();
-
- g.setFont(f);
- FontMetrics fm = g.getFontMetrics(f);
-
- vr = SwingUtilities.calculateInnerArea(c, vr);
-
- if (vr.width < 0)
- vr.width = 0;
- if (vr.height < 0)
- vr.height = 0;
-
- Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon();
-
- String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr);
-
- if (icon != null)
- icon.paintIcon(b, g, ir.x, ir.y);
- if (text != null && ! text.equals(""))
- {
- if (b.isEnabled())
- paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent());
- else
- paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent());
- }
- g.setFont(saved_font);
- }
-
- /**
- * This method is simply calls SwingUtilities's layoutCompoundLabel.
- *
- * @param label The label to lay out.
- * @param fontMetrics The FontMetrics for the font used.
- * @param text The text to paint.
- * @param icon The icon to draw.
- * @param viewR The entire viewable rectangle.
- * @param iconR The icon bounds rectangle.
- * @param textR The text bounds rectangle.
- *
- * @return A possibly clipped version of the text.
- */
- protected String layoutCL(JLabel label, FontMetrics fontMetrics,
- String text, Icon icon, Rectangle viewR,
- Rectangle iconR, Rectangle textR)
- {
- return SwingUtilities.layoutCompoundLabel(label, fontMetrics, text, icon,
- label.getVerticalAlignment(),
- label.getHorizontalAlignment(),
- label.getVerticalTextPosition(),
- label.getHorizontalTextPosition(),
- viewR, iconR, textR,
- label.getIconTextGap());
- }
-
- /**
- * Paints the text if the label is disabled. By default, this paints the
- * clipped text returned by layoutCompoundLabel using the
- * background.brighter() color. It also paints the same text using the
- * background.darker() color one pixel to the right and one pixel down.
- *
- * @param l The {@link JLabel} being painted.
- * @param g The {@link Graphics} object to paint with.
- * @param s The String to paint.
- * @param textX The x coordinate of the start of the baseline.
- * @param textY The y coordinate of the start of the baseline.
- */
- protected void paintDisabledText(JLabel l, Graphics g, String s, int textX,
- int textY)
- {
- Color saved_color = g.getColor();
-
- g.setColor(l.getBackground().brighter());
-
- int mnemIndex = l.getDisplayedMnemonicIndex();
-
- if (mnemIndex != -1)
- BasicGraphicsUtils.drawStringUnderlineCharAt(g, s, mnemIndex, textX,
- textY);
- else
- g.drawString(s, textX, textY);
-
- g.setColor(l.getBackground().darker());
- if (mnemIndex != -1)
- BasicGraphicsUtils.drawStringUnderlineCharAt(g, s, mnemIndex, textX + 1,
- textY + 1);
- else
- g.drawString(s, textX + 1, textY + 1);
-
- g.setColor(saved_color);
- }
-
- /**
- * Paints the text if the label is enabled. The text is painted using the
- * foreground color.
- *
- * @param l The {@link JLabel} being painted.
- * @param g The {@link Graphics} object to paint with.
- * @param s The String to paint.
- * @param textX The x coordinate of the start of the baseline.
- * @param textY The y coordinate of the start of the baseline.
- */
- protected void paintEnabledText(JLabel l, Graphics g, String s, int textX,
- int textY)
- {
- Color saved_color = g.getColor();
- g.setColor(l.getForeground());
-
- int mnemIndex = l.getDisplayedMnemonicIndex();
-
- if (mnemIndex != -1)
- BasicGraphicsUtils.drawStringUnderlineCharAt(g, s, mnemIndex, textX,
- textY);
- else
- g.drawString(s, textX, textY);
-
- g.setColor(saved_color);
- }
-
- /**
- * This method installs the UI for the given {@link JComponent}. This
- * method will install the component, defaults, listeners, and keyboard
- * actions.
- *
- * @param c The {@link JComponent} that this UI is being installed on.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
- if (c instanceof JLabel)
- {
- JLabel l = (JLabel) c;
-
- installComponents(l);
- installDefaults(l);
- installListeners(l);
- installKeyboardActions(l);
- }
- }
-
- /**
- * This method uninstalls the UI for the given {@link JComponent}. This
- * method will uninstall the component, defaults, listeners, and keyboard
- * actions.
- *
- * @param c The {@link JComponent} that this UI is being installed on.
- */
- public void uninstallUI(JComponent c)
- {
- super.uninstallUI(c);
- if (c instanceof JLabel)
- {
- JLabel l = (JLabel) c;
-
- uninstallKeyboardActions(l);
- uninstallListeners(l);
- uninstallDefaults(l);
- uninstallComponents(l);
- }
- }
-
- /**
- * This method installs the components for this {@link JLabel}.
- *
- * @param c The {@link JLabel} to install components for.
- */
- protected void installComponents(JLabel c)
- {
- //FIXME: fix javadoc + implement.
- }
-
- /**
- * This method uninstalls the components for this {@link JLabel}.
- *
- * @param c The {@link JLabel} to uninstall components for.
- */
- protected void uninstallComponents(JLabel c)
- {
- //FIXME: fix javadoc + implement.
- }
-
- /**
- * This method installs the defaults that are defined in the Basic look and
- * feel for this {@link JLabel}.
- *
- * @param c The {@link JLabel} to install defaults for.
- */
- protected void installDefaults(JLabel c)
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- c.setForeground(defaults.getColor("Label.foreground"));
- c.setBackground(defaults.getColor("Label.background"));
- c.setFont(defaults.getFont("Label.font"));
- c.setBorder(defaults.getBorder("Label.border"));
- c.setOpaque(true);
- //XXX: There are properties we don't use called disabledForeground
- //and disabledShadow.
- }
-
- /**
- * This method uninstalls the defaults that are defined in the Basic look
- * and feel for this {@link JLabel}.
- *
- * @param c The {@link JLabel} to uninstall defaults for.
- */
- protected void uninstallDefaults(JLabel c)
- {
- c.setForeground(null);
- c.setBackground(null);
- c.setFont(null);
- c.setBorder(null);
- }
-
- /**
- * This method installs the keyboard actions for the given {@link JLabel}.
- *
- * @param l The {@link JLabel} to install keyboard actions for.
- */
- protected void installKeyboardActions(JLabel l)
- {
- //FIXME: implement.
- }
-
- /**
- * This method uninstalls the keyboard actions for the given {@link JLabel}.
- *
- * @param l The {@link JLabel} to uninstall keyboard actions for.
- */
- protected void uninstallKeyboardActions(JLabel l)
- {
- //FIXME: implement.
- }
-
- /**
- * This method installs the listeners for the given {@link JLabel}. The UI
- * delegate only listens to the label.
- *
- * @param c The {@link JLabel} to install listeners for.
- */
- protected void installListeners(JLabel c)
- {
- c.addPropertyChangeListener(this);
- }
-
- /**
- * This method uninstalls the listeners for the given {@link JLabel}. The UI
- * delegate only listens to the label.
- *
- * @param c The {@link JLabel} to uninstall listeners for.
- */
- protected void uninstallListeners(JLabel c)
- {
- c.removePropertyChangeListener(this);
- }
-
- /**
- * This method is called whenever any JLabel's that use this UI has one of
- * their properties change.
- *
- * @param e The {@link PropertyChangeEvent} that describes the change.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- JLabel c = (JLabel) e.getSource();
- c.revalidate();
- c.repaint();
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicListUI.java b/libjava/javax/swing/plaf/basic/BasicListUI.java
deleted file mode 100644
index e1bac4e40ea..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicListUI.java
+++ /dev/null
@@ -1,870 +0,0 @@
-/* BasicListUI.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.CellRendererPane;
-import javax.swing.JComponent;
-import javax.swing.JList;
-import javax.swing.JViewport;
-import javax.swing.ListCellRenderer;
-import javax.swing.ListModel;
-import javax.swing.ListSelectionModel;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.MouseInputListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.ListUI;
-
-/**
- * The Basic Look and Feel UI delegate for the
- * JList.
- */
-public class BasicListUI extends ListUI
-{
-
- /**
- * A helper class which listens for {@link ComponentEvent}s from
- * the JList.
- */
- private class ComponentHandler extends ComponentAdapter {
-
- /**
- * Called when the component is hidden. Invalidates the internal
- * layout.
- */
- public void componentResized(ComponentEvent ev) {
- BasicListUI.this.damageLayout();
- }
- }
-
- /**
- * A helper class which listens for {@link FocusEvents}
- * from the JList.
- */
- public class FocusHandler implements FocusListener
- {
- /**
- * Called when the JList acquires focus.
- *
- * @param e The FocusEvent representing focus acquisition
- */
- public void focusGained(FocusEvent e)
- {
- repaintCellFocus();
- }
-
- /**
- * Called when the JList loses focus.
- *
- * @param e The FocusEvent representing focus loss
- */
- public void focusLost(FocusEvent e)
- {
- repaintCellFocus();
- }
-
- /**
- * Helper method to repaint the focused cell's
- * lost or acquired focus state.
- */
- void repaintCellFocus()
- {
- }
- }
-
- /**
- * A helper class which listens for {@link ListDataEvent}s generated by
- * the {@link JList}'s {@link ListModel}.
- *
- * @see javax.swing.JList#model
- */
- public class ListDataHandler implements ListDataListener
- {
- /**
- * Called when a general change has happened in the model which cannot
- * be represented in terms of a simple addition or deletion.
- *
- * @param e The event representing the change
- */
- public void contentsChanged(ListDataEvent e)
- {
- BasicListUI.this.damageLayout();
- }
-
- /**
- * Called when an interval of objects has been added to the model.
- *
- * @param e The event representing the addition
- */
- public void intervalAdded(ListDataEvent e)
- {
- BasicListUI.this.damageLayout();
- }
-
- /**
- * Called when an inteval of objects has been removed from the model.
- *
- * @param e The event representing the removal
- */
- public void intervalRemoved(ListDataEvent e)
- {
- BasicListUI.this.damageLayout();
- }
- }
-
- /**
- * A helper class which listens for {@link ListSelectionEvent}s
- * from the {@link JList}'s {@link ListSelectionModel}.
- */
- public class ListSelectionHandler implements ListSelectionListener
- {
- /**
- * Called when the list selection changes.
- *
- * @param e The event representing the change
- */
- public void valueChanged(ListSelectionEvent e)
- {
- }
- }
-
- /**
- * A helper class which listens for {@link MouseEvent}s
- * from the {@link JList}.
- */
- public class MouseInputHandler implements MouseInputListener
- {
- /**
- * Called when a mouse button press/release cycle completes
- * on the {@link JList}
- *
- * @param event The event representing the mouse click
- */
- public void mouseClicked(MouseEvent event)
- {
- }
-
- /**
- * Called when a mouse button is pressed down on the
- * {@link JList}.
- *
- * @param event The event representing the mouse press
- */
- public void mousePressed(MouseEvent event)
- {
- Point click = event.getPoint();
- int index = BasicListUI.this.locationToIndex(list, click);
- if (index == -1)
- return;
-
- BasicListUI.this.list.setSelectedIndex(index);
- }
-
- /**
- * Called when a mouse button is released on
- * the {@link JList}
- *
- * @param event The event representing the mouse press
- */
- public void mouseReleased(MouseEvent event)
- {
- }
-
- /**
- * Called when the mouse pointer enters the area bounded
- * by the {@link JList}
- *
- * @param event The event representing the mouse entry
- */
- public void mouseEntered(MouseEvent event)
- {
- }
-
- /**
- * Called when the mouse pointer leaves the area bounded
- * by the {@link JList}
- *
- * @param event The event representing the mouse exit
- */
- public void mouseExited(MouseEvent event)
- {
- }
-
- /**
- * Called when the mouse pointer moves over the area bounded
- * by the {@link JList} while a button is held down.
- *
- * @param event The event representing the mouse drag
- */
- public void mouseDragged(MouseEvent event)
- {
- }
-
- /**
- * Called when the mouse pointer moves over the area bounded
- * by the {@link JList}.
- *
- * @param event The event representing the mouse move
- */
- public void mouseMoved(MouseEvent event)
- {
- }
- }
-
- /**
- * Helper class which listens to {@link PropertyChangeEvent}s
- * from the {@link JList}.
- */
- public class PropertyChangeHandler implements PropertyChangeListener
- {
- /**
- * Called when the {@link JList} changes one of its bound properties.
- *
- * @param e The event representing the property change
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getSource() == BasicListUI.this.list)
- {
- if (e.getOldValue() != null && e.getOldValue() instanceof ListModel)
- ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener);
-
- if (e.getNewValue() != null && e.getNewValue() instanceof ListModel)
- ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener);
- }
- BasicListUI.this.damageLayout();
- }
- }
-
- /**
- * Creates a new BasicListUI for the component.
- *
- * @param c The component to create a UI for
- *
- * @return A new UI
- */
- public static ComponentUI createUI(final JComponent c)
- {
- return new BasicListUI();
- }
-
- /** The current focus listener. */
- protected FocusHandler focusListener;
-
- /** The data listener listening to the model. */
- protected ListDataHandler listDataListener;
-
- /** The selection listener listening to the selection model. */
- protected ListSelectionHandler listSelectionListener;
-
- /** The mouse listener listening to the list. */
- protected MouseInputHandler mouseInputListener;
-
- /** The property change listener listening to the list. */
- protected PropertyChangeHandler propertyChangeListener;
-
- /** The component listener that receives notification for resizing the
- * JList component.*/
- private ComponentListener componentListener;
-
- /** Saved reference to the list this UI was created for. */
- protected JList list;
-
- /** The height of a single cell in the list. */
- protected int cellHeight;
-
- /** The width of a single cell in the list. */
- protected int cellWidth;
-
- /**
- * An array of varying heights of cells in the list, in cases where each
- * cell might have a different height.
- */
- protected int[] cellHeights;
-
- /**
- * A simple counter. When nonzero, indicates that the UI class is out of
- * date with respect to the underlying list, and must recalculate the
- * list layout before painting or performing size calculations.
- */
- protected int updateLayoutStateNeeded;
-
- /**
- * The {@link CellRendererPane} that is used for painting.
- */
- protected CellRendererPane rendererPane;
-
- /**
- * Calculate the height of a particular row. If there is a fixed {@link
- * #cellHeight}, return it; otherwise return the specific row height
- * requested from the {@link #cellHeights} array. If the requested row
- * is invalid, return <code>-1</code>.
- *
- * @param row The row to get the height of
- *
- * @return The height, in pixels, of the specified row
- */
- protected int getRowHeight(int row)
- {
- if (row < 0 || row >= cellHeights.length)
- return -1;
- else if (cellHeight != -1)
- return cellHeight;
- else
- return cellHeights[row];
- }
-
- /**
- * Calculate the bounds of a particular cell, considering the upper left
- * corner of the list as the origin position <code>(0,0)</code>.
- *
- * @param l Ignored; calculates over <code>this.list</code>
- * @param index1 The first row to include in the bounds
- * @param index2 The last row to incude in the bounds
- *
- * @return A rectangle encompassing the range of rows between
- * <code>index1</code> and <code>index2</code> inclusive
- */
- public Rectangle getCellBounds(JList l, int index1, int index2)
- {
- maybeUpdateLayoutState();
-
- if (l != list || cellWidth == -1)
- return null;
-
- int minIndex = Math.min(index1, index2);
- int maxIndex = Math.max(index1, index2);
- Point loc = indexToLocation(list, minIndex);
- Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth,
- getRowHeight(minIndex));
-
- for (int i = minIndex + 1; i <= maxIndex; i++)
- {
- Point hiLoc = indexToLocation(list, i);
- Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth,
- getRowHeight(i));
- bounds = bounds.union(hibounds);
- }
-
- return bounds;
- }
-
- /**
- * Calculate the Y coordinate of the upper edge of a particular row,
- * considering the Y coordinate <code>0</code> to occur at the top of the
- * list.
- *
- * @param row The row to calculate the Y coordinate of
- *
- * @return The Y coordinate of the specified row, or <code>-1</code> if
- * the specified row number is invalid
- */
- protected int convertRowToY(int row)
- {
- int y = 0;
- for (int i = 0; i < row; ++i)
- {
- int h = getRowHeight(i);
- if (h == -1)
- return -1;
- y += h;
- }
- return y;
- }
-
- /**
- * Calculate the row number containing a particular Y coordinate,
- * considering the Y coodrinate <code>0</code> to occur at the top of the
- * list.
- *
- * @param y0 The Y coordinate to calculate the row number for
- *
- * @return The row number containing the specified Y value, or <code>-1</code>
- * if the specified Y coordinate is invalid
- */
- protected int convertYToRow(int y0)
- {
- for (int row = 0; row < cellHeights.length; ++row)
- {
- int h = getRowHeight(row);
-
- if (y0 < h)
- return row;
- y0 -= h;
- }
- return -1;
- }
-
- /**
- * Recomputes the {@link #cellHeights}, {@link #cellHeight}, and {@link
- * #cellWidth} properties by examining the variouis properties of the
- * {@link JList}.
- */
- protected void updateLayoutState()
- {
- int nrows = list.getModel().getSize();
- cellHeight = -1;
- cellWidth = -1;
- if (cellHeights == null || cellHeights.length != nrows)
- cellHeights = new int[nrows];
- if (list.getFixedCellHeight() == -1 || list.getFixedCellWidth() == -1)
- {
- ListCellRenderer rend = list.getCellRenderer();
- for (int i = 0; i < nrows; ++i)
- {
- Component flyweight = rend.getListCellRendererComponent(list,
- list.getModel()
- .getElementAt(i),
- 0, false,
- false);
- Dimension dim = flyweight.getPreferredSize();
- cellHeights[i] = dim.height;
- // compute average cell height (little hack here)
- cellHeight = (cellHeight * i + cellHeights[i]) / (i + 1);
- cellWidth = Math.max(cellWidth, dim.width);
- if (list.getLayoutOrientation() == JList.VERTICAL)
- cellWidth = Math.max(cellWidth, list.getSize().width);
- }
- }
- else
- {
- cellHeight = list.getFixedCellHeight();
- cellWidth = list.getFixedCellWidth();
- }
- }
-
- /**
- * Marks the current layout as damaged and requests revalidation from the
- * JList.
- * This is package-private to avoid an accessor method.
- *
- * @see #updateLayoutStateNeeded
- */
- void damageLayout()
- {
- updateLayoutStateNeeded = 1;
- list.revalidate();
- }
-
- /**
- * Calls {@link #updateLayoutState} if {@link #updateLayoutStateNeeded}
- * is nonzero, then resets {@link #updateLayoutStateNeeded} to zero.
- */
- protected void maybeUpdateLayoutState()
- {
- if (updateLayoutStateNeeded != 0)
- {
- updateLayoutState();
- updateLayoutStateNeeded = 0;
- }
- }
-
- /**
- * Creates a new BasicListUI object.
- */
- public BasicListUI()
- {
- focusListener = new FocusHandler();
- listDataListener = new ListDataHandler();
- listSelectionListener = new ListSelectionHandler();
- mouseInputListener = new MouseInputHandler();
- propertyChangeListener = new PropertyChangeHandler();
- componentListener = new ComponentHandler();
- updateLayoutStateNeeded = 1;
- rendererPane = new CellRendererPane();
- }
-
- /**
- * Installs various default settings (mostly colors) from the {@link
- * UIDefaults} into the {@link JList}
- *
- * @see #uninstallDefaults
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- list.setForeground(defaults.getColor("List.foreground"));
- list.setBackground(defaults.getColor("List.background"));
- list.setSelectionForeground(defaults.getColor("List.selectionForeground"));
- list.setSelectionBackground(defaults.getColor("List.selectionBackground"));
- list.setOpaque(true);
- }
-
- /**
- * Resets to <code>null</code> those defaults which were installed in
- * {@link #installDefaults}
- */
- protected void uninstallDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- list.setForeground(null);
- list.setBackground(null);
- list.setSelectionForeground(null);
- list.setSelectionBackground(null);
- }
-
- /**
- * Attaches all the listeners we have in the UI class to the {@link
- * JList}, its model and its selection model.
- *
- * @see #uninstallListeners
- */
- protected void installListeners()
- {
- list.addFocusListener(focusListener);
- list.getModel().addListDataListener(listDataListener);
- list.addListSelectionListener(listSelectionListener);
- list.addMouseListener(mouseInputListener);
- list.addMouseMotionListener(mouseInputListener);
- list.addPropertyChangeListener(propertyChangeListener);
- list.addComponentListener(componentListener);
- }
-
- /**
- * Detaches all the listeners we attached in {@link #installListeners}.
- */
- protected void uninstallListeners()
- {
- list.removeFocusListener(focusListener);
- list.getModel().removeListDataListener(listDataListener);
- list.removeListSelectionListener(listSelectionListener);
- list.removeMouseListener(mouseInputListener);
- list.removeMouseMotionListener(mouseInputListener);
- list.removePropertyChangeListener(propertyChangeListener);
- }
-
- /**
- * Installs keyboard actions for this UI in the {@link JList}.
- */
- protected void installKeyboardActions()
- {
- }
-
- /**
- * Uninstalls keyboard actions for this UI in the {@link JList}.
- */
- protected void uninstallKeyboardActions()
- {
- }
-
- /**
- * Installs the various aspects of the UI in the {@link JList}. In
- * particular, calls {@link #installDefaults}, {@link #installListeners}
- * and {@link #installKeyboardActions}. Also saves a reference to the
- * provided component, cast to a {@link JList}.
- *
- * @param c The {@link JList} to install the UI into
- */
- public void installUI(final JComponent c)
- {
- super.installUI(c);
- list = (JList) c;
- installDefaults();
- installListeners();
- installKeyboardActions();
- maybeUpdateLayoutState();
- }
-
- /**
- * Uninstalls all the aspects of the UI which were installed in {@link
- * #installUI}. When finished uninstalling, drops the saved reference to
- * the {@link JList}.
- *
- * @param c Ignored; the UI is uninstalled from the {@link JList}
- * reference saved during the call to {@link #installUI}
- */
- public void uninstallUI(final JComponent c)
- {
- uninstallKeyboardActions();
- uninstallListeners();
- uninstallDefaults();
- list = null;
- }
-
- /**
- * Gets the size this list would prefer to assume. This is calculated by
- * calling {@link #getCellBounds} over the entire list.
- *
- * @param c Ignored; uses the saved {@link JList} reference
- *
- * @return DOCUMENT ME!
- */
- public Dimension getPreferredSize(JComponent c)
- {
- int size = list.getModel().getSize();
- if (size == 0)
- return new Dimension(0, 0);
- int visibleRows = list.getVisibleRowCount();
- int layoutOrientation = list.getLayoutOrientation();
- Rectangle bounds = getCellBounds(list, 0, list.getModel().getSize() - 1);
- Dimension retVal = bounds.getSize();
- Component parent = list.getParent();
- if ((visibleRows == -1) && (parent instanceof JViewport))
- {
- JViewport viewport = (JViewport) parent;
-
- if (layoutOrientation == JList.HORIZONTAL_WRAP)
- {
- int h = viewport.getSize().height;
- int cellsPerCol = h / cellHeight;
- int w = size / cellsPerCol * cellWidth;
- retVal = new Dimension(w, h);
- }
- else if (layoutOrientation == JList.VERTICAL_WRAP)
- {
- int w = viewport.getSize().width;
- int cellsPerRow = Math.max(w / cellWidth, 1);
- int h = size / cellsPerRow * cellHeight;
- retVal = new Dimension(w, h);
- }
- }
- return retVal;
- }
-
- /**
- * Paints the packground of the list using the background color
- * of the specified component.
- *
- * @param g The graphics context to paint in
- * @param c The component to paint the background of
- */
- private void paintBackground(Graphics g, JComponent c)
- {
- Dimension size = getPreferredSize(c);
- Color save = g.getColor();
- g.setColor(c.getBackground());
- g.fillRect(0, 0, size.width, size.height);
- g.setColor(save);
- }
-
- /**
- * Paints a single cell in the list.
- *
- * @param g The graphics context to paint in
- * @param row The row number to paint
- * @param bounds The bounds of the cell to paint, assuming a coordinate
- * system beginning at <code>(0,0)</code> in the upper left corner of the
- * list
- * @param rend A cell renderer to paint with
- * @param data The data to provide to the cell renderer
- * @param sel A selection model to provide to the cell renderer
- * @param lead The lead selection index of the list
- */
- protected void paintCell(Graphics g, int row, Rectangle bounds,
- ListCellRenderer rend, ListModel data,
- ListSelectionModel sel, int lead)
- {
- boolean is_sel = list.isSelectedIndex(row);
- boolean has_focus = false;
- Component comp = rend.getListCellRendererComponent(list,
- data.getElementAt(row),
- 0, is_sel, has_focus);
- //comp.setBounds(new Rectangle(0, 0, bounds.width, bounds.height));
- //comp.paint(g);
- rendererPane.paintComponent(g, comp, list, bounds);
- }
-
- /**
- * Paints the list by calling {@link #paintBackground} and then repeatedly
- * calling {@link #paintCell} for each visible cell in the list.
- *
- * @param g The graphics context to paint with
- * @param c Ignored; uses the saved {@link JList} reference
- */
- public void paint(Graphics g, JComponent c)
- {
- int nrows = list.getModel().getSize();
- if (nrows == 0)
- return;
-
- maybeUpdateLayoutState();
- ListCellRenderer render = list.getCellRenderer();
- ListModel model = list.getModel();
- ListSelectionModel sel = list.getSelectionModel();
- int lead = sel.getLeadSelectionIndex();
- Rectangle clip = g.getClipBounds();
- paintBackground(g, list);
-
- for (int row = 0; row < nrows; ++row)
- {
- Rectangle bounds = getCellBounds(list, row, row);
- if (bounds.intersects(clip))
- paintCell(g, row, bounds, render, model, sel, lead);
- }
- }
-
- /**
- * Computes the index of a list cell given a point within the list.
- *
- * @param list the list which on which the computation is based on
- * @param location the coordinates
- *
- * @return the index of the list item that is located at the given
- * coordinates or <code>null</code> if the location is invalid
- */
- public int locationToIndex(JList list, Point location)
- {
- int layoutOrientation = list.getLayoutOrientation();
- int index = -1;
- switch (layoutOrientation)
- {
- case JList.VERTICAL:
- index = convertYToRow(location.y);
- break;
- case JList.HORIZONTAL_WRAP:
- // determine visible rows and cells per row
- int visibleRows = list.getVisibleRowCount();
- int cellsPerRow = -1;
- int numberOfItems = list.getModel().getSize();
- Dimension listDim = list.getSize();
- if (visibleRows <= 0)
- {
- try
- {
- cellsPerRow = listDim.width / cellWidth;
- }
- catch (ArithmeticException ex)
- {
- cellsPerRow = 1;
- }
- }
- else
- {
- cellsPerRow = numberOfItems / visibleRows + 1;
- }
-
- // determine index for the given location
- int cellsPerColumn = numberOfItems / cellsPerRow + 1;
- int gridX = Math.min(location.x / cellWidth, cellsPerRow - 1);
- int gridY = Math.min(location.y / cellHeight, cellsPerColumn);
- index = gridX + gridY * cellsPerRow;
- break;
- case JList.VERTICAL_WRAP:
- // determine visible rows and cells per column
- int visibleRows2 = list.getVisibleRowCount();
- if (visibleRows2 <= 0)
- {
- Dimension listDim2 = list.getSize();
- visibleRows2 = listDim2.height / cellHeight;
- }
- int numberOfItems2 = list.getModel().getSize();
- int cellsPerRow2 = numberOfItems2 / visibleRows2 + 1;
-
- Dimension listDim2 = list.getSize();
- int gridX2 = Math.min(location.x / cellWidth, cellsPerRow2 - 1);
- int gridY2 = Math.min(location.y / cellHeight, visibleRows2);
- index = gridY2 + gridX2 * visibleRows2;
- break;
- }
- return index;
- }
-
- public Point indexToLocation(JList list, int index)
- {
- int layoutOrientation = list.getLayoutOrientation();
- Point loc = null;
- switch (layoutOrientation)
- {
- case JList.VERTICAL:
- loc = new Point(0, convertRowToY(index));
- break;
- case JList.HORIZONTAL_WRAP:
- // determine visible rows and cells per row
- int visibleRows = list.getVisibleRowCount();
- int numberOfCellsPerRow = -1;
- if (visibleRows <= 0)
- {
- Dimension listDim = list.getSize();
- numberOfCellsPerRow = Math.max(listDim.width / cellWidth, 1);
- }
- else
- {
- int numberOfItems = list.getModel().getSize();
- numberOfCellsPerRow = numberOfItems / visibleRows + 1;
- }
- // compute coordinates inside the grid
- int gridX = index % numberOfCellsPerRow;
- int gridY = index / numberOfCellsPerRow;
- int locX = gridX * cellWidth;
- int locY = gridY * cellHeight;
- loc = new Point(locX, locY);
- break;
- case JList.VERTICAL_WRAP:
- // determine visible rows and cells per column
- int visibleRows2 = list.getVisibleRowCount();
- if (visibleRows2 <= 0)
- {
- Dimension listDim2 = list.getSize();
- visibleRows2 = listDim2.height / cellHeight;
- }
- // compute coordinates inside the grid
- if (visibleRows2 > 0)
- {
- int gridY2 = index % visibleRows2;
- int gridX2 = index / visibleRows2;
- int locX2 = gridX2 * cellWidth;
- int locY2 = gridY2 * cellHeight;
- loc = new Point(locX2, locY2);
- }
- else
- loc = new Point(0, convertRowToY(index));
- break;
- }
- return loc;
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java b/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
deleted file mode 100644
index 90f270dc112..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
+++ /dev/null
@@ -1,1033 +0,0 @@
-/* BasicLookAndFeel.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.ResourceBundle;
-
-import javax.swing.ImageIcon;
-import javax.swing.KeyStroke;
-import javax.swing.LookAndFeel;
-import javax.swing.UIDefaults;
-import javax.swing.plaf.BorderUIResource;
-import javax.swing.plaf.ColorUIResource;
-import javax.swing.plaf.DimensionUIResource;
-import javax.swing.plaf.FontUIResource;
-import javax.swing.plaf.IconUIResource;
-import javax.swing.plaf.InsetsUIResource;
-import javax.swing.text.JTextComponent;
-
-/**
- * BasicLookAndFeel
- * @author Andrew Selkirk
- */
-public abstract class BasicLookAndFeel extends LookAndFeel
- implements Serializable
-{
- static final long serialVersionUID = -6096995660290287879L;
-
- /**
- * Constructor BasicLookAndFeel
- */
- public BasicLookAndFeel()
- {
- // TODO
- }
-
- /**
- * getDefaults
- * @return UIDefaults
- */
- public UIDefaults getDefaults()
- {
- // Variables
- UIDefaults def = new UIDefaults();
- // Initialize Class Defaults
- initClassDefaults(def);
- // Initialize System Colour Defaults
- initSystemColorDefaults(def);
- // Initialize Component Defaults
- initComponentDefaults(def);
- // Return UI Defaults
- return def;
- }
-
- /**
- * initClassDefaults
- * @param value0 TODO
- */
- protected void initClassDefaults(UIDefaults defaults)
- {
- // Variables
- Object[] uiDefaults;
- // Initialize Class Defaults
- uiDefaults = new Object[] {
- "ButtonUI", "javax.swing.plaf.basic.BasicButtonUI",
- "CheckBoxMenuItemUI", "javax.swing.plaf.basic.BasicCheckBoxMenuItemUI",
- "CheckBoxUI", "javax.swing.plaf.basic.BasicCheckBoxUI",
- "ColorChooserUI", "javax.swing.plaf.basic.BasicColorChooserUI",
- "ComboBoxUI", "javax.swing.plaf.basic.BasicComboBoxUI",
- "DesktopIconUI", "javax.swing.plaf.basic.BasicDesktopIconUI",
- "DesktopPaneUI", "javax.swing.plaf.basic.BasicDesktopPaneUI",
- "EditorPaneUI", "javax.swing.plaf.basic.BasicEditorPaneUI",
- "FormattedTextFieldUI", "javax.swing.plaf.basic.BasicFormattedTextFieldUI",
- "InternalFrameUI", "javax.swing.plaf.basic.BasicInternalFrameUI",
- "LabelUI", "javax.swing.plaf.basic.BasicLabelUI",
- "ListUI", "javax.swing.plaf.basic.BasicListUI",
- "MenuBarUI", "javax.swing.plaf.basic.BasicMenuBarUI",
- "MenuItemUI", "javax.swing.plaf.basic.BasicMenuItemUI",
- "MenuUI", "javax.swing.plaf.basic.BasicMenuUI",
- "OptionPaneUI", "javax.swing.plaf.basic.BasicOptionPaneUI",
- "PanelUI", "javax.swing.plaf.basic.BasicPanelUI",
- "PasswordFieldUI", "javax.swing.plaf.basic.BasicPasswordFieldUI",
- "PopupMenuSeparatorUI", "javax.swing.plaf.basic.BasicPopupMenuSeparatorUI",
- "PopupMenuUI", "javax.swing.plaf.basic.BasicPopupMenuUI",
- "ProgressBarUI", "javax.swing.plaf.basic.BasicProgressBarUI",
- "RadioButtonMenuItemUI", "javax.swing.plaf.basic.BasicRadioButtonMenuItemUI",
- "RadioButtonUI", "javax.swing.plaf.basic.BasicRadioButtonUI",
- "RootPaneUI", "javax.swing.plaf.basic.BasicRootPaneUI",
- "ScrollBarUI", "javax.swing.plaf.basic.BasicScrollBarUI",
- "ScrollPaneUI", "javax.swing.plaf.basic.BasicScrollPaneUI",
- "SeparatorUI", "javax.swing.plaf.basic.BasicSeparatorUI",
- "SliderUI", "javax.swing.plaf.basic.BasicSliderUI",
- "SplitPaneUI", "javax.swing.plaf.basic.BasicSplitPaneUI",
- "SpinnerUI", "javax.swing.plaf.basic.BasicSpinnerUI",
- "StandardDialogUI", "javax.swing.plaf.basic.BasicStandardDialogUI",
- "TabbedPaneUI", "javax.swing.plaf.basic.BasicTabbedPaneUI",
- "TableHeaderUI", "javax.swing.plaf.basic.BasicTableHeaderUI",
- "TableUI", "javax.swing.plaf.basic.BasicTableUI",
- "TextPaneUI", "javax.swing.plaf.basic.BasicTextPaneUI",
- "TextAreaUI", "javax.swing.plaf.basic.BasicTextAreaUI",
- "TextFieldUI", "javax.swing.plaf.basic.BasicTextFieldUI",
- "TextPaneUI", "javax.swing.plaf.basic.BasicTextPaneUI",
- "ToggleButtonUI", "javax.swing.plaf.basic.BasicToggleButtonUI",
- "ToolBarSeparatorUI", "javax.swing.plaf.basic.BasicToolBarSeparatorUI",
- "ToolBarUI", "javax.swing.plaf.basic.BasicToolBarUI",
- "ToolTipUI", "javax.swing.plaf.basic.BasicToolTipUI",
- "TreeUI", "javax.swing.plaf.basic.BasicTreeUI",
- "ViewportUI", "javax.swing.plaf.basic.BasicViewportUI"
- };
- // Add Class Defaults to UI Defaults table
- defaults.putDefaults(uiDefaults);
- }
-
- /**
- * initSystemColorDefaults
- * @param defaults TODO
- */
- protected void initSystemColorDefaults(UIDefaults defaults)
- {
- Color highLight = new Color(249, 247, 246);
- Color light = new Color(239, 235, 231);
- Color shadow = new Color(139, 136, 134);
- Color darkShadow = new Color(16, 16, 16);
-
- Object[] uiDefaults;
- uiDefaults = new Object[] {
- "activeCaption", new ColorUIResource(0, 0, 128),
- "activeCaptionBorder", new ColorUIResource(Color.lightGray),
- "activeCaptionText", new ColorUIResource(Color.white),
- "control", new ColorUIResource(light),
- "controlDkShadow", new ColorUIResource(shadow),
- "controlHighlight", new ColorUIResource(highLight),
- "controlLtHighlight", new ColorUIResource(highLight),
- "controlShadow", new ColorUIResource(shadow),
- "controlText", new ColorUIResource(darkShadow),
- "desktop", new ColorUIResource(0, 92, 92),
- "inactiveCaption", new ColorUIResource(Color.gray),
- "inactiveCaptionBorder", new ColorUIResource(Color.lightGray),
- "inactiveCaptionText", new ColorUIResource(Color.lightGray),
- "info", new ColorUIResource(light),
- "infoText", new ColorUIResource(darkShadow),
- "menu", new ColorUIResource(light),
- "menuText", new ColorUIResource(darkShadow),
- "scrollbar", new ColorUIResource(light),
- "text", new ColorUIResource(Color.white),
- "textHighlight", new ColorUIResource(Color.black),
- "textHighlightText", new ColorUIResource(Color.white),
- "textInactiveText", new ColorUIResource(Color.gray),
- "textText", new ColorUIResource(Color.black),
- "window", new ColorUIResource(light),
- "windowBorder", new ColorUIResource(Color.black),
- "windowText", new ColorUIResource(darkShadow)
- };
- defaults.putDefaults(uiDefaults);
- }
-
- /**
- * loadSystemColors
- * @param defaults TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- protected void loadSystemColors(UIDefaults defaults, String[] value1,
- boolean value2)
- {
- // TODO
- }
-
- /**
- * loadResourceBundle
- * @param defaults TODO
- */
- private void loadResourceBundle(UIDefaults defaults)
- {
- ResourceBundle bundle;
- Enumeration e;
- String key;
- String value;
- bundle = ResourceBundle.getBundle("resources/basic");
- // Process Resources
- e = bundle.getKeys();
- while (e.hasMoreElements())
- {
- key = (String) e.nextElement();
- value = bundle.getString(key);
- defaults.put(key, value);
- }
- }
-
- /**
- * initComponentDefaults
- * @param defaults TODO
- */
- protected void initComponentDefaults(UIDefaults defaults)
- {
- Object[] uiDefaults;
-
- Color highLight = new Color(249, 247, 246);
- Color light = new Color(239, 235, 231);
- Color shadow = new Color(139, 136, 134);
- Color darkShadow = new Color(16, 16, 16);
-
- uiDefaults = new Object[] {
-
- "AbstractUndoableEdit.undoText", "Undo",
- "AbstractUndoableEdit.redoText", "Redo",
- "Button.background", new ColorUIResource(light),
- "Button.border",
- new UIDefaults.LazyValue()
- {
- public Object createValue(UIDefaults table)
- {
- return BasicBorders.getButtonBorder();
- }
- },
- "Button.darkShadow", new ColorUIResource(shadow),
- "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "SPACE", "pressed",
- "released SPACE", "released"
- }),
- "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "Button.foreground", new ColorUIResource(darkShadow),
- "Button.highlight", new ColorUIResource(highLight),
- "Button.light", new ColorUIResource(highLight),
- "Button.margin", new InsetsUIResource(2, 2, 2, 2),
- "Button.shadow", new ColorUIResource(shadow),
- "Button.textIconGap", new Integer(4),
- "Button.textShiftOffset", new Integer(0),
- "CheckBox.background", new ColorUIResource(light),
- "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null,
- null),
- "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "SPACE", "pressed",
- "released SPACE", "released"
- }),
- "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "CheckBox.foreground", new ColorUIResource(darkShadow),
- "CheckBox.icon", BasicIconFactory.getCheckBoxIcon(),
- "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2),
- "CheckBox.textIconGap", new Integer(4),
- "CheckBox.textShiftOffset", new Integer(0),
- "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog",
- Font.PLAIN, 12),
- "CheckBoxMenuItem.acceleratorForeground",
- new ColorUIResource(darkShadow),
- "CheckBoxMenuItem.acceleratorSelectionForeground",
- new ColorUIResource(Color.white),
- "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(),
- "CheckBoxMenuItem.background", new ColorUIResource(light),
- "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(),
- "CheckBoxMenuItem.borderPainted", Boolean.FALSE,
- "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(),
- "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "CheckBoxMenuItem.foreground", new ColorUIResource(darkShadow),
- "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
- "CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black),
- "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white),
- "ColorChooser.background", new ColorUIResource(light),
- "ColorChooser.cancelText", "Cancel",
- "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "ColorChooser.foreground", new ColorUIResource(darkShadow),
- "ColorChooser.hsbBlueText", "B",
- "ColorChooser.hsbBrightnessText", "B",
- "ColorChooser.hsbGreenText", "G",
- "ColorChooser.hsbHueText", "H",
- "ColorChooser.hsbNameText", "HSB",
- "ColorChooser.hsbRedText", "R",
- "ColorChooser.hsbSaturationText", "S",
- "ColorChooser.okText", "OK",
- "ColorChooser.previewText", "Preview",
- "ColorChooser.resetText", "Reset",
- "ColorChooser.rgbBlueMnemonic", new Integer(66),
- "ColorChooser.rgbBlueText", "Blue",
- "ColorChooser.rgbGreenMnemonic", new Integer(71),
- "ColorChooser.rgbGreenText", "Green",
- "ColorChooser.rgbNameText", "RGB",
- "ColorChooser.rgbRedMnemonic", new Integer(82),
- "ColorChooser.rgbRedText", "Red",
- "ColorChooser.sampleText", "Sample Text Sample Text",
- "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light),
- "ColorChooser.swatchesNameText", "Swatches",
- "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10),
- "ColorChooser.swatchesRecentText", "Recent:",
- "ColorChooser.swatchesSwatchSize", new Dimension(10, 10),
- "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "ESCAPE", "hidePopup",
- "PAGE_UP", "pageUpPassThrough",
- "PAGE_DOWN", "pageDownPassThrough",
- "HOME", "homePassThrough",
- "END", "endPassThrough"
- }),
- "ComboBox.background", new ColorUIResource(light),
- "ComboBox.buttonBackground", new ColorUIResource(light),
- "ComboBox.buttonDarkShadow", new ColorUIResource(shadow),
- "ComboBox.buttonHighlight", new ColorUIResource(highLight),
- "ComboBox.buttonShadow", new ColorUIResource(shadow),
- "ComboBox.disabledBackground", new ColorUIResource(light),
- "ComboBox.disabledForeground", new ColorUIResource(Color.gray),
- "ComboBox.font", new FontUIResource("SansSerif", Font.PLAIN, 12),
- "ComboBox.foreground", new ColorUIResource(Color.black),
- "ComboBox.selectionBackground", new ColorUIResource(Color.black),
- "ComboBox.selectionForeground", new ColorUIResource(Color.white),
- "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "KP_LEFT", "left",
- "KP_RIGHT", "right",
- "ctrl F5", "restore",
- "LEFT", "left",
- "ctrl alt F6", "selectNextFrame",
- "UP", "up",
- "ctrl F6", "selectNextFrame",
- "RIGHT", "right",
- "DOWN", "down",
- "ctrl F7", "move",
- "ctrl F8", "resize",
- "ESCAPE", "escape",
- "ctrl TAB", "selectNextFrame",
- "ctrl F9", "minimize",
- "KP_UP", "up",
- "ctrl F4", "close",
- "KP_DOWN", "down",
- "ctrl F10", "maximize",
- "ctrl alt shift F6","selectPreviousFrame"
- }),
- "Desktop.background", new ColorUIResource(0, 92, 92),
- "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null,
- null),
- "EditorPane.background", new ColorUIResource(Color.white),
- "EditorPane.border", new BasicBorders.MarginBorder(),
- "EditorPane.caretBlinkRate", new Integer(500),
- "EditorPane.caretForeground", new ColorUIResource(Color.black),
- "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12),
- "EditorPane.foreground", new ColorUIResource(Color.black),
- "EditorPane.inactiveForeground", new ColorUIResource(Color.gray),
- "EditorPane.keyBindings", new JTextComponent.KeyBinding[] {
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP,
- 0), "caret-up"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN,
- 0), "caret-down"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,
- 0), "page-up"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN,
- 0), "page-down"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
- 0), "insert-break"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,
- 0), "insert-tab")
- },
- "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3),
- "EditorPane.selectionBackground", new ColorUIResource(Color.black),
- "EditorPane.selectionForeground", new ColorUIResource(Color.white),
- "FileChooser.acceptAllFileFilterText", "All Files (*.*)",
- "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "ESCAPE", "cancelSelection"
- }),
- "FileChooser.cancelButtonMnemonic", new Integer(67),
- "FileChooser.cancelButtonText", "Cancel",
- "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog",
- // XXX Don't use gif
- "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")),
- "FileChooser.directoryDescriptionText", "Directory",
- "FileChooser.fileDescriptionText", "Generic File",
- "FileChooser.helpButtonMnemonic", new Integer(72),
- "FileChooser.helpButtonText", "Help",
- "FileChooser.helpButtonToolTipText", "FileChooser help",
- // XXX Don't use gif
- "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")),
- // XXX Don't use gif
- "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")),
- "FileChooser.newFolderErrorSeparator", ":",
- "FileChooser.newFolderErrorText", "Error creating new folder",
- // XXX Don't use gif
- "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")),
- "FileChooser.openButtonMnemonic", new Integer(79),
- "FileChooser.openButtonText", "Open",
- "FileChooser.openButtonToolTipText", "Open selected file",
- "FileChooser.saveButtonMnemonic", new Integer(83),
- "FileChooser.saveButtonText", "Save",
- "FileChooser.saveButtonToolTipText", "Save selected file",
- // XXX Don't use gif
- "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")),
- "FileChooser.updateButtonMnemonic", new Integer(85),
- "FileChooser.updateButtonText", "Update",
- "FileChooser.updateButtonToolTipText", "Update directory listing",
- // XXX Don't use gif
- "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")),
- // XXX Don't use gif
- "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")),
- // XXX Don't use gif
- "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")),
- // XXX Don't use gif
- "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")),
- // XXX Don't use gif
- "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")),
- "FocusManagerClassName", "TODO",
- "FormattedTextField.background", new ColorUIResource(light),
- "FormattedTextField.caretForeground", new ColorUIResource(Color.black),
- "FormattedTextField.foreground", new ColorUIResource(Color.black),
- "FormattedTextField.inactiveBackground", new ColorUIResource(light),
- "FormattedTextField.inactiveForeground", new ColorUIResource(Color.gray),
- "FormattedTextField.selectionBackground",
- new ColorUIResource(Color.black),
- "FormattedTextField.selectionForeground",
- new ColorUIResource(Color.white),
- "FormView.resetButtonText", "Reset",
- "FormView.submitButtonText", "Submit Query",
- "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128),
- "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white),
- "InternalFrame.border",
- new BorderUIResource.CompoundBorderUIResource(null, null),
- "InternalFrame.borderColor", new ColorUIResource(light),
- "InternalFrame.borderDarkShadow", new ColorUIResource(shadow),
- "InternalFrame.borderHighlight", new ColorUIResource(highLight),
- "InternalFrame.borderLight", new ColorUIResource(light),
- "InternalFrame.borderShadow", new ColorUIResource(shadow),
- "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(),
- // XXX Don't use gif
- "InternalFrame.icon", new IconUIResource(new ImageIcon("icons/JavaCup.gif")),
- "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(),
- "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray),
- "InternalFrame.inactiveTitleForeground",
- new ColorUIResource(Color.lightGray),
- "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(),
- "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(),
- "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12),
- "InternalFrame.windowBindings", new Object[] {
- "shift ESCAPE", "showSystemMenu",
- "ctrl SPACE", "showSystemMenu",
- "ESCAPE", "showSystemMenu"
- },
- "Label.background", new ColorUIResource(light),
- "Label.disabledForeground", new ColorUIResource(Color.white),
- "Label.disabledShadow", new ColorUIResource(shadow),
- "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "Label.foreground", new ColorUIResource(darkShadow),
- "List.background", new ColorUIResource(light),
- "List.border", new BasicBorders.MarginBorder(),
- "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "PAGE_UP", "scrollUp",
- "ctrl \\", "clearSelection",
- "PAGE_DOWN", "scrollDown",
- "shift PAGE_DOWN","scrollDownExtendSelection",
- "END", "selectLastRow",
- "HOME", "selectFirstRow",
- "shift END", "selectLastRowExtendSelection",
- "shift HOME", "selectFirstRowExtendSelection",
- "UP", "selectPreviousRow",
- "ctrl /", "selectAll",
- "ctrl A", "selectAll",
- "DOWN", "selectNextRow",
- "shift UP", "selectPreviousRowExtendSelection",
- "ctrl SPACE", "selectNextRowExtendSelection",
- "shift DOWN", "selectNextRowExtendSelection",
- "KP_UP", "selectPreviousRow",
- "shift PAGE_UP","scrollUpExtendSelection",
- "KP_DOWN", "selectNextRow"
- }),
- "List.foreground", new ColorUIResource(darkShadow),
- "List.selectionBackground", new ColorUIResource(Color.black),
- "List.selectionForeground", new ColorUIResource(Color.white),
- "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12),
- "Menu.acceleratorForeground", new ColorUIResource(darkShadow),
- "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white),
- "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(),
- "Menu.background", new ColorUIResource(light),
- "Menu.border", new BasicBorders.MarginBorder(),
- "Menu.borderPainted", Boolean.FALSE,
- "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(),
- "Menu.consumesTabs", Boolean.TRUE,
- "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "Menu.foreground", new ColorUIResource(darkShadow),
- "Menu.margin", new InsetsUIResource(2, 2, 2, 2),
- "Menu.selectedWindowInputMapBindings", new Object[] {
- "ESCAPE", "cancel",
- "DOWN", "selectNext",
- "KP_DOWN", "selectNext",
- "UP", "selectPrevious",
- "KP_UP", "selectPrevious",
- "LEFT", "selectParent",
- "KP_LEFT", "selectParent",
- "RIGHT", "selectChild",
- "KP_RIGHT", "selectChild",
- "ENTER", "return",
- "SPACE", "return"
- },
- "Menu.selectionBackground", new ColorUIResource(Color.black),
- "Menu.selectionForeground", new ColorUIResource(Color.white),
- "MenuBar.background", new ColorUIResource(light),
- "MenuBar.border", new BasicBorders.MenuBarBorder(null, null),
- "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "MenuBar.foreground", new ColorUIResource(darkShadow),
- "MenuBar.highlight", new ColorUIResource(highLight),
- "MenuBar.shadow", new ColorUIResource(shadow),
- "MenuBar.windowBindings", new Object[] {
- "F10", "takeFocus"
- },
- "MenuItem.acceleratorDelimiter", "-",
- "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12),
- "MenuItem.acceleratorForeground", new ColorUIResource(darkShadow),
- "MenuItem.acceleratorSelectionForeground",
- new ColorUIResource(Color.white),
- "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(),
- "MenuItem.background", new ColorUIResource(light),
- "MenuItem.border", new BasicBorders.MarginBorder(),
- "MenuItem.borderPainted", Boolean.FALSE,
- "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(),
- "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "MenuItem.foreground", new ColorUIResource(darkShadow),
- "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
- "MenuItem.selectionBackground", new ColorUIResource(Color.black),
- "MenuItem.selectionForeground", new ColorUIResource(Color.white),
- "OptionPane.background", new ColorUIResource(light),
- "OptionPane.border",
- new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0),
- "OptionPane.buttonAreaBorder",
- new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0),
- "OptionPane.cancelButtonText", "Cancel",
- // XXX Don't use gif
- "OptionPane.errorIcon",
- new IconUIResource(new ImageIcon("icons/Error.gif")),
- "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "OptionPane.foreground", new ColorUIResource(darkShadow),
- // XXX Don't use gif
- "OptionPane.informationIcon",
- new IconUIResource(new ImageIcon("icons/Inform.gif")),
- "OptionPane.messageAreaBorder",
- new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0),
- "OptionPane.messageForeground", new ColorUIResource(darkShadow),
- "OptionPane.minimumSize", new DimensionUIResource(262, 90),
- "OptionPane.noButtonText", "No",
- "OptionPane.okButtonText", "OK",
- // XXX Don't use gif
- "OptionPane.questionIcon",
- new IconUIResource(new ImageIcon("icons/Question.gif")),
- // XXX Don't use gif
- "OptionPane.warningIcon",
- new IconUIResource(new ImageIcon("icons/Warn.gif")),
- "OptionPane.windowBindings", new Object[] {
- "ESCAPE", "close"
- },
- "OptionPane.yesButtonText", "Yes",
- "Panel.background", new ColorUIResource(light),
- "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "Panel.foreground", new ColorUIResource(Color.black),
- "PasswordField.background", new ColorUIResource(light),
- "PasswordField.border", new BasicBorders.FieldBorder(null, null,
- null, null),
- "PasswordField.caretBlinkRate", new Integer(500),
- "PasswordField.caretForeground", new ColorUIResource(Color.black),
- "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12),
- "PasswordField.foreground", new ColorUIResource(Color.black),
- "PasswordField.inactiveBackground", new ColorUIResource(light),
- "PasswordField.inactiveForeground", new ColorUIResource(Color.gray),
- "PasswordField.keyBindings", new JTextComponent.KeyBinding[] {
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
- 0),
- "notify-field-accept")},
- "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0),
- "PasswordField.selectionBackground", new ColorUIResource(Color.black),
- "PasswordField.selectionForeground", new ColorUIResource(Color.white),
- "PopupMenu.background", new ColorUIResource(light),
- "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0),
- "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "PopupMenu.foreground", new ColorUIResource(darkShadow),
- "ProgressBar.background", new ColorUIResource(light),
- "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray),
- "ProgressBar.cellLength", new Integer(1),
- "ProgressBar.cellSpacing", new Integer(0),
- "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "ProgressBar.foreground", new ColorUIResource(Color.black),
- "ProgressBar.selectionBackground", new ColorUIResource(Color.black),
- "ProgressBar.selectionForeground", new ColorUIResource(light),
- "ProgressBar.repaintInterval", new Integer(250),
- "ProgressBar.cycleTime", new Integer(6000),
- "RadioButton.background", new ColorUIResource(light),
- "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null,
- null),
- "RadioButton.darkShadow", new ColorUIResource(shadow),
- "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "SPACE", "pressed",
- "released SPACE", "released"
- }),
- "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "RadioButton.foreground", new ColorUIResource(darkShadow),
- "RadioButton.highlight", new ColorUIResource(highLight),
- "RadioButton.icon", BasicIconFactory.getRadioButtonIcon(),
- "RadioButton.light", new ColorUIResource(highLight),
- "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2),
- "RadioButton.shadow", new ColorUIResource(shadow),
- "RadioButton.textIconGap", new Integer(4),
- "RadioButton.textShiftOffset", new Integer(0),
- "RadioButtonMenuItem.acceleratorFont",
- new FontUIResource("Dialog", Font.PLAIN, 12),
- "RadioButtonMenuItem.acceleratorForeground",
- new ColorUIResource(darkShadow),
- "RadioButtonMenuItem.acceleratorSelectionForeground",
- new ColorUIResource(Color.white),
- "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(),
- "RadioButtonMenuItem.background", new ColorUIResource(light),
- "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(),
- "RadioButtonMenuItem.borderPainted", Boolean.FALSE,
- "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(),
- "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "RadioButtonMenuItem.foreground", new ColorUIResource(darkShadow),
- "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
- "RadioButtonMenuItem.selectionBackground",
- new ColorUIResource(Color.black),
- "RadioButtonMenuItem.selectionForeground",
- new ColorUIResource(Color.white),
- "RootPane.defaultButtonWindowKeyBindings", new Object[] {
- "ENTER", "press",
- "released ENTER", "release",
- "ctrl ENTER", "press",
- "ctrl released ENTER", "release"
- },
- "ScrollBar.background", new ColorUIResource(224, 224, 224),
- "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "PAGE_UP", "negativeBlockIncrement",
- "PAGE_DOWN", "positiveBlockIncrement",
- "END", "maxScroll",
- "HOME", "minScroll",
- "LEFT", "positiveUnitIncrement",
- "KP_UP", "negativeUnitIncrement",
- "KP_DOWN", "positiveUnitIncrement",
- "UP", "negativeUnitIncrement",
- "RIGHT", "negativeUnitIncrement",
- "KP_LEFT", "positiveUnitIncrement",
- "DOWN", "positiveUnitIncrement",
- "KP_RIGHT", "negativeUnitIncrement"
- }),
- "ScrollBar.foreground", new ColorUIResource(light),
- "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096),
- "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8),
- "ScrollBar.thumb", new ColorUIResource(light),
- "ScrollBar.thumbDarkShadow", new ColorUIResource(shadow),
- "ScrollBar.thumbHighlight", new ColorUIResource(highLight),
- "ScrollBar.thumbShadow", new ColorUIResource(shadow),
- "ScrollBar.track", new ColorUIResource(light),
- "ScrollBar.trackHighlight", new ColorUIResource(shadow),
- "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "PAGE_UP", "scrollUp",
- "KP_LEFT", "unitScrollLeft",
- "ctrl PAGE_DOWN","scrollRight",
- "PAGE_DOWN", "scrollDown",
- "KP_RIGHT", "unitScrollRight",
- "LEFT", "unitScrollLeft",
- "ctrl END", "scrollEnd",
- "UP", "unitScrollUp",
- "RIGHT", "unitScrollRight",
- "DOWN", "unitScrollDown",
- "ctrl HOME", "scrollHome",
- "ctrl PAGE_UP", "scrollLeft",
- "KP_UP", "unitScrollUp",
- "KP_DOWN", "unitScrollDown"
- }),
- "ScrollPane.background", new ColorUIResource(light),
- "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(),
- "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "ScrollPane.foreground", new ColorUIResource(darkShadow),
- "Separator.background", new ColorUIResource(highLight),
- "Separator.foreground", new ColorUIResource(shadow),
- "Separator.highlight", new ColorUIResource(highLight),
- "Separator.shadow", new ColorUIResource(shadow),
- "Slider.background", new ColorUIResource(light),
- "Slider.focus", new ColorUIResource(shadow),
- "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "PAGE_UP", "positiveBlockIncrement",
- "PAGE_DOWN", "negativeBlockIncrement",
- "END", "maxScroll",
- "HOME", "minScroll",
- "LEFT", "negativeUnitIncrement",
- "KP_UP", "positiveUnitIncrement",
- "KP_DOWN", "negativeUnitIncrement",
- "UP", "positiveUnitIncrement",
- "RIGHT", "positiveUnitIncrement",
- "KP_LEFT", "negativeUnitIncrement",
- "DOWN", "negativeUnitIncrement",
- "KP_RIGHT", "positiveUnitIncrement"
- }),
- "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2),
- "Slider.foreground", new ColorUIResource(light),
- "Slider.highlight", new ColorUIResource(highLight),
- "Slider.shadow", new ColorUIResource(shadow),
- "Slider.thumbHeight", new Integer(20),
- "Slider.thumbWidth", new Integer(10),
- "Slider.tickHeight", new Integer(12),
- "Spinner.background", new ColorUIResource(light),
- "Spinner.foreground", new ColorUIResource(light),
- "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "F6", "toggleFocus",
- "F8", "startResize",
- "END", "selectMax",
- "HOME", "selectMin",
- "LEFT", "negativeIncremnent",
- "KP_UP", "negativeIncrement",
- "KP_DOWN", "positiveIncrement",
- "UP", "negativeIncrement",
- "RIGHT", "positiveIncrement",
- "KP_LEFT", "negativeIncrement",
- "DOWN", "positiveIncrement",
- "KP_RIGHT", "positiveIncrement"
- }),
- "SplitPane.background", new ColorUIResource(light),
- "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null),
- "SplitPane.darkShadow", new ColorUIResource(shadow),
- "SplitPane.dividerSize", new Integer(10),
- "SplitPane.highlight", new ColorUIResource(highLight),
- "SplitPane.shadow", new ColorUIResource(shadow),
- "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "ctrl PAGE_DOWN","navigatePageDown",
- "ctrl PAGE_UP", "navigatePageUp",
- "ctrl UP", "requestFocus",
- "ctrl KP_UP", "requestFocus"
- }),
- "TabbedPane.background", new ColorUIResource(light),
- "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3),
- "TabbedPane.darkShadow", new ColorUIResource(shadow),
- "TabbedPane.focus", new ColorUIResource(darkShadow),
- "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "LEFT", "navigateLeft",
- "KP_UP", "navigateUp",
- "ctrl DOWN", "requestFocusForVisibleComponent",
- "UP", "navigateUp",
- "KP_DOWN", "navigateDown",
- "RIGHT", "navigateRight",
- "KP_LEFT", "navigateLeft",
- "ctrl KP_DOWN", "requestFocusForVisibleComponent",
- "KP_RIGHT", "navigateRight",
- "DOWN", "navigateDown"
- }),
- "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "TabbedPane.foreground", new ColorUIResource(darkShadow),
- "TabbedPane.highlight", new ColorUIResource(highLight),
- "TabbedPane.light", new ColorUIResource(highLight),
- "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1),
- "TabbedPane.shadow", new ColorUIResource(shadow),
- "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2),
- "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4),
- "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2),
- "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1),
- "TabbedPane.tabRunOverlay", new Integer(2),
- "TabbedPane.textIconGap", new Integer(4),
- "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "shift PAGE_DOWN","scrollDownExtendSelection",
- "PAGE_DOWN", "scrollDownChangeSelection",
- "END", "selectLastColumn",
- "shift END", "selectLastColumnExtendSelection",
- "HOME", "selectFirstColumn",
- "ctrl END", "selectLastRow",
- "ctrl shift END","selectLastRowExtendSelection",
- "LEFT", "selectPreviousColumn",
- "shift HOME", "selectFirstColumnExtendSelection",
- "UP", "selectPreviousRow",
- "RIGHT", "selectNextColumn",
- "ctrl HOME", "selectFirstRow",
- "shift LEFT", "selectPreviousColumnExtendSelection",
- "DOWN", "selectNextRow",
- "ctrl shift HOME","selectFirstRowExtendSelection",
- "shift UP", "selectPreviousRowExtendSelection",
- "F2", "startEditing",
- "shift RIGHT", "selectNextColumnExtendSelection",
- "TAB", "selectNextColumnCell",
- "shift DOWN", "selectNextRowExtendSelection",
- "ENTER", "selectNextRowCell",
- "KP_UP", "selectPreviousRow",
- "KP_DOWN", "selectNextRow",
- "KP_LEFT", "selectPreviousColumn",
- "KP_RIGHT", "selectNextColumn",
- "shift TAB", "selectPreviousColumnCell",
- "ctrl A", "selectAll",
- "shift ENTER", "selectPreviousRowCell",
- "shift KP_DOWN", "selectNextRowExtendSelection",
- "shift KP_LEFT", "selectPreviousColumnExtendSelection",
- "ESCAPE", "cancel",
- "ctrl shift PAGE_UP", "scrollRightExtendSelection",
- "shift KP_RIGHT", " selectNextColumnExtendSelection",
- "ctrl PAGE_UP", "scrollLeftChangeSelection",
- "shift PAGE_UP", "scrollUpExtendSelection",
- "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection",
- "ctrl PAGE_DOWN", "scrollRightChangeSelection",
- "PAGE_UP", "scrollUpChangeSelection"
- }),
- "Table.background", new ColorUIResource(light),
- "Table.focusCellBackground", new ColorUIResource(light),
- "Table.focusCellForeground", new ColorUIResource(darkShadow),
- "Table.focusCellHighlightBorder",
- new BorderUIResource.LineBorderUIResource(Color.white),
- "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "Table.foreground", new ColorUIResource(darkShadow),
- "Table.gridColor", new ColorUIResource(Color.gray),
- "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0),
- "Table.selectionBackground", new ColorUIResource(Color.black),
- "Table.selectionForeground", new ColorUIResource(Color.white),
- "TableHeader.background", new ColorUIResource(light),
- "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0),
- "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "TableHeader.foreground", new ColorUIResource(darkShadow),
- "TextArea.background", new ColorUIResource(light),
- "TextArea.border", new BasicBorders.MarginBorder(),
- "TextArea.caretBlinkRate", new Integer(500),
- "TextArea.caretForeground", new ColorUIResource(Color.black),
- "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12),
- "TextArea.foreground", new ColorUIResource(Color.black),
- "TextArea.inactiveForeground", new ColorUIResource(Color.gray),
- "TextArea.keyBindings", new JTextComponent.KeyBinding[] {
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP,
- 0), "caret-up"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN,
- 0), "caret-down"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,
- 0), "page-up"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN,
- 0), "page-down"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
- 0), "insert-break"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,
- 0), "insert-tab")
- },
- "TextArea.margin", new InsetsUIResource(0, 0, 0, 0),
- "TextArea.selectionBackground", new ColorUIResource(Color.black),
- "TextArea.selectionForeground", new ColorUIResource(Color.white),
- "TextField.background", new ColorUIResource(light),
- "TextField.border", new BasicBorders.FieldBorder(null, null, null, null),
- "TextField.caretBlinkRate", new Integer(500),
- "TextField.caretForeground", new ColorUIResource(Color.black),
- "TextField.darkShadow", new ColorUIResource(shadow),
- "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12),
- "TextField.foreground", new ColorUIResource(Color.black),
- "TextField.highlight", new ColorUIResource(highLight),
- "TextField.inactiveBackground", new ColorUIResource(light),
- "TextField.inactiveForeground", new ColorUIResource(Color.gray),
- "TextField.light", new ColorUIResource(highLight),
- "TextField.highlight", new ColorUIResource(light),
- "TextField.keyBindings", new JTextComponent.KeyBinding[] {
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
- 0),
- "notify-field-accept"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
- InputEvent.SHIFT_DOWN_MASK),
- "selection-backward"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
- InputEvent.SHIFT_DOWN_MASK),
- "selection-forward"),
- },
- "TextField.margin", new InsetsUIResource(0, 0, 0, 0),
- "TextField.selectionBackground", new ColorUIResource(Color.black),
- "TextField.selectionForeground", new ColorUIResource(Color.white),
- "TextPane.background", new ColorUIResource(Color.white),
- "TextPane.border", new BasicBorders.MarginBorder(),
- "TextPane.caretBlinkRate", new Integer(500),
- "TextPane.caretForeground", new ColorUIResource(Color.black),
- "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12),
- "TextPane.foreground", new ColorUIResource(Color.black),
- "TextPane.inactiveForeground", new ColorUIResource(Color.gray),
- "TextPane.keyBindings", new JTextComponent.KeyBinding[] {
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP,
- 0), "caret-up"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN,
- 0), "caret-down"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,
- 0), "page-up"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN,
- 0), "page-down"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
- 0), "insert-break"),
- new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,
- 0), "insert-tab")
- },
- "TextPane.margin", new InsetsUIResource(3, 3, 3, 3),
- "TextPane.selectionBackground", new ColorUIResource(Color.black),
- "TextPane.selectionForeground", new ColorUIResource(Color.white),
- "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(),
- "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "TitledBorder.titleColor", new ColorUIResource(darkShadow),
- "ToggleButton.background", new ColorUIResource(light),
- "ToggleButton.border",
- new BorderUIResource.CompoundBorderUIResource(null, null),
- "ToggleButton.darkShadow", new ColorUIResource(shadow),
- "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "SPACE", "pressed",
- "released SPACE", "released"
- }),
- "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "ToggleButton.foreground", new ColorUIResource(darkShadow),
- "ToggleButton.highlight", new ColorUIResource(highLight),
- "ToggleButton.light", new ColorUIResource(light),
- "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
- "ToggleButton.shadow", new ColorUIResource(shadow),
- "ToggleButton.textIconGap", new Integer(4),
- "ToggleButton.textShiftOffset", new Integer(0),
- "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "UP", "navigateUp",
- "KP_UP", "navigateUp",
- "DOWN", "navigateDown",
- "KP_DOWN", "navigateDown",
- "LEFT", "navigateLeft",
- "KP_LEFT", "navigateLeft",
- "RIGHT", "navigateRight",
- "KP_RIGHT", "navigateRight"
- }),
- "ToolBar.background", new ColorUIResource(light),
- "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(),
- "ToolBar.darkShadow", new ColorUIResource(shadow),
- "ToolBar.dockingBackground", new ColorUIResource(light),
- "ToolBar.dockingForeground", new ColorUIResource(Color.red),
- "ToolBar.floatingBackground", new ColorUIResource(light),
- "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray),
- "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "ToolBar.foreground", new ColorUIResource(darkShadow),
- "ToolBar.highlight", new ColorUIResource(highLight),
- "ToolBar.light", new ColorUIResource(highLight),
- "ToolBar.separatorSize", new DimensionUIResource(20, 20),
- "ToolBar.shadow", new ColorUIResource(shadow),
- "ToolTip.background", new ColorUIResource(light),
- "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray),
- "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12),
- "ToolTip.foreground", new ColorUIResource(darkShadow),
- "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "ESCAPE", "cancel"
- }),
- "Tree.background", new ColorUIResource(light),
- "Tree.changeSelectionWithFocus", Boolean.TRUE,
- "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),
- "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")),
- "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE,
- "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray),
- "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
- "shift PAGE_DOWN", "scrollDownExtendSelection",
- "PAGE_DOWN", "scrollDownChangeSelection",
- "END", "selectLast",
- "ctrl KP_UP", "selectPreviousChangeLead",
- "shift END", "selectLastExtendSelection",
- "HOME", "selectFirst",
- "ctrl END", "selectLastChangeLead",
- "ctrl /", "selectAll",
- "LEFT", "selectParent",
- "shift HOME", "selectFirstExtendSelection",
- "UP", "selectPrevious",
- "ctrl KP_DOWN", "selectNextChangeLead",
- "RIGHT", "selectChild",
- "ctrl HOME", "selectFirstChangeLead",
- "DOWN", "selectNext",
- "ctrl KP_LEFT", "scrollLeft",
- "shift UP", "selectPreviousExtendSelection",
- "F2", "startEditing",
- "ctrl LEFT", "scrollLeft",
- "ctrl KP_RIGHT","scrollRight",
- "ctrl UP", "selectPreviousChangeLead",
- "shift DOWN", "selectNextExtendSelection",
- "ENTER", "toggle",
- "KP_UP", "selectPrevious",
- "KP_DOWN", "selectNext",
- "ctrl RIGHT", "scrollRight",
- "KP_LEFT", "selectParent",
- "KP_RIGHT", "selectChild",
- "ctrl DOWN", "selectNextChangeLead",
- "ctrl A", "selectAll",
- "shift KP_UP", "selectPreviousExtendSelection",
- "shift KP_DOWN","selectNextExtendSelection",
- "ctrl SPACE", "toggleSelectionPreserveAnchor",
- "ctrl shift PAGE_UP", "scrollUpExtendSelection",
- "ctrl \\", "clearSelection",
- "shift SPACE", "extendSelection",
- "ctrl PAGE_UP", "scrollUpChangeLead",
- "shift PAGE_UP","scrollUpExtendSelection",
- "SPACE", "toggleSelectionPreserveAnchor",
- "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
- "PAGE_UP", "scrollUpChangeSelection",
- "ctrl PAGE_DOWN", "scrollDownChangeLead"
- }),
- "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "Tree.expandedIcon", new IconUIResource(new ImageIcon("icons/TreeExpanded.png")),
- "Tree.foreground", new ColorUIResource(Color.black),
- "Tree.hash", new ColorUIResource(Color.gray),
- "Tree.leafIcon", new IconUIResource(new ImageIcon("icons/TreeLeaf.png")),
- "Tree.leftChildIndent", new Integer(7),
- "Tree.openIcon", new IconUIResource(new ImageIcon("icons/TreeOpen.png")),
- "Tree.rightChildIndent", new Integer(13),
- "Tree.rowHeight", new Integer(16),
- "Tree.scrollsOnExpand", Boolean.TRUE,
- "Tree.selectionBackground", new ColorUIResource(Color.black),
- "Tree.selectionBorderColor", new ColorUIResource(Color.black),
- "Tree.selectionForeground", new ColorUIResource(Color.white),
- "Tree.textBackground", new ColorUIResource(Color.white),
- "Tree.textForeground", new ColorUIResource(Color.black),
- "Viewport.background", new ColorUIResource(light),
- "Viewport.foreground", new ColorUIResource(Color.black),
- "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12)
- };
- defaults.putDefaults(uiDefaults);
- }
-} // class BasicLookAndFeel
diff --git a/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java b/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java
deleted file mode 100644
index bca104e31d0..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/* BasicMenuBarUI.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Dimension;
-import java.awt.event.ContainerEvent;
-import java.awt.event.ContainerListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.BoxLayout;
-import javax.swing.JComponent;
-import javax.swing.JMenuBar;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.MenuBarUI;
-
-/**
- * UI Delegate for JMenuBar.
- */
-public class BasicMenuBarUI extends MenuBarUI
-{
- protected ChangeListener changeListener;
-
- /*ContainerListener that listens to the ContainerEvents fired from menu bar*/
- protected ContainerListener containerListener;
-
- /*Property change listeners that listener to PropertyChangeEvent from menu bar*/
- protected PropertyChangeListener propertyChangeListener;
-
- /* menu bar for which this UI delegate is for*/
- protected JMenuBar menuBar;
-
- /**
- * Creates a new BasicMenuBarUI object.
- */
- public BasicMenuBarUI()
- {
- changeListener = createChangeListener();
- containerListener = createContainerListener();
- propertyChangeListener = new PropertyChangeHandler();
- }
-
- /**
- * Creates ChangeListener
- *
- * @return The ChangeListener
- */
- protected ChangeListener createChangeListener()
- {
- return new ChangeHandler();
- }
-
- /**
- * Creates ContainerListener() to listen for ContainerEvents
- * fired by JMenuBar.
- *
- * @return The ContainerListener
- */
- protected ContainerListener createContainerListener()
- {
- return new ContainerHandler();
- }
-
- /**
- * Factory method to create a BasicMenuBarUI for the given {@link
- * JComponent}, which should be a {@link JMenuBar}.
- *
- * @param b The {@link JComponent} a UI is being created for.
- *
- * @return A BasicMenuBarUI for the {@link JComponent}.
- */
- public static ComponentUI createUI(JComponent x)
- {
- return new BasicMenuBarUI();
- }
-
- /**
- * Returns maximum size for the specified menu bar
- *
- * @param c component for which to get maximum size
- *
- * @return Maximum size for the specified menu bar
- */
- public Dimension getMaximumSize(JComponent c)
- {
- // let layout manager calculate its size
- return null;
- }
-
- /**
- * Returns maximum allowed size of JMenuBar.
- *
- * @param c menuBar for which to return maximum size
- *
- * @return Maximum size of the give menu bar.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- // let layout manager calculate its size
- return null;
- }
-
- /**
- * Returns preferred size of JMenuBar.
- *
- * @param c menuBar for which to return preferred size
- *
- * @return Preferred size of the give menu bar.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- // let layout manager calculate its size
- return null;
- }
-
- /**
- * Initializes any default properties that this UI has from the defaults for
- * the Basic look and feel.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- menuBar.setBackground(defaults.getColor("MenuBar.background"));
- menuBar.setBorder(defaults.getBorder("MenuBar.border"));
- menuBar.setFont(defaults.getFont("MenuBar.font"));
- menuBar.setForeground(defaults.getColor("MenuBar.foreground"));
- }
-
- /**
- * This method installs the keyboard actions for the JMenuBar.
- */
- protected void installKeyboardActions()
- {
- // FIXME: implement
- }
-
- /**
- * This method installs the listeners needed for this UI to function.
- */
- protected void installListeners()
- {
- menuBar.addContainerListener(containerListener);
- menuBar.addPropertyChangeListener(propertyChangeListener);
- }
-
- /**
- * Installs and initializes all fields for this UI delegate. Any properties
- * of the UI that need to be initialized and/or set to defaults will be
- * done now. It will also install any listeners necessary.
- *
- * @param c The {@link JComponent} that is having this UI installed.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
- menuBar = (JMenuBar) c;
- menuBar.setLayout(new BoxLayout(menuBar, BoxLayout.X_AXIS));
- installDefaults();
- installListeners();
- installKeyboardActions();
- }
-
- /**
- * This method uninstalls the defaults and nulls any objects created during
- * install.
- */
- protected void uninstallDefaults()
- {
- menuBar.setBackground(null);
- menuBar.setBorder(null);
- menuBar.setFont(null);
- menuBar.setForeground(null);
- }
-
- /**
- * This method reverses the work done in installKeyboardActions.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: implement.
- }
-
- /**
- * Unregisters all the listeners that this UI delegate was using.
- */
- protected void uninstallListeners()
- {
- menuBar.removeContainerListener(containerListener);
- menuBar.removePropertyChangeListener(propertyChangeListener);
- }
-
- /**
- * Performs the opposite of installUI. Any properties or resources that need
- * to be cleaned up will be done now. It will also uninstall any listeners
- * it has. In addition, any properties of this UI will be nulled.
- *
- * @param c The {@link JComponent} that is having this UI uninstalled.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallDefaults();
- uninstallListeners();
- uninstallKeyboardActions();
- menuBar = null;
- }
-
- protected class ChangeHandler implements ChangeListener
- {
- public void stateChanged(ChangeEvent event)
- {
- }
- }
-
- /**
- * This class handles ContainerEvents fired by JMenuBar. It revalidates
- * and repaints menu bar whenever menu is added or removed from it.
- */
- protected class ContainerHandler implements ContainerListener
- {
- /**
- * This method is called whenever menu is added to the menu bar
- *
- * @param e The ContainerEvent.
- */
- public void componentAdded(ContainerEvent e)
- {
- menuBar.revalidate();
- menuBar.repaint();
- }
-
- /**
- * This method is called whenever menu is removed from the menu bar.
- *
- * @param e The ContainerEvent.
- */
- public void componentRemoved(ContainerEvent e)
- {
- menuBar.revalidate();
- menuBar.repaint();
- }
- }
-
- /**
- * This class handles PropertyChangeEvents fired from the JMenuBar
- */
- protected class PropertyChangeHandler implements PropertyChangeListener
- {
- /**
- * This method is called whenever one of the properties of the MenuBar
- * changes.
- *
- * @param e The PropertyChangeEvent.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getPropertyName().equals("borderPainted"))
- menuBar.repaint();
- if (e.getPropertyName().equals("margin"))
- menuBar.repaint();
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java b/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
deleted file mode 100644
index 5ddeae57c4e..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
+++ /dev/null
@@ -1,1008 +0,0 @@
-/* BasicMenuItemUI.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-
-import javax.swing.Icon;
-import javax.swing.JComponent;
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
-import javax.swing.JPopupMenu;
-import javax.swing.KeyStroke;
-import javax.swing.MenuElement;
-import javax.swing.MenuSelectionManager;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.MenuDragMouseEvent;
-import javax.swing.event.MenuDragMouseListener;
-import javax.swing.event.MenuKeyEvent;
-import javax.swing.event.MenuKeyListener;
-import javax.swing.event.MouseInputListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.MenuItemUI;
-
-/**
- * UI Delegate for JMenuItem.
- */
-public class BasicMenuItemUI extends MenuItemUI
-{
- /**
- * Font to be used when displaying menu item's accelerator.
- */
- protected Font acceleratorFont;
-
- /**
- * Color to be used when displaying menu item's accelerator.
- */
- protected Color acceleratorForeground;
-
- /**
- * Color to be used when displaying menu item's accelerator when menu item is
- * selected.
- */
- protected Color acceleratorSelectionForeground;
-
- /**
- * Icon that is displayed after the text to indicated that this menu contains
- * submenu.
- */
- protected Icon arrowIcon;
-
- /**
- * Icon that is displayed before the text. This icon is only used in
- * JCheckBoxMenuItem or JRadioBoxMenuItem.
- */
- protected Icon checkIcon;
-
- /**
- * Number of spaces between icon and text.
- */
- protected int defaultTextIconGap = 4;
-
- /**
- * Color of the text when menu item is disabled
- */
- protected Color disabledForeground;
-
- /**
- * The menu Drag mouse listener listening to the menu item.
- */
- protected MenuDragMouseListener menuDragMouseListener;
-
- /**
- * The menu item itself
- */
- protected JMenuItem menuItem;
-
- /**
- * Menu Key listener listening to the menu item.
- */
- protected MenuKeyListener menuKeyListener;
-
- /**
- * mouse input listener listening to menu item.
- */
- protected MouseInputListener mouseInputListener;
-
- /**
- * Indicates if border should be painted
- */
- protected boolean oldBorderPainted;
-
- /**
- * Color of text that is used when menu item is selected
- */
- protected Color selectionBackground;
-
- /**
- * Color of the text that is used when menu item is selected.
- */
- protected Color selectionForeground;
-
- /**
- * String that separates description of the modifiers and the key
- */
- private String acceleratorDelimiter;
-
- /**
- * PropertyChangeListener to listen for property changes in the menu item
- */
- private PropertyChangeListener propertyChangeListener;
-
- /**
- * Number of spaces between accelerator and menu item's label.
- */
- private int defaultAcceleratorLabelGap = 4;
-
- /**
- * Creates a new BasicMenuItemUI object.
- */
- public BasicMenuItemUI()
- {
- mouseInputListener = createMouseInputListener(menuItem);
- menuDragMouseListener = createMenuDragMouseListener(menuItem);
- menuKeyListener = createMenuKeyListener(menuItem);
- propertyChangeListener = new PropertyChangeHandler();
- }
-
- /**
- * Create MenuDragMouseListener to listen for mouse dragged events.
- *
- * @param c menu item to listen to
- *
- * @return The MenuDragMouseListener
- */
- protected MenuDragMouseListener createMenuDragMouseListener(JComponent c)
- {
- return new MenuDragMouseHandler();
- }
-
- /**
- * Creates MenuKeyListener to listen to key events occuring when menu item
- * is visible on the screen.
- *
- * @param c menu item to listen to
- *
- * @return The MenuKeyListener
- */
- protected MenuKeyListener createMenuKeyListener(JComponent c)
- {
- return new MenuKeyHandler();
- }
-
- /**
- * Handles mouse input events occuring for this menu item
- *
- * @param c menu item to listen to
- *
- * @return The MouseInputListener
- */
- protected MouseInputListener createMouseInputListener(JComponent c)
- {
- return new MouseInputHandler();
- }
-
- /**
- * Factory method to create a BasicMenuItemUI for the given {@link
- * JComponent}, which should be a {@link JMenuItem}.
- *
- * @param c The {@link JComponent} a UI is being created for.
- *
- * @return A BasicMenuItemUI for the {@link JComponent}.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicMenuItemUI();
- }
-
- /**
- * Programatically clicks menu item.
- *
- * @param msm MenuSelectionManager for the menu hierarchy
- */
- protected void doClick(MenuSelectionManager msm)
- {
- menuItem.doClick();
- msm.clearSelectedPath();
- }
-
- /**
- * Returns maximum size for the specified menu item
- *
- * @param c component for which to get maximum size
- *
- * @return Maximum size for the specified menu item.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return null;
- }
-
- /**
- * Returns minimum size for the specified menu item
- *
- * @param c component for which to get minimum size
- *
- * @return Minimum size for the specified menu item.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return null;
- }
-
- /**
- * Returns path to this menu item.
- *
- * @return $MenuElement[]$ Returns array of menu elements
- * that constitute a path to this menu item.
- */
- public MenuElement[] getPath()
- {
- ArrayList path = new ArrayList();
-
- // Path to menu should also include its popup menu.
- if (menuItem instanceof JMenu)
- path.add(((JMenu) menuItem).getPopupMenu());
-
- Component c = menuItem;
- while (c instanceof MenuElement)
- {
- path.add(0, (MenuElement) c);
-
- if (c instanceof JPopupMenu)
- c = ((JPopupMenu) c).getInvoker();
- else
- c = c.getParent();
- }
-
- MenuElement[] pathArray = new MenuElement[path.size()];
- path.toArray(pathArray);
- return pathArray;
- }
-
- /**
- * Returns preferred size for the given menu item.
- *
- * @param c menu item for which to get preferred size
- * @param checkIcon chech icon displayed in the given menu item
- * @param arrowIcon arrow icon displayed in the given menu item
- * @param defaultTextIconGap space between icon and text in the given menuItem
- *
- * @return $Dimension$ preferred size for the given menu item
- */
- protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon,
- Icon arrowIcon,
- int defaultTextIconGap)
- {
- JMenuItem m = (JMenuItem) c;
- Dimension d = BasicGraphicsUtils.getPreferredButtonSize(m,
- defaultTextIconGap);
-
- // if menu item has accelerator then take accelerator's size into account
- // when calculating preferred size.
- KeyStroke accelerator = m.getAccelerator();
- Rectangle rect;
-
- if (accelerator != null)
- {
- rect = getAcceleratorRect(accelerator,
- m.getToolkit().getFontMetrics(acceleratorFont));
-
- // add width of accelerator's text
- d.width = d.width + rect.width + defaultAcceleratorLabelGap;
-
- // adjust the heigth of the preferred size if necessary
- if (d.height < rect.height)
- d.height = rect.height;
- }
-
- if (checkIcon != null)
- {
- d.width = d.width + checkIcon.getIconWidth() + defaultTextIconGap;
-
- if (checkIcon.getIconHeight() > d.height)
- d.height = checkIcon.getIconHeight();
- }
-
- if (arrowIcon != null && (c instanceof JMenu))
- {
- d.width = d.width + arrowIcon.getIconWidth() + defaultTextIconGap;
-
- if (arrowIcon.getIconHeight() > d.height)
- d.height = arrowIcon.getIconHeight();
- }
-
- return d;
- }
-
- /**
- * Returns preferred size of the given component
- *
- * @param c component for which to return preferred size
- *
- * @return $Dimension$ preferred size for the given component
- */
- public Dimension getPreferredSize(JComponent c)
- {
- return getPreferredMenuItemSize(c, checkIcon, arrowIcon, defaultTextIconGap);
- }
-
- protected String getPropertyPrefix()
- {
- return null;
- }
-
- /**
- * This method installs the components for this {@link JMenuItem}.
- *
- * @param menuItem The {@link JMenuItem} to install components for.
- */
- protected void installComponents(JMenuItem menuItem)
- {
- // FIXME: Need to implement
- }
-
- /**
- * This method installs the defaults that are defined in the Basic look and
- * feel for this {@link JMenuItem}.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- menuItem.setBackground(defaults.getColor("MenuItem.background"));
- menuItem.setBorder(defaults.getBorder("MenuItem.border"));
- menuItem.setFont(defaults.getFont("MenuItem.font"));
- menuItem.setForeground(defaults.getColor("MenuItem.foreground"));
- menuItem.setMargin(defaults.getInsets("MenuItem.margin"));
- menuItem.setOpaque(true);
- acceleratorFont = defaults.getFont("MenuItem.acceleratorFont");
- acceleratorForeground = defaults.getColor("MenuItem.acceleratorForeground");
- acceleratorSelectionForeground = defaults.getColor("MenuItem.acceleratorSelectionForeground");
- selectionBackground = defaults.getColor("MenuItem.selectionBackground");
- selectionForeground = defaults.getColor("MenuItem.selectionForeground");
- acceleratorDelimiter = defaults.getString("MenuItem.acceleratorDelimiter");
-
- menuItem.setHorizontalTextPosition(SwingConstants.TRAILING);
- menuItem.setHorizontalAlignment(SwingConstants.LEADING);
- }
-
- /**
- * This method installs the keyboard actions for this {@link JMenuItem}.
- */
- protected void installKeyboardActions()
- {
- // FIXME: Need to implement
- }
-
- /**
- * This method installs the listeners for the {@link JMenuItem}.
- */
- protected void installListeners()
- {
- menuItem.addMouseListener(mouseInputListener);
- menuItem.addMouseMotionListener(mouseInputListener);
- menuItem.addMenuDragMouseListener(menuDragMouseListener);
- menuItem.addMenuKeyListener(menuKeyListener);
- menuItem.addPropertyChangeListener(propertyChangeListener);
- }
-
- /**
- * Installs and initializes all fields for this UI delegate. Any properties
- * of the UI that need to be initialized and/or set to defaults will be
- * done now. It will also install any listeners necessary.
- *
- * @param c The {@link JComponent} that is having this UI installed.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
- menuItem = (JMenuItem) c;
- installDefaults();
- installComponents(menuItem);
- installListeners();
- }
-
- /**
- * Paints given menu item using specified graphics context
- *
- * @param g The graphics context used to paint this menu item
- * @param c Menu Item to paint
- */
- public void paint(Graphics g, JComponent c)
- {
- paintMenuItem(g, c, checkIcon, arrowIcon, c.getBackground(),
- c.getForeground(), defaultTextIconGap);
- }
-
- /**
- * Paints background of the menu item
- *
- * @param g The graphics context used to paint this menu item
- * @param menuItem menu item to paint
- * @param bgColor Background color to use when painting menu item
- */
- protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor)
- {
- Dimension size = getPreferredSize(menuItem);
- Color foreground = g.getColor();
- g.setColor(bgColor);
- g.drawRect(0, 0, size.width, size.height);
- g.setColor(foreground);
- }
-
- /**
- * Paints specified menu item
- *
- * @param g The graphics context used to paint this menu item
- * @param c menu item to paint
- * @param checkIcon check icon to use when painting menu item
- * @param arrowIcon arrow icon to use when painting menu item
- * @param background Background color of the menu item
- * @param foreground Foreground color of the menu item
- * @param defaultTextIconGap space to use between icon and
- * text when painting menu item
- */
- protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon,
- Icon arrowIcon, Color background,
- Color foreground, int defaultTextIconGap)
- {
- JMenuItem m = (JMenuItem) c;
- Rectangle tr = new Rectangle(); // text rectangle
- Rectangle ir = new Rectangle(); // icon rectangle
- Rectangle vr = new Rectangle(); // view rectangle
- Rectangle br = new Rectangle(); // border rectangle
- Rectangle ar = new Rectangle(); // accelerator rectangle
- Rectangle cr = new Rectangle(); // checkIcon rectangle
-
- int vertAlign = m.getVerticalAlignment();
- int horAlign = m.getHorizontalAlignment();
- int vertTextPos = m.getVerticalTextPosition();
- int horTextPos = m.getHorizontalTextPosition();
-
- Font f = m.getFont();
- g.setFont(f);
- FontMetrics fm = g.getFontMetrics(f);
- SwingUtilities.calculateInnerArea(m, br);
- SwingUtilities.calculateInsetArea(br, m.getInsets(), vr);
- paintBackground(g, m, m.getBackground());
-
- /* MenuItems insets are equal to menuItems margin, space between text and
- menuItems border. We need to paint insets region as well. */
- Insets insets = m.getInsets();
- br.x -= insets.left;
- br.y -= insets.top;
- br.width += insets.right + insets.left;
- br.height += insets.top + insets.bottom;
-
- /* Menu item is considered to be highlighted when it is selected.
- It is considered to be selected if menu item is inside some menu
- and is armed or if it is both armed and pressed */
- if (m.getModel().isArmed()
- && (m.getParent() instanceof MenuElement || m.getModel().isPressed()))
- {
- if (m.isContentAreaFilled())
- {
- g.setColor(selectionBackground);
- g.fillRect(br.x, br.y, br.width, br.height);
- }
- }
- else
- {
- if (m.isContentAreaFilled())
- {
- g.setColor(m.getBackground());
- g.fillRect(br.x, br.y, br.width, br.height);
- }
- }
-
- // If this menu item is a JCheckBoxMenuItem then paint check icon
- if (checkIcon != null)
- {
- SwingUtilities.layoutCompoundLabel(m, fm, null, checkIcon, vertAlign,
- horAlign, vertTextPos, horTextPos,
- vr, cr, tr, defaultTextIconGap);
- checkIcon.paintIcon(m, g, cr.x, cr.y);
-
- // We need to calculate position of the menu text and position of
- // user menu icon if there exists one relative to the check icon.
- // So we need to adjust view rectangle s.t. its starting point is at
- // checkIcon.width + defaultTextIconGap.
- vr.x = cr.x + cr.width + defaultTextIconGap;
- }
-
- // if this is a submenu, then paint arrow icon to indicate it.
- if (arrowIcon != null && (c instanceof JMenu))
- {
- if (! ((JMenu) c).isTopLevelMenu())
- {
- int width = arrowIcon.getIconWidth();
- int height = arrowIcon.getIconHeight();
-
- arrowIcon.paintIcon(m, g, vr.width - width + defaultTextIconGap,
- vr.y + 2);
- }
- }
-
- // paint text and user menu icon if it exists
- Icon i = m.getIcon();
- SwingUtilities.layoutCompoundLabel(c, fm, m.getText(), i,
- vertAlign, horAlign, vertTextPos,
- horTextPos, vr, ir, tr,
- defaultTextIconGap);
- if (i != null)
- i.paintIcon(c, g, ir.x, ir.y);
-
- paintText(g, m, tr, m.getText());
-
- // paint accelerator
- String acceleratorText = "";
-
- if (m.getAccelerator() != null)
- {
- acceleratorText = getAcceleratorText(m.getAccelerator());
- fm = g.getFontMetrics(acceleratorFont);
- ar.width = fm.stringWidth(acceleratorText);
- ar.x = br.width - ar.width;
- vr.x = br.width - ar.width;
-
- SwingUtilities.layoutCompoundLabel(m, fm, acceleratorText, null,
- vertAlign, horAlign, vertTextPos,
- horTextPos, vr, ir, ar,
- defaultTextIconGap);
-
- paintAccelerator(g, m, ar, acceleratorText);
- }
- }
-
- /**
- * Paints label for the given menu item
- *
- * @param g The graphics context used to paint this menu item
- * @param menuItem menu item for which to draw its label
- * @param textRect rectangle specifiying position of the text relative to
- * the given menu item
- * @param text label of the menu item
- */
- protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect,
- String text)
- {
- Font f = menuItem.getFont();
- g.setFont(f);
- FontMetrics fm = g.getFontMetrics(f);
-
- if (text != null && ! text.equals(""))
- {
- if (menuItem.isEnabled())
- {
- /* Menu item is considered to be highlighted when it is selected.
- It is considered to be selected if menu item is inside some menu
- and is armed or if it is both armed and pressed */
- if (menuItem.getModel().isArmed()
- && (menuItem.getParent() instanceof MenuElement
- || menuItem.getModel().isPressed()))
- g.setColor(selectionForeground);
- else
- g.setColor(menuItem.getForeground());
- }
- else
- // FIXME: should fix this to use 'disabledForeground', but its
- // default value in BasicLookAndFeel is null.
- g.setColor(Color.gray);
-
- int mnemonicIndex = menuItem.getDisplayedMnemonicIndex();
-
- if (mnemonicIndex != -1)
- BasicGraphicsUtils.drawStringUnderlineCharAt(g, text, mnemonicIndex,
- textRect.x,
- textRect.y
- + fm.getAscent());
- else
- BasicGraphicsUtils.drawString(g, text, 0, textRect.x,
- textRect.y + fm.getAscent());
- }
- }
-
- /**
- * This method uninstalls the components for this {@link JMenuItem}.
- *
- * @param menuItem The {@link JMenuItem} to uninstall components for.
- */
- protected void uninstallComponents(JMenuItem menuItem)
- {
- // FIXME: need to implement
- }
-
- /**
- * This method uninstalls the defaults and sets any objects created during
- * install to null
- */
- protected void uninstallDefaults()
- {
- menuItem.setForeground(null);
- menuItem.setBackground(null);
- menuItem.setBorder(null);
- menuItem.setMargin(null);
- menuItem.setBackground(null);
- menuItem.setBorder(null);
- menuItem.setFont(null);
- menuItem.setForeground(null);
- menuItem.setMargin(null);
- acceleratorFont = null;
- acceleratorForeground = null;
- acceleratorSelectionForeground = null;
- arrowIcon = null;
- selectionBackground = null;
- selectionForeground = null;
- acceleratorDelimiter = null;
- }
-
- /**
- * Uninstalls any keyboard actions.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: need to implement
- }
-
- /**
- * Unregisters all the listeners that this UI delegate was using.
- */
- protected void uninstallListeners()
- {
- menuItem.removeMouseListener(mouseInputListener);
- menuItem.removeMenuDragMouseListener(menuDragMouseListener);
- menuItem.removeMenuKeyListener(menuKeyListener);
- menuItem.removePropertyChangeListener(propertyChangeListener);
- }
-
- /**
- * Performs the opposite of installUI. Any properties or resources that need
- * to be cleaned up will be done now. It will also uninstall any listeners
- * it has. In addition, any properties of this UI will be nulled.
- *
- * @param c The {@link JComponent} that is having this UI uninstalled.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallListeners();
- uninstallDefaults();
- uninstallComponents(menuItem);
- menuItem = null;
- }
-
- /**
- * This method calls paint.
- *
- * @param g The graphics context used to paint this menu item
- * @param c The menu item to paint
- */
- public void update(Graphics g, JComponent c)
- {
- paint(g, c);
- }
-
- /**
- * Return text representation of the specified accelerator
- *
- * @param accelerator Accelerator for which to return string representation
- *
- * @return $String$ Text representation of the given accelerator
- */
- private String getAcceleratorText(KeyStroke accelerator)
- {
- // convert keystroke into string format
- String modifiersText = "";
- int modifiers = accelerator.getModifiers();
- char keyChar = accelerator.getKeyChar();
- int keyCode = accelerator.getKeyCode();
-
- if (modifiers != 0)
- modifiersText = KeyEvent.getKeyModifiersText(modifiers)
- + acceleratorDelimiter;
-
- if (keyCode == KeyEvent.VK_UNDEFINED)
- return modifiersText + keyChar;
- else
- return modifiersText + KeyEvent.getKeyText(keyCode);
- }
-
- /**
- * Calculates and return rectange in which accelerator should be displayed
- *
- * @param accelerator accelerator for which to return the display rectangle
- * @param fm The font metrics used to measure the text
- *
- * @return $Rectangle$ reactangle which will be used to display accelerator
- */
- private Rectangle getAcceleratorRect(KeyStroke accelerator, FontMetrics fm)
- {
- int width = fm.stringWidth(getAcceleratorText(accelerator));
- int height = fm.getHeight();
- return new Rectangle(0, 0, width, height);
- }
-
- /**
- * Paints accelerator inside menu item
- *
- * @param g The graphics context used to paint the border
- * @param menuItem Menu item for which to draw accelerator
- * @param acceleratorRect rectangle representing position
- * of the accelerator relative to the menu item
- * @param acceleratorText accelerator's text
- */
- private void paintAccelerator(Graphics g, JMenuItem menuItem,
- Rectangle acceleratorRect,
- String acceleratorText)
- {
- g.setFont(acceleratorFont);
- FontMetrics fm = g.getFontMetrics(acceleratorFont);
-
- if (menuItem.isEnabled())
- g.setColor(acceleratorForeground);
- else
- // FIXME: should fix this to use 'disabledForeground', but its
- // default value in BasicLookAndFeel is null.
- g.setColor(Color.gray);
-
- BasicGraphicsUtils.drawString(g, acceleratorText, 0, acceleratorRect.x,
- acceleratorRect.y + fm.getAscent());
- }
-
- /**
- * This class handles mouse events occuring inside the menu item.
- * Most of the events are forwarded for processing to MenuSelectionManager
- * of the current menu hierarchy.
- *
- */
- protected class MouseInputHandler implements MouseInputListener
- {
- /**
- * Creates a new MouseInputHandler object.
- */
- protected MouseInputHandler()
- {
- }
-
- /**
- * This method is called when mouse is clicked on the menu item.
- * It forwards this event to MenuSelectionManager.
- *
- * @param e A {@link MouseEvent}.
- */
- public void mouseClicked(MouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.processMouseEvent(e);
- }
-
- /**
- * This method is called when mouse is dragged inside the menu item.
- * It forwards this event to MenuSelectionManager.
- *
- * @param e A {@link MouseEvent}.
- */
- public void mouseDragged(MouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.processMouseEvent(e);
- }
-
- /**
- * This method is called when mouse enters menu item.
- * When this happens menu item is considered to be selected and selection path
- * in MenuSelectionManager is set. This event is also forwarded to MenuSelection
- * Manager for further processing.
- *
- * @param e A {@link MouseEvent}.
- */
- public void mouseEntered(MouseEvent e)
- {
- Component source = (Component) e.getSource();
- if (source.getParent() instanceof MenuElement)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.setSelectedPath(getPath());
- manager.processMouseEvent(e);
- }
- }
-
- /**
- * This method is called when mouse exits menu item. The event is
- * forwarded to MenuSelectionManager for processing.
- *
- * @param e A {@link MouseEvent}.
- */
- public void mouseExited(MouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.processMouseEvent(e);
- }
-
- /**
- * This method is called when mouse is inside the menu item.
- * This event is forwarder to MenuSelectionManager for further processing.
- *
- * @param e A {@link MouseEvent}.
- */
- public void mouseMoved(MouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.processMouseEvent(e);
- }
-
- /**
- * This method is called when mouse is pressed. This event is forwarded to
- * MenuSelectionManager for further processing.
- *
- * @param e A {@link MouseEvent}.
- */
- public void mousePressed(MouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.processMouseEvent(e);
- }
-
- /**
- * This method is called when mouse is released. If the mouse is released
- * inside this menuItem, then this menu item is considered to be chosen and
- * the menu hierarchy should be closed.
- *
- * @param e A {@link MouseEvent}.
- */
- public void mouseReleased(MouseEvent e)
- {
- Rectangle size = menuItem.getBounds();
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- if (e.getX() > 0 && e.getX() < size.width && e.getY() > 0
- && e.getY() < size.height)
- {
- manager.clearSelectedPath();
- menuItem.doClick();
- }
-
- else
- manager.processMouseEvent(e);
- }
- }
-
- /**
- * This class handles mouse dragged events.
- */
- protected class MenuDragMouseHandler implements MenuDragMouseListener
- {
- /**
- * Tbis method is invoked when mouse is dragged over the menu item.
- *
- * @param e The MenuDragMouseEvent
- */
- public void menuDragMouseDragged(MenuDragMouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.setSelectedPath(e.getPath());
- }
-
- /**
- * Tbis method is invoked when mouse enters the menu item while it is
- * being dragged.
- *
- * @param e The MenuDragMouseEvent
- */
- public void menuDragMouseEntered(MenuDragMouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.setSelectedPath(e.getPath());
- }
-
- /**
- * Tbis method is invoked when mouse exits the menu item while
- * it is being dragged
- *
- * @param e The MenuDragMouseEvent
- */
- public void menuDragMouseExited(MenuDragMouseEvent e)
- {
- }
-
- /**
- * Tbis method is invoked when mouse was dragged and released
- * inside the menu item.
- *
- * @param e The MenuDragMouseEvent
- */
- public void menuDragMouseReleased(MenuDragMouseEvent e)
- {
- MenuElement[] path = e.getPath();
-
- if (path[path.length - 1] instanceof JMenuItem)
- ((JMenuItem) path[path.length - 1]).doClick();
-
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.clearSelectedPath();
- }
- }
-
- /**
- * This class handles key events occuring when menu item is visible on the
- * screen.
- */
- protected class MenuKeyHandler implements MenuKeyListener
- {
- /**
- * This method is invoked when key has been pressed
- *
- * @param e A {@link MenuKeyEvent}.
- */
- public void menuKeyPressed(MenuKeyEvent e)
- {
- }
-
- /**
- * This method is invoked when key has been pressed
- *
- * @param e A {@link MenuKeyEvent}.
- */
- public void menuKeyReleased(MenuKeyEvent e)
- {
- }
-
- /**
- * This method is invoked when key has been typed
- * It handles the mnemonic key for the menu item.
- *
- * @param e A {@link MenuKeyEvent}.
- */
- public void menuKeyTyped(MenuKeyEvent e)
- {
- }
- }
-
- /**
- * Helper class that listens for changes to the properties of the {@link
- * JMenuItem}.
- */
- protected class PropertyChangeHandler implements PropertyChangeListener
- {
- /**
- * This method is called when one of the menu item's properties change.
- *
- * @param evt A {@link PropertyChangeEvent}.
- */
- public void propertyChange(PropertyChangeEvent evt)
- {
- menuItem.revalidate();
- menuItem.repaint();
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicMenuUI.java b/libjava/javax/swing/plaf/basic/BasicMenuUI.java
deleted file mode 100644
index 3d1da7168e6..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicMenuUI.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/* BasicMenuUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Dimension;
-import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.JComponent;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JPopupMenu;
-import javax.swing.MenuSelectionManager;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.MenuDragMouseEvent;
-import javax.swing.event.MenuDragMouseListener;
-import javax.swing.event.MenuEvent;
-import javax.swing.event.MenuKeyEvent;
-import javax.swing.event.MenuKeyListener;
-import javax.swing.event.MenuListener;
-import javax.swing.event.MouseInputListener;
-import javax.swing.plaf.ComponentUI;
-
-/**
- * UI Delegate for JMenu
- */
-public class BasicMenuUI extends BasicMenuItemUI
-{
- protected ChangeListener changeListener;
-
- /* MenuListener listens to MenuEvents fired by JMenu */
- protected MenuListener menuListener;
-
- /* PropertyChangeListner that listens to propertyChangeEvents occuring in JMenu*/
- protected PropertyChangeListener propertyChangeListener;
-
- /**
- * Creates a new BasicMenuUI object.
- */
- public BasicMenuUI()
- {
- mouseInputListener = createMouseInputListener((JMenu) menuItem);
- menuListener = createMenuListener((JMenu) menuItem);
- propertyChangeListener = createPropertyChangeListener((JMenu) menuItem);
- }
-
- /**
- * This method creates a new ChangeListener.
- *
- * @return A new ChangeListener.
- */
- protected ChangeListener createChangeListener(JComponent c)
- {
- return new ChangeHandler();
- }
-
- /**
- * This method creates new MenuDragMouseListener to listen to mouse dragged events
- * occuring in the Menu
- *
- * @param c the menu to listen to
- *
- * @return The MenuDrageMouseListener
- */
- protected MenuDragMouseListener createMenuDragMouseListener(JComponent c)
- {
- return new MenuDragMouseHandler();
- }
-
- /**
- * This method creates new MenuDragKeyListener to listen to key events
- *
- * @param c the menu to listen to
- *
- * @return The MenuKeyListener
- */
- protected MenuKeyListener createMenuKeyListener(JComponent c)
- {
- return new MenuKeyHandler();
- }
-
- /**
- * This method creates new MenuListener to listen to menu events
- * occuring in the Menu
- *
- * @param c the menu to listen to
- *
- * @return The MenuListener
- */
- protected MenuListener createMenuListener(JComponent c)
- {
- return new MenuHandler();
- }
-
- /**
- * This method creates new MouseInputListener to listen to mouse input events
- * occuring in the Menu
- *
- * @param c the menu to listen to
- *
- * @return The MouseInputListener
- */
- protected MouseInputListener createMouseInputListener(JComponent c)
- {
- return new MouseInputHandler();
- }
-
- /**
- * This method creates newPropertyChangeListener to listen to property changes
- * occuring in the Menu
- *
- * @param c the menu to listen to
- *
- * @return The PropertyChangeListener
- */
- protected PropertyChangeListener createPropertyChangeListener(JComponent c)
- {
- return new PropertyChangeHandler();
- }
-
- /**
- * This method creates a new BasicMenuUI.
- *
- * @param c The JComponent to create a UI for.
- *
- * @return A new BasicMenuUI.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicMenuUI();
- }
-
- /**
- * Get the component's maximum size.
- *
- * @param c The JComponent for which to get maximum size
- *
- * @return The maximum size of the component
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return c.getPreferredSize();
- }
-
- protected String getPropertyPrefix()
- {
- return null;
- }
-
- /**
- * Initializes any default properties that this UI has from the defaults for
- * the Basic look and feel.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- menuItem.setBackground(defaults.getColor("Menu.background"));
- menuItem.setBorder(defaults.getBorder("Menu.border"));
- menuItem.setFont(defaults.getFont("Menu.font"));
- menuItem.setForeground(defaults.getColor("Menu.foreground"));
- menuItem.setMargin(defaults.getInsets("Menu.margin"));
- acceleratorFont = defaults.getFont("Menu.acceleratorFont");
- acceleratorForeground = defaults.getColor("Menu.acceleratorForeground");
- acceleratorSelectionForeground = defaults.getColor("Menu.acceleratorSelectionForeground");
- selectionBackground = defaults.getColor("Menu.selectionBackground");
- selectionForeground = defaults.getColor("Menu.selectionForeground");
- arrowIcon = defaults.getIcon("Menu.arrowIcon");
- oldBorderPainted = defaults.getBoolean("Menu.borderPainted");
- menuItem.setOpaque(true);
- }
-
- /**
- * Installs any keyboard actions. The list of keys that need to be bound are
- * listed in Basic look and feel's defaults.
- *
- */
- protected void installKeyboardActions()
- {
- // FIXME: Need to implement
- }
-
- /**
- * Creates and registers all the listeners for this UI delegate.
- */
- protected void installListeners()
- {
- ((JMenu) menuItem).addMouseListener(mouseInputListener);
- ((JMenu) menuItem).addMouseMotionListener(mouseInputListener);
- ((JMenu) menuItem).addMenuListener(menuListener);
- ((JMenu) menuItem).addMenuDragMouseListener(menuDragMouseListener);
- }
-
- protected void setupPostTimer(JMenu menu)
- {
- }
-
- /**
- * This method uninstalls the defaults and sets any objects created during
- * install to null
- */
- protected void uninstallDefaults()
- {
- menuItem.setBackground(null);
- menuItem.setBorder(null);
- menuItem.setFont(null);
- menuItem.setForeground(null);
- menuItem.setMargin(null);
- acceleratorFont = null;
- acceleratorForeground = null;
- acceleratorSelectionForeground = null;
- selectionBackground = null;
- selectionForeground = null;
- arrowIcon = null;
- }
-
- /**
- * Uninstalls any keyboard actions. The list of keys used are listed in
- * Basic look and feel's defaults.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: Need to implement
- }
-
- /**
- * Unregisters all the listeners that this UI delegate was using. In
- * addition, it will also null any listeners that it was using.
- */
- protected void uninstallListeners()
- {
- ((JMenu) menuItem).removeMouseListener(mouseInputListener);
- ((JMenu) menuItem).removeMenuListener(menuListener);
- ((JMenu) menuItem).removePropertyChangeListener(propertyChangeListener);
- }
-
- /**
- * This class is used by menus to handle mouse events occuring in the
- * menu.
- */
- protected class MouseInputHandler implements MouseInputListener
- {
- public void mouseClicked(MouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.processMouseEvent(e);
- }
-
- public void mouseDragged(MouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.processMouseEvent(e);
- }
-
- public void mouseEntered(MouseEvent e)
- {
- /* When mouse enters menu item, it should be considered selected
-
- if (i) if this menu is a submenu in some other menu
- (ii) or if this menu is in a menu bar and some other menu in a menu bar was just
- selected. (If nothing was selected, menu should be pressed before
- it will be selected)
- */
- JMenu menu = (JMenu) menuItem;
- if (! menu.isTopLevelMenu()
- || (menu.isTopLevelMenu()
- && (((JMenuBar) menu.getParent()).isSelected() && ! menu.isArmed())))
- {
- // set new selection and forward this event to MenuSelectionManager
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.setSelectedPath(getPath());
- manager.processMouseEvent(e);
- }
- }
-
- public void mouseExited(MouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.processMouseEvent(e);
- }
-
- public void mouseMoved(MouseEvent e)
- {
- }
-
- public void mousePressed(MouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- JMenu menu = (JMenu) menuItem;
- manager.processMouseEvent(e);
-
- // Menu should be displayed when the menu is pressed only if
- // it is top-level menu
- if (menu.isTopLevelMenu())
- {
- if (menu.getPopupMenu().isVisible())
- // If menu is visible and menu button was pressed..
- // then need to cancel the menu
- manager.clearSelectedPath();
- else
- {
- // Display the menu
- int x = 0;
- int y = menu.getHeight();
-
- manager.setSelectedPath(getPath());
-
- JMenuBar mb = (JMenuBar) menu.getParent();
-
- // set selectedIndex of the selectionModel of a menuBar
- mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu));
- }
- }
- }
-
- public void mouseReleased(MouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.processMouseEvent(e);
- }
- }
-
- /**
- * This class handles MenuEvents fired by the JMenu
- */
- protected class MenuHandler implements MenuListener
- {
- /**
- * This method is called when menu is cancelled. The menu is cancelled
- * when its popup menu is closed without selection. It clears selected index
- * in the selectionModel of the menu parent.
- *
- * @param e The MenuEvent.
- */
- public void menuCanceled(MenuEvent e)
- {
- menuDeselected(e);
- }
-
- /**
- * This method is called when menu is deselected. It clears selected index
- * in the selectionModel of the menu parent.
- *
- * @param e The MenuEvent.
- */
- public void menuDeselected(MenuEvent e)
- {
- JMenu menu = (JMenu) menuItem;
- if (menu.isTopLevelMenu())
- ((JMenuBar) menu.getParent()).getSelectionModel().clearSelection();
- else
- ((JPopupMenu) menu.getParent()).getSelectionModel().clearSelection();
- }
-
- /**
- * This method is called when menu is selected. It sets selected index
- * in the selectionModel of the menu parent.
- *
- * @param e The MenuEvent.
- */
- public void menuSelected(MenuEvent e)
- {
- JMenu menu = (JMenu) menuItem;
- if (menu.isTopLevelMenu())
- ((JMenuBar) menu.getParent()).setSelected(menu);
- else
- ((JPopupMenu) menu.getParent()).setSelected(menu);
- }
- }
-
- /**
- * This class handles PropertyChangeEvents fired from the JMenu
- */
- protected class PropertyChangeHandler implements PropertyChangeListener
- {
- /**
- * This method is called whenever one of the properties of the menu item
- * changes.
- *
- * @param e The PropertyChangeEvent.
- */
- public void propertyChange(PropertyChangeEvent evt)
- {
- }
- }
-
- protected class ChangeHandler implements ChangeListener
- {
- public void stateChanged(ChangeEvent e)
- {
- // FIXME: It seems that this class is not used anywhere
- }
- }
-
- /**
- * This class handles mouse dragged events occuring in the menu.
- */
- protected class MenuDragMouseHandler implements MenuDragMouseListener
- {
- /**
- * This method is invoked when mouse is dragged over the menu item.
- *
- * @param e The MenuDragMouseEvent
- */
- public void menuDragMouseDragged(MenuDragMouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.setSelectedPath(e.getPath());
- }
-
- /**
- * This method is invoked when mouse enters the menu item while it is
- * being dragged.
- *
- * @param e The MenuDragMouseEvent
- */
- public void menuDragMouseEntered(MenuDragMouseEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.setSelectedPath(e.getPath());
- }
-
- /**
- * This method is invoked when mouse exits the menu item while
- * it is being dragged
- *
- * @param e The MenuDragMouseEvent
- */
- public void menuDragMouseExited(MenuDragMouseEvent e)
- {
- }
-
- /**
- * This method is invoked when mouse was dragged and released
- * inside the menu item.
- *
- * @param e The MenuDragMouseEvent
- */
- public void menuDragMouseReleased(MenuDragMouseEvent e)
- {
- }
- }
-
- /**
- * This class handles key events occuring when menu item is visible on the
- * screen.
- */
- protected class MenuKeyHandler implements MenuKeyListener
- {
- /**
- * This method is invoked when key has been pressed
- *
- * @param e A {@link MenuKeyEvent}.
- */
- public void menuKeyPressed(MenuKeyEvent e)
- {
- }
-
- /**
- * This method is invoked when key has been pressed
- *
- * @param e A {@link MenuKeyEvent}.
- */
- public void menuKeyReleased(MenuKeyEvent e)
- {
- }
-
- /**
- * This method is invoked when key has been typed
- * It handles the mnemonic key for the menu item.
- *
- * @param e A {@link MenuKeyEvent}.
- */
- public void menuKeyTyped(MenuKeyEvent e)
- {
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java b/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
deleted file mode 100644
index 28ac706d1df..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
+++ /dev/null
@@ -1,1323 +0,0 @@
-/* BasicOptionPaneUI.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.Polygon;
-import java.awt.Window;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
-
-import javax.swing.Box;
-import javax.swing.BoxLayout;
-import javax.swing.Icon;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.JDialog;
-import javax.swing.JInternalFrame;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.OptionPaneUI;
-
-/**
- * This class is the UI delegate for JOptionPane in the Basic Look and Feel.
- */
-public class BasicOptionPaneUI extends OptionPaneUI
-{
- /**
- * This is a helper class that listens to the buttons located at the bottom
- * of the JOptionPane.
- */
- protected class ButtonActionListener implements ActionListener
- {
- /** The index of the option this button represents. */
- protected int buttonIndex;
-
- /**
- * Creates a new ButtonActionListener object with the given buttonIndex.
- *
- * @param buttonIndex The index of the option this button represents.
- */
- public ButtonActionListener(int buttonIndex)
- {
- this.buttonIndex = buttonIndex;
- }
-
- /**
- * This method is called when one of the option buttons are pressed.
- *
- * @param e The ActionEvent.
- */
- public void actionPerformed(ActionEvent e)
- {
- Object value = new Integer(JOptionPane.CLOSED_OPTION);
- Object[] options = optionPane.getOptions();
- if (options != null)
- value = new Integer(buttonIndex);
- else
- {
- String text = ((JButton) e.getSource()).getText();
- if (text.equals(OK_STRING))
- value = new Integer(JOptionPane.OK_OPTION);
- if (text.equals(CANCEL_STRING))
- value = new Integer(JOptionPane.CANCEL_OPTION);
- if (text.equals(YES_STRING))
- value = new Integer(JOptionPane.YES_OPTION);
- if (text.equals(NO_STRING))
- value = new Integer(JOptionPane.NO_OPTION);
- }
- optionPane.setValue(value);
- resetInputValue();
-
- Window owner = SwingUtilities.windowForComponent(optionPane);
-
- if (owner instanceof JDialog)
- ((JDialog) owner).dispose();
-
- //else we probably have some kind of internal frame.
- JInternalFrame inf = (JInternalFrame) SwingUtilities.getAncestorOfClass(JInternalFrame.class,
- optionPane);
- if (inf != null)
- {
- try
- {
- inf.setClosed(true);
- }
- catch (PropertyVetoException pve)
- {
- }
- }
- }
- }
-
- /**
- * This helper layout manager is responsible for the layout of the button
- * area. The button area is the panel that holds the buttons which
- * represent the options.
- */
- protected class ButtonAreaLayout implements LayoutManager
- {
- /** Whether this layout will center the buttons. */
- protected boolean centersChildren = true;
-
- /** The space between the buttons. */
- protected int padding;
-
- /** Whether the buttons will share the same widths. */
- protected boolean syncAllWidths;
-
- /** The width of the widest button. */
- private transient int widthOfWidestButton;
-
- /** The height of the tallest button. */
- private transient int tallestButton;
-
- /**
- * Creates a new ButtonAreaLayout object with the given sync widths
- * property and padding.
- *
- * @param syncAllWidths Whether the buttons will share the same widths.
- * @param padding The padding between the buttons.
- */
- public ButtonAreaLayout(boolean syncAllWidths, int padding)
- {
- this.syncAllWidths = syncAllWidths;
- this.padding = padding;
- }
-
- /**
- * This method is called when a component is added to the container.
- *
- * @param string The constraints string.
- * @param comp The component added.
- */
- public void addLayoutComponent(String string, Component comp)
- {
- // Do nothing.
- }
-
- /**
- * This method returns whether the children will be centered.
- *
- * @return Whether the children will be centered.
- */
- public boolean getCentersChildren()
- {
- return centersChildren;
- }
-
- /**
- * This method returns the amount of space between components.
- *
- * @return The amount of space between components.
- */
- public int getPadding()
- {
- return padding;
- }
-
- /**
- * This method returns whether all components will share widths (set to
- * largest width).
- *
- * @return Whether all components will share widths.
- */
- public boolean getSyncAllWidths()
- {
- return syncAllWidths;
- }
-
- /**
- * This method lays out the given container.
- *
- * @param container The container to lay out.
- */
- public void layoutContainer(Container container)
- {
- Component[] buttonList = container.getComponents();
- int x = container.getInsets().left;
- if (getCentersChildren())
- x += (int) ((double) (container.getSize().width) / 2
- - (double) (buttonRowLength(container)) / 2);
- for (int i = 0; i < buttonList.length; i++)
- {
- Dimension dims = buttonList[i].getPreferredSize();
- if (getSizeButtonsToSameWidth())
- {
- buttonList[i].setBounds(x, 0, widthOfWidestButton, dims.height);
- x += widthOfWidestButton + getPadding();
- }
- else
- {
- buttonList[i].setBounds(x, 0, dims.width, dims.height);
- x += dims.width + getPadding();
- }
- }
- }
-
- /**
- * This method returns the width of the given container taking into
- * consideration the padding and syncAllWidths.
- *
- * @param c The container to calculate width for.
- *
- * @return The width of the given container.
- */
- private int buttonRowLength(Container c)
- {
- Component[] buttonList = c.getComponents();
-
- int buttonLength = 0;
- int widest = 0;
- int tallest = 0;
-
- for (int i = 0; i < buttonList.length; i++)
- {
- Dimension dims = buttonList[i].getPreferredSize();
- buttonLength += dims.width + getPadding();
- widest = Math.max(widest, dims.width);
- tallest = Math.max(tallest, dims.height);
- }
-
- widthOfWidestButton = widest;
- tallestButton = tallest;
-
- int width;
- if (getSyncAllWidths())
- width = widest * buttonList.length
- + getPadding() * (buttonList.length - 1);
- else
- width = buttonLength;
-
- Insets insets = c.getInsets();
- width += insets.left + insets.right;
-
- return width;
- }
-
- /**
- * This method returns the minimum layout size for the given container.
- *
- * @param c The container to measure.
- *
- * @return The minimum layout size.
- */
- public Dimension minimumLayoutSize(Container c)
- {
- return preferredLayoutSize(c);
- }
-
- /**
- * This method returns the preferred size of the given container.
- *
- * @param c The container to measure.
- *
- * @return The preferred size.
- */
- public Dimension preferredLayoutSize(Container c)
- {
- int w = buttonRowLength(c);
-
- return new Dimension(w, tallestButton);
- }
-
- /**
- * This method removes the given component from the layout manager's
- * knowledge.
- *
- * @param c The component to remove.
- */
- public void removeLayoutComponent(Component c)
- {
- // Do nothing.
- }
-
- /**
- * This method sets whether the children will be centered.
- *
- * @param newValue Whether the children will be centered.
- */
- public void setCentersChildren(boolean newValue)
- {
- centersChildren = newValue;
- optionPane.invalidate();
- }
-
- /**
- * This method sets the amount of space between each component.
- *
- * @param newPadding The padding between components.
- */
- public void setPadding(int newPadding)
- {
- padding = newPadding;
- optionPane.invalidate();
- }
-
- /**
- * This method sets whether the widths will be synced.
- *
- * @param newValue Whether the widths will be synced.
- */
- public void setSyncAllWidths(boolean newValue)
- {
- syncAllWidths = newValue;
- optionPane.invalidate();
- }
- }
-
- /**
- * This helper class handles property change events from the JOptionPane.
- */
- public class PropertyChangeHandler implements PropertyChangeListener
- {
- /**
- * This method is called when one of the properties of the JOptionPane
- * changes.
- *
- * @param e The PropertyChangeEvent.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getPropertyName().equals(JOptionPane.ICON_PROPERTY)
- || e.getPropertyName().equals(JOptionPane.MESSAGE_TYPE_PROPERTY))
- addIcon(messageAreaContainer);
- else if (e.getPropertyName().equals(JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY))
- resetSelectedValue();
- else if (e.getPropertyName().equals(JOptionPane.INITIAL_VALUE_PROPERTY)
- || e.getPropertyName().equals(JOptionPane.OPTIONS_PROPERTY)
- || e.getPropertyName().equals(JOptionPane.OPTION_TYPE_PROPERTY))
- {
- Container newButtons = createButtonArea();
- optionPane.remove(buttonContainer);
- optionPane.add(newButtons);
- buttonContainer = newButtons;
- }
-
- else if (e.getPropertyName().equals(JOptionPane.MESSAGE_PROPERTY)
- || e.getPropertyName().equals(JOptionPane.WANTS_INPUT_PROPERTY)
- || e.getPropertyName().equals(JOptionPane.SELECTION_VALUES_PROPERTY))
- {
- optionPane.removeAll();
- messageAreaContainer = createMessageArea();
- optionPane.add(messageAreaContainer);
- optionPane.add(buttonContainer);
- }
- optionPane.invalidate();
- optionPane.repaint();
- }
- }
-
- /** Whether the JOptionPane contains custom components. */
- protected boolean hasCustomComponents = false;
-
- // The initialFocusComponent seems to always be set to a button (even if
- // I try to set initialSelectionValue). This is different from what the
- // javadocs state (which should switch this reference to the input component
- // if one is present since that is what's going to get focus).
-
- /**
- * The button that will receive focus based on initialValue when no input
- * component is present. If an input component is present, then the input
- * component will receive focus instead.
- */
- protected Component initialFocusComponent;
-
- /** The component that receives input when the JOptionPane needs it. */
- protected JComponent inputComponent;
-
- /** The minimum height of the JOptionPane. */
- public static int minimumHeight;
-
- /** The minimum width of the JOptionPane. */
- public static int minimumWidth;
-
- /** The minimum dimensions of the JOptionPane. */
- protected Dimension minimumSize;
-
- /** The propertyChangeListener for the JOptionPane. */
- protected PropertyChangeListener propertyChangeListener;
-
- /** The JOptionPane this UI delegate is used for. */
- protected JOptionPane optionPane;
-
- /** The size of the icons. */
- // FIXME: wrong name for a constant.
- private static final int iconSize = 36;
-
- /** The foreground color for the message area. */
- private transient Color messageForeground;
-
- /** The border around the message area. */
- private transient Border messageBorder;
-
- /** The border around the button area. */
- private transient Border buttonBorder;
-
- /** The string used to describe OK buttons. */
- // FIXME: wrong name for a constant.
- private static final String OK_STRING = "OK";
-
- /** The string used to describe Yes buttons. */
- // FIXME: wrong name for a constant.
- private static final String YES_STRING = "Yes";
-
- /** The string used to describe No buttons. */
- // FIXME: wrong name for a constant.
- private static final String NO_STRING = "No";
-
- /** The string used to describe Cancel buttons. */
- // FIXME: wrong name for a constant.
- private static final String CANCEL_STRING = "Cancel";
-
- /** The container for the message area.
- * This is package-private to avoid an accessor method. */
- transient Container messageAreaContainer;
-
- /** The container for the buttons.
- * This is package-private to avoid an accessor method. */
- transient Container buttonContainer;
-
- /**
- * A helper class that implements Icon. This is used temporarily until
- * ImageIcons are fixed.
- */
- private static class MessageIcon implements Icon
- {
- /**
- * This method returns the width of the icon.
- *
- * @return The width of the icon.
- */
- public int getIconWidth()
- {
- return iconSize;
- }
-
- /**
- * This method returns the height of the icon.
- *
- * @return The height of the icon.
- */
- public int getIconHeight()
- {
- return iconSize;
- }
-
- /**
- * This method paints the icon as a part of the given component using the
- * given graphics and the given x and y position.
- *
- * @param c The component that owns this icon.
- * @param g The Graphics object to paint with.
- * @param x The x coordinate.
- * @param y The y coordinate.
- */
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- }
- }
-
- /** The icon displayed for ERROR_MESSAGE. */
- private static MessageIcon errorIcon = new MessageIcon()
- {
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- Polygon oct = new Polygon(new int[] { 0, 0, 9, 27, 36, 36, 27, 9 },
- new int[] { 9, 27, 36, 36, 27, 9, 0, 0 }, 8);
- g.translate(x, y);
-
- Color saved = g.getColor();
- g.setColor(Color.RED);
-
- g.fillPolygon(oct);
-
- g.setColor(Color.BLACK);
- g.drawRect(13, 16, 10, 4);
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- };
-
- /** The icon displayed for INFORMATION_MESSAGE. */
- private static MessageIcon infoIcon = new MessageIcon()
- {
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- g.translate(x, y);
- Color saved = g.getColor();
-
- // Should be purple.
- g.setColor(Color.RED);
-
- g.fillOval(0, 0, iconSize, iconSize);
-
- g.setColor(Color.BLACK);
- g.drawOval(16, 6, 4, 4);
-
- Polygon bottomI = new Polygon(new int[] { 15, 15, 13, 13, 23, 23, 21, 21 },
- new int[] { 12, 28, 28, 30, 30, 28, 28, 12 },
- 8);
- g.drawPolygon(bottomI);
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- };
-
- /** The icon displayed for WARNING_MESSAGE. */
- private static MessageIcon warningIcon = new MessageIcon()
- {
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- g.translate(x, y);
- Color saved = g.getColor();
- g.setColor(Color.YELLOW);
-
- Polygon triangle = new Polygon(new int[] { 0, 18, 36 },
- new int[] { 36, 0, 36 }, 3);
- g.fillPolygon(triangle);
-
- g.setColor(Color.BLACK);
-
- Polygon excl = new Polygon(new int[] { 15, 16, 20, 21 },
- new int[] { 8, 26, 26, 8 }, 4);
- g.drawPolygon(excl);
- g.drawOval(16, 30, 4, 4);
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- };
-
- /** The icon displayed for MESSAGE_ICON. */
- private static MessageIcon questionIcon = new MessageIcon()
- {
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- g.translate(x, y);
- Color saved = g.getColor();
- g.setColor(Color.GREEN);
-
- g.fillRect(0, 0, iconSize, iconSize);
-
- g.setColor(Color.BLACK);
-
- g.drawOval(11, 2, 16, 16);
- g.drawOval(14, 5, 10, 10);
-
- g.setColor(Color.GREEN);
- g.fillRect(0, 10, iconSize, iconSize - 10);
-
- g.setColor(Color.BLACK);
-
- g.drawLine(11, 10, 14, 10);
-
- g.drawLine(24, 10, 17, 22);
- g.drawLine(27, 10, 20, 22);
- g.drawLine(17, 22, 20, 22);
-
- g.drawOval(17, 25, 3, 3);
-
- g.setColor(saved);
- g.translate(-x, -y);
- }
- };
-
- // FIXME: Uncomment when the ImageIcons are fixed.
-
- /* IconUIResource warningIcon, questionIcon, infoIcon, errorIcon;*/
-
- /**
- * Creates a new BasicOptionPaneUI object.
- */
- public BasicOptionPaneUI()
- {
- }
-
- /**
- * This method is messaged to add the buttons to the given container.
- *
- * @param container The container to add components to.
- * @param buttons The buttons to add. (If it is an instance of component,
- * the Object is added directly. If it is an instance of Icon, it is
- * packed into a label and added. For all other cases, the string
- * representation of the Object is retreived and packed into a
- * label.)
- * @param initialIndex The index of the component that is the initialValue.
- */
- protected void addButtonComponents(Container container, Object[] buttons,
- int initialIndex)
- {
- if (buttons == null)
- return;
- for (int i = 0; i < buttons.length; i++)
- {
- if (buttons[i] != null)
- {
- Component toAdd;
- if (buttons[i] instanceof Component)
- toAdd = (Component) buttons[i];
- else
- {
- if (buttons[i] instanceof Icon)
- toAdd = new JButton((Icon) buttons[i]);
- else
- toAdd = new JButton(buttons[i].toString());
- hasCustomComponents = true;
- }
- if (toAdd instanceof JButton)
- ((JButton) toAdd).addActionListener(createButtonActionListener(i));
- if (i == initialIndex)
- initialFocusComponent = toAdd;
- container.add(toAdd);
- }
- }
- selectInitialValue(optionPane);
- }
-
- /**
- * This method adds the appropriate icon the given container.
- *
- * @param top The container to add an icon to.
- */
- protected void addIcon(Container top)
- {
- JLabel iconLabel = null;
- Icon icon = getIcon();
- if (icon != null)
- {
- iconLabel = new JLabel(icon);
- top.add(iconLabel, BorderLayout.WEST);
- }
- }
-
- /**
- * A helper method that returns an instance of GridBagConstraints to be used
- * for creating the message area.
- *
- * @return An instance of GridBagConstraints.
- */
- private static GridBagConstraints createConstraints()
- {
- GridBagConstraints constraints = new GridBagConstraints();
- constraints.gridx = GridBagConstraints.REMAINDER;
- constraints.gridy = GridBagConstraints.REMAINDER;
- constraints.gridwidth = 0;
- constraints.anchor = GridBagConstraints.LINE_START;
- constraints.fill = GridBagConstraints.NONE;
- constraints.insets = new Insets(0, 0, 3, 0);
-
- return constraints;
- }
-
- /**
- * This method creates the proper object (if necessary) to represent msg.
- * (If msg is an instance of Component, it will add it directly. If it is
- * an icon, then it will pack it in a label and add it. Otherwise, it gets
- * treated as a string. If the string is longer than maxll, a box is
- * created and the burstStringInto is called with the box as the container.
- * The box is then added to the given container. Otherwise, the string is
- * packed in a label and placed in the given container.) This method is
- * also used for adding the inputComponent to the container.
- *
- * @param container The container to add to.
- * @param cons The constraints when adding.
- * @param msg The message to add.
- * @param maxll The max line length.
- * @param internallyCreated Whether the msg is internally created.
- */
- protected void addMessageComponents(Container container,
- GridBagConstraints cons, Object msg,
- int maxll, boolean internallyCreated)
- {
- if (msg == null)
- return;
- hasCustomComponents = internallyCreated;
- if (msg instanceof Object[])
- {
- Object[] arr = (Object[]) msg;
- for (int i = 0; i < arr.length; i++)
- addMessageComponents(container, cons, arr[i], maxll,
- internallyCreated);
- return;
- }
- else if (msg instanceof Component)
- {
- container.add((Component) msg, cons);
- cons.gridy++;
- }
- else if (msg instanceof Icon)
- {
- container.add(new JLabel((Icon) msg), cons);
- cons.gridy++;
- }
- else
- {
- // Undocumented behaviour.
- // if msg.toString().length greater than maxll
- // it will create a box and burst the string.
- // otherwise, it will just create a label and re-call
- // this method with the label o.O
- if (msg.toString().length() > maxll)
- {
- Box tmp = new Box(BoxLayout.Y_AXIS);
- burstStringInto(tmp, msg.toString(), maxll);
- addMessageComponents(container, cons, tmp, maxll, true);
- }
- else
- addMessageComponents(container, cons, new JLabel(msg.toString()),
- maxll, true);
- }
- }
-
- /**
- * This method creates instances of d (recursively if necessary based on
- * maxll) and adds to c.
- *
- * @param c The container to add to.
- * @param d The string to burst.
- * @param maxll The max line length.
- */
- protected void burstStringInto(Container c, String d, int maxll)
- {
- // FIXME: Verify that this is the correct behaviour.
- // One interpretation of the spec is that this method
- // should recursively call itself to create (and add)
- // JLabels to the container if the length of the String d
- // is greater than maxll.
- // but in practice, even with a really long string, this is
- // all that happens.
- if (d == null || c == null)
- return;
- JLabel label = new JLabel(d);
- c.add(label);
- }
-
- /**
- * This method returns true if the given JOptionPane contains custom
- * components.
- *
- * @param op The JOptionPane to check.
- *
- * @return True if the JOptionPane contains custom components.
- */
- public boolean containsCustomComponents(JOptionPane op)
- {
- return hasCustomComponents;
- }
-
- /**
- * This method creates a button action listener for the given button index.
- *
- * @param buttonIndex The index of the button in components.
- *
- * @return A new ButtonActionListener.
- */
- protected ActionListener createButtonActionListener(int buttonIndex)
- {
- return new ButtonActionListener(buttonIndex);
- }
-
- /**
- * This method creates the button area.
- *
- * @return A new Button Area.
- */
- protected Container createButtonArea()
- {
- JPanel buttonPanel = new JPanel();
-
- buttonPanel.setLayout(createLayoutManager());
- addButtonComponents(buttonPanel, getButtons(), getInitialValueIndex());
-
- return buttonPanel;
- }
-
- /**
- * This method creates a new LayoutManager for the button area.
- *
- * @return A new LayoutManager for the button area.
- */
- protected LayoutManager createLayoutManager()
- {
- return new ButtonAreaLayout(getSizeButtonsToSameWidth(), 6);
- }
-
- /**
- * This method creates the message area.
- *
- * @return A new message area.
- */
- protected Container createMessageArea()
- {
- JPanel messageArea = new JPanel();
- messageArea.setLayout(new BorderLayout());
- addIcon(messageArea);
-
- JPanel rightSide = new JPanel();
- rightSide.setLayout(new GridBagLayout());
- GridBagConstraints con = createConstraints();
-
- addMessageComponents(rightSide, con, getMessage(),
- getMaxCharactersPerLineCount(), false);
-
- if (optionPane.getWantsInput())
- {
- Object[] selection = optionPane.getSelectionValues();
-
-// if (selection == null)
-// inputComponent = new JTextField();
-// else if (selection.length < 20)
-// inputComponent = new JComboBox(selection);
- // FIXME: Uncomment when the widgets are done.
- if (selection == null)
- inputComponent = null;
- else
- inputComponent = new JList(selection);
- if (inputComponent != null)
- {
- addMessageComponents(rightSide, con, inputComponent,
- getMaxCharactersPerLineCount(), true);
- resetSelectedValue();
- selectInitialValue(optionPane);
- }
- }
-
- messageArea.add(rightSide, BorderLayout.EAST);
-
- return messageArea;
- }
-
- /**
- * This method creates a new PropertyChangeListener for listening to the
- * JOptionPane.
- *
- * @return A new PropertyChangeListener.
- */
- protected PropertyChangeListener createPropertyChangeListener()
- {
- return new PropertyChangeHandler();
- }
-
- /**
- * This method creates a Container that will separate the message and button
- * areas.
- *
- * @return A Container that will separate the message and button areas.
- */
- protected Container createSeparator()
- {
- return null;
- }
-
- /**
- * This method creates a new BasicOptionPaneUI for the given component.
- *
- * @param x The component to create a UI for.
- *
- * @return A new BasicOptionPaneUI.
- */
- public static ComponentUI createUI(JComponent x)
- {
- return new BasicOptionPaneUI();
- }
-
- /**
- * This method returns the buttons for the JOptionPane. If no options are
- * set, a set of options will be created based upon the optionType.
- *
- * @return The buttons that will be added.
- */
- protected Object[] getButtons()
- {
- if (optionPane.getOptions() != null)
- return optionPane.getOptions();
- switch (optionPane.getOptionType())
- {
- case JOptionPane.YES_NO_OPTION:
- return new Object[] { YES_STRING, NO_STRING };
- case JOptionPane.YES_NO_CANCEL_OPTION:
- return new Object[] { YES_STRING, NO_STRING, CANCEL_STRING };
- case JOptionPane.OK_CANCEL_OPTION:
- case JOptionPane.DEFAULT_OPTION:
- return new Object[] { OK_STRING, CANCEL_STRING };
- }
- return null;
- }
-
- /**
- * This method will return the icon the user has set or the icon that will
- * be used based on message type.
- *
- * @return The icon to use in the JOptionPane.
- */
- protected Icon getIcon()
- {
- if (optionPane.getIcon() != null)
- return optionPane.getIcon();
- else
- return getIconForType(optionPane.getMessageType());
- }
-
- /**
- * This method returns the icon for the given messageType.
- *
- * @param messageType The type of message.
- *
- * @return The icon for the given messageType.
- */
- protected Icon getIconForType(int messageType)
- {
- Icon tmp = null;
- switch (messageType)
- {
- case JOptionPane.ERROR_MESSAGE:
- tmp = errorIcon;
- break;
- case JOptionPane.INFORMATION_MESSAGE:
- tmp = infoIcon;
- break;
- case JOptionPane.WARNING_MESSAGE:
- tmp = warningIcon;
- break;
- case JOptionPane.QUESTION_MESSAGE:
- tmp = questionIcon;
- break;
- }
- return tmp;
- // FIXME: Don't cast till the default icons are in.
- // return new IconUIResource(tmp);
- }
-
- /**
- * This method returns the index of the initialValue in the options array.
- *
- * @return The index of the initalValue.
- */
- protected int getInitialValueIndex()
- {
- Object[] buttons = getButtons();
-
- if (buttons == null)
- return -1;
-
- Object select = optionPane.getInitialValue();
-
- for (int i = 0; i < buttons.length; i++)
- {
- if (select == buttons[i])
- return i;
- }
- return 0;
- }
-
- /**
- * This method returns the maximum number of characters that should be
- * placed on a line.
- *
- * @return The maximum number of characteres that should be placed on a
- * line.
- */
- protected int getMaxCharactersPerLineCount()
- {
- return optionPane.getMaxCharactersPerLineCount();
- }
-
- /**
- * This method returns the maximum size.
- *
- * @param c The JComponent to measure.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the message of the JOptionPane.
- *
- * @return The message.
- */
- protected Object getMessage()
- {
- return optionPane.getMessage();
- }
-
- /**
- * This method returns the minimum size of the JOptionPane.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumOptionPaneSize()
- {
- return minimumSize;
- }
-
- /**
- * This method returns the minimum size.
- *
- * @param c The JComponent to measure.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the preferred size of the JOptionPane. The preferred
- * size is the maximum of the size desired by the layout and the minimum
- * size.
- *
- * @param c The JComponent to measure.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- Dimension d = optionPane.getLayout().preferredLayoutSize(optionPane);
- Dimension d2 = getMinimumOptionPaneSize();
-
- int w = Math.max(d.width, d2.width);
- int h = Math.max(d.height, d2.height);
- return new Dimension(w, h);
- }
-
- /**
- * This method returns whether all buttons should have the same width.
- *
- * @return Whether all buttons should have the same width.
- */
- protected boolean getSizeButtonsToSameWidth()
- {
- return true;
- }
-
- /**
- * This method installs components for the JOptionPane.
- */
- protected void installComponents()
- {
- // reset it.
- hasCustomComponents = false;
- Container msg = createMessageArea();
- if (msg != null)
- {
- ((JComponent) msg).setBorder(messageBorder);
- msg.setForeground(messageForeground);
- messageAreaContainer = msg;
- optionPane.add(msg);
- }
-
- Container sep = createSeparator();
- if (sep != null)
- optionPane.add(sep);
-
- Container button = createButtonArea();
- if (button != null)
- {
- ((JComponent) button).setBorder(buttonBorder);
- buttonContainer = button;
- optionPane.add(button);
- }
-
- optionPane.invalidate();
- }
-
- /**
- * This method installs defaults for the JOptionPane.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- optionPane.setFont(defaults.getFont("OptionPane.font"));
- optionPane.setBackground(defaults.getColor("OptionPane.background"));
- optionPane.setForeground(defaults.getColor("OptionPane.foreground"));
- optionPane.setBorder(defaults.getBorder("OptionPane.border"));
-
- messageBorder = defaults.getBorder("OptionPane.messageAreaBorder");
- messageForeground = defaults.getColor("OptionPane.messageForeground");
- buttonBorder = defaults.getBorder("OptionPane.buttonAreaBorder");
-
- minimumSize = defaults.getDimension("OptionPane.minimumSize");
- minimumWidth = minimumSize.width;
- minimumHeight = minimumSize.height;
-
- // FIXME: Image icons don't seem to work properly right now.
- // Once they do, replace the synthetic icons with these ones.
-
- /*
- warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon");
- infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon");
- errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon");
- questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon");
- */
- }
-
- /**
- * This method installs keyboard actions for the JOptionpane.
- */
- protected void installKeyboardActions()
- {
- // FIXME: implement.
- }
-
- /**
- * This method installs listeners for the JOptionPane.
- */
- protected void installListeners()
- {
- propertyChangeListener = createPropertyChangeListener();
-
- optionPane.addPropertyChangeListener(propertyChangeListener);
- }
-
- /**
- * This method installs the UI for the JOptionPane.
- *
- * @param c The JComponent to install the UI for.
- */
- public void installUI(JComponent c)
- {
- if (c instanceof JOptionPane)
- {
- optionPane = (JOptionPane) c;
-
- installDefaults();
- installComponents();
- installListeners();
- installKeyboardActions();
- }
- }
-
- /**
- * Changes the inputValue property in the JOptionPane based on the current
- * value of the inputComponent.
- */
- protected void resetInputValue()
- {
- if (optionPane.getWantsInput() && inputComponent != null)
- {
- Object output = null;
- if (inputComponent instanceof JTextField)
- output = ((JTextField) inputComponent).getText();
- else if (inputComponent instanceof JComboBox)
- output = ((JComboBox) inputComponent).getSelectedItem();
- else if (inputComponent instanceof JList)
- output = ((JList) inputComponent).getSelectedValue();
-
- if (output != null)
- optionPane.setInputValue(output);
- }
- }
-
- /**
- * This method requests focus to the inputComponent (if one is present) and
- * the initialFocusComponent otherwise.
- *
- * @param op The JOptionPane.
- */
- public void selectInitialValue(JOptionPane op)
- {
- if (inputComponent != null)
- {
- inputComponent.requestFocus();
- return;
- }
- if (initialFocusComponent != null)
- initialFocusComponent.requestFocus();
- }
-
- /**
- * This method resets the value in the inputComponent to the
- * initialSelectionValue property.
- * This is package-private to avoid an accessor method.
- */
- void resetSelectedValue()
- {
- if (inputComponent != null)
- {
- Object init = optionPane.getInitialSelectionValue();
- if (init == null)
- return;
- if (inputComponent instanceof JTextField)
- ((JTextField) inputComponent).setText((String) init);
- else if (inputComponent instanceof JComboBox)
- ((JComboBox) inputComponent).setSelectedItem(init);
- else if (inputComponent instanceof JList)
- {
- // ((JList) inputComponent).setSelectedValue(init, true);
- }
- }
- }
-
- /**
- * This method uninstalls all the components in the JOptionPane.
- */
- protected void uninstallComponents()
- {
- optionPane.removeAll();
- buttonContainer = null;
- messageAreaContainer = null;
- }
-
- /**
- * This method uninstalls the defaults for the JOptionPane.
- */
- protected void uninstallDefaults()
- {
- optionPane.setFont(null);
- optionPane.setForeground(null);
- optionPane.setBackground(null);
-
- minimumSize = null;
-
- messageBorder = null;
- buttonBorder = null;
- messageForeground = null;
-
- // FIXME: ImageIcons don't seem to work properly
-
- /*
- warningIcon = null;
- errorIcon = null;
- questionIcon = null;
- infoIcon = null;
- */
- }
-
- /**
- * This method uninstalls keyboard actions for the JOptionPane.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: implement.
- }
-
- /**
- * This method uninstalls listeners for the JOptionPane.
- */
- protected void uninstallListeners()
- {
- optionPane.removePropertyChangeListener(propertyChangeListener);
- propertyChangeListener = null;
- }
-
- /**
- * This method uninstalls the UI for the given JComponent.
- *
- * @param c The JComponent to uninstall for.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallKeyboardActions();
- uninstallListeners();
- uninstallComponents();
- uninstallDefaults();
-
- optionPane = null;
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicPanelUI.java b/libjava/javax/swing/plaf/basic/BasicPanelUI.java
deleted file mode 100644
index b644336d9cc..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicPanelUI.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* BasicPanelUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.PanelUI;
-
-public class BasicPanelUI extends PanelUI
-{
- public static ComponentUI createUI(JComponent x)
- {
- return new BasicPanelUI();
- }
-
- public void installUI(JComponent c)
- {
- super.installUI(c);
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicPasswordFieldUI.java b/libjava/javax/swing/plaf/basic/BasicPasswordFieldUI.java
deleted file mode 100644
index 044027b0b4a..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicPasswordFieldUI.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* BasicPasswordFieldUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.text.Element;
-import javax.swing.text.PasswordView;
-import javax.swing.text.View;
-
-public class BasicPasswordFieldUI extends BasicTextFieldUI
-{
- public BasicPasswordFieldUI()
- {
- }
-
- public View create(Element elem)
- {
- return new PasswordView(elem);
- }
-
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicPasswordFieldUI();
- }
-
- protected String getPropertyPrefix()
- {
- return "PasswordField";
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java b/libjava/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java
deleted file mode 100644
index b6294772286..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* BasicPopupMenuSeparatorUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-
-import javax.swing.JComponent;
-import javax.swing.JPopupMenu;
-import javax.swing.SwingUtilities;
-import javax.swing.plaf.ComponentUI;
-
-/**
- * The Basic Look and Feel UI delegate for JPopupMenu.Separator.
- */
-public class BasicPopupMenuSeparatorUI extends BasicSeparatorUI
-{
- /**
- * Creates a new BasicPopupMenuSeparatorUI object.
- */
- public BasicPopupMenuSeparatorUI()
- {
- super();
- }
-
- /**
- * Creates a new UI delegate for the given JComponent.
- *
- * @param c The JComponent to create a delegate for.
- *
- * @return A new BasicPopupMenuSeparatorUI
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicPopupMenuSeparatorUI();
- }
-
- /**
- * The Popup Menu Separator has two lines. The top line will be
- * painted using highlight color and the bottom using shadow color.
- *
- * @param g The Graphics object to paint with
- * @param c The JComponent to paint.
- */
- public void paint(Graphics g, JComponent c)
- {
- if (! (c instanceof JPopupMenu.Separator))
- return;
-
- Rectangle r = new Rectangle();
- SwingUtilities.calculateInnerArea(c, r);
- Color saved = g.getColor();
-
- int midAB = r.width / 2 + r.x;
- int midAD = r.height / 2 + r.y;
-
- g.setColor(highlight);
- g.drawLine(r.x, midAD, r.x + r.width, midAD);
-
- g.setColor(shadow);
- g.drawLine(r.x, midAD + 1, r.x + r.width, midAD + 1);
- }
-
- /**
- * This method returns the preferred size of the
- * JComponent.
- *
- * @param c The JComponent to measure.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- return super.getPreferredSize(c);
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicPopupMenuUI.java b/libjava/javax/swing/plaf/basic/BasicPopupMenuUI.java
deleted file mode 100644
index 8280d468c1b..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicPopupMenuUI.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/* BasicPopupMenuUI.java
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.GridBagLayout;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.MouseEvent;
-
-import javax.swing.JComponent;
-import javax.swing.JPopupMenu;
-import javax.swing.MenuElement;
-import javax.swing.MenuSelectionManager;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.MouseInputListener;
-import javax.swing.event.PopupMenuEvent;
-import javax.swing.event.PopupMenuListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.PopupMenuUI;
-
-
-/**
- * UI Delegate for JPopupMenu
- */
-public class BasicPopupMenuUI extends PopupMenuUI
-{
- /* popupMenu for which this UI delegate is for*/
- protected JPopupMenu popupMenu;
-
- /* MouseInputListener listens to mouse events */
- private static transient MouseInputListener mouseInputListener;
-
- /* PopupMenuListener listens to popup menu events fired by JPopupMenu*/
- private transient PopupMenuListener popupMenuListener;
-
- /* ComponentListener listening to popupMenu's invoker.
- * This is package-private to avoid an accessor method. */
- TopWindowListener topWindowListener;
-
- /**
- * Creates a new BasicPopupMenuUI object.
- */
- public BasicPopupMenuUI()
- {
- popupMenuListener = new PopupMenuHandler();
- mouseInputListener = new MouseInputHandler();
- topWindowListener = new TopWindowListener();
- }
-
- /**
- * Factory method to create a BasicPopupMenuUI for the given {@link
- * JComponent}, which should be a {@link JMenuItem}.
- *
- * @param x The {@link JComponent} a UI is being created for.
- *
- * @return A BasicPopupMenuUI for the {@link JComponent}.
- */
- public static ComponentUI createUI(JComponent x)
- {
- return new BasicPopupMenuUI();
- }
-
- /**
- * Installs and initializes all fields for this UI delegate. Any properties
- * of the UI that need to be initialized and/or set to defaults will be
- * done now. It will also install any listeners necessary.
- *
- * @param c The {@link JComponent} that is having this UI installed.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
- popupMenu = (JPopupMenu) c;
- popupMenu.setLayout(new GridBagLayout());
- popupMenu.setBorderPainted(true);
- JPopupMenu.setDefaultLightWeightPopupEnabled(true);
-
- installDefaults();
- installListeners();
- }
-
- /**
- * This method installs the defaults that are defined in the Basic look and
- * feel for this {@link JPopupMenu}.
- */
- public void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- popupMenu.setBackground(defaults.getColor("PopupMenu.background"));
- popupMenu.setBorder(defaults.getBorder("PopupMenu.border"));
- popupMenu.setFont(defaults.getFont("PopupMenu.font"));
- popupMenu.setForeground(defaults.getColor("PopupMenu.foreground"));
- popupMenu.setOpaque(true);
- }
-
- /**
- * This method installs the listeners for the {@link JMenuItem}.
- */
- protected void installListeners()
- {
- popupMenu.addMouseListener(mouseInputListener);
- popupMenu.addMouseMotionListener(mouseInputListener);
- popupMenu.addPopupMenuListener(popupMenuListener);
- }
-
- /**
- * This method installs the keyboard actions for this {@link JPopupMenu}.
- */
- protected void installKeyboardActions()
- {
- // FIXME: Need to implement
- }
-
- /**
- * Performs the opposite of installUI. Any properties or resources that need
- * to be cleaned up will be done now. It will also uninstall any listeners
- * it has. In addition, any properties of this UI will be nulled.
- *
- * @param c The {@link JComponent} that is having this UI uninstalled.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallListeners();
- uninstallDefaults();
- popupMenu = null;
- }
-
- /**
- * This method uninstalls the defaults and sets any objects created during
- * install to null
- */
- protected void uninstallDefaults()
- {
- popupMenu.setBackground(null);
- popupMenu.setBorder(null);
- popupMenu.setFont(null);
- popupMenu.setForeground(null);
- }
-
- /**
- * Unregisters all the listeners that this UI delegate was using.
- */
- protected void uninstallListeners()
- {
- popupMenu.removeMouseListener(mouseInputListener);
- popupMenu.removeMouseMotionListener(mouseInputListener);
- popupMenu.removePopupMenuListener(popupMenuListener);
- }
-
- /**
- * Uninstalls any keyboard actions.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: Need to implement
- }
-
- /**
- * This method returns the minimum size of the JPopupMenu.
- *
- * @param c The JComponent to find a size for.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return null;
- }
-
- /**
- * This method returns the preferred size of the JPopupMenu.
- *
- * @param c The JComponent to find a size for.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- return null;
- }
-
- /**
- * This method returns the minimum size of the JPopupMenu.
- *
- * @param c The JComponent to find a size for.
- *
- * @return The minimum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return null;
- }
-
- /**
- * Return true if given mouse event is a platform popup trigger, and false
- * otherwise
- *
- * @param e MouseEvent that is to be checked for popup trigger event
- *
- * @return true if given mouse event is a platform popup trigger, and false
- * otherwise
- */
- public boolean isPopupTrigger(MouseEvent e)
- {
- return false;
- }
-
- /**
- * This listener handles PopupMenuEvents fired by JPopupMenu
- */
- private class PopupMenuHandler implements PopupMenuListener
- {
- /**
- * This method is invoked when JPopupMenu is cancelled.
- *
- * @param event the PopupMenuEvent
- */
- public void popupMenuCanceled(PopupMenuEvent event)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.clearSelectedPath();
- }
-
- /**
- * This method is invoked when JPopupMenu becomes invisible
- *
- * @param event the PopupMenuEvent
- */
- public void popupMenuWillBecomeInvisible(PopupMenuEvent event)
- {
- // remove listener that listens to component events fired
- // by the top - level window that this popup belongs to.
- Component invoker = popupMenu.getInvoker();
-
- Container rootContainer = (Container) SwingUtilities.getRoot(invoker);
- rootContainer.removeComponentListener(topWindowListener);
- }
-
- /**
- * This method is invoked when JPopupMenu becomes visible
- *
- * @param event the PopupMenuEvent
- */
- public void popupMenuWillBecomeVisible(PopupMenuEvent event)
- {
- // Adds topWindowListener to top-level window to listener to
- // ComponentEvents fired by it. We need to cancel this popup menu
- // if topWindow to which this popup belongs was resized or moved.
- Component invoker = popupMenu.getInvoker();
- Container rootContainer = (Container) SwingUtilities.getRoot(invoker);
- rootContainer.addComponentListener(topWindowListener);
-
- // if this popup menu is a free floating popup menu,
- // then by default its first element should be always selected when
- // this popup menu becomes visible.
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
-
- if (manager.getSelectedPath().length == 0)
- {
- // Set selected path to point to the first item in the popup menu
- MenuElement[] path = new MenuElement[2];
- path[0] = popupMenu;
- Component[] comps = popupMenu.getComponents();
- if (comps.length != 0 && comps[0] instanceof MenuElement)
- {
- path[1] = (MenuElement) comps[0];
- manager.setSelectedPath(path);
- }
- }
- }
- }
-
- /**
- * ComponentListener that listens to Component Events fired by the top -
- * level window to which popup menu belongs. If top-level window was
- * resized, moved or hidded then popup menu will be hidded and selected
- * path of current menu hierarchy will be set to null.
- */
- private class TopWindowListener implements ComponentListener
- {
- /**
- * This method is invoked when top-level window is resized. This method
- * closes current menu hierarchy.
- *
- * @param e The ComponentEvent
- */
- public void componentResized(ComponentEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.clearSelectedPath();
- }
-
- /**
- * This method is invoked when top-level window is moved. This method
- * closes current menu hierarchy.
- *
- * @param e The ComponentEvent
- */
- public void componentMoved(ComponentEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.clearSelectedPath();
- }
-
- /**
- * This method is invoked when top-level window is shown This method does
- * nothing by default.
- *
- * @param e The ComponentEvent
- */
- public void componentShown(ComponentEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.clearSelectedPath();
- }
-
- /**
- * This method is invoked when top-level window is hidden This method
- * closes current menu hierarchy.
- *
- * @param e The ComponentEvent
- */
- public void componentHidden(ComponentEvent e)
- {
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.clearSelectedPath();
- }
- }
-
- private class MouseInputHandler implements MouseInputListener
- {
- public void mouseClicked(MouseEvent e)
- {
- }
-
- public void mouseDragged(MouseEvent e)
- {
- }
-
- public void mouseEntered(MouseEvent e)
- {
- }
-
- public void mouseExited(MouseEvent e)
- {
- }
-
- public void mouseMoved(MouseEvent e)
- {
- }
-
- public void mousePressed(MouseEvent e)
- {
- }
-
- public void mouseReleased(MouseEvent e)
- {
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java b/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java
deleted file mode 100644
index 705efe42dbd..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java
+++ /dev/null
@@ -1,825 +0,0 @@
-/* BasicProgressBarUI.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.JComponent;
-import javax.swing.JProgressBar;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.Timer;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.ProgressBarUI;
-
-/**
- * The Basic Look and Feel UI delegate for the
- * JProgressBar.
- */
-public class BasicProgressBarUI extends ProgressBarUI
-{
- /**
- * A helper class that listens for ChangeEvents
- * from the progressBar's model.
- */
- protected class ChangeHandler implements ChangeListener
- {
- /**
- * Called every time the state of the model changes.
- *
- * @param e The ChangeEvent given by the model.
- */
- public void stateChanged(ChangeEvent e)
- {
- // Nothing to do but repaint.
- progressBar.repaint();
- }
- }
-
- /**
- * This helper class is used to listen for
- * PropertyChangeEvents from the progressBar.
- */
- private class PropertyChangeHandler implements PropertyChangeListener
- {
- /**
- * Called every time the properties of the
- * progressBar change.
- *
- * @param e The PropertyChangeEvent given by the progressBar.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- // Only need to listen for indeterminate changes.
- // All other things are done on a repaint.
- if (e.getPropertyName().equals("inderterminate"))
- if (((Boolean) e.getNewValue()).booleanValue())
- startAnimationTimer();
- else
- stopAnimationTimer();
- else
- progressBar.repaint();
- }
- }
-
- /**
- * This helper class is used to listen for
- * the animationTimer's intervals. On every interval,
- * the bouncing box should move.
- */
- private class Animator implements ActionListener
- {
- /**
- * Called every time the animationTimer reaches
- * its interval.
- *
- * @param e The ActionEvent given by the timer.
- */
- public void actionPerformed(ActionEvent e)
- {
- // Incrementing the animation index will cause
- // a repaint.
- incrementAnimationIndex();
- }
- }
-
- /** The timer used to move the bouncing box. */
- private transient Timer animationTimer;
-
- // The total number of frames must be an even number.
- // The total number of frames is calculated from
- // the cycleTime and repaintInterval given by
- // the basic Look and Feel defaults.
- //
- // +-----------------------------------------------+
- // | frame0 | frame1 | frame2 | frame 3 | frame 4 |
- // | | frame7 | frame6 | frame 5 | |
- // +-----------------------------------------------+
-
- /** The current animation index. */
- private transient int animationIndex;
-
- /** The total number of frames.*/
- private transient int numFrames;
-
- /** The helper that moves the bouncing box. */
- private transient Animator animation;
-
- /** The helper that listens for property change events. */
- private transient PropertyChangeHandler propertyListener;
-
- /** The Listener for the model. */
- protected ChangeListener changeListener;
-
- /** The progressBar for this UI. */
- protected JProgressBar progressBar;
-
- /** The length of the cell. The cell is the painted part. */
- private transient int cellLength;
-
- /** The gap between cells. */
- private transient int cellSpacing;
-
- /** The color of the text when the bar is not over it.*/
- private transient Color selectionBackground;
-
- /** The color of the text when the bar is over it. */
- private transient Color selectionForeground;
-
- /**
- * Creates a new BasicProgressBarUI object.
- */
- public BasicProgressBarUI()
- {
- super();
- }
-
- /**
- * Creates a new BasicProgressBarUI for the component.
- *
- * @param x The JComponent to create the UI for.
- *
- * @return A new BasicProgressBarUI.
- */
- public static ComponentUI createUI(JComponent x)
- {
- return new BasicProgressBarUI();
- }
-
- /**
- * This method returns the length of the bar (from the minimum)
- * in pixels (or units that the Graphics object draws in) based
- * on the progressBar's getPercentComplete() value.
- *
- * @param b The insets of the progressBar.
- * @param width The width of the progressBar.
- * @param height The height of the progressBar.
- *
- * @return The length of the bar that should be painted in pixels.
- */
- protected int getAmountFull(Insets b, int width, int height)
- {
- double percentDone = progressBar.getPercentComplete();
- if (progressBar.getOrientation() == JProgressBar.HORIZONTAL)
- return (int) (percentDone * (width - b.left - b.right));
- else
- return (int) (percentDone * (height - b.top - b.bottom));
- }
-
- /**
- * The current animation index.
- *
- * @return The current animation index.
- */
- protected int getAnimationIndex()
- {
- return animationIndex;
- }
-
- /**
- * This method returns the size and position of the bouncing box
- * for the current animation index. It stores the values in the
- * given rectangle and returns it. It returns null if no box should
- * be drawn.
- *
- * @param r The bouncing box rectangle.
- *
- * @return The bouncing box rectangle.
- */
- protected Rectangle getBox(Rectangle r)
- {
- if (!progressBar.isIndeterminate())
- return null;
- //numFrames has to be an even number as defined by spec.
- int iterations = numFrames / 2 + 1;
-
- double boxDependent;
- double boxIndependent;
-
- if (progressBar.getOrientation() == JProgressBar.HORIZONTAL)
- {
- Dimension dims = getPreferredInnerHorizontal();
- boxDependent = (double) dims.width / iterations;
- boxIndependent = dims.height;
- }
- else
- {
- Dimension dims = getPreferredInnerVertical();
- boxDependent = (double) dims.height / iterations;
- boxIndependent = dims.width;
- }
-
- Rectangle vr = new Rectangle();
- SwingUtilities.calculateInnerArea(progressBar, vr);
-
- int index = getAnimationIndex();
- if (animationIndex > (numFrames + 1) / 2)
- index = numFrames - getAnimationIndex();
-
- if (progressBar.getOrientation() == JProgressBar.HORIZONTAL)
- {
- r.x = vr.x + (int) (index * boxDependent);
- r.y = vr.y;
- r.width = (int) boxDependent;
- r.height = (int) boxIndependent;
- }
- else
- {
- index++;
- r.x = vr.x;
- r.y = vr.height - (int) (index * boxDependent) + vr.y;
- r.width = (int) boxIndependent;
- r.height = (int) boxDependent;
- }
-
- return r;
- }
-
- /**
- * This method returns the length of the cells.
- *
- * @return The cell length.
- */
- protected int getCellLength()
- {
- return cellLength;
- }
-
- /**
- * This method returns the spacing between cells.
- *
- * @return The cell gap.
- */
- protected int getCellSpacing()
- {
- return cellSpacing;
- }
-
- /**
- * This method returns the maximum size of the JComponent.
- * If it returns null, it is up to the LayoutManager
- * to give it a size.
- *
- * @param c The component to find a maximum size for.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the minimum size of the JComponent.
- * If it returns null, it is up to the LayoutManager to
- * give it a size.
- *
- * @param c The component to find a minimum size for.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the preferred size of the inner
- * rectangle (the bounds without the insets) if the
- * progressBar is horizontal.
- *
- * @return The preferred size of the progressBar minus
- * insets if it's horizontal.
- */
- protected Dimension getPreferredInnerHorizontal()
- {
- Rectangle vr = new Rectangle();
-
- SwingUtilities.calculateInnerArea(progressBar, vr);
-
- return new Dimension(vr.width, vr.height);
- }
-
- /**
- * This method returns the preferred size of the inner
- * rectangle (the bounds without insets) if the
- * progressBar is vertical.
- *
- * @return The preferred size of the progressBar minus
- * insets if it's vertical.
- */
- protected Dimension getPreferredInnerVertical()
- {
- Rectangle vr = new Rectangle();
-
- SwingUtilities.calculateInnerArea(progressBar, vr);
-
- return new Dimension(vr.width, vr.height);
- }
-
- /**
- * This method returns the preferred size of the
- * given JComponent. If it returns null, then it
- * is up to the LayoutManager to give it a size.
- *
- * @param c The component to find the preferred size for.
- *
- * @return The preferred size of the component.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- // The only thing we need to worry about is
- // the text size.
- Graphics g = progressBar.getGraphics();
-
- Insets insets = c.getInsets();
-
- FontMetrics fm = g.getFontMetrics(c.getFont());
-
- int textW = fm.stringWidth(progressBar.getString());
- int textH = fm.getHeight();
-
- g.dispose();
-
- if (progressBar.getOrientation() == JProgressBar.HORIZONTAL)
- {
- if (textH < 20)
- textH = 20;
- if (textW < 200)
- textW = 200;
- }
- else
- {
- if (textH < 200)
- textH = 200;
- if (textW < 20)
- textW = 20;
- }
- textW += insets.left + insets.right;
- textH += insets.top + insets.bottom;
- return new Dimension(textW, textH);
- }
-
- /**
- * This method returns the Color that the text is shown in when the bar is
- * not over the text.
- *
- * @return The color of the text when the bar is not over it.
- */
- protected Color getSelectionBackground()
- {
- return selectionBackground;
- }
-
- /**
- * This method returns the Color that the text is shown in when the bar is
- * over the text.
- *
- * @return The color of the text when the bar is over it.
- */
- protected Color getSelectionForeground()
- {
- return selectionForeground;
- }
-
- /**
- * This method returns the point (the top left of the bounding box)
- * where the text should be painted.
- *
- * @param g The Graphics object to measure FontMetrics with.
- * @param progressString The string to paint.
- * @param x The x coordinate of the overall bounds box.
- * @param y The y coordinate of the overall bounds box.
- * @param width The width of the overall bounds box.
- * @param height The height of the overall bounds box.
- *
- * @return The top left of the bounding box where text should be painted.
- */
- protected Point getStringPlacement(Graphics g, String progressString, int x,
- int y, int width, int height)
- {
- Rectangle tr = new Rectangle();
- Rectangle vr = new Rectangle(x, y, width, height);
- Rectangle ir = new Rectangle();
-
- Font f = g.getFont();
- FontMetrics fm = g.getFontMetrics(f);
-
- SwingUtilities.layoutCompoundLabel(progressBar, fm, progressString, null,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER, vr, ir, tr, 0);
- return new Point(tr.x, tr.y);
- }
-
- /**
- * This method increments the animation index.
- */
- protected void incrementAnimationIndex()
- {
- animationIndex++;
- //numFrames is like string length, it should be named numFrames or something
- if (animationIndex >= numFrames)
- animationIndex = 0;
- progressBar.repaint();
- }
-
- /**
- * This method paints the progressBar. It delegates its responsibilities
- * to paintDeterminate and paintIndeterminate.
- *
- * @param g The Graphics object to paint with.
- * @param c The JComponent to paint.
- */
- public void paint(Graphics g, JComponent c)
- {
- if (! progressBar.isIndeterminate())
- paintDeterminate(g, c);
- else
- paintIndeterminate(g, c);
-
- if (progressBar.isBorderPainted())
- progressBar.getBorder().paintBorder(progressBar, g, 0, 0,
- progressBar.getWidth(),
- progressBar.getHeight());
- }
-
- /**
- * This method is called if the painting to be done is
- * for a determinate progressBar.
- *
- * @param g The Graphics object to paint with.
- * @param c The JComponent to paint.
- */
- protected void paintDeterminate(Graphics g, JComponent c)
- {
- Color saved = g.getColor();
- int space = getCellSpacing();
- int len = getCellLength();
- int max = progressBar.getMaximum();
- int min = progressBar.getMinimum();
- int value = progressBar.getValue();
-
- Rectangle vr = new Rectangle();
- SwingUtilities.calculateInnerArea(c, vr);
-
- Rectangle or = c.getBounds();
-
- Insets insets = c.getInsets();
-
- int amountFull = getAmountFull(insets, or.width, or.height);
-
- g.setColor(c.getBackground());
- g.fill3DRect(vr.x, vr.y, vr.width, vr.height, false);
-
- if (max != min && len != 0 && value > min)
- {
- int iterations = value / (space + len);
-
- if (progressBar.getOrientation() == JProgressBar.HORIZONTAL)
- {
- double spaceInUnits = space * (double) vr.width / (max - min);
- double lenInUnits = len * (double) vr.width / (max - min);
- double currX = vr.x;
-
- g.setColor(c.getForeground());
- g.fill3DRect(vr.x, vr.y, amountFull, vr.height, true);
-
- g.setColor(c.getBackground());
- if (spaceInUnits != 0)
- {
- for (int i = 0; i < iterations; i++)
- {
- currX += lenInUnits;
- g.fill3DRect((int) currX, vr.y, (int) spaceInUnits,
- vr.height, true);
- currX += spaceInUnits;
- }
- }
- }
- else
- {
- double currY = vr.y;
- double spaceInUnits = space * (double) vr.height / (max - min);
- double lenInUnits = len * (double) vr.height / (max - min);
-
- g.setColor(c.getForeground());
- g.fill3DRect(vr.x, vr.y + vr.height - amountFull, vr.width,
- amountFull, true);
-
- g.setColor(c.getBackground());
-
- if (spaceInUnits != 0)
- {
- for (int i = 0; i < iterations; i++)
- {
- currY -= lenInUnits + spaceInUnits;
- g.fill3DRect(vr.x, (int) currY, vr.width,
- (int) spaceInUnits, true);
- }
- }
- }
- }
-
- if (progressBar.isStringPainted() && !progressBar.getString().equals(""))
- paintString(g, 0, 0, or.width, or.height, amountFull, insets);
- g.setColor(saved);
- }
-
- /**
- * This method is called if the painting to be done is for
- * an indeterminate progressBar.
- *
- * @param g The Graphics object to paint with.
- * @param c The JComponent to paint.
- */
- protected void paintIndeterminate(Graphics g, JComponent c)
- {
- //need to paint the box at it's current position. no text is painted since
- //all we're doing is bouncing back and forth
- Color saved = g.getColor();
- Insets insets = c.getInsets();
-
- Rectangle or = c.getBounds();
- Rectangle vr = new Rectangle();
- SwingUtilities.calculateInnerArea(c, vr);
-
- g.setColor(c.getBackground());
- g.fill3DRect(vr.x, vr.y, vr.width, vr.height, false);
-
- Rectangle box = new Rectangle();
- getBox(box);
-
- g.setColor(c.getForeground());
- g.fill3DRect(box.x, box.y, box.width, box.height, true);
-
- if (progressBar.isStringPainted() && !progressBar.getString().equals(""))
- paintString(g, 0, 0, or.width, or.height,
- getAmountFull(insets, or.width, or.height), insets);
-
- g.setColor(saved);
- }
-
- /**
- * This method paints the string for the progressBar.
- *
- * @param g The Graphics object to paint with.
- * @param x The x coordinate of the progressBar.
- * @param y The y coordinate of the progressBar.
- * @param width The width of the progressBar.
- * @param height The height of the progressBar.
- * @param amountFull The amount of the progressBar that has its bar filled.
- * @param b The insets of the progressBar.
- */
- protected void paintString(Graphics g, int x, int y, int width, int height,
- int amountFull, Insets b)
- {
- // We want to place in the exact center of the bar.
- Point placement = getStringPlacement(g, progressBar.getString(),
- x + b.left, y + b.top,
- width - b.left - b.right,
- height - b.top - b.bottom);
- Color saved = g.getColor();
-
- // FIXME: The Color of the text should use selectionForeground and selectionBackground
- // but that can't be done right now, so we'll use white in the mean time.
- g.setColor(Color.WHITE);
-
- FontMetrics fm = g.getFontMetrics(progressBar.getFont());
-
- g.drawString(progressBar.getString(), placement.x,
- placement.y + fm.getAscent());
-
- g.setColor(saved);
- }
-
- /**
- * This method sets the current animation index. If the index
- * is greater than the number of frames, it resets to 0.
- *
- * @param newValue The new animation index.
- */
- protected void setAnimationIndex(int newValue)
- {
- animationIndex = (newValue <= numFrames) ? newValue : 0;
- progressBar.repaint();
- }
-
- /**
- * This method sets the cell length.
- *
- * @param cellLen The cell length.
- */
- protected void setCellLength(int cellLen)
- {
- cellLength = cellLen;
- }
-
- /**
- * This method sets the cell spacing.
- *
- * @param cellSpace The cell spacing.
- */
- protected void setCellSpacing(int cellSpace)
- {
- cellSpacing = cellSpace;
- }
-
- /**
- * This method starts the animation timer. It is called
- * when the propertyChangeListener detects that the progressBar
- * has changed to indeterminate mode.
- *
- * @since 1.4
- */
- protected void startAnimationTimer()
- {
- if (animationTimer != null)
- animationTimer.start();
- }
-
- /**
- * This method stops the animation timer. It is called when
- * the propertyChangeListener detects that the progressBar
- * has changed to determinate mode.
- *
- * @since 1.4
- */
- protected void stopAnimationTimer()
- {
- if (animationTimer != null)
- animationTimer.stop();
- setAnimationIndex(0);
- }
-
- /**
- * This method changes the settings for the progressBar to
- * the defaults provided by the current Look and Feel.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- progressBar.setFont(defaults.getFont("ProgressBar.font"));
- progressBar.setForeground(defaults.getColor("ProgressBar.foreground"));
- progressBar.setBackground(defaults.getColor("ProgressBar.background"));
- progressBar.setBorder(defaults.getBorder("ProgressBar.border"));
- progressBar.setOpaque(true);
-
- selectionForeground = defaults.getColor("ProgressBar.selectionForeground");
- selectionBackground = defaults.getColor("ProgressBar.selectionBackground");
- cellLength = defaults.getInt("ProgressBar.cellLength");
- cellSpacing = defaults.getInt("ProgressBar.cellSpacing");
-
- int repaintInterval = defaults.getInt("ProgressBar.repaintInterval");
- int cycleTime = defaults.getInt("ProgressBar.cycleTime");
-
- if (cycleTime % repaintInterval != 0
- && (cycleTime / repaintInterval) % 2 != 0)
- {
- int div = (cycleTime / repaintInterval) + 2;
- div /= 2;
- div *= 2;
- cycleTime = div * repaintInterval;
- }
- setAnimationIndex(0);
- numFrames = cycleTime / repaintInterval;
- animationTimer.setDelay(repaintInterval);
- }
-
- /**
- * The method uninstalls any defaults that were
- * set by the current Look and Feel.
- */
- protected void uninstallDefaults()
- {
- progressBar.setFont(null);
- progressBar.setForeground(null);
- progressBar.setBackground(null);
-
- selectionForeground = null;
- selectionBackground = null;
- }
-
- /**
- * This method registers listeners to all the
- * components that this UI delegate needs to listen to.
- */
- protected void installListeners()
- {
- changeListener = new ChangeHandler();
- propertyListener = new PropertyChangeHandler();
- animation = new Animator();
-
- progressBar.addChangeListener(changeListener);
- progressBar.addPropertyChangeListener(propertyListener);
- animationTimer.addActionListener(animation);
- }
-
- /**
- * This method unregisters listeners to all the
- * components that were listened to.
- */
- protected void uninstallListeners()
- {
- progressBar.removeChangeListener(changeListener);
- progressBar.removePropertyChangeListener(propertyListener);
- animationTimer.removeActionListener(animation);
-
- changeListener = null;
- propertyListener = null;
- animation = null;
- }
-
- /**
- * This method installs the UI for the given JComponent.
- * This includes setting up defaults and listeners as
- * well as initializing any values or objects that
- * the UI may need.
- *
- * @param c The JComponent that is having this UI installed.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
- if (c instanceof JProgressBar)
- {
- progressBar = (JProgressBar) c;
-
- animationTimer = new Timer(200, null);
- animationTimer.setRepeats(true);
-
- installDefaults();
- installListeners();
- }
- }
-
- /**
- * This method removes the UI for the given JComponent.
- * This includes removing any listeners or defaults
- * that the installUI may have set up.
- *
- * @param c The JComponent that is having this UI uninstalled.
- */
- public void uninstallUI(JComponent c)
- {
- super.uninstallUI(c);
- uninstallListeners();
- uninstallDefaults();
-
- animationTimer = null;
- progressBar = null;
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java b/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
deleted file mode 100644
index d5cd7f4488e..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* BasicRadioButtonMenuItemUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.event.MouseEvent;
-
-import javax.swing.JComponent;
-import javax.swing.JMenuItem;
-import javax.swing.MenuElement;
-import javax.swing.MenuSelectionManager;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-
-/**
- * UI Delegator for JRadioButtonMenuItem
- */
-public class BasicRadioButtonMenuItemUI extends BasicMenuItemUI
-{
- /**
- * Creates a new BasicRadioButtonMenuItemUI object.
- */
- public BasicRadioButtonMenuItemUI()
- {
- super();
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- checkIcon = defaults.getIcon("RadioButtonMenuItem.checkIcon");
- }
-
- /**
- * Factory method to create a BasicRadioButtonMenuItemUI for the given {@link
- * JComponent}, which should be a JRadioButtonMenuItem.
- *
- * @param b The {@link JComponent} a UI is being created for.
- *
- * @return A BasicRadioButtonMenuItemUI for the {@link JComponent}.
- */
- public static ComponentUI createUI(JComponent b)
- {
- return new BasicRadioButtonMenuItemUI();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return $returnType$ DOCUMENT ME!
- */
- protected String getPropertyPrefix()
- {
- return null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param item DOCUMENT ME!
- * @param e DOCUMENT ME!
- * @param path DOCUMENT ME!
- * @param manager DOCUMENT ME!
- */
- public void processMouseEvent(JMenuItem item, MouseEvent e,
- MenuElement[] path,
- MenuSelectionManager manager)
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicRadioButtonUI.java b/libjava/javax/swing/plaf/basic/BasicRadioButtonUI.java
deleted file mode 100644
index 38e117b18b2..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicRadioButtonUI.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* BasicRadioButtonUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import javax.swing.AbstractButton;
-import javax.swing.Icon;
-import javax.swing.JComponent;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-
-public class BasicRadioButtonUI extends BasicToggleButtonUI
-{
-
- protected Icon icon;
-
- public static ComponentUI createUI(final JComponent c) {
- return new BasicRadioButtonUI();
- }
-
- public BasicRadioButtonUI()
- {
- icon = getDefaultIcon();
- }
-
- public void installUI(final JComponent c) {
- super.installUI(c);
- if (c instanceof AbstractButton)
- {
- AbstractButton b = (AbstractButton) c;
- b.setIcon(icon);
- }
- }
-
- public Icon getDefaultIcon()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- return defaults.getIcon("RadioButton.icon");
- }
-
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java b/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java
deleted file mode 100644
index f71e63f010d..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* BasicPanelUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.JComponent;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.RootPaneUI;
-
-public class BasicRootPaneUI extends RootPaneUI
- implements PropertyChangeListener
-{
- public static ComponentUI createUI(JComponent x)
- {
- return new BasicRootPaneUI();
- }
-
- public void installUI(JComponent c)
- {
- c.setOpaque(true);
- c.setBackground(UIManager.getColor("control"));
- super.installUI(c);
- }
-
- public void propertyChange(PropertyChangeEvent event)
- {
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java b/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java
deleted file mode 100644
index c3531232051..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java
+++ /dev/null
@@ -1,1277 +0,0 @@
-/* BasicScrollBarUI.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.Point;
-import java.awt.Polygon;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseMotionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.BoundedRangeModel;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JScrollBar;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.Timer;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.ScrollBarUI;
-
-/**
- * The Basic Look and Feel UI delegate for JScrollBar.
- */
-public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
- SwingConstants
-{
- /**
- * A helper class that listens to the two JButtons on each end of the
- * JScrollBar.
- */
- protected class ArrowButtonListener extends MouseAdapter
- {
- /**
- * Move the thumb in the direction specified by the button's arrow. If
- * this button is held down, then it should keep moving the thumb.
- *
- * @param e The MouseEvent fired by the JButton.
- */
- public void mousePressed(MouseEvent e)
- {
- scrollTimer.stop();
- scrollListener.setScrollByBlock(false);
- if (e.getSource() == incrButton)
- scrollListener.setDirection(POSITIVE_SCROLL);
- else
- scrollListener.setDirection(NEGATIVE_SCROLL);
- scrollTimer.start();
- }
-
- /**
- * Stops the thumb when the JButton is released.
- *
- * @param e The MouseEvent fired by the JButton.
- */
- public void mouseReleased(MouseEvent e)
- {
- scrollTimer.stop();
- }
- }
-
- /**
- * A helper class that listens to the ScrollBar's model for ChangeEvents.
- */
- protected class ModelListener implements ChangeListener
- {
- /**
- * Called when the model changes.
- *
- * @param e The ChangeEvent fired by the model.
- */
- public void stateChanged(ChangeEvent e)
- {
- // System.err.println(this + ".stateChanged()");
- calculatePreferredSize();
- layoutContainer(scrollbar);
- getThumbBounds();
- scrollbar.repaint();
- }
- }
-
- /**
- * A helper class that listens to the ScrollBar's properties.
- */
- public class PropertyChangeHandler implements PropertyChangeListener
- {
- /**
- * Called when one of the ScrollBar's properties change.
- *
- * @param e The PropertyChangeEvent fired by the ScrollBar.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getPropertyName().equals("model"))
- {
- ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener);
- scrollbar.getModel().addChangeListener(modelListener);
- getThumbBounds();
- }
- else if (e.getPropertyName().equals("orientation"))
- {
- incrButton.removeMouseListener(buttonListener);
- decrButton.removeMouseListener(buttonListener);
- int orientation = scrollbar.getOrientation();
- switch (orientation)
- {
- case (JScrollBar.HORIZONTAL):
- incrButton = createIncreaseButton(EAST);
- decrButton = createDecreaseButton(WEST);
- break;
- default:
- incrButton = createIncreaseButton(SOUTH);
- decrButton = createDecreaseButton(NORTH);
- break;
- }
- incrButton.addMouseListener(buttonListener);
- decrButton.addMouseListener(buttonListener);
- calculatePreferredSize();
- layoutContainer(scrollbar);
- }
- layoutContainer(scrollbar);
- scrollbar.repaint();
- }
- }
-
- /**
- * A helper class that listens for events from the timer that is used to
- * move the thumb.
- */
- protected class ScrollListener implements ActionListener
- {
- /** The direction the thumb moves in. */
- private transient int direction;
-
- /** Whether movement will be in blocks. */
- private transient boolean block;
-
- /**
- * Creates a new ScrollListener object. The default is scrolling
- * positively with block movement.
- */
- public ScrollListener()
- {
- direction = POSITIVE_SCROLL;
- block = true;
- }
-
- /**
- * Creates a new ScrollListener object using the given direction and
- * block.
- *
- * @param dir The direction to move in.
- * @param block Whether movement will be in blocks.
- */
- public ScrollListener(int dir, boolean block)
- {
- direction = dir;
- this.block = block;
- }
-
- /**
- * Sets the direction to scroll in.
- *
- * @param direction The direction to scroll in.
- */
- public void setDirection(int direction)
- {
- this.direction = direction;
- }
-
- /**
- * Sets whether scrolling will be done in blocks.
- *
- * @param block Whether scrolling will be in blocks.
- */
- public void setScrollByBlock(boolean block)
- {
- this.block = block;
- }
-
- /**
- * Called every time the timer reaches its interval.
- *
- * @param e The ActionEvent fired by the timer.
- */
- public void actionPerformed(ActionEvent e)
- {
- if (block)
- {
- // Only need to check it if it's block scrolling
- // We only block scroll if the click occurs
- // in the track.
- if (! trackListener.shouldScroll(direction))
- {
- trackHighlight = NO_HIGHLIGHT;
- scrollbar.repaint();
- return;
- }
- scrollByBlock(direction);
- }
- else
- scrollByUnit(direction);
- }
- }
-
- /**
- * Helper class that listens for movement on the track.
- */
- protected class TrackListener extends MouseAdapter
- implements MouseMotionListener
- {
- /** The current X coordinate of the mouse. */
- protected int currentMouseX;
-
- /** The current Y coordinate of the mouse. */
- protected int currentMouseY;
-
- /**
- * The offset between the current mouse cursor and the current value of
- * the scrollbar.
- */
- protected int offset;
-
- /**
- * This method is called when the mouse is being dragged.
- *
- * @param e The MouseEvent given.
- */
- public void mouseDragged(MouseEvent e)
- {
- currentMouseX = e.getX();
- currentMouseY = e.getY();
- if (scrollbar.getValueIsAdjusting())
- {
- int value;
- if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL)
- value = valueForXPosition(currentMouseX) - offset;
- else
- value = valueForYPosition(currentMouseY) - offset;
-
- scrollbar.setValue(value);
- }
- }
-
- /**
- * This method is called when the mouse is moved.
- *
- * @param e The MouseEvent given.
- */
- public void mouseMoved(MouseEvent e)
- {
- // Not interested in where the mouse
- // is unless it is being dragged.
- }
-
- /**
- * This method is called when the mouse is pressed. When it is pressed,
- * the thumb should move in blocks towards the cursor.
- *
- * @param e The MouseEvent given.
- */
- public void mousePressed(MouseEvent e)
- {
- currentMouseX = e.getX();
- currentMouseY = e.getY();
-
- int value;
- if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL)
- value = valueForXPosition(currentMouseX);
- else
- value = valueForYPosition(currentMouseY);
-
- if (value == scrollbar.getValue())
- return;
-
- if (! thumbRect.contains(e.getPoint()))
- {
- scrollTimer.stop();
- scrollListener.setScrollByBlock(true);
- if (value > scrollbar.getValue())
- {
- trackHighlight = INCREASE_HIGHLIGHT;
- scrollListener.setDirection(POSITIVE_SCROLL);
- }
- else
- {
- trackHighlight = DECREASE_HIGHLIGHT;
- scrollListener.setDirection(NEGATIVE_SCROLL);
- }
- scrollTimer.start();
- }
- else
- {
- // We'd like to keep track of where the cursor
- // is inside the thumb.
- // This works because the scrollbar's value represents
- // "lower" edge of the thumb. The value at which
- // the cursor is at must be greater or equal
- // to that value.
- scrollbar.setValueIsAdjusting(true);
- offset = value - scrollbar.getValue();
- }
- scrollbar.repaint();
- }
-
- /**
- * This method is called when the mouse is released. It should stop
- * movement on the thumb
- *
- * @param e The MouseEvent given.
- */
- public void mouseReleased(MouseEvent e)
- {
- trackHighlight = NO_HIGHLIGHT;
- scrollTimer.stop();
-
- if (scrollbar.getValueIsAdjusting())
- scrollbar.setValueIsAdjusting(false);
- scrollbar.repaint();
- }
-
- /**
- * A helper method that decides whether we should keep scrolling in the
- * given direction.
- *
- * @param direction The direction to check for.
- *
- * @return Whether the thumb should keep scrolling.
- */
- public boolean shouldScroll(int direction)
- {
- int value;
- if (scrollbar.getOrientation() == HORIZONTAL)
- value = valueForXPosition(currentMouseX);
- else
- value = valueForYPosition(currentMouseY);
-
- if (direction == POSITIVE_SCROLL)
- return (value > scrollbar.getValue());
- else
- return (value < scrollbar.getValue());
- }
- }
-
- /** The listener that listens to the JButtons. */
- protected ArrowButtonListener buttonListener;
-
- /** The listener that listens to the model. */
- protected ModelListener modelListener;
-
- /** The listener that listens to the scrollbar for property changes. */
- protected PropertyChangeListener propertyChangeListener;
-
- /** The listener that listens to the timer. */
- protected ScrollListener scrollListener;
-
- /** The listener that listens for MouseEvents on the track. */
- protected TrackListener trackListener;
-
- /** The JButton that decrements the scrollbar's value. */
- protected JButton decrButton;
-
- /** The JButton that increments the scrollbar's value. */
- protected JButton incrButton;
-
- /** The dimensions of the maximum thumb size. */
- protected Dimension maximumThumbSize;
-
- /** The dimensions of the minimum thumb size. */
- protected Dimension minimumThumbSize;
-
- /** The color of the thumb. */
- protected Color thumbColor;
-
- /** The outer shadow of the thumb. */
- protected Color thumbDarkShadowColor;
-
- /** The top and left edge color for the thumb. */
- protected Color thumbHighlightColor;
-
- /** The outer light shadow for the thumb. */
- protected Color thumbLightShadowColor;
-
- /** The color that is used when the mouse press occurs in the track. */
- protected Color trackHighlightColor;
-
- /** The color of the track. */
- protected Color trackColor;
-
- /** The size and position of the track. */
- protected Rectangle trackRect;
-
- /** The size and position of the thumb. */
- protected Rectangle thumbRect;
-
- /** Indicates that the decrease highlight should be painted. */
- protected static final int DECREASE_HIGHLIGHT = 1;
-
- /** Indicates that the increase highlight should be painted. */
- protected static final int INCREASE_HIGHLIGHT = 2;
-
- /** Indicates that no highlight should be painted. */
- protected static final int NO_HIGHLIGHT = 0;
-
- /** Indicates that the scrolling direction is positive. */
- private static final int POSITIVE_SCROLL = 1;
-
- /** Indicates that the scrolling direction is negative. */
- private static final int NEGATIVE_SCROLL = -1;
-
- /** The cached preferred size for the scrollbar. */
- private transient Dimension preferredSize;
-
- /** The current highlight status. */
- protected int trackHighlight;
-
- /** FIXME: Use this for something (presumably mouseDragged) */
- protected boolean isDragging;
-
- /** The timer used to move the thumb when the mouse is held. */
- protected Timer scrollTimer;
-
- /** The scrollbar this UI is acting for. */
- protected JScrollBar scrollbar;
-
- /**
- * This method adds a component to the layout.
- *
- * @param name The name to associate with the component that is added.
- * @param child The Component to add.
- */
- public void addLayoutComponent(String name, Component child)
- {
- // You should not be adding stuff to this component.
- // The contents are fixed.
- }
-
- /**
- * This method configures the scrollbar's colors. This can be done by
- * looking up the standard colors from the Look and Feel defaults.
- */
- protected void configureScrollBarColors()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- trackColor = defaults.getColor("ScrollBar.track");
- trackHighlightColor = defaults.getColor("ScrollBar.trackHighlight");
- thumbColor = defaults.getColor("ScrollBar.thumb");
- thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight");
- thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow");
- thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow");
- }
-
- /**
- * This method creates an ArrowButtonListener.
- *
- * @return A new ArrowButtonListener.
- */
- protected ArrowButtonListener createArrowButtonListener()
- {
- return new ArrowButtonListener();
- }
-
- /**
- * This method creates a new JButton with the appropriate icon for the
- * orientation.
- *
- * @param orientation The orientation this JButton uses.
- *
- * @return The increase JButton.
- */
- protected JButton createIncreaseButton(int orientation)
- {
- if (incrButton == null)
- incrButton = new BasicArrowButton(orientation);
- else
- ((BasicArrowButton) incrButton).setDirection(orientation);
- return incrButton;
- }
-
- /**
- * This method creates a new JButton with the appropriate icon for the
- * orientation.
- *
- * @param orientation The orientation this JButton uses.
- *
- * @return The decrease JButton.
- */
- protected JButton createDecreaseButton(int orientation)
- {
- if (decrButton == null)
- decrButton = new BasicArrowButton(orientation);
- else
- ((BasicArrowButton) decrButton).setDirection(orientation);
- return decrButton;
- }
-
- /**
- * This method creates a new ModelListener.
- *
- * @return A new ModelListener.
- */
- protected ModelListener createModelListener()
- {
- return new ModelListener();
- }
-
- /**
- * This method creates a new PropertyChangeListener.
- *
- * @return A new PropertyChangeListener.
- */
- protected PropertyChangeListener createPropertyChangeListener()
- {
- return new PropertyChangeHandler();
- }
-
- /**
- * This method creates a new ScrollListener.
- *
- * @return A new ScrollListener.
- */
- protected ScrollListener createScrollListener()
- {
- return new ScrollListener();
- }
-
- /**
- * This method creates a new TrackListener.
- *
- * @return A new TrackListener.
- */
- protected TrackListener createTrackListener()
- {
- return new TrackListener();
- }
-
- /**
- * This method returns a new BasicScrollBarUI.
- *
- * @param c The JComponent to create a UI for.
- *
- * @return A new BasicScrollBarUI.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicScrollBarUI();
- }
-
- /**
- * This method returns the maximum size for this JComponent.
- *
- * @param c The JComponent to measure the maximum size for.
- *
- * @return The maximum size for the component.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the maximum thumb size.
- *
- * @return The maximum thumb size.
- */
- protected Dimension getMaximumThumbSize()
- {
- return maximumThumbSize;
- }
-
- /**
- * This method returns the minimum size for this JComponent.
- *
- * @param c The JComponent to measure the minimum size for.
- *
- * @return The minimum size for the component.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the minimum thumb size.
- *
- * @return The minimum thumb size.
- */
- protected Dimension getMinimumThumbSize()
- {
- return minimumThumbSize;
- }
-
- /**
- * This method calculates the preferred size since calling
- * getPreferredSize() returns a cached value.
- * This is package-private to avoid an accessor method.
- */
- void calculatePreferredSize()
- {
- // System.err.println(this + ".calculatePreferredSize()");
- int height;
- int width;
- height = width = 0;
-
- if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL)
- {
- width += incrButton.getPreferredSize().getWidth();
- width += decrButton.getPreferredSize().getWidth();
-
- width += (scrollbar.getMaximum() - scrollbar.getMinimum());
-
- height = Math.max(incrButton.getPreferredSize().height,
- decrButton.getPreferredSize().height);
- height = Math.max(getMinimumThumbSize().height, height);
- height = Math.max(20, height);
- height = Math.min(getMaximumThumbSize().height, height);
- }
- else
- {
- height += incrButton.getPreferredSize().getHeight();
- height += decrButton.getPreferredSize().getHeight();
-
- height += (scrollbar.getMaximum() - scrollbar.getMinimum());
-
- width = Math.max(incrButton.getPreferredSize().width,
- decrButton.getPreferredSize().width);
- width = Math.max(getMinimumThumbSize().width, width);
- width = Math.max(20, width);
- width = Math.min(getMaximumThumbSize().width, width);
- }
-
- Insets insets = scrollbar.getInsets();
-
- height += insets.top + insets.bottom;
- width += insets.left + insets.right;
-
- preferredSize = new Dimension(width, height);
- }
-
- /**
- * This method returns a cached value of the preferredSize. The only
- * restrictions are: If the scrollbar is horizontal, the height should be
- * the maximum of the height of the JButtons and the minimum width of the
- * thumb. For vertical scrollbars, the calculation is similar (swap width
- * for height and vice versa).
- *
- * @param c The JComponent to measure.
- *
- * @return The preferredSize.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- calculatePreferredSize();
- return preferredSize;
- }
-
- /**
- * This method returns the thumb's bounds based on the current value of the
- * scrollbar. This method updates the cached value and returns that.
- *
- * @return The thumb bounds.
- */
- protected Rectangle getThumbBounds()
- {
- int max = scrollbar.getMaximum();
- int min = scrollbar.getMinimum();
- int value = scrollbar.getValue();
- int extent = scrollbar.getVisibleAmount();
-
- // System.err.println(this + ".getThumbBounds()");
- if (max == min)
- {
- thumbRect.x = trackRect.x;
- thumbRect.y = trackRect.y;
- if (scrollbar.getOrientation() == HORIZONTAL)
- {
- thumbRect.width = getMinimumThumbSize().width;
- thumbRect.height = trackRect.height;
- }
- else
- {
- thumbRect.width = trackRect.width;
- thumbRect.height = getMinimumThumbSize().height;
- }
- return thumbRect;
- }
-
- if (scrollbar.getOrientation() == HORIZONTAL)
- {
- thumbRect.x = trackRect.x;
- thumbRect.x += (value - min) * trackRect.width / (max - min);
- thumbRect.y = trackRect.y;
-
- thumbRect.width = Math.max(extent * trackRect.width / (max - min),
- getMinimumThumbSize().width);
- thumbRect.height = trackRect.height;
- }
- else
- {
- thumbRect.x = trackRect.x;
- thumbRect.y = trackRect.y + value * trackRect.height / (max - min);
-
- thumbRect.width = trackRect.width;
- thumbRect.height = Math.max(extent * trackRect.height / (max - min),
- getMinimumThumbSize().height);
- }
- return thumbRect;
- }
-
- /**
- * This method calculates the bounds of the track. This method updates the
- * cached value and returns it.
- *
- * @return The track's bounds.
- */
- protected Rectangle getTrackBounds()
- {
- SwingUtilities.calculateInnerArea(scrollbar, trackRect);
-
- if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL)
- {
- trackRect.width -= incrButton.getPreferredSize().getWidth();
- trackRect.width -= decrButton.getPreferredSize().getWidth();
-
- trackRect.x += decrButton.getPreferredSize().getWidth();
- }
- else
- {
- trackRect.height -= incrButton.getPreferredSize().getHeight();
- trackRect.height -= decrButton.getPreferredSize().getHeight();
-
- trackRect.y += incrButton.getPreferredSize().getHeight();
- }
- return trackRect;
- }
-
- /**
- * This method installs any addition Components that are a part of or
- * related to this scrollbar.
- */
- protected void installComponents()
- {
- int orientation = scrollbar.getOrientation();
- switch (orientation)
- {
- case (JScrollBar.HORIZONTAL):
- incrButton = createIncreaseButton(EAST);
- decrButton = createDecreaseButton(WEST);
- break;
- default:
- incrButton = createIncreaseButton(SOUTH);
- decrButton = createDecreaseButton(NORTH);
- break;
- }
- scrollbar.add(incrButton);
- scrollbar.add(decrButton);
- }
-
- /**
- * This method installs the defaults for the scrollbar specified by the
- * Basic Look and Feel.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- scrollbar.setForeground(defaults.getColor("ScrollBar.foreground"));
- scrollbar.setBackground(defaults.getColor("ScrollBar.background"));
- scrollbar.setBorder(defaults.getBorder("ScrollBar.border"));
- scrollbar.setOpaque(true);
-
- thumbColor = defaults.getColor("ScrollBar.thumb");
- thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow");
- thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight");
- thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow");
-
- maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize");
- minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize");
- }
-
- /**
- * This method installs the keyboard actions for the scrollbar.
- */
- protected void installKeyboardActions()
- {
- // FIXME: implement.
- }
-
- /**
- * This method installs any listeners for the scrollbar. This method also
- * installs listeners for things such as the JButtons and the timer.
- */
- protected void installListeners()
- {
- scrollListener = createScrollListener();
- trackListener = createTrackListener();
- buttonListener = createArrowButtonListener();
- modelListener = createModelListener();
- propertyChangeListener = createPropertyChangeListener();
-
- scrollbar.addMouseMotionListener(trackListener);
- scrollbar.addMouseListener(trackListener);
-
- incrButton.addMouseListener(buttonListener);
- decrButton.addMouseListener(buttonListener);
-
- scrollbar.addPropertyChangeListener(propertyChangeListener);
- scrollbar.getModel().addChangeListener(modelListener);
-
- scrollTimer.addActionListener(scrollListener);
- }
-
- /**
- * This method installs the UI for the component. This can include setting
- * up listeners, defaults, and components. This also includes initializing
- * any data objects.
- *
- * @param c The JComponent to install.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
- if (c instanceof JScrollBar)
- {
- scrollbar = (JScrollBar) c;
-
- trackRect = new Rectangle();
- thumbRect = new Rectangle();
-
- scrollTimer = new Timer(200, null);
- scrollTimer.setRepeats(true);
-
- installComponents();
- installDefaults();
- configureScrollBarColors();
- installListeners();
-
- calculatePreferredSize();
- layoutContainer(scrollbar);
- }
- }
-
- /**
- * This method lays out the scrollbar.
- *
- * @param scrollbarContainer The Container to layout.
- */
- public void layoutContainer(Container scrollbarContainer)
- {
- if (scrollbarContainer instanceof JScrollBar)
- {
- if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL)
- layoutHScrollbar((JScrollBar) scrollbarContainer);
- else
- layoutVScrollbar((JScrollBar) scrollbarContainer);
- }
- }
-
- /**
- * This method lays out the scrollbar horizontally.
- *
- * @param sb The JScrollBar to layout.
- */
- protected void layoutHScrollbar(JScrollBar sb)
- {
- // All we have to do is layout the 2 buttons?
- Rectangle vr = new Rectangle();
- SwingUtilities.calculateInnerArea(scrollbar, vr);
-
- // Update the rectangles.
- getTrackBounds();
- getThumbBounds();
-
- Dimension incrDims = incrButton.getPreferredSize();
- Dimension decrDims = decrButton.getPreferredSize();
-
- decrButton.setBounds(vr.x, vr.y, decrDims.width, trackRect.height);
- incrButton.setBounds(trackRect.x + trackRect.width, vr.y, incrDims.width,
- trackRect.height);
- }
-
- /**
- * This method lays out the scrollbar vertically.
- *
- * @param sb The JScrollBar to layout.
- */
- protected void layoutVScrollbar(JScrollBar sb)
- {
- Rectangle vr = new Rectangle();
- SwingUtilities.calculateInnerArea(scrollbar, vr);
-
- // Update rectangles
- getTrackBounds();
- getThumbBounds();
-
- Dimension incrDims = incrButton.getPreferredSize();
- Dimension decrDims = decrButton.getPreferredSize();
-
- decrButton.setBounds(vr.x, vr.y, trackRect.width, decrDims.height);
- incrButton.setBounds(vr.x, trackRect.y + trackRect.height,
- trackRect.width, incrDims.height);
- }
-
- /**
- * This method returns the minimum size required for the layout.
- *
- * @param scrollbarContainer The Container that is laid out.
- *
- * @return The minimum size.
- */
- public Dimension minimumLayoutSize(Container scrollbarContainer)
- {
- return preferredLayoutSize(scrollbarContainer);
- }
-
- /**
- * This method is called when the component is painted.
- *
- * @param g The Graphics object to paint with.
- * @param c The JComponent to paint.
- */
- public void paint(Graphics g, JComponent c)
- {
- layoutContainer(scrollbar);
- paintTrack(g, c, getTrackBounds());
- paintThumb(g, c, getThumbBounds());
-
- if (trackHighlight == INCREASE_HIGHLIGHT)
- paintIncreaseHighlight(g);
- else if (trackHighlight == DECREASE_HIGHLIGHT)
- paintDecreaseHighlight(g);
- }
-
- /**
- * This method is called when repainting and the mouse is pressed in the
- * track. It paints the track below the thumb with the trackHighlight
- * color.
- *
- * @param g The Graphics object to paint with.
- */
- protected void paintDecreaseHighlight(Graphics g)
- {
- Color saved = g.getColor();
-
- g.setColor(trackHighlightColor);
- if (scrollbar.getOrientation() == HORIZONTAL)
- g.fillRect(trackRect.x, trackRect.y, thumbRect.x - trackRect.x,
- trackRect.height);
- else
- g.fillRect(trackRect.x, trackRect.y, trackRect.width,
- thumbRect.y - trackRect.y);
- g.setColor(saved);
- }
-
- /**
- * This method is called when repainting and the mouse is pressed in the
- * track. It paints the track above the thumb with the trackHighlight
- * color.
- *
- * @param g The Graphics objet to paint with.
- */
- protected void paintIncreaseHighlight(Graphics g)
- {
- Color saved = g.getColor();
-
- g.setColor(trackHighlightColor);
- if (scrollbar.getOrientation() == HORIZONTAL)
- g.fillRect(thumbRect.x + thumbRect.width, trackRect.y,
- trackRect.x + trackRect.width - thumbRect.x - thumbRect.width,
- trackRect.height);
- else
- g.fillRect(trackRect.x, thumbRect.y + thumbRect.height, trackRect.width,
- trackRect.y + trackRect.height - thumbRect.y
- - thumbRect.height);
- g.setColor(saved);
- }
-
- /**
- * This method paints the thumb.
- *
- * @param g The Graphics object to paint with.
- * @param c The Component that is being painted.
- * @param thumbBounds The thumb bounds.
- */
- protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
- {
- g.setColor(thumbColor);
- g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width,
- thumbBounds.height);
-
- BasicGraphicsUtils.drawBezel(g, thumbBounds.x, thumbBounds.y,
- thumbBounds.width, thumbBounds.height,
- false, false, thumbDarkShadowColor,
- thumbDarkShadowColor, thumbHighlightColor,
- thumbHighlightColor);
- }
-
- /**
- * This method paints the track.
- *
- * @param g The Graphics object to paint with.
- * @param c The JComponent being painted.
- * @param trackBounds The track's bounds.
- */
- protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
- {
- Color saved = g.getColor();
- g.setColor(trackColor);
- g.fill3DRect(trackBounds.x, trackBounds.y, trackBounds.width,
- trackBounds.height, false);
- g.setColor(saved);
- }
-
- /**
- * This method returns the preferred size for the layout.
- *
- * @param scrollbarContainer The Container to find a size for.
- *
- * @return The preferred size for the layout.
- */
- public Dimension preferredLayoutSize(Container scrollbarContainer)
- {
- if (scrollbarContainer instanceof JComponent)
- return getPreferredSize((JComponent) scrollbarContainer);
- else
- return null;
- }
-
- /**
- * This method removes a child component from the layout.
- *
- * @param child The child to remove.
- */
- public void removeLayoutComponent(Component child)
- {
- // You should not be removing stuff from this component.
- }
-
- /**
- * The method scrolls the thumb by a block in the direction specified.
- *
- * @param direction The direction to scroll.
- */
- protected void scrollByBlock(int direction)
- {
- scrollbar.setValue(scrollbar.getValue()
- + scrollbar.getBlockIncrement(direction));
- }
-
- /**
- * The method scrolls the thumb by a unit in the direction specified.
- *
- * @param direction The direction to scroll.
- */
- protected void scrollByUnit(int direction)
- {
- scrollbar.setValue(scrollbar.getValue()
- + scrollbar.getUnitIncrement(direction));
- }
-
- /**
- * This method sets the thumb's bounds.
- *
- * @param x The X position of the thumb.
- * @param y The Y position of the thumb.
- * @param width The width of the thumb.
- * @param height The height of the thumb.
- */
- protected void setThumbBounds(int x, int y, int width, int height)
- {
- thumbRect.x = x;
- thumbRect.y = y;
- thumbRect.width = width;
- thumbRect.height = height;
- }
-
- /**
- * This method uninstalls any components that are a part of or related to
- * this scrollbar.
- */
- protected void uninstallComponents()
- {
- scrollbar.remove(incrButton);
- scrollbar.remove(decrButton);
- incrButton = null;
- decrButton = null;
- }
-
- /**
- * This method uninstalls any defaults that this scrollbar acquired from the
- * Basic Look and Feel defaults.
- */
- protected void uninstallDefaults()
- {
- scrollbar.setForeground(null);
- scrollbar.setBackground(null);
- scrollbar.setBorder(null);
- }
-
- /**
- * This method uninstalls any keyboard actions this scrollbar acquired
- * during install.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: implement.
- }
-
- /**
- * This method uninstalls any listeners that were registered during install.
- */
- protected void uninstallListeners()
- {
- scrollTimer.removeActionListener(scrollListener);
-
- scrollbar.getModel().removeChangeListener(modelListener);
- scrollbar.removePropertyChangeListener(propertyChangeListener);
-
- decrButton.removeMouseListener(buttonListener);
- incrButton.removeMouseListener(buttonListener);
-
- scrollbar.removeMouseListener(trackListener);
- scrollbar.removeMouseMotionListener(trackListener);
-
- propertyChangeListener = null;
- modelListener = null;
- buttonListener = null;
- trackListener = null;
- scrollListener = null;
- }
-
- /**
- * This method uninstalls the UI. This includes removing any defaults,
- * listeners, and components that this UI may have initialized. It also
- * nulls any instance data.
- *
- * @param c The Component to uninstall for.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallDefaults();
- uninstallListeners();
- uninstallComponents();
-
- scrollTimer = null;
-
- thumbRect = null;
- trackRect = null;
-
- trackColor = null;
- trackHighlightColor = null;
- thumbColor = null;
- thumbHighlightColor = null;
- thumbDarkShadowColor = null;
- thumbLightShadowColor = null;
-
- scrollbar = null;
- }
-
- /**
- * This method returns the value in the scrollbar's range given the y
- * coordinate. If the value is out of range, it will return the closest
- * legal value.
- * This is package-private to avoid an accessor method.
- *
- * @param yPos The y coordinate to calculate a value for.
- *
- * @return The value for the y coordinate.
- */
- int valueForYPosition(int yPos)
- {
- int min = scrollbar.getMinimum();
- int max = scrollbar.getMaximum();
- int len = trackRect.height;
-
- int value;
-
- // If the length is 0, you shouldn't be able to even see where the thumb is.
- // This really shouldn't ever happen, but just in case, we'll return the middle.
- if (len == 0)
- return ((max - min) / 2);
-
- value = ((yPos - trackRect.y) * (max - min) / len + min);
-
- // If this isn't a legal value, then we'll have to move to one now.
- if (value > max)
- value = max;
- else if (value < min)
- value = min;
- return value;
- }
-
- /**
- * This method returns the value in the scrollbar's range given the x
- * coordinate. If the value is out of range, it will return the closest
- * legal value.
- * This is package-private to avoid an accessor method.
- *
- * @param xPos The x coordinate to calculate a value for.
- *
- * @return The value for the x coordinate.
- */
- int valueForXPosition(int xPos)
- {
- int min = scrollbar.getMinimum();
- int max = scrollbar.getMaximum();
- int len = trackRect.width;
-
- int value;
-
- // If the length is 0, you shouldn't be able to even see where the slider is.
- // This really shouldn't ever happen, but just in case, we'll return the middle.
- if (len == 0)
- return ((max - min) / 2);
-
- value = ((xPos - trackRect.x) * (max - min) / len + min);
-
- // If this isn't a legal value, then we'll have to move to one now.
- if (value > max)
- value = max;
- else if (value < min)
- value = min;
- return value;
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java b/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java
deleted file mode 100644
index 7bb7acffb8d..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* BasicScrollPaneUI.java
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Dimension;
-import java.awt.Graphics;
-
-import javax.swing.JComponent;
-import javax.swing.JScrollPane;
-import javax.swing.ScrollPaneConstants;
-import javax.swing.ScrollPaneLayout;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.ScrollPaneUI;
-
-public class BasicScrollPaneUI extends ScrollPaneUI
- implements ScrollPaneConstants
-{
-
- /** The Scrollpane for which the UI is provided by this class. */
- protected JScrollPane scrollpane;
-
- public static ComponentUI createUI(final JComponent c)
- {
- return new BasicScrollPaneUI();
- }
-
- protected void installDefaults(JScrollPane p)
- {
- scrollpane = p;
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- p.setForeground(defaults.getColor("ScrollPane.foreground"));
- p.setBackground(defaults.getColor("ScrollPane.background"));
- p.setFont(defaults.getFont("ScrollPane.font"));
- p.setBorder(defaults.getBorder("ScrollPane.border"));
- p.setOpaque(true);
- }
-
- protected void uninstallDefaults(JScrollPane p)
- {
- p.setForeground(null);
- p.setBackground(null);
- p.setFont(null);
- p.setBorder(null);
- scrollpane = null;
- }
-
- public void installUI(final JComponent c)
- {
- super.installUI(c);
- this.installDefaults((JScrollPane)c);
- }
-
- public void uninstallUI(final JComponent c)
- {
- super.uninstallUI(c);
- this.uninstallDefaults((JScrollPane)c);
- }
-
-
- public Dimension getMinimumSize(JComponent c)
- {
- JScrollPane p = (JScrollPane ) c;
- ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
- return sl.minimumLayoutSize(c);
- }
-
- public Dimension getPreferredSize(JComponent c)
- {
- JScrollPane p = (JScrollPane ) c;
- ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
- return sl.preferredLayoutSize(c);
- }
-
-
- public void paint(Graphics g, JComponent c)
- {
- // do nothing; the normal painting-of-children algorithm, along with
- // ScrollPaneLayout, does all the relevant work.
- }
-}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libjava/javax/swing/plaf/basic/BasicSeparatorUI.java b/libjava/javax/swing/plaf/basic/BasicSeparatorUI.java
deleted file mode 100644
index d0d4ba71597..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicSeparatorUI.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/* BasicSeparatorUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
-
-import javax.swing.JComponent;
-import javax.swing.JSeparator;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.SeparatorUI;
-
-/**
- * The Basic Look and Feel UI delegate for JSeparator.
- */
-public class BasicSeparatorUI extends SeparatorUI
-{
- /** The shadow color. */
- protected Color shadow;
-
- /** The highlight color. */
- protected Color highlight;
-
- /**
- * Creates a new UI delegate for the given JComponent.
- *
- * @param c The JComponent to create a delegate for.
- *
- * @return A new BasicSeparatorUI.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicSeparatorUI();
- }
-
- /**
- * This method installs the UI for the given JComponent.
- * This can include installing defaults, listeners, and
- * initializing any instance data.
- *
- * @param c The JComponent that is having this UI installed.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
-
- if (c instanceof JSeparator)
- {
- JSeparator s = (JSeparator) c;
-
- installDefaults(s);
- installListeners(s);
- }
- }
-
- /**
- * Uninstalls the UI for the given JComponent. This
- * method reverses what was done when installing
- * the UI on the JComponent.
- *
- * @param c The JComponent that is having this UI uninstalled.
- */
- public void uninstallUI(JComponent c)
- {
- if (c instanceof JSeparator)
- {
- JSeparator s = (JSeparator) c;
-
- uninstallListeners(s);
- uninstallDefaults(s);
- }
- }
-
- /**
- * This method installs the defaults that are given by
- * the Basic Look and Feel.
- *
- * @param s The JSeparator that is being installed.
- */
- protected void installDefaults(JSeparator s)
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- shadow = defaults.getColor("Separator.shadow");
- highlight = defaults.getColor("Separator.highlight");
- s.setOpaque(true);
- }
-
- /**
- * This method removes the defaults that were given
- * by the Basic Look and Feel.
- *
- * @param s The JSeparator that is being uninstalled.
- */
- protected void uninstallDefaults(JSeparator s)
- {
- shadow = null;
- highlight = null;
- }
-
- /**
- * This method installs any listeners that need
- * to be attached to the JSeparator or any of its
- * components.
- *
- * @param s The JSeparator that is being installed.
- */
- protected void installListeners(JSeparator s)
- {
- // Separators don't receive events.
- }
-
- /**
- * This method uninstalls any listeners that
- * were installed during the install UI process.
- *
- * @param s The JSeparator that is being uninstalled.
- */
- protected void uninstallListeners(JSeparator s)
- {
- // Separators don't receive events.
- }
-
- /**
- * The separator is made of two lines. The top line will be
- * the highlight color (or left line if it's vertical). The bottom
- * or right line will be the shadow color. The two lines will
- * be centered inside the bounds box. If the separator is horizontal,
- * then it will be vertically centered, or if it's vertical, it will
- * be horizontally centered.
- *
- * @param g The Graphics object to paint with
- * @param c The JComponent to paint.
- */
- public void paint(Graphics g, JComponent c)
- {
- Rectangle r = new Rectangle();
- SwingUtilities.calculateInnerArea(c, r);
- Color saved = g.getColor();
-
- int midAB = r.width / 2 + r.x;
- int midAD = r.height / 2 + r.y;
-
- JSeparator s;
- if (c instanceof JSeparator)
- s = (JSeparator) c;
- else
- return;
-
- if (s.getOrientation() == JSeparator.HORIZONTAL)
- {
- g.setColor(highlight);
- g.drawLine(r.x, midAD, r.x + r.width, midAD);
-
- g.setColor(shadow);
- g.drawLine(r.x, midAD + 1, r.x + r.width, midAD + 1);
- }
- else
- {
- g.setColor(highlight);
- g.drawLine(midAB, r.y, midAB, r.y + r.height);
-
- g.setColor(shadow);
- g.drawLine(midAB + 1, r.y, midAB + 1, r.y + r.height);
- }
- }
-
- /**
- * This method returns the preferred size of the
- * JComponent.
- *
- * @param c The JComponent to measure.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- Dimension dims = new Dimension(0, 0);
- Insets insets = c.getInsets();
-
- if (c instanceof JSeparator)
- {
- JSeparator s = (JSeparator) c;
-
- if (s.getOrientation() == JSeparator.HORIZONTAL)
- {
- dims.height = 2;
- dims.width = 40;
- }
- else
- {
- dims.width = 2;
- dims.height = 40;
- }
- }
- dims.width += insets.left + insets.right;
- dims.height += insets.top + insets.bottom;
-
- return dims;
- }
-
- /**
- * This method returns the minimum size of the
- * JComponent.
- *
- * @param c The JComponent to measure.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the maximum size of the
- * JComponent.
- *
- * @param c The JComponent to measure.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicSliderUI.java b/libjava/javax/swing/plaf/basic/BasicSliderUI.java
deleted file mode 100644
index b7ae3dd0181..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicSliderUI.java
+++ /dev/null
@@ -1,2219 +0,0 @@
-/* BasicSliderUI.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.ComponentOrientation;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Polygon;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import javax.swing.BoundedRangeModel;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JSlider;
-import javax.swing.SwingUtilities;
-import javax.swing.Timer;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.MouseInputAdapter;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.SliderUI;
-
-/**
- * <p>
- * BasicSliderUI.java This is the UI delegate in the Basic look and feel that
- * paints JSliders.
- * </p>
- *
- * <p>
- * The UI delegate keeps track of 6 rectangles that place the various parts of
- * the JSlider inside the component.
- * </p>
- *
- * <p>
- * The rectangles are organized as follows:
- * </p>
- * <pre>
- * +-------------------------------------------------------+ <-- focusRect
- * | |
- * | +==+-------------------+==+--------------------+==+<------ contentRect
- * | | | | |<---thumbRect | | |
- * | | | TRACK | | |<--------- trackRect
- * | | +-------------------+==+--------------------+ | |
- * | | | | | |
- * | | | TICKS GO HERE |<-------- tickRect
- * | | | | | |
- * | +==+-------------------------------------------+==+ |
- * | | | | | |
- * | | | | |<----- labelRect
- * | | | LABELS GO HERE | | |
- * | | | | | |
- * | | | | | |
- * | | | | | |
- * | | | | | |
- * | | | | |
- * </pre>
- *
- * <p>
- * The space between the contentRect and the focusRect are the FocusInsets.
- * </p>
- *
- * <p>
- * The space between the focusRect and the component bounds is the insetCache
- * which are the component's insets.
- * </p>
- *
- * <p>
- * The top of the thumb is the top of the contentRect. The trackRect has to be
- * as tall as the thumb.
- * </p>
- *
- * <p>
- * The trackRect and tickRect do not start from the left edge of the
- * focusRect. They are trackBuffer away from each side of the focusRect. This
- * is so that the thumb has room to move.
- * </p>
- *
- * <p>
- * The labelRect does start right against the contentRect's left and right
- * edges and it gets all remaining space.
- * </p>
- */
-public class BasicSliderUI extends SliderUI
-{
- /**
- * Helper class that listens to the {@link JSlider}'s model for changes.
- */
- public class ChangeHandler implements ChangeListener
- {
- /**
- * Called when the slider's model has been altered. The UI delegate should
- * recalculate any rectangles that are dependent on the model for their
- * positions and repaint.
- *
- * @param e A static {@link ChangeEvent} passed from the model.
- */
- public void stateChanged(ChangeEvent e)
- {
- // Maximum, minimum, and extent values will be taken
- // care of automatically when the slider is repainted.
- // Only thing that needs recalculation is the thumb.
- calculateThumbLocation();
- slider.repaint();
- }
- }
-
- /**
- * Helper class that listens for resize events.
- */
- protected class ComponentHandler extends ComponentAdapter
- {
- /**
- * Called when the size of the component changes. The UI delegate should
- * recalculate any rectangles that are dependent on the model for their
- * positions and repaint.
- *
- * @param e A {@link ComponentEvent}.
- */
- public void componentResized(ComponentEvent e)
- {
- calculateGeometry();
-
- slider.revalidate();
- slider.repaint();
- }
- }
-
- /**
- * Helper class that listens for focus events.
- */
- public class FocusHandler implements FocusListener
- {
- /**
- * Called when the {@link JSlider} has gained focus. It should repaint
- * the slider with the focus drawn.
- *
- * @param e A {@link FocusEvent}.
- */
- public void focusGained(FocusEvent e)
- {
- // FIXME: implement.
- }
-
- /**
- * Called when the {@link JSlider} has lost focus. It should repaint the
- * slider without the focus drawn.
- *
- * @param e A {@link FocusEvent}.
- */
- public void focusLost(FocusEvent e)
- {
- // FIXME: implement.
- }
- }
-
- /**
- * Helper class that listens for changes to the properties of the {@link
- * JSlider}.
- */
- public class PropertyChangeHandler implements PropertyChangeListener
- {
- /**
- * Called when one of the properties change. The UI should recalculate any
- * rectangles if necessary and repaint.
- *
- * @param e A {@link PropertyChangeEvent}.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- // Check for orientation changes.
- if (e.getPropertyName().equals("orientation"))
- recalculateIfOrientationChanged();
- else if (e.getPropertyName().equals("model"))
- {
- BoundedRangeModel oldModel = (BoundedRangeModel) e.getOldValue();
- oldModel.removeChangeListener(changeListener);
- slider.getModel().addChangeListener(changeListener);
- calculateThumbLocation();
- }
-
- // elif the componentOrientation changes (this is a bound property,
- // just undocumented) we change leftToRightCache. In Sun's
- // implementation, the LTR cache changes on a repaint. This is strange
- // since there is no need to do so. We could events here and
- // update the cache.
- // elif the border/insets change, we recalculateInsets.
- slider.repaint();
- }
- }
-
- /**
- * Helper class that listens to our swing timer. This class is responsible
- * for listening to the timer and moving the thumb in the proper direction
- * every interval.
- */
- public class ScrollListener implements ActionListener
- {
- /** Indicates which direction the thumb should scroll. */
- private transient int direction;
-
- /** Indicates whether we should scroll in blocks or in units. */
- private transient boolean block;
-
- /**
- * Creates a new ScrollListener object.
- */
- public ScrollListener()
- {
- direction = POSITIVE_SCROLL;
- block = false;
- }
-
- /**
- * Creates a new ScrollListener object.
- *
- * @param dir The direction to scroll in.
- * @param block If movement will be in blocks.
- */
- public ScrollListener(int dir, boolean block)
- {
- direction = dir;
- this.block = block;
- }
-
- /**
- * Called every time the swing timer reaches its interval. If the thumb
- * needs to move, then this method will move the thumb one block or unit
- * in the direction desired. Otherwise, the timer can be stopped.
- *
- * @param e An {@link ActionEvent}.
- */
- public void actionPerformed(ActionEvent e)
- {
- if (! trackListener.shouldScroll(direction))
- {
- scrollTimer.stop();
- return;
- }
-
- if (block)
- scrollByBlock(direction);
- else
- scrollByUnit(direction);
- }
-
- /**
- * Sets the direction to scroll in.
- *
- * @param direction The direction to scroll in.
- */
- public void setDirection(int direction)
- {
- this.direction = direction;
- }
-
- /**
- * Sets whether movement will be in blocks.
- *
- * @param block If movement will be in blocks.
- */
- public void setScrollByBlock(boolean block)
- {
- this.block = block;
- }
- }
-
- /**
- * Helper class that listens for mouse events.
- */
- public class TrackListener extends MouseInputAdapter
- {
- /** The current X position of the mouse. */
- protected int currentMouseX;
-
- /** The current Y position of the mouse. */
- protected int currentMouseY;
-
- /**
- * The offset between the current slider value and the cursor's position.
- */
- protected int offset;
-
- /**
- * Called when the mouse has been dragged. This should find the mouse's
- * current position and adjust the value of the {@link JSlider}
- * accordingly.
- *
- * @param e A {@link MouseEvent}
- */
- public void mouseDragged(MouseEvent e)
- {
- currentMouseX = e.getX();
- currentMouseY = e.getY();
- if (slider.getValueIsAdjusting())
- {
- int value;
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- value = valueForXPosition(currentMouseX) - offset;
- else
- value = valueForYPosition(currentMouseY) - offset;
-
- slider.setValue(value);
- }
- }
-
- /**
- * Called when the mouse has moved over a component but no buttons have
- * been pressed yet.
- *
- * @param e A {@link MouseEvent}
- */
- public void mouseMoved(MouseEvent e)
- {
- // Don't care that we're moved unless we're dragging.
- }
-
- /**
- * Called when the mouse is pressed. When the press occurs on the thumb
- * itself, the {@link JSlider} should have its value set to where the
- * mouse was pressed. If the press occurs on the track, then the thumb
- * should move one block towards the direction of the mouse.
- *
- * @param e A {@link MouseEvent}
- */
- public void mousePressed(MouseEvent e)
- {
- currentMouseX = e.getX();
- currentMouseY = e.getY();
-
- int value;
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- value = valueForXPosition(currentMouseX);
- else
- value = valueForYPosition(currentMouseY);
-
- if (slider.getSnapToTicks())
- value = findClosestTick(value);
-
- // If the thumb is hit, then we don't need to set the timers to move it.
- if (! thumbRect.contains(e.getPoint()))
- {
- // The mouse has hit some other part of the slider.
- // The value moves no matter where in the slider you hit.
- if (value > slider.getValue())
- scrollDueToClickInTrack(POSITIVE_SCROLL);
- else
- scrollDueToClickInTrack(NEGATIVE_SCROLL);
- }
- else
- {
- slider.setValueIsAdjusting(true);
- offset = value - slider.getValue();
- }
- }
-
- /**
- * Called when the mouse is released. This should stop the timer that
- * scrolls the thumb.
- *
- * @param e A {@link MouseEvent}
- */
- public void mouseReleased(MouseEvent e)
- {
- currentMouseX = e.getX();
- currentMouseY = e.getY();
-
- if (slider.getValueIsAdjusting())
- {
- slider.setValueIsAdjusting(false);
- if (slider.getSnapToTicks())
- slider.setValue(findClosestTick(slider.getValue()));
- }
- if (scrollTimer != null)
- scrollTimer.stop();
- }
-
- /**
- * Indicates whether the thumb should scroll in the given direction.
- *
- * @param direction The direction to check.
- *
- * @return True if the thumb should move in that direction.
- */
- public boolean shouldScroll(int direction)
- {
- int value;
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- value = valueForXPosition(currentMouseX);
- else
- value = valueForYPosition(currentMouseY);
-
- if (direction == POSITIVE_SCROLL)
- return (value > slider.getValue());
- else
- return (value < slider.getValue());
- }
- }
-
- /** The preferred height of the thumb. */
- private transient int thumbHeight;
-
- /** The preferred width of the thumb. */
- private transient int thumbWidth;
-
- /** The preferred height of the tick rectangle. */
- private transient int tickHeight;
-
- /** Listener for changes from the model. */
- protected ChangeListener changeListener;
-
- /** Listener for changes to the {@link JSlider}. */
- protected PropertyChangeListener propertyChangeListener;
-
- /** Listener for the scrollTimer. */
- protected ScrollListener scrollListener;
-
- /** Listener for component resizing. */
- protected ComponentListener componentListener;
-
- /** Listener for focus handling. */
- protected FocusListener focusListener;
-
- /** Listener for mouse events. */
- protected TrackListener trackListener;
-
- /** The insets between the FocusRectangle and the ContentRectangle. */
- protected Insets focusInsets;
-
- /** The {@link JSlider}'s insets. */
- protected Insets insetCache;
-
- /** Rectangle describing content bounds. See diagram above. */
- protected Rectangle contentRect;
-
- /** Rectangle describing focus bounds. See diagram above. */
- protected Rectangle focusRect;
-
- /** Rectangle describing the thumb's bounds. See diagram above. */
- protected Rectangle thumbRect;
-
- /** Rectangle describing the tick bounds. See diagram above. */
- protected Rectangle tickRect;
-
- /** Rectangle describing the label bounds. See diagram above. */
- protected Rectangle labelRect;
-
- /** Rectangle describing the track bounds. See diagram above. */
- protected Rectangle trackRect;
-
- /** FIXME: use this somewhere. */
- public static final int MAX_SCROLL = 2;
-
- /** FIXME: use this somewhere. */
- public static final int MIN_SCROLL = -2;
-
- /** A constant describing scrolling towards the minimum. */
- public static final int NEGATIVE_SCROLL = -1;
-
- /** A constant describing scrolling towards the maximum. */
- public static final int POSITIVE_SCROLL = 1;
-
- /** The gap between the edges of the contentRect and trackRect. */
- protected int trackBuffer;
-
- /** Whether this slider is actually drawn left to right. */
- protected boolean leftToRightCache;
-
- /** A timer that periodically moves the thumb. */
- protected Timer scrollTimer;
-
- /** A reference to the {@link JSlider} that this UI was created for. */
- protected JSlider slider;
-
- /** The shadow color. */
- private transient Color shadowColor;
-
- /** The highlight color. */
- private transient Color highlightColor;
-
- /** The focus color. */
- private transient Color focusColor;
-
- /**
- * Creates a new Basic look and feel Slider UI.
- *
- * @param b The {@link JSlider} that this UI was created for.
- */
- public BasicSliderUI(JSlider b)
- {
- super();
- }
-
- /**
- * Gets the shadow color to be used for this slider. The shadow color is the
- * color used for drawing the top and left edges of the track.
- *
- * @return The shadow color.
- */
- protected Color getShadowColor()
- {
- return shadowColor;
- }
-
- /**
- * Gets the highlight color to be used for this slider. The highlight color
- * is the color used for drawing the bottom and right edges of the track.
- *
- * @return The highlight color.
- */
- protected Color getHighlightColor()
- {
- return highlightColor;
- }
-
- /**
- * Gets the focus color to be used for this slider. The focus color is the
- * color used for drawing the focus rectangle when the component gains
- * focus.
- *
- * @return The focus color.
- */
- protected Color getFocusColor()
- {
- return focusColor;
- }
-
- /**
- * Factory method to create a BasicSliderUI for the given {@link
- * JComponent}, which should be a {@link JSlider}.
- *
- * @param b The {@link JComponent} a UI is being created for.
- *
- * @return A BasicSliderUI for the {@link JComponent}.
- */
- public static ComponentUI createUI(JComponent b)
- {
- return new BasicSliderUI((JSlider) b);
- }
-
- /**
- * Installs and initializes all fields for this UI delegate. Any properties
- * of the UI that need to be initialized and/or set to defaults will be
- * done now. It will also install any listeners necessary.
- *
- * @param c The {@link JComponent} that is having this UI installed.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
- if (c instanceof JSlider)
- {
- slider = (JSlider) c;
-
- focusRect = new Rectangle();
- contentRect = new Rectangle();
- thumbRect = new Rectangle();
- trackRect = new Rectangle();
- tickRect = new Rectangle();
- labelRect = new Rectangle();
-
- insetCache = slider.getInsets();
- leftToRightCache = ! slider.getInverted();
-
- scrollTimer = new Timer(200, null);
- scrollTimer.setRepeats(true);
-
- installDefaults(slider);
- installListeners(slider);
- installKeyboardActions(slider);
-
- calculateFocusRect();
-
- calculateContentRect();
- calculateThumbSize();
- calculateTrackBuffer();
- calculateTrackRect();
- calculateThumbLocation();
-
- calculateTickRect();
- calculateLabelRect();
- }
- }
-
- /**
- * Performs the opposite of installUI. Any properties or resources that need
- * to be cleaned up will be done now. It will also uninstall any listeners
- * it has. In addition, any properties of this UI will be nulled.
- *
- * @param c The {@link JComponent} that is having this UI uninstalled.
- */
- public void uninstallUI(JComponent c)
- {
- super.uninstallUI(c);
-
- uninstallKeyboardActions(slider);
- uninstallListeners(slider);
-
- scrollTimer = null;
-
- focusRect = null;
- contentRect = null;
- thumbRect = null;
- trackRect = null;
- tickRect = null;
- labelRect = null;
-
- focusInsets = null;
- }
-
- /**
- * Initializes any default properties that this UI has from the defaults for
- * the Basic look and feel.
- *
- * @param slider The {@link JSlider} that is having this UI installed.
- */
- protected void installDefaults(JSlider slider)
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- slider.setForeground(defaults.getColor("Slider.foreground"));
- slider.setBackground(defaults.getColor("Slider.background"));
- shadowColor = defaults.getColor("Slider.shadow");
- highlightColor = defaults.getColor("Slider.highlight");
- focusColor = defaults.getColor("Slider.focus");
- slider.setBorder(defaults.getBorder("Slider.border"));
- slider.setOpaque(true);
-
- thumbHeight = defaults.getInt("Slider.thumbHeight");
- thumbWidth = defaults.getInt("Slider.thumbWidth");
- tickHeight = defaults.getInt("Slider.tickHeight");
-
- focusInsets = defaults.getInsets("Slider.focusInsets");
- }
-
- /**
- * Creates a new {@link TrackListener}.
- *
- * @param slider The {@link JSlider} that this {@link TrackListener} is
- * created for.
- *
- * @return A new {@link TrackListener}.
- */
- protected TrackListener createTrackListener(JSlider slider)
- {
- return new TrackListener();
- }
-
- /**
- * Creates a new {@link ChangeListener}.
- *
- * @param slider The {@link JSlider} that this {@link ChangeListener} is
- * created for.
- *
- * @return A new {@link ChangeListener}.
- */
- protected ChangeListener createChangeListener(JSlider slider)
- {
- return new ChangeHandler();
- }
-
- /**
- * Creates a new {@link ComponentListener}.
- *
- * @param slider The {@link JSlider} that this {@link ComponentListener} is
- * created for.
- *
- * @return A new {@link ComponentListener}.
- */
- protected ComponentListener createComponentListener(JSlider slider)
- {
- return new ComponentHandler();
- }
-
- /**
- * Creates a new {@link FocusListener}.
- *
- * @param slider The {@link JSlider} that this {@link FocusListener} is
- * created for.
- *
- * @return A new {@link FocusListener}.
- */
- protected FocusListener createFocusListener(JSlider slider)
- {
- return new FocusHandler();
- }
-
- /**
- * Creates a new {@link ScrollListener}.
- *
- * @param slider The {@link JSlider} that this {@link ScrollListener} is
- * created for.
- *
- * @return A new {@link ScrollListener}.
- */
- protected ScrollListener createScrollListener(JSlider slider)
- {
- return new ScrollListener();
- }
-
- /**
- * Creates a new {@link PropertyChangeListener}.
- *
- * @param slider The {@link JSlider} that this {@link
- * PropertyChangeListener} is created for.
- *
- * @return A new {@link PropertyChangeListener}.
- */
- protected PropertyChangeListener createPropertyChangeListener(JSlider slider)
- {
- return new PropertyChangeHandler();
- }
-
- /**
- * Creates and registers all the listeners for this UI delegate. This
- * includes creating the ScrollListener and registering it to the timer.
- *
- * @param slider The {@link JSlider} is having listeners installed.
- */
- protected void installListeners(JSlider slider)
- {
- propertyChangeListener = createPropertyChangeListener(slider);
- componentListener = createComponentListener(slider);
- trackListener = createTrackListener(slider);
- focusListener = createFocusListener(slider);
- changeListener = createChangeListener(slider);
- scrollListener = createScrollListener(slider);
-
- slider.addPropertyChangeListener(propertyChangeListener);
- slider.addComponentListener(componentListener);
- slider.addMouseListener(trackListener);
- slider.addMouseMotionListener(trackListener);
- slider.addFocusListener(focusListener);
- slider.getModel().addChangeListener(changeListener);
-
- scrollTimer.addActionListener(scrollListener);
- }
-
- /**
- * Unregisters all the listeners that this UI delegate was using. In
- * addition, it will also null any listeners that it was using.
- *
- * @param slider The {@link JSlider} that is having listeners removed.
- */
- protected void uninstallListeners(JSlider slider)
- {
- slider.removePropertyChangeListener(propertyChangeListener);
- slider.removeComponentListener(componentListener);
- slider.removeMouseListener(trackListener);
- slider.removeMouseMotionListener(trackListener);
- slider.removeFocusListener(focusListener);
- slider.getModel().removeChangeListener(changeListener);
-
- scrollTimer.removeActionListener(scrollListener);
-
- propertyChangeListener = null;
- componentListener = null;
- trackListener = null;
- focusListener = null;
- changeListener = null;
- scrollListener = null;
- }
-
- /**
- * Installs any keyboard actions. The list of keys that need to be bound are
- * listed in Basic look and feel's defaults.
- *
- * @param slider The {@link JSlider} that is having keyboard actions
- * installed.
- */
- protected void installKeyboardActions(JSlider slider)
- {
- // FIXME: implement.
- }
-
- /**
- * Uninstalls any keyboard actions. The list of keys used are listed in
- * Basic look and feel's defaults.
- *
- * @param slider The {@link JSlider} that is having keyboard actions
- * uninstalled.
- */
- protected void uninstallKeyboardActions(JSlider slider)
- {
- // FIXME: implement.
- }
-
- /* XXX: This is all after experimentation with SUN's implementation.
-
- PreferredHorizontalSize seems to be 200x21.
- PreferredVerticalSize seems to be 21x200.
-
- MinimumHorizontalSize seems to be 36x21.
- MinimumVerticalSize seems to be 21x36.
-
- PreferredSize seems to be 200x63. Or Components.getBounds?
-
- MinimumSize seems to be 36x63.
-
- MaximumSize seems to be 32767x63.
- */
-
- /**
- * This method returns the preferred size when the slider is horizontally
- * oriented.
- *
- * @return The dimensions of the preferred horizontal size.
- */
- public Dimension getPreferredHorizontalSize()
- {
- Insets insets = slider.getInsets();
-
- // The width should cover all the labels (which are usually the
- // deciding factor of the width)
- int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0
- : slider.getLabelTable()
- .size());
-
- // If there are not enough labels.
- // This number is pretty much arbitrary, but it looks nice.
- if (width < 200)
- width = 200;
-
- // We can only draw inside of the focusRectangle, so we have to
- // pad it with insets.
- width += insets.left + insets.right + focusInsets.left + focusInsets.right;
-
- // Height is determined by the thumb, the ticks and the labels.
- int height = thumbHeight;
-
- if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0
- || slider.getMinorTickSpacing() > 0)
- height += tickHeight;
-
- if (slider.getPaintLabels())
- height += getHeightOfTallestLabel();
-
- height += insets.top + insets.bottom + focusInsets.top
- + focusInsets.bottom;
-
- return new Dimension(width, height);
- }
-
- /**
- * This method returns the preferred size when the slider is vertically
- * oriented.
- *
- * @return The dimensions of the preferred vertical size.
- */
- public Dimension getPreferredVerticalSize()
- {
- Insets insets = slider.getInsets();
-
- int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null
- ? 0 : slider.getLabelTable()
- .size());
-
- if (height < 200)
- height = 200;
-
- height += insets.top + insets.bottom + focusInsets.top
- + focusInsets.bottom;
-
- int width = thumbHeight;
-
- if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0
- || slider.getMinorTickSpacing() > 0)
- width += tickHeight;
-
- if (slider.getPaintLabels())
- width += getWidthOfWidestLabel();
-
- width += insets.left + insets.right + focusInsets.left + focusInsets.right;
-
- return new Dimension(width, height);
- }
-
- /**
- * This method returns the minimum size when the slider is horizontally
- * oriented.
- *
- * @return The dimensions of the minimum horizontal size.
- */
- public Dimension getMinimumHorizontalSize()
- {
- return getPreferredHorizontalSize();
- }
-
- /**
- * This method returns the minimum size of the slider when it is vertically
- * oriented.
- *
- * @return The dimensions of the minimum vertical size.
- */
- public Dimension getMinimumVerticalSize()
- {
- return getPreferredVerticalSize();
- }
-
- /**
- * This method returns the preferred size of the component. If it returns
- * null, then it is up to the Layout Manager to give the {@link JComponent}
- * a size.
- *
- * @param c The {@link JComponent} to find the preferred size for.
- *
- * @return The dimensions of the preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- return getPreferredHorizontalSize();
- else
- return getPreferredVerticalSize();
- }
-
- /**
- * This method returns the minimum size for this {@link JSlider} for this
- * look and feel. If it returns null, then it is up to the Layout Manager
- * to give the {@link JComponent} a size.
- *
- * @param c The {@link JComponent} to find the minimum size for.
- *
- * @return The dimensions of the minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- return getPreferredHorizontalSize();
- else
- return getPreferredVerticalSize();
- }
-
- /**
- * This method returns the maximum size for this {@link JSlider} for this
- * look and feel. If it returns null, then it is up to the Layout Manager
- * to give the {@link JComponent} a size.
- *
- * @param c The {@link JComponent} to find a maximum size for.
- *
- * @return The dimensions of the maximum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- return getPreferredHorizontalSize();
- else
- return getPreferredVerticalSize();
- }
-
- /**
- * This method calculates all the sizes of the rectangles by delegating to
- * the helper methods calculateXXXRect.
- */
- protected void calculateGeometry()
- {
- calculateFocusRect();
- calculateContentRect();
- calculateThumbSize();
- calculateTrackBuffer();
- calculateTrackRect();
- calculateTickRect();
- calculateLabelRect();
- calculateThumbLocation();
- }
-
- /**
- * This method calculates the size and position of the focusRect. This
- * method does not need to be called if the orientation changes.
- */
- protected void calculateFocusRect()
- {
- insetCache = slider.getInsets();
- focusRect = SwingUtilities.calculateInnerArea(slider, focusRect);
-
- if (focusRect.width < 0)
- focusRect.width = 0;
- if (focusRect.height < 0)
- focusRect.height = 0;
- }
-
- /**
- * This method calculates the size but not the position of the thumbRect. It
- * must take into account the orientation of the slider.
- */
- protected void calculateThumbSize()
- {
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- if (thumbWidth > contentRect.width)
- thumbRect.width = contentRect.width / 4;
- else
- thumbRect.width = thumbWidth;
- if (thumbHeight > contentRect.height)
- thumbRect.height = contentRect.height;
- else
- thumbRect.height = thumbHeight;
- }
- else
- {
- // The thumb gets flipped when inverted, so thumbWidth
- // actually is the height and vice versa.
- if (thumbWidth > contentRect.height)
- thumbRect.height = contentRect.height / 4;
- else
- thumbRect.height = thumbWidth;
- if (thumbHeight > contentRect.width)
- thumbRect.width = contentRect.width;
- else
- thumbRect.width = thumbHeight;
- }
- }
-
- /**
- * This method calculates the size and position of the contentRect. This
- * method does not need to be called if the orientation changes.
- */
- protected void calculateContentRect()
- {
- contentRect.x = focusRect.x + focusInsets.left;
- contentRect.y = focusRect.y + focusInsets.top;
- contentRect.width = focusRect.width - focusInsets.left - focusInsets.right;
- contentRect.height = focusRect.height - focusInsets.top
- - focusInsets.bottom;
-
- if (contentRect.width < 0)
- contentRect.width = 0;
- if (contentRect.height < 0)
- contentRect.height = 0;
- }
-
- /**
- * Calculates the position of the thumbRect based on the current value of
- * the slider. It must take into account the orientation of the slider.
- */
- protected void calculateThumbLocation()
- {
- int value = slider.getValue();
-
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- thumbRect.x = xPositionForValue(value) - thumbRect.width / 2;
- thumbRect.y = contentRect.y;
- }
- else
- {
- thumbRect.x = contentRect.x;
- thumbRect.y = yPositionForValue(value) - thumbRect.height / 2;
- }
- }
-
- /**
- * Calculates the gap size between the left edge of the contentRect and the
- * left edge of the trackRect.
- */
- protected void calculateTrackBuffer()
- {
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- trackBuffer = thumbRect.width;
- else
- trackBuffer = thumbRect.height;
- }
-
- /**
- * This method returns the size of the thumbRect.
- *
- * @return The dimensions of the thumb.
- */
- protected Dimension getThumbSize()
- {
- // This is really just the bounds box for the thumb.
- // The thumb will actually be pointed (like a rectangle + triangle at bottom)
- return thumbRect.getSize();
- }
-
- /**
- * Calculates the size and position of the trackRect. It must take into
- * account the orientation of the slider.
- */
- protected void calculateTrackRect()
- {
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- trackRect.x = contentRect.x + trackBuffer;
- trackRect.y = contentRect.y;
- trackRect.width = contentRect.width - 2 * trackBuffer;
- trackRect.height = thumbRect.height;
- }
- else
- {
- trackRect.x = contentRect.x;
- trackRect.y = contentRect.y + trackBuffer;
- trackRect.width = thumbRect.width;
- trackRect.height = contentRect.height - 2 * trackBuffer;
- }
- }
-
- /**
- * This method returns the height of the tick area box if the slider is
- * horizontal and the width of the tick area box is the slider is vertical.
- * It not necessarily how long the ticks will be. If a gap between the edge
- * of tick box and the actual tick is desired, then that will need to be
- * handled in the tick painting methods.
- *
- * @return The height (or width if the slider is vertical) of the tick
- * rectangle.
- */
- protected int getTickLength()
- {
- return tickHeight;
- }
-
- /**
- * This method calculates the size and position of the tickRect. It must
- * take into account the orientation of the slider.
- */
- protected void calculateTickRect()
- {
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- tickRect.x = trackRect.x;
- tickRect.y = trackRect.y + trackRect.height;
- tickRect.width = trackRect.width;
- tickRect.height = getTickLength();
-
- if (tickRect.y + tickRect.height > contentRect.y + contentRect.height)
- tickRect.height = contentRect.y + contentRect.height - tickRect.y;
- }
- else
- {
- tickRect.x = trackRect.x + trackRect.width;
- tickRect.y = trackRect.y;
- tickRect.width = getTickLength();
- tickRect.height = trackRect.height;
-
- if (tickRect.x + tickRect.width > contentRect.x + contentRect.width)
- tickRect.width = contentRect.x + contentRect.width - tickRect.x;
- }
- }
-
- /**
- * This method calculates the size and position of the labelRect. It must
- * take into account the orientation of the slider.
- */
- protected void calculateLabelRect()
- {
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- labelRect.x = contentRect.x;
- labelRect.y = tickRect.y + tickRect.height;
- labelRect.width = contentRect.width;
- labelRect.height = contentRect.height - labelRect.y;
- }
- else
- {
- labelRect.x = tickRect.x + tickRect.width;
- labelRect.y = contentRect.y;
- labelRect.width = contentRect.width - labelRect.x;
- labelRect.height = contentRect.height;
- }
- }
-
- /**
- * This method returns the width of the widest label in the slider's label
- * table.
- *
- * @return The width of the widest label or 0 if no label table exists.
- */
- protected int getWidthOfWidestLabel()
- {
- int widest = 0;
- Component label;
-
- if (slider.getLabelTable() == null)
- return 0;
-
- Dimension pref;
- for (Enumeration list = slider.getLabelTable().elements();
- list.hasMoreElements();)
- {
- Object comp = list.nextElement();
- if (! (comp instanceof Component))
- continue;
- label = (Component) comp;
- pref = label.getPreferredSize();
- if (pref != null && pref.width > widest)
- widest = pref.width;
- }
- return widest;
- }
-
- /**
- * This method returns the height of the tallest label in the slider's label
- * table.
- *
- * @return The height of the tallest label or 0 if no label table exists.
- */
- protected int getHeightOfTallestLabel()
- {
- int tallest = 0;
- Component label;
-
- if (slider.getLabelTable() == null)
- return 0;
- Dimension pref;
- for (Enumeration list = slider.getLabelTable().elements();
- list.hasMoreElements();)
- {
- Object comp = list.nextElement();
- if (! (comp instanceof Component))
- continue;
- label = (Component) comp;
- pref = label.getPreferredSize();
- if (pref != null && pref.height > tallest)
- tallest = pref.height;
- }
- return tallest;
- }
-
- /**
- * This method returns the width of the label whose key has the highest
- * value.
- *
- * @return The width of the high value label or 0 if no label table exists.
- */
- protected int getWidthOfHighValueLabel()
- {
- Component highValueLabel = getHighestValueLabel();
- if (highValueLabel != null)
- return highValueLabel.getWidth();
- else
- return 0;
- }
-
- /**
- * This method returns the width of the label whose key has the lowest
- * value.
- *
- * @return The width of the low value label or 0 if no label table exists.
- */
- protected int getWidthOfLowValueLabel()
- {
- Component lowValueLabel = getLowestValueLabel();
- if (lowValueLabel != null)
- return lowValueLabel.getWidth();
- else
- return 0;
- }
-
- /**
- * This method returns the height of the label whose key has the highest
- * value.
- *
- * @return The height of the high value label or 0 if no label table exists.
- */
- protected int getHeightOfHighValueLabel()
- {
- Component highValueLabel = getHighestValueLabel();
- if (highValueLabel != null)
- return highValueLabel.getHeight();
- else
- return 0;
- }
-
- /**
- * This method returns the height of the label whose key has the lowest
- * value.
- *
- * @return The height of the low value label or 0 if no label table exists.
- */
- protected int getHeightOfLowValueLabel()
- {
- Component lowValueLabel = getLowestValueLabel();
- if (lowValueLabel != null)
- return lowValueLabel.getHeight();
- else
- return 0;
- }
-
- /**
- * This method returns whether the slider is to be drawn inverted.
- *
- * @return True is the slider is to be drawn inverted.
- */
- protected boolean drawInverted()
- {
- return ! (slider.getInverted() ^ leftToRightCache);
- }
-
- /**
- * This method returns the label whose key has the lowest value.
- *
- * @return The low value label or null if no label table exists.
- */
- protected Component getLowestValueLabel()
- {
- Integer key = new Integer(Integer.MAX_VALUE);
- Integer tmpKey;
- Dictionary labelTable = slider.getLabelTable();
-
- if (labelTable == null)
- return null;
-
- for (Enumeration list = labelTable.keys(); list.hasMoreElements();)
- {
- Object value = list.nextElement();
- if (! (value instanceof Integer))
- continue;
- tmpKey = (Integer) value;
- if (tmpKey.intValue() < key.intValue())
- key = tmpKey;
- }
- Object comp = labelTable.get(key);
- if (! (comp instanceof Component))
- return null;
- return (Component) comp;
- }
-
- /**
- * This method returns the label whose key has the highest value.
- *
- * @return The high value label or null if no label table exists.
- */
- protected Component getHighestValueLabel()
- {
- Integer key = new Integer(Integer.MIN_VALUE);
- Integer tmpKey;
- Dictionary labelTable = slider.getLabelTable();
-
- if (labelTable == null)
- return null;
-
- for (Enumeration list = labelTable.keys(); list.hasMoreElements();)
- {
- Object value = list.nextElement();
- if (! (value instanceof Integer))
- continue;
- tmpKey = (Integer) value;
- if (tmpKey.intValue() > key.intValue())
- key = tmpKey;
- }
- Object comp = labelTable.get(key);
- if (! (comp instanceof Component))
- return null;
- return (Component) comp;
- }
-
- /**
- * This method is used to paint the {@link JSlider}. It delegates all its
- * duties to the various paint methods like paintTicks(), paintTrack(),
- * paintThumb(), etc.
- *
- * @param g The {@link Graphics} object to paint with.
- * @param c The {@link JComponent} that is being painted.
- */
- public void paint(Graphics g, JComponent c)
- {
- // FIXME: Move this to propertyChangeEvent handler, when we get those.
- leftToRightCache = slider.getComponentOrientation() != ComponentOrientation.RIGHT_TO_LEFT;
- // FIXME: This next line is only here because the above line is here.
- calculateThumbLocation();
-
- if (slider.getPaintTrack())
- paintTrack(g);
- if (slider.getPaintTicks())
- paintTicks(g);
- if (slider.getPaintLabels())
- paintLabels(g);
-
- //FIXME: Paint focus.
- paintThumb(g);
- }
-
- /**
- * This method recalculates any rectangles that need to be recalculated
- * after the insets of the component have changed.
- */
- protected void recalculateIfInsetsChanged()
- {
- // Examining a test program shows that either Sun calls private
- // methods that we don't know about, or these don't do anything.
- calculateFocusRect();
-
- calculateContentRect();
- calculateThumbSize();
- calculateTrackBuffer();
- calculateTrackRect();
- calculateThumbLocation();
-
- calculateTickRect();
- calculateLabelRect();
- }
-
- /**
- * This method recalculates any rectangles that need to be recalculated
- * after the orientation of the slider changes.
- */
- protected void recalculateIfOrientationChanged()
- {
- // Examining a test program shows that either Sun calls private
- // methods that we don't know about, or these don't do anything.
- calculateThumbSize();
- calculateTrackBuffer();
- calculateTrackRect();
- calculateThumbLocation();
-
- calculateTickRect();
- calculateLabelRect();
- }
-
- /**
- * This method is called during a repaint if the slider has focus. It draws
- * an outline of the focusRect using the color returned by
- * getFocusColor().
- *
- * @param g The {@link Graphics} object to draw with.
- */
- public void paintFocus(Graphics g)
- {
- Color saved_color = g.getColor();
-
- g.setColor(getFocusColor());
-
- g.drawRect(focusRect.x, focusRect.y, focusRect.width, focusRect.height);
-
- g.setColor(saved_color);
- }
-
- /**
- * <p>
- * This method is called during a repaint if the track is to be drawn. It
- * draws a 3D rectangle to represent the track. The track is not the size
- * of the trackRect. The top and left edges of the track should be outlined
- * with the shadow color. The bottom and right edges should be outlined
- * with the highlight color.
- * </p>
- * <pre>
- * a---d
- * | |
- * | | a------------------------d
- * | | | |
- * | | b------------------------c
- * | |
- * | |
- * b---c
- * </pre>
- *
- * <p>
- * The b-a-d path needs to be drawn with the shadow color and the b-c-d path
- * needs to be drawn with the highlight color.
- * </p>
- *
- * @param g The {@link Graphics} object to draw with.
- */
- public void paintTrack(Graphics g)
- {
- Color saved_color = g.getColor();
- int width;
- int height;
-
- Point a = new Point(trackRect.x, trackRect.y);
- Point b = new Point(a);
- Point c = new Point(a);
- Point d = new Point(a);
-
- Polygon high;
- Polygon shadow;
-
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- width = trackRect.width;
- height = (thumbRect.height / 4 == 0) ? 1 : thumbRect.height / 4;
-
- a.translate(0, (trackRect.height / 2) - (height / 2));
- b.translate(0, (trackRect.height / 2) + (height / 2));
- c.translate(trackRect.width, (trackRect.height / 2) + (height / 2));
- d.translate(trackRect.width, (trackRect.height / 2) - (height / 2));
- }
- else
- {
- width = (thumbRect.width / 4 == 0) ? 1 : thumbRect.width / 4;
- height = trackRect.height;
-
- a.translate((trackRect.width / 2) - (width / 2), 0);
- b.translate((trackRect.width / 2) - (width / 2), trackRect.height);
- c.translate((trackRect.width / 2) + (width / 2), trackRect.height);
- d.translate((trackRect.width / 2) + (width / 2), 0);
- }
- g.setColor(Color.GRAY);
- g.fillRect(a.x, a.y, width, height);
-
- g.setColor(getHighlightColor());
- g.drawLine(b.x, b.y, c.x, c.y);
- g.drawLine(c.x, c.y, d.x, d.y);
-
- g.setColor(getShadowColor());
- g.drawLine(b.x, b.y, a.x, a.y);
- g.drawLine(a.x, a.y, d.x, d.y);
-
- g.setColor(saved_color);
- }
-
- /**
- * This method is called during a repaint if the ticks are to be drawn. This
- * method must still verify that the majorTickSpacing and minorTickSpacing
- * are greater than zero before drawing the ticks.
- *
- * @param g The {@link Graphics} object to draw with.
- */
- public void paintTicks(Graphics g)
- {
- int max = slider.getMaximum();
- int min = slider.getMinimum();
- int majorSpace = slider.getMajorTickSpacing();
- int minorSpace = slider.getMinorTickSpacing();
-
- if (majorSpace > 0)
- {
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- double loc = tickRect.x;
- double increment = (max == min) ? 0
- : majorSpace * (double) tickRect.width / (max
- - min);
- if (drawInverted())
- {
- loc += tickRect.width;
- increment *= -1;
- }
- for (int i = min; i <= max; i += majorSpace)
- {
- paintMajorTickForHorizSlider(g, tickRect, (int) loc);
- loc += increment;
- }
- }
- else
- {
- double loc = tickRect.height + tickRect.y;
- double increment = (max == min) ? 0
- : -majorSpace * (double) tickRect.height / (max
- - min);
- if (drawInverted())
- {
- loc = tickRect.y;
- increment *= -1;
- }
- for (int i = min; i <= max; i += majorSpace)
- {
- paintMajorTickForVertSlider(g, tickRect, (int) loc);
- loc += increment;
- }
- }
- }
- if (minorSpace > 0)
- {
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- double loc = tickRect.x;
- double increment = (max == min) ? 0
- : minorSpace * (double) tickRect.width / (max
- - min);
- if (drawInverted())
- {
- loc += tickRect.width;
- increment *= -1;
- }
- for (int i = min; i <= max; i += minorSpace)
- {
- paintMinorTickForHorizSlider(g, tickRect, (int) loc);
- loc += increment;
- }
- }
- else
- {
- double loc = tickRect.height + tickRect.y;
- double increment = (max == min) ? 0
- : -minorSpace * (double) tickRect.height / (max
- - min);
- if (drawInverted())
- {
- loc = tickRect.y;
- increment *= -1;
- }
- for (int i = min; i <= max; i += minorSpace)
- {
- paintMinorTickForVertSlider(g, tickRect, (int) loc);
- loc += increment;
- }
- }
- }
- }
-
- /* Minor ticks start at 1/4 of the height (or width) of the tickRect and extend
- to 1/2 of the tickRect.
-
- Major ticks start at 1/4 of the height and extend to 3/4.
- */
-
- /**
- * This method paints a minor tick for a horizontal slider at the given x
- * value. x represents the x coordinate to paint at.
- *
- * @param g The {@link Graphics} object to draw with.
- * @param tickBounds The tickRect rectangle.
- * @param x The x coordinate to draw the tick at.
- */
- protected void paintMinorTickForHorizSlider(Graphics g,
- Rectangle tickBounds, int x)
- {
- int y = tickRect.y + tickRect.height / 4;
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- g.drawLine(x, y, x, y + tickRect.height / 4);
- g.setColor(saved);
- }
-
- /**
- * This method paints a major tick for a horizontal slider at the given x
- * value. x represents the x coordinate to paint at.
- *
- * @param g The {@link Graphics} object to draw with.
- * @param tickBounds The tickRect rectangle.
- * @param x The x coordinate to draw the tick at.
- */
- protected void paintMajorTickForHorizSlider(Graphics g,
- Rectangle tickBounds, int x)
- {
- int y = tickRect.y + tickRect.height / 4;
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- g.drawLine(x, y, x, y + tickRect.height / 2);
- g.setColor(saved);
- }
-
- /**
- * This method paints a minor tick for a vertical slider at the given y
- * value. y represents the y coordinate to paint at.
- *
- * @param g The {@link Graphics} object to draw with.
- * @param tickBounds The tickRect rectangle.
- * @param y The y coordinate to draw the tick at.
- */
- protected void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds,
- int y)
- {
- int x = tickRect.x + tickRect.width / 4;
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- g.drawLine(x, y, x + tickRect.width / 4, y);
- g.setColor(saved);
- }
-
- /**
- * This method paints a major tick for a vertical slider at the given y
- * value. y represents the y coordinate to paint at.
- *
- * @param g The {@link Graphics} object to draw with.
- * @param tickBounds The tickRect rectangle.
- * @param y The y coordinate to draw the tick at.
- */
- protected void paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds,
- int y)
- {
- int x = tickRect.x + tickRect.width / 4;
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- g.drawLine(x, y, x + tickRect.width / 2, y);
- g.setColor(saved);
- }
-
- /**
- * This method paints all the labels from the slider's label table. This
- * method must make sure that the label table is not null before painting
- * the labels. Each entry in the label table is a (integer, component)
- * pair. Every label is painted at the value of the integer.
- *
- * @param g The {@link Graphics} object to draw with.
- */
- public void paintLabels(Graphics g)
- {
- if (slider.getLabelTable() != null)
- {
- Dictionary table = slider.getLabelTable();
- Integer tmpKey;
- Object key;
- Object element;
- Component label;
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- for (Enumeration list = table.keys(); list.hasMoreElements();)
- {
- key = list.nextElement();
- if (! (key instanceof Integer))
- continue;
- tmpKey = (Integer) key;
- element = table.get(tmpKey);
- // We won't paint them if they're not
- // JLabels so continue anyway
- if (! (element instanceof JLabel))
- continue;
- label = (Component) element;
- paintHorizontalLabel(g, tmpKey.intValue(), label);
- }
- }
- else
- {
- for (Enumeration list = table.keys(); list.hasMoreElements();)
- {
- key = list.nextElement();
- if (! (key instanceof Integer))
- continue;
- tmpKey = (Integer) key;
- element = table.get(tmpKey);
- // We won't paint them if they're not
- // JLabels so continue anyway
- if (! (element instanceof JLabel))
- continue;
- label = (Component) element;
- paintVerticalLabel(g, tmpKey.intValue(), label);
- }
- }
- }
- }
-
- /**
- * This method paints the label on the horizontal slider at the value
- * specified. The value is not a coordinate. It is a value within the range
- * of the slider. If the value is not within the range of the slider, this
- * method will do nothing. This method should not paint outside the
- * boundaries of the labelRect.
- *
- * @param g The {@link Graphics} object to draw with.
- * @param value The value to paint at.
- * @param label The label to paint.
- */
- protected void paintHorizontalLabel(Graphics g, int value, Component label)
- {
- // This relies on clipping working properly or we'll end up
- // painting all over the place. If our preferred size is ignored, then
- // the labels may not fit inside the slider's bounds. Rather than mucking
- // with font sizes and possible icon sizes, we'll set the bounds for
- // the label and let it get clipped.
- Dimension dim = label.getPreferredSize();
- int w = (int) dim.getWidth();
- int h = (int) dim.getHeight();
-
- int max = slider.getMaximum();
- int min = slider.getMinimum();
-
- if (value > max || value < min)
- return;
-
- // value
- // |
- // ------------
- // | |
- // | |
- // | |
- // The label must move w/2 to the right to fit directly under the value.
- int xpos = xPositionForValue(value) - w / 2;
- int ypos = labelRect.y;
-
- // We want to center the label around the xPositionForValue
- // So we use xpos - w / 2. However, if value is min and the label
- // is large, we run the risk of going out of bounds. So we bring it back
- // to 0 if it becomes negative.
- if (xpos < 0)
- xpos = 0;
-
- // If the label + starting x position is greater than
- // the x space in the label rectangle, we reset it to the largest
- // amount possible in the rectangle. This means ugliness.
- if (xpos + w > labelRect.x + labelRect.width)
- w = labelRect.x + labelRect.width - xpos;
-
- // If the label is too tall. We reset it to the height of the label
- // rectangle.
- if (h > labelRect.height)
- h = labelRect.height;
-
- label.setBounds(xpos, ypos, w, h);
- javax.swing.SwingUtilities.paintComponent(g, label, null, label.getBounds());
- }
-
- /**
- * This method paints the label on the vertical slider at the value
- * specified. The value is not a coordinate. It is a value within the range
- * of the slider. If the value is not within the range of the slider, this
- * method will do nothing. This method should not paint outside the
- * boundaries of the labelRect.
- *
- * @param g The {@link Graphics} object to draw with.
- * @param value The value to paint at.
- * @param label The label to paint.
- */
- protected void paintVerticalLabel(Graphics g, int value, Component label)
- {
- Dimension dim = label.getPreferredSize();
- int w = (int) dim.getWidth();
- int h = (int) dim.getHeight();
-
- int max = slider.getMaximum();
- int min = slider.getMinimum();
-
- if (value > max || value < min)
- return;
-
- int xpos = labelRect.x;
- int ypos = yPositionForValue(value) - h / 2;
-
- if (ypos < 0)
- ypos = 0;
-
- if (ypos + h > labelRect.y + labelRect.height)
- h = labelRect.y + labelRect.height - ypos;
-
- if (w > labelRect.width)
- w = labelRect.width;
-
- label.setBounds(xpos, ypos, w, h);
- javax.swing.SwingUtilities.paintComponent(g, label, null, label.getBounds());
- }
-
- /**
- * <p>
- * This method paints a thumb. There are two types of thumb:
- * </p>
- * <pre>
- * Vertical Horizontal
- * a---b a-----b
- * | | | \
- * e c | c
- * \ / | /
- * d e-----d
- * </pre>
- *
- * <p>
- * In the case of vertical thumbs, we highlight the path b-a-e-d and shadow
- * the path b-c-d. In the case of horizontal thumbs, we highlight the path
- * c-b-a-e and shadow the path c-d-e. In both cases we fill the path
- * a-b-c-d-e before shadows and highlights are drawn.
- * </p>
- *
- * @param g The graphics object to paint with
- */
- public void paintThumb(Graphics g)
- {
- Color saved_color = g.getColor();
-
- Polygon thumb = new Polygon();
-
- Point a = new Point(thumbRect.x, thumbRect.y);
- Point b = new Point(a);
- Point c = new Point(a);
- Point d = new Point(a);
- Point e = new Point(a);
-
- Polygon bright;
- Polygon dark;
- Polygon all;
-
- // This will be in X-dimension if the slider is inverted and y if it isn't.
- int turnPoint;
-
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- turnPoint = thumbRect.height * 3 / 4;
-
- b.translate(thumbRect.width, 0);
- c.translate(thumbRect.width, turnPoint);
- d.translate(thumbRect.width / 2, thumbRect.height);
- e.translate(0, turnPoint);
-
- bright = new Polygon(new int[] { b.x, a.x, e.x, d.x },
- new int[] { b.y, a.y, e.y, d.y }, 4);
-
- dark = new Polygon(new int[] { b.x, c.x, d.x },
- new int[] { b.y, c.y, d.y }, 3);
- all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 },
- new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5);
- }
- else
- {
- turnPoint = thumbRect.width * 3 / 4;
-
- b.translate(turnPoint, 0);
- c.translate(thumbRect.width, thumbRect.height / 2);
- d.translate(turnPoint, thumbRect.height);
- e.translate(0, thumbRect.height);
-
- bright = new Polygon(new int[] { c.x, b.x, a.x, e.x },
- new int[] { c.y, b.y, a.y, e.y }, 4);
-
- dark = new Polygon(new int[] { c.x, d.x, e.x + 1 },
- new int[] { c.y, d.y, e.y }, 3);
-
- all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 },
- new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5);
- }
-
- g.setColor(Color.WHITE);
- g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints);
-
- g.setColor(Color.BLACK);
- g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints);
-
- g.setColor(Color.GRAY);
- g.fillPolygon(all);
-
- g.setColor(saved_color);
- }
-
- /**
- * This method sets the position of the thumbRect.
- *
- * @param x The new x position.
- * @param y The new y position.
- */
- public void setThumbLocation(int x, int y)
- {
- thumbRect.x = x;
- thumbRect.y = y;
- }
-
- /**
- * This method is used to move the thumb one block in the direction
- * specified. If the slider snaps to ticks, this method is responsible for
- * snapping it to a tick after the thumb has been moved.
- *
- * @param direction The direction to move in.
- */
- public void scrollByBlock(int direction)
- {
- // The direction is -1 for backwards and 1 for forwards.
- int unit = direction * (slider.getMaximum() - slider.getMinimum()) / 10;
-
- int moveTo = slider.getValue() + unit;
-
- if (slider.getSnapToTicks())
- moveTo = findClosestTick(moveTo);
-
- slider.setValue(moveTo);
- }
-
- /**
- * This method is used to move the thumb one unit in the direction
- * specified. If the slider snaps to ticks, this method is responsible for
- * snapping it to a tick after the thumb has been moved.
- *
- * @param direction The direction to move in.
- */
- public void scrollByUnit(int direction)
- {
- // The direction is -1 for backwards and 1 for forwards.
- int moveTo = slider.getValue() + direction;
-
- if (slider.getSnapToTicks())
- moveTo = findClosestTick(moveTo);
-
- slider.setValue(moveTo);
- }
-
- /**
- * This method is called when there has been a click in the track and the
- * thumb needs to be scrolled on regular intervals. This method is only
- * responsible for starting the timer and not for stopping it.
- *
- * @param dir The direction to move in.
- */
- protected void scrollDueToClickInTrack(int dir)
- {
- scrollTimer.stop();
-
- scrollListener.setDirection(dir);
- scrollListener.setScrollByBlock(true);
-
- scrollTimer.start();
- }
-
- /**
- * This method returns the X coordinate for the value passed in.
- *
- * @param value The value to calculate an x coordinate for.
- *
- * @return The x coordinate for the value.
- */
- protected int xPositionForValue(int value)
- {
- int min = slider.getMinimum();
- int max = slider.getMaximum();
- int extent = slider.getExtent();
- int len = trackRect.width;
-
- int xPos = (max == min) ? 0 : (value - min) * len / (max - min);
-
- if (! drawInverted())
- xPos += trackRect.x;
- else
- {
- xPos = trackRect.width - xPos;
- xPos += trackRect.x;
- }
- return xPos;
- }
-
- /**
- * This method returns the y coordinate for the value passed in.
- *
- * @param value The value to calculate a y coordinate for.
- *
- * @return The y coordinate for the value.
- */
- protected int yPositionForValue(int value)
- {
- int min = slider.getMinimum();
- int max = slider.getMaximum();
- int extent = slider.getExtent();
- int len = trackRect.height;
-
- int yPos = (max == min) ? 0 : (value - min) * len / (max - min);
-
- if (! drawInverted())
- {
- yPos = trackRect.height - yPos;
- yPos += trackRect.y;
- }
- else
- yPos += trackRect.y;
- return yPos;
- }
-
- /**
- * This method returns the value in the slider's range given the y
- * coordinate. If the value is out of range, it will return the closest
- * legal value.
- *
- * @param yPos The y coordinate to calculate a value for.
- *
- * @return The value for the y coordinate.
- */
- public int valueForYPosition(int yPos)
- {
- int min = slider.getMinimum();
- int max = slider.getMaximum();
- int len = trackRect.height;
-
- int value;
-
- // If the length is 0, you shouldn't be able to even see where the slider is.
- // This really shouldn't ever happen, but just in case, we'll return the middle.
- if (len == 0)
- return ((max - min) / 2);
-
- if (! drawInverted())
- value = ((len - (yPos - trackRect.y)) * (max - min) / len + min);
- else
- value = ((yPos - trackRect.y) * (max - min) / len + min);
-
- // If this isn't a legal value, then we'll have to move to one now.
- if (value > max)
- value = max;
- else if (value < min)
- value = min;
- return value;
- }
-
- /**
- * This method returns the value in the slider's range given the x
- * coordinate. If the value is out of range, it will return the closest
- * legal value.
- *
- * @param xPos The x coordinate to calculate a value for.
- *
- * @return The value for the x coordinate.
- */
- public int valueForXPosition(int xPos)
- {
- int min = slider.getMinimum();
- int max = slider.getMaximum();
- int len = trackRect.width;
-
- int value;
-
- // If the length is 0, you shouldn't be able to even see where the slider is.
- // This really shouldn't ever happen, but just in case, we'll return the middle.
- if (len == 0)
- return ((max - min) / 2);
-
- if (! drawInverted())
- value = ((xPos - trackRect.x) * (max - min) / len + min);
- else
- value = ((len - (xPos - trackRect.x)) * (max - min) / len + min);
-
- // If this isn't a legal value, then we'll have to move to one now.
- if (value > max)
- value = max;
- else if (value < min)
- value = min;
- return value;
- }
-
- /**
- * This method finds the closest value that has a tick associated with it.
- * This is package-private to avoid an accessor method.
- *
- * @param value The value to search from.
- *
- * @return The closest value that has a tick associated with it.
- */
- int findClosestTick(int value)
- {
- int min = slider.getMinimum();
- int max = slider.getMaximum();
- int majorSpace = slider.getMajorTickSpacing();
- int minorSpace = slider.getMinorTickSpacing();
-
- // The default value to return is value + minor or
- // value + major.
- // Initializing at min - value leaves us with a default
- // return value of min, which always has tick marks
- // (if ticks are painted).
- int minor = min - value;
- int major = min - value;
-
- // If there are no major tick marks or minor tick marks
- // e.g. snap is set to true but no ticks are set, then
- // we can just return the value.
- if (majorSpace <= 0 && minorSpace <= 0)
- return value;
-
- // First check the major ticks.
- if (majorSpace > 0)
- {
- int lowerBound = (value - min) / majorSpace;
- int majLower = majorSpace * lowerBound + min;
- int majHigher = majorSpace * (lowerBound + 1) + min;
-
- if (majHigher <= max && majHigher - value <= value - majLower)
- major = majHigher - value;
- else
- major = majLower - value;
- }
-
- if (minorSpace > 0)
- {
- int lowerBound = value / minorSpace;
- int minLower = minorSpace * lowerBound;
- int minHigher = minorSpace * (lowerBound + 1);
-
- if (minHigher <= max && minHigher - value <= value - minLower)
- minor = minHigher - value;
- else
- minor = minLower - value;
- }
-
- // Give preference to minor ticks
- if (Math.abs(minor) > Math.abs(major))
- return value + major;
- else
- return value + minor;
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicSpinnerUI.java b/libjava/javax/swing/plaf/basic/BasicSpinnerUI.java
deleted file mode 100644
index 46701a22944..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicSpinnerUI.java
+++ /dev/null
@@ -1,573 +0,0 @@
-/* SpinnerUI.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JSpinner;
-import javax.swing.Timer;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.SpinnerUI;
-
-/**
- * DOCUMENT ME!
- *
- * @author Ka-Hing Cheung
- *
- * @see javax.swing.JSpinner
- * @since 1.4
- */
-public class BasicSpinnerUI extends SpinnerUI
-{
- /**
- * Creates a new <code>ComponentUI</code> for the specified
- * <code>JComponent</code>
- *
- * @param c DOCUMENT ME!
- *
- * @return a ComponentUI
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicSpinnerUI();
- }
-
- /**
- * Creates an editor component. Really, it just returns
- * <code>JSpinner.getEditor()</code>
- *
- * @return a JComponent as an editor
- *
- * @see javax.swing.JSpinner#getEditor
- */
- protected JComponent createEditor()
- {
- return spinner.getEditor();
- }
-
- /**
- * Creates a <code>LayoutManager</code> that layouts the sub components. The
- * subcomponents are identifies by the constraint "Next", "Previous" and
- * "Editor"
- *
- * @return a LayoutManager
- *
- * @see java.awt.LayoutManager
- */
- protected LayoutManager createLayout()
- {
- return new DefaultLayoutManager();
- }
-
- /**
- * Creates the "Next" button
- *
- * @return the next button component
- */
- protected Component createNextButton()
- {
- JButton button = new BasicArrowButton(BasicArrowButton.NORTH);
- return button;
- }
-
- /**
- * Creates the "Previous" button
- *
- * @return the previous button component
- */
- protected Component createPreviousButton()
- {
- JButton button = new BasicArrowButton(BasicArrowButton.SOUTH);
- return button;
- }
-
- /**
- * Creates the <code>PropertyChangeListener</code> that will be attached by
- * <code>installListeners</code>. It should watch for the "editor"
- * property, when it's changed, replace the old editor with the new one,
- * probably by calling <code>replaceEditor</code>
- *
- * @return a PropertyChangeListener
- *
- * @see #replaceEditor
- */
- protected PropertyChangeListener createPropertyChangeListener()
- {
- return new PropertyChangeListener()
- {
- public void propertyChange(PropertyChangeEvent evt)
- {
- // FIXME: Add check for enabled property change. Need to
- // disable the buttons.
- if ("editor".equals(evt.getPropertyName()))
- BasicSpinnerUI.this.replaceEditor((JComponent) evt.getOldValue(),
- (JComponent) evt.getNewValue());
- }
- };
- }
-
- /**
- * Called by <code>installUI</code>. This should set various defaults
- * obtained from <code>UIManager.getLookAndFeelDefaults</code>, as well as
- * set the layout obtained from <code>createLayout</code>
- *
- * @see #javax.swing.UIManager#getLookAndFeelDefaults
- * @see #createLayout
- * @see #installUI
- */
- protected void installDefaults()
- {
- /* most of it copied from BasicLabelUI, I don't know what keys are
- available, so someone may want to update this. Hence: TODO
- */
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- /*
- spinner.setForeground(defaults.getColor("Spinner.foreground"));
- spinner.setBackground(defaults.getColor("Spinner.background"));
- spinner.setFont(defaults.getFont("Spinner.font"));
- spinner.setBorder(defaults.getBorder("Spinner.border"));
- */
- spinner.setLayout(createLayout());
- }
-
- /*
- * Called by <code>installUI</code>, which basically adds the
- * <code>PropertyChangeListener</code> created by
- * <code>createPropertyChangeListener</code>
- *
- * @see #createPropertyChangeListener
- * @see #installUI
- */
- protected void installListeners()
- {
- spinner.addPropertyChangeListener(listener);
- }
-
- /*
- * Install listeners to the next button so that it increments the model
- */
- protected void installNextButtonListeners(Component c)
- {
- c.addMouseListener(new MouseAdapter()
- {
- public void mousePressed(MouseEvent evt)
- {
- if (! spinner.isEnabled())
- return;
- increment();
- timer.setInitialDelay(500);
- timer.start();
- }
-
- public void mouseReleased(MouseEvent evt)
- {
- timer.stop();
- }
-
- void increment()
- {
- Object next = BasicSpinnerUI.this.spinner.getNextValue();
- if (next != null)
- BasicSpinnerUI.this.spinner.getModel().setValue(next);
- }
-
- volatile boolean mouseDown = false;
- Timer timer = new Timer(50,
- new ActionListener()
- {
- public void actionPerformed(ActionEvent event)
- {
- increment();
- }
- });
- });
- }
-
- /*
- * Install listeners to the previous button so that it decrements the model
- */
- protected void installPreviousButtonListeners(Component c)
- {
- c.addMouseListener(new MouseAdapter()
- {
- public void mousePressed(MouseEvent evt)
- {
- if (! spinner.isEnabled())
- return;
- decrement();
- timer.setInitialDelay(500);
- timer.start();
- }
-
- public void mouseReleased(MouseEvent evt)
- {
- timer.stop();
- }
-
- void decrement()
- {
- Object prev = BasicSpinnerUI.this.spinner.getPreviousValue();
- if (prev != null)
- BasicSpinnerUI.this.spinner.getModel().setValue(prev);
- }
-
- volatile boolean mouseDown = false;
- Timer timer = new Timer(50,
- new ActionListener()
- {
- public void actionPerformed(ActionEvent event)
- {
- decrement();
- }
- });
- });
- }
-
- /**
- * Install this UI to the <code>JComponent</code>, which in reality, is a
- * <code>JSpinner</code>. Calls <code>installDefaults</code>,
- * <code>installListeners</code>, and also adds the buttons and editor.
- *
- * @param c DOCUMENT ME!
- *
- * @see #installDefaults
- * @see #installListeners
- * @see #createNextButton
- * @see #createPreviousButton
- * @see #createEditor
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
-
- spinner = (JSpinner) c;
-
- installDefaults();
- installListeners();
-
- Component next = createNextButton();
- Component previous = createPreviousButton();
-
- installNextButtonListeners(next);
- installPreviousButtonListeners(previous);
-
- c.add(createEditor(), "Editor");
- c.add(next, "Next");
- c.add(previous, "Previous");
- }
-
- /**
- * Replace the old editor with the new one
- *
- * @param oldEditor the old editor
- * @param newEditor the new one to replace with
- */
- protected void replaceEditor(JComponent oldEditor, JComponent newEditor)
- {
- spinner.remove(oldEditor);
- spinner.add(newEditor);
- }
-
- /**
- * The reverse of <code>installDefaults</code>. Called by
- * <code>uninstallUI</code>
- */
- protected void uninstallDefaults()
- {
- spinner.setLayout(null);
- }
-
- /**
- * The reverse of <code>installListeners</code>, called by
- * <code>uninstallUI</code>
- */
- protected void uninstallListeners()
- {
- spinner.removePropertyChangeListener(listener);
- }
-
- /**
- * Called when the current L&F is replaced with another one, should call
- * <code>uninstallDefaults</code> and <code>uninstallListeners</code> as
- * well as remove the next/previous buttons and the editor
- *
- * @param c DOCUMENT ME!
- */
- public void uninstallUI(JComponent c)
- {
- super.uninstallUI(c);
-
- uninstallDefaults();
- uninstallListeners();
- c.removeAll();
- }
-
- /** The spinner for this UI */
- protected JSpinner spinner;
-
- /** DOCUMENT ME! */
- private PropertyChangeListener listener = createPropertyChangeListener();
-
- /**
- * DOCUMENT ME!
- */
- private class DefaultLayoutManager implements LayoutManager
- {
- /**
- * DOCUMENT ME!
- *
- * @param parent DOCUMENT ME!
- */
- public void layoutContainer(Container parent)
- {
- synchronized (parent.getTreeLock())
- {
- Insets i = parent.getInsets();
- boolean l2r = parent.getComponentOrientation().isLeftToRight();
- /*
- -------------- --------------
- | | n | | n | |
- | e | - | or | - | e |
- | | p | | p | |
- -------------- --------------
- */
- Dimension e = minSize(editor);
- Dimension n = minSize(next);
- Dimension p = minSize(previous);
- Dimension s = spinner.getPreferredSize();
-
- int x = l2r ? i.left : i.right;
- int y = i.top;
- int w = Math.max(p.width, n.width);
- int h = Math.max(p.height, n.height);
- h = Math.max(h, e.height / 2);
- int e_width = s.width - w;
-
- if (l2r)
- {
- setBounds(editor, x, y + (s.height - e.height) / 2, e_width,
- e.height);
- x += e_width;
-
- setBounds(next, x, y, w, h);
- y += h;
-
- setBounds(previous, x, y, w, h);
- }
- else
- {
- setBounds(next, x, y + (s.height - e.height) / 2, w, h);
- y += h;
-
- setBounds(previous, x, y, w, h);
- x += w;
- y -= h;
-
- setBounds(editor, x, y, e_width, e.height);
- }
- }
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param parent DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Dimension minimumLayoutSize(Container parent)
- {
- Dimension d = new Dimension();
-
- if (editor != null)
- {
- Dimension tmp = editor.getMinimumSize();
- d.width += tmp.width;
- d.height = tmp.height;
- }
-
- int nextWidth = 0;
- int previousWidth = 0;
- int otherHeight = 0;
-
- if (next != null)
- {
- Dimension tmp = next.getMinimumSize();
- nextWidth = tmp.width;
- otherHeight += tmp.height;
- }
- if (previous != null)
- {
- Dimension tmp = previous.getMinimumSize();
- previousWidth = tmp.width;
- otherHeight += tmp.height;
- }
-
- d.height = Math.max(d.height, otherHeight);
- d.width += Math.max(nextWidth, previousWidth);
-
- return d;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param parent DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Dimension preferredLayoutSize(Container parent)
- {
- Dimension d = new Dimension();
-
- if (editor != null)
- {
- Dimension tmp = editor.getPreferredSize();
- d.width += Math.max(tmp.width, 40);
- d.height = tmp.height;
- }
-
- int nextWidth = 0;
- int previousWidth = 0;
- int otherHeight = 0;
-
- if (next != null)
- {
- Dimension tmp = next.getPreferredSize();
- nextWidth = tmp.width;
- otherHeight += tmp.height;
- }
- if (previous != null)
- {
- Dimension tmp = previous.getPreferredSize();
- previousWidth = tmp.width;
- otherHeight += tmp.height;
- }
-
- d.height = Math.max(d.height, otherHeight);
- d.width += Math.max(nextWidth, previousWidth);
-
- return d;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param child DOCUMENT ME!
- */
- public void removeLayoutComponent(Component child)
- {
- if (child == editor)
- editor = null;
- else if (child == next)
- next = null;
- else if (previous == child)
- previous = null;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param name DOCUMENT ME!
- * @param child DOCUMENT ME!
- */
- public void addLayoutComponent(String name, Component child)
- {
- if ("Editor".equals(name))
- editor = child;
- else if ("Next".equals(name))
- next = child;
- else if ("Previous".equals(name))
- previous = child;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param c DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- private Dimension minSize(Component c)
- {
- if (c == null)
- return new Dimension();
- else
- return c.getMinimumSize();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param c DOCUMENT ME!
- * @param x DOCUMENT ME!
- * @param y DOCUMENT ME!
- * @param w DOCUMENT ME!
- * @param h DOCUMENT ME!
- */
- private void setBounds(Component c, int x, int y, int w, int h)
- {
- if (c != null)
- c.setBounds(x, y, w, h);
- }
-
- /** DOCUMENT ME! */
- private Component editor;
-
- /** DOCUMENT ME! */
- private Component next;
-
- /** DOCUMENT ME! */
- private Component previous;
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java
deleted file mode 100644
index ef3bc76f996..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java
+++ /dev/null
@@ -1,912 +0,0 @@
-/* BasicSplitPaneDivider.java --
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseMotionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.JButton;
-import javax.swing.JSplitPane;
-import javax.swing.SwingConstants;
-import javax.swing.border.Border;
-
-/**
- * The divider that separates the two parts of a JSplitPane in the Basic look
- * and feel.
- *
- * <p>
- * Implementation status: We do not have a real implementation yet. Currently,
- * it is mostly a stub to allow compiling other parts of the
- * javax.swing.plaf.basic package, although some parts are already
- * functional.
- * </p>
- *
- * @author Sascha Brawer (brawer_AT_dandelis.ch)
- */
-public class BasicSplitPaneDivider extends Container
- implements PropertyChangeListener
-{
- /**
- * Determined using the <code>serialver</code> tool of Apple/Sun JDK 1.3.1
- * on MacOS X 10.1.5.
- */
- static final long serialVersionUID = 1463404307042803342L;
-
- /**
- * The width and height of the little buttons for showing and hiding parts
- * of a JSplitPane in a single mouse click.
- */
- protected static final int ONE_TOUCH_SIZE = 6;
-
- /** The distance the one touch buttons will sit from the divider's edges. */
- protected static final int ONE_TOUCH_OFFSET = 2;
-
- /**
- * An object that performs the tasks associated with an ongoing drag
- * operation, or <code>null</code> if the user is currently not dragging
- * the divider.
- */
- protected DragController dragger;
-
- /**
- * The delegate object that is responsible for the UI of the
- * <code>JSplitPane</code> that contains this divider.
- */
- protected BasicSplitPaneUI splitPaneUI;
-
- /** The thickness of the divider in pixels. */
- protected int dividerSize;
-
- /** A divider that is used for layout purposes. */
- protected Component hiddenDivider;
-
- /** The JSplitPane containing this divider. */
- protected JSplitPane splitPane;
-
- /**
- * The listener for handling mouse events from both the divider and the
- * containing <code>JSplitPane</code>.
- *
- * <p>
- * The reason for also handling MouseEvents from the containing
- * <code>JSplitPane</code> is that users should be able to start a drag
- * gesture from inside the JSplitPane, but slightly outisde the divider.
- * </p>
- */
- protected MouseHandler mouseHandler = new MouseHandler();
-
- /**
- * The current orientation of the containing <code>JSplitPane</code>, which
- * is either {@link javax.swing.JSplitPane#HORIZONTAL_SPLIT} or {@link
- * javax.swing.JSplitPane#VERTICAL_SPLIT}.
- */
- protected int orientation;
-
- /**
- * The button for showing and hiding the left (or top) component of the
- * <code>JSplitPane</code>.
- */
- protected JButton leftButton;
-
- /**
- * The button for showing and hiding the right (or bottom) component of the
- * <code>JSplitPane</code>.
- */
- protected JButton rightButton;
-
- /**
- * The border of this divider. Typically, this will be an instance of {@link
- * javax.swing.plaf.basic.BasicBorders.SplitPaneDividerBorder}.
- *
- * @see #getBorder()
- * @see #setBorder(javax.swing.border.Border)
- */
- private Border border;
-
- // This is not a pixel count.
- // This int should be able to take 3 values.
- // left (top), middle, right(bottom)
- // 0 1 2
-
- /**
- * Keeps track of where the divider should be placed when using one touch
- * expand buttons.
- * This is package-private to avoid an accessor method.
- */
- transient int currentDividerLocation = 1;
-
- /** DOCUMENT ME! */
- private transient Border tmpBorder = new Border()
- {
- public Insets getBorderInsets(Component c)
- {
- return new Insets(2, 2, 2, 2);
- }
-
- public boolean isBorderOpaque()
- {
- return false;
- }
-
- public void paintBorder(Component c, Graphics g, int x, int y,
- int width, int height)
- {
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- g.drawRect(x + 2, y + 2, width - 4, height - 4);
-
- g.setColor(saved);
- }
- };
-
- /**
- * Constructs a new divider.
- *
- * @param ui the UI delegate of the enclosing <code>JSplitPane</code>.
- */
- public BasicSplitPaneDivider(BasicSplitPaneUI ui)
- {
- setLayout(new DividerLayout());
- setBasicSplitPaneUI(ui);
- setDividerSize(splitPane.getDividerSize());
- setBorder(tmpBorder);
- }
-
- /**
- * Sets the delegate object that is responsible for the UI of the {@link
- * javax.swing.JSplitPane} containing this divider.
- *
- * @param newUI the UI delegate, or <code>null</code> to release the
- * connection to the current delegate.
- */
- public void setBasicSplitPaneUI(BasicSplitPaneUI newUI)
- {
- /* Remove the connection to the existing JSplitPane. */
- if (splitPane != null)
- {
- splitPane.removePropertyChangeListener(this);
- splitPane.removeMouseListener(mouseHandler);
- splitPane.removeMouseMotionListener(mouseHandler);
- removeMouseListener(mouseHandler);
- removeMouseMotionListener(mouseHandler);
- splitPane = null;
- hiddenDivider = null;
- }
-
- /* Establish the connection to the new JSplitPane. */
- splitPaneUI = newUI;
- if (splitPaneUI != null)
- splitPane = newUI.getSplitPane();
- if (splitPane != null)
- {
- splitPane.addPropertyChangeListener(this);
- splitPane.addMouseListener(mouseHandler);
- splitPane.addMouseMotionListener(mouseHandler);
- addMouseListener(mouseHandler);
- addMouseMotionListener(mouseHandler);
- hiddenDivider = splitPaneUI.getNonContinuousLayoutDivider();
- orientation = splitPane.getOrientation();
- oneTouchExpandableChanged();
- }
- }
-
- /**
- * Returns the delegate object that is responsible for the UI of the {@link
- * javax.swing.JSplitPane} containing this divider.
- *
- * @return The UI for the JSplitPane.
- */
- public BasicSplitPaneUI getBasicSplitPaneUI()
- {
- return splitPaneUI;
- }
-
- /**
- * Sets the thickness of the divider.
- *
- * @param newSize the new width or height in pixels.
- */
- public void setDividerSize(int newSize)
- {
- this.dividerSize = newSize;
- }
-
- /**
- * Retrieves the thickness of the divider.
- *
- * @return The thickness of the divider.
- */
- public int getDividerSize()
- {
- return dividerSize;
- }
-
- /**
- * Sets the border of this divider.
- *
- * @param border the new border. Typically, this will be an instance of
- * {@link
- * javax.swing.plaf.basic.BasicBorders.SplitPaneDividerBorder}.
- *
- * @since 1.3
- */
- public void setBorder(Border border)
- {
- if (border != this.border)
- {
- Border oldValue = this.border;
- this.border = border;
- firePropertyChange("border", oldValue, border);
- }
- }
-
- /**
- * Retrieves the border of this divider.
- *
- * @return the current border, or <code>null</code> if no border has been
- * set.
- *
- * @since 1.3
- */
- public Border getBorder()
- {
- return border;
- }
-
- /**
- * Retrieves the insets of the divider. If a border has been installed on
- * the divider, the result of calling its <code>getBorderInsets</code>
- * method is returned. Otherwise, the inherited implementation will be
- * invoked.
- *
- * @see javax.swing.border.Border#getBorderInsets(java.awt.Component)
- */
- public Insets getInsets()
- {
- if (border != null)
- return border.getBorderInsets(this);
- else
- return super.getInsets();
- }
-
- /**
- * Returns the preferred size of this divider, which is
- * <code>dividerSize</code> by <code>dividerSize</code> pixels.
- *
- * @return The preferred size of the divider.
- */
- public Dimension getPreferredSize()
- {
- return getLayout().preferredLayoutSize(this);
- }
-
- /**
- * Returns the minimal size of this divider, which is
- * <code>dividerSize</code> by <code>dividerSize</code> pixels.
- *
- * @return The minimal size of the divider.
- */
- public Dimension getMinimumSize()
- {
- return getPreferredSize();
- }
-
- /**
- * Processes events from the <code>JSplitPane</code> that contains this
- * divider.
- *
- * @param e The PropertyChangeEvent.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getPropertyName().equals(JSplitPane.ONE_TOUCH_EXPANDABLE_PROPERTY))
- oneTouchExpandableChanged();
- else if (e.getPropertyName().equals(JSplitPane.ORIENTATION_PROPERTY))
- {
- orientation = splitPane.getOrientation();
- if (splitPane.isOneTouchExpandable())
- {
- layout();
- repaint();
- }
- }
- else if (e.getPropertyName().equals(JSplitPane.DIVIDER_SIZE_PROPERTY))
- dividerSize = splitPane.getDividerSize();
- }
-
- /**
- * Paints the divider by painting its border.
- *
- * @param g The Graphics Object to paint with.
- */
- public void paint(Graphics g)
- {
- Dimension dividerSize;
-
- super.paint(g);
- if (border != null)
- {
- dividerSize = getSize();
- border.paintBorder(this, g, 0, 0, dividerSize.width, dividerSize.height);
- }
- }
-
- /**
- * Reacts to changes of the <code>oneToughExpandable</code> property of the
- * containing <code>JSplitPane</code>.
- */
- protected void oneTouchExpandableChanged()
- {
- if (splitPane.isOneTouchExpandable())
- {
- leftButton = createLeftOneTouchButton();
- rightButton = createRightOneTouchButton();
- add(leftButton);
- add(rightButton);
-
- leftButton.addMouseListener(mouseHandler);
- rightButton.addMouseListener(mouseHandler);
-
- // Set it to 1.
- currentDividerLocation = 1;
- }
- else
- {
- if (leftButton != null && rightButton != null)
- {
- leftButton.removeMouseListener(mouseHandler);
- rightButton.removeMouseListener(mouseHandler);
-
- remove(leftButton);
- remove(rightButton);
- leftButton = null;
- rightButton = null;
- }
- }
- layout();
- repaint();
- }
-
- /**
- * Creates a button for showing and hiding the left (or top) part of a
- * <code>JSplitPane</code>.
- *
- * @return The left one touch button.
- */
- protected JButton createLeftOneTouchButton()
- {
- int dir = SwingConstants.WEST;
- if (orientation == JSplitPane.VERTICAL_SPLIT)
- dir = SwingConstants.NORTH;
- JButton button = new BasicArrowButton(dir);
- button.setBorder(null);
-
- return button;
- }
-
- /**
- * Creates a button for showing and hiding the right (or bottom) part of a
- * <code>JSplitPane</code>.
- *
- * @return The right one touch button.
- */
- protected JButton createRightOneTouchButton()
- {
- int dir = SwingConstants.EAST;
- if (orientation == JSplitPane.VERTICAL_SPLIT)
- dir = SwingConstants.SOUTH;
- JButton button = new BasicArrowButton(dir);
- button.setBorder(null);
- return button;
- }
-
- /**
- * Prepares the divider for dragging by calling the
- * <code>startDragging</code> method of the UI delegate of the enclosing
- * <code>JSplitPane</code>.
- *
- * @see BasicSplitPaneUI#startDragging()
- */
- protected void prepareForDragging()
- {
- if (splitPaneUI != null)
- splitPaneUI.startDragging();
- }
-
- /**
- * Drags the divider to a given location by calling the
- * <code>dragDividerTo</code> method of the UI delegate of the enclosing
- * <code>JSplitPane</code>.
- *
- * @param location the new location of the divider.
- *
- * @see BasicSplitPaneUI#dragDividerTo(int location)
- */
- protected void dragDividerTo(int location)
- {
- if (splitPaneUI != null)
- splitPaneUI.dragDividerTo(location);
- }
-
- /**
- * Finishes a dragging gesture by calling the <code>finishDraggingTo</code>
- * method of the UI delegate of the enclosing <code>JSplitPane</code>.
- *
- * @param location the new, final location of the divider.
- *
- * @see BasicSplitPaneUI#finishDraggingTo(int location)
- */
- protected void finishDraggingTo(int location)
- {
- if (splitPaneUI != null)
- splitPaneUI.finishDraggingTo(location);
- }
-
- /**
- * This helper method moves the divider to one of the three locations when
- * using one touch expand buttons. Location 0 is the left (or top) most
- * location. Location 1 is the middle. Location 2 is the right (or bottom)
- * most location.
- * This is package-private to avoid an accessor method.
- *
- * @param locationIndex The location to move to.
- */
- void moveDividerTo(int locationIndex)
- {
- Insets insets = splitPane.getInsets();
- switch (locationIndex)
- {
- case 1:
- splitPane.setDividerLocation(splitPane.getLastDividerLocation());
- break;
- case 0:
- int top = (orientation == JSplitPane.HORIZONTAL_SPLIT) ? insets.left
- : insets.top;
- splitPane.setDividerLocation(top);
- break;
- case 2:
- int bottom;
- if (orientation == JSplitPane.HORIZONTAL_SPLIT)
- bottom = splitPane.getBounds().width - insets.right - dividerSize;
- else
- bottom = splitPane.getBounds().height - insets.bottom - dividerSize;
- splitPane.setDividerLocation(bottom);
- break;
- }
- }
-
- /**
- * The listener for handling mouse events from both the divider and the
- * containing <code>JSplitPane</code>.
- *
- * <p>
- * The reason for also handling MouseEvents from the containing
- * <code>JSplitPane</code> is that users should be able to start a drag
- * gesture from inside the JSplitPane, but slightly outisde the divider.
- * </p>
- *
- * @author Sascha Brawer (brawer_AT_dandelis.ch)
- */
- protected class MouseHandler extends MouseAdapter
- implements MouseMotionListener
- {
- /** Keeps track of whether a drag is occurring. */
- private transient boolean isDragging;
-
- /**
- * This method is called when the mouse is pressed.
- *
- * @param e The MouseEvent.
- */
- public void mousePressed(MouseEvent e)
- {
- if (splitPane.isOneTouchExpandable())
- {
- if (e.getSource() == leftButton)
- {
- currentDividerLocation--;
- if (currentDividerLocation < 0)
- currentDividerLocation = 0;
- moveDividerTo(currentDividerLocation);
- return;
- }
- else if (e.getSource() == rightButton)
- {
- currentDividerLocation++;
- if (currentDividerLocation > 2)
- currentDividerLocation = 2;
- moveDividerTo(currentDividerLocation);
- return;
- }
- }
- isDragging = true;
- currentDividerLocation = 1;
- if (orientation == JSplitPane.HORIZONTAL_SPLIT)
- dragger = new DragController(e);
- else
- dragger = new VerticalDragController(e);
- prepareForDragging();
- }
-
- /**
- * This method is called when the mouse is released.
- *
- * @param e The MouseEvent.
- */
- public void mouseReleased(MouseEvent e)
- {
- if (isDragging)
- dragger.completeDrag(e);
- isDragging = false;
- }
-
- /**
- * Repeatedly invoked when the user is dragging the mouse cursor while
- * having pressed a mouse button.
- *
- * @param e The MouseEvent.
- */
- public void mouseDragged(MouseEvent e)
- {
- if (dragger != null)
- dragger.continueDrag(e);
- }
-
- /**
- * Repeatedly invoked when the user is dragging the mouse cursor without
- * having pressed a mouse button.
- *
- * @param e The MouseEvent.
- */
- public void mouseMoved(MouseEvent e)
- {
- // Do nothing.
- }
- }
-
- /**
- * Performs the tasks associated with an ongoing drag operation.
- *
- * @author Sascha Brawer (brawer_AT_dandelis.ch)
- */
- protected class DragController
- {
- /**
- * The difference between where the mouse is clicked and the initial
- * divider location.
- */
- transient int offset;
-
- /**
- * Creates a new DragController object.
- *
- * @param e The MouseEvent to initialize with.
- */
- protected DragController(MouseEvent e)
- {
- offset = e.getX();
- }
-
- /**
- * This method returns true if the divider can move.
- *
- * @return True if dragging is allowed.
- */
- protected boolean isValid()
- {
- // Views can always be resized?
- return true;
- }
-
- /**
- * Returns a position for the divider given the MouseEvent.
- *
- * @param e MouseEvent.
- *
- * @return The position for the divider to move to.
- */
- protected int positionForMouseEvent(MouseEvent e)
- {
- return e.getX() + getX() - offset;
- }
-
- /**
- * This method returns one of the two paramters for the orientation. In
- * this case, it returns x.
- *
- * @param x The x coordinate.
- * @param y The y coordinate.
- *
- * @return The x coordinate.
- */
- protected int getNeededLocation(int x, int y)
- {
- return x;
- }
-
- /**
- * This method is called to pass on the drag information to the UI through
- * dragDividerTo.
- *
- * @param newX The x coordinate of the MouseEvent.
- * @param newY The y coordinate of the MouseEvent.
- */
- protected void continueDrag(int newX, int newY)
- {
- if (isValid())
- dragDividerTo(adjust(newX, newY));
- }
-
- /**
- * This method is called to pass on the drag information to the UI
- * through dragDividerTo.
- *
- * @param e The MouseEvent.
- */
- protected void continueDrag(MouseEvent e)
- {
- if (isValid())
- dragDividerTo(positionForMouseEvent(e));
- }
-
- /**
- * This method is called to finish the drag session by calling
- * finishDraggingTo.
- *
- * @param x The x coordinate of the MouseEvent.
- * @param y The y coordinate of the MouseEvent.
- */
- protected void completeDrag(int x, int y)
- {
- finishDraggingTo(adjust(x, y));
- }
-
- /**
- * This method is called to finish the drag session by calling
- * finishDraggingTo.
- *
- * @param e The MouseEvent.
- */
- protected void completeDrag(MouseEvent e)
- {
- finishDraggingTo(positionForMouseEvent(e));
- }
-
- /**
- * This is a helper method that includes the offset in the needed
- * location.
- *
- * @param x The x coordinate of the MouseEvent.
- * @param y The y coordinate of the MouseEvent.
- *
- * @return The needed location adjusted by the offsets.
- */
- int adjust(int x, int y)
- {
- return getNeededLocation(x, y) + getX() - offset;
- }
- }
-
- /**
- * This is a helper class that controls dragging when the orientation is
- * VERTICAL_SPLIT.
- */
- protected class VerticalDragController extends DragController
- {
- /**
- * Creates a new VerticalDragController object.
- *
- * @param e The MouseEvent to initialize with.
- */
- protected VerticalDragController(MouseEvent e)
- {
- super(e);
- offset = e.getY();
- }
-
- /**
- * This method returns one of the two parameters given the orientation. In
- * this case, it returns y.
- *
- * @param x The x coordinate of the MouseEvent.
- * @param y The y coordinate of the MouseEvent.
- *
- * @return The y coordinate.
- */
- protected int getNeededLocation(int x, int y)
- {
- return y;
- }
-
- /**
- * This method returns the new location of the divider given a MouseEvent.
- *
- * @param e The MouseEvent.
- *
- * @return The new location of the divider.
- */
- protected int positionForMouseEvent(MouseEvent e)
- {
- return e.getY() + getY() - offset;
- }
-
- /**
- * This is a helper method that includes the offset in the needed
- * location.
- *
- * @param x The x coordinate of the MouseEvent.
- * @param y The y coordinate of the MouseEvent.
- *
- * @return The needed location adjusted by the offsets.
- */
- int adjust(int x, int y)
- {
- return getNeededLocation(x, y) + getY() - offset;
- }
- }
-
- /**
- * This helper class acts as the Layout Manager for the divider.
- */
- protected class DividerLayout implements LayoutManager
- {
- /**
- * Creates a new DividerLayout object.
- */
- protected DividerLayout()
- {
- }
-
- /**
- * This method is called when a Component is added.
- *
- * @param string The constraints string.
- * @param c The Component to add.
- */
- public void addLayoutComponent(String string, Component c)
- {
- // Do nothing.
- }
-
- /**
- * This method is called to lay out the container.
- *
- * @param c The container to lay out.
- */
- public void layoutContainer(Container c)
- {
- if (splitPane.isOneTouchExpandable())
- {
- changeButtonOrientation();
- positionButtons();
- }
- }
-
- /**
- * This method returns the minimum layout size.
- *
- * @param c The container to calculate for.
- *
- * @return The minimum layout size.
- */
- public Dimension minimumLayoutSize(Container c)
- {
- return preferredLayoutSize(c);
- }
-
- /**
- * This method returns the preferred layout size.
- *
- * @param c The container to calculate for.
- *
- * @return The preferred layout size.
- */
- public Dimension preferredLayoutSize(Container c)
- {
- return new Dimension(dividerSize, dividerSize);
- }
-
- /**
- * This method is called when a component is removed.
- *
- * @param c The component to remove.
- */
- public void removeLayoutComponent(Component c)
- {
- // Do nothing.
- }
-
- /**
- * This method changes the button orientation when the orientation of the
- * SplitPane changes.
- */
- private void changeButtonOrientation()
- {
- if (orientation == JSplitPane.HORIZONTAL_SPLIT)
- {
- ((BasicArrowButton) rightButton).setDirection(SwingConstants.EAST);
- ((BasicArrowButton) leftButton).setDirection(SwingConstants.WEST);
- }
- else
- {
- ((BasicArrowButton) rightButton).setDirection(SwingConstants.SOUTH);
- ((BasicArrowButton) leftButton).setDirection(SwingConstants.NORTH);
- }
- }
-
- /**
- * This method sizes and positions the buttons.
- */
- private void positionButtons()
- {
- int w = 0;
- int h = 0;
- if (orientation == JSplitPane.HORIZONTAL_SPLIT)
- {
- rightButton.setLocation(ONE_TOUCH_OFFSET, ONE_TOUCH_OFFSET);
- leftButton.setLocation(ONE_TOUCH_OFFSET,
- ONE_TOUCH_OFFSET + 2 * ONE_TOUCH_SIZE);
- w = dividerSize - 2 * ONE_TOUCH_OFFSET;
- h = 2 * ONE_TOUCH_SIZE;
- }
- else
- {
- leftButton.setLocation(ONE_TOUCH_OFFSET, ONE_TOUCH_OFFSET);
- rightButton.setLocation(ONE_TOUCH_OFFSET + 2 * ONE_TOUCH_SIZE,
- ONE_TOUCH_OFFSET);
- h = dividerSize - 2 * ONE_TOUCH_OFFSET;
- w = 2 * ONE_TOUCH_SIZE;
- }
- Dimension dims = new Dimension(w, h);
- leftButton.setSize(dims);
- rightButton.setSize(dims);
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicSplitPaneUI.java b/libjava/javax/swing/plaf/basic/BasicSplitPaneUI.java
deleted file mode 100644
index 85cfbd515fa..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicSplitPaneUI.java
+++ /dev/null
@@ -1,1521 +0,0 @@
-/* BasicSplitPaneUI.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Canvas;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.LayoutManager2;
-import java.awt.Point;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.JComponent;
-import javax.swing.JSplitPane;
-import javax.swing.KeyStroke;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.SplitPaneUI;
-
-/**
- * This is the Basic Look and Feel implementation of the SplitPaneUI class.
- */
-public class BasicSplitPaneUI extends SplitPaneUI
-{
- /**
- * This Layout Manager controls the position and size of the components when
- * the JSplitPane's orientation is HORIZONTAL_SPLIT.
- */
- protected class BasicHorizontalLayoutManager implements LayoutManager2
- {
- // 3 components at a time.
- // LEFT/TOP = 0
- // RIGHT/BOTTOM = 1
- // DIVIDER = 2
-
- /**
- * This array contains the components in the JSplitPane. The left/top
- * component is at index 0, the right/bottom is at 1, and the divider is
- * at 2.
- */
- protected Component[] components = new Component[3];
-
- // These are the _current_ widths of the associated component.
-
- /**
- * This array contains the current width (for HORIZONTAL_SPLIT) or height
- * (for VERTICAL_SPLIT) of the components. The indices are the same as
- * for components.
- */
- protected int[] sizes = new int[3];
-
- /**
- * This method adds the component given to the JSplitPane. The position of
- * the component is given by the constraints object.
- *
- * @param comp The Component to add.
- * @param constraints The constraints that bind the object.
- */
- public void addLayoutComponent(Component comp, Object constraints)
- {
- addLayoutComponent((String) constraints, comp);
- }
-
- /**
- * This method is called to add a Component to the JSplitPane. The
- * placement string determines where the Component will be placed. The
- * string should be one of LEFT, RIGHT, TOP, BOTTOM or null (signals that
- * the component is the divider).
- *
- * @param place The placement of the Component.
- * @param component The Component to add.
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- */
- public void addLayoutComponent(String place, Component component)
- {
- int i = 0;
- if (place == null)
- i = 2;
- else if (place.equals(JSplitPane.TOP) || place.equals(JSplitPane.LEFT))
- i = 0;
- else if (place.equals(JSplitPane.BOTTOM)
- || place.equals(JSplitPane.RIGHT))
- i = 1;
- else
- throw new IllegalArgumentException("Illegal placement in JSplitPane");
- components[i] = component;
- resetSizeAt(i);
- splitPane.revalidate();
- splitPane.repaint();
- }
-
- /**
- * This method returns the width of the JSplitPane minus the insets.
- *
- * @param containerSize The Dimensions of the JSplitPane.
- * @param insets The Insets of the JSplitPane.
- *
- * @return The width of the JSplitPane minus the insets.
- */
- protected int getAvailableSize(Dimension containerSize, Insets insets)
- {
- return containerSize.width - insets.left - insets.right;
- }
-
- /**
- * This method returns the given insets left value. If the given inset is
- * null, then 0 is returned.
- *
- * @param insets The Insets to use with the JSplitPane.
- *
- * @return The inset's left value.
- */
- protected int getInitialLocation(Insets insets)
- {
- if (insets != null)
- return insets.left;
- return 0;
- }
-
- /**
- * This specifies how a component is aligned with respect to other
- * components in the x fdirection.
- *
- * @param target The container.
- *
- * @return The component's alignment.
- */
- public float getLayoutAlignmentX(Container target)
- {
- return target.getAlignmentX();
- }
-
- /**
- * This specifies how a component is aligned with respect to other
- * components in the y direction.
- *
- * @param target The container.
- *
- * @return The component's alignment.
- */
- public float getLayoutAlignmentY(Container target)
- {
- return target.getAlignmentY();
- }
-
- /**
- * This method returns the preferred width of the component.
- *
- * @param c The component to measure.
- *
- * @return The preferred width of the component.
- */
- protected int getPreferredSizeOfComponent(Component c)
- {
- Dimension dims = c.getPreferredSize();
- if (dims != null)
- return dims.width;
- return 0;
- }
-
- /**
- * This method returns the current width of the component.
- *
- * @param c The component to measure.
- *
- * @return The width of the component.
- */
- protected int getSizeOfComponent(Component c)
- {
- return c.getWidth();
- }
-
- /**
- * This method returns the sizes array.
- *
- * @return The sizes array.
- */
- protected int[] getSizes()
- {
- return sizes;
- }
-
- /**
- * This method invalidates the layout. It does nothing.
- *
- * @param c The container to invalidate.
- */
- public void invalidateLayout(Container c)
- {
- // DO NOTHING
- }
-
- /**
- * This method lays out the components in the container.
- *
- * @param container The container to lay out.
- */
- public void layoutContainer(Container container)
- {
- if (container instanceof JSplitPane)
- {
- JSplitPane split = (JSplitPane) container;
- distributeExtraSpace();
- Insets insets = split.getInsets();
- int width = getInitialLocation(insets);
- Dimension dims = split.getSize();
- for (int i = 0; i < components.length; i += 2)
- {
- if (components[i] == null)
- continue;
- setComponentToSize(components[i], sizes[i], width, insets, dims);
- width += sizes[i];
- }
- if (components[1] != null)
- {
- setComponentToSize(components[1], sizes[1], width, insets, dims);
- width += sizes[1];
- }
- }
- }
-
- /**
- * This method returns the maximum size for the container given the
- * components. It returns a new Dimension object that has width and
- * height equal to Integer.MAX_VALUE.
- *
- * @param target The container to measure.
- *
- * @return The maximum size.
- */
- public Dimension maximumLayoutSize(Container target)
- {
- return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
- }
-
- /**
- * This method returns the container's minimum size. The minimum width is
- * the sum of all the component's minimum widths. The minimum height is
- * the maximum of all the components' minimum heights.
- *
- * @param target The container to measure.
- *
- * @return The minimum size.
- */
- public Dimension minimumLayoutSize(Container target)
- {
- if (target instanceof JSplitPane)
- {
- JSplitPane split = (JSplitPane) target;
- Insets insets = target.getInsets();
-
- int height = 0;
- int width = 0;
- for (int i = 0; i < components.length; i++)
- {
- if (components[i] == null)
- continue;
- Dimension dims = components[i].getMinimumSize();
- if (dims != null)
- {
- width += dims.width;
- height = Math.max(height, dims.height);
- }
- }
- return new Dimension(width, height);
- }
- return null;
- }
-
- /**
- * This method returns the container's preferred size. The preferred width
- * is the sum of all the component's preferred widths. The preferred
- * height is the maximum of all the components' preferred heights.
- *
- * @param target The container to measure.
- *
- * @return The preferred size.
- */
- public Dimension preferredLayoutSize(Container target)
- {
- if (target instanceof JSplitPane)
- {
- JSplitPane split = (JSplitPane) target;
- Insets insets = target.getInsets();
-
- int height = 0;
- int width = 0;
- for (int i = 0; i < components.length; i++)
- {
- if (components[i] == null)
- continue;
- Dimension dims = components[i].getPreferredSize();
- if (dims != null)
- {
- width += dims.width;
- if (! (components[i] instanceof BasicSplitPaneDivider))
- height = Math.max(height, dims.height);
- }
- }
- return new Dimension(500, 500); //width, height);
- }
- return null;
- }
-
- /**
- * This method removes the component from the layout.
- *
- * @param component The component to remove from the layout.
- */
- public void removeLayoutComponent(Component component)
- {
- for (int i = 0; i < components.length; i++)
- {
- if (component == components[i])
- {
- components[i] = null;
- sizes[i] = 0;
- }
- }
- }
-
- /**
- * This method resets the size of Component to the preferred size.
- *
- * @param index The index of the component to reset.
- */
- protected void resetSizeAt(int index)
- {
- if (components[index] != null)
- sizes[index] = getPreferredSizeOfComponent(components[index]);
- }
-
- /**
- * This method resets the sizes of all the components.
- */
- public void resetToPreferredSizes()
- {
- for (int i = 0; i < components.length; i++)
- resetSizeAt(i);
- }
-
- /**
- * This methods sets the bounds of the given component. The width is the
- * size. The height is the container size minus the top and bottom
- * inset. The x coordinate is the location given. The y coordinate is
- * the top inset.
- *
- * @param c The component to set.
- * @param size The width of the component.
- * @param location The x coordinate.
- * @param insets The insets to use.
- * @param containerSize The height of the container.
- */
- protected void setComponentToSize(Component c, int size, int location,
- Insets insets, Dimension containerSize)
- {
- int w = size;
- int h = containerSize.height - insets.top - insets.bottom;
- int x = location;
- int y = insets.top;
- c.setBounds(x, y, w, h);
- }
-
- /**
- * This method stores the given int array as the new sizes array.
- *
- * @param newSizes The array to use as sizes.
- */
- protected void setSizes(int[] newSizes)
- {
- sizes = newSizes;
- }
-
- /**
- * This method determines the size of each component. It should be called
- * when a new Layout Manager is created for an existing JSplitPane.
- */
- protected void updateComponents()
- {
- Component left = splitPane.getLeftComponent();
- Component right = splitPane.getRightComponent();
-
- if (left != null)
- {
- components[0] = left;
- resetSizeAt(0);
- }
- if (right != null)
- {
- components[1] = right;
- resetSizeAt(1);
- }
- components[2] = divider;
- resetSizeAt(2);
- }
-
- /**
- * This method resizes the left and right components to fit inside the
- * JSplitPane when there is extra space.
- */
- void distributeExtraSpace()
- {
- int availSize = getAvailableSize(splitPane.getSize(),
- splitPane.getInsets());
- int[] newSizes = new int[3];
- double weight = splitPane.getResizeWeight();
-
- int oldLen = sizes[0] + sizes[1];
-
- // dividers don't change size.
- availSize -= sizes[2] + oldLen;
-
- int rightAlloc = (int) (availSize * (1 - weight));
- int leftAlloc = availSize - rightAlloc;
-
- sizes[0] += leftAlloc;
- sizes[1] += rightAlloc;
- }
-
- /**
- * This method returns the minimum width of the component at the given
- * index.
- *
- * @param index The index to check.
- *
- * @return The minimum width.
- */
- int minimumSizeOfComponent(int index)
- {
- Dimension dims = components[index].getMinimumSize();
- if (dims != null)
- return dims.width;
- else
- return 0;
- }
- } //end BasicHorizontalLayoutManager
-
- /**
- * This class is the Layout Manager for the JSplitPane when the orientation
- * is VERTICAL_SPLIT.
- */
- protected class BasicVerticalLayoutManager
- extends BasicHorizontalLayoutManager
- {
- /**
- * This method returns the height of the container minus the top and
- * bottom inset.
- *
- * @param containerSize The size of the container.
- * @param insets The insets of the container.
- *
- * @return The height minus top and bottom inset.
- */
- protected int getAvailableSize(Dimension containerSize, Insets insets)
- {
- return containerSize.height - insets.top - insets.bottom;
- }
-
- /**
- * This method returns the top inset.
- *
- * @param insets The Insets to use.
- *
- * @return The top inset.
- */
- protected int getInitialLocation(Insets insets)
- {
- return insets.top;
- }
-
- /**
- * This method returns the preferred height of the component.
- *
- * @param c The component to measure.
- *
- * @return The preferred height of the component.
- */
- protected int getPreferredSizeOfComponent(Component c)
- {
- Dimension dims = c.getPreferredSize();
- if (dims != null)
- return dims.height;
- return 0;
- }
-
- /**
- * This method returns the current height of the component.
- *
- * @param c The component to measure.
- *
- * @return The current height of the component.
- */
- protected int getSizeOfComponent(Component c)
- {
- return c.getHeight();
- }
-
- /**
- * This method returns the minimum layout size. The minimum height is the
- * sum of all the components' minimum heights. The minimum width is the
- * maximum of all the components' minimum widths.
- *
- * @param container The container to measure.
- *
- * @return The minimum size.
- */
- public Dimension minimumLayoutSize(Container container)
- {
- if (container instanceof JSplitPane)
- {
- JSplitPane split = (JSplitPane) container;
- Insets insets = container.getInsets();
-
- int height = 0;
- int width = 0;
- for (int i = 0; i < components.length; i++)
- {
- if (components[i] == null)
- continue;
- Dimension dims = components[i].getMinimumSize();
- if (dims != null)
- {
- height += dims.height;
- width = Math.max(width, dims.width);
- }
- }
- return new Dimension(width, height);
- }
- return null;
- }
-
- /**
- * This method returns the preferred layout size. The preferred height is
- * the sum of all the components' preferred heights. The preferred width
- * is the maximum of all the components' preferred widths.
- *
- * @param container The container to measure.
- *
- * @return The preferred size.
- */
- public Dimension preferredLayoutSize(Container container)
- {
- if (container instanceof JSplitPane)
- {
- JSplitPane split = (JSplitPane) container;
- Insets insets = container.getInsets();
-
- int height = 0;
- int width = 0;
- for (int i = 0; i < components.length; i++)
- {
- if (components[i] == null)
- continue;
- Dimension dims = components[i].getPreferredSize();
- if (dims != null)
- {
- height += dims.height;
- width = Math.max(width, dims.width);
- }
- }
- return new Dimension(500, 500); //width, height);
- }
- return null;
- }
-
- /**
- * This method sets the bounds of the given component. The y coordinate is
- * the location given. The x coordinate is the left inset. The height is
- * the size given. The width is the container size minus the left and
- * right inset.
- *
- * @param c The component to set bounds for.
- * @param size The height.
- * @param location The y coordinate.
- * @param insets The insets to use.
- * @param containerSize The container's size.
- */
- protected void setComponentToSize(Component c, int size, int location,
- Insets insets, Dimension containerSize)
- {
- int y = location;
- int x = insets.left;
- int h = size;
- int w = containerSize.width - insets.left - insets.right;
-
- c.setBounds(x, y, w, h);
- }
-
- /**
- * This method returns the minimum height of the component at the given
- * index.
- *
- * @param index The index of the component to check.
- *
- * @return The minimum height of the given component.
- */
- int minimumSizeOfComponent(int index)
- {
- Dimension dims = components[index].getMinimumSize();
- if (dims != null)
- return dims.height;
- else
- return 0;
- }
- }
-
- /**
- * This class handles FocusEvents from the JComponent.
- */
- protected class FocusHandler extends FocusAdapter
- {
- /**
- * This method is called when the JSplitPane gains focus.
- *
- * @param ev The FocusEvent.
- */
- public void focusGained(FocusEvent ev)
- {
- // FIXME: implement.
- }
-
- /**
- * This method is called when the JSplitPane loses focus.
- *
- * @param ev The FocusEvent.
- */
- public void focusLost(FocusEvent ev)
- {
- // FIXME: implement.
- }
- }
-
- /**
- * This is a deprecated class. It is supposed to be used for handling down
- * and right key presses.
- */
- public class KeyboardDownRightHandler implements ActionListener
- {
- /**
- * This method is called when the down or right keys are pressed.
- *
- * @param ev The ActionEvent
- */
- public void actionPerformed(ActionEvent ev)
- {
- // FIXME: implement.
- }
- }
-
- /**
- * This is a deprecated class. It is supposed to be used for handling end
- * key presses.
- */
- public class KeyboardEndHandler implements ActionListener
- {
- /**
- * This method is called when the end key is pressed.
- *
- * @param ev The ActionEvent.
- */
- public void actionPerformed(ActionEvent ev)
- {
- // FIXME: implement.
- }
- }
-
- /**
- * This is a deprecated class. It is supposed to be used for handling home
- * key presses.
- */
- public class KeyboardHomeHandler implements ActionListener
- {
- /**
- * This method is called when the home key is pressed.
- *
- * @param ev The ActionEvent.
- */
- public void actionPerformed(ActionEvent ev)
- {
- // FIXME: implement.
- }
- }
-
- /**
- * This is a deprecated class. It is supposed to be used for handling resize
- * toggles.
- */
- public class KeyboardResizeToggleHandler implements ActionListener
- {
- /**
- * This method is called when a resize is toggled.
- *
- * @param ev The ActionEvent.
- */
- public void actionPerformed(ActionEvent ev)
- {
- // FIXME: implement.
- }
- }
-
- /**
- * This is a deprecated class. It is supposed to be used for handler up and
- * left key presses.
- */
- public class KeyboardUpLeftHandler implements ActionListener
- {
- /**
- * This method is called when the left or up keys are pressed.
- *
- * @param ev The ActionEvent.
- */
- public void actionPerformed(ActionEvent ev)
- {
- // FIXME: implement.
- }
- }
-
- /**
- * This helper class handles PropertyChangeEvents from the JSplitPane. When
- * a property changes, this will update the UI accordingly.
- */
- public class PropertyHandler implements PropertyChangeListener
- {
- /**
- * This method is called whenever one of the JSplitPane's properties
- * change.
- *
- * @param e DOCUMENT ME!
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getPropertyName().equals(JSplitPane.DIVIDER_SIZE_PROPERTY))
- {
- int newSize = splitPane.getDividerSize();
- int[] tmpSizes = layoutManager.getSizes();
- dividerSize = tmpSizes[2];
- Component left = splitPane.getLeftComponent();
- Component right = splitPane.getRightComponent();
- int newSpace = newSize - tmpSizes[2];
-
- tmpSizes[2] = newSize;
-
- tmpSizes[0] += newSpace / 2;
- tmpSizes[1] += newSpace / 2;
-
- layoutManager.setSizes(tmpSizes);
- }
- else if (e.getPropertyName().equals(JSplitPane.ORIENTATION_PROPERTY))
- {
- int max = layoutManager.getAvailableSize(splitPane.getSize(),
- splitPane.getInsets());
- int dividerLoc = getDividerLocation(splitPane);
- double prop = ((double) dividerLoc) / max;
-
- resetLayoutManager();
- if (prop <= 1 && prop >= 0)
- splitPane.setDividerLocation(prop);
- }
- layoutManager.layoutContainer(splitPane);
- splitPane.repaint();
- // Don't have to deal with continuous_layout - only
- // necessary in dragging modes (and it's checked
- // every time you drag there)
- // Don't have to deal with resize_weight (as there
- // will be no extra space associated with this
- // event - the changes to the weighting will
- // be taken into account the next time the
- // sizes change.)
- // Don't have to deal with divider_location
- // The method in JSplitPane calls our setDividerLocation
- // so we'll know about those anyway.
- // Don't have to deal with last_divider_location
- // Although I'm not sure why, it doesn't seem to
- // have any effect on Sun's JSplitPane.
- // one_touch_expandable changes are dealt with
- // by our divider.
- }
- }
-
- /** The location of the divider when dragging began. */
- protected int beginDragDividerLocation;
-
- /** The size of the divider while dragging. */
- protected int dividerSize;
-
- /** The location where the last drag location ended. */
- transient int lastDragLocation = -1;
-
- /** The distance the divider is moved when moved by keyboard actions. */
- protected static int KEYBOARD_DIVIDER_MOVE_OFFSET;
-
- /** The divider that divides this JSplitPane. */
- protected BasicSplitPaneDivider divider;
-
- /** The listener that listens for PropertyChangeEvents from the JSplitPane. */
- protected PropertyChangeListener propertyChangeListener;
-
- /** The JSplitPane's focus handler. */
- protected FocusListener focusListener;
-
- /** @deprecated The handler for down and right key presses. */
- protected ActionListener keyboardDownRightListener;
-
- /** @deprecated The handler for end key presses. */
- protected ActionListener keyboardEndListener;
-
- /** @deprecated The handler for home key presses. */
- protected ActionListener keyboardHomeListener;
-
- /** @deprecated The handler for toggling resizes. */
- protected ActionListener keyboardResizeToggleListener;
-
- /** @deprecated The handler for up and left key presses. */
- protected ActionListener keyboardUpLeftListener;
-
- /** The JSplitPane's current layout manager. */
- protected BasicHorizontalLayoutManager layoutManager;
-
- /** @deprecated The divider resize toggle key. */
- protected KeyStroke dividerResizeToggleKey;
-
- /** @deprecated The down key. */
- protected KeyStroke downKey;
-
- /** @deprecated The end key. */
- protected KeyStroke endKey;
-
- /** @deprecated The home key. */
- protected KeyStroke homeKey;
-
- /** @deprecated The left key. */
- protected KeyStroke leftKey;
-
- /** @deprecated The right key. */
- protected KeyStroke rightKey;
-
- /** @deprecated The up key. */
- protected KeyStroke upKey;
-
- /** Set to true when dragging heavy weight components. */
- protected boolean draggingHW;
-
- /**
- * The constraints object used when adding the non-continuous divider to the
- * JSplitPane.
- */
- protected static final String NON_CONTINUOUS_DIVIDER
- = "nonContinuousDivider";
-
- /** The dark divider used when dragging in non-continuous layout mode. */
- protected Component nonContinuousLayoutDivider;
-
- /** The JSplitPane that this UI draws. */
- protected JSplitPane splitPane;
-
- /**
- * Creates a new BasicSplitPaneUI object.
- */
- public BasicSplitPaneUI()
- {
- }
-
- /**
- * This method creates a new BasicSplitPaneUI for the given JComponent.
- *
- * @param x The JComponent to create a UI for.
- *
- * @return A new BasicSplitPaneUI.
- */
- public static ComponentUI createUI(JComponent x)
- {
- return new BasicSplitPaneUI();
- }
-
- /**
- * This method installs the BasicSplitPaneUI for the given JComponent.
- *
- * @param c The JComponent to install the UI for.
- */
- public void installUI(JComponent c)
- {
- if (c instanceof JSplitPane)
- {
- splitPane = (JSplitPane) c;
- installDefaults();
- installListeners();
- installKeyboardActions();
- }
- }
-
- /**
- * This method uninstalls the BasicSplitPaneUI for the given JComponent.
- *
- * @param c The JComponent to uninstall the UI for.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallKeyboardActions();
- uninstallListeners();
- uninstallDefaults();
-
- splitPane = null;
- }
-
- /**
- * This method installs the defaults given by the Look and Feel.
- */
- protected void installDefaults()
- {
- resetLayoutManager();
- divider = createDefaultDivider();
- nonContinuousLayoutDivider = createDefaultNonContinuousLayoutDivider();
- splitPane.add(divider, JSplitPane.DIVIDER);
-
- // There is no need to add the nonContinuousLayoutDivider
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- splitPane.setBackground(defaults.getColor("SplitPane.background"));
- splitPane.setBorder(defaults.getBorder("SplitPane.border"));
- splitPane.setDividerSize(defaults.getInt("SplitPane.dividerSize"));
- }
-
- /**
- * This method uninstalls the defaults and nulls any objects created during
- * install.
- */
- protected void uninstallDefaults()
- {
- layoutManager = null;
- splitPane.remove(divider);
- divider = null;
- nonContinuousLayoutDivider = null;
-
- splitPane.setBackground(null);
- splitPane.setBorder(null);
- }
-
- /**
- * This method installs the listeners needed for this UI to function.
- */
- protected void installListeners()
- {
- propertyChangeListener = createPropertyChangeListener();
- focusListener = createFocusListener();
-
- splitPane.addPropertyChangeListener(propertyChangeListener);
- splitPane.addFocusListener(focusListener);
- }
-
- /**
- * This method uninstalls all listeners registered for the UI.
- */
- protected void uninstallListeners()
- {
- splitPane.removePropertyChangeListener(propertyChangeListener);
- splitPane.removeFocusListener(focusListener);
-
- focusListener = null;
- propertyChangeListener = null;
- }
-
- /**
- * This method installs the keyboard actions for the JSplitPane.
- */
- protected void installKeyboardActions()
- {
- // FIXME: implement.
- }
-
- /**
- * This method reverses the work done in installKeyboardActions.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: implement.
- }
-
- /**
- * This method creates a new PropertyChangeListener.
- *
- * @return A new PropertyChangeListener.
- */
- protected PropertyChangeListener createPropertyChangeListener()
- {
- return new PropertyHandler();
- }
-
- /**
- * This method creates a new FocusListener.
- *
- * @return A new FocusListener.
- */
- protected FocusListener createFocusListener()
- {
- return new FocusHandler();
- }
-
- /**
- * This method creates a new ActionListener for up and left key presses.
- *
- * @return A new ActionListener for up and left keys.
- *
- * @deprecated 1.3
- */
- protected ActionListener createKeyboardUpLeftListener()
- {
- return new KeyboardUpLeftHandler();
- }
-
- /**
- * This method creates a new ActionListener for down and right key presses.
- *
- * @return A new ActionListener for down and right keys.
- *
- * @deprecated 1.3
- */
- protected ActionListener createKeyboardDownRightListener()
- {
- return new KeyboardDownRightHandler();
- }
-
- /**
- * This method creates a new ActionListener for home key presses.
- *
- * @return A new ActionListener for home keys.
- *
- * @deprecated
- */
- protected ActionListener createKeyboardHomeListener()
- {
- return new KeyboardHomeHandler();
- }
-
- /**
- * This method creates a new ActionListener for end key presses.i
- *
- * @return A new ActionListener for end keys.
- *
- * @deprecated 1.3
- */
- protected ActionListener createKeyboardEndListener()
- {
- return new KeyboardEndHandler();
- }
-
- /**
- * This method creates a new ActionListener for resize toggle key events.
- *
- * @return A new ActionListener for resize toggle keys.
- *
- * @deprecated 1.3
- */
- protected ActionListener createKeyboardResizeToggleListener()
- {
- return new KeyboardResizeToggleHandler();
- }
-
- /**
- * This method returns the orientation of the JSplitPane.
- *
- * @return The orientation of the JSplitPane.
- */
- public int getOrientation()
- {
- return splitPane.getOrientation();
- }
-
- /**
- * This method sets the orientation of the JSplitPane.
- *
- * @param orientation The new orientation of the JSplitPane.
- */
- public void setOrientation(int orientation)
- {
- splitPane.setOrientation(orientation);
- }
-
- /**
- * This method returns true if the JSplitPane is using continuous layout.
- *
- * @return True if the JSplitPane is using continuous layout.
- */
- public boolean isContinuousLayout()
- {
- return splitPane.isContinuousLayout();
- }
-
- /**
- * This method sets the continuous layout property of the JSplitPane.
- *
- * @param b True if the JsplitPane is to use continuous layout.
- */
- public void setContinuousLayout(boolean b)
- {
- splitPane.setContinuousLayout(b);
- }
-
- /**
- * This method returns the last location the divider was dragged to.
- *
- * @return The last location the divider was dragged to.
- */
- public int getLastDragLocation()
- {
- return lastDragLocation;
- }
-
- /**
- * This method sets the last location the divider was dragged to.
- *
- * @param l The last location the divider was dragged to.
- */
- public void setLastDragLocation(int l)
- {
- lastDragLocation = l;
- }
-
- /**
- * This method returns the BasicSplitPaneDivider that divides this
- * JSplitPane.
- *
- * @return The divider for the JSplitPane.
- */
- public BasicSplitPaneDivider getDivider()
- {
- return divider;
- }
-
- /**
- * This method creates a nonContinuousLayoutDivider for use with the
- * JSplitPane in nonContinousLayout mode. The default divider is a gray
- * Canvas.
- *
- * @return The default nonContinousLayoutDivider.
- */
- protected Component createDefaultNonContinuousLayoutDivider()
- {
- if (nonContinuousLayoutDivider == null)
- {
- nonContinuousLayoutDivider = new Canvas();
- nonContinuousLayoutDivider.setBackground(Color.DARK_GRAY);
- }
- return nonContinuousLayoutDivider;
- }
-
- /**
- * This method sets the component to use as the nonContinuousLayoutDivider.
- *
- * @param newDivider The component to use as the nonContinuousLayoutDivider.
- */
- protected void setNonContinuousLayoutDivider(Component newDivider)
- {
- setNonContinuousLayoutDivider(newDivider, true);
- }
-
- /**
- * This method sets the component to use as the nonContinuousLayoutDivider.
- *
- * @param newDivider The component to use as the nonContinuousLayoutDivider.
- * @param rememberSizes FIXME: document.
- */
- protected void setNonContinuousLayoutDivider(Component newDivider,
- boolean rememberSizes)
- {
- // FIXME: use rememberSizes for something
- nonContinuousLayoutDivider = newDivider;
- }
-
- /**
- * This method returns the nonContinuousLayoutDivider.
- *
- * @return The nonContinuousLayoutDivider.
- */
- public Component getNonContinuousLayoutDivider()
- {
- return nonContinuousLayoutDivider;
- }
-
- /**
- * This method returns the JSplitPane that this BasicSplitPaneUI draws.
- *
- * @return The JSplitPane.
- */
- public JSplitPane getSplitPane()
- {
- return splitPane;
- }
-
- /**
- * This method creates the divider used normally with the JSplitPane.
- *
- * @return The default divider.
- */
- public BasicSplitPaneDivider createDefaultDivider()
- {
- if (divider == null)
- divider = new BasicSplitPaneDivider(this);
- return divider;
- }
-
- /**
- * This method is called when JSplitPane's resetToPreferredSizes is called.
- * It resets the sizes of all components in the JSplitPane.
- *
- * @param jc The JSplitPane to reset.
- */
- public void resetToPreferredSizes(JSplitPane jc)
- {
- layoutManager.resetToPreferredSizes();
- }
-
- /**
- * This method sets the location of the divider.
- *
- * @param jc The JSplitPane to set the divider location in.
- * @param location The new location of the divider.
- */
- public void setDividerLocation(JSplitPane jc, int location)
- {
- setLastDragLocation(getDividerLocation(splitPane));
- splitPane.setLastDividerLocation(getDividerLocation(splitPane));
- int[] tmpSizes = layoutManager.getSizes();
- tmpSizes[0] = location
- - layoutManager.getInitialLocation(splitPane.getInsets());
- tmpSizes[1] = layoutManager.getAvailableSize(splitPane.getSize(),
- splitPane.getInsets())
- - tmpSizes[0] - tmpSizes[1];
-
- layoutManager.setSizes(tmpSizes);
- splitPane.revalidate();
- splitPane.repaint();
- }
-
- /**
- * This method returns the location of the divider.
- *
- * @param jc The JSplitPane to retrieve the location for.
- *
- * @return The location of the divider.
- */
- public int getDividerLocation(JSplitPane jc)
- {
- return layoutManager.sizes[0]
- + layoutManager.getInitialLocation(splitPane.getInsets());
- }
-
- /**
- * This method returns the smallest value possible for the location of the
- * divider.
- *
- * @param jc The JSplitPane.
- *
- * @return The minimum divider location.
- */
- public int getMinimumDividerLocation(JSplitPane jc)
- {
- int value = layoutManager.getInitialLocation(jc.getInsets());
- if (layoutManager.components[0] != null)
- value += layoutManager.minimumSizeOfComponent(0);
- return value;
- }
-
- /**
- * This method returns the largest value possible for the location of the
- * divider.
- *
- * @param jc The JSplitPane.
- *
- * @return The maximum divider location.
- */
- public int getMaximumDividerLocation(JSplitPane jc)
- {
- int value = layoutManager.getInitialLocation(jc.getInsets())
- + layoutManager.getAvailableSize(jc.getSize(), jc.getInsets())
- - splitPane.getDividerSize();
- if (layoutManager.components[1] != null)
- value -= layoutManager.minimumSizeOfComponent(1);
- return value;
- }
-
- /**
- * This method is called after the children of the JSplitPane are painted.
- *
- * @param jc The JSplitPane.
- * @param g The Graphics object to paint with.
- */
- public void finishedPaintingChildren(JSplitPane jc, Graphics g)
- {
- if (! splitPane.isContinuousLayout() && nonContinuousLayoutDivider != null
- && nonContinuousLayoutDivider.isVisible())
- javax.swing.SwingUtilities.paintComponent(g, nonContinuousLayoutDivider,
- null,
- nonContinuousLayoutDivider
- .getBounds());
- }
-
- /**
- * This method is called to paint the JSplitPane.
- *
- * @param g The Graphics object to paint with.
- * @param jc The JSplitPane to paint.
- */
- public void paint(Graphics g, JComponent jc)
- {
- // Do nothing. All the painting is handled by children.
- }
-
- /**
- * This method returns the preferred size of the JSplitPane.
- *
- * @param jc The JSplitPane.
- *
- * @return The preferred size of the JSplitPane.
- */
- public Dimension getPreferredSize(JComponent jc)
- {
- return layoutManager.preferredLayoutSize((Container) jc);
- }
-
- /**
- * This method returns the minimum size of the JSplitPane.
- *
- * @param jc The JSplitPane.
- *
- * @return The minimum size of the JSplitPane.
- */
- public Dimension getMinimumSize(JComponent jc)
- {
- return layoutManager.minimumLayoutSize((Container) jc);
- }
-
- /**
- * This method returns the maximum size of the JSplitPane.
- *
- * @param jc The JSplitPane.
- *
- * @return The maximum size of the JSplitPane.
- */
- public Dimension getMaximumSize(JComponent jc)
- {
- return layoutManager.maximumLayoutSize((Container) jc);
- }
-
- /**
- * This method returns the border insets of the current border.
- *
- * @param jc The JSplitPane.
- *
- * @return The current border insets.
- */
- public Insets getInsets(JComponent jc)
- {
- return splitPane.getBorder().getBorderInsets(splitPane);
- }
-
- /**
- * This method resets the current layout manager. The type of layout manager
- * is dependent on the current orientation.
- */
- protected void resetLayoutManager()
- {
- if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT)
- layoutManager = new BasicHorizontalLayoutManager();
- else
- layoutManager = new BasicVerticalLayoutManager();
- layoutManager.invalidateLayout(splitPane);
- layoutManager.updateComponents();
- getSplitPane().setLayout(layoutManager);
-
- // invalidating by itself does not invalidate the layout.
- getSplitPane().revalidate();
- }
-
- /**
- * This method is called when dragging starts. It resets lastDragLocation
- * and dividerSize.
- */
- protected void startDragging()
- {
- dividerSize = divider.getDividerSize();
- setLastDragLocation(-1);
-
- if (! splitPane.getLeftComponent().isLightweight()
- || ! splitPane.getRightComponent().isLightweight())
- draggingHW = true;
-
- if (splitPane.isContinuousLayout())
- nonContinuousLayoutDivider.setVisible(false);
- else
- {
- nonContinuousLayoutDivider.setVisible(true);
- nonContinuousLayoutDivider.setBounds(divider.getBounds());
- }
- splitPane.revalidate();
- splitPane.repaint();
- }
-
- /**
- * This method is called whenever the divider is dragged. If the JSplitPane
- * is in continuousLayout mode, the divider needs to be moved and the
- * JSplitPane needs to be laid out.
- *
- * @param location The new location of the divider.
- */
- protected void dragDividerTo(int location)
- {
- location = validLocation(location);
- if (beginDragDividerLocation == -1)
- beginDragDividerLocation = location;
-
- if (splitPane.isContinuousLayout())
- splitPane.setDividerLocation(location);
- else
- {
- Point p = nonContinuousLayoutDivider.getLocation();
- if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT)
- p.x = location;
- else
- p.y = location;
- nonContinuousLayoutDivider.setLocation(p);
- }
- setLastDragLocation(location);
- splitPane.repaint();
- }
-
- /**
- * This method is called when the dragging is finished.
- *
- * @param location The location where the drag finished.
- */
- protected void finishDraggingTo(int location)
- {
- if (nonContinuousLayoutDivider != null)
- nonContinuousLayoutDivider.setVisible(false);
- draggingHW = false;
- location = validLocation(location);
- dragDividerTo(location);
- splitPane.setDividerLocation(location);
- splitPane.setLastDividerLocation(beginDragDividerLocation);
- beginDragDividerLocation = -1;
- splitPane.repaint();
- }
-
- /**
- * This method returns the width of one of the sides of the divider's border.
- *
- * @return The width of one side of the divider's border.
- *
- * @deprecated 1.3
- */
- protected int getDividerBorderSize()
- {
- if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT)
- return divider.getBorder().getBorderInsets(divider).left;
- else
- return divider.getBorder().getBorderInsets(divider).top;
- }
-
- /**
- * This is a helper method that returns a valid location for the divider
- * when dragging.
- *
- * @param location The location to check.
- *
- * @return A valid location.
- */
- private int validLocation(int location)
- {
- if (location < getMinimumDividerLocation(splitPane))
- return getMinimumDividerLocation(splitPane);
- if (location > getMaximumDividerLocation(splitPane))
- return getMaximumDividerLocation(splitPane);
- return location;
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
deleted file mode 100644
index ea9c34378a5..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
+++ /dev/null
@@ -1,3064 +0,0 @@
-/* BasicTabbedPaneUI.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.Icon;
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-import javax.swing.JTabbedPane;
-import javax.swing.JViewport;
-import javax.swing.KeyStroke;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.PanelUI;
-import javax.swing.plaf.TabbedPaneUI;
-import javax.swing.plaf.UIResource;
-import javax.swing.text.View;
-
-/**
- * This is the Basic Look and Feel's UI delegate for JTabbedPane.
- */
-public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
-{
- /**
- * A helper class that handles focus.
- */
- public class FocusHandler extends FocusAdapter
- {
- /**
- * This method is called when the component gains focus.
- *
- * @param e The FocusEvent.
- */
- public void focusGained(FocusEvent e)
- {
- // FIXME: Implement.
- }
-
- /**
- * This method is called when the component loses focus.
- *
- * @param e The FocusEvent.
- */
- public void focusLost(FocusEvent e)
- {
- // FIXME: Implement.
- }
- }
-
- /**
- * A helper class for determining if mouse presses occur inside tabs and
- * sets the index appropriately. In SCROLL_TAB_MODE, this class also
- * handles the mouse clicks on the scrolling buttons.
- */
- public class MouseHandler extends MouseAdapter
- {
- /**
- * This method is called when the mouse is pressed. The index cannot
- * change to a tab that is not enabled.
- *
- * @param e The MouseEvent.
- */
- public void mousePressed(MouseEvent e)
- {
- int x = e.getX();
- int y = e.getY();
- int tabCount = tabPane.getTabCount();
-
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- if (e.getSource() == incrButton)
- {
- if (++currentScrollLocation >= tabCount)
- currentScrollLocation = tabCount - 1;
-
- int width = 0;
- for (int i = currentScrollLocation - 1; i < tabCount; i++)
- width += rects[i].width;
- if (width < viewport.getWidth())
- // FIXME: Still getting mouse events after the button is disabled.
- // incrButton.setEnabled(false);
- currentScrollLocation--;
- else if (! decrButton.isEnabled())
- decrButton.setEnabled(true);
- tabPane.revalidate();
- tabPane.repaint();
- return;
- }
- else if (e.getSource() == decrButton)
- {
- if (--currentScrollLocation < 0)
- currentScrollLocation = 0;
- if (currentScrollLocation == 0)
- decrButton.setEnabled(false);
- else if (! incrButton.isEnabled())
- incrButton.setEnabled(true);
- tabPane.revalidate();
- tabPane.repaint();
- return;
- }
- }
-
- int index = tabForCoordinate(tabPane, x, y);
-
- // We need to check since there are areas where tabs cannot be
- // e.g. in the inset area.
- if (index != -1 && tabPane.isEnabledAt(index))
- tabPane.setSelectedIndex(index);
- tabPane.revalidate();
- tabPane.repaint();
- }
- }
-
- /**
- * This class handles PropertyChangeEvents fired from the JTabbedPane.
- */
- public class PropertyChangeHandler implements PropertyChangeListener
- {
- /**
- * This method is called whenever one of the properties of the JTabbedPane
- * changes.
- *
- * @param e The PropertyChangeEvent.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- if (e.getPropertyName().equals("tabLayoutPolicy"))
- {
- layoutManager = createLayoutManager();
-
- tabPane.setLayout(layoutManager);
- }
- else if (e.getPropertyName().equals("tabPlacement")
- && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- incrButton = createIncreaseButton();
- decrButton = createDecreaseButton();
- }
- tabPane.layout();
- tabPane.repaint();
- }
- }
-
- /**
- * A LayoutManager responsible for placing all the tabs and the visible
- * component inside the JTabbedPane. This class is only used for
- * WRAP_TAB_LAYOUT.
- */
- protected class TabbedPaneLayout implements LayoutManager
- {
- /**
- * This method is called when a component is added to the JTabbedPane.
- *
- * @param name The name of the component.
- * @param comp The component being added.
- */
- public void addLayoutComponent(String name, Component comp)
- {
- // Do nothing.
- }
-
- /**
- * This method is called when the rectangles need to be calculated. It
- * also fixes the size of the visible component.
- */
- public void calculateLayoutInfo()
- {
- calculateTabRects(tabPane.getTabPlacement(), tabPane.getTabCount());
-
- if (tabPane.getSelectedIndex() != -1)
- {
- Component visible = getVisibleComponent();
- Insets insets = getContentBorderInsets(tabPane.getTabPlacement());
- if (visible != null)
- visible.setBounds(contentRect.x + insets.left,
- contentRect.y + insets.top,
- contentRect.width - insets.left - insets.right,
- contentRect.height - insets.top - insets.bottom);
- }
- }
-
- /**
- * This method calculates the size of the the JTabbedPane.
- *
- * @param minimum Whether the JTabbedPane will try to be as small as it
- * can.
- *
- * @return The desired size of the JTabbedPane.
- */
- protected Dimension calculateSize(boolean minimum)
- {
- int tabPlacement = tabPane.getTabPlacement();
- int width = 0;
- int height = 0;
-
- int componentHeight = 0;
- int componentWidth = 0;
- Component c;
- Dimension dims;
- for (int i = 0; i < tabPane.getTabCount(); i++)
- {
- c = tabPane.getComponentAt(i);
- if (c == null)
- continue;
- calcRect = c.getBounds();
- dims = c.getPreferredSize();
- if (dims != null)
- {
- componentHeight = Math.max(componentHeight, dims.height);
- componentWidth = Math.max(componentWidth, dims.width);
- }
- }
- Insets insets = tabPane.getInsets();
-
- if (tabPlacement == SwingConstants.TOP
- || tabPlacement == SwingConstants.BOTTOM)
- {
- int min = calculateMaxTabWidth(tabPlacement);
- width = Math.max(min, componentWidth);
-
- int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width);
- height = tabAreaHeight + componentHeight;
- }
- else
- {
- int min = calculateMaxTabHeight(tabPlacement);
- height = Math.max(min, componentHeight);
-
- int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height);
- width = tabAreaWidth + componentWidth;
- }
-
- return new Dimension(width, height);
- }
-
- // if tab placement is LEFT OR RIGHT, they share width.
- // if tab placement is TOP OR BOTTOM, they share height
- // PRE STEP: finds the default sizes for the labels as well as their locations.
- // AND where they will be placed within the run system.
- // 1. calls normalizeTab Runs.
- // 2. calls rotate tab runs.
- // 3. pads the tab runs.
- // 4. pads the selected tab.
-
- /**
- * This method is called to calculate the tab rectangles. This method
- * will calculate the size and position of all rectangles (taking into
- * account which ones should be in which tab run). It will pad them and
- * normalize them as necessary.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabCount The run the current selection is in.
- */
- protected void calculateTabRects(int tabPlacement, int tabCount)
- {
- if (tabCount == 0)
- return;
- assureRectsCreated(tabCount);
-
- FontMetrics fm = getFontMetrics();
- SwingUtilities.calculateInnerArea(tabPane, calcRect);
- Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
- Insets insets = tabPane.getInsets();
- int max = 0;
- int runs = 0;
- int start = getTabRunIndent(tabPlacement, 1);
- if (tabPlacement == SwingConstants.TOP
- || tabPlacement == SwingConstants.BOTTOM)
- {
- int maxHeight = calculateMaxTabHeight(tabPlacement);
-
- calcRect.width -= tabAreaInsets.left + tabAreaInsets.right;
- max = calcRect.width + tabAreaInsets.left + insets.left;
- start += tabAreaInsets.left + insets.left;
- int width = 0;
- int runWidth = start;
-
- for (int i = 0; i < tabCount; i++)
- {
- width = calculateTabWidth(tabPlacement, i, fm);
-
- if (runWidth + width > max)
- {
- runWidth = tabAreaInsets.left + insets.left
- + getTabRunIndent(tabPlacement, ++runs);
- rects[i] = new Rectangle(runWidth,
- insets.top + tabAreaInsets.top,
- width, maxHeight);
- runWidth += width;
- if (runs > tabRuns.length - 1)
- expandTabRunsArray();
- tabRuns[runs] = i;
- }
- else
- {
- rects[i] = new Rectangle(runWidth,
- insets.top + tabAreaInsets.top,
- width, maxHeight);
- runWidth += width;
- }
- }
- runs++;
- tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right;
- tabAreaRect.height = runs * maxTabHeight
- - (runs - 1) * tabRunOverlay
- + tabAreaInsets.top + tabAreaInsets.bottom;
- contentRect.width = tabAreaRect.width;
- contentRect.height = tabPane.getHeight() - insets.top
- - insets.bottom - tabAreaRect.height;
- contentRect.x = insets.left;
- tabAreaRect.x = insets.left;
- if (tabPlacement == SwingConstants.BOTTOM)
- {
- contentRect.y = insets.top;
- tabAreaRect.y = contentRect.y + contentRect.height;
- }
- else
- {
- tabAreaRect.y = insets.top;
- contentRect.y = tabAreaRect.y + tabAreaRect.height;
- }
- }
- else
- {
- int maxWidth = calculateMaxTabWidth(tabPlacement);
- calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom;
- max = calcRect.height + tabAreaInsets.top + insets.top;
-
- int height = 0;
- start += tabAreaInsets.top + insets.top;
- int runHeight = start;
-
- int fontHeight = fm.getHeight();
-
- for (int i = 0; i < tabCount; i++)
- {
- height = calculateTabHeight(tabPlacement, i, fontHeight);
- if (runHeight + height > max)
- {
- runHeight = tabAreaInsets.top + insets.top
- + getTabRunIndent(tabPlacement, ++runs);
- rects[i] = new Rectangle(insets.left + tabAreaInsets.left,
- runHeight, maxWidth, height);
- runHeight += height;
- if (runs > tabRuns.length - 1)
- expandTabRunsArray();
- tabRuns[runs] = i;
- }
- else
- {
- rects[i] = new Rectangle(insets.left + tabAreaInsets.left,
- runHeight, maxWidth, height);
- runHeight += height;
- }
- }
- runs++;
-
- tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay
- + tabAreaInsets.left + tabAreaInsets.right;
- tabAreaRect.height = tabPane.getHeight() - insets.top
- - insets.bottom;
- tabAreaRect.y = insets.top;
- contentRect.width = tabPane.getWidth() - insets.left - insets.right
- - tabAreaRect.width;
- contentRect.height = tabAreaRect.height;
- contentRect.y = insets.top;
- if (tabPlacement == SwingConstants.LEFT)
- {
- tabAreaRect.x = insets.left;
- contentRect.x = tabAreaRect.x + tabAreaRect.width;
- }
- else
- {
- contentRect.x = insets.left;
- tabAreaRect.x = contentRect.x + contentRect.width;
- }
- }
- runCount = runs;
-
- tabRuns[0] = 0;
- normalizeTabRuns(tabPlacement, tabCount, start, max);
- selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex());
- if (shouldRotateTabRuns(tabPlacement))
- rotateTabRuns(tabPlacement, selectedRun);
-
- // Need to pad the runs and move them to the correct location.
- for (int i = 0; i < runCount; i++)
- {
- int first = lastTabInRun(tabCount, getPreviousTabRun(i)) + 1;
- if (first == tabCount)
- first = 0;
- int last = lastTabInRun(tabCount, i);
- if (shouldPadTabRun(tabPlacement, i))
- padTabRun(tabPlacement, first, last, max);
-
- // Done padding, now need to move it.
- if (tabPlacement == SwingConstants.TOP && i > 0)
- {
- for (int j = first; j <= last; j++)
- rects[j].y += (runCount - i) * maxTabHeight
- - (runCount - i) * tabRunOverlay;
- }
-
- if (tabPlacement == SwingConstants.BOTTOM)
- {
- int height = tabPane.getBounds().height - insets.bottom
- - tabAreaInsets.bottom;
- int adjustment;
- if (i == 0)
- adjustment = height - maxTabHeight;
- else
- adjustment = height - (runCount - i + 1) * maxTabHeight
- - (runCount - i) * tabRunOverlay;
-
- for (int j = first; j <= last; j++)
- rects[j].y = adjustment;
- }
-
- if (tabPlacement == SwingConstants.LEFT && i > 0)
- {
- for (int j = first; j <= last; j++)
- rects[j].x += (runCount - i) * maxTabWidth
- - (runCount - i) * tabRunOverlay;
- }
-
- if (tabPlacement == SwingConstants.RIGHT)
- {
- int width = tabPane.getBounds().width - insets.right
- - tabAreaInsets.right;
- int adjustment;
- if (i == 0)
- adjustment = width - maxTabWidth;
- else
- adjustment = width - (runCount - i + 1) * maxTabWidth
- + (runCount - i) * tabRunOverlay;
-
- for (int j = first; j <= last; j++)
- rects[j].x = adjustment;
- }
- }
- padSelectedTab(tabPlacement, tabPane.getSelectedIndex());
- }
-
- /**
- * This method is called when the JTabbedPane is laid out in
- * WRAP_TAB_LAYOUT. It calls calculateLayoutInfo to find the positions
- * of all its components.
- *
- * @param parent The Container to lay out.
- */
- public void layoutContainer(Container parent)
- {
- calculateLayoutInfo();
- }
-
- /**
- * This method returns the minimum layout size for the given container.
- *
- * @param parent The container that is being sized.
- *
- * @return The minimum size.
- */
- public Dimension minimumLayoutSize(Container parent)
- {
- return calculateSize(false);
- }
-
- // If there is more free space in an adjacent run AND the tab in the run can fit in the
- // adjacent run, move it. This method is not perfect, it is merely an approximation.
- // If you play around with Sun's JTabbedPane, you'll see that
- // it does do some pretty strange things with regards to not moving tabs
- // that should be moved.
- // start = the x position where the tabs will begin
- // max = the maximum position of where the tabs can go to (tabAreaInsets.left + the width of the tab area)
-
- /**
- * This method tries to "even out" the number of tabs in each run based on
- * their widths.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabCount The number of tabs.
- * @param start The x position where the tabs will begin.
- * @param max The maximum x position where the tab can run to.
- */
- protected void normalizeTabRuns(int tabPlacement, int tabCount, int start,
- int max)
- {
- Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
- if (tabPlacement == SwingUtilities.TOP
- || tabPlacement == SwingUtilities.BOTTOM)
- {
- // We should only do this for runCount - 1, cause we can only shift that many times between
- // runs.
- for (int i = 1; i < runCount; i++)
- {
- Rectangle currRun = rects[lastTabInRun(tabCount, i)];
- Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))];
- int spaceInCurr = currRun.x + currRun.width;
- int spaceInNext = nextRun.x + nextRun.width;
-
- int diffNow = spaceInCurr - spaceInNext;
- int diffLater = (spaceInCurr - currRun.width)
- - (spaceInNext + currRun.width);
- while (Math.abs(diffLater) < Math.abs(diffNow)
- && spaceInNext + currRun.width < max)
- {
- tabRuns[i]--;
- spaceInNext += currRun.width;
- spaceInCurr -= currRun.width;
- currRun = rects[lastTabInRun(tabCount, i)];
- diffNow = spaceInCurr - spaceInNext;
- diffLater = (spaceInCurr - currRun.width)
- - (spaceInNext + currRun.width);
- }
-
- // Fix the bounds.
- int first = lastTabInRun(tabCount, i) + 1;
- int last = lastTabInRun(tabCount, getNextTabRun(i));
- int currX = tabAreaInsets.left;
- for (int j = first; j <= last; j++)
- {
- rects[j].x = currX;
- currX += rects[j].width;
- }
- }
- }
- else
- {
- for (int i = 1; i < runCount; i++)
- {
- Rectangle currRun = rects[lastTabInRun(tabCount, i)];
- Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))];
- int spaceInCurr = currRun.y + currRun.height;
- int spaceInNext = nextRun.y + nextRun.height;
-
- int diffNow = spaceInCurr - spaceInNext;
- int diffLater = (spaceInCurr - currRun.height)
- - (spaceInNext + currRun.height);
- while (Math.abs(diffLater) < Math.abs(diffNow)
- && spaceInNext + currRun.height < max)
- {
- tabRuns[i]--;
- spaceInNext += currRun.height;
- spaceInCurr -= currRun.height;
- currRun = rects[lastTabInRun(tabCount, i)];
- diffNow = spaceInCurr - spaceInNext;
- diffLater = (spaceInCurr - currRun.height)
- - (spaceInNext + currRun.height);
- }
-
- int first = lastTabInRun(tabCount, i) + 1;
- int last = lastTabInRun(tabCount, getNextTabRun(i));
- int currY = tabAreaInsets.top;
- for (int j = first; j <= last; j++)
- {
- rects[j].y = currY;
- currY += rects[j].height;
- }
- }
- }
- }
-
- /**
- * This method pads the tab at the selected index by the selected tab pad
- * insets (so that it looks larger).
- *
- * @param tabPlacement The placement of the tabs.
- * @param selectedIndex The selected index.
- */
- protected void padSelectedTab(int tabPlacement, int selectedIndex)
- {
- Insets insets = getSelectedTabPadInsets(tabPlacement);
- rects[selectedIndex].x -= insets.left;
- rects[selectedIndex].y -= insets.top;
- rects[selectedIndex].width += insets.left + insets.right;
- rects[selectedIndex].height += insets.top + insets.bottom;
- }
-
- // If the tabs on the run don't fill the width of the window, make it fit now.
- // start = starting index of the run
- // end = last index of the run
- // max = tabAreaInsets.left + width (or equivalent)
- // assert start <= end.
-
- /**
- * This method makes each tab in the run larger so that the tabs expand
- * to fill the runs width/height (depending on tabPlacement).
- *
- * @param tabPlacement The placement of the tabs.
- * @param start The index of the first tab.
- * @param end The last index of the tab
- * @param max The amount of space in the run (width for TOP and BOTTOM
- * tabPlacement).
- */
- protected void padTabRun(int tabPlacement, int start, int end, int max)
- {
- if (tabPlacement == SwingConstants.TOP
- || tabPlacement == SwingConstants.BOTTOM)
- {
- int runWidth = rects[end].x + rects[end].width;
- int spaceRemaining = max - runWidth;
- int numTabs = end - start + 1;
-
- // now divvy up the space.
- int spaceAllocated = spaceRemaining / numTabs;
- int currX = rects[start].x;
- for (int i = start; i <= end; i++)
- {
- rects[i].x = currX;
- rects[i].width += spaceAllocated;
- currX += rects[i].width;
- // This is used because since the spaceAllocated
- // variable is an int, it rounds down. Sometimes,
- // we don't fill an entire row, so we make it do
- // so now.
- if (i == end && rects[i].x + rects[i].width != max)
- rects[i].width = max - rects[i].x;
- }
- }
- else
- {
- int runHeight = rects[end].y + rects[end].height;
- int spaceRemaining = max - runHeight;
- int numTabs = end - start + 1;
-
- int spaceAllocated = spaceRemaining / numTabs;
- int currY = rects[start].y;
- for (int i = start; i <= end; i++)
- {
- rects[i].y = currY;
- rects[i].height += spaceAllocated;
- currY += rects[i].height;
- if (i == end && rects[i].y + rects[i].height != max)
- rects[i].height = max - rects[i].y;
- }
- }
- }
-
- /**
- * This method returns the preferred layout size for the given container.
- *
- * @param parent The container to size.
- *
- * @return The preferred layout size.
- */
- public Dimension preferredLayoutSize(Container parent)
- {
- return calculateSize(false);
- }
-
- /**
- * This method returns the preferred tab height given a tabPlacement and
- * width.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param width The expected width.
- *
- * @return The preferred tab area height.
- */
- protected int preferredTabAreaHeight(int tabPlacement, int width)
- {
- if (tabPane.getTabCount() == 0)
- return calculateTabAreaHeight(tabPlacement, 0, 0);
-
- int runs = 0;
- int runWidth = 0;
- int tabWidth = 0;
-
- FontMetrics fm = getFontMetrics();
-
- Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
- Insets insets = tabPane.getInsets();
-
- // Only interested in width, this is a messed up rectangle now.
- width -= tabAreaInsets.left + tabAreaInsets.right + insets.left
- + insets.right;
-
- // The reason why we can't use runCount:
- // This method is only called to calculate the size request
- // for the tabbedPane. However, this size request is dependent on
- // our desired width. We need to find out what the height would
- // be IF we got our desired width.
- for (int i = 0; i < tabPane.getTabCount(); i++)
- {
- tabWidth = calculateTabWidth(tabPlacement, i, fm);
- if (runWidth + tabWidth > width)
- {
- runWidth = tabWidth;
- runs++;
- }
- else
- runWidth += tabWidth;
- }
- runs++;
-
- int maxTabHeight = calculateMaxTabHeight(tabPlacement);
- int tabAreaHeight = calculateTabAreaHeight(tabPlacement, runs,
- maxTabHeight);
- return tabAreaHeight;
- }
-
- /**
- * This method calculates the preferred tab area width given a tab
- * placement and height.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param height The expected height.
- *
- * @return The preferred tab area width.
- */
- protected int preferredTabAreaWidth(int tabPlacement, int height)
- {
- if (tabPane.getTabCount() == 0)
- return calculateTabAreaHeight(tabPlacement, 0, 0);
-
- int runs = 0;
- int runHeight = 0;
- int tabHeight = 0;
-
- FontMetrics fm = getFontMetrics();
-
- Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
- Insets insets = tabPane.getInsets();
-
- height -= tabAreaInsets.top + tabAreaInsets.bottom + insets.top
- + insets.bottom;
- int fontHeight = fm.getHeight();
-
- for (int i = 0; i < tabPane.getTabCount(); i++)
- {
- tabHeight = calculateTabHeight(tabPlacement, i, fontHeight);
- if (runHeight + tabHeight > height)
- {
- runHeight = tabHeight;
- runs++;
- }
- else
- runHeight += tabHeight;
- }
- runs++;
-
- int maxTabWidth = calculateMaxTabWidth(tabPlacement);
- int tabAreaWidth = calculateTabAreaWidth(tabPlacement, runs, maxTabWidth);
- return tabAreaWidth;
- }
-
- /**
- * This method rotates the places each run in the correct place the
- * tabRuns array. See the comment for tabRuns for how the runs are placed
- * in the array.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param selectedRun The run the current selection is in.
- */
- protected void rotateTabRuns(int tabPlacement, int selectedRun)
- {
- if (runCount == 1 || selectedRun == 1 || selectedRun == -1)
- return;
- int[] newTabRuns = new int[tabRuns.length];
- int currentRun = selectedRun;
- int i = 1;
- do
- {
- newTabRuns[i] = tabRuns[currentRun];
- currentRun = getNextTabRun(currentRun);
- i++;
- }
- while (i < runCount);
- if (runCount > 1)
- newTabRuns[0] = tabRuns[currentRun];
-
- tabRuns = newTabRuns;
- BasicTabbedPaneUI.this.selectedRun = 1;
- }
-
- /**
- * This method is called when a component is removed from the
- * JTabbedPane.
- *
- * @param comp The component removed.
- */
- public void removeLayoutComponent(Component comp)
- {
- // Do nothing.
- }
- }
-
- /**
- * This class acts as the LayoutManager for the JTabbedPane in
- * SCROLL_TAB_MODE.
- */
- private class TabbedPaneScrollLayout extends TabbedPaneLayout
- {
- /**
- * This method returns the preferred layout size for the given container.
- *
- * @param parent The container to calculate a size for.
- *
- * @return The preferred layout size.
- */
- public Dimension preferredLayoutSize(Container parent)
- {
- return super.calculateSize(true);
- }
-
- /**
- * This method returns the minimum layout size for the given container.
- *
- * @param parent The container to calculate a size for.
- *
- * @return The minimum layout size.
- */
- public Dimension minimumLayoutSize(Container parent)
- {
- return super.calculateSize(true);
- }
-
- /**
- * This method calculates the tab area height given a desired width.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param width The expected width.
- *
- * @return The tab area height given the width.
- */
- protected int preferredTabAreaHeight(int tabPlacement, int width)
- {
- if (tabPane.getTabCount() == 0)
- return calculateTabAreaHeight(tabPlacement, 0, 0);
-
- int runs = 1;
-
- int maxTabHeight = calculateMaxTabHeight(tabPlacement);
- int tabAreaHeight = calculateTabAreaHeight(tabPlacement, runs,
- maxTabHeight);
- return tabAreaHeight;
- }
-
- /**
- * This method calculates the tab area width given a desired height.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param height The expected height.
- *
- * @return The tab area width given the height.
- */
- protected int preferredTabAreaWidth(int tabPlacement, int height)
- {
- if (tabPane.getTabCount() == 0)
- return calculateTabAreaHeight(tabPlacement, 0, 0);
-
- int runs = 1;
-
- int maxTabWidth = calculateMaxTabWidth(tabPlacement);
- int tabAreaWidth = calculateTabAreaWidth(tabPlacement, runs, maxTabWidth);
- return tabAreaWidth;
- }
-
- /**
- * This method is called to calculate the tab rectangles. This method
- * will calculate the size and position of all rectangles (taking into
- * account which ones should be in which tab run). It will pad them and
- * normalize them as necessary.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabCount The number of tabs.
- */
- protected void calculateTabRects(int tabPlacement, int tabCount)
- {
- if (tabCount == 0)
- return;
- assureRectsCreated(tabCount);
-
- FontMetrics fm = getFontMetrics();
- SwingUtilities.calculateInnerArea(tabPane, calcRect);
- Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
- Insets insets = tabPane.getInsets();
- int max = 0;
- int runs = 1;
- int start = 0;
- int top = 0;
- if (tabPlacement == SwingConstants.TOP
- || tabPlacement == SwingConstants.BOTTOM)
- {
- int maxHeight = calculateMaxTabHeight(tabPlacement);
- calcRect.width -= tabAreaInsets.left + tabAreaInsets.right;
- max = calcRect.width + tabAreaInsets.left + insets.left;
- start = tabAreaInsets.left + insets.left;
- int width = 0;
- int runWidth = start;
- top = insets.top + tabAreaInsets.top;
- for (int i = 0; i < tabCount; i++)
- {
- width = calculateTabWidth(tabPlacement, i, fm);
-
- rects[i] = new Rectangle(runWidth, top, width, maxHeight);
- runWidth += width;
- }
- tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right;
- tabAreaRect.height = runs * maxTabHeight
- - (runs - 1) * tabRunOverlay
- + tabAreaInsets.top + tabAreaInsets.bottom;
- contentRect.width = tabAreaRect.width;
- contentRect.height = tabPane.getHeight() - insets.top
- - insets.bottom - tabAreaRect.height;
- contentRect.x = insets.left;
- tabAreaRect.x = insets.left;
- if (tabPlacement == SwingConstants.BOTTOM)
- {
- contentRect.y = insets.top;
- tabAreaRect.y = contentRect.y + contentRect.height;
- }
- else
- {
- tabAreaRect.y = insets.top;
- contentRect.y = tabAreaRect.y + tabAreaRect.height;
- }
- }
- else
- {
- int maxWidth = calculateMaxTabWidth(tabPlacement);
-
- calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom;
- max = calcRect.height + tabAreaInsets.top;
- int height = 0;
- start = tabAreaInsets.top + insets.top;
- int runHeight = start;
- int fontHeight = fm.getHeight();
- top = insets.left + tabAreaInsets.left;
- for (int i = 0; i < tabCount; i++)
- {
- height = calculateTabHeight(tabPlacement, i, fontHeight);
- rects[i] = new Rectangle(top, runHeight, maxWidth, height);
- runHeight += height;
- }
- tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay
- + tabAreaInsets.left + tabAreaInsets.right;
- tabAreaRect.height = tabPane.getHeight() - insets.top
- - insets.bottom;
- tabAreaRect.y = insets.top;
- contentRect.width = tabPane.getWidth() - insets.left - insets.right
- - tabAreaRect.width;
- contentRect.height = tabAreaRect.height;
- contentRect.y = insets.top;
- if (tabPlacement == SwingConstants.LEFT)
- {
- tabAreaRect.x = insets.left;
- contentRect.x = tabAreaRect.x + tabAreaRect.width;
- }
- else
- {
- contentRect.x = insets.left;
- tabAreaRect.x = contentRect.x + contentRect.width;
- }
- }
- runCount = runs;
-
- padSelectedTab(tabPlacement, tabPane.getSelectedIndex());
- }
-
- /**
- * This method is called when the JTabbedPane is laid out in
- * SCROLL_TAB_LAYOUT. It finds the position for all components in the
- * JTabbedPane.
- *
- * @param pane The JTabbedPane to be laid out.
- */
- public void layoutContainer(Container pane)
- {
- super.layoutContainer(pane);
- int tabCount = tabPane.getTabCount();
- Point p = null;
- if (tabCount == 0)
- return;
- int tabPlacement = tabPane.getTabPlacement();
- incrButton.hide();
- decrButton.hide();
- if (tabPlacement == SwingConstants.TOP
- || tabPlacement == SwingConstants.BOTTOM)
- {
- if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x
- + rects[tabCount - 1].width)
- {
- Dimension incrDims = incrButton.getPreferredSize();
- Dimension decrDims = decrButton.getPreferredSize();
-
- decrButton.setBounds(tabAreaRect.x + tabAreaRect.width
- - incrDims.width - decrDims.width,
- tabAreaRect.y, decrDims.width,
- tabAreaRect.height);
- incrButton.setBounds(tabAreaRect.x + tabAreaRect.width
- - incrDims.width, tabAreaRect.y,
- decrDims.width, tabAreaRect.height);
-
- tabAreaRect.width -= decrDims.width + incrDims.width;
- incrButton.show();
- decrButton.show();
- }
- }
-
- if (tabPlacement == SwingConstants.LEFT
- || tabPlacement == SwingConstants.RIGHT)
- {
- if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y
- + rects[tabCount - 1].height)
- {
- Dimension incrDims = incrButton.getPreferredSize();
- Dimension decrDims = decrButton.getPreferredSize();
-
- decrButton.setBounds(tabAreaRect.x,
- tabAreaRect.y + tabAreaRect.height
- - incrDims.height - decrDims.height,
- tabAreaRect.width, decrDims.height);
- incrButton.setBounds(tabAreaRect.x,
- tabAreaRect.y + tabAreaRect.height
- - incrDims.height, tabAreaRect.width,
- incrDims.height);
-
- tabAreaRect.height -= decrDims.height + incrDims.height;
- incrButton.show();
- decrButton.show();
- }
- }
- viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width,
- tabAreaRect.height);
- int tabC = tabPane.getTabCount() - 1;
- if (tabCount > 0)
- {
- int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width);
- int h = Math.max(rects[tabC].height, tabAreaRect.height);
- p = findPointForIndex(currentScrollLocation);
-
- // we want to cover that entire space so that borders that run under
- // the tab area don't show up when we move the viewport around.
- panel.setSize(w + p.x, h + p.y);
- }
- viewport.setViewPosition(p);
- viewport.repaint();
- }
- }
-
- /**
- * This class handles ChangeEvents from the JTabbedPane.
- */
- public class TabSelectionHandler implements ChangeListener
- {
- /**
- * This method is called whenever a ChangeEvent is fired from the
- * JTabbedPane.
- *
- * @param e The ChangeEvent fired.
- */
- public void stateChanged(ChangeEvent e)
- {
- selectedRun = getRunForTab(tabPane.getTabCount(),
- tabPane.getSelectedIndex());
- tabPane.revalidate();
- tabPane.repaint();
- }
- }
-
- /**
- * This helper class is a JPanel that fits inside the ScrollViewport. This
- * panel's sole job is to paint the tab rectangles inside the viewport so
- * that it's clipped correctly.
- */
- private class ScrollingPanel extends JPanel
- {
- /**
- * This is a private UI class for our panel.
- */
- private class ScrollingPanelUI extends BasicPanelUI
- {
- /**
- * This method overrides the default paint method. It paints the tab
- * rectangles for the JTabbedPane in the panel.
- *
- * @param g The Graphics object to paint with.
- * @param c The JComponent to paint.
- */
- public void paint(Graphics g, JComponent c)
- {
- paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex());
- }
- }
-
- /**
- * This method overrides the updateUI method. It makes the default UI for
- * this ScrollingPanel to be a ScrollingPanelUI.
- */
- public void updateUI()
- {
- setUI((PanelUI) new ScrollingPanelUI());
- }
- }
-
- /**
- * This is a helper class that paints the panel that paints tabs. This
- * custom JViewport is used so that the tabs painted in the panel will be
- * clipped. This class implements UIResource so tabs are not added when
- * this objects of this class are added to the JTabbedPane.
- */
- private class ScrollingViewport extends JViewport implements UIResource
- {
- }
-
- /**
- * This is a helper class that implements UIResource so it is not added as a
- * tab when an object of this class is added to the JTabbedPane.
- */
- private class ScrollingButton extends BasicArrowButton implements UIResource
- {
- /**
- * Creates a ScrollingButton given the direction.
- *
- * @param dir The direction to point in.
- */
- public ScrollingButton(int dir)
- {
- super(dir);
- }
- }
-
- /** The button that increments the current scroll location.
- * This is package-private to avoid an accessor method. */
- transient ScrollingButton incrButton;
-
- /** The button that decrements the current scroll location.
- * This is package-private to avoid an accessor method. */
- transient ScrollingButton decrButton;
-
- /** The viewport used to display the tabs.
- * This is package-private to avoid an accessor method. */
- transient ScrollingViewport viewport;
-
- /** The panel inside the viewport that paints the tabs.
- * This is package-private to avoid an accessor method. */
- transient ScrollingPanel panel;
-
- /** The starting visible tab in the run in SCROLL_TAB_MODE.
- * This is package-private to avoid an accessor method. */
- transient int currentScrollLocation;
-
- /** A reusable rectangle. */
- protected Rectangle calcRect;
-
- /** An array of Rectangles keeping track of the tabs' area and position. */
- protected Rectangle[] rects;
-
- /** The insets around the content area. */
- protected Insets contentBorderInsets;
-
- /** The extra insets around the selected tab. */
- protected Insets selectedTabPadInsets;
-
- /** The insets around the tab area. */
- protected Insets tabAreaInsets;
-
- /** The insets around each and every tab. */
- protected Insets tabInsets;
-
- /**
- * The outer bottom and right edge color for both the tab and content
- * border.
- */
- protected Color darkShadow;
-
- /** The color of the focus outline on the selected tab. */
- protected Color focus;
-
- /** FIXME: find a use for this. */
- protected Color highlight;
-
- /** The top and left edge color for both the tab and content border. */
- protected Color lightHighlight;
-
- /** The inner bottom and right edge color for the tab and content border. */
- protected Color shadow;
-
- /** The maximum tab height. */
- protected int maxTabHeight;
-
- /** The maximum tab width. */
- protected int maxTabWidth;
-
- /** The number of runs in the JTabbedPane. */
- protected int runCount;
-
- /** The index of the run that the selected index is in. */
- protected int selectedRun;
-
- /** The amount of space each run overlaps the previous by. */
- protected int tabRunOverlay;
-
- /** The gap between text and label */
- protected int textIconGap;
-
- // Keeps track of tab runs.
- // The organization of this array is as follows (lots of experimentation to
- // figure this out)
- // index 0 = furthest away from the component area (aka outer run)
- // index 1 = closest to component area (aka selected run)
- // index > 1 = listed in order leading from selected run to outer run.
- // each int in the array is the tab index + 1 (counting starts at 1)
- // for the last tab in the run. (same as the rects array)
-
- /** This array keeps track of which tabs are in which run. See above. */
- protected int[] tabRuns;
-
- /**
- * This is the keystroke for moving down.
- *
- * @deprecated 1.3
- */
- protected KeyStroke downKey;
-
- /**
- * This is the keystroke for moving left.
- *
- * @deprecated 1.3
- */
- protected KeyStroke leftKey;
-
- /**
- * This is the keystroke for moving right.
- *
- * @deprecated 1.3
- */
- protected KeyStroke rightKey;
-
- /**
- * This is the keystroke for moving up.
- *
- * @deprecated 1.3
- */
- protected KeyStroke upKey;
-
- /** The listener that listens for focus events. */
- protected FocusListener focusListener;
-
- /** The listener that listens for mouse events. */
- protected MouseListener mouseListener;
-
- /** The listener that listens for property change events. */
- protected PropertyChangeListener propertyChangeListener;
-
- /** The listener that listens for change events. */
- protected ChangeListener tabChangeListener;
-
- /** The tab pane that this UI paints. */
- protected JTabbedPane tabPane;
-
- /** The current layout manager for the tabPane.
- * This is package-private to avoid an accessor method. */
- transient LayoutManager layoutManager;
-
- /** The rectangle that describes the tab area's position and size.
- * This is package-private to avoid an accessor method. */
- transient Rectangle tabAreaRect;
-
- /** The rectangle that describes the content area's position and
- * size. This is package-private to avoid an accessor method. */
- transient Rectangle contentRect;
-
- /**
- * Creates a new BasicTabbedPaneUI object.
- */
- public BasicTabbedPaneUI()
- {
- super();
- }
-
- /**
- * This method creates a ScrollingButton that points in the appropriate
- * direction for an increasing button.
- * This is package-private to avoid an accessor method.
- *
- * @return The increase ScrollingButton.
- */
- ScrollingButton createIncreaseButton()
- {
- if (incrButton == null)
- incrButton = new ScrollingButton(SwingConstants.NORTH);
- if (tabPane.getTabPlacement() == SwingConstants.TOP
- || tabPane.getTabPlacement() == SwingConstants.BOTTOM)
- incrButton.setDirection(SwingConstants.EAST);
- else
- incrButton.setDirection(SwingConstants.SOUTH);
- return incrButton;
- }
-
- /**
- * This method creates a ScrollingButton that points in the appropriate
- * direction for a decreasing button.
- * This is package-private to avoid an accessor method.
- *
- * @return The decrease ScrollingButton.
- */
- ScrollingButton createDecreaseButton()
- {
- if (decrButton == null)
- decrButton = new ScrollingButton(SwingConstants.SOUTH);
- if (tabPane.getTabPlacement() == SwingConstants.TOP
- || tabPane.getTabPlacement() == SwingConstants.BOTTOM)
- decrButton.setDirection(SwingConstants.WEST);
- else
- decrButton.setDirection(SwingConstants.NORTH);
- return decrButton;
- }
-
- /**
- * This method finds the point to set the view position at given the index
- * of a tab. The tab will be the first visible tab in the run.
- * This is package-private to avoid an accessor method.
- *
- * @param index The index of the first visible tab.
- *
- * @return The position of the first visible tab.
- */
- Point findPointForIndex(int index)
- {
- int tabPlacement = tabPane.getTabPlacement();
- int selectedIndex = tabPane.getSelectedIndex();
- Insets insets = getSelectedTabPadInsets(tabPlacement);
- int w = 0;
- int h = 0;
-
- if (tabPlacement == TOP || tabPlacement == BOTTOM)
- {
- if (index > 0)
- {
- w += rects[index - 1].x + rects[index - 1].width;
- if (index > selectedIndex)
- w -= insets.left + insets.right;
- }
- }
-
- else
- {
- if (index > 0)
- {
- h += rects[index - 1].y + rects[index - 1].height;
- if (index > selectedIndex)
- h -= insets.top + insets.bottom;
- }
- }
-
- Point p = new Point(w, h);
- return p;
- }
-
- /**
- * This method creates a new BasicTabbedPaneUI.
- *
- * @param c The JComponent to create a UI for.
- *
- * @return A new BasicTabbedPaneUI.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicTabbedPaneUI();
- }
-
- /**
- * This method installs the UI for the given JComponent.
- *
- * @param c The JComponent to install the UI for.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
- if (c instanceof JTabbedPane)
- {
- tabPane = (JTabbedPane) c;
-
- installComponents();
- installDefaults();
- installListeners();
- installKeyboardActions();
-
- layoutManager = createLayoutManager();
- tabPane.setLayout(layoutManager);
- tabPane.layout();
- }
- }
-
- /**
- * This method uninstalls the UI for the given JComponent.
- *
- * @param c The JComponent to uninstall the UI for.
- */
- public void uninstallUI(JComponent c)
- {
- layoutManager = null;
-
- uninstallKeyboardActions();
- uninstallListeners();
- uninstallDefaults();
- uninstallComponents();
-
- tabPane = null;
- }
-
- /**
- * This method creates the appropriate layout manager for the JTabbedPane's
- * current tab layout policy. If the tab layout policy is
- * SCROLL_TAB_LAYOUT, then all the associated components that need to be
- * created will be done so now.
- *
- * @return A layout manager given the tab layout policy.
- */
- protected LayoutManager createLayoutManager()
- {
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT)
- return new TabbedPaneLayout();
- else
- {
- incrButton = createIncreaseButton();
- decrButton = createDecreaseButton();
- viewport = new ScrollingViewport();
- viewport.setLayout(null);
- panel = new ScrollingPanel();
- viewport.setView(panel);
- tabPane.add(incrButton);
- tabPane.add(decrButton);
- tabPane.add(viewport);
- currentScrollLocation = 0;
- decrButton.setEnabled(false);
- panel.addMouseListener(mouseListener);
- incrButton.addMouseListener(mouseListener);
- decrButton.addMouseListener(mouseListener);
- viewport.setBackground(Color.LIGHT_GRAY);
-
- return new TabbedPaneScrollLayout();
- }
- }
-
- /**
- * This method installs components for this JTabbedPane.
- */
- protected void installComponents()
- {
- // Nothing to be done.
- }
-
- /**
- * This method uninstalls components for this JTabbedPane.
- */
- protected void uninstallComponents()
- {
- // Nothing to be done.
- }
-
- /**
- * This method installs defaults for the Look and Feel.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- tabPane.setFont(defaults.getFont("TabbedPane.font"));
- tabPane.setForeground(defaults.getColor("TabbedPane.foreground"));
- tabPane.setBackground(defaults.getColor("TabbedPane.background"));
- tabPane.setOpaque(true);
-
- highlight = defaults.getColor("TabbedPane.highlight");
- lightHighlight = defaults.getColor("TabbedPane.lightHighlight");
-
- shadow = defaults.getColor("TabbedPane.shadow");
- darkShadow = defaults.getColor("TabbedPane.darkShadow");
-
- focus = defaults.getColor("TabbedPane.focus");
-
- textIconGap = defaults.getInt("TabbedPane.textIconGap");
- tabRunOverlay = defaults.getInt("TabbedPane.tabRunOverlay");
-
- tabInsets = defaults.getInsets("TabbedPane.tabbedPaneTabInsets");
- selectedTabPadInsets = defaults.getInsets("TabbedPane.tabbedPaneTabPadInsets");
- tabAreaInsets = defaults.getInsets("TabbedPane.tabbedPaneTabAreaInsets");
- contentBorderInsets = defaults.getInsets("TabbedPane.tabbedPaneContentBorderInsets");
-
- calcRect = new Rectangle();
- tabRuns = new int[10];
- tabAreaRect = new Rectangle();
- contentRect = new Rectangle();
- }
-
- /**
- * This method uninstalls defaults for the Look and Feel.
- */
- protected void uninstallDefaults()
- {
- calcRect = null;
- tabAreaRect = null;
- contentRect = null;
- tabRuns = null;
-
- contentBorderInsets = null;
- tabAreaInsets = null;
- selectedTabPadInsets = null;
- tabInsets = null;
-
- focus = null;
- darkShadow = null;
- shadow = null;
- lightHighlight = null;
- highlight = null;
-
- tabPane.setBackground(null);
- tabPane.setForeground(null);
- tabPane.setFont(null);
- }
-
- /**
- * This method creates and installs the listeners for this UI.
- */
- protected void installListeners()
- {
- mouseListener = createMouseListener();
- tabChangeListener = createChangeListener();
- propertyChangeListener = createPropertyChangeListener();
- focusListener = createFocusListener();
-
- tabPane.addMouseListener(mouseListener);
- tabPane.addChangeListener(tabChangeListener);
- tabPane.addPropertyChangeListener(propertyChangeListener);
- tabPane.addFocusListener(focusListener);
- }
-
- /**
- * This method removes and nulls the listeners for this UI.
- */
- protected void uninstallListeners()
- {
- tabPane.removeFocusListener(focusListener);
- tabPane.removePropertyChangeListener(propertyChangeListener);
- tabPane.removeChangeListener(tabChangeListener);
- tabPane.removeMouseListener(mouseListener);
-
- focusListener = null;
- propertyChangeListener = null;
- tabChangeListener = null;
- mouseListener = null;
- }
-
- /**
- * This method creates a new MouseListener.
- *
- * @return A new MouseListener.
- */
- protected MouseListener createMouseListener()
- {
- return new MouseHandler();
- }
-
- /**
- * This method creates a new FocusListener.
- *
- * @return A new FocusListener.
- */
- protected FocusListener createFocusListener()
- {
- return new FocusHandler();
- }
-
- /**
- * This method creates a new ChangeListener.
- *
- * @return A new ChangeListener.
- */
- protected ChangeListener createChangeListener()
- {
- return new TabSelectionHandler();
- }
-
- /**
- * This method creates a new PropertyChangeListener.
- *
- * @return A new PropertyChangeListener.
- */
- protected PropertyChangeListener createPropertyChangeListener()
- {
- return new PropertyChangeHandler();
- }
-
- /**
- * This method installs keyboard actions for the JTabbedPane.
- */
- protected void installKeyboardActions()
- {
- // FIXME: Implement.
- }
-
- /**
- * This method uninstalls keyboard actions for the JTabbedPane.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: Implement.
- }
-
- /**
- * This method returns the preferred size of the JTabbedPane.
- *
- * @param c The JComponent to find a size for.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- return layoutManager.preferredLayoutSize(tabPane);
- }
-
- /**
- * This method returns the minimum size of the JTabbedPane.
- *
- * @param c The JComponent to find a size for.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return layoutManager.minimumLayoutSize(tabPane);
- }
-
- /**
- * This method returns the maximum size of the JTabbedPane.
- *
- * @param c The JComponent to find a size for.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
- }
-
- /**
- * This method paints the JTabbedPane.
- *
- * @param g The Graphics object to paint with.
- * @param c The JComponent to paint.
- */
- public void paint(Graphics g, JComponent c)
- {
- if (tabPane.getTabCount() == 0)
- return;
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT)
- paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex());
- paintContentBorder(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex());
- }
-
- /**
- * This method paints the tab area. This includes painting the rectangles
- * that make up the tabs.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param selectedIndex The selected index.
- */
- protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex)
- {
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
-
- boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT;
-
- // Please note: the ordering of the painting is important.
- // we WANT to paint the outermost run first and then work our way in.
- int tabCount = tabPane.getTabCount();
- int currRun = 1;
- if (tabCount < 1)
- return;
-
- if (runCount > 1)
- currRun = 0;
- for (int i = 0; i < runCount; i++)
- {
- int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1;
- if (isScroll)
- first = currentScrollLocation;
- else if (first == tabCount)
- first = 0;
- int last = lastTabInRun(tabCount, currRun);
- if (isScroll)
- {
- for (int k = first; k < tabCount; k++)
- {
- if (rects[k].x + rects[k].width - rects[first].x > viewport
- .getWidth())
- {
- last = k;
- break;
- }
- }
- }
-
- for (int j = first; j <= last; j++)
- {
- if (j != selectedIndex || isScroll)
- paintTab(g, tabPlacement, rects, j, ir, tr);
- }
- currRun = getPreviousTabRun(currRun);
- }
- if (! isScroll)
- paintTab(g, tabPlacement, rects, selectedIndex, ir, tr);
- }
-
- /**
- * This method paints an individual tab.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param rects The array of rectangles that keep the size and position of
- * the tabs.
- * @param tabIndex The tab index to paint.
- * @param iconRect The rectangle to use for the icon.
- * @param textRect The rectangle to use for the text.
- */
- protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects,
- int tabIndex, Rectangle iconRect, Rectangle textRect)
- {
- FontMetrics fm = getFontMetrics();
- Icon icon = getIconForTab(tabIndex);
- String title = tabPane.getTitleAt(tabIndex);
- boolean isSelected = tabIndex == tabPane.getSelectedIndex();
- calcRect = getTabBounds(tabPane, tabIndex);
-
- int x = calcRect.x;
- int y = calcRect.y;
- int w = calcRect.width;
- int h = calcRect.height;
- if (getRunForTab(tabPane.getTabCount(), tabIndex) == 1)
- {
- Insets insets = getTabAreaInsets(tabPlacement);
- switch (tabPlacement)
- {
- case TOP:
- h += insets.bottom;
- break;
- case LEFT:
- w += insets.right;
- break;
- case BOTTOM:
- y -= insets.top;
- h += insets.top;
- break;
- case RIGHT:
- x -= insets.left;
- w += insets.left;
- break;
- }
- }
-
- layoutLabel(tabPlacement, fm, tabIndex, title, icon, calcRect, iconRect,
- textRect, isSelected);
- paintTabBackground(g, tabPlacement, tabIndex, x, y, w, h, isSelected);
- paintTabBorder(g, tabPlacement, tabIndex, x, y, w, h, isSelected);
-
- // FIXME: Paint little folding corner and jagged edge clipped tab.
- if (icon != null)
- paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);
- if (title != null && ! title.equals(""))
- paintText(g, tabPlacement, tabPane.getFont(), fm, tabIndex, title,
- textRect, isSelected);
- }
-
- /**
- * This method lays out the tab and finds the location to paint the icon
- * and text.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param metrics The font metrics for the font to paint with.
- * @param tabIndex The tab index to paint.
- * @param title The string painted.
- * @param icon The icon painted.
- * @param tabRect The tab bounds.
- * @param iconRect The calculated icon bounds.
- * @param textRect The calculated text bounds.
- * @param isSelected Whether this tab is selected.
- */
- protected void layoutLabel(int tabPlacement, FontMetrics metrics,
- int tabIndex, String title, Icon icon,
- Rectangle tabRect, Rectangle iconRect,
- Rectangle textRect, boolean isSelected)
- {
- SwingUtilities.layoutCompoundLabel(metrics, title, icon,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER, tabRect,
- iconRect, textRect, textIconGap);
-
- int shiftX = getTabLabelShiftX(tabPlacement, tabIndex, isSelected);
- int shiftY = getTabLabelShiftY(tabPlacement, tabIndex, isSelected);
-
- iconRect.x += shiftX;
- iconRect.y += shiftY;
-
- textRect.x += shiftX;
- textRect.y += shiftY;
- }
-
- /**
- * This method paints the icon.
- *
- * @param g The Graphics object to paint.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabIndex The tab index to paint.
- * @param icon The icon to paint.
- * @param iconRect The bounds of the icon.
- * @param isSelected Whether this tab is selected.
- */
- protected void paintIcon(Graphics g, int tabPlacement, int tabIndex,
- Icon icon, Rectangle iconRect, boolean isSelected)
- {
- icon.paintIcon(tabPane, g, iconRect.x, iconRect.y);
- }
-
- /**
- * This method paints the text for the given tab.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param font The font to paint with.
- * @param metrics The fontmetrics of the given font.
- * @param tabIndex The tab index.
- * @param title The string to paint.
- * @param textRect The bounds of the string.
- * @param isSelected Whether this tab is selected.
- */
- protected void paintText(Graphics g, int tabPlacement, Font font,
- FontMetrics metrics, int tabIndex, String title,
- Rectangle textRect, boolean isSelected)
- {
- View textView = getTextViewForTab(tabIndex);
- if (textView != null)
- {
- textView.paint(g, textRect);
- return;
- }
-
- Color fg = tabPane.getForegroundAt(tabIndex);
- if (fg == null)
- fg = tabPane.getForeground();
- Color bg = tabPane.getBackgroundAt(tabIndex);
- if (bg == null)
- bg = tabPane.getBackground();
-
- Color saved_color = g.getColor();
- Font f = g.getFont();
- g.setFont(font);
-
- if (tabPane.isEnabledAt(tabIndex))
- {
- g.setColor(fg);
-
- int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
-
- if (mnemIndex != -1)
- BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex,
- textRect.x,
- textRect.y
- + metrics.getAscent());
- else
- g.drawString(title, textRect.x, textRect.y + metrics.getAscent());
- }
- else
- {
- g.setColor(bg.brighter());
-
- int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
-
- if (mnemIndex != -1)
- BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex,
- textRect.x, textRect.y);
- else
- g.drawString(title, textRect.x, textRect.y);
-
- g.setColor(bg.darker());
- if (mnemIndex != -1)
- BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex,
- textRect.x + 1,
- textRect.y + 1);
- else
- g.drawString(title, textRect.x + 1, textRect.y + 1);
- }
-
- g.setColor(saved_color);
- g.setFont(f);
- }
-
- /**
- * This method returns how much the label for the tab should shift in the X
- * direction.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabIndex The tab index being painted.
- * @param isSelected Whether this tab is selected.
- *
- * @return The amount the label should shift by in the X direction.
- */
- protected int getTabLabelShiftX(int tabPlacement, int tabIndex,
- boolean isSelected)
- {
- // No reason to shift.
- return 0;
- }
-
- /**
- * This method returns how much the label for the tab should shift in the Y
- * direction.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabIndex The tab index being painted.
- * @param isSelected Whether this tab is selected.
- *
- * @return The amount the label should shift by in the Y direction.
- */
- protected int getTabLabelShiftY(int tabPlacement, int tabIndex,
- boolean isSelected)
- {
- // No reason to shift.
- return 0;
- }
-
- /**
- * This method paints the focus rectangle around the selected tab.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param rects The array of rectangles keeping track of size and position.
- * @param tabIndex The tab index.
- * @param iconRect The icon bounds.
- * @param textRect The text bounds.
- * @param isSelected Whether this tab is selected.
- */
- protected void paintFocusIndicator(Graphics g, int tabPlacement,
- Rectangle[] rects, int tabIndex,
- Rectangle iconRect, Rectangle textRect,
- boolean isSelected)
- {
- Color saved = g.getColor();
- calcRect = iconRect.union(textRect);
-
- g.setColor(focus);
-
- g.drawRect(calcRect.x, calcRect.y, calcRect.width, calcRect.height);
-
- g.setColor(saved);
- }
-
- /**
- * This method paints the border for an individual tab.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabIndex The tab index.
- * @param x The x position of the tab.
- * @param y The y position of the tab.
- * @param w The width of the tab.
- * @param h The height of the tab.
- * @param isSelected Whether the tab is selected.
- */
- protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex,
- int x, int y, int w, int h, boolean isSelected)
- {
- Color saved = g.getColor();
-
- if (! isSelected || tabPlacement != SwingConstants.TOP)
- {
- g.setColor(shadow);
- g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1);
- g.setColor(darkShadow);
- g.drawLine(x, y + h, x + w, y + h);
- }
-
- if (! isSelected || tabPlacement != SwingConstants.LEFT)
- {
- g.setColor(darkShadow);
- g.drawLine(x + w, y, x + w, y + h);
- g.setColor(shadow);
- g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1);
- }
-
- if (! isSelected || tabPlacement != SwingConstants.RIGHT)
- {
- g.setColor(lightHighlight);
- g.drawLine(x, y, x, y + h);
- }
-
- if (! isSelected || tabPlacement != SwingConstants.BOTTOM)
- {
- g.setColor(lightHighlight);
- g.drawLine(x, y, x + w, y);
- }
-
- g.setColor(saved);
- }
-
- /**
- * This method paints the background for an individual tab.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabIndex The tab index.
- * @param x The x position of the tab.
- * @param y The y position of the tab.
- * @param w The width of the tab.
- * @param h The height of the tab.
- * @param isSelected Whether the tab is selected.
- */
- protected void paintTabBackground(Graphics g, int tabPlacement,
- int tabIndex, int x, int y, int w, int h,
- boolean isSelected)
- {
- Color saved = g.getColor();
- if (isSelected)
- g.setColor(Color.LIGHT_GRAY);
- else
- {
- Color bg = tabPane.getBackgroundAt(tabIndex);
- if (bg == null)
- bg = Color.GRAY;
- g.setColor(bg);
- }
-
- g.fillRect(x, y, w, h);
-
- g.setColor(saved);
- }
-
- /**
- * This method paints the border around the content area.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param selectedIndex The index of the selected tab.
- */
- protected void paintContentBorder(Graphics g, int tabPlacement,
- int selectedIndex)
- {
- Insets insets = getContentBorderInsets(tabPlacement);
- int x = contentRect.x;
- int y = contentRect.y;
- int w = contentRect.width;
- int h = contentRect.height;
- paintContentBorderTopEdge(g, tabPlacement, selectedIndex, x, y, w, h);
- paintContentBorderLeftEdge(g, tabPlacement, selectedIndex, x, y, w, h);
- paintContentBorderBottomEdge(g, tabPlacement, selectedIndex, x, y, w, h);
- paintContentBorderRightEdge(g, tabPlacement, selectedIndex, x, y, w, h);
- }
-
- /**
- * This method paints the top edge of the content border.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param selectedIndex The selected tab index.
- * @param x The x coordinate for the content area.
- * @param y The y coordinate for the content area.
- * @param w The width of the content area.
- * @param h The height of the content area.
- */
- protected void paintContentBorderTopEdge(Graphics g, int tabPlacement,
- int selectedIndex, int x, int y,
- int w, int h)
- {
- Color saved = g.getColor();
- g.setColor(lightHighlight);
-
- int startgap = rects[selectedIndex].x;
- int endgap = rects[selectedIndex].x + rects[selectedIndex].width;
-
- int diff = 0;
-
- if (tabPlacement == SwingConstants.TOP)
- {
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- Point p = findPointForIndex(currentScrollLocation);
- diff = p.x;
- }
-
- g.drawLine(x, y, startgap - diff, y);
- g.drawLine(endgap - diff, y, x + w, y);
- }
- else
- g.drawLine(x, y, x + w, y);
-
- g.setColor(saved);
- }
-
- /**
- * This method paints the left edge of the content border.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param selectedIndex The selected tab index.
- * @param x The x coordinate for the content area.
- * @param y The y coordinate for the content area.
- * @param w The width of the content area.
- * @param h The height of the content area.
- */
- protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement,
- int selectedIndex, int x, int y,
- int w, int h)
- {
- Color saved = g.getColor();
- g.setColor(lightHighlight);
-
- int startgap = rects[selectedIndex].y;
- int endgap = rects[selectedIndex].y + rects[selectedIndex].height;
-
- int diff = 0;
-
- if (tabPlacement == SwingConstants.LEFT)
- {
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- Point p = findPointForIndex(currentScrollLocation);
- diff = p.y;
- }
-
- g.drawLine(x, y, x, startgap - diff);
- g.drawLine(x, endgap - diff, x, y + h);
- }
- else
- g.drawLine(x, y, x, y + h);
-
- g.setColor(saved);
- }
-
- /**
- * This method paints the bottom edge of the content border.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param selectedIndex The selected tab index.
- * @param x The x coordinate for the content area.
- * @param y The y coordinate for the content area.
- * @param w The width of the content area.
- * @param h The height of the content area.
- */
- protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement,
- int selectedIndex, int x, int y,
- int w, int h)
- {
- Color saved = g.getColor();
-
- int startgap = rects[selectedIndex].x;
- int endgap = rects[selectedIndex].x + rects[selectedIndex].width;
-
- int diff = 0;
-
- if (tabPlacement == SwingConstants.BOTTOM)
- {
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- Point p = findPointForIndex(currentScrollLocation);
- diff = p.x;
- }
-
- g.setColor(shadow);
- g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1);
- g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1);
-
- g.setColor(darkShadow);
- g.drawLine(x, y + h, startgap - diff, y + h);
- g.drawLine(endgap - diff, y + h, x + w, y + h);
- }
- else
- {
- g.setColor(shadow);
- g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1);
- g.setColor(darkShadow);
- g.drawLine(x, y + h, x + w, y + h);
- }
-
- g.setColor(saved);
- }
-
- /**
- * This method paints the right edge of the content border.
- *
- * @param g The Graphics object to paint with.
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param selectedIndex The selected tab index.
- * @param x The x coordinate for the content area.
- * @param y The y coordinate for the content area.
- * @param w The width of the content area.
- * @param h The height of the content area.
- */
- protected void paintContentBorderRightEdge(Graphics g, int tabPlacement,
- int selectedIndex, int x, int y,
- int w, int h)
- {
- Color saved = g.getColor();
- int startgap = rects[selectedIndex].y;
- int endgap = rects[selectedIndex].y + rects[selectedIndex].height;
-
- int diff = 0;
-
- if (tabPlacement == SwingConstants.RIGHT)
- {
- if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- Point p = findPointForIndex(currentScrollLocation);
- diff = p.y;
- }
-
- g.setColor(shadow);
- g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff);
- g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1);
-
- g.setColor(darkShadow);
- g.drawLine(x + w, y, x + w, startgap - diff);
- g.drawLine(x + w, endgap - diff, x + w, y + h);
- }
- else
- {
- g.setColor(shadow);
- g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1);
- g.setColor(darkShadow);
- g.drawLine(x + w, y, x + w, y + h);
- }
-
- g.setColor(saved);
- }
-
- /**
- * This method returns the tab bounds for the given index.
- *
- * @param pane The JTabbedPane.
- * @param i The index to look for.
- *
- * @return The bounds of the tab with the given index.
- */
- public Rectangle getTabBounds(JTabbedPane pane, int i)
- {
- return rects[i];
- }
-
- /**
- * This method returns the number of runs.
- *
- * @param pane The JTabbedPane.
- *
- * @return The number of runs.
- */
- public int getTabRunCount(JTabbedPane pane)
- {
- return runCount;
- }
-
- /**
- * This method returns the tab index given a coordinate.
- *
- * @param pane The JTabbedPane.
- * @param x The x coordinate.
- * @param y The y coordinate.
- *
- * @return The tab index that the coordinate lands in.
- */
- public int tabForCoordinate(JTabbedPane pane, int x, int y)
- {
- Point p = new Point(x, y);
- int tabCount = tabPane.getTabCount();
- int currRun = 1;
- for (int i = 0; i < runCount; i++)
- {
- int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1;
- if (first == tabCount)
- first = 0;
- int last = lastTabInRun(tabCount, currRun);
- for (int j = first; j <= last; j++)
- {
- if (getTabBounds(pane, j).contains(p))
- return j;
- }
- currRun = getNextTabRun(currRun);
- }
- return -1;
- }
-
- /**
- * This method returns the tab bounds in the given rectangle.
- *
- * @param tabIndex The index to get bounds for.
- * @param dest The rectangle to store bounds in.
- *
- * @return The rectangle passed in.
- */
- protected Rectangle getTabBounds(int tabIndex, Rectangle dest)
- {
- dest.setBounds(getTabBounds(tabPane, tabIndex));
- return dest;
- }
-
- /**
- * This method returns the component that is shown in the content area.
- *
- * @return The component that is shown in the content area.
- */
- protected Component getVisibleComponent()
- {
- return tabPane.getComponentAt(tabPane.getSelectedIndex());
- }
-
- /**
- * This method sets the visible component.
- *
- * @param component The component to be set visible.
- */
- protected void setVisibleComponent(Component component)
- {
- component.setVisible(true);
- tabPane.setSelectedComponent(component);
- }
-
- /**
- * This method assures that enough rectangles are created given the
- * tabCount. The old array is copied to the new one.
- *
- * @param tabCount The number of tabs.
- */
- protected void assureRectsCreated(int tabCount)
- {
- if (rects == null)
- rects = new Rectangle[tabCount];
- if (tabCount == rects.length)
- return;
- else
- {
- int numToCopy = Math.min(tabCount, rects.length);
- Rectangle[] tmp = new Rectangle[tabCount];
- System.arraycopy(rects, 0, tmp, 0, numToCopy);
- rects = tmp;
- }
- }
-
- /**
- * This method expands the tabRuns array to give it more room. The old array
- * is copied to the new one.
- */
- protected void expandTabRunsArray()
- {
- // This method adds another 10 index positions to the tabRuns array.
- if (tabRuns == null)
- tabRuns = new int[10];
- else
- {
- int[] newRuns = new int[tabRuns.length + 10];
- System.arraycopy(tabRuns, 0, newRuns, 0, tabRuns.length);
- tabRuns = newRuns;
- }
- }
-
- /**
- * This method returns which run a particular tab belongs to.
- *
- * @param tabCount The number of tabs.
- * @param tabIndex The tab to find.
- *
- * @return The tabRuns index that it belongs to.
- */
- protected int getRunForTab(int tabCount, int tabIndex)
- {
- if (runCount == 1 && tabIndex < tabCount && tabIndex >= 0)
- return 1;
- for (int i = 0; i < runCount; i++)
- {
- int first = lastTabInRun(tabCount, getPreviousTabRun(i)) + 1;
- if (first == tabCount)
- first = 0;
- int last = lastTabInRun(tabCount, i);
- if (last >= tabIndex && first <= tabIndex)
- return i;
- }
- return -1;
- }
-
- /**
- * This method returns the index of the last tab in a run.
- *
- * @param tabCount The number of tabs.
- * @param run The run to check.
- *
- * @return The last tab in the given run.
- */
- protected int lastTabInRun(int tabCount, int run)
- {
- if (tabRuns[run] == 0)
- return tabCount - 1;
- else
- return tabRuns[run] - 1;
- }
-
- /**
- * This method returns the tab run overlay.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- *
- * @return The tab run overlay.
- */
- protected int getTabRunOverlay(int tabPlacement)
- {
- return tabRunOverlay;
- }
-
- /**
- * This method returns the tab run indent. It is used in WRAP_TAB_LAYOUT and
- * makes each tab run start indented by a certain amount.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param run The run to get indent for.
- *
- * @return The amount a run should be indented.
- */
- protected int getTabRunIndent(int tabPlacement, int run)
- {
- return 0;
- }
-
- /**
- * This method returns whether a tab run should be padded.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param run The run to check.
- *
- * @return Whether the given run should be padded.
- */
- protected boolean shouldPadTabRun(int tabPlacement, int run)
- {
- return true;
- }
-
- /**
- * This method returns whether the tab runs should be rotated.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- *
- * @return Whether runs should be rotated.
- */
- protected boolean shouldRotateTabRuns(int tabPlacement)
- {
- return true;
- }
-
- /**
- * This method returns an icon for the tab. If the tab is disabled, it
- * should return the disabledIcon. If it is enabled, then it should return
- * the default icon.
- *
- * @param tabIndex The tab index to get an icon for.
- *
- * @return The icon for the tab index.
- */
- protected Icon getIconForTab(int tabIndex)
- {
- if (tabPane.isEnabledAt(tabIndex))
- return tabPane.getIconAt(tabIndex);
- else
- return tabPane.getDisabledIconAt(tabIndex);
- }
-
- /**
- * This method returns a view that can paint the text for the label.
- *
- * @param tabIndex The tab index to get a view for.
- *
- * @return The view for the tab index.
- */
- protected View getTextViewForTab(int tabIndex)
- {
- return null;
- }
-
- /**
- * This method returns the tab height, including insets, for the given index
- * and fontheight.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabIndex The index of the tab to calculate.
- * @param fontHeight The font height.
- *
- * @return This tab's height.
- */
- protected int calculateTabHeight(int tabPlacement, int tabIndex,
- int fontHeight)
- {
- Icon icon = getIconForTab(tabIndex);
- Insets insets = getTabInsets(tabPlacement, tabIndex);
-
- if (icon != null)
- {
- Rectangle vr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
- layoutLabel(tabPlacement, getFontMetrics(), tabIndex,
- tabPane.getTitleAt(tabIndex), icon, vr, ir, tr,
- tabIndex == tabPane.getSelectedIndex());
- calcRect = tr.union(ir);
- }
- else
- calcRect.height = fontHeight;
-
- calcRect.height += insets.top + insets.bottom;
- return calcRect.height;
- }
-
- /**
- * This method returns the max tab height.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- *
- * @return The maximum tab height.
- */
- protected int calculateMaxTabHeight(int tabPlacement)
- {
- maxTabHeight = 0;
-
- FontMetrics fm = getFontMetrics();
- int fontHeight = fm.getHeight();
-
- for (int i = 0; i < tabPane.getTabCount(); i++)
- maxTabHeight = Math.max(calculateTabHeight(tabPlacement, i, fontHeight),
- maxTabHeight);
-
- return maxTabHeight;
- }
-
- /**
- * This method calculates the tab width, including insets, for the given tab
- * index and font metrics.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabIndex The tab index to calculate for.
- * @param metrics The font's metrics.
- *
- * @return The tab width for the given index.
- */
- protected int calculateTabWidth(int tabPlacement, int tabIndex,
- FontMetrics metrics)
- {
- Icon icon = getIconForTab(tabIndex);
- Insets insets = getTabInsets(tabPlacement, tabIndex);
-
- if (icon != null)
- {
- Rectangle vr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
- layoutLabel(tabPlacement, getFontMetrics(), tabIndex,
- tabPane.getTitleAt(tabIndex), icon, vr, ir, tr,
- tabIndex == tabPane.getSelectedIndex());
- calcRect = tr.union(ir);
- }
- else
- calcRect.width = metrics.stringWidth(tabPane.getTitleAt(tabIndex));
-
- calcRect.width += insets.left + insets.right;
- return calcRect.width;
- }
-
- /**
- * This method calculates the max tab width.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- *
- * @return The maximum tab width.
- */
- protected int calculateMaxTabWidth(int tabPlacement)
- {
- maxTabWidth = 0;
-
- FontMetrics fm = getFontMetrics();
-
- for (int i = 0; i < tabPane.getTabCount(); i++)
- maxTabWidth = Math.max(calculateTabWidth(tabPlacement, i, fm),
- maxTabWidth);
-
- return maxTabWidth;
- }
-
- /**
- * This method calculates the tab area height, including insets, for the
- * given amount of runs and tab height.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param horizRunCount The number of runs.
- * @param maxTabHeight The max tab height.
- *
- * @return The tab area height.
- */
- protected int calculateTabAreaHeight(int tabPlacement, int horizRunCount,
- int maxTabHeight)
- {
- Insets insets = getTabAreaInsets(tabPlacement);
- int tabAreaHeight = horizRunCount * maxTabHeight
- - (horizRunCount - 1) * tabRunOverlay;
-
- tabAreaHeight += insets.top + insets.bottom;
-
- return tabAreaHeight;
- }
-
- /**
- * This method calculates the tab area width, including insets, for the
- * given amount of runs and tab width.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param vertRunCount The number of runs.
- * @param maxTabWidth The max tab width.
- *
- * @return The tab area width.
- */
- protected int calculateTabAreaWidth(int tabPlacement, int vertRunCount,
- int maxTabWidth)
- {
- Insets insets = getTabAreaInsets(tabPlacement);
- int tabAreaWidth = vertRunCount * maxTabWidth
- - (vertRunCount - 1) * tabRunOverlay;
-
- tabAreaWidth += insets.left + insets.right;
-
- return tabAreaWidth;
- }
-
- /**
- * This method returns the tab insets appropriately rotated.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabIndex The tab index.
- *
- * @return The tab insets for the given index.
- */
- protected Insets getTabInsets(int tabPlacement, int tabIndex)
- {
- Insets target = new Insets(0, 0, 0, 0);
- rotateInsets(tabInsets, target, tabPlacement);
- return target;
- }
-
- /**
- * This method returns the selected tab pad insets appropriately rotated.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- *
- * @return The selected tab pad insets.
- */
- protected Insets getSelectedTabPadInsets(int tabPlacement)
- {
- Insets target = new Insets(0, 0, 0, 0);
- rotateInsets(selectedTabPadInsets, target, tabPlacement);
- return target;
- }
-
- /**
- * This method returns the tab area insets appropriately rotated.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- *
- * @return The tab area insets.
- */
- protected Insets getTabAreaInsets(int tabPlacement)
- {
- Insets target = new Insets(0, 0, 0, 0);
- rotateInsets(tabAreaInsets, target, tabPlacement);
- return target;
- }
-
- /**
- * This method returns the content border insets appropriately rotated.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- *
- * @return The content border insets.
- */
- protected Insets getContentBorderInsets(int tabPlacement)
- {
- Insets target = new Insets(0, 0, 0, 0);
- rotateInsets(contentBorderInsets, target, tabPlacement);
- return target;
- }
-
- /**
- * This method returns the fontmetrics for the font of the JTabbedPane.
- *
- * @return The font metrics for the JTabbedPane.
- */
- protected FontMetrics getFontMetrics()
- {
- FontMetrics fm = tabPane.getToolkit().getFontMetrics(tabPane.getFont());
- return fm;
- }
-
- /**
- * This method navigates from the selected tab into the given direction. As
- * a result, a new tab will be selected (if possible).
- *
- * @param direction The direction to navigate in.
- */
- protected void navigateSelectedTab(int direction)
- {
- int tabPlacement = tabPane.getTabPlacement();
- if (tabPlacement == SwingConstants.TOP
- || tabPlacement == SwingConstants.BOTTOM)
- {
- if (direction == SwingConstants.WEST)
- selectPreviousTabInRun(tabPane.getSelectedIndex());
- else if (direction == SwingConstants.EAST)
- selectNextTabInRun(tabPane.getSelectedIndex());
-
- else
- {
- int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(),
- tabPane.getSelectedIndex(),
- (tabPlacement == SwingConstants.RIGHT)
- ? true : false);
- selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(),
- offset);
- }
- }
- if (tabPlacement == SwingConstants.LEFT
- || tabPlacement == SwingConstants.RIGHT)
- {
- if (direction == SwingConstants.NORTH)
- selectPreviousTabInRun(tabPane.getSelectedIndex());
- else if (direction == SwingConstants.SOUTH)
- selectNextTabInRun(tabPane.getSelectedIndex());
- else
- {
- int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(),
- tabPane.getSelectedIndex(),
- (tabPlacement == SwingConstants.RIGHT)
- ? true : false);
- selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(),
- offset);
- }
- }
- }
-
- /**
- * This method selects the next tab in the run.
- *
- * @param current The current selected index.
- */
- protected void selectNextTabInRun(int current)
- {
- tabPane.setSelectedIndex(getNextTabIndexInRun(tabPane.getTabCount(),
- current));
- }
-
- /**
- * This method selects the previous tab in the run.
- *
- * @param current The current selected index.
- */
- protected void selectPreviousTabInRun(int current)
- {
- tabPane.setSelectedIndex(getPreviousTabIndexInRun(tabPane.getTabCount(),
- current));
- }
-
- /**
- * This method selects the next tab (regardless of runs).
- *
- * @param current The current selected index.
- */
- protected void selectNextTab(int current)
- {
- tabPane.setSelectedIndex(getNextTabIndex(current));
- }
-
- /**
- * This method selects the previous tab (regardless of runs).
- *
- * @param current The current selected index.
- */
- protected void selectPreviousTab(int current)
- {
- tabPane.setSelectedIndex(getPreviousTabIndex(current));
- }
-
- /**
- * This method selects the correct tab given an offset from the current tab
- * index. If the tab placement is TOP or BOTTOM, the offset will be in the
- * y direction, otherwise, it will be in the x direction. A new coordinate
- * will be found by adding the offset to the current location of the tab.
- * The tab that the new location will be selected.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabIndex The tab to start from.
- * @param offset The coordinate offset.
- */
- protected void selectAdjacentRunTab(int tabPlacement, int tabIndex,
- int offset)
- {
- int x = rects[tabIndex].x + rects[tabIndex].width / 2;
- int y = rects[tabIndex].y + rects[tabIndex].height / 2;
-
- switch (tabPlacement)
- {
- case SwingConstants.TOP:
- case SwingConstants.BOTTOM:
- y += offset;
- break;
- case SwingConstants.RIGHT:
- case SwingConstants.LEFT:
- x += offset;
- break;
- }
-
- int index = tabForCoordinate(tabPane, x, y);
- if (index != -1)
- tabPane.setSelectedIndex(index);
- }
-
- // This method is called when you press up/down to cycle through tab runs.
- // it returns the distance (between the two runs' x/y position.
- // where one run is the current selected run and the other run is the run in the
- // direction of the scroll (dictated by the forward flag)
- // the offset is an absolute value of the difference
-
- /**
- * This method calculates the offset distance for use in
- * selectAdjacentRunTab. The offset returned will be a difference in the y
- * coordinate between the run in the desired direction and the current run
- * (for tabPlacement in TOP or BOTTOM). Use x coordinate for LEFT and
- * RIGHT.
- *
- * @param tabPlacement The JTabbedPane's tab placement.
- * @param tabCount The number of tabs.
- * @param tabIndex The starting index.
- * @param forward If forward, the run in the desired direction will be the
- * next run.
- *
- * @return The offset between the two runs.
- */
- protected int getTabRunOffset(int tabPlacement, int tabCount, int tabIndex,
- boolean forward)
- {
- int currRun = getRunForTab(tabCount, tabIndex);
- int offset;
- int nextRun = (forward) ? getNextTabRun(currRun) : getPreviousTabRun(currRun);
- if (tabPlacement == SwingConstants.TOP
- || tabPlacement == SwingConstants.BOTTOM)
- offset = rects[lastTabInRun(tabCount, nextRun)].y
- - rects[lastTabInRun(tabCount, currRun)].y;
- else
- offset = rects[lastTabInRun(tabCount, nextRun)].x
- - rects[lastTabInRun(tabCount, currRun)].x;
- return offset;
- }
-
- /**
- * This method returns the previous tab index.
- *
- * @param base The index to start from.
- *
- * @return The previous tab index.
- */
- protected int getPreviousTabIndex(int base)
- {
- base--;
- if (base < 0)
- return tabPane.getTabCount() - 1;
- return base;
- }
-
- /**
- * This method returns the next tab index.
- *
- * @param base The index to start from.
- *
- * @return The next tab index.
- */
- protected int getNextTabIndex(int base)
- {
- base++;
- if (base == tabPane.getTabCount())
- return 0;
- return base;
- }
-
- /**
- * This method returns the next tab index in the run. If the next index is
- * out of this run, it will return the starting tab index for the run.
- *
- * @param tabCount The number of tabs.
- * @param base The index to start from.
- *
- * @return The next tab index in the run.
- */
- protected int getNextTabIndexInRun(int tabCount, int base)
- {
- int index = getNextTabIndex(base);
- int run = getRunForTab(tabCount, base);
- if (index == lastTabInRun(tabCount, run) + 1)
- index = lastTabInRun(tabCount, getPreviousTabRun(run)) + 1;
- return getNextTabIndex(base);
- }
-
- /**
- * This method returns the previous tab index in the run. If the previous
- * index is out of this run, it will return the last index for the run.
- *
- * @param tabCount The number of tabs.
- * @param base The index to start from.
- *
- * @return The previous tab index in the run.
- */
- protected int getPreviousTabIndexInRun(int tabCount, int base)
- {
- int index = getPreviousTabIndex(base);
- int run = getRunForTab(tabCount, base);
- if (index == lastTabInRun(tabCount, getPreviousTabRun(run)))
- index = lastTabInRun(tabCount, run);
- return getPreviousTabIndex(base);
- }
-
- /**
- * This method returns the index of the previous run.
- *
- * @param baseRun The run to start from.
- *
- * @return The index of the previous run.
- */
- protected int getPreviousTabRun(int baseRun)
- {
- if (getTabRunCount(tabPane) == 1)
- return 1;
-
- int prevRun = --baseRun;
- if (prevRun < 0)
- prevRun = getTabRunCount(tabPane) - 1;
- return prevRun;
- }
-
- /**
- * This method returns the index of the next run.
- *
- * @param baseRun The run to start from.
- *
- * @return The index of the next run.
- */
- protected int getNextTabRun(int baseRun)
- {
- if (getTabRunCount(tabPane) == 1)
- return 1;
-
- int nextRun = ++baseRun;
- if (nextRun == getTabRunCount(tabPane))
- nextRun = 0;
- return nextRun;
- }
-
- /**
- * This method rotates the insets given a direction to rotate them in.
- * Target placement should be one of TOP, LEFT, BOTTOM, RIGHT. The rotated
- * insets will be stored in targetInsets. Passing in TOP as the direction
- * does nothing. Passing in LEFT switches top and left, right and bottom.
- * Passing in BOTTOM switches top and bottom. Passing in RIGHT switches top
- * for left, left for bottom, bottom for right, and right for top.
- *
- * @param topInsets The reference insets.
- * @param targetInsets An Insets object to store the new insets.
- * @param targetPlacement The rotation direction.
- */
- protected static void rotateInsets(Insets topInsets, Insets targetInsets,
- int targetPlacement)
- {
- // Sun's version will happily throw an NPE if params are null,
- // so I won't check it either.
- switch (targetPlacement)
- {
- case SwingConstants.TOP:
- targetInsets.top = topInsets.top;
- targetInsets.left = topInsets.left;
- targetInsets.right = topInsets.right;
- targetInsets.bottom = topInsets.bottom;
- break;
- case SwingConstants.LEFT:
- targetInsets.left = topInsets.top;
- targetInsets.top = topInsets.left;
- targetInsets.right = topInsets.bottom;
- targetInsets.bottom = topInsets.right;
- break;
- case SwingConstants.BOTTOM:
- targetInsets.top = topInsets.bottom;
- targetInsets.bottom = topInsets.top;
- targetInsets.left = topInsets.left;
- targetInsets.right = topInsets.right;
- break;
- case SwingConstants.RIGHT:
- targetInsets.top = topInsets.left;
- targetInsets.left = topInsets.bottom;
- targetInsets.bottom = topInsets.right;
- targetInsets.right = topInsets.top;
- break;
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java b/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java
deleted file mode 100644
index 700b406d076..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/* BasicTableHeaderUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-import java.awt.event.MouseEvent;
-
-import javax.swing.CellRendererPane;
-import javax.swing.JComponent;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import javax.swing.event.MouseInputListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.TableHeaderUI;
-import javax.swing.table.JTableHeader;
-import javax.swing.table.TableCellRenderer;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableColumnModel;
-
-public class BasicTableHeaderUI
- extends TableHeaderUI
-{
-
- public static ComponentUI createUI(JComponent h)
- {
- return new BasicTableHeaderUI();
- }
-
- protected JTableHeader header;
- protected MouseInputListener mouseInputListener;
- protected CellRendererPane rendererPane;
- protected Border cellBorder;
-
- class MouseInputHandler
- implements MouseInputListener
- {
- public void mouseClicked(MouseEvent e) {}
- public void mouseDragged(MouseEvent e) {}
- public void mouseEntered(MouseEvent e) {}
- public void mouseExited(MouseEvent e) {}
- public void mouseMoved(MouseEvent e) {}
- public void mousePressed(MouseEvent e) {}
- public void mouseReleased(MouseEvent e) {}
- }
-
- protected MouseInputListener createMouseInputListener()
- {
- return new MouseInputHandler();
- }
-
- public BasicTableHeaderUI()
- {
- mouseInputListener = createMouseInputListener();
- }
-
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- header.setBackground(defaults.getColor("TableHeader.background"));
- header.setForeground(defaults.getColor("TableHeader.foreground"));
- header.setFont(defaults.getFont("TableHeader.font"));
- cellBorder = defaults.getBorder("TableHeader.cellBorder");
- }
-
- protected void installKeyboardActions()
- {
- }
-
- protected void installListeners()
- {
- header.addMouseListener(mouseInputListener);
- }
-
- public void installUI(JComponent c)
- {
- header = (JTableHeader) c;
- installDefaults();
- installKeyboardActions();
- installListeners();
- }
-
- protected void uninstallDefaults()
- {
- header.setBackground(null);
- header.setForeground(null);
- header.setFont(null);
- }
-
- protected void uninstallKeyboardActions()
- {
- }
-
- protected void uninstallListeners()
- {
- header.removeMouseListener(mouseInputListener);
- }
-
- public void uninstallUI(JComponent c)
- {
- uninstallListeners();
- uninstallKeyboardActions();
- uninstallDefaults();
- }
-
- public void paint(Graphics gfx, JComponent c)
- {
- TableColumnModel cmod = header.getColumnModel();
- int ncols = cmod.getColumnCount();
- if (ncols == 0)
- return;
-
- Rectangle clip = gfx.getClipBounds();
- TableCellRenderer defaultRend = header.getDefaultRenderer();
-
- for (int i = 0; i < ncols; ++i)
- {
- Rectangle bounds = header.getHeaderRect(i);
- if (bounds.intersects(clip))
- {
- TableColumn col = cmod.getColumn(i);
- TableCellRenderer rend = col.getHeaderRenderer();
- if (rend == null)
- rend = defaultRend;
- Object val = col.getHeaderValue();
- Component comp = rend.getTableCellRendererComponent(header.getTable(),
- val,
- false, // isSelected
- false, // isFocused
- -1, i);
- comp.setFont(header.getFont());
- comp.setBackground(header.getBackground());
- comp.setForeground(header.getForeground());
- if (comp instanceof JComponent)
- ((JComponent)comp).setBorder(cellBorder);
- gfx.translate(bounds.x, bounds.y);
- comp.setSize(bounds.width, bounds.height);
- comp.setLocation(0,0);
- comp.paint(gfx);
- gfx.translate(-bounds.x, -bounds.y);
- }
- }
-
- }
-
- public Dimension getPreferredSize(JComponent c)
- {
- TableColumnModel cmod = header.getColumnModel();
- TableCellRenderer defaultRend = header.getDefaultRenderer();
- int ncols = cmod.getColumnCount();
- Dimension ret = new Dimension(0,0);
- int spacing = 0;
-
- if (header.getTable() != null
- && header.getTable().getIntercellSpacing() != null)
- spacing = header.getTable().getIntercellSpacing().width;
-
- for (int i = 0; i < ncols; ++i)
- {
- TableColumn col = cmod.getColumn(i);
- TableCellRenderer rend = col.getHeaderRenderer();
- if (rend == null)
- rend = defaultRend;
- Object val = col.getHeaderValue();
- Component comp = rend.getTableCellRendererComponent(header.getTable(),
- val,
- false, // isSelected
- false, // isFocused
- -1, i);
- comp.setFont(header.getFont());
- comp.setBackground(header.getBackground());
- comp.setForeground(header.getForeground());
- if (comp instanceof JComponent)
- ((JComponent)comp).setBorder(cellBorder);
-
- Dimension d = comp.getPreferredSize();
- ret.width += spacing;
- ret.height = Math.max(d.height, ret.height);
- }
- ret.width = cmod.getTotalColumnWidth();
- return ret;
- }
-
-
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicTableUI.java b/libjava/javax/swing/plaf/basic/BasicTableUI.java
deleted file mode 100644
index 76f6252e68b..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicTableUI.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/* BasicTableUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-
-import javax.swing.CellRendererPane;
-import javax.swing.JComponent;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.event.MouseInputListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.TableUI;
-import javax.swing.table.TableCellRenderer;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableColumnModel;
-
-public class BasicTableUI
- extends TableUI
-{
- public static ComponentUI createUI(JComponent comp)
- {
- return new BasicTableUI();
- }
-
- protected FocusListener focusListener;
- protected KeyListener keyListener;
- protected MouseInputListener mouseInputListener;
- protected CellRendererPane rendererPane;
- protected JTable table;
-
- class FocusHandler implements FocusListener
- {
- public void focusGained(FocusEvent e)
- {
- }
- public void focusLost(FocusEvent e)
- {
- }
- }
-
- class KeyHandler implements KeyListener
- {
- public void keyPressed(KeyEvent e)
- {
- }
- public void keyReleased(KeyEvent e)
- {
- }
- public void keyTyped(KeyEvent e)
- {
- }
- }
-
- class MouseInputHandler implements MouseInputListener
- {
- Point begin, curr;
-
- private void updateSelection()
- {
- if (table.getRowSelectionAllowed())
- {
- int lo_row = table.rowAtPoint(begin);
- int hi_row = table.rowAtPoint(curr);
- ListSelectionModel rowModel = table.getSelectionModel();
- if (lo_row != -1 && hi_row != -1)
- rowModel.setSelectionInterval(lo_row, hi_row);
- }
-
- if (table.getColumnSelectionAllowed())
- {
- int lo_col = table.columnAtPoint(begin);
- int hi_col = table.columnAtPoint(curr);
- ListSelectionModel colModel = table.getColumnModel().getSelectionModel();
- if (lo_col != -1 && hi_col != -1)
- colModel.setSelectionInterval(lo_col, hi_col);
- }
- }
-
- public void mouseClicked(MouseEvent e)
- {
- }
- public void mouseDragged(MouseEvent e)
- {
- curr = new Point(e.getX(), e.getY());
- updateSelection();
- }
- public void mouseEntered(MouseEvent e)
- {
- }
- public void mouseExited(MouseEvent e)
- {
- }
- public void mouseMoved(MouseEvent e)
- {
- }
- public void mousePressed(MouseEvent e)
- {
- begin = new Point(e.getX(), e.getY());
- curr = new Point(e.getX(), e.getY());
- updateSelection();
- }
- public void mouseReleased(MouseEvent e)
- {
- begin = null;
- curr = null;
- }
- }
-
- protected FocusListener createFocusListener()
- {
- return new FocusHandler();
- }
- protected KeyListener createKeyListener()
- {
- return new KeyHandler();
- }
- protected MouseInputListener createMouseInputListener()
- {
- return new MouseInputHandler();
- }
-
- public Dimension getMaximumSize(JComponent comp)
- {
- return getPreferredSize(comp);
- }
-
- public Dimension getMinimumSize(JComponent comp)
- {
- return getPreferredSize(comp);
- }
-
- public Dimension getPreferredSize(JComponent comp)
- {
- int width = table.getColumnModel().getTotalColumnWidth();
- int height = table.getRowCount() * table.getRowHeight();
- return new Dimension(width, height);
- }
-
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- table.setFont(defaults.getFont("Table.font"));
- table.setGridColor(defaults.getColor("Table.gridColor"));
- table.setForeground(defaults.getColor("Table.foreground"));
- table.setBackground(defaults.getColor("Table.background"));
- table.setSelectionForeground(defaults.getColor("Table.selectionForeground"));
- table.setSelectionBackground(defaults.getColor("Table.selectionBackground"));
- table.setOpaque(true);
- }
- protected void installKeyboardActions()
- {
- }
-
- protected void installListeners()
- {
- table.addFocusListener(focusListener);
- table.addKeyListener(keyListener);
- table.addMouseListener(mouseInputListener);
- }
-
- protected void uninstallDefaults()
- {
- table.setFont(null);
- table.setGridColor(null);
- table.setForeground(null);
- table.setBackground(null);
- table.setSelectionForeground(null);
- table.setSelectionBackground(null);
- }
-
- protected void uninstallKeyboardActions()
- {
- }
-
- protected void uninstallListeners()
- {
- table.removeFocusListener(focusListener);
- table.removeKeyListener(keyListener);
- table.removeMouseListener(mouseInputListener);
- }
-
- public void installUI(JComponent comp)
- {
- table = (JTable)comp;
- focusListener = createFocusListener();
- keyListener = createKeyListener();
- mouseInputListener = createMouseInputListener();
- installDefaults();
- installKeyboardActions();
- installListeners();
- }
-
- public void uninstallUI(JComponent c)
- {
- uninstallListeners();
- uninstallKeyboardActions();
- uninstallDefaults();
- }
-
- public void paint(Graphics gfx, JComponent ignored)
- {
- int ncols = table.getColumnCount();
- int nrows = table.getRowCount();
- if (nrows == 0 || ncols == 0)
- return;
-
- Rectangle clip = gfx.getClipBounds();
- TableColumnModel cols = table.getColumnModel();
-
- int height = table.getRowHeight();
- int x0 = 0, y0 = 0;
- int x = x0;
- int y = y0;
-
- Dimension gap = table.getIntercellSpacing();
- int ymax = clip.y + clip.height;
- int xmax = clip.x + clip.width;
-
- // paint the cell contents
- for (int c = 0; c < ncols && x < xmax; ++c)
- {
- y = y0;
- TableColumn col = cols.getColumn(c);
- int width = col.getWidth();
- int modelCol = col.getModelIndex();
-
- for (int r = 0; r < nrows && y < ymax; ++r)
- {
- Rectangle bounds = new Rectangle(x, y, width, height);
- if (bounds.intersects(clip))
- {
- TableCellRenderer rend = table.getCellRenderer(r, c);
- Component comp = table.prepareRenderer(rend, r, c);
- gfx.translate(x, y);
- comp.setBounds(new Rectangle(0, 0, width, height));
- comp.paint(gfx);
- gfx.translate(-x, -y);
- }
- y += height;
- if (gap != null)
- y += gap.height;
- }
- x += width;
- if (gap != null)
- x += gap.width;
- }
-
- // tighten up the x and y max bounds
- ymax = y;
- xmax = x;
-
- Color grid = table.getGridColor();
-
- // paint vertical grid lines
- if (grid != null && table.getShowVerticalLines())
- {
- x = x0;
- Color save = gfx.getColor();
- gfx.setColor(grid);
- boolean paintedLine = false;
- for (int c = 0; c < ncols && x < xmax; ++c)
- {
- x += cols.getColumn(c).getWidth();;
- if (gap != null)
- x += gap.width;
- gfx.drawLine(x, y0, x, ymax);
- paintedLine = true;
- }
- gfx.setColor(save);
- }
-
- // paint horizontal grid lines
- if (grid != null && table.getShowHorizontalLines())
- {
- y = y0;
- Color save = gfx.getColor();
- gfx.setColor(grid);
- boolean paintedLine = false;
- for (int r = 0; r < nrows && y < ymax; ++r)
- {
- y += height;
- if (gap != null)
- y += gap.height;
- gfx.drawLine(x0, y, xmax, y);
- paintedLine = true;
- }
- gfx.setColor(save);
- }
-
- }
-
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicTextAreaUI.java b/libjava/javax/swing/plaf/basic/BasicTextAreaUI.java
deleted file mode 100644
index 97b0ccb6ee6..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicTextAreaUI.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* BasicTextAreaUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.text.Element;
-import javax.swing.text.PlainView;
-import javax.swing.text.View;
-
-public class BasicTextAreaUI extends BasicTextUI
-{
- public static ComponentUI createUI(JComponent comp)
- {
- return new BasicTextAreaUI();
- }
-
- public BasicTextAreaUI()
- {
- }
-
- public View create(Element elem)
- {
- return new PlainView(elem);
- }
-
- protected String getPropertyPrefix()
- {
- return "TextArea";
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicTextFieldUI.java b/libjava/javax/swing/plaf/basic/BasicTextFieldUI.java
deleted file mode 100644
index a300446c262..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicTextFieldUI.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* BasicTextFieldUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.beans.PropertyChangeEvent;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.text.Element;
-import javax.swing.text.FieldView;
-import javax.swing.text.View;
-
-public class BasicTextFieldUI extends BasicTextUI
-{
- public BasicTextFieldUI()
- {
- super();
- }
-
- public View create(Element elem)
- {
- return new FieldView(elem);
- }
-
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicTextFieldUI();
- }
-
- protected String getPropertyPrefix()
- {
- return "TextField";
- }
-
- public void installUI(JComponent c)
- {
- super.installUI(c);
- }
-
- protected void propertyChange(PropertyChangeEvent event)
- {
- // Does nothing by default.
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicTextPaneUI.java b/libjava/javax/swing/plaf/basic/BasicTextPaneUI.java
deleted file mode 100644
index 55d908e1b88..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicTextPaneUI.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* BasicTextPaneUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.text.Element;
-import javax.swing.text.PlainView;
-import javax.swing.text.View;
-
-public class BasicTextPaneUI extends BasicEditorPaneUI
-{
- public BasicTextPaneUI()
- {
- // Do nothing here.
- }
-
- public static ComponentUI createUI(JComponent comp)
- {
- return new BasicTextPaneUI();
- }
-
- public View create(Element elem)
- {
- return new PlainView(elem);
- }
-
- protected String getPropertyPrefix()
- {
- return "TextPane";
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicTextUI.java b/libjava/javax/swing/plaf/basic/BasicTextUI.java
deleted file mode 100644
index 530332b79f6..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicTextUI.java
+++ /dev/null
@@ -1,496 +0,0 @@
-/* BasicTextUI.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import javax.swing.Action;
-import javax.swing.ActionMap;
-import javax.swing.InputMap;
-import javax.swing.JComponent;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.TextUI;
-import javax.swing.plaf.UIResource;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Caret;
-import javax.swing.text.DefaultCaret;
-import javax.swing.text.DefaultEditorKit;
-import javax.swing.text.DefaultHighlighter;
-import javax.swing.text.Document;
-import javax.swing.text.EditorKit;
-import javax.swing.text.Element;
-import javax.swing.text.Highlighter;
-import javax.swing.text.JTextComponent;
-import javax.swing.text.Keymap;
-import javax.swing.text.PlainView;
-import javax.swing.text.Position;
-import javax.swing.text.View;
-import javax.swing.text.ViewFactory;
-
-
-public abstract class BasicTextUI extends TextUI
- implements ViewFactory
-{
- public static class BasicCaret extends DefaultCaret
- implements UIResource
- {
- public BasicCaret()
- {
- }
- }
-
- public static class BasicHighlighter extends DefaultHighlighter
- implements UIResource
- {
- public BasicHighlighter()
- {
- }
- }
-
- private class RootView extends View
- {
- private View view;
-
- public RootView()
- {
- super(null);
- }
-
- // View methods.
-
- public ViewFactory getViewFactory()
- {
- // FIXME: Handle EditorKit somehow.
- return BasicTextUI.this;
- }
-
- public void setView(View v)
- {
- if (view != null)
- view.setParent(null);
-
- if (v != null)
- v.setParent(null);
-
- view = v;
- }
-
- public Container getContainer()
- {
- return textComponent;
- }
-
- public float getPreferredSpan(int axis)
- {
- if (view != null)
- return view.getPreferredSpan(axis);
-
- return Integer.MAX_VALUE;
- }
-
- public void paint(Graphics g, Shape s)
- {
- if (view != null)
- view.paint(g, s);
- }
-
- public Shape modelToView(int position, Shape a, Position.Bias bias)
- throws BadLocationException
- {
- if (view == null)
- return null;
-
- return ((PlainView) view).modelToView(position, a, bias).getBounds();
- }
- }
-
- class UpdateHandler implements PropertyChangeListener
- {
- public void propertyChange(PropertyChangeEvent event)
- {
- if (event.getPropertyName().equals("document"))
- {
- // Document changed.
- modelChanged();
- }
- }
- }
-
- static EditorKit kit = new DefaultEditorKit();
-
- RootView rootView = new RootView();
- JTextComponent textComponent;
- UpdateHandler updateHandler = new UpdateHandler();
-
- public BasicTextUI()
- {
- }
-
- protected Caret createCaret()
- {
- return new BasicCaret();
- }
-
- protected Highlighter createHighlighter()
- {
- return new BasicHighlighter();
- }
-
- protected final JTextComponent getComponent()
- {
- return textComponent;
- }
-
- public void installUI(final JComponent c)
- {
- super.installUI(c);
- c.setOpaque(true);
-
- textComponent = (JTextComponent) c;
-
- Document doc = textComponent.getDocument();
- if (doc == null)
- {
- doc = getEditorKit(textComponent).createDefaultDocument();
- textComponent.setDocument(doc);
- }
-
- textComponent.addPropertyChangeListener(updateHandler);
- modelChanged();
-
- installDefaults();
- installListeners();
- installKeyboardActions();
- }
-
- protected void installDefaults()
- {
- Caret caret = textComponent.getCaret();
- if (caret == null)
- {
- caret = createCaret();
- textComponent.setCaret(caret);
- }
-
- Highlighter highlighter = textComponent.getHighlighter();
- if (highlighter == null)
- textComponent.setHighlighter(createHighlighter());
-
- String prefix = getPropertyPrefix();
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- textComponent.setBackground(defaults.getColor(prefix + ".background"));
- textComponent.setForeground(defaults.getColor(prefix + ".foreground"));
- textComponent.setMargin(defaults.getInsets(prefix + ".margin"));
- textComponent.setBorder(defaults.getBorder(prefix + ".border"));
- textComponent.setFont(defaults.getFont(prefix + ".font"));
-
- caret.setBlinkRate(defaults.getInt(prefix + ".caretBlinkRate"));
- }
-
- private FocusListener focuslistener = new FocusListener() {
- public void focusGained(FocusEvent e)
- {
- textComponent.repaint();
- }
- public void focusLost(FocusEvent e)
- {
- textComponent.repaint();
- }
- };
-
- protected void installListeners()
- {
- textComponent.addFocusListener(focuslistener);
- }
-
- protected String getKeymapName()
- {
- return "BasicTextUI";
- }
-
- protected Keymap createKeymap()
- {
- String prefix = getPropertyPrefix();
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- JTextComponent.KeyBinding[] bindings =
- (JTextComponent.KeyBinding[]) defaults.get(prefix + ".keyBindings");
- Keymap km = JTextComponent.addKeymap(getKeymapName(),
- JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP));
- JTextComponent.loadKeymap(km, bindings, textComponent.getActions());
- return km;
- }
-
- protected void installKeyboardActions()
- {
- // load any bindings for the older Keymap interface
- Keymap km = JTextComponent.getKeymap(getKeymapName());
- if (km == null)
- km = createKeymap();
- textComponent.setKeymap(km);
-
- // load any bindings for the newer InputMap / ActionMap interface
- SwingUtilities.replaceUIInputMap(textComponent,
- JComponent.WHEN_FOCUSED,
- getInputMap(JComponent.WHEN_FOCUSED));
- SwingUtilities.replaceUIActionMap(textComponent, getActionMap());
- }
-
- InputMap getInputMap(int condition)
- {
- String prefix = getPropertyPrefix();
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- switch (condition)
- {
- case JComponent.WHEN_IN_FOCUSED_WINDOW:
- // FIXME: is this the right string? nobody seems to use it.
- return (InputMap) defaults.get(prefix + ".windowInputMap");
- case JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT:
- return (InputMap) defaults.get(prefix + ".ancestorInputMap");
- default:
- case JComponent.WHEN_FOCUSED:
- return (InputMap) defaults.get(prefix + ".focusInputMap");
- }
- }
-
- ActionMap getActionMap()
- {
- String prefix = getPropertyPrefix();
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- ActionMap am = (ActionMap) defaults.get(prefix + ".actionMap");
- if (am == null)
- {
- am = createActionMap();
- defaults.put(prefix + ".actionMap", am);
- }
- return am;
- }
-
- ActionMap createActionMap()
- {
- Action[] actions = textComponent.getActions();
- ActionMap am = new ActionMap();
- for (int i = 0; i < actions.length; ++i)
- {
- String name = (String) actions[i].getValue(Action.NAME);
- if (name != null)
- am.put(name, actions[i]);
- }
- return am;
- }
-
- public void uninstallUI(final JComponent component)
- {
- super.uninstallUI(component);
- rootView.setView(null);
-
- textComponent.removePropertyChangeListener(updateHandler);
-
- uninstallDefaults();
- uninstallListeners();
- uninstallKeyboardActions();
-
- textComponent = null;
- }
-
- protected void uninstallDefaults()
- {
- // Do nothing here.
- }
-
- protected void uninstallListeners()
- {
- textComponent.removeFocusListener(focuslistener);
- }
-
- protected void uninstallKeyboardActions()
- {
- // Do nothing here.
- }
-
- protected abstract String getPropertyPrefix();
-
- public Dimension getPreferredSize(JComponent c)
- {
- View v = getRootView(textComponent);
-
- float w = v.getPreferredSpan(View.X_AXIS);
- float h = v.getPreferredSpan(View.Y_AXIS);
-
- return new Dimension((int) w, (int) h);
- }
-
- public final void paint(Graphics g, JComponent c)
- {
- paintSafely(g);
- }
-
- protected void paintSafely(Graphics g)
- {
- Caret caret = textComponent.getCaret();
- Highlighter highlighter = textComponent.getHighlighter();
-
- if (textComponent.isOpaque())
- paintBackground(g);
-
- if (highlighter != null
- && textComponent.getSelectionStart() != textComponent.getSelectionEnd())
- highlighter.paint(g);
-
- rootView.paint(g, getVisibleEditorRect());
-
- if (caret != null && textComponent.hasFocus())
- caret.paint(g);
- }
-
- protected void paintBackground(Graphics g)
- {
- g.setColor(textComponent.getBackground());
- g.fillRect(0, 0, textComponent.getWidth(), textComponent.getHeight());
- }
-
- public void damageRange(JTextComponent t, int p0, int p1)
- {
- damageRange(t, p0, p1, null, null);
- }
-
- public void damageRange(JTextComponent t, int p0, int p1,
- Position.Bias firstBias, Position.Bias secondBias)
- {
- }
-
- public EditorKit getEditorKit(JTextComponent t)
- {
- return kit;
- }
-
- public int getNextVisualPositionFrom(JTextComponent t, int pos,
- Position.Bias b, int direction,
- Position.Bias[] biasRet)
- throws BadLocationException
- {
- return 0;
- }
-
- public View getRootView(JTextComponent t)
- {
- return rootView;
- }
-
- public Rectangle modelToView(JTextComponent t, int pos)
- throws BadLocationException
- {
- return modelToView(t, pos, Position.Bias.Forward);
- }
-
- public Rectangle modelToView(JTextComponent t, int pos, Position.Bias bias)
- throws BadLocationException
- {
- return rootView.modelToView(pos, getVisibleEditorRect(), bias).getBounds();
- }
-
- public int viewToModel(JTextComponent t, Point pt)
- {
- return viewToModel(t, pt, null);
- }
-
- public int viewToModel(JTextComponent t, Point pt, Position.Bias[] biasReturn)
- {
- return 0;
- }
-
- public View create(Element elem)
- {
- // Subclasses have to implement this to get this functionality.
- return null;
- }
-
- public View create(Element elem, int p0, int p1)
- {
- // Subclasses have to implement this to get this functionality.
- return null;
- }
-
- protected Rectangle getVisibleEditorRect()
- {
- int width = textComponent.getWidth();
- int height = textComponent.getHeight();
-
- if (width <= 0 || height <= 0)
- return null;
-
- Insets insets = textComponent.getInsets();
- return new Rectangle(insets.left, insets.top,
- width - insets.left + insets.right,
- height - insets.top + insets.bottom);
- }
-
- protected final void setView(View view)
- {
- rootView.setView(view);
- view.setParent(rootView);
- }
-
- protected void modelChanged()
- {
- if (textComponent == null || rootView == null)
- return;
- ViewFactory factory = rootView.getViewFactory();
- if (factory == null)
- return;
- Document doc = textComponent.getDocument();
- if (doc == null)
- return;
- Element elem = doc.getDefaultRootElement();
- if (elem == null)
- return;
- setView(factory.create(elem));
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicToggleButtonUI.java b/libjava/javax/swing/plaf/basic/BasicToggleButtonUI.java
deleted file mode 100644
index 84509ad6efd..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicToggleButtonUI.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* BasicToggleButtonUI.java
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-
-public class BasicToggleButtonUI extends BasicButtonUI
-{
- public static ComponentUI createUI(final JComponent component)
- {
- return new BasicToggleButtonUI();
- }
-
- /**
- * Returns the prefix for the UI defaults property for this UI class.
- * This is &apos;ToggleButton&apos; for this class.
- *
- * @return the prefix for the UI defaults property
- */
- protected String getPropertyPrefix()
- {
- return "ToggleButton";
- }
-}
-
diff --git a/libjava/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java b/libjava/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java
deleted file mode 100644
index db29fdca583..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/* BasicToolBarSeparatorUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Dimension;
-import java.awt.Graphics;
-
-import javax.swing.JComponent;
-import javax.swing.JSeparator;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-
-/**
- * The Basic Look and Feel UI delegate for Separator.
- */
-public class BasicToolBarSeparatorUI extends BasicSeparatorUI
-{
- private transient Dimension size;
-
- /**
- * Creates a new UI delegate for the given JComponent.
- *
- * @param c The JComponent to create a delegate for.
- *
- * @return A new BasicToolBarSeparatorUI.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicToolBarSeparatorUI();
- }
-
- /**
- * This method installs the defaults that are given by the Basic L&F.
- *
- * @param s The Separator that is being installed.
- */
- protected void installDefaults(JSeparator s)
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- size = defaults.getDimension("ToolBar.separatorSize");
- }
-
- /**
- * This method does nothing as a Separator is just blank space.
- *
- * @param g The Graphics object to paint with
- * @param c The JComponent to paint.
- */
- public void paint(Graphics g, JComponent c)
- {
- // Do nothing.
- }
-
- /**
- * This method returns the preferred size of the JComponent.
- *
- * @param c The JComponent to measure.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- return size;
- }
-
- /**
- * This method returns the minimum size of the JComponent.
- *
- * @param c The JComponent to measure.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return size;
- }
-
- /**
- * This method returns the maximum size of the JComponent.
- *
- * @param c The JComponent to measure.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return size;
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicToolBarUI.java b/libjava/javax/swing/plaf/basic/BasicToolBarUI.java
deleted file mode 100644
index bc655a2742d..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicToolBarUI.java
+++ /dev/null
@@ -1,1435 +0,0 @@
-/* BasicToolBarUI.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.Window;
-import java.awt.event.ContainerEvent;
-import java.awt.event.ContainerListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Hashtable;
-
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JDialog;
-import javax.swing.JFrame;
-import javax.swing.JToolBar;
-import javax.swing.RootPaneContainer;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import javax.swing.event.MouseInputListener;
-import javax.swing.plaf.BorderUIResource.EtchedBorderUIResource;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.ToolBarUI;
-import javax.swing.plaf.UIResource;
-
-/**
- * This is the Basic Look and Feel UI class for JToolBar.
- */
-public class BasicToolBarUI extends ToolBarUI implements SwingConstants
-{
- /** Static owner of all DragWindows.
- * This is package-private to avoid an accessor method. */
- static JFrame owner = new JFrame();
-
- /** The border used when the JToolBar is in nonrollover mode. */
- private static Border nonRolloverBorder;
-
- /** The border used when the JToolBar is in rollover mode. */
- private static Border rolloverBorder;
-
- /** The last known BorderLayout constraint before floating. */
- protected String constraintBeforeFloating;
-
- /** The last known orientation of the JToolBar before floating.
- * This is package-private to avoid an accessor method. */
- int lastGoodOrientation;
-
- /** The color of the border when it is dockable. */
- protected Color dockingBorderColor;
-
- /** The background color of the JToolBar when it is dockable. */
- protected Color dockingColor;
-
- /** The docking listener responsible for mouse events on the JToolBar. */
- protected MouseInputListener dockingListener;
-
- /** The window used for dragging the JToolBar. */
- protected BasicToolBarUI.DragWindow dragWindow;
-
- /** The color of the border when it is not dockable. */
- protected Color floatingBorderColor;
-
- /** The background color of the JToolBar when it is not dockable. */
- protected Color floatingColor;
-
- /** The index of the focused component. */
- protected int focusedCompIndex;
-
- /** The PropertyChangeListener for the JToolBar. */
- protected PropertyChangeListener propertyListener;
-
- /** The JToolBar this UI delegate is responsible for. */
- protected JToolBar toolBar;
-
- /** The Container listener for the JToolBar. */
- protected ContainerListener toolBarContListener;
-
- /** The Focus listener for the JToolBar. */
- protected FocusListener toolBarFocusListener;
-
- /**
- * The floating window that is responsible for holding the JToolBar when it
- * is dragged outside of its original parent.
- */
- private transient Window floatFrame;
-
- /** The original parent of the JToolBar.
- * This is package-private to avoid an accessor method. */
- transient Container origParent;
-
- /** A hashtable of components and their original borders.
- * This is package-private to avoid an accessor method. */
- transient Hashtable borders;
-
- /** A window listener for the floatable frame. */
- private transient WindowListener windowListener;
-
- /** A set of cached bounds of the JToolBar.
- * This is package-private to avoid an accessor method. */
- transient Dimension cachedBounds;
-
- /** The cached orientation of the JToolBar.
- * This is package-private to avoid an accessor method. */
- transient int cachedOrientation;
-
- /**
- * This method creates a new <code>BasicToolBarUI</code> object for the given JToolBar.
- */
- public BasicToolBarUI()
- {
- // Do nothing here.
- }
-
- /**
- * This method returns whether the JToolBar can dock at the given position.
- *
- * @param c The component to try to dock in.
- * @param p The position of the mouse cursor relative to the given
- * component.
- *
- * @return Whether the JToolBar can dock.
- */
- public boolean canDock(Component c, Point p)
- {
- return areaOfClick(c, p) != -1;
- }
-
- /**
- * This helper method returns the position of the JToolBar if it can dock.
- *
- * @param c The component to try to dock in.
- * @param p The position of the mouse cursor relative to the given
- * component.
- *
- * @return One of the SwingConstants directions or -1 if the JToolBar can't
- * dock.
- */
- private int areaOfClick(Component c, Point p)
- {
- // Has to dock in immediate parent, not eventual root container.
- Rectangle pBounds = c.getBounds();
-
- // XXX: In Sun's implementation, the space the toolbar has to dock is dependent on the size it had last.
- Dimension d = toolBar.getSize();
- int limit = Math.min(d.width, d.height);
-
- // The order of checking is 1. top 2. bottom 3. left 4. right
- if (! pBounds.contains(p))
- return -1;
-
- if (p.y < limit)
- return SwingConstants.NORTH;
-
- if (p.y > (pBounds.height - limit))
- return SwingConstants.SOUTH;
-
- if (p.x < limit)
- return SwingConstants.WEST;
-
- if (p.x > (pBounds.width - limit))
- return SwingConstants.EAST;
-
- return -1;
- }
-
- /**
- * This method creates a new DockingListener for the JToolBar.
- *
- * @return A new DockingListener for the JToolBar.
- */
- protected MouseInputListener createDockingListener()
- {
- return new DockingListener(toolBar);
- }
-
- /**
- * This method creates a new DragWindow for the given JToolBar.
- *
- * @param toolbar The JToolBar to create a DragWindow for.
- *
- * @return A new DragWindow.
- */
- protected BasicToolBarUI.DragWindow createDragWindow(JToolBar toolbar)
- {
- return new DragWindow();
- }
-
- /**
- * This method creates a new floating frame for the JToolBar. By default,
- * this UI uses createFloatingWindow instead. This method of creating a
- * floating frame is deprecated.
- *
- * @param toolbar The JToolBar to create a floating frame for.
- *
- * @return A new floating frame.
- */
- protected JFrame createFloatingFrame(JToolBar toolbar)
- {
- // FIXME: Though deprecated, this should still work.
- return null;
- }
-
- /**
- * This method creates a new floating window for the JToolBar. This is the
- * method used by default to create a floating container for the JToolBar.
- *
- * @param toolbar The JToolBar to create a floating window for.
- *
- * @return A new floating window.
- */
- protected RootPaneContainer createFloatingWindow(JToolBar toolbar)
- {
- // This one is used by default though.
- return new ToolBarDialog();
- }
-
- /**
- * This method creates a new WindowListener for the JToolBar.
- *
- * @return A new WindowListener.
- */
- protected WindowListener createFrameListener()
- {
- return new FrameListener();
- }
-
- /**
- * This method creates a new nonRolloverBorder for JButtons when the
- * JToolBar's rollover property is set to false.
- *
- * @return A new NonRolloverBorder.
- */
- protected Border createNonRolloverBorder()
- {
- return new EtchedBorderUIResource();
- }
-
- /**
- * This method creates a new PropertyChangeListener for the JToolBar.
- *
- * @return A new PropertyChangeListener.
- */
- protected PropertyChangeListener createPropertyListener()
- {
- return new PropertyListener();
- }
-
- /**
- * This method creates a new rollover border for JButtons when the
- * JToolBar's rollover property is set to true.
- *
- * @return A new rollover border.
- */
- protected Border createRolloverBorder()
- {
- return new EtchedBorderUIResource()
- {
- public void paintBorder(Component c, Graphics g, int x, int y,
- int width, int height)
- {
- if (c instanceof JButton)
- {
- if (((JButton) c).getModel().isRollover())
- super.paintBorder(c, g, x, y, width, height);
- }
- }
- };
- }
-
- /**
- * This method creates a new Container listener for the JToolBar.
- *
- * @return A new Container listener.
- */
- protected ContainerListener createToolBarContListener()
- {
- return new ToolBarContListener();
- }
-
- /**
- * This method creates a new FocusListener for the JToolBar.
- *
- * @return A new FocusListener for the JToolBar.
- */
- protected FocusListener createToolBarFocusListener()
- {
- return new ToolBarFocusListener();
- }
-
- /**
- * This method creates a new UI delegate for the given JComponent.
- *
- * @param c The JComponent to create a UI delegate for.
- *
- * @return A new UI delegate.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicToolBarUI();
- }
-
- /**
- * This method is called to drag the DragWindow around when the JToolBar is
- * being dragged around.
- *
- * @param position The mouse cursor coordinates relative to the JToolBar.
- * @param origin The screen position of the JToolBar.
- */
- protected void dragTo(Point position, Point origin)
- {
- int loc = areaOfClick(origParent,
- SwingUtilities.convertPoint(toolBar, position,
- origParent));
-
- if (loc != -1)
- {
- dragWindow.setBorderColor(dockingBorderColor);
- dragWindow.setBackground(dockingColor);
- }
- else
- {
- dragWindow.setBorderColor(floatingBorderColor);
- dragWindow.setBackground(floatingColor);
- }
-
- int w = 0;
- int h = 0;
-
- boolean tmp = ((loc == SwingConstants.NORTH)
- || (loc == SwingConstants.SOUTH) || (loc == -1));
-
- if (((cachedOrientation == SwingConstants.HORIZONTAL) && tmp)
- || ((cachedOrientation == VERTICAL) && ! tmp))
- {
- w = cachedBounds.width;
- h = cachedBounds.height;
- }
- else
- {
- w = cachedBounds.height;
- h = cachedBounds.width;
- }
-
- Point p = dragWindow.getOffset();
- Insets insets = toolBar.getInsets();
-
- dragWindow.setBounds((origin.x + position.x) - p.x
- - ((insets.left + insets.right) / 2),
- (origin.y + position.y) - p.y
- - ((insets.top + insets.bottom) / 2), w, h);
-
- if (! dragWindow.isVisible())
- dragWindow.show();
- }
-
- /**
- * This method is used at the end of a drag session to place the frame in
- * either its original parent as a docked JToolBar or in its floating
- * frame.
- *
- * @param position The position of the mouse cursor relative to the
- * JToolBar.
- * @param origin The screen position of the JToolBar before the drag session
- * started.
- */
- protected void floatAt(Point position, Point origin)
- {
- Point p = new Point(position);
- int aoc = areaOfClick(origParent,
- SwingUtilities.convertPoint(toolBar, p, origParent));
-
- Container oldParent = toolBar.getParent();
-
- oldParent.remove(toolBar);
- oldParent.doLayout();
- oldParent.repaint();
-
- Container newParent;
-
- if (aoc == -1)
- newParent = ((RootPaneContainer) floatFrame).getContentPane();
- else
- {
- floatFrame.hide();
- newParent = origParent;
- }
-
- String constraint;
- switch (aoc)
- {
- case SwingConstants.EAST:
- constraint = BorderLayout.EAST;
- break;
- case SwingConstants.NORTH:
- constraint = BorderLayout.NORTH;
- break;
- case SwingConstants.SOUTH:
- constraint = BorderLayout.SOUTH;
- break;
- case SwingConstants.WEST:
- constraint = BorderLayout.WEST;
- break;
- default:
- constraint = BorderLayout.CENTER;
- break;
- }
-
- int newOrientation = SwingConstants.HORIZONTAL;
- if ((aoc != -1)
- && ((aoc == SwingConstants.EAST) || (aoc == SwingConstants.WEST)))
- newOrientation = SwingConstants.VERTICAL;
-
- if (aoc != -1)
- {
- constraintBeforeFloating = constraint;
- lastGoodOrientation = newOrientation;
- }
-
- newParent.add(toolBar, constraint);
-
- setFloating(aoc == -1, null);
- toolBar.setOrientation(newOrientation);
-
- Insets insets = floatFrame.getInsets();
- Dimension dims = toolBar.getPreferredSize();
- p = dragWindow.getOffset();
- setFloatingLocation((position.x + origin.x) - p.x
- - ((insets.left + insets.right) / 2),
- (position.y + origin.y) - p.y
- - ((insets.top + insets.bottom) / 2));
-
- if (aoc == -1)
- {
- floatFrame.pack();
- floatFrame.setSize(dims.width + insets.left + insets.right,
- dims.height + insets.top + insets.bottom);
- floatFrame.show();
- }
-
- newParent.invalidate();
- newParent.validate();
- newParent.repaint();
- }
-
- /**
- * This method returns the docking color.
- *
- * @return The docking color.
- */
- public Color getDockingColor()
- {
- return dockingColor;
- }
-
- /**
- * This method returns the Color which is displayed when over a floating
- * area.
- *
- * @return The color which is displayed when over a floating area.
- */
- public Color getFloatingColor()
- {
- return floatingColor;
- }
-
- /**
- * This method returns the maximum size of the given JComponent for this UI.
- *
- * @param c The JComponent to find the maximum size for.
- *
- * @return The maximum size for this UI.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the minimum size of the given JComponent for this UI.
- *
- * @param c The JComponent to find a minimum size for.
- *
- * @return The minimum size for this UI.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the preferred size of the given JComponent for this
- * UI.
- *
- * @param c The JComponent to find a preferred size for.
- *
- * @return The preferred size for this UI.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- return toolBar.getLayout().preferredLayoutSize(c);
- }
-
- /**
- * This method installs the needed components for the JToolBar.
- */
- protected void installComponents()
- {
- floatFrame = (Window) createFloatingWindow(toolBar);
-
- dragWindow = createDragWindow(toolBar);
-
- cachedBounds = toolBar.getPreferredSize();
- cachedOrientation = toolBar.getOrientation();
-
- nonRolloverBorder = createNonRolloverBorder();
- rolloverBorder = createRolloverBorder();
-
- borders = new Hashtable();
-
- fillHashtable();
- }
-
- /**
- * This method installs the defaults as specified by the look and feel.
- */
- protected void installDefaults()
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- toolBar.setBorder(new ToolBarBorder());
- toolBar.setBackground(defaults.getColor("ToolBar.background"));
- toolBar.setForeground(defaults.getColor("ToolBar.foreground"));
- toolBar.setFont(defaults.getFont("ToolBar.font"));
-
- dockingBorderColor = defaults.getColor("ToolBar.dockingForeground");
- dockingColor = defaults.getColor("ToolBar.dockingBackground");
-
- floatingBorderColor = defaults.getColor("ToolBar.floatingForeground");
- floatingColor = defaults.getColor("ToolBar.floatingBackground");
- }
-
- /**
- * This method installs the keyboard actions for the JToolBar as specified
- * by the look and feel.
- */
- protected void installKeyboardActions()
- {
- // FIXME: implement.
- }
-
- /**
- * This method installs listeners for the JToolBar.
- *
- * @param toolbar The JToolBar to register listeners for.
- */
- protected void installListeners(JToolBar toolbar)
- {
- dockingListener = createDockingListener();
- toolBar.addMouseListener(dockingListener);
- toolBar.addMouseMotionListener(dockingListener);
-
- propertyListener = createPropertyListener();
- toolBar.addPropertyChangeListener(propertyListener);
-
- toolBarContListener = createToolBarContListener();
- toolBar.addContainerListener(toolBarContListener);
-
- windowListener = createFrameListener();
- floatFrame.addWindowListener(windowListener);
-
- toolBarFocusListener = createToolBarFocusListener();
- toolBar.addFocusListener(toolBarFocusListener);
- }
-
- /**
- * This method installs non rollover borders for each component inside the
- * given JComponent.
- *
- * @param c The JComponent whose children need to have non rollover borders
- * installed.
- */
- protected void installNonRolloverBorders(JComponent c)
- {
- Component[] components = toolBar.getComponents();
-
- for (int i = 0; i < components.length; i++)
- setBorderToNonRollover(components[i]);
- }
-
- /**
- * This method installs normal (or their original) borders for each
- * component inside the given JComponent.
- *
- * @param c The JComponent whose children need to have their original
- * borders installed.
- */
- protected void installNormalBorders(JComponent c)
- {
- Component[] components = toolBar.getComponents();
-
- for (int i = 0; i < components.length; i++)
- setBorderToNormal(components[i]);
- }
-
- /**
- * This method install rollover borders for each component inside the given
- * JComponent.
- *
- * @param c The JComponent whose children need to have rollover borders
- * installed.
- */
- protected void installRolloverBorders(JComponent c)
- {
- Component[] components = toolBar.getComponents();
-
- for (int i = 0; i < components.length; i++)
- setBorderToRollover(components[i]);
- }
-
- /**
- * This method fills the borders hashtable with a list of components that
- * are JButtons and their borders.
- */
- private void fillHashtable()
- {
- Component[] c = toolBar.getComponents();
-
- for (int i = 0; i < c.length; i++)
- {
- if (c[i] instanceof JButton)
- {
- // Don't really care about anything other than JButtons
- JButton b = (JButton) c[i];
-
- if (b.getBorder() != null)
- borders.put(b, b.getBorder());
- }
- }
- }
-
- /**
- * This method installs the UI for the given JComponent.
- *
- * @param c The JComponent to install a UI for.
- */
- public void installUI(JComponent c)
- {
- super.installUI(c);
-
- if (c instanceof JToolBar)
- {
- toolBar = (JToolBar) c;
- toolBar.setOpaque(true);
- installDefaults();
- installComponents();
- installListeners(toolBar);
- installKeyboardActions();
- }
- }
-
- /**
- * This method returns whether the JToolBar is floating.
- *
- * @return Whether the JToolBar is floating.
- */
- public boolean isFloating()
- {
- return floatFrame.isVisible();
- }
-
- /**
- * This method returns whether rollover borders have been set.
- *
- * @return Whether rollover borders have been set.
- */
- public boolean isRolloverBorders()
- {
- return toolBar.isRollover();
- }
-
- /**
- * This method navigates in the given direction giving focus to the next
- * component in the given direction.
- *
- * @param direction The direction to give focus to.
- */
- protected void navigateFocusedComp(int direction)
- {
- // FIXME: Implement.
- }
-
- /**
- * This method sets the border of the given component to a non rollover
- * border.
- *
- * @param c The Component whose border needs to be set.
- */
- protected void setBorderToNonRollover(Component c)
- {
- if (c instanceof JButton)
- {
- JButton b = (JButton) c;
- b.setRolloverEnabled(false);
- b.setBorder(nonRolloverBorder);
- }
- }
-
- /**
- * This method sets the border of the given component to its original value.
- *
- * @param c The Component whose border needs to be set.
- */
- protected void setBorderToNormal(Component c)
- {
- if (c instanceof JButton)
- {
- JButton b = (JButton) c;
- Border border = (Border) borders.get(b);
- b.setBorder(border);
- }
- }
-
- /**
- * This method sets the border of the given component to a rollover border.
- *
- * @param c The Component whose border needs to be set.
- */
- protected void setBorderToRollover(Component c)
- {
- if (c instanceof JButton)
- {
- JButton b = (JButton) c;
- b.setRolloverEnabled(true);
- b.setBorder(rolloverBorder);
- }
- }
-
- /**
- * This method sets the docking color.
- *
- * @param c The docking color.
- */
- public void setDockingColor(Color c)
- {
- dockingColor = c;
- }
-
- /**
- * This method sets the floating property for the JToolBar.
- *
- * @param b Whether the JToolBar is floating.
- * @param p FIXME
- */
- public void setFloating(boolean b, Point p)
- {
- // FIXME: use p for something. It's not location
- // since we already have setFloatingLocation.
- floatFrame.setVisible(b);
- }
-
- /**
- * This method sets the color displayed when the JToolBar is not in a
- * dockable area.
- *
- * @param c The floating color.
- */
- public void setFloatingColor(Color c)
- {
- floatingColor = c;
- }
-
- /**
- * This method sets the floating location of the JToolBar.
- *
- * @param x The x coordinate for the floating frame.
- * @param y The y coordinate for the floating frame.
- */
- public void setFloatingLocation(int x, int y)
- {
- // x,y are the coordinates of the new JFrame created to store the toolbar
- // XXX: The floating location is bogus is not floating.
- floatFrame.setLocation(x, y);
- floatFrame.invalidate();
- floatFrame.validate();
- floatFrame.repaint();
- }
-
- /**
- * This is a convenience method for changing the orientation of the
- * JToolBar.
- *
- * @param orientation The new orientation.
- */
- public void setOrientation(int orientation)
- {
- toolBar.setOrientation(orientation);
- }
-
- /**
- * This method changes the child components to have rollover borders if the
- * given parameter is true. Otherwise, the components are set to have non
- * rollover borders.
- *
- * @param rollover Whether the children will have rollover borders.
- */
- public void setRolloverBorders(boolean rollover)
- {
- if (rollover)
- installRolloverBorders(toolBar);
- else
- installNonRolloverBorders(toolBar);
- }
-
- /**
- * This method uninstall UI installed components from the JToolBar.
- */
- protected void uninstallComponents()
- {
- installNormalBorders(toolBar);
- borders = null;
- rolloverBorder = null;
- nonRolloverBorder = null;
- cachedBounds = null;
-
- floatFrame = null;
- dragWindow = null;
- }
-
- /**
- * This method removes the defaults installed by the Look and Feel.
- */
- protected void uninstallDefaults()
- {
- toolBar.setBackground(null);
- toolBar.setForeground(null);
- toolBar.setFont(null);
-
- dockingBorderColor = null;
- dockingColor = null;
- floatingBorderColor = null;
- floatingColor = null;
- }
-
- /**
- * This method uninstalls keyboard actions installed by the UI.
- */
- protected void uninstallKeyboardActions()
- {
- // FIXME: implement.
- }
-
- /**
- * This method uninstalls listeners installed by the UI.
- */
- protected void uninstallListeners()
- {
- toolBar.removeFocusListener(toolBarFocusListener);
- toolBarFocusListener = null;
-
- floatFrame.removeWindowListener(windowListener);
- windowListener = null;
-
- toolBar.removeContainerListener(toolBarContListener);
- toolBarContListener = null;
-
- toolBar.removeMouseMotionListener(dockingListener);
- toolBar.removeMouseListener(dockingListener);
- dockingListener = null;
- }
-
- /**
- * This method uninstalls the UI.
- *
- * @param c The JComponent that is having this UI removed.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallKeyboardActions();
- uninstallListeners();
- uninstallComponents();
- uninstallDefaults();
- toolBar = null;
- }
-
- /**
- * This is the MouseHandler class that allows the user to drag the JToolBar
- * in and out of the parent and dock it if it can.
- */
- public class DockingListener implements MouseInputListener
- {
- /** Whether the JToolBar is being dragged. */
- protected boolean isDragging;
-
- /**
- * The origin point. This point is saved from the beginning press and is
- * used until the end of the drag session.
- */
- protected Point origin;
-
- /** The JToolBar being dragged. */
- protected JToolBar toolBar;
-
- /**
- * Creates a new DockingListener object.
- *
- * @param t The JToolBar this DockingListener is being used for.
- */
- public DockingListener(JToolBar t)
- {
- toolBar = t;
- }
-
- /**
- * This method is called when the mouse is clicked.
- *
- * @param e The MouseEvent.
- */
- public void mouseClicked(MouseEvent e)
- {
- // Don't care.
- }
-
- /**
- * This method is called when the mouse is dragged. It delegates the drag
- * painting to the dragTo method.
- *
- * @param e The MouseEvent.
- */
- public void mouseDragged(MouseEvent e)
- {
- if (isDragging)
- dragTo(e.getPoint(), origin);
- }
-
- /**
- * This method is called when the mouse enters the JToolBar.
- *
- * @param e The MouseEvent.
- */
- public void mouseEntered(MouseEvent e)
- {
- // Don't care (yet).
- }
-
- /**
- * This method is called when the mouse exits the JToolBar.
- *
- * @param e The MouseEvent.
- */
- public void mouseExited(MouseEvent e)
- {
- // Don't care (yet).
- }
-
- /**
- * This method is called when the mouse is moved in the JToolBar.
- *
- * @param e The MouseEvent.
- */
- public void mouseMoved(MouseEvent e)
- {
- }
-
- /**
- * This method is called when the mouse is pressed in the JToolBar. If the
- * press doesn't occur in a place where it causes the JToolBar to be
- * dragged, it returns. Otherwise, it starts a drag session.
- *
- * @param e The MouseEvent.
- */
- public void mousePressed(MouseEvent e)
- {
- if (! toolBar.isFloatable())
- return;
-
- Point ssd = e.getPoint();
- Insets insets = toolBar.getInsets();
-
- // Verify that this click occurs in the top inset.
- if (toolBar.getOrientation() == SwingConstants.HORIZONTAL)
- {
- if (e.getX() > insets.left)
- return;
- }
- else
- {
- if (e.getY() > insets.top)
- return;
- }
-
- origin = new Point(0, 0);
- SwingUtilities.convertPointToScreen(ssd, toolBar);
-
- if (! (SwingUtilities.getAncestorOfClass(Window.class, toolBar) instanceof UIResource))
- // Need to know who keeps the toolBar if it gets dragged back into it.
- origParent = toolBar.getParent();
-
- SwingUtilities.convertPointToScreen(origin, toolBar);
-
- isDragging = true;
-
- if (dragWindow != null)
- dragWindow.setOffset(new Point(e.getX(), e.getY()));
-
- dragTo(e.getPoint(), origin);
- }
-
- /**
- * This method is called when the mouse is released from the JToolBar.
- *
- * @param e The MouseEvent.
- */
- public void mouseReleased(MouseEvent e)
- {
- if (! isDragging || ! toolBar.isFloatable())
- return;
-
- isDragging = false;
- floatAt(e.getPoint(), origin);
- dragWindow.hide();
- }
- }
-
- /**
- * This is the window that appears when the JToolBar is being dragged
- * around.
- */
- protected class DragWindow extends Window
- {
- /**
- * The current border color. It changes depending on whether the JToolBar
- * is over a place that allows it to dock.
- */
- private Color borderColor;
-
- /** The between the mouse and the top left corner of the window. */
- private Point offset;
-
- /**
- * Creates a new DragWindow object.
- * This is package-private to avoid an accessor method.
- */
- DragWindow()
- {
- super(owner);
- }
-
- /**
- * The color that the border should be.
- *
- * @return The border color.
- */
- public Color getBorderColor()
- {
- if (borderColor == null)
- return Color.BLACK;
-
- return borderColor;
- }
-
- /**
- * This method returns the insets for the DragWindow.
- *
- * @return The insets for the DragWindow.
- */
- public Insets getInsets()
- {
- // This window has no decorations, so insets are empty.
- return new Insets(0, 0, 0, 0);
- }
-
- /**
- * This method returns the mouse offset from the top left corner of the
- * DragWindow.
- *
- * @return The mouse offset.
- */
- public Point getOffset()
- {
- return offset;
- }
-
- /**
- * This method paints the DragWindow.
- *
- * @param g The Graphics object to paint with.
- */
- public void paint(Graphics g)
- {
- // No visiting children necessary.
- Color saved = g.getColor();
- Rectangle b = getBounds();
-
- g.setColor(getBorderColor());
- g.drawRect(0, 0, b.width - 1, b.height - 1);
-
- g.setColor(saved);
- }
-
- /**
- * This method changes the border color.
- *
- * @param c The new border color.
- */
- public void setBorderColor(Color c)
- {
- borderColor = c;
- }
-
- /**
- * This method changes the mouse offset.
- *
- * @param p The new mouse offset.
- */
- public void setOffset(Point p)
- {
- offset = p;
- }
-
- /**
- * FIXME: Do something.
- *
- * @param o DOCUMENT ME!
- */
- public void setOrientation(int o)
- {
- // FIXME: implement.
- }
- }
-
- /**
- * This helper class listens for Window events from the floatable window and
- * if it is closed, returns the JToolBar to the last known good location.
- */
- protected class FrameListener extends WindowAdapter
- {
- /**
- * This method is called when the floating window is closed.
- *
- * @param e The WindowEvent.
- */
- public void windowClosing(WindowEvent e)
- {
- Container parent = toolBar.getParent();
- parent.remove(toolBar);
-
- if (origParent != null)
- {
- origParent.add(toolBar,
- (constraintBeforeFloating != null)
- ? constraintBeforeFloating : BorderLayout.NORTH);
- toolBar.setOrientation(lastGoodOrientation);
- }
-
- origParent.invalidate();
- origParent.validate();
- origParent.repaint();
- }
- }
-
- /**
- * This helper class listens for PropertyChangeEvents from the JToolBar.
- */
- protected class PropertyListener implements PropertyChangeListener
- {
- /**
- * This method is called when a property from the JToolBar is changed.
- *
- * @param e The PropertyChangeEvent.
- */
- public void propertyChange(PropertyChangeEvent e)
- {
- // FIXME: need name properties so can change floatFrame title.
- if (e.getPropertyName().equals("rollover"))
- setRolloverBorders(toolBar.isRollover());
- }
- }
-
- /**
- * This helper class listens for components added to and removed from the
- * JToolBar.
- */
- protected class ToolBarContListener implements ContainerListener
- {
- /**
- * This method is responsible for setting rollover or non rollover for new
- * buttons added to the JToolBar.
- *
- * @param e The ContainerEvent.
- */
- public void componentAdded(ContainerEvent e)
- {
- if (e.getChild() instanceof JButton)
- {
- JButton b = (JButton) e.getChild();
-
- if (b.getBorder() != null)
- borders.put(b, b.getBorder());
- }
-
- if (isRolloverBorders())
- setBorderToRollover(e.getChild());
- else
- setBorderToNonRollover(e.getChild());
-
- cachedBounds = toolBar.getPreferredSize();
- cachedOrientation = toolBar.getOrientation();
- }
-
- /**
- * This method is responsible for giving the child components their
- * original borders when they are removed.
- *
- * @param e The ContainerEvent.
- */
- public void componentRemoved(ContainerEvent e)
- {
- setBorderToNormal(e.getChild());
- cachedBounds = toolBar.getPreferredSize();
- cachedOrientation = toolBar.getOrientation();
- }
- }
-
- /**
- * This is the floating window that is returned when getFloatingWindow is
- * called.
- */
- private class ToolBarDialog extends JDialog implements UIResource
- {
- /**
- * Creates a new ToolBarDialog object with the name given by the JToolBar.
- */
- public ToolBarDialog()
- {
- super();
- setName((toolBar.getName() != null) ? toolBar.getName() : "");
- }
- }
-
- /**
- * DOCUMENT ME!
- */
- protected class ToolBarFocusListener implements FocusListener
- {
- /**
- * Creates a new ToolBarFocusListener object.
- */
- protected ToolBarFocusListener()
- {
- // FIXME: implement.
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param e DOCUMENT ME!
- */
- public void focusGained(FocusEvent e)
- {
- // FIXME: implement.
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param e DOCUMENT ME!
- */
- public void focusLost(FocusEvent e)
- {
- // FIXME: implement.
- }
- }
-
- /**
- * This helper class acts as the border for the JToolBar.
- */
- private static class ToolBarBorder implements Border
- {
- /** The size of the larger, draggable side of the border. */
- private static final int offset = 10;
-
- /** The other sides. */
- private static final int regular = 2;
-
- /**
- * This method returns the border insets for the JToolBar.
- *
- * @param c The Component to find insets for.
- *
- * @return The border insets.
- */
- public Insets getBorderInsets(Component c)
- {
- if (c instanceof JToolBar)
- {
- JToolBar tb = (JToolBar) c;
- int orientation = tb.getOrientation();
-
- if (! tb.isFloatable())
- return new Insets(regular, regular, regular, regular);
- else if (orientation == SwingConstants.HORIZONTAL)
- return new Insets(regular, offset, regular, regular);
- else
- return new Insets(offset, regular, regular, regular);
- }
-
- return new Insets(0, 0, 0, 0);
- }
-
- /**
- * This method returns whether the border is opaque.
- *
- * @return Whether the border is opaque.
- */
- public boolean isBorderOpaque()
- {
- return false;
- }
-
- /**
- * This method paints the ribbed area of the border.
- *
- * @param g The Graphics object to paint with.
- * @param x The x coordinate of the area.
- * @param y The y coordinate of the area.
- * @param w The width of the area.
- * @param h The height of the area.
- * @param size The size of the bump.
- * @param c The color of the bumps.
- */
- private void paintBumps(Graphics g, int x, int y, int w, int h, int size,
- Color c)
- {
- Color saved = g.getColor();
- g.setColor(c);
-
- int hgap = 2 * size;
- int vgap = 4 * size;
- int count = 0;
-
- for (int i = x; i < (w + x); i += hgap)
- for (int j = ((count++ % 2) == 0) ? y : (y + (2 * size)); j < (h + y);
- j += vgap)
- g.fillRect(i, j, size, size);
-
- g.setColor(saved);
- }
-
- /**
- * This method paints the border around the given Component.
- *
- * @param c The Component whose border is being painted.
- * @param g The Graphics object to paint with.
- * @param x The x coordinate of the component.
- * @param y The y coordinate of the component.
- * @param width The width of the component.
- * @param height The height of the component.
- */
- public void paintBorder(Component c, Graphics g, int x, int y, int width,
- int height)
- {
- if (c instanceof JToolBar)
- {
- JToolBar tb = (JToolBar) c;
-
- int orientation = tb.getOrientation();
-
- if (orientation == SwingConstants.HORIZONTAL)
- {
- paintBumps(g, x, y, offset, height, 1, Color.WHITE);
- paintBumps(g, x + 1, y + 1, offset - 1, height - 1, 1, Color.GRAY);
- }
- else
- {
- paintBumps(g, x, y, width, offset, 1, Color.WHITE);
- paintBumps(g, x + 1, y + 1, width - 1, offset - 1, 1, Color.GRAY);
- }
- }
- }
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicToolTipUI.java b/libjava/javax/swing/plaf/basic/BasicToolTipUI.java
deleted file mode 100644
index 2ce7252253b..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicToolTipUI.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/* BasicToolTipUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
-
-import javax.swing.JComponent;
-import javax.swing.JToolTip;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.ToolTipUI;
-
-/**
- * This is the Basic Look and Feel UI class for JToolTip.
- */
-public class BasicToolTipUI extends ToolTipUI
-{
- /** The default Border around the JToolTip. */
- private static Border defaultBorder = new Border()
- {
- // FIXME: This needs to go into Basic Look and Feel
- // defaults.
-
- /**
- * This method returns the border insets.
- *
- * @param c The Component to find Border insets for.
- *
- * @return The Border insets.
- */
- public Insets getBorderInsets(Component c)
- {
- return new Insets(4, 4, 4, 4);
- }
-
- /**
- * This method returns whether the border is opaque.
- *
- * @return Whether the border is opaque.
- */
- public boolean isBorderOpaque()
- {
- return false;
- }
-
- /**
- * This method paints the border.
- *
- * @param c The Component to paint this border around.
- * @param g The Graphics object to paint with.
- * @param x The x coordinate to start painting at.
- * @param y The y coordinate to start painting at.
- * @param w The width of the Component.
- * @param y The height of the Component.
- */
- public void paintBorder(Component c, Graphics g, int x, int y, int w,
- int h)
- {
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- g.drawRect(0, 0, w - 1, h - 1);
-
- g.setColor(saved);
- }
- };
-
- /** The shared instance of BasicToolTipUI used for all ToolTips. */
- private static BasicToolTipUI shared;
-
- /**
- * Creates a new BasicToolTipUI object.
- */
- public BasicToolTipUI()
- {
- super();
- }
-
- /**
- * This method creates a new BasicToolTip UI for the given
- * JComponent.
- *
- * @param c The JComponent to create a UI for.
- *
- * @return A BasicToolTipUI that can be used by the given JComponent.
- */
- public static ComponentUI createUI(JComponent c)
- {
- if (shared == null)
- shared = new BasicToolTipUI();
- return shared;
- }
-
- /**
- * This method returns the msximum size of the given JComponent.
- *
- * @param c The JComponent to find a maximum size for.
- *
- * @return The maximum size.
- */
- public Dimension getMaximumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the minimum size of the given JComponent.
- *
- * @param c The JComponent to find a minimum size for.
- *
- * @return The minimum size.
- */
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
-
- /**
- * This method returns the preferred size of the given JComponent.
- *
- * @param c The JComponent to find a preferred size for.
- *
- * @return The preferred size.
- */
- public Dimension getPreferredSize(JComponent c)
- {
- JToolTip tip = (JToolTip) c;
- Rectangle vr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
- Insets insets = tip.getInsets();
- FontMetrics fm = tip.getToolkit().getFontMetrics(tip.getFont());
- SwingUtilities.layoutCompoundLabel(tip, fm, tip.getTipText(), null,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER, vr, ir, tr, 0);
- return new Dimension(insets.left + tr.width + insets.right,
- insets.top + tr.height + insets.bottom);
- }
-
- /**
- * This method installs the defaults for the given JComponent.
- *
- * @param c The JComponent to install defaults for.
- */
- protected void installDefaults(JComponent c)
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- c.setBackground(defaults.getColor("ToolTip.background"));
- c.setForeground(defaults.getColor("ToolTip.foreground"));
- c.setFont(defaults.getFont("ToolTip.font"));
- c.setBorder(defaultBorder);
- }
-
- /**
- * This method installs the listeners for the given JComponent.
- *
- * @param c The JComponent to install listeners for.
- */
- protected void installListeners(JComponent c)
- {
- }
-
- /**
- * This method installs the UI for the given JComponent.
- *
- * @param c The JComponent to install the UI for.
- */
- public void installUI(JComponent c)
- {
- c.setOpaque(true);
- installDefaults(c);
- installListeners(c);
- }
-
- /**
- * This method paints the given JComponent with the given Graphics object.
- *
- * @param g The Graphics object to paint with.
- * @param c The JComponent to paint.
- */
- public void paint(Graphics g, JComponent c)
- {
- JToolTip tip = (JToolTip) c;
-
- String text = tip.getTipText();
- if (text == null)
- return;
-
- Rectangle vr = new Rectangle();
- vr = SwingUtilities.calculateInnerArea(tip, vr);
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
- FontMetrics fm = tip.getToolkit().getFontMetrics(tip.getFont());
- SwingUtilities.layoutCompoundLabel(tip, fm, tip.getTipText(), null,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER, vr, ir, tr, 0);
-
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- g.drawString(text, vr.x, vr.y + fm.getAscent());
-
- g.setColor(saved);
- }
-
- /**
- * This method uninstalls the defaults for the given JComponent.
- *
- * @param c The JComponent to uninstall defaults for.
- */
- protected void uninstallDefaults(JComponent c)
- {
- c.setForeground(null);
- c.setBackground(null);
- c.setFont(null);
- c.setBorder(null);
- }
-
- /**
- * This method uninstalls listeners for the given JComponent.
- *
- * @param c The JComponent to uninstall listeners for.
- */
- protected void uninstallListeners(JComponent c)
- {
- }
-
- /**
- * This method uninstalls the UI for the given JComponent.
- *
- * @param c The JComponent to uninstall.
- */
- public void uninstallUI(JComponent c)
- {
- uninstallDefaults(c);
- uninstallListeners(c);
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicTreeUI.java b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
deleted file mode 100644
index fd18d2c01b6..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicTreeUI.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/* BasicTreeUI.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-
-import javax.swing.JComponent;
-import javax.swing.JTree;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.TreeUI;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreePath;
-
-/**
- * A delegate providing the user interface for <code>JTree</code>
- * according to the Basic look and feel. The current implementation
- * of GNU Classpath does really work; it is just a stub that allows
- * compiling the code.
- *
- * @see javax.swing.JTree
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class BasicTreeUI
- extends TreeUI
-{
-
- /**
- * Determines the geometric extent of the label that is
- * drawn for a path.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @param path the path whose label extent is requested.
- *
- * @return a rectangle enclosing the label, or <code>null</code>
- * if <code>path</code> contains invalid nodes.
- */
- public Rectangle getPathBounds(JTree tree, TreePath path)
- {
- return null; // FIXME: not implemented
- }
-
-
- /**
- * Creates a <code>TreePath</code> for the specified row.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @param row the index of the row, which should be a number
- * in the range <code>[0, getRowCount(tree) - 1]</code>.
- *
- * @return a <code>TreePath</code> for the specified row, or
- * <code>null</code> if <code>row</code> is outside
- * the valid range.
- */
- public TreePath getPathForRow(JTree tree, int row)
- {
- return null; // FIXME: not implemented
- }
-
-
- /**
- * Determines in which row a <code>TreePath</code> is currently
- * being displayed.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @param path the path for which the caller wants to know
- * in which row it is being displayed.
- *
- * @return a number in the range <code>[0, getRowCount(tree)
- * - 1]</code> if the path is currently on display;
- * <code>-1</code> if the path is not shown to the
- * user.
- */
- public int getRowForPath(JTree tree, TreePath path)
- {
- return -1; // FIXME: not implemented
- }
-
-
- /**
- * Counts how many rows are currently displayed.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @return the number of visible rows.
- */
- public int getRowCount(JTree tree)
- {
- return 0; // FIXME: not implemented
- }
-
-
- /**
- * Finds the path that is closest to the specified position.
- *
- * <p><img src="../doc-files/TreeUI-1.png" width="300" height="250"
- * alt="[A screen shot of a JTree]" />
- *
- * <p>As shown by the above illustration, the bounds of the
- * closest path do not necessarily need to contain the passed
- * location.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @param x the horizontal location, relative to the origin
- * of <code>tree</code>.
- *
- * @param y the vertical location, relative to the origin
- * of <code>tree</code>.
- *
- * @return the closest path, or <code>null</code> if the
- * tree is currenlty not displaying any paths at all.
- */
- public TreePath getClosestPathForLocation(JTree tree,
- int x, int y)
- {
- return null; // FIXME: not implemented
- }
-
-
- /**
- * Determines whether the user is currently editing a tree cell.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @see #getEditingPath
- */
- public boolean isEditing(JTree tree)
- {
- return false; // FIXME: not implemented
- }
-
-
- /**
- * Stops editing a tree cell, committing the entered value into the
- * tree&#x2019;s model. If no editing session is active, or if the
- * active editor does not agree to stopping, nothing happens. In
- * some look and feels, this action happens when the user has
- * pressed the enter key.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @return <code>false</code> if the editing still goes on because
- * the cell editor has objected to stopping the session;
- * <code>true</code> if editing has been stopped.
- */
- public boolean stopEditing(JTree tree)
- {
- return true; // FIXME: not implemented
- }
-
- /**
- * Cancels editing a tree cell, discarding any entered value.
- * If no editing session is active, nothing happens. The cell
- * editor is not given an opportunity to veto the canceling.
- * In some look and feels, this action happens when the user has
- * pressed the escape key.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- */
- public void cancelEditing(JTree tree)
- {
- // FIXME: not implemented
- }
-
-
- /**
- * Starts a session to edit a tree cell. If the cell editor
- * rejects editing the cell, it will just be selected.
- *
- * @param tree the <code>JTree</code> for which this delegate
- * object provides the user interface.
- *
- * @param path the cell to edit.
- */
- public void startEditingAtPath(JTree tree, TreePath path)
- {
- // FIXME: not implemented
- }
-
-
- /**
- * Retrieves the tree cell that is currently being edited.
- *
- * @return the currently edited path, or <code>null</code>
- * if no editing session is currently active.
- */
- public TreePath getEditingPath(JTree tree)
- {
- return null; // FIXME: not implemented
- }
-
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicTreeUI();
- }
-
- int rightChildIndent;
- int leftChildIndent;
- int rowHeight;
- Color hashColor;
-
- protected void installDefaults(JTree tree)
- {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- tree.setFont(defaults.getFont("Tree.font"));
- tree.setForeground(defaults.getColor("Tree.foreground"));
- tree.setBackground(defaults.getColor("Tree.background"));
- tree.setOpaque(true);
-
- hashColor = defaults.getColor("Tree.hash");
- rightChildIndent = defaults.getInt("Tree.rightChildIndent");
- leftChildIndent = defaults.getInt("Tree.leftChildIndent");
- rowHeight = defaults.getInt("Tree.rowHeight");
- }
-
- protected void installKeyboardActions()
- {
- }
-
- protected void installListeners()
- {
- }
-
- public void installUI(JComponent c)
- {
- installDefaults((JTree) c);
- }
-
-
- protected void uninstallDefaults(JTree tree)
- {
- tree.setFont(null);
- tree.setForeground(null);
- tree.setBackground(null);
-
- tree.setCellRenderer(null);
- }
-
- public void uninstallUI(JComponent c)
- {
- uninstallDefaults((JTree) c);
- }
-
- public Dimension getPreferredSize(JComponent c)
- {
- return new Dimension(200,200);
- }
-
- protected void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf)
- {
- Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree,
- leaf,
- false, // selected
- false, // expanded
- true, // leaf
- 0, // row
- false // hasFocus
- );
- g.translate(x, y);
- c.paint(g);
- g.translate(-x, -y);
- }
-
- protected void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf)
- {
- Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree,
- nonLeaf,
- false, // selected
- false, // expanded
- false, // leaf
- 0, // row
- false // hasFocus
- );
- g.translate(x, y);
- c.paint(g);
- g.translate(-x, -y);
- }
-
- protected int paintRecursive(Graphics g,
- int indentation,
- int descent,
- int childNumber,
- int depth,
- JTree tree,
- TreeModel mod,
- Object curr)
- {
- Rectangle clip = g.getClipBounds();
- if (indentation > clip.x + clip.width + rightChildIndent ||
- descent > clip.y + clip.height + rowHeight)
- return descent;
-
-
- int halfHeight = rowHeight / 2;
- int halfWidth = rightChildIndent / 2;
- int y0 = descent + halfHeight;
-
- if (mod.isLeaf(curr))
- {
- paintLeaf(g, indentation, descent, tree, curr);
- descent += rowHeight;
- }
- else
- {
- if (depth > 0 || tree.isRootVisible())
- {
- paintNonLeaf(g, indentation, descent, tree, curr);
- descent += rowHeight;
- y0 += halfHeight;
- }
- int max = mod.getChildCount(curr);
- for (int i = 0; i < max; ++i)
- {
- g.setColor(hashColor);
- g.drawLine(indentation + halfWidth, descent + halfHeight,
- indentation + rightChildIndent, descent + halfHeight);
- descent = paintRecursive(g,
- indentation + rightChildIndent, descent,
- i, depth+1,
- tree, mod, mod.getChild(curr, i));
- }
- }
-
- int y1 = descent - halfHeight;
- if (y0 != y1)
- {
- g.setColor(hashColor);
- g.drawLine(indentation + halfWidth, y0,
- indentation + halfWidth, y1);
- }
-
- return descent;
- }
-
- public void paint(Graphics g, JComponent c)
- {
- JTree tree = (JTree) c;
- TreeModel mod = tree.getModel();
- g.translate(10, 10);
- paintRecursive(g, 0, 0, 0, 0, tree, mod, mod.getRoot());
- g.translate(-10, -10);
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/BasicViewportUI.java b/libjava/javax/swing/plaf/basic/BasicViewportUI.java
deleted file mode 100644
index 5f9ba6c3b1e..00000000000
--- a/libjava/javax/swing/plaf/basic/BasicViewportUI.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/* BasicViewportUI.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Image;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.image.ImageObserver;
-
-import javax.swing.JComponent;
-import javax.swing.JViewport;
-import javax.swing.ViewportLayout;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.ViewportUI;
-
-public class BasicViewportUI extends ViewportUI
-{
-
- ChangeListener changeListener;
- Image backingStoreImage;
- int backingStoreWidth = -1;
- int backingStoreHeight = -1;
-
- class ChangeHandler implements ChangeListener
- {
- public void stateChanged(ChangeEvent event)
- {
- JViewport v = (JViewport) event.getSource();
- v.repaint();
- }
- }
-
- void installDefaults(JComponent c)
- {
- c.setOpaque(true);
- }
-
- void uninstallDefaults(JComponent c)
- {
- }
-
- void installListeners(JComponent c)
- {
- ((JViewport)c).addChangeListener(changeListener);
- }
-
- void uninstallListeners(JComponent c)
- {
- ((JViewport)c).removeChangeListener(changeListener);
- }
-
- public BasicViewportUI()
- {
- changeListener = new ChangeHandler();
- }
-
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicViewportUI();
- }
-
- public void installUI(JComponent c)
- {
- super.installUI(c);
- c.setLayout(new ViewportLayout());
- installListeners(c);
- }
-
- public void uninstallUI(JComponent c)
- {
- uninstallListeners(c);
- }
-
-
- public Dimension getPreferredSize(JComponent c)
- {
- // let the ViewportLayout decide
- return null;
- }
-
- public void paint(Graphics g, JComponent c)
- {
- JViewport port = (JViewport)c;
- Component view = port.getView();
-
- if (view == null)
- return;
-
- Point pos = port.getViewPosition();
- Rectangle viewBounds = view.getBounds();
- Rectangle portBounds = port.getBounds();
-
- if (viewBounds.width == 0
- || viewBounds.height == 0
- || portBounds.width == 0
- || portBounds.height == 0)
- return;
-
- switch (port.getScrollMode())
- {
-
- case JViewport.BACKINGSTORE_SCROLL_MODE:
- paintBackingStore(g, port, view, pos, viewBounds, portBounds);
- break;
-
- case JViewport.BLIT_SCROLL_MODE:
- // FIXME: implement separate blit mode
-
- case JViewport.SIMPLE_SCROLL_MODE:
- default:
- paintSimple(g, port, view, pos, viewBounds, portBounds);
- break;
- }
- }
-
- private void paintSimple(Graphics g,
- JViewport v,
- Component view,
- Point pos,
- Rectangle viewBounds,
- Rectangle portBounds)
- {
- Rectangle oldClip = g.getClipBounds ();
- g.setClip (oldClip.intersection (viewBounds));
- g.translate (-pos.x, -pos.y);
- try
- {
- view.paint(g);
- }
- finally
- {
- g.translate (pos.x, pos.y);
- g.setClip (oldClip);
- }
- }
-
- private void paintBackingStore(Graphics g,
- JViewport v,
- Component view,
- Point pos,
- Rectangle viewBounds,
- Rectangle portBounds)
- {
- if (backingStoreImage == null
- || backingStoreWidth != viewBounds.width
- || backingStoreHeight != viewBounds.height)
- {
- backingStoreImage = v.createImage(viewBounds.width, viewBounds.height);
- backingStoreWidth = viewBounds.width;
- backingStoreHeight = viewBounds.height;
- }
-
- Graphics g2 = backingStoreImage.getGraphics();
-
- if (v.getBackground() != null)
- {
- // fill the backing store background
- java.awt.Color save = g2.getColor();
- g2.setColor(v.getBackground());
- g2.fillRect (0, 0, backingStoreWidth, backingStoreHeight);
- g2.setColor(save);
-
- // fill the viewport background
- save = g.getColor();
- g.setColor(v.getBackground());
- g.fillRect (0, 0, portBounds.width, portBounds.height);
- g.setColor(save);
-
- }
- else
- {
- // clear the backing store background
- g2.clearRect(0, 0, backingStoreWidth, backingStoreHeight);
-
- // clear the viewport background
- g.clearRect(0, 0, portBounds.width, portBounds.height);
- }
-
- g2.setClip(g.getClipBounds());
- g2.translate(-pos.x, -pos.y);
- try
- {
- view.paint(g2);
- }
- finally
- {
- g2.translate(pos.x, pos.y);
- }
- g2 = null;
- g.drawImage(backingStoreImage,
- 0, 0,
- (ImageObserver)null);
- }
-}
diff --git a/libjava/javax/swing/plaf/basic/ComboPopup.java b/libjava/javax/swing/plaf/basic/ComboPopup.java
deleted file mode 100644
index 8bdcc51b0c0..00000000000
--- a/libjava/javax/swing/plaf/basic/ComboPopup.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* ComboPopup.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.basic;
-
-import java.awt.event.KeyListener;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-
-import javax.swing.JList;
-
-public interface ComboPopup
-{
- /**
- * This method display popup menu containing list of JComboBox's items to
- * the screen
- */
- void show();
-
- /**
- * This method hides popup menu with list of JComboBox's item from the
- * screen
- */
- void hide();
-
- /**
- * Retursn true if popup menu with JComboBOx's item is currently visible on
- * the screen and false otherwise
- *
- * @return true if JComboBox's popup menu with list of items is currently
- * visible on the screen and false otherwise.
- */
- boolean isVisible();
-
- /**
- * Return JList that is used to draw cells of the JComboBox.
- *
- * @return JList that is used to draw cells of the JcomboBox
- */
- JList getList();
-
- /**
- * This method returns MouseListener that listen's to mouse events occuring
- * in the combo box
- *
- * @return MouseListenere
- */
- MouseListener getMouseListener();
-
- /**
- * This method returns MouseListener that listen's to mouse events occuring
- * in the combo box.
- *
- * @return MouseMotionListener
- */
- MouseMotionListener getMouseMotionListener();
-
- /**
- * This method returns KeyListener that listen's to key events occuring in
- * the combo box.
- *
- * @return KeyListener
- */
- KeyListener getKeyListener();
-
- /* This method removes any listeners that were installed */
- void uninstallingUI();
-}
diff --git a/libjava/javax/swing/plaf/metal/DefaultMetalTheme.java b/libjava/javax/swing/plaf/metal/DefaultMetalTheme.java
deleted file mode 100644
index d5da720bfb6..00000000000
--- a/libjava/javax/swing/plaf/metal/DefaultMetalTheme.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/* DefaultMetalTheme.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import java.awt.Font;
-
-import javax.swing.plaf.ColorUIResource;
-import javax.swing.plaf.FontUIResource;
-
-public class DefaultMetalTheme extends MetalTheme
-{
- private static final ColorUIResource PRIMARY1 =
- new ColorUIResource(102, 102, 153);
- private static final ColorUIResource PRIMARY2 =
- new ColorUIResource(153, 153, 204);
- private static final ColorUIResource PRIMARY3 =
- new ColorUIResource(204, 204, 255);
- private static final ColorUIResource SECONDARY1 =
- new ColorUIResource(102, 102, 102);
- private static final ColorUIResource SECONDARY2 =
- new ColorUIResource(153, 153, 153);
- private static final ColorUIResource SECONDARY3 =
- new ColorUIResource(204, 204, 204);
-
- private static final FontUIResource CONTROL_TEXT_FONT =
- new FontUIResource("Dialog", Font.BOLD, 12);
- private static final FontUIResource MENU_TEXT_FONT =
- new FontUIResource("Dialog", Font.BOLD, 12);
- private static final FontUIResource SUB_TEXT_FONT =
- new FontUIResource("Dialog", Font.PLAIN, 10);
- private static final FontUIResource SYSTEM_TEXT_FONT =
- new FontUIResource("Dialog", Font.PLAIN, 12);
- private static final FontUIResource USER_TEXT_FONT =
- new FontUIResource("Dialog", Font.PLAIN, 12);
- private static final FontUIResource WINDOW_TITLE_FONT =
- new FontUIResource("Dialog", Font.BOLD, 12);
-
- public DefaultMetalTheme()
- {
- // Do nothing here.
- }
-
- public String getName()
- {
- return "Steel";
- }
-
- protected ColorUIResource getPrimary1()
- {
- return PRIMARY1;
- }
-
- protected ColorUIResource getPrimary2()
- {
- return PRIMARY2;
- }
-
- protected ColorUIResource getPrimary3()
- {
- return PRIMARY3;
- }
-
- protected ColorUIResource getSecondary1()
- {
- return SECONDARY1;
- }
-
- protected ColorUIResource getSecondary2()
- {
- return SECONDARY2;
- }
-
- protected ColorUIResource getSecondary3()
- {
- return SECONDARY3;
- }
-
- public FontUIResource getControlTextFont()
- {
- return CONTROL_TEXT_FONT;
- }
-
- public FontUIResource getMenuTextFont()
- {
- return MENU_TEXT_FONT;
- }
-
- public FontUIResource getSubTextFont()
- {
- return SUB_TEXT_FONT;
- }
-
- public FontUIResource getSystemTextFont()
- {
- return SYSTEM_TEXT_FONT;
- }
-
- public FontUIResource getUserTextFont()
- {
- return USER_TEXT_FONT;
- }
-
- public FontUIResource getWindowTitleFont()
- {
- return WINDOW_TITLE_FONT;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalBorders.java b/libjava/javax/swing/plaf/metal/MetalBorders.java
deleted file mode 100644
index e9c4bc0cf63..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalBorders.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/* MetalBorders.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-import javax.swing.AbstractButton;
-import javax.swing.ButtonModel;
-import javax.swing.JButton;
-import javax.swing.border.AbstractBorder;
-import javax.swing.border.Border;
-import javax.swing.plaf.BorderUIResource;
-import javax.swing.plaf.UIResource;
-import javax.swing.plaf.basic.BasicGraphicsUtils;
-import javax.swing.plaf.basic.BasicBorders;
-
-/**
- * This factory class creates borders for the different Swing components
- * UI.
- *
- * @author Roman Kennke (roman@kennke.org)
- */
-public class MetalBorders
-{
-
- /** The shared instance for getButtonBorder(). */
- private static Border buttonBorder;
-
- /** The shared instance for getRolloverButtonBorder(). */
- private static Border toolbarButtonBorder;
-
- /**
- * A MarginBorder that gets shared by multiple components.
- * Created on demand by the private helper function {@link
- * #getMarginBorder()}.
- */
- private static BasicBorders.MarginBorder marginBorder;
-
- /**
- * The border that is drawn around Swing buttons.
- */
- public static class MetalButtonBorder
- extends AbstractBorder
- implements UIResource
- {
- /** The borders insets. */
- protected static Insets borderInsets = new Insets(3, 3, 3, 3);
-
- /**
- * Creates a new instance of ButtonBorder.
- */
- public MetalButtonBorder()
- {
- }
-
- /**
- * Paints the button border.
- *
- * @param c the component for which we paint the border
- * @param g the Graphics context to use
- * @param x the X coordinate of the upper left corner of c
- * @param y the Y coordinate of the upper left corner of c
- * @param w the width of c
- * @param h the height of c
- */
- public void paintBorder(Component c, Graphics g, int x, int y, int w,
- int h)
- {
- ButtonModel bmodel = null;
-
- if (c instanceof AbstractButton)
- bmodel = ((AbstractButton) c).getModel();
-
- Color darkShadow = MetalLookAndFeel.getControlDarkShadow();
- Color shadow = MetalLookAndFeel.getControlShadow();
- Color light = MetalLookAndFeel.getWhite();
- Color middle = MetalLookAndFeel.getControl();
-
- // draw dark border
- g.setColor(darkShadow);
- g.drawRect(x, y, w - 2, h - 2);
-
- if (!bmodel.isPressed())
- {
- // draw light border
- g.setColor(light);
- g.drawRect(x + 1, y + 1, w - 2, h - 2);
-
- // draw crossing pixels of both borders
- g.setColor(middle);
- g.drawRect(x + 1, y + h - 2, 0, 0);
- g.drawRect(x + w - 2, y + 1, 0, 0);
- }
- else
- {
- // draw light border
- g.setColor(light);
- g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1);
- g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1);
-
- // draw shadow border
- g.setColor(middle);
- g.drawLine(x + 1, y + 1, x + w - 2, y + 1);
- g.drawLine(x + 1, y + 1, x + 1, y + h - 2);
-
- // draw crossing pixels of both borders
- g.setColor(shadow);
- g.drawRect(x + 1, y + h - 2, 0, 0);
- g.drawRect(x + w - 2, y + 1, 0, 0);
- }
- }
-
- /**
- * Returns the insets of the ButtonBorder.
- *
- * @param c the component for which the border is used
- *
- * @return the insets of the ButtonBorder
- */
- public Insets getBorderInsets(Component c)
- {
- return getBorderInsets(c, null);
- }
-
- /**
- * Returns the insets of the ButtonBorder in the specified Insets object.
- *
- * @param c the component for which the border is used
- * @param newInsets the insets object where to put the values
- *
- * @return the insets of the ButtonBorder
- */
- public Insets getBorderInsets(Component c, Insets newInsets)
- {
- if (newInsets == null)
- newInsets = new Insets(0, 0, 0, 0);
-
- AbstractButton b = (AbstractButton) c;
- newInsets.bottom = borderInsets.bottom;
- newInsets.left = borderInsets.left;
- newInsets.right = borderInsets.right;
- newInsets.top = borderInsets.top;
- return newInsets;
- }
- }
-
- /**
- * A border for JScrollPanes.
- */
- public static class ScrollPaneBorder
- extends AbstractBorder
- implements UIResource
- {
- /** The border insets. */
- private static Insets insets = new Insets(1, 1, 2, 2);
-
- /**
- * Constructs a new ScrollPaneBorder.
- */
- public ScrollPaneBorder()
- {
- }
-
- /**
- * Returns the insets of the border for the Component <code>c</code>.
- *
- * @param c the Component for which we return the border insets
- */
- public Insets getBorderInsets(Component c)
- {
- return insets;
- }
-
- /**
- * Paints the border.
- *
- * @param c the Component for which the border is painted
- * @param g the Graphics context
- * @param x the X coordinate of the upper left corner of the border
- * @param y the Y coordinate of the upper left corner of the border
- * @param w the width of the border
- * @param h the height of the border
- */
- public void paintBorder(Component c, Graphics g, int x, int y,
- int w, int h)
- {
- Color darkShadow = MetalLookAndFeel.getControlDarkShadow();
- Color shadow = MetalLookAndFeel.getControlShadow();
- Color light = MetalLookAndFeel.getWhite();
- Color middle = MetalLookAndFeel.getControl();
-
- // paint top border line
- g.setColor(darkShadow);
- g.drawLine(x, y, x + w - 2, y);
-
- // paint left border line
- g.drawLine(x, y, x, y + h - 2);
-
- // paint right inner border line
- g.drawLine(x + w - 2, y, x + w - 2, y + h + 1);
-
- // paint bottom inner border line
- g.drawLine(x + 2, y + h - 2, x + w - 2, y + h - 2);
-
- // draw right outer border line
- g.setColor(light);
- g.drawLine(x + w - 1, y, x + w - 1, y + h - 1);
-
- // draw bottom outer border line
- g.drawLine(x, y + h - 1, x + w - 1, y + h - 1);
-
- // paint the lighter points
- g.setColor(middle);
- g.drawLine(x + w - 1, y, x + w - 1, y);
- g.drawLine(x + w - 2, y + 2, x + w - 2, y + 2);
- g.drawLine(x, y + h - 1, x, y + h - 1);
- g.drawLine(x + 1, y + h - 2, x + 1, y + h - 2);
-
- }
-
- }
-
- /**
- * This border is used in Toolbar buttons as inner border.
- */
- static class RolloverMarginBorder extends AbstractBorder
- {
- /** The borders insets. */
- protected static Insets borderInsets = new Insets(3, 3, 3, 3);
-
- /**
- * Creates a new instance of RolloverBorder.
- */
- public RolloverMarginBorder()
- {
- }
-
- /**
- * Returns the insets of the RolloverBorder.
- *
- * @param c the component for which the border is used
- *
- * @return the insets of the RolloverBorder
- */
- public Insets getBorderInsets(Component c)
- {
- return getBorderInsets(c, null);
- }
-
- /**
- * Returns the insets of the RolloverMarginBorder in the specified
- * Insets object.
- *
- * @param c the component for which the border is used
- * @param newInsets the insets object where to put the values
- *
- * @return the insets of the RolloverMarginBorder
- */
- public Insets getBorderInsets(Component c, Insets newInsets)
- {
- if (newInsets == null)
- newInsets = new Insets(0, 0, 0, 0);
-
- AbstractButton b = (AbstractButton) c;
- Insets margin = b.getMargin();
- newInsets.bottom = borderInsets.bottom;
- newInsets.left = borderInsets.left;
- newInsets.right = borderInsets.right;
- newInsets.top = borderInsets.top;
- return newInsets;
- }
- }
-
- /**
- * A border implementation for popup menus.
- */
- public static class PopupMenuBorder
- extends AbstractBorder
- implements UIResource
- {
-
- /** The border's insets. */
- protected static Insets borderInsets = new Insets(2, 2, 1, 1);
-
- /**
- * Constructs a new PopupMenuBorder.
- */
- public PopupMenuBorder()
- {
- }
-
- /**
- * Returns the insets of the border, creating a new Insets instance
- * with each call.
- *
- * @param c the component for which we return the border insets
- * (not used here)
- */
- public Insets getBorderInsets(Component c)
- {
- return getBorderInsets(c, null);
- }
-
- /**
- * Returns the insets of the border, using the supplied Insets instance.
- *
- * @param c the component for which we return the border insets
- * (not used here)
- * @param i the Insets instance to fill with the Insets values
- */
- public Insets getBorderInsets(Component c, Insets i)
- {
- Insets insets;
- if (i == null)
- insets = new Insets(borderInsets.top, borderInsets.left,
- borderInsets.bottom, borderInsets.right);
- else
- {
- insets = i;
- insets.top = borderInsets.top;
- insets.left = borderInsets.left;
- insets.bottom = borderInsets.bottom;
- insets.right = borderInsets.right;
- }
-
- return insets;
- }
-
- /**
- * Paints the border for component <code>c</code> using the
- * Graphics context <code>g</code> with the dimension
- * <code>x, y, w, h</code>.
- *
- * @param c the component for which we paint the border
- * @param g the Graphics context to use
- * @param x the X coordinate of the upper left corner of c
- * @param y the Y coordinate of the upper left corner of c
- * @param w the width of c
- * @param h the height of c
- */
- public void paintBorder(Component c, Graphics g, int x, int y, int w,
- int h)
- {
- Color darkShadow = MetalLookAndFeel.getPrimaryControlDarkShadow();
- Color light = MetalLookAndFeel.getPrimaryControlHighlight();
-
- // draw dark outer border
- g.setColor(darkShadow);
- g.drawRect(x, y, w - 1, h - 1);
-
- // draw highlighted inner border (only top and left)
- g.setColor(light);
- g.drawLine(x + 1, y + 1, x + 1, y + h - 2);
- g.drawLine(x + 1, y + 1, x + w - 2, y + 1);
- }
-
- }
-
- /**
- * Returns a border for Swing buttons in the Metal Look &amp; Feel.
- *
- * @return a border for Swing buttons in the Metal Look &amp; Feel
- */
- public static Border getButtonBorder()
- {
- if (buttonBorder == null)
- {
- Border outer = new MetalButtonBorder();
- Border inner = getMarginBorder();
- buttonBorder = new BorderUIResource.CompoundBorderUIResource
- (outer, inner);
- }
- return buttonBorder;
- }
-
- /**
- * Returns a border for Toolbar buttons in the Metal Look &amp; Feel.
- *
- * @return a border for Toolbar buttons in the Metal Look &amp; Feel
- */
- static Border getToolbarButtonBorder()
- {
- if (toolbarButtonBorder == null)
- {
- Border outer = new MetalButtonBorder();
- Border inner = new RolloverMarginBorder();
- toolbarButtonBorder = new BorderUIResource.CompoundBorderUIResource
- (outer, inner);
- }
- return toolbarButtonBorder;
- }
-
- /**
- * Returns a shared instance of {@link BasicBorders.MarginBorder}.
- *
- * @return a shared instance of {@link BasicBorders.MarginBorder}
- */
- static Border getMarginBorder()
- {
- if (marginBorder == null)
- marginBorder = new BasicBorders.MarginBorder();
- return marginBorder;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalButtonUI.java b/libjava/javax/swing/plaf/metal/MetalButtonUI.java
deleted file mode 100644
index a7b53c4b430..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalButtonUI.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* MetalButtonUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.AbstractButton;
-import javax.swing.JComponent;
-import javax.swing.JToolBar;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicButtonUI;
-
-/**
- * The Metal Look &amp; Feel implementation for
- * {@link javax.swing.AbstractButton}s.
- *
- * @author Roman Kennke (roman@kennke.org)
- */
-public class MetalButtonUI
- extends BasicButtonUI
-{
-
- // FIXME: probably substitute with a Map in the future in the case
- // that this UI becomes stateful
-
- /** The cached MetalButtonUI instance. */
- private static MetalButtonUI instance = null;
-
- /**
- * Creates a new instance of MetalButtonUI.
- */
- public MetalButtonUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalButtonUI.
- *
- * @param component a button for which a UI instance should be returned
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalButtonUI();
- return instance;
- }
-
- /**
- * Install the Look &amp; Feel defaults for Buttons.
- *
- * @param button the button for which to install the Look &amp; Feel
- */
- public void installDefaults(AbstractButton button)
- {
- super.installDefaults(button);
-
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- button.setFont(defaults.getFont("Button.font"));
-
- if (button.getParent() instanceof JToolBar)
- button.setBorder(MetalBorders.getToolbarButtonBorder());
- }
-
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalCheckBoxUI.java b/libjava/javax/swing/plaf/metal/MetalCheckBoxUI.java
deleted file mode 100644
index d59e38c5474..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalCheckBoxUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalCheckBoxUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicCheckBoxUI;
-
-public class MetalCheckBoxUI
- extends BasicCheckBoxUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for JCheckBoxes. */
- private static MetalCheckBoxUI instance = null;
-
- /**
- * Constructs a new instance of MetalCheckBoxUI.
- */
- public MetalCheckBoxUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalCheckBoxUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalCheckBoxUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalCheckBoxUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalComboBoxUI.java b/libjava/javax/swing/plaf/metal/MetalComboBoxUI.java
deleted file mode 100644
index 3578561ff17..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalComboBoxUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalComboBoxUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicComboBoxUI;
-
-public class MetalComboBoxUI
- extends BasicComboBoxUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for JComboBoxes. */
- private static MetalComboBoxUI instance = null;
-
- /**
- * Constructs a new instance of MetalComboBoxUI.
- */
- public MetalComboBoxUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalComboBoxUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalComboBoxUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalComboBoxUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalDesktopIconUI.java b/libjava/javax/swing/plaf/metal/MetalDesktopIconUI.java
deleted file mode 100644
index 00870545bc6..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalDesktopIconUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalDesktopIconUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicDesktopIconUI;
-
-public class MetalDesktopIconUI
- extends BasicDesktopIconUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for MetalDesktopIcons */
- private static MetalDesktopIconUI instance = null;
-
- /**
- * Constructs a new instance of MetalDesktopIconUI.
- */
- public MetalDesktopIconUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalDesktopIconUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalDesktopIconUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalDesktopIconUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalInternalFrameUI.java b/libjava/javax/swing/plaf/metal/MetalInternalFrameUI.java
deleted file mode 100644
index 14143512e67..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalInternalFrameUI.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/* MetalInternalFrameUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import java.util.HashMap;
-
-import javax.swing.JComponent;
-import javax.swing.JInternalFrame;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicInternalFrameUI;
-
-public class MetalInternalFrameUI
- extends BasicInternalFrameUI
-{
-
- /** The instances of MetalInternalFrameUI*/
- private static HashMap instances;
-
- /**
- * Constructs a new instance of MetalInternalFrameUI.
- */
- public MetalInternalFrameUI(JInternalFrame frame)
- {
- super(frame);
- }
-
- /**
- * Returns an instance of MetalInternalFrameUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalInternalFrameUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instances == null)
- instances = new HashMap();
-
-
- Object o = instances.get(component);
- MetalInternalFrameUI instance;
- if (o == null)
- {
- instance = new MetalInternalFrameUI((JInternalFrame) component);
- instances.put(component, instance);
- }
- else
- instance = (MetalInternalFrameUI) o;
-
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalLabelUI.java b/libjava/javax/swing/plaf/metal/MetalLabelUI.java
deleted file mode 100644
index cdd861227a2..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalLabelUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalLabelUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicLabelUI;
-
-public class MetalLabelUI
- extends BasicLabelUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for JLabels. */
- private static MetalLabelUI instance = null;
-
- /**
- * Constructs a new instance of MetalLabelUI.
- */
- public MetalLabelUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalLabelUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalLabelUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalLabelUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
deleted file mode 100644
index b4c74218ff2..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/* MetalLookAndFeel.java
- Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import java.awt.Color;
-import java.awt.Insets;
-
-import javax.swing.UIDefaults;
-import javax.swing.plaf.ColorUIResource;
-import javax.swing.plaf.FontUIResource;
-import javax.swing.plaf.basic.BasicLookAndFeel;
-
-public class MetalLookAndFeel extends BasicLookAndFeel
-{
- private static final long serialVersionUID = 6680646159193457980L;
- private static MetalTheme theme;
- private UIDefaults LAF_defaults;
-
- public MetalLookAndFeel()
- {
- createDefaultTheme();
- }
-
- protected void createDefaultTheme()
- {
- setCurrentTheme(new DefaultMetalTheme());
- }
-
- public boolean isNativeLookAndFeel()
- {
- return true;
- }
-
- public boolean isSupportedLookAndFeel()
- {
- return true;
- }
-
- public String getDescription()
- {
- return "Metal look and feel";
- }
-
- public String getID()
- {
- return "MetalLookAndFeel";
- }
-
- public String getName()
- {
- return "MetalLookAndFeel";
- }
-
- public UIDefaults getDefaults()
- {
- if (LAF_defaults == null)
- LAF_defaults = super.getDefaults();
-
- // add custom theme entries to the table
- theme.addCustomEntriesToTable(LAF_defaults);
-
- // Returns the default values for this look and feel.
- return LAF_defaults;
- }
-
- public static ColorUIResource getAcceleratorForeground()
- {
- return theme.getAcceleratorForeground();
- }
-
- public static ColorUIResource getAcceleratorSelectedForeground()
- {
- return theme.getAcceleratorSelectedForeground();
- }
-
- public static ColorUIResource getBlack()
- {
- return theme.getBlack();
- }
-
- public static ColorUIResource getControl()
- {
- return theme.getControl();
- }
-
- public static ColorUIResource getControlDarkShadow()
- {
- return theme.getControlDarkShadow();
- }
-
- public static ColorUIResource getControlDisabled()
- {
- return theme.getControlDisabled();
- }
-
- public static ColorUIResource getControlHighlight()
- {
- return theme.getControlHighlight();
- }
-
- public static ColorUIResource getControlInfo()
- {
- return theme.getControlInfo();
- }
-
- public static ColorUIResource getControlShadow()
- {
- return theme.getControlShadow();
- }
-
- public static ColorUIResource getControlTextColor()
- {
- return theme.getControlTextColor();
- }
-
- public static FontUIResource getControlTextFont()
- {
- return theme.getControlTextFont();
- }
-
- public static ColorUIResource getDesktopColor()
- {
- return theme.getDesktopColor();
- }
-
- public static ColorUIResource getFocusColor()
- {
- return theme.getFocusColor();
- }
-
- public static ColorUIResource getHighlightedTextColor()
- {
- return theme.getHighlightedTextColor();
- }
-
- public static ColorUIResource getInactiveControlTextColor()
- {
- return theme.getInactiveControlTextColor();
- }
-
- public static ColorUIResource getInactiveSystemTextColor()
- {
- return theme.getInactiveSystemTextColor();
- }
-
- public static ColorUIResource getMenuBackground()
- {
- return theme.getMenuBackground();
- }
-
- public static ColorUIResource getMenuDisabledForeground()
- {
- return theme.getMenuDisabledForeground();
- }
-
- public static ColorUIResource getMenuForeground()
- {
- return theme.getMenuForeground();
- }
-
- public static ColorUIResource getMenuSelectedBackground()
- {
- return theme.getMenuSelectedBackground();
- }
-
- public static ColorUIResource getMenuSelectedForeground()
- {
- return theme.getMenuSelectedForeground();
- }
-
- public static FontUIResource getMenuTextFont()
- {
- return theme.getMenuTextFont();
- }
-
- public static ColorUIResource getPrimaryControl()
- {
- return theme.getPrimaryControl();
- }
-
- public static ColorUIResource getPrimaryControlDarkShadow()
- {
- return theme.getPrimaryControlDarkShadow();
- }
-
- public static ColorUIResource getPrimaryControlHighlight()
- {
- return theme.getPrimaryControlHighlight();
- }
-
- public static ColorUIResource getPrimaryControlInfo()
- {
- return theme.getPrimaryControlInfo();
- }
-
- public static ColorUIResource getPrimaryControlShadow()
- {
- return theme.getPrimaryControlShadow();
- }
-
- public static ColorUIResource getSeparatorBackground()
- {
- return theme.getSeparatorBackground();
- }
-
- public static ColorUIResource getSeparatorForeground()
- {
- return theme.getSeparatorForeground();
- }
-
- public static FontUIResource getSubTextFont()
- {
- return theme.getSubTextFont();
- }
-
- public static ColorUIResource getSystemTextColor()
- {
- return theme.getSystemTextColor();
- }
-
- public static FontUIResource getSystemTextFont()
- {
- return theme.getSystemTextFont();
- }
-
- public static ColorUIResource getTextHighlightColor()
- {
- return theme.getTextHighlightColor();
- }
-
- public static ColorUIResource getUserTextColor()
- {
- return theme.getUserTextColor();
- }
-
- public static FontUIResource getUserTextFont()
- {
- return theme.getUserTextFont();
- }
-
- public static ColorUIResource getWhite()
- {
- return theme.getWhite();
- }
-
- public static ColorUIResource getWindowBackground()
- {
- return theme.getWindowBackground();
- }
-
- public static ColorUIResource getWindowTitleBackground()
- {
- return theme.getWindowTitleBackground();
- }
-
- public static FontUIResource getWindowTitleFont()
- {
- return theme.getWindowTitleFont();
- }
-
- public static ColorUIResource getWindowTitleForeground()
- {
- return theme.getWindowTitleForeground();
- }
-
- public static ColorUIResource getWindowTitleInactiveBackground()
- {
- return theme.getWindowTitleInactiveBackground();
- }
-
- public static ColorUIResource getWindowTitleInactiveForeground()
- {
- return theme.getWindowTitleInactiveForeground();
- }
-
- public static void setCurrentTheme(MetalTheme theme)
- {
- MetalLookAndFeel.theme = theme;
- }
-
- /**
- * Sets the ComponentUI classes for all Swing components to the Metal
- * implementations.
- *
- * In particular this sets the following keys:
- *
- * <table>
- * <tr>
- * <th>Key</th><th>Value</th>
- * </tr><tr>
- * <td>ButtonUI</td><td>{@link MetalButtonUI}</td>
- * </tr><tr>
- * <td>CheckBoxUI</td><td>{@link MetalCheckBoxUI}</td>
- * </tr><tr>
- * <td>ComboBoxUI</td><td>{@link MetalComboBoxUI}</td>
- * </tr><tr>
- * <td>DesktopIconUI</td><td>{@link MetalDesktopIconUI}</td>
- * </tr><tr>
- * <td>InternalFrameUI</td><td>{@link MetalInternalFrameUI}</td>
- * </tr><tr>
- * <td>LabelUI</td><td>{@link MetalLabelUI}</td>
- * </tr><tr>
- * <td>PopupMenuSeparatorUI</td><td>{@link MetalPopupMenuSeparatorUI}</td>
- * </tr><tr>
- * <td>ProgressBarUI</td><td>{@link MetalProgressBarUI}</td>
- * </tr><tr>
- * <td>RadioButtonUI</td><td>{@link MetalRadioButtonUI}</td>
- * </tr><tr>
- * <td>RootPaneUI</td><td>{@link MetalRootPaneUI}</td>
- * </tr><tr>
- * <td>ScrollBarUI</td><td>{@link MetalScrollBarUI}</td>
- * </tr><tr>
- * <td>ScrollPaneUI</td><td>{@link MetalScrollPaneUI}</td>
- * </tr><tr>
- * <td>SeparatorUI</td><td>{@link MetalSeparatorUI}</td>
- * </tr><tr>
- * <td>SliderUI</td><td>{@link MetalSliderUI}</td>
- * </tr><tr>
- * <td>SplitPaneUI</td><td>{@link MetalSplitPaneUI}</td>
- * </tr><tr>
- * <td>TabbedPaneUI</td><td>{@link MetalTabbedPaneUI}</td>
- * </tr><tr>
- * <td>TextFieldUI</td><td>{@link MetalTextFieldUI}</td>
- * </tr><tr>
- * <td>ToggleButtonUI</td><td>{@link MetalToggleButtonUI}</td>
- * </tr><tr>
- * <td>ToolBarUI</td><td>{@link MetalToolBarUI}</td>
- * </tr><tr>
- * <td>ToolTipUI</td><td>{@link MetalToolTipUI}</td>
- * </tr><tr>
- * <td>TreeUI</td><td>{@link MetalTreeUI}</td>
- * </tr><tr>
- * </table>
- *
- * @param defaults the UIDefaults where the class defaults are added
- */
- protected void initClassDefaults(UIDefaults defaults)
- {
- super.initClassDefaults(defaults);
-
- // Variables
- Object[] uiDefaults;
- // Initialize Class Defaults
- uiDefaults = new Object[] {
- "ButtonUI", "javax.swing.plaf.metal.MetalButtonUI",
- "CheckBoxUI", "javax.swing.plaf.metal.MetalCheckBoxUI",
- "ComboBoxUI", "javax.swing.plaf.metal.MetalComboBoxUI",
- "DesktopIconUI", "javax.swing.plaf.metal.MetalDesktopIconUI",
- "InternalFrameUI", "javax.swing.plaf.metal.MetalInternalFrameUI",
- "LabelUI", "javax.swing.plaf.metal.MetalLabelUI",
- "PopupMenuSeparatorUI",
- "javax.swing.plaf.metal.MetalPopupMenuSeparatorUI",
- "ProgressBarUI", "javax.swing.plaf.metal.MetalProgressBarUI",
- "RadioButtonUI", "javax.swing.plaf.metal.MetalRadioButtonUI",
- "RootPaneUI", "javax.swing.plaf.metal.MetalRootPaneUI",
- "ScrollBarUI", "javax.swing.plaf.metal.MetalScrollBarUI",
- "ScrollPaneUI", "javax.swing.plaf.metal.MetalScrollPaneUI",
- "SeparatorUI", "javax.swing.plaf.metal.MetalSeparatorUI",
- "SliderUI", "javax.swing.plaf.metal.MetalSliderUI",
- "SplitPaneUI", "javax.swing.plaf.metal.MetalSplitPaneUI",
- "TabbedPaneUI", "javax.swing.plaf.metal.MetalTabbedPaneUI",
- "TextFieldUI", "javax.swing.plaf.metal.MetalTextFieldUI",
- "ToggleButtonUI", "javax.swing.plaf.metal.MetalToggleButtonUI",
- "ToolBarUI", "javax.swing.plaf.metal.MetalToolBarUI",
- "ToolTipUI", "javax.swing.plaf.metal.MetalToolTipUI",
- "TreeUI", "javax.swing.plaf.metal.MetalTreeUI",
- };
- // Add Class Defaults to UI Defaults table
- defaults.putDefaults(uiDefaults);
- }
-
- /**
- * Initializes the component defaults for the Metal Look &amp; Feel.
- *
- * In particular this sets the following keys (the colors are given
- * as RGB hex values):
- *
- * <table>
- * <tr>
- * <th>Key</th><th>Value</th>
- * </tr><tr>
- * <td>Button.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>Button.border</td><td>{@link MetalBorders.ButtonBorder}</td>
- * </tr><tr>
- * <td>Button.font</td><td>{@link #getControlTextFont}</td>
- * </tr><tr>
- * <td>Button.margin</td><td><code>new java.awt.Insets(2, 14, 2, 14)</code>
- * </td>
- * </tr><tr>
- * <td>CheckBox.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>CheckBoxMenuItem.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>ToolBar.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>Panel.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>Slider.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>OptionPane.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>ProgressBar.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>TabbedPane.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>Label.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>Label.font</td><td>{@link #getControlTextFont}</td>
- * </tr><tr>
- * <td>Menu.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>MenuBar.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>MenuItem.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>ScrollBar.background</td><td>0xcccccc</td>
- * </tr><tr>
- * <td>PopupMenu.border</td>
- * <td><code>new javax.swing.plaf.metal.MetalBorders.PopupMenuBorder()</td>
- * </tr><tr>
- * </table>
- *
- * @param defaults the UIDefaults instance to which the values are added
- */
- protected void initComponentDefaults(UIDefaults defaults)
- {
- super.initComponentDefaults(defaults);
- Object[] myDefaults = new Object[] {
- "Button.background", new ColorUIResource(getControl()),
- "Button.border", MetalBorders.getButtonBorder(),
- "Button.darkShadow", new ColorUIResource(getControlDarkShadow()),
- "Button.disabledText", new ColorUIResource(getControlDisabled()),
- "Button.focus", new ColorUIResource(getFocusColor()),
- "Button.font", getControlTextFont(),
- "Button.foreground", new ColorUIResource(getSystemTextColor()),
- "Button.highlight", new ColorUIResource(getControlHighlight()),
- "Button.light", new ColorUIResource(getControlHighlight()),
- "Button.margin", new Insets(2, 14, 2, 14),
- "Button.select", new ColorUIResource(getPrimaryControlShadow()),
- "Button.shadow", new ColorUIResource(getPrimaryControlShadow()),
- "CheckBox.background", new ColorUIResource(getControl()),
- "CheckBoxMenuItem.background", new ColorUIResource(getControl()),
- "ToolBar.background", new ColorUIResource(getControl()),
- "Panel.background", new ColorUIResource(getControl()),
- "Slider.background", new ColorUIResource(getControl()),
- "OptionPane.background", new ColorUIResource(getControl()),
- "ProgressBar.background", new ColorUIResource(getControl()),
- "ScrollPane.border", new MetalBorders.ScrollPaneBorder(),
- "TabbedPane.background", new ColorUIResource(getControl()),
- "Label.background", new ColorUIResource(getControl()),
- "Label.font", getControlTextFont(),
- "Label.disabledForeground", new ColorUIResource(getControlDisabled()),
- "Label.foreground", new ColorUIResource(getSystemTextColor()),
- "Menu.background", new ColorUIResource(getControl()),
- "Menu.font", getControlTextFont(),
- "MenuBar.background", new ColorUIResource(getControl()),
- "MenuBar.font", getControlTextFont(),
- "MenuItem.background", new ColorUIResource(getControl()),
- "MenuItem.font", getControlTextFont(),
- "ScrollBar.background", new ColorUIResource(getControl()),
- "ScrollBar.shadow", new ColorUIResource(getControlShadow()),
- "ScrollBar.thumb", new ColorUIResource(getPrimaryControlShadow()),
- "ScrollBar.thumbDarkShadow",
- new ColorUIResource(getPrimaryControlDarkShadow()),
- "ScrollBar.thumbHighlight",
- new ColorUIResource(getPrimaryControl()),
- "PopupMenu.border", new MetalBorders.PopupMenuBorder()
- };
- defaults.putDefaults(myDefaults);
- }
-
- /**
- * Initializes the system color defaults.
- *
- * In particular this sets the following keys:
- *
- * <table>
- * <tr>
- * <th>Key</th><th>Value</th><th>Description</th>
- * </tr><tr>
- * <td>control</td><td>0xcccccc</td><td>The default color for components</td>
- * </tr>
- * </table>
- */
- protected void initSystemColorDefaults(UIDefaults defaults)
- {
- super.initSystemColorDefaults(defaults);
- Object[] uiDefaults;
- uiDefaults = new Object[] {
- "control", new ColorUIResource(getControl())
- };
- defaults.putDefaults(uiDefaults);
- }
-
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java b/libjava/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java
deleted file mode 100644
index ec9bf2b5586..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* MetalPopupMenuSeparatorUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-
-public class MetalPopupMenuSeparatorUI
- extends MetalSeparatorUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for MetalPopupMenuSeparatorUIs */
- private static MetalPopupMenuSeparatorUI instance = null;
-
- /**
- * Constructs a new instance of MetalPopupMenuSeparatorUI.
- */
- public MetalPopupMenuSeparatorUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalPopupMenuSeparatorUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalPopupMenuSeparatorUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalPopupMenuSeparatorUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalProgressBarUI.java b/libjava/javax/swing/plaf/metal/MetalProgressBarUI.java
deleted file mode 100644
index 96d1988fd3d..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalProgressBarUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalProgressBarUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicProgressBarUI;
-
-public class MetalProgressBarUI
- extends BasicProgressBarUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for MetalProgressBarUIs */
- private static MetalProgressBarUI instance = null;
-
- /**
- * Constructs a new instance of MetalProgressBarUI.
- */
- public MetalProgressBarUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalProgressBarUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalProgressBarUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalProgressBarUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalRadioButtonUI.java b/libjava/javax/swing/plaf/metal/MetalRadioButtonUI.java
deleted file mode 100644
index a668f914e43..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalRadioButtonUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalRadioButtonUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicRadioButtonUI;
-
-public class MetalRadioButtonUI
- extends BasicRadioButtonUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for JRadioButtons. */
- private static MetalRadioButtonUI instance = null;
-
- /**
- * Constructs a new instance of MetalRadioButtonUI.
- */
- public MetalRadioButtonUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalRadioButtonUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalRadioButtonUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalRadioButtonUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalRootPaneUI.java b/libjava/javax/swing/plaf/metal/MetalRootPaneUI.java
deleted file mode 100644
index 4196a4e477c..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalRootPaneUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalRootPaneUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicRootPaneUI;
-
-public class MetalRootPaneUI
- extends BasicRootPaneUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for MetalRootPaneUIs */
- private static MetalRootPaneUI instance = null;
-
- /**
- * Constructs a new instance of MetalRootPaneUI.
- */
- public MetalRootPaneUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalRootPaneUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalRootPaneUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalRootPaneUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalScrollBarUI.java b/libjava/javax/swing/plaf/metal/MetalScrollBarUI.java
deleted file mode 100644
index ff6b24c387d..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalScrollBarUI.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/* MetalScrollBarUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-import java.util.HashMap;
-
-import javax.swing.JComponent;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicScrollBarUI;
-
-public class MetalScrollBarUI
- extends BasicScrollBarUI
-{
-
- /** The minimum thumb size */
- private static final Dimension MIN_THUMB_SIZE = new Dimension(18, 18);
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for JScrollBars. */
- private static HashMap instances = null;
-
- /**
- * Constructs a new instance of MetalScrollBarUI.
- */
- public MetalScrollBarUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalScrollBarUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalScrollBarUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instances == null)
- instances = new HashMap();
-
- Object o = instances.get(component);
- MetalScrollBarUI instance;
- if (o == null)
- {
- instance = new MetalScrollBarUI();
- instances.put(component, instance);
- }
- else
- instance = (MetalScrollBarUI) o;
-
- return instance;
- }
-
- /**
- * Paints the slider button of the ScrollBar.
- *
- * @param g the Graphics context to use
- * @param c the JComponent on which we paint
- * @param thumbBounds the rectangle that is the slider button
- */
- protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
- {
- // first we fill the background
- g.setColor(thumbColor);
- g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width,
- thumbBounds.height);
-
- // draw the outer dark line
- g.setColor(thumbDarkShadowColor);
- g.drawRect(thumbBounds.x, thumbBounds.y, thumbBounds.width - 1,
- thumbBounds.height - 1);
-
- // draw the inner light line
- g.setColor(thumbHighlightColor);
- g.drawLine(thumbBounds.x + 1, thumbBounds.y + 1,
- thumbBounds.x + thumbBounds.width - 2,
- thumbBounds.y + 1);
- g.drawLine(thumbBounds.x + 1, thumbBounds.y + 1,
- thumbBounds.x + 1,
- thumbBounds.y + thumbBounds.height - 2);
-
- // draw the shadow line
- UIDefaults def = UIManager.getLookAndFeelDefaults();
- g.setColor(def.getColor("ScrollBar.shadow"));
- g.drawLine(thumbBounds.x + 1, thumbBounds.y + thumbBounds.height,
- thumbBounds.x + thumbBounds.width,
- thumbBounds.y + thumbBounds.height);
-
- // draw the pattern
- int xOff = 0;
- for (int y = thumbBounds.y + 4;
- y < (thumbBounds.y + thumbBounds.height - 4); y++)
- {
- // set color alternating with every line
- if ((y % 2) == 0)
- g.setColor(thumbHighlightColor);
- else
- g.setColor(thumbDarkShadowColor);
-
- for (int x = thumbBounds.x + 3 + (xOff);
- x < (thumbBounds.x + thumbBounds.width - 3); x = x + 4)
- {
- g.drawLine(x, y, x, y);
- }
-
- // increase x offset
- xOff++;
- if (xOff > 3)
- xOff = 0;
-
- }
- }
-
- /**
- * This method returns the minimum thumb size.
- *
- * @return The minimum thumb size.
- */
- protected Dimension getMinimumThumbSize()
- {
- return MIN_THUMB_SIZE;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalScrollPaneUI.java b/libjava/javax/swing/plaf/metal/MetalScrollPaneUI.java
deleted file mode 100644
index 3e1198b398d..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalScrollPaneUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalScrollPaneUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicScrollPaneUI;
-
-public class MetalScrollPaneUI
- extends BasicScrollPaneUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for JScrollPanes. */
- private static MetalScrollPaneUI instance = null;
-
- /**
- * Constructs a new instance of MetalScrollPaneUI.
- */
- public MetalScrollPaneUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalScrollPaneUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalScrollPaneUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalScrollPaneUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalSeparatorUI.java b/libjava/javax/swing/plaf/metal/MetalSeparatorUI.java
deleted file mode 100644
index 6e78ccb7071..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalSeparatorUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalSeparatorUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicSeparatorUI;
-
-public class MetalSeparatorUI
- extends BasicSeparatorUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for MetalSeparatorUIs */
- private static MetalSeparatorUI instance = null;
-
- /**
- * Constructs a new instance of MetalSeparatorUI.
- */
- public MetalSeparatorUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalSeparatorUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalSeparatorUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalSeparatorUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalSliderUI.java b/libjava/javax/swing/plaf/metal/MetalSliderUI.java
deleted file mode 100644
index a857d6a9d8d..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalSliderUI.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* MetalSliderUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import java.util.HashMap;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicSliderUI;
-
-public class MetalSliderUI
- extends BasicSliderUI
-{
-
- /** The UI instances for MetalSliderUIs */
- private static HashMap instances;
-
- /**
- * Constructs a new instance of MetalSliderUI.
- */
- public MetalSliderUI()
- {
- super(null);
- }
-
- /**
- * Returns an instance of MetalSliderUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalSliderUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instances == null)
- instances = new HashMap();
-
-
- Object o = instances.get(component);
- MetalSliderUI instance;
- if (o == null)
- {
- instance = new MetalSliderUI();
- instances.put(component, instance);
- }
- else
- instance = (MetalSliderUI) o;
-
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalSplitPaneUI.java b/libjava/javax/swing/plaf/metal/MetalSplitPaneUI.java
deleted file mode 100644
index f7c6474f25e..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalSplitPaneUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalSplitPaneUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicSplitPaneUI;
-
-public class MetalSplitPaneUI
- extends BasicSplitPaneUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for MetalSplitPaneUIs */
- private static MetalSplitPaneUI instance = null;
-
- /**
- * Constructs a new instance of MetalSplitPaneUI.
- */
- public MetalSplitPaneUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalSplitPaneUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalSplitPaneUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalSplitPaneUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalTabbedPaneUI.java b/libjava/javax/swing/plaf/metal/MetalTabbedPaneUI.java
deleted file mode 100644
index bf50f9172a1..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalTabbedPaneUI.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* MetalTabbedPaneUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import java.util.HashMap;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicTabbedPaneUI;
-
-public class MetalTabbedPaneUI
- extends BasicTabbedPaneUI
-{
-
- /** The shared UI instance for JTabbedPanes. */
- private static HashMap instances = null;
-
- /**
- * Constructs a new instance of MetalTabbedPaneUI.
- */
- public MetalTabbedPaneUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalTabbedPaneUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalTabbedPaneUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instances == null)
- instances = new HashMap();
-
- Object o = instances.get(component);
- MetalTabbedPaneUI instance;
- if (o == null)
- {
- instance = new MetalTabbedPaneUI();
- instances.put(component, instance);
- }
- else
- instance = (MetalTabbedPaneUI) o;
-
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalTextFieldUI.java b/libjava/javax/swing/plaf/metal/MetalTextFieldUI.java
deleted file mode 100644
index d6e50e12239..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalTextFieldUI.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* MetalTextFieldUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import java.util.HashMap;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicTextFieldUI;
-
-public class MetalTextFieldUI
- extends BasicTextFieldUI
-{
-
- /** The UI instances for MetalTextFieldUIs */
- private static HashMap instances = null;
-
- /**
- * Constructs a new instance of MetalTextFieldUI.
- */
- public MetalTextFieldUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalTextFieldUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalTextFieldUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instances == null)
- instances = new HashMap();
-
- Object o = instances.get(component);
- MetalTextFieldUI instance;
- if (o == null)
- {
- instance = new MetalTextFieldUI();
- instances.put(component, instance);
- }
- else
- instance = (MetalTextFieldUI) o;
-
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalTheme.java b/libjava/javax/swing/plaf/metal/MetalTheme.java
deleted file mode 100644
index 170467b9d3d..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalTheme.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/* MetalTheme.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import java.awt.Color;
-
-import javax.swing.UIDefaults;
-import javax.swing.plaf.ColorUIResource;
-import javax.swing.plaf.FontUIResource;
-
-public abstract class MetalTheme
-{
- private ColorUIResource BLACK = new ColorUIResource(Color.BLACK);
- private ColorUIResource WHITE = new ColorUIResource(Color.WHITE);
-
- public MetalTheme()
- {
- // Do nothing here.
- }
-
- public abstract String getName();
-
- public void addCustomEntriesToTable(UIDefaults table)
- {
- // Do nothing here.
- // This method needs to be overloaded to actuall do something.
- }
-
- public ColorUIResource getAcceleratorForeground()
- {
- return getPrimary1();
- }
-
- public ColorUIResource getAcceleratorSelectedForeground()
- {
- return getBlack();
- }
-
- public ColorUIResource getControl()
- {
- return getSecondary3();
- }
-
- public ColorUIResource getControlDarkShadow()
- {
- return getSecondary1();
- }
-
- public ColorUIResource getControlDisabled()
- {
- return getSecondary2();
- }
-
- public ColorUIResource getControlHighlight()
- {
- return getWhite();
- }
-
- public ColorUIResource getControlInfo()
- {
- return getBlack();
- }
-
- public ColorUIResource getControlShadow()
- {
- return getSecondary2();
- }
-
- public ColorUIResource getControlTextColor()
- {
- return getControlInfo();
- }
-
- public ColorUIResource getDesktopColor()
- {
- return getPrimary2();
- }
-
- public ColorUIResource getFocusColor()
- {
- return getPrimary2();
- }
-
- public ColorUIResource getHighlightedTextColor()
- {
- return getControlTextColor();
- }
-
- public ColorUIResource getInactiveControlTextColor()
- {
- return getControlDisabled();
- }
-
- public ColorUIResource getInactiveSystemTextColor()
- {
- return getSecondary2();
- }
-
- public ColorUIResource getMenuBackground()
- {
- return getSecondary3();
- }
-
- public ColorUIResource getMenuDisabledForeground()
- {
- return getSecondary3();
- }
-
- public ColorUIResource getMenuForeground()
- {
- return getBlack();
- }
-
- public ColorUIResource getMenuSelectedBackground()
- {
- return getPrimary2();
- }
-
- public ColorUIResource getMenuSelectedForeground()
- {
- return getBlack();
- }
-
- public ColorUIResource getPrimaryControl()
- {
- return getPrimary3();
- }
-
- public ColorUIResource getPrimaryControlDarkShadow()
- {
- return getPrimary1();
- }
-
- public ColorUIResource getPrimaryControlHighlight()
- {
- return getWhite();
- }
-
- public ColorUIResource getPrimaryControlInfo()
- {
- return getBlack();
- }
-
- public ColorUIResource getPrimaryControlShadow()
- {
- return getPrimary2();
- }
-
- public ColorUIResource getSeparatorBackground()
- {
- return getWhite();
- }
-
- public ColorUIResource getSeparatorForeground()
- {
- return getPrimary1();
- }
-
- public ColorUIResource getSystemTextColor()
- {
- return getBlack();
- }
-
- public ColorUIResource getTextHighlightColor()
- {
- return getPrimary3();
- }
-
- public ColorUIResource getUserTextColor()
- {
- return getBlack();
- }
-
- public ColorUIResource getWindowBackground()
- {
- return getWhite();
- }
-
- public ColorUIResource getWindowTitleBackground()
- {
- return getPrimary3();
- }
-
- public ColorUIResource getWindowTitleForeground()
- {
- return getBlack();
- }
-
- public ColorUIResource getWindowTitleInactiveBackground()
- {
- return getSecondary3();
- }
-
- public ColorUIResource getWindowTitleInactiveForeground()
- {
- return getBlack();
- }
-
- protected ColorUIResource getBlack()
- {
- return BLACK;
- }
-
- protected ColorUIResource getWhite()
- {
- return WHITE;
- }
-
- protected abstract ColorUIResource getPrimary1();
- protected abstract ColorUIResource getPrimary2();
- protected abstract ColorUIResource getPrimary3();
- protected abstract ColorUIResource getSecondary1();
- protected abstract ColorUIResource getSecondary2();
- protected abstract ColorUIResource getSecondary3();
-
- public abstract FontUIResource getControlTextFont();
- public abstract FontUIResource getMenuTextFont();
- public abstract FontUIResource getSubTextFont();
- public abstract FontUIResource getSystemTextFont();
- public abstract FontUIResource getUserTextFont();
- public abstract FontUIResource getWindowTitleFont();
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalToggleButtonUI.java b/libjava/javax/swing/plaf/metal/MetalToggleButtonUI.java
deleted file mode 100644
index 7913cdb83e9..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalToggleButtonUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalToggleButtonUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicToggleButtonUI;
-
-public class MetalToggleButtonUI
- extends BasicToggleButtonUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for MetalToggleButtonUIs */
- private static MetalToggleButtonUI instance = null;
-
- /**
- * Constructs a new instance of MetalToggleButtonUI.
- */
- public MetalToggleButtonUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalToggleButtonUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalToggleButtonUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalToggleButtonUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalToolBarUI.java b/libjava/javax/swing/plaf/metal/MetalToolBarUI.java
deleted file mode 100644
index 39af0011ae6..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalToolBarUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalToolBarUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicToolBarUI;
-
-public class MetalToolBarUI
- extends BasicToolBarUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for MetalToolBarUIs */
- private static MetalToolBarUI instance = null;
-
- /**
- * Constructs a new instance of MetalToolBarUI.
- */
- public MetalToolBarUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalToolBarUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalToolBarUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalToolBarUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalToolTipUI.java b/libjava/javax/swing/plaf/metal/MetalToolTipUI.java
deleted file mode 100644
index c88b6534ab7..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalToolTipUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalToolTipUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicToolTipUI;
-
-public class MetalToolTipUI
- extends BasicToolTipUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for MetalToolTipUIs */
- private static MetalToolTipUI instance = null;
-
- /**
- * Constructs a new instance of MetalToolTipUI.
- */
- public MetalToolTipUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalToolTipUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalToolTipUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalToolTipUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/plaf/metal/MetalTreeUI.java b/libjava/javax/swing/plaf/metal/MetalTreeUI.java
deleted file mode 100644
index dabc96be617..00000000000
--- a/libjava/javax/swing/plaf/metal/MetalTreeUI.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* MetalTreeUI.java
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.plaf.metal;
-
-import javax.swing.JComponent;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicTreeUI;
-
-public class MetalTreeUI
- extends BasicTreeUI
-{
-
- // FIXME: maybe replace by a Map of instances when this becomes stateful
- /** The shared UI instance for MetalTreeUIs */
- private static MetalTreeUI instance = null;
-
- /**
- * Constructs a new instance of MetalTreeUI.
- */
- public MetalTreeUI()
- {
- super();
- }
-
- /**
- * Returns an instance of MetalTreeUI.
- *
- * @param component the component for which we return an UI instance
- *
- * @return an instance of MetalTreeUI
- */
- public static ComponentUI createUI(JComponent component)
- {
- if (instance == null)
- instance = new MetalTreeUI();
- return instance;
- }
-}
diff --git a/libjava/javax/swing/table/AbstractTableModel.java b/libjava/javax/swing/table/AbstractTableModel.java
deleted file mode 100644
index 9eb83ac8ad3..00000000000
--- a/libjava/javax/swing/table/AbstractTableModel.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/* AbstractTableModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.table;
-
-import java.io.Serializable;
-import java.util.EventListener;
-
-import javax.swing.event.EventListenerList;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-
-/**
- * AbstractTableModel
- *
- * @author Andrew Selkirk
- */
-public abstract class AbstractTableModel implements TableModel, Serializable
-{
- static final long serialVersionUID = -5798593159423650347L;
-
- /**
- * listenerList
- */
- protected EventListenerList listenerList = new EventListenerList();
-
- /**
- * Constructor AbstractTableModel
- */
- public AbstractTableModel()
- {
- // TODO
- }
-
- /**
- * Get the name of the column for this index. If you do not override
- * this methode, you'll get something like: 0, A; 1, B; ...; AA; AB;
- * ...
- *
- * @param columnIndex The index of the column.
- *
- * @return The name of the column.
- */
- public String getColumnName (int columnIndex)
- {
- int index = columnIndex + 1;
- StringBuffer buffer = new StringBuffer();
-
- while (index > 0)
- {
- buffer.insert (0, (char) ('A' + ((index - 1) % 26)));
- index = (index - 1) / 26;
- }
-
- // Return column name.
- return buffer.toString();
- }
-
- /**
- * Return the index of the given name.
- *
- * @param columnName The name of the column.
- *
- * @return The index of the column, -1 if not found.
- */
- public int findColumn (String columnName)
- {
- int count = getColumnCount();
-
- for (int index = 0; index < count; index++)
- {
- String name = getColumnName (index);
-
- if (name.equals (columnName))
- return index;
- }
-
- // Unable to locate.
- return -1;
- }
-
- /**
- * Returns the class of a comlumn.
- *
- * @param columnIndex The index of the column.
- *
- * @return The class type of the column.
- */
- public Class getColumnClass (int columnIndex)
- {
- return Object.class;
- }
-
- /**
- * Tells whether a cell is editable.
- *
- * @param rowIndex The row of the cell.
- * @param columnIndex The index of the cell.
- *
- * @return True if cell is editable.
- */
- public boolean isCellEditable (int rowIndex, int columnIndex)
- {
- return false;
- }
-
- /**
- * Sets a cell to a value.
- *
- * @param value New value of cell.
- * @param rowIndex The row of the cell.
- * @param columnIndex The column of the cell.
- */
- public void setValueAt (Object value, int rowIndex, int columnIndex)
- {
- // Do nothing...
- }
-
- /**
- * Add a TableModelListener.
- *
- * @param listener The listener to add.
- */
- public void addTableModelListener (TableModelListener listener)
- {
- listenerList.add (TableModelListener.class, listener);
- }
-
- /**
- * Removes a TableModelListener.
- *
- * @param listener The listener to remove.
- */
- public void removeTableModelListener (TableModelListener listener)
- {
- listenerList.remove (TableModelListener.class, listener);
- }
-
- /**
- * Return all registered TableModelListener objects.
- *
- * @return Array of TableModelListener objects.
- *
- * @since 1.4
- */
- public TableModelListener[] getTableModelListeners()
- {
- return (TableModelListener[])
- listenerList.getListeners (TableModelListener.class);
- }
-
- /**
- * fireTableDataChanged
- */
- public void fireTableDataChanged()
- {
- fireTableChanged (new TableModelEvent (this));
- }
-
- /**
- * fireTableStructureChanged
- */
- public void fireTableStructureChanged()
- {
- fireTableChanged (new TableModelEvent (this, TableModelEvent.HEADER_ROW));
- }
-
- /**
- * fireTableRowsInserted
- * @param value0 TODO
- * @param value1 TODO
- */
- public void fireTableRowsInserted (int firstRow, int lastRow)
- {
- fireTableChanged (new TableModelEvent (this, firstRow, lastRow,
- TableModelEvent.ALL_COLUMNS,
- TableModelEvent.INSERT));
- }
-
- /**
- * fireTableRowsUpdated
- * @param value0 TODO
- * @param value1 TODO
- */
- public void fireTableRowsUpdated (int firstRow, int lastRow)
- {
- fireTableChanged (new TableModelEvent (this, firstRow, lastRow,
- TableModelEvent.ALL_COLUMNS,
- TableModelEvent.UPDATE));
- }
-
- /**
- * fireTableRowsDeleted
- * @param value0 TODO
- * @param value1 TODO
- */
- public void fireTableRowsDeleted(int firstRow, int lastRow)
- {
- fireTableChanged (new TableModelEvent (this, firstRow, lastRow,
- TableModelEvent.ALL_COLUMNS,
- TableModelEvent.DELETE));
- }
-
- /**
- * fireTableCellUpdated
- * @param value0 TODO
- * @param value1 TODO
- */
- public void fireTableCellUpdated (int row, int column)
- {
- fireTableChanged (new TableModelEvent (this, row, row, column));
- }
-
- /**
- * fireTableChanged
- * @param value0 TODO
- */
- public void fireTableChanged (TableModelEvent event)
- {
- int index;
- TableModelListener listener;
- Object[] list = listenerList.getListenerList();
-
- for (index = 0; index < list.length; index += 2)
- {
- listener = (TableModelListener) list [index + 1];
- listener.tableChanged (event);
- }
- }
-
- /**
- * getListeners
- * @param value0 TODO
- * @return EventListener[]
- */
- public EventListener[] getListeners (Class listenerType)
- {
- return listenerList.getListeners (listenerType);
- }
-}
diff --git a/libjava/javax/swing/table/DefaultTableCellRenderer.java b/libjava/javax/swing/table/DefaultTableCellRenderer.java
deleted file mode 100644
index 4b53858fb90..00000000000
--- a/libjava/javax/swing/table/DefaultTableCellRenderer.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/* DefaultTableCellRenderer.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.table;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Rectangle;
-import java.io.Serializable;
-
-import javax.swing.JLabel;
-import javax.swing.JTable;
-import javax.swing.border.Border;
-import javax.swing.border.EmptyBorder;
-
-/**
- * Class to display every cells.
- */
-public class DefaultTableCellRenderer extends JLabel
- implements TableCellRenderer, Serializable
-{
- static final long serialVersionUID = 7878911414715528324L;
-
- protected static Border noFocusBorder = new EmptyBorder(0, 0, 0, 0);
-
- public static class UIResource extends DefaultTableCellRenderer
- implements javax.swing.plaf.UIResource
- {
- public UIResource()
- {
- }
- }
-
- /**
- * Creates a default table cell renderer with an empty border.
- */
- public DefaultTableCellRenderer()
- {
- super();
- }
-
- /**
- * Assign the unselected-foreground.
- *
- * @param c the color to assign
- */
- public void setForeground(Color c)
- {
- super.setForeground(c);
- }
-
- /**
- * Assign the unselected-background.
- *
- * @param c the color to assign
- */
- public void setBackground(Color c)
- {
- super.setBackground(c);
- }
-
- /**
- * Look and feel has changed.
- *
- * <p>Replaces the current UI object with the latest version from
- * the UIManager.</p>
- */
- public void updateUI()
- {
- super.updateUI();
- }
-
- /**
- * Get the string value of the object and pass it to setText().
- *
- * @param table the JTable
- * @param value the value of the object
- * @param isSelected is the cell selected?
- * @param hasFocus has the cell the focus?
- * @param row the row to render
- * @param column the cell to render
- *
- * @return this component (the default table cell renderer)
- */
- public Component getTableCellRendererComponent(JTable table, Object value,
- boolean isSelected,
- boolean hasFocus,
- int row, int column)
- {
- if (value!=null)
- super.setText(value.toString());
-
- setOpaque(true);
- if (isSelected)
- {
- setBackground(table.getSelectionBackground());
- setForeground(table.getSelectionForeground());
- }
- else
- {
- setBackground(table.getBackground());
- setForeground(table.getForeground());
- }
-
- setEnabled(table.isEnabled());
- setFont(table.getFont());
- return this;
- }
-
- /**
- * Overriden for performance.
- *
- * <p>This method needs to be overridden in a subclass to actually
- * do something.</p>
- *
- * @return always true
- */
- public boolean isOpaque()
- {
- return true;
- }
-
- /**
- * Overriden for performance.
- *
- * <p>This method needs to be overridden in a subclass to actually
- * do something.</p>
- */
- public void validate()
- {
- // Does nothing.
- }
-
- public void revalidate()
- {
- // Does nothing.
- }
-
- /**
- * Overriden for performance.
- *
- * <p>This method needs to be overridden in a subclass to actually
- * do something.</p>
- */
- public void repaint(long tm, int x, int y, int width, int height)
- {
- // Does nothing.
- }
-
- /**
- * Overriden for performance.
- *
- * <p>This method needs to be overridden in a subclass to actually
- * do something.</p>
- */
- public void repaint(Rectangle r)
- {
- // Does nothing.
- }
-
- /**
- * Overriden for performance.
- *
- * <p>This method needs to be overridden in a subclass to actually
- * do something.</p>
- */
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue)
- {
- // Does nothing.
- }
-
- /**
- * Overriden for performance.
- *
- * <p>This method needs to be overridden in a subclass to actually
- * do something.</p>
- */
- public void firePropertyChange(String propertyName, boolean oldValue,
- boolean newValue)
- {
- // Does nothing.
- }
-
- /**
- * Sets the String for this cell.
- *
- * @param value the string value for this cell; if value is null it
- * sets the text value to an empty string
- */
- protected void setValue(Object value)
- {
- super.setText((value!=null) ? value.toString() : "");
- }
-}
diff --git a/libjava/javax/swing/table/DefaultTableColumnModel.java b/libjava/javax/swing/table/DefaultTableColumnModel.java
deleted file mode 100644
index 8ed85657216..00000000000
--- a/libjava/javax/swing/table/DefaultTableColumnModel.java
+++ /dev/null
@@ -1,542 +0,0 @@
-/* DefaultTableColumnModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.table;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.EventListener;
-import java.util.Vector;
-
-import javax.swing.DefaultListSelectionModel;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.EventListenerList;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableColumnModelEvent;
-import javax.swing.event.TableColumnModelListener;
-
-/**
- * DefaultTableColumnModel
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class DefaultTableColumnModel
- implements TableColumnModel, PropertyChangeListener, ListSelectionListener,
- Serializable
-{
- private static final long serialVersionUID = 6580012493508960512L;
-
- /**
- * Columns that this model keeps track of.
- */
- protected Vector tableColumns;
-
- /**
- * Selection Model that keeps track of columns selection
- */
- protected ListSelectionModel selectionModel;
-
- /**
- * Space between two columns. By default it is set to 1
- */
- protected int columnMargin;
-
- /**
- * listenerList keeps track of all listeners registered with this model
- */
- protected EventListenerList listenerList = new EventListenerList();
-
- /**
- * changeEvent is fired when change occurs in one of the columns properties
- */
- protected transient ChangeEvent changeEvent = new ChangeEvent(this);
-
- /**
- * Indicates whether columns can be selected
- */
- protected boolean columnSelectionAllowed;
-
- /**
- * Total width of all the columns in this model
- */
- protected int totalColumnWidth;
-
- /**
- * Constructor DefaultTableColumnModel
- */
- public DefaultTableColumnModel()
- {
- tableColumns = new Vector();
- setSelectionModel(createSelectionModel());
- columnMargin = 1;
- columnSelectionAllowed = false;
- }
-
- /**
- * addColumn adds column to the model. This method fires ColumnAdded
- * event to model's registered TableColumnModelListeners.
- *
- * @param col column to add
- */
- public void addColumn(TableColumn col)
- {
- tableColumns.add(col);
- invalidateWidthCache();
- fireColumnAdded(new TableColumnModelEvent(this,0,tableColumns.size()));
- }
-
- /**
- * removeColumn removes table column from the model. This method fires
- * ColumnRemoved event to model's registered TableColumnModelListeners.
- *
- * @param col column to be removed
- */
- public void removeColumn(TableColumn col)
- {
- int index = getColumnIndex(col);
- fireColumnRemoved(new TableColumnModelEvent(this,index,0));
- tableColumns.remove(col);
- invalidateWidthCache();
- }
-
- /**
- * moveColumn moves column at index i to index j. This method fires
- * ColumnMoved event to model's registered TableColumnModelListeners.
- *
- * @param i index of the column that will be moved
- * @param j index of column's new location
- */
- public void moveColumn(int i, int j)
- {
- Object tmp = tableColumns.get(i);
- tableColumns.set(i, tableColumns.get(j));
- tableColumns.set(j, tmp);
- fireColumnAdded(new TableColumnModelEvent(this,i,j));
- }
-
- /**
- * setColumnMargin sets margin of the columns.
- * @param m new column margin
- */
- public void setColumnMargin(int m)
- {
- columnMargin = m;
- fireColumnMarginChanged();
- }
-
- /**
- * getColumnCount returns number of columns in the model
- * @return int number of columns in the model
- */
- public int getColumnCount()
- {
- return tableColumns.size();
- }
-
- /**
- * getColumns
- * @return Enumeration
- */
- public Enumeration getColumns()
- {
- return tableColumns.elements();
- }
-
- /**
- * getColumnIndex returns index of the specified column
- *
- * @param identifier identifier of the column
- * @return int index of the given column
- */
- public int getColumnIndex(Object identifier)
- {
- return tableColumns.indexOf(identifier, 0);
- }
-
- /**
- * getColumn returns column at the specified index
- * @param i index of the column
- * @return TableColumn column at the specified index
- */
- public TableColumn getColumn(int i)
- {
- return (TableColumn) tableColumns.get(i);
- }
-
- /**
- * getColumnMargin returns column margin
- * @return int column margin
- */
- public int getColumnMargin()
- {
- return columnMargin;
- }
-
- /**
- * getColumnIndexAtX returns column that contains specified x-coordinate.
- * @param x x-coordinate that column should contain
- * @return int index of the column that contains specified x-coordinate relative
- * to this column model
- */
- public int getColumnIndexAtX(int x)
- {
- for (int i = 0; i < tableColumns.size(); ++i)
- {
- int w = ((TableColumn)tableColumns.get(i)).getWidth();
- if (0 <= x && x < w)
- return i;
- else
- x -= w;
- }
- return -1;
- }
-
- /**
- * getTotalColumnWidth returns total width of all the columns including
- * column's margins.
- *
- * @return total width of all the columns
- */
- public int getTotalColumnWidth()
- {
- if (totalColumnWidth == -1)
- recalcWidthCache();
- return totalColumnWidth;
- }
-
- /**
- * setSelectionModel sets selection model that will be used by this ColumnTableModel
- * to keep track of currently selected columns
- *
- * @param model new selection model
- * @exception IllegalArgumentException if model is null
- */
- public void setSelectionModel(ListSelectionModel model)
- {
- if (model == null)
- throw new IllegalArgumentException();
-
- selectionModel = model;
- selectionModel.addListSelectionListener(this);
- }
-
- /**
- * getSelectionModel returns selection model
- * @return ListSelectionModel selection model
- */
- public ListSelectionModel getSelectionModel()
- {
- return selectionModel;
- }
-
- /**
- * setColumnSelectionAllowed sets whether column selection is allowed
- * or not.
- *
- * @param flag true if column selection is allowed and false otherwise
- */
- public void setColumnSelectionAllowed(boolean flag)
- {
- columnSelectionAllowed = flag;
- }
-
- /**
- * getColumnSelectionAllowed indicates whether column selection is
- * allowed or not.
- *
- * @return boolean true if column selection is allowed and false otherwise.
- */
- public boolean getColumnSelectionAllowed()
- {
- return columnSelectionAllowed;
- }
-
- /**
- * getSelectedColumns returns array containing indexes of currently
- * selected columns
- *
- * @return int[] array containing indexes of currently selected columns
- */
- public int[] getSelectedColumns()
- {
- // FIXME: Implementation of this method was taken from private method
- // JTable.getSelections(), which is used in various places in JTable
- // including selected row calculations and cannot be simply removed.
- // This design should be improved to illuminate duplication of code.
-
- ListSelectionModel lsm = this.selectionModel;
- int sz = getSelectedColumnCount();
- int [] ret = new int[sz];
-
- int lo = lsm.getMinSelectionIndex();
- int hi = lsm.getMaxSelectionIndex();
- int j = 0;
- java.util.ArrayList ls = new java.util.ArrayList();
- if (lo != -1 && hi != -1)
- {
- switch (lsm.getSelectionMode())
- {
- case ListSelectionModel.SINGLE_SELECTION:
- ret[0] = lo;
- break;
-
- case ListSelectionModel.SINGLE_INTERVAL_SELECTION:
- for (int i = lo; i <= hi; ++i)
- ret[j++] = i;
- break;
-
- case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:
- for (int i = lo; i <= hi; ++i)
- if (lsm.isSelectedIndex(i))
- ret[j++] = i;
- break;
- }
- }
- return ret;
- }
-
- /**
- * getSelectedColumnCount returns number of currently selected columns
- * @return int number of currently selected columns
- */
- public int getSelectedColumnCount()
- {
- // FIXME: Implementation of this method was taken from private method
- // JTable.countSelections(), which is used in various places in JTable
- // including selected row calculations and cannot be simply removed.
- // This design should be improved to illuminate duplication of code.
-
- ListSelectionModel lsm = this.selectionModel;
- int lo = lsm.getMinSelectionIndex();
- int hi = lsm.getMaxSelectionIndex();
- int sum = 0;
-
- if (lo != -1 && hi != -1)
- {
- switch (lsm.getSelectionMode())
- {
- case ListSelectionModel.SINGLE_SELECTION:
- sum = 1;
- break;
-
- case ListSelectionModel.SINGLE_INTERVAL_SELECTION:
- sum = hi - lo + 1;
- break;
-
- case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:
- for (int i = lo; i <= hi; ++i)
- if (lsm.isSelectedIndex(i))
- ++sum;
- break;
- }
- }
-
- return sum;
- }
-
- /**
- * addColumnModelListener adds specified listener to the model's
- * listener list
- *
- * @param listener the listener to add
- */
- public void addColumnModelListener(TableColumnModelListener listener)
- {
- listenerList.add(TableColumnModelListener.class, listener);
- }
-
- /**
- * removeColumnModelListener removes specified listener from the model's
- * listener list.
- *
- * @param listener the listener to remove
- */
- public void removeColumnModelListener(TableColumnModelListener listener)
- {
- listenerList.remove(TableColumnModelListener.class, listener);
- }
-
- /**
- * @since 1.4
- */
- public TableColumnModelListener[] getColumnModelListeners()
- {
- return (TableColumnModelListener[])
- listenerList.getListeners(TableColumnModelListener.class);
- }
-
- /**
- * fireColumnAdded fires TableColumnModelEvent to registered
- * TableColumnModelListeners to indicate that column was added
- *
- * @param e TableColumnModelEvent
- */
- protected void fireColumnAdded(TableColumnModelEvent e)
- {
- TableColumnModelListener[] listeners = getColumnModelListeners();
-
- for (int i=0; i< listeners.length; i++)
- listeners[i].columnAdded(e);
- }
-
- /**
- * fireColumnAdded fires TableColumnModelEvent to registered
- * TableColumnModelListeners to indicate that column was removed
- *
- * @param e TableColumnModelEvent
- */
- protected void fireColumnRemoved(TableColumnModelEvent e)
- {
- TableColumnModelListener[] listeners = getColumnModelListeners();
-
- for (int i=0; i< listeners.length; i++)
- listeners[i].columnRemoved(e);
- }
-
- /**
- * fireColumnAdded fires TableColumnModelEvent to registered
- * TableColumnModelListeners to indicate that column was moved
- *
- * @param e TableColumnModelEvent
- */
- protected void fireColumnMoved(TableColumnModelEvent e)
- {
- TableColumnModelListener[] listeners = getColumnModelListeners();
-
- for (int i=0; i< listeners.length; i++)
- listeners[i].columnMoved(e);
- }
-
- /**
- * fireColumnSelectionChanged fires TableColumnModelEvent to model's
- * registered TableColumnModelListeners to indicate that different column
- * was selected.
- *
- * @param evt ListSelectionEvent
- */
- protected void fireColumnSelectionChanged(ListSelectionEvent evt)
- {
- EventListener [] listeners = getListeners(TableColumnModelListener.class);
- for (int i = 0; i < listeners.length; ++i)
- ((TableColumnModelListener)listeners[i]).columnSelectionChanged(evt);
- }
-
- /**
- * fireColumnMarginChanged fires TableColumnModelEvent to model's
- * registered TableColumnModelListeners to indicate that column margin
- * was changed.
- */
- protected void fireColumnMarginChanged()
- {
- EventListener [] listeners = getListeners(TableColumnModelListener.class);
- for (int i = 0; i < listeners.length; ++i)
- ((TableColumnModelListener)listeners[i]).columnMarginChanged(changeEvent);
- }
-
- /**
- * getListeners returns currently registered listeners with this model.
- * @param listenerType type of listeners to return
- *
- * @return EventListener[] array of model's listeners of the specified type
- */
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
- /**
- * propertyChange handles changes occuring in the properties of the
- * model's columns.
- *
- * @param evt PropertyChangeEvent
- */
- public void propertyChange(PropertyChangeEvent evt)
- {
- if (evt.getPropertyName().equals(TableColumn.COLUMN_WIDTH_PROPERTY))
- invalidateWidthCache();
- }
-
- /**
- * valueChanged handles changes in the selectionModel.
- * @param e ListSelectionEvent
- */
- public void valueChanged(ListSelectionEvent e)
- {
- fireColumnSelectionChanged(e);
- }
-
- /**
- * createSelectionModel creates selection model that will keep track
- * of currently selected column(s)
- *
- * @return ListSelectionModel selection model of the columns
- */
- protected ListSelectionModel createSelectionModel()
- {
- return new DefaultListSelectionModel();
- }
-
- /**
- * recalcWidthCache calculates total width of the columns.
- * If the current cache of the total width is in invalidated state,
- * then width is recalculated. Otherwise nothing is done.
- */
- protected void recalcWidthCache()
- {
- if (totalColumnWidth == -1)
- {
- totalColumnWidth = 0;
- for (int i = 0; i < tableColumns.size(); ++i)
- {
- totalColumnWidth += ((TableColumn)tableColumns.get(i)).getWidth();
- }
- }
- }
-
- /**
- * invalidateWidthCache
- */
- private void invalidateWidthCache()
- {
- totalColumnWidth = -1;
- }
-}
diff --git a/libjava/javax/swing/table/DefaultTableModel.java b/libjava/javax/swing/table/DefaultTableModel.java
deleted file mode 100644
index cc6f3dc11df..00000000000
--- a/libjava/javax/swing/table/DefaultTableModel.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/* DefaultTableModel.java --
- Copyright (C) 2002, 2004, 2005, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.table;
-
-import java.io.Serializable;
-import java.util.Vector;
-
-import javax.swing.event.TableModelEvent;
-
-/**
- * A two dimensional data structure used to store <code>Object</code>
- * instances, usually for display in a <code>JTable</code> component.
- *
- * @author Andrew Selkirk
- */
-public class DefaultTableModel extends AbstractTableModel
- implements Serializable
-{
- static final long serialVersionUID = 6680042567037222321L;
-
- /**
- * Storage for the rows in the table (each row is itself
- * a <code>Vector</code>).
- */
- protected Vector dataVector;
-
- /**
- * columnIdentifiers
- */
- protected Vector columnIdentifiers;
-
- /**
- * Creates an empty table with zero rows and zero columns.
- */
- public DefaultTableModel()
- {
- this(0, 0);
- }
-
- /**
- * Creates a new table with the specified number of rows and columns.
- * All cells in the table are initially empty (set to <code>null</code>).
- *
- * @param numRows the number of rows.
- * @param numColumns the number of columns.
- */
- public DefaultTableModel(int numRows, int numColumns)
- {
- Vector defaultNames = new Vector(numColumns);
- Vector data = new Vector(numRows);
- for (int i = 0; i < numColumns; i++)
- {
- defaultNames.add(super.getColumnName(i));
- }
- for (int r = 0; r < numRows; r++)
- {
- Vector tmp = new Vector(numColumns);
- tmp.setSize(numColumns);
- data.add(tmp);
- }
- setDataVector(data, defaultNames);
- }
-
- /**
- * Creates a new table with the specified column names and number of
- * rows. The number of columns is determined by the number of column
- * names supplied.
- *
- * @param columnNames the column names.
- * @param numRows the number of rows.
- */
- public DefaultTableModel(Vector columnNames, int numRows)
- {
- if (numRows < 0)
- throw new IllegalArgumentException("numRows < 0");
- Vector data = new Vector();
- int numColumns = 0;
-
- if (columnNames != null)
- numColumns = columnNames.size();
-
- while (0 < numRows--)
- {
- Vector rowData = new Vector();
- rowData.setSize(numColumns);
- data.add(rowData);
- }
- setDataVector(data, columnNames);
- }
-
- /**
- * Creates a new table with the specified column names and row count.
- *
- * @param columnNames the column names.
- * @param numRows the number of rows.
- */
- public DefaultTableModel(Object[] columnNames, int numRows)
- {
- this(convertToVector(columnNames), numRows);
- }
-
- /**
- * Creates a new table with the specified data values and column names.
- *
- * @param data the data values.
- * @param columnNames the column names.
- */
- public DefaultTableModel(Vector data, Vector columnNames)
- {
- setDataVector(data, columnNames);
- }
-
- /**
- * Creates a new table with the specified data values and column names.
- *
- * @param data the data values.
- * @param columnNames the column names.
- */
- public DefaultTableModel(Object[][] data, Object[] columnNames)
- {
- this(convertToVector(data), convertToVector(columnNames));
- }
-
- /**
- * Returns the vector containing the row data for the table.
- *
- * @returns The data vector.
- */
- public Vector getDataVector()
- {
- return dataVector;
- }
-
- /**
- * Sets the data and column identifiers for the table. The data vector
- * contains a <code>Vector</code> for each row in the table - if the
- * number of objects in each row does not match the number of column
- * names specified, the row data is truncated or expanded (by adding
- * <code>null</code> values) as required.
- *
- * @param data the data for the table (a vector of row vectors).
- * @param columnNames the column names.
- *
- * @throws NullPointerException if either argument is <code>null</code>.
- */
- public void setDataVector(Vector data, Vector columnNames)
- {
- dataVector = data;
- columnIdentifiers = columnNames;
- for (int r = 0; r < data.size(); r++) {
- ((Vector) dataVector.get(r)).setSize(columnNames.size());
- }
- }
-
- /**
- * Sets the data and column identifiers for the table.
- *
- * @param data the data for the table.
- * @param columnNames the column names.
- *
- * @throws NullPointerException if either argument is <code>null</code>.
- */
- public void setDataVector(Object[][] data, Object[] columnNames)
- {
- setDataVector(convertToVector(data),
- convertToVector(columnNames));
- }
-
- /**
- * Sends the specified <code>event</code> to all registered listeners.
- * This method is equivalent to
- * {@link AbstractTableModel#fireTableChanged(TableModelEvent)}.
- *
- * @param event the event.
- */
- public void newDataAvailable(TableModelEvent event)
- {
- fireTableChanged(event);
- }
-
- /**
- * Sends the specified <code>event</code> to all registered listeners.
- * This method is equivalent to
- * {@link AbstractTableModel#fireTableChanged(TableModelEvent)}.
- *
- * @param event the event.
- */
- public void newRowsAdded(TableModelEvent event)
- {
- fireTableChanged(event);
- }
-
- /**
- * Sends the specified <code>event</code> to all registered listeners.
- * This method is equivalent to
- * {@link AbstractTableModel#fireTableChanged(TableModelEvent)}.
- *
- * @param event the event.
- */
- public void rowsRemoved(TableModelEvent event)
- {
- fireTableChanged(event);
- }
-
- /**
- * Sets the column identifiers, updates the data rows (truncating
- * or padding each row with <code>null</code> values) to match the
- * number of columns, and sends a {@link TableModelEvent} to all
- * registered listeners.
- *
- * @param columnIdentifiers the column identifiers.
- */
- public void setColumnIdentifiers(Vector columnIdentifiers)
- {
- this.columnIdentifiers = columnIdentifiers;
- setColumnCount((columnIdentifiers == null ? 0 : columnIdentifiers.size()));
- }
-
- /**
- * Sets the column identifiers, updates the data rows (truncating
- * or padding each row with <code>null</code> values) to match the
- * number of columns, and sends a {@link TableModelEvent} to all
- * registered listeners.
- *
- * @param columnIdentifiers the column identifiers.
- */
- public void setColumnIdentifiers(Object[] columnIdentifiers)
- {
- setColumnIdentifiers(convertToVector(columnIdentifiers));
- }
-
- /**
- * This method is obsolete, use {@link #setRowCount(int)} instead.
- *
- * @param numRows the number of rows.
- */
- public void setNumRows(int numRows)
- {
- setRowCount(numRows);
- }
-
- /**
- * Sets the number of rows in the table. If <code>rowCount</code> is less
- * than the current number of rows in the table, rows are discarded.
- * If <code>rowCount</code> is greater than the current number of rows in
- * the table, new (empty) rows are added.
- *
- * @param the row count.
- */
- public void setRowCount(int rowCount)
- {
- int existingRowCount = dataVector.size();
- if (rowCount < existingRowCount)
- {
- dataVector.setSize(rowCount);
- fireTableRowsDeleted(rowCount,existingRowCount-1);
- }
- else
- {
- int rowsToAdd = rowCount - existingRowCount;
- for (int i = 0; i < rowsToAdd; i++)
- {
- Vector tmp = new Vector();
- tmp.setSize(columnIdentifiers.size());
- dataVector.add(tmp);
- }
- fireTableRowsInserted(existingRowCount,rowCount-1);
- }
- }
-
- /**
- * Sets the number of columns in the table. Existing rows are truncated
- * or padded with <code>null</code> values to match the new column count.
- * A {@link TableModelEvent} is sent to all registered listeners.
- *
- * @param columnCount the column count.
- */
- public void setColumnCount(int columnCount)
- {
- for (int i = 0; i < dataVector.size(); ++i)
- {
- ((Vector) dataVector.get(i)).setSize(columnCount);
- }
- if (columnIdentifiers != null)
- columnIdentifiers.setSize(columnCount);
- fireTableDataChanged();
- }
-
- /**
- * Adds a column with the specified name to the table. All cell values
- * for the column are initially set to <code>null</code>.
- *
- * @param columnName the column name (<code>null</code> permitted).
- */
- public void addColumn(Object columnName)
- {
- addColumn(columnName, (Object[]) null);
- }
-
- /**
- * Adds a column with the specified name and data values to the table.
- *
- * @param columnName the column name (<code>null</code> permitted).
- * @param columnData the column data.
- */
- public void addColumn(Object columnName, Vector columnData)
- {
- Object[] dataArray = null;
- if (columnData != null)
- {
- int rowCount = dataVector.size();
- if (columnData.size() < rowCount)
- columnData.setSize(rowCount);
- dataArray = columnData.toArray();
- }
- addColumn(columnName, dataArray);
- }
-
- /**
- * Adds a column with the specified name and data values to the table.
- *
- * @param columnName the column name (<code>null</code> permitted).
- * @param columnData the column data.
- */
- public void addColumn(Object columnName, Object[] columnData) {
- if (columnData != null)
- {
- // check columnData array for cases where the number of items
- // doesn't match the number of rows in the existing table
- if (columnData.length > dataVector.size())
- {
- int rowsToAdd = columnData.length - dataVector.size();
- for (int i = 0; i < rowsToAdd; i++)
- {
- Vector tmp = new Vector();
- tmp.setSize(columnIdentifiers.size());
- dataVector.add(tmp);
- }
- }
- else if (columnData.length < dataVector.size())
- {
- Object[] tmp = new Object[dataVector.size()];
- System.arraycopy(columnData, 0, tmp, 0, columnData.length);
- columnData = tmp;
- }
- }
- for (int i = 0; i < dataVector.size(); ++i)
- {
- ((Vector) dataVector.get(i)).add(columnData == null ? null : columnData[i]);
- }
- columnIdentifiers.add(columnName);
- fireTableDataChanged();
- }
-
- /**
- * Adds a new row containing the specified data to the table and sends a
- * {@link TableModelEvent} to all registered listeners.
- *
- * @param rowData the row data (<code>null</code> permitted).
- */
- public void addRow(Vector rowData) {
- dataVector.add(rowData);
- newRowsAdded(new TableModelEvent(
- this, dataVector.size(), dataVector.size(), -1, TableModelEvent.INSERT)
- );
- }
-
- /**
- * Adds a new row containing the specified data to the table and sends a
- * {@link TableModelEvent} to all registered listeners.
- *
- * @param rowData the row data (<code>null</code> permitted).
- */
- public void addRow(Object[] rowData) {
- addRow(convertToVector(rowData));
- }
-
- /**
- * Inserts a new row into the table.
- *
- * @param row the row index.
- * @param rowData the row data.
- */
- public void insertRow(int row, Vector rowData) {
- dataVector.add(row, rowData);
- fireTableRowsInserted(row,row);
- }
-
- /**
- * Inserts a new row into the table.
- *
- * @param row the row index.
- * @param rowData the row data.
- */
- public void insertRow(int row, Object[] rowData) {
- insertRow(row, convertToVector(rowData));
- }
-
- /**
- * Moves the rows from <code>startIndex</code> to <code>endIndex</code>
- * (inclusive) to the specified row.
- *
- * @param startIndex the start row.
- * @param endIndex the end row.
- * @param toIndex the row to move to.
- */
- public void moveRow(int startIndex, int endIndex, int toIndex) {
- Vector removed = new Vector();
- for (int i = endIndex; i >= startIndex; i--)
- {
- removed.add(this.dataVector.remove(i));
- }
- for (int i = 0; i <= endIndex - startIndex; i++)
- {
- dataVector.insertElementAt(removed.get(i), toIndex);
- }
- fireTableDataChanged();
- }
-
- /**
- * Removes a row from the table and sends a {@link TableModelEvent} to
- * all registered listeners.
- *
- * @param row the row index.
- */
- public void removeRow(int row) {
- dataVector.remove(row);
- fireTableRowsDeleted(row,row);
- }
-
- /**
- * getRowCount
- * @returns int
- */
- public int getRowCount() {
- return dataVector.size();
- }
-
- /**
- * Returns the number of columns in the model.
- *
- * @return The column count.
- */
- public int getColumnCount() {
- return (columnIdentifiers == null ? 0 : columnIdentifiers.size());
- }
-
- /**
- * Returns the name of the specified column.
- *
- * @param column the column index.
- *
- * @returns The column name.
- */
- public String getColumnName(int column) {
- String result = "";
- if (columnIdentifiers == null)
- result = super.getColumnName(column);
- else
- {
- if (column < getColumnCount())
- {
- Object id = columnIdentifiers.get(column);
- if (id != null)
- result = id.toString();
- else
- result = super.getColumnName(column);
- }
- }
- return result;
- }
-
- /**
- * Returns <code>true</code> if the specified cell can be modified, and
- * <code>false</code> otherwise. For this implementation, the method
- * always returns <code>true</code>.
- *
- * @param row the row index.
- * @param column the column index.
- *
- * @returns <code>true</code> in all cases.
- */
- public boolean isCellEditable(int row, int column) {
- return true;
- }
-
- /**
- * Returns the value at the specified cell in the table.
- *
- * @param row the row index.
- * @param column the column index.
- *
- * @returns The value (<code>Object</code>, possibly <code>null</code>) at
- * the specified cell in the table.
- */
- public Object getValueAt(int row, int column) {
- return ((Vector) dataVector.get(row)).get(column);
- }
-
- /**
- * Sets the value for the specified cell in the table and sends a
- * {@link TableModelEvent} to all registered listeners.
- *
- * @param value the value (<code>Object</code>, <code>null</code> permitted).
- * @param row the row index.
- * @param column the column index.
- */
- public void setValueAt(Object value, int row, int column) {
- ((Vector) dataVector.get(row)).set(column, value);
- fireTableCellUpdated(row,column);
- }
-
- /**
- * Converts the data array to a <code>Vector</code>.
- *
- * @param data the data array (<code>null</code> permitted).
- *
- * @returns A vector (or <code>null</code> if the data array
- * is <code>null</code>).
- */
- protected static Vector convertToVector(Object[] data) {
- if (data == null)
- return null;
- Vector vector = new Vector(data.length);
- for (int i = 0; i < data.length; i++)
- vector.add(data[i]);
- return vector;
- }
-
- /**
- * Converts the data array to a <code>Vector</code> of rows.
- *
- * @param the data array (<code>null</code> permitted).
- *
- * @returns A vector (or <code>null</code> if the data array
- * is <code>null</code>.
- */
- protected static Vector convertToVector(Object[][] data) {
- if (data == null)
- return null;
- Vector vector = new Vector(data.length);
- for (int i = 0; i < data.length; i++)
- vector.add(convertToVector(data[i]));
- return vector;
- }
-}
diff --git a/libjava/javax/swing/table/JTableHeader.java b/libjava/javax/swing/table/JTableHeader.java
deleted file mode 100644
index 89d8aa9d7bf..00000000000
--- a/libjava/javax/swing/table/JTableHeader.java
+++ /dev/null
@@ -1,631 +0,0 @@
-/* JTableHeader.java --
- Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.table;
-
-import java.awt.Color;
-import java.awt.Cursor;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.FocusListener;
-import java.beans.PropertyChangeListener;
-import java.util.Locale;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleAction;
-import javax.accessibility.AccessibleComponent;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleSelection;
-import javax.accessibility.AccessibleStateSet;
-import javax.accessibility.AccessibleText;
-import javax.accessibility.AccessibleValue;
-import javax.swing.JComponent;
-import javax.swing.JTable;
-import javax.swing.UIManager;
-import javax.swing.plaf.TableHeaderUI;
-
-public class JTableHeader extends JComponent
-{
- protected class AccessibleJTableHeader extends AccessibleJComponent
- {
- protected class AccessibleJTableHeaderEntry extends AccessibleContext
- implements Accessible, AccessibleComponent
- {
- public AccessibleJTableHeaderEntry(int c, JTableHeader p, JTable t)
- {
- throw new Error("not implemented");
- }
-
- public void addFocusListener(FocusListener l)
- {
- throw new Error("not implemented");
- }
-
- public void addPropertyChangeListener(PropertyChangeListener l)
- {
- throw new Error("not implemented");
- }
-
- public boolean contains(Point p)
- {
- throw new Error("not implemented");
- }
-
- public AccessibleAction getAccessibleAction()
- {
- throw new Error("not implemented");
- }
-
- public Accessible getAccessibleAt(Point p)
- {
- throw new Error("not implemented");
- }
-
- public Accessible getAccessibleChild(int i)
- {
- throw new Error("not implemented");
- }
-
- public int getAccessibleChildrenCount()
- {
- throw new Error("not implemented");
- }
-
- public AccessibleComponent getAccessibleComponent()
- {
- throw new Error("not implemented");
- }
-
- public AccessibleContext getAccessibleContext()
- {
- throw new Error("not implemented");
- }
-
- public String getAccessibleDescription()
- {
- throw new Error("not implemented");
- }
-
- public int getAccessibleIndexInParent()
- {
- throw new Error("not implemented");
- }
-
- public String getAccessibleName()
- {
- throw new Error("not implemented");
- }
-
- public AccessibleRole getAccessibleRole()
- {
- throw new Error("not implemented");
- }
-
- public AccessibleSelection getAccessibleSelection()
- {
- throw new Error("not implemented");
- }
-
- public AccessibleStateSet getAccessibleStateSet()
- {
- throw new Error("not implemented");
- }
-
- public AccessibleText getAccessibleText()
- {
- throw new Error("not implemented");
- }
-
- public AccessibleValue getAccessibleValue()
- {
- throw new Error("not implemented");
- }
-
- public Color getBackground()
- {
- throw new Error("not implemented");
- }
-
- public Rectangle getBounds()
- {
- throw new Error("not implemented");
- }
-
- public Cursor getCursor()
- {
- throw new Error("not implemented");
- }
-
- public Font getFont()
- {
- throw new Error("not implemented");
- }
-
- public FontMetrics getFontMetrics(Font f)
- {
- throw new Error("not implemented");
- }
-
- public Color getForeground()
- {
- throw new Error("not implemented");
- }
-
- public Locale getLocale()
- {
- throw new Error("not implemented");
- }
-
- public Point getLocation()
- {
- throw new Error("not implemented");
- }
-
- public Point getLocationOnScreen()
- {
- throw new Error("not implemented");
- }
-
- public Dimension getSize()
- {
- throw new Error("not implemented");
- }
-
- public boolean isEnabled()
- {
- throw new Error("not implemented");
- }
-
- public boolean isFocusTraversable()
- {
- throw new Error("not implemented");
- }
-
- public boolean isShowing()
- {
- throw new Error("not implemented");
- }
-
- public boolean isVisible()
- {
- throw new Error("not implemented");
- }
-
- public void removeFocusListener(FocusListener l)
- {
- throw new Error("not implemented");
- }
-
- public void removePropertyChangeListener(PropertyChangeListener l)
- {
- throw new Error("not implemented");
- }
-
- public void requestFocus()
- {
- throw new Error("not implemented");
- }
-
- public void setAccessibleDescription(String s)
- {
- throw new Error("not implemented");
- }
-
- public void setAccessibleName(String s)
- {
- throw new Error("not implemented");
- }
-
- public void setBackground(Color c)
- {
- throw new Error("not implemented");
- }
-
- public void setBounds(Rectangle r)
- {
- throw new Error("not implemented");
- }
-
- public void setCursor(Cursor c)
- {
- throw new Error("not implemented");
- }
-
- public void setEnabled(boolean b)
- {
- throw new Error("not implemented");
- }
-
- public void setFont(Font f)
- {
- throw new Error("not implemented");
- }
-
- public void setForeground(Color c)
- {
- throw new Error("not implemented");
- }
-
- public void setLocation(Point p)
- {
- throw new Error("not implemented");
- }
-
- public void setSize(Dimension d)
- {
- throw new Error("not implemented");
- }
-
- public void setVisible(boolean b)
- {
- throw new Error("not implemented");
- }
- };
- }
-
- private static final long serialVersionUID = 5144633983372967710L;
-
- /**
- * The accessibleContext property.
- */
- AccessibleContext accessibleContext;
-
- /**
- * The columnModel property.
- */
- protected TableColumnModel columnModel;
-
- /**
- * The draggedColumn property.
- */
- protected TableColumn draggedColumn;
-
- /**
- * The draggedDistance property.
- */
- protected int draggedDistance;
-
- /**
- * The opaque property.
- */
- boolean opaque;
-
- /**
- * The reorderingAllowed property.
- */
- protected boolean reorderingAllowed;
-
- /**
- * The resizingAllowed property.
- */
- protected boolean resizingAllowed = true;
-
- /**
- * The resizingColumn property.
- */
- protected TableColumn resizingColumn;
-
- /**
- * The table property.
- */
- protected JTable table;
-
- /**
- * The updateTableInRealTime property.
- */
- protected boolean updateTableInRealTime;
-
- TableCellRenderer cellRenderer;
-
- public JTableHeader()
- {
- this(null);
- }
-
- public JTableHeader(TableColumnModel cm)
- {
- accessibleContext = new AccessibleJTableHeader();
- columnModel = cm == null ? createDefaultColumnModel() : cm;
- draggedColumn = null;
- draggedDistance = 0;
- opaque = true;
- reorderingAllowed = true;
- resizingAllowed = true;
- resizingColumn = null;
- table = null;
- updateTableInRealTime = true;
- cellRenderer = createDefaultRenderer();
- updateUI();
- }
-
- protected TableColumnModel createDefaultColumnModel()
- {
- return new DefaultTableColumnModel();
- }
-
- /**
- * Get the value of the {@link #accessibleContext} property.
- *
- * @return The current value of the property
- */
- public AccessibleContext getAccessibleContext()
- {
- return accessibleContext;
- }
-
- /**
- * Get the value of the {@link #columnModel} property.
- *
- * @return The current value of the property
- */
- public TableColumnModel getColumnModel()
- {
- return columnModel;
- }
-
- /**
- * Get the value of the {@link #draggedColumn} property.
- *
- * @return The current value of the property
- */
- public TableColumn getDraggedColumn()
- {
- return draggedColumn;
- }
-
- /**
- * Get the value of the {@link #draggedDistance} property.
- *
- * @return The current value of the property
- */
- public int getDraggedDistance()
- {
- return draggedDistance;
- }
-
- /**
- * Get the value of the {@link #reorderingAllowed} property.
- *
- * @return The current value of the property
- */
- public boolean getReorderingAllowed()
- {
- return reorderingAllowed;
- }
-
- /**
- * Get the value of the {@link #resizingAllowed} property.
- *
- * @return The current value of the property
- */
- public boolean getResizingAllowed()
- {
- return resizingAllowed;
- }
-
- /**
- * Get the value of the {@link #resizingColumn} property.
- *
- * @return The current value of the property
- */
- public TableColumn getResizingColumn()
- {
- return resizingColumn;
- }
-
- /**
- * Get the value of the {@link #table} property.
- *
- * @return The current value of the property
- */
- public JTable getTable()
- {
- return table;
- }
-
- /**
- * Get the value of the {@link #updateTableInRealTime} property.
- *
- * @return The current value of the property
- */
- public boolean getUpdateTableInRealTime()
- {
- return updateTableInRealTime;
- }
-
- /**
- * Get the value of the {@link #opaque} property.
- *
- * @return The current value of the property
- */
- public boolean isOpaque()
- {
- return opaque;
- }
-
- /**
- * Set the value of the {@link #columnModel} property.
- *
- * @param c The new value of the property
- */
- public void setColumnModel(TableColumnModel c)
- {
- columnModel = c;
- }
-
- /**
- * Set the value of the {@link #draggedColumn} property.
- *
- * @param d The new value of the property
- */
- public void setDraggedColumn(TableColumn d)
- {
- draggedColumn = d;
- }
-
- /**
- * Set the value of the {@link #draggedDistance} property.
- *
- * @param d The new value of the property
- */
- public void setDraggedDistance(int d)
- {
- draggedDistance = d;
- }
-
- /**
- * Set the value of the {@link #opaque} property.
- *
- * @param o The new value of the property
- */
- public void setOpaque(boolean o)
- {
- opaque = o;
- }
-
- /**
- * Set the value of the {@link #reorderingAllowed} property.
- *
- * @param r The new value of the property
- */
- public void setReorderingAllowed(boolean r)
- {
- reorderingAllowed = r;
- }
-
- /**
- * Set the value of the {@link #resizingAllowed} property.
- *
- * @param r The new value of the property
- */
- public void setResizingAllowed(boolean r)
- {
- resizingAllowed = r;
- }
-
- /**
- * Set the value of the {@link #resizingColumn} property.
- *
- * @param r The new value of the property
- */
- public void setResizingColumn(TableColumn r)
- {
- resizingColumn = r;
- }
-
- /**
- * Set the value of the {@link #table} property.
- *
- * @param t The new value of the property
- */
- public void setTable(JTable t)
- {
- table = t;
- }
-
- /**
- * Set the value of the {@link #updateTableInRealTime} property.
- *
- * @param u The new value of the property
- */
- public void setUpdateTableInRealTime(boolean u)
- {
- updateTableInRealTime = u;
- }
-
- protected TableCellRenderer createDefaultRenderer()
- {
- return new DefaultTableCellRenderer();
- }
-
- public TableCellRenderer getDefaultRenderer()
- {
- return cellRenderer;
- }
-
- public void setDefaultRenderer(TableCellRenderer cellRenderer)
- {
- this.cellRenderer = cellRenderer;
- }
-
- public Rectangle getHeaderRect(int column)
- {
- Rectangle r = getTable().getCellRect(-1, column, true);
- r.height = getHeight();
- return r;
- }
-
- protected String paramString()
- {
- return "JTableHeader";
- }
-
- // UI support
-
- public String getUIClassID()
- {
- return "TableHeaderUI";
- }
-
- public TableHeaderUI getUI()
- {
- return (TableHeaderUI) ui;
- }
-
- public void setUI(TableHeaderUI u)
- {
- super.setUI(u);
- }
-
- public void updateUI()
- {
- setUI((TableHeaderUI) UIManager.getUI(this));
- }
-
- public int columnAtPoint(Point point)
- {
- if (getBounds().contains(point))
- return columnModel.getColumnIndexAtX(point.x);
-
- return -1;
- }
-}
diff --git a/libjava/javax/swing/table/TableCellEditor.java b/libjava/javax/swing/table/TableCellEditor.java
deleted file mode 100644
index b355311dcb2..00000000000
--- a/libjava/javax/swing/table/TableCellEditor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* TableCellEditor.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.table;
-
-import java.awt.Component;
-
-import javax.swing.CellEditor;
-import javax.swing.JTable;
-
-/**
- * TableCellEditor public interface
- * @author Andrew Selkirk
- */
-public interface TableCellEditor extends CellEditor {
-
- /**
- * Get table cell editor component
- * @param table JTable
- * @param value Value of cell
- * @param isSelected Cell selected
- * @param row Row of cell
- * @param column Column of cell
- * @returns Component
- */
- Component getTableCellEditorComponent(JTable table,
- Object value, boolean isSelected, int row, int column);
-
-
-} // TableCellEditor
diff --git a/libjava/javax/swing/table/TableCellRenderer.java b/libjava/javax/swing/table/TableCellRenderer.java
deleted file mode 100644
index 639b4b9ad73..00000000000
--- a/libjava/javax/swing/table/TableCellRenderer.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* TableCellRenderer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.table;
-
-import java.awt.Component;
-
-import javax.swing.JTable;
-
-/**
- * TableCellRenderer public interface
- * @author Andrew Selkirk
- */
-public interface TableCellRenderer {
-
- /**
- * Get table cell renderer component
- * @param table JTable
- * @param value Value of cell
- * @param isSelected Cell selected
- * @param hasFocus Cell has focus
- * @param row Row of cell
- * @param column Column of cell
- * @returns Component
- */
- Component getTableCellRendererComponent(JTable table,
- Object value, boolean isSelected, boolean hasFocus,
- int row, int column);
-
-
-} // TableCellRenderer
diff --git a/libjava/javax/swing/table/TableColumn.java b/libjava/javax/swing/table/TableColumn.java
deleted file mode 100644
index 88ce96b19b6..00000000000
--- a/libjava/javax/swing/table/TableColumn.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/* TableColumn.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.table;
-
-import java.beans.PropertyChangeListener;
-import java.io.Serializable;
-
-import javax.swing.event.SwingPropertyChangeSupport;
-
-/**
- * TableColumn
- * @author Andrew Selkirk
- * @version 1.0
- */
-public class TableColumn
- implements Serializable
-{
- static final long serialVersionUID = -6113660025878112608L;
-
- /**
- * COLUMN_WIDTH_PROPERTY
- */
- public static final String COLUMN_WIDTH_PROPERTY = "columWidth";
-
- /**
- * HEADER_VALUE_PROPERTY
- */
- public static final String HEADER_VALUE_PROPERTY = "headerValue";
-
- /**
- * HEADER_RENDERER_PROPERTY
- */
- public static final String HEADER_RENDERER_PROPERTY = "headerRenderer";
-
- /**
- * CELL_RENDERER_PROPERTY
- */
- public static final String CELL_RENDERER_PROPERTY = "cellRenderer";
-
- /**
- * modelIndex
- */
- protected int modelIndex;
-
- /**
- * identifier
- */
- protected Object identifier;
-
- /**
- * width
- */
- protected int width;
-
- /**
- * minWidth
- */
- protected int minWidth = 15;
-
- /**
- * preferredWidth
- */
- private int preferredWidth;
-
- /**
- * maxWidth
- */
- protected int maxWidth = Integer.MAX_VALUE;
-
- /**
- * headerRenderer
- */
- protected TableCellRenderer headerRenderer;
-
- /**
- * headerValue
- */
- protected Object headerValue;
-
- /**
- * cellRenderer
- */
- protected TableCellRenderer cellRenderer;
-
- /**
- * cellEditor
- */
- protected TableCellEditor cellEditor;
-
- /**
- * isResizable
- */
- protected boolean isResizable = true;
-
- /**
- * resizedPostingDisableCount
- *
- * @deprecated 1.3
- */
- protected transient int resizedPostingDisableCount;
-
- /**
- * changeSupport
- */
- private SwingPropertyChangeSupport changeSupport =
- new SwingPropertyChangeSupport(this);
-
- /**
- * Constructor TableColumn
- */
- public TableColumn()
- {
- this(0, 75, null, null);
- }
-
- /**
- * Constructor TableColumn
- *
- * @param modelIndex the index of the column in the model
- */
- public TableColumn(int modelIndex)
- {
- this(modelIndex, 75, null, null);
- }
-
- /**
- * Constructor TableColumn
- *
- * @param modelIndex the index of the column in the model
- * @param width the width
- */
- public TableColumn(int modelIndex, int width)
- {
- this(modelIndex, width, null, null);
- }
-
- /**
- * Constructor TableColumn
- *
- * @param modelIndex the index of the column in the model
- * @param width the width
- * @param cellRenderer the cell renderer
- * @param cellEditor the cell editor
- */
- public TableColumn(int modelIndex, int width,
- TableCellRenderer cellRenderer, TableCellEditor cellEditor)
- {
- this.modelIndex = modelIndex;
- this.width = width;
- this.preferredWidth = width;
- this.cellRenderer = cellRenderer;
- this.cellEditor = cellEditor;
- this.headerValue = null;
- this.identifier = null;
- }
-
- /**
- * firePropertyChange
- *
- * @param property the name of the property
- * @param oldValue the old value
- * @param newValue the new value
- */
- private void firePropertyChange(String property, Object oldValue,
- Object newValue)
- {
- changeSupport.firePropertyChange(property, oldValue, newValue);
- }
-
- /**
- * firePropertyChange
- *
- * @param property the name of the property
- * @param oldValue the old value
- * @param newValue the new value
- */
- private void firePropertyChange(String property, int oldValue, int newValue)
- {
- firePropertyChange(property, new Integer(oldValue), new Integer(newValue));
- }
-
- /**
- * firePropertyChange
- *
- * @param property the name of the property
- * @param oldValue the old value
- * @param newValue the new value
- */
- private void firePropertyChange(String property, boolean oldValue,
- boolean newValue)
- {
- firePropertyChange(property, Boolean.valueOf(oldValue),
- Boolean.valueOf(newValue));
- }
-
- /**
- * setModelIndex
- *
- * @param modelIndex the index to set
- */
- public void setModelIndex(int modelIndex)
- {
- this.modelIndex = modelIndex;
- }
-
- /**
- * getModelIndex
- *
- * @return the model index
- */
- public int getModelIndex()
- {
- return modelIndex;
- }
-
- /**
- * setIdentifier
- *
- * @param identifier the identifier
- */
- public void setIdentifier(Object identifier)
- {
- this.identifier = identifier;
- }
-
- /**
- * getIdentifier
- *
- * @return the identifier
- */
- public Object getIdentifier()
- {
- if (identifier == null)
- return getHeaderValue();
- return identifier;
- }
-
- /**
- * setHeaderValue
- *
- * @param headerValue the value of the header
- */
- public void setHeaderValue(Object headerValue)
- {
- if (this.headerValue == headerValue)
- return;
-
- Object oldValue = this.headerValue;
- this.headerValue = headerValue;
- firePropertyChange(HEADER_VALUE_PROPERTY, oldValue, headerValue);
- }
-
- /**
- * getHeaderValue
- *
- * @return the value of the header
- */
- public Object getHeaderValue()
- {
- return headerValue;
- }
-
- /**
- * setHeaderRenderer
- *
- * @param headerRenderer the renderer to se
- */
- public void setHeaderRenderer(TableCellRenderer renderer)
- {
- if (headerRenderer == renderer)
- return;
-
- TableCellRenderer oldRenderer = headerRenderer;
- headerRenderer = renderer;
- firePropertyChange(HEADER_RENDERER_PROPERTY,
- oldRenderer, headerRenderer);
- }
-
- /**
- * getHeaderRenderer
- * @return TableCellRenderer
- */
- public TableCellRenderer getHeaderRenderer()
- {
- return headerRenderer;
- }
-
- /**
- * setCellRenderer
- *
- * @param cellRenderer the cell renderer
- */
- public void setCellRenderer(TableCellRenderer renderer)
- {
- if (cellRenderer == renderer)
- return;
-
- TableCellRenderer oldRenderer = cellRenderer;
- cellRenderer = renderer;
- firePropertyChange(CELL_RENDERER_PROPERTY,
- oldRenderer, cellRenderer);
- }
-
- /**
- * getCellRenderer
- *
- * @return the cell renderer
- */
- public TableCellRenderer getCellRenderer()
- {
- return cellRenderer;
- }
-
- /**
- * setCellEditor
- *
- * @param cellEditor the cell editor
- */
- public void setCellEditor(TableCellEditor cellEditor)
- {
- this.cellEditor = cellEditor;
- }
-
- /**
- * getCellEditor
- *
- * @return the cell editor
- */
- public TableCellEditor getCellEditor()
- {
- return cellEditor;
- }
-
- /**
- * setWidth
- *
- * @param newWidth the width
- */
- public void setWidth(int newWidth)
- {
- int oldWidth = width;
-
- if (newWidth < minWidth)
- width = minWidth;
- else if (newWidth > maxWidth)
- width = maxWidth;
- else
- width = newWidth;
-
- if (width == oldWidth)
- return;
-
- firePropertyChange(COLUMN_WIDTH_PROPERTY, oldWidth, width);
- }
-
- /**
- * getWidth
- *
- * @return int
- */
- public int getWidth()
- {
- return width;
- }
-
- /**
- * setPreferredWidth
- *
- * @param preferredWidth the preferred width
- */
- public void setPreferredWidth(int preferredWidth)
- {
- if (preferredWidth < minWidth)
- this.preferredWidth = minWidth;
- else if (preferredWidth > maxWidth)
- this.preferredWidth = maxWidth;
- else
- this.preferredWidth = preferredWidth;
- }
-
- /**
- * getPreferredWidth
- *
- * @return the preferred width
- */
- public int getPreferredWidth()
- {
- return preferredWidth;
- }
-
- /**
- * setMinWidth
- *
- * @param minWidth the minium width
- */
- public void setMinWidth(int minWidth)
- {
- this.minWidth = minWidth;
- setWidth(getWidth());
- setPreferredWidth(getPreferredWidth());
- }
-
- /**
- * getMinWidth
- *
- * @return the minimum width
- */
- public int getMinWidth()
- {
- return minWidth;
- }
-
- /**
- * setMaxWidth
- *
- * @param maxWidth the maximum width
- */
- public void setMaxWidth(int maxWidth)
- {
- this.maxWidth = maxWidth;
- setWidth(getWidth());
- setPreferredWidth(getPreferredWidth());
- }
-
- /**
- * getMaxWidth
- * @return the maximim width
- */
- public int getMaxWidth()
- {
- return maxWidth;
- }
-
- /**
- * setResizable
- *
- * @param isResizable <code>true</code> if this column is resizable,
- * <code>false</code> otherwise
- */
- public void setResizable(boolean isResizable)
- {
- this.isResizable = isResizable;
- }
-
- /**
- * getResizable
- *
- * @return <code>true</code> if this column is resizable,
- * <code>false</code> otherwise
- */
- public boolean getResizable()
- {
- return isResizable;
- }
-
- /**
- * sizeWidthToFit
- */
- public void sizeWidthToFit()
- {
- // TODO
- }
-
- /**
- * disableResizedPosting
- *
- * @deprecated 1.3
- */
- public void disableResizedPosting()
- {
- // Does nothing
- }
-
- /**
- * enableResizedPosting
- *
- * @deprecated 1.3
- */
- public void enableResizedPosting()
- {
- // Does nothing
- }
-
- /**
- * addPropertyChangeListener
- * @param listener the listener to all
- */
- public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- {
- changeSupport.addPropertyChangeListener(listener);
- }
-
- /**
- * removePropertyChangeListener
- * @param listener the listener to remove
- */
- public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- {
- changeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners()
- {
- return changeSupport.getPropertyChangeListeners();
- }
-
- /**
- * createDefaultHeaderRenderer
- * @return TableCellRenderer
- */
- protected TableCellRenderer createDefaultHeaderRenderer()
- {
- return new DefaultTableCellRenderer();
- }
-}
diff --git a/libjava/javax/swing/table/TableColumnModel.java b/libjava/javax/swing/table/TableColumnModel.java
deleted file mode 100644
index c201f140901..00000000000
--- a/libjava/javax/swing/table/TableColumnModel.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/* TableColumnModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.table;
-
-import java.util.Enumeration;
-
-import javax.swing.ListSelectionModel;
-import javax.swing.event.TableColumnModelListener;
-
-/**
- * TableColumnModel public interface
- * @author Andrew Selkirk
- */
-public interface TableColumnModel
-{
- /**
- * addColumn
- * @param column TableColumn
- */
- void addColumn(TableColumn column);
-
- /**
- * removeColumn
- * @param column TableColumn
- */
- void removeColumn(TableColumn column);
-
- /**
- * moveColumn
- * @param columnIndex Index of column to move
- * @param newIndex New index of column
- */
- void moveColumn(int columnIndex, int newIndex);
-
- /**
- * setColumnMargin
- * @param margin Margin of column
- */
- void setColumnMargin(int margin);
-
- /**
- * getColumnCount
- * @return Column count
- */
- int getColumnCount();
-
- /**
- * getColumns
- * @return Enumeration of columns
- */
- Enumeration getColumns();
-
- /**
- * getColumnIndex
- * @param columnIdentifier Column id
- */
- int getColumnIndex(Object columnIdentifier);
-
- /**
- * getColumn
- * @param columnIndex Index of column
- */
- TableColumn getColumn(int columnIndex);
-
- /**
- * getColumnMargin
- * @return Column margin
- */
- int getColumnMargin();
-
- /**
- * getColumnIndexAtX
- * @return Column index as position x
- */
- int getColumnIndexAtX(int xPosition);
-
- /**
- * getTotalColumnWidth
- * @return Total column width
- */
- int getTotalColumnWidth();
-
- /**
- * setColumnSelectionAllowed
- * @param value Set column selection
- */
- void setColumnSelectionAllowed(boolean value);
-
- /**
- * getColumnSelectionAllowed
- * @return true if column selection allowed, false otherwise
- */
- boolean getColumnSelectionAllowed();
-
- /**
- * getSelectedColumns
- * @return Selected columns
- */
- int[] getSelectedColumns();
-
- /**
- * getSelectedColumnCount
- * @return Count of selected columns
- */
- int getSelectedColumnCount();
-
- /**
- * setSelectionModel
- * @param model ListSelectionModel
- */
- void setSelectionModel(ListSelectionModel model);
-
- /**
- * getSelectionModel
- * @param column TableColumn
- */
- ListSelectionModel getSelectionModel();
-
- /**
- * addColumnModelListener
- * @param listener TableColumnModelListener
- */
- void addColumnModelListener(TableColumnModelListener listener);
-
- /**
- * removeColumnModelListener
- * @param listener TableColumnModelListener
- */
- void removeColumnModelListener(TableColumnModelListener listener);
-}
diff --git a/libjava/javax/swing/table/TableModel.java b/libjava/javax/swing/table/TableModel.java
deleted file mode 100644
index 733464eaa37..00000000000
--- a/libjava/javax/swing/table/TableModel.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/* TableModel.java --
- Copyright (C) 2002, 2005, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.table;
-
-import javax.swing.event.TableModelListener;
-
-/**
- * A <code>TableModel</code> is a two dimensional data structure that
- * can store arbitrary <code>Object</code> instances, usually for the
- * purpose of display in a {@link JTable} component. Individual objects
- * can be accessed by specifying the row index and column index for
- * the object. Each column in the model has a name associated with it.
- * <p>
- * The {@link DefaultTableModel} class provides one implementation of
- * this interface.
- *
- * @author Andrew Selkirk
- */
-public interface TableModel
-{
- /**
- * Returns the number of rows in the model.
- *
- * @return The row count.
- */
- int getRowCount();
-
- /**
- * Returns the number of columns in the model.
- *
- * @return The column count
- */
- int getColumnCount();
-
- /**
- * Returns the name of a column in the model.
- *
- * @param columnIndex the column index.
- *
- * @return The column name.
- */
- String getColumnName(int columnIndex);
-
- /**
- * Returns the <code>Class</code> for all <code>Object</code> instances
- * in the specified column.
- *
- * @param columnIndex the column index.
- *
- * @return The class.
- */
- Class getColumnClass(int columnIndex);
-
- /**
- * Returns <code>true</code> if the cell is editable, and <code>false</code>
- * otherwise.
- *
- * @param rowIndex the row index.
- * @param columnIndex the column index.
- *
- * @return <code>true</code> if editable, <code>false</code> otherwise.
- */
- boolean isCellEditable(int rowIndex, int columnIndex);
-
- /**
- * Returns the value (<code>Object</code>) at a particular cell in the
- * table.
- *
- * @param rowIndex the row index.
- * @param columnIndex the column index.
- *
- * @return The value at the specified cell.
- */
- Object getValueAt(int rowIndex, int columnIndex);
-
- /**
- * Sets the value at a particular cell in the table.
- *
- * @param aValue the value (<code>null</code> permitted).
- * @param rowIndex the row index.
- * @param columnIndex the column index.
- */
- void setValueAt(Object aValue, int rowIndex, int columnIndex);
-
- /**
- * Adds a listener to the model. The listener will receive notification
- * of updates to the model.
- *
- * @param listener the listener.
- */
- void addTableModelListener(TableModelListener listener);
-
- /**
- * Removes a listener from the model.
- *
- * @param listener the listener.
- */
- void removeTableModelListener(TableModelListener listener);
-}
diff --git a/libjava/javax/swing/text/AbstractDocument.java b/libjava/javax/swing/text/AbstractDocument.java
deleted file mode 100644
index c3a3d70ae37..00000000000
--- a/libjava/javax/swing/text/AbstractDocument.java
+++ /dev/null
@@ -1,912 +0,0 @@
-/* AbstractDocument.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.io.PrintStream;
-import java.io.Serializable;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.EventListener;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.EventListenerList;
-import javax.swing.event.UndoableEditEvent;
-import javax.swing.event.UndoableEditListener;
-import javax.swing.tree.TreeNode;
-import javax.swing.undo.AbstractUndoableEdit;
-import javax.swing.undo.CompoundEdit;
-import javax.swing.undo.UndoableEdit;
-
-public abstract class AbstractDocument
- implements Document, Serializable
-{
- private static final long serialVersionUID = -116069779446114664L;
-
- protected static final String BAD_LOCATION = "document location failure";
-
- public static final String BidiElementName = "bidi level";
- public static final String ContentElementName = "content";
- public static final String ParagraphElementName = "paragraph";
- public static final String SectionElementName = "section";
- public static final String ElementNameAttribute = "$ename";
-
- Content content;
- AttributeContext context;
- DocumentFilter documentFilter;
-
- /** The documents properties. */
- Dictionary properties;
-
- protected EventListenerList listenerList = new EventListenerList();
-
- protected AbstractDocument(Content doc)
- {
- this(doc, StyleContext.getDefaultStyleContext());
- }
-
- protected AbstractDocument(Content doc, AttributeContext ctx)
- {
- content = doc;
- context = ctx;
- }
-
- // These still need to be implemented by a derived class:
- public abstract Element getParagraphElement(int pos);
-
- public abstract Element getDefaultRootElement();
-
- protected Element createBranchElement(Element parent,
- AttributeSet attributes)
- {
- return new BranchElement(parent, attributes);
- }
-
- protected Element createLeafElement(Element parent, AttributeSet attributes,
- int start, int end)
- {
- return new LeafElement(parent, attributes, start, end);
- }
-
- public Position createPosition(final int offset) throws BadLocationException
- {
- if (offset < 0 || offset > getLength())
- throw new BadLocationException(getText(0, getLength()), offset);
-
- return new Position()
- {
- public int getOffset()
- {
- return offset;
- }
- };
- }
-
- protected void fireChangedUpdate(DocumentEvent event)
- {
- DocumentListener[] listeners = getDocumentListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].changedUpdate(event);
- }
-
- protected void fireInsertUpdate(DocumentEvent event)
- {
- DocumentListener[] listeners = getDocumentListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].insertUpdate(event);
- }
-
- protected void fireRemoveUpdate(DocumentEvent event)
- {
- DocumentListener[] listeners = getDocumentListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].removeUpdate(event);
- }
-
- protected void fireUndoableEditUpdate(UndoableEditEvent event)
- {
- UndoableEditListener[] listeners = getUndoableEditListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].undoableEditHappened(event);
- }
-
- public int getAsynchronousLoadPriority()
- {
- return 0;
- }
-
- protected AttributeContext getAttributeContext()
- {
- return context;
- }
-
- public Element getBidiRootElement()
- {
- return null;
- }
-
- protected Content getContent()
- {
- return content;
- }
-
- protected Thread getCurrentWriter()
- {
- return null;
- }
-
- public Dictionary getDocumentProperties()
- {
- // FIXME: make me thread-safe
- if (properties == null)
- properties = new Hashtable();
-
- return properties;
- }
-
- public Position getEndPosition()
- {
- return new Position()
- {
- public int getOffset()
- {
- return getLength();
- }
- };
- }
-
- public int getLength()
- {
- return content.length() - 1;
- }
-
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
- public Object getProperty(Object key)
- {
- // FIXME: make me thread-safe
- Object value = null;
- if (properties != null)
- value = properties.get(key);
-
- return value;
- }
-
- public Element[] getRootElements()
- {
- Element[] elements = new Element[1];
- elements[0] = getDefaultRootElement();
- return elements;
- }
-
- public Position getStartPosition()
- {
- return new Position()
- {
- public int getOffset()
- {
- return 0;
- }
- };
- }
-
- public String getText(int offset, int length) throws BadLocationException
- {
- return content.getString(offset, length);
- }
-
- public void getText(int offset, int length, Segment segment)
- throws BadLocationException
- {
- content.getChars(offset, length, segment);
- }
-
- public void insertString(int offset, String text, AttributeSet attributes)
- throws BadLocationException
- {
- // Just return when no text to insert was given.
- if (text == null || text.length() == 0)
- return;
-
- DefaultDocumentEvent event =
- new DefaultDocumentEvent(offset, text.length(),
- DocumentEvent.EventType.INSERT);
- content.insertString(offset, text);
- insertUpdate(event, attributes);
- fireInsertUpdate(event);
- }
-
- protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr)
- {
- }
-
- protected void postRemoveUpdate(DefaultDocumentEvent chng)
- {
- }
-
- public void putProperty(Object key, Object value)
- {
- // FIXME: make me thread-safe
- if (properties == null)
- properties = new Hashtable();
-
- properties.put(key, value);
- }
-
- public void readLock()
- {
- }
-
- public void readUnlock()
- {
- }
-
- public void remove(int offset, int length) throws BadLocationException
- {
- DefaultDocumentEvent event =
- new DefaultDocumentEvent(offset, length,
- DocumentEvent.EventType.REMOVE);
- removeUpdate(event);
- content.remove(offset, length);
- postRemoveUpdate(event);
- fireRemoveUpdate(event);
- }
-
- /**
- * Replaces some text in the document.
- *
- * @since 1.4
- */
- public void replace(int offset, int length, String text,
- AttributeSet attributes)
- throws BadLocationException
- {
- remove(offset, length);
- insertString(offset, text, attributes);
- }
-
- /**
- * Adds a <code>DocumentListener</code> object to this document.
- *
- * @param listener the listener to add
- */
- public void addDocumentListener(DocumentListener listener)
- {
- listenerList.add(DocumentListener.class, listener);
- }
-
- /**
- * Removes a <code>DocumentListener</code> object from this document.
- *
- * @param listener the listener to remove
- */
- public void removeDocumentListener(DocumentListener listener)
- {
- listenerList.remove(DocumentListener.class, listener);
- }
-
- /**
- * Returns add added <code>DocumentListener</code> objects.
- *
- * @return an array of listeners
- */
- public DocumentListener[] getDocumentListeners()
- {
- return (DocumentListener[]) getListeners(DocumentListener.class);
- }
-
- /**
- * Adds a <code>UndoableEditListener</code> object to this document.
- *
- * @param listener the listener to add
- */
- public void addUndoableEditListener(UndoableEditListener listener)
- {
- listenerList.add(UndoableEditListener.class, listener);
- }
-
- /**
- * Removes a <code>UndoableEditListener</code> object from this document.
- *
- * @param listener the listener to remove
- */
- public void removeUndoableEditListener(UndoableEditListener listener)
- {
- listenerList.remove(UndoableEditListener.class, listener);
- }
-
- /**
- * Returns add added <code>UndoableEditListener</code> objects.
- *
- * @return an array of listeners
- */
- public UndoableEditListener[] getUndoableEditListeners()
- {
- return (UndoableEditListener[]) getListeners(UndoableEditListener.class);
- }
-
- protected void removeUpdate(DefaultDocumentEvent chng)
- {
- }
-
- public void render(Runnable r)
- {
- }
-
- public void setAsynchronousLoadPriority(int p)
- {
- }
-
- public void setDocumentProperties(Dictionary x)
- {
- // FIXME: make me thread-safe
- properties = x;
- }
-
- protected void writeLock()
- {
- }
-
- protected void writeUnlock()
- {
- }
-
- /**
- * @since 1.4
- */
- public DocumentFilter getDocumentFilter()
- {
- return documentFilter;
- }
-
- /**
- * @since 1.4
- */
- public void setDocumentFilter(DocumentFilter filter)
- {
- this.documentFilter = filter;
- }
-
- public void dump(PrintStream out)
- {
- ((AbstractElement) getDefaultRootElement()).dump(out, 0);
- }
-
- public interface AttributeContext
- {
- AttributeSet addAttribute(AttributeSet old, Object name, Object value);
-
- AttributeSet addAttributes(AttributeSet old, AttributeSet attributes);
-
- AttributeSet getEmptySet();
-
- void reclaim(AttributeSet attributes);
-
- AttributeSet removeAttribute(AttributeSet old, Object name);
-
- AttributeSet removeAttributes(AttributeSet old, AttributeSet attributes);
-
- AttributeSet removeAttributes(AttributeSet old, Enumeration names);
- }
-
- public interface Content
- {
- Position createPosition(int offset) throws BadLocationException;
-
- int length();
-
- UndoableEdit insertString(int where, String str)
- throws BadLocationException;
-
- UndoableEdit remove(int where, int nitems) throws BadLocationException;
-
- String getString(int where, int len) throws BadLocationException;
-
- void getChars(int where, int len, Segment txt) throws BadLocationException;
- }
-
- public abstract class AbstractElement
- implements Element, MutableAttributeSet, TreeNode, Serializable
- {
- private static final long serialVersionUID = 1265312733007397733L;
- int count;
- int offset;
-
- AttributeSet attributes;
-
- Element element_parent;
-
- TreeNode tree_parent;
- Vector tree_children;
-
- public AbstractElement(Element p, AttributeSet s)
- {
- element_parent = p;
- attributes = s;
- }
-
- // TreeNode implementation
-
- public abstract Enumeration children();
-
- public abstract boolean getAllowsChildren();
-
- public TreeNode getChildAt(int index)
- {
- return (TreeNode) tree_children.get(index);
- }
-
- public int getChildCount()
- {
- return tree_children.size();
- }
-
- public int getIndex(TreeNode node)
- {
- return tree_children.indexOf(node);
- }
-
- public TreeNode getParent()
- {
- return tree_parent;
- }
-
- public abstract boolean isLeaf();
-
-
- // MutableAttributeSet support
-
- public void addAttribute(Object name, Object value)
- {
- attributes = getAttributeContext().addAttribute(attributes, name, value);
- }
-
- public void addAttributes(AttributeSet attrs)
- {
- attributes = getAttributeContext().addAttributes(attributes, attrs);
- }
-
- public void removeAttribute(Object name)
- {
- attributes = getAttributeContext().removeAttribute(attributes, name);
- }
-
- public void removeAttributes(AttributeSet attrs)
- {
- attributes = getAttributeContext().removeAttributes(attributes, attrs);
- }
-
- public void removeAttributes(Enumeration names)
- {
- attributes = getAttributeContext().removeAttributes(attributes, names);
- }
-
- public void setResolveParent(AttributeSet parent)
- {
- attributes = getAttributeContext().addAttribute(attributes, ResolveAttribute, parent);
- }
-
-
- // AttributeSet interface support
-
- public boolean containsAttribute(Object name, Object value)
- {
- return attributes.containsAttribute(name, value);
- }
-
- public boolean containsAttributes(AttributeSet attrs)
- {
- return attributes.containsAttributes(attrs);
- }
-
- public AttributeSet copyAttributes()
- {
- return attributes.copyAttributes();
- }
-
- public Object getAttribute(Object key)
- {
- return attributes.getAttribute(key);
- }
-
- public int getAttributeCount()
- {
- return attributes.getAttributeCount();
- }
-
- public Enumeration getAttributeNames()
- {
- return attributes.getAttributeNames();
- }
-
- public AttributeSet getResolveParent()
- {
- return attributes.getResolveParent();
- }
-
- public boolean isDefined(Object attrName)
- {
- return attributes.isDefined(attrName);
- }
-
- public boolean isEqual(AttributeSet attrs)
- {
- return attributes.isEqual(attrs);
- }
-
- // Element interface support
-
- public AttributeSet getAttributes()
- {
- return attributes;
- }
-
- public Document getDocument()
- {
- return AbstractDocument.this;
- }
-
- public abstract Element getElement(int index);
-
- public String getName()
- {
- return (String) getAttribute(NameAttribute);
- }
-
- public Element getParentElement()
- {
- return element_parent;
- }
-
- public abstract int getEndOffset();
-
- public abstract int getElementCount();
-
- public abstract int getElementIndex(int offset);
-
- public abstract int getStartOffset();
-
- private void dumpElement(PrintStream stream, String indent, Element element)
- {
- System.out.println(indent + "<" + element.getName() +">");
-
- if (element.isLeaf())
- {
- int start = element.getStartOffset();
- int end = element.getEndOffset();
- String text = "";
- try
- {
- text = getContent().getString(start, end - start);
- }
- catch (BadLocationException e)
- {
- }
- System.out.println(indent + " ["
- + start + ","
- + end + "]["
- + text + "]");
- }
- else
- {
- for (int i = 0; i < element.getElementCount(); ++i)
- dumpElement(stream, indent + " ", element.getElement(i));
- }
- }
-
- public void dump(PrintStream stream, int indent)
- {
- String indentStr = "";
- for (int i = 0; i < indent; ++i)
- indentStr += " ";
- dumpElement(stream, indentStr, this);
- }
- }
-
- public class BranchElement extends AbstractElement
- {
- private static final long serialVersionUID = -8595176318868717313L;
-
- private Element[] children = new Element[0];
-
- public BranchElement(Element parent, AttributeSet attributes)
- {
- super(parent, attributes);
- }
-
- public Enumeration children()
- {
- if (children.length == 0)
- return null;
-
- Vector tmp = new Vector();
-
- for (int index = 0; index < children.length; ++index)
- tmp.add(children[index]);
-
- return tmp.elements();
- }
-
- public boolean getAllowsChildren()
- {
- return true;
- }
-
- public Element getElement(int index)
- {
- if (index < 0 || index >= children.length)
- return null;
-
- return children[index];
- }
-
- public int getElementCount()
- {
- return children.length;
- }
-
- public int getElementIndex(int offset)
- {
- // XXX: There is surely a better algorithm
- // as beginning from first element each time.
- for (int index = 0; index < children.length; ++index)
- {
- Element elem = children[index];
-
- if ((elem.getStartOffset() <= offset)
- && (offset < elem.getEndOffset()))
- return index;
- }
-
- return 0;
- }
-
- public int getEndOffset()
- {
- return children[children.length - 1].getEndOffset();
- }
-
- public String getName()
- {
- return ParagraphElementName;
- }
-
- public int getStartOffset()
- {
- return children[0].getStartOffset();
- }
-
- public boolean isLeaf()
- {
- return false;
- }
-
- public Element positionToElement(int position)
- {
- // XXX: There is surely a better algorithm
- // as beginning from first element each time.
- for (int index = 0; index < children.length; ++index)
- {
- Element elem = children[index];
-
- if ((elem.getStartOffset() <= position)
- && (position < elem.getEndOffset()))
- return elem;
- }
-
- return null;
- }
-
- public void replace(int offset, int length, Element[] elements)
- {
- Element[] target = new Element[children.length - length
- + elements.length];
- System.arraycopy(children, 0, target, 0, offset);
- System.arraycopy(elements, 0, target, offset, elements.length);
- System.arraycopy(children, offset + length, target,
- offset + elements.length,
- children.length - offset - length);
- children = target;
- }
-
- public String toString()
- {
- return ("BranchElement(" + getName() + ") "
- + getStartOffset() + "," + getEndOffset() + "\n");
- }
- }
-
- public class DefaultDocumentEvent extends CompoundEdit
- implements DocumentEvent
- {
- private static final long serialVersionUID = -7406103236022413522L;
-
- private int offset;
- private int length;
- private DocumentEvent.EventType type;
-
- public DefaultDocumentEvent(int offset, int length,
- DocumentEvent.EventType type)
- {
- this.offset = offset;
- this.length = length;
- this.type = type;
- }
-
- public Document getDocument()
- {
- return AbstractDocument.this;
- }
-
- public int getLength()
- {
- return length;
- }
-
- public int getOffset()
- {
- return offset;
- }
-
- public DocumentEvent.EventType getType()
- {
- return type;
- }
-
- public DocumentEvent.ElementChange getChange(Element elem)
- {
- return null;
- }
- }
-
- public static class ElementEdit extends AbstractUndoableEdit
- implements DocumentEvent.ElementChange
- {
- private static final long serialVersionUID = -1216620962142928304L;
-
- private Element elem;
- private int index;
- private Element[] removed;
- private Element[] added;
-
- public ElementEdit(Element elem, int index,
- Element[] removed, Element[] added)
- {
- this.elem = elem;
- this.index = index;
- this.removed = removed;
- this.added = added;
- }
-
- public Element[] getChildrenAdded()
- {
- return added;
- }
-
- public Element[] getChildrenRemoved()
- {
- return removed;
- }
-
- public Element getElement()
- {
- return elem;
- }
-
- public int getIndex()
- {
- return index;
- }
- }
-
- public class LeafElement extends AbstractElement
- {
- private static final long serialVersionUID = 5115368706941283802L;
- int start;
- int end;
-
- public LeafElement(Element parent, AttributeSet attributes, int start,
- int end)
- {
- super(parent, attributes);
- this.start = start;
- this.end = end;
- }
-
- public Enumeration children()
- {
- return null;
- }
-
- public boolean getAllowsChildren()
- {
- return false;
- }
-
- public Element getElement(int index)
- {
- return null;
- }
-
- public int getElementCount()
- {
- return 0;
- }
-
- public int getElementIndex(int offset)
- {
- return -1;
- }
-
- public int getEndOffset()
- {
- return end;
- }
-
- public String getName()
- {
- return ContentElementName;
- }
-
- public int getStartOffset()
- {
- return start;
- }
-
- public boolean isLeaf()
- {
- return true;
- }
-
- public String toString()
- {
- return ("LeafElement(" + getName() + ") "
- + getStartOffset() + "," + getEndOffset() + "\n");
- }
- }
-}
diff --git a/libjava/javax/swing/text/AttributeSet.java b/libjava/javax/swing/text/AttributeSet.java
deleted file mode 100644
index 87e7b98af22..00000000000
--- a/libjava/javax/swing/text/AttributeSet.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* AttributeSet.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.util.Enumeration;
-
-public interface AttributeSet
-{
- static interface CharacterAttribute
- {
- }
-
- static interface ColorAttribute
- {
- }
-
- static interface FontAttribute
- {
- }
-
- static interface ParagraphAttribute
- {
- }
-
- Object NameAttribute = StyleConstants.NameAttribute;
- Object ResolveAttribute = StyleConstants.ResolveAttribute;
-
- boolean containsAttribute(Object name, Object value);
- boolean containsAttributes(AttributeSet attributes);
- AttributeSet copyAttributes();
- Object getAttribute(Object key);
- int getAttributeCount();
- Enumeration getAttributeNames();
- AttributeSet getResolveParent();
- boolean isDefined(Object attrName);
- boolean isEqual(AttributeSet attr);
-}
diff --git a/libjava/javax/swing/text/BadLocationException.java b/libjava/javax/swing/text/BadLocationException.java
deleted file mode 100644
index e1a2ebcc604..00000000000
--- a/libjava/javax/swing/text/BadLocationException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* BadLocationException.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-public class BadLocationException extends Exception
-{
- private static final long serialVersionUID = -7712259886815656766L;
-
- int offset;
-
- /**
- * Constructs a <code>BadLocationException</code>
- *
- * @param str A string indicating what was wrong with the arguments
- * @param offset Offset within the document that was requested &gt;= 0
- */
- public BadLocationException(String str, int offset)
- {
- super(str);
- this.offset = offset;
- }
-
- /**
- * Returns the offset into the document that was not legal
- */
- public int offsetRequested()
- {
- return offset;
- }
-}
diff --git a/libjava/javax/swing/text/Caret.java b/libjava/javax/swing/text/Caret.java
deleted file mode 100644
index 46072ef19c5..00000000000
--- a/libjava/javax/swing/text/Caret.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Caret.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Graphics;
-import java.awt.Point;
-
-import javax.swing.event.ChangeListener;
-
-public interface Caret
-{
- void addChangeListener(ChangeListener l);
-
- void deinstall(JTextComponent c);
-
- int getBlinkRate();
-
- int getDot();
-
- Point getMagicCaretPosition();
-
- int getMark();
-
- void install(JTextComponent c);
-
- boolean isSelectionVisible();
-
- boolean isVisible();
-
- void moveDot(int dot);
-
- void paint(Graphics g);
-
- void removeChangeListener(ChangeListener l);
-
- void setBlinkRate(int rate);
-
- void setDot(int dot);
-
- void setMagicCaretPosition(Point p);
-
- void setSelectionVisible(boolean v);
-
- void setVisible(boolean v);
-}
diff --git a/libjava/javax/swing/text/ChangedCharSetException.java b/libjava/javax/swing/text/ChangedCharSetException.java
deleted file mode 100644
index 7fba29a309f..00000000000
--- a/libjava/javax/swing/text/ChangedCharSetException.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* ChangedCharSetException.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-/**
- * The exception is thrown when the document charset is changed.
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class ChangedCharSetException
- extends IOException
- implements Serializable
-{
- /**
- * Use serialVersionUID for interoperability.
- * This value corresponds the version 1.4.
- */
- private static final long serialVersionUID = 9119851554465432389L;
-
- /**
- * The char set specification.
- */
- private final String m_charSetSpec;
-
- /**
- * The char set key.
- */
- private final boolean m_charSetKey;
-
- /**
- * Constructs a new char set exception with two additional parameters,
- * defining the circumstances under that the exception was raised.
- */
- public ChangedCharSetException(String charSetSpec, boolean charSetKey)
- {
- m_charSetSpec = charSetSpec;
- m_charSetKey = charSetKey;
- }
-
- /**
- * Get the value of the first parameter, previously passed to the
- * constructor.
- *
- * @return the value of the first parameter
- */
- public String getCharSetSpec()
- {
- return m_charSetSpec;
- }
-
- /**
- * Get the value of the second parameter, previously passed to the
- * constructor.
- *
- * @return the value of the second parameter
- */
- public boolean keyEqualsCharSet()
- {
- return m_charSetKey;
- }
-}
diff --git a/libjava/javax/swing/text/ComponentView.java b/libjava/javax/swing/text/ComponentView.java
deleted file mode 100644
index 744d537aec6..00000000000
--- a/libjava/javax/swing/text/ComponentView.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* ComponentView.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Shape;
-
-public class ComponentView extends View
-{
- public ComponentView(Element elem)
- {
- super(elem);
- }
-
- protected Component createComponent()
- {
- return null;
- }
-
- public float getAlignment(int axis)
- {
- return 0;
- }
-
- public final Component getComponent()
- {
- return null;
- }
-
- public float getMaximumSpan(int axis)
- {
- return 0;
- }
-
- public float getMinimumSpan(int axis)
- {
- return 0;
- }
-
- public float getPreferredSpan(int axis)
- {
- return 0;
- }
-
- public Shape modelToView(int pos, Shape a, Position.Bias b)
- throws BadLocationException
- {
- return null;
- }
-
- public void paint(Graphics g, Shape a)
- {
- }
-
- public void setParent(View p)
- {
- }
-
- public void setSize(float width, float height)
- {
- }
-
- public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
- {
- return 0;
- }
-}
diff --git a/libjava/javax/swing/text/DefaultCaret.java b/libjava/javax/swing/text/DefaultCaret.java
deleted file mode 100644
index 30a1176fddf..00000000000
--- a/libjava/javax/swing/text/DefaultCaret.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/* DefaultCaret.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Graphics;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-import java.util.EventListener;
-
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-
-public class DefaultCaret extends Rectangle
- implements Caret, FocusListener, MouseListener, MouseMotionListener
-{
- private static final long serialVersionUID = 228155774675466193L;
-
- protected ChangeEvent changeEvent = new ChangeEvent(this);
- protected EventListenerList listenerList = new EventListenerList();
-
- private JTextComponent textComponent;
-
- private boolean selectionVisible = true;
- private int blinkRate = 0;
- private int dot = 0;
- private int mark = 0;
- private Point magicCaretPosition = null;
- private boolean visible = true;
- private Object highlightEntry;
-
- public void mouseDragged(MouseEvent event)
- {
- }
-
- public void mouseMoved(MouseEvent event)
- {
- }
-
- public void mouseClicked(MouseEvent event)
- {
- }
-
- public void mouseEntered(MouseEvent event)
- {
- }
-
- public void mouseExited(MouseEvent event)
- {
- }
-
- public void mousePressed(MouseEvent event)
- {
- }
-
- public void mouseReleased(MouseEvent event)
- {
- }
-
- public void focusGained(FocusEvent event)
- {
- }
-
- public void focusLost(FocusEvent event)
- {
- }
-
- protected void moveCaret(MouseEvent event)
- {
- }
-
- protected void positionCaret(MouseEvent event)
- {
- }
-
- public void deinstall(JTextComponent c)
- {
- textComponent.removeFocusListener(this);
- textComponent.removeMouseListener(this);
- textComponent.removeMouseMotionListener(this);
- textComponent = null;
- }
-
- public void install(JTextComponent c)
- {
- textComponent = c;
- textComponent.addFocusListener(this);
- textComponent.addMouseListener(this);
- textComponent.addMouseMotionListener(this);
- repaint();
- }
-
- public void setMagicCaretPosition(Point p)
- {
- magicCaretPosition = p;
- }
-
- public Point getMagicCaretPosition()
- {
- return magicCaretPosition;
- }
-
- public int getMark()
- {
- return mark;
- }
-
- private void handleHighlight()
- {
- Highlighter highlighter = textComponent.getHighlighter();
-
- if (highlighter == null)
- return;
-
- int p0 = Math.min(dot, mark);
- int p1 = Math.max(dot, mark);
-
- if (selectionVisible && p0 != p1)
- {
- try
- {
- if (highlightEntry == null)
- highlightEntry = highlighter.addHighlight(p0, p1, getSelectionPainter());
- else
- highlighter.changeHighlight(highlightEntry, p0, p1);
- }
- catch (BadLocationException e)
- {
- // This should never happen.
- throw new InternalError();
- }
- }
- else
- {
- if (highlightEntry != null)
- {
- highlighter.removeHighlight(highlightEntry);
- highlightEntry = null;
- }
- }
- }
-
- public void setSelectionVisible(boolean v)
- {
- if (selectionVisible == v)
- return;
-
- selectionVisible = v;
- handleHighlight();
- repaint();
- }
-
- public boolean isSelectionVisible()
- {
- return selectionVisible;
- }
-
- protected final void repaint()
- {
- if (textComponent != null)
- textComponent.repaint();
- }
-
- public void paint(Graphics g)
- {
- if (textComponent == null)
- return;
-
- int dot = getDot();
- Rectangle rect = null;
-
- try
- {
- rect = textComponent.modelToView(dot);
- }
- catch (BadLocationException e)
- {
- // This should never happen as dot should be always valid.
- return;
- }
-
- if (rect == null)
- return;
-
- // First we need to delete the old caret.
- // FIXME: Implement deleting of old caret.
-
- // Now draw the caret on the new position if visible.
- if (visible)
- {
- g.setColor(textComponent.getCaretColor());
- g.drawLine(rect.x, rect.y, rect.x, rect.y + rect.height);
- }
- }
-
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) getListeners(ChangeListener.class);
- }
-
- protected void fireStateChanged()
- {
- ChangeListener[] listeners = getChangeListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].stateChanged(changeEvent);
- }
-
- protected final JTextComponent getComponent()
- {
- return textComponent;
- }
-
- public int getBlinkRate()
- {
- return blinkRate;
- }
-
- public void setBlinkRate(int rate)
- {
- blinkRate = rate;
- }
-
- public int getDot()
- {
- return dot;
- }
-
- public void moveDot(int dot)
- {
- this.dot = dot;
- handleHighlight();
- repaint();
- }
-
- public void setDot(int dot)
- {
- this.dot = dot;
- this.mark = dot;
- handleHighlight();
- repaint();
- }
-
- public boolean isVisible()
- {
- return visible;
- }
-
- public void setVisible(boolean v)
- {
- visible = v;
- repaint();
- }
-
- protected Highlighter.HighlightPainter getSelectionPainter()
- {
- return DefaultHighlighter.DefaultPainter;
- }
-}
diff --git a/libjava/javax/swing/text/DefaultEditorKit.java b/libjava/javax/swing/text/DefaultEditorKit.java
deleted file mode 100644
index 01f0aebf185..00000000000
--- a/libjava/javax/swing/text/DefaultEditorKit.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/* DefaultEditorKit.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-
-import javax.swing.Action;
-
-public class DefaultEditorKit extends EditorKit
-{
- public static class BeepAction
- extends TextAction
- {
- public BeepAction()
- {
- super(beepAction);
- }
-
- public void actionPerformed(ActionEvent event)
- {
- Toolkit.getDefaultToolkit().beep();
- }
- }
-
- public static class CopyAction
- extends TextAction
- {
- public CopyAction()
- {
- super(copyAction);
- }
- public void actionPerformed(ActionEvent event)
- {
- }
- }
-
- public static class CutAction
- extends TextAction
- {
- public CutAction()
- {
- super(cutAction);
- }
-
- public void actionPerformed(ActionEvent event)
- {
- }
- }
-
- public static class DefaultKeyTypedAction
- extends TextAction
- {
- public DefaultKeyTypedAction()
- {
- super(defaultKeyTypedAction);
- }
-
- public void actionPerformed(ActionEvent event)
- {
- JTextComponent t = getTextComponent(event);
- if (t != null)
- {
- try
- {
- t.getDocument().insertString(t.getCaret().getDot(), event.getActionCommand(), null);
- t.getCaret().setDot(Math.min(t.getCaret().getDot() + 1,
- t.getDocument().getEndPosition().getOffset()));
- }
- catch (BadLocationException be)
- {
- // FIXME: we're not authorized to throw this.. swallow it?
- }
- }
- }
- }
-
- public static class InsertBreakAction
- extends TextAction
- {
- public InsertBreakAction()
- {
- super(insertBreakAction);
- }
-
- public void actionPerformed(ActionEvent event)
- {
- }
- }
-
- public static class InsertContentAction
- extends TextAction
- {
- public InsertContentAction()
- {
- super(insertContentAction);
- }
- public void actionPerformed(ActionEvent event)
- {
- }
- }
-
- public static class InsertTabAction
- extends TextAction
- {
- public InsertTabAction()
- {
- super(insertTabAction);
- }
-
- public void actionPerformed(ActionEvent event)
- {
- }
- }
-
- public static class PasteAction
- extends TextAction
- {
- public PasteAction()
- {
- super(pasteAction);
- }
-
- public void actionPerformed(ActionEvent event)
- {
- }
- }
-
- private static final long serialVersionUID = 9017245433028523428L;
-
- public static final String backwardAction = "caret-backward";
- public static final String beepAction = "beep";
- public static final String beginAction = "caret-begin";
- public static final String beginLineAction = "caret-begin-line";
- public static final String beginParagraphAction = "caret-begin-paragraph";
- public static final String beginWordAction = "caret-begin-word";
- public static final String copyAction = "copy-to-clipboard";
- public static final String cutAction = "cut-to-clipboard";
- public static final String defaultKeyTypedAction = "default-typed";
- public static final String deleteNextCharAction = "delete-next";
- public static final String deletePrevCharAction = "delete-previous";
- public static final String downAction = "caret-down";
- public static final String endAction = "caret-end";
- public static final String endLineAction = "caret-end-line";
- public static final String EndOfLineStringProperty = "__EndOfLine__";
- public static final String endParagraphAction = "caret-end-paragraph";
- public static final String endWordAction = "caret-end-word";
- public static final String forwardAction = "caret-forward";
- public static final String insertBreakAction = "insert-break";
- public static final String insertContentAction = "insert-content";
- public static final String insertTabAction = "insert-tab";
- public static final String nextWordAction = "caret-next-word";
- public static final String pageDownAction = "page-down";
- public static final String pageUpAction = "page-up";
- public static final String pasteAction = "paste-from-clipboard";
- public static final String previousWordAction = "caret-previous-word";
- public static final String readOnlyAction = "set-read-only";
- public static final String selectAllAction = "select-all";
- public static final String selectionBackwardAction = "selection-backward";
- public static final String selectionBeginAction = "selection-begin";
- public static final String selectionBeginLineAction = "selection-begin-line";
- public static final String selectionBeginParagraphAction =
- "selection-begin-paragraph";
- public static final String selectionBeginWordAction = "selection-begin-word";
- public static final String selectionDownAction = "selection-down";
- public static final String selectionEndAction = "selection-end";
- public static final String selectionEndLineAction = "selection-end-line";
- public static final String selectionEndParagraphAction =
- "selection-end-paragraph";
- public static final String selectionEndWordAction = "selection-end-word";
- public static final String selectionForwardAction = "selection-forward";
- public static final String selectionNextWordAction = "selection-next-word";
- public static final String selectionPreviousWordAction =
- "selection-previous-word";
- public static final String selectionUpAction = "selection-up";
- public static final String selectLineAction = "select-line";
- public static final String selectParagraphAction = "select-paragraph";
- public static final String selectWordAction = "select-word";
- public static final String upAction = "caret-up";
- public static final String writableAction = "set-writable";
-
- public DefaultEditorKit()
- {
- }
-
- private static Action[] defaultActions =
- new Action[] {
- new BeepAction(),
- new CopyAction(),
- new CutAction(),
- new DefaultKeyTypedAction(),
- new InsertBreakAction(),
- new InsertContentAction(),
- new InsertTabAction(),
- new PasteAction(),
- new TextAction(deleteNextCharAction)
- {
- public void actionPerformed(ActionEvent event)
- {
- JTextComponent t = getTextComponent(event);
- if (t != null)
- {
- try
- {
- int pos = t.getCaret().getDot();
- if (pos < t.getDocument().getEndPosition().getOffset())
- {
- t.getDocument().remove(t.getCaret().getDot(), 1);
- }
- }
- catch (BadLocationException e)
- {
- // FIXME: we're not authorized to throw this.. swallow it?
- }
- }
- }
- },
- new TextAction(deletePrevCharAction)
- {
- public void actionPerformed(ActionEvent event)
- {
- JTextComponent t = getTextComponent(event);
- if (t != null)
- {
- try
- {
- int pos = t.getCaret().getDot();
- if (pos > t.getDocument().getStartPosition().getOffset())
- {
- t.getDocument().remove(pos - 1, 1);
- t.getCaret().setDot(pos - 1);
- }
- }
- catch (BadLocationException e)
- {
- // FIXME: we're not authorized to throw this.. swallow it?
- }
- }
- }
- },
- new TextAction(backwardAction)
- {
- public void actionPerformed(ActionEvent event)
- {
- JTextComponent t = getTextComponent(event);
- if (t != null)
- {
- t.getCaret().setDot(Math.max(t.getCaret().getDot() - 1,
- t.getDocument().getStartPosition().getOffset()));
- }
- }
- },
- new TextAction(forwardAction)
- {
- public void actionPerformed(ActionEvent event)
- {
- JTextComponent t = getTextComponent(event);
- if (t != null)
- {
- t.getCaret().setDot(Math.min(t.getCaret().getDot() + 1,
- t.getDocument().getEndPosition().getOffset()));
- }
- }
- },
- new TextAction(selectionBackwardAction)
- {
- public void actionPerformed(ActionEvent event)
- {
- JTextComponent t = getTextComponent(event);
- if (t != null)
- {
- t.getCaret().moveDot(Math.max(t.getCaret().getDot() - 1,
- t.getDocument().getStartPosition().getOffset()));
- }
- }
- },
- new TextAction(selectionForwardAction)
- {
- public void actionPerformed(ActionEvent event)
- {
- JTextComponent t = getTextComponent(event);
- if (t != null)
- {
- t.getCaret().moveDot(Math.min(t.getCaret().getDot() + 1,
- t.getDocument().getEndPosition().getOffset()));
- }
- }
- },
- };
-
- public Caret createCaret()
- {
- return new DefaultCaret();
- }
-
- public Document createDefaultDocument()
- {
- return new PlainDocument();
- }
-
- public Action[] getActions()
- {
- return defaultActions;
- }
-
- public String getContentType()
- {
- return "text/plain";
- }
-
- public ViewFactory getViewFactory()
- {
- return null;
- }
-
- public void read(InputStream in, Document document, int offset)
- throws BadLocationException, IOException
- {
- read(new InputStreamReader(in), document, offset);
- }
-
- public void read(Reader in, Document document, int offset)
- throws BadLocationException, IOException
- {
- BufferedReader reader = new BufferedReader(in);
-
- String line;
- StringBuffer content = new StringBuffer();
-
- while ((line = reader.readLine()) != null)
- {
- content.append(line);
- content.append("\n");
- }
-
- document.insertString(offset, content.toString(),
- SimpleAttributeSet.EMPTY);
- }
-
- public void write(OutputStream out, Document document, int offset, int len)
- throws BadLocationException, IOException
- {
- write(new OutputStreamWriter(out), document, offset, len);
- }
-
- public void write(Writer out, Document document, int offset, int len)
- throws BadLocationException, IOException
- {
- }
-}
diff --git a/libjava/javax/swing/text/DefaultHighlighter.java b/libjava/javax/swing/text/DefaultHighlighter.java
deleted file mode 100644
index c8d874caa51..00000000000
--- a/libjava/javax/swing/text/DefaultHighlighter.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/* DefaultHighlighter.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.util.Vector;
-
-public class DefaultHighlighter extends LayeredHighlighter
-{
- public static class DefaultHighlightPainter
- extends LayerPainter
- {
- private Color color;
-
- public DefaultHighlightPainter(Color c)
- {
- super();
- color = c;
- }
-
- public Color getColor()
- {
- return color;
- }
-
- private void paintHighlight(Graphics g, Rectangle rect)
- {
- g.fillRect(rect.x, rect.y, rect.width, rect.height);
- }
-
- public void paint(Graphics g, int p0, int p1, Shape bounds,
- JTextComponent c)
- {
- Rectangle r0 = null;
- Rectangle r1 = null;
- Rectangle rect = bounds.getBounds();
-
- try
- {
- r0 = c.modelToView(p0);
- r1 = c.modelToView(p1);
- }
- catch (BadLocationException e)
- {
- // This should never occur.
- return;
- }
-
- if (r0 == null || r1 == null)
- return;
-
- if (color == null)
- g.setColor(c.getSelectionColor());
- else
- g.setColor(color);
-
- // Check if only one line to highlight.
- if (r0.y == r1.y)
- {
- r0.width = r1.x - r0.x;
- paintHighlight(g, r0);
- return;
- }
-
- // First line, from p0 to end-of-line.
- r0.width = rect.x + rect.width - r0.x;
- paintHighlight(g, r0);
-
- // FIXME: All the full lines in between, if any (assumes that all lines
- // have the same height -- not a good assumption with JEditorPane/JTextPane).
- r0.y += r0.height;
- r0.x = rect.x;
-
- while (r0.y < r1.y)
- {
- paintHighlight(g, r0);
- r0.y += r0.height;
- }
-
- // Last line, from beginnin-of-line to p1.
- paintHighlight(g, r1);
- }
-
- public Shape paintLayer(Graphics g, int p0, int p1, Shape bounds,
- JTextComponent c, View view)
- {
- throw new InternalError();
- }
- }
-
- private class HighlightEntry
- {
- int p0;
- int p1;
- Highlighter.HighlightPainter painter;
-
- public HighlightEntry(int p0, int p1, Highlighter.HighlightPainter painter)
- {
- this.p0 = p0;
- this.p1 = p1;
- this.painter = painter;
- }
-
- public int getStartPosition()
- {
- return p0;
- }
-
- public int getEndPosition()
- {
- return p1;
- }
-
- public Highlighter.HighlightPainter getPainter()
- {
- return painter;
- }
- }
-
- /**
- * @specnote final as of 1.4
- */
- public static final LayeredHighlighter.LayerPainter DefaultPainter =
- new DefaultHighlightPainter(null);
-
- private JTextComponent textComponent;
- private Vector highlights = new Vector();
- private boolean drawsLayeredHighlights = true;
-
- public DefaultHighlighter()
- {
- }
-
- public boolean getDrawsLayeredHighlights()
- {
- return drawsLayeredHighlights;
- }
-
- public void setDrawsLayeredHighlights(boolean newValue)
- {
- drawsLayeredHighlights = newValue;
- }
-
- private void checkPositions(int p0, int p1)
- throws BadLocationException
- {
- if (p0 < 0)
- throw new BadLocationException("DefaultHighlighter", p0);
-
- if (p1 < p0)
- throw new BadLocationException("DefaultHighlighter", p1);
- }
-
- public void install(JTextComponent c)
- {
- textComponent = c;
- removeAllHighlights();
- }
-
- public void deinstall(JTextComponent c)
- {
- textComponent = null;
- }
-
- public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter painter)
- throws BadLocationException
- {
- checkPositions(p0, p1);
- HighlightEntry entry = new HighlightEntry(p0, p1, painter);
- highlights.add(entry);
- return entry;
- }
-
- public void removeHighlight(Object tag)
- {
- highlights.remove(tag);
- }
-
- public void removeAllHighlights()
- {
- highlights.clear();
- }
-
- public Highlighter.Highlight[] getHighlights()
- {
- return null;
- }
-
- public void changeHighlight(Object tag, int p0, int p1)
- throws BadLocationException
- {
- checkPositions(p0, p1);
- HighlightEntry entry = (HighlightEntry) tag;
- entry.p0 = p0;
- entry.p1 = p1;
- }
-
- public void paintLayeredHighlights(Graphics g, int p0, int p1,
- Shape viewBounds, JTextComponent editor,
- View view)
- {
- }
-
- public void paint(Graphics g)
- {
- // Check if there are any highlights.
- if (highlights.size() == 0)
- return;
-
- Shape bounds = textComponent.getBounds();
-
- for (int index = 0; index < highlights.size(); ++index)
- {
- HighlightEntry entry = (HighlightEntry) highlights.get(index);
- entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent);
- }
- }
-}
diff --git a/libjava/javax/swing/text/DefaultStyledDocument.java b/libjava/javax/swing/text/DefaultStyledDocument.java
deleted file mode 100644
index b3ce14a1fc5..00000000000
--- a/libjava/javax/swing/text/DefaultStyledDocument.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/* DefaultStyledDocument.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.io.Serializable;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class DefaultStyledDocument extends AbstractDocument
- implements StyledDocument
-{
- public class ElementBuffer
- implements Serializable
- {
- private Element root;
-
- public ElementBuffer(Element root)
- {
- this.root = root;
- }
-
- public Element getRootElement()
- {
- return root;
- }
- }
-
- public static final int BUFFER_SIZE_DEFAULT = 4096;
-
- protected DefaultStyledDocument.ElementBuffer buffer;
-
- public DefaultStyledDocument()
- {
- this(new GapContent(BUFFER_SIZE_DEFAULT), new StyleContext());
- }
-
- public DefaultStyledDocument(StyleContext context)
- {
- this(new GapContent(BUFFER_SIZE_DEFAULT), context);
- }
-
- public DefaultStyledDocument(AbstractDocument.Content content,
- StyleContext context)
- {
- super(content, context);
- buffer = new ElementBuffer(createDefaultRoot());
- setLogicalStyle(0, context.getStyle(StyleContext.DEFAULT_STYLE));
- }
-
- public Style addStyle(String nm, Style parent)
- {
- StyleContext context = (StyleContext) getAttributeContext();
- return context.addStyle(nm, parent);
- }
-
- protected AbstractDocument.AbstractElement createDefaultRoot()
- {
- Element[] tmp;
- BranchElement section = new BranchElement(null, null);
-
- BranchElement paragraph = new BranchElement(section, null);
- tmp = new Element[1];
- tmp[0] = paragraph;
- section.replace(0, 0, tmp);
-
- LeafElement leaf = new LeafElement(paragraph, null, 0, 1);
- tmp = new Element[1];
- tmp[0] = leaf;
- paragraph.replace(0, 0, tmp);
-
- return section;
- }
-
- public Element getCharacterElement(int position)
- {
- Element element = getDefaultRootElement();
-
- while (! element.isLeaf())
- {
- int index = element.getElementIndex(position);
- element = element.getElement(index);
- }
-
- return element;
- }
-
- public Color getBackground(AttributeSet attributes)
- {
- StyleContext context = (StyleContext) getAttributeContext();
- return context.getBackground(attributes);
- }
-
- public Element getDefaultRootElement()
- {
- return buffer.getRootElement();
- }
-
- public Font getFont(AttributeSet attributes)
- {
- StyleContext context = (StyleContext) getAttributeContext();
- return context.getFont(attributes);
- }
-
- public Color getForeground(AttributeSet attributes)
- {
- StyleContext context = (StyleContext) getAttributeContext();
- return context.getForeground(attributes);
- }
-
- public Style getLogicalStyle(int position)
- {
- Element paragraph = getParagraphElement(position);
- AttributeSet attributes = paragraph.getAttributes();
- return (Style) attributes.getResolveParent();
- }
-
- public Element getParagraphElement(int position)
- {
- Element element = getCharacterElement(position);
- return element.getParentElement();
- }
-
- public Style getStyle(String nm)
- {
- StyleContext context = (StyleContext) getAttributeContext();
- return context.getStyle(nm);
- }
-
- public void removeStyle(String nm)
- {
- StyleContext context = (StyleContext) getAttributeContext();
- context.removeStyle(nm);
- }
-
- public void setCharacterAttributes(int offset, int length,
- AttributeSet attributes,
- boolean replace)
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public void setLogicalStyle(int position, Style style)
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-
- public void setParagraphAttributes(int offset, int length,
- AttributeSet attributes,
- boolean replace)
- {
- // FIXME: Implement me.
- throw new Error("not implemented");
- }
-}
diff --git a/libjava/javax/swing/text/Document.java b/libjava/javax/swing/text/Document.java
deleted file mode 100644
index f23767f58ef..00000000000
--- a/libjava/javax/swing/text/Document.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/* Document.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import javax.swing.event.DocumentListener;
-import javax.swing.event.UndoableEditListener;
-
-/**
- * A Document is the model that backs up all text components in Swing.
- * This interface supports different kinds of implementations, from
- * simple plain text model up to complex styled HTML or RTF models.
- */
-public interface Document
-{
- /**
- * The key for the property that describes the source of a document.
- */
- String StreamDescriptionProperty = "stream";
-
- /**
- * The key for the property that is the title of a document.
- */
- String TitleProperty = "title";
-
- /**
- * Adds a {@link DocumentListener} to this document.
- *
- * @param listener the DocumentListener to add
- */
- void addDocumentListener(DocumentListener listener);
-
- /**
- * Adds an {@link UndoableEditListener} to this document.
- *
- * @param listener the UndoableEditListener to add
- */
- void addUndoableEditListener(UndoableEditListener listener);
-
- /**
- * Creates a mark in the character content at the specified offset.
- *
- * @param offs the offset where to place the mark
- *
- * @return the created Position object
- *
- * @throws BadLocationException of the specified offset is not a valid
- * position in the documents content
- */
- Position createPosition(int offs)
- throws BadLocationException;
-
- /**
- * Returns the default root element. Views should be using this element
- * unless other mechanisms for assigning views to element structure is
- * provided.
- *
- * @return the default root element
- */
- Element getDefaultRootElement();
-
- /**
- * Returns the position that marks the end of the document.
- *
- * @return the position that marks the end of the document
- */
- Position getEndPosition();
-
- /**
- * Returns the length of the document content.
- *
- * @return the length of the document content
- */
- int getLength();
-
- /**
- * Returns a document property with the specified key.
- *
- * @param key the (non-null) key for the property to fetch
- *
- * @return the property for <code>key</code> or null if no such property
- * is stored
- */
- Object getProperty(Object key);
-
- /**
- * Returns the root elements of the document content.
- *
- * @return the root elements of the document content
- */
- Element[] getRootElements();
-
- /**
- * Returns the position that marks the beginning of the document
- * content.
- *
- * @return the start position
- */
- Position getStartPosition();
-
- /**
- * Returns the textual content starting at <code>offset</code> with
- * a length of <code>length</code>.
- *
- * @param offset the beginning of the text fragment to fetch
- * @param length the length of the text fragment to fetch
- *
- * @return the text fragment starting at <code>offset</code> with
- * a length of <code>length</code>
- *
- * @throws BadLocationException if <code>offset</code> or <code>length</code>
- * are no valid locations in the document content
- */
- String getText(int offset, int length)
- throws BadLocationException;
-
- /**
- * Fetch the textual content starting at <code>offset</code> with
- * a length of <code>length</code> and store it in <code>txt</code>.
- *
- * @param offset the beginning of the text fragment to fetch
- * @param length the length of the text fragment to fetch
- * @param txt the Segment where to store the text fragment
- *
- * @throws BadLocationException if <code>offset</code> or <code>length</code>
- * are no valid locations in the document content
- */
- void getText(int offset, int length, Segment txt)
- throws BadLocationException;
-
- /**
- * Inserts a piece of text with an AttributeSet at the specified
- * <code>offset</code>.
- *
- * @param offset the location where to insert the content
- * @param str the textual content to insert
- * @param a the Attributes associated with the piece of text
- *
- * @throws BadLocationException if <code>offset</code>
- * is not a valid location in the document content
- */
- void insertString(int offset, String str, AttributeSet a)
- throws BadLocationException;
-
- /**
- * Sets a document property.
- *
- * @param key the key of the property
- * @param value the value of the property
- */
- void putProperty(Object key, Object value);
-
- /**
- * Removes a piece of content.
- *
- * @param offs the location of the fragment to remove
- * @param len the length of the fragment to remove
- *
- * @throws BadLocationException if <code>offs</code> or <code>len</code>
- * are no valid locations in the document content
- */
- void remove(int offs, int len)
- throws BadLocationException;
-
- /**
- * Removes a DocumentListener from this Document.
- *
- * @param listener the DocumentListener to remove
- */
- void removeDocumentListener(DocumentListener listener);
-
- /**
- * Removes an UndoableEditListener from this Document.
- *
- * @param listener the UndoableEditListener to remove
- */
- void removeUndoableEditListener(UndoableEditListener listener);
-
- /**
- * This allows the Document to be rendered safely. It is made sure that
- * the Runnable can read the document without any changes while reading.
- * The Runnable is not allowed to change the Document itself.
- *
- * @param r the Runnable that renders the Document
- */
- void render(Runnable r);
-}
diff --git a/libjava/javax/swing/text/DocumentFilter.java b/libjava/javax/swing/text/DocumentFilter.java
deleted file mode 100644
index f86f41ca6c0..00000000000
--- a/libjava/javax/swing/text/DocumentFilter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* DocumentFilter.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-public class DocumentFilter
-{
- public abstract static class FilterBypass
- {
- public FilterBypass()
- {
- // Do nothing here.
- }
-
- public abstract Document getDocument();
-
- public abstract void insertString(int offset, String string,
- AttributeSet attr)
- throws BadLocationException;
-
- public abstract void remove(int offset, int length)
- throws BadLocationException;
-
- public abstract void replace(int offset, int length, String string,
- AttributeSet attrs)
- throws BadLocationException;
- }
-
- public void insertString(DocumentFilter.FilterBypass fb, int offset,
- String string, AttributeSet attr)
- throws BadLocationException
- {
- fb.insertString(offset, string, attr);
- }
-
- public void remove(DocumentFilter.FilterBypass fb, int offset, int length)
- throws BadLocationException
- {
- fb.remove(offset, length);
- }
-
- public void replace(DocumentFilter.FilterBypass fb, int offset, int length,
- String text, AttributeSet attr)
- throws BadLocationException
- {
- fb.replace(offset, length, text, attr);
- }
-}
diff --git a/libjava/javax/swing/text/EditorKit.java b/libjava/javax/swing/text/EditorKit.java
deleted file mode 100644
index bd51a866f68..00000000000
--- a/libjava/javax/swing/text/EditorKit.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* EditorKit.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Serializable;
-import java.io.Writer;
-
-import javax.swing.Action;
-import javax.swing.JEditorPane;
-
-public abstract class EditorKit
- implements Cloneable, Serializable
-{
- private static final long serialVersionUID = -5044124649345887822L;
-
- public EditorKit()
- {
- }
-
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- return null;
- }
- }
-
- /**
- * Called when the kit is being removed from the JEditorPane.
- */
- public void deinstall(JEditorPane c)
- {
- }
-
- public void install(JEditorPane c)
- {
- }
-
- public abstract Caret createCaret();
- public abstract Document createDefaultDocument();
- public abstract Action[] getActions();
- public abstract String getContentType();
- public abstract ViewFactory getViewFactory();
- public abstract void read(InputStream in, Document doc, int pos)
- throws BadLocationException, IOException;
- public abstract void read(Reader in, Document doc, int pos)
- throws BadLocationException, IOException;
- public abstract void write(OutputStream out, Document doc, int pos, int len)
- throws BadLocationException, IOException;
- public abstract void write(Writer out, Document doc, int pos, int len)
- throws BadLocationException, IOException;
-}
diff --git a/libjava/javax/swing/text/Element.java b/libjava/javax/swing/text/Element.java
deleted file mode 100644
index eb53ee9d3e1..00000000000
--- a/libjava/javax/swing/text/Element.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Element.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-
-
-public interface Element
-{
- AttributeSet getAttributes();
- Document getDocument();
- Element getElement(int index);
- int getElementCount();
- int getElementIndex(int offset);
- int getEndOffset();
- String getName();
- Element getParentElement();
- int getStartOffset();
- boolean isLeaf();
- }
diff --git a/libjava/javax/swing/text/FieldView.java b/libjava/javax/swing/text/FieldView.java
deleted file mode 100644
index bb0ed062356..00000000000
--- a/libjava/javax/swing/text/FieldView.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/* FieldView.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Component;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Shape;
-
-public class FieldView extends PlainView
-{
- public FieldView(Element elem)
- {
- super(elem);
- }
-
- protected FontMetrics getFontMetrics()
- {
- Component container = getContainer();
- return container.getFontMetrics(container.getFont());
- }
-
- public float getPreferredSpan(int axis)
- {
- if (axis != X_AXIS && axis != Y_AXIS)
- throw new IllegalArgumentException();
-
- FontMetrics fm = getFontMetrics();
-
- if (axis == Y_AXIS)
- return fm.getHeight();
-
- String text;
- Element elem = getElement();
-
- try
- {
- text = elem.getDocument().getText(elem.getStartOffset(),
- elem.getEndOffset());
- }
- catch (BadLocationException e)
- {
- // This should never happen.
- text = "";
- }
-
- return fm.stringWidth(text);
- }
-
- public int getResizeWeight(int axis)
- {
- return axis = axis == X_AXIS ? 1 : 0;
- }
-
- public Shape modelToView(int pos, Shape a, Position.Bias bias)
- throws BadLocationException
- {
- return super.modelToView(pos, a, bias);
- }
-
- public void paint(Graphics g, Shape s)
- {
- super.paint(g, s);
- }
-}
diff --git a/libjava/javax/swing/text/GapContent.java b/libjava/javax/swing/text/GapContent.java
deleted file mode 100644
index 1bbef8f93d6..00000000000
--- a/libjava/javax/swing/text/GapContent.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/* GapContent.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.io.Serializable;
-
-import javax.swing.undo.UndoableEdit;
-
-/**
- * This implementation of {@link AbstractDocument.Content} uses a gapped
- * buffer. This takes advantage of the fact that text area content is
- * mostly inserted sequentially. The buffer is a char array that maintains
- * a gap at the current insertion point. If characters a inserted at
- * gap boundaries, the cost is minimal (simple array access). The array only
- * has to be shifted around when the insertion point moves (then the gap also
- * moves and one array copy is necessary) or when the gap is filled up and
- * the buffer has to be enlarged.
- *
- * TODO: Implement UndoableEdit support stuff
- */
-public class GapContent
- implements AbstractDocument.Content, Serializable
-{
- private static final long serialVersionUID = 8374645204155842629L;
-
- /**
- * This is the default buffer size and the amount of bytes that
- * a buffer is extended if it is full.
- */
- static final int DEFAULT_BUFSIZE = 64;
-
- /**
- * The text buffer.
- */
- char[] buffer;
-
- /**
- * The index of the first character of the gap.
- */
- int gapStart;
-
- /**
- * The index of the character after the last character of the gap.
- */
- int gapEnd;
-
- /**
- * Creates a new GapContent object.
- */
- public GapContent()
- {
- this(DEFAULT_BUFSIZE);
- }
-
- /**
- * Creates a new GapContent object with a specified initial size.
- *
- * @param size the initial size of the buffer
- */
- public GapContent(int size)
- {
- buffer = (char[]) allocateArray(size);
- gapStart = 0;
- gapEnd = size - 1;
- buffer[size - 1] = '\n';
- }
-
- /**
- * Allocates an array of the specified length that can then be used as
- * buffer.
- *
- * @param size the size of the array to be allocated
- *
- * @return the allocated array
- */
- protected Object allocateArray(int size)
- {
- return new char[size];
- }
-
- /**
- * Returns the length of the allocated buffer array.
- *
- * @return the length of the allocated buffer array
- */
- protected int getArrayLength()
- {
- return buffer.length;
- }
-
- /**
- * Returns the length of the content.
- *
- * @return the length of the content
- */
- public int length()
- {
- return buffer.length - (gapEnd - gapStart);
- }
-
- /**
- * Inserts a string at the specified position.
- *
- * @param where the position where the string is inserted
- * @param str the string that is to be inserted
- *
- * @return an UndoableEdit object (currently not supported, so
- * <code>null</code> is returned)
- *
- * @throws BadLocationException if <code>where</code> is not a valid location
- * in the buffer
- */
- public UndoableEdit insertString(int where, String str)
- throws BadLocationException
- {
- // check arguments
- int length = length();
- int strLen = str.length();
-
- if (where >= length)
- throw new BadLocationException("the where argument cannot be greater"
- + " than the content length", where);
-
- // check if the gap is big enough to hold the string
- if ((gapEnd - gapStart) < strLen)
- // make room for this string and some more
- shiftEnd(strLen + DEFAULT_BUFSIZE);
-
- // are we at the gap boundary?
- if (where != gapStart)
- shiftGap(where);
-
- // now we can simple copy the string into the gap and adjust the
- // gap boundaries
- System.arraycopy(str.toCharArray(), 0, buffer, gapStart, strLen);
- gapStart += strLen;
- return null;
- }
-
- /**
- * Removes a piece of content at th specified position.
- *
- * @param where the position where the content is to be removed
- * @param nitems number of characters to be removed
- *
- * @return an UndoableEdit object (currently not supported, so
- * <code>null</code> is returned)
- *
- * @throws BadLocationException if <code>where</code> is not a valid location
- * in the buffer
- */
- public UndoableEdit remove(int where, int nitems)
- throws BadLocationException
- {
- // check arguments
- int length = length();
-
- if (where >= length)
- throw new BadLocationException("the where argument cannot be greater"
- + " than the content length", where);
- if ((where + nitems) > length)
- throw new BadLocationException("where + nitems cannot be greater"
- + " than the content length",
- where + nitems);
-
- // check if we are at the gap boundary
- if (where != gapStart)
- shiftGap(where);
-
- // now we simply have to enlarge the gap
- gapEnd += nitems;
- return null;
- }
-
- /**
- * Returns a piece of content as String.
- *
- * @param where the start location of the fragment
- * @param len the length of the fragment
- *
- * @throws BadLocationException if <code>where</code> or
- * <code>where + len</code> are no valid locations in the buffer
- */
- public String getString(int where, int len) throws BadLocationException
- {
- Segment seg = new Segment();
- getChars(where, len, seg);
- return new String(seg.array, seg.offset, seg.count);
- }
-
- /**
- * Fetches a piece of content and stores it in a {@link Segment} object.
- *
- * If the requested piece of text spans the gap, the content is copied
- * into a new array. If it doesn't then it is contiguous and the
- * actual content store is returned.
- *
- * @param where the start location of the fragment
- * @param len the length of the fragment
- * @param txt the Segment object to store the fragment in
- *
- * @throws BadLocationException if <code>where</code> or
- * <code>where + len</code> are no valid locations in the buffer
- */
- public void getChars(int where, int len, Segment txt)
- throws BadLocationException
- {
- // check arguments
- int length = length();
- if (where >= length)
- throw new BadLocationException("the where argument cannot be greater"
- + " than the content length", where);
- if ((where + len) > length)
- throw new BadLocationException("len plus where cannot be greater"
- + " than the content length",
- len + where);
-
- // check if requested segment is contiguous
- if ((where < gapStart) && ((gapStart - where) < len))
- {
- // requested segment is not contiguous -> copy the pieces together
- char[] copy = new char[len];
- int lenFirst = gapStart - where; // the length of the first segment
- System.arraycopy(buffer, where, copy, 0, lenFirst);
- System.arraycopy(buffer, gapEnd, copy, lenFirst, len - lenFirst);
- txt.array = copy;
- txt.offset = 0;
- txt.count = len;
- }
- else
- {
- // requested segment is contiguous -> we can simply return the
- // actual content
- txt.array = buffer;
- if (where < gapStart)
- txt.offset = where;
- else
- txt.offset = where + (gapEnd - gapStart);
- txt.count = len;
- }
- }
-
- /**
- * Creates and returns a mark at the specified position.
- *
- * @param offset the position at which to create the mark
- *
- * @return the create Position object for the mark
- *
- * @throws BadLocationException if the offset is not a valid position in
- * the buffer
- */
- public Position createPosition(final int offset) throws BadLocationException
- {
- return new Position()
- {
- int off = offset;
-
- public int getOffset()
- {
- return off;
- }
- };
- }
-
- /**
- * Enlarges the gap. This allocates a new bigger buffer array, copy the
- * segment before the gap as it is and the segment after the gap at
- * the end of the new buffer array. This does change the gapEnd mark
- * but not the gapStart mark.
- *
- * @param newSize the new size of the gap
- */
- protected void shiftEnd(int newSize)
- {
- char[] newBuf = (char[]) allocateArray(length() + newSize);
- System.arraycopy(buffer, 0, newBuf, 0, gapStart);
- System.arraycopy(buffer, gapEnd, newBuf, gapStart + newSize,
- buffer.length - gapEnd);
- gapEnd = gapStart + newSize;
- buffer = newBuf;
- }
-
- /**
- * Shifts the gap to the specified position.
- *
- * @param newGapStart the new start position of the gap
- */
- protected void shiftGap(int newGapStart)
- {
- int newGapEnd = newGapStart + (gapEnd - gapStart);
-
- if (newGapStart == gapStart)
- return;
- else if (newGapStart < gapStart)
- {
- System.arraycopy(buffer, newGapStart, buffer, newGapEnd,
- gapStart - newGapStart);
- gapStart = newGapStart;
- gapEnd = newGapEnd;
- }
- else
- {
- System.arraycopy(buffer, gapEnd, buffer, gapStart,
- newGapStart - gapStart);
- gapStart = newGapStart;
- gapEnd = newGapEnd;
- }
- }
-
- /**
- * Returns the allocated buffer array.
- *
- * @return the allocated buffer array
- */
- protected Object getArray()
- {
- return buffer;
- }
-}
diff --git a/libjava/javax/swing/text/Highlighter.java b/libjava/javax/swing/text/Highlighter.java
deleted file mode 100644
index 91f3b7903d0..00000000000
--- a/libjava/javax/swing/text/Highlighter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Highlighter.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Graphics;
-import java.awt.Shape;
-
-
-public interface Highlighter
-{
- public interface Highlight
- {
- int getEndOffset();
-
- int getStartOffset();
-
- HighlightPainter getPainter();
- }
-
- public interface HighlightPainter
- {
- void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c);
- }
-
- void install(JTextComponent c);
-
- void deinstall(JTextComponent c);
-
- Object addHighlight(int p0, int p1, HighlightPainter p)
- throws BadLocationException;
-
- void removeAllHighlights();
-
- void removeHighlight(Object tag);
-
- void changeHighlight(Object tag, int p0, int p1)
- throws BadLocationException;
-
- Highlight[] getHighlights();
-
- void paint(Graphics g);
-}
-
diff --git a/libjava/javax/swing/text/JTextComponent.java b/libjava/javax/swing/text/JTextComponent.java
deleted file mode 100644
index 186ec58f67e..00000000000
--- a/libjava/javax/swing/text/JTextComponent.java
+++ /dev/null
@@ -1,1564 +0,0 @@
-/* JTextComponent.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.AWTEvent;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.datatransfer.Clipboard;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.StringSelection;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.awt.event.ActionEvent;
-import java.awt.event.InputMethodListener;
-import java.awt.event.KeyEvent;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleStateSet;
-import javax.accessibility.AccessibleText;
-import javax.swing.Action;
-import javax.swing.ActionMap;
-import javax.swing.InputMap;
-import javax.swing.JComponent;
-import javax.swing.JViewport;
-import javax.swing.KeyStroke;
-import javax.swing.Scrollable;
-import javax.swing.TransferHandler;
-import javax.swing.UIManager;
-import javax.swing.event.CaretEvent;
-import javax.swing.event.CaretListener;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.plaf.ActionMapUIResource;
-import javax.swing.plaf.InputMapUIResource;
-import javax.swing.plaf.TextUI;
-
-public abstract class JTextComponent extends JComponent
- implements Scrollable, Accessible
-{
- /**
- * AccessibleJTextComponent
- */
- public class AccessibleJTextComponent extends AccessibleJComponent
- implements AccessibleText, CaretListener, DocumentListener
- {
- private static final long serialVersionUID = 7664188944091413696L;
-
- /**
- * Constructor AccessibleJTextComponent
- * @param component TODO
- */
- public AccessibleJTextComponent()
- {
- }
-
- /**
- * getCaretPosition
- * @return int
- */
- public int getCaretPosition()
- {
- return 0; // TODO
- }
-
- /**
- * getSelectedText
- * @return String
- */
- public String getSelectedText()
- {
- return null; // TODO
- }
-
- /**
- * getSelectionStart
- * @return int
- */
- public int getSelectionStart()
- {
- return 0; // TODO
- }
-
- /**
- * getSelectionEnd
- * @return int
- */
- public int getSelectionEnd()
- {
- return 0; // TODO
- }
-
- /**
- * caretUpdate
- * @param value0 TODO
- */
- public void caretUpdate(CaretEvent value0)
- {
- // TODO
- }
-
- /**
- * getAccessibleStateSet
- * @return AccessibleStateSet
- */
- public AccessibleStateSet getAccessibleStateSet()
- {
- return null; // TODO
- }
-
- /**
- * getAccessibleRole
- * @return AccessibleRole
- */
- public AccessibleRole getAccessibleRole()
- {
- return null; // TODO
- }
-
- /**
- * getAccessibleText
- * @return AccessibleText
- */
- public AccessibleText getAccessibleText()
- {
- return null; // TODO
- }
-
- /**
- * insertUpdate
- * @param value0 TODO
- */
- public void insertUpdate(DocumentEvent value0)
- {
- // TODO
- }
-
- /**
- * removeUpdate
- * @param value0 TODO
- */
- public void removeUpdate(DocumentEvent value0)
- {
- // TODO
- }
-
- /**
- * changedUpdate
- * @param value0 TODO
- */
- public void changedUpdate(DocumentEvent value0)
- {
- // TODO
- }
-
- /**
- * getIndexAtPoint
- * @param value0 TODO
- * @return int
- */
- public int getIndexAtPoint(Point value0)
- {
- return 0; // TODO
- }
-
- /**
- * getRootEditorRect
- * @return Rectangle
- */
- Rectangle getRootEditorRect()
- {
- return null;
- }
-
- /**
- * getCharacterBounds
- * @param value0 TODO
- * @return Rectangle
- */
- public Rectangle getCharacterBounds(int value0)
- {
- return null; // TODO
- }
-
- /**
- * getCharCount
- * @return int
- */
- public int getCharCount()
- {
- return 0; // TODO
- }
-
- /**
- * getCharacterAttribute
- * @param value0 TODO
- * @return AttributeSet
- */
- public AttributeSet getCharacterAttribute(int value0)
- {
- return null; // TODO
- }
-
- /**
- * getAtIndex
- * @param value0 TODO
- * @param value1 TODO
- * @return String
- */
- public String getAtIndex(int value0, int value1)
- {
- return null; // TODO
- }
-
- /**
- * getAfterIndex
- * @param value0 TODO
- * @param value1 TODO
- * @return String
- */
- public String getAfterIndex(int value0, int value1)
- {
- return null; // TODO
- }
-
- /**
- * getBeforeIndex
- * @param value0 TODO
- * @param value1 TODO
- * @return String
- */
- public String getBeforeIndex(int value0, int value1)
- {
- return null; // TODO
- }
- }
-
- public static class KeyBinding
- {
- public KeyStroke key;
- public String actionName;
-
- /**
- * Creates a new <code>KeyBinding</code> instance.
- *
- * @param key a <code>KeyStroke</code> value
- * @param actionName a <code>String</code> value
- */
- public KeyBinding(KeyStroke key, String actionName)
- {
- this.key = key;
- this.actionName = actionName;
- }
- }
-
- /**
- * According to <a
- * href="http://java.sun.com/products/jfc/tsc/special_report/kestrel/keybindings.html">this
- * report</a>, a pair of private classes wraps a {@link
- * javax.swing.text.Keymap} in the new {@link InputMap} / {@link
- * ActionMap} interfaces, such that old Keymap-using code can make use of
- * the new framework.
- *
- * <p>A little bit of experimentation with these classes reveals the following
- * structure:
- *
- * <ul>
- *
- * <li>KeymapWrapper extends {@link InputMap} and holds a reference to
- * the underlying {@link Keymap}.</li>
- *
- * <li>KeymapWrapper maps {@link KeyStroke} objects to {@link Action}
- * objects, by delegation to the underlying {@link Keymap}.</li>
- *
- * <li>KeymapActionMap extends {@link ActionMap} also holds a reference to
- * the underlying {@link Keymap} but only appears to use it for listing
- * its keys. </li>
- *
- * <li>KeymapActionMap maps all {@link Action} objects to
- * <em>themselves</em>, whether they exist in the underlying {@link
- * Keymap} or not, and passes other objects to the parent {@link
- * ActionMap} for resolving.
- *
- * </ul>
- */
-
- private class KeymapWrapper extends InputMap
- {
- Keymap map;
-
- public KeymapWrapper(Keymap k)
- {
- map = k;
- }
-
- public int size()
- {
- return map.getBoundKeyStrokes().length + super.size();
- }
-
- public Object get(KeyStroke ks)
- {
- Action mapped = null;
- Keymap m = map;
- while(mapped == null && m != null)
- {
- mapped = m.getAction(ks);
- if (mapped == null && ks.getKeyEventType() == KeyEvent.KEY_TYPED)
- mapped = m.getDefaultAction();
- if (mapped == null)
- m = m.getResolveParent();
- }
-
- if (mapped == null)
- return super.get(ks);
- else
- return mapped;
- }
-
- public KeyStroke[] keys()
- {
- KeyStroke[] superKeys = super.keys();
- KeyStroke[] mapKeys = map.getBoundKeyStrokes();
- KeyStroke[] bothKeys = new KeyStroke[superKeys.length + mapKeys.length];
- for (int i = 0; i < superKeys.length; ++i)
- bothKeys[i] = superKeys[i];
- for (int i = 0; i < mapKeys.length; ++i)
- bothKeys[i + superKeys.length] = mapKeys[i];
- return bothKeys;
- }
-
- public KeyStroke[] allKeys()
- {
- KeyStroke[] superKeys = super.allKeys();
- KeyStroke[] mapKeys = map.getBoundKeyStrokes();
- KeyStroke[] bothKeys = new KeyStroke[superKeys.length + mapKeys.length];
- for (int i = 0; i < superKeys.length; ++i)
- bothKeys[i] = superKeys[i];
- for (int i = 0; i < mapKeys.length; ++i)
- bothKeys[i + superKeys.length] = mapKeys[i];
- return bothKeys;
- }
- }
-
- private class KeymapActionMap extends ActionMap
- {
- Keymap map;
-
- public KeymapActionMap(Keymap k)
- {
- map = k;
- }
-
- public Action get(Object cmd)
- {
- if (cmd instanceof Action)
- return (Action) cmd;
- else
- return super.get(cmd);
- }
-
- public int size()
- {
- return map.getBoundKeyStrokes().length + super.size();
- }
-
- public Object[] keys()
- {
- Object[] superKeys = super.keys();
- Object[] mapKeys = map.getBoundKeyStrokes();
- Object[] bothKeys = new Object[superKeys.length + mapKeys.length];
- for (int i = 0; i < superKeys.length; ++i)
- bothKeys[i] = superKeys[i];
- for (int i = 0; i < mapKeys.length; ++i)
- bothKeys[i + superKeys.length] = mapKeys[i];
- return bothKeys;
- }
-
- public Object[] allKeys()
- {
- Object[] superKeys = super.allKeys();
- Object[] mapKeys = map.getBoundKeyStrokes();
- Object[] bothKeys = new Object[superKeys.length + mapKeys.length];
- for (int i = 0; i < superKeys.length; ++i)
- bothKeys[i] = superKeys[i];
- for (int i = 0; i < mapKeys.length; ++i)
- bothKeys[i + superKeys.length] = mapKeys[i];
- return bothKeys;
- }
-
- }
-
- static class DefaultKeymap implements Keymap
- {
- String name;
- Keymap parent;
- Hashtable map;
- Action defaultAction;
-
- public DefaultKeymap(String name)
- {
- this.name = name;
- this.map = new Hashtable();
- }
-
- public void addActionForKeyStroke(KeyStroke key, Action a)
- {
- map.put(key, a);
- }
-
- /**
- * Looks up a KeyStroke either in the current map or the parent Keymap;
- * does <em>not</em> return the default action if lookup fails.
- *
- * @param key The KeyStroke to look up an Action for.
- *
- * @return The mapping for <code>key</code>, or <code>null</code>
- * if no mapping exists in this Keymap or any of its parents.
- */
- public Action getAction(KeyStroke key)
- {
- if (map.containsKey(key))
- return (Action) map.get(key);
- else if (parent != null)
- return parent.getAction(key);
- else
- return null;
- }
-
- public Action[] getBoundActions()
- {
- Action [] ret = new Action[map.size()];
- Enumeration e = map.elements();
- int i = 0;
- while (e.hasMoreElements())
- {
- ret[i++] = (Action) e.nextElement();
- }
- return ret;
- }
-
- public KeyStroke[] getBoundKeyStrokes()
- {
- KeyStroke [] ret = new KeyStroke[map.size()];
- Enumeration e = map.keys();
- int i = 0;
- while (e.hasMoreElements())
- {
- ret[i++] = (KeyStroke) e.nextElement();
- }
- return ret;
- }
-
- public Action getDefaultAction()
- {
- return defaultAction;
- }
-
- public KeyStroke[] getKeyStrokesForAction(Action a)
- {
- int i = 0;
- Enumeration e = map.keys();
- while (e.hasMoreElements())
- {
- if (map.get(e.nextElement()).equals(a))
- ++i;
- }
- KeyStroke [] ret = new KeyStroke[i];
- i = 0;
- e = map.keys();
- while (e.hasMoreElements())
- {
- KeyStroke k = (KeyStroke) e.nextElement();
- if (map.get(k).equals(a))
- ret[i++] = k;
- }
- return ret;
- }
-
- public String getName()
- {
- return name;
- }
-
- public Keymap getResolveParent()
- {
- return parent;
- }
-
- public boolean isLocallyDefined(KeyStroke key)
- {
- return map.containsKey(key);
- }
-
- public void removeBindings()
- {
- map.clear();
- }
-
- public void removeKeyStrokeBinding(KeyStroke key)
- {
- map.remove(key);
- }
-
- public void setDefaultAction(Action a)
- {
- defaultAction = a;
- }
-
- public void setResolveParent(Keymap p)
- {
- parent = p;
- }
- }
-
- class DefaultTransferHandler
- extends TransferHandler
- {
- public boolean canImport(JComponent component, DataFlavor[] flavors)
- {
- JTextComponent textComponent = (JTextComponent) component;
-
- if (! (textComponent.isEnabled()
- && textComponent.isEditable()
- && flavors != null))
- return false;
-
- for (int i = 0; i < flavors.length; ++i)
- if (flavors[i].equals(DataFlavor.stringFlavor))
- return true;
-
- return false;
- }
-
- public void exportToClipboard(JComponent component, Clipboard clipboard,
- int action)
- {
- JTextComponent textComponent = (JTextComponent) component;
- int start = textComponent.getSelectionStart();
- int end = textComponent.getSelectionEnd();
-
- if (start == end)
- return;
-
- try
- {
- // Copy text to clipboard.
- String data = textComponent.getDocument().getText(start, end);
- StringSelection selection = new StringSelection(data);
- clipboard.setContents(selection, null);
-
- // Delete selected text on cut action.
- if (action == MOVE)
- doc.remove(start, end - start);
- }
- catch (BadLocationException e)
- {
- // Ignore this and do nothing.
- }
- }
-
- public int getSourceActions()
- {
- return NONE;
- }
-
- public boolean importData(JComponent component, Transferable transferable)
- {
- DataFlavor flavor = null;
- DataFlavor[] flavors = transferable.getTransferDataFlavors();
-
- if (flavors == null)
- return false;
-
- for (int i = 0; i < flavors.length; ++i)
- if (flavors[i].equals(DataFlavor.stringFlavor))
- flavor = flavors[i];
-
- if (flavor == null)
- return false;
-
- try
- {
- JTextComponent textComponent = (JTextComponent) component;
- String data = (String) transferable.getTransferData(flavor);
- textComponent.replaceSelection(data);
- return true;
- }
- catch (IOException e)
- {
- // Ignored.
- }
- catch (UnsupportedFlavorException e)
- {
- // Ignored.
- }
-
- return false;
- }
- }
-
- private static final long serialVersionUID = -8796518220218978795L;
-
- public static final String DEFAULT_KEYMAP = "default";
- public static final String FOCUS_ACCELERATOR_KEY = "focusAcceleratorKey";
-
- private static DefaultTransferHandler defaultTransferHandler;
- private static Hashtable keymaps = new Hashtable();
- private Keymap keymap;
- private char focusAccelerator = '\0';
- private NavigationFilter navigationFilter;
-
- /**
- * Get a Keymap from the global keymap table, by name.
- *
- * @param n The name of the Keymap to look up
- *
- * @return A Keymap associated with the provided name, or
- * <code>null</code> if no such Keymap exists
- *
- * @see #addKeymap()
- * @see #removeKeymap()
- * @see #keymaps
- */
- public static Keymap getKeymap(String n)
- {
- return (Keymap) keymaps.get(n);
- }
-
- /**
- * Remove a Keymap from the global Keymap table, by name.
- *
- * @param n The name of the Keymap to remove
- *
- * @return The keymap removed from the global table
- *
- * @see #addKeymap()
- * @see #getKeymap()
- * @see #keymaps
- */
- public static Keymap removeKeymap(String n)
- {
- Keymap km = (Keymap) keymaps.get(n);
- keymaps.remove(n);
- return km;
- }
-
- /**
- * Create a new Keymap with a specific name and parent, and add the new
- * Keymap to the global keymap table. The name may be <code>null</code>,
- * in which case the new Keymap will <em>not</em> be added to the global
- * Keymap table. The parent may also be <code>null</code>, which is
- * harmless.
- *
- * @param n The name of the new Keymap, or <code>null</code>
- * @param parent The parent of the new Keymap, or <code>null</code>
- *
- * @return The newly created Keymap
- *
- * @see #removeKeymap()
- * @see #getKeymap()
- * @see #keymaps
- */
- public static Keymap addKeymap(String n, Keymap parent)
- {
- Keymap k = new DefaultKeymap(n);
- k.setResolveParent(parent);
- if (n != null)
- keymaps.put(n, k);
- return k;
- }
-
- /**
- * Get the current Keymap of this component.
- *
- * @return The component's current Keymap
- *
- * @see #setKeymap()
- * @see #keymap
- */
- public Keymap getKeymap()
- {
- return keymap;
- }
-
- /**
- * Set the current Keymap of this component, installing appropriate
- * {@link KeymapWrapper} and {@link KeymapActionMap} objects in the
- * {@link InputMap} and {@link ActionMap} parent chains, respectively,
- * and fire a property change event with name <code>"keymap"</code>.
- *
- * @see #getKeymap()
- * @see #keymap
- */
- public void setKeymap(Keymap k)
- {
-
- // phase 1: replace the KeymapWrapper entry in the InputMap chain.
- // the goal here is to always maintain the following ordering:
- //
- // [InputMap]? -> [KeymapWrapper]? -> [InputMapUIResource]*
- //
- // that is to say, component-specific InputMaps need to remain children
- // of Keymaps, and Keymaps need to remain children of UI-installed
- // InputMaps (and the order of each group needs to be preserved, of
- // course).
-
- KeymapWrapper kw = (k == null ? null : new KeymapWrapper(k));
- InputMap childInputMap = getInputMap(JComponent.WHEN_FOCUSED);
- if (childInputMap == null)
- setInputMap(JComponent.WHEN_FOCUSED, kw);
- else
- {
- while (childInputMap.getParent() != null
- && !(childInputMap.getParent() instanceof KeymapWrapper)
- && !(childInputMap.getParent() instanceof InputMapUIResource))
- childInputMap = childInputMap.getParent();
-
- // option 1: there is nobody to replace at the end of the chain
- if (childInputMap.getParent() == null)
- childInputMap.setParent(kw);
-
- // option 2: there is already a KeymapWrapper in the chain which
- // needs replacing (possibly with its own parents, possibly without)
- else if (childInputMap.getParent() instanceof KeymapWrapper)
- {
- if (kw == null)
- childInputMap.setParent(childInputMap.getParent().getParent());
- else
- {
- kw.setParent(childInputMap.getParent().getParent());
- childInputMap.setParent(kw);
- }
- }
-
- // option 3: there is an InputMapUIResource in the chain, which marks
- // the place where we need to stop and insert ourselves
- else if (childInputMap.getParent() instanceof InputMapUIResource)
- {
- if (kw != null)
- {
- kw.setParent(childInputMap.getParent());
- childInputMap.setParent(kw);
- }
- }
- }
-
- // phase 2: replace the KeymapActionMap entry in the ActionMap chain
-
- KeymapActionMap kam = (k == null ? null : new KeymapActionMap(k));
- ActionMap childActionMap = getActionMap();
- if (childActionMap == null)
- setActionMap(kam);
- else
- {
- while (childActionMap.getParent() != null
- && !(childActionMap.getParent() instanceof KeymapActionMap)
- && !(childActionMap.getParent() instanceof ActionMapUIResource))
- childActionMap = childActionMap.getParent();
-
- // option 1: there is nobody to replace at the end of the chain
- if (childActionMap.getParent() == null)
- childActionMap.setParent(kam);
-
- // option 2: there is already a KeymapActionMap in the chain which
- // needs replacing (possibly with its own parents, possibly without)
- else if (childActionMap.getParent() instanceof KeymapActionMap)
- {
- if (kam == null)
- childActionMap.setParent(childActionMap.getParent().getParent());
- else
- {
- kam.setParent(childActionMap.getParent().getParent());
- childActionMap.setParent(kam);
- }
- }
-
- // option 3: there is an ActionMapUIResource in the chain, which marks
- // the place where we need to stop and insert ourselves
- else if (childActionMap.getParent() instanceof ActionMapUIResource)
- {
- if (kam != null)
- {
- kam.setParent(childActionMap.getParent());
- childActionMap.setParent(kam);
- }
- }
- }
-
- // phase 3: update the explicit keymap field
-
- Keymap old = keymap;
- keymap = k;
- firePropertyChange("keymap", old, k);
- }
-
- /**
- * Resolves a set of bindings against a set of actions and inserts the
- * results into a {@link Keymap}. Specifically, for each provided binding
- * <code>b</code>, if there exists a provided action <code>a</code> such
- * that <code>a.getValue(Action.NAME) == b.ActionName</code> then an
- * entry is added to the Keymap mapping <code>b</code> to
- * <code>a</code>.
- *
- * @param map The Keymap to add new mappings to
- * @param bindings The set of bindings to add to the Keymap
- * @param actions The set of actions to resolve binding names against
- *
- * @see Action#NAME
- * @see Action#getValue()
- * @see KeyBinding#ActionName
- */
- public static void loadKeymap(Keymap map,
- JTextComponent.KeyBinding[] bindings,
- Action[] actions)
- {
- Hashtable acts = new Hashtable(actions.length);
- for (int i = 0; i < actions.length; ++i)
- acts.put(actions[i].getValue(Action.NAME), actions[i]);
- for (int i = 0; i < bindings.length; ++i)
- if (acts.containsKey(bindings[i].actionName))
- map.addActionForKeyStroke(bindings[i].key, (Action) acts.get(bindings[i].actionName));
- }
-
- /**
- * Returns the set of available Actions this component's associated
- * editor can run. Equivalent to calling
- * <code>getUI().getEditorKit().getActions()</code>. This set of Actions
- * is a reasonable value to provide as a parameter to {@link
- * #loadKeymap()}, when resolving a set of {@link #KeyBinding} objects
- * against this component.
- *
- * @return The set of available Actions on this component's {@link EditorKit}
- *
- * @see TextUI#getEditorKit()
- * @see EditorKit#getActions()
- */
- public Action[] getActions()
- {
- return getUI().getEditorKit(this).getActions();
- }
-
- // This is package-private to avoid an accessor method.
- Document doc;
- private Caret caret;
- private Highlighter highlighter;
- private Color caretColor;
- private Color disabledTextColor;
- private Color selectedTextColor;
- private Color selectionColor;
- private boolean editable;
- private Insets margin;
- private boolean dragEnabled;
-
- /** Issues repaint request on document changes. */
- private DocumentListener repaintListener;
-
- /**
- * Creates a new <code>JTextComponent</code> instance.
- */
- public JTextComponent()
- {
- repaintListener = new DocumentListener()
- {
- public void changedUpdate(DocumentEvent ev)
- {
- repaint();
- }
- public void insertUpdate(DocumentEvent ev)
- {
- repaint();
- }
- public void removeUpdate(DocumentEvent ev)
- {
- repaint();
- }
- };
-
- Keymap defkeymap = getKeymap(DEFAULT_KEYMAP);
- boolean creatingKeymap = false;
- if (defkeymap == null)
- {
- defkeymap = addKeymap(DEFAULT_KEYMAP, null);
- defkeymap.setDefaultAction(new DefaultEditorKit.DefaultKeyTypedAction());
- creatingKeymap = true;
- }
-
- setFocusable(true);
- enableEvents(AWTEvent.KEY_EVENT_MASK);
- updateUI();
-
- // need to do this after updateUI()
- if (creatingKeymap)
- loadKeymap(defkeymap,
- new KeyBinding[] {
- new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0),
- DefaultEditorKit.backwardAction),
- new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0),
- DefaultEditorKit.forwardAction),
- new KeyBinding(KeyStroke.getKeyStroke("typed \b"),
- DefaultEditorKit.deletePrevCharAction),
- new KeyBinding(KeyStroke.getKeyStroke("typed \u007f"),
- DefaultEditorKit.deleteNextCharAction)
- },
- getActions());
- }
-
- public void setDocument(Document newDoc)
- {
- Document oldDoc = doc;
- doc = newDoc;
-
- // setup document listener
- if (oldDoc != null)
- oldDoc.removeDocumentListener(repaintListener);
- if (newDoc != null)
- newDoc.addDocumentListener(repaintListener);
-
- firePropertyChange("document", oldDoc, newDoc);
- revalidate();
- repaint();
- }
-
- public Document getDocument()
- {
- return doc;
- }
-
- /**
- * Get the <code>AccessibleContext</code> of this object.
- *
- * @return an <code>AccessibleContext</code> object
- */
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
-
- public void setMargin(Insets m)
- {
- margin = m;
- }
-
- public Insets getMargin()
- {
- return margin;
- }
-
- public void setText(String text)
- {
- try
- {
- doc.remove(0, doc.getLength());
- doc.insertString(0, text, null);
- }
- catch (BadLocationException e)
- {
- // This can never happen.
- }
- }
-
- /**
- * Retrieves the current text in this text document.
- *
- * @return the text
- *
- * @exception NullPointerException if the underlaying document is null
- */
- public String getText()
- {
- if (doc == null)
- return null;
-
- try
- {
- return doc.getText(0, doc.getLength());
- }
- catch (BadLocationException e)
- {
- // This should never happen.
- return "";
- }
- }
-
- /**
- * Retrieves a part of the current text in this document.
- *
- * @param offset the postion of the first character
- * @param length the length of the text to retrieve
- *
- * @return the text
- *
- * @exception BadLocationException if arguments do not hold pre-conditions
- */
- public String getText(int offset, int length)
- throws BadLocationException
- {
- return getDocument().getText(offset, length);
- }
-
- /**
- * Retrieves the currently selected text in this text document.
- *
- * @return the selected text
- *
- * @exception NullPointerException if the underlaying document is null
- */
- public String getSelectedText()
- {
- try
- {
- return doc.getText(getSelectionStart(), getSelectionEnd());
- }
- catch (BadLocationException e)
- {
- // This should never happen.
- return null;
- }
- }
-
- /**
- * Returns a string that specifies the name of the Look and Feel class
- * that renders this component.
- *
- * @return the string "TextComponentUI"
- */
- public String getUIClassID()
- {
- return "TextComponentUI";
- }
-
- /**
- * Returns a string representation of this JTextComponent.
- */
- protected String paramString()
- {
- return "JTextComponent";
- }
-
- /**
- * This method returns the label's UI delegate.
- *
- * @return The label's UI delegate.
- */
- public TextUI getUI()
- {
- return (TextUI) ui;
- }
-
- /**
- * This method sets the label's UI delegate.
- *
- * @param ui The label's UI delegate.
- */
- public void setUI(TextUI newUI)
- {
- super.setUI(newUI);
- }
-
- /**
- * This method resets the label's UI delegate to the default UI for the
- * current look and feel.
- */
- public void updateUI()
- {
- setUI((TextUI) UIManager.getUI(this));
- }
-
- public Dimension getPreferredScrollableViewportSize()
- {
- return null;
- }
-
- public int getScrollableUnitIncrement(Rectangle visible, int orientation,
- int direction)
- {
- return 0;
- }
-
- public int getScrollableBlockIncrement(Rectangle visible, int orientation,
- int direction)
- {
- return 0;
- }
-
- /**
- * Checks whether this text component it editable.
- *
- * @return true if editable, false otherwise
- */
- public boolean isEditable()
- {
- return editable;
- }
-
- /**
- * Enables/disabled this text component's editability.
- *
- * @param newValue true to make it editable, false otherwise.
- */
- public void setEditable(boolean newValue)
- {
- if (editable == newValue)
- return;
-
- boolean oldValue = editable;
- editable = newValue;
- firePropertyChange("editable", oldValue, newValue);
- }
-
- /**
- * The <code>Caret</code> object used in this text component.
- *
- * @return the caret object
- */
- public Caret getCaret()
- {
- return caret;
- }
-
- /**
- * Sets a new <code>Caret</code> for this text component.
- *
- * @param newCaret the new <code>Caret</code> to set
- */
- public void setCaret(Caret newCaret)
- {
- if (caret != null)
- caret.deinstall(this);
-
- Caret oldCaret = caret;
- caret = newCaret;
-
- if (caret != null)
- caret.install(this);
-
- firePropertyChange("caret", oldCaret, newCaret);
- }
-
- public Color getCaretColor()
- {
- return caretColor;
- }
-
- public void setCaretColor(Color newColor)
- {
- Color oldCaretColor = caretColor;
- caretColor = newColor;
- firePropertyChange("caretColor", oldCaretColor, newColor);
- }
-
- public Color getDisabledTextColor()
- {
- return disabledTextColor;
- }
-
- public void setDisabledTextColor(Color newColor)
- {
- Color oldColor = disabledTextColor;
- disabledTextColor = newColor;
- firePropertyChange("disabledTextColor", oldColor, newColor);
- }
-
- public Color getSelectedTextColor()
- {
- return selectedTextColor;
- }
-
- public void setSelectedTextColor(Color newColor)
- {
- Color oldColor = selectedTextColor;
- selectedTextColor = newColor;
- firePropertyChange("selectedTextColor", oldColor, newColor);
- }
-
- public Color getSelectionColor()
- {
- return selectionColor;
- }
-
- public void setSelectionColor(Color newColor)
- {
- Color oldColor = selectionColor;
- selectionColor = newColor;
- firePropertyChange("selectionColor", oldColor, newColor);
- }
-
- /**
- * Retrisves the current caret position.
- *
- * @return the current position
- */
- public int getCaretPosition()
- {
- return caret.getDot();
- }
-
- /**
- * Sets the caret to a new position.
- *
- * @param position the new position
- */
- public void setCaretPosition(int position)
- {
- if (doc == null)
- return;
-
- if (position < 0 || position > doc.getLength())
- throw new IllegalArgumentException();
-
- caret.setDot(position);
- }
-
- /**
- * Moves the caret to a given position. This selects the text between
- * the old and the new position of the caret.
- */
- public void moveCaretPosition(int position)
- {
- if (doc == null)
- return;
-
- if (position < 0 || position > doc.getLength())
- throw new IllegalArgumentException();
-
- caret.moveDot(position);
- }
-
- public Highlighter getHighlighter()
- {
- return highlighter;
- }
-
- public void setHighlighter(Highlighter newHighlighter)
- {
- if (highlighter != null)
- highlighter.deinstall(this);
-
- Highlighter oldHighlighter = highlighter;
- highlighter = newHighlighter;
-
- if (highlighter != null)
- highlighter.install(this);
-
- firePropertyChange("highlighter", oldHighlighter, newHighlighter);
- }
-
- /**
- * Returns the start postion of the currently selected text.
- *
- * @return the start postion
- */
- public int getSelectionStart()
- {
- return Math.min(caret.getDot(), caret.getMark());
- }
-
- /**
- * Selects the text from the given postion to the selection end position.
- *
- * @param end the start positon of the selected text.
- */
- public void setSelectionStart(int start)
- {
- select(start, getSelectionEnd());
- }
-
- /**
- * Returns the end postion of the currently selected text.
- *
- * @return the end postion
- */
- public int getSelectionEnd()
- {
- return Math.max(caret.getDot(), caret.getMark());
- }
-
- /**
- * Selects the text from the selection start postion to the given position.
- *
- * @param end the end positon of the selected text.
- */
- public void setSelectionEnd(int end)
- {
- select(getSelectionStart(), end);
- }
-
- /**
- * Selects a part of the content of the text component.
- *
- * @param start the start position of the selected text
- * @param ent the end position of the selected text
- */
- public void select(int start, int end)
- {
- int length = doc.getLength();
-
- start = Math.max(start, 0);
- start = Math.min(start, length);
-
- end = Math.max(end, 0);
- end = Math.min(end, length);
-
- setCaretPosition(start);
- moveCaretPosition(end);
- }
-
- /**
- * Selects the whole content of the text component.
- */
- public void selectAll()
- {
- select(0, doc.getLength());
- }
-
- public synchronized void replaceSelection(String content)
- {
- int dot = caret.getDot();
- int mark = caret.getMark();
-
- // If content is empty delete selection.
- if (content == null)
- {
- caret.setDot(dot);
- return;
- }
-
- try
- {
- int start = getSelectionStart();
- int end = getSelectionEnd();
-
- // Remove selected text.
- if (dot != mark)
- doc.remove(start, end - start);
-
- // Insert new text.
- doc.insertString(start, content, null);
-
- // Set dot to new position.
- setCaretPosition(start + content.length());
- }
- catch (BadLocationException e)
- {
- // This should never happen.
- }
- }
-
- public boolean getScrollableTracksViewportHeight()
- {
- if (getParent() instanceof JViewport)
- return ((JViewport) getParent()).getHeight() > getPreferredSize().height;
-
- return false;
- }
-
- public boolean getScrollableTracksViewportWidth()
- {
- if (getParent() instanceof JViewport)
- return ((JViewport) getParent()).getWidth() > getPreferredSize().width;
-
- return false;
- }
-
- /**
- * Adds a <code>CaretListener</code> object to this text component.
- *
- * @param listener the listener to add
- */
- public void addCaretListener(CaretListener listener)
- {
- listenerList.add(CaretListener.class, listener);
- }
-
- /**
- * Removed a <code>CaretListener</code> object from this text component.
- *
- * @param listener the listener to remove
- */
- public void removeCaretListener(CaretListener listener)
- {
- listenerList.remove(CaretListener.class, listener);
- }
-
- /**
- * Returns all added <code>CaretListener</code> objects.
- *
- * @return an array of listeners
- */
- public CaretListener[] getCaretListeners()
- {
- return (CaretListener[]) getListeners(CaretListener.class);
- }
-
- /**
- * Notifies all registered <code>CaretListener</code> objects that the caret
- * was updated.
- *
- * @param event the event to send
- */
- protected void fireCaretUpdate(CaretEvent event)
- {
- CaretListener[] listeners = getCaretListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].caretUpdate(event);
- }
-
- /**
- * Adds an <code>InputListener</code> object to this text component.
- *
- * @param listener the listener to add
- */
- public void addInputMethodListener(InputMethodListener listener)
- {
- listenerList.add(InputMethodListener.class, listener);
- }
-
- /**
- * Removes an <code>InputListener</code> object from this text component.
- *
- * @param listener the listener to remove
- */
- public void removeInputMethodListener(InputMethodListener listener)
- {
- listenerList.remove(InputMethodListener.class, listener);
- }
-
- /**
- * Returns all added <code>InputMethodListener</code> objects.
- *
- * @return an array of listeners
- */
- public InputMethodListener[] getInputMethodListeners()
- {
- return (InputMethodListener[]) getListeners(InputMethodListener.class);
- }
-
- public Rectangle modelToView(int position) throws BadLocationException
- {
- return getUI().modelToView(this, position);
- }
-
- public boolean getDragEnabled()
- {
- return dragEnabled;
- }
-
- public void setDragEnabled(boolean enabled)
- {
- dragEnabled = enabled;
- }
-
- public int viewToModel(Point pt)
- {
- return getUI().viewToModel(this, pt);
- }
-
- public void copy()
- {
- doTransferAction("copy", TransferHandler.getCopyAction());
- }
-
- public void cut()
- {
- doTransferAction("cut", TransferHandler.getCutAction());
- }
-
- public void paste()
- {
- doTransferAction("paste", TransferHandler.getPasteAction());
- }
-
- private void doTransferAction(String name, Action action)
- {
- // Install default TransferHandler if none set.
- if (getTransferHandler() == null)
- {
- if (defaultTransferHandler == null)
- defaultTransferHandler = new DefaultTransferHandler();
-
- setTransferHandler(defaultTransferHandler);
- }
-
- // Perform action.
- ActionEvent event = new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
- action.getValue(Action.NAME).toString());
- action.actionPerformed(event);
- }
-
- public void setFocusAccelerator(char newKey)
- {
- if (focusAccelerator == newKey)
- return;
-
- char oldKey = focusAccelerator;
- focusAccelerator = newKey;
- firePropertyChange(FOCUS_ACCELERATOR_KEY, oldKey, newKey);
- }
-
- public char getFocusAccelerator()
- {
- return focusAccelerator;
- }
-
- /**
- * @since 1.4
- */
- public NavigationFilter getNavigationFilter()
- {
- return navigationFilter;
- }
-
- /**
- * @since 1.4
- */
- public void setNavigationFilter(NavigationFilter filter)
- {
- navigationFilter = filter;
- }
-}
diff --git a/libjava/javax/swing/text/Keymap.java b/libjava/javax/swing/text/Keymap.java
deleted file mode 100644
index c3f61d88e07..00000000000
--- a/libjava/javax/swing/text/Keymap.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Keymap.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import javax.swing.Action;
-import javax.swing.KeyStroke;
-
-public interface Keymap
-{
- void addActionForKeyStroke(KeyStroke key, Action a);
- Action getAction(KeyStroke key);
- Action[] getBoundActions();
- KeyStroke[] getBoundKeyStrokes();
- Action getDefaultAction();
- KeyStroke[] getKeyStrokesForAction(Action a);
- String getName();
- Keymap getResolveParent();
- boolean isLocallyDefined(KeyStroke key);
- void removeBindings();
- void removeKeyStrokeBinding(KeyStroke keys);
- void setDefaultAction(Action a);
- void setResolveParent(Keymap parent);
-}
-
-
diff --git a/libjava/javax/swing/text/LayeredHighlighter.java b/libjava/javax/swing/text/LayeredHighlighter.java
deleted file mode 100644
index dcaf1c504c6..00000000000
--- a/libjava/javax/swing/text/LayeredHighlighter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* LayeredHighlighter.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Graphics;
-import java.awt.Shape;
-
-public abstract class LayeredHighlighter
- implements Highlighter
-{
- public abstract static class LayerPainter
- implements Highlighter.HighlightPainter
- {
- public abstract Shape paintLayer(Graphics g, int p0, int p1,
- Shape viewBounds, JTextComponent editor,
- View view);
- }
-
- public abstract void paintLayeredHighlights(Graphics g, int p0, int p1,
- Shape viewBounds,
- JTextComponent editor, View view);
-}
diff --git a/libjava/javax/swing/text/MutableAttributeSet.java b/libjava/javax/swing/text/MutableAttributeSet.java
deleted file mode 100644
index 2fe9ad50f67..00000000000
--- a/libjava/javax/swing/text/MutableAttributeSet.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/* MutableAttributeSet.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.util.Enumeration;
-
-/**
- * MutableAttributeSet
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface MutableAttributeSet extends AttributeSet
-{
- /**
- * addAttribute
- * @param name TODO
- * @param value TODO
- */
- void addAttribute(Object name, Object value);
-
- /**
- * addAttributes
- * @param attributes TODO
- */
- void addAttributes(AttributeSet attributes);
-
- /**
- * removeAttribute
- * @param name TODO
- */
- void removeAttribute(Object name);
-
- /**
- * removeAttributes
- * @param names TODO
- */
- void removeAttributes(Enumeration names);
-
- /**
- * removeAttributes
- * @param attributes TODO
- */
- void removeAttributes(AttributeSet attributes);
-
- /**
- * setResolveParent
- * @param parent TODO
- */
- void setResolveParent(AttributeSet parent);
-}
diff --git a/libjava/javax/swing/text/NavigationFilter.java b/libjava/javax/swing/text/NavigationFilter.java
deleted file mode 100644
index 45f58f9e229..00000000000
--- a/libjava/javax/swing/text/NavigationFilter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* NavigationFilter.java --
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-public class NavigationFilter
-{
- public abstract static class FilterBypass
- {
- public FilterBypass()
- {
- // Do nothing here.
- }
-
- public abstract Caret getCaret();
- public abstract void moveDot(int dot, Position.Bias bias);
- public abstract void setDot(int dot, Position.Bias bias);
- }
-
- public NavigationFilter()
- {
- // Do nothing here.
- }
-
- public void moveDot(NavigationFilter.FilterBypass fb, int dot,
- Position.Bias bias)
- {
- fb.moveDot(dot, bias);
- }
-
- public void setDot(NavigationFilter.FilterBypass fb, int dot,
- Position.Bias bias)
- {
- fb.setDot(dot, bias);
- }
-}
diff --git a/libjava/javax/swing/text/PasswordView.java b/libjava/javax/swing/text/PasswordView.java
deleted file mode 100644
index 229fd2b508d..00000000000
--- a/libjava/javax/swing/text/PasswordView.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/* PasswordView.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Color;
-import java.awt.Graphics;
-
-import javax.swing.JPasswordField;
-
-public class PasswordView extends FieldView
-{
- /**
- * Buffer for putting the echo char into it and
- * then using it to draw it into the view.
- */
- private char[] oneCharBuffer = new char[1];
-
- public PasswordView(Element elem)
- {
- super(elem);
- }
-
- /**
- * Draws one echo character at a given position.
- *
- * @param g the <code>Graphics</code> object to draw to
- * @param x the x-position
- * @param y the y-position
- * @param ch the echo character
- *
- * @return the next x position right of the drawn character
- */
- protected int drawEchoCharacter(Graphics g, int x, int y, char ch)
- {
- // Update font metrics.
- updateMetrics();
-
- // Draw character.
- oneCharBuffer[0] = ch;
- g.drawChars(oneCharBuffer, 0, 1, x, y);
-
- // Return new x position right of drawn character.
- return x + metrics.charWidth(ch);
- }
-
- private char getEchoChar()
- {
- char ch = ((JPasswordField) getContainer()).getEchoChar();
-
- if (ch == 0)
- ch = '*';
-
- return ch;
- }
-
- /**
- * Draws selected text at a given position.
- *
- * @param g the <code>Graphics</code> object to draw to
- * @param x the x-position
- * @param y the y-position
- * @param p0 the position of the first character to draw
- * @param p1 the position of the first character not to draw
- *
- * @return the next x position right of the drawn character
- */
- protected int drawSelectedText(Graphics g, int x, int y, int p0, int p1)
- throws BadLocationException
- {
- // FIXME: Throw BadLocationException somehow.
-
- // Update font metrics.
- updateMetrics();
-
- // Get echo character.
- char ch = getEchoChar();
-
- // Set color for selected text.
- g.setColor(selectedColor);
- g.setColor(Color.BLACK);
-
- // Initialize buffer for faster drawing of all characters.
- int len = p1 - p0;
- char[] buffer = new char[len];
- for (int index = 0; index < len; ++index)
- buffer[index] = ch;
-
- // Draw echo charaters.
- g.drawChars(buffer, 0, len, x, y);
-
- // Return new x position right of all drawn characters.
- return x + len * metrics.charWidth(ch);
- }
-
- /**
- * Draws unselected text at a given position.
- *
- * @param g the <code>Graphics</code> object to draw to
- * @param x the x-position
- * @param y the y-position
- * @param p0 the position of the first character to draw
- * @param p1 the position of the first character not to draw
- *
- * @return the next x position right of the drawn character
- */
- protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1)
- throws BadLocationException
- {
- // FIXME: Throw BadLocationException somehow.
-
- // Update font metrics.
- updateMetrics();
-
- // Get echo character.
- char ch = getEchoChar();
-
- // Set color for unselected text.
- g.setColor(unselectedColor);
- g.setColor(Color.BLACK);
-
- // Initialize buffer for faster drawing of all characters.
- int len = p1 - p0;
- char[] buffer = new char[len];
- for (int index = 0; index < len; ++index)
- buffer[index] = ch;
-
- // Draw echo charaters.
- g.drawChars(buffer, 0, len, x, y);
-
- // Return new x position right of all drawn characters.
- return x + len * metrics.charWidth(ch);
- }
-}
-
diff --git a/libjava/javax/swing/text/PlainDocument.java b/libjava/javax/swing/text/PlainDocument.java
deleted file mode 100644
index 5f7b730d8a7..00000000000
--- a/libjava/javax/swing/text/PlainDocument.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/* PlainDocument.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.util.ArrayList;
-
-public class PlainDocument extends AbstractDocument
-{
- private static final long serialVersionUID = 4758290289196893664L;
-
- public static final String lineLimitAttribute = "lineLimit";
- public static final String tabSizeAttribute = "tabSize";
-
- private BranchElement rootElement;
- private int tabSize;
-
- public PlainDocument()
- {
- this(new GapContent());
- }
-
- public PlainDocument(AbstractDocument.Content content)
- {
- super(content);
- tabSize = 8;
- rootElement = (BranchElement) createDefaultRoot();
- }
-
- private void reindex()
- {
- Element[] lines;
- try
- {
- String str = content.getString(0, content.length());
-
- ArrayList elts = new ArrayList();
- int j = 0;
- for (int i = str.indexOf('\n', 0); i != -1; i = str.indexOf('\n', i + 1))
- {
- elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, i + 1));
- j = i + 1;
- }
-
- if (j < content.length())
- elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, content.length()));
-
- lines = new Element[elts.size()];
- for (int i = 0; i < elts.size(); ++i)
- lines[i] = (Element) elts.get(i);
- }
- catch (BadLocationException e)
- {
- lines = new Element[1];
- lines[0] = createLeafElement(rootElement, SimpleAttributeSet.EMPTY, 0, 1);
- }
-
- ((BranchElement) rootElement).replace(0, rootElement.getElementCount(), lines);
- }
-
- protected AbstractDocument.AbstractElement createDefaultRoot()
- {
- BranchElement root =
- (BranchElement) createBranchElement(null, SimpleAttributeSet.EMPTY);
-
- Element[] array = new Element[1];
- array[0] = createLeafElement(root, SimpleAttributeSet.EMPTY, 0, 1);
- root.replace(0, 0, array);
-
- return root;
- }
-
- protected void insertUpdate(DefaultDocumentEvent event, AttributeSet attributes)
- {
- reindex();
-
- super.insertUpdate(event, attributes);
- }
-
- protected void removeUpdate(DefaultDocumentEvent event)
- {
- super.removeUpdate(event);
-
- int p0 = event.getOffset();
- int p1 = event.getLength() + p0;
- int len = event.getLength();
-
- // check if we must collapse some elements
- int i1 = rootElement.getElementIndex(p0);
- int i2 = rootElement.getElementIndex(p1);
- if (i1 != i2)
- {
- Element el1 = rootElement.getElement(i1);
- Element el2 = rootElement.getElement(i2);
- int start = el1.getStartOffset();
- int end = el2.getEndOffset();
- // collapse elements if the removal spans more than 1 line
- Element newEl = createLeafElement(rootElement,
- SimpleAttributeSet.EMPTY,
- start, end - len);
- rootElement.replace(start, end - start, new Element[]{ newEl });
- }
- else
- {
- // otherwise only adjust indices of the element
- LeafElement el1 = (LeafElement) rootElement.getElement(i1);
- el1.end -= len;
- }
-
- // reindex remaining elements
- for (int i = rootElement.getElementIndex(p0) + 1;
- i < rootElement.getElementCount(); i++)
- {
- LeafElement el = (LeafElement) rootElement.getElement(i);
- el.start -= len;
- el.end -= len;
- }
-
- }
-
- public Element getDefaultRootElement()
- {
- return rootElement;
- }
-
- public Element getParagraphElement(int pos)
- {
- Element root = getDefaultRootElement();
- return root.getElement(root.getElementIndex(pos));
- }
-}
diff --git a/libjava/javax/swing/text/PlainView.java b/libjava/javax/swing/text/PlainView.java
deleted file mode 100644
index c0cb6be3940..00000000000
--- a/libjava/javax/swing/text/PlainView.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/* PlainView.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-import java.awt.Shape;
-
-public class PlainView extends View
- implements TabExpander
-{
- Color selectedColor;
- Color unselectedColor;
- Font font;
-
- protected FontMetrics metrics;
-
- public PlainView(Element elem)
- {
- super(elem);
- }
-
- /**
- * @since 1.4
- */
- protected void updateMetrics()
- {
- Component component = getContainer();
- Font font = component.getFont();
-
- if (this.font != font)
- {
- this.font = font;
- metrics = component.getFontMetrics(font);
- }
- }
-
- /**
- * @since 1.4
- */
- protected Rectangle lineToRect(Shape a, int line)
- {
- // Ensure metrics are up-to-date.
- updateMetrics();
-
- Rectangle rect = a.getBounds();
- int fontHeight = metrics.getHeight();
- return new Rectangle(rect.x, rect.y + (line * fontHeight),
- rect.width, fontHeight);
- }
-
- public Shape modelToView(int position, Shape a, Position.Bias b)
- throws BadLocationException
- {
- // Ensure metrics are up-to-date.
- updateMetrics();
-
- Document document = getDocument();
-
- // Get rectangle of the line containing position.
- int lineIndex = getElement().getElementIndex(position);
- Rectangle rect = lineToRect(a, lineIndex);
-
- // Get the rectangle for position.
- Element line = getElement().getElement(lineIndex);
- int lineStart = line.getStartOffset();
- Segment segment = new Segment();
- document.getText(lineStart, position - lineStart, segment);
- int xoffset = Utilities.getTabbedTextWidth(segment, metrics, rect.x,
- this, lineStart);
-
- // Calc the real rectangle.
- rect.x += xoffset;
- rect.width = 1;
- rect.height = metrics.getHeight();
-
- return rect;
- }
-
- protected void drawLine(int lineIndex, Graphics g, int x, int y)
- {
- try
- {
- metrics = g.getFontMetrics();
- // FIXME: Selected text are not drawn yet.
- Element line = getDocument().getDefaultRootElement().getElement(lineIndex);
- drawUnselectedText(g, x, y, line.getStartOffset(), line.getEndOffset());
- //drawSelectedText(g, , , , );
- }
- catch (BadLocationException e)
- {
- // This should never happen.
- }
- }
-
- protected int drawSelectedText(Graphics g, int x, int y, int p0, int p1)
- throws BadLocationException
- {
- g.setColor(selectedColor);
- Segment segment = new Segment();
- getDocument().getText(p0, p1 - p0, segment);
- return Utilities.drawTabbedText(segment, x, y, g, this, 0);
- }
-
- protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1)
- throws BadLocationException
- {
- g.setColor(unselectedColor);
- Segment segment = new Segment();
- getDocument().getText(p0, p1 - p0, segment);
- return Utilities.drawTabbedText(segment, x, y, g, this, segment.offset);
- }
-
- public void paint(Graphics g, Shape s)
- {
- // Ensure metrics are up-to-date.
- updateMetrics();
-
- JTextComponent textComponent = (JTextComponent) getContainer();
-
- g.setFont(textComponent.getFont());
- selectedColor = textComponent.getSelectedTextColor();
- unselectedColor = textComponent.getForeground();
-
- Rectangle rect = s.getBounds();
-
- // FIXME: Text may be scrolled.
- Document document = textComponent.getDocument();
- Element root = document.getDefaultRootElement();
- int y = rect.y;
-
- for (int i = 0; i < root.getElementCount(); i++)
- {
- drawLine(i, g, rect.x, y);
- y += metrics.getHeight();
- }
- }
-
- protected int getTabSize()
- {
- return 8;
- }
-
- /**
- * Returns the next tab stop position after a given reference position.
- *
- * This implementation ignores the <code>tabStop</code> argument.
- *
- * @param x the current x position in pixels
- * @param tabStop the position within the text stream that the tab occured at
- */
- public float nextTabStop(float x, int tabStop)
- {
- float tabSizePixels = getTabSize() + metrics.charWidth('m');
- return (float) (Math.floor(x / tabSizePixels) + 1) * tabSizePixels;
- }
-
- public float getPreferredSpan(int axis)
- {
- if (axis != X_AXIS && axis != Y_AXIS)
- throw new IllegalArgumentException();
-
- return 10;
- }
-}
-
diff --git a/libjava/javax/swing/text/Position.java b/libjava/javax/swing/text/Position.java
deleted file mode 100644
index a9d3d09d764..00000000000
--- a/libjava/javax/swing/text/Position.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Position.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-
-public interface Position
-{
- static class Bias
- {
- public static final Bias Backward = new Bias("backward");
- public static final Bias Forward = new Bias("forward");
-
- private String name;
-
- private Bias(String n)
- {
- name = n;
- }
-
- public String toString()
- {
- return name;
- }
- }
-
- int getOffset();
-}
diff --git a/libjava/javax/swing/text/Segment.java b/libjava/javax/swing/text/Segment.java
deleted file mode 100644
index 92d850016d9..00000000000
--- a/libjava/javax/swing/text/Segment.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Segment.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.text.CharacterIterator;
-
-public class Segment
- implements Cloneable, CharacterIterator
-{
- private boolean partialReturn;
- private int current;
-
- public char[] array;
- public int count;
- public int offset;
-
- public Segment()
- {
- }
-
- public Segment(char[] array, int offset, int count)
- {
- this.array = array;
- this.offset = offset;
- this.count = count;
- }
-
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- return null;
- }
- }
-
- public char current()
- {
- if (count == 0
- || current >= getEndIndex())
- return DONE;
-
- return array[current];
- }
-
- public char first()
- {
- if (count == 0)
- return DONE;
-
- current = getBeginIndex();
- return array[current];
- }
-
- public int getBeginIndex()
- {
- return offset;
- }
-
- public int getEndIndex()
- {
- return offset + count;
- }
-
- public int getIndex()
- {
- return current;
- }
-
- public char last()
- {
- if (count == 0)
- return DONE;
-
- current = getEndIndex() - 1;
- return array[current];
- }
-
- public char next()
- {
- if (count == 0)
- return DONE;
-
- if ((current + 1) >= getEndIndex())
- {
- current = getEndIndex();
- return DONE;
- }
-
- current++;
- return array[current];
- }
-
- public char previous()
- {
- if (count == 0
- || current == getBeginIndex())
- return DONE;
-
- current--;
- return array[current];
- }
-
- public char setIndex(int position)
- {
- if (position < getBeginIndex()
- || position > getEndIndex())
- throw new IllegalArgumentException();
-
- current = position;
-
- if (position == getEndIndex())
- return DONE;
-
- return array[current];
- }
-
- public String toString()
- {
- return new String(array, offset, count);
- }
-
- /**
- * @since 1.4
- */
- public void setPartialReturn(boolean p)
- {
- partialReturn = p;
- }
-
- /**
- * @since 1.4
- */
- public boolean isPartialReturn()
- {
- return partialReturn;
- }
-}
diff --git a/libjava/javax/swing/text/SimpleAttributeSet.java b/libjava/javax/swing/text/SimpleAttributeSet.java
deleted file mode 100644
index 3ef5db61d43..00000000000
--- a/libjava/javax/swing/text/SimpleAttributeSet.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/* SimpleAttributeSet.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-public class SimpleAttributeSet
- implements MutableAttributeSet, Serializable, Cloneable
-{
- public static final AttributeSet EMPTY = new SimpleAttributeSet();
-
- Hashtable tab;
-
- public SimpleAttributeSet()
- {
- this(null);
- }
-
- public SimpleAttributeSet(AttributeSet a)
- {
- tab = new Hashtable();
- if (a != null)
- addAttributes(a);
- }
-
- public void addAttribute(Object name, Object value)
- {
- tab.put(name, value);
- }
-
- public void addAttributes(AttributeSet attributes)
- {
- Enumeration e = attributes.getAttributeNames();
- while (e.hasMoreElements())
- {
- Object name = e.nextElement();
- Object val = attributes.getAttribute(name);
- tab.put(name, val);
- }
- }
-
- public Object clone()
- {
- SimpleAttributeSet s = new SimpleAttributeSet();
- s.tab = (Hashtable) tab.clone();
- return s;
- }
-
- public boolean containsAttribute(Object name, Object value)
- {
- return tab.containsKey(name)
- && tab.get(name).equals(value);
- }
-
- public boolean containsAttributes(AttributeSet attributes)
- {
- Enumeration e = attributes.getAttributeNames();
- while (e.hasMoreElements())
- {
- Object name = e.nextElement();
- Object val = attributes.getAttribute(name);
- if (! containsAttribute(name, val))
- return false;
- }
- return true;
- }
-
- public AttributeSet copyAttributes()
- {
- return (AttributeSet) clone();
- }
-
- public boolean equals(Object obj)
- {
- return (obj != null)
- && (obj instanceof SimpleAttributeSet)
- && ((SimpleAttributeSet)obj).tab.equals(this.tab);
- }
-
- public Object getAttribute(Object name)
- {
- Object val = tab.get(name);
- if (val != null)
- return val;
-
- Object p = getResolveParent();
- if (p != null && p instanceof AttributeSet)
- return (((AttributeSet)p).getAttribute(name));
-
- return null;
- }
-
- public int getAttributeCount()
- {
- return tab.size();
- }
-
- public Enumeration getAttributeNames()
- {
- return tab.keys();
- }
-
- public AttributeSet getResolveParent()
- {
- return (AttributeSet) tab.get(ResolveAttribute);
- }
-
- public int hashCode()
- {
- return tab.hashCode();
- }
-
- public boolean isDefined(Object attrName)
- {
- return tab.containsKey(attrName);
- }
-
- public boolean isEmpty()
- {
- return tab.isEmpty();
- }
-
- public boolean isEqual(AttributeSet attr)
- {
- return this.equals(attr);
- }
-
- public void removeAttribute(Object name)
- {
- tab.remove(name);
- }
-
- public void removeAttributes(AttributeSet attributes)
- {
- removeAttributes(attributes.getAttributeNames());
- }
-
- public void removeAttributes(Enumeration names)
- {
- while (names.hasMoreElements())
- {
- removeAttribute(names.nextElement());
- }
- }
-
- public void setResolveParent(AttributeSet parent)
- {
- addAttribute(ResolveAttribute, parent);
- }
-
- public String toString()
- {
- return tab.toString();
- }
-}
diff --git a/libjava/javax/swing/text/StringContent.java b/libjava/javax/swing/text/StringContent.java
deleted file mode 100644
index bedf480d4ec..00000000000
--- a/libjava/javax/swing/text/StringContent.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/* StringContent.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import javax.swing.undo.AbstractUndoableEdit;
-import javax.swing.undo.CannotRedoException;
-import javax.swing.undo.CannotUndoException;
-import javax.swing.undo.UndoableEdit;
-
-/**
- * An implementation of the <code>AbstractDocument.Content</code>
- * interface useful for small documents or debugging. The character
- * content is a simple character array. It's not really efficient.
- *
- * <p>Do not use this class for large size.</p>
- */
-public final class StringContent implements AbstractDocument.Content, Serializable
-{
- // This is package-private to avoid an accessor method.
- char[] content;
-
- private int count;
-
- private Vector positions = new Vector();
-
- private class InsertUndo extends AbstractUndoableEdit
- {
- private int start;
-
- private int length;
-
- private String redoContent;
-
- public InsertUndo(int start, int length)
- {
- super();
- this.start = start;
- this.length = length;
- }
-
- public void undo()
- {
- super.undo();
- try
- {
- StringContent.this.checkLocation(this.start, this.length);
- this.redoContent = new String(StringContent.this.content, this.start, this.length);
- StringContent.this.remove(this.start, this.length);
- }
- catch (BadLocationException b)
- {
- throw new CannotUndoException();
- }
- }
-
- public void redo()
- {
- super.redo();
- try
- {
- StringContent.this.insertString(this.start, this.redoContent);
- }
- catch (BadLocationException b)
- {
- throw new CannotRedoException();
- }
- }
- }
-
- private class RemoveUndo extends AbstractUndoableEdit
- {
- private int start;
-
- private String undoString;
-
- public RemoveUndo(int start, String str)
- {
- super();
- this.start = start;
- this.undoString = str;
- }
-
- public void undo()
- {
- super.undo();
- try
- {
- StringContent.this.insertString(this.start, this.undoString);
- }
- catch (BadLocationException bad)
- {
- throw new CannotUndoException();
- }
- }
-
- public void redo()
- {
- super.redo();
- try
- {
- int end = this.undoString.length();
- StringContent.this.remove(this.start, end);
- }
- catch (BadLocationException bad)
- {
- throw new CannotRedoException();
- }
- }
- }
-
- private class StickyPosition implements Position
- {
- private int offset = -1;
-
- public StickyPosition(int offset)
- {
- this.offset = offset;
- }
-
- // This is package-private to avoid an accessor method.
- void setOffset(int offset)
- {
- this.offset = this.offset >= 0 ? offset : -1;
- }
-
- /**
- * Should be >=0.
- */
- public int getOffset()
- {
- return offset < 0 ? 0 : offset;
- }
- }
-
- public StringContent()
- {
- this(1);
- }
-
- public StringContent(int initialLength)
- {
- super();
- if (initialLength < 1)
- initialLength = 1;
- this.content = new char[initialLength];
- this.content[0] = '\n';
- this.count = 1;
- }
-
- protected Vector getPositionsInRange(Vector v,
- int offset,
- int length)
- {
- Vector refPos = new Vector();
- Iterator iter = this.positions.iterator();
- while(iter.hasNext())
- {
- Position p = (Position)iter.next();
- if ((offset <= p.getOffset())
- && (p.getOffset() <= (offset + length)))
- refPos.add(p);
- }
- return refPos;
- }
-
- public Position createPosition(int offset) throws BadLocationException
- {
- if (offset < this.count || offset > this.count)
- checkLocation(offset, 0);
- StickyPosition sp = new StickyPosition(offset);
- this.positions.add(sp);
- return sp;
- }
-
- public int length()
- {
- return this.count;
- }
-
- public UndoableEdit insertString(int where, String str)
- throws BadLocationException
- {
- checkLocation(where, 0);
- if (where == this.count)
- throw new BadLocationException("Invalid location", 1);
- if (str == null)
- throw new NullPointerException();
- char[] insert = str.toCharArray();
- char[] temp = new char[this.content.length + insert.length];
- this.count += insert.length;
- // Copy array and insert the string.
- if (where > 0)
- System.arraycopy(this.content, 0, temp, 0, where);
- System.arraycopy(insert, 0, temp, where, insert.length);
- System.arraycopy(this.content, where, temp, (where + insert.length), (temp.length - where - insert.length));
- if (this.content.length < temp.length)
- this.content = new char[temp.length];
- // Copy the result in the original char array.
- System.arraycopy(temp, 0, this.content, 0, temp.length);
- // Move all the positions.
- Vector refPos = getPositionsInRange(this.positions, where, temp.length - where);
- Iterator iter = refPos.iterator();
- while (iter.hasNext())
- {
- StickyPosition p = (StickyPosition)iter.next();
- p.setOffset(p.getOffset() + str.length());
- }
- InsertUndo iundo = new InsertUndo(where, insert.length);
- return iundo;
- }
-
- public UndoableEdit remove(int where, int nitems) throws BadLocationException
- {
- checkLocation(where, nitems);
- char[] temp = new char[(this.content.length - nitems)];
- this.count = this.count - nitems;
- RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems));
- // Copy array.
- System.arraycopy(this.content, 0, temp, 0, where);
- System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems);
- this.content = new char[temp.length];
- // Then copy the result in the original char array.
- System.arraycopy(temp, 0, this.content, 0, this.content.length);
- // Move all the positions.
- Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where);
- Iterator iter = refPos.iterator();
- while (iter.hasNext())
- {
- StickyPosition p = (StickyPosition)iter.next();
- int result = p.getOffset() - nitems;
- p.setOffset(result);
- if (result < 0)
- this.positions.remove(p);
- }
- return rundo;
- }
-
- public String getString(int where, int len) throws BadLocationException
- {
- checkLocation(where, len);
- return new String (this.content, where, len);
- }
-
- public void getChars(int where, int len, Segment txt) throws BadLocationException
- {
- checkLocation(where, len);
- if (txt != null)
- {
- txt.array = this.content;
- txt.offset = where;
- txt.count = len;
- }
- }
-
- // This is package-private to avoid an accessor method.
- void checkLocation(int where, int len) throws BadLocationException
- {
- if (where < 0)
- throw new BadLocationException("Invalid location", 1);
- else if (where > this.count)
- throw new BadLocationException("Invalid location", this.count);
- else if ((where + len)>this.count)
- throw new BadLocationException("Invalid range", this.count);
- }
-
-}
-
diff --git a/libjava/javax/swing/text/Style.java b/libjava/javax/swing/text/Style.java
deleted file mode 100644
index 851ac021947..00000000000
--- a/libjava/javax/swing/text/Style.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Style.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import javax.swing.event.ChangeListener;
-
-public interface Style extends MutableAttributeSet
-{
- /**
- * Returns the name of the style.
- *
- * @return the name
- */
- String getName();
-
- /**
- * Adds a <code>ChangeListener</code> object to the style.
- *
- * @param listener the listener object to add
- */
- void addChangeListener(ChangeListener listener);
-
- /**
- * Removes a <code>ChangeListener</code> from to the style.
- *
- * @param listener the listener object to remove,
- */
- void removeChangeListener(ChangeListener listener);
-}
diff --git a/libjava/javax/swing/text/StyleConstants.java b/libjava/javax/swing/text/StyleConstants.java
deleted file mode 100644
index 3f973f22631..00000000000
--- a/libjava/javax/swing/text/StyleConstants.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/* StyleConstants.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Color;
-import java.awt.Component;
-
-import javax.swing.Icon;
-
-public class StyleConstants
-{
- public static final int ALIGN_LEFT = 0;
- public static final int ALIGN_CENTER = 1;
- public static final int ALIGN_RIGHT = 2;
- public static final int ALIGN_JUSTIFIED = 3;
-
- public static final Object Background = CharacterConstants.Background;
- public static final Object BidiLevel = CharacterConstants.BidiLevel;
- public static final Object Bold = CharacterConstants.Bold;
- public static final Object ComponentAttribute = CharacterConstants.ComponentAttribute;
- public static final Object FontFamily = CharacterConstants.Family;
- public static final Object FontSize = CharacterConstants.Size;
- public static final Object Foreground = CharacterConstants.Foreground;
- public static final Object IconAttribute = CharacterConstants.IconAttribute;
- public static final Object Italic = CharacterConstants.Italic;
- public static final Object StrikeThrough = CharacterConstants.StrikeThrough;
- public static final Object Subscript = CharacterConstants.Subscript;
- public static final Object Superscript = CharacterConstants.Superscript;
- public static final Object Underline = CharacterConstants.Underline;
-
- public static final Object Alignment = ParagraphConstants.Alignment;
- public static final Object FirstLineIndent = ParagraphConstants.FirstLineIndent;
- public static final Object LeftIndent = ParagraphConstants.LeftIndent;
- public static final Object LineSpacing = ParagraphConstants.LineSpacing;
- public static final Object Orientation = ParagraphConstants.Orientation;
- public static final Object RightIndent = ParagraphConstants.RightIndent;
- public static final Object SpaceAbove = ParagraphConstants.SpaceAbove;
- public static final Object SpaceBelow = ParagraphConstants.SpaceBelow;
- public static final Object TabSet = ParagraphConstants.TabSet;
-
- public static final String ComponentElementName = "component";
- public static final String IconElementName = "icon";
-
- public static final Object ComposedTextAttribute = new StyleConstants("composed text");
- public static final Object ModelAttribute = new StyleConstants("model");
- public static final Object NameAttribute = new StyleConstants("name");
- public static final Object ResolveAttribute = new StyleConstants("resolver");
-
- String keyname;
-
- // Package-private to avoid accessor constructor for use by
- // subclasses.
- StyleConstants(String k)
- {
- keyname = k;
- }
-
- public String toString()
- {
- return keyname;
- }
-
- public static int getAlignment(AttributeSet a)
- {
- if (a.isDefined(Alignment))
- return ((Integer)a.getAttribute(Alignment)).intValue();
- else
- return ALIGN_LEFT;
- }
-
- public static Color getBackground(AttributeSet a)
- {
- if (a.isDefined(Background))
- return (Color) a.getAttribute(Background);
- else
- return Color.BLACK;
- }
-
- public static int getBidiLevel(AttributeSet a)
- {
- if (a.isDefined(BidiLevel))
- return ((Integer)a.getAttribute(BidiLevel)).intValue();
- else
- return 0;
- }
-
- public static Component getComponent(AttributeSet a)
- {
- if (a.isDefined(ComponentAttribute))
- return (Component) a.getAttribute(ComponentAttribute);
- else
- return (Component) null;
- }
-
- public static float getFirstLineIndent(AttributeSet a)
- {
- if (a.isDefined(FirstLineIndent))
- return ((Float)a.getAttribute(FirstLineIndent)).floatValue();
- else
- return 0.f;
- }
-
- public static String getFontFamily(AttributeSet a)
- {
- if (a.isDefined(FontFamily))
- return (String) a.getAttribute(FontFamily);
- else
- return "Monospaced";
- }
-
- public static int getFontSize(AttributeSet a)
- {
- if (a.isDefined(FontSize))
- return ((Integer)a.getAttribute(FontSize)).intValue();
- else
- return 12;
- }
-
- public static Color getForeground(AttributeSet a)
- {
- if (a.isDefined(Foreground))
- return (Color) a.getAttribute(Foreground);
- else
- return Color.BLACK;
- }
-
- public static Icon getIcon(AttributeSet a)
- {
- if (a.isDefined(IconAttribute))
- return (Icon) a.getAttribute(IconAttribute);
- else
- return (Icon) null;
- }
-
- public static float getLeftIndent(AttributeSet a)
- {
- if (a.isDefined(LeftIndent))
- return ((Float)a.getAttribute(LeftIndent)).floatValue();
- else
- return 0.f;
- }
-
- public static float getLineSpacing(AttributeSet a)
- {
- if (a.isDefined(LineSpacing))
- return ((Float)a.getAttribute(LineSpacing)).floatValue();
- else
- return 0.f;
- }
-
- public static float getRightIndent(AttributeSet a)
- {
- if (a.isDefined(RightIndent))
- return ((Float)a.getAttribute(RightIndent)).floatValue();
- else
- return 0.f;
- }
-
- public static float getSpaceAbove(AttributeSet a)
- {
- if (a.isDefined(SpaceAbove))
- return ((Float)a.getAttribute(SpaceAbove)).floatValue();
- else
- return 0.f;
- }
-
- public static float getSpaceBelow(AttributeSet a)
- {
- if (a.isDefined(SpaceBelow))
- return ((Float)a.getAttribute(SpaceBelow)).floatValue();
- else
- return 0.f;
- }
-
- public static javax.swing.text.TabSet getTabSet(AttributeSet a)
- {
- if (a.isDefined(StyleConstants.TabSet))
- return (javax.swing.text.TabSet) a.getAttribute(StyleConstants.TabSet);
- else
- return (javax.swing.text.TabSet) null;
- }
-
- public static boolean isBold(AttributeSet a)
- {
- if (a.isDefined(Bold))
- return ((Boolean) a.getAttribute(Bold)).booleanValue();
- else
- return false;
- }
-
- public static boolean isItalic(AttributeSet a)
- {
- if (a.isDefined(Italic))
- return ((Boolean) a.getAttribute(Italic)).booleanValue();
- else
- return false;
- }
-
- public static boolean isStrikeThrough(AttributeSet a)
- {
- if (a.isDefined(StrikeThrough))
- return ((Boolean) a.getAttribute(StrikeThrough)).booleanValue();
- else
- return false;
- }
-
- public static boolean isSubscript(AttributeSet a)
- {
- if (a.isDefined(Subscript))
- return ((Boolean) a.getAttribute(Subscript)).booleanValue();
- else
- return false;
- }
-
- public static boolean isSuperscript(AttributeSet a)
- {
- if (a.isDefined(Superscript))
- return ((Boolean) a.getAttribute(Superscript)).booleanValue();
- else
- return false;
- }
-
- public static boolean isUnderline(AttributeSet a)
- {
- if (a.isDefined(Underline))
- return ((Boolean) a.getAttribute(Underline)).booleanValue();
- else
- return false;
- }
-
- public static void setAlignment(MutableAttributeSet a, int align)
- {
- a.addAttribute(Alignment, new Integer(align));
- }
-
- public static void setBackground(MutableAttributeSet a, Color fg)
- {
- a.addAttribute(Background, fg);
- }
-
- public static void setBidiLevel(MutableAttributeSet a, int lev)
- {
- a.addAttribute(BidiLevel, new Integer(lev));
- }
-
- public static void setBold(MutableAttributeSet a, boolean b)
- {
- a.addAttribute(Bold, Boolean.valueOf(b));
- }
-
- public static void setComponent(MutableAttributeSet a, Component c)
- {
- a.addAttribute(ComponentAttribute, c);
- }
-
- public static void setFirstLineIndent(MutableAttributeSet a, float i)
- {
- a.addAttribute(FirstLineIndent, new Float(i));
- }
-
- public static void setFontFamily(MutableAttributeSet a, String fam)
- {
- a.addAttribute(FontFamily, fam);
- }
-
- public static void setFontSize(MutableAttributeSet a, int s)
- {
- a.addAttribute(FontSize, new Integer(s));
- }
-
- public static void setForeground(MutableAttributeSet a, Color fg)
- {
- a.addAttribute(Foreground, fg);
- }
-
- public static void setIcon(MutableAttributeSet a, Icon c)
- {
- a.addAttribute(IconAttribute, c);
- }
-
- public static void setItalic(MutableAttributeSet a, boolean b)
- {
- a.addAttribute(Italic, Boolean.valueOf(b));
- }
-
- public static void setLeftIndent(MutableAttributeSet a, float i)
- {
- a.addAttribute(LeftIndent, new Float(i));
- }
-
- public static void setLineSpacing(MutableAttributeSet a, float i)
- {
- a.addAttribute(LineSpacing, new Float(i));
- }
-
- public static void setRightIndent(MutableAttributeSet a, float i)
- {
- a.addAttribute(RightIndent, new Float(i));
- }
-
- public static void setSpaceAbove(MutableAttributeSet a, float i)
- {
- a.addAttribute(SpaceAbove, new Float(i));
- }
-
- public static void setSpaceBelow(MutableAttributeSet a, float i)
- {
- a.addAttribute(SpaceBelow, new Float(i));
- }
-
- public static void setStrikeThrough(MutableAttributeSet a, boolean b)
- {
- a.addAttribute(StrikeThrough, Boolean.valueOf(b));
- }
-
- public static void setSubscript(MutableAttributeSet a, boolean b)
- {
- a.addAttribute(Subscript, Boolean.valueOf(b));
- }
-
- public static void setSuperscript(MutableAttributeSet a, boolean b)
- {
- a.addAttribute(Superscript, Boolean.valueOf(b));
- }
-
- public static void setTabSet(MutableAttributeSet a, javax.swing.text.TabSet tabs)
- {
- a.addAttribute(StyleConstants.TabSet, tabs);
- }
-
- public static void setUnderline(MutableAttributeSet a, boolean b)
- {
- a.addAttribute(Underline, Boolean.valueOf(b));
- }
-
- // The remainder are so-called "typesafe enumerations" which
- // alias subsets of the above constants.
- public static class CharacterConstants
- extends StyleConstants
- implements AttributeSet.CharacterAttribute
- {
- private CharacterConstants(String k)
- {
- super(k);
- }
-
- public static Object Background = ColorConstants.Background;
- public static Object BidiLevel = new CharacterConstants("bidiLevel");
- public static Object Bold = FontConstants.Bold;
- public static Object ComponentAttribute = new CharacterConstants("component");
- public static Object Family = FontConstants.Family;
- public static Object Size = FontConstants.Size;
- public static Object Foreground = ColorConstants.Foreground;
- public static Object IconAttribute = new CharacterConstants("icon");
- public static Object Italic = FontConstants.Italic;
- public static Object StrikeThrough = new CharacterConstants("strikethrough");
- public static Object Subscript = new CharacterConstants("subscript");
- public static Object Superscript = new CharacterConstants("superscript");
- public static Object Underline = new CharacterConstants("underline");
- }
-
- public static class ColorConstants
- extends StyleConstants
- implements AttributeSet.ColorAttribute, AttributeSet.CharacterAttribute
- {
- private ColorConstants(String k)
- {
- super(k);
- }
- public static Object Foreground = new ColorConstants("foreground");
- public static Object Background = new ColorConstants("background");
- }
-
- public static class FontConstants
- extends StyleConstants
- implements AttributeSet.FontAttribute, AttributeSet.CharacterAttribute
- {
- private FontConstants(String k)
- {
- super(k);
- }
- public static Object Bold = new FontConstants("bold");
- public static Object Family = new FontConstants("family");
- public static Object Italic = new FontConstants("italic");
- public static Object Size = new FontConstants("size");
- }
-
- public static class ParagraphConstants
- extends StyleConstants
- implements AttributeSet.ParagraphAttribute
- {
- private ParagraphConstants(String k)
- {
- super(k);
- }
- public static Object Alignment = new ParagraphConstants("Alignment");
- public static Object FirstLineIndent = new ParagraphConstants("FirstLineIndent");
- public static Object LeftIndent = new ParagraphConstants("LeftIndent");
- public static Object LineSpacing = new ParagraphConstants("LineSpacing");
- public static Object Orientation = new ParagraphConstants("Orientation");
- public static Object RightIndent = new ParagraphConstants("RightIndent");
- public static Object SpaceAbove = new ParagraphConstants("SpaceAbove");
- public static Object SpaceBelow = new ParagraphConstants("SpaceBelow");
- public static Object TabSet = new ParagraphConstants("TabSet");
- }
-
-}
diff --git a/libjava/javax/swing/text/StyleContext.java b/libjava/javax/swing/text/StyleContext.java
deleted file mode 100644
index 9bf32170d7e..00000000000
--- a/libjava/javax/swing/text/StyleContext.java
+++ /dev/null
@@ -1,703 +0,0 @@
-/* StyleContext.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Toolkit;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.EventListener;
-import java.util.Hashtable;
-
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-public class StyleContext
- implements Serializable, AbstractDocument.AttributeContext
-{
- public class NamedStyle
- implements Serializable, Style
- {
- protected ChangeEvent changeEvent;
- protected EventListenerList listenerList;
-
- AttributeSet attributes;
- String name;
-
- public NamedStyle()
- {
- this(null, null);
- }
-
- public NamedStyle(Style parent)
- {
- this(null, parent);
- }
-
- public NamedStyle(String name, Style parent)
- {
- this.name = name;
- this.attributes = getEmptySet();
- this.changeEvent = new ChangeEvent(this);
- this.listenerList = new EventListenerList();
- setResolveParent(parent);
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String n)
- {
- name = n;
- fireStateChanged();
- }
-
- public void addChangeListener(ChangeListener l)
- {
- listenerList.add(ChangeListener.class, l);
- }
-
- public void removeChangeListener(ChangeListener l)
- {
- listenerList.remove(ChangeListener.class, l);
- }
-
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) getListeners(ChangeListener.class);
- }
-
- protected void fireStateChanged()
- {
- ChangeListener[] listeners = getChangeListeners();
- for (int i = 0; i < listeners.length; ++i)
- {
- listeners[i].stateChanged(changeEvent);
- }
- }
-
- public void addAttribute(Object name, Object value)
- {
- attributes = StyleContext.this.addAttribute(attributes, name, value);
- fireStateChanged();
- }
-
- public void addAttributes(AttributeSet attr)
- {
- attributes = StyleContext.this.addAttributes(attributes, attr);
- fireStateChanged();
- }
-
- public boolean containsAttribute(Object name, Object value)
- {
- return attributes.containsAttribute(name, value);
- }
-
- public boolean containsAttributes(AttributeSet attrs)
- {
- return attributes.containsAttributes(attrs);
- }
-
- public AttributeSet copyAttributes()
- {
- return attributes.copyAttributes();
- }
-
- public Object getAttribute(Object attrName)
- {
- return attributes.getAttribute(attrName);
- }
-
- public int getAttributeCount()
- {
- return attributes.getAttributeCount();
- }
-
- public Enumeration getAttributeNames()
- {
- return attributes.getAttributeNames();
- }
-
- public boolean isDefined(Object attrName)
- {
- return attributes.isDefined(attrName);
- }
-
- public boolean isEqual(AttributeSet attr)
- {
- return attributes.isEqual(attr);
- }
-
- public void removeAttribute(Object name)
- {
- attributes = StyleContext.this.removeAttribute(attributes, name);
- fireStateChanged();
- }
-
- public void removeAttributes(AttributeSet attrs)
- {
- attributes = StyleContext.this.removeAttributes(attributes, attrs);
- fireStateChanged();
- }
-
- public void removeAttributes(Enumeration names)
- {
- attributes = StyleContext.this.removeAttributes(attributes, names);
- fireStateChanged();
- }
-
-
- public AttributeSet getResolveParent()
- {
- return attributes.getResolveParent();
- }
-
- public void setResolveParent(AttributeSet parent)
- {
- if (parent != null)
- {
- attributes = StyleContext.this.addAttribute
- (attributes, ResolveAttribute, parent);
- }
- fireStateChanged();
- }
-
- public String toString()
- {
- return ("[NamedStyle: name=" + name + ", attrs=" + attributes.toString() + "]");
- }
- }
-
- public class SmallAttributeSet
- implements AttributeSet
- {
- final Object [] attrs;
- public SmallAttributeSet(AttributeSet a)
- {
- if (a == null)
- attrs = new Object[0];
- else
- {
- int n = a.getAttributeCount();
- int i = 0;
- attrs = new Object[n * 2];
- Enumeration e = a.getAttributeNames();
- while (e.hasMoreElements())
- {
- Object name = e.nextElement();
- attrs[i++] = name;
- attrs[i++] = a.getAttribute(name);
- }
- }
- }
-
- public SmallAttributeSet(Object [] a)
- {
- if (a == null)
- attrs = new Object[0];
- else
- {
- attrs = new Object[a.length];
- System.arraycopy(a, 0, attrs, 0, a.length);
- }
- }
-
- public Object clone()
- {
- return new SmallAttributeSet(this.attrs);
- }
-
- public boolean containsAttribute(Object name, Object value)
- {
- for (int i = 0; i < attrs.length; i += 2)
- {
- if (attrs[i].equals(name) &&
- attrs[i+1].equals(value))
- return true;
- }
- return false;
- }
-
- public boolean containsAttributes(AttributeSet a)
- {
- Enumeration e = a.getAttributeNames();
- while (e.hasMoreElements())
- {
- Object name = e.nextElement();
- Object val = a.getAttribute(name);
- if (!containsAttribute(name, val))
- return false;
- }
- return true;
- }
-
- public AttributeSet copyAttributes()
- {
- return (AttributeSet) clone();
- }
-
- public boolean equals(Object obj)
- {
- return
- (obj instanceof SmallAttributeSet)
- && this.isEqual((AttributeSet)obj);
- }
-
- public Object getAttribute(Object key)
- {
- for (int i = 0; i < attrs.length; i += 2)
- {
- if (attrs[i].equals(key))
- return attrs[i+1];
- }
-
- Object p = getResolveParent();
- if (p != null && p instanceof AttributeSet)
- return (((AttributeSet)p).getAttribute(key));
-
- return null;
- }
-
- public int getAttributeCount()
- {
- return attrs.length / 2;
- }
-
- public Enumeration getAttributeNames()
- {
- return new Enumeration()
- {
- int i = 0;
- public boolean hasMoreElements()
- {
- return i < attrs.length;
- }
- public Object nextElement()
- {
- i += 2;
- return attrs[i-2];
- }
- };
- }
-
- public AttributeSet getResolveParent()
- {
- return (AttributeSet) getAttribute(ResolveAttribute);
- }
-
- public int hashCode()
- {
- return java.util.Arrays.asList(attrs).hashCode();
- }
-
- public boolean isDefined(Object key)
- {
- for (int i = 0; i < attrs.length; i += 2)
- {
- if (attrs[i].equals(key))
- return true;
- }
- return false;
- }
-
- public boolean isEqual(AttributeSet attr)
- {
- return attr != null
- && attr.containsAttributes(this)
- && this.containsAttributes(attr);
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
- sb.append("[StyleContext.SmallattributeSet:");
- for (int i = 0; i < attrs.length; ++i)
- {
- sb.append(" (");
- sb.append(attrs[i].toString());
- sb.append("=");
- sb.append(attrs[i+1].toString());
- sb.append(")");
- }
- sb.append("]");
- return sb.toString();
- }
- }
-
- // FIXME: official javadocs suggest that these might be more usefully
- // implemented using a WeakHashMap, but not sure if that works most
- // places or whether it really matters anyways.
- //
- // FIXME: also not sure if these tables ought to be static (singletons),
- // shared across all StyleContexts. I think so, but it's not clear in
- // docs. revert to non-shared if you think it matters.
-
- public static final String DEFAULT_STYLE = "default";
-
- static Hashtable sharedAttributeSets = new Hashtable();
- static Hashtable sharedFonts = new Hashtable();
-
- static StyleContext defaultStyleContext = new StyleContext();
- static final int compressionThreshold = 9;
-
- EventListenerList listenerList;
- Hashtable styleTable;
-
- public StyleContext()
- {
- listenerList = new EventListenerList();
- styleTable = new Hashtable();
- }
-
- protected SmallAttributeSet createSmallAttributeSet(AttributeSet a)
- {
- return new SmallAttributeSet(a);
- }
-
- protected MutableAttributeSet createLargeAttributeSet(AttributeSet a)
- {
- return new SimpleAttributeSet(a);
- }
-
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
- }
-
- public Style addStyle(String name, Style parent)
- {
- Style newStyle = new NamedStyle(name, parent);
- if (name != null)
- styleTable.put(name, newStyle);
- return newStyle;
- }
-
- public void removeStyle(String name)
- {
- styleTable.remove(name);
- }
-
- public Style getStyle(String name)
- {
- return (Style) styleTable.get(name);
- }
-
- public Enumeration getStyleNames()
- {
- return styleTable.keys();
- }
-
- //
- // StyleContexts only understand the "simple" model of fonts present in
- // pre-java2d systems: fonts are a family name, a size (integral number
- // of points), and a mask of style parameters (plain, bold, italic, or
- // bold|italic). We have an inner class here called SimpleFontSpec which
- // holds such triples.
- //
- // A SimpleFontSpec can be built for *any* AttributeSet because the size,
- // family, and style keys in an AttributeSet have default values (defined
- // over in StyleConstants).
- //
- // We keep a static cache mapping SimpleFontSpecs to java.awt.Fonts, so
- // that we reuse Fonts between styles and style contexts.
- //
-
- private static class SimpleFontSpec
- {
- String family;
- int style;
- int size;
- public SimpleFontSpec(String family,
- int style,
- int size)
- {
- this.family = family;
- this.style = style;
- this.size = size;
- }
- public boolean equals(Object obj)
- {
- return (obj != null)
- && (obj instanceof SimpleFontSpec)
- && (((SimpleFontSpec)obj).family.equals(this.family))
- && (((SimpleFontSpec)obj).style == this.style)
- && (((SimpleFontSpec)obj).size == this.size);
- }
- public int hashCode()
- {
- return family.hashCode() + style + size;
- }
- }
-
- public Font getFont(AttributeSet attr)
- {
- String family = StyleConstants.getFontFamily(attr);
- int style = Font.PLAIN;
- if (StyleConstants.isBold(attr))
- style += Font.BOLD;
- if (StyleConstants.isItalic(attr))
- style += Font.ITALIC;
- int size = StyleConstants.getFontSize(attr);
- return getFont(family, style, size);
- }
-
- public Font getFont(String family, int style, int size)
- {
- SimpleFontSpec spec = new SimpleFontSpec(family, style, size);
- if (sharedFonts.containsKey(spec))
- return (Font) sharedFonts.get(spec);
- else
- {
- Font tmp = new Font(family, style, size);
- sharedFonts.put(spec, tmp);
- return tmp;
- }
- }
-
- public FontMetrics getFontMetrics(Font f)
- {
- return Toolkit.getDefaultToolkit().getFontMetrics(f);
- }
-
- public Color getForeground(AttributeSet a)
- {
- return StyleConstants.getForeground(a);
- }
-
- public Color getBackground(AttributeSet a)
- {
- return StyleConstants.getBackground(a);
- }
-
- protected int getCompressionThreshold()
- {
- return compressionThreshold;
- }
-
- public static StyleContext getDefaultStyleContext()
- {
- return defaultStyleContext;
- }
-
- public AttributeSet addAttribute(AttributeSet old, Object name, Object value)
- {
- if (old instanceof MutableAttributeSet)
- {
- ((MutableAttributeSet)old).addAttribute(name, value);
- return old;
- }
- else
- {
- MutableAttributeSet mutable = createLargeAttributeSet(old);
- mutable.addAttribute(name, value);
- if (mutable.getAttributeCount() >= getCompressionThreshold())
- return mutable;
- else
- {
- SmallAttributeSet small = createSmallAttributeSet(mutable);
- if (sharedAttributeSets.containsKey(small))
- small = (SmallAttributeSet) sharedAttributeSets.get(small);
- else
- sharedAttributeSets.put(small,small);
- return small;
- }
- }
- }
-
- public AttributeSet addAttributes(AttributeSet old, AttributeSet attributes)
- {
- if (old instanceof MutableAttributeSet)
- {
- ((MutableAttributeSet)old).addAttributes(attributes);
- return old;
- }
- else
- {
- MutableAttributeSet mutable = createLargeAttributeSet(old);
- mutable.addAttributes(attributes);
- if (mutable.getAttributeCount() >= getCompressionThreshold())
- return mutable;
- else
- {
- SmallAttributeSet small = createSmallAttributeSet(mutable);
- if (sharedAttributeSets.containsKey(small))
- small = (SmallAttributeSet) sharedAttributeSets.get(small);
- else
- sharedAttributeSets.put(small,small);
- return small;
- }
- }
- }
-
- public AttributeSet getEmptySet()
- {
- AttributeSet e = createSmallAttributeSet(null);
- if (sharedAttributeSets.containsKey(e))
- e = (AttributeSet) sharedAttributeSets.get(e);
- else
- sharedAttributeSets.put(e, e);
- return e;
- }
-
- public void reclaim(AttributeSet attributes)
- {
- if (sharedAttributeSets.containsKey(attributes))
- sharedAttributeSets.remove(attributes);
- }
-
- public AttributeSet removeAttribute(AttributeSet old, Object name)
- {
- if (old instanceof MutableAttributeSet)
- {
- ((MutableAttributeSet)old).removeAttribute(name);
- if (old.getAttributeCount() < getCompressionThreshold())
- {
- SmallAttributeSet small = createSmallAttributeSet(old);
- if (!sharedAttributeSets.containsKey(small))
- sharedAttributeSets.put(small,small);
- old = (AttributeSet) sharedAttributeSets.get(small);
- }
- return old;
- }
- else
- {
- MutableAttributeSet mutable = createLargeAttributeSet(old);
- mutable.removeAttribute(name);
- SmallAttributeSet small = createSmallAttributeSet(mutable);
- if (sharedAttributeSets.containsKey(small))
- small = (SmallAttributeSet) sharedAttributeSets.get(small);
- else
- sharedAttributeSets.put(small,small);
- return small;
- }
- }
-
- public AttributeSet removeAttributes(AttributeSet old, AttributeSet attributes)
- {
- return removeAttributes(old, attributes.getAttributeNames());
- }
-
- public AttributeSet removeAttributes(AttributeSet old, Enumeration names)
- {
- if (old instanceof MutableAttributeSet)
- {
- ((MutableAttributeSet)old).removeAttributes(names);
- if (old.getAttributeCount() < getCompressionThreshold())
- {
- SmallAttributeSet small = createSmallAttributeSet(old);
- if (!sharedAttributeSets.containsKey(small))
- sharedAttributeSets.put(small,small);
- old = (AttributeSet) sharedAttributeSets.get(small);
- }
- return old;
- }
- else
- {
- MutableAttributeSet mutable = createLargeAttributeSet(old);
- mutable.removeAttributes(names);
- SmallAttributeSet small = createSmallAttributeSet(mutable);
- if (sharedAttributeSets.containsKey(small))
- small = (SmallAttributeSet) sharedAttributeSets.get(small);
- else
- sharedAttributeSets.put(small,small);
- return small;
- }
- }
-
-
- // FIXME: there's some sort of quasi-serialization stuff in here which I
- // have left incomplete; I'm not sure I understand the intent properly.
-
- public static Object getStaticAttribute(Object key)
- {
- throw new InternalError("not implemented");
- }
-
- public static Object getStaticAttributeKey(Object key)
- {
- throw new InternalError("not implemented");
- }
-
- public static void readAttributeSet(ObjectInputStream in, MutableAttributeSet a)
- throws ClassNotFoundException, IOException
- {
- throw new InternalError("not implemented");
- }
-
- public static void writeAttributeSet(ObjectOutputStream out, AttributeSet a)
- throws IOException
- {
- throw new InternalError("not implemented");
- }
-
- public void readAttributes(ObjectInputStream in, MutableAttributeSet a)
- throws ClassNotFoundException, IOException
- {
- throw new InternalError("not implemented");
- }
-
- public void writeAttributes(ObjectOutputStream out, AttributeSet a)
- throws IOException
- {
- throw new InternalError("not implemented");
- }
-}
diff --git a/libjava/javax/swing/text/StyledDocument.java b/libjava/javax/swing/text/StyledDocument.java
deleted file mode 100644
index ea277540f23..00000000000
--- a/libjava/javax/swing/text/StyledDocument.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/* StyledDcoument.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Color;
-import java.awt.Font;
-
-/**
- * StyledDocument
- * @author Andrew Selkirk
- * @version 1.0
- */
-public interface StyledDocument extends Document {
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * addStyle
- * @param nm TODO
- * @param rent TODO
- * @returns Style
- */
- Style addStyle(String nm, Style parent);
-
- /**
- * removeStyle
- * @param nm TODO
- */
- void removeStyle(String nm);
-
- /**
- * getStyle
- * @param nm TODO
- * @returns Style
- */
- Style getStyle(String nm);
-
- /**
- * setCharacterAttributes
- * @param offset TODO
- * @param length TODO
- * @param set TODO
- * @param replace TODO
- */
- void setCharacterAttributes(int offset, int length,
- AttributeSet set, boolean replace);
-
- /**
- * setParagraphAttributes
- * @param offset TODO
- * @param length TODO
- * @param set TODO
- * @param replace TODO
- */
- void setParagraphAttributes(int offset, int length,
- AttributeSet set, boolean replace);
-
- /**
- * getLogicalStyle
- * @param position TODO
- * @returns Style
- */
- Style getLogicalStyle(int position);
-
- /**
- * setLogicalStyle
- * @param position TODO
- * @param style TODO
- */
- void setLogicalStyle(int position, Style style);
-
- /**
- * getParagraphElement
- * @param position TODO
- * @returns Element
- */
- Element getParagraphElement(int position);
-
- /**
- * getCharacterElement
- * @param position TODO
- * @returns Element
- */
- Element getCharacterElement(int position);
-
- /**
- * getForeground
- * @param set TODO
- * @returns Color
- */
- Color getForeground(AttributeSet set);
-
- /**
- * getBackground
- * @param set TODO
- * @returns Color
- */
- Color getBackground(AttributeSet set);
-
- /**
- * getFont
- * @param set TODO
- * @returns Font
- */
- Font getFont(AttributeSet set);
-
-
-} // StyledDocument
diff --git a/libjava/javax/swing/text/StyledEditorKit.java b/libjava/javax/swing/text/StyledEditorKit.java
deleted file mode 100644
index 459f2438679..00000000000
--- a/libjava/javax/swing/text/StyledEditorKit.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/* StyledEditorKit.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Color;
-import java.awt.event.ActionEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.Serializable;
-
-import javax.swing.Action;
-import javax.swing.JEditorPane;
-import javax.swing.event.CaretEvent;
-import javax.swing.event.CaretListener;
-
-/**
- * StyledEditorKit
- *
- * @author Andrew Selkirk
- */
-public class StyledEditorKit extends DefaultEditorKit
-{
- private static final long serialVersionUID = 7002391892985555948L;
-
- /**
- * UnderlineAction
- */
- public static class UnderlineAction extends StyledEditorKit.StyledTextAction
- {
- /**
- * Constructor UnderlineAction
- */
- public UnderlineAction()
- {
- super("TODO");
- // TODO
- }
-
- /**
- * actionPerformed
- * @param event TODO
- */
- public void actionPerformed(ActionEvent event)
- {
- // TODO
- }
- }
-
- /**
- * ItalicAction
- */
- public static class ItalicAction extends StyledEditorKit.StyledTextAction
- {
- /**
- * Constructor ItalicAction
- */
- public ItalicAction()
- {
- super("TODO");
- // TODO
- }
-
- /**
- * actionPerformed
- * @param event TODO
- */
- public void actionPerformed(ActionEvent event)
- {
- // TODO
- }
- }
-
- /**
- * BoldAction
- */
- public static class BoldAction extends StyledEditorKit.StyledTextAction
- {
- /**
- * Constructor BoldAction
- */
- public BoldAction()
- {
- super("TODO");
- // TODO
- }
-
- /**
- * actionPerformed
- * @param event TODO
- */
- public void actionPerformed(ActionEvent event)
- {
- // TODO
- }
- }
-
- /**
- * AlignmentAction
- */
- public static class AlignmentAction extends StyledEditorKit.StyledTextAction
- {
- /**
- * a
- */
- private int a;
-
- /**
- * Constructor AlignmentAction
- * @param nm TODO
- * @param a TODO
- */
- public AlignmentAction(String nm, int a)
- {
- super("TODO");
- // TODO
- }
-
- /**
- * actionPerformed
- * @param event TODO
- */
- public void actionPerformed(ActionEvent event)
- {
- // TODO
- }
- }
-
- /**
- * ForegroundAction
- */
- public static class ForegroundAction extends StyledEditorKit.StyledTextAction
- {
- /**
- * fg
- */
- private Color fg;
-
- /**
- * Constructor ForegroundAction
- * @param nm TODO
- * @param fg TODO
- */
- public ForegroundAction(String nm, Color fg)
- {
- super("TODO");
- // TODO
- }
-
- /**
- * actionPerformed
- * @param event TODO
- */
- public void actionPerformed(ActionEvent event)
- {
- // TODO
- }
- }
-
- /**
- * FontSizeAction
- */
- public static class FontSizeAction extends StyledEditorKit.StyledTextAction
- {
- /**
- * size
- */
- private int size;
-
- /**
- * Constructor FontSizeAction
- * @param nm TODO
- * @param size TODO
- */
- public FontSizeAction(String nm, int size)
- {
- super("TODO");
- // TODO
- }
-
- /**
- * actionPerformed
- * @param event TODO
- */
- public void actionPerformed(ActionEvent event)
- {
- // TODO
- }
- }
-
- /**
- * FontFamilyAction
- */
- public static class FontFamilyAction extends StyledEditorKit.StyledTextAction
- {
- /**
- * family
- */
- private String family;
-
- /**
- * Constructor FontFamilyAction
- * @param nm TODO
- * @param family TODO
- */
- public FontFamilyAction(String nm, String family)
- {
- super("TODO");
- // TODO
- }
-
- /**
- * actionPerformed
- * @param event TODO
- */
- public void actionPerformed(ActionEvent event)
- {
- // TODO
- }
- }
-
- /**
- * StyledTextAction
- */
- public abstract static class StyledTextAction extends TextAction
- {
- /**
- * Constructor StyledTextAction
- * @param nm TODO
- */
- public StyledTextAction(String nm)
- {
- super(nm);
- // TODO
- }
-
- /**
- * getEditor
- * @param event TODO
- * @returns JEditorPane
- */
- protected final JEditorPane getEditor(ActionEvent event)
- {
- return null; // TODO
- }
-
- /**
- * setCharacterAttributes
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- protected final void setCharacterAttributes(JEditorPane value0,
- AttributeSet value1,
- boolean value2)
- {
- // TODO
- }
-
- /**
- * getStyledDocument
- * @param value0 TODO
- * @returns StyledDocument
- */
- protected final StyledDocument getStyledDocument(JEditorPane value0)
- {
- return null; // TODO
- }
-
- /**
- * getStyledEditorKit
- * @param value0 TODO
- * @returns StyledEditorKit
- */
- protected final StyledEditorKit getStyledEditorKit(JEditorPane value0)
- {
- return null; // TODO
- }
-
- /**
- * setParagraphAttributes
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- protected final void setParagraphAttributes(JEditorPane value0,
- AttributeSet value1,
- boolean value2)
- {
- // TODO
- }
- }
-
- /**
- * StyledViewFactory
- */
- static class StyledViewFactory
- implements ViewFactory
- {
- /**
- * Constructor StyledViewFactory
- */
- StyledViewFactory()
- {
- // TODO
- }
-
- /**
- * create
- * @param value0 TODO
- * @returns View
- */
- public View create(Element value0)
- {
- return null; // TODO
- }
- }
-
- /**
- * AttributeTracker
- */
- class AttributeTracker
- implements CaretListener, PropertyChangeListener, Serializable
- {
- /**
- * Constructor AttributeTracker
- * @param value0 TODO
- */
- AttributeTracker(StyledEditorKit value0)
- {
- // TODO
- }
-
- /**
- * updateInputAttributes
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- void updateInputAttributes(int value0, int value1, JTextComponent value2)
- {
- // TODO
- }
-
- /**
- * propertyChange
- * @param value0 TODO
- */
- public void propertyChange(PropertyChangeEvent value0)
- {
- // TODO
- }
-
- /**
- * caretUpdate
- * @param value0 TODO
- */
- public void caretUpdate(CaretEvent value0)
- {
- // TODO
- }
- }
-
- /**
- * currentRun
- */
- Element currentRun;
-
- /**
- * currentParagraph
- */
- Element currentParagraph;
-
- /**
- * inputAttributes
- */
- MutableAttributeSet inputAttributes;
-
- /**
- * Constructor StyledEditorKit
- */
- public StyledEditorKit()
- {
- // TODO
- }
-
- /**
- * clone
- * @returns Object
- */
- public Object clone()
- {
- return null; // TODO
- }
-
- /**
- * getActions
- * @returns Action[]
- */
- public Action[] getActions()
- {
- return null; // TODO
- }
-
- /**
- * getInputAttributes
- * @returns MutableAttributeSet
- */
- public MutableAttributeSet getInputAttributes()
- {
- return null; // TODO
- }
-
- /**
- * getCharacterAttributeRun
- * @returns Element
- */
- public Element getCharacterAttributeRun()
- {
- return null; // TODO
- }
-
- /**
- * createDefaultDocument
- * @returns Document
- */
- public Document createDefaultDocument()
- {
- return null; // TODO
- }
-
- /**
- * install
- * @param component TODO
- */
- public void install(JEditorPane component)
- {
- // TODO
- }
-
- /**
- * deinstall
- * @param component TODO
- */
- public void deinstall(JEditorPane component)
- {
- // TODO
- }
-
- /**
- * getViewFactory
- * @returns ViewFactory
- */
- public ViewFactory getViewFactory()
- {
- return null; // TODO
- }
-
- /**
- * createInputAttributes
- * @param element TODO
- * @param set TODO
- */
- protected void createInputAttributes(Element element, MutableAttributeSet set)
- {
- // TODO
- }
-}
diff --git a/libjava/javax/swing/text/TabExpander.java b/libjava/javax/swing/text/TabExpander.java
deleted file mode 100644
index a1e4571cf67..00000000000
--- a/libjava/javax/swing/text/TabExpander.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* TabExpander.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-public interface TabExpander
-{
- float nextTabStop(float x, int tabOffset);
-}
diff --git a/libjava/javax/swing/text/TabSet.java b/libjava/javax/swing/text/TabSet.java
deleted file mode 100644
index 146f545aac7..00000000000
--- a/libjava/javax/swing/text/TabSet.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* TabSet.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.io.Serializable;
-
-public class TabSet implements Serializable
-{
- TabStop[] tabs;
-
- public TabSet(TabStop[] t)
- {
- tabs = t;
- }
-
- public TabStop getTab(int i)
- {
- return tabs[i];
- }
-
- public TabStop getTabAfter(float location)
- {
- int idx = getTabIndexAfter(location);
- if (idx == -1)
- return null;
- else
- return tabs[idx];
- }
-
- public int getTabCount()
- {
- return tabs.length;
- }
-
- public int getTabIndex(TabStop tab)
- {
- for (int i = 0; i < tabs.length; ++i)
- if (tabs[i] == tab)
- return i;
- return -1;
- }
-
- public int getTabIndexAfter(float location)
- {
- int idx = -1;
- for (int i = 0; i < tabs.length; ++i)
- {
- if (location < tabs[i].getPosition())
- idx = i;
- }
- return idx;
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
- sb.append("[");
- for (int i = 0; i < tabs.length; ++i)
- {
- if (i != 0)
- sb.append(" - ");
- sb.append(tabs[i].toString());
- }
- sb.append("]");
- return sb.toString();
- }
-}
diff --git a/libjava/javax/swing/text/TabStop.java b/libjava/javax/swing/text/TabStop.java
deleted file mode 100644
index 032da8bca46..00000000000
--- a/libjava/javax/swing/text/TabStop.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* TabSet.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.io.Serializable;
-
-public class TabStop implements Serializable
-{
- public static final int ALIGN_LEFT = 0;
- public static final int ALIGN_RIGHT = 1;
- public static final int ALIGN_CENTER = 2;
- public static final int ALIGN_DECIMAL = 4;
- public static final int ALIGN_BAR = 5;
-
- public static final int LEAD_NONE = 0;
- public static final int LEAD_DOTS = 1;
- public static final int LEAD_HYPHENS = 2;
- public static final int LEAD_UNDERLINE = 3;
- public static final int LEAD_THICKLINE = 4;
- public static final int LEAD_EQUALS = 5;
-
- float pos;
- int align;
- int leader;
-
- public TabStop(float pos)
- {
- this(pos, ALIGN_LEFT, LEAD_NONE);
- }
-
- public TabStop(float pos, int align, int leader)
- {
- this.pos = pos;
- this.align = align;
- this.leader = leader;
- }
-
- public boolean equals(Object other)
- {
- return (other != null)
- && (other instanceof TabStop)
- && (((TabStop)other).getPosition() == this.getPosition())
- && (((TabStop)other).getLeader() == this.getLeader())
- && (((TabStop)other).getAlignment() == this.getAlignment());
- }
-
- public int getAlignment()
- {
- return align;
- }
-
- public int getLeader()
- {
- return leader;
- }
-
- public float getPosition()
- {
- return pos;
- }
-
- public int hashCode()
- {
- return (int) pos + (int) leader + (int) align;
- }
-
- public String toString()
- {
- String prefix = "";
- switch (align)
- {
- case ALIGN_LEFT:
- prefix = "left ";
- break;
- case ALIGN_RIGHT:
- prefix = "right ";
- break;
-
- case ALIGN_CENTER:
- prefix = "center ";
- break;
-
- case ALIGN_DECIMAL:
- prefix = "decimal ";
- break;
-
- case ALIGN_BAR:
- prefix = "bar ";
- break;
-
- default:
- break;
- }
-
- return (prefix + "tab @" + pos + ((leader == LEAD_NONE) ? "" : "(w/leaders)"));
- }
-
-}
diff --git a/libjava/javax/swing/text/TabableView.java b/libjava/javax/swing/text/TabableView.java
deleted file mode 100644
index 2a96ea94d81..00000000000
--- a/libjava/javax/swing/text/TabableView.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/* TabableView.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-public interface TabableView
-{
- float getPartialSpan(int p0, int p1);
- float getTabbedSpan(float x, TabExpander expander);
-}
diff --git a/libjava/javax/swing/text/TextAction.java b/libjava/javax/swing/text/TextAction.java
deleted file mode 100644
index 8588e3cd202..00000000000
--- a/libjava/javax/swing/text/TextAction.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/* TextAction.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.event.ActionEvent;
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-
-/**
- * TextAction
- * @author Andrew Selkirk
- */
-public abstract class TextAction extends AbstractAction
-{
- /**
- * Constructor TextAction
- * @param name TODO
- */
- public TextAction(String name)
- {
- super(name);
- }
-
- /**
- * Returns the <code>JTextComponent</code> object associated with the given
- * <code>ActionEvent</code>. If the source of the event is not a
- * <code>JTextComponent</code> the currently focused text component is returned.
- *
- * @param event the action event
- *
- * @return the <code>JTextComponent</code>
- */
- protected final JTextComponent getTextComponent(ActionEvent event)
- {
- if (event.getSource() instanceof JTextComponent)
- return (JTextComponent) event.getSource();
-
- return getFocusedComponent();
- }
-
- /**
- * Creates a new array of <code>Action</code> containing both given arrays.
- *
- * @param list1 the first action array
- * @param list2 the second action array
- *
- * @return the augmented array of actions
- */
- public static final Action[] augmentList(Action[] list1, Action[] list2)
- {
- HashSet actionSet = new HashSet();
-
- for (int i = 0; i < list1.length; ++i)
- actionSet.add(list1[i]);
-
- for (int i = 0; i < list2.length; ++i)
- actionSet.add(list2[i]);
-
- ArrayList list = new ArrayList(actionSet);
- return (Action[]) list.toArray(new Action[actionSet.size()]);
- }
-
- /**
- * Returns the current focused <code>JTextComponent</code> object.
- *
- * @return the <code>JTextComponent</code>
- */
- protected final JTextComponent getFocusedComponent()
- {
- return null; // TODO
- }
-}
diff --git a/libjava/javax/swing/text/Utilities.java b/libjava/javax/swing/text/Utilities.java
deleted file mode 100644
index d40408ddc3f..00000000000
--- a/libjava/javax/swing/text/Utilities.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/* Utilities.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-
-/**
- * A set of utilities to deal with text. This is used by several other classes
- * inside this package.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
-public class Utilities
-{
- /**
- * The length of the char buffer that holds the characters to be drawn.
- */
- private static final int BUF_LENGTH = 64;
-
- /**
- * Creates a new <code>Utilities</code> object.
- */
- public Utilities()
- {
- // Nothing to be done here.
- }
-
- /**
- * Draws the given text segment. Contained tabs and newline characters
- * are taken into account. Tabs are expanded using the
- * specified {@link TabExpander}.
- *
- * @param s the text fragment to be drawn.
- * @param x the x position for drawing.
- * @param y the y position for drawing.
- * @param g the {@link Graphics} context for drawing.
- * @param e the {@link TabExpander} which specifies the Tab-expanding
- * technique.
- * @param startOffset starting offset in the text.
- * @return the x coordinate at the end of the drawn text.
- */
- public static final int drawTabbedText(Segment s, int x, int y, Graphics g,
- TabExpander e, int startOffset)
- {
- // This buffers the chars to be drawn.
- char[] buffer = s.array;
-
-
- // The current x and y pixel coordinates.
- int pixelX = x;
- int pixelY = y;
-
- // The font metrics of the current selected font.
- FontMetrics metrics = g.getFontMetrics();
- int ascent = metrics.getAscent();
-
- int pixelWidth = 0;
- int pos = s.offset;
- int len = 0;
-
- for (int offset = s.offset; offset < (s.offset + s.count); ++offset)
- {
- char c = buffer[offset];
- if (c == '\t' || c == '\n')
- {
- if (len > 0) {
- g.drawChars(buffer, pos, len, pixelX, pixelY + ascent);
- pixelX += pixelWidth;
- pixelWidth = 0;
- }
- pos = offset+1;
- len = 0;
- }
-
- switch (c)
- {
- case '\t':
- // In case we have a tab, we just 'jump' over the tab.
- // When we have no tab expander we just use the width of ' '.
- if (e != null)
- pixelX = (int) e.nextTabStop((float) pixelX,
- startOffset + offset - s.offset);
- else
- pixelX += metrics.charWidth(' ');
- break;
- case '\n':
- // In case we have a newline, we must jump to the next line.
- pixelY += metrics.getHeight();
- pixelX = x;
- break;
- default:
- ++len;
- pixelWidth += metrics.charWidth(buffer[offset]);
- break;
- }
- }
-
- if (len > 0)
- g.drawChars(buffer, pos, len, pixelX, pixelY + ascent);
-
- return pixelX;
- }
-
- /**
- * Determines the width, that the given text <code>s</code> would take
- * if it was printed with the given {@link java.awt.FontMetrics} on the
- * specified screen position.
- * @param s the text fragment
- * @param metrics the font metrics of the font to be used
- * @param x the x coordinate of the point at which drawing should be done
- * @param e the {@link TabExpander} to be used
- * @param startOffset the index in <code>s</code> where to start
- * @returns the width of the given text s. This takes tabs and newlines
- * into account.
- */
- public static final int getTabbedTextWidth(Segment s, FontMetrics metrics,
- int x, TabExpander e,
- int startOffset)
- {
- // This buffers the chars to be drawn.
- char[] buffer = s.array;
-
- // The current x coordinate.
- int pixelX = x;
-
- // The current maximum width.
- int maxWidth = 0;
-
- for (int offset = s.offset; offset < (s.offset + s.count); ++offset)
- {
- switch (buffer[offset])
- {
- case '\t':
- // In case we have a tab, we just 'jump' over the tab.
- // When we have no tab expander we just use the width of 'm'.
- if (e != null)
- pixelX = (int) e.nextTabStop((float) pixelX,
- startOffset + offset - s.offset);
- else
- pixelX += metrics.charWidth(' ');
- break;
- case '\n':
- // In case we have a newline, we must 'draw'
- // the buffer and jump on the next line.
- pixelX += metrics.charWidth(buffer[offset]);
- maxWidth = Math.max(maxWidth, pixelX - x);
- pixelX = x;
- break;
- default:
- // Here we draw the char.
- pixelX += metrics.charWidth(buffer[offset]);
- break;
- }
- }
-
- // Take the last line into account.
- maxWidth = Math.max(maxWidth, pixelX - x);
-
- return maxWidth;
- }
-}
diff --git a/libjava/javax/swing/text/View.java b/libjava/javax/swing/text/View.java
deleted file mode 100644
index 490408ae46d..00000000000
--- a/libjava/javax/swing/text/View.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/* View.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-import java.awt.Container;
-import java.awt.Graphics;
-import java.awt.Shape;
-
-import javax.swing.SwingConstants;
-
-public abstract class View implements SwingConstants
-{
- public static final int BadBreakWeight = 0;
- public static final int ExcellentBreakWeight = 2000;
- public static final int ForcedBreakWeight = 3000;
- public static final int GoodBreakWeight = 1000;
-
- public static final int X_AXIS = 0;
- public static final int Y_AXIS = 1;
-
- private float width, height;
- private Element elt;
- private View parent;
-
- /**
- * Creates a new <code>View</code> instance.
- *
- * @param elem an <code>Element</code> value
- */
- public View(Element elem)
- {
- elt = elem;
- }
-
- public abstract void paint(Graphics g, Shape s);
-
- public void setParent(View parent)
- {
- this.parent = parent;
- }
-
- public View getParent()
- {
- return parent;
- }
-
- public Container getContainer()
- {
- View parent = getParent();
- return parent != null ? parent.getContainer() : null;
- }
-
- public Document getDocument()
- {
- return getElement().getDocument();
- }
-
- public Element getElement()
- {
- return elt;
- }
-
- public abstract float getPreferredSpan(int axis);
-
- public int getResizeWeight(int axis)
- {
- return 0;
- }
-
- public float getMaximumSpan(int axis)
- {
- if (getResizeWeight(axis) <= 0)
- return getPreferredSpan(axis);
-
- return Integer.MAX_VALUE;
- }
-
- public float getMinimumSpan(int axis)
- {
- if (getResizeWeight(axis) <= 0)
- return getPreferredSpan(axis);
-
- return Integer.MAX_VALUE;
- }
-
- public void setSize(float width, float height)
- {
- // The default implementation does nothing.
- }
-
- public float getAlignment(int axis)
- {
- return 0.5f;
- }
-
- public AttributeSet getAttributes()
- {
- return getElement().getAttributes();
- }
-
- public boolean isVisible()
- {
- return true;
- }
-
- public int getViewCount()
- {
- return 0;
- }
-
- public View getView(int index)
- {
- return null;
- }
-
- public ViewFactory getViewFactory()
- {
- View parent = getParent();
- return parent != null ? parent.getViewFactory() : null;
- }
-
- public void replace(int offset, int length, View[] views)
- {
- // Default implementation does nothing.
- }
-
- public void insert(int offset, View view)
- {
- View[] array = { view };
- replace(offset, 1, array);
- }
-
- public void append(View view)
- {
- View[] array = { view };
- replace(getViewCount(), 1, array);
- }
-
- public void removeAll()
- {
- replace(0, getViewCount(), null);
- }
-
- public void remove(int index)
- {
- replace(index, 1, null);
- }
-
- public View createFragment(int p0, int p1)
- {
- // The default implementation doesn't support fragmentation.
- return this;
- }
-
- public int getStartOffset()
- {
- return getElement().getStartOffset();
- }
-
- public int getEndOffset()
- {
- return getElement().getEndOffset();
- }
-
- public Shape getChildAllocation(int index, Shape a)
- {
- return null;
- }
-
- /**
- * @since 1.4
- */
- public int getViewIndex(float x, float y, Shape allocation)
- {
- return -1;
- }
-
- /**
- * @since 1.4
- */
- public String getToolTipText(float x, float y, Shape allocation)
- {
- int index = getViewIndex(x, y, allocation);
-
- if (index < -1)
- return null;
-
- Shape childAllocation = getChildAllocation(index, allocation);
-
- if (childAllocation.getBounds().contains(x, y))
- return getView(index).getToolTipText(x, y, childAllocation);
-
- return null;
- }
-
- /**
- * @since 1.3
- */
- public Graphics getGraphics()
- {
- return getContainer().getGraphics();
- }
-
- public void preferenceChanged(View child, boolean width, boolean height)
- {
- if (parent != null)
- parent.preferenceChanged(this, width, height);
- }
-
- public int getBreakWeight(int axis, float pos, float len)
- {
- return BadBreakWeight;
- }
-
- public View breakView(int axis, int offset, float pos, float len)
- {
- return this;
- }
-
- /**
- * @since 1.3
- */
- public int getViewIndex(int pos, Position.Bias b)
- {
- return -1;
- }
-}
-
diff --git a/libjava/javax/swing/text/ViewFactory.java b/libjava/javax/swing/text/ViewFactory.java
deleted file mode 100644
index 079488017b6..00000000000
--- a/libjava/javax/swing/text/ViewFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ViewFactory.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text;
-
-public interface ViewFactory
-{
- /**
- * Creates a view for a given element.
- *
- * @param elem them element to create view for
- *
- * @return a new created view
- */
- View create(Element elem);
-}
diff --git a/libjava/javax/swing/text/html/HTML.java b/libjava/javax/swing/text/html/HTML.java
deleted file mode 100644
index 6ed18d4eb2c..00000000000
--- a/libjava/javax/swing/text/html/HTML.java
+++ /dev/null
@@ -1,1294 +0,0 @@
-/* HTML.java -- HTML document tag constants
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html;
-
-import java.io.Serializable;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.swing.text.AttributeSet;
-
-/**
- * HTML attribute and tag definitions.
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class HTML
-{
- /**
- * Represents a HTML attribute.
- */
- public static class Attribute
- implements Serializable
- {
- /**
- * The action attribute
- */
- public static final Attribute ACTION = new Attribute("action");
-
- /**
- * The align attribute
- */
- public static final Attribute ALIGN = new Attribute("align");
-
- /**
- * The alink attribute
- */
- public static final Attribute ALINK = new Attribute("alink");
-
- /**
- * The alt attribute
- */
- public static final Attribute ALT = new Attribute("alt");
-
- /**
- * The archive attribute
- */
- public static final Attribute ARCHIVE = new Attribute("archive");
-
- /**
- * The background attribute
- */
- public static final Attribute BACKGROUND = new Attribute("background");
-
- /**
- * The bgcolor attribute
- */
- public static final Attribute BGCOLOR = new Attribute("bgcolor");
-
- /**
- * The border attribute
- */
- public static final Attribute BORDER = new Attribute("border");
-
- /**
- * The cellpadding attribute
- */
- public static final Attribute CELLPADDING = new Attribute("cellpadding");
-
- /**
- * The cellspacing attribute
- */
- public static final Attribute CELLSPACING = new Attribute("cellspacing");
-
- /**
- * The checked attribute
- */
- public static final Attribute CHECKED = new Attribute("checked");
-
- /**
- * The class attribute
- */
- public static final Attribute CLASS = new Attribute("class");
-
- /**
- * The classid attribute
- */
- public static final Attribute CLASSID = new Attribute("classid");
-
- /**
- * The clear attribute
- */
- public static final Attribute CLEAR = new Attribute("clear");
-
- /**
- * The code attribute
- */
- public static final Attribute CODE = new Attribute("code");
-
- /**
- * The codebase attribute
- */
- public static final Attribute CODEBASE = new Attribute("codebase");
-
- /**
- * The codetype attribute
- */
- public static final Attribute CODETYPE = new Attribute("codetype");
-
- /**
- * The color attribute
- */
- public static final Attribute COLOR = new Attribute("color");
-
- /**
- * The cols attribute
- */
- public static final Attribute COLS = new Attribute("cols");
-
- /**
- * The colspan attribute
- */
- public static final Attribute COLSPAN = new Attribute("colspan");
-
- /**
- * The comment attribute
- */
- public static final Attribute COMMENT = new Attribute("comment");
-
- /**
- * The compact attribute
- */
- public static final Attribute COMPACT = new Attribute("compact");
-
- /**
- * The content attribute
- */
- public static final Attribute CONTENT = new Attribute("content");
-
- /**
- * The coords attribute
- */
- public static final Attribute COORDS = new Attribute("coords");
-
- /**
- * The data attribute
- */
- public static final Attribute DATA = new Attribute("data");
-
- /**
- * The declare attribute
- */
- public static final Attribute DECLARE = new Attribute("declare");
-
- /**
- * The dir attribute
- */
- public static final Attribute DIR = new Attribute("dir");
-
- /**
- * The dummy attribute
- */
- public static final Attribute DUMMY = new Attribute("dummy");
-
- /**
- * The enctype attribute
- */
- public static final Attribute ENCTYPE = new Attribute("enctype");
-
- /**
- * The endtag attribute
- */
- public static final Attribute ENDTAG = new Attribute("endtag");
-
- /**
- * The face attribute
- */
- public static final Attribute FACE = new Attribute("face");
-
- /**
- * The frameborder attribute
- */
- public static final Attribute FRAMEBORDER = new Attribute("frameborder");
-
- /**
- * The halign attribute
- */
- public static final Attribute HALIGN = new Attribute("halign");
-
- /**
- * The height attribute
- */
- public static final Attribute HEIGHT = new Attribute("height");
-
- /**
- * The href attribute
- */
- public static final Attribute HREF = new Attribute("href");
-
- /**
- * The hspace attribute
- */
- public static final Attribute HSPACE = new Attribute("hspace");
-
- /**
- * The http-equiv attribute
- */
- public static final Attribute HTTPEQUIV = new Attribute("http-equiv");
-
- /**
- * The id attribute
- */
- public static final Attribute ID = new Attribute("id");
-
- /**
- * The ismap attribute
- */
- public static final Attribute ISMAP = new Attribute("ismap");
-
- /**
- * The lang attribute
- */
- public static final Attribute LANG = new Attribute("lang");
-
- /**
- * The language attribute
- */
- public static final Attribute LANGUAGE = new Attribute("language");
-
- /**
- * The link attribute
- */
- public static final Attribute LINK = new Attribute("link");
-
- /**
- * The lowsrc attribute
- */
- public static final Attribute LOWSRC = new Attribute("lowsrc");
-
- /**
- * The marginheight attribute
- */
- public static final Attribute MARGINHEIGHT = new Attribute("marginheight");
-
- /**
- * The marginwidth attribute
- */
- public static final Attribute MARGINWIDTH = new Attribute("marginwidth");
-
- /**
- * The maxlength attribute
- */
- public static final Attribute MAXLENGTH = new Attribute("maxlength");
-
- /**
- * The media attribute
- */
- public static final Attribute MEDIA = new Attribute("media");
-
- /**
- * The method attribute
- */
- public static final Attribute METHOD = new Attribute("method");
-
- /**
- * The multiple attribute
- */
- public static final Attribute MULTIPLE = new Attribute("multiple");
-
- /**
- * The n attribute
- */
- public static final Attribute N = new Attribute("n");
-
- /**
- * The name attribute
- */
- public static final Attribute NAME = new Attribute("name");
-
- /**
- * The nohref attribute
- */
- public static final Attribute NOHREF = new Attribute("nohref");
-
- /**
- * The noresize attribute
- */
- public static final Attribute NORESIZE = new Attribute("noresize");
-
- /**
- * The noshade attribute
- */
- public static final Attribute NOSHADE = new Attribute("noshade");
-
- /**
- * The nowrap attribute
- */
- public static final Attribute NOWRAP = new Attribute("nowrap");
-
- /**
- * The prompt attribute
- */
- public static final Attribute PROMPT = new Attribute("prompt");
-
- /**
- * The rel attribute
- */
- public static final Attribute REL = new Attribute("rel");
-
- /**
- * The rev attribute
- */
- public static final Attribute REV = new Attribute("rev");
-
- /**
- * The rows attribute
- */
- public static final Attribute ROWS = new Attribute("rows");
-
- /**
- * The rowspan attribute
- */
- public static final Attribute ROWSPAN = new Attribute("rowspan");
-
- /**
- * The scrolling attribute
- */
- public static final Attribute SCROLLING = new Attribute("scrolling");
-
- /**
- * The selected attribute
- */
- public static final Attribute SELECTED = new Attribute("selected");
-
- /**
- * The shape attribute
- */
- public static final Attribute SHAPE = new Attribute("shape");
-
- /**
- * The shapes attribute
- */
- public static final Attribute SHAPES = new Attribute("shapes");
-
- /**
- * The size attribute
- */
- public static final Attribute SIZE = new Attribute("size");
-
- /**
- * The src attribute
- */
- public static final Attribute SRC = new Attribute("src");
-
- /**
- * The standby attribute
- */
- public static final Attribute STANDBY = new Attribute("standby");
-
- /**
- * The start attribute
- */
- public static final Attribute START = new Attribute("start");
-
- /**
- * The style attribute
- */
- public static final Attribute STYLE = new Attribute("style");
-
- /**
- * The target attribute
- */
- public static final Attribute TARGET = new Attribute("target");
-
- /**
- * The text attribute
- */
- public static final Attribute TEXT = new Attribute("text");
-
- /**
- * The title attribute
- */
- public static final Attribute TITLE = new Attribute("title");
-
- /**
- * The type attribute
- */
- public static final Attribute TYPE = new Attribute("type");
-
- /**
- * The usemap attribute
- */
- public static final Attribute USEMAP = new Attribute("usemap");
-
- /**
- * The valign attribute
- */
- public static final Attribute VALIGN = new Attribute("valign");
-
- /**
- * The value attribute
- */
- public static final Attribute VALUE = new Attribute("value");
-
- /**
- * The valuetype attribute
- */
- public static final Attribute VALUETYPE = new Attribute("valuetype");
-
- /**
- * The version attribute
- */
- public static final Attribute VERSION = new Attribute("version");
-
- /**
- * The vlink attribute
- */
- public static final Attribute VLINK = new Attribute("vlink");
-
- /**
- * The vspace attribute
- */
- public static final Attribute VSPACE = new Attribute("vspace");
-
- /**
- * The width attribute
- */
- public static final Attribute WIDTH = new Attribute("width");
- private final String name;
-
- /**
- * Creates the attribute with the given name.
- */
- protected Attribute(String a_name)
- {
- name = a_name;
- }
-
- /**
- * Calls compareTo on the tag names (Strings)
- */
- public int compareTo(Object other)
- {
- return name.compareTo(((Attribute) other).name);
- }
-
- /**
- * The attributes are equal if the names are equal
- * (ignoring case)
- */
- public boolean equals(Object other)
- {
- if (other == this)
- return true;
-
- if (!(other instanceof Attribute))
- return false;
-
- Attribute that = (Attribute) other;
-
- return that.name.equalsIgnoreCase(name);
- }
-
- /**
- * Returns the hash code which corresponds to the string for this tag.
- */
- public int hashCode()
- {
- return name == null ? 0 : name.hashCode();
- }
-
- /**
- * Returns the attribute name. The names of the built-in attributes
- * are always returned in lowercase.
- */
- public String toString()
- {
- return name;
- }
-
- /**
- * Return an array of all attributes, declared in the HTML.Attribute
- * class. WARNING: attributes are the only public fields,
- * expected in this class.
- */
- static Attribute[] getAllAttributes()
- {
- Field[] f = Attribute.class.getFields();
- Attribute[] attrs = new Attribute[ f.length ];
- Field x;
- int p = 0;
- Attribute a;
-
- for (int i = 0; i < f.length; i++)
- {
- x = f [ i ];
-
- if ((x.getModifiers() & Modifier.STATIC) != 0)
- {
- if (x.getType().equals(Attribute.class))
- {
- try
- {
- a = (Attribute) x.get(null);
- attrs [ p++ ] = a;
- }
- catch (Exception ex)
- {
- ex.printStackTrace(System.err);
- throw new Error("This should never happen, report a bug");
- }
- }
- }
- }
-
- return attrs;
- }
- }
-
- /**
- * Represents a HTML tag.
- */
- public static class Tag
- implements Comparable, Serializable
- {
- /**
- * The &lt;a&gt; tag
- */
- public static final Tag A = new Tag("a");
-
- /**
- * The &lt;address&gt; tag
- */
- public static final Tag ADDRESS = new Tag("address");
-
- /**
- * The &lt;applet&gt; tag
- */
- public static final Tag APPLET = new Tag("applet");
-
- /**
- * The &lt;area&gt; tag
- */
- public static final Tag AREA = new Tag("area");
-
- /**
- * The &lt;b&gt; tag
- */
- public static final Tag B = new Tag("b");
-
- /**
- * The &lt;base&gt; tag
- */
- public static final Tag BASE = new Tag("base");
-
- /**
- * The &lt;basefont&gt; tag
- */
- public static final Tag BASEFONT = new Tag("basefont");
-
- /**
- * The &lt;big&gt; tag
- */
- public static final Tag BIG = new Tag("big");
-
- /**
- * The &lt;blockquote&gt; tag , breaks flow, block tag.
- */
- public static final Tag BLOCKQUOTE = new Tag("blockquote", BREAKS | BLOCK);
-
- /**
- * The &lt;body&gt; tag , breaks flow, block tag.
- */
- public static final Tag BODY = new Tag("body", BREAKS | BLOCK);
-
- /**
- * The &lt;br&gt; tag , breaks flow.
- */
- public static final Tag BR = new Tag("br", BREAKS);
-
- /**
- * The &lt;caption&gt; tag
- */
- public static final Tag CAPTION = new Tag("caption");
-
- /**
- * The &lt;center&gt; tag , breaks flow.
- */
- public static final Tag CENTER = new Tag("center", BREAKS);
-
- /**
- * The &lt;cite&gt; tag
- */
- public static final Tag CITE = new Tag("cite");
-
- /**
- * The &lt;code&gt; tag
- */
- public static final Tag CODE = new Tag("code");
-
- /**
- * The &lt;dd&gt; tag , breaks flow, block tag.
- */
- public static final Tag DD = new Tag("dd", BREAKS | BLOCK);
-
- /**
- * The &lt;dfn&gt; tag
- */
- public static final Tag DFN = new Tag("dfn");
-
- /**
- * The &lt;dir&gt; tag , breaks flow, block tag.
- */
- public static final Tag DIR = new Tag("dir", BREAKS | BLOCK);
-
- /**
- * The &lt;div&gt; tag , breaks flow, block tag.
- */
- public static final Tag DIV = new Tag("div", BREAKS | BLOCK);
-
- /**
- * The &lt;dl&gt; tag , breaks flow, block tag.
- */
- public static final Tag DL = new Tag("dl", BREAKS | BLOCK);
-
- /**
- * The &lt;dt&gt; tag , breaks flow, block tag.
- */
- public static final Tag DT = new Tag("dt", BREAKS | BLOCK);
-
- /**
- * The &lt;em&gt; tag
- */
- public static final Tag EM = new Tag("em");
-
- /**
- * The &lt;font&gt; tag
- */
- public static final Tag FONT = new Tag("font");
-
- /**
- * The &lt;form&gt; tag , breaks flow.
- */
- public static final Tag FORM = new Tag("form", BREAKS);
-
- /**
- * The &lt;frame&gt; tag
- */
- public static final Tag FRAME = new Tag("frame");
-
- /**
- * The &lt;frameset&gt; tag
- */
- public static final Tag FRAMESET = new Tag("frameset");
-
- /**
- * The &lt;h1&gt; tag , breaks flow, block tag.
- */
- public static final Tag H1 = new Tag("h1", BREAKS | BLOCK);
-
- /**
- * The &lt;h2&gt; tag , breaks flow, block tag.
- */
- public static final Tag H2 = new Tag("h2", BREAKS | BLOCK);
-
- /**
- * The &lt;h3&gt; tag , breaks flow, block tag.
- */
- public static final Tag H3 = new Tag("h3", BREAKS | BLOCK);
-
- /**
- * The &lt;h4&gt; tag , breaks flow, block tag.
- */
- public static final Tag H4 = new Tag("h4", BREAKS | BLOCK);
-
- /**
- * The &lt;h5&gt; tag , breaks flow, block tag.
- */
- public static final Tag H5 = new Tag("h5", BREAKS | BLOCK);
-
- /**
- * The &lt;h6&gt; tag , breaks flow, block tag.
- */
- public static final Tag H6 = new Tag("h6", BREAKS | BLOCK);
-
- /**
- * The &lt;head&gt; tag , breaks flow, block tag.
- */
- public static final Tag HEAD = new Tag("head", BREAKS | BLOCK);
-
- /**
- * The &lt;hr&gt; tag , breaks flow.
- */
- public static final Tag HR = new Tag("hr", BREAKS);
-
- /**
- * The &lt;html&gt; tag , breaks flow.
- */
- public static final Tag HTML = new Tag("html", BREAKS);
-
- /**
- * The &lt;i&gt; tag
- */
- public static final Tag I = new Tag("i");
-
- /**
- * The &lt;img&gt; tag
- */
- public static final Tag IMG = new Tag("img");
-
- /**
- * The &lt;input&gt; tag
- */
- public static final Tag INPUT = new Tag("input");
-
- /**
- * The &lt;isindex&gt; tag , breaks flow.
- */
- public static final Tag ISINDEX = new Tag("isindex", BREAKS);
-
- /**
- * The &lt;kbd&gt; tag
- */
- public static final Tag KBD = new Tag("kbd");
-
- /**
- * The &lt;li&gt; tag , breaks flow, block tag.
- */
- public static final Tag LI = new Tag("li", BREAKS | BLOCK);
-
- /**
- * The &lt;link&gt; tag
- */
- public static final Tag LINK = new Tag("link");
-
- /**
- * The &lt;map&gt; tag
- */
- public static final Tag MAP = new Tag("map");
-
- /**
- * The &lt;menu&gt; tag , breaks flow, block tag.
- */
- public static final Tag MENU = new Tag("menu", BREAKS | BLOCK);
-
- /**
- * The &lt;meta&gt; tag
- */
- public static final Tag META = new Tag("meta");
-
- /**
- * The &lt;nobr&gt; tag
- */
- public static final Tag NOBR = new Tag("nobr");
-
- /**
- * The &lt;noframes&gt; tag , breaks flow, block tag.
- */
- public static final Tag NOFRAMES = new Tag("noframes", BREAKS | BLOCK);
-
- /**
- * The &lt;object&gt; tag
- */
- public static final Tag OBJECT = new Tag("object");
-
- /**
- * The &lt;ol&gt; tag , breaks flow, block tag.
- */
- public static final Tag OL = new Tag("ol", BREAKS | BLOCK);
-
- /**
- * The &lt;option&gt; tag
- */
- public static final Tag OPTION = new Tag("option");
-
- /**
- * The &lt;p&gt; tag , breaks flow, block tag.
- */
- public static final Tag P = new Tag("p", BREAKS | BLOCK);
-
- /**
- * The &lt;param&gt; tag
- */
- public static final Tag PARAM = new Tag("param");
-
- /**
- * The &lt;pre&gt; tag , breaks flow, block tag, preformatted.
- */
- public static final Tag PRE = new Tag("pre", BREAKS | BLOCK | PREFORMATTED);
-
- /**
- * The &lt;s&gt; tag
- */
- public static final Tag S = new Tag("s");
-
- /**
- * The &lt;samp&gt; tag
- */
- public static final Tag SAMP = new Tag("samp");
-
- /**
- * The &lt;script&gt; tag
- */
- public static final Tag SCRIPT = new Tag("script");
-
- /**
- * The &lt;select&gt; tag
- */
- public static final Tag SELECT = new Tag("select");
-
- /**
- * The &lt;small&gt; tag
- */
- public static final Tag SMALL = new Tag("small");
-
- /**
- * The &lt;span&gt; tag
- */
- public static final Tag SPAN = new Tag("span");
-
- /**
- * The &lt;strike&gt; tag
- */
- public static final Tag STRIKE = new Tag("strike");
-
- /**
- * The &lt;strong&gt; tag
- */
- public static final Tag STRONG = new Tag("strong");
-
- /**
- * The &lt;style&gt; tag
- */
- public static final Tag STYLE = new Tag("style");
-
- /**
- * The &lt;sub&gt; tag
- */
- public static final Tag SUB = new Tag("sub");
-
- /**
- * The &lt;sup&gt; tag
- */
- public static final Tag SUP = new Tag("sup");
-
- /**
- * The &lt;table&gt; tag , block tag.
- */
- public static final Tag TABLE = new Tag("table", BLOCK);
-
- /**
- * The &lt;td&gt; tag , breaks flow, block tag.
- */
- public static final Tag TD = new Tag("td", BREAKS | BLOCK);
-
- /**
- * The &lt;textarea&gt; tag , preformatted.
- */
- public static final Tag TEXTAREA = new Tag("textarea", PREFORMATTED);
-
- /**
- * The &lt;th&gt; tag , breaks flow, block tag.
- */
- public static final Tag TH = new Tag("th", BREAKS | BLOCK);
-
- /**
- * The &lt;title&gt; tag , breaks flow, block tag.
- */
- public static final Tag TITLE = new Tag("title", BREAKS | BLOCK);
-
- /**
- * The &lt;tr&gt; tag , block tag.
- */
- public static final Tag TR = new Tag("tr", BLOCK);
-
- /**
- * The &lt;tt&gt; tag
- */
- public static final Tag TT = new Tag("tt");
-
- /**
- * The &lt;u&gt; tag
- */
- public static final Tag U = new Tag("u");
-
- /**
- * The &lt;ul&gt; tag , breaks flow, block tag.
- */
- public static final Tag UL = new Tag("ul", BREAKS | BLOCK);
-
- /**
- * The &lt;var&gt; tag
- */
- public static final Tag VAR = new Tag("var");
-
- /* Special tags */
-
- /**
- * Total number of syntetic tags, delared in the Tag class.
- * This must be adjusted if the new synthetic tags are declared.
- * Otherwise the HTML.getAllTags() will not work as expected.
- */
- private static final int TOTAL_SYNTHETIC_TAGS = 3;
-
- /**
- * All comments are labeled with this tag.
- * This tag is not included into the array, returned by getAllTags().
- * toString() returns 'comment'. HTML reader synthesizes this tag.
- */
- public static final Tag COMMENT = new Tag("comment", SYNTETIC);
-
- /**
- * All text content is labeled with this tag.
- * This tag is not included into the array, returned by getAllTags().
- * toString() returns 'content'. HTML reader synthesizes this tag.
- */
- public static final Tag CONTENT = new Tag("content", SYNTETIC);
-
- /**
- * All text content must be in a paragraph element.
- * If a paragraph didn't exist when content was encountered,
- * a paragraph is manufactured.
- * toString() returns 'implied'. HTML reader synthesizes this tag.
- */
- public static final Tag IMPLIED = new Tag("implied", SYNTETIC);
- final String name;
- final int flags;
-
- /**
- * Creates a new Tag with the specified id, and with causesBreak
- * and isBlock set to false.
- */
- protected Tag(String id)
- {
- name = id;
- flags = 0;
- }
-
- /**
- * Creates a new Tag with the specified tag name and
- * causesBreak and isBlock properties.
- */
- protected Tag(String id, boolean causesBreak, boolean isBlock)
- {
- int f = 0;
-
- if (causesBreak)
- {
- f |= BREAKS;
- }
-
- if (isBlock)
- {
- f |= BLOCK;
- }
-
- flags = f;
- name = id;
- }
-
- /**
- * Create a tag taking flags.
- */
- Tag(String id, int a_flags)
- {
- name = id;
- flags = a_flags;
- }
-
- /**
- * Returns true if this tag is a block tag, which is a tag used to
- * add structure to a document.
- */
- public boolean isBlock()
- {
- return (flags & BLOCK) != 0;
- }
-
- /**
- * Returns true if this tag is pre-formatted, which is true if
- * the tag is either PRE or TEXTAREA
- */
- public boolean isPreformatted()
- {
- return (flags & PREFORMATTED) != 0;
- }
-
- /**
- * Returns true if this tag causes a line break to the flow of text
- */
- public boolean breaksFlow()
- {
- return (flags & BREAKS) != 0;
- }
-
- /**
- * Calls compareTo on the tag names (Strings)
- */
- public int compareTo(Object other)
- {
- return name.compareTo(((Tag) other).name);
- }
-
- /**
- * The tags are equal if the names are equal (ignoring case).
- */
- public boolean equals(Object other)
- {
- if (other == this)
- {
- return true;
- }
-
- if (!(other instanceof Tag))
- {
- return false;
- }
-
- Tag that = (Tag) other;
-
- return that.name.equalsIgnoreCase(name);
- }
-
- /**
- * Returns the hash code which corresponds to the string for this tag.
- */
- public int hashCode()
- {
- return name == null ? 0 : name.hashCode();
- }
-
- /**
- * Returns the tag name. The names of the built-in tags are always
- * returned in lowercase.
- */
- public String toString()
- {
- return name;
- }
-
- /**
- * Return an array of HTML tags, declared in HTML.Tag class.
- * WARNING: This method expects that the Tags are the only
- * public fields declared in the Tag class.
- */
- static Tag[] getAllTags()
- {
- Field[] f = Tag.class.getFields();
- Field x;
-
- // The syntetic tags are not included.
- Tag[] tags = new Tag[ f.length - TOTAL_SYNTHETIC_TAGS ];
- int p = 0;
- Tag t;
-
- for (int i = 0; i < f.length; i++)
- {
- x = f [ i ];
-
- if ((x.getModifiers() & Modifier.STATIC) != 0)
- {
- if (x.getType().equals(Tag.class))
- {
- try
- {
- t = (Tag) x.get(null);
-
- if (!t.isSyntetic())
- {
- tags [ p++ ] = t;
- }
- }
- catch (IllegalAccessException ex)
- {
- unexpected(ex);
- }
- catch (IllegalArgumentException ex)
- {
- unexpected(ex);
- }
- }
- }
- }
-
- return tags;
- }
-
- /**
- * Returns true for tags, generated by the html reader
- * (COMMENT, CONTENT and IMPLIED).
- */
- boolean isSyntetic()
- {
- return (flags & SYNTETIC) != 0;
- }
-
- private static void unexpected(Exception ex)
- throws Error
- {
- throw new Error("This should never happen, report a bug", ex);
- }
- }
-
- /**
- * Represents an unknown HTML tag.
- * @author Mark Wielaard (mark@klomp.org)
- */
- public static class UnknownTag
- extends Tag
- implements Serializable
- {
- private static final long serialVersionUID = -1534369342247250625L;
-
- /**
- * Creates a new UnknownTag with the specified name
- * @param name The tag name.
- *
- */
- public UnknownTag(String name)
- {
- super(name);
- }
- }
-
- /**
- * This value is returned for attributes without value that have no
- * default value defined in the DTD.
- */
- public static final String NULL_ATTRIBUTE_VALUE = "#DEFAULT";
-
- /* Package level html tag flags */
- static final int BREAKS = 1;
- static final int BLOCK = 2;
- static final int PREFORMATTED = 4;
- static final int SYNTETIC = 8;
- private static Map tagMap;
- private static Map attrMap;
-
- /**
- * The public constructor (does nothing). It it seldom required to have
- * an instance of this class, because all public fields and methods
- * are static.
- */
- public HTML()
- {
- }
-
- /**
- * Returns the set of the recognized HTML attributes.
- */
- public static HTML.Attribute[] getAllAttributeKeys()
- {
- return Attribute.getAllAttributes();
- }
-
- /**
- * Returns the set of actual HTML tags that are recognized by
- * the default HTML reader. The returned array does not include the
- * COMMENT, CONTENT and IMPLIED tags.
- */
- public static HTML.Tag[] getAllTags()
- {
- return Tag.getAllTags();
- }
-
- /**
- * Returns an htl attribute constant for the given attribute name.
- * @param attName the attribute name, case insensitive
- */
- public static Attribute getAttributeKey(String attName)
- {
- if (attrMap == null)
- {
- // Create the map on demand.
- attrMap = new TreeMap();
-
- Attribute[] attrs = getAllAttributeKeys();
-
- for (int i = 0; i < attrs.length; i++)
- {
- attrMap.put(attrs [ i ].toString(), attrs [ i ]);
- }
- }
-
- return (Attribute) attrMap.get(attName.toLowerCase());
- }
-
- /**
- * Searches the value of given attribute in the provided set.
- * If the value is found (String type expected), tries to parse it as
- * an integer value. If succeded, returns the obtained integer value.
- *
- * For example:<p><code>
- * SimpleAttributeSet ase = new SimpleAttributeSet();
- * ase.addAttribute(HTML.getAttributeKey("size"),"222");
- * System.out.println(
- * HTML.getIntegerAttributeValue
- * (ase, HTML.getAttributeKey("size"), 333)); // prints "222"
- * System.out.println(
- * HTML.getIntegerAttributeValue
- * (ase, HTML.getAttributeKey("width"), 333)); // prints "333".
- * </code></p>
- *
- *
- * @param set The attribute set to search in. If the set contains the
- * given attribute, it must by a type of String.
- * @param attribute The html attribute to search in
- * @param defaultValue The value that is returned if the attribute is not
- * found in the given set or if the NumberFormatException was thrown
- * during the parsing.
- */
- public static int getIntegerAttributeValue(AttributeSet set,
- HTML.Attribute attribute,
- int defaultValue
- )
- {
- Object v = set.getAttribute(attribute);
-
- if (v == null)
- {
- return defaultValue;
- }
-
- try
- {
- return Integer.parseInt(v.toString().trim());
- }
- catch (Exception ex)
- {
- return defaultValue;
- }
- }
-
- /**
- * Returns a HTML tag constant for the given HTML attribute name.
- * If the tag is unknown, the null is returned.
- * @param tagName the tag name, case insensitive
- */
- public static Tag getTag(String tagName)
- {
- if (tagMap == null)
- {
- // Create the mao on demand.
- tagMap = new TreeMap();
-
- Tag[] tags = getAllTags();
-
- for (int i = 0; i < tags.length; i++)
- {
- tagMap.put(tags [ i ].toString(), tags [ i ]);
- }
- }
-
- return (Tag) tagMap.get(tagName.toLowerCase());
- }
-}
diff --git a/libjava/javax/swing/text/html/HTMLDocument.java b/libjava/javax/swing/text/html/HTMLDocument.java
deleted file mode 100644
index a95e496ec4d..00000000000
--- a/libjava/javax/swing/text/html/HTMLDocument.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* HTMLDocument.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html;
-
-import javax.swing.text.DefaultStyledDocument;
-
-/**
- * TODO: This class is not yet completetely implemented.
- *
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class HTMLDocument extends DefaultStyledDocument
-{
- public void processHTMLFrameHyperlinkEvent(HTMLFrameHyperlinkEvent event)
- {
- }
-}
diff --git a/libjava/javax/swing/text/html/HTMLEditorKit.java b/libjava/javax/swing/text/html/HTMLEditorKit.java
deleted file mode 100755
index d1fcdb58b2a..00000000000
--- a/libjava/javax/swing/text/html/HTMLEditorKit.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/* HTMLEditorKit.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html;
-
-import java.io.Reader;
-
-import javax.swing.text.BadLocationException;
-import javax.swing.text.MutableAttributeSet;
-
-/**
- * This class is NOT implemented. This file currently holds only
- * declarations of the two enclosing classes, necessary for testing
- * the implemented javax.swing.text.html.parser package.
- * @author No authorship is taken, implement the class and be!
- * TODO: replace this header after implementing the class.
- */
-public class HTMLEditorKit
-{
- /**
- * The abstract HTML parser declaration.
- */
- public abstract static class Parser
- {
- /**
- * Parse the HTML text, calling various methods of the provided callback
- * in response to the occurence of the corresponding HTML constructions.
- * @param reader The reader to read the source HTML from.
- * @param callback The callback to receive information about the parsed
- * HTML structures
- * @param ignoreCharSet If true, the parser ignores all charset information
- * that may be present in HTML documents.
- * @throws IOException, normally if the reader throws one.
- */
- public abstract void parse(Reader reader, ParserCallback callback,
- boolean ignoreCharSet
- )
- throws java.io.IOException;
- }
-
- /**
- * The "hook" that receives all information about the HTML document
- * structure while parsing it. The methods are invoked by parser
- * and should be normally overridden.
- */
- public static class ParserCallback
- {
- /**
- * If the tag does not occurs in the html stream directly, but
- * is supposed by parser, the tag attribute set contains this additional
- * attribute, having value Boolean.True.
- */
- public static final Object IMPLIED = "_implied_";
-
- /**
- * The parser calls this method after it finishes parsing the document.
- */
- public void flush()
- throws BadLocationException
- {
- }
-
- /**
- * Handle HTML comment, present in the given position.
- * @param comment the comment
- * @position the position of the comment in the text being parsed.
- */
- public void handleComment(char[] comment, int position)
- {
- }
-
- /**
- * Notifies about the character sequences, used to separate lines in
- * this document. The parser calls this method after it finishes
- * parsing the document, but before flush().
- * @param end_of_line The "end of line sequence", one of: \r or \n or \r\n.
- */
- public void handleEndOfLineString(String end_of_line)
- {
- }
-
- /**
- * The method is called when the HTML closing tag ((like &lt;/table&gt;)
- * is found or if the parser concludes that the one should be present
- * in the current position.
- * @param The tag being handled
- * @position the tag position in the text being parsed.
- */
- public void handleEndTag(HTML.Tag tag, int position)
- {
- }
-
- /**
- * Handle the error.
- * @param message The message, explaining the error.
- * @param position The starting position of the fragment that has caused
- * the error in the html document being parsed.
- */
- public void handleError(String message, int position)
- {
- }
-
- /**
- * Handle the tag with no content, like &lt;br&gt;. The method is
- * called for the elements that, in accordance with the current DTD,
- * has an empty content.
- * @param tag The tag being handled.
- * @param position The tag position in the text being parsed.
- */
- public void handleSimpleTag(HTML.Tag tag, MutableAttributeSet attributes,
- int position
- )
- {
- }
-
- /**
- * The method is called when the HTML opening tag ((like &lt;table&gt;)
- * is found or if the parser concludes that the one should be present
- * in the current position.
- * @param tag The tag being handled
- * @param position The tag position in the text bein parsed
- */
- public void handleStartTag(HTML.Tag tag, MutableAttributeSet attributes,
- int position
- )
- {
- }
-
- /**
- * Handle the text section.
- * @param text A section text.
- * @param position The text position in the HTML document text being parsed.
- */
- public void handleText(char[] text, int position)
- {
- }
- }
-}
diff --git a/libjava/javax/swing/text/html/HTMLFrameHyperlinkEvent.java b/libjava/javax/swing/text/html/HTMLFrameHyperlinkEvent.java
deleted file mode 100644
index dc0ab10a8f7..00000000000
--- a/libjava/javax/swing/text/html/HTMLFrameHyperlinkEvent.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/* HTMLFrameHyperlinkEvent.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html;
-
-import java.net.URL;
-
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkEvent.EventType;
-import javax.swing.text.Element;
-
-/**
- * HTMLFrameHyperlinkEvent transfers information about the link that was
- * activated in a frame.
- *
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class HTMLFrameHyperlinkEvent
- extends HyperlinkEvent
-{
- private final String target_frame;
-
- /**
- * Creates a new hypertext link event.
- *
- * @param source The object this link is associated to.
- * @param type The type of event.
- * @param url The URL this link pointing too.
- * @param element The element in the document representing the anchor.
- * @param frame - the Frame to display the document in.
- */
- public HTMLFrameHyperlinkEvent(Object source, EventType type, URL url,
- Element element, String frame)
- {
- super(source, type, url, frame, element);
- target_frame = frame;
- }
-
- /**
- * Creates a new hypertext link event.
- *
- * @param source The object this link is associated to.
- * @param type The type of event.
- * @param url The URL this link pointing too.
- * @param frame - the Frame to display the document in.
- */
- public HTMLFrameHyperlinkEvent(Object source, EventType type, URL url,
- String frame)
- {
- super(source, type, url, frame);
- target_frame = frame;
- }
-
- /**
- * Creates a new hypertext link event.
- *
- * @param source The object this link is associated to.
- * @param type The type of event.
- * @param url The URL this link pointing too.
- * @param description The description for this link.
- * @param element The element in the document representing the anchor.
- * @param frame - the Frame to display the document in.
- */
- public HTMLFrameHyperlinkEvent(Object source, EventType type, URL url,
- String description, Element element,
- String frame)
- {
- super(source, type, url, description, element);
- target_frame = frame;
- }
-
- /**
- * Creates a new hypertext link event.
- *
- * @param source The object this link is associated to.
- * @param type The type of event.
- * @param url The URL this link pointing too.
- * @param description The description for this link.
- * @param frame - the Frame to display the document in.
- */
- public HTMLFrameHyperlinkEvent(Object source, EventType type, URL url,
- String description, String frame)
- {
- super(source, type, url, description);
- target_frame = frame;
- }
-
- /**
- * Gets the string, passed as the target frame identifier.
- *
- * @return the target for the link.
- */
- public String getTarget()
- {
- return target_frame;
- }
-}
diff --git a/libjava/javax/swing/text/html/parser/AttributeList.java b/libjava/javax/swing/text/html/parser/AttributeList.java
deleted file mode 100755
index 5bca0bfa7db..00000000000
--- a/libjava/javax/swing/text/html/parser/AttributeList.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/* AttributeList.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html.parser;
-
-import gnu.javax.swing.text.html.parser.support.gnuStringIntMapper;
-
-import java.io.Serializable;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-/**
- * <p>
- * Stores the attribute information, obtained by parsing SGML (DTD) tag
- * <code>&lt;!ATTLIST .. &gt;</code></p>
- * <p>
- * Elements can have a associated named properties (attributes) having the
- * assigned values. The element start tag can have any number of attribute
- * value pairs, separated by spaces. They can appear in any order.
- * SGML requires you to delimit the attribute values using either double (")
- * or single (') quotation marks. In HTML, it is possible
- * (but not recommended) to specify the value of an attribute without
- * quotation marks. Such attribute value may only contain
- * letters, digits, hyphens (-) and periods (.) .
- * </p>
- * <p>
- * The <code>AttributeList</code> defines a single attribute that additionally
- * has a pointer referencing the possible subsequent attribute.
- * The whole structure is just a simple linked list, storing all attributes of
- * some <code>Element</code>.
- * Use the <code>getNext()</code> method repeatedly to see all attributes in
- * the list.
- * </p>
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public final class AttributeList
- implements DTDConstants, Serializable
-{
- /** Maps between type names and they string values. */
- private static final gnuStringIntMapper mapper =
- new gnuStringIntMapper()
- {
- protected void create()
- {
- add("CDATA", DTDConstants.CDATA);
- add("ENTITY", DTDConstants.ENTITY);
- add("ENTITIES", DTDConstants.ENTITIES);
- add("ID", DTDConstants.ID);
- add("IDREF", DTDConstants.IDREF);
- add("IDREFS", DTDConstants.IDREFS);
- add("NAME", DTDConstants.NAME);
- add("NAMES", DTDConstants.NAMES);
- add("NMTOKEN", DTDConstants.NMTOKEN);
- add("NMTOKENS", DTDConstants.NMTOKENS);
- add("NOTATION", DTDConstants.NOTATION);
- add("NUMBER", DTDConstants.NUMBER);
- add("NUMBERS", DTDConstants.NUMBERS);
- add("NUTOKEN", DTDConstants.NUTOKEN);
- add("NUTOKENS", DTDConstants.NUTOKENS);
- }
- };
-
- /** Use serialVersionUID for interoperability. */
- private static final long serialVersionUID = -1361214058742015233L;
-
- /**
- * The value of ( = pointer to ) the next attribute in the linked list,
- * storing all attributes of some Element. Contains null for the
- * last attribute.
- */
- public AttributeList next;
-
- /**
- * The name of the attribute. The attribute names are case insensitive.
- */
- public String name;
-
- /**
- * The default value of this attribute. Equals to null if no default value
- * is specified.
- */
- public String value;
-
- /**
- * The explicit set of the allowed values of this attribute. Equals to
- * null, if this parameter was not specified.
- * Values, defined in DTD, are case insensitive.
- */
- public Vector values;
-
- /**
- * The modifier of this attribute. This field contains one of the
- * following DTD constants:
- * <ul>
- * <li> REQUIRED if the attribute value is always required,</li>
- * <li> IMPLIED if the user agent must supply the default value itself,</li>
- * <li> FIXED if the attribute value is fixed to some value and cannot
- * be changed.</li>
- * <li> DEFAULT if the attribute default value has been supplied.</li>
- * <li> CURRENT the value that at any point in the document is
- * the last value supplied for that element. A value is required to be
- * supplied for the first* occurrence of an element</li>
- * <li> CONREF specifies the IDREF value of
- * the reference to content in another location of the document.
- * The element with this attribute is empty, the content from
- * that another location must be used instead.</li>
- * </ul>
- */
- public int modifier;
-
- /**
- * The type of the attribute. The possible values of this field
- * (NUMBER, NAME, ID, CDATA and so on) are defined in DTDConstants.
- */
- public int type;
-
- /**
- * Creates the attribute with the given name, initializing other fields
- * to the default values ( 0 and null ).
- *
- * @param a_name The name of the attribute.
- */
- public AttributeList(String a_name)
- {
- name = a_name;
- }
-
- /**
- * Creates the attribute with the given properties.
- * @param a_name The name of the attribute
- * @param a_type The type of the attribute. The possible values are defined
- * in <code> DTDConstants</code>.
- * @param a_modifier The modifier of this attribute. The possible values
- * are defined in <code> DTDConstants</code>.
- * @param a_default The default value of this attribute
- * @param allowed_values The explicit set of the allowed values of
- * this attribute
- * @param a_next The value of the subsequent instance of the AttributeList,
- * representing the next attribute definition for the same element.
- * Equals to null for the last attribute definition.
- */
- public AttributeList(String a_name, int a_type, int a_modifier,
- String a_default, Vector allowed_values,
- AttributeList a_next
- )
- {
- this(a_name);
- type = a_type;
- modifier = a_modifier;
- value = a_default;
- values = allowed_values;
- next = a_next;
- }
-
- /**
- * Get the modifier of this attribute. This field contains one of the
- * following DTD constants:
- * <ul>
- * <li> REQUIRED if the attribute value is always required,</li>
- * <li> IMPLIED if the user agent must supply the default value itself,</li>
- * <li> FIXED if the attribute value is fixed to some value and cannot
- * be changed.</li>
- * <li> DEFAULT if the attribute default value has been supplied.</li>
- * <li> CURRENT the value that at any point in the document is
- * the last value supplied for that element. A value is required to be
- * supplied for the first* occurrence of an element</li>
- * <li> CONREF specifies the IDREF value of
- * the reference to content in another location of the document.
- * The element with this attribute is empty, the content from
- * that another location must be used instead.</li>
- * </ul>
- */
- public int getModifier()
- {
- return modifier;
- }
-
- /**
- * Get the name of the attribute.
- * The value is returned as it was supplied to a
- * constructor, preserving the character case.
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Get the value of ( = pointer to ) the next attribute in the linked list,
- * storing all attributes of some Element. Contains null for the
- * last attribute.
- */
- public AttributeList getNext()
- {
- return next;
- }
-
- /**
- * Get the type of the attribute. The possible values of this field
- * (NUMBER, NAME, ID, CDATA and so on) are defined in DTDConstants.
- */
- public int getType()
- {
- return type;
- }
-
- /**
- * Get the default value of this attribute.
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Get the allowed values of this attribute.
- */
- public Enumeration getValues()
- {
- return values.elements();
- }
-
- /**
- * Converts a string value, representing a valid SGLM attribute type,
- * into the corresponding value, defined in DTDConstants.
- * @param typeName the name of the type (character case is ignored).
- * @return a value from DTDConstants or DTDConstants.ANY if the
- * string is not representing a known type. The known attribute types
- * in this implementation are CDATA, ENTITY, ENTITIES, ID, IDREF, IDREFS,
- * NAME, NAMES, NMTOKEN, NMTOKENS, NOTATION, NUMBER, NUMBERS, NUTOKEN and
- * NUTOKENS.
- * @throws NullPointerException if the passed parameter is null.
- */
- public static int name2type(String typeName)
- {
- return mapper.get(typeName.toUpperCase());
- }
-
- /**
- * Returns the attribute name.
- */
- public String toString()
- {
- return name;
- }
-
- /**
- * Converts a value from DTDConstants into the string representation.
- * @param type - an integer value of the public static integer field,
- * defined in the DTDConstants class.
- * @return a corresponding SGML DTD keyword (UPPERCASE) or null if there
- * are no attribute type constant having the given value.
- */
- public static String type2name(int type)
- {
- return mapper.get(type);
- }
-}
diff --git a/libjava/javax/swing/text/html/parser/ContentModel.java b/libjava/javax/swing/text/html/parser/ContentModel.java
deleted file mode 100755
index deb7b1602bb..00000000000
--- a/libjava/javax/swing/text/html/parser/ContentModel.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/* ContentModel.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html.parser;
-
-import gnu.javax.swing.text.html.parser.models.transformer;
-
-import java.io.Serializable;
-
-import java.util.Vector;
-
-/**
- * A representation of the element content. The instances of this class
- * can be arranged into the linked list, representing a BNF expression.
- * The content model is constructed as a branched tree structure in the
- * following way:
- * <pre>
- * a = new ContentModel('+', A, null); // a reprensents A+
- * b = new ContentModel('&amp;', B, a); // b represents B &amp; A+
- * c = new ContentModel('*', b, null); // c represents ( B &amp; A+) *
- * d = new ContentModel('|', new ContentModel('*', A, null),
- * new ContentModel('?', B, null)); // d represents ( A* | B? )
- * </pre>
- * where the valid operations are:
- * <ul>
- * <li><code>E* </code> E occurs zero or more times</li>
- * <li><code>E+ </code> E occurs one or more times</li>
- * <li><code>E? </code> E occurs once or not atl all</li>
- * <li><code>A,B</code> A occurs before B</li>
- * <li><code>A|B</code> both A and B are permitted in any order.
- * The '|' alone does not permit the repetetive occurence of A or B
- * (use <code>(A|B)*</code>.</li>
- * <li><code>A&amp;B</code> both A and B must occur once (in any order)</li>
- * </ul>
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public final class ContentModel
- implements Serializable
-{
- /** Use serialVersionUID for interoperability. */
- private static final long serialVersionUID = -1130825523866321257L;
-
- /**
- * The next content model model ( = pointer to the next element of
- * the linked list) for the binary expression (',','&amp;' or '|'). Null
- * for the last element in the list.
- */
- public ContentModel next;
-
- /**
- * The document content, containing either Element or the enclosed
- * content model (that would be in the parentheses in BNF expression).
- */
- public Object content;
-
- /**
- * Specifies the BNF operation between this node and the node,
- * stored in the field <code>next</code> (or for this node, if it is
- * an unary operation.
- */
- public int type;
-
- /** Create a content model initializing all fields to default values. */
- public ContentModel()
- {
- }
-
- /**
- * Create a content model, consisting of the single element.
- * Examples:
- *<code>
- * a = new ContentModel('+', A, null); // a reprensents A+
- * b = new ContentModel('&amp;', B, a); // b represents B &amp; A+
- * c = new ContentModel('*', b, null); // c represents ( B &amp; A+) *
- * d = new ContentModel('|', A,
- * new ContentModel('?',b, null);
- * // d represents
- * </code>
- */
- public ContentModel(Element a_content)
- {
- content = a_content;
- }
-
- /**
- * Create a content model, involving expression of the given type.
- * @param a_type The expression operation type ('*','?' or '+'
- * @param a_content The content for that the expression is applied.
- */
- public ContentModel(int a_type, ContentModel a_content)
- {
- content = a_content;
- type = a_type;
- }
-
- /**
- * Create a content model, involving binary expression of the given type.
- * @param a_type The expression operation type ( ',', '|' or '&amp;').
- * @param a_content The content of the left part of the expression.
- * @param a_next The content model, representing the right part of the
- * expression.
- */
- public ContentModel(int a_type, Object a_content, ContentModel a_next)
- {
- content = a_content;
- type = a_type;
- next = a_next;
- }
-
- /**
- * Adds all list elements to the given vector, ignoring the
- * operations between the elements. The old vector values are not
- * discarded.
- * @param elements - a vector to add the values to.
- */
- public void getElements(Vector elements)
- {
- ContentModel c = this;
-
- while (c != null)
- {
- elements.add(c.content);
- c = c.next;
- }
- }
-
- /**
- * Checks if the content model matches an empty input stream.
- * The empty content is created using SGML DTD keyword EMPTY.
- * The empty model is a model with the content field equal to null.
- *
- * @return true if the content field is equal to null.
- */
- public boolean empty()
- {
- return content == null;
- }
-
- /**
- * Get the element, stored in the <code>next.content</code>.
- * The method is programmed as the part of the standard API, but not
- * used in this implementation.
- * @return the value of the field <code>next</code>.
- */
- public Element first()
- {
- return (Element) next.content;
- }
-
- /**
- * Checks if this object can potentially be the first token in the
- * ContenModel list. The method is programmed as the part of the
- * standard API, but not used in this implementation.
- */
- public boolean first(Object token)
- {
- ContentModel c = this;
- while (c.next != null)
- {
- if (c.content != null && c.content.toString().equals(token.toString()) &&
- c.type != ','
- )
-
- // Agree if the operation with the preceeding element
- // is not the comma operation.
- return true;
- c = c.next;
- }
- return false;
- }
-
- /**
- * Returns a string representation (an expression) of this content model.
- * The expression has BNF-like syntax, except the absence of the
- * unary operator is additionally indicated by " ' ". It is
- * advisable to check the created models for correctness using this
- * method.
- */
- public String toString()
- {
- return transformer.transform(this).toString();
- }
-}
diff --git a/libjava/javax/swing/text/html/parser/DTD.java b/libjava/javax/swing/text/html/parser/DTD.java
deleted file mode 100755
index 63d03eaccf0..00000000000
--- a/libjava/javax/swing/text/html/parser/DTD.java
+++ /dev/null
@@ -1,607 +0,0 @@
-/* DTD.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html.parser;
-
-import java.io.DataInputStream;
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.BitSet;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-/**
- * <p>Representation or the SGML DTD document.
- * Provides basis for describing a syntax of the
- * HTML documents. The fields of this class are NOT initialized in
- * constructor. You need to do this separately before passing this data
- * structure to the HTML parser. The subclasses with the fields, pre-
- * initialized, for example, for HTML 4.01, can be available only between
- * the implementation specific classes
- * ( for example, {@link gnu.javax.swing.text.html.parser.HTML_401F }
- * in this implementation).</p>
- * <p>
- * If you need more information about SGML DTD documents,
- * the author suggests to read SGML tutorial on
- * {@link http://www.w3.org/TR/WD-html40-970708/intro/sgmltut.html}.
- * We also recommend Goldfarb C.F (1991) <i>The SGML Handbook</i>,
- * Oxford University Press, 688 p, ISBN: 0198537379.
- * </p>
- * <p>
- * Warning: the html, head and other tag fields will only be automatically
- * assigned if the VM has the correctly implemented reflection mechanism.
- * As these fields are not used anywhere in the implementation, not
- * exception will be thrown in the opposite case.
- * </p>
- *
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class DTD
- implements DTDConstants
-{
- /**
- * The version of the persistent data format.
- */
- public static int FILE_VERSION = 1;
-
- /**
- * The table of existing available DTDs.
- */
- static Hashtable dtdHash = new Hashtable();
-
- /**
- * The applet element for this DTD.
- */
- public Element applet;
-
- /**
- * The base element for this DTD.
- */
- public Element base;
-
- /**
- * The body element for this DTD.
- */
- public Element body;
-
- /**
- * The head element for this DTD.
- */
- public Element head;
-
- /**
- * The html element for this DTD.
- */
- public Element html;
-
- /**
- * The isindex element of for this DTD.
- */
- public Element isindex;
-
- /**
- * The meta element for this DTD.
- */
- public Element meta;
-
- /**
- * The p element for this DTD.
- */
- public Element p;
-
- /**
- * The param element for this DTD.
- */
- public Element param;
-
- /**
- * The pcdata for this DTD.
- */
- public Element pcdata;
-
- /**
- * The title element for this DTD.
- */
- public Element title;
-
- /**
- * The element for accessing all DTD elements by name.
- */
- public Hashtable elementHash = new Hashtable();
-
- /**
- * The entity table for accessing all DTD entities by name.
- */
- public Hashtable entityHash = new Hashtable();
-
- /**
- * The name of this DTD.
- */
- public String name;
-
- /**
- * Contains all elements in this DTD. The
- * javax.swing.text.html.parser.Element#index field of all elements
- * in this vector is set to the element position in this vector.
- */
- public Vector elements = new Vector();
-
- /** Create a new DTD with the specified name. */
- protected DTD(String a_name)
- {
- name = a_name;
- }
-
- /** Get this DTD by name. The current implementation
- * only looks in the internal table of DTD documents. If no corresponding
- * entry is found, the new entry is created, placed into
- * the table and returned. */
- public static DTD getDTD(String name)
- throws IOException
- {
- DTD d = (DTD) dtdHash.get(name);
-
- if (d == null)
- {
- d = new DTD(name);
- dtdHash.put(d.name, d);
- }
-
- return d;
- }
-
- /**
- * Get the element by the element name. If the element is not yet
- * defined, it is newly created and placed into the element table.
- * If the element name matches (ingoring case) a public non static
- * element field in this class, this field is assigned to the value
- * of the newly created element.
- */
- public Element getElement(String element_name)
- {
- return newElement(element_name);
- }
-
- /**
- * Get the element by the value of its
- * {@link javax.swing.text.html.parser.Element#index} field.
- */
- public Element getElement(int index)
- {
- return (Element) elements.get(index);
- }
-
- /**
- * Get the entity with the given identifier.
- * @param id that can be returned by
- * {@link javax.swing.text.html.parser.Entity#name2type(String an_entity)}
- * @return The entity from this DTD or null if there is no entity with
- * such id or such entity is not present in the table of this instance.
- */
- public Entity getEntity(int id)
- {
- String name = Entity.mapper.get(id);
-
- if (name != null)
- return (Entity) entityHash.get(name);
- else
- return null;
- }
-
- /**
- * Get the named entity by its name.
- */
- public Entity getEntity(String entity_name)
- {
- return (Entity) entityHash.get(entity_name);
- }
-
- /**
- * Get the name of this instance of DTD
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Creates, adds into the entity table and returns the
- * character entity like <code>&amp;lt;</code>
- * (means '<code>&lt;</code>' );
- * @param name The entity name (without heading &amp; and closing ;)
- * @param type The entity type
- * @param character The entity value (single character)
- * @return The created entity
- */
- public Entity defEntity(String name, int type, int character)
- {
- Entity e = newEntity(name, type);
- e.data = new char[] { (char) character };
- return e;
- }
-
- /**
- * Define the attributes for the element with the given name.
- * If the element is not exist, it is created.
- * @param forElement
- * @param attributes
- */
- public void defineAttributes(String forElement, AttributeList attributes)
- {
- Element e = (Element) elementHash.get(forElement.toLowerCase());
-
- if (e == null)
- e = newElement(forElement);
-
- e.atts = attributes;
- }
-
- /**
- * Defines the element and adds it to the element table. Sets the
- * <code>Element.index</code> field to the value, unique for this
- * instance of DTD. If the element with the given name already exists,
- * replaces all other its settings by the method argument values.
- * @param name the name of the element
- * @param type the type of the element
- * @param headless true if the element needs no starting tag
- * (should not occur in HTML).
- * @param tailless true if the element needs no ending tag (like
- * <code>&lt;hr&gt;</code>
- * @param content the element content
- * @param exclusions the set of elements that must not occur inside
- * this element. The <code>Element.index</code> value defines which
- * bit in this bitset corresponds to that element.
- * @param inclusions the set of elements that can occur inside this
- * element. the <code>Element.index</code> value defines which
- * bit in this bitset corresponds to that element.
- * @param attributes the element attributes.
- * @return the newly defined element.
- */
- public Element defineElement(String name, int type, boolean headless,
- boolean tailless, ContentModel content,
- BitSet exclusions, BitSet inclusions,
- AttributeList attributes
- )
- {
- Element e = newElement(name);
- e.type = type;
- e.oStart = headless;
- e.oEnd = tailless;
- e.content = content;
- e.exclusions = exclusions;
- e.inclusions = inclusions;
- e.atts = attributes;
-
- return e;
- }
-
- /**
- * Creates, intializes and adds to the entity table the new
- * entity.
- * @param name the name of the entity
- * @param type the type of the entity
- * @param data the data section of the entity
- * @return the created entity
- */
- public Entity defineEntity(String name, int type, char[] data)
- {
- Entity e = newEntity(name, type);
- e.data = data;
-
- return e;
- }
-
- /** Place this DTD into the DTD table. */
- public static void putDTDHash(String name, DTD dtd)
- {
- dtdHash.put(name, dtd);
- }
-
- /**
- * <p>Reads DTD from an archived format. This format is not standardized
- * and differs between implementations.</p><p> This implementation
- * reads and defines all entities and elements using
- * ObjectInputStream. The elements and entities can be written into the
- * stream in any order. The objects other than elements and entities
- * are ignored.</p>
- * @param stream A data stream to read from.
- * @throws java.io.IOException If one is thrown by the input stream
- */
- public void read(DataInputStream stream)
- throws java.io.IOException
- {
- ObjectInputStream oi = new ObjectInputStream(stream);
- Object def;
- try
- {
- while (true)
- {
- def = oi.readObject();
- if (def instanceof Element)
- {
- Element e = (Element) def;
- elementHash.put(e.name.toLowerCase(), e);
- assignField(e);
- }
- else if (def instanceof Entity)
- {
- Entity e = (Entity) def;
- entityHash.put(e.name, e);
- }
- }
- }
- catch (ClassNotFoundException ex)
- {
- throw new IOException(ex.getMessage());
- }
- catch (EOFException ex)
- {
- // ok EOF
- }
- }
-
- /**
- * Returns the name of this instance of DTD.
- */
- public String toString()
- {
- return name;
- }
-
- /**
- * Creates and returns new attribute (not an attribute list).
- * @param name the name of this attribute
- * @param type the type of this attribute (FIXED, IMPLIED or
- * REQUIRED from <code>DTDConstants</code>).
- * @param modifier the modifier of this attribute
- * @param default_value the default value of this attribute
- * @param allowed_values the allowed values of this attribute. The multiple
- * possible values in this parameter are supposed to be separated by
- * '|', same as in SGML DTD <code>&lt;!ATTLIST </code>tag. This parameter
- * can be null if no list of allowed values is specified.
- * @param atts the previous attribute of this element. This is
- * placed to the field
- * {@link javax.swing.text.html.parser.AttributeList#next },
- * creating a linked list.
- * @return
- */
- protected AttributeList defAttributeList(String name, int type, int modifier,
- String default_value,
- String allowed_values,
- AttributeList atts
- )
- {
- AttributeList al = new AttributeList(name);
- al.modifier = modifier;
- al.value = default_value;
- al.next = atts;
-
- if (allowed_values != null)
- {
- StringTokenizer st = new StringTokenizer(allowed_values, " \t|");
- Vector v = new Vector(st.countTokens());
-
- while (st.hasMoreTokens())
- v.add(st.nextToken());
-
- al.values = v;
- }
-
- return al;
- }
-
- /**
- * Creates a new content model.
- * @param type specifies the BNF operation for this content model.
- * The valid operations are documented in the
- * {@link javax.swing.text.html.parser.ContentModel#type }.
- * @param content the content of this content model
- * @param next if the content model is specified by BNF-like
- * expression, contains the rest of this expression.
- * @return The newly created content model.
- */
- protected ContentModel defContentModel(int type, Object content,
- ContentModel next
- )
- {
- ContentModel model = new ContentModel();
- model.type = type;
- model.next = next;
- model.content = content;
-
- return model;
- }
-
- /**
- * Defines a new element and adds it to the element table.
- * If the element alredy exists,
- * overrides it settings with the specified values.
- * @param name the name of the new element
- * @param type the type of the element
- * @param headless true if the element needs no starting tag
- * @param tailless true if the element needs no closing tag
- * @param content the element content.
- * @param exclusions the elements that must be excluded from the
- * content of this element, in all levels of the hierarchy.
- * @param inclusions the elements that can be included as the
- * content of this element.
- * @param attributes the element attributes.
- * @return the created or updated element.
- */
- protected Element defElement(String name, int type, boolean headless,
- boolean tailless, ContentModel content,
- String[] exclusions, String[] inclusions,
- AttributeList attributes
- )
- {
- // compute the bit sets
- BitSet exclude = bitSet(exclusions);
- BitSet include = bitSet(inclusions);
-
- Element e =
- defineElement(name, type, headless, tailless, content, exclude, include,
- attributes
- );
-
- return e;
- }
-
- /**
- * Creates, intializes and adds to the entity table the new
- * entity.
- * @param name the name of the entity
- * @param type the type of the entity
- * @param data the data section of the entity
- * @return the created entity
- */
- protected Entity defEntity(String name, int type, String data)
- {
- Entity e = newEntity(name, type);
- e.data = data.toCharArray();
-
- return e;
- }
-
- private void assignField(Element e)
- {
- String element_name = e.name;
- try
- {
- // Assign the field via reflection.
- Field f = getClass().getField(element_name.toLowerCase());
- if ((f.getModifiers() & Modifier.PUBLIC) != 0)
- if ((f.getModifiers() & Modifier.STATIC) == 0)
- if (f.getType().isAssignableFrom(e.getClass()))
- f.set(this, e);
- }
- catch (IllegalAccessException ex)
- {
- unexpected(ex);
- }
- catch (NoSuchFieldException ex)
- {
- // This is ok.
- }
-
- // Some virtual machines may still lack the proper
- // implementation of reflection. As the tag fields
- // are not used anywhere in this implementation,
- // (and this class is also rarely used by the end user),
- // it may be better not to crash everything by throwing an error
- // for each case when the HTML parsing is required.
- catch (Throwable t)
- {
- // This VM has no reflection mechanism implemented!
- if (t instanceof OutOfMemoryError)
- throw (Error) t;
- }
- }
-
- /**
- * Create the bit set for this array of elements.
- * The unknown elements are automatically defined and added
- * to the element table.
- * @param elements
- * @return
- */
- private BitSet bitSet(String[] elements)
- {
- BitSet b = new BitSet();
-
- for (int i = 0; i < elements.length; i++)
- {
- Element e = getElement(elements [ i ]);
-
- if (e == null)
- e = newElement(elements [ i ]);
-
- b.set(e.index);
- }
-
- return b;
- }
-
- /**
- * Find the element with the given name in the element table.
- * If not find, create a new element with this name and add to the
- * table.
- * @param name the name of the element
- * @return the found or created element.
- */
- private Element newElement(String name)
- {
- Element e = (Element) elementHash.get(name.toLowerCase());
-
- if (e == null)
- {
- e = new Element();
- e.name = name;
- e.index = elements.size();
- elements.add(e);
- elementHash.put(e.name.toLowerCase(), e);
- assignField(e);
- }
- return e;
- }
-
- /**
- * Creates and adds to the element table the entity with an
- * unitialized data section. Used internally.
- * @param name the name of the entity
- * @param type the type of the entity, a bitwise combination
- * of GENERAL, PARAMETER, SYSTEM and PUBLIC.
- * @throws an error if the parameter is both GENERAL and PARAMETER
- * of both PUBLIC and SYSTEM.
- * @return the created entity
- */
- private Entity newEntity(String name, int type)
- {
- Entity e = new Entity(name, type, null);
- entityHash.put(e.name, e);
- return e;
- }
-
- private void unexpected(Exception ex)
- {
- throw new Error("This should never happen, report a bug", ex);
- }
-}
diff --git a/libjava/javax/swing/text/html/parser/DTDConstants.java b/libjava/javax/swing/text/html/parser/DTDConstants.java
deleted file mode 100755
index a771264a1ad..00000000000
--- a/libjava/javax/swing/text/html/parser/DTDConstants.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/* DTDConstants.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html.parser;
-
-/**
- * <p>This class defines the SGML basic types, used for describing HTML 4.01
- * at {@link http://www.w3.org/TR/html4/types.html }. Not all constants,
- * defined here, are actually used in HTML 4.01 SGML specification. Some others
- * are defined just as part of the required implementation.
- * </p>
- * <p>
- * If you need more information about SGML DTD documents,
- * the author suggests to read SGML tutorial on
- * {@link http://www.w3.org/TR/WD-html40-970708/intro/sgmltut.html}.
- * We also recommend Goldfarb C.F (1991) <i>The SGML Handbook</i>,
- * Oxford University Press, 688 p, ISBN: 0198537379.
- * </p>
- *
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public interface DTDConstants
-{
- /* ----- The data types, used in HTML 4.01 SGML definition: ---- */
-
- /**
- * The CDATA (Character data) constant, specifes the content model,
- * consisting of characters only. In SGML for HTML 4.01, the character
- * entities must be replaced by characters, the line feeds must be
- * ignored and any number of the subsequent carriage returns or tabs
- * must be replaced by a single space.
- */
- int CDATA = 1;
-
- /**
- * The EMPTY constant, means the element with no content.
- */
- int EMPTY = 17;
-
- /**
- * The ID constant, means that the token is the unique identifier.
- * This identifier can be referenced by attribute with value of IDREF.
- * The identifier must begin with letter, followed by any number of
- * letters, digits, hyphens, underscores, colons and periods.
- */
- int ID = 4;
-
- /**
- * The IDREF constant, specifies reference to a valid ID within
- * the document.
- */
- int IDREF = 5;
-
- /**
- * The IDREFS constant, a space separated list of IDREFs
- */
- int IDREFS = 6;
-
- /**
- * The NAME constant, means the token that
- * must begin with letter, followed by any number of
- * letters, digits, hyphens, underscores, colons and periods.
- */
- int NAME = 7;
-
- /**
- * The NAMES constant, specifies a space separated of NAMEs.
- */
- int NAMES = 8;
-
- /**
- * The NMTOKEN constant, specifies the attribute, consisting of
- * characters that can be either digits or alphabetic characters).
- */
- int NMTOKEN = 9;
-
- /**
- * The NMTOKENS constant, specifies a list of NMTOKENs.
- */
- int NMTOKENS = 10;
-
- /**
- * The NOTATION constant, a previously defined data type.
- */
- int NOTATION = 11;
-
- /**
- * The NUMBER constant (means that the attribute consists of at least
- * one decimal digit).
- */
- int NUMBER = 12;
-
- /**
- * The NUMBERS constant, specifies a space separated list of NUMBERs.
- */
- int NUMBERS = 13;
-
- /**
- * The NUTOKEN constant.
- */
- int NUTOKEN = 14;
-
- /**
- * The NUTOKENS constant.
- */
- int NUTOKENS = 15;
-
- /* -------
- The entity scope constants.
- As these four constants are combined with the bitwise OR,
- they are defined in the hexadecimal notation.
- The reason of setting the two bits at once (for PUBLIC and SYSTEM)
- is probably historical. ----- */
-
- /**
- * The PUBLIC constant, specifies the public entity. The PUBLIC entities
- * are assumed to be known to many systems so that a full declaration
- * need not be transmitted. For example,
- * &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN"&gt;
- */
- int PUBLIC = 0xA;
-
- /**
- * The SYSTEM constant, specifies the system entitiy. The system entities
- * are assumed to be known but require the clear identifer
- * (like the file path), where they can be found in the system.
- * For example, <code>
- * &lt;DOCTYPE html SYSTEM "/path/to/file.dtd"&gt; </code>.
- */
- int SYSTEM = 0x11;
-
- /**
- * The PARAMETER constant, specifies that entity is only valid
- * inside SGML DTD scope.
- */
- int PARAMETER = 0x40000;
-
- /**
- * The GENERAL constant, specifies theat the entity is valid in the
- * whole HTML document scope.
- */
- int GENERAL = 0x10000;
-
- /* ---- The constants, defining if the element attribute is required,
- fixed or implied. ---- */
-
- /**
- * The attribute modifier #REQUIRED constant, indicates that the
- * value must be supplied.
- */
- int REQUIRED = 2;
-
- /**
- * The attribute modifier #FIXED constant, means that the attribute has
- * the fixed value that cannot be changed.
- */
- int FIXED = 1;
-
- /**
- * The attribute modifier #IMPLIED constant,
- * indicating that for this attribute the user agent must provide
- * the value itself.
- */
- int IMPLIED = 5;
-
- /**
- * The attribute modifier #CURRENT constant, specifies the value
- * that at any point in the document is the last value supplied for
- * that element. A value is required to be supplied for the first
- * occurrence of an element
- */
- int CURRENT = 3;
-
- /**
- * The attribute modifier #CONREF constant, specifies the IDREF value of
- * the reference to content in another location of the document.
- * The element with this attribute is empty, the content from
- * that another location must be used instead.
- */
- int CONREF = 4;
-
- /* ----- Constants, defining if the element
- start and end tags are required. ---- */
-
- /**
- * The STARTTAG, meaning that the element needs a starting tag.
- */
- int STARTTAG = 13;
-
- /**
- * The ENDTAG constant, meaning that the element needs a closing tag.
- */
- int ENDTAG = 14;
-
- /* ----- Other constants: ----- */
-
- /**
- * The ANY constant, specifies
- * an attribute, consisting from arbitrary characters.
- */
- int ANY = 19;
-
- /**
- * The DEFAULT constant, specifies the default value.
- */
- int DEFAULT = 131072;
-
- /**
- * The ENTITIES constant (list of ENTITYes)
- */
- int ENTITIES = 3;
-
- /**
- * The ENTITY constant, meaning the numeric or symbolic name of some
- * HTML data.
- */
- int ENTITY = 2;
-
- /**
- * The MD constant.
- */
- int MD = 16;
-
- /**
- * The MODEL constant.
- */
- int MODEL = 18;
-
- /**
- * The MS constant.
- */
- int MS = 15;
-
- /**
- * The PI (Processing Instruction) constant, specifies a processing
- * instruction. Processing instructions are used to embed information
- * intended for specific applications.
- */
- int PI = 12;
-
- /**
- * The RCDATA constant (Entity References and Character Data), specifies
- * the content model, consisting of characters AND entities. The
- * "&lt;" is threated as an ordinary character, but
- * "<code>&amp;name;</code>" still means the general entity with
- * the given name.
- */
- int RCDATA = 16;
-
- /**
- * The SDATA constant. Means that the value contains the entity name
- * and the replacement value of a character entity reference.
- */
- int SDATA = 11;
-}
diff --git a/libjava/javax/swing/text/html/parser/DocumentParser.java b/libjava/javax/swing/text/html/parser/DocumentParser.java
deleted file mode 100644
index c706f4d0f0b..00000000000
--- a/libjava/javax/swing/text/html/parser/DocumentParser.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/* DocumentParser.java -- A parser for HTML documents.
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html.parser;
-
-import gnu.javax.swing.text.html.parser.htmlAttributeSet;
-import javax.swing.text.html.parser.Parser;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import javax.swing.text.BadLocationException;
-import javax.swing.text.html.HTMLEditorKit;
-
-/**
- * <p>A simple error-tolerant HTML parser that uses a DTD document
- * to access data on the possible tokens, arguments and syntax.</p>
- * <p> The parser reads an HTML content from a Reader and calls various
- * notifying methods (which should be overridden in a subclass)
- * when tags or data are encountered.</p>
- * <p>Some HTML elements need no opening or closing tags. The
- * task of this parser is to invoke the tag handling methods also when
- * the tags are not explicitly specified and must be supposed using
- * information, stored in the DTD.
- * For example, parsing the document
- * <p>&lt;table&gt;&lt;tr&gt;&lt;td&gt;a&lt;td&gt;b&lt;td&gt;c&lt;/tr&gt; <br>
- * will invoke exactly the handling methods exactly in the same order
- * (and with the same parameters) as if parsing the document: <br>
- * <em>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;table&gt;&lt;
- * tbody&gt;</em>&lt;tr&gt;&lt;td&gt;a<em>&lt;/td&gt;</em>&lt;td&gt;b<em>
- * &lt;/td&gt;</em>&lt;td&gt;c<em>&lt;/td&gt;&lt;/tr&gt;</em>&lt;
- * <em>/tbody&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</em></p>
- * (supposed tags are given in italics). The parser also supports
- * obsolete elements of HTML syntax.<p>
- * </p>
- * In this implementation, DocumentParser is directly derived from its
- * ancestor without changes of functionality.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class DocumentParser
- extends Parser
- implements DTDConstants
-{
- /**
- * The enclosed working parser class.
- */
- private class gnuParser
- extends gnu.javax.swing.text.html.parser.support.Parser
- {
- private gnuParser(DTD d)
- {
- super(d);
- }
-
- protected final void handleComment(char[] comment)
- {
- parser.handleComment(comment);
- callBack.handleComment(comment, hTag.where.startPosition);
- }
-
- protected final void handleEmptyTag(TagElement tag)
- throws javax.swing.text.ChangedCharSetException
- {
- parser.handleEmptyTag(tag);
- callBack.handleSimpleTag(tag.getHTMLTag(), getAttributes(),
- hTag.where.startPosition
- );
- }
-
- protected final void handleEndTag(TagElement tag)
- {
- parser.handleEndTag(tag);
- callBack.handleEndTag(tag.getHTMLTag(), hTag.where.startPosition);
- }
-
- protected final void handleError(int line, String message)
- {
- parser.handleError(line, message);
- callBack.handleError(message, hTag.where.startPosition);
- }
-
- protected final void handleStartTag(TagElement tag)
- {
- parser.handleStartTag(tag);
- htmlAttributeSet attributes = gnu.getAttributes();
-
- if (tag.fictional())
- attributes.addAttribute(HTMLEditorKit.ParserCallback.IMPLIED,
- Boolean.TRUE
- );
-
- callBack.handleStartTag(tag.getHTMLTag(), attributes,
- hTag.where.startPosition
- );
- }
-
- protected final void handleText(char[] text)
- {
- parser.handleText(text);
- callBack.handleText(text, hTag.where.startPosition);
- }
-
- DTD getDTD()
- {
- return dtd;
- }
- }
-
- /**
- * This field is used to access the identically named
- * methods of the outer class.
- * This is package-private to avoid an accessor method.
- */
- DocumentParser parser = this;
-
- /**
- * The callback.
- * This is package-private to avoid an accessor method.
- */
- HTMLEditorKit.ParserCallback callBack;
-
- /**
- * The reference to the working class of HTML parser that is
- * actually used to parse the document.
- * This is package-private to avoid an accessor method.
- */
- gnuParser gnu;
-
- /**
- * Creates a new parser that uses the given DTD to access data on the
- * possible tokens, arguments and syntax. There is no single - step way
- * to get a default DTD; you must either refer to the implementation -
- * specific packages, write your own DTD or obtain the working instance
- * of parser in other way, for example, by calling
- * {@link javax.swing.text.html.HTMLEditorKit#getParser() }.
- * @param a_dtd a DTD to use.
- */
- public DocumentParser(DTD a_dtd)
- {
- super(a_dtd);
- gnu = new gnuParser(a_dtd);
- }
-
- /**
- * Parses the HTML document, calling methods of the provided
- * callback. This method must be multithread - safe.
- * @param reader The reader to read the HTML document from
- * @param callback The callback that is notifyed about the presence
- * of HTML elements in the document.
- * @param ignoreCharSet If thrue, any charset changes during parsing
- * are ignored.
- * @throws java.io.IOException
- */
- public void parse(Reader reader, HTMLEditorKit.ParserCallback a_callback,
- boolean ignoreCharSet
- )
- throws IOException
- {
- callBack = a_callback;
- gnu.parse(reader);
-
- callBack.handleEndOfLineString(gnu.getEndOfLineSequence());
- try
- {
- callBack.flush();
- }
- catch (BadLocationException ex)
- {
- // Convert this into the supported type of exception.
- throw new IOException(ex.getMessage());
- }
- }
-
- /**
- * Handle HTML comment. The default method returns without action.
- * @param comment the comment being handled
- */
- protected void handleComment(char[] comment)
- {
- }
-
- /**
- * Handle the tag with no content, like &lt;br&gt;. The method is
- * called for the elements that, in accordance with the current DTD,
- * has an empty content.
- * @param tag the tag being handled.
- * @throws javax.swing.text.ChangedCharSetException
- */
- protected void handleEmptyTag(TagElement tag)
- throws javax.swing.text.ChangedCharSetException
- {
- }
-
- /**
- * The method is called when the HTML closing tag ((like &lt;/table&gt;)
- * is found or if the parser concludes that the one should be present
- * in the current position.
- * @param The tag being handled
- */
- protected void handleEndTag(TagElement tag)
- {
- }
-
- /* Handle error that has occured in the given line. */
- protected void handleError(int line, String message)
- {
- }
-
- /**
- * The method is called when the HTML opening tag ((like &lt;table&gt;)
- * is found or if the parser concludes that the one should be present
- * in the current position.
- * @param The tag being handled
- */
- protected void handleStartTag(TagElement tag)
- {
- }
-
- /**
- * Handle the text section.
- * @param text a section text.
- */
- protected void handleText(char[] text)
- {
- }
-}
diff --git a/libjava/javax/swing/text/html/parser/Element.java b/libjava/javax/swing/text/html/parser/Element.java
deleted file mode 100755
index f0a0f3303cb..00000000000
--- a/libjava/javax/swing/text/html/parser/Element.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/* Element.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html.parser;
-
-import gnu.javax.swing.text.html.parser.support.gnuStringIntMapper;
-
-import java.io.Serializable;
-
-import java.util.BitSet;
-
-/**
- * <p>
- * Stores the element information, obtained by parsing SGML DTD
- * tag <code>&lt;!ELEMENT .. &gt;</code>. This class has no public
- * constructor and can only be instantiated using the
- * {@link javax.swing.text.html.parser.DTD } methods</p>
- *
- * <p>SGML defines elements that represent structures or
- * behavior. An element typically consists of a start tag, content, and an
- * end tag. Hence the elements are not tags. The HTML 4.0 definition specifies
- * that some elements are not required to have the end tags. Also, some
- * HTML elements (like <code>&lt;hr&gt;</code>) have no content. Element names
- * are case sensitive.</p>
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public final class Element
- implements DTDConstants, Serializable
-{
- /**
- * Package level mapper between type names and they string values.
- */
- static final gnuStringIntMapper mapper =
- new gnuStringIntMapper()
- {
- protected void create()
- {
- add("CDATA", DTDConstants.CDATA);
- add("RCDATA", DTDConstants.RCDATA);
- add("EMPTY", DTDConstants.EMPTY);
- add("ANY", DTDConstants.ANY);
- }
- };
-
- /** Use serialVersionUID for interoperability. */
- private static final long serialVersionUID = -6717939384601675586L;
-
- /**
- * The element attributes.
- */
- public AttributeList atts;
-
- /**
- * Contains refernces to elements that must NOT occur inside this element,
- * at any level of hierarchy.
- */
- public BitSet exclusions;
-
- /**
- * Contains refernces to elements that must CAN occur inside this element,
- * at any level of hierarchy.
- */
- public BitSet inclusions;
-
- /**
- * The content model, defining elements, entities and DTD text
- * that may/may not occur inside this element.
- */
- public ContentModel content;
-
- /**
- * A field to store additional user data for this Element.
- */
- public Object data;
-
- /**
- * The element name.
- */
- public String name;
-
- /**
- * True is this element need not to have the closing tag, false
- * otherwise. The HTML 4.0 definition specifies
- * that some elements (like <code>&lt;hr&gt;</code>are
- * not required to have the end tags.
- */
- public boolean oEnd;
-
- /**
- * True is this element need not to have the starting tag, false
- * otherwise. The HTML 4.0 definition specifies
- * that some elements (like <code>&lt;head&gt;</code> or
- * <code>&lt;body&gt;</code>) are
- * not required to have the start tags.
-
- */
- public boolean oStart;
-
- /**
- * This field contains the unique integer identifier of this Element,
- * used to refer the element (more exactly, the element flag)
- * in <code>inclusions</code> and <code>exclusions</code> bit set.
- */
- public int index;
-
- /**
- * The element type, containing value, defined in DTDConstants.
- * In this implementation, the element type can be
- * CDATA, RCDATA, EMPTY or ANY.
- */
- public int type;
-
- /**
- * The default constructor must have package level access in this
- * class. Use DTD.defineElement(..) to create an element when required.
- * @todo MAKE THIS PACKAGE in the final version. Now the Parser needs it!
- */
- Element()
- {
- }
-
- /**
- * Converts the string representation of the element type
- * into its unique integer identifier, defined in DTDConstants.
- * @param a_type A name of the type
- * @return DTDConstants.CDATA, DTDConstants.RCDATA, DTDConstants.EMPTY,
- * DTDConstants.ANY or null if the type name is not
- * "CDATA", "RCDATA", "EMPTY" or "ANY". This function is case sensitive.
- * @throws NullPointerException if <code>a_type</code> is null.
- */
- public static int name2type(String a_type)
- {
- return mapper.get(a_type);
- }
-
- /**
- * Get the element attribute by name.
- * @param attribute the attribute name, case insensitive.
- * @return the correspoding attribute of this element. The class,
- * for storing as attribute list, as a single attribute, is used to
- * store a single attribute in this case.
- * @throws NullPointerException if the attribute name is null.
- */
- public AttributeList getAttribute(String attribute)
- {
- AttributeList a = atts;
-
- while (a != null && !attribute.equalsIgnoreCase(a.name))
- a = a.next;
-
- return a;
- }
-
- /**
- * Get the element attribute by its value.
- * @param a_value the attribute value, case insensitive.
- * @return the correspoding attribute of this element. The class,
- * for storing as attribute list, as a single attribute, is used to
- * store a single attribute in this case. If there are several
- * attributes with the same value, there is no garranty, which one
- * is returned.
- */
- public AttributeList getAttributeByValue(String a_value)
- {
- AttributeList a = atts;
-
- if (a_value == null)
- {
- while (a != null)
- {
- if (a.value == null)
- return a;
-
- a = a.next;
- }
- }
- else
- {
- while (a != null)
- {
- if (a.value != null && a_value.equalsIgnoreCase(a.value))
- return a;
-
- a = a.next;
- }
- }
-
- return null;
- }
-
- /**
- * Get all attributes of this document as an attribute list.
- * @return
- */
- public AttributeList getAttributes()
- {
- return atts;
- }
-
- /**
- * Get the content model, defining elements, entities and DTD text
- * that may/may not occur inside this element.
- */
- public ContentModel getContent()
- {
- return content;
- }
-
- /**
- * Returns true for the element with no content.
- * Empty elements are defined with the SGML DTD keyword "EMPTY".
- * @return true if content model field (content) method is equal to
- * null or its method empty() returns true.
- */
- public boolean isEmpty()
- {
- return content == null || content.empty();
- }
-
- /**
- * Get the unique integer identifier of this Element,
- * used to refer the element (more exactly, the element flag)
- * in <code>inclusions</code> and <code>exclusions</code> bit set.
- * WARNING: This value may not be the same between different
- * implementations.
- */
- public int getIndex()
- {
- return index;
- }
-
- /**
- * Get the element name.
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Get the element type.
- * @return one of the values, defined DTDConstants.
- * In this implementation, the element type can be
- * CDATA, RCDATA, EMPTY or ANY.
- */
- public int getType()
- {
- return type;
- }
-
- /**
- * True is this element need not to have the starting tag, false
- * otherwise.s element need not to have the closing tag, false
- * otherwise. The HTML 4.0 definition specifies
- * that some elements (like <code>&lt;hr&gt;</code>are
- * not required to have the end tags.
- */
- public boolean omitEnd()
- {
- return oEnd;
- }
-
- /**
- * True is this element need not to have the closing tag, false
- * otherwise. The HTML 4.0 definition specifies
- * that some elements (like <code>&lt;head&gt;</code> or
- * <code>&lt;body&gt;</code>) are
- * not required to have the start tags.
- */
- public boolean omitStart()
- {
- return oStart;
- }
-
- /**
- * Returns the name of this element.
- */
- public String toString()
- {
- return name;
- }
-}
diff --git a/libjava/javax/swing/text/html/parser/Entity.java b/libjava/javax/swing/text/html/parser/Entity.java
deleted file mode 100644
index 766984f9c79..00000000000
--- a/libjava/javax/swing/text/html/parser/Entity.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/* Entity.java -- Stores information, obtained by parsing SGML DTL
- * &lt;!ENTITY % .. &gt; tag
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html.parser;
-
-import gnu.javax.swing.text.html.parser.support.gnuStringIntMapper;
-
-import java.io.Serializable;
-
-/**
- * <p>Stores information, obtained by parsing SGML DTL
- * &lt;!ENTITY % .. &gt; tag.</p>
- * <p>
- * The entity defines some kind of macro that can be used elsewhere in
- * the document.
- * When the macro is referred to by the name in the DTD, it is expanded into
- * a string
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public final class Entity
- implements DTDConstants, Serializable
-{
- /**
- * Package level mapper between type names and they string values.
- */
- final static gnuStringIntMapper mapper =
- new gnuStringIntMapper()
- {
- protected void create()
- {
- add("ANY", DTDConstants.ANY);
- add("CDATA", DTDConstants.CDATA);
- add("PUBLIC", DTDConstants.PUBLIC);
- add("SDATA", DTDConstants.SDATA);
- add("PI", DTDConstants.PI);
- add("STARTTAG", DTDConstants.STARTTAG);
- add("ENDTAG", DTDConstants.ENDTAG);
- add("MS", DTDConstants.MS);
- add("MD", DTDConstants.MD);
- add("SYSTEM", DTDConstants.SYSTEM);
- }
- };
-
- /**
- * The entity name.
- */
- public String name;
-
- /**
- * The entity data
- */
- public char[] data;
-
- /**
- * The entity type.
- */
- public int type;
-
- /**
- * String representation of the entity data.
- */
- private String sdata;
-
- /**
- * Create a new entity
- * @param a_name the entity name
- * @param a_type the entity type
- * @param a_data the data replacing the entity reference
- */
- public Entity(String a_name, int a_type, char[] a_data)
- {
- name = a_name;
- type = a_type;
- data = a_data;
- }
-
- /**
- * Converts a given string to the corresponding entity type.
- * @return a value, defined in DTDConstants (one of
- * PUBLIC, CDATA, SDATA, PI, STARTTAG, ENDTAG, MS, MD, SYSTEM)
- * or CDATA if the parameter is not a valid entity type.
- */
- public static int name2type(String an_entity)
- {
- int r = mapper.get(an_entity);
- return (r == 0) ? DTDConstants.CDATA : r;
- }
-
- /**
- * Get the entity data.
- */
- public char[] getData()
- {
- return data;
- }
-
- /**
- * Returns true for general entities. Each general entity can be
- * referenced as <code>&entity-name;</code>. Such entities are
- * defined by the SGML DTD tag
- * <code>&lt;!ENTITY <i>name</i> "<i>value</i>"></code>. The general
- * entities can be used anywhere in the document.
- */
- public boolean isGeneral()
- {
- return (type & DTDConstants.GENERAL) != 0;
- }
-
- /**
- * Get the entity name.
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Returns true for parameter entities. Each parameter entity can be
- * referenced as <code>&entity-name;</code>. Such entities are
- * defined by the SGML DTD tag
- * <code>&lt;!ENTITY % <i>name</i> "<i>value</i>"></code>. The parameter
- * entities can be used only in SGML context.
- */
- public boolean isParameter()
- {
- return (type & DTDConstants.PARAMETER) != 0;
- }
-
- /**
- * Returns a data as String
- */
- public String getString()
- {
- if (sdata == null)
- sdata = new String(data);
-
- return sdata;
- }
-
- /**
- * Get the entity type.
- * @return the value of the {@link #type}.
- */
- public int getType()
- {
- return type;
- }
-
-}
diff --git a/libjava/javax/swing/text/html/parser/Parser.java b/libjava/javax/swing/text/html/parser/Parser.java
deleted file mode 100755
index 5867107cd45..00000000000
--- a/libjava/javax/swing/text/html/parser/Parser.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/* Parser.java -- HTML parser
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html.parser;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import javax.swing.text.ChangedCharSetException;
-import javax.swing.text.SimpleAttributeSet;
-
-/*
- * FOR DEVELOPERS: To avoid regression, please run the package test
- * textsuite/javax.swing.text.html.parser/AllParserTests after your
- * modifications.
- */
-
-/**
- * <p>A simple error-tolerant HTML parser that uses a DTD document
- * to access data on the possible tokens, arguments and syntax.</p>
- * <p> The parser reads an HTML content from a Reader and calls various
- * notifying methods (which should be overridden in a subclass)
- * when tags or data are encountered.</p>
- * <p>Some HTML elements need no opening or closing tags. The
- * task of this parser is to invoke the tag handling methods also when
- * the tags are not explicitly specified and must be supposed using
- * information, stored in the DTD.
- * For example, parsing the document
- * <p>&lt;table&gt;&lt;tr&gt;&lt;td&gt;a&lt;td&gt;b&lt;td&gt;c&lt;/tr&gt; <br>
- * will invoke exactly the handling methods exactly in the same order
- * (and with the same parameters) as if parsing the document: <br>
- * <em>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;table&gt;&lt;
- * tbody&gt;</em>&lt;tr&gt;&lt;td&gt;a<em>&lt;/td&gt;</em>&lt;td&gt;b<em>
- * &lt;/td&gt;</em>&lt;td&gt;c<em>&lt;/td&gt;&lt;/tr&gt;</em>&lt;
- * <em>/tbody&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</em></p>
- * (supposed tags are given in italics). The parser also supports
- * obsolete elements of HTML syntax.<p>
- * </p>
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class Parser
- implements DTDConstants
-{
- /**
- * The document template description that will be used to parse the documents.
- */
- protected DTD dtd;
-
- /**
- * The value of this field determines whether or not the Parser will be
- * strict in enforcing SGML compatibility. The default value is false,
- * stating that the parser should do everything to parse and get at least
- * some information even from the incorrectly written HTML input.
- */
- protected boolean strict;
-
- /**
- * The package level reference to the working HTML parser in this
- * implementation.
- */
- final gnu.javax.swing.text.html.parser.support.Parser gnu;
-
- /**
- * Creates a new parser that uses the given DTD to access data on the
- * possible tokens, arguments and syntax. There is no single - step way
- * to get a default DTD; you must either refer to the implementation -
- * specific packages, write your own DTD or obtain the working instance
- * of parser in other way, for example, by calling
- * {@link javax.swing.text.html.HTMLEditorKit#getParser() }.
- * @param a_dtd A DTD to use.
- */
- public Parser(DTD a_dtd)
- {
- dtd = a_dtd;
-
- final Parser j = this;
-
- gnu =
- new gnu.javax.swing.text.html.parser.support.Parser(dtd)
- {
- protected final void handleComment(char[] comment)
- {
- j.handleComment(comment);
- }
-
- protected final void handleEOFInComment()
- {
- j.handleEOFInComment();
- }
-
- protected final void handleEmptyTag(TagElement tag)
- throws javax.swing.text.ChangedCharSetException
- {
- j.handleEmptyTag(tag);
- }
-
- protected final void handleStartTag(TagElement tag)
- {
- j.handleStartTag(tag);
- }
-
- protected final void handleEndTag(TagElement tag)
- {
- j.handleEndTag(tag);
- }
-
- protected final void handleError(int line, String message)
- {
- j.handleError(line, message);
- }
-
- protected final void handleText(char[] text)
- {
- j.handleText(text);
- }
-
- protected final void handleTitle(char[] title)
- {
- j.handleTitle(title);
- }
-
- protected final void markFirstTime(Element element)
- {
- j.markFirstTime(element);
- }
-
- protected final void startTag(TagElement tag)
- throws ChangedCharSetException
- {
- j.startTag(tag);
- }
-
- protected final void endTag(boolean omitted)
- {
- j.endTag(omitted);
- }
-
- protected TagElement makeTag(Element element)
- {
- return j.makeTag(element);
- }
-
- protected TagElement makeTag(Element element, boolean isSupposed)
- {
- return j.makeTag(element, isSupposed);
- }
- };
- }
-
- /**
- * Parse the HTML text, calling various methods in response to the
- * occurence of the corresponding HTML constructions.
- * @param reader The reader to read the source HTML from.
- * @throws IOException If the reader throws one.
- */
- public synchronized void parse(Reader reader)
- throws IOException
- {
- gnu.parse(reader);
- }
-
- /**
- * Parses DTD markup declaration. Currently returns without action.
- * @return null.
- * @throws java.io.IOException
- */
- public String parseDTDMarkup()
- throws IOException
- {
- return gnu.parseDTDMarkup();
- }
-
- /**
- * Parse DTD document declarations. Currently only parses the document
- * type declaration markup.
- * @param strBuff
- * @return true if this is a valid DTD markup declaration.
- * @throws IOException
- */
- protected boolean parseMarkupDeclarations(StringBuffer strBuff)
- throws IOException
- {
- return gnu.parseMarkupDeclarations(strBuff);
- }
-
- /**
- * Get the attributes of the current tag.
- * @return The attribute set, representing the attributes of the current tag.
- */
- protected SimpleAttributeSet getAttributes()
- {
- return gnu.getAttributes();
- }
-
- /**
- * Get the number of the document line being parsed.
- * @return The current line.
- */
- protected int getCurrentLine()
- {
- return gnu.hTag.where.beginLine;
- }
-
- /**
- * Get the current position in the document being parsed.
- * @return The current position.
- */
- protected int getCurrentPos()
- {
- return gnu.hTag.where.startPosition;
- }
-
- /**
- * The method is called when the HTML end (closing) tag is found or if
- * the parser concludes that the one should be present in the
- * current position. The method is called immediatly
- * before calling the handleEndTag().
- * @param omitted True if the tag is no actually present in the document,
- * but is supposed by the parser (like &lt;/html&gt; at the end of the
- * document).
- */
- protected void endTag(boolean omitted)
- {
- }
-
- /**
- * Invokes the error handler. The default method in this implementation
- * finally delegates the call to handleError, also providing the number of the
- * current line.
- */
- protected void error(String msg)
- {
- gnu.error(msg);
- }
-
- /**
- * Invokes the error handler. The default method in this implementation
- * finally delegates the call to error (msg+": '"+invalid+"'").
- */
- protected void error(String msg, String invalid)
- {
- gnu.error(msg, invalid);
- }
-
- /**
- * Invokes the error handler. The default method in this implementation
- * finally delegates the call to error (parm1+" "+ parm2+" "+ parm3).
- */
- protected void error(String parm1, String parm2, String parm3)
- {
- gnu.error(parm1, parm2, parm3);
- }
-
- /**
- * Invokes the error handler. The default method in this implementation
- * finally delegates the call to error
- * (parm1+" "+ parm2+" "+ parm3+" "+ parm4).
- */
- protected void error(String parm1, String parm2, String parm3, String parm4)
- {
- gnu.error(parm1, parm2, parm3, parm4);
- }
-
- /**
- * In this implementation, this is never called and returns without action.
- */
- protected void flushAttributes()
- {
- gnu.flushAttributes();
- }
-
- /**
- * Handle HTML comment. The default method returns without action.
- * @param comment The comment being handled
- */
- protected void handleComment(char[] comment)
- {
- }
-
- /**
- * This is additionally called in when the HTML content terminates
- * without closing the HTML comment. This can only happen if the
- * HTML document contains errors (for example, the closing --;gt is
- * missing. The default method calls the error handler.
- */
- protected void handleEOFInComment()
- {
- gnu.error("Unclosed comment");
- }
-
- /**
- * Handle the tag with no content, like &lt;br&gt;. The method is
- * called for the elements that, in accordance with the current DTD,
- * has an empty content.
- * @param The tag being handled.
- * @throws javax.swing.text.ChangedCharSetException
- */
- protected void handleEmptyTag(TagElement tag)
- throws ChangedCharSetException
- {
- }
-
- /**
- * The method is called when the HTML closing tag ((like &lt;/table&gt;)
- * is found or if the parser concludes that the one should be present
- * in the current position.
- * @param The tag being handled
- */
- protected void handleEndTag(TagElement tag)
- {
- }
-
- /* Handle error that has occured in the given line. */
- protected void handleError(int line, String message)
- {
- }
-
- /**
- * The method is called when the HTML opening tag ((like &lt;table&gt;)
- * is found or if the parser concludes that the one should be present
- * in the current position.
- * @param The tag being handled
- */
- protected void handleStartTag(TagElement tag)
- {
- }
-
- /**
- * Handle the text section.
- * <p> For non-preformatted section, the parser replaces
- * \t, \r and \n by spaces and then multiple spaces
- * by a single space. Additionaly, all whitespace around
- * tags is discarded.
- * </p>
- * <p> For pre-formatted text (inside TEXAREA and PRE), the parser preserves
- * all tabs and spaces, but removes <b>one</b> bounding \r, \n or \r\n,
- * if it is present. Additionally, it replaces each occurence of \r or \r\n
- * by a single \n.</p>
- *
- * @param text A section text.
- */
- protected void handleText(char[] text)
- {
- }
-
- /**
- * Handle HTML &lt;title&gt; tag. This method is invoked when
- * both title starting and closing tags are already behind.
- * The passed argument contains the concatenation of all
- * title text sections.
- * @param The title text.
- */
- protected void handleTitle(char[] title)
- {
- }
-
- /**
- * Constructs the tag from the given element. In this implementation,
- * this is defined, but never called.
- * @param element the base element of the tag.
- * @return the tag
- */
- protected TagElement makeTag(Element element)
- {
- return makeTag(element, false);
- }
-
- /**
- * Constructs the tag from the given element.
- * @param the tag base {@link javax.swing.text.html.parser.Element}
- * @param isSupposed true if the tag is not actually present in the
- * html input, but the parser supposes that it should to occur in
- * the current location.
- * @return the tag
- */
- protected TagElement makeTag(Element element, boolean isSupposed)
- {
- return new TagElement(element, isSupposed);
- }
-
- /**
- * This is called when the tag, representing the given element,
- * occurs first time in the document.
- * @param element
- */
- protected void markFirstTime(Element element)
- {
- }
-
- /**
- * The method is called when the HTML opening tag ((like &lt;table&gt;)
- * is found or if the parser concludes that the one should be present
- * in the current position. The method is called immediately before
- * calling the handleStartTag.
- * @param The tag
- */
- protected void startTag(TagElement tag)
- throws ChangedCharSetException
- {
- }
-}
diff --git a/libjava/javax/swing/text/html/parser/ParserDelegator.java b/libjava/javax/swing/text/html/parser/ParserDelegator.java
deleted file mode 100644
index 745a4176853..00000000000
--- a/libjava/javax/swing/text/html/parser/ParserDelegator.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/* ParserDelegator.java -- Delegator for ParserDocument.
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html.parser;
-
-import gnu.javax.swing.text.html.parser.HTML_401F;
-import gnu.javax.swing.text.html.parser.htmlAttributeSet;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Serializable;
-
-import javax.swing.text.BadLocationException;
-import javax.swing.text.html.HTMLEditorKit;
-import javax.swing.text.html.HTMLEditorKit.ParserCallback;
-
-/**
- * This class instantiates and starts the working instance of
- * html parser, being responsible for providing the default DTD.
- *
- * TODO Later this class must be derived from the totally abstract class
- * HTMLEditorKit.Parser. HTMLEditorKit that does not yet exist.
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class ParserDelegator
- extends javax.swing.text.html.HTMLEditorKit.Parser
- implements Serializable
-{
- private class gnuParser
- extends gnu.javax.swing.text.html.parser.support.Parser
- {
- private static final long serialVersionUID = 1;
-
- private gnuParser(DTD d)
- {
- super(d);
- }
-
- protected final void handleComment(char[] comment)
- {
- callBack.handleComment(comment, hTag.where.startPosition);
- }
-
- protected final void handleEmptyTag(TagElement tag)
- throws javax.swing.text.ChangedCharSetException
- {
- callBack.handleSimpleTag(tag.getHTMLTag(), getAttributes(),
- hTag.where.startPosition
- );
- }
-
- protected final void handleEndTag(TagElement tag)
- {
- callBack.handleEndTag(tag.getHTMLTag(), hTag.where.startPosition);
- }
-
- protected final void handleError(int line, String message)
- {
- callBack.handleError(message, hTag.where.startPosition);
- }
-
- protected final void handleStartTag(TagElement tag)
- {
- htmlAttributeSet attributes = gnu.getAttributes();
-
- if (tag.fictional())
- attributes.addAttribute(ParserCallback.IMPLIED, Boolean.TRUE);
-
- callBack.handleStartTag(tag.getHTMLTag(), attributes,
- hTag.where.startPosition
- );
- }
-
- protected final void handleText(char[] text)
- {
- callBack.handleText(text, hTag.where.startPosition);
- }
-
- DTD getDTD()
- {
- return dtd;
- }
- }
-
- /**
- * Use serialVersionUID for interoperability.
- */
- private static final long serialVersionUID = -1276686502624777206L;
-
- private static DTD dtd = HTML_401F.getInstance();
-
- /**
- * The callback.
- * This is package-private to avoid an accessor method.
- */
- HTMLEditorKit.ParserCallback callBack;
-
- /**
- * The reference to the working class of HTML parser that is
- * actually used to parse the document.
- * This is package-private to avoid an accessor method.
- */
- gnuParser gnu;
-
- /**
- * Parses the HTML document, calling methods of the provided
- * callback. This method must be multithread - safe.
- * @param reader The reader to read the HTML document from
- * @param callback The callback that is notifyed about the presence
- * of HTML elements in the document.
- * @param ignoreCharSet If thrue, any charset changes during parsing
- * are ignored.
- * @throws java.io.IOException
- */
- public void parse(Reader reader, HTMLEditorKit.ParserCallback a_callback,
- boolean ignoreCharSet
- )
- throws IOException
- {
- callBack = a_callback;
-
- if (gnu == null || !dtd.equals(gnu.getDTD()))
- {
- gnu = new gnuParser(dtd);
- }
-
- gnu.parse(reader);
-
- callBack.handleEndOfLineString(gnu.getEndOfLineSequence());
- try
- {
- callBack.flush();
- }
- catch (BadLocationException ex)
- {
- // Convert this into the supported type of exception.
- throw new IOException(ex.getMessage());
- }
- }
-
- /**
- * Calling this method instructs that, if not specified directly,
- * the documents will be parsed using the default
- * DTD of the implementation.
- */
- protected static void setDefaultDTD()
- {
- dtd = HTML_401F.getInstance();
- }
-
- /**
- * Registers the user - written DTD under the given name, also
- * making it default for the subsequent parsings. This has effect on
- * all subsequent calls to the parse(...) . If you need to specify
- * your DTD locally, simply {@link javax.swing.text.html.parser.Parser}
- * instead.
- * @param dtd The DTD that will be used to parse documents by this class.
- * @param name The name of this DTD.
- * @return No standard is specified on which instance of DTD must be
- * returned by this method, and it is recommended to leave the returned
- * value without consideration. This implementation returns the DTD
- * that was previously set as the default DTD, or the implementations
- * default DTD if none was set.
- */
- protected static DTD createDTD(DTD a_dtd, String name)
- {
- DTD.putDTDHash(name, a_dtd);
-
- DTD dtd_prev = dtd;
- dtd = a_dtd;
- return dtd_prev;
- }
-}
diff --git a/libjava/javax/swing/text/html/parser/TagElement.java b/libjava/javax/swing/text/html/parser/TagElement.java
deleted file mode 100755
index 4558b15eb0a..00000000000
--- a/libjava/javax/swing/text/html/parser/TagElement.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/* TagElement.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.html.parser;
-
-import javax.swing.text.html.HTML;
-
-/**
- * The SGML element, defining a single html tag.
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class TagElement
-{
- /**
- * The Element the tag was constructed from.
- */
- private final Element element;
-
- /**
- * The coresponding HTML tag, assigned once in constructor.
- */
- private final HTML.Tag tag;
-
- /**
- * The 'fictional' flag.
- */
- private final boolean fictional;
-
- /**
- * Creates the html tag element from the defintion, stored in the
- * given element. Sets the flag 'fictional' to false.
- * @param an_element
- */
- public TagElement(Element an_element)
- {
- this(an_element, false);
- }
-
- /**
- * Creates the html tag element from the defintion, stored in the
- * given element, setting the flag 'fictional' to the given value.
- */
- public TagElement(Element an_element, boolean is_fictional)
- {
- element = an_element;
- fictional = is_fictional;
-
- HTML.Tag t = HTML.getTag(element.getName());
-
- if (t != null)
- tag = t;
- else
- tag = new HTML.UnknownTag(element.getName());
- }
-
- /**
- * Get the element from that the tag was constructed.
- */
- public Element getElement()
- {
- return element;
- }
-
- /**
- * Get the corresponding HTML tag. This is either one of the
- * pre-defined HTML tags or the instance of the UnknownTag with the
- * element name.
- */
- public HTML.Tag getHTMLTag()
- {
- return tag;
- }
-
- /**
- * Calls isPreformatted() for the corresponding html tag and returns
- * the obtained value.
- */
- public boolean isPreformatted()
- {
- return tag.isPreformatted();
- }
-
- /**
- * Calls breaksFlow() for the corresponding html tag and returns
- * the obtained value.
- */
- public boolean breaksFlow()
- {
- return tag.breaksFlow();
- }
-
- /**
- * Get the value of the flag 'fictional'.
- */
- public boolean fictional()
- {
- return fictional;
- }
-
- /**
- * Returns string representation of this object.
- */
- public String toString()
- {
- return getElement() + (fictional ? "?" : "");
- }
-}
diff --git a/libjava/javax/swing/text/rtf/ControlWordToken.java b/libjava/javax/swing/text/rtf/ControlWordToken.java
deleted file mode 100644
index 7008f0fd4a9..00000000000
--- a/libjava/javax/swing/text/rtf/ControlWordToken.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* ControlWordToken.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.rtf;
-
-/**
- * A special {@link Token} that represents a control word in RTF like
- * '\deff0' where 'deff' is the name of the control word and '0' is an
- * optional parameter.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
-class ControlWordToken extends Token
-{
-
- /**
- * The name of the control word.
- */
- public String name;
-
- /**
- * The optional parameter of the control word. Absence of a parameter is
- * expressed through Integer.MIN_VALUE.
- */
- public int param;
-
- /**
- * Constructs a new ControlWordToken with the specified name and without
- * a parameter.
- *
- * @param name the name of the control word
- */
- public ControlWordToken(String name)
- {
- this(name, Integer.MIN_VALUE);
- }
-
-
- /**
- * Constructs a new ControlWordToken with the specified name and parameter.
- *
- * @param name the name of the control word
- */
- public ControlWordToken(String name, int param)
- {
- super(Token.CONTROL_WORD);
- this.name = name;
- this.param = param;
- }
-
-}
diff --git a/libjava/javax/swing/text/rtf/RTFEditorKit.java b/libjava/javax/swing/text/rtf/RTFEditorKit.java
deleted file mode 100644
index b2ebe3dd18c..00000000000
--- a/libjava/javax/swing/text/rtf/RTFEditorKit.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* RTFEditorKit.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.rtf;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-import javax.swing.text.StyledEditorKit;
-
-/**
- * Provides support for RTF data for use in
- * {@link javax.swing.JEditorPane}s.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
-public class RTFEditorKit
- extends StyledEditorKit
-{
-
- /**
- * Constructs a new RTFEditorKit.
- */
- public RTFEditorKit()
- {
- super();
- }
-
- /**
- * Returns the MIME content type. In the case of RTFEditorKit this is
- * &apos;text/rtf&apos;
- *
- * @return the MIME content type for RTFEditorKit
- */
- public String getContentType()
- {
- return "text/rtf";
- }
-
- /**
- * Reads RTF data from <code>stream</code> into <code>doc</code> at the
- * specified position <code>pos</code>.
- *
- * @param stream the {@link InputStream} from where we read RTF data
- * @param doc the {@link Document} into which we read the RTF data
- * @param pos the position where to start
- *
- * @throws IOException if an IO error occurs
- * @throws BadLocationException if the position is not valid
- */
- public void read(InputStream stream, Document doc, int pos)
- throws IOException, BadLocationException
- {
- RTFParser parser = new RTFParser(stream, doc, pos);
- parser.parse();
- }
-
-
- /**
- * Reads RTF data from <code>reader</code> into <code>doc</code> at the
- * specified position <code>pos</code>.
- *
- * @param reader the {@link Reader} from where we read RTF data
- * @param doc the {@link Document} into which we read the RTF data
- * @param pos the position where to start
- *
- * @throws IOException if an IO error occurs
- * @throws BadLocationException if the position is not valid
- */
- public void read(Reader reader, Document doc, int pos)
- throws IOException, BadLocationException
- {
- RTFParser parser = new RTFParser(reader, doc, pos);
- parser.parse();
- }
-}
diff --git a/libjava/javax/swing/text/rtf/RTFParseException.java b/libjava/javax/swing/text/rtf/RTFParseException.java
deleted file mode 100644
index 2a9c64f05b8..00000000000
--- a/libjava/javax/swing/text/rtf/RTFParseException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* RTFParseException.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.rtf;
-
-/**
- * Indicates a parsing error during RTF processing.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
-class RTFParseException
- extends RuntimeException
-{
- /**
- * Constructs a new RTFParseException without message.
- */
- public RTFParseException()
- {
- super();
- }
-
- /**
- * Constructs a new RTFParseException with the specified message.
- */
- public RTFParseException(String message)
- {
- super(message);
- }
-
-}
diff --git a/libjava/javax/swing/text/rtf/RTFParser.java b/libjava/javax/swing/text/rtf/RTFParser.java
deleted file mode 100644
index 4f0f967c117..00000000000
--- a/libjava/javax/swing/text/rtf/RTFParser.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/* RTFParser.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.rtf;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-
-/**
- * Parses an RTF file into a {@link Document}. The parser utilizes
- * {@link RTFScanner}.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
-class RTFParser
-{
-
- /**
- * Our scanner.
- */
- private RTFScanner scanner;
-
- /**
- * The document into which we parse.
- */
- private Document doc;
-
- /**
- * The current position.
- */
- private int pos;
-
- /**
- * Constructs a new RTFParser for the specified document and position,
- * without initializing the scanner. This is only used internally.
- *
- * @param doc the {@link Document} into which we should parse
- * @param pos the position to start
- */
- private RTFParser(Document doc, int pos)
- {
- this.doc = doc;
- this.pos = pos;
- }
-
- /**
- * Constructs a new RTFParser for the specified <code>stream</code>.
- *
- * @param stream the stream from which we parse
- * @param doc the {@link Document} into which we should parse
- * @param pos the position to start
- */
- public RTFParser(InputStream stream, Document doc, int pos)
- {
- this(doc, pos);
- scanner = new RTFScanner(stream);
- }
-
- /**
- * Constructs a new RTFParser for the specified <code>reader</code>.
- *
- * @param reader the reader from which we parse
- * @param doc the {@link Document} into which we should parse
- * @param pos the position to start
- */
- public RTFParser(Reader reader, Document doc, int pos)
- {
- this(doc, pos);
- scanner = new RTFScanner(reader);
- }
-
- /**
- * Returns the {@link Document} in which we parsed the RTF data.
- *
- * @return the {@link Document} in which we parsed the RTF data
- */
- public Document getDocument()
- {
- return doc;
- }
-
- /**
- * Starts the parsing process.
- */
- public void parse()
- throws IOException, BadLocationException
- {
- parseFile();
- }
-
- /**
- * The parse rules for &lt;file&gt;.
- */
- private void parseFile()
- throws IOException, BadLocationException
- {
- Token t1 = scanner.readToken();
- if (t1.type != Token.LCURLY)
- throw new RTFParseException("expected left curly braces");
-
- parseHeader();
- parseDocument();
-
- Token t2 = scanner.readToken();
- if (t2.type != Token.RCURLY)
- throw new RTFParseException("expected right curly braces");
-
- }
-
- /**
- * The parse rules for &lt;header&gt;.
- *
- * TODO: implement this properly
- */
- private void parseHeader()
- //throws IOException, BadLocationException
- {
- // TODO add parse rules here
- }
-
-
- /**
- * The parse rules for &lt;document&gt;.
- *
- * TODO: implement this properly
- */
- private void parseDocument()
- throws IOException, BadLocationException
- {
- // !!! TODO !!!
- // This simply emits every TEXT Token as text to the document
- // which is plain stupid
-
- boolean eof = false;
-
- do {
- Token token = scanner.readToken();
- switch (token.type)
- {
- case Token.TEXT:
- TextToken textToken = (TextToken) token;
- doc.insertString(pos, textToken.text, null);
- pos += textToken.text.length();
- break;
- case Token.EOF:
- eof = true;
- break;
- default:
- // FIXME
- break;
- }
- } while (!eof);
-
- }
-
-}
diff --git a/libjava/javax/swing/text/rtf/RTFScanner.java b/libjava/javax/swing/text/rtf/RTFScanner.java
deleted file mode 100644
index 3cdd6e8e0b9..00000000000
--- a/libjava/javax/swing/text/rtf/RTFScanner.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/* RTFScanner.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.rtf;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
-/**
- * Provides a scanner that scans an {@link InputStream} for tokens of the
- * RTF syntax.
- *
- * This scanner is based upon the RTF specification 1.6
- * available at:
- *
- * <a
- * href="http://msdn.microsoft.com/library/en-us/dnrtfspec/html/rtfspec.asp">
- * RTF specification at MSDN</a>
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
-class RTFScanner
-{
-
- /**
- * The reader from which we read the RTF data.
- */
- private Reader in;
-
- /**
- * This is used to constuct strings from the read in chars.
- */
- private StringBuffer buffer;
-
- /**
- * Constructs a new RTFScanner without initializing the {@link Reader}.
- */
- private RTFScanner()
- {
- buffer = new StringBuffer();
- }
-
- /**
- * Constructs a new RTFScanner for the given {@link InputStream}.
- * The stream is wrapped into an {@link InputStreamReader} and if it's
- * not yet buffered then the Reader is wrapped in a {@link BufferedReader}
- *
- * @param stream the {@link InputStream} to read RTF data from
- */
- public RTFScanner(InputStream stream)
- {
- this();
- InputStreamReader reader = new InputStreamReader(stream);
- in = new BufferedReader(reader);
- }
-
- /**
- * Constructs a new RTFScanner for the given {@link Reader}.
- *
- * If the reader is not an instance of {@link BufferedReader} then it
- * is wrapped into a BufferedReader.
- *
- * @param reader the {@link BufferedReader} to read RTF data from
- */
- public RTFScanner(Reader reader)
- {
- this();
- if (reader instanceof BufferedReader)
- {
- in = reader;
- }
- else
- {
- in = new BufferedReader(reader);
- }
- }
-
- /**
- * Reads in the next {@link Token} from the stream.
- *
- * @return the read {@link Token}
- *
- * @throws IOException if the underlying stream has problems
- */
- public Token readToken()
- throws IOException
- {
- Token token = null;
-
- int c = in.read();
- switch(c)
- {
- case -1:
- token = new Token(Token.EOF);
- break;
-
- case '{':
- token = new Token(Token.LCURLY);
- break;
-
- case '}':
- token = new Token(Token.RCURLY);
- break;
-
- case '\\':
- buffer.delete(0, buffer.length());
- buffer.append((char) c);
- token = readControlWord();
- break;
-
- default:
- buffer.delete(0, buffer.length());
- buffer.append((char) c);
- token = readText();
- break;
- }
-
- return token;
- }
-
- /**
- * Reads in a control word and optional parameter.
- *
- * @return the read in control word as {@link ControlWordToken}
- *
- * @throws IOException if the underlying stream has problems
- */
- private Token readControlWord()
- throws IOException
- {
- // this flag indicates if we are still reading the name or are already
- // in the parameter
- boolean readingName = true;
- String name = null;
- String param = null;
-
- while (true)
- {
- in.mark(1);
- int c = in.read();
-
- // check for 'a'..'z'
- if (readingName && (c >= 'a') && (c <= 'z'))
- {
- buffer.append((char) c);
- }
- else if ((c >= '0') && (c <= '9'))
- {
- // if the last char was in the name, then finish reading the name
- if (readingName)
- {
- name = buffer.toString();
- buffer.delete(0, buffer.length());
- readingName = false;
- }
- buffer.append((char) c);
- }
- else
- {
- // if we were in the name, then finish this
- if (readingName)
- {
- name = buffer.toString();
- }
- // otherwise finish the parameter
- else
- {
- param = buffer.toString();
- }
-
- // clear up
- buffer.delete(0, buffer.length());
- // reset input buffer to last char
- in.reset();
- // break while loop
- break;
- }
- }
-
- ControlWordToken token = null;
-
- if (param == null)
- token = new ControlWordToken(name);
- else
- token =new ControlWordToken(name, Integer.parseInt(param));
-
- return token;
-
- }
-
- /**
- * Reads in a block of text.
- *
- * @return the token for the text
- */
- private Token readText()
- throws IOException
- {
-
- boolean readingText = true;
- while (readingText)
- {
- in.mark(1);
- int c = in.read();
- switch(c)
- {
- case '\\':
- case '{':
- case '}':
- case -1:
- readingText = false;
- in.reset();
- break;
-
- default:
- buffer.append((char) c);
- break;
- }
-
- }
-
- String text = buffer.toString();
- Token token = new TextToken(text);
-
- buffer.delete(0, buffer.length());
-
- return token;
-
- }
-}
diff --git a/libjava/javax/swing/text/rtf/TextToken.java b/libjava/javax/swing/text/rtf/TextToken.java
deleted file mode 100644
index 2d6d527d132..00000000000
--- a/libjava/javax/swing/text/rtf/TextToken.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* TextToken.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.rtf;
-
-/**
- * A special {@link Token} that represents a piece of text in RTF.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
-class TextToken extends Token
-{
-
- /**
- * The text.
- */
- public String text;
-
- /**
- * Constructs a new TextToken with the specified textual data.
- *
- * @param text the text for this token
- */
- public TextToken(String text)
- {
- super(Token.TEXT);
- this.text = text;
- }
-
-}
diff --git a/libjava/javax/swing/text/rtf/Token.java b/libjava/javax/swing/text/rtf/Token.java
deleted file mode 100644
index 7d5adaaf0bb..00000000000
--- a/libjava/javax/swing/text/rtf/Token.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Token.java --
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.text.rtf;
-
-/**
- * Represents a simple token that the RTFScanner can read. A simple
- * only has a type (like LCURLY or RCURLY). More complex tokens may
- * attach data to the token.
- *
- * @author Roman Kennke (roman@ontographics.com)
- */
-class Token
-{
-
- /**
- * This special type inidicates the end of the input stream.
- */
- public static final int EOF = -1;
-
- /**
- * A left curly brace '{'.
- */
- public static final int LCURLY = 1;
-
- /**
- * A right curly brace '}'.
- */
- public static final int RCURLY = 2;
-
- /**
- * A control word like '\rtf1'. Tokens with this type are represented
- * through the subclass {@link ControlWordToken}.
- */
- public static final int CONTROL_WORD = 3;
-
- /**
- * A token that contains text. This is represented through the subclass
- * {@link TextToken}.
- */
- public static final int TEXT = 4;
-
-
- /** The token type. */
- public int type;
-
- /**
- * Constructs a new Token with the specified type.
- *
- * @param type the Token type
- */
- public Token(int type)
- {
- this.type = type;
- }
-}
diff --git a/libjava/javax/swing/tree/AbstractLayoutCache.java b/libjava/javax/swing/tree/AbstractLayoutCache.java
deleted file mode 100644
index 6b66c0b20c4..00000000000
--- a/libjava/javax/swing/tree/AbstractLayoutCache.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/* AbstractLayoutCache.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.awt.Rectangle;
-import java.util.Enumeration;
-
-import javax.swing.event.TreeModelEvent;
-
-/**
- * class AbstractLayoutCache
- *
- * @author Andrew Selkirk
- */
-public abstract class AbstractLayoutCache implements RowMapper
-{
- /**
- * class NodeDimensions
- */
- public abstract static class NodeDimensions
- {
- /**
- * Creates <code>NodeDimensions</code> object.
- */
- public NodeDimensions()
- {
- // Do nothing here.
- }
-
- /**
- * getNodeDimensions
- *
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- * @param value3 TODO
- * @param value4 TODO
- * @return Rectangle
- */
- public abstract Rectangle getNodeDimensions(Object value0, int value1,
- int value2, boolean value3,
- Rectangle value4);
- }
-
- /**
- * nodeDimensions
- */
- protected NodeDimensions nodeDimensions;
-
- /**
- * treeModel
- */
- protected TreeModel treeModel;
-
- /**
- * treeSelectionModel
- */
- protected TreeSelectionModel treeSelectionModel;
-
- /**
- * rootVisible
- */
- protected boolean rootVisible;
-
- /**
- * rowHeight
- */
- protected int rowHeight;
-
- /**
- * Constructor AbstractLayoutCache
- */
- public AbstractLayoutCache()
- {
- // Do nothing here.
- }
-
- /**
- * setNodeDimensions
- *
- * @param dimensions TODO
- */
- public void setNodeDimensions(NodeDimensions dimensions)
- {
- nodeDimensions = dimensions;
- }
-
- /**
- * getNodeDimensions
- *
- * @return NodeDimensions
- */
- public NodeDimensions getNodeDimensions()
- {
- return nodeDimensions;
- }
-
- /**
- * getNodeDimensions
- *
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- * @param value3 TODO
- * @param value4 TODO
- *
- * @return Rectangle
- */
- protected Rectangle getNodeDimensions(Object value0, int value1, int value2, boolean value3, Rectangle value4)
- {
- return null; // TODO
- }
-
- /**
- * Sets the model that provides the tree data.
- *
- * @param the model
- */
- public void setModel(TreeModel model)
- {
- treeModel = model;
- }
-
- /**
- * Returns the model that provides the tree data.
- *
- * @return the model
- */
- public TreeModel getModel()
- {
- return treeModel;
- }
-
- /**
- * setRootVisible
- *
- * @param visible <code>true</code> if root should be visible,
- * <code>false</code> otherwise
- */
- public void setRootVisible(boolean visible)
- {
- rootVisible = visible;
- }
-
- /**
- * isRootVisible
- *
- * @return <code>true</code> if root is visible,
- * <code>false</code> otherwise
- */
- public boolean isRootVisible()
- {
- return rootVisible;
- }
-
- /**
- * setRowHeight
- *
- * @param height the row height
- */
- public void setRowHeight(int height)
- {
- rowHeight = height;
- }
-
- /**
- * getRowHeight
- *
- * @return the row height
- */
- public int getRowHeight()
- {
- return rowHeight;
- }
-
- /**
- * setSelectionModel
- *
- * @param model the model
- */
- public void setSelectionModel(TreeSelectionModel model)
- {
- treeSelectionModel = model;
- }
-
- /**
- * getSelectionModel
- *
- * @return the model
- */
- public TreeSelectionModel getSelectionModel()
- {
- return treeSelectionModel;
- }
-
- /**
- * getPreferredHeight
- *
- * @return int
- */
- public int getPreferredHeight()
- {
- return 0; // TODO
- }
-
- /**
- * getPreferredWidth
- *
- * @param value0 TODO
- *
- * @return int
- */
- public int getPreferredWidth(Rectangle value0)
- {
- return 0; // TODO
- }
-
- /**
- * isExpanded
- *
- * @param value0 TODO
- *
- * @return boolean
- */
- public abstract boolean isExpanded(TreePath value0);
-
- /**
- * getBounds
- *
- * @param value0 TODO
- * @param value1 TODO
- *
- * @return Rectangle
- */
- public abstract Rectangle getBounds(TreePath value0, Rectangle value1);
-
- /**
- * getPathForRow
- *
- * @param row the row
- *
- * @return the tree path
- */
- public abstract TreePath getPathForRow(int row);
-
- /**
- * getRowForPath
- *
- * @param path the tree path
- *
- * @return the row
- */
- public abstract int getRowForPath(TreePath path);
-
- /**
- * getPathClosestTo
- *
- * @param value0 TODO
- * @param value1 TODO
- *
- * @return the tree path
- */
- public abstract TreePath getPathClosestTo(int value0, int value1);
-
- /**
- * getVisiblePathsFrom
- *
- * @param path the tree path
- *
- * @return Enumeration
- */
- public abstract Enumeration getVisiblePathsFrom(TreePath path);
-
- /**
- * getVisibleChildCount
- *
- * @param path the tree path
- *
- * @return int
- */
- public abstract int getVisibleChildCount(TreePath value0);
-
- /**
- * setExpandedState
- *
- * @param value0 TODO
- *
- * @param value1 TODO
- */
- public abstract void setExpandedState(TreePath value0, boolean value1);
-
- /**
- * getExpandedState
- *
- * @param path the tree path
- *
- * @return boolean
- */
- public abstract boolean getExpandedState(TreePath path);
-
- /**
- * getRowCount
- *
- * @return the number of rows
- */
- public abstract int getRowCount();
-
- /**
- * invalidateSizes
- */
- public abstract void invalidateSizes();
-
- /**
- * invalidatePathBounds
- *
- * @param path the tree path
- */
- public abstract void invalidatePathBounds(TreePath path);
-
- /**
- * treeNodesChanged
- *
- * @param event the event to send
- */
- public abstract void treeNodesChanged(TreeModelEvent event);
-
- /**
- * treeNodesInserted
- *
- * @param event the event to send
- */
- public abstract void treeNodesInserted(TreeModelEvent event);
-
- /**
- * treeNodesRemoved
- *
- * @param event the event to send
- */
- public abstract void treeNodesRemoved(TreeModelEvent event);
-
- /**
- * treeStructureChanged
- *
- * @param event the event to send
- */
- public abstract void treeStructureChanged(TreeModelEvent event);
-
- /**
- * getRowsForPaths
- *
- * @param paths the tree paths
- *
- * @return an array of rows
- */
- public int[] getRowsForPaths(TreePath[] paths)
- {
- return null; // TODO
- }
-
- /**
- * isFixedRowHeight
- *
- * @return boolean
- */
- protected boolean isFixedRowHeight()
- {
- return false; // TODO
- }
-}
diff --git a/libjava/javax/swing/tree/DefaultMutableTreeNode.java b/libjava/javax/swing/tree/DefaultMutableTreeNode.java
deleted file mode 100644
index ed86cb3c054..00000000000
--- a/libjava/javax/swing/tree/DefaultMutableTreeNode.java
+++ /dev/null
@@ -1,954 +0,0 @@
-/* DefaultMutableTreeNode.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import gnu.java.util.EmptyEnumeration;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Stack;
-import java.util.Vector;
-
-/**
- * DefaultMutableTreeNode
- *
- * @author Andrew Selkirk
- */
-public class DefaultMutableTreeNode
- implements Cloneable, MutableTreeNode, Serializable
-{
- private static final long serialVersionUID = -4298474751201349152L;
-
- /**
- * EMPTY_ENUMERATION
- */
- public static final Enumeration EMPTY_ENUMERATION =
- EmptyEnumeration.getInstance();
-
- /**
- * parent
- */
- protected MutableTreeNode parent;
-
- /**
- * children
- */
- protected Vector children = new Vector();
-
- /**
- * userObject
- */
- protected transient Object userObject;
-
- /**
- * allowsChildren
- */
- protected boolean allowsChildren;
-
- /**
- * Creates a <code>DefaultMutableTreeNode</code> object.
- * This node allows to add child nodes.
- */
- public DefaultMutableTreeNode()
- {
- this(null, true);
- }
-
- /**
- * Creates a <code>DefaultMutableTreeNode</code> object with the given
- * user object attached to it. This node allows to add child nodes.
- *
- * @param userObject the user object
- */
- public DefaultMutableTreeNode(Object userObject)
- {
- this(userObject, true);
- }
-
- /**
- * Creates a <code>DefaultMutableTreeNode</code> object with the given
- * user object attached to it.
- *
- * @param userObject the user object
- * @param allowsChildren <code>true</code> if the code allows to add child
- * nodes, <code>false</code> otherwise
- */
- public DefaultMutableTreeNode(Object userObject, boolean allowsChildren)
- {
- this.userObject = userObject;
- this.allowsChildren = allowsChildren;
- }
-
- /**
- * clone
- *
- * @return Object
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- // TODO: Do we need to do more here ?
- }
- catch (CloneNotSupportedException e)
- {
- // This never happens.
- return null;
- }
- }
-
- /**
- * Returns a string representation of this node
- *
- * @return a human-readable String representing this node
- */
- public String toString()
- {
- if (userObject == null)
- return null;
-
- return userObject.toString();
- }
-
- /**
- * Adds a new child node to this node.
- *
- * @param child the child node
- *
- * @throws IllegalArgumentException if <code>child</code> is null
- * @throws IllegalStateException if the node does not allow children
- */
- public void add(MutableTreeNode child)
- {
- if (child == null)
- throw new IllegalArgumentException();
-
- if (! allowsChildren)
- throw new IllegalStateException();
-
- children.add(child);
- child.setParent(this);
- }
-
- /**
- * Returns the parent node of this node.
- *
- * @return the parent node
- */
- public TreeNode getParent()
- {
- return parent;
- }
-
- /**
- * Removes the child with the given index from this node
- *
- * @param index the index
- */
- public void remove(int index)
- {
- children.remove(index);
- }
-
- /**
- * Removes the given child from this node.
- *
- * @param node the child node
- */
- public void remove(MutableTreeNode node)
- {
- children.remove(node);
- }
-
- /**
- * writeObject
- *
- * @param stream the output stream
- *
- * @exception IOException If an error occurs
- */
- private void writeObject(ObjectOutputStream stream)
- throws IOException
- {
- // TODO: Implement me.
- }
-
- /**
- * readObject
- *
- * @param stream the input stream
- *
- * @exception IOException If an error occurs
- * @exception ClassNotFoundException TODO
- */
- private void readObject(ObjectInputStream stream)
- throws IOException, ClassNotFoundException
- {
- // TODO: Implement me.
- }
-
- /**
- * Inserts given child node at the given index.
- *
- * @param node the child node
- * @param value the index.
- */
- public void insert(MutableTreeNode node, int index)
- {
- children.insertElementAt(node, index);
- }
-
- /**
- * Returns a path to this node from the root.
- *
- * @return an array of tree nodes
- */
- public TreeNode[] getPath()
- {
- return getPathToRoot(this, 0);
- }
-
- /**
- * Returns an enumeration containing all children of this node.
- * <code>EMPTY_ENUMERATION</code> is returned if this node has no children.
- *
- * @return an enumeration of tree nodes
- */
- public Enumeration children()
- {
- if (children.size() == 0)
- return EMPTY_ENUMERATION;
-
- return children.elements();
- }
-
- /**
- * Set the parent node for this node.
- *
- * @param node the parent node
- */
- public void setParent(MutableTreeNode node)
- {
- parent = node;
- }
-
- /**
- * Returns the child node at a given index.
- *
- * @param index the index
- *
- * @return the child node
- */
- public TreeNode getChildAt(int index)
- {
- return (TreeNode) children.elementAt(index);
- }
-
- /**
- * Returns the number of children of this node.
- *
- * @return the number of children
- */
- public int getChildCount()
- {
- return children.size();
- }
-
- /**
- * Returns the child index for a given node.
- *
- * @param node this node
- *
- * @return the index
- */
- public int getIndex(TreeNode node)
- {
- return children.indexOf(node);
- }
-
- /**
- * setAllowsChildren
- *
- * @param allowsChildren TODO
- */
- public void setAllowsChildren(boolean allowsChildren)
- {
- this.allowsChildren = allowsChildren;
- }
-
- /**
- * getAllowsChildren
- *
- * @return boolean
- */
- public boolean getAllowsChildren()
- {
- return allowsChildren;
- }
-
- /**
- * Sets the user object for this node
- *
- * @param userObject the user object
- */
- public void setUserObject(Object userObject)
- {
- this.userObject = userObject;
- }
-
- /**
- * Returns the user object attached to this node. <code>null</code> is
- * returned when no user object is set.
- *
- * @return the user object
- */
- public Object getUserObject()
- {
- return userObject;
- }
-
- /**
- * Removes this node from its parent.
- */
- public void removeFromParent()
- {
- // FIXME: IS this implementation really correct ?
- parent = null;
- }
-
- /**
- * Removes all child nodes from this node.
- */
- public void removeAllChildren()
- {
- children.removeAllElements();
- }
-
- /**
- * isNodeAncestor
- *
- * @param node TODO
- *
- * @return boolean
- */
- public boolean isNodeAncestor(TreeNode node)
- {
- if (node == null)
- return false;
-
- TreeNode current = this;
-
- while (current != null
- && current != node)
- current = current.getParent();
-
- return current == node;
- }
-
- /**
- * isNodeDescendant
- *
- * @param node0 TODO
- *
- * @return boolean
- */
- public boolean isNodeDescendant(DefaultMutableTreeNode node)
- {
- if (node == null)
- return false;
-
- TreeNode current = node;
-
- while (current != null
- && current != this)
- current = current.getParent();
-
- return current == this;
- }
-
- /**
- * getSharedAncestor
- *
- * @param node TODO
- *
- * @return TreeNode
- */
- public TreeNode getSharedAncestor(DefaultMutableTreeNode node)
- {
- TreeNode current = this;
- ArrayList list = new ArrayList();
-
- while (current != null)
- {
- list.add(current);
- current = current.getParent();
- }
-
- current = node;
-
- while (current != null)
- {
- if (list.contains(current))
- return current;
-
- current = current.getParent();
- }
-
- return null;
- }
-
- /**
- * isNodeRelated
- *
- * @param node TODO
- *
- * @return boolean
- */
- public boolean isNodeRelated(DefaultMutableTreeNode node)
- {
- if (node == null)
- return false;
-
- return node.getRoot() == getRoot();
- }
-
- /**
- * getDepth
- *
- * @return int
- */
- public int getDepth()
- {
- if ((! allowsChildren)
- || children.size() == 0)
- return 0;
-
- Stack stack = new Stack();
- stack.push(new Integer(0));
- TreeNode node = getChildAt(0);
- int depth = 0;
- int current = 1;
-
- while (! stack.empty())
- {
- if (node.getChildCount() != 0)
- {
- node = node.getChildAt(0);
- stack.push(new Integer(0));
- current++;
- }
- else
- {
- if (current > depth)
- depth = current;
-
- int size;
- int index;
-
- do
- {
- node = node.getParent();
- size = node.getChildCount();
- index = ((Integer) stack.pop()).intValue() + 1;
- current--;
- }
- while (index >= size
- && node != this);
-
- if (index < size)
- {
- node = node.getChildAt(index);
- stack.push(new Integer(index));
- current++;
- }
- }
- }
-
- return depth;
- }
-
- /**
- * getLevel
- *
- * @return int
- */
- public int getLevel()
- {
- int count = -1;
- TreeNode current = this;
-
- do
- {
- current = current.getParent();
- count++;
- }
- while (current != null);
-
- return count;
- }
-
- /**
- * getPathToRoot
- *
- * @param node TODO
- * @param depth TODO
- *
- * @return TreeNode[]
- */
- protected TreeNode[] getPathToRoot(TreeNode node, int depth)
- {
- if (node == null)
- {
- if (depth == 0)
- return null;
-
- return new TreeNode[depth];
- }
-
- TreeNode[] path = getPathToRoot(node.getParent(), depth + 1);
- path[path.length - depth - 1] = node;
- return path;
- }
-
- /**
- * getUserObjectPath
- *
- * @return Object[]
- */
- public Object[] getUserObjectPath()
- {
- TreeNode[] path = getPathToRoot(this, 0);
- Object[] object = new Object[path.length];
-
- for (int index = 0; index < path.length; ++index)
- object[index] = ((DefaultMutableTreeNode) path[index]).getUserObject();
-
- return object;
- }
-
- /**
- * Returns the root node by iterating the parents of this node.
- *
- * @return the root node
- */
- public TreeNode getRoot()
- {
- TreeNode current = this;
- TreeNode check = current.getParent();
-
- while (check != null)
- {
- current = check;
- check = current.getParent();
- }
-
- return current;
- }
-
- /**
- * Tells whether this node is the root node or not.
- *
- * @return <code>true</code> if this is the root node,
- * <code>false</code>otherwise
- */
- public boolean isRoot()
- {
- return parent == null;
- }
-
- /**
- * getNextNode
- *
- * @return DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getNextNode()
- {
- // Return first child.
- if (getChildCount() != 0)
- return (DefaultMutableTreeNode) getChildAt(0);
-
- // Return next sibling (if needed the sibling of some parent).
- DefaultMutableTreeNode node = this;
- DefaultMutableTreeNode sibling;
-
- do
- {
- sibling = node.getNextSibling();
- node = (DefaultMutableTreeNode) node.getParent();
- }
- while (sibling == null &&
- node != null);
-
- // Return sibling.
- return sibling;
- }
-
- /**
- * getPreviousNode
- *
- * @return DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getPreviousNode()
- {
- // Return null if no parent.
- if (parent == null)
- return null;
-
- DefaultMutableTreeNode sibling = getPreviousSibling();
-
- // Return parent if no sibling.
- if (sibling == null)
- return (DefaultMutableTreeNode) parent;
-
- // Return last leaf of sibling.
- if (sibling.getChildCount() != 0)
- return sibling.getLastLeaf();
-
- // Return sibling.
- return sibling;
- }
-
- /**
- * preorderEnumeration
- *
- * @return Enumeration
- */
- public Enumeration preorderEnumeration()
- {
- return null; // TODO: Implement me.
- }
-
- /**
- * postorderEnumeration
- *
- * @return Enumeration
- */
- public Enumeration postorderEnumeration()
- {
- return null; // TODO: Implement me.
- }
-
- /**
- * breadthFirstEnumeration
- *
- * @return Enumeration
- */
- public Enumeration breadthFirstEnumeration()
- {
- return null; // TODO: Implement me.
- }
-
- /**
- * depthFirstEnumeration
- *
- * @return Enumeration
- */
- public Enumeration depthFirstEnumeration()
- {
- return postorderEnumeration();
- }
-
- /**
- * pathFromAncestorEnumeration
- *
- * @param node TODO
- *
- * @return Enumeration
- */
- public Enumeration pathFromAncestorEnumeration(TreeNode node)
- {
- if (node == null)
- throw new IllegalArgumentException();
-
- TreeNode parent = this;
- Vector nodes = new Vector();
- nodes.add(this);
-
- while (parent != node && parent != null)
- {
- parent = parent.getParent();
- nodes.add(0, parent);
- }
-
- if (parent != node)
- throw new IllegalArgumentException();
-
- return nodes.elements();
- }
-
- /**
- * isNodeChild
- *
- * @param node TODO
- *
- * @return boolean
- */
- public boolean isNodeChild(TreeNode node)
- {
- if (node == null)
- return false;
-
- return node.getParent() == this;
- }
-
- /**
- * getFirstChild
- *
- * @return TreeNode
- */
- public TreeNode getFirstChild()
- {
- return (TreeNode) children.firstElement();
- }
-
- /**
- * getLastChild
- *
- * @return TreeNode
- */
- public TreeNode getLastChild()
- {
- return (TreeNode) children.lastElement();
- }
-
- /**
- * getChildAfter
- *
- * @param node TODO
- *
- * @return TreeNode
- */
- public TreeNode getChildAfter(TreeNode node)
- {
- if (node == null
- || node.getParent() != this)
- throw new IllegalArgumentException();
-
- int index = getIndex(node) + 1;
-
- if (index == getChildCount())
- return null;
-
- return getChildAt(index);
- }
-
- /**
- * getChildBefore
- *
- * @param node TODO
- *
- * @return TreeNode
- */
- public TreeNode getChildBefore(TreeNode node)
- {
- if (node == null
- || node.getParent() != this)
- throw new IllegalArgumentException();
-
- int index = getIndex(node) - 1;
-
- if (index < 0)
- return null;
-
- return getChildAt(index);
- }
-
- /**
- * isNodeSibling
- *
- * @param node TODO
- *
- * @return boolean
- */
- public boolean isNodeSibling(TreeNode node)
- {
- if (node == null)
- return false;
-
- return (node.getParent() == getParent()
- && getParent() != null);
- }
-
- /**
- * getSiblingCount
- *
- * @return int
- */
- public int getSiblingCount()
- {
- if (parent == null)
- return 1;
-
- return parent.getChildCount();
- }
-
- /**
- * getNextSibling
- *
- * @return DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getNextSibling()
- {
- if (parent == null)
- return null;
-
- int index = parent.getIndex(this) + 1;
-
- if (index == parent.getChildCount())
- return null;
-
- return (DefaultMutableTreeNode) parent.getChildAt(index);
- }
-
- /**
- * getPreviousSibling
- *
- * @return DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getPreviousSibling()
- {
- if (parent == null)
- return null;
-
- int index = parent.getIndex(this) - 1;
-
- if (index < 0)
- return null;
-
- return (DefaultMutableTreeNode) parent.getChildAt(index);
- }
-
- /**
- * isLeaf
- *
- * @return boolean
- */
- public boolean isLeaf()
- {
- return children.size() == 0;
- }
-
- /**
- * getFirstLeaf
- *
- * @return DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getFirstLeaf()
- {
- TreeNode current = this;
-
- while (current.getChildCount() > 0)
- current = current.getChildAt(0);
-
- return (DefaultMutableTreeNode) current;
- }
-
- /**
- * getLastLeaf
- *
- * @return DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getLastLeaf()
- {
- TreeNode current = this;
- int size = current.getChildCount();
-
- while (size > 0)
- {
- current = current.getChildAt(size - 1);
- size = current.getChildCount();
- }
-
- return (DefaultMutableTreeNode) current;
- }
-
- /**
- * getNextLeaf
- *
- * @return DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getNextLeaf()
- {
- if (parent == null)
- return null;
-
- return null;
- //return parent.getChildAfter(this);
- }
-
- /**
- * getPreviousLeaf
- *
- * @return DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getPreviousLeaf()
- {
- if (parent == null)
- return null;
-
- return null;
- //return parent.getChildBefore(this);
- }
-
- /**
- * getLeafCount
- *
- * @return int
- */
- public int getLeafCount()
- {
- int count = 0;
- Enumeration e = depthFirstEnumeration();
-
- while (e.hasMoreElements())
- {
- TreeNode current = (TreeNode) e.nextElement();
-
- if (current.isLeaf())
- count++;
- }
-
- return count;
- }
-}
diff --git a/libjava/javax/swing/tree/DefaultTreeCellEditor.java b/libjava/javax/swing/tree/DefaultTreeCellEditor.java
deleted file mode 100644
index e509d2c18e0..00000000000
--- a/libjava/javax/swing/tree/DefaultTreeCellEditor.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/* DefaultTreeCellEditor.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.Graphics;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.EventObject;
-
-import javax.swing.Icon;
-import javax.swing.JTextField;
-import javax.swing.JTree;
-import javax.swing.border.Border;
-import javax.swing.event.CellEditorListener;
-import javax.swing.event.EventListenerList;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-
-/**
- * DefaultTreeCellEditor
- * @author Andrew Selkirk
- */
-public class DefaultTreeCellEditor
- implements ActionListener, TreeCellEditor, TreeSelectionListener
-{
- /**
- * EditorContainer
- */
- public class EditorContainer extends Container
- {
- /**
- * Creates an <code>EditorContainer</code> object.
- */
- public EditorContainer()
- {
- // Do nothing here.
- }
-
- /**
- * This method only exists for API compatibility and is useless as it does
- * nothing. It got probably introduced by accident.
- */
- public void EditorContainer()
- {
- // Do nothing here.
- }
-
- /**
- * getPreferredSize
- * @return Dimension
- */
- public Dimension getPreferredSize()
- {
- return null; // TODO
- }
-
- /**
- * paint
- * @param value0 TODO
- */
- public void paint(Graphics value0)
- {
- // TODO
- }
-
- /**
- * doLayout
- */
- public void doLayout()
- {
- // TODO
- }
- }
-
- /**
- * DefaultTextField
- */
- public class DefaultTextField extends JTextField
- {
- /**
- * border
- */
- protected Border border;
-
- /**
- * Creates a <code>DefaultTextField</code> object.
- *
- * @param border the border to use
- */
- public DefaultTextField(Border border)
- {
- this.border = border;
- }
-
- /**
- * getFont
- * @return Font
- */
- public Font getFont()
- {
- return null; // TODO
- }
-
- /**
- * Returns the border of the text field.
- *
- * @return the border
- */
- public Border getBorder()
- {
- return border;
- }
-
- /**
- * getPreferredSize
- * @return Dimension
- */
- public Dimension getPreferredSize()
- {
- return null; // TODO
- }
- }
-
- private EventListenerList listenerList = new EventListenerList();
-
- /**
- * realEditor
- */
- protected TreeCellEditor realEditor;
-
- /**
- * renderer
- */
- protected DefaultTreeCellRenderer renderer;
-
- /**
- * editingContainer
- */
- protected Container editingContainer;
-
- /**
- * editingComponent
- */
- protected transient Component editingComponent;
-
- /**
- * canEdit
- */
- protected boolean canEdit;
-
- /**
- * offset
- */
- protected transient int offset;
-
- /**
- * tree
- */
- protected transient JTree tree;
-
- /**
- * lastPath
- */
- protected transient TreePath lastPath;
-
- /**
- * timer
- */
- protected transient javax.swing.Timer timer; // TODO
-
- /**
- * lastRow
- */
- protected transient int lastRow;
-
- /**
- * borderSelectionColor
- */
- protected Color borderSelectionColor;
-
- /**
- * editingIcon
- */
- protected transient Icon editingIcon;
-
- /**
- * font
- */
- protected Font font;
-
- /**
- * Constructor DefaultTreeCellEditor
- * @param value0 TODO
- * @param value1 TODO
- */
- public DefaultTreeCellEditor(JTree value0, DefaultTreeCellRenderer value1)
- {
- // TODO
- }
-
- /**
- * Constructor DefaultTreeCellEditor
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public DefaultTreeCellEditor(JTree value0, DefaultTreeCellRenderer value1,
- TreeCellEditor value2)
- {
- // TODO
- }
-
- /**
- * writeObject
- * @param value0 TODO
- * @exception IOException TODO
- */
- private void writeObject(ObjectOutputStream value0) throws IOException
- {
- // TODO
- }
-
- /**
- * readObject
- * @param value0 TODO
- * @exception IOException TODO
- * @exception ClassNotFoundException TODO
- */
- private void readObject(ObjectInputStream value0)
- throws IOException, ClassNotFoundException
- {
- // TODO
- }
-
- /**
- * setBorderSelectionColor
- * @param value0 TODO
- */
- public void setBorderSelectionColor(Color value0)
- {
- // TODO
- }
-
- /**
- * getBorderSelectionColor
- * @return Color
- */
- public Color getBorderSelectionColor()
- {
- return null; // TODO
- }
-
- /**
- * setFont
- * @param value0 TODO
- */
- public void setFont(Font value0)
- {
- // TODO
- }
-
- /**
- * getFont
- * @return Font
- */
- public Font getFont()
- {
- return null; // TODO
- }
-
- /**
- * getTreeCellEditorComponent
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- * @param value3 TODO
- * @param value4 TODO
- * @param value5 TODO
- * @return Component
- */
- public Component getTreeCellEditorComponent(JTree value0, Object value1,
- boolean value2, boolean value3,
- boolean value4, int value5)
- {
- return null; // TODO
- }
-
- /**
- * getCellEditorValue
- * @return Object
- */
- public Object getCellEditorValue()
- {
- return null; // TODO
- }
-
- /**
- * isCellEditable
- * @param value0 TODO
- * @return boolean
- */
- public boolean isCellEditable(EventObject value0)
- {
- return false; // TODO
- }
-
- /**
- * shouldSelectCell
- * @param value0 TODO
- * @return boolean
- */
- public boolean shouldSelectCell(EventObject value0)
- {
- return false; // TODO
- }
-
- /**
- * stopCellEditing
- * @return boolean
- */
- public boolean stopCellEditing()
- {
- return false; // TODO
- }
-
- /**
- * cancelCellEditing
- */
- public void cancelCellEditing()
- {
- // TODO
- }
-
- /**
- * Adds a <code>CellEditorListener</code> object to this editor.
- *
- * @param listener the listener to add
- */
- public void addCellEditorListener(CellEditorListener listener)
- {
- listenerList.add(CellEditorListener.class, listener);
- }
-
- /**
- * Removes a <code>CellEditorListener</code> object.
- *
- * @param listener the listener to remove
- */
- public void removeCellEditorListener(CellEditorListener listener)
- {
- listenerList.remove(CellEditorListener.class, listener);
- }
-
- /**
- * Returns all added <code>CellEditorListener</code> objects to this editor.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public CellEditorListener[] getCellEditorListeners()
- {
- return (CellEditorListener[]) listenerList.getListeners(CellEditorListener.class);
- }
-
- /**
- * valueChanged
- * @param value0 TODO
- */
- public void valueChanged(TreeSelectionEvent value0)
- {
- // TODO
- }
-
- /**
- * actionPerformed
- * @param value0 TODO
- */
- public void actionPerformed(ActionEvent value0)
- {
- // TODO
- }
-
- /**
- * setTree
- * @param value0 TODO
- */
- protected void setTree(JTree value0)
- {
- // TODO
- }
-
- /**
- * shouldStartEditingTimer
- * @param value0 TODO
- * @return boolean
- */
- protected boolean shouldStartEditingTimer(EventObject value0)
- {
- return false; // TODO
- }
-
- /**
- * startEditingTimer
- */
- protected void startEditingTimer()
- {
- // TODO
- }
-
- /**
- * canEditImmediately
- * @param value0 TODO
- * @return boolean
- */
- protected boolean canEditImmediately(EventObject value0)
- {
- return false; // TODO
- }
-
- /**
- * inHitRegion
- * @param value0 TODO
- * @param value1 TODO
- * @return boolean
- */
- protected boolean inHitRegion(int value0, int value1)
- {
- return false; // TODO
- }
-
- /**
- * determineOffset
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- * @param value3 TODO
- * @param value4 TODO
- * @param value5 TODO
- */
- protected void determineOffset(JTree value0, Object value1, boolean value2,
- boolean value3, boolean value4, int value5)
- {
- // TODO
- }
-
- /**
- * prepareForEditing
- */
- protected void prepareForEditing()
- {
- // TODO
- }
-
- /**
- * createContainer
- * @return Container
- */
- protected Container createContainer()
- {
- return null; // TODO
- }
-
- /**
- * createTreeCellEditor
- * @return TreeCellEditor
- */
- protected TreeCellEditor createTreeCellEditor()
- {
- return null; // TODO
- }
-}
diff --git a/libjava/javax/swing/tree/DefaultTreeCellRenderer.java b/libjava/javax/swing/tree/DefaultTreeCellRenderer.java
deleted file mode 100644
index 690ad5bf39c..00000000000
--- a/libjava/javax/swing/tree/DefaultTreeCellRenderer.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/* DefaultTreeCellRenderer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-
-import javax.swing.Icon;
-import javax.swing.JLabel;
-import javax.swing.JTree;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import javax.swing.plaf.UIResource;
-
-/**
- * DefaultTreeCellRenderer
- * @author Andrew Selkirk
- */
-public class DefaultTreeCellRenderer
- extends JLabel
- implements TreeCellRenderer
-{
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * selected
- */
- protected boolean selected;
-
- /**
- * hasFocus
- */
- protected boolean hasFocus;
-
- /**
- * drawsFocusBorderAroundIcon
- */
- private boolean drawsFocusBorderAroundIcon;
-
- /**
- * closedIcon
- */
- protected transient Icon closedIcon;
-
- /**
- * leafIcon
- */
- protected transient Icon leafIcon;
-
- /**
- * openIcon
- */
- protected transient Icon openIcon;
-
- /**
- * textSelectionColor
- */
- protected Color textSelectionColor;
-
- /**
- * textNonSelectionColor
- */
- protected Color textNonSelectionColor;
-
- /**
- * backgroundSelectionColor
- */
- protected Color backgroundSelectionColor;
-
- /**
- * backgroundNonSelectionColor
- */
- protected Color backgroundNonSelectionColor;
-
- /**
- * borderSelectionColor
- */
- protected Color borderSelectionColor;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor DefaultTreeCellRenderer
- */
- public DefaultTreeCellRenderer() {
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- setLeafIcon(getDefaultLeafIcon());
- setOpenIcon(getDefaultOpenIcon());
- setClosedIcon(getDefaultClosedIcon());
-
- setTextNonSelectionColor(defaults.getColor("Tree.textForeground"));
- setTextSelectionColor(defaults.getColor("Tree.selectionForeground"));
- setBackgroundNonSelectionColor(defaults.getColor("Tree.textBackground"));
- setBackgroundSelectionColor(defaults.getColor("Tree.selectionBackground"));
- setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor"));
- }
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getDefaultOpenIcon
- * @returns Icon
- */
- public Icon getDefaultOpenIcon() {
- return UIManager.getLookAndFeelDefaults().getIcon("Tree.openIcon");
- }
-
- /**
- * getDefaultClosedIcon
- * @returns Icon
- */
- public Icon getDefaultClosedIcon() {
- return UIManager.getLookAndFeelDefaults().getIcon("Tree.closedIcon");
- }
-
- /**
- * getDefaultLeafIcon
- * @returns Icon
- */
- public Icon getDefaultLeafIcon() {
- return UIManager.getLookAndFeelDefaults().getIcon("Tree.leafIcon");
- }
-
- /**
- * setOpenIcon
- * @param value0 TODO
- */
- public void setOpenIcon(Icon i) {
- openIcon = i;
- }
-
- /**
- * getOpenIcon
- * @returns Icon
- */
- public Icon getOpenIcon() {
- return openIcon;
- }
-
- /**
- * setClosedIcon
- * @param value0 TODO
- */
- public void setClosedIcon(Icon i) {
- closedIcon = i;
- }
-
- /**
- * getClosedIcon
- * @returns Icon
- */
- public Icon getClosedIcon() {
- return closedIcon;
- }
-
- /**
- * setLeafIcon
- * @param value0 TODO
- */
- public void setLeafIcon(Icon i) {
- leafIcon = i;
- }
-
- /**
- * getLeafIcon
- * @returns Icon
- */
- public Icon getLeafIcon() {
- return leafIcon;
- }
-
- /**
- * setTextSelectionColor
- * @param value0 TODO
- */
- public void setTextSelectionColor(Color c) {
- textSelectionColor = c;
- }
-
- /**
- * getTextSelectionColor
- * @returns Color
- */
- public Color getTextSelectionColor() {
- return textSelectionColor;
- }
-
- /**
- * setTextNonSelectionColor
- * @param value0 TODO
- */
- public void setTextNonSelectionColor(Color c) {
- textNonSelectionColor = c;
- }
-
- /**
- * getTextNonSelectionColor
- * @returns Color
- */
- public Color getTextNonSelectionColor() {
- return textNonSelectionColor;
- }
-
- /**
- * setBackgroundSelectionColor
- * @param value0 TODO
- */
- public void setBackgroundSelectionColor(Color c) {
- backgroundSelectionColor = c;
- }
-
- /**
- * getBackgroundSelectionColor
- * @returns Color
- */
- public Color getBackgroundSelectionColor() {
- return backgroundSelectionColor;
- }
-
- /**
- * setBackgroundNonSelectionColor
- * @param value0 TODO
- */
- public void setBackgroundNonSelectionColor(Color c) {
- backgroundNonSelectionColor = c;
- }
-
- /**
- * getBackgroundNonSelectionColor
- * @returns Color
- */
- public Color getBackgroundNonSelectionColor() {
- return backgroundNonSelectionColor;
- }
-
- /**
- * setBorderSelectionColor
- * @param value0 TODO
- */
- public void setBorderSelectionColor(Color c) {
- borderSelectionColor = c;
- }
-
- /**
- * getBorderSelectionColor
- * @returns Color
- */
- public Color getBorderSelectionColor() {
- return borderSelectionColor;
- }
-
- /**
- * setFont
- * @param value0 TODO
- */
- public void setFont(Font f) {
- if (f != null && f instanceof UIResource)
- f = null;
- super.setFont(f);
- }
-
- /**
- * setBackground
- * @param value0 TODO
- */
- public void setBackground(Color c) {
- if (c != null && c instanceof UIResource)
- c = null;
- super.setBackground(c);
- }
-
- /**
- * getTreeCellRendererComponent
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- * @param value3 TODO
- * @param value4 TODO
- * @param value5 TODO
- * @param value6 TODO
- * @returns Component
- */
- public Component getTreeCellRendererComponent(JTree tree,
- Object val,
- boolean selected,
- boolean expanded,
- boolean leaf,
- int row,
- boolean hasFocus) {
- this.selected = selected;
- this.hasFocus = hasFocus;
-
- if (leaf)
- setIcon(getLeafIcon());
- else if (expanded)
- setIcon(getOpenIcon());
- else
- setIcon(getClosedIcon());
-
- setText(val.toString());
- setHorizontalAlignment(LEFT);
- setVerticalAlignment(TOP);
-
- return this;
- }
-
- /**
- * paint
- * @param value0 TODO
- */
- public void paint(Graphics g) {
- super.paint(g);
- }
-
- /**
- * getPreferredSize
- * @returns Dimension
- */
- public Dimension getPreferredSize() {
- return null; // TODO
- } // getPreferredSize()
-
- /**
- * validate
- */
- public void validate() {
- // TODO
- } // validate()
-
- /**
- * revalidate
- */
- public void revalidate() {
- // TODO
- } // revalidate()
-
- /**
- * repaint
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- * @param value3 TODO
- * @param value4 TODO
- */
- public void repaint(long value0, int value1, int value2, int value3, int value4) {
- // TODO
- } // repaint()
-
- /**
- * repaint
- * @param value0 TODO
- */
- public void repaint(Rectangle value0) {
- // TODO
- } // repaint()
-
- /**
- * firePropertyChange
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- protected void firePropertyChange(String value0, Object value1, Object value2) {
- // TODO
- } // firePropertyChange()
-
- /**
- * firePropertyChange
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public void firePropertyChange(String value0, byte value1, byte value2) {
- // TODO
- } // firePropertyChange()
-
- /**
- * firePropertyChange
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public void firePropertyChange(String value0, char value1, char value2) {
- // TODO
- } // firePropertyChange()
-
- /**
- * firePropertyChange
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public void firePropertyChange(String value0, short value1, short value2) {
- // TODO
- } // firePropertyChange()
-
- /**
- * firePropertyChange
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public void firePropertyChange(String value0, int value1, int value2) {
- // TODO
- } // firePropertyChange()
-
- /**
- * firePropertyChange
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public void firePropertyChange(String value0, long value1, long value2) {
- // TODO
- } // firePropertyChange()
-
- /**
- * firePropertyChange
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public void firePropertyChange(String value0, float value1, float value2) {
- // TODO
- } // firePropertyChange()
-
- /**
- * firePropertyChange
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public void firePropertyChange(String value0, double value1, double value2) {
- // TODO
- } // firePropertyChange()
-
- /**
- * firePropertyChange
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public void firePropertyChange(String value0, boolean value1, boolean value2) {
- // TODO
- } // firePropertyChange()
-
-
-} // DefaultTreeCellRenderer
diff --git a/libjava/javax/swing/tree/DefaultTreeModel.java b/libjava/javax/swing/tree/DefaultTreeModel.java
deleted file mode 100644
index 6056d166ac8..00000000000
--- a/libjava/javax/swing/tree/DefaultTreeModel.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/* DefaultTreeModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.EventListener;
-
-import javax.swing.event.EventListenerList;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-
-/**
- * DefaultTreeModel
- * @author Andrew Selkirk
- */
-public class DefaultTreeModel
- implements Serializable, TreeModel
-{
- static final long serialVersionUID = -2621068368932566998L;
-
- /**
- * root
- */
- protected TreeNode root = null;
-
- /**
- * listenerList
- */
- protected EventListenerList listenerList = new EventListenerList();
-
- /**
- * asksAllowsChildren
- */
- protected boolean asksAllowsChildren;
-
- /**
- * Constructor DefaultTreeModel
- * @param value0 TODO
- */
- public DefaultTreeModel(TreeNode root)
- {
- setRoot(root);
- }
-
- /**
- * Constructor DefaultTreeModel
- * @param value0 TODO
- * @param value1 TODO
- */
- public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren)
- {
- setRoot(root);
- this.asksAllowsChildren = asksAllowsChildren;
- }
-
- /**
- * writeObject
- * @param value0 TODO
- * @exception IOException TODO
- */
- private void writeObject(ObjectOutputStream value0) throws IOException
- {
- // TODO
- }
-
- /**
- * readObject
- * @param value0 TODO
- * @exception IOException TODO
- * @exception ClassNotFoundException TODO
- */
- private void readObject(ObjectInputStream value0)
- throws IOException, ClassNotFoundException
- {
- // TODO
- }
-
- /**
- * asksAllowsChildren
- * @return boolean
- */
- public boolean asksAllowsChildren()
- {
- return asksAllowsChildren;
- }
-
- /**
- * setAsksAllowsChildren
- * @param value0 TODO
- */
- public void setAsksAllowsChildren(boolean value)
- {
- asksAllowsChildren = value; // TODO
- }
-
- /**
- * setRoot
- * @param value0 TODO
- */
- public void setRoot(TreeNode root)
- {
- // Sanity Check
- if (root == null)
- {
- throw new IllegalArgumentException("null root");
- }
- // Set new root
- this.root = root;
-
- // TODO
- }
-
- /**
- * getRoot
- * @return Object
- */
- public Object getRoot()
- {
- return root;
- }
-
- /**
- * getIndexOfChild
- * @param value0 TODO
- * @param value1 TODO
- * @return int
- */
- public int getIndexOfChild(Object parent, Object child)
- {
- return 0; // TODO
- }
-
- /**
- * getChild
- * @param value0 TODO
- * @param value1 TODO
- * @return Object
- */
- public Object getChild(Object node, int idx)
- {
- if (node instanceof TreeNode)
- return ((TreeNode)node).getChildAt(idx);
- else
- return null;
- }
-
- /**
- * getChildCount
- * @param value0 TODO
- * @return int
- */
- public int getChildCount(Object node)
- {
- if (node instanceof TreeNode)
- return ((TreeNode)node).getChildCount();
- else
- return 0;
- }
-
- /**
- * isLeaf
- * @param value0 TODO
- * @return boolean
- */
- public boolean isLeaf(Object node)
- {
- if (node instanceof TreeNode)
- return ((TreeNode)node).isLeaf();
- else
- return true;
- }
-
- /**
- * reload
- */
- public void reload()
- {
- // TODO
- }
-
- /**
- * reload
- * @param value0 TODO
- */
- public void reload(TreeNode value0)
- {
- // TODO
- }
-
- /**
- * valueForPathChanged
- * @param value0 TODO
- * @param value1 TODO
- */
- public void valueForPathChanged(TreePath value0, Object value1)
- {
- // TODO
- }
-
- /**
- * insertNodeInto
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public void insertNodeInto(MutableTreeNode value0, MutableTreeNode value1,
- int value2)
- {
- // TODO
- }
-
- /**
- * removeNodeFromParent
- * @param value0 TODO
- */
- public void removeNodeFromParent(MutableTreeNode value0)
- {
- // TODO
- }
-
- /**
- * nodeChanged
- * @param value0 TODO
- */
- public void nodeChanged(TreeNode value0)
- {
- // TODO
- }
-
- /**
- * nodesWereInserted
- * @param value0 TODO
- * @param value1 TODO
- */
- public void nodesWereInserted(TreeNode value0, int[] value1)
- {
- // TODO
- }
-
- /**
- * nodesWereRemoved
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
- public void nodesWereRemoved(TreeNode value0, int[] value1, Object[] value2)
- {
- // TODO
- }
-
- /**
- * nodesChanged
- * @param value0 TODO
- * @param value1 TODO
- */
- public void nodesChanged(TreeNode value0, int[] value1)
- {
- // TODO
- }
-
- /**
- * nodeStructureChanged
- * @param value0 TODO
- */
- public void nodeStructureChanged(TreeNode value0)
- {
- // TODO
- }
-
- /**
- * getPathToRoot
- * @param value0 TODO
- * @return TreeNode[]
- */
- public TreeNode[] getPathToRoot(TreeNode value0)
- {
- return null; // TODO
- }
-
- /**
- * getPathToRoot
- * @param value0 TODO
- * @param value1 TODO
- * @return TreeNode[]
- */
- protected TreeNode[] getPathToRoot(TreeNode value0, int value1)
- {
- return null; // TODO
- }
-
- /**
- * Registers a listere to the model.
- *
- * @param listener the listener to add
- */
- public void addTreeModelListener(TreeModelListener listener)
- {
- listenerList.add(TreeModelListener.class, listener);
- }
-
- /**
- * Removes a listener from the model.
- *
- * @param listener the listener to remove
- */
- public void removeTreeModelListener(TreeModelListener listener)
- {
- listenerList.remove(TreeModelListener.class, listener);
- }
-
- /**
- * Returns all registered <code>TreeModelListener</code> listeners.
- *
- * @return an array of listeners.
- *
- * @since 1.4
- */
- public TreeModelListener[] getTreeModelListeners()
- {
- return (TreeModelListener[]) listenerList.getListeners(TreeModelListener.class);
- }
-
- /**
- * fireTreeNodesChanged
- *
- * @param source the node being changed
- * @param path the path to the root node
- * @param childIndices the indices of the changed elements
- * @param children the changed elements
- */
- protected void fireTreeNodesChanged(Object source, Object[] path,
- int[] childIndices, Object[] children)
- {
- TreeModelEvent event =
- new TreeModelEvent(source, path, childIndices, children);
- TreeModelListener[] listeners = getTreeModelListeners();
-
- for (int i = listeners.length - 1; i >= 0; --i)
- listeners[i].treeNodesChanged(event);
- }
-
- /**
- * fireTreeNodesInserted
- *
- * @param source the node where new nodes got inserted
- * @param path the path to the root node
- * @param childIndices the indices of the new elements
- * @param children the new elements
- */
- protected void fireTreeNodesInserted(Object source, Object[] path,
- int[] childIndices, Object[] children)
- {
- TreeModelEvent event =
- new TreeModelEvent(source, path, childIndices, children);
- TreeModelListener[] listeners = getTreeModelListeners();
-
- for (int i = listeners.length - 1; i >= 0; --i)
- listeners[i].treeNodesInserted(event);
- }
-
- /**
- * fireTreeNodesRemoved
- *
- * @param source the node where nodes got removed-
- * @param path the path to the root node
- * @param childIndices the indices of the removed elements
- * @param children the removed elements
- */
- protected void fireTreeNodesRemoved(Object source, Object[] path,
- int[] childIndices, Object[] children)
- {
- TreeModelEvent event =
- new TreeModelEvent(source, path, childIndices, children);
- TreeModelListener[] listeners = getTreeModelListeners();
-
- for (int i = listeners.length - 1; i >= 0; --i)
- listeners[i].treeNodesRemoved(event);
- }
-
- /**
- * fireTreeStructureChanged
- *
- * @param source the node where the model has changed
- * @param path the path to the root node
- * @param childIndices the indices of the affected elements
- * @param children the affected elements
- */
- protected void fireTreeStructureChanged(Object source, Object[] path,
- int[] childIndices, Object[] children)
- {
- TreeModelEvent event =
- new TreeModelEvent(source, path, childIndices, children);
- TreeModelListener[] listeners = getTreeModelListeners();
-
- for (int i = listeners.length - 1; i >= 0; --i)
- listeners[i].treeStructureChanged(event);
- }
-
- /**
- * Returns the registered listeners of a given type.
- *
- * @param listenerType the listener type to return
- *
- * @return an array of listeners
- *
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-}
diff --git a/libjava/javax/swing/tree/DefaultTreeSelectionModel.java b/libjava/javax/swing/tree/DefaultTreeSelectionModel.java
deleted file mode 100644
index 536a6e7c7c2..00000000000
--- a/libjava/javax/swing/tree/DefaultTreeSelectionModel.java
+++ /dev/null
@@ -1,646 +0,0 @@
-/* DefaultTreeSelectionModel.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.beans.PropertyChangeListener;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.EventListener;
-import java.util.Vector;
-
-import javax.swing.DefaultListSelectionModel;
-import javax.swing.event.EventListenerList;
-import javax.swing.event.SwingPropertyChangeSupport;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-
-/**
- * DefaultTreeSelectionModel
- * @author Andrew Selkirk
- */
-public class DefaultTreeSelectionModel
- implements Cloneable, Serializable, TreeSelectionModel
-{
- static final long serialVersionUID = 3288129636638950196L;
-
- /**
- * SELECTION_MODE_PROPERTY
- */
- public static final String SELECTION_MODE_PROPERTY = "selectionMode";
-
- /**
- * Our Swing property change support.
- */
- protected SwingPropertyChangeSupport changeSupport;
-
- /**
- * The current selection.
- */
- protected TreePath[] selection;
-
- /**
- * Our TreeSelectionListeners.
- */
- protected EventListenerList listenerList;
-
- /**
- * The current RowMapper.
- */
- protected transient RowMapper rowMapper;
-
- /**
- * The current listSelectionModel.
- */
- protected DefaultListSelectionModel listSelectionModel;
-
- /**
- * The current selection mode.
- */
- protected int selectionMode;
-
- /**
- * The path that has been added last.
- */
- protected TreePath leadPath;
-
- /**
- * The index of the last added path.
- */
- protected int leadIndex;
-
- /**
- * The row of the last added path according to the RowMapper.
- */
- protected int leadRow;
-
- /**
- * Constructs a new DefaultTreeSelectionModel.
- */
- public DefaultTreeSelectionModel()
- {
- setSelectionMode(DISCONTIGUOUS_TREE_SELECTION);
- listenerList = new EventListenerList();
- }
-
- /**
- * Creates a clone of this DefaultTreeSelectionModel with the same
- * selection.
- *
- * @exception CloneNotSupportedException should not be thrown here
- *
- * @return a clone of this DefaultTreeSelectionModel
- */
- public Object clone() throws CloneNotSupportedException
- {
- return null; // TODO
- }
-
- /**
- * Returns a string that shows this object's properties.
- *
- * @return a string that shows this object's properties
- */
- public String toString()
- {
- return null; // TODO
- }
-
- /**
- * writeObject
- * @param value0 TODO
- * @exception IOException TODO
- */
- private void writeObject(ObjectOutputStream value0) throws IOException
- {
- // TODO
- }
-
- /**
- * readObject
- * @param value0 TODO
- * @exception IOException TODO
- * @exception ClassNotFoundException TODO
- */
- private void readObject(ObjectInputStream value0)
- throws IOException, ClassNotFoundException
- {
- // TODO
- }
-
- /**
- * Sets the RowMapper that should be used to map between paths and their
- * rows.
- *
- * @param rowMapper the RowMapper to set
- *
- * @see {@link RowMapper
- */
- public void setRowMapper(RowMapper value0)
- {
- // TODO
- }
-
- /**
- * Returns the RowMapper that is currently used to map between paths and
- * their rows.
- *
- * @return the current RowMapper
- *
- * @see {@link RowMapper
- */
- public RowMapper getRowMapper()
- {
- return rowMapper;
- }
-
- /**
- * Sets the current selection mode. Possible values are
- * {@link #SINGLE_TREE_SELECTION}, {@link CONTIGUOUS_TREE_SELECTION}
- * and {@link #DISCONTIGUOUS_TREE_SELECTION}.
- *
- * @param mode the selection mode to be set
- *
- * @see {@link #getSelectionMode}
- * @see {@link #SINGLE_TREE_SELECTION}
- * @see {@link #CONTIGUOUS_TREE_SELECTION}
- * @see {@link #DISCONTIGUOUS_TREE_SELECTION}
- */
- public void setSelectionMode(int mode)
- {
- selectionMode = mode;
- }
-
- /**
- * Returns the current selection mode.
- *
- * @return the current selection mode
- *
- * @see {@link #setSelectionMode}
- * @see {@link #SINGLE_TREE_SELECTION}
- * @see {@link #CONTIGUOUS_TREE_SELECTION}
- * @see {@link #DISCONTIGUOUS_TREE_SELECTION}
- */
- public int getSelectionMode()
- {
- return selectionMode;
- }
-
- /**
- * Sets this path as the only selection.
- *
- * If this changes the selection the registered TreeSelectionListeners
- * are notified.
- *
- * @param path the path to set as selection
- */
- public void setSelectionPath(TreePath path)
- {
- selection = new TreePath[] { path };
- }
-
- /**
- * Sets the paths as selection. This method checks for duplicates and
- * removes them.
- *
- * If this changes the selection the registered TreeSelectionListeners
- * are notified.
- *
- * @param paths the paths to set as selection
- */
- public void setSelectionPaths(TreePath[] value0)
- {
- // TODO
- }
-
- /**
- * Adds a path to the list of selected paths. This method checks if the
- * path is already selected and doesn't add the same path twice.
- *
- * If this changes the selection the registered TreeSelectionListeners
- * are notified.
- *
- * @param path the path to add to the selection
- */
- public void addSelectionPath(TreePath value0)
- {
- // TODO
- }
-
- /**
- * Adds the paths to the list of selected paths. This method checks if the
- * paths are already selected and doesn't add the same path twice.
- *
- * If this changes the selection the registered TreeSelectionListeners
- * are notified.
- *
- * @param paths the paths to add to the selection
- */
- public void addSelectionPaths(TreePath[] value0)
- {
- // TODO
- }
-
- /**
- * Removes the path from the selection.
- *
- * If this changes the selection the registered TreeSelectionListeners
- * are notified.
- *
- * @param path the path to remove
- */
- public void removeSelectionPath(TreePath value0)
- {
- // TODO
- }
-
- /**
- * Removes the paths from the selection.
- *
- * If this changes the selection the registered TreeSelectionListeners
- * are notified.
- *
- * @param paths the path to remove
- */
- public void removeSelectionPaths(TreePath[] value0)
- {
- // TODO
- }
-
- /**
- * Returns the first path in the selection. This is especially useful
- * when the selectionMode is {@link #SINGLE_TREE_SELECTION}.
- *
- * @return the first path in the selection
- */
- public TreePath getSelectionPath()
- {
- if ((selection == null) || (selection.length == 0))
- return null;
- else
- return selection[0];
- }
-
- /**
- * Returns the complete selection.
- *
- * @return the complete selection
- */
- public TreePath[] getSelectionPaths()
- {
- return selection;
- }
-
- /**
- * Returns the number of paths in the selection.
- *
- * @return the number of paths in the selection
- */
- public int getSelectionCount()
- {
- if (selection == null)
- return 0;
- else
- return selection.length;
- }
-
- /**
- * Checks if a given path is in the selection.
- *
- * @param path the path to check
- *
- * @return <code>true</code> if the path is in the selection,
- * <code>false</code> otherwise
- */
- public boolean isPathSelected(TreePath value0)
- {
- return false; // TODO
- }
-
- /**
- * Checks if the selection is empty.
- *
- * @return <code>true</code> if the selection is empty,
- * <code>false</code> otherwise
- */
- public boolean isSelectionEmpty()
- {
- return ((selection == null) || (selection.length == 0));
- }
-
- /**
- * Removes all paths from the selection.
- */
- public void clearSelection()
- {
- // TODO
- }
-
- /**
- * Adds a <code>TreeSelectionListener</code> object to this model.
- *
- * @param listener the listener to add
- */
- public void addTreeSelectionListener(TreeSelectionListener listener)
- {
- listenerList.add(TreeSelectionListener.class, listener);
- }
-
- /**
- * Removes a <code>TreeSelectionListener</code> object from this model.
- *
- * @param listener the listener to remove
- */
- public void removeTreeSelectionListener(TreeSelectionListener listener)
- {
- listenerList.remove(TreeSelectionListener.class, listener);
- }
-
- /**
- * Returns all <code>TreeSelectionListener</code> added to this model.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public TreeSelectionListener[] getTreeSelectionListeners()
- {
- return (TreeSelectionListener[]) listenerList.getListeners(TreeSelectionListener.class);
- }
-
- /**
- * fireValueChanged
- *
- * @param event the event to fire.
- */
- protected void fireValueChanged(TreeSelectionEvent event)
- {
- TreeSelectionListener[] listeners = getTreeSelectionListeners();
-
- for (int i = listeners.length - 1; i >= 0; --i)
- listeners[i].valueChanged(event);
- }
-
- /**
- * Returns all added listeners of a special type.
- *
- * @param listenerType the listener type
- *
- * @return an array of listeners
- *
- * @since 1.3
- */
- public EventListener[] getListeners(Class listenerType)
- {
- return listenerList.getListeners(listenerType);
- }
-
- /**
- * Returns the currently selected rows.
- *
- * @return the currently selected rows
- */
- public int[] getSelectionRows()
- {
- if (rowMapper == null)
- return null;
- else
- return rowMapper.getRowsForPaths(selection);
- }
-
- /**
- * Returns the smallest row index from the selection.
- *
- * @return the smallest row index from the selection
- */
- public int getMinSelectionRow()
- {
- if ((rowMapper == null) || (selection == null) || (selection.length == 0))
- return -1;
- else {
- int[] rows = rowMapper.getRowsForPaths(selection);
- int minRow = Integer.MAX_VALUE;
- for (int index = 0; index < rows.length; index++)
- minRow = Math.min(minRow, rows[index]);
- return minRow;
- }
- }
-
- /**
- * Returns the largest row index from the selection.
- *
- * @return the largest row index from the selection
- */
- public int getMaxSelectionRow()
- {
- if ((rowMapper == null) || (selection == null) || (selection.length == 0))
- return -1;
- else {
- int[] rows = rowMapper.getRowsForPaths(selection);
- int maxRow = -1;
- for (int index = 0; index < rows.length; index++)
- maxRow = Math.max(maxRow, rows[index]);
- return maxRow;
- }
- }
-
- /**
- * Checks if a particular row is selected.
- *
- * @param row the index of the row to check
- *
- * @return <code>true</code> if the row is in this selection,
- * <code>false</code> otherwise
- */
- public boolean isRowSelected(int value0)
- {
- return false; // TODO
- }
-
- /**
- * Updates the mappings from TreePaths to row indices.
- */
- public void resetRowSelection()
- {
- // TODO
- }
-
- /**
- * getLeadSelectionRow
- * @return int
- */
- public int getLeadSelectionRow()
- {
- if ((rowMapper == null) || (leadPath == null))
- return -1;
- else
- return rowMapper.getRowsForPaths(new TreePath[]{ leadPath })[0];
- }
-
- /**
- * getLeadSelectionPath
- * @return TreePath
- */
- public TreePath getLeadSelectionPath()
- {
- return leadPath;
- }
-
- /**
- * Adds a <code>PropertyChangeListener</code> object to this model.
- *
- * @param listener the listener to add.
- */
- public void addPropertyChangeListener(PropertyChangeListener listener)
- {
- changeSupport.addPropertyChangeListener(listener);
- }
-
- /**
- * Removes a <code>PropertyChangeListener</code> object from this model.
- *
- * @param listener the listener to remove.
- */
- public void removePropertyChangeListener(PropertyChangeListener listener)
- {
- changeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * Returns all added <code>PropertyChangeListener</code> objects.
- *
- * @return an array of listeners.
- *
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners()
- {
- return changeSupport.getPropertyChangeListeners();
- }
-
- /**
- * Makes sure the currently selected paths are valid according to the
- * current selectionMode.
- *
- * If the selectionMode is set to {@link CONTIGUOUS_TREE_SELECTION}
- * and the selection isn't contiguous then the selection is reset to
- * the first set of contguous paths.
- *
- * If the selectionMode is set to {@link SINGLE_TREE_SELECTION}
- * and the selection has more than one path, the selection is reset to
- * the contain only the first path.
- */
- protected void insureRowContinuity()
- {
- // TODO
- }
-
- /**
- * Returns <code>true</code> if the paths are contiguous or we
- * have no RowMapper assigned.
- *
- * @param paths the paths to check for continuity
- * @return <code>true</code> if the paths are contiguous or we
- * have no RowMapper assigned
- */
- protected boolean arePathsContiguous(TreePath[] value0)
- {
- return false; // TODO
- }
-
- /**
- * Checks if the paths can be added. This returns <code>true</code> if:
- * <ul>
- * <li><code>paths</code> is <code>null</code> or empty</li>
- * <li>we have no RowMapper assigned</li>
- * <li>nothing is currently selected</li>
- * <li>selectionMode is {@link DISCONTIGUOUS_TREE_SELECTION</li>
- * <li>adding the paths to the selection still results in a contiguous set
- * of paths</li>
- *
- * @param paths the paths to check
- *
- * @return <code>true</code> if the paths can be added with respect to the
- * selectionMode
- */
- protected boolean canPathsBeAdded(TreePath[] value0)
- {
- return false; // TODO
- }
-
- /**
- * Checks if the paths can be removed without breaking the continuity of
- * the selection according to selectionMode.
- *
- * @param paths the paths to check
- * @return <code>true</code> if the paths can be removed with respect to the
- * selectionMode
- */
- protected boolean canPathsBeRemoved(TreePath[] value0)
- {
- return false; // TODO
- }
-
- /**
- * notifyPathChange
- * @param value0 TODO
- * @param value1 TODO
- */
- protected void notifyPathChange(Vector value0, TreePath value1)
- {
- // TODO
- }
-
- /**
- * Updates the lead index instance field.
- */
- protected void updateLeadIndex()
- {
- // TODO
- }
-
- /**
- * Deprecated and not used.
- */
- protected void insureUniqueness()
- {
- // TODO
- }
-}
diff --git a/libjava/javax/swing/tree/ExpandVetoException.java b/libjava/javax/swing/tree/ExpandVetoException.java
deleted file mode 100644
index 1c8827c8a6c..00000000000
--- a/libjava/javax/swing/tree/ExpandVetoException.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* ExpandVetoException.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-// Imports
-import javax.swing.event.TreeExpansionEvent;
-
-/**
- * ExpandVetoException
- * @author Andrew Selkirk
- */
-public class ExpandVetoException extends Exception {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * event
- */
- protected TreeExpansionEvent event = null;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ExpandVetoException
- * @param event Tree Expansion Event
- */
- public ExpandVetoException(TreeExpansionEvent event) {
- super();
- this.event = event;
- } // ExpandVetoException()
-
- /**
- * Constructor ExpandVetoException
- * @param event Tree Expansion Event
- * @param message Message
- */
- public ExpandVetoException(TreeExpansionEvent event, String message) {
- super(message);
- this.event = event;
- } // ExpandVetoException()
-
-
-} // ExpandVetoException
diff --git a/libjava/javax/swing/tree/FixedHeightLayoutCache.java b/libjava/javax/swing/tree/FixedHeightLayoutCache.java
deleted file mode 100644
index 79c7e05b28a..00000000000
--- a/libjava/javax/swing/tree/FixedHeightLayoutCache.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/* FixedHeightLayoutCache.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.awt.Rectangle;
-import java.util.Enumeration;
-
-import javax.swing.event.TreeModelEvent;
-
-/**
- * FixedHeightLayoutCache
- * @author Andrew Selkirk
- */
-public class FixedHeightLayoutCache extends AbstractLayoutCache {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor FixedHeightLayoutCache
- */
- public FixedHeightLayoutCache() {
- // TODO
- } // FixedHeightLayoutCache()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * setModel
- * @param value0 TODO
- */
- public void setModel(TreeModel value0) {
- // TODO
- } // setModel()
-
- /**
- * setRootVisible
- * @param value0 TODO
- */
- public void setRootVisible(boolean value0) {
- // TODO
- } // setRootVisible()
-
- /**
- * setRowHeight
- * @param value0 TODO
- */
- public void setRowHeight(int value0) {
- // TODO
- } // setRowHeight()
-
- /**
- * getRowCount
- * @returns int
- */
- public int getRowCount() {
- return 0; // TODO
- } // getRowCount()
-
- /**
- * invalidatePathBounds
- * @param value0 TODO
- */
- public void invalidatePathBounds(TreePath value0) {
- // TODO
- } // invalidatePathBounds()
-
- /**
- * invalidateSizes
- */
- public void invalidateSizes() {
- // TODO
- } // invalidateSizes()
-
- /**
- * isExpanded
- * @param value0 TODO
- * @returns boolean
- */
- public boolean isExpanded(TreePath value0) {
- return false; // TODO
- } // isExpanded()
-
- /**
- * getBounds
- * @param value0 TODO
- * @param value1 TODO
- * @returns Rectangle
- */
- public Rectangle getBounds(TreePath value0, Rectangle value1) {
- return null; // TODO
- } // getBounds()
-
- /**
- * getPathForRow
- * @param value0 TODO
- * @returns TreePath
- */
- public TreePath getPathForRow(int value0) {
- return null; // TODO
- } // getPathForRow()
-
- /**
- * getRowForPath
- * @param value0 TODO
- * @returns int
- */
- public int getRowForPath(TreePath value0) {
- return 0; // TODO
- } // getRowForPath()
-
- /**
- * getPathClosestTo
- * @param value0 TODO
- * @param value1 TODO
- * @returns TreePath
- */
- public TreePath getPathClosestTo(int value0, int value1) {
- return null; // TODO
- } // getPathClosestTo()
-
- /**
- * getVisibleChildCount
- * @param value0 TODO
- * @returns int
- */
- public int getVisibleChildCount(TreePath value0) {
- return 0; // TODO
- } // getVisibleChildCount()
-
- /**
- * getVisiblePathsFrom
- * @param value0 TODO
- * @returns Enumeration
- */
- public Enumeration getVisiblePathsFrom(TreePath value0) {
- return null; // TODO
- } // getVisiblePathsFrom()
-
- /**
- * setExpandedState
- * @param value0 TODO
- * @param value1 TODO
- */
- public void setExpandedState(TreePath value0, boolean value1) {
- // TODO
- } // setExpandedState()
-
- /**
- * getExpandedState
- * @param value0 TODO
- * @returns boolean
- */
- public boolean getExpandedState(TreePath value0) {
- return false; // TODO
- } // getExpandedState()
-
- /**
- * treeNodesChanged
- * @param value0 TODO
- */
- public void treeNodesChanged(TreeModelEvent value0) {
- // TODO
- } // treeNodesChanged()
-
- /**
- * treeNodesInserted
- * @param value0 TODO
- */
- public void treeNodesInserted(TreeModelEvent value0) {
- // TODO
- } // treeNodesInserted()
-
- /**
- * treeNodesRemoved
- * @param value0 TODO
- */
- public void treeNodesRemoved(TreeModelEvent value0) {
- // TODO
- } // treeNodesRemoved()
-
- /**
- * treeStructureChanged
- * @param value0 TODO
- */
- public void treeStructureChanged(TreeModelEvent value0) {
- // TODO
- } // treeStructureChanged()
-
-
-} // FixedHeightLayoutCache
diff --git a/libjava/javax/swing/tree/MutableTreeNode.java b/libjava/javax/swing/tree/MutableTreeNode.java
deleted file mode 100644
index a5275210e43..00000000000
--- a/libjava/javax/swing/tree/MutableTreeNode.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* MutableTreeNode.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-/**
- * MutableTreeNode public interface
-
- * @author Andrew Selkirk
- */
-public interface MutableTreeNode extends TreeNode
-{
- /**
- * Inserts a node as child at a given index.
- *
- * @param child the note to insert
- * @param index the index
- *
- * @see #remove(int)
- * @see #remove(MutableTreeNode)
- * @see #setParent(MutableTreeNode)
- */
- void insert(MutableTreeNode child, int index);
-
- /**
- * Removes the child node a given index.
- *
- * @param index the index
- *
- * @see #add(MutableTreeNode,int)
- * @see #remove(MutableTreeNode)
- * @see #removeFromParent()
- */
- void remove(int index);
-
- /**
- * Removes a given child node.
- *
- * @param node the node to remove
- *
- * @see #add(MutableTreeNode,int)
- * @see #remove(int)
- * @see #removeFromParent()
- */
- void remove(MutableTreeNode node);
-
- /**
- * Sets a user object, the data represented by the node.
- *
- * @param object the data
- */
- void setUserObject(Object object);
-
- /**
- * Removes this node from its parent.
- *
- * @see #remove(int)
- * @see #remove(MutableTreeNode)
- */
- void removeFromParent();
-
- /**
- * Sets the parent of the node.
- *
- * @param parent the parent
- *
- * @see insert(MutableTreeNode,int)
- */
- void setParent(MutableTreeNode parent);
-}
diff --git a/libjava/javax/swing/tree/RowMapper.java b/libjava/javax/swing/tree/RowMapper.java
deleted file mode 100644
index 690efb77e32..00000000000
--- a/libjava/javax/swing/tree/RowMapper.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* RowMapper.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-/**
- * RowMapper public interface
- * @author Andrew Selkirk
- */
-public interface RowMapper {
-
- /**
- * getRowsForPaths
- * @param path TreePath
- * @return TODO
- */
- int[] getRowsForPaths(TreePath[] path);
-
-
-} // RowMapper
diff --git a/libjava/javax/swing/tree/TreeCellEditor.java b/libjava/javax/swing/tree/TreeCellEditor.java
deleted file mode 100644
index 691cbc16386..00000000000
--- a/libjava/javax/swing/tree/TreeCellEditor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* TreeCellEditor.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.awt.Component;
-
-import javax.swing.CellEditor;
-import javax.swing.JTree;
-
-/**
- * TreeCellEditor public interface
- * @author Andrew Selkirk
- */
-public interface TreeCellEditor extends CellEditor
-{
- /**
- * getTreeCellEditorComponent
- * @param tree TODO
- * @param value TODO
- * @param isSelected TODO
- * @param expanded TODO
- * @param leaf TODO
- * @param row TODO
- * @return TODO
- */
- Component getTreeCellEditorComponent(JTree tree, Object value,
- boolean isSelected, boolean expanded,
- boolean leaf, int row);
-}
diff --git a/libjava/javax/swing/tree/TreeCellRenderer.java b/libjava/javax/swing/tree/TreeCellRenderer.java
deleted file mode 100644
index ebbe3fa9133..00000000000
--- a/libjava/javax/swing/tree/TreeCellRenderer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* TreeCellRenderer.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.awt.Component;
-
-import javax.swing.JTree;
-
-/**
- * TreeCellRenderer public interface
- * @author Andrew Selkirk
- */
-public interface TreeCellRenderer {
-
- /**
- * getTreeCellRendererComponent
- * @param tree TODO
- * @param value TODO
- * @param selected TODO
- * @param expanded TODO
- * @param leaf TODO
- * @param row TODO
- * @param us TODO
- * @returns TODO
- */
- Component getTreeCellRendererComponent(JTree tree,
- Object value, boolean selected, boolean expanded,
- boolean leaf, int row, boolean hasFocus);
-
-
-} // TreeCellRenderer
diff --git a/libjava/javax/swing/tree/TreeModel.java b/libjava/javax/swing/tree/TreeModel.java
deleted file mode 100644
index 759aaac588c..00000000000
--- a/libjava/javax/swing/tree/TreeModel.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* TreeModel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import javax.swing.event.TreeModelListener;
-
-/**
- * TreeModel public interface
- * @author Andrew Selkirk
- */
-public interface TreeModel {
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getRoot
- * @returns Object
- */
- Object getRoot();
-
- /**
- * getChild
- * @param parent TODO
- * @param index TODO
- * @returns Object
- */
- Object getChild(Object parent, int index);
-
- /**
- * getChildCount
- * @param parent TODO
- * @returns int
- */
- int getChildCount(Object parent);
-
- /**
- * isLeaf
- * @param node TODO
- * @returns boolean
- */
- boolean isLeaf(Object node);
-
- /**
- * valueForPathChanged
- * @param path TODO
- * @param newvalue TODO
- */
- void valueForPathChanged(TreePath path, Object newvalue);
-
- /**
- * getIndexOfChild
- * @param parent TODO
- * @param ild TODO
- * @returns int
- */
- int getIndexOfChild(Object parent, Object child);
-
- /**
- * addTreeModelListener
- * @param listener TODO
- */
- void addTreeModelListener(TreeModelListener listener);
-
- /**
- * removeTreeModelListener
- * @param listener TODO
- */
- void removeTreeModelListener(TreeModelListener listener);
-
-
-} // TreeModel
diff --git a/libjava/javax/swing/tree/TreeNode.java b/libjava/javax/swing/tree/TreeNode.java
deleted file mode 100644
index fb8f880f286..00000000000
--- a/libjava/javax/swing/tree/TreeNode.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* TreeNode.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.util.Enumeration;
-
-/**
- * TreeNode public interface
- * @author Andrew Selkirk
- */
-public interface TreeNode {
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getParent
- * @returns TreeNode
- */
- TreeNode getParent();
-
- /**
- * getIndex
- * @param node TODO
- * @returns int
- */
- int getIndex(TreeNode node);
-
- /**
- * getChildAt
- * @param index TODO
- * @returns TreeNode
- */
- TreeNode getChildAt(int index);
-
- /**
- * getChildCount
- * @returns int
- */
- int getChildCount();
-
- /**
- * getAllowsChildren
- * @returns boolean
- */
- boolean getAllowsChildren();
-
- /**
- * isLeaf
- * @returns boolean
- */
- boolean isLeaf();
-
- /**
- * children
- * @returns Enumeration
- */
- Enumeration children();
-
-
-} // TreeNode
-
diff --git a/libjava/javax/swing/tree/TreePath.java b/libjava/javax/swing/tree/TreePath.java
deleted file mode 100644
index cb947b98167..00000000000
--- a/libjava/javax/swing/tree/TreePath.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/* TreePath.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-/**
- * TreePath
- * @author Andrew Selkirk
- */
-public class TreePath implements Serializable
-{
- static final long serialVersionUID = 4380036194768077479L;
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * path
- */
- private Object[] path = null;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor TreePath
- * @param path TODO
- */
- public TreePath(Object[] path) {
-
- // Create Path
- this.path = new Object[path.length];
- System.arraycopy(path, 0, this.path, 0, path.length);
-
- } // TreePath()
-
- /**
- * Constructor TreePath
- * @param element TODO
- */
- public TreePath(Object element) {
-
- // Create Path
- path = new Object[1];
- path[0] = element;
-
- } // TreePath()
-
- /**
- * Constructor TreePath
- * @param path TODO
- * @param element TODO
- */
- protected TreePath(TreePath path, Object element) {
-
- // Variables
- Object[] treepath;
-
- // Get Tree Path
- treepath = path.getPath();
-
- // Create Tree Path
- this.path = new Object[treepath.length + 1];
- System.arraycopy(treepath, 0, this.path, 0, treepath.length);
- this.path[treepath.length] = element;
-
- } // TreePath()
-
- /**
- * Constructor TreePath
- * @param path TODO
- * @param length TODO
- */
- protected TreePath(Object[] path, int length) {
-
- // Create Path
- this.path = new Object[length];
- System.arraycopy(path, 0, this.path, 0, length);
-
- } // TreePath()
-
- /**
- * Constructor TreePath
- */
- protected TreePath() {
- path = new Object[0];
- } // TreePath()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * hashCode
- * @returns int
- */
- public int hashCode() {
- return getLastPathComponent().hashCode();
- } // hashCode()
-
- /**
- * equals
- * @param object TODO
- * @returns boolean
- */
- public boolean equals(Object object) {
-
- // Variables
- Object[] treepath;
- int index;
-
- // Check for TreePath
- if (object instanceof TreePath) {
-
- // Get Path Elements
- treepath = ((TreePath) object).getPath();
-
- // Check length
- if (treepath.length != path.length) {
- return false;
- } // if
-
- // Check Elements
- for (index = 0; index < path.length; index++) {
- if (treepath[index] != path[index]) {
- return false;
- } // if
- } // for
-
- // Tree Path's are equals
- return true;
-
- } // if
-
- // Unequal
- return false;
-
- } // equals()
-
- /**
- * toString
- * @returns String
- */
- public String toString() {
- return null; // TODO
- } // toString()
-
- /**
- * writeObject
- * @param value0 TODO
- * @exception IOException TODO
- */
- private void writeObject(ObjectOutputStream value0) throws IOException {
- // TODO
- } // writeObject()
-
- /**
- * readObject
- * @param value0 TODO
- * @exception IOException TODO
- * @exception ClassNotFoundException TODO
- */
- private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException {
- // TODO
- } // readObject()
-
- /**
- * getPath
- * @returns Object[]
- */
- public Object[] getPath() {
- return path;
- } // getPath()
-
- /**
- * getLastPathComponent
- * @returns Object
- */
- public Object getLastPathComponent() {
- return path[path.length - 1];
- } // getLastPathComponent()
-
- /**
- * getPathCount
- * @returns int
- */
- public int getPathCount() {
- return path.length;
- } // getPathCount()
-
- /**
- * getPathComponent
- * @param position TODO
- * @returns Object
- */
- public Object getPathComponent(int position) {
- return path[position];
- } // getPathComponent()
-
- /**
- * isDescendant
- * @param path TODO
- * @returns boolean
- */
- public boolean isDescendant(TreePath path) {
-
- // Variables
- Object[] treepath;
- int index;
- int index2;
-
- // Get Descendant path
- treepath = path.getPath();
-
- // Locate Start Index
- index = 0;
- index2 = 0;
- while (treepath[index] != this.path[index2]) {
- index++;
- } // while
-
- // Verify Paths
- while (treepath[index] == this.path[index2]) {
- index++;
- index2++;
- } // while
-
- // Check for descendant
- if (index2 != this.path.length) {
- return false;
- } // if
-
- // Is Descendant
- return true;
-
- } // isDescendant()
-
- /**
- * pathByAddingChild
- * @param element TODO
- * @returns TreePath
- */
- public TreePath pathByAddingChild(Object element) {
- return new TreePath(this, element);
- } // pathByAddingChild()
-
- /**
- * getParentPath
- * @returns TreePath
- */
- public TreePath getParentPath() {
- return new TreePath(this.getPath(), path.length - 1);
- } // getParentPath()
-
-
-} // TreePath
diff --git a/libjava/javax/swing/tree/TreeSelectionModel.java b/libjava/javax/swing/tree/TreeSelectionModel.java
deleted file mode 100644
index 4072ccc64c5..00000000000
--- a/libjava/javax/swing/tree/TreeSelectionModel.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* TreeSelectionModel.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.beans.PropertyChangeListener;
-
-import javax.swing.event.TreeSelectionListener;
-
-/**
- * TreeSelectionModel public interface
- * @author Andrew Selkirk
- */
-public interface TreeSelectionModel {
-
- int SINGLE_TREE_SELECTION = 1;
- int CONTIGUOUS_TREE_SELECTION = 2;
- int DISCONTIGUOUS_TREE_SELECTION = 4;
-
- void setSelectionMode(int mode);
- int getSelectionMode();
- void setSelectionPath(TreePath path);
- void setSelectionPaths(TreePath[] paths);
- void addSelectionPath(TreePath path);
- void addSelectionPaths(TreePath[] paths);
- void removeSelectionPath(TreePath path);
- void removeSelectionPaths(TreePath[] paths);
- TreePath getSelectionPath();
- TreePath[] getSelectionPaths();
- int getSelectionCount();
- boolean isPathSelected(TreePath path);
- boolean isSelectionEmpty();
- void clearSelection();
- void setRowMapper(RowMapper newMapper);
- RowMapper getRowMapper();
- int[] getSelectionRows();
- int getMinSelectionRow();
- int getMaxSelectionRow();
- boolean isRowSelected(int row);
- void resetRowSelection();
- int getLeadSelectionRow();
- TreePath getLeadSelectionPath();
- void addPropertyChangeListener(PropertyChangeListener listener);
- void removePropertyChangeListener(PropertyChangeListener listener);
- void addTreeSelectionListener(TreeSelectionListener x);
- void removeTreeSelectionListener(TreeSelectionListener x);
-
-
-} // TreeSelectionModel
diff --git a/libjava/javax/swing/tree/VariableHeightLayoutCache.java b/libjava/javax/swing/tree/VariableHeightLayoutCache.java
deleted file mode 100644
index 2f93be832d6..00000000000
--- a/libjava/javax/swing/tree/VariableHeightLayoutCache.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/* VariableHeightLayoutCache.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.tree;
-
-import java.awt.Rectangle;
-import java.util.Enumeration;
-
-import javax.swing.event.TreeModelEvent;
-
-/**
- * VariableHeightLayoutCache
- * @author Andrew Selkirk
- */
-public class VariableHeightLayoutCache extends AbstractLayoutCache {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor VariableHeightLayoutCache
- */
- public VariableHeightLayoutCache() {
- // TODO
- } // VariableHeightLayoutCache()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * setModel
- * @param value0 TODO
- */
- public void setModel(TreeModel value0) {
- // TODO
- } // setModel()
-
- /**
- * setRootVisible
- * @param value0 TODO
- */
- public void setRootVisible(boolean value0) {
- // TODO
- } // setRootVisible()
-
- /**
- * setRowHeight
- * @param value0 TODO
- */
- public void setRowHeight(int value0) {
- // TODO
- } // setRowHeight()
-
- /**
- * setNodeDimensions
- * @param value0 TODO
- */
- public void setNodeDimensions(NodeDimensions value0) {
- // TODO
- } // setNodeDimensions()
-
- /**
- * setExpandedState
- * @param value0 TODO
- * @param value1 TODO
- */
- public void setExpandedState(TreePath value0, boolean value1) {
- // TODO
- } // setExpandedState()
-
- /**
- * getExpandedState
- * @param value0 TODO
- * @returns boolean
- */
- public boolean getExpandedState(TreePath value0) {
- return false; // TODO
- } // getExpandedState()
-
- /**
- * getBounds
- * @param value0 TODO
- * @param value1 TODO
- * @returns Rectangle
- */
- public Rectangle getBounds(TreePath value0, Rectangle value1) {
- return null; // TODO
- } // getBounds()
-
- /**
- * getPathForRow
- * @param value0 TODO
- * @returns TreePath
- */
- public TreePath getPathForRow(int value0) {
- return null; // TODO
- } // getPathForRow()
-
- /**
- * getRowForPath
- * @param value0 TODO
- * @returns int
- */
- public int getRowForPath(TreePath value0) {
- return 0; // TODO
- } // getRowForPath()
-
- /**
- * getRowCount
- * @returns int
- */
- public int getRowCount() {
- return 0; // TODO
- } // getRowCount()
-
- /**
- * invalidatePathBounds
- * @param value0 TODO
- */
- public void invalidatePathBounds(TreePath value0) {
- // TODO
- } // invalidatePathBounds()
-
- /**
- * getPreferredHeight
- * @returns int
- */
- public int getPreferredHeight() {
- return 0; // TODO
- } // getPreferredHeight()
-
- /**
- * getPreferredWidth
- * @param value0 TODO
- * @returns int
- */
- public int getPreferredWidth(Rectangle value0) {
- return 0; // TODO
- } // getPreferredWidth()
-
- /**
- * getPathClosestTo
- * @param value0 TODO
- * @param value1 TODO
- * @returns TreePath
- */
- public TreePath getPathClosestTo(int value0, int value1) {
- return null; // TODO
- } // getPathClosestTo()
-
- /**
- * getVisiblePathsFrom
- * @param value0 TODO
- * @returns Enumeration
- */
- public Enumeration getVisiblePathsFrom(TreePath value0) {
- return null; // TODO
- } // getVisiblePathsFrom()
-
- /**
- * getVisibleChildCount
- * @param value0 TODO
- * @returns int
- */
- public int getVisibleChildCount(TreePath value0) {
- return 0; // TODO
- } // getVisibleChildCount()
-
- /**
- * invalidateSizes
- */
- public void invalidateSizes() {
- // TODO
- } // invalidateSizes()
-
- /**
- * isExpanded
- * @param value0 TODO
- * @returns boolean
- */
- public boolean isExpanded(TreePath value0) {
- return false; // TODO
- } // isExpanded()
-
- /**
- * treeNodesChanged
- * @param value0 TODO
- */
- public void treeNodesChanged(TreeModelEvent value0) {
- // TODO
- } // treeNodesChanged()
-
- /**
- * treeNodesInserted
- * @param value0 TODO
- */
- public void treeNodesInserted(TreeModelEvent value0) {
- // TODO
- } // treeNodesInserted()
-
- /**
- * treeNodesRemoved
- * @param value0 TODO
- */
- public void treeNodesRemoved(TreeModelEvent value0) {
- // TODO
- } // treeNodesRemoved()
-
- /**
- * treeStructureChanged
- * @param value0 TODO
- */
- public void treeStructureChanged(TreeModelEvent value0) {
- // TODO
- } // treeStructureChanged()
-
-
-} // VariableHeightLayoutCache
diff --git a/libjava/javax/swing/undo/AbstractUndoableEdit.java b/libjava/javax/swing/undo/AbstractUndoableEdit.java
deleted file mode 100644
index 34c41aea274..00000000000
--- a/libjava/javax/swing/undo/AbstractUndoableEdit.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/* AbstractUndoableEdit.java --
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.undo;
-
-import java.io.Serializable;
-
-import javax.swing.UIManager;
-
-/**
- * A default implementation of <code>UndoableEdit</code> that can be
- * used as a base for implementing editing operations.
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class AbstractUndoableEdit
- implements UndoableEdit, Serializable
-{
- /**
- * The serialization ID. Verified using the <code>serialver</code>
- * tool of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5, and Sun JDK
- * 1.4.1_01 on GNU/Linux.
- */
- static final long serialVersionUID = 580150227676302096L;
-
-
- /**
- * The constant string &#x201c;Undo&#x201d;, which was returned by
- * {@link #getUndoPresentationName()} on early versions of the
- * platform. However, this field has become obsolete with version
- * 1.3.1. That method now retrieves a localized string from the
- * {@link javax.swing.UIManager}, using the key
- * <code>&#x201c;AbstractUndoableEdit.undoText&#x201d;</code>.
- */
- protected static final String UndoName = "Undo";
-
-
- /**
- * The constant string &#x201c;Redo&#x201d;, which was returned by
- * {@link #getRedoPresentationName()} on early versions of the
- * platform. However, this field has become obsolete with version
- * 1.3.1. That method now retrieves a localized string from the
- * {@link javax.swing.UIManager}, using the key
- * <code>&#x201c;AbstractUndoableEdit.redoText&#x201d;</code>.
- */
- protected static final String RedoName = "Redo";
-
-
- /**
- * Indicates whether this editing action has been executed. A value
- * of <code>true</code> means that the action was performed, or that
- * a redo operation was successful. A value of <code>false</code>
- * means that the action has not yet performed, or that an undo
- * operation was successful.
- */
- private boolean hasBeenDone;
-
-
- /**
- * Indicates whether this editing action is still alive. The value
- * is set to <code>true</code> by the constructor, and to
- * <code>false</code> by the {@link #die()} method.
- */
- private boolean alive;
-
-
- /**
- * Constructs a new <code>AbstractUndoableEdit</code>. The initial
- * state is that the editing action is alive, and
- * <code>hasBeenDone</code> is <code>true</code>.
- */
- public AbstractUndoableEdit()
- {
- // The API specification is not clear, but Mauve test code has
- // determined that hasBeenDone is initially set to true.
- alive = hasBeenDone = true;
- }
-
-
- /**
- * Undoes this editing action.
- *
- * @throws CannotUndoException if {@link #canUndo()} returns
- * <code>false</code>, for example because this action has already
- * been undone.
- *
- * @see #canUndo()
- * @see #redo()
- */
- public void undo()
- throws CannotUndoException
- {
- if (!canUndo())
- throw new CannotUndoException();
- hasBeenDone = false;
- }
-
-
- /**
- * Determines whether it would be possible to undo this editing
- * action.
- *
- * @return <code>true</code> to indicate that this action can be
- * undone, <code>false</code> otherwise.
- *
- * @see #undo()
- * @see #canRedo()
- */
- public boolean canUndo()
- {
- return alive && hasBeenDone;
- }
-
-
- /**
- * Redoes this editing action.
- *
- * @throws CannotRedoException if {@link #canRedo()} returns
- * <code>false</code>, for example because this action has not
- * yet been undone.
- *
- * @see #canRedo()
- * @see #undo()
- */
- public void redo()
- throws CannotRedoException
- {
- if (!canRedo())
- throw new CannotRedoException();
- hasBeenDone = true;
- }
-
-
- /**
- * Determines whether it would be possible to redo this editing
- * action.
- *
- * @return <code>true</code> to indicate that this action can be
- * redone, <code>false</code> otherwise.
- *
- * @see #redo()
- * @see #canUndo()
- */
- public boolean canRedo()
- {
- return alive && !hasBeenDone;
- }
-
-
- /**
- * Informs this edit action that it will no longer be used. Some
- * actions might use this information to release resources, for
- * example open files. Called by {@link UndoManager} before this
- * action is removed from the edit queue.
- */
- public void die()
- {
- alive = false;
- }
-
-
- /**
- * Incorporates another editing action into this one, thus forming a
- * combined action.
- *
- * <p>The default implementation always returns <code>false</code>,
- * indicating that the editing action could not be incorporated.
- *
- * @param edit the editing action to be incorporated.
- */
- public boolean addEdit(UndoableEdit edit)
- {
- return false;
- }
-
-
- /**
- * Incorporates another editing action into this one, thus forming a
- * combined action that replaces the argument action.
- *
- * <p>The default implementation always returns <code>false</code>,
- * indicating that the argument action should not be replaced.
- *
- * @param edit the editing action to be replaced.
- */
- public boolean replaceEdit(UndoableEdit edit)
- {
- return false;
- }
-
-
- /**
- * Determines whether this editing action is significant enough for
- * being seperately undoable by the user. A typical significant
- * action would be the resizing of an object. However, changing the
- * selection in a text document would usually not be considered
- * significant.
- *
- * <p>The default implementation returns <code>true</code>.
- *
- * @return <code>true</code> to indicate that the action is
- * significant enough for being separately undoable, or
- * <code>false</code> otherwise.
- */
- public boolean isSignificant()
- {
- return true;
- }
-
-
- /**
- * Returns a human-readable, localized name that describes this
- * editing action and can be displayed to the user.
- *
- * <p>The default implementation returns an empty string.
- */
- public String getPresentationName()
- {
- return "";
- }
-
-
- /**
- * Calculates a localized name for presenting the undo action to the
- * user.
- *
- * <p>The default implementation returns the concatenation of the
- * string &#x201c;Undo&#x201d; and the action name, which is
- * determined by calling {@link #getPresentationName()}.
- *
- * <p>The string &#x201c;Undo&#x201d; is retrieved from the {@link
- * javax.swing.UIManager}, using the key
- * <code>&#x201c;AbstractUndoableEdit.undoText&#x201d;</code>. This
- * allows the text to be localized.
- */
- public String getUndoPresentationName()
- {
- String msg, pres;
-
- msg = UIManager.getString("AbstractUndoableEdit.undoText");
- if (msg == null)
- msg = UndoName;
-
- pres = getPresentationName();
- if ((pres == null) || (pres.length() == 0))
- return msg;
- else
- return msg + ' ' + pres;
- }
-
-
- /**
- * Calculates a localized name for presenting the redo action to the
- * user.
- *
- * <p>The default implementation returns the concatenation of the
- * string &#x201c;Redo&#x201d; and the action name, which is
- * determined by calling {@link #getPresentationName()}.
- *
- * <p>The string &#x201c;Redo&#x201d; is retrieved from the {@link
- * javax.swing.UIManager}, using the key
- * <code>&#x201c;AbstractUndoableEdit.redoText&#x201d;</code>. This
- * allows the text to be localized.
- */
- public String getRedoPresentationName()
- {
- String msg, pres;
-
- msg = UIManager.getString("AbstractUndoableEdit.redoText");
- if (msg == null)
- msg = RedoName;
-
- pres = getPresentationName();
- if ((pres == null) || (pres.length() == 0))
- return msg;
- else
- return msg + ' ' + pres;
- }
-
-
- public String toString()
- {
- return super.toString()
- + " hasBeenDone: " + hasBeenDone
- + " alive: " + alive;
- }
-}
diff --git a/libjava/javax/swing/undo/CannotRedoException.java b/libjava/javax/swing/undo/CannotRedoException.java
deleted file mode 100644
index 7d70a38c2c8..00000000000
--- a/libjava/javax/swing/undo/CannotRedoException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* CannotRedoException.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.undo;
-
-/**
- * An exception which indicates that an editing action cannot be
- * redone.
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class CannotRedoException
- extends RuntimeException
-{
- /**
- * Constructs a new instance of a <code>CannotRedoException</code>.
- */
- public CannotRedoException()
- {
- }
-}
diff --git a/libjava/javax/swing/undo/CannotUndoException.java b/libjava/javax/swing/undo/CannotUndoException.java
deleted file mode 100644
index 9fc0ec3bd3a..00000000000
--- a/libjava/javax/swing/undo/CannotUndoException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* CannotUndoException.java
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.undo;
-
-
-/**
- * An exception which indicates that an editing action cannot be
- * undone.
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class CannotUndoException
- extends RuntimeException
-{
- /**
- * Constructs a new instance of a <code>CannotUndoException</code>.
- */
- public CannotUndoException()
- {
- }
-}
diff --git a/libjava/javax/swing/undo/CompoundEdit.java b/libjava/javax/swing/undo/CompoundEdit.java
deleted file mode 100644
index e1cfbb619b3..00000000000
--- a/libjava/javax/swing/undo/CompoundEdit.java
+++ /dev/null
@@ -1,400 +0,0 @@
-/* CompoundEdit.java -- Combines multiple UndoableEdits.
- Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.undo;
-
-import java.util.Vector;
-
-/**
- * An editing action that consists of multiple
- * <code>UndoableEdits</code>.
- *
- * <p>The use of a <code>CompoundEdit</code> is divided in two separate
- * phases.</p>
- *
- * <ol>
- * <li>In the first phase, the <code>CompoundEdit</code> is
- * initialized. After a new instance of <code>CompoundEdit</code> has
- * been created, {@link #addEdit(UndoableEdit)} is called for each
- * element of the compound. To terminate the initialization phase,
- * call {@link #end()}.</li>
- * <li>In the second phase, the the <code>CompoundEdit</code> can be
- * used, typically by invoking {@link #undo()} and
- * {@link #redo()}.</li>
- * </ol>
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class CompoundEdit
- extends AbstractUndoableEdit
-{
- /**
- * The identifier of this class in object serialization. Determined
- * using the serialver tool of Sun J2SE 1.4.1_01.
- */
- private static final long serialVersionUID = -6512679249930119683L;
-
-
- /**
- * The <code>UndoableEdit</code>s being combined into a compound
- * editing action.
- */
- protected Vector edits;
-
-
- /**
- * Indicates whether the creation of this CompoundEdit is still in
- * progress. Initially, the value of this flag is
- * <code>true</code>. The {@link #end()} method changes the flag to
- * <code>false</code>.
- */
- private boolean inProgress;
-
-
- /**
- * Constructs a new CompoundEdit.
- */
- public CompoundEdit()
- {
- edits = new Vector();
- inProgress = true;
- }
-
-
- /**
- * Undoes all edits that are part of of this
- * <code>CompoundEdit</code>. The compound elements will receive the
- * <code>undo</code> message in the reverse order of addition.
- *
- * @throws CannotUndoException if {@link #canUndo()} returns
- * <code>false</code>. This can happen if {@link #end()} has not
- * been called on this <code>CompoundEdit</code>, or if this edit
- * has already been undone.
- *
- * @see #canUndo()
- * @see #redo()
- */
- public void undo()
- throws CannotUndoException
- {
- // AbstractUndoableEdit.undo() will throw a CannotUndoException if
- // canUndo returns false.
- super.undo();
-
- for (int i = edits.size() - 1; i >= 0; i--)
- ((UndoableEdit) edits.elementAt(i)).undo();
- }
-
-
- /**
- * Redoes all edits that are part of of this
- * <code>CompoundEdit</code>. The compound elements will receive the
- * <code>undo</code> message in the same order as they were added.
- *
- * @throws CannotRedoException if {@link #canRedo()} returns
- * <code>false</code>. This can happen if {@link #end()} has not
- * been called on this <code>CompoundEdit</code>, or if this edit
- * has already been redone.
- *
- * @see #canRedo()
- * @see #undo()
- */
- public void redo()
- throws CannotRedoException
- {
- // AbstractUndoableEdit.redo() will throw a CannotRedoException if
- // canRedo returns false.
- super.redo();
-
- for (int i = 0; i < edits.size(); i++)
- ((UndoableEdit) edits.elementAt(i)).redo();
- }
-
-
- /**
- * Returns the the <code>UndoableEdit</code> that was last added to
- * this compound.
- */
- protected UndoableEdit lastEdit()
- {
- if (edits.size() == 0)
- return null;
- else
- return (UndoableEdit) edits.elementAt(edits.size() - 1);
- }
-
-
- /**
- * Informs this edit action, and all compound edits, that they will
- * no longer be used. Some actions might use this information to
- * release resources such as open files. Called by {@link
- * UndoManager} before this action is removed from the edit queue.
- *
- * <p>The compound elements will receive the
- * <code>die</code> message in the reverse order of addition.
- */
- public void die()
- {
- for (int i = edits.size() - 1; i >= 0; i--)
- ((UndoableEdit) edits.elementAt(i)).die();
-
- super.die();
- }
-
-
- /**
- * Incorporates another editing action into this one, thus forming a
- * combined edit.
- *
- * <p>If this edit&#x2019;s {@link #end()} method has been called
- * before, <code>false</code> is returned immediately. Otherwise,
- * the {@linkplain #lastEdit() last added edit} is given the
- * opportunity to {@linkplain UndoableEdit#addEdit(UndoableEdit)
- * incorporate} <code>edit</code>. If this fails, <code>edit</code>
- * is given the opportunity to {@linkplain
- * UndoableEdit#replaceEdit(UndoableEdit) replace} the last added
- * edit. If this fails as well, <code>edit</code> gets added as a
- * new compound to {@link #edits}.
- *
- * @param edit the editing action being added.
- *
- * @return <code>true</code> if <code>edit</code> could somehow be
- * incorporated; <code>false</code> if <code>edit</code> has not
- * been incorporated because {@link #end()} was called before.
- */
- public boolean addEdit(UndoableEdit edit)
- {
- UndoableEdit last;
-
- // If end has been called before, do nothing.
- if (!inProgress)
- return false;
-
- last = lastEdit();
-
- // If edit is the very first edit, just add it to the list.
- if (last == null)
- {
- edits.add(edit);
- return true;
- }
-
- // Try to incorporate edit into last.
- if (last.addEdit(edit))
- return true;
-
- // Try to replace last by edit.
- if (edit.replaceEdit(last))
- {
- edits.set(edits.size() - 1, edit);
- return true;
- }
-
- // If everything else has failed, add edit to the list of compound
- // edits.
- edits.add(edit);
- return true;
- }
-
-
- /**
- * Informs this <code>CompoundEdit</code> that its construction
- * phase has been completed. After this method has been called,
- * {@link #undo()} and {@link #redo()} may be called, {@link
- * #isInProgress()} will return <code>false</code>, and all attempts
- * to {@linkplain #addEdit(UndoableEdit) add further edits} will
- * fail.
- */
- public void end()
- {
- inProgress = false;
- }
-
-
- /**
- * Determines whether it would be possible to undo this editing
- * action. The result will be <code>true</code> if {@link #end()}
- * has been called on this <code>CompoundEdit</code>, {@link #die()}
- * has not yet been called, and the edit has not been undone
- * already.
- *
- * @return <code>true</code> to indicate that this action can be
- * undone; <code>false</code> otherwise.
- *
- * @see #undo()
- * @see #canRedo()
- */
- public boolean canUndo()
- {
- return !inProgress && super.canUndo();
- }
-
-
- /**
- * Determines whether it would be possible to redo this editing
- * action. The result will be <code>true</code> if {@link #end()}
- * has been called on this <code>CompoundEdit</code>, {@link #die()}
- * has not yet been called, and the edit has not been redone
- * already.
- *
- * @return <code>true</code> to indicate that this action can be
- * redone; <code>false</code> otherwise.
- *
- * @see #redo()
- * @see #canUndo()
- */
- public boolean canRedo()
- {
- return !inProgress && super.canRedo();
- }
-
-
- /**
- * Determines whether the initial construction phase of this
- * <code>CompoundEdit</code> is still in progress. During this
- * phase, edits {@linkplain #addEdit(UndoableEdit) may be
- * added}. After initialization has been terminated by calling
- * {@link #end()}, {@link #undo()} and {@link #redo()} can be used.
- *
- * @return <code>true</code> if the initialization phase is still in
- * progress; <code>false</code> if {@link #end()} has been called.
- *
- * @see #end()
- */
- public boolean isInProgress()
- {
- return inProgress;
- }
-
-
- /**
- * Determines whether this editing action is significant enough for
- * being seperately undoable by the user. A typical significant
- * action would be the resizing of an object. However, changing the
- * selection in a text document would usually not be considered
- * significant.
- *
- * <p>A <code>CompoundEdit</code> is significant if any of its
- * elements are significant.
- */
- public boolean isSignificant()
- {
- for (int i = edits.size() - 1; i >= 0; i--)
- if (((UndoableEdit) edits.elementAt(i)).isSignificant())
- return true;
-
- return false;
- }
-
-
- /**
- * Returns a human-readable, localized name that describes this
- * editing action and can be displayed to the user.
- *
- * <p>The implementation delegates the call to the {@linkplain
- * #lastEdit() last added edit action}. If no edit has been added
- * yet, the inherited implementation will be invoked, which always
- * returns an empty string.
- */
- public String getPresentationName()
- {
- UndoableEdit last;
-
- last = lastEdit();
- if (last == null)
- return super.getPresentationName();
- else
- return last.getPresentationName();
- }
-
-
- /**
- * Calculates a localized message text for presenting the undo
- * action to the user.
- *
- * <p>The implementation delegates the call to the {@linkplain
- * #lastEdit() last added edit action}. If no edit has been added
- * yet, the {@linkplain
- * AbstractUndoableEdit#getUndoPresentationName() inherited
- * implementation} will be invoked.
- */
- public String getUndoPresentationName()
- {
- UndoableEdit last;
-
- last = lastEdit();
- if (last == null)
- return super.getUndoPresentationName();
- else
- return last.getUndoPresentationName();
- }
-
-
- /**
- * Calculates a localized message text for presenting the redo
- * action to the user.
- *
- * <p>The implementation delegates the call to the {@linkplain
- * #lastEdit() last added edit action}. If no edit has been added
- * yet, the {@linkplain
- * AbstractUndoableEdit#getRedoPresentationName() inherited
- * implementation} will be invoked.
- */
- public String getRedoPresentationName()
- {
- UndoableEdit last;
-
- last = lastEdit();
- if (last == null)
- return super.getRedoPresentationName();
- else
- return last.getRedoPresentationName();
- }
-
-
- /**
- * Calculates a string that may be useful for debugging.
- */
- public String toString()
- {
- return super.toString()
- + " inProgress: " + inProgress
- + " edits: " + edits;
- }
-}
diff --git a/libjava/javax/swing/undo/StateEdit.java b/libjava/javax/swing/undo/StateEdit.java
deleted file mode 100644
index 80e4e33ec29..00000000000
--- a/libjava/javax/swing/undo/StateEdit.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/* StateEdit.java -- UndoableEdit for StateEditable implementations.
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.undo;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-
-/**
- * A helper class, making it easy to support undo and redo.
- *
- * <p>The following example shows how to use this class.</p>
- *
- * <pre>
- * Foo foo; // class Foo implements {@link StateEditable}
- * StateEdit edit;
- *
- * edit = new StateEdit(foo, "Name Change");
- * foo.setName("Jane Doe");
- * edit.end();
- * undoManager.addEdit(edit);
- * </pre>
- *
- * <p>If <code>Foo</code>&#x2019;s implementation of {@link
- * StateEditable} considers the name as part of the editable state,
- * the user can now choose &#x201c;Undo Name Change&#x201d; or
- * &#x201c;Redo Name Change&#x201d; from the respective menu. No
- * further undo support is needed from the application.</p>
- *
- * <p>The following explains what happens in the example.</p>
- *
- * <ol>
- * <li>When a <code>StateEdit</code> is created, the associated
- * {@link StateEditable} gets asked to store its state into a hash
- * table, {@link #preState}.</li>
- * <li>The application will now perform some changes to the edited
- * object. This typically happens by invoking methods on the edited
- * object.</li>
- * <li>The editing phase is terminated by invoking the {@link #end()}
- * method of the <code>StateEdit</code>. The <code>end()</code> method
- * does two things.
- *
- * <ul>
- * <li>The edited object receives a second request for storing
- * its state. This time, it will use a different hash table, {@link
- * #postState}.</li>
- * <li>To increase efficiency, the <code>StateEdit</code> now removes
- * any entries from {@link #preState} and {@link #postState} that have
- * the same key, and whose values are equal. Equality is determined
- * by invoking the <code>equals</code> method inherited from
- * {@link java.lang.Object}.</li>
- * </ul></li>
- * <li>When the user later chooses to undo the <code>StateEdit</code>,
- * the edited object is asked to {@linkplain StateEditable#restoreState
- * restore its state} from the {@link #preState} table. Similarly,
- * when the user chooses to <i>redo</i> the <code>StateEdit</code>,
- * the edited object gets asked to restore its state from the {@link
- * #postState}.</li>
- * </ol>
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class StateEdit
- extends AbstractUndoableEdit
-{
- /**
- * The ID of the Java source file in Sun&#x2019;s Revision Control
- * System (RCS). This certainly should not be part of the API
- * specification. But in order to be API-compatible with
- * Sun&#x2019;s reference implementation, GNU Classpath also has to
- * provide this field. However, we do not try to match its value.
- */
- protected static final String RCSID = "";
-
-
- /**
- * The object which is being edited by this <code>StateEdit</code>.
- */
- protected StateEditable object;
-
-
- /**
- * The state of <code>object</code> at the time of constructing
- * this <code>StateEdit</code>.
- */
- protected Hashtable preState;
-
-
- /**
- * The state of <code>object</code> at the time when {@link #end()}
- * was called.
- */
- protected Hashtable postState;
-
-
- /**
- * A human-readable name for this edit action.
- */
- protected String undoRedoName;
-
-
- /**
- * Constructs a <code>StateEdit</code>, specifying the object whose
- * state is being edited.
- *
- * @param obj the object whose state is being edited by this
- * <code>StateEdit</code>.
- */
- public StateEdit(StateEditable obj)
- {
- init(obj, null);
- }
-
-
- /**
- * Constructs a <code>StateEdit</code>, specifying the object whose
- * state is being edited.
- *
- * @param obj the object whose state is being edited by this
- * <code>StateEdit</code>.
- *
- * @param name the human-readable name of the editing action.
- */
- public StateEdit(StateEditable obj, String name)
- {
- init(obj, name);
- }
-
-
- /**
- * Initializes this <code>StateEdit</code>. The edited object will
- * be asked to store its current state into {@link #preState}.
- *
- * @param obj the object being edited.
- *
- * @param name the human-readable name of the editing action.
- */
- protected void init(StateEditable obj, String name)
- {
- object = obj;
- undoRedoName = name;
- preState = new Hashtable();
- postState = new Hashtable();
- obj.storeState(preState);
- }
-
-
- /**
- * Informs this <code>StateEdit</code> that all edits are finished.
- * The edited object will be asked to store its state into {@link
- * #postState}, and any redundant entries will get removed from
- * {@link #preState} and {@link #postState}.
- */
- public void end()
- {
- object.storeState(postState);
- removeRedundantState();
- }
-
-
- /**
- * Undoes this edit operation. The edited object will be asked to
- * {@linkplain StateEditable#restoreState restore its state} from
- * {@link #preState}.
- *
- * @throws CannotUndoException if {@link #canUndo()} returns
- * <code>false</code>, for example because this action has already
- * been undone.
- */
- public void undo()
- {
- super.undo();
- object.restoreState(preState);
- }
-
-
- /**
- * Redoes this edit operation. The edited object will be asked to
- * {@linkplain StateEditable#restoreState restore its state} from
- * {@link #postState}.
- *
- * @throws CannotRedoException if {@link #canRedo()} returns
- * <code>false</code>, for example because this action has not yet
- * been undone.
- */
- public void redo()
- {
- super.redo();
- object.restoreState(postState);
- }
-
-
- /**
- * Returns a human-readable, localized name that describes this
- * editing action and can be displayed to the user.
- *
- * @return the name, or <code>null</code> if no presentation
- * name is available.
- */
- public String getPresentationName()
- {
- return undoRedoName;
- }
-
-
- /**
- * Removes all redundant entries from the pre- and post-edit state
- * hash tables. An entry is considered redundant if it is present
- * both before and after the edit, and if the two values are equal.
- */
- protected void removeRedundantState()
- {
- Iterator i = preState.keySet().iterator();
- while (i.hasNext())
- {
- Object key = i.next();
- if (postState.containsKey(key))
- {
- if (preState.get(key).equals(postState.get(key)))
- {
- i.remove();
- postState.remove(key);
- }
- }
- }
- }
-}
diff --git a/libjava/javax/swing/undo/StateEditable.java b/libjava/javax/swing/undo/StateEditable.java
deleted file mode 100644
index 9a7fb09545d..00000000000
--- a/libjava/javax/swing/undo/StateEditable.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* StateEditable.java -- Interface for collaborating with StateEdit.
- Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.undo;
-
-import java.util.Hashtable;
-
-
-/**
- * The interface for objects whose state can be undone or redone by a
- * {@link StateEdit} action.
- *
- * <p>The following example shows how to write a class that implements
- * this interface.
- *
- * <pre> class Foo
- * implements StateEditable
- * {
- * private String name;
- *
- * public void setName(String n) { name = n; }
- *
- * public void restoreState(Hashtable h)
- * {
- * if (h.containsKey("name"))
- * setName((String) h.get("name"));
- * }
- *
- * public void storeState(Hashtable s)
- * {
- * s.put("name", name);
- * }
- * }</pre>
- *
- * @see StateEdit
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public interface StateEditable
-{
- /**
- * The ID of the Java source file in Sun&#x2019;s Revision Control
- * System (RCS). This certainly should not be part of the API
- * specification. But in order to be API-compatible with
- * Sun&#x2019;s reference implementation, GNU Classpath also has to
- * provide this field. However, we do not try to match its value.
- */
- String RCSID = "";
-
-
- /**
- * Performs an edit action, taking any editable state information
- * from the specified hash table.
- *
- * <p><b>Note to implementors of this interface:</b> To increase
- * efficiency, the <code>StateEdit</code> class {@linkplan
- * StateEdit#removeRedundantState() removes redundant state
- * information}. Therefore, implementations of this interface must be
- * prepared for the case where certain keys were stored into the
- * table by {@link #storeState}, but are not present anymore
- * when the <code>restoreState</code> method gets called.
- *
- * @param state a hash table containing the relevant state
- * information.
- */
- void restoreState(Hashtable state);
-
-
- /**
- * Stores any editable state information into the specified hash
- * table.
- *
- * @param state a hash table for storing relevant state
- * information.
- */
- void storeState(Hashtable state);
-}
diff --git a/libjava/javax/swing/undo/UndoManager.java b/libjava/javax/swing/undo/UndoManager.java
deleted file mode 100644
index 97bd3d31c8f..00000000000
--- a/libjava/javax/swing/undo/UndoManager.java
+++ /dev/null
@@ -1,625 +0,0 @@
-/* AbstractTableModel.java --
- Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.undo;
-
-import javax.swing.UIManager;
-import javax.swing.event.UndoableEditEvent;
-import javax.swing.event.UndoableEditListener;
-
-
-/**
- * A manager for providing an application&#x2019;s undo/redo
- * functionality.
- *
- * <p>Tyipcally, an application will create only one single instance
- * of UndoManager. When the user performs an undoable action, for
- * instance changing the color of an object from green to blue, the
- * application registers an {@link UndoableEdit} object with the
- * <code>UndoManager</code>. To implement the &#x201c;undo&#x201d; and
- * &#x201c;redo&#x201d; menu commands, the application invokes the
- * UndoManager&#x2019;s {@link #undo} and {@link #redo} methods. The
- * human-readable text of these menu commands is provided by {@link
- * #getUndoPresentationName} and {@link #getRedoPresentationName},
- * respectively. To determine whether the menu item should be
- * selectable or greyed out, use {@link #canUndo} and {@link
- * #canRedo}.
- *
- * <p>The UndoManager will only keep a specified number of editing
- * actions, the <em>limit</em>. The value of this parameter can be
- * retrieved by calling {@link #getLimit} and set with {@link
- * #setLimit}. If more UndoableEdits are added to the UndoManager,
- * the oldest actions will be discarded.
- *
- * <p>Some applications do not provide separate menu commands for
- * &#x201c;undo&#x201d; and &#x201c;redo.&#x201d; Instead, they
- * have just a single command whose text switches between the two.
- * Such applications would use an UndoManager with a <code>limit</code>
- * of 1. The text of this combined menu item is available via
- * {@link #getUndoOrRedoPresentationName}, and it is implemented
- * by calling {@link #undoOrRedo}.
- *
- * <p><b>Thread Safety:</b> In constrast to the other classes of the
- * <code>javax.swing.undo</code> package, the public methods of an
- * <code>UndoManager</code> are safe to call from concurrent threads.
- * The caller does not need to perform external synchronization, and
- * {@link javax.swing.event.UndoableEvent} sources do not need to
- * broadcast their events from inside the Swing worker thread.
- *
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class UndoManager
- extends CompoundEdit
- implements UndoableEditListener
-{
- /**
- * The unique ID for serializing instances of this class. Determined
- * using the <code>serialver</code> tool of Sun JDK 1.4.1_01 on
- * GNU/Linux.
- */
- static final long serialVersionUID = -2077529998244066750L;
-
-
- /**
- * An index into the inherited {@link #edits} Vector that indicates
- * at which position newly added editing actions would get inserted.
- *
- * <p>Normally, the value of <code>indexOfNextAdd</code> equals
- * the number of UndoableEdits stored by this UndoManager, i.e.
- * <code>edits.size()</code>. For each call to {@link #undo},
- * <code>indexOfNextAdd</code> is decremented by one. For each
- * call to {@link #redo}, it is incremented again.
- */
- int indexOfNextAdd;
-
-
- /**
- * The maximum number of UndoableEdits stored by this UndoManager.
- */
- int limit;
-
-
- /**
- * Constructs an UndoManager.
- *
- * <p>The <code>limit</code> of the freshly constructed UndoManager
- * is 100.
- */
- public UndoManager()
- {
- limit = 100;
- }
-
-
- /**
- * Returns a string representation for this UndoManager. This may be
- * useful for debugging purposes. For the text of menu items, please
- * refer to {@link #getUndoPresentationName}, {@link
- * #getRedoPresentationName}, and {@link
- * #getUndoOrRedoPresentationName}.
- */
- public String toString()
- {
- return super.toString()
- + " limit: " + limit
- + " indexOfNextAdd: " + indexOfNextAdd;
- }
-
-
- /**
- * Puts this UndoManager into a state where it acts as a normal
- * {@link CompoundEdit}. It is unlikely that an application would
- * want to do this.
- */
- public synchronized void end()
- {
- super.end();
- trimEdits(indexOfNextAdd, edits.size() - 1);
- }
-
-
- /**
- * Returns how many edits this UndoManager can maximally hold.
- *
- * @see #setLimit
- */
- public synchronized int getLimit()
- {
- return limit;
- }
-
-
- /**
- * Changes the maximal number of edits that this UndoManager can
- * process. If there are currently more edits than the new limit
- * allows, they will receive a {@link UndoableEdit#die() die}
- * message in reverse order of addition.
- *
- * @param limit the new limit.
- *
- * @throws IllegalStateException if {@link #end()} has already been
- * called on this UndoManager.
- */
- public synchronized void setLimit(int limit)
- {
- if (!isInProgress())
- throw new IllegalStateException();
-
- this.limit = limit;
- trimForLimit();
- }
-
-
- /**
- * Discards all editing actions that are currently registered with
- * this UndoManager. Each {@link UndoableEdit} will receive a {@link
- * UndoableEdit#die() die message}.
- */
- public synchronized void discardAllEdits()
- {
- int size;
-
- size = edits.size();
- for (int i = size - 1; i >= 0; i--)
- ((UndoableEdit) edits.get(i)).die();
- indexOfNextAdd = 0;
- edits.clear();
- }
-
-
- /**
- * Called by various internal methods in order to enforce
- * the <code>limit</code> value.
- */
- protected void trimForLimit()
- {
- int high, s;
-
- s = edits.size();
-
- /* The Sun J2SE1.4.1_01 implementation can be observed to do
- * nothing (instead of throwing an exception) with a negative or
- * zero limit. It may be debatable whether this is the best
- * behavior, but we replicate it for sake of compatibility.
- */
- if (limit <= 0 || s <= limit)
- return;
-
- high = Math.min(indexOfNextAdd + limit/2 - 1, s - 1);
- trimEdits(high + 1, s - 1);
- trimEdits(0, high - limit);
- }
-
-
- /**
- * Discards a range of edits. All edits in the range <code>[from
- * .. to]</code> will receive a {@linkplain UndoableEdit#die() die
- * message} before being removed from the edits array. If
- * <code>from</code> is greater than <code>to</code>, nothing
- * happens.
- *
- * @param from the lower bound of the range of edits to be
- * discarded.
- *
- * @param to the upper bound of the range of edits to be discarded.
- */
- protected void trimEdits(int from, int to)
- {
- if (from > to)
- return;
-
- for (int i = to; i >= from; i--)
- ((UndoableEdit) edits.get(i)).die();
-
- // Remove the range [from .. to] from edits. If from == to, which
- // is likely to be a very common case, we can do better than
- // creating a sub-list and clearing it.
- if (to == from)
- edits.remove(from);
- else
- edits.subList(from, to + 1).clear();
-
- if (indexOfNextAdd > to)
- indexOfNextAdd = indexOfNextAdd - to + from - 1;
- else if (indexOfNextAdd >= from)
- indexOfNextAdd = from;
- }
-
-
- /**
- * Determines which significant edit would be undone if {@link
- * #undo()} was called.
- *
- * @returns the significant edit that would be undone, or
- * <code>null</code> if no significant edit would be affected by
- * calling {@link #undo()}.
- */
- protected UndoableEdit editToBeUndone()
- {
- UndoableEdit result;
-
- for (int i = indexOfNextAdd - 1; i >= 0; i--)
- {
- result = (UndoableEdit) edits.get(i);
- if (result.isSignificant())
- return result;
- }
-
- return null;
- }
-
-
- /**
- * Determines which significant edit would be redone if {@link
- * #redo()} was called.
- *
- * @returns the significant edit that would be redone, or
- * <code>null</code> if no significant edit would be affected by
- * calling {@link #redo()}.
- */
- protected UndoableEdit editToBeRedone()
- {
- UndoableEdit result;
-
- for (int i = indexOfNextAdd; i < edits.size(); i++)
- {
- result = (UndoableEdit) edits.get(i);
- if (result.isSignificant())
- return result;
- }
-
- return null;
- }
-
-
- /**
- * Undoes all editing actions in reverse order of addition,
- * up to the specified action,
- *
- * @param edit the last editing action to be undone.
- */
- protected void undoTo(UndoableEdit edit)
- throws CannotUndoException
- {
- UndoableEdit cur;
-
- if (!edits.contains(edit))
- throw new CannotUndoException();
-
- while (true)
- {
- indexOfNextAdd -= 1;
- cur = (UndoableEdit) edits.get(indexOfNextAdd);
- cur.undo();
- if (cur == edit)
- return;
- }
- }
-
-
- /**
- * Redoes all editing actions in the same order as they were
- * added to this UndoManager, up to the specified action.
- *
- * @param edit the last editing action to be redone.
- */
- protected void redoTo(UndoableEdit edit)
- throws CannotRedoException
- {
- UndoableEdit cur;
-
- if (!edits.contains(edit))
- throw new CannotRedoException();
-
- while (true)
- {
- cur = (UndoableEdit) edits.get(indexOfNextAdd);
- indexOfNextAdd += 1;
- cur.redo();
- if (cur == edit)
- return;
- }
- }
-
-
- /**
- * Undoes or redoes the last action. If the last action has already
- * been undone, it will be re-done, and vice versa.
- *
- * <p>This is useful for applications that do not present a separate
- * undo and redo facility, but just have a single menu item for
- * undoing and redoing the very last action. Such applications will
- * use an <code>UndoManager</code> whose <code>limit</code> is 1.
- */
- public synchronized void undoOrRedo()
- throws CannotRedoException, CannotUndoException
- {
- if (indexOfNextAdd == edits.size())
- undo();
- else
- redo();
- }
-
-
- /**
- * Determines whether it would be possible to either undo or redo
- * this editing action.
- *
- * <p>This is useful for applications that do not present a separate
- * undo and redo facility, but just have a single menu item for
- * undoing and redoing the very last action. Such applications will
- * use an <code>UndoManager</code> whose <code>limit</code> is 1.
- *
- * @return <code>true</code> to indicate that this action can be
- * undone or redone; <code>false</code> if neither is possible at
- * the current time.
- */
- public synchronized boolean canUndoOrRedo()
- {
- return indexOfNextAdd == edits.size() ? canUndo() : canRedo();
- }
-
-
- /**
- * Undoes one significant edit action. If insignificant actions have
- * been posted after the last signficant action, the insignificant
- * ones will be undone first.
- *
- * <p>However, if {@link #end()} has been called on this
- * UndoManager, it will behave like a normal {@link
- * CompoundEdit}. In this case, all actions will be undone in
- * reverse order of addition. Typical applications will never call
- * {@link #end()} on their <code>UndoManager</code>.
- *
- * @throws CannotUndoException if no action can be undone.
- *
- * @see #canUndo()
- * @see #redo()
- * @see #undoOrRedo()
- */
- public synchronized void undo()
- throws CannotUndoException
- {
- if (!isInProgress())
- {
- super.undo();
- return;
- }
-
- UndoableEdit edit = editToBeUndone();
- if (edit == null)
- throw new CannotUndoException();
-
- undoTo(edit);
- }
-
-
- /**
- * Determines whether it would be possible to undo this editing
- * action.
- *
- * @return <code>true</code> to indicate that this action can be
- * undone; <code>false</code> otherwise.
- *
- * @see #undo()
- * @see #canRedo()
- * @see #canUndoOrRedo()
- */
- public synchronized boolean canUndo()
- {
- UndoableEdit edit;
-
- if (!isInProgress())
- return super.canUndo();
-
- edit = editToBeUndone();
- return edit != null && edit.canUndo();
- }
-
-
-
- /**
- * Redoes one significant edit action. If insignificant actions have
- * been posted in between, the insignificant ones will be redone
- * first.
- *
- * <p>However, if {@link #end()} has been called on this
- * UndoManager, it will behave like a normal {@link
- * CompoundEdit}. In this case, <em>all</em> actions will be redone
- * in order of addition. Typical applications will never call {@link
- * #end()} on their <code>UndoManager</code>.
- *
- * @throws CannotRedoException if no action can be redone.
- *
- * @see #canRedo()
- * @see #redo()
- * @see #undoOrRedo()
- */
- public synchronized void redo()
- throws CannotRedoException
- {
- if (!isInProgress())
- {
- super.redo();
- return;
- }
-
- UndoableEdit edit = editToBeRedone();
- if (edit == null)
- throw new CannotRedoException();
-
- redoTo(edit);
- }
-
-
- /**
- * Determines whether it would be possible to redo this editing
- * action.
- *
- * @return <code>true</code> to indicate that this action can be
- * redone; <code>false</code> otherwise.
- *
- * @see #redo()
- * @see #canUndo()
- * @see #canUndoOrRedo()
- */
- public synchronized boolean canRedo()
- {
- UndoableEdit edit;
-
- if (!isInProgress())
- return super.canRedo();
-
- edit = editToBeRedone();
- return edit != null && edit.canRedo();
- }
-
-
- /**
- * Registers an undoable editing action with this UndoManager. If
- * the capacity <code>limit</code> is reached, the oldest action
- * will be discarded (and receives a {@linkplain UndoableEdit#die()
- * die message}. Equally, any actions that were undone (but not re-done)
- * will be discarded, too.
- *
- * @param edit the editing action that is added to this UndoManager.
- *
- * @return <code>true</code> if <code>edit</code> could be
- * incorporated; <code>false</code> if <code>edit</code> has not
- * been incorporated because {@link #end()} has already been called
- * on this <code>UndoManager</code>.
- */
- public synchronized boolean addEdit(UndoableEdit edit)
- {
- boolean result;
-
- // Discard any edits starting at indexOfNextAdd.
- trimEdits(indexOfNextAdd, edits.size() - 1);
-
- result = super.addEdit(edit);
- indexOfNextAdd = edits.size();
- trimForLimit();
- return result;
- }
-
-
- /**
- * Calculates a localized text for presenting the undo or redo
- * action to the user, for example in the form of a menu command.
- *
- * <p>This is useful for applications that do not present a separate
- * undo and redo facility, but just have a single menu item for
- * undoing and redoing the very last action. Such applications will
- * use an <code>UndoManager</code> whose <code>limit</code> is 1.
- *
- * @return the redo presentation name if the last action has already
- * been undone, or the undo presentation name otherwise.
- *
- * @see #getUndoPresentationName()
- * @see #getRedoPresentationName()
- */
- public synchronized String getUndoOrRedoPresentationName()
- {
- if (indexOfNextAdd == edits.size())
- return getUndoPresentationName();
- else
- return getRedoPresentationName();
- }
-
-
- /**
- * Calculates a localized text for presenting the undo action
- * to the user, for example in the form of a menu command.
- */
- public synchronized String getUndoPresentationName()
- {
- UndoableEdit edit;
-
- if (!isInProgress())
- return super.getUndoPresentationName();
-
- edit = editToBeUndone();
- if (edit == null)
- return UIManager.getString("AbstractUndoableEdit.undoText");
- else
- return edit.getUndoPresentationName();
- }
-
-
- /**
- * Calculates a localized text for presenting the redo action
- * to the user, for example in the form of a menu command.
- */
- public synchronized String getRedoPresentationName()
- {
- UndoableEdit edit;
-
- if (!isInProgress())
- return super.getRedoPresentationName();
-
- edit = editToBeRedone();
- if (edit == null)
- return UIManager.getString("AbstractUndoableEdit.redoText");
- else
- return edit.getRedoPresentationName();
- }
-
-
- /**
- * Registers the edit action of an {@link UndoableEditEvent}
- * with this UndoManager.
- *
- * <p><b>Thread Safety:</b> This method may safely be invoked from
- * concurrent threads. The caller does not need to perform external
- * synchronization. This means that {@link
- * javax.swing.event.UndoableEvent} sources do not need to broadcast
- * their events from inside the Swing worker thread.
- *
- * @param event the event whose <code>edit</code> will be
- * passed to {@link #addEdit}.
- *
- * @see UndoableEditEvent#getEdit()
- * @see #addEdit
- */
- public void undoableEditHappened(UndoableEditEvent event)
- {
- // Note that this method does not need to be synchronized,
- // because addEdit will obtain and release the mutex.
- addEdit(event.getEdit());
- }
-}
diff --git a/libjava/javax/swing/undo/UndoableEdit.java b/libjava/javax/swing/undo/UndoableEdit.java
deleted file mode 100644
index 982d7f2a729..00000000000
--- a/libjava/javax/swing/undo/UndoableEdit.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* AbstractTableModel.java --
- Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.undo;
-
-/**
- * UndoableEdit public interface
- * @author Andrew Selkirk
- */
-public interface UndoableEdit {
-
- /**
- * anEdit
- * @param anEdit TODO
- * @returns TODO
- */
- boolean addEdit(UndoableEdit anEdit);
-
- /**
- * canRedo
- * @returns TODO
- */
- boolean canRedo();
-
- /**
- * canRedo
- * @returns TODO
- */
- boolean canUndo();
-
- /**
- * die
- */
- void die();
-
- /**
- * getPresentationName
- * @returns TODO
- */
- String getPresentationName();
-
- /**
- * getRedoPresentationName
- * @returns TODO
- */
- String getRedoPresentationName();
-
- /**
- * getUndoPresentationName
- * @returns TODO
- */
- String getUndoPresentationName();
-
- /**
- * isSignificant
- * @returns TODO
- */
- boolean isSignificant();
-
- /**
- * redo
- * @throws CannotRedoException TODO
- */
- void redo() throws CannotRedoException;
-
- /**
- * replaceEdit
- * @param anEdit TODO
- * @returns TODO
- */
- boolean replaceEdit(UndoableEdit anEdit);
-
- /**
- * undo
- * @throws CannotUndoException TODO
- */
- void undo() throws CannotUndoException;
-
-
-} // UndoableEdit
diff --git a/libjava/javax/swing/undo/UndoableEditSupport.java b/libjava/javax/swing/undo/UndoableEditSupport.java
deleted file mode 100644
index 227d2824779..00000000000
--- a/libjava/javax/swing/undo/UndoableEditSupport.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/* UndoableEditSupport.java --
- Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.undo;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import javax.swing.event.UndoableEditEvent;
-import javax.swing.event.UndoableEditListener;
-
-/**
- * A helper class for supporting {@link
- * javax.swing.event.UndoableEditListener}.
- *
- * @author Andrew Selkirk (aselkirk@sympatico.ca)
- * @author Sascha Brawer (brawer@dandelis.ch)
- */
-public class UndoableEditSupport
-{
- /**
- * The number of times that {@link #beginUpdate()} has been called
- * without a matching call to {@link #endUpdate()}.
- */
- protected int updateLevel;
-
-
- /**
- * compoundEdit
- */
- protected CompoundEdit compoundEdit;
-
-
- /**
- * The currently registered listeners.
- */
- protected Vector listeners = new Vector();
-
-
- /**
- * The source of the broadcast UndoableEditEvents.
- */
- protected Object realSource;
-
-
- /**
- * Constructs a new helper for broadcasting UndoableEditEvents. The
- * events will indicate the newly constructed
- * <code>UndoableEditSupport</code> instance as their source.
- *
- * @see #UndoableEditSupport(java.lang.Object)
- */
- public UndoableEditSupport()
- {
- realSource = this;
- }
-
-
- /**
- * Constructs a new helper for broadcasting UndoableEditEvents.
- *
- * @param realSource the source of the UndoableEditEvents that will
- * be broadcast by this helper. If <code>realSource</code> is
- * <code>null</code>, the events will indicate the newly constructed
- * <code>UndoableEditSupport</code> instance as their source.
- */
- public UndoableEditSupport(Object realSource)
- {
- if (realSource == null)
- realSource = this;
- this.realSource = realSource;
- }
-
-
- /**
- * Returns a string representation of this object that may be useful
- * for debugging.
- */
- public String toString()
- {
- // Note that often, this.realSource == this. Therefore, dumping
- // realSource without additional checks may lead to infinite
- // recursion. See Classpath bug #7119.
- return super.toString() + " updateLevel: " + updateLevel
- + " listeners: " + listeners + " compoundEdit: " + compoundEdit;
- }
-
-
- /**
- * Registers a listener.
- *
- * @param val the listener to be added.
- */
- public synchronized void addUndoableEditListener(UndoableEditListener val)
- {
- listeners.add(val);
- }
-
-
- /**
- * Unregisters a listener.
- * @param val the listener to be removed.
- */
- public synchronized void removeUndoableEditListener(UndoableEditListener val)
- {
- listeners.removeElement(val);
- }
-
-
- /**
- * Returns an array containing the currently registered listeners.
- */
- public synchronized UndoableEditListener[] getUndoableEditListeners()
- {
- UndoableEditListener[] result = new UndoableEditListener[listeners.size()];
- return (UndoableEditListener[]) listeners.toArray(result);
- }
-
-
- /**
- * Notifies all registered listeners that an {@link
- * UndoableEditEvent} has occured.
- *
- * <p><b>Lack of Thread Safety:</b> It is <em>not</em> safe to call
- * this method from concurrent threads, unless the call is protected
- * by a synchronization on this <code>UndoableEditSupport</code>
- * instance.
- *
- * @param edit the edit action to be posted.
- */
- protected void _postEdit(UndoableEdit edit)
- {
- UndoableEditEvent event;
- Iterator iter;
-
- // Do nothing if we have no listeners.
- if (listeners.isEmpty())
- return;
-
- event = new UndoableEditEvent(realSource, edit);
-
- // We clone the vector because this allows listeners to register
- // or unregister listeners in their undoableEditHappened method.
- // Otherwise, this would throw exceptions (in the case of
- // Iterator, a java.util.ConcurrentModificationException; in the
- // case of a direct loop over the Vector elements, some
- // index-out-of-bounds exception).
- iter = ((Vector) listeners.clone()).iterator();
- while (iter.hasNext())
- ((UndoableEditListener) iter.next()).undoableEditHappened(event);
- }
-
-
- /**
- * If {@link #beginEdit} has been called (so that the current
- * update level is greater than zero), adds the specified edit
- * to {@link #compoundEdit}. Otherwise, notify listeners of the
- * edit by calling {@link #_postEdit(UndoableEdit)}.
- *
- * <p><b>Thread Safety:</b> It is safe to call this method from any
- * thread without external synchronization.
- *
- * @param edit the edit action to be posted.
- */
- public synchronized void postEdit(UndoableEdit edit)
- {
- if (compoundEdit != null)
- compoundEdit.addEdit(edit);
- else
- _postEdit(edit);
- }
-
-
- /**
- * Returns the current update level.
- */
- public int getUpdateLevel()
- {
- return updateLevel;
- }
-
-
- /**
- * Starts a (possibly nested) update session. If the current update
- * level is zero, {@link #compoundEdit} is set to the result of the
- * {@link #createCompoundEdit} method. In any case, the update level
- * is increased by one.
- *
- * <p><b>Thread Safety:</b> It is safe to call this method from any
- * thread without external synchronization.
- */
- public synchronized void beginUpdate()
- {
- if (compoundEdit == null)
- compoundEdit = createCompoundEdit();
- ++updateLevel;
- }
-
-
- /**
- * Creates a new instance of {@link #CompoundEdit}. Called by {@link
- * #beginUpdate}. If a subclass wants {@link #beginUpdate} to work
- * on a specific {@link #compoundEdit}, it should override this
- * method.
- *
- * @returns a newly created instance of {@link #CompoundEdit}.
- */
- protected CompoundEdit createCompoundEdit()
- {
- return new CompoundEdit();
- }
-
-
- /**
- * Ends an update session. If the terminated session was the
- * outermost session, {@link #compoundEdit} will receive an
- * <code>end</code> message, and {@link #_postEdit} gets called in
- * order to notify any listeners. Finally, the
- * <code>compoundEdit</code> is discarded.
- *
- * <p><b>Thread Safety:</b> It is safe to call this method from any
- * thread without external synchronization.
- */
- public synchronized void endUpdate()
- {
- if (updateLevel == 0)
- throw new IllegalStateException();
-
- if (--updateLevel > 0)
- return;
-
- compoundEdit.end();
- _postEdit(compoundEdit);
- compoundEdit = null;
- }
-}
diff --git a/libjava/javax/transaction/HeuristicCommitException.java b/libjava/javax/transaction/HeuristicCommitException.java
deleted file mode 100644
index 60ac7756aa3..00000000000
--- a/libjava/javax/transaction/HeuristicCommitException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* HeuristicCommitException.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public class HeuristicCommitException extends Exception
-{
- public HeuristicCommitException ()
- {
- super();
- }
-
- public HeuristicCommitException (String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/transaction/HeuristicMixedException.java b/libjava/javax/transaction/HeuristicMixedException.java
deleted file mode 100644
index b5e89fb1a10..00000000000
--- a/libjava/javax/transaction/HeuristicMixedException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* HeuristicMixedException.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public class HeuristicMixedException extends Exception
-{
- public HeuristicMixedException ()
- {
- super();
- }
-
- public HeuristicMixedException (String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/transaction/HeuristicRollbackException.java b/libjava/javax/transaction/HeuristicRollbackException.java
deleted file mode 100644
index 3ad34fa47bb..00000000000
--- a/libjava/javax/transaction/HeuristicRollbackException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* HeuristicRollbackException.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public class HeuristicRollbackException extends Exception
-{
- public HeuristicRollbackException ()
- {
- super();
- }
-
- public HeuristicRollbackException (String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/transaction/InvalidTransactionException.java b/libjava/javax/transaction/InvalidTransactionException.java
deleted file mode 100644
index 82eefe67eb2..00000000000
--- a/libjava/javax/transaction/InvalidTransactionException.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* InvalidTransactionException.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-import java.rmi.RemoteException;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date April 18, 2001
- */
-
-public class InvalidTransactionException extends RemoteException
-{
- public InvalidTransactionException ()
- {
- super();
- }
-
- public InvalidTransactionException (String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/transaction/NotSupportedException.java b/libjava/javax/transaction/NotSupportedException.java
deleted file mode 100644
index a416d133aa4..00000000000
--- a/libjava/javax/transaction/NotSupportedException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* NotSupportedException.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public class NotSupportedException extends Exception
-{
- public NotSupportedException ()
- {
- super();
- }
-
- public NotSupportedException (String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/transaction/RollbackException.java b/libjava/javax/transaction/RollbackException.java
deleted file mode 100644
index 4fd51cf6e2c..00000000000
--- a/libjava/javax/transaction/RollbackException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* RollbackException.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public class RollbackException extends Exception
-{
- public RollbackException ()
- {
- super();
- }
-
- public RollbackException (String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/transaction/Status.java b/libjava/javax/transaction/Status.java
deleted file mode 100644
index 6bbbffbf00a..00000000000
--- a/libjava/javax/transaction/Status.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Status.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public interface Status
-{
- int STATUS_ACTIVE = 0;
- int STATUS_MARKED_ROLLBACK = 1;
- int STATUS_PREPARED = 2;
- int STATUS_COMMITTED = 3;
- int STATUS_ROLLEDBACK = 4;
- int STATUS_UNKNOWN = 5;
- int STATUS_NO_TRANSACTION = 6;
- int STATUS_PREPARING = 7;
- int STATUS_COMMITTING = 8;
- int STATUS_ROLLING_BACK = 9;
-}
diff --git a/libjava/javax/transaction/Synchronization.java b/libjava/javax/transaction/Synchronization.java
deleted file mode 100644
index eea50277cb1..00000000000
--- a/libjava/javax/transaction/Synchronization.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Synchronization.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public interface Synchronization
-{
- void beforeCompletion();
- void afterCompletion(int status);
-}
diff --git a/libjava/javax/transaction/SystemException.java b/libjava/javax/transaction/SystemException.java
deleted file mode 100644
index d614fb3c5ab..00000000000
--- a/libjava/javax/transaction/SystemException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* SystemException.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public class SystemException extends Exception
-{
- public int errorCode;
-
- public SystemException ()
- {
- super();
- }
-
- public SystemException (String msg)
- {
- super(msg);
- }
-
- public SystemException(int errcode)
- {
- super ();
- this.errorCode = errcode;
- }
-}
diff --git a/libjava/javax/transaction/Transaction.java b/libjava/javax/transaction/Transaction.java
deleted file mode 100644
index b5b7108f069..00000000000
--- a/libjava/javax/transaction/Transaction.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Transaction.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-import javax.transaction.xa.XAResource;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public interface Transaction
-{
- void commit()
- throws RollbackException, HeuristicMixedException,
- HeuristicRollbackException, SecurityException, SystemException;
-
- boolean delistResource(XAResource xaRes, int flag)
- throws IllegalStateException, SystemException;
-
- boolean enlistResource(XAResource xaRes)
- throws RollbackException, IllegalStateException, SystemException;
-
- int getStatus() throws SystemException;
-
- void registerSynchronization(Synchronization sync)
- throws RollbackException, IllegalStateException, SystemException;
-
- void rollback()
- throws IllegalStateException, SystemException;
-
- void setRollbackOnly()
- throws IllegalStateException, SystemException;
-}
diff --git a/libjava/javax/transaction/TransactionManager.java b/libjava/javax/transaction/TransactionManager.java
deleted file mode 100644
index 85a4da9f5df..00000000000
--- a/libjava/javax/transaction/TransactionManager.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* TransactionManager.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public interface TransactionManager
-{
- void begin() throws NotSupportedException, SystemException;
-
- void commit()
- throws RollbackException, HeuristicMixedException,
- HeuristicRollbackException, SecurityException,
- IllegalStateException, SystemException;
-
- int getStatus() throws SystemException;
-
- Transaction getTransaction() throws SystemException;
-
- void resume(Transaction tobj)
- throws InvalidTransactionException, IllegalStateException,
- SystemException;
-
- void rollback()
- throws IllegalStateException, SecurityException, SystemException;
-
- void setRollbackOnly()
- throws IllegalStateException, SystemException;
-
- void setTransactionTimeout(int seconds) throws SystemException;
-
- Transaction suspend() throws SystemException;
-}
diff --git a/libjava/javax/transaction/TransactionRequiredException.java b/libjava/javax/transaction/TransactionRequiredException.java
deleted file mode 100644
index 6c889481005..00000000000
--- a/libjava/javax/transaction/TransactionRequiredException.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* TransactionRequiredException --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-import java.rmi.RemoteException;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date April 18, 2001
- */
-
-public class TransactionRequiredException extends RemoteException
-{
- public TransactionRequiredException ()
- {
- super();
- }
-
- public TransactionRequiredException (String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/transaction/TransactionRolledbackException.java b/libjava/javax/transaction/TransactionRolledbackException.java
deleted file mode 100644
index 49c22a70e22..00000000000
--- a/libjava/javax/transaction/TransactionRolledbackException.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* TransactionRolledbackException --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-import java.rmi.RemoteException;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date April 18, 2001
- */
-
-public class TransactionRolledbackException extends RemoteException
-{
- public TransactionRolledbackException ()
- {
- super();
- }
-
- public TransactionRolledbackException (String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/javax/transaction/UserTransaction.java b/libjava/javax/transaction/UserTransaction.java
deleted file mode 100644
index 86922932ed3..00000000000
--- a/libjava/javax/transaction/UserTransaction.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* UserTransaction.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public interface UserTransaction
-{
- void begin() throws NotSupportedException, SystemException;
-
- void commit()
- throws RollbackException, HeuristicMixedException,
- HeuristicRollbackException, SecurityException,
- IllegalStateException, SystemException;
-
- void rollback()
- throws IllegalStateException, SecurityException, SystemException;
-
- void setRollbackOnly()
- throws IllegalStateException, SystemException;
-
- int getStatus() throws SystemException;
-
- void setTransactionTimeout(int seconds) throws SystemException;
-}
diff --git a/libjava/javax/transaction/xa/XAException.java b/libjava/javax/transaction/xa/XAException.java
deleted file mode 100644
index ceb76f0907f..00000000000
--- a/libjava/javax/transaction/xa/XAException.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* XAException.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction.xa;
-
-/**
- * @author Tom Tromey (tromey@redhat.com)
- * @date April 18, 2001
- */
-
-public class XAException extends Exception
-{
- public int errorCode;
- public static final int XA_RBBASE = 100;
- public static final int XA_RBROLLBACK = 100;
- public static final int XA_RBCOMMFAIL = 101;
- public static final int XA_RBDEADLOCK = 102;
- public static final int XA_RBINTEGRITY = 103;
- public static final int XA_RBOTHER = 104;
- public static final int XA_RBPROTO = 105;
- public static final int XA_RBTIMEOUT = 106;
- public static final int XA_RBTRANSIENT = 107;
- public static final int XA_RBEND = 107;
- public static final int XA_NOMIGRATE = 9;
- public static final int XA_HEURHAZ = 8;
- public static final int XA_HEURCOM = 7;
- public static final int XA_HEURRB = 6;
- public static final int XA_HEURMIX = 5;
- public static final int XA_RETRY = 4;
- public static final int XA_RDONLY = 3;
- public static final int XAER_ASYNC = -2;
- public static final int XAER_RMERR = -3;
- public static final int XAER_NOTA = -4;
- public static final int XAER_INVAL = -5;
- public static final int XAER_PROTO = -6;
- public static final int XAER_RMFAIL = -7;
- public static final int XAER_DUPID = -8;
- public static final int XAER_OUTSIDE = -9;
-
- public XAException ()
- {
- super ();
- }
-
- public XAException (String msg)
- {
- super (msg);
- }
-
- public XAException (int errcode)
- {
- super ();
- this.errorCode = errcode;
- }
-}
diff --git a/libjava/javax/transaction/xa/XAResource.java b/libjava/javax/transaction/xa/XAResource.java
deleted file mode 100644
index 39406344166..00000000000
--- a/libjava/javax/transaction/xa/XAResource.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* XAResource.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction.xa;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public interface XAResource
-{
- int TMENDRSCAN = 8388608;
- int TMFAIL = 536870912;
- int TMJOIN = 2097152;
- int TMNOFLAGS = 0;
- int TMONEPHASE = 1073741824;
- int TMRESUME = 134217728;
- int TMSTARTRSCAN = 16777216;
- int TMSUCCESS = 67108864;
- int TMSUSPEND = 33554432;
- int XA_RDONLY = 3;
- int XA_OK = 0;
-
- void commit(Xid xid, boolean onePhase) throws XAException;
- void end(Xid xid, int flags) throws XAException;
- void forget(Xid xid) throws XAException;
- int getTransactionTimeout() throws XAException;
- boolean isSameRM(XAResource xares) throws XAException;
- int prepare(Xid xid) throws XAException;
- Xid[] recover(int flag) throws XAException;
- void rollback(Xid xid) throws XAException;
- boolean setTransactionTimeout(int seconds) throws XAException;
- void start(Xid xid, int flags) throws XAException;
-}
diff --git a/libjava/javax/transaction/xa/Xid.java b/libjava/javax/transaction/xa/Xid.java
deleted file mode 100644
index 51e3102b6b4..00000000000
--- a/libjava/javax/transaction/xa/Xid.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Xid.java --
- Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.transaction.xa;
-
-/**
- * @author Warren Levy (warrenl@redhat.com)
- * @date May 25, 2001
- */
-
-public interface Xid
-{
- int MAXGTRIDSIZE = 64;
- int MAXBQUALSIZE = 64;
-
- int getFormatId();
- byte[] getGlobalTransactionId();
- byte[] getBranchQualifier();
-}
diff --git a/libjava/javax/xml/XMLConstants.java b/libjava/javax/xml/XMLConstants.java
deleted file mode 100644
index 735620755df..00000000000
--- a/libjava/javax/xml/XMLConstants.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/* XMLConstants.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml;
-
-/**
- * Repository for well-known XML constants.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public final class XMLConstants
-{
-
- /**
- * Dummy namespace URI indicating that there is no namespace.
- * @see http://www.w3.org/TR/REC-xml-names/#defaulting
- */
- public static final String NULL_NS_URI = "";
-
- /**
- * Dummy namespace prefix indicating that there is no namespace.
- * @see http://www.w3.org/TR/REC-xml-names/#ns-qualnames
- */
- public static final String DEFAULT_NS_PREFIX = "";
-
- /**
- * The XML Namespace URI.
- * @see http://www.w3.org/TR/REC-xml-names/#ns-qualnames
- */
- public static final String XML_NS_URI =
- "http://www.w3.org/XML/1998/namespace";
-
- /**
- * The XML Namespace prefix.
- * @see http://www.w3.org/TR/REC-xml-names/#ns-qualnames
- */
- public static final String XML_NS_PREFIX = "xml";
-
- /**
- * The XML Namespace declaration URI.
- * @see http://www.w3.org/TR/REC-xml-names/#ns-qualnames
- */
- public static final String XMLNS_ATTRIBUTE_NS_URI =
- "http://www.w3.org/2000/xmlns/";
-
- /**
- * The XML Namespace declaration attribute.
- * @see http://www.w3.org/TR/REC-xml-names/#ns-qualnames
- */
- public static final String XMLNS_ATTRIBUTE = "xmlns";
-
- /**
- * The XML Schema (XSD) namespace URI.
- * @see http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions
- */
- public static final String W3C_XML_SCHEMA_NS_URI =
- "http://www.w3.org/2001/XMLSchema";
-
- /**
- * The XML Schema Instance (XSI) namespace URI.
- * @see http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions
- */
- public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI =
- "http://www.w3.org/2001/XMLSchema-instance";
-
- /**
- * The XPath 2.0 datatypes namespace URI.
- * @see http://www.w3.org/TR/xpath-datamodel
- */
- public static final String W3C_XPATH_DATATYPE_NS_URI =
- "http://www.w3.org/2003/11/xpath-datatypes";
-
- /**
- * The XML DTD namespace URI.
- */
- public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml";
-
- /**
- * The RELAX NG Namespace URI.
- * @see http://relaxng.org/spec-20011203.html
- */
- public static final String RELAXNG_NS_URI =
- "http://relaxng.org/ns/structure/1.0";
-
- /**
- * DOM feature for secure processing.
- */
- public static final String FEATURE_SECURE_PROCESSING =
- "http://javax.xml.XMLConstants/feature/secure-processing";
-
-}
diff --git a/libjava/javax/xml/datatype/DatatypeConfigurationException.java b/libjava/javax/xml/datatype/DatatypeConfigurationException.java
deleted file mode 100644
index c17a89a7d2f..00000000000
--- a/libjava/javax/xml/datatype/DatatypeConfigurationException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* DatatypeConfigurationException.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.datatype;
-
-/**
- * A serious error during datatype configuration.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public class DatatypeConfigurationException
- extends Exception
-{
-
- public DatatypeConfigurationException()
- {
- super();
- }
-
- public DatatypeConfigurationException(String message)
- {
- super(message);
- }
-
- public DatatypeConfigurationException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public DatatypeConfigurationException(Throwable cause)
- {
- super(cause);
- }
-
-}
diff --git a/libjava/javax/xml/datatype/DatatypeConstants.java b/libjava/javax/xml/datatype/DatatypeConstants.java
deleted file mode 100644
index 3919d03daff..00000000000
--- a/libjava/javax/xml/datatype/DatatypeConstants.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/* DatatypeConstants.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.datatype;
-
-import javax.xml.namespace.QName;
-
-/**
- * Basic data type constants.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public final class DatatypeConstants
-{
-
- /**
- * Typesafe enumerated class representing the six fields of the
- * <a href='Duration.html'>Duration</a> class.
- */
- public static final class Field
- {
-
- final int id;
- final String name;
-
- Field(int id, String name)
- {
- this.id = id;
- this.name = name;
- }
-
- public int getId()
- {
- return id;
- }
-
- public String toString()
- {
- return name;
- }
-
- }
-
- /**
- * Value for January.
- */
- public static final int JANUARY = 1;
-
- /**
- * Value for February.
- */
- public static final int FEBRUARY = 2;
-
- /**
- * Value for March.
- */
- public static final int MARCH = 3;
-
- /**
- * Value for April.
- */
- public static final int APRIL = 4;
-
- /**
- * Value for May.
- */
- public static final int MAY = 5;
-
- /**
- * Value for June.
- */
- public static final int JUNE = 6;
-
- /**
- * Value for July.
- */
- public static final int JULY = 7;
-
- /**
- * Value for August.
- */
- public static final int AUGUST = 8;
-
- /**
- * Value for September.
- */
- public static final int SEPTEMBER = 9;
-
- /**
- * Value for October.
- */
- public static final int OCTOBER = 10;
-
- /**
- * Value for November.
- */
- public static final int NOVEMBER = 11;
-
- /**
- * Value for December.
- */
- public static final int DECEMBER = 12;
-
- /**
- * Comparison result.
- */
- public static final int LESSER = -1;
-
- /**
- * Comparison result.
- */
- public static final int EQUAL = 0;
-
- /**
- * Comparison result.
- */
- public static final int GREATER = 1;
-
- /**
- * Comparison result.
- */
- public static final int INDETERMINATE = 2;
-
- /**
- * Comparison result.
- */
- public static final int FIELD_UNDEFINED = -2147483648;
-
- /**
- * Constant that represents the years field.
- */
- public static final Field YEARS = new Field(1, "YEARS");
-
- /**
- * Constant that represents the months field.
- */
- public static final Field MONTHS = new Field(2, "MONTHS");
-
- /**
- * Constant that represents the days field.
- */
- public static final Field DAYS = new Field(3, "DAYS");
-
- /**
- * Constant that represents the hours field.
- */
- public static final Field HOURS = new Field(4, "HOURS");
-
- /**
- * Constant that represents the minutes field.
- */
- public static final Field MINUTES = new Field(5, "MINUTES");
-
- /**
- * Constant that represents the seconds field.
- */
- public static final Field SECONDS = new Field(6, "SECONDS");
-
- /**
- * The qualified-name for the <code>dateTime</code> data type.
- */
- public static final QName DATETIME = new QName ("http://www.w3.org/2001/XMLSchema#dateTime", "");
-
- /**
- * The qualified-name for the <code>time</code> data type.
- */
- public static final QName TIME = new QName ("http://www.w3.org/2001/XMLSchema#time", "");
-
- /**
- * The qualified-name for the <code>date</code> data type.
- */
- public static final QName DATE = new QName ("http://www.w3.org/2001/XMLSchema#date", "");
-
- /**
- * The qualified-name for the <code>gYearMonth</code> data type.
- */
- public static final QName GYEARMONTH = new QName ("http://www.w3.org/2001/XMLSchema#gYearMonth", "");
-
- /**
- * The qualified-name for the <code>gMonthDay</code> data type.
- */
- public static final QName GMONTHDAY = new QName ("http://www.w3.org/2001/XMLSchema#gMonthDay", "");
-
- /**
- * The qualified-name for the <code>gYear</code> data type.
- */
- public static final QName GYEAR = new QName ("http://www.w3.org/2001/XMLSchema#gYear", "");
-
- /**
- * The qualified-name for the <code>gMonth</code> data type.
- */
- public static final QName GMONTH = new QName ("http://www.w3.org/2001/XMLSchema#gMonth", "");
-
- /**
- * The qualified-name for the <code>gDay</code> data type.
- */
- public static final QName GDAY = new QName ("http://www.w3.org/2001/XMLSchema#gDay", "");
-
- /**
- * The qualified-name for the <code>duration</code> data type.
- */
- public static final QName DURATION = new QName ("http://www.w3.org/2001/XMLSchema#duration", "");
-
- /**
- * The qualified-name for the <code>dayTimeDuration</code> data type.
- */
- public static final QName DURATION_DAYTIME = new QName ("http://www.w3.org/2001/XMLSchema#dayTimeDuration", "");
-
- /**
- * The qualified-name for the <code>yearMonthDuration</code> data type.
- */
- public static final QName DURATION_YEARMONTH = new QName ("http://www.w3.org/2001/XMLSchema#yearMonthDuration", "");
-
- /**
- * XML Schema maximum timezone offset, in minutes.
- */
- public static final int MAX_TIMEZONE_OFFSET = -840;
-
- /**
- * XML Schema minimum timezone offset, in minutes.
- */
- public static final int MIN_TIMEZONE_OFFSET = 840;
-
-}
diff --git a/libjava/javax/xml/datatype/DatatypeFactory.java b/libjava/javax/xml/datatype/DatatypeFactory.java
deleted file mode 100644
index 3f3a224799e..00000000000
--- a/libjava/javax/xml/datatype/DatatypeFactory.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/* DatatypeFactory.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.datatype;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.GregorianCalendar;
-
-/**
- * Factory class to create new datatype objects mapping XML to and from Java
- * objects.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public abstract class DatatypeFactory
-{
-
- /**
- * JAXP 1.3 default property name.
- */
- public static final String DATATYPEFACTORY_PROPERTY = "javax.xml.datatype.DatatypeFactory";
-
- /**
- * JAXP 1.3 default implementation class name.
- */
- public static final java.lang.String DATATYPEFACTORY_IMPLEMENTATION_CLASS = "gnu.xml.datatype.JAXPDatatypeFactory";
-
- protected DatatypeFactory()
- {
- }
-
- /**
- * Returns a new factory instance.
- */
- public static DatatypeFactory newInstance()
- throws DatatypeConfigurationException
- {
- try
- {
- Class t = Class.forName(DATATYPEFACTORY_IMPLEMENTATION_CLASS);
- return (DatatypeFactory) t.newInstance();
- }
- catch (Exception e)
- {
- throw new DatatypeConfigurationException (e);
- }
- }
-
- /**
- * Returns a new duration from its string representation.
- * @param lexicalRepresentation the lexical representation of the
- * duration, as specified in XML Schema 1.0 section 3.2.6.1.
- */
- public abstract Duration newDuration(String lexicalRepresentation);
-
- /**
- * Returns a new duration.
- * @param durationInMilliseconds the duration in milliseconds
- */
- public abstract Duration newDuration(long durationInMilliSeconds);
-
- /**
- * Returns a new duration by specifying the individual components.
- * @param isPositive whether the duration is positive
- * @param years the number of years
- * @param months the number of months
- * @param days the number of days
- * @param hours the number of hours
- * @param minutes th number of minutes
- * @param seconds the number of seconds
- */
- public abstract Duration newDuration(boolean isPositive,
- BigInteger years,
- BigInteger months,
- BigInteger days,
- BigInteger hours,
- BigInteger minutes,
- BigDecimal seconds);
-
- /**
- * Returns a new duration by specifying the individual components.
- * @param isPositive whether the duration is positive
- * @param years the number of years
- * @param months the number of months
- * @param days the number of days
- * @param hours the number of hours
- * @param minutes th number of minutes
- * @param seconds the number of seconds
- */
- public Duration newDuration(boolean isPositive,
- int years,
- int months,
- int days,
- int hours,
- int minutes,
- int seconds)
- {
- return newDuration(isPositive,
- BigInteger.valueOf((long) years),
- BigInteger.valueOf((long) months),
- BigInteger.valueOf((long) days),
- BigInteger.valueOf((long) hours),
- BigInteger.valueOf((long) minutes),
- BigDecimal.valueOf((long) seconds));
- }
-
- /**
- * Returns a new dayTimeDuration from its string representation.
- * @param lexicalRepresentation the lexical representation of the
- * duration, as specified in XML Schema 1.0 section 3.2.6.1.
- */
- public Duration newDurationDayTime(String lexicalRepresentation)
- {
- return newDuration(lexicalRepresentation);
- }
-
- /**
- * Returns a new dayTimeDuration.
- * @param durationInMilliseconds the duration in milliseconds
- */
- public Duration newDurationDayTime(long durationInMilliseconds)
- {
- // TODO xmlSchemaType
- return newDuration(durationInMilliseconds);
- }
-
- /**
- * Returns a new dayTimeDuration by specifying the individual components.
- * @param isPositive whether the duration is positive
- * @param days the number of days
- * @param hours the number of hours
- * @param minutes th number of minutes
- * @param seconds the number of seconds
- */
- public Duration newDurationDayTime(boolean isPositive,
- BigInteger days,
- BigInteger hours,
- BigInteger minutes,
- BigDecimal seconds)
- {
- return newDuration(isPositive,
- null,
- null,
- days,
- hours,
- minutes,
- seconds);
- }
-
- /**
- * Returns a new dayTimeDuration by specifying the individual components.
- * @param isPositive whether the duration is positive
- * @param days the number of days
- * @param hours the number of hours
- * @param minutes th number of minutes
- * @param seconds the number of seconds
- */
- public Duration newDurationDayTime(boolean isPositive,
- int days,
- int hours,
- int minutes,
- int seconds)
- {
- return newDuration(isPositive,
- null,
- null,
- BigInteger.valueOf((long) days),
- BigInteger.valueOf((long) hours),
- BigInteger.valueOf((long) minutes),
- BigDecimal.valueOf((long) seconds));
- }
-
- /**
- * Returns a new yearMonthDuration from its string representation.
- * @param lexicalRepresentation the lexical representation of the
- * duration, as specified in XML Schema 1.0 section 3.2.6.1.
- */
- public Duration newDurationYearMonth(String lexicalRepresentation)
- {
- return newDuration(lexicalRepresentation);
- }
-
- /**
- * Returns a new yearMonthDuration.
- * @param durationInMilliseconds the duration in milliseconds
- */
- public Duration newDurationYearMonth(long durationInMilliseconds)
- {
- // TODO xmlSchemaType
- return newDuration(durationInMilliseconds);
- }
-
- /**
- * Returns a new yearMonthDuration by specifying the individual components.
- * @param isPositive whether the duration is positive
- * @param years the number of years
- * @param months the number of months
- * @param days the number of days
- * @param hours the number of hours
- * @param minutes th number of minutes
- * @param seconds the number of seconds
- */
- public Duration newDurationYearMonth(boolean isPositive,
- BigInteger years,
- BigInteger months)
- {
- return newDuration(isPositive,
- years,
- months,
- null,
- null,
- null,
- null);
- }
-
- /**
- * Returns a new yearMonthDuration by specifying the individual components.
- * @param isPositive whether the duration is positive
- * @param years the number of years
- * @param months the number of months
- * @param days the number of days
- * @param hours the number of hours
- * @param minutes th number of minutes
- * @param seconds the number of seconds
- */
- public Duration newDurationYearMonth(boolean isPositive,
- int years,
- int months)
- {
- return newDuration(isPositive,
- BigInteger.valueOf((long) years),
- BigInteger.valueOf((long) months),
- null,
- null,
- null,
- null);
- }
-
- /**
- * Returns a new XMLGregorianCalendar with no fields initialized.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar();
-
- /**
- * Returns a new XMLGregorianCalendar from a string representation.
- * @param lexicalRepresentation the lexical representation as specified in
- * XML Schema 1.0 Part 2, section 3.2.[7-14].1.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar(String lexicalRepresentation);
-
- /**
- * Returns a new XMLGregorianCalendar based on the specified Gregorian
- * calendar.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar(GregorianCalendar cal);
-
- /**
- * Returns a new XMLGregorianCalendar with the specified components.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar(BigInteger year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- BigDecimal fractionalSecond,
- int timezone);
-
- /**
- * Returns a new XMLGregorianCalendar with the specified components.
- */
- public XMLGregorianCalendar newXMLGregorianCalendar(int year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- int millisecond,
- int timezone)
- {
- return newXMLGregorianCalendar(BigInteger.valueOf((long) year),
- month,
- day,
- hour,
- minute,
- second,
- new BigDecimal(((double) millisecond) / 1000.0),
- timezone);
- }
-
- /**
- * Returns a new XMLGregorianCalendar with the specified components.
- */
- public XMLGregorianCalendar newXMLGregorianCalendarDate(int year,
- int month,
- int day,
- int timezone)
- {
- return newXMLGregorianCalendar(BigInteger.valueOf((long) year),
- month,
- day,
- DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED,
- null,
- timezone);
- }
-
- /**
- * Returns a new XMLGregorianCalendar with the specified components.
- */
- public XMLGregorianCalendar newXMLGregorianCalendarTime(int hours,
- int minutes,
- int seconds,
- int timezone)
- {
- return newXMLGregorianCalendar(null,
- DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED,
- hours,
- minutes,
- seconds,
- null,
- timezone);
- }
-
- /**
- * Returns a new XMLGregorianCalendar with the specified components.
- */
- public XMLGregorianCalendar newXMLGregorianCalendarTime(int hours,
- int minutes,
- int seconds,
- BigDecimal fractionalSecond,
- int timezone)
- {
- return newXMLGregorianCalendar(null,
- DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED,
- hours,
- minutes,
- seconds,
- fractionalSecond,
- timezone);
- }
-
- /**
- * Returns a new XMLGregorianCalendar with the specified components.
- */
- public XMLGregorianCalendar newXMLGregorianCalendarTime(int hours,
- int minutes,
- int seconds,
- int milliseconds,
- int timezone)
- {
- return newXMLGregorianCalendar(null,
- DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED,
- hours,
- minutes,
- seconds,
- new BigDecimal(((double) milliseconds) / 1000.0),
- timezone);
- }
-
-}
diff --git a/libjava/javax/xml/datatype/Duration.java b/libjava/javax/xml/datatype/Duration.java
deleted file mode 100644
index fb1d65537cc..00000000000
--- a/libjava/javax/xml/datatype/Duration.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/* Duration.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.datatype;
-
-import java.math.BigDecimal;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.namespace.QName;
-
-/**
- * An immutable time space as specified in XML Schema 1.0.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public abstract class Duration
-{
-
- /**
- * Returns the name of the XML Schema data type this value maps to.
- */
- public QName getXMLSchemaType()
- {
- int state = 0;
- state |= isSet(DatatypeConstants.YEARS) ? 32 : 0;
- state |= isSet(DatatypeConstants.MONTHS) ? 16 : 0;
- state |= isSet(DatatypeConstants.DAYS) ? 8 : 0;
- state |= isSet(DatatypeConstants.HOURS) ? 4 : 0;
- state |= isSet(DatatypeConstants.MINUTES) ? 2 : 0;
- state |= isSet(DatatypeConstants.SECONDS) ? 1 : 0;
- switch (state)
- {
- case 63:
- return DatatypeConstants.DURATION;
- case 15:
- return DatatypeConstants.DURATION_DAYTIME;
- case 48:
- return DatatypeConstants.DURATION_YEARMONTH;
- default:
- throw new IllegalStateException();
- }
- }
-
- /**
- * Returns the sign of this value.
- */
- public abstract int getSign();
-
- /**
- * Returns the years in this duration as an int, or 0 if not present.
- */
- public int getYears()
- {
- Number val = getField(DatatypeConstants.YEARS);
- return (val == null) ? 0 : val.intValue();
- }
-
- /**
- * Returns the months in this duration as an int, or 0 if not present.
- */
- public int getMonths()
- {
- Number val = getField(DatatypeConstants.MONTHS);
- return (val == null) ? 0 : val.intValue();
- }
-
- /**
- * Returns the days in this duration as an int, or 0 if not present.
- */
- public int getDays()
- {
- Number val = getField(DatatypeConstants.DAYS);
- return (val == null) ? 0 : val.intValue();
- }
-
- /**
- * Returns the hours in this duration as an int, or 0 if not present.
- */
- public int getHours()
- {
- Number val = getField(DatatypeConstants.HOURS);
- return (val == null) ? 0 : val.intValue();
- }
-
- /**
- * Returns the minutes in this duration as an int, or 0 if not present.
- */
- public int getMinutes()
- {
- Number val = getField(DatatypeConstants.MINUTES);
- return (val == null) ? 0 : val.intValue();
- }
-
- /**
- * Returns the seconds in this duration as an int, or 0 if not present.
- */
- public int getSeconds()
- {
- Number val = getField(DatatypeConstants.SECONDS);
- return (val == null) ? 0 : val.intValue();
- }
-
- /**
- * Returns the duration length in milliseconds.
- * Because the length of a month or year may vary depending on the year,
- * the <code>startInstant</code> parameter is used to specify the duration
- * offset.
- */
- public long getTimeInMillis(Calendar startInstant)
- {
- Calendar cal = (Calendar) startInstant.clone();
- long t1 = cal.getTimeInMillis();
- addTo(cal);
- long t2 = cal.getTimeInMillis();
- return t2 - t1;
- }
-
- /**
- * Returns the duration length in milliseconds.
- * Because the length of a month or year may vary depending on the year,
- * the <code>startInstant</code> parameter is used to specify the duration
- * offset.
- */
- public long getTimeInMillis(Date startInstant)
- {
- Date date = (Date) startInstant.clone();
- long t1 = date.getTime();
- addTo(date);
- long t2 = date.getTime();
- return t2 - t1;
- }
-
- /**
- * Returns the value of the specified field, or <code>null</code> if the
- * field is undefined.
- */
- public abstract Number getField(DatatypeConstants.Field field);
-
- /**
- * Indicates whether the specified field is set.
- */
- public abstract boolean isSet(DatatypeConstants.Field field);
-
- /**
- * Returns the result of adding the specified duration to this duration.
- */
- public abstract Duration add(Duration rhs);
-
- /**
- * Adds this duration to the specified calendar.
- */
- public abstract void addTo(Calendar calendar);
- /*{
- switch (getSign())
- {
- case -1:
- calendar.add(Calendar.YEAR, -getYears());
- calendar.add(Calendar.MONTH, -getMonths());
- calendar.add(Calendar.DATE, -getDays());
- calendar.add(Calendar.HOUR, -getHours());
- calendar.add(Calendar.MINUTE, -getMinutes());
- calendar.add(Calendar.SECOND, -getSeconds());
- break;
- case 1:
- calendar.add(Calendar.YEAR, getYears());
- calendar.add(Calendar.MONTH, getMonths());
- calendar.add(Calendar.DATE, getDays());
- calendar.add(Calendar.HOUR, getHours());
- calendar.add(Calendar.MINUTE, getMinutes());
- calendar.add(Calendar.SECOND, getSeconds());
- }
- }*/
-
- /**
- * Adds this duration to the specified date.
- */
- public void addTo(Date date)
- {
- Calendar calendar = new GregorianCalendar();
- calendar.setTimeInMillis(date.getTime());
- addTo(calendar);
- date.setTime(calendar.getTimeInMillis());
- }
-
- /**
- * Returns the result of subtracting the given duration from this
- * duration.
- */
- public Duration subtract(Duration rhs)
- {
- // TODO
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns the result of multiplying this duration by the given factor.
- */
- public Duration multiply(int factor)
- {
- return multiply(BigDecimal.valueOf((long) factor));
- }
-
- /**
- * Returns the result of multiplying this duration by the given factor.
- */
- public Duration multiply(BigDecimal factor)
- {
- // TODO
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns the unary negative of this duration.
- */
- public abstract Duration negate();
-
- /**
- * Converts the years and months fields into the days field using a
- * specific time instant as the reference point.
- */
- public abstract Duration normalizeWith(Calendar startTimeInstant);
-
- /**
- * Partial order relation comparison with this duration, in accordance
- * with XML Schema 1.0 Part 2, Section 3.2.7.6.2.
- */
- public abstract int compare(Duration duration);
-
- public boolean isLongerThan(Duration duration)
- {
- // TODO
- throw new UnsupportedOperationException();
- }
-
- public boolean isShorterThan(Duration duration)
- {
- // TODO
- throw new UnsupportedOperationException();
- }
-
- public boolean equals(java.lang.Object duration)
- {
- // TODO
- throw new UnsupportedOperationException();
- }
-
- public abstract int hashCode();
-
- /**
- * Returns the lexical representation of this duration.
- */
- public String toString()
- {
- // TODO
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/libjava/javax/xml/datatype/XMLGregorianCalendar.java b/libjava/javax/xml/datatype/XMLGregorianCalendar.java
deleted file mode 100644
index c0b68681c22..00000000000
--- a/libjava/javax/xml/datatype/XMLGregorianCalendar.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/* XMLGregorianCalendar.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.datatype;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.GregorianCalendar;
-import java.util.Locale;
-import java.util.TimeZone;
-import javax.xml.namespace.QName;
-
-/**
- * An XML Schema 1.0 date/time data type.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public abstract class XMLGregorianCalendar
- implements Cloneable
-{
-
- /**
- * Resets all fields to undefined.
- */
- public abstract void clear();
-
- /**
- * Resets all fields to their original values.
- */
- public abstract void reset();
-
- public abstract void setYear(BigInteger year);
-
- public abstract void setYear(int year);
-
- public abstract void setMonth(int month);
-
- public abstract void setDay(int day);
-
- public abstract void setTimezone(int offset);
-
- public void setTime(int hour, int minute, int second)
- {
- setHour(hour);
- setMinute(minute);
- setSecond(second);
- }
-
- public abstract void setHour(int hour);
-
- public abstract void setMinute(int minute);
-
- public abstract void setSecond(int second);
-
- public abstract void setMillisecond(int millisecond);
-
- public abstract void setFractionalSecond(BigDecimal fractional);
-
- public void setTime(int hour, int minute, int second, BigDecimal fractional)
- {
- setHour(hour);
- setMinute(minute);
- setSecond(second);
- setFractionalSecond(fractional);
- }
-
- public void setTime(int hour, int minute, int second, int millisecond)
- {
- setHour(hour);
- setMinute(minute);
- setSecond(second);
- setMillisecond(millisecond);
- }
-
- public abstract BigInteger getEon();
-
- public abstract int getYear();
-
- public abstract BigInteger getEonAndYear();
-
- public abstract int getMonth();
-
- public abstract int getDay();
-
- public abstract int getTimezone();
-
- public abstract int getHour();
-
- public abstract int getMinute();
-
- public abstract int getSecond();
-
- public int getMillisecond()
- {
- BigDecimal factor = BigDecimal.valueOf(1000L);
- BigDecimal val = getFractionalSecond().multiply(factor);
- return val.intValue();
- }
-
- public abstract BigDecimal getFractionalSecond();
-
- public abstract int compare(XMLGregorianCalendar xmlGregorianCalendar);
-
- public abstract XMLGregorianCalendar normalize();
-
- public boolean equals(Object obj)
- {
- if (obj instanceof XMLGregorianCalendar)
- {
- XMLGregorianCalendar xgc = (XMLGregorianCalendar) obj;
- BigInteger y1 = getEonAndYear();
- BigInteger y2 = xgc.getEonAndYear();
- BigDecimal f1 = getFractionalSecond();
- BigDecimal f2 = xgc.getFractionalSecond();
- return ((y1 == null && y2 == null) || (y1 != null && y1.equals(y2))) &&
- getMonth() == xgc.getMonth() &&
- getDay() == xgc.getDay() &&
- getTimezone() == xgc.getTimezone() &&
- getHour() == xgc.getHour() &&
- getMinute() == xgc.getMinute() &&
- getSecond() == xgc.getSecond() &&
- ((f1 == null && f2 == null) || (f1 != null && f1.equals(f2)));
- }
- return false;
- }
-
- public int hashCode()
- {
- int hash = 0;
- BigInteger y = getEonAndYear();
- BigDecimal f = getFractionalSecond();
- if (y != null)
- {
- hash *= 31 + y.hashCode();
- }
- hash *= 31 + getMonth();
- hash *= 31 + getDay();
- hash *= 31 + getTimezone();
- hash *= 31 + getHour();
- hash *= 31 + getMinute();
- hash *= 31 + getSecond();
- if (f != null)
- {
- hash *= 31 + f.hashCode();
- }
- return hash;
- }
-
- /**
- * Returns the XML Schema lexical representation of this calendar.
- */
- public abstract String toXMLFormat();
-
- public abstract QName getXMLSchemaType();
-
- public String toString()
- {
- return toXMLFormat();
- }
-
- /**
- * Determines the validity of this calendar by
- * <code>getXMLSchemaType</code> constraints.
- */
- public abstract boolean isValid();
-
- /**
- * Adds the specified duration to this calendar.
- */
- public abstract void add(Duration duration);
-
- public abstract GregorianCalendar toGregorianCalendar();
-
- public abstract GregorianCalendar toGregorianCalendar(TimeZone timezone,
- Locale locale,
- XMLGregorianCalendar defaults);
-
- public abstract TimeZone getTimeZone(int defaultZoneoffset);
-
- public abstract Object clone();
-
-}
diff --git a/libjava/javax/xml/namespace/NamespaceContext.java b/libjava/javax/xml/namespace/NamespaceContext.java
deleted file mode 100644
index 1bcb85006c1..00000000000
--- a/libjava/javax/xml/namespace/NamespaceContext.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* NamespaceContext.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.namespace;
-
-import java.util.Iterator;
-
-/**
- * Interface by which namespace properties are made available.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public interface NamespaceContext
-{
-
- /**
- * Returns the namespace URI currently bound to the given prefix.
- */
- public String getNamespaceURI(String prefix);
-
- /**
- * Returns the prefix currently bound to the given namespace URI.
- */
- public String getPrefix(String namespaceURI);
-
- /**
- * Returns all the prefixes currently bound to the given namespace URI.
- */
- public Iterator getPrefixes(String namespaceURI);
-
-}
diff --git a/libjava/javax/xml/namespace/QName.java b/libjava/javax/xml/namespace/QName.java
deleted file mode 100644
index 2e8d1243c53..00000000000
--- a/libjava/javax/xml/namespace/QName.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/* QName.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.namespace;
-
-import javax.xml.XMLConstants;
-
-/**
- * An XML
- * <a href='http://www.w3.org/TR/REC-xml-names/#ns-qualnames'>qualified name</a>.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public class QName
-{
-
- private final String namespaceURI;
- private final String localPart;
- private final String prefix;
- private final String qName;
-
- public QName(String namespaceURI, String localPart)
- {
- this(namespaceURI, localPart, null);
- }
-
- public QName(String namespaceURI, String localPart, String prefix)
- {
- if (namespaceURI == null)
- {
- namespaceURI = XMLConstants.NULL_NS_URI;
- }
- if (localPart == null)
- {
- throw new IllegalArgumentException();
- }
- if (prefix == null)
- {
- prefix = XMLConstants.DEFAULT_NS_PREFIX;
- }
- this.namespaceURI = namespaceURI;
- this.localPart = localPart;
- this.prefix = prefix;
-
- StringBuffer buf = new StringBuffer();
- if (namespaceURI != null && namespaceURI.length() > 0)
- {
- buf.append('{');
- buf.append(namespaceURI);
- buf.append('}');
- }
- if (prefix != null && prefix.length() > 0)
- {
- buf.append(prefix);
- buf.append(':');
- }
- buf.append(localPart);
- qName = buf.toString();
- }
-
- public QName(String localPart)
- {
- this(null, localPart, null);
- }
-
- public String getNamespaceURI()
- {
- return namespaceURI;
- }
-
- public String getLocalPart()
- {
- return localPart;
- }
-
- public String getPrefix()
- {
- return prefix;
- }
-
- public boolean equals(Object obj)
- {
- if (obj instanceof QName)
- {
- QName qname = (QName) obj;
- return qname.getLocalPart().equals(localPart) &&
- qname.getNamespaceURI().equals(namespaceURI);
- }
- return false;
- }
-
- public final int hashCode()
- {
- return qName.hashCode();
- }
-
- public String toString()
- {
- return qName;
- }
-
- public static QName valueOf(String qNameAsString)
- {
- String namespaceUri = "", prefix = null;
- int start = qNameAsString.indexOf('{');
- int end = qNameAsString.indexOf('}');
- if (start != -1)
- {
- if (end < start)
- {
- throw new IllegalArgumentException(qNameAsString);
- }
- namespaceUri = qNameAsString.substring(start + 1, end);
- qNameAsString = qNameAsString.substring(end + 1);
- }
- start = qNameAsString.indexOf(':');
- if (start != -1)
- {
- prefix = qNameAsString.substring(0, start);
- qNameAsString = qNameAsString.substring(start + 1);
- }
- return new QName(namespaceUri, qNameAsString, prefix);
- }
-
-}
diff --git a/libjava/javax/xml/parsers/DocumentBuilder.java b/libjava/javax/xml/parsers/DocumentBuilder.java
deleted file mode 100644
index 56c55a3e320..00000000000
--- a/libjava/javax/xml/parsers/DocumentBuilder.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/* DocumentBuilder.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.parsers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import javax.xml.validation.Schema;
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMImplementation;
-import org.xml.sax.InputSource;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-
-/**
- * Convenience class for parsing an XML document into a W3C DOM object
- * graph.
- * Instances of this class are <em>not</em> guaranteed to be thread safe.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public abstract class DocumentBuilder
-{
-
- protected DocumentBuilder()
- {
- }
-
- /**
- * Parse the specified input stream and return a DOM Document.
- * Prefer the version of this method that specifies a system ID, in order
- * to resolve external references correctly.
- * @param is an XML input stream
- * @exception IllegalArgumentException if the input stream is null
- */
- public Document parse(InputStream is)
- throws SAXException, IOException
- {
- if (is == null)
- {
- throw new IllegalArgumentException("input stream is null");
- }
- return parse(new InputSource(is));
- }
-
- /**
- * Parse the specified input stream and return a DOM Document.
- * @param is an XML input stream
- * @param systemId the system ID of the XML document
- * @exception IllegalArgumentException if the input stream is null
- */
- public Document parse(InputStream is, String systemId)
- throws SAXException, IOException
- {
- if (is == null)
- {
- throw new IllegalArgumentException("input stream is null");
- }
- InputSource source = new InputSource(is);
- source.setSystemId(systemId);
- return parse(source);
- }
-
- /**
- * Parse the content of the specified URI and return a DOM Document.
- * @param uri an XML system ID
- * @exception IllegalArgumentException if the URI is null
- */
- public Document parse(String uri)
- throws SAXException, IOException
- {
- if (uri == null)
- {
- throw new IllegalArgumentException("URI is null");
- }
- return parse(new InputSource(uri));
- }
-
- /**
- * Parse the specified file and return a DOM Document.
- * @param f the XML file
- * @exception IllegalArgumentException if the file is null
- */
- public Document parse(File f)
- throws SAXException, IOException
- {
- if (f == null)
- {
- throw new IllegalArgumentException("file is null");
- }
- InputSource source = new InputSource(new FileInputStream(f));
- source.setSystemId(f.toURL().toString());
- return parse(source);
- }
-
- /**
- * Parse the specified input source and return a DOM Document.
- * @param is the input source
- * @exception IllegalArgumentException if the input source is null
- */
- public abstract Document parse(InputSource source)
- throws SAXException, IOException;
-
- /**
- * Indicates whether this document builder is XML Namespace aware.
- */
- public abstract boolean isNamespaceAware();
-
- /**
- * Indicates whether this document builder will validate its input.
- */
- public abstract boolean isValidating();
-
- /**
- * Sets the SAX entity resolver callback used to resolve external entities
- * in the XML document(s) to parse.
- * @param er an entity resolver
- */
- public abstract void setEntityResolver(EntityResolver er);
-
- /**
- * Sets the SAX error handler callback used to report parsing errors.
- * @param eh the error handler
- */
- public abstract void setErrorHandler(ErrorHandler eh);
-
- /**
- * Creates a new, empty DOM Document.
- * To create a document with a root element and optional doctype, use the
- * <code>DOMImplementation</code> instead.
- * @see org.w3c.dom.DOMImplementation#createDocument
- */
- public abstract Document newDocument();
-
- /**
- * Returns the DOM implementation.
- */
- public abstract DOMImplementation getDOMImplementation();
-
- // -- JAXP 1.3 methods --
-
- /**
- * Reset this document builder to its original configuration.
- * @since 1.3
- */
- public void reset()
- {
- }
-
- /**
- * Returns the schema in use by the XML processor.
- */
- public Schema getSchema()
- {
- return null;
- }
-
- /**
- * Returns the XInclude processing mode in use by the parser.
- */
- public boolean isXIncludeAware()
- {
- return false;
- }
-
-}
diff --git a/libjava/javax/xml/parsers/DocumentBuilderFactory.java b/libjava/javax/xml/parsers/DocumentBuilderFactory.java
deleted file mode 100644
index 1cbb9a79f08..00000000000
--- a/libjava/javax/xml/parsers/DocumentBuilderFactory.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/* DocumentBuilderFactory.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.parsers;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.util.Properties;
-import javax.xml.validation.Schema;
-
-/**
- * Factory for obtaining document builders.
- * Instances of this class are <em>not</em> guaranteed to be thread safe.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public abstract class DocumentBuilderFactory
-{
-
- private boolean namespaceAware;
- private boolean validating;
- private boolean ignoringElementContentWhitespace;
- private boolean expandEntityReferences = true;
- private boolean ignoringComments;
- private boolean coalescing;
- private Schema schema;
- private boolean xIncludeAware;
-
- protected DocumentBuilderFactory()
- {
- }
-
- /**
- * Creates a new factory instance.
- * The implementation class to load is the first found in the following
- * locations:
- * <ol>
- * <li>the <code>javax.xml.parsers.DocumentBuilderFactory</code> system
- * property</li>
- * <li>the above named property value in the
- * <code><i>$JAVA_HOME</i>/lib/jaxp.properties</code> file</li>
- * <li>the class name specified in the
- * <code>META-INF/services/javax.xml.parsers.DocumentBuilderFactory</code>
- * system resource</li>
- * <li>the default factory class</li>
- * </ol>
- */
- public static DocumentBuilderFactory newInstance()
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (loader == null)
- {
- loader = DocumentBuilderFactory.class.getClassLoader();
- }
- String className = null;
- int count = 0;
- do
- {
- className = getFactoryClassName(loader, count++);
- if (className != null)
- {
- try
- {
- Class t = (loader != null) ? loader.loadClass(className) :
- Class.forName(className);
- return (DocumentBuilderFactory) t.newInstance();
- }
- catch (ClassNotFoundException e)
- {
- className = null;
- }
- catch (Exception e)
- {
- throw new FactoryConfigurationError(e,
- "error instantiating class " + className);
- }
- }
- }
- while (className == null && count < 3);
- return new gnu.xml.dom.DomDocumentBuilderFactory();
- }
-
- private static String getFactoryClassName(ClassLoader loader, int attempt)
- {
- final String propertyName = "javax.xml.parsers.DocumentBuilderFactory";
- switch (attempt)
- {
- case 0:
- return System.getProperty(propertyName);
- case 1:
- try
- {
- File file = new File(System.getProperty("java.home"));
- file = new File(file, "lib");
- file = new File(file, "jaxp.properties");
- InputStream in = new FileInputStream(file);
- Properties props = new Properties();
- props.load(in);
- in.close();
- return props.getProperty(propertyName);
- }
- catch (IOException e)
- {
- return null;
- }
- case 2:
- try
- {
- String serviceKey = "/META-INF/services/" + propertyName;
- InputStream in = (loader != null) ?
- loader.getResourceAsStream(serviceKey) :
- DocumentBuilderFactory.class.getResourceAsStream(serviceKey);
- if (in != null)
- {
- BufferedReader r =
- new BufferedReader(new InputStreamReader(in));
- String ret = r.readLine();
- r.close();
- return ret;
- }
- }
- catch (IOException e)
- {
- }
- return null;
- default:
- return null;
- }
- }
-
- /**
- * Creates a new document builder instance using the currently specified
- * factory configuration.
- * @exception ParserConfigurationException if the specified configuration
- * is not supported
- */
- public abstract DocumentBuilder newDocumentBuilder()
- throws ParserConfigurationException;
-
- /**
- * Sets whether document builders obtained from this factory will be XML
- * Namespace aware.
- */
- public void setNamespaceAware(boolean awareness)
- {
- namespaceAware = awareness;
- }
-
- /**
- * Sets whether document builders obtained from this factory will validate
- * their input.
- */
- public void setValidating(boolean validating)
- {
- this.validating = validating;
- }
-
- /**
- * Sets whether document builders obtained from this factory will
- * eliminate whitespace within elements that have an element-only content
- * model.
- */
- public void setIgnoringElementContentWhitespace(boolean whitespace)
- {
- ignoringElementContentWhitespace = whitespace;
- }
-
- /**
- * Sets whether document builders obtained from this factory will expand
- * entity reference nodes.
- */
- public void setExpandEntityReferences(boolean expandEntityRef)
- {
- expandEntityReferences = expandEntityRef;
- }
-
- /**
- * Sets whether document builders obtained from this factory will discard
- * comment nodes.
- */
- public void setIgnoringComments(boolean ignoreComments)
- {
- ignoringComments = ignoreComments;
- }
-
- /**
- * Sets whether document builders obtained from this factory will convert
- * CDATA sections to text nodes and normalize adjacent text nodes into a
- * single text node.
- */
- public void setCoalescing(boolean coalescing)
- {
- this.coalescing = coalescing;
- }
-
- /**
- * Indicates whether document builders obtained from this factory will be
- * XML Namespace aware.
- */
- public boolean isNamespaceAware()
- {
- return namespaceAware;
- }
-
- /**
- * Indicates whether document builders obtained from this factory will
- * validate their input.
- */
- public boolean isValidating()
- {
- return validating;
- }
-
- /**
- * Indicates whether document builders obtained from this factory will
- * eliminate whitespace within elements that have an element-only content
- * model.
- */
- public boolean isIgnoringElementContentWhitespace()
- {
- return ignoringElementContentWhitespace;
- }
-
- /**
- * Indicates whether document builders obtained from this factory will
- * expand entity reference nodes.
- */
- public boolean isExpandEntityReferences()
- {
- return expandEntityReferences;
- }
-
- /**
- * Indicates whether document builders obtained from this factory will
- * discard comment nodes.
- */
- public boolean isIgnoringComments()
- {
- return ignoringComments;
- }
-
- /**
- * Indicates whether document builders obtained from this factory will
- * convert CDATA sections to text nodes and normalize adjacent text nodes
- * into a single text node.
- */
- public boolean isCoalescing()
- {
- return coalescing;
- }
-
- /**
- * Set the named attribute on the underlying implementation.
- * @param name the name of the attribute
- * @param value the new value
- * @exception IllegalArgumentException if the attribute is not recognized
- */
- public abstract void setAttribute(String name, Object value)
- throws IllegalArgumentException;
-
- /**
- * Retrieves the named attribute value from the underlying implementation.
- * @param name the name of the attribute
- * @exception IllegalArgumentException if the attribute is not recognized
- */
- public abstract Object getAttribute(String name)
- throws IllegalArgumentException;
-
- // -- JAXP 1.3 methods --
-
- /**
- * Returns the schema.
- * @see #setSchema
- */
- public Schema getSchema()
- {
- return schema;
- }
-
- /**
- * Sets the schema.
- * @see #getSchema
- */
- public void setSchema(Schema schema)
- {
- this.schema = schema;
- }
-
- /**
- * Indicates whether parsers obtained from this factory will be XInclude
- * aware.
- * @since 1.3
- */
- public boolean isXIncludeAware()
- {
- return xIncludeAware;
- }
-
- /**
- * Sets whether parsers obtained from this factory will be XInclude aware.
- * @since 1.3
- */
- public void setXIncludeAware(boolean state)
- {
- xIncludeAware = state;
- }
-
-}
diff --git a/libjava/javax/xml/parsers/FactoryConfigurationError.java b/libjava/javax/xml/parsers/FactoryConfigurationError.java
deleted file mode 100644
index 96d0fc08289..00000000000
--- a/libjava/javax/xml/parsers/FactoryConfigurationError.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* FactoryConfigurationError.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.parsers;
-
-/**
- * An error occurred during configuration of the parser factory.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class FactoryConfigurationError
- extends Error
-{
-
- /**
- * The underlying cause of this exception, if any.
- */
- private Exception exception;
-
- /**
- * Constructor with no detail message.
- */
- public FactoryConfigurationError()
- {
- super();
- }
-
- /**
- * Constructor with the specified detail message.
- * @param msg the detail message
- */
- public FactoryConfigurationError(String msg)
- {
- super(msg);
- }
-
- /**
- * Constructor with the specified underlying cause.
- * @param e the underlying cause of this exception
- */
- public FactoryConfigurationError(Exception e)
- {
- super(e);
- exception = e;
- }
-
- /**
- * Constructor with the specified underlying cause and detail message.
- * @param e the underlying cause of this exception
- * @param msg the detail message
- */
- public FactoryConfigurationError(Exception e, String msg)
- {
- super(msg, e);
- exception = e;
- }
-
- /**
- * Returns the message for this error, if any.
- */
- public String getMessage()
- {
- String message = super.getMessage();
- if (message == null && exception != null)
- {
- message = exception.getMessage();
- }
- return message;
- }
-
- /**
- * Returns the underlying cause of this exception, if any.
- */
- public Exception getException()
- {
- return exception;
- }
-
-}
diff --git a/libjava/javax/xml/parsers/ParserConfigurationException.java b/libjava/javax/xml/parsers/ParserConfigurationException.java
deleted file mode 100644
index 412872f17de..00000000000
--- a/libjava/javax/xml/parsers/ParserConfigurationException.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* ParserConfigurationException.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.parsers;
-
-/**
- * An exception occurred during configuration of the XML parser.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class ParserConfigurationException
- extends Exception
-{
-
- /**
- * Constructor with no detail message.
- */
- public ParserConfigurationException()
- {
- super();
- }
-
- /**
- * Constructor with the specified detail message.
- * @param msg the detail message
- */
- public ParserConfigurationException(String msg)
- {
- super(msg);
- }
-
-}
diff --git a/libjava/javax/xml/parsers/SAXParser.java b/libjava/javax/xml/parsers/SAXParser.java
deleted file mode 100644
index 1a6b1558da6..00000000000
--- a/libjava/javax/xml/parsers/SAXParser.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/* SAXParser.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.parsers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import javax.xml.validation.Schema;
-import org.xml.sax.HandlerBase;
-import org.xml.sax.InputSource;
-import org.xml.sax.Parser;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * Convenience class for using or accessing a SAX version 1 or 2 parser.
- * Instances of this class are <em>not</em> guaranteed to be thread safe.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public abstract class SAXParser
-{
-
- protected SAXParser()
- {
- }
-
- /**
- * Parse the specifed input stream, reporting SAX1 events to the given
- * handler.
- * Prefer the SAX2 version of this method, since the HandlerBase class is
- * now deprecated.
- * Also prefer the version of this method that specifies a system ID, in
- * order to resolve external references correctly.
- * @param is an XML input stream
- * @param hb the SAX1 handler
- * @exception IllegalArgumentException if the input stream is null
- * @see #parse(java.io.InputStream,org.xml.sax.helpers.DefaultHandler)
- */
- public void parse(InputStream is, HandlerBase hb)
- throws SAXException, IOException
- {
- if (is == null)
- {
- throw new IllegalArgumentException("input stream is null");
- }
- parse(new InputSource(is), hb);
- }
-
- /**
- * Parse the specified input stream, reporting SAX1 events to the given
- * handler.
- * Prefer the SAX2 version of this method, since the HandlerBase class is
- * now deprecated.
- * @param is an XML input stream
- * @param hb the SAX1 handler
- * @param systemId the system ID of the XML document
- * @exception IllegalArgumentException if the input stream is null
- * @see #parse(java.io.InputStream,org.xml.sax.helpers.DefaultHandler,java.lang.String)
- */
- public void parse(InputStream is, HandlerBase hb, String systemId)
- throws SAXException, IOException
- {
- if (is == null)
- {
- throw new IllegalArgumentException("input stream is null");
- }
- InputSource source = new InputSource(is);
- source.setSystemId(systemId);
- parse(source, hb);
- }
-
- /**
- * Parse the specified input stream, reporting SAX2 events to the given
- * handler.
- * Prefer the version of this method that specifies a system ID, in
- * order to resolve external references correctly.
- * @param is an XML input stream
- * @param dh the SAX2 handler
- * @exception IllegalArgumentException if the input stream is null
- */
- public void parse(InputStream is, DefaultHandler dh)
- throws SAXException, IOException
- {
- if (is == null)
- {
- throw new IllegalArgumentException("input stream is null");
- }
- parse(new InputSource(is), dh);
- }
-
- /**
- * Parse the specified input stream, reporting SAX2 events to the given
- * handler.
- * @param is an XML input stream
- * @param dh the SAX2 handler
- * @param systemId the system ID of the XML document
- * @exception IllegalArgumentException if the input stream is null
- */
- public void parse (InputStream is, DefaultHandler dh, String systemId)
- throws SAXException, IOException
- {
- if (is == null)
- {
- throw new IllegalArgumentException("input stream is null");
- }
- InputSource source = new InputSource(is);
- source.setSystemId(systemId);
- parse(source, dh);
- }
-
- /**
- * Parse the content of the specified URI, reporting SAX1 events to the
- * given handler.
- * Prefer the SAX2 version of this method, since the HandlerBase class is
- * now deprecated.
- * @param uri an XML system ID
- * @param hb the SAX1 handler
- * @exception IllegalArgumentException if the URI is null
- * @see #parse(java.lang.String,org.xml.sax.helpers.DefaultHandler)
- */
- public void parse(String uri, HandlerBase hb)
- throws SAXException, IOException
- {
- if (uri == null)
- {
- throw new IllegalArgumentException("URI is null");
- }
- parse(new InputSource(uri), hb);
- }
-
- /**
- * Parse the content of the specified URI, reporting SAX2 events to the
- * given handler.
- * @param uri an XML system ID
- * @param dh the SAX2 handler
- * @exception IllegalArgumentException if the URI is null
- */
- public void parse(String uri, DefaultHandler dh)
- throws SAXException, IOException
- {
- if (uri == null)
- {
- throw new IllegalArgumentException("URI is null");
- }
- parse(new InputSource(uri), dh);
- }
-
- /**
- * Parse the content of the specified file, reporting SAX1 events to the
- * given handler.
- * Prefer the SAX2 version of this method, since the HandlerBase class is
- * now deprecated.
- * @param f an XML file
- * @param hb the SAX1 handler
- * @exception IllegalArgumentException if the file is null
- * @see #parse(java.io.File,org.xml.sax.helpers.DefaultHandler)
- */
- public void parse(File f, HandlerBase hb)
- throws SAXException, IOException
- {
- if (f == null)
- {
- throw new IllegalArgumentException("file is null");
- }
- InputSource source = new InputSource(new FileInputStream(f));
- source.setSystemId(f.toURL().toString());
- parse(source, hb);
- }
-
- /**
- * Parse the content of the specified file, reporting SAX2 events to the
- * given handler.
- * @param f an XML file
- * @param dh the SAX2 handler
- * @exception IllegalArgumentException if the file is null
- */
- public void parse(File f, DefaultHandler dh)
- throws SAXException, IOException
- {
- if (f == null)
- {
- throw new IllegalArgumentException("file is null");
- }
- InputSource source = new InputSource(new FileInputStream(f));
- source.setSystemId(f.toURL().toString());
- parse(source, dh);
- }
-
- /**
- * Parse the specified input source, reporting SAX1 events to the
- * given handler.
- * Prefer the SAX2 version of this method, since the HandlerBase class is
- * now deprecated.
- * @param is the SAX input source
- * @param hb the SAX1 handler
- * @exception IllegalArgumentException if the input source is null
- * @see #parse(org.xml.sax.InputSource,org.xml.sax.helpers.DefaultHandler)
- */
- public void parse(InputSource is, HandlerBase hb)
- throws SAXException, IOException
- {
- if (is == null)
- {
- throw new IllegalArgumentException("input source is null");
- }
- Parser parser = getParser();
- parser.setDocumentHandler(hb);
- parser.setDTDHandler(hb);
- parser.setEntityResolver(hb);
- parser.setErrorHandler(hb);
- parser.parse(is);
- }
-
- /**
- * Parse the specified input source, reporting SAX2 events to the
- * given handler.
- * @param f an XML file
- * @param dh the SAX2 handler
- * @exception IllegalArgumentException if the input source is null
- */
- public void parse(InputSource is, DefaultHandler dh)
- throws SAXException, IOException
- {
- if (is == null)
- {
- throw new IllegalArgumentException("input source is null");
- }
- XMLReader reader = getXMLReader();
- reader.setContentHandler(dh);
- reader.setDTDHandler(dh);
- reader.setEntityResolver(dh);
- reader.setErrorHandler(dh);
- reader.parse(is);
- }
-
- /**
- * Returns the underlying SAX1 parser.
- */
- public abstract Parser getParser() throws SAXException;
-
- /**
- * Returns the underlying SAX2 parser.
- * @since 1.1
- */
- public abstract XMLReader getXMLReader() throws SAXException;
-
- /**
- * Indicates whether this parser is XML Namespace aware.
- */
- public abstract boolean isNamespaceAware();
-
- /**
- * Indicates whether this parser will validate its input.
- */
- public abstract boolean isValidating();
-
- /**
- * Sets the specified SAX2 parser property.
- * @param name the name of the property
- * @param value the value of the property
- */
- public abstract void setProperty(String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
- /**
- * Returns the value of the specified SAX2 parser property.
- * @param name the name of the property
- */
- public abstract Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
- // -- JAXP 1.3 methods --
-
- /**
- * Resets this parser to its original configuration.
- * @since 1.3
- */
- public void reset()
- {
- }
-
- /**
- * Returns the schema in use by this parser.
- * @since 1.3
- */
- public Schema getSchema()
- {
- return null;
- }
-
- /**
- * Indicates whether this parser is XInclude-aware.
- * @since 1.3
- */
- public boolean isXIncludeAware()
- {
- return false;
- }
-
-}
diff --git a/libjava/javax/xml/parsers/SAXParserFactory.java b/libjava/javax/xml/parsers/SAXParserFactory.java
deleted file mode 100644
index 8a89fdd92b5..00000000000
--- a/libjava/javax/xml/parsers/SAXParserFactory.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/* SAXParserFactory.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.parsers;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-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 SAX parsers.
- * Instances of this class are <em>not</em> guaranteed to be thread safe.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public abstract class SAXParserFactory
-{
-
- private boolean validating;
- private boolean namespaceAware;
- private Schema schema;
- private boolean xIncludeAware;
-
- protected SAXParserFactory()
- {
- }
-
- /**
- * Creates a new factory instance.
- * The implementation class to load is the first found in the following
- * locations:
- * <ol>
- * <li>the <code>javax.xml.parsers.SAXParserFactory</code> system
- * property</li>
- * <li>the above named property value in the
- * <code><i>$JAVA_HOME</i>/lib/jaxp.properties</code> file</li>
- * <li>the class name specified in the
- * <code>META-INF/services/javax.xml.parsers.SAXParserFactory</code>
- * system resource</li>
- * <li>the default factory class</li>
- * </ol>
- */
- public static SAXParserFactory newInstance()
- throws FactoryConfigurationError
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (loader == null)
- {
- loader = SAXParserFactory.class.getClassLoader();
- }
- String className = null;
- int count = 0;
- do
- {
- className = getFactoryClassName(loader, count++);
- if (className != null)
- {
- try
- {
- Class t = (loader != null) ? loader.loadClass(className) :
- Class.forName(className);
- return (SAXParserFactory) t.newInstance();
- }
- catch (ClassNotFoundException e)
- {
- className = null;
- }
- catch (Exception e)
- {
- throw new FactoryConfigurationError(e,
- "error instantiating class " + className);
- }
- }
- }
- while (className == null && count < 3);
- return new gnu.xml.aelfred2.JAXPFactory();
- }
-
- private static String getFactoryClassName(ClassLoader loader, int attempt)
- {
- final String propertyName = "javax.xml.parsers.SAXParserFactory";
- switch (attempt)
- {
- case 0:
- return System.getProperty(propertyName);
- case 1:
- try
- {
- File file = new File(System.getProperty("java.home"));
- file = new File(file, "lib");
- file = new File(file, "jaxp.properties");
- InputStream in = new FileInputStream(file);
- Properties props = new Properties();
- props.load(in);
- in.close();
- return props.getProperty(propertyName);
- }
- catch (IOException e)
- {
- return null;
- }
- case 2:
- try
- {
- String serviceKey = "/META-INF/services/" + propertyName;
- InputStream in = (loader != null) ?
- loader.getResourceAsStream(serviceKey) :
- SAXParserFactory.class.getResourceAsStream(serviceKey);
- if (in != null)
- {
- BufferedReader r =
- new BufferedReader(new InputStreamReader(in));
- String ret = r.readLine();
- r.close();
- return ret;
- }
- }
- catch (IOException e)
- {
- }
- return null;
- default:
- return null;
- }
- }
-
- /**
- * Creates a new parser instance using the currently specified factory
- * configuration.
- * @exception ParserConfigurationException if the specified configuration
- * is not supported
- */
- public abstract SAXParser newSAXParser()
- throws ParserConfigurationException, SAXException;
-
- /**
- * Sets whether parsers obtained from this factory will be XML Namespace
- * aware.
- */
- public void setNamespaceAware(boolean awareness)
- {
- namespaceAware = awareness;
- }
-
- /**
- * Sets whether parsers obtained from this factory will validate their
- * input.
- */
- public void setValidating(boolean validating)
- {
- this.validating = validating;
- }
-
- /**
- * Indicates whether parsers obtained from this factory will be XML
- * Namespace aware.
- */
- public boolean isNamespaceAware()
- {
- return namespaceAware;
- }
-
- /**
- * Indicates whether parsers obtained from this factory will validate
- * their input.
- */
- public boolean isValidating()
- {
- return validating;
- }
-
- /**
- * Sets the specified feature for SAX2 parsers obtained from this factory.
- * @param name the feature name
- * @param value the featurevalue
- */
- public abstract void setFeature(String name, boolean value)
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException;
-
- /**
- * Returns the specified feature for SAX2 parsers obtained from this
- * factory.
- * @param name the feature name
- */
- public abstract boolean getFeature(String name)
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException;
-
- // -- JAXP 1.3 methods --
-
- /**
- * Returns the schema.
- * @since 1.3
- * @see #setSchema
- */
- public Schema getSchema()
- {
- return schema;
- }
-
- /**
- * Sets the schema.
- * @since 1.3
- * @see #getSchema
- */
- public void setSchema(Schema schema)
- {
- this.schema = schema;
- }
-
- /**
- * Indicates whether parsers obtained from this factory will be XInclude
- * aware.
- * @since 1.3
- */
- public boolean isXIncludeAware()
- {
- return xIncludeAware;
- }
-
- /**
- * Sets whether parsers obtained from this factory will be XInclude aware.
- * @since 1.3
- */
- public void setXIncludeAware(boolean state)
- {
- xIncludeAware = state;
- }
-
-}
diff --git a/libjava/javax/xml/transform/ErrorListener.java b/libjava/javax/xml/transform/ErrorListener.java
deleted file mode 100644
index 5a9eee81f97..00000000000
--- a/libjava/javax/xml/transform/ErrorListener.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* ErrorListener.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-/**
- * Error reporting callback handler.
- * Equivalent to the SAX ErrorHandler.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public interface ErrorListener
-{
-
- /**
- * Reports a warning condition.
- */
- public void warning(TransformerException exception)
- throws TransformerException;
-
- /**
- * Reports a recoverable error.
- */
- public void error(TransformerException exception)
- throws TransformerException;
-
- /**
- * Reports a fatal error.
- */
- public void fatalError(TransformerException exception)
- throws TransformerException;
-
-}
diff --git a/libjava/javax/xml/transform/OutputKeys.java b/libjava/javax/xml/transform/OutputKeys.java
deleted file mode 100644
index 8a86c13695e..00000000000
--- a/libjava/javax/xml/transform/OutputKeys.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* OutputKeys.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-/**
- * Constants for XSLT output attributes.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class OutputKeys
-{
-
- /**
- * The output method (xml, html, or text).
- */
- public static final String METHOD = "method";
-
- /**
- * The version of the output method.
- */
- public static final String VERSION = "version";
-
- /**
- * The preferred output character encoding.
- */
- public static final String ENCODING = "encoding";
-
- /**
- * Whether not to output an XML declaration (yes or no).
- */
- public static final String OMIT_XML_DECLARATION = "omit-xml-declaration";
-
- /**
- * Whether to output a standalone document declaration (yes or no).
- */
- public static final String STANDALONE = "standalone";
-
- /**
- * The public ID to output in the doctype declaration.
- */
- public static final String DOCTYPE_PUBLIC = "doctype-public";
-
- /**
- * The system ID to output in the doctype declaration.
- */
- public static final String DOCTYPE_SYSTEM = "doctype-system";
-
- /**
- * Whitespace-separated list of element names for which text children
- * should be output as CDATA sections.
- */
- public static final String CDATA_SECTION_ELEMENTS = "cdata-section-elements";
-
- /**
- * Whether to indent the result tree (yes or no).
- */
- public static final String INDENT = "indent";
-
- /**
- * The MIME content type of the output data.
- */
- public static final String MEDIA_TYPE = "media-type";
-
- private OutputKeys()
- {
- }
-
-}
diff --git a/libjava/javax/xml/transform/Result.java b/libjava/javax/xml/transform/Result.java
deleted file mode 100644
index 58afebafe97..00000000000
--- a/libjava/javax/xml/transform/Result.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Result.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-/**
- * The result of an XSL transformation.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public interface Result
-{
-
- /**
- * Constant for the processing instruction sent when the result disables
- * output escaping.
- */
- public static final String PI_DISABLE_OUTPUT_ESCAPING =
- "javax.xml.transform.disable-output-escaping";
-
- /**
- * Constant for the processing instruction sent when the result enables
- * output escaping.
- */
- public static final String PI_ENABLE_OUTPUT_ESCAPING =
- "javax.xml.transform.enable-output-escaping";
-
- /**
- * Sets the XML system ID for this result.
- * @param systemId the system ID URI
- */
- public void setSystemId(String systemId);
-
- /**
- * Returns the system ID for this result.
- */
- public String getSystemId();
-
-}
diff --git a/libjava/javax/xml/transform/Source.java b/libjava/javax/xml/transform/Source.java
deleted file mode 100644
index d6edb036b03..00000000000
--- a/libjava/javax/xml/transform/Source.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Source.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-/**
- * An XML input source.
- * This is equivalent to a SAX InputSource.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public interface Source
-{
-
- /**
- * Sets the XML system ID for this source.
- * This can be used to resolve external entities in the source.
- * @param systemID the system ID URI
- */
- public void setSystemId(String systemId);
-
- /**
- * Returns the system ID for this source.
- */
- public String getSystemId();
-
-}
diff --git a/libjava/javax/xml/transform/SourceLocator.java b/libjava/javax/xml/transform/SourceLocator.java
deleted file mode 100644
index 5304d25479e..00000000000
--- a/libjava/javax/xml/transform/SourceLocator.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* SourceLocator.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-/**
- * The location in an XML resource at which an event occurred.
- * Tis is equivalent to the SAX Locator.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public interface SourceLocator
-{
-
- /**
- * Returns the XML public ID for the document.
- */
- public String getPublicId();
-
- /**
- * Returns the XML system ID for the document.
- */
- public String getSystemId();
-
- /**
- * Returns the line number at which the event occurred.
- * @return the line number, or -1 if not available
- */
- public int getLineNumber();
-
- /**
- * Returns the column number at which the event occurred.
- * @return the column number, or -1 if not available
- */
- public int getColumnNumber();
-
-}
diff --git a/libjava/javax/xml/transform/Templates.java b/libjava/javax/xml/transform/Templates.java
deleted file mode 100644
index b4d1fbe686b..00000000000
--- a/libjava/javax/xml/transform/Templates.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Templates.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-import java.util.Properties;
-
-/**
- * A compiled, reusable XSL transformation.
- * Implementations of this class are guaranteed to be thread safe.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public interface Templates
-{
-
- /**
- * Creates a new transformer based on this transformation.
- */
- public Transformer newTransformer()
- throws TransformerConfigurationException;
-
- /**
- * Returns the static properties for the <code>xsl:output</code>
- * instruction. Missing properties are defaulted according the
- * <a href='http://www.w3.org/TR/xslt#output'>XSLT Recommendation, section
- * 16</a>: <code>getProperty(String)</code> returns all properties
- * including defaulted ones, and <code>get(Object)</code> returns only the
- * properties explicitly set in the stylesheet.
- */
- public Properties getOutputProperties();
-
-}
diff --git a/libjava/javax/xml/transform/Transformer.java b/libjava/javax/xml/transform/Transformer.java
deleted file mode 100644
index 905412559e0..00000000000
--- a/libjava/javax/xml/transform/Transformer.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Transformer.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-import java.util.Properties;
-
-/**
- * An XSL transformation.
- * Instances of this class may be reused, but the same instance may not be
- * used concurrently by different threads.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public abstract class Transformer
-{
-
- protected Transformer()
- {
- }
-
- /**
- * Transforms the source XML to a result tree.
- * @param xmlSource the XML source
- * @param outputTarget the result of the transformation
- */
- public abstract void transform(Source xmlSource, Result outputTarget)
- throws TransformerException;
-
- /**
- * Sets a parameter value for the transformation.
- * Parameters may be referenced in the XSLT stylesheet.
- * @param name the parameter name (an XML Name, or a namespace-prefixed
- * XML Name of the form <code>{<i>namespaceURI</i>}<i>localName</i></code>
- * @param value the value to assign
- */
- public abstract void setParameter(String name, Object value);
-
- /**
- * Returns the specified parameter value.
- * @param name the parameter name (an XML Name, or a namespace-prefixed
- * XML Name of the form <code>{<i>namespaceURI</i>}<i>localName</i></code>
- */
- public abstract Object getParameter(String name);
-
- /**
- * Clears all parameter values.
- */
- public abstract void clearParameters();
-
- /**
- * Sets the callback used to resolve entities referenced by
- * <code>xsl:include</code>, <code>xsl:import</code>, or the XPath
- * <code>document()</code> function.
- */
- public abstract void setURIResolver(URIResolver resolver);
-
- /**
- * Returns the callback used to resolve entities referenced by
- * <code>xsl:include</code>, <code>xsl:import</code>, or the XPath
- * <code>document()</code> function.
- */
- public abstract URIResolver getURIResolver();
-
- /**
- * Sets the output properties for the transformation, overriding any
- * properties defined in the stylesheet.
- * The format of property keys is as in the
- * {@link #setOutputProperty(java.lang.String,java.lang.String)} method.
- * @param oformat a set of output properties, or null to reset all the
- * properties to their default values
- */
- public abstract void setOutputProperties(Properties oformat)
- throws IllegalArgumentException;
-
- /**
- * Returns a copy of the output properties for the transformation.
- * Missing properties are defaulted according the
- * <a href='http://www.w3.org/TR/xslt#output'>XSLT Recommendation, section
- * 16</a>: <code>getProperty(String)</code> returns all properties
- * including defaulted ones, and <code>get(Object)</code> returns only the
- * properties explicitly set in the stylesheet.
- */
- public abstract Properties getOutputProperties();
-
- /**
- * Sets an output property for the transformation, overriding any property
- * of the same name defined in the stylesheet.
- * @param name the property name (an XML Name, or a namespace-prefixed
- * XML Name of the form <code>{<i>namespaceURI</i>}<i>localName</i></code>
- * @param value the string value of the property
- * @exception IllegalArgumentException if the property is not supported
- */
- public abstract void setOutputProperty(String name, String value)
- throws IllegalArgumentException;
-
- /**
- * Returns the value of an output property for the transformation.
- * Only explicit properties set programmatically or defined in the
- * stylesheet, not defaulted properties, are returned by this method.
- * @param name the property name (an XML Name, or a namespace-prefixed
- * XML Name of the form <code>{<i>namespaceURI</i>}<i>localName</i></code>
- * @exception IllegalArgumentException if the property is not supported
- */
- public abstract String getOutputProperty(String name)
- throws IllegalArgumentException;
-
- /**
- * Sets the callback used to report errors during the transformation.
- * @exception IllegalArgumentException if the listener is null
- */
- public abstract void setErrorListener(ErrorListener listener)
- throws IllegalArgumentException;
-
- /**
- * Returns the callback used to report errors during the transformation.
- */
- public abstract ErrorListener getErrorListener();
-
- // -- JAXP 1.3 methods --
-
- /**
- * Reset this Transformer to its original configuration.
- * @since 1.3
- */
- public void reset()
- {
- }
-
-}
diff --git a/libjava/javax/xml/transform/TransformerConfigurationException.java b/libjava/javax/xml/transform/TransformerConfigurationException.java
deleted file mode 100644
index b2153c2cbf9..00000000000
--- a/libjava/javax/xml/transform/TransformerConfigurationException.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* TransformerConfigurationException.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-/**
- * An exception occurred during configuration of the transformer.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class TransformerConfigurationException
- extends TransformerException
-{
-
- private SourceLocator locator;
-
- /**
- * Constructor with no detail message.
- */
- public TransformerConfigurationException()
- {
- this(null, null, null);
- }
-
- /**
- * Constructor with a detail message.
- */
- public TransformerConfigurationException(String msg)
- {
- this(msg, null, null);
- }
-
- /**
- * Constructor with underlying cause.
- */
- public TransformerConfigurationException(Throwable e)
- {
- this(e.getMessage(), null, e);
- }
-
- /**
- * Constructor with detail message and underlyinmg cause.
- */
- public TransformerConfigurationException(String msg, Throwable e)
- {
- this(msg, null, e);
- }
-
- /**
- * Constructor with detail message and locator.
- */
- public TransformerConfigurationException(String message,
- SourceLocator locator)
- {
- this(message, locator, null);
- }
-
- /**
- * Constructor with detail message, locator and underlying cause.
- */
- public TransformerConfigurationException(String message,
- SourceLocator locator,
- Throwable e)
- {
- super(message, e);
- this.locator = locator;
- }
-
-}
diff --git a/libjava/javax/xml/transform/TransformerException.java b/libjava/javax/xml/transform/TransformerException.java
deleted file mode 100644
index a72ee1c2f56..00000000000
--- a/libjava/javax/xml/transform/TransformerException.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/* TransformerException.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-/**
- * An exception occurred during the transformation process.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class TransformerException
- extends Exception
-{
-
- private SourceLocator locator;
- private Throwable cause;
-
- /**
- * Constructor with a detail message.
- */
- public TransformerException(String msg)
- {
- this(msg, null, null);
- }
-
- /**
- * Constructor with an underlying cause.
- */
- public TransformerException(Throwable cause)
- {
- this(cause.getMessage(), null, cause);
- }
-
- /**
- * Constructor with a detail message and underlying cause.
- */
- public TransformerException(String msg, Throwable cause)
- {
- this(msg, null, cause);
- }
-
- /**
- * Constructor with a detail message and locator.
- */
- public TransformerException(String msg, SourceLocator locator)
- {
- this(msg, locator, null);
- }
-
- /**
- * Constructor with detail message, locator and underlying cause.
- */
- public TransformerException(String msg, SourceLocator locator,
- Throwable cause)
- {
- super(msg);
- this.locator = locator;
- if (cause != null)
- {
- initCause(cause);
- this.cause = cause;
- }
- }
-
- /**
- * Returns a locator indicating where the error occurred.
- */
- public SourceLocator getLocator()
- {
- return locator;
- }
-
- /**
- * Sets the locator indicating where the error occurred.
- */
- public void setLocator(SourceLocator location)
- {
- locator = location;
- }
-
- /**
- * Returns the underlying cause of this exception.
- */
- public Throwable getException()
- {
- return cause;
- }
-
- /**
- * Returns the underlying cause of this exception.
- */
- public Throwable getCause()
- {
- return cause;
- }
-
- /**
- * Initializes the root cause of this exception.
- * This method may be called only once, and will be called by the
- * constructor if a non-null cause is specified.
- * Really phenomenally poor API design.
- * @param cause the underlying cause
- * @exception IllegalArgumentException if this exception is passed as the
- * argument
- * @exception IllegalStateException if a cause has already been
- * initialized
- */
- public Throwable initCause(Throwable cause)
- {
- if (this.cause != null)
- {
- throw new IllegalStateException();
- }
- if (cause == this)
- {
- throw new IllegalArgumentException();
- }
- this.cause = cause;
- return this;
- }
-
- /**
- * Returns the exception message with location information appended.
- */
- public String getMessageAndLocation()
- {
- return (locator == null) ? getMessage() :
- getMessage() + ": " + getLocationAsString();
- }
-
- /**
- * Returns the location information as a string.
- */
- public String getLocationAsString()
- {
- if (locator == null)
- {
- return null;
- }
- String publicId = locator.getPublicId();
- String systemId = locator.getSystemId();
- int lineNumber = locator.getLineNumber();
- int columnNumber = locator.getColumnNumber();
- StringBuffer buffer = new StringBuffer ();
- if (publicId != null)
- {
- buffer.append ("publicId=");
- buffer.append (publicId);
- }
- if (systemId != null)
- {
- if (buffer.length() > 0)
- {
- buffer.append(' ');
- }
- buffer.append ("systemId=");
- buffer.append (systemId);
- }
- if (lineNumber != -1)
- {
- if (buffer.length() > 0)
- {
- buffer.append(' ');
- }
- buffer.append ("lineNumber=");
- buffer.append (lineNumber);
- }
- if (columnNumber != -1)
- {
- if (buffer.length() > 0)
- {
- buffer.append(' ');
- }
- buffer.append ("columnNumber=");
- buffer.append (columnNumber);
- }
- return buffer.toString();
- }
-
- public void printStackTrace()
- {
- printStackTrace(System.out);
- }
-
- public void printStackTrace(PrintStream s)
- {
- super.printStackTrace(s);
- if (cause != null)
- {
- s.print("caused by ");
- cause.printStackTrace(s);
- }
- }
-
- public void printStackTrace(PrintWriter s)
- {
- super.printStackTrace(s);
- if (cause != null)
- {
- s.print("caused by ");
- cause.printStackTrace(s);
- }
- }
-
-}
diff --git a/libjava/javax/xml/transform/TransformerFactory.java b/libjava/javax/xml/transform/TransformerFactory.java
deleted file mode 100644
index e3c895361a2..00000000000
--- a/libjava/javax/xml/transform/TransformerFactory.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/* TransformerFactory.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.util.Properties;
-
-/**
- * Factory for obtaining transformation contexts.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public abstract class TransformerFactory
-{
-
- protected TransformerFactory()
- {
- }
-
- /**
- * Creates a new factory instance.
- * The implementation class to load is the first found in the following
- * locations:
- * <ol>
- * <li>the <code>javax.xml.transform.TransformerFactory</code> system
- * property</li>
- * <li>the above named property value in the
- * <code><i>$JAVA_HOME</i>/lib/jaxp.properties</code> file</li>
- * <li>the class name specified in the
- * <code>META-INF/services/javax.xml.parsers.DocumentBuilderFactory</code>
- * system resource</li>
- * <li>the default factory class</li>
- * </ol>
- */
- public static TransformerFactory newInstance()
- throws TransformerFactoryConfigurationError
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (loader == null)
- {
- loader = TransformerFactory.class.getClassLoader();
- }
- String className = null;
- int count = 0;
- do
- {
- className = getFactoryClassName(loader, count++);
- if (className != null)
- {
- try
- {
- Class t = (loader != null) ? loader.loadClass(className) :
- Class.forName(className);
- return (TransformerFactory) t.newInstance();
- }
- catch (ClassNotFoundException e)
- {
- className = null;
- }
- catch (Exception e)
- {
- throw new TransformerFactoryConfigurationError(e,
- "error instantiating class " + className);
- }
- }
- }
- while (className == null && count < 3);
- try
- {
- Class t =
- Class.forName("gnu.xml.transform.TransformerFactoryImpl");
- return (TransformerFactory) t.newInstance();
- }
- catch (Exception e)
- {
- throw new TransformerFactoryConfigurationError(e);
- }
- }
-
- private static String getFactoryClassName(ClassLoader loader, int attempt)
- {
- final String propertyName = "javax.xml.transform.TransformerFactory";
- switch (attempt)
- {
- case 0:
- return System.getProperty(propertyName);
- case 1:
- try
- {
- File file = new File(System.getProperty("java.home"));
- file = new File(file, "lib");
- file = new File(file, "jaxp.properties");
- InputStream in = new FileInputStream(file);
- Properties props = new Properties();
- props.load(in);
- in.close();
- return props.getProperty(propertyName);
- }
- catch (IOException e)
- {
- return null;
- }
- case 2:
- try
- {
- String serviceKey = "/META-INF/services/" + propertyName;
- InputStream in = (loader != null) ?
- loader.getResourceAsStream(serviceKey) :
- TransformerFactory.class.getResourceAsStream(serviceKey);
- if (in != null)
- {
- BufferedReader r =
- new BufferedReader(new InputStreamReader(in));
- String ret = r.readLine();
- r.close();
- return ret;
- }
- }
- catch (IOException e)
- {
- }
- return null;
- default:
- return null;
- }
- }
-
- /**
- * Creates a new transformer using the specified stylesheet.
- * @param source the source of an <a href='http://www.w3.org/TR/xslt'>XSLT
- * stylesheet</a> specifying the transformation to apply
- */
- public abstract Transformer newTransformer(Source source)
- throws TransformerConfigurationException;
-
- /**
- * Creates a new transformer that applies the identity transform.
- */
- public abstract Transformer newTransformer()
- throws TransformerConfigurationException;
-
- /**
- * Creates a new compiled transformation using the specified stylesheet.
- * @param source the source of an <a href='http://www.w3.org/TR/xslt'>XSLT
- * stylesheet</a> specifying the transformation to apply
- */
- public abstract Templates newTemplates(Source source)
- throws TransformerConfigurationException;
-
- /**
- * Returns a source object representing the XML resource specified by the
- * <a href='http://www.w3.org/TR/xml-stylesheet/'>xml-stylesheet</a>
- * processing instruction and matching the given criteria.
- * Note that if multiple stylesheets are selected, the source represents a
- * stylesheet composed of a list of imports.
- * @param source the source XML document
- * @param media the media attribute to match, or <code>null</code> to match
- * the preferred templates
- * @param title the title attribute to match, or <code>null</code> to match
- * any
- * @param charset the charset attribute to match, or <code>null</code> to
- * match any
- */
- public abstract Source getAssociatedStylesheet(Source source,
- String media,
- String title,
- String charset)
- throws TransformerConfigurationException;
-
- /**
- * Set the resolver callback to be used by transformers obtained from
- * this factory.
- */
- public abstract void setURIResolver(URIResolver resolver);
-
- /**
- * Returns the resolver callback to be used by transformers obtained from
- * this factory.
- */
- public abstract URIResolver getURIResolver();
-
- /**
- * Sets a feature of transformers and templates obtained from this
- * factory.
- * Feature names are fully qualified URIs, and may depend on the factory
- * implementation.
- * @param name the name of the feature
- * @param value the feature state
- * @exception TransformerConfigurationException if the feature is
- * unsupported
- */
- public abstract void setFeature(String name, boolean value)
- throws TransformerConfigurationException;
-
- /**
- * Returns the state of a feature in the factory implementation.
- * Feature names are fully qualified URIs, and may depend on the factory
- * implementation. JAXP also predefines several features, including the
- * constants in {@link javax.xml.XMLConstants} and
- * <ul>
- * <li>{@link javax.xml.transform.dom.DOMSource#FEATURE}</li>
- * <li>{@link javax.xml.transform.dom.DOMResult#FEATURE}</li>
- * <li>{@link javax.xml.transform.sax.SAXSource#FEATURE}</li>
- * <li>{@link javax.xml.transform.sax.SAXResult#FEATURE}</li>
- * <li>{@link javax.xml.transform.sax.SAXTransformerFactory#FEATURE}</li>
- * <li>{@link javax.xml.transform.sax.SAXTransformerFactory#FEATURE_XMLFILTER}</li>
- * <li>{@link javax.xml.transform.stream.StreamSource#FEATURE}</li>
- * <li>{@link javax.xml.transform.stream.StreamResult#FEATURE}</li>
- * </ul>
- * The latter expose various capabilities of the factory implementation.
- */
- public abstract boolean getFeature(String name);
-
- /**
- * Set a named attribute on the underlying implementation.
- * @param name the attribute name
- * @param value the value to assign
- * @exception IllegalArgumentException if the attribute is not supported
- */
- public abstract void setAttribute(String name, Object value)
- throws IllegalArgumentException;
-
- /**
- * Retrieve the specified named attribute value.
- * @param name the attribute name
- * @exception IllegalArgumentException if the attribute is not supported
- */
- public abstract Object getAttribute(String name)
- throws IllegalArgumentException;
-
- /**
- * Sets the callback to be used by transformers obtained from this factory
- * to report transformation errors.
- */
- public abstract void setErrorListener(ErrorListener listener)
- throws IllegalArgumentException;
-
- /**
- * Returns the callback to be used by transformers obtained from this
- * factory to report transformation errors.
- */
- public abstract ErrorListener getErrorListener();
-
-}
diff --git a/libjava/javax/xml/transform/TransformerFactoryConfigurationError.java b/libjava/javax/xml/transform/TransformerFactoryConfigurationError.java
deleted file mode 100644
index 9b16b2b2e4c..00000000000
--- a/libjava/javax/xml/transform/TransformerFactoryConfigurationError.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* TransformerFactoryConfigurationError.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-/**
- * An error occurred during configuration of the transformer factory.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class TransformerFactoryConfigurationError
- extends Error
-{
-
- private final Exception exception;
-
- /**
- * Constructor with no detail message.
- */
- public TransformerFactoryConfigurationError()
- {
- this(null, null);
- }
-
- /**
- * Constructor with a detail message.
- */
- public TransformerFactoryConfigurationError(String msg)
- {
- this(null, msg);
- }
-
- /**
- * Constructor with an underlying cause.
- */
- public TransformerFactoryConfigurationError(Exception e)
- {
- this(e, null);
- }
-
- /**
- * Constructor with an underlying cause and detail message.
- */
- public TransformerFactoryConfigurationError(Exception e, String msg)
- {
- super(msg);
- exception = e;
- }
-
- /**
- * Returns the detail message.
- */
- public String getMessage()
- {
- String message = super.getMessage();
- if (message == null && exception != null)
- {
- message = exception.getMessage();
- }
- return message;
- }
-
- /**
- * Returns the underlying cause.
- */
- public Exception getException()
- {
- return exception;
- }
-
-}
diff --git a/libjava/javax/xml/transform/URIResolver.java b/libjava/javax/xml/transform/URIResolver.java
deleted file mode 100644
index a3d8e8f41ce..00000000000
--- a/libjava/javax/xml/transform/URIResolver.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* URIResolver.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform;
-
-/**
- * Callback that can resolve a URI into source XML for transformation.
- * Equivalent to the SAX EntityResolver.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public interface URIResolver
-{
-
- /**
- * Resolves an <code>xsl:include</code>, <code>xsl:import</code>, or
- * XPath <code>document()</code> function.
- * @param href the URI to resolve (relative or absolute)
- * @param base the base URI relative to which the URI is to be resolved
- * @return a source, or null if the resource could not be found
- */
- public Source resolve(String href, String base)
- throws TransformerException;
-
-}
diff --git a/libjava/javax/xml/transform/dom/DOMLocator.java b/libjava/javax/xml/transform/dom/DOMLocator.java
deleted file mode 100644
index 7f237065968..00000000000
--- a/libjava/javax/xml/transform/dom/DOMLocator.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* DOMLocator.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform.dom;
-
-import javax.xml.transform.SourceLocator;
-import org.w3c.dom.Node;
-
-/**
- * Locator for reporting a location in a W3C DOM object graph.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public interface DOMLocator
- extends SourceLocator
-{
-
- /**
- * Returns the node on which the event originated.
- */
- public Node getOriginatingNode();
-
-}
diff --git a/libjava/javax/xml/transform/dom/DOMResult.java b/libjava/javax/xml/transform/dom/DOMResult.java
deleted file mode 100644
index 6656f42d4f3..00000000000
--- a/libjava/javax/xml/transform/dom/DOMResult.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/* DOMResult.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform.dom;
-
-import javax.xml.transform.Result;
-import org.w3c.dom.Node;
-
-/**
- * Output result specified as a W3C DOM object graph.
- * The result tree may be appended to an existing tree.
- * If no target node is specified, the result tree will be made available by
- * the {@link #getNode} method after the transformation.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class DOMResult
- implements Result
-{
-
- /**
- * Factory feature indicating that DOM results are supported.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.dom.DOMResult/feature";
-
- private Node node;
- private Node nextSibling;
- private String systemId;
-
- /**
- * Default constructor.
- */
- public DOMResult()
- {
- this(null, null, null);
- }
-
- /**
- * Constructor with the node to append to.
- */
- public DOMResult(Node node)
- {
- this(node, null, null);
- }
-
- /**
- * Constructor with the node to append to and the child node before which
- * the result should be appended.
- * @since 1.3
- */
- public DOMResult(Node node, Node nextSibling)
- {
- this(node, nextSibling, null);
- }
-
- /**
- * Constructor with the node to append to and the system ID.
- */
- public DOMResult(Node node, String systemID)
- {
- this(node, null, systemID);
- }
-
- /**
- * Constructor with the node to append to, the child node before which
- * the result should be appended, and the system ID.
- * @since 1.3
- */
- public DOMResult(Node node, Node nextSibling, String systemID)
- {
- this.node = node;
- this.nextSibling = nextSibling;
- this.systemId = systemID;
- }
-
- /**
- * Sets the node to which the result tree will be appended.
- * @param node the node
- */
- public void setNode(Node node)
- {
- this.node = node;
- }
-
- /**
- * Returns the node to which the result tree is to be appended,
- * or the result tree after transformation if no node was previously set.
- */
- public Node getNode()
- {
- return node;
- }
-
- /**
- * Sets the child node before which the result nodes will be inserted.
- * @since 1.3
- */
- public void setNextSibling(Node nextSibling)
- {
- this.nextSibling = nextSibling;
- }
-
- /**
- * Returns the child node before which the result nodes will be inserted.
- * @since 1.3
- */
- public Node getNextSibling()
- {
- return nextSibling;
- }
-
- /**
- * Sets the system ID used to resolve external entities.
- */
- public void setSystemId(String systemId)
- {
- this.systemId = systemId;
- }
-
- /**
- * Returns the system ID used to resolve external entities.
- */
- public String getSystemId()
- {
- return systemId;
- }
-
-}
diff --git a/libjava/javax/xml/transform/dom/DOMSource.java b/libjava/javax/xml/transform/dom/DOMSource.java
deleted file mode 100644
index 2321496dd23..00000000000
--- a/libjava/javax/xml/transform/dom/DOMSource.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/* DOMSource.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform.dom;
-
-import javax.xml.transform.Source;
-import org.w3c.dom.Node;
-
-/**
- * An XML source specified as a W3C DOM node context.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class DOMSource
- implements Source
-{
-
- /**
- * Factory feature indicating that DOM sources are supported.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.dom.DOMSource/feature";
-
- private Node node;
- private String systemId;
-
- /**
- * Default constructor.
- */
- public DOMSource()
- {
- this(null, null);
- }
-
- /**
- * Constructor with a context node.
- */
- public DOMSource(Node node)
- {
- this(node, null);
- }
-
- /**
- * Constructor with a context node and system ID.
- */
- public DOMSource(Node node, String systemId)
- {
- this.node = node;
- this.systemId = systemId;
- }
-
- /**
- * Sets the context node.
- */
- public void setNode(Node node)
- {
- this.node = node;
- }
-
- /**
- * Returns the context node.
- */
- public Node getNode()
- {
- return node;
- }
-
- /**
- * Sets the base URI to use as the context for resolving entities.
- */
- public void setSystemId(String systemId)
- {
- this.systemId = systemId;
- }
-
- /**
- * Returns the base URI to use as the context for resolving entities.
- */
- public String getSystemId()
- {
- return systemId;
- }
-
-}
diff --git a/libjava/javax/xml/transform/sax/SAXResult.java b/libjava/javax/xml/transform/sax/SAXResult.java
deleted file mode 100644
index ea6b8dd4bbf..00000000000
--- a/libjava/javax/xml/transform/sax/SAXResult.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/* SAXResult.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform.sax;
-
-import javax.xml.transform.Result;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * Specifies SAX handlers to be used as a result sink during a
- * transformation.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class SAXResult implements Result
-{
-
- /**
- * Factory feature indicating that SAX results are supported.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.sax.SAXResult/feature";
-
- private ContentHandler handler;
- private LexicalHandler lexicalHandler;
- private String systemId;
-
- /**
- * Default constructor.
- */
- public SAXResult()
- {
- }
-
- /**
- * Constructor specifying a content handler.
- */
- public SAXResult(ContentHandler handler)
- {
- this.handler = handler;
- }
-
- /**
- * Sets the content handler to which result document events will be
- * propagated.
- */
- public void setHandler(ContentHandler handler)
- {
- this.handler = handler;
- }
-
- /**
- * Returns the content handler to which result document events will be
- * propagated.
- */
- public ContentHandler getHandler()
- {
- return handler;
- }
-
- /**
- * Sets the lexical handler to which lexical events will be propagated.
- * If a lexical handler is not set, the transformer should attempt to cast
- * the content handler to a lexical handler.
- */
- public void setLexicalHandler(LexicalHandler handler)
- {
- lexicalHandler = handler;
- }
-
- /**
- * Returns the lexical handler to which lexical events will be propagated.
- * If a lexical handler is not set, the transformer should attempt to cast
- * the content handler to a lexical handler.
- */
- public LexicalHandler getLexicalHandler()
- {
- return lexicalHandler;
- }
-
- /**
- * Sets the system ID which this result represents.
- */
- public void setSystemId(String systemId)
- {
- this.systemId = systemId;
- }
-
- /**
- * Returns the system ID which this result represnts.
- */
- public String getSystemId()
- {
- return systemId;
- }
-
-}
diff --git a/libjava/javax/xml/transform/sax/SAXSource.java b/libjava/javax/xml/transform/sax/SAXSource.java
deleted file mode 100644
index 4b1f5ee2a26..00000000000
--- a/libjava/javax/xml/transform/sax/SAXSource.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/* SAXSource.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform.sax;
-
-import java.io.InputStream;
-import java.io.Reader;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/**
- * Specifies a SAX XML source. This is a tuple of input source and SAX
- * parser.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class SAXSource
- implements Source
-{
-
- /**
- * Factory feature indicating that SAX sources are supported.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.sax.SAXSource/feature";
-
- private XMLReader xmlReader;
- private InputSource inputSource;
-
- /**
- * Default constructor.
- */
- public SAXSource()
- {
- }
-
- /**
- * Constructor with a SAX parser and input source.
- */
- public SAXSource(XMLReader reader, InputSource inputSource)
- {
- xmlReader = reader;
- this.inputSource = inputSource;
- }
-
- /**
- * Constructor with an input source.
- * The SAX parser will be instantiated by the transformer.
- */
- public SAXSource(InputSource inputSource)
- {
- this.inputSource = inputSource;
- }
-
- /**
- * Sets the SAX parser to be used by this source.
- * If null, the transformer will instantiate its own parser.
- */
- public void setXMLReader(XMLReader reader)
- {
- xmlReader = reader;
- }
-
- /**
- * Returns the SAX parser to be used by this source.
- * If null, the transformer will instantiate its own parser.
- */
- public XMLReader getXMLReader()
- {
- return xmlReader;
- }
-
- /**
- * Sets the input source to parse.
- */
- public void setInputSource(InputSource inputSource)
- {
- this.inputSource = inputSource;
- }
-
- /**
- * Returns the input source to parse.
- */
- public InputSource getInputSource()
- {
- return inputSource;
- }
-
- /**
- * Sets the system ID for this source.
- */
- public void setSystemId(String systemId)
- {
- if (inputSource != null)
- {
- inputSource.setSystemId(systemId);
- }
- }
-
- /**
- * Returns the system ID for this source.
- */
- public String getSystemId()
- {
- if (inputSource != null)
- {
- return inputSource.getSystemId();
- }
- return null;
- }
-
- /**
- * Converts a source into a SAX input source.
- * This method can use a StreamSource or the system ID.
- * @return an input source or null
- */
- public static InputSource sourceToInputSource(Source source)
- {
- InputSource in = null;
- if (source instanceof SAXSource)
- {
- in = ((SAXSource) source).getInputSource();
- }
- else if (source instanceof StreamSource)
- {
- StreamSource streamSource = (StreamSource) source;
- InputStream inputStream = streamSource.getInputStream();
- if (inputStream != null)
- {
- in = new InputSource(inputStream);
- }
- else
- {
- Reader reader = streamSource.getReader();
- if (reader != null)
- {
- in = new InputSource(reader);
- }
- }
- String publicId = streamSource.getPublicId();
- if (publicId != null && in != null)
- {
- in.setPublicId(publicId);
- }
- }
- String systemId = source.getSystemId();
- if (systemId != null)
- {
- if (in == null)
- {
- in = new InputSource(systemId);
- }
- else
- {
- in.setSystemId(systemId);
- }
- }
- return in;
- }
-
-}
diff --git a/libjava/javax/xml/transform/sax/SAXTransformerFactory.java b/libjava/javax/xml/transform/sax/SAXTransformerFactory.java
deleted file mode 100644
index 8508777d2b4..00000000000
--- a/libjava/javax/xml/transform/sax/SAXTransformerFactory.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* SAXTransformerFactory.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform.sax;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.Templates;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerFactory;
-import org.xml.sax.XMLFilter;
-
-/**
- * Specialized transformer factory with support for SAX-specific factory
- * methods.
- * This factory provides SAX content handlers that can create transformation
- * templates and transformers.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public abstract class SAXTransformerFactory extends TransformerFactory
-{
-
- /**
- * Factory feature indicating that the factory can be cast to this class.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.sax.SAXTransformerFactory/feature";
-
- /**
- * Factory feature indicating that this factory can create new XMLFilters.
- */
- public static final String FEATURE_XMLFILTER =
- "http://javax.xml.transform.sax.SAXTransformerFactory/feature/xmlfilter";
-
- protected SAXTransformerFactory()
- {
- }
-
- /**
- * Returns a content handler that can process SAX events into a result,
- * using the specified transformation.
- * @param src the source stylesheet
- */
- public abstract TransformerHandler newTransformerHandler(Source src)
- throws TransformerConfigurationException;
-
- /**
- * Returns a content handler that can process SAX events into a result,
- * using the specified transformation.
- * @param templates the compiled stylesheet
- */
- public abstract TransformerHandler newTransformerHandler(Templates templates)
- throws TransformerConfigurationException;
-
- /**
- * Returns a content handler that can process SAX events into a result,
- * using the identity transform.
- */
- public abstract TransformerHandler newTransformerHandler()
- throws TransformerConfigurationException;
-
- /**
- * Returns a content handler that can process SAX events into a
- * transformation template.
- */
- public abstract TemplatesHandler newTemplatesHandler()
- throws TransformerConfigurationException;
-
- /**
- * Creates an XML filter for the specified source.
- */
- public abstract XMLFilter newXMLFilter(Source src)
- throws TransformerConfigurationException;
-
- /**
- * Creates an XML filter for the specified compiled stylesheet.
- */
- public abstract XMLFilter newXMLFilter(Templates templates)
- throws TransformerConfigurationException;
-
-}
diff --git a/libjava/javax/xml/transform/sax/TemplatesHandler.java b/libjava/javax/xml/transform/sax/TemplatesHandler.java
deleted file mode 100644
index ae8e6640ea2..00000000000
--- a/libjava/javax/xml/transform/sax/TemplatesHandler.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* TemplatesHandler.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform.sax;
-
-import javax.xml.transform.Templates;
-import org.xml.sax.ContentHandler;
-
-/**
- * A content handler that processes SAX parse events into a compiled
- * transformation template.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public interface TemplatesHandler
- extends ContentHandler
-{
-
- /**
- * Returns the templates object created by the parsing of the SAX events.
- */
- public Templates getTemplates();
-
- /**
- * Sets the system ID for the templates object created by this processor.
- */
- public void setSystemId(String systemId);
-
- /**
- * Returns the system ID for the templates object created by this processor.
- */
- public String getSystemId();
-
-}
diff --git a/libjava/javax/xml/transform/sax/TransformerHandler.java b/libjava/javax/xml/transform/sax/TransformerHandler.java
deleted file mode 100644
index f31c3f8defe..00000000000
--- a/libjava/javax/xml/transform/sax/TransformerHandler.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* TransformerHandler.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform.sax;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Transformer;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * A content handler that transforms SAX events into a result tree.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public interface TransformerHandler
- extends ContentHandler, LexicalHandler, DTDHandler
-{
-
- /**
- * Sets the result sink to be used as the output of the transformation.
- * @exception IllegalArgumentException if the result is not a valid target
- */
- public void setResult(Result result)
- throws IllegalArgumentException;
-
- /**
- * Sets the system ID relative to which URLs will be resolved.
- */
- public void setSystemId(String systemID);
-
- /**
- * Returns the system ID relative to which URLs will be resolved.
- */
- public String getSystemId();
-
- /**
- * Returns the transformer associated with this handler in order to set
- * parameters and output properties.
- */
- public Transformer getTransformer();
-
-}
diff --git a/libjava/javax/xml/transform/stream/StreamResult.java b/libjava/javax/xml/transform/stream/StreamResult.java
deleted file mode 100644
index 8fbf3a3653d..00000000000
--- a/libjava/javax/xml/transform/stream/StreamResult.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/* StreamResult.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform.stream;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import javax.xml.transform.Result;
-
-/**
- * Specifies a stream to which to write the transformation result.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class StreamResult
- implements Result
-{
-
- /**
- * Factory feature indicating that stream results are supported.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.stream.StreamResult/feature";
-
- private String systemId;
- private OutputStream outputStream;
- private Writer writer;
-
- /**
- * Default constructor.
- */
- public StreamResult()
- {
- }
-
- /**
- * Constructor with an output stream.
- */
- public StreamResult(OutputStream stream)
- {
- this.outputStream = stream;
- }
-
- /**
- * Constructor with a writer.
- * Prefer to use an output stream rather than a writer, so that the
- * output encoding can be controlled by transformation properties.
- */
- public StreamResult(Writer writer)
- {
- this.writer = writer;
- }
-
- /**
- * Constructor with a system ID.
- */
- public StreamResult(String systemID)
- {
- this.systemId = systemID;
- }
-
- /**
- * Constructor with a system ID specified as a File object.
- */
- public StreamResult(File file)
- {
- setSystemId(file);
- }
-
- /**
- * Sets the target output stream.
- */
- public void setOutputStream(OutputStream outputStream)
- {
- this.outputStream = outputStream;
- }
-
- /**
- * Returns the target output stream.
- */
- public OutputStream getOutputStream()
- {
- return outputStream;
- }
-
- /**
- * Sets the target writer.
- * Prefer to use an output stream rather than a writer, so that the
- * output encoding can be controlled by transformation properties.
- */
- public void setWriter(Writer writer)
- {
- this.writer = writer;
- }
-
- /**
- * Returns the target writer.
- */
- public Writer getWriter()
- {
- return writer;
- }
-
- /**
- * Sets the system ID.
- * If neither the out stream nor the writer have been specified, the
- * system ID will be treated as a URL for writing to.
- */
- public void setSystemId(String systemID)
- {
- this.systemId = systemID;
- }
-
- /**
- * Sets the system ID from a File reference.
- */
- public void setSystemId(File f)
- {
- try
- {
- systemId = f.toURL().toString();
- }
- catch (IOException e)
- {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
- /**
- * Returns the system ID.
- */
- public String getSystemId()
- {
- return systemId;
- }
-
-}
diff --git a/libjava/javax/xml/transform/stream/StreamSource.java b/libjava/javax/xml/transform/stream/StreamSource.java
deleted file mode 100644
index 65e2c70789d..00000000000
--- a/libjava/javax/xml/transform/stream/StreamSource.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/* StreamSource.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.transform.stream;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.Reader;
-import javax.xml.transform.Source;
-
-/**
- * Specifies a stream from which to read the source XML data.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- */
-public class StreamSource
- implements Source
-{
-
- /**
- * Factory feature indicating that stream sources are supported.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.stream.StreamSource/feature";
-
- private String publicId;
- private String systemId;
- private InputStream inputStream;
- private Reader reader;
-
- /**
- * Default constructor.
- */
- public StreamSource()
- {
- }
-
- /**
- * Constructor with an input stream.
- */
- public StreamSource(InputStream stream)
- {
- this.inputStream = stream;
- }
-
- /**
- * Constructor with an input stream and system ID.
- */
- public StreamSource(InputStream stream, String systemId)
- {
- this.inputStream = stream;
- this.systemId = systemId;
- }
-
- /**
- * Constructor with a reader.
- * Prefer an input stream to a reader, so that the parser can use the
- * character encoding specified in the XML.
- */
- public StreamSource(Reader reader)
- {
- this.reader = reader;
- }
-
- /**
- * Constructor with a reader and system ID.
- * Prefer an input stream to a reader, so that the parser can use the
- * character encoding specified in the XML.
- */
- public StreamSource(Reader reader, String systemId)
- {
- this.reader = reader;
- this.systemId = systemId;
- }
-
- /**
- * Constructor with a system ID.
- */
- public StreamSource(String systemId)
- {
- this.systemId = systemId;
- }
-
- /**
- * Constructor with a system ID specified as a File reference.
- */
- public StreamSource(File file)
- {
- setSystemId(file);
- }
-
- /**
- * Sets the source input stream.
- */
- public void setInputStream(InputStream stream)
- {
- this.inputStream = stream;
- }
-
- /**
- * Returns the source input stream.
- */
- public InputStream getInputStream()
- {
- return inputStream;
- }
-
- /**
- * Sets the source reader.
- * Prefer an input stream to a reader, so that the parser can use the
- * character encoding specified in the XML.
- */
- public void setReader(Reader reader)
- {
- this.reader = reader;
- }
-
- /**
- * Returns the source reader.
- */
- public Reader getReader()
- {
- return reader;
- }
-
- /**
- * Sets the public ID for this source.
- */
- public void setPublicId(String publicId)
- {
- this.publicId = publicId;
- }
-
- /**
- * Returns the public ID for this source.
- */
- public String getPublicId()
- {
- return publicId;
- }
-
- /**
- * Sets the system ID for this source.
- * If the input stream and reader are absent, the system ID will be used
- * as a readable URL to locate the source data.
- */
- public void setSystemId(String systemId)
- {
- this.systemId = systemId;
- }
-
- /**
- * Returns the system ID for this source.
- */
- public String getSystemId()
- {
- return systemId;
- }
-
- /**
- * Sets the system ID using a File reference.
- */
- public void setSystemId(File f)
- {
- try
- {
- this.systemId = f.toURL().toString();
- }
- catch (IOException e)
- {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
-}
diff --git a/libjava/javax/xml/validation/Schema.java b/libjava/javax/xml/validation/Schema.java
deleted file mode 100644
index 46926c8c89a..00000000000
--- a/libjava/javax/xml/validation/Schema.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Schema.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.validation;
-
-/**
- * An immutable grammar.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public abstract class Schema
-{
-
- protected Schema()
- {
- }
-
- /**
- * Returns a new validator that can check the set of constraints this
- * schema represents.
- */
- public abstract Validator newValidator();
-
- public abstract ValidatorHandler newValidatorHandler();
-
-}
diff --git a/libjava/javax/xml/validation/SchemaFactory.java b/libjava/javax/xml/validation/SchemaFactory.java
deleted file mode 100644
index 35bf205642b..00000000000
--- a/libjava/javax/xml/validation/SchemaFactory.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/* SchemaFactory.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.validation;
-
-import java.io.File;
-import java.net.URL;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * Factory for obtaining schemata.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public abstract class SchemaFactory
-{
-
- ErrorHandler errorHandler;
-
- protected SchemaFactory()
- {
- }
-
- /**
- * Returns an implementation of <code>SchemaFactory</code> that supports
- * the specified schema language.
- * @param schemaLanguage the URI of a schema language (see
- * <code>XMLConstants</code>)
- */
- public static final SchemaFactory newInstance(String schemaLanguage)
- {
- // TODO
- throw new IllegalArgumentException(schemaLanguage);
- }
-
- /**
- * Indicates whether the specified schema language is supported.
- * @param schemaLanguage the URI of a schema language (see
- * <code>XMLConstants</code>)
- */
- public abstract boolean isSchemaLanguageSupported(String schemaLanguage);
-
- public boolean getFeature(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException(name);
- }
-
- public void setFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException(name);
- }
-
- public Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException(name);
- }
-
- public void setProperty(String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException(name);
- }
-
- public ErrorHandler getErrorHandler()
- {
- return errorHandler;
- }
-
- public void setErrorHandler(ErrorHandler errorHandler)
- {
- this.errorHandler = errorHandler;
- }
-
- public abstract LSResourceResolver getResourceResolver();
-
- public abstract void setResourceResolver(LSResourceResolver resourceResolver);
-
- /**
- * Returns a schema based on the specified source resource.
- * @param schema the source resource
- */
- public Schema newSchema(Source schema)
- throws SAXException
- {
- return newSchema(new Source[] { schema });
- }
-
- /**
- * Returns a schema based on the specified source file.
- * @param schema the source resource
- */
- public Schema newSchema(File schema)
- throws SAXException
- {
- return newSchema(new StreamSource(schema));
- }
-
- /**
- * Returns a schema based on the specified URL.
- * @param schema the source resource
- */
- public Schema newSchema(URL schema)
- throws SAXException
- {
- return newSchema(new StreamSource(schema.toString()));
- }
-
- /**
- * Parses the specified sources, and combine them into a single schema.
- * The exact procedure and semantics of this depends on the schema
- * language.
- * @param schemata the schema resources to load
- */
- public abstract Schema newSchema(Source[] schemata)
- throws SAXException;
-
- /**
- * Creates a special schema.
- * The exact semantics of this depends on the schema language.
- */
- public abstract Schema newSchema()
- throws SAXException;
-
-}
diff --git a/libjava/javax/xml/validation/TypeInfoProvider.java b/libjava/javax/xml/validation/TypeInfoProvider.java
deleted file mode 100644
index 99bf2832fb6..00000000000
--- a/libjava/javax/xml/validation/TypeInfoProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* TypeInfoProvider.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.validation;
-
-import org.w3c.dom.TypeInfo;
-
-/**
- * Provides access to the PSVI type info supplied by
- * <code>ValidatorHandler</code>.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public abstract class TypeInfoProvider
-{
-
- protected TypeInfoProvider()
- {
- }
-
- /**
- * Returns the type information for the current element.
- */
- public abstract TypeInfo getElementTypeInfo();
-
- /**
- * Returns the type information for the specified attribute of the current
- * element.
- * @param index the attribute index as for the Attributes object passed to
- * the startElement callback
- */
- public abstract TypeInfo getAttributeTypeInfo(int index);
-
- /**
- * Indicates if the attribute at the specified index is of the ID type.
- * @param index the attribute index as for the Attributes object passed to
- * the startElement callback
- */
- public abstract boolean isIdAttribute(int index);
-
- /**
- * Returns false if the attribute was defaulted (added by the validator).
- * @param index the attribute index as for the Attributes object passed to
- * the startElement callback
- */
- public abstract boolean isSpecified(int index);
-
-}
diff --git a/libjava/javax/xml/validation/Validator.java b/libjava/javax/xml/validation/Validator.java
deleted file mode 100644
index 4a96fc13a1f..00000000000
--- a/libjava/javax/xml/validation/Validator.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Validator.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.validation;
-
-import java.io.IOException;
-import javax.xml.transform.Source;
-import javax.xml.transform.Result;
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * A processor that validates a document against a schema.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public abstract class Validator
-{
-
- protected Validator()
- {
- }
-
- /**
- * Reset this validator to its original state.
- */
- public abstract void reset();
-
- /**
- * Validate the specified input.
- * @param source the document to validate
- */
- public void validate(Source source)
- throws SAXException, IOException
- {
- validate(source, null);
- }
-
- /**
- * Validate the specified input.
- * @param source the document to validate
- * @param result the PSVI document to output
- */
- public abstract void validate(Source source, Result result)
- throws SAXException, IOException;
-
- public abstract void setErrorHandler(ErrorHandler errorHandler);
-
- public abstract ErrorHandler getErrorHandler();
-
- public abstract void setResourceResolver(LSResourceResolver resourceResolver);
-
- public abstract LSResourceResolver getResourceResolver();
-
- public boolean getFeature(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException(name);
- }
-
- public void setFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException(name);
- }
-
- public Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException(name);
- }
-
- public void setProperty(String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException(name);
- }
-
-}
diff --git a/libjava/javax/xml/validation/ValidatorHandler.java b/libjava/javax/xml/validation/ValidatorHandler.java
deleted file mode 100644
index 50cd1516542..00000000000
--- a/libjava/javax/xml/validation/ValidatorHandler.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ValidatorHandler.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.validation;
-
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * A streaming validator that operates on a SAX event stream.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public abstract class ValidatorHandler
- implements ContentHandler
-{
-
- static final String NS_FEATURE =
- "http://xml.org/sax/features/namespace-prefixes";
-
- protected ValidatorHandler()
- {
- }
-
- /**
- * Sets the ContentHandler to receive PSVI SAX events.
- */
- public abstract void setContentHandler(ContentHandler receiver);
-
- /**
- * Returns the ContentHandler to receive PSVI SAX events.
- */
- public abstract ContentHandler getContentHandler();
-
- public abstract void setErrorHandler(ErrorHandler errorHandler);
-
- public abstract ErrorHandler getErrorHandler();
-
- public abstract void setResourceResolver(LSResourceResolver resourceResolver);
-
- public abstract LSResourceResolver getResourceResolver();
-
- public abstract TypeInfoProvider getTypeInfoProvider();
-
- public boolean getFeature(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (name.equals(NS_FEATURE))
- {
- return true;
- }
- throw new SAXNotRecognizedException(name);
- }
-
- public void setFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (name.equals(NS_FEATURE))
- {
- throw new SAXNotSupportedException();
- }
- throw new SAXNotRecognizedException(name);
- }
-
- public Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException(name);
- }
-
- public void setProperty(String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException(name);
- }
-
-}
diff --git a/libjava/javax/xml/xpath/XPath.java b/libjava/javax/xml/xpath/XPath.java
deleted file mode 100644
index 1bcfa63d22c..00000000000
--- a/libjava/javax/xml/xpath/XPath.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* XPath.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import org.xml.sax.InputSource;
-
-/**
- * Interface to the XPath evaluation environment.
- * @since 1.3
- */
-public interface XPath
-{
-
- /**
- * Resets the environment.
- */
- void reset();
-
- void setXPathVariableResolver(XPathVariableResolver resolver);
-
- XPathVariableResolver getXPathVariableResolver();
-
- void setXPathFunctionResolver(XPathFunctionResolver resolver);
-
- XPathFunctionResolver getXPathFunctionResolver();
-
- void setNamespaceContext(NamespaceContext nsContext);
-
- NamespaceContext getNamespaceContext();
-
- /**
- * Compiles an XPath expression for future evaluation.
- * @param expression the expression
- */
- XPathExpression compile(String expression)
- throws XPathExpressionException;
-
- /**
- * Evaluates an expression.
- * @param expression the expression
- * @param item the expression context
- * @param returnType the desired return type
- */
- Object evaluate(String expression,
- Object item,
- QName returnType)
- throws XPathExpressionException;
-
- /**
- * Evaluates an expression and returns the result as a string.
- * @param expression the expression
- * @param item the expression context
- */
- String evaluate(String expression,
- Object item)
- throws XPathExpressionException;
-
- /**
- * Evaluates an expression.
- * @param expression the expression
- * @param source the source to load the expression context from
- * @param returnType the desired return type
- */
- Object evaluate(String expression,
- InputSource source,
- QName returnType)
- throws XPathExpressionException;
-
- /**
- * Evaluates an expression and returns the result as a string.
- * @param expression the expression
- * @param source the source to load the expression context from
- */
- String evaluate(String expression,
- InputSource source)
- throws XPathExpressionException;
-
-}
diff --git a/libjava/javax/xml/xpath/XPathConstants.java b/libjava/javax/xml/xpath/XPathConstants.java
deleted file mode 100644
index 3b2d5d2d992..00000000000
--- a/libjava/javax/xml/xpath/XPathConstants.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* XPathConstants.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-import javax.xml.namespace.QName;
-
-/**
- * XPath constants.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public class XPathConstants
-{
-
- /**
- * The XPath 1.0 number data type.
- */
- public static final QName NUMBER =
- new QName("http://java.sun.com/jaxp/xpath/dom#number", "");
-
- /**
- * The XPath 1.0 string data type.
- */
- public static final QName STRING =
- new QName("http://java.sun.com/jaxp/xpath/dom#string", "");
-
- /**
- * The XPath 1.0 boolean data type.
- */
- public static final QName BOOLEAN =
- new QName("http://java.sun.com/jaxp/xpath/dom#boolean", "");
-
- /**
- * The XPath 1.0 node-set data type.
- */
- public static final QName NODESET =
- new QName("http://java.sun.com/jaxp/xpath/dom#node-set", "");
-
- /**
- * The XPath 1.0 node data type.
- */
- public static final QName NODE =
- new QName("http://java.sun.com/jaxp/xpath/dom#node", "");
-
- /**
- * The URL for the JAXP DOM object model.
- */
- public static final String DOM_OBJECT_MODEL =
- "http://java.sun.com/jaxp/xpath/dom";
-
-}
diff --git a/libjava/javax/xml/xpath/XPathException.java b/libjava/javax/xml/xpath/XPathException.java
deleted file mode 100644
index 030d0a9c1d7..00000000000
--- a/libjava/javax/xml/xpath/XPathException.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* XPathException.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-/**
- * A generic XPath exception.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public class XPathException
- extends Exception
-{
-
- Throwable cause;
-
- public XPathException(String message)
- {
- super(message);
- }
-
- public XPathException(Throwable cause)
- {
- super(cause);
- this.cause = cause;
- }
-
- public Throwable getCause()
- {
- return cause;
- }
-
- public void printStackTrace()
- {
- super.printStackTrace();
- }
-
- public void printStackTrace(PrintStream out)
- {
- super.printStackTrace(out);
- }
-
- public void printStackTrace(PrintWriter out)
- {
- super.printStackTrace(out);
- }
-
-}
diff --git a/libjava/javax/xml/xpath/XPathExpression.java b/libjava/javax/xml/xpath/XPathExpression.java
deleted file mode 100644
index 9ead27b8f26..00000000000
--- a/libjava/javax/xml/xpath/XPathExpression.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* XPathExpression.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-import javax.xml.namespace.QName;
-import org.xml.sax.InputSource;
-
-/**
- * An XPath expression.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public interface XPathExpression
-{
-
- /**
- * Evaluates this expression against the specified context.
- * @param item the evaluation context
- * @param returnType the desired return type
- */
- Object evaluate(Object item,
- QName returnType)
- throws XPathExpressionException;
-
- /**
- * Evaluates this expression against the specified context, returning the
- * result as a string.
- * @param item the evaluation context
- */
- String evaluate(Object item)
- throws XPathExpressionException;
-
- /**
- * Evaluates this expression against the specified context.
- * @param source the source to load the context from
- * @param returnType the desired return type
- */
- Object evaluate(InputSource source,
- QName returnType)
- throws XPathExpressionException;
-
- /**
- * Evaluates this expression against the specified context, returning the
- * result as a string.
- * @param source the source to load the context from
- */
- String evaluate(InputSource source)
- throws XPathExpressionException;
-
-}
diff --git a/libjava/javax/xml/xpath/XPathExpressionException.java b/libjava/javax/xml/xpath/XPathExpressionException.java
deleted file mode 100644
index 91716f1502f..00000000000
--- a/libjava/javax/xml/xpath/XPathExpressionException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* XPathExpressionException.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-/**
- * An exception in an XPath expression.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public class XPathExpressionException
- extends XPathException
-{
-
- public XPathExpressionException(String message)
- {
- super(message);
- }
-
- public XPathExpressionException(Throwable cause)
- {
- super(cause);
- }
-
-}
diff --git a/libjava/javax/xml/xpath/XPathFactory.java b/libjava/javax/xml/xpath/XPathFactory.java
deleted file mode 100644
index e87475f13d4..00000000000
--- a/libjava/javax/xml/xpath/XPathFactory.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/* XPathFactory.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.util.Properties;
-
-/**
- * Factory for creating XPath environments.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public abstract class XPathFactory
-{
-
- /**
- * The default property name according to the JAXP specification.
- */
- public static final String DEFAULT_PROPERTY_NAME =
- "javax.xml.xpath.XPathFactory";
-
- /**
- * The default object model URI.
- */
- public static final String DEFAULT_OBJECT_MODEL_URI =
- XPathConstants.DOM_OBJECT_MODEL;
-
- protected XPathFactory()
- {
- }
-
- /**
- * Returns a new factory for the default (DOM) object model.
- */
- public static final XPathFactory newInstance()
- {
- try
- {
- return newInstance(DEFAULT_OBJECT_MODEL_URI);
- }
- catch (XPathFactoryConfigurationException e)
- {
- throw new RuntimeException(e.getMessage());
- }
- }
-
- /**
- * Returns a new factory for the given object model URI.
- * The implementation class to load is the first found in the following
- * locations that advertises support for the given model URI:
- * <ol>
- * <li>the <code>javax.xml.xpath.XPathFactory</code> system property</li>
- * <li>the above named property value in the
- * <code><i>$JAVA_HOME</i>/lib/jaxp.properties</code> file</li>
- * <li>the class name specified in the
- * <code>META-INF/services/javax.xml.xpath.XPathFactory</code> system
- * resource</li>
- * <li>the default factory class</li>
- * </ol>
- * @param uri the object model URI
- */
- public static final XPathFactory newInstance(String uri)
- throws XPathFactoryConfigurationException
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (loader == null)
- {
- loader = XPathFactory.class.getClassLoader();
- }
- String className = null;
- int count = 0;
- do
- {
- className = getFactoryClassName(loader, count++);
- if (className != null)
- {
- try
- {
- Class t = (loader != null) ? loader.loadClass(className) :
- Class.forName(className);
- XPathFactory ret = (XPathFactory) t.newInstance();
- if (ret.isObjectModelSupported(uri))
- {
- return ret;
- }
- className = null;
- }
- catch (ClassNotFoundException e)
- {
- className = null;
- }
- catch (Exception e)
- {
- throw new XPathFactoryConfigurationException(e);
- }
- }
- }
- while (className == null && count < 4);
- String msg = "no factories with support for " + uri;
- throw new XPathFactoryConfigurationException(msg);
- }
-
- private static String getFactoryClassName(ClassLoader loader, int attempt)
- {
- final String propertyName = DEFAULT_PROPERTY_NAME;
- switch (attempt)
- {
- case 0:
- return System.getProperty(propertyName);
- case 1:
- try
- {
- File file = new File(System.getProperty("java.home"));
- file = new File(file, "lib");
- file = new File(file, "jaxp.properties");
- InputStream in = new FileInputStream(file);
- Properties props = new Properties();
- props.load(in);
- in.close();
- return props.getProperty(propertyName);
- }
- catch (IOException e)
- {
- return null;
- }
- case 2:
- try
- {
- String serviceKey = "/META-INF/services/" + propertyName;
- InputStream in = (loader != null) ?
- loader.getResourceAsStream(serviceKey) :
- XPathFactory.class.getResourceAsStream(serviceKey);
- if (in != null)
- {
- BufferedReader r =
- new BufferedReader(new InputStreamReader(in));
- String ret = r.readLine();
- r.close();
- return ret;
- }
- }
- catch (IOException e)
- {
- }
- return null;
- case 3:
- return "gnu.xml.xpath.XPathFactoryImpl";
- default:
- return null;
- }
- }
-
- /**
- * Indicates whether the specified object model URI is supported by
- * this factory.
- */
- public abstract boolean isObjectModelSupported(String objectModel);
-
- /**
- * Sets the state of the named feature.
- */
- public abstract void setFeature(String name, boolean value)
- throws XPathFactoryConfigurationException;
-
- /**
- * Returns the state of the named feature.
- */
- public abstract boolean getFeature(String name)
- throws XPathFactoryConfigurationException;
-
- /**
- * Sets the XPath variable resolver calback.
- */
- public abstract void setXPathVariableResolver(XPathVariableResolver resolver);
-
- /**
- * Sets the XPath extension function resolver calback.
- */
- public abstract void setXPathFunctionResolver(XPathFunctionResolver resolver);
-
- /**
- * Returns a new XPath evaluation environment.
- */
- public abstract XPath newXPath();
-
-}
diff --git a/libjava/javax/xml/xpath/XPathFactoryConfigurationException.java b/libjava/javax/xml/xpath/XPathFactoryConfigurationException.java
deleted file mode 100644
index a89646336d8..00000000000
--- a/libjava/javax/xml/xpath/XPathFactoryConfigurationException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* XPathFactoryConfigurationException.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-/**
- * A configuration exception in an XPath factory environment.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public class XPathFactoryConfigurationException
- extends XPathException
-{
-
- public XPathFactoryConfigurationException(String message)
- {
- super(message);
- }
-
- public XPathFactoryConfigurationException(Throwable cause)
- {
- super(cause);
- }
-
-}
diff --git a/libjava/javax/xml/xpath/XPathFunction.java b/libjava/javax/xml/xpath/XPathFunction.java
deleted file mode 100644
index c7ea733141f..00000000000
--- a/libjava/javax/xml/xpath/XPathFunction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* XPathFunction.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-import java.util.List;
-
-/**
- * An XPath extension function.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public interface XPathFunction
-{
-
- /**
- * Evaluate the function with the specified arguments.
- * @param args the list of arguments
- */
- Object evaluate(List args)
- throws XPathFunctionException;
-
-}
diff --git a/libjava/javax/xml/xpath/XPathFunctionException.java b/libjava/javax/xml/xpath/XPathFunctionException.java
deleted file mode 100644
index ebc8ce7d341..00000000000
--- a/libjava/javax/xml/xpath/XPathFunctionException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* XPathFunctionException.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-/**
- * An exception in an XPath function.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public class XPathFunctionException
- extends XPathExpressionException
-{
-
- public XPathFunctionException(String message)
- {
- super(message);
- }
-
- public XPathFunctionException(Throwable cause)
- {
- super(cause);
- }
-
-}
diff --git a/libjava/javax/xml/xpath/XPathFunctionResolver.java b/libjava/javax/xml/xpath/XPathFunctionResolver.java
deleted file mode 100644
index 208f432166e..00000000000
--- a/libjava/javax/xml/xpath/XPathFunctionResolver.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* XPathFunctionResolver.java --
- Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-import javax.xml.namespace.QName;
-
-/**
- * Interface providing the means to access XPath extension functions.
- *
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
- * @since 1.3
- */
-public interface XPathFunctionResolver
-{
-
- /**
- * Returns the function with the specified name and arity.
- * @param functionName the function name
- * @param arity the number of arguments
- */
- XPathFunction resolveFunction(QName functionName,
- int arity);
-
-}
diff --git a/libjava/javax/xml/xpath/XPathVariableResolver.java b/libjava/javax/xml/xpath/XPathVariableResolver.java
deleted file mode 100644
index 35226894aad..00000000000
--- a/libjava/javax/xml/xpath/XPathVariableResolver.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* XPathVariableResolver.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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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.xml.xpath;
-
-import javax.xml.namespace.QName;
-
-/**
- * Interface providing the means to access the values of XPath variable
- * references.
- * @since 1.3
- */
-public interface XPathVariableResolver
-{
-
- Object resolveVariable(QName variableName);
-
-}
diff --git a/libjava/jni/classpath/classpath_jawt.h b/libjava/jni/classpath/classpath_jawt.h
deleted file mode 100644
index f3326e1ca63..00000000000
--- a/libjava/jni/classpath/classpath_jawt.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* classpath_awt.h -- libjawt's interface to the peer library
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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. */
-
-/*
- * libjawt.so is linked directly to the peer library with -l. This
- * header declares all the functions that libjawt.so needs -- X-based
- * peer libraries wanting to support libjawt.so must implement these
- * functions.
- */
-
-#ifndef __classpath_jawt_h__
-#define __classpath_jawt_h__
-
-#include <jni.h>
-#include <X11/Xlib.h>
-
-#define CLASSPATH_JAWT_VERSION 0x10004
-
-jint classpath_jawt_get_awt_version ();
-Display* classpath_jawt_get_default_display (JNIEnv* env, jobject canvas);
-Drawable classpath_jawt_get_drawable (JNIEnv* env, jobject canvas);
-VisualID classpath_jawt_get_visualID (JNIEnv* env, jobject canvas);
-jint classpath_jawt_object_lock (jobject lock);
-void classpath_jawt_object_unlock (jobject lock);
-jint classpath_jawt_lock ();
-void classpath_jawt_unlock ();
-jobject classpath_jawt_create_lock ();
-void classpath_jawt_destroy_lock (jobject lock);
-
-#endif /* __classpath_jawt_h__ */
diff --git a/libjava/jni/classpath/native_state.c b/libjava/jni/classpath/native_state.c
deleted file mode 100644
index 5923bb8565d..00000000000
--- a/libjava/jni/classpath/native_state.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/* Magical NSA API -- Associate a C ptr with an instance of an object
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 <stdlib.h>
-#include <jni.h>
-#include "native_state.h"
-
-#define DEFAULT_TABLE_SIZE 97
-
-struct state_table *
-init_state_table_with_size (JNIEnv *env, jclass clazz, jint size)
-{
- struct state_table *table;
- jfieldID hash;
- jclass clazz_g;
-
- hash = (*env)->GetFieldID (env, clazz, "native_state", "I");
- if (hash == NULL)
- return NULL;
-
- clazz_g = (*env)->NewGlobalRef (env, clazz);
- if (clazz_g == NULL)
- return NULL;
-
- table = (struct state_table *) malloc (sizeof (struct state_table));
- table->size = size;
- table->head = (struct state_node **) calloc (sizeof (struct state_node *),
- table->size);
- table->hash = hash;
- table->clazz = clazz_g;
-
- return table;
-}
-
-struct state_table *
-init_state_table (JNIEnv *env, jclass clazz)
-{
- return init_state_table_with_size (env, clazz, DEFAULT_TABLE_SIZE);
-}
-
-static void *
-remove_node (struct state_node **head, jint obj_id)
-{
- struct state_node *back_ptr = NULL;
- struct state_node *node = *head;
-
- while (node != NULL)
- {
- if (node->key == obj_id)
- {
- void *return_value;
- if (back_ptr == NULL)
- *head = node->next;
- else
- back_ptr->next = node->next;
- return_value = node->c_state;
- free (node);
- return return_value;
- }
- back_ptr = node;
- node = node->next;
- }
-
- return NULL;
-}
-
-static void *
-get_node (struct state_node **head, jint obj_id)
-{
- struct state_node *back_ptr = NULL;
- struct state_node *node = *head;
-
- while (node != NULL)
- {
- if (node->key == obj_id)
- {
- /* Move the node we found to the front of the list. */
- if (back_ptr != NULL)
- {
- back_ptr->next = node->next;
- node->next = *head;
- *head = node;
- }
-
- /* Return the match. */
- return node->c_state;
- }
-
- back_ptr = node;
- node = node->next;
- }
-
- return NULL;
-}
-
-static void
-add_node (struct state_node **head, jint obj_id, void *state)
-{
- struct state_node *node = *head;
- struct state_node *back_ptr = NULL;
-
- struct state_node *new_node;
-
- if (node != NULL)
- {
- while (node->next != NULL && obj_id != node->key)
- {
- back_ptr = node;
- node = node->next;
- }
-
- if (node->key == obj_id)
- {
- /* If we're updating a node, move it to the front of the
- list. */
- if (back_ptr != NULL)
- {
- back_ptr->next = node->next;
- node->next = *head;
- }
- node->c_state = state;
- return;
- }
- }
-
- new_node = (struct state_node *) malloc (sizeof (struct state_node));
- new_node->key = obj_id;
- new_node->c_state = state;
- new_node->next = *head;
- *head = new_node;
-}
-
-void
-set_state_oid (JNIEnv *env, jobject lock, struct state_table *table,
- jint obj_id, void *state)
-{
- jint hash;
-
- hash = obj_id % table->size;
-
- (*env)->MonitorEnter (env, lock);
- add_node (&table->head[hash], obj_id, state);
- (*env)->MonitorExit (env, lock);
-}
-
-void *
-get_state_oid (JNIEnv *env, jobject lock, struct state_table *table,
- jint obj_id)
-{
- jint hash;
- void *return_value;
-
- hash = obj_id % table->size;
-
- (*env)->MonitorEnter (env, lock);
- return_value = get_node (&table->head[hash], obj_id);
- (*env)->MonitorExit (env, lock);
-
- return return_value;
-}
-
-void *
-remove_state_oid (JNIEnv *env, jobject lock, struct state_table *table,
- jint obj_id)
-{
- jint hash;
- void *return_value;
-
- hash = obj_id % table->size;
-
- (*env)->MonitorEnter (env, lock);
- return_value = remove_node (&table->head[hash], obj_id);
- (*env)->MonitorExit (env, lock);
-
- return return_value;
-}
-
-int
-set_state (JNIEnv *env, jobject obj, struct state_table *table, void *state)
-{
- jint obj_id;
- obj_id = (*env)->GetIntField (env, obj, table->hash);
-
- if ((*env)->ExceptionOccurred (env) != NULL)
- return -1;
-
- set_state_oid (env, table->clazz, table, obj_id, state);
- return 0;
-}
-
-void *
-get_state (JNIEnv *env, jobject obj, struct state_table *table)
-{
- jint obj_id;
- obj_id = (*env)->GetIntField (env, obj, table->hash);
-
- if ((*env)->ExceptionOccurred (env) != NULL)
- return NULL;
-
- return get_state_oid (env, table->clazz, table, obj_id);
-}
-
-void *
-remove_state_slot (JNIEnv *env, jobject obj, struct state_table *table)
-{
- jint obj_id;
- obj_id = (*env)->GetIntField (env, obj, table->hash);
-
- if ((*env)->ExceptionOccurred (env) != NULL)
- return NULL;
-
- return remove_state_oid (env, table->clazz, table, obj_id);
-}
diff --git a/libjava/jni/classpath/native_state.h b/libjava/jni/classpath/native_state.h
deleted file mode 100644
index 0a4edbd9764..00000000000
--- a/libjava/jni/classpath/native_state.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Magical NSA API -- Associate a C ptr with an instance of an object
- Copyright (C) 1998 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-#ifndef JCL_NATIVE_STATE
-#define JCL_NATIVE_STATE
-
-#include <jni.h>
-
-struct state_table
-{
- jint size; /* number of slots, should be prime */
- jfieldID hash; /* field containing System.identityHashCode(this) */
- jclass clazz; /* lock aquired for reading/writing nodes */
- struct state_node **head;
-};
-
-struct state_node
-{
- jint key;
- void *c_state;
- struct state_node *next;
-};
-
-struct state_table * init_state_table_with_size (JNIEnv *, jclass, jint);
-struct state_table * init_state_table (JNIEnv *, jclass);
-
-/* lowlevel api */
-void set_state_oid (JNIEnv *, jobject, struct state_table *, jint, void *);
-void * get_state_oid (JNIEnv *, jobject, struct state_table *, jint);
-void * remove_state_oid (JNIEnv *, jobject, struct state_table *, jint);
-
-/* highlevel api */
-int set_state (JNIEnv *, jobject, struct state_table *, void *);
-void * get_state (JNIEnv *, jobject, struct state_table *);
-void * remove_state_slot (JNIEnv *, jobject, struct state_table *);
-
-#endif
diff --git a/libjava/jni/gtk-peer/gdkfont.h b/libjava/jni/gtk-peer/gdkfont.h
deleted file mode 100644
index 1ed08582f45..00000000000
--- a/libjava/jni/gtk-peer/gdkfont.h
+++ /dev/null
@@ -1,142 +0,0 @@
-#ifndef __GDKFONT_H__
-#define __GDKFONT_H__
-
-/* gdkfont.h -- Some global stuff related to fonts and glyphs
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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 <pango/pango.h>
-#include <pango/pango-context.h>
-#include <pango/pango-fontmap.h>
-#include <pango/pangoft2.h>
-
-extern struct state_table *native_font_state_table;
-extern struct state_table *native_glyphvector_state_table;
-extern struct state_table *native_text_layout_state_table;
-
-#define NSA_FONT_INIT(env, clazz) \
- native_font_state_table = init_state_table (env, clazz)
-
-#define NSA_GET_FONT_PTR(env, obj) \
- get_state (env, obj, native_font_state_table)
-
-#define NSA_SET_FONT_PTR(env, obj, ptr) \
- set_state (env, obj, native_font_state_table, (void *)ptr)
-
-#define NSA_DEL_FONT_PTR(env, obj) \
- remove_state_slot (env, obj, native_font_state_table)
-
-
-#define NSA_GV_INIT(env, clazz) \
- native_glyphvector_state_table = init_state_table (env, clazz)
-
-#define NSA_GET_GV_PTR(env, obj) \
- get_state (env, obj, native_glyphvector_state_table)
-
-#define NSA_SET_GV_PTR(env, obj, ptr) \
- set_state (env, obj, native_glyphvector_state_table, (void *)ptr)
-
-#define NSA_DEL_GV_PTR(env, obj) \
- remove_state_slot (env, obj, native_glyphvector_state_table)
-
-
-#define NSA_TEXT_LAYOUT_INIT(env, clazz) \
- native_text_layout_state_table = init_state_table (env, clazz)
-
-#define NSA_GET_TEXT_LAYOUT_PTR(env, obj) \
- get_state (env, obj, native_text_layout_state_table)
-
-#define NSA_SET_TEXT_LAYOUT_PTR(env, obj, ptr) \
- set_state (env, obj, native_text_layout_state_table, (void *)ptr)
-
-#define NSA_DEL_TEXT_LAYOUT_PTR(env, obj) \
- remove_state_slot (env, obj, native_text_layout_state_table)
-
-#define FONT_METRICS_ASCENT 0
-#define FONT_METRICS_MAX_ASCENT 1
-#define FONT_METRICS_DESCENT 2
-#define FONT_METRICS_MAX_DESCENT 3
-#define FONT_METRICS_MAX_ADVANCE 4
-#define NUM_FONT_METRICS 5
-
-#define TEXT_METRICS_X_BEARING 0
-#define TEXT_METRICS_Y_BEARING 1
-#define TEXT_METRICS_WIDTH 2
-#define TEXT_METRICS_HEIGHT 3
-#define TEXT_METRICS_X_ADVANCE 4
-#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;
- PangoFontDescription *desc;
- PangoContext *ctx;
- PangoLayout *layout;
- /*
- * The GdkGraphics2D (using cairo) may store a pointer to a
- * cairo_font_t here; since we want to work equally well with
- * the GdkGraphics class (using GDK) we do not explicitly mention
- * cairo types here; it is up to the higher level driver routine
- * in GdkClasspathFontPeer.java to decide which backend functions
- * to invoke.
- */
- void *graphics_resource;
-};
-
-struct textlayout
-{
- PangoLayout *pango_layout;
-};
-
-#endif /* __GDKFONT_H__ */
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
deleted file mode 100644
index 595c1a28a6e..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Native implementation of functions in GThreadNativeMethodRunner
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.h"
-#include "gthread-jni.h"
-
-/*
- * Class: GThreadNativeMethodRunner
- * Method: nativeRun
- * Signature: (J)V
- *
- * Purpose: Run the C function whose function pointer is
- *
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun
- (JNIEnv *env __attribute__((unused)),
- jobject lcl_obj __attribute__((unused)),
- jlong funcAddr, jlong funcArg)
-{
- /* Convert the function's address back into a pointer to a C function. */
- void *(*funcPtr)(void *) = (void *(*)(void *)) (size_t)funcAddr;
-
- /* We do not need to worry about the return value from funcPtr(); it's
- just thrown away. That is part of the g_threads spec, so no reason
- to worry about returning it. */
- (void) funcPtr((void *) (size_t)funcArg);
- /* Fall off the end and terminate the thread of control. */
-}
-
-/* Local Variables: */
-/* c-file-style: "gnu" */
-/* End: */
-
-
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
deleted file mode 100644
index 55a20e8bb7c..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
+++ /dev/null
@@ -1,401 +0,0 @@
-/* gnu_java_awt_GdkFont.c
- Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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 "gdkfont.h"
-#include "gnu_java_awt_peer_gtk_GdkFontPeer.h"
-
-struct state_table *native_font_state_table;
-
-enum java_awt_font_style {
- java_awt_font_PLAIN = 0,
- java_awt_font_BOLD = 1,
- java_awt_font_ITALIC = 2
-};
-
-enum java_awt_font_baseline {
- java_awt_font_ROMAN_BASELINE = 0,
- java_awt_font_CENTER_BASELINE = 1,
- java_awt_font_HANGING_BASELINE = 2
-};
-
-static jmethodID glyphVector_ctor;
-static jclass glyphVector_class;
-static PangoAttrList *attrs = NULL;
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkFontPeer_initStaticState
- (JNIEnv *env, jclass clazz)
-{
- NSA_FONT_INIT (env, clazz);
-
- glyphVector_class = (*env)->FindClass
- (env, "gnu/java/awt/peer/gtk/GdkGlyphVector");
-
- glyphVector_ctor = (*env)->GetMethodID
- (env, glyphVector_class, "<init>",
- "([D[ILjava/awt/Font;Ljava/awt/font/FontRenderContext;)V");
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkFontPeer_initState
- (JNIEnv *env, jobject self)
-{
- struct peerfont *pfont = NULL;
- gdk_threads_enter ();
- g_assert (self != NULL);
- pfont = (struct peerfont *) g_malloc0 (sizeof (struct peerfont));
- g_assert (pfont != NULL);
- NSA_SET_FONT_PTR (env, self, pfont);
- gdk_threads_leave ();
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkFontPeer_dispose
- (JNIEnv *env, jobject self)
-{
- struct peerfont *pfont = NULL;
-
- gdk_threads_enter ();
- pfont = (struct peerfont *)NSA_DEL_FONT_PTR (env, self);
- g_assert (pfont != NULL);
- if (pfont->layout != NULL)
- g_object_unref (pfont->font);
- if (pfont->font != NULL)
- g_object_unref (pfont->font);
- if (pfont->ctx != NULL)
- g_object_unref (pfont->ctx);
- if (pfont->desc != NULL)
- pango_font_description_free (pfont->desc);
- g_free (pfont);
- gdk_threads_leave ();
-}
-
-
-JNIEXPORT jobject JNICALL
-Java_gnu_java_awt_peer_gtk_GdkFontPeer_getGlyphVector
- (JNIEnv *env, jobject self,
- jstring chars,
- jobject font,
- jobject fontRenderContext)
-{
- struct peerfont *pfont = NULL;
- GList *items = NULL, *i = NULL;
- gchar *str = NULL;
- int len, j;
- double *native_extents;
- int *native_codes;
- jintArray java_codes = NULL;
- jdoubleArray java_extents = NULL;
-
- gdk_threads_enter ();
-
- pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, self);
- g_assert (pfont != NULL);
-
- len = (*gdk_env())->GetStringUTFLength (env, chars);
- str = (gchar *)(*env)->GetStringUTFChars (env, chars, NULL);
- g_assert (str != NULL);
-
- if (attrs == NULL)
- attrs = pango_attr_list_new ();
-
- if (len > 0 && str[len-1] == '\0')
- len--;
-
- items = pango_itemize (pfont->ctx, str, 0, len, attrs, NULL);
-
- i = g_list_first (items);
-
- if (i == NULL)
- {
- java_extents = (*env)->NewDoubleArray (env, 0);
- java_codes = (*env)->NewIntArray (env, 0);
- }
- else
- {
- PangoGlyphString *glyphs;
- PangoItem *item = (PangoItem *)i->data;
-
- pango_context_set_font_description (pfont->ctx, pfont->desc);
- pango_context_set_language (pfont->ctx, gtk_get_default_language());
- pango_context_load_font (pfont->ctx, pfont->desc);
-
- glyphs = pango_glyph_string_new ();
- g_assert (glyphs != NULL);
-
- pango_shape (str + item->offset, item->length,
- &(item->analysis), glyphs);
-
- if (glyphs->num_glyphs > 0)
- {
- int x = 0;
- double scale = ((double) PANGO_SCALE);
-
- java_extents = (*env)->NewDoubleArray (env, glyphs->num_glyphs * NUM_GLYPH_METRICS);
- java_codes = (*env)->NewIntArray (env, glyphs->num_glyphs);
- native_extents = (*env)->GetDoubleArrayElements (env, java_extents, NULL);
- native_codes = (*env)->GetIntArrayElements (env, java_codes, NULL);
-
- for (j = 0; j < glyphs->num_glyphs; ++j)
- {
- PangoRectangle ink;
- PangoRectangle logical;
- PangoGlyphGeometry *geom = &glyphs->glyphs[j].geometry;
-
- pango_font_get_glyph_extents (pfont->font,
- glyphs->glyphs[j].glyph,
- &ink, &logical);
-
- native_codes[j] = glyphs->glyphs[j].glyph;
-
- native_extents[ GLYPH_LOG_X(j) ] = (logical.x) / scale;
- native_extents[ GLYPH_LOG_Y(j) ] = (- logical.y) / scale;
- native_extents[ GLYPH_LOG_WIDTH(j) ] = (logical.width) / scale;
- native_extents[ GLYPH_LOG_HEIGHT(j) ] = (logical.height) / scale;
-
- native_extents[ GLYPH_INK_X(j) ] = (ink.x) / scale;
- native_extents[ GLYPH_INK_Y(j) ] = (- ink.y) / scale;
- native_extents[ GLYPH_INK_WIDTH(j) ] = (ink.width) / scale;
- native_extents[ GLYPH_INK_HEIGHT(j) ] = (ink.height) / scale;
-
- native_extents[ GLYPH_POS_X(j) ] = (x + geom->x_offset) / scale;
- native_extents[ GLYPH_POS_Y(j) ] = ( - geom->y_offset) / scale;
-
- x += geom->width;
- }
- (*env)->ReleaseDoubleArrayElements (env, java_extents, native_extents, 0);
- (*env)->ReleaseIntArrayElements (env, java_codes, native_codes, 0);
- }
-
- pango_glyph_string_free (glyphs);
- }
-
- (*env)->ReleaseStringUTFChars (env, chars, str);
-
- for (i = g_list_first (items); i != NULL; i = g_list_next (i))
- g_free (i->data);
-
- g_list_free (items);
-
- gdk_threads_leave ();
-
- return (*env)->NewObject (env,
- glyphVector_class,
- glyphVector_ctor,
- java_extents, java_codes,
- font, fontRenderContext);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkFontPeer_getFontMetrics
- (JNIEnv *env, jobject java_font, jdoubleArray java_metrics)
-{
- struct peerfont *pfont = NULL;
- jdouble *native_metrics = NULL;
- PangoFontMetrics *pango_metrics;
-
- gdk_threads_enter();
-
- pfont = (struct peerfont *) NSA_GET_FONT_PTR (env, java_font);
- g_assert (pfont != NULL);
-
- pango_metrics
- = pango_context_get_metrics (pfont->ctx, pfont->desc,
- gtk_get_default_language ());
-
- native_metrics
- = (*env)->GetDoubleArrayElements (env, java_metrics, NULL);
-
- g_assert (native_metrics != NULL);
-
- native_metrics[FONT_METRICS_ASCENT]
- = PANGO_PIXELS (pango_font_metrics_get_ascent (pango_metrics));
-
- native_metrics[FONT_METRICS_MAX_ASCENT]
- = native_metrics[FONT_METRICS_ASCENT];
-
- native_metrics[FONT_METRICS_DESCENT]
- = PANGO_PIXELS (pango_font_metrics_get_descent (pango_metrics));
-
- if (native_metrics[FONT_METRICS_DESCENT] < 0)
- native_metrics[FONT_METRICS_DESCENT]
- = - native_metrics[FONT_METRICS_DESCENT];
-
- native_metrics[FONT_METRICS_MAX_DESCENT]
- = native_metrics[FONT_METRICS_DESCENT];
-
- native_metrics[FONT_METRICS_MAX_ADVANCE]
- = PANGO_PIXELS (pango_font_metrics_get_approximate_char_width
- (pango_metrics));
-
- (*env)->ReleaseDoubleArrayElements (env,
- java_metrics,
- native_metrics, 0);
-
- pango_font_metrics_unref (pango_metrics);
-
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics
- (JNIEnv *env, jobject java_font, jstring str, jdoubleArray java_metrics)
-{
- struct peerfont *pfont = NULL;
- const char *cstr = NULL;
- jdouble *native_metrics = NULL;
- PangoRectangle log;
-
- gdk_threads_enter();
-
- pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, java_font);
- g_assert (pfont != NULL);
-
- cstr = (*env)->GetStringUTFChars (env, str, NULL);
- g_assert(cstr != NULL);
-
- pango_layout_set_text (pfont->layout, cstr, -1);
- pango_layout_get_extents (pfont->layout, NULL, &log);
-
- (*env)->ReleaseStringUTFChars (env, str, cstr);
- pango_layout_set_text (pfont->layout, "", -1);
-
- native_metrics = (*env)->GetDoubleArrayElements (env, java_metrics, NULL);
- g_assert (native_metrics != NULL);
-
- native_metrics[TEXT_METRICS_X_BEARING]
- = PANGO_PIXELS( ((double)log.x) );
-
- native_metrics[TEXT_METRICS_Y_BEARING]
- = PANGO_PIXELS( ((double)log.y) );
-
- native_metrics[TEXT_METRICS_WIDTH]
- = PANGO_PIXELS( ((double)log.width) );
-
- native_metrics[TEXT_METRICS_HEIGHT]
- = PANGO_PIXELS( ((double)log.height) );
-
- native_metrics[TEXT_METRICS_X_ADVANCE]
- = PANGO_PIXELS( ((double) (log.x + log.width)) );
-
- native_metrics[TEXT_METRICS_Y_ADVANCE]
- = PANGO_PIXELS( ((double) (log.y + log.height)) );
-
- (*env)->ReleaseDoubleArrayElements (env, java_metrics, native_metrics, 0);
-
- gdk_threads_leave();
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont
- (JNIEnv *env, jobject self, jstring family_name_str, jint style_int, jint size, jboolean useGraphics2D)
-{
- struct peerfont *pfont = NULL;
- char const *family_name = NULL;
- enum java_awt_font_style style;
- PangoFT2FontMap *ft2_map;
-
- gdk_threads_enter ();
- style = (enum java_awt_font_style) style_int;
-
- g_assert (self != NULL);
- pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, self);
- g_assert (pfont != NULL);
-
- if (pfont->ctx != NULL)
- g_object_unref (pfont->ctx);
- if (pfont->font != NULL)
- g_object_unref (pfont->font);
- if (pfont->desc != NULL)
- pango_font_description_free (pfont->desc);
-
- pfont->desc = pango_font_description_new ();
- g_assert (pfont->desc != NULL);
-
- family_name = (*env)->GetStringUTFChars(env, family_name_str, 0);
- g_assert (family_name != NULL);
- pango_font_description_set_family (pfont->desc, family_name);
- (*env)->ReleaseStringUTFChars(env, family_name_str, family_name);
-
-
- if (style & java_awt_font_BOLD)
- pango_font_description_set_weight (pfont->desc, PANGO_WEIGHT_BOLD);
-
- if (style & java_awt_font_ITALIC)
- pango_font_description_set_style (pfont->desc, PANGO_STYLE_ITALIC);
-
- if (useGraphics2D)
- {
- pango_font_description_set_size (pfont->desc, size * PANGO_SCALE);
- if (pfont->ctx == NULL)
- {
- ft2_map = PANGO_FT2_FONT_MAP(pango_ft2_font_map_for_display ());
- pfont->ctx = pango_ft2_font_map_create_context (ft2_map);
- }
- }
- else
- {
- /* GDK uses a slightly different DPI setting. */
- pango_font_description_set_size (pfont->desc,
- size * dpi_conversion_factor);
- if (pfont->ctx == NULL)
- pfont->ctx = gdk_pango_context_get();
- }
-
- g_assert (pfont->ctx != NULL);
-
- if (pfont->font != NULL)
- {
- g_object_unref (pfont->font);
- pfont->font = NULL;
- }
-
- pango_context_set_font_description (pfont->ctx, pfont->desc);
- pango_context_set_language (pfont->ctx, gtk_get_default_language());
- pfont->font = pango_context_load_font (pfont->ctx, pfont->desc);
- g_assert (pfont->font != NULL);
-
- if (pfont->layout == NULL)
- pfont->layout = pango_layout_new (pfont->ctx);
- g_assert (pfont->layout != NULL);
-
- gdk_threads_leave ();
-}
-
-
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
deleted file mode 100644
index 26e2230a7da..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
+++ /dev/null
@@ -1,692 +0,0 @@
-/* gdkgraphics.c
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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_GdkGraphics.h"
-#include <gdk/gdkprivate.h>
-#include <gdk/gdkx.h>
-
-#define GDK_STABLE_IS_PIXMAP(d) (GDK_IS_PIXMAP(d))
-
-GdkPoint *
-translate_points (JNIEnv *env, jintArray xpoints, jintArray ypoints,
- jint npoints, jint x_offset, jint y_offset);
-static void realize_cb (GtkWidget *widget, jobject peer);
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_copyState
- (JNIEnv *env, jobject obj, jobject old)
-{
- struct graphics *g, *g_old;
-
- g = (struct graphics *) malloc (sizeof (struct graphics));
- g_old = (struct graphics *) NSA_GET_PTR (env, old);
-
- *g = *g_old;
-
- gdk_threads_enter ();
-
- g->gc = gdk_gc_new (g->drawable);
- gdk_gc_copy (g->gc, g_old->gc);
-
- if (GDK_STABLE_IS_PIXMAP (g->drawable))
- gdk_pixmap_ref (g->drawable);
- else /* GDK_IS_WINDOW (g->drawable) */
- gdk_window_ref (g->drawable);
-
- gdk_colormap_ref (g->cm);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, g);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_initState__II
- (JNIEnv *env, jobject obj, jint width, jint height)
-{
- struct graphics *g;
-
- g = (struct graphics *) malloc (sizeof (struct graphics));
- g->x_offset = g->y_offset = 0;
-
- gdk_threads_enter ();
- g->drawable = (GdkDrawable *) gdk_pixmap_new (NULL, width, height,
- gdk_rgb_get_visual ()->depth);
- g->cm = gdk_rgb_get_cmap ();
- gdk_colormap_ref (g->cm);
- g->gc = gdk_gc_new (g->drawable);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, g);
-}
-
-/* copy the native state of the peer (GtkWidget *) to the native state
- of the graphics object */
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_initState__Lgnu_java_awt_peer_gtk_GtkComponentPeer_2
- (JNIEnv *env, jobject obj, jobject peer)
-{
- struct graphics *g = (struct graphics *) malloc (sizeof (struct graphics));
- void *ptr;
- GtkWidget *widget;
- GdkColor color;
-
- ptr = NSA_GET_PTR (env, peer);
- g->x_offset = g->y_offset = 0;
-
- gdk_threads_enter ();
-
- widget = GTK_WIDGET (ptr);
- g->drawable = (GdkDrawable *) widget->window;
-
- gdk_window_ref (g->drawable);
- g->cm = gtk_widget_get_colormap (widget);
- gdk_colormap_ref (g->cm);
- g->gc = gdk_gc_new (g->drawable);
- gdk_gc_copy (g->gc, widget->style->fg_gc[GTK_STATE_NORMAL]);
- color = widget->style->fg[GTK_STATE_NORMAL];
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, g);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_connectSignals
- (JNIEnv *env, jobject obj, jobject peer)
-{
- void *ptr;
- jobject *gref;
-
- NSA_SET_GLOBAL_REF (env, obj);
- gref = NSA_GET_GLOBAL_REF (env, obj);
-
- ptr = NSA_GET_PTR (env, peer);
-
- gdk_threads_enter ();
-
- g_signal_connect_after (G_OBJECT (ptr), "realize",
- G_CALLBACK (realize_cb), *gref);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_dispose
- (JNIEnv *env, jobject obj)
-{
- struct graphics *g;
-
-
- g = (struct graphics *) NSA_DEL_PTR (env, obj);
-
- if (!g) return; /* dispose has been called more than once */
-
- gdk_threads_enter ();
- XFlush (GDK_DISPLAY ());
-
- gdk_gc_destroy (g->gc);
-
- if (GDK_STABLE_IS_PIXMAP (g->drawable))
- gdk_pixmap_unref (g->drawable);
- else /* GDK_IS_WINDOW (g->drawable) */
- gdk_window_unref (g->drawable);
-
- gdk_colormap_unref (g->cm);
-
- gdk_threads_leave ();
-
-
- free (g);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_translateNative
- (JNIEnv *env, jobject obj, jint x, jint y)
-{
- struct graphics *g;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- g->x_offset += x;
- g->y_offset += y;
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_drawString
- (JNIEnv *env, jobject obj, jobject font, jstring str, jint x, jint y)
-{
- struct peerfont *pfont = NULL;
- struct graphics *g;
- const char *cstr;
- int baseline_y;
- PangoLayoutIter *iter;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
- g_assert (g != NULL);
-
- pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, font);
- g_assert (pfont != NULL);
-
- cstr = (*env)->GetStringUTFChars (env, str, NULL);
-
- gdk_threads_enter ();
-
- pango_layout_set_font_description (pfont->layout, pfont->desc);
- pango_layout_set_text (pfont->layout, cstr, -1);
- iter = pango_layout_get_iter (pfont->layout);
-
- baseline_y = pango_layout_iter_get_baseline (iter);
-
- gdk_draw_layout (g->drawable, g->gc,
- x + g->x_offset,
- y + g->y_offset - PANGO_PIXELS (baseline_y),
- pfont->layout);
-
- pango_layout_iter_free (iter);
- pango_layout_set_text (pfont->layout, "", -1);
-
- gdk_flush ();
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, str, cstr);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_drawLine
- (JNIEnv *env, jobject obj, jint x, jint y, jint x2, jint y2)
-{
- struct graphics *g;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gdk_draw_line (g->drawable, g->gc,
- x + g->x_offset, y + g->y_offset,
- x2 + g->x_offset, y2 + g->y_offset);
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_fillRect
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
-{
- struct graphics *g;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- gdk_draw_rectangle (g->drawable, g->gc, TRUE,
- x + g->x_offset, y + g->y_offset, width, height);
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_drawRect
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
-{
- struct graphics *g;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gdk_draw_rectangle (g->drawable, g->gc, FALSE,
- x + g->x_offset, y + g->y_offset, width, height);
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_copyArea
- (JNIEnv *env, jobject obj, jint x, jint y,
- jint width, jint height, jint dx, jint dy)
-{
- struct graphics *g;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gdk_window_copy_area ((GdkWindow *)g->drawable,
- g->gc,
- x + g->x_offset + dx, y + g->y_offset + dy,
- (GdkWindow *)g->drawable,
- x + g->x_offset, y + g->y_offset,
- width, height);
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_copyPixmap
- (JNIEnv *env, jobject obj, jobject offscreen,
- jint x, jint y, jint width, jint height)
-{
- struct graphics *g1, *g2;
-
- g1 = (struct graphics *) NSA_GET_PTR (env, obj);
- g2 = (struct graphics *) NSA_GET_PTR (env, offscreen);
-
- gdk_threads_enter ();
- gdk_window_copy_area ((GdkWindow *)g1->drawable,
- g1->gc,
- x + g1->x_offset, y + g1->y_offset,
- (GdkWindow *)g2->drawable,
- 0 + g2->x_offset, 0 + g2->y_offset,
- width, height);
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-static void flip_pixbuf (GdkPixbuf *pixbuf,
- jboolean flip_x,
- jboolean flip_y,
- jint width,
- jint height)
-{
- gint src_rs;
- guchar *src_pix;
-
- src_rs = gdk_pixbuf_get_rowstride (pixbuf);
- src_pix = gdk_pixbuf_get_pixels (pixbuf);
-
- if (flip_x)
- {
- gint i, channels;
- guchar buf[4];
-
- channels = gdk_pixbuf_get_has_alpha (pixbuf) ? 4 : 3;
-
- for (i = 0; i < height; i++)
- {
- guchar *left = src_pix + i * src_rs;
- guchar *right = left + channels * (width - 1);
- while (left < right)
- {
- g_memmove (buf, left, channels);
- g_memmove (left, right, channels);
- g_memmove (right, buf, channels);
- left += channels;
- right -= channels;
- }
- }
- }
-
- if (flip_y)
- {
- guchar *top = src_pix;
- guchar *bottom = top + (height - 1) * src_rs;
- gpointer buf = g_malloc (src_rs);
-
- while (top < bottom)
- {
- g_memmove (buf, top, src_rs);
- g_memmove (top, bottom, src_rs);
- g_memmove (bottom, buf, src_rs);
- top += src_rs;
- bottom -= src_rs;
- }
-
- g_free (buf);
- }
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_copyAndScalePixmap
- (JNIEnv *env, jobject obj, jobject offscreen, jboolean flip_x, jboolean flip_y,
- jint src_x, jint src_y, jint src_width, jint src_height,
- jint dest_x, jint dest_y, jint dest_width, jint dest_height)
-{
- struct graphics *g1, *g2;
- GdkPixbuf *buf_src, *buf_dest;
-
- g1 = (struct graphics *) NSA_GET_PTR (env, obj);
- g2 = (struct graphics *) NSA_GET_PTR (env, offscreen);
-
- gdk_threads_enter ();
-
- buf_src = gdk_pixbuf_get_from_drawable (NULL,
- g2->drawable,
- g2->cm,
- src_x,
- src_y,
- 0,
- 0,
- src_width,
- src_height);
-
- buf_dest = gdk_pixbuf_scale_simple (buf_src,
- dest_width,
- dest_height,
- GDK_INTERP_BILINEAR);
-
- if (flip_x || flip_y)
- {
- flip_pixbuf (buf_dest, flip_x, flip_y, dest_width, dest_height);
- }
-
- gdk_pixbuf_render_to_drawable (buf_dest,
- g1->drawable,
- g1->gc,
- 0,
- 0,
- dest_x,
- dest_y,
- dest_width,
- dest_height,
- GDK_RGB_DITHER_NORMAL,
- 0,
- 0);
-
- g_object_unref (G_OBJECT (buf_src));
- g_object_unref (G_OBJECT (buf_dest));
-
- gdk_threads_leave ();
-}
-
-
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_clearRect
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
-{
- struct graphics *g;
- GdkGCValues saved;
- GtkWidget *widget;
- union widget_union w;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- if (!g)
- {
- gdk_threads_leave ();
- return;
- }
- if (GDK_IS_WINDOW (g->drawable))
- {
- w.widget = &widget;
- gdk_window_get_user_data (GDK_WINDOW (g->drawable), w.void_widget);
- if (widget == NULL || !GTK_IS_EVENT_BOX (widget))
- gdk_window_clear_area ((GdkWindow *) g->drawable,
- x + g->x_offset, y + g->y_offset,
- width, height);
- }
- else
- {
- gdk_gc_get_values (g->gc, &saved);
- gdk_gc_set_foreground (g->gc, &(saved.background));
- gdk_draw_rectangle (g->drawable, g->gc, TRUE,
- x + g->x_offset, y + g->y_offset, width, height);
- gdk_gc_set_foreground (g->gc, &(saved.foreground));
- }
-
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_setFunction
- (JNIEnv *env, jobject obj, jint func)
-{
- struct graphics *g;
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gdk_gc_set_function (g->gc, func);
- gdk_threads_leave ();
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_setFGColor
- (JNIEnv *env, jobject obj, jint red, jint green, jint blue)
-{
- GdkColor color;
- struct graphics *g;
-
- color.red = red << 8;
- color.green = green << 8;
- color.blue = blue << 8;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gdk_color_alloc (g->cm, &color);
- gdk_gc_set_foreground (g->gc, &color);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_drawArc
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height,
- jint angle1, jint angle2)
-{
- struct graphics *g;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gdk_draw_arc (g->drawable, g->gc, FALSE,
- x + g->x_offset, y + g->y_offset,
- width, height, angle1 << 6, angle2 << 6);
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-GdkPoint *
-translate_points (JNIEnv *env, jintArray xpoints, jintArray ypoints,
- jint npoints, jint x_offset, jint y_offset)
-{
- GdkPoint *points;
- jint *x, *y;
- int i;
-
- /* allocate one more point than necessary, in case we need to tack
- on an extra due to the semantics of Java polygons. */
- points = g_malloc (sizeof (GdkPoint) * (npoints + 1));
-
- x = (*env)->GetIntArrayElements (env, xpoints, NULL);
- y = (*env)->GetIntArrayElements (env, ypoints, NULL);
-
- for (i = 0; i < npoints; i++)
- {
- points[i].x = x[i] + x_offset;
- points[i].y = y[i] + y_offset;
- }
-
- (*env)->ReleaseIntArrayElements (env, xpoints, x, JNI_ABORT);
- (*env)->ReleaseIntArrayElements (env, ypoints, y, JNI_ABORT);
-
- return points;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_drawPolyline
- (JNIEnv *env, jobject obj, jintArray xpoints, jintArray ypoints,
- jint npoints)
-{
- struct graphics *g;
- GdkPoint *points;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
- points = translate_points (env, xpoints, ypoints, npoints,
- g->x_offset, g->y_offset);
-
- gdk_threads_enter ();
- gdk_draw_lines (g->drawable, g->gc, points, npoints);
- gdk_flush ();
- gdk_threads_leave ();
-
- g_free (points);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_drawPolygon
- (JNIEnv *env, jobject obj, jintArray xpoints, jintArray ypoints,
- jint npoints)
-{
- struct graphics *g;
- GdkPoint *points;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
- points = translate_points (env, xpoints, ypoints, npoints,
- g->x_offset, g->y_offset);
-
- /* make sure the polygon is closed, per Java semantics.
- if it's not, we close it. */
- if (points[0].x != points[npoints-1].x || points[0].y != points[npoints-1].y)
- points[npoints++] = points[0];
-
- gdk_threads_enter ();
- gdk_draw_lines (g->drawable, g->gc, points, npoints);
- gdk_flush ();
- gdk_threads_leave ();
-
- g_free (points);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_fillPolygon
- (JNIEnv *env, jobject obj, jintArray xpoints, jintArray ypoints,
- jint npoints)
-{
- struct graphics *g;
- GdkPoint *points;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
- points = translate_points (env, xpoints, ypoints, npoints,
- g->x_offset, g->y_offset);
- gdk_threads_enter ();
- gdk_draw_polygon (g->drawable, g->gc, TRUE, points, npoints);
- gdk_flush ();
- gdk_threads_leave ();
-
- g_free (points);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_fillArc
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height,
- jint angle1, jint angle2)
-{
- struct graphics *g;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gdk_draw_arc (g->drawable, g->gc, TRUE,
- x + g->x_offset, y + g->y_offset,
- width, height, angle1 << 6, angle2 << 6);
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_drawOval
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
-{
- struct graphics *g;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gdk_draw_arc (g->drawable, g->gc, FALSE,
- x + g->x_offset, y + g->y_offset,
- width, height, 0, 23040);
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_fillOval
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
-{
- struct graphics *g;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gdk_draw_arc (g->drawable, g->gc, TRUE,
- x + g->x_offset, y + g->y_offset,
- width, height, 0, 23040);
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics_setClipRectangle
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
-{
- struct graphics *g;
- GdkRectangle rectangle;
-
- g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- rectangle.x = x + g->x_offset;
- rectangle.y = y + g->y_offset;
- rectangle.width = width;
- rectangle.height = height;
-
- gdk_threads_enter ();
- gdk_gc_set_clip_rectangle (g->gc, &rectangle);
- gdk_threads_leave ();
-}
-
-static void realize_cb (GtkWidget *widget __attribute__ ((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
-
- (*gdk_env())->CallVoidMethod (gdk_env(), peer, initComponentGraphicsID);
-
- NSA_DEL_GLOBAL_REF (gdk_env(), peer);
-
- gdk_threads_enter ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
deleted file mode 100644
index 97787387708..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
+++ /dev/null
@@ -1,1621 +0,0 @@
-/* gnu_java_awt_peer_gtk_GdkGraphics2d.c
- Copyright (C) 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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 "gtkcairopeer.h"
-#include "gdkfont.h"
-#include "gnu_java_awt_peer_gtk_GdkGraphics2D.h"
-#include <gdk/gdktypes.h>
-#include <gdk/gdkprivate.h>
-#include <gdk/gdkx.h>
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gdk-pixbuf/gdk-pixdata.h>
-
-#include <cairo-ft.h>
-#include <cairo-xlib.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-struct state_table *native_graphics2d_state_table;
-
-#define NSA_G2D_INIT(env, clazz) \
- native_graphics2d_state_table = init_state_table (env, clazz)
-
-#define NSA_GET_G2D_PTR(env, obj) \
- get_state (env, obj, native_graphics2d_state_table)
-
-#define NSA_SET_G2D_PTR(env, obj, ptr) \
- set_state (env, obj, native_graphics2d_state_table, (void *)ptr)
-
-#define NSA_DEL_G2D_PTR(env, obj) \
- remove_state_slot (env, obj, native_graphics2d_state_table)
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initStaticState
- (JNIEnv *env, jclass clazz)
-{
- gdk_threads_enter();
- NSA_G2D_INIT (env, clazz);
- gdk_threads_leave();
-}
-
-/* these public final constants are part of the java2d public API, so we
- write them explicitly here to save fetching them from the constant pool
- all the time. */
-
-#ifndef min
-#define min(x,y) ((x) < (y) ? (x) : (y))
-#endif
-
-enum java_awt_alpha_composite_rule
- {
- java_awt_alpha_composite_CLEAR = 1,
- java_awt_alpha_composite_SRC = 2,
- java_awt_alpha_composite_SRC_OVER = 3,
- java_awt_alpha_composite_DST_OVER = 4,
- java_awt_alpha_composite_SRC_IN = 5,
- java_awt_alpha_composite_DST_IN = 6,
- java_awt_alpha_composite_SRC_OUT = 7,
- java_awt_alpha_composite_DST_OUT = 8,
- java_awt_alpha_composite_DST = 9,
- java_awt_alpha_composite_SRC_ATOP = 10,
- java_awt_alpha_composite_DST_ATOP = 11,
- java_awt_alpha_composite_XOR = 12
- };
-
-enum java_awt_basic_stroke_join_rule
- {
- java_awt_basic_stroke_JOIN_MITER = 0,
- java_awt_basic_stroke_JOIN_ROUND = 1,
- java_awt_basic_stroke_JOIN_BEVEL = 2
- };
-
-enum java_awt_basic_stroke_cap_rule
- {
- java_awt_basic_stroke_CAP_BUTT = 0,
- java_awt_basic_stroke_CAP_ROUND = 1,
- java_awt_basic_stroke_CAP_SQUARE = 2
- };
-
-enum java_awt_geom_path_iterator_winding_rule
- {
- java_awt_geom_path_iterator_WIND_EVEN_ODD = 0,
- java_awt_geom_path_iterator_WIND_NON_ZERO = 1
- };
-
-enum java_awt_rendering_hints_filter
- {
- java_awt_rendering_hints_VALUE_INTERPOLATION_NEAREST_NEIGHBOR = 0,
- java_awt_rendering_hints_VALUE_INTERPOLATION_BILINEAR = 1,
- java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_SPEED = 2,
- java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_QUALITY = 3,
- java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_DEFAULT = 4
-
- };
-
-static int
-peer_is_disposed(JNIEnv *env, jobject obj)
-{
- static jfieldID fid = NULL;
- jclass cls;
- jobject peer;
-
- return 0;
-
- if (fid == NULL)
- {
- cls = (*env)->GetObjectClass(env, obj);
- fid = (*env)->GetFieldID(env, cls, "component",
- "Lgnu/java/awt/peer/gtk/GtkComponentPeer;");
- }
- g_assert(fid != NULL);
- peer = (*env)->GetObjectField(env, obj, fid);
- if (peer == NULL || NSA_GET_PTR (env, peer) != NULL)
- return 0;
- else
- {
- return 1;
- }
-}
-
-
-static void
-grab_current_drawable (GtkWidget *widget, GdkDrawable **draw, GdkWindow **win)
-{
- g_assert (widget != NULL);
- g_assert (draw != NULL);
- g_assert (win != NULL);
-
- *win = widget->window;
-
- *draw = *win;
- gdk_window_get_internal_paint_info (*win, draw, 0, 0);
- g_object_ref (*draw);
-}
-
-
-static int
-x_server_has_render_extension (void)
-{
- int ev = 0, err = 0;
- return (int) XRenderQueryExtension (GDK_DISPLAY (), &ev, &err);
-}
-
-static void
-init_graphics2d_as_pixbuf (struct graphics2d *gr)
-{
- gint width, height;
- gint bits_per_sample = 8;
- gint total_channels = 4;
- gboolean has_alpha = TRUE;
-
- g_assert (gr != NULL);
- g_assert (gr->drawable != NULL);
-
- if (gr->debug) printf ("initializing graphics2d as pixbuf\n");
- gdk_drawable_get_size (gr->drawable, &width, &height);
- gr->drawbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
- has_alpha, bits_per_sample,
- width, height);
- g_assert (gr->drawbuf != NULL);
- g_assert (gdk_pixbuf_get_bits_per_sample (gr->drawbuf) == bits_per_sample);
- g_assert (gdk_pixbuf_get_n_channels (gr->drawbuf) == total_channels);
-
- gr->surface = cairo_surface_create_for_image ((char *) gdk_pixbuf_get_pixels (gr->drawbuf),
- CAIRO_FORMAT_ARGB32,
- gdk_pixbuf_get_width (gr->drawbuf),
- gdk_pixbuf_get_height (gr->drawbuf),
- gdk_pixbuf_get_rowstride (gr->drawbuf));
- g_assert (gr->surface != NULL);
- g_assert (gr->cr != NULL);
- gr->mode = MODE_DRAWABLE_NO_RENDER;
- cairo_set_target_surface (gr->cr, gr->surface);
-}
-
-static void
-init_graphics2d_as_renderable (struct graphics2d *gr)
-{
- Drawable draw;
- Display * dpy;
- Visual * vis;
-
- g_assert (gr != NULL);
- g_assert (gr->drawable != NULL);
-
- gr->drawbuf = NULL;
-
- if (gr->debug) printf ("initializing graphics2d as renderable\n");
- draw = gdk_x11_drawable_get_xid (gr->drawable);
-
- dpy = gdk_x11_drawable_get_xdisplay (gr->drawable);
- g_assert (dpy != NULL);
-
- vis = gdk_x11_visual_get_xvisual (gdk_drawable_get_visual (gr->drawable));
- g_assert (vis != NULL);
-
- gr->surface = cairo_xlib_surface_create (dpy, draw, vis,
- CAIRO_FORMAT_ARGB32,
- DefaultColormap (dpy, DefaultScreen (dpy)));
- g_assert (gr->surface != NULL);
- g_assert (gr->cr != NULL);
- gr->mode = MODE_DRAWABLE_WITH_RENDER;
- cairo_set_target_surface (gr->cr, gr->surface);
-}
-
-static void
-begin_drawing_operation (JNIEnv *env, struct graphics2d * gr)
-{
- g_assert(cairo_status (gr->cr) == CAIRO_STATUS_SUCCESS);
-
- switch (gr->mode)
- {
- case MODE_DRAWABLE_WITH_RENDER:
- break;
-
- case MODE_DRAWABLE_NO_RENDER:
- {
-
- gint drawable_width, drawable_height;
- gint pixbuf_width, pixbuf_height;
- gint width, height;
-
- gdk_drawable_get_size (gr->drawable, &drawable_width, &drawable_height);
- pixbuf_width = gdk_pixbuf_get_width (gr->drawbuf);
- pixbuf_height = gdk_pixbuf_get_height (gr->drawbuf);
- width = min (drawable_width, pixbuf_width);
- height = min (drawable_height, pixbuf_height);
-
- gdk_pixbuf_get_from_drawable (gr->drawbuf, /* destination pixbuf */
- gr->drawable,
- NULL, /* colormap */
- 0, 0, 0, 0,
- width, height);
-
- if (gr->debug) printf ("copied (%d, %d) pixels from GDK drawable to pixbuf\n",
- width, height);
- }
- break;
-
- case MODE_JAVA_ARRAY:
- gr->javabuf = (*env)->GetIntArrayElements (env, gr->jarray, &gr->isCopy);
- gr->surface = cairo_surface_create_for_image ((char *) gr->javabuf,
- CAIRO_FORMAT_ARGB32,
- gr->width,
- gr->height,
- gr->width * 4);
- g_assert(gr->surface != NULL);
- g_assert(gr->cr != NULL);
- cairo_set_target_surface (gr->cr, gr->surface);
- break;
- }
-}
-
-static void
-end_drawing_operation (JNIEnv *env, struct graphics2d * gr)
-{
- g_assert(cairo_status (gr->cr) == CAIRO_STATUS_SUCCESS);
-
- switch (gr->mode)
- {
- case MODE_DRAWABLE_WITH_RENDER:
- break;
-
- case MODE_DRAWABLE_NO_RENDER:
- {
-
- gint drawable_width, drawable_height;
- gint pixbuf_width, pixbuf_height;
- gint width, height;
-
- gdk_drawable_get_size (gr->drawable, &drawable_width, &drawable_height);
- pixbuf_width = gdk_pixbuf_get_width (gr->drawbuf);
- pixbuf_height = gdk_pixbuf_get_height (gr->drawbuf);
- width = min (drawable_width, pixbuf_width);
- height = min (drawable_height, pixbuf_height);
-
- gdk_draw_pixbuf (gr->drawable, NULL, gr->drawbuf,
- 0, 0, 0, 0,
- width, height,
- GDK_RGB_DITHER_NORMAL, 0, 0);
-
- if (gr->debug) printf ("copied (%d, %d) pixels from pixbuf to GDK drawable\n",
- width, height);
- }
- break;
-
- case MODE_JAVA_ARRAY:
- /*
- * FIXME: Perhaps this should use the isCopy flag to try to avoid
- * tearing down the cairo surface.
- */
- cairo_surface_destroy (gr->surface);
- gr->surface = NULL;
- (*env)->ReleaseIntArrayElements (env, gr->jarray, gr->javabuf, JNI_COMMIT);
- }
-}
-
-
-static void
-update_pattern_transform (struct graphics2d *gr)
-{
- double a, b, c, d, tx, ty;
- cairo_matrix_t *mat = NULL;
-
- g_assert (gr != NULL);
- if (gr->pattern == NULL)
- return;
-
- return;
- /* temporarily disabled: ambiguous behavior */
- /* cairo_get_matrix (gr->cr, &a, &b, &c, &d, &tx, &ty); */
- mat = cairo_matrix_create ();
- g_assert (mat != NULL);
- cairo_matrix_set_affine (mat, a, b, c, d, tx, ty);
- cairo_pattern_set_matrix (gr->pattern, mat);
- cairo_matrix_destroy (mat);
-}
-
-static void
-check_for_debug (struct graphics2d *gr)
-{
- gr->debug = (gboolean)(getenv("DEBUGJ2D") != NULL);
-}
-
-static void
-realize_cb (GtkWidget *widget __attribute__ ((unused)), jobject peer)
-{
- gdk_threads_leave ();
-
- (*gdk_env())->CallVoidMethod (gdk_env(), peer, initComponentGraphics2DID);
-
- gdk_threads_enter ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_copyState
- (JNIEnv *env, jobject obj, jobject old)
-{
- struct graphics2d *g = NULL, *g_old = NULL;
-
- gdk_threads_enter();
- g = (struct graphics2d *) malloc (sizeof (struct graphics2d));
- g_assert (g != NULL);
- memset (g, 0, sizeof(struct graphics2d));
-
- g_old = (struct graphics2d *) NSA_GET_G2D_PTR (env, old);
- g_assert (g_old != NULL);
-
- if (g_old->debug) printf ("copying state from existing graphics2d\n");
-
- g->debug = g_old->debug;
- g->mode = g_old->mode;
-
- if (g_old->mode == MODE_JAVA_ARRAY)
- {
- g->width = g_old->width;
- g->height = g_old->height;
- g->jarray = (*env)->NewGlobalRef(env, g_old->jarray);
- }
- else
- {
- g->drawable = g_old->drawable;
-
- g_object_ref (g->drawable);
-
- g->cr = cairo_create();
- g_assert (g->cr != NULL);
-
- if (x_server_has_render_extension ())
- init_graphics2d_as_renderable (g);
- else
- init_graphics2d_as_pixbuf (g);
- }
-
- cairo_surface_set_filter (g->surface, CAIRO_FILTER_FAST);
-
- NSA_SET_G2D_PTR (env, obj, g);
- gdk_threads_leave();
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState___3III
-(JNIEnv *env, jobject obj, jintArray jarr, jint width, jint height)
-{
- struct graphics2d *gr;
-
- gdk_threads_enter();
- gr = (struct graphics2d *) malloc (sizeof (struct graphics2d));
- g_assert (gr != NULL);
- memset (gr, 0, sizeof(struct graphics2d));
-
- check_for_debug (gr);
-
- if (gr->debug) printf ("constructing java-backed image of size (%d,%d)\n",
- width, height);
-
- gr->cr = cairo_create();
- g_assert (gr->cr != NULL);
-
- gr->width = width;
- gr->height = height;
- gr->jarray = (*env)->NewGlobalRef(env, jarr);
- gr->mode = MODE_JAVA_ARRAY;
-
- if (gr->debug) printf ("constructed java-backed image of size (%d,%d)\n",
- width, height);
-
- NSA_SET_G2D_PTR (env, obj, gr);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState__II
- (JNIEnv *env, jobject obj, jint width, jint height)
-{
- struct graphics2d *gr;
-
- gdk_threads_enter();
- gr = (struct graphics2d *) malloc (sizeof (struct graphics2d));
- g_assert (gr != NULL);
- memset (gr, 0, sizeof(struct graphics2d));
-
- check_for_debug (gr);
-
- if (gr->debug) printf ("constructing offscreen drawable of size (%d,%d)\n",
- width, height);
-
- gr->drawable = (GdkDrawable *) gdk_pixmap_new (NULL, width, height,
- gdk_rgb_get_visual ()->depth);
- g_assert (gr->drawable != NULL);
-
- gr->cr = cairo_create();
- g_assert (gr->cr != NULL);
-
- if (x_server_has_render_extension ())
- init_graphics2d_as_renderable (gr);
- else
- init_graphics2d_as_pixbuf (gr);
-
- if (gr->debug) printf ("constructed offscreen drawable of size (%d,%d)\n",
- width, height);
- NSA_SET_G2D_PTR (env, obj, gr);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_gdkDrawDrawable
- (JNIEnv *env, jobject self, jobject other, jint x, jint y)
-{
- struct graphics2d *src = NULL, *dst = NULL;
- gint s_height, s_width, d_height, d_width, height, width;
- cairo_matrix_t *matrix;
- cairo_operator_t tmp_op;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, self)) { gdk_threads_leave(); return; }
- src = (struct graphics2d *)NSA_GET_G2D_PTR (env, other);
- dst = (struct graphics2d *)NSA_GET_G2D_PTR (env, self);
- g_assert (src != NULL);
- g_assert (dst != NULL);
-
- if (src->debug) printf ("copying from offscreen drawable\n");
-
- begin_drawing_operation(env, dst);
-
- /* gdk_flush(); */
-
- gdk_drawable_get_size (src->drawable, &s_width, &s_height);
- gdk_drawable_get_size (dst->drawable, &d_width, &d_height);
- width = min (s_width, d_width);
- height = min (s_height, d_height);
-
- matrix = cairo_matrix_create ();
- cairo_surface_get_matrix (src->surface, matrix);
- cairo_matrix_translate (matrix, (double)-x, (double)-y);
- cairo_surface_set_matrix (src->surface, matrix);
-
- tmp_op = cairo_current_operator (dst->cr);
- cairo_set_operator(dst->cr, CAIRO_OPERATOR_SRC);
- cairo_show_surface (dst->cr, src->surface, width, height);
- cairo_set_operator(dst->cr, tmp_op);
-
- cairo_matrix_translate (matrix, (double)x, (double)y);
- cairo_surface_set_matrix (src->surface, matrix);
- cairo_matrix_destroy (matrix);
-
- gdk_flush();
-
- end_drawing_operation(env, dst);
-
- if (src->debug) printf ("copied %d x %d pixels from offscreen drawable\n", width, height);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState__Lgnu_java_awt_peer_gtk_GtkComponentPeer_2
- (JNIEnv *env, jobject obj, jobject peer)
-{
- struct graphics2d *gr = NULL;
- GtkWidget *widget = NULL;
- void *ptr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
- ptr = NSA_GET_PTR (env, peer);
- g_assert (ptr != NULL);
-
- gr = (struct graphics2d *) malloc (sizeof (struct graphics2d));
- g_assert (gr != NULL);
- memset (gr, 0, sizeof(struct graphics2d));
-
- check_for_debug (gr);
-
- gr->cr = cairo_create();
- g_assert (gr->cr != NULL);
-
- widget = GTK_WIDGET (ptr);
- g_assert (widget != NULL);
-
- grab_current_drawable (widget, &(gr->drawable), &(gr->win));
- g_assert (gr->drawable != NULL);
-
- if (x_server_has_render_extension ())
- init_graphics2d_as_renderable (gr);
- else
- init_graphics2d_as_pixbuf (gr);
-
- NSA_SET_G2D_PTR (env, obj, gr);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_connectSignals
- (JNIEnv *env, jobject obj, jobject peer)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, peer);
-
- gdk_threads_enter ();
-
- g_signal_connect_after (G_OBJECT (ptr), "realize",
- G_CALLBACK (realize_cb), obj);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_dispose
- (JNIEnv *env, jobject obj)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- gr = (struct graphics2d *) NSA_DEL_G2D_PTR (env, obj);
- if (gr == NULL)
- {
- gdk_threads_leave();
- return; /* dispose has been called more than once */
- }
-
- if (gr->surface)
- cairo_surface_destroy (gr->surface);
-
- cairo_destroy (gr->cr);
-
- if (gr->drawbuf)
- g_object_unref (gr->drawbuf);
-
- g_object_unref (gr->drawable);
-
- if (gr->pattern)
- cairo_pattern_destroy (gr->pattern);
-
- if (gr->pattern_surface)
- cairo_surface_destroy (gr->pattern_surface);
-
- if (gr->pattern_pixels)
- free (gr->pattern_pixels);
-
- if (gr->mode == MODE_JAVA_ARRAY)
- (*env)->DeleteGlobalRef(env, gr->jarray);
-
- if (gr->debug) printf ("disposed of graphics2d\n");
-
- free (gr);
- gdk_threads_leave();
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_setGradient
- (JNIEnv *env, jobject obj,
- jdouble x1, jdouble y1,
- jdouble x2, jdouble y2,
- jint r1, jint g1, jint b1, jint a1,
- jint r2, jint g2, jint b2, jint a2,
- jboolean cyclic)
-{
- struct graphics2d *gr = NULL;
- cairo_surface_t *surf = NULL;
- cairo_matrix_t *mat = NULL;
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
- if (gr->debug) printf ("setGradient (%f,%f) -> (%f,%f); (%d,%d,%d,%d) -> (%d,%d,%d,%d)\n",
- x1, y1,
- x2, y2,
- r1, g1, b1, a1,
- r2, g2, b2, a2);
-
- cairo_save (gr->cr);
-
- if (cyclic)
- surf = cairo_surface_create_similar (gr->surface, CAIRO_FORMAT_ARGB32, 3, 2);
- else
- surf = cairo_surface_create_similar (gr->surface, CAIRO_FORMAT_ARGB32, 2, 2);
- g_assert (surf != NULL);
-
- cairo_set_target_surface (gr->cr, surf);
-
- cairo_identity_matrix (gr->cr);
-
- cairo_set_rgb_color (gr->cr, r1 / 255.0, g1 / 255.0, b1 / 255.0);
- cairo_set_alpha (gr->cr, a1 / 255.0);
- cairo_rectangle (gr->cr, 0, 0, 1, 2);
- cairo_fill (gr->cr);
-
- cairo_set_rgb_color (gr->cr, r2 / 255.0, g2 / 255.0, b2 / 255.0);
- cairo_set_alpha (gr->cr, a2 / 255.0);
- cairo_rectangle (gr->cr, 1, 0, 1, 2);
- cairo_fill (gr->cr);
-
- if (cyclic)
- {
- cairo_set_rgb_color (gr->cr, r1 / 255.0, g1 / 255.0, b1 / 255.0);
- cairo_set_alpha (gr->cr, a1 / 255.0);
- cairo_rectangle (gr->cr, 2, 0, 1, 2);
- cairo_fill (gr->cr);
- }
-
- mat = cairo_matrix_create ();
- g_assert (mat != NULL);
-
- /*
- consider the vector [x2 - x1, y2 - y1] = [p,q]
-
- this is a line in space starting at an 'origin' x1, y1.
-
- it can also be thought of as a "transformed" unit vector in either the
- x or y directions. we have just *drawn* our gradient as a unit vector
- (well, a 2-3x unit vector) in the x dimension. so what we want to know
- is which transformation turns our existing unit vector into [p,q].
-
- which means solving for M in
-
- [p,q] = M[1,0]
-
- [p,q] = |a b| [1,0]
- |c d|
-
- [p,q] = [a,c], with b = d = 0.
-
- what does this mean? it means that our gradient is 1-dimensional; as
- you move through the x axis of our 2 or 3 pixel gradient from logical
- x positions 0 to 1, the transformation of your x coordinate under the
- matrix M causes you to accumulate both x and y values in fill
- space. the y value of a gradient coordinate is ignored, since the
- gradient is one dimensional. which is correct.
-
- unfortunately we want the opposite transformation, it seems, because of
- the way cairo is going to use this transformation. I'm a bit confused by
- that, but it seems to work right, so we take reciprocals of values and
- negate offsets. oh well.
-
- */
- {
- double a = (x2 - x1 == 0.) ? 0. : ((cyclic ? 3.0 : 2.0) / (x2 - x1));
- double c = (y2 - y1 == 0.) ? 0. : (1. / (y2 - y1));
- double dx = (x1 == 0.) ? 0. : 1. / x1;
- double dy = (y1 == 0.) ? 0. : 1. / y1;
-
- cairo_matrix_set_affine (mat,
- a, 0.,
- c, 0.,
- dx, dy);
-
- cairo_surface_set_matrix (surf, mat);
- cairo_matrix_destroy (mat);
- cairo_surface_set_filter (surf, CAIRO_FILTER_BILINEAR);
- }
-
- /* FIXME: repeating gradients (not to mention hold gradients) don't seem to work. */
- /* cairo_surface_set_repeat (surf, cyclic ? 1 : 0); */
-
- if (gr->pattern)
- cairo_pattern_destroy (gr->pattern);
-
- if (gr->pattern_surface)
- cairo_surface_destroy (gr->pattern_surface);
-
- if (gr->pattern_pixels)
- free (gr->pattern_pixels);
-
- gr->pattern_pixels = NULL;
- gr->pattern_surface = surf;
- gr->pattern = cairo_pattern_create_for_surface(surf);
-
- cairo_restore (gr->cr);
- cairo_set_pattern (gr->cr, gr->pattern);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_setTexturePixels
- (JNIEnv *env, jobject obj, jintArray jarr, jint w, jint h, jint stride)
-{
- struct graphics2d *gr = NULL;
- jint *jpixels = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
-
- if (gr->debug) printf ("setTexturePixels (%d pixels, %dx%d, stride: %d)\n",
- (*env)->GetArrayLength (env, jarr), w, h, stride);
-
- if (gr->pattern)
- cairo_pattern_destroy (gr->pattern);
-
- if (gr->pattern_surface)
- cairo_surface_destroy (gr->pattern_surface);
-
- if (gr->pattern_pixels)
- free (gr->pattern_pixels);
-
- gr->pattern = NULL;
- gr->pattern_surface = NULL;
- gr->pattern_pixels = NULL;
-
- gr->pattern_pixels = (char *) malloc (h * stride * 4);
- g_assert (gr->pattern_pixels != NULL);
-
- jpixels = (*env)->GetIntArrayElements (env, jarr, NULL);
- g_assert (jpixels != NULL);
- memcpy (gr->pattern_pixels, jpixels, h * stride * 4);
- (*env)->ReleaseIntArrayElements (env, jarr, jpixels, 0);
-
- gr->pattern_surface = cairo_surface_create_for_image (gr->pattern_pixels,
- CAIRO_FORMAT_ARGB32,
- w, h, stride * 4);
- g_assert (gr->pattern_surface != NULL);
- cairo_surface_set_repeat (gr->pattern_surface, 1);
- gr->pattern = cairo_pattern_create_for_surface (gr->pattern_surface);
- g_assert (gr->pattern != NULL);
- cairo_set_pattern (gr->cr, gr->pattern);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_drawPixels
- (JNIEnv *env, jobject obj, jintArray java_pixels,
- jint w, jint h, jint stride, jdoubleArray java_matrix)
-{
- struct graphics2d *gr = NULL;
- jint *native_pixels = NULL;
- jdouble *native_matrix = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
-
- if (gr->debug) printf ("drawPixels (%d pixels, %dx%d, stride: %d)\n",
- (*env)->GetArrayLength (env, java_pixels), w, h, stride);
-
- native_pixels = (*env)->GetIntArrayElements (env, java_pixels, NULL);
- native_matrix = (*env)->GetDoubleArrayElements (env, java_matrix, NULL);
- g_assert (native_pixels != NULL);
- g_assert (native_matrix != NULL);
- g_assert ((*env)->GetArrayLength (env, java_matrix) == 6);
-
- begin_drawing_operation (env, gr);
-
- {
- cairo_matrix_t *mat = NULL;
- cairo_surface_t *surf = cairo_surface_create_for_image ((char *)native_pixels,
- CAIRO_FORMAT_ARGB32,
- w, h, stride * 4);
- mat = cairo_matrix_create ();
- cairo_matrix_set_affine (mat,
- native_matrix[0], native_matrix[1],
- native_matrix[2], native_matrix[3],
- native_matrix[4], native_matrix[5]);
- cairo_surface_set_matrix (surf, mat);
- cairo_surface_set_filter (surf, cairo_surface_get_filter(gr->surface));
- cairo_show_surface (gr->cr, surf, w, h);
- cairo_matrix_destroy (mat);
- cairo_surface_destroy (surf);
- }
-
- end_drawing_operation (env, gr);
-
- (*env)->ReleaseIntArrayElements (env, java_pixels, native_pixels, 0);
- (*env)->ReleaseDoubleArrayElements (env, java_matrix, native_matrix, 0);
-
- gdk_threads_leave();
-}
-
-/* passthrough methods to cairo */
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSave
- (JNIEnv *env, jobject obj)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_save\n");
- cairo_save (gr->cr);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRestore
- (JNIEnv *env, jobject obj)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_restore\n");
- cairo_restore (gr->cr);
- update_pattern_transform (gr);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetMatrix
- (JNIEnv *env, jobject obj, jdoubleArray java_matrix)
-{
- struct graphics2d *gr = NULL;
- jdouble *native_matrix = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- /* cairoSetMatrix was called before this graphics object's component
- was realized. */
- if (gr == NULL) { gdk_threads_leave (); return; }
-
- native_matrix = (*env)->GetDoubleArrayElements (env, java_matrix, NULL);
- g_assert (native_matrix != NULL);
- g_assert ((*env)->GetArrayLength (env, java_matrix) == 6);
-
- if (gr->debug) printf ("cairo_set_matrix [ %f, %f, %f, %f, %f, %f ]\n",
- native_matrix[0], native_matrix[1],
- native_matrix[2], native_matrix[3],
- native_matrix[4], native_matrix[5]);
-
- {
- cairo_matrix_t * mat = cairo_matrix_create ();
- cairo_matrix_set_affine (mat,
- native_matrix[0], native_matrix[1],
- native_matrix[2], native_matrix[3],
- native_matrix[4], native_matrix[5]);
- cairo_set_matrix (gr->cr, mat);
- cairo_matrix_destroy (mat);
- }
-
- (*env)->ReleaseDoubleArrayElements (env, java_matrix, native_matrix, 0);
- update_pattern_transform (gr);
- gdk_threads_leave();
-}
-
-static void
-install_font_peer(cairo_t *cr,
- struct peerfont *pfont,
- int debug)
-{
- cairo_font_t *ft;
- FT_Face face = NULL;
-
- g_assert(cr != NULL);
- g_assert(pfont != NULL);
-
- if (pfont->graphics_resource == NULL)
- {
- face = pango_ft2_font_get_face (pfont->font);
- g_assert (face != NULL);
-
- ft = cairo_ft_font_create_for_ft_face (face);
- g_assert (ft != NULL);
-
- if (debug) printf ("install_font_peer made new cairo font for '%s' at %f\n",
- face->family_name,
- (pango_font_description_get_size (pfont->desc) /
- (double)PANGO_SCALE));
-
- cairo_set_font (cr, ft);
- cairo_font_destroy (ft);
- cairo_scale_font (cr,
- (pango_font_description_get_size (pfont->desc) /
- (double)PANGO_SCALE));
- ft = cairo_current_font (cr);
- pfont->graphics_resource = ft;
- }
- else
- {
- if (debug) printf ("install_font_peer reused existing font resource\n");
- ft = (cairo_font_t *) pfont->graphics_resource;
- cairo_set_font (cr, ft);
- }
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_releasePeerGraphicsResource
- (JNIEnv *env, jclass clazz __attribute__ ((unused)), jobject java_font)
-{
- struct peerfont *pfont = NULL;
-
- g_assert(java_font != NULL);
-
- gdk_threads_enter();
- pfont = (struct peerfont *) NSA_GET_FONT_PTR (env, java_font);
- g_assert (pfont != NULL);
- if (pfont->graphics_resource != NULL)
- {
- cairo_font_destroy ((cairo_font_t *) pfont->graphics_resource);
- pfont->graphics_resource = NULL;
- }
- gdk_threads_leave();
-}
-
-static void
-paint_glyph_run(JNIEnv *env,
- struct graphics2d *gr,
- cairo_glyph_t **glyphs,
- gint *n_glyphs,
- PangoLayoutRun *run)
-{
- gint i = 0;
- gint x = 0, y = 0;
-
- g_assert (gr != NULL);
- g_assert (glyphs != NULL);
- g_assert (n_glyphs != NULL);
- g_assert (run != NULL);
-
- if (run->glyphs != NULL && run->glyphs->num_glyphs > 0)
- {
- if (*n_glyphs < run->glyphs->num_glyphs)
- {
- *glyphs = g_realloc(*glyphs,
- (sizeof(cairo_glyph_t)
- * run->glyphs->num_glyphs));
- *n_glyphs = run->glyphs->num_glyphs;
- }
-
- g_assert (*glyphs != NULL);
-
- if (gr->debug) printf ("painting %d glyphs: ", run->glyphs->num_glyphs);
-
- for (i = 0; i < run->glyphs->num_glyphs; ++i)
- {
- (*glyphs)[i].index = run->glyphs->glyphs[i].glyph;
-
- (*glyphs)[i].x =
- ((double) (x + run->glyphs->glyphs[i].geometry.x_offset))
- / ((double) PANGO_SCALE);
-
- (*glyphs)[i].y =
- ((double) (y + run->glyphs->glyphs[i].geometry.y_offset))
- / ((double) PANGO_SCALE);
-
- if (gr->debug) printf(" (%ld @ %f,%f)",
- (*glyphs)[i].index,
- (*glyphs)[i].x,
- (*glyphs)[i].y);
-
- x += run->glyphs->glyphs[i].geometry.width;
- }
-
- if (gr->debug) printf("\n");
- begin_drawing_operation (env, gr);
- cairo_show_glyphs (gr->cr, *glyphs, run->glyphs->num_glyphs);
- end_drawing_operation (env, gr);
- }
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawGlyphVector
- (JNIEnv *env, jobject self,
- jobject font,
- jfloat x, jfloat y, jint n,
- jintArray java_codes,
- jfloatArray java_positions)
-{
-
- struct graphics2d *gr = NULL;
- struct peerfont *pfont = NULL;
- cairo_glyph_t *glyphs = NULL;
- int *native_codes;
- float *native_positions;
- jint i = 0;
-
- g_assert (self != NULL);
- g_assert (java_codes != NULL);
- g_assert (java_positions != NULL);
-
- gdk_threads_enter ();
- if (peer_is_disposed(env, self)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *)NSA_GET_G2D_PTR (env, self);
- g_assert (gr != NULL);
-
- pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, font);
- g_assert (pfont != NULL);
-
- install_font_peer(gr->cr, pfont, gr->debug);
-
- glyphs = malloc( sizeof(cairo_glyph_t) * n);
- g_assert (glyphs != NULL);
-
- native_codes = (*env)->GetIntArrayElements (env, java_codes, NULL);
- native_positions = (*env)->GetFloatArrayElements (env, java_positions, NULL);
-
- for (i = 0; i < n; ++i)
- {
- glyphs[i].index = native_codes[i];
- glyphs[i].x = x + native_positions[ 2*i ];
- glyphs[i].y = y + native_positions[ 2*i + 1];
- }
-
- (*env)->ReleaseFloatArrayElements (env, java_positions, native_positions, 0);
- (*env)->ReleaseIntArrayElements (env, java_codes, native_codes, 0);
-
- begin_drawing_operation (env, gr);
- cairo_show_glyphs (gr->cr, glyphs, n);
- end_drawing_operation (env, gr);
-
- gdk_threads_leave ();
- free(glyphs);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawGdkTextLayout
- (JNIEnv *env, jobject self, jobject java_layout, jfloat x, jfloat y)
-{
- /*
- * FIXME: Some day we expect either cairo or pango will know how to make
- * a pango layout paint to a cairo surface. that day is not yet here.
- */
-
- struct graphics2d *gr = NULL;
- struct textlayout *tl = NULL;
- PangoLayoutIter *i = NULL;
- PangoLayoutRun *run = NULL;
- cairo_glyph_t *glyphs = NULL;
- gint n_glyphs = 0;
-
- g_assert (self != NULL);
- g_assert (java_layout != NULL);
-
- gr = (struct graphics2d *)NSA_GET_G2D_PTR (env, self);
- tl = (struct textlayout *)NSA_GET_TEXT_LAYOUT_PTR (env, java_layout);
-
- g_assert (gr != NULL);
- g_assert (tl != NULL);
- g_assert (tl->pango_layout != NULL);
-
- if (gr->debug) printf ("painting pango layout\n");
-
- gdk_threads_enter ();
- if (peer_is_disposed(env, self)) { gdk_threads_leave(); return; }
-
- i = pango_layout_get_iter (tl->pango_layout);
- g_assert (i != NULL);
-
- cairo_translate (gr->cr, x, y);
-
- do
- {
- run = pango_layout_iter_get_run (i);
- if (run != NULL)
- paint_glyph_run (env, gr, &glyphs, &n_glyphs, run);
- }
- while (pango_layout_iter_next_run (i));
-
- if (glyphs != NULL)
- g_free (glyphs);
-
- cairo_translate (gr->cr, -x, -y);
-
- pango_layout_iter_free (i);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetOperator
- (JNIEnv *env, jobject obj, jint op)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_set_operator %d\n", op);
- switch ((enum java_awt_alpha_composite_rule) op)
- {
- case java_awt_alpha_composite_CLEAR:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_CLEAR);
- break;
-
- case java_awt_alpha_composite_SRC:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_SRC);
- break;
-
- case java_awt_alpha_composite_SRC_OVER:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_OVER);
- break;
-
- case java_awt_alpha_composite_DST_OVER:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_OVER_REVERSE);
- break;
-
- case java_awt_alpha_composite_SRC_IN:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_IN);
- break;
-
- case java_awt_alpha_composite_DST_IN:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_IN_REVERSE);
- break;
-
- case java_awt_alpha_composite_SRC_OUT:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_OUT);
- break;
-
- case java_awt_alpha_composite_DST_OUT:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_OUT_REVERSE);
- break;
-
- case java_awt_alpha_composite_DST:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_DST);
- break;
-
- case java_awt_alpha_composite_SRC_ATOP:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_ATOP);
- break;
-
- case java_awt_alpha_composite_DST_ATOP:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_ATOP_REVERSE);
- break;
-
- case java_awt_alpha_composite_XOR:
- cairo_set_operator (gr->cr, CAIRO_OPERATOR_XOR);
- break;
- }
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetRGBColor
- (JNIEnv *env, jobject obj, jdouble r, jdouble g, jdouble b)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
-
- /* this is a very weird fact: GDK Pixbufs and RENDER drawables consider
- colors in opposite pixel order. I have no idea why. thus when you
- draw to a PixBuf, you must exchange the R and B components of your
- color. */
-
- if (gr->debug) printf ("cairo_set_rgb_color (%f, %f, %f)\n", r, g, b);
-
- if (gr->drawbuf)
- cairo_set_rgb_color (gr->cr, b, g, r);
- else
- cairo_set_rgb_color (gr->cr, r, g, b);
-
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetAlpha
- (JNIEnv *env, jobject obj, jdouble a)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_set_alpha %f\n", a);
- cairo_set_alpha (gr->cr, a);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetFillRule
- (JNIEnv *env, jobject obj, jint rule)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- if (gr->debug) printf ("cairo_set_fill_rule %d\n", rule);
- g_assert (gr != NULL);
- switch ((enum java_awt_geom_path_iterator_winding_rule) rule)
- {
- case java_awt_geom_path_iterator_WIND_NON_ZERO:
- cairo_set_fill_rule (gr->cr, CAIRO_FILL_RULE_WINDING);
- break;
- case java_awt_geom_path_iterator_WIND_EVEN_ODD:
- cairo_set_fill_rule (gr->cr, CAIRO_FILL_RULE_EVEN_ODD);
- break;
- }
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetLineWidth
- (JNIEnv *env, jobject obj, jdouble width)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_set_line_width %f\n", width);
- cairo_set_line_width (gr->cr, width);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetLineCap
- (JNIEnv *env, jobject obj, jint cap)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_set_line_cap %d\n", cap);
- switch ((enum java_awt_basic_stroke_cap_rule) cap)
- {
- case java_awt_basic_stroke_CAP_BUTT:
- cairo_set_line_cap (gr->cr, CAIRO_LINE_CAP_BUTT);
- break;
-
- case java_awt_basic_stroke_CAP_ROUND:
- cairo_set_line_cap (gr->cr, CAIRO_LINE_CAP_ROUND);
- break;
-
- case java_awt_basic_stroke_CAP_SQUARE:
- cairo_set_line_cap (gr->cr, CAIRO_LINE_CAP_SQUARE);
- break;
- }
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetLineJoin
- (JNIEnv *env, jobject obj, jint join)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_set_line_join %d\n", join);
- switch ((enum java_awt_basic_stroke_join_rule) join)
- {
- case java_awt_basic_stroke_JOIN_MITER:
- cairo_set_line_join (gr->cr, CAIRO_LINE_JOIN_MITER);
- break;
-
- case java_awt_basic_stroke_JOIN_ROUND:
- cairo_set_line_join (gr->cr, CAIRO_LINE_JOIN_ROUND);
- break;
-
- case java_awt_basic_stroke_JOIN_BEVEL:
- cairo_set_line_join (gr->cr, CAIRO_LINE_JOIN_BEVEL);
- break;
- }
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetDash
- (JNIEnv *env, jobject obj, jdoubleArray dashes, jint ndash, jdouble offset)
-{
- struct graphics2d *gr = NULL;
- jdouble *dasharr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_set_dash\n");
- dasharr = (*env)->GetDoubleArrayElements (env, dashes, NULL);
- g_assert (dasharr != NULL);
- cairo_set_dash (gr->cr, dasharr, ndash, offset);
- (*env)->ReleaseDoubleArrayElements (env, dashes, dasharr, 0);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetMiterLimit
- (JNIEnv *env, jobject obj, jdouble miter)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_set_miter_limit %f\n", miter);
- cairo_set_miter_limit (gr->cr, miter);
- gdk_threads_leave();
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoNewPath
- (JNIEnv *env, jobject obj)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- if (gr == NULL) { gdk_threads_leave (); return; }
- if (gr->debug) printf ("cairo_new_path\n");
- cairo_new_path (gr->cr);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoMoveTo
- (JNIEnv *env, jobject obj, jdouble x, jdouble y)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_move_to (%f, %f)\n", x, y);
- cairo_move_to (gr->cr, x, y);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoLineTo
- (JNIEnv *env, jobject obj, jdouble x, jdouble y)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_line_to (%f, %f)\n", x, y);
- cairo_line_to (gr->cr, x, y);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoCurveTo
- (JNIEnv *env, jobject obj, jdouble x1, jdouble y1, jdouble x2, jdouble y2, jdouble x3, jdouble y3)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_curve_to (%f, %f), (%f, %f), (%f, %f)\n", x1, y1, x2, y2, x3, y3);
- cairo_curve_to (gr->cr, x1, y1, x2, y2, x3, y3);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRelMoveTo
- (JNIEnv *env, jobject obj, jdouble dx, jdouble dy)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_rel_move_to (%f, %f)\n", dx, dy);
- cairo_rel_move_to (gr->cr, dx, dy);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRelLineTo
- (JNIEnv *env, jobject obj, jdouble dx, jdouble dy)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_rel_line_to (%f, %f)\n", dx, dy);
- cairo_rel_line_to (gr->cr, dx, dy);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRelCurveTo
- (JNIEnv *env, jobject obj, jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2, jdouble dx3, jdouble dy3)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_rel_curve_to (%f, %f), (%f, %f), (%f, %f)\n", dx1, dy1, dx2, dy2, dx3, dy3);
- cairo_rel_curve_to (gr->cr, dx1, dy1, dx2, dy2, dx3, dy3);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRectangle
- (JNIEnv *env, jobject obj, jdouble x, jdouble y, jdouble width, jdouble height)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- if (gr == NULL) { gdk_threads_leave (); return; }
- if (gr->debug) printf ("cairo_rectangle (%f, %f) (%f, %f)\n", x, y, width, height);
- cairo_rectangle (gr->cr, x, y, width, height);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoClosePath
- (JNIEnv *env, jobject obj)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_close_path\n");
- cairo_close_path (gr->cr);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoStroke
- (JNIEnv *env, jobject obj)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_stroke\n");
- begin_drawing_operation (env, gr);
- cairo_stroke (gr->cr);
- end_drawing_operation (env, gr);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoFill
- (JNIEnv *env, jobject obj)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_fill\n");
- begin_drawing_operation (env, gr);
- cairo_fill (gr->cr);
- end_drawing_operation (env, gr);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoClip
- (JNIEnv *env, jobject obj)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- if (gr == NULL) { gdk_threads_leave (); return; }
- if (gr->debug) printf ("cairo_clip\n");
- begin_drawing_operation (env, gr);
- cairo_init_clip (gr->cr);
- cairo_clip (gr->cr);
- end_drawing_operation (env, gr);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSurfaceSetFilter
- (JNIEnv *env, jobject obj, jint filter)
-{
- struct graphics2d *gr = NULL;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_surface_set_filter %d\n", filter);
- switch ((enum java_awt_rendering_hints_filter) filter)
- {
- case java_awt_rendering_hints_VALUE_INTERPOLATION_NEAREST_NEIGHBOR:
- cairo_surface_set_filter (gr->surface, CAIRO_FILTER_NEAREST);
- break;
- case java_awt_rendering_hints_VALUE_INTERPOLATION_BILINEAR:
- cairo_surface_set_filter (gr->surface, CAIRO_FILTER_BILINEAR);
- break;
- case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_SPEED:
- cairo_surface_set_filter (gr->surface, CAIRO_FILTER_FAST);
- break;
- case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_DEFAULT:
- cairo_surface_set_filter (gr->surface, CAIRO_FILTER_NEAREST);
- break;
- case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_QUALITY:
- cairo_surface_set_filter (gr->surface, CAIRO_FILTER_BEST);
- break;
- }
- gdk_threads_leave();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c
deleted file mode 100644
index ca9d5642eec..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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 "gdkfont.h"
-#include "gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h"
-
-
-static gint
-cmp_families (const void *a, const void *b)
-{
- const char *a_name = pango_font_family_get_name (*(PangoFontFamily **)a);
- const char *b_name = pango_font_family_get_name (*(PangoFontFamily **)b);
-
- return g_utf8_collate (a_name, b_name);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeGetFontFamilies
-(JNIEnv *env, jobject self __attribute__((unused)), jobjectArray family_name)
-{
- PangoContext *context;
- PangoFontFamily **families;
- int n_families, idx;
-
- gdk_threads_enter ();
-
- context = gdk_pango_context_get();
- g_assert (context != NULL);
-
- pango_context_list_families (context, &families, &n_families);
-
- qsort (families, n_families, sizeof (PangoFontFamily *), cmp_families);
-
- for (idx = 0; idx < n_families; idx++)
- {
- const char *name_tmp = pango_font_family_get_name (families[idx]);
- jstring name = (*env)->NewStringUTF (env, name_tmp);
- (*env)->SetObjectArrayElement (env, family_name, idx, name);
- }
- g_free (families);
- gdk_threads_leave ();
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeGetNumFontFamilies
-(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
-{
- PangoContext *context;
- PangoFontFamily **families;
- gint n_families;
- jint num;
-
- gdk_threads_enter ();
-
- context = gdk_pango_context_get();
- g_assert (context != NULL);
-
- pango_context_list_families (context, &families, &n_families);
-
- num = n_families;
- g_free (families);
- gdk_threads_leave ();
-
- return num;
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
deleted file mode 100644
index 6af4815622f..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+++ /dev/null
@@ -1,445 +0,0 @@
-/* gdkpixbufdecoder.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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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 <gdk/gdk.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gdk-pixbuf/gdk-pixbuf-loader.h>
-
-#include <jni.h>
-#include "native_state.h"
-#include "gnu_java_awt_peer_gtk_GdkPixbufDecoder.h"
-
-#include <string.h>
-#include <stdlib.h>
-
-struct state_table *native_pixbufdecoder_state_table;
-
-/* Union used for type punning. */
-union env_union
-{
- void **void_env;
- JNIEnv **jni_env;
-};
-
-static JavaVM *vm;
-
-static jmethodID areaPreparedID;
-static jmethodID areaUpdatedID;
-static jmethodID dataOutputWriteID;
-static jmethodID registerFormatID;
-
-static void
-area_prepared (GdkPixbufLoader *loader,
- jobject *decoder)
-{
- JNIEnv *env;
- union env_union e;
- jint width, height;
-
- GdkPixbuf *pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
- if (pixbuf == NULL)
- return;
-
- width = gdk_pixbuf_get_width (pixbuf);
- height = gdk_pixbuf_get_height (pixbuf);
-
- gdk_threads_leave ();
-
- g_assert (decoder != NULL);
-
- e.jni_env = &env;
- (*vm)->GetEnv (vm, e.void_env, JNI_VERSION_1_1);
- (*env)->CallVoidMethod (env,
- *decoder,
- areaPreparedID,
- width, height);
-
- gdk_threads_enter ();
-}
-
-static void
-area_updated (GdkPixbufLoader *loader,
- gint x, gint y,
- gint width, gint height,
- jobject *decoder)
-{
- JNIEnv *env;
- union env_union e;
- jint stride_bytes, stride_pixels, n_channels, n_pixels;
- jintArray jpixels;
- jint *java_pixels;
- guchar *gdk_pixels;
-
- GdkPixbuf *pixbuf_no_alpha = NULL;
- GdkPixbuf *pixbuf = NULL;
-
-#ifndef WORDS_BIGENDIAN
- int i;
-#endif
-
- pixbuf_no_alpha = gdk_pixbuf_loader_get_pixbuf (loader);
- if (pixbuf_no_alpha == NULL)
- return;
-
- pixbuf = gdk_pixbuf_add_alpha(pixbuf_no_alpha, FALSE, 0, 0, 0);
- g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
-
- stride_bytes = gdk_pixbuf_get_rowstride (pixbuf);
- n_channels = gdk_pixbuf_get_n_channels (pixbuf);
- stride_pixels = stride_bytes / n_channels;
- n_pixels = height * stride_pixels;
- gdk_pixels = gdk_pixbuf_get_pixels (pixbuf);
-
- e.jni_env = &env;
- (*vm)->GetEnv (vm, e.void_env, JNI_VERSION_1_1);
- jpixels = (*env)->NewIntArray (env, n_pixels);
- java_pixels = (*env)->GetIntArrayElements (env, jpixels, NULL);
-
- memcpy (java_pixels,
- gdk_pixels + (y * stride_bytes),
- (height * stride_bytes));
-
-#ifndef WORDS_BIGENDIAN
- /* convert pixels from 0xBBGGRRAA to 0xAARRGGBB */
- for (i = 0; i < n_pixels; ++i)
- {
- java_pixels[i] = SWAPU32 ((unsigned)java_pixels[i]);
- }
-#endif
-
- g_object_unref (pixbuf);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseIntArrayElements (env, jpixels, java_pixels, 0);
- (*env)->CallVoidMethod (env,
- *decoder,
- areaUpdatedID,
- (jint) x, (jint) y,
- (jint) width, (jint) height,
- jpixels,
- stride_pixels);
- gdk_threads_enter ();
-}
-
-static void
-closed (GdkPixbufLoader *loader __attribute__((unused)), jobject *decoder)
-{
- JNIEnv *env;
- union env_union e;
- e.jni_env = &env;
- (*vm)->GetEnv (vm, e.void_env, JNI_VERSION_1_1);
-
- gdk_threads_leave ();
- (*env)->DeleteGlobalRef (env, *decoder);
- free (decoder);
- gdk_threads_enter ();
-}
-
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_initState
- (JNIEnv *env, jobject obj)
-{
- GdkPixbufLoader *loader = NULL;
- jobject *decoder = NULL;
-
- decoder = (jobject *) malloc (sizeof (jobject));
- g_assert (decoder != NULL);
- *decoder = (*env)->NewGlobalRef (env, obj);
-
- gdk_threads_enter ();
- loader = gdk_pixbuf_loader_new ();
- g_assert (loader != NULL);
- g_signal_connect (loader, "area-prepared", G_CALLBACK (area_prepared), decoder);
- g_signal_connect (loader, "area-updated", G_CALLBACK (area_updated), decoder);
- g_signal_connect (loader, "closed", G_CALLBACK (closed), decoder);
- gdk_threads_leave ();
-
- NSA_SET_PB_PTR (env, obj, loader);
-}
-
-static void
-query_formats (JNIEnv *env, jclass clazz)
-{
- jobject jformat;
- GSList *formats, *f;
- GdkPixbufFormat *format;
- char **ch, *name;
-
- jclass formatClass;
- jmethodID addExtensionID;
- jmethodID addMimeTypeID;
- jobject string;
-
- formatClass = (*env)->FindClass
- (env, "gnu/java/awt/peer/gtk/GdkPixbufDecoder$ImageFormatSpec");
-
- g_assert(formatClass != NULL);
-
- addExtensionID = (*env)->GetMethodID (env, formatClass,
- "addExtension",
- "(Ljava/lang/String;)V");
-
- addMimeTypeID = (*env)->GetMethodID (env, formatClass,
- "addMimeType",
- "(Ljava/lang/String;)V");
-
- formats = gdk_pixbuf_get_formats ();
-
- for (f = formats; f; f = f->next)
- {
- format = (GdkPixbufFormat *) f->data;
- name = gdk_pixbuf_format_get_name(format);
-
- string = (*env)->NewStringUTF(env, name);
- g_assert(string != NULL);
-
- jformat = (*env)->CallStaticObjectMethod
- (env, clazz, registerFormatID, string,
- (jboolean) gdk_pixbuf_format_is_writable(format));
- (*env)->DeleteLocalRef(env, string);
-
- g_assert(jformat != NULL);
-
- ch = gdk_pixbuf_format_get_extensions(format);
- while (*ch)
- {
- string = (*env)->NewStringUTF(env, *ch);
- g_assert(string != NULL);
- (*env)->CallVoidMethod (env, jformat, addExtensionID, string);
- (*env)->DeleteLocalRef(env, string);
- ++ch;
- }
-
- ch = gdk_pixbuf_format_get_mime_types(format);
- while (*ch)
- {
- string = (*env)->NewStringUTF(env, *ch);
- g_assert(string != NULL);
- (*env)->CallVoidMethod (env, jformat, addMimeTypeID, string);
- (*env)->DeleteLocalRef(env, string);
- ++ch;
- }
- }
-
- g_slist_free(formats);
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_initStaticState
- (JNIEnv *env, jclass clazz)
-{
- jclass dataOutputClass;
-
- (*env)->GetJavaVM(env, &vm);
-
- areaPreparedID = (*env)->GetMethodID (env, clazz,
- "areaPrepared",
- "(II)V");
-
- areaUpdatedID = (*env)->GetMethodID (env, clazz,
- "areaUpdated",
- "(IIII[II)V");
-
- registerFormatID = (*env)->GetStaticMethodID
- (env, clazz,
- "registerFormat",
- "(Ljava/lang/String;Z)"
- "Lgnu/java/awt/peer/gtk/GdkPixbufDecoder$ImageFormatSpec;");
-
-
- dataOutputClass = (*env)->FindClass(env, "java/io/DataOutput");
- dataOutputWriteID = (*env)->GetMethodID (env, dataOutputClass,
- "write", "([B)V");
-
- query_formats (env, clazz);
-
- NSA_PB_INIT (env, clazz);
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_finish
- (JNIEnv *env, jobject obj)
-{
- GdkPixbufLoader *loader = NULL;
-
- loader = (GdkPixbufLoader *)NSA_DEL_PB_PTR (env, obj);
- if (loader == NULL)
- return;
-
- gdk_threads_enter ();
- gdk_pixbuf_loader_close (loader, NULL);
- g_object_unref (loader);
- gdk_threads_leave ();
-}
-
-struct stream_save_request
-{
- JNIEnv *env;
- jobject *stream;
-};
-
-static gboolean
-save_to_stream(const gchar *buf,
- gsize count,
- GError **error __attribute__((unused)),
- gpointer data)
-{
- struct stream_save_request *ssr = (struct stream_save_request *)data;
-
- jbyteArray jbuf;
- jbyte *cbuf;
-
- gdk_threads_leave ();
- jbuf = (*(ssr->env))->NewByteArray ((ssr->env), count);
- cbuf = (*(ssr->env))->GetByteArrayElements ((ssr->env), jbuf, NULL);
- memcpy (cbuf, buf, count);
- (*(ssr->env))->ReleaseByteArrayElements ((ssr->env), jbuf, cbuf, 0);
- (*(ssr->env))->CallVoidMethod ((ssr->env), *(ssr->stream),
- dataOutputWriteID, jbuf);
- gdk_threads_enter ();
- return TRUE;
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_streamImage
-(JNIEnv *env, jclass clazz __attribute__((unused)),
- jintArray jarr, jstring jenctype, jint width, jint height,
- jboolean hasAlpha, jobject stream)
-{
- GdkPixbuf* pixbuf;
- jint *ints;
- guchar a, r, g, b, *pix, *p;
- GError *err = NULL;
- const char *enctype;
- int i;
-
- struct stream_save_request ssr;
- ssr.stream = &stream;
- ssr.env = env;
-
- ints = (*env)->GetIntArrayElements (env, jarr, NULL);
- pix = g_malloc(width * height * (hasAlpha ? 4 : 3));
-
- enctype = (*env)->GetStringUTFChars (env, jenctype, NULL);
- g_assert(enctype != NULL);
-
- g_assert (pix != NULL);
- g_assert (ints != NULL);
-
- p = pix;
- for (i = 0; i < width*height; ++i)
- {
- /*
- * Java encodes pixels as integers in a predictable arithmetic order:
- * 0xAARRGGBB. Since these are jints, JNI has already byte-swapped
- * them for us if necessary, so they're in "our" endianness, whatever
- * that is. It uses 4 bytes per pixel whether or not there's an alpha
- * channel.
- */
-
- a = 0xff & (ints[i] >> 24);
- r = 0xff & (ints[i] >> 16);
- g = 0xff & (ints[i] >> 8);
- b = 0xff & ints[i];
-
- /*
- * GDK-pixbuf has a very different storage model:
- *
- * - A different alpha order (alpha after colors).
- * - A different packing model (no alpha -> 3-bytes-per-pixel).
- * - A different "RGB" order (host memory order, not endian-neutral).
- */
-
- *p++ = r;
- *p++ = g;
- *p++ = b;
- if (hasAlpha)
- *p++ = a;
- }
-
- gdk_threads_enter ();
- pixbuf = gdk_pixbuf_new_from_data (pix,
- GDK_COLORSPACE_RGB,
- (gboolean) hasAlpha,
- 8, width, height,
- width * (hasAlpha ? 4 : 3), /* rowstride */
- NULL, NULL);
- g_assert (pixbuf != NULL);
-
- g_assert(gdk_pixbuf_save_to_callback (pixbuf,
- &save_to_stream,
- &ssr,
- enctype,
- &err, NULL));
-
- g_object_unref (pixbuf);
-
- gdk_threads_leave ();
- g_free(pix);
-
- (*env)->ReleaseStringUTFChars (env, jenctype, enctype);
- (*env)->ReleaseIntArrayElements (env, jarr, ints, 0);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_pumpBytes
- (JNIEnv *env, jobject obj, jbyteArray jarr, jint len)
-{
- GdkPixbufLoader *loader = NULL;
- jbyte *bytes = NULL;
-
- if (len < 1)
- return;
-
- bytes = (*env)->GetByteArrayElements (env, jarr, NULL);
- g_assert (bytes != NULL);
- loader = (GdkPixbufLoader *)NSA_GET_PB_PTR (env, obj);
- g_assert (loader != NULL);
-
- gdk_threads_enter ();
- gdk_pixbuf_loader_write (loader, (const guchar *) bytes, len, NULL);
- gdk_threads_leave ();
-
- (*env)->ReleaseByteArrayElements (env, jarr, bytes, 0);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c
deleted file mode 100644
index e884004cb26..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/* gdkrobotpeer.c
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GdkRobotPeer.h"
-#include <gdk/gdkx.h>
-#include <X11/extensions/XTest.h>
-
-static int
-awt_button_mask_to_num (int buttons)
-{
- switch (buttons)
- {
- case AWT_BUTTON1_MASK:
- return 1;
- case AWT_BUTTON2_MASK:
- return 2;
- case AWT_BUTTON3_MASK:
- return 3;
- }
-
- return 0;
-}
-
-JNIEXPORT jboolean JNICALL
-Java_gnu_java_awt_peer_gtk_GdkRobotPeer_initXTest
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
-{
- GdkDisplay *display;
- Display *xdisplay;
- int event_basep;
- int error_basep;
- int majorp;
- int minorp;
- jboolean result;
-
- gdk_threads_enter ();
-
- display = gdk_display_get_default ();
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- result = XTestQueryExtension (xdisplay,
- &event_basep,
- &error_basep,
- &majorp,
- &minorp);
-
- gdk_threads_leave ();
-
- return result;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkRobotPeer_mouseMove
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)), jint x, jint y)
-{
- GdkDisplay *display;
- Display *xdisplay;
- int result;
-
- gdk_threads_enter ();
-
- display = gdk_display_get_default ();
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- result = XTestFakeMotionEvent (xdisplay,
- -1,
- x, y, CurrentTime);
-
- XFlush (xdisplay);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkRobotPeer_mousePress
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)), jint buttons)
-{
- GdkDisplay *display;
- Display *xdisplay;
- int result;
-
- gdk_threads_enter ();
-
- display = gdk_display_get_default ();
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- result = XTestFakeButtonEvent (xdisplay,
- awt_button_mask_to_num (buttons),
- True, CurrentTime);
-
- XFlush (xdisplay);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkRobotPeer_mouseRelease
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)), jint buttons)
-{
- GdkDisplay *display;
- Display *xdisplay;
- int result;
-
- gdk_threads_enter ();
-
- display = gdk_display_get_default ();
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- result = XTestFakeButtonEvent (xdisplay,
- awt_button_mask_to_num (buttons),
- False, CurrentTime);
-
- XFlush (xdisplay);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkRobotPeer_mouseWheel
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)), jint wheelAmt)
-{
- GdkDisplay *display;
- Display *xdisplay;
- int i = 0;
-
- gdk_threads_enter ();
-
- display = gdk_display_get_default ();
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- if (wheelAmt < 0)
- for (i = 0; i < -wheelAmt; i++)
- {
- XTestFakeButtonEvent (xdisplay,
- 4,
- True, CurrentTime);
- XTestFakeButtonEvent (xdisplay,
- 4,
- False, CurrentTime);
- }
- else
- for (i = 0; i < wheelAmt; i++)
- {
- XTestFakeButtonEvent (xdisplay,
- 5,
- True, CurrentTime);
- XTestFakeButtonEvent (xdisplay,
- 5,
- False, CurrentTime);
- }
-
- XFlush (xdisplay);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkRobotPeer_keyPress
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)), jint keycode)
-{
- GdkDisplay *display;
- Display *xdisplay;
- GdkKeymapKey *keymap_keys = NULL;
- gint n_keys = 0;
- guint lookup_keyval = 0;
- int result;
-
- gdk_threads_enter ();
-
- display = gdk_display_get_default ();
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- lookup_keyval = awt_keycode_to_keysym (keycode, AWT_KEY_LOCATION_LEFT);
-
- if (!gdk_keymap_get_entries_for_keyval (gdk_keymap_get_default (),
- lookup_keyval,
- &keymap_keys,
- &n_keys))
- {
- /* No matching keymap entry was found. */
- g_printerr ("No matching keymap entries were found\n");
- gdk_threads_leave ();
- return;
- }
-
- /* If n_keys > 1 then there are multiple hardware keycodes that
- translate to lookup_keyval. We arbitrarily choose the first
- hardware keycode from the list returned by
- gdk_keymap_get_entries_for_keyval. */
- result = XTestFakeKeyEvent (xdisplay,
- keymap_keys[0].keycode,
- True, CurrentTime);
-
- g_free (keymap_keys);
-
- XFlush (xdisplay);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkRobotPeer_keyRelease
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)), jint keycode)
-{
- GdkDisplay *display;
- Display *xdisplay;
- GdkKeymapKey *keymap_keys = NULL;
- gint n_keys = 0;
- guint lookup_keyval = 0;
- int result;
-
- gdk_threads_enter ();
-
- display = gdk_display_get_default ();
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- lookup_keyval = awt_keycode_to_keysym (keycode, AWT_KEY_LOCATION_LEFT);
-
- if (!gdk_keymap_get_entries_for_keyval (gdk_keymap_get_default (),
- lookup_keyval,
- &keymap_keys,
- &n_keys))
- {
- /* No matching keymap entry was found. */
- g_printerr ("No matching keymap entries were found\n");
- gdk_threads_leave ();
- return;
- }
-
- /* If n_keys > 1 then there are multiple hardware keycodes that
- translate to lookup_keyval. We arbitrarily choose the first
- hardware keycode from the list returned by
- gdk_keymap_get_entries_for_keyval. */
- result = XTestFakeKeyEvent (xdisplay,
- keymap_keys[0].keycode,
- False, CurrentTime);
-
- g_free (keymap_keys);
-
- XFlush (xdisplay);
- gdk_threads_leave ();
-}
-
-JNIEXPORT jintArray JNICALL
-Java_gnu_java_awt_peer_gtk_GdkRobotPeer_nativeGetRGBPixels
- (JNIEnv *env, jobject obj __attribute__((unused)), jint x, jint y,
- jint width, jint height)
-{
- jint stride_bytes, stride_pixels, n_channels, n_pixels;
- jintArray jpixels;
- jint *java_pixels;
- guchar *gdk_pixels;
- GdkPixbuf *pixbuf_no_alpha = NULL;
- GdkPixbuf *pixbuf = NULL;
-
-#ifndef WORDS_BIGENDIAN
- int i;
-#endif
-
- gdk_threads_enter ();
-
- pixbuf_no_alpha = gdk_pixbuf_get_from_drawable (NULL,
- gdk_get_default_root_window (),
- NULL, x, y, 0, 0,
- width, height);
-
- pixbuf = gdk_pixbuf_add_alpha(pixbuf_no_alpha, FALSE, 0, 0, 0);
- g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
-
- stride_bytes = gdk_pixbuf_get_rowstride (pixbuf);
- n_channels = gdk_pixbuf_get_n_channels (pixbuf);
- stride_pixels = stride_bytes / n_channels;
- n_pixels = height * stride_pixels;
- gdk_pixels = gdk_pixbuf_get_pixels (pixbuf);
-
- jpixels = (*env)->NewIntArray (env, n_pixels);
- java_pixels = (*env)->GetIntArrayElements (env, jpixels, NULL);
-
- memcpy (java_pixels,
- gdk_pixels,
- (height * stride_bytes));
-
-#ifndef WORDS_BIGENDIAN
- /* convert pixels from 0xBBGGRRAA to 0xAARRGGBB */
- for (i = 0; i < n_pixels; ++i)
- {
- java_pixels[i] = SWAPU32 ((unsigned)java_pixels[i]);
- }
-#endif
-
- g_object_unref (pixbuf);
-
- (*env)->ReleaseIntArrayElements (env, jpixels, java_pixels, 0);
-
- gdk_threads_leave ();
-
- return jpixels;
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
deleted file mode 100644
index a86bb09db95..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/* gnu_java_awt_GdkTextLayout.c
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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 <jni.h>
-#include <gtk/gtk.h>
-#include "native_state.h"
-#include "gdkfont.h"
-#include "gnu_java_awt_peer_gtk_GdkTextLayout.h"
-
-struct state_table *native_text_layout_state_table;
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkTextLayout_initStaticState
- (JNIEnv *env, jclass clazz)
-{
- NSA_TEXT_LAYOUT_INIT (env, clazz);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkTextLayout_initState
- (JNIEnv *env, jobject self)
-{
- struct textlayout *tl;
-
- gdk_threads_enter ();
- g_assert(self != NULL);
- tl = g_malloc0 (sizeof (struct textlayout));
- g_assert(tl != NULL);
- tl->pango_layout = pango_layout_new(gdk_pango_context_get());
- g_assert(tl->pango_layout != NULL);
- NSA_SET_TEXT_LAYOUT_PTR (env, self, tl);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkTextLayout_setText
- (JNIEnv *env, jobject self, jstring text)
-{
- struct textlayout *tl;
- gchar *str = NULL;
- gint len = 0;
-
- gdk_threads_enter ();
- g_assert(self != NULL);
- g_assert(text != NULL);
-
- tl = (struct textlayout *)NSA_GET_TEXT_LAYOUT_PTR (env, self);
- g_assert(tl != NULL);
- g_assert(tl->pango_layout != NULL);
-
- len = (*env)->GetStringUTFLength (env, text);
- str = (gchar *)(*env)->GetStringUTFChars (env, text, NULL);
- g_assert (str != NULL);
-
- pango_layout_set_text (tl->pango_layout, text, len);
-
- (*env)->ReleaseStringUTFChars (env, text, str);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkTextLayout_indexToPos
- (JNIEnv *env, jobject self, jint idx, jdoubleArray javaPos)
-{
- struct textlayout *tl;
- PangoRectangle pangoPos;
- jdouble *nativePos;
-
- gdk_threads_enter ();
- g_assert(self != NULL);
- g_assert(javaPos != NULL);
-
- tl = (struct textlayout *)NSA_GET_TEXT_LAYOUT_PTR (env, self);
- g_assert(tl != NULL);
- g_assert(tl->pango_layout != NULL);
-
- g_assert((*env)->GetArrayLength (env, javaPos) == 4);
-
- nativePos = (*env)->GetDoubleArrayElements (env, javaPos, NULL);
-
- pango_layout_index_to_pos (tl->pango_layout, idx, &pangoPos);
-
- nativePos[0] = (jdouble) pangoPos.x;
- nativePos[1] = (jdouble) pangoPos.y;
- nativePos[2] = (jdouble) pangoPos.width;
- nativePos[3] = (jdouble) pangoPos.height;
-
- (*env)->ReleaseDoubleArrayElements (env, javaPos, nativePos, 0);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkTextLayout_getExtents
- (JNIEnv *env, jobject self, jdoubleArray javaInkExtents, jdoubleArray javaLogExtents)
-{
- struct textlayout *tl;
- PangoRectangle pangoInkExtents, pangoLogExtents;
- jdouble *nativeInkExtents, *nativeLogExtents;
-
- gdk_threads_enter ();
- g_assert(self != NULL);
- g_assert(javaInkExtents != NULL);
- g_assert(javaLogExtents != NULL);
-
- tl = (struct textlayout *)NSA_GET_TEXT_LAYOUT_PTR (env, self);
- g_assert(tl != NULL);
- g_assert(tl->pango_layout != NULL);
-
- g_assert((*env)->GetArrayLength (env, javaInkExtents) == 4);
- g_assert((*env)->GetArrayLength (env, javaLogExtents) == 4);
-
- nativeInkExtents = (*env)->GetDoubleArrayElements (env, javaInkExtents, NULL);
- nativeLogExtents = (*env)->GetDoubleArrayElements (env, javaLogExtents, NULL);
-
- pango_layout_get_extents (tl->pango_layout,
- &pangoInkExtents, &pangoLogExtents);
-
- nativeInkExtents[0] = (jdouble) pangoInkExtents.x;
- nativeInkExtents[1] = (jdouble) pangoInkExtents.y;
- nativeInkExtents[2] = (jdouble) pangoInkExtents.width;
- nativeInkExtents[3] = (jdouble) pangoInkExtents.height;
-
- nativeLogExtents[0] = (jdouble) pangoLogExtents.x;
- nativeLogExtents[1] = (jdouble) pangoLogExtents.y;
- nativeLogExtents[2] = (jdouble) pangoLogExtents.width;
- nativeLogExtents[3] = (jdouble) pangoLogExtents.height;
-
- (*env)->ReleaseDoubleArrayElements (env, javaInkExtents, nativeInkExtents, 0);
- (*env)->ReleaseDoubleArrayElements (env, javaLogExtents, nativeLogExtents, 0);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkTextLayout_dispose
- (JNIEnv *env, jobject self)
-{
- struct textlayout *tl;
-
- gdk_threads_enter ();
- g_assert(self != NULL);
- tl = (struct textlayout *) NSA_DEL_TEXT_LAYOUT_PTR (env, self);
- g_assert(tl != NULL);
- if (tl->pango_layout != NULL)
- g_object_unref (tl->pango_layout);
- g_free(tl);
- gdk_threads_leave ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
deleted file mode 100644
index 07574ed7d96..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+++ /dev/null
@@ -1,355 +0,0 @@
-/* gtkbuttonpeer.c -- Native implementation of GtkButtonPeer
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkButtonPeer.h"
-
-static gboolean focus_in_cb (GtkWidget *widget,
- GdkEventFocus *event,
- jobject peer);
-static gboolean focus_out_cb (GtkWidget *widget,
- GdkEventFocus *event,
- jobject peer);
-
-static void block_expose_events_cb (GtkWidget *widget,
- jobject peer);
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create
- (JNIEnv *env, jobject obj, jstring label)
-{
- const char *c_label;
- GtkWidget *eventbox;
- GtkWidget *button;
-
- NSA_SET_GLOBAL_REF (env, obj);
-
- c_label = (*env)->GetStringUTFChars (env, label, NULL);
-
- gdk_threads_enter ();
-
- eventbox = gtk_event_box_new ();
- button = gtk_button_new_with_label (c_label);
- gtk_container_add (GTK_CONTAINER (eventbox), button);
- gtk_widget_show (button);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, label, c_label);
- NSA_SET_PTR (env, obj, eventbox);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- jobject *gref;
- GtkWidget *button;
-
- ptr = NSA_GET_PTR (env, obj);
- gref = NSA_GET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- button = gtk_bin_get_child (GTK_BIN (ptr));
-
- g_signal_connect (G_OBJECT (ptr), "event",
- G_CALLBACK (pre_event_handler), *gref);
-
- g_signal_connect (G_OBJECT (button), "event",
- G_CALLBACK (pre_event_handler), *gref);
-
- g_signal_connect (G_OBJECT (button), "focus-in-event",
- G_CALLBACK (focus_in_cb), *gref);
-
- g_signal_connect (G_OBJECT (button), "focus-out-event",
- G_CALLBACK (focus_out_cb), *gref);
-
- g_signal_connect_after (G_OBJECT (button), "pressed",
- G_CALLBACK (block_expose_events_cb), *gref);
-
- g_signal_connect_after (G_OBJECT (button), "released",
- G_CALLBACK (block_expose_events_cb), *gref);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetLabel
- (JNIEnv *env, jobject obj, jstring jtext)
-{
- const char *text;
- GtkWidget *button;
- GtkWidget *label;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- text = (*env)->GetStringUTFChars (env, jtext, NULL);
-
- gdk_threads_enter ();
-
- button = gtk_bin_get_child (GTK_BIN (ptr));
- label = gtk_bin_get_child (GTK_BIN (button));
- gtk_label_set_text (GTK_LABEL (label), text);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, jtext, text);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkWidgetModifyFont
- (JNIEnv *env, jobject obj, jstring name, jint style, jint size)
-{
- const char *font_name;
- void *ptr;
- GtkWidget *button;
- GtkWidget *label;
- PangoFontDescription *font_desc;
-
- ptr = NSA_GET_PTR (env, obj);
-
- font_name = (*env)->GetStringUTFChars (env, name, NULL);
-
- gdk_threads_enter();
-
- button = gtk_bin_get_child (GTK_BIN (ptr));
- label = gtk_bin_get_child (GTK_BIN (button));
-
- font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size * dpi_conversion_factor);
-
- if (style & AWT_STYLE_BOLD)
- pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
-
- if (style & AWT_STYLE_ITALIC)
- pango_font_description_set_style (font_desc, PANGO_STYLE_OBLIQUE);
-
- gtk_widget_modify_font (GTK_WIDGET(label), font_desc);
-
- pango_font_description_free (font_desc);
-
- gdk_threads_leave();
-
- (*env)->ReleaseStringUTFChars (env, name, font_name);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkWidgetSetBackground
- (JNIEnv *env, jobject obj, jint red, jint green, jint blue)
-{
- GdkColor normal_color;
- GdkColor prelight_color;
- GdkColor active_color;
- int prelight_red;
- int prelight_blue;
- int prelight_green;
- GtkWidget *button;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- normal_color.red = (red / 255.0) * 65535;
- normal_color.green = (green / 255.0) * 65535;
- normal_color.blue = (blue / 255.0) * 65535;
-
- /* This calculation only approximate the active color produced by
- Sun's AWT. */
- active_color.red = 0.85 * (red / 255.0) * 65535;
- active_color.green = 0.85 * (green / 255.0) * 65535;
- active_color.blue = 0.85 * (blue / 255.0) * 65535;
-
- /* There is no separate prelight color in Motif. */
- prelight_red = 1.15 * (red / 255.0) * 65535;
- prelight_green = 1.15 * (green / 255.0) * 65535;
- prelight_blue = 1.15 * (blue / 255.0) * 65535;
-
- prelight_color.red = prelight_red > 65535 ? 65535 : prelight_red;
- prelight_color.green = prelight_green > 65535 ? 65535 : prelight_green;
- prelight_color.blue = prelight_blue > 65535 ? 65535 : prelight_blue;
-
- gdk_threads_enter ();
-
- button = gtk_bin_get_child (GTK_BIN (ptr));
-
- gtk_widget_modify_bg (button, GTK_STATE_NORMAL, &normal_color);
- gtk_widget_modify_bg (button, GTK_STATE_ACTIVE, &active_color);
- gtk_widget_modify_bg (button, GTK_STATE_PRELIGHT, &prelight_color);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkWidgetSetForeground
- (JNIEnv *env, jobject obj, jint red, jint green, jint blue)
-{
- GdkColor color;
- GtkWidget *button;
- GtkWidget *label;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- color.red = (red / 255.0) * 65535;
- color.green = (green / 255.0) * 65535;
- color.blue = (blue / 255.0) * 65535;
-
- gdk_threads_enter ();
-
- button = gtk_bin_get_child (GTK_BIN (ptr));
- label = gtk_bin_get_child (GTK_BIN (button));
-
- gtk_widget_modify_fg (label, GTK_STATE_NORMAL, &color);
- gtk_widget_modify_fg (label, GTK_STATE_ACTIVE, &color);
- gtk_widget_modify_fg (label, GTK_STATE_PRELIGHT, &color);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkActivate
- (JNIEnv *env, jobject obj)
-{
- GtkWidget *button;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- button = gtk_bin_get_child (GTK_BIN (ptr));
- gtk_widget_activate (GTK_WIDGET (button));
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkWidgetRequestFocus
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- GtkWidget *button;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- button = gtk_bin_get_child (GTK_BIN (ptr));
- gtk_widget_grab_focus (button);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
-{
- GtkWidget *widget, *child;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- widget = GTK_WIDGET (ptr);
-
- /* We assume that -1 is a width or height and not a request for the
- widget's natural size. */
- width = width < 0 ? 0 : width;
- height = height < 0 ? 0 : height;
- child = gtk_bin_get_child (GTK_BIN (widget));
-
- if (!(width == 0 && height == 0))
- {
- /* Set the event box's size request... */
- gtk_widget_set_size_request (widget, width, height);
- /* ...and the button's size request... */
- gtk_widget_set_size_request (child, width, height);
- /* ...and the label's size request. */
- gtk_widget_set_size_request (gtk_bin_get_child (GTK_BIN (child)), width,
- height);
- if (widget->parent != NULL)
- gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
- }
-
- gdk_threads_leave ();
-}
-
-static gboolean
-focus_in_cb (GtkWidget *widget __attribute((unused)),
- GdkEventFocus *event __attribute((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postFocusEventID,
- AWT_FOCUS_GAINED,
- JNI_FALSE);
- gdk_threads_enter ();
- return FALSE;
-}
-
-static gboolean
-focus_out_cb (GtkWidget *widget __attribute((unused)),
- GdkEventFocus *event __attribute((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postFocusEventID,
- AWT_FOCUS_LOST,
- JNI_FALSE);
- gdk_threads_enter ();
- return FALSE;
-}
-
-static void
-block_expose_events_cb (GtkWidget *widget, jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- beginNativeRepaintID);
- gdk_threads_enter ();
-
- gdk_window_process_updates (widget->window, TRUE);
-
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- endNativeRepaintID);
- gdk_threads_enter ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c
deleted file mode 100644
index 592cd02bb4f..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* gtkcanvaspeer.c -- Native implementation of GtkCanvasPeer
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkCanvasPeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create
- (JNIEnv *env, jobject obj)
-{
- gpointer widget;
-
- /* Create global reference and save it for future use */
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- widget = gtk_type_new (gtk_drawing_area_get_type ());
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, widget);
-}
-
-
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c
deleted file mode 100644
index 93fab16c030..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* gtkcheckboxgrouppeer.c -- Native implementation of GtkCheckboxGroupPeer
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer_dispose
- (JNIEnv *env, jobject obj)
-{
- /* The actual underlying widget is owned by a different class. So
- we just clean up the hash table here. */
- NSA_DEL_PTR (env, obj);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer_remove
- (JNIEnv *env, jobject obj, jobject checkbox)
-{
- GtkRadioButton *button;
- void *ptr;
- GSList *list;
-
- ptr = NSA_GET_PTR (env, checkbox);
- gdk_threads_enter ();
- button = GTK_RADIO_BUTTON (ptr);
-
- /* Update the group to point to some other widget in the group. We
- have to do this because Gtk doesn't have a separate object to
- represent a radio button's group. */
- for (list = gtk_radio_button_group (button); list != NULL;
- list = list->next)
- {
- if (list->data != button)
- break;
- }
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, list ? list->data : NULL);
-}
-
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c
deleted file mode 100644
index 87803a7df71..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* gtkmenuitempeer.c -- Native implementation of GtkMenuItemPeer
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create
- (JNIEnv *env, jobject obj, jstring label)
-{
- GtkWidget *widget;
- const char *str;
-
- NSA_SET_GLOBAL_REF (env, obj);
-
- str = (*env)->GetStringUTFChars (env, label, NULL);
-
- gdk_threads_enter ();
-
- widget = gtk_check_menu_item_new_with_label (str);
- gtk_widget_show (widget);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, label, str);
-
- NSA_SET_PTR (env, obj, widget);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_setState
- (JNIEnv *env, jobject obj, jboolean state)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (ptr), state);
- gdk_threads_leave ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
deleted file mode 100644
index b37f3c1df57..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/* gtkcheckboxpeer.c -- Native implementation of GtkCheckboxPeer
- Copyright (C) 1998, 1999, 2002, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkCheckboxPeer.h"
-#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
-
-static void item_toggled (GtkToggleButton *item, jobject peer);
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_create
- (JNIEnv *env, jobject obj, jobject group)
-{
- GtkWidget *button;
-
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- if (group == NULL)
- button = gtk_check_button_new_with_label ("");
- else
- {
- void *native_group = NSA_GET_PTR (env, group);
- button = gtk_radio_button_new_with_label_from_widget (native_group, "");
- if (native_group == NULL)
- {
- /* Set the native group so we can use the correct value the
- next time around. FIXME: this doesn't work! */
- NSA_SET_PTR (env, group, button);
- }
- }
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, button);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals
- (JNIEnv *env, jobject obj)
-{
- void *ptr = NSA_GET_PTR (env, obj);
- jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
- g_assert (gref);
-
- gdk_threads_enter ();
-
- g_signal_connect (G_OBJECT (ptr), "toggled",
- GTK_SIGNAL_FUNC (item_toggled), *gref);
-
- gdk_threads_leave ();
-
- /* Connect the superclass signals. */
- Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeSetCheckboxGroup
- (JNIEnv *env, jobject obj, jobject group)
-{
- GtkRadioButton *button;
- void *native_group, *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- /* FIXME: we can't yet switch between a checkbutton and a
- radiobutton. However, AWT requires this. For now we just
- crash. */
-
- button = GTK_RADIO_BUTTON (ptr);
-
- native_group = NSA_GET_PTR (env, group);
- if (native_group == NULL)
- gtk_radio_button_set_group (button, NULL);
- else
- gtk_radio_button_set_group (button,
- gtk_radio_button_group
- (GTK_RADIO_BUTTON (native_group)));
-
- gdk_threads_leave ();
-
- /* If the native group wasn't set on the new CheckboxGroup, then set
- it now so that the right thing will happen with the next
- radiobutton. The native state for a CheckboxGroup is a pointer
- to one of the widgets in the group. We are careful to keep this
- always pointing at a live widget; whenever a widget is destroyed
- (or otherwise removed from the group), the CheckboxGroup peer is
- notified. */
- if (native_group == NULL)
- NSA_SET_PTR (env, group, native_group);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_gtkToggleButtonSetActive
- (JNIEnv *env, jobject obj, jboolean is_active)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ptr), is_active);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_gtkWidgetModifyFont
- (JNIEnv *env, jobject obj, jstring name, jint style, jint size)
-{
- const char *font_name;
- void *ptr;
- GtkWidget *button;
- GtkWidget *label;
- PangoFontDescription *font_desc;
-
- ptr = NSA_GET_PTR (env, obj);
-
- button = GTK_WIDGET (ptr);
- label = gtk_bin_get_child (GTK_BIN(button));
-
- if (!label)
- return;
-
- font_name = (*env)->GetStringUTFChars (env, name, NULL);
-
- gdk_threads_enter();
-
- font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size * dpi_conversion_factor);
-
- if (style & AWT_STYLE_BOLD)
- pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
-
- if (style & AWT_STYLE_ITALIC)
- pango_font_description_set_style (font_desc, PANGO_STYLE_OBLIQUE);
-
- gtk_widget_modify_font (GTK_WIDGET(label), font_desc);
-
- pango_font_description_free (font_desc);
-
- gdk_threads_leave();
-
- (*env)->ReleaseStringUTFChars (env, name, font_name);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_gtkButtonSetLabel
- (JNIEnv *env, jobject obj, jstring label)
-{
- const char *c_label;
- GtkWidget *label_widget;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- c_label = (*env)->GetStringUTFChars (env, label, NULL);
-
- gdk_threads_enter ();
-
- label_widget = gtk_bin_get_child (GTK_BIN (ptr));
- gtk_label_set_text (GTK_LABEL (label_widget), c_label);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, label, c_label);
-}
-
-static void
-item_toggled (GtkToggleButton *item, jobject peer)
-{
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postItemEventID,
- peer,
- item->active ?
- (jint) AWT_ITEM_SELECTED :
- (jint) AWT_ITEM_DESELECTED);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
deleted file mode 100644
index 030cb73d09f..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* gtkchoicepeer.c -- Native implementation of GtkChoicePeer
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkChoicePeer.h"
-
-static void selection_changed (GtkComboBox *combobox, jobject peer);
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create
- (JNIEnv *env, jobject obj)
-{
- GtkWidget *combobox;
- jobject *gref;
-
- NSA_SET_GLOBAL_REF (env, obj);
- gref = NSA_GET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- combobox = gtk_combo_box_new_text ();
-
- g_signal_connect (combobox, "changed",
- G_CALLBACK (selection_changed), *gref);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, combobox);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append
- (JNIEnv *env, jobject obj, jobjectArray items)
-{
- gpointer ptr;
- jsize count, i;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- count = (*env)->GetArrayLength (env, items);
-
- for (i = 0; i < count; i++)
- {
- jobject item;
- const char *label;
-
- item = (*env)->GetObjectArrayElement (env, items, i);
- label = (*env)->GetStringUTFChars (env, item, NULL);
-
- gtk_combo_box_append_text (GTK_COMBO_BOX (ptr), label);
-
- (*env)->ReleaseStringUTFChars (env, item, label);
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeAdd
- (JNIEnv *env, jobject obj, jstring item, jint index)
-{
- void *ptr;
- const char *label;
-
- ptr = NSA_GET_PTR (env, obj);
-
- label = (*env)->GetStringUTFChars (env, item, 0);
-
- gdk_threads_enter ();
- gtk_combo_box_insert_text (GTK_COMBO_BOX (ptr), index, label);
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, item, label);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemove
- (JNIEnv *env, jobject obj, jint index)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gtk_combo_box_remove_text (GTK_COMBO_BOX (ptr), index);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemoveAll
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- GtkTreeModel *model;
- gint count, i;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- model = gtk_combo_box_get_model (GTK_COMBO_BOX (ptr));
- count = gtk_tree_model_iter_n_children (model, NULL);
-
- /* First, unselect everything, to avoid problems when removing items. */
- gtk_combo_box_set_active (GTK_COMBO_BOX (ptr), -1);
-
- for (i = count - 1; i >= 0; i--) {
- gtk_combo_box_remove_text (GTK_COMBO_BOX (ptr), i);
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkChoicePeer_select
- (JNIEnv *env, jobject obj, jint index)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gtk_combo_box_set_active (GTK_COMBO_BOX (ptr), index);
- gdk_threads_leave ();
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeGetSelected
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- int index;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- index = gtk_combo_box_get_active (GTK_COMBO_BOX (ptr));
- gdk_threads_leave ();
-
- return index;
-}
-
-static void selection_changed (GtkComboBox *combobox, jobject peer)
-{
- jstring label;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gchar *selected;
- gint index;
-
- index = gtk_combo_box_get_active(combobox);
-
- if (index >= 0)
- {
- model = gtk_combo_box_get_model (combobox);
-
- gtk_combo_box_get_active_iter (combobox, &iter);
-
- gtk_tree_model_get (model, &iter, 0, &selected, -1);
-
- gdk_threads_leave ();
-
- label = (*gdk_env())->NewStringUTF (gdk_env(), selected);
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- choicePostItemEventID,
- label,
- (jint) AWT_ITEM_SELECTED);
- gdk_threads_enter ();
- }
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
deleted file mode 100644
index b2717e8d122..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/* gtkclipboard.c
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkClipboard.h"
-
-jmethodID stringSelectionReceivedID;
-jmethodID stringSelectionHandlerID;
-jmethodID selectionClearID;
-
-void selection_received (GtkWidget *, GtkSelectionData *, guint, gpointer);
-void selection_get (GtkWidget *, GtkSelectionData *, guint, guint, gpointer);
-gint selection_clear (GtkWidget *, GdkEventSelection *);
-
-GtkWidget *clipboard;
-jobject cb_obj;
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState (JNIEnv *env,
- jobject obj)
-{
- if (!stringSelectionReceivedID)
- {
- jclass gtkclipboard;
-
- gtkclipboard = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkClipboard");
- stringSelectionReceivedID = (*env)->GetMethodID (env, gtkclipboard,
- "stringSelectionReceived",
- "(Ljava/lang/String;)V");
- stringSelectionHandlerID = (*env)->GetMethodID (env, gtkclipboard,
- "stringSelectionHandler",
- "()Ljava/lang/String;");
- selectionClearID = (*env)->GetMethodID (env, gtkclipboard,
- "selectionClear", "()V");
- }
-
- cb_obj = (*env)->NewGlobalRef (env, obj);
-
- gdk_threads_enter ();
- clipboard = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- g_signal_connect (G_OBJECT(clipboard), "selection_received",
- GTK_SIGNAL_FUNC (selection_received), NULL);
-
- g_signal_connect (G_OBJECT(clipboard), "selection_clear_event",
- GTK_SIGNAL_FUNC (selection_clear), NULL);
-
- gtk_selection_add_target (clipboard, GDK_SELECTION_PRIMARY,
- GDK_TARGET_STRING, 0);
-
- g_signal_connect (G_OBJECT(clipboard), "selection_get",
- GTK_SIGNAL_FUNC (selection_get), NULL);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkClipboard_requestStringConversion
- (JNIEnv *env __attribute__((unused)), jclass clazz __attribute__((unused)))
-{
- gdk_threads_enter ();
- gtk_selection_convert (clipboard, GDK_SELECTION_PRIMARY,
- GDK_TARGET_STRING, GDK_CURRENT_TIME);
- gdk_threads_leave ();
-}
-
-void
-selection_received (GtkWidget *widget __attribute__((unused)),
- GtkSelectionData *selection_data __attribute__((unused)),
- guint time __attribute__((unused)),
- gpointer data __attribute__((unused)))
-{
- /* Check to see if retrieval succeeded */
- if (selection_data->length < 0
- || selection_data->type != GDK_SELECTION_TYPE_STRING)
- {
- (*gdk_env())->CallVoidMethod (gdk_env(), cb_obj, stringSelectionReceivedID,
- NULL);
- }
- else
- {
- char *str = (char *) selection_data->data;
-
- (*gdk_env())->CallVoidMethod (gdk_env(), cb_obj, stringSelectionReceivedID,
- (*gdk_env())->NewStringUTF (gdk_env(), str));
- }
-
- return;
-}
-
-void
-selection_get (GtkWidget *widget __attribute__((unused)),
- GtkSelectionData *selection_data,
- guint info __attribute__((unused)),
- guint time __attribute__((unused)),
- gpointer data __attribute__((unused)))
-{
- jstring jstr;
- const char *utf;
- jsize utflen;
-
- jstr = (*gdk_env())->CallObjectMethod (gdk_env(), cb_obj,
- stringSelectionHandlerID);
-
- if (!jstr)
- {
- gtk_selection_data_set (selection_data,
- GDK_TARGET_STRING, 8, NULL, 0);
- return;
- }
-
- utflen = (*gdk_env())->GetStringUTFLength (gdk_env(), jstr);
- utf = (*gdk_env())->GetStringUTFChars (gdk_env(), jstr, NULL);
-
- gtk_selection_data_set (selection_data, GDK_TARGET_STRING, 8,
- (const unsigned char*)utf, utflen);
-
- (*gdk_env())->ReleaseStringUTFChars (gdk_env(), jstr, utf);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkClipboard_selectionGet
- (JNIEnv *env, jclass clazz __attribute__((unused)))
-{
- GdkWindow *owner;
-
- gdk_threads_enter ();
-
- /* if we already own the clipboard, we need to tell the old data object
- that we're no longer going to be using him */
- owner = gdk_selection_owner_get (GDK_SELECTION_PRIMARY);
- if (owner && owner == clipboard->window)
- (*env)->CallVoidMethod (env, cb_obj, selectionClearID);
-
- gtk_selection_owner_set (clipboard, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME);
-
- gdk_threads_leave ();
-}
-
-gint
-selection_clear (GtkWidget *widget __attribute__((unused)),
- GdkEventSelection *event __attribute__((unused)))
-{
- (*gdk_env())->CallVoidMethod (gdk_env(), cb_obj, selectionClearID);
-
- return TRUE;
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
deleted file mode 100644
index 2b932d14bdf..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+++ /dev/null
@@ -1,1078 +0,0 @@
-/* gtkcomponentpeer.c -- Native implementation of GtkComponentPeer
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
-#include <gtk/gtkprivate.h>
-#include <gdk/gdkkeysyms.h>
-
-static GtkWidget *find_fg_color_widget (GtkWidget *widget);
-static GtkWidget *find_bg_color_widget (GtkWidget *widget);
-static gboolean focus_in_cb (GtkWidget *widget,
- GdkEventFocus *event,
- jobject peer);
-static gboolean focus_out_cb (GtkWidget *widget,
- GdkEventFocus *event,
- jobject peer);
-
-/*
- * This method returns a GDK keyval that corresponds to one of the
- * keysyms in the X keymap table. The return value is only used to
- * determine the keyval's corresponding hardware keycode, and doesn't
- * reflect an accurate translation of a Java virtual key value to a
- * GDK keyval.
- */
-#ifdef __GNUC__
-__inline
-#endif
-guint
-awt_keycode_to_keysym (jint keyCode, jint keyLocation)
-{
- /* GDK_A through GDK_Z */
- if (keyCode >= VK_A && keyCode <= VK_Z)
- return gdk_keyval_to_lower (keyCode);
-
- /* GDK_0 through GDK_9 */
- if (keyCode >= VK_0 && keyCode <= VK_9)
- return keyCode;
-
- switch (keyCode)
- {
- case VK_ENTER:
- return keyLocation == AWT_KEY_LOCATION_NUMPAD ? GDK_KP_Enter : GDK_Return;
- case VK_BACK_SPACE:
- return GDK_BackSpace;
- case VK_TAB:
- return GDK_Tab;
- case VK_CANCEL:
- return GDK_Cancel;
- case VK_CLEAR:
- return GDK_Clear;
- case VK_SHIFT:
- return keyLocation == AWT_KEY_LOCATION_LEFT ? GDK_Shift_L : GDK_Shift_R;
- case VK_CONTROL:
- return keyLocation == AWT_KEY_LOCATION_LEFT ? GDK_Control_L : GDK_Control_R;
- case VK_ALT:
- return keyLocation == AWT_KEY_LOCATION_LEFT ? GDK_Alt_L : GDK_Alt_R;
- case VK_PAUSE:
- return GDK_Pause;
- case VK_CAPS_LOCK:
- return GDK_Caps_Lock;
- case VK_ESCAPE:
- return GDK_Escape;
- case VK_SPACE:
- return GDK_space;
- case VK_PAGE_UP:
- return keyLocation == AWT_KEY_LOCATION_NUMPAD ? GDK_KP_Page_Up : GDK_Page_Up;
- case VK_PAGE_DOWN:
- return keyLocation == AWT_KEY_LOCATION_NUMPAD ? GDK_KP_Page_Down : GDK_Page_Down;
- case VK_END:
- return keyLocation == AWT_KEY_LOCATION_NUMPAD ? GDK_KP_End : GDK_End;
- case VK_HOME:
- return keyLocation == AWT_KEY_LOCATION_NUMPAD ? GDK_KP_Home : GDK_Home;
- case VK_LEFT:
- return GDK_Left;
- case VK_UP:
- return GDK_Up;
- case VK_RIGHT:
- return GDK_Right;
- case VK_DOWN:
- return GDK_Down;
- case VK_COMMA:
- return GDK_comma;
- case VK_MINUS:
- return GDK_minus;
- case VK_PERIOD:
- return GDK_period;
- case VK_SLASH:
- return GDK_slash;
- /*
- case VK_0:
- case VK_1:
- case VK_2:
- case VK_3:
- case VK_4:
- case VK_5:
- case VK_6:
- case VK_7:
- case VK_8:
- case VK_9:
- */
- case VK_SEMICOLON:
- return GDK_semicolon;
- case VK_EQUALS:
- return GDK_equal;
- /*
- case VK_A:
- case VK_B:
- case VK_C:
- case VK_D:
- case VK_E:
- case VK_F:
- case VK_G:
- case VK_H:
- case VK_I:
- case VK_J:
- case VK_K:
- case VK_L:
- case VK_M:
- case VK_N:
- case VK_O:
- case VK_P:
- case VK_Q:
- case VK_R:
- case VK_S:
- case VK_T:
- case VK_U:
- case VK_V:
- case VK_W:
- case VK_X:
- case VK_Y:
- case VK_Z:
- */
- case VK_OPEN_BRACKET:
- return GDK_bracketleft;
- case VK_BACK_SLASH:
- return GDK_backslash;
- case VK_CLOSE_BRACKET:
- return GDK_bracketright;
- case VK_NUMPAD0:
- return GDK_KP_0;
- case VK_NUMPAD1:
- return GDK_KP_1;
- case VK_NUMPAD2:
- return GDK_KP_2;
- case VK_NUMPAD3:
- return GDK_KP_3;
- case VK_NUMPAD4:
- return GDK_KP_4;
- case VK_NUMPAD5:
- return GDK_KP_5;
- case VK_NUMPAD6:
- return GDK_KP_6;
- case VK_NUMPAD7:
- return GDK_KP_7;
- case VK_NUMPAD8:
- return GDK_KP_8;
- case VK_NUMPAD9:
- return GDK_KP_9;
- case VK_MULTIPLY:
- return GDK_KP_Multiply;
- case VK_ADD:
- return GDK_KP_Add;
- /*
- case VK_SEPARATER:
- */
- case VK_SEPARATOR:
- return GDK_KP_Separator;
- case VK_SUBTRACT:
- return GDK_KP_Subtract;
- case VK_DECIMAL:
- return GDK_KP_Decimal;
- case VK_DIVIDE:
- return GDK_KP_Divide;
- case VK_DELETE:
- return keyLocation == AWT_KEY_LOCATION_NUMPAD ? GDK_KP_Delete : GDK_Delete;
- case VK_NUM_LOCK:
- return GDK_Num_Lock;
- case VK_SCROLL_LOCK:
- return GDK_Scroll_Lock;
- case VK_F1:
- return GDK_F1;
- case VK_F2:
- return GDK_F2;
- case VK_F3:
- return GDK_F3;
- case VK_F4:
- return GDK_F4;
- case VK_F5:
- return GDK_F5;
- case VK_F6:
- return GDK_F6;
- case VK_F7:
- return GDK_F7;
- case VK_F8:
- return GDK_F8;
- case VK_F9:
- return GDK_F9;
- case VK_F10:
- return GDK_F10;
- case VK_F11:
- return GDK_F11;
- case VK_F12:
- return GDK_F12;
- case VK_F13:
- return GDK_F13;
- case VK_F14:
- return GDK_F14;
- case VK_F15:
- return GDK_F15;
- case VK_F16:
- return GDK_F16;
- case VK_F17:
- return GDK_F17;
- case VK_F18:
- return GDK_F18;
- case VK_F19:
- return GDK_F19;
- case VK_F20:
- return GDK_F20;
- case VK_F21:
- return GDK_F21;
- case VK_F22:
- return GDK_F22;
- case VK_F23:
- return GDK_F23;
- case VK_F24:
- return GDK_F24;
- case VK_PRINTSCREEN:
- return GDK_Print;
- case VK_INSERT:
- return keyLocation == AWT_KEY_LOCATION_NUMPAD ? GDK_KP_Insert : GDK_Insert;
- case VK_HELP:
- return GDK_Help;
- case VK_META:
- return keyLocation == AWT_KEY_LOCATION_LEFT ? GDK_Meta_L : GDK_Meta_R;
- case VK_BACK_QUOTE:
- return GDK_grave;
- case VK_QUOTE:
- return GDK_apostrophe;
- case VK_KP_UP:
- return GDK_KP_Up;
- case VK_KP_DOWN:
- return GDK_KP_Down;
- case VK_KP_LEFT:
- return GDK_KP_Left;
- case VK_KP_RIGHT:
- return GDK_KP_Right;
- case VK_DEAD_GRAVE:
- return GDK_dead_grave;
- case VK_DEAD_ACUTE:
- return GDK_dead_acute;
- case VK_DEAD_CIRCUMFLEX:
- return GDK_dead_circumflex;
- case VK_DEAD_TILDE:
- return GDK_dead_tilde;
- case VK_DEAD_MACRON:
- return GDK_dead_macron;
- case VK_DEAD_BREVE:
- return GDK_dead_breve;
- case VK_DEAD_ABOVEDOT:
- return GDK_dead_abovedot;
- case VK_DEAD_DIAERESIS:
- return GDK_dead_diaeresis;
- case VK_DEAD_ABOVERING:
- return GDK_dead_abovering;
- case VK_DEAD_DOUBLEACUTE:
- return GDK_dead_doubleacute;
- case VK_DEAD_CARON:
- return GDK_dead_caron;
- case VK_DEAD_CEDILLA:
- return GDK_dead_cedilla;
- case VK_DEAD_OGONEK:
- return GDK_dead_ogonek;
- case VK_DEAD_IOTA:
- return GDK_dead_iota;
- case VK_DEAD_VOICED_SOUND:
- return GDK_dead_voiced_sound;
- case VK_DEAD_SEMIVOICED_SOUND:
- return GDK_dead_semivoiced_sound;
- case VK_AMPERSAND:
- return GDK_ampersand;
- case VK_ASTERISK:
- return GDK_asterisk;
- case VK_QUOTEDBL:
- return GDK_quotedbl;
- case VK_LESS:
- return GDK_less;
- case VK_GREATER:
- return GDK_greater;
- case VK_BRACELEFT:
- return GDK_braceleft;
- case VK_BRACERIGHT:
- return GDK_braceright;
- case VK_AT:
- return GDK_at;
- case VK_COLON:
- return GDK_colon;
- case VK_CIRCUMFLEX:
- return GDK_asciicircum;
- case VK_DOLLAR:
- return GDK_dollar;
- case VK_EURO_SIGN:
- return GDK_EuroSign;
- case VK_EXCLAMATION_MARK:
- return GDK_exclam;
- case VK_INVERTED_EXCLAMATION_MARK:
- return GDK_exclamdown;
- case VK_LEFT_PARENTHESIS:
- return GDK_parenleft;
- case VK_NUMBER_SIGN:
- return GDK_numbersign;
- case VK_PLUS:
- return GDK_plus;
- case VK_RIGHT_PARENTHESIS:
- return GDK_parenright;
- case VK_UNDERSCORE:
- return GDK_underscore;
- /*
- case VK_FINAL:
- case VK_CONVERT:
- case VK_NONCONVERT:
- case VK_ACCEPT:
- */
- case VK_MODECHANGE:
- return GDK_Mode_switch;
- /*
- case VK_KANA:
- */
- case VK_KANJI:
- return GDK_Kanji;
- /*
- case VK_ALPHANUMERIC:
- */
- case VK_KATAKANA:
- return GDK_Katakana;
- case VK_HIRAGANA:
- return GDK_Hiragana;
- /*
- case VK_FULL_WIDTH:
- case VK_HALF_WIDTH:
- case VK_ROMAN_CHARACTERS:
- case VK_ALL_CANDIDATES:
- */
- case VK_PREVIOUS_CANDIDATE:
- return GDK_PreviousCandidate;
- case VK_CODE_INPUT:
- return GDK_Codeinput;
- /*
- case VK_JAPANESE_KATAKANA:
- case VK_JAPANESE_HIRAGANA:
- case VK_JAPANESE_ROMAN:
- */
- case VK_KANA_LOCK:
- return GDK_Kana_Lock;
- /*
- case VK_INPUT_METHOD_ON_OFF:
- case VK_CUT:
- case VK_COPY:
- case VK_PASTE:
- case VK_UNDO:
- case VK_AGAIN:
- case VK_FIND:
- case VK_PROPS:
- case VK_STOP:
- case VK_COMPOSE:
- case VK_ALT_GRAPH:
- */
- default:
- return GDK_VoidSymbol;
- }
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursor
- (JNIEnv *env, jobject obj, jint type)
-{
- void *ptr;
- GtkWidget *widget;
- GdkCursorType gdk_cursor_type;
- GdkCursor *gdk_cursor;
-
- ptr = NSA_GET_PTR (env, obj);
-
- switch (type)
- {
- case AWT_CROSSHAIR_CURSOR:
- gdk_cursor_type = GDK_CROSSHAIR;
- break;
- case AWT_TEXT_CURSOR:
- gdk_cursor_type = GDK_XTERM;
- break;
- case AWT_WAIT_CURSOR:
- gdk_cursor_type = GDK_WATCH;
- break;
- case AWT_SW_RESIZE_CURSOR:
- gdk_cursor_type = GDK_BOTTOM_LEFT_CORNER;
- break;
- case AWT_SE_RESIZE_CURSOR:
- gdk_cursor_type = GDK_BOTTOM_RIGHT_CORNER;
- break;
- case AWT_NW_RESIZE_CURSOR:
- gdk_cursor_type = GDK_TOP_LEFT_CORNER;
- break;
- case AWT_NE_RESIZE_CURSOR:
- gdk_cursor_type = GDK_TOP_RIGHT_CORNER;
- break;
- case AWT_N_RESIZE_CURSOR:
- gdk_cursor_type = GDK_TOP_SIDE;
- break;
- case AWT_S_RESIZE_CURSOR:
- gdk_cursor_type = GDK_BOTTOM_SIDE;
- break;
- case AWT_W_RESIZE_CURSOR:
- gdk_cursor_type = GDK_LEFT_SIDE;
- break;
- case AWT_E_RESIZE_CURSOR:
- gdk_cursor_type = GDK_RIGHT_SIDE;
- break;
- case AWT_HAND_CURSOR:
- gdk_cursor_type = GDK_HAND2;
- break;
- case AWT_MOVE_CURSOR:
- gdk_cursor_type = GDK_FLEUR;
- break;
- default:
- gdk_cursor_type = GDK_LEFT_PTR;
- }
-
- gdk_threads_enter ();
-
- widget = GTK_WIDGET(ptr);
-
- gdk_cursor = gdk_cursor_new (gdk_cursor_type);
- gdk_window_set_cursor (widget->window, gdk_cursor);
- gdk_cursor_destroy (gdk_cursor);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetParent
- (JNIEnv *env, jobject obj, jobject parent)
-{
- void *ptr;
- void *parent_ptr;
- GtkWidget *widget;
- GtkWidget *parent_widget;
-
- ptr = NSA_GET_PTR (env, obj);
- parent_ptr = NSA_GET_PTR (env, parent);
-
- gdk_threads_enter ();
-
- widget = GTK_WIDGET (ptr);
- parent_widget = GTK_WIDGET (parent_ptr);
-
- if (widget->parent == NULL)
- {
- if (GTK_IS_WINDOW (parent_widget))
- {
- GList *children = gtk_container_children
- (GTK_CONTAINER (parent_widget));
-
- if (GTK_IS_MENU_BAR (children->data))
- gtk_fixed_put (GTK_FIXED (children->next->data), widget, 0, 0);
- else
- gtk_fixed_put (GTK_FIXED (children->data), widget, 0, 0);
- }
- else
- if (GTK_IS_SCROLLED_WINDOW (parent_widget))
- {
- gtk_scrolled_window_add_with_viewport
- (GTK_SCROLLED_WINDOW (parent_widget), widget);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (widget->parent),
- GTK_SHADOW_NONE);
-
- }
- else
- {
- if (widget->parent == NULL)
- gtk_fixed_put (GTK_FIXED (parent_widget), widget, 0, 0);
- }
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetSensitive
- (JNIEnv *env, jobject obj, jboolean sensitive)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- gtk_widget_set_sensitive (GTK_WIDGET (ptr), sensitive);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetRequestFocus
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gtk_widget_grab_focus (GTK_WIDGET (ptr));
- gdk_threads_leave ();
-}
-
-/*
- * Translate a Java KeyEvent object into a GdkEventKey event, then
- * pass it to the GTK main loop for processing.
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetDispatchKeyEvent
- (JNIEnv *env, jobject obj, jint id, jlong when, jint mods,
- jint keyCode, jint keyLocation)
-{
- void *ptr;
- GdkEvent *event = NULL;
- GdkKeymapKey *keymap_keys = NULL;
- gint n_keys = 0;
- guint lookup_keyval = 0;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- if (id == AWT_KEY_PRESSED)
- event = gdk_event_new (GDK_KEY_PRESS);
- else if (id == AWT_KEY_RELEASED)
- event = gdk_event_new (GDK_KEY_RELEASE);
- else
- {
- gdk_threads_leave ();
- /* Don't send AWT KEY_TYPED events to GTK. */
- return;
- }
-
- if (GTK_IS_BUTTON (ptr))
- event->key.window = GTK_BUTTON (ptr)->event_window;
- else if (GTK_IS_SCROLLED_WINDOW (ptr))
- event->key.window = GTK_WIDGET (GTK_SCROLLED_WINDOW (ptr)->container.child)->window;
- else
- event->key.window = GTK_WIDGET (ptr)->window;
-
- event->key.send_event = 0;
- event->key.time = (guint32) when;
-
- if (mods & AWT_SHIFT_DOWN_MASK)
- event->key.state |= GDK_SHIFT_MASK;
- if (mods & AWT_CTRL_DOWN_MASK)
- event->key.state |= GDK_CONTROL_MASK;
- if (mods & AWT_ALT_DOWN_MASK)
- event->key.state |= GDK_MOD1_MASK;
-
- /* This hack is needed because the AWT has no notion of num lock.
- It infers numlock state from the only Java virtual keys that are
- affected by it. */
- if (keyCode == VK_NUMPAD9
- || keyCode == VK_NUMPAD8
- || keyCode == VK_NUMPAD7
- || keyCode == VK_NUMPAD6
- || keyCode == VK_NUMPAD5
- || keyCode == VK_NUMPAD4
- || keyCode == VK_NUMPAD3
- || keyCode == VK_NUMPAD2
- || keyCode == VK_NUMPAD1
- || keyCode == VK_NUMPAD0
- || keyCode == VK_DECIMAL)
- event->key.state |= GDK_MOD2_MASK;
-
- /* These values don't need to be filled in since GTK doesn't use
- them. */
- event->key.length = 0;
- event->key.string = NULL;
-
- lookup_keyval = awt_keycode_to_keysym (keyCode, keyLocation);
-
- if (!gdk_keymap_get_entries_for_keyval (gdk_keymap_get_default (),
- lookup_keyval,
- &keymap_keys,
- &n_keys))
- {
- /* No matching keymap entry was found. */
- g_printerr ("No matching keymap entries were found\n");
- gdk_threads_leave ();
- return;
- }
-
- /* Note: if n_keys > 1 then there are multiple hardware keycodes
- that translate to lookup_keyval. We arbitrarily choose the first
- hardware keycode from the list returned by
- gdk_keymap_get_entries_for_keyval. */
-
- event->key.hardware_keycode = keymap_keys[0].keycode;
- event->key.group = keymap_keys[0].group;
-
- g_free (keymap_keys);
-
- if (!gdk_keymap_translate_keyboard_state (gdk_keymap_get_default (),
- event->key.hardware_keycode,
- event->key.state,
- event->key.group,
- &event->key.keyval,
- NULL, NULL, NULL))
- {
- /* No matching keyval was found. */
- g_printerr ("No matching keyval was found\n");
- gdk_threads_leave ();
- return;
- }
-
- /* keyevent = (GdkEventKey *) event; */
- /* g_printerr ("generated event: sent: %d time: %d state: %d keyval: %d length: %d string: %s hardware_keycode: %d group: %d\n", keyevent->send_event, keyevent->time, keyevent->state, keyevent->keyval, keyevent->length, keyevent->string, keyevent->hardware_keycode, keyevent->group); */
-
- /* We already received the original key event on the window itself,
- so we don't want to resend it. */
- if (!GTK_IS_WINDOW (ptr))
- {
- if (GTK_IS_SCROLLED_WINDOW (ptr))
- gtk_widget_event (GTK_WIDGET (GTK_SCROLLED_WINDOW (ptr)->container.child), event);
- else
- gtk_widget_event (GTK_WIDGET (ptr), event);
- }
-
- gdk_threads_leave ();
-}
-
-/*
- * Find the origin of a widget's window.
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetLocationOnScreen
- (JNIEnv * env, jobject obj, jintArray jpoint)
-{
- void *ptr;
- jint *point;
-
- ptr = NSA_GET_PTR (env, obj);
- point = (*env)->GetIntArrayElements (env, jpoint, 0);
-
- gdk_threads_enter ();
-
- gdk_window_get_origin (GTK_WIDGET (ptr)->window, point, point+1);
-
- if (!GTK_IS_CONTAINER (ptr))
- {
- *point += GTK_WIDGET(ptr)->allocation.x;
- *(point+1) += GTK_WIDGET(ptr)->allocation.y;
- }
-
- gdk_threads_leave ();
-
- (*env)->ReleaseIntArrayElements(env, jpoint, point, 0);
-}
-
-/*
- * Find this widget's current size.
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetDimensions
- (JNIEnv *env, jobject obj, jintArray jdims)
-{
- void *ptr;
- jint *dims;
- GtkRequisition requisition;
-
- ptr = NSA_GET_PTR (env, obj);
-
- dims = (*env)->GetIntArrayElements (env, jdims, 0);
- dims[0] = dims[1] = 0;
-
- gdk_threads_enter ();
-
- gtk_widget_size_request (GTK_WIDGET (ptr), &requisition);
-
- dims[0] = requisition.width;
- dims[1] = requisition.height;
-
- gdk_threads_leave ();
-
- (*env)->ReleaseIntArrayElements (env, jdims, dims, 0);
-}
-
-/*
- * Find this widget's preferred size.
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetPreferredDimensions
- (JNIEnv *env, jobject obj, jintArray jdims)
-{
- void *ptr;
- jint *dims;
- GtkRequisition current_req;
- GtkRequisition natural_req;
-
- ptr = NSA_GET_PTR (env, obj);
-
- dims = (*env)->GetIntArrayElements (env, jdims, 0);
- dims[0] = dims[1] = 0;
-
- gdk_threads_enter ();
-
- /* Widgets that extend GtkWindow such as GtkFileChooserDialog may have
- a default size. These values seem more useful then the natural
- requisition values, particularly for GtkFileChooserDialog. */
- if (GTK_IS_WINDOW (ptr))
- {
- gint width, height;
- gtk_window_get_default_size (GTK_WINDOW (ptr), &width, &height);
-
- dims[0] = width;
- dims[1] = height;
- }
- else
- {
- /* Save the widget's current size request. */
- gtk_widget_size_request (GTK_WIDGET (ptr), &current_req);
-
- /* Get the widget's "natural" size request. */
- gtk_widget_set_size_request (GTK_WIDGET (ptr), -1, -1);
- gtk_widget_size_request (GTK_WIDGET (ptr), &natural_req);
-
- /* Reset the widget's size request. */
- gtk_widget_set_size_request (GTK_WIDGET (ptr),
- current_req.width, current_req.height);
-
- dims[0] = natural_req.width;
- dims[1] = natural_req.height;
- }
-
- gdk_threads_leave ();
-
- (*env)->ReleaseIntArrayElements (env, jdims, dims, 0);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_setNativeBounds
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
-{
- GtkWidget *widget;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- widget = GTK_WIDGET (ptr);
-
- /* We assume that -1 is a width or height and not a request for the
- widget's natural size. */
- width = width < 0 ? 0 : width;
- height = height < 0 ? 0 : height;
-
- if (GTK_IS_VIEWPORT (widget->parent))
- gtk_widget_set_size_request (widget, width, height);
- else
- {
- if (!(width == 0 && height == 0))
- {
- gtk_widget_set_size_request (widget, width, height);
- if (widget->parent != NULL)
- gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
- }
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT jintArray JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetBackground
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- jintArray array;
- int *rgb;
- GdkColor bg;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- bg = GTK_WIDGET (ptr)->style->bg[GTK_STATE_NORMAL];
- gdk_threads_leave ();
-
- array = (*env)->NewIntArray (env, 3);
- rgb = (*env)->GetIntArrayElements (env, array, NULL);
- /* convert color data from 16 bit values down to 8 bit values */
- rgb[0] = bg.red >> 8;
- rgb[1] = bg.green >> 8;
- rgb[2] = bg.blue >> 8;
- (*env)->ReleaseIntArrayElements (env, array, rgb, 0);
-
- return array;
-}
-
-JNIEXPORT jintArray JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetForeground
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- jintArray array;
- jint *rgb;
- GdkColor fg;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- fg = GTK_WIDGET (ptr)->style->fg[GTK_STATE_NORMAL];
- gdk_threads_leave ();
-
- array = (*env)->NewIntArray (env, 3);
- rgb = (*env)->GetIntArrayElements (env, array, NULL);
- /* convert color data from 16 bit values down to 8 bit values */
- rgb[0] = fg.red >> 8;
- rgb[1] = fg.green >> 8;
- rgb[2] = fg.blue >> 8;
- (*env)->ReleaseIntArrayElements (env, array, rgb, 0);
-
- return array;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetBackground
- (JNIEnv *env, jobject obj, jint red, jint green, jint blue)
-{
- GdkColor normal_color;
- GdkColor active_color;
- GtkWidget *widget;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- normal_color.red = (red / 255.0) * 65535;
- normal_color.green = (green / 255.0) * 65535;
- normal_color.blue = (blue / 255.0) * 65535;
-
- /* This calculation only approximates the active colors produced by
- Sun's AWT. */
- active_color.red = 0.85 * (red / 255.0) * 65535;
- active_color.green = 0.85 * (green / 255.0) * 65535;
- active_color.blue = 0.85 * (blue / 255.0) * 65535;
-
- gdk_threads_enter ();
-
- widget = find_bg_color_widget (GTK_WIDGET (ptr));
-
- gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &normal_color);
- gtk_widget_modify_bg (widget, GTK_STATE_ACTIVE, &active_color);
- gtk_widget_modify_bg (widget, GTK_STATE_PRELIGHT, &normal_color);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetForeground
- (JNIEnv *env, jobject obj, jint red, jint green, jint blue)
-{
- GdkColor color;
- GtkWidget *widget;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- color.red = (red / 255.0) * 65535;
- color.green = (green / 255.0) * 65535;
- color.blue = (blue / 255.0) * 65535;
-
- gdk_threads_enter ();
-
- widget = find_fg_color_widget (GTK_WIDGET (ptr));
-
- gtk_widget_modify_fg (widget, GTK_STATE_NORMAL, &color);
- gtk_widget_modify_fg (widget, GTK_STATE_ACTIVE, &color);
- gtk_widget_modify_fg (widget, GTK_STATE_PRELIGHT, &color);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_show
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter();
- gtk_widget_show (GTK_WIDGET (ptr));
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_hide
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter();
- gtk_widget_hide (GTK_WIDGET (ptr));
- gdk_threads_leave();
-}
-
-JNIEXPORT jboolean JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_isEnabled
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- jboolean ret_val;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- ret_val = GTK_WIDGET_IS_SENSITIVE (GTK_WIDGET (ptr));
- gdk_threads_leave ();
-
- return ret_val;
-}
-
-JNIEXPORT jboolean JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_isRealized
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- jboolean ret_val;
-
- ptr = NSA_GET_PTR (env, obj);
-
- if (ptr == NULL)
- return FALSE;
-
- gdk_threads_enter ();
- ret_val = GTK_WIDGET_REALIZED (GTK_WIDGET (ptr));
- gdk_threads_leave ();
-
- return ret_val;
-}
-
-JNIEXPORT jboolean JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_modalHasGrab
- (JNIEnv *env __attribute__((unused)), jclass clazz __attribute__((unused)))
-{
- GtkWidget *widget;
- jboolean retval;
-
- gdk_threads_enter ();
- widget = gtk_grab_get_current ();
- retval = (widget && GTK_IS_WINDOW (widget) && GTK_WINDOW (widget)->modal);
- gdk_threads_leave ();
-
- return retval;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- jobject *gref;
-
- ptr = NSA_GET_PTR (env, obj);
- gref = NSA_GET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- /* Connect EVENT signal, which happens _before_ any specific signal. */
-
- g_signal_connect (GTK_OBJECT (ptr), "event",
- G_CALLBACK (pre_event_handler), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "focus-in-event",
- G_CALLBACK (focus_in_cb), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "focus-out-event",
- G_CALLBACK (focus_out_cb), *gref);
-
- g_signal_connect_after (G_OBJECT (ptr), "realize",
- G_CALLBACK (connect_awt_hook_cb), *gref);
-
- gdk_threads_leave ();
-}
-
-static GtkWidget *
-find_fg_color_widget (GtkWidget *widget)
-{
- GtkWidget *fg_color_widget;
-
- if (GTK_IS_EVENT_BOX (widget)
- || (GTK_IS_BUTTON (widget)
- && !GTK_IS_OPTION_MENU (widget)))
- fg_color_widget = gtk_bin_get_child (GTK_BIN(widget));
- else
- fg_color_widget = widget;
-
- return fg_color_widget;
-}
-
-static GtkWidget *
-find_bg_color_widget (GtkWidget *widget)
-{
- GtkWidget *bg_color_widget;
-
- bg_color_widget = widget;
-
- return bg_color_widget;
-}
-
-static gboolean
-focus_in_cb (GtkWidget *widget __attribute((unused)),
- GdkEventFocus *event __attribute((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postFocusEventID,
- AWT_FOCUS_GAINED,
- JNI_FALSE);
- gdk_threads_enter ();
- return FALSE;
-}
-
-static gboolean
-focus_out_cb (GtkWidget *widget __attribute((unused)),
- GdkEventFocus *event __attribute((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postFocusEventID,
- AWT_FOCUS_LOST,
- JNI_FALSE);
- gdk_threads_enter ();
- return FALSE;
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
deleted file mode 100644
index 3fa0c21e6c6..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c -- Native
- implementation of GtkEmbeddedWindowPeer
- Copyright (C) 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create
- (JNIEnv *env, jobject obj, jlong socket_id)
-{
- GtkWidget *window;
- GtkWidget *fixed;
-
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- window = gtk_plug_new ((GdkNativeWindow) socket_id);
-
- fixed = gtk_fixed_new ();
- gtk_container_add (GTK_CONTAINER (window), fixed);
-
- gtk_widget_show (fixed);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, window);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_construct
- (JNIEnv *env, jobject obj, jlong socket_id)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- if (GTK_WIDGET_REALIZED (GTK_WIDGET (ptr)))
- g_printerr ("ERROR: GtkPlug is already realized\n");
-
- gtk_plug_construct (GTK_PLUG (ptr), (GdkNativeWindow) socket_id);
-
- gdk_threads_leave ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
deleted file mode 100644
index c45c672fec0..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+++ /dev/null
@@ -1,1176 +0,0 @@
-/* gtkevents.c -- GDK/GTK event handlers
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 <X11/Xlib.h>
-#include <gdk/gdkkeysyms.h>
-#include <stdarg.h>
-#include <assert.h>
-
-/* A widget can be composed of multipled windows, so we need to hook
- events on all of them. */
-struct event_hook_info
-{
- jobject *peer_obj;
- int nwindows;
- /* array of pointers to (GdkWindow *) */
- GdkWindow ***windows;
-};
-
-static jint
-button_to_awt_mods (int button)
-{
- switch (button)
- {
- case 1:
- return AWT_BUTTON1_MASK;
- case 2:
- return AWT_BUTTON2_MASK;
- case 3:
- return AWT_BUTTON3_MASK;
- }
-
- return 0;
-}
-
-static jint
-state_to_awt_mods (guint state)
-{
- jint result = 0;
-
- if (state & GDK_SHIFT_MASK)
- result |= AWT_SHIFT_DOWN_MASK;
- if (state & GDK_CONTROL_MASK)
- result |= AWT_CTRL_DOWN_MASK;
- if (state & GDK_MOD1_MASK)
- result |= AWT_ALT_DOWN_MASK;
-
- return result;
-}
-
-static jint
-state_to_awt_mods_with_button_states (guint state)
-{
- jint result = 0;
-
- if (state & GDK_SHIFT_MASK)
- result |= AWT_SHIFT_DOWN_MASK;
- if (state & GDK_CONTROL_MASK)
- result |= AWT_CTRL_DOWN_MASK;
- if (state & GDK_MOD1_MASK)
- result |= AWT_ALT_DOWN_MASK;
- if (state & GDK_BUTTON1_MASK)
- result |= AWT_BUTTON1_DOWN_MASK;
- if (state & GDK_BUTTON2_MASK)
- result |= AWT_BUTTON2_DOWN_MASK;
- if (state & GDK_BUTTON3_MASK)
- result |= AWT_BUTTON3_DOWN_MASK;
-
- return result;
-}
-
-/* Modifier key events need special treatment. In Sun's peer
- implementation, when a modifier key is pressed, the KEY_PRESSED
- event has that modifier in its modifiers list. The corresponding
- KEY_RELEASED event's modifier list does not contain the modifier.
- For example, pressing and releasing the shift key will produce a
- key press event with modifiers=Shift, and a key release event with
- no modifiers. GDK's key events behave in the exact opposite way,
- so this translation code is needed. */
-jint
-keyevent_state_to_awt_mods (GdkEvent *event)
-{
- jint result = 0;
- guint state;
-
- if (event->type == GDK_KEY_PRESS)
- {
- state = event->key.state;
-
- if (event->key.keyval == GDK_Shift_L
- || event->key.keyval == GDK_Shift_R)
- result |= AWT_SHIFT_DOWN_MASK;
- else
- {
- if (state & GDK_SHIFT_MASK)
- result |= AWT_SHIFT_DOWN_MASK;
- }
-
- if (event->key.keyval == GDK_Control_L
- || event->key.keyval == GDK_Control_R)
- result |= AWT_CTRL_DOWN_MASK;
- else
- {
- if (state & GDK_CONTROL_MASK)
- result |= AWT_CTRL_DOWN_MASK;
- }
-
- if (event->key.keyval == GDK_Alt_L
- || event->key.keyval == GDK_Alt_R)
- result |= AWT_ALT_DOWN_MASK;
- else
- {
- if (state & GDK_MOD1_MASK)
- result |= AWT_ALT_DOWN_MASK;
- }
- }
- else if (event->type == GDK_KEY_RELEASE)
- {
- state = event->key.state;
-
- if (event->key.keyval != GDK_Shift_L
- && event->key.keyval != GDK_Shift_R)
- {
- if (state & GDK_SHIFT_MASK)
- result |= AWT_SHIFT_DOWN_MASK;
- }
- if (event->key.keyval != GDK_Control_L
- && event->key.keyval != GDK_Control_R)
- {
- if (state & GDK_CONTROL_MASK)
- result |= AWT_CTRL_DOWN_MASK;
- }
-
- if (event->key.keyval != GDK_Alt_L
- && event->key.keyval != GDK_Alt_R)
- {
- if (state & GDK_MOD1_MASK)
- result |= AWT_ALT_DOWN_MASK;
- }
- }
-
- return result;
-}
-
-/* Get the first keyval in the keymap for this event's keycode. The
- first keyval corresponds roughly to Java's notion of a virtual
- key. Returns the uppercase version of the first keyval. */
-static guint
-get_first_keyval_from_keymap (GdkEvent *event)
-{
- guint keyval;
- guint *keyvals;
- gint n_entries;
-
- if (!gdk_keymap_get_entries_for_keycode (NULL,
- event->key.hardware_keycode,
- NULL,
- &keyvals,
- &n_entries))
- {
- g_warning ("No keyval found for hardware keycode %d\n",
- event->key.hardware_keycode);
- /* Try to recover by using the keyval in the event structure. */
- keyvals = &(event->key.keyval);
- }
- keyval = keyvals[0];
- g_free (keyvals);
-
- return gdk_keyval_to_upper (keyval);
-}
-
-#ifdef __GNUC__
-__inline
-#endif
-static jint
-keysym_to_awt_keycode (GdkEvent *event)
-{
- guint ukeyval;
- guint state;
-
- ukeyval = get_first_keyval_from_keymap (event);
- state = event->key.state;
-
- /* VK_A through VK_Z */
- if (ukeyval >= GDK_A && ukeyval <= GDK_Z)
- return ukeyval;
-
- /* VK_0 through VK_9 */
- if (ukeyval >= GDK_0 && ukeyval <= GDK_9)
- return ukeyval;
-
- switch (ukeyval)
- {
- case GDK_Return:
- case GDK_KP_Enter:
- return VK_ENTER;
- case GDK_BackSpace:
- return VK_BACK_SPACE;
- case GDK_Tab:
- return VK_TAB;
- case GDK_Cancel:
- return VK_CANCEL;
- case GDK_Clear:
- return VK_CLEAR;
- case GDK_Shift_L:
- case GDK_Shift_R:
- return VK_SHIFT;
- case GDK_Control_L:
- case GDK_Control_R:
- return VK_CONTROL;
- case GDK_Alt_L:
- case GDK_Alt_R:
- return VK_ALT;
- case GDK_Pause:
- return VK_PAUSE;
- case GDK_Caps_Lock:
- return VK_CAPS_LOCK;
- case GDK_Escape:
- return VK_ESCAPE;
- case GDK_space:
- return VK_SPACE;
- case GDK_KP_Page_Up:
- /* For keys on the numeric keypad, the JVM produces one of two
- virtual keys, depending on the num lock state. */
- if (state & GDK_MOD2_MASK)
- return VK_NUMPAD9;
- else
- return VK_PAGE_UP;
- case GDK_Page_Up:
- return VK_PAGE_UP;
- case GDK_KP_Page_Down:
- if (state & GDK_MOD2_MASK)
- return VK_NUMPAD3;
- else
- return VK_PAGE_DOWN;
- case GDK_Page_Down:
- return VK_PAGE_DOWN;
- case GDK_KP_End:
- if (state & GDK_MOD2_MASK)
- return VK_NUMPAD1;
- else
- return VK_END;
- case GDK_End:
- return VK_END;
- case GDK_KP_Home:
- if (state & GDK_MOD2_MASK)
- return VK_NUMPAD7;
- else
- return VK_HOME;
- case GDK_Home:
- return VK_HOME;
- case GDK_KP_Begin:
- if (state & GDK_MOD2_MASK)
- return VK_NUMPAD5;
- else
- return VK_UNDEFINED;
- case GDK_Left:
- return VK_LEFT;
- case GDK_Up:
- return VK_UP;
- case GDK_Right:
- return VK_RIGHT;
- case GDK_Down:
- return VK_DOWN;
- case GDK_comma:
- return VK_COMMA;
- case GDK_minus:
- return VK_MINUS;
- case GDK_period:
- return VK_PERIOD;
- case GDK_slash:
- return VK_SLASH;
- /*
- return VK_0;
- return VK_1;
- return VK_2;
- return VK_3;
- return VK_4;
- return VK_5;
- return VK_6;
- return VK_7;
- return VK_8;
- return VK_9;
- */
- case GDK_semicolon:
- return VK_SEMICOLON;
- case GDK_equal:
- return VK_EQUALS;
- /*
- return VK_A;
- return VK_B;
- return VK_C;
- return VK_D;
- return VK_E;
- return VK_F;
- return VK_G;
- return VK_H;
- return VK_I;
- return VK_J;
- return VK_K;
- return VK_L;
- return VK_M;
- return VK_N;
- return VK_O;
- return VK_P;
- return VK_Q;
- return VK_R;
- return VK_S;
- return VK_T;
- return VK_U;
- return VK_V;
- return VK_W;
- return VK_X;
- return VK_Y;
- return VK_Z;
- */
- case GDK_bracketleft:
- return VK_OPEN_BRACKET;
- case GDK_backslash:
- return VK_BACK_SLASH;
- case GDK_bracketright:
- return VK_CLOSE_BRACKET;
- case GDK_KP_0:
- return VK_NUMPAD0;
- case GDK_KP_1:
- return VK_NUMPAD1;
- case GDK_KP_2:
- return VK_NUMPAD2;
- case GDK_KP_3:
- return VK_NUMPAD3;
- case GDK_KP_4:
- return VK_NUMPAD4;
- case GDK_KP_5:
- return VK_NUMPAD5;
- case GDK_KP_6:
- return VK_NUMPAD6;
- case GDK_KP_7:
- return VK_NUMPAD7;
- case GDK_KP_8:
- return VK_NUMPAD8;
- case GDK_KP_9:
- return VK_NUMPAD9;
- case GDK_KP_Multiply:
- return VK_MULTIPLY;
- case GDK_KP_Add:
- return VK_ADD;
- /*
- return VK_SEPARATER;
- */
- case GDK_KP_Separator:
- return VK_SEPARATOR;
- case GDK_KP_Subtract:
- return VK_SUBTRACT;
- case GDK_KP_Decimal:
- return VK_DECIMAL;
- case GDK_KP_Divide:
- return VK_DIVIDE;
- case GDK_KP_Delete:
- if (state & GDK_MOD2_MASK)
- return VK_DECIMAL;
- else
- return VK_DELETE;
- case GDK_Delete:
- return VK_DELETE;
- case GDK_Num_Lock:
- return VK_NUM_LOCK;
- case GDK_Scroll_Lock:
- return VK_SCROLL_LOCK;
- case GDK_F1:
- return VK_F1;
- case GDK_F2:
- return VK_F2;
- case GDK_F3:
- return VK_F3;
- case GDK_F4:
- return VK_F4;
- case GDK_F5:
- return VK_F5;
- case GDK_F6:
- return VK_F6;
- case GDK_F7:
- return VK_F7;
- case GDK_F8:
- return VK_F8;
- case GDK_F9:
- return VK_F9;
- case GDK_F10:
- return VK_F10;
- case GDK_F11:
- return VK_F11;
- case GDK_F12:
- return VK_F12;
- case GDK_F13:
- return VK_F13;
- case GDK_F14:
- return VK_F14;
- case GDK_F15:
- return VK_F15;
- case GDK_F16:
- return VK_F16;
- case GDK_F17:
- return VK_F17;
- case GDK_F18:
- return VK_F18;
- case GDK_F19:
- return VK_F19;
- case GDK_F20:
- return VK_F20;
- case GDK_F21:
- return VK_F21;
- case GDK_F22:
- return VK_F22;
- case GDK_F23:
- return VK_F23;
- case GDK_F24:
- return VK_F24;
- case GDK_Print:
- return VK_PRINTSCREEN;
- case GDK_KP_Insert:
- if (state & GDK_MOD2_MASK)
- return VK_NUMPAD0;
- else
- return VK_INSERT;
- case GDK_Insert:
- return VK_INSERT;
- case GDK_Help:
- return VK_HELP;
- case GDK_Meta_L:
- case GDK_Meta_R:
- return VK_META;
- case GDK_grave:
- return VK_BACK_QUOTE;
- case GDK_apostrophe:
- return VK_QUOTE;
- case GDK_KP_Up:
- if (state & GDK_MOD2_MASK)
- return VK_NUMPAD8;
- else
- return VK_KP_UP;
- case GDK_KP_Down:
- if (state & GDK_MOD2_MASK)
- return VK_NUMPAD2;
- else
- return VK_KP_DOWN;
- case GDK_KP_Left:
- if (state & GDK_MOD2_MASK)
- return VK_NUMPAD4;
- else
- return VK_KP_LEFT;
- case GDK_KP_Right:
- if (state & GDK_MOD2_MASK)
- return VK_NUMPAD6;
- else
- return VK_KP_RIGHT;
- case GDK_dead_grave:
- return VK_DEAD_GRAVE;
- case GDK_dead_acute:
- return VK_DEAD_ACUTE;
- case GDK_dead_circumflex:
- return VK_DEAD_CIRCUMFLEX;
- case GDK_dead_tilde:
- return VK_DEAD_TILDE;
- case GDK_dead_macron:
- return VK_DEAD_MACRON;
- case GDK_dead_breve:
- return VK_DEAD_BREVE;
- case GDK_dead_abovedot:
- return VK_DEAD_ABOVEDOT;
- case GDK_dead_diaeresis:
- return VK_DEAD_DIAERESIS;
- case GDK_dead_abovering:
- return VK_DEAD_ABOVERING;
- case GDK_dead_doubleacute:
- return VK_DEAD_DOUBLEACUTE;
- case GDK_dead_caron:
- return VK_DEAD_CARON;
- case GDK_dead_cedilla:
- return VK_DEAD_CEDILLA;
- case GDK_dead_ogonek:
- return VK_DEAD_OGONEK;
- case GDK_dead_iota:
- return VK_DEAD_IOTA;
- case GDK_dead_voiced_sound:
- return VK_DEAD_VOICED_SOUND;
- case GDK_dead_semivoiced_sound:
- return VK_DEAD_SEMIVOICED_SOUND;
- case GDK_ampersand:
- return VK_AMPERSAND;
- case GDK_asterisk:
- return VK_ASTERISK;
- case GDK_quotedbl:
- return VK_QUOTEDBL;
- case GDK_less:
- return VK_LESS;
- case GDK_greater:
- return VK_GREATER;
- case GDK_braceleft:
- return VK_BRACELEFT;
- case GDK_braceright:
- return VK_BRACERIGHT;
- case GDK_at:
- return VK_AT;
- case GDK_colon:
- return VK_COLON;
- case GDK_asciicircum:
- return VK_CIRCUMFLEX;
- case GDK_dollar:
- return VK_DOLLAR;
- case GDK_EuroSign:
- return VK_EURO_SIGN;
- case GDK_exclam:
- return VK_EXCLAMATION_MARK;
- case GDK_exclamdown:
- return VK_INVERTED_EXCLAMATION_MARK;
- case GDK_parenleft:
- return VK_LEFT_PARENTHESIS;
- case GDK_numbersign:
- return VK_NUMBER_SIGN;
- case GDK_plus:
- return VK_PLUS;
- case GDK_parenright:
- return VK_RIGHT_PARENTHESIS;
- case GDK_underscore:
- return VK_UNDERSCORE;
- /*
- return VK_FINAL;
- return VK_CONVERT;
- return VK_NONCONVERT;
- return VK_ACCEPT;
- */
- case GDK_Mode_switch:
- return VK_MODECHANGE;
- /*
- return VK_KANA;
- */
- case GDK_Kanji:
- return VK_KANJI;
- /*
- return VK_ALPHANUMERIC;
- */
- case GDK_Katakana:
- return VK_KATAKANA;
- case GDK_Hiragana:
- return VK_HIRAGANA;
- /*
- return VK_FULL_WIDTH;
- return VK_HALF_WIDTH;
- return VK_ROMAN_CHARACTERS;
- return VK_ALL_CANDIDATES;
- */
- case GDK_PreviousCandidate:
- return VK_PREVIOUS_CANDIDATE;
- case GDK_Codeinput:
- return VK_CODE_INPUT;
- /*
- return VK_JAPANESE_KATAKANA;
- return VK_JAPANESE_HIRAGANA;
- return VK_JAPANESE_ROMAN;
- */
- case GDK_Kana_Lock:
- return VK_KANA_LOCK;
- /*
- return VK_INPUT_METHOD_ON_OFF;
- return VK_CUT;
- return VK_COPY;
- return VK_PASTE;
- return VK_UNDO;
- return VK_AGAIN;
- return VK_FIND;
- return VK_PROPS;
- return VK_STOP;
- return VK_COMPOSE;
- return VK_ALT_GRAPH;
- */
- default:
- return VK_UNDEFINED;
- }
-}
-
-static jint
-keysym_to_awt_keylocation (GdkEvent *event)
-{
- guint ukeyval;
-
- ukeyval = get_first_keyval_from_keymap (event);
-
- /* VK_A through VK_Z */
- if (ukeyval >= GDK_A && ukeyval <= GDK_Z)
- return AWT_KEY_LOCATION_STANDARD;
-
- /* VK_0 through VK_9 */
- if (ukeyval >= GDK_0 && ukeyval <= GDK_9)
- return AWT_KEY_LOCATION_STANDARD;
-
- switch (ukeyval)
- {
- case GDK_Shift_L:
- case GDK_Control_L:
- case GDK_Alt_L:
- case GDK_Meta_L:
- return AWT_KEY_LOCATION_LEFT;
-
- case GDK_Shift_R:
- case GDK_Control_R:
- case GDK_Alt_R:
- case GDK_Meta_R:
- return AWT_KEY_LOCATION_RIGHT;
-
- case GDK_Return:
- case GDK_BackSpace:
- case GDK_Tab:
- case GDK_Cancel:
- case GDK_Clear:
- case GDK_Pause:
- case GDK_Caps_Lock:
- case GDK_Escape:
- case GDK_space:
- case GDK_Page_Up:
- case GDK_Page_Down:
- case GDK_End:
- case GDK_Home:
- case GDK_Left:
- case GDK_Up:
- case GDK_Right:
- case GDK_Down:
- case GDK_comma:
- case GDK_minus:
- case GDK_period:
- case GDK_slash:
- case GDK_semicolon:
- case GDK_equal:
- case GDK_bracketleft:
- case GDK_backslash:
- case GDK_bracketright:
- case GDK_Delete:
- case GDK_Scroll_Lock:
- case GDK_F1:
- case GDK_F2:
- case GDK_F3:
- case GDK_F4:
- case GDK_F5:
- case GDK_F6:
- case GDK_F7:
- case GDK_F8:
- case GDK_F9:
- case GDK_F10:
- case GDK_F11:
- case GDK_F12:
- case GDK_F13:
- case GDK_F14:
- case GDK_F15:
- case GDK_F16:
- case GDK_F17:
- case GDK_F18:
- case GDK_F19:
- case GDK_F20:
- case GDK_F21:
- case GDK_F22:
- case GDK_F23:
- case GDK_F24:
- case GDK_Print:
- case GDK_Insert:
- case GDK_Help:
- case GDK_grave:
- case GDK_apostrophe:
- case GDK_dead_grave:
- case GDK_dead_acute:
- case GDK_dead_circumflex:
- case GDK_dead_tilde:
- case GDK_dead_macron:
- case GDK_dead_breve:
- case GDK_dead_abovedot:
- case GDK_dead_diaeresis:
- case GDK_dead_abovering:
- case GDK_dead_doubleacute:
- case GDK_dead_caron:
- case GDK_dead_cedilla:
- case GDK_dead_ogonek:
- case GDK_dead_iota:
- case GDK_dead_voiced_sound:
- case GDK_dead_semivoiced_sound:
- case GDK_ampersand:
- case GDK_asterisk:
- case GDK_quotedbl:
- case GDK_less:
- case GDK_greater:
- case GDK_braceleft:
- case GDK_braceright:
- case GDK_at:
- case GDK_colon:
- case GDK_asciicircum:
- case GDK_dollar:
- case GDK_EuroSign:
- case GDK_exclam:
- case GDK_exclamdown:
- case GDK_parenleft:
- case GDK_numbersign:
- case GDK_plus:
- case GDK_parenright:
- case GDK_underscore:
- case GDK_Mode_switch:
- case GDK_Kanji:
- case GDK_Katakana:
- case GDK_Hiragana:
- case GDK_PreviousCandidate:
- case GDK_Codeinput:
- case GDK_Kana_Lock:
- return AWT_KEY_LOCATION_STANDARD;
-
- case GDK_KP_Enter:
- case GDK_KP_Page_Up:
- case GDK_KP_Page_Down:
- case GDK_KP_End:
- case GDK_KP_Home:
- case GDK_KP_Begin:
- case GDK_KP_0:
- case GDK_KP_1:
- case GDK_KP_2:
- case GDK_KP_3:
- case GDK_KP_4:
- case GDK_KP_5:
- case GDK_KP_6:
- case GDK_KP_7:
- case GDK_KP_8:
- case GDK_KP_9:
- case GDK_KP_Multiply:
- case GDK_KP_Add:
- case GDK_KP_Separator:
- case GDK_KP_Subtract:
- case GDK_KP_Decimal:
- case GDK_KP_Divide:
- case GDK_KP_Delete:
- case GDK_Num_Lock:
- case GDK_KP_Insert:
- case GDK_KP_Up:
- case GDK_KP_Down:
- case GDK_KP_Left:
- case GDK_KP_Right:
- return AWT_KEY_LOCATION_NUMPAD;
-
- default:
- return AWT_KEY_LOCATION_UNKNOWN;
- }
-}
-
-static jchar
-keyevent_to_awt_keychar (GdkEvent *event)
-{
- if (event->key.length > 0)
- {
- /* Translate GDK carriage return to Java linefeed. */
- if (event->key.string[0] == 13)
- return VK_ENTER;
- else
- return event->key.string[0];
- }
- else
- {
- switch (event->key.keyval)
- {
- case GDK_BackSpace:
- return VK_BACK_SPACE;
- case GDK_Tab:
- return VK_TAB;
- case GDK_Delete:
- case GDK_KP_Delete:
- return VK_DELETE;
- default:
- return AWT_KEY_CHAR_UNDEFINED;
- }
- }
-}
-
-void
-awt_event_handler (GdkEvent *event)
-{
- /* keep synthetic AWT events from being processed recursively */
- if (event->type & SYNTHETIC_EVENT_MASK && event->type != GDK_NOTHING)
- {
- event->type ^= SYNTHETIC_EVENT_MASK;
- }
-
- gtk_main_do_event (event);
-}
-
-gboolean
-pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
-{
- GtkWidget *event_widget;
- static guint32 button_click_time = 0;
- static GdkWindow *button_window = NULL;
- static guint button_number = -1;
- static jint click_count = 1;
- static int hasBeenDragged;
- union widget_union w;
-
- /* If it is not a focus change event, the widget must be realized already.
- If not, ignore the event (Gtk+ will do the same). */
- if (!(event->type == GDK_FOCUS_CHANGE || GTK_WIDGET_REALIZED(widget)))
- return FALSE;
-
- /* Do not handle propagated events. AWT has its own propagation rules */
- w.widget = &event_widget;
- gdk_window_get_user_data (event->any.window, w.void_widget);
- if (event_widget != widget)
- return FALSE;
-
- /* We only care about input events */
- if (!(event->type == GDK_BUTTON_PRESS
- || event->type == GDK_BUTTON_RELEASE
- || event->type == GDK_ENTER_NOTIFY
- || event->type == GDK_LEAVE_NOTIFY
- || event->type == GDK_CONFIGURE
- || event->type == GDK_EXPOSE
- || event->type == GDK_KEY_PRESS
- || event->type == GDK_KEY_RELEASE
- || event->type == GDK_FOCUS_CHANGE
- || event->type == GDK_MOTION_NOTIFY))
- {
- return FALSE;
- }
- /* g_print("event %u widget %s peer %p\n",
- event->type, gtk_widget_get_name (widget), peer); */
-
- /* If it has no jobject associated we can send no AWT event */
- if (!peer)
- return FALSE;
-
- /* for all input events, which have a window with a jobject attached,
- send the AWT input event corresponding to the Gtk event off to Java */
-
- /* keep track of clickCount ourselves, since the AWT allows more
- than a triple click to occur */
- if (event->type == GDK_BUTTON_PRESS)
- {
- if ((event->button.time < (button_click_time + MULTI_CLICK_TIME))
- && (event->button.window == button_window)
- && (event->button.button == button_number))
- click_count++;
- else
- click_count = 1;
-
- button_click_time = event->button.time;
- button_window = event->button.window;
- button_number = event->button.button;
- }
-
- switch (event->type)
- {
- case GDK_BUTTON_PRESS:
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postMouseEventID,
- AWT_MOUSE_PRESSED,
- (jlong)event->button.time,
- state_to_awt_mods (event->button.state)
- | button_to_awt_mods (event->button.button),
- (jint)event->button.x,
- (jint)event->button.y,
- click_count,
- (event->button.button == 3) ? JNI_TRUE :
- JNI_FALSE);
- gdk_threads_enter ();
- hasBeenDragged = FALSE;
- break;
- case GDK_BUTTON_RELEASE:
- {
- int width, height;
-
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postMouseEventID,
- AWT_MOUSE_RELEASED,
- (jlong)event->button.time,
- state_to_awt_mods (event->button.state)
- | button_to_awt_mods (event->button.button),
- (jint)event->button.x,
- (jint)event->button.y,
- click_count,
- JNI_FALSE);
- gdk_threads_enter ();
-
- /* Generate an AWT click event only if the release occured in the
- window it was pressed in, and the mouse has not been dragged since
- the last time it was pressed. */
- gdk_window_get_size (event->any.window, &width, &height);
- if (! hasBeenDragged
- && event->button.x >= 0
- && event->button.y >= 0
- && event->button.x <= width
- && event->button.y <= height)
- {
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postMouseEventID,
- AWT_MOUSE_CLICKED,
- (jlong)event->button.time,
- state_to_awt_mods (event->button.state)
- | button_to_awt_mods (event->button.button),
- (jint)event->button.x,
- (jint)event->button.y,
- click_count,
- JNI_FALSE);
- gdk_threads_enter ();
- }
- }
- break;
- case GDK_MOTION_NOTIFY:
- if (event->motion.state & (GDK_BUTTON1_MASK
- | GDK_BUTTON2_MASK
- | GDK_BUTTON3_MASK
- | GDK_BUTTON4_MASK
- | GDK_BUTTON5_MASK))
- {
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postMouseEventID,
- AWT_MOUSE_DRAGGED,
- (jlong)event->motion.time,
- state_to_awt_mods_with_button_states (event->motion.state),
- (jint)event->motion.x,
- (jint)event->motion.y,
- 0,
- JNI_FALSE);
- gdk_threads_enter ();
- hasBeenDragged = TRUE;
- }
- else
- {
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer, postMouseEventID,
- AWT_MOUSE_MOVED,
- (jlong)event->motion.time,
- state_to_awt_mods (event->motion.state),
- (jint)event->motion.x,
- (jint)event->motion.y,
- 0,
- JNI_FALSE);
- gdk_threads_enter ();
- }
-
- break;
- case GDK_ENTER_NOTIFY:
- /* We are not interested in enter events that are due to
- grab/ungrab and not to actually crossing boundaries */
- if (event->crossing.mode == GDK_CROSSING_NORMAL)
- {
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer, postMouseEventID,
- AWT_MOUSE_ENTERED,
- (jlong)event->crossing.time,
- state_to_awt_mods_with_button_states (event->crossing.state),
- (jint)event->crossing.x,
- (jint)event->crossing.y,
- 0,
- JNI_FALSE);
- gdk_threads_enter ();
- }
- break;
- case GDK_LEAVE_NOTIFY:
- /* We are not interested in leave events that are due to
- grab/ungrab and not to actually crossing boundaries */
- if (event->crossing.mode == GDK_CROSSING_NORMAL)
- {
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postMouseEventID,
- AWT_MOUSE_EXITED,
- (jlong)event->crossing.time,
- state_to_awt_mods_with_button_states (event->crossing.state),
- (jint)event->crossing.x,
- (jint)event->crossing.y,
- 0,
- JNI_FALSE);
- gdk_threads_enter ();
- }
- break;
- case GDK_CONFIGURE:
- {
- /* Only send configure events to visible top-level windows. */
- if (widget && GTK_WIDGET_TOPLEVEL (widget)
- && GTK_WIDGET_VISIBLE (widget))
- {
- /* Configure events are not posted to the AWT event
- queue, and as such, the gdk/gtk peer functions will
- be called back before postConfigureEvent
- returns. */
- gdk_threads_leave ();
-
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postConfigureEventID,
- (jint) event->configure.x,
- (jint) event->configure.y,
- (jint) event->configure.width,
- (jint) event->configure.height);
- gdk_threads_enter ();
- }
- }
- break;
- case GDK_EXPOSE:
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postExposeEventID,
- (jint)event->expose.area.x,
- (jint)event->expose.area.y,
- (jint)event->expose.area.width,
- (jint)event->expose.area.height);
- gdk_threads_enter ();
- break;
-
- case GDK_FOCUS_CHANGE:
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postFocusEventID,
- (jint) (event->focus_change.in) ?
- AWT_FOCUS_GAINED : AWT_FOCUS_LOST,
- JNI_FALSE);
- gdk_threads_enter ();
- break;
- case GDK_KEY_PRESS:
- if (GTK_IS_WINDOW (widget))
- {
- /* GdkEventKey *keyevent = (GdkEventKey *) event; */
- /* g_printerr ("key press event: sent: %d time: %d state: %d keyval: %d length: %d string: %s hardware_keycode: %d group: %d\n", keyevent->send_event, keyevent->time, keyevent->state, keyevent->keyval, keyevent->length, keyevent->string, keyevent->hardware_keycode, keyevent->group); */
-
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postKeyEventID,
- (jint) AWT_KEY_PRESSED,
- (jlong) event->key.time,
- keyevent_state_to_awt_mods (event),
- keysym_to_awt_keycode (event),
- keyevent_to_awt_keychar (event),
- keysym_to_awt_keylocation (event));
- gdk_threads_enter ();
- /* FIXME: generation of key typed events needs to be moved
- to GtkComponentPeer.postKeyEvent. If the key in a key
- press event is not an "action" key
- (KeyEvent.isActionKey) and is not a modifier key, then
- it should generate a key typed event. */
- return TRUE;
- }
- else
- return FALSE;
- break;
- case GDK_KEY_RELEASE:
- if (GTK_IS_WINDOW (widget))
- {
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postKeyEventID,
- (jint) AWT_KEY_RELEASED,
- (jlong) event->key.time,
- keyevent_state_to_awt_mods (event),
- keysym_to_awt_keycode (event),
- keyevent_to_awt_keychar (event),
- keysym_to_awt_keylocation (event));
- gdk_threads_enter ();
- return TRUE;
- }
- else
- return FALSE;
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-static void
-attach_jobject (GdkWindow *window, jobject *obj)
-{
- GdkAtom addr_atom = gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE);
- GdkAtom type_atom = gdk_atom_intern ("CARDINAL", FALSE);
-
- gdk_window_set_events (window,
- gdk_window_get_events (window)
- | GDK_POINTER_MOTION_MASK
- | GDK_BUTTON_MOTION_MASK
- | GDK_BUTTON_PRESS_MASK
- | GDK_BUTTON_RELEASE_MASK
- | GDK_KEY_PRESS_MASK
- | GDK_KEY_RELEASE_MASK
- | GDK_ENTER_NOTIFY_MASK
- | GDK_LEAVE_NOTIFY_MASK
- | GDK_STRUCTURE_MASK
- | GDK_KEY_PRESS_MASK
- | GDK_FOCUS_CHANGE_MASK);
-
- gdk_property_change (window,
- addr_atom,
- type_atom,
- 8,
- GDK_PROP_MODE_REPLACE,
- (guchar *)obj,
- sizeof (jobject));
-}
-
-void
-connect_awt_hook (JNIEnv *env, jobject peer_obj, int nwindows, ...)
-{
- va_list ap;
- jobject *obj;
-
- obj = NSA_GET_GLOBAL_REF (env, peer_obj);
- g_assert (obj);
-
- va_start (ap, nwindows);
- {
- int i;
- for (i = 0; i < nwindows; i++)
- {
- GdkWindow* attach = (va_arg (ap, GdkWindow *));
- attach_jobject(attach, obj);
- }
- }
- va_end (ap);
-}
-
-/*
- * Attach a Java object that is backed by widget. This callback is
- * called after the widget's window has been realized. That way, we
- * can be sure that widget->window is non-NULL, and so can have data
- * connected to it.
- */
-void connect_awt_hook_cb (GtkWidget *widget __attribute__((unused)),
- jobject peer)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (gdk_env(), peer);
-
- connect_awt_hook (gdk_env(), peer, 1, GTK_WIDGET (ptr)->window);
-
- gdk_threads_leave ();
-
- (*gdk_env())->CallVoidMethod (gdk_env(), peer, setCursorID);
-
- gdk_threads_enter ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
deleted file mode 100644
index 85fe3dd6cbf..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
+++ /dev/null
@@ -1,274 +0,0 @@
-/* gtkfiledialogpeer.c -- Native implementation of GtkFileDialogPeer
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
-#include "gnu_java_awt_peer_gtk_GtkFileDialogPeer.h"
-
-static void handle_response (GtkDialog *dialog,
- gint responseId,
- jobject peer_obj);
-
-/*
- * Make a new file selection dialog
- */
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create
- (JNIEnv *env, jobject obj, jobject parent)
-{
- void *parentp;
- gpointer widget;
-
- /* Create global reference and save it for future use */
- NSA_SET_GLOBAL_REF (env, obj);
-
- parentp = NSA_GET_PTR(env, parent);
-
- gdk_threads_enter ();
-
- /* FIXME: we should be using the default gnome-vfs backend but it is
- not currently thread-safe. See:
- http://bugzilla.gnome.org/show_bug.cgi?id=166852 */
- widget = gtk_file_chooser_dialog_new_with_backend
- ("Open File",
- GTK_WINDOW(parentp),
- GTK_FILE_CHOOSER_ACTION_OPEN,
- "gtk+",
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
- NULL);
-
- /* GtkFileSelect is not modal by default */
- gtk_window_set_modal (GTK_WINDOW (widget), TRUE);
-
- /* We must add this window to the group so input in the others are
- disable while it is being shown */
- gtk_window_group_add_window (global_gtk_window_group, GTK_WINDOW (widget));
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, widget);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_connectSignals
- (JNIEnv *env, jobject obj)
-{
- void *ptr = NSA_GET_PTR (env, obj);
- jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
- g_assert (gref);
-
- gdk_threads_enter ();
-
- g_signal_connect (G_OBJECT (GTK_DIALOG (ptr)),
- "response",
- GTK_SIGNAL_FUNC (handle_response), *gref);
-
- gdk_threads_leave ();
-
- /* Connect the superclass signals. */
- Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj);
-}
-
-JNIEXPORT jstring JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeGetDirectory
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- const char *str;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- str = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER(ptr));
-
- gdk_threads_leave ();
-
- return (*env)->NewStringUTF(env, str);
-}
-
-
-/* This function interfaces with the Java callback method of the same name.
- This function extracts the filename from the GtkFileFilterInfo object,
- and passes it to the Java method. The Java method will call the filter's
- accept() method and will give back the return value. */
-static gboolean filenameFilterCallback (const GtkFileFilterInfo *filter_info,
- gpointer obj)
-{
- jclass cx;
- jmethodID id;
- jstring *filename;
- gboolean accepted;
-
- cx = (*gdk_env())->GetObjectClass (gdk_env(), (jobject) obj);
- id = (*gdk_env())->GetMethodID (gdk_env(), cx, "filenameFilterCallback",
- "(Ljava/lang/String;)Z");
-
- filename = (*gdk_env())->NewStringUTF(gdk_env(), filter_info->filename);
-
- gdk_threads_leave();
- accepted = (*gdk_env())->CallBooleanMethod(gdk_env(), obj, id, filename);
- gdk_threads_enter();
-
- return accepted;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFilenameFilter
- (JNIEnv *env, jobject obj, jobject filter_obj __attribute__((unused)))
-{
- void *ptr;
- GtkFileFilter *filter;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- filter = gtk_file_filter_new();
- gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME,
- filenameFilterCallback, obj, NULL);
-
- gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(ptr), filter);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetDirectory
- (JNIEnv *env, jobject obj, jstring directory)
-{
- void *ptr;
- const char *str;
-
- ptr = NSA_GET_PTR (env, obj);
-
- str = (*env)->GetStringUTFChars (env, directory, 0);
-
- gdk_threads_enter ();
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(ptr), str);
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, directory, str);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFile
- (JNIEnv *env, jobject obj, jstring filename)
-{
- void *ptr;
- const char *str;
-
- ptr = NSA_GET_PTR (env, obj);
-
- str = (*env)->GetStringUTFChars (env, filename, 0);
-
- gdk_threads_enter ();
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (ptr), str);
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, filename, str);
-}
-
-static void
-handle_response (GtkDialog *dialog __attribute__((unused)),
- gint responseId,
- jobject peer_obj)
-{
- static int isDisposeIDSet = 0;
- static int isIDSet = 0;
- static jmethodID gtkSetFilenameID;
- static jmethodID hideID;
- static jmethodID disposeID;
- void *ptr;
- G_CONST_RETURN gchar *fileName;
- jstring str_fileName = NULL;
-
- /* We only need this for the case when the user closed the window,
- or clicked ok or cancel. */
- if (responseId != GTK_RESPONSE_DELETE_EVENT
- && responseId != GTK_RESPONSE_ACCEPT
- && responseId != GTK_RESPONSE_CANCEL)
- return;
-
- ptr = NSA_GET_PTR (gdk_env(), peer_obj);
-
- if (responseId == GTK_RESPONSE_DELETE_EVENT)
- {
- if (!isDisposeIDSet)
- {
- jclass cx = (*gdk_env())->GetObjectClass (gdk_env(), peer_obj);
- disposeID = (*gdk_env())->GetMethodID (gdk_env(), cx, "gtkDisposeFileDialog", "()V");
- isDisposeIDSet = 1;
- }
-
- gdk_threads_leave ();
-
- /* We can dispose of the dialog now (and unblock show) */
- (*gdk_env())->CallVoidMethod (gdk_env(), peer_obj, disposeID);
-
- gdk_threads_enter ();
- return;
- }
-
- if (responseId == GTK_RESPONSE_ACCEPT) {
- fileName = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (GTK_WIDGET (ptr)));
- str_fileName = (*gdk_env())->NewStringUTF (gdk_env(), fileName);
- }
-
- if (!isIDSet)
- {
- jclass cx = (*gdk_env())->GetObjectClass (gdk_env(), peer_obj);
- hideID = (*gdk_env())->GetMethodID (gdk_env(), cx, "gtkHideFileDialog", "()V");
- gtkSetFilenameID = (*gdk_env())->GetMethodID (gdk_env(), cx,
- "gtkSetFilename", "(Ljava/lang/String;)V");
- isIDSet = 1;
- }
-
- gdk_threads_leave ();
-
- /* Set the Java object field 'file' with this value. */
- (*gdk_env())->CallVoidMethod (gdk_env(), peer_obj, gtkSetFilenameID, str_fileName);
-
- /* We can hide the dialog now (and unblock show) */
- (*gdk_env())->CallVoidMethod (gdk_env(), peer_obj, hideID);
-
- gdk_threads_enter ();
-}
-
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
deleted file mode 100644
index 9253312f0f6..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/* gtkframepeer.c -- Native implementation of GtkFramePeer
- Copyright (C) 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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 "gnu_java_awt_peer_gtk_GtkFramePeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFramePeer_removeMenuBarPeer
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- void *mptr;
- void *fixed;
- GList* children;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- fixed = gtk_container_get_children (GTK_CONTAINER (ptr))->data;
- children = gtk_container_get_children (GTK_CONTAINER (fixed));
-
- while (children != NULL && !GTK_IS_MENU_SHELL (children->data))
- {
- children = children->next;
- }
-
- /* If there's a menu bar, remove it. */
- if (children != NULL)
- {
- mptr = children->data;
-
- /* This will actually destroy the MenuBar. By removing it from
- its parent, the reference count for the MenuBar widget will
- decrement to 0. The widget will be automatically destroyed by
- GTK. */
- gtk_container_remove (GTK_CONTAINER (fixed), GTK_WIDGET (mptr));
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFramePeer_setMenuBarPeer
- (JNIEnv *env, jobject obj, jobject menubar)
-{
- void *ptr;
- void *mptr;
- void *fixed;
-
- ptr = NSA_GET_PTR (env, obj);
- mptr = NSA_GET_PTR (env, menubar);
-
- gdk_threads_enter ();
-
- fixed = gtk_container_get_children (GTK_CONTAINER (ptr))->data;
- gtk_fixed_put (GTK_FIXED (fixed), mptr, 0, 0);
- gtk_widget_show (mptr);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFramePeer_getMenuBarHeight
- (JNIEnv *env, jobject obj __attribute__((unused)), jobject menubar)
-{
- GtkWidget *ptr;
- GtkRequisition requisition;
-
- ptr = NSA_GET_PTR (env, menubar);
-
- gdk_threads_enter ();
-
- gtk_widget_size_request (ptr, &requisition);
-
- gdk_threads_leave ();
-
- return requisition.height;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFramePeer_setMenuBarWidth
- (JNIEnv *env, jobject obj __attribute__((unused)), jobject menubar, jint width)
-{
- GtkWidget *ptr;
- GtkRequisition natural_req;
-
- ptr = NSA_GET_PTR (env, menubar);
-
- gdk_threads_enter ();
-
- /* Get the menubar's natural size request. */
- gtk_widget_set_size_request (GTK_WIDGET (ptr), -1, -1);
- gtk_widget_size_request (GTK_WIDGET (ptr), &natural_req);
-
- /* Set the menubar's size request to width by natural_req.height. */
- gtk_widget_set_size_request (GTK_WIDGET (ptr),
- width, natural_req.height);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFramePeer_gtkFixedSetVisible
- (JNIEnv *env, jobject obj, jboolean visible)
-{
- void *ptr;
- void *fixed;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- fixed = gtk_container_get_children (GTK_CONTAINER (ptr))->data;
-
- if (visible)
- gtk_widget_show (GTK_WIDGET (fixed));
- else
- gtk_widget_hide (GTK_WIDGET (fixed));
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImageFromDecoder
- (JNIEnv *env, jobject obj, jobject decoder)
-{
- void *ptr;
- GdkPixbufLoader *loader = NULL;
- GdkPixbuf *pixbuf = NULL;
-
- ptr = NSA_GET_PTR (env, obj);
-
- loader = NSA_GET_PB_PTR (env, decoder);
- g_assert (loader != NULL);
-
- gdk_threads_enter ();
-
- pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
- g_assert (pixbuf != NULL);
-
- gtk_window_set_icon (GTK_WINDOW (ptr), pixbuf);
-
- gdk_threads_leave ();
-}
-
-static void
-free_pixbuf_data (guchar *pixels, gpointer data __attribute__((unused)))
-{
- free(pixels);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImageFromData
- (JNIEnv *env, jobject obj, jintArray pixelArray, jint width, jint height)
-{
- void *ptr;
- GdkPixbuf *pixbuf;
- jint *pixels;
- int pixels_length, i;
- guchar *data;
-
- ptr = NSA_GET_PTR (env, obj);
-
- pixels = (*env)->GetIntArrayElements (env, pixelArray, 0);
- pixels_length = (*env)->GetArrayLength (env, pixelArray);
-
- data = malloc (sizeof (guchar) * pixels_length);
- for (i = 0; i < pixels_length; i++)
- data[i] = (guchar) pixels[i];
-
- gdk_threads_enter ();
-
- pixbuf = gdk_pixbuf_new_from_data (data,
- GDK_COLORSPACE_RGB,
- TRUE,
- 8,
- width,
- height,
- width*4,
- free_pixbuf_data,
- NULL);
-
- gtk_window_set_icon (GTK_WINDOW (ptr), pixbuf);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseIntArrayElements(env, pixelArray, pixels, 0);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
deleted file mode 100644
index 7e8a07a7df7..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/* gtkgenericpeer.c -- Native implementation of GtkGenericPeer
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkGenericPeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- /* For now the native state for any object must be a widget.
- However, a subclass could override dispose() if required. */
- gtk_widget_destroy (GTK_WIDGET (ptr));
-
- gdk_threads_leave ();
-
- /* Remove entries from state tables */
- NSA_DEL_GLOBAL_REF (env, obj);
- NSA_DEL_PTR (env, obj);
-
- /*
- * Wake up the main thread, to make sure it re-checks the window
- * destruction condition.
- */
-
- g_main_context_wakeup (NULL);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkGenericPeer_gtkWidgetModifyFont
- (JNIEnv *env, jobject obj, jstring name, jint style, jint size)
-{
- const char *font_name;
- void *ptr;
- PangoFontDescription *font_desc;
-
- ptr = NSA_GET_PTR (env, obj);
-
- font_name = (*env)->GetStringUTFChars (env, name, NULL);
-
- gdk_threads_enter();
-
- font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size * dpi_conversion_factor);
-
- if (style & AWT_STYLE_BOLD)
- pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
-
- if (style & AWT_STYLE_ITALIC)
- pango_font_description_set_style (font_desc, PANGO_STYLE_OBLIQUE);
-
- gtk_widget_modify_font (GTK_WIDGET(ptr), font_desc);
-
- pango_font_description_free (font_desc);
-
- gdk_threads_leave();
-
- (*env)->ReleaseStringUTFChars (env, name, font_name);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c
deleted file mode 100644
index c7c3b8e5a2e..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* gtkimagepainter.c
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkImagePainter.h"
-#include <libart_lgpl/art_misc.h>
-#include <libart_lgpl/art_rgb_affine.h>
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkImagePainter_drawPixels
- (JNIEnv *env, jobject obj __attribute__((unused)), jobject gc_obj,
- jint bg_red, jint bg_green, jint bg_blue, jint x, jint y, jint width,
- jint height, jintArray jpixels, jint offset, jint scansize,
- jdoubleArray jaffine)
-{
- struct graphics *g;
- jint *pixels, *elems;
- guchar *packed;
- int i;
- jsize num_pixels;
- guchar *j_rgba, *c_rgb;
-
- g = (struct graphics *) NSA_GET_PTR (env, gc_obj);
-
- if (!jpixels)
- return;
-
- elems = (*env)->GetIntArrayElements (env, jpixels, NULL);
- num_pixels = (*env)->GetArrayLength (env, jpixels);
-
- /* get a copy of the pixel data so we can modify it */
- pixels = malloc (sizeof (jint) * num_pixels);
- memcpy (pixels, elems, sizeof (jint) * num_pixels);
-
- (*env)->ReleaseIntArrayElements (env, jpixels, elems, 0);
-
-#ifndef WORDS_BIGENDIAN
- /* convert pixels from 0xBBGGRRAA to 0xAARRGGBB */
- for (i = 0; i < num_pixels; i++)
- pixels[i] = SWAPU32 ((unsigned)pixels[i]);
-#endif
-
- packed = (guchar *) malloc (sizeof (guchar) * 3 * num_pixels);
- j_rgba = (guchar *) pixels;
- c_rgb = packed;
-
- /* copy over pixels in DirectColorModel format to 24 bit RGB image data,
- and process the alpha channel */
- for (i = 0; i < num_pixels; i++)
- {
- jint ialpha = *j_rgba++;
-
- switch (ialpha)
- {
- case 0: /* full transparency */
- *c_rgb++ = bg_red;
- *c_rgb++ = bg_green;
- *c_rgb++ = bg_blue;
- j_rgba += 3;
- break;
- case 255: /* opaque */
- *c_rgb++ = *j_rgba++;
- *c_rgb++ = *j_rgba++;
- *c_rgb++ = *j_rgba++;
- break;
- default: /* compositing required */
- {
- jfloat alpha = ialpha / 255.0;
- jfloat comp_alpha = 1.0 - alpha;
-
- *c_rgb++ = *j_rgba++ * alpha + bg_red * comp_alpha;
- *c_rgb++ = *j_rgba++ * alpha + bg_green * comp_alpha;
- *c_rgb++ = *j_rgba++ * alpha + bg_blue * comp_alpha;
- }
- break;
- }
- }
-
- if (jaffine)
- {
- jdouble *affine;
- ArtAlphaGamma *alphagamma = NULL;
- art_u8 *dst;
- int new_width, new_height;
-
- affine = (*env)->GetDoubleArrayElements (env, jaffine, NULL);
-
- new_width = abs (width * affine[0]);
- new_height = abs (height * affine[3]);
-
- dst = (art_u8 *) malloc (sizeof (art_u8) * 3 * (new_width * new_height));
-
- art_rgb_affine (dst,
- 0, 0,
- new_width, new_height,
- new_width * 3,
- (art_u8 *) packed + offset * 3,
- width, height,
- scansize * 3,
- affine,
- ART_FILTER_NEAREST,
- alphagamma);
-
- (*env)->ReleaseDoubleArrayElements (env, jaffine, affine, JNI_ABORT);
-
- free (packed);
- packed = (guchar *) dst;
-
- width = scansize = new_width;
- height = new_height;
- offset = 0;
- }
-
- gdk_threads_enter ();
-
- if (!g || !GDK_IS_DRAWABLE (g->drawable))
- {
- gdk_threads_leave ();
- return;
- }
-
- gdk_draw_rgb_image (g->drawable,
- g->gc,
- x + g->x_offset,
- y + g->y_offset,
- width, height, GDK_RGB_DITHER_NORMAL,
- packed + offset * 3, scansize * 3);
-
- gdk_threads_leave ();
-
- free (pixels);
- free (packed);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
deleted file mode 100644
index befa265488b..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/* gtklabelpeer.c -- Native implementation of GtkLabelPeer
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkLabelPeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create
- (JNIEnv *env, jobject obj, jstring text, jfloat xalign)
-{
- GtkWidget *label;
- GtkWidget *eventbox;
- const char *str;
-
- NSA_SET_GLOBAL_REF (env, obj);
-
- str = (*env)->GetStringUTFChars (env, text, 0);
-
- gdk_threads_enter ();
-
- eventbox = gtk_event_box_new ();
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), xalign, 0.5);
- gtk_container_add (GTK_CONTAINER (eventbox), label);
- gtk_widget_show (label);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, text, str);
-
- NSA_SET_PTR (env, obj, eventbox);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkLabelPeer_gtkWidgetModifyFont
- (JNIEnv *env, jobject obj, jstring name, jint style, jint size)
-{
- const char *font_name;
- void *ptr;
- GtkWidget *label;
- PangoFontDescription *font_desc;
-
- ptr = NSA_GET_PTR (env, obj);
-
- font_name = (*env)->GetStringUTFChars (env, name, NULL);
-
- gdk_threads_enter ();
-
- label = gtk_bin_get_child (GTK_BIN (ptr));
-
- if (!label)
- return;
-
- font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size * dpi_conversion_factor);
-
- if (style & AWT_STYLE_BOLD)
- pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
-
- if (style & AWT_STYLE_ITALIC)
- pango_font_description_set_style (font_desc, PANGO_STYLE_OBLIQUE);
-
- gtk_widget_modify_font (GTK_WIDGET (label), font_desc);
-
- pango_font_description_free (font_desc);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, name, font_name);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkLabelPeer_setText
- (JNIEnv *env, jobject obj, jstring text)
-{
- const char *str;
- void *ptr;
- GtkWidget *label;
-
- ptr = NSA_GET_PTR (env, obj);
-
- str = (*env)->GetStringUTFChars (env, text, 0);
-
- gdk_threads_enter ();
-
- label = gtk_bin_get_child (GTK_BIN (ptr));
-
- gtk_label_set_label (GTK_LABEL (label), str);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, text, str);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkLabelPeer_nativeSetAlignment
- (JNIEnv *env, jobject obj, jfloat xalign)
-{
- void *ptr;
- GtkWidget *label;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- label = gtk_bin_get_child (GTK_BIN(ptr));
-
- gtk_misc_set_alignment (GTK_MISC (label), xalign, 0.5);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkLabelPeer_setNativeBounds
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
-{
- GtkWidget *widget;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- widget = GTK_WIDGET (ptr);
-
- /* We assume that -1 is a width or height and not a request for the
- widget's natural size. */
- width = width < 0 ? 0 : width;
- height = height < 0 ? 0 : height;
-
- if (!(width == 0 && height == 0))
- {
- /* Set the event box's size request... */
- gtk_widget_set_size_request (widget, width, height);
- /* ...and the label's size request. */
- gtk_widget_set_size_request (gtk_bin_get_child (GTK_BIN (widget)),
- width, height);
-
- if (widget->parent != NULL)
- gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
- }
-
- gdk_threads_leave ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
deleted file mode 100644
index 1483147dc99..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
+++ /dev/null
@@ -1,513 +0,0 @@
-/* GtkListPeer.c -- implements GtkListPeer's native methods
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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 "gnu_java_awt_peer_gtk_GtkListPeer.h"
-
-enum
- {
- COLUMN_STRING,
- N_COLUMNS
- };
-
-gboolean item_highlighted (GtkTreeSelection *selection,
- GtkTreeModel *model,
- GtkTreePath *path,
- gboolean path_currently_selected,
- jobject peer);
-
-
-#define TREE_VIEW_FROM_SW(obj) \
- (GTK_TREE_VIEW (GTK_SCROLLED_WINDOW (obj)->container.child))
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_create
- (JNIEnv *env, jobject obj, jint rows)
-{
- GtkWidget *sw;
- GtkWidget *list;
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
- GtkListStore *list_store;
- GtkTreeIter iter;
- GtkRequisition req;
- gint i;
-
- /* Create global reference and save it for future use */
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING);
- /* Add the number of rows so that we can calculate the tree view's
- size request. */
- for (i = 0; i < rows; i++)
- {
- gtk_list_store_append (list_store, &iter);
- gtk_list_store_set (list_store, &iter,
- COLUMN_STRING, "",
- -1);
- }
- list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (NULL,
- renderer,
- "text",
- COLUMN_STRING,
- NULL);
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
-
- gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
-
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (list), FALSE);
-
- gtk_widget_size_request (GTK_WIDGET (list), &req);
-
- gtk_widget_set_size_request (GTK_WIDGET (list), req.width, req.height);
-
- gtk_container_add (GTK_CONTAINER (sw), list);
-
- /* Remove the blank rows. */
- gtk_list_store_clear (list_store);
-
- gtk_widget_show (list);
- gtk_widget_show (sw);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, sw);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- jobject *gref;
- GtkTreeView *list;
- GtkTreeSelection *selection;
-
- ptr = NSA_GET_PTR (env, obj);
- gref = NSA_GET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- g_assert (gref);
-
- list = TREE_VIEW_FROM_SW (ptr);
-
- g_signal_connect (G_OBJECT (list), "event",
- G_CALLBACK (pre_event_handler), *gref);
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
- gtk_tree_selection_set_select_function (selection, item_highlighted,
- *gref, NULL);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_gtkWidgetModifyFont
- (JNIEnv *env, jobject obj, jstring name, jint style, jint size)
-{
- const char *font_name;
- void *ptr;
- GtkWidget *list;
- PangoFontDescription *font_desc;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter();
-
- list = GTK_WIDGET (TREE_VIEW_FROM_SW (ptr));
-
- font_name = (*env)->GetStringUTFChars (env, name, NULL);
-
- font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size * dpi_conversion_factor);
-
- if (style & AWT_STYLE_BOLD)
- pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
-
- if (style & AWT_STYLE_ITALIC)
- pango_font_description_set_style (font_desc, PANGO_STYLE_OBLIQUE);
-
- gtk_widget_modify_font (GTK_WIDGET (list), font_desc);
-
- pango_font_description_free (font_desc);
-
- (*env)->ReleaseStringUTFChars (env, name, font_name);
-
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_gtkWidgetRequestFocus
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- GtkWidget *list;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- list = GTK_WIDGET (TREE_VIEW_FROM_SW (ptr));
- gtk_widget_grab_focus (list);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_append
- (JNIEnv *env, jobject obj, jobjectArray items)
-{
- void *ptr;
- GtkTreeView *list;
- GtkTreeIter iter;
- GtkTreeModel *list_store;
- jint count;
- jint i;
-
- ptr = NSA_GET_PTR (env, obj);
-
- count = (*env)->GetArrayLength (env, items);
-
- gdk_threads_enter ();
-
- list = TREE_VIEW_FROM_SW (ptr);
- list_store = gtk_tree_view_get_model (list);
-
- for (i = 0; i < count; i++)
- {
- const char *text;
- jobject item;
-
- item = (*env)->GetObjectArrayElement (env, items, i);
-
- text = (*env)->GetStringUTFChars (env, item, NULL);
- gtk_list_store_append (GTK_LIST_STORE (list_store), &iter);
- gtk_list_store_set (GTK_LIST_STORE (list_store), &iter,
- COLUMN_STRING, text,
- -1);
- (*env)->ReleaseStringUTFChars (env, item, text);
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_add
- (JNIEnv *env, jobject obj, jstring text, jint index)
-{
- void *ptr;
- const char *str;
- GtkTreeView *list;
- GtkTreeIter iter;
- GtkTreeModel *list_store;
-
- ptr = NSA_GET_PTR (env, obj);
- str = (*env)->GetStringUTFChars (env, text, NULL);
-
- gdk_threads_enter ();
-
- list = TREE_VIEW_FROM_SW (ptr);
- list_store = gtk_tree_view_get_model (list);
-
- if (index == -1)
- gtk_list_store_append (GTK_LIST_STORE (list_store), &iter);
- else
- gtk_list_store_insert (GTK_LIST_STORE (list_store), &iter, index);
-
- gtk_list_store_set (GTK_LIST_STORE (list_store), &iter,
- COLUMN_STRING, str, -1);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, text, str);
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_delItems
- (JNIEnv *env, jobject obj, jint start, jint end)
-{
- void *ptr;
- GtkTreeView *list;
- GtkTreeIter iter;
- GtkTreeModel *list_store;
- jint i;
- jint num_items;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- list = TREE_VIEW_FROM_SW (ptr);
- list_store = gtk_tree_view_get_model (list);
-
- /* Special case: remove all rows. */
- if (end == -1)
- gtk_list_store_clear (GTK_LIST_STORE (list_store));
- else
- {
- i = 0;
- num_items = end - start + 1;
- gtk_tree_model_iter_nth_child (list_store, &iter, NULL, start);
- while (i < num_items)
- {
- gtk_list_store_remove (GTK_LIST_STORE (list_store), &iter);
- i++;
- }
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_select
- (JNIEnv *env, jobject obj, jint index)
-{
- void *ptr;
- GtkTreeView *list;
- GtkTreePath *path;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- list = TREE_VIEW_FROM_SW (ptr);
- path = gtk_tree_path_new_from_indices (index, -1);
- gtk_tree_view_set_cursor (list, path, NULL, FALSE);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_deselect
- (JNIEnv *env, jobject obj, jint index)
-{
- void *ptr;
- GtkTreeView *list;
- GtkTreeSelection *selection;
- GtkTreePath *path;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- list = TREE_VIEW_FROM_SW (ptr);
- selection = gtk_tree_view_get_selection (list);
- path = gtk_tree_path_new_from_indices (index, -1);
- gtk_tree_selection_unselect_path (selection, path);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_getSize
- (JNIEnv *env, jobject obj, jint rows, jint visible_rows, jintArray jdims)
-{
- void *ptr;
- jint *dims;
- GtkRequisition current_req;
- GtkRequisition natural_req;
-
- dims = (*env)->GetIntArrayElements (env, jdims, NULL);
- dims[0] = dims[1] = 0;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- /* Save the widget's current size request. */
- gtk_widget_size_request (GTK_WIDGET (ptr), &current_req);
-
- /* Get the widget's "natural" size request. */
- gtk_widget_set_size_request (GTK_WIDGET (ptr), -1, -1);
- gtk_widget_size_request (GTK_WIDGET (ptr), &natural_req);
-
- /* Reset the widget's size request. */
- gtk_widget_set_size_request (GTK_WIDGET (ptr),
- current_req.width, current_req.height);
-
- dims[0] = natural_req.width;
-
- /* Calculate the final height, by comparing the number of rows
- in the list to the number of rows requested by the caller.
- FIXME: Is there a GTK method that counts the number of rows
- in the list? If so, we don't need to bring visible_rows from
- the Java peer. */
- if (rows == visible_rows)
- dims[1] = natural_req.height;
- else
- dims[1] = natural_req.height / visible_rows * rows;
-
- gdk_threads_leave ();
-
- (*env)->ReleaseIntArrayElements (env, jdims, dims, 0);
-}
-
-
-JNIEXPORT jintArray JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_getSelectedIndexes
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- GtkTreeView *list;
- GtkTreeSelection *selection;
- jintArray result_array;
- jint *result_array_iter;
- GList *current_row;
- GList *rows;
- gint *indices;
- jint count;
- jint i;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- list = TREE_VIEW_FROM_SW (ptr);
- selection = gtk_tree_view_get_selection (list);
- count = gtk_tree_selection_count_selected_rows (selection);
- if (count > 0)
- {
- current_row = rows = gtk_tree_selection_get_selected_rows (selection, NULL);
-
- result_array = (*env)->NewIntArray (env, count);
- result_array_iter = (*env)->GetIntArrayElements (env, result_array, NULL);
-
- for (i = 0; i < count; i++)
- {
- indices = gtk_tree_path_get_indices (current_row->data);
- result_array_iter[i] = indices ? indices[0] : -1;
- current_row = g_list_next (current_row);
- }
-
- if (rows)
- {
- g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL);
- g_list_free (rows);
- }
-
- gdk_threads_leave ();
-
- (*env)->ReleaseIntArrayElements (env, result_array, result_array_iter, 0);
-
- return result_array;
- }
- else
- gdk_threads_leave ();
-
- return (jintArray) NULL;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_makeVisible
- (JNIEnv *env, jobject obj, jint index)
-{
- void *ptr;
- GtkTreeView *list;
- GtkTreePath *path;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- list = TREE_VIEW_FROM_SW (ptr);
- path = gtk_tree_path_new_from_indices (index, -1);
- gtk_tree_view_scroll_to_cell (list, path, NULL, FALSE, 0.0, 0.0);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_setMultipleMode
- (JNIEnv *env, jobject obj, jboolean mode)
-{
- void *ptr;
- GtkTreeView *list;
- GtkTreeSelection *selection;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- list = TREE_VIEW_FROM_SW (ptr);
- selection = gtk_tree_view_get_selection (list);
- gtk_tree_selection_set_mode (selection,
- mode ? GTK_SELECTION_MULTIPLE
- : GTK_SELECTION_SINGLE);
-
- gdk_threads_leave ();
-}
-
-gboolean
-item_highlighted (GtkTreeSelection *selection __attribute__((unused)),
- GtkTreeModel *model,
- GtkTreePath *path,
- gboolean path_currently_selected,
- jobject peer)
-{
- GtkTreeIter iter;
- jint row;
- gint *indices;
-
- if (gtk_tree_model_get_iter (model, &iter, path))
- {
- indices = gtk_tree_path_get_indices (path);
- row = indices ? indices[0] : -1;
-
- if (!path_currently_selected)
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postListItemEventID,
- row,
- (jint) AWT_ITEM_SELECTED);
- else
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postListItemEventID,
- row,
- (jint) AWT_ITEM_DESELECTED);
- }
-
- return TRUE;
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
deleted file mode 100644
index 0a88f645bd2..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* gtkmenubarpeer.c -- Native implementation of GtkMenuBarPeer
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkMenuBarPeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create
- (JNIEnv *env, jobject obj)
-{
- GtkWidget *widget;
-
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- widget = gtk_menu_bar_new ();
- gtk_widget_show (widget);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, widget);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_addMenu
- (JNIEnv *env, jobject obj, jobject menupeer)
-{
- void *mbar, *menu;
-
- mbar = NSA_GET_PTR (env, obj);
- menu = NSA_GET_PTR (env, menupeer);
-
- gdk_threads_enter ();
- gtk_menu_shell_append (GTK_MENU_SHELL (mbar), GTK_WIDGET (menu));
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_nativeSetHelpMenu
- (JNIEnv *env, jobject obj, jobject menupeer)
-{
- static void *helpmenu;
- void *mbar, *menu;
- GList *list;
-
- mbar = NSA_GET_PTR (env, obj);
- menu = NSA_GET_PTR (env, menupeer);
-
- gdk_threads_enter ();
- if (helpmenu != NULL)
- {
- list = gtk_container_children (GTK_CONTAINER (mbar));
- while (list != NULL && list->data != helpmenu)
- list = list->next;
- if (list != NULL && list->data == helpmenu)
- gtk_container_remove (GTK_CONTAINER (mbar), GTK_WIDGET (list->data));
- }
- helpmenu = menu;
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_delMenu
- (JNIEnv *env, jobject obj, jint index)
-{
- void *ptr;
- GList *list;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- list = gtk_container_children (GTK_CONTAINER (ptr));
- list = g_list_nth (list, index);
- gtk_container_remove (GTK_CONTAINER (ptr), GTK_WIDGET (list->data));
- gdk_threads_leave ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c
deleted file mode 100644
index 01b74e46c57..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* gtkmenucomponentpeer.c -- Native implementation of GtkMenuComponentPeer
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkMenuComponentPeer.h"
-
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuComponentPeer_dispose
- (JNIEnv *env, jobject obj)
-{
- /* For MenuComponents and its subclasses, the widgets are
- automatically destroyed by Gtk when the parent MenuBar
- is removed from the Frame. So we avoid the widget
- destruction in GtkGenericPeer dispose() by overriding
- it here. */
-
- /* However, references to the Java objects still exist in the
- state tables, so we still have to remove those. */
-
- NSA_DEL_GLOBAL_REF (env, obj);
- NSA_DEL_PTR (env, obj);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
deleted file mode 100644
index 76850c8143c..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* gtkmenuitempeer.c -- Native implementation of GtkMenuItemPeer
- Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkMenuItemPeer.h"
-#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
-
-static void item_activate (GtkMenuItem *item __attribute__((unused)),
- jobject peer_obj);
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create
- (JNIEnv *env, jobject obj, jstring label)
-{
- GtkWidget *widget;
- const char *str;
-
- NSA_SET_GLOBAL_REF (env, obj);
-
- str = (*env)->GetStringUTFChars (env, label, NULL);
-
- gdk_threads_enter ();
-
- /* "-" signals that we need a separator. */
- if (strcmp (str, "-") == 0)
- widget = gtk_menu_item_new ();
- else
- widget = gtk_menu_item_new_with_label (str);
-
- gtk_widget_show (widget);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, label, str);
-
- NSA_SET_PTR (env, obj, widget);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_connectSignals
- (JNIEnv *env, jobject obj)
-{
- void *ptr = NSA_GET_PTR (env, obj);
- jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
- g_assert (gref);
-
- gdk_threads_enter ();
-
- g_signal_connect (G_OBJECT (ptr), "activate",
- G_CALLBACK (item_activate), *gref);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_gtkWidgetModifyFont
- (JNIEnv *env, jobject obj, jstring name, jint style, jint size)
-{
- const char *font_name;
- void *ptr;
- GtkWidget *label;
- PangoFontDescription *font_desc;
-
- ptr = NSA_GET_PTR (env, obj);
-
- font_name = (*env)->GetStringUTFChars (env, name, NULL);
-
- gdk_threads_enter();
-
- label = gtk_bin_get_child (GTK_BIN (ptr));
-
- if (label)
- {
- font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size * dpi_conversion_factor);
-
- if (style & AWT_STYLE_BOLD)
- pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
-
- if (style & AWT_STYLE_ITALIC)
- pango_font_description_set_style (font_desc, PANGO_STYLE_OBLIQUE);
-
- gtk_widget_modify_font (GTK_WIDGET(label), font_desc);
-
- pango_font_description_free (font_desc);
- }
-
- gdk_threads_leave();
-
- (*env)->ReleaseStringUTFChars (env, name, font_name);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_setEnabled
- (JNIEnv *env, jobject obj, jboolean enabled)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gtk_widget_set_sensitive (GTK_WIDGET (ptr), enabled);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_setLabel
- (JNIEnv *env, jobject obj, jstring label)
-{
- void *ptr;
- const char *str;
- GtkAccelLabel *accel_label;
-
- ptr = NSA_GET_PTR (env, obj);
-
- str = (*env)->GetStringUTFChars (env, label, NULL);
-
- gdk_threads_enter ();
-
- accel_label = GTK_ACCEL_LABEL (GTK_BIN (ptr)->child);
-
- gtk_label_set_text (GTK_LABEL (accel_label), str);
- gtk_accel_label_refetch (accel_label);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, label, str);
-}
-
-static void
-item_activate (GtkMenuItem *item __attribute__((unused)), jobject peer_obj)
-{
- (*gdk_env())->CallVoidMethod (gdk_env(), peer_obj,
- postMenuActionEventID);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
deleted file mode 100644
index 21c738ca5d2..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* gtkmenupeer.c -- Native implementation of GtkMenuPeer
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkMenuPeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuPeer_setupAccelGroup
- (JNIEnv *env, jobject obj, jobject parent)
-{
- void *ptr1, *ptr2;
-
- ptr1 = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- if (!parent)
- {
- gtk_menu_set_accel_group (GTK_MENU (GTK_MENU_ITEM (ptr1)->submenu),
- gtk_accel_group_new ());
- }
- else
- {
- GtkAccelGroup *parent_accel;
-
- ptr2 = NSA_GET_PTR (env, parent);
- parent_accel = gtk_menu_get_accel_group (GTK_MENU (GTK_MENU_ITEM (ptr2)->submenu));
-
- gtk_menu_set_accel_group (GTK_MENU (GTK_MENU_ITEM (ptr1)->submenu),
- parent_accel);
- }
-
- gdk_threads_leave ();
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create
- (JNIEnv *env, jobject obj, jstring label)
-{
- GtkWidget *menu_title, *menu, *toplevel;
- const char *str;
-
- NSA_SET_GLOBAL_REF (env, obj);
-
- str = (*env)->GetStringUTFChars (env, label, NULL);
-
- gdk_threads_enter ();
-
- menu = gtk_menu_new ();
-
- if (str != NULL)
- menu_title = gtk_menu_item_new_with_label (str);
- else
- menu_title = gtk_menu_item_new();
-
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_title), menu);
-
- /* Allow this menu to grab the pointer. */
- toplevel = gtk_widget_get_toplevel (menu);
- if (GTK_IS_WINDOW (toplevel))
- {
- gtk_window_group_add_window (global_gtk_window_group,
- GTK_WINDOW(toplevel));
- }
-
- gtk_widget_show (menu_title);
-
- NSA_SET_PTR (env, obj, menu_title);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, label, str);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuPeer_addTearOff
- (JNIEnv *env, jobject obj)
-{
- void *ptr1;
- GtkWidget *menu, *item;
-
- ptr1 = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (ptr1));
- item = gtk_tearoff_menu_item_new ();
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (item);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuPeer_addItem
- (JNIEnv *env, jobject obj, jobject menuitempeer, jint key, jboolean shift)
-{
- void *ptr1, *ptr2;
- GtkWidget *menu;
-
- ptr1 = NSA_GET_PTR (env, obj);
- ptr2 = NSA_GET_PTR (env, menuitempeer);
-
- gdk_threads_enter ();
-
- menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(ptr1));
- gtk_menu_shell_append (GTK_MENU_SHELL(menu), GTK_WIDGET (ptr2));
-
- if (key)
- {
- gtk_widget_add_accelerator (GTK_WIDGET (ptr2), "activate",
- gtk_menu_get_accel_group (GTK_MENU (menu)), key,
- (GDK_CONTROL_MASK
- | ((shift) ? GDK_SHIFT_MASK : 0)),
- GTK_ACCEL_VISIBLE);
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuPeer_delItem
- (JNIEnv *env, jobject obj, jint index)
-{
- void *ptr;
- GList *list;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- list = gtk_container_children (GTK_CONTAINER (ptr));
- list = g_list_nth (list, index);
- gtk_container_remove (GTK_CONTAINER (ptr), GTK_WIDGET (list->data));
- gdk_threads_leave ();
-}
-
-
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c
deleted file mode 100644
index 63ead82036d..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* gtkpanelpeer.c -- Native implementation of GtkPanelPeer
- Copyright (C) 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
-#include "gnu_java_awt_peer_gtk_GtkPanelPeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create
- (JNIEnv *env, jobject obj)
-{
- GtkWidget *widget;
-
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- widget = gtk_fixed_new ();
-
- gtk_fixed_set_has_window (GTK_FIXED (widget), TRUE);
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, widget);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c
deleted file mode 100644
index 70ebbb796ad..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* gtkpopupmenupeer.c -- Native implementation of GtkPopupMenuPeer
- Copyright (C) 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h"
-
-struct pos
-{
- gint x;
- gint y;
-};
-
-static void
-menu_pos (GtkMenu *menu __attribute__((unused)),
- gint *x, gint *y,
- gboolean *push_in,
- gpointer user_data)
-{
- struct pos *p = (struct pos *) user_data;
-
- *x = p->x;
- *y = p->y;
- *push_in = TRUE;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkPopupMenuPeer_show
- (JNIEnv *env, jobject obj, jint x, jint y, jlong time)
-{
- void *ptr;
- struct pos *p;
-
- ptr = NSA_GET_PTR (env, obj);
-
- p = g_malloc (sizeof (struct pos));
- p->x = x;
- p->y = y;
-
- gdk_threads_enter ();
- gtk_menu_popup (GTK_MENU (GTK_MENU_ITEM (ptr)->submenu),
- NULL, NULL, menu_pos, p, 0, time);
- gdk_threads_leave ();
-
- g_free (p);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkPopupMenuPeer_setupAccelGroup
- (JNIEnv *env, jobject obj, jobject parent)
-{
- void *ptr1, *ptr2;
- GtkMenu *menu;
-
- ptr1 = NSA_GET_PTR (env, obj);
- ptr2 = NSA_GET_PTR (env, parent);
-
- gdk_threads_enter ();
- menu = GTK_MENU (GTK_MENU_ITEM (ptr1)->submenu);
- gtk_menu_set_accel_group (menu, gtk_accel_group_new ());
- /* FIXME: update this to use GTK-2.4 GtkActions. */
-#if 0
- _gtk_accel_group_attach (gtk_menu_get_accel_group (menu),
- G_OBJECT (gtk_widget_get_toplevel (ptr2)));
-#endif
- gdk_threads_leave ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
deleted file mode 100644
index 372458360d0..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/* gtkscrollbarpeer.c -- Native implementation of GtkScrollbarPeer
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
-#include "gnu_java_awt_peer_gtk_GtkScrollbarPeer.h"
-
-static void post_change_event (GtkRange *range, jobject peer);
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create
-(JNIEnv *env, jobject obj, jint orientation, jint value,
- jint min, jint max, jint step_incr, jint page_incr, jint visible_amount)
-{
- GtkWidget *scrollbar;
- GtkObject *adj;
-
- /* Create global reference and save it for future use */
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- adj = gtk_adjustment_new ((gdouble) value,
- (gdouble) min,
- (gdouble) max,
- (gdouble) step_incr,
- (gdouble) page_incr,
- (gdouble) visible_amount);
-
- scrollbar = (orientation) ? gtk_vscrollbar_new (GTK_ADJUSTMENT (adj)) :
- gtk_hscrollbar_new (GTK_ADJUSTMENT (adj));
-
- GTK_RANGE (scrollbar)->round_digits = 0;
- /* These calls seem redundant but they are not. They clamp values
- so that the slider's entirety is always between the two
- steppers. */
- gtk_range_set_range (GTK_RANGE (scrollbar), (gdouble) min, (gdouble) max);
- gtk_range_set_value (GTK_RANGE (scrollbar), (gdouble) value);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, scrollbar);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals
- (JNIEnv *env, jobject obj)
-{
- void *ptr = NSA_GET_PTR (env, obj);
- jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
- g_assert (gref);
-
- gdk_threads_enter ();
-
- g_signal_connect (G_OBJECT (ptr), "value-changed",
- G_CALLBACK (post_change_event), *gref);
-
- gdk_threads_leave ();
-
- /* Connect the superclass signals. */
- Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj);
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setLineIncrement
- (JNIEnv *env, jobject obj, jint amount)
-{
- void *ptr;
- GtkAdjustment *adj;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- adj = gtk_range_get_adjustment (GTK_RANGE (ptr));
- adj->step_increment = (gdouble) amount;
- gtk_adjustment_changed (adj);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setPageIncrement
- (JNIEnv *env, jobject obj, jint amount)
-{
- void *ptr;
- GtkAdjustment *adj;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- adj = gtk_range_get_adjustment (GTK_RANGE (ptr));
- adj->page_increment = (gdouble) amount;
- gtk_adjustment_changed (adj);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setValues
- (JNIEnv *env, jobject obj, jint value, jint visible, jint min, jint max)
-{
- void *ptr;
- GtkAdjustment *adj;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- adj = gtk_range_get_adjustment (GTK_RANGE (ptr));
- adj->page_size = (gdouble) visible;
-
- gtk_range_set_range (GTK_RANGE (ptr), (gdouble) min, (gdouble) max);
- gtk_range_set_value (GTK_RANGE (ptr), (gdouble) value);
-
- gtk_adjustment_changed (adj);
-
- gdk_threads_leave ();
-}
-
-static void
-post_change_event (GtkRange *range, jobject peer)
-{
- GtkAdjustment *adj;
- adj = gtk_range_get_adjustment (range);
- (*gdk_env())->CallVoidMethod (gdk_env(), peer, postAdjustmentEventID,
- AWT_ADJUSTMENT_TRACK, (jint) adj->value);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c
deleted file mode 100644
index 474d334d91f..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/* gtkscrollpanepeer.c -- Native implementation of GtkScrollPanePeer
- Copyright (C) 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkScrollPanePeer.h"
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create
- (JNIEnv *env, jobject obj, int width, int height)
-{
- GtkWidget *sw;
-
- /* Create global reference and save it for future use */
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- sw = gtk_scrolled_window_new (NULL, NULL);
-
- gtk_widget_set_size_request (sw, width, height);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, sw);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_setScrollPosition
- (JNIEnv *env, jobject obj, jint x, jint y)
-{
- GtkAdjustment *hadj, *vadj;
- GtkScrolledWindow *sw;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- sw = GTK_SCROLLED_WINDOW (ptr);
-
- hadj = gtk_scrolled_window_get_hadjustment (sw);
- vadj = gtk_scrolled_window_get_vadjustment (sw);
-
- gtk_adjustment_set_value (hadj, x);
- gtk_adjustment_set_value (vadj, y);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_gtkScrolledWindowSetHScrollIncrement
- (JNIEnv *env, jobject obj, jint u)
-{
- GtkAdjustment *hadj;
- GtkScrolledWindow *sw;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- sw = GTK_SCROLLED_WINDOW(ptr);
-
- hadj = gtk_scrolled_window_get_hadjustment (sw);
- hadj->step_increment = u;
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_gtkScrolledWindowSetVScrollIncrement
- (JNIEnv *env, jobject obj, jint u)
-{
- GtkAdjustment *vadj;
- GtkScrolledWindow *sw;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- sw = GTK_SCROLLED_WINDOW(ptr);
-
- vadj = gtk_scrolled_window_get_hadjustment (sw);
- vadj->step_increment = u;
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_getHScrollbarHeight
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- GtkScrolledWindow *sw;
- GtkRequisition requisition;
- jint height = 0;
- jint spacing = 0;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- sw = GTK_SCROLLED_WINDOW (ptr);
-
- gtk_widget_size_request (sw->hscrollbar, &requisition);
- gtk_widget_style_get (GTK_WIDGET (sw), "scrollbar_spacing", &spacing, NULL);
- height = requisition.height + spacing;
-
- gdk_threads_leave ();
-
- return height;
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_getVScrollbarWidth
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- GtkScrolledWindow *sw;
- GtkRequisition requisition;
- jint width = 0;
- jint spacing = 0;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- sw = GTK_SCROLLED_WINDOW (ptr);
-
- gtk_widget_size_request (sw->vscrollbar, &requisition);
- gtk_widget_style_get (GTK_WIDGET (sw), "scrollbar_spacing", &spacing, NULL);
- width = requisition.width + spacing;
-
- gdk_threads_leave ();
-
- return width;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_setPolicy
- (JNIEnv *env, jobject obj, jint policy)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- switch (policy)
- {
- case AWT_SCROLLPANE_SCROLLBARS_AS_NEEDED:
- policy = GTK_POLICY_AUTOMATIC;
- break;
- case AWT_SCROLLPANE_SCROLLBARS_ALWAYS:
- policy = GTK_POLICY_ALWAYS;
- break;
- case AWT_SCROLLPANE_SCROLLBARS_NEVER:
- policy = GTK_POLICY_NEVER;
- break;
- }
-
- gdk_threads_enter ();
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (ptr), policy, policy);
- gdk_threads_leave ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
deleted file mode 100644
index 002a7a8c24d..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/* gtktextareapeer.c -- Native implementation of GtkTextAreaPeer
- Copyright (C) 1998, 1999, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkTextAreaPeer.h"
-
-#define TEXT_FROM_SW(obj) (GTK_TEXT_VIEW(GTK_SCROLLED_WINDOW (obj)->container.child))
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create
- (JNIEnv *env, jobject obj,
- jint textview_width, jint textview_height, jint scroll)
-{
- GtkWidget *text, *sw;
-
- /* Create global reference and save it for future use */
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- text = gtk_text_view_new ();
- gtk_widget_set_size_request (text, textview_width, textview_height);
- gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW (text), TRUE);
-
- gtk_widget_show (text);
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_container_add (GTK_CONTAINER (sw), text);
-
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- /* horizontal scrollbar */
- (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH
- || scroll == AWT_TEXTAREA_SCROLLBARS_HORIZONTAL_ONLY) ?
- GTK_POLICY_ALWAYS : GTK_POLICY_NEVER,
- /* vertical scrollbar */
- (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH
- || scroll == AWT_TEXTAREA_SCROLLBARS_VERTICAL_ONLY) ?
- GTK_POLICY_ALWAYS : GTK_POLICY_NEVER);
-
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text),
- (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH
- || scroll == AWT_TEXTAREA_SCROLLBARS_HORIZONTAL_ONLY)
- ? GTK_WRAP_NONE : GTK_WRAP_WORD);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, sw);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_insert
- (JNIEnv *env, jobject obj, jstring contents, jint position)
-{
- GtkTextBuffer *buf;
- GtkTextIter iter;
- GtkWidget *text;
- void *ptr;
- const char *str;
- int pos=position;
-
- ptr = NSA_GET_PTR (env, obj);
- str = (*env)->GetStringUTFChars (env, contents, NULL);
-
- gdk_threads_enter ();
-
- text = GTK_WIDGET (TEXT_FROM_SW (ptr));
-
- buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
- gtk_text_buffer_get_iter_at_offset (buf, &iter, pos);
- gtk_text_buffer_insert (buf, &iter, str, strlen (str));
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, contents, str);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_replaceRange
- (JNIEnv *env, jobject obj, jstring contents, jint start, jint end)
-{
- GtkWidget *text;
- GtkTextBuffer *buf;
- GtkTextIter iter, startIter, endIter;
- void *ptr;
- const char *str;
- int mystart = start;
- int myend = end;
-
- ptr = NSA_GET_PTR (env, obj);
- str = (*env)->GetStringUTFChars (env, contents, NULL);
-
- gdk_threads_enter ();
-
- text = GTK_WIDGET (TEXT_FROM_SW (ptr));
-
- buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
-
- gtk_text_buffer_get_iter_at_offset (buf, &startIter, mystart);
- gtk_text_buffer_get_iter_at_offset (buf, &endIter, myend);
- gtk_text_buffer_delete (buf, &startIter, &endIter);
-
- gtk_text_buffer_get_iter_at_offset (buf, &iter, mystart);
- gtk_text_buffer_insert(buf, &iter, str, strlen (str));
-
- gdk_threads_leave ();
- (*env)->ReleaseStringUTFChars (env, contents, str);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkWidgetModifyFont
- (JNIEnv *env, jobject obj, jstring name, jint style, jint size)
-{
- const char *font_name;
- void *ptr;
- GtkWidget *text;
- PangoFontDescription *font_desc;
-
- ptr = NSA_GET_PTR (env, obj);
-
- text = GTK_WIDGET (TEXT_FROM_SW (ptr));
-
- font_name = (*env)->GetStringUTFChars (env, name, NULL);
-
- gdk_threads_enter();
-
- font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size * dpi_conversion_factor);
-
- if (style & AWT_STYLE_BOLD)
- pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
-
- if (style & AWT_STYLE_ITALIC)
- pango_font_description_set_style (font_desc, PANGO_STYLE_OBLIQUE);
-
- gtk_widget_modify_font (GTK_WIDGET (text), font_desc);
-
- pango_font_description_free (font_desc);
-
- gdk_threads_leave();
-
- (*env)->ReleaseStringUTFChars (env, name, font_name);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkWidgetRequestFocus
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- GtkWidget *text;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- text = GTK_WIDGET (TEXT_FROM_SW (ptr));
-
- gtk_widget_grab_focus (text);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_getHScrollbarHeight
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- GtkScrolledWindow *sw;
- GtkRequisition requisition;
- jint height = 0;
- jint spacing = 0;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- sw = GTK_SCROLLED_WINDOW (ptr);
-
- if (sw)
- {
- gtk_widget_size_request (sw->hscrollbar, &requisition);
- gtk_widget_style_get (GTK_WIDGET (sw), "scrollbar_spacing", &spacing, NULL);
- height = requisition.height + spacing;
- }
-
- gdk_threads_leave ();
-
- return height;
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_getVScrollbarWidth
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- GtkScrolledWindow *sw;
- GtkRequisition requisition;
- jint width = 0;
- jint spacing = 0;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- sw = GTK_SCROLLED_WINDOW (ptr);
-
- if (sw)
- {
- gtk_widget_size_request (sw->vscrollbar, &requisition);
- gtk_widget_style_get (GTK_WIDGET (sw), "scrollbar_spacing", &spacing, NULL);
- width = requisition.width + spacing;
- }
-
- gdk_threads_leave ();
-
- return width;
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
deleted file mode 100644
index a6d0a612445..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
+++ /dev/null
@@ -1,498 +0,0 @@
-/* gtktextcomponentpeer.c -- Native implementation of GtkTextComponentPeer
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
-#include "gnu_java_awt_peer_gtk_GtkTextComponentPeer.h"
-
-static void textcomponent_changed_cb (GtkEditable *editable,
- jobject peer);
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals
- (JNIEnv *env, jobject obj)
-{
- GtkTextView *text = NULL;
- GtkTextBuffer *buf;
- void *ptr = NSA_GET_PTR (env, obj);
- jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
- g_assert (gref);
-
- gdk_threads_enter ();
-
- if (GTK_IS_ENTRY(ptr))
- {
- g_signal_connect (GTK_EDITABLE (ptr), "changed",
- G_CALLBACK (textcomponent_changed_cb), *gref);
-
- gdk_threads_leave ();
-
- /* Connect the superclass signals. */
- Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, *gref);
- }
- else
- {
- if (GTK_IS_SCROLLED_WINDOW (ptr))
- {
- text = GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child);
- }
- else if (GTK_IS_TEXT_VIEW (ptr))
- {
- text = GTK_TEXT_VIEW (ptr);
- }
-
- if (text)
- {
- buf = gtk_text_view_get_buffer (text);
- if (buf)
- g_signal_connect (buf, "changed",
- G_CALLBACK (textcomponent_changed_cb), *gref);
-
- /* Connect the superclass signals. */
- /* FIXME: Cannot do that here or it will get the sw and not the list.
- We must a generic way of doing this. */
- /* Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env,
- obj); */
- g_signal_connect (GTK_OBJECT (text), "event",
- G_CALLBACK (pre_event_handler), *gref);
-
- gdk_threads_leave ();
- }
- }
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getCaretPosition
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- int pos = 0;
- GtkEditable *editable;
- GtkWidget *text = NULL;
- GtkTextBuffer *buf;
- GtkTextMark *mark;
- GtkTextIter iter;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- if (GTK_IS_EDITABLE (ptr))
- {
- editable = GTK_EDITABLE (ptr);
- pos = gtk_editable_get_position (editable);
- }
- else
- {
- if (GTK_IS_SCROLLED_WINDOW (ptr))
- {
- text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
- }
- else if (GTK_IS_TEXT_VIEW (ptr))
- {
- text = GTK_WIDGET (ptr);
- }
-
- if (text)
- {
- buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
- mark = gtk_text_buffer_get_insert (buf);
- gtk_text_buffer_get_iter_at_mark (buf, &iter, mark);
- pos = gtk_text_iter_get_offset (&iter);
- }
- }
-
- gdk_threads_leave ();
-
- return pos;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setCaretPosition
- (JNIEnv *env, jobject obj, jint pos)
-{
- void *ptr;
- GtkEditable *editable;
- GtkWidget *text = NULL;
- GtkTextBuffer *buf;
- GtkTextIter iter;
- GtkTextMark *oldmark;
- GtkTextIter olditer;
- int oldpos;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- if (GTK_IS_EDITABLE (ptr))
- {
- editable = GTK_EDITABLE (ptr);
- gtk_editable_set_position (editable, pos);
- }
- else
- {
- if (GTK_IS_SCROLLED_WINDOW (ptr))
- {
- text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
- }
- else if (GTK_IS_TEXT_VIEW (ptr))
- {
- text = GTK_WIDGET (ptr);
- }
-
- if (text)
- {
- buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
-
- /* Save old position. */
- oldmark = gtk_text_buffer_get_insert (buf);
- gtk_text_buffer_get_iter_at_mark (buf, &olditer, oldmark);
- oldpos = gtk_text_iter_get_offset (&olditer);
-
- /* Move to new position. */
- gtk_text_buffer_get_iter_at_offset (buf, &iter, pos);
- gtk_text_buffer_place_cursor (buf, &iter);
-
- /* Scroll to new position. Alignment is determined
- comparing the new position to the old position. */
- if (oldpos > pos)
- gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW (text),
- &iter, 0, TRUE, 0, 0);
- else if (oldpos < pos)
- gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW (text),
- &iter, 0, TRUE, 1, 1);
- }
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionStart
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- int pos = 0;
- GtkEditable *editable;
- GtkWidget *text = NULL;
- GtkTextBuffer *buf;
- GtkTextIter start;
- GtkTextIter end;
- int starti, endi;
- GtkTextMark *mark;
- GtkTextIter iter;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- if (GTK_IS_EDITABLE (ptr))
- {
- editable = GTK_EDITABLE (ptr);
- if (gtk_editable_get_selection_bounds (editable, &starti, &endi))
- pos = starti;
- else
- pos = gtk_editable_get_position (editable);
- }
- else
- {
- if (GTK_IS_SCROLLED_WINDOW (ptr))
- {
- text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
- }
- else if (GTK_IS_TEXT_VIEW (ptr))
- {
- text = GTK_WIDGET (ptr);
- }
-
- if (text)
- {
- buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
- if (gtk_text_buffer_get_selection_bounds(buf, &start, &end))
- pos = gtk_text_iter_get_offset (&start);
- else
- {
- mark = gtk_text_buffer_get_insert (buf);
- gtk_text_buffer_get_iter_at_mark (buf, &iter, mark);
- pos = gtk_text_iter_get_offset (&iter);
- }
- }
- }
-
- gdk_threads_leave ();
-
- return pos;
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionEnd
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- int pos = 0;
- GtkEditable *editable;
- GtkWidget *text = NULL;
- GtkTextBuffer *buf;
- GtkTextIter start;
- GtkTextIter end;
- int starti, endi;
- GtkTextMark *mark;
- GtkTextIter iter;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- if (GTK_IS_EDITABLE (ptr))
- {
- editable = GTK_EDITABLE (ptr);
- if (gtk_editable_get_selection_bounds (editable, &starti, &endi))
- pos = endi;
- else
- pos = gtk_editable_get_position (editable);
- }
- else
- {
- if (GTK_IS_SCROLLED_WINDOW (ptr))
- {
- text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
- }
- else if (GTK_IS_TEXT_VIEW (ptr))
- {
- text = GTK_WIDGET (ptr);
- }
-
- if (text)
- {
- buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
- if (gtk_text_buffer_get_selection_bounds(buf, &start, &end))
- pos = gtk_text_iter_get_offset (&end);
- else
- {
- mark = gtk_text_buffer_get_insert (buf);
- gtk_text_buffer_get_iter_at_mark (buf, &iter, mark);
- pos = gtk_text_iter_get_offset (&iter);
- }
- }
- }
-
- gdk_threads_leave ();
-
- return pos;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_select
- (JNIEnv *env, jobject obj, jint start, jint end)
-{
- void *ptr;
- GtkEditable *editable;
- GtkWidget *text = NULL;
- GtkTextBuffer *buf;
- GtkTextIter iter;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
-
- if (GTK_IS_EDITABLE (ptr))
- {
- editable = GTK_EDITABLE (ptr);
- gtk_editable_select_region (editable, start, end);
- }
- else
- {
- if (GTK_IS_SCROLLED_WINDOW (ptr))
- {
- text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
- }
- else if (GTK_IS_TEXT_VIEW (ptr))
- {
- text = GTK_WIDGET (ptr);
- }
-
- if (text)
- {
- buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
- gtk_text_buffer_get_iter_at_offset (buf, &iter, start);
- /* quickly move both 'insert' and 'selection_bound' to the
- same position */
- gtk_text_buffer_place_cursor (buf, &iter);
- gtk_text_buffer_get_iter_at_offset (buf, &iter, end);
- gtk_text_buffer_move_mark_by_name (buf, "selection_bound", &iter);
- }
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setEditable
- (JNIEnv *env, jobject obj, jboolean state)
-{
- void *ptr;
- GtkEditable *editable;
- GtkWidget *text = NULL;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- if (GTK_IS_EDITABLE (ptr))
- {
- editable = GTK_EDITABLE (ptr);
- gtk_editable_set_editable (editable, state);
- }
- else
- {
- if (GTK_IS_SCROLLED_WINDOW (ptr))
- {
- text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
- }
- else if (GTK_IS_TEXT_VIEW (ptr))
- {
- text = GTK_WIDGET (ptr);
- }
-
- if (text)
- {
- gtk_text_view_set_editable (GTK_TEXT_VIEW (text), state);
- }
- }
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT jstring JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getText
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- char *contents = NULL;
- jstring jcontents;
- GtkEditable *editable;
- GtkWidget *text = NULL;
- GtkTextBuffer *buf;
- GtkTextIter start, end;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- if (GTK_IS_EDITABLE (ptr))
- {
- editable = GTK_EDITABLE (ptr);
- contents = gtk_editable_get_chars (editable, 0, -1);
- }
- else
- {
- if (GTK_IS_SCROLLED_WINDOW (ptr))
- {
- text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
- }
- else if (GTK_IS_TEXT_VIEW (ptr))
- {
- text = GTK_WIDGET (ptr);
- }
-
- if (text)
- {
- buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
- gtk_text_buffer_get_start_iter (buf, &start);
- gtk_text_buffer_get_end_iter (buf, &end);
- contents = gtk_text_buffer_get_text (buf, &start, &end, FALSE);
- }
- }
-
- gdk_threads_leave ();
-
- jcontents = (*env)->NewStringUTF (env, contents);
- g_free (contents);
-
- return jcontents;
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setText
- (JNIEnv *env, jobject obj, jstring contents)
-{
- void *ptr;
- const char *str;
- GtkWidget *text = NULL;
- GtkTextBuffer *buf;
-
- ptr = NSA_GET_PTR (env, obj);
- str = (*env)->GetStringUTFChars (env, contents, NULL);
-
- gdk_threads_enter ();
-
- if (GTK_IS_EDITABLE (ptr))
- {
- gtk_entry_set_text (GTK_ENTRY (ptr), str);
- }
- else
- {
- if (GTK_IS_SCROLLED_WINDOW (ptr))
- {
- text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child));
- }
- else if (GTK_IS_TEXT_VIEW (ptr))
- {
- text = GTK_WIDGET (ptr);
- }
-
- if (text)
- {
- buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
- gtk_text_buffer_set_text (buf, str, strlen (str));
- }
- }
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, contents, str);
-}
-
-static void
-textcomponent_changed_cb (GtkEditable *editable __attribute__((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer, postTextEventID);
- gdk_threads_enter ();
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
deleted file mode 100644
index b7e4a1677a7..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* gtktextfieldpeer.c -- Native implementation of GtkTextFieldPeer
- Copyright (C) 1998, 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkTextFieldPeer.h"
-
-static jint
-get_border_width (GtkWidget *entry);
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create
- (JNIEnv *env, jobject obj, jint text_width)
-{
- GtkWidget *entry;
-
- /* Create global reference and save it for future use */
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- entry = gtk_entry_new ();
- gtk_widget_set_size_request (entry,
- text_width + 2 * get_border_width (entry), -1);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, entry);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkWidgetSetBackground
- (JNIEnv *env, jobject obj, jint red, jint green, jint blue)
-{
- GdkColor color;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- color.red = (red / 255.0) * 65535;
- color.green = (green / 255.0) * 65535;
- color.blue = (blue / 255.0) * 65535;
-
- gdk_threads_enter ();
-
- gtk_widget_modify_base (GTK_WIDGET (ptr), GTK_STATE_NORMAL, &color);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkWidgetSetForeground
- (JNIEnv *env, jobject obj, jint red, jint green, jint blue)
-{
- GdkColor color;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- color.red = (red / 255.0) * 65535;
- color.green = (green / 255.0) * 65535;
- color.blue = (blue / 255.0) * 65535;
-
- gdk_threads_enter ();
-
- gtk_widget_modify_text (GTK_WIDGET (ptr), GTK_STATE_NORMAL, &color);
- gtk_widget_modify_base (GTK_WIDGET (ptr), GTK_STATE_SELECTED, &color);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkEntryGetBorderWidth
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- int border_width = 0;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- border_width = get_border_width (GTK_WIDGET (ptr));
-
- gdk_threads_leave ();
-
- return border_width;
-}
-
-/* GTK hard-codes this value. It is the space between a GtkEntry's
- frame and its text. */
-#define INNER_BORDER 2
-
-static jint
-get_border_width (GtkWidget *entry)
-{
- gint focus_width;
- gboolean interior_focus;
- int x_border_width = INNER_BORDER;
-
- gtk_widget_style_get (entry,
- "interior-focus", &interior_focus,
- "focus-line-width", &focus_width,
- NULL);
-
- if (GTK_ENTRY (entry)->has_frame)
- x_border_width += entry->style->xthickness;
-
- if (!interior_focus)
- x_border_width += focus_width;
-
- return x_border_width;
-}
-
-#undef INNER_BORDER
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_setEchoChar
- (JNIEnv *env, jobject obj, jchar c)
-{
- void *ptr;
- GtkEntry *entry;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- entry = GTK_ENTRY (ptr);
-
- if (c != 0)
- {
- /* FIXME: use gtk_entry_set_invisible_char (GtkEntry *entry,
- gunichar ch) here. That means we must convert from jchar
- (utf16) to gunichar (ucs4). */
- gtk_entry_set_visibility (entry, FALSE);
- }
- else
- gtk_entry_set_visibility (entry, TRUE);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkWidgetModifyFont
- (JNIEnv *env, jobject obj, jstring name, jint style, jint size)
-{
- const char *font_name;
- void *ptr;
- GtkWidget *entry;
- PangoFontDescription *font_desc;
-
- ptr = NSA_GET_PTR (env, obj);
-
- entry = GTK_WIDGET (ptr);
- font_name = (*env)->GetStringUTFChars (env, name, NULL);
-
- gdk_threads_enter();
-
- font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size * dpi_conversion_factor);
-
- if (style & AWT_STYLE_BOLD)
- pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
-
- if (style & AWT_STYLE_ITALIC)
- pango_font_description_set_style (font_desc, PANGO_STYLE_OBLIQUE);
-
- gtk_widget_modify_font (GTK_WIDGET(entry), font_desc);
-
- pango_font_description_free (font_desc);
-
- gdk_threads_leave();
-
- (*env)->ReleaseStringUTFChars (env, name, font_name);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
deleted file mode 100644
index e831bc4c458..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
+++ /dev/null
@@ -1,537 +0,0 @@
-/* gtktoolkit.c -- Native portion of GtkToolkit
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkToolkit.h"
-#include "gthread-jni.h"
-
-#include <sys/time.h>
-
-#ifdef JVM_SUN
- struct state_table *native_state_table;
- struct state_table *native_global_ref_table;
-#endif
-
-jmethodID setBoundsCallbackID;
-
-jmethodID postActionEventID;
-jmethodID postMenuActionEventID;
-jmethodID postMouseEventID;
-jmethodID postConfigureEventID;
-jmethodID postExposeEventID;
-jmethodID postKeyEventID;
-jmethodID postFocusEventID;
-jmethodID postAdjustmentEventID;
-jmethodID postItemEventID;
-jmethodID choicePostItemEventID;
-jmethodID postListItemEventID;
-jmethodID postTextEventID;
-jmethodID postWindowEventID;
-jmethodID postInsetsChangedEventID;
-jmethodID windowGetWidthID;
-jmethodID windowGetHeightID;
-
-jmethodID beginNativeRepaintID;
-jmethodID endNativeRepaintID;
-
-jmethodID initComponentGraphicsID;
-jmethodID initComponentGraphics2DID;
-jmethodID setCursorID;
-
-JavaVM *java_vm;
-
-union env_union
-{
- void *void_env;
- JNIEnv *jni_env;
-};
-
-JNIEnv *
-gdk_env()
-{
- union env_union tmp;
- g_assert((*java_vm)->GetEnv(java_vm, &tmp.void_env, JNI_VERSION_1_2) == JNI_OK);
- return tmp.jni_env;
-}
-
-
-GtkWindowGroup *global_gtk_window_group;
-
-static void init_glib_threads(JNIEnv *, jint);
-
-double dpi_conversion_factor;
-
-static void init_dpi_conversion_factor (void);
-static void dpi_changed_cb (GtkSettings *settings,
- GParamSpec *pspec);
-
-/*
- * Call gtk_init. It is very important that this happen before any other
- * gtk calls.
- *
- * The portableNativeSync argument may have the values:
- * 1 if the Java property gnu.classpath.awt.gtk.portable.native.sync
- * is set to "true".
- * 0 if it is set to "false"
- * -1 if unset.
- */
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit (JNIEnv *env,
- jclass clazz __attribute__((unused)),
- jint portableNativeSync)
-{
- int argc = 1;
- char **argv;
- char *homedir, *rcpath = NULL;
-
- jclass gtkgenericpeer, gtkcomponentpeer, gtkchoicepeer, gtkwindowpeer, gtkscrollbarpeer, gtklistpeer,
- gtkmenuitempeer, gtktextcomponentpeer, window, gdkgraphics, gdkgraphics2d;
-
- gtkgenericpeer = (*env)->FindClass(env, "gnu/java/awt/peer/gtk/GtkGenericPeer");
-
- NSA_INIT (env, gtkgenericpeer);
-
- g_assert((*env)->GetJavaVM(env, &java_vm) == 0);
-
- /* GTK requires a program's argc and argv variables, and requires that they
- be valid. Set it up. */
- argv = (char **) g_malloc (sizeof (char *) * 2);
- argv[0] = (char *) g_malloc(1);
-#if 1
- strcpy(argv[0], "");
-#else /* The following is a more efficient alternative, but less intuitively
- * expresses what we are trying to do. This code is only run once, so
- * I'm going for intuitive. */
- argv[0][0] = '\0';
-#endif
- argv[1] = NULL;
-
- init_glib_threads(env, portableNativeSync);
-
- /* From GDK 2.0 onwards we have to explicitly call gdk_threads_init */
- gdk_threads_init();
-
- gtk_init (&argc, &argv);
-
- gdk_rgb_init ();
- gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
- gtk_widget_set_default_visual (gdk_rgb_get_visual ());
-
- /* Make sure queued calls don't get sent to GTK/GDK while
- we're shutting down. */
- atexit (gdk_threads_enter);
-
- gdk_event_handler_set ((GdkEventFunc)awt_event_handler, NULL, NULL);
-
- if ((homedir = getenv ("HOME")))
- {
- rcpath = (char *) g_malloc (strlen (homedir) + strlen (RC_FILE) + 2);
- sprintf (rcpath, "%s/%s", homedir, RC_FILE);
- }
-
- gtk_rc_parse ((rcpath) ? rcpath : RC_FILE);
-
- g_free (rcpath);
- g_free (argv[0]);
- g_free (argv);
-
- /* setup cached IDs for posting GTK events to Java */
-
- window = (*env)->FindClass (env, "java/awt/Window");
-
- gtkcomponentpeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkComponentPeer");
- gtkchoicepeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkChoicePeer");
- gtkwindowpeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkWindowPeer");
- gtkscrollbarpeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkScrollbarPeer");
- gtklistpeer = (*env)->FindClass (env, "gnu/java/awt/peer/gtk/GtkListPeer");
- gtkmenuitempeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkMenuItemPeer");
- gtktextcomponentpeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkTextComponentPeer");
- gdkgraphics = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GdkGraphics");
- gdkgraphics2d = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GdkGraphics2D");
- setBoundsCallbackID = (*env)->GetMethodID (env, window,
- "setBoundsCallback",
- "(IIII)V");
-
- postMenuActionEventID = (*env)->GetMethodID (env, gtkmenuitempeer,
- "postMenuActionEvent",
- "()V");
- postMouseEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postMouseEvent", "(IJIIIIZ)V");
- setCursorID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "setCursor", "()V");
- beginNativeRepaintID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "beginNativeRepaint", "()V");
-
- endNativeRepaintID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "endNativeRepaint", "()V");
-
- postConfigureEventID = (*env)->GetMethodID (env, gtkwindowpeer,
- "postConfigureEvent", "(IIII)V");
- postWindowEventID = (*env)->GetMethodID (env, gtkwindowpeer,
- "postWindowEvent",
- "(ILjava/awt/Window;I)V");
- postInsetsChangedEventID = (*env)->GetMethodID (env, gtkwindowpeer,
- "postInsetsChangedEvent",
- "(IIII)V");
- windowGetWidthID = (*env)->GetMethodID (env, gtkwindowpeer,
- "getWidth", "()I");
- windowGetHeightID = (*env)->GetMethodID (env, gtkwindowpeer,
- "getHeight", "()I");
-
- postExposeEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postExposeEvent", "(IIII)V");
- postKeyEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postKeyEvent", "(IJIICI)V");
- postFocusEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postFocusEvent", "(IZ)V");
- postAdjustmentEventID = (*env)->GetMethodID (env, gtkscrollbarpeer,
- "postAdjustmentEvent",
- "(II)V");
- postItemEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postItemEvent",
- "(Ljava/lang/Object;I)V");
- choicePostItemEventID = (*env)->GetMethodID (env, gtkchoicepeer,
- "choicePostItemEvent",
- "(Ljava/lang/String;I)V");
- postListItemEventID = (*env)->GetMethodID (env, gtklistpeer,
- "postItemEvent",
- "(II)V");
- postTextEventID = (*env)->GetMethodID (env, gtktextcomponentpeer,
- "postTextEvent",
- "()V");
- initComponentGraphicsID = (*env)->GetMethodID (env, gdkgraphics,
- "initComponentGraphics",
- "()V");
- initComponentGraphics2DID = (*env)->GetMethodID (env, gdkgraphics2d,
- "initComponentGraphics2D",
- "()V");
- global_gtk_window_group = gtk_window_group_new ();
-
- init_dpi_conversion_factor ();
-}
-
-
-/** Initialize GLIB's threads properly, based on the value of the
- gnu.classpath.awt.gtk.portable.native.sync Java system property. If
- that's unset, use the PORTABLE_NATIVE_SYNC config.h macro. (TODO:
- In some release following 0.10, that config.h macro will go away.)
- */
-static void
-init_glib_threads(JNIEnv *env, jint portableNativeSync)
-{
- if (portableNativeSync < 0)
- {
-#ifdef PORTABLE_NATIVE_SYNC /* Default value, if not set by the Java system
- property */
- portableNativeSync = 1;
-#else
- portableNativeSync = 0;
-#endif
- }
-
- (*env)->GetJavaVM( env, &the_vm );
- if (!g_thread_supported ())
- {
- if (portableNativeSync)
- g_thread_init ( &portable_native_sync_jni_functions );
- else
- g_thread_init ( NULL );
- }
- else
- {
- /* Warn if portable native sync is desired but the threading
- system is already initialized. In that case we can't
- override the threading implementation with our portable
- native sync functions. */
- if (portableNativeSync)
- g_printerr ("peer warning: portable native sync disabled.\n");
- }
-
- /* Debugging progress message; uncomment if needed: */
- /* printf("called gthread init\n"); */
-}
-
-
-/* This is a big hack, needed until this pango bug is resolved:
- http://bugzilla.gnome.org/show_bug.cgi?id=119081.
- See: http://mail.gnome.org/archives/gtk-i18n-list/2003-August/msg00001.html
- for details. */
-static void
-init_dpi_conversion_factor ()
-{
- GtkSettings *settings = gtk_settings_get_default ();
- GObjectClass *klass;
-
- klass = G_OBJECT_CLASS (GTK_SETTINGS_GET_CLASS (settings));
- if (g_object_class_find_property (klass, "gtk-xft-dpi"))
- {
- int int_dpi;
- g_object_get (settings, "gtk-xft-dpi", &int_dpi, NULL);
- /* If int_dpi == -1 gtk-xft-dpi returns the default value. So we
- have to do approximate calculation here. */
- if (int_dpi < 0)
- dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
- else
- dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
-
- g_signal_connect (settings, "notify::gtk-xft-dpi",
- G_CALLBACK (dpi_changed_cb), NULL);
- }
- else
- /* Approximate. */
- dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
-}
-
-static void
-dpi_changed_cb (GtkSettings *settings,
- GParamSpec *pspec __attribute__((unused)))
-{
- int int_dpi;
- g_object_get (settings, "gtk-xft-dpi", &int_dpi, NULL);
- if (int_dpi < 0)
- dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
- else
- dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
-}
-
-static int
-within_human_latency_tolerance(struct timeval *init)
-{
- struct timeval curr;
- unsigned long milliseconds_elapsed;
-
- gettimeofday(&curr, NULL);
-
- milliseconds_elapsed = (((curr.tv_sec * 1000) + (curr.tv_usec / 1000))
- - ((init->tv_sec * 1000) + (init->tv_usec / 1000)));
-
- return milliseconds_elapsed < 100;
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkToolkit_iterateNativeQueue
-(JNIEnv *env,
- jobject self __attribute__((unused)),
- jobject lockedQueue,
- jboolean block)
-{
- /* We're holding an EventQueue lock, and we're about to acquire the GDK
- * lock before dropping the EventQueue lock. This can deadlock if someone
- * holds the GDK lock and wants to acquire the EventQueue lock; however
- * all callbacks from GTK happen with the GDK lock released, so this
- * would only happen in an odd case such as some JNI helper code
- * acquiring the GDK lock and calling back into
- * EventQueue.getNextEvent().
- */
-
- struct timeval init;
- gettimeofday(&init, NULL);
-
- gdk_threads_enter ();
- (*env)->MonitorExit (env, lockedQueue);
-
- if (block)
- {
-
- /* If we're blocking-when-empty, we want a do .. while loop. */
- do
- gtk_main_iteration ();
- while (within_human_latency_tolerance (&init)
- && gtk_events_pending ());
- }
- else
- {
- /* If we're not blocking-when-empty, we want a while loop. */
- while (within_human_latency_tolerance (&init)
- && gtk_events_pending ())
- gtk_main_iteration ();
- }
-
- (*env)->MonitorEnter (env, lockedQueue);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkToolkit_wakeNativeQueue
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
-{
- g_main_context_wakeup (NULL);
-}
-
-JNIEXPORT jboolean JNICALL
-Java_gnu_java_awt_peer_gtk_GtkToolkit_nativeQueueEmpty
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
-{
- jboolean empty = FALSE;
- gdk_threads_enter ();
- empty = ! gtk_events_pending();
- gdk_threads_leave ();
- return empty;
-}
-
-
-static jint gdk_color_to_java_color (GdkColor color);
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkToolkit_beep
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
-{
- gdk_threads_enter ();
- gdk_beep ();
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkToolkit_sync
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
-{
- gdk_threads_enter ();
- gdk_flush ();
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkToolkit_getScreenSizeDimensions
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
- jintArray jdims)
-{
- jint *dims = (*env)->GetIntArrayElements (env, jdims, 0);
-
- gdk_threads_enter ();
-
- dims[0] = gdk_screen_width ();
- dims[1] = gdk_screen_height ();
-
- gdk_threads_leave ();
-
- (*env)->ReleaseIntArrayElements(env, jdims, dims, 0);
-}
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GtkToolkit_getScreenResolution
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
-{
- jint res;
-
- gdk_threads_enter ();
-
- res = gdk_screen_width () / (gdk_screen_width_mm () / 25.4);
-
- gdk_threads_leave ();
- return res;
-}
-
-#define CONVERT(type, state) \
- gdk_color_to_java_color (style->type[GTK_STATE_ ## state])
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkToolkit_loadSystemColors
- (JNIEnv *env, jobject obj __attribute__((unused)),
- jintArray jcolors)
-{
- jint *colors;
- GtkStyle *style;
-
- colors = (*env)->GetIntArrayElements (env, jcolors, 0);
-
- gdk_threads_enter ();
-
- style = gtk_widget_get_default_style ();
-
- colors[AWT_DESKTOP] = CONVERT (bg, SELECTED);
- colors[AWT_ACTIVE_CAPTION] = CONVERT (bg, SELECTED);
- colors[AWT_ACTIVE_CAPTION_TEXT] = CONVERT (text, SELECTED);
- colors[AWT_ACTIVE_CAPTION_BORDER] = CONVERT (fg, NORMAL);
- colors[AWT_INACTIVE_CAPTION] = CONVERT (base, INSENSITIVE);
- colors[AWT_INACTIVE_CAPTION_TEXT] = CONVERT (fg, INSENSITIVE);
- colors[AWT_INACTIVE_CAPTION_BORDER] = CONVERT (fg, INSENSITIVE);
- colors[AWT_WINDOW] = CONVERT (bg, NORMAL);
- colors[AWT_WINDOW_BORDER] = CONVERT (fg, NORMAL);
- colors[AWT_WINDOW_TEXT] = CONVERT (fg, NORMAL);
- colors[AWT_MENU] = CONVERT (bg, NORMAL);
- colors[AWT_MENU_TEXT] = CONVERT (fg, NORMAL);
- colors[AWT_TEXT] = CONVERT (bg, NORMAL);
- colors[AWT_TEXT_TEXT] = CONVERT (fg, NORMAL);
- colors[AWT_TEXT_HIGHLIGHT] = CONVERT (bg, SELECTED);
- colors[AWT_TEXT_HIGHLIGHT_TEXT] = CONVERT (fg, SELECTED);
- colors[AWT_TEXT_INACTIVE_TEXT] = CONVERT (bg, INSENSITIVE);
- colors[AWT_CONTROL] = CONVERT (bg, NORMAL);
- colors[AWT_CONTROL_TEXT] = CONVERT (fg, NORMAL);
- colors[AWT_CONTROL_HIGHLIGHT] = CONVERT (base, ACTIVE);
- colors[AWT_CONTROL_LT_HIGHLIGHT] = CONVERT (bg, PRELIGHT);
- colors[AWT_CONTROL_SHADOW] = CONVERT (bg, ACTIVE);
- colors[AWT_CONTROL_DK_SHADOW] = CONVERT (fg, INSENSITIVE);
- colors[AWT_SCROLLBAR] = CONVERT (base, INSENSITIVE);
- colors[AWT_INFO] = CONVERT (bg, NORMAL);
- colors[AWT_INFO_TEXT] = CONVERT (fg, NORMAL);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseIntArrayElements(env, jcolors, colors, 0);
-}
-
-#undef CONVERT
-
-static jint
-gdk_color_to_java_color (GdkColor gdk_color)
-{
- guchar red;
- guchar green;
- guchar blue;
- float factor;
-
- factor = 255.0 / 65535.0;
-
- red = (float) gdk_color.red * factor;
- green = (float) gdk_color.green * factor;
- blue = (float) gdk_color.blue * factor;
-
- return (jint) (0xff000000 | (red << 16) | (green << 8) | blue);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
deleted file mode 100644
index 8136416d6a5..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+++ /dev/null
@@ -1,744 +0,0 @@
-/* gtkwindowpeer.c -- Native implementation of GtkWindowPeer
- Copyright (C) 1998, 1999, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 "gnu_java_awt_peer_gtk_GtkWindowPeer.h"
-#include <gdk/gdkprivate.h>
-#include <gdk/gdkx.h>
-#include <X11/Xatom.h>
-
-/* FIXME: we're currently seeing the double-activation that occurs
- with metacity and GTK. See
- http://bugzilla.gnome.org/show_bug.cgi?id=140977 for details. */
-
-static void window_get_frame_extents (GtkWidget *window,
- int *top, int *left,
- int *bottom, int *right);
-
-static void request_frame_extents (GtkWidget *window);
-
-static Bool property_notify_predicate (Display *display,
- XEvent *xevent,
- XPointer arg);
-
-static gboolean window_delete_cb (GtkWidget *widget, GdkEvent *event,
- jobject peer);
-static void window_destroy_cb (GtkWidget *widget, GdkEvent *event,
- jobject peer);
-static void window_show_cb (GtkWidget *widget, jobject peer);
-static void window_active_state_change_cb (GtkWidget *widget,
- GParamSpec *pspec,
- jobject peer);
-static void window_focus_state_change_cb (GtkWidget *widget,
- GParamSpec *pspec,
- jobject peer);
-static gboolean window_focus_in_cb (GtkWidget * widget,
- GdkEventFocus *event,
- jobject peer);
-static gboolean window_focus_out_cb (GtkWidget * widget,
- GdkEventFocus *event,
- jobject peer);
-static gboolean window_window_state_cb (GtkWidget *widget,
- GdkEvent *event,
- jobject peer);
-static jint window_get_new_state (GtkWidget *widget);
-static gboolean window_property_changed_cb (GtkWidget *widget,
- GdkEventProperty *event,
- jobject peer);
-static void realize_cb (GtkWidget *widget, jobject peer);
-
-/* Union used for type punning. */
-union extents_union
-{
- guchar **gu_extents;
- unsigned long **extents;
-};
-
-union atom_list_union
-{
- guchar **gu_extents;
- Atom **atom_list;
-};
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create
- (JNIEnv *env, jobject obj, jint type, jboolean decorated, jobject parent)
-{
- GtkWidget *window_widget;
- GtkWindow *window;
- void *window_parent;
- GtkWidget *fixed;
-
- NSA_SET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- window_widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- window = GTK_WINDOW (window_widget);
-
- /* Keep this window in front of its parent, if it has one. */
- if (parent)
- {
- window_parent = NSA_GET_PTR (env, parent);
- gtk_window_set_transient_for (window, GTK_WINDOW(window_parent));
- }
-
- gtk_window_set_decorated (window, decorated);
-
- gtk_window_set_type_hint (window, type);
-
- gtk_window_group_add_window (global_gtk_window_group, window);
-
- fixed = gtk_fixed_new ();
- gtk_container_add (GTK_CONTAINER (window_widget), fixed);
-
- gtk_widget_show (fixed);
-
- gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, window_widget);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_gtkWindowSetTitle
- (JNIEnv *env, jobject obj, jstring title)
-{
- const char *c_title;
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- c_title = (*env)->GetStringUTFChars (env, title, NULL);
-
- gdk_threads_enter ();
-
- gtk_window_set_title (GTK_WINDOW (ptr), c_title);
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, title, c_title);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_gtkWindowSetResizable
- (JNIEnv *env, jobject obj, jboolean resizable)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- gtk_window_set_policy (GTK_WINDOW (ptr), resizable, resizable, FALSE);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_gtkWindowSetModal
- (JNIEnv *env, jobject obj, jboolean modal)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- gtk_window_set_modal (GTK_WINDOW (ptr), modal);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_nativeSetVisible
- (JNIEnv *env, jobject obj, jboolean visible)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- if (visible)
- gtk_widget_show (GTK_WIDGET (ptr));
- else
- gtk_widget_hide (GTK_WIDGET (ptr));
-
- XFlush (GDK_DISPLAY ());
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
- jobject *gref;
-
- ptr = NSA_GET_PTR (env, obj);
- gref = NSA_GET_GLOBAL_REF (env, obj);
-
- gdk_threads_enter ();
-
- g_signal_connect (G_OBJECT (ptr), "event",
- G_CALLBACK (pre_event_handler), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "delete-event",
- G_CALLBACK (window_delete_cb), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "destroy-event",
- G_CALLBACK (window_destroy_cb), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "show",
- G_CALLBACK (window_show_cb), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "notify::is-active",
- G_CALLBACK (window_active_state_change_cb), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "notify::has-toplevel-focus",
- G_CALLBACK (window_focus_state_change_cb), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "focus-in-event",
- G_CALLBACK (window_focus_in_cb), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "focus-out-event",
- G_CALLBACK (window_focus_out_cb), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "window-state-event",
- G_CALLBACK (window_window_state_cb), *gref);
-
- g_signal_connect (G_OBJECT (ptr), "property-notify-event",
- G_CALLBACK (window_property_changed_cb), *gref);
-
- g_signal_connect_after (G_OBJECT (ptr), "realize",
- G_CALLBACK (realize_cb), *gref);
-
- g_signal_connect_after (G_OBJECT (ptr), "realize",
- G_CALLBACK (connect_awt_hook_cb), *gref);
-
-
- /* Realize the window here so that its frame extents are known now.
- That way Window.pack can operate with the accurate insets
- returned by the window manager rather than the default
- estimates. */
- gtk_widget_realize (GTK_WIDGET (ptr));
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_toBack (JNIEnv *env,
- jobject obj)
-{
- void *ptr;
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- gdk_window_lower (GTK_WIDGET (ptr)->window);
- gdk_flush ();
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_toFront (JNIEnv *env,
- jobject obj)
-{
- void *ptr;
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
-
- gdk_window_raise (GTK_WIDGET (ptr)->window);
- gdk_flush ();
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setBoundsCallback
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
- jobject window, jint x, jint y, jint width, jint height)
-{
- /* Circumvent package-private access to call Window's
- setBoundsCallback method. */
- (*gdk_env())->CallVoidMethod (gdk_env(), window, setBoundsCallbackID,
- x, y, width, height);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setSize
- (JNIEnv *env, jobject obj, jint width, jint height)
-{
- void *ptr = NSA_GET_PTR (env, obj);
-
- /* Avoid GTK runtime assertion failures. */
- width = (width < 1) ? 1 : width;
- height = (height < 1) ? 1 : height;
-
- gdk_threads_enter ();
-
- gtk_widget_set_size_request (GTK_WIDGET(ptr), width, height);
-
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_nativeSetBounds
- (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
-{
- void *ptr = NSA_GET_PTR (env, obj);
-
- /* Avoid GTK runtime assertion failures. */
- width = (width < 1) ? 1 : width;
- height = (height < 1) ? 1 : height;
-
- gdk_threads_enter ();
-
- gtk_window_move (GTK_WINDOW(ptr), x, y);
- /* The call to gdk_window_move is needed in addition to the call to
- gtk_window_move. If gdk_window_move isn't called, then the
- following set of operations doesn't give the expected results:
-
- 1. show a window
- 2. manually move it to another position on the screen
- 3. hide the window
- 4. reposition the window with Component.setLocation
- 5. show the window
-
- Instead of being at the position set by setLocation, the window
- is reshown at the position to which it was moved manually. */
- if (GTK_WIDGET (ptr)->window != NULL)
- gdk_window_move (GTK_WIDGET (ptr)->window, x, y);
-
- /* Need to change the widget's request size. */
- gtk_widget_set_size_request (GTK_WIDGET(ptr), width, height);
- /* Also need to call gtk_window_resize. If the resize is requested
- by the program and the window's "resizable" property is true then
- the size request will not be honoured. */
- gtk_window_resize (GTK_WINDOW (ptr), width, height);
- gdk_threads_leave ();
-}
-
-static void
-window_get_frame_extents (GtkWidget *window,
- int *top, int *left, int *bottom, int *right)
-{
- unsigned long *extents = NULL;
- union extents_union gu_ex;
-
- /* Guess frame extents in case _NET_FRAME_EXTENTS is not
- supported. */
- *top = 23;
- *left = 6;
- *bottom = 6;
- *right = 6;
-
- /* Request that the window manager set window's
- _NET_FRAME_EXTENTS property. */
- request_frame_extents (window);
-
- /* Attempt to retrieve window's frame extents. */
- gu_ex.extents = &extents;
- if (gdk_property_get (window->window,
- gdk_atom_intern ("_NET_FRAME_EXTENTS", FALSE),
- gdk_atom_intern ("CARDINAL", FALSE),
- 0,
- sizeof (unsigned long) * 4,
- FALSE,
- NULL,
- NULL,
- NULL,
- gu_ex.gu_extents))
- {
- *left = extents [0];
- *right = extents [1];
- *top = extents [2];
- *bottom = extents [3];
- }
-}
-
-static Atom extents_atom = 0;
-
-/* Requests that the window manager set window's
- _NET_FRAME_EXTENTS property. */
-static void
-request_frame_extents (GtkWidget *window)
-{
- const char *request_str = "_NET_REQUEST_FRAME_EXTENTS";
- GdkAtom request_extents = gdk_atom_intern (request_str, FALSE);
-
- /* Check if the current window manager supports
- _NET_REQUEST_FRAME_EXTENTS. */
- if (gdk_net_wm_supports (request_extents))
- {
- GdkDisplay *display = gtk_widget_get_display (window);
- Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- GdkWindow *root_window = gdk_get_default_root_window ();
- Window xroot_window = GDK_WINDOW_XID (root_window);
-
- Atom extents_request_atom =
- gdk_x11_get_xatom_by_name_for_display (display, request_str);
-
- XEvent xevent;
- XEvent notify_xevent;
-
- unsigned long window_id = GDK_WINDOW_XID (GDK_DRAWABLE(window->window));
-
- if (!extents_atom)
- {
- const char *extents_str = "_NET_FRAME_EXTENTS";
- extents_atom =
- gdk_x11_get_xatom_by_name_for_display (display, extents_str);
- }
-
- xevent.xclient.type = ClientMessage;
- xevent.xclient.message_type = extents_request_atom;
- xevent.xclient.display = xdisplay;
- xevent.xclient.window = window_id;
- xevent.xclient.format = 32;
- xevent.xclient.data.l[0] = 0;
- xevent.xclient.data.l[1] = 0;
- xevent.xclient.data.l[2] = 0;
- xevent.xclient.data.l[3] = 0;
- xevent.xclient.data.l[4] = 0;
-
- XSendEvent (xdisplay, xroot_window, False,
- (SubstructureRedirectMask | SubstructureNotifyMask),
- &xevent);
-
- XIfEvent(xdisplay, &notify_xevent,
- property_notify_predicate, (XPointer) &window_id);
- }
-}
-
-static Bool
-property_notify_predicate (Display *xdisplay __attribute__((unused)),
- XEvent *event,
- XPointer window_id)
-{
- unsigned long *window = (unsigned long *) window_id;
-
- if (event->xany.type == PropertyNotify
- && event->xany.window == *window
- && event->xproperty.atom == extents_atom)
- return True;
- else
- return False;
-}
-
-static gboolean
-window_delete_cb (GtkWidget *widget __attribute__((unused)),
- GdkEvent *event __attribute__((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_CLOSING,
- (jobject) NULL, (jint) 0);
- gdk_threads_enter ();
-
- /* Prevents that the Window dissappears ("destroy"
- not being signalled). This is necessary because it
- should be up to a WindowListener implementation
- how the AWT Frame responds to close requests. */
- return TRUE;
-}
-
-static void
-window_destroy_cb (GtkWidget *widget __attribute__((unused)),
- GdkEvent *event __attribute__((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_CLOSED,
- (jobject) NULL, (jint) 0);
- gdk_threads_enter ();
-}
-
-static void
-window_show_cb (GtkWidget *widget __attribute__((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_OPENED,
- (jobject) NULL, (jint) 0);
- gdk_threads_enter ();
-}
-
-static void
-window_active_state_change_cb (GtkWidget *widget __attribute__((unused)),
- GParamSpec *pspec __attribute__((unused)),
- jobject peer __attribute__((unused)))
-{
- /* FIXME: not sure if this is needed or not. */
- /* Remove the unused attributes if you fix the below. */
-#if 0
- gdk_threads_leave ();
- if (GTK_WINDOW (widget)->is_active)
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_GAINED_FOCUS,
- (jobject) NULL, (jint) 0);
- else
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_DEACTIVATED,
- (jobject) NULL, (jint) 0);
- gdk_threads_enter ();
-#endif
-}
-
-static void
-window_focus_state_change_cb (GtkWidget *widget,
- GParamSpec *pspec __attribute__((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- if (GTK_WINDOW (widget)->has_toplevel_focus)
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_ACTIVATED,
- (jobject) NULL, (jint) 0);
- else
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_DEACTIVATED,
- (jobject) NULL, (jint) 0);
- gdk_threads_enter ();
-}
-
-static gboolean
-window_focus_in_cb (GtkWidget * widget __attribute__((unused)),
- GdkEventFocus *event __attribute__((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_GAINED_FOCUS,
- (jobject) NULL, (jint) 0);
- /* FIXME: somewhere after this is handled, the child window is
- getting an expose event. */
- gdk_threads_enter ();
- return FALSE;
-}
-
-static gboolean
-window_focus_out_cb (GtkWidget * widget __attribute__((unused)),
- GdkEventFocus *event __attribute__((unused)),
- jobject peer)
-{
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_LOST_FOCUS,
- (jobject) NULL, (jint) 0);
- /* FIXME: somewhere after this is handled, the child window is
- getting an expose event. */
- gdk_threads_enter ();
- return FALSE;
-}
-
-static gboolean
-window_window_state_cb (GtkWidget *widget,
- GdkEvent *event,
- jobject peer)
-{
- jint new_state;
-
- /* Handle WINDOW_ICONIFIED and WINDOW_DEICONIFIED events. */
- if (event->window_state.changed_mask & GDK_WINDOW_STATE_ICONIFIED)
- {
- /* We've either been iconified or deiconified. */
- if (event->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED)
- {
- /* We've been iconified. */
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_ICONIFIED,
- (jobject) NULL, (jint) 0);
- gdk_threads_enter ();
- }
- else
- {
- /* We've been deiconified. */
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_DEICONIFIED,
- (jobject) NULL, (jint) 0);
- gdk_threads_enter ();
- }
- }
-
- /* Post a WINDOW_STATE_CHANGED event, passing the new frame state to
- GtkWindowPeer. */
- new_state = AWT_FRAME_STATE_NORMAL;
-
- if (event->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED)
- new_state |= AWT_FRAME_STATE_ICONIFIED;
-
- new_state |= window_get_new_state (widget);
-
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_STATE_CHANGED,
- (jobject) NULL, new_state);
- gdk_threads_enter ();
- return TRUE;
-}
-
-static jint
-window_get_new_state (GtkWidget *widget)
-{
- GdkDisplay *display = gtk_widget_get_display(widget);
- jint new_state = AWT_FRAME_STATE_NORMAL;
- Atom type;
- gint format;
- gulong atom_count;
- gulong bytes_after;
- Atom *atom_list = NULL;
- union atom_list_union alu;
- gulong i;
-
- alu.atom_list = &atom_list;
- XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XID (widget->window),
- gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
- 0, G_MAXLONG, False, XA_ATOM, &type, &format, &atom_count,
- &bytes_after, alu.gu_extents);
-
- if (type != None)
- {
- Atom maxvert = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_VERT");
- Atom maxhorz = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_HORZ");
-
- i = 0;
- while (i < atom_count)
- {
- if (atom_list[i] == maxhorz)
- new_state |= AWT_FRAME_STATE_MAXIMIZED_HORIZ;
- else if (atom_list[i] == maxvert)
- new_state |= AWT_FRAME_STATE_MAXIMIZED_VERT;
-
- ++i;
- }
-
- XFree (atom_list);
- }
- return new_state;
-}
-
-static gboolean
-window_property_changed_cb (GtkWidget *widget __attribute__((unused)),
- GdkEventProperty *event,
- jobject peer)
-{
- unsigned long *extents;
- union extents_union gu_ex;
-
- gu_ex.extents = &extents;
- if (gdk_atom_intern ("_NET_FRAME_EXTENTS", FALSE) == event->atom
- && gdk_property_get (event->window,
- gdk_atom_intern ("_NET_FRAME_EXTENTS", FALSE),
- gdk_atom_intern ("CARDINAL", FALSE),
- 0,
- sizeof (unsigned long) * 4,
- FALSE,
- NULL,
- NULL,
- NULL,
- gu_ex.gu_extents))
- {
- gdk_threads_leave ();
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postInsetsChangedEventID,
- (jint) extents[2], /* top */
- (jint) extents[0], /* left */
- (jint) extents[3], /* bottom */
- (jint) extents[1]); /* right */
- gdk_threads_enter ();
- }
-
-
- return FALSE;
-}
-
-static void
-realize_cb (GtkWidget *widget, jobject peer)
-{
- jint top = 0;
- jint left = 0;
- jint bottom = 0;
- jint right = 0;
- jint width = 0;
- jint height = 0;
-
- width = (*gdk_env())->CallIntMethod (gdk_env(), peer, windowGetWidthID);
- height = (*gdk_env())->CallIntMethod (gdk_env(), peer, windowGetHeightID);
-
- window_get_frame_extents (widget, &top, &left, &bottom, &right);
-
- (*gdk_env())->CallVoidMethod (gdk_env(), peer,
- postInsetsChangedEventID,
- top, left, bottom, right);
-
- gtk_window_set_default_size (GTK_WINDOW (widget),
- MAX (1, width - left - right),
- MAX (1, height - top - bottom));
-
- /* set the size like we do in nativeSetBounds */
- gtk_widget_set_size_request (widget,
- MAX (1, width - left - right),
- MAX (1, height - top - bottom));
-
- gtk_window_resize (GTK_WINDOW (widget),
- MAX (1, width - left - right),
- MAX (1, height - top - bottom));
-}
diff --git a/libjava/jni/gtk-peer/gthread-jni.c b/libjava/jni/gtk-peer/gthread-jni.c
deleted file mode 100644
index be822cefd12..00000000000
--- a/libjava/jni/gtk-peer/gthread-jni.c
+++ /dev/null
@@ -1,2592 +0,0 @@
-/* gthread-jni.c -- JNI threading routines for GLIB
- Copyright (C) 1998, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-/************************************************************************/
-/* Header */
-/************************************************************************/
-
-/*
- * @author Julian Dolby (dolby@us.ibm.com)
- * @date February 7, 2003 implemented for GLIB v.1
- *
- *
- * @author Steven Augart
- * <steve+classpath at augart dot com>, <augart at watson dot ibm dot com>
- * @date April 30, 2004 -- May 10 2004: Support new functions for Glib v.2,
- * fix cond_wait to free and re-acquire the mutex,
- * replaced trylock stub implementation with a full one.
- *
- * This code implements the GThreadFunctions interface for GLIB using
- * Java threading primitives. All of the locking and conditional variable
- * functionality required by GThreadFunctions is implemented using the
- * monitor and wait/notify functionality of Java objects. The thread-
- * local functionality uses the java.lang.ThreadLocal class.
- *
- * Classpath's AWT support uses GTK+ peers. GTK+ uses GLIB. GLIB by default
- * uses the platform's native threading model -- pthreads in most cases. If
- * the Java runtime doesn't use the native threading model, then it needs this
- * code in order to use Classpath's (GTK+-based) AWT routines.
- *
- * This code should be portable; I believe it makes no assumptions
- * about the underlying VM beyond that it implements the JNI functionality
- * that this code uses.
- *
- * Currently, use of this code is governed by the configuration option
- * --enable-portable-native-sync. We will soon add a VM hook so the VM can
- * select which threading model it wants to use at run time; at that point,
- * the configuration option will go away.
- *
- * The code in this file uses only JNI 1.1, except for one JNI 1.2 function:
- * GetEnv, in the JNI Invocation API. (There seems to be no way around using
- * GetEnv).
- *
- * ACKNOWLEDGEMENT:
- *
- * I would like to thank Mark Wielaard for his kindness in spending at least
- * six hours of his own time in reviewing this code and correcting my GNU
- * coding and commenting style. --Steve Augart
- *
- *
- * NOTES:
- *
- * This code has been tested with Jikes RVM and with Kaffe.
- *
- * This code should have proper automated unit tests. I manually tested it
- * by running an application that uses AWT. --Steven Augart
- *
- * MINOR NIT:
- *
- * - Using a jboolean in the arglist to "throw()" and "rethrow()"
- * triggers many warnings from GCC's -Wconversion operation, because that
- * is not the same as the conversion (upcast to an int) that would occur in
- * the absence of a prototype.
- *
- * It would be very slightly more efficient to just pass the jboolean, but
- * is not worth the clutter of messages. The right solution would be to
- * turn off the -Wconversion warning for just this file, *except* that
- * -Wconversion also warns you against constructs such as:
- * unsigned u = -1;
- * and that is a useful warning. So I went from a "jboolean" to a
- * "gboolean" (-Wconversion is not enabled by default for GNU Classpath,
- * but it is in my own CFLAGS, which, for gcc 3.3.3, read: -pipe -ggdb3 -W
- * -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual
- * -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
- * -fkeep-static-consts -fkeep-inline-functions -Wundef -Wwrite-strings
- * -Wno-aggregate-return -Wmissing-noreturn -Wnested-externs -Wtrigraphs
- * -Wconversion -Wsign-compare -Wno-float-equal -Wmissing-format-attribute
- * -Wno-unreachable-code -Wdisabled-optimization )
- */
-
-#include <config.h>
-
-/************************************************************************/
-/* Configuration */
-/************************************************************************/
-
-/** Tracing and Reporting **/
-#define TRACE_API_CALLS 0 /* announce entry and exit into each method,
- by printing to stderr. */
-
-#define TRACE_MONITORS 0 /* Every enterMonitor() and exitMonitor() goes
- to stderr. */
-
-/** Trouble handling. There is a discussion below of this. **/
-#define EXPLAIN_TROUBLE 1 /* Describe any unexpected trouble that
- happens. This is a superset
- of EXPLAIN_BROKEN, and if set trumps an
- unset EXPLAIN_BROKEN. It is not a strict
- superset, since at the moment there is no
- TROUBLE that is not also BROKEN.
-
- Use criticalMsg() to describe the problem.
- */
-
-#define EXPLAIN_BROKEN 1 /* Describe trouble that is serious enough to
- be BROKEN. (Right now all trouble is at
- least BROKEN.) */
-
-/* There is no EXPLAIN_BADLY_BROKEN definition. We always explain
- BADLY_BROKEN trouble, since there is no other way to report it. */
-
-
-/** Error Handling **/
-#define DIE_IF_BROKEN 1 /* Dies if serious trouble happens. There is
- really no non-serious trouble, except
- possibly problems that arise during
- pthread_create, which are reported by a
- GError.
-
- If you do not set DIE_IF_BROKEN, then
- trouble will raise a Java RuntimeException.
- We probably do want to die right away,
- since anything that's BROKEN really
- indicates a programming error or a
- system-wide error, and that's what the glib
- documentation says you should do in case of
- that kind of error in a glib-style
- function. But it does work to turn this
- off. */
-
-#if DIE_IF_BROKEN
-#define DIE_IF_BADLY_BROKEN 1 /* DIE_IF_BROKEN implies DIE_IF_BADLY_BROKEN */
-#else
-#define DIE_IF_BADLY_BROKEN 1 /* Die if the system is badly broken --
- that is, if we have further trouble while
- attempting to throw an exception
- upwards, or if we are unable to generate
- one of the classes we'll need in order to
- throw wrapped exceptions upward.
-
- If unset, we will print a warning message,
- and limp along anyway. Not that the system
- is likely to work. */
-#endif
-
-/** Performance tuning parameters **/
-
-#define ENABLE_EXPENSIVE_ASSERTIONS 0 /* Enable expensive assertions? */
-
-#define DELETE_LOCAL_REFS 1 /* Whether to delete local references.
-
- JNI only guarantees that there wil be 16
- available. (Jikes RVM provides an number
- only limited by VM memory.)
-
- Jikes RVM will probably perform faster if
- this is turned off, but other VMs may need
- this to be turned on in order to perform at
- all, or might need it if things change.
-
- Remember, we don't know how many of those
- local refs might have already been used up
- by higher layers of JNI code that end up
- calling g_thread_self(),
- g_thread_set_private(), and so on.
-
- We set this to 1 for GNU Classpath, since
- one of our principles is "always go for the
- most robust implementation" */
-
-#define HAVE_JNI_VERSION_1_2 0 /* Assume we don't. We could
- dynamically check for this. We will
- assume JNI 1.2 in later versions of
- Classpath.
-
- As it stands, the code in this file
- already needs one JNI 1.2 function:
- GetEnv, in the JNI Invocation API.
-
- TODO This code hasn't been tested yet.
- And really hasn't been implemented yet.
- */
-
-/************************************************************************/
-/* Global data */
-/************************************************************************/
-
-#if defined HAVE_STDINT_H
-#include <stdint.h> /* provides intptr_t */
-#elif defined HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-#include <stdarg.h> /* va_list */
-#include <glib.h>
-#include "gthread-jni.h"
-#include <assert.h> /* assert() */
-
-/* For Java thread priority constants. */
-#include <gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.h>
-
-/* Since not all JNI header generators actually define constants we
- define them here explicitly. */
-#ifndef gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MIN_PRIORITY
-#define gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MIN_PRIORITY 1
-#endif
-#ifndef gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_NORM_PRIORITY
-#define gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_NORM_PRIORITY 5
-#endif
-#ifndef gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MAX_PRIORITY
-#define gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MAX_PRIORITY 10
-#endif
-
-/* The VM handle. This is set in
- Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit */
-JavaVM *the_vm;
-
-/* Unions used for type punning. */
-union env_union
-{
- void **void_env;
- JNIEnv **jni_env;
-};
-
-union func_union
-{
- void *void_func;
- GThreadFunc g_func;
-};
-
-/* Forward Declarations for Functions */
-static int threadObj_set_priority (JNIEnv * env, jobject threadObj,
- GThreadPriority gpriority);
-static void fatalMsg (const char fmt[], ...)
- __attribute__ ((format (printf, 1, 2)))
- __attribute__ ((noreturn));
-
-static void criticalMsg (const char fmt[], ...)
- __attribute__ ((format (printf, 1, 2)));
-
-static void tracing (const char fmt[], ...)
- __attribute__ ((format (printf, 1, 2)));
-
-static jint javaPriorityLevel (GThreadPriority priority)
- __attribute__ ((const));
-
-/************************************************************************/
-/* Trouble-handling, including utilities to reflect exceptions */
-/* back to the VM. Also some status reporting. */
-/************************************************************************/
-
-/* How are we going to handle problems?
-
- There are several approaches:
-
- 1) Report them with the GError mechanism.
-
- (*thread_create)() is the only one of these functions that takes a
- GError pointer. And the only G_THREAD error defined maps onto EAGAIN.
- We don't have any errors in our (*thread_create)() implementation that
- can be mapped to EAGAIN. So this idea is a non-starter.
-
- 2) Reflect the exception back to the VM, wrapped in a RuntimeException.
- This will fail sometimes, if we're so broken (BADLY_BROKEN) that we
- fail to throw the exception.
-
- 3) Abort execution. This is what the glib functions themselves do for
- errors that they can't report via GError.
-
- Enable DIE_IF_BROKEN and/or DIE_IF_BADLY_BROKEN to
- make this the default for BROKEN and/or BADLY_BROKEN trouble.
-
- 4) Display messages to stderr. We always do this for BADLY_BROKEN
- trouble. The glib functions do that for errors they can't report via
- GError.
-
- There are some complications.
-
- When I attempted to report a problem in g_thread_self() using g_critical (a
- macro around g_log(), I found that g_log in turn looks for thread-private
- data and calls g_thread_self() again.
-
- We got a segfault, probably due to stack overflow. So, this code doesn't
- use the g_critical() and g_error() functions any more. Nor do we use
- g_assert(); we use the C library's assert() instead.
-*/
-
-
-#define WHERE __FILE__ ":" G_STRINGIFY(__LINE__) ": "
-
-/* This is portable to older compilers that lack variable-argument macros.
- This used to be just g_critical(), but then we ran into the error reporting
- problem discussed above.
-*/
-static void
-fatalMsg (const char fmt[], ...)
-{
- va_list ap;
- va_start (ap, fmt);
- vfprintf (stderr, fmt, ap);
- va_end (ap);
- fputs ("\nAborting execution\n", stderr);
- abort ();
-}
-
-
-static void
-criticalMsg (const char fmt[], ...)
-{
- va_list ap;
- va_start (ap, fmt);
- vfprintf (stderr, fmt, ap);
- va_end (ap);
- putc ('\n', stderr);
-}
-
-/* Unlike the other two, this one does not append a newline. This is only
- used if one of the TRACE_ macros is defined. */
-static void
-tracing (const char fmt[], ...)
-{
- va_list ap;
- va_start (ap, fmt);
- vfprintf (stderr, fmt, ap);
- va_end (ap);
-}
-
-#define assert_not_reached() \
- do \
- { \
- fputs(WHERE "You should never get here. Aborting execution.\n", \
- stderr); \
- abort(); \
- } \
- while(0)
-
-
-#if DIE_IF_BADLY_BROKEN
-#define BADLY_BROKEN fatalMsg
-#else
-#define BADLY_BROKEN criticalMsg
-/* So, the user may still attempt to recover, even though we do not advise
- this. */
-#endif
-
-/* I find it so depressing to have to use C without varargs macros. */
-#define BADLY_BROKEN_MSG WHERE "Something fundamental" \
- " to GNU Classpath's AWT JNI broke while we were trying to pass up a Java error message"
-
-#define BADLY_BROKEN0() \
- BADLY_BROKEN(BADLY_BROKEN_MSG);
-#define BADLY_BROKEN1(msg) \
- BADLY_BROKEN(BADLY_BROKEN_MSG ": " msg)
-#define BADLY_BROKEN2(msg, arg) \
- BADLY_BROKEN(BADLY_BROKEN_MSG ": " msg, arg)
-#define BADLY_BROKEN3(msg, arg, arg2) \
- BADLY_BROKEN(BADLY_BROKEN_MSG ": " msg, arg1, arg2)
-#define BADLY_BROKEN4(msg, arg, arg2, arg3) \
- BADLY_BROKEN(BADLY_BROKEN_MSG ": " msg, arg1, arg2, arg3)
-
-#define DELETE_LOCAL_REF(env, ref) \
- do \
- { \
- if ( DELETE_LOCAL_REFS ) \
- { \
- (*env)->DeleteLocalRef (env, ref); \
- (ref) = NULL; \
- } \
- } \
- while(0)
-
-/* Cached info for Exception-wrapping */
-
-jclass runtimeException_class; /* java.lang.RuntimeException */
-jmethodID runtimeException_ctor; /* constructor for it */
-
-
-/* Throw a new RuntimeException. It may wrap around an existing exception.
- 1 if we did rethrow, -1 if we had trouble while rethrowing.
- isBroken is always true in this case. */
-static int
-throw (JNIEnv * env, jthrowable cause, const char *message,
- gboolean isBroken, const char *file, int line)
-{
- jstring jmessage;
- gboolean describedException = FALSE; /* Did we already describe the
- exception to stderr or the
- equivalent? */
- jthrowable wrapper;
-
- /* allocate local message in Java */
- const char fmt[] = "In AWT JNI, %s (at %s:%d)";
- size_t len = strlen (message) + strlen (file) + sizeof fmt + 25;
- char *buf;
-
- if (EXPLAIN_TROUBLE || (isBroken && EXPLAIN_BROKEN))
- {
- criticalMsg ("%s:%d: AWT JNI failure%s: %s\n", file, line,
- isBroken ? " (BROKEN)" : "", message);
- if (cause)
- {
- jthrowable currentException = (*env)->ExceptionOccurred (env);
-
- if (cause == currentException)
- {
- criticalMsg ("Description follows to System.err:");
- (*env)->ExceptionDescribe (env);
- /* ExceptionDescribe has the side-effect of clearing the pending
- exception; relaunch it. */
- describedException = TRUE;
-
- if ((*env)->Throw (env, cause))
- {
- BADLY_BROKEN1
- ("Relaunching an exception with Throw failed.");
- return -1;
- }
- }
- else
- {
- DELETE_LOCAL_REF (env, currentException);
- criticalMsg (WHERE
- "currentException != cause; something else happened"
- " while handling an exception.");
- }
- }
- } /* if (EXPLAIN_TROUBLE) */
-
- if (isBroken && DIE_IF_BROKEN)
- fatalMsg ("%s:%d: Aborting execution; BROKEN: %s\n", file, line, message);
-
- if ((buf = malloc (len)))
- {
- memset (buf, 0, len);
- g_snprintf (buf, len, fmt, message, file, line);
- jmessage = (*env)->NewStringUTF (env, buf);
- free (buf);
- }
- else
- {
- jmessage = NULL;
- }
-
- /* Create the RuntimeException wrapper object and throw it. It is OK for
- CAUSE to be NULL. */
- wrapper = (jthrowable) (*env)->NewObject
- (env, runtimeException_class, runtimeException_ctor, jmessage, cause);
- DELETE_LOCAL_REF (env, jmessage);
-
- if (!wrapper)
- {
- /* I think this should only happen:
- - if there are bugs in my JNI code, or
- - if the VM is broken, or
- - if we run out of memory.
- */
- if (EXPLAIN_TROUBLE)
- {
- criticalMsg (WHERE "GNU Classpath: JNI NewObject() could not create"
- " a new java.lang.RuntimeException.");
- criticalMsg ("We were trying to warn about the following"
- " previous failure:");
- criticalMsg ("%s:%d: %s", file, line, message);
- criticalMsg ("The latest (NewObject()) exception's description"
- " follows, to System.err:");
- (*env)->ExceptionDescribe (env);
- }
- BADLY_BROKEN1 ("Failure of JNI NewObject()"
- " to make a java.lang.RuntimeException");
- return -1;
- }
-
-
- /* throw it */
- if ((*env)->Throw (env, wrapper))
- {
- /* Throw() should just never fail, unless we're in such severe trouble
- that we might as well die. */
- BADLY_BROKEN1
- ("GNU Classpath: Failure of JNI Throw to report an Exception");
- return -1;
- }
-
- DELETE_LOCAL_REF (env, wrapper);
- return 1;
-}
-
-
-
-/* Rethrow an exception we received, wrapping it with a RuntimeException. 1
- if we did rethrow, -1 if we had trouble while rethrowing.
- CAUSE should be identical to the most recent exception that happened, so
- that ExceptionDescribe will work. (Otherwise nix.) */
-static int
-rethrow (JNIEnv * env, jthrowable cause, const char *message,
- gboolean isBroken, const char *file, int line)
-{
- assert (cause);
- return throw (env, cause, message, isBroken, file, line);
-}
-
-
-/* This function checks for a pending exception, and rethrows it with
- * a wrapper RuntimeException to deal with possible type problems (in
- * case some calling piece of code does not expect the exception being
- * thrown) and to include the given extra message.
- *
- * Returns 0 if no problems found (so no exception thrown), 1 if we rethrew an
- * exception. Returns -1 on failure.
- */
-static int
-maybe_rethrow (JNIEnv * env, const char *message, gboolean isBroken,
- const char *file, int line)
-{
- jthrowable cause = (*env)->ExceptionOccurred (env);
- int ret = 0;
-
- /* rethrow if an exception happened */
- if (cause)
- {
- ret = rethrow (env, cause, message, isBroken, file, line);
- DELETE_LOCAL_REF (env, cause);
- }
-
- return 0;
-}
-
-/* MAYBE_TROUBLE() is used to include a source location in the exception
- message. Once we have run maybe_rethrow, if there WAS trouble,
- return TRUE, else FALSE.
-
- MAYBE_TROUBLE() is actually never used; all problems that throw exceptions
- are BROKEN, at least. Nothing is recoverable :(. See the discussion of
- possible errors at thread_create_jni_impl(). */
-#define MAYBE_TROUBLE(_env, _message) \
- maybe_rethrow(_env, _message, FALSE, __FILE__, __LINE__)
-
-/* MAYBE_TROUBLE(), but something would be BROKEN if it were true. */
-#define MAYBE_BROKEN(_env, _message) \
- maybe_rethrow(_env, _message, TRUE, __FILE__, __LINE__)
-
-/* Like MAYBE_TROUBLE(), TROUBLE() is never used. */
-#define TROUBLE(_env, _message) \
- rethrow(_env, (*env)->ExceptionOccurred (env), _message, FALSE, \
- __FILE__, __LINE__)
-
-#define BROKEN(_env, _message) \
- rethrow (_env, (*env)->ExceptionOccurred (env), _message, TRUE, \
- __FILE__, __LINE__)
-
-/* Like MAYBE_TROUBLE(), NEW_TROUBLE() is never used. */
-#define NEW_TROUBLE(_env, _message) \
- throw (_env, NULL, _message, FALSE, __FILE__, __LINE__)
-
-#define NEW_BROKEN(_env, _message) \
- throw (_env, NULL, _message, TRUE, __FILE__, __LINE__)
-
-/* Like MAYBE_TROUBLE(), RETHROW_CAUSE() is never used. */
-#define RETHROW_CAUSE(_env, _cause, _message) \
- rethrow (_env, _cause, _message, FALSE, __FILE__, __LINE__)
-
-#define BROKEN_CAUSE(_env, _cause, _message) \
- rethrow (_env, _cause, _message, TRUE, __FILE__, __LINE__)
-
-/* Macros to handle the possibility that someone might have called one of the
- GThreadFunctions API functions with a Java exception pending. It is
- generally discouraged to continue to use JNI after a Java exception has
- been raised. Sun's JNI book advises that one trap JNI errors immediately
- and not continue with an exception pending.
-
- These are #if'd out for these reasons:
-
- 1) They do not work in the C '89 subset that Classpath is currently
- (2004 May 10) sticking to; HIDE_OLD_TROUBLE() includes a declaration
- that should be in scope for the rest of the function, so it needs a
- language version that lets you mix declarations and statements. (This
- could be worked around if it were important.)
-
- 2) They chew up more time and resources.
-
- 3) There does not ever seem to be old trouble -- the assertion in
- HIDE_OLD_TROUBLE never goes off.
-
- You will want to re-enable them if this code needs to be used in a context
- where old exceptions might be pending when the GThread functions are
- called.
-
- The implementations in this file are responsible for skipping around calls
- to SHOW_OLD_TROUBLE() if they've raised exceptions during the call. So, if
- we reach SHOW_OLD_TROUBLE, we are guaranteed that there are no exceptions
- pending. */
-#if 1
-#define HIDE_OLD_TROUBLE(env) \
- assert ( NULL == (*env)->ExceptionOccurred (env) )
-
-#define SHOW_OLD_TROUBLE() \
- assert ( NULL == (*env)->ExceptionOccurred (env) )
-#else /* 0 */
-#define HIDE_OLD_TROUBLE(env) \
- jthrowable savedTrouble = (*env)->ExceptionOccurred (env); \
- (*env)->ExceptionClear (env);
-
-#define SHOW_OLD_TROUBLE() do \
-{ \
- assert ( NULL == (*env)->ExceptionOccurred (env) ) \
- if (savedTrouble) \
- { \
- if ((*env)->Throw (env, savedTrouble)) \
- BADLY_BROKEN ("ReThrowing the savedTrouble failed"); \
- } \
- DELETE_LOCAL_REF (env, savedTrouble); \
-} while(0)
-
-#endif /* 0 */
-
-/* Set up the cache of jclass and jmethodID primitives we need
- in order to throw new exceptions and rethrow exceptions. We do this
- independently of the other caching. We need to have this cache set up
- first, so that we can then report errors properly.
-
- If any errors while setting up the error cache, the world is BADLY_BROKEN.
-
- May be called more than once.
-
- Returns -1 if the cache was not initialized properly, 1 if it was.
-*/
-static int
-setup_exception_cache (JNIEnv * env)
-{
- static int exception_cache_initialized = 0; /* -1 for trouble, 1 for proper
- init. */
-
- jclass lcl_class; /* a class used for local refs */
-
- if (exception_cache_initialized)
- return exception_cache_initialized;
- lcl_class = (*env)->FindClass (env, "java/lang/RuntimeException");
- if ( ! lcl_class )
- {
- BADLY_BROKEN1 ("Broken Class library or VM?"
- " Couldn't find java/lang/RuntimeException");
- return exception_cache_initialized = -1;
- }
- /* Pin it down. */
- runtimeException_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
- DELETE_LOCAL_REF (env, lcl_class);
- if (!runtimeException_class)
- {
- BADLY_BROKEN1 ("Serious trouble: could not turn"
- " java.lang.RuntimeException into a global reference");
- return exception_cache_initialized = -1;
- }
-
- runtimeException_ctor =
- (*env)->GetMethodID (env, runtimeException_class, "<init>",
- "(Ljava/lang/String;Ljava/lang/Throwable;)V");
- if ( ! runtimeException_ctor )
- {
- BADLY_BROKEN1 ("Serious trouble: classpath couldn't find a"
- " two-arg constructor for java/lang/RuntimeException");
- return exception_cache_initialized = -1;
- }
-
- return exception_cache_initialized = 1;
-}
-
-
-/**********************************************************/
-/***** The main cache *************************************/
-/**********************************************************/
-
-/** This is a cache of all classes, methods, and field IDs that we use during
- the run. We maintain a permanent global reference to each of the classes
- we cache, since otherwise the (local) jclass that refers to that class
- would go out of scope and possibly be reused in further calls.
-
- The permanent global reference also achieves the secondary goal of
- protecting the validity of the methods and field IDs in case the classes
- were otherwise unloaded and then later loaded again. Obviously, this will
- never happen to classes such as java.lang.Thread and java.lang.Object, but
- the primary reason for maintaining permanent global refs is sitll valid.
-
- The code in jnilink.c has a similar objective. TODO: Consider using that
- code instead.
-
- --Steven Augart
-*/
-
-/* All of these are cached classes and method IDs: */
-/* java.lang.Object */
-static jclass obj_class; /* java.lang.Object */
-static jmethodID obj_ctor; /* no-arg Constructor for java.lang.Object */
-static jmethodID obj_notify_mth; /* java.lang.Object.notify() */
-static jmethodID obj_notifyall_mth; /* java.lang.Object.notifyall() */
-static jmethodID obj_wait_mth; /* java.lang.Object.wait() */
-static jmethodID obj_wait_nanotime_mth; /* java.lang.Object.wait(JI) */
-
-/* GThreadMutex and its methods */
-static jclass mutex_class;
-static jmethodID mutex_ctor;
-static jfieldID mutex_lockForPotentialLockers_fld;
-static jfieldID mutex_potentialLockers_fld;
-
-/* java.lang.Thread and its methods*/
-static jclass thread_class; /* java.lang.Thread */
-static jmethodID thread_current_mth; /* Thread.currentThread() */
-static jmethodID thread_equals_mth; /* Thread.equals() */
-static jmethodID thread_join_mth; /* Thread.join() */
-static jmethodID thread_setPriority_mth; /* Thread.setPriority() */
-static jmethodID thread_stop_mth; /* Thread.stop() */
-static jmethodID thread_yield_mth; /* Thread.yield() */
-
-/* java.lang.ThreadLocal and its methods */
-static jclass threadlocal_class; /* java.lang.ThreadLocal */
-static jmethodID threadlocal_ctor; /* Its constructor */
-static jmethodID threadlocal_set_mth; /* ThreadLocal.set() */
-static jmethodID threadlocal_get_mth; /* ThreadLocal.get() */
-
-/* java.lang.Long and its methods */
-static jclass long_class; /* java.lang.Long */
-static jmethodID long_ctor; /* constructor for it: (J) */
-static jmethodID long_longValue_mth; /* longValue()J */
-
-
-/* GThreadNativeMethodRunner */
-static jclass runner_class;
-static jmethodID runner_ctor;
-static jmethodID runner_threadToThreadID_mth;
-static jmethodID runner_threadIDToThread_mth;
-static jmethodID runner_deRegisterJoinable_mth;
-static jmethodID runner_start_mth; /* Inherited Thread.start() */
-
-
-/* java.lang.InterruptedException */
-static jclass interrupted_exception_class;
-
-
-
-
-/* Returns a negative value if there was trouble during initialization.
- Returns a positive value of the cache was initialized correctly.
- Never returns zero. */
-static int
-setup_cache (JNIEnv * env)
-{
- jclass lcl_class;
- static int initialized = 0; /* 1 means initialized, 0 means uninitialized,
- -1 means mis-initialized */
-
- if (initialized)
- return initialized;
-
- /* make sure we can report on trouble */
- if (setup_exception_cache (env) < 0)
- return initialized = -1;
-
-#ifdef JNI_VERSION_1_2
- if (HAVE_JNI_VERSION_1_2)
- assert ( ! (*env)->ExceptionCheck (env));
- else
-#endif
- assert ( ! (*env)->ExceptionOccurred (env));
-
- /* java.lang.Object and its methods */
- lcl_class = (*env)->FindClass (env, "java/lang/Object");
- if (!lcl_class)
- {
- BROKEN (env, "cannot find java.lang.Object");
- return initialized = -1;
- }
-
- /* Pin it down. */
- obj_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
- DELETE_LOCAL_REF (env, lcl_class);
- if (!obj_class)
- {
- BROKEN (env, "Cannot get a global reference to java.lang.Object");
- return initialized = -1;
- }
-
- obj_ctor = (*env)->GetMethodID (env, obj_class, "<init>", "()V");
- if (!obj_ctor)
- {
- BROKEN (env, "cannot find constructor for java.lang.Object");
- return initialized = -1;
- }
-
- obj_notify_mth = (*env)->GetMethodID (env, obj_class, "notify", "()V");
- if ( ! obj_notify_mth )
- {
- BROKEN (env, "cannot find java.lang.Object.notify()V");
- return initialized = -1;
- }
-
- obj_notifyall_mth =
- (*env)->GetMethodID (env, obj_class, "notifyAll", "()V");
- if ( ! obj_notifyall_mth)
- {
- BROKEN (env, "cannot find java.lang.Object.notifyall()V");
- return initialized = -1;
- }
-
- obj_wait_mth = (*env)->GetMethodID (env, obj_class, "wait", "()V");
- if ( ! obj_wait_mth )
- {
- BROKEN (env, "cannot find Object.<wait()V>");
- return initialized = -1;
- }
-
- obj_wait_nanotime_mth =
- (*env)->GetMethodID (env, obj_class, "wait", "(JI)V");
- if ( ! obj_wait_nanotime_mth )
- {
- BROKEN (env, "cannot find Object.<wait(JI)V>");
- return initialized = -1;
- }
-
- /* GThreadMutex and its methods */
- lcl_class = (*env)->FindClass (env, "gnu/java/awt/peer/gtk/GThreadMutex");
- if ( ! lcl_class)
- {
- BROKEN (env, "cannot find gnu.java.awt.peer.gtk.GThreadMutex");
- return initialized = -1;
- }
- /* Pin it down. */
- mutex_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
- DELETE_LOCAL_REF (env, lcl_class);
- if ( ! mutex_class)
- {
- BROKEN (env, "Cannot get a global reference to GThreadMutex");
- return initialized = -1;
- }
-
- mutex_ctor = (*env)->GetMethodID (env, mutex_class, "<init>", "()V");
- if ( ! mutex_ctor)
- {
- BROKEN (env, "cannot find zero-arg constructor for GThreadMutex");
- return initialized = -1;
- }
-
- mutex_potentialLockers_fld = (*env)->GetFieldID
- (env, mutex_class, "potentialLockers", "I");
- if ( ! mutex_class )
- {
- BROKEN (env, "cannot find GThreadMutex.potentialLockers");
- return initialized = -1;
- }
-
- if (! (mutex_lockForPotentialLockers_fld = (*env)->GetFieldID
- (env, mutex_class, "lockForPotentialLockers", "Ljava/lang/Object;")))
- {
- BROKEN (env, "cannot find GThreadMutex.lockForPotentialLockers");
- return initialized = -1;
- }
-
-
- /* java.lang.Thread */
- if (! (lcl_class = (*env)->FindClass (env, "java/lang/Thread")))
- {
- BROKEN (env, "cannot find java.lang.Thread");
- return initialized = -1;
- }
-
- /* Pin it down. */
- thread_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
- DELETE_LOCAL_REF (env, lcl_class);
- if (!thread_class)
- {
- BROKEN (env, "Cannot get a global reference to java.lang.Thread");
- return initialized = -1;
- }
-
- thread_current_mth =
- (*env)->GetStaticMethodID (env, thread_class, "currentThread",
- "()Ljava/lang/Thread;");
- if (!thread_current_mth)
- {
- BROKEN (env, "cannot find Thread.currentThread() method");
- return initialized = -1;
- }
-
- thread_equals_mth =
- (*env)->GetMethodID (env, thread_class, "equals", "(Ljava/lang/Object;)Z");
- if (!thread_equals_mth)
- {
- BROKEN (env, "cannot find Thread.equals() method");
- return initialized = -1;
- }
-
- thread_join_mth = (*env)->GetMethodID (env, thread_class, "join", "()V");
- if (!thread_join_mth)
- {
- BROKEN (env, "cannot find Thread.join() method");
- return initialized = -1;
- }
-
- thread_stop_mth = (*env)->GetMethodID (env, thread_class, "stop", "()V");
- if ( ! thread_stop_mth )
- {
- BROKEN (env, "cannot find Thread.stop() method");
- return initialized = -1;
- }
-
- thread_setPriority_mth =
- (*env)->GetMethodID (env, thread_class, "setPriority", "(I)V");
- if ( ! thread_setPriority_mth )
- {
- BROKEN (env, "cannot find Thread.setPriority() method");
- return initialized = -1;
- }
-
- thread_yield_mth =
- (*env)->GetStaticMethodID (env, thread_class, "yield", "()V");
- if ( ! thread_yield_mth )
- {
- BROKEN (env, "cannot find Thread.yield() method");
- return initialized = -1;
- }
-
- /* java.lang.ThreadLocal */
- lcl_class = (*env)->FindClass (env, "java/lang/ThreadLocal");
- if ( ! lcl_class )
- {
- BROKEN (env, "cannot find class java.lang.ThreadLocal");
- return initialized = -1;
- }
-
- /* Pin it down. */
- threadlocal_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
- DELETE_LOCAL_REF (env, lcl_class);
- if ( ! threadlocal_class )
- {
- BROKEN (env, "Cannot get a global reference to java.lang.ThreadLocal");
- return initialized = -1;
- }
-
- threadlocal_ctor = (*env)->GetMethodID (env, threadlocal_class,
- "<init>", "()V");
- if ( ! threadlocal_ctor )
- {
- BROKEN (env, "cannot find ThreadLocal.<init>()V");
- return initialized = -1;
- }
-
- threadlocal_get_mth = (*env)->GetMethodID (env, threadlocal_class,
- "get", "()Ljava/lang/Object;");
- if ( ! threadlocal_get_mth )
- {
- BROKEN (env, "cannot find java.lang.ThreadLocal.get()Object");
- return initialized = -1;
- }
-
- threadlocal_set_mth = (*env)->GetMethodID (env, threadlocal_class,
- "set", "(Ljava/lang/Object;)V");
- if ( ! threadlocal_set_mth )
- {
- BROKEN (env, "cannot find ThreadLocal.set(Object)V");
- return initialized = -1;
- }
-
- /* java.lang.Long */
- lcl_class = (*env)->FindClass (env, "java/lang/Long");
- if ( ! lcl_class )
- {
- BROKEN (env, "cannot find class java.lang.Long");
- return initialized = -1;
- }
-
- /* Pin it down. */
- long_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
- DELETE_LOCAL_REF (env, lcl_class);
- if (!long_class)
- {
- BROKEN (env, "Cannot get a global reference to java.lang.Long");
- return initialized = -1;
- }
-
- long_ctor = (*env)->GetMethodID (env, long_class, "<init>", "(J)V");
- if (!long_ctor)
- {
- BROKEN (env, "cannot find method java.lang.Long.<init>(J)V");
- return initialized = -1;
- }
-
- long_longValue_mth =
- (*env)->GetMethodID (env, long_class, "longValue", "()J");
- if (!long_longValue_mth)
- {
- BROKEN (env, "cannot find method java.lang.Long.longValue()J");
- return initialized = -1;
- }
-
-
- /* GThreadNativeMethodRunner */
- lcl_class =
- (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GThreadNativeMethodRunner");
- if ( ! lcl_class )
- {
- BROKEN (env,
- "cannot find gnu.java.awt.peer.gtk.GThreadNativeMethodRunner");
- return initialized = -1;
- }
-
- /* Pin it down. */
- runner_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
- DELETE_LOCAL_REF (env, lcl_class);
- if (!runner_class)
- {
- BROKEN (env,
- "Cannot get a global reference to the class GThreadNativeMethodRunner");
- return initialized = -1;
- }
-
- runner_ctor = (*env)->GetMethodID (env, runner_class, "<init>", "(JJZ)V");
- if ( ! runner_ctor )
- {
- BROKEN (env,
- "cannot find method GThreadNativeMethodRunner.<init>(JJZ)");
- return initialized = -1;
- }
-
- runner_start_mth = (*env)->GetMethodID (env, runner_class, "start", "()V");
- if ( ! runner_start_mth )
- {
- BROKEN (env, "cannot find method GThreadNativeMethodRunner.start()V");
- return initialized = -1;
- }
-
-
- runner_threadToThreadID_mth =
- (*env)->GetStaticMethodID (env, runner_class,
- "threadToThreadID", "(Ljava/lang/Thread;)I");
- if ( ! runner_threadToThreadID_mth )
- {
- BROKEN (env,
- "cannot find method GThreadNativeMethodRunner.threadToThreadID(java.lang.Thread)I");
- return initialized = -1;
- }
-
-
- runner_threadIDToThread_mth =
- (*env)->GetStaticMethodID (env, runner_class,
- "threadIDToThread", "(I)Ljava/lang/Thread;");
- if ( ! runner_threadIDToThread_mth )
- {
- BROKEN (env,
- "cannot find method GThreadNativeMethodRunner.threadIDToThread(I)java.lang.Thread");
- return initialized = -1;
- }
-
-
- runner_deRegisterJoinable_mth =
- (*env)->GetStaticMethodID (env, runner_class, "deRegisterJoinable",
- "(Ljava/lang/Thread;)V");
- if (!runner_deRegisterJoinable_mth)
- {
- BROKEN (env,
- "cannot find method GThreadNativeMethodRunner.deRegisterJoinable(java.lang.Thread)V");
- return initialized = -1;
- }
-
-
- /* java.lang.InterruptedException */
- lcl_class = (*env)->FindClass (env, "java/lang/InterruptedException");
- if ( ! lcl_class )
- {
- BROKEN (env, "cannot find class java.lang.InterruptedException");
- return initialized = -1;
- }
-
- /* Pin it down. */
- interrupted_exception_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
- DELETE_LOCAL_REF (env, lcl_class);
- if (!interrupted_exception_class)
- {
- BROKEN (env, "Cannot make a global reference"
- " to java.lang.InterruptedException");
- return initialized = -1;
- }
-
-#ifdef JNI_VERSION_1_2
- if (HAVE_JNI_VERSION_1_2)
- assert ( ! (*env)->ExceptionCheck (env));
- else
-#endif
- assert ( ! (*env)->ExceptionOccurred (env));
-
-
- return initialized = 1;
-}
-
-
-
-
-
-/************************************************************************/
-/* Utilities to allocate and free java.lang.Objects */
-/************************************************************************/
-
-/* The condition variables are java.lang.Object objects,
- * which this method allocates and returns a global ref. Note that global
- * refs must be explicitly freed (isn't C fun?).
- */
-static jobject
-allocatePlainObject (JNIEnv * env)
-{
- jobject lcl_obj, global_obj;
-
- lcl_obj = (*env)->NewObject (env, obj_class, obj_ctor);
- if (!lcl_obj)
- {
- BROKEN (env, "cannot allocate object");
- return NULL;
- }
-
- global_obj = (*env)->NewGlobalRef (env, lcl_obj);
- DELETE_LOCAL_REF (env, lcl_obj);
- if (!global_obj)
- {
- NEW_BROKEN (env, "cannot make global ref for a new plain Java object");
- /* Deliberate fall-through */
- }
-
- return global_obj;
-}
-
-/* Frees any Java object given a global ref (isn't C fun?) */
-static void
-freeObject (JNIEnv * env, jobject obj)
-{
- if (obj)
- {
- (*env)->DeleteGlobalRef (env, obj);
- /* DeleteGlobalRef can never fail */
- }
-}
-
-
-/************************************************************************/
-/* Utilities to allocate and free Java mutexes */
-/************************************************************************/
-
-/* The mutexes are gnu.java.awt.peer.gtk.GThreadMutex objects,
- * which this method allocates and returns a global ref. Note that global
- * refs must be explicitly freed (isn't C fun?).
- *
- * Free this with freeObject()
- */
-static jobject
-allocateMutexObject (JNIEnv * env)
-{
- jobject lcl_obj, global_obj;
-
- lcl_obj = (*env)->NewObject (env, mutex_class, mutex_ctor);
- if (!lcl_obj)
- {
- BROKEN (env, "cannot allocate a GThreadMutex");
- return NULL;
- }
-
- global_obj = (*env)->NewGlobalRef (env, lcl_obj);
- DELETE_LOCAL_REF (env, lcl_obj);
- if (!global_obj)
- {
- NEW_BROKEN (env, "cannot make global ref");
- /* Deliberate fallthrough */
- }
-
- return global_obj;
-}
-
-
-/************************************************************************/
-/* Locking code */
-/************************************************************************/
-
-/* Lock a Java object */
-#define ENTER_MONITOR(env, m) \
- enterMonitor(env, m, G_STRINGIFY(m))
-
-/* Return -1 on failure, 0 on success. */
-static int
-enterMonitor (JNIEnv * env, jobject monitorObj, const char monName[])
-{
- if (TRACE_MONITORS)
- tracing (" <MonitorEnter(%s)>", monName);
- assert (monitorObj);
- if ((*env)->MonitorEnter (env, monitorObj) < 0)
- {
- BROKEN (env, "cannot enter monitor");
- return -1;
- }
- return 0;
-}
-
-
-/* Unlock a Java object */
-#define EXIT_MONITOR(env, m) \
- exitMonitor(env, m, G_STRINGIFY(m))
-
-static int
-exitMonitor (JNIEnv * env, jobject mutexObj, const char monName[])
-{
- if (TRACE_MONITORS)
- tracing (" <MonitorExit(%s)>", monName);
- assert (mutexObj);
- if ((*env)->MonitorExit (env, mutexObj) < 0)
- {
- BROKEN (env, "cannot exit monitor ");
- return -1;
- }
- return 0;
-}
-
-
-/************************************************************************/
-/* Miscellaneous utilities */
-/************************************************************************/
-
-/* Get the Java Thread object that corresponds to a particular thread ID.
- A negative thread Id gives us a null object.
-
- Returns a local reference.
-*/
-static jobject
-getThreadFromThreadID (JNIEnv * env, gpointer gThreadID)
-{
- jint threadNum = (jint) gThreadID;
- jobject thread;
-
- if (threadNum < 0)
- {
- NEW_BROKEN (env, "getThreadFromThreadID asked to look up"
- " a negative thread index");
- return NULL;
- }
-
- thread = (*env)->CallStaticObjectMethod
- (env, runner_class, runner_threadIDToThread_mth, threadNum);
-
- if (MAYBE_BROKEN (env, "cannot get Thread for threadID "))
- return NULL;
-
- return thread;
-}
-
-/** Return the unique threadID of THREAD.
-
- Error handling: Return (gpointer) -1 on all failures,
- and propagate an exception.
-*/
-static gpointer
-getThreadIDFromThread (JNIEnv * env, jobject thread)
-{
- jint threadNum;
-
- if (ENABLE_EXPENSIVE_ASSERTIONS)
- assert ((*env)->IsInstanceOf (env, thread, thread_class));
-
- HIDE_OLD_TROUBLE (env);
-
- threadNum = (*env)->CallStaticIntMethod
- (env, runner_class, runner_threadToThreadID_mth, thread);
-
- if (MAYBE_BROKEN (env, "cannot get ThreadID for a Thread "))
- {
- threadNum = -1;
- goto done;
- }
-
-
- SHOW_OLD_TROUBLE ();
-
-done:
- return (gpointer) threadNum;
-}
-
-
-/************************************************************************/
-/* The Actual JNI functions that we pass to the function vector. */
-/************************************************************************/
-
-
-/************************************************************************/
-/* Mutex Functions */
-/************************************************************************/
-
-/*** Mutex Utilities ****/
-struct mutexObj_cache
-{
- jobject lockForPotentialLockersObj; /* Lock for the potentialLockers
- field. Local reference. */
- jobject lockObj; /* The real lock we use. This is a GLOBAL
- reference and must not be freed. */
-};
-
-/* Initialize the cache of sub-locks for a particular mutex object.
-
- -1 on error, 0 on success. The caller is not responsible for freeing the
- partially-populated cache in case of failure (but in practice does anyway)
- (This actually never fails, though, since GetObjectField allegedly never
- fails.)
-
- Guaranteed to leave all fields of the cache initialized, even if only to
- zero.
-*/
-static int
-populate_mutexObj_cache (JNIEnv * env, jobject mutexObj,
- struct mutexObj_cache *mcache)
-{
- mcache->lockObj = mutexObj; /* the mutexObj is its own lock. */
- assert (mcache->lockObj);
-
- mcache->lockForPotentialLockersObj = (*env)->GetObjectField
- (env, mutexObj, mutex_lockForPotentialLockers_fld);
- /* GetObjectField can never fail. */
-
- /* Retrieving a NULL object could only happen if we somehow got a
- a mutex object that was not properly intialized. */
- assert (mcache->lockForPotentialLockersObj);
-
- return 0;
-}
-
-
-/* Clean out the mutexObj_cache, even if it was never populated. */
-static void
-clean_mutexObj_cache (JNIEnv * env, struct mutexObj_cache *mcache)
-{
- /* OK to pass NULL refs to DELETE_LOCAL_REF */
- DELETE_LOCAL_REF (env, mcache->lockForPotentialLockersObj);
- /* mcache->lockObj is a GLOBAL reference. */
- mcache->lockObj = NULL;
-}
-
-/* -1 on failure, 0 on success.
- The mutexObj_cache is already populated for this particular object. */
-static int
-mutexObj_lock (JNIEnv * env, jobject mutexObj, struct mutexObj_cache *mcache)
-{
- jint potentialLockers;
-
- if (ENTER_MONITOR (env, mcache->lockForPotentialLockersObj))
- return -1;
-
- assert(mutexObj);
- potentialLockers =
- (*env)->GetIntField (env, mutexObj, mutex_potentialLockers_fld);
- /* GetIntField() never fails. */
-
- ++potentialLockers;
-
- (*env)->SetIntField
- (env, mutexObj, mutex_potentialLockers_fld, potentialLockers);
-
- if (EXIT_MONITOR (env, mcache->lockForPotentialLockersObj))
- return -1;
-
- if (ENTER_MONITOR (env, mcache->lockObj))
- return -1;
-
- SHOW_OLD_TROUBLE ();
-
- return 0;
-}
-
-/* Unlock a GMutex, once we're already in JNI and have already gotten the
- mutexObj for it. This skips the messages that TRACE_API_CALLS would
- print.
-
- Returns -1 on error, 0 on success. */
-static int
-mutexObj_unlock (JNIEnv * env, jobject mutexObj,
- struct mutexObj_cache *mcache)
-{
- jint potentialLockers;
- int ret = -1; /* assume failure until we suceed. */
-
- /* Free the lock first, so that someone waiting for the lock can get it
- ASAP. */
- /* This is guaranteed not to block. */
- if (EXIT_MONITOR (env, mcache->lockObj) < 0)
- goto done;
-
- /* Kick down potentialLockers by one. We do this AFTER we free the lock, so
- that we hold it no longer than necessary. */
- if (ENTER_MONITOR (env, mcache->lockForPotentialLockersObj) < 0)
- goto done;
-
- potentialLockers = (*env)->GetIntField
- (env, mutexObj, mutex_potentialLockers_fld);
- /* GetIntField never fails */
-
- assert (potentialLockers >= 1);
- --potentialLockers;
-
- (*env)->SetIntField
- (env, mutexObj, mutex_potentialLockers_fld, potentialLockers);
- /* Never fails, so the JNI book says. */
-
- /* Clean up. */
- if (EXIT_MONITOR (env, mcache->lockForPotentialLockersObj) < 0)
- goto done;
- ret = 0;
-
-done:
- return ret;
-}
-
-/*** Mutex Implementations ****/
-
-/* Create a mutex, which is a java.lang.Object for us.
- In case of failure, we'll return NULL. Which will implicitly
- cause future calls to fail. */
-static GMutex *
-mutex_new_jni_impl (void)
-{
- jobject mutexObj;
- JNIEnv *env;
- union env_union e;
-
- if (TRACE_API_CALLS)
- tracing ("mutex_new_jni_impl()");
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
-
- if (setup_cache (env) < 0)
- {
- mutexObj = NULL;
- goto done;
- }
-
- mutexObj = allocateMutexObject (env);
-
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> %p \n", mutexObj);
-
- return (GMutex *) mutexObj;
-
-}
-
-/* Lock a mutex. */
-static void
-mutex_lock_jni_impl (GMutex * mutex)
-{
- struct mutexObj_cache mcache;
- jobject mutexObj = (jobject) mutex;
- JNIEnv *env;
- union env_union e;
-
- if (TRACE_API_CALLS)
- tracing ("mutex_lock_jni_impl( mutexObj = %p )", mutexObj);
-
- assert (mutexObj);
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
-
- if (setup_cache (env) < 0)
- goto done;
-
- HIDE_OLD_TROUBLE (env);
-
- if (populate_mutexObj_cache (env, mutexObj, &mcache) < 0)
- goto done;
-
- mutexObj_lock (env, mutexObj, &mcache);
- /* No need to error check; we've already reported it in any case. */
-
-done:
- clean_mutexObj_cache (env, &mcache);
- if (TRACE_API_CALLS)
- tracing (" ==> VOID \n");
-}
-
-
-/* Try to lock a mutex. Return TRUE if we succeed, FALSE if we fail.
- FALSE on error. */
-static gboolean
-mutex_trylock_jni_impl (GMutex * gmutex)
-{
- jobject mutexObj = (jobject) gmutex;
- jint potentialLockers;
- gboolean ret = FALSE;
- JNIEnv *env;
- union env_union e;
- struct mutexObj_cache mcache;
-
- if (TRACE_API_CALLS)
- tracing ("mutex_trylock_jni_impl(mutexObj=%p)", mutexObj);
-
- assert (mutexObj);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- if (populate_mutexObj_cache (env, mutexObj, &mcache) < 0)
- goto done;
-
- if (ENTER_MONITOR (env, mcache.lockForPotentialLockersObj))
- goto done;
-
- potentialLockers = (*env)->GetIntField
- (env, mutexObj, mutex_potentialLockers_fld);
-
- assert (potentialLockers >= 0);
-
- if (potentialLockers)
- {
- /* Already locked. Clean up and leave. */
- EXIT_MONITOR (env, mcache.lockForPotentialLockersObj);
- /* Ignore any error code from EXIT_MONITOR; there's nothing we could do
- at this level, in any case. */
- goto done;
- }
-
- /* Guaranteed not to block. */
- if (ENTER_MONITOR (env, mcache.lockObj))
- {
- /* Clean up the existing lock. */
- EXIT_MONITOR (env, mcache.lockForPotentialLockersObj);
- /* Ignore any error code from EXIT_MONITOR; there's nothing we could do
- at this level, in any case. */
- goto done;
- }
-
-
- /* We have the monitor. Record that fact. */
- potentialLockers = 1;
- (*env)->SetIntField
- (env, mutexObj, mutex_potentialLockers_fld, potentialLockers);
- /* Set*Field() never fails */
-
- ret = TRUE; /* We have the lock. */
-
- /* Clean up. */
- if (EXIT_MONITOR (env, mcache.lockForPotentialLockersObj))
- goto done; /* If we fail at this point, still keep the
- main lock. */
-
- SHOW_OLD_TROUBLE ();
-done:
- clean_mutexObj_cache (env, &mcache);
- if (TRACE_API_CALLS)
- tracing (" ==> %s\n", ret ? "TRUE" : "FALSE");
- return ret;
-}
-
-
-/* Unlock a mutex. */
-static void
-mutex_unlock_jni_impl (GMutex * gmutex)
-{
- jobject mutexObj = (jobject) gmutex;
- struct mutexObj_cache mcache;
- JNIEnv *env;
- union env_union e;
-
- if (TRACE_API_CALLS)
- tracing ("mutex_unlock_jni_impl(mutexObj=%p)", mutexObj);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- assert (mutexObj);
-
- if ( populate_mutexObj_cache (env, mutexObj, &mcache) < 0)
- goto done;
-
- (void) mutexObj_unlock (env, mutexObj, &mcache);
-
- SHOW_OLD_TROUBLE ();
-
-done:
- clean_mutexObj_cache (env, &mcache);
- if (TRACE_API_CALLS)
- tracing (" ==> VOID\n");
-}
-
-
-
-/* Free a mutex (isn't C fun?). OK this time for it to be NULL.
- No failure conditions, for a change. */
-static void
-mutex_free_jni_impl (GMutex * mutex)
-{
- jobject mutexObj = (jobject) mutex;
- JNIEnv *env;
- union env_union e;
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
-
- if (TRACE_API_CALLS)
- tracing ("mutex_free_jni_impl(%p)", mutexObj);
-
- freeObject (env, mutexObj);
-
- if (TRACE_API_CALLS)
- tracing (" ==> VOID\n");
-}
-
-
-
-
-/************************************************************************/
-/* Condition variable code */
-/************************************************************************/
-
-/* Create a new condition variable. This is a java.lang.Object for us. */
-static GCond *
-cond_new_jni_impl (void)
-{
- jobject condObj;
- JNIEnv *env;
- union env_union e;
-
- if (TRACE_API_CALLS)
- tracing ("mutex_free_jni_impl()");
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
-
- condObj = allocatePlainObject (env);
-
- if (TRACE_API_CALLS)
- tracing (" ==> %p\n", condObj);
-
- return (GCond *) condObj;
-}
-
-/* Signal on a condition variable. This is simply calling Object.notify
- * for us.
- */
-static void
-cond_signal_jni_impl (GCond * gcond)
-{
- JNIEnv *env;
- union env_union e;
- jobject condObj = (jobject) gcond;
-
- if (TRACE_API_CALLS)
- tracing ("cond_signal_jni_impl(condObj = %p)", condObj);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- assert (condObj);
-
- /* Must have locked an object to call notify */
- if (ENTER_MONITOR (env, condObj))
- goto done;
-
- (*env)->CallVoidMethod (env, condObj, obj_notify_mth);
- if (MAYBE_BROKEN (env, "cannot signal mutex with Object.notify()"))
- {
- if (EXIT_MONITOR (env, condObj))
- BADLY_BROKEN1 ("Failed to unlock a monitor; the VM may deadlock.");
- goto done;
- }
-
- EXIT_MONITOR (env, condObj);
-
- SHOW_OLD_TROUBLE ();
-
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> VOID\n");
-}
-
-/* Broadcast to all waiting on a condition variable. This is simply
- * calling Object.notifyAll for us.
- */
-static void
-cond_broadcast_jni_impl (GCond * gcond)
-{
- jobject condObj = (jobject) gcond;
- JNIEnv *env;
- union env_union e;
-
- if (TRACE_API_CALLS)
- tracing ("cond_broadcast_jni_impl(condObj=%p)", condObj);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- assert (condObj);
- /* Must have locked an object to call notifyAll */
- if (ENTER_MONITOR (env, condObj))
- goto done;
-
- (*env)->CallVoidMethod (env, condObj, obj_notifyall_mth);
- if (MAYBE_BROKEN (env, "cannot broadcast to mutex with Object.notify()"))
- {
- EXIT_MONITOR (env, condObj);
- goto done;
- }
-
- EXIT_MONITOR (env, condObj);
-
- SHOW_OLD_TROUBLE ();
-
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> VOID\n");
-}
-
-
-/* Wait on a condition variable. For us, this simply means calling
- * Object.wait.
- *
- * Throws a Java exception on trouble; may leave the mutexes set arbitrarily.
- * XXX TODO: Further improve error recovery.
- */
-static void
-cond_wait_jni_impl (GCond * gcond, GMutex * gmutex)
-{
- struct mutexObj_cache cache;
- jobject condObj = (jobject) gcond;
- jobject mutexObj = (jobject) gmutex;
- JNIEnv *env;
- union env_union e;
-
- if (TRACE_API_CALLS)
- tracing ("cond_wait_jni_impl(condObj=%p, mutexObj=%p)",
- condObj, mutexObj);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- assert (condObj);
- assert (mutexObj);
- /* Must have locked a Java object to call wait on it */
- if (ENTER_MONITOR (env, condObj) < 0)
- goto done;
-
- /* Our atomicity is now guaranteed; we're protected by the Java monitor on
- condObj. Unlock the GMutex. */
- if (mutexObj_unlock (env, mutexObj, &cache))
- goto done;
-
- (*env)->CallVoidMethod (env, condObj, obj_wait_mth);
- if (MAYBE_BROKEN (env, "cannot wait on condObj"))
- {
- EXIT_MONITOR (env, condObj); /* ignore err checking */
- goto done;
- }
-
- /* Re-acquire the lock on the GMutex. Do this while we're protected by the
- Java monitor on condObj. */
- if (mutexObj_lock (env, mutexObj, &cache))
- goto done;
-
- EXIT_MONITOR (env, condObj);
-
- SHOW_OLD_TROUBLE ();
-
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> VOID\n");
-}
-
-
-/** Wait on a condition variable until a timeout. This is a little tricky
- * for us. We first call Object.wait(J) giving it the appropriate timeout
- * value. On return, we check whether an InterruptedException happened. If
- * so, that is Java-speak for wait timing out.
- *
- * We return FALSE if we timed out. Return TRUE if the condition was
- * signalled first, before we timed out.
- *
- * In case of trouble we throw a Java exception. Whether we return FALSE or
- * TRUE depends upon whether the condition was raised before the trouble
- * happened.
- *
- * I believe that this function goes to the proper lengths to try to unlock
- * all of the locked mutexes and monitors, as appropriate, and that it further
- * tries to make sure that the thrown exception is the current one, not any
- * future cascaded one from something like a failure to unlock the monitors.
- */
-static gboolean
-cond_timed_wait_jni_impl (GCond * gcond, GMutex * gmutex, GTimeVal * end_time)
-{
- JNIEnv *env;
- union env_union e;
- jlong time_millisec;
- jint time_nanosec;
- jthrowable cause;
- jobject condObj = (jobject) gcond;
- jobject mutexObj = (jobject) gmutex;
- gboolean condRaised = FALSE; /* Condition has not been raised yet. */
- struct mutexObj_cache cache;
- gboolean interrupted;
-
- if (TRACE_API_CALLS)
- {
- tracing ("cond_timed_wait_jni_impl(cond=%p, mutex=%p,"
- " end_time=< sec=%lu, usec=%lu >)", condObj, mutexObj,
- (unsigned long) end_time->tv_sec,
- (unsigned long) end_time->tv_usec);
- }
-
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- time_millisec = end_time->tv_sec * 1000 + end_time->tv_usec / 1000;
- time_nanosec = 1000 * (end_time->tv_usec % 1000);
-
- /* Must have locked an object to call wait */
- if (ENTER_MONITOR (env, condObj) < 0)
- goto done;
-
- if (mutexObj_unlock (env, mutexObj, &cache) < 0)
- {
- if (EXIT_MONITOR (env, condObj) < 0)
- criticalMsg
- ("Unable to unlock an existing lock on a condition; your proram may deadlock");
- goto done;
- }
-
-
- (*env)->CallVoidMethod (env, condObj, obj_wait_nanotime_mth,
- time_millisec, time_nanosec);
-
- /* If there was trouble, save that fact, and the reason for the trouble. We
- want to respond to this condition as fast as possible. */
- cause = (*env)->ExceptionOccurred (env);
-
- if ( ! cause )
- {
- condRaised = TRUE; /* condition was signalled */
- }
- else if ((*env)->IsInstanceOf (env, cause, interrupted_exception_class))
- {
- condRaised = FALSE; /* Condition was not raised before timeout.
- (This is redundant with the initialization
- of condRaised above) */
- (*env)->ExceptionClear (env); /* Clear the InterruptedException. */
- cause = NULL; /* no pending cause now. */
- }
- else
- {
- interrupted = FALSE; /* Trouble, but not because of
- InterruptedException. Assume the condition
- was not raised. */
- /* Leave condRaised set to FALSE */
- }
-
- /* Irrespective of whether there is a pending problem to report, go ahead
- and try to clean up. This may end up throwing an exception that is
- different from the one that was thrown by the call to Object.wait().
- So we will override it with the first exception (don't want to have
- cascading problems). */
- if (mutexObj_lock (env, mutexObj, &cache) && !cause)
- {
- cause = (*env)->ExceptionOccurred (env);
- assert (cause);
- }
-
- if (EXIT_MONITOR (env, condObj) && !cause)
- {
- cause = (*env)->ExceptionOccurred (env);
- assert (cause);
- }
-
- if (cause) /* Raise the first cause. */
- {
- BROKEN_CAUSE (env, cause, "error in timed wait or during its cleanup");
- goto done;
- }
-
- SHOW_OLD_TROUBLE ();
-
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> condRaised = %s\n", condRaised ? "TRUE" : "FALSE");
- return condRaised;
-}
-
-
-/* Free a condition variable. (isn't C fun?). Can not fail. */
-static void
-cond_free_jni_impl (GCond * cond)
-{
- jobject condObj = (jobject) cond;
- JNIEnv *env;
- union env_union e;
-
- if (TRACE_API_CALLS)
- tracing ("cond_free_jni_impl(condObj = %p)", condObj);
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
-
- freeObject (env, condObj);
-
- if (TRACE_API_CALLS)
- tracing (" ==> VOID\n");
-}
-
-
-/************************************************************************/
-/* Thread-local data code */
-/************************************************************************/
-
-/* Create a new thread-local key. We use java.lang.ThreadLocal objects
- * for this. This returns the pointer representation of a Java global
- * reference.
- *
- * We will throw a Java exception and return NULL in case of failure.
- */
-static GPrivate *
-private_new_jni_impl (GDestroyNotify notify __attribute__ ((unused)))
-{
- JNIEnv *env;
- union env_union e;
- jobject lcl_key;
- jobject global_key;
- GPrivate *gkey = NULL; /* Error return code */
-
- if (TRACE_API_CALLS)
- tracing ("private_new_jni_impl()");
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- lcl_key = (*env)->NewObject (env, threadlocal_class, threadlocal_ctor);
- if ( ! lcl_key )
- {
- BROKEN (env, "cannot allocate a ThreadLocal");
- goto done;
- }
-
- global_key = ((*env)->NewGlobalRef (env, lcl_key));
- DELETE_LOCAL_REF (env, lcl_key);
- if ( ! global_key)
- {
- NEW_BROKEN (env, "cannot create a GlobalRef to a new ThreadLocal");
- goto done;
- }
-
- gkey = (GPrivate *) global_key;
- SHOW_OLD_TROUBLE ();
-
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> %p\n", (void *) gkey);
-
- return gkey;
-}
-
-/* Get this thread's value for a thread-local key. This is simply
- * ThreadLocal.get for us. Return NULL if no value. (I can't think of
- * anything else to do.)
- */
-static gpointer
-private_get_jni_impl (GPrivate * gkey)
-{
- JNIEnv *env;
- union env_union e;
- jobject val_wrapper;
- jobject keyObj = (jobject) gkey;
- gpointer thread_specific_data = NULL; /* Init to the error-return value */
-
- jlong val;
-
- if (TRACE_API_CALLS)
- tracing ("private_get_jni_impl(keyObj=%p)", keyObj);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- val_wrapper = (*env)->CallObjectMethod (env, keyObj, threadlocal_get_mth);
- if (MAYBE_BROKEN (env, "cannot find thread-local object"))
- goto done;
-
- if (! val_wrapper )
- {
- /* It's Java's "null" object. No ref found. This is OK; we must never
- have set a value in this thread. Note that this next statement is
- not necessary, strictly speaking, since we're already initialized to
- NULL. A good optimizing C compiler will detect that and optimize out
- this statement. */
- thread_specific_data = NULL;
- goto done;
- }
-
- val = (*env)->CallLongMethod (env, val_wrapper, long_longValue_mth);
-
- if (MAYBE_BROKEN (env, "cannot get thread local value"))
- goto done;
-
- thread_specific_data = (gpointer) (intptr_t) val;
-
- /* Only re-raise the old pending exception if a new one hasn't come along to
- supersede it. */
- SHOW_OLD_TROUBLE ();
-
-done:
-
- if (TRACE_API_CALLS)
- tracing (" ==> %p\n", thread_specific_data);
-
- return thread_specific_data;
-}
-
-/* Set this thread's value for a thread-local key. This is simply
- * ThreadLocal.set() for us.
- */
-static void
-private_set_jni_impl (GPrivate * gkey, gpointer thread_specific_data)
-{
- JNIEnv *env;
- union env_union e;
- jobject val_wrapper;
- jobject keyObj = (jobject) gkey;
-
-
- if (TRACE_API_CALLS)
- tracing ("private_set_jni_impl(keyObj=%p, thread_specific_data=%p)",
- keyObj, thread_specific_data);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- /* We are just going to always use a Java long to represent a C pointer.
- Otherwise all of the code would end up being conditionalized for various
- pointer sizes, and that seems like too much of a hassle, in order to save
- a paltry few bytes, especially given the horrendous overhead of JNI in
- any case.
- */
-
- val_wrapper = (*env)->NewObject (env, long_class, long_ctor,
- (jlong) (intptr_t) thread_specific_data);
- if ( ! val_wrapper )
- {
- BROKEN (env, "cannot create a java.lang.Long");
- goto done;
- }
-
- /* At this point, we now have set lcl_obj as a numeric class that wraps
- around the thread-specific data we were given. */
- (*env)->CallVoidMethod (env, keyObj, threadlocal_set_mth, val_wrapper);
- if (MAYBE_BROKEN (env, "cannot set thread local value"))
- goto done;
-
- SHOW_OLD_TROUBLE ();
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> VOID\n");
-}
-
-
-/** Create an object of type gnu.java.awt.peer.gtk.GThreadNativeMethodRunner.
- Run it.
-
- We need to create joinable threads. We handle the notion of a joinable
- thread by determining whether or not we are going to maintain a permanent
- hard reference to it until it croaks.
-
- Posix does not appear to have a Java-like concept of daemon threads, where
- the JVM will exit when there are only daemon threads running.
-
- Error handling:
-
- To quote from the glib guide:
- "GError should only be used to report recoverable runtime errors, never
- to report programming errors."
-
- So how do we consider the failure to create a thread? Well, each of the
- failure cases in this function are discussed, and none of them are really
- recoverable.
-
- The glib library is really designed so that you should fail
- catastrophically in case of "programming errors". The only error defined
- for the GThread functions is G_THREAD_ERROR_AGAIN, and that for
- thread_create.
-
- Most of these GThread functions could fail if we run out of memory, for
- example, but the only one capable of reporting that fact is
- thread_create. */
-static void
-thread_create_jni_impl (GThreadFunc func,
- gpointer data,
- gulong stack_size __attribute__((unused)),
- gboolean joinable,
- gboolean bound __attribute__((unused)),
- GThreadPriority gpriority,
- /* This prototype is horrible. threadIDp is actually
- a gpointer to the thread's thread-ID. Which is,
- of course, itself a gpointer-typed value. Ouch. */
- gpointer threadIDp,
- /* Do not touch the GError stuff unless you have
- RECOVERABLE trouble. There is no recoverable
- trouble in this implementation. */
- GError **errorp __attribute__((unused)))
-{
- JNIEnv *env;
- union env_union e;
- union func_union f;
- jboolean jjoinable = joinable;
- jobject newThreadObj;
- gpointer threadID; /* to be filled in */
-
- if (TRACE_API_CALLS)
- {
- f.g_func = func;
- tracing ("thread_create_jni_impl(func=%p, data=%p, joinable=%s,"
- " threadIDp=%p, *(int *) threadIDp = %d)",
- f.void_func, data, joinable ? "TRUE" : "FALSE",
- threadIDp, *(int *) threadIDp);
- }
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- {
- /* The failed call to setup the cache is certainly not recoverable;
- not appropriate for G_THREAD_ERROR_AGAIN. */
- *(gpointer *) threadIDp = NULL;
- goto done;
- }
- HIDE_OLD_TROUBLE (env);
-
- /* If a thread is joinable, then notify its constructor. The constructor
- will enter a hard reference for it, and the hard ref. won't go away until
- the thread has been joined. */
- newThreadObj =
- (*env)->NewObject (env, runner_class, runner_ctor,
- (jlong) (intptr_t) func, (jlong) (intptr_t) data,
- jjoinable);
- if ( ! newThreadObj )
- {
- BROKEN (env, "creating a new thread failed in the constructor");
- *(gpointer *) threadIDp = NULL;
- /* The failed call to the constructor does not throw any errors such
- that G_THREAD_ERROR_AGAIN is appropriate. No other recoverable
- errors defined. Once again, we go back to the VM. */
- goto done;
- }
-
- if (threadObj_set_priority (env, newThreadObj, gpriority) < 0)
- {
- *(gpointer *) threadIDp = NULL;
- /* None of these possible exceptions from Thread.setPriority() are
- recoverable, so they are not appropriate for EAGAIN. So we should
- fail. */
- goto done;
- }
-
- (*env)->CallVoidMethod (env, runner_class, runner_start_mth);
-
- if (MAYBE_BROKEN (env, "starting a new thread failed"))
- {
- *(gpointer *) threadIDp = NULL;
- /* The only exception Thread.start() throws is
- IllegalStateException. And that would indicate a programming error.
-
- So there are no situations such that G_THREAD_ERROR_AGAIN would be
- OK.
-
- So, we don't use g_set_error() here to perform any error reporting.
- */
- goto done;
- }
-
- threadID = getThreadIDFromThread (env, newThreadObj);
-
- *(gpointer *) threadIDp = threadID;
- SHOW_OLD_TROUBLE ();
-
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> (threadID = %p) \n", threadID);
-}
-
-
-/* Wraps a call to g_thread_yield. */
-static void
-thread_yield_jni_impl (void)
-{
- JNIEnv *env;
- union env_union e;
-
- if (TRACE_API_CALLS)
- tracing ("thread_yield_jni_impl()");
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- (*env)->CallStaticVoidMethod (env, thread_class, thread_yield_mth);
- if (MAYBE_BROKEN (env, "Thread.yield() failed"))
- goto done;
-
- SHOW_OLD_TROUBLE ();
-
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> VOID\n");
-}
-
-
-static void
-thread_join_jni_impl (gpointer threadID)
-{
- JNIEnv *env;
- union env_union e;
- jobject threadObj = NULL;
-
- if ( TRACE_API_CALLS )
- tracing ("thread_join_jni_impl(threadID=%p) ", threadID);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
- HIDE_OLD_TROUBLE (env);
-
- threadObj = getThreadFromThreadID (env, threadID);
- if ( ! threadObj ) /* Already reported with BROKEN */
- goto done;
-
- (*env)->CallVoidMethod (env, threadObj, thread_join_mth);
- if (MAYBE_BROKEN (env, "Thread.join() failed"))
- goto done;
-
-
- (*env)->CallStaticVoidMethod
- (env, runner_class, runner_deRegisterJoinable_mth, threadObj);
- if (MAYBE_BROKEN (env, "Thread.deRegisterJoinableThread() failed"))
- goto done;
-
- SHOW_OLD_TROUBLE ();
-
-done:
- DELETE_LOCAL_REF (env, threadObj);
- if (TRACE_API_CALLS)
- tracing (" ==> VOID \n");
-}
-
-/* Terminate the current thread. Unlike pthread_exit(), here we do not need
- to bother with a return value or exit value for the thread which is about
- to croak. (The gthreads abstraction doesn't use it.) However, we *do*
- need to bail immediately. We handle this with Thread.stop(), which is
- a deprecated method.
-
- It's deprecated since we might leave objects protected by monitors in
- half-constructed states on the way out -- Thread.stop() throws a
- ThreadDeath exception, which is usually unchecked. There is no good
- solution that I can see. */
-static void
-thread_exit_jni_impl (void)
-{
- JNIEnv *env;
- union env_union e;
- jobject this_thread;
-
- if (TRACE_API_CALLS)
- tracing ("thread_exit_jni_impl() ");
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- goto done;
-
- HIDE_OLD_TROUBLE (env);
-
- this_thread = (*env)->
- CallStaticObjectMethod (env, thread_class, thread_current_mth);
-
- if ( ! this_thread )
- {
- BROKEN (env, "cannot get current thread");
- goto done;
- }
-
- (*env)->CallVoidMethod (env, this_thread, thread_stop_mth);
- if (MAYBE_BROKEN (env, "cannot call Thread.stop() on current thread"))
- goto done;
-
- SHOW_OLD_TROUBLE ();
-
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> VOID \n");
-}
-
-
-/* Translate a GThreadPriority to a Java priority level. */
-static jint
-javaPriorityLevel (GThreadPriority priority)
-{
- /* We have these fields in java.lang.Thread to play with:
-
- static int MIN_PRIORITY The minimum priority that a thread can have.
- static int NORM_PRIORITY The default priority that is assigned to a
- thread.
- static int MAX_PRIORITY The maximum priority that a thread can have.
-
- We get these from the header file generated by javah, even though they're
- documented as being 1, 5, and 10.
- */
- static const jint minJPri =
- gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MIN_PRIORITY;
- static const jint normJPri =
- gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_NORM_PRIORITY;
- static const jint maxJPri =
- gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MAX_PRIORITY;
-
- switch (priority)
- {
- case G_THREAD_PRIORITY_LOW:
- return minJPri;
- break;
-
- default:
- assert_not_reached ();
- /* Deliberate fall-through if assertions are turned off; also shuts up
- GCC warnings if they're turned on. */
- case G_THREAD_PRIORITY_NORMAL:
- return normJPri;
- break;
-
- case G_THREAD_PRIORITY_HIGH:
- return (normJPri + maxJPri) / 2;
- break;
-
- case G_THREAD_PRIORITY_URGENT:
- return maxJPri;
- break;
- }
-}
-
-
-/** It would be safe not to implement this, according to the JNI docs, since
- not all platforms do thread priorities. However, we might as well
- provide the hint for those who want it.
-*/
-static void
-thread_set_priority_jni_impl (gpointer gThreadID, GThreadPriority gpriority)
-{
- jobject threadObj = NULL;
- JNIEnv *env;
- union env_union e;
-
- if (TRACE_API_CALLS)
- tracing ("thread_set_priority_jni_impl(gThreadID=%p, gpriority = %u) ",
- gThreadID, gpriority);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
-
- if (setup_cache (env) < 0)
- goto done;
-
- HIDE_OLD_TROUBLE (env);
-
-
- threadObj = getThreadFromThreadID (env, gThreadID);
- if ( ! threadObj) /* Reported with BROKEN already. */
- goto done;
-
- if (threadObj_set_priority (env, threadObj, gpriority))
- goto done;
-
- SHOW_OLD_TROUBLE ();
-
-done:
- DELETE_LOCAL_REF (env, threadObj);
-
- if (TRACE_API_CALLS)
- tracing (" ==> VOID\n");
-}
-
-
-/** It would be safe not to implement this, according to the JNI docs, since
- not all platforms do thread priorities. However, we might as well
- provide the hint for those who want it.
-
- -1 on failure, 0 on success. */
-static int
-threadObj_set_priority (JNIEnv * env, jobject threadObj,
- GThreadPriority gpriority)
-{
- jint javaPriority = javaPriorityLevel (gpriority);
- (*env)->CallVoidMethod (env, threadObj, thread_setPriority_mth,
- javaPriority);
- return MAYBE_BROKEN (env, "Thread.setPriority() failed");
-}
-
-
-/** Return the result of Thread.currentThread(), a static method. */
-static void
-thread_self_jni_impl (/* Another confusing glib prototype. This is
- actually a gpointer to the thread's thread-ID.
- Which is, of course, a gpointer. */
- gpointer my_thread_IDp)
-{
- JNIEnv *env;
- union env_union e;
- jobject this_thread;
- gpointer my_threadID;
-
- if (TRACE_API_CALLS)
- tracing ("thread_self_jni_impl(my_thread_IDp=%p)", my_thread_IDp);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
-
- if (setup_cache (env) < 0)
- return;
-
- HIDE_OLD_TROUBLE (env);
-
- this_thread = (*env)->
- CallStaticObjectMethod (env, thread_class, thread_current_mth);
- if (! this_thread )
- {
- BROKEN (env, "cannot get current thread");
- my_threadID = NULL;
- goto done;
- }
-
- my_threadID = getThreadIDFromThread (env, this_thread);
- SHOW_OLD_TROUBLE ();
-
-done:
- if (TRACE_API_CALLS)
- tracing (" ==> (my_threadID = %p) \n", my_threadID);
-
- *(gpointer *) my_thread_IDp = my_threadID;
-}
-
-
-static gboolean
-thread_equal_jni_impl (gpointer thread1, gpointer thread2)
-{
- JNIEnv *env;
- union env_union e;
-
- gpointer threadID1 = *(gpointer *) thread1;
- gpointer threadID2 = *(gpointer *) thread2;
-
- jobject thread1_obj = NULL;
- jobject thread2_obj = NULL;
- gboolean ret;
-
- if (TRACE_API_CALLS)
- tracing ("thread_equal_jni_impl(threadID1=%p, threadID2=%p)",
- threadID1, threadID2);
-
- e.jni_env = &env;
- (*the_vm)->GetEnv (the_vm, e.void_env, JNI_VERSION_1_1);
- if (setup_cache (env) < 0)
- {
- ret = FALSE; /* what is safer? We really don't ever want
- to return from here. */
- goto done;
- }
-
- HIDE_OLD_TROUBLE (env);
- thread1_obj = getThreadFromThreadID (env, threadID1);
- thread2_obj = getThreadFromThreadID (env, threadID2);
-
- ret = (*env)->CallBooleanMethod (env, thread1_obj,
- thread_equals_mth, thread2_obj);
-
- if (MAYBE_BROKEN (env, "Thread.equals() failed"))
- {
- ret = FALSE;
- goto done;
- }
-
- SHOW_OLD_TROUBLE ();
-
-
-done:
- DELETE_LOCAL_REF (env, thread1_obj);
- DELETE_LOCAL_REF (env, thread2_obj);
-
- if (TRACE_API_CALLS)
- tracing (" ==> %s\n", ret ? "TRUE" : "FALSE");
-
- return ret;
-}
-
-
-
-
-/************************************************************************/
-/* GLIB interface */
-/************************************************************************/
-
-/* set of function pointers to give to glib. */
-GThreadFunctions portable_native_sync_jni_functions = {
- mutex_new_jni_impl, /* mutex_new */
- mutex_lock_jni_impl, /* mutex_lock */
- mutex_trylock_jni_impl, /* mutex_trylock */
- mutex_unlock_jni_impl, /* mutex_unlock */
- mutex_free_jni_impl, /* mutex_free */
- cond_new_jni_impl, /* cond_new */
- cond_signal_jni_impl, /* cond_signal */
- cond_broadcast_jni_impl, /* cond_broadcast */
- cond_wait_jni_impl, /* cond_wait */
- cond_timed_wait_jni_impl, /* cond_timed_wait */
- cond_free_jni_impl, /* cond_free */
- private_new_jni_impl, /* private_new */
- private_get_jni_impl, /* private_get */
- private_set_jni_impl, /* private_set */
- thread_create_jni_impl, /* thread_create */
- thread_yield_jni_impl, /* thread_yield */
- thread_join_jni_impl, /* thread_join */
- thread_exit_jni_impl, /* thread_exit */
- thread_set_priority_jni_impl, /* thread_set_priority */
- thread_self_jni_impl, /* thread_self */
- thread_equal_jni_impl, /* thread_equal */
-};
-
-
-/* Keep c-font-lock-extra-types in alphabetical order. */
-/* Local Variables: */
-/* c-file-style: "gnu" */
-/* c-font-lock-extra-types: ("\\sw+_t" "gboolean" "GError" "gpointer"
- "GPrivate" "GThreadFunc" "GThreadFunctions" "GThreadPriority"
- "gulong"
- "JNIEnv"
- "jboolean" "jclass" "jfieldID" "jint" "jlong" "jmethodID" "jobject" "jstring" "jthrowable" ) */
-/* End: */
diff --git a/libjava/jni/gtk-peer/gthread-jni.h b/libjava/jni/gtk-peer/gthread-jni.h
deleted file mode 100644
index e7b33a61153..00000000000
--- a/libjava/jni/gtk-peer/gthread-jni.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* gthread-jni.h
- Copyright (C) 1998, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-#ifndef __GTHREADJNI_H__
-#define __GTHREADJNI_H__
-
-#include <jni.h>
-#include <glib.h>
-#include "gtkpeer.h"
-
-extern GThreadFunctions portable_native_sync_jni_functions;
-extern JavaVM *the_vm;
-
-#endif /* __GTHREADJNI_H__ */
diff --git a/libjava/jni/gtk-peer/gtk_jawt.c b/libjava/jni/gtk-peer/gtk_jawt.c
deleted file mode 100644
index c63f07d0a23..00000000000
--- a/libjava/jni/gtk-peer/gtk_jawt.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/* gtk_jawt.c -- GTK implementation of classpath_jawt.h
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 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 <gtk/gtk.h>
-#include <gdk/gdkx.h>
-#include "classpath_jawt.h"
-
-jint
-classpath_jawt_get_awt_version ()
-{
- return CLASSPATH_JAWT_VERSION;
-}
-
-Display*
-classpath_jawt_get_default_display (JNIEnv* env, jobject canvas)
-{
- GdkDisplay *display;
- Display *xdisplay;
- GtkWidget *widget;
- void *ptr;
- jobject peer;
- jclass class_id;
- jmethodID method_id;
-
- /* retrieve peer object */
- class_id = (*env)->GetObjectClass (env, canvas);
-
- method_id = (*env)->GetMethodID (env, class_id,
- "getPeer",
- "()Ljava/awt/peer/ComponentPeer;");
-
- peer = (*env)->CallObjectMethod (env, canvas, method_id);
-
- ptr = NSA_GET_PTR (env, peer);
-
- gdk_threads_enter ();
-
- widget = GTK_WIDGET (ptr);
-
- /* widget should be realized before Canvas.paint is called. */
- g_assert (GTK_WIDGET_REALIZED (widget));
-
- display = gtk_widget_get_display (widget);
-
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- gdk_threads_leave ();
-
- return xdisplay;
-}
-
-VisualID
-classpath_jawt_get_visualID (JNIEnv* env, jobject canvas)
-{
- GtkWidget *widget;
- Visual *visual;
- void *ptr;
- jobject peer;
- jclass class_id;
- jmethodID method_id;
-
- class_id = (*env)->GetObjectClass (env, canvas);
-
- method_id = (*env)->GetMethodID (env, class_id,
- "getPeer",
- "()Ljava/awt/peer/ComponentPeer;");
-
- peer = (*env)->CallObjectMethod (env, canvas, method_id);
-
- ptr = NSA_GET_PTR (env, peer);
-
- gdk_threads_enter ();
-
- widget = GTK_WIDGET (ptr);
-
- g_assert (GTK_WIDGET_REALIZED (widget));
-
- visual = gdk_x11_visual_get_xvisual (gtk_widget_get_visual (widget));
- g_assert (visual != NULL);
-
- gdk_threads_leave ();
-
- return visual->visualid;
-}
-
-Drawable
-classpath_jawt_get_drawable (JNIEnv* env, jobject canvas)
-{
- GtkWidget *widget;
- int drawable;
- void *ptr;
- jobject peer;
- jclass class_id;
- jmethodID method_id;
-
- class_id = (*env)->GetObjectClass (env, canvas);
-
- method_id = (*env)->GetMethodID (env, class_id,
- "getPeer",
- "()Ljava/awt/peer/ComponentPeer;");
-
- peer = (*env)->CallObjectMethod (env, canvas, method_id);
-
- ptr = NSA_GET_PTR (env, peer);
-
- gdk_threads_enter ();
-
- widget = GTK_WIDGET (ptr);
-
- g_assert (GTK_WIDGET_REALIZED (widget));
-
- drawable = GDK_DRAWABLE_XID (widget->window);
-
- gdk_threads_leave ();
-
- return drawable;
-}
-
-jint
-classpath_jawt_object_lock (jobject lock)
-{
- JNIEnv *env = gdk_env();
- (*env)->MonitorEnter (env, lock);
- return 0;
-}
-
-void
-classpath_jawt_object_unlock (jobject lock)
-{
- JNIEnv *env = gdk_env();
- (*env)->MonitorExit (env, lock);
-}
-
-jint
-classpath_jawt_lock ()
-{
- gdk_threads_enter ();
- return 0;
-}
-
-void
-classpath_jawt_unlock ()
-{
- gdk_threads_leave ();
-}
-
-jobject
-classpath_jawt_create_lock ()
-{
- JNIEnv *env = gdk_env ();
- jobject lock = (*env)->NewStringUTF (env, "jawt-lock");
- NSA_SET_GLOBAL_REF (env, lock);
- return lock;
-}
-
-void
-classpath_jawt_destroy_lock (jobject lock)
-{
- JNIEnv *env = gdk_env ();
- NSA_DEL_GLOBAL_REF (env, lock);
-}
diff --git a/libjava/jni/gtk-peer/gtkcairopeer.h b/libjava/jni/gtk-peer/gtkcairopeer.h
deleted file mode 100644
index c4b1eb6a917..00000000000
--- a/libjava/jni/gtk-peer/gtkcairopeer.h
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef __GTKCAIROPEER_H__
-#define __GTKCAIROPEER_H__
-
-/* gtkcairopeer.h -- Some global variables and #defines
- Copyright (C) 1998, 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 <cairo.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-/*
- A graphics2d struct is both simpler and uglier than a graphics
- struct.
-
- Most of the graphics2d drawing state is held in the referenced cairo_t
- and corresponding cairo_surface_t, so we can ignore it.
-
- In addition to the cairo_t, we need to hold an extra reference to the
- underlying GdkDrawable so its refcount matches the lifecycle of the java
- Graphics object which is peering with us; also a reference to a byte
- buffer and cairo_surface_t which contain the pattern you're drawing from
- (if it exists).
-
- Finally, it is possible that we are using a non-RENDER capable X server,
- therefore we will be drawing to an cairo_surface_t which is actually a
- pixbuf. When this is the case, the pointer to a GdkPixbuf will be
- non-NULL and any drawing operation needs to be bracketed by pixbuf
- load/save operations. If the GdkPixbuf pointer is NULL, we will treat
- the cairo_surface_t as RENDER-capable.
- */
-
-struct graphics2d
-{
- cairo_t *cr;
- cairo_surface_t *surface;
- GdkDrawable *drawable;
- GdkWindow *win;
- GdkPixbuf *drawbuf;
- char *pattern_pixels;
- cairo_surface_t *pattern_surface;
- cairo_pattern_t *pattern;
- gboolean debug;
- enum
- {
- MODE_DRAWABLE_WITH_RENDER,
- MODE_DRAWABLE_NO_RENDER,
- MODE_JAVA_ARRAY
- }
- mode;
-
- /* Support for MODE_JAVA_ARRAY */
- jintArray jarray;
- jint width, height;
- jint *javabuf;
- jboolean isCopy;
-};
-
-#endif /* __GTKCAIROPEER_H */
diff --git a/libjava/jni/gtk-peer/gtkpeer.h b/libjava/jni/gtk-peer/gtkpeer.h
deleted file mode 100644
index 914de570f85..00000000000
--- a/libjava/jni/gtk-peer/gtkpeer.h
+++ /dev/null
@@ -1,522 +0,0 @@
-/* gtkpeer.h -- Some global variables and #defines
- Copyright (C) 1998, 1999, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 <gtk/gtk.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <config.h>
-#include "native_state.h"
-
-#include <jni.h>
-
-#define RC_FILE ".classpath-gtkrc"
-#define JVM_SUN
-/*
- #define JVM_JAPHAR
-*/
-
-#ifndef __GTKPEER_H__
-#define __GTKPEER_H__
-
-#ifndef __GNUC__
-#define __attribute__(x) /* nothing */
-#endif
-
-#ifdef JVM_SUN
-
-extern struct state_table *native_state_table;
-extern struct state_table *native_global_ref_table;
-
-#define NSA_INIT(env, clazz) \
- do {native_state_table = init_state_table (env, clazz); \
- native_global_ref_table = init_state_table (env, clazz);} while (0)
-
-#define NSA_GET_PTR(env, obj) \
- get_state (env, obj, native_state_table)
-
-#define NSA_SET_PTR(env, obj, ptr) \
- set_state (env, obj, native_state_table, (void *)ptr)
-
-#define NSA_DEL_PTR(env, obj) \
- remove_state_slot (env, obj, native_state_table)
-
-#define NSA_GET_GLOBAL_REF(env, obj) \
- get_state (env, obj, native_global_ref_table)
-
-#define NSA_SET_GLOBAL_REF(env, obj) \
- do {jobject *globRefPtr; \
- globRefPtr = (jobject *) malloc (sizeof (jobject)); \
- *globRefPtr = (*env)->NewGlobalRef (env, obj); \
- set_state (env, obj, native_global_ref_table, (void *)globRefPtr);} while (0)
-
-#define NSA_DEL_GLOBAL_REF(env, obj) \
- do {jobject *globRefPtr = get_state (env, obj, native_global_ref_table); \
- remove_state_slot (env, obj, native_global_ref_table); \
- (*env)->DeleteGlobalRef (env, *globRefPtr); \
- free (globRefPtr);} while (0)
-
-extern struct state_table *native_pixbufdecoder_state_table;
-
-#define NSA_PB_INIT(env, clazz) \
- native_pixbufdecoder_state_table = init_state_table (env, clazz)
-
-#define NSA_GET_PB_PTR(env, obj) \
- get_state (env, obj, native_pixbufdecoder_state_table)
-
-#define NSA_SET_PB_PTR(env, obj, ptr) \
- set_state (env, obj, native_pixbufdecoder_state_table, (void *)ptr)
-
-#define NSA_DEL_PB_PTR(env, obj) \
- remove_state_slot (env, obj, native_pixbufdecoder_state_table)
-
-#endif /* JVM_SUN */
-
-#define SWAPU32(w) \
- (((w) << 24) | (((w) & 0xff00) << 8) | (((w) >> 8) & 0xff00) | ((w) >> 24))
-
-struct graphics
-{
- GdkDrawable *drawable;
- GdkGC *gc;
- GdkColormap *cm;
- PangoFontDescription *pango_font;
- PangoContext *pango_context;
- PangoLayout *pango_layout;
- jint x_offset, y_offset;
-};
-
-#define AWT_DEFAULT_CURSOR 0
-#define AWT_CROSSHAIR_CURSOR 1
-#define AWT_TEXT_CURSOR 2
-#define AWT_WAIT_CURSOR 3
-#define AWT_SW_RESIZE_CURSOR 4
-#define AWT_SE_RESIZE_CURSOR 5
-#define AWT_NW_RESIZE_CURSOR 6
-#define AWT_NE_RESIZE_CURSOR 7
-#define AWT_N_RESIZE_CURSOR 8
-#define AWT_S_RESIZE_CURSOR 9
-#define AWT_W_RESIZE_CURSOR 10
-#define AWT_E_RESIZE_CURSOR 11
-#define AWT_HAND_CURSOR 12
-#define AWT_MOVE_CURSOR 13
-
-#define SYNTHETIC_EVENT_MASK (1 << 10)
-
-#define AWT_SHIFT_DOWN_MASK (1 << 6)
-#define AWT_CTRL_DOWN_MASK (1 << 7)
-#define AWT_META_DOWN_MASK (1 << 8)
-#define AWT_ALT_DOWN_MASK (1 << 9)
-
-#define AWT_BUTTON1_DOWN_MASK (1 << 10)
-#define AWT_BUTTON2_DOWN_MASK (1 << 11)
-#define AWT_BUTTON3_DOWN_MASK (1 << 12)
-
-#define AWT_BUTTON1_MASK (1 << 4)
-#define AWT_BUTTON2_MASK (1 << 3)
-#define AWT_BUTTON3_MASK (1 << 2)
-
-#define MULTI_CLICK_TIME 250
-/* as opposed to a MULTI_PASS_TIME :) */
-
-#define AWT_MOUSE_CLICKED 500
-#define AWT_MOUSE_PRESSED 501
-#define AWT_MOUSE_RELEASED 502
-#define AWT_MOUSE_MOVED 503
-#define AWT_MOUSE_ENTERED 504
-#define AWT_MOUSE_EXITED 505
-#define AWT_MOUSE_DRAGGED 506
-
-#define AWT_ADJUSTMENT_UNIT_INCREMENT 1
-#define AWT_ADJUSTMENT_UNIT_DECREMENT 2
-#define AWT_ADJUSTMENT_BLOCK_DECREMENT 3
-#define AWT_ADJUSTMENT_BLOCK_INCREMENT 4
-#define AWT_ADJUSTMENT_TRACK 5
-
-#define AWT_SCROLLPANE_SCROLLBARS_AS_NEEDED 0
-#define AWT_SCROLLPANE_SCROLLBARS_ALWAYS 1
-#define AWT_SCROLLPANE_SCROLLBARS_NEVER 2
-
-#define AWT_LABEL_LEFT 0
-#define AWT_LABEL_CENTER 1
-#define AWT_LABEL_RIGHT 2
-
-#define AWT_TEXTAREA_SCROLLBARS_BOTH 0
-#define AWT_TEXTAREA_SCROLLBARS_VERTICAL_ONLY 1
-#define AWT_TEXTAREA_SCROLLBARS_HORIZONTAL_ONLY 2
-
-#define AWT_ITEM_SELECTED 1
-#define AWT_ITEM_DESELECTED 2
-
-#define AWT_KEY_TYPED 400
-#define AWT_KEY_PRESSED 401
-#define AWT_KEY_RELEASED 402
-
-#define AWT_KEY_CHAR_UNDEFINED 0
-
-#define AWT_KEY_LOCATION_UNKNOWN 0
-#define AWT_KEY_LOCATION_STANDARD 1
-#define AWT_KEY_LOCATION_LEFT 2
-#define AWT_KEY_LOCATION_RIGHT 3
-#define AWT_KEY_LOCATION_NUMPAD 4
-
-/* Virtual Keys */
-/* This list should be kept in the same order as the VK_ field
- declarations in KeyEvent.java. */
-#define VK_ENTER '\n'
-#define VK_BACK_SPACE '\b'
-#define VK_TAB '\t'
-#define VK_CANCEL 3
-#define VK_CLEAR 12
-#define VK_SHIFT 16
-#define VK_CONTROL 17
-#define VK_ALT 18
-#define VK_PAUSE 19
-#define VK_CAPS_LOCK 20
-#define VK_ESCAPE 27
-#define VK_SPACE ' '
-#define VK_PAGE_UP 33
-#define VK_PAGE_DOWN 34
-#define VK_END 35
-#define VK_HOME 36
-#define VK_LEFT 37
-#define VK_UP 38
-#define VK_RIGHT 39
-#define VK_DOWN 40
-#define VK_COMMA ','
-#define VK_MINUS '-'
-#define VK_PERIOD '.'
-#define VK_SLASH '/'
-#define VK_0 '0'
-#define VK_1 '1'
-#define VK_2 '2'
-#define VK_3 '3'
-#define VK_4 '4'
-#define VK_5 '5'
-#define VK_6 '6'
-#define VK_7 '7'
-#define VK_8 '8'
-#define VK_9 '9'
-#define VK_SEMICOLON ';'
-#define VK_EQUALS '='
-#define VK_A 'A'
-#define VK_B 'B'
-#define VK_C 'C'
-#define VK_D 'D'
-#define VK_E 'E'
-#define VK_F 'F'
-#define VK_G 'G'
-#define VK_H 'H'
-#define VK_I 'I'
-#define VK_J 'J'
-#define VK_K 'K'
-#define VK_L 'L'
-#define VK_M 'M'
-#define VK_N 'N'
-#define VK_O 'O'
-#define VK_P 'P'
-#define VK_Q 'Q'
-#define VK_R 'R'
-#define VK_S 'S'
-#define VK_T 'T'
-#define VK_U 'U'
-#define VK_V 'V'
-#define VK_W 'W'
-#define VK_X 'X'
-#define VK_Y 'Y'
-#define VK_Z 'Z'
-#define VK_OPEN_BRACKET '['
-#define VK_BACK_SLASH '\\'
-#define VK_CLOSE_BRACKET ']'
-#define VK_NUMPAD0 96
-#define VK_NUMPAD1 97
-#define VK_NUMPAD2 98
-#define VK_NUMPAD3 99
-#define VK_NUMPAD4 100
-#define VK_NUMPAD5 101
-#define VK_NUMPAD6 102
-#define VK_NUMPAD7 103
-#define VK_NUMPAD8 104
-#define VK_NUMPAD9 105
-#define VK_MULTIPLY 106
-#define VK_ADD 107
-#define VK_SEPARATER 108
-#define VK_SEPARATOR 108
-#define VK_SUBTRACT 109
-#define VK_DECIMAL 110
-#define VK_DIVIDE 111
-#define VK_DELETE 127
-#define VK_NUM_LOCK 144
-#define VK_SCROLL_LOCK 145
-#define VK_F1 112
-#define VK_F2 113
-#define VK_F3 114
-#define VK_F4 115
-#define VK_F5 116
-#define VK_F6 117
-#define VK_F7 118
-#define VK_F8 119
-#define VK_F9 120
-#define VK_F10 121
-#define VK_F11 122
-#define VK_F12 123
-#define VK_F13 61440
-#define VK_F14 61441
-#define VK_F15 61442
-#define VK_F16 61443
-#define VK_F17 61444
-#define VK_F18 61445
-#define VK_F19 61446
-#define VK_F20 61447
-#define VK_F21 61448
-#define VK_F22 61449
-#define VK_F23 61450
-#define VK_F24 61451
-#define VK_PRINTSCREEN 154
-#define VK_INSERT 155
-#define VK_HELP 156
-#define VK_META 157
-#define VK_BACK_QUOTE 192
-#define VK_QUOTE 222
-#define VK_KP_UP 224
-#define VK_KP_DOWN 225
-#define VK_KP_LEFT 226
-#define VK_KP_RIGHT 227
-#define VK_DEAD_GRAVE 128
-#define VK_DEAD_ACUTE 129
-#define VK_DEAD_CIRCUMFLEX 130
-#define VK_DEAD_TILDE 131
-#define VK_DEAD_MACRON 132
-#define VK_DEAD_BREVE 133
-#define VK_DEAD_ABOVEDOT 134
-#define VK_DEAD_DIAERESIS 135
-#define VK_DEAD_ABOVERING 136
-#define VK_DEAD_DOUBLEACUTE 137
-#define VK_DEAD_CARON 138
-#define VK_DEAD_CEDILLA 139
-#define VK_DEAD_OGONEK 140
-#define VK_DEAD_IOTA 141
-#define VK_DEAD_VOICED_SOUND 142
-#define VK_DEAD_SEMIVOICED_SOUND 143
-#define VK_AMPERSAND 150
-#define VK_ASTERISK 151
-#define VK_QUOTEDBL 152
-#define VK_LESS 153
-#define VK_GREATER 160
-#define VK_BRACELEFT 161
-#define VK_BRACERIGHT 162
-#define VK_AT 512
-#define VK_COLON 513
-#define VK_CIRCUMFLEX 514
-#define VK_DOLLAR 515
-#define VK_EURO_SIGN 516
-#define VK_EXCLAMATION_MARK 517
-#define VK_INVERTED_EXCLAMATION_MARK 518
-#define VK_LEFT_PARENTHESIS 519
-#define VK_NUMBER_SIGN 520
-#define VK_PLUS 521
-#define VK_RIGHT_PARENTHESIS 522
-#define VK_UNDERSCORE 523
-#define VK_FINAL 24
-#define VK_CONVERT 28
-#define VK_NONCONVERT 29
-#define VK_ACCEPT 30
-#define VK_MODECHANGE 31
-#define VK_KANA 21
-#define VK_KANJI 25
-#define VK_ALPHANUMERIC 240
-#define VK_KATAKANA 241
-#define VK_HIRAGANA 242
-#define VK_FULL_WIDTH 243
-#define VK_HALF_WIDTH 244
-#define VK_ROMAN_CHARACTERS 245
-#define VK_ALL_CANDIDATES 256
-#define VK_PREVIOUS_CANDIDATE 257
-#define VK_CODE_INPUT 258
-#define VK_JAPANESE_KATAKANA 259
-#define VK_JAPANESE_HIRAGANA 260
-#define VK_JAPANESE_ROMAN 261
-#define VK_KANA_LOCK 262
-#define VK_INPUT_METHOD_ON_OFF 263
-#define VK_CUT 65489
-#define VK_COPY 65485
-#define VK_PASTE 65487
-#define VK_UNDO 65483
-#define VK_AGAIN 65481
-#define VK_FIND 65488
-#define VK_PROPS 65482
-#define VK_STOP 65480
-#define VK_COMPOSE 65312
-#define VK_ALT_GRAPH 65406
-#define VK_UNDEFINED 0
-
-#define AWT_FOCUS_GAINED 1004
-#define AWT_FOCUS_LOST 1005
-
-#define AWT_WINDOW_OPENED 200
-#define AWT_WINDOW_CLOSING 201
-#define AWT_WINDOW_CLOSED 202
-#define AWT_WINDOW_ICONIFIED 203
-#define AWT_WINDOW_DEICONIFIED 204
-#define AWT_WINDOW_ACTIVATED 205
-#define AWT_WINDOW_DEACTIVATED 206
-#define AWT_WINDOW_GAINED_FOCUS 207
-#define AWT_WINDOW_LOST_FOCUS 208
-#define AWT_WINDOW_STATE_CHANGED 209
-
-#define AWT_FRAME_STATE_NORMAL 0
-#define AWT_FRAME_STATE_ICONIFIED 1
-#define AWT_FRAME_STATE_MAXIMIZED_HORIZ 2
-#define AWT_FRAME_STATE_MAXIMIZED_VERT 4
-#define AWT_FRAME_STATE_MAXIMIZED_BOTH 6
-
-#define AWT_STYLE_PLAIN 0
-#define AWT_STYLE_BOLD 1
-#define AWT_STYLE_ITALIC 2
-
-/* From java.awt.SystemColor */
-#define AWT_DESKTOP 0
-#define AWT_ACTIVE_CAPTION 1
-#define AWT_ACTIVE_CAPTION_TEXT 2
-#define AWT_ACTIVE_CAPTION_BORDER 3
-#define AWT_INACTIVE_CAPTION 4
-#define AWT_INACTIVE_CAPTION_TEXT 5
-#define AWT_INACTIVE_CAPTION_BORDER 6
-#define AWT_WINDOW 7
-#define AWT_WINDOW_BORDER 8
-#define AWT_WINDOW_TEXT 9
-#define AWT_MENU 10
-#define AWT_MENU_TEXT 11
-#define AWT_TEXT 12
-#define AWT_TEXT_TEXT 13
-#define AWT_TEXT_HIGHLIGHT 14
-#define AWT_TEXT_HIGHLIGHT_TEXT 15
-#define AWT_TEXT_INACTIVE_TEXT 16
-#define AWT_CONTROL 17
-#define AWT_CONTROL_TEXT 18
-#define AWT_CONTROL_HIGHLIGHT 19
-#define AWT_CONTROL_LT_HIGHLIGHT 20
-#define AWT_CONTROL_SHADOW 21
-#define AWT_CONTROL_DK_SHADOW 22
-#define AWT_SCROLLBAR 23
-#define AWT_INFO 24
-#define AWT_INFO_TEXT 25
-#define AWT_NUM_COLORS 26
-
-extern jmethodID setBoundsCallbackID;
-
-extern jmethodID postActionEventID;
-extern jmethodID postMenuActionEventID;
-extern jmethodID postMouseEventID;
-extern jmethodID postConfigureEventID;
-extern jmethodID postExposeEventID;
-extern jmethodID postKeyEventID;
-extern jmethodID postFocusEventID;
-extern jmethodID postAdjustmentEventID;
-extern jmethodID choicePostItemEventID;
-extern jmethodID postItemEventID;
-extern jmethodID postListItemEventID;
-extern jmethodID postTextEventID;
-extern jmethodID postWindowEventID;
-
-extern jmethodID beginNativeRepaintID;
-extern jmethodID endNativeRepaintID;
-
-extern jmethodID initComponentGraphicsID;
-extern jmethodID initComponentGraphics2DID;
-extern jmethodID setCursorID;
-
-extern jmethodID syncAttrsID;
-extern jclass gdkColor;
-extern jmethodID gdkColorID;
-
-extern jmethodID postInsetsChangedEventID;
-extern jmethodID windowGetWidthID;
-extern jmethodID windowGetHeightID;
-
-JNIEnv *gdk_env(void);
-
-extern double dpi_conversion_factor;
-
-extern GtkWindowGroup *global_gtk_window_group;
-
-void awt_event_handler (GdkEvent *event);
-
-gboolean pre_event_handler (GtkWidget *widget,
- GdkEvent *event,
- jobject peer);
-
-void connect_awt_hook (JNIEnv *env, jobject peer_obj, int nwindows, ...);
-void connect_awt_hook_cb (GtkWidget *widget, jobject peer);
-
-void set_visible (GtkWidget *widget, jboolean visible);
-void set_parent (GtkWidget *widget, GtkContainer *parent);
-
-jint keyevent_state_to_awt_mods (GdkEvent *event);
-
-guint awt_keycode_to_keysym (jint keyCode, jint keyLocation);
-
-struct item_event_hook_info
-{
- jobject peer_obj;
- const char *label;
-};
-
-/* Union used for type punning. */
-union widget_union
-{
- void **void_widget;
- GtkWidget **widget;
-};
-
-#define DEBUG_LOCKING 0
-
-#if DEBUG_LOCKING
-#define gdk_threads_enter() \
-{ \
- g_print ("lock: %s, %d\n", __FILE__, __LINE__); \
- gdk_threads_enter (); \
-}
-#define gdk_threads_leave() \
-{ \
- g_print ("unlock: %s, %d\n", __FILE__, __LINE__); \
- gdk_threads_leave (); \
-}
-#endif
-
-#endif /* __GTKPEER_H */
diff --git a/libjava/org/ietf/jgss/ChannelBinding.java b/libjava/org/ietf/jgss/ChannelBinding.java
deleted file mode 100644
index b02683adb0d..00000000000
--- a/libjava/org/ietf/jgss/ChannelBinding.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/* ChannelBinding.java -- a channel binding in the GSS-API.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-/* The documentation comments of this class are derived from the text
- of RFC 2853: Generic Security Service API Version 2: Java Bindings.
- That document is covered under the following license notice:
-
-Copyright (C) The Internet Society (2000). All Rights Reserved.
-
-This document and translations of it may be copied and furnished to
-others, and derivative works that comment on or otherwise explain it
-or assist in its implementation may be prepared, copied, published and
-distributed, in whole or in part, without restriction of any kind,
-provided that the above copyright notice and this paragraph are
-included on all such copies and derivative works. However, this
-document itself may not be modified in any way, such as by removing
-the copyright notice or references to the Internet Society or other
-Internet organizations, except as needed for the purpose of developing
-Internet standards in which case the procedures for copyrights defined
-in the Internet Standards process must be followed, or as required to
-translate it into languages other than English.
-
-The limited permissions granted above are perpetual and will not be
-revoked by the Internet Society or its successors or assigns.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
-TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
-NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
-WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. */
-
-
-package org.ietf.jgss;
-
-import java.net.InetAddress;
-import java.util.Arrays;
-
-/**
- * <p>The GSS-API accommodates the concept of caller-provided channel
- * binding information. Channel bindings are used to strengthen the
- * quality with which peer entity authentication is provided during
- * context establishment. They enable the GSS-API callers to bind the
- * establishment of the security context to relevant characteristics
- * like addresses or to application specific data.</p>
- *
- * <p>The caller initiating the security context must determine the
- * appropriate channel binding values to set in the {@link GSSContext}
- * object. The acceptor must provide an identical binding in order to
- * validate that received tokens possess correct channel-related
- * characteristics.</p>
- *
- * <p>Use of channel bindings is optional in GSS-API. Since channel-binding
- * information may be transmitted in context establishment tokens,
- * applications should therefore not use confidential data as
- * channel-binding components.</p>
- */
-public class ChannelBinding
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final byte[] appData;
- private final InetAddress initAddr;
- private final InetAddress acceptAddr;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- /**
- * Create a ChannelBinding object with user supplied address information
- * and data. <code>null</code> values can be used for any fields which the
- * application does not want to specify.
- *
- * @param initAddr The address of the context initiator. <code>null</code>
- * value can be supplied to indicate that the application
- * does not want to set this value.
- * @param acceptAddr The address of the context acceptor. <code>null</code>
- * value can be supplied to indicate that the application
- * does not want to set this value.
- * @param appData Application supplied data to be used as part of the
- * channel bindings. <code>null</code> value can be
- * supplied to indicate that the application does not
- * want to set this value.
- */
- public ChannelBinding(InetAddress initAddr, InetAddress acceptAddr,
- byte[] appData)
- {
- this.appData = (appData != null) ? (byte[]) appData.clone() : null;
- this.initAddr = initAddr;
- this.acceptAddr = acceptAddr;
- }
-
- /**
- * Creates a ChannelBinding object without any addressing information.
- *
- * @param appData Application supplied data to be used as part of the
- * channel bindings.
- */
- public ChannelBinding(byte[] appData)
- {
- this(null, null, appData);
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- /**
- * Returns the initiator's address for this channel binding.
- * <code>null</code> is returned if the address has not been set.
- *
- * @return The initiator's address, or <code>null</code>.
- */
- public InetAddress getInitiatorAddress()
- {
- return initAddr;
- }
-
- /**
- * Returns the acceptor's address for this channel binding.
- * <code>null</code> is returned if the address has not been set.
- *
- * @return The acceptor's address, or <code>null</code>.
- */
- public InetAddress getAcceptorAddress()
- {
- return acceptAddr;
- }
-
- /**
- * Returns application data being used as part of the ChannelBinding.
- * <code>null</code> is returned if no application data has been
- * specified for the channel binding.
- *
- * @return The application data, or <code>null</code>.
- */
- public byte[] getApplicationData()
- {
- if (appData != null)
- return (byte[]) appData.clone();
- return null;
- }
-
- /**
- * Returns <code>true</code> if two channel bindings match.
- *
- * @param obj Another channel binding to compare with.
- * @return True if this channel binding equals the other.
- */
- public boolean equals(Object obj)
- {
- if (!(obj instanceof ChannelBinding))
- return false;
- ChannelBinding cb = (ChannelBinding) obj;
- boolean b1 = Arrays.equals(appData, cb.appData);
- boolean b2 = (initAddr == null && cb.initAddr == null)
- || (cb.initAddr != null && initAddr.equals(cb.initAddr));
- boolean b3 = (acceptAddr == null && cb.acceptAddr == null)
- || (cb.acceptAddr != null && acceptAddr.equals(cb.acceptAddr));
- return b1 && b2 && b3;
- }
-
- /**
- * Returns the hash code for this channel binding.
- *
- * @return The hash code.
- */
- public int hashCode()
- {
- int code = 0;
- if (appData != null)
- for (int i = 0; i < appData.length; i++)
- code ^= appData[i] << ((8 * i) & 31);
- if (initAddr != null)
- code ^= initAddr.hashCode();
- if (acceptAddr != null)
- code ^= acceptAddr.hashCode();
- return code;
- }
-}
diff --git a/libjava/org/ietf/jgss/GSSContext.java b/libjava/org/ietf/jgss/GSSContext.java
deleted file mode 100644
index 6f469e235a3..00000000000
--- a/libjava/org/ietf/jgss/GSSContext.java
+++ /dev/null
@@ -1,924 +0,0 @@
-/* GSSContext.java -- The GSS context interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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 org.ietf.jgss;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * <p>This interface encapsulates the GSS-API security context and provides
- * the security services ({@link #wrap(byte[],int,int,org.ietf.jgss.MessageProp)},
- * {@link #unwrap(byte[],int,int,org.ietf.jgss.MessageProp)}, {@link
- * #getMIC(byte[],int,int,org.ietf.jgss.MessageProp)}, {@link
- * #verifyMIC(byte[],int,int,byte[],int,int,org.ietf.jgss.MessageProp)}) that
- * are available over the context. Security contexts are established
- * between peers using locally acquired credentials. Multiple contexts
- * may exist simultaneously between a pair of peers, using the same or
- * different set of credentials. GSS-API functions in a manner
- * independent of the underlying transport protocol and depends on its
- * calling application to transport its tokens between peers.</p>
- *
- * <p>Before the context establishment phase is initiated, the context
- * initiator may request specific characteristics desired of the
- * established context. These can be set using the set methods. After
- * the context is established, the caller can check the actual
- * characteristic and services offered by the context using the query
- * methods.</p>
- *
- * <p>The context establishment phase begins with the first call to the
- * init method by the context initiator. During this phase the
- * {@link #initSecContext(byte[],int,int)} and {@link
- * #acceptSecContext(byte[],int,int)} methods will produce GSS-API
- * authentication tokens which the calling application needs to send to
- * its peer. If an error occurs at any point, an exception will get
- * thrown and the code will start executing in a catch block. If not,
- * the normal flow of code continues and the application can make a call
- * to the {@link #isEstablished()} method. If this method returns false it
- * indicates that a token is needed from its peer in order to continue
- * the context establishment phase. A return value of true signals that
- * the local end of the context is established. This may still require
- * that a token be sent to the peer, if one is produced by GSS-API.
- * During the context establishment phase, the {@link #isProtReady()}
- * method may be called to determine if the context can be used for the
- * per-message operations. This allows applications to use per-message
- * operations on contexts which aren't fully established.</p>
- *
- * <p>After the context has been established or the {@link #isProtReady()}
- * method returns <code>true</code>, the query routines can be invoked to
- * determine the actual characteristics and services of the established
- * context. The application can also start using the per-message methods
- * of {@link #wrap(byte[],int,int,org.ietf.jgss.MessageProp)} and
- * {@link #getMIC(byte[],int,int,org.ietf.jgss.MessageProp)} to obtain
- * cryptographic operations on application supplied data.</p>
- *
- * <p>When the context is no longer needed, the application should call
- * {@link dispose()} to release any system resources the context may be
- * using.</p>
- *
- * <h3>Example Code</h3>
- *
- * <pre>
-GSSManager mgr = GSSManager.getInstance();
-
-// start by creating the name for a service entity
-GSSName targetName = mgr.createName("service@host",
- GSSName.NT_HOSTBASED_SERVICE);
-
-// create a context using default credentials for the above entity
-// and the implementation specific default mechanism
-GSSContext context = mgr.createContext(targetName,
- null, // default mechanism
- null, // default credentials
- GSSContext.INDEFINITE_LIFETIME);
-
-// set desired context options - all others are false by default
-context.requestConf(true);
-context.requestMutualAuth(true);
-context.requestReplayDet(true);
-context.requestSequenceDet(true);
-
-// establish a context between peers - using byte arrays
-byte []inTok = new byte[0];
-
-try
- {
- do
- {
- byte[] outTok = context.initSecContext(inTok, 0,
- inTok.length);
-
- // send the token if present
- if (outTok != null)
- sendToken(outTok);
-
- // check if we should expect more tokens
- if (context.isEstablished())
- break;
-
- // another token expected from peer
- inTok = readToken();
-
- }
- while (true);
- }
-catch (GSSException e)
- {
- print("GSSAPI error: " + e.getMessage());
- }
-
-// display context information
-print("Remaining lifetime in seconds = " + context.getLifetime());
-print("Context mechanism = " + context.getMech().toString());
-print("Initiator = " + context.getSrcName().toString());
-print("Acceptor = " + context.getTargName().toString());
-
-if (context.getConfState())
- print("Confidentiality security service available");
-
-if (context.getIntegState())
- print("Integrity security service available");
-
-// perform wrap on an application supplied message, appMsg,
-// using QOP = 0, and requesting privacy service
-byte[] appMsg ...
-MessageProp mProp = new MessageProp(0, true);
-byte[] tok = context.wrap(appMsg, 0, appMsg.length, mProp);
-
-if (mProp.getPrivacy())
- print("Message protected with privacy.");
-
-sendToken(tok);
-
-
-// release the local-end of the context
-context.dispose();
- * </pre>
- */
-public interface GSSContext
-{
-
- // Constants.
- // -------------------------------------------------------------------------
-
- /**
- * A lifetime constant representing the default context lifetime.
- */
- int DEFAULT_LIFETIME = 0;
-
- /**
- * A lifetime constant representing indefinite context lifetime.
- */
- int INDEFINITE_LIFETIME = Integer.MAX_VALUE;
-
- // Methods.
- // -------------------------------------------------------------------------
-
- /**
- * <p>Called by the context initiator to start the context creation
- * process. This is equivalent to the stream based method except that
- * the token buffers are handled as byte arrays instead of using stream
- * objects. This method may return an output token which the
- * application will need to send to the peer for processing by the
- * accept call. Typically, the application would do so by calling the
- * {@link OutputStream#flush()} method on an OutputStream that
- * encapsulates the connection between the two peers. The application
- * can call {@link #isEstablished()} to determine if the context
- * establishment phase is complete for this peer. A return value of
- * <code>false</code> from {@link #isEstablished()} indicates that more
- * tokens are expected to be supplied to the initSecContext() method. Note
- * that it is possible that the initSecContext() method return a token for
- * the peer, and {@link #isEstablished()} to return <code>true</code> also.
- * This indicates that the token needs to be sent to the peer, but the local
- * end of the context is now fully established.</p>
- *
- * <p>Upon completion of the context establishment, the available context
- * options may be queried through the get methods.</p>
- *
- * @param inputBuf Token generated by the peer. This parameter is ignored
- * on the first call.
- * @param offset The offset within the <i>inputBuf</i> where the token
- * begins.
- * @param len The length of the token within the <i>inputBuf</i>
- * (starting at the offset).
- * @return The output token, if any.
- * @throws GSSException If this operation fails.
- */
- byte[] initSecContext(byte[] inputBuf, int offset, int len)
- throws GSSException;
-
- /**
- * <p>Called by the context initiator to start the context creation
- * process. This is equivalent to the byte array based method. This
- * method may write an output token to the <i>outStream</i>, which the
- * application will need to send to the peer for processing by the
- * accept call. Typically, the application would do so by calling the
- * {@link OutputStream#flush()} method on an OutputStream that encapsulates
- * the connection between the two peers. The application can call {@link
- * #isEstablished()} to determine if the context establishment phase is
- * complete for this peer. A return value of <code>false</code> from
- * isEstablished indicates that more tokens are expected to be supplied
- * to the initSecContext() method. Note that it is possible that the
- * initSecContext() method return a token for the peer, and {@link
- * #isEstablished() return <code>true</code> also. This indicates that
- * the token needs to be sent to the peer, but the local end of the context
- * is now fully established.</p>
- *
- * <p>The GSS-API authentication tokens contain a definitive start and end.
- * This method will attempt to read one of these tokens per invocation,
- * and may block on the stream if only part of the token is available.</p>
- *
- * <p>Upon completion of the context establishment, the available context
- * options may be queried through the get methods.</p>
- *
- * @param inStream Contains the token generated by the peer. This
- * parameter is ignored on the first call.
- * @param outStream Output stream where the output token will be written.
- * During the final stage of context establishment, there
- * may be no bytes written.
- * @return The number of bytes written to <i>outStream</i>, or 0 if no
- * token is written.
- * @throws GSSException If this operation fails.
- */
- int initSecContext(InputStream inStream, OutputStream outStream)
- throws GSSException;
-
- /**
- * <p>Called by the context acceptor upon receiving a token from the peer.
- * This call is equivalent to the stream based method except that the
- * token buffers are handled as byte arrays instead of using stream
- * objects.</p>
- *
- * <p>This method may return an output token which the application will
- * need to send to the peer for further processing by the init call.</p>
- *
- * <p><code>null</code> return value indicates that no token needs to be
- * sent to the peer. The application can call {@link #isEstablished()}
- * to determine if the context establishment phase is complete for this
- * peer. A return value of <code>false</code> from {@link #isEstablished()}
- * indicates that more tokens are expected to be supplied to this
- * method.</p>
- *
- * <p>Note that it is possible that acceptSecContext() return a token for
- * the peer, and isEstablished() return <code>true</code> also. This
- * indicates that the token needs to be sent to the peer, but the local
- * end of the context is now fully established.</p>
- *
- * <p>Upon completion of the context establishment, the available context
- * options may be queried through the get methods.</p>
- *
- * @param inTok Token generated by the peer.
- * @param offset The offset within the <i>inTok</i> where the token begins.
- * @param len The length of the token within the <i>inTok</i> (starting
- * at the offset).
- * @return The output token, if any.
- * @throws GSSException If this operation fails.
- */
- byte[] acceptSecContext(byte[] inTok, int offset, int len)
- throws GSSException;
-
- /**
- * <p>Called by the context acceptor upon receiving a token from the peer.
- * This call is equivalent to the byte array method. It may write an
- * output token to the outStream, which the application will need to
- * send to the peer for processing by its initSecContext method.
- * Typically, the application would do so by calling the {@link
- * OutputStream#flush()} method on an OutputStream that encapsulates the
- * connection between the two peers. The application can call {@link
- * #isEstablished()} to determine if the context establishment phase is
- * complete for this peer. A return value of <code>false</code> from
- * {@link #isEstablished()} indicates that more tokens are expected to be
- * supplied to this method.</p>
- *
- * <p>Note that it is possible that acceptSecContext() return a token for
- * the peer, and isEstablished() return <code>true</code> also. This
- * indicates that the token needs to be sent to the peer, but the local
- * end of the context is now fully established.</p>
- *
- * <p>The GSS-API authentication tokens contain a definitive start and end.
- * This method will attempt to read one of these tokens per invocation,
- * and may block on the stream if only part of the token is available.</p>
- *
- * <p>Upon completion of the context establishment, the available context
- * options may be queried through the get methods.</p>
- *
- * @param inStream Contains the token generated by the peer.
- * @param outStream Output stream where the output token will be written.
- * During the final stage of context establishment, there
- * may be no bytes written.
- * @return The number of bytes written, or 0 if no token is written.
- * @throws GSSException If this operation fails.
- */
- void acceptSecContext(InputStream inStream, OutputStream outStream)
- throws GSSException;
-
- /**
- * Used during context establishment to determine the state of the
- * context. Returns <code>true</code> if this is a fully established
- * context on the caller's side and no more tokens are needed from the
- * peer. Should be called after a call to {@link
- * #initSecContext(byte[],int,int)} or {@link
- * #acceptSecContext(byte[],int,int)} when no {@link GSSException}
- * is thrown.
- *
- * @return True of this context is fully established on this side.
- */
- boolean isEstablished();
-
- /**
- * Releases any system resources and cryptographic information stored in
- * the context object. This will invalidate the context.
- *
- * @throws GSSException If this operation fails.
- */
- void dispose() throws GSSException;
-
- /**
- * <p>Returns the maximum message size that, if presented to the
- * {@link #wrap(byte[],int,int,org.ietf.jgss.MessageProp)} method with
- * the same <i>confReq</i> and <i>qop</i> parameters, will result in an
- * output token containing no more than the <i>maxTokenSize</i> bytes.</p>
- *
- * <p>This call is intended for use by applications that communicate over
- * protocols that impose a maximum message size. It enables the
- * application to fragment messages prior to applying protection.</p>
- *
- * <p>GSS-API implementations are recommended but not required to detect
- * invalid QOP values when getWrapSizeLimit is called. This routine
- * guarantees only a maximum message size, not the availability of
- * specific QOP values for message protection.</p>
- *
- * <p>Successful completion of this call does not guarantee that wrap will
- * be able to protect a message of the computed length, since this
- * ability may depend on the availability of system resources at the
- * time that wrap is called. However, if the implementation itself
- * imposes an upper limit on the length of messages that may be
- * processed by wrap, the implementation should not return a value that
- * is greater than this length.</p>
- *
- * @param qop Indicates the level of protection wrap will be asked
- * to provide.
- * @param confReq Indicates if wrap will be asked to provide privacy
- * service.
- * @param maxTokenSize The desired maximum size of the token emitted
- * by {@link #wrap(byte[],int,int,org.ietf.jgss.MessageProp)}.
- * @return The maximum wrapped output size.
- * @throws GSSException If this operation fails.
- */
- int getWrapSizeLimit(int qop, boolean confReq, int maxTokenSize)
- throws GSSException;
-
- /**
- * <p>Applies per-message security services over the established security
- * context. The method will return a token with a cryptographic MIC and
- * may optionally encrypt the specified <i>inBuf</i>. This method is
- * equivalent in functionality to its stream counterpart. The returned
- * byte array will contain both the MIC and the message.</p>
- *
- * <p>The {@link MessageProp} object is instantiated by the application
- * and used to specify a QOP value which selects cryptographic algorithms,
- * and a privacy service to optionally encrypt the message. The underlying
- * mechanism that is used in the call may not be able to provide the
- * privacy service. It sets the actual privacy service that it does
- * provide in this {@link MessageProp} object which the caller should then
- * query upon return. If the mechanism is not able to provide the
- * requested QOP, it throws a {@link GSSException} with the {@link
- * GSSException#BAD_QOP} code.</p>
- *
- * <p>Since some application-level protocols may wish to use tokens emitted
- * by wrap to provide "secure framing", implementations should support
- * the wrapping of zero-length messages.</p>
- *
- * <p>The application will be responsible for sending the token to the
- * peer.</p>
- *
- * @param inBuf Application data to be protected.
- * @param offset The offset within the inBuf where the data begins.
- * @param len The length of the data within the inBuf (starting at
- * the offset).
- * @param msgProp Instance of {@link MessageProp} that is used by the
- * application to set the desired QOP and privacy state.
- * Set the desired QOP to 0 to request the default QOP.
- * Upon return from this method, this object will contain
- * the the actual privacy state that was applied to the
- * message by the underlying mechanism.
- * @return The wrapped data.
- * @throws GSSException If this operation fails.
- */
- byte[] wrap(byte[] inBuf, int offset, int len, MessageProp msgProp)
- throws GSSException;
-
- /**
- * <p>Allows to apply per-message security services over the established
- * security context. The method will produce a token with a
- * cryptographic MIC and may optionally encrypt the message in inStream.
- * The outStream will contain both the MIC and the message.</p>
- *
- * <p>The {@link MessageProp} object is instantiated by the application and
- * used to specify a QOP value which selects cryptographic algorithms, and
- * a privacy service to optionally encrypt the message. The underlying
- * mechanism that is used in the call may not be able to provide the
- * privacy service. It sets the actual privacy service that it does
- * provide in this MessageProp object which the caller should then query
- * upon return. If the mechanism is not able to provide the requested
- * QOP, it throws a {@link GSSException} with the {@link
- * GSSException#BAD_QOP} code.</p>
- *
- * <p>Since some application-level protocols may wish to use tokens emitted
- * by wrap to provide "secure framing", implementations should support
- * the wrapping of zero-length messages.</p>
- *
- * <p>The application will be responsible for sending the token to the
- * peer.</p>
- *
- * @param inStream Input stream containing the application data to be
- * protected.
- * @param outStream The output stream to write the protected message to.
- * The application is responsible for sending this to the
- * other peer for processing in its unwrap method.
- * @param msgProp Instance of {@link MessageProp} that is used by the
- * application to set the desired QOP and privacy state.
- * Set the desired QOP to 0 to request the default QOP.
- * Upon return from this method, this object will contain
- * the the actual privacy state that was applied to the
- * message by the underlying mechanism.
- * @throws GSSException If this operation fails.
- */
- void wrap(InputStream inStream, OutputStream outStream, MessageProp msgProp)
- throws GSSException;
-
- /**
- * <p>Used by the peer application to process tokens generated with the
- * wrap call. This call is equal in functionality to its stream
- * counterpart. The method will return the message supplied in the peer
- * application to the wrap call, verifying the embedded MIC.</p>
- *
- * <p>The {@link MessageProp} object is instantiated by the application and
- * is used by the underlying mechanism to return information to the caller
- * such as the QOP, whether confidentiality was applied to the message, and
- * other supplementary message state information.</p>
- *
- * <p>Since some application-level protocols may wish to use tokens emitted
- * by wrap to provide "secure framing", implementations should support
- * the wrapping and unwrapping of zero-length messages.</p>
- *
- * @param inBuf GSS-API wrap token received from peer.
- * @param offset The offset within the inBuf where the token begins.
- * @param len The length of the token within the inBuf (starting at
- * the offset).
- * @param msgProp Upon return from the method, this object will contain
- * the applied QOP, the privacy state of the message, and
- * supplementary information stating whether the token was
- * a duplicate, old, out of sequence or arriving after a gap.
- * @return The unwrapped token.
- * @throws GSSException If this operation fails.
- */
- byte[] unwrap(byte[] inBuf, int offset, int len, MessageProp msgProp)
- throws GSSException;
-
- /**
- * <p>Used by the peer application to process tokens generated with the
- * wrap call. This call is equal in functionality to its byte array
- * counterpart. It will produce the message supplied in the peer
- * application to the wrap call, verifying the embedded MIC.</p>
- *
- * <p>The {@link MessageProp} object is instantiated by the application
- * and is used by the underlying mechanism to return information to the
- * caller such as the QOP, whether confidentiality was applied to the
- * message, and other supplementary message state information.</p>
- *
- * <p>Since some application-level protocols may wish to use tokens emitted
- * by wrap to provide "secure framing", implementations should support
- * the wrapping and unwrapping of zero-length messages.</p>
- *
- * @param inStream Input stream containing the GSS-API wrap token
- * received from the peer.
- * @param outStream The output stream to write the application message to.
- * @param msgProp Upon return from the method, this object will contain
- * the applied QOP, the privacy state of the message, and
- * supplementary information stating whether the token was
- * a duplicate, old, out of sequence or arriving after a gap.
- * @throws GSSException If this operation fails.
- */
- void unwrap(InputStream inStream, OutputStream outStream, MessageProp msgProp)
- throws GSSException;
-
- /**
- * <p>Returns a token containing a cryptographic MIC for the supplied
- * message, for transfer to the peer application. Unlike wrap, which
- * encapsulates the user message in the returned token, only the message
- * MIC is returned in the output token. This method is identical in
- * functionality to its stream counterpart.</p>
- *
- * <p>Note that privacy can only be applied through the wrap call.</p>
- *
- * <p>Since some application-level protocols may wish to use tokens emitted
- * by getMIC to provide "secure framing", implementations should support
- * derivation of MICs from zero-length messages.</p>
- *
- * @param inMsg Message to generate MIC over.
- * @param offset The offset within the inMsg where the token begins.
- * @param len The length of the token within the inMsg (starting at
- * the offset).
- * @param msgProp Instance of MessageProp that is used by the
- * application to set the desired QOP. Set the desired
- * QOP to 0 in msgProp to request the default QOP.
- * Alternatively pass in <code>null</code> for msgProp to
- * request default QOP.
- * @return The MIC.
- * @throws GSSException If this operation fails.
- */
- byte[] getMIC(byte[] inMsg, int offset, int len, MessageProp msgProp)
- throws GSSException;
-
- /**
- * <p>Produces a token containing a cryptographic MIC for the supplied
- * message, for transfer to the peer application. Unlike wrap, which
- * encapsulates the user message in the returned token, only the message
- * MIC is produced in the output token. This method is identical in
- * functionality to its byte array counterpart.</p>
- *
- * <p>Note that privacy can only be applied through the wrap call.</p>
- *
- * <p>Since some application-level protocols may wish to use tokens emitted
- * by getMIC to provide "secure framing", implementations should support
- * derivation of MICs from zero-length messages.</p>
- *
- * @param inStream Input stream containing the message to generate
- * the MIC over.
- * @param outStream Output stream to write the GSS-API output token to.
- * @param msgProp Instance of MessageProp that is used by the
- * application to set the desired QOP. Set the desired
- * QOP to 0 in msgProp to request the default QOP.
- * Alternatively pass in <code>null</code> for msgProp
- * to request default QOP.
- * @throws GSSException If this operation fails.
- */
- void getMIC(InputStream inStream, OutputStream outStream, MessageProp mgProp)
- throws GSSException;
-
- /**
- * <p>Verifies the cryptographic MIC, contained in the token parameter,
- * over the supplied message. This method is equivalent in
- * functionality to its stream counterpart.</p>
- *
- * <p>The MessageProp object is instantiated by the application and is used
- * by the underlying mechanism to return information to the caller such
- * as the QOP indicating the strength of protection that was applied to
- * the message and other supplementary message state information.</p>
- *
- * <p>Since some application-level protocols may wish to use tokens emitted
- * by getMIC to provide "secure framing", implementations should support
- * the calculation and verification of MICs over zero-length messages.</p>
- *
- * @param inTok Token generated by peer's getMIC method.
- * @param tokOffset The offset within the inTok where the token begins.
- * @param tokLen The length of the token within the inTok (starting at
- * the offset).
- * @param inMsg Application message to verify the cryptographic MIC
- * over.
- * @param msgOffset The offset within the inMsg where the message begins.
- * @param msgLen The length of the message within the inMsg (starting
- * at the offset).
- * @param msgProp Upon return from the method, this object will contain
- * the applied QOP and supplementary information
- * stating whether the token was a duplicate, old, out
- * of sequence or arriving after a gap. The
- * confidentiality state will be set to <code>false</code>.
- * @throws GSSException If this operation fails.
- */
- void verifyMIC(byte[] inTok, int tokOffset, int tokLen, byte[] inMsg,
- int msgOffset, int msgLen, MessageProp msgProp)
- throws GSSException;
-
- /**
- * <p>Verifies the cryptographic MIC, contained in the token parameter,
- * over the supplied message. This method is equivalent in
- * functionality to its byte array counterpart.</p>
- *
- * <p>The MessageProp object is instantiated by the application and is used
- * by the underlying mechanism to return information to the caller such
- * as the QOP indicating the strength of protection that was applied to
- * the message and other supplementary message state information.</p>
- *
- * <p>Since some application-level protocols may wish to use tokens emitted
- * by getMIC to provide "secure framing", implementations should support
- * the calculation and verification of MICs over zero-length messages.</p>
- *
- * @param tokStream Input stream containing the token generated by peer's
- * getMIC method.
- * @param msgStream Input stream containing the application message to
- * verify the cryptographic MIC over.
- * @param msgProp Upon return from the method, this object will contain
- * the applied QOP and supplementary information
- * stating whether the token was a duplicate, old, out of
- * sequence or arriving after a gap. The confidentiality
- * state will be set to <code>false</code>.
- * @throws GSSException If this operation fails.
- */
- void verifyMIC(InputStream tokStream, InputStream msgStream, MessageProp msgProp)
- throws GSSException;
-
- /**
- * <p>Provided to support the sharing of work between multiple processes.
- * This routine will typically be used by the context-acceptor, in an
- * application where a single process receives incoming connection
- * requests and accepts security contexts over them, then passes the
- * established context to one or more other processes for message
- * exchange.</p>
- *
- * <p>This method deactivates the security context and creates an
- * interprocess token which, when passed to the byte array constructor
- * of the GSSContext interface in another process, will re-activate the
- * context in the second process. Only a single instantiation of a
- * given context may be active at any one time; a subsequent attempt by
- * a context exporter to access the exported security context will fail.</p>
- *
- * <p>The implementation may constrain the set of processes by which the
- * interprocess token may be imported, either as a function of local
- * security policy, or as a result of implementation decisions. For
- * example, some implementations may constrain contexts to be passed
- * only between processes that run under the same account, or which are
- * part of the same process group.</p>
- *
- * <p>The interprocess token may contain security-sensitive information
- * (for example cryptographic keys). While mechanisms are encouraged to
- * either avoid placing such sensitive information within interprocess
- * tokens, or to encrypt the token before returning it to the
- * application, in a typical GSS-API implementation this may not be
- * possible. Thus the application must take care to protect the
- * interprocess token, and ensure that any process to which the token is
- * transferred is trustworthy.</p>
- *
- * @return The exported context.
- * @throws GSSException If this operation fails.
- */
- byte[] export() throws GSSException;
-
- /**
- * <p>Sets the request state of the mutual authentication flag for the
- * context. This method is only valid before the context creation
- * process begins and only for the initiator.</p>
- *
- * @param state Boolean representing if mutual authentication should
- * be requested during context establishment.
- * @throws GSSException If this operation fails.
- */
- void requestMutualAuth(boolean state) throws GSSException;
-
- /**
- * <p>Sets the request state of the replay detection service for the
- * context. This method is only valid before the context creation
- * process begins and only for the initiator.</p>
- *
- * @param state Boolean representing if replay detection is desired
- * over the established context.
- * @throws GSSException If this operation fails.
- */
- void requestReplayDet(boolean state) throws GSSException;
-
- /**
- * <p>Sets the request state for the sequence checking service of the
- * context. This method is only valid before the context creation
- * process begins and only for the initiator.</p>
- *
- * @param state Boolean representing if sequence detection is desired
- * over the established context.
- * @throws GSSException If this operation fails.
- */
- void requestSequenceDet(boolean state) throws GSSException;
-
- /**
- * <p>Sets the request state for the credential delegation flag for the
- * context. This method is only valid before the context creation
- * process begins and only for the initiator.</p>
- *
- * @param state Boolean representing if credential delegation is
- * desired.
- * @throws GSSException If this operation fails.
- */
- void requestCredDeleg(boolean state) throws GSSException;
-
- /**
- * <p>Requests anonymous support over the context. This method is only
- * valid before the context creation process begins and only for the
- * initiator.</p>
- *
- * @param state Boolean representing if anonymity support is requested.
- * @throws GSSException If this operation fails.
- */
- void requestAnonymity(boolean state) throws GSSException;
-
- /**
- * <p>Requests that confidentiality service be available over the context.
- * This method is only valid before the context creation process begins
- * and only for the initiator.</p>
- *
- * @param state Boolean indicating if confidentiality services are to
- * be requested for the context.
- * @throws GSSException If this operation fails.
- */
- void requestConf(boolean state) throws GSSException;
-
- /**
- * <p>Requests that integrity services be available over the context. This
- * method is only valid before the context creation process begins and
- * only for the initiator.</p>
- *
- * @param state Boolean indicating if integrity services are to be
- * requested for the context.
- * @throws GSSException If this operation fails.
- */
- void requestInteg(boolean state) throws GSSException;
-
- /**
- * <p>Sets the desired lifetime for the context in seconds. This method is
- * only valid before the context creation process begins and only for
- * the initiator. Use {@link #INDEFINITE_LIFETIME} and {@link
- * #DEFAULT_LIFETIME} to request indefinite or default context lifetime.</p>
- *
- * @param lifetime The desired context lifetime in seconds.
- * @throws GSSException If this operation fails.
- */
- void requestLifetime(int lifetime) throws GSSException;
-
- /**
- * <p>Sets the channel bindings to be used during context establishment.
- * This method is only valid before the context creation process begins.</p>
- *
- * @param cb Channel bindings to be used.
- * @throws GSSException If this operation fails.
- */
- void setChannelBinding(ChannelBinding cb) throws GSSException;
-
- /**
- * <p>Returns the state of the delegated credentials for the context.
- * When issued before context establishment is completed or when the
- * isProtReady method returns "false", it returns the desired state,
- * otherwise it will indicate the actual state over the established
- * context.</p>
- *
- * @return The state of the delegated credentials for the context.
- */
- boolean getCredDelegState();
-
- /**
- * <p>Returns the state of the mutual authentication option for the
- * context. When issued before context establishment completes or when
- * the isProtReady method returns "false", it returns the desired state,
- * otherwise it will indicate the actual state over the established
- * context.</p>
- *
- * @return The state of the mutual authentication option.
- */
- boolean getMutualAuthState();
-
- /**
- * <p>Returns the state of the replay detection option for the context.
- * When issued before context establishment completes or when the
- * isProtReady method returns "false", it returns the desired state,
- * otherwise it will indicate the actual state over the established
- * context.</p>
- *
- * @return The state of the replay detection option.
- */
- boolean getReplayDetState();
-
- /**
- * <p>Returns the state of the sequence detection option for the context.
- * When issued before context establishment completes or when the
- * isProtReady method returns "false", it returns the desired state,
- * otherwise it will indicate the actual state over the established
- * context.</p>
- *
- * @return The state of the sequence detection option.
- */
- boolean getSequenceDetState();
-
- /**
- * <p>Returns "true" if this is an anonymous context. When issued before
- * context establishment completes or when the isProtReady method
- * returns "false", it returns the desired state, otherwise it will
- * indicate the actual state over the established context.</p>
- *
- * @return True if this is an anonymous context.
- */
- boolean getAnonymityState();
-
- /**
- * <p>Returns "true" if the context is transferable to other processes
- * through the use of the {@link #export()} method. This call is only
- * valid on fully established contexts.</p>
- *
- * @return True if the context is transferable.
- * @throws GSSException If this operation fails.
- */
- boolean isTransferable() throws GSSException;
-
- /**
- * <p>Returns "true" if the per message operations can be applied over
- * the context. Some mechanisms may allow the usage of per-message
- * operations before the context is fully established. This will also
- * indicate that the get methods will return actual context state
- * characteristics instead of the desired ones.</p>
- *
- * @return True if the per message operations can be applied over
- * the context.
- */
- boolean isProtReady();
-
- /**
- * <p>Returns the confidentiality service state over the context. When
- * issued before context establishment completes or when the isProtReady
- * method returns "false", it returns the desired state, otherwise it
- * will indicate the actual state over the established context.</p>
- *
- * @return True the confidentiality service state.
- */
- boolean getConfState();
-
- /**
- * <p>Returns the integrity service state over the context. When issued
- * before context establishment completes or when the isProtReady method
- * returns "false", it returns the desired state, otherwise it will
- * indicate the actual state over the established context.</p>
- *
- * @return The integrity service state.
- */
- boolean getIntegState();
-
- /**
- * <p>Returns the context lifetime in seconds. When issued before context
- * establishment completes or when the isProtReady method returns
- * "false", it returns the desired lifetime, otherwise it will indicate
- * the remaining lifetime for the context.</p>
- *
- * @return The lifetime.
- */
- int getLifetime();
-
- /**
- * <p>Returns the name of the context initiator. This call is valid only
- * after the context is fully established or the isProtReady method
- * returns "true". It is guaranteed to return an MN.</p>
- *
- * @return The name of the context initiator.
- * @throws GSSException If this operation fails.
- */
- GSSName getSrcName() throws GSSException;
-
- /**
- * <p>Returns the name of the context target (acceptor). This call is
- * valid only after the context is fully established or the isProtReady
- * method returns "true". It is guaranteed to return an MN.</p>
- *
- * @return The name of the context target.
- * @throws GSSException If this operation fails.
- */
- GSSName getTargName() throws GSSException;
-
- /**
- * <p>Returns the mechanism oid for this context. This method may be called
- * before the context is fully established, but the mechanism returned
- * may change on successive calls in negotiated mechanism case.</p>
- *
- * @return The mechanism OID.
- * @throws GSSException If this operation fails.
- */
- Oid getMech() throws GSSException;
-
- /**
- * <p>Returns the delegated credential object on the acceptor's side.
- * To check for availability of delegated credentials call
- * {@link #getDelegCredState()}. This call is only valid on fully
- * established contexts.</p>
- *
- * @return The delegated credential object.
- * @throws GSSException If this operation fails.
- */
- GSSCredential getDelegCred() throws GSSException;
-
- /**
- * <p>Returns "true" if this is the initiator of the context. This call is
- * only valid after the context creation process has started.</p>
- *
- * @return True if this is the initiator.
- * @throws GSSException If this operation fails.
- */
- boolean isInitiator() throws GSSException;
-}
diff --git a/libjava/org/ietf/jgss/GSSCredential.java b/libjava/org/ietf/jgss/GSSCredential.java
deleted file mode 100644
index fb373bd8242..00000000000
--- a/libjava/org/ietf/jgss/GSSCredential.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/* GSSCredential.java -- GSS credential interface.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-/* The documentation comments of this class are derived from the text
- of RFC 2853: Generic Security Service API Version 2: Java Bindings.
- That document is covered under the following license notice:
-
-Copyright (C) The Internet Society (2000). All Rights Reserved.
-
-This document and translations of it may be copied and furnished to
-others, and derivative works that comment on or otherwise explain it
-or assist in its implementation may be prepared, copied, published and
-distributed, in whole or in part, without restriction of any kind,
-provided that the above copyright notice and this paragraph are
-included on all such copies and derivative works. However, this
-document itself may not be modified in any way, such as by removing
-the copyright notice or references to the Internet Society or other
-Internet organizations, except as needed for the purpose of developing
-Internet standards in which case the procedures for copyrights defined
-in the Internet Standards process must be followed, or as required to
-translate it into languages other than English.
-
-The limited permissions granted above are perpetual and will not be
-revoked by the Internet Society or its successors or assigns.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
-TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
-NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
-WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. */
-
-
-package org.ietf.jgss;
-
-/**
- * <p>This interface encapsulates the GSS-API credentials for an entity.
- * A credential contains all the necessary cryptographic information to
- * enable the creation of a context on behalf of the entity that it
- * represents. It may contain multiple, distinct, mechanism specific
- * credential elements, each containing information for a specific
- * security mechanism, but all referring to the same entity.</p>
- *
- * <p>A credential may be used to perform context initiation, acceptance,
- * or both.</p>
- *
- * <p>GSS-API implementations must impose a local access-control policy on
- * callers to prevent unauthorized callers from acquiring credentials to
- * which they are not entitled. GSS-API credential creation is not
- * intended to provide a "login to the network" function, as such a
- * function would involve the creation of new credentials rather than
- * merely acquiring a handle to existing credentials. Such functions,
- * if required, should be defined in implementation-specific extensions
- * to the API.</p>
- *
- * <p>If credential acquisition is time-consuming for a mechanism, the
- * mechanism may choose to delay the actual acquisition until the
- * credential is required (e.g. by {@link GSSContext}). Such mechanism-
- * specific implementation decisions should be invisible to the calling
- * application; thus the query methods immediately following the
- * creation of a credential object must return valid credential data,
- * and may therefore incur the overhead of a deferred credential
- * acquisition.</p>
- *
- * <p>Applications will create a credential object passing the desired
- * parameters. The application can then use the query methods to obtain
- * specific information about the instantiated credential object
- * (equivalent to the gss_inquire routines). When the credential is no
- * longer needed, the application should call the dispose (equivalent to
- * gss_release_cred) method to release any resources held by the
- * credential object and to destroy any cryptographically sensitive
- * information.</p>
- *
- * <p>Classes implementing this interface also implement the {@link Cloneable}
- * interface. This indicates the the class will support the {@link
- * Cloneable#clone()} method that will allow the creation of duplicate
- * credentials. This is useful when called just before the {@link
- * #add(org.ietf.jgss.GSSName,int,int,org.ietf.jgss.Oid,int)} call to retain
- * a copy of the original credential.</p>
- *
- * <h3>Example Code</h3>
- *
- * <pre>
-GSSManager mgr = GSSManager.getInstance();
-
-// start by creating a name object for the entity
-GSSName name = mgr.createName("userName", GSSName.NT_USER_NAME);
-
-// now acquire credentials for the entity
-GSSCredential cred = mgr.createCredential(name,
- GSSCredential.ACCEPT_ONLY);
-
-// display credential information - name, remaining lifetime,
-// and the mechanisms it has been acquired over
-print(cred.getName().toString());
-print(cred.getRemainingLifetime());
-
-Oid [] mechs = cred.getMechs();
-if (mechs != null)
- {
- for (int i = 0; i < mechs.length; i++)
- print(mechs[i].toString());
- }
-
-// release system resources held by the credential
-cred.dispose();
- * </pre>
- */
-public interface GSSCredential extends Cloneable
-{
-
- // Constants.
- // -------------------------------------------------------------------------
-
- /**
- * Credential usage flag requesting that it be able to be used for both
- * context initiation and acceptance.
- */
- int INITIATE_AND_ACCEPT = 0;
-
- /**
- * Credential usage flag requesting that it be able to be used for
- * context initiation only.
- */
- int INITIATE_ONLY = 1;
-
- /**
- * Credential usage flag requesting that it be able to be used for
- * context acceptance only.
- */
- int ACCEPT_ONLY = 2;
-
- /**
- * A lifetime constant representing the default credential lifetime.
- */
- int DEFAULT_LIFETIME = 0;
-
- /**
- * A lifetime constant representing indefinite credential lifetime.
- */
- int INDEFINITE_LIFETIME = Integer.MAX_VALUE;
-
- // Methods.
- // -------------------------------------------------------------------------
-
- /**
- * Releases any sensitive information that the GSSCredential object may
- * be containing. Applications should call this method as soon as the
- * credential is no longer needed to minimize the time any sensitive
- * information is maintained.
- *
- * @throws GSSException If this operation fails.
- */
- void dispose() throws GSSException;
-
- /**
- * Retrieves the name of the entity that the credential asserts.
- *
- * @return The name.
- * @throws GSSException If this operation fails.
- */
- GSSName getName() throws GSSException;
-
- /**
- * Retrieves a mechanism name of the entity that the credential asserts.
- * Equivalent to calling {@link GSSName#canonicalize(org.ietf.jgss.Oid)}
- * on the name returned by {@link #getName()}.
- *
- * @param mechOID The mechanism for which information should be returned.
- * @return The name.
- * @throws GSSException If this operation fails.
- */
- GSSName getName(Oid mechOID) throws GSSException;
-
- /**
- * Returns the remaining lifetime in seconds for a credential. The
- * remaining lifetime is the minimum lifetime for any of the underlying
- * credential mechanisms. A return value of {@link
- * GSSCredential#INDEFINITE_LIFETIME} indicates that the credential does
- * not expire. A return value of 0 indicates that the credential is
- * already expired.
- *
- * @return The remaining lifetime.
- * @throws GSSException If this operation fails.
- */
- int getRemainingLifetime() throws GSSException;
-
- /**
- * Returns the remaining lifetime is seconds for the credential to
- * remain capable of initiating security contexts under the specified
- * mechanism. A return value of {@link GSSCredential#INDEFINITE_LIFETIME}
- * indicates that the credential does not expire for context initiation.
- * A return value of 0 indicates that the credential is already expired.
- *
- * @param mech The mechanism for which information should be returned.
- * @return The remaining lifetime.
- * @throws GSSException If this operation fails.
- */
- int getRemainingInitLifetime(Oid mech) throws GSSException;
-
- /**
- * Returns the remaining lifetime is seconds for the credential to
- * remain capable of accepting security contexts under the specified
- * mechanism. A return value of {@link GSSCredential#INDEFINITE_LIFETIME}
- * indicates that the credential does not expire for context acceptance.
- * A return value of 0 indicates that the credential is already expired.
- *
- * @param mech The mechanism for which information should be returned.
- * @return The remaining lifetime.
- * @throws GSSException If this operation fails.
- */
- int getRemainingAcceptLifetime(Oid mech) throws GSSException;
-
- /**
- * Returns the credential usage flag. The return value will be one of
- * {@link GSSCredential#INITIATE_ONLY}, {@link GSSCredential#ACCEPT_ONLY},
- * or {@link GSSCredential#INITIATE_AND_ACCEPT}.
- *
- * @return The credential usage flag.
- * @throws GSSException If this operation fails.
- */
- int getUsage() throws GSSException;
-
- /**
- * Returns the credential usage flag for the specified credential
- * mechanism. The return value will be one of
- * {@link GSSCredential#INITIATE_ONLY}, {@link GSSCredential#ACCEPT_ONLY},
- * or {@link GSSCredential#INITIATE_AND_ACCEPT}.
- *
- * @param mechOID The mechanism for which information should be returned.
- * @return The credential usage flag.
- * @throws GSSException If this operation fails.
- */
- int getUsage(Oid mechOID) throws GSSException;
-
- /**
- * Returns an array of mechanisms supported by this credential.
- *
- * @return The supported mechanism.
- * @throws GSSException If this operation fails.
- */
- Oid[] getMechs() throws GSSException;
-
- /**
- * <p>Adds a mechanism specific credential-element to an existing
- * credential. This method allows the construction of credentials one
- * mechanism at a time.</p>
- *
- * <p>This routine is envisioned to be used mainly by context acceptors
- * during the creation of acceptance credentials which are to be used
- * with a variety of clients using different security mechanisms.</p>
- *
- * <p>This routine adds the new credential element "in-place". To add the
- * element in a new credential, first call {@link Cloneable#clone()} to
- * obtain a copy of this credential, then call its <code>add()</code>
- * method.</p>
- *
- * @param aName Name of the principal for whom this credential
- * is to be acquired. Use <code>null</code> to
- * specify the default principal.
- * @param initLifetime The number of seconds that credentials should
- * remain valid for initiating of security contexts.
- * Use {@link #INDEFINITE_LIFETIME} to request that
- * the credentials have the maximum permitted lifetime.
- * Use {@link GSSCredential#DEFAULT_LIFETIME} to
- * request the default credential lifetime.
- * @param acceptLifetime The number of seconds that credentials should
- * remain valid for accepting of security contexts.
- * Use {@link GSSCredential#INDEFINITE_LIFETIME} to
- * request that the credentials have the maximum
- * permitted lifetime. Use {@link
- * GSSCredential#DEFAULT_LIFETIME} to request
- * the default credential lifetime.
- * @param mech The mechanisms over which the credential is to be
- * acquired.
- * @param usage The intended usage for this credential object. The
- * value of this parameter must be one of:
- * {@link GSSCredential#ACCEPT_AND_INITIATE},
- * {@link GSSCredential#ACCEPT_ONLY},
- * {@link GSSCredential#INITIATE_ONLY}.
- * @throws GSSException If this operation fails.
- */
- void add(GSSName aName, int initLifetime, int acceptLifetime,
- Oid mech, int usage) throws GSSException;
-
- /**
- * Tests if this GSSCredential refers to the same entity as the supplied
- * object. The two credentials must be acquired over the same
- * mechanisms and must refer to the same principal. Returns <code>true</code>
- * if the two GSSCredentials refer to the same entity; <code>false</code>
- * otherwise. (Note that the Java language specification requires that two
- * objects that are equal according to the {@link
- * Object#equals(java.lang.Object)} method must return the same integer
- * result when the {@link Object#hashCode()} method is called on them.)
- *
- * @param another Another GSSCredential object for comparison.
- * @return True if this object equals the other.
- */
- boolean equals(Object another);
-}
diff --git a/libjava/org/ietf/jgss/GSSException.java b/libjava/org/ietf/jgss/GSSException.java
deleted file mode 100644
index dbe3822cf5a..00000000000
--- a/libjava/org/ietf/jgss/GSSException.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/* GSSException.java -- a general exception in GSS.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-/* The documentation comments of this class are derived from the text
- of RFC 2853: Generic Security Service API Version 2: Java Bindings.
- That document is covered under the following license notice:
-
-Copyright (C) The Internet Society (2000). All Rights Reserved.
-
-This document and translations of it may be copied and furnished to
-others, and derivative works that comment on or otherwise explain it
-or assist in its implementation may be prepared, copied, published and
-distributed, in whole or in part, without restriction of any kind,
-provided that the above copyright notice and this paragraph are
-included on all such copies and derivative works. However, this
-document itself may not be modified in any way, such as by removing
-the copyright notice or references to the Internet Society or other
-Internet organizations, except as needed for the purpose of developing
-Internet standards in which case the procedures for copyrights defined
-in the Internet Standards process must be followed, or as required to
-translate it into languages other than English.
-
-The limited permissions granted above are perpetual and will not be
-revoked by the Internet Society or its successors or assigns.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
-TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
-NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
-WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. */
-
-
-package org.ietf.jgss;
-
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-
-/**
- * This exception is thrown whenever a fatal GSS-API error occurs
- * including mechanism specific errors. It may contain both, the major
- * and minor, GSS-API status codes. The mechanism implementers are
- * responsible for setting appropriate minor status codes when throwing
- * this exception. Aside from delivering the numeric error code(s) to
- * the caller, this class performs the mapping from their numeric values
- * to textual representations. All Java GSS-API methods are declared
- * throwing this exception.
- */
-public class GSSException extends Exception
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- // These values do not jive with the "Constant Field Values" in the J2SE
- // 1.4.1, but do follow RFC 2853. I trust the IETF, but not Sun.
-
- /**
- * Channel bindings mismatch error.
- */
- public static final int BAD_BINDINGS = 4;
-
- /**
- * Unsupported mechanism requested error.
- */
- public static final int BAD_MECH = 1;
-
- /**
- * Invalid name provided error.
- */
- public static final int BAD_NAME = 2;
-
- /**
- * Name of unsupported type provided error.
- */
- public static final int BAD_NAMETYPE = 3;
-
- /**
- * Invalid status code error - this is the default status value.
- */
- public static final int BAD_STATUS = 5;
-
- /**
- * Token had invalid integrity check error.
- */
- public static final int BAD_MIC = 6;
-
- /**
- * Specified security context expired error.
- */
- public static final int CONTEXT_EXPIRED = 12;
-
- /**
- * Expired credentials detected error.
- */
- public static final int CREDENTIALS_EXPIRED = 11;
-
- /**
- * Defective credential error.
- */
- public static final int DEFECTIVE_CREDENTIAL = 10;
-
- /**
- * Defective token error.
- */
- public static final int DEFECTIVE_TOKEN = 9;
-
- /**
- * General failure, unspecified at GSS-API level.
- */
- public static final int FAILURE = 13;
-
- /**
- * Invalid security context error.
- */
- public static final int NO_CONTEXT = 8;
-
- /**
- * Invalid credentials error.
- */
- public static final int NO_CRED = 7;
-
- /**
- * Unsupported QOP value error.
- */
- public static final int BAD_QOP = 14;
-
- /**
- * Operation unauthorized error.
- */
- public static final int UNAUTHORIZED = 15;
-
- /**
- * Operation unavailable error.
- */
- public static final int UNAVAILABLE = 16;
-
- /**
- * Duplicate credential element requested error.
- */
- public static final int DUPLICATE_ELEMENT = 17;
-
- /**
- * Name contains multi-mechanism elements error.
- */
- public static final int NAME_NOT_MN = 18;
-
- /**
- * The token was a duplicate of an earlier token. This is a fatal error
- * code that may occur during context establishment. It is not used to
- * indicate supplementary status values. The MessageProp object is used
- * for that purpose.
- */
- public static final int DUPLICATE_TOKEN = 20;
-
- /**
- * The token's validity period has expired. This is a fatal error code
- * that may occur during context establishment. It is not used to
- * indicate supplementary status values. The MessageProp object is used
- * for that purpose.
- */
- public static final int OLD_TOKEN = 19;
-
- /**
- * A later token has already been processed. This is a fatal error code
- * that may occur during context establishment. It is not used to
- * indicate supplementary status values. The MessageProp object is used
- * for that purpose.
- */
- public static final int UNSEQ_TOKEN = 21;
-
- /**
- * An expected per-message token was not received. This is a fatal
- * error code that may occur during context establishment. It is not
- * used to indicate supplementary status values. The MessageProp object
- * is used for that purpose.
- */
- public static final int GAP_TOKEN = 22;
-
- private final int major;
- private int minor;
- private String minorString;
-
- private ResourceBundle messages;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- /**
- * Create a new GSS exception with the given major code.
- *
- * @param major The major GSS error code.
- */
- public GSSException(int major)
- {
- this(major, 0, null);
- }
-
- /**
- * Create a new GSS exception with the given major and minor codes, and a
- * minor explanation string.
- *
- * @param major The major GSS error code.
- * @param minor The minor application-specific error code.
- * @param minorString An explanation of the minor error code.
- */
- public GSSException(int major, int minor, String minorString)
- {
- this.major = major;
- this.minor = minor;
- this.minorString = minorString;
- try
- {
- messages = PropertyResourceBundle.getBundle("org/ietf/jgss/MessagesBundle");
- }
- catch (Exception e)
- {
- messages = null;
- }
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- /**
- * Returns the major code representing the GSS error code that caused
- * this exception to be thrown.
- *
- * @return The major error code.
- */
- public int getMajor()
- {
- return major;
- }
-
- /**
- * Returns the mechanism error code that caused this exception. The
- * minor code is set by the underlying mechanism. Value of 0 indicates
- * that mechanism error code is not set.
- *
- * @return The minor error code, or 0 if not set.
- */
- public int getMinor()
- {
- return minor;
- }
-
- /**
- * Returns a string explaining the GSS major error code causing this
- * exception to be thrown.
- *
- * @return The major error string.
- */
- public String getMajorString()
- {
- switch (major)
- {
- case BAD_MECH:
- return getMsg("GSSException.BAD_MECH",
- "An unsupported mechanism was requested.");
- case BAD_NAME:
- return getMsg("GSSException.BAD_NAME",
- "An invalid name was supplied.");
- case BAD_NAMETYPE:
- return getMsg("GSSException.BAD_NAMETYPE",
- "A supplied name was of an unsupported type.");
- case BAD_BINDINGS:
- return getMsg("GSSException.BAD_BINDINGS",
- "Incorrect channel bindings were supplied.");
- case BAD_STATUS:
- return getMsg("GSSException.BAD_STATUS",
- "An invalid status code was supplied.");
- case BAD_MIC:
- return getMsg("GSSException.BAD_MIC",
- "A token had an invalid MIC.");
- case NO_CRED:
- return getMsg("GSSException.NO_CRED",
- "No credentials were supplied, or the credentials were "+
- "unavailable or inaccessible.");
- case NO_CONTEXT:
- return getMsg("GSSException.NO_CONTEXT",
- "Invalid context has been supplied.");
- case DEFECTIVE_TOKEN:
- return getMsg("GSSException.DEFECTIVE_TOKEN",
- "A supplied token was invalid.");
- case DEFECTIVE_CREDENTIAL:
- return getMsg("GSSException.DEFECTIVE_CREDENTIAL",
- "A supplied credential was invalid.");
- case CREDENTIALS_EXPIRED:
- return getMsg("GSSException.CREDENTIALS_EXPIRED",
- "The referenced credentials have expired.");
- case CONTEXT_EXPIRED:
- return getMsg("GSSException.CONTEXT_EXPIRED",
- "The context has expired.");
- case FAILURE:
- return getMsg("GSSException.FAILURE",
- "Miscellaneous failure.");
- case BAD_QOP:
- return getMsg("GSSException.BAD_QOP",
- "The quality-of-protection requested could not be provided.");
- case UNAUTHORIZED:
- return getMsg("GSSException.UNAUTHORIZED",
- "The operation is forbidden by local security policy.");
- case UNAVAILABLE:
- return getMsg("GSSException.UNAVAILABLE",
- "The operation or option is unavailable.");
- case DUPLICATE_ELEMENT:
- return getMsg("GSSException.DUPLICATE_ELEMENT",
- "The requested credential element already exists.");
- case NAME_NOT_MN:
- return getMsg("GSSException.NAME_NOT_MN",
- "The provided name was not a mechanism name.");
- case OLD_TOKEN:
- return getMsg("GSSException.OLD_TOKEN",
- "The token's validity period has expired.");
- case DUPLICATE_TOKEN:
- return getMsg("GSSException.DUPLICATE_TOKEN",
- "The token was a duplicate of an earlier version.");
- case UNSEQ_TOKEN:
- return getMsg("GSSException.UNSEQ_TOKEN",
- "A later token has already been processed.");
- case GAP_TOKEN:
- return getMsg("GSSException.GAP_TOKEN",
- "An expected per-message token was not received.");
- default: return "Unknown or invalid error code.";
- }
- }
-
- /**
- * Returns a string explaining the mechanism specific error code.
- * <code>null</code> will be returned when no mechanism error code has
- * been set.
- *
- * @return The minor error string, or <code>null</code>.
- */
- public String getMinorString()
- {
- return minorString;
- }
-
- /**
- * Used internally by the GSS-API implementation and the underlying
- * mechanisms to set the minor code and its textual representation.
- *
- * @param minorCode The mechanism specific error code.
- * @param message A textual explanation of the mechanism error code.
- */
- public void setMinor(int minorCode, String message)
- {
- this.minor = minorCode;
- this.minorString = message;
- }
-
- /**
- * Returns a textual representation of both the major and minor status
- * codes.
- *
- * @return The textual representation.
- */
- public String toString()
- {
- return GSSException.class.getName() + ": " + getMessage();
- }
-
- /**
- * Returns a detailed message of this exception. Overrides {@link
- * Throwable#getMessage()}. It is customary in Java to use this method to
- * obtain exception information.
- *
- * @return The detail message.
- */
- public String getMessage()
- {
- if (minor == 0)
- return getMajorString();
- else
- return getMajorString() + " (" + minorString + ")";
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private String getMsg(String key, String defaultText)
- {
- if (messages != null)
- {
- try
- {
- return messages.getString(key);
- }
- catch (Exception e)
- {
- }
- }
- return defaultText;
- }
-}
diff --git a/libjava/org/ietf/jgss/GSSManager.java b/libjava/org/ietf/jgss/GSSManager.java
deleted file mode 100644
index 9f591e73eed..00000000000
--- a/libjava/org/ietf/jgss/GSSManager.java
+++ /dev/null
@@ -1,501 +0,0 @@
-/* GSSManager.java -- manager class for the GSS-API.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-/* The documentation comments of this class are derived from the text
- of RFC 2853: Generic Security Service API Version 2: Java Bindings.
- That document is covered under the following license notice:
-
-Copyright (C) The Internet Society (2000). All Rights Reserved.
-
-This document and translations of it may be copied and furnished to
-others, and derivative works that comment on or otherwise explain it
-or assist in its implementation may be prepared, copied, published and
-distributed, in whole or in part, without restriction of any kind,
-provided that the above copyright notice and this paragraph are
-included on all such copies and derivative works. However, this
-document itself may not be modified in any way, such as by removing
-the copyright notice or references to the Internet Society or other
-Internet organizations, except as needed for the purpose of developing
-Internet standards in which case the procedures for copyrights defined
-in the Internet Standards process must be followed, or as required to
-translate it into languages other than English.
-
-The limited permissions granted above are perpetual and will not be
-revoked by the Internet Society or its successors or assigns.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
-TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
-NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
-WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. */
-
-
-package org.ietf.jgss;
-
-import java.security.Provider;
-import java.security.Security;
-
-/**
- * <p>The GSSManager class is an abstract class that serves as a factory
- * for three GSS interfaces: {@link GSSName}, {@link GSSCredential}, and
- * {@link GSSContext}. It also provides methods for applications to determine
- * what mechanisms are available from the GSS implementation and what
- * nametypes these mechanisms support. An instance of the default GSSManager
- * subclass may be obtained through the static method {@link #getInstance()},
- * but applications are free to instantiate other subclasses of GSSManager.</p>
- *
- * <p>All but one method in this class are declared abstract. This means
- * that subclasses have to provide the complete implementation for those
- * methods. The only exception to this is the static method {@link
- * #getInstance()} which will have platform specific code to return an
- * instance of the default subclass.</p>
- *
- * <p>Platform providers of GSS are required not to add any constructors to
- * this class, private, public, or protected. This will ensure that all
- * subclasses invoke only the default constructor provided to the base
- * class by the compiler.</p>
- *
- * <p>A subclass extending the GSSManager abstract class may be implemented
- * as a modular provider based layer that utilizes some well known
- * service provider specification. The GSSManager API provides the
- * application with methods to set provider preferences on such an
- * implementation. These methods also allow the implementation to throw
- * a well-defined exception in case provider based configuration is not
- * supported. Applications that expect to be portable should be aware of
- * this and recover cleanly by catching the exception.</p>
- *
- * <p>It is envisioned that there will be three most common ways in which
- * providers will be used:</p>
- *
- * <ol>
- * <li>The application does not care about what provider is used (the
- * default case).</li>
- *
- * <li>The application wants a particular provider to be used
- * preferentially, either for a particular mechanism or all the
- * time, irrespective of mechanism.</li>
- *
- * <li>The application wants to use the locally configured providers
- * as far as possible but if support is missing for one or more
- * mechanisms then it wants to fall back on its own provider.</li>
- * </ol>
- *
- * <p>The GSSManager class has two methods that enable these modes of
- * usage: {@link #addProviderAtFront(java.security.Provider,org.ietf.jgss.Oid)}
- * and {@link #addProviderAtEnd(java.security.Provider,org.ietf.jgss.Oid)}.
- * These methods have the effect of creating an ordered list of
- * (<i>provider</i>, <i>oid</i>) pairs where each pair indicates a preference
- * of provider for a given oid.</p>
- *
- * <p>The use of these methods does not require any knowledge of whatever
- * service provider specification the GSSManager subclass follows. It is
- * hoped that these methods will serve the needs of most applications.
- * Additional methods may be added to an extended GSSManager that could
- * be part of a service provider specification that is standardized
- * later.</p>
- *
- * <h3>Example Code</h3>
- *
- * <pre>
-GSSManager mgr = GSSManager.getInstance();
-
-// What mechs are available to us?
-Oid[] supportedMechs = mgr.getMechs();
-
-// Set a preference for the provider to be used when support is needed
-// for the mechanisms "1.2.840.113554.1.2.2" and "1.3.6.1.5.5.1.1".
-
-Oid krb = new Oid("1.2.840.113554.1.2.2");
-Oid spkm1 = new Oid("1.3.6.1.5.5.1.1");
-
-Provider p = (Provider) (new com.foo.security.Provider());
-
-mgr.addProviderAtFront(p, krb);
-mgr.addProviderAtFront(p, spkm1);
-
-// What name types does this spkm implementation support?
-Oid[] nameTypes = mgr.getNamesForMech(spkm1);
-</pre>
- */
-public abstract class GSSManager
-{
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public GSSManager()
- {
- }
-
- // Class method.
- // -------------------------------------------------------------------------
-
- /**
- * Returns the default GSSManager implementation.
- *
- * @return The default GSSManager implementation.
- */
- public static synchronized GSSManager getInstance()
- {
- String impl = Security.getProperty("org.ietf.jgss.GSSManager");
- if (impl == null)
- impl = "gnu.crypto.gssapi.GSSManagerImpl";
- try
- {
- ClassLoader loader = GSSManager.class.getClassLoader();
- if (loader == null)
- loader = ClassLoader.getSystemClassLoader();
- Class c = loader.loadClass(impl);
- return (GSSManager) c.newInstance();
- }
- catch (Exception x)
- {
- throw new RuntimeException(x.toString());
- }
- }
-
- // Abstract methods.
- // -------------------------------------------------------------------------
-
- /**
- * <p>This method is used to indicate to the GSSManager that the
- * application would like a particular provider to be used if no other
- * provider can be found that supports the given mechanism. When a value
- * of null is used instead of an Oid for the mechanism, the GSSManager
- * must use the indicated provider for any mechanism.</p>
- *
- * <p>Calling this method repeatedly preserves the older settings but
- * raises them above newer ones in preference thus forming an ordered
- * list of providers and Oid pairs that grows at the bottom. Thus the
- * older provider settings will be utilized first before this one is.</p>
- *
- * <p>If there are any previously existing preferences that conflict with
- * the preference being set here, then the GSSManager should ignore this
- * request.</p>
- *
- * <p>If the GSSManager implementation does not support an SPI with a
- * pluggable provider architecture it should throw a GSSException with
- * the status code {@link GSSException#UNAVAILABLE} to indicate that the
- * operation is unavailable.</p>
- *
- * @param p The provider instance that should be used whenever
- * support is needed for <i>mech</i>.
- * @param mech The mechanism for which the provider is being set.
- * @throws GSSException If this service is unavailable.
- */
- public abstract void addProviderAtEnd(Provider p, Oid mech)
- throws GSSException;
-
- /**
- * <p>This method is used to indicate to the GSSManager that the
- * application would like a particular provider to be used ahead of all
- * others when support is desired for the given mechanism. When a value
- * of null is used instead of an Oid for the mechanism, the GSSManager
- * must use the indicated provider ahead of all others no matter what
- * the mechanism is. Only when the indicated provider does not support
- * the needed mechanism should the GSSManager move on to a different
- * provider.</p>
- *
- * <p>Calling this method repeatedly preserves the older settings but
- * lowers them in preference thus forming an ordered list of provider
- * and Oid pairs that grows at the top.</p>
- *
- * <p>Calling addProviderAtFront with a null Oid will remove all previous
- * preferences that were set for this provider in the GSSManager
- * instance. Calling addProviderAtFront with a non-null Oid will remove
- * any previous preference that was set using this mechanism and this
- * provider together.</p>
- *
- * <p>If the GSSManager implementation does not support an SPI with a
- * pluggable provider architecture it should throw a GSSException with
- * the status code {@link GSSException#UNAVAILABLE} to indicate that the
- * operation is unavailable.</p>
- *
- * @param p The provider instance that should be used whenever
- * support is needed for <i>mech</i>.
- * @param mech The mechanism for which the provider is being set.
- * @throws GSSException If this service is unavailable.
- */
- public abstract void addProviderAtFront(Provider p, Oid mech)
- throws GSSException;
-
- /**
- * Factory method for creating a previously exported context. The
- * context properties will be determined from the input token and can't
- * be modified through the set methods.
- *
- * @param interProcessToken The token previously emitted from the
- * export method.
- * @return The context.
- * @throws GSSException If this operation fails.
- */
- public abstract GSSContext createContext(byte[] interProcessToken)
- throws GSSException;
-
- /**
- * Factory method for creating a context on the acceptor' side. The
- * context's properties will be determined from the input token supplied
- * to the accept method.
- *
- * @param myCred Credentials for the acceptor. Use <code>null</code> to
- * act as a default acceptor principal.
- * @return The context.
- * @throws GSSException If this operation fails.
- */
- public abstract GSSContext createContext(GSSCredential myCred)
- throws GSSException;
-
- /**
- * Factory method for creating a context on the initiator's side.
- * Context flags may be modified through the mutator methods prior to
- * calling {@link
- * GSSContext#initSecContext(java.io.InputStream,java.io.OutputStream)}.
- *
- * @param peer Name of the target peer.
- * @param mech Oid of the desired mechanism. Use <code>null</code>
- * to request default mechanism.
- * @param myCred Credentials of the initiator. Use <code>null</code>
- * default initiator principal.
- * @param lifetime The request lifetime, in seconds, for the context.
- * Use {@link GSSContext#INDEFINITE_LIFETIME} and
- * {@link GSSContext#DEFAULT_LIFETIME} to request
- * indefinite or default context lifetime.
- * @return The context.
- * @throws GSSException If this operation fails.
- */
- public abstract GSSContext createContext(GSSName peer, Oid mech,
- GSSCredential myCred, int lifetime)
- throws GSSException;
-
- /**
- * Factory method for acquiring default credentials. This will cause
- * the GSS-API to use system specific defaults for the set of
- * mechanisms, name, and a DEFAULT lifetime.
- *
- * @param usage The intended usage for this credential object. The
- * value of this parameter must be one of:
- * {@link GSSCredential#ACCEPT_AND_INITIATE},
- * {@link GSSCredential#ACCEPT_ONLY},
- * {@link GSSCredential#INITIATE_ONLY}.
- * @return The credential.
- * @throws GSSException If this operation fails.
- */
- public abstract GSSCredential createCredential(int usage) throws GSSException;
-
- /**
- * Factory method for acquiring a single mechanism credential.
- *
- * @param aName Name of the principal for whom this credential is to
- * be acquired. Use <code>null</code> to specify the
- * default principal.
- * @param lifetime The number of seconds that credentials should remain
- * valid. Use {@link GSSCredential#INDEFINITE_LIFETIME}
- * to request that the credentials have the maximum
- * permitted lifetime. Use {@link
- * GSSCredential#DEFAULT_LIFETIME} to request default
- * credential lifetime.
- * @param mech The oid of the desired mechanism. Use <code>null</code>
- * to request the default mechanism(s).
- * @param usage The intended usage for this credential object. The
- * value of this parameter must be one of:
- * {@link GSSCredential#ACCEPT_AND_INITIATE},
- * {@link GSSCredential#ACCEPT_ONLY},
- * {@link GSSCredential#INITIATE_ONLY}.
- * @return The credential.
- * @throws GSSException If this operation fails.
- */
- public abstract GSSCredential createCredential(GSSName aName, int lifetime,
- Oid mech, int usage)
- throws GSSException;
-
- /**
- * Factory method for acquiring credentials over a set of mechanisms.
- * Acquires credentials for each of the mechanisms specified in the
- * array called mechs. To determine the list of mechanisms' for which
- * the acquisition of credentials succeeded, the caller should use the
- * {@link GSSCredential#getMechs()} method.
- *
- * @param aName Name of the principal for whom this credential is to
- * be acquired. Use <code>null</code> to specify the
- * default principal.
- * @param lifetime The number of seconds that credentials should remain
- * valid. Use {@link GSSCredential#INDEFINITE_LIFETIME}
- * to request that the credentials have the maximum
- * permitted lifetime. Use {@link
- * GSSCredential#DEFAULT_LIFETIME} to request default
- * credential lifetime.
- * @param mechs The array of mechanisms over which the credential is
- * to be acquired. Use <code>null</code> for requesting
- * a system specific default set of mechanisms.
- * @param usage The intended usage for this credential object. The
- * value of this parameter must be one of:
- * {@link GSSCredential#ACCEPT_AND_INITIATE},
- * {@link GSSCredential#ACCEPT_ONLY},
- * {@link GSSCredential#INITIATE_ONLY}.
- * @return The credential.
- * @throws GSSException If this operation fails.
- */
- public abstract GSSCredential createCredential(GSSName aName, int lifetime,
- Oid[] mechs, int usage)
- throws GSSException;
-
- /**
- * Factory method to convert a contiguous byte array containing a name
- * from the specified namespace to a {@link GSSName} object. In general,
- * the {@link GSSName} object created will not be an MN; two examples that
- * are exceptions to this are when the namespace type parameter indicates
- * {@link GSSName#NT_EXPORT_NAME} or when the GSS-API implementation is not
- * multi-mechanism.
- *
- * @param name The byte array containing the name to create.
- * @param nameType The Oid specifying the namespace of the name supplied
- * in the byte array. Note that nameType serves to
- * describe and qualify the interpretation of the input
- * name byte array, it does not necessarily imply a type
- * for the output GSSName implementation. "null" value
- * can be used to specify that a mechanism specific
- * default syntax should be assumed by each mechanism
- * that examines the byte array.
- * @return The name.
- * @throws GSSException If this operation fails.
- */
- public abstract GSSName createName(byte[] name, Oid nameType)
- throws GSSException;
-
- /**
- * Factory method to convert a contiguous byte array containing a name
- * from the specified namespace to a GSSName object that is an MN. In
- * other words, this method is a utility that does the equivalent of two
- * steps: {@link #createName(byte[],org.ietf.jgss.Oid)} and then also
- * {@link GSSName#canonicalize(org.ietf.jgss.Oid)}.
- *
- * @param name The byte array representing the name to create.
- * @param nameType The Oid specifying the namespace of the name supplied
- * in the byte array. Note that nameType serves to
- * describe and qualify the interpretation of the input
- * name byte array, it does not necessarily imply a type
- * for the output GSSName implementation. "null" value
- * can be used to specify that a mechanism specific
- * default syntax should be assumed by each mechanism
- * that examines the byte array.
- * @param mech Oid specifying the mechanism for which this name
- * should be created.
- * @return The name.
- * @throws GSSException If this operation fails.
- */
- public abstract GSSName createName(byte[] name, Oid nameType, Oid mech)
- throws GSSException;
-
- /**
- * Factory method to convert a contiguous string name from the specified
- * namespace to a {@link GSSName} object. In general, the {@link GSSName}
- * object created will not be an MN; two examples that are exceptions to
- * this are when the namespace type parameter indicates {@link
- * GSSName#NT_EXPORT_NAME} or when the GSS-API implementation is not
- * multi-mechanism.
- *
- * @param nameStr The string representing a printable form of the name
- * to create.
- * @param nameType The Oid specifying the namespace of the printable name
- * supplied. Note that nameType serves to describe and
- * qualify the interpretation of the input nameStr, it
- * does not necessarily imply a type for the output
- * GSSName implementation. "null" value can be used to
- * specify that a mechanism specific default printable
- * syntax should be assumed by each mechanism that
- * examines nameStr.
- * @return The name.
- * @throws GSSException If this operation fails.
- */
- public abstract GSSName createName(String nameStr, Oid nameType)
- throws GSSException;
-
- /**
- * Factory method to convert a contiguous string name from the specified
- * namespace to an GSSName object that is a mechanism name (MN). In
- * other words, this method is a utility that does the equivalent of two
- * steps: the {@link #createName(java.lang.String,org.ietf.jgss.Oid)}
- * and then also {@link GSSName#canonicalize(org.ietf.jgss.Oid)}.
- *
- * @param nameStr The string representing a printable form of the name
- * to create.
- * @param nameType The Oid specifying the namespace of the printable name
- * supplied. Note that nameType serves to describe and
- * qualify the interpretation of the input nameStr, it
- * does not necessarily imply a type for the output
- * GSSName implementation. "null" value can be used to
- * specify that a mechanism specific default printable
- * syntax should be assumed when the mechanism examines
- * nameStr.
- * @param mech Oid specifying the mechanism for which this name
- * should be created.
- * @return The name.
- * @throws GSSException If this operation fails.
- */
- public abstract GSSName createName(String nameStr, Oid nameType, Oid mech)
- throws GSSException;
-
- /**
- * Returns an array of {@link Oid} objects indicating mechanisms available
- * to GSS-API callers. A <code>null</code> value is returned when no
- * mechanism are available (an example of this would be when mechanism are
- * dynamically configured, and currently no mechanisms are installed).
- *
- * @return The array of available mechanisms, or <code>null</code>.
- */
- public abstract Oid[] getMechs();
-
- /**
- * Returns an array of {@link Oid} objects corresponding to the mechanisms
- * that support the specific name type. <code>null</code> is returned when
- * no mechanisms are found to support the specified name type.
- *
- * @param name The Oid object for the name type.
- * @return The array of mechanisms, or <code>null</code>.
- */
- public abstract Oid[] getMechsForName(Oid name);
-
- /**
- * Returns name type Oid's supported by the specified mechanism.
- *
- * @param mechanism The Oid object for the mechanism to query.
- * @return The name type Oid's supported by the mechanism.
- * @throws GSSException If this operation fails.
- */
- public abstract Oid[] getNamesForMech(Oid mechanism) throws GSSException;
-}
diff --git a/libjava/org/ietf/jgss/GSSName.java b/libjava/org/ietf/jgss/GSSName.java
deleted file mode 100644
index f0d6be131fa..00000000000
--- a/libjava/org/ietf/jgss/GSSName.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/* GSSName.java -- a name interface for GSS.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-/* The documentation comments of this class are derived from the text
- of RFC 2853: Generic Security Service API Version 2: Java Bindings.
- That document is covered under the following license notice:
-
-Copyright (C) The Internet Society (2000). All Rights Reserved.
-
-This document and translations of it may be copied and furnished to
-others, and derivative works that comment on or otherwise explain it
-or assist in its implementation may be prepared, copied, published and
-distributed, in whole or in part, without restriction of any kind,
-provided that the above copyright notice and this paragraph are
-included on all such copies and derivative works. However, this
-document itself may not be modified in any way, such as by removing
-the copyright notice or references to the Internet Society or other
-Internet organizations, except as needed for the purpose of developing
-Internet standards in which case the procedures for copyrights defined
-in the Internet Standards process must be followed, or as required to
-translate it into languages other than English.
-
-The limited permissions granted above are perpetual and will not be
-revoked by the Internet Society or its successors or assigns.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
-TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
-NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
-WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. */
-
-
-package org.ietf.jgss;
-
-/**
- * <p>This interface encapsulates a single GSS-API principal entity.
- * Different name formats and their definitions are identified with
- * universal Object Identifiers (Oids). The format of the names can be
- * derived based on the unique oid of its namespace type.</p>
- *
- * <h3>Example Code</h3>
- *
- * <pre>
-GSSManager mgr = GSSManager.getInstance();
-
-// create a host based service name
-GSSName name = mgr.createName("service@host",
- GSSName.NT_HOSTBASED_SERVICE);
-
-Oid krb5 = new Oid("1.2.840.113554.1.2.2");
-
-GSSName mechName = name.canonicalize(krb5);
-
-// the above two steps are equivalent to the following
-GSSName mechName = mgr.createName("service@host",
- GSSName.NT_HOSTBASED_SERVICE, krb5);
-
-// perform name comparison
-if (name.equals(mechName))
- print("Names are equal.");
-
-// obtain textual representation of name and its printable
-// name type
-print(mechName.toString() +
- mechName.getStringNameType().toString());
-
-// export and re-import the name
-byte [] exportName = mechName.export();
-
-// create a new name object from the exported buffer
-GSSName newName = mgr.createName(exportName,
- GSSName.NT_EXPORT_NAME);
-</pre>
- */
-public interface GSSName
-{
-
- // Constants.
- // -------------------------------------------------------------------------
-
- /**
- * <p>Name type for representing an anonymous entity. It represents the
- * following value: <code>{ 1(iso), 3(org), 6(dod), 1(internet), 5(security),
- * 6(nametypes), 3(gss-anonymous-name) }</code>.</p>
- */
- Oid NT_ANONYMOUS = new Oid(new int[] { 1, 3, 6, 1, 5, 6, 3 });
-
- /**
- * <p>Name type used to indicate an exported name produced by the export
- * method. It represents the following value: <code>{ 1(iso), 3(org), 6(dod),
- * 1(internet), 5(security), 6(nametypes), 4(gss-api-exported-name)
- * }</code>.</p>
- */
- Oid NT_EXPORT_NAME = new Oid(new int[] { 1, 3, 6, 1, 5, 6, 4 });
-
- /**
- * <p>Oid indicating a host-based service name form. It is used to
- * represent services associated with host computers. This name form is
- * constructed using two elements, "service" and "hostname", as follows:</p>
- *
- * <blockquote><code>service@hostname</code></blockquote>
- *
- * <p>Values for the "service" element are registered with the IANA. It
- * represents the following value: <code>{ 1(iso), 3(org), 6(dod),
- * 1(internet), 5(security), 6(nametypes), 2(gss-host-based-services)
- * }</code>.</p>
- */
- Oid NT_HOSTBASED_SERVICE = new Oid(new int[] { 1, 3, 6, 1, 5, 6, 2 });
-
- /**
- * <p>Name type to indicate a numeric user identifier corresponding to a
- * user on a local system. (e.g. Uid). It represents the following
- * value: <code>{ iso(1) member-body(2) United States(840) mit(113554)
- * infosys(1) gssapi(2) generic(1) machine_uid_name(2) }</code>.</p>
- */
- Oid NT_MACHINE_UID_NAME = new Oid(new int[] { 1, 2, 840, 113554, 1, 2, 1, 2 });
-
- /**
- * <p>Name type to indicate a string of digits representing the numeric
- * user identifier of a user on a local system. It represents the
- * following value: <code>{ iso(1) member-body(2) United States(840)
- * mit(113554) infosys(1) gssapi(2) generic(1) string_uid_name(3)
- * }</code>.</p>
- */
- Oid NT_STRING_UID_NAME = new Oid(new int[] { 1, 2, 840, 113554, 1, 2, 1, 3 });
-
- /**
- * <p>Name type to indicate a named user on a local system. It represents
- * the following value: <code>{ iso(1) member-body(2) United States(840)
- * mit(113554) infosys(1) gssapi(2) generic(1) user_name(1) }</code>.</p>
- */
- Oid NT_USER_NAME = new Oid(new int[] { 1, 2, 840, 113554, 1, 2, 1, 1 });
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- /**
- * Compares two GSSName objects to determine whether they refer to the
- * same entity. This method may throw a {@link GSSException} when the
- * names cannot be compared. If either of the names represents an
- * anonymous entity, the method will return <code>false</code>.
- *
- * @param another GSSName object to compare with.
- * @return True if this name equals the other, and if neither name
- * represents an anonymous entity.
- * @throws GSSException If the names cannot be compared.
- */
- boolean equals(GSSName another) throws GSSException;
-
- /**
- * A variation of the {@link #equals(org.ietf.jgss.GSSName)} method that
- * is provided to override the {@link Object#equals(java.lang.Object)}
- * method that the implementing class will inherit. The behavior is
- * exactly the same as that in the other equals method except that no
- * {@link GSSException} is thrown; instead, <code>false</code> will be
- * returned in the situation where an error occurs. (Note that the Java
- * language specification requires that two objects that are equal
- * according to the {@link Object#equals(java.lang.Object)} method must
- * return the same integer when the {@link hashCode()} method is called
- * on them.
- *
- * @param another GSSName object to compare with.
- * @return True if this name equals the other, if neither name
- * represents an anonymous entity, or if an error occurs.
- */
- boolean equals(Object another);
-
- /**
- * Creates a mechanism name (MN) from an arbitrary internal name. This
- * is equivalent to using the factory methods {@link
- * GSSManager#createName(java.lang.String,org.ietf.jgss.Oid,org.ietf.jgss.Oid)}
- * or {@link
- * GSSManager#createName(byte[],org.ietf.jgss.Oid,org.ietf.jgss.Oid)}.
- *
- * @param mech The oid for the mechanism for which the canonical form
- * of the name is requested.
- * @return The mechanism name.
- * @throws GSSException If this operation fails.
- */
- GSSName canonicalize(Oid mech) throws GSSException;
-
- /**
- * Returns a canonical contiguous byte representation of a mechanism
- * name (MN), suitable for direct, byte by byte comparison by
- * authorization functions. If the name is not an MN, implementations
- * may throw a {@link GSSException} with the {@link GSSException#NAME_NOT_MN}
- * status code. If an implementation chooses not to throw an exception,
- * it should use some system specific default mechanism to canonicalize
- * the name and then export it. The format of the header of the output
- * buffer is specified in <a
- * href="http://www.ietf.org/rfc/rfc2743.txt">RFC 2743</a>.
- *
- * @return The exported name.
- * @throws GSSException If the name is not an MN and the implementation
- * throws an exception for this case.
- */
- byte[] export() throws GSSException;
-
- /**
- * Returns a textual representation of the GSSName object. To retrieve
- * the printed name format, which determines the syntax of the returned
- * string, the {@link #getStringNameType()} method can be used.
- *
- * @return The textual representation of the GSSName object.
- */
- String toString();
-
- /**
- * Returns the oid representing the type of name returned through the
- * {@link #toString()} method. Using this oid, the syntax of the printable
- * name can be determined.
- *
- * @return The name type.
- * @throws GSSException If this operation fails.
- */
- Oid getStringNameType() throws GSSException;
-
- /**
- * Tests if this name object represents an anonymous entity. Returns
- * <code>true</code> if this is an anonymous name.
- *
- * @return True if this name represents an anonymous entity.
- */
- boolean isAnonymous();
-
- /**
- * Tests if this name object contains only one mechanism element and is
- * thus a mechanism name as defined by <a
- * href="http://www.ietf.org/rfc/rfc2743.txt">RFC 2743</a>.
- *
- * @return True if this name is a mechanism name.
- */
- boolean isMN();
-}
diff --git a/libjava/org/ietf/jgss/MessageProp.java b/libjava/org/ietf/jgss/MessageProp.java
deleted file mode 100644
index 85bef0c82bb..00000000000
--- a/libjava/org/ietf/jgss/MessageProp.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/* MessageProp.java -- GSS-API message property.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-/* The documentation comments of this class are derived from the text
- of RFC 2853: Generic Security Service API Version 2: Java Bindings.
- That document is covered under the following license notice:
-
-Copyright (C) The Internet Society (2000). All Rights Reserved.
-
-This document and translations of it may be copied and furnished to
-others, and derivative works that comment on or otherwise explain it
-or assist in its implementation may be prepared, copied, published and
-distributed, in whole or in part, without restriction of any kind,
-provided that the above copyright notice and this paragraph are
-included on all such copies and derivative works. However, this
-document itself may not be modified in any way, such as by removing
-the copyright notice or references to the Internet Society or other
-Internet organizations, except as needed for the purpose of developing
-Internet standards in which case the procedures for copyrights defined
-in the Internet Standards process must be followed, or as required to
-translate it into languages other than English.
-
-The limited permissions granted above are perpetual and will not be
-revoked by the Internet Society or its successors or assigns.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
-TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
-NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
-WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. */
-
-
-package org.ietf.jgss;
-
-/**
- * <p>This is a utility class used within the per-message {@link
- * GSSContext} methods to convey per-message properties.</p>
- *
- * <p>When used with the GSSContext interface's {@link
- * GSSContext#wrap(byte[],int,int,org.ietf.jgss.MessageProp)} and {@link
- * GSSContext#getMIC(byte[],int,int,org.ietf.jgss.MessageProp)} methods, an
- * instance of this class is used to indicate the desired QOP and to
- * request if confidentiality services are to be applied to caller
- * supplied data (wrap only). To request default QOP, the value of 0
- * should be used for QOP.</p>
- *
- * <p>When used with the {@link
- * GSSContext#unwrap(byte[],int,int,org.ietf.jgss.MessageProp)} and {@link
- * GSSContext#verifyMIC(byte[],int,int,byte[],int,int,org.ietf.jgss.MessageProp)}
- * methods of the GSSContext interface, an instance of this class will be
- * used to indicate the applied QOP and confidentiality services over the
- * supplied message. In the case of verifyMIC, the confidentiality state
- * will always be "false". Upon return from these methods, this object will
- * also contain any supplementary status values applicable to the processed
- * token. The supplementary status values can indicate old tokens, out
- * of sequence tokens, gap tokens or duplicate tokens.</p>
- */
-public class MessageProp
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private int qopVal;
- private boolean privState;
- private boolean duplicate;
- private boolean old;
- private boolean unseq;
- private boolean gap;
- private int minorStatus;
- private String minorString;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- /**
- * <p>Constructor which sets QOP to 0 indicating that the default QOP is
- * requested.</p>
- *
- * @param privState The desired privacy state. "true" for privacy and
- * "false" for integrity only.
- */
- public MessageProp(boolean privState)
- {
- this(0, privState);
- }
-
- /**
- * <p>Constructor which sets the values for the qop and privacy state.</p>
- *
- * @param qop The desired QOP. Use 0 to request a default QOP.
- * @param privState The desired privacy state. "true" for privacy and
- * "false" for integrity only.
- */
- public MessageProp(int qop, boolean privState)
- {
- this.qopVal = qop;
- this.privState = privState;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- /**
- * Retrieves the QOP value.
- *
- * @return The QOP value.
- */
- public int getQOP()
- {
- return qopVal;
- }
-
- /**
- * Retrieves the privacy state.
- *
- * @return The privacy state.
- */
- public boolean getPrivacy()
- {
- return privState;
- }
-
- /**
- * Retrieves the minor status that the underlying mechanism might have
- * set.
- *
- * @return The minor status.
- */
- public int getMinorStatus()
- {
- return minorStatus;
- }
-
- /**
- * Returns a string explaining the mechanism specific error code.
- * <code>null</code> will be returned when no mechanism error code has
- * been set.
- *
- * @return The minor status string.
- */
- public String getMinorString()
- {
- return minorString;
- }
-
- /**
- * Sets the QOP value.
- *
- * @param qopVal The QOP value to be set. Use 0 to request a default
- * QOP value.
- */
- public void setQOP(int qopVal)
- {
- this.qopVal = qopVal;
- }
-
- /**
- * Sets the privacy state.
- *
- * @param privState The privacy state to set.
- */
- public void setPrivacy(boolean privState)
- {
- this.privState = privState;
- }
-
- /**
- * Returns "true" if this is a duplicate of an earlier token.
- *
- * @return True if this is a duplicate of an earlier token.
- */
- public boolean isDuplicateToken()
- {
- return duplicate;
- }
-
- /**
- * Returns "true" if the token's validity period has expired.
- *
- * @return True if the token's validity period has expired.
- */
- public boolean isOldToken()
- {
- return old;
- }
-
- /**
- * Returns "true" if a later token has already been processed.
- *
- * @return True if a later token has already been processed.
- */
- public boolean isUnseqToken()
- {
- return unseq;
- }
-
- /**
- * Returns "true" if an expected per-message token was not received.
- *
- * @return True if an expected per-message token was not received.
- */
- public boolean isGapToken()
- {
- return gap;
- }
-
- /**
- * This method sets the state for the supplementary information flags
- * and the minor status in MessageProp. It is not used by the
- * application but by the GSS implementation to return this information
- * to the caller of a per-message context method.
- *
- * @param duplicate True if the token was a duplicate of an earlier
- * token, false otherwise.
- * @param old True if the token's validity period has expired,
- * false otherwise.
- * @param unseq True if a later token has already been processed,
- * false otherwise.
- * @param gap True if one or more predecessor tokens have not yet
- * been successfully processed, false otherwise.
- * @param minorStatus The integer minor status code that the underlying
- * mechanism wants to set.
- * @param minorString The textual representation of the minorStatus
- * value.
- */
- public void setSupplementaryStates(boolean duplicate, boolean old,
- boolean unseq, boolean gap,
- int minorStatus, String minorString)
- {
- this.duplicate = duplicate;
- this.old = old;
- this.unseq = unseq;
- this.gap = gap;
- this.minorStatus = minorStatus;
- this.minorString = minorString;
- }
-}
diff --git a/libjava/org/ietf/jgss/MessagesBundle.properties b/libjava/org/ietf/jgss/MessagesBundle.properties
deleted file mode 100644
index 2d88225ee02..00000000000
--- a/libjava/org/ietf/jgss/MessagesBundle.properties
+++ /dev/null
@@ -1,60 +0,0 @@
-# MessagesBundle.properties -- English GSS messages.
-# Copyright (C) 2004 Free Software Foundation, Inc.
-#
-# This file is a 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 of the
-# License, 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; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
-# 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.
-
-GSSException.BAD_MECH=An unsupported mechanism was requested.
-GSSException.BAD_NAME=An invalid name was supplied.
-GSSException.BAD_NAMETYPE=A supplied name was of an unsupported type.
-GSSException.BAD_BINDINGS=Incorrect channel bindings were supplied.
-GSSException.BAD_STATUS=An invalid status code was supplied.
-GSSException.BAD_MIC=A token had an invalid MIC.
-GSSException.NO_CRED=No credentials were supplied, or the credentials were unavailable or inaccessible.
-GSSException.NO_CONTEXT=Invalid context has been supplied.
-GSSException.DEFECTIVE_TOKEN=A supplied token was invalid.
-GSSException.DEFECTIVE_CREDENTIAL=A supplied credential was invalid.
-GSSException.CREDENTIALS_EXPIRED=The referenced credentials have expired.
-GSSException.CONTEXT_EXPIRED=The context has expired.
-GSSException.FAILURE=Miscellaneous failure.
-GSSException.BAD_QOP=The quality-of-protection requested could not be provided.
-GSSException.UNAUTHORIZED=The operation is forbidden by local security policy.
-GSSException.UNAVAILABLE=The operation or option is unavailable.
-GSSException.DUPLICATE_ELEMENT=The requested credential element already exists.
-GSSException.NAME_NOT_MN=The provided name was not a mechanism name.
-GSSException.OLD_TOKEN=The token\'s validity period has expired.
-GSSException.DUPLICATE_TOKEN=The token was a duplicate of an earlier version.
-GSSException.UNSEQ_TOKEN=A later token has already been processed.
-GSSException.GAP_TOKEN=An expected per-message token was not received.
-
diff --git a/libjava/org/ietf/jgss/Oid.java b/libjava/org/ietf/jgss/Oid.java
deleted file mode 100644
index 27719bb367a..00000000000
--- a/libjava/org/ietf/jgss/Oid.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/* Oid.java -- Object identifier class.
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 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. */
-
-/* The documentation comments of this class are derived from the text
- of RFC 2853: Generic Security Service API Version 2: Java Bindings.
- That document is covered under the following license notice:
-
-Copyright (C) The Internet Society (2000). All Rights Reserved.
-
-This document and translations of it may be copied and furnished to
-others, and derivative works that comment on or otherwise explain it
-or assist in its implementation may be prepared, copied, published and
-distributed, in whole or in part, without restriction of any kind,
-provided that the above copyright notice and this paragraph are
-included on all such copies and derivative works. However, this
-document itself may not be modified in any way, such as by removing
-the copyright notice or references to the Internet Society or other
-Internet organizations, except as needed for the purpose of developing
-Internet standards in which case the procedures for copyrights defined
-in the Internet Standards process must be followed, or as required to
-translate it into languages other than English.
-
-The limited permissions granted above are perpetual and will not be
-revoked by the Internet Society or its successors or assigns.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
-TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
-NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
-WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. */
-
-
-package org.ietf.jgss;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import java.math.BigInteger;
-
-import java.util.Arrays;
-import java.util.StringTokenizer;
-
-/**
- * <p>This class represents Universal Object Identifiers (Oids) and their
- * associated operations.</p>
- *
- * <p>Oids are hierarchically globally-interpretable identifiers used
- * within the GSS-API framework to identify mechanisms and name formats.</p>
- *
- * <p>The structure and encoding of Oids is defined in ISOIEC-8824 and
- * ISOIEC-8825. For example the Oid representation of Kerberos V5
- * mechanism is "1.2.840.113554.1.2.2".</p>
- *
- * <p>The {@link GSSName} name class contains <code>public static Oid</code>
- * objects representing the standard name types defined in GSS-API.</p>
- */
-public class Oid
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- private static final int OBJECT_IDENTIFIER = 0x06;
- private static final int RELATIVE_OID = 0x0d;
-
- private final int[] components;
- private byte[] derOid;
- private String strOid;
- private boolean relative;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- /**
- * Creates an Oid object from a string representation of its integer
- * components (e.g. "1.2.840.113554.1.2.2").
- *
- * @param strOid The string representation for the oid.
- * @throws GSSException If the argument is badly formed.
- */
- public Oid(String strOid) throws GSSException
- {
- if (strOid == null)
- throw new NullPointerException();
- this.strOid = strOid;
- try
- {
- StringTokenizer tok = new StringTokenizer(strOid, ".");
- components = new int[tok.countTokens()];
- int i = 0;
- while (tok.hasMoreTokens() && i < components.length)
- {
- components[i++] = Integer.parseInt(tok.nextToken());
- }
- }
- catch (Exception x)
- {
- throw new GSSException(GSSException.FAILURE);
- }
- relative = false;
- }
-
- /**
- * Creates an Oid object from its DER encoding. This refers to the full
- * encoding including tag and length. The structure and encoding of
- * Oids is defined in ISOIEC-8824 and ISOIEC-8825. This method is
- * identical in functionality to its byte array counterpart.
- *
- * @param derOid Stream containing the DER encoded oid.
- * @throws GSSException If the DER stream is badly formed, or if the
- * input stream throws an exception.
- */
- public Oid(InputStream derOid) throws GSSException
- {
- DataInputStream in = new DataInputStream(derOid);
- try
- {
- int tag = in.read() & 0x1F;
- if (tag != OBJECT_IDENTIFIER && tag != RELATIVE_OID)
- throw new IOException();
- int len = in.read();
- if ((len & ~0x7F) != 0)
- {
- byte[] buf = new byte[len & 0x7F];
- in.readFully(buf);
- len = new BigInteger(1, buf).intValue();
- }
- if (len < 0)
- throw new IOException();
- byte[] enc = new byte[len];
- in.readFully(enc);
- int[] comp = new int[len + 1];
- int count = 0;
- int i = 0;
- relative = tag == RELATIVE_OID;
- if (!relative && i < len)
- {
- int j = (enc[i] & 0xFF);
- comp[count++] = j / 40;
- comp[count++] = j % 40;
- i++;
- }
- while (i < len)
- {
- int j = 0;
- do
- {
- j = enc[i++] & 0xFF;
- comp[count] <<= 7;
- comp[count] |= j & 0x7F;
- if (i >= len && (j & 0x80) != 0)
- throw new IOException();
- }
- while ((j & 0x80) != 0);
- count++;
- }
- if (count == len)
- this.components = comp;
- else
- {
- this.components = new int[count];
- System.arraycopy(comp, 0, components, 0, count);
- }
- }
- catch (IOException ioe)
- {
- throw new GSSException(GSSException.FAILURE);
- }
- }
-
- /**
- * Creates an Oid object from its DER encoding. This refers to the full
- * encoding including tag and length. The structure and encoding of
- * Oids is defined in ISOIEC-8824 and ISOIEC-8825. This method is
- * identical in functionality to its streaming counterpart.
- *
- * @param derOid Byte array storing a DER encoded oid.
- * @throws GSSException If the DER bytes are badly formed.
- */
- public Oid(byte[] derOid) throws GSSException
- {
- this(new ByteArrayInputStream(derOid));
- this.derOid = (byte[]) derOid.clone();
- }
-
- Oid(int[] components)
- {
- this.components = components;
- relative = false;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- /**
- * Returns a string representation of the oid's integer components in
- * dot separated notation (e.g. "1.2.840.113554.1.2.2").
- *
- * @return The string representation of this oid.
- */
- public String toString()
- {
- if (strOid == null)
- {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < components.length; i++)
- {
- buf.append(components[i]);
- if (i < components.length - 1)
- buf.append('.');
- }
- strOid = buf.toString();
- }
- return strOid;
- }
-
- /**
- * Returns the full ASN.1 DER encoding for this oid object, which
- * includes the tag and length.
- *
- * @return The ASN.1 DER encoding for this oid.
- * @throws GSSException If encoding fails.
- */
- public byte[] getDER() throws GSSException
- {
- if (derOid == null)
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream(256);
- try
- {
- int i = 0;
- if (!relative)
- {
- int b = components[i++] * 40 + (components.length > 1
- ? components[i++] : 0);
- encodeSubId(out, b);
- }
- for ( ; i < components.length; i++)
- encodeSubId(out, components[i]);
- byte[] oid = out.toByteArray();
- out.reset();
- if (relative)
- out.write(RELATIVE_OID);
- else
- out.write(OBJECT_IDENTIFIER);
- if (oid.length < 128)
- out.write(oid.length);
- else if (oid.length < 256)
- {
- out.write(0x81);
- out.write(oid.length);
- }
- else if (oid.length < 65536)
- {
- out.write(0x82);
- out.write((oid.length >>> 8) & 0xFF);
- out.write(oid.length & 0xFF);
- }
- else if (oid.length < 16777216)
- {
- out.write(0x83);
- out.write((oid.length >>> 16) & 0xFF);
- out.write((oid.length >>> 8) & 0xFF);
- out.write(oid.length & 0xFF);
- }
- else
- {
- out.write(0x84);
- out.write((oid.length >>> 24) & 0xFF);
- out.write((oid.length >>> 16) & 0xFF);
- out.write((oid.length >>> 8) & 0xFF);
- out.write(oid.length & 0xFF);
- }
- out.write(oid);
- }
- catch (IOException ioe)
- {
- throw new GSSException(GSSException.FAILURE);
- }
- derOid = out.toByteArray();
- }
- return (byte[]) derOid.clone();
- }
-
- /**
- * A utility method to test if an Oid object is contained within the
- * supplied Oid object array.
- *
- * @param oids An array of oids to search.
- * @return True if this oid is contained in the given array.
- */
- public boolean containedIn(Oid[] oids)
- {
- for (int i = 0; i < oids.length; i++)
- {
- if (equals(oids[i]))
- return true;
- }
- return false;
- }
-
- public boolean equals(Object o)
- {
- if (!(o instanceof Oid))
- return false;
- Oid that = (Oid) o;
- return Arrays.equals(components, that.components);
- }
-
- public int hashCode()
- {
- int code = 0;
- for (int i = 0; i < components.length; i++)
- code += components[i];
- return code;
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private static void encodeSubId(OutputStream out, int id) throws IOException
- {
- if (id < 128)
- {
- out.write(id);
- }
- else if (id < 16384)
- {
- out.write((id >>> 7) | 0x80);
- out.write(id & 0x7F);
- }
- else if (id < 2097152)
- {
- out.write((id >>> 14) | 0x80);
- out.write(((id >>> 7) | 0x80) & 0xFF);
- out.write(id & 0x7F);
- }
- else if (id < 268435456)
- {
- out.write( (id >>> 21) | 0x80);
- out.write(((id >>> 14) | 0x80) & 0xFF);
- out.write(((id >>> 7) | 0x80) & 0xFF);
- out.write(id & 0x7F);
- }
- }
-}
diff --git a/libjava/scripts/classes.pl b/libjava/scripts/classes.pl
index 7e77c59227e..d231ea4f7ba 100644
--- a/libjava/scripts/classes.pl
+++ b/libjava/scripts/classes.pl
@@ -1,17 +1,15 @@
# classes.pl - A perl program to generate most of the contents of
# javaprims.h automatically.
-# Copyright (C) 1998, 1999, 2000, 2002 Red Hat, Inc.
+# Copyright (C) 1998, 1999, 2000, 2002, 2005 Free Software Foundation
#
-# This file is part of libjava.
+# This file is part of libgcj.
#
# This software is copyrighted work licensed under the terms of the
-# Libjava License. Please consult the file "LIBJAVA_LICENSE" for
+# Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
# details.
-# Usage: cd <top-srcdir> ; perl classes.pl.
-# Can also be run from the `include' directory; this lets us
-# more easily insert the output into javaprims.h (which is where it goes).
+# Usage: cd <build>/classpath/lib ; perl classes.pl.
use DirHandle;
@@ -62,38 +60,8 @@ sub scan
push (@subdirs, $name);
next;
}
- next unless $name =~ /\.java$/;
-
- open (FILE, "< $dir/$name");
- local ($outer, $classname);
- while (<FILE>)
- {
- s,//.*$,,;
- # NOTE: we don't skip `/*' comments. However, we do
- # skip lines with a `*' with leading whitespace. This
- # catches the most important cases.
- s,^\s*\*.*$,,;
-
- # For now assume that class names start with upper
- # case letter.
- next unless /\b(class|interface) ([A-Z][A-Za-z0-9]+)/;
- $classname = $2;
-
- # We assume the code is properly indented, so that we
- # can print inner classes properly.
- if (/^\s/)
- {
- die "no outer class for $classname in $dir/$name"
- unless $outer;
- $classes{$outer . "\$" . $classname} = 1;
- }
- else
- {
- $classes{$classname} = 1;
- $outer = $classname;
- }
- }
- close (FILE);
+ next unless $name =~ s/\.class$//;
+ $classes{$name} = 1;
}
undef $d;
diff --git a/libjava/scripts/makemake.tcl b/libjava/scripts/makemake.tcl
new file mode 100755
index 00000000000..0a87fb56ee4
--- /dev/null
+++ b/libjava/scripts/makemake.tcl
@@ -0,0 +1,357 @@
+#!/usr/bin/tclsh
+
+# Helper to enforce array-ness.
+proc makearray {name} {
+ upvar $name ary
+ set ary(_) 1
+ unset ary(_)
+}
+
+# Verbose printer.
+proc verbose {text} {
+# puts stderr $text
+}
+
+# This maps a name to its style:
+# * bc objects in this package and all its sub-packages
+# are to be compiled with the BC ABI. It is an error
+# for sub-packages to also appear in the map.
+# * package
+# objects in this package (and possibly sub-packages,
+# if they do not appear in the map) will be compiled en masse
+# from source into a single object, using the C++ ABI.
+# * ordinary
+# objects in this package (and possibly sub-packages
+# if they do not appear in the map) will be compiled one at
+# a time into separate .o files.
+# * ignore
+# objects in this package are not used. Note however that
+# most ignored files are actually handled by listing them in
+# 'standard.omit'
+#
+# If a package does not appear in the map, the default is 'package'.
+global package_map
+set package_map(.) package
+
+# These are ignored in Classpath.
+set package_map(gnu/test) ignore
+set package_map(gnu/javax/swing/plaf/gtk) ignore
+
+set package_map(gnu/xml) bc
+set package_map(javax/imageio) bc
+set package_map(javax/xml) bc
+set package_map(gnu/java/beans) bc
+set package_map(gnu/java/awt/peer/gtk) bc
+set package_map(org/xml) bc
+set package_map(org/w3c) bc
+
+# This is handled specially by the Makefile.
+# We still want it byte-compiled so it isn't in the .omit file.
+set package_map(gnu/gcj/tools/gcj_dbtool/Main.java) ignore
+
+# These are handled specially. If we list Class.java with other files
+# in java.lang, we hit a compiler bug.
+set package_map(java/lang/Class.java) ignore
+set package_map(java/lang/Object.java) ignore
+
+# More special cases. These end up in their own library.
+# Note that if we BC-compile AWT we must update these as well.
+set package_map(gnu/gcj/xlib) ignore
+set package_map(gnu/awt/xlib) ignore
+
+# Some BC ABI packages have classes which must not be compiled BC.
+# This maps such packages to a grep expression for excluding such
+# classes.
+global exclusion_map
+makearray exclusion_map
+# set exclusion_map(java/awt) AWTPermission
+
+# This maps a package name to a list of corresponding .java file base
+# names. The package name will either appear as a key in package_map,
+# or it will be '.' for the default.
+global name_map
+makearray name_map
+
+# This maps a java file base name, like 'java/lang/Object.java', to
+# the source directory in which it resides. We keep a layer of
+# indirection here so that we can override sources in Classpath with
+# our own sources.
+global dir_map
+makearray dir_map
+
+# List of all '@' files that we are going to compile.
+set package_files {}
+
+# List of all header file variables.
+set header_vars {}
+
+# List of all BC object files.
+set bc_objects {}
+
+# List of regexps for matching ignored files.
+set ignore_rx_list {}
+
+
+# Return true if a given file should be ignored.
+# The argument is the path name including the package part.
+proc ignore_file_p {file} {
+ global ignore_rx_list
+ foreach rx $ignore_rx_list {
+ if {[regexp -- $rx $file]} {
+ verbose "ignoring $file for $rx"
+ return 1
+ }
+ }
+ return 0
+}
+
+# Read a '.omit' file and update the internal data structures.
+proc read_omit_file {name} {
+ global ignore_rx_list
+ set fd [open $name r]
+ while {! [eof $fd]} {
+ set line [gets $fd]
+
+ # Classpath's entries bogusly start with "../".
+ if {[string match ../* $line]} {
+ set line [string range $line 3 end]
+ }
+
+ if {$line != ""} {
+ lappend ignore_rx_list $line
+ }
+ }
+ close $fd
+}
+
+# Classify a single source file.
+proc classify_source_file {basedir file} {
+ global package_map name_map dir_map
+
+ if {[ignore_file_p $file]} {
+ return
+ }
+
+ set seen [info exists dir_map($file)]
+ set dir_map($file) $basedir
+ set pkg $file
+ while {1} {
+ if {[info exists package_map($pkg)]} {
+ # If the entry for '.' is 'package', then set up a new entry for
+ # the file's package.
+ if {$pkg == "." && $package_map($pkg) == "package"} {
+ set pkg [file dirname $file]
+ set package_map($pkg) package
+ }
+ verbose "classify succeeded: $file -> $pkg"
+ if {! $seen} {
+ lappend name_map($pkg) $file
+ }
+ return
+ }
+ set pkg [file dirname $pkg]
+ }
+ error "can't happen"
+}
+
+# Scan a directory and its subdirectories for .java source files.
+# Note that we keep basedir and subdir separate so we can properly
+# update our global data structures.
+proc scan_directory {basedir subdir} {
+ global dir_map
+
+ set subdirs {}
+ set files {}
+ set here [pwd]
+ cd $basedir/$subdir
+ foreach file [lsort [glob *]] {
+ if {[string match *.java $file]} {
+ lappend files $subdir/$file
+ } elseif {[file isdirectory $file]} {
+ lappend subdirs $subdir/$file
+ }
+ }
+ cd $here
+
+ # Recurse first, so that we don't create new packages too eagerly.
+ foreach dir $subdirs {
+ scan_directory $basedir $dir
+ }
+
+ foreach file $files {
+ classify_source_file $basedir $file
+ }
+}
+
+# Scan known packages beneath the base directory for .java source
+# files.
+proc scan_packages {basedir} {
+ foreach subdir {gnu java javax org} {
+ if {[file exists $basedir/$subdir]} {
+ scan_directory $basedir $subdir
+ }
+ }
+}
+
+# Emit a rule for a 'bc' package.
+proc emit_bc_rule {package} {
+ global package_map exclusion_map bc_objects
+
+ if {$package == "."} {
+ set pkgname ordinary
+ } else {
+ set pkgname $package
+ }
+ set varname [join [split $pkgname /] _]_source_files
+ set loname [join [split $pkgname /] -].lo
+
+ puts "$loname: \$($varname)"
+ puts "\t\$(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o $loname \\"
+ set omit ""
+ if {[info exists exclusion_map($package)]} {
+ set omit "| grep -v $exclusion_map($package)"
+ }
+ # classpath was built first, so the class files are to be found
+ # there.
+ puts "\t\t`find classpath/lib/$package -name '*.class' | sort -r$omit`"
+ puts ""
+
+ # We skip this one because it is built into its own library and is
+ # handled specially in Makefile.am.
+ if {$loname != "gnu-java-awt-peer-gtk.lo"} {
+ lappend bc_objects $loname
+ }
+}
+
+# Emit a rule for a 'package' package.
+proc emit_package_rule {package} {
+ global package_map exclusion_map package_files
+
+ if {$package == "."} {
+ set pkgname ordinary
+ } else {
+ set pkgname $package
+ }
+ set varname [join [split $pkgname /] _]_source_files
+ set base $pkgname
+ set lname $base.list
+ set dname $base.deps
+
+ # A rule to make the phony file we are going to compile.
+ puts "$lname: \$($varname)"
+ puts "\t@for file in \$($varname); do \\"
+ puts "\t if test -f \$(srcdir)/\$\$file; then \\"
+ puts "\t echo \$(srcdir)/\$\$file; \\"
+ puts "\t else echo \$\$file; fi; \\"
+ puts "\tdone > $lname"
+ puts ""
+ puts "-include $dname"
+ puts ""
+ puts ""
+
+ lappend package_files $lname
+}
+
+# Emit a source file variable for a package, and corresponding header
+# file variable, if needed.
+proc emit_source_var {package} {
+ global package_map name_map dir_map header_vars
+
+ if {$package == "."} {
+ set pkgname ordinary
+ } else {
+ set pkgname $package
+ }
+ set uname [join [split $pkgname /] _]
+ set varname ${uname}_source_files
+ puts -nonewline "$varname ="
+
+ makearray dirs
+ foreach base [lsort $name_map($package)] {
+ # Terminate previous line.
+ puts " \\"
+ # Having files start with './' is ugly and confuses the automake
+ # "dirstamp" code; see automake PR 461.
+ set ndir $dir_map($base)/
+ if {$ndir == "./"} {
+ set ndir ""
+ }
+ puts -nonewline "${ndir}${base}"
+ set dirs($dir_map($base)) 1
+ }
+ puts ""
+ puts ""
+
+ if {$package_map($package) != "bc"} {
+ # Ugly code to build up the appropriate patsubst.
+ set result "\$(patsubst %.java,%.h,\$($varname))"
+ foreach dir [lsort [array names dirs]] {
+ set result "\$(patsubst $dir/%,%,$result)"
+ }
+
+ if {$package == "." || $package == "java/lang"} {
+ # Ugly hack.
+ set result "\$(filter-out java/lang/Object.h java/lang/Class.h,$result)"
+ }
+
+ puts "${uname}_header_files = $result"
+ lappend header_vars "${uname}_header_files"
+ puts ""
+ }
+}
+
+# Pretty-print a Makefile variable.
+proc pp_var {name valueList {pre ""} {post ""}} {
+ puts ""
+ puts -nonewline "$name ="
+ foreach val $valueList {
+ puts " \\"
+ puts -nonewline " ${pre}${val}${post}"
+ }
+ puts ""
+}
+
+# Read the proper .omit files.
+read_omit_file standard.omit
+read_omit_file classpath/lib/standard.omit
+
+# Scan classpath first.
+scan_packages classpath
+scan_packages classpath/external/sax
+scan_packages classpath/external/w3c_dom
+# Now scan our own files; this will correctly override decisions made
+# when scanning classpath.
+scan_packages .
+# Files created by the build.
+classify_source_file . java/lang/ConcreteProcess.java
+classify_source_file classpath java/util/LocaleData.java
+classify_source_file classpath gnu/classpath/Configuration.java
+
+puts "## This file was automatically generated by scripts/makemake.tcl"
+puts "## Do not edit!"
+puts ""
+
+foreach package [lsort [array names package_map]] {
+ if {$package_map($package) == "ignore"} {
+ continue
+ }
+ if {! [info exists name_map($package)]} {
+ continue
+ }
+
+ emit_source_var $package
+
+ if {$package_map($package) == "bc"} {
+ emit_bc_rule $package
+ } elseif {$package_map($package) == "ordinary"} {
+ # Nothing in particular to do here.
+ } elseif {$package_map($package) == "package"} {
+ emit_package_rule $package
+ } else {
+ error "unrecognized type: $package_map($package)"
+ }
+}
+
+pp_var all_packages_source_files $package_files
+pp_var ordinary_header_files $header_vars "\$(" ")"
+pp_var bc_objects $bc_objects
diff --git a/libjava/sources.am b/libjava/sources.am
new file mode 100644
index 00000000000..2bcf959cded
--- /dev/null
+++ b/libjava/sources.am
@@ -0,0 +1,5323 @@
+## This file was automatically generated by scripts/makemake.tcl
+## Do not edit!
+
+gnu_awt_source_files = \
+gnu/awt/LightweightRedirector.java
+
+gnu_awt_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_awt_source_files)))
+
+gnu/awt.list: $(gnu_awt_source_files)
+ @for file in $(gnu_awt_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/awt.list
+
+-include gnu/awt.deps
+
+
+gnu_awt_j2d_source_files = \
+gnu/awt/j2d/AbstractGraphicsState.java \
+gnu/awt/j2d/DirectRasterGraphics.java \
+gnu/awt/j2d/Graphics2DImpl.java \
+gnu/awt/j2d/IntegerGraphicsState.java \
+gnu/awt/j2d/MappedRaster.java
+
+gnu_awt_j2d_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_awt_j2d_source_files)))
+
+gnu/awt/j2d.list: $(gnu_awt_j2d_source_files)
+ @for file in $(gnu_awt_j2d_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/awt/j2d.list
+
+-include gnu/awt/j2d.deps
+
+
+gnu_classpath_source_files = \
+classpath/gnu/classpath/Configuration.java \
+classpath/gnu/classpath/RawData.java \
+classpath/gnu/classpath/RawData32.java \
+classpath/gnu/classpath/RawData64.java \
+classpath/gnu/classpath/ServiceFactory.java \
+classpath/gnu/classpath/ServiceProviderLoadingAction.java \
+gnu/classpath/SystemProperties.java
+
+gnu_classpath_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_classpath_source_files))))
+
+gnu/classpath.list: $(gnu_classpath_source_files)
+ @for file in $(gnu_classpath_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/classpath.list
+
+-include gnu/classpath.deps
+
+
+gnu_classpath_debug_source_files = \
+classpath/gnu/classpath/debug/Component.java \
+classpath/gnu/classpath/debug/PreciseFilter.java \
+classpath/gnu/classpath/debug/SystemLogger.java
+
+gnu_classpath_debug_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_classpath_debug_source_files)))
+
+gnu/classpath/debug.list: $(gnu_classpath_debug_source_files)
+ @for file in $(gnu_classpath_debug_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/classpath/debug.list
+
+-include gnu/classpath/debug.deps
+
+
+gnu_gcj_source_files = \
+gnu/gcj/Core.java \
+gnu/gcj/RawData.java \
+gnu/gcj/RawDataManaged.java
+
+gnu_gcj_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_gcj_source_files)))
+
+gnu/gcj.list: $(gnu_gcj_source_files)
+ @for file in $(gnu_gcj_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/gcj.list
+
+-include gnu/gcj.deps
+
+
+gnu_gcj_convert_source_files = \
+gnu/gcj/convert/BytesToUnicode.java \
+gnu/gcj/convert/Convert.java \
+gnu/gcj/convert/IOConverter.java \
+gnu/gcj/convert/Input_8859_1.java \
+gnu/gcj/convert/Input_ASCII.java \
+gnu/gcj/convert/Input_EUCJIS.java \
+gnu/gcj/convert/Input_JavaSrc.java \
+gnu/gcj/convert/Input_SJIS.java \
+gnu/gcj/convert/Input_UTF8.java \
+gnu/gcj/convert/Input_UnicodeBig.java \
+gnu/gcj/convert/Input_UnicodeLittle.java \
+gnu/gcj/convert/Input_iconv.java \
+gnu/gcj/convert/Output_8859_1.java \
+gnu/gcj/convert/Output_ASCII.java \
+gnu/gcj/convert/Output_EUCJIS.java \
+gnu/gcj/convert/Output_JavaSrc.java \
+gnu/gcj/convert/Output_SJIS.java \
+gnu/gcj/convert/Output_UTF8.java \
+gnu/gcj/convert/Output_UnicodeLittleUnmarked.java \
+gnu/gcj/convert/Output_iconv.java \
+gnu/gcj/convert/UnicodeToBytes.java
+
+gnu_gcj_convert_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_gcj_convert_source_files)))
+
+gnu/gcj/convert.list: $(gnu_gcj_convert_source_files)
+ @for file in $(gnu_gcj_convert_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/gcj/convert.list
+
+-include gnu/gcj/convert.deps
+
+
+gnu_gcj_io_source_files = \
+gnu/gcj/io/DefaultMimeTypes.java \
+gnu/gcj/io/MimeTypes.java \
+gnu/gcj/io/SimpleSHSStream.java
+
+gnu_gcj_io_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_gcj_io_source_files)))
+
+gnu/gcj/io.list: $(gnu_gcj_io_source_files)
+ @for file in $(gnu_gcj_io_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/gcj/io.list
+
+-include gnu/gcj/io.deps
+
+
+gnu_gcj_runtime_source_files = \
+gnu/gcj/runtime/BootClassLoader.java \
+gnu/gcj/runtime/ExtensionClassLoader.java \
+gnu/gcj/runtime/FileDeleter.java \
+gnu/gcj/runtime/FinalizerThread.java \
+gnu/gcj/runtime/HelperClassLoader.java \
+gnu/gcj/runtime/JNIWeakRef.java \
+gnu/gcj/runtime/NameFinder.java \
+gnu/gcj/runtime/PersistentByteMap.java \
+gnu/gcj/runtime/SharedLibHelper.java \
+gnu/gcj/runtime/SharedLibLoader.java \
+gnu/gcj/runtime/StringBuffer.java \
+gnu/gcj/runtime/SystemClassLoader.java
+
+gnu_gcj_runtime_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_gcj_runtime_source_files)))
+
+gnu/gcj/runtime.list: $(gnu_gcj_runtime_source_files)
+ @for file in $(gnu_gcj_runtime_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/gcj/runtime.list
+
+-include gnu/gcj/runtime.deps
+
+
+gnu_gcj_util_source_files = \
+gnu/gcj/util/Debug.java
+
+gnu_gcj_util_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_gcj_util_source_files)))
+
+gnu/gcj/util.list: $(gnu_gcj_util_source_files)
+ @for file in $(gnu_gcj_util_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/gcj/util.list
+
+-include gnu/gcj/util.deps
+
+
+gnu_java_awt_source_files = \
+classpath/gnu/java/awt/AWTUtilities.java \
+classpath/gnu/java/awt/BitMaskExtent.java \
+classpath/gnu/java/awt/BitwiseXORComposite.java \
+classpath/gnu/java/awt/Buffers.java \
+classpath/gnu/java/awt/ClasspathToolkit.java \
+classpath/gnu/java/awt/ComponentDataBlitOp.java \
+classpath/gnu/java/awt/EmbeddedWindow.java \
+classpath/gnu/java/awt/EventModifier.java \
+classpath/gnu/java/awt/FocusManager.java \
+classpath/gnu/java/awt/GradientPaintContext.java
+
+gnu_java_awt_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_source_files)))
+
+gnu/java/awt.list: $(gnu_java_awt_source_files)
+ @for file in $(gnu_java_awt_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/awt.list
+
+-include gnu/java/awt.deps
+
+
+gnu_java_awt_color_source_files = \
+classpath/gnu/java/awt/color/CieXyzConverter.java \
+classpath/gnu/java/awt/color/ClutProfileConverter.java \
+classpath/gnu/java/awt/color/ColorLookUpTable.java \
+classpath/gnu/java/awt/color/ColorSpaceConverter.java \
+classpath/gnu/java/awt/color/GrayProfileConverter.java \
+classpath/gnu/java/awt/color/GrayScaleConverter.java \
+classpath/gnu/java/awt/color/LinearRGBConverter.java \
+classpath/gnu/java/awt/color/ProfileHeader.java \
+classpath/gnu/java/awt/color/PyccConverter.java \
+classpath/gnu/java/awt/color/RgbProfileConverter.java \
+classpath/gnu/java/awt/color/SrgbConverter.java \
+classpath/gnu/java/awt/color/TagEntry.java \
+classpath/gnu/java/awt/color/ToneReproductionCurve.java
+
+gnu_java_awt_color_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_color_source_files)))
+
+gnu/java/awt/color.list: $(gnu_java_awt_color_source_files)
+ @for file in $(gnu_java_awt_color_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/awt/color.list
+
+-include gnu/java/awt/color.deps
+
+
+gnu_java_awt_image_source_files = \
+classpath/gnu/java/awt/image/ImageDecoder.java \
+classpath/gnu/java/awt/image/XBMDecoder.java
+
+gnu_java_awt_image_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_image_source_files)))
+
+gnu/java/awt/image.list: $(gnu_java_awt_image_source_files)
+ @for file in $(gnu_java_awt_image_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/awt/image.list
+
+-include gnu/java/awt/image.deps
+
+
+gnu_java_awt_peer_source_files = \
+classpath/gnu/java/awt/peer/ClasspathFontPeer.java \
+classpath/gnu/java/awt/peer/ClasspathTextLayoutPeer.java \
+classpath/gnu/java/awt/peer/EmbeddedWindowPeer.java \
+classpath/gnu/java/awt/peer/GLightweightPeer.java
+
+gnu_java_awt_peer_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_peer_source_files)))
+
+gnu/java/awt/peer.list: $(gnu_java_awt_peer_source_files)
+ @for file in $(gnu_java_awt_peer_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/awt/peer.list
+
+-include gnu/java/awt/peer.deps
+
+
+gnu_java_awt_peer_gtk_source_files = \
+classpath/gnu/java/awt/peer/gtk/GThreadMutex.java \
+classpath/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java \
+classpath/gnu/java/awt/peer/gtk/GdkFontMetrics.java \
+classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java \
+classpath/gnu/java/awt/peer/gtk/GdkGlyphVector.java \
+classpath/gnu/java/awt/peer/gtk/GdkGraphics.java \
+classpath/gnu/java/awt/peer/gtk/GdkGraphics2D.java \
+classpath/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java \
+classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java \
+classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java \
+classpath/gnu/java/awt/peer/gtk/GdkRobotPeer.java \
+classpath/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java \
+classpath/gnu/java/awt/peer/gtk/GdkTextLayout.java \
+classpath/gnu/java/awt/peer/gtk/GtkButtonPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkCanvasPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkClipboard.java \
+classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkContainerPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkDialogPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkFontPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkGenericPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkImage.java \
+classpath/gnu/java/awt/peer/gtk/GtkImageConsumer.java \
+classpath/gnu/java/awt/peer/gtk/GtkLabelPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkListPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkMenuPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkPanelPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java \
+classpath/gnu/java/awt/peer/gtk/GtkToolkit.java \
+classpath/gnu/java/awt/peer/gtk/GtkVolatileImage.java \
+classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java
+
+gnu-java-awt-peer-gtk.lo: $(gnu_java_awt_peer_gtk_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o gnu-java-awt-peer-gtk.lo \
+ `find classpath/lib/gnu/java/awt/peer/gtk -name '*.class' | sort -r`
+
+gnu_java_beans_source_files = \
+classpath/gnu/java/beans/BeanInfoEmbryo.java \
+classpath/gnu/java/beans/DummyAppletContext.java \
+classpath/gnu/java/beans/DummyAppletStub.java \
+classpath/gnu/java/beans/ExplicitBeanInfo.java \
+classpath/gnu/java/beans/IntrospectionIncubator.java \
+classpath/gnu/java/beans/decoder/AbstractContext.java \
+classpath/gnu/java/beans/decoder/AbstractCreatableObjectContext.java \
+classpath/gnu/java/beans/decoder/AbstractElementHandler.java \
+classpath/gnu/java/beans/decoder/AbstractObjectContext.java \
+classpath/gnu/java/beans/decoder/ArrayContext.java \
+classpath/gnu/java/beans/decoder/ArrayHandler.java \
+classpath/gnu/java/beans/decoder/AssemblyException.java \
+classpath/gnu/java/beans/decoder/BooleanHandler.java \
+classpath/gnu/java/beans/decoder/ByteHandler.java \
+classpath/gnu/java/beans/decoder/CharHandler.java \
+classpath/gnu/java/beans/decoder/ClassHandler.java \
+classpath/gnu/java/beans/decoder/ConstructorContext.java \
+classpath/gnu/java/beans/decoder/Context.java \
+classpath/gnu/java/beans/decoder/DecoderContext.java \
+classpath/gnu/java/beans/decoder/DefaultExceptionListener.java \
+classpath/gnu/java/beans/decoder/DoubleHandler.java \
+classpath/gnu/java/beans/decoder/DummyContext.java \
+classpath/gnu/java/beans/decoder/DummyHandler.java \
+classpath/gnu/java/beans/decoder/ElementHandler.java \
+classpath/gnu/java/beans/decoder/FloatHandler.java \
+classpath/gnu/java/beans/decoder/GrowableArrayContext.java \
+classpath/gnu/java/beans/decoder/IndexContext.java \
+classpath/gnu/java/beans/decoder/IntHandler.java \
+classpath/gnu/java/beans/decoder/JavaHandler.java \
+classpath/gnu/java/beans/decoder/LongHandler.java \
+classpath/gnu/java/beans/decoder/MethodContext.java \
+classpath/gnu/java/beans/decoder/MethodFinder.java \
+classpath/gnu/java/beans/decoder/NullHandler.java \
+classpath/gnu/java/beans/decoder/ObjectContext.java \
+classpath/gnu/java/beans/decoder/ObjectHandler.java \
+classpath/gnu/java/beans/decoder/PersistenceParser.java \
+classpath/gnu/java/beans/decoder/PropertyContext.java \
+classpath/gnu/java/beans/decoder/ShortHandler.java \
+classpath/gnu/java/beans/decoder/SimpleHandler.java \
+classpath/gnu/java/beans/decoder/StaticMethodContext.java \
+classpath/gnu/java/beans/decoder/StringHandler.java \
+classpath/gnu/java/beans/decoder/VoidHandler.java \
+classpath/gnu/java/beans/editors/ColorEditor.java \
+classpath/gnu/java/beans/editors/FontEditor.java \
+classpath/gnu/java/beans/editors/NativeBooleanEditor.java \
+classpath/gnu/java/beans/editors/NativeByteEditor.java \
+classpath/gnu/java/beans/editors/NativeDoubleEditor.java \
+classpath/gnu/java/beans/editors/NativeFloatEditor.java \
+classpath/gnu/java/beans/editors/NativeIntEditor.java \
+classpath/gnu/java/beans/editors/NativeLongEditor.java \
+classpath/gnu/java/beans/editors/NativeShortEditor.java \
+classpath/gnu/java/beans/editors/StringEditor.java
+
+gnu-java-beans.lo: $(gnu_java_beans_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o gnu-java-beans.lo \
+ `find classpath/lib/gnu/java/beans -name '*.class' | sort -r`
+
+gnu_java_io_source_files = \
+classpath/gnu/java/io/ASN1ParsingException.java \
+classpath/gnu/java/io/Base64InputStream.java \
+classpath/gnu/java/io/ClassLoaderObjectInputStream.java \
+classpath/gnu/java/io/NullOutputStream.java \
+classpath/gnu/java/io/ObjectIdentityWrapper.java \
+classpath/gnu/java/io/PlatformHelper.java
+
+gnu_java_io_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_io_source_files)))
+
+gnu/java/io.list: $(gnu_java_io_source_files)
+ @for file in $(gnu_java_io_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/io.list
+
+-include gnu/java/io.deps
+
+
+gnu_java_lang_source_files = \
+classpath/gnu/java/lang/ArrayHelper.java \
+classpath/gnu/java/lang/CharData.java \
+classpath/gnu/java/lang/ClassHelper.java \
+gnu/java/lang/MainThread.java
+
+gnu_java_lang_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_lang_source_files))))
+
+gnu/java/lang.list: $(gnu_java_lang_source_files)
+ @for file in $(gnu_java_lang_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/lang.list
+
+-include gnu/java/lang.deps
+
+
+gnu_java_lang_reflect_source_files = \
+classpath/gnu/java/lang/reflect/TypeSignature.java
+
+gnu_java_lang_reflect_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_lang_reflect_source_files)))
+
+gnu/java/lang/reflect.list: $(gnu_java_lang_reflect_source_files)
+ @for file in $(gnu_java_lang_reflect_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/lang/reflect.list
+
+-include gnu/java/lang/reflect.deps
+
+
+gnu_java_locale_source_files = \
+gnu/java/locale/Calendar.java \
+gnu/java/locale/Calendar_de.java \
+gnu/java/locale/Calendar_en.java \
+gnu/java/locale/Calendar_nl.java \
+classpath/gnu/java/locale/LocaleHelper.java \
+gnu/java/locale/LocaleInformation.java \
+gnu/java/locale/LocaleInformation_af_ZA.java \
+gnu/java/locale/LocaleInformation_ar_AE.java \
+gnu/java/locale/LocaleInformation_ar_BH.java \
+gnu/java/locale/LocaleInformation_ar_DZ.java \
+gnu/java/locale/LocaleInformation_ar_EG.java \
+gnu/java/locale/LocaleInformation_ar_IN.java \
+gnu/java/locale/LocaleInformation_ar_IQ.java \
+gnu/java/locale/LocaleInformation_ar_JO.java \
+gnu/java/locale/LocaleInformation_ar_KW.java \
+gnu/java/locale/LocaleInformation_ar_LB.java \
+gnu/java/locale/LocaleInformation_ar_LY.java \
+gnu/java/locale/LocaleInformation_ar_MA.java \
+gnu/java/locale/LocaleInformation_ar_OM.java \
+gnu/java/locale/LocaleInformation_ar_QA.java \
+gnu/java/locale/LocaleInformation_ar_SD.java \
+gnu/java/locale/LocaleInformation_ar_SY.java \
+gnu/java/locale/LocaleInformation_ar_TN.java \
+gnu/java/locale/LocaleInformation_ar_YE.java \
+gnu/java/locale/LocaleInformation_be_BY.java \
+gnu/java/locale/LocaleInformation_bn_IN.java \
+gnu/java/locale/LocaleInformation_br_FR.java \
+gnu/java/locale/LocaleInformation_bs_BA.java \
+gnu/java/locale/LocaleInformation_ca_ES.java \
+gnu/java/locale/LocaleInformation_cs_CZ.java \
+gnu/java/locale/LocaleInformation_cy_GB.java \
+gnu/java/locale/LocaleInformation_da_DK.java \
+gnu/java/locale/LocaleInformation_de.java \
+gnu/java/locale/LocaleInformation_de_AT.java \
+gnu/java/locale/LocaleInformation_de_BE.java \
+gnu/java/locale/LocaleInformation_de_CH.java \
+gnu/java/locale/LocaleInformation_de_DE.java \
+gnu/java/locale/LocaleInformation_de_LU.java \
+gnu/java/locale/LocaleInformation_el_GR.java \
+gnu/java/locale/LocaleInformation_en.java \
+gnu/java/locale/LocaleInformation_en_AU.java \
+gnu/java/locale/LocaleInformation_en_BW.java \
+gnu/java/locale/LocaleInformation_en_CA.java \
+gnu/java/locale/LocaleInformation_en_DK.java \
+gnu/java/locale/LocaleInformation_en_GB.java \
+gnu/java/locale/LocaleInformation_en_HK.java \
+gnu/java/locale/LocaleInformation_en_IE.java \
+gnu/java/locale/LocaleInformation_en_IN.java \
+gnu/java/locale/LocaleInformation_en_NZ.java \
+gnu/java/locale/LocaleInformation_en_PH.java \
+gnu/java/locale/LocaleInformation_en_SG.java \
+gnu/java/locale/LocaleInformation_en_US.java \
+gnu/java/locale/LocaleInformation_en_ZA.java \
+gnu/java/locale/LocaleInformation_en_ZW.java \
+gnu/java/locale/LocaleInformation_es_AR.java \
+gnu/java/locale/LocaleInformation_es_BO.java \
+gnu/java/locale/LocaleInformation_es_CL.java \
+gnu/java/locale/LocaleInformation_es_CO.java \
+gnu/java/locale/LocaleInformation_es_CR.java \
+gnu/java/locale/LocaleInformation_es_DO.java \
+gnu/java/locale/LocaleInformation_es_EC.java \
+gnu/java/locale/LocaleInformation_es_ES.java \
+gnu/java/locale/LocaleInformation_es_GT.java \
+gnu/java/locale/LocaleInformation_es_HN.java \
+gnu/java/locale/LocaleInformation_es_MX.java \
+gnu/java/locale/LocaleInformation_es_NI.java \
+gnu/java/locale/LocaleInformation_es_PA.java \
+gnu/java/locale/LocaleInformation_es_PE.java \
+gnu/java/locale/LocaleInformation_es_PR.java \
+gnu/java/locale/LocaleInformation_es_PY.java \
+gnu/java/locale/LocaleInformation_es_SV.java \
+gnu/java/locale/LocaleInformation_es_US.java \
+gnu/java/locale/LocaleInformation_es_UY.java \
+gnu/java/locale/LocaleInformation_es_VE.java \
+gnu/java/locale/LocaleInformation_et_EE.java \
+gnu/java/locale/LocaleInformation_eu_ES.java \
+gnu/java/locale/LocaleInformation_fa_IR.java \
+gnu/java/locale/LocaleInformation_fi_FI.java \
+gnu/java/locale/LocaleInformation_fo_FO.java \
+gnu/java/locale/LocaleInformation_fr_BE.java \
+gnu/java/locale/LocaleInformation_fr_CA.java \
+gnu/java/locale/LocaleInformation_fr_CH.java \
+gnu/java/locale/LocaleInformation_fr_FR.java \
+gnu/java/locale/LocaleInformation_fr_LU.java \
+gnu/java/locale/LocaleInformation_ga_IE.java \
+gnu/java/locale/LocaleInformation_gd_GB.java \
+gnu/java/locale/LocaleInformation_gl_ES.java \
+gnu/java/locale/LocaleInformation_gv_GB.java \
+gnu/java/locale/LocaleInformation_he_IL.java \
+gnu/java/locale/LocaleInformation_hi_IN.java \
+gnu/java/locale/LocaleInformation_hr_HR.java \
+gnu/java/locale/LocaleInformation_hu_HU.java \
+gnu/java/locale/LocaleInformation_id_ID.java \
+gnu/java/locale/LocaleInformation_it_CH.java \
+gnu/java/locale/LocaleInformation_it_IT.java \
+gnu/java/locale/LocaleInformation_iw_IL.java \
+gnu/java/locale/LocaleInformation_ja_JP.java \
+gnu/java/locale/LocaleInformation_ka_GE.java \
+gnu/java/locale/LocaleInformation_kl_GL.java \
+gnu/java/locale/LocaleInformation_ko_KR.java \
+gnu/java/locale/LocaleInformation_kw_GB.java \
+gnu/java/locale/LocaleInformation_lt_LT.java \
+gnu/java/locale/LocaleInformation_lv_LV.java \
+gnu/java/locale/LocaleInformation_mi_NZ.java \
+gnu/java/locale/LocaleInformation_mk_MK.java \
+gnu/java/locale/LocaleInformation_mr_IN.java \
+gnu/java/locale/LocaleInformation_mt_MT.java \
+gnu/java/locale/LocaleInformation_nl.java \
+gnu/java/locale/LocaleInformation_nl_BE.java \
+gnu/java/locale/LocaleInformation_nl_NL.java \
+gnu/java/locale/LocaleInformation_nn_NO.java \
+gnu/java/locale/LocaleInformation_no_NO.java \
+gnu/java/locale/LocaleInformation_oc_FR.java \
+gnu/java/locale/LocaleInformation_pl_PL.java \
+gnu/java/locale/LocaleInformation_pt_BR.java \
+gnu/java/locale/LocaleInformation_pt_PT.java \
+gnu/java/locale/LocaleInformation_ro_RO.java \
+gnu/java/locale/LocaleInformation_ru_RU.java \
+gnu/java/locale/LocaleInformation_ru_UA.java \
+gnu/java/locale/LocaleInformation_se_NO.java \
+gnu/java/locale/LocaleInformation_sk_SK.java \
+gnu/java/locale/LocaleInformation_sl_SI.java \
+gnu/java/locale/LocaleInformation_sq_AL.java \
+gnu/java/locale/LocaleInformation_sr_YU.java \
+gnu/java/locale/LocaleInformation_sv_FI.java \
+gnu/java/locale/LocaleInformation_sv_SE.java \
+gnu/java/locale/LocaleInformation_ta_IN.java \
+gnu/java/locale/LocaleInformation_te_IN.java \
+gnu/java/locale/LocaleInformation_tg_TJ.java \
+gnu/java/locale/LocaleInformation_tl_PH.java \
+gnu/java/locale/LocaleInformation_tr_TR.java \
+gnu/java/locale/LocaleInformation_uk_UA.java \
+gnu/java/locale/LocaleInformation_ur_PK.java \
+gnu/java/locale/LocaleInformation_uz_UZ.java \
+gnu/java/locale/LocaleInformation_vi_VN.java \
+gnu/java/locale/LocaleInformation_yi_US.java \
+gnu/java/locale/LocaleInformation_zh_CN.java \
+gnu/java/locale/LocaleInformation_zh_HK.java \
+gnu/java/locale/LocaleInformation_zh_SG.java \
+gnu/java/locale/LocaleInformation_zh_TW.java
+
+gnu_java_locale_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_locale_source_files))))
+
+gnu/java/locale.list: $(gnu_java_locale_source_files)
+ @for file in $(gnu_java_locale_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/locale.list
+
+-include gnu/java/locale.deps
+
+
+gnu_java_math_source_files = \
+classpath/gnu/java/math/MPN.java
+
+gnu_java_math_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_math_source_files)))
+
+gnu/java/math.list: $(gnu_java_math_source_files)
+ @for file in $(gnu_java_math_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/math.list
+
+-include gnu/java/math.deps
+
+
+gnu_java_net_source_files = \
+classpath/gnu/java/net/BASE64.java \
+classpath/gnu/java/net/CRLFInputStream.java \
+classpath/gnu/java/net/CRLFOutputStream.java \
+gnu/java/net/DefaultContentHandlerFactory.java \
+classpath/gnu/java/net/EmptyX509TrustManager.java \
+classpath/gnu/java/net/GetLocalHostAction.java \
+classpath/gnu/java/net/HeaderFieldHelper.java \
+classpath/gnu/java/net/LineInputStream.java \
+gnu/java/net/PlainDatagramSocketImpl.java \
+gnu/java/net/PlainSocketImpl.java \
+classpath/gnu/java/net/URLParseError.java \
+gnu/java/net/protocol/core/Connection.java \
+gnu/java/net/protocol/core/CoreInputStream.java \
+gnu/java/net/protocol/core/Handler.java \
+gnu/java/net/protocol/gcjlib/Connection.java \
+gnu/java/net/protocol/gcjlib/Handler.java
+
+gnu_java_net_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_net_source_files))))
+
+gnu/java/net.list: $(gnu_java_net_source_files)
+ @for file in $(gnu_java_net_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net.list
+
+-include gnu/java/net.deps
+
+
+gnu_java_net_protocol_file_source_files = \
+gnu/java/net/protocol/file/Connection.java \
+gnu/java/net/protocol/file/Handler.java
+
+gnu_java_net_protocol_file_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_file_source_files)))
+
+gnu/java/net/protocol/file.list: $(gnu_java_net_protocol_file_source_files)
+ @for file in $(gnu_java_net_protocol_file_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/file.list
+
+-include gnu/java/net/protocol/file.deps
+
+
+gnu_java_net_protocol_ftp_source_files = \
+classpath/gnu/java/net/protocol/ftp/ActiveModeDTP.java \
+classpath/gnu/java/net/protocol/ftp/BlockInputStream.java \
+classpath/gnu/java/net/protocol/ftp/BlockOutputStream.java \
+classpath/gnu/java/net/protocol/ftp/CompressedInputStream.java \
+classpath/gnu/java/net/protocol/ftp/CompressedOutputStream.java \
+classpath/gnu/java/net/protocol/ftp/DTP.java \
+classpath/gnu/java/net/protocol/ftp/DTPInputStream.java \
+classpath/gnu/java/net/protocol/ftp/DTPOutputStream.java \
+classpath/gnu/java/net/protocol/ftp/FTPConnection.java \
+classpath/gnu/java/net/protocol/ftp/FTPException.java \
+classpath/gnu/java/net/protocol/ftp/FTPResponse.java \
+classpath/gnu/java/net/protocol/ftp/FTPURLConnection.java \
+classpath/gnu/java/net/protocol/ftp/Handler.java \
+classpath/gnu/java/net/protocol/ftp/PassiveModeDTP.java \
+classpath/gnu/java/net/protocol/ftp/StreamInputStream.java \
+classpath/gnu/java/net/protocol/ftp/StreamOutputStream.java
+
+gnu_java_net_protocol_ftp_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_ftp_source_files)))
+
+gnu/java/net/protocol/ftp.list: $(gnu_java_net_protocol_ftp_source_files)
+ @for file in $(gnu_java_net_protocol_ftp_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/ftp.list
+
+-include gnu/java/net/protocol/ftp.deps
+
+
+gnu_java_net_protocol_http_source_files = \
+classpath/gnu/java/net/protocol/http/Authenticator.java \
+classpath/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java \
+classpath/gnu/java/net/protocol/http/ByteArrayResponseBodyReader.java \
+classpath/gnu/java/net/protocol/http/ChunkedInputStream.java \
+classpath/gnu/java/net/protocol/http/Cookie.java \
+classpath/gnu/java/net/protocol/http/CookieManager.java \
+classpath/gnu/java/net/protocol/http/Credentials.java \
+classpath/gnu/java/net/protocol/http/HTTPConnection.java \
+classpath/gnu/java/net/protocol/http/HTTPDateFormat.java \
+classpath/gnu/java/net/protocol/http/HTTPURLConnection.java \
+classpath/gnu/java/net/protocol/http/Handler.java \
+classpath/gnu/java/net/protocol/http/Headers.java \
+classpath/gnu/java/net/protocol/http/Request.java \
+classpath/gnu/java/net/protocol/http/RequestBodyWriter.java \
+classpath/gnu/java/net/protocol/http/Response.java \
+classpath/gnu/java/net/protocol/http/ResponseBodyReader.java \
+classpath/gnu/java/net/protocol/http/ResponseHeaderHandler.java \
+classpath/gnu/java/net/protocol/http/SimpleCookieManager.java
+
+gnu_java_net_protocol_http_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_http_source_files)))
+
+gnu/java/net/protocol/http.list: $(gnu_java_net_protocol_http_source_files)
+ @for file in $(gnu_java_net_protocol_http_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/http.list
+
+-include gnu/java/net/protocol/http.deps
+
+
+gnu_java_net_protocol_http_event_source_files = \
+classpath/gnu/java/net/protocol/http/event/ConnectionEvent.java \
+classpath/gnu/java/net/protocol/http/event/ConnectionListener.java \
+classpath/gnu/java/net/protocol/http/event/RequestEvent.java \
+classpath/gnu/java/net/protocol/http/event/RequestListener.java
+
+gnu_java_net_protocol_http_event_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_http_event_source_files)))
+
+gnu/java/net/protocol/http/event.list: $(gnu_java_net_protocol_http_event_source_files)
+ @for file in $(gnu_java_net_protocol_http_event_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/http/event.list
+
+-include gnu/java/net/protocol/http/event.deps
+
+
+gnu_java_net_protocol_https_source_files = \
+classpath/gnu/java/net/protocol/https/Handler.java
+
+gnu_java_net_protocol_https_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_https_source_files)))
+
+gnu/java/net/protocol/https.list: $(gnu_java_net_protocol_https_source_files)
+ @for file in $(gnu_java_net_protocol_https_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/https.list
+
+-include gnu/java/net/protocol/https.deps
+
+
+gnu_java_net_protocol_jar_source_files = \
+gnu/java/net/protocol/jar/Connection.java \
+classpath/gnu/java/net/protocol/jar/Handler.java
+
+gnu_java_net_protocol_jar_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_net_protocol_jar_source_files))))
+
+gnu/java/net/protocol/jar.list: $(gnu_java_net_protocol_jar_source_files)
+ @for file in $(gnu_java_net_protocol_jar_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/net/protocol/jar.list
+
+-include gnu/java/net/protocol/jar.deps
+
+
+gnu_java_nio_source_files = \
+classpath/gnu/java/nio/ChannelInputStream.java \
+classpath/gnu/java/nio/ChannelOutputStream.java \
+classpath/gnu/java/nio/ChannelReader.java \
+gnu/java/nio/DatagramChannelImpl.java \
+gnu/java/nio/DatagramChannelSelectionKey.java \
+classpath/gnu/java/nio/FileLockImpl.java \
+classpath/gnu/java/nio/InputStreamChannel.java \
+classpath/gnu/java/nio/NIOConstants.java \
+classpath/gnu/java/nio/NIODatagramSocket.java \
+gnu/java/nio/NIOServerSocket.java \
+classpath/gnu/java/nio/NIOSocket.java \
+classpath/gnu/java/nio/OutputStreamChannel.java \
+classpath/gnu/java/nio/PipeImpl.java \
+classpath/gnu/java/nio/SelectionKeyImpl.java \
+classpath/gnu/java/nio/SelectorImpl.java \
+classpath/gnu/java/nio/SelectorProviderImpl.java \
+gnu/java/nio/ServerSocketChannelImpl.java \
+gnu/java/nio/ServerSocketChannelSelectionKey.java \
+gnu/java/nio/SocketChannelImpl.java \
+gnu/java/nio/SocketChannelSelectionKey.java \
+gnu/java/nio/VMPipe.java \
+gnu/java/nio/VMSelector.java
+
+gnu_java_nio_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_nio_source_files))))
+
+gnu/java/nio.list: $(gnu_java_nio_source_files)
+ @for file in $(gnu_java_nio_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/nio.list
+
+-include gnu/java/nio.deps
+
+
+gnu_java_nio_channels_source_files = \
+gnu/java/nio/channels/FileChannelImpl.java
+
+gnu_java_nio_channels_header_files = $(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_nio_channels_source_files)))
+
+gnu/java/nio/channels.list: $(gnu_java_nio_channels_source_files)
+ @for file in $(gnu_java_nio_channels_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/nio/channels.list
+
+-include gnu/java/nio/channels.deps
+
+
+gnu_java_nio_charset_source_files = \
+classpath/gnu/java/nio/charset/ByteCharset.java \
+classpath/gnu/java/nio/charset/Cp424.java \
+classpath/gnu/java/nio/charset/Cp437.java \
+classpath/gnu/java/nio/charset/Cp737.java \
+classpath/gnu/java/nio/charset/Cp775.java \
+classpath/gnu/java/nio/charset/Cp850.java \
+classpath/gnu/java/nio/charset/Cp852.java \
+classpath/gnu/java/nio/charset/Cp855.java \
+classpath/gnu/java/nio/charset/Cp857.java \
+classpath/gnu/java/nio/charset/Cp860.java \
+classpath/gnu/java/nio/charset/Cp861.java \
+classpath/gnu/java/nio/charset/Cp862.java \
+classpath/gnu/java/nio/charset/Cp863.java \
+classpath/gnu/java/nio/charset/Cp864.java \
+classpath/gnu/java/nio/charset/Cp865.java \
+classpath/gnu/java/nio/charset/Cp866.java \
+classpath/gnu/java/nio/charset/Cp869.java \
+classpath/gnu/java/nio/charset/Cp874.java \
+classpath/gnu/java/nio/charset/EncodingHelper.java \
+classpath/gnu/java/nio/charset/ISO_8859_1.java \
+classpath/gnu/java/nio/charset/ISO_8859_13.java \
+classpath/gnu/java/nio/charset/ISO_8859_15.java \
+classpath/gnu/java/nio/charset/ISO_8859_2.java \
+classpath/gnu/java/nio/charset/ISO_8859_3.java \
+classpath/gnu/java/nio/charset/ISO_8859_4.java \
+classpath/gnu/java/nio/charset/ISO_8859_5.java \
+classpath/gnu/java/nio/charset/ISO_8859_6.java \
+classpath/gnu/java/nio/charset/ISO_8859_7.java \
+classpath/gnu/java/nio/charset/ISO_8859_8.java \
+classpath/gnu/java/nio/charset/ISO_8859_9.java \
+classpath/gnu/java/nio/charset/KOI_8.java \
+classpath/gnu/java/nio/charset/MS874.java \
+classpath/gnu/java/nio/charset/MacCentralEurope.java \
+classpath/gnu/java/nio/charset/MacCroatian.java \
+classpath/gnu/java/nio/charset/MacCyrillic.java \
+classpath/gnu/java/nio/charset/MacDingbat.java \
+classpath/gnu/java/nio/charset/MacGreek.java \
+classpath/gnu/java/nio/charset/MacIceland.java \
+classpath/gnu/java/nio/charset/MacRoman.java \
+classpath/gnu/java/nio/charset/MacRomania.java \
+classpath/gnu/java/nio/charset/MacSymbol.java \
+classpath/gnu/java/nio/charset/MacThai.java \
+classpath/gnu/java/nio/charset/MacTurkish.java \
+gnu/java/nio/charset/Provider.java \
+classpath/gnu/java/nio/charset/US_ASCII.java \
+classpath/gnu/java/nio/charset/UTF_16.java \
+classpath/gnu/java/nio/charset/UTF_16BE.java \
+classpath/gnu/java/nio/charset/UTF_16Decoder.java \
+classpath/gnu/java/nio/charset/UTF_16Encoder.java \
+classpath/gnu/java/nio/charset/UTF_16LE.java \
+classpath/gnu/java/nio/charset/UTF_8.java \
+classpath/gnu/java/nio/charset/UnicodeLittle.java \
+classpath/gnu/java/nio/charset/Windows1250.java \
+classpath/gnu/java/nio/charset/Windows1251.java \
+classpath/gnu/java/nio/charset/Windows1252.java \
+classpath/gnu/java/nio/charset/Windows1253.java \
+classpath/gnu/java/nio/charset/Windows1254.java \
+classpath/gnu/java/nio/charset/Windows1255.java \
+classpath/gnu/java/nio/charset/Windows1256.java \
+classpath/gnu/java/nio/charset/Windows1257.java \
+classpath/gnu/java/nio/charset/Windows1258.java
+
+gnu_java_nio_charset_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_nio_charset_source_files))))
+
+gnu/java/nio/charset.list: $(gnu_java_nio_charset_source_files)
+ @for file in $(gnu_java_nio_charset_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/nio/charset.list
+
+-include gnu/java/nio/charset.deps
+
+
+gnu_java_rmi_source_files = \
+classpath/gnu/java/rmi/RMIMarshalledObjectInputStream.java \
+classpath/gnu/java/rmi/RMIMarshalledObjectOutputStream.java \
+gnu/java/rmi/rmic/Compile_gcj.java \
+gnu/java/rmi/rmic/Compile_jikes.java \
+gnu/java/rmi/rmic/Compile_kjc.java \
+gnu/java/rmi/rmic/Compiler.java \
+gnu/java/rmi/rmic/CompilerProcess.java \
+gnu/java/rmi/rmic/RMIC.java \
+gnu/java/rmi/rmic/RMICException.java \
+gnu/java/rmi/rmic/TabbedWriter.java
+
+gnu_java_rmi_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(gnu_java_rmi_source_files))))
+
+gnu/java/rmi.list: $(gnu_java_rmi_source_files)
+ @for file in $(gnu_java_rmi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/rmi.list
+
+-include gnu/java/rmi.deps
+
+
+gnu_java_rmi_dgc_source_files = \
+classpath/gnu/java/rmi/dgc/DGCImpl.java \
+classpath/gnu/java/rmi/dgc/DGCImpl_Skel.java \
+classpath/gnu/java/rmi/dgc/DGCImpl_Stub.java
+
+gnu_java_rmi_dgc_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_rmi_dgc_source_files)))
+
+gnu/java/rmi/dgc.list: $(gnu_java_rmi_dgc_source_files)
+ @for file in $(gnu_java_rmi_dgc_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/rmi/dgc.list
+
+-include gnu/java/rmi/dgc.deps
+
+
+gnu_java_rmi_registry_source_files = \
+classpath/gnu/java/rmi/registry/RegistryImpl.java \
+classpath/gnu/java/rmi/registry/RegistryImpl_Skel.java \
+classpath/gnu/java/rmi/registry/RegistryImpl_Stub.java
+
+gnu_java_rmi_registry_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_rmi_registry_source_files)))
+
+gnu/java/rmi/registry.list: $(gnu_java_rmi_registry_source_files)
+ @for file in $(gnu_java_rmi_registry_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/rmi/registry.list
+
+-include gnu/java/rmi/registry.deps
+
+
+gnu_java_rmi_server_source_files = \
+classpath/gnu/java/rmi/server/ConnectionRunnerPool.java \
+classpath/gnu/java/rmi/server/ProtocolConstants.java \
+classpath/gnu/java/rmi/server/RMIDefaultSocketFactory.java \
+classpath/gnu/java/rmi/server/RMIHashes.java \
+classpath/gnu/java/rmi/server/RMIIncomingThread.java \
+classpath/gnu/java/rmi/server/RMIObjectInputStream.java \
+classpath/gnu/java/rmi/server/RMIObjectOutputStream.java \
+classpath/gnu/java/rmi/server/RMIVoidValue.java \
+classpath/gnu/java/rmi/server/UnicastConnection.java \
+classpath/gnu/java/rmi/server/UnicastConnectionManager.java \
+classpath/gnu/java/rmi/server/UnicastRef.java \
+classpath/gnu/java/rmi/server/UnicastRemoteCall.java \
+classpath/gnu/java/rmi/server/UnicastRemoteStub.java \
+classpath/gnu/java/rmi/server/UnicastServer.java \
+classpath/gnu/java/rmi/server/UnicastServerRef.java
+
+gnu_java_rmi_server_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_rmi_server_source_files)))
+
+gnu/java/rmi/server.list: $(gnu_java_rmi_server_source_files)
+ @for file in $(gnu_java_rmi_server_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/rmi/server.list
+
+-include gnu/java/rmi/server.deps
+
+
+gnu_java_security_source_files = \
+classpath/gnu/java/security/Engine.java \
+classpath/gnu/java/security/OID.java \
+classpath/gnu/java/security/PolicyFile.java
+
+gnu_java_security_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_source_files)))
+
+gnu/java/security.list: $(gnu_java_security_source_files)
+ @for file in $(gnu_java_security_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security.list
+
+-include gnu/java/security.deps
+
+
+gnu_java_security_action_source_files = \
+classpath/gnu/java/security/action/GetPropertyAction.java \
+classpath/gnu/java/security/action/GetSecurityPropertyAction.java \
+classpath/gnu/java/security/action/SetAccessibleAction.java
+
+gnu_java_security_action_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_action_source_files)))
+
+gnu/java/security/action.list: $(gnu_java_security_action_source_files)
+ @for file in $(gnu_java_security_action_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/action.list
+
+-include gnu/java/security/action.deps
+
+
+gnu_java_security_ber_source_files = \
+classpath/gnu/java/security/ber/BER.java \
+classpath/gnu/java/security/ber/BEREncodingException.java \
+classpath/gnu/java/security/ber/BERReader.java \
+classpath/gnu/java/security/ber/BERValue.java
+
+gnu_java_security_ber_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_ber_source_files)))
+
+gnu/java/security/ber.list: $(gnu_java_security_ber_source_files)
+ @for file in $(gnu_java_security_ber_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/ber.list
+
+-include gnu/java/security/ber.deps
+
+
+gnu_java_security_der_source_files = \
+classpath/gnu/java/security/der/BitString.java \
+classpath/gnu/java/security/der/DER.java \
+classpath/gnu/java/security/der/DEREncodingException.java \
+classpath/gnu/java/security/der/DERReader.java \
+classpath/gnu/java/security/der/DERValue.java \
+classpath/gnu/java/security/der/DERWriter.java
+
+gnu_java_security_der_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_der_source_files)))
+
+gnu/java/security/der.list: $(gnu_java_security_der_source_files)
+ @for file in $(gnu_java_security_der_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/der.list
+
+-include gnu/java/security/der.deps
+
+
+gnu_java_security_pkcs_source_files = \
+classpath/gnu/java/security/pkcs/PKCS7SignedData.java \
+classpath/gnu/java/security/pkcs/SignerInfo.java
+
+gnu_java_security_pkcs_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_pkcs_source_files)))
+
+gnu/java/security/pkcs.list: $(gnu_java_security_pkcs_source_files)
+ @for file in $(gnu_java_security_pkcs_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/pkcs.list
+
+-include gnu/java/security/pkcs.deps
+
+
+gnu_java_security_provider_source_files = \
+classpath/gnu/java/security/provider/CollectionCertStoreImpl.java \
+classpath/gnu/java/security/provider/DSAKeyFactory.java \
+classpath/gnu/java/security/provider/DSAKeyPairGenerator.java \
+classpath/gnu/java/security/provider/DSAParameterGenerator.java \
+classpath/gnu/java/security/provider/DSAParameters.java \
+classpath/gnu/java/security/provider/DSASignature.java \
+classpath/gnu/java/security/provider/DefaultPolicy.java \
+classpath/gnu/java/security/provider/EncodedKeyFactory.java \
+classpath/gnu/java/security/provider/Gnu.java \
+classpath/gnu/java/security/provider/GnuDHPublicKey.java \
+classpath/gnu/java/security/provider/GnuDSAPrivateKey.java \
+classpath/gnu/java/security/provider/GnuDSAPublicKey.java \
+classpath/gnu/java/security/provider/GnuRSAPrivateKey.java \
+classpath/gnu/java/security/provider/GnuRSAPublicKey.java \
+classpath/gnu/java/security/provider/MD2withRSA.java \
+classpath/gnu/java/security/provider/MD4withRSA.java \
+classpath/gnu/java/security/provider/MD5.java \
+classpath/gnu/java/security/provider/MD5withRSA.java \
+classpath/gnu/java/security/provider/PKIXCertPathValidatorImpl.java \
+classpath/gnu/java/security/provider/RSA.java \
+classpath/gnu/java/security/provider/RSAKeyFactory.java \
+classpath/gnu/java/security/provider/SHA.java \
+classpath/gnu/java/security/provider/SHA1PRNG.java \
+classpath/gnu/java/security/provider/SHA1withRSA.java \
+classpath/gnu/java/security/provider/X509CertificateFactory.java
+
+gnu_java_security_provider_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_provider_source_files)))
+
+gnu/java/security/provider.list: $(gnu_java_security_provider_source_files)
+ @for file in $(gnu_java_security_provider_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/provider.list
+
+-include gnu/java/security/provider.deps
+
+
+gnu_java_security_util_source_files = \
+classpath/gnu/java/security/util/Prime.java
+
+gnu_java_security_util_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_util_source_files)))
+
+gnu/java/security/util.list: $(gnu_java_security_util_source_files)
+ @for file in $(gnu_java_security_util_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/util.list
+
+-include gnu/java/security/util.deps
+
+
+gnu_java_security_x509_source_files = \
+classpath/gnu/java/security/x509/GnuPKIExtension.java \
+classpath/gnu/java/security/x509/PolicyNodeImpl.java \
+classpath/gnu/java/security/x509/Util.java \
+classpath/gnu/java/security/x509/X500DistinguishedName.java \
+classpath/gnu/java/security/x509/X509CRL.java \
+classpath/gnu/java/security/x509/X509CRLEntry.java \
+classpath/gnu/java/security/x509/X509CRLSelectorImpl.java \
+classpath/gnu/java/security/x509/X509CertPath.java \
+classpath/gnu/java/security/x509/X509CertSelectorImpl.java \
+classpath/gnu/java/security/x509/X509Certificate.java
+
+gnu_java_security_x509_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_x509_source_files)))
+
+gnu/java/security/x509.list: $(gnu_java_security_x509_source_files)
+ @for file in $(gnu_java_security_x509_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/x509.list
+
+-include gnu/java/security/x509.deps
+
+
+gnu_java_security_x509_ext_source_files = \
+classpath/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java \
+classpath/gnu/java/security/x509/ext/BasicConstraints.java \
+classpath/gnu/java/security/x509/ext/CRLNumber.java \
+classpath/gnu/java/security/x509/ext/CertificatePolicies.java \
+classpath/gnu/java/security/x509/ext/ExtendedKeyUsage.java \
+classpath/gnu/java/security/x509/ext/Extension.java \
+classpath/gnu/java/security/x509/ext/GeneralNames.java \
+classpath/gnu/java/security/x509/ext/IssuerAlternativeNames.java \
+classpath/gnu/java/security/x509/ext/KeyUsage.java \
+classpath/gnu/java/security/x509/ext/PolicyConstraint.java \
+classpath/gnu/java/security/x509/ext/PolicyMappings.java \
+classpath/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java \
+classpath/gnu/java/security/x509/ext/ReasonCode.java \
+classpath/gnu/java/security/x509/ext/SubjectAlternativeNames.java \
+classpath/gnu/java/security/x509/ext/SubjectKeyIdentifier.java
+
+gnu_java_security_x509_ext_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_security_x509_ext_source_files)))
+
+gnu/java/security/x509/ext.list: $(gnu_java_security_x509_ext_source_files)
+ @for file in $(gnu_java_security_x509_ext_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/security/x509/ext.list
+
+-include gnu/java/security/x509/ext.deps
+
+
+gnu_java_text_source_files = \
+classpath/gnu/java/text/AttributedFormatBuffer.java \
+classpath/gnu/java/text/BaseBreakIterator.java \
+classpath/gnu/java/text/CharacterBreakIterator.java \
+classpath/gnu/java/text/FormatBuffer.java \
+classpath/gnu/java/text/FormatCharacterIterator.java \
+classpath/gnu/java/text/LineBreakIterator.java \
+classpath/gnu/java/text/SentenceBreakIterator.java \
+classpath/gnu/java/text/StringFormatBuffer.java \
+classpath/gnu/java/text/WordBreakIterator.java
+
+gnu_java_text_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_text_source_files)))
+
+gnu/java/text.list: $(gnu_java_text_source_files)
+ @for file in $(gnu_java_text_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/text.list
+
+-include gnu/java/text.deps
+
+
+gnu_java_util_source_files = \
+classpath/gnu/java/util/DoubleEnumeration.java \
+classpath/gnu/java/util/EmptyEnumeration.java
+
+gnu_java_util_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_util_source_files)))
+
+gnu/java/util.list: $(gnu_java_util_source_files)
+ @for file in $(gnu_java_util_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/util.list
+
+-include gnu/java/util.deps
+
+
+gnu_java_util_prefs_source_files = \
+classpath/gnu/java/util/prefs/FileBasedFactory.java \
+classpath/gnu/java/util/prefs/MemoryBasedFactory.java \
+classpath/gnu/java/util/prefs/MemoryBasedPreferences.java \
+classpath/gnu/java/util/prefs/NodeReader.java \
+classpath/gnu/java/util/prefs/NodeWriter.java
+
+gnu_java_util_prefs_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_util_prefs_source_files)))
+
+gnu/java/util/prefs.list: $(gnu_java_util_prefs_source_files)
+ @for file in $(gnu_java_util_prefs_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/java/util/prefs.list
+
+-include gnu/java/util/prefs.deps
+
+
+gnu_javax_swing_text_html_parser_source_files = \
+classpath/gnu/javax/swing/text/html/parser/HTML_401F.java \
+classpath/gnu/javax/swing/text/html/parser/gnuDTD.java \
+classpath/gnu/javax/swing/text/html/parser/htmlAttributeSet.java \
+classpath/gnu/javax/swing/text/html/parser/htmlValidator.java
+
+gnu_javax_swing_text_html_parser_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_javax_swing_text_html_parser_source_files)))
+
+gnu/javax/swing/text/html/parser.list: $(gnu_javax_swing_text_html_parser_source_files)
+ @for file in $(gnu_javax_swing_text_html_parser_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/javax/swing/text/html/parser.list
+
+-include gnu/javax/swing/text/html/parser.deps
+
+
+gnu_javax_swing_text_html_parser_models_source_files = \
+classpath/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.java \
+classpath/gnu/javax/swing/text/html/parser/models/TableRowContentModel.java \
+classpath/gnu/javax/swing/text/html/parser/models/list.java \
+classpath/gnu/javax/swing/text/html/parser/models/noTagModel.java \
+classpath/gnu/javax/swing/text/html/parser/models/node.java \
+classpath/gnu/javax/swing/text/html/parser/models/transformer.java
+
+gnu_javax_swing_text_html_parser_models_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_javax_swing_text_html_parser_models_source_files)))
+
+gnu/javax/swing/text/html/parser/models.list: $(gnu_javax_swing_text_html_parser_models_source_files)
+ @for file in $(gnu_javax_swing_text_html_parser_models_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/javax/swing/text/html/parser/models.list
+
+-include gnu/javax/swing/text/html/parser/models.deps
+
+
+gnu_javax_swing_text_html_parser_support_source_files = \
+classpath/gnu/javax/swing/text/html/parser/support/Parser.java \
+classpath/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.java \
+classpath/gnu/javax/swing/text/html/parser/support/parameterDefaulter.java \
+classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java
+
+gnu_javax_swing_text_html_parser_support_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_javax_swing_text_html_parser_support_source_files)))
+
+gnu/javax/swing/text/html/parser/support.list: $(gnu_javax_swing_text_html_parser_support_source_files)
+ @for file in $(gnu_javax_swing_text_html_parser_support_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/javax/swing/text/html/parser/support.list
+
+-include gnu/javax/swing/text/html/parser/support.deps
+
+
+gnu_javax_swing_text_html_parser_support_low_source_files = \
+classpath/gnu/javax/swing/text/html/parser/support/low/Buffer.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/Constants.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/Location.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/ParseException.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/Queue.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/Token.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/node.java \
+classpath/gnu/javax/swing/text/html/parser/support/low/pattern.java
+
+gnu_javax_swing_text_html_parser_support_low_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_javax_swing_text_html_parser_support_low_source_files)))
+
+gnu/javax/swing/text/html/parser/support/low.list: $(gnu_javax_swing_text_html_parser_support_low_source_files)
+ @for file in $(gnu_javax_swing_text_html_parser_support_low_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/javax/swing/text/html/parser/support/low.list
+
+-include gnu/javax/swing/text/html/parser/support/low.deps
+
+
+gnu_regexp_source_files = \
+classpath/gnu/regexp/CharIndexed.java \
+classpath/gnu/regexp/CharIndexedCharArray.java \
+classpath/gnu/regexp/CharIndexedInputStream.java \
+classpath/gnu/regexp/CharIndexedString.java \
+classpath/gnu/regexp/CharIndexedStringBuffer.java \
+classpath/gnu/regexp/RE.java \
+classpath/gnu/regexp/REException.java \
+classpath/gnu/regexp/REFilterInputStream.java \
+classpath/gnu/regexp/REMatch.java \
+classpath/gnu/regexp/REMatchEnumeration.java \
+classpath/gnu/regexp/RESyntax.java \
+classpath/gnu/regexp/REToken.java \
+classpath/gnu/regexp/RETokenAny.java \
+classpath/gnu/regexp/RETokenBackRef.java \
+classpath/gnu/regexp/RETokenChar.java \
+classpath/gnu/regexp/RETokenEnd.java \
+classpath/gnu/regexp/RETokenEndSub.java \
+classpath/gnu/regexp/RETokenLookAhead.java \
+classpath/gnu/regexp/RETokenOneOf.java \
+classpath/gnu/regexp/RETokenPOSIX.java \
+classpath/gnu/regexp/RETokenRange.java \
+classpath/gnu/regexp/RETokenRepeated.java \
+classpath/gnu/regexp/RETokenStart.java \
+classpath/gnu/regexp/RETokenWordBoundary.java \
+classpath/gnu/regexp/UncheckedRE.java
+
+gnu_regexp_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_regexp_source_files)))
+
+gnu/regexp.list: $(gnu_regexp_source_files)
+ @for file in $(gnu_regexp_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > gnu/regexp.list
+
+-include gnu/regexp.deps
+
+
+gnu_xml_source_files = \
+classpath/gnu/xml/aelfred2/ContentHandler2.java \
+classpath/gnu/xml/aelfred2/JAXPFactory.java \
+classpath/gnu/xml/aelfred2/SAXDriver.java \
+classpath/gnu/xml/aelfred2/XmlParser.java \
+classpath/gnu/xml/aelfred2/XmlReader.java \
+classpath/gnu/xml/dom/Consumer.java \
+classpath/gnu/xml/dom/DTDAttributeTypeInfo.java \
+classpath/gnu/xml/dom/DTDElementTypeInfo.java \
+classpath/gnu/xml/dom/DomAttr.java \
+classpath/gnu/xml/dom/DomCDATASection.java \
+classpath/gnu/xml/dom/DomCharacterData.java \
+classpath/gnu/xml/dom/DomComment.java \
+classpath/gnu/xml/dom/DomDOMException.java \
+classpath/gnu/xml/dom/DomDoctype.java \
+classpath/gnu/xml/dom/DomDocument.java \
+classpath/gnu/xml/dom/DomDocumentBuilder.java \
+classpath/gnu/xml/dom/DomDocumentBuilderFactory.java \
+classpath/gnu/xml/dom/DomDocumentConfiguration.java \
+classpath/gnu/xml/dom/DomDocumentFragment.java \
+classpath/gnu/xml/dom/DomElement.java \
+classpath/gnu/xml/dom/DomEntity.java \
+classpath/gnu/xml/dom/DomEntityReference.java \
+classpath/gnu/xml/dom/DomEvent.java \
+classpath/gnu/xml/dom/DomExtern.java \
+classpath/gnu/xml/dom/DomImpl.java \
+classpath/gnu/xml/dom/DomIterator.java \
+classpath/gnu/xml/dom/DomNSResolverContext.java \
+classpath/gnu/xml/dom/DomNamedNodeMap.java \
+classpath/gnu/xml/dom/DomNode.java \
+classpath/gnu/xml/dom/DomNodeIterator.java \
+classpath/gnu/xml/dom/DomNotation.java \
+classpath/gnu/xml/dom/DomNsNode.java \
+classpath/gnu/xml/dom/DomProcessingInstruction.java \
+classpath/gnu/xml/dom/DomText.java \
+classpath/gnu/xml/dom/DomXPathExpression.java \
+classpath/gnu/xml/dom/DomXPathNSResolver.java \
+classpath/gnu/xml/dom/DomXPathResult.java \
+classpath/gnu/xml/dom/ImplementationList.java \
+classpath/gnu/xml/dom/ImplementationSource.java \
+classpath/gnu/xml/dom/JAXPFactory.java \
+classpath/gnu/xml/dom/html2/DomHTMLAnchorElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLAppletElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLAreaElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLBRElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLBaseElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLBaseFontElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLBodyElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLButtonElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLCollection.java \
+classpath/gnu/xml/dom/html2/DomHTMLDListElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLDirectoryElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLDivElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLDocument.java \
+classpath/gnu/xml/dom/html2/DomHTMLElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLFieldSetElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLFontElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLFormElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLFrameElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLFrameSetElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLHRElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLHeadElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLHeadingElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLHtmlElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLIFrameElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLImageElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLImpl.java \
+classpath/gnu/xml/dom/html2/DomHTMLInputElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLIsIndexElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLLIElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLLabelElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLLegendElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLLinkElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLMapElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLMenuElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLMetaElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLModElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLOListElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLObjectElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLOptGroupElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLOptionElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLParagraphElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLParamElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLParser.java \
+classpath/gnu/xml/dom/html2/DomHTMLPreElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLQuoteElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLScriptElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLSelectElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLStyleElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableCaptionElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableCellElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableColElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableRowElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTableSectionElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTextAreaElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLTitleElement.java \
+classpath/gnu/xml/dom/html2/DomHTMLUListElement.java \
+classpath/gnu/xml/dom/ls/DomLSException.java \
+classpath/gnu/xml/dom/ls/DomLSInput.java \
+classpath/gnu/xml/dom/ls/DomLSOutput.java \
+classpath/gnu/xml/dom/ls/DomLSParser.java \
+classpath/gnu/xml/dom/ls/DomLSSerializer.java \
+classpath/gnu/xml/dom/ls/FilteredSAXEventSink.java \
+classpath/gnu/xml/dom/ls/ReaderInputStream.java \
+classpath/gnu/xml/dom/ls/SAXEventSink.java \
+classpath/gnu/xml/dom/ls/WriterOutputStream.java \
+classpath/gnu/xml/libxmlj/dom/GnomeAttr.java \
+classpath/gnu/xml/libxmlj/dom/GnomeCDATASection.java \
+classpath/gnu/xml/libxmlj/dom/GnomeCharacterData.java \
+classpath/gnu/xml/libxmlj/dom/GnomeComment.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDOMException.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDOMStringList.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDocument.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDocumentBuilder.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDocumentBuilderFactory.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDocumentFragment.java \
+classpath/gnu/xml/libxmlj/dom/GnomeDocumentType.java \
+classpath/gnu/xml/libxmlj/dom/GnomeElement.java \
+classpath/gnu/xml/libxmlj/dom/GnomeEntity.java \
+classpath/gnu/xml/libxmlj/dom/GnomeEntityReference.java \
+classpath/gnu/xml/libxmlj/dom/GnomeNamedNodeMap.java \
+classpath/gnu/xml/libxmlj/dom/GnomeNode.java \
+classpath/gnu/xml/libxmlj/dom/GnomeNodeList.java \
+classpath/gnu/xml/libxmlj/dom/GnomeNotation.java \
+classpath/gnu/xml/libxmlj/dom/GnomeProcessingInstruction.java \
+classpath/gnu/xml/libxmlj/dom/GnomeText.java \
+classpath/gnu/xml/libxmlj/dom/GnomeTypeInfo.java \
+classpath/gnu/xml/libxmlj/dom/GnomeXPathExpression.java \
+classpath/gnu/xml/libxmlj/dom/GnomeXPathNSResolver.java \
+classpath/gnu/xml/libxmlj/dom/GnomeXPathNodeList.java \
+classpath/gnu/xml/libxmlj/dom/GnomeXPathResult.java \
+classpath/gnu/xml/libxmlj/sax/GnomeLocator.java \
+classpath/gnu/xml/libxmlj/sax/GnomeSAXParser.java \
+classpath/gnu/xml/libxmlj/sax/GnomeSAXParserFactory.java \
+classpath/gnu/xml/libxmlj/sax/GnomeXMLReader.java \
+classpath/gnu/xml/libxmlj/sax/Namespaces.java \
+classpath/gnu/xml/libxmlj/sax/StringArrayAttributes.java \
+classpath/gnu/xml/libxmlj/sax/XMLName.java \
+classpath/gnu/xml/libxmlj/transform/ErrorListenerErrorHandler.java \
+classpath/gnu/xml/libxmlj/transform/GnomeTransformer.java \
+classpath/gnu/xml/libxmlj/transform/GnomeTransformerFactory.java \
+classpath/gnu/xml/libxmlj/transform/URIResolverEntityResolver.java \
+classpath/gnu/xml/libxmlj/util/EmptyNodeList.java \
+classpath/gnu/xml/libxmlj/util/NamedInputStream.java \
+classpath/gnu/xml/libxmlj/util/StandaloneDocumentType.java \
+classpath/gnu/xml/libxmlj/util/StandaloneLocator.java \
+classpath/gnu/xml/libxmlj/util/XMLJ.java \
+classpath/gnu/xml/pipeline/CallFilter.java \
+classpath/gnu/xml/pipeline/DomConsumer.java \
+classpath/gnu/xml/pipeline/EventConsumer.java \
+classpath/gnu/xml/pipeline/EventFilter.java \
+classpath/gnu/xml/pipeline/LinkFilter.java \
+classpath/gnu/xml/pipeline/NSFilter.java \
+classpath/gnu/xml/pipeline/PipelineFactory.java \
+classpath/gnu/xml/pipeline/TeeConsumer.java \
+classpath/gnu/xml/pipeline/TextConsumer.java \
+classpath/gnu/xml/pipeline/ValidationConsumer.java \
+classpath/gnu/xml/pipeline/WellFormednessFilter.java \
+classpath/gnu/xml/pipeline/XIncludeFilter.java \
+classpath/gnu/xml/pipeline/XsltFilter.java \
+classpath/gnu/xml/transform/AbstractNumberNode.java \
+classpath/gnu/xml/transform/ApplyImportsNode.java \
+classpath/gnu/xml/transform/ApplyTemplatesNode.java \
+classpath/gnu/xml/transform/AttributeNode.java \
+classpath/gnu/xml/transform/AttributeSet.java \
+classpath/gnu/xml/transform/Bindings.java \
+classpath/gnu/xml/transform/CallTemplateNode.java \
+classpath/gnu/xml/transform/ChooseNode.java \
+classpath/gnu/xml/transform/CommentNode.java \
+classpath/gnu/xml/transform/CopyNode.java \
+classpath/gnu/xml/transform/CopyOfNode.java \
+classpath/gnu/xml/transform/CurrentFunction.java \
+classpath/gnu/xml/transform/DOMSourceLocator.java \
+classpath/gnu/xml/transform/DocumentFunction.java \
+classpath/gnu/xml/transform/ElementAvailableFunction.java \
+classpath/gnu/xml/transform/ElementNode.java \
+classpath/gnu/xml/transform/ErrorListenerErrorHandler.java \
+classpath/gnu/xml/transform/ForEachNode.java \
+classpath/gnu/xml/transform/FormatNumberFunction.java \
+classpath/gnu/xml/transform/FunctionAvailableFunction.java \
+classpath/gnu/xml/transform/GenerateIdFunction.java \
+classpath/gnu/xml/transform/IfNode.java \
+classpath/gnu/xml/transform/Key.java \
+classpath/gnu/xml/transform/KeyFunction.java \
+classpath/gnu/xml/transform/LiteralNode.java \
+classpath/gnu/xml/transform/MessageNode.java \
+classpath/gnu/xml/transform/NodeNumberNode.java \
+classpath/gnu/xml/transform/NumberNode.java \
+classpath/gnu/xml/transform/OtherwiseNode.java \
+classpath/gnu/xml/transform/ParameterNode.java \
+classpath/gnu/xml/transform/ProcessingInstructionNode.java \
+classpath/gnu/xml/transform/SAXSerializer.java \
+classpath/gnu/xml/transform/SortKey.java \
+classpath/gnu/xml/transform/StreamSerializer.java \
+classpath/gnu/xml/transform/Stylesheet.java \
+classpath/gnu/xml/transform/SystemPropertyFunction.java \
+classpath/gnu/xml/transform/Template.java \
+classpath/gnu/xml/transform/TemplateNode.java \
+classpath/gnu/xml/transform/TemplatesImpl.java \
+classpath/gnu/xml/transform/TextNode.java \
+classpath/gnu/xml/transform/TransformerFactoryImpl.java \
+classpath/gnu/xml/transform/TransformerImpl.java \
+classpath/gnu/xml/transform/TransformerOutputProperties.java \
+classpath/gnu/xml/transform/URIResolverEntityResolver.java \
+classpath/gnu/xml/transform/UnparsedEntityUriFunction.java \
+classpath/gnu/xml/transform/ValueOfNode.java \
+classpath/gnu/xml/transform/WhenNode.java \
+classpath/gnu/xml/transform/WithParam.java \
+classpath/gnu/xml/transform/XSLComparator.java \
+classpath/gnu/xml/transform/XSLURIResolver.java \
+classpath/gnu/xml/util/DoParse.java \
+classpath/gnu/xml/util/DomParser.java \
+classpath/gnu/xml/util/Resolver.java \
+classpath/gnu/xml/util/SAXNullTransformerFactory.java \
+classpath/gnu/xml/util/XCat.java \
+classpath/gnu/xml/util/XHTMLWriter.java \
+classpath/gnu/xml/util/XMLWriter.java \
+classpath/gnu/xml/xpath/AndExpr.java \
+classpath/gnu/xml/xpath/ArithmeticExpr.java \
+classpath/gnu/xml/xpath/BooleanFunction.java \
+classpath/gnu/xml/xpath/CeilingFunction.java \
+classpath/gnu/xml/xpath/ConcatFunction.java \
+classpath/gnu/xml/xpath/Constant.java \
+classpath/gnu/xml/xpath/ContainsFunction.java \
+classpath/gnu/xml/xpath/CountFunction.java \
+classpath/gnu/xml/xpath/DocumentOrderComparator.java \
+classpath/gnu/xml/xpath/EqualityExpr.java \
+classpath/gnu/xml/xpath/Expr.java \
+classpath/gnu/xml/xpath/FalseFunction.java \
+classpath/gnu/xml/xpath/FloorFunction.java \
+classpath/gnu/xml/xpath/Function.java \
+classpath/gnu/xml/xpath/FunctionCall.java \
+classpath/gnu/xml/xpath/IdFunction.java \
+classpath/gnu/xml/xpath/LangFunction.java \
+classpath/gnu/xml/xpath/LastFunction.java \
+classpath/gnu/xml/xpath/LocalNameFunction.java \
+classpath/gnu/xml/xpath/NameFunction.java \
+classpath/gnu/xml/xpath/NameTest.java \
+classpath/gnu/xml/xpath/NamespaceTest.java \
+classpath/gnu/xml/xpath/NamespaceUriFunction.java \
+classpath/gnu/xml/xpath/NegativeExpr.java \
+classpath/gnu/xml/xpath/NodeTypeTest.java \
+classpath/gnu/xml/xpath/NormalizeSpaceFunction.java \
+classpath/gnu/xml/xpath/NotFunction.java \
+classpath/gnu/xml/xpath/NumberFunction.java \
+classpath/gnu/xml/xpath/OrExpr.java \
+classpath/gnu/xml/xpath/ParenthesizedExpr.java \
+classpath/gnu/xml/xpath/Path.java \
+classpath/gnu/xml/xpath/Pattern.java \
+classpath/gnu/xml/xpath/PositionFunction.java \
+classpath/gnu/xml/xpath/Predicate.java \
+classpath/gnu/xml/xpath/RelationalExpr.java \
+classpath/gnu/xml/xpath/Root.java \
+classpath/gnu/xml/xpath/RoundFunction.java \
+classpath/gnu/xml/xpath/Selector.java \
+classpath/gnu/xml/xpath/StartsWithFunction.java \
+classpath/gnu/xml/xpath/Steps.java \
+classpath/gnu/xml/xpath/StringFunction.java \
+classpath/gnu/xml/xpath/StringLengthFunction.java \
+classpath/gnu/xml/xpath/SubstringAfterFunction.java \
+classpath/gnu/xml/xpath/SubstringBeforeFunction.java \
+classpath/gnu/xml/xpath/SubstringFunction.java \
+classpath/gnu/xml/xpath/SumFunction.java \
+classpath/gnu/xml/xpath/Test.java \
+classpath/gnu/xml/xpath/TranslateFunction.java \
+classpath/gnu/xml/xpath/TrueFunction.java \
+classpath/gnu/xml/xpath/UnionExpr.java \
+classpath/gnu/xml/xpath/VariableReference.java \
+classpath/gnu/xml/xpath/XPathFactoryImpl.java \
+classpath/gnu/xml/xpath/XPathImpl.java \
+classpath/gnu/xml/xpath/XPathParser.java \
+classpath/gnu/xml/xpath/XPathTokenizer.java
+
+gnu-xml.lo: $(gnu_xml_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o gnu-xml.lo \
+ `find classpath/lib/gnu/xml -name '*.class' | sort -r`
+
+java_applet_source_files = \
+classpath/java/applet/Applet.java \
+classpath/java/applet/AppletContext.java \
+classpath/java/applet/AppletStub.java \
+classpath/java/applet/AudioClip.java
+
+java_applet_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_applet_source_files)))
+
+java/applet.list: $(java_applet_source_files)
+ @for file in $(java_applet_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/applet.list
+
+-include java/applet.deps
+
+
+java_awt_source_files = \
+classpath/java/awt/AWTError.java \
+classpath/java/awt/AWTEvent.java \
+classpath/java/awt/AWTEventMulticaster.java \
+classpath/java/awt/AWTException.java \
+classpath/java/awt/AWTKeyStroke.java \
+classpath/java/awt/AWTPermission.java \
+classpath/java/awt/ActiveEvent.java \
+classpath/java/awt/Adjustable.java \
+classpath/java/awt/AlphaComposite.java \
+classpath/java/awt/AttributeValue.java \
+classpath/java/awt/BasicStroke.java \
+classpath/java/awt/BorderLayout.java \
+classpath/java/awt/BufferCapabilities.java \
+classpath/java/awt/Button.java \
+classpath/java/awt/Canvas.java \
+classpath/java/awt/CardLayout.java \
+classpath/java/awt/Checkbox.java \
+classpath/java/awt/CheckboxGroup.java \
+classpath/java/awt/CheckboxMenuItem.java \
+classpath/java/awt/Choice.java \
+classpath/java/awt/Color.java \
+classpath/java/awt/ColorPaintContext.java \
+classpath/java/awt/Component.java \
+classpath/java/awt/ComponentOrientation.java \
+classpath/java/awt/Composite.java \
+classpath/java/awt/CompositeContext.java \
+classpath/java/awt/Container.java \
+classpath/java/awt/ContainerOrderFocusTraversalPolicy.java \
+classpath/java/awt/Cursor.java \
+classpath/java/awt/DefaultFocusTraversalPolicy.java \
+classpath/java/awt/DefaultKeyboardFocusManager.java \
+classpath/java/awt/Dialog.java \
+classpath/java/awt/Dimension.java \
+classpath/java/awt/DisplayMode.java \
+classpath/java/awt/Event.java \
+classpath/java/awt/EventDispatchThread.java \
+classpath/java/awt/EventQueue.java \
+classpath/java/awt/FileDialog.java \
+classpath/java/awt/FlowLayout.java \
+classpath/java/awt/FocusTraversalPolicy.java \
+classpath/java/awt/Font.java \
+classpath/java/awt/FontFormatException.java \
+classpath/java/awt/FontMetrics.java \
+classpath/java/awt/Frame.java \
+classpath/java/awt/GradientPaint.java \
+classpath/java/awt/Graphics.java \
+classpath/java/awt/Graphics2D.java \
+classpath/java/awt/GraphicsConfigTemplate.java \
+classpath/java/awt/GraphicsConfiguration.java \
+classpath/java/awt/GraphicsDevice.java \
+classpath/java/awt/GraphicsEnvironment.java \
+classpath/java/awt/GridBagConstraints.java \
+classpath/java/awt/GridBagLayout.java \
+classpath/java/awt/GridBagLayoutInfo.java \
+classpath/java/awt/GridLayout.java \
+classpath/java/awt/HeadlessException.java \
+classpath/java/awt/IllegalComponentStateException.java \
+classpath/java/awt/Image.java \
+classpath/java/awt/ImageCapabilities.java \
+classpath/java/awt/Insets.java \
+classpath/java/awt/ItemSelectable.java \
+classpath/java/awt/JobAttributes.java \
+classpath/java/awt/KeyEventDispatcher.java \
+classpath/java/awt/KeyEventPostProcessor.java \
+classpath/java/awt/KeyboardFocusManager.java \
+classpath/java/awt/Label.java \
+classpath/java/awt/LayoutManager.java \
+classpath/java/awt/LayoutManager2.java \
+classpath/java/awt/List.java \
+classpath/java/awt/MediaTracker.java \
+classpath/java/awt/Menu.java \
+classpath/java/awt/MenuBar.java \
+classpath/java/awt/MenuComponent.java \
+classpath/java/awt/MenuContainer.java \
+classpath/java/awt/MenuItem.java \
+classpath/java/awt/MenuShortcut.java \
+classpath/java/awt/PageAttributes.java \
+classpath/java/awt/Paint.java \
+classpath/java/awt/PaintContext.java \
+classpath/java/awt/Panel.java \
+classpath/java/awt/Point.java \
+classpath/java/awt/Polygon.java \
+classpath/java/awt/PopupMenu.java \
+classpath/java/awt/PrintGraphics.java \
+classpath/java/awt/PrintJob.java \
+classpath/java/awt/Rectangle.java \
+classpath/java/awt/RenderingHints.java \
+classpath/java/awt/Robot.java \
+classpath/java/awt/ScrollPane.java \
+classpath/java/awt/ScrollPaneAdjustable.java \
+classpath/java/awt/Scrollbar.java \
+classpath/java/awt/Shape.java \
+classpath/java/awt/Stroke.java \
+classpath/java/awt/SystemColor.java \
+classpath/java/awt/TextArea.java \
+classpath/java/awt/TextComponent.java \
+classpath/java/awt/TextField.java \
+classpath/java/awt/TexturePaint.java \
+classpath/java/awt/Toolkit.java \
+classpath/java/awt/Transparency.java \
+classpath/java/awt/Window.java
+
+java_awt_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_source_files)))
+
+java/awt.list: $(java_awt_source_files)
+ @for file in $(java_awt_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt.list
+
+-include java/awt.deps
+
+
+java_awt_color_source_files = \
+classpath/java/awt/color/CMMException.java \
+classpath/java/awt/color/ColorSpace.java \
+classpath/java/awt/color/ICC_ColorSpace.java \
+classpath/java/awt/color/ICC_Profile.java \
+classpath/java/awt/color/ICC_ProfileGray.java \
+classpath/java/awt/color/ICC_ProfileRGB.java \
+classpath/java/awt/color/ProfileDataException.java
+
+java_awt_color_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_color_source_files)))
+
+java/awt/color.list: $(java_awt_color_source_files)
+ @for file in $(java_awt_color_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/color.list
+
+-include java/awt/color.deps
+
+
+java_awt_datatransfer_source_files = \
+classpath/java/awt/datatransfer/Clipboard.java \
+classpath/java/awt/datatransfer/ClipboardOwner.java \
+classpath/java/awt/datatransfer/DataFlavor.java \
+classpath/java/awt/datatransfer/FlavorMap.java \
+classpath/java/awt/datatransfer/FlavorTable.java \
+classpath/java/awt/datatransfer/MimeTypeParseException.java \
+classpath/java/awt/datatransfer/StringSelection.java \
+classpath/java/awt/datatransfer/SystemFlavorMap.java \
+classpath/java/awt/datatransfer/Transferable.java \
+classpath/java/awt/datatransfer/UnsupportedFlavorException.java
+
+java_awt_datatransfer_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_datatransfer_source_files)))
+
+java/awt/datatransfer.list: $(java_awt_datatransfer_source_files)
+ @for file in $(java_awt_datatransfer_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/datatransfer.list
+
+-include java/awt/datatransfer.deps
+
+
+java_awt_dnd_source_files = \
+classpath/java/awt/dnd/Autoscroll.java \
+classpath/java/awt/dnd/DnDConstants.java \
+classpath/java/awt/dnd/DnDEventMulticaster.java \
+classpath/java/awt/dnd/DragGestureEvent.java \
+classpath/java/awt/dnd/DragGestureListener.java \
+classpath/java/awt/dnd/DragGestureRecognizer.java \
+classpath/java/awt/dnd/DragSource.java \
+classpath/java/awt/dnd/DragSourceAdapter.java \
+classpath/java/awt/dnd/DragSourceContext.java \
+classpath/java/awt/dnd/DragSourceDragEvent.java \
+classpath/java/awt/dnd/DragSourceDropEvent.java \
+classpath/java/awt/dnd/DragSourceEvent.java \
+classpath/java/awt/dnd/DragSourceListener.java \
+classpath/java/awt/dnd/DragSourceMotionListener.java \
+classpath/java/awt/dnd/DropTarget.java \
+classpath/java/awt/dnd/DropTargetAdapter.java \
+classpath/java/awt/dnd/DropTargetContext.java \
+classpath/java/awt/dnd/DropTargetDragEvent.java \
+classpath/java/awt/dnd/DropTargetDropEvent.java \
+classpath/java/awt/dnd/DropTargetEvent.java \
+classpath/java/awt/dnd/DropTargetListener.java \
+classpath/java/awt/dnd/InvalidDnDOperationException.java \
+classpath/java/awt/dnd/MouseDragGestureRecognizer.java
+
+java_awt_dnd_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_dnd_source_files)))
+
+java/awt/dnd.list: $(java_awt_dnd_source_files)
+ @for file in $(java_awt_dnd_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/dnd.list
+
+-include java/awt/dnd.deps
+
+
+java_awt_dnd_peer_source_files = \
+classpath/java/awt/dnd/peer/DragSourceContextPeer.java \
+classpath/java/awt/dnd/peer/DropTargetContextPeer.java \
+classpath/java/awt/dnd/peer/DropTargetPeer.java
+
+java_awt_dnd_peer_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_dnd_peer_source_files)))
+
+java/awt/dnd/peer.list: $(java_awt_dnd_peer_source_files)
+ @for file in $(java_awt_dnd_peer_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/dnd/peer.list
+
+-include java/awt/dnd/peer.deps
+
+
+java_awt_event_source_files = \
+classpath/java/awt/event/AWTEventListener.java \
+classpath/java/awt/event/AWTEventListenerProxy.java \
+classpath/java/awt/event/ActionEvent.java \
+classpath/java/awt/event/ActionListener.java \
+classpath/java/awt/event/AdjustmentEvent.java \
+classpath/java/awt/event/AdjustmentListener.java \
+classpath/java/awt/event/ComponentAdapter.java \
+classpath/java/awt/event/ComponentEvent.java \
+classpath/java/awt/event/ComponentListener.java \
+classpath/java/awt/event/ContainerAdapter.java \
+classpath/java/awt/event/ContainerEvent.java \
+classpath/java/awt/event/ContainerListener.java \
+classpath/java/awt/event/FocusAdapter.java \
+classpath/java/awt/event/FocusEvent.java \
+classpath/java/awt/event/FocusListener.java \
+classpath/java/awt/event/HierarchyBoundsAdapter.java \
+classpath/java/awt/event/HierarchyBoundsListener.java \
+classpath/java/awt/event/HierarchyEvent.java \
+classpath/java/awt/event/HierarchyListener.java \
+classpath/java/awt/event/InputEvent.java \
+classpath/java/awt/event/InputMethodEvent.java \
+classpath/java/awt/event/InputMethodListener.java \
+classpath/java/awt/event/InvocationEvent.java \
+classpath/java/awt/event/ItemEvent.java \
+classpath/java/awt/event/ItemListener.java \
+classpath/java/awt/event/KeyAdapter.java \
+classpath/java/awt/event/KeyEvent.java \
+classpath/java/awt/event/KeyListener.java \
+classpath/java/awt/event/MouseAdapter.java \
+classpath/java/awt/event/MouseEvent.java \
+classpath/java/awt/event/MouseListener.java \
+classpath/java/awt/event/MouseMotionAdapter.java \
+classpath/java/awt/event/MouseMotionListener.java \
+classpath/java/awt/event/MouseWheelEvent.java \
+classpath/java/awt/event/MouseWheelListener.java \
+classpath/java/awt/event/PaintEvent.java \
+classpath/java/awt/event/TextEvent.java \
+classpath/java/awt/event/TextListener.java \
+classpath/java/awt/event/WindowAdapter.java \
+classpath/java/awt/event/WindowEvent.java \
+classpath/java/awt/event/WindowFocusListener.java \
+classpath/java/awt/event/WindowListener.java \
+classpath/java/awt/event/WindowStateListener.java
+
+java_awt_event_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_event_source_files)))
+
+java/awt/event.list: $(java_awt_event_source_files)
+ @for file in $(java_awt_event_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/event.list
+
+-include java/awt/event.deps
+
+
+java_awt_font_source_files = \
+classpath/java/awt/font/FontRenderContext.java \
+classpath/java/awt/font/GlyphJustificationInfo.java \
+classpath/java/awt/font/GlyphMetrics.java \
+classpath/java/awt/font/GlyphVector.java \
+classpath/java/awt/font/GraphicAttribute.java \
+classpath/java/awt/font/ImageGraphicAttribute.java \
+classpath/java/awt/font/LineBreakMeasurer.java \
+classpath/java/awt/font/LineMetrics.java \
+classpath/java/awt/font/MultipleMaster.java \
+classpath/java/awt/font/NumericShaper.java \
+classpath/java/awt/font/OpenType.java \
+classpath/java/awt/font/ShapeGraphicAttribute.java \
+classpath/java/awt/font/TextAttribute.java \
+classpath/java/awt/font/TextHitInfo.java \
+classpath/java/awt/font/TextLayout.java \
+classpath/java/awt/font/TextMeasurer.java \
+classpath/java/awt/font/TransformAttribute.java
+
+java_awt_font_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_font_source_files)))
+
+java/awt/font.list: $(java_awt_font_source_files)
+ @for file in $(java_awt_font_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/font.list
+
+-include java/awt/font.deps
+
+
+java_awt_geom_source_files = \
+classpath/java/awt/geom/AffineTransform.java \
+classpath/java/awt/geom/Arc2D.java \
+classpath/java/awt/geom/Area.java \
+classpath/java/awt/geom/CubicCurve2D.java \
+classpath/java/awt/geom/Dimension2D.java \
+classpath/java/awt/geom/Ellipse2D.java \
+classpath/java/awt/geom/FlatteningPathIterator.java \
+classpath/java/awt/geom/GeneralPath.java \
+classpath/java/awt/geom/IllegalPathStateException.java \
+classpath/java/awt/geom/Line2D.java \
+classpath/java/awt/geom/NoninvertibleTransformException.java \
+classpath/java/awt/geom/PathIterator.java \
+classpath/java/awt/geom/Point2D.java \
+classpath/java/awt/geom/QuadCurve2D.java \
+classpath/java/awt/geom/Rectangle2D.java \
+classpath/java/awt/geom/RectangularShape.java \
+classpath/java/awt/geom/RoundRectangle2D.java
+
+java_awt_geom_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_geom_source_files)))
+
+java/awt/geom.list: $(java_awt_geom_source_files)
+ @for file in $(java_awt_geom_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/geom.list
+
+-include java/awt/geom.deps
+
+
+java_awt_im_source_files = \
+classpath/java/awt/im/InputContext.java \
+classpath/java/awt/im/InputMethodHighlight.java \
+classpath/java/awt/im/InputMethodRequests.java \
+classpath/java/awt/im/InputSubset.java
+
+java_awt_im_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_im_source_files)))
+
+java/awt/im.list: $(java_awt_im_source_files)
+ @for file in $(java_awt_im_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/im.list
+
+-include java/awt/im.deps
+
+
+java_awt_im_spi_source_files = \
+classpath/java/awt/im/spi/InputMethod.java \
+classpath/java/awt/im/spi/InputMethodContext.java \
+classpath/java/awt/im/spi/InputMethodDescriptor.java
+
+java_awt_im_spi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_im_spi_source_files)))
+
+java/awt/im/spi.list: $(java_awt_im_spi_source_files)
+ @for file in $(java_awt_im_spi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/im/spi.list
+
+-include java/awt/im/spi.deps
+
+
+java_awt_image_source_files = \
+classpath/java/awt/image/AffineTransformOp.java \
+classpath/java/awt/image/AreaAveragingScaleFilter.java \
+classpath/java/awt/image/BandCombineOp.java \
+classpath/java/awt/image/BandedSampleModel.java \
+classpath/java/awt/image/BufferStrategy.java \
+classpath/java/awt/image/BufferedImage.java \
+classpath/java/awt/image/BufferedImageFilter.java \
+classpath/java/awt/image/BufferedImageOp.java \
+classpath/java/awt/image/ByteLookupTable.java \
+classpath/java/awt/image/ColorConvertOp.java \
+classpath/java/awt/image/ColorModel.java \
+classpath/java/awt/image/ComponentColorModel.java \
+classpath/java/awt/image/ComponentSampleModel.java \
+classpath/java/awt/image/ConvolveOp.java \
+classpath/java/awt/image/CropImageFilter.java \
+classpath/java/awt/image/DataBuffer.java \
+classpath/java/awt/image/DataBufferByte.java \
+classpath/java/awt/image/DataBufferDouble.java \
+classpath/java/awt/image/DataBufferFloat.java \
+classpath/java/awt/image/DataBufferInt.java \
+classpath/java/awt/image/DataBufferShort.java \
+classpath/java/awt/image/DataBufferUShort.java \
+classpath/java/awt/image/DirectColorModel.java \
+classpath/java/awt/image/FilteredImageSource.java \
+classpath/java/awt/image/ImageConsumer.java \
+classpath/java/awt/image/ImageFilter.java \
+classpath/java/awt/image/ImageObserver.java \
+classpath/java/awt/image/ImageProducer.java \
+classpath/java/awt/image/ImagingOpException.java \
+classpath/java/awt/image/IndexColorModel.java \
+classpath/java/awt/image/Kernel.java \
+classpath/java/awt/image/LookupOp.java \
+classpath/java/awt/image/LookupTable.java \
+classpath/java/awt/image/MemoryImageSource.java \
+classpath/java/awt/image/MultiPixelPackedSampleModel.java \
+classpath/java/awt/image/PackedColorModel.java \
+classpath/java/awt/image/PixelGrabber.java \
+classpath/java/awt/image/PixelInterleavedSampleModel.java \
+classpath/java/awt/image/RGBImageFilter.java \
+classpath/java/awt/image/Raster.java \
+classpath/java/awt/image/RasterFormatException.java \
+classpath/java/awt/image/RasterOp.java \
+classpath/java/awt/image/RenderedImage.java \
+classpath/java/awt/image/ReplicateScaleFilter.java \
+classpath/java/awt/image/RescaleOp.java \
+classpath/java/awt/image/SampleModel.java \
+classpath/java/awt/image/ShortLookupTable.java \
+classpath/java/awt/image/SinglePixelPackedSampleModel.java \
+classpath/java/awt/image/TileObserver.java \
+classpath/java/awt/image/VolatileImage.java \
+classpath/java/awt/image/WritableRaster.java \
+classpath/java/awt/image/WritableRenderedImage.java
+
+java_awt_image_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_image_source_files)))
+
+java/awt/image.list: $(java_awt_image_source_files)
+ @for file in $(java_awt_image_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/image.list
+
+-include java/awt/image.deps
+
+
+java_awt_image_renderable_source_files = \
+classpath/java/awt/image/renderable/ContextualRenderedImageFactory.java \
+classpath/java/awt/image/renderable/ParameterBlock.java \
+classpath/java/awt/image/renderable/RenderContext.java \
+classpath/java/awt/image/renderable/RenderableImage.java \
+classpath/java/awt/image/renderable/RenderableImageOp.java \
+classpath/java/awt/image/renderable/RenderableImageProducer.java \
+classpath/java/awt/image/renderable/RenderedImageFactory.java
+
+java_awt_image_renderable_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_image_renderable_source_files)))
+
+java/awt/image/renderable.list: $(java_awt_image_renderable_source_files)
+ @for file in $(java_awt_image_renderable_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/image/renderable.list
+
+-include java/awt/image/renderable.deps
+
+
+java_awt_peer_source_files = \
+classpath/java/awt/peer/ButtonPeer.java \
+classpath/java/awt/peer/CanvasPeer.java \
+classpath/java/awt/peer/CheckboxMenuItemPeer.java \
+classpath/java/awt/peer/CheckboxPeer.java \
+classpath/java/awt/peer/ChoicePeer.java \
+classpath/java/awt/peer/ComponentPeer.java \
+classpath/java/awt/peer/ContainerPeer.java \
+classpath/java/awt/peer/DialogPeer.java \
+classpath/java/awt/peer/FileDialogPeer.java \
+classpath/java/awt/peer/FontPeer.java \
+classpath/java/awt/peer/FramePeer.java \
+classpath/java/awt/peer/LabelPeer.java \
+classpath/java/awt/peer/LightweightPeer.java \
+classpath/java/awt/peer/ListPeer.java \
+classpath/java/awt/peer/MenuBarPeer.java \
+classpath/java/awt/peer/MenuComponentPeer.java \
+classpath/java/awt/peer/MenuItemPeer.java \
+classpath/java/awt/peer/MenuPeer.java \
+classpath/java/awt/peer/PanelPeer.java \
+classpath/java/awt/peer/PopupMenuPeer.java \
+classpath/java/awt/peer/RobotPeer.java \
+classpath/java/awt/peer/ScrollPanePeer.java \
+classpath/java/awt/peer/ScrollbarPeer.java \
+classpath/java/awt/peer/TextAreaPeer.java \
+classpath/java/awt/peer/TextComponentPeer.java \
+classpath/java/awt/peer/TextFieldPeer.java \
+classpath/java/awt/peer/WindowPeer.java
+
+java_awt_peer_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_peer_source_files)))
+
+java/awt/peer.list: $(java_awt_peer_source_files)
+ @for file in $(java_awt_peer_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/peer.list
+
+-include java/awt/peer.deps
+
+
+java_awt_print_source_files = \
+classpath/java/awt/print/Book.java \
+classpath/java/awt/print/PageFormat.java \
+classpath/java/awt/print/Pageable.java \
+classpath/java/awt/print/Paper.java \
+classpath/java/awt/print/Printable.java \
+classpath/java/awt/print/PrinterAbortException.java \
+classpath/java/awt/print/PrinterException.java \
+classpath/java/awt/print/PrinterGraphics.java \
+classpath/java/awt/print/PrinterIOException.java \
+classpath/java/awt/print/PrinterJob.java
+
+java_awt_print_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_awt_print_source_files)))
+
+java/awt/print.list: $(java_awt_print_source_files)
+ @for file in $(java_awt_print_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/awt/print.list
+
+-include java/awt/print.deps
+
+
+java_beans_source_files = \
+classpath/java/beans/AppletInitializer.java \
+classpath/java/beans/BeanDescriptor.java \
+classpath/java/beans/BeanInfo.java \
+classpath/java/beans/Beans.java \
+classpath/java/beans/Customizer.java \
+classpath/java/beans/DesignMode.java \
+classpath/java/beans/EventHandler.java \
+classpath/java/beans/EventSetDescriptor.java \
+classpath/java/beans/ExceptionListener.java \
+classpath/java/beans/Expression.java \
+classpath/java/beans/FeatureDescriptor.java \
+classpath/java/beans/IndexedPropertyDescriptor.java \
+classpath/java/beans/IntrospectionException.java \
+classpath/java/beans/Introspector.java \
+classpath/java/beans/MethodDescriptor.java \
+classpath/java/beans/ParameterDescriptor.java \
+classpath/java/beans/PropertyChangeEvent.java \
+classpath/java/beans/PropertyChangeListener.java \
+classpath/java/beans/PropertyChangeListenerProxy.java \
+classpath/java/beans/PropertyChangeSupport.java \
+classpath/java/beans/PropertyDescriptor.java \
+classpath/java/beans/PropertyEditor.java \
+classpath/java/beans/PropertyEditorManager.java \
+classpath/java/beans/PropertyEditorSupport.java \
+classpath/java/beans/PropertyVetoException.java \
+classpath/java/beans/SimpleBeanInfo.java \
+classpath/java/beans/Statement.java \
+classpath/java/beans/VetoableChangeListener.java \
+classpath/java/beans/VetoableChangeListenerProxy.java \
+classpath/java/beans/VetoableChangeSupport.java \
+classpath/java/beans/Visibility.java \
+classpath/java/beans/XMLDecoder.java
+
+java_beans_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_beans_source_files)))
+
+java/beans.list: $(java_beans_source_files)
+ @for file in $(java_beans_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/beans.list
+
+-include java/beans.deps
+
+
+java_beans_beancontext_source_files = \
+classpath/java/beans/beancontext/BeanContext.java \
+classpath/java/beans/beancontext/BeanContextChild.java \
+classpath/java/beans/beancontext/BeanContextChildComponentProxy.java \
+classpath/java/beans/beancontext/BeanContextChildSupport.java \
+classpath/java/beans/beancontext/BeanContextContainerProxy.java \
+classpath/java/beans/beancontext/BeanContextEvent.java \
+classpath/java/beans/beancontext/BeanContextMembershipEvent.java \
+classpath/java/beans/beancontext/BeanContextMembershipListener.java \
+classpath/java/beans/beancontext/BeanContextProxy.java \
+classpath/java/beans/beancontext/BeanContextServiceAvailableEvent.java \
+classpath/java/beans/beancontext/BeanContextServiceProvider.java \
+classpath/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java \
+classpath/java/beans/beancontext/BeanContextServiceRevokedEvent.java \
+classpath/java/beans/beancontext/BeanContextServiceRevokedListener.java \
+classpath/java/beans/beancontext/BeanContextServices.java \
+classpath/java/beans/beancontext/BeanContextServicesListener.java \
+classpath/java/beans/beancontext/BeanContextServicesSupport.java \
+classpath/java/beans/beancontext/BeanContextSupport.java
+
+java_beans_beancontext_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_beans_beancontext_source_files)))
+
+java/beans/beancontext.list: $(java_beans_beancontext_source_files)
+ @for file in $(java_beans_beancontext_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/beans/beancontext.list
+
+-include java/beans/beancontext.deps
+
+
+java_io_source_files = \
+java/io/BufferedInputStream.java \
+classpath/java/io/BufferedOutputStream.java \
+classpath/java/io/BufferedReader.java \
+classpath/java/io/BufferedWriter.java \
+classpath/java/io/ByteArrayInputStream.java \
+classpath/java/io/ByteArrayOutputStream.java \
+classpath/java/io/CharArrayReader.java \
+classpath/java/io/CharArrayWriter.java \
+classpath/java/io/CharConversionException.java \
+classpath/java/io/Closeable.java \
+classpath/java/io/DataInput.java \
+classpath/java/io/DataInputStream.java \
+classpath/java/io/DataOutput.java \
+classpath/java/io/DataOutputStream.java \
+classpath/java/io/DeleteFileHelper.java \
+classpath/java/io/EOFException.java \
+classpath/java/io/Externalizable.java \
+java/io/File.java \
+classpath/java/io/FileDescriptor.java \
+classpath/java/io/FileFilter.java \
+java/io/FileInputStream.java \
+classpath/java/io/FileNotFoundException.java \
+java/io/FileOutputStream.java \
+classpath/java/io/FilePermission.java \
+classpath/java/io/FileReader.java \
+classpath/java/io/FileWriter.java \
+classpath/java/io/FilenameFilter.java \
+classpath/java/io/FilterInputStream.java \
+classpath/java/io/FilterOutputStream.java \
+classpath/java/io/FilterReader.java \
+classpath/java/io/FilterWriter.java \
+classpath/java/io/Flushable.java \
+classpath/java/io/IOException.java \
+classpath/java/io/InputStream.java \
+java/io/InputStreamReader.java \
+classpath/java/io/InterruptedIOException.java \
+classpath/java/io/InvalidClassException.java \
+classpath/java/io/InvalidObjectException.java \
+classpath/java/io/LineNumberInputStream.java \
+classpath/java/io/LineNumberReader.java \
+classpath/java/io/NotActiveException.java \
+classpath/java/io/NotSerializableException.java \
+classpath/java/io/ObjectInput.java \
+java/io/ObjectInputStream.java \
+classpath/java/io/ObjectInputValidation.java \
+classpath/java/io/ObjectOutput.java \
+classpath/java/io/ObjectOutputStream.java \
+java/io/ObjectStreamClass.java \
+classpath/java/io/ObjectStreamConstants.java \
+classpath/java/io/ObjectStreamException.java \
+classpath/java/io/ObjectStreamField.java \
+classpath/java/io/OptionalDataException.java \
+classpath/java/io/OutputStream.java \
+java/io/OutputStreamWriter.java \
+classpath/java/io/PipedInputStream.java \
+classpath/java/io/PipedOutputStream.java \
+classpath/java/io/PipedReader.java \
+classpath/java/io/PipedWriter.java \
+java/io/PrintStream.java \
+classpath/java/io/PrintWriter.java \
+classpath/java/io/PushbackInputStream.java \
+classpath/java/io/PushbackReader.java \
+java/io/RandomAccessFile.java \
+classpath/java/io/Reader.java \
+classpath/java/io/SequenceInputStream.java \
+classpath/java/io/Serializable.java \
+classpath/java/io/SerializablePermission.java \
+classpath/java/io/StreamCorruptedException.java \
+classpath/java/io/StreamTokenizer.java \
+classpath/java/io/StringBufferInputStream.java \
+classpath/java/io/StringReader.java \
+classpath/java/io/StringWriter.java \
+classpath/java/io/SyncFailedException.java \
+classpath/java/io/UTFDataFormatException.java \
+classpath/java/io/UnsupportedEncodingException.java \
+java/io/VMObjectStreamClass.java \
+classpath/java/io/WriteAbortedException.java \
+classpath/java/io/Writer.java
+
+java_io_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_io_source_files))))
+
+java/io.list: $(java_io_source_files)
+ @for file in $(java_io_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/io.list
+
+-include java/io.deps
+
+
+java_lang_source_files = \
+classpath/java/lang/AbstractMethodError.java \
+classpath/java/lang/Appendable.java \
+classpath/java/lang/ArithmeticException.java \
+classpath/java/lang/ArrayIndexOutOfBoundsException.java \
+classpath/java/lang/ArrayStoreException.java \
+classpath/java/lang/AssertionError.java \
+classpath/java/lang/Boolean.java \
+classpath/java/lang/Byte.java \
+classpath/java/lang/CharSequence.java \
+java/lang/Character.java \
+classpath/java/lang/ClassCastException.java \
+classpath/java/lang/ClassCircularityError.java \
+classpath/java/lang/ClassFormatError.java \
+java/lang/ClassLoader.java \
+classpath/java/lang/ClassNotFoundException.java \
+classpath/java/lang/CloneNotSupportedException.java \
+classpath/java/lang/Cloneable.java \
+classpath/java/lang/Comparable.java \
+classpath/java/lang/Compiler.java \
+java/lang/ConcreteProcess.java \
+java/lang/Double.java \
+classpath/java/lang/Error.java \
+classpath/java/lang/Exception.java \
+classpath/java/lang/ExceptionInInitializerError.java \
+java/lang/Float.java \
+classpath/java/lang/IllegalAccessError.java \
+classpath/java/lang/IllegalAccessException.java \
+classpath/java/lang/IllegalArgumentException.java \
+classpath/java/lang/IllegalMonitorStateException.java \
+classpath/java/lang/IllegalStateException.java \
+classpath/java/lang/IllegalThreadStateException.java \
+classpath/java/lang/IncompatibleClassChangeError.java \
+classpath/java/lang/IndexOutOfBoundsException.java \
+java/lang/InheritableThreadLocal.java \
+classpath/java/lang/InstantiationError.java \
+classpath/java/lang/InstantiationException.java \
+classpath/java/lang/Integer.java \
+classpath/java/lang/InternalError.java \
+classpath/java/lang/InterruptedException.java \
+classpath/java/lang/LinkageError.java \
+classpath/java/lang/Long.java \
+classpath/java/lang/Math.java \
+classpath/java/lang/NegativeArraySizeException.java \
+classpath/java/lang/NoClassDefFoundError.java \
+classpath/java/lang/NoSuchFieldError.java \
+classpath/java/lang/NoSuchFieldException.java \
+classpath/java/lang/NoSuchMethodError.java \
+classpath/java/lang/NoSuchMethodException.java \
+classpath/java/lang/NullPointerException.java \
+classpath/java/lang/Number.java \
+classpath/java/lang/NumberFormatException.java \
+classpath/java/lang/OutOfMemoryError.java \
+java/lang/Package.java \
+classpath/java/lang/Process.java \
+classpath/java/lang/Readable.java \
+classpath/java/lang/Runnable.java \
+java/lang/Runtime.java \
+classpath/java/lang/RuntimeException.java \
+classpath/java/lang/RuntimePermission.java \
+classpath/java/lang/SecurityException.java \
+java/lang/SecurityManager.java \
+classpath/java/lang/Short.java \
+classpath/java/lang/StackOverflowError.java \
+classpath/java/lang/StackTraceElement.java \
+classpath/java/lang/StrictMath.java \
+java/lang/String.java \
+java/lang/StringBuffer.java \
+java/lang/StringBuilder.java \
+classpath/java/lang/StringIndexOutOfBoundsException.java \
+java/lang/System.java \
+java/lang/Thread.java \
+classpath/java/lang/ThreadDeath.java \
+classpath/java/lang/ThreadGroup.java \
+java/lang/ThreadLocal.java \
+classpath/java/lang/Throwable.java \
+classpath/java/lang/TypeNotPresentException.java \
+classpath/java/lang/UnknownError.java \
+classpath/java/lang/UnsatisfiedLinkError.java \
+classpath/java/lang/UnsupportedClassVersionError.java \
+classpath/java/lang/UnsupportedOperationException.java \
+java/lang/VMClassLoader.java \
+java/lang/VMCompiler.java \
+java/lang/VMSecurityManager.java \
+java/lang/VMThrowable.java \
+classpath/java/lang/VerifyError.java \
+classpath/java/lang/VirtualMachineError.java \
+classpath/java/lang/Void.java
+
+java_lang_header_files = $(filter-out java/lang/Object.h java/lang/Class.h,$(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_lang_source_files)))))
+
+java/lang.list: $(java_lang_source_files)
+ @for file in $(java_lang_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/lang.list
+
+-include java/lang.deps
+
+
+java_lang_annotation_source_files = \
+classpath/java/lang/annotation/AnnotationFormatError.java \
+classpath/java/lang/annotation/AnnotationTypeMismatchException.java
+
+java_lang_annotation_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_lang_annotation_source_files)))
+
+java/lang/annotation.list: $(java_lang_annotation_source_files)
+ @for file in $(java_lang_annotation_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/lang/annotation.list
+
+-include java/lang/annotation.deps
+
+
+java_lang_ref_source_files = \
+classpath/java/lang/ref/PhantomReference.java \
+java/lang/ref/Reference.java \
+classpath/java/lang/ref/ReferenceQueue.java \
+classpath/java/lang/ref/SoftReference.java \
+classpath/java/lang/ref/WeakReference.java
+
+java_lang_ref_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_lang_ref_source_files))))
+
+java/lang/ref.list: $(java_lang_ref_source_files)
+ @for file in $(java_lang_ref_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/lang/ref.list
+
+-include java/lang/ref.deps
+
+
+java_lang_reflect_source_files = \
+classpath/java/lang/reflect/AccessibleObject.java \
+java/lang/reflect/Array.java \
+java/lang/reflect/Constructor.java \
+java/lang/reflect/Field.java \
+classpath/java/lang/reflect/GenericArrayType.java \
+classpath/java/lang/reflect/GenericSignatureFormatError.java \
+classpath/java/lang/reflect/InvocationHandler.java \
+classpath/java/lang/reflect/InvocationTargetException.java \
+classpath/java/lang/reflect/Member.java \
+java/lang/reflect/Method.java \
+java/lang/reflect/Modifier.java \
+classpath/java/lang/reflect/ParameterizedType.java \
+classpath/java/lang/reflect/Proxy.java \
+classpath/java/lang/reflect/ReflectPermission.java \
+classpath/java/lang/reflect/Type.java \
+classpath/java/lang/reflect/UndeclaredThrowableException.java \
+classpath/java/lang/reflect/WildcardType.java
+
+java_lang_reflect_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_lang_reflect_source_files))))
+
+java/lang/reflect.list: $(java_lang_reflect_source_files)
+ @for file in $(java_lang_reflect_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/lang/reflect.list
+
+-include java/lang/reflect.deps
+
+
+java_math_source_files = \
+classpath/java/math/BigDecimal.java \
+classpath/java/math/BigInteger.java
+
+java_math_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_math_source_files)))
+
+java/math.list: $(java_math_source_files)
+ @for file in $(java_math_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/math.list
+
+-include java/math.deps
+
+
+java_net_source_files = \
+classpath/java/net/Authenticator.java \
+classpath/java/net/BindException.java \
+classpath/java/net/ConnectException.java \
+classpath/java/net/ContentHandler.java \
+classpath/java/net/ContentHandlerFactory.java \
+classpath/java/net/DatagramPacket.java \
+classpath/java/net/DatagramSocket.java \
+classpath/java/net/DatagramSocketImpl.java \
+classpath/java/net/DatagramSocketImplFactory.java \
+classpath/java/net/FileNameMap.java \
+classpath/java/net/HttpURLConnection.java \
+classpath/java/net/Inet4Address.java \
+classpath/java/net/Inet6Address.java \
+java/net/InetAddress.java \
+classpath/java/net/InetSocketAddress.java \
+java/net/JarURLConnection.java \
+classpath/java/net/MalformedURLException.java \
+classpath/java/net/MimeTypeMapper.java \
+classpath/java/net/MulticastSocket.java \
+classpath/java/net/NetPermission.java \
+classpath/java/net/NetworkInterface.java \
+classpath/java/net/NoRouteToHostException.java \
+classpath/java/net/PasswordAuthentication.java \
+classpath/java/net/PortUnreachableException.java \
+classpath/java/net/ProtocolException.java \
+java/net/ServerSocket.java \
+classpath/java/net/Socket.java \
+classpath/java/net/SocketAddress.java \
+classpath/java/net/SocketException.java \
+classpath/java/net/SocketImpl.java \
+classpath/java/net/SocketImplFactory.java \
+classpath/java/net/SocketOptions.java \
+classpath/java/net/SocketPermission.java \
+classpath/java/net/SocketTimeoutException.java \
+classpath/java/net/URI.java \
+classpath/java/net/URISyntaxException.java \
+java/net/URL.java \
+java/net/URLClassLoader.java \
+java/net/URLConnection.java \
+classpath/java/net/URLDecoder.java \
+classpath/java/net/URLEncoder.java \
+classpath/java/net/URLStreamHandler.java \
+classpath/java/net/URLStreamHandlerFactory.java \
+classpath/java/net/UnknownHostException.java \
+classpath/java/net/UnknownServiceException.java \
+java/net/VMNetworkInterface.java
+
+java_net_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_net_source_files))))
+
+java/net.list: $(java_net_source_files)
+ @for file in $(java_net_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/net.list
+
+-include java/net.deps
+
+
+java_nio_source_files = \
+java/nio/Buffer.java \
+classpath/java/nio/BufferOverflowException.java \
+classpath/java/nio/BufferUnderflowException.java \
+classpath/java/nio/ByteBuffer.java \
+classpath/java/nio/ByteBufferHelper.java \
+classpath/java/nio/ByteBufferImpl.java \
+classpath/java/nio/ByteOrder.java \
+classpath/java/nio/CharBuffer.java \
+classpath/java/nio/CharBufferImpl.java \
+classpath/java/nio/CharViewBufferImpl.java \
+java/nio/DirectByteBufferImpl.java \
+classpath/java/nio/DoubleBuffer.java \
+classpath/java/nio/DoubleBufferImpl.java \
+classpath/java/nio/DoubleViewBufferImpl.java \
+classpath/java/nio/FloatBuffer.java \
+classpath/java/nio/FloatBufferImpl.java \
+classpath/java/nio/FloatViewBufferImpl.java \
+classpath/java/nio/IntBuffer.java \
+classpath/java/nio/IntBufferImpl.java \
+classpath/java/nio/IntViewBufferImpl.java \
+classpath/java/nio/InvalidMarkException.java \
+classpath/java/nio/LongBuffer.java \
+classpath/java/nio/LongBufferImpl.java \
+classpath/java/nio/LongViewBufferImpl.java \
+java/nio/MappedByteBuffer.java \
+java/nio/MappedByteBufferImpl.java \
+classpath/java/nio/ReadOnlyBufferException.java \
+classpath/java/nio/ShortBuffer.java \
+classpath/java/nio/ShortBufferImpl.java \
+classpath/java/nio/ShortViewBufferImpl.java \
+java/nio/VMDirectByteBuffer.java
+
+java_nio_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_nio_source_files))))
+
+java/nio.list: $(java_nio_source_files)
+ @for file in $(java_nio_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/nio.list
+
+-include java/nio.deps
+
+
+java_nio_channels_source_files = \
+classpath/java/nio/channels/AlreadyConnectedException.java \
+classpath/java/nio/channels/AsynchronousCloseException.java \
+classpath/java/nio/channels/ByteChannel.java \
+classpath/java/nio/channels/CancelledKeyException.java \
+classpath/java/nio/channels/Channel.java \
+java/nio/channels/Channels.java \
+classpath/java/nio/channels/ClosedByInterruptException.java \
+classpath/java/nio/channels/ClosedChannelException.java \
+classpath/java/nio/channels/ClosedSelectorException.java \
+classpath/java/nio/channels/ConnectionPendingException.java \
+classpath/java/nio/channels/DatagramChannel.java \
+classpath/java/nio/channels/FileChannel.java \
+classpath/java/nio/channels/FileLock.java \
+classpath/java/nio/channels/FileLockInterruptionException.java \
+classpath/java/nio/channels/GatheringByteChannel.java \
+classpath/java/nio/channels/IllegalBlockingModeException.java \
+classpath/java/nio/channels/IllegalSelectorException.java \
+classpath/java/nio/channels/InterruptibleChannel.java \
+classpath/java/nio/channels/NoConnectionPendingException.java \
+classpath/java/nio/channels/NonReadableChannelException.java \
+classpath/java/nio/channels/NonWritableChannelException.java \
+classpath/java/nio/channels/NotYetBoundException.java \
+classpath/java/nio/channels/NotYetConnectedException.java \
+classpath/java/nio/channels/OverlappingFileLockException.java \
+classpath/java/nio/channels/Pipe.java \
+classpath/java/nio/channels/ReadableByteChannel.java \
+classpath/java/nio/channels/ScatteringByteChannel.java \
+classpath/java/nio/channels/SelectableChannel.java \
+classpath/java/nio/channels/SelectionKey.java \
+classpath/java/nio/channels/Selector.java \
+classpath/java/nio/channels/ServerSocketChannel.java \
+classpath/java/nio/channels/SocketChannel.java \
+classpath/java/nio/channels/UnresolvedAddressException.java \
+classpath/java/nio/channels/UnsupportedAddressTypeException.java \
+classpath/java/nio/channels/WritableByteChannel.java
+
+java_nio_channels_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_nio_channels_source_files))))
+
+java/nio/channels.list: $(java_nio_channels_source_files)
+ @for file in $(java_nio_channels_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/nio/channels.list
+
+-include java/nio/channels.deps
+
+
+java_nio_channels_spi_source_files = \
+classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java \
+classpath/java/nio/channels/spi/AbstractSelectableChannel.java \
+classpath/java/nio/channels/spi/AbstractSelectionKey.java \
+classpath/java/nio/channels/spi/AbstractSelector.java \
+classpath/java/nio/channels/spi/SelectorProvider.java
+
+java_nio_channels_spi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_nio_channels_spi_source_files)))
+
+java/nio/channels/spi.list: $(java_nio_channels_spi_source_files)
+ @for file in $(java_nio_channels_spi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/nio/channels/spi.list
+
+-include java/nio/channels/spi.deps
+
+
+java_nio_charset_source_files = \
+classpath/java/nio/charset/CharacterCodingException.java \
+java/nio/charset/Charset.java \
+classpath/java/nio/charset/CharsetDecoder.java \
+classpath/java/nio/charset/CharsetEncoder.java \
+classpath/java/nio/charset/CoderMalfunctionError.java \
+classpath/java/nio/charset/CoderResult.java \
+classpath/java/nio/charset/CodingErrorAction.java \
+classpath/java/nio/charset/IllegalCharsetNameException.java \
+classpath/java/nio/charset/MalformedInputException.java \
+classpath/java/nio/charset/UnmappableCharacterException.java \
+classpath/java/nio/charset/UnsupportedCharsetException.java
+
+java_nio_charset_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_nio_charset_source_files))))
+
+java/nio/charset.list: $(java_nio_charset_source_files)
+ @for file in $(java_nio_charset_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/nio/charset.list
+
+-include java/nio/charset.deps
+
+
+java_nio_charset_spi_source_files = \
+classpath/java/nio/charset/spi/CharsetProvider.java
+
+java_nio_charset_spi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_nio_charset_spi_source_files)))
+
+java/nio/charset/spi.list: $(java_nio_charset_spi_source_files)
+ @for file in $(java_nio_charset_spi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/nio/charset/spi.list
+
+-include java/nio/charset/spi.deps
+
+
+java_rmi_source_files = \
+classpath/java/rmi/AccessException.java \
+classpath/java/rmi/AlreadyBoundException.java \
+classpath/java/rmi/ConnectException.java \
+classpath/java/rmi/ConnectIOException.java \
+classpath/java/rmi/MarshalException.java \
+classpath/java/rmi/MarshalledObject.java \
+classpath/java/rmi/Naming.java \
+classpath/java/rmi/NoSuchObjectException.java \
+classpath/java/rmi/NotBoundException.java \
+classpath/java/rmi/RMISecurityException.java \
+classpath/java/rmi/RMISecurityManager.java \
+classpath/java/rmi/Remote.java \
+classpath/java/rmi/RemoteException.java \
+classpath/java/rmi/ServerError.java \
+classpath/java/rmi/ServerException.java \
+classpath/java/rmi/ServerRuntimeException.java \
+classpath/java/rmi/StubNotFoundException.java \
+classpath/java/rmi/UnexpectedException.java \
+classpath/java/rmi/UnknownHostException.java \
+classpath/java/rmi/UnmarshalException.java
+
+java_rmi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_rmi_source_files)))
+
+java/rmi.list: $(java_rmi_source_files)
+ @for file in $(java_rmi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/rmi.list
+
+-include java/rmi.deps
+
+
+java_rmi_activation_source_files = \
+classpath/java/rmi/activation/Activatable.java \
+classpath/java/rmi/activation/ActivateFailedException.java \
+classpath/java/rmi/activation/ActivationDesc.java \
+classpath/java/rmi/activation/ActivationException.java \
+classpath/java/rmi/activation/ActivationGroup.java \
+classpath/java/rmi/activation/ActivationGroupDesc.java \
+classpath/java/rmi/activation/ActivationGroupID.java \
+classpath/java/rmi/activation/ActivationID.java \
+classpath/java/rmi/activation/ActivationInstantiator.java \
+classpath/java/rmi/activation/ActivationMonitor.java \
+classpath/java/rmi/activation/ActivationSystem.java \
+classpath/java/rmi/activation/Activator.java \
+classpath/java/rmi/activation/UnknownGroupException.java \
+classpath/java/rmi/activation/UnknownObjectException.java
+
+java_rmi_activation_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_rmi_activation_source_files)))
+
+java/rmi/activation.list: $(java_rmi_activation_source_files)
+ @for file in $(java_rmi_activation_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/rmi/activation.list
+
+-include java/rmi/activation.deps
+
+
+java_rmi_dgc_source_files = \
+classpath/java/rmi/dgc/DGC.java \
+classpath/java/rmi/dgc/Lease.java \
+classpath/java/rmi/dgc/VMID.java
+
+java_rmi_dgc_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_rmi_dgc_source_files)))
+
+java/rmi/dgc.list: $(java_rmi_dgc_source_files)
+ @for file in $(java_rmi_dgc_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/rmi/dgc.list
+
+-include java/rmi/dgc.deps
+
+
+java_rmi_registry_source_files = \
+classpath/java/rmi/registry/LocateRegistry.java \
+classpath/java/rmi/registry/Registry.java \
+classpath/java/rmi/registry/RegistryHandler.java
+
+java_rmi_registry_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_rmi_registry_source_files)))
+
+java/rmi/registry.list: $(java_rmi_registry_source_files)
+ @for file in $(java_rmi_registry_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/rmi/registry.list
+
+-include java/rmi/registry.deps
+
+
+java_rmi_server_source_files = \
+classpath/java/rmi/server/ExportException.java \
+classpath/java/rmi/server/LoaderHandler.java \
+classpath/java/rmi/server/LogStream.java \
+classpath/java/rmi/server/ObjID.java \
+classpath/java/rmi/server/Operation.java \
+classpath/java/rmi/server/RMIClassLoader.java \
+classpath/java/rmi/server/RMIClassLoaderSpi.java \
+classpath/java/rmi/server/RMIClientSocketFactory.java \
+classpath/java/rmi/server/RMIFailureHandler.java \
+classpath/java/rmi/server/RMIServerSocketFactory.java \
+classpath/java/rmi/server/RMISocketFactory.java \
+classpath/java/rmi/server/RemoteCall.java \
+classpath/java/rmi/server/RemoteObject.java \
+classpath/java/rmi/server/RemoteRef.java \
+classpath/java/rmi/server/RemoteServer.java \
+classpath/java/rmi/server/RemoteStub.java \
+classpath/java/rmi/server/ServerCloneException.java \
+classpath/java/rmi/server/ServerNotActiveException.java \
+classpath/java/rmi/server/ServerRef.java \
+classpath/java/rmi/server/Skeleton.java \
+classpath/java/rmi/server/SkeletonMismatchException.java \
+classpath/java/rmi/server/SkeletonNotFoundException.java \
+classpath/java/rmi/server/SocketSecurityException.java \
+classpath/java/rmi/server/UID.java \
+classpath/java/rmi/server/UnicastRemoteObject.java \
+classpath/java/rmi/server/Unreferenced.java
+
+java_rmi_server_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_rmi_server_source_files)))
+
+java/rmi/server.list: $(java_rmi_server_source_files)
+ @for file in $(java_rmi_server_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/rmi/server.list
+
+-include java/rmi/server.deps
+
+
+java_security_source_files = \
+java/security/AccessControlContext.java \
+classpath/java/security/AccessControlException.java \
+java/security/AccessController.java \
+classpath/java/security/AlgorithmParameterGenerator.java \
+classpath/java/security/AlgorithmParameterGeneratorSpi.java \
+classpath/java/security/AlgorithmParameters.java \
+classpath/java/security/AlgorithmParametersSpi.java \
+classpath/java/security/AllPermission.java \
+classpath/java/security/BasicPermission.java \
+classpath/java/security/Certificate.java \
+classpath/java/security/CodeSource.java \
+classpath/java/security/DigestException.java \
+classpath/java/security/DigestInputStream.java \
+classpath/java/security/DigestOutputStream.java \
+classpath/java/security/DomainCombiner.java \
+classpath/java/security/DummyKeyPairGenerator.java \
+classpath/java/security/DummyMessageDigest.java \
+classpath/java/security/DummySignature.java \
+classpath/java/security/GeneralSecurityException.java \
+classpath/java/security/Guard.java \
+classpath/java/security/GuardedObject.java \
+classpath/java/security/Identity.java \
+classpath/java/security/IdentityScope.java \
+classpath/java/security/IntersectingDomainCombiner.java \
+classpath/java/security/InvalidAlgorithmParameterException.java \
+classpath/java/security/InvalidKeyException.java \
+classpath/java/security/InvalidParameterException.java \
+classpath/java/security/Key.java \
+classpath/java/security/KeyException.java \
+classpath/java/security/KeyFactory.java \
+classpath/java/security/KeyFactorySpi.java \
+classpath/java/security/KeyManagementException.java \
+classpath/java/security/KeyPair.java \
+classpath/java/security/KeyPairGenerator.java \
+classpath/java/security/KeyPairGeneratorSpi.java \
+classpath/java/security/KeyStore.java \
+classpath/java/security/KeyStoreException.java \
+classpath/java/security/KeyStoreSpi.java \
+classpath/java/security/MessageDigest.java \
+classpath/java/security/MessageDigestSpi.java \
+classpath/java/security/NoSuchAlgorithmException.java \
+classpath/java/security/NoSuchProviderException.java \
+classpath/java/security/Permission.java \
+classpath/java/security/PermissionCollection.java \
+classpath/java/security/Permissions.java \
+classpath/java/security/Policy.java \
+classpath/java/security/Principal.java \
+classpath/java/security/PrivateKey.java \
+classpath/java/security/PrivilegedAction.java \
+classpath/java/security/PrivilegedActionException.java \
+classpath/java/security/PrivilegedExceptionAction.java \
+classpath/java/security/ProtectionDomain.java \
+classpath/java/security/Provider.java \
+classpath/java/security/ProviderException.java \
+classpath/java/security/PublicKey.java \
+classpath/java/security/SecureClassLoader.java \
+classpath/java/security/SecureRandom.java \
+classpath/java/security/SecureRandomSpi.java \
+classpath/java/security/Security.java \
+classpath/java/security/SecurityPermission.java \
+classpath/java/security/Signature.java \
+classpath/java/security/SignatureException.java \
+classpath/java/security/SignatureSpi.java \
+classpath/java/security/SignedObject.java \
+classpath/java/security/Signer.java \
+classpath/java/security/UnrecoverableKeyException.java \
+classpath/java/security/UnresolvedPermission.java
+
+java_security_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_security_source_files))))
+
+java/security.list: $(java_security_source_files)
+ @for file in $(java_security_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/security.list
+
+-include java/security.deps
+
+
+java_security_acl_source_files = \
+classpath/java/security/acl/Acl.java \
+classpath/java/security/acl/AclEntry.java \
+classpath/java/security/acl/AclNotFoundException.java \
+classpath/java/security/acl/Group.java \
+classpath/java/security/acl/LastOwnerException.java \
+classpath/java/security/acl/NotOwnerException.java \
+classpath/java/security/acl/Owner.java \
+classpath/java/security/acl/Permission.java
+
+java_security_acl_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_security_acl_source_files)))
+
+java/security/acl.list: $(java_security_acl_source_files)
+ @for file in $(java_security_acl_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/security/acl.list
+
+-include java/security/acl.deps
+
+
+java_security_cert_source_files = \
+classpath/java/security/cert/CRL.java \
+classpath/java/security/cert/CRLException.java \
+classpath/java/security/cert/CRLSelector.java \
+classpath/java/security/cert/CertPath.java \
+classpath/java/security/cert/CertPathBuilder.java \
+classpath/java/security/cert/CertPathBuilderException.java \
+classpath/java/security/cert/CertPathBuilderResult.java \
+classpath/java/security/cert/CertPathBuilderSpi.java \
+classpath/java/security/cert/CertPathParameters.java \
+classpath/java/security/cert/CertPathValidator.java \
+classpath/java/security/cert/CertPathValidatorException.java \
+classpath/java/security/cert/CertPathValidatorResult.java \
+classpath/java/security/cert/CertPathValidatorSpi.java \
+classpath/java/security/cert/CertSelector.java \
+classpath/java/security/cert/CertStore.java \
+classpath/java/security/cert/CertStoreException.java \
+classpath/java/security/cert/CertStoreParameters.java \
+classpath/java/security/cert/CertStoreSpi.java \
+classpath/java/security/cert/Certificate.java \
+classpath/java/security/cert/CertificateEncodingException.java \
+classpath/java/security/cert/CertificateException.java \
+classpath/java/security/cert/CertificateExpiredException.java \
+classpath/java/security/cert/CertificateFactory.java \
+classpath/java/security/cert/CertificateFactorySpi.java \
+classpath/java/security/cert/CertificateNotYetValidException.java \
+classpath/java/security/cert/CertificateParsingException.java \
+classpath/java/security/cert/CollectionCertStoreParameters.java \
+classpath/java/security/cert/LDAPCertStoreParameters.java \
+classpath/java/security/cert/PKIXBuilderParameters.java \
+classpath/java/security/cert/PKIXCertPathBuilderResult.java \
+classpath/java/security/cert/PKIXCertPathChecker.java \
+classpath/java/security/cert/PKIXCertPathValidatorResult.java \
+classpath/java/security/cert/PKIXParameters.java \
+classpath/java/security/cert/PolicyNode.java \
+classpath/java/security/cert/PolicyQualifierInfo.java \
+classpath/java/security/cert/TrustAnchor.java \
+classpath/java/security/cert/X509CRL.java \
+classpath/java/security/cert/X509CRLEntry.java \
+classpath/java/security/cert/X509CRLSelector.java \
+classpath/java/security/cert/X509CertSelector.java \
+classpath/java/security/cert/X509Certificate.java \
+classpath/java/security/cert/X509Extension.java
+
+java_security_cert_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_security_cert_source_files)))
+
+java/security/cert.list: $(java_security_cert_source_files)
+ @for file in $(java_security_cert_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/security/cert.list
+
+-include java/security/cert.deps
+
+
+java_security_interfaces_source_files = \
+classpath/java/security/interfaces/DSAKey.java \
+classpath/java/security/interfaces/DSAKeyPairGenerator.java \
+classpath/java/security/interfaces/DSAParams.java \
+classpath/java/security/interfaces/DSAPrivateKey.java \
+classpath/java/security/interfaces/DSAPublicKey.java \
+classpath/java/security/interfaces/RSAKey.java \
+classpath/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java \
+classpath/java/security/interfaces/RSAPrivateCrtKey.java \
+classpath/java/security/interfaces/RSAPrivateKey.java \
+classpath/java/security/interfaces/RSAPublicKey.java
+
+java_security_interfaces_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_security_interfaces_source_files)))
+
+java/security/interfaces.list: $(java_security_interfaces_source_files)
+ @for file in $(java_security_interfaces_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/security/interfaces.list
+
+-include java/security/interfaces.deps
+
+
+java_security_spec_source_files = \
+classpath/java/security/spec/AlgorithmParameterSpec.java \
+classpath/java/security/spec/DSAParameterSpec.java \
+classpath/java/security/spec/DSAPrivateKeySpec.java \
+classpath/java/security/spec/DSAPublicKeySpec.java \
+classpath/java/security/spec/EncodedKeySpec.java \
+classpath/java/security/spec/InvalidKeySpecException.java \
+classpath/java/security/spec/InvalidParameterSpecException.java \
+classpath/java/security/spec/KeySpec.java \
+classpath/java/security/spec/PKCS8EncodedKeySpec.java \
+classpath/java/security/spec/PSSParameterSpec.java \
+classpath/java/security/spec/RSAKeyGenParameterSpec.java \
+classpath/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java \
+classpath/java/security/spec/RSAOtherPrimeInfo.java \
+classpath/java/security/spec/RSAPrivateCrtKeySpec.java \
+classpath/java/security/spec/RSAPrivateKeySpec.java \
+classpath/java/security/spec/RSAPublicKeySpec.java \
+classpath/java/security/spec/X509EncodedKeySpec.java
+
+java_security_spec_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_security_spec_source_files)))
+
+java/security/spec.list: $(java_security_spec_source_files)
+ @for file in $(java_security_spec_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/security/spec.list
+
+-include java/security/spec.deps
+
+
+java_sql_source_files = \
+classpath/java/sql/Array.java \
+classpath/java/sql/BatchUpdateException.java \
+classpath/java/sql/Blob.java \
+classpath/java/sql/CallableStatement.java \
+classpath/java/sql/Clob.java \
+classpath/java/sql/Connection.java \
+classpath/java/sql/DataTruncation.java \
+classpath/java/sql/DatabaseMetaData.java \
+classpath/java/sql/Date.java \
+classpath/java/sql/Driver.java \
+classpath/java/sql/DriverManager.java \
+classpath/java/sql/DriverPropertyInfo.java \
+classpath/java/sql/ParameterMetaData.java \
+classpath/java/sql/PreparedStatement.java \
+classpath/java/sql/Ref.java \
+classpath/java/sql/ResultSet.java \
+classpath/java/sql/ResultSetMetaData.java \
+classpath/java/sql/SQLData.java \
+classpath/java/sql/SQLException.java \
+classpath/java/sql/SQLInput.java \
+classpath/java/sql/SQLOutput.java \
+classpath/java/sql/SQLPermission.java \
+classpath/java/sql/SQLWarning.java \
+classpath/java/sql/Savepoint.java \
+classpath/java/sql/Statement.java \
+classpath/java/sql/Struct.java \
+classpath/java/sql/Time.java \
+classpath/java/sql/Timestamp.java \
+classpath/java/sql/Types.java
+
+java_sql_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_sql_source_files)))
+
+java/sql.list: $(java_sql_source_files)
+ @for file in $(java_sql_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/sql.list
+
+-include java/sql.deps
+
+
+java_text_source_files = \
+classpath/java/text/Annotation.java \
+classpath/java/text/AttributedCharacterIterator.java \
+classpath/java/text/AttributedString.java \
+classpath/java/text/AttributedStringIterator.java \
+classpath/java/text/BreakIterator.java \
+classpath/java/text/CharacterIterator.java \
+classpath/java/text/ChoiceFormat.java \
+classpath/java/text/CollationElementIterator.java \
+classpath/java/text/CollationKey.java \
+java/text/Collator.java \
+java/text/DateFormat.java \
+java/text/DateFormatSymbols.java \
+classpath/java/text/DecimalFormat.java \
+java/text/DecimalFormatSymbols.java \
+classpath/java/text/FieldPosition.java \
+classpath/java/text/Format.java \
+classpath/java/text/MessageFormat.java \
+classpath/java/text/NumberFormat.java \
+classpath/java/text/ParseException.java \
+classpath/java/text/ParsePosition.java \
+classpath/java/text/RuleBasedCollator.java \
+java/text/SimpleDateFormat.java \
+classpath/java/text/StringCharacterIterator.java
+
+java_text_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_text_source_files))))
+
+java/text.list: $(java_text_source_files)
+ @for file in $(java_text_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/text.list
+
+-include java/text.deps
+
+
+java_util_source_files = \
+classpath/java/util/AbstractCollection.java \
+classpath/java/util/AbstractList.java \
+classpath/java/util/AbstractMap.java \
+classpath/java/util/AbstractSequentialList.java \
+classpath/java/util/AbstractSet.java \
+classpath/java/util/ArrayList.java \
+classpath/java/util/Arrays.java \
+classpath/java/util/BitSet.java \
+java/util/Calendar.java \
+classpath/java/util/Collection.java \
+classpath/java/util/Collections.java \
+classpath/java/util/Comparator.java \
+classpath/java/util/ConcurrentModificationException.java \
+java/util/Currency.java \
+java/util/Date.java \
+classpath/java/util/Dictionary.java \
+classpath/java/util/EmptyStackException.java \
+classpath/java/util/Enumeration.java \
+classpath/java/util/EventListener.java \
+classpath/java/util/EventListenerProxy.java \
+classpath/java/util/EventObject.java \
+java/util/GregorianCalendar.java \
+classpath/java/util/HashMap.java \
+classpath/java/util/HashSet.java \
+classpath/java/util/Hashtable.java \
+classpath/java/util/IdentityHashMap.java \
+classpath/java/util/Iterator.java \
+classpath/java/util/LinkedHashMap.java \
+classpath/java/util/LinkedHashSet.java \
+classpath/java/util/LinkedList.java \
+classpath/java/util/List.java \
+classpath/java/util/ListIterator.java \
+classpath/java/util/ListResourceBundle.java \
+java/util/Locale.java \
+classpath/java/util/LocaleData.java \
+classpath/java/util/Map.java \
+classpath/java/util/MissingResourceException.java \
+classpath/java/util/NoSuchElementException.java \
+classpath/java/util/Observable.java \
+classpath/java/util/Observer.java \
+classpath/java/util/Properties.java \
+classpath/java/util/PropertyPermission.java \
+classpath/java/util/PropertyPermissionCollection.java \
+classpath/java/util/PropertyResourceBundle.java \
+classpath/java/util/Random.java \
+classpath/java/util/RandomAccess.java \
+java/util/ResourceBundle.java \
+classpath/java/util/Set.java \
+java/util/SimpleTimeZone.java \
+classpath/java/util/SortedMap.java \
+classpath/java/util/SortedSet.java \
+classpath/java/util/Stack.java \
+classpath/java/util/StringTokenizer.java \
+classpath/java/util/TimeZone.java \
+classpath/java/util/Timer.java \
+classpath/java/util/TimerTask.java \
+classpath/java/util/TooManyListenersException.java \
+classpath/java/util/TreeMap.java \
+classpath/java/util/TreeSet.java \
+java/util/VMTimeZone.java \
+classpath/java/util/Vector.java \
+classpath/java/util/WeakHashMap.java
+
+java_util_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_util_source_files))))
+
+java/util.list: $(java_util_source_files)
+ @for file in $(java_util_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util.list
+
+-include java/util.deps
+
+
+java_util_jar_source_files = \
+classpath/java/util/jar/Attributes.java \
+classpath/java/util/jar/JarEntry.java \
+classpath/java/util/jar/JarException.java \
+classpath/java/util/jar/JarFile.java \
+classpath/java/util/jar/JarInputStream.java \
+classpath/java/util/jar/JarOutputStream.java \
+classpath/java/util/jar/Manifest.java
+
+java_util_jar_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_util_jar_source_files)))
+
+java/util/jar.list: $(java_util_jar_source_files)
+ @for file in $(java_util_jar_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util/jar.list
+
+-include java/util/jar.deps
+
+
+java_util_logging_source_files = \
+classpath/java/util/logging/ConsoleHandler.java \
+classpath/java/util/logging/ErrorManager.java \
+classpath/java/util/logging/FileHandler.java \
+classpath/java/util/logging/Filter.java \
+classpath/java/util/logging/Formatter.java \
+classpath/java/util/logging/Handler.java \
+classpath/java/util/logging/Level.java \
+java/util/logging/LogManager.java \
+classpath/java/util/logging/LogRecord.java \
+java/util/logging/Logger.java \
+classpath/java/util/logging/LoggingPermission.java \
+classpath/java/util/logging/MemoryHandler.java \
+classpath/java/util/logging/SimpleFormatter.java \
+classpath/java/util/logging/SocketHandler.java \
+classpath/java/util/logging/StreamHandler.java \
+classpath/java/util/logging/XMLFormatter.java
+
+java_util_logging_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_util_logging_source_files))))
+
+java/util/logging.list: $(java_util_logging_source_files)
+ @for file in $(java_util_logging_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util/logging.list
+
+-include java/util/logging.deps
+
+
+java_util_prefs_source_files = \
+classpath/java/util/prefs/AbstractPreferences.java \
+classpath/java/util/prefs/BackingStoreException.java \
+classpath/java/util/prefs/InvalidPreferencesFormatException.java \
+classpath/java/util/prefs/NodeChangeEvent.java \
+classpath/java/util/prefs/NodeChangeListener.java \
+classpath/java/util/prefs/PreferenceChangeEvent.java \
+classpath/java/util/prefs/PreferenceChangeListener.java \
+classpath/java/util/prefs/Preferences.java \
+classpath/java/util/prefs/PreferencesFactory.java
+
+java_util_prefs_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_util_prefs_source_files)))
+
+java/util/prefs.list: $(java_util_prefs_source_files)
+ @for file in $(java_util_prefs_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util/prefs.list
+
+-include java/util/prefs.deps
+
+
+java_util_regex_source_files = \
+classpath/java/util/regex/Matcher.java \
+classpath/java/util/regex/Pattern.java \
+classpath/java/util/regex/PatternSyntaxException.java
+
+java_util_regex_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(java_util_regex_source_files)))
+
+java/util/regex.list: $(java_util_regex_source_files)
+ @for file in $(java_util_regex_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util/regex.list
+
+-include java/util/regex.deps
+
+
+java_util_zip_source_files = \
+classpath/java/util/zip/Adler32.java \
+classpath/java/util/zip/CRC32.java \
+classpath/java/util/zip/CheckedInputStream.java \
+classpath/java/util/zip/CheckedOutputStream.java \
+classpath/java/util/zip/Checksum.java \
+classpath/java/util/zip/DataFormatException.java \
+java/util/zip/Deflater.java \
+java/util/zip/DeflaterOutputStream.java \
+java/util/zip/GZIPInputStream.java \
+java/util/zip/GZIPOutputStream.java \
+java/util/zip/Inflater.java \
+java/util/zip/InflaterInputStream.java \
+classpath/java/util/zip/ZipConstants.java \
+java/util/zip/ZipEntry.java \
+classpath/java/util/zip/ZipException.java \
+java/util/zip/ZipFile.java \
+classpath/java/util/zip/ZipInputStream.java \
+classpath/java/util/zip/ZipOutputStream.java
+
+java_util_zip_header_files = $(patsubst classpath/%,%,$(patsubst ./%,%,$(patsubst %.java,%.h,$(java_util_zip_source_files))))
+
+java/util/zip.list: $(java_util_zip_source_files)
+ @for file in $(java_util_zip_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > java/util/zip.list
+
+-include java/util/zip.deps
+
+
+javax_accessibility_source_files = \
+classpath/javax/accessibility/Accessible.java \
+classpath/javax/accessibility/AccessibleAction.java \
+classpath/javax/accessibility/AccessibleBundle.java \
+classpath/javax/accessibility/AccessibleComponent.java \
+classpath/javax/accessibility/AccessibleContext.java \
+classpath/javax/accessibility/AccessibleEditableText.java \
+classpath/javax/accessibility/AccessibleExtendedComponent.java \
+classpath/javax/accessibility/AccessibleExtendedTable.java \
+classpath/javax/accessibility/AccessibleHyperlink.java \
+classpath/javax/accessibility/AccessibleHypertext.java \
+classpath/javax/accessibility/AccessibleIcon.java \
+classpath/javax/accessibility/AccessibleKeyBinding.java \
+classpath/javax/accessibility/AccessibleRelation.java \
+classpath/javax/accessibility/AccessibleRelationSet.java \
+classpath/javax/accessibility/AccessibleResourceBundle.java \
+classpath/javax/accessibility/AccessibleRole.java \
+classpath/javax/accessibility/AccessibleSelection.java \
+classpath/javax/accessibility/AccessibleState.java \
+classpath/javax/accessibility/AccessibleStateSet.java \
+classpath/javax/accessibility/AccessibleTable.java \
+classpath/javax/accessibility/AccessibleTableModelChange.java \
+classpath/javax/accessibility/AccessibleText.java \
+classpath/javax/accessibility/AccessibleValue.java
+
+javax_accessibility_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_accessibility_source_files)))
+
+javax/accessibility.list: $(javax_accessibility_source_files)
+ @for file in $(javax_accessibility_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/accessibility.list
+
+-include javax/accessibility.deps
+
+
+javax_crypto_source_files = \
+classpath/javax/crypto/BadPaddingException.java \
+classpath/javax/crypto/Cipher.java \
+classpath/javax/crypto/CipherInputStream.java \
+classpath/javax/crypto/CipherOutputStream.java \
+classpath/javax/crypto/CipherSpi.java \
+classpath/javax/crypto/EncryptedPrivateKeyInfo.java \
+classpath/javax/crypto/ExemptionMechanism.java \
+classpath/javax/crypto/ExemptionMechanismException.java \
+classpath/javax/crypto/ExemptionMechanismSpi.java \
+classpath/javax/crypto/IllegalBlockSizeException.java \
+classpath/javax/crypto/KeyAgreement.java \
+classpath/javax/crypto/KeyAgreementSpi.java \
+classpath/javax/crypto/KeyGenerator.java \
+classpath/javax/crypto/KeyGeneratorSpi.java \
+classpath/javax/crypto/Mac.java \
+classpath/javax/crypto/MacSpi.java \
+classpath/javax/crypto/NoSuchPaddingException.java \
+classpath/javax/crypto/NullCipher.java \
+classpath/javax/crypto/NullCipherImpl.java \
+classpath/javax/crypto/SealedObject.java \
+classpath/javax/crypto/SecretKey.java \
+classpath/javax/crypto/SecretKeyFactory.java \
+classpath/javax/crypto/SecretKeyFactorySpi.java \
+classpath/javax/crypto/ShortBufferException.java
+
+javax_crypto_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_crypto_source_files)))
+
+javax/crypto.list: $(javax_crypto_source_files)
+ @for file in $(javax_crypto_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/crypto.list
+
+-include javax/crypto.deps
+
+
+javax_crypto_interfaces_source_files = \
+classpath/javax/crypto/interfaces/DHKey.java \
+classpath/javax/crypto/interfaces/DHPrivateKey.java \
+classpath/javax/crypto/interfaces/DHPublicKey.java \
+classpath/javax/crypto/interfaces/PBEKey.java
+
+javax_crypto_interfaces_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_crypto_interfaces_source_files)))
+
+javax/crypto/interfaces.list: $(javax_crypto_interfaces_source_files)
+ @for file in $(javax_crypto_interfaces_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/crypto/interfaces.list
+
+-include javax/crypto/interfaces.deps
+
+
+javax_crypto_spec_source_files = \
+classpath/javax/crypto/spec/DESKeySpec.java \
+classpath/javax/crypto/spec/DESedeKeySpec.java \
+classpath/javax/crypto/spec/DHGenParameterSpec.java \
+classpath/javax/crypto/spec/DHParameterSpec.java \
+classpath/javax/crypto/spec/DHPrivateKeySpec.java \
+classpath/javax/crypto/spec/DHPublicKeySpec.java \
+classpath/javax/crypto/spec/IvParameterSpec.java \
+classpath/javax/crypto/spec/PBEKeySpec.java \
+classpath/javax/crypto/spec/PBEParameterSpec.java \
+classpath/javax/crypto/spec/RC2ParameterSpec.java \
+classpath/javax/crypto/spec/RC5ParameterSpec.java \
+classpath/javax/crypto/spec/SecretKeySpec.java
+
+javax_crypto_spec_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_crypto_spec_source_files)))
+
+javax/crypto/spec.list: $(javax_crypto_spec_source_files)
+ @for file in $(javax_crypto_spec_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/crypto/spec.list
+
+-include javax/crypto/spec.deps
+
+
+javax_imageio_source_files = \
+classpath/javax/imageio/IIOException.java \
+classpath/javax/imageio/IIOImage.java \
+classpath/javax/imageio/IIOParam.java \
+classpath/javax/imageio/IIOParamController.java \
+classpath/javax/imageio/ImageIO.java \
+classpath/javax/imageio/ImageReadParam.java \
+classpath/javax/imageio/ImageReader.java \
+classpath/javax/imageio/ImageTranscoder.java \
+classpath/javax/imageio/ImageTypeSpecifier.java \
+classpath/javax/imageio/ImageWriteParam.java \
+classpath/javax/imageio/ImageWriter.java \
+classpath/javax/imageio/event/IIOReadProgressListener.java \
+classpath/javax/imageio/event/IIOReadUpdateListener.java \
+classpath/javax/imageio/event/IIOReadWarningListener.java \
+classpath/javax/imageio/event/IIOWriteProgressListener.java \
+classpath/javax/imageio/event/IIOWriteWarningListener.java \
+classpath/javax/imageio/metadata/IIOAttr.java \
+classpath/javax/imageio/metadata/IIOInvalidTreeException.java \
+classpath/javax/imageio/metadata/IIOMetadata.java \
+classpath/javax/imageio/metadata/IIOMetadataController.java \
+classpath/javax/imageio/metadata/IIOMetadataFormat.java \
+classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java \
+classpath/javax/imageio/metadata/IIOMetadataNode.java \
+classpath/javax/imageio/metadata/IIONamedNodeMap.java \
+classpath/javax/imageio/metadata/IIONodeList.java \
+classpath/javax/imageio/spi/IIORegistry.java \
+classpath/javax/imageio/spi/IIOServiceProvider.java \
+classpath/javax/imageio/spi/ImageInputStreamSpi.java \
+classpath/javax/imageio/spi/ImageOutputStreamSpi.java \
+classpath/javax/imageio/spi/ImageReaderSpi.java \
+classpath/javax/imageio/spi/ImageReaderWriterSpi.java \
+classpath/javax/imageio/spi/ImageTranscoderSpi.java \
+classpath/javax/imageio/spi/ImageWriterSpi.java \
+classpath/javax/imageio/spi/RegisterableService.java \
+classpath/javax/imageio/spi/ServiceRegistry.java \
+classpath/javax/imageio/stream/FileCacheImageInputStream.java \
+classpath/javax/imageio/stream/FileCacheImageOutputStream.java \
+classpath/javax/imageio/stream/FileImageInputStream.java \
+classpath/javax/imageio/stream/FileImageOutputStream.java \
+classpath/javax/imageio/stream/IIOByteBuffer.java \
+classpath/javax/imageio/stream/ImageInputStream.java \
+classpath/javax/imageio/stream/ImageInputStreamImpl.java \
+classpath/javax/imageio/stream/ImageOutputStream.java \
+classpath/javax/imageio/stream/ImageOutputStreamImpl.java \
+classpath/javax/imageio/stream/MemoryCacheImageInputStream.java \
+classpath/javax/imageio/stream/MemoryCacheImageOutputStream.java
+
+javax-imageio.lo: $(javax_imageio_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o javax-imageio.lo \
+ `find classpath/lib/javax/imageio -name '*.class' | sort -r`
+
+javax_naming_source_files = \
+classpath/javax/naming/AuthenticationException.java \
+classpath/javax/naming/AuthenticationNotSupportedException.java \
+classpath/javax/naming/BinaryRefAddr.java \
+classpath/javax/naming/Binding.java \
+classpath/javax/naming/CannotProceedException.java \
+classpath/javax/naming/CommunicationException.java \
+classpath/javax/naming/CompositeName.java \
+classpath/javax/naming/CompoundName.java \
+classpath/javax/naming/ConfigurationException.java \
+classpath/javax/naming/Context.java \
+classpath/javax/naming/ContextNotEmptyException.java \
+classpath/javax/naming/InitialContext.java \
+classpath/javax/naming/InsufficientResourcesException.java \
+classpath/javax/naming/InterruptedNamingException.java \
+classpath/javax/naming/InvalidNameException.java \
+classpath/javax/naming/LimitExceededException.java \
+classpath/javax/naming/LinkException.java \
+classpath/javax/naming/LinkLoopException.java \
+classpath/javax/naming/LinkRef.java \
+classpath/javax/naming/MalformedLinkException.java \
+classpath/javax/naming/Name.java \
+classpath/javax/naming/NameAlreadyBoundException.java \
+classpath/javax/naming/NameClassPair.java \
+classpath/javax/naming/NameNotFoundException.java \
+classpath/javax/naming/NameParser.java \
+classpath/javax/naming/NamingEnumeration.java \
+classpath/javax/naming/NamingException.java \
+classpath/javax/naming/NamingSecurityException.java \
+classpath/javax/naming/NoInitialContextException.java \
+classpath/javax/naming/NoPermissionException.java \
+classpath/javax/naming/NotContextException.java \
+classpath/javax/naming/OperationNotSupportedException.java \
+classpath/javax/naming/PartialResultException.java \
+classpath/javax/naming/RefAddr.java \
+classpath/javax/naming/Reference.java \
+classpath/javax/naming/Referenceable.java \
+classpath/javax/naming/ReferralException.java \
+classpath/javax/naming/ServiceUnavailableException.java \
+classpath/javax/naming/SizeLimitExceededException.java \
+classpath/javax/naming/StringRefAddr.java \
+classpath/javax/naming/TimeLimitExceededException.java
+
+javax_naming_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_naming_source_files)))
+
+javax/naming.list: $(javax_naming_source_files)
+ @for file in $(javax_naming_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/naming.list
+
+-include javax/naming.deps
+
+
+javax_naming_directory_source_files = \
+classpath/javax/naming/directory/Attribute.java \
+classpath/javax/naming/directory/AttributeInUseException.java \
+classpath/javax/naming/directory/AttributeModificationException.java \
+classpath/javax/naming/directory/Attributes.java \
+classpath/javax/naming/directory/BasicAttribute.java \
+classpath/javax/naming/directory/BasicAttributes.java \
+classpath/javax/naming/directory/DirContext.java \
+classpath/javax/naming/directory/InitialDirContext.java \
+classpath/javax/naming/directory/InvalidAttributeIdentifierException.java \
+classpath/javax/naming/directory/InvalidAttributeValueException.java \
+classpath/javax/naming/directory/InvalidAttributesException.java \
+classpath/javax/naming/directory/InvalidSearchControlsException.java \
+classpath/javax/naming/directory/InvalidSearchFilterException.java \
+classpath/javax/naming/directory/ModificationItem.java \
+classpath/javax/naming/directory/NoSuchAttributeException.java \
+classpath/javax/naming/directory/SchemaViolationException.java \
+classpath/javax/naming/directory/SearchControls.java \
+classpath/javax/naming/directory/SearchResult.java
+
+javax_naming_directory_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_naming_directory_source_files)))
+
+javax/naming/directory.list: $(javax_naming_directory_source_files)
+ @for file in $(javax_naming_directory_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/naming/directory.list
+
+-include javax/naming/directory.deps
+
+
+javax_naming_event_source_files = \
+classpath/javax/naming/event/EventContext.java \
+classpath/javax/naming/event/EventDirContext.java \
+classpath/javax/naming/event/NamespaceChangeListener.java \
+classpath/javax/naming/event/NamingEvent.java \
+classpath/javax/naming/event/NamingExceptionEvent.java \
+classpath/javax/naming/event/NamingListener.java \
+classpath/javax/naming/event/ObjectChangeListener.java
+
+javax_naming_event_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_naming_event_source_files)))
+
+javax/naming/event.list: $(javax_naming_event_source_files)
+ @for file in $(javax_naming_event_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/naming/event.list
+
+-include javax/naming/event.deps
+
+
+javax_naming_ldap_source_files = \
+classpath/javax/naming/ldap/Control.java \
+classpath/javax/naming/ldap/ControlFactory.java \
+classpath/javax/naming/ldap/ExtendedRequest.java \
+classpath/javax/naming/ldap/ExtendedResponse.java \
+classpath/javax/naming/ldap/HasControls.java \
+classpath/javax/naming/ldap/InitialLdapContext.java \
+classpath/javax/naming/ldap/LdapContext.java \
+classpath/javax/naming/ldap/LdapReferralException.java \
+classpath/javax/naming/ldap/UnsolicitedNotification.java \
+classpath/javax/naming/ldap/UnsolicitedNotificationEvent.java \
+classpath/javax/naming/ldap/UnsolicitedNotificationListener.java
+
+javax_naming_ldap_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_naming_ldap_source_files)))
+
+javax/naming/ldap.list: $(javax_naming_ldap_source_files)
+ @for file in $(javax_naming_ldap_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/naming/ldap.list
+
+-include javax/naming/ldap.deps
+
+
+javax_naming_spi_source_files = \
+classpath/javax/naming/spi/DirObjectFactory.java \
+classpath/javax/naming/spi/DirStateFactory.java \
+classpath/javax/naming/spi/DirectoryManager.java \
+classpath/javax/naming/spi/InitialContextFactory.java \
+classpath/javax/naming/spi/InitialContextFactoryBuilder.java \
+classpath/javax/naming/spi/NamingManager.java \
+classpath/javax/naming/spi/ObjectFactory.java \
+classpath/javax/naming/spi/ObjectFactoryBuilder.java \
+classpath/javax/naming/spi/ResolveResult.java \
+classpath/javax/naming/spi/Resolver.java \
+classpath/javax/naming/spi/StateFactory.java
+
+javax_naming_spi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_naming_spi_source_files)))
+
+javax/naming/spi.list: $(javax_naming_spi_source_files)
+ @for file in $(javax_naming_spi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/naming/spi.list
+
+-include javax/naming/spi.deps
+
+
+javax_net_source_files = \
+classpath/javax/net/ServerSocketFactory.java \
+classpath/javax/net/SocketFactory.java \
+classpath/javax/net/VanillaServerSocketFactory.java \
+classpath/javax/net/VanillaSocketFactory.java
+
+javax_net_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_net_source_files)))
+
+javax/net.list: $(javax_net_source_files)
+ @for file in $(javax_net_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/net.list
+
+-include javax/net.deps
+
+
+javax_net_ssl_source_files = \
+classpath/javax/net/ssl/HandshakeCompletedEvent.java \
+classpath/javax/net/ssl/HandshakeCompletedListener.java \
+classpath/javax/net/ssl/HostnameVerifier.java \
+classpath/javax/net/ssl/HttpsURLConnection.java \
+classpath/javax/net/ssl/KeyManager.java \
+classpath/javax/net/ssl/KeyManagerFactory.java \
+classpath/javax/net/ssl/KeyManagerFactorySpi.java \
+classpath/javax/net/ssl/ManagerFactoryParameters.java \
+classpath/javax/net/ssl/SSLContext.java \
+classpath/javax/net/ssl/SSLContextSpi.java \
+classpath/javax/net/ssl/SSLException.java \
+classpath/javax/net/ssl/SSLHandshakeException.java \
+classpath/javax/net/ssl/SSLKeyException.java \
+classpath/javax/net/ssl/SSLPeerUnverifiedException.java \
+classpath/javax/net/ssl/SSLPermission.java \
+classpath/javax/net/ssl/SSLProtocolException.java \
+classpath/javax/net/ssl/SSLServerSocket.java \
+classpath/javax/net/ssl/SSLServerSocketFactory.java \
+classpath/javax/net/ssl/SSLSession.java \
+classpath/javax/net/ssl/SSLSessionBindingEvent.java \
+classpath/javax/net/ssl/SSLSessionBindingListener.java \
+classpath/javax/net/ssl/SSLSessionContext.java \
+classpath/javax/net/ssl/SSLSocket.java \
+classpath/javax/net/ssl/SSLSocketFactory.java \
+classpath/javax/net/ssl/TrivialHostnameVerifier.java \
+classpath/javax/net/ssl/TrustManager.java \
+classpath/javax/net/ssl/TrustManagerFactory.java \
+classpath/javax/net/ssl/TrustManagerFactorySpi.java \
+classpath/javax/net/ssl/X509KeyManager.java \
+classpath/javax/net/ssl/X509TrustManager.java
+
+javax_net_ssl_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_net_ssl_source_files)))
+
+javax/net/ssl.list: $(javax_net_ssl_source_files)
+ @for file in $(javax_net_ssl_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/net/ssl.list
+
+-include javax/net/ssl.deps
+
+
+javax_print_source_files = \
+classpath/javax/print/AttributeException.java \
+classpath/javax/print/CancelablePrintJob.java \
+classpath/javax/print/Doc.java \
+classpath/javax/print/DocFlavor.java \
+classpath/javax/print/DocPrintJob.java \
+classpath/javax/print/FlavorException.java \
+classpath/javax/print/MultiDoc.java \
+classpath/javax/print/MultiDocPrintJob.java \
+classpath/javax/print/MultiDocPrintService.java \
+classpath/javax/print/PrintException.java \
+classpath/javax/print/PrintService.java \
+classpath/javax/print/PrintServiceLookup.java \
+classpath/javax/print/ServiceUIFactory.java \
+classpath/javax/print/StreamPrintService.java \
+classpath/javax/print/URIException.java
+
+javax_print_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_print_source_files)))
+
+javax/print.list: $(javax_print_source_files)
+ @for file in $(javax_print_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/print.list
+
+-include javax/print.deps
+
+
+javax_print_attribute_source_files = \
+classpath/javax/print/attribute/Attribute.java \
+classpath/javax/print/attribute/AttributeSet.java \
+classpath/javax/print/attribute/AttributeSetUtilities.java \
+classpath/javax/print/attribute/DateTimeSyntax.java \
+classpath/javax/print/attribute/DocAttribute.java \
+classpath/javax/print/attribute/DocAttributeSet.java \
+classpath/javax/print/attribute/EnumSyntax.java \
+classpath/javax/print/attribute/HashAttributeSet.java \
+classpath/javax/print/attribute/HashDocAttributeSet.java \
+classpath/javax/print/attribute/HashPrintJobAttributeSet.java \
+classpath/javax/print/attribute/HashPrintRequestAttributeSet.java \
+classpath/javax/print/attribute/HashPrintServiceAttributeSet.java \
+classpath/javax/print/attribute/IntegerSyntax.java \
+classpath/javax/print/attribute/PrintJobAttribute.java \
+classpath/javax/print/attribute/PrintJobAttributeSet.java \
+classpath/javax/print/attribute/PrintRequestAttribute.java \
+classpath/javax/print/attribute/PrintRequestAttributeSet.java \
+classpath/javax/print/attribute/PrintServiceAttribute.java \
+classpath/javax/print/attribute/PrintServiceAttributeSet.java \
+classpath/javax/print/attribute/ResolutionSyntax.java \
+classpath/javax/print/attribute/SetOfIntegerSyntax.java \
+classpath/javax/print/attribute/Size2DSyntax.java \
+classpath/javax/print/attribute/SupportedValuesAttribute.java \
+classpath/javax/print/attribute/TextSyntax.java \
+classpath/javax/print/attribute/URISyntax.java \
+classpath/javax/print/attribute/UnmodifiableSetException.java
+
+javax_print_attribute_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_print_attribute_source_files)))
+
+javax/print/attribute.list: $(javax_print_attribute_source_files)
+ @for file in $(javax_print_attribute_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/print/attribute.list
+
+-include javax/print/attribute.deps
+
+
+javax_print_attribute_standard_source_files = \
+classpath/javax/print/attribute/standard/Chromaticity.java \
+classpath/javax/print/attribute/standard/ColorSupported.java \
+classpath/javax/print/attribute/standard/Compression.java \
+classpath/javax/print/attribute/standard/Copies.java \
+classpath/javax/print/attribute/standard/CopiesSupported.java \
+classpath/javax/print/attribute/standard/DateTimeAtCompleted.java \
+classpath/javax/print/attribute/standard/DateTimeAtCreation.java \
+classpath/javax/print/attribute/standard/DateTimeAtProcessing.java \
+classpath/javax/print/attribute/standard/Destination.java \
+classpath/javax/print/attribute/standard/DocumentName.java \
+classpath/javax/print/attribute/standard/Fidelity.java \
+classpath/javax/print/attribute/standard/Finishings.java \
+classpath/javax/print/attribute/standard/JobHoldUntil.java \
+classpath/javax/print/attribute/standard/JobImpressions.java \
+classpath/javax/print/attribute/standard/JobImpressionsCompleted.java \
+classpath/javax/print/attribute/standard/JobImpressionsSupported.java \
+classpath/javax/print/attribute/standard/JobKOctets.java \
+classpath/javax/print/attribute/standard/JobKOctetsProcessed.java \
+classpath/javax/print/attribute/standard/JobKOctetsSupported.java \
+classpath/javax/print/attribute/standard/JobMediaSheets.java \
+classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java \
+classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java \
+classpath/javax/print/attribute/standard/JobMessageFromOperator.java \
+classpath/javax/print/attribute/standard/JobName.java \
+classpath/javax/print/attribute/standard/JobOriginatingUserName.java \
+classpath/javax/print/attribute/standard/JobPriority.java \
+classpath/javax/print/attribute/standard/JobPrioritySupported.java \
+classpath/javax/print/attribute/standard/JobSheets.java \
+classpath/javax/print/attribute/standard/JobState.java \
+classpath/javax/print/attribute/standard/JobStateReason.java \
+classpath/javax/print/attribute/standard/JobStateReasons.java \
+classpath/javax/print/attribute/standard/Media.java \
+classpath/javax/print/attribute/standard/MediaPrintableArea.java \
+classpath/javax/print/attribute/standard/MediaSize.java \
+classpath/javax/print/attribute/standard/MediaSizeName.java \
+classpath/javax/print/attribute/standard/MultipleDocumentHandling.java \
+classpath/javax/print/attribute/standard/NumberOfDocuments.java \
+classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java \
+classpath/javax/print/attribute/standard/NumberUp.java \
+classpath/javax/print/attribute/standard/NumberUpSupported.java \
+classpath/javax/print/attribute/standard/OrientationRequested.java \
+classpath/javax/print/attribute/standard/OutputDeviceAssigned.java \
+classpath/javax/print/attribute/standard/PDLOverrideSupported.java \
+classpath/javax/print/attribute/standard/PageRanges.java \
+classpath/javax/print/attribute/standard/PagesPerMinute.java \
+classpath/javax/print/attribute/standard/PagesPerMinuteColor.java \
+classpath/javax/print/attribute/standard/PresentationDirection.java \
+classpath/javax/print/attribute/standard/PrintQuality.java \
+classpath/javax/print/attribute/standard/PrinterInfo.java \
+classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java \
+classpath/javax/print/attribute/standard/PrinterLocation.java \
+classpath/javax/print/attribute/standard/PrinterMakeAndModel.java \
+classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java \
+classpath/javax/print/attribute/standard/PrinterMoreInfo.java \
+classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java \
+classpath/javax/print/attribute/standard/PrinterName.java \
+classpath/javax/print/attribute/standard/PrinterResolution.java \
+classpath/javax/print/attribute/standard/PrinterState.java \
+classpath/javax/print/attribute/standard/PrinterStateReason.java \
+classpath/javax/print/attribute/standard/PrinterStateReasons.java \
+classpath/javax/print/attribute/standard/PrinterURI.java \
+classpath/javax/print/attribute/standard/QueuedJobCount.java \
+classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java \
+classpath/javax/print/attribute/standard/RequestingUserName.java \
+classpath/javax/print/attribute/standard/Severity.java \
+classpath/javax/print/attribute/standard/SheetCollate.java \
+classpath/javax/print/attribute/standard/Sides.java
+
+javax_print_attribute_standard_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_print_attribute_standard_source_files)))
+
+javax/print/attribute/standard.list: $(javax_print_attribute_standard_source_files)
+ @for file in $(javax_print_attribute_standard_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/print/attribute/standard.list
+
+-include javax/print/attribute/standard.deps
+
+
+javax_print_event_source_files = \
+classpath/javax/print/event/PrintEvent.java \
+classpath/javax/print/event/PrintJobAdapter.java \
+classpath/javax/print/event/PrintJobAttributeEvent.java \
+classpath/javax/print/event/PrintJobAttributeListener.java \
+classpath/javax/print/event/PrintJobEvent.java \
+classpath/javax/print/event/PrintJobListener.java \
+classpath/javax/print/event/PrintServiceAttributeEvent.java \
+classpath/javax/print/event/PrintServiceAttributeListener.java
+
+javax_print_event_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_print_event_source_files)))
+
+javax/print/event.list: $(javax_print_event_source_files)
+ @for file in $(javax_print_event_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/print/event.list
+
+-include javax/print/event.deps
+
+
+javax_security_auth_source_files = \
+classpath/javax/security/auth/AuthPermission.java \
+classpath/javax/security/auth/DestroyFailedException.java \
+classpath/javax/security/auth/Destroyable.java \
+classpath/javax/security/auth/Policy.java \
+classpath/javax/security/auth/PrivateCredentialPermission.java \
+classpath/javax/security/auth/RefreshFailedException.java \
+classpath/javax/security/auth/Refreshable.java \
+classpath/javax/security/auth/Subject.java \
+classpath/javax/security/auth/SubjectDomainCombiner.java
+
+javax_security_auth_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_auth_source_files)))
+
+javax/security/auth.list: $(javax_security_auth_source_files)
+ @for file in $(javax_security_auth_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/auth.list
+
+-include javax/security/auth.deps
+
+
+javax_security_auth_callback_source_files = \
+classpath/javax/security/auth/callback/Callback.java \
+classpath/javax/security/auth/callback/CallbackHandler.java \
+classpath/javax/security/auth/callback/ChoiceCallback.java \
+classpath/javax/security/auth/callback/ConfirmationCallback.java \
+classpath/javax/security/auth/callback/LanguageCallback.java \
+classpath/javax/security/auth/callback/NameCallback.java \
+classpath/javax/security/auth/callback/PasswordCallback.java \
+classpath/javax/security/auth/callback/TextInputCallback.java \
+classpath/javax/security/auth/callback/TextOutputCallback.java \
+classpath/javax/security/auth/callback/UnsupportedCallbackException.java
+
+javax_security_auth_callback_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_auth_callback_source_files)))
+
+javax/security/auth/callback.list: $(javax_security_auth_callback_source_files)
+ @for file in $(javax_security_auth_callback_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/auth/callback.list
+
+-include javax/security/auth/callback.deps
+
+
+javax_security_auth_login_source_files = \
+classpath/javax/security/auth/login/AccountExpiredException.java \
+classpath/javax/security/auth/login/AppConfigurationEntry.java \
+classpath/javax/security/auth/login/Configuration.java \
+classpath/javax/security/auth/login/CredentialExpiredException.java \
+classpath/javax/security/auth/login/FailedLoginException.java \
+classpath/javax/security/auth/login/LoginContext.java \
+classpath/javax/security/auth/login/LoginException.java \
+classpath/javax/security/auth/login/NullConfiguration.java
+
+javax_security_auth_login_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_auth_login_source_files)))
+
+javax/security/auth/login.list: $(javax_security_auth_login_source_files)
+ @for file in $(javax_security_auth_login_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/auth/login.list
+
+-include javax/security/auth/login.deps
+
+
+javax_security_auth_spi_source_files = \
+classpath/javax/security/auth/spi/LoginModule.java
+
+javax_security_auth_spi_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_auth_spi_source_files)))
+
+javax/security/auth/spi.list: $(javax_security_auth_spi_source_files)
+ @for file in $(javax_security_auth_spi_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/auth/spi.list
+
+-include javax/security/auth/spi.deps
+
+
+javax_security_auth_x500_source_files = \
+classpath/javax/security/auth/x500/X500Principal.java \
+classpath/javax/security/auth/x500/X500PrivateCredential.java
+
+javax_security_auth_x500_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_auth_x500_source_files)))
+
+javax/security/auth/x500.list: $(javax_security_auth_x500_source_files)
+ @for file in $(javax_security_auth_x500_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/auth/x500.list
+
+-include javax/security/auth/x500.deps
+
+
+javax_security_cert_source_files = \
+classpath/javax/security/cert/Certificate.java \
+classpath/javax/security/cert/CertificateEncodingException.java \
+classpath/javax/security/cert/CertificateException.java \
+classpath/javax/security/cert/CertificateExpiredException.java \
+classpath/javax/security/cert/CertificateNotYetValidException.java \
+classpath/javax/security/cert/CertificateParsingException.java \
+classpath/javax/security/cert/X509CertBridge.java \
+classpath/javax/security/cert/X509Certificate.java
+
+javax_security_cert_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_cert_source_files)))
+
+javax/security/cert.list: $(javax_security_cert_source_files)
+ @for file in $(javax_security_cert_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/cert.list
+
+-include javax/security/cert.deps
+
+
+javax_security_sasl_source_files = \
+classpath/javax/security/sasl/AuthenticationException.java \
+classpath/javax/security/sasl/AuthorizeCallback.java \
+classpath/javax/security/sasl/RealmCallback.java \
+classpath/javax/security/sasl/RealmChoiceCallback.java \
+classpath/javax/security/sasl/Sasl.java \
+classpath/javax/security/sasl/SaslClient.java \
+classpath/javax/security/sasl/SaslClientFactory.java \
+classpath/javax/security/sasl/SaslException.java \
+classpath/javax/security/sasl/SaslServer.java \
+classpath/javax/security/sasl/SaslServerFactory.java
+
+javax_security_sasl_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_security_sasl_source_files)))
+
+javax/security/sasl.list: $(javax_security_sasl_source_files)
+ @for file in $(javax_security_sasl_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/security/sasl.list
+
+-include javax/security/sasl.deps
+
+
+javax_sql_source_files = \
+classpath/javax/sql/ConnectionEvent.java \
+classpath/javax/sql/ConnectionEventListener.java \
+classpath/javax/sql/ConnectionPoolDataSource.java \
+classpath/javax/sql/DataSource.java \
+classpath/javax/sql/PooledConnection.java \
+classpath/javax/sql/RowSet.java \
+classpath/javax/sql/RowSetEvent.java \
+classpath/javax/sql/RowSetInternal.java \
+classpath/javax/sql/RowSetListener.java \
+classpath/javax/sql/RowSetMetaData.java \
+classpath/javax/sql/RowSetReader.java \
+classpath/javax/sql/RowSetWriter.java \
+classpath/javax/sql/XAConnection.java \
+classpath/javax/sql/XADataSource.java
+
+javax_sql_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_sql_source_files)))
+
+javax/sql.list: $(javax_sql_source_files)
+ @for file in $(javax_sql_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/sql.list
+
+-include javax/sql.deps
+
+
+javax_swing_source_files = \
+classpath/javax/swing/AbstractAction.java \
+classpath/javax/swing/AbstractButton.java \
+classpath/javax/swing/AbstractCellEditor.java \
+classpath/javax/swing/AbstractListModel.java \
+classpath/javax/swing/AbstractSpinnerModel.java \
+classpath/javax/swing/Action.java \
+classpath/javax/swing/ActionMap.java \
+classpath/javax/swing/BorderFactory.java \
+classpath/javax/swing/BoundedRangeModel.java \
+classpath/javax/swing/Box.java \
+classpath/javax/swing/BoxLayout.java \
+classpath/javax/swing/ButtonGroup.java \
+classpath/javax/swing/ButtonModel.java \
+classpath/javax/swing/CellEditor.java \
+classpath/javax/swing/CellRendererPane.java \
+classpath/javax/swing/ComboBoxEditor.java \
+classpath/javax/swing/ComboBoxModel.java \
+classpath/javax/swing/ComponentInputMap.java \
+classpath/javax/swing/DebugGraphics.java \
+classpath/javax/swing/DefaultBoundedRangeModel.java \
+classpath/javax/swing/DefaultButtonModel.java \
+classpath/javax/swing/DefaultCellEditor.java \
+classpath/javax/swing/DefaultComboBoxModel.java \
+classpath/javax/swing/DefaultDesktopManager.java \
+classpath/javax/swing/DefaultFocusManager.java \
+classpath/javax/swing/DefaultListCellRenderer.java \
+classpath/javax/swing/DefaultListModel.java \
+classpath/javax/swing/DefaultListSelectionModel.java \
+classpath/javax/swing/DefaultSingleSelectionModel.java \
+classpath/javax/swing/DesktopManager.java \
+classpath/javax/swing/FocusManager.java \
+classpath/javax/swing/GrayFilter.java \
+classpath/javax/swing/Icon.java \
+classpath/javax/swing/ImageIcon.java \
+classpath/javax/swing/InputMap.java \
+classpath/javax/swing/InputVerifier.java \
+classpath/javax/swing/InternalFrameFocusTraversalPolicy.java \
+classpath/javax/swing/JApplet.java \
+classpath/javax/swing/JButton.java \
+classpath/javax/swing/JCheckBox.java \
+classpath/javax/swing/JCheckBoxMenuItem.java \
+classpath/javax/swing/JColorChooser.java \
+classpath/javax/swing/JComboBox.java \
+classpath/javax/swing/JComponent.java \
+classpath/javax/swing/JDesktopPane.java \
+classpath/javax/swing/JDialog.java \
+classpath/javax/swing/JEditorPane.java \
+classpath/javax/swing/JFileChooser.java \
+classpath/javax/swing/JFormattedTextField.java \
+classpath/javax/swing/JFrame.java \
+classpath/javax/swing/JInternalFrame.java \
+classpath/javax/swing/JLabel.java \
+classpath/javax/swing/JLayeredPane.java \
+classpath/javax/swing/JList.java \
+classpath/javax/swing/JMenu.java \
+classpath/javax/swing/JMenuBar.java \
+classpath/javax/swing/JMenuItem.java \
+classpath/javax/swing/JOptionPane.java \
+classpath/javax/swing/JPanel.java \
+classpath/javax/swing/JPasswordField.java \
+classpath/javax/swing/JPopupMenu.java \
+classpath/javax/swing/JProgressBar.java \
+classpath/javax/swing/JRadioButton.java \
+classpath/javax/swing/JRadioButtonMenuItem.java \
+classpath/javax/swing/JRootPane.java \
+classpath/javax/swing/JScrollBar.java \
+classpath/javax/swing/JScrollPane.java \
+classpath/javax/swing/JSeparator.java \
+classpath/javax/swing/JSlider.java \
+classpath/javax/swing/JSpinner.java \
+classpath/javax/swing/JSplitPane.java \
+classpath/javax/swing/JTabbedPane.java \
+classpath/javax/swing/JTable.java \
+classpath/javax/swing/JTextArea.java \
+classpath/javax/swing/JTextField.java \
+classpath/javax/swing/JTextPane.java \
+classpath/javax/swing/JToggleButton.java \
+classpath/javax/swing/JToolBar.java \
+classpath/javax/swing/JToolTip.java \
+classpath/javax/swing/JTree.java \
+classpath/javax/swing/JViewport.java \
+classpath/javax/swing/JWindow.java \
+classpath/javax/swing/KeyStroke.java \
+classpath/javax/swing/LayoutFocusTraversalPolicy.java \
+classpath/javax/swing/ListCellRenderer.java \
+classpath/javax/swing/ListModel.java \
+classpath/javax/swing/ListSelectionModel.java \
+classpath/javax/swing/LookAndFeel.java \
+classpath/javax/swing/MenuElement.java \
+classpath/javax/swing/MenuSelectionManager.java \
+classpath/javax/swing/MutableComboBoxModel.java \
+classpath/javax/swing/OverlayLayout.java \
+classpath/javax/swing/Popup.java \
+classpath/javax/swing/PopupFactory.java \
+classpath/javax/swing/ProgressMonitor.java \
+classpath/javax/swing/ProgressMonitorInputStream.java \
+classpath/javax/swing/Renderer.java \
+classpath/javax/swing/RepaintManager.java \
+classpath/javax/swing/RootPaneContainer.java \
+classpath/javax/swing/ScrollPaneConstants.java \
+classpath/javax/swing/ScrollPaneLayout.java \
+classpath/javax/swing/Scrollable.java \
+classpath/javax/swing/SingleSelectionModel.java \
+classpath/javax/swing/SizeRequirements.java \
+classpath/javax/swing/SizeSequence.java \
+classpath/javax/swing/SortingFocusTraversalPolicy.java \
+classpath/javax/swing/SpinnerDateModel.java \
+classpath/javax/swing/SpinnerListModel.java \
+classpath/javax/swing/SpinnerModel.java \
+classpath/javax/swing/SpinnerNumberModel.java \
+classpath/javax/swing/Spring.java \
+classpath/javax/swing/SpringLayout.java \
+classpath/javax/swing/SwingConstants.java \
+classpath/javax/swing/SwingUtilities.java \
+classpath/javax/swing/Timer.java \
+classpath/javax/swing/ToolTipManager.java \
+classpath/javax/swing/TransferHandler.java \
+classpath/javax/swing/UIDefaults.java \
+classpath/javax/swing/UIManager.java \
+classpath/javax/swing/UnsupportedLookAndFeelException.java \
+classpath/javax/swing/ViewportLayout.java \
+classpath/javax/swing/WindowConstants.java
+
+javax_swing_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_source_files)))
+
+javax/swing.list: $(javax_swing_source_files)
+ @for file in $(javax_swing_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing.list
+
+-include javax/swing.deps
+
+
+javax_swing_border_source_files = \
+classpath/javax/swing/border/AbstractBorder.java \
+classpath/javax/swing/border/BevelBorder.java \
+classpath/javax/swing/border/Border.java \
+classpath/javax/swing/border/CompoundBorder.java \
+classpath/javax/swing/border/EmptyBorder.java \
+classpath/javax/swing/border/EtchedBorder.java \
+classpath/javax/swing/border/LineBorder.java \
+classpath/javax/swing/border/MatteBorder.java \
+classpath/javax/swing/border/SoftBevelBorder.java \
+classpath/javax/swing/border/TitledBorder.java
+
+javax_swing_border_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_border_source_files)))
+
+javax/swing/border.list: $(javax_swing_border_source_files)
+ @for file in $(javax_swing_border_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/border.list
+
+-include javax/swing/border.deps
+
+
+javax_swing_colorchooser_source_files = \
+classpath/javax/swing/colorchooser/AbstractColorChooserPanel.java \
+classpath/javax/swing/colorchooser/ColorChooserComponentFactory.java \
+classpath/javax/swing/colorchooser/ColorSelectionModel.java \
+classpath/javax/swing/colorchooser/DefaultColorSelectionModel.java \
+classpath/javax/swing/colorchooser/DefaultHSBChooserPanel.java \
+classpath/javax/swing/colorchooser/DefaultPreviewPanel.java \
+classpath/javax/swing/colorchooser/DefaultRGBChooserPanel.java \
+classpath/javax/swing/colorchooser/DefaultSwatchChooserPanel.java
+
+javax_swing_colorchooser_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_colorchooser_source_files)))
+
+javax/swing/colorchooser.list: $(javax_swing_colorchooser_source_files)
+ @for file in $(javax_swing_colorchooser_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/colorchooser.list
+
+-include javax/swing/colorchooser.deps
+
+
+javax_swing_event_source_files = \
+classpath/javax/swing/event/AncestorEvent.java \
+classpath/javax/swing/event/AncestorListener.java \
+classpath/javax/swing/event/CaretEvent.java \
+classpath/javax/swing/event/CaretListener.java \
+classpath/javax/swing/event/CellEditorListener.java \
+classpath/javax/swing/event/ChangeEvent.java \
+classpath/javax/swing/event/ChangeListener.java \
+classpath/javax/swing/event/DocumentEvent.java \
+classpath/javax/swing/event/DocumentListener.java \
+classpath/javax/swing/event/EventListenerList.java \
+classpath/javax/swing/event/HyperlinkEvent.java \
+classpath/javax/swing/event/HyperlinkListener.java \
+classpath/javax/swing/event/InternalFrameAdapter.java \
+classpath/javax/swing/event/InternalFrameEvent.java \
+classpath/javax/swing/event/InternalFrameListener.java \
+classpath/javax/swing/event/ListDataEvent.java \
+classpath/javax/swing/event/ListDataListener.java \
+classpath/javax/swing/event/ListSelectionEvent.java \
+classpath/javax/swing/event/ListSelectionListener.java \
+classpath/javax/swing/event/MenuDragMouseEvent.java \
+classpath/javax/swing/event/MenuDragMouseListener.java \
+classpath/javax/swing/event/MenuEvent.java \
+classpath/javax/swing/event/MenuKeyEvent.java \
+classpath/javax/swing/event/MenuKeyListener.java \
+classpath/javax/swing/event/MenuListener.java \
+classpath/javax/swing/event/MouseInputAdapter.java \
+classpath/javax/swing/event/MouseInputListener.java \
+classpath/javax/swing/event/PopupMenuEvent.java \
+classpath/javax/swing/event/PopupMenuListener.java \
+classpath/javax/swing/event/SwingPropertyChangeSupport.java \
+classpath/javax/swing/event/TableColumnModelEvent.java \
+classpath/javax/swing/event/TableColumnModelListener.java \
+classpath/javax/swing/event/TableModelEvent.java \
+classpath/javax/swing/event/TableModelListener.java \
+classpath/javax/swing/event/TreeExpansionEvent.java \
+classpath/javax/swing/event/TreeExpansionListener.java \
+classpath/javax/swing/event/TreeModelEvent.java \
+classpath/javax/swing/event/TreeModelListener.java \
+classpath/javax/swing/event/TreeSelectionEvent.java \
+classpath/javax/swing/event/TreeSelectionListener.java \
+classpath/javax/swing/event/TreeWillExpandListener.java \
+classpath/javax/swing/event/UndoableEditEvent.java \
+classpath/javax/swing/event/UndoableEditListener.java
+
+javax_swing_event_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_event_source_files)))
+
+javax/swing/event.list: $(javax_swing_event_source_files)
+ @for file in $(javax_swing_event_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/event.list
+
+-include javax/swing/event.deps
+
+
+javax_swing_filechooser_source_files = \
+classpath/javax/swing/filechooser/FileFilter.java \
+classpath/javax/swing/filechooser/FileSystemView.java \
+classpath/javax/swing/filechooser/FileView.java \
+classpath/javax/swing/filechooser/UnixFileSystemView.java
+
+javax_swing_filechooser_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_filechooser_source_files)))
+
+javax/swing/filechooser.list: $(javax_swing_filechooser_source_files)
+ @for file in $(javax_swing_filechooser_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/filechooser.list
+
+-include javax/swing/filechooser.deps
+
+
+javax_swing_plaf_source_files = \
+classpath/javax/swing/plaf/ActionMapUIResource.java \
+classpath/javax/swing/plaf/BorderUIResource.java \
+classpath/javax/swing/plaf/ButtonUI.java \
+classpath/javax/swing/plaf/ColorChooserUI.java \
+classpath/javax/swing/plaf/ColorUIResource.java \
+classpath/javax/swing/plaf/ComboBoxUI.java \
+classpath/javax/swing/plaf/ComponentInputMapUIResource.java \
+classpath/javax/swing/plaf/ComponentUI.java \
+classpath/javax/swing/plaf/DesktopIconUI.java \
+classpath/javax/swing/plaf/DesktopPaneUI.java \
+classpath/javax/swing/plaf/DimensionUIResource.java \
+classpath/javax/swing/plaf/FileChooserUI.java \
+classpath/javax/swing/plaf/FontUIResource.java \
+classpath/javax/swing/plaf/IconUIResource.java \
+classpath/javax/swing/plaf/InputMapUIResource.java \
+classpath/javax/swing/plaf/InsetsUIResource.java \
+classpath/javax/swing/plaf/InternalFrameUI.java \
+classpath/javax/swing/plaf/LabelUI.java \
+classpath/javax/swing/plaf/ListUI.java \
+classpath/javax/swing/plaf/MenuBarUI.java \
+classpath/javax/swing/plaf/MenuItemUI.java \
+classpath/javax/swing/plaf/OptionPaneUI.java \
+classpath/javax/swing/plaf/PanelUI.java \
+classpath/javax/swing/plaf/PopupMenuUI.java \
+classpath/javax/swing/plaf/ProgressBarUI.java \
+classpath/javax/swing/plaf/RootPaneUI.java \
+classpath/javax/swing/plaf/ScrollBarUI.java \
+classpath/javax/swing/plaf/ScrollPaneUI.java \
+classpath/javax/swing/plaf/SeparatorUI.java \
+classpath/javax/swing/plaf/SliderUI.java \
+classpath/javax/swing/plaf/SpinnerUI.java \
+classpath/javax/swing/plaf/SplitPaneUI.java \
+classpath/javax/swing/plaf/TabbedPaneUI.java \
+classpath/javax/swing/plaf/TableHeaderUI.java \
+classpath/javax/swing/plaf/TableUI.java \
+classpath/javax/swing/plaf/TextUI.java \
+classpath/javax/swing/plaf/ToolBarUI.java \
+classpath/javax/swing/plaf/ToolTipUI.java \
+classpath/javax/swing/plaf/TreeUI.java \
+classpath/javax/swing/plaf/UIResource.java \
+classpath/javax/swing/plaf/ViewportUI.java
+
+javax_swing_plaf_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_plaf_source_files)))
+
+javax/swing/plaf.list: $(javax_swing_plaf_source_files)
+ @for file in $(javax_swing_plaf_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/plaf.list
+
+-include javax/swing/plaf.deps
+
+
+javax_swing_plaf_basic_source_files = \
+classpath/javax/swing/plaf/basic/BasicArrowButton.java \
+classpath/javax/swing/plaf/basic/BasicBorders.java \
+classpath/javax/swing/plaf/basic/BasicButtonListener.java \
+classpath/javax/swing/plaf/basic/BasicButtonUI.java \
+classpath/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java \
+classpath/javax/swing/plaf/basic/BasicCheckBoxUI.java \
+classpath/javax/swing/plaf/basic/BasicColorChooserUI.java \
+classpath/javax/swing/plaf/basic/BasicComboBoxEditor.java \
+classpath/javax/swing/plaf/basic/BasicComboBoxRenderer.java \
+classpath/javax/swing/plaf/basic/BasicComboBoxUI.java \
+classpath/javax/swing/plaf/basic/BasicComboPopup.java \
+classpath/javax/swing/plaf/basic/BasicDesktopIconUI.java \
+classpath/javax/swing/plaf/basic/BasicDesktopPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicDirectoryModel.java \
+classpath/javax/swing/plaf/basic/BasicEditorPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicFileChooserUI.java \
+classpath/javax/swing/plaf/basic/BasicFormattedTextFieldUI.java \
+classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java \
+classpath/javax/swing/plaf/basic/BasicIconFactory.java \
+classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java \
+classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java \
+classpath/javax/swing/plaf/basic/BasicLabelUI.java \
+classpath/javax/swing/plaf/basic/BasicListUI.java \
+classpath/javax/swing/plaf/basic/BasicLookAndFeel.java \
+classpath/javax/swing/plaf/basic/BasicMenuBarUI.java \
+classpath/javax/swing/plaf/basic/BasicMenuItemUI.java \
+classpath/javax/swing/plaf/basic/BasicMenuUI.java \
+classpath/javax/swing/plaf/basic/BasicOptionPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicPanelUI.java \
+classpath/javax/swing/plaf/basic/BasicPasswordFieldUI.java \
+classpath/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java \
+classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java \
+classpath/javax/swing/plaf/basic/BasicProgressBarUI.java \
+classpath/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java \
+classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java \
+classpath/javax/swing/plaf/basic/BasicRootPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicScrollBarUI.java \
+classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicSeparatorUI.java \
+classpath/javax/swing/plaf/basic/BasicSliderUI.java \
+classpath/javax/swing/plaf/basic/BasicSpinnerUI.java \
+classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java \
+classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java \
+classpath/javax/swing/plaf/basic/BasicTableUI.java \
+classpath/javax/swing/plaf/basic/BasicTextAreaUI.java \
+classpath/javax/swing/plaf/basic/BasicTextFieldUI.java \
+classpath/javax/swing/plaf/basic/BasicTextPaneUI.java \
+classpath/javax/swing/plaf/basic/BasicTextUI.java \
+classpath/javax/swing/plaf/basic/BasicToggleButtonUI.java \
+classpath/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java \
+classpath/javax/swing/plaf/basic/BasicToolBarUI.java \
+classpath/javax/swing/plaf/basic/BasicToolTipUI.java \
+classpath/javax/swing/plaf/basic/BasicTreeUI.java \
+classpath/javax/swing/plaf/basic/BasicViewportUI.java \
+classpath/javax/swing/plaf/basic/ComboPopup.java \
+classpath/javax/swing/plaf/basic/DefaultMenuLayout.java
+
+javax_swing_plaf_basic_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_plaf_basic_source_files)))
+
+javax/swing/plaf/basic.list: $(javax_swing_plaf_basic_source_files)
+ @for file in $(javax_swing_plaf_basic_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/plaf/basic.list
+
+-include javax/swing/plaf/basic.deps
+
+
+javax_swing_plaf_metal_source_files = \
+classpath/javax/swing/plaf/metal/DefaultMetalTheme.java \
+classpath/javax/swing/plaf/metal/MetalBorders.java \
+classpath/javax/swing/plaf/metal/MetalButtonUI.java \
+classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java \
+classpath/javax/swing/plaf/metal/MetalCheckBoxUI.java \
+classpath/javax/swing/plaf/metal/MetalComboBoxIcon.java \
+classpath/javax/swing/plaf/metal/MetalComboBoxUI.java \
+classpath/javax/swing/plaf/metal/MetalDesktopIconUI.java \
+classpath/javax/swing/plaf/metal/MetalIconFactory.java \
+classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java \
+classpath/javax/swing/plaf/metal/MetalLabelUI.java \
+classpath/javax/swing/plaf/metal/MetalLookAndFeel.java \
+classpath/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java \
+classpath/javax/swing/plaf/metal/MetalProgressBarUI.java \
+classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java \
+classpath/javax/swing/plaf/metal/MetalRootPaneUI.java \
+classpath/javax/swing/plaf/metal/MetalScrollBarUI.java \
+classpath/javax/swing/plaf/metal/MetalScrollPaneUI.java \
+classpath/javax/swing/plaf/metal/MetalSeparatorUI.java \
+classpath/javax/swing/plaf/metal/MetalSliderUI.java \
+classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java \
+classpath/javax/swing/plaf/metal/MetalSplitPaneUI.java \
+classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java \
+classpath/javax/swing/plaf/metal/MetalTextFieldUI.java \
+classpath/javax/swing/plaf/metal/MetalTheme.java \
+classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java \
+classpath/javax/swing/plaf/metal/MetalToolBarUI.java \
+classpath/javax/swing/plaf/metal/MetalToolTipUI.java \
+classpath/javax/swing/plaf/metal/MetalTreeUI.java \
+classpath/javax/swing/plaf/metal/MetalUtils.java
+
+javax_swing_plaf_metal_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_plaf_metal_source_files)))
+
+javax/swing/plaf/metal.list: $(javax_swing_plaf_metal_source_files)
+ @for file in $(javax_swing_plaf_metal_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/plaf/metal.list
+
+-include javax/swing/plaf/metal.deps
+
+
+javax_swing_table_source_files = \
+classpath/javax/swing/table/AbstractTableModel.java \
+classpath/javax/swing/table/DefaultTableCellRenderer.java \
+classpath/javax/swing/table/DefaultTableColumnModel.java \
+classpath/javax/swing/table/DefaultTableModel.java \
+classpath/javax/swing/table/JTableHeader.java \
+classpath/javax/swing/table/TableCellEditor.java \
+classpath/javax/swing/table/TableCellRenderer.java \
+classpath/javax/swing/table/TableColumn.java \
+classpath/javax/swing/table/TableColumnModel.java \
+classpath/javax/swing/table/TableModel.java
+
+javax_swing_table_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_table_source_files)))
+
+javax/swing/table.list: $(javax_swing_table_source_files)
+ @for file in $(javax_swing_table_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/table.list
+
+-include javax/swing/table.deps
+
+
+javax_swing_text_source_files = \
+classpath/javax/swing/text/AbstractDocument.java \
+classpath/javax/swing/text/AttributeSet.java \
+classpath/javax/swing/text/BadLocationException.java \
+classpath/javax/swing/text/Caret.java \
+classpath/javax/swing/text/ChangedCharSetException.java \
+classpath/javax/swing/text/ComponentView.java \
+classpath/javax/swing/text/DateFormatter.java \
+classpath/javax/swing/text/DefaultCaret.java \
+classpath/javax/swing/text/DefaultEditorKit.java \
+classpath/javax/swing/text/DefaultFormatter.java \
+classpath/javax/swing/text/DefaultHighlighter.java \
+classpath/javax/swing/text/DefaultStyledDocument.java \
+classpath/javax/swing/text/Document.java \
+classpath/javax/swing/text/DocumentFilter.java \
+classpath/javax/swing/text/EditorKit.java \
+classpath/javax/swing/text/Element.java \
+classpath/javax/swing/text/FieldView.java \
+classpath/javax/swing/text/GapContent.java \
+classpath/javax/swing/text/Highlighter.java \
+classpath/javax/swing/text/InternationalFormatter.java \
+classpath/javax/swing/text/JTextComponent.java \
+classpath/javax/swing/text/Keymap.java \
+classpath/javax/swing/text/LayeredHighlighter.java \
+classpath/javax/swing/text/MutableAttributeSet.java \
+classpath/javax/swing/text/NavigationFilter.java \
+classpath/javax/swing/text/PasswordView.java \
+classpath/javax/swing/text/PlainDocument.java \
+classpath/javax/swing/text/PlainView.java \
+classpath/javax/swing/text/Position.java \
+classpath/javax/swing/text/Segment.java \
+classpath/javax/swing/text/SimpleAttributeSet.java \
+classpath/javax/swing/text/StringContent.java \
+classpath/javax/swing/text/Style.java \
+classpath/javax/swing/text/StyleConstants.java \
+classpath/javax/swing/text/StyleContext.java \
+classpath/javax/swing/text/StyledDocument.java \
+classpath/javax/swing/text/StyledEditorKit.java \
+classpath/javax/swing/text/TabExpander.java \
+classpath/javax/swing/text/TabSet.java \
+classpath/javax/swing/text/TabStop.java \
+classpath/javax/swing/text/TabableView.java \
+classpath/javax/swing/text/TextAction.java \
+classpath/javax/swing/text/Utilities.java \
+classpath/javax/swing/text/View.java \
+classpath/javax/swing/text/ViewFactory.java
+
+javax_swing_text_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_text_source_files)))
+
+javax/swing/text.list: $(javax_swing_text_source_files)
+ @for file in $(javax_swing_text_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/text.list
+
+-include javax/swing/text.deps
+
+
+javax_swing_text_html_source_files = \
+classpath/javax/swing/text/html/HTML.java \
+classpath/javax/swing/text/html/HTMLDocument.java \
+classpath/javax/swing/text/html/HTMLEditorKit.java \
+classpath/javax/swing/text/html/HTMLFrameHyperlinkEvent.java
+
+javax_swing_text_html_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_text_html_source_files)))
+
+javax/swing/text/html.list: $(javax_swing_text_html_source_files)
+ @for file in $(javax_swing_text_html_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/text/html.list
+
+-include javax/swing/text/html.deps
+
+
+javax_swing_text_html_parser_source_files = \
+classpath/javax/swing/text/html/parser/AttributeList.java \
+classpath/javax/swing/text/html/parser/ContentModel.java \
+classpath/javax/swing/text/html/parser/DTD.java \
+classpath/javax/swing/text/html/parser/DTDConstants.java \
+classpath/javax/swing/text/html/parser/DocumentParser.java \
+classpath/javax/swing/text/html/parser/Element.java \
+classpath/javax/swing/text/html/parser/Entity.java \
+classpath/javax/swing/text/html/parser/Parser.java \
+classpath/javax/swing/text/html/parser/ParserDelegator.java \
+classpath/javax/swing/text/html/parser/TagElement.java
+
+javax_swing_text_html_parser_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_text_html_parser_source_files)))
+
+javax/swing/text/html/parser.list: $(javax_swing_text_html_parser_source_files)
+ @for file in $(javax_swing_text_html_parser_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/text/html/parser.list
+
+-include javax/swing/text/html/parser.deps
+
+
+javax_swing_text_rtf_source_files = \
+classpath/javax/swing/text/rtf/ControlWordToken.java \
+classpath/javax/swing/text/rtf/RTFEditorKit.java \
+classpath/javax/swing/text/rtf/RTFParseException.java \
+classpath/javax/swing/text/rtf/RTFParser.java \
+classpath/javax/swing/text/rtf/RTFScanner.java \
+classpath/javax/swing/text/rtf/TextToken.java \
+classpath/javax/swing/text/rtf/Token.java
+
+javax_swing_text_rtf_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_text_rtf_source_files)))
+
+javax/swing/text/rtf.list: $(javax_swing_text_rtf_source_files)
+ @for file in $(javax_swing_text_rtf_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/text/rtf.list
+
+-include javax/swing/text/rtf.deps
+
+
+javax_swing_tree_source_files = \
+classpath/javax/swing/tree/AbstractLayoutCache.java \
+classpath/javax/swing/tree/DefaultMutableTreeNode.java \
+classpath/javax/swing/tree/DefaultTreeCellEditor.java \
+classpath/javax/swing/tree/DefaultTreeCellRenderer.java \
+classpath/javax/swing/tree/DefaultTreeModel.java \
+classpath/javax/swing/tree/DefaultTreeSelectionModel.java \
+classpath/javax/swing/tree/ExpandVetoException.java \
+classpath/javax/swing/tree/FixedHeightLayoutCache.java \
+classpath/javax/swing/tree/MutableTreeNode.java \
+classpath/javax/swing/tree/RowMapper.java \
+classpath/javax/swing/tree/TreeCellEditor.java \
+classpath/javax/swing/tree/TreeCellRenderer.java \
+classpath/javax/swing/tree/TreeModel.java \
+classpath/javax/swing/tree/TreeNode.java \
+classpath/javax/swing/tree/TreePath.java \
+classpath/javax/swing/tree/TreeSelectionModel.java \
+classpath/javax/swing/tree/VariableHeightLayoutCache.java
+
+javax_swing_tree_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_tree_source_files)))
+
+javax/swing/tree.list: $(javax_swing_tree_source_files)
+ @for file in $(javax_swing_tree_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/tree.list
+
+-include javax/swing/tree.deps
+
+
+javax_swing_undo_source_files = \
+classpath/javax/swing/undo/AbstractUndoableEdit.java \
+classpath/javax/swing/undo/CannotRedoException.java \
+classpath/javax/swing/undo/CannotUndoException.java \
+classpath/javax/swing/undo/CompoundEdit.java \
+classpath/javax/swing/undo/StateEdit.java \
+classpath/javax/swing/undo/StateEditable.java \
+classpath/javax/swing/undo/UndoManager.java \
+classpath/javax/swing/undo/UndoableEdit.java \
+classpath/javax/swing/undo/UndoableEditSupport.java
+
+javax_swing_undo_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_undo_source_files)))
+
+javax/swing/undo.list: $(javax_swing_undo_source_files)
+ @for file in $(javax_swing_undo_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/swing/undo.list
+
+-include javax/swing/undo.deps
+
+
+javax_transaction_source_files = \
+classpath/javax/transaction/HeuristicCommitException.java \
+classpath/javax/transaction/HeuristicMixedException.java \
+classpath/javax/transaction/HeuristicRollbackException.java \
+classpath/javax/transaction/InvalidTransactionException.java \
+classpath/javax/transaction/NotSupportedException.java \
+classpath/javax/transaction/RollbackException.java \
+classpath/javax/transaction/Status.java \
+classpath/javax/transaction/Synchronization.java \
+classpath/javax/transaction/SystemException.java \
+classpath/javax/transaction/Transaction.java \
+classpath/javax/transaction/TransactionManager.java \
+classpath/javax/transaction/TransactionRequiredException.java \
+classpath/javax/transaction/TransactionRolledbackException.java \
+classpath/javax/transaction/UserTransaction.java
+
+javax_transaction_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_transaction_source_files)))
+
+javax/transaction.list: $(javax_transaction_source_files)
+ @for file in $(javax_transaction_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/transaction.list
+
+-include javax/transaction.deps
+
+
+javax_transaction_xa_source_files = \
+classpath/javax/transaction/xa/XAException.java \
+classpath/javax/transaction/xa/XAResource.java \
+classpath/javax/transaction/xa/Xid.java
+
+javax_transaction_xa_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_transaction_xa_source_files)))
+
+javax/transaction/xa.list: $(javax_transaction_xa_source_files)
+ @for file in $(javax_transaction_xa_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > javax/transaction/xa.list
+
+-include javax/transaction/xa.deps
+
+
+javax_xml_source_files = \
+classpath/javax/xml/XMLConstants.java \
+classpath/javax/xml/datatype/DatatypeConfigurationException.java \
+classpath/javax/xml/datatype/DatatypeConstants.java \
+classpath/javax/xml/datatype/DatatypeFactory.java \
+classpath/javax/xml/datatype/Duration.java \
+classpath/javax/xml/datatype/XMLGregorianCalendar.java \
+classpath/javax/xml/namespace/NamespaceContext.java \
+classpath/javax/xml/namespace/QName.java \
+classpath/javax/xml/parsers/DocumentBuilder.java \
+classpath/javax/xml/parsers/DocumentBuilderFactory.java \
+classpath/javax/xml/parsers/FactoryConfigurationError.java \
+classpath/javax/xml/parsers/ParserConfigurationException.java \
+classpath/javax/xml/parsers/SAXParser.java \
+classpath/javax/xml/parsers/SAXParserFactory.java \
+classpath/javax/xml/transform/ErrorListener.java \
+classpath/javax/xml/transform/OutputKeys.java \
+classpath/javax/xml/transform/Result.java \
+classpath/javax/xml/transform/Source.java \
+classpath/javax/xml/transform/SourceLocator.java \
+classpath/javax/xml/transform/Templates.java \
+classpath/javax/xml/transform/Transformer.java \
+classpath/javax/xml/transform/TransformerConfigurationException.java \
+classpath/javax/xml/transform/TransformerException.java \
+classpath/javax/xml/transform/TransformerFactory.java \
+classpath/javax/xml/transform/TransformerFactoryConfigurationError.java \
+classpath/javax/xml/transform/URIResolver.java \
+classpath/javax/xml/transform/dom/DOMLocator.java \
+classpath/javax/xml/transform/dom/DOMResult.java \
+classpath/javax/xml/transform/dom/DOMSource.java \
+classpath/javax/xml/transform/sax/SAXResult.java \
+classpath/javax/xml/transform/sax/SAXSource.java \
+classpath/javax/xml/transform/sax/SAXTransformerFactory.java \
+classpath/javax/xml/transform/sax/TemplatesHandler.java \
+classpath/javax/xml/transform/sax/TransformerHandler.java \
+classpath/javax/xml/transform/stream/StreamResult.java \
+classpath/javax/xml/transform/stream/StreamSource.java \
+classpath/javax/xml/validation/Schema.java \
+classpath/javax/xml/validation/SchemaFactory.java \
+classpath/javax/xml/validation/TypeInfoProvider.java \
+classpath/javax/xml/validation/Validator.java \
+classpath/javax/xml/validation/ValidatorHandler.java \
+classpath/javax/xml/xpath/XPath.java \
+classpath/javax/xml/xpath/XPathConstants.java \
+classpath/javax/xml/xpath/XPathException.java \
+classpath/javax/xml/xpath/XPathExpression.java \
+classpath/javax/xml/xpath/XPathExpressionException.java \
+classpath/javax/xml/xpath/XPathFactory.java \
+classpath/javax/xml/xpath/XPathFactoryConfigurationException.java \
+classpath/javax/xml/xpath/XPathFunction.java \
+classpath/javax/xml/xpath/XPathFunctionException.java \
+classpath/javax/xml/xpath/XPathFunctionResolver.java \
+classpath/javax/xml/xpath/XPathVariableResolver.java
+
+javax-xml.lo: $(javax_xml_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o javax-xml.lo \
+ `find classpath/lib/javax/xml -name '*.class' | sort -r`
+
+org_ietf_jgss_source_files = \
+classpath/org/ietf/jgss/ChannelBinding.java \
+classpath/org/ietf/jgss/GSSContext.java \
+classpath/org/ietf/jgss/GSSCredential.java \
+classpath/org/ietf/jgss/GSSException.java \
+classpath/org/ietf/jgss/GSSManager.java \
+classpath/org/ietf/jgss/GSSName.java \
+classpath/org/ietf/jgss/MessageProp.java \
+classpath/org/ietf/jgss/Oid.java
+
+org_ietf_jgss_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(org_ietf_jgss_source_files)))
+
+org/ietf/jgss.list: $(org_ietf_jgss_source_files)
+ @for file in $(org_ietf_jgss_source_files); do \
+ if test -f $(srcdir)/$$file; then \
+ echo $(srcdir)/$$file; \
+ else echo $$file; fi; \
+ done > org/ietf/jgss.list
+
+-include org/ietf/jgss.deps
+
+
+org_w3c_source_files = \
+classpath/external/w3c_dom/org/w3c/dom/Attr.java \
+classpath/external/w3c_dom/org/w3c/dom/CDATASection.java \
+classpath/external/w3c_dom/org/w3c/dom/CharacterData.java \
+classpath/external/w3c_dom/org/w3c/dom/Comment.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMConfiguration.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMError.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMErrorHandler.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMException.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMImplementation.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMImplementationList.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMImplementationSource.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMLocator.java \
+classpath/external/w3c_dom/org/w3c/dom/DOMStringList.java \
+classpath/external/w3c_dom/org/w3c/dom/Document.java \
+classpath/external/w3c_dom/org/w3c/dom/DocumentFragment.java \
+classpath/external/w3c_dom/org/w3c/dom/DocumentType.java \
+classpath/external/w3c_dom/org/w3c/dom/Element.java \
+classpath/external/w3c_dom/org/w3c/dom/Entity.java \
+classpath/external/w3c_dom/org/w3c/dom/EntityReference.java \
+classpath/external/w3c_dom/org/w3c/dom/NameList.java \
+classpath/external/w3c_dom/org/w3c/dom/NamedNodeMap.java \
+classpath/external/w3c_dom/org/w3c/dom/Node.java \
+classpath/external/w3c_dom/org/w3c/dom/NodeList.java \
+classpath/external/w3c_dom/org/w3c/dom/Notation.java \
+classpath/external/w3c_dom/org/w3c/dom/ProcessingInstruction.java \
+classpath/external/w3c_dom/org/w3c/dom/Text.java \
+classpath/external/w3c_dom/org/w3c/dom/TypeInfo.java \
+classpath/external/w3c_dom/org/w3c/dom/UserDataHandler.java \
+classpath/external/w3c_dom/org/w3c/dom/bootstrap/DOMImplementationRegistry.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSS2Properties.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSCharsetRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSFontFaceRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSImportRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSMediaRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSPageRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSPrimitiveValue.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSRuleList.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSStyleDeclaration.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSStyleRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSStyleSheet.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSUnknownRule.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSValue.java \
+classpath/external/w3c_dom/org/w3c/dom/css/CSSValueList.java \
+classpath/external/w3c_dom/org/w3c/dom/css/Counter.java \
+classpath/external/w3c_dom/org/w3c/dom/css/DOMImplementationCSS.java \
+classpath/external/w3c_dom/org/w3c/dom/css/DocumentCSS.java \
+classpath/external/w3c_dom/org/w3c/dom/css/ElementCSSInlineStyle.java \
+classpath/external/w3c_dom/org/w3c/dom/css/RGBColor.java \
+classpath/external/w3c_dom/org/w3c/dom/css/Rect.java \
+classpath/external/w3c_dom/org/w3c/dom/css/ViewCSS.java \
+classpath/external/w3c_dom/org/w3c/dom/events/DocumentEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/events/Event.java \
+classpath/external/w3c_dom/org/w3c/dom/events/EventException.java \
+classpath/external/w3c_dom/org/w3c/dom/events/EventListener.java \
+classpath/external/w3c_dom/org/w3c/dom/events/EventTarget.java \
+classpath/external/w3c_dom/org/w3c/dom/events/MouseEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/events/MutationEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/events/UIEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLAnchorElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLAppletElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLAreaElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLBRElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLBaseElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLBaseFontElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLBodyElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLButtonElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLCollection.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLDListElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLDirectoryElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLDivElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLDocument.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLFieldSetElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLFontElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLFormElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLFrameElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLFrameSetElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLHRElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLHeadElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLHeadingElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLHtmlElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLIFrameElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLImageElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLInputElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLIsIndexElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLLIElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLLabelElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLLegendElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLLinkElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLMapElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLMenuElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLMetaElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLModElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLOListElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLObjectElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLOptGroupElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLOptionElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLOptionsCollection.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLParagraphElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLParamElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLPreElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLQuoteElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLScriptElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLSelectElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLStyleElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableCaptionElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableCellElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableColElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableRowElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTableSectionElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTextAreaElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLTitleElement.java \
+classpath/external/w3c_dom/org/w3c/dom/html2/HTMLUListElement.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/DOMImplementationLS.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSException.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSInput.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSLoadEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSOutput.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSParser.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSParserFilter.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSProgressEvent.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSResourceResolver.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSSerializer.java \
+classpath/external/w3c_dom/org/w3c/dom/ls/LSSerializerFilter.java \
+classpath/external/w3c_dom/org/w3c/dom/ranges/DocumentRange.java \
+classpath/external/w3c_dom/org/w3c/dom/ranges/Range.java \
+classpath/external/w3c_dom/org/w3c/dom/ranges/RangeException.java \
+classpath/external/w3c_dom/org/w3c/dom/stylesheets/DocumentStyle.java \
+classpath/external/w3c_dom/org/w3c/dom/stylesheets/LinkStyle.java \
+classpath/external/w3c_dom/org/w3c/dom/stylesheets/MediaList.java \
+classpath/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheet.java \
+classpath/external/w3c_dom/org/w3c/dom/stylesheets/StyleSheetList.java \
+classpath/external/w3c_dom/org/w3c/dom/traversal/DocumentTraversal.java \
+classpath/external/w3c_dom/org/w3c/dom/traversal/NodeFilter.java \
+classpath/external/w3c_dom/org/w3c/dom/traversal/NodeIterator.java \
+classpath/external/w3c_dom/org/w3c/dom/traversal/TreeWalker.java \
+classpath/external/w3c_dom/org/w3c/dom/views/AbstractView.java \
+classpath/external/w3c_dom/org/w3c/dom/views/DocumentView.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathEvaluator.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathException.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathExpression.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathNSResolver.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathNamespace.java \
+classpath/external/w3c_dom/org/w3c/dom/xpath/XPathResult.java
+
+org-w3c.lo: $(org_w3c_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o org-w3c.lo \
+ `find classpath/lib/org/w3c -name '*.class' | sort -r`
+
+org_xml_source_files = \
+classpath/external/sax/org/xml/sax/AttributeList.java \
+classpath/external/sax/org/xml/sax/Attributes.java \
+classpath/external/sax/org/xml/sax/ContentHandler.java \
+classpath/external/sax/org/xml/sax/DTDHandler.java \
+classpath/external/sax/org/xml/sax/DocumentHandler.java \
+classpath/external/sax/org/xml/sax/EntityResolver.java \
+classpath/external/sax/org/xml/sax/ErrorHandler.java \
+classpath/external/sax/org/xml/sax/HandlerBase.java \
+classpath/external/sax/org/xml/sax/InputSource.java \
+classpath/external/sax/org/xml/sax/Locator.java \
+classpath/external/sax/org/xml/sax/Parser.java \
+classpath/external/sax/org/xml/sax/SAXException.java \
+classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java \
+classpath/external/sax/org/xml/sax/SAXNotSupportedException.java \
+classpath/external/sax/org/xml/sax/SAXParseException.java \
+classpath/external/sax/org/xml/sax/XMLFilter.java \
+classpath/external/sax/org/xml/sax/XMLReader.java \
+classpath/external/sax/org/xml/sax/ext/Attributes2.java \
+classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java \
+classpath/external/sax/org/xml/sax/ext/DeclHandler.java \
+classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java \
+classpath/external/sax/org/xml/sax/ext/EntityResolver2.java \
+classpath/external/sax/org/xml/sax/ext/LexicalHandler.java \
+classpath/external/sax/org/xml/sax/ext/Locator2.java \
+classpath/external/sax/org/xml/sax/ext/Locator2Impl.java \
+classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java \
+classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java \
+classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java \
+classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java \
+classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java \
+classpath/external/sax/org/xml/sax/helpers/NewInstance.java \
+classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java \
+classpath/external/sax/org/xml/sax/helpers/ParserFactory.java \
+classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java \
+classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java \
+classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java
+
+org-xml.lo: $(org_xml_source_files)
+ $(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o org-xml.lo \
+ `find classpath/lib/org/xml -name '*.class' | sort -r`
+
+
+all_packages_source_files = \
+ gnu/awt.list \
+ gnu/awt/j2d.list \
+ gnu/classpath.list \
+ gnu/classpath/debug.list \
+ gnu/gcj.list \
+ gnu/gcj/convert.list \
+ gnu/gcj/io.list \
+ gnu/gcj/runtime.list \
+ gnu/gcj/util.list \
+ gnu/java/awt.list \
+ gnu/java/awt/color.list \
+ gnu/java/awt/image.list \
+ gnu/java/awt/peer.list \
+ gnu/java/io.list \
+ gnu/java/lang.list \
+ gnu/java/lang/reflect.list \
+ gnu/java/locale.list \
+ gnu/java/math.list \
+ gnu/java/net.list \
+ gnu/java/net/protocol/file.list \
+ gnu/java/net/protocol/ftp.list \
+ gnu/java/net/protocol/http.list \
+ gnu/java/net/protocol/http/event.list \
+ gnu/java/net/protocol/https.list \
+ gnu/java/net/protocol/jar.list \
+ gnu/java/nio.list \
+ gnu/java/nio/channels.list \
+ gnu/java/nio/charset.list \
+ gnu/java/rmi.list \
+ gnu/java/rmi/dgc.list \
+ gnu/java/rmi/registry.list \
+ gnu/java/rmi/server.list \
+ gnu/java/security.list \
+ gnu/java/security/action.list \
+ gnu/java/security/ber.list \
+ gnu/java/security/der.list \
+ gnu/java/security/pkcs.list \
+ gnu/java/security/provider.list \
+ gnu/java/security/util.list \
+ gnu/java/security/x509.list \
+ gnu/java/security/x509/ext.list \
+ gnu/java/text.list \
+ gnu/java/util.list \
+ gnu/java/util/prefs.list \
+ gnu/javax/swing/text/html/parser.list \
+ gnu/javax/swing/text/html/parser/models.list \
+ gnu/javax/swing/text/html/parser/support.list \
+ gnu/javax/swing/text/html/parser/support/low.list \
+ gnu/regexp.list \
+ java/applet.list \
+ java/awt.list \
+ java/awt/color.list \
+ java/awt/datatransfer.list \
+ java/awt/dnd.list \
+ java/awt/dnd/peer.list \
+ java/awt/event.list \
+ java/awt/font.list \
+ java/awt/geom.list \
+ java/awt/im.list \
+ java/awt/im/spi.list \
+ java/awt/image.list \
+ java/awt/image/renderable.list \
+ java/awt/peer.list \
+ java/awt/print.list \
+ java/beans.list \
+ java/beans/beancontext.list \
+ java/io.list \
+ java/lang.list \
+ java/lang/annotation.list \
+ java/lang/ref.list \
+ java/lang/reflect.list \
+ java/math.list \
+ java/net.list \
+ java/nio.list \
+ java/nio/channels.list \
+ java/nio/channels/spi.list \
+ java/nio/charset.list \
+ java/nio/charset/spi.list \
+ java/rmi.list \
+ java/rmi/activation.list \
+ java/rmi/dgc.list \
+ java/rmi/registry.list \
+ java/rmi/server.list \
+ java/security.list \
+ java/security/acl.list \
+ java/security/cert.list \
+ java/security/interfaces.list \
+ java/security/spec.list \
+ java/sql.list \
+ java/text.list \
+ java/util.list \
+ java/util/jar.list \
+ java/util/logging.list \
+ java/util/prefs.list \
+ java/util/regex.list \
+ java/util/zip.list \
+ javax/accessibility.list \
+ javax/crypto.list \
+ javax/crypto/interfaces.list \
+ javax/crypto/spec.list \
+ javax/naming.list \
+ javax/naming/directory.list \
+ javax/naming/event.list \
+ javax/naming/ldap.list \
+ javax/naming/spi.list \
+ javax/net.list \
+ javax/net/ssl.list \
+ javax/print.list \
+ javax/print/attribute.list \
+ javax/print/attribute/standard.list \
+ javax/print/event.list \
+ javax/security/auth.list \
+ javax/security/auth/callback.list \
+ javax/security/auth/login.list \
+ javax/security/auth/spi.list \
+ javax/security/auth/x500.list \
+ javax/security/cert.list \
+ javax/security/sasl.list \
+ javax/sql.list \
+ javax/swing.list \
+ javax/swing/border.list \
+ javax/swing/colorchooser.list \
+ javax/swing/event.list \
+ javax/swing/filechooser.list \
+ javax/swing/plaf.list \
+ javax/swing/plaf/basic.list \
+ javax/swing/plaf/metal.list \
+ javax/swing/table.list \
+ javax/swing/text.list \
+ javax/swing/text/html.list \
+ javax/swing/text/html/parser.list \
+ javax/swing/text/rtf.list \
+ javax/swing/tree.list \
+ javax/swing/undo.list \
+ javax/transaction.list \
+ javax/transaction/xa.list \
+ org/ietf/jgss.list
+
+ordinary_header_files = \
+ $(gnu_awt_header_files) \
+ $(gnu_awt_j2d_header_files) \
+ $(gnu_classpath_header_files) \
+ $(gnu_classpath_debug_header_files) \
+ $(gnu_gcj_header_files) \
+ $(gnu_gcj_convert_header_files) \
+ $(gnu_gcj_io_header_files) \
+ $(gnu_gcj_runtime_header_files) \
+ $(gnu_gcj_util_header_files) \
+ $(gnu_java_awt_header_files) \
+ $(gnu_java_awt_color_header_files) \
+ $(gnu_java_awt_image_header_files) \
+ $(gnu_java_awt_peer_header_files) \
+ $(gnu_java_io_header_files) \
+ $(gnu_java_lang_header_files) \
+ $(gnu_java_lang_reflect_header_files) \
+ $(gnu_java_locale_header_files) \
+ $(gnu_java_math_header_files) \
+ $(gnu_java_net_header_files) \
+ $(gnu_java_net_protocol_file_header_files) \
+ $(gnu_java_net_protocol_ftp_header_files) \
+ $(gnu_java_net_protocol_http_header_files) \
+ $(gnu_java_net_protocol_http_event_header_files) \
+ $(gnu_java_net_protocol_https_header_files) \
+ $(gnu_java_net_protocol_jar_header_files) \
+ $(gnu_java_nio_header_files) \
+ $(gnu_java_nio_channels_header_files) \
+ $(gnu_java_nio_charset_header_files) \
+ $(gnu_java_rmi_header_files) \
+ $(gnu_java_rmi_dgc_header_files) \
+ $(gnu_java_rmi_registry_header_files) \
+ $(gnu_java_rmi_server_header_files) \
+ $(gnu_java_security_header_files) \
+ $(gnu_java_security_action_header_files) \
+ $(gnu_java_security_ber_header_files) \
+ $(gnu_java_security_der_header_files) \
+ $(gnu_java_security_pkcs_header_files) \
+ $(gnu_java_security_provider_header_files) \
+ $(gnu_java_security_util_header_files) \
+ $(gnu_java_security_x509_header_files) \
+ $(gnu_java_security_x509_ext_header_files) \
+ $(gnu_java_text_header_files) \
+ $(gnu_java_util_header_files) \
+ $(gnu_java_util_prefs_header_files) \
+ $(gnu_javax_swing_text_html_parser_header_files) \
+ $(gnu_javax_swing_text_html_parser_models_header_files) \
+ $(gnu_javax_swing_text_html_parser_support_header_files) \
+ $(gnu_javax_swing_text_html_parser_support_low_header_files) \
+ $(gnu_regexp_header_files) \
+ $(java_applet_header_files) \
+ $(java_awt_header_files) \
+ $(java_awt_color_header_files) \
+ $(java_awt_datatransfer_header_files) \
+ $(java_awt_dnd_header_files) \
+ $(java_awt_dnd_peer_header_files) \
+ $(java_awt_event_header_files) \
+ $(java_awt_font_header_files) \
+ $(java_awt_geom_header_files) \
+ $(java_awt_im_header_files) \
+ $(java_awt_im_spi_header_files) \
+ $(java_awt_image_header_files) \
+ $(java_awt_image_renderable_header_files) \
+ $(java_awt_peer_header_files) \
+ $(java_awt_print_header_files) \
+ $(java_beans_header_files) \
+ $(java_beans_beancontext_header_files) \
+ $(java_io_header_files) \
+ $(java_lang_header_files) \
+ $(java_lang_annotation_header_files) \
+ $(java_lang_ref_header_files) \
+ $(java_lang_reflect_header_files) \
+ $(java_math_header_files) \
+ $(java_net_header_files) \
+ $(java_nio_header_files) \
+ $(java_nio_channels_header_files) \
+ $(java_nio_channels_spi_header_files) \
+ $(java_nio_charset_header_files) \
+ $(java_nio_charset_spi_header_files) \
+ $(java_rmi_header_files) \
+ $(java_rmi_activation_header_files) \
+ $(java_rmi_dgc_header_files) \
+ $(java_rmi_registry_header_files) \
+ $(java_rmi_server_header_files) \
+ $(java_security_header_files) \
+ $(java_security_acl_header_files) \
+ $(java_security_cert_header_files) \
+ $(java_security_interfaces_header_files) \
+ $(java_security_spec_header_files) \
+ $(java_sql_header_files) \
+ $(java_text_header_files) \
+ $(java_util_header_files) \
+ $(java_util_jar_header_files) \
+ $(java_util_logging_header_files) \
+ $(java_util_prefs_header_files) \
+ $(java_util_regex_header_files) \
+ $(java_util_zip_header_files) \
+ $(javax_accessibility_header_files) \
+ $(javax_crypto_header_files) \
+ $(javax_crypto_interfaces_header_files) \
+ $(javax_crypto_spec_header_files) \
+ $(javax_naming_header_files) \
+ $(javax_naming_directory_header_files) \
+ $(javax_naming_event_header_files) \
+ $(javax_naming_ldap_header_files) \
+ $(javax_naming_spi_header_files) \
+ $(javax_net_header_files) \
+ $(javax_net_ssl_header_files) \
+ $(javax_print_header_files) \
+ $(javax_print_attribute_header_files) \
+ $(javax_print_attribute_standard_header_files) \
+ $(javax_print_event_header_files) \
+ $(javax_security_auth_header_files) \
+ $(javax_security_auth_callback_header_files) \
+ $(javax_security_auth_login_header_files) \
+ $(javax_security_auth_spi_header_files) \
+ $(javax_security_auth_x500_header_files) \
+ $(javax_security_cert_header_files) \
+ $(javax_security_sasl_header_files) \
+ $(javax_sql_header_files) \
+ $(javax_swing_header_files) \
+ $(javax_swing_border_header_files) \
+ $(javax_swing_colorchooser_header_files) \
+ $(javax_swing_event_header_files) \
+ $(javax_swing_filechooser_header_files) \
+ $(javax_swing_plaf_header_files) \
+ $(javax_swing_plaf_basic_header_files) \
+ $(javax_swing_plaf_metal_header_files) \
+ $(javax_swing_table_header_files) \
+ $(javax_swing_text_header_files) \
+ $(javax_swing_text_html_header_files) \
+ $(javax_swing_text_html_parser_header_files) \
+ $(javax_swing_text_rtf_header_files) \
+ $(javax_swing_tree_header_files) \
+ $(javax_swing_undo_header_files) \
+ $(javax_transaction_header_files) \
+ $(javax_transaction_xa_header_files) \
+ $(org_ietf_jgss_header_files)
+
+bc_objects = \
+ gnu-java-beans.lo \
+ gnu-xml.lo \
+ javax-imageio.lo \
+ javax-xml.lo \
+ org-w3c.lo \
+ org-xml.lo
diff --git a/libjava/standard.omit b/libjava/standard.omit
new file mode 100644
index 00000000000..738f39bc593
--- /dev/null
+++ b/libjava/standard.omit
@@ -0,0 +1,21 @@
+java/lang/EcosProcess.java
+java/lang/Win32Process.java
+java/lang/PosixProcess.java
+gnu/java/awt/peer/gtk/Test.java
+gnu/java/awt/peer/gtk/TestAWT.java
+javax/rmi
+org/omg
+gnu/CORBA
+gnu/javax/rmi
+gnu/java/nio/charset/iconv
+java/util/zip/DeflaterConstants.java
+java/util/zip/DeflaterEngine.java
+java/util/zip/DeflaterHuffman.java
+java/util/zip/DeflaterPending.java
+java/util/zip/InflaterDynHeader.java
+java/util/zip/InflaterHuffmanTree.java
+java/util/zip/OutputWindow.java
+java/util/zip/PendingBuffer.java
+java/util/zip/StreamManipulator.java
+gnu/awt/xlib
+gnu/gcj/xlib
diff --git a/libjava/testsuite/Makefile.in b/libjava/testsuite/Makefile.in
index d3ddabf352f..f0e3b25af43 100644
--- a/libjava/testsuite/Makefile.in
+++ b/libjava/testsuite/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004 Free Software Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -40,14 +40,12 @@ subdir = testsuite
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
- $(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
$(top_srcdir)/../config/iconv.m4 \
$(top_srcdir)/../config/lcmessage.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
$(top_srcdir)/../config/lib-link.m4 \
- $(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
+ $(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
diff --git a/libjava/testsuite/libjava.jni/jni.exp b/libjava/testsuite/libjava.jni/jni.exp
index 84614260b0b..aa993b33127 100644
--- a/libjava/testsuite/libjava.jni/jni.exp
+++ b/libjava/testsuite/libjava.jni/jni.exp
@@ -36,8 +36,8 @@ proc gcj_jni_compile_c_to_so {file {options {}}} {
lappend options "additional_flags=-Wmissing-prototypes"
}
- # Find jni.h.
- lappend options "additional_flags=-I$srcdir/../include"
+ # Find jni.h and jni_md.h.
+ lappend options "additional_flags=-I$srcdir/../include -I$srcdir/../classpath/include"
# Append C++ options
lappend options "additional_flags=$options_cxx"
@@ -201,8 +201,8 @@ proc gcj_jni_invocation_compile_c_to_binary {file {options {}}} {
# Find the generated header.
lappend options "additional_flags=-I. -I.."
- # Find jni.h.
- lappend options "additional_flags=-I$srcdir/../include"
+ # Find jni.h and jni_md.h.
+ lappend options "additional_flags=-I$srcdir/../include -I$srcdir/../classpath/include"
# Append C++ options
lappend options "additional_flags=$options_cxx"